From 52f84ad6cfa96378342ace8abab7de60cd2a44b1 Mon Sep 17 00:00:00 2001 From: tajniak81 <13187254+tajniak81@users.noreply.github.com> Date: Mon, 13 Jul 2026 19:46:18 +0200 Subject: [PATCH] Add compliance & operational document store (PocketBase) Introduces a `documents` collection and full-stack UI for tracking pilot certificates, aircraft registrations, insurance, airspace authorisations, contracts, and other paperwork. - Migration 1720300800_add_documents.js (also provisioned live on remote PB): doc_type/owner/expiry/status/access_tier + file blob, a self-referential `replaces` version chain, audit fields, and a partial index on expiry_date. - API Server (documents.go): role-scoped CRUD, server-computed expiry assessment, ?expiring=N query, versioning (replaces -> version+1, old row auto-archived), and streamed blob download. admin.go gains multipart upload, file tokens, and protected-file streaming. - Web App: BFF passthrough (multipart create + streamed download), api.js client fns, and Documents.vue wired into the Documents nav slot. Blobs live in PocketBase file storage for now; only that backend swaps when S3-compatible object storage lands. Co-Authored-By: Claude Opus 4.8 --- API Server/internal/api/admin.go | 104 ++++ API Server/internal/api/documents.go | 572 ++++++++++++++++++ API Server/internal/api/server.go | 9 + .../pb_migrations/1720300800_add_documents.js | 171 ++++++ Web App/server/bff.go | 64 ++ Web App/server/dist/assets/index-B-aj3yVr.css | 1 + Web App/server/dist/assets/index-Bw9Fgeki.js | 20 + Web App/server/dist/assets/index-Co-T5CTN.css | 1 - Web App/server/dist/assets/index-DLbqB6QP.js | 20 - Web App/server/dist/index.html | 4 +- Web App/server/main.go | 6 + Web App/web/src/api.js | 48 ++ Web App/web/src/components/Dashboard.vue | 4 + Web App/web/src/components/Documents.vue | 480 +++++++++++++++ 14 files changed, 1481 insertions(+), 23 deletions(-) create mode 100644 API Server/internal/api/documents.go create mode 100644 API Server/pocketbase/pb_migrations/1720300800_add_documents.js create mode 100644 Web App/server/dist/assets/index-B-aj3yVr.css create mode 100644 Web App/server/dist/assets/index-Bw9Fgeki.js delete mode 100644 Web App/server/dist/assets/index-Co-T5CTN.css delete mode 100644 Web App/server/dist/assets/index-DLbqB6QP.js create mode 100644 Web App/web/src/components/Documents.vue diff --git a/API Server/internal/api/admin.go b/API Server/internal/api/admin.go index 7e38038..eac3d89 100644 --- a/API Server/internal/api/admin.go +++ b/API Server/internal/api/admin.go @@ -6,7 +6,9 @@ import ( "encoding/json" "errors" "io" + "mime/multipart" "net/http" + "net/url" "sync" "time" ) @@ -153,3 +155,105 @@ func (a *adminClient) do(ctx context.Context, method, path string, payload any) } return data, status, nil } + +// multipartFile is one file part for a multipart upload. +type multipartFile struct { + field string + filename string + data []byte +} + +// doMultipart performs an admin request with a multipart/form-data body (used to +// upload PocketBase file-field records). It mirrors do()'s self-healing re-auth: +// on a 401 it re-authenticates once and retries. The body is buffered so the +// retry can resend it. +func (a *adminClient) doMultipart(ctx context.Context, method, path string, fields map[string]string, files []multipartFile) ([]byte, int, error) { + var buf bytes.Buffer + mw := multipart.NewWriter(&buf) + for k, v := range fields { + if err := mw.WriteField(k, v); err != nil { + return nil, 0, err + } + } + for _, f := range files { + fw, err := mw.CreateFormFile(f.field, f.filename) + if err != nil { + return nil, 0, err + } + if _, err := fw.Write(f.data); err != nil { + return nil, 0, err + } + } + if err := mw.Close(); err != nil { + return nil, 0, err + } + contentType := mw.FormDataContentType() + body := buf.Bytes() + + token := a.cachedToken() + if token == "" { + var err error + if token, err = a.authenticate(ctx); err != nil { + return nil, 0, err + } + } + baseURL, _, _ := a.creds() + send := func(tok string) ([]byte, int, error) { + req, _ := http.NewRequestWithContext(ctx, method, baseURL+path, bytes.NewReader(body)) + req.Header.Set("Authorization", tok) + req.Header.Set("Content-Type", contentType) + resp, err := a.client.Do(req) + if err != nil { + return nil, 0, err + } + defer resp.Body.Close() + data, _ := io.ReadAll(resp.Body) + return data, resp.StatusCode, nil + } + data, status, err := send(token) + if err != nil { + return nil, 0, err + } + if status == http.StatusUnauthorized { + if token, err = a.authenticate(ctx); err != nil { + return nil, 0, err + } + return send(token) + } + return data, status, nil +} + +// fileToken mints a short-lived PocketBase file-access token so protected files +// (the documents collection's rules are locked) can be fetched by URL. +func (a *adminClient) fileToken(ctx context.Context) (string, error) { + data, status, err := a.do(ctx, http.MethodPost, "/api/files/token", nil) + if err != nil { + return "", err + } + if status != http.StatusOK { + return "", errors.New("file token request failed: " + string(data)) + } + var out struct { + Token string `json:"token"` + } + if err := json.Unmarshal(data, &out); err != nil || out.Token == "" { + return "", errors.New("file token: no token") + } + return out.Token, nil +} + +// streamFile fetches a stored file for a record and returns the raw upstream +// response so the caller can copy its headers + body to the client. The caller +// must Close the returned Body. +func (a *adminClient) streamFile(ctx context.Context, collection, recordID, filename string) (*http.Response, error) { + tok, err := a.fileToken(ctx) + if err != nil { + return nil, err + } + baseURL, _, _ := a.creds() + fileURL := baseURL + "/api/files/" + url.PathEscape(collection) + "/" + + url.PathEscape(recordID) + "/" + url.PathEscape(filename) + + "?token=" + url.QueryEscape(tok) + req, _ := http.NewRequestWithContext(ctx, http.MethodGet, fileURL, nil) + return a.client.Do(req) +} diff --git a/API Server/internal/api/documents.go b/API Server/internal/api/documents.go new file mode 100644 index 0000000..3f3627a --- /dev/null +++ b/API Server/internal/api/documents.go @@ -0,0 +1,572 @@ +package api + +import ( + "context" + "encoding/json" + "io" + "net/http" + "net/url" + "strconv" + "strings" + "time" +) + +// The document store holds PilotVault's compliance + operational paperwork — +// pilot certificates, aircraft registrations, insurance, airspace +// authorisations, contracts, and so on. Metadata is stored in the `documents` +// PocketBase collection; the blob itself is kept in PocketBase's file storage +// *for now* (the temporary stand-in for the S3-compatible object store this +// grows into). Like the logbook, every access flows through the superuser +// service account and per-role scoping is enforced here in Go. +// +// Scoping: +// - user → documents they uploaded, or that are about them (owner_pilot). +// - admin → all documents in their organization. +// - superadmin → everything. +// +// The highest-value behaviour is expiry alerting: each document carries an +// `expiry_date`, and the store computes a live expiry assessment (and a +// dedicated "expiring soon" query) so certs and registrations get flagged before +// they lapse. + +// soonDays is the default window (days) within which an upcoming expiry is +// surfaced as "expiring soon". +const soonDays = 30 + +// --------------------------------------------------------------------------- +// Record shapes (snake_case, as stored) + client-facing views. +// --------------------------------------------------------------------------- + +type documentRecord struct { + ID string `json:"id"` + Title string `json:"title"` + DocType string `json:"doc_type"` + OwnerType string `json:"owner_type"` + OwnerPilot string `json:"owner_pilot"` + OwnerDrone string `json:"owner_drone"` + OwnerRef string `json:"owner_ref"` + Reference string `json:"reference"` + Jurisdiction string `json:"jurisdiction"` + IssueDate string `json:"issue_date"` + ExpiryDate string `json:"expiry_date"` + Status string `json:"status"` + AccessTier string `json:"access_tier"` + File string `json:"file"` + Metadata json.RawMessage `json:"metadata"` + Notes string `json:"notes"` + Replaces string `json:"replaces"` + Version float64 `json:"version"` + UploadedBy string `json:"uploaded_by"` + Organization string `json:"organization"` + Created string `json:"created"` + Updated string `json:"updated"` +} + +type documentView struct { + ID string `json:"id"` + Title string `json:"title"` + DocType string `json:"docType"` + OwnerType string `json:"ownerType"` + OwnerPilot string `json:"ownerPilot"` + OwnerDrone string `json:"ownerDrone"` + OwnerDroneName string `json:"ownerDroneName"` + OwnerRef string `json:"ownerRef"` + Reference string `json:"reference"` + Jurisdiction string `json:"jurisdiction"` + IssueDate string `json:"issueDate"` + ExpiryDate string `json:"expiryDate"` + Status string `json:"status"` + AccessTier string `json:"accessTier"` + FileName string `json:"fileName"` + HasFile bool `json:"hasFile"` + Metadata json.RawMessage `json:"metadata,omitempty"` + Notes string `json:"notes"` + Replaces string `json:"replaces"` + Version int `json:"version"` + UploadedBy string `json:"uploadedBy"` + Organization string `json:"organization"` + Created string `json:"created"` + Updated string `json:"updated"` + Expiry expiryAssessment `json:"expiry"` +} + +// expiryAssessment is the server-computed lifecycle assessment for a document. +type expiryAssessment struct { + State string `json:"state"` // no_expiry | valid | expiring_soon | expired + Days *int `json:"daysUntilExpiry"` // nil when no expiry date + Flags []string `json:"flags"` // things worth surfacing +} + +func (d documentRecord) view(drones map[string]droneRecord, now time.Time) documentView { + droneName := "" + if d.OwnerDrone != "" { + if dr, ok := drones[d.OwnerDrone]; ok { + droneName = dr.Name + } + } + return documentView{ + ID: d.ID, Title: d.Title, DocType: d.DocType, OwnerType: d.OwnerType, + OwnerPilot: d.OwnerPilot, OwnerDrone: d.OwnerDrone, OwnerDroneName: droneName, + OwnerRef: d.OwnerRef, Reference: d.Reference, Jurisdiction: d.Jurisdiction, + IssueDate: day(d.IssueDate), ExpiryDate: day(d.ExpiryDate), Status: d.Status, + AccessTier: d.AccessTier, FileName: d.File, HasFile: d.File != "", + Metadata: d.Metadata, Notes: d.Notes, Replaces: d.Replaces, + Version: int(d.Version), UploadedBy: d.UploadedBy, Organization: d.Organization, + Created: d.Created, Updated: d.Updated, + Expiry: computeExpiry(d, now), + } +} + +// computeExpiry classifies a document by its expiry date relative to `now`. +func computeExpiry(d documentRecord, now time.Time) expiryAssessment { + a := expiryAssessment{State: "no_expiry", Flags: []string{}} + exp := parseDay(d.ExpiryDate) + if exp.IsZero() { + if d.Status == "pending_review" { + a.Flags = append(a.Flags, "Pending review — not yet confirmed valid") + } + return a + } + today := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, time.UTC) + days := int(exp.Sub(today).Hours() / 24) + a.Days = &days + switch { + case days < 0: + a.State = "expired" + a.Flags = append(a.Flags, "Expired "+plural(-days, "day")+" ago — renew before the linked pilot/aircraft operates") + case days <= soonDays: + a.State = "expiring_soon" + a.Flags = append(a.Flags, "Expires in "+plural(days, "day")+" — schedule a renewal") + default: + a.State = "valid" + } + if d.Status == "pending_review" { + a.Flags = append(a.Flags, "Pending review — not yet confirmed valid") + } + return a +} + +func plural(n int, unit string) string { + s := strconv.Itoa(n) + " " + unit + if n != 1 { + s += "s" + } + return s +} + +// --------------------------------------------------------------------------- +// Scope + authorisation. +// --------------------------------------------------------------------------- + +func documentScopeFilter(who *callerIdentity) string { + if who.isSuperadmin() { + return "" + } + if who.isManager() && who.OrgID != "" { + return "organization = \"" + who.OrgID + "\"" + } + // Plain user: their own uploads, or documents about them. + return "uploaded_by = \"" + who.ID + "\" || owner_pilot = \"" + who.ID + "\"" +} + +func canManageDocument(who *callerIdentity, d documentRecord) bool { + if who.isSuperadmin() { + return true + } + if who.isManager() && who.OrgID != "" && d.Organization == who.OrgID { + return true + } + return d.UploadedBy == who.ID +} + +func canViewDocument(who *callerIdentity, d documentRecord) bool { + if canManageDocument(who, d) { + return true + } + return d.OwnerPilot == who.ID +} + +// getDocument fetches one document record by id. +func (s *Server) getDocument(ctx context.Context, id string) (documentRecord, int, error) { + var d documentRecord + data, status, err := s.admin.do(ctx, http.MethodGet, + "/api/collections/documents/records/"+url.PathEscape(id), nil) + if err != nil { + return d, 0, err + } + if status == http.StatusOK { + _ = json.Unmarshal(data, &d) + } + return d, status, nil +} + +// --------------------------------------------------------------------------- +// List. +// --------------------------------------------------------------------------- + +// GET /api/documents — list the caller's in-scope documents, each with its +// computed expiry assessment. Optional `?expiring=` narrows the result to +// live documents that expire within that many days (already-expired included). +func (s *Server) handleListDocuments(w http.ResponseWriter, r *http.Request) { + who := caller(r) + drones, err := s.dronesInScope(r.Context(), who) + if err != nil { + gatewayError(w, err) + return + } + var list struct { + Items []documentRecord `json:"items"` + } + if _, err := s.listRecords(r.Context(), "documents", documentScopeFilter(who), + "-created", &list); err != nil { + gatewayError(w, err) + return + } + + within, expiringOnly := 0, false + if q := strings.TrimSpace(r.URL.Query().Get("expiring")); q != "" { + if n, err := strconv.Atoi(q); err == nil { + within, expiringOnly = n, true + } + } + + now := time.Now().UTC() + out := make([]documentView, 0, len(list.Items)) + for _, d := range list.Items { + v := d.view(drones, now) + if expiringOnly { + if d.Status == "archived" || v.Expiry.Days == nil || *v.Expiry.Days > within { + continue + } + } + out = append(out, v) + } + writeJSON(w, http.StatusOK, map[string]any{"documents": out}) +} + +// --------------------------------------------------------------------------- +// Create (multipart: metadata fields + an optional file blob). +// --------------------------------------------------------------------------- + +const maxUploadBytes = 52 << 20 // 52 MiB, matching the collection's file cap. + +// POST /api/documents — create a document. Accepts multipart/form-data so the +// blob can ride along with the metadata. When `replaces` names an existing +// document, this becomes the next version and the superseded row is archived +// (the version chain is preserved, never overwritten). +func (s *Server) handleCreateDocument(w http.ResponseWriter, r *http.Request) { + who := caller(r) + if err := r.ParseMultipartForm(maxUploadBytes); err != nil { + writeError(w, http.StatusBadRequest, "invalid multipart form") + return + } + + title := strings.TrimSpace(r.FormValue("title")) + if title == "" { + writeError(w, http.StatusBadRequest, "document title is required") + return + } + + // Resolve + authorise an owning drone, if one was named. + ownerDrone := strings.TrimSpace(r.FormValue("ownerDrone")) + if ownerDrone != "" { + drone, status, err := s.getDrone(r.Context(), ownerDrone) + if err != nil { + gatewayError(w, err) + return + } + if status != http.StatusOK || !droneVisibleTo(who, drone) { + writeError(w, http.StatusBadRequest, "selected aircraft is not in your scope") + return + } + } + + // Versioning: if replacing, inherit version+1 from the superseded document. + version := 1 + replaces := strings.TrimSpace(r.FormValue("replaces")) + var superseded *documentRecord + if replaces != "" { + old, status, err := s.getDocument(r.Context(), replaces) + if err != nil { + gatewayError(w, err) + return + } + if status != http.StatusOK || !canManageDocument(who, old) { + writeError(w, http.StatusBadRequest, "the document being replaced is not in your scope") + return + } + version = int(old.Version) + 1 + if version < 2 { + version = 2 + } + superseded = &old + } + + fields := map[string]string{ + "title": title, + "doc_type": strings.TrimSpace(r.FormValue("docType")), + "owner_type": strings.TrimSpace(r.FormValue("ownerType")), + "owner_ref": strings.TrimSpace(r.FormValue("ownerRef")), + "reference": strings.TrimSpace(r.FormValue("reference")), + "jurisdiction": strings.TrimSpace(r.FormValue("jurisdiction")), + "issue_date": strings.TrimSpace(r.FormValue("issueDate")), + "expiry_date": strings.TrimSpace(r.FormValue("expiryDate")), + "status": statusOr(r.FormValue("status")), + "access_tier": strings.TrimSpace(r.FormValue("accessTier")), + "notes": strings.TrimSpace(r.FormValue("notes")), + "version": strconv.Itoa(version), + "uploaded_by": who.ID, + } + // Relations + selects are omitted when blank so PocketBase doesn't reject an + // empty relation id. + setIfNotEmpty(fields, "owner_pilot", r.FormValue("ownerPilot")) + setIfNotEmpty(fields, "owner_drone", ownerDrone) + setIfNotEmpty(fields, "replaces", replaces) + setIfNotEmpty(fields, "organization", who.OrgID) + if md := strings.TrimSpace(r.FormValue("metadata")); md != "" && json.Valid([]byte(md)) { + fields["metadata"] = md + } + + var files []multipartFile + if f, hdr, err := r.FormFile("file"); err == nil { + defer f.Close() + data, err := io.ReadAll(io.LimitReader(f, maxUploadBytes+1)) + if err != nil { + writeError(w, http.StatusBadRequest, "could not read the uploaded file") + return + } + if len(data) > maxUploadBytes { + writeError(w, http.StatusRequestEntityTooLarge, "file exceeds the 50 MB limit") + return + } + files = append(files, multipartFile{field: "file", filename: hdr.Filename, data: data}) + } + + data, status, err := s.admin.doMultipart(r.Context(), http.MethodPost, + "/api/collections/documents/records", fields, files) + if err != nil { + gatewayError(w, err) + return + } + if status != http.StatusOK { + relayRaw(w, status, data) + return + } + var d documentRecord + _ = json.Unmarshal(data, &d) + + // Archive the superseded version now that the successor exists. + if superseded != nil { + _, _, _ = s.admin.do(r.Context(), http.MethodPatch, + "/api/collections/documents/records/"+url.PathEscape(superseded.ID), + map[string]any{"status": "archived"}) + } + + drones, _ := s.dronesInScope(r.Context(), who) + writeJSON(w, http.StatusCreated, map[string]any{"document": d.view(drones, time.Now().UTC())}) +} + +// statusOr defaults a blank/invalid status to "active". +func statusOr(s string) string { + switch strings.TrimSpace(s) { + case "pending_review", "archived", "active": + return strings.TrimSpace(s) + default: + return "active" + } +} + +func setIfNotEmpty(m map[string]string, key, val string) { + if v := strings.TrimSpace(val); v != "" { + m[key] = v + } +} + +// --------------------------------------------------------------------------- +// Update (metadata only; a new blob is a new version via create+replaces). +// --------------------------------------------------------------------------- + +type documentPatch struct { + Title *string `json:"title"` + DocType *string `json:"docType"` + OwnerType *string `json:"ownerType"` + OwnerPilot *string `json:"ownerPilot"` + OwnerDrone *string `json:"ownerDrone"` + OwnerRef *string `json:"ownerRef"` + Reference *string `json:"reference"` + Jurisdiction *string `json:"jurisdiction"` + IssueDate *string `json:"issueDate"` + ExpiryDate *string `json:"expiryDate"` + Status *string `json:"status"` + AccessTier *string `json:"accessTier"` + Notes *string `json:"notes"` + Metadata json.RawMessage `json:"metadata"` +} + +// PATCH /api/documents/{id} — update a document's metadata. +func (s *Server) handleUpdateDocument(w http.ResponseWriter, r *http.Request) { + who := caller(r) + id := r.PathValue("id") + existing, status, err := s.getDocument(r.Context(), id) + if err != nil { + gatewayError(w, err) + return + } + if status != http.StatusOK { + writeError(w, http.StatusNotFound, "document not found") + return + } + if !canManageDocument(who, existing) { + writeError(w, http.StatusForbidden, "you cannot modify this document") + return + } + var in documentPatch + if err := json.NewDecoder(r.Body).Decode(&in); err != nil { + writeError(w, http.StatusBadRequest, "invalid json") + return + } + payload := map[string]any{} + putStr := func(key string, p *string) { + if p != nil { + payload[key] = strings.TrimSpace(*p) + } + } + if in.Title != nil { + t := strings.TrimSpace(*in.Title) + if t == "" { + writeError(w, http.StatusBadRequest, "document title cannot be empty") + return + } + payload["title"] = t + } + putStr("doc_type", in.DocType) + putStr("owner_type", in.OwnerType) + putStr("owner_ref", in.OwnerRef) + putStr("reference", in.Reference) + putStr("jurisdiction", in.Jurisdiction) + putStr("issue_date", in.IssueDate) + putStr("expiry_date", in.ExpiryDate) + putStr("access_tier", in.AccessTier) + putStr("notes", in.Notes) + // Relations may be cleared (empty string tells PocketBase to unset them). + if in.OwnerPilot != nil { + payload["owner_pilot"] = strings.TrimSpace(*in.OwnerPilot) + } + if in.OwnerDrone != nil { + payload["owner_drone"] = strings.TrimSpace(*in.OwnerDrone) + } + if in.Status != nil { + payload["status"] = statusOr(*in.Status) + } + if len(in.Metadata) > 0 && json.Valid(in.Metadata) { + payload["metadata"] = in.Metadata + } + + data, status, err := s.admin.do(r.Context(), http.MethodPatch, + "/api/collections/documents/records/"+url.PathEscape(id), payload) + if err != nil { + gatewayError(w, err) + return + } + if status != http.StatusOK { + relayRaw(w, status, data) + return + } + var d documentRecord + _ = json.Unmarshal(data, &d) + drones, _ := s.dronesInScope(r.Context(), who) + writeJSON(w, http.StatusOK, map[string]any{"document": d.view(drones, time.Now().UTC())}) +} + +// --------------------------------------------------------------------------- +// Delete. +// --------------------------------------------------------------------------- + +// DELETE /api/documents/{id} — delete a document (and its stored blob). +func (s *Server) handleDeleteDocument(w http.ResponseWriter, r *http.Request) { + who := caller(r) + id := r.PathValue("id") + existing, status, err := s.getDocument(r.Context(), id) + if err != nil { + gatewayError(w, err) + return + } + if status != http.StatusOK { + writeError(w, http.StatusNotFound, "document not found") + return + } + if !canManageDocument(who, existing) { + writeError(w, http.StatusForbidden, "you cannot delete this document") + return + } + _, st, err := s.admin.do(r.Context(), http.MethodDelete, + "/api/collections/documents/records/"+url.PathEscape(id), nil) + if err != nil { + gatewayError(w, err) + return + } + if st != http.StatusOK && st != http.StatusNoContent { + writeError(w, http.StatusBadGateway, "could not delete document") + return + } + writeJSON(w, http.StatusOK, map[string]any{"ok": true}) +} + +// --------------------------------------------------------------------------- +// File download (streamed through the API Server so the browser never touches +// PocketBase directly). +// --------------------------------------------------------------------------- + +// GET /api/documents/{id}/file — stream the stored blob for a document. +func (s *Server) handleDownloadDocument(w http.ResponseWriter, r *http.Request) { + who := caller(r) + id := r.PathValue("id") + rec, status, err := s.getDocument(r.Context(), id) + if err != nil { + gatewayError(w, err) + return + } + if status != http.StatusOK { + writeError(w, http.StatusNotFound, "document not found") + return + } + if !canViewDocument(who, rec) { + writeError(w, http.StatusForbidden, "you cannot access this document") + return + } + if rec.File == "" { + writeError(w, http.StatusNotFound, "this document has no file attached") + return + } + resp, err := s.admin.streamFile(r.Context(), "documents", rec.ID, rec.File) + if err != nil { + gatewayError(w, err) + return + } + defer resp.Body.Close() + if resp.StatusCode != http.StatusOK { + writeError(w, http.StatusBadGateway, "could not retrieve the stored file") + return + } + if ct := resp.Header.Get("Content-Type"); ct != "" { + w.Header().Set("Content-Type", ct) + } + if cl := resp.Header.Get("Content-Length"); cl != "" { + w.Header().Set("Content-Length", cl) + } + w.Header().Set("Content-Disposition", "attachment; filename=\""+sanitizeFilename(rec.File)+"\"") + w.WriteHeader(http.StatusOK) + _, _ = io.Copy(w, resp.Body) +} + +// sanitizeFilename strips characters that would break a Content-Disposition +// header (quotes / control chars); PocketBase filenames are already safe, this +// is belt-and-braces. +func sanitizeFilename(name string) string { + return strings.Map(func(r rune) rune { + if r == '"' || r < 0x20 { + return '_' + } + return r + }, name) +} diff --git a/API Server/internal/api/server.go b/API Server/internal/api/server.go index e9b3d59..46e0eb0 100644 --- a/API Server/internal/api/server.go +++ b/API Server/internal/api/server.go @@ -153,6 +153,15 @@ func (s *Server) Handler() http.Handler { mux.HandleFunc("DELETE /api/flights/{id}", s.requireUser(s.handleDeleteFlight)) mux.HandleFunc("GET /api/logbook/export", s.requireUser(s.handleExportLogbook)) + // Documents — the compliance + operational document store (metadata in + // PocketBase, blob in PocketBase file storage for now). Available to any + // authenticated user; per-role scoping is enforced inside the handlers. + mux.HandleFunc("GET /api/documents", s.requireUser(s.handleListDocuments)) + mux.HandleFunc("POST /api/documents", s.requireUser(s.handleCreateDocument)) + mux.HandleFunc("PATCH /api/documents/{id}", s.requireUser(s.handleUpdateDocument)) + mux.HandleFunc("DELETE /api/documents/{id}", s.requireUser(s.handleDeleteDocument)) + mux.HandleFunc("GET /api/documents/{id}/file", s.requireUser(s.handleDownloadDocument)) + // Device / dashboard API. mux.HandleFunc("GET /api/devices", s.handleListDevices) mux.HandleFunc("GET /api/devices/{id}/track", s.handleTrack) diff --git a/API Server/pocketbase/pb_migrations/1720300800_add_documents.js b/API Server/pocketbase/pb_migrations/1720300800_add_documents.js new file mode 100644 index 0000000..9ea7ea7 --- /dev/null +++ b/API Server/pocketbase/pb_migrations/1720300800_add_documents.js @@ -0,0 +1,171 @@ +/// + +// Creates the `documents` collection: the compliance + operational document +// store for PilotVault (pilot certificates, aircraft registrations, insurance, +// airspace authorisations, contracts, …). Metadata lives here; the blob lives in +// PocketBase's own file storage *for now* — the file field is the temporary +// stand-in for the S3-compatible object store this will grow into. When that +// lands, only the blob backend changes: this metadata shape (and its +// `replaces` version chain + `expiry_date`-driven alerting) stays. +// +// Like `organizations`, user management, and the logbook, the collection is +// reached only through the API Server's superuser service account, so its API +// rules stay locked (superusers only); the API Server enforces per-role scoping +// in Go. +// +// Apply by copying into your PocketBase deployment's `pb_migrations/` directory +// and restarting. Written for PocketBase v0.22+/v0.23. Idempotent: the +// collection is created only if absent, so re-running is a no-op. +// +// Depends on 1720300200_add_organizations.js (organizations), the `users` auth +// collection, and 1720300700_add_logbook.js (drones — a document may be owned by +// a specific airframe). +migrate( + (app) => { + // Idempotency guard. + try { + app.findCollectionByNameOrId('documents') + return // already present + } catch (_) { + // create below + } + + const orgs = app.findCollectionByNameOrId('organizations') + const users = app.findCollectionByNameOrId('users') + const drones = app.findCollectionByNameOrId('drones') + + const documents = new Collection({ + type: 'base', + name: 'documents', + fields: [ + { name: 'title', type: 'text', required: true, max: 200, presentable: true }, + + // What kind of paperwork this is — drives filtering + which owner makes + // sense. Kept broad to cover pilot / aircraft / operational / business. + { + name: 'doc_type', + type: 'select', + maxSelect: 1, + values: [ + 'certificate', 'medical', 'insurance', 'background_check', + 'registration', 'maintenance', 'conformity', 'firmware', 'incident', + 'flight_log', 'checklist', 'airspace_auth', 'mission_plan', + 'risk_assessment', 'contract', 'client_insurance', 'delivery_report', + 'other', + ], + }, + + // -- ownership: who/what the document is about -- + { name: 'owner_type', type: 'select', maxSelect: 1, values: ['pilot', 'aircraft', 'organization', 'client', 'other'] }, + { + name: 'owner_pilot', + type: 'relation', + required: false, + collectionId: users.id, + cascadeDelete: false, + minSelect: 0, + maxSelect: 1, + presentable: false, + }, + { + name: 'owner_drone', + type: 'relation', + required: false, + collectionId: drones.id, + cascadeDelete: false, + minSelect: 0, + maxSelect: 1, + presentable: false, + }, + // Free-form owner reference for client/other (client name, aircraft + // serial, site…), used when no relation fits. + { name: 'owner_ref', type: 'text', max: 200 }, + + // -- identity + compliance drivers -- + // Certificate / registration / policy number. + { name: 'reference', type: 'text', max: 200 }, + { name: 'jurisdiction', type: 'text', max: 120 }, + { name: 'issue_date', type: 'date' }, + // The single highest-value field: drives expiry alerting (expired certs = + // grounded fleet). Blank = the document never expires. + { name: 'expiry_date', type: 'date' }, + + // Lifecycle. `archived` marks a row superseded by a newer version (see + // `replaces`) — the chain is kept, nothing is overwritten in place. + { name: 'status', type: 'select', maxSelect: 1, values: ['active', 'pending_review', 'archived'] }, + // Who may view — informational for now; scope is enforced by org/role. + { name: 'access_tier', type: 'select', maxSelect: 1, values: ['pilot', 'ops', 'admin', 'client'] }, + + // The blob itself (temporary PocketBase-hosted stand-in for object + // storage). Single file, ~50 MB cap. + { name: 'file', type: 'file', maxSelect: 1, maxSize: 52428800 }, + + // Type-specific fields that shouldn't need a schema migration each — same + // JSONB-style escape hatch used for plugin config. + { name: 'metadata', type: 'json', maxSize: 50000 }, + { name: 'notes', type: 'text', max: 2000 }, + + // -- versioning (replaces_id chain) + audit -- + { + name: 'replaces', + type: 'relation', + required: false, + collectionId: '', // self-reference; patched to documents.id after save + cascadeDelete: false, + minSelect: 0, + maxSelect: 1, + presentable: false, + }, + { name: 'version', type: 'number', min: 1 }, + { + name: 'uploaded_by', + type: 'relation', + required: false, + collectionId: users.id, + cascadeDelete: false, + minSelect: 0, + maxSelect: 1, + presentable: false, + }, + { + name: 'organization', + type: 'relation', + required: false, + collectionId: orgs.id, + cascadeDelete: false, + minSelect: 0, + maxSelect: 1, + presentable: false, + }, + + { name: 'created', type: 'autodate', onCreate: true, onUpdate: false }, + { name: 'updated', type: 'autodate', onCreate: true, onUpdate: true }, + ], + indexes: [ + 'CREATE INDEX `idx_documents_org` ON `documents` (`organization`)', + 'CREATE INDEX `idx_documents_owner_pilot` ON `documents` (`owner_pilot`)', + 'CREATE INDEX `idx_documents_owner_drone` ON `documents` (`owner_drone`)', + // Partial index: only the live rows the expiry job scans, keeping it + // cheap as archived/superseded versions accumulate. + "CREATE INDEX `idx_documents_expiring` ON `documents` (`expiry_date`) WHERE `status` = 'active'", + ], + }) + app.save(documents) + + // Point the self-referential `replaces` relation at the now-created + // collection (its id wasn't known before the first save). + const saved = app.findCollectionByNameOrId('documents') + const replaces = saved.fields.find((f) => f.name === 'replaces') + if (replaces) { + replaces.collectionId = saved.id + app.save(saved) + } + }, + (app) => { + try { + app.delete(app.findCollectionByNameOrId('documents')) + } catch (_) { + // already gone + } + }, +) diff --git a/Web App/server/bff.go b/Web App/server/bff.go index f820f9a..fef75e2 100644 --- a/Web App/server/bff.go +++ b/Web App/server/bff.go @@ -465,6 +465,70 @@ func (a *App) handleExportLogbook(w http.ResponseWriter, r *http.Request) { _, _ = io.Copy(w, resp.Body) } +/* ---------- Documents ---------- */ + +// GET /bff/documents → API Server /api/documents (preserves ?expiring=N). +func (a *App) handleListDocuments(w http.ResponseWriter, r *http.Request) { + target := a.apiBaseFor(r) + "/api/documents" + if r.URL.RawQuery != "" { + target += "?" + r.URL.RawQuery + } + req, _ := http.NewRequest(http.MethodGet, target, nil) + req.Header.Set("Authorization", tokenOf(r)) + a.doRelay(w, req) +} + +// POST /bff/documents → API Server /api/documents. Streams the multipart body +// through unchanged (metadata fields + the optional file blob). +func (a *App) handleCreateDocument(w http.ResponseWriter, r *http.Request) { + req, _ := http.NewRequest(http.MethodPost, a.apiBaseFor(r)+"/api/documents", r.Body) + req.Header.Set("Authorization", tokenOf(r)) + if ct := r.Header.Get("Content-Type"); ct != "" { + req.Header.Set("Content-Type", ct) + } + req.ContentLength = r.ContentLength + a.doRelay(w, req) +} + +// PATCH /bff/documents/{id} → API Server /api/documents/{id} (JSON metadata). +func (a *App) handleUpdateDocument(w http.ResponseWriter, r *http.Request) { + id := r.PathValue("id") + body, _ := io.ReadAll(r.Body) + req, _ := http.NewRequest(http.MethodPatch, a.apiBaseFor(r)+"/api/documents/"+url.PathEscape(id), bytes.NewReader(body)) + req.Header.Set("Authorization", tokenOf(r)) + req.Header.Set("Content-Type", "application/json") + a.doRelay(w, req) +} + +// DELETE /bff/documents/{id} → API Server /api/documents/{id} +func (a *App) handleDeleteDocument(w http.ResponseWriter, r *http.Request) { + id := r.PathValue("id") + req, _ := http.NewRequest(http.MethodDelete, a.apiBaseFor(r)+"/api/documents/"+url.PathEscape(id), nil) + req.Header.Set("Authorization", tokenOf(r)) + a.doRelay(w, req) +} + +// GET /bff/documents/{id}/file → API Server /api/documents/{id}/file. Streams +// the blob download, preserving the upstream Content-Type + Content-Disposition. +func (a *App) handleDownloadDocument(w http.ResponseWriter, r *http.Request) { + id := r.PathValue("id") + req, _ := http.NewRequest(http.MethodGet, a.apiBaseFor(r)+"/api/documents/"+url.PathEscape(id)+"/file", nil) + req.Header.Set("Authorization", tokenOf(r)) + resp, err := client.Do(req) + if err != nil { + writeJSON(w, http.StatusBadGateway, map[string]any{"error": "cannot reach API server"}) + return + } + defer resp.Body.Close() + for _, h := range []string{"Content-Type", "Content-Disposition", "Content-Length"} { + if v := resp.Header.Get(h); v != "" { + w.Header().Set(h, v) + } + } + w.WriteHeader(resp.StatusCode) + _, _ = io.Copy(w, resp.Body) +} + // doRelay executes an outbound request and relays the response verbatim. func (a *App) doRelay(w http.ResponseWriter, req *http.Request) { resp, err := client.Do(req) diff --git a/Web App/server/dist/assets/index-B-aj3yVr.css b/Web App/server/dist/assets/index-B-aj3yVr.css new file mode 100644 index 0000000..1fcc4a4 --- /dev/null +++ b/Web App/server/dist/assets/index-B-aj3yVr.css @@ -0,0 +1 @@ +:root,[data-theme=light]{--navy-950: #0B1730;--navy-900: #0F1E3D;--navy-800: #1B2E52;--navy-700: #26406E;--blue-50: #EAF1FE;--blue-100: #D6E3FD;--blue-200: #B4CDFA;--blue-300: #8FB4F6;--blue-400: #5B93F5;--blue-500: #3D7BF0;--blue-600: #2B62CC;--blue-700: #1F4CA0;--slate-0: #FFFFFF;--slate-50: #F6F7F9;--slate-100: #EEF0F3;--slate-150: #E6E9EE;--slate-200: #DCE0E7;--slate-300: #C5CCD7;--slate-400: #97A1B0;--slate-500: #6B7688;--slate-600: #4C5566;--slate-700: #333B4A;--slate-800: #1E2635;--slate-900: #131A28;--slate-950: #0B111C;--steel: #5A6B85;--green-500: #1F8A5B;--green-100: #DCF1E7;--green-600:#177049;--amber-500: #D9852B;--amber-100: #FBEBD5;--amber-600:#B86C1B;--red-500: #D64545;--red-100: #FBE0E0;--red-600: #B83232;--bg-app: var(--slate-100);--bg-subtle: var(--slate-50);--surface: var(--slate-0);--surface-2: var(--slate-50);--surface-inset: var(--slate-100);--border: var(--slate-200);--border-strong: var(--slate-300);--border-subtle: var(--slate-150);--text-primary: var(--navy-900);--text-secondary:var(--steel);--text-tertiary: var(--slate-400);--text-inverse: var(--slate-0);--text-on-accent:#FFFFFF;--accent: var(--blue-500);--accent-hover: var(--blue-600);--accent-active: var(--blue-700);--accent-soft: var(--blue-50);--accent-soft-fg:var(--blue-700);--focus-ring: color-mix(in srgb, var(--blue-500) 45%, transparent);--success: var(--green-500);--success-soft: var(--green-100);--success-fg: var(--green-600);--warning: var(--amber-500);--warning-soft: var(--amber-100);--warning-fg: var(--amber-600);--danger: var(--red-500);--danger-soft: var(--red-100);--danger-fg: var(--red-600);--overlay: color-mix(in srgb, var(--navy-950) 55%, transparent);--font-sans: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;--font-mono: "Space Mono", ui-monospace, "SF Mono", "JetBrains Mono", monospace;--radius-xs: 4px;--radius-sm: 6px;--radius-md: 10px;--radius-lg: 14px;--radius-xl: 20px;--radius-pill: 999px;--shadow-xs: 0 1px 2px rgba(15,30,61,.06);--shadow-sm: 0 1px 2px rgba(15,30,61,.06), 0 1px 3px rgba(15,30,61,.04);--shadow-md: 0 2px 4px rgba(15,30,61,.06), 0 6px 16px rgba(15,30,61,.08);--shadow-lg: 0 8px 24px rgba(15,30,61,.1), 0 2px 6px rgba(15,30,61,.06);--ease-standard: cubic-bezier(.4, 0, .2, 1);--ease-out: cubic-bezier(.16, 1, .3, 1);--dur-fast: .12s;--dur-base: .2s;color-scheme:light}[data-theme=dark]{--bg-app: var(--navy-950);--bg-subtle: var(--slate-950);--surface: #10203F;--surface-2: #142748;--surface-inset: var(--navy-950);--border: color-mix(in srgb, #FFFFFF 10%, transparent);--border-strong: color-mix(in srgb, #FFFFFF 18%, transparent);--border-subtle: color-mix(in srgb, #FFFFFF 6%, transparent);--text-primary: #F4F7FC;--text-secondary:#8FA0BE;--text-tertiary: #5E6E8C;--text-inverse: var(--navy-900);--text-on-accent:#FFFFFF;--accent: var(--blue-400);--accent-hover: var(--blue-300);--accent-active: var(--blue-200);--accent-soft: color-mix(in srgb, var(--blue-500) 18%, transparent);--accent-soft-fg:var(--blue-300);--focus-ring: color-mix(in srgb, var(--blue-400) 55%, transparent);--success:var(--green-500);--success-soft: color-mix(in srgb, var(--green-500) 22%, transparent);--success-fg:#5FD3A0;--warning:var(--amber-500);--warning-soft: color-mix(in srgb, var(--amber-500) 22%, transparent);--warning-fg:#F0B26A;--danger: var(--red-500);--danger-soft: color-mix(in srgb, var(--red-500) 22%, transparent);--danger-fg: #F08A8A;--overlay: color-mix(in srgb, #000000 62%, transparent);--shadow-xs: 0 1px 2px rgba(0,0,0,.35);--shadow-sm: 0 1px 3px rgba(0,0,0,.4);--shadow-md: 0 4px 12px rgba(0,0,0,.45);--shadow-lg: 0 12px 32px rgba(0,0,0,.5);color-scheme:dark}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Space Grotesk,ui-sans-serif,system-ui,-apple-system,Segoe UI,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}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;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:Space Mono,ui-monospace,SF Mono,JetBrains Mono,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.tabular{font-variant-numeric:tabular-nums}.eyebrow{font-family:Space Mono,ui-monospace,SF Mono,JetBrains Mono,monospace;font-size:11px;text-transform:uppercase;letter-spacing:.14em;color:var(--text-tertiary)}.readout{font-variant-numeric:tabular-nums;font-family:Space Mono,ui-monospace,SF Mono,JetBrains Mono,monospace;font-size:30px;line-height:1;font-weight:500;color:var(--text-primary)}.panel{border-radius:14px;border-width:1px;border-color:var(--border);background-color:var(--surface);--tw-shadow: var(--shadow-xs);--tw-shadow-colored: var(--shadow-xs);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.pill{border-radius:10px;border-width:1px;border-color:var(--border);background-color:var(--surface-2);padding:.5rem .75rem}.field{width:100%;border-radius:10px;border-width:1px;border-color:var(--border);background-color:var(--surface-2);padding:.625rem .75rem;font-size:.875rem;line-height:1.25rem;color:var(--text-primary);outline:2px solid transparent;outline-offset:2px;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.field::-moz-placeholder{color:var(--text-tertiary)}.field::placeholder{color:var(--text-tertiary)}.field{transition-duration:var(--dur-fast)}.field:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--focus-ring)}.btn-accent{border-radius:10px;background-color:var(--accent);padding:.625rem 1rem;font-size:.875rem;line-height:1.25rem;font-weight:600;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.btn-accent:hover{background-color:var(--accent-hover)}.btn-accent:active{--tw-translate-y: 1px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.btn-accent:disabled{opacity:.5}.btn-accent{transition-duration:var(--dur-fast)}.btn-ghost{border-radius:10px;border-width:1px;border-color:var(--border);background-color:var(--surface);padding:.375rem .75rem;font-size:.875rem;line-height:1.25rem;color:var(--text-secondary);transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.btn-ghost:hover{border-color:var(--border-strong);color:var(--text-primary)}.btn-ghost:active{--tw-translate-y: 1px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.btn-ghost{transition-duration:var(--dur-fast)}.btn-icon{display:grid;height:2.25rem;width:2.25rem;place-items:center;border-radius:10px;border-width:1px;border-color:var(--border);background-color:var(--surface);color:var(--text-secondary);transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.btn-icon:hover{border-color:var(--border-strong);color:var(--text-primary)}.btn-icon{transition-duration:var(--dur-fast)}.\!visible{visibility:visible!important}.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-y-0{top:0;bottom:0}.bottom-5{bottom:1.25rem}.right-0{right:0}.right-5{right:1.25rem}.top-0{top:0}.top-5{top:1.25rem}.z-10{z-index:10}.z-20{z-index:20}.col-span-2{grid-column:span 2 / span 2}.mx-auto{margin-left:auto;margin-right:auto}.my-4{margin-top:1rem;margin-bottom:1rem}.-mb-px{margin-bottom:-1px}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-3\.5{margin-bottom:.875rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.ml-1{margin-left:.25rem}.ml-1\.5{margin-left:.375rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-1\.5{margin-right:.375rem}.mr-2{margin-right:.5rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-2\.5{margin-top:.625rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.mt-auto{margin-top:auto}.mt-px{margin-top:1px}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-16{height:4rem}.h-2{height:.5rem}.h-28{height:7rem}.h-4{height:1rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[180px\]{height:180px}.h-\[18px\]{height:18px}.h-\[320px\]{height:320px}.h-full{height:100%}.min-h-\[16px\]{min-height:16px}.w-1\.5{width:.375rem}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-16{width:4rem}.w-2{width:.5rem}.w-24{width:6rem}.w-28{width:7rem}.w-32{width:8rem}.w-4{width:1rem}.w-48{width:12rem}.w-56{width:14rem}.w-60{width:15rem}.w-64{width:16rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-\[18px\]{width:18px}.w-\[380px\]{width:380px}.w-full{width:100%}.min-w-0{min-width:0px}.max-w-\[1240px\]{max-width:1240px}.max-w-\[1280px\]{max-width:1280px}.max-w-\[220px\]{max-width:220px}.max-w-\[280px\]{max-width:280px}.max-w-\[360px\]{max-width:360px}.max-w-\[420px\]{max-width:420px}.max-w-\[520px\]{max-width:520px}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.translate-x-1{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-6{--tw-translate-x: 1.5rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-pointer{cursor:pointer}.select-all{-webkit-user-select:all;-moz-user-select:all;user-select:all}.resize-none{resize:none}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-\[1\.6fr_1fr\]{grid-template-columns:1.6fr 1fr}.grid-cols-\[210px_1fr\]{grid-template-columns:210px 1fr}.grid-cols-\[248px_1fr\]{grid-template-columns:248px 1fr}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-between{justify-content:space-between}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.gap-6{gap:1.5rem}.gap-x-8{-moz-column-gap:2rem;column-gap:2rem}.gap-y-1\.5{row-gap:.375rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.break-all{word-break:break-all}.rounded,.rounded-\[10px\]{border-radius:10px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:14px}.rounded-md{border-radius:.375rem}.border{border-width:1px}.border-y{border-top-width:1px;border-bottom-width:1px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-r{border-right-width:1px}.border-none{border-style:none}.border-accent{border-color:var(--accent)}.border-line{border-color:var(--border)}.border-line-strong{border-color:var(--border-strong)}.border-transparent{border-color:transparent}.bg-\[var\(--navy-800\)\]{background-color:var(--navy-800)}.bg-accent{background-color:var(--accent)}.bg-accent-soft{background-color:var(--accent-soft)}.bg-amber{background-color:var(--warning)}.bg-amber-soft{background-color:var(--warning-soft)}.bg-caution{background-color:var(--warning)}.bg-current{background-color:currentColor}.bg-danger{background-color:var(--danger)}.bg-danger-soft{background-color:var(--danger-soft)}.bg-ink-muted{background-color:var(--text-tertiary)}.bg-line{background-color:var(--border)}.bg-ready,.bg-success{background-color:var(--success)}.bg-success-soft{background-color:var(--success-soft)}.bg-surface-1{background-color:var(--surface)}.bg-surface-2{background-color:var(--surface-2)}.bg-transparent{background-color:transparent}.bg-warning{background-color:var(--danger)}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-0\.5{padding:.125rem}.p-10{padding:2.5rem}.p-16{padding:4rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-7{padding:1.75rem}.p-8{padding:2rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-3\.5{padding-left:.875rem;padding-right:.875rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-7{padding-left:1.75rem;padding-right:1.75rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-16{padding-top:4rem;padding-bottom:4rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-3\.5{padding-top:.875rem;padding-bottom:.875rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.pb-4{padding-bottom:1rem}.pb-5{padding-bottom:1.25rem}.pb-8{padding-bottom:2rem}.pr-10{padding-right:2.5rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:Space Mono,ui-monospace,SF Mono,JetBrains Mono,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-\[10\.5px\]{font-size:10.5px}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[13px\]{font-size:13px}.text-\[19px\]{font-size:19px}.text-\[22px\]{font-size:22px}.text-\[30px\]{font-size:30px}.text-\[34px\]{font-size:34px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-mode{font-size:18px;line-height:1.2;letter-spacing:-.02em;font-weight:600}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.leading-none{line-height:1}.leading-tight{line-height:1.25}.tracking-\[0\.3em\]{letter-spacing:.3em}.tracking-caps{letter-spacing:.14em}.tracking-tightest{letter-spacing:-.02em}.text-accent{color:var(--accent)}.text-accent-soft-fg{color:var(--accent-soft-fg)}.text-amber-fg{color:var(--warning-fg)}.text-danger-fg{color:var(--danger-fg)}.text-ink{color:var(--text-primary)}.text-ink-muted{color:var(--text-tertiary)}.text-ink-secondary{color:var(--text-secondary)}.text-success-fg{color:var(--success-fg)}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.accent-\[var\(--accent\)\]{accent-color:var(--accent)}.accent-\[var\(--danger\)\]{accent-color:var(--danger)}.opacity-60{opacity:.6}.shadow-md{--tw-shadow: var(--shadow-md);--tw-shadow-colored: var(--shadow-md);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: var(--shadow-sm);--tw-shadow-colored: var(--shadow-sm);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xs{--tw-shadow: var(--shadow-xs);--tw-shadow-colored: var(--shadow-xs);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.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)}.filter{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)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}html,body,#app{height:100%}html{background-color:var(--bg-app);transition:background-color var(--dur-base) var(--ease-standard)}body{font-family:Space Grotesk,ui-sans-serif,system-ui,-apple-system,Segoe UI,sans-serif;color:var(--text-primary);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#app{background-color:var(--bg-app);min-height:100vh;transition:background-color var(--dur-base) var(--ease-standard)}html.reduce-motion *,html.reduce-motion *:before,html.reduce-motion *:after{transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important}.leaflet-container{background:var(--surface-inset);font-family:var(--font-sans)}.leaflet-control-attribution{background:color-mix(in srgb,var(--surface) 82%,transparent)!important;color:var(--text-tertiary)!important}.leaflet-control-attribution a{color:var(--text-secondary)!important}.placeholder\:text-ink-muted::-moz-placeholder{color:var(--text-tertiary)}.placeholder\:text-ink-muted::placeholder{color:var(--text-tertiary)}.first\:mt-0:first-child{margin-top:0}.last\:border-0:last-child{border-width:0px}.hover\:border-line-strong:hover{border-color:var(--border-strong)}.hover\:bg-danger-soft:hover{background-color:var(--danger-soft)}.hover\:bg-surface-2:hover{background-color:var(--surface-2)}.hover\:text-ink:hover{color:var(--text-primary)}.hover\:text-ink-secondary:hover{color:var(--text-secondary)}.hover\:underline:hover{text-decoration-line:underline}.hover\:brightness-110:hover{--tw-brightness: brightness(1.1);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)}.enabled\:hover\:brightness-110:hover:enabled{--tw-brightness: brightness(1.1);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)}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}@media(max-width:1100px){.max-\[1100px\]\:hidden{display:none}.max-\[1100px\]\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.max-\[1100px\]\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:900px){.max-\[900px\]\:hidden{display:none}.max-\[900px\]\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.max-\[900px\]\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:820px){.max-\[820px\]\:col-span-1{grid-column:span 1 / span 1}.max-\[820px\]\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}}@media(max-width:760px){.max-\[760px\]\:col-span-1{grid-column:span 1 / span 1}.max-\[760px\]\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.max-\[760px\]\:flex-row{flex-direction:row}.max-\[760px\]\:overflow-x-auto{overflow-x:auto}}@media(max-width:560px){.max-\[560px\]\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}}@media(min-width:640px){.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:justify-between{justify-content:space-between}}.fade-enter-active[data-v-4fe25eb7],.fade-leave-active[data-v-4fe25eb7]{transition:opacity .2s}.fade-enter-from[data-v-4fe25eb7],.fade-leave-to[data-v-4fe25eb7]{opacity:0} diff --git a/Web App/server/dist/assets/index-Bw9Fgeki.js b/Web App/server/dist/assets/index-Bw9Fgeki.js new file mode 100644 index 0000000..2597f72 --- /dev/null +++ b/Web App/server/dist/assets/index-Bw9Fgeki.js @@ -0,0 +1,20 @@ +(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))l(u);new MutationObserver(u=>{for(const d of u)if(d.type==="childList")for(const h of d.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&l(h)}).observe(document,{childList:!0,subtree:!0});function o(u){const d={};return u.integrity&&(d.integrity=u.integrity),u.referrerPolicy&&(d.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?d.credentials="include":u.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function l(u){if(u.ep)return;u.ep=!0;const d=o(u);fetch(u.href,d)}})();/** +* @vue/shared v3.5.39 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/function yr(t){const i=Object.create(null);for(const o of t.split(","))i[o]=1;return o=>o in i}const ft={},_s=[],Un=()=>{},su=()=>!1,ua=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),ca=t=>t.startsWith("onUpdate:"),Ot=Object.assign,br=(t,i)=>{const o=t.indexOf(i);o>-1&&t.splice(o,1)},ed=Object.prototype.hasOwnProperty,ot=(t,i)=>ed.call(t,i),Ee=Array.isArray,ys=t=>po(t)==="[object Map]",Cs=t=>po(t)==="[object Set]",sl=t=>po(t)==="[object Date]",He=t=>typeof t=="function",xt=t=>typeof t=="string",Ln=t=>typeof t=="symbol",at=t=>t!==null&&typeof t=="object",ou=t=>(at(t)||He(t))&&He(t.then)&&He(t.catch),au=Object.prototype.toString,po=t=>au.call(t),td=t=>po(t).slice(8,-1),ru=t=>po(t)==="[object Object]",xr=t=>xt(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,Xs=yr(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),da=t=>{const i=Object.create(null);return(o=>i[o]||(i[o]=t(o)))},nd=/-\w/g,Tn=da(t=>t.replace(nd,i=>i.slice(1).toUpperCase())),id=/\B([A-Z])/g,Ci=da(t=>t.replace(id,"-$1").toLowerCase()),lu=da(t=>t.charAt(0).toUpperCase()+t.slice(1)),Wa=da(t=>t?`on${lu(t)}`:""),Vn=(t,i)=>!Object.is(t,i),qo=(t,...i)=>{for(let o=0;o{Object.defineProperty(t,i,{configurable:!0,enumerable:!1,writable:l,value:o})},fa=t=>{const i=parseFloat(t);return isNaN(i)?t:i},sd=t=>{const i=xt(t)?Number(t):NaN;return isNaN(i)?t:i};let ol;const ha=()=>ol||(ol=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Ss(t){if(Ee(t)){const i={};for(let o=0;o{if(o){const l=o.split(ad);l.length>1&&(i[l[0].trim()]=l[1].trim())}}),i}function Le(t){let i="";if(xt(t))i=t;else if(Ee(t))for(let o=0;oSi(o,i))}const du=t=>!!(t&&t.__v_isRef===!0),k=t=>xt(t)?t:t==null?"":Ee(t)||at(t)&&(t.toString===au||!He(t.toString))?du(t)?k(t.value):JSON.stringify(t,fu,2):String(t),fu=(t,i)=>du(i)?fu(t,i.value):ys(i)?{[`Map(${i.size})`]:[...i.entries()].reduce((o,[l,u],d)=>(o[Ka(l,d)+" =>"]=u,o),{})}:Cs(i)?{[`Set(${i.size})`]:[...i.values()].map(o=>Ka(o))}:Ln(i)?Ka(i):at(i)&&!Ee(i)&&!ru(i)?String(i):i,Ka=(t,i="")=>{var o;return Ln(t)?`Symbol(${(o=t.description)!=null?o:i})`:t};/** +* @vue/reactivity v3.5.39 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let It;class fd{constructor(i=!1){this.detached=i,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!i&&It&&(It.active?(this.parent=It,this.index=(It.scopes||(It.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let i,o;if(this.scopes)for(i=0,o=this.scopes.length;i0&&--this._on===0){if(It===this)It=this.prevScope;else{let i=It;for(;i;){if(i.prevScope===this){i.prevScope=this.prevScope;break}i=i.prevScope}}this.prevScope=void 0}}stop(i){if(this._active){this._active=!1;let o,l;for(o=0,l=this.effects.length;o0)return;if(eo){let i=eo;for(eo=void 0;i;){const o=i.next;i.next=void 0,i.flags&=-9,i=o}}let t;for(;Qs;){let i=Qs;for(Qs=void 0;i;){const o=i.next;if(i.next=void 0,i.flags&=-9,i.flags&1)try{i.trigger()}catch(l){t||(t=l)}i=o}}if(t)throw t}function gu(t){for(let i=t.deps;i;i=i.nextDep)i.version=-1,i.prevActiveLink=i.dep.activeLink,i.dep.activeLink=i}function vu(t){let i,o=t.depsTail,l=o;for(;l;){const u=l.prevDep;l.version===-1?(l===o&&(o=u),Pr(l),pd(l)):i=l,l.dep.activeLink=l.prevActiveLink,l.prevActiveLink=void 0,l=u}t.deps=i,t.depsTail=o}function sr(t){for(let i=t.deps;i;i=i.nextDep)if(i.dep.version!==i.version||i.dep.computed&&(_u(i.dep.computed)||i.dep.version!==i.version))return!0;return!!t._dirty}function _u(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===oo)||(t.globalVersion=oo,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!sr(t))))return;t.flags|=2;const i=t.dep,o=mt,l=Cn;mt=t,Cn=!0;try{gu(t);const u=t.fn(t._value);(i.version===0||Vn(u,t._value))&&(t.flags|=128,t._value=u,i.version++)}catch(u){throw i.version++,u}finally{mt=o,Cn=l,vu(t),t.flags&=-3}}function Pr(t,i=!1){const{dep:o,prevSub:l,nextSub:u}=t;if(l&&(l.nextSub=u,t.prevSub=void 0),u&&(u.prevSub=l,t.nextSub=void 0),o.subs===t&&(o.subs=l,!l&&o.computed)){o.computed.flags&=-5;for(let d=o.computed.deps;d;d=d.nextDep)Pr(d,!0)}!i&&!--o.sc&&o.map&&o.map.delete(o.key)}function pd(t){const{prevDep:i,nextDep:o}=t;i&&(i.nextDep=o,t.prevDep=void 0),o&&(o.prevDep=i,t.nextDep=void 0)}let Cn=!0;const yu=[];function Zn(){yu.push(Cn),Cn=!1}function Hn(){const t=yu.pop();Cn=t===void 0?!0:t}function al(t){const{cleanup:i}=t;if(t.cleanup=void 0,i){const o=mt;mt=void 0;try{i()}finally{mt=o}}}let oo=0;class md{constructor(i,o){this.sub=i,this.dep=o,this.version=o.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Tr{constructor(i){this.computed=i,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(i){if(!mt||!Cn||mt===this.computed)return;let o=this.activeLink;if(o===void 0||o.sub!==mt)o=this.activeLink=new md(mt,this),mt.deps?(o.prevDep=mt.depsTail,mt.depsTail.nextDep=o,mt.depsTail=o):mt.deps=mt.depsTail=o,bu(o);else if(o.version===-1&&(o.version=this.version,o.nextDep)){const l=o.nextDep;l.prevDep=o.prevDep,o.prevDep&&(o.prevDep.nextDep=l),o.prevDep=mt.depsTail,o.nextDep=void 0,mt.depsTail.nextDep=o,mt.depsTail=o,mt.deps===o&&(mt.deps=l)}return o}trigger(i){this.version++,oo++,this.notify(i)}notify(i){kr();try{for(let o=this.subs;o;o=o.prevSub)o.sub.notify()&&o.sub.dep.notify()}finally{Sr()}}}function bu(t){if(t.dep.sc++,t.sub.flags&4){const i=t.dep.computed;if(i&&!t.dep.subs){i.flags|=20;for(let l=i.deps;l;l=l.nextDep)bu(l)}const o=t.dep.subs;o!==t&&(t.prevSub=o,o&&(o.nextSub=t)),t.dep.subs=t}}const or=new WeakMap,Gi=Symbol(""),ar=Symbol(""),ao=Symbol("");function Nt(t,i,o){if(Cn&&mt){let l=or.get(t);l||or.set(t,l=new Map);let u=l.get(o);u||(l.set(o,u=new Tr),u.map=l,u.key=o),u.track()}}function oi(t,i,o,l,u,d){const h=or.get(t);if(!h){oo++;return}const _=y=>{y&&y.trigger()};if(kr(),i==="clear")h.forEach(_);else{const y=Ee(t),T=y&&xr(o);if(y&&o==="length"){const w=Number(l);h.forEach((z,U)=>{(U==="length"||U===ao||!Ln(U)&&U>=w)&&_(z)})}else switch((o!==void 0||h.has(void 0))&&_(h.get(o)),T&&_(h.get(ao)),i){case"add":y?T&&_(h.get("length")):(_(h.get(Gi)),ys(t)&&_(h.get(ar)));break;case"delete":y||(_(h.get(Gi)),ys(t)&&_(h.get(ar)));break;case"set":ys(t)&&_(h.get(Gi));break}}Sr()}function gs(t){const i=tt(t);return i===t?i:(Nt(i,"iterate",ao),mn(t)?i:i.map(Mn))}function pa(t){return Nt(t=tt(t),"iterate",ao),t}function Fn(t,i){return li(t)?Ps(qi(t)?Mn(i):i):Mn(i)}const gd={__proto__:null,[Symbol.iterator](){return qa(this,Symbol.iterator,t=>Fn(this,t))},concat(...t){return gs(this).concat(...t.map(i=>Ee(i)?gs(i):i))},entries(){return qa(this,"entries",t=>(t[1]=Fn(this,t[1]),t))},every(t,i){return ti(this,"every",t,i,void 0,arguments)},filter(t,i){return ti(this,"filter",t,i,o=>o.map(l=>Fn(this,l)),arguments)},find(t,i){return ti(this,"find",t,i,o=>Fn(this,o),arguments)},findIndex(t,i){return ti(this,"findIndex",t,i,void 0,arguments)},findLast(t,i){return ti(this,"findLast",t,i,o=>Fn(this,o),arguments)},findLastIndex(t,i){return ti(this,"findLastIndex",t,i,void 0,arguments)},forEach(t,i){return ti(this,"forEach",t,i,void 0,arguments)},includes(...t){return Ya(this,"includes",t)},indexOf(...t){return Ya(this,"indexOf",t)},join(t){return gs(this).join(t)},lastIndexOf(...t){return Ya(this,"lastIndexOf",t)},map(t,i){return ti(this,"map",t,i,void 0,arguments)},pop(){return js(this,"pop")},push(...t){return js(this,"push",t)},reduce(t,...i){return rl(this,"reduce",t,i)},reduceRight(t,...i){return rl(this,"reduceRight",t,i)},shift(){return js(this,"shift")},some(t,i){return ti(this,"some",t,i,void 0,arguments)},splice(...t){return js(this,"splice",t)},toReversed(){return gs(this).toReversed()},toSorted(t){return gs(this).toSorted(t)},toSpliced(...t){return gs(this).toSpliced(...t)},unshift(...t){return js(this,"unshift",t)},values(){return qa(this,"values",t=>Fn(this,t))}};function qa(t,i,o){const l=pa(t),u=l[i]();return l!==t&&!mn(t)&&(u._next=u.next,u.next=()=>{const d=u._next();return d.done||(d.value=o(d.value)),d}),u}const vd=Array.prototype;function ti(t,i,o,l,u,d){const h=pa(t),_=h!==t&&!mn(t),y=h[i];if(y!==vd[i]){const z=y.apply(t,d);return _?Mn(z):z}let T=o;h!==t&&(_?T=function(z,U){return o.call(this,Fn(t,z),U,t)}:o.length>2&&(T=function(z,U){return o.call(this,z,U,t)}));const w=y.call(h,T,l);return _&&u?u(w):w}function rl(t,i,o,l){const u=pa(t),d=u!==t&&!mn(t);let h=o,_=!1;u!==t&&(d?(_=l.length===0,h=function(T,w,z){return _&&(_=!1,T=Fn(t,T)),o.call(this,T,Fn(t,w),z,t)}):o.length>3&&(h=function(T,w,z){return o.call(this,T,w,z,t)}));const y=u[i](h,...l);return _?Fn(t,y):y}function Ya(t,i,o){const l=tt(t);Nt(l,"iterate",ao);const u=l[i](...o);return(u===-1||u===!1)&&Mr(o[0])?(o[0]=tt(o[0]),l[i](...o)):u}function js(t,i,o=[]){Zn(),kr();const l=tt(t)[i].apply(t,o);return Sr(),Hn(),l}const _d=yr("__proto__,__v_isRef,__isVue"),xu=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(Ln));function yd(t){Ln(t)||(t=String(t));const i=tt(this);return Nt(i,"has",t),i.hasOwnProperty(t)}class wu{constructor(i=!1,o=!1){this._isReadonly=i,this._isShallow=o}get(i,o,l){if(o==="__v_skip")return i.__v_skip;const u=this._isReadonly,d=this._isShallow;if(o==="__v_isReactive")return!u;if(o==="__v_isReadonly")return u;if(o==="__v_isShallow")return d;if(o==="__v_raw")return l===(u?d?Md:Tu:d?Pu:Su).get(i)||Object.getPrototypeOf(i)===Object.getPrototypeOf(l)?i:void 0;const h=Ee(i);if(!u){let y;if(h&&(y=gd[o]))return y;if(o==="hasOwnProperty")return yd}const _=Reflect.get(i,o,Bt(i)?i:l);if((Ln(o)?xu.has(o):_d(o))||(u||Nt(i,"get",o),d))return _;if(Bt(_)){const y=h&&xr(o)?_:_.value;return u&&at(y)?lr(y):y}return at(_)?u?lr(_):bt(_):_}}class ku extends wu{constructor(i=!1){super(!1,i)}set(i,o,l,u){let d=i[o];const h=Ee(i)&&xr(o);if(!this._isShallow){const T=li(d);if(!mn(l)&&!li(l)&&(d=tt(d),l=tt(l)),!h&&Bt(d)&&!Bt(l))return T||(d.value=l),!0}const _=h?Number(o)t,Zo=t=>Reflect.getPrototypeOf(t);function Sd(t,i,o){return function(...l){const u=this.__v_raw,d=tt(u),h=ys(d),_=t==="entries"||t===Symbol.iterator&&h,y=t==="keys"&&h,T=u[t](...l),w=o?rr:i?Ps:Mn;return!i&&Nt(d,"iterate",y?ar:Gi),Ot(Object.create(T),{next(){const{value:z,done:U}=T.next();return U?{value:z,done:U}:{value:_?[w(z[0]),w(z[1])]:w(z),done:U}}})}}function Ho(t){return function(...i){return t==="delete"?!1:t==="clear"?void 0:this}}function Pd(t,i){const o={get(u){const d=this.__v_raw,h=tt(d),_=tt(u);t||(Vn(u,_)&&Nt(h,"get",u),Nt(h,"get",_));const{has:y}=Zo(h),T=i?rr:t?Ps:Mn;if(y.call(h,u))return T(d.get(u));if(y.call(h,_))return T(d.get(_));d!==h&&d.get(u)},get size(){const u=this.__v_raw;return!t&&Nt(tt(u),"iterate",Gi),u.size},has(u){const d=this.__v_raw,h=tt(d),_=tt(u);return t||(Vn(u,_)&&Nt(h,"has",u),Nt(h,"has",_)),u===_?d.has(u):d.has(u)||d.has(_)},forEach(u,d){const h=this,_=h.__v_raw,y=tt(_),T=i?rr:t?Ps:Mn;return!t&&Nt(y,"iterate",Gi),_.forEach((w,z)=>u.call(d,T(w),T(z),h))}};return Ot(o,t?{add:Ho("add"),set:Ho("set"),delete:Ho("delete"),clear:Ho("clear")}:{add(u){const d=tt(this),h=Zo(d),_=tt(u),y=!i&&!mn(u)&&!li(u)?_:u;return h.has.call(d,y)||Vn(u,y)&&h.has.call(d,u)||Vn(_,y)&&h.has.call(d,_)||(d.add(y),oi(d,"add",y,y)),this},set(u,d){!i&&!mn(d)&&!li(d)&&(d=tt(d));const h=tt(this),{has:_,get:y}=Zo(h);let T=_.call(h,u);T||(u=tt(u),T=_.call(h,u));const w=y.call(h,u);return h.set(u,d),T?Vn(d,w)&&oi(h,"set",u,d):oi(h,"add",u,d),this},delete(u){const d=tt(this),{has:h,get:_}=Zo(d);let y=h.call(d,u);y||(u=tt(u),y=h.call(d,u)),_&&_.call(d,u);const T=d.delete(u);return y&&oi(d,"delete",u,void 0),T},clear(){const u=tt(this),d=u.size!==0,h=u.clear();return d&&oi(u,"clear",void 0,void 0),h}}),["keys","values","entries",Symbol.iterator].forEach(u=>{o[u]=Sd(u,t,i)}),o}function Cr(t,i){const o=Pd(t,i);return(l,u,d)=>u==="__v_isReactive"?!t:u==="__v_isReadonly"?t:u==="__v_raw"?l:Reflect.get(ot(o,u)&&u in l?o:l,u,d)}const Td={get:Cr(!1,!1)},Cd={get:Cr(!1,!0)},Ld={get:Cr(!0,!1)};const Su=new WeakMap,Pu=new WeakMap,Tu=new WeakMap,Md=new WeakMap;function Ed(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function bt(t){return li(t)?t:Lr(t,!1,xd,Td,Su)}function Od(t){return Lr(t,!1,kd,Cd,Pu)}function lr(t){return Lr(t,!0,wd,Ld,Tu)}function Lr(t,i,o,l,u){if(!at(t)||t.__v_raw&&!(i&&t.__v_isReactive)||t.__v_skip||!Object.isExtensible(t))return t;const d=u.get(t);if(d)return d;const h=Ed(td(t));if(h===0)return t;const _=new Proxy(t,h===2?l:o);return u.set(t,_),_}function qi(t){return li(t)?qi(t.__v_raw):!!(t&&t.__v_isReactive)}function li(t){return!!(t&&t.__v_isReadonly)}function mn(t){return!!(t&&t.__v_isShallow)}function Mr(t){return t?!!t.__v_raw:!1}function tt(t){const i=t&&t.__v_raw;return i?tt(i):t}function zd(t){return!ot(t,"__v_skip")&&Object.isExtensible(t)&&uu(t,"__v_skip",!0),t}const Mn=t=>at(t)?bt(t):t,Ps=t=>at(t)?lr(t):t;function Bt(t){return t?t.__v_isRef===!0:!1}function K(t){return Ad(t,!1)}function Ad(t,i){return Bt(t)?t:new Id(t,i)}class Id{constructor(i,o){this.dep=new Tr,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=o?i:tt(i),this._value=o?i:Mn(i),this.__v_isShallow=o}get value(){return this.dep.track(),this._value}set value(i){const o=this._rawValue,l=this.__v_isShallow||mn(i)||li(i);i=l?i:tt(i),Vn(i,o)&&(this._rawValue=i,this._value=l?i:Mn(i),this.dep.trigger())}}function Ue(t){return Bt(t)?t.value:t}const $d={get:(t,i,o)=>i==="__v_raw"?t:Ue(Reflect.get(t,i,o)),set:(t,i,o,l)=>{const u=t[i];return Bt(u)&&!Bt(o)?(u.value=o,!0):Reflect.set(t,i,o,l)}};function Cu(t){return qi(t)?t:new Proxy(t,$d)}class Dd{constructor(i,o,l){this.fn=i,this.setter=o,this._value=void 0,this.dep=new Tr(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=oo-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!o,this.isSSR=l}notify(){if(this.flags|=16,!(this.flags&8)&&mt!==this)return mu(this,!0),!0}get value(){const i=this.dep.track();return _u(this),i&&(i.version=this.dep.version),this._value}set value(i){this.setter&&this.setter(i)}}function Nd(t,i,o=!1){let l,u;return He(t)?l=t:(l=t.get,u=t.set),new Dd(l,u,o)}const jo={},Jo=new WeakMap;let Wi;function Rd(t,i=!1,o=Wi){if(o){let l=Jo.get(o);l||Jo.set(o,l=[]),l.push(t)}}function Fd(t,i,o=ft){const{immediate:l,deep:u,once:d,scheduler:h,augmentJob:_,call:y}=o,T=oe=>u?oe:mn(oe)||u===!1||u===0?ai(oe,1):ai(oe);let w,z,U,V,ue=!1,X=!1;if(Bt(t)?(z=()=>t.value,ue=mn(t)):qi(t)?(z=()=>T(t),ue=!0):Ee(t)?(X=!0,ue=t.some(oe=>qi(oe)||mn(oe)),z=()=>t.map(oe=>{if(Bt(oe))return oe.value;if(qi(oe))return T(oe);if(He(oe))return y?y(oe,2):oe()})):He(t)?i?z=y?()=>y(t,2):t:z=()=>{if(U){Zn();try{U()}finally{Hn()}}const oe=Wi;Wi=w;try{return y?y(t,3,[V]):t(V)}finally{Wi=oe}}:z=Un,i&&u){const oe=z,de=u===!0?1/0:u;z=()=>ai(oe(),de)}const Ae=hd(),$e=()=>{w.stop(),Ae&&Ae.active&&br(Ae.effects,w)};if(d&&i){const oe=i;i=(...de)=>{const Ne=oe(...de);return $e(),Ne}}let Q=X?new Array(t.length).fill(jo):jo;const me=oe=>{if(!(!(w.flags&1)||!w.dirty&&!oe))if(i){const de=w.run();if(oe||u||ue||(X?de.some((Ne,nt)=>Vn(Ne,Q[nt])):Vn(de,Q))){U&&U();const Ne=Wi;Wi=w;try{const nt=[de,Q===jo?void 0:X&&Q[0]===jo?[]:Q,V];Q=de,y?y(i,3,nt):i(...nt)}finally{Wi=Ne}}}else w.run()};return _&&_(me),w=new hu(z),w.scheduler=h?()=>h(me,!1):me,V=oe=>Rd(oe,!1,w),U=w.onStop=()=>{const oe=Jo.get(w);if(oe){if(y)y(oe,4);else for(const de of oe)de();Jo.delete(w)}},i?l?me(!0):Q=w.run():h?h(me.bind(null,!0),!0):w.run(),$e.pause=w.pause.bind(w),$e.resume=w.resume.bind(w),$e.stop=$e,$e}function ai(t,i=1/0,o){if(i<=0||!at(t)||t.__v_skip||(o=o||new Map,(o.get(t)||0)>=i))return t;if(o.set(t,i),i--,Bt(t))ai(t.value,i,o);else if(Ee(t))for(let l=0;l{ai(l,i,o)});else if(ru(t)){for(const l in t)ai(t[l],i,o);for(const l of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,l)&&ai(t[l],i,o)}return t}/** +* @vue/runtime-core v3.5.39 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/function mo(t,i,o,l){try{return l?t(...l):t()}catch(u){ma(u,i,o)}}function vn(t,i,o,l){if(He(t)){const u=mo(t,i,o,l);return u&&ou(u)&&u.catch(d=>{ma(d,i,o)}),u}if(Ee(t)){const u=[];for(let d=0;d>>1,u=Kt[l],d=ro(u);d=ro(o)?Kt.push(t):Kt.splice(Vd(i),0,t),t.flags|=1,Eu()}}function Eu(){Xo||(Xo=Lu.then(zu))}function Ud(t){Ee(t)?bs.push(...t):ki&&t.id===-1?ki.splice(vs+1,0,t):t.flags&1||(bs.push(t),t.flags|=1),Eu()}function ll(t,i,o=Rn+1){for(;oro(o)-ro(l));if(bs.length=0,ki){ki.push(...i);return}for(ki=i,vs=0;vst.id==null?t.flags&2?-1:1/0:t.id;function zu(t){try{for(Rn=0;Rn{l._d&&na(-1);const d=Qo(i);let h;try{h=t(...u)}finally{Qo(d),l._d&&na(1)}return h};return l._n=!0,l._c=!0,l._d=!0,l}function re(t,i){if(Ft===null)return t;const o=xa(Ft),l=t.dirs||(t.dirs=[]);for(let u=0;u1)return o&&He(i)?i.call(l&&l.proxy):i}}const Zd=Symbol.for("v-scx"),Hd=()=>to(Zd);function en(t,i,o){return $u(t,i,o)}function $u(t,i,o=ft){const{immediate:l,deep:u,flush:d,once:h}=o,_=Ot({},o),y=i&&l||!i&&d!=="post";let T;if(fo){if(d==="sync"){const V=Hd();T=V.__watcherHandles||(V.__watcherHandles=[])}else if(!y){const V=()=>{};return V.stop=Un,V.resume=Un,V.pause=Un,V}}const w=Gt;_.call=(V,ue,X)=>vn(V,w,ue,X);let z=!1;d==="post"?_.scheduler=V=>{Qt(V,w&&w.suspense)}:d!=="sync"&&(z=!0,_.scheduler=(V,ue)=>{ue?V():Er(V)}),_.augmentJob=V=>{i&&(V.flags|=4),z&&(V.flags|=2,w&&(V.id=w.uid,V.i=w))};const U=Fd(t,i,_);return fo&&(T?T.push(U):y&&U()),U}function jd(t,i,o){const l=this.proxy,u=xt(t)?t.includes(".")?Du(l,t):()=>l[t]:t.bind(l,l);let d;He(i)?d=i:(d=i.handler,o=i);const h=go(this),_=$u(u,d.bind(l),o);return h(),_}function Du(t,i){const o=i.split(".");return()=>{let l=t;for(let u=0;ut.__isTeleport,pn=Symbol("_leaveCb"),Ws=Symbol("_enterCb");function Kd(){const t={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Li(()=>{t.isMounted=!0}),_a(()=>{t.isUnmounting=!0}),t}const fn=[Function,Array],Ru={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:fn,onEnter:fn,onAfterEnter:fn,onEnterCancelled:fn,onBeforeLeave:fn,onLeave:fn,onAfterLeave:fn,onLeaveCancelled:fn,onBeforeAppear:fn,onAppear:fn,onAfterAppear:fn,onAppearCancelled:fn},Fu=t=>{const i=t.subTree;return i.component?Fu(i.component):i},Gd={name:"BaseTransition",props:Ru,setup(t,{slots:i}){const o=fc(),l=Kd();return()=>{const u=i.default&&Uu(i.default(),!0),d=u&&u.length?Bu(u):o.subTree?R():void 0;if(!d)return;const h=tt(t),{mode:_}=h;if(l.isLeaving)return Ja(d);const y=ul(d);if(!y)return Ja(d);let T=ur(y,h,l,o,z=>T=z);y.type!==Rt&&lo(y,T);let w=o.subTree&&ul(o.subTree);if(w&&w.type!==Rt&&!Ki(w,y)&&Fu(o).type!==Rt){let z=ur(w,h,l,o);if(lo(w,z),_==="out-in"&&y.type!==Rt)return l.isLeaving=!0,z.afterLeave=()=>{l.isLeaving=!1,o.job.flags&8||o.update(),delete z.afterLeave,w=void 0},Ja(d);_==="in-out"&&y.type!==Rt?z.delayLeave=(U,V,ue)=>{const X=Vu(l,w);X[String(w.key)]=w,U[pn]=()=>{V(),U[pn]=void 0,delete T.delayedLeave,w=void 0},T.delayedLeave=()=>{ue(),delete T.delayedLeave,w=void 0}}:w=void 0}else w&&(w=void 0);return d}}};function Bu(t){let i=t[0];if(t.length>1){for(const o of t)if(o.type!==Rt){i=o;break}}return i}const qd=Gd;function Vu(t,i){const{leavingVNodes:o}=t;let l=o.get(i.type);return l||(l=Object.create(null),o.set(i.type,l)),l}function ur(t,i,o,l,u){const{appear:d,mode:h,persisted:_=!1,onBeforeEnter:y,onEnter:T,onAfterEnter:w,onEnterCancelled:z,onBeforeLeave:U,onLeave:V,onAfterLeave:ue,onLeaveCancelled:X,onBeforeAppear:Ae,onAppear:$e,onAfterAppear:Q,onAppearCancelled:me}=i,oe=String(t.key),de=Vu(o,t),Ne=(Te,Be)=>{Te&&vn(Te,l,9,Be)},nt=(Te,Be)=>{const Ce=Be[1];Ne(Te,Be),Ee(Te)?Te.every(ee=>ee.length<=1)&&Ce():Te.length<=1&&Ce()},ke={mode:h,persisted:_,beforeEnter(Te){let Be=y;if(!o.isMounted)if(d)Be=Ae||y;else return;Te[pn]&&Te[pn](!0);const Ce=de[oe];Ce&&Ki(t,Ce)&&Ce.el[pn]&&Ce.el[pn](),Ne(Be,[Te])},enter(Te){if(de[oe]===t)return;let Be=T,Ce=w,ee=z;if(!o.isMounted)if(d)Be=$e||T,Ce=Q||w,ee=me||z;else return;let pe=!1;Te[Ws]=Ze=>{pe||(pe=!0,Ze?Ne(ee,[Te]):Ne(Ce,[Te]),ke.delayedLeave&&ke.delayedLeave(),Te[Ws]=void 0)};const Re=Te[Ws].bind(null,!1);Be?nt(Be,[Te,Re]):Re()},leave(Te,Be){const Ce=String(t.key);if(Te[Ws]&&Te[Ws](!0),o.isUnmounting)return Be();Ne(U,[Te]);let ee=!1;Te[pn]=Re=>{ee||(ee=!0,Be(),Re?Ne(X,[Te]):Ne(ue,[Te]),Te[pn]=void 0,de[Ce]===t&&delete de[Ce])};const pe=Te[pn].bind(null,!1);de[Ce]=t,V?nt(V,[Te,pe]):pe()},clone(Te){const Be=ur(Te,i,o,l,u);return u&&u(Be),Be}};return ke}function Ja(t){if(ga(t))return t=Pi(t),t.children=null,t}function ul(t){if(!ga(t))return Nu(t.type)&&t.children?Bu(t.children):t;if(t.component)return t.component.subTree;const{shapeFlag:i,children:o}=t;if(o){if(i&16)return o[0];if(i&32&&He(o.default))return o.default()}}function lo(t,i){t.shapeFlag&6&&t.component?(t.transition=i,lo(t.component.subTree,i)):t.shapeFlag&128?(t.ssContent.transition=i.clone(t.ssContent),t.ssFallback.transition=i.clone(t.ssFallback)):t.transition=i}function Uu(t,i=!1,o){let l=[],u=0;for(let d=0;d1)for(let d=0;dno(X,i&&(Ee(i)?i[Ae]:i),o,l,u));return}if(xs(l)&&!u){l.shapeFlag&512&&l.type.__asyncResolved&&l.component.subTree.component&&no(t,i,o,l.component.subTree);return}const d=l.shapeFlag&4?xa(l.component):l.el,h=u?null:d,{i:_,r:y}=t,T=i&&i.r,w=_.refs===ft?_.refs={}:_.refs,z=_.setupState,U=tt(z),V=z===ft?su:X=>cl(w,X)?!1:ot(U,X),ue=(X,Ae)=>!(Ae&&cl(w,Ae));if(T!=null&&T!==y){if(dl(i),xt(T))w[T]=null,V(T)&&(z[T]=null);else if(Bt(T)){const X=i;ue(T,X.k)&&(T.value=null),X.k&&(w[X.k]=null)}}if(He(y)){Zn();try{mo(y,_,12,[h,w])}finally{Hn()}}else{const X=xt(y),Ae=Bt(y);if(X||Ae){const $e=()=>{if(t.f){const Q=X?V(y)?z[y]:w[y]:ue()||!t.k?y.value:w[t.k];if(u)Ee(Q)&&br(Q,d);else if(Ee(Q))Q.includes(d)||Q.push(d);else if(X)w[y]=[d],V(y)&&(z[y]=w[y]);else{const me=[d];ue(y,t.k)&&(y.value=me),t.k&&(w[t.k]=me)}}else X?(w[y]=h,V(y)&&(z[y]=h)):Ae&&(ue(y,t.k)&&(y.value=h),t.k&&(w[t.k]=h))};if(h){const Q=()=>{$e(),ea.delete(t)};Q.id=-1,ea.set(t,Q),Qt(Q,o)}else dl(t),$e()}}}function dl(t){const i=ea.get(t);i&&(i.flags|=8,ea.delete(t))}ha().requestIdleCallback;ha().cancelIdleCallback;const xs=t=>!!t.type.__asyncLoader,ga=t=>t.type.__isKeepAlive;function Yd(t,i){Hu(t,"a",i)}function Jd(t,i){Hu(t,"da",i)}function Hu(t,i,o=Gt){const l=t.__wdc||(t.__wdc=()=>{let u=o;for(;u;){if(u.isDeactivated)return;u=u.parent}return t()});if(va(i,l,o),o){let u=o.parent;for(;u&&u.parent;)ga(u.parent.vnode)&&Xd(l,i,o,u),u=u.parent}}function Xd(t,i,o,l){const u=va(i,t,l,!0);ju(()=>{br(l[i],u)},o)}function va(t,i,o=Gt,l=!1){if(o){const u=o[t]||(o[t]=[]),d=i.__weh||(i.__weh=(...h)=>{Zn();const _=go(o),y=vn(i,o,t,h);return _(),Hn(),y});return l?u.unshift(d):u.push(d),d}}const ui=t=>(i,o=Gt)=>{(!fo||t==="sp")&&va(t,(...l)=>i(...l),o)},Qd=ui("bm"),Li=ui("m"),ef=ui("bu"),tf=ui("u"),_a=ui("bum"),ju=ui("um"),nf=ui("sp"),sf=ui("rtg"),of=ui("rtc");function af(t,i=Gt){va("ec",t,i)}const rf=Symbol.for("v-ndc");function Fe(t,i,o,l){let u;const d=o,h=Ee(t);if(h||xt(t)){const _=h&&qi(t);let y=!1,T=!1;_&&(y=!mn(t),T=li(t),t=pa(t)),u=new Array(t.length);for(let w=0,z=t.length;wi(_,y,void 0,d));else{const _=Object.keys(t);u=new Array(_.length);for(let y=0,T=_.length;y0;return m(),et(le,null,[E("slot",o,l)],T?-2:64)}let d=t[i];d&&d._c&&(d._d=!1),m();const h=d&&Wu(d(o)),_=o.key||h&&h.key,y=et(le,{key:(_&&!Ln(_)?_:`_${i}`)+(!h&&l?"_fb":"")},h||[],h&&t._===1?64:-2);return y.scopeId&&(y.slotScopeIds=[y.scopeId+"-s"]),d&&d._c&&(d._d=!0),y}function Wu(t){return t.some(i=>co(i)?!(i.type===Rt||i.type===le&&!Wu(i.children)):!0)?t:null}const cr=t=>t?hc(t)?xa(t):cr(t.parent):null,io=Ot(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>cr(t.parent),$root:t=>cr(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>Gu(t),$forceUpdate:t=>t.f||(t.f=()=>{Er(t.update)}),$nextTick:t=>t.n||(t.n=Mu.bind(t.proxy)),$watch:t=>jd.bind(t)}),Xa=(t,i)=>t!==ft&&!t.__isScriptSetup&&ot(t,i),uf={get({_:t},i){if(i==="__v_skip")return!0;const{ctx:o,setupState:l,data:u,props:d,accessCache:h,type:_,appContext:y}=t;if(i[0]!=="$"){const U=h[i];if(U!==void 0)switch(U){case 1:return l[i];case 2:return u[i];case 4:return o[i];case 3:return d[i]}else{if(Xa(l,i))return h[i]=1,l[i];if(u!==ft&&ot(u,i))return h[i]=2,u[i];if(ot(d,i))return h[i]=3,d[i];if(o!==ft&&ot(o,i))return h[i]=4,o[i];dr&&(h[i]=0)}}const T=io[i];let w,z;if(T)return i==="$attrs"&&Nt(t.attrs,"get",""),T(t);if((w=_.__cssModules)&&(w=w[i]))return w;if(o!==ft&&ot(o,i))return h[i]=4,o[i];if(z=y.config.globalProperties,ot(z,i))return z[i]},set({_:t},i,o){const{data:l,setupState:u,ctx:d}=t;return Xa(u,i)?(u[i]=o,!0):l!==ft&&ot(l,i)?(l[i]=o,!0):ot(t.props,i)||i[0]==="$"&&i.slice(1)in t?!1:(d[i]=o,!0)},has({_:{data:t,setupState:i,accessCache:o,ctx:l,appContext:u,props:d,type:h}},_){let y;return!!(o[_]||t!==ft&&_[0]!=="$"&&ot(t,_)||Xa(i,_)||ot(d,_)||ot(l,_)||ot(io,_)||ot(u.config.globalProperties,_)||(y=h.__cssModules)&&y[_])},defineProperty(t,i,o){return o.get!=null?t._.accessCache[i]=0:ot(o,"value")&&this.set(t,i,o.value,null),Reflect.defineProperty(t,i,o)}};function fl(t){return Ee(t)?t.reduce((i,o)=>(i[o]=null,i),{}):t}let dr=!0;function cf(t){const i=Gu(t),o=t.proxy,l=t.ctx;dr=!1,i.beforeCreate&&hl(i.beforeCreate,t,"bc");const{data:u,computed:d,methods:h,watch:_,provide:y,inject:T,created:w,beforeMount:z,mounted:U,beforeUpdate:V,updated:ue,activated:X,deactivated:Ae,beforeDestroy:$e,beforeUnmount:Q,destroyed:me,unmounted:oe,render:de,renderTracked:Ne,renderTriggered:nt,errorCaptured:ke,serverPrefetch:Te,expose:Be,inheritAttrs:Ce,components:ee,directives:pe,filters:Re}=i;if(T&&df(T,l,null),h)for(const De in h){const ne=h[De];He(ne)&&(l[De]=ne.bind(o))}if(u){const De=u.call(o,o);at(De)&&(t.data=bt(De))}if(dr=!0,d)for(const De in d){const ne=d[De],rt=He(ne)?ne.bind(o,o):He(ne.get)?ne.get.bind(o,o):Un,ge=!He(ne)&&He(ne.set)?ne.set.bind(o):Un,Me=we({get:rt,set:ge});Object.defineProperty(l,De,{enumerable:!0,configurable:!0,get:()=>Me.value,set:je=>Me.value=je})}if(_)for(const De in _)Ku(_[De],l,o,De);if(y){const De=He(y)?y.call(o):y;Reflect.ownKeys(De).forEach(ne=>{Iu(ne,De[ne])})}w&&hl(w,t,"c");function he(De,ne){Ee(ne)?ne.forEach(rt=>De(rt.bind(o))):ne&&De(ne.bind(o))}if(he(Qd,z),he(Li,U),he(ef,V),he(tf,ue),he(Yd,X),he(Jd,Ae),he(af,ke),he(of,Ne),he(sf,nt),he(_a,Q),he(ju,oe),he(nf,Te),Ee(Be))if(Be.length){const De=t.exposed||(t.exposed={});Be.forEach(ne=>{Object.defineProperty(De,ne,{get:()=>o[ne],set:rt=>o[ne]=rt,enumerable:!0})})}else t.exposed||(t.exposed={});de&&t.render===Un&&(t.render=de),Ce!=null&&(t.inheritAttrs=Ce),ee&&(t.components=ee),pe&&(t.directives=pe),Te&&Zu(t)}function df(t,i,o=Un){Ee(t)&&(t=fr(t));for(const l in t){const u=t[l];let d;at(u)?"default"in u?d=to(u.from||l,u.default,!0):d=to(u.from||l):d=to(u),Bt(d)?Object.defineProperty(i,l,{enumerable:!0,configurable:!0,get:()=>d.value,set:h=>d.value=h}):i[l]=d}}function hl(t,i,o){vn(Ee(t)?t.map(l=>l.bind(i.proxy)):t.bind(i.proxy),i,o)}function Ku(t,i,o,l){let u=l.includes(".")?Du(o,l):()=>o[l];if(xt(t)){const d=i[t];He(d)&&en(u,d)}else if(He(t))en(u,t.bind(o));else if(at(t))if(Ee(t))t.forEach(d=>Ku(d,i,o,l));else{const d=He(t.handler)?t.handler.bind(o):i[t.handler];He(d)&&en(u,d,t)}}function Gu(t){const i=t.type,{mixins:o,extends:l}=i,{mixins:u,optionsCache:d,config:{optionMergeStrategies:h}}=t.appContext,_=d.get(i);let y;return _?y=_:!u.length&&!o&&!l?y=i:(y={},u.length&&u.forEach(T=>ta(y,T,h,!0)),ta(y,i,h)),at(i)&&d.set(i,y),y}function ta(t,i,o,l=!1){const{mixins:u,extends:d}=i;d&&ta(t,d,o,!0),u&&u.forEach(h=>ta(t,h,o,!0));for(const h in i)if(!(l&&h==="expose")){const _=ff[h]||o&&o[h];t[h]=_?_(t[h],i[h]):i[h]}return t}const ff={data:pl,props:ml,emits:ml,methods:qs,computed:qs,beforeCreate:Wt,created:Wt,beforeMount:Wt,mounted:Wt,beforeUpdate:Wt,updated:Wt,beforeDestroy:Wt,beforeUnmount:Wt,destroyed:Wt,unmounted:Wt,activated:Wt,deactivated:Wt,errorCaptured:Wt,serverPrefetch:Wt,components:qs,directives:qs,watch:pf,provide:pl,inject:hf};function pl(t,i){return i?t?function(){return Ot(He(t)?t.call(this,this):t,He(i)?i.call(this,this):i)}:i:t}function hf(t,i){return qs(fr(t),fr(i))}function fr(t){if(Ee(t)){const i={};for(let o=0;oi==="modelValue"||i==="model-value"?t.modelModifiers:t[`${i}Modifiers`]||t[`${Tn(i)}Modifiers`]||t[`${Ci(i)}Modifiers`];function _f(t,i,...o){if(t.isUnmounted)return;const l=t.vnode.props||ft;let u=o;const d=i.startsWith("update:"),h=d&&vf(l,i.slice(7));h&&(h.trim&&(u=o.map(w=>xt(w)?w.trim():w)),h.number&&(u=o.map(fa)));let _,y=l[_=Wa(i)]||l[_=Wa(Tn(i))];!y&&d&&(y=l[_=Wa(Ci(i))]),y&&vn(y,t,6,u);const T=l[_+"Once"];if(T){if(!t.emitted)t.emitted={};else if(t.emitted[_])return;t.emitted[_]=!0,vn(T,t,6,u)}}const yf=new WeakMap;function Yu(t,i,o=!1){const l=o?yf:i.emitsCache,u=l.get(t);if(u!==void 0)return u;const d=t.emits;let h={},_=!1;if(!He(t)){const y=T=>{const w=Yu(T,i,!0);w&&(_=!0,Ot(h,w))};!o&&i.mixins.length&&i.mixins.forEach(y),t.extends&&y(t.extends),t.mixins&&t.mixins.forEach(y)}return!d&&!_?(at(t)&&l.set(t,null),null):(Ee(d)?d.forEach(y=>h[y]=null):Ot(h,d),at(t)&&l.set(t,h),h)}function ya(t,i){return!t||!ua(i)?!1:(i=i.slice(2),i=i==="Once"?i:i.replace(/Once$/,""),ot(t,i[0].toLowerCase()+i.slice(1))||ot(t,Ci(i))||ot(t,i))}function gl(t){const{type:i,vnode:o,proxy:l,withProxy:u,propsOptions:[d],slots:h,attrs:_,emit:y,render:T,renderCache:w,props:z,data:U,setupState:V,ctx:ue,inheritAttrs:X}=t,Ae=Qo(t);let $e,Q;try{if(o.shapeFlag&4){const oe=u||l,de=oe;$e=Bn(T.call(de,oe,w,z,V,U,ue)),Q=_}else{const oe=i;$e=Bn(oe.length>1?oe(z,{attrs:_,slots:h,emit:y}):oe(z,null)),Q=i.props?_:bf(_)}}catch(oe){so.length=0,ma(oe,t,1),$e=E(Rt)}let me=$e;if(Q&&X!==!1){const oe=Object.keys(Q),{shapeFlag:de}=me;oe.length&&de&7&&(d&&oe.some(ca)&&(Q=xf(Q,d)),me=Pi(me,Q,!1,!0))}return o.dirs&&(me=Pi(me,null,!1,!0),me.dirs=me.dirs?me.dirs.concat(o.dirs):o.dirs),o.transition&&lo(me,o.transition),$e=me,Qo(Ae),$e}const bf=t=>{let i;for(const o in t)(o==="class"||o==="style"||ua(o))&&((i||(i={}))[o]=t[o]);return i},xf=(t,i)=>{const o={};for(const l in t)(!ca(l)||!(l.slice(9)in i))&&(o[l]=t[l]);return o};function wf(t,i,o){const{props:l,children:u,component:d}=t,{props:h,children:_,patchFlag:y}=i,T=d.emitsOptions;if(i.dirs||i.transition)return!0;if(o&&y>=0){if(y&1024)return!0;if(y&16)return l?vl(l,h,T):!!h;if(y&8){const w=i.dynamicProps;for(let z=0;zObject.create(Xu),ec=t=>Object.getPrototypeOf(t)===Xu;function Sf(t,i,o,l=!1){const u={},d=Qu();t.propsDefaults=Object.create(null),tc(t,i,u,d);for(const h in t.propsOptions[0])h in u||(u[h]=void 0);o?t.props=l?u:Od(u):t.type.props?t.props=u:t.props=d,t.attrs=d}function Pf(t,i,o,l){const{props:u,attrs:d,vnode:{patchFlag:h}}=t,_=tt(u),[y]=t.propsOptions;let T=!1;if((l||h>0)&&!(h&16)){if(h&8){const w=t.vnode.dynamicProps;for(let z=0;z{y=!0;const[U,V]=nc(z,i,!0);Ot(h,U),V&&_.push(...V)};!o&&i.mixins.length&&i.mixins.forEach(w),t.extends&&w(t.extends),t.mixins&&t.mixins.forEach(w)}if(!d&&!y)return at(t)&&l.set(t,_s),_s;if(Ee(d))for(let w=0;wt==="_"||t==="_ctx"||t==="$stable",zr=t=>Ee(t)?t.map(Bn):[Bn(t)],Cf=(t,i,o)=>{if(i._n)return i;const l=ye((...u)=>zr(i(...u)),o);return l._c=!1,l},ic=(t,i,o)=>{const l=t._ctx;for(const u in t){if(Or(u))continue;const d=t[u];if(He(d))i[u]=Cf(u,d,l);else if(d!=null){const h=zr(d);i[u]=()=>h}}},sc=(t,i)=>{const o=zr(i);t.slots.default=()=>o},oc=(t,i,o)=>{for(const l in i)(o||!Or(l))&&(t[l]=i[l])},Lf=(t,i,o)=>{const l=t.slots=Qu();if(t.vnode.shapeFlag&32){const u=i._;u?(oc(l,i,o),o&&uu(l,"_",u,!0)):ic(i,l)}else i&&sc(t,i)},Mf=(t,i,o)=>{const{vnode:l,slots:u}=t;let d=!0,h=ft;if(l.shapeFlag&32){const _=i._;_?o&&_===1?d=!1:oc(u,i,o):(d=!i.$stable,ic(i,u)),h=i}else i&&(sc(t,i),h={default:1});if(d)for(const _ in u)!Or(_)&&h[_]==null&&delete u[_]},Qt=If;function Ef(t){return Of(t)}function Of(t,i){const o=ha();o.__VUE__=!0;const{insert:l,remove:u,patchProp:d,createElement:h,createText:_,createComment:y,setText:T,setElementText:w,parentNode:z,nextSibling:U,setScopeId:V=Un,insertStaticContent:ue}=t,X=(b,g,M,Z=null,B=null,H=null,ie=void 0,F=null,Y=!!g.dynamicChildren)=>{if(b===g)return;b&&!Ki(b,g)&&(Z=C(b),je(b,B,H,!0),b=null),g.patchFlag===-2&&(Y=!1,g.dynamicChildren=null);const{type:j,ref:Se,shapeFlag:ce}=g;switch(j){case ba:Ae(b,g,M,Z);break;case Rt:$e(b,g,M,Z);break;case er:b==null&&Q(g,M,Z,ie);break;case le:ee(b,g,M,Z,B,H,ie,F,Y);break;default:ce&1?de(b,g,M,Z,B,H,ie,F,Y):ce&6?pe(b,g,M,Z,B,H,ie,F,Y):(ce&64||ce&128)&&j.process(b,g,M,Z,B,H,ie,F,Y,lt)}Se!=null&&B?no(Se,b&&b.ref,H,g||b,!g):Se==null&&b&&b.ref!=null&&no(b.ref,null,H,b,!0)},Ae=(b,g,M,Z)=>{if(b==null)l(g.el=_(g.children),M,Z);else{const B=g.el=b.el;g.children!==b.children&&T(B,g.children)}},$e=(b,g,M,Z)=>{b==null?l(g.el=y(g.children||""),M,Z):g.el=b.el},Q=(b,g,M,Z)=>{[b.el,b.anchor]=ue(b.children,g,M,Z,b.el,b.anchor)},me=({el:b,anchor:g},M,Z)=>{let B;for(;b&&b!==g;)B=U(b),l(b,M,Z),b=B;l(g,M,Z)},oe=({el:b,anchor:g})=>{let M;for(;b&&b!==g;)M=U(b),u(b),b=M;u(g)},de=(b,g,M,Z,B,H,ie,F,Y)=>{if(g.type==="svg"?ie="svg":g.type==="math"&&(ie="mathml"),b==null)Ne(g,M,Z,B,H,ie,F,Y);else{const j=b.el&&b.el._isVueCE?b.el:null;try{j&&j._beginPatch(),Te(b,g,B,H,ie,F,Y)}finally{j&&j._endPatch()}}},Ne=(b,g,M,Z,B,H,ie,F)=>{let Y,j;const{props:Se,shapeFlag:ce,transition:ae,dirs:Pe}=b;if(Y=b.el=h(b.type,H,Se&&Se.is,Se),ce&8?w(Y,b.children):ce&16&&ke(b.children,Y,null,Z,B,Qa(b,H),ie,F),Pe&&Ui(b,null,Z,"created"),nt(Y,b,b.scopeId,ie,Z),Se){for(const be in Se)be!=="value"&&!Xs(be)&&d(Y,be,null,Se[be],H,Z);"value"in Se&&d(Y,"value",null,Se.value,H),(j=Se.onVnodeBeforeMount)&&Nn(j,Z,b)}Pe&&Ui(b,null,Z,"beforeMount");const We=zf(B,ae);We&&ae.beforeEnter(Y),l(Y,g,M),((j=Se&&Se.onVnodeMounted)||We||Pe)&&Qt(()=>{try{j&&Nn(j,Z,b),We&&ae.enter(Y),Pe&&Ui(b,null,Z,"mounted")}finally{}},B)},nt=(b,g,M,Z,B)=>{if(M&&V(b,M),Z)for(let H=0;H{for(let j=Y;j{const F=g.el=b.el;let{patchFlag:Y,dynamicChildren:j,dirs:Se}=g;Y|=b.patchFlag&16;const ce=b.props||ft,ae=g.props||ft;let Pe;if(M&&Zi(M,!1),(Pe=ae.onVnodeBeforeUpdate)&&Nn(Pe,M,g,b),Se&&Ui(g,b,M,"beforeUpdate"),M&&Zi(M,!0),j&&(!b.dynamicChildren||b.dynamicChildren.length!==j.length)&&(Y=0,ie=!1,j=null),(ce.innerHTML&&ae.innerHTML==null||ce.textContent&&ae.textContent==null)&&w(F,""),j?Be(b.dynamicChildren,j,F,M,Z,Qa(g,B),H):ie||ne(b,g,F,null,M,Z,Qa(g,B),H,!1),Y>0){if(Y&16)Ce(F,ce,ae,M,B);else if(Y&2&&ce.class!==ae.class&&d(F,"class",null,ae.class,B),Y&4&&d(F,"style",ce.style,ae.style,B),Y&8){const We=g.dynamicProps;for(let be=0;be{Pe&&Nn(Pe,M,g,b),Se&&Ui(g,b,M,"updated")},Z)},Be=(b,g,M,Z,B,H,ie)=>{for(let F=0;F{if(g!==M){if(g!==ft)for(const H in g)!Xs(H)&&!(H in M)&&d(b,H,g[H],null,B,Z);for(const H in M){if(Xs(H))continue;const ie=M[H],F=g[H];ie!==F&&H!=="value"&&d(b,H,F,ie,B,Z)}"value"in M&&d(b,"value",g.value,M.value,B)}},ee=(b,g,M,Z,B,H,ie,F,Y)=>{const j=g.el=b?b.el:_(""),Se=g.anchor=b?b.anchor:_("");let{patchFlag:ce,dynamicChildren:ae,slotScopeIds:Pe}=g;Pe&&(F=F?F.concat(Pe):Pe),b==null?(l(j,M,Z),l(Se,M,Z),ke(g.children||[],M,Se,B,H,ie,F,Y)):ce>0&&ce&64&&ae&&b.dynamicChildren&&b.dynamicChildren.length===ae.length?(Be(b.dynamicChildren,ae,M,B,H,ie,F),(g.key!=null||B&&g===B.subTree)&&ac(b,g,!0)):ne(b,g,M,Se,B,H,ie,F,Y)},pe=(b,g,M,Z,B,H,ie,F,Y)=>{g.slotScopeIds=F,b==null?g.shapeFlag&512?B.ctx.activate(g,M,Z,ie,Y):Re(g,M,Z,B,H,ie,Y):Ze(b,g,Y)},Re=(b,g,M,Z,B,H,ie)=>{const F=b.component=Vf(b,Z,B);if(ga(b)&&(F.ctx.renderer=lt),Uf(F,!1,ie),F.asyncDep){if(B&&B.registerDep(F,he,ie),!b.el){const Y=F.subTree=E(Rt);$e(null,Y,g,M),b.placeholder=Y.el}}else he(F,b,g,M,B,H,ie)},Ze=(b,g,M)=>{const Z=g.component=b.component;if(wf(b,g,M))if(Z.asyncDep&&!Z.asyncResolved){De(Z,g,M);return}else Z.next=g,Z.update();else g.el=b.el,Z.vnode=g},he=(b,g,M,Z,B,H,ie)=>{const F=()=>{if(b.isMounted){let{next:ce,bu:ae,u:Pe,parent:We,vnode:be}=b;{const Tt=rc(b);if(Tt){ce&&(ce.el=be.el,De(b,ce,ie)),Tt.asyncDep.then(()=>{Qt(()=>{b.isUnmounted||j()},B)});return}}let Ye=ce,dt;Zi(b,!1),ce?(ce.el=be.el,De(b,ce,ie)):ce=be,ae&&qo(ae),(dt=ce.props&&ce.props.onVnodeBeforeUpdate)&&Nn(dt,We,ce,be),Zi(b,!0);const gt=gl(b),_t=b.subTree;b.subTree=gt,X(_t,gt,z(_t.el),C(_t),b,B,H),ce.el=gt.el,Ye===null&&kf(b,gt.el),Pe&&Qt(Pe,B),(dt=ce.props&&ce.props.onVnodeUpdated)&&Qt(()=>Nn(dt,We,ce,be),B)}else{let ce;const{el:ae,props:Pe}=g,{bm:We,m:be,parent:Ye,root:dt,type:gt}=b,_t=xs(g);Zi(b,!1),We&&qo(We),!_t&&(ce=Pe&&Pe.onVnodeBeforeMount)&&Nn(ce,Ye,g),Zi(b,!0);{dt.ce&&dt.ce._hasShadowRoot()&&dt.ce._injectChildStyle(gt,b.parent?b.parent.type:void 0);const Tt=b.subTree=gl(b);X(null,Tt,M,Z,b,B,H),g.el=Tt.el}if(be&&Qt(be,B),!_t&&(ce=Pe&&Pe.onVnodeMounted)){const Tt=g;Qt(()=>Nn(ce,Ye,Tt),B)}(g.shapeFlag&256||Ye&&xs(Ye.vnode)&&Ye.vnode.shapeFlag&256)&&b.a&&Qt(b.a,B),b.isMounted=!0,g=M=Z=null}};b.scope.on();const Y=b.effect=new hu(F);b.scope.off();const j=b.update=Y.run.bind(Y),Se=b.job=Y.runIfDirty.bind(Y);Se.i=b,Se.id=b.uid,Y.scheduler=()=>Er(Se),Zi(b,!0),j()},De=(b,g,M)=>{g.component=b;const Z=b.vnode.props;b.vnode=g,b.next=null,Pf(b,g.props,Z,M),Mf(b,g.children,M),Zn(),ll(b),Hn()},ne=(b,g,M,Z,B,H,ie,F,Y=!1)=>{const j=b&&b.children,Se=b?b.shapeFlag:0,ce=g.children,{patchFlag:ae,shapeFlag:Pe}=g;if(ae>0){if(ae&128){ge(j,ce,M,Z,B,H,ie,F,Y);return}else if(ae&256){rt(j,ce,M,Z,B,H,ie,F,Y);return}}Pe&8?(Se&16&&W(j,B,H),ce!==j&&w(M,ce)):Se&16?Pe&16?ge(j,ce,M,Z,B,H,ie,F,Y):W(j,B,H,!0):(Se&8&&w(M,""),Pe&16&&ke(ce,M,Z,B,H,ie,F,Y))},rt=(b,g,M,Z,B,H,ie,F,Y)=>{b=b||_s,g=g||_s;const j=b.length,Se=g.length,ce=Math.min(j,Se);let ae;for(ae=0;aeSe?W(b,B,H,!0,!1,ce):ke(g,M,Z,B,H,ie,F,Y,ce)},ge=(b,g,M,Z,B,H,ie,F,Y)=>{let j=0;const Se=g.length;let ce=b.length-1,ae=Se-1;for(;j<=ce&&j<=ae;){const Pe=b[j],We=g[j]=Y?si(g[j]):Bn(g[j]);if(Ki(Pe,We))X(Pe,We,M,null,B,H,ie,F,Y);else break;j++}for(;j<=ce&&j<=ae;){const Pe=b[ce],We=g[ae]=Y?si(g[ae]):Bn(g[ae]);if(Ki(Pe,We))X(Pe,We,M,null,B,H,ie,F,Y);else break;ce--,ae--}if(j>ce){if(j<=ae){const Pe=ae+1,We=Peae)for(;j<=ce;)je(b[j],B,H,!0),j++;else{const Pe=j,We=j,be=new Map;for(j=We;j<=ae;j++){const kt=g[j]=Y?si(g[j]):Bn(g[j]);kt.key!=null&&be.set(kt.key,j)}let Ye,dt=0;const gt=ae-We+1;let _t=!1,Tt=0;const _n=new Array(gt);for(j=0;j=gt){je(kt,B,H,!0);continue}let $t;if(kt.key!=null)$t=be.get(kt.key);else for(Ye=We;Ye<=ae;Ye++)if(_n[Ye-We]===0&&Ki(kt,g[Ye])){$t=Ye;break}$t===void 0?je(kt,B,H,!0):(_n[$t-We]=j+1,$t>=Tt?Tt=$t:_t=!0,X(kt,g[$t],M,null,B,H,ie,F,Y),dt++)}const ci=_t?Af(_n):_s;for(Ye=ci.length-1,j=gt-1;j>=0;j--){const kt=We+j,$t=g[kt],En=g[kt+1],Vt=kt+1{const{el:H,type:ie,transition:F,children:Y,shapeFlag:j}=b;if(j&6){Me(b.component.subTree,g,M,Z);return}if(j&128){b.suspense.move(g,M,Z);return}if(j&64){ie.move(b,g,M,lt);return}if(ie===le){l(H,g,M);for(let ce=0;ceF.enter(H),B));else{const{leave:ce,delayLeave:ae,afterLeave:Pe}=F,We=()=>{b.ctx.isUnmounted?u(H):l(H,g,M)},be=()=>{const Ye=H._isLeaving||!!H[pn];H._isLeaving&&H[pn](!0),F.persisted&&!Ye?We():ce(H,()=>{We(),Pe&&Pe()})};ae?ae(H,We,be):be()}else l(H,g,M)},je=(b,g,M,Z=!1,B=!1)=>{const{type:H,props:ie,ref:F,children:Y,dynamicChildren:j,shapeFlag:Se,patchFlag:ce,dirs:ae,cacheIndex:Pe,memo:We}=b;if(ce===-2&&(B=!1),F!=null&&(Zn(),no(F,null,M,b,!0),Hn()),Pe!=null&&(g.renderCache[Pe]=void 0),Se&256){g.ctx.deactivate(b);return}const be=Se&1&&ae,Ye=!xs(b);let dt;if(Ye&&(dt=ie&&ie.onVnodeBeforeUnmount)&&Nn(dt,g,b),Se&6)I(b.component,M,Z);else{if(Se&128){b.suspense.unmount(M,Z);return}be&&Ui(b,null,g,"beforeUnmount"),Se&64?b.type.remove(b,g,M,lt,Z):j&&!j.hasOnce&&(H!==le||ce>0&&ce&64)?W(j,g,M,!1,!0):(H===le&&ce&384||!B&&Se&16)&&W(Y,g,M),Z&&te(b)}const gt=We!=null&&Pe==null;(Ye&&(dt=ie&&ie.onVnodeUnmounted)||be||gt)&&Qt(()=>{dt&&Nn(dt,g,b),be&&Ui(b,null,g,"unmounted"),gt&&(b.el=null)},M)},te=b=>{const{type:g,el:M,anchor:Z,transition:B}=b;if(g===le){$(M,Z);return}if(g===er){oe(b);return}const H=()=>{u(M),B&&!B.persisted&&B.afterLeave&&B.afterLeave()};if(b.shapeFlag&1&&B&&!B.persisted){const{leave:ie,delayLeave:F}=B,Y=()=>ie(M,H);F?F(b.el,H,Y):Y()}else H()},$=(b,g)=>{let M;for(;b!==g;)M=U(b),u(b),b=M;u(g)},I=(b,g,M)=>{const{bum:Z,scope:B,job:H,subTree:ie,um:F,m:Y,a:j}=b;yl(Y),yl(j),Z&&qo(Z),B.stop(),H&&(H.flags|=8,je(ie,b,g,M)),F&&Qt(F,g),Qt(()=>{b.isUnmounted=!0},g)},W=(b,g,M,Z=!1,B=!1,H=0)=>{for(let ie=H;ie{if(b.shapeFlag&6)return C(b.component.subTree);if(b.shapeFlag&128)return b.suspense.next();const g=U(b.anchor||b.el),M=g&&g[Wd];return M?U(M):g};let O=!1;const ht=(b,g,M)=>{let Z;b==null?g._vnode&&(je(g._vnode,null,null,!0),Z=g._vnode.component):X(g._vnode||null,b,g,null,null,null,M),g._vnode=b,O||(O=!0,ll(Z),Ou(),O=!1)},lt={p:X,um:je,m:Me,r:te,mt:Re,mc:ke,pc:ne,pbc:Be,n:C,o:t};return{render:ht,hydrate:void 0,createApp:gf(ht)}}function Qa({type:t,props:i},o){return o==="svg"&&t==="foreignObject"||o==="mathml"&&t==="annotation-xml"&&i&&i.encoding&&i.encoding.includes("html")?void 0:o}function Zi({effect:t,job:i},o){o?(t.flags|=32,i.flags|=4):(t.flags&=-33,i.flags&=-5)}function zf(t,i){return(!t||t&&!t.pendingBranch)&&i&&!i.persisted}function ac(t,i,o=!1){const l=t.children,u=i.children;if(Ee(l)&&Ee(u))for(let d=0;d>1,t[o[_]]0&&(i[l]=o[d-1]),o[d]=l)}}for(d=o.length,h=o[d-1];d-- >0;)o[d]=h,h=i[h];return o}function rc(t){const i=t.subTree.component;if(i)return i.asyncDep&&!i.asyncResolved?i:rc(i)}function yl(t){if(t)for(let i=0;it.__isSuspense;function If(t,i){i&&i.pendingBranch?Ee(t)?i.effects.push(...t):i.effects.push(t):Ud(t)}const le=Symbol.for("v-fgt"),ba=Symbol.for("v-txt"),Rt=Symbol.for("v-cmt"),er=Symbol.for("v-stc"),so=[];let on=null;function m(t=!1){so.push(on=t?null:[])}function $f(){so.pop(),on=so[so.length-1]||null}let uo=1;function na(t,i=!1){uo+=t,t<0&&on&&i&&(on.hasOnce=!0)}function cc(t){return t.dynamicChildren=uo>0?on||_s:null,$f(),uo>0&&on&&on.push(t),t}function v(t,i,o,l,u,d){return cc(r(t,i,o,l,u,d,!0))}function et(t,i,o,l,u){return cc(E(t,i,o,l,u,!0))}function co(t){return t?t.__v_isVNode===!0:!1}function Ki(t,i){return t.type===i.type&&t.key===i.key}const dc=({key:t})=>t??null,Yo=({ref:t,ref_key:i,ref_for:o})=>(typeof t=="number"&&(t=""+t),t!=null?xt(t)||Bt(t)||He(t)?{i:Ft,r:t,k:i,f:!!o}:t:null);function r(t,i=null,o=null,l=0,u=null,d=t===le?0:1,h=!1,_=!1){const y={__v_isVNode:!0,__v_skip:!0,type:t,props:i,key:i&&dc(i),ref:i&&Yo(i),scopeId:Au,slotScopeIds:null,children:o,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:d,patchFlag:l,dynamicProps:u,dynamicChildren:null,appContext:null,ctx:Ft};return _?(ia(y,o),d&128&&t.normalize(y)):o&&(y.shapeFlag|=xt(o)?8:16),uo>0&&!h&&on&&(y.patchFlag>0||d&6)&&y.patchFlag!==32&&on.push(y),y}const E=Df;function Df(t,i=null,o=null,l=0,u=null,d=!1){if((!t||t===rf)&&(t=Rt),co(t)){const _=Pi(t,i,!0);return o&&ia(_,o),uo>0&&!d&&on&&(_.shapeFlag&6?on[on.indexOf(t)]=_:on.push(_)),_.patchFlag=-2,_}if(Wf(t)&&(t=t.__vccOpts),i){i=Nf(i);let{class:_,style:y}=i;_&&!xt(_)&&(i.class=Le(_)),at(y)&&(Mr(y)&&!Ee(y)&&(y=Ot({},y)),i.style=Ss(y))}const h=xt(t)?1:uc(t)?128:Nu(t)?64:at(t)?4:He(t)?2:0;return r(t,i,o,l,u,h,d,!0)}function Nf(t){return t?Mr(t)||ec(t)?Ot({},t):t:null}function Pi(t,i,o=!1,l=!1){const{props:u,ref:d,patchFlag:h,children:_,transition:y}=t,T=i?Rf(u||{},i):u,w={__v_isVNode:!0,__v_skip:!0,type:t.type,props:T,key:T&&dc(T),ref:i&&i.ref?o&&d?Ee(d)?d.concat(Yo(i)):[d,Yo(i)]:Yo(i):d,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:_,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:i&&t.type!==le?h===-1?16:h|16:h,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:y,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&Pi(t.ssContent),ssFallback:t.ssFallback&&Pi(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return y&&l&&lo(w,y.clone(w)),w}function D(t=" ",i=0){return E(ba,null,t,i)}function R(t="",i=!1){return i?(m(),et(Rt,null,t)):E(Rt,null,t)}function Bn(t){return t==null||typeof t=="boolean"?E(Rt):Ee(t)?E(le,null,t.slice()):co(t)?si(t):E(ba,null,String(t))}function si(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:Pi(t)}function ia(t,i){let o=0;const{shapeFlag:l}=t;if(i==null)i=null;else if(Ee(i))o=16;else if(typeof i=="object")if(l&65){const u=i.default;u&&(u._c&&(u._d=!1),ia(t,u()),u._c&&(u._d=!0));return}else{o=32;const u=i._;!u&&!ec(i)?i._ctx=Ft:u===3&&Ft&&(Ft.slots._===1?i._=1:(i._=2,t.patchFlag|=1024))}else if(He(i)){if(l&65){ia(t,{default:i});return}i={default:i,_ctx:Ft},o=32}else i=String(i),l&64?(o=16,i=[D(i)]):o=8;t.children=i,t.shapeFlag|=o}function Rf(...t){const i={};for(let o=0;oGt||Ft;let sa,pr;{const t=ha(),i=(o,l)=>{let u;return(u=t[o])||(u=t[o]=[]),u.push(l),d=>{u.length>1?u.forEach(h=>h(d)):u[0](d)}};sa=i("__VUE_INSTANCE_SETTERS__",o=>Gt=o),pr=i("__VUE_SSR_SETTERS__",o=>fo=o)}const go=t=>{const i=Gt;return sa(t),t.scope.on(),()=>{t.scope.off(),sa(i)}},bl=()=>{Gt&&Gt.scope.off(),sa(null)};function hc(t){return t.vnode.shapeFlag&4}let fo=!1;function Uf(t,i=!1,o=!1){i&&pr(i);const{props:l,children:u}=t.vnode,d=hc(t);Sf(t,l,d,i),Lf(t,u,o||i);const h=d?Zf(t,i):void 0;return i&&pr(!1),h}function Zf(t,i){const o=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,uf);const{setup:l}=o;if(l){Zn();const u=t.setupContext=l.length>1?jf(t):null,d=go(t),h=mo(l,t,0,[t.props,u]),_=ou(h);if(Hn(),d(),(_||t.sp)&&!xs(t)&&Zu(t),_){if(h.then(bl,bl),i)return h.then(y=>{xl(t,y)}).catch(y=>{ma(y,t,0)});t.asyncDep=h}else xl(t,h)}else pc(t)}function xl(t,i,o){He(i)?t.type.__ssrInlineRender?t.ssrRender=i:t.render=i:at(i)&&(t.setupState=Cu(i)),pc(t)}function pc(t,i,o){const l=t.type;t.render||(t.render=l.render||Un);{const u=go(t);Zn();try{cf(t)}finally{Hn(),u()}}}const Hf={get(t,i){return Nt(t,"get",""),t[i]}};function jf(t){const i=o=>{t.exposed=o||{}};return{attrs:new Proxy(t.attrs,Hf),slots:t.slots,emit:t.emit,expose:i}}function xa(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(Cu(zd(t.exposed)),{get(i,o){if(o in i)return i[o];if(o in io)return io[o](t)},has(i,o){return o in i||o in io}})):t.proxy}function Wf(t){return He(t)&&"__vccOpts"in t}const we=(t,i)=>Nd(t,i,fo);function Kf(t,i,o){try{na(-1);const l=arguments.length;return l===2?at(i)&&!Ee(i)?co(i)?E(t,null,[i]):E(t,i):E(t,null,i):(l>3?o=Array.prototype.slice.call(arguments,2):l===3&&co(o)&&(o=[o]),E(t,i,o))}finally{na(1)}}const Gf="3.5.39";/** +* @vue/runtime-dom v3.5.39 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let mr;const wl=typeof window<"u"&&window.trustedTypes;if(wl)try{mr=wl.createPolicy("vue",{createHTML:t=>t})}catch{}const mc=mr?t=>mr.createHTML(t):t=>t,qf="http://www.w3.org/2000/svg",Yf="http://www.w3.org/1998/Math/MathML",ii=typeof document<"u"?document:null,kl=ii&&ii.createElement("template"),Jf={insert:(t,i,o)=>{i.insertBefore(t,o||null)},remove:t=>{const i=t.parentNode;i&&i.removeChild(t)},createElement:(t,i,o,l)=>{const u=i==="svg"?ii.createElementNS(qf,t):i==="mathml"?ii.createElementNS(Yf,t):o?ii.createElement(t,{is:o}):ii.createElement(t);return t==="select"&&l&&l.multiple!=null&&u.setAttribute("multiple",l.multiple),u},createText:t=>ii.createTextNode(t),createComment:t=>ii.createComment(t),setText:(t,i)=>{t.nodeValue=i},setElementText:(t,i)=>{t.textContent=i},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>ii.querySelector(t),setScopeId(t,i){t.setAttribute(i,"")},insertStaticContent(t,i,o,l,u,d){const h=o?o.previousSibling:i.lastChild;if(u&&(u===d||u.nextSibling))for(;i.insertBefore(u.cloneNode(!0),o),!(u===d||!(u=u.nextSibling)););else{kl.innerHTML=mc(l==="svg"?`${t}`:l==="mathml"?`${t}`:t);const _=kl.content;if(l==="svg"||l==="mathml"){const y=_.firstChild;for(;y.firstChild;)_.appendChild(y.firstChild);_.removeChild(y)}i.insertBefore(_,o)}return[h?h.nextSibling:i.firstChild,o?o.previousSibling:i.lastChild]}},wi="transition",Ks="animation",ho=Symbol("_vtc"),gc={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},Xf=Ot({},Ru,gc),Qf=t=>(t.displayName="Transition",t.props=Xf,t),eh=Qf((t,{slots:i})=>Kf(qd,th(t),i)),Hi=(t,i=[])=>{Ee(t)?t.forEach(o=>o(...i)):t&&t(...i)},Sl=t=>t?Ee(t)?t.some(i=>i.length>1):t.length>1:!1;function th(t){const i={};for(const ee in t)ee in gc||(i[ee]=t[ee]);if(t.css===!1)return i;const{name:o="v",type:l,duration:u,enterFromClass:d=`${o}-enter-from`,enterActiveClass:h=`${o}-enter-active`,enterToClass:_=`${o}-enter-to`,appearFromClass:y=d,appearActiveClass:T=h,appearToClass:w=_,leaveFromClass:z=`${o}-leave-from`,leaveActiveClass:U=`${o}-leave-active`,leaveToClass:V=`${o}-leave-to`}=t,ue=nh(u),X=ue&&ue[0],Ae=ue&&ue[1],{onBeforeEnter:$e,onEnter:Q,onEnterCancelled:me,onLeave:oe,onLeaveCancelled:de,onBeforeAppear:Ne=$e,onAppear:nt=Q,onAppearCancelled:ke=me}=i,Te=(ee,pe,Re,Ze)=>{ee._enterCancelled=Ze,ji(ee,pe?w:_),ji(ee,pe?T:h),Re&&Re()},Be=(ee,pe)=>{ee._isLeaving=!1,ji(ee,z),ji(ee,V),ji(ee,U),pe&&pe()},Ce=ee=>(pe,Re)=>{const Ze=ee?nt:Q,he=()=>Te(pe,ee,Re);Hi(Ze,[pe,he]),Pl(()=>{ji(pe,ee?y:d),ni(pe,ee?w:_),Sl(Ze)||Tl(pe,l,X,he)})};return Ot(i,{onBeforeEnter(ee){Hi($e,[ee]),ni(ee,d),ni(ee,h)},onBeforeAppear(ee){Hi(Ne,[ee]),ni(ee,y),ni(ee,T)},onEnter:Ce(!1),onAppear:Ce(!0),onLeave(ee,pe){ee._isLeaving=!0;const Re=()=>Be(ee,pe);ni(ee,z),ee._enterCancelled?(ni(ee,U),Ml(ee)):(Ml(ee),ni(ee,U)),Pl(()=>{ee._isLeaving&&(ji(ee,z),ni(ee,V),Sl(oe)||Tl(ee,l,Ae,Re))}),Hi(oe,[ee,Re])},onEnterCancelled(ee){Te(ee,!1,void 0,!0),Hi(me,[ee])},onAppearCancelled(ee){Te(ee,!0,void 0,!0),Hi(ke,[ee])},onLeaveCancelled(ee){Be(ee),Hi(de,[ee])}})}function nh(t){if(t==null)return null;if(at(t))return[tr(t.enter),tr(t.leave)];{const i=tr(t);return[i,i]}}function tr(t){return sd(t)}function ni(t,i){i.split(/\s+/).forEach(o=>o&&t.classList.add(o)),(t[ho]||(t[ho]=new Set)).add(i)}function ji(t,i){i.split(/\s+/).forEach(l=>l&&t.classList.remove(l));const o=t[ho];o&&(o.delete(i),o.size||(t[ho]=void 0))}function Pl(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let ih=0;function Tl(t,i,o,l){const u=t._endId=++ih,d=()=>{u===t._endId&&l()};if(o!=null)return setTimeout(d,o);const{type:h,timeout:_,propCount:y}=sh(t,i);if(!h)return l();const T=h+"end";let w=0;const z=()=>{t.removeEventListener(T,U),d()},U=V=>{V.target===t&&++w>=y&&z()};setTimeout(()=>{w(o[ue]||"").split(", "),u=l(`${wi}Delay`),d=l(`${wi}Duration`),h=Cl(u,d),_=l(`${Ks}Delay`),y=l(`${Ks}Duration`),T=Cl(_,y);let w=null,z=0,U=0;i===wi?h>0&&(w=wi,z=h,U=d.length):i===Ks?T>0&&(w=Ks,z=T,U=y.length):(z=Math.max(h,T),w=z>0?h>T?wi:Ks:null,U=w?w===wi?d.length:y.length:0);const V=w===wi&&/\b(?:transform|all)(?:,|$)/.test(l(`${wi}Property`).toString());return{type:w,timeout:z,propCount:U,hasTransform:V}}function Cl(t,i){for(;t.lengthLl(o)+Ll(t[l])))}function Ll(t){return t==="auto"?0:Number(t.slice(0,-1).replace(",","."))*1e3}function Ml(t){return(t?t.ownerDocument:document).body.offsetHeight}function oh(t,i,o){const l=t[ho];l&&(i=(i?[i,...l]:[...l]).join(" ")),i==null?t.removeAttribute("class"):o?t.setAttribute("class",i):t.className=i}const oa=Symbol("_vod"),vc=Symbol("_vsh"),ah={name:"show",beforeMount(t,{value:i},{transition:o}){t[oa]=t.style.display==="none"?"":t.style.display,o&&i?o.beforeEnter(t):Gs(t,i)},mounted(t,{value:i},{transition:o}){o&&i&&o.enter(t)},updated(t,{value:i,oldValue:o},{transition:l}){!i!=!o&&(l?i?(l.beforeEnter(t),Gs(t,!0),l.enter(t)):l.leave(t,()=>{Gs(t,!1)}):Gs(t,i))},beforeUnmount(t,{value:i}){Gs(t,i)}};function Gs(t,i){t.style.display=i?t[oa]:"none",t[vc]=!i}const rh=Symbol(""),lh=/(?:^|;)\s*display\s*:/;function uh(t,i,o){const l=t.style,u=xt(o);let d=!1;if(o&&!u){if(i)if(xt(i))for(const h of i.split(";")){const _=h.slice(0,h.indexOf(":")).trim();o[_]==null&&Ys(l,_,"")}else for(const h in i)o[h]==null&&Ys(l,h,"");for(const h in o){h==="display"&&(d=!0);const _=o[h];_!=null?dh(t,h,!xt(i)&&i?i[h]:void 0,_)||Ys(l,h,_):Ys(l,h,"")}}else if(u){if(i!==o){const h=l[rh];h&&(o+=";"+h),l.cssText=o,d=lh.test(o)}}else i&&t.removeAttribute("style");oa in t&&(t[oa]=d?l.display:"",t[vc]&&(l.display="none"))}const El=/\s*!important$/;function Ys(t,i,o){if(Ee(o))o.forEach(l=>Ys(t,i,l));else if(o==null&&(o=""),i.startsWith("--"))t.setProperty(i,o);else{const l=ch(t,i);El.test(o)?t.setProperty(Ci(l),o.replace(El,""),"important"):t[l]=o}}const Ol=["Webkit","Moz","ms"],nr={};function ch(t,i){const o=nr[i];if(o)return o;let l=Tn(i);if(l!=="filter"&&l in t)return nr[i]=l;l=lu(l);for(let u=0;uir||(vh.then(()=>ir=0),ir=Date.now());function yh(t,i){const o=l=>{if(!l._vts)l._vts=Date.now();else if(l._vts<=o.attached)return;const u=o.value;if(Ee(u)){const d=l.stopImmediatePropagation;l.stopImmediatePropagation=()=>{d.call(l),l._stopped=!0};const h=u.slice(),_=[l];for(let y=0;yt.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,bh=(t,i,o,l,u,d)=>{const h=u==="svg";i==="class"?oh(t,l,h):i==="style"?uh(t,o,l):ua(i)?ca(i)||hh(t,i,o,l,d):(i[0]==="."?(i=i.slice(1),!0):i[0]==="^"?(i=i.slice(1),!1):xh(t,i,l,h))?(Il(t,i,l),!t.tagName.includes("-")&&(i==="value"||i==="checked"||i==="selected")&&Al(t,i,l,h,d,i!=="value")):t._isVueCE&&(wh(t,i)||t._def.__asyncLoader&&(/[A-Z]/.test(i)||!xt(l)))?Il(t,Tn(i),l,d,i):(i==="true-value"?t._trueValue=l:i==="false-value"&&(t._falseValue=l),Al(t,i,l,h))};function xh(t,i,o,l){if(l)return!!(i==="innerHTML"||i==="textContent"||i in t&&Dl(i)&&He(o));if(i==="spellcheck"||i==="draggable"||i==="translate"||i==="autocorrect"||i==="sandbox"&&t.tagName==="IFRAME"||i==="form"||i==="list"&&t.tagName==="INPUT"||i==="type"&&t.tagName==="TEXTAREA")return!1;if(i==="width"||i==="height"){const u=t.tagName;if(u==="IMG"||u==="VIDEO"||u==="CANVAS"||u==="SOURCE")return!1}return Dl(i)&&xt(o)?!1:i in t}function wh(t,i){const o=t._def.props;if(!o)return!1;const l=Tn(i);return Array.isArray(o)?o.some(u=>Tn(u)===l):Object.keys(o).some(u=>Tn(u)===l)}const Ti=t=>{const i=t.props["onUpdate:modelValue"]||!1;return Ee(i)?o=>qo(i,o):i};function kh(t){t.target.composing=!0}function Nl(t){const i=t.target;i.composing&&(i.composing=!1,i.dispatchEvent(new Event("input")))}const gn=Symbol("_assign");function Rl(t,i,o){return i&&(t=t.trim()),o&&(t=fa(t)),t}const ve={created(t,{modifiers:{lazy:i,trim:o,number:l}},u){t[gn]=Ti(u);const d=l||u.props&&u.props.type==="number";ri(t,i?"change":"input",h=>{h.target.composing||t[gn](Rl(t.value,o,d))}),(o||d)&&ri(t,"change",()=>{t.value=Rl(t.value,o,d)}),i||(ri(t,"compositionstart",kh),ri(t,"compositionend",Nl),ri(t,"change",Nl))},mounted(t,{value:i}){t.value=i??""},beforeUpdate(t,{value:i,oldValue:o,modifiers:{lazy:l,trim:u,number:d}},h){if(t[gn]=Ti(h),t.composing)return;const _=(d||t.type==="number")&&!/^0\d/.test(t.value)?fa(t.value):t.value,y=i??"";if(_===y)return;const T=t.getRootNode();(T instanceof Document||T instanceof ShadowRoot)&&T.activeElement===t&&t.type!=="range"&&(l&&i===o||u&&t.value.trim()===y)||(t.value=y)}},aa={deep:!0,created(t,i,o){t[gn]=Ti(o),ri(t,"change",()=>{const l=t._modelValue,u=Ts(t),d=t.checked,h=t[gn];if(Ee(l)){const _=wr(l,u),y=_!==-1;if(d&&!y)h(l.concat(u));else if(!d&&y){const T=[...l];T.splice(_,1),h(T)}}else if(Cs(l)){const _=new Set(l);d?_.add(u):_.delete(u),h(_)}else h(_c(t,d))})},mounted:Fl,beforeUpdate(t,i,o){t[gn]=Ti(o),Fl(t,i,o)}};function Fl(t,{value:i,oldValue:o},l){t._modelValue=i;let u;if(Ee(i))u=wr(i,l.props.value)>-1;else if(Cs(i))u=i.has(l.props.value);else{if(i===o)return;u=Si(i,_c(t,!0))}t.checked!==u&&(t.checked=u)}const Sh={created(t,{value:i},o){t.checked=Si(i,o.props.value),t[gn]=Ti(o),ri(t,"change",()=>{t[gn](Ts(t))})},beforeUpdate(t,{value:i,oldValue:o},l){t[gn]=Ti(l),i!==o&&(t.checked=Si(i,l.props.value))}},Et={deep:!0,created(t,{value:i,modifiers:{number:o}},l){const u=Cs(i);ri(t,"change",()=>{const d=Array.prototype.filter.call(t.options,h=>h.selected).map(h=>o?fa(Ts(h)):Ts(h));t[gn](t.multiple?u?new Set(d):d:d[0]),t._assigning=!0,Mu(()=>{t._assigning=!1})}),t[gn]=Ti(l)},mounted(t,{value:i}){Bl(t,i)},beforeUpdate(t,i,o){t[gn]=Ti(o)},updated(t,{value:i}){t._assigning||Bl(t,i)}};function Bl(t,i){const o=t.multiple,l=Ee(i);if(!(o&&!l&&!Cs(i))){for(let u=0,d=t.options.length;uString(T)===String(_)):h.selected=wr(i,_)>-1}else h.selected=i.has(_);else if(Si(Ts(h),i)){t.selectedIndex!==u&&(t.selectedIndex=u);return}}!o&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function Ts(t){return"_value"in t?t._value:t.value}function _c(t,i){const o=i?"_trueValue":"_falseValue";return o in t?t[o]:i}const Ph={created(t,i,o){Wo(t,i,o,null,"created")},mounted(t,i,o){Wo(t,i,o,null,"mounted")},beforeUpdate(t,i,o,l){Wo(t,i,o,l,"beforeUpdate")},updated(t,i,o,l){Wo(t,i,o,l,"updated")}};function Th(t,i){switch(t){case"SELECT":return Et;case"TEXTAREA":return ve;default:switch(i){case"checkbox":return aa;case"radio":return Sh;default:return ve}}}function Wo(t,i,o,l,u){const h=Th(t.tagName,o.props&&o.props.type)[u];h&&h(t,i,o,l)}const Ch=["ctrl","shift","alt","meta"],Lh={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,i)=>Ch.some(o=>t[`${o}Key`]&&!i.includes(o))},yc=(t,i)=>{if(!t)return t;const o=t._withMods||(t._withMods={}),l=i.join(".");return o[l]||(o[l]=((u,...d)=>{for(let h=0;h{const o=t._withKeys||(t._withKeys={}),l=i.join(".");return o[l]||(o[l]=(u=>{if(!("key"in u))return;const d=Ci(u.key);if(i.some(h=>h===d||Mh[h]===d))return t(u)}))},Eh=Ot({patchProp:bh},Jf);let Ul;function Oh(){return Ul||(Ul=Ef(Eh))}const zh=((...t)=>{const i=Oh().createApp(...t),{mount:o}=i;return i.mount=l=>{const u=Ih(l);if(!u)return;const d=i._component;!He(d)&&!d.render&&!d.template&&(d.template=u.innerHTML),u.nodeType===1&&(u.textContent="");const h=o(u,!1,Ah(u));return u instanceof Element&&(u.removeAttribute("v-cloak"),u.setAttribute("data-v-app","")),h},i});function Ah(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function Ih(t){return xt(t)?document.querySelector(t):t}const bc="pv_theme",Zl={light:"#EEF0F3",dark:"#0B1730"},ra=typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;function xc(){return ra&&ra.matches?"dark":"light"}function $h(){try{return localStorage.getItem(bc)||"light"}catch{return"light"}}function wc(t){return t==="system"?xc():t}function kc(t){const i=document.documentElement;i.setAttribute("data-theme",t),i.style.backgroundColor=Zl[t]||Zl.light}const Yi=K($h()),ks=K(wc(Yi.value));function la(t){Yi.value=t;const i=wc(t);ks.value=i,kc(i);try{localStorage.setItem(bc,t)}catch{}}function Hl(){la(ks.value==="dark"?"light":"dark")}ra&&ra.addEventListener("change",()=>{if(Yi.value==="system"){const t=xc();ks.value=t,kc(t)}});async function Dh(){try{const t=await fetch("/bff/config");return t.ok?await t.json():{apiBase:""}}catch{return{apiBase:""}}}async function jl(){try{const t=await fetch("/bff/me");return t.ok?await t.json():null}catch{return null}}async function Nh(t,i,o){const l=await fetch("/bff/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t,password:i,apiBase:o})});return{ok:l.ok,status:l.status,body:await l.json().catch(()=>({}))}}async function Rh(){try{await fetch("/bff/logout",{method:"POST"})}catch{}}async function Fh(){try{const t=await fetch("/bff/devices");return t.ok?await t.json():[]}catch{return[]}}async function Bh(){try{const t=await fetch("/bff/users");return t.ok?{ok:!0,status:200,users:(await t.json()).users||[]}:{ok:!1,status:t.status,users:[]}}catch{return{ok:!1,status:0,users:[]}}}async function Vh(t,i,o,l){const u=await fetch("/bff/users",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t,password:i,role:o,organization:l})});return{ok:u.ok,status:u.status,body:await u.json().catch(()=>({}))}}async function Uh(t,i){const o=await fetch(`/bff/users/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return{ok:o.ok,status:o.status,body:await o.json().catch(()=>({}))}}async function Zh(t){const i=await fetch(`/bff/users/${encodeURIComponent(t)}`,{method:"DELETE"});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function Hh(){try{const t=await fetch("/bff/orgs");return t.ok?{ok:!0,status:200,organizations:(await t.json()).organizations||[]}:{ok:!1,status:t.status,organizations:[]}}catch{return{ok:!1,status:0,organizations:[]}}}async function jh(t){const i=await fetch("/bff/orgs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t})});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function Wh(t,i){const o=await fetch(`/bff/orgs/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i})});return{ok:o.ok,status:o.status,body:await o.json().catch(()=>({}))}}async function Kh(t){const i=await fetch(`/bff/orgs/${encodeURIComponent(t)}`,{method:"DELETE"});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function Gh(){try{const t=await fetch("/bff/preferences");if(!t.ok)return null;const i=await t.json();return i&&typeof i.preferences=="object"?i.preferences:null}catch{return null}}async function qh(t){try{return(await fetch("/bff/preferences",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({preferences:t})})).ok}catch{return!1}}async function Yh(){try{const t=await fetch("/bff/integrations/opensky");return t.ok?{ok:!0,status:200,body:await t.json()}:{ok:!1,status:t.status,body:await t.json().catch(()=>({}))}}catch{return{ok:!1,status:0,body:{}}}}async function Wl(t){const i=await fetch("/bff/integrations/opensky",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function Jh(){const t=await fetch("/bff/integrations/opensky/health",{method:"POST"});return{ok:t.ok,status:t.status,body:await t.json().catch(()=>({}))}}async function Xh(){try{const t=await fetch("/bff/integrations/filetransfer");return t.ok?{ok:!0,status:200,body:await t.json()}:{ok:!1,status:t.status,body:await t.json().catch(()=>({}))}}catch{return{ok:!1,status:0,body:{}}}}async function Kl(t){const i=await fetch("/bff/integrations/filetransfer",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function Qh(){const t=await fetch("/bff/integrations/filetransfer/health",{method:"POST"});return{ok:t.ok,status:t.status,body:await t.json().catch(()=>({}))}}async function ep(){try{const t=await fetch("/bff/integrations/localstorage");return t.ok?{ok:!0,status:200,body:await t.json()}:{ok:!1,status:t.status,body:await t.json().catch(()=>({}))}}catch{return{ok:!1,status:0,body:{}}}}async function Ko(t){const i=await fetch("/bff/integrations/localstorage",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function tp(){const t=await fetch("/bff/integrations/localstorage/health",{method:"POST"});return{ok:t.ok,status:t.status,body:await t.json().catch(()=>({}))}}async function np(){try{const t=await fetch("/bff/integrations/webdav");return t.ok?{ok:!0,status:200,body:await t.json()}:{ok:!1,status:t.status,body:await t.json().catch(()=>({}))}}catch{return{ok:!1,status:0,body:{}}}}async function Gl(t){const i=await fetch("/bff/integrations/webdav",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function ip(){const t=await fetch("/bff/integrations/webdav/health",{method:"POST"});return{ok:t.ok,status:t.status,body:await t.json().catch(()=>({}))}}async function Sc(){try{const t=await fetch("/bff/drones");return t.ok?{ok:!0,status:200,drones:(await t.json()).drones||[]}:{ok:!1,status:t.status,drones:[]}}catch{return{ok:!1,status:0,drones:[]}}}async function sp(t){const i=await fetch("/bff/drones",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function op(t,i){const o=await fetch(`/bff/drones/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return{ok:o.ok,status:o.status,body:await o.json().catch(()=>({}))}}async function ap(t){const i=await fetch(`/bff/drones/${encodeURIComponent(t)}`,{method:"DELETE"});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function rp(){try{const t=await fetch("/bff/flights");return t.ok?{ok:!0,status:200,flights:(await t.json()).flights||[]}:{ok:!1,status:t.status,flights:[]}}catch{return{ok:!1,status:0,flights:[]}}}async function lp(t){const i=await fetch("/bff/flights",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function up(t,i){const o=await fetch(`/bff/flights/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return{ok:o.ok,status:o.status,body:await o.json().catch(()=>({}))}}async function cp(t){const i=await fetch(`/bff/flights/${encodeURIComponent(t)}`,{method:"DELETE"});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}function dp(){return"/bff/logbook/export"}async function fp(t){try{const i=t!=null&&t!==""?`?expiring=${encodeURIComponent(t)}`:"",o=await fetch(`/bff/documents${i}`);return o.ok?{ok:!0,status:200,documents:(await o.json()).documents||[]}:{ok:!1,status:o.status,documents:[]}}catch{return{ok:!1,status:0,documents:[]}}}async function hp(t,i){const o=new FormData;Object.entries(t).forEach(([u,d])=>{d!=null&&d!==""&&o.append(u,d)}),i&&o.append("file",i);const l=await fetch("/bff/documents",{method:"POST",body:o});return{ok:l.ok,status:l.status,body:await l.json().catch(()=>({}))}}async function pp(t,i){const o=await fetch(`/bff/documents/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return{ok:o.ok,status:o.status,body:await o.json().catch(()=>({}))}}async function mp(t){const i=await fetch(`/bff/documents/${encodeURIComponent(t)}`,{method:"DELETE"});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}function gp(t){return`/bff/documents/${encodeURIComponent(t)}/file`}async function vp(t,i,o){const l=await fetch(`/bff/devices/${encodeURIComponent(t)}/command`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:i,payload:o})});return{ok:l.ok,body:await l.json().catch(()=>({}))}}const Pc="pv_prefs",gr={name:"",username:"",displayName:"",bio:"",avatar:"",showEmail:!1,fontSize:"md",language:"en",region:"US",dateFormat:"MDY",timeFormat:"24",reduceMotion:!1,twoFactor:!1};function _p(){try{return{...gr,...JSON.parse(localStorage.getItem(Pc)||"{}")||{}}}catch{return{...gr}}}const ze=bt(_p());function Tc(){try{localStorage.setItem(Pc,JSON.stringify(ze))}catch{}}function Cc(t){if(!t||typeof t!="object")return!1;for(const i of Object.keys(gr))i in t&&(ze[i]=t[i]);return!0}const yp={sm:15,md:16,lg:18};function Ar(t){document.documentElement.style.fontSize=(yp[t]||16)+"px"}function Ir(t){document.documentElement.classList.toggle("reduce-motion",!!t)}function Lc(t){const i=new Date(t),o=i.getFullYear(),l=String(i.getMonth()+1).padStart(2,"0"),u=String(i.getDate()).padStart(2,"0");let d;switch(ze.dateFormat){case"DMY":d=`${u}/${l}/${o}`;break;case"YMD":d=`${o}/${l}/${u}`;break;case"ISO":d=`${o}-${l}-${u}`;break;default:d=`${l}/${u}/${o}`}let h;return ze.timeFormat==="12"?h=i.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0}):h=`${String(i.getHours()).padStart(2,"0")}:${String(i.getMinutes()).padStart(2,"0")}:${String(i.getSeconds()).padStart(2,"0")}`,{date:d,time:h}}function ql(t){return Lc(t).time}function Yl(t){const i=Lc(t);return`${i.date} ${i.time}`}let $r=!1,vr=!1,_r=null;function bp(){return{...JSON.parse(JSON.stringify(ze)),themeMode:Yi.value}}function Dr(){!$r||vr||(clearTimeout(_r),_r=setTimeout(()=>{qh(bp())},600))}function xp(t){vr=!0;try{Cc(t),t.themeMode&&la(t.themeMode),Ar(ze.fontSize),Ir(ze.reduceMotion),Tc()}finally{vr=!1}}async function Jl(){$r=!0;const t=await Gh();t&&Object.keys(t).length?xp(t):Dr()}function wp(){$r=!1,clearTimeout(_r)}en(ze,()=>{Tc(),Dr()},{deep:!0});en(Yi,Dr);en(()=>ze.fontSize,Ar,{immediate:!0});en(()=>ze.reduceMotion,Ir,{immediate:!0});const kp=["width","height"],Mc={__name:"BrandMark",props:{size:{type:[Number,String],default:28}},setup(t){return(i,o)=>(m(),v("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none","aria-hidden":"true"},[...o[0]||(o[0]=[r("g",{"stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round"},[r("polyline",{points:"8,30 19,17 30,30",stroke:"var(--accent)"}),r("polyline",{points:"18,33 29,20 40,33",stroke:"currentColor"})],-1)])],8,kp))}},Sp=["title","aria-label"],Pp={key:0,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Tp={key:1,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Cp={__name:"ThemeToggle",setup(t){return(i,o)=>(m(),v("button",{class:"btn-icon",type:"button",title:Ue(ks)==="dark"?"Switch to light":"Switch to dark","aria-label":Ue(ks)==="dark"?"Switch to light theme":"Switch to dark theme",onClick:o[0]||(o[0]=(...l)=>Ue(Hl)&&Ue(Hl)(...l))},[Ue(ks)==="dark"?(m(),v("svg",Pp,[...o[1]||(o[1]=[r("circle",{cx:"12",cy:"12",r:"4"},null,-1),r("path",{d:"M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41"},null,-1)])])):(m(),v("svg",Tp,[...o[2]||(o[2]=[r("path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9z"},null,-1)])]))],8,Sp))}},Lp={class:"relative grid h-full place-items-center p-5"},Mp={class:"absolute right-5 top-5"},Ep={class:"mb-6 flex items-center gap-3 text-ink"},Op={class:"relative mb-1"},zp=["type"],Ap=["aria-label","title"],Ip={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"h-[18px] w-[18px]"},$p={key:1,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"h-[18px] w-[18px]"},Dp={key:0,class:"mt-4"},Np={key:1,class:"mt-4 rounded border border-line bg-danger-soft px-3 py-2 text-sm text-danger-fg"},Rp=["disabled"],Fp={__name:"LoginView",props:{defaultApiBase:{type:String,default:""}},emits:["signed-in"],setup(t,{emit:i}){const o=t,l=i,u=K(""),d=K(""),h=K(localStorage.getItem("api_url")||o.defaultApiBase||"http://localhost:8080"),_=K(!1),y=K(!1),T=K(!1),w=K("");async function z(){T.value=!0,w.value="",localStorage.setItem("api_url",h.value.trim());const{ok:U,status:V,body:ue}=await Nh(u.value.trim(),d.value,h.value.trim());if(T.value=!1,U){l("signed-in",ue.email);return}w.value=V===400?"Invalid email or password.":V===502?"API server can't reach PocketBase.":ue.message||ue.error||"Cannot reach the API server."}return(U,V)=>(m(),v("div",Lp,[r("div",Mp,[E(Cp)]),r("form",{class:"panel w-[380px] p-8 shadow-md",onSubmit:yc(z,["prevent"])},[r("div",Ep,[E(Mc,{size:34}),V[5]||(V[5]=r("div",{class:"leading-tight"},[r("div",{class:"text-mode"},"PilotVault"),r("div",{class:"eyebrow mt-0.5"},"Control panel")],-1))]),V[9]||(V[9]=r("label",{class:"eyebrow mb-1.5 block"},"Email",-1)),re(r("input",{"onUpdate:modelValue":V[0]||(V[0]=ue=>u.value=ue),type:"email",autocomplete:"username",required:"",class:"field mb-4",placeholder:"you@example.com"},null,512),[[ve,u.value]]),V[10]||(V[10]=r("label",{class:"eyebrow mb-1.5 block"},"Password",-1)),r("div",Op,[re(r("input",{"onUpdate:modelValue":V[1]||(V[1]=ue=>d.value=ue),type:y.value?"text":"password",autocomplete:"current-password",required:"",class:"field w-full pr-10",placeholder:"••••••••"},null,8,zp),[[Ph,d.value]]),r("button",{type:"button",class:"absolute inset-y-0 right-0 grid w-10 place-items-center text-ink-muted transition hover:text-ink-secondary","aria-label":y.value?"Hide password":"Show password",title:y.value?"Hide password":"Show password",onClick:V[2]||(V[2]=ue=>y.value=!y.value)},[y.value?(m(),v("svg",Ip,[...V[6]||(V[6]=[r("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"},null,-1),r("line",{x1:"1",y1:"1",x2:"23",y2:"23"},null,-1)])])):(m(),v("svg",$p,[...V[7]||(V[7]=[r("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"},null,-1),r("circle",{cx:"12",cy:"12",r:"3"},null,-1)])]))],8,Ap)]),_.value?(m(),v("div",Dp,[V[8]||(V[8]=r("label",{class:"eyebrow mb-1.5 block"},"API Server",-1)),re(r("input",{"onUpdate:modelValue":V[3]||(V[3]=ue=>h.value=ue),type:"text",class:"field font-mono",placeholder:"10.2.1.101:8080"},null,512),[[ve,h.value]])])):R("",!0),w.value?(m(),v("p",Np,k(w.value),1)):R("",!0),r("button",{type:"submit",class:"btn-accent mt-6 w-full",disabled:T.value},k(T.value?"Signing in…":"Sign in"),9,Rp),r("button",{type:"button",class:"mx-auto mt-3 block text-xs text-ink-muted transition hover:text-ink-secondary",onClick:V[4]||(V[4]=ue=>_.value=!_.value)},k(_.value?"Hide server settings":"Server settings"),1)],32)]))}};function Bp(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Js={exports:{}};/* @preserve + * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com + * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade + */var Vp=Js.exports,Xl;function Up(){return Xl||(Xl=1,(function(t,i){(function(o,l){l(i)})(Vp,(function(o){var l="1.9.4";function u(e){var n,s,a,c;for(s=1,a=arguments.length;s"u"||!L||!L.Mixin)){e=me(e)?e:[e];for(var n=0;n0?Math.floor(e):Math.ceil(e)};ne.prototype={clone:function(){return new ne(this.x,this.y)},add:function(e){return this.clone()._add(ge(e))},_add:function(e){return this.x+=e.x,this.y+=e.y,this},subtract:function(e){return this.clone()._subtract(ge(e))},_subtract:function(e){return this.x-=e.x,this.y-=e.y,this},divideBy:function(e){return this.clone()._divideBy(e)},_divideBy:function(e){return this.x/=e,this.y/=e,this},multiplyBy:function(e){return this.clone()._multiplyBy(e)},_multiplyBy:function(e){return this.x*=e,this.y*=e,this},scaleBy:function(e){return new ne(this.x*e.x,this.y*e.y)},unscaleBy:function(e){return new ne(this.x/e.x,this.y/e.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=rt(this.x),this.y=rt(this.y),this},distanceTo:function(e){e=ge(e);var n=e.x-this.x,s=e.y-this.y;return Math.sqrt(n*n+s*s)},equals:function(e){return e=ge(e),e.x===this.x&&e.y===this.y},contains:function(e){return e=ge(e),Math.abs(e.x)<=Math.abs(this.x)&&Math.abs(e.y)<=Math.abs(this.y)},toString:function(){return"Point("+U(this.x)+", "+U(this.y)+")"}};function ge(e,n,s){return e instanceof ne?e:me(e)?new ne(e[0],e[1]):e==null?e:typeof e=="object"&&"x"in e&&"y"in e?new ne(e.x,e.y):new ne(e,n,s)}function Me(e,n){if(e)for(var s=n?[e,n]:e,a=0,c=s.length;a=this.min.x&&s.x<=this.max.x&&n.y>=this.min.y&&s.y<=this.max.y},intersects:function(e){e=je(e);var n=this.min,s=this.max,a=e.min,c=e.max,p=c.x>=n.x&&a.x<=s.x,P=c.y>=n.y&&a.y<=s.y;return p&&P},overlaps:function(e){e=je(e);var n=this.min,s=this.max,a=e.min,c=e.max,p=c.x>n.x&&a.xn.y&&a.y=n.lat&&c.lat<=s.lat&&a.lng>=n.lng&&c.lng<=s.lng},intersects:function(e){e=$(e);var n=this._southWest,s=this._northEast,a=e.getSouthWest(),c=e.getNorthEast(),p=c.lat>=n.lat&&a.lat<=s.lat,P=c.lng>=n.lng&&a.lng<=s.lng;return p&&P},overlaps:function(e){e=$(e);var n=this._southWest,s=this._northEast,a=e.getSouthWest(),c=e.getNorthEast(),p=c.lat>n.lat&&a.latn.lng&&a.lng1,Sa=(function(){var e=!1;try{var n=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassiveEventSupport",z,n),window.removeEventListener("testPassiveEventSupport",z,n)}catch{}return e})(),Pa=(function(){return!!document.createElement("canvas").getContext})(),Ms=!!(document.createElementNS&&Z("svg").createSVGRect),_o=!!Ms&&(function(){var e=document.createElement("div");return e.innerHTML="",(e.firstChild&&e.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"})(),Ta=!Ms&&(function(){try{var e=document.createElement("div");e.innerHTML='';var n=e.firstChild;return n.style.behavior="url(#default#VML)",n&&typeof n.adj=="object"}catch{return!1}})(),Ca=navigator.platform.indexOf("Mac")===0,La=navigator.platform.indexOf("Linux")===0;function Ke(e){return navigator.userAgent.toLowerCase().indexOf(e)>=0}var _e={ie,ielt9:F,edge:Y,webkit:j,android:Se,android23:ce,androidStock:Pe,opera:We,chrome:be,gecko:Ye,safari:dt,phantom:gt,opera12:_t,win:Tt,ie3d:_n,webkit3d:ci,gecko3d:kt,any3d:$t,mobile:En,mobileWebkit:Vt,mobileWebkit3d:Ji,msPointer:zt,pointer:Ut,touch:wa,touchNative:yt,mobileOpera:vo,mobileGecko:Ls,retina:ka,passiveEvents:Sa,canvas:Pa,svg:Ms,vml:Ta,inlineSvg:_o,mac:Ca,linux:La},Xi=_e.msPointer?"MSPointerDown":"pointerdown",At=_e.msPointer?"MSPointerMove":"pointermove",di=_e.msPointer?"MSPointerUp":"pointerup",Mi=_e.msPointer?"MSPointerCancel":"pointercancel",fi={touchstart:Xi,touchmove:At,touchend:di,touchcancel:Mi},an={touchstart:bo,touchmove:Zt,touchend:Zt,touchcancel:Zt},tn={},yo=!1;function Es(e,n,s){return n==="touchstart"&&hi(),an[n]?(s=an[n].bind(this,s),e.addEventListener(fi[n],s,!1),s):(console.warn("wrong event specified:",n),z)}function Os(e,n,s){if(!fi[n]){console.warn("wrong event specified:",n);return}e.removeEventListener(fi[n],s,!1)}function Ma(e){tn[e.pointerId]=e}function rn(e){tn[e.pointerId]&&(tn[e.pointerId]=e)}function yn(e){delete tn[e.pointerId]}function hi(){yo||(document.addEventListener(Xi,Ma,!0),document.addEventListener(At,rn,!0),document.addEventListener(di,yn,!0),document.addEventListener(Mi,yn,!0),yo=!0)}function Zt(e,n){if(n.pointerType!==(n.MSPOINTER_TYPE_MOUSE||"mouse")){n.touches=[];for(var s in tn)n.touches.push(tn[s]);n.changedTouches=[n],e(n)}}function bo(e,n){n.MSPOINTER_TYPE_TOUCH&&n.pointerType===n.MSPOINTER_TYPE_TOUCH&&Ct(n),Zt(e,n)}function zs(e){var n={},s,a;for(a in e)s=e[a],n[a]=s&&s.bind?s.bind(e):s;return e=n,n.type="dblclick",n.detail=2,n.isTrusted=!1,n._simulated=!0,n}var Ea=200;function Oa(e,n){e.addEventListener("dblclick",n);var s=0,a;function c(p){if(p.detail!==1){a=p.detail;return}if(!(p.pointerType==="mouse"||p.sourceCapabilities&&!p.sourceCapabilities.firesTouchEvents)){var P=So(p);if(!(P.some(function(N){return N instanceof HTMLLabelElement&&N.attributes.for})&&!P.some(function(N){return N instanceof HTMLInputElement||N instanceof HTMLSelectElement}))){var A=Date.now();A-s<=Ea?(a++,a===2&&n(zs(p))):a=1,s=A}}}return e.addEventListener("click",c),{dblclick:n,simDblclick:c}}function za(e,n){e.removeEventListener("dblclick",n.dblclick),e.removeEventListener("click",n.simDblclick)}var As=Qi(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),pi=Qi(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),xo=pi==="webkitTransition"||pi==="OTransition"?pi+"End":"transitionend";function wo(e){return typeof e=="string"?document.getElementById(e):e}function Ei(e,n){var s=e.style[n]||e.currentStyle&&e.currentStyle[n];if((!s||s==="auto")&&document.defaultView){var a=document.defaultView.getComputedStyle(e,null);s=a?a[n]:null}return s==="auto"?null:s}function se(e,n,s){var a=document.createElement(e);return a.className=n||"",s&&s.appendChild(a),a}function it(e){var n=e.parentNode;n&&n.removeChild(e)}function jn(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function ln(e){var n=e.parentNode;n&&n.lastChild!==e&&n.appendChild(e)}function bn(e){var n=e.parentNode;n&&n.firstChild!==e&&n.insertBefore(e,n.firstChild)}function mi(e,n){if(e.classList!==void 0)return e.classList.contains(n);var s=Oi(e);return s.length>0&&new RegExp("(^|\\s)"+n+"(\\s|$)").test(s)}function Oe(e,n){if(e.classList!==void 0)for(var s=ue(n),a=0,c=s.length;a0?2*window.devicePixelRatio:1;function To(e){return _e.edge?e.wheelDeltaY/2:e.deltaY&&e.deltaMode===0?-e.deltaY/Ia:e.deltaY&&e.deltaMode===1?-e.deltaY*20:e.deltaY&&e.deltaMode===2?-e.deltaY*60:e.deltaX||e.deltaZ?0:e.wheelDelta?(e.wheelDeltaY||e.wheelDelta)/2:e.detail&&Math.abs(e.detail)<32765?-e.detail*20:e.detail?e.detail/-32765*60:0}function Kn(e,n){var s=n.relatedTarget;if(!s)return!0;try{for(;s&&s!==e;)s=s.parentNode}catch{return!1}return s!==e}var Co={__proto__:null,on:Ve,off:st,stopPropagation:wt,disableScrollPropagation:zn,disableClickPropagation:_i,preventDefault:Ct,stop:wn,getPropagationPath:So,getMousePosition:Po,getWheelDelta:To,isExternalTarget:Kn,addListener:Ve,removeListener:st},Ii=De.extend({run:function(e,n,s,a){this.stop(),this._el=e,this._inProgress=!0,this._duration=s||.25,this._easeOutPower=1/Math.max(a||.5,.2),this._startPos=On(e),this._offset=n.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=Ce(this._animate,this),this._step()},_step:function(e){var n=+new Date-this._startTime,s=this._duration*1e3;nthis.options.maxZoom)?this.setZoom(e):this},panInsideBounds:function(e,n){this._enforcingBounds=!0;var s=this.getCenter(),a=this._limitCenter(s,this._zoom,$(e));return s.equals(a)||this.panTo(a,n),this._enforcingBounds=!1,this},panInside:function(e,n){n=n||{};var s=ge(n.paddingTopLeft||n.padding||[0,0]),a=ge(n.paddingBottomRight||n.padding||[0,0]),c=this.project(this.getCenter()),p=this.project(e),P=this.getPixelBounds(),A=je([P.min.add(s),P.max.subtract(a)]),N=A.getSize();if(!A.contains(p)){this._enforcingBounds=!0;var q=p.subtract(A.getCenter()),fe=A.extend(p).getSize().subtract(N);c.x+=q.x<0?-fe.x:fe.x,c.y+=q.y<0?-fe.y:fe.y,this.panTo(this.unproject(c),n),this._enforcingBounds=!1}return this},invalidateSize:function(e){if(!this._loaded)return this;e=u({animate:!1,pan:!0},e===!0?{animate:!0}:e);var n=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var s=this.getSize(),a=n.divideBy(2).round(),c=s.divideBy(2).round(),p=a.subtract(c);return!p.x&&!p.y?this:(e.animate&&e.pan?this.panBy(p):(e.pan&&this._rawPanBy(p),this.fire("move"),e.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(h(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:n,newSize:s}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(e){if(e=this._locateOptions=u({timeout:1e4,watch:!1},e),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var n=h(this._handleGeolocationResponse,this),s=h(this._handleGeolocationError,this);return e.watch?this._locationWatchId=navigator.geolocation.watchPosition(n,s,e):navigator.geolocation.getCurrentPosition(n,s,e),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(e){if(this._container._leaflet_id){var n=e.code,s=e.message||(n===1?"permission denied":n===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:n,message:"Geolocation error: "+s+"."})}},_handleGeolocationResponse:function(e){if(this._container._leaflet_id){var n=e.coords.latitude,s=e.coords.longitude,a=new I(n,s),c=a.toBounds(e.coords.accuracy*2),p=this._locateOptions;if(p.setView){var P=this.getBoundsZoom(c);this.setView(a,p.maxZoom?Math.min(P,p.maxZoom):P)}var A={latlng:a,bounds:c,timestamp:e.timestamp};for(var N in e.coords)typeof e.coords[N]=="number"&&(A[N]=e.coords[N]);this.fire("locationfound",A)}},addHandler:function(e,n){if(!n)return this;var s=this[e]=new n(this);return this._handlers.push(s),this.options[e]&&s.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),it(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(ee(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var e;for(e in this._layers)this._layers[e].remove();for(e in this._panes)it(this._panes[e]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(e,n){var s="leaflet-pane"+(e?" leaflet-"+e.replace("Pane","")+"-pane":""),a=se("div",s,n||this._mapPane);return e&&(this._panes[e]=a),a},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var e=this.getPixelBounds(),n=this.unproject(e.getBottomLeft()),s=this.unproject(e.getTopRight());return new te(n,s)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(e,n,s){e=$(e),s=ge(s||[0,0]);var a=this.getZoom()||0,c=this.getMinZoom(),p=this.getMaxZoom(),P=e.getNorthWest(),A=e.getSouthEast(),N=this.getSize().subtract(s),q=je(this.project(A,a),this.project(P,a)).getSize(),fe=_e.any3d?this.options.zoomSnap:1,Ie=N.x/q.x,qe=N.y/q.y,jt=n?Math.max(Ie,qe):Math.min(Ie,qe);return a=this.getScaleZoom(jt,a),fe&&(a=Math.round(a/(fe/100))*(fe/100),a=n?Math.ceil(a/fe)*fe:Math.floor(a/fe)*fe),Math.max(c,Math.min(p,a))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new ne(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(e,n){var s=this._getTopLeftPoint(e,n);return new Me(s,s.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(e){return this.options.crs.getProjectedBounds(e===void 0?this.getZoom():e)},getPane:function(e){return typeof e=="string"?this._panes[e]:e},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(e,n){var s=this.options.crs;return n=n===void 0?this._zoom:n,s.scale(e)/s.scale(n)},getScaleZoom:function(e,n){var s=this.options.crs;n=n===void 0?this._zoom:n;var a=s.zoom(e*s.scale(n));return isNaN(a)?1/0:a},project:function(e,n){return n=n===void 0?this._zoom:n,this.options.crs.latLngToPoint(W(e),n)},unproject:function(e,n){return n=n===void 0?this._zoom:n,this.options.crs.pointToLatLng(ge(e),n)},layerPointToLatLng:function(e){var n=ge(e).add(this.getPixelOrigin());return this.unproject(n)},latLngToLayerPoint:function(e){var n=this.project(W(e))._round();return n._subtract(this.getPixelOrigin())},wrapLatLng:function(e){return this.options.crs.wrapLatLng(W(e))},wrapLatLngBounds:function(e){return this.options.crs.wrapLatLngBounds($(e))},distance:function(e,n){return this.options.crs.distance(W(e),W(n))},containerPointToLayerPoint:function(e){return ge(e).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(e){return ge(e).add(this._getMapPanePos())},containerPointToLatLng:function(e){var n=this.containerPointToLayerPoint(ge(e));return this.layerPointToLatLng(n)},latLngToContainerPoint:function(e){return this.layerPointToContainerPoint(this.latLngToLayerPoint(W(e)))},mouseEventToContainerPoint:function(e){return Po(e,this._container)},mouseEventToLayerPoint:function(e){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(e))},mouseEventToLatLng:function(e){return this.layerPointToLatLng(this.mouseEventToLayerPoint(e))},_initContainer:function(e){var n=this._container=wo(e);if(n){if(n._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");Ve(n,"scroll",this._onScroll,this),this._containerId=y(n)},_initLayout:function(){var e=this._container;this._fadeAnimated=this.options.fadeAnimation&&_e.any3d,Oe(e,"leaflet-container"+(_e.touch?" leaflet-touch":"")+(_e.retina?" leaflet-retina":"")+(_e.ielt9?" leaflet-oldie":"")+(_e.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var n=Ei(e,"position");n!=="absolute"&&n!=="relative"&&n!=="fixed"&&n!=="sticky"&&(e.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var e=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),vt(this._mapPane,new ne(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(Oe(e.markerPane,"leaflet-zoom-hide"),Oe(e.shadowPane,"leaflet-zoom-hide"))},_resetView:function(e,n,s){vt(this._mapPane,new ne(0,0));var a=!this._loaded;this._loaded=!0,n=this._limitZoom(n),this.fire("viewprereset");var c=this._zoom!==n;this._moveStart(c,s)._move(e,n)._moveEnd(c),this.fire("viewreset"),a&&this.fire("load")},_moveStart:function(e,n){return e&&this.fire("zoomstart"),n||this.fire("movestart"),this},_move:function(e,n,s,a){n===void 0&&(n=this._zoom);var c=this._zoom!==n;return this._zoom=n,this._lastCenter=e,this._pixelOrigin=this._getNewPixelOrigin(e),a?s&&s.pinch&&this.fire("zoom",s):((c||s&&s.pinch)&&this.fire("zoom",s),this.fire("move",s)),this},_moveEnd:function(e){return e&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return ee(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(e){vt(this._mapPane,this._getMapPanePos().subtract(e))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(e){this._targets={},this._targets[y(this._container)]=this;var n=e?st:Ve;n(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&n(window,"resize",this._onResize,this),_e.any3d&&this.options.transform3DLimit&&(e?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){ee(this._resizeRequest),this._resizeRequest=Ce(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var e=this._getMapPanePos();Math.max(Math.abs(e.x),Math.abs(e.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(e,n){for(var s=[],a,c=n==="mouseout"||n==="mouseover",p=e.target||e.srcElement,P=!1;p;){if(a=this._targets[y(p)],a&&(n==="click"||n==="preclick")&&this._draggableMoved(a)){P=!0;break}if(a&&a.listens(n,!0)&&(c&&!Kn(p,e)||(s.push(a),c))||p===this._container)break;p=p.parentNode}return!s.length&&!P&&!c&&this.listens(n,!0)&&(s=[this]),s},_isClickDisabled:function(e){for(;e&&e!==this._container;){if(e._leaflet_disable_click)return!0;e=e.parentNode}},_handleDOMEvent:function(e){var n=e.target||e.srcElement;if(!(!this._loaded||n._leaflet_disable_events||e.type==="click"&&this._isClickDisabled(n))){var s=e.type;s==="mousedown"&&ns(n),this._fireDOMEvent(e,s)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(e,n,s){if(e.type==="click"){var a=u({},e);a.type="preclick",this._fireDOMEvent(a,a.type,s)}var c=this._findEventTargets(e,n);if(s){for(var p=[],P=0;P0?Math.round(e-n)/2:Math.max(0,Math.ceil(e))-Math.max(0,Math.floor(n))},_limitZoom:function(e){var n=this.getMinZoom(),s=this.getMaxZoom(),a=_e.any3d?this.options.zoomSnap:1;return a&&(e=Math.round(e/a)*a),Math.max(n,Math.min(s,e))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){ut(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(e,n){var s=this._getCenterOffset(e)._trunc();return(n&&n.animate)!==!0&&!this.getSize().contains(s)?!1:(this.panBy(s,n),!0)},_createAnimProxy:function(){var e=this._proxy=se("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(e),this.on("zoomanim",function(n){var s=As,a=this._proxy.style[s];St(this._proxy,this.project(n.center,n.zoom),this.getZoomScale(n.zoom,1)),a===this._proxy.style[s]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){it(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var e=this.getCenter(),n=this.getZoom();St(this._proxy,this.project(e,n),this.getZoomScale(n,1))},_catchTransitionEnd:function(e){this._animatingZoom&&e.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(e,n,s){if(this._animatingZoom)return!0;if(s=s||{},!this._zoomAnimated||s.animate===!1||this._nothingToAnimate()||Math.abs(n-this._zoom)>this.options.zoomAnimationThreshold)return!1;var a=this.getZoomScale(n),c=this._getCenterOffset(e)._divideBy(1-1/a);return s.animate!==!0&&!this.getSize().contains(c)?!1:(Ce(function(){this._moveStart(!0,s.noMoveStart||!1)._animateZoom(e,n,!0)},this),!0)},_animateZoom:function(e,n,s,a){this._mapPane&&(s&&(this._animatingZoom=!0,this._animateToCenter=e,this._animateToZoom=n,Oe(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:e,zoom:n,noUpdate:a}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(h(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&ut(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function os(e,n){return new Ge(e,n)}var Ht=Re.extend({options:{position:"topright"},initialize:function(e){X(this,e)},getPosition:function(){return this.options.position},setPosition:function(e){var n=this._map;return n&&n.removeControl(this),this.options.position=e,n&&n.addControl(this),this},getContainer:function(){return this._container},addTo:function(e){this.remove(),this._map=e;var n=this._container=this.onAdd(e),s=this.getPosition(),a=e._controlCorners[s];return Oe(n,"leaflet-control"),s.indexOf("bottom")!==-1?a.insertBefore(n,a.firstChild):a.appendChild(n),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(it(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(e){this._map&&e&&e.screenX>0&&e.screenY>0&&this._map.getContainer().focus()}}),$i=function(e){return new Ht(e)};Ge.include({addControl:function(e){return e.addTo(this),this},removeControl:function(e){return e.remove(),this},_initControlPos:function(){var e=this._controlCorners={},n="leaflet-",s=this._controlContainer=se("div",n+"control-container",this._container);function a(c,p){var P=n+c+" "+n+p;e[c+p]=se("div",P,s)}a("top","left"),a("top","right"),a("bottom","left"),a("bottom","right")},_clearControlPos:function(){for(var e in this._controlCorners)it(this._controlCorners[e]);it(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Lo=Ht.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(e,n,s,a){return s1,this._baseLayersList.style.display=e?"":"none"),this._separator.style.display=n&&e?"":"none",this},_onLayerChange:function(e){this._handlingClick||this._update();var n=this._getLayer(y(e.target)),s=n.overlay?e.type==="add"?"overlayadd":"overlayremove":e.type==="add"?"baselayerchange":null;s&&this._map.fire(s,n)},_createRadioElement:function(e,n){var s='",a=document.createElement("div");return a.innerHTML=s,a.firstChild},_addItem:function(e){var n=document.createElement("label"),s=this._map.hasLayer(e.layer),a;e.overlay?(a=document.createElement("input"),a.type="checkbox",a.className="leaflet-control-layers-selector",a.defaultChecked=s):a=this._createRadioElement("leaflet-base-layers_"+y(this),s),this._layerControlInputs.push(a),a.layerId=y(e.layer),Ve(a,"click",this._onInputClick,this);var c=document.createElement("span");c.innerHTML=" "+e.name;var p=document.createElement("span");n.appendChild(p),p.appendChild(a),p.appendChild(c);var P=e.overlay?this._overlaysList:this._baseLayersList;return P.appendChild(n),this._checkDisabledLayers(),n},_onInputClick:function(){if(!this._preventClick){var e=this._layerControlInputs,n,s,a=[],c=[];this._handlingClick=!0;for(var p=e.length-1;p>=0;p--)n=e[p],s=this._getLayer(n.layerId).layer,n.checked?a.push(s):n.checked||c.push(s);for(p=0;p=0;c--)n=e[c],s=this._getLayer(n.layerId).layer,n.disabled=s.options.minZoom!==void 0&&as.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var e=this._section;this._preventClick=!0,Ve(e,"click",Ct),this.expand();var n=this;setTimeout(function(){st(e,"click",Ct),n._preventClick=!1})}}),$a=function(e,n,s){return new Lo(e,n,s)},Yt=Ht.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(e){var n="leaflet-control-zoom",s=se("div",n+" leaflet-bar"),a=this.options;return this._zoomInButton=this._createButton(a.zoomInText,a.zoomInTitle,n+"-in",s,this._zoomIn),this._zoomOutButton=this._createButton(a.zoomOutText,a.zoomOutTitle,n+"-out",s,this._zoomOut),this._updateDisabled(),e.on("zoomend zoomlevelschange",this._updateDisabled,this),s},onRemove:function(e){e.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(e){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(e.shiftKey?3:1))},_createButton:function(e,n,s,a,c){var p=se("a",s,a);return p.innerHTML=e,p.href="#",p.title=n,p.setAttribute("role","button"),p.setAttribute("aria-label",n),_i(p),Ve(p,"click",wn),Ve(p,"click",c,this),Ve(p,"click",this._refocusOnMap,this),p},_updateDisabled:function(){var e=this._map,n="leaflet-disabled";ut(this._zoomInButton,n),ut(this._zoomOutButton,n),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||e._zoom===e.getMinZoom())&&(Oe(this._zoomOutButton,n),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||e._zoom===e.getMaxZoom())&&(Oe(this._zoomInButton,n),this._zoomInButton.setAttribute("aria-disabled","true"))}});Ge.mergeOptions({zoomControl:!0}),Ge.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Yt,this.addControl(this.zoomControl))});var Da=function(e){return new Yt(e)},Mo=Ht.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(e){var n="leaflet-control-scale",s=se("div",n),a=this.options;return this._addScales(a,n+"-line",s),e.on(a.updateWhenIdle?"moveend":"move",this._update,this),e.whenReady(this._update,this),s},onRemove:function(e){e.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(e,n,s){e.metric&&(this._mScale=se("div",n,s)),e.imperial&&(this._iScale=se("div",n,s))},_update:function(){var e=this._map,n=e.getSize().y/2,s=e.distance(e.containerPointToLatLng([0,n]),e.containerPointToLatLng([this.options.maxWidth,n]));this._updateScales(s)},_updateScales:function(e){this.options.metric&&e&&this._updateMetric(e),this.options.imperial&&e&&this._updateImperial(e)},_updateMetric:function(e){var n=this._getRoundNum(e),s=n<1e3?n+" m":n/1e3+" km";this._updateScale(this._mScale,s,n/e)},_updateImperial:function(e){var n=e*3.2808399,s,a,c;n>5280?(s=n/5280,a=this._getRoundNum(s),this._updateScale(this._iScale,a+" mi",a/s)):(c=this._getRoundNum(n),this._updateScale(this._iScale,c+" ft",c/n))},_updateScale:function(e,n,s){e.style.width=Math.round(this.options.maxWidth*s)+"px",e.innerHTML=n},_getRoundNum:function(e){var n=Math.pow(10,(Math.floor(e)+"").length-1),s=e/n;return s=s>=10?10:s>=5?5:s>=3?3:s>=2?2:1,n*s}}),Na=function(e){return new Mo(e)},as='',Gn=Ht.extend({options:{position:"bottomright",prefix:''+(_e.inlineSvg?as+" ":"")+"Leaflet"},initialize:function(e){X(this,e),this._attributions={}},onAdd:function(e){e.attributionControl=this,this._container=se("div","leaflet-control-attribution"),_i(this._container);for(var n in e._layers)e._layers[n].getAttribution&&this.addAttribution(e._layers[n].getAttribution());return this._update(),e.on("layeradd",this._addAttribution,this),this._container},onRemove:function(e){e.off("layeradd",this._addAttribution,this)},_addAttribution:function(e){e.layer.getAttribution&&(this.addAttribution(e.layer.getAttribution()),e.layer.once("remove",function(){this.removeAttribution(e.layer.getAttribution())},this))},setPrefix:function(e){return this.options.prefix=e,this._update(),this},addAttribution:function(e){return e?(this._attributions[e]||(this._attributions[e]=0),this._attributions[e]++,this._update(),this):this},removeAttribution:function(e){return e?(this._attributions[e]&&(this._attributions[e]--,this._update()),this):this},_update:function(){if(this._map){var e=[];for(var n in this._attributions)this._attributions[n]&&e.push(n);var s=[];this.options.prefix&&s.push(this.options.prefix),e.length&&s.push(e.join(", ")),this._container.innerHTML=s.join(' ')}}});Ge.mergeOptions({attributionControl:!0}),Ge.addInitHook(function(){this.options.attributionControl&&new Gn().addTo(this)});var rs=function(e){return new Gn(e)};Ht.Layers=Lo,Ht.Zoom=Yt,Ht.Scale=Mo,Ht.Attribution=Gn,$i.layers=$a,$i.zoom=Da,$i.scale=Na,$i.attribution=rs;var ct=Re.extend({initialize:function(e){this._map=e},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});ct.addTo=function(e,n){return e.addHandler(n,this),this};var yi={Events:he},Di=_e.touch?"touchstart mousedown":"mousedown",Jt=De.extend({options:{clickTolerance:3},initialize:function(e,n,s,a){X(this,a),this._element=e,this._dragStartTarget=n||e,this._preventOutline=s},enable:function(){this._enabled||(Ve(this._dragStartTarget,Di,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Jt._dragging===this&&this.finishDrag(!0),st(this._dragStartTarget,Di,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(e){if(this._enabled&&(this._moved=!1,!mi(this._element,"leaflet-zoom-anim"))){if(e.touches&&e.touches.length!==1){Jt._dragging===this&&this.finishDrag();return}if(!(Jt._dragging||e.shiftKey||e.which!==1&&e.button!==1&&!e.touches)&&(Jt._dragging=this,this._preventOutline&&ns(this._element),$s(),gi(),!this._moving)){this.fire("down");var n=e.touches?e.touches[0]:e,s=ko(this._element);this._startPoint=new ne(n.clientX,n.clientY),this._startPos=On(this._element),this._parentScale=Rs(s);var a=e.type==="mousedown";Ve(document,a?"mousemove":"touchmove",this._onMove,this),Ve(document,a?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(e){if(this._enabled){if(e.touches&&e.touches.length>1){this._moved=!0;return}var n=e.touches&&e.touches.length===1?e.touches[0]:e,s=new ne(n.clientX,n.clientY)._subtract(this._startPoint);!s.x&&!s.y||Math.abs(s.x)+Math.abs(s.y)p&&(P=A,p=N);p>s&&(n[P]=1,Xe(e,n,s,a,P),Xe(e,n,s,P,c))}function An(e,n){for(var s=[e[0]],a=1,c=0,p=e.length;an&&(s.push(e[a]),c=a);return cn.max.x&&(s|=2),e.yn.max.y&&(s|=8),s}function Ba(e,n){var s=n.x-e.x,a=n.y-e.y;return s*s+a*a}function $n(e,n,s,a){var c=n.x,p=n.y,P=s.x-c,A=s.y-p,N=P*P+A*A,q;return N>0&&(q=((e.x-c)*P+(e.y-p)*A)/N,q>1?(c=s.x,p=s.y):q>0&&(c+=P*q,p+=A*q)),P=e.x-c,A=e.y-p,a?P*P+A*A:new ne(c,p)}function Lt(e){return!me(e[0])||typeof e[0][0]!="object"&&typeof e[0][0]<"u"}function Bi(e){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Lt(e)}function bi(e,n){var s,a,c,p,P,A,N,q;if(!e||e.length===0)throw new Error("latlngs not passed");Lt(e)||(console.warn("latlngs are not flat! Only the first ring will be used"),e=e[0]);var fe=W([0,0]),Ie=$(e),qe=Ie.getNorthWest().distanceTo(Ie.getSouthWest())*Ie.getNorthEast().distanceTo(Ie.getNorthWest());qe<1700&&(fe=qn(e));var jt=e.length,Mt=[];for(s=0;sa){N=(p-a)/c,q=[A.x-N*(A.x-P.x),A.y-N*(A.y-P.y)];break}var Xt=n.unproject(ge(q));return W([Xt.lat+fe.lat,Xt.lng+fe.lng])}var kn={__proto__:null,simplify:Yn,pointToSegmentDistance:Ri,closestPointOnSegment:Ra,clipSegment:ls,_getEdgeIntersection:us,_getBitCode:In,_sqClosestPointOnSegment:$n,isFlat:Lt,_flat:Bi,polylineCenter:bi},Sn={project:function(e){return new ne(e.lng,e.lat)},unproject:function(e){return new I(e.y,e.x)},bounds:new Me([-180,-90],[180,90])},Vi={R:6378137,R_MINOR:6356752314245179e-9,bounds:new Me([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(e){var n=Math.PI/180,s=this.R,a=e.lat*n,c=this.R_MINOR/s,p=Math.sqrt(1-c*c),P=p*Math.sin(a),A=Math.tan(Math.PI/4-a/2)/Math.pow((1-P)/(1+P),p/2);return a=-s*Math.log(Math.max(A,1e-10)),new ne(e.lng*n*s,a)},unproject:function(e){for(var n=180/Math.PI,s=this.R,a=this.R_MINOR/s,c=Math.sqrt(1-a*a),p=Math.exp(-e.y/s),P=Math.PI/2-2*Math.atan(p),A=0,N=.1,q;A<15&&Math.abs(N)>1e-7;A++)q=c*Math.sin(P),q=Math.pow((1-q)/(1+q),c/2),N=Math.PI/2-2*Math.atan(p*q)-P,P+=N;return new I(P*n,e.x*n/s)}},Oo={__proto__:null,LonLat:Sn,Mercator:Vi,SphericalMercator:lt},Va=u({},O,{code:"EPSG:3395",projection:Vi,transformation:(function(){var e=.5/(Math.PI*Vi.R);return b(e,.5,-e,.5)})()}),Bs=u({},O,{code:"EPSG:4326",projection:Sn,transformation:b(1/180,1,-1/180,.5)}),zo=u({},C,{projection:Sn,transformation:b(1,0,-1,0),scale:function(e){return Math.pow(2,e)},zoom:function(e){return Math.log(e)/Math.LN2},distance:function(e,n){var s=n.lng-e.lng,a=n.lat-e.lat;return Math.sqrt(s*s+a*a)},infinite:!0});C.Earth=O,C.EPSG3395=Va,C.EPSG3857=g,C.EPSG900913=M,C.EPSG4326=Bs,C.Simple=zo;var nn=De.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(e){return e.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(e){return e&&e.removeLayer(this),this},getPane:function(e){return this._map.getPane(e?this.options[e]||e:this.options.pane)},addInteractiveTarget:function(e){return this._map._targets[y(e)]=this,this},removeInteractiveTarget:function(e){return delete this._map._targets[y(e)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(e){var n=e.target;if(n.hasLayer(this)){if(this._map=n,this._zoomAnimated=n._zoomAnimated,this.getEvents){var s=this.getEvents();n.on(s,this),this.once("remove",function(){n.off(s,this)},this)}this.onAdd(n),this.fire("add"),n.fire("layeradd",{layer:this})}}});Ge.include({addLayer:function(e){if(!e._layerAdd)throw new Error("The provided object is not a Layer.");var n=y(e);return this._layers[n]?this:(this._layers[n]=e,e._mapToAdd=this,e.beforeAdd&&e.beforeAdd(this),this.whenReady(e._layerAdd,e),this)},removeLayer:function(e){var n=y(e);return this._layers[n]?(this._loaded&&e.onRemove(this),delete this._layers[n],this._loaded&&(this.fire("layerremove",{layer:e}),e.fire("remove")),e._map=e._mapToAdd=null,this):this},hasLayer:function(e){return y(e)in this._layers},eachLayer:function(e,n){for(var s in this._layers)e.call(n,this._layers[s]);return this},_addLayers:function(e){e=e?me(e)?e:[e]:[];for(var n=0,s=e.length;nthis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()=2&&n[0]instanceof I&&n[0].equals(n[s-1])&&n.pop(),n},_setLatLngs:function(e){Xn.prototype._setLatLngs.call(this,e),Lt(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Lt(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var e=this._renderer._bounds,n=this.options.weight,s=new ne(n,n);if(e=new Me(e.min.subtract(s),e.max.add(s)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(e))){if(this.options.noClip){this._parts=this._rings;return}for(var a=0,c=this._rings.length,p;ae.y!=c.y>e.y&&e.x<(c.x-a.x)*(e.y-a.y)/(c.y-a.y)+a.x&&(n=!n);return n||Xn.prototype._containsPoint.call(this,e,!0)}});function zc(e,n){return new fs(e,n)}var Qn=Pn.extend({initialize:function(e,n){X(this,n),this._layers={},e&&this.addData(e)},addData:function(e){var n=me(e)?e:e.features,s,a,c;if(n){for(s=0,a=n.length;s0&&c.push(c[0].slice()),c}function hs(e,n){return e.feature?u({},e.feature,{geometry:n}):No(n)}function No(e){return e.type==="Feature"||e.type==="FeatureCollection"?e:{type:"Feature",properties:{},geometry:e}}var Ha={toGeoJSON:function(e){return hs(this,{type:"Point",coordinates:Za(this.getLatLng(),e)})}};ds.include(Ha),Qe.include(Ha),G.include(Ha),Xn.include({toGeoJSON:function(e){var n=!Lt(this._latlngs),s=Do(this._latlngs,n?1:0,!1,e);return hs(this,{type:(n?"Multi":"")+"LineString",coordinates:s})}}),fs.include({toGeoJSON:function(e){var n=!Lt(this._latlngs),s=n&&!Lt(this._latlngs[0]),a=Do(this._latlngs,s?2:n?1:0,!0,e);return n||(a=[a]),hs(this,{type:(s?"Multi":"")+"Polygon",coordinates:a})}}),xi.include({toMultiPoint:function(e){var n=[];return this.eachLayer(function(s){n.push(s.toGeoJSON(e).geometry.coordinates)}),hs(this,{type:"MultiPoint",coordinates:n})},toGeoJSON:function(e){var n=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(n==="MultiPoint")return this.toMultiPoint(e);var s=n==="GeometryCollection",a=[];return this.eachLayer(function(c){if(c.toGeoJSON){var p=c.toGeoJSON(e);if(s)a.push(p.geometry);else{var P=No(p);P.type==="FeatureCollection"?a.push.apply(a,P.features):a.push(P)}}}),s?hs(this,{geometries:a,type:"GeometryCollection"}):{type:"FeatureCollection",features:a}}});function Rr(e,n){return new Qn(e,n)}var Ac=Rr,Ro=nn.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(e,n,s){this._url=e,this._bounds=$(n),X(this,s)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(Oe(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){it(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(e){return this.options.opacity=e,this._image&&this._updateOpacity(),this},setStyle:function(e){return e.opacity&&this.setOpacity(e.opacity),this},bringToFront:function(){return this._map&&ln(this._image),this},bringToBack:function(){return this._map&&bn(this._image),this},setUrl:function(e){return this._url=e,this._image&&(this._image.src=e),this},setBounds:function(e){return this._bounds=$(e),this._map&&this._reset(),this},getEvents:function(){var e={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(e.zoomanim=this._animateZoom),e},setZIndex:function(e){return this.options.zIndex=e,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var e=this._url.tagName==="IMG",n=this._image=e?this._url:se("img");if(Oe(n,"leaflet-image-layer"),this._zoomAnimated&&Oe(n,"leaflet-zoom-animated"),this.options.className&&Oe(n,this.options.className),n.onselectstart=z,n.onmousemove=z,n.onload=h(this.fire,this,"load"),n.onerror=h(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(n.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),e){this._url=n.src;return}n.src=this._url,n.alt=this.options.alt},_animateZoom:function(e){var n=this._map.getZoomScale(e.zoom),s=this._map._latLngBoundsToNewLayerBounds(this._bounds,e.zoom,e.center).min;St(this._image,s,n)},_reset:function(){var e=this._image,n=new Me(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),s=n.getSize();vt(e,n.min),e.style.width=s.x+"px",e.style.height=s.y+"px"},_updateOpacity:function(){Dt(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var e=this.options.errorOverlayUrl;e&&this._url!==e&&(this._url=e,this._image.src=e)},getCenter:function(){return this._bounds.getCenter()}}),Ic=function(e,n,s){return new Ro(e,n,s)},Fr=Ro.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var e=this._url.tagName==="VIDEO",n=this._image=e?this._url:se("video");if(Oe(n,"leaflet-image-layer"),this._zoomAnimated&&Oe(n,"leaflet-zoom-animated"),this.options.className&&Oe(n,this.options.className),n.onselectstart=z,n.onmousemove=z,n.onloadeddata=h(this.fire,this,"load"),e){for(var s=n.getElementsByTagName("source"),a=[],c=0;c0?a:[n.src];return}me(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(n.style,"objectFit")&&(n.style.objectFit="fill"),n.autoplay=!!this.options.autoplay,n.loop=!!this.options.loop,n.muted=!!this.options.muted,n.playsInline=!!this.options.playsInline;for(var p=0;pc?(n.height=c+"px",Oe(e,p)):ut(e,p),this._containerWidth=this._container.offsetWidth},_animateZoom:function(e){var n=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center),s=this._getAnchor();vt(this._container,n.add(s))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var e=this._map,n=parseInt(Ei(this._container,"marginBottom"),10)||0,s=this._container.offsetHeight+n,a=this._containerWidth,c=new ne(this._containerLeft,-s-this._containerBottom);c._add(On(this._container));var p=e.layerPointToContainerPoint(c),P=ge(this.options.autoPanPadding),A=ge(this.options.autoPanPaddingTopLeft||P),N=ge(this.options.autoPanPaddingBottomRight||P),q=e.getSize(),fe=0,Ie=0;p.x+a+N.x>q.x&&(fe=p.x+a-q.x+N.x),p.x-fe-A.x<0&&(fe=p.x-A.x),p.y+s+N.y>q.y&&(Ie=p.y+s-q.y+N.y),p.y-Ie-A.y<0&&(Ie=p.y-A.y),(fe||Ie)&&(this.options.keepInView&&(this._autopanning=!0),e.fire("autopanstart").panBy([fe,Ie]))}},_getAnchor:function(){return ge(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Nc=function(e,n){return new Fo(e,n)};Ge.mergeOptions({closePopupOnClick:!0}),Ge.include({openPopup:function(e,n,s){return this._initOverlay(Fo,e,n,s).openOn(this),this},closePopup:function(e){return e=arguments.length?e:this._popup,e&&e.close(),this}}),nn.include({bindPopup:function(e,n){return this._popup=this._initOverlay(Fo,this._popup,e,n),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(e){return this._popup&&(this instanceof Pn||(this._popup._source=this),this._popup._prepareOpen(e||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(e){return this._popup&&this._popup.setContent(e),this},getPopup:function(){return this._popup},_openPopup:function(e){if(!(!this._popup||!this._map)){wn(e);var n=e.layer||e.target;if(this._popup._source===n&&!(n instanceof f)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(e.latlng);return}this._popup._source=n,this.openPopup(e.latlng)}},_movePopup:function(e){this._popup.setLatLng(e.latlng)},_onKeyPress:function(e){e.originalEvent.keyCode===13&&this._openPopup(e)}});var Bo=Dn.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(e){Dn.prototype.onAdd.call(this,e),this.setOpacity(this.options.opacity),e.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(e){Dn.prototype.onRemove.call(this,e),e.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var e=Dn.prototype.getEvents.call(this);return this.options.permanent||(e.preclick=this.close),e},_initLayout:function(){var e="leaflet-tooltip",n=e+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=se("div",n),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+y(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(e){var n,s,a=this._map,c=this._container,p=a.latLngToContainerPoint(a.getCenter()),P=a.layerPointToContainerPoint(e),A=this.options.direction,N=c.offsetWidth,q=c.offsetHeight,fe=ge(this.options.offset),Ie=this._getAnchor();A==="top"?(n=N/2,s=q):A==="bottom"?(n=N/2,s=0):A==="center"?(n=N/2,s=q/2):A==="right"?(n=0,s=q/2):A==="left"?(n=N,s=q/2):P.xthis.options.maxZoom||sa?this._retainParent(c,p,P,a):!1)},_retainChildren:function(e,n,s,a){for(var c=2*e;c<2*e+2;c++)for(var p=2*n;p<2*n+2;p++){var P=new ne(c,p);P.z=s+1;var A=this._tileCoordsToKey(P),N=this._tiles[A];if(N&&N.active){N.retain=!0;continue}else N&&N.loaded&&(N.retain=!0);s+1this.options.maxZoom||this.options.minZoom!==void 0&&c1){this._setView(e,s);return}for(var Ie=c.min.y;Ie<=c.max.y;Ie++)for(var qe=c.min.x;qe<=c.max.x;qe++){var jt=new ne(qe,Ie);if(jt.z=this._tileZoom,!!this._isValidTile(jt)){var Mt=this._tiles[this._tileCoordsToKey(jt)];Mt?Mt.current=!0:P.push(jt)}}if(P.sort(function(Xt,ms){return Xt.distanceTo(p)-ms.distanceTo(p)}),P.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var dn=document.createDocumentFragment();for(qe=0;qes.max.x)||!n.wrapLat&&(e.ys.max.y))return!1}if(!this.options.bounds)return!0;var a=this._tileCoordsToBounds(e);return $(this.options.bounds).overlaps(a)},_keyToBounds:function(e){return this._tileCoordsToBounds(this._keyToTileCoords(e))},_tileCoordsToNwSe:function(e){var n=this._map,s=this.getTileSize(),a=e.scaleBy(s),c=a.add(s),p=n.unproject(a,e.z),P=n.unproject(c,e.z);return[p,P]},_tileCoordsToBounds:function(e){var n=this._tileCoordsToNwSe(e),s=new te(n[0],n[1]);return this.options.noWrap||(s=this._map.wrapLatLngBounds(s)),s},_tileCoordsToKey:function(e){return e.x+":"+e.y+":"+e.z},_keyToTileCoords:function(e){var n=e.split(":"),s=new ne(+n[0],+n[1]);return s.z=+n[2],s},_removeTile:function(e){var n=this._tiles[e];n&&(it(n.el),delete this._tiles[e],this.fire("tileunload",{tile:n.el,coords:this._keyToTileCoords(e)}))},_initTile:function(e){Oe(e,"leaflet-tile");var n=this.getTileSize();e.style.width=n.x+"px",e.style.height=n.y+"px",e.onselectstart=z,e.onmousemove=z,_e.ielt9&&this.options.opacity<1&&Dt(e,this.options.opacity)},_addTile:function(e,n){var s=this._getTilePos(e),a=this._tileCoordsToKey(e),c=this.createTile(this._wrapCoords(e),h(this._tileReady,this,e));this._initTile(c),this.createTile.length<2&&Ce(h(this._tileReady,this,e,null,c)),vt(c,s),this._tiles[a]={el:c,coords:e,current:!0},n.appendChild(c),this.fire("tileloadstart",{tile:c,coords:e})},_tileReady:function(e,n,s){n&&this.fire("tileerror",{error:n,tile:s,coords:e});var a=this._tileCoordsToKey(e);s=this._tiles[a],s&&(s.loaded=+new Date,this._map._fadeAnimated?(Dt(s.el,0),ee(this._fadeFrame),this._fadeFrame=Ce(this._updateOpacity,this)):(s.active=!0,this._pruneTiles()),n||(Oe(s.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:s.el,coords:e})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),_e.ielt9||!this._map._fadeAnimated?Ce(this._pruneTiles,this):setTimeout(h(this._pruneTiles,this),250)))},_getTilePos:function(e){return e.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(e){var n=new ne(this._wrapX?w(e.x,this._wrapX):e.x,this._wrapY?w(e.y,this._wrapY):e.y);return n.z=e.z,n},_pxBoundsToTileRange:function(e){var n=this.getTileSize();return new Me(e.min.unscaleBy(n).floor(),e.max.unscaleBy(n).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var e in this._tiles)if(!this._tiles[e].loaded)return!1;return!0}});function Bc(e){return new Us(e)}var ps=Us.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(e,n){this._url=e,n=X(this,n),n.detectRetina&&_e.retina&&n.maxZoom>0?(n.tileSize=Math.floor(n.tileSize/2),n.zoomReverse?(n.zoomOffset--,n.minZoom=Math.min(n.maxZoom,n.minZoom+1)):(n.zoomOffset++,n.maxZoom=Math.max(n.minZoom,n.maxZoom-1)),n.minZoom=Math.max(0,n.minZoom)):n.zoomReverse?n.minZoom=Math.min(n.maxZoom,n.minZoom):n.maxZoom=Math.max(n.minZoom,n.maxZoom),typeof n.subdomains=="string"&&(n.subdomains=n.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(e,n){return this._url===e&&n===void 0&&(n=!0),this._url=e,n||this.redraw(),this},createTile:function(e,n){var s=document.createElement("img");return Ve(s,"load",h(this._tileOnLoad,this,n,s)),Ve(s,"error",h(this._tileOnError,this,n,s)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(s.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(s.referrerPolicy=this.options.referrerPolicy),s.alt="",s.src=this.getTileUrl(e),s},getTileUrl:function(e){var n={r:_e.retina?"@2x":"",s:this._getSubdomain(e),x:e.x,y:e.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var s=this._globalTileRange.max.y-e.y;this.options.tms&&(n.y=s),n["-y"]=s}return Q(this._url,u(n,this.options))},_tileOnLoad:function(e,n){_e.ielt9?setTimeout(h(e,this,null,n),0):e(null,n)},_tileOnError:function(e,n,s){var a=this.options.errorTileUrl;a&&n.getAttribute("src")!==a&&(n.src=a),e(s,n)},_onTileRemove:function(e){e.tile.onload=null},_getZoomForUrl:function(){var e=this._tileZoom,n=this.options.maxZoom,s=this.options.zoomReverse,a=this.options.zoomOffset;return s&&(e=n-e),e+a},_getSubdomain:function(e){var n=Math.abs(e.x+e.y)%this.options.subdomains.length;return this.options.subdomains[n]},_abortLoading:function(){var e,n;for(e in this._tiles)if(this._tiles[e].coords.z!==this._tileZoom&&(n=this._tiles[e].el,n.onload=z,n.onerror=z,!n.complete)){n.src=de;var s=this._tiles[e].coords;it(n),delete this._tiles[e],this.fire("tileabort",{tile:n,coords:s})}},_removeTile:function(e){var n=this._tiles[e];if(n)return n.el.setAttribute("src",de),Us.prototype._removeTile.call(this,e)},_tileReady:function(e,n,s){if(!(!this._map||s&&s.getAttribute("src")===de))return Us.prototype._tileReady.call(this,e,n,s)}});function Ur(e,n){return new ps(e,n)}var Zr=ps.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(e,n){this._url=e;var s=u({},this.defaultWmsParams);for(var a in n)a in this.options||(s[a]=n[a]);n=X(this,n);var c=n.detectRetina&&_e.retina?2:1,p=this.getTileSize();s.width=p.x*c,s.height=p.y*c,this.wmsParams=s},onAdd:function(e){this._crs=this.options.crs||e.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var n=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[n]=this._crs.code,ps.prototype.onAdd.call(this,e)},getTileUrl:function(e){var n=this._tileCoordsToNwSe(e),s=this._crs,a=je(s.project(n[0]),s.project(n[1])),c=a.min,p=a.max,P=(this._wmsVersion>=1.3&&this._crs===Bs?[c.y,c.x,p.y,p.x]:[c.x,c.y,p.x,p.y]).join(","),A=ps.prototype.getTileUrl.call(this,e);return A+Ae(this.wmsParams,A,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+P},setParams:function(e,n){return u(this.wmsParams,e),n||this.redraw(),this}});function Vc(e,n){return new Zr(e,n)}ps.WMS=Zr,Ur.wms=Vc;var ei=nn.extend({options:{padding:.1},initialize:function(e){X(this,e),y(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),Oe(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var e={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(e.zoomanim=this._onAnimZoom),e},_onAnimZoom:function(e){this._updateTransform(e.center,e.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(e,n){var s=this._map.getZoomScale(n,this._zoom),a=this._map.getSize().multiplyBy(.5+this.options.padding),c=this._map.project(this._center,n),p=a.multiplyBy(-s).add(c).subtract(this._map._getNewPixelOrigin(e,n));_e.any3d?St(this._container,p,s):vt(this._container,p)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var e in this._layers)this._layers[e]._reset()},_onZoomEnd:function(){for(var e in this._layers)this._layers[e]._project()},_updatePaths:function(){for(var e in this._layers)this._layers[e]._update()},_update:function(){var e=this.options.padding,n=this._map.getSize(),s=this._map.containerPointToLayerPoint(n.multiplyBy(-e)).round();this._bounds=new Me(s,s.add(n.multiplyBy(1+e*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Hr=ei.extend({options:{tolerance:0},getEvents:function(){var e=ei.prototype.getEvents.call(this);return e.viewprereset=this._onViewPreReset,e},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){ei.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var e=this._container=document.createElement("canvas");Ve(e,"mousemove",this._onMouseMove,this),Ve(e,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Ve(e,"mouseout",this._handleMouseOut,this),e._leaflet_disable_events=!0,this._ctx=e.getContext("2d")},_destroyContainer:function(){ee(this._redrawRequest),delete this._ctx,it(this._container),st(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var e;this._redrawBounds=null;for(var n in this._layers)e=this._layers[n],e._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){ei.prototype._update.call(this);var e=this._bounds,n=this._container,s=e.getSize(),a=_e.retina?2:1;vt(n,e.min),n.width=a*s.x,n.height=a*s.y,n.style.width=s.x+"px",n.style.height=s.y+"px",_e.retina&&this._ctx.scale(2,2),this._ctx.translate(-e.min.x,-e.min.y),this.fire("update")}},_reset:function(){ei.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(e){this._updateDashArray(e),this._layers[y(e)]=e;var n=e._order={layer:e,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=n),this._drawLast=n,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(e){this._requestRedraw(e)},_removePath:function(e){var n=e._order,s=n.next,a=n.prev;s?s.prev=a:this._drawLast=a,a?a.next=s:this._drawFirst=s,delete e._order,delete this._layers[y(e)],this._requestRedraw(e)},_updatePath:function(e){this._extendRedrawBounds(e),e._project(),e._update(),this._requestRedraw(e)},_updateStyle:function(e){this._updateDashArray(e),this._requestRedraw(e)},_updateDashArray:function(e){if(typeof e.options.dashArray=="string"){var n=e.options.dashArray.split(/[, ]+/),s=[],a,c;for(c=0;c')}}catch{}return function(e){return document.createElement("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}})(),Uc={_initContainer:function(){this._container=se("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(ei.prototype._update.call(this),this.fire("update"))},_initPath:function(e){var n=e._container=Zs("shape");Oe(n,"leaflet-vml-shape "+(this.options.className||"")),n.coordsize="1 1",e._path=Zs("path"),n.appendChild(e._path),this._updateStyle(e),this._layers[y(e)]=e},_addPath:function(e){var n=e._container;this._container.appendChild(n),e.options.interactive&&e.addInteractiveTarget(n)},_removePath:function(e){var n=e._container;it(n),e.removeInteractiveTarget(n),delete this._layers[y(e)]},_updateStyle:function(e){var n=e._stroke,s=e._fill,a=e.options,c=e._container;c.stroked=!!a.stroke,c.filled=!!a.fill,a.stroke?(n||(n=e._stroke=Zs("stroke")),c.appendChild(n),n.weight=a.weight+"px",n.color=a.color,n.opacity=a.opacity,a.dashArray?n.dashStyle=me(a.dashArray)?a.dashArray.join(" "):a.dashArray.replace(/( *, *)/g," "):n.dashStyle="",n.endcap=a.lineCap.replace("butt","flat"),n.joinstyle=a.lineJoin):n&&(c.removeChild(n),e._stroke=null),a.fill?(s||(s=e._fill=Zs("fill")),c.appendChild(s),s.color=a.fillColor||a.color,s.opacity=a.fillOpacity):s&&(c.removeChild(s),e._fill=null)},_updateCircle:function(e){var n=e._point.round(),s=Math.round(e._radius),a=Math.round(e._radiusY||s);this._setPath(e,e._empty()?"M0 0":"AL "+n.x+","+n.y+" "+s+","+a+" 0,"+65535*360)},_setPath:function(e,n){e._path.v=n},_bringToFront:function(e){ln(e._container)},_bringToBack:function(e){bn(e._container)}},Vo=_e.vml?Zs:Z,Hs=ei.extend({_initContainer:function(){this._container=Vo("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Vo("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){it(this._container),st(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){ei.prototype._update.call(this);var e=this._bounds,n=e.getSize(),s=this._container;(!this._svgSize||!this._svgSize.equals(n))&&(this._svgSize=n,s.setAttribute("width",n.x),s.setAttribute("height",n.y)),vt(s,e.min),s.setAttribute("viewBox",[e.min.x,e.min.y,n.x,n.y].join(" ")),this.fire("update")}},_initPath:function(e){var n=e._path=Vo("path");e.options.className&&Oe(n,e.options.className),e.options.interactive&&Oe(n,"leaflet-interactive"),this._updateStyle(e),this._layers[y(e)]=e},_addPath:function(e){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(e._path),e.addInteractiveTarget(e._path)},_removePath:function(e){it(e._path),e.removeInteractiveTarget(e._path),delete this._layers[y(e)]},_updatePath:function(e){e._project(),e._update()},_updateStyle:function(e){var n=e._path,s=e.options;n&&(s.stroke?(n.setAttribute("stroke",s.color),n.setAttribute("stroke-opacity",s.opacity),n.setAttribute("stroke-width",s.weight),n.setAttribute("stroke-linecap",s.lineCap),n.setAttribute("stroke-linejoin",s.lineJoin),s.dashArray?n.setAttribute("stroke-dasharray",s.dashArray):n.removeAttribute("stroke-dasharray"),s.dashOffset?n.setAttribute("stroke-dashoffset",s.dashOffset):n.removeAttribute("stroke-dashoffset")):n.setAttribute("stroke","none"),s.fill?(n.setAttribute("fill",s.fillColor||s.color),n.setAttribute("fill-opacity",s.fillOpacity),n.setAttribute("fill-rule",s.fillRule||"evenodd")):n.setAttribute("fill","none"))},_updatePoly:function(e,n){this._setPath(e,B(e._parts,n))},_updateCircle:function(e){var n=e._point,s=Math.max(Math.round(e._radius),1),a=Math.max(Math.round(e._radiusY),1)||s,c="a"+s+","+a+" 0 1,0 ",p=e._empty()?"M0 0":"M"+(n.x-s)+","+n.y+c+s*2+",0 "+c+-s*2+",0 ";this._setPath(e,p)},_setPath:function(e,n){e._path.setAttribute("d",n)},_bringToFront:function(e){ln(e._path)},_bringToBack:function(e){bn(e._path)}});_e.vml&&Hs.include(Uc);function Wr(e){return _e.svg||_e.vml?new Hs(e):null}Ge.include({getRenderer:function(e){var n=e.options.renderer||this._getPaneRenderer(e.options.pane)||this.options.renderer||this._renderer;return n||(n=this._renderer=this._createRenderer()),this.hasLayer(n)||this.addLayer(n),n},_getPaneRenderer:function(e){if(e==="overlayPane"||e===void 0)return!1;var n=this._paneRenderers[e];return n===void 0&&(n=this._createRenderer({pane:e}),this._paneRenderers[e]=n),n},_createRenderer:function(e){return this.options.preferCanvas&&jr(e)||Wr(e)}});var Kr=fs.extend({initialize:function(e,n){fs.prototype.initialize.call(this,this._boundsToLatLngs(e),n)},setBounds:function(e){return this.setLatLngs(this._boundsToLatLngs(e))},_boundsToLatLngs:function(e){return e=$(e),[e.getSouthWest(),e.getNorthWest(),e.getNorthEast(),e.getSouthEast()]}});function Zc(e,n){return new Kr(e,n)}Hs.create=Vo,Hs.pointsToPath=B,Qn.geometryToLayer=Io,Qn.coordsToLatLng=Ua,Qn.coordsToLatLngs=$o,Qn.latLngToCoords=Za,Qn.latLngsToCoords=Do,Qn.getFeature=hs,Qn.asFeature=No,Ge.mergeOptions({boxZoom:!0});var Gr=ct.extend({initialize:function(e){this._map=e,this._container=e._container,this._pane=e._panes.overlayPane,this._resetStateTimeout=0,e.on("unload",this._destroy,this)},addHooks:function(){Ve(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){st(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){it(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(e){if(!e.shiftKey||e.which!==1&&e.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),gi(),$s(),this._startPoint=this._map.mouseEventToContainerPoint(e),Ve(document,{contextmenu:wn,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(e){this._moved||(this._moved=!0,this._box=se("div","leaflet-zoom-box",this._container),Oe(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(e);var n=new Me(this._point,this._startPoint),s=n.getSize();vt(this._box,n.min),this._box.style.width=s.x+"px",this._box.style.height=s.y+"px"},_finish:function(){this._moved&&(it(this._box),ut(this._container,"leaflet-crosshair")),zi(),Ds(),st(document,{contextmenu:wn,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(e){if(!(e.which!==1&&e.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(h(this._resetState,this),0);var n=new te(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(n).fire("boxzoomend",{boxZoomBounds:n})}},_onKeyDown:function(e){e.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});Ge.addInitHook("addHandler","boxZoom",Gr),Ge.mergeOptions({doubleClickZoom:!0});var qr=ct.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(e){var n=this._map,s=n.getZoom(),a=n.options.zoomDelta,c=e.originalEvent.shiftKey?s-a:s+a;n.options.doubleClickZoom==="center"?n.setZoom(c):n.setZoomAround(e.containerPoint,c)}});Ge.addInitHook("addHandler","doubleClickZoom",qr),Ge.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Yr=ct.extend({addHooks:function(){if(!this._draggable){var e=this._map;this._draggable=new Jt(e._mapPane,e._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),e.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),e.on("zoomend",this._onZoomEnd,this),e.whenReady(this._onZoomEnd,this))}Oe(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){ut(this._map._container,"leaflet-grab"),ut(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var e=this._map;if(e._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var n=$(this._map.options.maxBounds);this._offsetLimit=je(this._map.latLngToContainerPoint(n.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(n.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;e.fire("movestart").fire("dragstart"),e.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(e){if(this._map.options.inertia){var n=this._lastTime=+new Date,s=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(s),this._times.push(n),this._prunePositions(n)}this._map.fire("move",e).fire("drag",e)},_prunePositions:function(e){for(;this._positions.length>1&&e-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var e=this._map.getSize().divideBy(2),n=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=n.subtract(e).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(e,n){return e-(e-n)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var e=this._draggable._newPos.subtract(this._draggable._startPos),n=this._offsetLimit;e.xn.max.x&&(e.x=this._viscousLimit(e.x,n.max.x)),e.y>n.max.y&&(e.y=this._viscousLimit(e.y,n.max.y)),this._draggable._newPos=this._draggable._startPos.add(e)}},_onPreDragWrap:function(){var e=this._worldWidth,n=Math.round(e/2),s=this._initialWorldOffset,a=this._draggable._newPos.x,c=(a-n+s)%e+n-s,p=(a+n+s)%e-n-s,P=Math.abs(c+s)0?p:-p))-n;this._delta=0,this._startTime=null,P&&(e.options.scrollWheelZoom==="center"?e.setZoom(n+P):e.setZoomAround(this._lastMousePos,n+P))}});Ge.addInitHook("addHandler","scrollWheelZoom",Xr);var Hc=600;Ge.mergeOptions({tapHold:_e.touchNative&&_e.safari&&_e.mobile,tapTolerance:15});var Qr=ct.extend({addHooks:function(){Ve(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){st(this._map._container,"touchstart",this._onDown,this)},_onDown:function(e){if(clearTimeout(this._holdTimeout),e.touches.length===1){var n=e.touches[0];this._startPos=this._newPos=new ne(n.clientX,n.clientY),this._holdTimeout=setTimeout(h(function(){this._cancel(),this._isTapValid()&&(Ve(document,"touchend",Ct),Ve(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",n))},this),Hc),Ve(document,"touchend touchcancel contextmenu",this._cancel,this),Ve(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function e(){st(document,"touchend",Ct),st(document,"touchend touchcancel",e)},_cancel:function(){clearTimeout(this._holdTimeout),st(document,"touchend touchcancel contextmenu",this._cancel,this),st(document,"touchmove",this._onMove,this)},_onMove:function(e){var n=e.touches[0];this._newPos=new ne(n.clientX,n.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(e,n){var s=new MouseEvent(e,{bubbles:!0,cancelable:!0,view:window,screenX:n.screenX,screenY:n.screenY,clientX:n.clientX,clientY:n.clientY});s._simulated=!0,n.target.dispatchEvent(s)}});Ge.addInitHook("addHandler","tapHold",Qr),Ge.mergeOptions({touchZoom:_e.touch,bounceAtZoomLimits:!0});var el=ct.extend({addHooks:function(){Oe(this._map._container,"leaflet-touch-zoom"),Ve(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){ut(this._map._container,"leaflet-touch-zoom"),st(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(e){var n=this._map;if(!(!e.touches||e.touches.length!==2||n._animatingZoom||this._zooming)){var s=n.mouseEventToContainerPoint(e.touches[0]),a=n.mouseEventToContainerPoint(e.touches[1]);this._centerPoint=n.getSize()._divideBy(2),this._startLatLng=n.containerPointToLatLng(this._centerPoint),n.options.touchZoom!=="center"&&(this._pinchStartLatLng=n.containerPointToLatLng(s.add(a)._divideBy(2))),this._startDist=s.distanceTo(a),this._startZoom=n.getZoom(),this._moved=!1,this._zooming=!0,n._stop(),Ve(document,"touchmove",this._onTouchMove,this),Ve(document,"touchend touchcancel",this._onTouchEnd,this),Ct(e)}},_onTouchMove:function(e){if(!(!e.touches||e.touches.length!==2||!this._zooming)){var n=this._map,s=n.mouseEventToContainerPoint(e.touches[0]),a=n.mouseEventToContainerPoint(e.touches[1]),c=s.distanceTo(a)/this._startDist;if(this._zoom=n.getScaleZoom(c,this._startZoom),!n.options.bounceAtZoomLimits&&(this._zoomn.getMaxZoom()&&c>1)&&(this._zoom=n._limitZoom(this._zoom)),n.options.touchZoom==="center"){if(this._center=this._startLatLng,c===1)return}else{var p=s._add(a)._divideBy(2)._subtract(this._centerPoint);if(c===1&&p.x===0&&p.y===0)return;this._center=n.unproject(n.project(this._pinchStartLatLng,this._zoom).subtract(p),this._zoom)}this._moved||(n._moveStart(!0,!1),this._moved=!0),ee(this._animRequest);var P=h(n._move,n,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=Ce(P,this,!0),Ct(e)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,ee(this._animRequest),st(document,"touchmove",this._onTouchMove,this),st(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});Ge.addInitHook("addHandler","touchZoom",el),Ge.BoxZoom=Gr,Ge.DoubleClickZoom=qr,Ge.Drag=Yr,Ge.Keyboard=Jr,Ge.ScrollWheelZoom=Xr,Ge.TapHold=Qr,Ge.TouchZoom=el,o.Bounds=Me,o.Browser=_e,o.CRS=C,o.Canvas=Hr,o.Circle=Qe,o.CircleMarker=G,o.Class=Re,o.Control=Ht,o.DivIcon=Vr,o.DivOverlay=Dn,o.DomEvent=Co,o.DomUtil=Aa,o.Draggable=Jt,o.Evented=De,o.FeatureGroup=Pn,o.GeoJSON=Qn,o.GridLayer=Us,o.Handler=ct,o.Icon=cn,o.ImageOverlay=Ro,o.LatLng=I,o.LatLngBounds=te,o.Layer=nn,o.LayerGroup=xi,o.LineUtil=kn,o.Map=Ge,o.Marker=ds,o.Mixin=yi,o.Path=f,o.Point=ne,o.PolyUtil=Eo,o.Polygon=fs,o.Polyline=Xn,o.Popup=Fo,o.PosAnimation=Ii,o.Projection=Oo,o.Rectangle=Kr,o.Renderer=ei,o.SVG=Hs,o.SVGOverlay=Br,o.TileLayer=ps,o.Tooltip=Bo,o.Transformation=qt,o.Util=pe,o.VideoOverlay=Fr,o.bind=h,o.bounds=je,o.canvas=jr,o.circle=Ec,o.circleMarker=S,o.control=$i,o.divIcon=Fc,o.extend=u,o.featureGroup=pt,o.geoJSON=Rr,o.geoJson=Ac,o.gridLayer=Bc,o.icon=Vs,o.imageOverlay=Ic,o.latLng=W,o.latLngBounds=$,o.layerGroup=cs,o.map=os,o.marker=x,o.point=ge,o.polygon=zc,o.polyline=Oc,o.popup=Nc,o.rectangle=Zc,o.setOptions=X,o.stamp=y,o.svg=Wr,o.svgOverlay=Dc,o.tileLayer=Ur,o.tooltip=Rc,o.transformation=b,o.version=l,o.videoOverlay=$c;var jc=window.L;o.noConflict=function(){return window.L=jc,this},window.L=o}))})(Js,Js.exports)),Js.exports}var Zp=Up();const Go=Bp(Zp),Ql={__name:"DeviceMap",props:{position:{type:Object,default:null},trail:{type:Array,default:()=>[]}},setup(t){const i=t,o=K(null);let l,u,d;function h(){if(!l)return;const _=i.position;if(_&&(_.lat||_.lng)){const y=[_.lat,_.lng];u?u.setLatLng(y):(u=Go.marker(y).addTo(l),l.setView(y,17))}if(d&&d.remove(),i.trail.length){const y=getComputedStyle(document.documentElement).getPropertyValue("--accent").trim()||"#3D7BF0";d=Go.polyline(i.trail,{color:y,weight:3}).addTo(l)}}return Li(()=>{l=Go.map(o.value,{zoomControl:!0}).setView([20,0],2),Go.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:"© OpenStreetMap",maxZoom:19}).addTo(l),setTimeout(()=>l.invalidateSize(),60),h()}),en(()=>i.position,h,{deep:!0}),en(()=>i.trail,h,{deep:!0}),(_,y)=>(m(),v("div",{ref_key:"el",ref:o,class:"h-[320px] w-full rounded-lg"},null,512))}},Hp=["width","height","stroke-width"],jp=["d"],J={__name:"Icon",props:{name:{type:String,required:!0},size:{type:[Number,String],default:18},stroke:{type:[Number,String],default:2}},setup(t){const l=({grid:"M3 3h7v7H3zM14 3h7v7h-7zM14 14h7v7h-7zM3 14h7v7H3z",radio:"M4.9 19.1a10 10 0 0 1 0-14.2M7.8 16.2a6 6 0 0 1 0-8.4M16.2 7.8a6 6 0 0 1 0 8.4M19.1 4.9a10 10 0 0 1 0 14.2M12 13a1 1 0 1 0 0-2 1 1 0 0 0 0 2z",route:"M6 19a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM18 11a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM6 13V9a4 4 0 0 1 4-4h4",calendar:"M8 2v4M16 2v4M3 10h18M5 4h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z",book:"M4 19.5A2.5 2.5 0 0 1 6.5 17H20M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z",fileText:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8zM14 2v6h6M16 13H8M16 17H8M10 9H8",settings:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z",search:"M11 19a8 8 0 1 0 0-16 8 8 0 0 0 0 16zM21 21l-4.3-4.3",plus:"M12 5v14M5 12h14",battery:"M3 8h14a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H3a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1zM22 11v2",signal:"M2 20h.01M7 20v-4M12 20v-8M17 20V8M22 20V4",clock:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM12 7v5l3 2",chevronRight:"M9 6l6 6-6 6",play:"M6 3l14 9-14 9V3z",logout:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4M16 17l5-5-5-5M21 12H9",wind:"M12.8 19.6A2 2 0 1 0 14 16H2M17.5 8a2.5 2.5 0 1 1 2 4H2M9.6 4.6A2 2 0 1 1 11 8H2",drone:"M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8zM6 6 4 4M18 6l2-2M6 18l-2 2M18 18l2 2",user:"M20 21a8 8 0 1 0-16 0M12 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8z",users:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM23 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75",shield:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z",sliders:"M4 21v-7M4 10V3M12 21v-9M12 8V3M20 21v-5M20 12V3M1 14h6M9 8h6M17 16h6",alertTriangle:"M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0zM12 9v4M12 17h.01",download:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3",upload:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12",trash:"M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6M10 11v6M14 11v6",check:"M20 6 9 17l-5-5",mail:"M4 4h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2zM22 6l-10 7L2 6",lock:"M5 11h14a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-6a2 2 0 0 1 2-2zM7 11V7a5 5 0 0 1 10 0v4",monitor:"M3 4h18a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1zM8 21h8M12 17v4",globe:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM3 12h18M12 3a15 15 0 0 1 0 18 15 15 0 0 1 0-18z",smartphone:"M7 2h10a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zM11 18h2",image:"M4 4h16a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1zM8.5 11a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zM21 15l-5-5L5 21",type:"M4 7V4h16v3M9 20h6M12 4v16",sun:"M12 17a5 5 0 1 0 0-10 5 5 0 0 0 0 10zM12 1v2M12 21v2M4.2 4.2l1.4 1.4M18.4 18.4l1.4 1.4M1 12h2M21 12h2M4.2 19.8l1.4-1.4M18.4 5.6l1.4-1.4",moon:"M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z",x:"M18 6 6 18M6 6l12 12",server:"M20 4H4a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zM20 13H4a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-3a2 2 0 0 0-2-2zM6 7.5h.01M6 16.5h.01",cloud:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9z"}[t.name]||"").split(" M").map((u,d)=>d?"M"+u:u);return(u,d)=>(m(),v("svg",{width:t.size,height:t.size,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":t.stroke,"stroke-linecap":"round","stroke-linejoin":"round",style:{flex:"none"},"aria-hidden":"true"},[(m(!0),v(le,null,Fe(Ue(l),(h,_)=>(m(),v("path",{key:_,d:h},null,8,jp))),128))],8,Hp))}},Wp=["aria-checked","disabled"],sn={__name:"Toggle",props:{modelValue:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:i}){const o=i;return(l,u)=>(m(),v("button",{type:"button",role:"switch","aria-checked":t.modelValue,disabled:t.disabled,class:Le(["relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition disabled:opacity-40",t.modelValue?"bg-accent":"bg-surface-2 border border-line-strong"]),onClick:u[0]||(u[0]=d=>o("update:modelValue",!t.modelValue))},[r("span",{class:Le(["inline-block h-4 w-4 transform rounded-full bg-white shadow-sm transition",t.modelValue?"translate-x-6":"translate-x-1"])},null,2)],10,Wp))}},Kp={class:"inline-flex rounded-[10px] border border-line bg-surface-2 p-0.5"},Gp=["onClick"],hn={__name:"Segmented",props:{modelValue:{type:[String,Number],default:""},options:{type:Array,default:()=>[]}},emits:["update:modelValue"],setup(t,{emit:i}){const o=i;return(l,u)=>(m(),v("div",Kp,[(m(!0),v(le,null,Fe(t.options,d=>(m(),v("button",{key:d.value,type:"button",class:Le(["inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-[13px] font-semibold transition",t.modelValue===d.value?"bg-surface-1 text-ink shadow-xs":"text-ink-secondary hover:text-ink"]),onClick:h=>o("update:modelValue",d.value)},[d.icon?(m(),et(J,{key:0,name:d.icon,size:15},null,8,["name"])):R("",!0),D(" "+k(d.label),1)],10,Gp))),128))]))}},qp={class:"text-sm font-semibold text-ink"},Yp={key:0,class:"mt-0.5 text-xs text-ink-muted"},xe={__name:"Row",props:{title:{type:String,default:""},desc:{type:String,default:""},keywords:{type:String,default:""},block:{type:Boolean,default:!1}},setup(t){const i=t,o=to("settingsSearch",{value:""}),l=we(()=>{const u=(o.value||"").trim().toLowerCase();return u?`${i.title} ${i.desc} ${i.keywords}`.toLowerCase().includes(u):!0});return(u,d)=>l.value?(m(),v("div",{key:0,class:Le(["border-b border-line py-4 last:border-0",t.block?"":"flex items-center justify-between gap-6"])},[r("div",{class:Le(t.block?"mb-3":"min-w-0")},[r("div",qp,k(t.title),1),t.desc?(m(),v("div",Yp,k(t.desc),1)):R("",!0)],2),r("div",{class:Le(t.block?"":"shrink-0")},[lf(u.$slots,"default")],2)],2)):R("",!0)}},Jp=(t,i)=>{const o=t.__vccOpts||t;for(const[l,u]of i)o[l]=u;return o},Xp={class:"mx-auto max-w-[1280px] p-7"},Qp={class:"mb-5 flex flex-wrap items-end justify-between gap-4"},em={class:"flex h-10 w-full max-w-[280px] items-center gap-2 rounded border border-line-strong bg-surface-1 px-3"},tm={class:"grid grid-cols-[210px_1fr] gap-6 max-[760px]:grid-cols-1"},nm={class:"flex flex-col gap-0.5 max-[760px]:flex-row max-[760px]:overflow-x-auto"},im=["onClick"],sm={class:"whitespace-nowrap"},om={class:"min-w-0"},am={key:0,class:"panel p-10 text-center text-sm text-ink-muted"},rm={key:0,class:"eyebrow mb-2 mt-5 first:mt-0 flex items-center gap-2"},lm={key:1,class:"panel mb-5 p-5"},um={class:"flex items-center gap-1"},cm={class:"flex items-center gap-2"},dm={class:"font-mono text-sm text-ink"},fm={class:"inline-flex items-center gap-1 rounded-full bg-amber-soft px-2 py-0.5 text-[11px] font-semibold text-amber-fg"},hm={key:0,class:"mt-2 text-xs text-ink-muted"},pm={class:"grid max-w-[420px] gap-2"},mm={class:"flex items-center gap-3"},gm={key:2,class:"panel mb-5 p-5"},vm=["value"],_m=["value"],ym=["value"],bm={class:"font-mono text-sm text-ink"},xm={key:3},wm={key:0,class:"mb-5 flex items-center gap-1 overflow-x-auto border-b border-line"},km=["onClick"],Sm={key:1,class:"panel mb-5 p-5"},Pm={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},Tm={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},Cm={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},Lm={key:1,class:"mb-4 flex flex-col gap-2 border-b border-line pb-4 sm:flex-row sm:items-center sm:justify-between"},Mm={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},Em={key:0},Om={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},zm={class:"font-semibold text-ink-secondary"},Am={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},Im={key:7,class:"my-4 rounded-lg border border-line bg-surface-2 p-4","data-keywords":"credits usage quota remaining daily allowance rate limit"},$m={class:"flex items-center justify-between gap-3"},Dm={class:"flex items-center gap-2 text-sm font-semibold text-ink"},Nm={key:0,class:"text-[11px] text-ink-muted"},Rm={class:"mt-2 flex items-baseline gap-1.5"},Fm={class:"font-mono text-2xl font-semibold text-ink"},Bm={class:"text-sm text-ink-muted"},Vm={class:"mt-2 h-2 w-full overflow-hidden rounded-full bg-line"},Um={class:"mt-2 text-xs text-ink-muted"},Zm={class:"mt-2 text-sm text-ink"},Hm={class:"font-semibold"},jm={class:"mt-1 text-xs text-ink-muted"},Wm={key:1,class:"mt-2 text-xs text-ink-muted"},Km={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},Gm={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},qm={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Ym={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Jm={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Xm={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Qm={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},eg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},tg={key:8,class:"border-b border-line py-3 text-xs text-amber-fg"},ng={class:"mt-4 flex flex-wrap items-center gap-3"},ig=["disabled"],sg=["disabled"],og={key:2,class:"text-xs text-danger-fg"},ag={class:"panel mb-5 p-5"},rg={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},lg={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},ug={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},cg={key:1,class:"mb-4 flex flex-col gap-2 border-b border-line pb-4 sm:flex-row sm:items-center sm:justify-between"},dg={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},fg={key:0},hg={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},pg={class:"font-semibold text-ink-secondary"},mg={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},gg={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},vg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},_g={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},yg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},bg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},xg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},wg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},kg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Sg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Pg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Tg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Cg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Lg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Mg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Eg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Og={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},zg={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},Ag={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Ig={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},$g={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Dg={class:"mt-4 flex flex-wrap items-center gap-3"},Ng=["disabled"],Rg=["disabled"],Fg={key:2,class:"text-xs text-danger-fg"},Bg={key:3,class:"text-[11px] text-ink-muted"},Vg={class:"panel mb-5 p-5"},Ug={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},Zg={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},Hg={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},jg={key:1,class:"mb-4 flex flex-col gap-2 border-b border-line pb-4 sm:flex-row sm:items-center sm:justify-between"},Wg={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},Kg={key:0},Gg={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},qg={class:"font-semibold text-ink-secondary"},Yg={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},Jg={key:0,class:"inline-flex items-center gap-2 break-all font-mono text-sm text-ink"},Xg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Qg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},ev={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},tv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},nv={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},iv={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},sv={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},ov={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},av={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},rv={class:"mt-4 flex flex-wrap items-center gap-3"},lv=["disabled"],uv=["disabled"],cv={key:2,class:"text-xs text-danger-fg"},dv={key:3,class:"text-[11px] text-ink-muted"},fv={key:3,class:"panel mb-5 p-5"},hv={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},pv={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},mv={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},gv={key:1,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},vv={key:2,class:"mb-4 flex flex-col gap-2 border-b border-line pb-4 sm:flex-row sm:items-center sm:justify-between"},_v={key:5,class:"border-b border-line py-3 text-xs text-amber-fg"},yv={key:0},bv={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},xv={class:"font-semibold text-ink-secondary"},wv={key:7,class:"border-b border-line py-3 text-xs text-ink-muted"},kv={class:"flex w-full flex-col gap-2"},Sv={class:"break-all font-mono text-sm text-ink"},Pv={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Tv={key:1,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Cv={key:0,class:"text-xs text-ink-muted"},Lv={key:1,class:"border-b border-line py-3 text-xs text-ink-muted"},Mv={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},Ev={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Ov={class:"mt-4 flex flex-wrap items-center gap-3"},zv=["disabled"],Av=["disabled"],Iv={key:2,class:"text-xs text-danger-fg"},$v={key:3,class:"text-[11px] text-ink-muted"},Dv={key:4,class:"panel mb-5 p-5"},Nv={class:"flex items-center gap-4"},Rv=["src"],Fv={key:1,class:"grid h-16 w-16 place-items-center rounded-full bg-[var(--navy-800)] text-lg font-bold text-white"},Bv={class:"flex gap-2"},Vv={class:"btn-ghost cursor-pointer"},Uv={class:"mt-1 text-right text-[11px] text-ink-muted"},Zv={key:5,class:"panel mb-5 p-5"},Hv={class:"flex items-center gap-3"},jv={key:0,class:"mt-4 rounded-lg border border-line bg-surface-2 p-4"},Wv={class:"flex flex-wrap items-center gap-4"},Kv={class:"min-w-0"},Gv={class:"mt-1 select-all font-mono text-sm font-bold text-ink"},qv={class:"mt-3 flex items-center gap-2"},Yv={key:0,class:"mt-2 text-xs text-danger-fg"},Jv={key:1,class:"mt-4 rounded-lg border border-line bg-surface-2 p-4"},Xv={class:"mt-2 grid grid-cols-2 gap-1 font-mono text-xs text-ink-secondary sm:grid-cols-4"},Qv={class:"rounded-lg border border-line bg-surface-2 p-3"},e_={class:"flex items-center gap-3"},t_={class:"grid h-9 w-9 place-items-center rounded-full bg-accent-soft text-accent-soft-fg"},n_={class:"min-w-0 flex-1"},i_={class:"text-sm font-semibold text-ink"},s_={class:"font-mono text-[11px] text-ink-muted"},o_={key:6,class:"mb-5"},a_={key:0,class:"panel mb-5 p-5"},r_={class:"grid max-w-[520px] gap-2"},l_={class:"flex flex-wrap gap-2"},u_=["disabled","title"],c_=["value"],d_=["value"],f_={class:"flex items-center gap-2 py-1 text-sm text-ink-secondary"},h_={class:"flex items-center gap-3"},p_=["disabled"],m_={key:0,class:"text-xs text-danger-fg"},g_={key:1,class:"text-xs text-ink-muted"},v_={key:1,class:"panel mb-5 p-5"},__={class:"grid max-w-[520px] gap-2"},y_={class:"flex flex-wrap gap-2"},b_=["value"],x_=["value"],w_={key:1,class:"text-xs text-ink-muted"},k_={class:"font-semibold text-ink-secondary"},S_={class:"flex items-center gap-3"},P_=["disabled"],T_={key:0,class:"text-xs text-danger-fg"},C_={class:"panel overflow-hidden p-0"},L_={class:"flex items-center justify-between px-5 py-4"},M_=["disabled"],E_={key:0,class:"px-5 pb-5 text-sm text-danger-fg"},O_={key:1,class:"px-5 pb-8 text-sm text-ink-muted"},z_={key:2,class:"overflow-x-auto"},A_={class:"w-full border-collapse text-sm"},I_={class:"text-left"},$_={class:"px-5 py-3"},D_={class:"text-ink"},N_={key:0,class:"ml-1.5 text-[11px] text-ink-muted"},R_={class:"px-5 py-3"},F_={class:"px-5 py-3"},B_={class:"px-5 py-3"},V_={class:"px-5 py-3 text-right"},U_=["onClick"],Z_={key:1,class:"inline-flex items-center gap-1.5"},H_=["onClick"],j_=["onClick"],W_={key:7,class:"mb-5"},K_={key:0,class:"panel mb-5 p-5"},G_={class:"grid max-w-[520px] gap-2"},q_={class:"flex items-center gap-3"},Y_={key:0,class:"text-xs text-danger-fg"},J_={key:1,class:"panel mb-5 p-5"},X_={class:"grid max-w-[520px] gap-2"},Q_={class:"flex items-center gap-3"},ey=["disabled"],ty={key:0,class:"text-xs text-danger-fg"},ny={class:"panel overflow-hidden p-0"},iy={key:0,class:"px-5 pb-8 text-sm text-ink-muted"},sy={key:1,class:"overflow-x-auto"},oy={class:"w-full border-collapse text-sm"},ay={class:"text-left"},ry={class:"px-5 py-3"},ly={class:"inline-flex items-center gap-2 text-ink"},uy={class:"px-5 py-3 text-ink-secondary"},cy={class:"px-5 py-3 text-right"},dy=["onClick"],fy={key:1,class:"inline-flex items-center gap-1.5"},hy=["onClick"],py=["disabled","title","onClick"],my={key:8,class:"mb-5"},gy={class:"panel mb-5 p-5"},vy={class:"btn-ghost cursor-pointer"},_y={key:0,class:"mt-2 text-xs text-ink-muted"},yy={class:"rounded-lg border p-5",style:{"border-color":"color-mix(in srgb, var(--danger) 35%, transparent)",background:"var(--danger-soft)"}},by={class:"flex items-center gap-2 text-danger-fg"},xy={class:"mt-4 rounded-lg border border-line bg-surface-1 p-4"},wy={class:"mt-3 flex items-start gap-2 text-sm text-ink-secondary"},ky={class:"mt-3"},Sy={class:"eyebrow mb-1 block"},Py={class:"text-ink"},Ty=["placeholder"],Cy={class:"mt-4 flex flex-wrap items-center gap-3"},Ly=["disabled"],My=["disabled"],Ey={key:2,class:"text-xs text-ink-muted"},Oy={key:0,class:"mt-3 rounded border border-line bg-surface-2 px-3 py-2 text-xs text-ink-secondary"},zy={key:0,class:"fixed bottom-5 right-5 z-20 flex items-center gap-2 rounded-lg border border-line bg-surface-1 px-4 py-2.5 text-sm text-ink shadow-md"},eu="pv.opensky.health",tu="pv.filetransfer.health",nu="pv.webdav.health",iu="pv.localstorage.health",Ay={__name:"Settings",props:{email:{type:String,default:""},role:{type:String,default:"user"},organization:{type:String,default:""},organizationName:{type:String,default:""}},emits:["logout"],setup(t,{emit:i}){const o=t,l=i,u=we(()=>o.role==="superadmin"),d=we(()=>o.role==="admin"||o.role==="superadmin");function h(x){return x==="superadmin"?"Superadmin":x==="admin"?"Admin":"User"}function _(x){return x==="superadmin"||x==="admin"?"shield":"user"}function y(x){return x==="superadmin"||x==="admin"?T.accent:T.neutral}const T={success:"bg-success-soft text-success-fg",warning:"bg-amber-soft text-amber-fg",danger:"bg-danger-soft text-danger-fg",accent:"bg-accent-soft text-accent-soft-fg",neutral:"bg-surface-2 text-ink-secondary"},w=we(()=>{const x=[{id:"account",label:"Account",icon:"user",kw:"name username email password verification login credentials role"},{id:"appearance",label:"Appearance",icon:"sliders",kw:"theme light dark system language region font size accessibility date time format motion"},{id:"integrations",label:"Integrations",icon:"radio",kw:"opensky flights adsb aircraft plugin oauth credentials bounding box plan connection ftp sftp ftps file transfer server host upload download local storage folder drive isolated private read only webdav nextcloud owncloud dav url https"},{id:"profile",label:"Profile",icon:"image",kw:"avatar photo display name bio public"},{id:"security",label:"Privacy & Security",icon:"shield",kw:"two factor authentication 2fa sessions devices logout security privacy"}];return d.value&&x.push({id:"team",label:"User management",icon:"users",kw:"users team members add remove create delete role admin permissions rights organization"}),u.value&&x.push({id:"organizations",label:"Organizations",icon:"grid",kw:"organization org tenant company create rename delete members"}),x.push({id:"advanced",label:"Advanced",icon:"alertTriangle",kw:"export import data delete account danger zone",danger:!0}),x}),z=K("account"),U=K("");Iu("settingsSearch",U);const V=we(()=>U.value.trim().length>0),ue=we(()=>U.value.trim().toLowerCase());function X(x){return ue.value?(x.label+" "+x.kw).toLowerCase().includes(ue.value)||$e(x.id):!0}const Ae={account:["full name","username","email address verification verify","password change current new"],appearance:["theme light dark system","language","region","font size accessibility","reduce motion","date format","time format clock"],integrations:["opensky live flights","enable plugin","oauth client id secret","plan credits","bounding box","test connection","file transfer ftp sftp ftps","server host port username password","private key passphrase","base path directory","local storage folder drive","private isolated folder","read only access mode","webdav nextcloud owncloud dav","server url username password tls","base path directory folder"],profile:["profile photo avatar","display name","bio about","show email public"],security:["two factor authentication","active sessions devices","sign out"],team:["add user create account","members list role admin remove delete","organization org assign"],organizations:["add organization create","rename organization","delete organization members"],advanced:["export data download","import data upload","delete account permanent danger"]};function $e(x){return ue.value?(Ae[x]||[]).some(f=>f.includes(ue.value)):!0}const Q=we(()=>V.value?w.value.filter(X):w.value.filter(x=>x.id===z.value)),me=we({get:()=>Yi.value,set:x=>la(x)}),oe=[{value:"light",label:"Light",icon:"sun"},{value:"dark",label:"Dark",icon:"moon"},{value:"system",label:"System",icon:"monitor"}],de=[{value:"sm",label:"Small"},{value:"md",label:"Default"},{value:"lg",label:"Large"}],Ne=[{value:"12",label:"12-hour"},{value:"24",label:"24-hour"}],nt=[["en","English"],["es","Español"],["de","Deutsch"],["fr","Français"],["pl","Polski"],["ja","日本語"]],ke=[["US","United States"],["GB","United Kingdom"],["EU","European Union"],["CA","Canada"],["AU","Australia"],["JP","Japan"]],Te=[["MDY","MM/DD/YYYY"],["DMY","DD/MM/YYYY"],["YMD","YYYY/MM/DD"],["ISO","YYYY-MM-DD"]],Be=K(Date.now());let Ce=null;const ee=we(()=>Yl(Be.value)),pe=bt({loaded:!1,available:!1,orgEnabled:!0,allowAnonymous:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),Re=K("user"),Ze=bt({clientId:"",clientSecret:"",plan:"",bbox:""}),he=K(""),De=K(!1),ne=K(!1),rt=K(null),ge=K(null),Me=we(()=>rt.value&&rt.value.credits||null),je=we(()=>{const x=Me.value;return!x||!x.daily||x.remaining==null?null:Math.max(0,Math.min(100,Math.round(x.remaining/x.daily*100)))}),te=we(()=>{const x=je.value;return x==null?"bg-accent":x<=10?"bg-danger":x<=30?"bg-amber":"bg-success"});function $(x){return typeof x=="number"?x.toLocaleString():x}function I(){if(!ge.value)return"";const x=Math.max(0,Math.round((Date.now()-ge.value)/1e3));if(x<60)return"just now";const f=Math.round(x/60);if(f<60)return`${f} min ago`;const G=Math.round(f/60);return G<24?`${G} h ago`:`${Math.round(G/24)} d ago`}function W(){try{rt.value&&localStorage.setItem(eu,JSON.stringify({health:rt.value,ts:ge.value}))}catch{}}function C(){try{const x=localStorage.getItem(eu);if(!x)return;const f=JSON.parse(x);f&&f.health&&(rt.value=f.health,ge.value=f.ts||null)}catch{}}const O=[{value:"",label:"Not set"},{value:"anonymous",label:"Anonymous"},{value:"standard",label:"Standard"},{value:"contributor",label:"Contributor"}],ht=[{value:"user",label:"My settings",icon:"user"},{value:"org",label:"Organization",icon:"users"}],lt=we(()=>pe.isSuperadmin),qt=we(()=>pe.isSuperadmin?"user":Re.value),b=we(()=>pe.scopes[qt.value]||{editableLayer:"user",fields:{}}),g=we(()=>qt.value==="org");function M(x){return b.value.fields[x]||{effective:"",own:"",source:"unset",locked:!1}}function Z(x){return lt.value||M(x).locked}function B(x){const f=M(x).source;return f==="global"?"Set by administrator":f==="org"?"Set by your organization":""}function H(){Ze.clientId=M("clientId").own||"",Ze.clientSecret=M("clientSecret").own||"",Ze.plan=M("plan").own||"",Ze.bbox=M("bbox").own||""}function ie(x){pe.available=!!x.available,pe.orgEnabled=x.orgEnabled!==!1,pe.allowAnonymous=!!x.allowAnonymous,pe.enabled=!!x.enabled,pe.canEditOrg=!!x.canEditOrg,pe.isSuperadmin=!!x.isSuperadmin,pe.scopes=x.scopes||{},Re.value==="org"&&!pe.canEditOrg&&(Re.value="user"),H(),pe.loaded=!0}en(Re,()=>{he.value="",H()});async function F(){C();const{ok:x,body:f}=await Yh();x&&ie(f)}async function Y(x){const f=g.value;f?pe.orgEnabled=x:pe.enabled=x;const{ok:G,body:S}=await Wl(f?{scope:"org",enabled:x}:{scope:"user",enabled:x});G?(ie(S),Je(f?x?"OpenSky enabled for your organization.":"OpenSky disabled for your organization.":x?"OpenSky enabled.":"OpenSky disabled.")):(f?pe.orgEnabled=!x:pe.enabled=!x,Je(S.error||"Could not update."))}async function j(){he.value="",De.value=!0;const x={};for(const Qe of["clientId","clientSecret","plan","bbox"])Z(Qe)||(x[Qe]=Ze[Qe]);const f={scope:qt.value,config:x};g.value||(f.enabled=pe.enabled);const{ok:G,body:S}=await Wl(f);if(De.value=!1,!G){he.value=S.error||"Could not save settings.";return}ie(S),Je(g.value?"Organization OpenSky settings saved.":"OpenSky settings saved.")}async function Se(){ne.value=!0,rt.value=null;const{ok:x,body:f}=await Jh();ne.value=!1,rt.value=x&&f.health?f.health:{status:"down",detail:f.error||"Probe failed."},ge.value=Date.now(),W()}function ce(x){return x==="ok"?T.success:x==="degraded"?T.warning:T.danger}const ae=bt({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),Pe=K("user"),We=["protocol","host","port","username","password","privateKey","keyPassphrase","hostKeyFingerprint","insecureSkipVerify","basePath"],be=bt(Object.fromEntries(We.map(x=>[x,""]))),Ye=K(""),dt=K(!1),gt=K(!1),_t=K(null),Tt=K(null),_n=[{value:"sftp",label:"SFTP"},{value:"ftps",label:"FTPS"},{value:"ftp",label:"FTP"}],ci=[{value:"false",label:"Verify certificate"},{value:"true",label:"Skip verification"}],kt=we(()=>ae.isSuperadmin),$t=we(()=>ae.isSuperadmin?"user":Pe.value),En=we(()=>ae.scopes[$t.value]||{editableLayer:"user",fields:{}}),Vt=we(()=>$t.value==="org"),Ji=we(()=>(Ut("protocol")?zt("protocol").effective:be.protocol)||"sftp");function zt(x){return En.value.fields[x]||{effective:"",own:"",source:"unset",locked:!1}}function Ut(x){return kt.value||zt(x).locked}function yt(x){const f=zt(x).source;return f==="global"?"Set by administrator":f==="org"?"Set by your organization":""}function wa(x){return(_n.find(f=>f.value===x)||{}).label||x||"—"}function vo(){for(const x of We)be[x]=zt(x).own||"";be.protocol||(be.protocol="sftp"),be.insecureSkipVerify||(be.insecureSkipVerify="false")}function Ls(x){ae.available=!!x.available,ae.orgEnabled=x.orgEnabled!==!1,ae.enabled=!!x.enabled,ae.canEditOrg=!!x.canEditOrg,ae.isSuperadmin=!!x.isSuperadmin,ae.scopes=x.scopes||{},Pe.value==="org"&&!ae.canEditOrg&&(Pe.value="user"),vo(),ae.loaded=!0}en(Pe,()=>{Ye.value="",vo()});function ka(){if(!Tt.value)return"";const x=Math.max(0,Math.round((Date.now()-Tt.value)/1e3));if(x<60)return"just now";const f=Math.round(x/60);if(f<60)return`${f} min ago`;const G=Math.round(f/60);return G<24?`${G} h ago`:`${Math.round(G/24)} d ago`}function Sa(){try{_t.value&&localStorage.setItem(tu,JSON.stringify({health:_t.value,ts:Tt.value}))}catch{}}function Pa(){try{const x=localStorage.getItem(tu);if(!x)return;const f=JSON.parse(x);f&&f.health&&(_t.value=f.health,Tt.value=f.ts||null)}catch{}}async function Ms(){Pa();const{ok:x,body:f}=await Xh();x&&Ls(f)}async function _o(x){const f=Vt.value;f?ae.orgEnabled=x:ae.enabled=x;const{ok:G,body:S}=await Kl(f?{scope:"org",enabled:x}:{scope:"user",enabled:x});G?(Ls(S),Je(f?x?"File transfer enabled for your organization.":"File transfer disabled for your organization.":x?"File transfer enabled.":"File transfer disabled.")):(f?ae.orgEnabled=!x:ae.enabled=!x,Je(S.error||"Could not update."))}async function Ta(){Ye.value="",dt.value=!0;const x={};for(const Qe of We)Ut(Qe)||(x[Qe]=be[Qe]);const f={scope:$t.value,config:x};Vt.value||(f.enabled=ae.enabled);const{ok:G,body:S}=await Kl(f);if(dt.value=!1,!G){Ye.value=S.error||"Could not save settings.";return}Ls(S),Je(Vt.value?"Organization file-transfer settings saved.":"File-transfer settings saved.")}async function Ca(){gt.value=!0,_t.value=null;const{ok:x,body:f}=await Qh();gt.value=!1,_t.value=x&&f.health?f.health:{status:"down",detail:f.error||"Probe failed."},Tt.value=Date.now(),Sa()}function La(x){return x==="ok"?T.success:x==="degraded"?T.warning:T.danger}const Ke=bt({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),_e=K("user"),Xi=["baseURL","username","password","insecureSkipVerify","basePath"],At=bt(Object.fromEntries(Xi.map(x=>[x,""]))),di=K(""),Mi=K(!1),fi=K(!1),an=K(null),tn=K(null),yo=[{value:"false",label:"Verify certificate"},{value:"true",label:"Skip verification"}],Es=we(()=>Ke.isSuperadmin),Os=we(()=>Ke.isSuperadmin?"user":_e.value),Ma=we(()=>Ke.scopes[Os.value]||{editableLayer:"user",fields:{}}),rn=we(()=>Os.value==="org");function yn(x){return Ma.value.fields[x]||{effective:"",own:"",source:"unset",locked:!1}}function hi(x){return Es.value||yn(x).locked}function Zt(x){const f=yn(x).source;return f==="global"?"Set by administrator":f==="org"?"Set by your organization":""}function bo(){for(const x of Xi)At[x]=yn(x).own||"";At.insecureSkipVerify||(At.insecureSkipVerify="false")}function zs(x){Ke.available=!!x.available,Ke.orgEnabled=x.orgEnabled!==!1,Ke.enabled=!!x.enabled,Ke.canEditOrg=!!x.canEditOrg,Ke.isSuperadmin=!!x.isSuperadmin,Ke.scopes=x.scopes||{},_e.value==="org"&&!Ke.canEditOrg&&(_e.value="user"),bo(),Ke.loaded=!0}en(_e,()=>{di.value="",bo()});function Ea(){if(!tn.value)return"";const x=Math.max(0,Math.round((Date.now()-tn.value)/1e3));if(x<60)return"just now";const f=Math.round(x/60);if(f<60)return`${f} min ago`;const G=Math.round(f/60);return G<24?`${G} h ago`:`${Math.round(G/24)} d ago`}function Oa(){try{an.value&&localStorage.setItem(nu,JSON.stringify({health:an.value,ts:tn.value}))}catch{}}function za(){try{const x=localStorage.getItem(nu);if(!x)return;const f=JSON.parse(x);f&&f.health&&(an.value=f.health,tn.value=f.ts||null)}catch{}}async function As(){za();const{ok:x,body:f}=await np();x&&zs(f)}async function pi(x){const f=rn.value;f?Ke.orgEnabled=x:Ke.enabled=x;const{ok:G,body:S}=await Gl(f?{scope:"org",enabled:x}:{scope:"user",enabled:x});G?(zs(S),Je(f?x?"WebDAV enabled for your organization.":"WebDAV disabled for your organization.":x?"WebDAV enabled.":"WebDAV disabled.")):(f?Ke.orgEnabled=!x:Ke.enabled=!x,Je(S.error||"Could not update."))}async function xo(){di.value="",Mi.value=!0;const x={};for(const Qe of Xi)hi(Qe)||(x[Qe]=At[Qe]);const f={scope:Os.value,config:x};rn.value||(f.enabled=Ke.enabled);const{ok:G,body:S}=await Gl(f);if(Mi.value=!1,!G){di.value=S.error||"Could not save settings.";return}zs(S),Je(rn.value?"Organization WebDAV settings saved.":"WebDAV settings saved.")}async function wo(){fi.value=!0,an.value=null;const{ok:x,body:f}=await ip();fi.value=!1,an.value=x&&f.health?f.health:{status:"down",detail:f.error||"Probe failed."},tn.value=Date.now(),Oa()}function Ei(x){return x==="ok"?T.success:x==="degraded"?T.warning:T.danger}const se=bt({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,isOrgUser:!1,mounts:[],privateFolder:!1,privateEnabled:!1,allowPrivate:!0,rootConfigured:!1,scopes:{}}),it=K("user"),jn=K(""),ln=K(""),bn=K(!1),mi=K(!1),Oe=K(null),ut=K(null),Wn=K({}),Oi=[{value:"",label:"Inherit"},{value:"false",label:"Read-write"},{value:"true",label:"Read-only"}],Dt=we(()=>se.isSuperadmin),Is=we(()=>se.isSuperadmin?"user":it.value),Qi=we(()=>se.scopes[Is.value]||{editableLayer:"user",fields:{}}),St=we(()=>Is.value==="org");function vt(x){return Qi.value.fields[x]||{effective:"",own:"",source:"unset",locked:!1}}function On(x){return Dt.value||vt(x).locked}function gi(x){const f=vt(x).source;return f==="global"?"Set by administrator":f==="org"?"Set by your organization":""}function zi(x){return(Oi.find(f=>f.value===x)||{}).label||"Inherit"}function es(){jn.value=vt("readOnly").own||""}function xn(x){se.available=!!x.available,se.orgEnabled=x.orgEnabled!==!1,se.enabled=!!x.enabled,se.canEditOrg=!!x.canEditOrg,se.isSuperadmin=!!x.isSuperadmin,se.isOrgUser=!!x.isOrgUser,se.mounts=Array.isArray(x.mounts)?x.mounts:[],se.privateFolder=!!x.privateFolder,se.privateEnabled=!!x.privateEnabled,se.allowPrivate=x.allowPrivate!==!1,se.rootConfigured=!!x.rootConfigured,se.scopes=x.scopes||{},it.value==="org"&&!se.canEditOrg&&(it.value="user"),es(),se.loaded=!0}en(it,()=>{ln.value="",es()});function $s(){if(!ut.value)return"";const x=Math.max(0,Math.round((Date.now()-ut.value)/1e3));if(x<60)return"just now";const f=Math.round(x/60);if(f<60)return`${f} min ago`;const G=Math.round(f/60);return G<24?`${G} h ago`:`${Math.round(G/24)} d ago`}function Ds(){try{Oe.value&&localStorage.setItem(iu,JSON.stringify({health:Oe.value,ts:ut.value}))}catch{}}function ts(){try{const x=localStorage.getItem(iu);if(!x)return;const f=JSON.parse(x);f&&f.health&&(Oe.value=f.health,ut.value=f.ts||null)}catch{}}async function Ns(){ts();const{ok:x,body:f}=await ep();x&&xn(f)}async function ns(x){const f=St.value;f?se.orgEnabled=x:se.enabled=x;const{ok:G,body:S}=await Ko(f?{scope:"org",enabled:x}:{scope:"user",enabled:x});G?(xn(S),Je(f?x?"Local storage enabled for your organization.":"Local storage disabled for your organization.":x?"Local storage enabled.":"Local storage disabled.")):(f?se.orgEnabled=!x:se.enabled=!x,Je(S.error||"Could not update."))}async function is(x){se.privateFolder=x;const{ok:f,body:G}=await Ko({scope:"user",privateFolder:x});f?(xn(G),Je(x?"Private folder enabled.":"Private folder disabled.")):(se.privateFolder=!x,Je(G.error||"Could not update."))}async function ko(x){se.allowPrivate=x;const{ok:f,body:G}=await Ko({scope:"org",allowPrivate:x});f?(xn(G),Je(x?"Members may now create private folders.":"Private folders disabled for your organization.")):(se.allowPrivate=!x,Je(G.error||"Could not update."))}async function Rs(){ln.value="",bn.value=!0;const x={};On("readOnly")||(x.readOnly=jn.value);const f={scope:Is.value,config:x};St.value||(f.enabled=se.enabled);const{ok:G,body:S}=await Ko(f);if(bn.value=!1,!G){ln.value=S.error||"Could not save settings.";return}xn(S),Je(St.value?"Organization local-storage settings saved.":"Local-storage settings saved.")}async function Aa(){mi.value=!0,Oe.value=null,Wn.value={};const{ok:x,body:f}=await tp();mi.value=!1,Oe.value=x&&f.health?f.health:{status:"down",detail:f.error||"Probe failed."};const G={};if(Array.isArray(f.mounts))for(const S of f.mounts)G[S.id]={status:S.status,detail:S.detail};Wn.value=G,ut.value=Date.now(),Ds()}function Ve(x){return x==="ok"?T.success:x==="degraded"?T.warning:T.danger}const un=[{id:"apis-external",label:"APIs — External",icon:"globe"},{id:"drives-external",label:"Drives — External",icon:"server"},{id:"drives-local",label:"Drives — Local",icon:"monitor"}],st=K("apis-external");function ss(x){return V.value||st.value===x}const vi=K("");let Ai=null;function Je(x){vi.value=x,clearTimeout(Ai),Ai=setTimeout(()=>vi.value="",2200)}const wt=bt({current:"",next:"",confirm:""}),zn=K(""),_i=K(!1);function Ct(){if(_i.value=!1,!wt.current)return zn.value="Enter your current password.";if(wt.next.length<8)return zn.value="New password must be at least 8 characters.";if(wt.next!==wt.confirm)return zn.value="New passwords do not match.";zn.value="Validated. Connecting to the account service is pending — no password endpoint yet.",wt.current=wt.next=wt.confirm=""}const wn=K("");function So(){wn.value="Verification link would be sent once the account service is wired up."}function Po(x){const f=x.target.files&&x.target.files[0];if(!f)return;if(f.size>1.5*1024*1024){Je("Image too large (max ~1.5 MB).");return}const G=new FileReader;G.onload=()=>{ze.avatar=String(G.result),Je("Photo updated.")},G.readAsDataURL(f)}function Ia(){ze.avatar="",Je("Photo removed.")}const To=we(()=>{var G,S,Qe;const f=(ze.displayName||ze.name||o.email||"PV").split("@")[0].split(/[.\-_ ]+/).filter(Boolean);return((((G=f[0])==null?void 0:G[0])||"P")+(((S=f[1])==null?void 0:S[0])||((Qe=f[0])==null?void 0:Qe[1])||"V")).toUpperCase()}),Kn=K(!1),Co=K(""),Ii=K(""),Ge=K(""),os=K([]);function Ht(x){const f="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";let G="";for(let S=0;SHt(4).toLowerCase()+"-"+Ht(4).toLowerCase()),Ge.value=""}function $a(){ze.twoFactor=!1,os.value=[],Kn.value=!1}const Yt=navigator.userAgent;function Da(){return/Edg\//.test(Yt)?"Edge":/OPR\//.test(Yt)?"Opera":/Chrome\//.test(Yt)?"Chrome":/Firefox\//.test(Yt)?"Firefox":/Safari\//.test(Yt)?"Safari":"Browser"}function Mo(){return/Windows/.test(Yt)?"Windows":/Mac OS X/.test(Yt)?"macOS":/Android/.test(Yt)?"Android":/iPhone|iPad/.test(Yt)?"iOS":/Linux/.test(Yt)?"Linux":"Unknown OS"}const Na=Date.now(),as=K([]),Gn=K(!1),rs=K(""),ct=bt({email:"",password:"",role:"user",organization:""}),yi=K(""),Di=K(!1),Jt=K(""),Fs=we(()=>{const x=[{value:"user",label:"User"},{value:"admin",label:"Admin"}];return u.value&&x.push({value:"superadmin",label:"Superadmin"}),x}),Ni=K([]);async function qn(){if(!d.value)return;const x=await Hh();x.ok&&(Ni.value=x.organizations.slice().sort((f,G)=>f.name.localeCompare(G.name)))}const Eo=we(()=>{const x=Ni.value.map(f=>({value:f.id,label:f.name}));return u.value&&x.unshift({value:"",label:"No organization"}),x});async function Yn(){if(!d.value)return;Gn.value=!0,rs.value="";const x=await Bh();if(Gn.value=!1,!x.ok){rs.value=x.status===403?"Manager role required.":"Could not load users.";return}as.value=x.users.slice().sort((f,G)=>f.email.localeCompare(G.email))}function Ri(x){try{const f=x.data||{},G=Object.keys(f)[0];return G&&f[G]&&f[G].message||x.message||x.error||"Invalid input."}catch{return x.error||"Could not create user."}}async function Ra(){yi.value="";const x=ct.email.trim().toLowerCase();if(!x.includes("@"))return yi.value="Enter a valid email.";if(ct.password.length<8)return yi.value="Password must be at least 8 characters.";Di.value=!0;const f=u.value?ct.organization:o.organization,{ok:G,body:S}=await Vh(x,ct.password,ct.role,f);if(Di.value=!1,!G)return yi.value=Ri(S);ct.email="",ct.password="",ct.role="user",ct.organization="",Je("User created."),Yn()}async function Fa(x){const{ok:f,body:G}=await Zh(x.id);if(Jt.value="",!f)return Je(G.error||"Could not remove user.");Je("User removed."),Yn()}const Xe=bt({id:"",email:"",role:"user",verified:!1,password:"",organization:""}),An=K(""),Fi=K(!1),ls=we(()=>!!Xe.id&&Xe.email===o.email);function us(x){Jt.value="",Xe.id=x.id,Xe.email=x.email,Xe.role=x.role||"user",Xe.verified=!!x.verified,Xe.password="",Xe.organization=x.organization||"",An.value=""}function In(){Xe.id="",An.value=""}async function Ba(){An.value="";const x=Xe.email.trim().toLowerCase();if(!x.includes("@"))return An.value="Enter a valid email.";if(Xe.password&&Xe.password.length<8)return An.value="New password must be at least 8 characters (or leave blank).";const f={email:x,role:Xe.role,verified:Xe.verified};u.value&&(f.organization=Xe.organization),Xe.password&&(f.password=Xe.password),Fi.value=!0;const{ok:G,body:S}=await Uh(Xe.id,f);if(Fi.value=!1,!G)return An.value=Ri(S);Je("User updated."),In(),Yn()}const $n=bt({name:""}),Lt=K(""),Bi=K(!1),bi=K(""),kn=bt({id:"",name:""}),Sn=K(""),Vi=we(()=>{const x={};for(const f of as.value)f.organization&&(x[f.organization]=(x[f.organization]||0)+1);return x});async function Oo(){Lt.value="";const x=$n.name.trim();if(!x)return Lt.value="Enter an organization name.";Bi.value=!0;const{ok:f,body:G}=await jh(x);if(Bi.value=!1,!f)return Lt.value=Ri(G);$n.name="",Je("Organization created."),qn()}function Va(x){bi.value="",kn.id=x.id,kn.name=x.name,Sn.value=""}function Bs(){kn.id="",Sn.value=""}async function zo(){Sn.value="";const x=kn.name.trim();if(!x)return Sn.value="Enter an organization name.";const{ok:f,body:G}=await Wh(kn.id,x);if(!f)return Sn.value=Ri(G);Je("Organization renamed."),Bs(),qn(),Yn()}async function nn(x){const{ok:f,body:G}=await Kh(x.id);if(bi.value="",!f)return Je(G.error||"Could not delete organization.");Je("Organization deleted."),qn()}function xi(){const x={_app:"PilotVault",_kind:"settings-export",exportedAt:new Date().toISOString(),email:o.email,prefs:{...ze},themeMode:Yi.value},f=new Blob([JSON.stringify(x,null,2)],{type:"application/json"}),G=URL.createObjectURL(f),S=document.createElement("a");S.href=G,S.download=`pilotvault-settings-${new Date().toISOString().slice(0,10)}.json`,document.body.appendChild(S),S.click(),S.remove(),URL.revokeObjectURL(G),Je("Settings exported.")}const cs=K("");function Pn(x){const f=x.target.files&&x.target.files[0];if(!f)return;const G=new FileReader;G.onload=()=>{try{const S=JSON.parse(String(G.result)),Qe=S.prefs||S;if(!Cc(Qe))throw new Error("bad shape");S.themeMode&&la(S.themeMode),Ar(ze.fontSize),Ir(ze.reduceMotion),cs.value="Settings imported and applied."}catch{cs.value="That file is not a valid PilotVault settings export."}},G.readAsText(f),x.target.value=""}const pt=bt({understand:!1,typed:"",cooldown:0,armed:!1,msg:""});let cn=null;const Vs=we(()=>o.email||"DELETE MY ACCOUNT"),Jn=we(()=>pt.understand&&pt.typed===Vs.value);function Ao(){Jn.value&&(pt.armed=!0,pt.cooldown=5,clearInterval(cn),cn=setInterval(()=>{pt.cooldown--,pt.cooldown<=0&&clearInterval(cn)},1e3))}en(Jn,x=>{!x&&pt.armed&&(pt.armed=!1,pt.cooldown=0,clearInterval(cn))});function ds(){if(!(!pt.armed||pt.cooldown>0)){try{localStorage.removeItem("pv_prefs")}catch{}pt.msg="Account deletion requires the account service. Local data was cleared and you were signed out.",setTimeout(()=>l("logout"),900)}}return Li(()=>{Ce=setInterval(()=>Be.value=Date.now(),1e3),qn(),Yn(),F(),Ms(),As(),Ns()}),_a(()=>{clearInterval(Ce),clearInterval(cn),clearTimeout(Ai)}),(x,f)=>(m(),v("div",Xp,[r("div",Qp,[f[62]||(f[62]=r("div",null,[r("div",{class:"eyebrow"},"Preferences"),r("h2",{class:"mt-0.5 text-[22px] font-bold tracking-tightest text-ink"},"Settings")],-1)),r("div",em,[E(J,{name:"search",size:16,class:"text-ink-muted"}),re(r("input",{"onUpdate:modelValue":f[0]||(f[0]=G=>U.value=G),placeholder:"Search settings…",class:"w-full border-none bg-transparent text-sm text-ink outline-none placeholder:text-ink-muted"},null,512),[[ve,U.value]]),U.value?(m(),v("button",{key:0,class:"text-ink-muted hover:text-ink","aria-label":"Clear search",onClick:f[1]||(f[1]=G=>U.value="")},[E(J,{name:"x",size:15})])):R("",!0)])]),r("div",tm,[re(r("nav",nm,[(m(!0),v(le,null,Fe(w.value,G=>(m(),v("button",{key:G.id,class:Le(["flex items-center gap-2.5 rounded px-3 py-2.5 text-left text-sm transition",[z.value===G.id?G.danger?"bg-danger-soft font-semibold text-danger-fg":"bg-accent-soft font-semibold text-accent-soft-fg":G.danger?"font-medium text-danger-fg hover:bg-danger-soft":"font-medium text-ink-secondary hover:bg-surface-2"]]),onClick:S=>z.value=G.id},[E(J,{name:G.icon,size:17},null,8,["name"]),r("span",sm,k(G.label),1)],10,im))),128))],512),[[ah,!V.value]]),r("div",om,[V.value&&!Q.value.length?(m(),v("div",am," No settings match “"+k(U.value)+"”. ",1)):R("",!0),(m(!0),v(le,null,Fe(Q.value,G=>(m(),v(le,{key:G.id},[V.value?(m(),v("div",rm,[E(J,{name:G.icon,size:14},null,8,["name"]),D(" "+k(G.label),1)])):R("",!0),G.id==="account"?(m(),v("div",lm,[E(xe,{title:"Full name",desc:"Shown to your team on flights and audit logs.",keywords:"full name account"},{default:ye(()=>[re(r("input",{"onUpdate:modelValue":f[2]||(f[2]=S=>Ue(ze).name=S),class:"field w-56",placeholder:"Jane Operator",onBlur:f[3]||(f[3]=S=>Je("Saved."))},null,544),[[ve,Ue(ze).name]])]),_:1}),E(xe,{title:"Username",desc:"Your unique handle within PilotVault.",keywords:"username handle"},{default:ye(()=>[r("div",um,[f[63]||(f[63]=r("span",{class:"text-sm text-ink-muted"},"@",-1)),re(r("input",{"onUpdate:modelValue":f[4]||(f[4]=S=>Ue(ze).username=S),class:"field w-48",placeholder:"jane",onBlur:f[5]||(f[5]=S=>Je("Saved."))},null,544),[[ve,Ue(ze).username]])])]),_:1}),E(xe,{title:"Email address",desc:"Used for sign-in and notifications.",keywords:"email verification verify"},{default:ye(()=>[r("div",cm,[r("span",dm,k(t.email||"—"),1),r("span",fm,[E(J,{name:"mail",size:12}),f[64]||(f[64]=D(" Unverified ",-1))])])]),_:1}),E(xe,{title:"Role",desc:"Your access level in PilotVault.",keywords:"role admin user superadmin access rights permissions"},{default:ye(()=>[r("span",{class:Le(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",y(t.role)])},[E(J,{name:_(t.role),size:12},null,8,["name"]),D(k(h(t.role)),1)],2)]),_:1}),E(xe,{title:"Organization",desc:"The organization your account belongs to.",keywords:"organization org tenant company"},{default:ye(()=>[r("span",{class:Le(["text-sm",t.organizationName?"text-ink":"text-ink-muted"])},k(t.organizationName||(u.value?"All organizations":"None")),3)]),_:1}),E(xe,{block:"",title:"Verify email",desc:"Confirm ownership to enable password resets and alerts.",keywords:"verify email resend"},{default:ye(()=>[r("button",{class:"btn-ghost",onClick:So},"Send verification link"),wn.value?(m(),v("p",hm,k(wn.value),1)):R("",!0)]),_:1}),E(xe,{block:"",title:"Change password",desc:"Use at least 8 characters.",keywords:"password change current new"},{default:ye(()=>[r("div",pm,[re(r("input",{"onUpdate:modelValue":f[6]||(f[6]=S=>wt.current=S),type:"password",class:"field",placeholder:"Current password"},null,512),[[ve,wt.current]]),re(r("input",{"onUpdate:modelValue":f[7]||(f[7]=S=>wt.next=S),type:"password",class:"field",placeholder:"New password"},null,512),[[ve,wt.next]]),re(r("input",{"onUpdate:modelValue":f[8]||(f[8]=S=>wt.confirm=S),type:"password",class:"field",placeholder:"Confirm new password"},null,512),[[ve,wt.confirm]]),r("div",mm,[r("button",{class:"btn-accent",onClick:Ct},"Update password"),zn.value?(m(),v("span",{key:0,class:Le(["text-xs",_i.value?"text-success-fg":"text-ink-muted"])},k(zn.value),3)):R("",!0)])])]),_:1})])):G.id==="appearance"?(m(),v("div",gm,[E(xe,{title:"Theme",desc:"Light, dark, or follow your system.",keywords:"theme light dark system appearance"},{default:ye(()=>[E(hn,{modelValue:me.value,"onUpdate:modelValue":f[9]||(f[9]=S=>me.value=S),options:oe},null,8,["modelValue"])]),_:1}),E(xe,{title:"Font size",desc:"Scales the entire interface for readability.",keywords:"font size accessibility text"},{default:ye(()=>[E(hn,{modelValue:Ue(ze).fontSize,"onUpdate:modelValue":f[10]||(f[10]=S=>Ue(ze).fontSize=S),options:de},null,8,["modelValue"])]),_:1}),E(xe,{title:"Reduce motion",desc:"Minimise animations and transitions.",keywords:"reduce motion accessibility animation"},{default:ye(()=>[E(sn,{modelValue:Ue(ze).reduceMotion,"onUpdate:modelValue":f[11]||(f[11]=S=>Ue(ze).reduceMotion=S)},null,8,["modelValue"])]),_:1}),E(xe,{title:"Language",desc:"Interface language.",keywords:"language locale"},{default:ye(()=>[re(r("select",{"onUpdate:modelValue":f[12]||(f[12]=S=>Ue(ze).language=S),class:"field w-48"},[(m(),v(le,null,Fe(nt,([S,Qe])=>r("option",{key:S,value:S},k(Qe),9,vm)),64))],512),[[Et,Ue(ze).language]])]),_:1}),E(xe,{title:"Region",desc:"Affects number, unit and date defaults.",keywords:"region country locale"},{default:ye(()=>[re(r("select",{"onUpdate:modelValue":f[13]||(f[13]=S=>Ue(ze).region=S),class:"field w-48"},[(m(),v(le,null,Fe(ke,([S,Qe])=>r("option",{key:S,value:S},k(Qe),9,_m)),64))],512),[[Et,Ue(ze).region]])]),_:1}),E(xe,{title:"Date format",desc:"How calendar dates are displayed.",keywords:"date format"},{default:ye(()=>[re(r("select",{"onUpdate:modelValue":f[14]||(f[14]=S=>Ue(ze).dateFormat=S),class:"field w-48"},[(m(),v(le,null,Fe(Te,([S,Qe])=>r("option",{key:S,value:S},k(Qe),9,ym)),64))],512),[[Et,Ue(ze).dateFormat]])]),_:1}),E(xe,{title:"Time format",desc:"12- or 24-hour clock.",keywords:"time format clock 12 24 hour"},{default:ye(()=>[E(hn,{modelValue:Ue(ze).timeFormat,"onUpdate:modelValue":f[15]||(f[15]=S=>Ue(ze).timeFormat=S),options:Ne},null,8,["modelValue"])]),_:1}),E(xe,{title:"Preview",desc:"How timestamps appear across the app.",keywords:"preview date time"},{default:ye(()=>[r("span",bm,k(ee.value),1)]),_:1}),f[65]||(f[65]=r("p",{class:"mt-3 text-xs text-ink-muted"}," Language & region are stored now; full localisation ships with the account service. ",-1))])):G.id==="integrations"?(m(),v("div",xm,[V.value?R("",!0):(m(),v("div",wm,[(m(),v(le,null,Fe(un,S=>r("button",{key:S.id,type:"button",class:Le(["-mb-px inline-flex items-center gap-1.5 whitespace-nowrap border-b-2 px-3 py-2 text-sm font-semibold transition",st.value===S.id?"border-accent text-ink":"border-transparent text-ink-secondary hover:text-ink"]),onClick:Qe=>st.value=S.id},[E(J,{name:S.icon,size:16},null,8,["name"]),D(k(S.label),1)],10,km)),64))])),ss("apis-external")?(m(),v("div",Sm,[r("div",Pm,[r("div",Tm,[E(J,{name:"radio",size:20})]),f[66]||(f[66]=r("div",{class:"min-w-0"},[r("div",{class:"text-sm font-semibold text-ink"},"OpenSky Network"),r("div",{class:"mt-0.5 text-xs text-ink-muted"}," Live ADS-B aircraft data. Configure your own OAuth2 credentials, plan and default bounding box. ")],-1))]),pe.loaded&&!pe.available?(m(),v("div",Cm,[E(J,{name:"lock",size:14,class:"mr-1 inline"}),f[67]||(f[67]=D(" OpenSky is currently disabled by your administrator. Contact them to enable it. ",-1))])):R("",!0),pe.canEditOrg?(m(),v("div",Lm,[f[68]||(f[68]=r("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),E(hn,{modelValue:Re.value,"onUpdate:modelValue":f[16]||(f[16]=S=>Re.value=S),options:ht},null,8,["modelValue"])])):R("",!0),g.value?(m(),et(xe,{key:2,title:"Enable OpenSky (organization-wide)",desc:"Turn OpenSky on or off for everyone in your organization.",keywords:"enable disable plugin opensky organization"},{default:ye(()=>[E(sn,{"model-value":pe.orgEnabled,disabled:!pe.available,"onUpdate:modelValue":Y},null,8,["model-value","disabled"])]),_:1})):(m(),et(xe,{key:3,title:"Enable OpenSky",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin opensky"},{default:ye(()=>[E(sn,{"model-value":pe.enabled,disabled:!pe.available||!pe.orgEnabled,"onUpdate:modelValue":Y},null,8,["model-value","disabled"])]),_:1})),!g.value&&pe.available&&!pe.orgEnabled?(m(),v("div",Mm,[E(J,{name:"lock",size:13,class:"mr-1 inline"}),f[70]||(f[70]=D("OpenSky is turned off for your organization",-1)),pe.canEditOrg?(m(),v("span",Em,[...f[69]||(f[69]=[D(" — switch to ",-1),r("span",{class:"font-semibold"},"Organization",-1),D(" to turn it back on",-1)])])):R("",!0),f[71]||(f[71]=D(". ",-1))])):R("",!0),g.value?(m(),v("div",Om,[E(J,{name:"users",size:13,class:"mr-1 inline"}),f[72]||(f[72]=D("These are organization-wide settings — they apply to everyone in ",-1)),r("span",zm,k(t.organizationName||"your organization"),1),f[73]||(f[73]=D(". Leave a field blank to let each user choose their own; a value set here overrides the user's. ",-1))])):lt.value?(m(),v("div",Am," As a superadmin you manage the global OpenSky configuration in the API Server panel. The effective configuration is shown below. ")):R("",!0),pe.available&&!g.value?(m(),v("div",Im,[r("div",$m,[r("div",Dm,[E(J,{name:"signal",size:15}),f[74]||(f[74]=D("Credit usage ",-1))]),ge.value?(m(),v("span",Nm,"Checked "+k(I()),1)):R("",!0)]),Me.value?(m(),v(le,{key:0},[Me.value.remaining!=null?(m(),v(le,{key:0},[r("div",Rm,[r("span",Fm,k($(Me.value.remaining)),1),r("span",Bm,"/ "+k($(Me.value.daily))+" credits left today",1)]),r("div",Vm,[r("div",{class:Le(["h-full rounded-full transition-all",te.value]),style:Ss({width:je.value+"%"})},null,6)]),r("div",Um," Used "+k($(Me.value.daily-Me.value.remaining))+" today · "+k(Me.value.probeCost)+" credit"+k(Me.value.probeCost===1?"":"s")+" per query · "+k(Me.value.mode),1)],64)):(m(),v(le,{key:1},[r("div",Zm,[f[75]||(f[75]=D("Daily allowance: ",-1)),r("span",Hm,k($(Me.value.daily)),1),f[76]||(f[76]=D(" credits",-1))]),r("div",jm,k(Me.value.probeCost)+" credit"+k(Me.value.probeCost===1?"":"s")+" per query · "+k(Me.value.mode)+". OpenSky only reports live remaining credits for authenticated requests — add OAuth2 credentials below to track usage. ",1)],64))],64)):(m(),v("div",Wm,[...f[77]||(f[77]=[D(" Run ",-1),r("span",{class:"font-semibold text-ink-secondary"},"Test connection",-1),D(" below to fetch your live OpenSky credit balance. ",-1)])]))])):R("",!0),E(xe,{title:"OpenSky plan",desc:"Your account tier — sets the daily credit allowance.",keywords:"plan tier credits"},{default:ye(()=>[Z("plan")?(m(),v("span",Km,[D(k((O.find(S=>S.value===M("plan").effective)||{}).label||M("plan").effective||"—")+" ",1),B("plan")?(m(),v("span",Gm,[E(J,{name:"lock",size:10}),D(k(B("plan")),1)])):R("",!0)])):(m(),et(hn,{key:1,modelValue:Ze.plan,"onUpdate:modelValue":f[17]||(f[17]=S=>Ze.plan=S),options:O},null,8,["modelValue"]))]),_:1}),E(xe,{title:"Default bounding box",desc:"lamin,lomin,lamax,lomax — used for live queries and the health probe.",keywords:"bounding box bbox area"},{default:ye(()=>[Z("bbox")?(m(),v("span",qm,[D(k(M("bbox").effective||"—")+" ",1),B("bbox")?(m(),v("span",Ym,[E(J,{name:"lock",size:10}),D(k(B("bbox")),1)])):R("",!0)])):re((m(),v("input",{key:1,"onUpdate:modelValue":f[18]||(f[18]=S=>Ze.bbox=S),class:"field w-64 font-mono",placeholder:"50.5,3.2,53.7,7.3"},null,512)),[[ve,Ze.bbox]])]),_:1}),E(xe,{title:"OAuth2 client ID",desc:"Optional — leave blank for anonymous access (lower limits).",keywords:"oauth client id credentials"},{default:ye(()=>[Z("clientId")?(m(),v("span",Jm,[D(k(M("clientId").effective||"—")+" ",1),B("clientId")?(m(),v("span",Xm,[E(J,{name:"lock",size:10}),D(k(B("clientId")),1)])):R("",!0)])):re((m(),v("input",{key:1,"onUpdate:modelValue":f[19]||(f[19]=S=>Ze.clientId=S),class:"field w-64",placeholder:"your-api-client"},null,512)),[[ve,Ze.clientId]])]),_:1}),E(xe,{title:"OAuth2 client secret",desc:"Paired with the client ID for authenticated access.",keywords:"oauth client secret credentials password"},{default:ye(()=>[Z("clientSecret")?(m(),v("span",Qm,[D(k(M("clientSecret").effective||"—")+" ",1),B("clientSecret")?(m(),v("span",eg,[E(J,{name:"lock",size:10}),D(k(B("clientSecret")),1)])):R("",!0)])):re((m(),v("input",{key:1,"onUpdate:modelValue":f[20]||(f[20]=S=>Ze.clientSecret=S),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[ve,Ze.clientSecret]])]),_:1}),pe.available&&!pe.allowAnonymous?(m(),v("div",tg," Anonymous access is disabled by the administrator — OpenSky needs OAuth2 credentials from some layer to work. ")):R("",!0),r("div",ng,[lt.value?R("",!0):(m(),v("button",{key:0,class:"btn-accent",disabled:De.value||!pe.available,onClick:j},k(De.value?"Saving…":g.value?"Save organization settings":"Save settings"),9,ig)),g.value?R("",!0):(m(),v("button",{key:1,class:"btn-ghost",disabled:ne.value||!pe.available,onClick:Se},k(ne.value?"Testing…":"Test connection"),9,sg)),he.value?(m(),v("span",og,k(he.value),1)):R("",!0),rt.value&&!g.value?(m(),v("span",{key:3,class:Le(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",ce(rt.value.status)])},[f[78]||(f[78]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(k(rt.value.detail||rt.value.status),1)],2)):R("",!0)])])):R("",!0),ss("drives-external")?(m(),v(le,{key:2},[r("div",ag,[r("div",rg,[r("div",lg,[E(J,{name:"server",size:20})]),f[79]||(f[79]=r("div",{class:"min-w-0"},[r("div",{class:"text-sm font-semibold text-ink"},"File Transfer (FTP / SFTP)"),r("div",{class:"mt-0.5 text-xs text-ink-muted"}," Connect to an FTP, FTPS or SFTP server. Configure the connection your account uses for file transfers. ")],-1))]),ae.loaded&&!ae.available?(m(),v("div",ug,[E(J,{name:"lock",size:14,class:"mr-1 inline"}),f[80]||(f[80]=D(" File transfer is currently disabled by your administrator. Contact them to enable it. ",-1))])):R("",!0),ae.canEditOrg?(m(),v("div",cg,[f[81]||(f[81]=r("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),E(hn,{modelValue:Pe.value,"onUpdate:modelValue":f[21]||(f[21]=S=>Pe.value=S),options:ht},null,8,["modelValue"])])):R("",!0),Vt.value?(m(),et(xe,{key:2,title:"Enable file transfer (organization-wide)",desc:"Turn it on or off for everyone in your organization.",keywords:"enable disable plugin ftp sftp organization"},{default:ye(()=>[E(sn,{"model-value":ae.orgEnabled,disabled:!ae.available,"onUpdate:modelValue":_o},null,8,["model-value","disabled"])]),_:1})):(m(),et(xe,{key:3,title:"Enable file transfer",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin ftp sftp"},{default:ye(()=>[E(sn,{"model-value":ae.enabled,disabled:!ae.available||!ae.orgEnabled,"onUpdate:modelValue":_o},null,8,["model-value","disabled"])]),_:1})),!Vt.value&&ae.available&&!ae.orgEnabled?(m(),v("div",dg,[E(J,{name:"lock",size:13,class:"mr-1 inline"}),f[83]||(f[83]=D("File transfer is turned off for your organization",-1)),ae.canEditOrg?(m(),v("span",fg,[...f[82]||(f[82]=[D(" — switch to ",-1),r("span",{class:"font-semibold"},"Organization",-1),D(" to turn it back on",-1)])])):R("",!0),f[84]||(f[84]=D(". ",-1))])):R("",!0),Vt.value?(m(),v("div",hg,[E(J,{name:"users",size:13,class:"mr-1 inline"}),f[85]||(f[85]=D("These are organization-wide settings — they apply to everyone in ",-1)),r("span",pg,k(t.organizationName||"your organization"),1),f[86]||(f[86]=D(". Leave the connection blank to let each user configure their own; a connection set here overrides the user's. ",-1))])):kt.value?(m(),v("div",mg," As a superadmin you manage the global file-transfer configuration in the API Server panel. The effective configuration is shown below. ")):R("",!0),E(xe,{title:"Protocol",desc:"SFTP (over SSH), FTPS (FTP over TLS), or plain FTP.",keywords:"protocol sftp ftps ftp"},{default:ye(()=>[Ut("protocol")?(m(),v("span",gg,[D(k(wa(zt("protocol").effective))+" ",1),yt("protocol")?(m(),v("span",vg,[E(J,{name:"lock",size:10}),D(k(yt("protocol")),1)])):R("",!0)])):(m(),et(hn,{key:1,modelValue:be.protocol,"onUpdate:modelValue":f[22]||(f[22]=S=>be.protocol=S),options:_n},null,8,["modelValue"]))]),_:1}),E(xe,{title:"Host",desc:"Server hostname or IP address.",keywords:"host server address"},{default:ye(()=>[Ut("host")?(m(),v("span",_g,[D(k(zt("host").effective||"—")+" ",1),yt("host")?(m(),v("span",yg,[E(J,{name:"lock",size:10}),D(k(yt("host")),1)])):R("",!0)])):re((m(),v("input",{key:1,"onUpdate:modelValue":f[23]||(f[23]=S=>be.host=S),class:"field w-64",placeholder:"files.example.com"},null,512)),[[ve,be.host]])]),_:1}),E(xe,{title:"Port",desc:"Leave blank for the protocol default (22 for SFTP, 21 for FTP/FTPS).",keywords:"port"},{default:ye(()=>[Ut("port")?(m(),v("span",bg,[D(k(zt("port").effective||"default")+" ",1),yt("port")?(m(),v("span",xg,[E(J,{name:"lock",size:10}),D(k(yt("port")),1)])):R("",!0)])):re((m(),v("input",{key:1,"onUpdate:modelValue":f[24]||(f[24]=S=>be.port=S),inputmode:"numeric",class:"field w-24 font-mono",placeholder:"22"},null,512)),[[ve,be.port]])]),_:1}),E(xe,{title:"Username",desc:"Account used to authenticate.",keywords:"username login account"},{default:ye(()=>[Ut("username")?(m(),v("span",wg,[D(k(zt("username").effective||"—")+" ",1),yt("username")?(m(),v("span",kg,[E(J,{name:"lock",size:10}),D(k(yt("username")),1)])):R("",!0)])):re((m(),v("input",{key:1,"onUpdate:modelValue":f[25]||(f[25]=S=>be.username=S),class:"field w-64",placeholder:"user"},null,512)),[[ve,be.username]])]),_:1}),E(xe,{title:"Password",desc:"Password auth for FTP/FTPS, or SFTP password login. Leave blank to use a key.",keywords:"password secret credentials"},{default:ye(()=>[Ut("password")?(m(),v("span",Sg,[D(k(zt("password").effective||"—")+" ",1),yt("password")?(m(),v("span",Pg,[E(J,{name:"lock",size:10}),D(k(yt("password")),1)])):R("",!0)])):re((m(),v("input",{key:1,"onUpdate:modelValue":f[26]||(f[26]=S=>be.password=S),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[ve,be.password]])]),_:1}),Ji.value==="sftp"?(m(),et(xe,{key:7,block:"",title:"SSH private key",desc:"PEM key for SFTP key auth — used instead of, or alongside, a password.",keywords:"private key ssh pem identity"},{default:ye(()=>[Ut("privateKey")?(m(),v("span",Tg,[D(k(zt("privateKey").effective||"—")+" ",1),yt("privateKey")?(m(),v("span",Cg,[E(J,{name:"lock",size:10}),D(k(yt("privateKey")),1)])):R("",!0)])):re((m(),v("textarea",{key:1,"onUpdate:modelValue":f[27]||(f[27]=S=>be.privateKey=S),rows:"3",class:"field w-full font-mono text-xs",placeholder:"-----BEGIN OPENSSH PRIVATE KEY-----"},null,512)),[[ve,be.privateKey]])]),_:1})):R("",!0),Ji.value==="sftp"?(m(),et(xe,{key:8,title:"Private key passphrase",desc:"Passphrase protecting the SSH private key, if any.",keywords:"passphrase key secret"},{default:ye(()=>[Ut("keyPassphrase")?(m(),v("span",Lg,[D(k(zt("keyPassphrase").effective||"—")+" ",1),yt("keyPassphrase")?(m(),v("span",Mg,[E(J,{name:"lock",size:10}),D(k(yt("keyPassphrase")),1)])):R("",!0)])):re((m(),v("input",{key:1,"onUpdate:modelValue":f[28]||(f[28]=S=>be.keyPassphrase=S),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[ve,be.keyPassphrase]])]),_:1})):R("",!0),Ji.value==="sftp"?(m(),et(xe,{key:9,title:"Host key fingerprint",desc:"Optional SHA256:… fingerprint to pin the server's host key. Blank accepts any key.",keywords:"host key fingerprint verify trust"},{default:ye(()=>[Ut("hostKeyFingerprint")?(m(),v("span",Eg,[D(k(zt("hostKeyFingerprint").effective||"—")+" ",1),yt("hostKeyFingerprint")?(m(),v("span",Og,[E(J,{name:"lock",size:10}),D(k(yt("hostKeyFingerprint")),1)])):R("",!0)])):re((m(),v("input",{key:1,"onUpdate:modelValue":f[29]||(f[29]=S=>be.hostKeyFingerprint=S),class:"field w-full font-mono text-xs",placeholder:"SHA256:…"},null,512)),[[ve,be.hostKeyFingerprint]])]),_:1})):R("",!0),Ji.value==="ftps"?(m(),et(xe,{key:10,title:"TLS verification",desc:"Skip only for self-signed test servers.",keywords:"tls certificate verify insecure ftps"},{default:ye(()=>[Ut("insecureSkipVerify")?(m(),v("span",zg,[D(k(zt("insecureSkipVerify").effective==="true"?"Skip verification":"Verify certificate")+" ",1),yt("insecureSkipVerify")?(m(),v("span",Ag,[E(J,{name:"lock",size:10}),D(k(yt("insecureSkipVerify")),1)])):R("",!0)])):(m(),et(hn,{key:1,modelValue:be.insecureSkipVerify,"onUpdate:modelValue":f[30]||(f[30]=S=>be.insecureSkipVerify=S),options:ci},null,8,["modelValue"]))]),_:1})):R("",!0),E(xe,{title:"Base path",desc:"Working directory and health-check target, e.g. /uploads.",keywords:"base path directory folder root"},{default:ye(()=>[Ut("basePath")?(m(),v("span",Ig,[D(k(zt("basePath").effective||"—")+" ",1),yt("basePath")?(m(),v("span",$g,[E(J,{name:"lock",size:10}),D(k(yt("basePath")),1)])):R("",!0)])):re((m(),v("input",{key:1,"onUpdate:modelValue":f[31]||(f[31]=S=>be.basePath=S),class:"field w-64 font-mono",placeholder:"/uploads"},null,512)),[[ve,be.basePath]])]),_:1}),r("div",Dg,[kt.value?R("",!0):(m(),v("button",{key:0,class:"btn-accent",disabled:dt.value||!ae.available,onClick:Ta},k(dt.value?"Saving…":Vt.value?"Save organization settings":"Save settings"),9,Ng)),Vt.value?R("",!0):(m(),v("button",{key:1,class:"btn-ghost",disabled:gt.value||!ae.available,onClick:Ca},k(gt.value?"Testing…":"Test connection"),9,Rg)),Ye.value?(m(),v("span",Fg,k(Ye.value),1)):R("",!0),Tt.value&&!Vt.value?(m(),v("span",Bg,"Checked "+k(ka()),1)):R("",!0),_t.value&&!Vt.value?(m(),v("span",{key:4,class:Le(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",La(_t.value.status)])},[f[87]||(f[87]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(k(_t.value.detail||_t.value.status),1)],2)):R("",!0)])]),r("div",Vg,[r("div",Ug,[r("div",Zg,[E(J,{name:"cloud",size:20})]),f[88]||(f[88]=r("div",{class:"min-w-0"},[r("div",{class:"text-sm font-semibold text-ink"},"WebDAV"),r("div",{class:"mt-0.5 text-xs text-ink-muted"}," Connect to a WebDAV server (Nextcloud, ownCloud, IIS, …). Configure the connection your account uses. ")],-1))]),Ke.loaded&&!Ke.available?(m(),v("div",Hg,[E(J,{name:"lock",size:14,class:"mr-1 inline"}),f[89]||(f[89]=D(" WebDAV is currently disabled by your administrator. Contact them to enable it. ",-1))])):R("",!0),Ke.canEditOrg?(m(),v("div",jg,[f[90]||(f[90]=r("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),E(hn,{modelValue:_e.value,"onUpdate:modelValue":f[32]||(f[32]=S=>_e.value=S),options:ht},null,8,["modelValue"])])):R("",!0),rn.value?(m(),et(xe,{key:2,title:"Enable WebDAV (organization-wide)",desc:"Turn it on or off for everyone in your organization.",keywords:"enable disable plugin webdav organization"},{default:ye(()=>[E(sn,{"model-value":Ke.orgEnabled,disabled:!Ke.available,"onUpdate:modelValue":pi},null,8,["model-value","disabled"])]),_:1})):(m(),et(xe,{key:3,title:"Enable WebDAV",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin webdav"},{default:ye(()=>[E(sn,{"model-value":Ke.enabled,disabled:!Ke.available||!Ke.orgEnabled,"onUpdate:modelValue":pi},null,8,["model-value","disabled"])]),_:1})),!rn.value&&Ke.available&&!Ke.orgEnabled?(m(),v("div",Wg,[E(J,{name:"lock",size:13,class:"mr-1 inline"}),f[92]||(f[92]=D("WebDAV is turned off for your organization",-1)),Ke.canEditOrg?(m(),v("span",Kg,[...f[91]||(f[91]=[D(" — switch to ",-1),r("span",{class:"font-semibold"},"Organization",-1),D(" to turn it back on",-1)])])):R("",!0),f[93]||(f[93]=D(". ",-1))])):R("",!0),rn.value?(m(),v("div",Gg,[E(J,{name:"users",size:13,class:"mr-1 inline"}),f[94]||(f[94]=D("These are organization-wide settings — they apply to everyone in ",-1)),r("span",qg,k(t.organizationName||"your organization"),1),f[95]||(f[95]=D(". Leave the connection blank to let each user configure their own; a connection set here overrides the user's. ",-1))])):Es.value?(m(),v("div",Yg," As a superadmin you manage the global WebDAV configuration in the API Server panel. The effective configuration is shown below. ")):R("",!0),E(xe,{block:"",title:"Server URL",desc:"WebDAV endpoint including scheme, e.g. https://cloud.example.com/remote.php/dav/files/alice/.",keywords:"url server address endpoint webdav host"},{default:ye(()=>[hi("baseURL")?(m(),v("span",Jg,[D(k(yn("baseURL").effective||"—")+" ",1),Zt("baseURL")?(m(),v("span",Xg,[E(J,{name:"lock",size:10}),D(k(Zt("baseURL")),1)])):R("",!0)])):re((m(),v("input",{key:1,"onUpdate:modelValue":f[33]||(f[33]=S=>At.baseURL=S),class:"field w-full font-mono text-xs",placeholder:"https://cloud.example.com/remote.php/dav/files/alice/"},null,512)),[[ve,At.baseURL]])]),_:1}),E(xe,{title:"Username",desc:"Account used to authenticate (leave blank for a public share).",keywords:"username login account"},{default:ye(()=>[hi("username")?(m(),v("span",Qg,[D(k(yn("username").effective||"—")+" ",1),Zt("username")?(m(),v("span",ev,[E(J,{name:"lock",size:10}),D(k(Zt("username")),1)])):R("",!0)])):re((m(),v("input",{key:1,"onUpdate:modelValue":f[34]||(f[34]=S=>At.username=S),class:"field w-64",placeholder:"user"},null,512)),[[ve,At.username]])]),_:1}),E(xe,{title:"Password",desc:"Password or app-specific token for HTTP Basic auth.",keywords:"password secret credentials token"},{default:ye(()=>[hi("password")?(m(),v("span",tv,[D(k(yn("password").effective||"—")+" ",1),Zt("password")?(m(),v("span",nv,[E(J,{name:"lock",size:10}),D(k(Zt("password")),1)])):R("",!0)])):re((m(),v("input",{key:1,"onUpdate:modelValue":f[35]||(f[35]=S=>At.password=S),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[ve,At.password]])]),_:1}),E(xe,{title:"TLS verification",desc:"Only affects HTTPS. Skip only for self-signed test servers.",keywords:"tls certificate verify insecure https"},{default:ye(()=>[hi("insecureSkipVerify")?(m(),v("span",iv,[D(k(yn("insecureSkipVerify").effective==="true"?"Skip verification":"Verify certificate")+" ",1),Zt("insecureSkipVerify")?(m(),v("span",sv,[E(J,{name:"lock",size:10}),D(k(Zt("insecureSkipVerify")),1)])):R("",!0)])):(m(),et(hn,{key:1,modelValue:At.insecureSkipVerify,"onUpdate:modelValue":f[36]||(f[36]=S=>At.insecureSkipVerify=S),options:yo},null,8,["modelValue"]))]),_:1}),E(xe,{title:"Base path",desc:"Working directory under the server URL and health-check target, e.g. /Documents.",keywords:"base path directory folder root"},{default:ye(()=>[hi("basePath")?(m(),v("span",ov,[D(k(yn("basePath").effective||"—")+" ",1),Zt("basePath")?(m(),v("span",av,[E(J,{name:"lock",size:10}),D(k(Zt("basePath")),1)])):R("",!0)])):re((m(),v("input",{key:1,"onUpdate:modelValue":f[37]||(f[37]=S=>At.basePath=S),class:"field w-64 font-mono",placeholder:"/Documents"},null,512)),[[ve,At.basePath]])]),_:1}),r("div",rv,[Es.value?R("",!0):(m(),v("button",{key:0,class:"btn-accent",disabled:Mi.value||!Ke.available,onClick:xo},k(Mi.value?"Saving…":rn.value?"Save organization settings":"Save settings"),9,lv)),rn.value?R("",!0):(m(),v("button",{key:1,class:"btn-ghost",disabled:fi.value||!Ke.available,onClick:wo},k(fi.value?"Testing…":"Test connection"),9,uv)),di.value?(m(),v("span",cv,k(di.value),1)):R("",!0),tn.value&&!rn.value?(m(),v("span",dv,"Checked "+k(Ea()),1)):R("",!0),an.value&&!rn.value?(m(),v("span",{key:4,class:Le(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",Ei(an.value.status)])},[f[96]||(f[96]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(k(an.value.detail||an.value.status),1)],2)):R("",!0)])])],64)):R("",!0),ss("drives-local")?(m(),v("div",fv,[r("div",hv,[r("div",pv,[E(J,{name:"monitor",size:20})]),f[97]||(f[97]=r("div",{class:"min-w-0"},[r("div",{class:"text-sm font-semibold text-ink"},"Local Storage"),r("div",{class:"mt-0.5 text-xs text-ink-muted"}," A private folder on the server for your files. Each user has their own; members of an organization share one. ")],-1))]),se.loaded&&!se.available?(m(),v("div",mv,[E(J,{name:"lock",size:14,class:"mr-1 inline"}),f[98]||(f[98]=D(" Local storage is currently disabled by your administrator. Contact them to enable it. ",-1))])):se.loaded&&!se.rootConfigured?(m(),v("div",gv,[E(J,{name:"alertTriangle",size:14,class:"mr-1 inline"}),f[99]||(f[99]=D(" No storage root has been configured by your administrator yet. ",-1))])):R("",!0),se.canEditOrg?(m(),v("div",vv,[f[100]||(f[100]=r("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),E(hn,{modelValue:it.value,"onUpdate:modelValue":f[38]||(f[38]=S=>it.value=S),options:ht},null,8,["modelValue"])])):R("",!0),St.value?(m(),et(xe,{key:3,title:"Enable local storage (organization-wide)",desc:"Turn it on or off for everyone in your organization.",keywords:"enable disable plugin local storage folder organization"},{default:ye(()=>[E(sn,{"model-value":se.orgEnabled,disabled:!se.available,"onUpdate:modelValue":ns},null,8,["model-value","disabled"])]),_:1})):(m(),et(xe,{key:4,title:"Enable local storage",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin local storage folder"},{default:ye(()=>[E(sn,{"model-value":se.enabled,disabled:!se.available||!se.orgEnabled,"onUpdate:modelValue":ns},null,8,["model-value","disabled"])]),_:1})),!St.value&&se.available&&!se.orgEnabled?(m(),v("div",_v,[E(J,{name:"lock",size:13,class:"mr-1 inline"}),f[102]||(f[102]=D("Local storage is turned off for your organization",-1)),se.canEditOrg?(m(),v("span",yv,[...f[101]||(f[101]=[D(" — switch to ",-1),r("span",{class:"font-semibold"},"Organization",-1),D(" to turn it back on",-1)])])):R("",!0),f[103]||(f[103]=D(". ",-1))])):R("",!0),St.value?(m(),v("div",bv,[E(J,{name:"users",size:13,class:"mr-1 inline"}),f[104]||(f[104]=D("These are organization-wide settings — they apply to everyone in ",-1)),r("span",xv,k(t.organizationName||"your organization"),1),f[105]||(f[105]=D(", who all share the organization folder. Members can additionally enable a private folder inside it. ",-1))])):Dt.value?(m(),v("div",wv," As a superadmin you manage the global storage root in the API Server panel. The effective configuration is shown below. ")):R("",!0),St.value?(m(),et(xe,{key:8,title:"Private folders",desc:"Let members create a private folder inside the organization folder, reachable only by them.",keywords:"private folder members allow policy organization"},{default:ye(()=>[E(sn,{"model-value":se.allowPrivate,disabled:!se.available,"onUpdate:modelValue":ko},null,8,["model-value","disabled"])]),_:1})):R("",!0),St.value?R("",!0):(m(),v(le,{key:9},[E(xe,{block:"",title:"Your folders",desc:"Assigned automatically and isolated — no one else can reach your private folder.",keywords:"folder directory path storage location isolated private shared"},{default:ye(()=>[r("div",kv,[(m(!0),v(le,null,Fe(se.mounts,S=>(m(),v("div",{key:S.id,class:"flex flex-wrap items-center gap-2"},[r("span",Sv,k(S.path),1),S.kind==="shared"?(m(),v("span",Pv,[E(J,{name:"users",size:10}),f[106]||(f[106]=D("Shared with your organization",-1))])):(m(),v("span",Tv,[E(J,{name:"lock",size:10}),f[107]||(f[107]=D("Private to you",-1))])),Wn.value[S.id]?(m(),v("span",{key:2,class:Le(["inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[10px] font-semibold",Ve(Wn.value[S.id].status)])},[f[108]||(f[108]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(k(Wn.value[S.id].status),1)],2)):R("",!0)]))),128)),se.mounts.length?R("",!0):(m(),v("div",Cv,k(se.rootConfigured?"No folder assigned yet.":"Waiting for the administrator to configure a storage root."),1))])]),_:1}),se.isOrgUser&&se.allowPrivate?(m(),et(xe,{key:0,title:"My private folder",desc:"Add a private folder inside the organization folder, reachable only by you — you keep the shared folder too.",keywords:"private folder personal isolated organization inside"},{default:ye(()=>[E(sn,{"model-value":se.privateFolder,disabled:!se.available||!se.orgEnabled,"onUpdate:modelValue":is},null,8,["model-value","disabled"])]),_:1})):se.isOrgUser&&!se.allowPrivate?(m(),v("div",Lv,[E(J,{name:"lock",size:13,class:"mr-1 inline"}),f[109]||(f[109]=D("Private folders are turned off by your organization. ",-1))])):R("",!0)],64)),E(xe,{title:"Access mode",desc:"Read-only prevents uploads, deletes and folder creation.",keywords:"read only write access mode permission"},{default:ye(()=>[On("readOnly")?(m(),v("span",Mv,[D(k(zi(vt("readOnly").effective))+" ",1),gi("readOnly")?(m(),v("span",Ev,[E(J,{name:"lock",size:10}),D(k(gi("readOnly")),1)])):R("",!0)])):(m(),et(hn,{key:1,modelValue:jn.value,"onUpdate:modelValue":f[39]||(f[39]=S=>jn.value=S),options:Oi},null,8,["modelValue"]))]),_:1}),r("div",Ov,[Dt.value?R("",!0):(m(),v("button",{key:0,class:"btn-accent",disabled:bn.value||!se.available,onClick:Rs},k(bn.value?"Saving…":St.value?"Save organization settings":"Save settings"),9,zv)),St.value?R("",!0):(m(),v("button",{key:1,class:"btn-ghost",disabled:mi.value||!se.available,onClick:Aa},k(mi.value?"Testing…":"Test folder"),9,Av)),ln.value?(m(),v("span",Iv,k(ln.value),1)):R("",!0),ut.value&&!St.value?(m(),v("span",$v,"Checked "+k($s()),1)):R("",!0),Oe.value&&!St.value?(m(),v("span",{key:4,class:Le(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",Ve(Oe.value.status)])},[f[110]||(f[110]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(k(Oe.value.detail||Oe.value.status),1)],2)):R("",!0)])])):R("",!0)])):G.id==="profile"?(m(),v("div",Dv,[E(xe,{block:"",title:"Profile photo",desc:"PNG or JPG, up to ~1.5 MB. Stored on this device.",keywords:"avatar photo picture"},{default:ye(()=>[r("div",Nv,[Ue(ze).avatar?(m(),v("img",{key:0,src:Ue(ze).avatar,alt:"Avatar",class:"h-16 w-16 rounded-full object-cover"},null,8,Rv)):(m(),v("div",Fv,k(To.value),1)),r("div",Bv,[r("label",Vv,[E(J,{name:"upload",size:15,class:"mr-1.5 inline"}),f[111]||(f[111]=D("Upload ",-1)),r("input",{type:"file",accept:"image/*",class:"hidden",onChange:Po},null,32)]),Ue(ze).avatar?(m(),v("button",{key:0,class:"btn-ghost",onClick:Ia},"Remove")):R("",!0)])])]),_:1}),E(xe,{title:"Display name",desc:"The name shown on your public profile.",keywords:"display name profile"},{default:ye(()=>[re(r("input",{"onUpdate:modelValue":f[40]||(f[40]=S=>Ue(ze).displayName=S),class:"field w-56",placeholder:"Jane O.",onBlur:f[41]||(f[41]=S=>Je("Saved."))},null,544),[[ve,Ue(ze).displayName]])]),_:1}),E(xe,{block:"",title:"Bio",desc:"A short description others can see.",keywords:"bio about description"},{default:ye(()=>[re(r("textarea",{"onUpdate:modelValue":f[42]||(f[42]=S=>Ue(ze).bio=S),rows:"3",maxlength:"240",class:"field w-full resize-none",placeholder:"Flight director, North yard operations…",onBlur:f[43]||(f[43]=S=>Je("Saved."))},null,544),[[ve,Ue(ze).bio]]),r("div",Uv,k((Ue(ze).bio||"").length)+"/240",1)]),_:1}),E(xe,{title:"Show email on profile",desc:"Let teammates see your email address.",keywords:"show email public visibility"},{default:ye(()=>[E(sn,{modelValue:Ue(ze).showEmail,"onUpdate:modelValue":f[44]||(f[44]=S=>Ue(ze).showEmail=S)},null,8,["modelValue"])]),_:1})])):G.id==="security"?(m(),v("div",Zv,[E(xe,{block:"",title:"Two-factor authentication",desc:"Require a one-time code at sign-in.",keywords:"two factor 2fa authentication security"},{default:ye(()=>[r("div",Hv,[r("span",{class:Le(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",Ue(ze).twoFactor?"bg-success-soft text-success-fg":"bg-surface-2 text-ink-secondary"])},[f[112]||(f[112]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(k(Ue(ze).twoFactor?"Enabled":"Disabled"),1)],2),!Ue(ze).twoFactor&&!Kn.value?(m(),v("button",{key:0,class:"btn-accent",onClick:$i},"Enable 2FA")):Ue(ze).twoFactor?(m(),v("button",{key:1,class:"btn-ghost",onClick:$a},"Disable")):R("",!0)]),Kn.value?(m(),v("div",jv,[r("div",Wv,[f[114]||(f[114]=r("div",{class:"grid h-28 w-28 place-items-center rounded bg-white p-2"},[r("svg",{viewBox:"0 0 100 100",class:"h-full w-full"},[r("rect",{width:"100",height:"100",fill:"#fff"}),r("g",{fill:"#0F1E3D"},[r("rect",{x:"6",y:"6",width:"24",height:"24"}),r("rect",{x:"70",y:"6",width:"24",height:"24"}),r("rect",{x:"6",y:"70",width:"24",height:"24"}),r("rect",{x:"12",y:"12",width:"12",height:"12",fill:"#fff"}),r("rect",{x:"76",y:"12",width:"12",height:"12",fill:"#fff"}),r("rect",{x:"12",y:"76",width:"12",height:"12",fill:"#fff"}),r("rect",{x:"40",y:"10",width:"8",height:"8"}),r("rect",{x:"52",y:"20",width:"8",height:"8"}),r("rect",{x:"40",y:"40",width:"8",height:"8"}),r("rect",{x:"60",y:"44",width:"8",height:"8"}),r("rect",{x:"44",y:"60",width:"8",height:"8"}),r("rect",{x:"70",y:"60",width:"8",height:"8"}),r("rect",{x:"80",y:"72",width:"8",height:"8"}),r("rect",{x:"60",y:"80",width:"8",height:"8"})])])],-1)),r("div",Kv,[f[113]||(f[113]=r("div",{class:"text-xs text-ink-secondary"},"Scan with an authenticator app, or enter this secret:",-1)),r("div",Gv,k(Co.value),1),r("div",qv,[re(r("input",{"onUpdate:modelValue":f[45]||(f[45]=S=>Ii.value=S),inputmode:"numeric",maxlength:"6",class:"field w-28 font-mono tracking-[0.3em]",placeholder:"000000"},null,512),[[ve,Ii.value]]),r("button",{class:"btn-accent",onClick:Lo},"Verify & enable")]),Ge.value?(m(),v("p",Yv,k(Ge.value),1)):R("",!0)])])])):R("",!0),Ue(ze).twoFactor&&os.value.length?(m(),v("div",Jv,[f[115]||(f[115]=r("div",{class:"text-xs font-semibold text-ink"},"Recovery codes",-1)),f[116]||(f[116]=r("div",{class:"mt-0.5 text-xs text-ink-muted"},"Store these somewhere safe — each works once.",-1)),r("div",Xv,[(m(!0),v(le,null,Fe(os.value,S=>(m(),v("span",{key:S,class:"select-all"},k(S),1))),128))])])):R("",!0),f[117]||(f[117]=r("p",{class:"mt-2 text-xs text-ink-muted"},"Prototype — codes are generated locally until the account service verifies them.",-1))]),_:1}),E(xe,{block:"",title:"Active sessions",desc:"Devices currently signed in to your account.",keywords:"sessions devices logout sign out remote"},{default:ye(()=>[r("div",Qv,[r("div",e_,[r("div",t_,[E(J,{name:"monitor",size:18})]),r("div",n_,[r("div",i_,[D(k(Da())+" on "+k(Mo())+" ",1),f[118]||(f[118]=r("span",{class:"ml-1 rounded-full bg-success-soft px-2 py-0.5 text-[10px] font-semibold text-success-fg"},"This device",-1))]),r("div",s_,"Signed in "+k(Ue(Yl)(Ue(Na))),1)]),r("button",{class:"btn-ghost",onClick:f[46]||(f[46]=S=>l("logout"))},"Log out")])]),f[119]||(f[119]=r("button",{class:"btn-ghost mt-2 opacity-60",disabled:"",title:"Requires the account service"}," Log out all other devices ",-1)),f[120]||(f[120]=r("p",{class:"mt-2 text-xs text-ink-muted"}," Only this session is visible from the browser; enumerating and revoking remote sessions needs the account service. ",-1))]),_:1})])):G.id==="team"?(m(),v("div",o_,[Xe.id?(m(),v("div",a_,[E(xe,{block:"",title:`Edit user — ${Xe.email}`,desc:"Update details, change role, reset password, or set verified.",keywords:"edit user update role password verified organization"},{default:ye(()=>[r("div",r_,[r("div",l_,[re(r("input",{"onUpdate:modelValue":f[47]||(f[47]=S=>Xe.email=S),type:"email",class:"field flex-1",placeholder:"name@pilotvault.local"},null,512),[[ve,Xe.email]]),re(r("select",{"onUpdate:modelValue":f[48]||(f[48]=S=>Xe.role=S),class:"field w-32",disabled:ls.value,title:ls.value?"You cannot change your own role":""},[(m(!0),v(le,null,Fe(Fs.value,S=>(m(),v("option",{key:S.value,value:S.value},k(S.label),9,c_))),128))],8,u_),[[Et,Xe.role]])]),u.value?re((m(),v("select",{key:0,"onUpdate:modelValue":f[49]||(f[49]=S=>Xe.organization=S),class:"field",title:"Organization"},[(m(!0),v(le,null,Fe(Eo.value,S=>(m(),v("option",{key:S.value,value:S.value},k(S.label),9,d_))),128))],512)),[[Et,Xe.organization]]):R("",!0),re(r("input",{"onUpdate:modelValue":f[50]||(f[50]=S=>Xe.password=S),type:"password",class:"field",placeholder:"New password (leave blank to keep current)"},null,512),[[ve,Xe.password]]),r("label",f_,[E(sn,{modelValue:Xe.verified,"onUpdate:modelValue":f[51]||(f[51]=S=>Xe.verified=S)},null,8,["modelValue"]),f[121]||(f[121]=D(" Email verified ",-1))]),r("div",h_,[r("button",{class:"btn-accent",disabled:Fi.value,onClick:Ba},k(Fi.value?"Saving…":"Save changes"),9,p_),r("button",{class:"btn-ghost",onClick:In},"Cancel"),An.value?(m(),v("span",m_,k(An.value),1)):R("",!0),ls.value?(m(),v("span",g_,"Editing your own account — role locked.")):R("",!0)])])]),_:1},8,["title"])])):(m(),v("div",v_,[E(xe,{block:"",title:"Add user",desc:"Create a new account. Admins add users within their organization; superadmins can target any.",keywords:"add user create account role admin organization"},{default:ye(()=>[r("div",__,[r("div",y_,[re(r("input",{"onUpdate:modelValue":f[52]||(f[52]=S=>ct.email=S),type:"email",class:"field flex-1",placeholder:"name@pilotvault.local"},null,512),[[ve,ct.email]]),re(r("select",{"onUpdate:modelValue":f[53]||(f[53]=S=>ct.role=S),class:"field w-32"},[(m(!0),v(le,null,Fe(Fs.value,S=>(m(),v("option",{key:S.value,value:S.value},k(S.label),9,b_))),128))],512),[[Et,ct.role]])]),u.value?re((m(),v("select",{key:0,"onUpdate:modelValue":f[54]||(f[54]=S=>ct.organization=S),class:"field",title:"Organization"},[(m(!0),v(le,null,Fe(Eo.value,S=>(m(),v("option",{key:S.value,value:S.value},k(S.label),9,x_))),128))],512)),[[Et,ct.organization]]):(m(),v("div",w_,[f[122]||(f[122]=D(" New users join your organization: ",-1)),r("span",k_,k(t.organizationName||"—"),1)])),re(r("input",{"onUpdate:modelValue":f[55]||(f[55]=S=>ct.password=S),type:"password",class:"field",placeholder:"Temporary password (min 8 chars)"},null,512),[[ve,ct.password]]),r("div",S_,[r("button",{class:"btn-accent",disabled:Di.value,onClick:Ra},k(Di.value?"Creating…":"Create user"),9,P_),yi.value?(m(),v("span",T_,k(yi.value),1)):R("",!0)])])]),_:1})])),r("div",C_,[r("div",L_,[f[123]||(f[123]=r("div",null,[r("div",{class:"eyebrow"},"Team"),r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"All users")],-1)),r("button",{class:"btn-ghost",disabled:Gn.value,onClick:Yn},k(Gn.value?"Loading…":"Refresh"),9,M_)]),rs.value?(m(),v("div",E_,k(rs.value),1)):!as.value.length&&!Gn.value?(m(),v("div",O_,"No users yet.")):(m(),v("div",z_,[r("table",A_,[r("thead",null,[r("tr",I_,[(m(),v(le,null,Fe(["User","Role","Organization","Status",""],S=>r("th",{key:S,class:"border-y border-line bg-surface-2 px-5 py-2.5 font-mono text-[10.5px] font-normal uppercase tracking-caps text-ink-muted"},k(S),1)),64))])]),r("tbody",null,[(m(!0),v(le,null,Fe(as.value,S=>(m(),v("tr",{key:S.id,class:Le(["border-b border-line last:border-0",Xe.id===S.id?"bg-accent-soft":""])},[r("td",$_,[r("span",D_,k(S.email),1),S.email===t.email?(m(),v("span",N_,"(you)")):R("",!0)]),r("td",R_,[r("span",{class:Le(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",y(S.role||"user")])},[E(J,{name:_(S.role||"user"),size:12},null,8,["name"]),D(k(h(S.role||"user")),1)],2)]),r("td",F_,[r("span",{class:Le(["text-sm",S.organizationName?"text-ink-secondary":"text-ink-muted"])},k(S.organizationName||"—"),3)]),r("td",B_,[r("span",{class:Le(["text-xs",S.verified?"text-success-fg":"text-ink-muted"])},k(S.verified?"Verified":"Unverified"),3)]),r("td",V_,[Jt.value===S.id?(m(),v(le,{key:0},[f[124]||(f[124]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Remove?",-1)),r("button",{class:"btn-ghost mr-1",onClick:f[56]||(f[56]=Qe=>Jt.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:Qe=>Fa(S)}," Remove ",8,U_)],64)):(m(),v("div",Z_,[r("button",{class:"btn-ghost inline-flex items-center gap-1.5",onClick:Qe=>us(S)},[E(J,{name:"settings",size:14}),f[125]||(f[125]=D(" Edit ",-1))],8,H_),S.email!==t.email?(m(),v("button",{key:0,class:"btn-ghost inline-flex items-center gap-1.5",onClick:Qe=>Jt.value=S.id},[E(J,{name:"trash",size:14}),f[126]||(f[126]=D(" Remove ",-1))],8,j_)):R("",!0)]))])],2))),128))])])]))])])):G.id==="organizations"?(m(),v("div",W_,[kn.id?(m(),v("div",K_,[E(xe,{block:"",title:"Rename organization",desc:"Update the organization's display name.",keywords:"rename organization edit"},{default:ye(()=>[r("div",G_,[re(r("input",{"onUpdate:modelValue":f[57]||(f[57]=S=>kn.name=S),class:"field",placeholder:"Organization name",onKeyup:Vl(zo,["enter"])},null,544),[[ve,kn.name]]),r("div",q_,[r("button",{class:"btn-accent",onClick:zo},"Save changes"),r("button",{class:"btn-ghost",onClick:Bs},"Cancel"),Sn.value?(m(),v("span",Y_,k(Sn.value),1)):R("",!0)])])]),_:1})])):(m(),v("div",J_,[E(xe,{block:"",title:"Add organization",desc:"Create a new organization. Assign admins and users to it from User management.",keywords:"add organization create tenant company"},{default:ye(()=>[r("div",X_,[re(r("input",{"onUpdate:modelValue":f[58]||(f[58]=S=>$n.name=S),class:"field",placeholder:"e.g. Northwind Aerial",onKeyup:Vl(Oo,["enter"])},null,544),[[ve,$n.name]]),r("div",Q_,[r("button",{class:"btn-accent",disabled:Bi.value,onClick:Oo},k(Bi.value?"Creating…":"Create organization"),9,ey),Lt.value?(m(),v("span",ty,k(Lt.value),1)):R("",!0)])])]),_:1})])),r("div",ny,[r("div",{class:"flex items-center justify-between px-5 py-4"},[f[127]||(f[127]=r("div",null,[r("div",{class:"eyebrow"},"Tenancy"),r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"All organizations")],-1)),r("button",{class:"btn-ghost",onClick:qn},"Refresh")]),Ni.value.length?(m(),v("div",sy,[r("table",oy,[r("thead",null,[r("tr",ay,[(m(),v(le,null,Fe(["Organization","Members",""],S=>r("th",{key:S,class:"border-y border-line bg-surface-2 px-5 py-2.5 font-mono text-[10.5px] font-normal uppercase tracking-caps text-ink-muted"},k(S),1)),64))])]),r("tbody",null,[(m(!0),v(le,null,Fe(Ni.value,S=>(m(),v("tr",{key:S.id,class:Le(["border-b border-line last:border-0",kn.id===S.id?"bg-accent-soft":""])},[r("td",ry,[r("span",ly,[E(J,{name:"grid",size:14,class:"text-ink-muted"}),D(k(S.name),1)])]),r("td",uy,k(Vi.value[S.id]||0),1),r("td",cy,[bi.value===S.id?(m(),v(le,{key:0},[f[128]||(f[128]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),r("button",{class:"btn-ghost mr-1",onClick:f[59]||(f[59]=Qe=>bi.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:Qe=>nn(S)}," Delete ",8,dy)],64)):(m(),v("div",fy,[r("button",{class:"btn-ghost inline-flex items-center gap-1.5",onClick:Qe=>Va(S)},[E(J,{name:"settings",size:14}),f[129]||(f[129]=D(" Rename ",-1))],8,hy),r("button",{class:"btn-ghost inline-flex items-center gap-1.5",disabled:(Vi.value[S.id]||0)>0,title:(Vi.value[S.id]||0)>0?"Reassign or remove members first":"",onClick:Qe=>bi.value=S.id},[E(J,{name:"trash",size:14}),f[130]||(f[130]=D(" Delete ",-1))],8,py)]))])],2))),128))])])])):(m(),v("div",iy,"No organizations yet."))])])):G.id==="advanced"?(m(),v("div",my,[r("div",gy,[E(xe,{title:"Export data",desc:"Download your settings and profile as JSON.",keywords:"export data download backup"},{default:ye(()=>[r("button",{class:"btn-ghost",onClick:xi},[E(J,{name:"download",size:15,class:"mr-1.5 inline"}),f[131]||(f[131]=D("Export",-1))])]),_:1}),E(xe,{block:"",title:"Import data",desc:"Restore settings from a previous export.",keywords:"import data upload restore"},{default:ye(()=>[r("label",vy,[E(J,{name:"upload",size:15,class:"mr-1.5 inline"}),f[132]||(f[132]=D("Choose file… ",-1)),r("input",{type:"file",accept:"application/json,.json",class:"hidden",onChange:Pn},null,32)]),cs.value?(m(),v("p",_y,k(cs.value),1)):R("",!0)]),_:1})]),r("div",yy,[r("div",by,[E(J,{name:"alertTriangle",size:18}),f[133]||(f[133]=r("h3",{class:"text-sm font-bold uppercase tracking-caps"},"Danger zone",-1))]),f[138]||(f[138]=r("p",{class:"mt-1 text-xs text-ink-secondary"},"Deleting your account is permanent and cannot be undone.",-1)),r("div",xy,[f[137]||(f[137]=r("div",{class:"text-sm font-semibold text-ink"},"Delete account",-1)),r("label",wy,[re(r("input",{"onUpdate:modelValue":f[60]||(f[60]=S=>pt.understand=S),type:"checkbox",class:"mt-0.5 h-4 w-4 accent-[var(--danger)]"},null,512),[[aa,pt.understand]]),f[134]||(f[134]=D(" I understand this permanently deletes my account and all associated data. ",-1))]),r("div",ky,[r("label",Sy,[f[135]||(f[135]=D("Type ",-1)),r("span",Py,k(Vs.value),1),f[136]||(f[136]=D(" to confirm",-1))]),re(r("input",{"onUpdate:modelValue":f[61]||(f[61]=S=>pt.typed=S),class:"field w-full max-w-[360px] font-mono",placeholder:Vs.value},null,8,Ty),[[ve,pt.typed]])]),r("div",Cy,[pt.armed?(m(),v("button",{key:1,class:"rounded bg-danger px-4 py-2.5 text-sm font-semibold text-white transition enabled:hover:brightness-110 disabled:cursor-not-allowed disabled:opacity-50",disabled:pt.cooldown>0,onClick:ds},k(pt.cooldown>0?`Confirm in ${pt.cooldown}s…`:"Permanently delete account"),9,My)):(m(),v("button",{key:0,class:"rounded bg-danger px-4 py-2.5 text-sm font-semibold text-white transition enabled:hover:brightness-110 disabled:cursor-not-allowed disabled:opacity-40",disabled:!Jn.value,onClick:Ao}," Delete account… ",8,Ly)),pt.armed&&pt.cooldown>0?(m(),v("span",Ey,"Cooling-off period — read once more.")):R("",!0)]),pt.msg?(m(),v("p",Oy,k(pt.msg),1)):R("",!0)])])])):R("",!0)],64))),128))])]),E(eh,{name:"fade"},{default:ye(()=>[vi.value?(m(),v("div",zy,[E(J,{name:"check",size:16,class:"text-success-fg"}),D(k(vi.value),1)])):R("",!0)]),_:1})]))}},Iy=Jp(Ay,[["__scopeId","data-v-4fe25eb7"]]),$y={class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},Dy={class:"flex flex-wrap items-center gap-3"},Ny={class:"inline-flex rounded-lg border border-line bg-surface-1 p-0.5"},Ry=["onClick"],Fy={class:"ml-auto flex items-center gap-2"},By=["href"],Vy={class:"grid grid-cols-4 gap-4 max-[900px]:grid-cols-2"},Uy={class:"eyebrow"},Zy={key:0,class:"panel border-danger/40 p-4 text-sm text-danger-fg"},Hy={key:0,class:"panel p-5"},jy={class:"mb-4 flex items-center justify-between"},Wy={class:"eyebrow"},Ky={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},Gy={class:"block"},qy={class:"block"},Yy={class:"block"},Jy={class:"block"},Xy={key:0,value:""},Qy=["value"],e1={class:"block"},t1={class:"block"},n1={class:"block"},i1={class:"block"},s1={class:"block"},o1=["value"],a1={class:"block"},r1=["value"],l1={class:"block"},u1=["value"],c1={class:"block"},d1={class:"mt-3 block"},f1={key:0,class:"mt-3 grid grid-cols-2 gap-3 max-[760px]:grid-cols-1"},h1={class:"block"},p1={class:"block"},m1={class:"block"},g1={class:"block"},v1={class:"col-span-2 block max-[760px]:col-span-1"},_1={class:"mt-4 flex items-center gap-3"},y1=["disabled"],b1={key:0,class:"text-sm text-danger-fg"},x1={class:"panel overflow-hidden p-0"},w1={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},k1={key:1,class:"grid place-items-center px-5 py-16 text-center"},S1={key:2,class:"overflow-x-auto"},P1={class:"w-full border-collapse text-sm"},T1={class:"text-left"},C1={class:"whitespace-nowrap px-5 py-3 font-mono text-ink"},L1={key:0,class:"text-ink-muted"},M1={class:"px-5 py-3 text-ink-secondary"},E1=["title"],O1={class:"px-5 py-3 font-mono text-ink-secondary"},z1={class:"px-5 py-3 text-ink-secondary"},A1={class:"px-5 py-3"},I1=["onClick"],$1={class:"whitespace-nowrap px-5 py-3 text-right"},D1=["onClick"],N1=["onClick"],R1=["onClick"],F1={key:0,class:"border-b border-line bg-surface-2"},B1={colspan:"7",class:"px-5 py-3"},V1={class:"flex flex-wrap gap-x-8 gap-y-1.5 text-xs"},U1={class:"text-ink-secondary"},Z1={class:"text-ink"},H1={class:"text-ink-secondary"},j1={class:"text-ink"},W1={class:"text-ink-secondary"},K1={class:"font-mono text-ink"},G1={key:0,class:"text-ink-secondary"},q1={class:"text-ink"},Y1={key:0,class:"mt-2 space-y-1"},J1={key:1,class:"mt-2 text-xs text-success-fg"},X1={key:0,class:"panel p-5"},Q1={class:"mb-4 flex items-center justify-between"},eb={class:"eyebrow"},tb={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},nb={class:"block"},ib={class:"block"},sb={class:"block"},ob={class:"block"},ab={class:"block"},rb={class:"block"},lb=["value"],ub={class:"mt-3 flex flex-wrap gap-6"},cb={class:"flex items-center gap-2 text-sm text-ink-secondary"},db={class:"flex items-center gap-2 text-sm text-ink-secondary"},fb={class:"mt-4 flex items-center gap-3"},hb=["disabled"],pb={key:0,class:"text-sm text-danger-fg"},mb={class:"panel overflow-hidden p-0"},gb={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},vb={key:1,class:"grid place-items-center px-5 py-16 text-center"},_b={key:2,class:"overflow-x-auto"},yb={class:"w-full border-collapse text-sm"},bb={class:"text-left"},xb={class:"px-5 py-3 font-semibold text-ink"},wb={class:"px-5 py-3 text-ink-secondary"},kb={class:"px-5 py-3 font-mono text-ink-secondary"},Sb={class:"px-5 py-3"},Pb={key:1,class:"text-ink-muted"},Tb={class:"px-5 py-3"},Cb={class:"whitespace-nowrap px-5 py-3 text-right"},Lb=["onClick"],Mb=["onClick"],Eb=["onClick"],Ob={__name:"Logbook",props:{email:{type:String,default:""},role:{type:String,default:"user"},organization:{type:String,default:""},organizationName:{type:String,default:""}},setup(t){const i=t,o={success:"bg-success-soft text-success-fg",warning:"bg-amber-soft text-amber-fg",danger:"bg-danger-soft text-danger-fg",accent:"bg-accent-soft text-accent-soft-fg",neutral:"bg-surface-2 text-ink-secondary"},l=K("flights"),u=K([]),d=K([]),h=K(!1),_=K("");async function y(){h.value=!0,_.value="";const[W,C]=await Promise.all([Sc(),rp()]);(!W.ok||!C.ok)&&(_.value=W.status===503||C.status===503?"Logbook storage is not configured on the API Server (service account missing).":"Could not load the logbook."),u.value=W.drones,d.value=C.flights,h.value=!1}Li(y);function T(W){const C=W.compliance||{};return C.exempt?{tone:"neutral",label:"Exempt"}:(C.redFlags||[]).length?{tone:"danger",label:`${C.redFlags.length} issue${C.redFlags.length>1?"s":""}`}:{tone:"success",label:"Compliant"}}const w=K("");function z(W){w.value=w.value===W?"":W}const U=[{value:"open",label:"Open"},{value:"specific",label:"Specific"},{value:"certified",label:"Certified"}],V=[{value:"commercial",label:"Commercial"},{value:"research",label:"Research"},{value:"public",label:"Public-benefit"},{value:"hobby",label:"Private hobby"},{value:"club_area",label:"Model-club area"}],ue=[{value:"",label:"Auto (from drone)"},{value:"manual",label:"Manual"},{value:"automatic",label:"Automatic (FDR)"}];function X(){var W;return{operationDate:new Date().toISOString().slice(0,10),startTime:"",endTime:"",drone:((W=u.value[0])==null?void 0:W.id)||"",areaRoute:"",maxAltitudeAgl:"",pilotName:i.email,certificateRef:"",category:"open",purpose:"commercial",loggingPath:"",rawFdrLogUrl:"",authorisationRef:"",weather:"",airspaceRef:"",observer:"",incidents:"",notes:""}}const Ae=K(!1),$e=K(""),Q=bt(X()),me=K(""),oe=K(!1),de=K(!1);function Ne(){Object.assign(Q,X()),$e.value="",me.value="",de.value=!1,Ae.value=!0}function nt(W){Object.assign(Q,{operationDate:(W.operationDate||"").slice(0,10),startTime:W.startTime||"",endTime:W.endTime||"",drone:W.drone||"",areaRoute:W.areaRoute||"",maxAltitudeAgl:W.maxAltitudeAgl||"",pilotName:W.pilotName||"",certificateRef:W.certificateRef||"",category:W.category||"open",purpose:W.purpose||"commercial",loggingPath:W.loggingPath||"",rawFdrLogUrl:W.rawFdrLogUrl||"",authorisationRef:W.authorisationRef||"",weather:W.weather||"",airspaceRef:W.airspaceRef||"",observer:W.observer||"",incidents:W.incidents||"",notes:W.notes||""}),$e.value=W.id,me.value="",de.value=!!(W.weather||W.airspaceRef||W.observer||W.incidents||W.notes),Ae.value=!0}function ke(){Ae.value=!1,$e.value=""}async function Te(){var O;if(me.value="",!Q.drone){me.value="Select a drone first (add one on the Drones tab).";return}oe.value=!0;const W={...Q,maxAltitudeAgl:Number(Q.maxAltitudeAgl)||0},C=$e.value?await up($e.value,W):await lp(W);if(oe.value=!1,!C.ok){me.value=((O=C.body)==null?void 0:O.error)||"Could not save the flight.";return}Ae.value=!1,await y()}const Be=K("");async function Ce(W){const C=await cp(W.id);Be.value="",C.ok&&await y()}const ee=["","C0","C1","C2","C3","C4","C5","C6"];function pe(){return{name:"",model:"",serial:"",operatorNumber:"",mtomGrams:"",isToy:!1,autologsFlights:!1,cClass:""}}const Re=K(!1),Ze=K(""),he=bt(pe()),De=K(""),ne=K(!1);function rt(){Object.assign(he,pe()),Ze.value="",De.value="",Re.value=!0}function ge(W){Object.assign(he,{name:W.name||"",model:W.model||"",serial:W.serial||"",operatorNumber:W.operatorNumber||"",mtomGrams:W.mtomGrams||"",isToy:!!W.isToy,autologsFlights:!!W.autologsFlights,cClass:W.cClass||""}),Ze.value=W.id,De.value="",Re.value=!0}function Me(){Re.value=!1,Ze.value=""}async function je(){var O;if(De.value="",!he.name.trim()){De.value="Give the drone a name.";return}ne.value=!0;const W={...he,mtomGrams:Number(he.mtomGrams)||0},C=Ze.value?await op(Ze.value,W):await sp(W);if(ne.value=!1,!C.ok){De.value=((O=C.body)==null?void 0:O.error)||"Could not save the drone.";return}Re.value=!1,await y()}const te=K("");async function $(W){var O;const C=await ap(W.id);te.value="",C.ok?await y():De.value=((O=C.body)==null?void 0:O.error)||"Could not delete the drone."}const I=we(()=>{const W=d.value.length,C=d.value.filter(ht=>{var lt;return(((lt=ht.compliance)==null?void 0:lt.redFlags)||[]).length}).length,O=d.value.filter(ht=>{var lt;return(lt=ht.compliance)==null?void 0:lt.required}).length;return{total:W,flagged:C,required:O,fleet:u.value.length}});return(W,C)=>(m(),v("div",$y,[r("div",Dy,[r("div",Ny,[(m(),v(le,null,Fe([["flights","Flights"],["drones","Drones"]],O=>r("button",{key:O[0],class:Le(["rounded-md px-3.5 py-1.5 text-sm font-semibold transition",l.value===O[0]?"bg-accent-soft text-accent-soft-fg":"text-ink-secondary hover:text-ink"]),onClick:ht=>l.value=O[0]},k(O[1]),11,Ry)),64))]),r("div",Fy,[r("a",{href:Ue(dp)(),class:"btn-ghost inline-flex items-center gap-2",title:"Download a compliance CSV (Trafikstyrelsen / police disclosure)"},[E(J,{name:"download",size:15}),C[29]||(C[29]=D(" Export CSV ",-1))],8,By),l.value==="flights"?(m(),v("button",{key:0,class:"btn-accent inline-flex items-center gap-2",onClick:Ne},[E(J,{name:"plus",size:15}),C[30]||(C[30]=D(" Log flight ",-1))])):(m(),v("button",{key:1,class:"btn-accent inline-flex items-center gap-2",onClick:rt},[E(J,{name:"plus",size:15}),C[31]||(C[31]=D(" Add drone ",-1))]))])]),r("div",Vy,[(m(!0),v(le,null,Fe([{label:"Flights logged",value:I.value.total,tone:"neutral"},{label:"Require logbook",value:I.value.required,tone:"neutral"},{label:"Compliance flags",value:I.value.flagged,tone:I.value.flagged?"danger":"success"},{label:"Registered drones",value:I.value.fleet,tone:"neutral"}],O=>(m(),v("div",{key:O.label,class:"panel p-5"},[r("div",Uy,k(O.label),1),r("div",{class:Le(["mt-2 text-[30px] font-bold leading-none tracking-tightest",O.tone==="danger"?"text-danger-fg":O.tone==="success"?"text-success-fg":"text-ink"])},k(O.value),3)]))),128))]),_.value?(m(),v("div",Zy,k(_.value),1)):R("",!0),l.value==="flights"?(m(),v(le,{key:1},[Ae.value?(m(),v("div",Hy,[r("div",jy,[r("div",null,[r("div",Wy,k($e.value?"Edit entry":"New entry"),1),C[32]||(C[32]=r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Logbook flight (BEK 1649 §5)",-1))]),r("button",{class:"btn-icon",onClick:ke},[E(J,{name:"x",size:16})])]),r("div",Ky,[r("label",Gy,[C[33]||(C[33]=r("span",{class:"eyebrow mb-1 block"},"Date",-1)),re(r("input",{"onUpdate:modelValue":C[0]||(C[0]=O=>Q.operationDate=O),type:"date",class:"field"},null,512),[[ve,Q.operationDate]])]),r("label",qy,[C[34]||(C[34]=r("span",{class:"eyebrow mb-1 block"},"Start",-1)),re(r("input",{"onUpdate:modelValue":C[1]||(C[1]=O=>Q.startTime=O),type:"time",class:"field"},null,512),[[ve,Q.startTime]])]),r("label",Yy,[C[35]||(C[35]=r("span",{class:"eyebrow mb-1 block"},"End",-1)),re(r("input",{"onUpdate:modelValue":C[2]||(C[2]=O=>Q.endTime=O),type:"time",class:"field"},null,512),[[ve,Q.endTime]])]),r("label",Jy,[C[36]||(C[36]=r("span",{class:"eyebrow mb-1 block"},"Drone",-1)),re(r("select",{"onUpdate:modelValue":C[3]||(C[3]=O=>Q.drone=O),class:"field"},[u.value.length?R("",!0):(m(),v("option",Xy,"— add a drone first —")),(m(!0),v(le,null,Fe(u.value,O=>(m(),v("option",{key:O.id,value:O.id},k(O.name)+k(O.model?` · ${O.model}`:""),9,Qy))),128))],512),[[Et,Q.drone]])]),r("label",e1,[C[37]||(C[37]=r("span",{class:"eyebrow mb-1 block"},"Max altitude (m AGL)",-1)),re(r("input",{"onUpdate:modelValue":C[4]||(C[4]=O=>Q.maxAltitudeAgl=O),type:"number",min:"0",class:"field",placeholder:"120"},null,512),[[ve,Q.maxAltitudeAgl]])]),r("label",t1,[C[38]||(C[38]=r("span",{class:"eyebrow mb-1 block"},"Area / route",-1)),re(r("input",{"onUpdate:modelValue":C[5]||(C[5]=O=>Q.areaRoute=O),class:"field",placeholder:"Field N of Roskilde, grid survey"},null,512),[[ve,Q.areaRoute]])]),r("label",n1,[C[39]||(C[39]=r("span",{class:"eyebrow mb-1 block"},"Remote pilot name",-1)),re(r("input",{"onUpdate:modelValue":C[6]||(C[6]=O=>Q.pilotName=O),class:"field",placeholder:"Full name"},null,512),[[ve,Q.pilotName]])]),r("label",i1,[C[40]||(C[40]=r("span",{class:"eyebrow mb-1 block"},"Certificate ref",-1)),re(r("input",{"onUpdate:modelValue":C[7]||(C[7]=O=>Q.certificateRef=O),class:"field",placeholder:"A2 / STS cert no."},null,512),[[ve,Q.certificateRef]])]),r("label",s1,[C[41]||(C[41]=r("span",{class:"eyebrow mb-1 block"},"Logging path",-1)),re(r("select",{"onUpdate:modelValue":C[8]||(C[8]=O=>Q.loggingPath=O),class:"field"},[(m(),v(le,null,Fe(ue,O=>r("option",{key:O.value,value:O.value},k(O.label),9,o1)),64))],512),[[Et,Q.loggingPath]])]),r("label",a1,[C[42]||(C[42]=r("span",{class:"eyebrow mb-1 block"},"Category",-1)),re(r("select",{"onUpdate:modelValue":C[9]||(C[9]=O=>Q.category=O),class:"field"},[(m(),v(le,null,Fe(U,O=>r("option",{key:O.value,value:O.value},k(O.label),9,r1)),64))],512),[[Et,Q.category]])]),r("label",l1,[C[43]||(C[43]=r("span",{class:"eyebrow mb-1 block"},"Purpose",-1)),re(r("select",{"onUpdate:modelValue":C[10]||(C[10]=O=>Q.purpose=O),class:"field"},[(m(),v(le,null,Fe(V,O=>r("option",{key:O.value,value:O.value},k(O.label),9,u1)),64))],512),[[Et,Q.purpose]])]),r("label",c1,[C[44]||(C[44]=r("span",{class:"eyebrow mb-1 block"},"Authorisation ref",-1)),re(r("input",{"onUpdate:modelValue":C[11]||(C[11]=O=>Q.authorisationRef=O),class:"field",placeholder:"Specific-category ref"},null,512),[[ve,Q.authorisationRef]])])]),r("label",d1,[C[45]||(C[45]=r("span",{class:"eyebrow mb-1 block"},"FDR log URL (automatic path)",-1)),re(r("input",{"onUpdate:modelValue":C[12]||(C[12]=O=>Q.rawFdrLogUrl=O),class:"field",placeholder:"Link to the stored flight-data-recorder export"},null,512),[[ve,Q.rawFdrLogUrl]])]),r("button",{class:"mt-4 flex items-center gap-1.5 text-sm font-semibold text-accent",onClick:C[13]||(C[13]=O=>de.value=!de.value)},[E(J,{name:de.value?"x":"plus",size:14},null,8,["name"]),C[46]||(C[46]=D(" Operational details (weather, airspace, incidents) ",-1))]),de.value?(m(),v("div",f1,[r("label",h1,[C[47]||(C[47]=r("span",{class:"eyebrow mb-1 block"},"Weather / wind",-1)),re(r("input",{"onUpdate:modelValue":C[14]||(C[14]=O=>Q.weather=O),class:"field",placeholder:"6 m/s NW, CAVOK"},null,512),[[ve,Q.weather]])]),r("label",p1,[C[48]||(C[48]=r("span",{class:"eyebrow mb-1 block"},"Airspace / NOTAM ref",-1)),re(r("input",{"onUpdate:modelValue":C[15]||(C[15]=O=>Q.airspaceRef=O),class:"field"},null,512),[[ve,Q.airspaceRef]])]),r("label",m1,[C[49]||(C[49]=r("span",{class:"eyebrow mb-1 block"},"Observer",-1)),re(r("input",{"onUpdate:modelValue":C[16]||(C[16]=O=>Q.observer=O),class:"field"},null,512),[[ve,Q.observer]])]),r("label",g1,[C[50]||(C[50]=r("span",{class:"eyebrow mb-1 block"},"Incidents / anomalies",-1)),re(r("input",{"onUpdate:modelValue":C[17]||(C[17]=O=>Q.incidents=O),class:"field",placeholder:"RTH trigger, GPS dropout…"},null,512),[[ve,Q.incidents]])]),r("label",v1,[C[51]||(C[51]=r("span",{class:"eyebrow mb-1 block"},"Notes",-1)),re(r("textarea",{"onUpdate:modelValue":C[18]||(C[18]=O=>Q.notes=O),rows:"2",class:"field"},null,512),[[ve,Q.notes]])])])):R("",!0),r("div",_1,[r("button",{class:"btn-accent",disabled:oe.value,onClick:Te},k(oe.value?"Saving…":$e.value?"Save changes":"Log flight"),9,y1),r("button",{class:"btn-ghost",onClick:ke},"Cancel"),me.value?(m(),v("span",b1,k(me.value),1)):R("",!0)])])):R("",!0),r("div",x1,[h.value?(m(),v("div",w1,"Loading…")):d.value.length?(m(),v("div",S1,[r("table",P1,[r("thead",null,[r("tr",T1,[(m(),v(le,null,Fe(["Date","Drone","Area / route","Alt","Pilot","Compliance",""],O=>r("th",{key:O,class:"border-y border-line bg-surface-2 px-5 py-2.5 font-mono text-[10.5px] font-normal uppercase tracking-caps text-ink-muted"},k(O),1)),64))])]),r("tbody",null,[(m(!0),v(le,null,Fe(d.value,O=>{var ht,lt,qt,b;return m(),v(le,{key:O.id},[r("tr",{class:Le(["border-b border-line last:border-0",$e.value===O.id?"bg-accent-soft":""])},[r("td",C1,[D(k((O.operationDate||"").slice(0,10))+" ",1),O.startTime?(m(),v("span",L1,k(O.startTime),1)):R("",!0)]),r("td",M1,k(O.droneName||"—"),1),r("td",{class:"max-w-[220px] truncate px-5 py-3 text-ink-secondary",title:O.areaRoute},k(O.areaRoute||"—"),9,E1),r("td",O1,k(O.maxAltitudeAgl?O.maxAltitudeAgl+" m":"—"),1),r("td",z1,k(O.pilotName||"—"),1),r("td",A1,[r("button",{class:Le(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",o[T(O).tone]]),onClick:g=>z(O.id)},[T(O).tone==="danger"?(m(),et(J,{key:0,name:"alertTriangle",size:12})):T(O).tone==="success"?(m(),et(J,{key:1,name:"check",size:12})):R("",!0),D(" "+k(T(O).label),1)],10,I1)]),r("td",$1,[Be.value===O.id?(m(),v(le,{key:0},[C[54]||(C[54]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),r("button",{class:"btn-ghost mr-1",onClick:C[19]||(C[19]=g=>Be.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:g=>Ce(O)},"Delete",8,D1)],64)):(m(),v(le,{key:1},[r("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:g=>nt(O)},[E(J,{name:"sliders",size:13}),C[55]||(C[55]=D(" Edit",-1))],8,N1),r("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:g=>Be.value=O.id},[E(J,{name:"trash",size:13})],8,R1)],64))])],2),w.value===O.id?(m(),v("tr",F1,[r("td",B1,[r("div",V1,[r("span",U1,[C[56]||(C[56]=D("Logging path: ",-1)),r("b",Z1,k(((ht=O.compliance)==null?void 0:ht.loggingPath)||"—"),1)]),r("span",H1,[C[57]||(C[57]=D("Category: ",-1)),r("b",j1,k(O.category||"—"),1)]),r("span",W1,[C[58]||(C[58]=D("Retain until: ",-1)),r("b",K1,k((O.retentionUntil||"").slice(0,10)||"—"),1)]),(lt=O.compliance)!=null&<.exempt?(m(),v("span",G1,[C[59]||(C[59]=D("Exempt: ",-1)),r("b",q1,k(O.compliance.exemptReason),1)])):R("",!0)]),(((qt=O.compliance)==null?void 0:qt.redFlags)||[]).length?(m(),v("ul",Y1,[(m(!0),v(le,null,Fe(O.compliance.redFlags,(g,M)=>(m(),v("li",{key:M,class:"flex items-start gap-2 text-xs text-danger-fg"},[E(J,{name:"alertTriangle",size:13,class:"mt-px shrink-0"}),D(" "+k(g),1)]))),128))])):(b=O.compliance)!=null&&b.exempt?R("",!0):(m(),v("div",J1,"No compliance gaps detected."))])])):R("",!0)],64)}),128))])])])):(m(),v("div",k1,[E(J,{name:"book",size:26,class:"text-ink-muted"}),C[52]||(C[52]=r("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No flights logged yet",-1)),C[53]||(C[53]=r("div",{class:"mt-1 text-xs text-ink-muted"},"Log your first operation to start the 5-year retention record.",-1))]))])],64)):(m(),v(le,{key:2},[Re.value?(m(),v("div",X1,[r("div",Q1,[r("div",null,[r("div",eb,k(Ze.value?"Edit drone":"New drone"),1),C[60]||(C[60]=r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Aircraft registry",-1))]),r("button",{class:"btn-icon",onClick:Me},[E(J,{name:"x",size:16})])]),r("div",tb,[r("label",nb,[C[61]||(C[61]=r("span",{class:"eyebrow mb-1 block"},"Name",-1)),re(r("input",{"onUpdate:modelValue":C[20]||(C[20]=O=>he.name=O),class:"field",placeholder:"Mavic-01"},null,512),[[ve,he.name]])]),r("label",ib,[C[62]||(C[62]=r("span",{class:"eyebrow mb-1 block"},"Model",-1)),re(r("input",{"onUpdate:modelValue":C[21]||(C[21]=O=>he.model=O),class:"field",placeholder:"DJI Mavic 3 Enterprise"},null,512),[[ve,he.model]])]),r("label",sb,[C[63]||(C[63]=r("span",{class:"eyebrow mb-1 block"},"Serial",-1)),re(r("input",{"onUpdate:modelValue":C[22]||(C[22]=O=>he.serial=O),class:"field"},null,512),[[ve,he.serial]])]),r("label",ob,[C[64]||(C[64]=r("span",{class:"eyebrow mb-1 block"},"Operator no.",-1)),re(r("input",{"onUpdate:modelValue":C[23]||(C[23]=O=>he.operatorNumber=O),class:"field",placeholder:"DNK…"},null,512),[[ve,he.operatorNumber]])]),r("label",ab,[C[65]||(C[65]=r("span",{class:"eyebrow mb-1 block"},"MTOM (grams)",-1)),re(r("input",{"onUpdate:modelValue":C[24]||(C[24]=O=>he.mtomGrams=O),type:"number",min:"0",class:"field",placeholder:"920"},null,512),[[ve,he.mtomGrams]])]),r("label",rb,[C[66]||(C[66]=r("span",{class:"eyebrow mb-1 block"},"C-class",-1)),re(r("select",{"onUpdate:modelValue":C[25]||(C[25]=O=>he.cClass=O),class:"field"},[(m(),v(le,null,Fe(ee,O=>r("option",{key:O,value:O},k(O||"— none —"),9,lb)),64))],512),[[Et,he.cClass]])])]),r("div",ub,[r("label",cb,[re(r("input",{"onUpdate:modelValue":C[26]||(C[26]=O=>he.autologsFlights=O),type:"checkbox",class:"h-4 w-4 accent-[var(--accent)]"},null,512),[[aa,he.autologsFlights]]),C[67]||(C[67]=D(" Auto-logs flights (onboard FDR) ",-1))]),r("label",db,[re(r("input",{"onUpdate:modelValue":C[27]||(C[27]=O=>he.isToy=O),type:"checkbox",class:"h-4 w-4 accent-[var(--accent)]"},null,512),[[aa,he.isToy]]),C[68]||(C[68]=D(" Toy drone (logbook-exempt) ",-1))])]),r("div",fb,[r("button",{class:"btn-accent",disabled:ne.value,onClick:je},k(ne.value?"Saving…":Ze.value?"Save changes":"Add drone"),9,hb),r("button",{class:"btn-ghost",onClick:Me},"Cancel"),De.value?(m(),v("span",pb,k(De.value),1)):R("",!0)])])):R("",!0),r("div",mb,[h.value?(m(),v("div",gb,"Loading…")):u.value.length?(m(),v("div",_b,[r("table",yb,[r("thead",null,[r("tr",bb,[(m(),v(le,null,Fe(["Name","Model","MTOM","Class","FDR",""],O=>r("th",{key:O,class:"border-y border-line bg-surface-2 px-5 py-2.5 font-mono text-[10.5px] font-normal uppercase tracking-caps text-ink-muted"},k(O),1)),64))])]),r("tbody",null,[(m(!0),v(le,null,Fe(u.value,O=>(m(),v("tr",{key:O.id,class:Le(["border-b border-line last:border-0",Ze.value===O.id?"bg-accent-soft":""])},[r("td",xb,k(O.name),1),r("td",wb,k(O.model||"—"),1),r("td",kb,k(O.mtomGrams?O.mtomGrams+" g":"—"),1),r("td",Sb,[O.cClass?(m(),v("span",{key:0,class:Le(["inline-flex rounded-full px-2 py-0.5 text-[11px] font-semibold",o.accent])},k(O.cClass),3)):(m(),v("span",Pb,"—")),O.isToy?(m(),v("span",{key:2,class:Le(["ml-1 inline-flex rounded-full px-2 py-0.5 text-[11px] font-semibold",o.neutral])},"toy",2)):R("",!0)]),r("td",Tb,[r("span",{class:Le(["text-xs",O.autologsFlights?"text-success-fg":"text-ink-muted"])},k(O.autologsFlights?"yes":"no"),3)]),r("td",Cb,[te.value===O.id?(m(),v(le,{key:0},[C[71]||(C[71]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),r("button",{class:"btn-ghost mr-1",onClick:C[28]||(C[28]=ht=>te.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:ht=>$(O)},"Delete",8,Lb)],64)):(m(),v(le,{key:1},[r("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:ht=>ge(O)},[E(J,{name:"sliders",size:13}),C[72]||(C[72]=D(" Edit",-1))],8,Mb),r("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:ht=>te.value=O.id},[E(J,{name:"trash",size:13})],8,Eb)],64))])],2))),128))])])])):(m(),v("div",vb,[E(J,{name:"drone",size:26,class:"text-ink-muted"}),C[69]||(C[69]=r("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No drones registered",-1)),C[70]||(C[70]=r("div",{class:"mt-1 text-xs text-ink-muted"},"Register the airframes you fly to log flights against them.",-1))]))])],64))]))}},zb={class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},Ab={class:"flex flex-wrap items-center gap-3"},Ib={class:"inline-flex flex-wrap rounded-lg border border-line bg-surface-1 p-0.5"},$b=["onClick"],Db={class:"ml-auto"},Nb={class:"grid grid-cols-4 gap-4 max-[900px]:grid-cols-2"},Rb={class:"eyebrow"},Fb={key:0,class:"panel border-danger/40 p-4 text-sm text-danger-fg"},Bb={key:1,class:"panel p-5"},Vb={class:"mb-4 flex items-center justify-between"},Ub={class:"eyebrow"},Zb={class:"mt-0.5 text-base font-semibold text-ink"},Hb={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},jb={class:"col-span-2 block max-[760px]:col-span-1"},Wb={class:"block"},Kb=["value"],Gb={class:"block"},qb=["value"],Yb={class:"block"},Jb=["value"],Xb={class:"block"},Qb={class:"block"},ex={class:"block"},tx={class:"block"},nx=["value"],ix={class:"block"},sx={class:"block"},ox={class:"block"},ax=["value"],rx={class:"mt-3 block"},lx={key:0,class:"mt-3"},ux={class:"eyebrow mb-1 block"},cx={key:1,class:"mt-3 text-xs text-ink-muted"},dx={class:"mt-4 flex items-center gap-3"},fx=["disabled"],hx={key:0,class:"text-sm text-danger-fg"},px={class:"panel overflow-hidden p-0"},mx={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},gx={key:1,class:"grid place-items-center px-5 py-16 text-center"},vx={class:"mt-3 text-sm font-medium text-ink-secondary"},_x={class:"mt-1 text-xs text-ink-muted"},yx={key:2,class:"overflow-x-auto"},bx={class:"w-full border-collapse text-sm"},xx={class:"text-left"},wx={class:"px-5 py-3"},kx={class:"font-semibold text-ink"},Sx={key:0,class:"font-mono text-[11px] text-ink-muted"},Px={class:"px-5 py-3 text-ink-secondary"},Tx={class:"px-5 py-3 text-ink-secondary"},Cx={class:"px-5 py-3"},Lx=["onClick"],Mx={key:0,class:"mt-0.5 font-mono text-[10.5px] text-ink-muted"},Ex={class:"px-5 py-3 font-mono text-ink-secondary"},Ox={class:"whitespace-nowrap px-5 py-3 text-right"},zx=["onClick"],Ax=["href"],Ix=["onClick"],$x=["onClick"],Dx=["onClick"],Nx={key:0,class:"border-b border-line bg-surface-2"},Rx={colspan:"6",class:"px-5 py-3"},Fx={class:"flex flex-wrap gap-x-8 gap-y-1.5 text-xs"},Bx={class:"text-ink-secondary"},Vx={class:"text-ink"},Ux={class:"text-ink-secondary"},Zx={class:"text-ink"},Hx={key:0,class:"text-ink-secondary"},jx={class:"text-ink"},Wx={key:1,class:"text-ink-secondary"},Kx={class:"font-mono text-ink"},Gx={key:2,class:"text-ink-secondary"},qx={class:"font-mono text-ink"},Yx={class:"text-ink-secondary"},Jx={class:"text-ink"},Xx={key:0,class:"mt-2 space-y-1"},Qx={key:1,class:"mt-2 text-xs text-success-fg"},e0={key:2,class:"mt-2 text-xs text-ink-secondary"},t0={__name:"Documents",props:{email:{type:String,default:""},role:{type:String,default:"user"},organization:{type:String,default:""},organizationName:{type:String,default:""}},setup(t){const i={success:"bg-success-soft text-success-fg",warning:"bg-amber-soft text-amber-fg",danger:"bg-danger-soft text-danger-fg",accent:"bg-accent-soft text-accent-soft-fg",neutral:"bg-surface-2 text-ink-secondary"},o=[{value:"certificate",label:"Pilot certificate"},{value:"medical",label:"Medical / training"},{value:"insurance",label:"Insurance / liability"},{value:"background_check",label:"Background check / waiver"},{value:"registration",label:"Aircraft registration"},{value:"maintenance",label:"Maintenance log"},{value:"conformity",label:"Conformity / compliance"},{value:"firmware",label:"Firmware / software"},{value:"incident",label:"Incident / repair report"},{value:"flight_log",label:"Flight log"},{value:"checklist",label:"Pre-flight checklist"},{value:"airspace_auth",label:"Airspace authorisation"},{value:"mission_plan",label:"Mission plan / flight path"},{value:"risk_assessment",label:"Risk assessment / survey"},{value:"contract",label:"Contract / SOW"},{value:"client_insurance",label:"Client insurance cert"},{value:"delivery_report",label:"Delivery / media handoff"},{value:"other",label:"Other"}],l=Object.fromEntries(o.map(te=>[te.value,te.label])),u=[{value:"pilot",label:"Pilot"},{value:"aircraft",label:"Aircraft"},{value:"organization",label:"Organization"},{value:"client",label:"Client"},{value:"other",label:"Other"}],d=[{value:"active",label:"Active"},{value:"pending_review",label:"Pending review"},{value:"archived",label:"Archived"}],h=[{value:"pilot",label:"Pilot"},{value:"ops",label:"Ops manager"},{value:"admin",label:"Admin"},{value:"client",label:"Client-facing"}],_=K([]),y=K([]),T=K(!1),w=K("");async function z(){T.value=!0,w.value="";const[te,$]=await Promise.all([fp(),Sc()]);te.ok||(w.value=te.status===503?"Document storage is not configured on the API Server (service account missing).":"Could not load documents."),_.value=te.documents,y.value=$.drones||[],T.value=!1}Li(z);const U=K("all"),V=[["all","All"],["expiring","Expiring soon"],["expired","Expired"],["pending","Pending review"],["archived","Archived"]],ue=we(()=>{const te=_.value;switch(U.value){case"expiring":return te.filter($=>{var I;return((I=$.expiry)==null?void 0:I.state)==="expiring_soon"&&$.status!=="archived"});case"expired":return te.filter($=>{var I;return((I=$.expiry)==null?void 0:I.state)==="expired"&&$.status!=="archived"});case"pending":return te.filter($=>$.status==="pending_review");case"archived":return te.filter($=>$.status==="archived");default:return te.filter($=>$.status!=="archived")}});function X(te){if(te.status==="archived")return{tone:"neutral",label:"Superseded",icon:""};const $=te.expiry||{};return $.state==="expired"?{tone:"danger",label:"Expired",icon:"alertTriangle"}:$.state==="expiring_soon"?{tone:"warning",label:`Expires in ${$.daysUntilExpiry}d`,icon:"clock"}:$.state==="valid"?{tone:"success",label:"Valid",icon:"check"}:{tone:"neutral",label:"No expiry",icon:""}}const Ae=K("");function $e(te){Ae.value=Ae.value===te?"":te}function Q(te){return te.ownerDrone?te.ownerDroneName||"Aircraft":te.ownerRef?te.ownerRef:te.ownerType==="pilot"?"Pilot":te.ownerType?te.ownerType.charAt(0).toUpperCase()+te.ownerType.slice(1):"—"}function me(){return{title:"",docType:"certificate",ownerType:"pilot",ownerDrone:"",ownerRef:"",reference:"",jurisdiction:"",issueDate:"",expiryDate:"",status:"active",accessTier:"ops",notes:""}}const oe=K(!1),de=K(""),Ne=K(""),nt=K(""),ke=bt(me()),Te=K(null),Be=K(null),Ce=K(""),ee=K(!1);function pe(){Te.value=null,Be.value&&(Be.value.value="")}function Re(){Object.assign(ke,me()),de.value="",Ne.value="",nt.value="",pe(),Ce.value="",oe.value=!0}function Ze(te){Object.assign(ke,{title:te.title||"",docType:te.docType||"certificate",ownerType:te.ownerType||"pilot",ownerDrone:te.ownerDrone||"",ownerRef:te.ownerRef||"",reference:te.reference||"",jurisdiction:te.jurisdiction||"",issueDate:te.issueDate||"",expiryDate:te.expiryDate||"",status:te.status||"active",accessTier:te.accessTier||"ops",notes:te.notes||""}),de.value=te.id,Ne.value="",nt.value="",pe(),Ce.value="",oe.value=!0}function he(te){Ze(te),de.value="",Ne.value=te.id,nt.value=te.title,ke.status="active"}function De(){oe.value=!1,de.value="",Ne.value=""}function ne(te){var $;Te.value=(($=te.target.files)==null?void 0:$[0])||null}async function rt(){var $;if(Ce.value="",!ke.title.trim()){Ce.value="Give the document a title.";return}ee.value=!0;let te;if(de.value)te=await pp(de.value,{...ke});else{const I={...ke};Ne.value&&(I.replaces=Ne.value),te=await hp(I,Te.value)}if(ee.value=!1,!te.ok){Ce.value=(($=te.body)==null?void 0:$.error)||"Could not save the document.";return}oe.value=!1,de.value="",Ne.value="",await z()}const ge=K("");async function Me(te){var I;const $=await mp(te.id);ge.value="",$.ok?await z():Ce.value=((I=$.body)==null?void 0:I.error)||"Could not delete the document."}const je=we(()=>{const te=_.value.filter($=>$.status!=="archived");return{total:te.length,expiring:te.filter($=>{var I;return((I=$.expiry)==null?void 0:I.state)==="expiring_soon"}).length,expired:te.filter($=>{var I;return((I=$.expiry)==null?void 0:I.state)==="expired"}).length,pending:_.value.filter($=>$.status==="pending_review").length}});return(te,$)=>(m(),v("div",zb,[r("div",Ab,[r("div",Ib,[(m(),v(le,null,Fe(V,I=>r("button",{key:I[0],class:Le(["rounded-md px-3.5 py-1.5 text-sm font-semibold transition",U.value===I[0]?"bg-accent-soft text-accent-soft-fg":"text-ink-secondary hover:text-ink"]),onClick:W=>U.value=I[0]},k(I[1]),11,$b)),64))]),r("div",Db,[r("button",{class:"btn-accent inline-flex items-center gap-2",onClick:Re},[E(J,{name:"upload",size:15}),$[13]||($[13]=D(" Add document ",-1))])])]),r("div",Nb,[(m(!0),v(le,null,Fe([{label:"Documents on file",value:je.value.total,tone:"neutral"},{label:"Expiring soon",value:je.value.expiring,tone:je.value.expiring?"warning":"neutral"},{label:"Expired",value:je.value.expired,tone:je.value.expired?"danger":"success"},{label:"Pending review",value:je.value.pending,tone:je.value.pending?"accent":"neutral"}],I=>(m(),v("div",{key:I.label,class:"panel p-5"},[r("div",Rb,k(I.label),1),r("div",{class:Le(["mt-2 text-[30px] font-bold leading-none tracking-tightest",I.tone==="danger"?"text-danger-fg":I.tone==="warning"?"text-amber-fg":I.tone==="success"?"text-success-fg":I.tone==="accent"?"text-accent-soft-fg":"text-ink"])},k(I.value),3)]))),128))]),w.value?(m(),v("div",Fb,k(w.value),1)):R("",!0),oe.value?(m(),v("div",Bb,[r("div",Vb,[r("div",null,[r("div",Ub,k(de.value?"Edit document":Ne.value?"New version":"New document"),1),r("div",Zb,k(Ne.value?`Supersedes “${nt.value}”`:"Compliance & operational document"),1)]),r("button",{class:"btn-icon",onClick:De},[E(J,{name:"x",size:16})])]),r("div",Hb,[r("label",jb,[$[14]||($[14]=r("span",{class:"eyebrow mb-1 block"},"Title",-1)),re(r("input",{"onUpdate:modelValue":$[0]||($[0]=I=>ke.title=I),class:"field",placeholder:"A2 Remote Pilot Certificate — J. Dariusz"},null,512),[[ve,ke.title]])]),r("label",Wb,[$[15]||($[15]=r("span",{class:"eyebrow mb-1 block"},"Type",-1)),re(r("select",{"onUpdate:modelValue":$[1]||($[1]=I=>ke.docType=I),class:"field"},[(m(),v(le,null,Fe(o,I=>r("option",{key:I.value,value:I.value},k(I.label),9,Kb)),64))],512),[[Et,ke.docType]])]),r("label",Gb,[$[16]||($[16]=r("span",{class:"eyebrow mb-1 block"},"Owner type",-1)),re(r("select",{"onUpdate:modelValue":$[2]||($[2]=I=>ke.ownerType=I),class:"field"},[(m(),v(le,null,Fe(u,I=>r("option",{key:I.value,value:I.value},k(I.label),9,qb)),64))],512),[[Et,ke.ownerType]])]),r("label",Yb,[$[18]||($[18]=r("span",{class:"eyebrow mb-1 block"},"Aircraft (if any)",-1)),re(r("select",{"onUpdate:modelValue":$[3]||($[3]=I=>ke.ownerDrone=I),class:"field"},[$[17]||($[17]=r("option",{value:""},"— none —",-1)),(m(!0),v(le,null,Fe(y.value,I=>(m(),v("option",{key:I.id,value:I.id},k(I.name)+k(I.model?` · ${I.model}`:""),9,Jb))),128))],512),[[Et,ke.ownerDrone]])]),r("label",Xb,[$[19]||($[19]=r("span",{class:"eyebrow mb-1 block"},"Owner reference",-1)),re(r("input",{"onUpdate:modelValue":$[4]||($[4]=I=>ke.ownerRef=I),class:"field",placeholder:"Client name / serial / site"},null,512),[[ve,ke.ownerRef]])]),r("label",Qb,[$[20]||($[20]=r("span",{class:"eyebrow mb-1 block"},"Reference / number",-1)),re(r("input",{"onUpdate:modelValue":$[5]||($[5]=I=>ke.reference=I),class:"field",placeholder:"Cert / registration / policy no."},null,512),[[ve,ke.reference]])]),r("label",ex,[$[21]||($[21]=r("span",{class:"eyebrow mb-1 block"},"Jurisdiction",-1)),re(r("input",{"onUpdate:modelValue":$[6]||($[6]=I=>ke.jurisdiction=I),class:"field",placeholder:"DK / EASA / FAA"},null,512),[[ve,ke.jurisdiction]])]),r("label",tx,[$[22]||($[22]=r("span",{class:"eyebrow mb-1 block"},"Access tier",-1)),re(r("select",{"onUpdate:modelValue":$[7]||($[7]=I=>ke.accessTier=I),class:"field"},[(m(),v(le,null,Fe(h,I=>r("option",{key:I.value,value:I.value},k(I.label),9,nx)),64))],512),[[Et,ke.accessTier]])]),r("label",ix,[$[23]||($[23]=r("span",{class:"eyebrow mb-1 block"},"Issue date",-1)),re(r("input",{"onUpdate:modelValue":$[8]||($[8]=I=>ke.issueDate=I),type:"date",class:"field"},null,512),[[ve,ke.issueDate]])]),r("label",sx,[$[24]||($[24]=r("span",{class:"eyebrow mb-1 block"},"Expiry date",-1)),re(r("input",{"onUpdate:modelValue":$[9]||($[9]=I=>ke.expiryDate=I),type:"date",class:"field"},null,512),[[ve,ke.expiryDate]])]),r("label",ox,[$[25]||($[25]=r("span",{class:"eyebrow mb-1 block"},"Status",-1)),re(r("select",{"onUpdate:modelValue":$[10]||($[10]=I=>ke.status=I),class:"field"},[(m(),v(le,null,Fe(d,I=>r("option",{key:I.value,value:I.value},k(I.label),9,ax)),64))],512),[[Et,ke.status]])])]),r("label",rx,[$[26]||($[26]=r("span",{class:"eyebrow mb-1 block"},"Notes",-1)),re(r("textarea",{"onUpdate:modelValue":$[11]||($[11]=I=>ke.notes=I),rows:"2",class:"field",placeholder:"Conditions, renewal contacts, anything worth recording"},null,512),[[ve,ke.notes]])]),de.value?(m(),v("div",cx,[...$[28]||($[28]=[D(" Editing updates metadata only. To replace the file, close this and use ",-1),r("b",{class:"text-ink-secondary"},"New version",-1),D(" on the document — the old version is kept for audit. ",-1)])])):(m(),v("div",lx,[r("span",ux,"File "+k(Ne.value?"(new version)":"(optional)"),1),r("input",{ref_key:"fileInput",ref:Be,type:"file",class:"field",onChange:ne},null,544),$[27]||($[27]=r("p",{class:"mt-1 text-xs text-ink-muted"}," Stored in PocketBase for now (object storage later). Max 50 MB. ",-1))])),r("div",dx,[r("button",{class:"btn-accent",disabled:ee.value,onClick:rt},k(ee.value?"Saving…":de.value?"Save changes":Ne.value?"Upload new version":"Add document"),9,fx),r("button",{class:"btn-ghost",onClick:De},"Cancel"),Ce.value?(m(),v("span",hx,k(Ce.value),1)):R("",!0)])])):R("",!0),r("div",px,[T.value?(m(),v("div",mx,"Loading…")):ue.value.length?(m(),v("div",yx,[r("table",bx,[r("thead",null,[r("tr",xx,[(m(),v(le,null,Fe(["Title","Type","Owner","Expiry","Ver",""],I=>r("th",{key:I,class:"border-y border-line bg-surface-2 px-5 py-2.5 font-mono text-[10.5px] font-normal uppercase tracking-caps text-ink-muted"},k(I),1)),64))])]),r("tbody",null,[(m(!0),v(le,null,Fe(ue.value,I=>{var W,C;return m(),v(le,{key:I.id},[r("tr",{class:Le(["border-b border-line last:border-0",de.value===I.id?"bg-accent-soft":""])},[r("td",wx,[r("div",kx,k(I.title),1),I.reference?(m(),v("div",Sx,k(I.reference),1)):R("",!0)]),r("td",Px,k(Ue(l)[I.docType]||I.docType||"—"),1),r("td",Tx,k(Q(I)),1),r("td",Cx,[r("button",{class:Le(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",i[X(I).tone]]),onClick:O=>$e(I.id)},[X(I).icon?(m(),et(J,{key:0,name:X(I).icon,size:12},null,8,["name"])):R("",!0),D(" "+k(X(I).label),1)],10,Lx),I.expiryDate?(m(),v("div",Mx,k(I.expiryDate),1)):R("",!0)]),r("td",Ex,"v"+k(I.version||1),1),r("td",Ox,[ge.value===I.id?(m(),v(le,{key:0},[$[29]||($[29]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),r("button",{class:"btn-ghost mr-1",onClick:$[12]||($[12]=O=>ge.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:O=>Me(I)},"Delete",8,zx)],64)):(m(),v(le,{key:1},[I.hasFile?(m(),v("a",{key:0,href:Ue(gp)(I.id),class:"btn-ghost mr-1 inline-flex items-center gap-1",title:"Download file"},[E(J,{name:"download",size:13})],8,Ax)):R("",!0),r("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",title:"Upload new version",onClick:O=>he(I)},[E(J,{name:"upload",size:13})],8,Ix),r("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:O=>Ze(I)},[E(J,{name:"sliders",size:13}),$[30]||($[30]=D(" Edit",-1))],8,$x),r("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:O=>ge.value=I.id},[E(J,{name:"trash",size:13})],8,Dx)],64))])],2),Ae.value===I.id?(m(),v("tr",Nx,[r("td",Rx,[r("div",Fx,[r("span",Bx,[$[31]||($[31]=D("Status: ",-1)),r("b",Vx,k(I.status||"—"),1)]),r("span",Ux,[$[32]||($[32]=D("Access: ",-1)),r("b",Zx,k(I.accessTier||"—"),1)]),I.jurisdiction?(m(),v("span",Hx,[$[33]||($[33]=D("Jurisdiction: ",-1)),r("b",jx,k(I.jurisdiction),1)])):R("",!0),I.issueDate?(m(),v("span",Wx,[$[34]||($[34]=D("Issued: ",-1)),r("b",Kx,k(I.issueDate),1)])):R("",!0),I.expiryDate?(m(),v("span",Gx,[$[35]||($[35]=D("Expires: ",-1)),r("b",qx,k(I.expiryDate),1)])):R("",!0),r("span",Yx,[$[36]||($[36]=D("File: ",-1)),r("b",Jx,k(I.hasFile?I.fileName:"none"),1)])]),(((W=I.expiry)==null?void 0:W.flags)||[]).length?(m(),v("ul",Xx,[(m(!0),v(le,null,Fe(I.expiry.flags,(O,ht)=>(m(),v("li",{key:ht,class:Le(["flex items-start gap-2 text-xs",I.expiry.state==="expired"?"text-danger-fg":I.expiry.state==="expiring_soon"?"text-amber-fg":"text-ink-secondary"])},[E(J,{name:"alertTriangle",size:13,class:"mt-px shrink-0"}),D(" "+k(O),1)],2))),128))])):((C=I.expiry)==null?void 0:C.state)==="valid"?(m(),v("div",Qx,"In force — no action needed.")):R("",!0),I.notes?(m(),v("div",e0,[$[37]||($[37]=r("span",{class:"text-ink-muted"},"Notes:",-1)),D(" "+k(I.notes),1)])):R("",!0)])])):R("",!0)],64)}),128))])])])):(m(),v("div",gx,[E(J,{name:"fileText",size:26,class:"text-ink-muted"}),r("div",vx,k(U.value==="all"?"No documents on file yet":"Nothing in this view"),1),r("div",_x,k(U.value==="all"?"Add certificates, registrations, insurance and authorisations to track their expiry.":"Try a different filter."),1)]))])]))}},n0={class:"grid h-full grid-cols-[248px_1fr] max-[900px]:grid-cols-1"},i0={class:"flex flex-col border-r border-line bg-surface-1 px-4 py-5 max-[900px]:hidden"},s0={class:"flex items-center gap-2.5 px-2 pb-5"},o0={class:"flex flex-col gap-0.5"},a0=["onClick"],r0={class:"mt-auto flex flex-col gap-2.5"},l0={class:"rounded-lg bg-surface-2 p-3"},u0={class:"flex items-center gap-2"},c0={class:"text-xs font-semibold text-ink"},d0={class:"mt-1.5 block font-mono text-[10.5px] text-ink-muted"},f0={class:"flex items-center gap-2.5 px-2 py-1"},h0={class:"grid h-8 w-8 place-items-center rounded-full bg-[var(--navy-800)] text-xs font-bold text-white"},p0={class:"min-w-0 flex-1"},m0={class:"truncate text-[13px] font-semibold text-ink"},g0={class:"flex items-center gap-1.5 text-[11px] text-ink-muted"},v0=["title"],_0={class:"overflow-y-auto"},y0={class:"sticky top-0 z-10 flex items-center gap-4 border-b border-line px-7 py-3.5",style:{background:"color-mix(in srgb, var(--bg-app) 82%, transparent)","backdrop-filter":"blur(10px)"}},b0={class:"mt-0.5 text-[22px] font-bold tracking-tightest text-ink"},x0={class:"ml-auto flex items-center gap-3"},w0={class:"flex h-10 w-60 items-center gap-2 rounded border border-line-strong bg-surface-1 px-3 max-[1100px]:hidden"},k0={key:0,class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},S0={class:"grid grid-cols-4 gap-4 max-[1100px]:grid-cols-2 max-[560px]:grid-cols-1"},P0={class:"flex items-center justify-between"},T0={class:"eyebrow"},C0={class:"mt-2.5 text-[34px] font-bold leading-none tracking-tightest text-ink"},L0={class:"grid grid-cols-[1.6fr_1fr] gap-5 max-[1100px]:grid-cols-1"},M0={class:"panel p-5"},E0={class:"mb-3.5 flex items-center justify-between"},O0={class:"panel p-5"},z0={class:"mb-3.5 flex items-center justify-between"},A0={class:"grid place-items-center py-10 text-center"},I0={class:"panel overflow-hidden p-0"},$0={class:"flex items-center justify-between px-5 py-4"},D0={class:"flex gap-2"},N0={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},R0={key:1,class:"overflow-x-auto"},F0={class:"w-full border-collapse text-sm"},B0={class:"text-left"},V0=["onClick"],U0={class:"px-5 py-3 font-mono font-bold text-ink"},Z0={class:"px-5 py-3 text-ink-secondary"},H0={class:"px-5 py-3"},j0={class:"px-5 py-3 font-mono text-ink-secondary"},W0={class:"px-5 py-3"},K0={key:0,class:"flex items-center gap-2"},G0={class:"h-1.5 w-12 overflow-hidden rounded bg-surface-2"},q0={class:"font-mono text-xs text-ink-secondary"},Y0={key:1,class:"font-mono text-xs text-ink-muted"},J0={class:"px-5 py-3 font-mono text-ink-secondary"},X0={class:"px-5 py-3 text-right"},Q0=["onClick"],ew={key:1,class:"p-7"},tw={class:"mb-4 flex flex-wrap items-center gap-3"},nw={class:"font-mono text-mode font-bold text-ink"},iw={key:0,class:"rounded-full bg-danger-soft px-2.5 py-0.5 font-mono text-[10px] font-bold uppercase tracking-caps text-danger-fg"},sw={key:1,class:"ml-auto flex flex-wrap gap-1.5"},ow=["onClick"],aw={key:0,class:"panel grid place-items-center p-16 text-center"},rw={class:"pill"},lw={class:"pill"},uw={class:"pill"},cw={class:"mt-1 text-sm font-semibold text-ink"},dw={class:"pill"},fw={class:"mt-1 font-mono text-sm font-bold tabular text-ink"},hw={class:"grid grid-cols-2 gap-4 max-[820px]:grid-cols-1"},pw={class:"panel p-4"},mw={class:"flex items-center gap-4"},gw={class:"h-9 flex-1 overflow-hidden rounded border border-line bg-surface-2"},vw={class:"readout"},_w={class:"panel p-4"},yw={class:"readout"},bw={class:"panel p-4"},xw={class:"space-y-1.5 text-sm"},ww={class:"flex justify-between"},kw={class:"text-ink"},Sw={class:"flex justify-between"},Pw={class:"text-ink"},Tw={class:"flex justify-between"},Cw={class:"font-mono tabular text-ink"},Lw={class:"flex justify-between"},Mw={class:"font-mono tabular text-ink"},Ew={class:"panel p-4"},Ow={class:"space-y-1.5 text-sm"},zw={class:"flex justify-between"},Aw={class:"font-mono tabular text-ink"},Iw={class:"flex justify-between"},$w={class:"font-mono tabular text-ink"},Dw={class:"flex justify-between"},Nw={class:"font-mono tabular text-ink"},Rw={class:"panel col-span-2 p-4 max-[820px]:col-span-1"},Fw={class:"panel p-4"},Bw={class:"flex flex-wrap gap-2"},Vw={class:"mt-2 min-h-[16px] text-xs text-ink-muted"},Uw={class:"panel p-4"},Zw={class:"h-[180px] overflow-y-auto font-mono text-xs"},Hw={class:"text-ink-muted"},jw={class:"font-semibold text-accent"},Ww={class:"break-all text-ink"},Kw={key:5,class:"p-7"},Gw={class:"panel grid place-items-center p-16 text-center"},qw={class:"mt-3 text-sm font-medium text-ink-secondary"},Yw={key:0,class:"mt-1 text-xs text-ink-muted"},Jw={key:1,class:"mt-1 text-xs text-ink-muted"},Xw={__name:"Dashboard",props:{email:{type:String,default:""},role:{type:String,default:"user"},organization:{type:String,default:""},organizationName:{type:String,default:""}},emits:["logout"],setup(t,{emit:i}){const o=t,l=i,u=bt({}),d=bt({}),h=K(null),_=K(!1),y=bt([]),T=K(""),w=K("Overview"),z=[["grid","Overview"],["radio","Live flights"],["route","Routes"],["calendar","Schedule"],["book","Logbook"],["fileText","Documents"],["server","Drives"],["settings","Settings"]],U=we(()=>(z.find(([,b])=>b===w.value)||["grid"])[0]),V=K(""),ue=K(""),X=K("");let Ae=null,$e=null,Q=!1;const me=we(()=>Object.keys(u).sort((b,g)=>(u[g].online?1:0)-(u[b].online?1:0)||b.localeCompare(g))),oe=we(()=>h.value?u[h.value]:null),de=we(()=>oe.value&&oe.value.telemetry||{}),Ne=we(()=>!!(oe.value&&oe.value.online)),nt=we(()=>{const b=de.value;return typeof b.latitude=="number"&&typeof b.longitude=="number"&&(b.latitude||b.longitude)?{lat:b.latitude,lng:b.longitude}:null}),ke=we(()=>h.value&&d[h.value]||[]),Te=we(()=>{const b=de.value;return typeof b.velocityX=="number"&&typeof b.velocityY=="number"?Math.hypot(b.velocityX,b.velocityY):null});function Be(b){return b.online?b.connected?["In flight","success"]:["Standby","accent"]:["Offline","neutral"]}function Ce(b){const g=b&&b.telemetry||{};return typeof g.velocityX=="number"&&typeof g.velocityY=="number"?Math.hypot(g.velocityX,g.velocityY):null}const ee=we(()=>me.value.map(b=>{const g=u[b],M=g.telemetry||{},[Z,B]=Be(g);return{id:b,mission:g.model||(g.connected?"Drone linked":g.online?"App online":"No signal"),status:Z,tone:B,alt:typeof M.altitude=="number"?M.altitude.toFixed(0)+" m":"—",battery:typeof M.batteryPercent=="number"?M.batteryPercent:null,speed:Ce(g)}})),pe=we(()=>me.value.filter(b=>u[b].online).length),Re=we(()=>me.value.filter(b=>u[b].online&&u[b].connected).length),Ze=we(()=>me.value.filter(b=>!u[b].online).length),he=we(()=>{const b=me.value.map(g=>{var M;return(M=u[g].telemetry)==null?void 0:M.batteryPercent}).filter(g=>typeof g=="number");return b.length?Math.round(b.reduce((g,M)=>g+M,0)/b.length):null}),De=we(()=>[{label:"Active flights",value:String(Re.value),delta:`${pe.value} online`,tone:"success",icon:"radio"},{label:"Avg battery",value:he.value==null?"—":he.value+"%",delta:he.value==null?"no telemetry":he.value<40?"low — watch":"nominal",tone:he.value!=null&&he.value<40?"danger":"neutral",icon:"battery"},{label:"Fleet size",value:String(me.value.length),delta:`${Re.value} in flight`,tone:"neutral",icon:"grid"},{label:"Offline",value:String(Ze.value),delta:Ze.value?"needs attention":"all reachable",tone:Ze.value?"warning":"success",icon:"signal"}]),ne={success:"bg-success-soft text-success-fg",warning:"bg-amber-soft text-amber-fg",danger:"bg-danger-soft text-danger-fg",accent:"bg-accent-soft text-accent-soft-fg",neutral:"bg-surface-2 text-ink-secondary"},rt={success:"text-success-fg",danger:"text-danger-fg",warning:"text-amber-fg",neutral:"text-ink-muted",accent:"text-accent-soft-fg"},ge=we(()=>{var M,Z,B;const g=(o.email||"PV").split("@")[0].split(/[.\-_ ]+/).filter(Boolean);return((((M=g[0])==null?void 0:M[0])||"P")+(((Z=g[1])==null?void 0:Z[0])||((B=g[0])==null?void 0:B[1])||"V")).toUpperCase()}),Me={superadmin:"Superadmin",admin:"Admin",user:"Operator"},je=we(()=>Me[o.role]||"Operator"),te=we(()=>o.organizationName||(o.role==="superadmin"?"All organizations":"No organization"));function $(b){var M;u[b.deviceId]=b;const g=b.telemetry||{};typeof g.latitude=="number"&&typeof g.longitude=="number"&&(g.latitude||g.longitude)&&(d[b.deviceId]||(d[b.deviceId]=[]),d[b.deviceId].push([g.latitude,g.longitude]),d[b.deviceId].length>1e3&&d[b.deviceId].shift()),(!h.value||b.online&&!((M=u[h.value])!=null&&M.online))&&(h.value=b.deviceId)}function I(b){delete u[b],delete d[b],h.value===b&&(h.value=me.value[0]||null)}function W(b){y.unshift({t:ql(Date.now()),tag:b.type||"?",text:JSON.stringify(C(b))}),y.length>200&&y.pop()}function C(b){const g={...b};return delete g.type,g}function O(){const b=location.protocol==="https:"?"wss":"ws";Ae=new WebSocket(`${b}://${location.host}/bff/ws`),Ae.onopen=()=>_.value=!0,Ae.onclose=()=>{_.value=!1,Q||($e=setTimeout(O,1500))},Ae.onerror=()=>Ae&&Ae.close(),Ae.onmessage=g=>{let M;try{M=JSON.parse(g.data)}catch{return}M.type==="snapshot"?(M.devices||[]).forEach($):M.type==="update"&&M.device?($(M.device),M.event&&M.device.deviceId===h.value&&W(M.event)):M.type==="removed"&&M.deviceId&&I(M.deviceId)}}async function ht(){if(!h.value)return X.value="No device selected.";if(!V.value.trim())return X.value="Enter a command name.";let b;if(ue.value.trim())try{b=JSON.parse(ue.value)}catch{return X.value="Payload is not valid JSON."}const{ok:g,body:M}=await vp(h.value,V.value.trim(),b);X.value=g?`Sent "${V.value.trim()}".`:`Error: ${M.error||"failed"}`}function lt(b,g,M=""){return typeof b=="number"?b.toFixed(g)+M:"—"}function qt(b){h.value=b,w.value="Live flights"}return Li(async()=>{(await Fh()).forEach($),O()}),_a(()=>{Q=!0,$e&&clearTimeout($e),Ae&&Ae.close()}),(b,g)=>{var M,Z,B,H,ie;return m(),v("div",n0,[r("aside",i0,[r("div",s0,[E(Mc,{size:26}),g[7]||(g[7]=r("span",{class:"text-[19px] tracking-tightest"},[r("span",{class:"font-medium text-ink-secondary"},"Pilot"),r("span",{class:"font-bold text-ink"},"Vault")],-1))]),r("nav",o0,[(m(),v(le,null,Fe(z,([F,Y])=>r("button",{key:Y,class:Le(["flex items-center gap-3 rounded px-3 py-2.5 text-left text-sm transition",w.value===Y?"bg-accent-soft font-semibold text-accent-soft-fg":"font-medium text-ink-secondary hover:bg-surface-2"]),onClick:j=>w.value=Y},[E(J,{name:F,size:18,stroke:w.value===Y?2.2:1.8},null,8,["name","stroke"]),D(" "+k(Y),1)],10,a0)),64))]),r("div",r0,[r("div",l0,[r("div",u0,[r("span",{class:Le(["h-2 w-2 rounded-full",_.value?"bg-ready":"bg-caution"])},null,2),r("span",c0,k(_.value?"Link healthy":"Reconnecting…"),1)]),r("span",d0,"API gateway · "+k(_.value?"streaming":"retrying"),1)]),r("div",f0,[r("div",h0,k(ge.value),1),r("div",p0,[r("div",m0,k(t.email||"Operator"),1),r("div",g0,[E(J,{name:"grid",size:11,class:"shrink-0"}),r("span",{class:"truncate",title:`${je.value} · ${te.value}`},k(je.value)+" · "+k(te.value),9,v0)])]),r("button",{class:"text-ink-muted transition hover:text-ink",title:"Log out","aria-label":"Log out",onClick:g[0]||(g[0]=F=>l("logout"))},[E(J,{name:"logout",size:16})])])])]),r("main",_0,[r("header",y0,[r("div",null,[g[8]||(g[8]=r("div",{class:"eyebrow"},"Live operations",-1)),r("h1",b0,k(w.value),1)]),r("div",x0,[r("div",w0,[E(J,{name:"search",size:16,class:"text-ink-muted"}),re(r("input",{"onUpdate:modelValue":g[1]||(g[1]=F=>T.value=F),placeholder:"Search drones, routes…",class:"w-full border-none bg-transparent text-sm text-ink outline-none placeholder:text-ink-muted"},null,512),[[ve,T.value]])]),r("button",{class:"btn-accent flex items-center gap-2",onClick:g[2]||(g[2]=F=>w.value="Live flights")},[E(J,{name:"radio",size:16}),g[9]||(g[9]=D(" Live flights ",-1))])])]),w.value==="Overview"?(m(),v("div",k0,[r("div",S0,[(m(!0),v(le,null,Fe(De.value,F=>(m(),v("div",{key:F.label,class:"panel p-5"},[r("div",P0,[r("span",T0,k(F.label),1),E(J,{name:F.icon,size:16,class:"text-ink-muted"},null,8,["name"])]),r("div",C0,k(F.value),1),r("span",{class:Le(["mt-2 block font-mono text-[11px]",rt[F.tone]])},k(F.delta),3)]))),128))]),r("div",L0,[r("div",M0,[r("div",E0,[g[11]||(g[11]=r("div",null,[r("div",{class:"eyebrow"},"Airspace"),r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Live map")],-1)),Re.value?(m(),v("span",{key:0,class:Le(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",ne.success])},[g[10]||(g[10]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(k(Re.value)+" airborne ",1)],2)):R("",!0)]),E(Ql,{position:nt.value,trail:ke.value},null,8,["position","trail"])]),r("div",O0,[r("div",z0,[g[12]||(g[12]=r("div",null,[r("div",{class:"eyebrow"},"Today"),r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Schedule")],-1)),E(J,{name:"clock",size:16,class:"text-ink-muted"})]),r("div",A0,[E(J,{name:"calendar",size:24,class:"text-ink-muted"}),g[13]||(g[13]=r("div",{class:"mt-2 text-sm font-medium text-ink-secondary"},"No missions scheduled",-1)),g[14]||(g[14]=r("div",{class:"mt-0.5 text-xs text-ink-muted"},"Scheduling is not wired to a backend yet.",-1))])])]),r("div",I0,[r("div",$0,[g[17]||(g[17]=r("div",null,[r("div",{class:"eyebrow"},"Fleet"),r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Aircraft status")],-1)),r("div",D0,[r("span",{class:Le(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",ne.success])},[g[15]||(g[15]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(k(Re.value)+" in flight ",1)],2),Ze.value?(m(),v("span",{key:0,class:Le(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",ne.warning])},[g[16]||(g[16]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(k(Ze.value)+" offline ",1)],2)):R("",!0)])]),ee.value.length?(m(),v("div",R0,[r("table",F0,[r("thead",null,[r("tr",B0,[(m(),v(le,null,Fe(["Aircraft","Mission","Status","Alt","Battery","Speed",""],F=>r("th",{key:F,class:"border-y border-line bg-surface-2 px-5 py-2.5 font-mono text-[10.5px] font-normal uppercase tracking-caps text-ink-muted"},k(F),1)),64))])]),r("tbody",null,[(m(!0),v(le,null,Fe(ee.value,(F,Y)=>(m(),v("tr",{key:F.id,class:Le(["cursor-pointer transition hover:bg-surface-2",Yqt(F.id)},[r("td",U0,k(F.id),1),r("td",Z0,k(F.mission),1),r("td",H0,[r("span",{class:Le(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",ne[F.tone]])},[g[18]||(g[18]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(k(F.status),1)],2)]),r("td",j0,k(F.alt),1),r("td",W0,[F.battery!=null?(m(),v("div",K0,[r("div",G0,[r("div",{class:Le(["h-full",F.battery<40?"bg-caution":"bg-ready"]),style:Ss({width:F.battery+"%"})},null,6)]),r("span",q0,k(F.battery)+"%",1)])):(m(),v("span",Y0,"—"))]),r("td",J0,[D(k(F.speed==null?"—":F.speed.toFixed(1))+" ",1),g[19]||(g[19]=r("span",{class:"text-ink-muted"},"m/s",-1))]),r("td",X0,[r("button",{class:"btn-ghost inline-flex items-center gap-1.5 whitespace-nowrap",onClick:yc(j=>qt(F.id),["stop"])},[E(J,{name:"play",size:14}),g[20]||(g[20]=D(" Track ",-1))],8,Q0)])],10,V0))),128))])])])):(m(),v("div",N0," No aircraft connected yet. Devices appear here as they come online. "))])])):w.value==="Live flights"?(m(),v("div",ew,[r("div",tw,[r("span",nw,k(h.value||"No device selected"),1),oe.value&&!Ne.value?(m(),v("span",iw,"Offline")):R("",!0),me.value.length?(m(),v("div",sw,[(m(!0),v(le,null,Fe(me.value,F=>(m(),v("button",{key:F,class:Le(["flex items-center gap-2 rounded border px-3 py-1.5 font-mono text-xs font-bold transition",F===h.value?"border-accent bg-accent-soft text-accent-soft-fg":"border-line bg-surface-1 text-ink-secondary hover:border-line-strong"]),onClick:Y=>h.value=F},[r("span",{class:Le(["h-2 w-2 rounded-full",u[F].online?"bg-ready":"bg-ink-muted"])},null,2),D(" "+k(F),1)],10,ow))),128))])):R("",!0)]),me.value.length?(m(),v(le,{key:1},[r("div",{class:Le(["mb-4 grid gap-3",!Ne.value&&oe.value?"opacity-60":""]),style:{"grid-template-columns":"repeat(auto-fit, minmax(150px, 1fr))"}},[r("div",rw,[g[23]||(g[23]=r("div",{class:"eyebrow"},"Registration",-1)),r("div",{class:Le(["mt-1 text-sm font-semibold",Ne.value?((M=oe.value)==null?void 0:M.registration)==="success"?"text-success-fg":"text-danger-fg":"text-ink"])},k(Ne.value&&((Z=oe.value)!=null&&Z.registration)?oe.value.registration:"—"),3)]),r("div",lw,[g[24]||(g[24]=r("div",{class:"eyebrow"},"Drone link",-1)),r("div",{class:Le(["mt-1 text-sm font-semibold",Ne.value?(B=oe.value)!=null&&B.connected?"text-success-fg":"text-danger-fg":"text-ink"])},k(oe.value?Ne.value?oe.value.connected?"connected":"no drone":"app offline":"—"),3)]),r("div",uw,[g[25]||(g[25]=r("div",{class:"eyebrow"},"Model",-1)),r("div",cw,k(((H=oe.value)==null?void 0:H.model)||"—"),1)]),r("div",dw,[g[26]||(g[26]=r("div",{class:"eyebrow"},"Last update",-1)),r("div",fw,k((ie=oe.value)!=null&&ie.lastSeenMs?Ue(ql)(oe.value.lastSeenMs):"—"),1)])],2),r("div",hw,[r("div",pw,[g[28]||(g[28]=r("div",{class:"mb-3 eyebrow"},"Battery",-1)),r("div",mw,[r("div",gw,[r("div",{class:Le(["h-full transition-all",typeof de.value.batteryPercent=="number"?de.value.batteryPercent<20?"bg-warning":de.value.batteryPercent<40?"bg-caution":"bg-ready":""]),style:Ss({width:(typeof de.value.batteryPercent=="number"?de.value.batteryPercent:0)+"%"})},null,6)]),r("div",vw,[D(k(typeof de.value.batteryPercent=="number"?de.value.batteryPercent:"—"),1),g[27]||(g[27]=r("span",{class:"text-sm text-ink-secondary"},"%",-1))])])]),r("div",_w,[g[30]||(g[30]=r("div",{class:"mb-3 eyebrow"},"Altitude",-1)),r("div",yw,[D(k(lt(de.value.altitude,1)),1),g[29]||(g[29]=r("span",{class:"text-sm text-ink-secondary"}," m",-1))])]),r("div",bw,[g[35]||(g[35]=r("div",{class:"mb-3 eyebrow"},"Flight",-1)),r("div",xw,[r("div",ww,[g[31]||(g[31]=r("span",{class:"text-ink-secondary"},"Mode",-1)),r("b",kw,k(de.value.flightMode||"—"),1)]),r("div",Sw,[g[32]||(g[32]=r("span",{class:"text-ink-secondary"},"Flying",-1)),r("b",Pw,k(de.value.isFlying==null?"—":de.value.isFlying?"yes":"no"),1)]),r("div",Tw,[g[33]||(g[33]=r("span",{class:"text-ink-secondary"},"GPS sats",-1)),r("b",Cw,k(de.value.satelliteCount==null?"—":de.value.satelliteCount),1)]),r("div",Lw,[g[34]||(g[34]=r("span",{class:"text-ink-secondary"},"Speed (H)",-1)),r("b",Mw,k(Te.value==null?"—":lt(Te.value,2," m/s")),1)])])]),r("div",Ew,[g[39]||(g[39]=r("div",{class:"mb-3 eyebrow"},"Position",-1)),r("div",Ow,[r("div",zw,[g[36]||(g[36]=r("span",{class:"text-ink-secondary"},"Latitude",-1)),r("b",Aw,k(lt(de.value.latitude,6)),1)]),r("div",Iw,[g[37]||(g[37]=r("span",{class:"text-ink-secondary"},"Longitude",-1)),r("b",$w,k(lt(de.value.longitude,6)),1)]),r("div",Dw,[g[38]||(g[38]=r("span",{class:"text-ink-secondary"},"Vert. speed",-1)),r("b",Nw,k(lt(typeof de.value.velocityZ=="number"?-de.value.velocityZ:void 0,2," m/s")),1)])])]),r("div",Rw,[g[40]||(g[40]=r("div",{class:"mb-3 eyebrow"},"Track",-1)),E(Ql,{position:nt.value,trail:ke.value},null,8,["position","trail"])]),r("div",Fw,[g[41]||(g[41]=r("div",{class:"mb-3 eyebrow"},"Send command",-1)),r("div",Bw,[re(r("input",{"onUpdate:modelValue":g[3]||(g[3]=F=>V.value=F),class:"field flex-1",placeholder:"command (e.g. startConnection)"},null,512),[[ve,V.value]]),re(r("input",{"onUpdate:modelValue":g[4]||(g[4]=F=>ue.value=F),class:"field flex-1",placeholder:"payload JSON (optional)"},null,512),[[ve,ue.value]]),r("button",{class:"btn-accent",onClick:ht},"Send")]),r("div",Vw,k(X.value),1)]),r("div",Uw,[g[42]||(g[42]=r("div",{class:"mb-3 eyebrow"},"Event log",-1)),r("div",Zw,[(m(!0),v(le,null,Fe(y,(F,Y)=>(m(),v("div",{key:Y,class:"border-b border-line py-1"},[r("span",Hw,k(F.t),1),r("span",jw,k(F.tag),1),r("span",Ww,k(F.text),1)]))),128))])])])],64)):(m(),v("div",aw,[E(J,{name:"radio",size:28,class:"text-ink-muted"}),g[21]||(g[21]=r("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No aircraft online",-1)),g[22]||(g[22]=r("div",{class:"mt-1 text-xs text-ink-muted"},"Live telemetry appears here once a drone connects.",-1))]))])):w.value==="Logbook"?(m(),et(Ob,{key:2,email:t.email,role:t.role,organization:t.organization,"organization-name":t.organizationName},null,8,["email","role","organization","organization-name"])):w.value==="Documents"?(m(),et(t0,{key:3,email:t.email,role:t.role,organization:t.organization,"organization-name":t.organizationName},null,8,["email","role","organization","organization-name"])):w.value==="Settings"?(m(),et(Iy,{key:4,email:t.email,role:t.role,organization:t.organization,"organization-name":t.organizationName,onLogout:g[5]||(g[5]=F=>l("logout"))},null,8,["email","role","organization","organization-name"])):(m(),v("div",Kw,[r("div",Gw,[E(J,{name:U.value,size:28,class:"text-ink-muted"},null,8,["name"]),r("div",qw,k(w.value),1),w.value==="Drives"?(m(),v("div",Yw,[g[43]||(g[43]=D(" Browse and transfer files here once a drive is connected. Configure drives in ",-1)),r("button",{class:"font-semibold text-accent hover:underline",onClick:g[6]||(g[6]=F=>w.value="Settings")},"Settings → Integrations"),g[44]||(g[44]=D(". ",-1))])):(m(),v("div",Jw,"This section is part of the console shell and has no backend yet."))])]))])])}}},Qw={key:0,class:"h-full"},ek={key:1,class:"grid h-full place-items-center text-ink-muted text-sm"},tk={__name:"App",setup(t){const i=K(!1),o=K(null),l=K("user"),u=K(""),d=K(""),h=K("");function _(w){l.value=w&&w.role||"user",u.value=w&&w.organization||"",d.value=w&&w.organizationName||""}Li(async()=>{h.value=(await Dh()).apiBase||"";const w=await jl();w&&(o.value=w.email,_(w),await Jl()),i.value=!0});async function y(w){o.value=w,_(await jl()),await Jl()}async function T(){wp(),await Rh(),o.value=null,l.value="user",u.value="",d.value=""}return(w,z)=>i.value?(m(),v("div",Qw,[o.value?(m(),et(Xw,{key:0,email:o.value,role:l.value,organization:u.value,"organization-name":d.value,onLogout:T},null,8,["email","role","organization","organization-name"])):(m(),et(Fp,{key:1,"default-api-base":h.value,onSignedIn:y},null,8,["default-api-base"]))])):(m(),v("div",ek,"Loading…"))}};zh(tk).mount("#app"); diff --git a/Web App/server/dist/assets/index-Co-T5CTN.css b/Web App/server/dist/assets/index-Co-T5CTN.css deleted file mode 100644 index 231e11f..0000000 --- a/Web App/server/dist/assets/index-Co-T5CTN.css +++ /dev/null @@ -1 +0,0 @@ -:root,[data-theme=light]{--navy-950: #0B1730;--navy-900: #0F1E3D;--navy-800: #1B2E52;--navy-700: #26406E;--blue-50: #EAF1FE;--blue-100: #D6E3FD;--blue-200: #B4CDFA;--blue-300: #8FB4F6;--blue-400: #5B93F5;--blue-500: #3D7BF0;--blue-600: #2B62CC;--blue-700: #1F4CA0;--slate-0: #FFFFFF;--slate-50: #F6F7F9;--slate-100: #EEF0F3;--slate-150: #E6E9EE;--slate-200: #DCE0E7;--slate-300: #C5CCD7;--slate-400: #97A1B0;--slate-500: #6B7688;--slate-600: #4C5566;--slate-700: #333B4A;--slate-800: #1E2635;--slate-900: #131A28;--slate-950: #0B111C;--steel: #5A6B85;--green-500: #1F8A5B;--green-100: #DCF1E7;--green-600:#177049;--amber-500: #D9852B;--amber-100: #FBEBD5;--amber-600:#B86C1B;--red-500: #D64545;--red-100: #FBE0E0;--red-600: #B83232;--bg-app: var(--slate-100);--bg-subtle: var(--slate-50);--surface: var(--slate-0);--surface-2: var(--slate-50);--surface-inset: var(--slate-100);--border: var(--slate-200);--border-strong: var(--slate-300);--border-subtle: var(--slate-150);--text-primary: var(--navy-900);--text-secondary:var(--steel);--text-tertiary: var(--slate-400);--text-inverse: var(--slate-0);--text-on-accent:#FFFFFF;--accent: var(--blue-500);--accent-hover: var(--blue-600);--accent-active: var(--blue-700);--accent-soft: var(--blue-50);--accent-soft-fg:var(--blue-700);--focus-ring: color-mix(in srgb, var(--blue-500) 45%, transparent);--success: var(--green-500);--success-soft: var(--green-100);--success-fg: var(--green-600);--warning: var(--amber-500);--warning-soft: var(--amber-100);--warning-fg: var(--amber-600);--danger: var(--red-500);--danger-soft: var(--red-100);--danger-fg: var(--red-600);--overlay: color-mix(in srgb, var(--navy-950) 55%, transparent);--font-sans: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;--font-mono: "Space Mono", ui-monospace, "SF Mono", "JetBrains Mono", monospace;--radius-xs: 4px;--radius-sm: 6px;--radius-md: 10px;--radius-lg: 14px;--radius-xl: 20px;--radius-pill: 999px;--shadow-xs: 0 1px 2px rgba(15,30,61,.06);--shadow-sm: 0 1px 2px rgba(15,30,61,.06), 0 1px 3px rgba(15,30,61,.04);--shadow-md: 0 2px 4px rgba(15,30,61,.06), 0 6px 16px rgba(15,30,61,.08);--shadow-lg: 0 8px 24px rgba(15,30,61,.1), 0 2px 6px rgba(15,30,61,.06);--ease-standard: cubic-bezier(.4, 0, .2, 1);--ease-out: cubic-bezier(.16, 1, .3, 1);--dur-fast: .12s;--dur-base: .2s;color-scheme:light}[data-theme=dark]{--bg-app: var(--navy-950);--bg-subtle: var(--slate-950);--surface: #10203F;--surface-2: #142748;--surface-inset: var(--navy-950);--border: color-mix(in srgb, #FFFFFF 10%, transparent);--border-strong: color-mix(in srgb, #FFFFFF 18%, transparent);--border-subtle: color-mix(in srgb, #FFFFFF 6%, transparent);--text-primary: #F4F7FC;--text-secondary:#8FA0BE;--text-tertiary: #5E6E8C;--text-inverse: var(--navy-900);--text-on-accent:#FFFFFF;--accent: var(--blue-400);--accent-hover: var(--blue-300);--accent-active: var(--blue-200);--accent-soft: color-mix(in srgb, var(--blue-500) 18%, transparent);--accent-soft-fg:var(--blue-300);--focus-ring: color-mix(in srgb, var(--blue-400) 55%, transparent);--success:var(--green-500);--success-soft: color-mix(in srgb, var(--green-500) 22%, transparent);--success-fg:#5FD3A0;--warning:var(--amber-500);--warning-soft: color-mix(in srgb, var(--amber-500) 22%, transparent);--warning-fg:#F0B26A;--danger: var(--red-500);--danger-soft: color-mix(in srgb, var(--red-500) 22%, transparent);--danger-fg: #F08A8A;--overlay: color-mix(in srgb, #000000 62%, transparent);--shadow-xs: 0 1px 2px rgba(0,0,0,.35);--shadow-sm: 0 1px 3px rgba(0,0,0,.4);--shadow-md: 0 4px 12px rgba(0,0,0,.45);--shadow-lg: 0 12px 32px rgba(0,0,0,.5);color-scheme:dark}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Space Grotesk,ui-sans-serif,system-ui,-apple-system,Segoe UI,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}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;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:Space Mono,ui-monospace,SF Mono,JetBrains Mono,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.tabular{font-variant-numeric:tabular-nums}.eyebrow{font-family:Space Mono,ui-monospace,SF Mono,JetBrains Mono,monospace;font-size:11px;text-transform:uppercase;letter-spacing:.14em;color:var(--text-tertiary)}.readout{font-variant-numeric:tabular-nums;font-family:Space Mono,ui-monospace,SF Mono,JetBrains Mono,monospace;font-size:30px;line-height:1;font-weight:500;color:var(--text-primary)}.panel{border-radius:14px;border-width:1px;border-color:var(--border);background-color:var(--surface);--tw-shadow: var(--shadow-xs);--tw-shadow-colored: var(--shadow-xs);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.pill{border-radius:10px;border-width:1px;border-color:var(--border);background-color:var(--surface-2);padding:.5rem .75rem}.field{width:100%;border-radius:10px;border-width:1px;border-color:var(--border);background-color:var(--surface-2);padding:.625rem .75rem;font-size:.875rem;line-height:1.25rem;color:var(--text-primary);outline:2px solid transparent;outline-offset:2px;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.field::-moz-placeholder{color:var(--text-tertiary)}.field::placeholder{color:var(--text-tertiary)}.field{transition-duration:var(--dur-fast)}.field:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--focus-ring)}.btn-accent{border-radius:10px;background-color:var(--accent);padding:.625rem 1rem;font-size:.875rem;line-height:1.25rem;font-weight:600;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.btn-accent:hover{background-color:var(--accent-hover)}.btn-accent:active{--tw-translate-y: 1px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.btn-accent:disabled{opacity:.5}.btn-accent{transition-duration:var(--dur-fast)}.btn-ghost{border-radius:10px;border-width:1px;border-color:var(--border);background-color:var(--surface);padding:.375rem .75rem;font-size:.875rem;line-height:1.25rem;color:var(--text-secondary);transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.btn-ghost:hover{border-color:var(--border-strong);color:var(--text-primary)}.btn-ghost:active{--tw-translate-y: 1px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.btn-ghost{transition-duration:var(--dur-fast)}.btn-icon{display:grid;height:2.25rem;width:2.25rem;place-items:center;border-radius:10px;border-width:1px;border-color:var(--border);background-color:var(--surface);color:var(--text-secondary);transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.btn-icon:hover{border-color:var(--border-strong);color:var(--text-primary)}.btn-icon{transition-duration:var(--dur-fast)}.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-y-0{top:0;bottom:0}.bottom-5{bottom:1.25rem}.right-0{right:0}.right-5{right:1.25rem}.top-0{top:0}.top-5{top:1.25rem}.z-10{z-index:10}.z-20{z-index:20}.col-span-2{grid-column:span 2 / span 2}.mx-auto{margin-left:auto;margin-right:auto}.my-4{margin-top:1rem;margin-bottom:1rem}.-mb-px{margin-bottom:-1px}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-3\.5{margin-bottom:.875rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.ml-1{margin-left:.25rem}.ml-1\.5{margin-left:.375rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-1\.5{margin-right:.375rem}.mr-2{margin-right:.5rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-2\.5{margin-top:.625rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.mt-auto{margin-top:auto}.mt-px{margin-top:1px}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-16{height:4rem}.h-2{height:.5rem}.h-28{height:7rem}.h-4{height:1rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[180px\]{height:180px}.h-\[18px\]{height:18px}.h-\[320px\]{height:320px}.h-full{height:100%}.min-h-\[16px\]{min-height:16px}.w-1\.5{width:.375rem}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-16{width:4rem}.w-2{width:.5rem}.w-24{width:6rem}.w-28{width:7rem}.w-32{width:8rem}.w-4{width:1rem}.w-48{width:12rem}.w-56{width:14rem}.w-60{width:15rem}.w-64{width:16rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-\[18px\]{width:18px}.w-\[380px\]{width:380px}.w-full{width:100%}.min-w-0{min-width:0px}.max-w-\[1240px\]{max-width:1240px}.max-w-\[1280px\]{max-width:1280px}.max-w-\[220px\]{max-width:220px}.max-w-\[280px\]{max-width:280px}.max-w-\[360px\]{max-width:360px}.max-w-\[420px\]{max-width:420px}.max-w-\[520px\]{max-width:520px}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.translate-x-1{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-6{--tw-translate-x: 1.5rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-pointer{cursor:pointer}.select-all{-webkit-user-select:all;-moz-user-select:all;user-select:all}.resize-none{resize:none}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-\[1\.6fr_1fr\]{grid-template-columns:1.6fr 1fr}.grid-cols-\[210px_1fr\]{grid-template-columns:210px 1fr}.grid-cols-\[248px_1fr\]{grid-template-columns:248px 1fr}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-between{justify-content:space-between}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.gap-6{gap:1.5rem}.gap-x-8{-moz-column-gap:2rem;column-gap:2rem}.gap-y-1\.5{row-gap:.375rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.break-all{word-break:break-all}.rounded,.rounded-\[10px\]{border-radius:10px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:14px}.rounded-md{border-radius:.375rem}.border{border-width:1px}.border-y{border-top-width:1px;border-bottom-width:1px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-r{border-right-width:1px}.border-none{border-style:none}.border-accent{border-color:var(--accent)}.border-line{border-color:var(--border)}.border-line-strong{border-color:var(--border-strong)}.border-transparent{border-color:transparent}.bg-\[var\(--navy-800\)\]{background-color:var(--navy-800)}.bg-accent{background-color:var(--accent)}.bg-accent-soft{background-color:var(--accent-soft)}.bg-amber{background-color:var(--warning)}.bg-amber-soft{background-color:var(--warning-soft)}.bg-caution{background-color:var(--warning)}.bg-current{background-color:currentColor}.bg-danger{background-color:var(--danger)}.bg-danger-soft{background-color:var(--danger-soft)}.bg-ink-muted{background-color:var(--text-tertiary)}.bg-line{background-color:var(--border)}.bg-ready,.bg-success{background-color:var(--success)}.bg-success-soft{background-color:var(--success-soft)}.bg-surface-1{background-color:var(--surface)}.bg-surface-2{background-color:var(--surface-2)}.bg-transparent{background-color:transparent}.bg-warning{background-color:var(--danger)}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-0\.5{padding:.125rem}.p-10{padding:2.5rem}.p-16{padding:4rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-7{padding:1.75rem}.p-8{padding:2rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-3\.5{padding-left:.875rem;padding-right:.875rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-7{padding-left:1.75rem;padding-right:1.75rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-16{padding-top:4rem;padding-bottom:4rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-3\.5{padding-top:.875rem;padding-bottom:.875rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.pb-4{padding-bottom:1rem}.pb-5{padding-bottom:1.25rem}.pb-8{padding-bottom:2rem}.pr-10{padding-right:2.5rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:Space Mono,ui-monospace,SF Mono,JetBrains Mono,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-\[10\.5px\]{font-size:10.5px}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[13px\]{font-size:13px}.text-\[19px\]{font-size:19px}.text-\[22px\]{font-size:22px}.text-\[30px\]{font-size:30px}.text-\[34px\]{font-size:34px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-mode{font-size:18px;line-height:1.2;letter-spacing:-.02em;font-weight:600}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.leading-none{line-height:1}.leading-tight{line-height:1.25}.tracking-\[0\.3em\]{letter-spacing:.3em}.tracking-caps{letter-spacing:.14em}.tracking-tightest{letter-spacing:-.02em}.text-accent{color:var(--accent)}.text-accent-soft-fg{color:var(--accent-soft-fg)}.text-amber-fg{color:var(--warning-fg)}.text-danger-fg{color:var(--danger-fg)}.text-ink{color:var(--text-primary)}.text-ink-muted{color:var(--text-tertiary)}.text-ink-secondary{color:var(--text-secondary)}.text-success-fg{color:var(--success-fg)}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.accent-\[var\(--accent\)\]{accent-color:var(--accent)}.accent-\[var\(--danger\)\]{accent-color:var(--danger)}.opacity-60{opacity:.6}.shadow-md{--tw-shadow: var(--shadow-md);--tw-shadow-colored: var(--shadow-md);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: var(--shadow-sm);--tw-shadow-colored: var(--shadow-sm);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xs{--tw-shadow: var(--shadow-xs);--tw-shadow-colored: var(--shadow-xs);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.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)}.filter{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)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}html,body,#app{height:100%}html{background-color:var(--bg-app);transition:background-color var(--dur-base) var(--ease-standard)}body{font-family:Space Grotesk,ui-sans-serif,system-ui,-apple-system,Segoe UI,sans-serif;color:var(--text-primary);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#app{background-color:var(--bg-app);min-height:100vh;transition:background-color var(--dur-base) var(--ease-standard)}html.reduce-motion *,html.reduce-motion *:before,html.reduce-motion *:after{transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important}.leaflet-container{background:var(--surface-inset);font-family:var(--font-sans)}.leaflet-control-attribution{background:color-mix(in srgb,var(--surface) 82%,transparent)!important;color:var(--text-tertiary)!important}.leaflet-control-attribution a{color:var(--text-secondary)!important}.placeholder\:text-ink-muted::-moz-placeholder{color:var(--text-tertiary)}.placeholder\:text-ink-muted::placeholder{color:var(--text-tertiary)}.first\:mt-0:first-child{margin-top:0}.last\:border-0:last-child{border-width:0px}.hover\:border-line-strong:hover{border-color:var(--border-strong)}.hover\:bg-danger-soft:hover{background-color:var(--danger-soft)}.hover\:bg-surface-2:hover{background-color:var(--surface-2)}.hover\:text-ink:hover{color:var(--text-primary)}.hover\:text-ink-secondary:hover{color:var(--text-secondary)}.hover\:underline:hover{text-decoration-line:underline}.hover\:brightness-110:hover{--tw-brightness: brightness(1.1);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)}.enabled\:hover\:brightness-110:hover:enabled{--tw-brightness: brightness(1.1);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)}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}@media(max-width:1100px){.max-\[1100px\]\:hidden{display:none}.max-\[1100px\]\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.max-\[1100px\]\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:900px){.max-\[900px\]\:hidden{display:none}.max-\[900px\]\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.max-\[900px\]\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:820px){.max-\[820px\]\:col-span-1{grid-column:span 1 / span 1}.max-\[820px\]\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}}@media(max-width:760px){.max-\[760px\]\:col-span-1{grid-column:span 1 / span 1}.max-\[760px\]\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.max-\[760px\]\:flex-row{flex-direction:row}.max-\[760px\]\:overflow-x-auto{overflow-x:auto}}@media(max-width:560px){.max-\[560px\]\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}}@media(min-width:640px){.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:justify-between{justify-content:space-between}}.fade-enter-active[data-v-4fe25eb7],.fade-leave-active[data-v-4fe25eb7]{transition:opacity .2s}.fade-enter-from[data-v-4fe25eb7],.fade-leave-to[data-v-4fe25eb7]{opacity:0} diff --git a/Web App/server/dist/assets/index-DLbqB6QP.js b/Web App/server/dist/assets/index-DLbqB6QP.js deleted file mode 100644 index 583b32f..0000000 --- a/Web App/server/dist/assets/index-DLbqB6QP.js +++ /dev/null @@ -1,20 +0,0 @@ -(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))a(l);new MutationObserver(l=>{for(const d of l)if(d.type==="childList")for(const h of d.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&a(h)}).observe(document,{childList:!0,subtree:!0});function o(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 a(l){if(l.ep)return;l.ep=!0;const d=o(l);fetch(l.href,d)}})();/** -* @vue/shared v3.5.39 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/function ya(e){const i=Object.create(null);for(const o of e.split(","))i[o]=1;return o=>o in i}const ue={},vs=[],Zn=()=>{},su=()=>!1,ur=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),cr=e=>e.startsWith("onUpdate:"),Oe=Object.assign,ba=(e,i)=>{const o=e.indexOf(i);o>-1&&e.splice(o,1)},Qc=Object.prototype.hasOwnProperty,ee=(e,i)=>Qc.call(e,i),wt=Array.isArray,ys=e=>po(e)==="[object Map]",Ls=e=>po(e)==="[object Set]",sl=e=>po(e)==="[object Date]",Dt=e=>typeof e=="function",be=e=>typeof e=="string",Cn=e=>typeof e=="symbol",ne=e=>e!==null&&typeof e=="object",ou=e=>(ne(e)||Dt(e))&&Dt(e.then)&&Dt(e.catch),ru=Object.prototype.toString,po=e=>ru.call(e),td=e=>po(e).slice(8,-1),au=e=>po(e)==="[object Object]",xa=e=>be(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Xs=ya(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),dr=e=>{const i=Object.create(null);return(o=>i[o]||(i[o]=e(o)))},ed=/-\w/g,Tn=dr(e=>e.replace(ed,i=>i.slice(1).toUpperCase())),nd=/\B([A-Z])/g,Li=dr(e=>e.replace(nd,"-$1").toLowerCase()),lu=dr(e=>e.charAt(0).toUpperCase()+e.slice(1)),Wr=dr(e=>e?`on${lu(e)}`:""),Vn=(e,i)=>!Object.is(e,i),qo=(e,...i)=>{for(let o=0;o{Object.defineProperty(e,i,{configurable:!0,enumerable:!1,writable:a,value:o})},fr=e=>{const i=parseFloat(e);return isNaN(i)?e:i},id=e=>{const i=be(e)?Number(e):NaN;return isNaN(i)?e:i};let ol;const hr=()=>ol||(ol=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Ss(e){if(wt(e)){const i={};for(let o=0;o{if(o){const a=o.split(od);a.length>1&&(i[a[0].trim()]=a[1].trim())}}),i}function Ct(e){let i="";if(be(e))i=e;else if(wt(e))for(let o=0;oSi(o,i))}const du=e=>!!(e&&e.__v_isRef===!0),P=e=>be(e)?e:e==null?"":wt(e)||ne(e)&&(e.toString===ru||!Dt(e.toString))?du(e)?P(e.value):JSON.stringify(e,fu,2):String(e),fu=(e,i)=>du(i)?fu(e,i.value):ys(i)?{[`Map(${i.size})`]:[...i.entries()].reduce((o,[a,l],d)=>(o[Kr(a,d)+" =>"]=l,o),{})}:Ls(i)?{[`Set(${i.size})`]:[...i.values()].map(o=>Kr(o))}:Cn(i)?Kr(i):ne(i)&&!wt(i)&&!au(i)?String(i):i,Kr=(e,i="")=>{var o;return Cn(e)?`Symbol(${(o=e.description)!=null?o:i})`:e};/** -* @vue/reactivity v3.5.39 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/let Ae;class dd{constructor(i=!1){this.detached=i,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!i&&Ae&&(Ae.active?(this.parent=Ae,this.index=(Ae.scopes||(Ae.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let i,o;if(this.scopes)for(i=0,o=this.scopes.length;i0&&--this._on===0){if(Ae===this)Ae=this.prevScope;else{let i=Ae;for(;i;){if(i.prevScope===this){i.prevScope=this.prevScope;break}i=i.prevScope}}this.prevScope=void 0}}stop(i){if(this._active){this._active=!1;let o,a;for(o=0,a=this.effects.length;o0)return;if(to){let i=to;for(to=void 0;i;){const o=i.next;i.next=void 0,i.flags&=-9,i=o}}let e;for(;Qs;){let i=Qs;for(Qs=void 0;i;){const o=i.next;if(i.next=void 0,i.flags&=-9,i.flags&1)try{i.trigger()}catch(a){e||(e=a)}i=o}}if(e)throw e}function gu(e){for(let i=e.deps;i;i=i.nextDep)i.version=-1,i.prevActiveLink=i.dep.activeLink,i.dep.activeLink=i}function _u(e){let i,o=e.depsTail,a=o;for(;a;){const l=a.prevDep;a.version===-1?(a===o&&(o=l),Pa(a),hd(a)):i=a,a.dep.activeLink=a.prevActiveLink,a.prevActiveLink=void 0,a=l}e.deps=i,e.depsTail=o}function sa(e){for(let i=e.deps;i;i=i.nextDep)if(i.dep.version!==i.version||i.dep.computed&&(vu(i.dep.computed)||i.dep.version!==i.version))return!0;return!!e._dirty}function vu(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===oo)||(e.globalVersion=oo,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!sa(e))))return;e.flags|=2;const i=e.dep,o=fe,a=Ln;fe=e,Ln=!0;try{gu(e);const l=e.fn(e._value);(i.version===0||Vn(l,e._value))&&(e.flags|=128,e._value=l,i.version++)}catch(l){throw i.version++,l}finally{fe=o,Ln=a,_u(e),e.flags&=-3}}function Pa(e,i=!1){const{dep:o,prevSub:a,nextSub:l}=e;if(a&&(a.nextSub=l,e.prevSub=void 0),l&&(l.prevSub=a,e.nextSub=void 0),o.subs===e&&(o.subs=a,!a&&o.computed)){o.computed.flags&=-5;for(let d=o.computed.deps;d;d=d.nextDep)Pa(d,!0)}!i&&!--o.sc&&o.map&&o.map.delete(o.key)}function hd(e){const{prevDep:i,nextDep:o}=e;i&&(i.nextDep=o,e.prevDep=void 0),o&&(o.prevDep=i,e.nextDep=void 0)}let Ln=!0;const yu=[];function Un(){yu.push(Ln),Ln=!1}function Hn(){const e=yu.pop();Ln=e===void 0?!0:e}function rl(e){const{cleanup:i}=e;if(e.cleanup=void 0,i){const o=fe;fe=void 0;try{i()}finally{fe=o}}}let oo=0;class pd{constructor(i,o){this.sub=i,this.dep=o,this.version=o.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Ta{constructor(i){this.computed=i,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(i){if(!fe||!Ln||fe===this.computed)return;let o=this.activeLink;if(o===void 0||o.sub!==fe)o=this.activeLink=new pd(fe,this),fe.deps?(o.prevDep=fe.depsTail,fe.depsTail.nextDep=o,fe.depsTail=o):fe.deps=fe.depsTail=o,bu(o);else if(o.version===-1&&(o.version=this.version,o.nextDep)){const a=o.nextDep;a.prevDep=o.prevDep,o.prevDep&&(o.prevDep.nextDep=a),o.prevDep=fe.depsTail,o.nextDep=void 0,fe.depsTail.nextDep=o,fe.depsTail=o,fe.deps===o&&(fe.deps=a)}return o}trigger(i){this.version++,oo++,this.notify(i)}notify(i){ka();try{for(let o=this.subs;o;o=o.prevSub)o.sub.notify()&&o.sub.dep.notify()}finally{Sa()}}}function bu(e){if(e.dep.sc++,e.sub.flags&4){const i=e.dep.computed;if(i&&!e.dep.subs){i.flags|=20;for(let a=i.deps;a;a=a.nextDep)bu(a)}const o=e.dep.subs;o!==e&&(e.prevSub=o,o&&(o.nextSub=e)),e.dep.subs=e}}const oa=new WeakMap,Ki=Symbol(""),ra=Symbol(""),ro=Symbol("");function De(e,i,o){if(Ln&&fe){let a=oa.get(e);a||oa.set(e,a=new Map);let l=a.get(o);l||(a.set(o,l=new Ta),l.map=a,l.key=o),l.track()}}function oi(e,i,o,a,l,d){const h=oa.get(e);if(!h){oo++;return}const _=y=>{y&&y.trigger()};if(ka(),i==="clear")h.forEach(_);else{const y=wt(e),T=y&&xa(o);if(y&&o==="length"){const w=Number(a);h.forEach((A,U)=>{(U==="length"||U===ro||!Cn(U)&&U>=w)&&_(A)})}else switch((o!==void 0||h.has(void 0))&&_(h.get(o)),T&&_(h.get(ro)),i){case"add":y?T&&_(h.get("length")):(_(h.get(Ki)),ys(e)&&_(h.get(ra)));break;case"delete":y||(_(h.get(Ki)),ys(e)&&_(h.get(ra)));break;case"set":ys(e)&&_(h.get(Ki));break}}Sa()}function gs(e){const i=Xt(e);return i===e?i:(De(i,"iterate",ro),mn(e)?i:i.map(Mn))}function pr(e){return De(e=Xt(e),"iterate",ro),e}function Fn(e,i){return li(e)?Ps(Gi(e)?Mn(i):i):Mn(i)}const md={__proto__:null,[Symbol.iterator](){return qr(this,Symbol.iterator,e=>Fn(this,e))},concat(...e){return gs(this).concat(...e.map(i=>wt(i)?gs(i):i))},entries(){return qr(this,"entries",e=>(e[1]=Fn(this,e[1]),e))},every(e,i){return ei(this,"every",e,i,void 0,arguments)},filter(e,i){return ei(this,"filter",e,i,o=>o.map(a=>Fn(this,a)),arguments)},find(e,i){return ei(this,"find",e,i,o=>Fn(this,o),arguments)},findIndex(e,i){return ei(this,"findIndex",e,i,void 0,arguments)},findLast(e,i){return ei(this,"findLast",e,i,o=>Fn(this,o),arguments)},findLastIndex(e,i){return ei(this,"findLastIndex",e,i,void 0,arguments)},forEach(e,i){return ei(this,"forEach",e,i,void 0,arguments)},includes(...e){return Yr(this,"includes",e)},indexOf(...e){return Yr(this,"indexOf",e)},join(e){return gs(this).join(e)},lastIndexOf(...e){return Yr(this,"lastIndexOf",e)},map(e,i){return ei(this,"map",e,i,void 0,arguments)},pop(){return js(this,"pop")},push(...e){return js(this,"push",e)},reduce(e,...i){return al(this,"reduce",e,i)},reduceRight(e,...i){return al(this,"reduceRight",e,i)},shift(){return js(this,"shift")},some(e,i){return ei(this,"some",e,i,void 0,arguments)},splice(...e){return js(this,"splice",e)},toReversed(){return gs(this).toReversed()},toSorted(e){return gs(this).toSorted(e)},toSpliced(...e){return gs(this).toSpliced(...e)},unshift(...e){return js(this,"unshift",e)},values(){return qr(this,"values",e=>Fn(this,e))}};function qr(e,i,o){const a=pr(e),l=a[i]();return a!==e&&!mn(e)&&(l._next=l.next,l.next=()=>{const d=l._next();return d.done||(d.value=o(d.value)),d}),l}const gd=Array.prototype;function ei(e,i,o,a,l,d){const h=pr(e),_=h!==e&&!mn(e),y=h[i];if(y!==gd[i]){const A=y.apply(e,d);return _?Mn(A):A}let T=o;h!==e&&(_?T=function(A,U){return o.call(this,Fn(e,A),U,e)}:o.length>2&&(T=function(A,U){return o.call(this,A,U,e)}));const w=y.call(h,T,a);return _&&l?l(w):w}function al(e,i,o,a){const l=pr(e),d=l!==e&&!mn(e);let h=o,_=!1;l!==e&&(d?(_=a.length===0,h=function(T,w,A){return _&&(_=!1,T=Fn(e,T)),o.call(this,T,Fn(e,w),A,e)}):o.length>3&&(h=function(T,w,A){return o.call(this,T,w,A,e)}));const y=l[i](h,...a);return _?Fn(e,y):y}function Yr(e,i,o){const a=Xt(e);De(a,"iterate",ro);const l=a[i](...o);return(l===-1||l===!1)&&Ma(o[0])?(o[0]=Xt(o[0]),a[i](...o)):l}function js(e,i,o=[]){Un(),ka();const a=Xt(e)[i].apply(e,o);return Sa(),Hn(),a}const _d=ya("__proto__,__v_isRef,__isVue"),xu=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Cn));function vd(e){Cn(e)||(e=String(e));const i=Xt(this);return De(i,"has",e),i.hasOwnProperty(e)}class wu{constructor(i=!1,o=!1){this._isReadonly=i,this._isShallow=o}get(i,o,a){if(o==="__v_skip")return i.__v_skip;const l=this._isReadonly,d=this._isShallow;if(o==="__v_isReactive")return!l;if(o==="__v_isReadonly")return l;if(o==="__v_isShallow")return d;if(o==="__v_raw")return a===(l?d?Cd:Tu:d?Pu:Su).get(i)||Object.getPrototypeOf(i)===Object.getPrototypeOf(a)?i:void 0;const h=wt(i);if(!l){let y;if(h&&(y=md[o]))return y;if(o==="hasOwnProperty")return vd}const _=Reflect.get(i,o,Fe(i)?i:a);if((Cn(o)?xu.has(o):_d(o))||(l||De(i,"get",o),d))return _;if(Fe(_)){const y=h&&xa(o)?_:_.value;return l&&ne(y)?la(y):y}return ne(_)?l?la(_):xe(_):_}}class ku extends wu{constructor(i=!1){super(!1,i)}set(i,o,a,l){let d=i[o];const h=wt(i)&&xa(o);if(!this._isShallow){const T=li(d);if(!mn(a)&&!li(a)&&(d=Xt(d),a=Xt(a)),!h&&Fe(d)&&!Fe(a))return T||(d.value=a),!0}const _=h?Number(o)e,Uo=e=>Reflect.getPrototypeOf(e);function kd(e,i,o){return function(...a){const l=this.__v_raw,d=Xt(l),h=ys(d),_=e==="entries"||e===Symbol.iterator&&h,y=e==="keys"&&h,T=l[e](...a),w=o?aa:i?Ps:Mn;return!i&&De(d,"iterate",y?ra:Ki),Oe(Object.create(T),{next(){const{value:A,done:U}=T.next();return U?{value:A,done:U}:{value:_?[w(A[0]),w(A[1])]:w(A),done:U}}})}}function Ho(e){return function(...i){return e==="delete"?!1:e==="clear"?void 0:this}}function Sd(e,i){const o={get(l){const d=this.__v_raw,h=Xt(d),_=Xt(l);e||(Vn(l,_)&&De(h,"get",l),De(h,"get",_));const{has:y}=Uo(h),T=i?aa:e?Ps:Mn;if(y.call(h,l))return T(d.get(l));if(y.call(h,_))return T(d.get(_));d!==h&&d.get(l)},get size(){const l=this.__v_raw;return!e&&De(Xt(l),"iterate",Ki),l.size},has(l){const d=this.__v_raw,h=Xt(d),_=Xt(l);return e||(Vn(l,_)&&De(h,"has",l),De(h,"has",_)),l===_?d.has(l):d.has(l)||d.has(_)},forEach(l,d){const h=this,_=h.__v_raw,y=Xt(_),T=i?aa:e?Ps:Mn;return!e&&De(y,"iterate",Ki),_.forEach((w,A)=>l.call(d,T(w),T(A),h))}};return Oe(o,e?{add:Ho("add"),set:Ho("set"),delete:Ho("delete"),clear:Ho("clear")}:{add(l){const d=Xt(this),h=Uo(d),_=Xt(l),y=!i&&!mn(l)&&!li(l)?_:l;return h.has.call(d,y)||Vn(l,y)&&h.has.call(d,l)||Vn(_,y)&&h.has.call(d,_)||(d.add(y),oi(d,"add",y,y)),this},set(l,d){!i&&!mn(d)&&!li(d)&&(d=Xt(d));const h=Xt(this),{has:_,get:y}=Uo(h);let T=_.call(h,l);T||(l=Xt(l),T=_.call(h,l));const w=y.call(h,l);return h.set(l,d),T?Vn(d,w)&&oi(h,"set",l,d):oi(h,"add",l,d),this},delete(l){const d=Xt(this),{has:h,get:_}=Uo(d);let y=h.call(d,l);y||(l=Xt(l),y=h.call(d,l)),_&&_.call(d,l);const T=d.delete(l);return y&&oi(d,"delete",l,void 0),T},clear(){const l=Xt(this),d=l.size!==0,h=l.clear();return d&&oi(l,"clear",void 0,void 0),h}}),["keys","values","entries",Symbol.iterator].forEach(l=>{o[l]=kd(l,e,i)}),o}function La(e,i){const o=Sd(e,i);return(a,l,d)=>l==="__v_isReactive"?!e:l==="__v_isReadonly"?e:l==="__v_raw"?a:Reflect.get(ee(o,l)&&l in a?o:a,l,d)}const Pd={get:La(!1,!1)},Td={get:La(!1,!0)},Ld={get:La(!0,!1)};const Su=new WeakMap,Pu=new WeakMap,Tu=new WeakMap,Cd=new WeakMap;function Md(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function xe(e){return li(e)?e:Ca(e,!1,bd,Pd,Su)}function Od(e){return Ca(e,!1,wd,Td,Pu)}function la(e){return Ca(e,!0,xd,Ld,Tu)}function Ca(e,i,o,a,l){if(!ne(e)||e.__v_raw&&!(i&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const d=l.get(e);if(d)return d;const h=Md(td(e));if(h===0)return e;const _=new Proxy(e,h===2?a:o);return l.set(e,_),_}function Gi(e){return li(e)?Gi(e.__v_raw):!!(e&&e.__v_isReactive)}function li(e){return!!(e&&e.__v_isReadonly)}function mn(e){return!!(e&&e.__v_isShallow)}function Ma(e){return e?!!e.__v_raw:!1}function Xt(e){const i=e&&e.__v_raw;return i?Xt(i):e}function Ed(e){return!ee(e,"__v_skip")&&Object.isExtensible(e)&&uu(e,"__v_skip",!0),e}const Mn=e=>ne(e)?xe(e):e,Ps=e=>ne(e)?la(e):e;function Fe(e){return e?e.__v_isRef===!0:!1}function G(e){return zd(e,!1)}function zd(e,i){return Fe(e)?e:new Ad(e,i)}class Ad{constructor(i,o){this.dep=new Ta,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=o?i:Xt(i),this._value=o?i:Mn(i),this.__v_isShallow=o}get value(){return this.dep.track(),this._value}set value(i){const o=this._rawValue,a=this.__v_isShallow||mn(i)||li(i);i=a?i:Xt(i),Vn(i,o)&&(this._rawValue=i,this._value=a?i:Mn(i),this.dep.trigger())}}function $t(e){return Fe(e)?e.value:e}const Id={get:(e,i,o)=>i==="__v_raw"?e:$t(Reflect.get(e,i,o)),set:(e,i,o,a)=>{const l=e[i];return Fe(l)&&!Fe(o)?(l.value=o,!0):Reflect.set(e,i,o,a)}};function Lu(e){return Gi(e)?e:new Proxy(e,Id)}class $d{constructor(i,o,a){this.fn=i,this.setter=o,this._value=void 0,this.dep=new Ta(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=oo-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!o,this.isSSR=a}notify(){if(this.flags|=16,!(this.flags&8)&&fe!==this)return mu(this,!0),!0}get value(){const i=this.dep.track();return vu(this),i&&(i.version=this.dep.version),this._value}set value(i){this.setter&&this.setter(i)}}function Dd(e,i,o=!1){let a,l;return Dt(e)?a=e:(a=e.get,l=e.set),new $d(a,l,o)}const jo={},Jo=new WeakMap;let ji;function Nd(e,i=!1,o=ji){if(o){let a=Jo.get(o);a||Jo.set(o,a=[]),a.push(e)}}function Rd(e,i,o=ue){const{immediate:a,deep:l,once:d,scheduler:h,augmentJob:_,call:y}=o,T=it=>l?it:mn(it)||l===!1||l===0?ri(it,1):ri(it);let w,A,U,V,rt=!1,Q=!1;if(Fe(e)?(A=()=>e.value,rt=mn(e)):Gi(e)?(A=()=>T(e),rt=!0):wt(e)?(Q=!0,rt=e.some(it=>Gi(it)||mn(it)),A=()=>e.map(it=>{if(Fe(it))return it.value;if(Gi(it))return T(it);if(Dt(it))return y?y(it,2):it()})):Dt(e)?i?A=y?()=>y(e,2):e:A=()=>{if(U){Un();try{U()}finally{Hn()}}const it=ji;ji=w;try{return y?y(e,3,[V]):e(V)}finally{ji=it}}:A=Zn,i&&l){const it=A,ht=l===!0?1/0:l;A=()=>ri(it(),ht)}const Ot=fd(),Mt=()=>{w.stop(),Ot&&Ot.active&&ba(Ot.effects,w)};if(d&&i){const it=i;i=(...ht)=>{const Kt=it(...ht);return Mt(),Kt}}let q=Q?new Array(e.length).fill(jo):jo;const dt=it=>{if(!(!(w.flags&1)||!w.dirty&&!it))if(i){const ht=w.run();if(it||l||rt||(Q?ht.some((Kt,he)=>Vn(Kt,q[he])):Vn(ht,q))){U&&U();const Kt=ji;ji=w;try{const he=[ht,q===jo?void 0:Q&&q[0]===jo?[]:q,V];q=ht,y?y(i,3,he):i(...he)}finally{ji=Kt}}}else w.run()};return _&&_(dt),w=new hu(A),w.scheduler=h?()=>h(dt,!1):dt,V=it=>Nd(it,!1,w),U=w.onStop=()=>{const it=Jo.get(w);if(it){if(y)y(it,4);else for(const ht of it)ht();Jo.delete(w)}},i?a?dt(!0):q=w.run():h?h(dt.bind(null,!0),!0):w.run(),Mt.pause=w.pause.bind(w),Mt.resume=w.resume.bind(w),Mt.stop=Mt,Mt}function ri(e,i=1/0,o){if(i<=0||!ne(e)||e.__v_skip||(o=o||new Map,(o.get(e)||0)>=i))return e;if(o.set(e,i),i--,Fe(e))ri(e.value,i,o);else if(wt(e))for(let a=0;a{ri(a,i,o)});else if(au(e)){for(const a in e)ri(e[a],i,o);for(const a of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,a)&&ri(e[a],i,o)}return e}/** -* @vue/runtime-core v3.5.39 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/function mo(e,i,o,a){try{return a?e(...a):e()}catch(l){mr(l,i,o)}}function _n(e,i,o,a){if(Dt(e)){const l=mo(e,i,o,a);return l&&ou(l)&&l.catch(d=>{mr(d,i,o)}),l}if(wt(e)){const l=[];for(let d=0;d>>1,l=We[a],d=ao(l);d=ao(o)?We.push(e):We.splice(Bd(i),0,e),e.flags|=1,Ou()}}function Ou(){Xo||(Xo=Cu.then(zu))}function Vd(e){wt(e)?bs.push(...e):ki&&e.id===-1?ki.splice(_s+1,0,e):e.flags&1||(bs.push(e),e.flags|=1),Ou()}function ll(e,i,o=Rn+1){for(;oao(o)-ao(a));if(bs.length=0,ki){ki.push(...i);return}for(ki=i,_s=0;_se.id==null?e.flags&2?-1:1/0:e.id;function zu(e){try{for(Rn=0;Rn{a._d&&nr(-1);const d=Qo(i);let h;try{h=e(...l)}finally{Qo(d),a._d&&nr(1)}return h};return a._n=!0,a._c=!0,a._d=!0,a}function ot(e,i){if(Re===null)return e;const o=xr(Re),a=e.dirs||(e.dirs=[]);for(let l=0;l1)return o&&Dt(i)?i.call(a&&a.proxy):i}}const Zd=Symbol.for("v-scx"),Ud=()=>eo(Zd);function Qe(e,i,o){return $u(e,i,o)}function $u(e,i,o=ue){const{immediate:a,deep:l,flush:d,once:h}=o,_=Oe({},o),y=i&&a||!i&&d!=="post";let T;if(fo){if(d==="sync"){const V=Ud();T=V.__watcherHandles||(V.__watcherHandles=[])}else if(!y){const V=()=>{};return V.stop=Zn,V.resume=Zn,V.pause=Zn,V}}const w=Ke;_.call=(V,rt,Q)=>_n(V,w,rt,Q);let A=!1;d==="post"?_.scheduler=V=>{Xe(V,w&&w.suspense)}:d!=="sync"&&(A=!0,_.scheduler=(V,rt)=>{rt?V():Oa(V)}),_.augmentJob=V=>{i&&(V.flags|=4),A&&(V.flags|=2,w&&(V.id=w.uid,V.i=w))};const U=Rd(e,i,_);return fo&&(T?T.push(U):y&&U()),U}function Hd(e,i,o){const a=this.proxy,l=be(e)?e.includes(".")?Du(a,e):()=>a[e]:e.bind(a,a);let d;Dt(i)?d=i:(d=i.handler,o=i);const h=go(this),_=$u(l,d.bind(a),o);return h(),_}function Du(e,i){const o=i.split(".");return()=>{let a=e;for(let l=0;le.__isTeleport,pn=Symbol("_leaveCb"),Ws=Symbol("_enterCb");function Wd(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Yi(()=>{e.isMounted=!0}),vr(()=>{e.isUnmounting=!0}),e}const fn=[Function,Array],Ru={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:fn,onEnter:fn,onAfterEnter:fn,onEnterCancelled:fn,onBeforeLeave:fn,onLeave:fn,onAfterLeave:fn,onLeaveCancelled:fn,onBeforeAppear:fn,onAppear:fn,onAfterAppear:fn,onAppearCancelled:fn},Fu=e=>{const i=e.subTree;return i.component?Fu(i.component):i},Kd={name:"BaseTransition",props:Ru,setup(e,{slots:i}){const o=fc(),a=Wd();return()=>{const l=i.default&&Zu(i.default(),!0),d=l&&l.length?Bu(l):o.subTree?N():void 0;if(!d)return;const h=Xt(e),{mode:_}=h;if(a.isLeaving)return Jr(d);const y=ul(d);if(!y)return Jr(d);let T=ua(y,h,a,o,A=>T=A);y.type!==Ne&&lo(y,T);let w=o.subTree&&ul(o.subTree);if(w&&w.type!==Ne&&!Wi(w,y)&&Fu(o).type!==Ne){let A=ua(w,h,a,o);if(lo(w,A),_==="out-in"&&y.type!==Ne)return a.isLeaving=!0,A.afterLeave=()=>{a.isLeaving=!1,o.job.flags&8||o.update(),delete A.afterLeave,w=void 0},Jr(d);_==="in-out"&&y.type!==Ne?A.delayLeave=(U,V,rt)=>{const Q=Vu(a,w);Q[String(w.key)]=w,U[pn]=()=>{V(),U[pn]=void 0,delete T.delayedLeave,w=void 0},T.delayedLeave=()=>{rt(),delete T.delayedLeave,w=void 0}}:w=void 0}else w&&(w=void 0);return d}}};function Bu(e){let i=e[0];if(e.length>1){for(const o of e)if(o.type!==Ne){i=o;break}}return i}const Gd=Kd;function Vu(e,i){const{leavingVNodes:o}=e;let a=o.get(i.type);return a||(a=Object.create(null),o.set(i.type,a)),a}function ua(e,i,o,a,l){const{appear:d,mode:h,persisted:_=!1,onBeforeEnter:y,onEnter:T,onAfterEnter:w,onEnterCancelled:A,onBeforeLeave:U,onLeave:V,onAfterLeave:rt,onLeaveCancelled:Q,onBeforeAppear:Ot,onAppear:Mt,onAfterAppear:q,onAppearCancelled:dt}=i,it=String(e.key),ht=Vu(o,e),Kt=(St,Nt)=>{St&&_n(St,a,9,Nt)},he=(St,Nt)=>{const Et=Nt[1];Kt(St,Nt),wt(St)?St.every(nt=>nt.length<=1)&&Et():St.length<=1&&Et()},pe={mode:h,persisted:_,beforeEnter(St){let Nt=y;if(!o.isMounted)if(d)Nt=Ot||y;else return;St[pn]&&St[pn](!0);const Et=ht[it];Et&&Wi(e,Et)&&Et.el[pn]&&Et.el[pn](),Kt(Nt,[St])},enter(St){if(ht[it]===e)return;let Nt=T,Et=w,nt=A;if(!o.isMounted)if(d)Nt=Mt||T,Et=q||w,nt=dt||A;else return;let ut=!1;St[Ws]=Ft=>{ut||(ut=!0,Ft?Kt(nt,[St]):Kt(Et,[St]),pe.delayedLeave&&pe.delayedLeave(),St[Ws]=void 0)};const zt=St[Ws].bind(null,!1);Nt?he(Nt,[St,zt]):zt()},leave(St,Nt){const Et=String(e.key);if(St[Ws]&&St[Ws](!0),o.isUnmounting)return Nt();Kt(U,[St]);let nt=!1;St[pn]=zt=>{nt||(nt=!0,Nt(),zt?Kt(Q,[St]):Kt(rt,[St]),St[pn]=void 0,ht[Et]===e&&delete ht[Et])};const ut=St[pn].bind(null,!1);ht[Et]=e,V?he(V,[St,ut]):ut()},clone(St){const Nt=ua(St,i,o,a,l);return l&&l(Nt),Nt}};return pe}function Jr(e){if(gr(e))return e=Pi(e),e.children=null,e}function ul(e){if(!gr(e))return Nu(e.type)&&e.children?Bu(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:i,children:o}=e;if(o){if(i&16)return o[0];if(i&32&&Dt(o.default))return o.default()}}function lo(e,i){e.shapeFlag&6&&e.component?(e.transition=i,lo(e.component.subTree,i)):e.shapeFlag&128?(e.ssContent.transition=i.clone(e.ssContent),e.ssFallback.transition=i.clone(e.ssFallback)):e.transition=i}function Zu(e,i=!1,o){let a=[],l=0;for(let d=0;d1)for(let d=0;dno(Q,i&&(wt(i)?i[Ot]:i),o,a,l));return}if(xs(a)&&!l){a.shapeFlag&512&&a.type.__asyncResolved&&a.component.subTree.component&&no(e,i,o,a.component.subTree);return}const d=a.shapeFlag&4?xr(a.component):a.el,h=l?null:d,{i:_,r:y}=e,T=i&&i.r,w=_.refs===ue?_.refs={}:_.refs,A=_.setupState,U=Xt(A),V=A===ue?su:Q=>cl(w,Q)?!1:ee(U,Q),rt=(Q,Ot)=>!(Ot&&cl(w,Ot));if(T!=null&&T!==y){if(dl(i),be(T))w[T]=null,V(T)&&(A[T]=null);else if(Fe(T)){const Q=i;rt(T,Q.k)&&(T.value=null),Q.k&&(w[Q.k]=null)}}if(Dt(y)){Un();try{mo(y,_,12,[h,w])}finally{Hn()}}else{const Q=be(y),Ot=Fe(y);if(Q||Ot){const Mt=()=>{if(e.f){const q=Q?V(y)?A[y]:w[y]:rt()||!e.k?y.value:w[e.k];if(l)wt(q)&&ba(q,d);else if(wt(q))q.includes(d)||q.push(d);else if(Q)w[y]=[d],V(y)&&(A[y]=w[y]);else{const dt=[d];rt(y,e.k)&&(y.value=dt),e.k&&(w[e.k]=dt)}}else Q?(w[y]=h,V(y)&&(A[y]=h)):Ot&&(rt(y,e.k)&&(y.value=h),e.k&&(w[e.k]=h))};if(h){const q=()=>{Mt(),tr.delete(e)};q.id=-1,tr.set(e,q),Xe(q,o)}else dl(e),Mt()}}}function dl(e){const i=tr.get(e);i&&(i.flags|=8,tr.delete(e))}hr().requestIdleCallback;hr().cancelIdleCallback;const xs=e=>!!e.type.__asyncLoader,gr=e=>e.type.__isKeepAlive;function qd(e,i){Hu(e,"a",i)}function Yd(e,i){Hu(e,"da",i)}function Hu(e,i,o=Ke){const a=e.__wdc||(e.__wdc=()=>{let l=o;for(;l;){if(l.isDeactivated)return;l=l.parent}return e()});if(_r(i,a,o),o){let l=o.parent;for(;l&&l.parent;)gr(l.parent.vnode)&&Jd(a,i,o,l),l=l.parent}}function Jd(e,i,o,a){const l=_r(i,e,a,!0);ju(()=>{ba(a[i],l)},o)}function _r(e,i,o=Ke,a=!1){if(o){const l=o[e]||(o[e]=[]),d=i.__weh||(i.__weh=(...h)=>{Un();const _=go(o),y=_n(i,o,e,h);return _(),Hn(),y});return a?l.unshift(d):l.push(d),d}}const ui=e=>(i,o=Ke)=>{(!fo||e==="sp")&&_r(e,(...a)=>i(...a),o)},Xd=ui("bm"),Yi=ui("m"),Qd=ui("bu"),tf=ui("u"),vr=ui("bum"),ju=ui("um"),ef=ui("sp"),nf=ui("rtg"),sf=ui("rtc");function of(e,i=Ke){_r("ec",e,i)}const rf=Symbol.for("v-ndc");function Wt(e,i,o,a){let l;const d=o,h=wt(e);if(h||be(e)){const _=h&&Gi(e);let y=!1,T=!1;_&&(y=!mn(e),T=li(e),e=pr(e)),l=new Array(e.length);for(let w=0,A=e.length;wi(_,y,void 0,d));else{const _=Object.keys(e);l=new Array(_.length);for(let y=0,T=_.length;y0;return g(),ie(ct,null,[O("slot",o,a)],T?-2:64)}let d=e[i];d&&d._c&&(d._d=!1),g();const h=d&&Wu(d(o)),_=o.key||h&&h.key,y=ie(ct,{key:(_&&!Cn(_)?_:`_${i}`)+(!h&&a?"_fb":"")},h||[],h&&e._===1?64:-2);return y.scopeId&&(y.slotScopeIds=[y.scopeId+"-s"]),d&&d._c&&(d._d=!0),y}function Wu(e){return e.some(i=>co(i)?!(i.type===Ne||i.type===ct&&!Wu(i.children)):!0)?e:null}const ca=e=>e?hc(e)?xr(e):ca(e.parent):null,io=Oe(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>ca(e.parent),$root:e=>ca(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Gu(e),$forceUpdate:e=>e.f||(e.f=()=>{Oa(e.update)}),$nextTick:e=>e.n||(e.n=Mu.bind(e.proxy)),$watch:e=>Hd.bind(e)}),Xr=(e,i)=>e!==ue&&!e.__isScriptSetup&&ee(e,i),lf={get({_:e},i){if(i==="__v_skip")return!0;const{ctx:o,setupState:a,data:l,props:d,accessCache:h,type:_,appContext:y}=e;if(i[0]!=="$"){const U=h[i];if(U!==void 0)switch(U){case 1:return a[i];case 2:return l[i];case 4:return o[i];case 3:return d[i]}else{if(Xr(a,i))return h[i]=1,a[i];if(l!==ue&&ee(l,i))return h[i]=2,l[i];if(ee(d,i))return h[i]=3,d[i];if(o!==ue&&ee(o,i))return h[i]=4,o[i];da&&(h[i]=0)}}const T=io[i];let w,A;if(T)return i==="$attrs"&&De(e.attrs,"get",""),T(e);if((w=_.__cssModules)&&(w=w[i]))return w;if(o!==ue&&ee(o,i))return h[i]=4,o[i];if(A=y.config.globalProperties,ee(A,i))return A[i]},set({_:e},i,o){const{data:a,setupState:l,ctx:d}=e;return Xr(l,i)?(l[i]=o,!0):a!==ue&&ee(a,i)?(a[i]=o,!0):ee(e.props,i)||i[0]==="$"&&i.slice(1)in e?!1:(d[i]=o,!0)},has({_:{data:e,setupState:i,accessCache:o,ctx:a,appContext:l,props:d,type:h}},_){let y;return!!(o[_]||e!==ue&&_[0]!=="$"&&ee(e,_)||Xr(i,_)||ee(d,_)||ee(a,_)||ee(io,_)||ee(l.config.globalProperties,_)||(y=h.__cssModules)&&y[_])},defineProperty(e,i,o){return o.get!=null?e._.accessCache[i]=0:ee(o,"value")&&this.set(e,i,o.value,null),Reflect.defineProperty(e,i,o)}};function fl(e){return wt(e)?e.reduce((i,o)=>(i[o]=null,i),{}):e}let da=!0;function uf(e){const i=Gu(e),o=e.proxy,a=e.ctx;da=!1,i.beforeCreate&&hl(i.beforeCreate,e,"bc");const{data:l,computed:d,methods:h,watch:_,provide:y,inject:T,created:w,beforeMount:A,mounted:U,beforeUpdate:V,updated:rt,activated:Q,deactivated:Ot,beforeDestroy:Mt,beforeUnmount:q,destroyed:dt,unmounted:it,render:ht,renderTracked:Kt,renderTriggered:he,errorCaptured:pe,serverPrefetch:St,expose:Nt,inheritAttrs:Et,components:nt,directives:ut,filters:zt}=i;if(T&&cf(T,a,null),h)for(const At in h){const et=h[At];Dt(et)&&(a[At]=et.bind(o))}if(l){const At=l.call(o,o);ne(At)&&(e.data=xe(At))}if(da=!0,d)for(const At in d){const et=d[At],ce=Dt(et)?et.bind(o,o):Dt(et.get)?et.get.bind(o,o):Zn,pt=!Dt(et)&&Dt(et.set)?et.set.bind(o):Zn,kt=xt({get:ce,set:pt});Object.defineProperty(a,At,{enumerable:!0,configurable:!0,get:()=>kt.value,set:Yt=>kt.value=Yt})}if(_)for(const At in _)Ku(_[At],a,o,At);if(y){const At=Dt(y)?y.call(o):y;Reflect.ownKeys(At).forEach(et=>{Iu(et,At[et])})}w&&hl(w,e,"c");function lt(At,et){wt(et)?et.forEach(ce=>At(ce.bind(o))):et&&At(et.bind(o))}if(lt(Xd,A),lt(Yi,U),lt(Qd,V),lt(tf,rt),lt(qd,Q),lt(Yd,Ot),lt(of,pe),lt(sf,Kt),lt(nf,he),lt(vr,q),lt(ju,it),lt(ef,St),wt(Nt))if(Nt.length){const At=e.exposed||(e.exposed={});Nt.forEach(et=>{Object.defineProperty(At,et,{get:()=>o[et],set:ce=>o[et]=ce,enumerable:!0})})}else e.exposed||(e.exposed={});ht&&e.render===Zn&&(e.render=ht),Et!=null&&(e.inheritAttrs=Et),nt&&(e.components=nt),ut&&(e.directives=ut),St&&Uu(e)}function cf(e,i,o=Zn){wt(e)&&(e=fa(e));for(const a in e){const l=e[a];let d;ne(l)?"default"in l?d=eo(l.from||a,l.default,!0):d=eo(l.from||a):d=eo(l),Fe(d)?Object.defineProperty(i,a,{enumerable:!0,configurable:!0,get:()=>d.value,set:h=>d.value=h}):i[a]=d}}function hl(e,i,o){_n(wt(e)?e.map(a=>a.bind(i.proxy)):e.bind(i.proxy),i,o)}function Ku(e,i,o,a){let l=a.includes(".")?Du(o,a):()=>o[a];if(be(e)){const d=i[e];Dt(d)&&Qe(l,d)}else if(Dt(e))Qe(l,e.bind(o));else if(ne(e))if(wt(e))e.forEach(d=>Ku(d,i,o,a));else{const d=Dt(e.handler)?e.handler.bind(o):i[e.handler];Dt(d)&&Qe(l,d,e)}}function Gu(e){const i=e.type,{mixins:o,extends:a}=i,{mixins:l,optionsCache:d,config:{optionMergeStrategies:h}}=e.appContext,_=d.get(i);let y;return _?y=_:!l.length&&!o&&!a?y=i:(y={},l.length&&l.forEach(T=>er(y,T,h,!0)),er(y,i,h)),ne(i)&&d.set(i,y),y}function er(e,i,o,a=!1){const{mixins:l,extends:d}=i;d&&er(e,d,o,!0),l&&l.forEach(h=>er(e,h,o,!0));for(const h in i)if(!(a&&h==="expose")){const _=df[h]||o&&o[h];e[h]=_?_(e[h],i[h]):i[h]}return e}const df={data:pl,props:ml,emits:ml,methods:qs,computed:qs,beforeCreate:je,created:je,beforeMount:je,mounted:je,beforeUpdate:je,updated:je,beforeDestroy:je,beforeUnmount:je,destroyed:je,unmounted:je,activated:je,deactivated:je,errorCaptured:je,serverPrefetch:je,components:qs,directives:qs,watch:hf,provide:pl,inject:ff};function pl(e,i){return i?e?function(){return Oe(Dt(e)?e.call(this,this):e,Dt(i)?i.call(this,this):i)}:i:e}function ff(e,i){return qs(fa(e),fa(i))}function fa(e){if(wt(e)){const i={};for(let o=0;oi==="modelValue"||i==="model-value"?e.modelModifiers:e[`${i}Modifiers`]||e[`${Tn(i)}Modifiers`]||e[`${Li(i)}Modifiers`];function _f(e,i,...o){if(e.isUnmounted)return;const a=e.vnode.props||ue;let l=o;const d=i.startsWith("update:"),h=d&&gf(a,i.slice(7));h&&(h.trim&&(l=o.map(w=>be(w)?w.trim():w)),h.number&&(l=o.map(fr)));let _,y=a[_=Wr(i)]||a[_=Wr(Tn(i))];!y&&d&&(y=a[_=Wr(Li(i))]),y&&_n(y,e,6,l);const T=a[_+"Once"];if(T){if(!e.emitted)e.emitted={};else if(e.emitted[_])return;e.emitted[_]=!0,_n(T,e,6,l)}}const vf=new WeakMap;function Yu(e,i,o=!1){const a=o?vf:i.emitsCache,l=a.get(e);if(l!==void 0)return l;const d=e.emits;let h={},_=!1;if(!Dt(e)){const y=T=>{const w=Yu(T,i,!0);w&&(_=!0,Oe(h,w))};!o&&i.mixins.length&&i.mixins.forEach(y),e.extends&&y(e.extends),e.mixins&&e.mixins.forEach(y)}return!d&&!_?(ne(e)&&a.set(e,null),null):(wt(d)?d.forEach(y=>h[y]=null):Oe(h,d),ne(e)&&a.set(e,h),h)}function yr(e,i){return!e||!ur(i)?!1:(i=i.slice(2),i=i==="Once"?i:i.replace(/Once$/,""),ee(e,i[0].toLowerCase()+i.slice(1))||ee(e,Li(i))||ee(e,i))}function gl(e){const{type:i,vnode:o,proxy:a,withProxy:l,propsOptions:[d],slots:h,attrs:_,emit:y,render:T,renderCache:w,props:A,data:U,setupState:V,ctx:rt,inheritAttrs:Q}=e,Ot=Qo(e);let Mt,q;try{if(o.shapeFlag&4){const it=l||a,ht=it;Mt=Bn(T.call(ht,it,w,A,V,U,rt)),q=_}else{const it=i;Mt=Bn(it.length>1?it(A,{attrs:_,slots:h,emit:y}):it(A,null)),q=i.props?_:yf(_)}}catch(it){so.length=0,mr(it,e,1),Mt=O(Ne)}let dt=Mt;if(q&&Q!==!1){const it=Object.keys(q),{shapeFlag:ht}=dt;it.length&&ht&7&&(d&&it.some(cr)&&(q=bf(q,d)),dt=Pi(dt,q,!1,!0))}return o.dirs&&(dt=Pi(dt,null,!1,!0),dt.dirs=dt.dirs?dt.dirs.concat(o.dirs):o.dirs),o.transition&&lo(dt,o.transition),Mt=dt,Qo(Ot),Mt}const yf=e=>{let i;for(const o in e)(o==="class"||o==="style"||ur(o))&&((i||(i={}))[o]=e[o]);return i},bf=(e,i)=>{const o={};for(const a in e)(!cr(a)||!(a.slice(9)in i))&&(o[a]=e[a]);return o};function xf(e,i,o){const{props:a,children:l,component:d}=e,{props:h,children:_,patchFlag:y}=i,T=d.emitsOptions;if(i.dirs||i.transition)return!0;if(o&&y>=0){if(y&1024)return!0;if(y&16)return a?_l(a,h,T):!!h;if(y&8){const w=i.dynamicProps;for(let A=0;AObject.create(Xu),tc=e=>Object.getPrototypeOf(e)===Xu;function kf(e,i,o,a=!1){const l={},d=Qu();e.propsDefaults=Object.create(null),ec(e,i,l,d);for(const h in e.propsOptions[0])h in l||(l[h]=void 0);o?e.props=a?l:Od(l):e.type.props?e.props=l:e.props=d,e.attrs=d}function Sf(e,i,o,a){const{props:l,attrs:d,vnode:{patchFlag:h}}=e,_=Xt(l),[y]=e.propsOptions;let T=!1;if((a||h>0)&&!(h&16)){if(h&8){const w=e.vnode.dynamicProps;for(let A=0;A{y=!0;const[U,V]=nc(A,i,!0);Oe(h,U),V&&_.push(...V)};!o&&i.mixins.length&&i.mixins.forEach(w),e.extends&&w(e.extends),e.mixins&&e.mixins.forEach(w)}if(!d&&!y)return ne(e)&&a.set(e,vs),vs;if(wt(d))for(let w=0;we==="_"||e==="_ctx"||e==="$stable",za=e=>wt(e)?e.map(Bn):[Bn(e)],Tf=(e,i,o)=>{if(i._n)return i;const a=mt((...l)=>za(i(...l)),o);return a._c=!1,a},ic=(e,i,o)=>{const a=e._ctx;for(const l in e){if(Ea(l))continue;const d=e[l];if(Dt(d))i[l]=Tf(l,d,a);else if(d!=null){const h=za(d);i[l]=()=>h}}},sc=(e,i)=>{const o=za(i);e.slots.default=()=>o},oc=(e,i,o)=>{for(const a in i)(o||!Ea(a))&&(e[a]=i[a])},Lf=(e,i,o)=>{const a=e.slots=Qu();if(e.vnode.shapeFlag&32){const l=i._;l?(oc(a,i,o),o&&uu(a,"_",l,!0)):ic(i,a)}else i&&sc(e,i)},Cf=(e,i,o)=>{const{vnode:a,slots:l}=e;let d=!0,h=ue;if(a.shapeFlag&32){const _=i._;_?o&&_===1?d=!1:oc(l,i,o):(d=!i.$stable,ic(i,l)),h=i}else i&&(sc(e,i),h={default:1});if(d)for(const _ in l)!Ea(_)&&h[_]==null&&delete l[_]},Xe=Af;function Mf(e){return Of(e)}function Of(e,i){const o=hr();o.__VUE__=!0;const{insert:a,remove:l,patchProp:d,createElement:h,createText:_,createComment:y,setText:T,setElementText:w,parentNode:A,nextSibling:U,setScopeId:V=Zn,insertStaticContent:rt}=e,Q=(v,m,M,F=null,R=null,B=null,J=void 0,D=null,K=!!m.dynamicChildren)=>{if(v===m)return;v&&!Wi(v,m)&&(F=C(v),Yt(v,R,B,!0),v=null),m.patchFlag===-2&&(K=!1,m.dynamicChildren=null);const{type:Z,ref:yt,shapeFlag:st}=m;switch(Z){case br:Ot(v,m,M,F);break;case Ne:Mt(v,m,M,F);break;case ta:v==null&&q(m,M,F,J);break;case ct:nt(v,m,M,F,R,B,J,D,K);break;default:st&1?ht(v,m,M,F,R,B,J,D,K):st&6?ut(v,m,M,F,R,B,J,D,K):(st&64||st&128)&&Z.process(v,m,M,F,R,B,J,D,K,se)}yt!=null&&R?no(yt,v&&v.ref,B,m||v,!m):yt==null&&v&&v.ref!=null&&no(v.ref,null,B,v,!0)},Ot=(v,m,M,F)=>{if(v==null)a(m.el=_(m.children),M,F);else{const R=m.el=v.el;m.children!==v.children&&T(R,m.children)}},Mt=(v,m,M,F)=>{v==null?a(m.el=y(m.children||""),M,F):m.el=v.el},q=(v,m,M,F)=>{[v.el,v.anchor]=rt(v.children,m,M,F,v.el,v.anchor)},dt=({el:v,anchor:m},M,F)=>{let R;for(;v&&v!==m;)R=U(v),a(v,M,F),v=R;a(m,M,F)},it=({el:v,anchor:m})=>{let M;for(;v&&v!==m;)M=U(v),l(v),v=M;l(m)},ht=(v,m,M,F,R,B,J,D,K)=>{if(m.type==="svg"?J="svg":m.type==="math"&&(J="mathml"),v==null)Kt(m,M,F,R,B,J,D,K);else{const Z=v.el&&v.el._isVueCE?v.el:null;try{Z&&Z._beginPatch(),St(v,m,R,B,J,D,K)}finally{Z&&Z._endPatch()}}},Kt=(v,m,M,F,R,B,J,D)=>{let K,Z;const{props:yt,shapeFlag:st,transition:tt,dirs:bt}=v;if(K=v.el=h(v.type,B,yt&&yt.is,yt),st&8?w(K,v.children):st&16&&pe(v.children,K,null,F,R,Qr(v,B),J,D),bt&&Vi(v,null,F,"created"),he(K,v,v.scopeId,J,F),yt){for(const gt in yt)gt!=="value"&&!Xs(gt)&&d(K,gt,null,yt[gt],B,F);"value"in yt&&d(K,"value",null,yt.value,B),(Z=yt.onVnodeBeforeMount)&&Nn(Z,F,v)}bt&&Vi(v,null,F,"beforeMount");const Rt=Ef(R,tt);Rt&&tt.beforeEnter(K),a(K,m,M),((Z=yt&&yt.onVnodeMounted)||Rt||bt)&&Xe(()=>{try{Z&&Nn(Z,F,v),Rt&&tt.enter(K),bt&&Vi(v,null,F,"mounted")}finally{}},R)},he=(v,m,M,F,R)=>{if(M&&V(v,M),F)for(let B=0;B{for(let Z=K;Z{const D=m.el=v.el;let{patchFlag:K,dynamicChildren:Z,dirs:yt}=m;K|=v.patchFlag&16;const st=v.props||ue,tt=m.props||ue;let bt;if(M&&Zi(M,!1),(bt=tt.onVnodeBeforeUpdate)&&Nn(bt,M,m,v),yt&&Vi(m,v,M,"beforeUpdate"),M&&Zi(M,!0),Z&&(!v.dynamicChildren||v.dynamicChildren.length!==Z.length)&&(K=0,J=!1,Z=null),(st.innerHTML&&tt.innerHTML==null||st.textContent&&tt.textContent==null)&&w(D,""),Z?Nt(v.dynamicChildren,Z,D,M,F,Qr(m,R),B):J||et(v,m,D,null,M,F,Qr(m,R),B,!1),K>0){if(K&16)Et(D,st,tt,M,R);else if(K&2&&st.class!==tt.class&&d(D,"class",null,tt.class,R),K&4&&d(D,"style",st.style,tt.style,R),K&8){const Rt=m.dynamicProps;for(let gt=0;gt{bt&&Nn(bt,M,m,v),yt&&Vi(m,v,M,"updated")},F)},Nt=(v,m,M,F,R,B,J)=>{for(let D=0;D{if(m!==M){if(m!==ue)for(const B in m)!Xs(B)&&!(B in M)&&d(v,B,m[B],null,R,F);for(const B in M){if(Xs(B))continue;const J=M[B],D=m[B];J!==D&&B!=="value"&&d(v,B,D,J,R,F)}"value"in M&&d(v,"value",m.value,M.value,R)}},nt=(v,m,M,F,R,B,J,D,K)=>{const Z=m.el=v?v.el:_(""),yt=m.anchor=v?v.anchor:_("");let{patchFlag:st,dynamicChildren:tt,slotScopeIds:bt}=m;bt&&(D=D?D.concat(bt):bt),v==null?(a(Z,M,F),a(yt,M,F),pe(m.children||[],M,yt,R,B,J,D,K)):st>0&&st&64&&tt&&v.dynamicChildren&&v.dynamicChildren.length===tt.length?(Nt(v.dynamicChildren,tt,M,R,B,J,D),(m.key!=null||R&&m===R.subTree)&&rc(v,m,!0)):et(v,m,M,yt,R,B,J,D,K)},ut=(v,m,M,F,R,B,J,D,K)=>{m.slotScopeIds=D,v==null?m.shapeFlag&512?R.ctx.activate(m,M,F,J,K):zt(m,M,F,R,B,J,K):Ft(v,m,K)},zt=(v,m,M,F,R,B,J)=>{const D=v.component=Bf(v,F,R);if(gr(v)&&(D.ctx.renderer=se),Vf(D,!1,J),D.asyncDep){if(R&&R.registerDep(D,lt,J),!v.el){const K=D.subTree=O(Ne);Mt(null,K,m,M),v.placeholder=K.el}}else lt(D,v,m,M,R,B,J)},Ft=(v,m,M)=>{const F=m.component=v.component;if(xf(v,m,M))if(F.asyncDep&&!F.asyncResolved){At(F,m,M);return}else F.next=m,F.update();else m.el=v.el,F.vnode=m},lt=(v,m,M,F,R,B,J)=>{const D=()=>{if(v.isMounted){let{next:st,bu:tt,u:bt,parent:Rt,vnode:gt}=v;{const Te=ac(v);if(Te){st&&(st.el=gt.el,At(v,st,J)),Te.asyncDep.then(()=>{Xe(()=>{v.isUnmounted||Z()},R)});return}}let Ht=st,le;Zi(v,!1),st?(st.el=gt.el,At(v,st,J)):st=gt,tt&&qo(tt),(le=st.props&&st.props.onVnodeBeforeUpdate)&&Nn(le,Rt,st,gt),Zi(v,!0);const me=gl(v),ve=v.subTree;v.subTree=me,Q(ve,me,A(ve.el),C(ve),v,R,B),st.el=me.el,Ht===null&&wf(v,me.el),bt&&Xe(bt,R),(le=st.props&&st.props.onVnodeUpdated)&&Xe(()=>Nn(le,Rt,st,gt),R)}else{let st;const{el:tt,props:bt}=m,{bm:Rt,m:gt,parent:Ht,root:le,type:me}=v,ve=xs(m);Zi(v,!1),Rt&&qo(Rt),!ve&&(st=bt&&bt.onVnodeBeforeMount)&&Nn(st,Ht,m),Zi(v,!0);{le.ce&&le.ce._hasShadowRoot()&&le.ce._injectChildStyle(me,v.parent?v.parent.type:void 0);const Te=v.subTree=gl(v);Q(null,Te,M,F,v,R,B),m.el=Te.el}if(gt&&Xe(gt,R),!ve&&(st=bt&&bt.onVnodeMounted)){const Te=m;Xe(()=>Nn(st,Ht,Te),R)}(m.shapeFlag&256||Ht&&xs(Ht.vnode)&&Ht.vnode.shapeFlag&256)&&v.a&&Xe(v.a,R),v.isMounted=!0,m=M=F=null}};v.scope.on();const K=v.effect=new hu(D);v.scope.off();const Z=v.update=K.run.bind(K),yt=v.job=K.runIfDirty.bind(K);yt.i=v,yt.id=v.uid,K.scheduler=()=>Oa(yt),Zi(v,!0),Z()},At=(v,m,M)=>{m.component=v;const F=v.vnode.props;v.vnode=m,v.next=null,Sf(v,m.props,F,M),Cf(v,m.children,M),Un(),ll(v),Hn()},et=(v,m,M,F,R,B,J,D,K=!1)=>{const Z=v&&v.children,yt=v?v.shapeFlag:0,st=m.children,{patchFlag:tt,shapeFlag:bt}=m;if(tt>0){if(tt&128){pt(Z,st,M,F,R,B,J,D,K);return}else if(tt&256){ce(Z,st,M,F,R,B,J,D,K);return}}bt&8?(yt&16&&j(Z,R,B),st!==Z&&w(M,st)):yt&16?bt&16?pt(Z,st,M,F,R,B,J,D,K):j(Z,R,B,!0):(yt&8&&w(M,""),bt&16&&pe(st,M,F,R,B,J,D,K))},ce=(v,m,M,F,R,B,J,D,K)=>{v=v||vs,m=m||vs;const Z=v.length,yt=m.length,st=Math.min(Z,yt);let tt;for(tt=0;ttyt?j(v,R,B,!0,!1,st):pe(m,M,F,R,B,J,D,K,st)},pt=(v,m,M,F,R,B,J,D,K)=>{let Z=0;const yt=m.length;let st=v.length-1,tt=yt-1;for(;Z<=st&&Z<=tt;){const bt=v[Z],Rt=m[Z]=K?si(m[Z]):Bn(m[Z]);if(Wi(bt,Rt))Q(bt,Rt,M,null,R,B,J,D,K);else break;Z++}for(;Z<=st&&Z<=tt;){const bt=v[st],Rt=m[tt]=K?si(m[tt]):Bn(m[tt]);if(Wi(bt,Rt))Q(bt,Rt,M,null,R,B,J,D,K);else break;st--,tt--}if(Z>st){if(Z<=tt){const bt=tt+1,Rt=bttt)for(;Z<=st;)Yt(v[Z],R,B,!0),Z++;else{const bt=Z,Rt=Z,gt=new Map;for(Z=Rt;Z<=tt;Z++){const ke=m[Z]=K?si(m[Z]):Bn(m[Z]);ke.key!=null&>.set(ke.key,Z)}let Ht,le=0;const me=tt-Rt+1;let ve=!1,Te=0;const vn=new Array(me);for(Z=0;Z=me){Yt(ke,R,B,!0);continue}let Ie;if(ke.key!=null)Ie=gt.get(ke.key);else for(Ht=Rt;Ht<=tt;Ht++)if(vn[Ht-Rt]===0&&Wi(ke,m[Ht])){Ie=Ht;break}Ie===void 0?Yt(ke,R,B,!0):(vn[Ie-Rt]=Z+1,Ie>=Te?Te=Ie:ve=!0,Q(ke,m[Ie],M,null,R,B,J,D,K),le++)}const ci=ve?zf(vn):vs;for(Ht=ci.length-1,Z=me-1;Z>=0;Z--){const ke=Rt+Z,Ie=m[ke],On=m[ke+1],Be=ke+1{const{el:B,type:J,transition:D,children:K,shapeFlag:Z}=v;if(Z&6){kt(v.component.subTree,m,M,F);return}if(Z&128){v.suspense.move(m,M,F);return}if(Z&64){J.move(v,m,M,se);return}if(J===ct){a(B,m,M);for(let st=0;stD.enter(B),R));else{const{leave:st,delayLeave:tt,afterLeave:bt}=D,Rt=()=>{v.ctx.isUnmounted?l(B):a(B,m,M)},gt=()=>{const Ht=B._isLeaving||!!B[pn];B._isLeaving&&B[pn](!0),D.persisted&&!Ht?Rt():st(B,()=>{Rt(),bt&&bt()})};tt?tt(B,Rt,gt):gt()}else a(B,m,M)},Yt=(v,m,M,F=!1,R=!1)=>{const{type:B,props:J,ref:D,children:K,dynamicChildren:Z,shapeFlag:yt,patchFlag:st,dirs:tt,cacheIndex:bt,memo:Rt}=v;if(st===-2&&(R=!1),D!=null&&(Un(),no(D,null,M,v,!0),Hn()),bt!=null&&(m.renderCache[bt]=void 0),yt&256){m.ctx.deactivate(v);return}const gt=yt&1&&tt,Ht=!xs(v);let le;if(Ht&&(le=J&&J.onVnodeBeforeUnmount)&&Nn(le,m,v),yt&6)Bt(v.component,M,F);else{if(yt&128){v.suspense.unmount(M,F);return}gt&&Vi(v,null,m,"beforeUnmount"),yt&64?v.type.remove(v,m,M,se,F):Z&&!Z.hasOnce&&(B!==ct||st>0&&st&64)?j(Z,m,M,!1,!0):(B===ct&&st&384||!R&&yt&16)&&j(K,m,M),F&&ae(v)}const me=Rt!=null&&bt==null;(Ht&&(le=J&&J.onVnodeUnmounted)||gt||me)&&Xe(()=>{le&&Nn(le,m,v),gt&&Vi(v,null,m,"unmounted"),me&&(v.el=null)},M)},ae=v=>{const{type:m,el:M,anchor:F,transition:R}=v;if(m===ct){Jt(M,F);return}if(m===ta){it(v);return}const B=()=>{l(M),R&&!R.persisted&&R.afterLeave&&R.afterLeave()};if(v.shapeFlag&1&&R&&!R.persisted){const{leave:J,delayLeave:D}=R,K=()=>J(M,B);D?D(v.el,B,K):K()}else B()},Jt=(v,m)=>{let M;for(;v!==m;)M=U(v),l(v),v=M;l(m)},Bt=(v,m,M)=>{const{bum:F,scope:R,job:B,subTree:J,um:D,m:K,a:Z}=v;yl(K),yl(Z),F&&qo(F),R.stop(),B&&(B.flags|=8,Yt(J,v,m,M)),D&&Xe(D,m),Xe(()=>{v.isUnmounted=!0},m)},j=(v,m,M,F=!1,R=!1,B=0)=>{for(let J=B;J{if(v.shapeFlag&6)return C(v.component.subTree);if(v.shapeFlag&128)return v.suspense.next();const m=U(v.anchor||v.el),M=m&&m[jd];return M?U(M):m};let E=!1;const _e=(v,m,M)=>{let F;v==null?m._vnode&&(Yt(m._vnode,null,null,!0),F=m._vnode.component):Q(m._vnode||null,v,m,null,null,null,M),m._vnode=v,E||(E=!0,ll(F),Eu(),E=!1)},se={p:Q,um:Yt,m:kt,r:ae,mt:zt,mc:pe,pc:et,pbc:Nt,n:C,o:e};return{render:_e,hydrate:void 0,createApp:mf(_e)}}function Qr({type:e,props:i},o){return o==="svg"&&e==="foreignObject"||o==="mathml"&&e==="annotation-xml"&&i&&i.encoding&&i.encoding.includes("html")?void 0:o}function Zi({effect:e,job:i},o){o?(e.flags|=32,i.flags|=4):(e.flags&=-33,i.flags&=-5)}function Ef(e,i){return(!e||e&&!e.pendingBranch)&&i&&!i.persisted}function rc(e,i,o=!1){const a=e.children,l=i.children;if(wt(a)&&wt(l))for(let d=0;d>1,e[o[_]]0&&(i[a]=o[d-1]),o[d]=a)}}for(d=o.length,h=o[d-1];d-- >0;)o[d]=h,h=i[h];return o}function ac(e){const i=e.subTree.component;if(i)return i.asyncDep&&!i.asyncResolved?i:ac(i)}function yl(e){if(e)for(let i=0;ie.__isSuspense;function Af(e,i){i&&i.pendingBranch?wt(e)?i.effects.push(...e):i.effects.push(e):Vd(e)}const ct=Symbol.for("v-fgt"),br=Symbol.for("v-txt"),Ne=Symbol.for("v-cmt"),ta=Symbol.for("v-stc"),so=[];let on=null;function g(e=!1){so.push(on=e?null:[])}function If(){so.pop(),on=so[so.length-1]||null}let uo=1;function nr(e,i=!1){uo+=e,e<0&&on&&i&&(on.hasOnce=!0)}function cc(e){return e.dynamicChildren=uo>0?on||vs:null,If(),uo>0&&on&&on.push(e),e}function x(e,i,o,a,l,d){return cc(u(e,i,o,a,l,d,!0))}function ie(e,i,o,a,l){return cc(O(e,i,o,a,l,!0))}function co(e){return e?e.__v_isVNode===!0:!1}function Wi(e,i){return e.type===i.type&&e.key===i.key}const dc=({key:e})=>e??null,Yo=({ref:e,ref_key:i,ref_for:o})=>(typeof e=="number"&&(e=""+e),e!=null?be(e)||Fe(e)||Dt(e)?{i:Re,r:e,k:i,f:!!o}:e:null);function u(e,i=null,o=null,a=0,l=null,d=e===ct?0:1,h=!1,_=!1){const y={__v_isVNode:!0,__v_skip:!0,type:e,props:i,key:i&&dc(i),ref:i&&Yo(i),scopeId:Au,slotScopeIds:null,children:o,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:d,patchFlag:a,dynamicProps:l,dynamicChildren:null,appContext:null,ctx:Re};return _?(ir(y,o),d&128&&e.normalize(y)):o&&(y.shapeFlag|=be(o)?8:16),uo>0&&!h&&on&&(y.patchFlag>0||d&6)&&y.patchFlag!==32&&on.push(y),y}const O=$f;function $f(e,i=null,o=null,a=0,l=null,d=!1){if((!e||e===rf)&&(e=Ne),co(e)){const _=Pi(e,i,!0);return o&&ir(_,o),uo>0&&!d&&on&&(_.shapeFlag&6?on[on.indexOf(e)]=_:on.push(_)),_.patchFlag=-2,_}if(jf(e)&&(e=e.__vccOpts),i){i=Df(i);let{class:_,style:y}=i;_&&!be(_)&&(i.class=Ct(_)),ne(y)&&(Ma(y)&&!wt(y)&&(y=Oe({},y)),i.style=Ss(y))}const h=be(e)?1:uc(e)?128:Nu(e)?64:ne(e)?4:Dt(e)?2:0;return u(e,i,o,a,l,h,d,!0)}function Df(e){return e?Ma(e)||tc(e)?Oe({},e):e:null}function Pi(e,i,o=!1,a=!1){const{props:l,ref:d,patchFlag:h,children:_,transition:y}=e,T=i?Nf(l||{},i):l,w={__v_isVNode:!0,__v_skip:!0,type:e.type,props:T,key:T&&dc(T),ref:i&&i.ref?o&&d?wt(d)?d.concat(Yo(i)):[d,Yo(i)]:Yo(i):d,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:_,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:i&&e.type!==ct?h===-1?16:h|16:h,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:y,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Pi(e.ssContent),ssFallback:e.ssFallback&&Pi(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return y&&a&&lo(w,y.clone(w)),w}function $(e=" ",i=0){return O(br,null,e,i)}function N(e="",i=!1){return i?(g(),ie(Ne,null,e)):O(Ne,null,e)}function Bn(e){return e==null||typeof e=="boolean"?O(Ne):wt(e)?O(ct,null,e.slice()):co(e)?si(e):O(br,null,String(e))}function si(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Pi(e)}function ir(e,i){let o=0;const{shapeFlag:a}=e;if(i==null)i=null;else if(wt(i))o=16;else if(typeof i=="object")if(a&65){const l=i.default;l&&(l._c&&(l._d=!1),ir(e,l()),l._c&&(l._d=!0));return}else{o=32;const l=i._;!l&&!tc(i)?i._ctx=Re:l===3&&Re&&(Re.slots._===1?i._=1:(i._=2,e.patchFlag|=1024))}else if(Dt(i)){if(a&65){ir(e,{default:i});return}i={default:i,_ctx:Re},o=32}else i=String(i),a&64?(o=16,i=[$(i)]):o=8;e.children=i,e.shapeFlag|=o}function Nf(...e){const i={};for(let o=0;oKe||Re;let sr,pa;{const e=hr(),i=(o,a)=>{let l;return(l=e[o])||(l=e[o]=[]),l.push(a),d=>{l.length>1?l.forEach(h=>h(d)):l[0](d)}};sr=i("__VUE_INSTANCE_SETTERS__",o=>Ke=o),pa=i("__VUE_SSR_SETTERS__",o=>fo=o)}const go=e=>{const i=Ke;return sr(e),e.scope.on(),()=>{e.scope.off(),sr(i)}},bl=()=>{Ke&&Ke.scope.off(),sr(null)};function hc(e){return e.vnode.shapeFlag&4}let fo=!1;function Vf(e,i=!1,o=!1){i&&pa(i);const{props:a,children:l}=e.vnode,d=hc(e);kf(e,a,d,i),Lf(e,l,o||i);const h=d?Zf(e,i):void 0;return i&&pa(!1),h}function Zf(e,i){const o=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,lf);const{setup:a}=o;if(a){Un();const l=e.setupContext=a.length>1?Hf(e):null,d=go(e),h=mo(a,e,0,[e.props,l]),_=ou(h);if(Hn(),d(),(_||e.sp)&&!xs(e)&&Uu(e),_){if(h.then(bl,bl),i)return h.then(y=>{xl(e,y)}).catch(y=>{mr(y,e,0)});e.asyncDep=h}else xl(e,h)}else pc(e)}function xl(e,i,o){Dt(i)?e.type.__ssrInlineRender?e.ssrRender=i:e.render=i:ne(i)&&(e.setupState=Lu(i)),pc(e)}function pc(e,i,o){const a=e.type;e.render||(e.render=a.render||Zn);{const l=go(e);Un();try{uf(e)}finally{Hn(),l()}}}const Uf={get(e,i){return De(e,"get",""),e[i]}};function Hf(e){const i=o=>{e.exposed=o||{}};return{attrs:new Proxy(e.attrs,Uf),slots:e.slots,emit:e.emit,expose:i}}function xr(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Lu(Ed(e.exposed)),{get(i,o){if(o in i)return i[o];if(o in io)return io[o](e)},has(i,o){return o in i||o in io}})):e.proxy}function jf(e){return Dt(e)&&"__vccOpts"in e}const xt=(e,i)=>Dd(e,i,fo);function Wf(e,i,o){try{nr(-1);const a=arguments.length;return a===2?ne(i)&&!wt(i)?co(i)?O(e,null,[i]):O(e,i):O(e,null,i):(a>3?o=Array.prototype.slice.call(arguments,2):a===3&&co(o)&&(o=[o]),O(e,i,o))}finally{nr(1)}}const Kf="3.5.39";/** -* @vue/runtime-dom v3.5.39 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/let ma;const wl=typeof window<"u"&&window.trustedTypes;if(wl)try{ma=wl.createPolicy("vue",{createHTML:e=>e})}catch{}const mc=ma?e=>ma.createHTML(e):e=>e,Gf="http://www.w3.org/2000/svg",qf="http://www.w3.org/1998/Math/MathML",ii=typeof document<"u"?document:null,kl=ii&&ii.createElement("template"),Yf={insert:(e,i,o)=>{i.insertBefore(e,o||null)},remove:e=>{const i=e.parentNode;i&&i.removeChild(e)},createElement:(e,i,o,a)=>{const l=i==="svg"?ii.createElementNS(Gf,e):i==="mathml"?ii.createElementNS(qf,e):o?ii.createElement(e,{is:o}):ii.createElement(e);return e==="select"&&a&&a.multiple!=null&&l.setAttribute("multiple",a.multiple),l},createText:e=>ii.createTextNode(e),createComment:e=>ii.createComment(e),setText:(e,i)=>{e.nodeValue=i},setElementText:(e,i)=>{e.textContent=i},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>ii.querySelector(e),setScopeId(e,i){e.setAttribute(i,"")},insertStaticContent(e,i,o,a,l,d){const h=o?o.previousSibling:i.lastChild;if(l&&(l===d||l.nextSibling))for(;i.insertBefore(l.cloneNode(!0),o),!(l===d||!(l=l.nextSibling)););else{kl.innerHTML=mc(a==="svg"?`${e}`:a==="mathml"?`${e}`:e);const _=kl.content;if(a==="svg"||a==="mathml"){const y=_.firstChild;for(;y.firstChild;)_.appendChild(y.firstChild);_.removeChild(y)}i.insertBefore(_,o)}return[h?h.nextSibling:i.firstChild,o?o.previousSibling:i.lastChild]}},wi="transition",Ks="animation",ho=Symbol("_vtc"),gc={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},Jf=Oe({},Ru,gc),Xf=e=>(e.displayName="Transition",e.props=Jf,e),Qf=Xf((e,{slots:i})=>Wf(Gd,th(e),i)),Ui=(e,i=[])=>{wt(e)?e.forEach(o=>o(...i)):e&&e(...i)},Sl=e=>e?wt(e)?e.some(i=>i.length>1):e.length>1:!1;function th(e){const i={};for(const nt in e)nt in gc||(i[nt]=e[nt]);if(e.css===!1)return i;const{name:o="v",type:a,duration:l,enterFromClass:d=`${o}-enter-from`,enterActiveClass:h=`${o}-enter-active`,enterToClass:_=`${o}-enter-to`,appearFromClass:y=d,appearActiveClass:T=h,appearToClass:w=_,leaveFromClass:A=`${o}-leave-from`,leaveActiveClass:U=`${o}-leave-active`,leaveToClass:V=`${o}-leave-to`}=e,rt=eh(l),Q=rt&&rt[0],Ot=rt&&rt[1],{onBeforeEnter:Mt,onEnter:q,onEnterCancelled:dt,onLeave:it,onLeaveCancelled:ht,onBeforeAppear:Kt=Mt,onAppear:he=q,onAppearCancelled:pe=dt}=i,St=(nt,ut,zt,Ft)=>{nt._enterCancelled=Ft,Hi(nt,ut?w:_),Hi(nt,ut?T:h),zt&&zt()},Nt=(nt,ut)=>{nt._isLeaving=!1,Hi(nt,A),Hi(nt,V),Hi(nt,U),ut&&ut()},Et=nt=>(ut,zt)=>{const Ft=nt?he:q,lt=()=>St(ut,nt,zt);Ui(Ft,[ut,lt]),Pl(()=>{Hi(ut,nt?y:d),ni(ut,nt?w:_),Sl(Ft)||Tl(ut,a,Q,lt)})};return Oe(i,{onBeforeEnter(nt){Ui(Mt,[nt]),ni(nt,d),ni(nt,h)},onBeforeAppear(nt){Ui(Kt,[nt]),ni(nt,y),ni(nt,T)},onEnter:Et(!1),onAppear:Et(!0),onLeave(nt,ut){nt._isLeaving=!0;const zt=()=>Nt(nt,ut);ni(nt,A),nt._enterCancelled?(ni(nt,U),Ml(nt)):(Ml(nt),ni(nt,U)),Pl(()=>{nt._isLeaving&&(Hi(nt,A),ni(nt,V),Sl(it)||Tl(nt,a,Ot,zt))}),Ui(it,[nt,zt])},onEnterCancelled(nt){St(nt,!1,void 0,!0),Ui(dt,[nt])},onAppearCancelled(nt){St(nt,!0,void 0,!0),Ui(pe,[nt])},onLeaveCancelled(nt){Nt(nt),Ui(ht,[nt])}})}function eh(e){if(e==null)return null;if(ne(e))return[ea(e.enter),ea(e.leave)];{const i=ea(e);return[i,i]}}function ea(e){return id(e)}function ni(e,i){i.split(/\s+/).forEach(o=>o&&e.classList.add(o)),(e[ho]||(e[ho]=new Set)).add(i)}function Hi(e,i){i.split(/\s+/).forEach(a=>a&&e.classList.remove(a));const o=e[ho];o&&(o.delete(i),o.size||(e[ho]=void 0))}function Pl(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let nh=0;function Tl(e,i,o,a){const l=e._endId=++nh,d=()=>{l===e._endId&&a()};if(o!=null)return setTimeout(d,o);const{type:h,timeout:_,propCount:y}=ih(e,i);if(!h)return a();const T=h+"end";let w=0;const A=()=>{e.removeEventListener(T,U),d()},U=V=>{V.target===e&&++w>=y&&A()};setTimeout(()=>{w(o[rt]||"").split(", "),l=a(`${wi}Delay`),d=a(`${wi}Duration`),h=Ll(l,d),_=a(`${Ks}Delay`),y=a(`${Ks}Duration`),T=Ll(_,y);let w=null,A=0,U=0;i===wi?h>0&&(w=wi,A=h,U=d.length):i===Ks?T>0&&(w=Ks,A=T,U=y.length):(A=Math.max(h,T),w=A>0?h>T?wi:Ks:null,U=w?w===wi?d.length:y.length:0);const V=w===wi&&/\b(?:transform|all)(?:,|$)/.test(a(`${wi}Property`).toString());return{type:w,timeout:A,propCount:U,hasTransform:V}}function Ll(e,i){for(;e.lengthCl(o)+Cl(e[a])))}function Cl(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Ml(e){return(e?e.ownerDocument:document).body.offsetHeight}function sh(e,i,o){const a=e[ho];a&&(i=(i?[i,...a]:[...a]).join(" ")),i==null?e.removeAttribute("class"):o?e.setAttribute("class",i):e.className=i}const or=Symbol("_vod"),_c=Symbol("_vsh"),oh={name:"show",beforeMount(e,{value:i},{transition:o}){e[or]=e.style.display==="none"?"":e.style.display,o&&i?o.beforeEnter(e):Gs(e,i)},mounted(e,{value:i},{transition:o}){o&&i&&o.enter(e)},updated(e,{value:i,oldValue:o},{transition:a}){!i!=!o&&(a?i?(a.beforeEnter(e),Gs(e,!0),a.enter(e)):a.leave(e,()=>{Gs(e,!1)}):Gs(e,i))},beforeUnmount(e,{value:i}){Gs(e,i)}};function Gs(e,i){e.style.display=i?e[or]:"none",e[_c]=!i}const rh=Symbol(""),ah=/(?:^|;)\s*display\s*:/;function lh(e,i,o){const a=e.style,l=be(o);let d=!1;if(o&&!l){if(i)if(be(i))for(const h of i.split(";")){const _=h.slice(0,h.indexOf(":")).trim();o[_]==null&&Ys(a,_,"")}else for(const h in i)o[h]==null&&Ys(a,h,"");for(const h in o){h==="display"&&(d=!0);const _=o[h];_!=null?ch(e,h,!be(i)&&i?i[h]:void 0,_)||Ys(a,h,_):Ys(a,h,"")}}else if(l){if(i!==o){const h=a[rh];h&&(o+=";"+h),a.cssText=o,d=ah.test(o)}}else i&&e.removeAttribute("style");or in e&&(e[or]=d?a.display:"",e[_c]&&(a.display="none"))}const Ol=/\s*!important$/;function Ys(e,i,o){if(wt(o))o.forEach(a=>Ys(e,i,a));else if(o==null&&(o=""),i.startsWith("--"))e.setProperty(i,o);else{const a=uh(e,i);Ol.test(o)?e.setProperty(Li(a),o.replace(Ol,""),"important"):e[a]=o}}const El=["Webkit","Moz","ms"],na={};function uh(e,i){const o=na[i];if(o)return o;let a=Tn(i);if(a!=="filter"&&a in e)return na[i]=a;a=lu(a);for(let l=0;lia||(gh.then(()=>ia=0),ia=Date.now());function vh(e,i){const o=a=>{if(!a._vts)a._vts=Date.now();else if(a._vts<=o.attached)return;const l=o.value;if(wt(l)){const d=a.stopImmediatePropagation;a.stopImmediatePropagation=()=>{d.call(a),a._stopped=!0};const h=l.slice(),_=[a];for(let y=0;ye.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,yh=(e,i,o,a,l,d)=>{const h=l==="svg";i==="class"?sh(e,a,h):i==="style"?lh(e,o,a):ur(i)?cr(i)||fh(e,i,o,a,d):(i[0]==="."?(i=i.slice(1),!0):i[0]==="^"?(i=i.slice(1),!1):bh(e,i,a,h))?(Il(e,i,a),!e.tagName.includes("-")&&(i==="value"||i==="checked"||i==="selected")&&Al(e,i,a,h,d,i!=="value")):e._isVueCE&&(xh(e,i)||e._def.__asyncLoader&&(/[A-Z]/.test(i)||!be(a)))?Il(e,Tn(i),a,d,i):(i==="true-value"?e._trueValue=a:i==="false-value"&&(e._falseValue=a),Al(e,i,a,h))};function bh(e,i,o,a){if(a)return!!(i==="innerHTML"||i==="textContent"||i in e&&Dl(i)&&Dt(o));if(i==="spellcheck"||i==="draggable"||i==="translate"||i==="autocorrect"||i==="sandbox"&&e.tagName==="IFRAME"||i==="form"||i==="list"&&e.tagName==="INPUT"||i==="type"&&e.tagName==="TEXTAREA")return!1;if(i==="width"||i==="height"){const l=e.tagName;if(l==="IMG"||l==="VIDEO"||l==="CANVAS"||l==="SOURCE")return!1}return Dl(i)&&be(o)?!1:i in e}function xh(e,i){const o=e._def.props;if(!o)return!1;const a=Tn(i);return Array.isArray(o)?o.some(l=>Tn(l)===a):Object.keys(o).some(l=>Tn(l)===a)}const Ti=e=>{const i=e.props["onUpdate:modelValue"]||!1;return wt(i)?o=>qo(i,o):i};function wh(e){e.target.composing=!0}function Nl(e){const i=e.target;i.composing&&(i.composing=!1,i.dispatchEvent(new Event("input")))}const gn=Symbol("_assign");function Rl(e,i,o){return i&&(e=e.trim()),o&&(e=fr(e)),e}const vt={created(e,{modifiers:{lazy:i,trim:o,number:a}},l){e[gn]=Ti(l);const d=a||l.props&&l.props.type==="number";ai(e,i?"change":"input",h=>{h.target.composing||e[gn](Rl(e.value,o,d))}),(o||d)&&ai(e,"change",()=>{e.value=Rl(e.value,o,d)}),i||(ai(e,"compositionstart",wh),ai(e,"compositionend",Nl),ai(e,"change",Nl))},mounted(e,{value:i}){e.value=i??""},beforeUpdate(e,{value:i,oldValue:o,modifiers:{lazy:a,trim:l,number:d}},h){if(e[gn]=Ti(h),e.composing)return;const _=(d||e.type==="number")&&!/^0\d/.test(e.value)?fr(e.value):e.value,y=i??"";if(_===y)return;const T=e.getRootNode();(T instanceof Document||T instanceof ShadowRoot)&&T.activeElement===e&&e.type!=="range"&&(a&&i===o||l&&e.value.trim()===y)||(e.value=y)}},rr={deep:!0,created(e,i,o){e[gn]=Ti(o),ai(e,"change",()=>{const a=e._modelValue,l=Ts(e),d=e.checked,h=e[gn];if(wt(a)){const _=wa(a,l),y=_!==-1;if(d&&!y)h(a.concat(l));else if(!d&&y){const T=[...a];T.splice(_,1),h(T)}}else if(Ls(a)){const _=new Set(a);d?_.add(l):_.delete(l),h(_)}else h(vc(e,d))})},mounted:Fl,beforeUpdate(e,i,o){e[gn]=Ti(o),Fl(e,i,o)}};function Fl(e,{value:i,oldValue:o},a){e._modelValue=i;let l;if(wt(i))l=wa(i,a.props.value)>-1;else if(Ls(i))l=i.has(a.props.value);else{if(i===o)return;l=Si(i,vc(e,!0))}e.checked!==l&&(e.checked=l)}const kh={created(e,{value:i},o){e.checked=Si(i,o.props.value),e[gn]=Ti(o),ai(e,"change",()=>{e[gn](Ts(e))})},beforeUpdate(e,{value:i,oldValue:o},a){e[gn]=Ti(a),i!==o&&(e.checked=Si(i,a.props.value))}},sn={deep:!0,created(e,{value:i,modifiers:{number:o}},a){const l=Ls(i);ai(e,"change",()=>{const d=Array.prototype.filter.call(e.options,h=>h.selected).map(h=>o?fr(Ts(h)):Ts(h));e[gn](e.multiple?l?new Set(d):d:d[0]),e._assigning=!0,Mu(()=>{e._assigning=!1})}),e[gn]=Ti(a)},mounted(e,{value:i}){Bl(e,i)},beforeUpdate(e,i,o){e[gn]=Ti(o)},updated(e,{value:i}){e._assigning||Bl(e,i)}};function Bl(e,i){const o=e.multiple,a=wt(i);if(!(o&&!a&&!Ls(i))){for(let l=0,d=e.options.length;lString(T)===String(_)):h.selected=wa(i,_)>-1}else h.selected=i.has(_);else if(Si(Ts(h),i)){e.selectedIndex!==l&&(e.selectedIndex=l);return}}!o&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Ts(e){return"_value"in e?e._value:e.value}function vc(e,i){const o=i?"_trueValue":"_falseValue";return o in e?e[o]:i}const Sh={created(e,i,o){Wo(e,i,o,null,"created")},mounted(e,i,o){Wo(e,i,o,null,"mounted")},beforeUpdate(e,i,o,a){Wo(e,i,o,a,"beforeUpdate")},updated(e,i,o,a){Wo(e,i,o,a,"updated")}};function Ph(e,i){switch(e){case"SELECT":return sn;case"TEXTAREA":return vt;default:switch(i){case"checkbox":return rr;case"radio":return kh;default:return vt}}}function Wo(e,i,o,a,l){const h=Ph(e.tagName,o.props&&o.props.type)[l];h&&h(e,i,o,a)}const Th=["ctrl","shift","alt","meta"],Lh={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,i)=>Th.some(o=>e[`${o}Key`]&&!i.includes(o))},yc=(e,i)=>{if(!e)return e;const o=e._withMods||(e._withMods={}),a=i.join(".");return o[a]||(o[a]=((l,...d)=>{for(let h=0;h{const o=e._withKeys||(e._withKeys={}),a=i.join(".");return o[a]||(o[a]=(l=>{if(!("key"in l))return;const d=Li(l.key);if(i.some(h=>h===d||Ch[h]===d))return e(l)}))},Mh=Oe({patchProp:yh},Yf);let Zl;function Oh(){return Zl||(Zl=Mf(Mh))}const Eh=((...e)=>{const i=Oh().createApp(...e),{mount:o}=i;return i.mount=a=>{const l=Ah(a);if(!l)return;const d=i._component;!Dt(d)&&!d.render&&!d.template&&(d.template=l.innerHTML),l.nodeType===1&&(l.textContent="");const h=o(l,!1,zh(l));return l instanceof Element&&(l.removeAttribute("v-cloak"),l.setAttribute("data-v-app","")),h},i});function zh(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Ah(e){return be(e)?document.querySelector(e):e}const bc="pv_theme",Ul={light:"#EEF0F3",dark:"#0B1730"},ar=typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;function xc(){return ar&&ar.matches?"dark":"light"}function Ih(){try{return localStorage.getItem(bc)||"light"}catch{return"light"}}function wc(e){return e==="system"?xc():e}function kc(e){const i=document.documentElement;i.setAttribute("data-theme",e),i.style.backgroundColor=Ul[e]||Ul.light}const qi=G(Ih()),ks=G(wc(qi.value));function lr(e){qi.value=e;const i=wc(e);ks.value=i,kc(i);try{localStorage.setItem(bc,e)}catch{}}function Hl(){lr(ks.value==="dark"?"light":"dark")}ar&&ar.addEventListener("change",()=>{if(qi.value==="system"){const e=xc();ks.value=e,kc(e)}});async function $h(){try{const e=await fetch("/bff/config");return e.ok?await e.json():{apiBase:""}}catch{return{apiBase:""}}}async function jl(){try{const e=await fetch("/bff/me");return e.ok?await e.json():null}catch{return null}}async function Dh(e,i,o){const a=await fetch("/bff/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e,password:i,apiBase:o})});return{ok:a.ok,status:a.status,body:await a.json().catch(()=>({}))}}async function Nh(){try{await fetch("/bff/logout",{method:"POST"})}catch{}}async function Rh(){try{const e=await fetch("/bff/devices");return e.ok?await e.json():[]}catch{return[]}}async function Fh(){try{const e=await fetch("/bff/users");return e.ok?{ok:!0,status:200,users:(await e.json()).users||[]}:{ok:!1,status:e.status,users:[]}}catch{return{ok:!1,status:0,users:[]}}}async function Bh(e,i,o,a){const l=await fetch("/bff/users",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e,password:i,role:o,organization:a})});return{ok:l.ok,status:l.status,body:await l.json().catch(()=>({}))}}async function Vh(e,i){const o=await fetch(`/bff/users/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return{ok:o.ok,status:o.status,body:await o.json().catch(()=>({}))}}async function Zh(e){const i=await fetch(`/bff/users/${encodeURIComponent(e)}`,{method:"DELETE"});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function Uh(){try{const e=await fetch("/bff/orgs");return e.ok?{ok:!0,status:200,organizations:(await e.json()).organizations||[]}:{ok:!1,status:e.status,organizations:[]}}catch{return{ok:!1,status:0,organizations:[]}}}async function Hh(e){const i=await fetch("/bff/orgs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e})});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function jh(e,i){const o=await fetch(`/bff/orgs/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i})});return{ok:o.ok,status:o.status,body:await o.json().catch(()=>({}))}}async function Wh(e){const i=await fetch(`/bff/orgs/${encodeURIComponent(e)}`,{method:"DELETE"});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function Kh(){try{const e=await fetch("/bff/preferences");if(!e.ok)return null;const i=await e.json();return i&&typeof i.preferences=="object"?i.preferences:null}catch{return null}}async function Gh(e){try{return(await fetch("/bff/preferences",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({preferences:e})})).ok}catch{return!1}}async function qh(){try{const e=await fetch("/bff/integrations/opensky");return e.ok?{ok:!0,status:200,body:await e.json()}:{ok:!1,status:e.status,body:await e.json().catch(()=>({}))}}catch{return{ok:!1,status:0,body:{}}}}async function Wl(e){const i=await fetch("/bff/integrations/opensky",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function Yh(){const e=await fetch("/bff/integrations/opensky/health",{method:"POST"});return{ok:e.ok,status:e.status,body:await e.json().catch(()=>({}))}}async function Jh(){try{const e=await fetch("/bff/integrations/filetransfer");return e.ok?{ok:!0,status:200,body:await e.json()}:{ok:!1,status:e.status,body:await e.json().catch(()=>({}))}}catch{return{ok:!1,status:0,body:{}}}}async function Kl(e){const i=await fetch("/bff/integrations/filetransfer",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function Xh(){const e=await fetch("/bff/integrations/filetransfer/health",{method:"POST"});return{ok:e.ok,status:e.status,body:await e.json().catch(()=>({}))}}async function Qh(){try{const e=await fetch("/bff/integrations/localstorage");return e.ok?{ok:!0,status:200,body:await e.json()}:{ok:!1,status:e.status,body:await e.json().catch(()=>({}))}}catch{return{ok:!1,status:0,body:{}}}}async function Ko(e){const i=await fetch("/bff/integrations/localstorage",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function tp(){const e=await fetch("/bff/integrations/localstorage/health",{method:"POST"});return{ok:e.ok,status:e.status,body:await e.json().catch(()=>({}))}}async function ep(){try{const e=await fetch("/bff/integrations/webdav");return e.ok?{ok:!0,status:200,body:await e.json()}:{ok:!1,status:e.status,body:await e.json().catch(()=>({}))}}catch{return{ok:!1,status:0,body:{}}}}async function Gl(e){const i=await fetch("/bff/integrations/webdav",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function np(){const e=await fetch("/bff/integrations/webdav/health",{method:"POST"});return{ok:e.ok,status:e.status,body:await e.json().catch(()=>({}))}}async function ip(){try{const e=await fetch("/bff/drones");return e.ok?{ok:!0,status:200,drones:(await e.json()).drones||[]}:{ok:!1,status:e.status,drones:[]}}catch{return{ok:!1,status:0,drones:[]}}}async function sp(e){const i=await fetch("/bff/drones",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function op(e,i){const o=await fetch(`/bff/drones/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return{ok:o.ok,status:o.status,body:await o.json().catch(()=>({}))}}async function rp(e){const i=await fetch(`/bff/drones/${encodeURIComponent(e)}`,{method:"DELETE"});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function ap(){try{const e=await fetch("/bff/flights");return e.ok?{ok:!0,status:200,flights:(await e.json()).flights||[]}:{ok:!1,status:e.status,flights:[]}}catch{return{ok:!1,status:0,flights:[]}}}async function lp(e){const i=await fetch("/bff/flights",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function up(e,i){const o=await fetch(`/bff/flights/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return{ok:o.ok,status:o.status,body:await o.json().catch(()=>({}))}}async function cp(e){const i=await fetch(`/bff/flights/${encodeURIComponent(e)}`,{method:"DELETE"});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}function dp(){return"/bff/logbook/export"}async function fp(e,i,o){const a=await fetch(`/bff/devices/${encodeURIComponent(e)}/command`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:i,payload:o})});return{ok:a.ok,body:await a.json().catch(()=>({}))}}const Sc="pv_prefs",ga={name:"",username:"",displayName:"",bio:"",avatar:"",showEmail:!1,fontSize:"md",language:"en",region:"US",dateFormat:"MDY",timeFormat:"24",reduceMotion:!1,twoFactor:!1};function hp(){try{return{...ga,...JSON.parse(localStorage.getItem(Sc)||"{}")||{}}}catch{return{...ga}}}const Tt=xe(hp());function Pc(){try{localStorage.setItem(Sc,JSON.stringify(Tt))}catch{}}function Tc(e){if(!e||typeof e!="object")return!1;for(const i of Object.keys(ga))i in e&&(Tt[i]=e[i]);return!0}const pp={sm:15,md:16,lg:18};function Aa(e){document.documentElement.style.fontSize=(pp[e]||16)+"px"}function Ia(e){document.documentElement.classList.toggle("reduce-motion",!!e)}function Lc(e){const i=new Date(e),o=i.getFullYear(),a=String(i.getMonth()+1).padStart(2,"0"),l=String(i.getDate()).padStart(2,"0");let d;switch(Tt.dateFormat){case"DMY":d=`${l}/${a}/${o}`;break;case"YMD":d=`${o}/${a}/${l}`;break;case"ISO":d=`${o}-${a}-${l}`;break;default:d=`${a}/${l}/${o}`}let h;return Tt.timeFormat==="12"?h=i.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0}):h=`${String(i.getHours()).padStart(2,"0")}:${String(i.getMinutes()).padStart(2,"0")}:${String(i.getSeconds()).padStart(2,"0")}`,{date:d,time:h}}function ql(e){return Lc(e).time}function Yl(e){const i=Lc(e);return`${i.date} ${i.time}`}let $a=!1,_a=!1,va=null;function mp(){return{...JSON.parse(JSON.stringify(Tt)),themeMode:qi.value}}function Da(){!$a||_a||(clearTimeout(va),va=setTimeout(()=>{Gh(mp())},600))}function gp(e){_a=!0;try{Tc(e),e.themeMode&&lr(e.themeMode),Aa(Tt.fontSize),Ia(Tt.reduceMotion),Pc()}finally{_a=!1}}async function Jl(){$a=!0;const e=await Kh();e&&Object.keys(e).length?gp(e):Da()}function _p(){$a=!1,clearTimeout(va)}Qe(Tt,()=>{Pc(),Da()},{deep:!0});Qe(qi,Da);Qe(()=>Tt.fontSize,Aa,{immediate:!0});Qe(()=>Tt.reduceMotion,Ia,{immediate:!0});const vp=["width","height"],Cc={__name:"BrandMark",props:{size:{type:[Number,String],default:28}},setup(e){return(i,o)=>(g(),x("svg",{width:e.size,height:e.size,viewBox:"0 0 48 48",fill:"none","aria-hidden":"true"},[...o[0]||(o[0]=[u("g",{"stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round"},[u("polyline",{points:"8,30 19,17 30,30",stroke:"var(--accent)"}),u("polyline",{points:"18,33 29,20 40,33",stroke:"currentColor"})],-1)])],8,vp))}},yp=["title","aria-label"],bp={key:0,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},xp={key:1,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},wp={__name:"ThemeToggle",setup(e){return(i,o)=>(g(),x("button",{class:"btn-icon",type:"button",title:$t(ks)==="dark"?"Switch to light":"Switch to dark","aria-label":$t(ks)==="dark"?"Switch to light theme":"Switch to dark theme",onClick:o[0]||(o[0]=(...a)=>$t(Hl)&&$t(Hl)(...a))},[$t(ks)==="dark"?(g(),x("svg",bp,[...o[1]||(o[1]=[u("circle",{cx:"12",cy:"12",r:"4"},null,-1),u("path",{d:"M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41"},null,-1)])])):(g(),x("svg",xp,[...o[2]||(o[2]=[u("path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9z"},null,-1)])]))],8,yp))}},kp={class:"relative grid h-full place-items-center p-5"},Sp={class:"absolute right-5 top-5"},Pp={class:"mb-6 flex items-center gap-3 text-ink"},Tp={class:"relative mb-1"},Lp=["type"],Cp=["aria-label","title"],Mp={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"h-[18px] w-[18px]"},Op={key:1,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"h-[18px] w-[18px]"},Ep={key:0,class:"mt-4"},zp={key:1,class:"mt-4 rounded border border-line bg-danger-soft px-3 py-2 text-sm text-danger-fg"},Ap=["disabled"],Ip={__name:"LoginView",props:{defaultApiBase:{type:String,default:""}},emits:["signed-in"],setup(e,{emit:i}){const o=e,a=i,l=G(""),d=G(""),h=G(localStorage.getItem("api_url")||o.defaultApiBase||"http://localhost:8080"),_=G(!1),y=G(!1),T=G(!1),w=G("");async function A(){T.value=!0,w.value="",localStorage.setItem("api_url",h.value.trim());const{ok:U,status:V,body:rt}=await Dh(l.value.trim(),d.value,h.value.trim());if(T.value=!1,U){a("signed-in",rt.email);return}w.value=V===400?"Invalid email or password.":V===502?"API server can't reach PocketBase.":rt.message||rt.error||"Cannot reach the API server."}return(U,V)=>(g(),x("div",kp,[u("div",Sp,[O(wp)]),u("form",{class:"panel w-[380px] p-8 shadow-md",onSubmit:yc(A,["prevent"])},[u("div",Pp,[O(Cc,{size:34}),V[5]||(V[5]=u("div",{class:"leading-tight"},[u("div",{class:"text-mode"},"PilotVault"),u("div",{class:"eyebrow mt-0.5"},"Control panel")],-1))]),V[9]||(V[9]=u("label",{class:"eyebrow mb-1.5 block"},"Email",-1)),ot(u("input",{"onUpdate:modelValue":V[0]||(V[0]=rt=>l.value=rt),type:"email",autocomplete:"username",required:"",class:"field mb-4",placeholder:"you@example.com"},null,512),[[vt,l.value]]),V[10]||(V[10]=u("label",{class:"eyebrow mb-1.5 block"},"Password",-1)),u("div",Tp,[ot(u("input",{"onUpdate:modelValue":V[1]||(V[1]=rt=>d.value=rt),type:y.value?"text":"password",autocomplete:"current-password",required:"",class:"field w-full pr-10",placeholder:"••••••••"},null,8,Lp),[[Sh,d.value]]),u("button",{type:"button",class:"absolute inset-y-0 right-0 grid w-10 place-items-center text-ink-muted transition hover:text-ink-secondary","aria-label":y.value?"Hide password":"Show password",title:y.value?"Hide password":"Show password",onClick:V[2]||(V[2]=rt=>y.value=!y.value)},[y.value?(g(),x("svg",Mp,[...V[6]||(V[6]=[u("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"},null,-1),u("line",{x1:"1",y1:"1",x2:"23",y2:"23"},null,-1)])])):(g(),x("svg",Op,[...V[7]||(V[7]=[u("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"},null,-1),u("circle",{cx:"12",cy:"12",r:"3"},null,-1)])]))],8,Cp)]),_.value?(g(),x("div",Ep,[V[8]||(V[8]=u("label",{class:"eyebrow mb-1.5 block"},"API Server",-1)),ot(u("input",{"onUpdate:modelValue":V[3]||(V[3]=rt=>h.value=rt),type:"text",class:"field font-mono",placeholder:"10.2.1.101:8080"},null,512),[[vt,h.value]])])):N("",!0),w.value?(g(),x("p",zp,P(w.value),1)):N("",!0),u("button",{type:"submit",class:"btn-accent mt-6 w-full",disabled:T.value},P(T.value?"Signing in…":"Sign in"),9,Ap),u("button",{type:"button",class:"mx-auto mt-3 block text-xs text-ink-muted transition hover:text-ink-secondary",onClick:V[4]||(V[4]=rt=>_.value=!_.value)},P(_.value?"Hide server settings":"Server settings"),1)],32)]))}};function $p(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Js={exports:{}};/* @preserve - * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com - * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade - */var Dp=Js.exports,Xl;function Np(){return Xl||(Xl=1,(function(e,i){(function(o,a){a(i)})(Dp,(function(o){var a="1.9.4";function l(t){var n,s,r,c;for(s=1,r=arguments.length;s"u"||!L||!L.Mixin)){t=dt(t)?t:[t];for(var n=0;n0?Math.floor(t):Math.ceil(t)};et.prototype={clone:function(){return new et(this.x,this.y)},add:function(t){return this.clone()._add(pt(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(pt(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new et(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new et(this.x/t.x,this.y/t.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=ce(this.x),this.y=ce(this.y),this},distanceTo:function(t){t=pt(t);var n=t.x-this.x,s=t.y-this.y;return Math.sqrt(n*n+s*s)},equals:function(t){return t=pt(t),t.x===this.x&&t.y===this.y},contains:function(t){return t=pt(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+U(this.x)+", "+U(this.y)+")"}};function pt(t,n,s){return t instanceof et?t:dt(t)?new et(t[0],t[1]):t==null?t:typeof t=="object"&&"x"in t&&"y"in t?new et(t.x,t.y):new et(t,n,s)}function kt(t,n){if(t)for(var s=n?[t,n]:t,r=0,c=s.length;r=this.min.x&&s.x<=this.max.x&&n.y>=this.min.y&&s.y<=this.max.y},intersects:function(t){t=Yt(t);var n=this.min,s=this.max,r=t.min,c=t.max,p=c.x>=n.x&&r.x<=s.x,S=c.y>=n.y&&r.y<=s.y;return p&&S},overlaps:function(t){t=Yt(t);var n=this.min,s=this.max,r=t.min,c=t.max,p=c.x>n.x&&r.xn.y&&r.y=n.lat&&c.lat<=s.lat&&r.lng>=n.lng&&c.lng<=s.lng},intersects:function(t){t=Jt(t);var n=this._southWest,s=this._northEast,r=t.getSouthWest(),c=t.getNorthEast(),p=c.lat>=n.lat&&r.lat<=s.lat,S=c.lng>=n.lng&&r.lng<=s.lng;return p&&S},overlaps:function(t){t=Jt(t);var n=this._southWest,s=this._northEast,r=t.getSouthWest(),c=t.getNorthEast(),p=c.lat>n.lat&&r.latn.lng&&r.lng1,Sr=(function(){var t=!1;try{var n=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",A,n),window.removeEventListener("testPassiveEventSupport",A,n)}catch{}return t})(),Pr=(function(){return!!document.createElement("canvas").getContext})(),Ms=!!(document.createElementNS&&F("svg").createSVGRect),vo=!!Ms&&(function(){var t=document.createElement("div");return t.innerHTML="",(t.firstChild&&t.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"})(),Tr=!Ms&&(function(){try{var t=document.createElement("div");t.innerHTML='';var n=t.firstChild;return n.style.behavior="url(#default#VML)",n&&typeof n.adj=="object"}catch{return!1}})(),Lr=navigator.platform.indexOf("Mac")===0,Cr=navigator.platform.indexOf("Linux")===0;function Vt(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var ft={ie:J,ielt9:D,edge:K,webkit:Z,android:yt,android23:st,androidStock:bt,opera:Rt,chrome:gt,gecko:Ht,safari:le,phantom:me,opera12:ve,win:Te,ie3d:vn,webkit3d:ci,gecko3d:ke,any3d:Ie,mobile:On,mobileWebkit:Be,mobileWebkit3d:Ji,msPointer:Ee,pointer:Ve,touch:wr,touchNative:ye,mobileOpera:_o,mobileGecko:Cs,retina:kr,passiveEvents:Sr,canvas:Pr,svg:Ms,vml:Tr,inlineSvg:vo,mac:Lr,linux:Cr},Xi=ft.msPointer?"MSPointerDown":"pointerdown",ze=ft.msPointer?"MSPointerMove":"pointermove",di=ft.msPointer?"MSPointerUp":"pointerup",Ci=ft.msPointer?"MSPointerCancel":"pointercancel",fi={touchstart:Xi,touchmove:ze,touchend:di,touchcancel:Ci},rn={touchstart:bo,touchmove:Ze,touchend:Ze,touchcancel:Ze},tn={},yo=!1;function Os(t,n,s){return n==="touchstart"&&hi(),rn[n]?(s=rn[n].bind(this,s),t.addEventListener(fi[n],s,!1),s):(console.warn("wrong event specified:",n),A)}function Es(t,n,s){if(!fi[n]){console.warn("wrong event specified:",n);return}t.removeEventListener(fi[n],s,!1)}function Mr(t){tn[t.pointerId]=t}function an(t){tn[t.pointerId]&&(tn[t.pointerId]=t)}function yn(t){delete tn[t.pointerId]}function hi(){yo||(document.addEventListener(Xi,Mr,!0),document.addEventListener(ze,an,!0),document.addEventListener(di,yn,!0),document.addEventListener(Ci,yn,!0),yo=!0)}function Ze(t,n){if(n.pointerType!==(n.MSPOINTER_TYPE_MOUSE||"mouse")){n.touches=[];for(var s in tn)n.touches.push(tn[s]);n.changedTouches=[n],t(n)}}function bo(t,n){n.MSPOINTER_TYPE_TOUCH&&n.pointerType===n.MSPOINTER_TYPE_TOUCH&&Le(n),Ze(t,n)}function zs(t){var n={},s,r;for(r in t)s=t[r],n[r]=s&&s.bind?s.bind(t):s;return t=n,n.type="dblclick",n.detail=2,n.isTrusted=!1,n._simulated=!0,n}var Or=200;function Er(t,n){t.addEventListener("dblclick",n);var s=0,r;function c(p){if(p.detail!==1){r=p.detail;return}if(!(p.pointerType==="mouse"||p.sourceCapabilities&&!p.sourceCapabilities.firesTouchEvents)){var S=So(p);if(!(S.some(function(I){return I instanceof HTMLLabelElement&&I.attributes.for})&&!S.some(function(I){return I instanceof HTMLInputElement||I instanceof HTMLSelectElement}))){var z=Date.now();z-s<=Or?(r++,r===2&&n(zs(p))):r=1,s=z}}}return t.addEventListener("click",c),{dblclick:n,simDblclick:c}}function zr(t,n){t.removeEventListener("dblclick",n.dblclick),t.removeEventListener("click",n.simDblclick)}var As=Qi(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),pi=Qi(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),xo=pi==="webkitTransition"||pi==="OTransition"?pi+"End":"transitionend";function wo(t){return typeof t=="string"?document.getElementById(t):t}function Mi(t,n){var s=t.style[n]||t.currentStyle&&t.currentStyle[n];if((!s||s==="auto")&&document.defaultView){var r=document.defaultView.getComputedStyle(t,null);s=r?r[n]:null}return s==="auto"?null:s}function X(t,n,s){var r=document.createElement(t);return r.className=n||"",s&&s.appendChild(r),r}function Qt(t){var n=t.parentNode;n&&n.removeChild(t)}function jn(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function ln(t){var n=t.parentNode;n&&n.lastChild!==t&&n.appendChild(t)}function bn(t){var n=t.parentNode;n&&n.firstChild!==t&&n.insertBefore(t,n.firstChild)}function mi(t,n){if(t.classList!==void 0)return t.classList.contains(n);var s=Oi(t);return s.length>0&&new RegExp("(^|\\s)"+n+"(\\s|$)").test(s)}function Pt(t,n){if(t.classList!==void 0)for(var s=rt(n),r=0,c=s.length;r0?2*window.devicePixelRatio:1;function To(t){return ft.edge?t.wheelDeltaY/2:t.deltaY&&t.deltaMode===0?-t.deltaY/Ir:t.deltaY&&t.deltaMode===1?-t.deltaY*20:t.deltaY&&t.deltaMode===2?-t.deltaY*60:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?-t.detail*20:t.detail?t.detail/-32765*60:0}function Kn(t,n){var s=n.relatedTarget;if(!s)return!0;try{for(;s&&s!==t;)s=s.parentNode}catch{return!1}return s!==t}var Lo={__proto__:null,on:It,off:te,stopPropagation:we,disableScrollPropagation:zn,disableClickPropagation:vi,preventDefault:Le,stop:wn,getPropagationPath:So,getMousePosition:Po,getWheelDelta:To,isExternalTarget:Kn,addListener:It,removeListener:te},Ai=At.extend({run:function(t,n,s,r){this.stop(),this._el=t,this._inProgress=!0,this._duration=s||.25,this._easeOutPower=1/Math.max(r||.5,.2),this._startPos=En(t),this._offset=n.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=Et(this._animate,this),this._step()},_step:function(t){var n=+new Date-this._startTime,s=this._duration*1e3;nthis.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,n){this._enforcingBounds=!0;var s=this.getCenter(),r=this._limitCenter(s,this._zoom,Jt(t));return s.equals(r)||this.panTo(r,n),this._enforcingBounds=!1,this},panInside:function(t,n){n=n||{};var s=pt(n.paddingTopLeft||n.padding||[0,0]),r=pt(n.paddingBottomRight||n.padding||[0,0]),c=this.project(this.getCenter()),p=this.project(t),S=this.getPixelBounds(),z=Yt([S.min.add(s),S.max.subtract(r)]),I=z.getSize();if(!z.contains(p)){this._enforcingBounds=!0;var W=p.subtract(z.getCenter()),at=z.extend(p).getSize().subtract(I);c.x+=W.x<0?-at.x:at.x,c.y+=W.y<0?-at.y:at.y,this.panTo(this.unproject(c),n),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=l({animate:!1,pan:!0},t===!0?{animate:!0}:t);var n=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var s=this.getSize(),r=n.divideBy(2).round(),c=s.divideBy(2).round(),p=r.subtract(c);return!p.x&&!p.y?this:(t.animate&&t.pan?this.panBy(p):(t.pan&&this._rawPanBy(p),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(h(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:n,newSize:s}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=l({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var n=h(this._handleGeolocationResponse,this),s=h(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(n,s,t):navigator.geolocation.getCurrentPosition(n,s,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){if(this._container._leaflet_id){var n=t.code,s=t.message||(n===1?"permission denied":n===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:n,message:"Geolocation error: "+s+"."})}},_handleGeolocationResponse:function(t){if(this._container._leaflet_id){var n=t.coords.latitude,s=t.coords.longitude,r=new Bt(n,s),c=r.toBounds(t.coords.accuracy*2),p=this._locateOptions;if(p.setView){var S=this.getBoundsZoom(c);this.setView(r,p.maxZoom?Math.min(S,p.maxZoom):S)}var z={latlng:r,bounds:c,timestamp:t.timestamp};for(var I in t.coords)typeof t.coords[I]=="number"&&(z[I]=t.coords[I]);this.fire("locationfound",z)}},addHandler:function(t,n){if(!n)return this;var s=this[t]=new n(this);return this._handlers.push(s),this.options[t]&&s.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),Qt(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(nt(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var t;for(t in this._layers)this._layers[t].remove();for(t in this._panes)Qt(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,n){var s="leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),r=X("div",s,n||this._mapPane);return t&&(this._panes[t]=r),r},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds(),n=this.unproject(t.getBottomLeft()),s=this.unproject(t.getTopRight());return new ae(n,s)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,n,s){t=Jt(t),s=pt(s||[0,0]);var r=this.getZoom()||0,c=this.getMinZoom(),p=this.getMaxZoom(),S=t.getNorthWest(),z=t.getSouthEast(),I=this.getSize().subtract(s),W=Yt(this.project(z,r),this.project(S,r)).getSize(),at=ft.any3d?this.options.zoomSnap:1,Lt=I.x/W.x,Ut=I.y/W.y,He=n?Math.max(Lt,Ut):Math.min(Lt,Ut);return r=this.getScaleZoom(He,r),at&&(r=Math.round(r/(at/100))*(at/100),r=n?Math.ceil(r/at)*at:Math.floor(r/at)*at),Math.max(c,Math.min(p,r))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new et(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,n){var s=this._getTopLeftPoint(t,n);return new kt(s,s.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(t===void 0?this.getZoom():t)},getPane:function(t){return typeof t=="string"?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,n){var s=this.options.crs;return n=n===void 0?this._zoom:n,s.scale(t)/s.scale(n)},getScaleZoom:function(t,n){var s=this.options.crs;n=n===void 0?this._zoom:n;var r=s.zoom(t*s.scale(n));return isNaN(r)?1/0:r},project:function(t,n){return n=n===void 0?this._zoom:n,this.options.crs.latLngToPoint(j(t),n)},unproject:function(t,n){return n=n===void 0?this._zoom:n,this.options.crs.pointToLatLng(pt(t),n)},layerPointToLatLng:function(t){var n=pt(t).add(this.getPixelOrigin());return this.unproject(n)},latLngToLayerPoint:function(t){var n=this.project(j(t))._round();return n._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(j(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(Jt(t))},distance:function(t,n){return this.options.crs.distance(j(t),j(n))},containerPointToLayerPoint:function(t){return pt(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return pt(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var n=this.containerPointToLayerPoint(pt(t));return this.layerPointToLatLng(n)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(j(t)))},mouseEventToContainerPoint:function(t){return Po(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var n=this._container=wo(t);if(n){if(n._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");It(n,"scroll",this._onScroll,this),this._containerId=y(n)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&ft.any3d,Pt(t,"leaflet-container"+(ft.touch?" leaflet-touch":"")+(ft.retina?" leaflet-retina":"")+(ft.ielt9?" leaflet-oldie":"")+(ft.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var n=Mi(t,"position");n!=="absolute"&&n!=="relative"&&n!=="fixed"&&n!=="sticky"&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),ge(this._mapPane,new et(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(Pt(t.markerPane,"leaflet-zoom-hide"),Pt(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,n,s){ge(this._mapPane,new et(0,0));var r=!this._loaded;this._loaded=!0,n=this._limitZoom(n),this.fire("viewprereset");var c=this._zoom!==n;this._moveStart(c,s)._move(t,n)._moveEnd(c),this.fire("viewreset"),r&&this.fire("load")},_moveStart:function(t,n){return t&&this.fire("zoomstart"),n||this.fire("movestart"),this},_move:function(t,n,s,r){n===void 0&&(n=this._zoom);var c=this._zoom!==n;return this._zoom=n,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),r?s&&s.pinch&&this.fire("zoom",s):((c||s&&s.pinch)&&this.fire("zoom",s),this.fire("move",s)),this},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return nt(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){ge(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={},this._targets[y(this._container)]=this;var n=t?te:It;n(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&n(window,"resize",this._onResize,this),ft.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){nt(this._resizeRequest),this._resizeRequest=Et(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,n){for(var s=[],r,c=n==="mouseout"||n==="mouseover",p=t.target||t.srcElement,S=!1;p;){if(r=this._targets[y(p)],r&&(n==="click"||n==="preclick")&&this._draggableMoved(r)){S=!0;break}if(r&&r.listens(n,!0)&&(c&&!Kn(p,t)||(s.push(r),c))||p===this._container)break;p=p.parentNode}return!s.length&&!S&&!c&&this.listens(n,!0)&&(s=[this]),s},_isClickDisabled:function(t){for(;t&&t!==this._container;){if(t._leaflet_disable_click)return!0;t=t.parentNode}},_handleDOMEvent:function(t){var n=t.target||t.srcElement;if(!(!this._loaded||n._leaflet_disable_events||t.type==="click"&&this._isClickDisabled(n))){var s=t.type;s==="mousedown"&&ns(n),this._fireDOMEvent(t,s)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,n,s){if(t.type==="click"){var r=l({},t);r.type="preclick",this._fireDOMEvent(r,r.type,s)}var c=this._findEventTargets(t,n);if(s){for(var p=[],S=0;S0?Math.round(t-n)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(n))},_limitZoom:function(t){var n=this.getMinZoom(),s=this.getMaxZoom(),r=ft.any3d?this.options.zoomSnap:1;return r&&(t=Math.round(t/r)*r),Math.max(n,Math.min(s,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){oe(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,n){var s=this._getCenterOffset(t)._trunc();return(n&&n.animate)!==!0&&!this.getSize().contains(s)?!1:(this.panBy(s,n),!0)},_createAnimProxy:function(){var t=this._proxy=X("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",function(n){var s=As,r=this._proxy.style[s];Se(this._proxy,this.project(n.center,n.zoom),this.getZoomScale(n.zoom,1)),r===this._proxy.style[s]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){Qt(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),n=this.getZoom();Se(this._proxy,this.project(t,n),this.getZoomScale(n,1))},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,n,s){if(this._animatingZoom)return!0;if(s=s||{},!this._zoomAnimated||s.animate===!1||this._nothingToAnimate()||Math.abs(n-this._zoom)>this.options.zoomAnimationThreshold)return!1;var r=this.getZoomScale(n),c=this._getCenterOffset(t)._divideBy(1-1/r);return s.animate!==!0&&!this.getSize().contains(c)?!1:(Et(function(){this._moveStart(!0,s.noMoveStart||!1)._animateZoom(t,n,!0)},this),!0)},_animateZoom:function(t,n,s,r){this._mapPane&&(s&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=n,Pt(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:n,noUpdate:r}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(h(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&oe(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function os(t,n){return new Zt(t,n)}var Ue=zt.extend({options:{position:"topright"},initialize:function(t){Q(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var n=this._map;return n&&n.removeControl(this),this.options.position=t,n&&n.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var n=this._container=this.onAdd(t),s=this.getPosition(),r=t._controlCorners[s];return Pt(n,"leaflet-control"),s.indexOf("bottom")!==-1?r.insertBefore(n,r.firstChild):r.appendChild(n),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(Qt(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),Ii=function(t){return new Ue(t)};Zt.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCorners={},n="leaflet-",s=this._controlContainer=X("div",n+"control-container",this._container);function r(c,p){var S=n+c+" "+n+p;t[c+p]=X("div",S,s)}r("top","left"),r("top","right"),r("bottom","left"),r("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)Qt(this._controlCorners[t]);Qt(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Co=Ue.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,n,s,r){return s1,this._baseLayersList.style.display=t?"":"none"),this._separator.style.display=n&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var n=this._getLayer(y(t.target)),s=n.overlay?t.type==="add"?"overlayadd":"overlayremove":t.type==="add"?"baselayerchange":null;s&&this._map.fire(s,n)},_createRadioElement:function(t,n){var s='",r=document.createElement("div");return r.innerHTML=s,r.firstChild},_addItem:function(t){var n=document.createElement("label"),s=this._map.hasLayer(t.layer),r;t.overlay?(r=document.createElement("input"),r.type="checkbox",r.className="leaflet-control-layers-selector",r.defaultChecked=s):r=this._createRadioElement("leaflet-base-layers_"+y(this),s),this._layerControlInputs.push(r),r.layerId=y(t.layer),It(r,"click",this._onInputClick,this);var c=document.createElement("span");c.innerHTML=" "+t.name;var p=document.createElement("span");n.appendChild(p),p.appendChild(r),p.appendChild(c);var S=t.overlay?this._overlaysList:this._baseLayersList;return S.appendChild(n),this._checkDisabledLayers(),n},_onInputClick:function(){if(!this._preventClick){var t=this._layerControlInputs,n,s,r=[],c=[];this._handlingClick=!0;for(var p=t.length-1;p>=0;p--)n=t[p],s=this._getLayer(n.layerId).layer,n.checked?r.push(s):n.checked||c.push(s);for(p=0;p=0;c--)n=t[c],s=this._getLayer(n.layerId).layer,n.disabled=s.options.minZoom!==void 0&&rs.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var t=this._section;this._preventClick=!0,It(t,"click",Le),this.expand();var n=this;setTimeout(function(){te(t,"click",Le),n._preventClick=!1})}}),$r=function(t,n,s){return new Co(t,n,s)},qe=Ue.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(t){var n="leaflet-control-zoom",s=X("div",n+" leaflet-bar"),r=this.options;return this._zoomInButton=this._createButton(r.zoomInText,r.zoomInTitle,n+"-in",s,this._zoomIn),this._zoomOutButton=this._createButton(r.zoomOutText,r.zoomOutTitle,n+"-out",s,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),s},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,n,s,r,c){var p=X("a",s,r);return p.innerHTML=t,p.href="#",p.title=n,p.setAttribute("role","button"),p.setAttribute("aria-label",n),vi(p),It(p,"click",wn),It(p,"click",c,this),It(p,"click",this._refocusOnMap,this),p},_updateDisabled:function(){var t=this._map,n="leaflet-disabled";oe(this._zoomInButton,n),oe(this._zoomOutButton,n),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||t._zoom===t.getMinZoom())&&(Pt(this._zoomOutButton,n),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||t._zoom===t.getMaxZoom())&&(Pt(this._zoomInButton,n),this._zoomInButton.setAttribute("aria-disabled","true"))}});Zt.mergeOptions({zoomControl:!0}),Zt.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new qe,this.addControl(this.zoomControl))});var Dr=function(t){return new qe(t)},Mo=Ue.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var n="leaflet-control-scale",s=X("div",n),r=this.options;return this._addScales(r,n+"-line",s),t.on(r.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),s},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,n,s){t.metric&&(this._mScale=X("div",n,s)),t.imperial&&(this._iScale=X("div",n,s))},_update:function(){var t=this._map,n=t.getSize().y/2,s=t.distance(t.containerPointToLatLng([0,n]),t.containerPointToLatLng([this.options.maxWidth,n]));this._updateScales(s)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var n=this._getRoundNum(t),s=n<1e3?n+" m":n/1e3+" km";this._updateScale(this._mScale,s,n/t)},_updateImperial:function(t){var n=t*3.2808399,s,r,c;n>5280?(s=n/5280,r=this._getRoundNum(s),this._updateScale(this._iScale,r+" mi",r/s)):(c=this._getRoundNum(n),this._updateScale(this._iScale,c+" ft",c/n))},_updateScale:function(t,n,s){t.style.width=Math.round(this.options.maxWidth*s)+"px",t.innerHTML=n},_getRoundNum:function(t){var n=Math.pow(10,(Math.floor(t)+"").length-1),s=t/n;return s=s>=10?10:s>=5?5:s>=3?3:s>=2?2:1,n*s}}),Nr=function(t){return new Mo(t)},rs='',Gn=Ue.extend({options:{position:"bottomright",prefix:''+(ft.inlineSvg?rs+" ":"")+"Leaflet"},initialize:function(t){Q(this,t),this._attributions={}},onAdd:function(t){t.attributionControl=this,this._container=X("div","leaflet-control-attribution"),vi(this._container);for(var n in t._layers)t._layers[n].getAttribution&&this.addAttribution(t._layers[n].getAttribution());return this._update(),t.on("layeradd",this._addAttribution,this),this._container},onRemove:function(t){t.off("layeradd",this._addAttribution,this)},_addAttribution:function(t){t.layer.getAttribution&&(this.addAttribution(t.layer.getAttribution()),t.layer.once("remove",function(){this.removeAttribution(t.layer.getAttribution())},this))},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var n in this._attributions)this._attributions[n]&&t.push(n);var s=[];this.options.prefix&&s.push(this.options.prefix),t.length&&s.push(t.join(", ")),this._container.innerHTML=s.join(' ')}}});Zt.mergeOptions({attributionControl:!0}),Zt.addInitHook(function(){this.options.attributionControl&&new Gn().addTo(this)});var as=function(t){return new Gn(t)};Ue.Layers=Co,Ue.Zoom=qe,Ue.Scale=Mo,Ue.Attribution=Gn,Ii.layers=$r,Ii.zoom=Dr,Ii.scale=Nr,Ii.attribution=as;var re=zt.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});re.addTo=function(t,n){return t.addHandler(n,this),this};var yi={Events:lt},$i=ft.touch?"touchstart mousedown":"mousedown",Ye=At.extend({options:{clickTolerance:3},initialize:function(t,n,s,r){Q(this,r),this._element=t,this._dragStartTarget=n||t,this._preventOutline=s},enable:function(){this._enabled||(It(this._dragStartTarget,$i,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Ye._dragging===this&&this.finishDrag(!0),te(this._dragStartTarget,$i,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(this._enabled&&(this._moved=!1,!mi(this._element,"leaflet-zoom-anim"))){if(t.touches&&t.touches.length!==1){Ye._dragging===this&&this.finishDrag();return}if(!(Ye._dragging||t.shiftKey||t.which!==1&&t.button!==1&&!t.touches)&&(Ye._dragging=this,this._preventOutline&&ns(this._element),$s(),gi(),!this._moving)){this.fire("down");var n=t.touches?t.touches[0]:t,s=ko(this._element);this._startPoint=new et(n.clientX,n.clientY),this._startPos=En(this._element),this._parentScale=Rs(s);var r=t.type==="mousedown";It(document,r?"mousemove":"touchmove",this._onMove,this),It(document,r?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(t){if(this._enabled){if(t.touches&&t.touches.length>1){this._moved=!0;return}var n=t.touches&&t.touches.length===1?t.touches[0]:t,s=new et(n.clientX,n.clientY)._subtract(this._startPoint);!s.x&&!s.y||Math.abs(s.x)+Math.abs(s.y)p&&(S=z,p=I);p>s&&(n[S]=1,Gt(t,n,s,r,S),Gt(t,n,s,S,c))}function An(t,n){for(var s=[t[0]],r=1,c=0,p=t.length;rn&&(s.push(t[r]),c=r);return cn.max.x&&(s|=2),t.yn.max.y&&(s|=8),s}function Br(t,n){var s=n.x-t.x,r=n.y-t.y;return s*s+r*r}function $n(t,n,s,r){var c=n.x,p=n.y,S=s.x-c,z=s.y-p,I=S*S+z*z,W;return I>0&&(W=((t.x-c)*S+(t.y-p)*z)/I,W>1?(c=s.x,p=s.y):W>0&&(c+=S*W,p+=z*W)),S=t.x-c,z=t.y-p,r?S*S+z*z:new et(c,p)}function Ce(t){return!dt(t[0])||typeof t[0][0]!="object"&&typeof t[0][0]<"u"}function Fi(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Ce(t)}function bi(t,n){var s,r,c,p,S,z,I,W;if(!t||t.length===0)throw new Error("latlngs not passed");Ce(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var at=j([0,0]),Lt=Jt(t),Ut=Lt.getNorthWest().distanceTo(Lt.getSouthWest())*Lt.getNorthEast().distanceTo(Lt.getNorthWest());Ut<1700&&(at=qn(t));var He=t.length,Me=[];for(s=0;sr){I=(p-r)/c,W=[z.x-I*(z.x-S.x),z.y-I*(z.y-S.y)];break}var Je=n.unproject(pt(W));return j([Je.lat+at.lat,Je.lng+at.lng])}var kn={__proto__:null,simplify:Yn,pointToSegmentDistance:Ni,closestPointOnSegment:Rr,clipSegment:ls,_getEdgeIntersection:us,_getBitCode:In,_sqClosestPointOnSegment:$n,isFlat:Ce,_flat:Fi,polylineCenter:bi},Sn={project:function(t){return new et(t.lng,t.lat)},unproject:function(t){return new Bt(t.y,t.x)},bounds:new kt([-180,-90],[180,90])},Bi={R:6378137,R_MINOR:6356752314245179e-9,bounds:new kt([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(t){var n=Math.PI/180,s=this.R,r=t.lat*n,c=this.R_MINOR/s,p=Math.sqrt(1-c*c),S=p*Math.sin(r),z=Math.tan(Math.PI/4-r/2)/Math.pow((1-S)/(1+S),p/2);return r=-s*Math.log(Math.max(z,1e-10)),new et(t.lng*n*s,r)},unproject:function(t){for(var n=180/Math.PI,s=this.R,r=this.R_MINOR/s,c=Math.sqrt(1-r*r),p=Math.exp(-t.y/s),S=Math.PI/2-2*Math.atan(p),z=0,I=.1,W;z<15&&Math.abs(I)>1e-7;z++)W=c*Math.sin(S),W=Math.pow((1-W)/(1+W),c/2),I=Math.PI/2-2*Math.atan(p*W)-S,S+=I;return new Bt(S*n,t.x*n/s)}},Eo={__proto__:null,LonLat:Sn,Mercator:Bi,SphericalMercator:se},Vr=l({},E,{code:"EPSG:3395",projection:Bi,transformation:(function(){var t=.5/(Math.PI*Bi.R);return v(t,.5,-t,.5)})()}),Bs=l({},E,{code:"EPSG:4326",projection:Sn,transformation:v(1/180,1,-1/180,.5)}),zo=l({},C,{projection:Sn,transformation:v(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,n){var s=n.lng-t.lng,r=n.lat-t.lat;return Math.sqrt(s*s+r*r)},infinite:!0});C.Earth=E,C.EPSG3395=Vr,C.EPSG3857=m,C.EPSG900913=M,C.EPSG4326=Bs,C.Simple=zo;var en=At.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[y(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[y(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var n=t.target;if(n.hasLayer(this)){if(this._map=n,this._zoomAnimated=n._zoomAnimated,this.getEvents){var s=this.getEvents();n.on(s,this),this.once("remove",function(){n.off(s,this)},this)}this.onAdd(n),this.fire("add"),n.fire("layeradd",{layer:this})}}});Zt.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var n=y(t);return this._layers[n]?this:(this._layers[n]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t),this)},removeLayer:function(t){var n=y(t);return this._layers[n]?(this._loaded&&t.onRemove(this),delete this._layers[n],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return y(t)in this._layers},eachLayer:function(t,n){for(var s in this._layers)t.call(n,this._layers[s]);return this},_addLayers:function(t){t=t?dt(t)?t:[t]:[];for(var n=0,s=t.length;nthis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()=2&&n[0]instanceof Bt&&n[0].equals(n[s-1])&&n.pop(),n},_setLatLngs:function(t){Xn.prototype._setLatLngs.call(this,t),Ce(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Ce(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,n=this.options.weight,s=new et(n,n);if(t=new kt(t.min.subtract(s),t.max.add(s)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(t))){if(this.options.noClip){this._parts=this._rings;return}for(var r=0,c=this._rings.length,p;rt.y!=c.y>t.y&&t.x<(c.x-r.x)*(t.y-r.y)/(c.y-r.y)+r.x&&(n=!n);return n||Xn.prototype._containsPoint.call(this,t,!0)}});function Ec(t,n){return new fs(t,n)}var Qn=Pn.extend({initialize:function(t,n){Q(this,n),this._layers={},t&&this.addData(t)},addData:function(t){var n=dt(t)?t:t.features,s,r,c;if(n){for(s=0,r=n.length;s0&&c.push(c[0].slice()),c}function hs(t,n){return t.feature?l({},t.feature,{geometry:n}):No(n)}function No(t){return t.type==="Feature"||t.type==="FeatureCollection"?t:{type:"Feature",properties:{},geometry:t}}var Hr={toGeoJSON:function(t){return hs(this,{type:"Point",coordinates:Ur(this.getLatLng(),t)})}};ds.include(Hr),qt.include(Hr),H.include(Hr),Xn.include({toGeoJSON:function(t){var n=!Ce(this._latlngs),s=Do(this._latlngs,n?1:0,!1,t);return hs(this,{type:(n?"Multi":"")+"LineString",coordinates:s})}}),fs.include({toGeoJSON:function(t){var n=!Ce(this._latlngs),s=n&&!Ce(this._latlngs[0]),r=Do(this._latlngs,s?2:n?1:0,!0,t);return n||(r=[r]),hs(this,{type:(s?"Multi":"")+"Polygon",coordinates:r})}}),xi.include({toMultiPoint:function(t){var n=[];return this.eachLayer(function(s){n.push(s.toGeoJSON(t).geometry.coordinates)}),hs(this,{type:"MultiPoint",coordinates:n})},toGeoJSON:function(t){var n=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(n==="MultiPoint")return this.toMultiPoint(t);var s=n==="GeometryCollection",r=[];return this.eachLayer(function(c){if(c.toGeoJSON){var p=c.toGeoJSON(t);if(s)r.push(p.geometry);else{var S=No(p);S.type==="FeatureCollection"?r.push.apply(r,S.features):r.push(S)}}}),s?hs(this,{geometries:r,type:"GeometryCollection"}):{type:"FeatureCollection",features:r}}});function Ra(t,n){return new Qn(t,n)}var zc=Ra,Ro=en.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,n,s){this._url=t,this._bounds=Jt(n),Q(this,s)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(Pt(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){Qt(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&ln(this._image),this},bringToBack:function(){return this._map&&bn(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=Jt(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t=this._url.tagName==="IMG",n=this._image=t?this._url:X("img");if(Pt(n,"leaflet-image-layer"),this._zoomAnimated&&Pt(n,"leaflet-zoom-animated"),this.options.className&&Pt(n,this.options.className),n.onselectstart=A,n.onmousemove=A,n.onload=h(this.fire,this,"load"),n.onerror=h(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(n.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t){this._url=n.src;return}n.src=this._url,n.alt=this.options.alt},_animateZoom:function(t){var n=this._map.getZoomScale(t.zoom),s=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;Se(this._image,s,n)},_reset:function(){var t=this._image,n=new kt(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),s=n.getSize();ge(t,n.min),t.style.width=s.x+"px",t.style.height=s.y+"px"},_updateOpacity:function(){$e(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)},getCenter:function(){return this._bounds.getCenter()}}),Ac=function(t,n,s){return new Ro(t,n,s)},Fa=Ro.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var t=this._url.tagName==="VIDEO",n=this._image=t?this._url:X("video");if(Pt(n,"leaflet-image-layer"),this._zoomAnimated&&Pt(n,"leaflet-zoom-animated"),this.options.className&&Pt(n,this.options.className),n.onselectstart=A,n.onmousemove=A,n.onloadeddata=h(this.fire,this,"load"),t){for(var s=n.getElementsByTagName("source"),r=[],c=0;c0?r:[n.src];return}dt(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(n.style,"objectFit")&&(n.style.objectFit="fill"),n.autoplay=!!this.options.autoplay,n.loop=!!this.options.loop,n.muted=!!this.options.muted,n.playsInline=!!this.options.playsInline;for(var p=0;pc?(n.height=c+"px",Pt(t,p)):oe(t,p),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var n=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),s=this._getAnchor();ge(this._container,n.add(s))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var t=this._map,n=parseInt(Mi(this._container,"marginBottom"),10)||0,s=this._container.offsetHeight+n,r=this._containerWidth,c=new et(this._containerLeft,-s-this._containerBottom);c._add(En(this._container));var p=t.layerPointToContainerPoint(c),S=pt(this.options.autoPanPadding),z=pt(this.options.autoPanPaddingTopLeft||S),I=pt(this.options.autoPanPaddingBottomRight||S),W=t.getSize(),at=0,Lt=0;p.x+r+I.x>W.x&&(at=p.x+r-W.x+I.x),p.x-at-z.x<0&&(at=p.x-z.x),p.y+s+I.y>W.y&&(Lt=p.y+s-W.y+I.y),p.y-Lt-z.y<0&&(Lt=p.y-z.y),(at||Lt)&&(this.options.keepInView&&(this._autopanning=!0),t.fire("autopanstart").panBy([at,Lt]))}},_getAnchor:function(){return pt(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Dc=function(t,n){return new Fo(t,n)};Zt.mergeOptions({closePopupOnClick:!0}),Zt.include({openPopup:function(t,n,s){return this._initOverlay(Fo,t,n,s).openOn(this),this},closePopup:function(t){return t=arguments.length?t:this._popup,t&&t.close(),this}}),en.include({bindPopup:function(t,n){return this._popup=this._initOverlay(Fo,this._popup,t,n),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t){return this._popup&&(this instanceof Pn||(this._popup._source=this),this._popup._prepareOpen(t||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){if(!(!this._popup||!this._map)){wn(t);var n=t.layer||t.target;if(this._popup._source===n&&!(n instanceof f)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(t.latlng);return}this._popup._source=n,this.openPopup(t.latlng)}},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){t.originalEvent.keyCode===13&&this._openPopup(t)}});var Bo=Dn.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){Dn.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(t){Dn.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var t=Dn.prototype.getEvents.call(this);return this.options.permanent||(t.preclick=this.close),t},_initLayout:function(){var t="leaflet-tooltip",n=t+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=X("div",n),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+y(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var n,s,r=this._map,c=this._container,p=r.latLngToContainerPoint(r.getCenter()),S=r.layerPointToContainerPoint(t),z=this.options.direction,I=c.offsetWidth,W=c.offsetHeight,at=pt(this.options.offset),Lt=this._getAnchor();z==="top"?(n=I/2,s=W):z==="bottom"?(n=I/2,s=0):z==="center"?(n=I/2,s=W/2):z==="right"?(n=0,s=W/2):z==="left"?(n=I,s=W/2):S.xthis.options.maxZoom||sr?this._retainParent(c,p,S,r):!1)},_retainChildren:function(t,n,s,r){for(var c=2*t;c<2*t+2;c++)for(var p=2*n;p<2*n+2;p++){var S=new et(c,p);S.z=s+1;var z=this._tileCoordsToKey(S),I=this._tiles[z];if(I&&I.active){I.retain=!0;continue}else I&&I.loaded&&(I.retain=!0);s+1this.options.maxZoom||this.options.minZoom!==void 0&&c1){this._setView(t,s);return}for(var Lt=c.min.y;Lt<=c.max.y;Lt++)for(var Ut=c.min.x;Ut<=c.max.x;Ut++){var He=new et(Ut,Lt);if(He.z=this._tileZoom,!!this._isValidTile(He)){var Me=this._tiles[this._tileCoordsToKey(He)];Me?Me.current=!0:S.push(He)}}if(S.sort(function(Je,ms){return Je.distanceTo(p)-ms.distanceTo(p)}),S.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var dn=document.createDocumentFragment();for(Ut=0;Uts.max.x)||!n.wrapLat&&(t.ys.max.y))return!1}if(!this.options.bounds)return!0;var r=this._tileCoordsToBounds(t);return Jt(this.options.bounds).overlaps(r)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var n=this._map,s=this.getTileSize(),r=t.scaleBy(s),c=r.add(s),p=n.unproject(r,t.z),S=n.unproject(c,t.z);return[p,S]},_tileCoordsToBounds:function(t){var n=this._tileCoordsToNwSe(t),s=new ae(n[0],n[1]);return this.options.noWrap||(s=this._map.wrapLatLngBounds(s)),s},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var n=t.split(":"),s=new et(+n[0],+n[1]);return s.z=+n[2],s},_removeTile:function(t){var n=this._tiles[t];n&&(Qt(n.el),delete this._tiles[t],this.fire("tileunload",{tile:n.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){Pt(t,"leaflet-tile");var n=this.getTileSize();t.style.width=n.x+"px",t.style.height=n.y+"px",t.onselectstart=A,t.onmousemove=A,ft.ielt9&&this.options.opacity<1&&$e(t,this.options.opacity)},_addTile:function(t,n){var s=this._getTilePos(t),r=this._tileCoordsToKey(t),c=this.createTile(this._wrapCoords(t),h(this._tileReady,this,t));this._initTile(c),this.createTile.length<2&&Et(h(this._tileReady,this,t,null,c)),ge(c,s),this._tiles[r]={el:c,coords:t,current:!0},n.appendChild(c),this.fire("tileloadstart",{tile:c,coords:t})},_tileReady:function(t,n,s){n&&this.fire("tileerror",{error:n,tile:s,coords:t});var r=this._tileCoordsToKey(t);s=this._tiles[r],s&&(s.loaded=+new Date,this._map._fadeAnimated?($e(s.el,0),nt(this._fadeFrame),this._fadeFrame=Et(this._updateOpacity,this)):(s.active=!0,this._pruneTiles()),n||(Pt(s.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:s.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),ft.ielt9||!this._map._fadeAnimated?Et(this._pruneTiles,this):setTimeout(h(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var n=new et(this._wrapX?w(t.x,this._wrapX):t.x,this._wrapY?w(t.y,this._wrapY):t.y);return n.z=t.z,n},_pxBoundsToTileRange:function(t){var n=this.getTileSize();return new kt(t.min.unscaleBy(n).floor(),t.max.unscaleBy(n).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});function Fc(t){return new Zs(t)}var ps=Zs.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(t,n){this._url=t,n=Q(this,n),n.detectRetina&&ft.retina&&n.maxZoom>0?(n.tileSize=Math.floor(n.tileSize/2),n.zoomReverse?(n.zoomOffset--,n.minZoom=Math.min(n.maxZoom,n.minZoom+1)):(n.zoomOffset++,n.maxZoom=Math.max(n.minZoom,n.maxZoom-1)),n.minZoom=Math.max(0,n.minZoom)):n.zoomReverse?n.minZoom=Math.min(n.maxZoom,n.minZoom):n.maxZoom=Math.max(n.minZoom,n.maxZoom),typeof n.subdomains=="string"&&(n.subdomains=n.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(t,n){return this._url===t&&n===void 0&&(n=!0),this._url=t,n||this.redraw(),this},createTile:function(t,n){var s=document.createElement("img");return It(s,"load",h(this._tileOnLoad,this,n,s)),It(s,"error",h(this._tileOnError,this,n,s)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(s.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(s.referrerPolicy=this.options.referrerPolicy),s.alt="",s.src=this.getTileUrl(t),s},getTileUrl:function(t){var n={r:ft.retina?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var s=this._globalTileRange.max.y-t.y;this.options.tms&&(n.y=s),n["-y"]=s}return q(this._url,l(n,this.options))},_tileOnLoad:function(t,n){ft.ielt9?setTimeout(h(t,this,null,n),0):t(null,n)},_tileOnError:function(t,n,s){var r=this.options.errorTileUrl;r&&n.getAttribute("src")!==r&&(n.src=r),t(s,n)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,n=this.options.maxZoom,s=this.options.zoomReverse,r=this.options.zoomOffset;return s&&(t=n-t),t+r},_getSubdomain:function(t){var n=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[n]},_abortLoading:function(){var t,n;for(t in this._tiles)if(this._tiles[t].coords.z!==this._tileZoom&&(n=this._tiles[t].el,n.onload=A,n.onerror=A,!n.complete)){n.src=ht;var s=this._tiles[t].coords;Qt(n),delete this._tiles[t],this.fire("tileabort",{tile:n,coords:s})}},_removeTile:function(t){var n=this._tiles[t];if(n)return n.el.setAttribute("src",ht),Zs.prototype._removeTile.call(this,t)},_tileReady:function(t,n,s){if(!(!this._map||s&&s.getAttribute("src")===ht))return Zs.prototype._tileReady.call(this,t,n,s)}});function Za(t,n){return new ps(t,n)}var Ua=ps.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,n){this._url=t;var s=l({},this.defaultWmsParams);for(var r in n)r in this.options||(s[r]=n[r]);n=Q(this,n);var c=n.detectRetina&&ft.retina?2:1,p=this.getTileSize();s.width=p.x*c,s.height=p.y*c,this.wmsParams=s},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var n=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[n]=this._crs.code,ps.prototype.onAdd.call(this,t)},getTileUrl:function(t){var n=this._tileCoordsToNwSe(t),s=this._crs,r=Yt(s.project(n[0]),s.project(n[1])),c=r.min,p=r.max,S=(this._wmsVersion>=1.3&&this._crs===Bs?[c.y,c.x,p.y,p.x]:[c.x,c.y,p.x,p.y]).join(","),z=ps.prototype.getTileUrl.call(this,t);return z+Ot(this.wmsParams,z,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+S},setParams:function(t,n){return l(this.wmsParams,t),n||this.redraw(),this}});function Bc(t,n){return new Ua(t,n)}ps.WMS=Ua,Za.wms=Bc;var ti=en.extend({options:{padding:.1},initialize:function(t){Q(this,t),y(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),Pt(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,n){var s=this._map.getZoomScale(n,this._zoom),r=this._map.getSize().multiplyBy(.5+this.options.padding),c=this._map.project(this._center,n),p=r.multiplyBy(-s).add(c).subtract(this._map._getNewPixelOrigin(t,n));ft.any3d?Se(this._container,p,s):ge(this._container,p)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var t in this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,n=this._map.getSize(),s=this._map.containerPointToLayerPoint(n.multiplyBy(-t)).round();this._bounds=new kt(s,s.add(n.multiplyBy(1+t*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Ha=ti.extend({options:{tolerance:0},getEvents:function(){var t=ti.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){ti.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");It(t,"mousemove",this._onMouseMove,this),It(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),It(t,"mouseout",this._handleMouseOut,this),t._leaflet_disable_events=!0,this._ctx=t.getContext("2d")},_destroyContainer:function(){nt(this._redrawRequest),delete this._ctx,Qt(this._container),te(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var t;this._redrawBounds=null;for(var n in this._layers)t=this._layers[n],t._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){ti.prototype._update.call(this);var t=this._bounds,n=this._container,s=t.getSize(),r=ft.retina?2:1;ge(n,t.min),n.width=r*s.x,n.height=r*s.y,n.style.width=s.x+"px",n.style.height=s.y+"px",ft.retina&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){ti.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[y(t)]=t;var n=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=n),this._drawLast=n,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var n=t._order,s=n.next,r=n.prev;s?s.prev=r:this._drawLast=r,r?r.next=s:this._drawFirst=s,delete t._order,delete this._layers[y(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if(typeof t.options.dashArray=="string"){var n=t.options.dashArray.split(/[, ]+/),s=[],r,c;for(c=0;c')}}catch{}return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}})(),Vc={_initContainer:function(){this._container=X("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(ti.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var n=t._container=Us("shape");Pt(n,"leaflet-vml-shape "+(this.options.className||"")),n.coordsize="1 1",t._path=Us("path"),n.appendChild(t._path),this._updateStyle(t),this._layers[y(t)]=t},_addPath:function(t){var n=t._container;this._container.appendChild(n),t.options.interactive&&t.addInteractiveTarget(n)},_removePath:function(t){var n=t._container;Qt(n),t.removeInteractiveTarget(n),delete this._layers[y(t)]},_updateStyle:function(t){var n=t._stroke,s=t._fill,r=t.options,c=t._container;c.stroked=!!r.stroke,c.filled=!!r.fill,r.stroke?(n||(n=t._stroke=Us("stroke")),c.appendChild(n),n.weight=r.weight+"px",n.color=r.color,n.opacity=r.opacity,r.dashArray?n.dashStyle=dt(r.dashArray)?r.dashArray.join(" "):r.dashArray.replace(/( *, *)/g," "):n.dashStyle="",n.endcap=r.lineCap.replace("butt","flat"),n.joinstyle=r.lineJoin):n&&(c.removeChild(n),t._stroke=null),r.fill?(s||(s=t._fill=Us("fill")),c.appendChild(s),s.color=r.fillColor||r.color,s.opacity=r.fillOpacity):s&&(c.removeChild(s),t._fill=null)},_updateCircle:function(t){var n=t._point.round(),s=Math.round(t._radius),r=Math.round(t._radiusY||s);this._setPath(t,t._empty()?"M0 0":"AL "+n.x+","+n.y+" "+s+","+r+" 0,"+65535*360)},_setPath:function(t,n){t._path.v=n},_bringToFront:function(t){ln(t._container)},_bringToBack:function(t){bn(t._container)}},Vo=ft.vml?Us:F,Hs=ti.extend({_initContainer:function(){this._container=Vo("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Vo("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){Qt(this._container),te(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){ti.prototype._update.call(this);var t=this._bounds,n=t.getSize(),s=this._container;(!this._svgSize||!this._svgSize.equals(n))&&(this._svgSize=n,s.setAttribute("width",n.x),s.setAttribute("height",n.y)),ge(s,t.min),s.setAttribute("viewBox",[t.min.x,t.min.y,n.x,n.y].join(" ")),this.fire("update")}},_initPath:function(t){var n=t._path=Vo("path");t.options.className&&Pt(n,t.options.className),t.options.interactive&&Pt(n,"leaflet-interactive"),this._updateStyle(t),this._layers[y(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){Qt(t._path),t.removeInteractiveTarget(t._path),delete this._layers[y(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var n=t._path,s=t.options;n&&(s.stroke?(n.setAttribute("stroke",s.color),n.setAttribute("stroke-opacity",s.opacity),n.setAttribute("stroke-width",s.weight),n.setAttribute("stroke-linecap",s.lineCap),n.setAttribute("stroke-linejoin",s.lineJoin),s.dashArray?n.setAttribute("stroke-dasharray",s.dashArray):n.removeAttribute("stroke-dasharray"),s.dashOffset?n.setAttribute("stroke-dashoffset",s.dashOffset):n.removeAttribute("stroke-dashoffset")):n.setAttribute("stroke","none"),s.fill?(n.setAttribute("fill",s.fillColor||s.color),n.setAttribute("fill-opacity",s.fillOpacity),n.setAttribute("fill-rule",s.fillRule||"evenodd")):n.setAttribute("fill","none"))},_updatePoly:function(t,n){this._setPath(t,R(t._parts,n))},_updateCircle:function(t){var n=t._point,s=Math.max(Math.round(t._radius),1),r=Math.max(Math.round(t._radiusY),1)||s,c="a"+s+","+r+" 0 1,0 ",p=t._empty()?"M0 0":"M"+(n.x-s)+","+n.y+c+s*2+",0 "+c+-s*2+",0 ";this._setPath(t,p)},_setPath:function(t,n){t._path.setAttribute("d",n)},_bringToFront:function(t){ln(t._path)},_bringToBack:function(t){bn(t._path)}});ft.vml&&Hs.include(Vc);function Wa(t){return ft.svg||ft.vml?new Hs(t):null}Zt.include({getRenderer:function(t){var n=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return n||(n=this._renderer=this._createRenderer()),this.hasLayer(n)||this.addLayer(n),n},_getPaneRenderer:function(t){if(t==="overlayPane"||t===void 0)return!1;var n=this._paneRenderers[t];return n===void 0&&(n=this._createRenderer({pane:t}),this._paneRenderers[t]=n),n},_createRenderer:function(t){return this.options.preferCanvas&&ja(t)||Wa(t)}});var Ka=fs.extend({initialize:function(t,n){fs.prototype.initialize.call(this,this._boundsToLatLngs(t),n)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return t=Jt(t),[t.getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});function Zc(t,n){return new Ka(t,n)}Hs.create=Vo,Hs.pointsToPath=R,Qn.geometryToLayer=Io,Qn.coordsToLatLng=Zr,Qn.coordsToLatLngs=$o,Qn.latLngToCoords=Ur,Qn.latLngsToCoords=Do,Qn.getFeature=hs,Qn.asFeature=No,Zt.mergeOptions({boxZoom:!0});var Ga=re.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){It(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){te(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){Qt(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||t.which!==1&&t.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),gi(),$s(),this._startPoint=this._map.mouseEventToContainerPoint(t),It(document,{contextmenu:wn,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=X("div","leaflet-zoom-box",this._container),Pt(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var n=new kt(this._point,this._startPoint),s=n.getSize();ge(this._box,n.min),this._box.style.width=s.x+"px",this._box.style.height=s.y+"px"},_finish:function(){this._moved&&(Qt(this._box),oe(this._container,"leaflet-crosshair")),Ei(),Ds(),te(document,{contextmenu:wn,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if(!(t.which!==1&&t.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(h(this._resetState,this),0);var n=new ae(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(n).fire("boxzoomend",{boxZoomBounds:n})}},_onKeyDown:function(t){t.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});Zt.addInitHook("addHandler","boxZoom",Ga),Zt.mergeOptions({doubleClickZoom:!0});var qa=re.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var n=this._map,s=n.getZoom(),r=n.options.zoomDelta,c=t.originalEvent.shiftKey?s-r:s+r;n.options.doubleClickZoom==="center"?n.setZoom(c):n.setZoomAround(t.containerPoint,c)}});Zt.addInitHook("addHandler","doubleClickZoom",qa),Zt.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Ya=re.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new Ye(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}Pt(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){oe(this._map._container,"leaflet-grab"),oe(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var n=Jt(this._map.options.maxBounds);this._offsetLimit=Yt(this._map.latLngToContainerPoint(n.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(n.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var n=this._lastTime=+new Date,s=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(s),this._times.push(n),this._prunePositions(n)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),n=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=n.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,n){return t-(t-n)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var t=this._draggable._newPos.subtract(this._draggable._startPos),n=this._offsetLimit;t.xn.max.x&&(t.x=this._viscousLimit(t.x,n.max.x)),t.y>n.max.y&&(t.y=this._viscousLimit(t.y,n.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,n=Math.round(t/2),s=this._initialWorldOffset,r=this._draggable._newPos.x,c=(r-n+s)%t+n-s,p=(r+n+s)%t-n-s,S=Math.abs(c+s)0?p:-p))-n;this._delta=0,this._startTime=null,S&&(t.options.scrollWheelZoom==="center"?t.setZoom(n+S):t.setZoomAround(this._lastMousePos,n+S))}});Zt.addInitHook("addHandler","scrollWheelZoom",Xa);var Uc=600;Zt.mergeOptions({tapHold:ft.touchNative&&ft.safari&&ft.mobile,tapTolerance:15});var Qa=re.extend({addHooks:function(){It(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){te(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(clearTimeout(this._holdTimeout),t.touches.length===1){var n=t.touches[0];this._startPos=this._newPos=new et(n.clientX,n.clientY),this._holdTimeout=setTimeout(h(function(){this._cancel(),this._isTapValid()&&(It(document,"touchend",Le),It(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",n))},this),Uc),It(document,"touchend touchcancel contextmenu",this._cancel,this),It(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function t(){te(document,"touchend",Le),te(document,"touchend touchcancel",t)},_cancel:function(){clearTimeout(this._holdTimeout),te(document,"touchend touchcancel contextmenu",this._cancel,this),te(document,"touchmove",this._onMove,this)},_onMove:function(t){var n=t.touches[0];this._newPos=new et(n.clientX,n.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(t,n){var s=new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,screenX:n.screenX,screenY:n.screenY,clientX:n.clientX,clientY:n.clientY});s._simulated=!0,n.target.dispatchEvent(s)}});Zt.addInitHook("addHandler","tapHold",Qa),Zt.mergeOptions({touchZoom:ft.touch,bounceAtZoomLimits:!0});var tl=re.extend({addHooks:function(){Pt(this._map._container,"leaflet-touch-zoom"),It(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){oe(this._map._container,"leaflet-touch-zoom"),te(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var n=this._map;if(!(!t.touches||t.touches.length!==2||n._animatingZoom||this._zooming)){var s=n.mouseEventToContainerPoint(t.touches[0]),r=n.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=n.getSize()._divideBy(2),this._startLatLng=n.containerPointToLatLng(this._centerPoint),n.options.touchZoom!=="center"&&(this._pinchStartLatLng=n.containerPointToLatLng(s.add(r)._divideBy(2))),this._startDist=s.distanceTo(r),this._startZoom=n.getZoom(),this._moved=!1,this._zooming=!0,n._stop(),It(document,"touchmove",this._onTouchMove,this),It(document,"touchend touchcancel",this._onTouchEnd,this),Le(t)}},_onTouchMove:function(t){if(!(!t.touches||t.touches.length!==2||!this._zooming)){var n=this._map,s=n.mouseEventToContainerPoint(t.touches[0]),r=n.mouseEventToContainerPoint(t.touches[1]),c=s.distanceTo(r)/this._startDist;if(this._zoom=n.getScaleZoom(c,this._startZoom),!n.options.bounceAtZoomLimits&&(this._zoomn.getMaxZoom()&&c>1)&&(this._zoom=n._limitZoom(this._zoom)),n.options.touchZoom==="center"){if(this._center=this._startLatLng,c===1)return}else{var p=s._add(r)._divideBy(2)._subtract(this._centerPoint);if(c===1&&p.x===0&&p.y===0)return;this._center=n.unproject(n.project(this._pinchStartLatLng,this._zoom).subtract(p),this._zoom)}this._moved||(n._moveStart(!0,!1),this._moved=!0),nt(this._animRequest);var S=h(n._move,n,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=Et(S,this,!0),Le(t)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,nt(this._animRequest),te(document,"touchmove",this._onTouchMove,this),te(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});Zt.addInitHook("addHandler","touchZoom",tl),Zt.BoxZoom=Ga,Zt.DoubleClickZoom=qa,Zt.Drag=Ya,Zt.Keyboard=Ja,Zt.ScrollWheelZoom=Xa,Zt.TapHold=Qa,Zt.TouchZoom=tl,o.Bounds=kt,o.Browser=ft,o.CRS=C,o.Canvas=Ha,o.Circle=qt,o.CircleMarker=H,o.Class=zt,o.Control=Ue,o.DivIcon=Va,o.DivOverlay=Dn,o.DomEvent=Lo,o.DomUtil=Ar,o.Draggable=Ye,o.Evented=At,o.FeatureGroup=Pn,o.GeoJSON=Qn,o.GridLayer=Zs,o.Handler=re,o.Icon=cn,o.ImageOverlay=Ro,o.LatLng=Bt,o.LatLngBounds=ae,o.Layer=en,o.LayerGroup=xi,o.LineUtil=kn,o.Map=Zt,o.Marker=ds,o.Mixin=yi,o.Path=f,o.Point=et,o.PolyUtil=Oo,o.Polygon=fs,o.Polyline=Xn,o.Popup=Fo,o.PosAnimation=Ai,o.Projection=Eo,o.Rectangle=Ka,o.Renderer=ti,o.SVG=Hs,o.SVGOverlay=Ba,o.TileLayer=ps,o.Tooltip=Bo,o.Transformation=Ge,o.Util=ut,o.VideoOverlay=Fa,o.bind=h,o.bounds=Yt,o.canvas=ja,o.circle=Mc,o.circleMarker=k,o.control=Ii,o.divIcon=Rc,o.extend=l,o.featureGroup=de,o.geoJSON=Ra,o.geoJson=zc,o.gridLayer=Fc,o.icon=Vs,o.imageOverlay=Ac,o.latLng=j,o.latLngBounds=Jt,o.layerGroup=cs,o.map=os,o.marker=b,o.point=pt,o.polygon=Ec,o.polyline=Oc,o.popup=Dc,o.rectangle=Zc,o.setOptions=Q,o.stamp=y,o.svg=Wa,o.svgOverlay=$c,o.tileLayer=Za,o.tooltip=Nc,o.transformation=v,o.version=a,o.videoOverlay=Ic;var Hc=window.L;o.noConflict=function(){return window.L=Hc,this},window.L=o}))})(Js,Js.exports)),Js.exports}var Rp=Np();const Go=$p(Rp),Ql={__name:"DeviceMap",props:{position:{type:Object,default:null},trail:{type:Array,default:()=>[]}},setup(e){const i=e,o=G(null);let a,l,d;function h(){if(!a)return;const _=i.position;if(_&&(_.lat||_.lng)){const y=[_.lat,_.lng];l?l.setLatLng(y):(l=Go.marker(y).addTo(a),a.setView(y,17))}if(d&&d.remove(),i.trail.length){const y=getComputedStyle(document.documentElement).getPropertyValue("--accent").trim()||"#3D7BF0";d=Go.polyline(i.trail,{color:y,weight:3}).addTo(a)}}return Yi(()=>{a=Go.map(o.value,{zoomControl:!0}).setView([20,0],2),Go.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:"© OpenStreetMap",maxZoom:19}).addTo(a),setTimeout(()=>a.invalidateSize(),60),h()}),Qe(()=>i.position,h,{deep:!0}),Qe(()=>i.trail,h,{deep:!0}),(_,y)=>(g(),x("div",{ref_key:"el",ref:o,class:"h-[320px] w-full rounded-lg"},null,512))}},Fp=["width","height","stroke-width"],Bp=["d"],Y={__name:"Icon",props:{name:{type:String,required:!0},size:{type:[Number,String],default:18},stroke:{type:[Number,String],default:2}},setup(e){const a=({grid:"M3 3h7v7H3zM14 3h7v7h-7zM14 14h7v7h-7zM3 14h7v7H3z",radio:"M4.9 19.1a10 10 0 0 1 0-14.2M7.8 16.2a6 6 0 0 1 0-8.4M16.2 7.8a6 6 0 0 1 0 8.4M19.1 4.9a10 10 0 0 1 0 14.2M12 13a1 1 0 1 0 0-2 1 1 0 0 0 0 2z",route:"M6 19a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM18 11a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM6 13V9a4 4 0 0 1 4-4h4",calendar:"M8 2v4M16 2v4M3 10h18M5 4h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z",book:"M4 19.5A2.5 2.5 0 0 1 6.5 17H20M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z",fileText:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8zM14 2v6h6M16 13H8M16 17H8M10 9H8",settings:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z",search:"M11 19a8 8 0 1 0 0-16 8 8 0 0 0 0 16zM21 21l-4.3-4.3",plus:"M12 5v14M5 12h14",battery:"M3 8h14a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H3a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1zM22 11v2",signal:"M2 20h.01M7 20v-4M12 20v-8M17 20V8M22 20V4",clock:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM12 7v5l3 2",chevronRight:"M9 6l6 6-6 6",play:"M6 3l14 9-14 9V3z",logout:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4M16 17l5-5-5-5M21 12H9",wind:"M12.8 19.6A2 2 0 1 0 14 16H2M17.5 8a2.5 2.5 0 1 1 2 4H2M9.6 4.6A2 2 0 1 1 11 8H2",drone:"M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8zM6 6 4 4M18 6l2-2M6 18l-2 2M18 18l2 2",user:"M20 21a8 8 0 1 0-16 0M12 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8z",users:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM23 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75",shield:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z",sliders:"M4 21v-7M4 10V3M12 21v-9M12 8V3M20 21v-5M20 12V3M1 14h6M9 8h6M17 16h6",alertTriangle:"M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0zM12 9v4M12 17h.01",download:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3",upload:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12",trash:"M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6M10 11v6M14 11v6",check:"M20 6 9 17l-5-5",mail:"M4 4h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2zM22 6l-10 7L2 6",lock:"M5 11h14a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-6a2 2 0 0 1 2-2zM7 11V7a5 5 0 0 1 10 0v4",monitor:"M3 4h18a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1zM8 21h8M12 17v4",globe:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM3 12h18M12 3a15 15 0 0 1 0 18 15 15 0 0 1 0-18z",smartphone:"M7 2h10a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zM11 18h2",image:"M4 4h16a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1zM8.5 11a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zM21 15l-5-5L5 21",type:"M4 7V4h16v3M9 20h6M12 4v16",sun:"M12 17a5 5 0 1 0 0-10 5 5 0 0 0 0 10zM12 1v2M12 21v2M4.2 4.2l1.4 1.4M18.4 18.4l1.4 1.4M1 12h2M21 12h2M4.2 19.8l1.4-1.4M18.4 5.6l1.4-1.4",moon:"M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z",x:"M18 6 6 18M6 6l12 12",server:"M20 4H4a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zM20 13H4a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-3a2 2 0 0 0-2-2zM6 7.5h.01M6 16.5h.01",cloud:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9z"}[e.name]||"").split(" M").map((l,d)=>d?"M"+l:l);return(l,d)=>(g(),x("svg",{width:e.size,height:e.size,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":e.stroke,"stroke-linecap":"round","stroke-linejoin":"round",style:{flex:"none"},"aria-hidden":"true"},[(g(!0),x(ct,null,Wt($t(a),(h,_)=>(g(),x("path",{key:_,d:h},null,8,Bp))),128))],8,Fp))}},Vp=["aria-checked","disabled"],nn={__name:"Toggle",props:{modelValue:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:i}){const o=i;return(a,l)=>(g(),x("button",{type:"button",role:"switch","aria-checked":e.modelValue,disabled:e.disabled,class:Ct(["relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition disabled:opacity-40",e.modelValue?"bg-accent":"bg-surface-2 border border-line-strong"]),onClick:l[0]||(l[0]=d=>o("update:modelValue",!e.modelValue))},[u("span",{class:Ct(["inline-block h-4 w-4 transform rounded-full bg-white shadow-sm transition",e.modelValue?"translate-x-6":"translate-x-1"])},null,2)],10,Vp))}},Zp={class:"inline-flex rounded-[10px] border border-line bg-surface-2 p-0.5"},Up=["onClick"],hn={__name:"Segmented",props:{modelValue:{type:[String,Number],default:""},options:{type:Array,default:()=>[]}},emits:["update:modelValue"],setup(e,{emit:i}){const o=i;return(a,l)=>(g(),x("div",Zp,[(g(!0),x(ct,null,Wt(e.options,d=>(g(),x("button",{key:d.value,type:"button",class:Ct(["inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-[13px] font-semibold transition",e.modelValue===d.value?"bg-surface-1 text-ink shadow-xs":"text-ink-secondary hover:text-ink"]),onClick:h=>o("update:modelValue",d.value)},[d.icon?(g(),ie(Y,{key:0,name:d.icon,size:15},null,8,["name"])):N("",!0),$(" "+P(d.label),1)],10,Up))),128))]))}},Hp={class:"text-sm font-semibold text-ink"},jp={key:0,class:"mt-0.5 text-xs text-ink-muted"},_t={__name:"Row",props:{title:{type:String,default:""},desc:{type:String,default:""},keywords:{type:String,default:""},block:{type:Boolean,default:!1}},setup(e){const i=e,o=eo("settingsSearch",{value:""}),a=xt(()=>{const l=(o.value||"").trim().toLowerCase();return l?`${i.title} ${i.desc} ${i.keywords}`.toLowerCase().includes(l):!0});return(l,d)=>a.value?(g(),x("div",{key:0,class:Ct(["border-b border-line py-4 last:border-0",e.block?"":"flex items-center justify-between gap-6"])},[u("div",{class:Ct(e.block?"mb-3":"min-w-0")},[u("div",Hp,P(e.title),1),e.desc?(g(),x("div",jp,P(e.desc),1)):N("",!0)],2),u("div",{class:Ct(e.block?"":"shrink-0")},[af(l.$slots,"default")],2)],2)):N("",!0)}},Wp=(e,i)=>{const o=e.__vccOpts||e;for(const[a,l]of i)o[a]=l;return o},Kp={class:"mx-auto max-w-[1280px] p-7"},Gp={class:"mb-5 flex flex-wrap items-end justify-between gap-4"},qp={class:"flex h-10 w-full max-w-[280px] items-center gap-2 rounded border border-line-strong bg-surface-1 px-3"},Yp={class:"grid grid-cols-[210px_1fr] gap-6 max-[760px]:grid-cols-1"},Jp={class:"flex flex-col gap-0.5 max-[760px]:flex-row max-[760px]:overflow-x-auto"},Xp=["onClick"],Qp={class:"whitespace-nowrap"},tm={class:"min-w-0"},em={key:0,class:"panel p-10 text-center text-sm text-ink-muted"},nm={key:0,class:"eyebrow mb-2 mt-5 first:mt-0 flex items-center gap-2"},im={key:1,class:"panel mb-5 p-5"},sm={class:"flex items-center gap-1"},om={class:"flex items-center gap-2"},rm={class:"font-mono text-sm text-ink"},am={class:"inline-flex items-center gap-1 rounded-full bg-amber-soft px-2 py-0.5 text-[11px] font-semibold text-amber-fg"},lm={key:0,class:"mt-2 text-xs text-ink-muted"},um={class:"grid max-w-[420px] gap-2"},cm={class:"flex items-center gap-3"},dm={key:2,class:"panel mb-5 p-5"},fm=["value"],hm=["value"],pm=["value"],mm={class:"font-mono text-sm text-ink"},gm={key:3},_m={key:0,class:"mb-5 flex items-center gap-1 overflow-x-auto border-b border-line"},vm=["onClick"],ym={key:1,class:"panel mb-5 p-5"},bm={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},xm={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},wm={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},km={key:1,class:"mb-4 flex flex-col gap-2 border-b border-line pb-4 sm:flex-row sm:items-center sm:justify-between"},Sm={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},Pm={key:0},Tm={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},Lm={class:"font-semibold text-ink-secondary"},Cm={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},Mm={key:7,class:"my-4 rounded-lg border border-line bg-surface-2 p-4","data-keywords":"credits usage quota remaining daily allowance rate limit"},Om={class:"flex items-center justify-between gap-3"},Em={class:"flex items-center gap-2 text-sm font-semibold text-ink"},zm={key:0,class:"text-[11px] text-ink-muted"},Am={class:"mt-2 flex items-baseline gap-1.5"},Im={class:"font-mono text-2xl font-semibold text-ink"},$m={class:"text-sm text-ink-muted"},Dm={class:"mt-2 h-2 w-full overflow-hidden rounded-full bg-line"},Nm={class:"mt-2 text-xs text-ink-muted"},Rm={class:"mt-2 text-sm text-ink"},Fm={class:"font-semibold"},Bm={class:"mt-1 text-xs text-ink-muted"},Vm={key:1,class:"mt-2 text-xs text-ink-muted"},Zm={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},Um={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Hm={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},jm={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Wm={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Km={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Gm={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},qm={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Ym={key:8,class:"border-b border-line py-3 text-xs text-amber-fg"},Jm={class:"mt-4 flex flex-wrap items-center gap-3"},Xm=["disabled"],Qm=["disabled"],tg={key:2,class:"text-xs text-danger-fg"},eg={class:"panel mb-5 p-5"},ng={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},ig={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},sg={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},og={key:1,class:"mb-4 flex flex-col gap-2 border-b border-line pb-4 sm:flex-row sm:items-center sm:justify-between"},rg={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},ag={key:0},lg={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},ug={class:"font-semibold text-ink-secondary"},cg={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},dg={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},fg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},hg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},pg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},mg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},gg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},_g={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},vg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},yg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},bg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},xg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},wg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},kg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Sg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Pg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Tg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Lg={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},Cg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Mg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Og={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Eg={class:"mt-4 flex flex-wrap items-center gap-3"},zg=["disabled"],Ag=["disabled"],Ig={key:2,class:"text-xs text-danger-fg"},$g={key:3,class:"text-[11px] text-ink-muted"},Dg={class:"panel mb-5 p-5"},Ng={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},Rg={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},Fg={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},Bg={key:1,class:"mb-4 flex flex-col gap-2 border-b border-line pb-4 sm:flex-row sm:items-center sm:justify-between"},Vg={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},Zg={key:0},Ug={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},Hg={class:"font-semibold text-ink-secondary"},jg={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},Wg={key:0,class:"inline-flex items-center gap-2 break-all font-mono text-sm text-ink"},Kg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Gg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},qg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Yg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Jg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Xg={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},Qg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},t_={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},e_={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},n_={class:"mt-4 flex flex-wrap items-center gap-3"},i_=["disabled"],s_=["disabled"],o_={key:2,class:"text-xs text-danger-fg"},r_={key:3,class:"text-[11px] text-ink-muted"},a_={key:3,class:"panel mb-5 p-5"},l_={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},u_={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},c_={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},d_={key:1,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},f_={key:2,class:"mb-4 flex flex-col gap-2 border-b border-line pb-4 sm:flex-row sm:items-center sm:justify-between"},h_={key:5,class:"border-b border-line py-3 text-xs text-amber-fg"},p_={key:0},m_={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},g_={class:"font-semibold text-ink-secondary"},__={key:7,class:"border-b border-line py-3 text-xs text-ink-muted"},v_={class:"flex w-full flex-col gap-2"},y_={class:"break-all font-mono text-sm text-ink"},b_={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},x_={key:1,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},w_={key:0,class:"text-xs text-ink-muted"},k_={key:1,class:"border-b border-line py-3 text-xs text-ink-muted"},S_={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},P_={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},T_={class:"mt-4 flex flex-wrap items-center gap-3"},L_=["disabled"],C_=["disabled"],M_={key:2,class:"text-xs text-danger-fg"},O_={key:3,class:"text-[11px] text-ink-muted"},E_={key:4,class:"panel mb-5 p-5"},z_={class:"flex items-center gap-4"},A_=["src"],I_={key:1,class:"grid h-16 w-16 place-items-center rounded-full bg-[var(--navy-800)] text-lg font-bold text-white"},$_={class:"flex gap-2"},D_={class:"btn-ghost cursor-pointer"},N_={class:"mt-1 text-right text-[11px] text-ink-muted"},R_={key:5,class:"panel mb-5 p-5"},F_={class:"flex items-center gap-3"},B_={key:0,class:"mt-4 rounded-lg border border-line bg-surface-2 p-4"},V_={class:"flex flex-wrap items-center gap-4"},Z_={class:"min-w-0"},U_={class:"mt-1 select-all font-mono text-sm font-bold text-ink"},H_={class:"mt-3 flex items-center gap-2"},j_={key:0,class:"mt-2 text-xs text-danger-fg"},W_={key:1,class:"mt-4 rounded-lg border border-line bg-surface-2 p-4"},K_={class:"mt-2 grid grid-cols-2 gap-1 font-mono text-xs text-ink-secondary sm:grid-cols-4"},G_={class:"rounded-lg border border-line bg-surface-2 p-3"},q_={class:"flex items-center gap-3"},Y_={class:"grid h-9 w-9 place-items-center rounded-full bg-accent-soft text-accent-soft-fg"},J_={class:"min-w-0 flex-1"},X_={class:"text-sm font-semibold text-ink"},Q_={class:"font-mono text-[11px] text-ink-muted"},tv={key:6,class:"mb-5"},ev={key:0,class:"panel mb-5 p-5"},nv={class:"grid max-w-[520px] gap-2"},iv={class:"flex flex-wrap gap-2"},sv=["disabled","title"],ov=["value"],rv=["value"],av={class:"flex items-center gap-2 py-1 text-sm text-ink-secondary"},lv={class:"flex items-center gap-3"},uv=["disabled"],cv={key:0,class:"text-xs text-danger-fg"},dv={key:1,class:"text-xs text-ink-muted"},fv={key:1,class:"panel mb-5 p-5"},hv={class:"grid max-w-[520px] gap-2"},pv={class:"flex flex-wrap gap-2"},mv=["value"],gv=["value"],_v={key:1,class:"text-xs text-ink-muted"},vv={class:"font-semibold text-ink-secondary"},yv={class:"flex items-center gap-3"},bv=["disabled"],xv={key:0,class:"text-xs text-danger-fg"},wv={class:"panel overflow-hidden p-0"},kv={class:"flex items-center justify-between px-5 py-4"},Sv=["disabled"],Pv={key:0,class:"px-5 pb-5 text-sm text-danger-fg"},Tv={key:1,class:"px-5 pb-8 text-sm text-ink-muted"},Lv={key:2,class:"overflow-x-auto"},Cv={class:"w-full border-collapse text-sm"},Mv={class:"text-left"},Ov={class:"px-5 py-3"},Ev={class:"text-ink"},zv={key:0,class:"ml-1.5 text-[11px] text-ink-muted"},Av={class:"px-5 py-3"},Iv={class:"px-5 py-3"},$v={class:"px-5 py-3"},Dv={class:"px-5 py-3 text-right"},Nv=["onClick"],Rv={key:1,class:"inline-flex items-center gap-1.5"},Fv=["onClick"],Bv=["onClick"],Vv={key:7,class:"mb-5"},Zv={key:0,class:"panel mb-5 p-5"},Uv={class:"grid max-w-[520px] gap-2"},Hv={class:"flex items-center gap-3"},jv={key:0,class:"text-xs text-danger-fg"},Wv={key:1,class:"panel mb-5 p-5"},Kv={class:"grid max-w-[520px] gap-2"},Gv={class:"flex items-center gap-3"},qv=["disabled"],Yv={key:0,class:"text-xs text-danger-fg"},Jv={class:"panel overflow-hidden p-0"},Xv={key:0,class:"px-5 pb-8 text-sm text-ink-muted"},Qv={key:1,class:"overflow-x-auto"},ty={class:"w-full border-collapse text-sm"},ey={class:"text-left"},ny={class:"px-5 py-3"},iy={class:"inline-flex items-center gap-2 text-ink"},sy={class:"px-5 py-3 text-ink-secondary"},oy={class:"px-5 py-3 text-right"},ry=["onClick"],ay={key:1,class:"inline-flex items-center gap-1.5"},ly=["onClick"],uy=["disabled","title","onClick"],cy={key:8,class:"mb-5"},dy={class:"panel mb-5 p-5"},fy={class:"btn-ghost cursor-pointer"},hy={key:0,class:"mt-2 text-xs text-ink-muted"},py={class:"rounded-lg border p-5",style:{"border-color":"color-mix(in srgb, var(--danger) 35%, transparent)",background:"var(--danger-soft)"}},my={class:"flex items-center gap-2 text-danger-fg"},gy={class:"mt-4 rounded-lg border border-line bg-surface-1 p-4"},_y={class:"mt-3 flex items-start gap-2 text-sm text-ink-secondary"},vy={class:"mt-3"},yy={class:"eyebrow mb-1 block"},by={class:"text-ink"},xy=["placeholder"],wy={class:"mt-4 flex flex-wrap items-center gap-3"},ky=["disabled"],Sy=["disabled"],Py={key:2,class:"text-xs text-ink-muted"},Ty={key:0,class:"mt-3 rounded border border-line bg-surface-2 px-3 py-2 text-xs text-ink-secondary"},Ly={key:0,class:"fixed bottom-5 right-5 z-20 flex items-center gap-2 rounded-lg border border-line bg-surface-1 px-4 py-2.5 text-sm text-ink shadow-md"},tu="pv.opensky.health",eu="pv.filetransfer.health",nu="pv.webdav.health",iu="pv.localstorage.health",Cy={__name:"Settings",props:{email:{type:String,default:""},role:{type:String,default:"user"},organization:{type:String,default:""},organizationName:{type:String,default:""}},emits:["logout"],setup(e,{emit:i}){const o=e,a=i,l=xt(()=>o.role==="superadmin"),d=xt(()=>o.role==="admin"||o.role==="superadmin");function h(b){return b==="superadmin"?"Superadmin":b==="admin"?"Admin":"User"}function _(b){return b==="superadmin"||b==="admin"?"shield":"user"}function y(b){return b==="superadmin"||b==="admin"?T.accent:T.neutral}const T={success:"bg-success-soft text-success-fg",warning:"bg-amber-soft text-amber-fg",danger:"bg-danger-soft text-danger-fg",accent:"bg-accent-soft text-accent-soft-fg",neutral:"bg-surface-2 text-ink-secondary"},w=xt(()=>{const b=[{id:"account",label:"Account",icon:"user",kw:"name username email password verification login credentials role"},{id:"appearance",label:"Appearance",icon:"sliders",kw:"theme light dark system language region font size accessibility date time format motion"},{id:"integrations",label:"Integrations",icon:"radio",kw:"opensky flights adsb aircraft plugin oauth credentials bounding box plan connection ftp sftp ftps file transfer server host upload download local storage folder drive isolated private read only webdav nextcloud owncloud dav url https"},{id:"profile",label:"Profile",icon:"image",kw:"avatar photo display name bio public"},{id:"security",label:"Privacy & Security",icon:"shield",kw:"two factor authentication 2fa sessions devices logout security privacy"}];return d.value&&b.push({id:"team",label:"User management",icon:"users",kw:"users team members add remove create delete role admin permissions rights organization"}),l.value&&b.push({id:"organizations",label:"Organizations",icon:"grid",kw:"organization org tenant company create rename delete members"}),b.push({id:"advanced",label:"Advanced",icon:"alertTriangle",kw:"export import data delete account danger zone",danger:!0}),b}),A=G("account"),U=G("");Iu("settingsSearch",U);const V=xt(()=>U.value.trim().length>0),rt=xt(()=>U.value.trim().toLowerCase());function Q(b){return rt.value?(b.label+" "+b.kw).toLowerCase().includes(rt.value)||Mt(b.id):!0}const Ot={account:["full name","username","email address verification verify","password change current new"],appearance:["theme light dark system","language","region","font size accessibility","reduce motion","date format","time format clock"],integrations:["opensky live flights","enable plugin","oauth client id secret","plan credits","bounding box","test connection","file transfer ftp sftp ftps","server host port username password","private key passphrase","base path directory","local storage folder drive","private isolated folder","read only access mode","webdav nextcloud owncloud dav","server url username password tls","base path directory folder"],profile:["profile photo avatar","display name","bio about","show email public"],security:["two factor authentication","active sessions devices","sign out"],team:["add user create account","members list role admin remove delete","organization org assign"],organizations:["add organization create","rename organization","delete organization members"],advanced:["export data download","import data upload","delete account permanent danger"]};function Mt(b){return rt.value?(Ot[b]||[]).some(f=>f.includes(rt.value)):!0}const q=xt(()=>V.value?w.value.filter(Q):w.value.filter(b=>b.id===A.value)),dt=xt({get:()=>qi.value,set:b=>lr(b)}),it=[{value:"light",label:"Light",icon:"sun"},{value:"dark",label:"Dark",icon:"moon"},{value:"system",label:"System",icon:"monitor"}],ht=[{value:"sm",label:"Small"},{value:"md",label:"Default"},{value:"lg",label:"Large"}],Kt=[{value:"12",label:"12-hour"},{value:"24",label:"24-hour"}],he=[["en","English"],["es","Español"],["de","Deutsch"],["fr","Français"],["pl","Polski"],["ja","日本語"]],pe=[["US","United States"],["GB","United Kingdom"],["EU","European Union"],["CA","Canada"],["AU","Australia"],["JP","Japan"]],St=[["MDY","MM/DD/YYYY"],["DMY","DD/MM/YYYY"],["YMD","YYYY/MM/DD"],["ISO","YYYY-MM-DD"]],Nt=G(Date.now());let Et=null;const nt=xt(()=>Yl(Nt.value)),ut=xe({loaded:!1,available:!1,orgEnabled:!0,allowAnonymous:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),zt=G("user"),Ft=xe({clientId:"",clientSecret:"",plan:"",bbox:""}),lt=G(""),At=G(!1),et=G(!1),ce=G(null),pt=G(null),kt=xt(()=>ce.value&&ce.value.credits||null),Yt=xt(()=>{const b=kt.value;return!b||!b.daily||b.remaining==null?null:Math.max(0,Math.min(100,Math.round(b.remaining/b.daily*100)))}),ae=xt(()=>{const b=Yt.value;return b==null?"bg-accent":b<=10?"bg-danger":b<=30?"bg-amber":"bg-success"});function Jt(b){return typeof b=="number"?b.toLocaleString():b}function Bt(){if(!pt.value)return"";const b=Math.max(0,Math.round((Date.now()-pt.value)/1e3));if(b<60)return"just now";const f=Math.round(b/60);if(f<60)return`${f} min ago`;const H=Math.round(f/60);return H<24?`${H} h ago`:`${Math.round(H/24)} d ago`}function j(){try{ce.value&&localStorage.setItem(tu,JSON.stringify({health:ce.value,ts:pt.value}))}catch{}}function C(){try{const b=localStorage.getItem(tu);if(!b)return;const f=JSON.parse(b);f&&f.health&&(ce.value=f.health,pt.value=f.ts||null)}catch{}}const E=[{value:"",label:"Not set"},{value:"anonymous",label:"Anonymous"},{value:"standard",label:"Standard"},{value:"contributor",label:"Contributor"}],_e=[{value:"user",label:"My settings",icon:"user"},{value:"org",label:"Organization",icon:"users"}],se=xt(()=>ut.isSuperadmin),Ge=xt(()=>ut.isSuperadmin?"user":zt.value),v=xt(()=>ut.scopes[Ge.value]||{editableLayer:"user",fields:{}}),m=xt(()=>Ge.value==="org");function M(b){return v.value.fields[b]||{effective:"",own:"",source:"unset",locked:!1}}function F(b){return se.value||M(b).locked}function R(b){const f=M(b).source;return f==="global"?"Set by administrator":f==="org"?"Set by your organization":""}function B(){Ft.clientId=M("clientId").own||"",Ft.clientSecret=M("clientSecret").own||"",Ft.plan=M("plan").own||"",Ft.bbox=M("bbox").own||""}function J(b){ut.available=!!b.available,ut.orgEnabled=b.orgEnabled!==!1,ut.allowAnonymous=!!b.allowAnonymous,ut.enabled=!!b.enabled,ut.canEditOrg=!!b.canEditOrg,ut.isSuperadmin=!!b.isSuperadmin,ut.scopes=b.scopes||{},zt.value==="org"&&!ut.canEditOrg&&(zt.value="user"),B(),ut.loaded=!0}Qe(zt,()=>{lt.value="",B()});async function D(){C();const{ok:b,body:f}=await qh();b&&J(f)}async function K(b){const f=m.value;f?ut.orgEnabled=b:ut.enabled=b;const{ok:H,body:k}=await Wl(f?{scope:"org",enabled:b}:{scope:"user",enabled:b});H?(J(k),jt(f?b?"OpenSky enabled for your organization.":"OpenSky disabled for your organization.":b?"OpenSky enabled.":"OpenSky disabled.")):(f?ut.orgEnabled=!b:ut.enabled=!b,jt(k.error||"Could not update."))}async function Z(){lt.value="",At.value=!0;const b={};for(const qt of["clientId","clientSecret","plan","bbox"])F(qt)||(b[qt]=Ft[qt]);const f={scope:Ge.value,config:b};m.value||(f.enabled=ut.enabled);const{ok:H,body:k}=await Wl(f);if(At.value=!1,!H){lt.value=k.error||"Could not save settings.";return}J(k),jt(m.value?"Organization OpenSky settings saved.":"OpenSky settings saved.")}async function yt(){et.value=!0,ce.value=null;const{ok:b,body:f}=await Yh();et.value=!1,ce.value=b&&f.health?f.health:{status:"down",detail:f.error||"Probe failed."},pt.value=Date.now(),j()}function st(b){return b==="ok"?T.success:b==="degraded"?T.warning:T.danger}const tt=xe({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),bt=G("user"),Rt=["protocol","host","port","username","password","privateKey","keyPassphrase","hostKeyFingerprint","insecureSkipVerify","basePath"],gt=xe(Object.fromEntries(Rt.map(b=>[b,""]))),Ht=G(""),le=G(!1),me=G(!1),ve=G(null),Te=G(null),vn=[{value:"sftp",label:"SFTP"},{value:"ftps",label:"FTPS"},{value:"ftp",label:"FTP"}],ci=[{value:"false",label:"Verify certificate"},{value:"true",label:"Skip verification"}],ke=xt(()=>tt.isSuperadmin),Ie=xt(()=>tt.isSuperadmin?"user":bt.value),On=xt(()=>tt.scopes[Ie.value]||{editableLayer:"user",fields:{}}),Be=xt(()=>Ie.value==="org"),Ji=xt(()=>(Ve("protocol")?Ee("protocol").effective:gt.protocol)||"sftp");function Ee(b){return On.value.fields[b]||{effective:"",own:"",source:"unset",locked:!1}}function Ve(b){return ke.value||Ee(b).locked}function ye(b){const f=Ee(b).source;return f==="global"?"Set by administrator":f==="org"?"Set by your organization":""}function wr(b){return(vn.find(f=>f.value===b)||{}).label||b||"—"}function _o(){for(const b of Rt)gt[b]=Ee(b).own||"";gt.protocol||(gt.protocol="sftp"),gt.insecureSkipVerify||(gt.insecureSkipVerify="false")}function Cs(b){tt.available=!!b.available,tt.orgEnabled=b.orgEnabled!==!1,tt.enabled=!!b.enabled,tt.canEditOrg=!!b.canEditOrg,tt.isSuperadmin=!!b.isSuperadmin,tt.scopes=b.scopes||{},bt.value==="org"&&!tt.canEditOrg&&(bt.value="user"),_o(),tt.loaded=!0}Qe(bt,()=>{Ht.value="",_o()});function kr(){if(!Te.value)return"";const b=Math.max(0,Math.round((Date.now()-Te.value)/1e3));if(b<60)return"just now";const f=Math.round(b/60);if(f<60)return`${f} min ago`;const H=Math.round(f/60);return H<24?`${H} h ago`:`${Math.round(H/24)} d ago`}function Sr(){try{ve.value&&localStorage.setItem(eu,JSON.stringify({health:ve.value,ts:Te.value}))}catch{}}function Pr(){try{const b=localStorage.getItem(eu);if(!b)return;const f=JSON.parse(b);f&&f.health&&(ve.value=f.health,Te.value=f.ts||null)}catch{}}async function Ms(){Pr();const{ok:b,body:f}=await Jh();b&&Cs(f)}async function vo(b){const f=Be.value;f?tt.orgEnabled=b:tt.enabled=b;const{ok:H,body:k}=await Kl(f?{scope:"org",enabled:b}:{scope:"user",enabled:b});H?(Cs(k),jt(f?b?"File transfer enabled for your organization.":"File transfer disabled for your organization.":b?"File transfer enabled.":"File transfer disabled.")):(f?tt.orgEnabled=!b:tt.enabled=!b,jt(k.error||"Could not update."))}async function Tr(){Ht.value="",le.value=!0;const b={};for(const qt of Rt)Ve(qt)||(b[qt]=gt[qt]);const f={scope:Ie.value,config:b};Be.value||(f.enabled=tt.enabled);const{ok:H,body:k}=await Kl(f);if(le.value=!1,!H){Ht.value=k.error||"Could not save settings.";return}Cs(k),jt(Be.value?"Organization file-transfer settings saved.":"File-transfer settings saved.")}async function Lr(){me.value=!0,ve.value=null;const{ok:b,body:f}=await Xh();me.value=!1,ve.value=b&&f.health?f.health:{status:"down",detail:f.error||"Probe failed."},Te.value=Date.now(),Sr()}function Cr(b){return b==="ok"?T.success:b==="degraded"?T.warning:T.danger}const Vt=xe({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),ft=G("user"),Xi=["baseURL","username","password","insecureSkipVerify","basePath"],ze=xe(Object.fromEntries(Xi.map(b=>[b,""]))),di=G(""),Ci=G(!1),fi=G(!1),rn=G(null),tn=G(null),yo=[{value:"false",label:"Verify certificate"},{value:"true",label:"Skip verification"}],Os=xt(()=>Vt.isSuperadmin),Es=xt(()=>Vt.isSuperadmin?"user":ft.value),Mr=xt(()=>Vt.scopes[Es.value]||{editableLayer:"user",fields:{}}),an=xt(()=>Es.value==="org");function yn(b){return Mr.value.fields[b]||{effective:"",own:"",source:"unset",locked:!1}}function hi(b){return Os.value||yn(b).locked}function Ze(b){const f=yn(b).source;return f==="global"?"Set by administrator":f==="org"?"Set by your organization":""}function bo(){for(const b of Xi)ze[b]=yn(b).own||"";ze.insecureSkipVerify||(ze.insecureSkipVerify="false")}function zs(b){Vt.available=!!b.available,Vt.orgEnabled=b.orgEnabled!==!1,Vt.enabled=!!b.enabled,Vt.canEditOrg=!!b.canEditOrg,Vt.isSuperadmin=!!b.isSuperadmin,Vt.scopes=b.scopes||{},ft.value==="org"&&!Vt.canEditOrg&&(ft.value="user"),bo(),Vt.loaded=!0}Qe(ft,()=>{di.value="",bo()});function Or(){if(!tn.value)return"";const b=Math.max(0,Math.round((Date.now()-tn.value)/1e3));if(b<60)return"just now";const f=Math.round(b/60);if(f<60)return`${f} min ago`;const H=Math.round(f/60);return H<24?`${H} h ago`:`${Math.round(H/24)} d ago`}function Er(){try{rn.value&&localStorage.setItem(nu,JSON.stringify({health:rn.value,ts:tn.value}))}catch{}}function zr(){try{const b=localStorage.getItem(nu);if(!b)return;const f=JSON.parse(b);f&&f.health&&(rn.value=f.health,tn.value=f.ts||null)}catch{}}async function As(){zr();const{ok:b,body:f}=await ep();b&&zs(f)}async function pi(b){const f=an.value;f?Vt.orgEnabled=b:Vt.enabled=b;const{ok:H,body:k}=await Gl(f?{scope:"org",enabled:b}:{scope:"user",enabled:b});H?(zs(k),jt(f?b?"WebDAV enabled for your organization.":"WebDAV disabled for your organization.":b?"WebDAV enabled.":"WebDAV disabled.")):(f?Vt.orgEnabled=!b:Vt.enabled=!b,jt(k.error||"Could not update."))}async function xo(){di.value="",Ci.value=!0;const b={};for(const qt of Xi)hi(qt)||(b[qt]=ze[qt]);const f={scope:Es.value,config:b};an.value||(f.enabled=Vt.enabled);const{ok:H,body:k}=await Gl(f);if(Ci.value=!1,!H){di.value=k.error||"Could not save settings.";return}zs(k),jt(an.value?"Organization WebDAV settings saved.":"WebDAV settings saved.")}async function wo(){fi.value=!0,rn.value=null;const{ok:b,body:f}=await np();fi.value=!1,rn.value=b&&f.health?f.health:{status:"down",detail:f.error||"Probe failed."},tn.value=Date.now(),Er()}function Mi(b){return b==="ok"?T.success:b==="degraded"?T.warning:T.danger}const X=xe({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,isOrgUser:!1,mounts:[],privateFolder:!1,privateEnabled:!1,allowPrivate:!0,rootConfigured:!1,scopes:{}}),Qt=G("user"),jn=G(""),ln=G(""),bn=G(!1),mi=G(!1),Pt=G(null),oe=G(null),Wn=G({}),Oi=[{value:"",label:"Inherit"},{value:"false",label:"Read-write"},{value:"true",label:"Read-only"}],$e=xt(()=>X.isSuperadmin),Is=xt(()=>X.isSuperadmin?"user":Qt.value),Qi=xt(()=>X.scopes[Is.value]||{editableLayer:"user",fields:{}}),Se=xt(()=>Is.value==="org");function ge(b){return Qi.value.fields[b]||{effective:"",own:"",source:"unset",locked:!1}}function En(b){return $e.value||ge(b).locked}function gi(b){const f=ge(b).source;return f==="global"?"Set by administrator":f==="org"?"Set by your organization":""}function Ei(b){return(Oi.find(f=>f.value===b)||{}).label||"Inherit"}function ts(){jn.value=ge("readOnly").own||""}function xn(b){X.available=!!b.available,X.orgEnabled=b.orgEnabled!==!1,X.enabled=!!b.enabled,X.canEditOrg=!!b.canEditOrg,X.isSuperadmin=!!b.isSuperadmin,X.isOrgUser=!!b.isOrgUser,X.mounts=Array.isArray(b.mounts)?b.mounts:[],X.privateFolder=!!b.privateFolder,X.privateEnabled=!!b.privateEnabled,X.allowPrivate=b.allowPrivate!==!1,X.rootConfigured=!!b.rootConfigured,X.scopes=b.scopes||{},Qt.value==="org"&&!X.canEditOrg&&(Qt.value="user"),ts(),X.loaded=!0}Qe(Qt,()=>{ln.value="",ts()});function $s(){if(!oe.value)return"";const b=Math.max(0,Math.round((Date.now()-oe.value)/1e3));if(b<60)return"just now";const f=Math.round(b/60);if(f<60)return`${f} min ago`;const H=Math.round(f/60);return H<24?`${H} h ago`:`${Math.round(H/24)} d ago`}function Ds(){try{Pt.value&&localStorage.setItem(iu,JSON.stringify({health:Pt.value,ts:oe.value}))}catch{}}function es(){try{const b=localStorage.getItem(iu);if(!b)return;const f=JSON.parse(b);f&&f.health&&(Pt.value=f.health,oe.value=f.ts||null)}catch{}}async function Ns(){es();const{ok:b,body:f}=await Qh();b&&xn(f)}async function ns(b){const f=Se.value;f?X.orgEnabled=b:X.enabled=b;const{ok:H,body:k}=await Ko(f?{scope:"org",enabled:b}:{scope:"user",enabled:b});H?(xn(k),jt(f?b?"Local storage enabled for your organization.":"Local storage disabled for your organization.":b?"Local storage enabled.":"Local storage disabled.")):(f?X.orgEnabled=!b:X.enabled=!b,jt(k.error||"Could not update."))}async function is(b){X.privateFolder=b;const{ok:f,body:H}=await Ko({scope:"user",privateFolder:b});f?(xn(H),jt(b?"Private folder enabled.":"Private folder disabled.")):(X.privateFolder=!b,jt(H.error||"Could not update."))}async function ko(b){X.allowPrivate=b;const{ok:f,body:H}=await Ko({scope:"org",allowPrivate:b});f?(xn(H),jt(b?"Members may now create private folders.":"Private folders disabled for your organization.")):(X.allowPrivate=!b,jt(H.error||"Could not update."))}async function Rs(){ln.value="",bn.value=!0;const b={};En("readOnly")||(b.readOnly=jn.value);const f={scope:Is.value,config:b};Se.value||(f.enabled=X.enabled);const{ok:H,body:k}=await Ko(f);if(bn.value=!1,!H){ln.value=k.error||"Could not save settings.";return}xn(k),jt(Se.value?"Organization local-storage settings saved.":"Local-storage settings saved.")}async function Ar(){mi.value=!0,Pt.value=null,Wn.value={};const{ok:b,body:f}=await tp();mi.value=!1,Pt.value=b&&f.health?f.health:{status:"down",detail:f.error||"Probe failed."};const H={};if(Array.isArray(f.mounts))for(const k of f.mounts)H[k.id]={status:k.status,detail:k.detail};Wn.value=H,oe.value=Date.now(),Ds()}function It(b){return b==="ok"?T.success:b==="degraded"?T.warning:T.danger}const un=[{id:"apis-external",label:"APIs — External",icon:"globe"},{id:"drives-external",label:"Drives — External",icon:"server"},{id:"drives-local",label:"Drives — Local",icon:"monitor"}],te=G("apis-external");function ss(b){return V.value||te.value===b}const _i=G("");let zi=null;function jt(b){_i.value=b,clearTimeout(zi),zi=setTimeout(()=>_i.value="",2200)}const we=xe({current:"",next:"",confirm:""}),zn=G(""),vi=G(!1);function Le(){if(vi.value=!1,!we.current)return zn.value="Enter your current password.";if(we.next.length<8)return zn.value="New password must be at least 8 characters.";if(we.next!==we.confirm)return zn.value="New passwords do not match.";zn.value="Validated. Connecting to the account service is pending — no password endpoint yet.",we.current=we.next=we.confirm=""}const wn=G("");function So(){wn.value="Verification link would be sent once the account service is wired up."}function Po(b){const f=b.target.files&&b.target.files[0];if(!f)return;if(f.size>1.5*1024*1024){jt("Image too large (max ~1.5 MB).");return}const H=new FileReader;H.onload=()=>{Tt.avatar=String(H.result),jt("Photo updated.")},H.readAsDataURL(f)}function Ir(){Tt.avatar="",jt("Photo removed.")}const To=xt(()=>{var H,k,qt;const f=(Tt.displayName||Tt.name||o.email||"PV").split("@")[0].split(/[.\-_ ]+/).filter(Boolean);return((((H=f[0])==null?void 0:H[0])||"P")+(((k=f[1])==null?void 0:k[0])||((qt=f[0])==null?void 0:qt[1])||"V")).toUpperCase()}),Kn=G(!1),Lo=G(""),Ai=G(""),Zt=G(""),os=G([]);function Ue(b){const f="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";let H="";for(let k=0;kUe(4).toLowerCase()+"-"+Ue(4).toLowerCase()),Zt.value=""}function $r(){Tt.twoFactor=!1,os.value=[],Kn.value=!1}const qe=navigator.userAgent;function Dr(){return/Edg\//.test(qe)?"Edge":/OPR\//.test(qe)?"Opera":/Chrome\//.test(qe)?"Chrome":/Firefox\//.test(qe)?"Firefox":/Safari\//.test(qe)?"Safari":"Browser"}function Mo(){return/Windows/.test(qe)?"Windows":/Mac OS X/.test(qe)?"macOS":/Android/.test(qe)?"Android":/iPhone|iPad/.test(qe)?"iOS":/Linux/.test(qe)?"Linux":"Unknown OS"}const Nr=Date.now(),rs=G([]),Gn=G(!1),as=G(""),re=xe({email:"",password:"",role:"user",organization:""}),yi=G(""),$i=G(!1),Ye=G(""),Fs=xt(()=>{const b=[{value:"user",label:"User"},{value:"admin",label:"Admin"}];return l.value&&b.push({value:"superadmin",label:"Superadmin"}),b}),Di=G([]);async function qn(){if(!d.value)return;const b=await Uh();b.ok&&(Di.value=b.organizations.slice().sort((f,H)=>f.name.localeCompare(H.name)))}const Oo=xt(()=>{const b=Di.value.map(f=>({value:f.id,label:f.name}));return l.value&&b.unshift({value:"",label:"No organization"}),b});async function Yn(){if(!d.value)return;Gn.value=!0,as.value="";const b=await Fh();if(Gn.value=!1,!b.ok){as.value=b.status===403?"Manager role required.":"Could not load users.";return}rs.value=b.users.slice().sort((f,H)=>f.email.localeCompare(H.email))}function Ni(b){try{const f=b.data||{},H=Object.keys(f)[0];return H&&f[H]&&f[H].message||b.message||b.error||"Invalid input."}catch{return b.error||"Could not create user."}}async function Rr(){yi.value="";const b=re.email.trim().toLowerCase();if(!b.includes("@"))return yi.value="Enter a valid email.";if(re.password.length<8)return yi.value="Password must be at least 8 characters.";$i.value=!0;const f=l.value?re.organization:o.organization,{ok:H,body:k}=await Bh(b,re.password,re.role,f);if($i.value=!1,!H)return yi.value=Ni(k);re.email="",re.password="",re.role="user",re.organization="",jt("User created."),Yn()}async function Fr(b){const{ok:f,body:H}=await Zh(b.id);if(Ye.value="",!f)return jt(H.error||"Could not remove user.");jt("User removed."),Yn()}const Gt=xe({id:"",email:"",role:"user",verified:!1,password:"",organization:""}),An=G(""),Ri=G(!1),ls=xt(()=>!!Gt.id&&Gt.email===o.email);function us(b){Ye.value="",Gt.id=b.id,Gt.email=b.email,Gt.role=b.role||"user",Gt.verified=!!b.verified,Gt.password="",Gt.organization=b.organization||"",An.value=""}function In(){Gt.id="",An.value=""}async function Br(){An.value="";const b=Gt.email.trim().toLowerCase();if(!b.includes("@"))return An.value="Enter a valid email.";if(Gt.password&&Gt.password.length<8)return An.value="New password must be at least 8 characters (or leave blank).";const f={email:b,role:Gt.role,verified:Gt.verified};l.value&&(f.organization=Gt.organization),Gt.password&&(f.password=Gt.password),Ri.value=!0;const{ok:H,body:k}=await Vh(Gt.id,f);if(Ri.value=!1,!H)return An.value=Ni(k);jt("User updated."),In(),Yn()}const $n=xe({name:""}),Ce=G(""),Fi=G(!1),bi=G(""),kn=xe({id:"",name:""}),Sn=G(""),Bi=xt(()=>{const b={};for(const f of rs.value)f.organization&&(b[f.organization]=(b[f.organization]||0)+1);return b});async function Eo(){Ce.value="";const b=$n.name.trim();if(!b)return Ce.value="Enter an organization name.";Fi.value=!0;const{ok:f,body:H}=await Hh(b);if(Fi.value=!1,!f)return Ce.value=Ni(H);$n.name="",jt("Organization created."),qn()}function Vr(b){bi.value="",kn.id=b.id,kn.name=b.name,Sn.value=""}function Bs(){kn.id="",Sn.value=""}async function zo(){Sn.value="";const b=kn.name.trim();if(!b)return Sn.value="Enter an organization name.";const{ok:f,body:H}=await jh(kn.id,b);if(!f)return Sn.value=Ni(H);jt("Organization renamed."),Bs(),qn(),Yn()}async function en(b){const{ok:f,body:H}=await Wh(b.id);if(bi.value="",!f)return jt(H.error||"Could not delete organization.");jt("Organization deleted."),qn()}function xi(){const b={_app:"PilotVault",_kind:"settings-export",exportedAt:new Date().toISOString(),email:o.email,prefs:{...Tt},themeMode:qi.value},f=new Blob([JSON.stringify(b,null,2)],{type:"application/json"}),H=URL.createObjectURL(f),k=document.createElement("a");k.href=H,k.download=`pilotvault-settings-${new Date().toISOString().slice(0,10)}.json`,document.body.appendChild(k),k.click(),k.remove(),URL.revokeObjectURL(H),jt("Settings exported.")}const cs=G("");function Pn(b){const f=b.target.files&&b.target.files[0];if(!f)return;const H=new FileReader;H.onload=()=>{try{const k=JSON.parse(String(H.result)),qt=k.prefs||k;if(!Tc(qt))throw new Error("bad shape");k.themeMode&&lr(k.themeMode),Aa(Tt.fontSize),Ia(Tt.reduceMotion),cs.value="Settings imported and applied."}catch{cs.value="That file is not a valid PilotVault settings export."}},H.readAsText(f),b.target.value=""}const de=xe({understand:!1,typed:"",cooldown:0,armed:!1,msg:""});let cn=null;const Vs=xt(()=>o.email||"DELETE MY ACCOUNT"),Jn=xt(()=>de.understand&&de.typed===Vs.value);function Ao(){Jn.value&&(de.armed=!0,de.cooldown=5,clearInterval(cn),cn=setInterval(()=>{de.cooldown--,de.cooldown<=0&&clearInterval(cn)},1e3))}Qe(Jn,b=>{!b&&de.armed&&(de.armed=!1,de.cooldown=0,clearInterval(cn))});function ds(){if(!(!de.armed||de.cooldown>0)){try{localStorage.removeItem("pv_prefs")}catch{}de.msg="Account deletion requires the account service. Local data was cleared and you were signed out.",setTimeout(()=>a("logout"),900)}}return Yi(()=>{Et=setInterval(()=>Nt.value=Date.now(),1e3),qn(),Yn(),D(),Ms(),As(),Ns()}),vr(()=>{clearInterval(Et),clearInterval(cn),clearTimeout(zi)}),(b,f)=>(g(),x("div",Kp,[u("div",Gp,[f[62]||(f[62]=u("div",null,[u("div",{class:"eyebrow"},"Preferences"),u("h2",{class:"mt-0.5 text-[22px] font-bold tracking-tightest text-ink"},"Settings")],-1)),u("div",qp,[O(Y,{name:"search",size:16,class:"text-ink-muted"}),ot(u("input",{"onUpdate:modelValue":f[0]||(f[0]=H=>U.value=H),placeholder:"Search settings…",class:"w-full border-none bg-transparent text-sm text-ink outline-none placeholder:text-ink-muted"},null,512),[[vt,U.value]]),U.value?(g(),x("button",{key:0,class:"text-ink-muted hover:text-ink","aria-label":"Clear search",onClick:f[1]||(f[1]=H=>U.value="")},[O(Y,{name:"x",size:15})])):N("",!0)])]),u("div",Yp,[ot(u("nav",Jp,[(g(!0),x(ct,null,Wt(w.value,H=>(g(),x("button",{key:H.id,class:Ct(["flex items-center gap-2.5 rounded px-3 py-2.5 text-left text-sm transition",[A.value===H.id?H.danger?"bg-danger-soft font-semibold text-danger-fg":"bg-accent-soft font-semibold text-accent-soft-fg":H.danger?"font-medium text-danger-fg hover:bg-danger-soft":"font-medium text-ink-secondary hover:bg-surface-2"]]),onClick:k=>A.value=H.id},[O(Y,{name:H.icon,size:17},null,8,["name"]),u("span",Qp,P(H.label),1)],10,Xp))),128))],512),[[oh,!V.value]]),u("div",tm,[V.value&&!q.value.length?(g(),x("div",em," No settings match “"+P(U.value)+"”. ",1)):N("",!0),(g(!0),x(ct,null,Wt(q.value,H=>(g(),x(ct,{key:H.id},[V.value?(g(),x("div",nm,[O(Y,{name:H.icon,size:14},null,8,["name"]),$(" "+P(H.label),1)])):N("",!0),H.id==="account"?(g(),x("div",im,[O(_t,{title:"Full name",desc:"Shown to your team on flights and audit logs.",keywords:"full name account"},{default:mt(()=>[ot(u("input",{"onUpdate:modelValue":f[2]||(f[2]=k=>$t(Tt).name=k),class:"field w-56",placeholder:"Jane Operator",onBlur:f[3]||(f[3]=k=>jt("Saved."))},null,544),[[vt,$t(Tt).name]])]),_:1}),O(_t,{title:"Username",desc:"Your unique handle within PilotVault.",keywords:"username handle"},{default:mt(()=>[u("div",sm,[f[63]||(f[63]=u("span",{class:"text-sm text-ink-muted"},"@",-1)),ot(u("input",{"onUpdate:modelValue":f[4]||(f[4]=k=>$t(Tt).username=k),class:"field w-48",placeholder:"jane",onBlur:f[5]||(f[5]=k=>jt("Saved."))},null,544),[[vt,$t(Tt).username]])])]),_:1}),O(_t,{title:"Email address",desc:"Used for sign-in and notifications.",keywords:"email verification verify"},{default:mt(()=>[u("div",om,[u("span",rm,P(e.email||"—"),1),u("span",am,[O(Y,{name:"mail",size:12}),f[64]||(f[64]=$(" Unverified ",-1))])])]),_:1}),O(_t,{title:"Role",desc:"Your access level in PilotVault.",keywords:"role admin user superadmin access rights permissions"},{default:mt(()=>[u("span",{class:Ct(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",y(e.role)])},[O(Y,{name:_(e.role),size:12},null,8,["name"]),$(P(h(e.role)),1)],2)]),_:1}),O(_t,{title:"Organization",desc:"The organization your account belongs to.",keywords:"organization org tenant company"},{default:mt(()=>[u("span",{class:Ct(["text-sm",e.organizationName?"text-ink":"text-ink-muted"])},P(e.organizationName||(l.value?"All organizations":"None")),3)]),_:1}),O(_t,{block:"",title:"Verify email",desc:"Confirm ownership to enable password resets and alerts.",keywords:"verify email resend"},{default:mt(()=>[u("button",{class:"btn-ghost",onClick:So},"Send verification link"),wn.value?(g(),x("p",lm,P(wn.value),1)):N("",!0)]),_:1}),O(_t,{block:"",title:"Change password",desc:"Use at least 8 characters.",keywords:"password change current new"},{default:mt(()=>[u("div",um,[ot(u("input",{"onUpdate:modelValue":f[6]||(f[6]=k=>we.current=k),type:"password",class:"field",placeholder:"Current password"},null,512),[[vt,we.current]]),ot(u("input",{"onUpdate:modelValue":f[7]||(f[7]=k=>we.next=k),type:"password",class:"field",placeholder:"New password"},null,512),[[vt,we.next]]),ot(u("input",{"onUpdate:modelValue":f[8]||(f[8]=k=>we.confirm=k),type:"password",class:"field",placeholder:"Confirm new password"},null,512),[[vt,we.confirm]]),u("div",cm,[u("button",{class:"btn-accent",onClick:Le},"Update password"),zn.value?(g(),x("span",{key:0,class:Ct(["text-xs",vi.value?"text-success-fg":"text-ink-muted"])},P(zn.value),3)):N("",!0)])])]),_:1})])):H.id==="appearance"?(g(),x("div",dm,[O(_t,{title:"Theme",desc:"Light, dark, or follow your system.",keywords:"theme light dark system appearance"},{default:mt(()=>[O(hn,{modelValue:dt.value,"onUpdate:modelValue":f[9]||(f[9]=k=>dt.value=k),options:it},null,8,["modelValue"])]),_:1}),O(_t,{title:"Font size",desc:"Scales the entire interface for readability.",keywords:"font size accessibility text"},{default:mt(()=>[O(hn,{modelValue:$t(Tt).fontSize,"onUpdate:modelValue":f[10]||(f[10]=k=>$t(Tt).fontSize=k),options:ht},null,8,["modelValue"])]),_:1}),O(_t,{title:"Reduce motion",desc:"Minimise animations and transitions.",keywords:"reduce motion accessibility animation"},{default:mt(()=>[O(nn,{modelValue:$t(Tt).reduceMotion,"onUpdate:modelValue":f[11]||(f[11]=k=>$t(Tt).reduceMotion=k)},null,8,["modelValue"])]),_:1}),O(_t,{title:"Language",desc:"Interface language.",keywords:"language locale"},{default:mt(()=>[ot(u("select",{"onUpdate:modelValue":f[12]||(f[12]=k=>$t(Tt).language=k),class:"field w-48"},[(g(),x(ct,null,Wt(he,([k,qt])=>u("option",{key:k,value:k},P(qt),9,fm)),64))],512),[[sn,$t(Tt).language]])]),_:1}),O(_t,{title:"Region",desc:"Affects number, unit and date defaults.",keywords:"region country locale"},{default:mt(()=>[ot(u("select",{"onUpdate:modelValue":f[13]||(f[13]=k=>$t(Tt).region=k),class:"field w-48"},[(g(),x(ct,null,Wt(pe,([k,qt])=>u("option",{key:k,value:k},P(qt),9,hm)),64))],512),[[sn,$t(Tt).region]])]),_:1}),O(_t,{title:"Date format",desc:"How calendar dates are displayed.",keywords:"date format"},{default:mt(()=>[ot(u("select",{"onUpdate:modelValue":f[14]||(f[14]=k=>$t(Tt).dateFormat=k),class:"field w-48"},[(g(),x(ct,null,Wt(St,([k,qt])=>u("option",{key:k,value:k},P(qt),9,pm)),64))],512),[[sn,$t(Tt).dateFormat]])]),_:1}),O(_t,{title:"Time format",desc:"12- or 24-hour clock.",keywords:"time format clock 12 24 hour"},{default:mt(()=>[O(hn,{modelValue:$t(Tt).timeFormat,"onUpdate:modelValue":f[15]||(f[15]=k=>$t(Tt).timeFormat=k),options:Kt},null,8,["modelValue"])]),_:1}),O(_t,{title:"Preview",desc:"How timestamps appear across the app.",keywords:"preview date time"},{default:mt(()=>[u("span",mm,P(nt.value),1)]),_:1}),f[65]||(f[65]=u("p",{class:"mt-3 text-xs text-ink-muted"}," Language & region are stored now; full localisation ships with the account service. ",-1))])):H.id==="integrations"?(g(),x("div",gm,[V.value?N("",!0):(g(),x("div",_m,[(g(),x(ct,null,Wt(un,k=>u("button",{key:k.id,type:"button",class:Ct(["-mb-px inline-flex items-center gap-1.5 whitespace-nowrap border-b-2 px-3 py-2 text-sm font-semibold transition",te.value===k.id?"border-accent text-ink":"border-transparent text-ink-secondary hover:text-ink"]),onClick:qt=>te.value=k.id},[O(Y,{name:k.icon,size:16},null,8,["name"]),$(P(k.label),1)],10,vm)),64))])),ss("apis-external")?(g(),x("div",ym,[u("div",bm,[u("div",xm,[O(Y,{name:"radio",size:20})]),f[66]||(f[66]=u("div",{class:"min-w-0"},[u("div",{class:"text-sm font-semibold text-ink"},"OpenSky Network"),u("div",{class:"mt-0.5 text-xs text-ink-muted"}," Live ADS-B aircraft data. Configure your own OAuth2 credentials, plan and default bounding box. ")],-1))]),ut.loaded&&!ut.available?(g(),x("div",wm,[O(Y,{name:"lock",size:14,class:"mr-1 inline"}),f[67]||(f[67]=$(" OpenSky is currently disabled by your administrator. Contact them to enable it. ",-1))])):N("",!0),ut.canEditOrg?(g(),x("div",km,[f[68]||(f[68]=u("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),O(hn,{modelValue:zt.value,"onUpdate:modelValue":f[16]||(f[16]=k=>zt.value=k),options:_e},null,8,["modelValue"])])):N("",!0),m.value?(g(),ie(_t,{key:2,title:"Enable OpenSky (organization-wide)",desc:"Turn OpenSky on or off for everyone in your organization.",keywords:"enable disable plugin opensky organization"},{default:mt(()=>[O(nn,{"model-value":ut.orgEnabled,disabled:!ut.available,"onUpdate:modelValue":K},null,8,["model-value","disabled"])]),_:1})):(g(),ie(_t,{key:3,title:"Enable OpenSky",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin opensky"},{default:mt(()=>[O(nn,{"model-value":ut.enabled,disabled:!ut.available||!ut.orgEnabled,"onUpdate:modelValue":K},null,8,["model-value","disabled"])]),_:1})),!m.value&&ut.available&&!ut.orgEnabled?(g(),x("div",Sm,[O(Y,{name:"lock",size:13,class:"mr-1 inline"}),f[70]||(f[70]=$("OpenSky is turned off for your organization",-1)),ut.canEditOrg?(g(),x("span",Pm,[...f[69]||(f[69]=[$(" — switch to ",-1),u("span",{class:"font-semibold"},"Organization",-1),$(" to turn it back on",-1)])])):N("",!0),f[71]||(f[71]=$(". ",-1))])):N("",!0),m.value?(g(),x("div",Tm,[O(Y,{name:"users",size:13,class:"mr-1 inline"}),f[72]||(f[72]=$("These are organization-wide settings — they apply to everyone in ",-1)),u("span",Lm,P(e.organizationName||"your organization"),1),f[73]||(f[73]=$(". Leave a field blank to let each user choose their own; a value set here overrides the user's. ",-1))])):se.value?(g(),x("div",Cm," As a superadmin you manage the global OpenSky configuration in the API Server panel. The effective configuration is shown below. ")):N("",!0),ut.available&&!m.value?(g(),x("div",Mm,[u("div",Om,[u("div",Em,[O(Y,{name:"signal",size:15}),f[74]||(f[74]=$("Credit usage ",-1))]),pt.value?(g(),x("span",zm,"Checked "+P(Bt()),1)):N("",!0)]),kt.value?(g(),x(ct,{key:0},[kt.value.remaining!=null?(g(),x(ct,{key:0},[u("div",Am,[u("span",Im,P(Jt(kt.value.remaining)),1),u("span",$m,"/ "+P(Jt(kt.value.daily))+" credits left today",1)]),u("div",Dm,[u("div",{class:Ct(["h-full rounded-full transition-all",ae.value]),style:Ss({width:Yt.value+"%"})},null,6)]),u("div",Nm," Used "+P(Jt(kt.value.daily-kt.value.remaining))+" today · "+P(kt.value.probeCost)+" credit"+P(kt.value.probeCost===1?"":"s")+" per query · "+P(kt.value.mode),1)],64)):(g(),x(ct,{key:1},[u("div",Rm,[f[75]||(f[75]=$("Daily allowance: ",-1)),u("span",Fm,P(Jt(kt.value.daily)),1),f[76]||(f[76]=$(" credits",-1))]),u("div",Bm,P(kt.value.probeCost)+" credit"+P(kt.value.probeCost===1?"":"s")+" per query · "+P(kt.value.mode)+". OpenSky only reports live remaining credits for authenticated requests — add OAuth2 credentials below to track usage. ",1)],64))],64)):(g(),x("div",Vm,[...f[77]||(f[77]=[$(" Run ",-1),u("span",{class:"font-semibold text-ink-secondary"},"Test connection",-1),$(" below to fetch your live OpenSky credit balance. ",-1)])]))])):N("",!0),O(_t,{title:"OpenSky plan",desc:"Your account tier — sets the daily credit allowance.",keywords:"plan tier credits"},{default:mt(()=>[F("plan")?(g(),x("span",Zm,[$(P((E.find(k=>k.value===M("plan").effective)||{}).label||M("plan").effective||"—")+" ",1),R("plan")?(g(),x("span",Um,[O(Y,{name:"lock",size:10}),$(P(R("plan")),1)])):N("",!0)])):(g(),ie(hn,{key:1,modelValue:Ft.plan,"onUpdate:modelValue":f[17]||(f[17]=k=>Ft.plan=k),options:E},null,8,["modelValue"]))]),_:1}),O(_t,{title:"Default bounding box",desc:"lamin,lomin,lamax,lomax — used for live queries and the health probe.",keywords:"bounding box bbox area"},{default:mt(()=>[F("bbox")?(g(),x("span",Hm,[$(P(M("bbox").effective||"—")+" ",1),R("bbox")?(g(),x("span",jm,[O(Y,{name:"lock",size:10}),$(P(R("bbox")),1)])):N("",!0)])):ot((g(),x("input",{key:1,"onUpdate:modelValue":f[18]||(f[18]=k=>Ft.bbox=k),class:"field w-64 font-mono",placeholder:"50.5,3.2,53.7,7.3"},null,512)),[[vt,Ft.bbox]])]),_:1}),O(_t,{title:"OAuth2 client ID",desc:"Optional — leave blank for anonymous access (lower limits).",keywords:"oauth client id credentials"},{default:mt(()=>[F("clientId")?(g(),x("span",Wm,[$(P(M("clientId").effective||"—")+" ",1),R("clientId")?(g(),x("span",Km,[O(Y,{name:"lock",size:10}),$(P(R("clientId")),1)])):N("",!0)])):ot((g(),x("input",{key:1,"onUpdate:modelValue":f[19]||(f[19]=k=>Ft.clientId=k),class:"field w-64",placeholder:"your-api-client"},null,512)),[[vt,Ft.clientId]])]),_:1}),O(_t,{title:"OAuth2 client secret",desc:"Paired with the client ID for authenticated access.",keywords:"oauth client secret credentials password"},{default:mt(()=>[F("clientSecret")?(g(),x("span",Gm,[$(P(M("clientSecret").effective||"—")+" ",1),R("clientSecret")?(g(),x("span",qm,[O(Y,{name:"lock",size:10}),$(P(R("clientSecret")),1)])):N("",!0)])):ot((g(),x("input",{key:1,"onUpdate:modelValue":f[20]||(f[20]=k=>Ft.clientSecret=k),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[vt,Ft.clientSecret]])]),_:1}),ut.available&&!ut.allowAnonymous?(g(),x("div",Ym," Anonymous access is disabled by the administrator — OpenSky needs OAuth2 credentials from some layer to work. ")):N("",!0),u("div",Jm,[se.value?N("",!0):(g(),x("button",{key:0,class:"btn-accent",disabled:At.value||!ut.available,onClick:Z},P(At.value?"Saving…":m.value?"Save organization settings":"Save settings"),9,Xm)),m.value?N("",!0):(g(),x("button",{key:1,class:"btn-ghost",disabled:et.value||!ut.available,onClick:yt},P(et.value?"Testing…":"Test connection"),9,Qm)),lt.value?(g(),x("span",tg,P(lt.value),1)):N("",!0),ce.value&&!m.value?(g(),x("span",{key:3,class:Ct(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",st(ce.value.status)])},[f[78]||(f[78]=u("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(P(ce.value.detail||ce.value.status),1)],2)):N("",!0)])])):N("",!0),ss("drives-external")?(g(),x(ct,{key:2},[u("div",eg,[u("div",ng,[u("div",ig,[O(Y,{name:"server",size:20})]),f[79]||(f[79]=u("div",{class:"min-w-0"},[u("div",{class:"text-sm font-semibold text-ink"},"File Transfer (FTP / SFTP)"),u("div",{class:"mt-0.5 text-xs text-ink-muted"}," Connect to an FTP, FTPS or SFTP server. Configure the connection your account uses for file transfers. ")],-1))]),tt.loaded&&!tt.available?(g(),x("div",sg,[O(Y,{name:"lock",size:14,class:"mr-1 inline"}),f[80]||(f[80]=$(" File transfer is currently disabled by your administrator. Contact them to enable it. ",-1))])):N("",!0),tt.canEditOrg?(g(),x("div",og,[f[81]||(f[81]=u("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),O(hn,{modelValue:bt.value,"onUpdate:modelValue":f[21]||(f[21]=k=>bt.value=k),options:_e},null,8,["modelValue"])])):N("",!0),Be.value?(g(),ie(_t,{key:2,title:"Enable file transfer (organization-wide)",desc:"Turn it on or off for everyone in your organization.",keywords:"enable disable plugin ftp sftp organization"},{default:mt(()=>[O(nn,{"model-value":tt.orgEnabled,disabled:!tt.available,"onUpdate:modelValue":vo},null,8,["model-value","disabled"])]),_:1})):(g(),ie(_t,{key:3,title:"Enable file transfer",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin ftp sftp"},{default:mt(()=>[O(nn,{"model-value":tt.enabled,disabled:!tt.available||!tt.orgEnabled,"onUpdate:modelValue":vo},null,8,["model-value","disabled"])]),_:1})),!Be.value&&tt.available&&!tt.orgEnabled?(g(),x("div",rg,[O(Y,{name:"lock",size:13,class:"mr-1 inline"}),f[83]||(f[83]=$("File transfer is turned off for your organization",-1)),tt.canEditOrg?(g(),x("span",ag,[...f[82]||(f[82]=[$(" — switch to ",-1),u("span",{class:"font-semibold"},"Organization",-1),$(" to turn it back on",-1)])])):N("",!0),f[84]||(f[84]=$(". ",-1))])):N("",!0),Be.value?(g(),x("div",lg,[O(Y,{name:"users",size:13,class:"mr-1 inline"}),f[85]||(f[85]=$("These are organization-wide settings — they apply to everyone in ",-1)),u("span",ug,P(e.organizationName||"your organization"),1),f[86]||(f[86]=$(". Leave the connection blank to let each user configure their own; a connection set here overrides the user's. ",-1))])):ke.value?(g(),x("div",cg," As a superadmin you manage the global file-transfer configuration in the API Server panel. The effective configuration is shown below. ")):N("",!0),O(_t,{title:"Protocol",desc:"SFTP (over SSH), FTPS (FTP over TLS), or plain FTP.",keywords:"protocol sftp ftps ftp"},{default:mt(()=>[Ve("protocol")?(g(),x("span",dg,[$(P(wr(Ee("protocol").effective))+" ",1),ye("protocol")?(g(),x("span",fg,[O(Y,{name:"lock",size:10}),$(P(ye("protocol")),1)])):N("",!0)])):(g(),ie(hn,{key:1,modelValue:gt.protocol,"onUpdate:modelValue":f[22]||(f[22]=k=>gt.protocol=k),options:vn},null,8,["modelValue"]))]),_:1}),O(_t,{title:"Host",desc:"Server hostname or IP address.",keywords:"host server address"},{default:mt(()=>[Ve("host")?(g(),x("span",hg,[$(P(Ee("host").effective||"—")+" ",1),ye("host")?(g(),x("span",pg,[O(Y,{name:"lock",size:10}),$(P(ye("host")),1)])):N("",!0)])):ot((g(),x("input",{key:1,"onUpdate:modelValue":f[23]||(f[23]=k=>gt.host=k),class:"field w-64",placeholder:"files.example.com"},null,512)),[[vt,gt.host]])]),_:1}),O(_t,{title:"Port",desc:"Leave blank for the protocol default (22 for SFTP, 21 for FTP/FTPS).",keywords:"port"},{default:mt(()=>[Ve("port")?(g(),x("span",mg,[$(P(Ee("port").effective||"default")+" ",1),ye("port")?(g(),x("span",gg,[O(Y,{name:"lock",size:10}),$(P(ye("port")),1)])):N("",!0)])):ot((g(),x("input",{key:1,"onUpdate:modelValue":f[24]||(f[24]=k=>gt.port=k),inputmode:"numeric",class:"field w-24 font-mono",placeholder:"22"},null,512)),[[vt,gt.port]])]),_:1}),O(_t,{title:"Username",desc:"Account used to authenticate.",keywords:"username login account"},{default:mt(()=>[Ve("username")?(g(),x("span",_g,[$(P(Ee("username").effective||"—")+" ",1),ye("username")?(g(),x("span",vg,[O(Y,{name:"lock",size:10}),$(P(ye("username")),1)])):N("",!0)])):ot((g(),x("input",{key:1,"onUpdate:modelValue":f[25]||(f[25]=k=>gt.username=k),class:"field w-64",placeholder:"user"},null,512)),[[vt,gt.username]])]),_:1}),O(_t,{title:"Password",desc:"Password auth for FTP/FTPS, or SFTP password login. Leave blank to use a key.",keywords:"password secret credentials"},{default:mt(()=>[Ve("password")?(g(),x("span",yg,[$(P(Ee("password").effective||"—")+" ",1),ye("password")?(g(),x("span",bg,[O(Y,{name:"lock",size:10}),$(P(ye("password")),1)])):N("",!0)])):ot((g(),x("input",{key:1,"onUpdate:modelValue":f[26]||(f[26]=k=>gt.password=k),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[vt,gt.password]])]),_:1}),Ji.value==="sftp"?(g(),ie(_t,{key:7,block:"",title:"SSH private key",desc:"PEM key for SFTP key auth — used instead of, or alongside, a password.",keywords:"private key ssh pem identity"},{default:mt(()=>[Ve("privateKey")?(g(),x("span",xg,[$(P(Ee("privateKey").effective||"—")+" ",1),ye("privateKey")?(g(),x("span",wg,[O(Y,{name:"lock",size:10}),$(P(ye("privateKey")),1)])):N("",!0)])):ot((g(),x("textarea",{key:1,"onUpdate:modelValue":f[27]||(f[27]=k=>gt.privateKey=k),rows:"3",class:"field w-full font-mono text-xs",placeholder:"-----BEGIN OPENSSH PRIVATE KEY-----"},null,512)),[[vt,gt.privateKey]])]),_:1})):N("",!0),Ji.value==="sftp"?(g(),ie(_t,{key:8,title:"Private key passphrase",desc:"Passphrase protecting the SSH private key, if any.",keywords:"passphrase key secret"},{default:mt(()=>[Ve("keyPassphrase")?(g(),x("span",kg,[$(P(Ee("keyPassphrase").effective||"—")+" ",1),ye("keyPassphrase")?(g(),x("span",Sg,[O(Y,{name:"lock",size:10}),$(P(ye("keyPassphrase")),1)])):N("",!0)])):ot((g(),x("input",{key:1,"onUpdate:modelValue":f[28]||(f[28]=k=>gt.keyPassphrase=k),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[vt,gt.keyPassphrase]])]),_:1})):N("",!0),Ji.value==="sftp"?(g(),ie(_t,{key:9,title:"Host key fingerprint",desc:"Optional SHA256:… fingerprint to pin the server's host key. Blank accepts any key.",keywords:"host key fingerprint verify trust"},{default:mt(()=>[Ve("hostKeyFingerprint")?(g(),x("span",Pg,[$(P(Ee("hostKeyFingerprint").effective||"—")+" ",1),ye("hostKeyFingerprint")?(g(),x("span",Tg,[O(Y,{name:"lock",size:10}),$(P(ye("hostKeyFingerprint")),1)])):N("",!0)])):ot((g(),x("input",{key:1,"onUpdate:modelValue":f[29]||(f[29]=k=>gt.hostKeyFingerprint=k),class:"field w-full font-mono text-xs",placeholder:"SHA256:…"},null,512)),[[vt,gt.hostKeyFingerprint]])]),_:1})):N("",!0),Ji.value==="ftps"?(g(),ie(_t,{key:10,title:"TLS verification",desc:"Skip only for self-signed test servers.",keywords:"tls certificate verify insecure ftps"},{default:mt(()=>[Ve("insecureSkipVerify")?(g(),x("span",Lg,[$(P(Ee("insecureSkipVerify").effective==="true"?"Skip verification":"Verify certificate")+" ",1),ye("insecureSkipVerify")?(g(),x("span",Cg,[O(Y,{name:"lock",size:10}),$(P(ye("insecureSkipVerify")),1)])):N("",!0)])):(g(),ie(hn,{key:1,modelValue:gt.insecureSkipVerify,"onUpdate:modelValue":f[30]||(f[30]=k=>gt.insecureSkipVerify=k),options:ci},null,8,["modelValue"]))]),_:1})):N("",!0),O(_t,{title:"Base path",desc:"Working directory and health-check target, e.g. /uploads.",keywords:"base path directory folder root"},{default:mt(()=>[Ve("basePath")?(g(),x("span",Mg,[$(P(Ee("basePath").effective||"—")+" ",1),ye("basePath")?(g(),x("span",Og,[O(Y,{name:"lock",size:10}),$(P(ye("basePath")),1)])):N("",!0)])):ot((g(),x("input",{key:1,"onUpdate:modelValue":f[31]||(f[31]=k=>gt.basePath=k),class:"field w-64 font-mono",placeholder:"/uploads"},null,512)),[[vt,gt.basePath]])]),_:1}),u("div",Eg,[ke.value?N("",!0):(g(),x("button",{key:0,class:"btn-accent",disabled:le.value||!tt.available,onClick:Tr},P(le.value?"Saving…":Be.value?"Save organization settings":"Save settings"),9,zg)),Be.value?N("",!0):(g(),x("button",{key:1,class:"btn-ghost",disabled:me.value||!tt.available,onClick:Lr},P(me.value?"Testing…":"Test connection"),9,Ag)),Ht.value?(g(),x("span",Ig,P(Ht.value),1)):N("",!0),Te.value&&!Be.value?(g(),x("span",$g,"Checked "+P(kr()),1)):N("",!0),ve.value&&!Be.value?(g(),x("span",{key:4,class:Ct(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",Cr(ve.value.status)])},[f[87]||(f[87]=u("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(P(ve.value.detail||ve.value.status),1)],2)):N("",!0)])]),u("div",Dg,[u("div",Ng,[u("div",Rg,[O(Y,{name:"cloud",size:20})]),f[88]||(f[88]=u("div",{class:"min-w-0"},[u("div",{class:"text-sm font-semibold text-ink"},"WebDAV"),u("div",{class:"mt-0.5 text-xs text-ink-muted"}," Connect to a WebDAV server (Nextcloud, ownCloud, IIS, …). Configure the connection your account uses. ")],-1))]),Vt.loaded&&!Vt.available?(g(),x("div",Fg,[O(Y,{name:"lock",size:14,class:"mr-1 inline"}),f[89]||(f[89]=$(" WebDAV is currently disabled by your administrator. Contact them to enable it. ",-1))])):N("",!0),Vt.canEditOrg?(g(),x("div",Bg,[f[90]||(f[90]=u("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),O(hn,{modelValue:ft.value,"onUpdate:modelValue":f[32]||(f[32]=k=>ft.value=k),options:_e},null,8,["modelValue"])])):N("",!0),an.value?(g(),ie(_t,{key:2,title:"Enable WebDAV (organization-wide)",desc:"Turn it on or off for everyone in your organization.",keywords:"enable disable plugin webdav organization"},{default:mt(()=>[O(nn,{"model-value":Vt.orgEnabled,disabled:!Vt.available,"onUpdate:modelValue":pi},null,8,["model-value","disabled"])]),_:1})):(g(),ie(_t,{key:3,title:"Enable WebDAV",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin webdav"},{default:mt(()=>[O(nn,{"model-value":Vt.enabled,disabled:!Vt.available||!Vt.orgEnabled,"onUpdate:modelValue":pi},null,8,["model-value","disabled"])]),_:1})),!an.value&&Vt.available&&!Vt.orgEnabled?(g(),x("div",Vg,[O(Y,{name:"lock",size:13,class:"mr-1 inline"}),f[92]||(f[92]=$("WebDAV is turned off for your organization",-1)),Vt.canEditOrg?(g(),x("span",Zg,[...f[91]||(f[91]=[$(" — switch to ",-1),u("span",{class:"font-semibold"},"Organization",-1),$(" to turn it back on",-1)])])):N("",!0),f[93]||(f[93]=$(". ",-1))])):N("",!0),an.value?(g(),x("div",Ug,[O(Y,{name:"users",size:13,class:"mr-1 inline"}),f[94]||(f[94]=$("These are organization-wide settings — they apply to everyone in ",-1)),u("span",Hg,P(e.organizationName||"your organization"),1),f[95]||(f[95]=$(". Leave the connection blank to let each user configure their own; a connection set here overrides the user's. ",-1))])):Os.value?(g(),x("div",jg," As a superadmin you manage the global WebDAV configuration in the API Server panel. The effective configuration is shown below. ")):N("",!0),O(_t,{block:"",title:"Server URL",desc:"WebDAV endpoint including scheme, e.g. https://cloud.example.com/remote.php/dav/files/alice/.",keywords:"url server address endpoint webdav host"},{default:mt(()=>[hi("baseURL")?(g(),x("span",Wg,[$(P(yn("baseURL").effective||"—")+" ",1),Ze("baseURL")?(g(),x("span",Kg,[O(Y,{name:"lock",size:10}),$(P(Ze("baseURL")),1)])):N("",!0)])):ot((g(),x("input",{key:1,"onUpdate:modelValue":f[33]||(f[33]=k=>ze.baseURL=k),class:"field w-full font-mono text-xs",placeholder:"https://cloud.example.com/remote.php/dav/files/alice/"},null,512)),[[vt,ze.baseURL]])]),_:1}),O(_t,{title:"Username",desc:"Account used to authenticate (leave blank for a public share).",keywords:"username login account"},{default:mt(()=>[hi("username")?(g(),x("span",Gg,[$(P(yn("username").effective||"—")+" ",1),Ze("username")?(g(),x("span",qg,[O(Y,{name:"lock",size:10}),$(P(Ze("username")),1)])):N("",!0)])):ot((g(),x("input",{key:1,"onUpdate:modelValue":f[34]||(f[34]=k=>ze.username=k),class:"field w-64",placeholder:"user"},null,512)),[[vt,ze.username]])]),_:1}),O(_t,{title:"Password",desc:"Password or app-specific token for HTTP Basic auth.",keywords:"password secret credentials token"},{default:mt(()=>[hi("password")?(g(),x("span",Yg,[$(P(yn("password").effective||"—")+" ",1),Ze("password")?(g(),x("span",Jg,[O(Y,{name:"lock",size:10}),$(P(Ze("password")),1)])):N("",!0)])):ot((g(),x("input",{key:1,"onUpdate:modelValue":f[35]||(f[35]=k=>ze.password=k),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[vt,ze.password]])]),_:1}),O(_t,{title:"TLS verification",desc:"Only affects HTTPS. Skip only for self-signed test servers.",keywords:"tls certificate verify insecure https"},{default:mt(()=>[hi("insecureSkipVerify")?(g(),x("span",Xg,[$(P(yn("insecureSkipVerify").effective==="true"?"Skip verification":"Verify certificate")+" ",1),Ze("insecureSkipVerify")?(g(),x("span",Qg,[O(Y,{name:"lock",size:10}),$(P(Ze("insecureSkipVerify")),1)])):N("",!0)])):(g(),ie(hn,{key:1,modelValue:ze.insecureSkipVerify,"onUpdate:modelValue":f[36]||(f[36]=k=>ze.insecureSkipVerify=k),options:yo},null,8,["modelValue"]))]),_:1}),O(_t,{title:"Base path",desc:"Working directory under the server URL and health-check target, e.g. /Documents.",keywords:"base path directory folder root"},{default:mt(()=>[hi("basePath")?(g(),x("span",t_,[$(P(yn("basePath").effective||"—")+" ",1),Ze("basePath")?(g(),x("span",e_,[O(Y,{name:"lock",size:10}),$(P(Ze("basePath")),1)])):N("",!0)])):ot((g(),x("input",{key:1,"onUpdate:modelValue":f[37]||(f[37]=k=>ze.basePath=k),class:"field w-64 font-mono",placeholder:"/Documents"},null,512)),[[vt,ze.basePath]])]),_:1}),u("div",n_,[Os.value?N("",!0):(g(),x("button",{key:0,class:"btn-accent",disabled:Ci.value||!Vt.available,onClick:xo},P(Ci.value?"Saving…":an.value?"Save organization settings":"Save settings"),9,i_)),an.value?N("",!0):(g(),x("button",{key:1,class:"btn-ghost",disabled:fi.value||!Vt.available,onClick:wo},P(fi.value?"Testing…":"Test connection"),9,s_)),di.value?(g(),x("span",o_,P(di.value),1)):N("",!0),tn.value&&!an.value?(g(),x("span",r_,"Checked "+P(Or()),1)):N("",!0),rn.value&&!an.value?(g(),x("span",{key:4,class:Ct(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",Mi(rn.value.status)])},[f[96]||(f[96]=u("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(P(rn.value.detail||rn.value.status),1)],2)):N("",!0)])])],64)):N("",!0),ss("drives-local")?(g(),x("div",a_,[u("div",l_,[u("div",u_,[O(Y,{name:"monitor",size:20})]),f[97]||(f[97]=u("div",{class:"min-w-0"},[u("div",{class:"text-sm font-semibold text-ink"},"Local Storage"),u("div",{class:"mt-0.5 text-xs text-ink-muted"}," A private folder on the server for your files. Each user has their own; members of an organization share one. ")],-1))]),X.loaded&&!X.available?(g(),x("div",c_,[O(Y,{name:"lock",size:14,class:"mr-1 inline"}),f[98]||(f[98]=$(" Local storage is currently disabled by your administrator. Contact them to enable it. ",-1))])):X.loaded&&!X.rootConfigured?(g(),x("div",d_,[O(Y,{name:"alertTriangle",size:14,class:"mr-1 inline"}),f[99]||(f[99]=$(" No storage root has been configured by your administrator yet. ",-1))])):N("",!0),X.canEditOrg?(g(),x("div",f_,[f[100]||(f[100]=u("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),O(hn,{modelValue:Qt.value,"onUpdate:modelValue":f[38]||(f[38]=k=>Qt.value=k),options:_e},null,8,["modelValue"])])):N("",!0),Se.value?(g(),ie(_t,{key:3,title:"Enable local storage (organization-wide)",desc:"Turn it on or off for everyone in your organization.",keywords:"enable disable plugin local storage folder organization"},{default:mt(()=>[O(nn,{"model-value":X.orgEnabled,disabled:!X.available,"onUpdate:modelValue":ns},null,8,["model-value","disabled"])]),_:1})):(g(),ie(_t,{key:4,title:"Enable local storage",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin local storage folder"},{default:mt(()=>[O(nn,{"model-value":X.enabled,disabled:!X.available||!X.orgEnabled,"onUpdate:modelValue":ns},null,8,["model-value","disabled"])]),_:1})),!Se.value&&X.available&&!X.orgEnabled?(g(),x("div",h_,[O(Y,{name:"lock",size:13,class:"mr-1 inline"}),f[102]||(f[102]=$("Local storage is turned off for your organization",-1)),X.canEditOrg?(g(),x("span",p_,[...f[101]||(f[101]=[$(" — switch to ",-1),u("span",{class:"font-semibold"},"Organization",-1),$(" to turn it back on",-1)])])):N("",!0),f[103]||(f[103]=$(". ",-1))])):N("",!0),Se.value?(g(),x("div",m_,[O(Y,{name:"users",size:13,class:"mr-1 inline"}),f[104]||(f[104]=$("These are organization-wide settings — they apply to everyone in ",-1)),u("span",g_,P(e.organizationName||"your organization"),1),f[105]||(f[105]=$(", who all share the organization folder. Members can additionally enable a private folder inside it. ",-1))])):$e.value?(g(),x("div",__," As a superadmin you manage the global storage root in the API Server panel. The effective configuration is shown below. ")):N("",!0),Se.value?(g(),ie(_t,{key:8,title:"Private folders",desc:"Let members create a private folder inside the organization folder, reachable only by them.",keywords:"private folder members allow policy organization"},{default:mt(()=>[O(nn,{"model-value":X.allowPrivate,disabled:!X.available,"onUpdate:modelValue":ko},null,8,["model-value","disabled"])]),_:1})):N("",!0),Se.value?N("",!0):(g(),x(ct,{key:9},[O(_t,{block:"",title:"Your folders",desc:"Assigned automatically and isolated — no one else can reach your private folder.",keywords:"folder directory path storage location isolated private shared"},{default:mt(()=>[u("div",v_,[(g(!0),x(ct,null,Wt(X.mounts,k=>(g(),x("div",{key:k.id,class:"flex flex-wrap items-center gap-2"},[u("span",y_,P(k.path),1),k.kind==="shared"?(g(),x("span",b_,[O(Y,{name:"users",size:10}),f[106]||(f[106]=$("Shared with your organization",-1))])):(g(),x("span",x_,[O(Y,{name:"lock",size:10}),f[107]||(f[107]=$("Private to you",-1))])),Wn.value[k.id]?(g(),x("span",{key:2,class:Ct(["inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[10px] font-semibold",It(Wn.value[k.id].status)])},[f[108]||(f[108]=u("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(P(Wn.value[k.id].status),1)],2)):N("",!0)]))),128)),X.mounts.length?N("",!0):(g(),x("div",w_,P(X.rootConfigured?"No folder assigned yet.":"Waiting for the administrator to configure a storage root."),1))])]),_:1}),X.isOrgUser&&X.allowPrivate?(g(),ie(_t,{key:0,title:"My private folder",desc:"Add a private folder inside the organization folder, reachable only by you — you keep the shared folder too.",keywords:"private folder personal isolated organization inside"},{default:mt(()=>[O(nn,{"model-value":X.privateFolder,disabled:!X.available||!X.orgEnabled,"onUpdate:modelValue":is},null,8,["model-value","disabled"])]),_:1})):X.isOrgUser&&!X.allowPrivate?(g(),x("div",k_,[O(Y,{name:"lock",size:13,class:"mr-1 inline"}),f[109]||(f[109]=$("Private folders are turned off by your organization. ",-1))])):N("",!0)],64)),O(_t,{title:"Access mode",desc:"Read-only prevents uploads, deletes and folder creation.",keywords:"read only write access mode permission"},{default:mt(()=>[En("readOnly")?(g(),x("span",S_,[$(P(Ei(ge("readOnly").effective))+" ",1),gi("readOnly")?(g(),x("span",P_,[O(Y,{name:"lock",size:10}),$(P(gi("readOnly")),1)])):N("",!0)])):(g(),ie(hn,{key:1,modelValue:jn.value,"onUpdate:modelValue":f[39]||(f[39]=k=>jn.value=k),options:Oi},null,8,["modelValue"]))]),_:1}),u("div",T_,[$e.value?N("",!0):(g(),x("button",{key:0,class:"btn-accent",disabled:bn.value||!X.available,onClick:Rs},P(bn.value?"Saving…":Se.value?"Save organization settings":"Save settings"),9,L_)),Se.value?N("",!0):(g(),x("button",{key:1,class:"btn-ghost",disabled:mi.value||!X.available,onClick:Ar},P(mi.value?"Testing…":"Test folder"),9,C_)),ln.value?(g(),x("span",M_,P(ln.value),1)):N("",!0),oe.value&&!Se.value?(g(),x("span",O_,"Checked "+P($s()),1)):N("",!0),Pt.value&&!Se.value?(g(),x("span",{key:4,class:Ct(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",It(Pt.value.status)])},[f[110]||(f[110]=u("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(P(Pt.value.detail||Pt.value.status),1)],2)):N("",!0)])])):N("",!0)])):H.id==="profile"?(g(),x("div",E_,[O(_t,{block:"",title:"Profile photo",desc:"PNG or JPG, up to ~1.5 MB. Stored on this device.",keywords:"avatar photo picture"},{default:mt(()=>[u("div",z_,[$t(Tt).avatar?(g(),x("img",{key:0,src:$t(Tt).avatar,alt:"Avatar",class:"h-16 w-16 rounded-full object-cover"},null,8,A_)):(g(),x("div",I_,P(To.value),1)),u("div",$_,[u("label",D_,[O(Y,{name:"upload",size:15,class:"mr-1.5 inline"}),f[111]||(f[111]=$("Upload ",-1)),u("input",{type:"file",accept:"image/*",class:"hidden",onChange:Po},null,32)]),$t(Tt).avatar?(g(),x("button",{key:0,class:"btn-ghost",onClick:Ir},"Remove")):N("",!0)])])]),_:1}),O(_t,{title:"Display name",desc:"The name shown on your public profile.",keywords:"display name profile"},{default:mt(()=>[ot(u("input",{"onUpdate:modelValue":f[40]||(f[40]=k=>$t(Tt).displayName=k),class:"field w-56",placeholder:"Jane O.",onBlur:f[41]||(f[41]=k=>jt("Saved."))},null,544),[[vt,$t(Tt).displayName]])]),_:1}),O(_t,{block:"",title:"Bio",desc:"A short description others can see.",keywords:"bio about description"},{default:mt(()=>[ot(u("textarea",{"onUpdate:modelValue":f[42]||(f[42]=k=>$t(Tt).bio=k),rows:"3",maxlength:"240",class:"field w-full resize-none",placeholder:"Flight director, North yard operations…",onBlur:f[43]||(f[43]=k=>jt("Saved."))},null,544),[[vt,$t(Tt).bio]]),u("div",N_,P(($t(Tt).bio||"").length)+"/240",1)]),_:1}),O(_t,{title:"Show email on profile",desc:"Let teammates see your email address.",keywords:"show email public visibility"},{default:mt(()=>[O(nn,{modelValue:$t(Tt).showEmail,"onUpdate:modelValue":f[44]||(f[44]=k=>$t(Tt).showEmail=k)},null,8,["modelValue"])]),_:1})])):H.id==="security"?(g(),x("div",R_,[O(_t,{block:"",title:"Two-factor authentication",desc:"Require a one-time code at sign-in.",keywords:"two factor 2fa authentication security"},{default:mt(()=>[u("div",F_,[u("span",{class:Ct(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",$t(Tt).twoFactor?"bg-success-soft text-success-fg":"bg-surface-2 text-ink-secondary"])},[f[112]||(f[112]=u("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(P($t(Tt).twoFactor?"Enabled":"Disabled"),1)],2),!$t(Tt).twoFactor&&!Kn.value?(g(),x("button",{key:0,class:"btn-accent",onClick:Ii},"Enable 2FA")):$t(Tt).twoFactor?(g(),x("button",{key:1,class:"btn-ghost",onClick:$r},"Disable")):N("",!0)]),Kn.value?(g(),x("div",B_,[u("div",V_,[f[114]||(f[114]=u("div",{class:"grid h-28 w-28 place-items-center rounded bg-white p-2"},[u("svg",{viewBox:"0 0 100 100",class:"h-full w-full"},[u("rect",{width:"100",height:"100",fill:"#fff"}),u("g",{fill:"#0F1E3D"},[u("rect",{x:"6",y:"6",width:"24",height:"24"}),u("rect",{x:"70",y:"6",width:"24",height:"24"}),u("rect",{x:"6",y:"70",width:"24",height:"24"}),u("rect",{x:"12",y:"12",width:"12",height:"12",fill:"#fff"}),u("rect",{x:"76",y:"12",width:"12",height:"12",fill:"#fff"}),u("rect",{x:"12",y:"76",width:"12",height:"12",fill:"#fff"}),u("rect",{x:"40",y:"10",width:"8",height:"8"}),u("rect",{x:"52",y:"20",width:"8",height:"8"}),u("rect",{x:"40",y:"40",width:"8",height:"8"}),u("rect",{x:"60",y:"44",width:"8",height:"8"}),u("rect",{x:"44",y:"60",width:"8",height:"8"}),u("rect",{x:"70",y:"60",width:"8",height:"8"}),u("rect",{x:"80",y:"72",width:"8",height:"8"}),u("rect",{x:"60",y:"80",width:"8",height:"8"})])])],-1)),u("div",Z_,[f[113]||(f[113]=u("div",{class:"text-xs text-ink-secondary"},"Scan with an authenticator app, or enter this secret:",-1)),u("div",U_,P(Lo.value),1),u("div",H_,[ot(u("input",{"onUpdate:modelValue":f[45]||(f[45]=k=>Ai.value=k),inputmode:"numeric",maxlength:"6",class:"field w-28 font-mono tracking-[0.3em]",placeholder:"000000"},null,512),[[vt,Ai.value]]),u("button",{class:"btn-accent",onClick:Co},"Verify & enable")]),Zt.value?(g(),x("p",j_,P(Zt.value),1)):N("",!0)])])])):N("",!0),$t(Tt).twoFactor&&os.value.length?(g(),x("div",W_,[f[115]||(f[115]=u("div",{class:"text-xs font-semibold text-ink"},"Recovery codes",-1)),f[116]||(f[116]=u("div",{class:"mt-0.5 text-xs text-ink-muted"},"Store these somewhere safe — each works once.",-1)),u("div",K_,[(g(!0),x(ct,null,Wt(os.value,k=>(g(),x("span",{key:k,class:"select-all"},P(k),1))),128))])])):N("",!0),f[117]||(f[117]=u("p",{class:"mt-2 text-xs text-ink-muted"},"Prototype — codes are generated locally until the account service verifies them.",-1))]),_:1}),O(_t,{block:"",title:"Active sessions",desc:"Devices currently signed in to your account.",keywords:"sessions devices logout sign out remote"},{default:mt(()=>[u("div",G_,[u("div",q_,[u("div",Y_,[O(Y,{name:"monitor",size:18})]),u("div",J_,[u("div",X_,[$(P(Dr())+" on "+P(Mo())+" ",1),f[118]||(f[118]=u("span",{class:"ml-1 rounded-full bg-success-soft px-2 py-0.5 text-[10px] font-semibold text-success-fg"},"This device",-1))]),u("div",Q_,"Signed in "+P($t(Yl)($t(Nr))),1)]),u("button",{class:"btn-ghost",onClick:f[46]||(f[46]=k=>a("logout"))},"Log out")])]),f[119]||(f[119]=u("button",{class:"btn-ghost mt-2 opacity-60",disabled:"",title:"Requires the account service"}," Log out all other devices ",-1)),f[120]||(f[120]=u("p",{class:"mt-2 text-xs text-ink-muted"}," Only this session is visible from the browser; enumerating and revoking remote sessions needs the account service. ",-1))]),_:1})])):H.id==="team"?(g(),x("div",tv,[Gt.id?(g(),x("div",ev,[O(_t,{block:"",title:`Edit user — ${Gt.email}`,desc:"Update details, change role, reset password, or set verified.",keywords:"edit user update role password verified organization"},{default:mt(()=>[u("div",nv,[u("div",iv,[ot(u("input",{"onUpdate:modelValue":f[47]||(f[47]=k=>Gt.email=k),type:"email",class:"field flex-1",placeholder:"name@pilotvault.local"},null,512),[[vt,Gt.email]]),ot(u("select",{"onUpdate:modelValue":f[48]||(f[48]=k=>Gt.role=k),class:"field w-32",disabled:ls.value,title:ls.value?"You cannot change your own role":""},[(g(!0),x(ct,null,Wt(Fs.value,k=>(g(),x("option",{key:k.value,value:k.value},P(k.label),9,ov))),128))],8,sv),[[sn,Gt.role]])]),l.value?ot((g(),x("select",{key:0,"onUpdate:modelValue":f[49]||(f[49]=k=>Gt.organization=k),class:"field",title:"Organization"},[(g(!0),x(ct,null,Wt(Oo.value,k=>(g(),x("option",{key:k.value,value:k.value},P(k.label),9,rv))),128))],512)),[[sn,Gt.organization]]):N("",!0),ot(u("input",{"onUpdate:modelValue":f[50]||(f[50]=k=>Gt.password=k),type:"password",class:"field",placeholder:"New password (leave blank to keep current)"},null,512),[[vt,Gt.password]]),u("label",av,[O(nn,{modelValue:Gt.verified,"onUpdate:modelValue":f[51]||(f[51]=k=>Gt.verified=k)},null,8,["modelValue"]),f[121]||(f[121]=$(" Email verified ",-1))]),u("div",lv,[u("button",{class:"btn-accent",disabled:Ri.value,onClick:Br},P(Ri.value?"Saving…":"Save changes"),9,uv),u("button",{class:"btn-ghost",onClick:In},"Cancel"),An.value?(g(),x("span",cv,P(An.value),1)):N("",!0),ls.value?(g(),x("span",dv,"Editing your own account — role locked.")):N("",!0)])])]),_:1},8,["title"])])):(g(),x("div",fv,[O(_t,{block:"",title:"Add user",desc:"Create a new account. Admins add users within their organization; superadmins can target any.",keywords:"add user create account role admin organization"},{default:mt(()=>[u("div",hv,[u("div",pv,[ot(u("input",{"onUpdate:modelValue":f[52]||(f[52]=k=>re.email=k),type:"email",class:"field flex-1",placeholder:"name@pilotvault.local"},null,512),[[vt,re.email]]),ot(u("select",{"onUpdate:modelValue":f[53]||(f[53]=k=>re.role=k),class:"field w-32"},[(g(!0),x(ct,null,Wt(Fs.value,k=>(g(),x("option",{key:k.value,value:k.value},P(k.label),9,mv))),128))],512),[[sn,re.role]])]),l.value?ot((g(),x("select",{key:0,"onUpdate:modelValue":f[54]||(f[54]=k=>re.organization=k),class:"field",title:"Organization"},[(g(!0),x(ct,null,Wt(Oo.value,k=>(g(),x("option",{key:k.value,value:k.value},P(k.label),9,gv))),128))],512)),[[sn,re.organization]]):(g(),x("div",_v,[f[122]||(f[122]=$(" New users join your organization: ",-1)),u("span",vv,P(e.organizationName||"—"),1)])),ot(u("input",{"onUpdate:modelValue":f[55]||(f[55]=k=>re.password=k),type:"password",class:"field",placeholder:"Temporary password (min 8 chars)"},null,512),[[vt,re.password]]),u("div",yv,[u("button",{class:"btn-accent",disabled:$i.value,onClick:Rr},P($i.value?"Creating…":"Create user"),9,bv),yi.value?(g(),x("span",xv,P(yi.value),1)):N("",!0)])])]),_:1})])),u("div",wv,[u("div",kv,[f[123]||(f[123]=u("div",null,[u("div",{class:"eyebrow"},"Team"),u("div",{class:"mt-0.5 text-base font-semibold text-ink"},"All users")],-1)),u("button",{class:"btn-ghost",disabled:Gn.value,onClick:Yn},P(Gn.value?"Loading…":"Refresh"),9,Sv)]),as.value?(g(),x("div",Pv,P(as.value),1)):!rs.value.length&&!Gn.value?(g(),x("div",Tv,"No users yet.")):(g(),x("div",Lv,[u("table",Cv,[u("thead",null,[u("tr",Mv,[(g(),x(ct,null,Wt(["User","Role","Organization","Status",""],k=>u("th",{key:k,class:"border-y border-line bg-surface-2 px-5 py-2.5 font-mono text-[10.5px] font-normal uppercase tracking-caps text-ink-muted"},P(k),1)),64))])]),u("tbody",null,[(g(!0),x(ct,null,Wt(rs.value,k=>(g(),x("tr",{key:k.id,class:Ct(["border-b border-line last:border-0",Gt.id===k.id?"bg-accent-soft":""])},[u("td",Ov,[u("span",Ev,P(k.email),1),k.email===e.email?(g(),x("span",zv,"(you)")):N("",!0)]),u("td",Av,[u("span",{class:Ct(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",y(k.role||"user")])},[O(Y,{name:_(k.role||"user"),size:12},null,8,["name"]),$(P(h(k.role||"user")),1)],2)]),u("td",Iv,[u("span",{class:Ct(["text-sm",k.organizationName?"text-ink-secondary":"text-ink-muted"])},P(k.organizationName||"—"),3)]),u("td",$v,[u("span",{class:Ct(["text-xs",k.verified?"text-success-fg":"text-ink-muted"])},P(k.verified?"Verified":"Unverified"),3)]),u("td",Dv,[Ye.value===k.id?(g(),x(ct,{key:0},[f[124]||(f[124]=u("span",{class:"mr-2 text-xs text-ink-muted"},"Remove?",-1)),u("button",{class:"btn-ghost mr-1",onClick:f[56]||(f[56]=qt=>Ye.value="")},"Cancel"),u("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:qt=>Fr(k)}," Remove ",8,Nv)],64)):(g(),x("div",Rv,[u("button",{class:"btn-ghost inline-flex items-center gap-1.5",onClick:qt=>us(k)},[O(Y,{name:"settings",size:14}),f[125]||(f[125]=$(" Edit ",-1))],8,Fv),k.email!==e.email?(g(),x("button",{key:0,class:"btn-ghost inline-flex items-center gap-1.5",onClick:qt=>Ye.value=k.id},[O(Y,{name:"trash",size:14}),f[126]||(f[126]=$(" Remove ",-1))],8,Bv)):N("",!0)]))])],2))),128))])])]))])])):H.id==="organizations"?(g(),x("div",Vv,[kn.id?(g(),x("div",Zv,[O(_t,{block:"",title:"Rename organization",desc:"Update the organization's display name.",keywords:"rename organization edit"},{default:mt(()=>[u("div",Uv,[ot(u("input",{"onUpdate:modelValue":f[57]||(f[57]=k=>kn.name=k),class:"field",placeholder:"Organization name",onKeyup:Vl(zo,["enter"])},null,544),[[vt,kn.name]]),u("div",Hv,[u("button",{class:"btn-accent",onClick:zo},"Save changes"),u("button",{class:"btn-ghost",onClick:Bs},"Cancel"),Sn.value?(g(),x("span",jv,P(Sn.value),1)):N("",!0)])])]),_:1})])):(g(),x("div",Wv,[O(_t,{block:"",title:"Add organization",desc:"Create a new organization. Assign admins and users to it from User management.",keywords:"add organization create tenant company"},{default:mt(()=>[u("div",Kv,[ot(u("input",{"onUpdate:modelValue":f[58]||(f[58]=k=>$n.name=k),class:"field",placeholder:"e.g. Northwind Aerial",onKeyup:Vl(Eo,["enter"])},null,544),[[vt,$n.name]]),u("div",Gv,[u("button",{class:"btn-accent",disabled:Fi.value,onClick:Eo},P(Fi.value?"Creating…":"Create organization"),9,qv),Ce.value?(g(),x("span",Yv,P(Ce.value),1)):N("",!0)])])]),_:1})])),u("div",Jv,[u("div",{class:"flex items-center justify-between px-5 py-4"},[f[127]||(f[127]=u("div",null,[u("div",{class:"eyebrow"},"Tenancy"),u("div",{class:"mt-0.5 text-base font-semibold text-ink"},"All organizations")],-1)),u("button",{class:"btn-ghost",onClick:qn},"Refresh")]),Di.value.length?(g(),x("div",Qv,[u("table",ty,[u("thead",null,[u("tr",ey,[(g(),x(ct,null,Wt(["Organization","Members",""],k=>u("th",{key:k,class:"border-y border-line bg-surface-2 px-5 py-2.5 font-mono text-[10.5px] font-normal uppercase tracking-caps text-ink-muted"},P(k),1)),64))])]),u("tbody",null,[(g(!0),x(ct,null,Wt(Di.value,k=>(g(),x("tr",{key:k.id,class:Ct(["border-b border-line last:border-0",kn.id===k.id?"bg-accent-soft":""])},[u("td",ny,[u("span",iy,[O(Y,{name:"grid",size:14,class:"text-ink-muted"}),$(P(k.name),1)])]),u("td",sy,P(Bi.value[k.id]||0),1),u("td",oy,[bi.value===k.id?(g(),x(ct,{key:0},[f[128]||(f[128]=u("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),u("button",{class:"btn-ghost mr-1",onClick:f[59]||(f[59]=qt=>bi.value="")},"Cancel"),u("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:qt=>en(k)}," Delete ",8,ry)],64)):(g(),x("div",ay,[u("button",{class:"btn-ghost inline-flex items-center gap-1.5",onClick:qt=>Vr(k)},[O(Y,{name:"settings",size:14}),f[129]||(f[129]=$(" Rename ",-1))],8,ly),u("button",{class:"btn-ghost inline-flex items-center gap-1.5",disabled:(Bi.value[k.id]||0)>0,title:(Bi.value[k.id]||0)>0?"Reassign or remove members first":"",onClick:qt=>bi.value=k.id},[O(Y,{name:"trash",size:14}),f[130]||(f[130]=$(" Delete ",-1))],8,uy)]))])],2))),128))])])])):(g(),x("div",Xv,"No organizations yet."))])])):H.id==="advanced"?(g(),x("div",cy,[u("div",dy,[O(_t,{title:"Export data",desc:"Download your settings and profile as JSON.",keywords:"export data download backup"},{default:mt(()=>[u("button",{class:"btn-ghost",onClick:xi},[O(Y,{name:"download",size:15,class:"mr-1.5 inline"}),f[131]||(f[131]=$("Export",-1))])]),_:1}),O(_t,{block:"",title:"Import data",desc:"Restore settings from a previous export.",keywords:"import data upload restore"},{default:mt(()=>[u("label",fy,[O(Y,{name:"upload",size:15,class:"mr-1.5 inline"}),f[132]||(f[132]=$("Choose file… ",-1)),u("input",{type:"file",accept:"application/json,.json",class:"hidden",onChange:Pn},null,32)]),cs.value?(g(),x("p",hy,P(cs.value),1)):N("",!0)]),_:1})]),u("div",py,[u("div",my,[O(Y,{name:"alertTriangle",size:18}),f[133]||(f[133]=u("h3",{class:"text-sm font-bold uppercase tracking-caps"},"Danger zone",-1))]),f[138]||(f[138]=u("p",{class:"mt-1 text-xs text-ink-secondary"},"Deleting your account is permanent and cannot be undone.",-1)),u("div",gy,[f[137]||(f[137]=u("div",{class:"text-sm font-semibold text-ink"},"Delete account",-1)),u("label",_y,[ot(u("input",{"onUpdate:modelValue":f[60]||(f[60]=k=>de.understand=k),type:"checkbox",class:"mt-0.5 h-4 w-4 accent-[var(--danger)]"},null,512),[[rr,de.understand]]),f[134]||(f[134]=$(" I understand this permanently deletes my account and all associated data. ",-1))]),u("div",vy,[u("label",yy,[f[135]||(f[135]=$("Type ",-1)),u("span",by,P(Vs.value),1),f[136]||(f[136]=$(" to confirm",-1))]),ot(u("input",{"onUpdate:modelValue":f[61]||(f[61]=k=>de.typed=k),class:"field w-full max-w-[360px] font-mono",placeholder:Vs.value},null,8,xy),[[vt,de.typed]])]),u("div",wy,[de.armed?(g(),x("button",{key:1,class:"rounded bg-danger px-4 py-2.5 text-sm font-semibold text-white transition enabled:hover:brightness-110 disabled:cursor-not-allowed disabled:opacity-50",disabled:de.cooldown>0,onClick:ds},P(de.cooldown>0?`Confirm in ${de.cooldown}s…`:"Permanently delete account"),9,Sy)):(g(),x("button",{key:0,class:"rounded bg-danger px-4 py-2.5 text-sm font-semibold text-white transition enabled:hover:brightness-110 disabled:cursor-not-allowed disabled:opacity-40",disabled:!Jn.value,onClick:Ao}," Delete account… ",8,ky)),de.armed&&de.cooldown>0?(g(),x("span",Py,"Cooling-off period — read once more.")):N("",!0)]),de.msg?(g(),x("p",Ty,P(de.msg),1)):N("",!0)])])])):N("",!0)],64))),128))])]),O(Qf,{name:"fade"},{default:mt(()=>[_i.value?(g(),x("div",Ly,[O(Y,{name:"check",size:16,class:"text-success-fg"}),$(P(_i.value),1)])):N("",!0)]),_:1})]))}},My=Wp(Cy,[["__scopeId","data-v-4fe25eb7"]]),Oy={class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},Ey={class:"flex flex-wrap items-center gap-3"},zy={class:"inline-flex rounded-lg border border-line bg-surface-1 p-0.5"},Ay=["onClick"],Iy={class:"ml-auto flex items-center gap-2"},$y=["href"],Dy={class:"grid grid-cols-4 gap-4 max-[900px]:grid-cols-2"},Ny={class:"eyebrow"},Ry={key:0,class:"panel border-danger/40 p-4 text-sm text-danger-fg"},Fy={key:0,class:"panel p-5"},By={class:"mb-4 flex items-center justify-between"},Vy={class:"eyebrow"},Zy={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},Uy={class:"block"},Hy={class:"block"},jy={class:"block"},Wy={class:"block"},Ky={key:0,value:""},Gy=["value"],qy={class:"block"},Yy={class:"block"},Jy={class:"block"},Xy={class:"block"},Qy={class:"block"},t1=["value"],e1={class:"block"},n1=["value"],i1={class:"block"},s1=["value"],o1={class:"block"},r1={class:"mt-3 block"},a1={key:0,class:"mt-3 grid grid-cols-2 gap-3 max-[760px]:grid-cols-1"},l1={class:"block"},u1={class:"block"},c1={class:"block"},d1={class:"block"},f1={class:"col-span-2 block max-[760px]:col-span-1"},h1={class:"mt-4 flex items-center gap-3"},p1=["disabled"],m1={key:0,class:"text-sm text-danger-fg"},g1={class:"panel overflow-hidden p-0"},_1={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},v1={key:1,class:"grid place-items-center px-5 py-16 text-center"},y1={key:2,class:"overflow-x-auto"},b1={class:"w-full border-collapse text-sm"},x1={class:"text-left"},w1={class:"whitespace-nowrap px-5 py-3 font-mono text-ink"},k1={key:0,class:"text-ink-muted"},S1={class:"px-5 py-3 text-ink-secondary"},P1=["title"],T1={class:"px-5 py-3 font-mono text-ink-secondary"},L1={class:"px-5 py-3 text-ink-secondary"},C1={class:"px-5 py-3"},M1=["onClick"],O1={class:"whitespace-nowrap px-5 py-3 text-right"},E1=["onClick"],z1=["onClick"],A1=["onClick"],I1={key:0,class:"border-b border-line bg-surface-2"},$1={colspan:"7",class:"px-5 py-3"},D1={class:"flex flex-wrap gap-x-8 gap-y-1.5 text-xs"},N1={class:"text-ink-secondary"},R1={class:"text-ink"},F1={class:"text-ink-secondary"},B1={class:"text-ink"},V1={class:"text-ink-secondary"},Z1={class:"font-mono text-ink"},U1={key:0,class:"text-ink-secondary"},H1={class:"text-ink"},j1={key:0,class:"mt-2 space-y-1"},W1={key:1,class:"mt-2 text-xs text-success-fg"},K1={key:0,class:"panel p-5"},G1={class:"mb-4 flex items-center justify-between"},q1={class:"eyebrow"},Y1={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},J1={class:"block"},X1={class:"block"},Q1={class:"block"},tb={class:"block"},eb={class:"block"},nb={class:"block"},ib=["value"],sb={class:"mt-3 flex flex-wrap gap-6"},ob={class:"flex items-center gap-2 text-sm text-ink-secondary"},rb={class:"flex items-center gap-2 text-sm text-ink-secondary"},ab={class:"mt-4 flex items-center gap-3"},lb=["disabled"],ub={key:0,class:"text-sm text-danger-fg"},cb={class:"panel overflow-hidden p-0"},db={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},fb={key:1,class:"grid place-items-center px-5 py-16 text-center"},hb={key:2,class:"overflow-x-auto"},pb={class:"w-full border-collapse text-sm"},mb={class:"text-left"},gb={class:"px-5 py-3 font-semibold text-ink"},_b={class:"px-5 py-3 text-ink-secondary"},vb={class:"px-5 py-3 font-mono text-ink-secondary"},yb={class:"px-5 py-3"},bb={key:1,class:"text-ink-muted"},xb={class:"px-5 py-3"},wb={class:"whitespace-nowrap px-5 py-3 text-right"},kb=["onClick"],Sb=["onClick"],Pb=["onClick"],Tb={__name:"Logbook",props:{email:{type:String,default:""},role:{type:String,default:"user"},organization:{type:String,default:""},organizationName:{type:String,default:""}},setup(e){const i=e,o={success:"bg-success-soft text-success-fg",warning:"bg-amber-soft text-amber-fg",danger:"bg-danger-soft text-danger-fg",accent:"bg-accent-soft text-accent-soft-fg",neutral:"bg-surface-2 text-ink-secondary"},a=G("flights"),l=G([]),d=G([]),h=G(!1),_=G("");async function y(){h.value=!0,_.value="";const[j,C]=await Promise.all([ip(),ap()]);(!j.ok||!C.ok)&&(_.value=j.status===503||C.status===503?"Logbook storage is not configured on the API Server (service account missing).":"Could not load the logbook."),l.value=j.drones,d.value=C.flights,h.value=!1}Yi(y);function T(j){const C=j.compliance||{};return C.exempt?{tone:"neutral",label:"Exempt"}:(C.redFlags||[]).length?{tone:"danger",label:`${C.redFlags.length} issue${C.redFlags.length>1?"s":""}`}:{tone:"success",label:"Compliant"}}const w=G("");function A(j){w.value=w.value===j?"":j}const U=[{value:"open",label:"Open"},{value:"specific",label:"Specific"},{value:"certified",label:"Certified"}],V=[{value:"commercial",label:"Commercial"},{value:"research",label:"Research"},{value:"public",label:"Public-benefit"},{value:"hobby",label:"Private hobby"},{value:"club_area",label:"Model-club area"}],rt=[{value:"",label:"Auto (from drone)"},{value:"manual",label:"Manual"},{value:"automatic",label:"Automatic (FDR)"}];function Q(){var j;return{operationDate:new Date().toISOString().slice(0,10),startTime:"",endTime:"",drone:((j=l.value[0])==null?void 0:j.id)||"",areaRoute:"",maxAltitudeAgl:"",pilotName:i.email,certificateRef:"",category:"open",purpose:"commercial",loggingPath:"",rawFdrLogUrl:"",authorisationRef:"",weather:"",airspaceRef:"",observer:"",incidents:"",notes:""}}const Ot=G(!1),Mt=G(""),q=xe(Q()),dt=G(""),it=G(!1),ht=G(!1);function Kt(){Object.assign(q,Q()),Mt.value="",dt.value="",ht.value=!1,Ot.value=!0}function he(j){Object.assign(q,{operationDate:(j.operationDate||"").slice(0,10),startTime:j.startTime||"",endTime:j.endTime||"",drone:j.drone||"",areaRoute:j.areaRoute||"",maxAltitudeAgl:j.maxAltitudeAgl||"",pilotName:j.pilotName||"",certificateRef:j.certificateRef||"",category:j.category||"open",purpose:j.purpose||"commercial",loggingPath:j.loggingPath||"",rawFdrLogUrl:j.rawFdrLogUrl||"",authorisationRef:j.authorisationRef||"",weather:j.weather||"",airspaceRef:j.airspaceRef||"",observer:j.observer||"",incidents:j.incidents||"",notes:j.notes||""}),Mt.value=j.id,dt.value="",ht.value=!!(j.weather||j.airspaceRef||j.observer||j.incidents||j.notes),Ot.value=!0}function pe(){Ot.value=!1,Mt.value=""}async function St(){var E;if(dt.value="",!q.drone){dt.value="Select a drone first (add one on the Drones tab).";return}it.value=!0;const j={...q,maxAltitudeAgl:Number(q.maxAltitudeAgl)||0},C=Mt.value?await up(Mt.value,j):await lp(j);if(it.value=!1,!C.ok){dt.value=((E=C.body)==null?void 0:E.error)||"Could not save the flight.";return}Ot.value=!1,await y()}const Nt=G("");async function Et(j){const C=await cp(j.id);Nt.value="",C.ok&&await y()}const nt=["","C0","C1","C2","C3","C4","C5","C6"];function ut(){return{name:"",model:"",serial:"",operatorNumber:"",mtomGrams:"",isToy:!1,autologsFlights:!1,cClass:""}}const zt=G(!1),Ft=G(""),lt=xe(ut()),At=G(""),et=G(!1);function ce(){Object.assign(lt,ut()),Ft.value="",At.value="",zt.value=!0}function pt(j){Object.assign(lt,{name:j.name||"",model:j.model||"",serial:j.serial||"",operatorNumber:j.operatorNumber||"",mtomGrams:j.mtomGrams||"",isToy:!!j.isToy,autologsFlights:!!j.autologsFlights,cClass:j.cClass||""}),Ft.value=j.id,At.value="",zt.value=!0}function kt(){zt.value=!1,Ft.value=""}async function Yt(){var E;if(At.value="",!lt.name.trim()){At.value="Give the drone a name.";return}et.value=!0;const j={...lt,mtomGrams:Number(lt.mtomGrams)||0},C=Ft.value?await op(Ft.value,j):await sp(j);if(et.value=!1,!C.ok){At.value=((E=C.body)==null?void 0:E.error)||"Could not save the drone.";return}zt.value=!1,await y()}const ae=G("");async function Jt(j){var E;const C=await rp(j.id);ae.value="",C.ok?await y():At.value=((E=C.body)==null?void 0:E.error)||"Could not delete the drone."}const Bt=xt(()=>{const j=d.value.length,C=d.value.filter(_e=>{var se;return(((se=_e.compliance)==null?void 0:se.redFlags)||[]).length}).length,E=d.value.filter(_e=>{var se;return(se=_e.compliance)==null?void 0:se.required}).length;return{total:j,flagged:C,required:E,fleet:l.value.length}});return(j,C)=>(g(),x("div",Oy,[u("div",Ey,[u("div",zy,[(g(),x(ct,null,Wt([["flights","Flights"],["drones","Drones"]],E=>u("button",{key:E[0],class:Ct(["rounded-md px-3.5 py-1.5 text-sm font-semibold transition",a.value===E[0]?"bg-accent-soft text-accent-soft-fg":"text-ink-secondary hover:text-ink"]),onClick:_e=>a.value=E[0]},P(E[1]),11,Ay)),64))]),u("div",Iy,[u("a",{href:$t(dp)(),class:"btn-ghost inline-flex items-center gap-2",title:"Download a compliance CSV (Trafikstyrelsen / police disclosure)"},[O(Y,{name:"download",size:15}),C[29]||(C[29]=$(" Export CSV ",-1))],8,$y),a.value==="flights"?(g(),x("button",{key:0,class:"btn-accent inline-flex items-center gap-2",onClick:Kt},[O(Y,{name:"plus",size:15}),C[30]||(C[30]=$(" Log flight ",-1))])):(g(),x("button",{key:1,class:"btn-accent inline-flex items-center gap-2",onClick:ce},[O(Y,{name:"plus",size:15}),C[31]||(C[31]=$(" Add drone ",-1))]))])]),u("div",Dy,[(g(!0),x(ct,null,Wt([{label:"Flights logged",value:Bt.value.total,tone:"neutral"},{label:"Require logbook",value:Bt.value.required,tone:"neutral"},{label:"Compliance flags",value:Bt.value.flagged,tone:Bt.value.flagged?"danger":"success"},{label:"Registered drones",value:Bt.value.fleet,tone:"neutral"}],E=>(g(),x("div",{key:E.label,class:"panel p-5"},[u("div",Ny,P(E.label),1),u("div",{class:Ct(["mt-2 text-[30px] font-bold leading-none tracking-tightest",E.tone==="danger"?"text-danger-fg":E.tone==="success"?"text-success-fg":"text-ink"])},P(E.value),3)]))),128))]),_.value?(g(),x("div",Ry,P(_.value),1)):N("",!0),a.value==="flights"?(g(),x(ct,{key:1},[Ot.value?(g(),x("div",Fy,[u("div",By,[u("div",null,[u("div",Vy,P(Mt.value?"Edit entry":"New entry"),1),C[32]||(C[32]=u("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Logbook flight (BEK 1649 §5)",-1))]),u("button",{class:"btn-icon",onClick:pe},[O(Y,{name:"x",size:16})])]),u("div",Zy,[u("label",Uy,[C[33]||(C[33]=u("span",{class:"eyebrow mb-1 block"},"Date",-1)),ot(u("input",{"onUpdate:modelValue":C[0]||(C[0]=E=>q.operationDate=E),type:"date",class:"field"},null,512),[[vt,q.operationDate]])]),u("label",Hy,[C[34]||(C[34]=u("span",{class:"eyebrow mb-1 block"},"Start",-1)),ot(u("input",{"onUpdate:modelValue":C[1]||(C[1]=E=>q.startTime=E),type:"time",class:"field"},null,512),[[vt,q.startTime]])]),u("label",jy,[C[35]||(C[35]=u("span",{class:"eyebrow mb-1 block"},"End",-1)),ot(u("input",{"onUpdate:modelValue":C[2]||(C[2]=E=>q.endTime=E),type:"time",class:"field"},null,512),[[vt,q.endTime]])]),u("label",Wy,[C[36]||(C[36]=u("span",{class:"eyebrow mb-1 block"},"Drone",-1)),ot(u("select",{"onUpdate:modelValue":C[3]||(C[3]=E=>q.drone=E),class:"field"},[l.value.length?N("",!0):(g(),x("option",Ky,"— add a drone first —")),(g(!0),x(ct,null,Wt(l.value,E=>(g(),x("option",{key:E.id,value:E.id},P(E.name)+P(E.model?` · ${E.model}`:""),9,Gy))),128))],512),[[sn,q.drone]])]),u("label",qy,[C[37]||(C[37]=u("span",{class:"eyebrow mb-1 block"},"Max altitude (m AGL)",-1)),ot(u("input",{"onUpdate:modelValue":C[4]||(C[4]=E=>q.maxAltitudeAgl=E),type:"number",min:"0",class:"field",placeholder:"120"},null,512),[[vt,q.maxAltitudeAgl]])]),u("label",Yy,[C[38]||(C[38]=u("span",{class:"eyebrow mb-1 block"},"Area / route",-1)),ot(u("input",{"onUpdate:modelValue":C[5]||(C[5]=E=>q.areaRoute=E),class:"field",placeholder:"Field N of Roskilde, grid survey"},null,512),[[vt,q.areaRoute]])]),u("label",Jy,[C[39]||(C[39]=u("span",{class:"eyebrow mb-1 block"},"Remote pilot name",-1)),ot(u("input",{"onUpdate:modelValue":C[6]||(C[6]=E=>q.pilotName=E),class:"field",placeholder:"Full name"},null,512),[[vt,q.pilotName]])]),u("label",Xy,[C[40]||(C[40]=u("span",{class:"eyebrow mb-1 block"},"Certificate ref",-1)),ot(u("input",{"onUpdate:modelValue":C[7]||(C[7]=E=>q.certificateRef=E),class:"field",placeholder:"A2 / STS cert no."},null,512),[[vt,q.certificateRef]])]),u("label",Qy,[C[41]||(C[41]=u("span",{class:"eyebrow mb-1 block"},"Logging path",-1)),ot(u("select",{"onUpdate:modelValue":C[8]||(C[8]=E=>q.loggingPath=E),class:"field"},[(g(),x(ct,null,Wt(rt,E=>u("option",{key:E.value,value:E.value},P(E.label),9,t1)),64))],512),[[sn,q.loggingPath]])]),u("label",e1,[C[42]||(C[42]=u("span",{class:"eyebrow mb-1 block"},"Category",-1)),ot(u("select",{"onUpdate:modelValue":C[9]||(C[9]=E=>q.category=E),class:"field"},[(g(),x(ct,null,Wt(U,E=>u("option",{key:E.value,value:E.value},P(E.label),9,n1)),64))],512),[[sn,q.category]])]),u("label",i1,[C[43]||(C[43]=u("span",{class:"eyebrow mb-1 block"},"Purpose",-1)),ot(u("select",{"onUpdate:modelValue":C[10]||(C[10]=E=>q.purpose=E),class:"field"},[(g(),x(ct,null,Wt(V,E=>u("option",{key:E.value,value:E.value},P(E.label),9,s1)),64))],512),[[sn,q.purpose]])]),u("label",o1,[C[44]||(C[44]=u("span",{class:"eyebrow mb-1 block"},"Authorisation ref",-1)),ot(u("input",{"onUpdate:modelValue":C[11]||(C[11]=E=>q.authorisationRef=E),class:"field",placeholder:"Specific-category ref"},null,512),[[vt,q.authorisationRef]])])]),u("label",r1,[C[45]||(C[45]=u("span",{class:"eyebrow mb-1 block"},"FDR log URL (automatic path)",-1)),ot(u("input",{"onUpdate:modelValue":C[12]||(C[12]=E=>q.rawFdrLogUrl=E),class:"field",placeholder:"Link to the stored flight-data-recorder export"},null,512),[[vt,q.rawFdrLogUrl]])]),u("button",{class:"mt-4 flex items-center gap-1.5 text-sm font-semibold text-accent",onClick:C[13]||(C[13]=E=>ht.value=!ht.value)},[O(Y,{name:ht.value?"x":"plus",size:14},null,8,["name"]),C[46]||(C[46]=$(" Operational details (weather, airspace, incidents) ",-1))]),ht.value?(g(),x("div",a1,[u("label",l1,[C[47]||(C[47]=u("span",{class:"eyebrow mb-1 block"},"Weather / wind",-1)),ot(u("input",{"onUpdate:modelValue":C[14]||(C[14]=E=>q.weather=E),class:"field",placeholder:"6 m/s NW, CAVOK"},null,512),[[vt,q.weather]])]),u("label",u1,[C[48]||(C[48]=u("span",{class:"eyebrow mb-1 block"},"Airspace / NOTAM ref",-1)),ot(u("input",{"onUpdate:modelValue":C[15]||(C[15]=E=>q.airspaceRef=E),class:"field"},null,512),[[vt,q.airspaceRef]])]),u("label",c1,[C[49]||(C[49]=u("span",{class:"eyebrow mb-1 block"},"Observer",-1)),ot(u("input",{"onUpdate:modelValue":C[16]||(C[16]=E=>q.observer=E),class:"field"},null,512),[[vt,q.observer]])]),u("label",d1,[C[50]||(C[50]=u("span",{class:"eyebrow mb-1 block"},"Incidents / anomalies",-1)),ot(u("input",{"onUpdate:modelValue":C[17]||(C[17]=E=>q.incidents=E),class:"field",placeholder:"RTH trigger, GPS dropout…"},null,512),[[vt,q.incidents]])]),u("label",f1,[C[51]||(C[51]=u("span",{class:"eyebrow mb-1 block"},"Notes",-1)),ot(u("textarea",{"onUpdate:modelValue":C[18]||(C[18]=E=>q.notes=E),rows:"2",class:"field"},null,512),[[vt,q.notes]])])])):N("",!0),u("div",h1,[u("button",{class:"btn-accent",disabled:it.value,onClick:St},P(it.value?"Saving…":Mt.value?"Save changes":"Log flight"),9,p1),u("button",{class:"btn-ghost",onClick:pe},"Cancel"),dt.value?(g(),x("span",m1,P(dt.value),1)):N("",!0)])])):N("",!0),u("div",g1,[h.value?(g(),x("div",_1,"Loading…")):d.value.length?(g(),x("div",y1,[u("table",b1,[u("thead",null,[u("tr",x1,[(g(),x(ct,null,Wt(["Date","Drone","Area / route","Alt","Pilot","Compliance",""],E=>u("th",{key:E,class:"border-y border-line bg-surface-2 px-5 py-2.5 font-mono text-[10.5px] font-normal uppercase tracking-caps text-ink-muted"},P(E),1)),64))])]),u("tbody",null,[(g(!0),x(ct,null,Wt(d.value,E=>{var _e,se,Ge,v;return g(),x(ct,{key:E.id},[u("tr",{class:Ct(["border-b border-line last:border-0",Mt.value===E.id?"bg-accent-soft":""])},[u("td",w1,[$(P((E.operationDate||"").slice(0,10))+" ",1),E.startTime?(g(),x("span",k1,P(E.startTime),1)):N("",!0)]),u("td",S1,P(E.droneName||"—"),1),u("td",{class:"max-w-[220px] truncate px-5 py-3 text-ink-secondary",title:E.areaRoute},P(E.areaRoute||"—"),9,P1),u("td",T1,P(E.maxAltitudeAgl?E.maxAltitudeAgl+" m":"—"),1),u("td",L1,P(E.pilotName||"—"),1),u("td",C1,[u("button",{class:Ct(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",o[T(E).tone]]),onClick:m=>A(E.id)},[T(E).tone==="danger"?(g(),ie(Y,{key:0,name:"alertTriangle",size:12})):T(E).tone==="success"?(g(),ie(Y,{key:1,name:"check",size:12})):N("",!0),$(" "+P(T(E).label),1)],10,M1)]),u("td",O1,[Nt.value===E.id?(g(),x(ct,{key:0},[C[54]||(C[54]=u("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),u("button",{class:"btn-ghost mr-1",onClick:C[19]||(C[19]=m=>Nt.value="")},"Cancel"),u("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:m=>Et(E)},"Delete",8,E1)],64)):(g(),x(ct,{key:1},[u("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:m=>he(E)},[O(Y,{name:"sliders",size:13}),C[55]||(C[55]=$(" Edit",-1))],8,z1),u("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:m=>Nt.value=E.id},[O(Y,{name:"trash",size:13})],8,A1)],64))])],2),w.value===E.id?(g(),x("tr",I1,[u("td",$1,[u("div",D1,[u("span",N1,[C[56]||(C[56]=$("Logging path: ",-1)),u("b",R1,P(((_e=E.compliance)==null?void 0:_e.loggingPath)||"—"),1)]),u("span",F1,[C[57]||(C[57]=$("Category: ",-1)),u("b",B1,P(E.category||"—"),1)]),u("span",V1,[C[58]||(C[58]=$("Retain until: ",-1)),u("b",Z1,P((E.retentionUntil||"").slice(0,10)||"—"),1)]),(se=E.compliance)!=null&&se.exempt?(g(),x("span",U1,[C[59]||(C[59]=$("Exempt: ",-1)),u("b",H1,P(E.compliance.exemptReason),1)])):N("",!0)]),(((Ge=E.compliance)==null?void 0:Ge.redFlags)||[]).length?(g(),x("ul",j1,[(g(!0),x(ct,null,Wt(E.compliance.redFlags,(m,M)=>(g(),x("li",{key:M,class:"flex items-start gap-2 text-xs text-danger-fg"},[O(Y,{name:"alertTriangle",size:13,class:"mt-px shrink-0"}),$(" "+P(m),1)]))),128))])):(v=E.compliance)!=null&&v.exempt?N("",!0):(g(),x("div",W1,"No compliance gaps detected."))])])):N("",!0)],64)}),128))])])])):(g(),x("div",v1,[O(Y,{name:"book",size:26,class:"text-ink-muted"}),C[52]||(C[52]=u("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No flights logged yet",-1)),C[53]||(C[53]=u("div",{class:"mt-1 text-xs text-ink-muted"},"Log your first operation to start the 5-year retention record.",-1))]))])],64)):(g(),x(ct,{key:2},[zt.value?(g(),x("div",K1,[u("div",G1,[u("div",null,[u("div",q1,P(Ft.value?"Edit drone":"New drone"),1),C[60]||(C[60]=u("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Aircraft registry",-1))]),u("button",{class:"btn-icon",onClick:kt},[O(Y,{name:"x",size:16})])]),u("div",Y1,[u("label",J1,[C[61]||(C[61]=u("span",{class:"eyebrow mb-1 block"},"Name",-1)),ot(u("input",{"onUpdate:modelValue":C[20]||(C[20]=E=>lt.name=E),class:"field",placeholder:"Mavic-01"},null,512),[[vt,lt.name]])]),u("label",X1,[C[62]||(C[62]=u("span",{class:"eyebrow mb-1 block"},"Model",-1)),ot(u("input",{"onUpdate:modelValue":C[21]||(C[21]=E=>lt.model=E),class:"field",placeholder:"DJI Mavic 3 Enterprise"},null,512),[[vt,lt.model]])]),u("label",Q1,[C[63]||(C[63]=u("span",{class:"eyebrow mb-1 block"},"Serial",-1)),ot(u("input",{"onUpdate:modelValue":C[22]||(C[22]=E=>lt.serial=E),class:"field"},null,512),[[vt,lt.serial]])]),u("label",tb,[C[64]||(C[64]=u("span",{class:"eyebrow mb-1 block"},"Operator no.",-1)),ot(u("input",{"onUpdate:modelValue":C[23]||(C[23]=E=>lt.operatorNumber=E),class:"field",placeholder:"DNK…"},null,512),[[vt,lt.operatorNumber]])]),u("label",eb,[C[65]||(C[65]=u("span",{class:"eyebrow mb-1 block"},"MTOM (grams)",-1)),ot(u("input",{"onUpdate:modelValue":C[24]||(C[24]=E=>lt.mtomGrams=E),type:"number",min:"0",class:"field",placeholder:"920"},null,512),[[vt,lt.mtomGrams]])]),u("label",nb,[C[66]||(C[66]=u("span",{class:"eyebrow mb-1 block"},"C-class",-1)),ot(u("select",{"onUpdate:modelValue":C[25]||(C[25]=E=>lt.cClass=E),class:"field"},[(g(),x(ct,null,Wt(nt,E=>u("option",{key:E,value:E},P(E||"— none —"),9,ib)),64))],512),[[sn,lt.cClass]])])]),u("div",sb,[u("label",ob,[ot(u("input",{"onUpdate:modelValue":C[26]||(C[26]=E=>lt.autologsFlights=E),type:"checkbox",class:"h-4 w-4 accent-[var(--accent)]"},null,512),[[rr,lt.autologsFlights]]),C[67]||(C[67]=$(" Auto-logs flights (onboard FDR) ",-1))]),u("label",rb,[ot(u("input",{"onUpdate:modelValue":C[27]||(C[27]=E=>lt.isToy=E),type:"checkbox",class:"h-4 w-4 accent-[var(--accent)]"},null,512),[[rr,lt.isToy]]),C[68]||(C[68]=$(" Toy drone (logbook-exempt) ",-1))])]),u("div",ab,[u("button",{class:"btn-accent",disabled:et.value,onClick:Yt},P(et.value?"Saving…":Ft.value?"Save changes":"Add drone"),9,lb),u("button",{class:"btn-ghost",onClick:kt},"Cancel"),At.value?(g(),x("span",ub,P(At.value),1)):N("",!0)])])):N("",!0),u("div",cb,[h.value?(g(),x("div",db,"Loading…")):l.value.length?(g(),x("div",hb,[u("table",pb,[u("thead",null,[u("tr",mb,[(g(),x(ct,null,Wt(["Name","Model","MTOM","Class","FDR",""],E=>u("th",{key:E,class:"border-y border-line bg-surface-2 px-5 py-2.5 font-mono text-[10.5px] font-normal uppercase tracking-caps text-ink-muted"},P(E),1)),64))])]),u("tbody",null,[(g(!0),x(ct,null,Wt(l.value,E=>(g(),x("tr",{key:E.id,class:Ct(["border-b border-line last:border-0",Ft.value===E.id?"bg-accent-soft":""])},[u("td",gb,P(E.name),1),u("td",_b,P(E.model||"—"),1),u("td",vb,P(E.mtomGrams?E.mtomGrams+" g":"—"),1),u("td",yb,[E.cClass?(g(),x("span",{key:0,class:Ct(["inline-flex rounded-full px-2 py-0.5 text-[11px] font-semibold",o.accent])},P(E.cClass),3)):(g(),x("span",bb,"—")),E.isToy?(g(),x("span",{key:2,class:Ct(["ml-1 inline-flex rounded-full px-2 py-0.5 text-[11px] font-semibold",o.neutral])},"toy",2)):N("",!0)]),u("td",xb,[u("span",{class:Ct(["text-xs",E.autologsFlights?"text-success-fg":"text-ink-muted"])},P(E.autologsFlights?"yes":"no"),3)]),u("td",wb,[ae.value===E.id?(g(),x(ct,{key:0},[C[71]||(C[71]=u("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),u("button",{class:"btn-ghost mr-1",onClick:C[28]||(C[28]=_e=>ae.value="")},"Cancel"),u("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:_e=>Jt(E)},"Delete",8,kb)],64)):(g(),x(ct,{key:1},[u("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:_e=>pt(E)},[O(Y,{name:"sliders",size:13}),C[72]||(C[72]=$(" Edit",-1))],8,Sb),u("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:_e=>ae.value=E.id},[O(Y,{name:"trash",size:13})],8,Pb)],64))])],2))),128))])])])):(g(),x("div",fb,[O(Y,{name:"drone",size:26,class:"text-ink-muted"}),C[69]||(C[69]=u("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No drones registered",-1)),C[70]||(C[70]=u("div",{class:"mt-1 text-xs text-ink-muted"},"Register the airframes you fly to log flights against them.",-1))]))])],64))]))}},Lb={class:"grid h-full grid-cols-[248px_1fr] max-[900px]:grid-cols-1"},Cb={class:"flex flex-col border-r border-line bg-surface-1 px-4 py-5 max-[900px]:hidden"},Mb={class:"flex items-center gap-2.5 px-2 pb-5"},Ob={class:"flex flex-col gap-0.5"},Eb=["onClick"],zb={class:"mt-auto flex flex-col gap-2.5"},Ab={class:"rounded-lg bg-surface-2 p-3"},Ib={class:"flex items-center gap-2"},$b={class:"text-xs font-semibold text-ink"},Db={class:"mt-1.5 block font-mono text-[10.5px] text-ink-muted"},Nb={class:"flex items-center gap-2.5 px-2 py-1"},Rb={class:"grid h-8 w-8 place-items-center rounded-full bg-[var(--navy-800)] text-xs font-bold text-white"},Fb={class:"min-w-0 flex-1"},Bb={class:"truncate text-[13px] font-semibold text-ink"},Vb={class:"flex items-center gap-1.5 text-[11px] text-ink-muted"},Zb=["title"],Ub={class:"overflow-y-auto"},Hb={class:"sticky top-0 z-10 flex items-center gap-4 border-b border-line px-7 py-3.5",style:{background:"color-mix(in srgb, var(--bg-app) 82%, transparent)","backdrop-filter":"blur(10px)"}},jb={class:"mt-0.5 text-[22px] font-bold tracking-tightest text-ink"},Wb={class:"ml-auto flex items-center gap-3"},Kb={class:"flex h-10 w-60 items-center gap-2 rounded border border-line-strong bg-surface-1 px-3 max-[1100px]:hidden"},Gb={key:0,class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},qb={class:"grid grid-cols-4 gap-4 max-[1100px]:grid-cols-2 max-[560px]:grid-cols-1"},Yb={class:"flex items-center justify-between"},Jb={class:"eyebrow"},Xb={class:"mt-2.5 text-[34px] font-bold leading-none tracking-tightest text-ink"},Qb={class:"grid grid-cols-[1.6fr_1fr] gap-5 max-[1100px]:grid-cols-1"},tx={class:"panel p-5"},ex={class:"mb-3.5 flex items-center justify-between"},nx={class:"panel p-5"},ix={class:"mb-3.5 flex items-center justify-between"},sx={class:"grid place-items-center py-10 text-center"},ox={class:"panel overflow-hidden p-0"},rx={class:"flex items-center justify-between px-5 py-4"},ax={class:"flex gap-2"},lx={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},ux={key:1,class:"overflow-x-auto"},cx={class:"w-full border-collapse text-sm"},dx={class:"text-left"},fx=["onClick"],hx={class:"px-5 py-3 font-mono font-bold text-ink"},px={class:"px-5 py-3 text-ink-secondary"},mx={class:"px-5 py-3"},gx={class:"px-5 py-3 font-mono text-ink-secondary"},_x={class:"px-5 py-3"},vx={key:0,class:"flex items-center gap-2"},yx={class:"h-1.5 w-12 overflow-hidden rounded bg-surface-2"},bx={class:"font-mono text-xs text-ink-secondary"},xx={key:1,class:"font-mono text-xs text-ink-muted"},wx={class:"px-5 py-3 font-mono text-ink-secondary"},kx={class:"px-5 py-3 text-right"},Sx=["onClick"],Px={key:1,class:"p-7"},Tx={class:"mb-4 flex flex-wrap items-center gap-3"},Lx={class:"font-mono text-mode font-bold text-ink"},Cx={key:0,class:"rounded-full bg-danger-soft px-2.5 py-0.5 font-mono text-[10px] font-bold uppercase tracking-caps text-danger-fg"},Mx={key:1,class:"ml-auto flex flex-wrap gap-1.5"},Ox=["onClick"],Ex={key:0,class:"panel grid place-items-center p-16 text-center"},zx={class:"pill"},Ax={class:"pill"},Ix={class:"pill"},$x={class:"mt-1 text-sm font-semibold text-ink"},Dx={class:"pill"},Nx={class:"mt-1 font-mono text-sm font-bold tabular text-ink"},Rx={class:"grid grid-cols-2 gap-4 max-[820px]:grid-cols-1"},Fx={class:"panel p-4"},Bx={class:"flex items-center gap-4"},Vx={class:"h-9 flex-1 overflow-hidden rounded border border-line bg-surface-2"},Zx={class:"readout"},Ux={class:"panel p-4"},Hx={class:"readout"},jx={class:"panel p-4"},Wx={class:"space-y-1.5 text-sm"},Kx={class:"flex justify-between"},Gx={class:"text-ink"},qx={class:"flex justify-between"},Yx={class:"text-ink"},Jx={class:"flex justify-between"},Xx={class:"font-mono tabular text-ink"},Qx={class:"flex justify-between"},t0={class:"font-mono tabular text-ink"},e0={class:"panel p-4"},n0={class:"space-y-1.5 text-sm"},i0={class:"flex justify-between"},s0={class:"font-mono tabular text-ink"},o0={class:"flex justify-between"},r0={class:"font-mono tabular text-ink"},a0={class:"flex justify-between"},l0={class:"font-mono tabular text-ink"},u0={class:"panel col-span-2 p-4 max-[820px]:col-span-1"},c0={class:"panel p-4"},d0={class:"flex flex-wrap gap-2"},f0={class:"mt-2 min-h-[16px] text-xs text-ink-muted"},h0={class:"panel p-4"},p0={class:"h-[180px] overflow-y-auto font-mono text-xs"},m0={class:"text-ink-muted"},g0={class:"font-semibold text-accent"},_0={class:"break-all text-ink"},v0={key:4,class:"p-7"},y0={class:"panel grid place-items-center p-16 text-center"},b0={class:"mt-3 text-sm font-medium text-ink-secondary"},x0={key:0,class:"mt-1 text-xs text-ink-muted"},w0={key:1,class:"mt-1 text-xs text-ink-muted"},k0={__name:"Dashboard",props:{email:{type:String,default:""},role:{type:String,default:"user"},organization:{type:String,default:""},organizationName:{type:String,default:""}},emits:["logout"],setup(e,{emit:i}){const o=e,a=i,l=xe({}),d=xe({}),h=G(null),_=G(!1),y=xe([]),T=G(""),w=G("Overview"),A=[["grid","Overview"],["radio","Live flights"],["route","Routes"],["calendar","Schedule"],["book","Logbook"],["fileText","Documents"],["server","Drives"],["settings","Settings"]],U=xt(()=>(A.find(([,v])=>v===w.value)||["grid"])[0]),V=G(""),rt=G(""),Q=G("");let Ot=null,Mt=null,q=!1;const dt=xt(()=>Object.keys(l).sort((v,m)=>(l[m].online?1:0)-(l[v].online?1:0)||v.localeCompare(m))),it=xt(()=>h.value?l[h.value]:null),ht=xt(()=>it.value&&it.value.telemetry||{}),Kt=xt(()=>!!(it.value&&it.value.online)),he=xt(()=>{const v=ht.value;return typeof v.latitude=="number"&&typeof v.longitude=="number"&&(v.latitude||v.longitude)?{lat:v.latitude,lng:v.longitude}:null}),pe=xt(()=>h.value&&d[h.value]||[]),St=xt(()=>{const v=ht.value;return typeof v.velocityX=="number"&&typeof v.velocityY=="number"?Math.hypot(v.velocityX,v.velocityY):null});function Nt(v){return v.online?v.connected?["In flight","success"]:["Standby","accent"]:["Offline","neutral"]}function Et(v){const m=v&&v.telemetry||{};return typeof m.velocityX=="number"&&typeof m.velocityY=="number"?Math.hypot(m.velocityX,m.velocityY):null}const nt=xt(()=>dt.value.map(v=>{const m=l[v],M=m.telemetry||{},[F,R]=Nt(m);return{id:v,mission:m.model||(m.connected?"Drone linked":m.online?"App online":"No signal"),status:F,tone:R,alt:typeof M.altitude=="number"?M.altitude.toFixed(0)+" m":"—",battery:typeof M.batteryPercent=="number"?M.batteryPercent:null,speed:Et(m)}})),ut=xt(()=>dt.value.filter(v=>l[v].online).length),zt=xt(()=>dt.value.filter(v=>l[v].online&&l[v].connected).length),Ft=xt(()=>dt.value.filter(v=>!l[v].online).length),lt=xt(()=>{const v=dt.value.map(m=>{var M;return(M=l[m].telemetry)==null?void 0:M.batteryPercent}).filter(m=>typeof m=="number");return v.length?Math.round(v.reduce((m,M)=>m+M,0)/v.length):null}),At=xt(()=>[{label:"Active flights",value:String(zt.value),delta:`${ut.value} online`,tone:"success",icon:"radio"},{label:"Avg battery",value:lt.value==null?"—":lt.value+"%",delta:lt.value==null?"no telemetry":lt.value<40?"low — watch":"nominal",tone:lt.value!=null&<.value<40?"danger":"neutral",icon:"battery"},{label:"Fleet size",value:String(dt.value.length),delta:`${zt.value} in flight`,tone:"neutral",icon:"grid"},{label:"Offline",value:String(Ft.value),delta:Ft.value?"needs attention":"all reachable",tone:Ft.value?"warning":"success",icon:"signal"}]),et={success:"bg-success-soft text-success-fg",warning:"bg-amber-soft text-amber-fg",danger:"bg-danger-soft text-danger-fg",accent:"bg-accent-soft text-accent-soft-fg",neutral:"bg-surface-2 text-ink-secondary"},ce={success:"text-success-fg",danger:"text-danger-fg",warning:"text-amber-fg",neutral:"text-ink-muted",accent:"text-accent-soft-fg"},pt=xt(()=>{var M,F,R;const m=(o.email||"PV").split("@")[0].split(/[.\-_ ]+/).filter(Boolean);return((((M=m[0])==null?void 0:M[0])||"P")+(((F=m[1])==null?void 0:F[0])||((R=m[0])==null?void 0:R[1])||"V")).toUpperCase()}),kt={superadmin:"Superadmin",admin:"Admin",user:"Operator"},Yt=xt(()=>kt[o.role]||"Operator"),ae=xt(()=>o.organizationName||(o.role==="superadmin"?"All organizations":"No organization"));function Jt(v){var M;l[v.deviceId]=v;const m=v.telemetry||{};typeof m.latitude=="number"&&typeof m.longitude=="number"&&(m.latitude||m.longitude)&&(d[v.deviceId]||(d[v.deviceId]=[]),d[v.deviceId].push([m.latitude,m.longitude]),d[v.deviceId].length>1e3&&d[v.deviceId].shift()),(!h.value||v.online&&!((M=l[h.value])!=null&&M.online))&&(h.value=v.deviceId)}function Bt(v){delete l[v],delete d[v],h.value===v&&(h.value=dt.value[0]||null)}function j(v){y.unshift({t:ql(Date.now()),tag:v.type||"?",text:JSON.stringify(C(v))}),y.length>200&&y.pop()}function C(v){const m={...v};return delete m.type,m}function E(){const v=location.protocol==="https:"?"wss":"ws";Ot=new WebSocket(`${v}://${location.host}/bff/ws`),Ot.onopen=()=>_.value=!0,Ot.onclose=()=>{_.value=!1,q||(Mt=setTimeout(E,1500))},Ot.onerror=()=>Ot&&Ot.close(),Ot.onmessage=m=>{let M;try{M=JSON.parse(m.data)}catch{return}M.type==="snapshot"?(M.devices||[]).forEach(Jt):M.type==="update"&&M.device?(Jt(M.device),M.event&&M.device.deviceId===h.value&&j(M.event)):M.type==="removed"&&M.deviceId&&Bt(M.deviceId)}}async function _e(){if(!h.value)return Q.value="No device selected.";if(!V.value.trim())return Q.value="Enter a command name.";let v;if(rt.value.trim())try{v=JSON.parse(rt.value)}catch{return Q.value="Payload is not valid JSON."}const{ok:m,body:M}=await fp(h.value,V.value.trim(),v);Q.value=m?`Sent "${V.value.trim()}".`:`Error: ${M.error||"failed"}`}function se(v,m,M=""){return typeof v=="number"?v.toFixed(m)+M:"—"}function Ge(v){h.value=v,w.value="Live flights"}return Yi(async()=>{(await Rh()).forEach(Jt),E()}),vr(()=>{q=!0,Mt&&clearTimeout(Mt),Ot&&Ot.close()}),(v,m)=>{var M,F,R,B,J;return g(),x("div",Lb,[u("aside",Cb,[u("div",Mb,[O(Cc,{size:26}),m[7]||(m[7]=u("span",{class:"text-[19px] tracking-tightest"},[u("span",{class:"font-medium text-ink-secondary"},"Pilot"),u("span",{class:"font-bold text-ink"},"Vault")],-1))]),u("nav",Ob,[(g(),x(ct,null,Wt(A,([D,K])=>u("button",{key:K,class:Ct(["flex items-center gap-3 rounded px-3 py-2.5 text-left text-sm transition",w.value===K?"bg-accent-soft font-semibold text-accent-soft-fg":"font-medium text-ink-secondary hover:bg-surface-2"]),onClick:Z=>w.value=K},[O(Y,{name:D,size:18,stroke:w.value===K?2.2:1.8},null,8,["name","stroke"]),$(" "+P(K),1)],10,Eb)),64))]),u("div",zb,[u("div",Ab,[u("div",Ib,[u("span",{class:Ct(["h-2 w-2 rounded-full",_.value?"bg-ready":"bg-caution"])},null,2),u("span",$b,P(_.value?"Link healthy":"Reconnecting…"),1)]),u("span",Db,"API gateway · "+P(_.value?"streaming":"retrying"),1)]),u("div",Nb,[u("div",Rb,P(pt.value),1),u("div",Fb,[u("div",Bb,P(e.email||"Operator"),1),u("div",Vb,[O(Y,{name:"grid",size:11,class:"shrink-0"}),u("span",{class:"truncate",title:`${Yt.value} · ${ae.value}`},P(Yt.value)+" · "+P(ae.value),9,Zb)])]),u("button",{class:"text-ink-muted transition hover:text-ink",title:"Log out","aria-label":"Log out",onClick:m[0]||(m[0]=D=>a("logout"))},[O(Y,{name:"logout",size:16})])])])]),u("main",Ub,[u("header",Hb,[u("div",null,[m[8]||(m[8]=u("div",{class:"eyebrow"},"Live operations",-1)),u("h1",jb,P(w.value),1)]),u("div",Wb,[u("div",Kb,[O(Y,{name:"search",size:16,class:"text-ink-muted"}),ot(u("input",{"onUpdate:modelValue":m[1]||(m[1]=D=>T.value=D),placeholder:"Search drones, routes…",class:"w-full border-none bg-transparent text-sm text-ink outline-none placeholder:text-ink-muted"},null,512),[[vt,T.value]])]),u("button",{class:"btn-accent flex items-center gap-2",onClick:m[2]||(m[2]=D=>w.value="Live flights")},[O(Y,{name:"radio",size:16}),m[9]||(m[9]=$(" Live flights ",-1))])])]),w.value==="Overview"?(g(),x("div",Gb,[u("div",qb,[(g(!0),x(ct,null,Wt(At.value,D=>(g(),x("div",{key:D.label,class:"panel p-5"},[u("div",Yb,[u("span",Jb,P(D.label),1),O(Y,{name:D.icon,size:16,class:"text-ink-muted"},null,8,["name"])]),u("div",Xb,P(D.value),1),u("span",{class:Ct(["mt-2 block font-mono text-[11px]",ce[D.tone]])},P(D.delta),3)]))),128))]),u("div",Qb,[u("div",tx,[u("div",ex,[m[11]||(m[11]=u("div",null,[u("div",{class:"eyebrow"},"Airspace"),u("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Live map")],-1)),zt.value?(g(),x("span",{key:0,class:Ct(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",et.success])},[m[10]||(m[10]=u("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(P(zt.value)+" airborne ",1)],2)):N("",!0)]),O(Ql,{position:he.value,trail:pe.value},null,8,["position","trail"])]),u("div",nx,[u("div",ix,[m[12]||(m[12]=u("div",null,[u("div",{class:"eyebrow"},"Today"),u("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Schedule")],-1)),O(Y,{name:"clock",size:16,class:"text-ink-muted"})]),u("div",sx,[O(Y,{name:"calendar",size:24,class:"text-ink-muted"}),m[13]||(m[13]=u("div",{class:"mt-2 text-sm font-medium text-ink-secondary"},"No missions scheduled",-1)),m[14]||(m[14]=u("div",{class:"mt-0.5 text-xs text-ink-muted"},"Scheduling is not wired to a backend yet.",-1))])])]),u("div",ox,[u("div",rx,[m[17]||(m[17]=u("div",null,[u("div",{class:"eyebrow"},"Fleet"),u("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Aircraft status")],-1)),u("div",ax,[u("span",{class:Ct(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",et.success])},[m[15]||(m[15]=u("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(P(zt.value)+" in flight ",1)],2),Ft.value?(g(),x("span",{key:0,class:Ct(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",et.warning])},[m[16]||(m[16]=u("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(P(Ft.value)+" offline ",1)],2)):N("",!0)])]),nt.value.length?(g(),x("div",ux,[u("table",cx,[u("thead",null,[u("tr",dx,[(g(),x(ct,null,Wt(["Aircraft","Mission","Status","Alt","Battery","Speed",""],D=>u("th",{key:D,class:"border-y border-line bg-surface-2 px-5 py-2.5 font-mono text-[10.5px] font-normal uppercase tracking-caps text-ink-muted"},P(D),1)),64))])]),u("tbody",null,[(g(!0),x(ct,null,Wt(nt.value,(D,K)=>(g(),x("tr",{key:D.id,class:Ct(["cursor-pointer transition hover:bg-surface-2",KGe(D.id)},[u("td",hx,P(D.id),1),u("td",px,P(D.mission),1),u("td",mx,[u("span",{class:Ct(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",et[D.tone]])},[m[18]||(m[18]=u("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(P(D.status),1)],2)]),u("td",gx,P(D.alt),1),u("td",_x,[D.battery!=null?(g(),x("div",vx,[u("div",yx,[u("div",{class:Ct(["h-full",D.battery<40?"bg-caution":"bg-ready"]),style:Ss({width:D.battery+"%"})},null,6)]),u("span",bx,P(D.battery)+"%",1)])):(g(),x("span",xx,"—"))]),u("td",wx,[$(P(D.speed==null?"—":D.speed.toFixed(1))+" ",1),m[19]||(m[19]=u("span",{class:"text-ink-muted"},"m/s",-1))]),u("td",kx,[u("button",{class:"btn-ghost inline-flex items-center gap-1.5 whitespace-nowrap",onClick:yc(Z=>Ge(D.id),["stop"])},[O(Y,{name:"play",size:14}),m[20]||(m[20]=$(" Track ",-1))],8,Sx)])],10,fx))),128))])])])):(g(),x("div",lx," No aircraft connected yet. Devices appear here as they come online. "))])])):w.value==="Live flights"?(g(),x("div",Px,[u("div",Tx,[u("span",Lx,P(h.value||"No device selected"),1),it.value&&!Kt.value?(g(),x("span",Cx,"Offline")):N("",!0),dt.value.length?(g(),x("div",Mx,[(g(!0),x(ct,null,Wt(dt.value,D=>(g(),x("button",{key:D,class:Ct(["flex items-center gap-2 rounded border px-3 py-1.5 font-mono text-xs font-bold transition",D===h.value?"border-accent bg-accent-soft text-accent-soft-fg":"border-line bg-surface-1 text-ink-secondary hover:border-line-strong"]),onClick:K=>h.value=D},[u("span",{class:Ct(["h-2 w-2 rounded-full",l[D].online?"bg-ready":"bg-ink-muted"])},null,2),$(" "+P(D),1)],10,Ox))),128))])):N("",!0)]),dt.value.length?(g(),x(ct,{key:1},[u("div",{class:Ct(["mb-4 grid gap-3",!Kt.value&&it.value?"opacity-60":""]),style:{"grid-template-columns":"repeat(auto-fit, minmax(150px, 1fr))"}},[u("div",zx,[m[23]||(m[23]=u("div",{class:"eyebrow"},"Registration",-1)),u("div",{class:Ct(["mt-1 text-sm font-semibold",Kt.value?((M=it.value)==null?void 0:M.registration)==="success"?"text-success-fg":"text-danger-fg":"text-ink"])},P(Kt.value&&((F=it.value)!=null&&F.registration)?it.value.registration:"—"),3)]),u("div",Ax,[m[24]||(m[24]=u("div",{class:"eyebrow"},"Drone link",-1)),u("div",{class:Ct(["mt-1 text-sm font-semibold",Kt.value?(R=it.value)!=null&&R.connected?"text-success-fg":"text-danger-fg":"text-ink"])},P(it.value?Kt.value?it.value.connected?"connected":"no drone":"app offline":"—"),3)]),u("div",Ix,[m[25]||(m[25]=u("div",{class:"eyebrow"},"Model",-1)),u("div",$x,P(((B=it.value)==null?void 0:B.model)||"—"),1)]),u("div",Dx,[m[26]||(m[26]=u("div",{class:"eyebrow"},"Last update",-1)),u("div",Nx,P((J=it.value)!=null&&J.lastSeenMs?$t(ql)(it.value.lastSeenMs):"—"),1)])],2),u("div",Rx,[u("div",Fx,[m[28]||(m[28]=u("div",{class:"mb-3 eyebrow"},"Battery",-1)),u("div",Bx,[u("div",Vx,[u("div",{class:Ct(["h-full transition-all",typeof ht.value.batteryPercent=="number"?ht.value.batteryPercent<20?"bg-warning":ht.value.batteryPercent<40?"bg-caution":"bg-ready":""]),style:Ss({width:(typeof ht.value.batteryPercent=="number"?ht.value.batteryPercent:0)+"%"})},null,6)]),u("div",Zx,[$(P(typeof ht.value.batteryPercent=="number"?ht.value.batteryPercent:"—"),1),m[27]||(m[27]=u("span",{class:"text-sm text-ink-secondary"},"%",-1))])])]),u("div",Ux,[m[30]||(m[30]=u("div",{class:"mb-3 eyebrow"},"Altitude",-1)),u("div",Hx,[$(P(se(ht.value.altitude,1)),1),m[29]||(m[29]=u("span",{class:"text-sm text-ink-secondary"}," m",-1))])]),u("div",jx,[m[35]||(m[35]=u("div",{class:"mb-3 eyebrow"},"Flight",-1)),u("div",Wx,[u("div",Kx,[m[31]||(m[31]=u("span",{class:"text-ink-secondary"},"Mode",-1)),u("b",Gx,P(ht.value.flightMode||"—"),1)]),u("div",qx,[m[32]||(m[32]=u("span",{class:"text-ink-secondary"},"Flying",-1)),u("b",Yx,P(ht.value.isFlying==null?"—":ht.value.isFlying?"yes":"no"),1)]),u("div",Jx,[m[33]||(m[33]=u("span",{class:"text-ink-secondary"},"GPS sats",-1)),u("b",Xx,P(ht.value.satelliteCount==null?"—":ht.value.satelliteCount),1)]),u("div",Qx,[m[34]||(m[34]=u("span",{class:"text-ink-secondary"},"Speed (H)",-1)),u("b",t0,P(St.value==null?"—":se(St.value,2," m/s")),1)])])]),u("div",e0,[m[39]||(m[39]=u("div",{class:"mb-3 eyebrow"},"Position",-1)),u("div",n0,[u("div",i0,[m[36]||(m[36]=u("span",{class:"text-ink-secondary"},"Latitude",-1)),u("b",s0,P(se(ht.value.latitude,6)),1)]),u("div",o0,[m[37]||(m[37]=u("span",{class:"text-ink-secondary"},"Longitude",-1)),u("b",r0,P(se(ht.value.longitude,6)),1)]),u("div",a0,[m[38]||(m[38]=u("span",{class:"text-ink-secondary"},"Vert. speed",-1)),u("b",l0,P(se(typeof ht.value.velocityZ=="number"?-ht.value.velocityZ:void 0,2," m/s")),1)])])]),u("div",u0,[m[40]||(m[40]=u("div",{class:"mb-3 eyebrow"},"Track",-1)),O(Ql,{position:he.value,trail:pe.value},null,8,["position","trail"])]),u("div",c0,[m[41]||(m[41]=u("div",{class:"mb-3 eyebrow"},"Send command",-1)),u("div",d0,[ot(u("input",{"onUpdate:modelValue":m[3]||(m[3]=D=>V.value=D),class:"field flex-1",placeholder:"command (e.g. startConnection)"},null,512),[[vt,V.value]]),ot(u("input",{"onUpdate:modelValue":m[4]||(m[4]=D=>rt.value=D),class:"field flex-1",placeholder:"payload JSON (optional)"},null,512),[[vt,rt.value]]),u("button",{class:"btn-accent",onClick:_e},"Send")]),u("div",f0,P(Q.value),1)]),u("div",h0,[m[42]||(m[42]=u("div",{class:"mb-3 eyebrow"},"Event log",-1)),u("div",p0,[(g(!0),x(ct,null,Wt(y,(D,K)=>(g(),x("div",{key:K,class:"border-b border-line py-1"},[u("span",m0,P(D.t),1),u("span",g0,P(D.tag),1),u("span",_0,P(D.text),1)]))),128))])])])],64)):(g(),x("div",Ex,[O(Y,{name:"radio",size:28,class:"text-ink-muted"}),m[21]||(m[21]=u("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No aircraft online",-1)),m[22]||(m[22]=u("div",{class:"mt-1 text-xs text-ink-muted"},"Live telemetry appears here once a drone connects.",-1))]))])):w.value==="Logbook"?(g(),ie(Tb,{key:2,email:e.email,role:e.role,organization:e.organization,"organization-name":e.organizationName},null,8,["email","role","organization","organization-name"])):w.value==="Settings"?(g(),ie(My,{key:3,email:e.email,role:e.role,organization:e.organization,"organization-name":e.organizationName,onLogout:m[5]||(m[5]=D=>a("logout"))},null,8,["email","role","organization","organization-name"])):(g(),x("div",v0,[u("div",y0,[O(Y,{name:U.value,size:28,class:"text-ink-muted"},null,8,["name"]),u("div",b0,P(w.value),1),w.value==="Drives"?(g(),x("div",x0,[m[43]||(m[43]=$(" Browse and transfer files here once a drive is connected. Configure drives in ",-1)),u("button",{class:"font-semibold text-accent hover:underline",onClick:m[6]||(m[6]=D=>w.value="Settings")},"Settings → Integrations"),m[44]||(m[44]=$(". ",-1))])):(g(),x("div",w0,"This section is part of the console shell and has no backend yet."))])]))])])}}},S0={key:0,class:"h-full"},P0={key:1,class:"grid h-full place-items-center text-ink-muted text-sm"},T0={__name:"App",setup(e){const i=G(!1),o=G(null),a=G("user"),l=G(""),d=G(""),h=G("");function _(w){a.value=w&&w.role||"user",l.value=w&&w.organization||"",d.value=w&&w.organizationName||""}Yi(async()=>{h.value=(await $h()).apiBase||"";const w=await jl();w&&(o.value=w.email,_(w),await Jl()),i.value=!0});async function y(w){o.value=w,_(await jl()),await Jl()}async function T(){_p(),await Nh(),o.value=null,a.value="user",l.value="",d.value=""}return(w,A)=>i.value?(g(),x("div",S0,[o.value?(g(),ie(k0,{key:0,email:o.value,role:a.value,organization:l.value,"organization-name":d.value,onLogout:T},null,8,["email","role","organization","organization-name"])):(g(),ie(Ip,{key:1,"default-api-base":h.value,onSignedIn:y},null,8,["default-api-base"]))])):(g(),x("div",P0,"Loading…"))}};Eh(T0).mount("#app"); diff --git a/Web App/server/dist/index.html b/Web App/server/dist/index.html index 3b8e629..c06d8e6 100644 --- a/Web App/server/dist/index.html +++ b/Web App/server/dist/index.html @@ -35,8 +35,8 @@ })() PilotVault — Control Panel - - + +
diff --git a/Web App/server/main.go b/Web App/server/main.go index 5129e18..38d9b6a 100644 --- a/Web App/server/main.go +++ b/Web App/server/main.go @@ -82,6 +82,12 @@ func main() { mux.HandleFunc("PATCH /bff/flights/{id}", app.requireAuth(app.handleUpdateFlight)) mux.HandleFunc("DELETE /bff/flights/{id}", app.requireAuth(app.handleDeleteFlight)) mux.HandleFunc("GET /bff/logbook/export", app.requireAuth(app.handleExportLogbook)) + // Documents — the compliance + operational document store (scoping upstream) + mux.HandleFunc("GET /bff/documents", app.requireAuth(app.handleListDocuments)) + mux.HandleFunc("POST /bff/documents", app.requireAuth(app.handleCreateDocument)) + mux.HandleFunc("PATCH /bff/documents/{id}", app.requireAuth(app.handleUpdateDocument)) + mux.HandleFunc("DELETE /bff/documents/{id}", app.requireAuth(app.handleDeleteDocument)) + mux.HandleFunc("GET /bff/documents/{id}/file", app.requireAuth(app.handleDownloadDocument)) mux.HandleFunc("GET /bff/ws", app.handleWS) mux.HandleFunc("GET /healthz", func(w http.ResponseWriter, r *http.Request) { writeJSON(w, http.StatusOK, map[string]any{"status": "ok", "api": app.apiBase}) diff --git a/Web App/web/src/api.js b/Web App/web/src/api.js index 486046c..14de9d4 100644 --- a/Web App/web/src/api.js +++ b/Web App/web/src/api.js @@ -330,6 +330,54 @@ export function exportLogbookUrl() { return '/bff/logbook/export' } +/* ---------- Documents ---------- */ + +// List in-scope documents. Pass `expiring` (days) to narrow to documents that +// expire within that window (already-expired included). +export async function getDocuments(expiring) { + try { + const qs = expiring != null && expiring !== '' ? `?expiring=${encodeURIComponent(expiring)}` : '' + const r = await fetch(`/bff/documents${qs}`) + if (!r.ok) return { ok: false, status: r.status, documents: [] } + const d = await r.json() + return { ok: true, status: 200, documents: d.documents || [] } + } catch { + return { ok: false, status: 0, documents: [] } + } +} + +// Create a document. `fields` is a plain object of metadata; `file` is an +// optional File (from an ). Sent as multipart/form-data so the +// blob rides along with the metadata. +export async function createDocument(fields, file) { + const fd = new FormData() + Object.entries(fields).forEach(([k, v]) => { + if (v != null && v !== '') fd.append(k, v) + }) + if (file) fd.append('file', file) + const r = await fetch('/bff/documents', { method: 'POST', body: fd }) + return { ok: r.ok, status: r.status, body: await r.json().catch(() => ({})) } +} + +export async function updateDocument(id, changes) { + const r = await fetch(`/bff/documents/${encodeURIComponent(id)}`, { + method: 'PATCH', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify(changes), + }) + return { ok: r.ok, status: r.status, body: await r.json().catch(() => ({})) } +} + +export async function deleteDocument(id) { + const r = await fetch(`/bff/documents/${encodeURIComponent(id)}`, { method: 'DELETE' }) + return { ok: r.ok, status: r.status, body: await r.json().catch(() => ({})) } +} + +// URL that streams a document's stored blob as a download. +export function documentFileUrl(id) { + return `/bff/documents/${encodeURIComponent(id)}/file` +} + export async function sendCommand(id, command, payload) { const r = await fetch(`/bff/devices/${encodeURIComponent(id)}/command`, { method: 'POST', diff --git a/Web App/web/src/components/Dashboard.vue b/Web App/web/src/components/Dashboard.vue index a551da9..cea67f8 100644 --- a/Web App/web/src/components/Dashboard.vue +++ b/Web App/web/src/components/Dashboard.vue @@ -5,6 +5,7 @@ import BrandMark from './BrandMark.vue' import Icon from './Icon.vue' import Settings from './Settings.vue' import Logbook from './Logbook.vue' +import Documents from './Documents.vue' import { getDevices, sendCommand } from '../api.js' import { formatTime } from '../prefs.js' @@ -631,6 +632,9 @@ onBeforeUnmount(() => { + + + diff --git a/Web App/web/src/components/Documents.vue b/Web App/web/src/components/Documents.vue new file mode 100644 index 0000000..b2fc8dd --- /dev/null +++ b/Web App/web/src/components/Documents.vue @@ -0,0 +1,480 @@ + + +