diff --git a/API Server/internal/api/integrations_openweather.go b/API Server/internal/api/integrations_openweather.go index 1c79c81..c9d4c3d 100644 --- a/API Server/internal/api/integrations_openweather.go +++ b/API Server/internal/api/integrations_openweather.go @@ -5,6 +5,7 @@ import ( "encoding/json" "net/http" "net/url" + "strconv" "strings" ) @@ -426,3 +427,126 @@ func (s *Server) handleOpenWeatherHealth(w http.ResponseWriter, r *http.Request) } writeJSON(w, http.StatusOK, map[string]any{"health": h}) } + +// owWeather is the trimmed current-conditions shape the Overview weather card needs, +// flattened out of OpenWeather's richer /data/2.5/weather payload. +type owWeather struct { + Location string `json:"location"` + Country string `json:"country"` + Temp *float64 `json:"temp"` + FeelsLike *float64 `json:"feelsLike"` + Description string `json:"description"` + Icon string `json:"icon"` // OpenWeather icon code, e.g. "01d" + Humidity *int `json:"humidity"` + WindSpeed *float64 `json:"windSpeed"` + WindDeg *int `json:"windDeg"` + Clouds *int `json:"clouds"` + Dt int64 `json:"dt"` // observation time (unix seconds) +} + +// validLatLon reports whether lat/lon are well-formed geographic coordinates. +func validLatLon(lat, lon string) bool { + la, e1 := strconv.ParseFloat(lat, 64) + lo, e2 := strconv.ParseFloat(lon, 64) + return e1 == nil && e2 == nil && la >= -90 && la <= 90 && lo >= -180 && lo <= 180 +} + +// GET /api/integrations/openweather/current — current conditions for the caller's +// resolved location (or a supplied ?lat=&lon= point), for the Overview weather card. +// Runs server-side against the resolved cascade config (never returns the API key). +// Gated by the same switches as the settings view: global master, org gate, and the +// caller's personal opt-in. When any gate is off (or no key resolves) it returns 200 +// with {unavailable:true, detail} so the card can degrade quietly rather than error. +func (s *Server) handleOpenWeatherCurrent(w http.ResponseWriter, r *http.Request) { + who, userRaw, ok := s.integrationCaller(w, r) + if !ok { + return + } + res := s.resolveOpenWeather(r.Context(), who, userRaw) + + units := res.eff.Units + if units == "" { + units = "metric" // matches the plugin's runtime fallback + } + unavailable := func(detail string) { + writeJSON(w, http.StatusOK, map[string]any{"unavailable": true, "detail": detail, "units": units}) + } + switch { + case !res.available: + unavailable("OpenWeather is disabled by the administrator") + return + case !res.orgEnabled: + unavailable("OpenWeather is disabled for your organization") + return + case !res.enabled: + unavailable("Enable OpenWeather in Settings → Integrations to show weather") + return + case strings.TrimSpace(res.eff.APIKey) == "": + unavailable("No API key configured for OpenWeather") + return + } + + // Optional point override (drone/device/browser location the Overview resolves). + // Malformed input is ignored so the plugin falls back to the configured default. + var payload json.RawMessage + lat := strings.TrimSpace(r.URL.Query().Get("lat")) + lon := strings.TrimSpace(r.URL.Query().Get("lon")) + if validLatLon(lat, lon) { + payload, _ = json.Marshal(map[string]string{"lat": lat, "lon": lon}) + } + + cfg := map[string]string{} + for _, k := range owFields { + cfg[k] = owGet(res.eff, k) + } + raw, err := s.plugins.InvokeWith(r.Context(), openWeatherPlugin, cfg, "weather.current", payload) + if err != nil { + writeJSON(w, http.StatusBadGateway, map[string]any{"error": err.Error()}) + return + } + + // Flatten OpenWeather's /data/2.5/weather response into the card model. + var owResp struct { + Weather []struct { + Description string `json:"description"` + Icon string `json:"icon"` + } `json:"weather"` + Main struct { + Temp *float64 `json:"temp"` + FeelsLike *float64 `json:"feels_like"` + Humidity *int `json:"humidity"` + } `json:"main"` + Wind struct { + Speed *float64 `json:"speed"` + Deg *int `json:"deg"` + } `json:"wind"` + Clouds struct { + All *int `json:"all"` + } `json:"clouds"` + Dt int64 `json:"dt"` + Name string `json:"name"` + Sys struct { + Country string `json:"country"` + } `json:"sys"` + } + if err := json.Unmarshal(raw, &owResp); err != nil { + writeJSON(w, http.StatusBadGateway, map[string]any{"error": "unexpected OpenWeather response"}) + return + } + weather := owWeather{ + Location: owResp.Name, + Country: owResp.Sys.Country, + Temp: owResp.Main.Temp, + FeelsLike: owResp.Main.FeelsLike, + Humidity: owResp.Main.Humidity, + WindSpeed: owResp.Wind.Speed, + WindDeg: owResp.Wind.Deg, + Clouds: owResp.Clouds.All, + Dt: owResp.Dt, + } + if len(owResp.Weather) > 0 { + weather.Description = owResp.Weather[0].Description + weather.Icon = owResp.Weather[0].Icon + } + writeJSON(w, http.StatusOK, map[string]any{"weather": weather, "units": units}) +} diff --git a/API Server/internal/api/integrations_openweather_test.go b/API Server/internal/api/integrations_openweather_test.go index ad63daa..8f31a66 100644 --- a/API Server/internal/api/integrations_openweather_test.go +++ b/API Server/internal/api/integrations_openweather_test.go @@ -98,6 +98,21 @@ func TestOpenWeatherViewMasksKey(t *testing.T) { } } +func TestValidLatLon(t *testing.T) { + ok := [][2]string{{"0", "0"}, {"52.2297", "21.0122"}, {"-90", "180"}, {"90", "-180"}} + for _, c := range ok { + if !validLatLon(c[0], c[1]) { + t.Errorf("validLatLon(%q,%q) = false, want true", c[0], c[1]) + } + } + bad := [][2]string{{"", ""}, {"91", "0"}, {"0", "181"}, {"-91", "0"}, {"abc", "0"}, {"0", "x"}} + for _, c := range bad { + if validLatLon(c[0], c[1]) { + t.Errorf("validLatLon(%q,%q) = true, want false", c[0], c[1]) + } + } +} + // mergeOpenWeather must preserve sibling plugin keys (opensky/webdav) untouched. func TestMergeOpenWeatherPreservesSiblings(t *testing.T) { existing := json.RawMessage(`{"opensky":{"enabled":true},"webdav":{"config":{"baseURL":"https://x"}}}`) diff --git a/API Server/internal/api/server.go b/API Server/internal/api/server.go index 6ca333a..7b33d79 100644 --- a/API Server/internal/api/server.go +++ b/API Server/internal/api/server.go @@ -115,6 +115,7 @@ func (s *Server) Handler() http.Handler { mux.HandleFunc("GET /api/integrations/openweather", s.handleGetOpenWeather) mux.HandleFunc("PUT /api/integrations/openweather", s.handlePutOpenWeather) mux.HandleFunc("POST /api/integrations/openweather/health", s.handleOpenWeatherHealth) + mux.HandleFunc("GET /api/integrations/openweather/current", s.handleOpenWeatherCurrent) // User-management — gated on the caller being a manager (admin or superadmin). // Admins are scoped to their own organization inside each handler. diff --git a/Web App/server/bff.go b/Web App/server/bff.go index e73ace4..8ce976a 100644 --- a/Web App/server/bff.go +++ b/Web App/server/bff.go @@ -344,6 +344,18 @@ func (a *App) handleOpenWeatherHealth(w http.ResponseWriter, r *http.Request) { a.doRelay(w, req) } +// GET /bff/integrations/openweather/current → API Server current conditions for the +// Overview weather card. Forwards the optional ?lat=&lon= location override. +func (a *App) handleOpenWeatherCurrent(w http.ResponseWriter, r *http.Request) { + target := a.apiBaseFor(r) + "/api/integrations/openweather/current" + 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) +} + // GET /bff/users → API Server /api/users (admin only, enforced upstream) func (a *App) handleListUsers(w http.ResponseWriter, r *http.Request) { req, _ := http.NewRequest(http.MethodGet, a.apiBaseFor(r)+"/api/users", nil) diff --git a/Web App/server/dist/assets/index-B-DwId4e.js b/Web App/server/dist/assets/index-B-DwId4e.js deleted file mode 100644 index 38dc6be..0000000 --- a/Web App/server/dist/assets/index-B-DwId4e.js +++ /dev/null @@ -1,20 +0,0 @@ -(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 f of u)if(f.type==="childList")for(const h of f.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&l(h)}).observe(document,{childList:!0,subtree:!0});function s(u){const f={};return u.integrity&&(f.integrity=u.integrity),u.referrerPolicy&&(f.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?f.credentials="include":u.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function l(u){if(u.ep)return;u.ep=!0;const f=s(u);fetch(u.href,f)}})();/** -* @vue/shared v3.5.39 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/function Xr(t){const i=Object.create(null);for(const s of t.split(","))i[s]=1;return s=>s in i}const yt={},qo=[],ni=()=>{},Ou=()=>!1,Ha=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),ja=t=>t.startsWith("onUpdate:"),Bt=Object.assign,Qr=(t,i)=>{const s=t.indexOf(i);s>-1&&t.splice(s,1)},pd=Object.prototype.hasOwnProperty,mt=(t,i)=>pd.call(t,i),Fe=Array.isArray,Yo=t=>Xs(t)==="[object Map]",is=t=>Xs(t)==="[object Set]",Ll=t=>Xs(t)==="[object Date]",Ye=t=>typeof t=="function",Ct=t=>typeof t=="string",Wn=t=>typeof t=="symbol",gt=t=>t!==null&&typeof t=="object",zu=t=>(gt(t)||Ye(t))&&Ye(t.then)&&Ye(t.catch),Iu=Object.prototype.toString,Xs=t=>Iu.call(t),md=t=>Xs(t).slice(8,-1),$u=t=>Xs(t)==="[object Object]",el=t=>Ct(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,Ds=Xr(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Wa=t=>{const i=Object.create(null);return(s=>i[s]||(i[s]=t(s)))},gd=/-\w/g,Hn=Wa(t=>t.replace(gd,i=>i.slice(1).toUpperCase())),vd=/\B([A-Z])/g,ji=Wa(t=>t.replace(vd,"-$1").toLowerCase()),Nu=Wa(t=>t.charAt(0).toUpperCase()+t.slice(1)),xr=Wa(t=>t?`on${Nu(t)}`:""),ti=(t,i)=>!Object.is(t,i),Aa=(t,...i)=>{for(let s=0;s{Object.defineProperty(t,i,{configurable:!0,enumerable:!1,writable:l,value:s})},Ka=t=>{const i=parseFloat(t);return isNaN(i)?t:i},_d=t=>{const i=Ct(t)?Number(t):NaN;return isNaN(i)?t:i};let Ml;const Ga=()=>Ml||(Ml=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function wo(t){if(Fe(t)){const i={};for(let s=0;s{if(s){const l=s.split(yd);l.length>1&&(i[l[0].trim()]=l[1].trim())}}),i}function Ae(t){let i="";if(Ct(t))i=t;else if(Fe(t))for(let s=0;sVi(s,i))}const Ru=t=>!!(t&&t.__v_isRef===!0),k=t=>Ct(t)?t:t==null?"":Fe(t)||gt(t)&&(t.toString===Iu||!Ye(t.toString))?Ru(t)?k(t.value):JSON.stringify(t,Bu,2):String(t),Bu=(t,i)=>Ru(i)?Bu(t,i.value):Yo(i)?{[`Map(${i.size})`]:[...i.entries()].reduce((s,[l,u],f)=>(s[wr(l,f)+" =>"]=u,s),{})}:is(i)?{[`Set(${i.size})`]:[...i.values()].map(s=>wr(s))}:Wn(i)?wr(i):gt(i)&&!Fe(i)&&!$u(i)?String(i):i,wr=(t,i="")=>{var s;return Wn(t)?`Symbol(${(s=t.description)!=null?s:i})`:t};/** -* @vue/reactivity v3.5.39 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/let Vt;class Pd{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&&Vt&&(Vt.active?(this.parent=Vt,this.index=(Vt.scopes||(Vt.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let i,s;if(this.scopes)for(i=0,s=this.scopes.length;i0&&--this._on===0){if(Vt===this)Vt=this.prevScope;else{let i=Vt;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 s,l;for(s=0,l=this.effects.length;s0)return;if(Rs){let i=Rs;for(Rs=void 0;i;){const s=i.next;i.next=void 0,i.flags&=-9,i=s}}let t;for(;Fs;){let i=Fs;for(Fs=void 0;i;){const s=i.next;if(i.next=void 0,i.flags&=-9,i.flags&1)try{i.trigger()}catch(l){t||(t=l)}i=s}}if(t)throw t}function Hu(t){for(let i=t.deps;i;i=i.nextDep)i.version=-1,i.prevActiveLink=i.dep.activeLink,i.dep.activeLink=i}function ju(t){let i,s=t.depsTail,l=s;for(;l;){const u=l.prevDep;l.version===-1?(l===s&&(s=u),ol(l),Ld(l)):i=l,l.dep.activeLink=l.prevActiveLink,l.prevActiveLink=void 0,l=u}t.deps=i,t.depsTail=s}function $r(t){for(let i=t.deps;i;i=i.nextDep)if(i.dep.version!==i.version||i.dep.computed&&(Wu(i.dep.computed)||i.dep.version!==i.version))return!0;return!!t._dirty}function Wu(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===Hs)||(t.globalVersion=Hs,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!$r(t))))return;t.flags|=2;const i=t.dep,s=kt,l=jn;kt=t,jn=!0;try{Hu(t);const u=t.fn(t._value);(i.version===0||ti(u,t._value))&&(t.flags|=128,t._value=u,i.version++)}catch(u){throw i.version++,u}finally{kt=s,jn=l,ju(t),t.flags&=-3}}function ol(t,i=!1){const{dep:s,prevSub:l,nextSub:u}=t;if(l&&(l.nextSub=u,t.prevSub=void 0),u&&(u.prevSub=l,t.nextSub=void 0),s.subs===t&&(s.subs=l,!l&&s.computed)){s.computed.flags&=-5;for(let f=s.computed.deps;f;f=f.nextDep)ol(f,!0)}!i&&!--s.sc&&s.map&&s.map.delete(s.key)}function Ld(t){const{prevDep:i,nextDep:s}=t;i&&(i.nextDep=s,t.prevDep=void 0),s&&(s.prevDep=i,t.nextDep=void 0)}let jn=!0;const Ku=[];function ii(){Ku.push(jn),jn=!1}function oi(){const t=Ku.pop();jn=t===void 0?!0:t}function Al(t){const{cleanup:i}=t;if(t.cleanup=void 0,i){const s=kt;kt=void 0;try{i()}finally{kt=s}}}let Hs=0;class Md{constructor(i,s){this.sub=i,this.dep=s,this.version=s.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class sl{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(!kt||!jn||kt===this.computed)return;let s=this.activeLink;if(s===void 0||s.sub!==kt)s=this.activeLink=new Md(kt,this),kt.deps?(s.prevDep=kt.depsTail,kt.depsTail.nextDep=s,kt.depsTail=s):kt.deps=kt.depsTail=s,Gu(s);else if(s.version===-1&&(s.version=this.version,s.nextDep)){const l=s.nextDep;l.prevDep=s.prevDep,s.prevDep&&(s.prevDep.nextDep=l),s.prevDep=kt.depsTail,s.nextDep=void 0,kt.depsTail.nextDep=s,kt.depsTail=s,kt.deps===s&&(kt.deps=l)}return s}trigger(i){this.version++,Hs++,this.notify(i)}notify(i){nl();try{for(let s=this.subs;s;s=s.prevSub)s.sub.notify()&&s.sub.dep.notify()}finally{il()}}}function Gu(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)Gu(l)}const s=t.dep.subs;s!==t&&(t.prevSub=s,s&&(s.nextSub=t)),t.dep.subs=t}}const Nr=new WeakMap,yo=Symbol(""),Dr=Symbol(""),js=Symbol("");function Gt(t,i,s){if(jn&&kt){let l=Nr.get(t);l||Nr.set(t,l=new Map);let u=l.get(s);u||(l.set(s,u=new sl),u.map=l,u.key=s),u.track()}}function bi(t,i,s,l,u,f){const h=Nr.get(t);if(!h){Hs++;return}const _=y=>{y&&y.trigger()};if(nl(),i==="clear")h.forEach(_);else{const y=Fe(t),C=y&&el(s);if(y&&s==="length"){const T=Number(l);h.forEach((A,R)=>{(R==="length"||R===js||!Wn(R)&&R>=T)&&_(A)})}else switch((s!==void 0||h.has(void 0))&&_(h.get(s)),C&&_(h.get(js)),i){case"add":y?C&&_(h.get("length")):(_(h.get(yo)),Yo(t)&&_(h.get(Dr)));break;case"delete":y||(_(h.get(yo)),Yo(t)&&_(h.get(Dr)));break;case"set":Yo(t)&&_(h.get(yo));break}}il()}function Ko(t){const i=ft(t);return i===t?i:(Gt(i,"iterate",js),$n(t)?i:i.map(Kn))}function qa(t){return Gt(t=ft(t),"iterate",js),t}function Qn(t,i){return wi(t)?ts(xo(t)?Kn(i):i):Kn(i)}const Ad={__proto__:null,[Symbol.iterator](){return Sr(this,Symbol.iterator,t=>Qn(this,t))},concat(...t){return Ko(this).concat(...t.map(i=>Fe(i)?Ko(i):i))},entries(){return Sr(this,"entries",t=>(t[1]=Qn(this,t[1]),t))},every(t,i){return mi(this,"every",t,i,void 0,arguments)},filter(t,i){return mi(this,"filter",t,i,s=>s.map(l=>Qn(this,l)),arguments)},find(t,i){return mi(this,"find",t,i,s=>Qn(this,s),arguments)},findIndex(t,i){return mi(this,"findIndex",t,i,void 0,arguments)},findLast(t,i){return mi(this,"findLast",t,i,s=>Qn(this,s),arguments)},findLastIndex(t,i){return mi(this,"findLastIndex",t,i,void 0,arguments)},forEach(t,i){return mi(this,"forEach",t,i,void 0,arguments)},includes(...t){return Tr(this,"includes",t)},indexOf(...t){return Tr(this,"indexOf",t)},join(t){return Ko(this).join(t)},lastIndexOf(...t){return Tr(this,"lastIndexOf",t)},map(t,i){return mi(this,"map",t,i,void 0,arguments)},pop(){return Ms(this,"pop")},push(...t){return Ms(this,"push",t)},reduce(t,...i){return El(this,"reduce",t,i)},reduceRight(t,...i){return El(this,"reduceRight",t,i)},shift(){return Ms(this,"shift")},some(t,i){return mi(this,"some",t,i,void 0,arguments)},splice(...t){return Ms(this,"splice",t)},toReversed(){return Ko(this).toReversed()},toSorted(t){return Ko(this).toSorted(t)},toSpliced(...t){return Ko(this).toSpliced(...t)},unshift(...t){return Ms(this,"unshift",t)},values(){return Sr(this,"values",t=>Qn(this,t))}};function Sr(t,i,s){const l=qa(t),u=l[i]();return l!==t&&!$n(t)&&(u._next=u.next,u.next=()=>{const f=u._next();return f.done||(f.value=s(f.value)),f}),u}const Ed=Array.prototype;function mi(t,i,s,l,u,f){const h=qa(t),_=h!==t&&!$n(t),y=h[i];if(y!==Ed[i]){const A=y.apply(t,f);return _?Kn(A):A}let C=s;h!==t&&(_?C=function(A,R){return s.call(this,Qn(t,A),R,t)}:s.length>2&&(C=function(A,R){return s.call(this,A,R,t)}));const T=y.call(h,C,l);return _&&u?u(T):T}function El(t,i,s,l){const u=qa(t),f=u!==t&&!$n(t);let h=s,_=!1;u!==t&&(f?(_=l.length===0,h=function(C,T,A){return _&&(_=!1,C=Qn(t,C)),s.call(this,C,Qn(t,T),A,t)}):s.length>3&&(h=function(C,T,A){return s.call(this,C,T,A,t)}));const y=u[i](h,...l);return _?Qn(t,y):y}function Tr(t,i,s){const l=ft(t);Gt(l,"iterate",js);const u=l[i](...s);return(u===-1||u===!1)&&ll(s[0])?(s[0]=ft(s[0]),l[i](...s)):u}function Ms(t,i,s=[]){ii(),nl();const l=ft(t)[i].apply(t,s);return il(),oi(),l}const Od=Xr("__proto__,__v_isRef,__isVue"),qu=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(Wn));function zd(t){Wn(t)||(t=String(t));const i=ft(this);return Gt(i,"has",t),i.hasOwnProperty(t)}class Yu{constructor(i=!1,s=!1){this._isReadonly=i,this._isShallow=s}get(i,s,l){if(s==="__v_skip")return i.__v_skip;const u=this._isReadonly,f=this._isShallow;if(s==="__v_isReactive")return!u;if(s==="__v_isReadonly")return u;if(s==="__v_isShallow")return f;if(s==="__v_raw")return l===(u?f?Zd:ec:f?Qu:Xu).get(i)||Object.getPrototypeOf(i)===Object.getPrototypeOf(l)?i:void 0;const h=Fe(i);if(!u){let y;if(h&&(y=Ad[s]))return y;if(s==="hasOwnProperty")return zd}const _=Reflect.get(i,s,Jt(i)?i:l);if((Wn(s)?qu.has(s):Od(s))||(u||Gt(i,"get",s),f))return _;if(Jt(_)){const y=h&&el(s)?_:_.value;return u&>(y)?Rr(y):y}return gt(_)?u?Rr(_):St(_):_}}class Ju extends Yu{constructor(i=!1){super(!1,i)}set(i,s,l,u){let f=i[s];const h=Fe(i)&&el(s);if(!this._isShallow){const C=wi(f);if(!$n(l)&&!wi(l)&&(f=ft(f),l=ft(l)),!h&&Jt(f)&&!Jt(l))return C||(f.value=l),!0}const _=h?Number(s)t,Sa=t=>Reflect.getPrototypeOf(t);function Fd(t,i,s){return function(...l){const u=this.__v_raw,f=ft(u),h=Yo(f),_=t==="entries"||t===Symbol.iterator&&h,y=t==="keys"&&h,C=u[t](...l),T=s?Fr:i?ts:Kn;return!i&&Gt(f,"iterate",y?Dr:yo),Bt(Object.create(C),{next(){const{value:A,done:R}=C.next();return R?{value:A,done:R}:{value:_?[T(A[0]),T(A[1])]:T(A),done:R}}})}}function Ta(t){return function(...i){return t==="delete"?!1:t==="clear"?void 0:this}}function Rd(t,i){const s={get(u){const f=this.__v_raw,h=ft(f),_=ft(u);t||(ti(u,_)&&Gt(h,"get",u),Gt(h,"get",_));const{has:y}=Sa(h),C=i?Fr:t?ts:Kn;if(y.call(h,u))return C(f.get(u));if(y.call(h,_))return C(f.get(_));f!==h&&f.get(u)},get size(){const u=this.__v_raw;return!t&&Gt(ft(u),"iterate",yo),u.size},has(u){const f=this.__v_raw,h=ft(f),_=ft(u);return t||(ti(u,_)&&Gt(h,"has",u),Gt(h,"has",_)),u===_?f.has(u):f.has(u)||f.has(_)},forEach(u,f){const h=this,_=h.__v_raw,y=ft(_),C=i?Fr:t?ts:Kn;return!t&&Gt(y,"iterate",yo),_.forEach((T,A)=>u.call(f,C(T),C(A),h))}};return Bt(s,t?{add:Ta("add"),set:Ta("set"),delete:Ta("delete"),clear:Ta("clear")}:{add(u){const f=ft(this),h=Sa(f),_=ft(u),y=!i&&!$n(u)&&!wi(u)?_:u;return h.has.call(f,y)||ti(u,y)&&h.has.call(f,u)||ti(_,y)&&h.has.call(f,_)||(f.add(y),bi(f,"add",y,y)),this},set(u,f){!i&&!$n(f)&&!wi(f)&&(f=ft(f));const h=ft(this),{has:_,get:y}=Sa(h);let C=_.call(h,u);C||(u=ft(u),C=_.call(h,u));const T=y.call(h,u);return h.set(u,f),C?ti(f,T)&&bi(h,"set",u,f):bi(h,"add",u,f),this},delete(u){const f=ft(this),{has:h,get:_}=Sa(f);let y=h.call(f,u);y||(u=ft(u),y=h.call(f,u)),_&&_.call(f,u);const C=f.delete(u);return y&&bi(f,"delete",u,void 0),C},clear(){const u=ft(this),f=u.size!==0,h=u.clear();return f&&bi(u,"clear",void 0,void 0),h}}),["keys","values","entries",Symbol.iterator].forEach(u=>{s[u]=Fd(u,t,i)}),s}function al(t,i){const s=Rd(t,i);return(l,u,f)=>u==="__v_isReactive"?!t:u==="__v_isReadonly"?t:u==="__v_raw"?l:Reflect.get(mt(s,u)&&u in l?s:l,u,f)}const Bd={get:al(!1,!1)},Ud={get:al(!1,!0)},Vd={get:al(!0,!1)};const Xu=new WeakMap,Qu=new WeakMap,ec=new WeakMap,Zd=new WeakMap;function Hd(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function St(t){return wi(t)?t:rl(t,!1,$d,Bd,Xu)}function jd(t){return rl(t,!1,Dd,Ud,Qu)}function Rr(t){return rl(t,!0,Nd,Vd,ec)}function rl(t,i,s,l,u){if(!gt(t)||t.__v_raw&&!(i&&t.__v_isReactive)||t.__v_skip||!Object.isExtensible(t))return t;const f=u.get(t);if(f)return f;const h=Hd(md(t));if(h===0)return t;const _=new Proxy(t,h===2?l:s);return u.set(t,_),_}function xo(t){return wi(t)?xo(t.__v_raw):!!(t&&t.__v_isReactive)}function wi(t){return!!(t&&t.__v_isReadonly)}function $n(t){return!!(t&&t.__v_isShallow)}function ll(t){return t?!!t.__v_raw:!1}function ft(t){const i=t&&t.__v_raw;return i?ft(i):t}function Wd(t){return!mt(t,"__v_skip")&&Object.isExtensible(t)&&Du(t,"__v_skip",!0),t}const Kn=t=>gt(t)?St(t):t,ts=t=>gt(t)?Rr(t):t;function Jt(t){return t?t.__v_isRef===!0:!1}function Z(t){return Kd(t,!1)}function Kd(t,i){return Jt(t)?t:new Gd(t,i)}class Gd{constructor(i,s){this.dep=new sl,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=s?i:ft(i),this._value=s?i:Kn(i),this.__v_isShallow=s}get value(){return this.dep.track(),this._value}set value(i){const s=this._rawValue,l=this.__v_isShallow||$n(i)||wi(i);i=l?i:ft(i),ti(i,s)&&(this._rawValue=i,this._value=l?i:Kn(i),this.dep.trigger())}}function Oe(t){return Jt(t)?t.value:t}const qd={get:(t,i,s)=>i==="__v_raw"?t:Oe(Reflect.get(t,i,s)),set:(t,i,s,l)=>{const u=t[i];return Jt(u)&&!Jt(s)?(u.value=s,!0):Reflect.set(t,i,s,l)}};function tc(t){return xo(t)?t:new Proxy(t,qd)}class Yd{constructor(i,s,l){this.fn=i,this.setter=s,this._value=void 0,this.dep=new sl(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Hs-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!s,this.isSSR=l}notify(){if(this.flags|=16,!(this.flags&8)&&kt!==this)return Zu(this,!0),!0}get value(){const i=this.dep.track();return Wu(this),i&&(i.version=this.dep.version),this._value}set value(i){this.setter&&this.setter(i)}}function Jd(t,i,s=!1){let l,u;return Ye(t)?l=t:(l=t.get,u=t.set),new Yd(l,u,s)}const Pa={},Oa=new WeakMap;let vo;function Xd(t,i=!1,s=vo){if(s){let l=Oa.get(s);l||Oa.set(s,l=[]),l.push(t)}}function Qd(t,i,s=yt){const{immediate:l,deep:u,once:f,scheduler:h,augmentJob:_,call:y}=s,C=fe=>u?fe:$n(fe)||u===!1||u===0?yi(fe,1):yi(fe);let T,A,R,B,j=!1,F=!1;if(Jt(t)?(A=()=>t.value,j=$n(t)):xo(t)?(A=()=>C(t),j=!0):Fe(t)?(F=!0,j=t.some(fe=>xo(fe)||$n(fe)),A=()=>t.map(fe=>{if(Jt(fe))return fe.value;if(xo(fe))return C(fe);if(Ye(fe))return y?y(fe,2):fe()})):Ye(t)?i?A=y?()=>y(t,2):t:A=()=>{if(R){ii();try{R()}finally{oi()}}const fe=vo;vo=T;try{return y?y(t,3,[B]):t(B)}finally{vo=fe}}:A=ni,i&&u){const fe=A,Ue=u===!0?1/0:u;A=()=>yi(fe(),Ue)}const pe=Cd(),me=()=>{T.stop(),pe&&pe.active&&Qr(pe.effects,T)};if(f&&i){const fe=i;i=(...Ue)=>{const Ne=fe(...Ue);return me(),Ne}}let Y=F?new Array(t.length).fill(Pa):Pa;const Le=fe=>{if(!(!(T.flags&1)||!T.dirty&&!fe))if(i){const Ue=T.run();if(fe||u||j||(F?Ue.some((Ne,Ie)=>ti(Ne,Y[Ie])):ti(Ue,Y))){R&&R();const Ne=vo;vo=T;try{const Ie=[Ue,Y===Pa?void 0:F&&Y[0]===Pa?[]:Y,B];Y=Ue,y?y(i,3,Ie):i(...Ie)}finally{vo=Ne}}}else T.run()};return _&&_(Le),T=new Uu(A),T.scheduler=h?()=>h(Le,!1):Le,B=fe=>Xd(fe,!1,T),R=T.onStop=()=>{const fe=Oa.get(T);if(fe){if(y)y(fe,4);else for(const Ue of fe)Ue();Oa.delete(T)}},i?l?Le(!0):Y=T.run():h?h(Le.bind(null,!0),!0):T.run(),me.pause=T.pause.bind(T),me.resume=T.resume.bind(T),me.stop=me,me}function yi(t,i=1/0,s){if(i<=0||!gt(t)||t.__v_skip||(s=s||new Map,(s.get(t)||0)>=i))return t;if(s.set(t,i),i--,Jt(t))yi(t.value,i,s);else if(Fe(t))for(let l=0;l{yi(l,i,s)});else if($u(t)){for(const l in t)yi(t[l],i,s);for(const l of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,l)&&yi(t[l],i,s)}return t}/** -* @vue/runtime-core v3.5.39 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/function Qs(t,i,s,l){try{return l?t(...l):t()}catch(u){Ya(u,i,s)}}function Dn(t,i,s,l){if(Ye(t)){const u=Qs(t,i,s,l);return u&&zu(u)&&u.catch(f=>{Ya(f,i,s)}),u}if(Fe(t)){const u=[];for(let f=0;f>>1,u=sn[l],f=Ws(u);f=Ws(s)?sn.push(t):sn.splice(tf(i),0,t),t.flags|=1,oc()}}function oc(){za||(za=nc.then(ac))}function nf(t){Fe(t)?Jo.push(...t):Ui&&t.id===-1?Ui.splice(Go+1,0,t):t.flags&1||(Jo.push(t),t.flags|=1),oc()}function Ol(t,i,s=Xn+1){for(;sWs(s)-Ws(l));if(Jo.length=0,Ui){Ui.push(...i);return}for(Ui=i,Go=0;Got.id==null?t.flags&2?-1:1/0:t.id;function ac(t){try{for(Xn=0;Xn{l._d&&Da(-1);const f=Ia(i);let h;try{h=t(...u)}finally{Ia(f),l._d&&Da(1)}return h};return l._n=!0,l._c=!0,l._d=!0,l}function ee(t,i){if(Yt===null)return t;const s=tr(Yt),l=t.dirs||(t.dirs=[]);for(let u=0;u1)return s&&Ye(i)?i.call(l&&l.proxy):i}}const of=Symbol.for("v-scx"),sf=()=>Bs(of);function Nt(t,i,s){return uc(t,i,s)}function uc(t,i,s=yt){const{immediate:l,deep:u,flush:f,once:h}=s,_=Bt({},s),y=i&&l||!i&&f!=="post";let C;if(Ys){if(f==="sync"){const B=sf();C=B.__watcherHandles||(B.__watcherHandles=[])}else if(!y){const B=()=>{};return B.stop=ni,B.resume=ni,B.pause=ni,B}}const T=an;_.call=(B,j,F)=>Dn(B,T,j,F);let A=!1;f==="post"?_.scheduler=B=>{on(B,T&&T.suspense)}:f!=="sync"&&(A=!0,_.scheduler=(B,j)=>{j?B():ul(B)}),_.augmentJob=B=>{i&&(B.flags|=4),A&&(B.flags|=2,T&&(B.id=T.uid,B.i=T))};const R=Qd(t,i,_);return Ys&&(C?C.push(R):y&&R()),R}function af(t,i,s){const l=this.proxy,u=Ct(t)?t.includes(".")?cc(l,t):()=>l[t]:t.bind(l,l);let f;Ye(i)?f=i:(f=i.handler,s=i);const h=ea(this),_=uc(u,f.bind(l),s);return h(),_}function cc(t,i){const s=i.split(".");return()=>{let l=t;for(let u=0;ut.__isTeleport,_o=t=>t&&(t.disabled||t.disabled===""),rf=t=>t&&(t.defer||t.defer===""),zl=t=>typeof SVGElement<"u"&&t instanceof SVGElement,Il=t=>typeof MathMLElement=="function"&&t instanceof MathMLElement,Br=(t,i)=>{const s=t&&t.to;return Ct(s)?i?i(s):null:s},lf={name:"Teleport",__isTeleport:!0,process(t,i,s,l,u,f,h,_,y,C){const{mc:T,pc:A,pbc:R,o:{insert:B,querySelector:j,createText:F,createComment:pe,parentNode:me}}=C,Y=_o(i.props);let{dynamicChildren:Le}=i;const fe=(Ie,Ge,we)=>{Ie.shapeFlag&16&&T(Ie.children,Ge,we,u,f,h,_,y)},Ue=(Ie=i)=>{const Ge=_o(Ie.props),we=Ie.target=Br(Ie.props,j),Te=Ur(we,Ie,F,B);we&&(h!=="svg"&&zl(we)?h="svg":h!=="mathml"&&Il(we)&&(h="mathml"),u&&u.isCE&&(u.ce._teleportTargets||(u.ce._teleportTargets=new Set)).add(we),Ge||(fe(Ie,we,Te),zs(Ie,!1)))},Ne=Ie=>{const Ge=()=>{if(Bi.get(Ie)===Ge){if(Bi.delete(Ie),_o(Ie.props)){const we=me(Ie.el)||s;fe(Ie,we,Ie.anchor),zs(Ie,!0)}Ue(Ie)}};Bi.set(Ie,Ge),on(Ge,f)};if(t==null){const Ie=i.el=F(""),Ge=i.anchor=F("");if(B(Ie,s,l),B(Ge,s,l),rf(i.props)||f&&f.pendingBranch){Ne(i);return}Y&&(fe(i,s,Ge),zs(i,!0)),Ue()}else{i.el=t.el;const Ie=i.anchor=t.anchor,Ge=Bi.get(t);if(Ge){Ge.flags|=8,Bi.delete(t),Ne(i);return}i.targetStart=t.targetStart;const we=i.target=t.target,Te=i.targetAnchor=t.targetAnchor,ze=_o(t.props),ie=ze?s:we,je=ze?Ie:Te;if(h==="svg"||zl(we)?h="svg":(h==="mathml"||Il(we))&&(h="mathml"),Le?(R(t.dynamicChildren,Le,ie,u,f,h,_),fl(t,i,!0)):y||A(t,i,ie,je,u,f,h,_,!1),Y)ze?i.props&&t.props&&i.props.to!==t.props.to&&(i.props.to=t.props.to):Ca(i,s,Ie,C,1);else if((i.props&&i.props.to)!==(t.props&&t.props.to)){const oe=Br(i.props,j);oe&&(i.target=oe,Ca(i,oe,null,C,0))}else ze&&Ca(i,we,Te,C,1);zs(i,Y)}},remove(t,i,s,{um:l,o:{remove:u}},f){const{shapeFlag:h,children:_,anchor:y,targetStart:C,targetAnchor:T,target:A,props:R}=t,B=_o(R),j=f||!B,F=Bi.get(t);if(F&&(F.flags|=8,Bi.delete(t)),A&&(u(C),u(T)),f&&u(y),!F&&(B||A)&&h&16)for(let pe=0;pe<_.length;pe++){const me=_[pe];l(me,i,s,j,!!me.dynamicChildren)}},move:Ca,hydrate:uf};function Ca(t,i,s,{o:{insert:l},m:u},f=2){f===0&&l(t.targetAnchor,i,s);const{el:h,anchor:_,shapeFlag:y,children:C,props:T}=t,A=f===2;if(A&&l(h,i,s),!Bi.has(t)&&(!A||_o(T))&&y&16)for(let R=0;R{t.isMounted=!0}),os(()=>{t.isUnmounting=!0}),t}const zn=[Function,Array],hc={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:zn,onEnter:zn,onAfterEnter:zn,onEnterCancelled:zn,onBeforeLeave:zn,onLeave:zn,onAfterLeave:zn,onLeaveCancelled:zn,onBeforeAppear:zn,onAppear:zn,onAfterAppear:zn,onAppearCancelled:zn},pc=t=>{const i=t.subTree;return i.component?pc(i.component):i},ff={name:"BaseTransition",props:hc,setup(t,{slots:i}){const s=Bc(),l=df();return()=>{const u=i.default&&vc(i.default(),!0),f=u&&u.length?mc(u):s.subTree?N():void 0;if(!f)return;const h=ft(t),{mode:_}=h;if(l.isLeaving)return Pr(f);const y=$l(f);if(!y)return Pr(f);let C=Vr(y,h,l,s,A=>C=A);y.type!==qt&&Ks(y,C);let T=s.subTree&&$l(s.subTree);if(T&&T.type!==qt&&!bo(T,y)&&pc(s).type!==qt){let A=Vr(T,h,l,s);if(Ks(T,A),_==="out-in"&&y.type!==qt)return l.isLeaving=!0,A.afterLeave=()=>{l.isLeaving=!1,s.job.flags&8||s.update(),delete A.afterLeave,T=void 0},Pr(f);_==="in-out"&&y.type!==qt?A.delayLeave=(R,B,j)=>{const F=gc(l,T);F[String(T.key)]=T,R[In]=()=>{B(),R[In]=void 0,delete C.delayedLeave,T=void 0},C.delayedLeave=()=>{j(),delete C.delayedLeave,T=void 0}}:T=void 0}else T&&(T=void 0);return f}}};function mc(t){let i=t[0];if(t.length>1){for(const s of t)if(s.type!==qt){i=s;break}}return i}const hf=ff;function gc(t,i){const{leavingVNodes:s}=t;let l=s.get(i.type);return l||(l=Object.create(null),s.set(i.type,l)),l}function Vr(t,i,s,l,u){const{appear:f,mode:h,persisted:_=!1,onBeforeEnter:y,onEnter:C,onAfterEnter:T,onEnterCancelled:A,onBeforeLeave:R,onLeave:B,onAfterLeave:j,onLeaveCancelled:F,onBeforeAppear:pe,onAppear:me,onAfterAppear:Y,onAppearCancelled:Le}=i,fe=String(t.key),Ue=gc(s,t),Ne=(we,Te)=>{we&&Dn(we,l,9,Te)},Ie=(we,Te)=>{const ze=Te[1];Ne(we,Te),Fe(we)?we.every(ie=>ie.length<=1)&&ze():we.length<=1&&ze()},Ge={mode:h,persisted:_,beforeEnter(we){let Te=y;if(!s.isMounted)if(f)Te=pe||y;else return;we[In]&&we[In](!0);const ze=Ue[fe];ze&&bo(t,ze)&&ze.el[In]&&ze.el[In](),Ne(Te,[we])},enter(we){if(Ue[fe]===t)return;let Te=C,ze=T,ie=A;if(!s.isMounted)if(f)Te=me||C,ze=Y||T,ie=Le||A;else return;let je=!1;we[As]=We=>{je||(je=!0,We?Ne(ie,[we]):Ne(ze,[we]),Ge.delayedLeave&&Ge.delayedLeave(),we[As]=void 0)};const oe=we[As].bind(null,!1);Te?Ie(Te,[we,oe]):oe()},leave(we,Te){const ze=String(t.key);if(we[As]&&we[As](!0),s.isUnmounting)return Te();Ne(R,[we]);let ie=!1;we[In]=oe=>{ie||(ie=!0,Te(),oe?Ne(F,[we]):Ne(j,[we]),we[In]=void 0,Ue[ze]===t&&delete Ue[ze])};const je=we[In].bind(null,!1);Ue[ze]=t,B?Ie(B,[we,je]):je()},clone(we){const Te=Vr(we,i,s,l,u);return u&&u(Te),Te}};return Ge}function Pr(t){if(Ja(t))return t=Zi(t),t.children=null,t}function $l(t){if(!Ja(t))return fc(t.type)&&t.children?mc(t.children):t;if(t.component)return t.component.subTree;const{shapeFlag:i,children:s}=t;if(s){if(i&16)return s[0];if(i&32&&Ye(s.default))return s.default()}}function Ks(t,i){t.shapeFlag&6&&t.component?(t.transition=i,Ks(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 vc(t,i=!1,s){let l=[],u=0;for(let f=0;f1)for(let f=0;fUs(F,i&&(Fe(i)?i[pe]:i),s,l,u));return}if(Xo(l)&&!u){l.shapeFlag&512&&l.type.__asyncResolved&&l.component.subTree.component&&Us(t,i,s,l.component.subTree);return}const f=l.shapeFlag&4?tr(l.component):l.el,h=u?null:f,{i:_,r:y}=t,C=i&&i.r,T=_.refs===yt?_.refs={}:_.refs,A=_.setupState,R=ft(A),B=A===yt?Ou:F=>Nl(T,F)?!1:mt(R,F),j=(F,pe)=>!(pe&&Nl(T,pe));if(C!=null&&C!==y){if(Dl(i),Ct(C))T[C]=null,B(C)&&(A[C]=null);else if(Jt(C)){const F=i;j(C,F.k)&&(C.value=null),F.k&&(T[F.k]=null)}}if(Ye(y)){ii();try{Qs(y,_,12,[h,T])}finally{oi()}}else{const F=Ct(y),pe=Jt(y);if(F||pe){const me=()=>{if(t.f){const Y=F?B(y)?A[y]:T[y]:j()||!t.k?y.value:T[t.k];if(u)Fe(Y)&&Qr(Y,f);else if(Fe(Y))Y.includes(f)||Y.push(f);else if(F)T[y]=[f],B(y)&&(A[y]=T[y]);else{const Le=[f];j(y,t.k)&&(y.value=Le),t.k&&(T[t.k]=Le)}}else F?(T[y]=h,B(y)&&(A[y]=h)):pe&&(j(y,t.k)&&(y.value=h),t.k&&(T[t.k]=h))};if(h){const Y=()=>{me(),$a.delete(t)};Y.id=-1,$a.set(t,Y),on(Y,s)}else Dl(t),me()}}}function Dl(t){const i=$a.get(t);i&&(i.flags|=8,$a.delete(t))}Ga().requestIdleCallback;Ga().cancelIdleCallback;const Xo=t=>!!t.type.__asyncLoader,Ja=t=>t.type.__isKeepAlive;function pf(t,i){bc(t,"a",i)}function mf(t,i){bc(t,"da",i)}function bc(t,i,s=an){const l=t.__wdc||(t.__wdc=()=>{let u=s;for(;u;){if(u.isDeactivated)return;u=u.parent}return t()});if(Xa(i,l,s),s){let u=s.parent;for(;u&&u.parent;)Ja(u.parent.vnode)&&gf(l,i,s,u),u=u.parent}}function gf(t,i,s,l){const u=Xa(i,t,l,!0);yc(()=>{Qr(l[i],u)},s)}function Xa(t,i,s=an,l=!1){if(s){const u=s[t]||(s[t]=[]),f=i.__weh||(i.__weh=(...h)=>{ii();const _=ea(s),y=Dn(i,s,t,h);return _(),oi(),y});return l?u.unshift(f):u.push(f),f}}const Si=t=>(i,s=an)=>{(!Ys||t==="sp")&&Xa(t,(...l)=>i(...l),s)},vf=Si("bm"),ki=Si("m"),_f=Si("bu"),bf=Si("u"),os=Si("bum"),yc=Si("um"),yf=Si("sp"),xf=Si("rtg"),wf=Si("rtc");function kf(t,i=an){Xa("ec",t,i)}const Sf=Symbol.for("v-ndc");function Re(t,i,s,l){let u;const f=s,h=Fe(t);if(h||Ct(t)){const _=h&&xo(t);let y=!1,C=!1;_&&(y=!$n(t),C=wi(t),t=qa(t)),u=new Array(t.length);for(let T=0,A=t.length;Ti(_,y,void 0,f));else{const _=Object.keys(t);u=new Array(_.length);for(let y=0,C=_.length;y0;return p(),ot(le,null,[M("slot",s,l)],C?-2:64)}let f=t[i];f&&f._c&&(f._d=!1),p();const h=f&&xc(f(s)),_=s.key||h&&h.key,y=ot(le,{key:(_&&!Wn(_)?_:`_${i}`)+(!h&&l?"_fb":"")},h||[],h&&t._===1?64:-2);return y.scopeId&&(y.slotScopeIds=[y.scopeId+"-s"]),f&&f._c&&(f._d=!0),y}function xc(t){return t.some(i=>qs(i)?!(i.type===qt||i.type===le&&!xc(i.children)):!0)?t:null}const Zr=t=>t?Uc(t)?tr(t):Zr(t.parent):null,Vs=Bt(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=>Zr(t.parent),$root:t=>Zr(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>kc(t),$forceUpdate:t=>t.f||(t.f=()=>{ul(t.update)}),$nextTick:t=>t.n||(t.n=ic.bind(t.proxy)),$watch:t=>af.bind(t)}),Cr=(t,i)=>t!==yt&&!t.__isScriptSetup&&mt(t,i),Pf={get({_:t},i){if(i==="__v_skip")return!0;const{ctx:s,setupState:l,data:u,props:f,accessCache:h,type:_,appContext:y}=t;if(i[0]!=="$"){const R=h[i];if(R!==void 0)switch(R){case 1:return l[i];case 2:return u[i];case 4:return s[i];case 3:return f[i]}else{if(Cr(l,i))return h[i]=1,l[i];if(u!==yt&&mt(u,i))return h[i]=2,u[i];if(mt(f,i))return h[i]=3,f[i];if(s!==yt&&mt(s,i))return h[i]=4,s[i];Hr&&(h[i]=0)}}const C=Vs[i];let T,A;if(C)return i==="$attrs"&&Gt(t.attrs,"get",""),C(t);if((T=_.__cssModules)&&(T=T[i]))return T;if(s!==yt&&mt(s,i))return h[i]=4,s[i];if(A=y.config.globalProperties,mt(A,i))return A[i]},set({_:t},i,s){const{data:l,setupState:u,ctx:f}=t;return Cr(u,i)?(u[i]=s,!0):l!==yt&&mt(l,i)?(l[i]=s,!0):mt(t.props,i)||i[0]==="$"&&i.slice(1)in t?!1:(f[i]=s,!0)},has({_:{data:t,setupState:i,accessCache:s,ctx:l,appContext:u,props:f,type:h}},_){let y;return!!(s[_]||t!==yt&&_[0]!=="$"&&mt(t,_)||Cr(i,_)||mt(f,_)||mt(l,_)||mt(Vs,_)||mt(u.config.globalProperties,_)||(y=h.__cssModules)&&y[_])},defineProperty(t,i,s){return s.get!=null?t._.accessCache[i]=0:mt(s,"value")&&this.set(t,i,s.value,null),Reflect.defineProperty(t,i,s)}};function Fl(t){return Fe(t)?t.reduce((i,s)=>(i[s]=null,i),{}):t}let Hr=!0;function Cf(t){const i=kc(t),s=t.proxy,l=t.ctx;Hr=!1,i.beforeCreate&&Rl(i.beforeCreate,t,"bc");const{data:u,computed:f,methods:h,watch:_,provide:y,inject:C,created:T,beforeMount:A,mounted:R,beforeUpdate:B,updated:j,activated:F,deactivated:pe,beforeDestroy:me,beforeUnmount:Y,destroyed:Le,unmounted:fe,render:Ue,renderTracked:Ne,renderTriggered:Ie,errorCaptured:Ge,serverPrefetch:we,expose:Te,inheritAttrs:ze,components:ie,directives:je,filters:oe}=i;if(C&&Lf(C,l,null),h)for(const ce in h){const ae=h[ce];Ye(ae)&&(l[ce]=ae.bind(s))}if(u){const ce=u.call(s,s);gt(ce)&&(t.data=St(ce))}if(Hr=!0,f)for(const ce in f){const ae=f[ce],st=Ye(ae)?ae.bind(s,s):Ye(ae.get)?ae.get.bind(s,s):ni,te=!Ye(ae)&&Ye(ae.set)?ae.set.bind(s):ni,ke=he({get:st,set:te});Object.defineProperty(l,ce,{enumerable:!0,configurable:!0,get:()=>ke.value,set:De=>ke.value=De})}if(_)for(const ce in _)wc(_[ce],l,s,ce);if(y){const ce=Ye(y)?y.call(s):y;Reflect.ownKeys(ce).forEach(ae=>{lc(ae,ce[ae])})}T&&Rl(T,t,"c");function ue(ce,ae){Fe(ae)?ae.forEach(st=>ce(st.bind(s))):ae&&ce(ae.bind(s))}if(ue(vf,A),ue(ki,R),ue(_f,B),ue(bf,j),ue(pf,F),ue(mf,pe),ue(kf,Ge),ue(wf,Ne),ue(xf,Ie),ue(os,Y),ue(yc,fe),ue(yf,we),Fe(Te))if(Te.length){const ce=t.exposed||(t.exposed={});Te.forEach(ae=>{Object.defineProperty(ce,ae,{get:()=>s[ae],set:st=>s[ae]=st,enumerable:!0})})}else t.exposed||(t.exposed={});Ue&&t.render===ni&&(t.render=Ue),ze!=null&&(t.inheritAttrs=ze),ie&&(t.components=ie),je&&(t.directives=je),we&&_c(t)}function Lf(t,i,s=ni){Fe(t)&&(t=jr(t));for(const l in t){const u=t[l];let f;gt(u)?"default"in u?f=Bs(u.from||l,u.default,!0):f=Bs(u.from||l):f=Bs(u),Jt(f)?Object.defineProperty(i,l,{enumerable:!0,configurable:!0,get:()=>f.value,set:h=>f.value=h}):i[l]=f}}function Rl(t,i,s){Dn(Fe(t)?t.map(l=>l.bind(i.proxy)):t.bind(i.proxy),i,s)}function wc(t,i,s,l){let u=l.includes(".")?cc(s,l):()=>s[l];if(Ct(t)){const f=i[t];Ye(f)&&Nt(u,f)}else if(Ye(t))Nt(u,t.bind(s));else if(gt(t))if(Fe(t))t.forEach(f=>wc(f,i,s,l));else{const f=Ye(t.handler)?t.handler.bind(s):i[t.handler];Ye(f)&&Nt(u,f,t)}}function kc(t){const i=t.type,{mixins:s,extends:l}=i,{mixins:u,optionsCache:f,config:{optionMergeStrategies:h}}=t.appContext,_=f.get(i);let y;return _?y=_:!u.length&&!s&&!l?y=i:(y={},u.length&&u.forEach(C=>Na(y,C,h,!0)),Na(y,i,h)),gt(i)&&f.set(i,y),y}function Na(t,i,s,l=!1){const{mixins:u,extends:f}=i;f&&Na(t,f,s,!0),u&&u.forEach(h=>Na(t,h,s,!0));for(const h in i)if(!(l&&h==="expose")){const _=Mf[h]||s&&s[h];t[h]=_?_(t[h],i[h]):i[h]}return t}const Mf={data:Bl,props:Ul,emits:Ul,methods:Is,computed:Is,beforeCreate:nn,created:nn,beforeMount:nn,mounted:nn,beforeUpdate:nn,updated:nn,beforeDestroy:nn,beforeUnmount:nn,destroyed:nn,unmounted:nn,activated:nn,deactivated:nn,errorCaptured:nn,serverPrefetch:nn,components:Is,directives:Is,watch:Ef,provide:Bl,inject:Af};function Bl(t,i){return i?t?function(){return Bt(Ye(t)?t.call(this,this):t,Ye(i)?i.call(this,this):i)}:i:t}function Af(t,i){return Is(jr(t),jr(i))}function jr(t){if(Fe(t)){const i={};for(let s=0;si==="modelValue"||i==="model-value"?t.modelModifiers:t[`${i}Modifiers`]||t[`${Hn(i)}Modifiers`]||t[`${ji(i)}Modifiers`];function $f(t,i,...s){if(t.isUnmounted)return;const l=t.vnode.props||yt;let u=s;const f=i.startsWith("update:"),h=f&&If(l,i.slice(7));h&&(h.trim&&(u=s.map(T=>Ct(T)?T.trim():T)),h.number&&(u=s.map(Ka)));let _,y=l[_=xr(i)]||l[_=xr(Hn(i))];!y&&f&&(y=l[_=xr(ji(i))]),y&&Dn(y,t,6,u);const C=l[_+"Once"];if(C){if(!t.emitted)t.emitted={};else if(t.emitted[_])return;t.emitted[_]=!0,Dn(C,t,6,u)}}const Nf=new WeakMap;function Tc(t,i,s=!1){const l=s?Nf:i.emitsCache,u=l.get(t);if(u!==void 0)return u;const f=t.emits;let h={},_=!1;if(!Ye(t)){const y=C=>{const T=Tc(C,i,!0);T&&(_=!0,Bt(h,T))};!s&&i.mixins.length&&i.mixins.forEach(y),t.extends&&y(t.extends),t.mixins&&t.mixins.forEach(y)}return!f&&!_?(gt(t)&&l.set(t,null),null):(Fe(f)?f.forEach(y=>h[y]=null):Bt(h,f),gt(t)&&l.set(t,h),h)}function Qa(t,i){return!t||!Ha(i)?!1:(i=i.slice(2),i=i==="Once"?i:i.replace(/Once$/,""),mt(t,i[0].toLowerCase()+i.slice(1))||mt(t,ji(i))||mt(t,i))}function Vl(t){const{type:i,vnode:s,proxy:l,withProxy:u,propsOptions:[f],slots:h,attrs:_,emit:y,render:C,renderCache:T,props:A,data:R,setupState:B,ctx:j,inheritAttrs:F}=t,pe=Ia(t);let me,Y;try{if(s.shapeFlag&4){const fe=u||l,Ue=fe;me=ei(C.call(Ue,fe,T,A,B,R,j)),Y=_}else{const fe=i;me=ei(fe.length>1?fe(A,{attrs:_,slots:h,emit:y}):fe(A,null)),Y=i.props?_:Df(_)}}catch(fe){Zs.length=0,Ya(fe,t,1),me=M(qt)}let Le=me;if(Y&&F!==!1){const fe=Object.keys(Y),{shapeFlag:Ue}=Le;fe.length&&Ue&7&&(f&&fe.some(ja)&&(Y=Ff(Y,f)),Le=Zi(Le,Y,!1,!0))}return s.dirs&&(Le=Zi(Le,null,!1,!0),Le.dirs=Le.dirs?Le.dirs.concat(s.dirs):s.dirs),s.transition&&Ks(Le,s.transition),me=Le,Ia(pe),me}const Df=t=>{let i;for(const s in t)(s==="class"||s==="style"||Ha(s))&&((i||(i={}))[s]=t[s]);return i},Ff=(t,i)=>{const s={};for(const l in t)(!ja(l)||!(l.slice(9)in i))&&(s[l]=t[l]);return s};function Rf(t,i,s){const{props:l,children:u,component:f}=t,{props:h,children:_,patchFlag:y}=i,C=f.emitsOptions;if(i.dirs||i.transition)return!0;if(s&&y>=0){if(y&1024)return!0;if(y&16)return l?Zl(l,h,C):!!h;if(y&8){const T=i.dynamicProps;for(let A=0;AObject.create(Cc),Mc=t=>Object.getPrototypeOf(t)===Cc;function Uf(t,i,s,l=!1){const u={},f=Lc();t.propsDefaults=Object.create(null),Ac(t,i,u,f);for(const h in t.propsOptions[0])h in u||(u[h]=void 0);s?t.props=l?u:jd(u):t.type.props?t.props=u:t.props=f,t.attrs=f}function Vf(t,i,s,l){const{props:u,attrs:f,vnode:{patchFlag:h}}=t,_=ft(u),[y]=t.propsOptions;let C=!1;if((l||h>0)&&!(h&16)){if(h&8){const T=t.vnode.dynamicProps;for(let A=0;A{y=!0;const[R,B]=Ec(A,i,!0);Bt(h,R),B&&_.push(...B)};!s&&i.mixins.length&&i.mixins.forEach(T),t.extends&&T(t.extends),t.mixins&&t.mixins.forEach(T)}if(!f&&!y)return gt(t)&&l.set(t,qo),qo;if(Fe(f))for(let T=0;Tt==="_"||t==="_ctx"||t==="$stable",dl=t=>Fe(t)?t.map(ei):[ei(t)],Hf=(t,i,s)=>{if(i._n)return i;const l=xe((...u)=>dl(i(...u)),s);return l._c=!1,l},Oc=(t,i,s)=>{const l=t._ctx;for(const u in t){if(cl(u))continue;const f=t[u];if(Ye(f))i[u]=Hf(u,f,l);else if(f!=null){const h=dl(f);i[u]=()=>h}}},zc=(t,i)=>{const s=dl(i);t.slots.default=()=>s},Ic=(t,i,s)=>{for(const l in i)(s||!cl(l))&&(t[l]=i[l])},jf=(t,i,s)=>{const l=t.slots=Lc();if(t.vnode.shapeFlag&32){const u=i._;u?(Ic(l,i,s),s&&Du(l,"_",u,!0)):Oc(i,l)}else i&&zc(t,i)},Wf=(t,i,s)=>{const{vnode:l,slots:u}=t;let f=!0,h=yt;if(l.shapeFlag&32){const _=i._;_?s&&_===1?f=!1:Ic(u,i,s):(f=!i.$stable,Oc(i,u)),h=i}else i&&(zc(t,i),h={default:1});if(f)for(const _ in u)!cl(_)&&h[_]==null&&delete u[_]},on=Jf;function Kf(t){return Gf(t)}function Gf(t,i){const s=Ga();s.__VUE__=!0;const{insert:l,remove:u,patchProp:f,createElement:h,createText:_,createComment:y,setText:C,setElementText:T,parentNode:A,nextSibling:R,setScopeId:B=ni,insertStaticContent:j}=t,F=(x,b,S,G=null,K=null,H=null,re=void 0,ne=null,Q=!!b.dynamicChildren)=>{if(x===b)return;x&&!bo(x,b)&&(G=E(x),De(x,K,H,!0),x=null),b.patchFlag===-2&&(Q=!1,b.dynamicChildren=null);const{type:q,ref:ge,shapeFlag:se}=b;switch(q){case er:pe(x,b,S,G);break;case qt:me(x,b,S,G);break;case Mr:x==null&&Y(b,S,G,re);break;case le:ie(x,b,S,G,K,H,re,ne,Q);break;default:se&1?Ue(x,b,S,G,K,H,re,ne,Q):se&6?je(x,b,S,G,K,H,re,ne,Q):(se&64||se&128)&&q.process(x,b,S,G,K,H,re,ne,Q,ut)}ge!=null&&K?Us(ge,x&&x.ref,H,b||x,!b):ge==null&&x&&x.ref!=null&&Us(x.ref,null,H,x,!0)},pe=(x,b,S,G)=>{if(x==null)l(b.el=_(b.children),S,G);else{const K=b.el=x.el;b.children!==x.children&&C(K,b.children)}},me=(x,b,S,G)=>{x==null?l(b.el=y(b.children||""),S,G):b.el=x.el},Y=(x,b,S,G)=>{[x.el,x.anchor]=j(x.children,b,S,G,x.el,x.anchor)},Le=({el:x,anchor:b},S,G)=>{let K;for(;x&&x!==b;)K=R(x),l(x,S,G),x=K;l(b,S,G)},fe=({el:x,anchor:b})=>{let S;for(;x&&x!==b;)S=R(x),u(x),x=S;u(b)},Ue=(x,b,S,G,K,H,re,ne,Q)=>{if(b.type==="svg"?re="svg":b.type==="math"&&(re="mathml"),x==null)Ne(b,S,G,K,H,re,ne,Q);else{const q=x.el&&x.el._isVueCE?x.el:null;try{q&&q._beginPatch(),we(x,b,K,H,re,ne,Q)}finally{q&&q._endPatch()}}},Ne=(x,b,S,G,K,H,re,ne)=>{let Q,q;const{props:ge,shapeFlag:se,transition:Ce,dirs:Me}=x;if(Q=x.el=h(x.type,H,ge&&ge.is,ge),se&8?T(Q,x.children):se&16&&Ge(x.children,Q,null,G,K,Lr(x,H),re,ne),Me&&ho(x,null,G,"created"),Ie(Q,x,x.scopeId,re,G),ge){for(const it in ge)it!=="value"&&!Ds(it)&&f(Q,it,null,ge[it],H,G);"value"in ge&&f(Q,"value",null,ge.value,H),(q=ge.onVnodeBeforeMount)&&Jn(q,G,x)}Me&&ho(x,null,G,"beforeMount");const Ze=qf(K,Ce);Ze&&Ce.beforeEnter(Q),l(Q,b,S),((q=ge&&ge.onVnodeMounted)||Ze||Me)&&on(()=>{try{q&&Jn(q,G,x),Ze&&Ce.enter(Q),Me&&ho(x,null,G,"mounted")}finally{}},K)},Ie=(x,b,S,G,K)=>{if(S&&B(x,S),G)for(let H=0;H{for(let q=Q;q{const ne=b.el=x.el;let{patchFlag:Q,dynamicChildren:q,dirs:ge}=b;Q|=x.patchFlag&16;const se=x.props||yt,Ce=b.props||yt;let Me;if(S&&po(S,!1),(Me=Ce.onVnodeBeforeUpdate)&&Jn(Me,S,b,x),ge&&ho(b,x,S,"beforeUpdate"),S&&po(S,!0),q&&(!x.dynamicChildren||x.dynamicChildren.length!==q.length)&&(Q=0,re=!1,q=null),(se.innerHTML&&Ce.innerHTML==null||se.textContent&&Ce.textContent==null)&&T(ne,""),q?Te(x.dynamicChildren,q,ne,S,G,Lr(b,K),H):re||ae(x,b,ne,null,S,G,Lr(b,K),H,!1),Q>0){if(Q&16)ze(ne,se,Ce,S,K);else if(Q&2&&se.class!==Ce.class&&f(ne,"class",null,Ce.class,K),Q&4&&f(ne,"style",se.style,Ce.style,K),Q&8){const Ze=b.dynamicProps;for(let it=0;it{Me&&Jn(Me,S,b,x),ge&&ho(b,x,S,"updated")},G)},Te=(x,b,S,G,K,H,re)=>{for(let ne=0;ne{if(b!==S){if(b!==yt)for(const H in b)!Ds(H)&&!(H in S)&&f(x,H,b[H],null,K,G);for(const H in S){if(Ds(H))continue;const re=S[H],ne=b[H];re!==ne&&H!=="value"&&f(x,H,ne,re,K,G)}"value"in S&&f(x,"value",b.value,S.value,K)}},ie=(x,b,S,G,K,H,re,ne,Q)=>{const q=b.el=x?x.el:_(""),ge=b.anchor=x?x.anchor:_("");let{patchFlag:se,dynamicChildren:Ce,slotScopeIds:Me}=b;Me&&(ne=ne?ne.concat(Me):Me),x==null?(l(q,S,G),l(ge,S,G),Ge(b.children||[],S,ge,K,H,re,ne,Q)):se>0&&se&64&&Ce&&x.dynamicChildren&&x.dynamicChildren.length===Ce.length?(Te(x.dynamicChildren,Ce,S,K,H,re,ne),(b.key!=null||K&&b===K.subTree)&&fl(x,b,!0)):ae(x,b,S,ge,K,H,re,ne,Q)},je=(x,b,S,G,K,H,re,ne,Q)=>{b.slotScopeIds=ne,x==null?b.shapeFlag&512?K.ctx.activate(b,S,G,re,Q):oe(b,S,G,K,H,re,Q):We(x,b,Q)},oe=(x,b,S,G,K,H,re)=>{const ne=x.component=oh(x,G,K);if(Ja(x)&&(ne.ctx.renderer=ut),sh(ne,!1,re),ne.asyncDep){if(K&&K.registerDep(ne,ue,re),!x.el){const Q=ne.subTree=M(qt);me(null,Q,b,S),x.placeholder=Q.el}}else ue(ne,x,b,S,K,H,re)},We=(x,b,S)=>{const G=b.component=x.component;if(Rf(x,b,S))if(G.asyncDep&&!G.asyncResolved){ce(G,b,S);return}else G.next=b,G.update();else b.el=x.el,G.vnode=b},ue=(x,b,S,G,K,H,re)=>{const ne=()=>{if(x.isMounted){let{next:se,bu:Ce,u:Me,parent:Ze,vnode:it}=x;{const vt=$c(x);if(vt){se&&(se.el=it.el,ce(x,se,re)),vt.asyncDep.then(()=>{on(()=>{x.isUnmounted||q()},K)});return}}let U=se,O;po(x,!1),se?(se.el=it.el,ce(x,se,re)):se=it,Ce&&Aa(Ce),(O=se.props&&se.props.onVnodeBeforeUpdate)&&Jn(O,Ze,se,it),po(x,!0);const Pe=Vl(x),qe=x.subTree;x.subTree=Pe,F(qe,Pe,A(qe.el),E(qe),x,K,H),se.el=Pe.el,U===null&&Bf(x,Pe.el),Me&&on(Me,K),(O=se.props&&se.props.onVnodeUpdated)&&on(()=>Jn(O,Ze,se,it),K)}else{let se;const{el:Ce,props:Me}=b,{bm:Ze,m:it,parent:U,root:O,type:Pe}=x,qe=Xo(b);po(x,!1),Ze&&Aa(Ze),!qe&&(se=Me&&Me.onVnodeBeforeMount)&&Jn(se,U,b),po(x,!0);{O.ce&&O.ce._hasShadowRoot()&&O.ce._injectChildStyle(Pe,x.parent?x.parent.type:void 0);const vt=x.subTree=Vl(x);F(null,vt,S,G,x,K,H),b.el=vt.el}if(it&&on(it,K),!qe&&(se=Me&&Me.onVnodeMounted)){const vt=b;on(()=>Jn(se,U,vt),K)}(b.shapeFlag&256||U&&Xo(U.vnode)&&U.vnode.shapeFlag&256)&&x.a&&on(x.a,K),x.isMounted=!0,b=S=G=null}};x.scope.on();const Q=x.effect=new Uu(ne);x.scope.off();const q=x.update=Q.run.bind(Q),ge=x.job=Q.runIfDirty.bind(Q);ge.i=x,ge.id=x.uid,Q.scheduler=()=>ul(ge),po(x,!0),q()},ce=(x,b,S)=>{b.component=x;const G=x.vnode.props;x.vnode=b,x.next=null,Vf(x,b.props,G,S),Wf(x,b.children,S),ii(),Ol(x),oi()},ae=(x,b,S,G,K,H,re,ne,Q=!1)=>{const q=x&&x.children,ge=x?x.shapeFlag:0,se=b.children,{patchFlag:Ce,shapeFlag:Me}=b;if(Ce>0){if(Ce&128){te(q,se,S,G,K,H,re,ne,Q);return}else if(Ce&256){st(q,se,S,G,K,H,re,ne,Q);return}}Me&8?(ge&16&&J(q,K,H),se!==q&&T(S,se)):ge&16?Me&16?te(q,se,S,G,K,H,re,ne,Q):J(q,K,H,!0):(ge&8&&T(S,""),Me&16&&Ge(se,S,G,K,H,re,ne,Q))},st=(x,b,S,G,K,H,re,ne,Q)=>{x=x||qo,b=b||qo;const q=x.length,ge=b.length,se=Math.min(q,ge);let Ce;for(Ce=0;Cege?J(x,K,H,!0,!1,se):Ge(b,S,G,K,H,re,ne,Q,se)},te=(x,b,S,G,K,H,re,ne,Q)=>{let q=0;const ge=b.length;let se=x.length-1,Ce=ge-1;for(;q<=se&&q<=Ce;){const Me=x[q],Ze=b[q]=Q?_i(b[q]):ei(b[q]);if(bo(Me,Ze))F(Me,Ze,S,null,K,H,re,ne,Q);else break;q++}for(;q<=se&&q<=Ce;){const Me=x[se],Ze=b[Ce]=Q?_i(b[Ce]):ei(b[Ce]);if(bo(Me,Ze))F(Me,Ze,S,null,K,H,re,ne,Q);else break;se--,Ce--}if(q>se){if(q<=Ce){const Me=Ce+1,Ze=MeCe)for(;q<=se;)De(x[q],K,H,!0),q++;else{const Me=q,Ze=q,it=new Map;for(q=Ze;q<=Ce;q++){const de=b[q]=Q?_i(b[q]):ei(b[q]);de.key!=null&&it.set(de.key,q)}let U,O=0;const Pe=Ce-Ze+1;let qe=!1,vt=0;const xt=new Array(Pe);for(q=0;q=Pe){De(de,K,H,!0);continue}let Tt;if(de.key!=null)Tt=it.get(de.key);else for(U=Ze;U<=Ce;U++)if(xt[U-Ze]===0&&bo(de,b[U])){Tt=U;break}Tt===void 0?De(de,K,H,!0):(xt[Tt-Ze]=q+1,Tt>=vt?vt=Tt:qe=!0,F(de,b[Tt],S,null,K,H,re,ne,Q),O++)}const rn=qe?Yf(xt):qo;for(U=rn.length-1,q=Pe-1;q>=0;q--){const de=Ze+q,Tt=b[de],gn=b[de+1],So=de+1{const{el:H,type:re,transition:ne,children:Q,shapeFlag:q}=x;if(q&6){ke(x.component.subTree,b,S,G);return}if(q&128){x.suspense.move(b,S,G);return}if(q&64){re.move(x,b,S,ut);return}if(re===le){l(H,b,S);for(let se=0;sene.enter(H),K));else{const{leave:se,delayLeave:Ce,afterLeave:Me}=ne,Ze=()=>{x.ctx.isUnmounted?u(H):l(H,b,S)},it=()=>{const U=H._isLeaving||!!H[In];H._isLeaving&&H[In](!0),ne.persisted&&!U?Ze():se(H,()=>{Ze(),Me&&Me()})};Ce?Ce(H,Ze,it):it()}else l(H,b,S)},De=(x,b,S,G=!1,K=!1)=>{const{type:H,props:re,ref:ne,children:Q,dynamicChildren:q,shapeFlag:ge,patchFlag:se,dirs:Ce,cacheIndex:Me,memo:Ze}=x;if(se===-2&&(K=!1),ne!=null&&(ii(),Us(ne,null,S,x,!0),oi()),Me!=null&&(b.renderCache[Me]=void 0),ge&256){b.ctx.deactivate(x);return}const it=ge&1&&Ce,U=!Xo(x);let O;if(U&&(O=re&&re.onVnodeBeforeUnmount)&&Jn(O,b,x),ge&6)Ve(x.component,S,G);else{if(ge&128){x.suspense.unmount(S,G);return}it&&ho(x,null,b,"beforeUnmount"),ge&64?x.type.remove(x,b,S,ut,G):q&&!q.hasOnce&&(H!==le||se>0&&se&64)?J(q,b,S,!1,!0):(H===le&&se&384||!K&&ge&16)&&J(Q,b,S),G&&ht(x)}const Pe=Ze!=null&&Me==null;(U&&(O=re&&re.onVnodeUnmounted)||it||Pe)&&on(()=>{O&&Jn(O,b,x),it&&ho(x,null,b,"unmounted"),Pe&&(x.el=null)},S)},ht=x=>{const{type:b,el:S,anchor:G,transition:K}=x;if(b===le){lt(S,G);return}if(b===Mr){fe(x);return}const H=()=>{u(S),K&&!K.persisted&&K.afterLeave&&K.afterLeave()};if(x.shapeFlag&1&&K&&!K.persisted){const{leave:re,delayLeave:ne}=K,Q=()=>re(S,H);ne?ne(x.el,H,Q):Q()}else H()},lt=(x,b)=>{let S;for(;x!==b;)S=R(x),u(x),x=S;u(b)},Ve=(x,b,S)=>{const{bum:G,scope:K,job:H,subTree:re,um:ne,m:Q,a:q}=x;jl(Q),jl(q),G&&Aa(G),K.stop(),H&&(H.flags|=8,De(re,x,b,S)),ne&&on(ne,b),on(()=>{x.isUnmounted=!0},b)},J=(x,b,S,G=!1,K=!1,H=0)=>{for(let re=H;re{if(x.shapeFlag&6)return E(x.component.subTree);if(x.shapeFlag&128)return x.suspense.next();const b=R(x.anchor||x.el),S=b&&b[dc];return S?R(S):b};let I=!1;const _t=(x,b,S)=>{let G;x==null?b._vnode&&(De(b._vnode,null,null,!0),G=b._vnode.component):F(b._vnode||null,x,b,null,null,null,S),b._vnode=x,I||(I=!0,Ol(G),sc(),I=!1)},ut={p:F,um:De,m:ke,r:ht,mt:oe,mc:Ge,pc:ae,pbc:Te,n:E,o:t};return{render:_t,hydrate:void 0,createApp:zf(_t)}}function Lr({type:t,props:i},s){return s==="svg"&&t==="foreignObject"||s==="mathml"&&t==="annotation-xml"&&i&&i.encoding&&i.encoding.includes("html")?void 0:s}function po({effect:t,job:i},s){s?(t.flags|=32,i.flags|=4):(t.flags&=-33,i.flags&=-5)}function qf(t,i){return(!t||t&&!t.pendingBranch)&&i&&!i.persisted}function fl(t,i,s=!1){const l=t.children,u=i.children;if(Fe(l)&&Fe(u))for(let f=0;f>1,t[s[_]]0&&(i[l]=s[f-1]),s[f]=l)}}for(f=s.length,h=s[f-1];f-- >0;)s[f]=h,h=i[h];return s}function $c(t){const i=t.subTree.component;if(i)return i.asyncDep&&!i.asyncResolved?i:$c(i)}function jl(t){if(t)for(let i=0;it.__isSuspense;function Jf(t,i){i&&i.pendingBranch?Fe(t)?i.effects.push(...t):i.effects.push(t):nf(t)}const le=Symbol.for("v-fgt"),er=Symbol.for("v-txt"),qt=Symbol.for("v-cmt"),Mr=Symbol.for("v-stc"),Zs=[];let Tn=null;function p(t=!1){Zs.push(Tn=t?null:[])}function Xf(){Zs.pop(),Tn=Zs[Zs.length-1]||null}let Gs=1;function Da(t,i=!1){Gs+=t,t<0&&Tn&&i&&(Tn.hasOnce=!0)}function Fc(t){return t.dynamicChildren=Gs>0?Tn||qo:null,Xf(),Gs>0&&Tn&&Tn.push(t),t}function m(t,i,s,l,u,f){return Fc(a(t,i,s,l,u,f,!0))}function ot(t,i,s,l,u){return Fc(M(t,i,s,l,u,!0))}function qs(t){return t?t.__v_isVNode===!0:!1}function bo(t,i){return t.type===i.type&&t.key===i.key}const Rc=({key:t})=>t??null,Ea=({ref:t,ref_key:i,ref_for:s})=>(typeof t=="number"&&(t=""+t),t!=null?Ct(t)||Jt(t)||Ye(t)?{i:Yt,r:t,k:i,f:!!s}:t:null);function a(t,i=null,s=null,l=0,u=null,f=t===le?0:1,h=!1,_=!1){const y={__v_isVNode:!0,__v_skip:!0,type:t,props:i,key:i&&Rc(i),ref:i&&Ea(i),scopeId:rc,slotScopeIds:null,children:s,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:f,patchFlag:l,dynamicProps:u,dynamicChildren:null,appContext:null,ctx:Yt};return _?(Fa(y,s),f&128&&t.normalize(y)):s&&(y.shapeFlag|=Ct(s)?8:16),Gs>0&&!h&&Tn&&(y.patchFlag>0||f&6)&&y.patchFlag!==32&&Tn.push(y),y}const M=Qf;function Qf(t,i=null,s=null,l=0,u=null,f=!1){if((!t||t===Sf)&&(t=qt),qs(t)){const _=Zi(t,i,!0);return s&&Fa(_,s),Gs>0&&!f&&Tn&&(_.shapeFlag&6?Tn[Tn.indexOf(t)]=_:Tn.push(_)),_.patchFlag=-2,_}if(uh(t)&&(t=t.__vccOpts),i){i=eh(i);let{class:_,style:y}=i;_&&!Ct(_)&&(i.class=Ae(_)),gt(y)&&(ll(y)&&!Fe(y)&&(y=Bt({},y)),i.style=wo(y))}const h=Ct(t)?1:Dc(t)?128:fc(t)?64:gt(t)?4:Ye(t)?2:0;return a(t,i,s,l,u,h,f,!0)}function eh(t){return t?ll(t)||Mc(t)?Bt({},t):t:null}function Zi(t,i,s=!1,l=!1){const{props:u,ref:f,patchFlag:h,children:_,transition:y}=t,C=i?th(u||{},i):u,T={__v_isVNode:!0,__v_skip:!0,type:t.type,props:C,key:C&&Rc(C),ref:i&&i.ref?s&&f?Fe(f)?f.concat(Ea(i)):[f,Ea(i)]:Ea(i):f,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&&Zi(t.ssContent),ssFallback:t.ssFallback&&Zi(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return y&&l&&Ks(T,y.clone(T)),T}function z(t=" ",i=0){return M(er,null,t,i)}function N(t="",i=!1){return i?(p(),ot(qt,null,t)):M(qt,null,t)}function ei(t){return t==null||typeof t=="boolean"?M(qt):Fe(t)?M(le,null,t.slice()):qs(t)?_i(t):M(er,null,String(t))}function _i(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:Zi(t)}function Fa(t,i){let s=0;const{shapeFlag:l}=t;if(i==null)i=null;else if(Fe(i))s=16;else if(typeof i=="object")if(l&65){const u=i.default;u&&(u._c&&(u._d=!1),Fa(t,u()),u._c&&(u._d=!0));return}else{s=32;const u=i._;!u&&!Mc(i)?i._ctx=Yt:u===3&&Yt&&(Yt.slots._===1?i._=1:(i._=2,t.patchFlag|=1024))}else if(Ye(i)){if(l&65){Fa(t,{default:i});return}i={default:i,_ctx:Yt},s=32}else i=String(i),l&64?(s=16,i=[z(i)]):s=8;t.children=i,t.shapeFlag|=s}function th(...t){const i={};for(let s=0;san||Yt;let Ra,Kr;{const t=Ga(),i=(s,l)=>{let u;return(u=t[s])||(u=t[s]=[]),u.push(l),f=>{u.length>1?u.forEach(h=>h(f)):u[0](f)}};Ra=i("__VUE_INSTANCE_SETTERS__",s=>an=s),Kr=i("__VUE_SSR_SETTERS__",s=>Ys=s)}const ea=t=>{const i=an;return Ra(t),t.scope.on(),()=>{t.scope.off(),Ra(i)}},Wl=()=>{an&&an.scope.off(),Ra(null)};function Uc(t){return t.vnode.shapeFlag&4}let Ys=!1;function sh(t,i=!1,s=!1){i&&Kr(i);const{props:l,children:u}=t.vnode,f=Uc(t);Uf(t,l,f,i),jf(t,u,s||i);const h=f?ah(t,i):void 0;return i&&Kr(!1),h}function ah(t,i){const s=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,Pf);const{setup:l}=s;if(l){ii();const u=t.setupContext=l.length>1?lh(t):null,f=ea(t),h=Qs(l,t,0,[t.props,u]),_=zu(h);if(oi(),f(),(_||t.sp)&&!Xo(t)&&_c(t),_){if(h.then(Wl,Wl),i)return h.then(y=>{Kl(t,y)}).catch(y=>{Ya(y,t,0)});t.asyncDep=h}else Kl(t,h)}else Vc(t)}function Kl(t,i,s){Ye(i)?t.type.__ssrInlineRender?t.ssrRender=i:t.render=i:gt(i)&&(t.setupState=tc(i)),Vc(t)}function Vc(t,i,s){const l=t.type;t.render||(t.render=l.render||ni);{const u=ea(t);ii();try{Cf(t)}finally{oi(),u()}}}const rh={get(t,i){return Gt(t,"get",""),t[i]}};function lh(t){const i=s=>{t.exposed=s||{}};return{attrs:new Proxy(t.attrs,rh),slots:t.slots,emit:t.emit,expose:i}}function tr(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(tc(Wd(t.exposed)),{get(i,s){if(s in i)return i[s];if(s in Vs)return Vs[s](t)},has(i,s){return s in i||s in Vs}})):t.proxy}function uh(t){return Ye(t)&&"__vccOpts"in t}const he=(t,i)=>Jd(t,i,Ys);function ch(t,i,s){try{Da(-1);const l=arguments.length;return l===2?gt(i)&&!Fe(i)?qs(i)?M(t,null,[i]):M(t,i):M(t,null,i):(l>3?s=Array.prototype.slice.call(arguments,2):l===3&&qs(s)&&(s=[s]),M(t,i,s))}finally{Da(1)}}const dh="3.5.39";/** -* @vue/runtime-dom v3.5.39 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/let Gr;const Gl=typeof window<"u"&&window.trustedTypes;if(Gl)try{Gr=Gl.createPolicy("vue",{createHTML:t=>t})}catch{}const Zc=Gr?t=>Gr.createHTML(t):t=>t,fh="http://www.w3.org/2000/svg",hh="http://www.w3.org/1998/Math/MathML",vi=typeof document<"u"?document:null,ql=vi&&vi.createElement("template"),ph={insert:(t,i,s)=>{i.insertBefore(t,s||null)},remove:t=>{const i=t.parentNode;i&&i.removeChild(t)},createElement:(t,i,s,l)=>{const u=i==="svg"?vi.createElementNS(fh,t):i==="mathml"?vi.createElementNS(hh,t):s?vi.createElement(t,{is:s}):vi.createElement(t);return t==="select"&&l&&l.multiple!=null&&u.setAttribute("multiple",l.multiple),u},createText:t=>vi.createTextNode(t),createComment:t=>vi.createComment(t),setText:(t,i)=>{t.nodeValue=i},setElementText:(t,i)=>{t.textContent=i},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>vi.querySelector(t),setScopeId(t,i){t.setAttribute(i,"")},insertStaticContent(t,i,s,l,u,f){const h=s?s.previousSibling:i.lastChild;if(u&&(u===f||u.nextSibling))for(;i.insertBefore(u.cloneNode(!0),s),!(u===f||!(u=u.nextSibling)););else{ql.innerHTML=Zc(l==="svg"?`${t}`:l==="mathml"?`${t}`:t);const _=ql.content;if(l==="svg"||l==="mathml"){const y=_.firstChild;for(;y.firstChild;)_.appendChild(y.firstChild);_.removeChild(y)}i.insertBefore(_,s)}return[h?h.nextSibling:i.firstChild,s?s.previousSibling:i.lastChild]}},Fi="transition",Es="animation",Js=Symbol("_vtc"),Hc={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},mh=Bt({},hc,Hc),gh=t=>(t.displayName="Transition",t.props=mh,t),vh=gh((t,{slots:i})=>ch(hf,_h(t),i)),mo=(t,i=[])=>{Fe(t)?t.forEach(s=>s(...i)):t&&t(...i)},Yl=t=>t?Fe(t)?t.some(i=>i.length>1):t.length>1:!1;function _h(t){const i={};for(const ie in t)ie in Hc||(i[ie]=t[ie]);if(t.css===!1)return i;const{name:s="v",type:l,duration:u,enterFromClass:f=`${s}-enter-from`,enterActiveClass:h=`${s}-enter-active`,enterToClass:_=`${s}-enter-to`,appearFromClass:y=f,appearActiveClass:C=h,appearToClass:T=_,leaveFromClass:A=`${s}-leave-from`,leaveActiveClass:R=`${s}-leave-active`,leaveToClass:B=`${s}-leave-to`}=t,j=bh(u),F=j&&j[0],pe=j&&j[1],{onBeforeEnter:me,onEnter:Y,onEnterCancelled:Le,onLeave:fe,onLeaveCancelled:Ue,onBeforeAppear:Ne=me,onAppear:Ie=Y,onAppearCancelled:Ge=Le}=i,we=(ie,je,oe,We)=>{ie._enterCancelled=We,go(ie,je?T:_),go(ie,je?C:h),oe&&oe()},Te=(ie,je)=>{ie._isLeaving=!1,go(ie,A),go(ie,B),go(ie,R),je&&je()},ze=ie=>(je,oe)=>{const We=ie?Ie:Y,ue=()=>we(je,ie,oe);mo(We,[je,ue]),Jl(()=>{go(je,ie?y:f),gi(je,ie?T:_),Yl(We)||Xl(je,l,F,ue)})};return Bt(i,{onBeforeEnter(ie){mo(me,[ie]),gi(ie,f),gi(ie,h)},onBeforeAppear(ie){mo(Ne,[ie]),gi(ie,y),gi(ie,C)},onEnter:ze(!1),onAppear:ze(!0),onLeave(ie,je){ie._isLeaving=!0;const oe=()=>Te(ie,je);gi(ie,A),ie._enterCancelled?(gi(ie,R),tu(ie)):(tu(ie),gi(ie,R)),Jl(()=>{ie._isLeaving&&(go(ie,A),gi(ie,B),Yl(fe)||Xl(ie,l,pe,oe))}),mo(fe,[ie,oe])},onEnterCancelled(ie){we(ie,!1,void 0,!0),mo(Le,[ie])},onAppearCancelled(ie){we(ie,!0,void 0,!0),mo(Ge,[ie])},onLeaveCancelled(ie){Te(ie),mo(Ue,[ie])}})}function bh(t){if(t==null)return null;if(gt(t))return[Ar(t.enter),Ar(t.leave)];{const i=Ar(t);return[i,i]}}function Ar(t){return _d(t)}function gi(t,i){i.split(/\s+/).forEach(s=>s&&t.classList.add(s)),(t[Js]||(t[Js]=new Set)).add(i)}function go(t,i){i.split(/\s+/).forEach(l=>l&&t.classList.remove(l));const s=t[Js];s&&(s.delete(i),s.size||(t[Js]=void 0))}function Jl(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let yh=0;function Xl(t,i,s,l){const u=t._endId=++yh,f=()=>{u===t._endId&&l()};if(s!=null)return setTimeout(f,s);const{type:h,timeout:_,propCount:y}=xh(t,i);if(!h)return l();const C=h+"end";let T=0;const A=()=>{t.removeEventListener(C,R),f()},R=B=>{B.target===t&&++T>=y&&A()};setTimeout(()=>{T(s[j]||"").split(", "),u=l(`${Fi}Delay`),f=l(`${Fi}Duration`),h=Ql(u,f),_=l(`${Es}Delay`),y=l(`${Es}Duration`),C=Ql(_,y);let T=null,A=0,R=0;i===Fi?h>0&&(T=Fi,A=h,R=f.length):i===Es?C>0&&(T=Es,A=C,R=y.length):(A=Math.max(h,C),T=A>0?h>C?Fi:Es:null,R=T?T===Fi?f.length:y.length:0);const B=T===Fi&&/\b(?:transform|all)(?:,|$)/.test(l(`${Fi}Property`).toString());return{type:T,timeout:A,propCount:R,hasTransform:B}}function Ql(t,i){for(;t.lengtheu(s)+eu(t[l])))}function eu(t){return t==="auto"?0:Number(t.slice(0,-1).replace(",","."))*1e3}function tu(t){return(t?t.ownerDocument:document).body.offsetHeight}function wh(t,i,s){const l=t[Js];l&&(i=(i?[i,...l]:[...l]).join(" ")),i==null?t.removeAttribute("class"):s?t.setAttribute("class",i):t.className=i}const Ba=Symbol("_vod"),jc=Symbol("_vsh"),kh={name:"show",beforeMount(t,{value:i},{transition:s}){t[Ba]=t.style.display==="none"?"":t.style.display,s&&i?s.beforeEnter(t):Os(t,i)},mounted(t,{value:i},{transition:s}){s&&i&&s.enter(t)},updated(t,{value:i,oldValue:s},{transition:l}){!i!=!s&&(l?i?(l.beforeEnter(t),Os(t,!0),l.enter(t)):l.leave(t,()=>{Os(t,!1)}):Os(t,i))},beforeUnmount(t,{value:i}){Os(t,i)}};function Os(t,i){t.style.display=i?t[Ba]:"none",t[jc]=!i}const Sh=Symbol(""),Th=/(?:^|;)\s*display\s*:/;function Ph(t,i,s){const l=t.style,u=Ct(s);let f=!1;if(s&&!u){if(i)if(Ct(i))for(const h of i.split(";")){const _=h.slice(0,h.indexOf(":")).trim();s[_]==null&&$s(l,_,"")}else for(const h in i)s[h]==null&&$s(l,h,"");for(const h in s){h==="display"&&(f=!0);const _=s[h];_!=null?Lh(t,h,!Ct(i)&&i?i[h]:void 0,_)||$s(l,h,_):$s(l,h,"")}}else if(u){if(i!==s){const h=l[Sh];h&&(s+=";"+h),l.cssText=s,f=Th.test(s)}}else i&&t.removeAttribute("style");Ba in t&&(t[Ba]=f?l.display:"",t[jc]&&(l.display="none"))}const nu=/\s*!important$/;function $s(t,i,s){if(Fe(s))s.forEach(l=>$s(t,i,l));else if(s==null&&(s=""),i.startsWith("--"))t.setProperty(i,s);else{const l=Ch(t,i);nu.test(s)?t.setProperty(ji(l),s.replace(nu,""),"important"):t[l]=s}}const iu=["Webkit","Moz","ms"],Er={};function Ch(t,i){const s=Er[i];if(s)return s;let l=Hn(i);if(l!=="filter"&&l in t)return Er[i]=l;l=Nu(l);for(let u=0;uOr||(Ih.then(()=>Or=0),Or=Date.now());function Nh(t,i){const s=l=>{if(!l._vts)l._vts=Date.now();else if(l._vts<=s.attached)return;const u=s.value;if(Fe(u)){const f=l.stopImmediatePropagation;l.stopImmediatePropagation=()=>{f.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,Dh=(t,i,s,l,u,f)=>{const h=u==="svg";i==="class"?wh(t,l,h):i==="style"?Ph(t,s,l):Ha(i)?ja(i)||Ah(t,i,s,l,f):(i[0]==="."?(i=i.slice(1),!0):i[0]==="^"?(i=i.slice(1),!1):Fh(t,i,l,h))?(au(t,i,l),!t.tagName.includes("-")&&(i==="value"||i==="checked"||i==="selected")&&su(t,i,l,h,f,i!=="value")):t._isVueCE&&(Rh(t,i)||t._def.__asyncLoader&&(/[A-Z]/.test(i)||!Ct(l)))?au(t,Hn(i),l,f,i):(i==="true-value"?t._trueValue=l:i==="false-value"&&(t._falseValue=l),su(t,i,l,h))};function Fh(t,i,s,l){if(l)return!!(i==="innerHTML"||i==="textContent"||i in t&&lu(i)&&Ye(s));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 lu(i)&&Ct(s)?!1:i in t}function Rh(t,i){const s=t._def.props;if(!s)return!1;const l=Hn(i);return Array.isArray(s)?s.some(u=>Hn(u)===l):Object.keys(s).some(u=>Hn(u)===l)}const Hi=t=>{const i=t.props["onUpdate:modelValue"]||!1;return Fe(i)?s=>Aa(i,s):i};function Bh(t){t.target.composing=!0}function uu(t){const i=t.target;i.composing&&(i.composing=!1,i.dispatchEvent(new Event("input")))}const Nn=Symbol("_assign");function cu(t,i,s){return i&&(t=t.trim()),s&&(t=Ka(t)),t}const ye={created(t,{modifiers:{lazy:i,trim:s,number:l}},u){t[Nn]=Hi(u);const f=l||u.props&&u.props.type==="number";xi(t,i?"change":"input",h=>{h.target.composing||t[Nn](cu(t.value,s,f))}),(s||f)&&xi(t,"change",()=>{t.value=cu(t.value,s,f)}),i||(xi(t,"compositionstart",Bh),xi(t,"compositionend",uu),xi(t,"change",uu))},mounted(t,{value:i}){t.value=i??""},beforeUpdate(t,{value:i,oldValue:s,modifiers:{lazy:l,trim:u,number:f}},h){if(t[Nn]=Hi(h),t.composing)return;const _=(f||t.type==="number")&&!/^0\d/.test(t.value)?Ka(t.value):t.value,y=i??"";if(_===y)return;const C=t.getRootNode();(C instanceof Document||C instanceof ShadowRoot)&&C.activeElement===t&&t.type!=="range"&&(l&&i===s||u&&t.value.trim()===y)||(t.value=y)}},Ua={deep:!0,created(t,i,s){t[Nn]=Hi(s),xi(t,"change",()=>{const l=t._modelValue,u=ns(t),f=t.checked,h=t[Nn];if(Fe(l)){const _=tl(l,u),y=_!==-1;if(f&&!y)h(l.concat(u));else if(!f&&y){const C=[...l];C.splice(_,1),h(C)}}else if(is(l)){const _=new Set(l);f?_.add(u):_.delete(u),h(_)}else h(Wc(t,f))})},mounted:du,beforeUpdate(t,i,s){t[Nn]=Hi(s),du(t,i,s)}};function du(t,{value:i,oldValue:s},l){t._modelValue=i;let u;if(Fe(i))u=tl(i,l.props.value)>-1;else if(is(i))u=i.has(l.props.value);else{if(i===s)return;u=Vi(i,Wc(t,!0))}t.checked!==u&&(t.checked=u)}const Uh={created(t,{value:i},s){t.checked=Vi(i,s.props.value),t[Nn]=Hi(s),xi(t,"change",()=>{t[Nn](ns(t))})},beforeUpdate(t,{value:i,oldValue:s},l){t[Nn]=Hi(l),i!==s&&(t.checked=Vi(i,l.props.value))}},Et={deep:!0,created(t,{value:i,modifiers:{number:s}},l){const u=is(i);xi(t,"change",()=>{const f=Array.prototype.filter.call(t.options,h=>h.selected).map(h=>s?Ka(ns(h)):ns(h));t[Nn](t.multiple?u?new Set(f):f:f[0]),t._assigning=!0,ic(()=>{t._assigning=!1})}),t[Nn]=Hi(l)},mounted(t,{value:i}){fu(t,i)},beforeUpdate(t,i,s){t[Nn]=Hi(s)},updated(t,{value:i}){t._assigning||fu(t,i)}};function fu(t,i){const s=t.multiple,l=Fe(i);if(!(s&&!l&&!is(i))){for(let u=0,f=t.options.length;uString(C)===String(_)):h.selected=tl(i,_)>-1}else h.selected=i.has(_);else if(Vi(ns(h),i)){t.selectedIndex!==u&&(t.selectedIndex=u);return}}!s&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function ns(t){return"_value"in t?t._value:t.value}function Wc(t,i){const s=i?"_trueValue":"_falseValue";return s in t?t[s]:i}const Vh={created(t,i,s){La(t,i,s,null,"created")},mounted(t,i,s){La(t,i,s,null,"mounted")},beforeUpdate(t,i,s,l){La(t,i,s,l,"beforeUpdate")},updated(t,i,s,l){La(t,i,s,l,"updated")}};function Zh(t,i){switch(t){case"SELECT":return Et;case"TEXTAREA":return ye;default:switch(i){case"checkbox":return Ua;case"radio":return Uh;default:return ye}}}function La(t,i,s,l,u){const h=Zh(t.tagName,s.props&&s.props.type)[u];h&&h(t,i,s,l)}const Hh=["ctrl","shift","alt","meta"],jh={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)=>Hh.some(s=>t[`${s}Key`]&&!i.includes(s))},hl=(t,i)=>{if(!t)return t;const s=t._withMods||(t._withMods={}),l=i.join(".");return s[l]||(s[l]=((u,...f)=>{for(let h=0;h{const s=t._withKeys||(t._withKeys={}),l=i.join(".");return s[l]||(s[l]=(u=>{if(!("key"in u))return;const f=ji(u.key);if(i.some(h=>h===f||Wh[h]===f))return t(u)}))},Kh=Bt({patchProp:Dh},ph);let pu;function Gh(){return pu||(pu=Kf(Kh))}const qh=((...t)=>{const i=Gh().createApp(...t),{mount:s}=i;return i.mount=l=>{const u=Jh(l);if(!u)return;const f=i._component;!Ye(f)&&!f.render&&!f.template&&(f.template=u.innerHTML),u.nodeType===1&&(u.textContent="");const h=s(u,!1,Yh(u));return u instanceof Element&&(u.removeAttribute("v-cloak"),u.setAttribute("data-v-app","")),h},i});function Yh(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function Jh(t){return Ct(t)?document.querySelector(t):t}const Kc="pv_theme",mu={light:"#EEF0F3",dark:"#0B1730"},Va=typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;function Gc(){return Va&&Va.matches?"dark":"light"}function Xh(){try{return localStorage.getItem(Kc)||"light"}catch{return"light"}}function qc(t){return t==="system"?Gc():t}function Yc(t){const i=document.documentElement;i.setAttribute("data-theme",t),i.style.backgroundColor=mu[t]||mu.light}const ko=Z(Xh()),es=Z(qc(ko.value));function Za(t){ko.value=t;const i=qc(t);es.value=i,Yc(i);try{localStorage.setItem(Kc,t)}catch{}}function gu(){Za(es.value==="dark"?"light":"dark")}Va&&Va.addEventListener("change",()=>{if(ko.value==="system"){const t=Gc();es.value=t,Yc(t)}});async function Qh(){try{const t=await fetch("/bff/config");return t.ok?await t.json():{apiBase:""}}catch{return{apiBase:""}}}async function vu(){try{const t=await fetch("/bff/me");return t.ok?await t.json():null}catch{return null}}async function ep(t,i,s){const l=await fetch("/bff/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t,password:i,apiBase:s})});return{ok:l.ok,status:l.status,body:await l.json().catch(()=>({}))}}async function tp(){try{await fetch("/bff/logout",{method:"POST"})}catch{}}async function np(){try{const t=await fetch("/bff/devices");return t.ok?await t.json():[]}catch{return[]}}async function ip(){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 op(t,i,s,l){const u=await fetch("/bff/users",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t,password:i,role:s,organization:l})});return{ok:u.ok,status:u.status,body:await u.json().catch(()=>({}))}}async function sp(t,i){const s=await fetch(`/bff/users/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return{ok:s.ok,status:s.status,body:await s.json().catch(()=>({}))}}async function ap(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 rp(){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 lp(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 up(t,i){const s=await fetch(`/bff/orgs/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i})});return{ok:s.ok,status:s.status,body:await s.json().catch(()=>({}))}}async function cp(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 dp(){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 fp(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 hp(){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 _u(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 pp(t){const i=t?`?bbox=${encodeURIComponent(t)}`:"",s=await fetch(`/bff/integrations/opensky/health${i}`,{method:"POST"});return{ok:s.ok,status:s.status,body:await s.json().catch(()=>({}))}}async function mp(t){try{const i=t?`?bbox=${encodeURIComponent(t)}`:"",s=await fetch(`/bff/integrations/opensky/states${i}`);if(!s.ok)return{states:[],unavailable:!0,detail:"OpenSky unavailable"};const l=await s.json();return{states:l.states||[],time:l.time,unavailable:!!l.unavailable,detail:l.detail||"",plan:l.plan||"",recommendedInterval:l.recommendedInterval||0}}catch{return{states:[],unavailable:!0,detail:"OpenSky unavailable"}}}async function gp(){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 bu(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 vp(){const t=await fetch("/bff/integrations/filetransfer/health",{method:"POST"});return{ok:t.ok,status:t.status,body:await t.json().catch(()=>({}))}}async function _p(){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 Ma(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 bp(){const t=await fetch("/bff/integrations/localstorage/health",{method:"POST"});return{ok:t.ok,status:t.status,body:await t.json().catch(()=>({}))}}async function yp(){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 yu(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 xp(){const t=await fetch("/bff/integrations/webdav/health",{method:"POST"});return{ok:t.ok,status:t.status,body:await t.json().catch(()=>({}))}}async function wp(){try{const t=await fetch("/bff/integrations/openweather");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 xu(t){const i=await fetch("/bff/integrations/openweather",{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 kp(){const t=await fetch("/bff/integrations/openweather/health",{method:"POST"});return{ok:t.ok,status:t.status,body:await t.json().catch(()=>({}))}}async function Jc(){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 Tp(t,i){const s=await fetch(`/bff/drones/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return{ok:s.ok,status:s.status,body:await s.json().catch(()=>({}))}}async function Pp(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 Cp(){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 Mp(t,i){const s=await fetch(`/bff/flights/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return{ok:s.ok,status:s.status,body:await s.json().catch(()=>({}))}}async function Ap(t){const i=await fetch(`/bff/flights/${encodeURIComponent(t)}`,{method:"DELETE"});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}function Ep(){return"/bff/logbook/export"}async function Op(t){try{const i=t!=null&&t!==""?`?expiring=${encodeURIComponent(t)}`:"",s=await fetch(`/bff/documents${i}`);return s.ok?{ok:!0,status:200,documents:(await s.json()).documents||[]}:{ok:!1,status:s.status,documents:[]}}catch{return{ok:!1,status:0,documents:[]}}}async function zp(t,i){const s=new FormData;Object.entries(t).forEach(([u,f])=>{f!=null&&f!==""&&s.append(u,f)}),i&&s.append("file",i);const l=await fetch("/bff/documents",{method:"POST",body:s});return{ok:l.ok,status:l.status,body:await l.json().catch(()=>({}))}}async function Ip(t,i){const s=await fetch(`/bff/documents/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return{ok:s.ok,status:s.status,body:await s.json().catch(()=>({}))}}async function $p(t){const i=await fetch(`/bff/documents/${encodeURIComponent(t)}`,{method:"DELETE"});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}function zr(t){return`/bff/documents/${encodeURIComponent(t)}/file`}function Np(t){return`/bff/documents/${encodeURIComponent(t)}/file?inline=1`}async function Dp(t,i,s){const l=await fetch(`/bff/devices/${encodeURIComponent(t)}/command`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:i,payload:s})});return{ok:l.ok,body:await l.json().catch(()=>({}))}}const Xc="pv_prefs",qr={name:"",username:"",displayName:"",bio:"",avatar:"",showEmail:!1,fontSize:"md",language:"en",region:"US",dateFormat:"MDY",timeFormat:"24",reduceMotion:!1,showAirTraffic:!0,autoBbox:!0,airTrafficInterval:"auto",twoFactor:!1};function Fp(){try{return{...qr,...JSON.parse(localStorage.getItem(Xc)||"{}")||{}}}catch{return{...qr}}}const be=St(Fp());function Qc(){try{localStorage.setItem(Xc,JSON.stringify(be))}catch{}}function ed(t){if(!t||typeof t!="object")return!1;for(const i of Object.keys(qr))i in t&&(be[i]=t[i]);return!0}const Rp={sm:15,md:16,lg:18};function pl(t){document.documentElement.style.fontSize=(Rp[t]||16)+"px"}function ml(t){document.documentElement.classList.toggle("reduce-motion",!!t)}function td(t){const i=new Date(t),s=i.getFullYear(),l=String(i.getMonth()+1).padStart(2,"0"),u=String(i.getDate()).padStart(2,"0");let f;switch(be.dateFormat){case"DMY":f=`${u}/${l}/${s}`;break;case"YMD":f=`${s}/${l}/${u}`;break;case"ISO":f=`${s}-${l}-${u}`;break;default:f=`${l}/${u}/${s}`}let h;return be.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:f,time:h}}function wu(t){return td(t).time}function ku(t){const i=td(t);return`${i.date} ${i.time}`}let gl=!1,Yr=!1,Jr=null;function Bp(){return{...JSON.parse(JSON.stringify(be)),themeMode:ko.value}}function vl(){!gl||Yr||(clearTimeout(Jr),Jr=setTimeout(()=>{fp(Bp())},600))}function Up(t){Yr=!0;try{ed(t),t.themeMode&&Za(t.themeMode),pl(be.fontSize),ml(be.reduceMotion),Qc()}finally{Yr=!1}}async function Su(){gl=!0;const t=await dp();t&&Object.keys(t).length?Up(t):vl()}function Vp(){gl=!1,clearTimeout(Jr)}Nt(be,()=>{Qc(),vl()},{deep:!0});Nt(ko,vl);Nt(()=>be.fontSize,pl,{immediate:!0});Nt(()=>be.reduceMotion,ml,{immediate:!0});const Zp=["width","height"],nd={__name:"BrandMark",props:{size:{type:[Number,String],default:28}},setup(t){return(i,s)=>(p(),m("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none","aria-hidden":"true"},[...s[0]||(s[0]=[a("g",{"stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round"},[a("polyline",{points:"8,30 19,17 30,30",stroke:"var(--accent)"}),a("polyline",{points:"18,33 29,20 40,33",stroke:"currentColor"})],-1)])],8,Zp))}},Hp=["title","aria-label"],jp={key:0,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Wp={key:1,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Kp={__name:"ThemeToggle",setup(t){return(i,s)=>(p(),m("button",{class:"btn-icon",type:"button",title:Oe(es)==="dark"?"Switch to light":"Switch to dark","aria-label":Oe(es)==="dark"?"Switch to light theme":"Switch to dark theme",onClick:s[0]||(s[0]=(...l)=>Oe(gu)&&Oe(gu)(...l))},[Oe(es)==="dark"?(p(),m("svg",jp,[...s[1]||(s[1]=[a("circle",{cx:"12",cy:"12",r:"4"},null,-1),a("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)])])):(p(),m("svg",Wp,[...s[2]||(s[2]=[a("path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9z"},null,-1)])]))],8,Hp))}},Gp={class:"relative grid h-full place-items-center p-5"},qp={class:"absolute right-5 top-5"},Yp={class:"mb-6 flex items-center gap-3 text-ink"},Jp={class:"relative mb-1"},Xp=["type"],Qp=["aria-label","title"],em={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]"},tm={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]"},nm={key:0,class:"mt-4"},im={key:1,class:"mt-4 rounded border border-line bg-danger-soft px-3 py-2 text-sm text-danger-fg"},om=["disabled"],sm={__name:"LoginView",props:{defaultApiBase:{type:String,default:""}},emits:["signed-in"],setup(t,{emit:i}){const s=t,l=i,u=Z(""),f=Z(""),h=Z(localStorage.getItem("api_url")||s.defaultApiBase||"http://localhost:8080"),_=Z(!1),y=Z(!1),C=Z(!1),T=Z("");async function A(){C.value=!0,T.value="",localStorage.setItem("api_url",h.value.trim());const{ok:R,status:B,body:j}=await ep(u.value.trim(),f.value,h.value.trim());if(C.value=!1,R){l("signed-in",j.email);return}T.value=B===400?"Invalid email or password.":B===502?"API server can't reach PocketBase.":j.message||j.error||"Cannot reach the API server."}return(R,B)=>(p(),m("div",Gp,[a("div",qp,[M(Kp)]),a("form",{class:"panel w-[380px] p-8 shadow-md",onSubmit:hl(A,["prevent"])},[a("div",Yp,[M(nd,{size:34}),B[5]||(B[5]=a("div",{class:"leading-tight"},[a("div",{class:"text-mode"},"PilotVault"),a("div",{class:"eyebrow mt-0.5"},"Control panel")],-1))]),B[9]||(B[9]=a("label",{class:"eyebrow mb-1.5 block"},"Email",-1)),ee(a("input",{"onUpdate:modelValue":B[0]||(B[0]=j=>u.value=j),type:"email",autocomplete:"username",required:"",class:"field mb-4",placeholder:"you@example.com"},null,512),[[ye,u.value]]),B[10]||(B[10]=a("label",{class:"eyebrow mb-1.5 block"},"Password",-1)),a("div",Jp,[ee(a("input",{"onUpdate:modelValue":B[1]||(B[1]=j=>f.value=j),type:y.value?"text":"password",autocomplete:"current-password",required:"",class:"field w-full pr-10",placeholder:"••••••••"},null,8,Xp),[[Vh,f.value]]),a("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:B[2]||(B[2]=j=>y.value=!y.value)},[y.value?(p(),m("svg",em,[...B[6]||(B[6]=[a("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),a("line",{x1:"1",y1:"1",x2:"23",y2:"23"},null,-1)])])):(p(),m("svg",tm,[...B[7]||(B[7]=[a("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"},null,-1),a("circle",{cx:"12",cy:"12",r:"3"},null,-1)])]))],8,Qp)]),_.value?(p(),m("div",nm,[B[8]||(B[8]=a("label",{class:"eyebrow mb-1.5 block"},"API Server",-1)),ee(a("input",{"onUpdate:modelValue":B[3]||(B[3]=j=>h.value=j),type:"text",class:"field font-mono",placeholder:"10.2.1.101:8080"},null,512),[[ye,h.value]])])):N("",!0),T.value?(p(),m("p",im,k(T.value),1)):N("",!0),a("button",{type:"submit",class:"btn-accent mt-6 w-full",disabled:C.value},k(C.value?"Signing in…":"Sign in"),9,om),a("button",{type:"button",class:"mx-auto mt-3 block text-xs text-ink-muted transition hover:text-ink-secondary",onClick:B[4]||(B[4]=j=>_.value=!_.value)},k(_.value?"Hide server settings":"Server settings"),1)],32)]))}};function am(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ns={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 rm=Ns.exports,Tu;function lm(){return Tu||(Tu=1,(function(t,i){(function(s,l){l(i)})(rm,(function(s){var l="1.9.4";function u(e){var n,o,r,d;for(o=1,r=arguments.length;o"u"||!L||!L.Mixin)){e=Le(e)?e:[e];for(var n=0;n0?Math.floor(e):Math.ceil(e)};ae.prototype={clone:function(){return new ae(this.x,this.y)},add:function(e){return this.clone()._add(te(e))},_add:function(e){return this.x+=e.x,this.y+=e.y,this},subtract:function(e){return this.clone()._subtract(te(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 ae(this.x*e.x,this.y*e.y)},unscaleBy:function(e){return new ae(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=st(this.x),this.y=st(this.y),this},distanceTo:function(e){e=te(e);var n=e.x-this.x,o=e.y-this.y;return Math.sqrt(n*n+o*o)},equals:function(e){return e=te(e),e.x===this.x&&e.y===this.y},contains:function(e){return e=te(e),Math.abs(e.x)<=Math.abs(this.x)&&Math.abs(e.y)<=Math.abs(this.y)},toString:function(){return"Point("+R(this.x)+", "+R(this.y)+")"}};function te(e,n,o){return e instanceof ae?e:Le(e)?new ae(e[0],e[1]):e==null?e:typeof e=="object"&&"x"in e&&"y"in e?new ae(e.x,e.y):new ae(e,n,o)}function ke(e,n){if(e)for(var o=n?[e,n]:e,r=0,d=o.length;r=this.min.x&&o.x<=this.max.x&&n.y>=this.min.y&&o.y<=this.max.y},intersects:function(e){e=De(e);var n=this.min,o=this.max,r=e.min,d=e.max,v=d.x>=n.x&&r.x<=o.x,P=d.y>=n.y&&r.y<=o.y;return v&&P},overlaps:function(e){e=De(e);var n=this.min,o=this.max,r=e.min,d=e.max,v=d.x>n.x&&r.xn.y&&r.y=n.lat&&d.lat<=o.lat&&r.lng>=n.lng&&d.lng<=o.lng},intersects:function(e){e=lt(e);var n=this._southWest,o=this._northEast,r=e.getSouthWest(),d=e.getNorthEast(),v=d.lat>=n.lat&&r.lat<=o.lat,P=d.lng>=n.lng&&r.lng<=o.lng;return v&&P},overlaps:function(e){e=lt(e);var n=this._southWest,o=this._northEast,r=e.getSouthWest(),d=e.getNorthEast(),v=d.lat>n.lat&&r.latn.lng&&r.lng1,Ti=(function(){var e=!1;try{var n=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassiveEventSupport",A,n),window.removeEventListener("testPassiveEventSupport",A,n)}catch{}return e})(),na=(function(){return!!document.createElement("canvas").getContext})(),ss=!!(document.createElementNS&&G("svg").createSVGRect),as=!!ss&&(function(){var e=document.createElement("div");return e.innerHTML="",(e.firstChild&&e.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"})(),rs=!ss&&(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}})(),nr=navigator.platform.indexOf("Mac")===0,Pn=navigator.platform.indexOf("Linux")===0;function Xt(e){return navigator.userAgent.toLowerCase().indexOf(e)>=0}var ve={ie:re,ielt9:ne,edge:Q,webkit:q,android:ge,android23:se,androidStock:Me,opera:Ze,chrome:it,gecko:U,safari:O,phantom:Pe,opera12:qe,win:vt,ie3d:xt,webkit3d:rn,gecko3d:de,any3d:Tt,mobile:gn,mobileWebkit:So,mobileWebkit3d:ct,msPointer:si,pointer:To,touch:Wi,touchNative:pt,mobileOpera:Po,mobileGecko:Co,retina:Fn,passiveEvents:Ti,canvas:na,svg:ss,vml:rs,inlineSvg:as,mac:nr,linux:Pn},Qt=ve.msPointer?"MSPointerDown":"pointerdown",Lt=ve.msPointer?"MSPointerMove":"pointermove",ia=ve.msPointer?"MSPointerUp":"pointerup",ls=ve.msPointer?"MSPointerCancel":"pointercancel",Ki={touchstart:Qt,touchmove:Lt,touchend:ia,touchcancel:ls},oa={touchstart:us,touchmove:Rn,touchend:Rn,touchcancel:Rn},Pi={},sa=!1;function ir(e,n,o){return n==="touchstart"&&dt(),oa[n]?(o=oa[n].bind(this,o),e.addEventListener(Ki[n],o,!1),o):(console.warn("wrong event specified:",n),A)}function aa(e,n,o){if(!Ki[n]){console.warn("wrong event specified:",n);return}e.removeEventListener(Ki[n],o,!1)}function or(e){Pi[e.pointerId]=e}function sr(e){Pi[e.pointerId]&&(Pi[e.pointerId]=e)}function ra(e){delete Pi[e.pointerId]}function dt(){sa||(document.addEventListener(Qt,or,!0),document.addEventListener(Lt,sr,!0),document.addEventListener(ia,ra,!0),document.addEventListener(ls,ra,!0),sa=!0)}function Rn(e,n){if(n.pointerType!==(n.MSPOINTER_TYPE_MOUSE||"mouse")){n.touches=[];for(var o in Pi)n.touches.push(Pi[o]);n.changedTouches=[n],e(n)}}function us(e,n){n.MSPOINTER_TYPE_TOUCH&&n.pointerType===n.MSPOINTER_TYPE_TOUCH&&It(n),Rn(e,n)}function Zt(e){var n={},o,r;for(r in e)o=e[r],n[r]=o&&o.bind?o.bind(e):o;return e=n,n.type="dblclick",n.detail=2,n.isTrusted=!1,n._simulated=!0,n}var Gi=200;function Lo(e,n){e.addEventListener("dblclick",n);var o=0,r;function d(v){if(v.detail!==1){r=v.detail;return}if(!(v.pointerType==="mouse"||v.sourceCapabilities&&!v.sourceCapabilities.firesTouchEvents)){var P=ca(v);if(!(P.some(function(D){return D instanceof HTMLLabelElement&&D.attributes.for})&&!P.some(function(D){return D instanceof HTMLInputElement||D instanceof HTMLSelectElement}))){var $=Date.now();$-o<=Gi?(r++,r===2&&n(Zt(v))):r=1,o=$}}}return e.addEventListener("click",d),{dblclick:n,simDblclick:d}}function Mo(e,n){e.removeEventListener("dblclick",n.dblclick),e.removeEventListener("click",n.simDblclick)}var vn=zo(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),Cn=zo(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),la=Cn==="webkitTransition"||Cn==="OTransition"?Cn+"End":"transitionend";function Ao(e){return typeof e=="string"?document.getElementById(e):e}function ai(e,n){var o=e.style[n]||e.currentStyle&&e.currentStyle[n];if((!o||o==="auto")&&document.defaultView){var r=document.defaultView.getComputedStyle(e,null);o=r?r[n]:null}return o==="auto"?null:o}function at(e,n,o){var r=document.createElement(e);return r.className=n||"",o&&o.appendChild(r),r}function rt(e){var n=e.parentNode;n&&n.removeChild(e)}function _n(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function bn(e){var n=e.parentNode;n&&n.lastChild!==e&&n.appendChild(e)}function Ut(e){var n=e.parentNode;n&&n.firstChild!==e&&n.insertBefore(e,n.firstChild)}function Eo(e,n){if(e.classList!==void 0)return e.classList.contains(n);var o=Oo(e);return o.length>0&&new RegExp("(^|\\s)"+n+"(\\s|$)").test(o)}function Ke(e,n){if(e.classList!==void 0)for(var o=j(n),r=0,d=o.length;r0?2*window.devicePixelRatio:1;function da(e){return ve.edge?e.wheelDeltaY/2:e.deltaY&&e.deltaMode===0?-e.deltaY/ms: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 Ee(e,n){var o=n.relatedTarget;if(!o)return!0;try{for(;o&&o!==e;)o=o.parentNode}catch{return!1}return o!==e}var Oi={__proto__:null,on:$e,off:Qe,stopPropagation:ui,disableScrollPropagation:ps,disableClickPropagation:Ai,preventDefault:It,stop:ci,getPropagationPath:ca,getMousePosition:Ei,getWheelDelta:da,isExternalTarget:Ee,addListener:$e,removeListener:Qe},Yi=ce.extend({run:function(e,n,o,r){this.stop(),this._el=e,this._inProgress=!0,this._duration=o||.25,this._easeOutPower=1/Math.max(r||.5,.2),this._startPos=et(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=ze(this._animate,this),this._step()},_step:function(e){var n=+new Date-this._startTime,o=this._duration*1e3;nthis.options.maxZoom)?this.setZoom(e):this},panInsideBounds:function(e,n){this._enforcingBounds=!0;var o=this.getCenter(),r=this._limitCenter(o,this._zoom,lt(e));return o.equals(r)||this.panTo(r,n),this._enforcingBounds=!1,this},panInside:function(e,n){n=n||{};var o=te(n.paddingTopLeft||n.padding||[0,0]),r=te(n.paddingBottomRight||n.padding||[0,0]),d=this.project(this.getCenter()),v=this.project(e),P=this.getPixelBounds(),$=De([P.min.add(o),P.max.subtract(r)]),D=$.getSize();if(!$.contains(v)){this._enforcingBounds=!0;var X=v.subtract($.getCenter()),_e=$.extend(v).getSize().subtract(D);d.x+=X.x<0?-_e.x:_e.x,d.y+=X.y<0?-_e.y:_e.y,this.panTo(this.unproject(d),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 o=this.getSize(),r=n.divideBy(2).round(),d=o.divideBy(2).round(),v=r.subtract(d);return!v.x&&!v.y?this:(e.animate&&e.pan?this.panBy(v):(e.pan&&this._rawPanBy(v),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:o}))},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),o=h(this._handleGeolocationError,this);return e.watch?this._locationWatchId=navigator.geolocation.watchPosition(n,o,e):navigator.geolocation.getCurrentPosition(n,o,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,o=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: "+o+"."})}},_handleGeolocationResponse:function(e){if(this._container._leaflet_id){var n=e.coords.latitude,o=e.coords.longitude,r=new Ve(n,o),d=r.toBounds(e.coords.accuracy*2),v=this._locateOptions;if(v.setView){var P=this.getBoundsZoom(d);this.setView(r,v.maxZoom?Math.min(P,v.maxZoom):P)}var $={latlng:r,bounds:d,timestamp:e.timestamp};for(var D in e.coords)typeof e.coords[D]=="number"&&($[D]=e.coords[D]);this.fire("locationfound",$)}},addHandler:function(e,n){if(!n)return this;var o=this[e]=new n(this);return this._handlers.push(o),this.options[e]&&o.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(),rt(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(ie(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)rt(this._panes[e]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(e,n){var o="leaflet-pane"+(e?" leaflet-"+e.replace("Pane","")+"-pane":""),r=at("div",o,n||this._mapPane);return e&&(this._panes[e]=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 e=this.getPixelBounds(),n=this.unproject(e.getBottomLeft()),o=this.unproject(e.getTopRight());return new ht(n,o)},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,o){e=lt(e),o=te(o||[0,0]);var r=this.getZoom()||0,d=this.getMinZoom(),v=this.getMaxZoom(),P=e.getNorthWest(),$=e.getSouthEast(),D=this.getSize().subtract(o),X=De(this.project($,r),this.project(P,r)).getSize(),_e=ve.any3d?this.options.zoomSnap:1,Be=D.x/X.x,nt=D.y/X.y,tn=n?Math.max(Be,nt):Math.min(Be,nt);return r=this.getScaleZoom(tn,r),_e&&(r=Math.round(r/(_e/100))*(_e/100),r=n?Math.ceil(r/_e)*_e:Math.floor(r/_e)*_e),Math.max(d,Math.min(v,r))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new ae(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(e,n){var o=this._getTopLeftPoint(e,n);return new ke(o,o.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 o=this.options.crs;return n=n===void 0?this._zoom:n,o.scale(e)/o.scale(n)},getScaleZoom:function(e,n){var o=this.options.crs;n=n===void 0?this._zoom:n;var r=o.zoom(e*o.scale(n));return isNaN(r)?1/0:r},project:function(e,n){return n=n===void 0?this._zoom:n,this.options.crs.latLngToPoint(J(e),n)},unproject:function(e,n){return n=n===void 0?this._zoom:n,this.options.crs.pointToLatLng(te(e),n)},layerPointToLatLng:function(e){var n=te(e).add(this.getPixelOrigin());return this.unproject(n)},latLngToLayerPoint:function(e){var n=this.project(J(e))._round();return n._subtract(this.getPixelOrigin())},wrapLatLng:function(e){return this.options.crs.wrapLatLng(J(e))},wrapLatLngBounds:function(e){return this.options.crs.wrapLatLngBounds(lt(e))},distance:function(e,n){return this.options.crs.distance(J(e),J(n))},containerPointToLayerPoint:function(e){return te(e).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(e){return te(e).add(this._getMapPanePos())},containerPointToLatLng:function(e){var n=this.containerPointToLayerPoint(te(e));return this.layerPointToLatLng(n)},latLngToContainerPoint:function(e){return this.layerPointToContainerPoint(this.latLngToLayerPoint(J(e)))},mouseEventToContainerPoint:function(e){return Ei(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=Ao(e);if(n){if(n._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");$e(n,"scroll",this._onScroll,this),this._containerId=y(n)},_initLayout:function(){var e=this._container;this._fadeAnimated=this.options.fadeAnimation&&ve.any3d,Ke(e,"leaflet-container"+(ve.touch?" leaflet-touch":"")+(ve.retina?" leaflet-retina":"")+(ve.ielt9?" leaflet-oldie":"")+(ve.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var n=ai(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),At(this._mapPane,new ae(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(Ke(e.markerPane,"leaflet-zoom-hide"),Ke(e.shadowPane,"leaflet-zoom-hide"))},_resetView:function(e,n,o){At(this._mapPane,new ae(0,0));var r=!this._loaded;this._loaded=!0,n=this._limitZoom(n),this.fire("viewprereset");var d=this._zoom!==n;this._moveStart(d,o)._move(e,n)._moveEnd(d),this.fire("viewreset"),r&&this.fire("load")},_moveStart:function(e,n){return e&&this.fire("zoomstart"),n||this.fire("movestart"),this},_move:function(e,n,o,r){n===void 0&&(n=this._zoom);var d=this._zoom!==n;return this._zoom=n,this._lastCenter=e,this._pixelOrigin=this._getNewPixelOrigin(e),r?o&&o.pinch&&this.fire("zoom",o):((d||o&&o.pinch)&&this.fire("zoom",o),this.fire("move",o)),this},_moveEnd:function(e){return e&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return ie(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(e){At(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?Qe:$e;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),ve.any3d&&this.options.transform3DLimit&&(e?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){ie(this._resizeRequest),this._resizeRequest=ze(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 o=[],r,d=n==="mouseout"||n==="mouseover",v=e.target||e.srcElement,P=!1;v;){if(r=this._targets[y(v)],r&&(n==="click"||n==="preclick")&&this._draggableMoved(r)){P=!0;break}if(r&&r.listens(n,!0)&&(d&&!Ee(v,e)||(o.push(r),d))||v===this._container)break;v=v.parentNode}return!o.length&&!P&&!d&&this.listens(n,!0)&&(o=[this]),o},_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 o=e.type;o==="mousedown"&&Io(n),this._fireDOMEvent(e,o)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(e,n,o){if(e.type==="click"){var r=u({},e);r.type="preclick",this._fireDOMEvent(r,r.type,o)}var d=this._findEventTargets(e,n);if(o){for(var v=[],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(),o=this.getMaxZoom(),r=ve.any3d?this.options.zoomSnap:1;return r&&(e=Math.round(e/r)*r),Math.max(n,Math.min(o,e))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){Mt(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(e,n){var o=this._getCenterOffset(e)._trunc();return(n&&n.animate)!==!0&&!this.getSize().contains(o)?!1:(this.panBy(o,n),!0)},_createAnimProxy:function(){var e=this._proxy=at("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(e),this.on("zoomanim",function(n){var o=vn,r=this._proxy.style[o];ri(this._proxy,this.project(n.center,n.zoom),this.getZoomScale(n.zoom,1)),r===this._proxy.style[o]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){rt(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var e=this.getCenter(),n=this.getZoom();ri(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,o){if(this._animatingZoom)return!0;if(o=o||{},!this._zoomAnimated||o.animate===!1||this._nothingToAnimate()||Math.abs(n-this._zoom)>this.options.zoomAnimationThreshold)return!1;var r=this.getZoomScale(n),d=this._getCenterOffset(e)._divideBy(1-1/r);return o.animate!==!0&&!this.getSize().contains(d)?!1:(ze(function(){this._moveStart(!0,o.noMoveStart||!1)._animateZoom(e,n,!0)},this),!0)},_animateZoom:function(e,n,o,r){this._mapPane&&(o&&(this._animatingZoom=!0,this._animateToCenter=e,this._animateToZoom=n,Ke(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:e,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&&Mt(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 Do(e,n){return new Xe(e,n)}var jt=oe.extend({options:{position:"topright"},initialize:function(e){F(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),o=this.getPosition(),r=e._controlCorners[o];return Ke(n,"leaflet-control"),o.indexOf("bottom")!==-1?r.insertBefore(n,r.firstChild):r.appendChild(n),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(rt(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()}}),en=function(e){return new jt(e)};Xe.include({addControl:function(e){return e.addTo(this),this},removeControl:function(e){return e.remove(),this},_initControlPos:function(){var e=this._controlCorners={},n="leaflet-",o=this._controlContainer=at("div",n+"control-container",this._container);function r(d,v){var P=n+d+" "+n+v;e[d+v]=at("div",P,o)}r("top","left"),r("top","right"),r("bottom","left"),r("bottom","right")},_clearControlPos:function(){for(var e in this._controlCorners)rt(this._controlCorners[e]);rt(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var di=jt.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(e,n,o,r){return o1,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)),o=n.overlay?e.type==="add"?"overlayadd":"overlayremove":e.type==="add"?"baselayerchange":null;o&&this._map.fire(o,n)},_createRadioElement:function(e,n){var o='",r=document.createElement("div");return r.innerHTML=o,r.firstChild},_addItem:function(e){var n=document.createElement("label"),o=this._map.hasLayer(e.layer),r;e.overlay?(r=document.createElement("input"),r.type="checkbox",r.className="leaflet-control-layers-selector",r.defaultChecked=o):r=this._createRadioElement("leaflet-base-layers_"+y(this),o),this._layerControlInputs.push(r),r.layerId=y(e.layer),$e(r,"click",this._onInputClick,this);var d=document.createElement("span");d.innerHTML=" "+e.name;var v=document.createElement("span");n.appendChild(v),v.appendChild(r),v.appendChild(d);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,o,r=[],d=[];this._handlingClick=!0;for(var v=e.length-1;v>=0;v--)n=e[v],o=this._getLayer(n.layerId).layer,n.checked?r.push(o):n.checked||d.push(o);for(v=0;v=0;d--)n=e[d],o=this._getLayer(n.layerId).layer,n.disabled=o.options.minZoom!==void 0&&ro.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var e=this._section;this._preventClick=!0,$e(e,"click",It),this.expand();var n=this;setTimeout(function(){Qe(e,"click",It),n._preventClick=!1})}}),Ji=function(e,n,o){return new di(e,n,o)},Fo=jt.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(e){var n="leaflet-control-zoom",o=at("div",n+" leaflet-bar"),r=this.options;return this._zoomInButton=this._createButton(r.zoomInText,r.zoomInTitle,n+"-in",o,this._zoomIn),this._zoomOutButton=this._createButton(r.zoomOutText,r.zoomOutTitle,n+"-out",o,this._zoomOut),this._updateDisabled(),e.on("zoomend zoomlevelschange",this._updateDisabled,this),o},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,o,r,d){var v=at("a",o,r);return v.innerHTML=e,v.href="#",v.title=n,v.setAttribute("role","button"),v.setAttribute("aria-label",n),Ai(v),$e(v,"click",ci),$e(v,"click",d,this),$e(v,"click",this._refocusOnMap,this),v},_updateDisabled:function(){var e=this._map,n="leaflet-disabled";Mt(this._zoomInButton,n),Mt(this._zoomOutButton,n),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||e._zoom===e.getMinZoom())&&(Ke(this._zoomOutButton,n),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||e._zoom===e.getMaxZoom())&&(Ke(this._zoomInButton,n),this._zoomInButton.setAttribute("aria-disabled","true"))}});Xe.mergeOptions({zoomControl:!0}),Xe.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Fo,this.addControl(this.zoomControl))});var gs=function(e){return new Fo(e)},Ro=jt.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(e){var n="leaflet-control-scale",o=at("div",n),r=this.options;return this._addScales(r,n+"-line",o),e.on(r.updateWhenIdle?"moveend":"move",this._update,this),e.whenReady(this._update,this),o},onRemove:function(e){e.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(e,n,o){e.metric&&(this._mScale=at("div",n,o)),e.imperial&&(this._iScale=at("div",n,o))},_update:function(){var e=this._map,n=e.getSize().y/2,o=e.distance(e.containerPointToLatLng([0,n]),e.containerPointToLatLng([this.options.maxWidth,n]));this._updateScales(o)},_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),o=n<1e3?n+" m":n/1e3+" km";this._updateScale(this._mScale,o,n/e)},_updateImperial:function(e){var n=e*3.2808399,o,r,d;n>5280?(o=n/5280,r=this._getRoundNum(o),this._updateScale(this._iScale,r+" mi",r/o)):(d=this._getRoundNum(n),this._updateScale(this._iScale,d+" ft",d/n))},_updateScale:function(e,n,o){e.style.width=Math.round(this.options.maxWidth*o)+"px",e.innerHTML=n},_getRoundNum:function(e){var n=Math.pow(10,(Math.floor(e)+"").length-1),o=e/n;return o=o>=10?10:o>=5?5:o>=3?3:o>=2?2:1,n*o}}),ar=function(e){return new Ro(e)},un='',zi=jt.extend({options:{position:"bottomright",prefix:''+(ve.inlineSvg?un+" ":"")+"Leaflet"},initialize:function(e){F(this,e),this._attributions={}},onAdd:function(e){e.attributionControl=this,this._container=at("div","leaflet-control-attribution"),Ai(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 o=[];this.options.prefix&&o.push(this.options.prefix),e.length&&o.push(e.join(", ")),this._container.innerHTML=o.join(' ')}}});Xe.mergeOptions({attributionControl:!0}),Xe.addInitHook(function(){this.options.attributionControl&&new zi().addTo(this)});var fa=function(e){return new zi(e)};jt.Layers=di,jt.Zoom=Fo,jt.Scale=Ro,jt.Attribution=zi,en.layers=Ji,en.zoom=gs,en.scale=ar,en.attribution=fa;var xn=oe.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}});xn.addTo=function(e,n){return e.addHandler(n,this),this};var rr={Events:ue},vs=ve.touch?"touchstart mousedown":"mousedown",cn=ce.extend({options:{clickTolerance:3},initialize:function(e,n,o,r){F(this,r),this._element=e,this._dragStartTarget=n||e,this._preventOutline=o},enable:function(){this._enabled||($e(this._dragStartTarget,vs,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(cn._dragging===this&&this.finishDrag(!0),Qe(this._dragStartTarget,vs,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(e){if(this._enabled&&(this._moved=!1,!Eo(this._element,"leaflet-zoom-anim"))){if(e.touches&&e.touches.length!==1){cn._dragging===this&&this.finishDrag();return}if(!(cn._dragging||e.shiftKey||e.which!==1&&e.button!==1&&!e.touches)&&(cn._dragging=this,this._preventOutline&&Io(this._element),Ci(),Ln(),!this._moving)){this.fire("down");var n=e.touches?e.touches[0]:e,o=$o(this._element);this._startPoint=new ae(n.clientX,n.clientY),this._startPos=et(this._element),this._parentScale=ds(o);var r=e.type==="mousedown";$e(document,r?"mousemove":"touchmove",this._onMove,this),$e(document,r?"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,o=new ae(n.clientX,n.clientY)._subtract(this._startPoint);!o.x&&!o.y||Math.abs(o.x)+Math.abs(o.y)v&&(P=$,v=D);v>o&&(n[P]=1,ys(e,n,o,r,P),ys(e,n,o,P,d))}function ga(e,n){for(var o=[e[0]],r=1,d=0,v=e.length;rn&&(o.push(e[r]),d=r);return dn.max.x&&(o|=2),e.yn.max.y&&(o|=8),o}function xs(e,n){var o=n.x-e.x,r=n.y-e.y;return o*o+r*r}function Je(e,n,o,r){var d=n.x,v=n.y,P=o.x-d,$=o.y-v,D=P*P+$*$,X;return D>0&&(X=((e.x-d)*P+(e.y-v)*$)/D,X>1?(d=o.x,v=o.y):X>0&&(d+=P*X,v+=$*X)),P=e.x-d,$=e.y-v,r?P*P+$*$:new ae(d,v)}function wt(e){return!Le(e[0])||typeof e[0][0]!="object"&&typeof e[0][0]<"u"}function fi(e){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),wt(e)}function ws(e,n){var o,r,d,v,P,$,D,X;if(!e||e.length===0)throw new Error("latlngs not passed");wt(e)||(console.warn("latlngs are not flat! Only the first ring will be used"),e=e[0]);var _e=J([0,0]),Be=lt(e),nt=Be.getNorthWest().distanceTo(Be.getSouthWest())*Be.getNorthEast().distanceTo(Be.getNorthWest());nt<1700&&(_e=_s(e));var tn=e.length,Rt=[];for(o=0;or){D=(v-r)/d,X=[$.x-D*($.x-P.x),$.y-D*($.y-P.y)];break}var pn=n.unproject(te(X));return J([pn.lat+_e.lat,pn.lng+_e.lng])}var dr={__proto__:null,simplify:bs,pointToSegmentDistance:ma,closestPointOnSegment:ur,clipSegment:Bo,_getEdgeIntersection:Ii,_getBitCode:Mn,_sqClosestPointOnSegment:Je,isFlat:wt,_flat:fi,polylineCenter:ws},Xi={project:function(e){return new ae(e.lng,e.lat)},unproject:function(e){return new Ve(e.y,e.x)},bounds:new ke([-180,-90],[180,90])},ks={R:6378137,R_MINOR:6356752314245179e-9,bounds:new ke([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(e){var n=Math.PI/180,o=this.R,r=e.lat*n,d=this.R_MINOR/o,v=Math.sqrt(1-d*d),P=v*Math.sin(r),$=Math.tan(Math.PI/4-r/2)/Math.pow((1-P)/(1+P),v/2);return r=-o*Math.log(Math.max($,1e-10)),new ae(e.lng*n*o,r)},unproject:function(e){for(var n=180/Math.PI,o=this.R,r=this.R_MINOR/o,d=Math.sqrt(1-r*r),v=Math.exp(-e.y/o),P=Math.PI/2-2*Math.atan(v),$=0,D=.1,X;$<15&&Math.abs(D)>1e-7;$++)X=d*Math.sin(P),X=Math.pow((1-X)/(1+X),d/2),D=Math.PI/2-2*Math.atan(v*X)-P,P+=D;return new Ve(P*n,e.x*n/o)}},fr={__proto__:null,LonLat:Xi,Mercator:ks,SphericalMercator:ut},hr=u({},I,{code:"EPSG:3395",projection:ks,transformation:(function(){var e=.5/(Math.PI*ks.R);return x(e,.5,-e,.5)})()}),_a=u({},I,{code:"EPSG:4326",projection:Xi,transformation:x(1/180,1,-1/180,.5)}),Qi=u({},E,{projection:Xi,transformation:x(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 o=n.lng-e.lng,r=n.lat-e.lat;return Math.sqrt(o*o+r*r)},infinite:!0});E.Earth=I,E.EPSG3395=hr,E.EPSG3857=b,E.EPSG900913=S,E.EPSG4326=_a,E.Simple=Qi;var dn=ce.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 o=this.getEvents();n.on(o,this),this.once("remove",function(){n.off(o,this)},this)}this.onAdd(n),this.fire("add"),n.fire("layeradd",{layer:this})}}});Xe.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 o in this._layers)e.call(n,this._layers[o]);return this},_addLayers:function(e){e=e?Le(e)?e:[e]:[];for(var n=0,o=e.length;nthis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()=2&&n[0]instanceof Ve&&n[0].equals(n[o-1])&&n.pop(),n},_setLatLngs:function(e){Wt.prototype._setLatLngs.call(this,e),wt(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return wt(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var e=this._renderer._bounds,n=this.options.weight,o=new ae(n,n);if(e=new ke(e.min.subtract(o),e.max.add(o)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(e))){if(this.options.noClip){this._parts=this._rings;return}for(var r=0,d=this._rings.length,v;re.y!=d.y>e.y&&e.x<(d.x-r.x)*(e.y-r.y)/(d.y-r.y)+r.x&&(n=!n);return n||Wt.prototype._containsPoint.call(this,e,!0)}});function ba(e,n){return new An(e,n)}var hn=fn.extend({initialize:function(e,n){F(this,n),this._layers={},e&&this.addData(e)},addData:function(e){var n=Le(e)?e:e.features,o,r,d;if(n){for(o=0,r=n.length;o0&&d.push(d[0].slice()),d}function tt(e,n){return e.feature?u({},e.feature,{geometry:n}):kn(n)}function kn(e){return e.type==="Feature"||e.type==="FeatureCollection"?e:{type:"Feature",properties:{},geometry:e}}var Di={toGeoJSON:function(e){return tt(this,{type:"Point",coordinates:Ps(this.getLatLng(),e)})}};Uo.include(Di),Ni.include(Di),hi.include(Di),Wt.include({toGeoJSON:function(e){var n=!wt(this._latlngs),o=Zo(this._latlngs,n?1:0,!1,e);return tt(this,{type:(n?"Multi":"")+"LineString",coordinates:o})}}),An.include({toGeoJSON:function(e){var n=!wt(this._latlngs),o=n&&!wt(this._latlngs[0]),r=Zo(this._latlngs,o?2:n?1:0,!0,e);return n||(r=[r]),tt(this,{type:(o?"Multi":"")+"Polygon",coordinates:r})}}),Vn.include({toMultiPoint:function(e){var n=[];return this.eachLayer(function(o){n.push(o.toGeoJSON(e).geometry.coordinates)}),tt(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 o=n==="GeometryCollection",r=[];return this.eachLayer(function(d){if(d.toGeoJSON){var v=d.toGeoJSON(e);if(o)r.push(v.geometry);else{var P=kn(v);P.type==="FeatureCollection"?r.push.apply(r,P.features):r.push(P)}}}),o?tt(this,{geometries:r,type:"GeometryCollection"}):{type:"FeatureCollection",features:r}}});function Ho(e,n){return new hn(e,n)}var gr=Ho,io=dn.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(e,n,o){this._url=e,this._bounds=lt(n),F(this,o)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(Ke(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){rt(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&&bn(this._image),this},bringToBack:function(){return this._map&&Ut(this._image),this},setUrl:function(e){return this._url=e,this._image&&(this._image.src=e),this},setBounds:function(e){return this._bounds=lt(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:at("img");if(Ke(n,"leaflet-image-layer"),this._zoomAnimated&&Ke(n,"leaflet-zoom-animated"),this.options.className&&Ke(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(),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),o=this._map._latLngBoundsToNewLayerBounds(this._bounds,e.zoom,e.center).min;ri(this._image,o,n)},_reset:function(){var e=this._image,n=new ke(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),o=n.getSize();At(e,n.min),e.style.width=o.x+"px",e.style.height=o.y+"px"},_updateOpacity:function(){ln(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()}}),vr=function(e,n,o){return new io(e,n,o)},oo=io.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:at("video");if(Ke(n,"leaflet-image-layer"),this._zoomAnimated&&Ke(n,"leaflet-zoom-animated"),this.options.className&&Ke(n,this.options.className),n.onselectstart=A,n.onmousemove=A,n.onloadeddata=h(this.fire,this,"load"),e){for(var o=n.getElementsByTagName("source"),r=[],d=0;d0?r:[n.src];return}Le(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 v=0;vd?(n.height=d+"px",Ke(e,v)):Mt(e,v),this._containerWidth=this._container.offsetWidth},_animateZoom:function(e){var n=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center),o=this._getAnchor();At(this._container,n.add(o))},_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(ai(this._container,"marginBottom"),10)||0,o=this._container.offsetHeight+n,r=this._containerWidth,d=new ae(this._containerLeft,-o-this._containerBottom);d._add(et(this._container));var v=e.layerPointToContainerPoint(d),P=te(this.options.autoPanPadding),$=te(this.options.autoPanPaddingTopLeft||P),D=te(this.options.autoPanPaddingBottomRight||P),X=e.getSize(),_e=0,Be=0;v.x+r+D.x>X.x&&(_e=v.x+r-X.x+D.x),v.x-_e-$.x<0&&(_e=v.x-$.x),v.y+o+D.y>X.y&&(Be=v.y+o-X.y+D.y),v.y-Be-$.y<0&&(Be=v.y-$.y),(_e||Be)&&(this.options.keepInView&&(this._autopanning=!0),e.fire("autopanstart").panBy([_e,Be]))}},_getAnchor:function(){return te(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Cs=function(e,n){return new En(e,n)};Xe.mergeOptions({closePopupOnClick:!0}),Xe.include({openPopup:function(e,n,o){return this._initOverlay(En,e,n,o).openOn(this),this},closePopup:function(e){return e=arguments.length?e:this._popup,e&&e.close(),this}}),dn.include({bindPopup:function(e,n){return this._popup=this._initOverlay(En,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 fn||(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)){ci(e);var n=e.layer||e.target;if(this._popup._source===n&&!(n instanceof Gn)){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 lo=Ot.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(e){Ot.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){Ot.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=Ot.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=at("div",n),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+y(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(e){var n,o,r=this._map,d=this._container,v=r.latLngToContainerPoint(r.getCenter()),P=r.layerPointToContainerPoint(e),$=this.options.direction,D=d.offsetWidth,X=d.offsetHeight,_e=te(this.options.offset),Be=this._getAnchor();$==="top"?(n=D/2,o=X):$==="bottom"?(n=D/2,o=0):$==="center"?(n=D/2,o=X/2):$==="right"?(n=0,o=X/2):$==="left"?(n=D,o=X/2):P.xthis.options.maxZoom||or?this._retainParent(d,v,P,r):!1)},_retainChildren:function(e,n,o,r){for(var d=2*e;d<2*e+2;d++)for(var v=2*n;v<2*n+2;v++){var P=new ae(d,v);P.z=o+1;var $=this._tileCoordsToKey(P),D=this._tiles[$];if(D&&D.active){D.retain=!0;continue}else D&&D.loaded&&(D.retain=!0);o+1this.options.maxZoom||this.options.minZoom!==void 0&&d1){this._setView(e,o);return}for(var Be=d.min.y;Be<=d.max.y;Be++)for(var nt=d.min.x;nt<=d.max.x;nt++){var tn=new ae(nt,Be);if(tn.z=this._tileZoom,!!this._isValidTile(tn)){var Rt=this._tiles[this._tileCoordsToKey(tn)];Rt?Rt.current=!0:P.push(tn)}}if(P.sort(function(pn,Wo){return pn.distanceTo(v)-Wo.distanceTo(v)}),P.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var On=document.createDocumentFragment();for(nt=0;nto.max.x)||!n.wrapLat&&(e.yo.max.y))return!1}if(!this.options.bounds)return!0;var r=this._tileCoordsToBounds(e);return lt(this.options.bounds).overlaps(r)},_keyToBounds:function(e){return this._tileCoordsToBounds(this._keyToTileCoords(e))},_tileCoordsToNwSe:function(e){var n=this._map,o=this.getTileSize(),r=e.scaleBy(o),d=r.add(o),v=n.unproject(r,e.z),P=n.unproject(d,e.z);return[v,P]},_tileCoordsToBounds:function(e){var n=this._tileCoordsToNwSe(e),o=new ht(n[0],n[1]);return this.options.noWrap||(o=this._map.wrapLatLngBounds(o)),o},_tileCoordsToKey:function(e){return e.x+":"+e.y+":"+e.z},_keyToTileCoords:function(e){var n=e.split(":"),o=new ae(+n[0],+n[1]);return o.z=+n[2],o},_removeTile:function(e){var n=this._tiles[e];n&&(rt(n.el),delete this._tiles[e],this.fire("tileunload",{tile:n.el,coords:this._keyToTileCoords(e)}))},_initTile:function(e){Ke(e,"leaflet-tile");var n=this.getTileSize();e.style.width=n.x+"px",e.style.height=n.y+"px",e.onselectstart=A,e.onmousemove=A,ve.ielt9&&this.options.opacity<1&&ln(e,this.options.opacity)},_addTile:function(e,n){var o=this._getTilePos(e),r=this._tileCoordsToKey(e),d=this.createTile(this._wrapCoords(e),h(this._tileReady,this,e));this._initTile(d),this.createTile.length<2&&ze(h(this._tileReady,this,e,null,d)),At(d,o),this._tiles[r]={el:d,coords:e,current:!0},n.appendChild(d),this.fire("tileloadstart",{tile:d,coords:e})},_tileReady:function(e,n,o){n&&this.fire("tileerror",{error:n,tile:o,coords:e});var r=this._tileCoordsToKey(e);o=this._tiles[r],o&&(o.loaded=+new Date,this._map._fadeAnimated?(ln(o.el,0),ie(this._fadeFrame),this._fadeFrame=ze(this._updateOpacity,this)):(o.active=!0,this._pruneTiles()),n||(Ke(o.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:o.el,coords:e})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),ve.ielt9||!this._map._fadeAnimated?ze(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 ae(this._wrapX?T(e.x,this._wrapX):e.x,this._wrapY?T(e.y,this._wrapY):e.y);return n.z=e.z,n},_pxBoundsToTileRange:function(e){var n=this.getTileSize();return new ke(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 br(e){return new uo(e)}var Zn=uo.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=F(this,n),n.detectRetina&&ve.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 o=document.createElement("img");return $e(o,"load",h(this._tileOnLoad,this,n,o)),$e(o,"error",h(this._tileOnError,this,n,o)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(o.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(o.referrerPolicy=this.options.referrerPolicy),o.alt="",o.src=this.getTileUrl(e),o},getTileUrl:function(e){var n={r:ve.retina?"@2x":"",s:this._getSubdomain(e),x:e.x,y:e.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var o=this._globalTileRange.max.y-e.y;this.options.tms&&(n.y=o),n["-y"]=o}return Y(this._url,u(n,this.options))},_tileOnLoad:function(e,n){ve.ielt9?setTimeout(h(e,this,null,n),0):e(null,n)},_tileOnError:function(e,n,o){var r=this.options.errorTileUrl;r&&n.getAttribute("src")!==r&&(n.src=r),e(o,n)},_onTileRemove:function(e){e.tile.onload=null},_getZoomForUrl:function(){var e=this._tileZoom,n=this.options.maxZoom,o=this.options.zoomReverse,r=this.options.zoomOffset;return o&&(e=n-e),e+r},_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=A,n.onerror=A,!n.complete)){n.src=Ue;var o=this._tiles[e].coords;rt(n),delete this._tiles[e],this.fire("tileabort",{tile:n,coords:o})}},_removeTile:function(e){var n=this._tiles[e];if(n)return n.el.setAttribute("src",Ue),uo.prototype._removeTile.call(this,e)},_tileReady:function(e,n,o){if(!(!this._map||o&&o.getAttribute("src")===Ue))return uo.prototype._tileReady.call(this,e,n,o)}});function xa(e,n){return new Zn(e,n)}var bt=Zn.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 o=u({},this.defaultWmsParams);for(var r in n)r in this.options||(o[r]=n[r]);n=F(this,n);var d=n.detectRetina&&ve.retina?2:1,v=this.getTileSize();o.width=v.x*d,o.height=v.y*d,this.wmsParams=o},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,Zn.prototype.onAdd.call(this,e)},getTileUrl:function(e){var n=this._tileCoordsToNwSe(e),o=this._crs,r=De(o.project(n[0]),o.project(n[1])),d=r.min,v=r.max,P=(this._wmsVersion>=1.3&&this._crs===_a?[d.y,d.x,v.y,v.x]:[d.x,d.y,v.x,v.y]).join(","),$=Zn.prototype.getTileUrl.call(this,e);return $+pe(this.wmsParams,$,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+P},setParams:function(e,n){return u(this.wmsParams,e),n||this.redraw(),this}});function co(e,n){return new bt(e,n)}Zn.WMS=bt,xa.wms=co;var Sn=dn.extend({options:{padding:.1},initialize:function(e){F(this,e),y(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),Ke(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 o=this._map.getZoomScale(n,this._zoom),r=this._map.getSize().multiplyBy(.5+this.options.padding),d=this._map.project(this._center,n),v=r.multiplyBy(-o).add(d).subtract(this._map._getNewPixelOrigin(e,n));ve.any3d?ri(this._container,v,o):At(this._container,v)},_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(),o=this._map.containerPointToLayerPoint(n.multiplyBy(-e)).round();this._bounds=new ke(o,o.add(n.multiplyBy(1+e*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),jo=Sn.extend({options:{tolerance:0},getEvents:function(){var e=Sn.prototype.getEvents.call(this);return e.viewprereset=this._onViewPreReset,e},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Sn.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var e=this._container=document.createElement("canvas");$e(e,"mousemove",this._onMouseMove,this),$e(e,"click dblclick mousedown mouseup contextmenu",this._onClick,this),$e(e,"mouseout",this._handleMouseOut,this),e._leaflet_disable_events=!0,this._ctx=e.getContext("2d")},_destroyContainer:function(){ie(this._redrawRequest),delete this._ctx,rt(this._container),Qe(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)){Sn.prototype._update.call(this);var e=this._bounds,n=this._container,o=e.getSize(),r=ve.retina?2:1;At(n,e.min),n.width=r*o.x,n.height=r*o.y,n.style.width=o.x+"px",n.style.height=o.y+"px",ve.retina&&this._ctx.scale(2,2),this._ctx.translate(-e.min.x,-e.min.y),this.fire("update")}},_reset:function(){Sn.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,o=n.next,r=n.prev;o?o.prev=r:this._drawLast=r,r?r.next=o:this._drawFirst=o,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(/[, ]+/),o=[],r,d;for(d=0;d')}}catch{}return function(e){return document.createElement("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}})(),g={_initContainer:function(){this._container=at("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Sn.prototype._update.call(this),this.fire("update"))},_initPath:function(e){var n=e._container=fo("shape");Ke(n,"leaflet-vml-shape "+(this.options.className||"")),n.coordsize="1 1",e._path=fo("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;rt(n),e.removeInteractiveTarget(n),delete this._layers[y(e)]},_updateStyle:function(e){var n=e._stroke,o=e._fill,r=e.options,d=e._container;d.stroked=!!r.stroke,d.filled=!!r.fill,r.stroke?(n||(n=e._stroke=fo("stroke")),d.appendChild(n),n.weight=r.weight+"px",n.color=r.color,n.opacity=r.opacity,r.dashArray?n.dashStyle=Le(r.dashArray)?r.dashArray.join(" "):r.dashArray.replace(/( *, *)/g," "):n.dashStyle="",n.endcap=r.lineCap.replace("butt","flat"),n.joinstyle=r.lineJoin):n&&(d.removeChild(n),e._stroke=null),r.fill?(o||(o=e._fill=fo("fill")),d.appendChild(o),o.color=r.fillColor||r.color,o.opacity=r.fillOpacity):o&&(d.removeChild(o),e._fill=null)},_updateCircle:function(e){var n=e._point.round(),o=Math.round(e._radius),r=Math.round(e._radiusY||o);this._setPath(e,e._empty()?"M0 0":"AL "+n.x+","+n.y+" "+o+","+r+" 0,"+65535*360)},_setPath:function(e,n){e._path.v=n},_bringToFront:function(e){bn(e._container)},_bringToBack:function(e){Ut(e._container)}},c=ve.vml?fo:G,V=Sn.extend({_initContainer:function(){this._container=c("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=c("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){rt(this._container),Qe(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Sn.prototype._update.call(this);var e=this._bounds,n=e.getSize(),o=this._container;(!this._svgSize||!this._svgSize.equals(n))&&(this._svgSize=n,o.setAttribute("width",n.x),o.setAttribute("height",n.y)),At(o,e.min),o.setAttribute("viewBox",[e.min.x,e.min.y,n.x,n.y].join(" ")),this.fire("update")}},_initPath:function(e){var n=e._path=c("path");e.options.className&&Ke(n,e.options.className),e.options.interactive&&Ke(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){rt(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,o=e.options;n&&(o.stroke?(n.setAttribute("stroke",o.color),n.setAttribute("stroke-opacity",o.opacity),n.setAttribute("stroke-width",o.weight),n.setAttribute("stroke-linecap",o.lineCap),n.setAttribute("stroke-linejoin",o.lineJoin),o.dashArray?n.setAttribute("stroke-dasharray",o.dashArray):n.removeAttribute("stroke-dasharray"),o.dashOffset?n.setAttribute("stroke-dashoffset",o.dashOffset):n.removeAttribute("stroke-dashoffset")):n.setAttribute("stroke","none"),o.fill?(n.setAttribute("fill",o.fillColor||o.color),n.setAttribute("fill-opacity",o.fillOpacity),n.setAttribute("fill-rule",o.fillRule||"evenodd")):n.setAttribute("fill","none"))},_updatePoly:function(e,n){this._setPath(e,K(e._parts,n))},_updateCircle:function(e){var n=e._point,o=Math.max(Math.round(e._radius),1),r=Math.max(Math.round(e._radiusY),1)||o,d="a"+o+","+r+" 0 1,0 ",v=e._empty()?"M0 0":"M"+(n.x-o)+","+n.y+d+o*2+",0 "+d+-o*2+",0 ";this._setPath(e,v)},_setPath:function(e,n){e._path.setAttribute("d",n)},_bringToFront:function(e){bn(e._path)},_bringToBack:function(e){Ut(e._path)}});ve.vml&&V.include(g);function w(e){return ve.svg||ve.vml?new V(e):null}Xe.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&&wa(e)||w(e)}});var He=An.extend({initialize:function(e,n){An.prototype.initialize.call(this,this._boundsToLatLngs(e),n)},setBounds:function(e){return this.setLatLngs(this._boundsToLatLngs(e))},_boundsToLatLngs:function(e){return e=lt(e),[e.getSouthWest(),e.getNorthWest(),e.getNorthEast(),e.getSouthEast()]}});function id(e,n){return new He(e,n)}V.create=c,V.pointsToPath=K,hn.geometryToLayer=qn,hn.coordsToLatLng=Yn,hn.coordsToLatLngs=pi,hn.latLngToCoords=Ps,hn.latLngsToCoords=Zo,hn.getFeature=tt,hn.asFeature=kn,Xe.mergeOptions({boxZoom:!0});var _l=xn.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(){$e(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Qe(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){rt(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(),Ln(),Ci(),this._startPoint=this._map.mouseEventToContainerPoint(e),$e(document,{contextmenu:ci,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(e){this._moved||(this._moved=!0,this._box=at("div","leaflet-zoom-box",this._container),Ke(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(e);var n=new ke(this._point,this._startPoint),o=n.getSize();At(this._box,n.min),this._box.style.width=o.x+"px",this._box.style.height=o.y+"px"},_finish:function(){this._moved&&(rt(this._box),Mt(this._container,"leaflet-crosshair")),li(),Li(),Qe(document,{contextmenu:ci,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 ht(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())}});Xe.addInitHook("addHandler","boxZoom",_l),Xe.mergeOptions({doubleClickZoom:!0});var bl=xn.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,o=n.getZoom(),r=n.options.zoomDelta,d=e.originalEvent.shiftKey?o-r:o+r;n.options.doubleClickZoom==="center"?n.setZoom(d):n.setZoomAround(e.containerPoint,d)}});Xe.addInitHook("addHandler","doubleClickZoom",bl),Xe.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var yl=xn.extend({addHooks:function(){if(!this._draggable){var e=this._map;this._draggable=new cn(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))}Ke(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){Mt(this._map._container,"leaflet-grab"),Mt(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=lt(this._map.options.maxBounds);this._offsetLimit=De(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,o=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(o),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),o=this._initialWorldOffset,r=this._draggable._newPos.x,d=(r-n+o)%e+n-o,v=(r+n+o)%e-n-o,P=Math.abs(d+o)0?v:-v))-n;this._delta=0,this._startTime=null,P&&(e.options.scrollWheelZoom==="center"?e.setZoom(n+P):e.setZoomAround(this._lastMousePos,n+P))}});Xe.addInitHook("addHandler","scrollWheelZoom",wl);var od=600;Xe.mergeOptions({tapHold:ve.touchNative&&ve.safari&&ve.mobile,tapTolerance:15});var kl=xn.extend({addHooks:function(){$e(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Qe(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 ae(n.clientX,n.clientY),this._holdTimeout=setTimeout(h(function(){this._cancel(),this._isTapValid()&&($e(document,"touchend",It),$e(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",n))},this),od),$e(document,"touchend touchcancel contextmenu",this._cancel,this),$e(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function e(){Qe(document,"touchend",It),Qe(document,"touchend touchcancel",e)},_cancel:function(){clearTimeout(this._holdTimeout),Qe(document,"touchend touchcancel contextmenu",this._cancel,this),Qe(document,"touchmove",this._onMove,this)},_onMove:function(e){var n=e.touches[0];this._newPos=new ae(n.clientX,n.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(e,n){var o=new MouseEvent(e,{bubbles:!0,cancelable:!0,view:window,screenX:n.screenX,screenY:n.screenY,clientX:n.clientX,clientY:n.clientY});o._simulated=!0,n.target.dispatchEvent(o)}});Xe.addInitHook("addHandler","tapHold",kl),Xe.mergeOptions({touchZoom:ve.touch,bounceAtZoomLimits:!0});var Sl=xn.extend({addHooks:function(){Ke(this._map._container,"leaflet-touch-zoom"),$e(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){Mt(this._map._container,"leaflet-touch-zoom"),Qe(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 o=n.mouseEventToContainerPoint(e.touches[0]),r=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(o.add(r)._divideBy(2))),this._startDist=o.distanceTo(r),this._startZoom=n.getZoom(),this._moved=!1,this._zooming=!0,n._stop(),$e(document,"touchmove",this._onTouchMove,this),$e(document,"touchend touchcancel",this._onTouchEnd,this),It(e)}},_onTouchMove:function(e){if(!(!e.touches||e.touches.length!==2||!this._zooming)){var n=this._map,o=n.mouseEventToContainerPoint(e.touches[0]),r=n.mouseEventToContainerPoint(e.touches[1]),d=o.distanceTo(r)/this._startDist;if(this._zoom=n.getScaleZoom(d,this._startZoom),!n.options.bounceAtZoomLimits&&(this._zoomn.getMaxZoom()&&d>1)&&(this._zoom=n._limitZoom(this._zoom)),n.options.touchZoom==="center"){if(this._center=this._startLatLng,d===1)return}else{var v=o._add(r)._divideBy(2)._subtract(this._centerPoint);if(d===1&&v.x===0&&v.y===0)return;this._center=n.unproject(n.project(this._pinchStartLatLng,this._zoom).subtract(v),this._zoom)}this._moved||(n._moveStart(!0,!1),this._moved=!0),ie(this._animRequest);var P=h(n._move,n,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=ze(P,this,!0),It(e)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,ie(this._animRequest),Qe(document,"touchmove",this._onTouchMove,this),Qe(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))}});Xe.addInitHook("addHandler","touchZoom",Sl),Xe.BoxZoom=_l,Xe.DoubleClickZoom=bl,Xe.Drag=yl,Xe.Keyboard=xl,Xe.ScrollWheelZoom=wl,Xe.TapHold=kl,Xe.TouchZoom=Sl,s.Bounds=ke,s.Browser=ve,s.CRS=E,s.Canvas=jo,s.Circle=Ni,s.CircleMarker=hi,s.Class=oe,s.Control=jt,s.DivIcon=Ls,s.DivOverlay=Ot,s.DomEvent=Oi,s.DomUtil=yn,s.Draggable=cn,s.Evented=ce,s.FeatureGroup=fn,s.GeoJSON=hn,s.GridLayer=uo,s.Handler=xn,s.Icon=$i,s.ImageOverlay=io,s.LatLng=Ve,s.LatLngBounds=ht,s.Layer=dn,s.LayerGroup=Vn,s.LineUtil=dr,s.Map=Xe,s.Marker=Uo,s.Mixin=rr,s.Path=Gn,s.Point=ae,s.PolyUtil=lr,s.Polygon=An,s.Polyline=Wt,s.Popup=En,s.PosAnimation=Yi,s.Projection=fr,s.Rectangle=He,s.Renderer=Sn,s.SVG=V,s.SVGOverlay=ao,s.TileLayer=Zn,s.Tooltip=lo,s.Transformation=Pt,s.Util=je,s.VideoOverlay=oo,s.bind=h,s.bounds=De,s.canvas=wa,s.circle=$t,s.circleMarker=no,s.control=en,s.divIcon=ya,s.extend=u,s.featureGroup=Ss,s.geoJSON=Ho,s.geoJson=gr,s.gridLayer=br,s.icon=pr,s.imageOverlay=vr,s.latLng=J,s.latLngBounds=lt,s.layerGroup=eo,s.map=Do,s.marker=mr,s.point=te,s.polygon=ba,s.polyline=Vo,s.popup=Cs,s.rectangle=id,s.setOptions=F,s.stamp=y,s.svg=w,s.svgOverlay=ro,s.tileLayer=xa,s.tooltip=_r,s.transformation=x,s.version=l,s.videoOverlay=so;var sd=window.L;s.noConflict=function(){return window.L=sd,this},window.L=s}))})(Ns,Ns.exports)),Ns.exports}var um=lm();const Ri=am(um),Pu={__name:"DeviceMap",props:{position:{type:Object,default:null},trail:{type:Array,default:()=>[]},aircraft:{type:Array,default:()=>[]}},setup(t){const i=t,s=Z(null);let l,u,f,h;const _=new Map;function y(j,F){const pe=getComputedStyle(document.documentElement).getPropertyValue("--accent").trim()||"#3D7BF0",me=F?"#8a94a6":pe,Y=typeof j=="number"?j:0;return Ri.divIcon({className:"plane-marker",iconSize:[22,22],iconAnchor:[11,11],html:``})}function C(j){const pe=[`${j.callsign||j.icao24||"aircraft"}`];return j.country&&pe.push(j.country),typeof j.altitude=="number"&&pe.push(`${Math.round(j.altitude)} m`),typeof j.velocity=="number"&&pe.push(`${Math.round(j.velocity*3.6)} km/h`),j.onGround&&pe.push("on ground"),pe.join(" · ")}function T(){if(!l)return;h||(h=Ri.layerGroup().addTo(l));const j=new Set;for(const F of i.aircraft){if(typeof F.lat!="number"||typeof F.lng!="number")continue;j.add(F.icao24);const pe=[F.lat,F.lng];let me=_.get(F.icao24);me?(me.setLatLng(pe),me.setIcon(y(F.heading,F.onGround)),me.setTooltipContent(C(F))):(me=Ri.marker(pe,{icon:y(F.heading,F.onGround)}).bindTooltip(C(F)),me.addTo(h),_.set(F.icao24,me))}for(const[F,pe]of _)j.has(F)||(h.removeLayer(pe),_.delete(F))}function A(){if(!l)return;const j=i.position;if(j&&(j.lat||j.lng)){const F=[j.lat,j.lng];u?u.setLatLng(F):(u=Ri.marker(F).addTo(l),l.setView(F,17))}if(f&&f.remove(),i.trail.length){const F=getComputedStyle(document.documentElement).getPropertyValue("--accent").trim()||"#3D7BF0";f=Ri.polyline(i.trail,{color:F,weight:3}).addTo(l)}}ki(()=>{l=Ri.map(s.value,{zoomControl:!0}).setView([20,0],2),Ri.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:"© OpenStreetMap",maxZoom:19}).addTo(l),setTimeout(()=>l.invalidateSize(),60),A(),T(),(!i.position||!i.position.lat&&!i.position.lng)&&i.aircraft.length&&B()});let R=!1;function B(){if(R||!l||!i.aircraft.length)return;const j=i.aircraft.filter(F=>typeof F.lat=="number"&&typeof F.lng=="number").map(F=>[F.lat,F.lng]);j.length&&(l.fitBounds(Ri.latLngBounds(j).pad(.2)),R=!0)}return os(()=>{l&&l.remove(),l=null}),Nt(()=>i.position,A,{deep:!0}),Nt(()=>i.trail,A,{deep:!0}),Nt(()=>i.aircraft,()=>{T(),(!i.position||!i.position.lat&&!i.position.lng)&&B()},{deep:!0}),(j,F)=>(p(),m("div",{ref_key:"el",ref:s,class:"h-[320px] w-full rounded-lg"},null,512))}},cm=["width","height","stroke-width"],dm=["d"],W={__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",eye:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7z M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",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,f)=>f?"M"+u:u);return(u,f)=>(p(),m("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"},[(p(!0),m(le,null,Re(Oe(l),(h,_)=>(p(),m("path",{key:_,d:h},null,8,dm))),128))],8,cm))}},fm=["aria-checked","disabled"],Kt={__name:"Toggle",props:{modelValue:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:i}){const s=i;return(l,u)=>(p(),m("button",{type:"button",role:"switch","aria-checked":t.modelValue,disabled:t.disabled,class:Ae(["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]=f=>s("update:modelValue",!t.modelValue))},[a("span",{class:Ae(["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,fm))}},hm={class:"inline-flex rounded-[10px] border border-line bg-surface-2 p-0.5"},pm=["onClick"],mn={__name:"Segmented",props:{modelValue:{type:[String,Number],default:""},options:{type:Array,default:()=>[]}},emits:["update:modelValue"],setup(t,{emit:i}){const s=i;return(l,u)=>(p(),m("div",hm,[(p(!0),m(le,null,Re(t.options,f=>(p(),m("button",{key:f.value,type:"button",class:Ae(["inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-[13px] font-semibold transition",t.modelValue===f.value?"bg-surface-1 text-ink shadow-xs":"text-ink-secondary hover:text-ink"]),onClick:h=>s("update:modelValue",f.value)},[f.icon?(p(),ot(W,{key:0,name:f.icon,size:15},null,8,["name"])):N("",!0),z(" "+k(f.label),1)],10,pm))),128))]))}},mm={class:"text-sm font-semibold text-ink"},gm={key:0,class:"mt-0.5 text-xs text-ink-muted"},Se={__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,s=Bs("settingsSearch",{value:""}),l=he(()=>{const u=(s.value||"").trim().toLowerCase();return u?`${i.title} ${i.desc} ${i.keywords}`.toLowerCase().includes(u):!0});return(u,f)=>l.value?(p(),m("div",{key:0,class:Ae(["border-b border-line py-4 last:border-0",t.block?"":"flex items-center justify-between gap-6"])},[a("div",{class:Ae(t.block?"mb-3":"min-w-0")},[a("div",mm,k(t.title),1),t.desc?(p(),m("div",gm,k(t.desc),1)):N("",!0)],2),a("div",{class:Ae(t.block?"":"shrink-0")},[Tf(u.$slots,"default")],2)],2)):N("",!0)}},ta=[{code:"AL",name:"Albania",continent:"EU",bbox:"39.6,19.3,42.7,21.1"},{code:"AD",name:"Andorra",continent:"EU",bbox:"42.4,1.4,42.7,1.8"},{code:"AT",name:"Austria",continent:"EU",bbox:"46.4,9.5,49.0,17.2"},{code:"BY",name:"Belarus",continent:"EU",bbox:"51.2,23.2,56.2,32.8"},{code:"BE",name:"Belgium",continent:"EU",bbox:"49.5,2.5,51.5,6.4"},{code:"BA",name:"Bosnia and Herzegovina",continent:"EU",bbox:"42.6,15.7,45.3,19.6"},{code:"BG",name:"Bulgaria",continent:"EU",bbox:"41.2,22.4,44.2,28.6"},{code:"HR",name:"Croatia",continent:"EU",bbox:"42.4,13.5,46.6,19.4"},{code:"CY",name:"Cyprus",continent:"EU",bbox:"34.6,32.3,35.7,34.6"},{code:"CZ",name:"Czechia",continent:"EU",bbox:"48.6,12.1,51.1,18.9"},{code:"DK",name:"Denmark",continent:"EU",bbox:"54.6,8.1,57.8,12.7"},{code:"EE",name:"Estonia",continent:"EU",bbox:"57.5,21.8,59.7,28.2"},{code:"FI",name:"Finland",continent:"EU",bbox:"59.8,20.6,70.1,31.6"},{code:"FR",name:"France",continent:"EU",bbox:"41.3,-5.2,51.1,9.6"},{code:"DE",name:"Germany",continent:"EU",bbox:"47.2,5.8,55.1,15.1"},{code:"GR",name:"Greece",continent:"EU",bbox:"34.8,19.4,41.8,28.3"},{code:"HU",name:"Hungary",continent:"EU",bbox:"45.7,16.1,48.6,22.9"},{code:"IS",name:"Iceland",continent:"EU",bbox:"63.3,-24.6,66.6,-13.5"},{code:"IE",name:"Ireland",continent:"EU",bbox:"51.4,-10.6,55.4,-6.0"},{code:"IT",name:"Italy",continent:"EU",bbox:"36.6,6.6,47.1,18.6"},{code:"XK",name:"Kosovo",continent:"EU",bbox:"41.8,20.0,43.3,21.8"},{code:"LV",name:"Latvia",continent:"EU",bbox:"55.7,20.9,58.1,28.2"},{code:"LI",name:"Liechtenstein",continent:"EU",bbox:"47.0,9.4,47.3,9.6"},{code:"LT",name:"Lithuania",continent:"EU",bbox:"53.9,20.9,56.5,26.9"},{code:"LU",name:"Luxembourg",continent:"EU",bbox:"49.4,5.7,50.2,6.5"},{code:"MT",name:"Malta",continent:"EU",bbox:"35.8,14.1,36.1,14.6"},{code:"MD",name:"Moldova",continent:"EU",bbox:"45.4,26.6,48.5,30.2"},{code:"MC",name:"Monaco",continent:"EU",bbox:"43.72,7.40,43.75,7.44"},{code:"ME",name:"Montenegro",continent:"EU",bbox:"41.8,18.4,43.6,20.4"},{code:"NL",name:"Netherlands",continent:"EU",bbox:"50.7,3.3,53.7,7.2"},{code:"MK",name:"North Macedonia",continent:"EU",bbox:"40.8,20.4,42.4,23.0"},{code:"NO",name:"Norway",continent:"EU",bbox:"57.9,4.6,71.2,31.1"},{code:"PL",name:"Poland",continent:"EU",bbox:"49.0,14.1,54.9,24.2"},{code:"PT",name:"Portugal",continent:"EU",bbox:"36.9,-9.5,42.2,-6.2"},{code:"RO",name:"Romania",continent:"EU",bbox:"43.6,20.2,48.3,29.7"},{code:"SM",name:"San Marino",continent:"EU",bbox:"43.89,12.40,43.99,12.52"},{code:"RS",name:"Serbia",continent:"EU",bbox:"42.2,18.8,46.2,23.0"},{code:"SK",name:"Slovakia",continent:"EU",bbox:"47.7,16.8,49.6,22.6"},{code:"SI",name:"Slovenia",continent:"EU",bbox:"45.4,13.4,46.9,16.6"},{code:"ES",name:"Spain",continent:"EU",bbox:"35.9,-9.4,43.8,3.4"},{code:"SE",name:"Sweden",continent:"EU",bbox:"55.3,11.1,69.1,24.2"},{code:"CH",name:"Switzerland",continent:"EU",bbox:"45.8,5.9,47.8,10.5"},{code:"UA",name:"Ukraine",continent:"EU",bbox:"44.4,22.1,52.4,40.2"},{code:"GB",name:"United Kingdom",continent:"EU",bbox:"49.9,-8.7,60.9,1.8"},{code:"VA",name:"Vatican City",continent:"EU",bbox:"41.900,12.445,41.908,12.458"},{code:"RU",name:"Russia",continent:"EU",bbox:"41.2,19.6,81.9,180"},{code:"TR",name:"Turkey",continent:"EU",bbox:"35.8,25.7,42.3,44.8"},{code:"AF",name:"Afghanistan",continent:"AS",bbox:"29.4,60.5,38.5,74.9"},{code:"AM",name:"Armenia",continent:"AS",bbox:"38.8,43.4,41.3,46.6"},{code:"AZ",name:"Azerbaijan",continent:"AS",bbox:"38.4,44.8,41.9,50.4"},{code:"BH",name:"Bahrain",continent:"AS",bbox:"25.8,50.4,26.3,50.7"},{code:"BD",name:"Bangladesh",continent:"AS",bbox:"20.7,88.0,26.6,92.7"},{code:"BT",name:"Bhutan",continent:"AS",bbox:"26.7,88.7,28.3,92.1"},{code:"BN",name:"Brunei",continent:"AS",bbox:"4.0,114.0,5.1,115.4"},{code:"KH",name:"Cambodia",continent:"AS",bbox:"10.4,102.3,14.7,107.6"},{code:"CN",name:"China",continent:"AS",bbox:"18.2,73.5,53.6,134.8"},{code:"GE",name:"Georgia",continent:"AS",bbox:"41.0,40.0,43.6,46.7"},{code:"IN",name:"India",continent:"AS",bbox:"6.7,68.1,35.5,97.4"},{code:"ID",name:"Indonesia",continent:"AS",bbox:"-11.0,95.0,6.1,141.0"},{code:"IR",name:"Iran",continent:"AS",bbox:"25.0,44.0,39.8,63.3"},{code:"IQ",name:"Iraq",continent:"AS",bbox:"29.1,38.8,37.4,48.6"},{code:"IL",name:"Israel",continent:"AS",bbox:"29.5,34.2,33.3,35.9"},{code:"JP",name:"Japan",continent:"AS",bbox:"24.0,122.9,45.5,145.8"},{code:"JO",name:"Jordan",continent:"AS",bbox:"29.2,34.9,33.4,39.3"},{code:"KZ",name:"Kazakhstan",continent:"AS",bbox:"40.6,46.5,55.4,87.3"},{code:"KW",name:"Kuwait",continent:"AS",bbox:"28.5,46.5,30.1,48.4"},{code:"KG",name:"Kyrgyzstan",continent:"AS",bbox:"39.2,69.3,43.3,80.3"},{code:"LA",name:"Laos",continent:"AS",bbox:"13.9,100.1,22.5,107.7"},{code:"LB",name:"Lebanon",continent:"AS",bbox:"33.0,35.1,34.7,36.6"},{code:"MY",name:"Malaysia",continent:"AS",bbox:"0.9,99.6,7.4,119.3"},{code:"MV",name:"Maldives",continent:"AS",bbox:"-0.7,72.7,7.1,73.7"},{code:"MN",name:"Mongolia",continent:"AS",bbox:"41.6,87.7,52.1,119.9"},{code:"MM",name:"Myanmar",continent:"AS",bbox:"9.8,92.2,28.5,101.2"},{code:"NP",name:"Nepal",continent:"AS",bbox:"26.3,80.1,30.4,88.2"},{code:"KP",name:"North Korea",continent:"AS",bbox:"37.7,124.2,43.0,130.7"},{code:"OM",name:"Oman",continent:"AS",bbox:"16.6,52.0,26.4,59.8"},{code:"PK",name:"Pakistan",continent:"AS",bbox:"23.7,60.9,37.1,77.8"},{code:"PH",name:"Philippines",continent:"AS",bbox:"4.6,116.9,21.1,126.6"},{code:"QA",name:"Qatar",continent:"AS",bbox:"24.5,50.7,26.2,51.6"},{code:"SA",name:"Saudi Arabia",continent:"AS",bbox:"16.4,34.6,32.2,55.7"},{code:"SG",name:"Singapore",continent:"AS",bbox:"1.2,103.6,1.5,104.1"},{code:"KR",name:"South Korea",continent:"AS",bbox:"33.1,125.9,38.6,129.6"},{code:"LK",name:"Sri Lanka",continent:"AS",bbox:"5.9,79.7,9.8,81.9"},{code:"SY",name:"Syria",continent:"AS",bbox:"32.3,35.7,37.3,42.4"},{code:"TW",name:"Taiwan",continent:"AS",bbox:"21.9,120.0,25.3,122.0"},{code:"TJ",name:"Tajikistan",continent:"AS",bbox:"36.7,67.4,41.0,75.2"},{code:"TH",name:"Thailand",continent:"AS",bbox:"5.6,97.3,20.5,105.6"},{code:"TL",name:"Timor-Leste",continent:"AS",bbox:"-9.5,124.0,-8.1,127.3"},{code:"TM",name:"Turkmenistan",continent:"AS",bbox:"35.1,52.4,42.8,66.7"},{code:"AE",name:"United Arab Emirates",continent:"AS",bbox:"22.6,51.5,26.1,56.4"},{code:"UZ",name:"Uzbekistan",continent:"AS",bbox:"37.2,55.9,45.6,73.1"},{code:"VN",name:"Vietnam",continent:"AS",bbox:"8.2,102.1,23.4,109.5"},{code:"YE",name:"Yemen",continent:"AS",bbox:"12.1,42.5,19.0,54.5"},{code:"DZ",name:"Algeria",continent:"AF",bbox:"18.9,-8.7,37.1,12.0"},{code:"AO",name:"Angola",continent:"AF",bbox:"-18.0,11.6,-4.4,24.1"},{code:"BJ",name:"Benin",continent:"AF",bbox:"6.2,0.8,12.4,3.9"},{code:"BW",name:"Botswana",continent:"AF",bbox:"-26.9,20.0,-17.8,29.4"},{code:"BF",name:"Burkina Faso",continent:"AF",bbox:"9.4,-5.5,15.1,2.4"},{code:"BI",name:"Burundi",continent:"AF",bbox:"-4.5,29.0,-2.3,30.8"},{code:"CV",name:"Cabo Verde",continent:"AF",bbox:"14.8,-25.4,17.2,-22.7"},{code:"CM",name:"Cameroon",continent:"AF",bbox:"1.7,8.5,13.1,16.2"},{code:"CF",name:"Central African Republic",continent:"AF",bbox:"2.2,14.4,11.0,27.5"},{code:"TD",name:"Chad",continent:"AF",bbox:"7.4,13.5,23.4,24.0"},{code:"KM",name:"Comoros",continent:"AF",bbox:"-12.4,43.2,-11.4,44.5"},{code:"CG",name:"Congo",continent:"AF",bbox:"-5.0,11.1,3.7,18.6"},{code:"CD",name:"DR Congo",continent:"AF",bbox:"-13.5,12.2,5.4,31.3"},{code:"DJ",name:"Djibouti",continent:"AF",bbox:"10.9,41.7,12.7,43.4"},{code:"EG",name:"Egypt",continent:"AF",bbox:"22.0,25.0,31.7,36.9"},{code:"GQ",name:"Equatorial Guinea",continent:"AF",bbox:"0.9,9.3,3.8,11.4"},{code:"ER",name:"Eritrea",continent:"AF",bbox:"12.4,36.4,18.0,43.1"},{code:"SZ",name:"Eswatini",continent:"AF",bbox:"-27.3,30.8,-25.7,32.1"},{code:"ET",name:"Ethiopia",continent:"AF",bbox:"3.4,33.0,14.9,48.0"},{code:"GA",name:"Gabon",continent:"AF",bbox:"-4.0,8.7,2.3,14.5"},{code:"GM",name:"Gambia",continent:"AF",bbox:"13.1,-16.8,13.8,-13.8"},{code:"GH",name:"Ghana",continent:"AF",bbox:"4.7,-3.3,11.2,1.2"},{code:"GN",name:"Guinea",continent:"AF",bbox:"7.2,-15.1,12.7,-7.6"},{code:"GW",name:"Guinea-Bissau",continent:"AF",bbox:"10.9,-16.7,12.7,-13.6"},{code:"CI",name:"Ivory Coast",continent:"AF",bbox:"4.4,-8.6,10.7,-2.5"},{code:"KE",name:"Kenya",continent:"AF",bbox:"-4.7,33.9,5.5,41.9"},{code:"LS",name:"Lesotho",continent:"AF",bbox:"-30.7,27.0,-28.6,29.5"},{code:"LR",name:"Liberia",continent:"AF",bbox:"4.3,-11.5,8.6,-7.4"},{code:"LY",name:"Libya",continent:"AF",bbox:"19.5,9.3,33.2,25.2"},{code:"MG",name:"Madagascar",continent:"AF",bbox:"-25.6,43.2,-11.9,50.5"},{code:"MW",name:"Malawi",continent:"AF",bbox:"-17.1,32.7,-9.4,35.9"},{code:"ML",name:"Mali",continent:"AF",bbox:"10.1,-12.3,25.0,4.3"},{code:"MR",name:"Mauritania",continent:"AF",bbox:"14.7,-17.1,27.3,-4.8"},{code:"MU",name:"Mauritius",continent:"AF",bbox:"-20.5,57.3,-19.9,57.8"},{code:"MA",name:"Morocco",continent:"AF",bbox:"27.7,-13.2,35.9,-1.0"},{code:"MZ",name:"Mozambique",continent:"AF",bbox:"-26.9,30.2,-10.5,40.8"},{code:"NA",name:"Namibia",continent:"AF",bbox:"-28.9,11.7,-16.9,25.3"},{code:"NE",name:"Niger",continent:"AF",bbox:"11.7,0.2,23.5,16.0"},{code:"NG",name:"Nigeria",continent:"AF",bbox:"4.3,2.7,13.9,14.7"},{code:"RW",name:"Rwanda",continent:"AF",bbox:"-2.8,28.9,-1.1,30.9"},{code:"SN",name:"Senegal",continent:"AF",bbox:"12.3,-17.5,16.7,-11.4"},{code:"SL",name:"Sierra Leone",continent:"AF",bbox:"6.9,-13.3,10.0,-10.3"},{code:"SO",name:"Somalia",continent:"AF",bbox:"-1.7,40.9,12.0,51.4"},{code:"ZA",name:"South Africa",continent:"AF",bbox:"-34.8,16.5,-22.1,32.9"},{code:"SS",name:"South Sudan",continent:"AF",bbox:"3.5,24.1,12.2,35.9"},{code:"SD",name:"Sudan",continent:"AF",bbox:"8.7,21.8,22.2,38.6"},{code:"TZ",name:"Tanzania",continent:"AF",bbox:"-11.7,29.3,-1.0,40.4"},{code:"TG",name:"Togo",continent:"AF",bbox:"6.1,-0.1,11.1,1.8"},{code:"TN",name:"Tunisia",continent:"AF",bbox:"30.2,7.5,37.5,11.6"},{code:"UG",name:"Uganda",continent:"AF",bbox:"-1.5,29.6,4.2,35.0"},{code:"ZM",name:"Zambia",continent:"AF",bbox:"-18.1,21.9,-8.2,33.7"},{code:"ZW",name:"Zimbabwe",continent:"AF",bbox:"-22.4,25.2,-15.6,33.1"},{code:"CA",name:"Canada",continent:"NA",bbox:"41.7,-141.0,83.1,-52.6"},{code:"US",name:"United States",continent:"NA",bbox:"24.4,-125.0,49.4,-66.9"},{code:"MX",name:"Mexico",continent:"NA",bbox:"14.5,-118.4,32.7,-86.7"},{code:"GT",name:"Guatemala",continent:"NA",bbox:"13.7,-92.2,17.8,-88.2"},{code:"BZ",name:"Belize",continent:"NA",bbox:"15.9,-89.2,18.5,-87.8"},{code:"SV",name:"El Salvador",continent:"NA",bbox:"13.1,-90.1,14.4,-87.7"},{code:"HN",name:"Honduras",continent:"NA",bbox:"12.9,-89.4,16.5,-83.1"},{code:"NI",name:"Nicaragua",continent:"NA",bbox:"10.7,-87.7,15.0,-83.1"},{code:"CR",name:"Costa Rica",continent:"NA",bbox:"8.0,-85.9,11.2,-82.5"},{code:"PA",name:"Panama",continent:"NA",bbox:"7.2,-83.1,9.6,-77.2"},{code:"CU",name:"Cuba",continent:"NA",bbox:"19.8,-85.0,23.3,-74.1"},{code:"DO",name:"Dominican Republic",continent:"NA",bbox:"17.5,-72.0,19.9,-68.3"},{code:"HT",name:"Haiti",continent:"NA",bbox:"18.0,-74.5,20.1,-71.6"},{code:"JM",name:"Jamaica",continent:"NA",bbox:"17.7,-78.4,18.5,-76.2"},{code:"BS",name:"Bahamas",continent:"NA",bbox:"20.9,-79.0,27.3,-72.7"},{code:"TT",name:"Trinidad and Tobago",continent:"NA",bbox:"10.0,-61.9,11.4,-60.5"},{code:"AR",name:"Argentina",continent:"SA",bbox:"-55.1,-73.6,-21.8,-53.6"},{code:"BO",name:"Bolivia",continent:"SA",bbox:"-22.9,-69.6,-9.7,-57.5"},{code:"BR",name:"Brazil",continent:"SA",bbox:"-33.8,-74.0,5.3,-34.8"},{code:"CL",name:"Chile",continent:"SA",bbox:"-55.9,-75.6,-17.5,-66.4"},{code:"CO",name:"Colombia",continent:"SA",bbox:"-4.2,-79.0,12.5,-66.9"},{code:"EC",name:"Ecuador",continent:"SA",bbox:"-5.0,-81.1,1.4,-75.2"},{code:"GY",name:"Guyana",continent:"SA",bbox:"1.2,-61.4,8.6,-56.5"},{code:"PY",name:"Paraguay",continent:"SA",bbox:"-27.6,-62.6,-19.3,-54.3"},{code:"PE",name:"Peru",continent:"SA",bbox:"-18.4,-81.3,0.0,-68.7"},{code:"SR",name:"Suriname",continent:"SA",bbox:"1.8,-58.1,6.0,-54.0"},{code:"UY",name:"Uruguay",continent:"SA",bbox:"-35.0,-58.4,-30.1,-53.1"},{code:"VE",name:"Venezuela",continent:"SA",bbox:"0.6,-73.4,12.2,-59.8"},{code:"AU",name:"Australia",continent:"OC",bbox:"-43.6,113.3,-10.7,153.6"},{code:"NZ",name:"New Zealand",continent:"OC",bbox:"-47.3,166.4,-34.4,178.6"},{code:"PG",name:"Papua New Guinea",continent:"OC",bbox:"-11.7,140.8,-1.3,155.9"},{code:"FJ",name:"Fiji",continent:"OC",bbox:"-19.2,177.0,-16.0,180.0"}],vm=new Map(ta.map(t=>[t.code,t]));function _m(t){const i=String(t||"").split(",").map(s=>Number(s.trim()));return i.length!==4||i.some(s=>Number.isNaN(s))?null:i}function bm(t){const i=vm.get(t);return i?i.bbox:""}function Ir(t,i){if(typeof t!="number"||typeof i!="number"||Number.isNaN(t)||Number.isNaN(i))return null;let s=null,l=1/0;for(const u of ta){const f=_m(u.bbox);if(!f)continue;const[h,_,y,C]=f;if(ty||i<_||i>C)continue;const T=Math.abs(y-h)*Math.abs(C-_);Tt.continent==="EU").slice().sort((t,i)=>t.name.localeCompare(i.name)).map(t=>({value:t.bbox,label:t.name}))}function xm(){return ta.slice().sort((t,i)=>t.name.localeCompare(i.name)).map(t=>[t.code,t.name])}const wm=[["EU","European countries"],["AS","Asian countries"],["AF","African countries"],["NA","North American countries"],["SA","South American countries"],["OC","Oceanian countries"]];function km(){return wm.map(([t,i])=>({label:i,options:ta.filter(s=>s.continent===t).slice().sort((s,l)=>s.name.localeCompare(l.name)).map(s=>({value:s.bbox,label:s.name}))}))}const Sm=(t,i)=>{const s=t.__vccOpts||t;for(const[l,u]of i)s[l]=u;return s},Tm={class:"mx-auto max-w-[1280px] p-7"},Pm={class:"mb-5 flex flex-wrap items-end justify-between gap-4"},Cm={class:"flex h-10 w-full max-w-[280px] items-center gap-2 rounded border border-line-strong bg-surface-1 px-3"},Lm={class:"grid grid-cols-[210px_1fr] gap-6 max-[760px]:grid-cols-1"},Mm={class:"flex flex-col gap-0.5 max-[760px]:flex-row max-[760px]:overflow-x-auto"},Am=["onClick"],Em={class:"whitespace-nowrap"},Om={class:"min-w-0"},zm={key:0,class:"panel p-10 text-center text-sm text-ink-muted"},Im={key:0,class:"eyebrow mb-2 mt-5 first:mt-0 flex items-center gap-2"},$m={key:1,class:"panel mb-5 p-5"},Nm={class:"flex items-center gap-1"},Dm={class:"flex items-center gap-2"},Fm={class:"font-mono text-sm text-ink"},Rm={class:"inline-flex items-center gap-1 rounded-full bg-amber-soft px-2 py-0.5 text-[11px] font-semibold text-amber-fg"},Bm={key:0,class:"mt-2 text-xs text-ink-muted"},Um={class:"grid max-w-[420px] gap-2"},Vm={class:"flex items-center gap-3"},Zm={key:2,class:"panel mb-5 p-5"},Hm=["value"],jm=["value"],Wm=["value"],Km={class:"font-mono text-sm text-ink"},Gm={key:3},qm={key:0,class:"mb-5 flex items-center gap-1 overflow-x-auto border-b border-line"},Ym=["onClick"],Jm={class:"panel mb-5 p-5"},Xm={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},Qm={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},eg={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},tg={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"},ng={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},ig={key:0},og={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},sg={class:"font-semibold text-ink-secondary"},ag={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},rg={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"},lg={class:"flex items-center justify-between gap-3"},ug={class:"flex items-center gap-2 text-sm font-semibold text-ink"},cg={key:0,class:"text-[11px] text-ink-muted"},dg={class:"mt-2 flex items-baseline gap-1.5"},fg={class:"font-mono text-2xl font-semibold text-ink"},hg={class:"text-sm text-ink-muted"},pg={class:"mt-2 h-2 w-full overflow-hidden rounded-full bg-line"},mg={class:"mt-2 text-xs text-ink-muted"},gg={class:"mt-2 text-sm text-ink"},vg={class:"font-semibold"},_g={class:"mt-1 text-xs text-ink-muted"},bg={key:1,class:"mt-2 text-xs text-ink-muted"},yg={key:0,class:"inline-flex items-center gap-2 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:1,class:"flex flex-col items-end gap-2"},Tg={key:0,value:"__auto__"},Pg=["label"],Cg=["value"],Lg={key:0,class:"w-64 text-right text-[11px] leading-snug text-ink-muted"},Mg={key:0,class:"inline-flex items-center gap-2 font-mono 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"},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:8,class:"border-b border-line py-3 text-xs text-amber-fg"},Ig={class:"mt-4 flex flex-wrap items-center gap-3"},$g=["disabled"],Ng={key:1,class:"flex items-center gap-2",title:"Bounding box used for Test connection — smaller areas cost fewer OpenSky credits"},Dg=["label"],Fg=["value"],Rg=["disabled"],Bg={key:3,class:"text-xs text-danger-fg"},Ug={class:"panel mb-5 p-5"},Vg={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 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 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 font-mono text-sm text-ink"},ov={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"},sv={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={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},lv={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"},uv={key:7,class:"my-4 rounded-lg border border-line bg-surface-2 p-4","data-keywords":"usage quota rate limit calls per minute remaining left api"},cv={class:"flex items-center justify-between gap-3"},dv={class:"flex items-center gap-2 text-sm font-semibold text-ink"},fv={key:0,class:"text-[11px] text-ink-muted"},hv={class:"mt-2 flex items-baseline gap-1.5"},pv={class:"font-mono text-2xl font-semibold text-ink"},mv={class:"text-sm text-ink-muted"},gv={key:0,class:"mt-2 h-2 w-full overflow-hidden rounded-full bg-line"},vv={class:"mt-2 text-xs text-ink-muted"},_v={key:1,class:"mt-2 text-xs text-ink-muted"},bv={class:"mt-4 flex flex-wrap items-center gap-3"},yv=["disabled"],xv=["disabled"],wv={key:2,class:"text-xs text-danger-fg"},kv={key:3,class:"text-[11px] text-ink-muted"},Sv={class:"panel mb-5 p-5"},Tv={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"},Cv={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},Lv={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"},Mv={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},Av={key:0},Ev={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},Ov={class:"font-semibold text-ink-secondary"},zv={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},Iv={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},$v={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"},Nv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Dv={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"},Fv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Rv={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"},Bv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Uv={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"},Vv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Zv={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"},Hv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},jv={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"},Wv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Kv={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"},Gv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},qv={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"},Yv={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},Jv={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"},Xv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Qv={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"},e_={class:"mt-4 flex flex-wrap items-center gap-3"},t_=["disabled"],n_=["disabled"],i_={key:2,class:"text-xs text-danger-fg"},o_={key:3,class:"text-[11px] text-ink-muted"},s_={class:"panel mb-5 p-5"},a_={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},r_={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},l_={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},u_={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"},c_={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},d_={key:0},f_={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},h_={class:"font-semibold text-ink-secondary"},p_={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},m_={key:0,class:"inline-flex items-center gap-2 break-all 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"},v_={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},__={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"},b_={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},y_={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:0,class:"inline-flex items-center gap-2 text-sm text-ink"},w_={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"},k_={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},S_={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"},P_=["disabled"],C_=["disabled"],L_={key:2,class:"text-xs text-danger-fg"},M_={key:3,class:"text-[11px] text-ink-muted"},A_={key:3,class:"panel mb-5 p-5"},E_={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},O_={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},z_={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},I_={key:1,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},$_={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"},N_={key:5,class:"border-b border-line py-3 text-xs text-amber-fg"},D_={key:0},F_={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},R_={class:"font-semibold text-ink-secondary"},B_={key:7,class:"border-b border-line py-3 text-xs text-ink-muted"},U_={class:"flex w-full flex-col gap-2"},V_={class:"break-all font-mono text-sm text-ink"},Z_={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"},H_={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"},j_={key:0,class:"text-xs text-ink-muted"},W_={key:1,class:"border-b border-line py-3 text-xs text-ink-muted"},K_={key:0,class:"inline-flex items-center gap-2 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"},q_={class:"mt-4 flex flex-wrap items-center gap-3"},Y_=["disabled"],J_=["disabled"],X_={key:2,class:"text-xs text-danger-fg"},Q_={key:3,class:"text-[11px] text-ink-muted"},e1={key:4,class:"panel mb-5 p-5"},t1={class:"flex items-center gap-4"},n1=["src"],i1={key:1,class:"grid h-16 w-16 place-items-center rounded-full bg-[var(--navy-800)] text-lg font-bold text-white"},o1={class:"flex gap-2"},s1={class:"btn-ghost cursor-pointer"},a1={class:"mt-1 text-right text-[11px] text-ink-muted"},r1={key:5,class:"panel mb-5 p-5"},l1={class:"flex items-center gap-3"},u1={key:0,class:"mt-4 rounded-lg border border-line bg-surface-2 p-4"},c1={class:"flex flex-wrap items-center gap-4"},d1={class:"min-w-0"},f1={class:"mt-1 select-all font-mono text-sm font-bold text-ink"},h1={class:"mt-3 flex items-center gap-2"},p1={key:0,class:"mt-2 text-xs text-danger-fg"},m1={key:1,class:"mt-4 rounded-lg border border-line bg-surface-2 p-4"},g1={class:"mt-2 grid grid-cols-2 gap-1 font-mono text-xs text-ink-secondary sm:grid-cols-4"},v1={class:"rounded-lg border border-line bg-surface-2 p-3"},_1={class:"flex items-center gap-3"},b1={class:"grid h-9 w-9 place-items-center rounded-full bg-accent-soft text-accent-soft-fg"},y1={class:"min-w-0 flex-1"},x1={class:"text-sm font-semibold text-ink"},w1={class:"font-mono text-[11px] text-ink-muted"},k1={key:6,class:"mb-5"},S1={key:0,class:"panel mb-5 p-5"},T1={class:"grid max-w-[520px] gap-2"},P1={class:"flex flex-wrap gap-2"},C1=["disabled","title"],L1=["value"],M1=["value"],A1={class:"flex items-center gap-2 py-1 text-sm text-ink-secondary"},E1={class:"flex items-center gap-3"},O1=["disabled"],z1={key:0,class:"text-xs text-danger-fg"},I1={key:1,class:"text-xs text-ink-muted"},$1={key:1,class:"panel mb-5 p-5"},N1={class:"grid max-w-[520px] gap-2"},D1={class:"flex flex-wrap gap-2"},F1=["value"],R1=["value"],B1={key:1,class:"text-xs text-ink-muted"},U1={class:"font-semibold text-ink-secondary"},V1={class:"flex items-center gap-3"},Z1=["disabled"],H1={key:0,class:"text-xs text-danger-fg"},j1={class:"panel overflow-hidden p-0"},W1={class:"flex items-center justify-between px-5 py-4"},K1=["disabled"],G1={key:0,class:"px-5 pb-5 text-sm text-danger-fg"},q1={key:1,class:"px-5 pb-8 text-sm text-ink-muted"},Y1={key:2,class:"overflow-x-auto"},J1={class:"w-full border-collapse text-sm"},X1={class:"text-left"},Q1={class:"px-5 py-3"},eb={class:"text-ink"},tb={key:0,class:"ml-1.5 text-[11px] text-ink-muted"},nb={class:"px-5 py-3"},ib={class:"px-5 py-3"},ob={class:"px-5 py-3"},sb={class:"px-5 py-3 text-right"},ab=["onClick"],rb={key:1,class:"inline-flex items-center gap-1.5"},lb=["onClick"],ub=["onClick"],cb={key:7,class:"mb-5"},db={key:0,class:"panel mb-5 p-5"},fb={class:"grid max-w-[520px] gap-2"},hb={class:"flex items-center gap-3"},pb={key:0,class:"text-xs text-danger-fg"},mb={key:1,class:"panel mb-5 p-5"},gb={class:"grid max-w-[520px] gap-2"},vb={class:"flex items-center gap-3"},_b=["disabled"],bb={key:0,class:"text-xs text-danger-fg"},yb={class:"panel overflow-hidden p-0"},xb={key:0,class:"px-5 pb-8 text-sm text-ink-muted"},wb={key:1,class:"overflow-x-auto"},kb={class:"w-full border-collapse text-sm"},Sb={class:"text-left"},Tb={class:"px-5 py-3"},Pb={class:"inline-flex items-center gap-2 text-ink"},Cb={class:"px-5 py-3 text-ink-secondary"},Lb={class:"px-5 py-3 text-right"},Mb=["onClick"],Ab={key:1,class:"inline-flex items-center gap-1.5"},Eb=["onClick"],Ob=["disabled","title","onClick"],zb={key:8,class:"mb-5"},Ib={class:"panel mb-5 p-5"},$b={class:"btn-ghost cursor-pointer"},Nb={key:0,class:"mt-2 text-xs text-ink-muted"},Db={class:"rounded-lg border p-5",style:{"border-color":"color-mix(in srgb, var(--danger) 35%, transparent)",background:"var(--danger-soft)"}},Fb={class:"flex items-center gap-2 text-danger-fg"},Rb={class:"mt-4 rounded-lg border border-line bg-surface-1 p-4"},Bb={class:"mt-3 flex items-start gap-2 text-sm text-ink-secondary"},Ub={class:"mt-3"},Vb={class:"eyebrow mb-1 block"},Zb={class:"text-ink"},Hb=["placeholder"],jb={class:"mt-4 flex flex-wrap items-center gap-3"},Wb=["disabled"],Kb=["disabled"],Gb={key:2,class:"text-xs text-ink-muted"},qb={key:0,class:"mt-3 rounded border border-line bg-surface-2 px-3 py-2 text-xs text-ink-secondary"},Yb={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"},Cu="pv.opensky.health",Lu="pv.filetransfer.health",Mu="pv.webdav.health",Au="pv.openweather.health",Eu="pv.localstorage.health",Jb={__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 s=t,l=i,u=he(()=>s.role==="superadmin"),f=he(()=>s.role==="admin"||s.role==="superadmin");function h(g){return g==="superadmin"?"Superadmin":g==="admin"?"Admin":"User"}function _(g){return g==="superadmin"||g==="admin"?"shield":"user"}function y(g){return g==="superadmin"||g==="admin"?C.accent:C.neutral}const C={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"},T=he(()=>{const g=[{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 openweather weather forecast temperature api key units calls per minute usage limit quota"},{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 f.value&&g.push({id:"team",label:"User management",icon:"users",kw:"users team members add remove create delete role admin permissions rights organization"}),u.value&&g.push({id:"organizations",label:"Organizations",icon:"grid",kw:"organization org tenant company create rename delete members"}),g.push({id:"advanced",label:"Advanced",icon:"alertTriangle",kw:"export import data delete account danger zone",danger:!0}),g}),A=Z("account"),R=Z("");lc("settingsSearch",R);const B=he(()=>R.value.trim().length>0),j=he(()=>R.value.trim().toLowerCase());function F(g){return j.value?(g.label+" "+g.kw).toLowerCase().includes(j.value)||me(g.id):!0}const pe={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","openweather weather forecast","api key units metric imperial","default latitude longitude language","calls per minute limit usage quota","api call usage today rate limit"],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 me(g){return j.value?(pe[g]||[]).some(c=>c.includes(j.value)):!0}const Y=he(()=>B.value?T.value.filter(F):T.value.filter(g=>g.id===A.value)),Le=he({get:()=>ko.value,set:g=>Za(g)}),fe=[{value:"light",label:"Light",icon:"sun"},{value:"dark",label:"Dark",icon:"moon"},{value:"system",label:"System",icon:"monitor"}],Ue=[{value:"sm",label:"Small"},{value:"md",label:"Default"},{value:"lg",label:"Large"}],Ne=[{value:"12",label:"12-hour"},{value:"24",label:"24-hour"}],Ie=[["en","English"],["es","Español"],["de","Deutsch"],["fr","Français"],["pl","Polski"],["ja","日本語"]],Ge=xm(),we=he(()=>(Ge.find(([g])=>g===be.region)||[null,be.region])[1]),Te=[["MDY","MM/DD/YYYY"],["DMY","DD/MM/YYYY"],["YMD","YYYY/MM/DD"],["ISO","YYYY-MM-DD"]],ze=Z(Date.now());let ie=null;const je=he(()=>ku(ze.value)),oe=St({loaded:!1,available:!1,orgEnabled:!0,allowAnonymous:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),We=Z("user"),ue=St({clientId:"",clientSecret:"",plan:"",bbox:""}),ce=Z(""),ae=Z(!1),st=Z(!1),te=Z(null),ke=Z(null),De=he(()=>te.value&&te.value.credits||null),ht=he(()=>{const g=De.value;return!g||!g.daily||g.remaining==null?null:Math.max(0,Math.min(100,Math.round(g.remaining/g.daily*100)))}),lt=he(()=>{const g=ht.value;return g==null?"bg-accent":g<=10?"bg-danger":g<=30?"bg-amber":"bg-success"});function Ve(g){return typeof g=="number"?g.toLocaleString():g}function J(){if(!ke.value)return"";const g=Math.max(0,Math.round((Date.now()-ke.value)/1e3));if(g<60)return"just now";const c=Math.round(g/60);if(c<60)return`${c} min ago`;const V=Math.round(c/60);return V<24?`${V} h ago`:`${Math.round(V/24)} d ago`}function E(){try{te.value&&localStorage.setItem(Cu,JSON.stringify({health:te.value,ts:ke.value}))}catch{}}function I(){try{const g=localStorage.getItem(Cu);if(!g)return;const c=JSON.parse(g);c&&c.health&&(te.value=c.health,ke.value=c.ts||null)}catch{}}const _t=[{value:"",label:"Not set"},{value:"anonymous",label:"Anonymous"},{value:"standard",label:"Standard"},{value:"contributor",label:"Contributor"}],ut=[{value:"user",label:"My settings",icon:"user"},{value:"org",label:"Organization",icon:"users"}],Pt=[{label:"World",options:[{value:"-90,-180,90,180",label:"World"}]},{label:"Continents",options:[{value:"34,-25,72,45",label:"Europe"},{value:"-35,-18,38,52",label:"Africa"},{value:"5,25,82,180",label:"Asia"},{value:"7,-168,72,-52",label:"North America"},{value:"-56,-82,13,-34",label:"South America"},{value:"-48,110,-10,180",label:"Oceania"}]},{label:"European countries",options:ym()},{label:"Other countries",options:[{value:"24,-125,49.5,-66.5",label:"United States"},{value:"41.7,-141,83.1,-52.6",label:"Canada"},{value:"-43.6,113.3,-10.7,153.6",label:"Australia"},{value:"24,122.9,45.5,145.8",label:"Japan"}]}],x=Pt.flatMap(g=>g.options);function b(g){const c=String(g||"").split(",").map(w=>w.trim());if(c.length!==4)return"";const V=c.map(Number);return V.some(w=>Number.isNaN(w))?"":V.join(",")}function S(g){const c=b(g),V=c&&x.find(w=>b(w.value)===c);return V?V.label:""}const G=Z(!1),K=he({get(){if(!ge.value&&be.autoBbox)return"__auto__";if(G.value)return"__custom__";const g=b(ue.bbox),c=g&&x.find(V=>b(V.value)===g);return c?c.value:"__custom__"},set(g){if(g==="__auto__"){ge.value||(be.autoBbox=!0),G.value=!1;return}if(ge.value||(be.autoBbox=!1),g==="__custom__"){G.value=!0;return}G.value=!1,ue.bbox=g}}),H=he(()=>K.value==="__custom__"),re=he(()=>K.value==="__auto__"),ne=he(()=>oe.isSuperadmin),Q=he(()=>oe.isSuperadmin?"user":We.value),q=he(()=>oe.scopes[Q.value]||{editableLayer:"user",fields:{}}),ge=he(()=>Q.value==="org");function se(g){return q.value.fields[g]||{effective:"",own:"",source:"unset",locked:!1}}function Ce(g){return ne.value||se(g).locked}function Me(g){const c=se(g).source;return c==="global"?"Set by administrator":c==="org"?"Set by your organization":""}function Ze(){ue.clientId=se("clientId").own||"",ue.clientSecret=se("clientSecret").own||"",ue.plan=se("plan").own||"",ue.bbox=se("bbox").own||"",G.value=!1}function it(g){oe.available=!!g.available,oe.orgEnabled=g.orgEnabled!==!1,oe.allowAnonymous=!!g.allowAnonymous,oe.enabled=!!g.enabled,oe.canEditOrg=!!g.canEditOrg,oe.isSuperadmin=!!g.isSuperadmin,oe.scopes=g.scopes||{},We.value==="org"&&!oe.canEditOrg&&(We.value="user"),Ze(),oe.loaded=!0}Nt(We,()=>{ce.value="",Ze()});async function U(){I();const{ok:g,body:c}=await hp();g&&it(c)}async function O(g){const c=ge.value;c?oe.orgEnabled=g:oe.enabled=g;const{ok:V,body:w}=await _u(c?{scope:"org",enabled:g}:{scope:"user",enabled:g});V?(it(w),Je(c?g?"OpenSky enabled for your organization.":"OpenSky disabled for your organization.":g?"OpenSky enabled.":"OpenSky disabled.")):(c?oe.orgEnabled=!g:oe.enabled=!g,Je(w.error||"Could not update."))}async function Pe(){ce.value="",ae.value=!0;const g={};for(const He of["clientId","clientSecret","plan","bbox"])Ce(He)||(g[He]=ue[He]);const c={scope:Q.value,config:g};ge.value||(c.enabled=oe.enabled);const{ok:V,body:w}=await _u(c);if(ae.value=!1,!V){ce.value=w.error||"Could not save settings.";return}it(w),Je(ge.value?"Organization OpenSky settings saved.":"OpenSky settings saved.")}const qe=[{label:"World",options:[{value:"-90,-180,90,180",label:"World"}]},{label:"Continents",options:[{value:"34,-25,72,45",label:"Europe"},{value:"-35,-18,38,52",label:"Africa"},{value:"5,25,82,180",label:"Asia"},{value:"7,-168,72,-52",label:"North America"},{value:"-56,-82,13,-34",label:"South America"},{value:"-48,110,-10,180",label:"Oceania"}]},...km()],vt=qe.flatMap(g=>g.options),xt=Z(""),rn=Z(!1),de=he({get(){if(rn.value)return"__custom__";if(!xt.value)return"__default__";const g=b(xt.value),c=g&&vt.find(V=>b(V.value)===g);return c?c.value:"__custom__"},set(g){if(g==="__default__"){rn.value=!1,xt.value="";return}if(g==="__custom__"){rn.value=!0;return}rn.value=!1,xt.value=g}}),Tt=he(()=>de.value==="__custom__");async function gn(){st.value=!0,te.value=null;const{ok:g,body:c}=await pp((xt.value||"").trim()||void 0);st.value=!1,te.value=g&&c.health?c.health:{status:"down",detail:c.error||"Probe failed."},ke.value=Date.now(),E()}function So(g){return g==="ok"?C.success:g==="degraded"?C.warning:C.danger}const ct=St({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),si=Z("user"),To=["protocol","host","port","username","password","privateKey","keyPassphrase","hostKeyFingerprint","insecureSkipVerify","basePath"],pt=St(Object.fromEntries(To.map(g=>[g,""]))),Wi=Z(""),Po=Z(!1),Co=Z(!1),Fn=Z(null),Ti=Z(null),na=[{value:"sftp",label:"SFTP"},{value:"ftps",label:"FTPS"},{value:"ftp",label:"FTP"}],ss=[{value:"false",label:"Verify certificate"},{value:"true",label:"Skip verification"}],as=he(()=>ct.isSuperadmin),rs=he(()=>ct.isSuperadmin?"user":si.value),nr=he(()=>ct.scopes[rs.value]||{editableLayer:"user",fields:{}}),Pn=he(()=>rs.value==="org"),Xt=he(()=>(Qt("protocol")?ve("protocol").effective:pt.protocol)||"sftp");function ve(g){return nr.value.fields[g]||{effective:"",own:"",source:"unset",locked:!1}}function Qt(g){return as.value||ve(g).locked}function Lt(g){const c=ve(g).source;return c==="global"?"Set by administrator":c==="org"?"Set by your organization":""}function ia(g){return(na.find(c=>c.value===g)||{}).label||g||"—"}function ls(){for(const g of To)pt[g]=ve(g).own||"";pt.protocol||(pt.protocol="sftp"),pt.insecureSkipVerify||(pt.insecureSkipVerify="false")}function Ki(g){ct.available=!!g.available,ct.orgEnabled=g.orgEnabled!==!1,ct.enabled=!!g.enabled,ct.canEditOrg=!!g.canEditOrg,ct.isSuperadmin=!!g.isSuperadmin,ct.scopes=g.scopes||{},si.value==="org"&&!ct.canEditOrg&&(si.value="user"),ls(),ct.loaded=!0}Nt(si,()=>{Wi.value="",ls()});function oa(){if(!Ti.value)return"";const g=Math.max(0,Math.round((Date.now()-Ti.value)/1e3));if(g<60)return"just now";const c=Math.round(g/60);if(c<60)return`${c} min ago`;const V=Math.round(c/60);return V<24?`${V} h ago`:`${Math.round(V/24)} d ago`}function Pi(){try{Fn.value&&localStorage.setItem(Lu,JSON.stringify({health:Fn.value,ts:Ti.value}))}catch{}}function sa(){try{const g=localStorage.getItem(Lu);if(!g)return;const c=JSON.parse(g);c&&c.health&&(Fn.value=c.health,Ti.value=c.ts||null)}catch{}}async function ir(){sa();const{ok:g,body:c}=await gp();g&&Ki(c)}async function aa(g){const c=Pn.value;c?ct.orgEnabled=g:ct.enabled=g;const{ok:V,body:w}=await bu(c?{scope:"org",enabled:g}:{scope:"user",enabled:g});V?(Ki(w),Je(c?g?"File transfer enabled for your organization.":"File transfer disabled for your organization.":g?"File transfer enabled.":"File transfer disabled.")):(c?ct.orgEnabled=!g:ct.enabled=!g,Je(w.error||"Could not update."))}async function or(){Wi.value="",Po.value=!0;const g={};for(const He of To)Qt(He)||(g[He]=pt[He]);const c={scope:rs.value,config:g};Pn.value||(c.enabled=ct.enabled);const{ok:V,body:w}=await bu(c);if(Po.value=!1,!V){Wi.value=w.error||"Could not save settings.";return}Ki(w),Je(Pn.value?"Organization file-transfer settings saved.":"File-transfer settings saved.")}async function sr(){Co.value=!0,Fn.value=null;const{ok:g,body:c}=await vp();Co.value=!1,Fn.value=g&&c.health?c.health:{status:"down",detail:c.error||"Probe failed."},Ti.value=Date.now(),Pi()}function ra(g){return g==="ok"?C.success:g==="degraded"?C.warning:C.danger}const dt=St({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),Rn=Z("user"),us=["baseURL","username","password","insecureSkipVerify","basePath"],Zt=St(Object.fromEntries(us.map(g=>[g,""]))),Gi=Z(""),Lo=Z(!1),Mo=Z(!1),vn=Z(null),Cn=Z(null),la=[{value:"false",label:"Verify certificate"},{value:"true",label:"Skip verification"}],Ao=he(()=>dt.isSuperadmin),ai=he(()=>dt.isSuperadmin?"user":Rn.value),at=he(()=>dt.scopes[ai.value]||{editableLayer:"user",fields:{}}),rt=he(()=>ai.value==="org");function _n(g){return at.value.fields[g]||{effective:"",own:"",source:"unset",locked:!1}}function bn(g){return Ao.value||_n(g).locked}function Ut(g){const c=_n(g).source;return c==="global"?"Set by administrator":c==="org"?"Set by your organization":""}function Eo(){for(const g of us)Zt[g]=_n(g).own||"";Zt.insecureSkipVerify||(Zt.insecureSkipVerify="false")}function Ke(g){dt.available=!!g.available,dt.orgEnabled=g.orgEnabled!==!1,dt.enabled=!!g.enabled,dt.canEditOrg=!!g.canEditOrg,dt.isSuperadmin=!!g.isSuperadmin,dt.scopes=g.scopes||{},Rn.value==="org"&&!dt.canEditOrg&&(Rn.value="user"),Eo(),dt.loaded=!0}Nt(Rn,()=>{Gi.value="",Eo()});function Mt(){if(!Cn.value)return"";const g=Math.max(0,Math.round((Date.now()-Cn.value)/1e3));if(g<60)return"just now";const c=Math.round(g/60);if(c<60)return`${c} min ago`;const V=Math.round(c/60);return V<24?`${V} h ago`:`${Math.round(V/24)} d ago`}function cs(){try{vn.value&&localStorage.setItem(Mu,JSON.stringify({health:vn.value,ts:Cn.value}))}catch{}}function Oo(){try{const g=localStorage.getItem(Mu);if(!g)return;const c=JSON.parse(g);c&&c.health&&(vn.value=c.health,Cn.value=c.ts||null)}catch{}}async function ln(){Oo();const{ok:g,body:c}=await yp();g&&Ke(c)}async function ua(g){const c=rt.value;c?dt.orgEnabled=g:dt.enabled=g;const{ok:V,body:w}=await yu(c?{scope:"org",enabled:g}:{scope:"user",enabled:g});V?(Ke(w),Je(c?g?"WebDAV enabled for your organization.":"WebDAV disabled for your organization.":g?"WebDAV enabled.":"WebDAV disabled.")):(c?dt.orgEnabled=!g:dt.enabled=!g,Je(w.error||"Could not update."))}async function zo(){Gi.value="",Lo.value=!0;const g={};for(const He of us)bn(He)||(g[He]=Zt[He]);const c={scope:ai.value,config:g};rt.value||(c.enabled=dt.enabled);const{ok:V,body:w}=await yu(c);if(Lo.value=!1,!V){Gi.value=w.error||"Could not save settings.";return}Ke(w),Je(rt.value?"Organization WebDAV settings saved.":"WebDAV settings saved.")}async function ri(){Mo.value=!0,vn.value=null;const{ok:g,body:c}=await xp();Mo.value=!1,vn.value=g&&c.health?c.health:{status:"down",detail:c.error||"Probe failed."},Cn.value=Date.now(),cs()}function At(g){return g==="ok"?C.success:g==="degraded"?C.warning:C.danger}const et=St({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),Ln=Z("user"),li=["apiKey","units","lat","lon","lang","callsPerMinute"],Dt=St(Object.fromEntries(li.map(g=>[g,""]))),Bn=Z(""),Ci=Z(!1),Li=Z(!1),Ht=Z(null),Un=Z(null),Io=[{value:"",label:"Not set"},{value:"metric",label:"Metric (°C)"},{value:"imperial",label:"Imperial (°F)"},{value:"standard",label:"Standard (K)"}],Mi=he(()=>et.isSuperadmin),$o=he(()=>et.isSuperadmin?"user":Ln.value),ds=he(()=>et.scopes[$o.value]||{editableLayer:"user",fields:{}}),yn=he(()=>$o.value==="org");function $e(g){return ds.value.fields[g]||{effective:"",own:"",source:"unset",locked:!1}}function Ft(g){return Mi.value||$e(g).locked}function Qe(g){const c=$e(g).source;return c==="global"?"Set by administrator":c==="org"?"Set by your organization":""}function fs(){for(const g of li)Dt[g]=$e(g).own||""}function qi(g){et.available=!!g.available,et.orgEnabled=g.orgEnabled!==!1,et.enabled=!!g.enabled,et.canEditOrg=!!g.canEditOrg,et.isSuperadmin=!!g.isSuperadmin,et.scopes=g.scopes||{},Ln.value==="org"&&!et.canEditOrg&&(Ln.value="user"),fs(),et.loaded=!0}Nt(Ln,()=>{Bn.value="",fs()});function No(){if(!Un.value)return"";const g=Math.max(0,Math.round((Date.now()-Un.value)/1e3));if(g<60)return"just now";const c=Math.round(g/60);if(c<60)return`${c} min ago`;const V=Math.round(c/60);return V<24?`${V} h ago`:`${Math.round(V/24)} d ago`}function hs(){try{Ht.value&&localStorage.setItem(Au,JSON.stringify({health:Ht.value,ts:Un.value}))}catch{}}function ui(){try{const g=localStorage.getItem(Au);if(!g)return;const c=JSON.parse(g);c&&c.health&&(Ht.value=c.health,Un.value=c.ts||null)}catch{}}async function ps(){ui();const{ok:g,body:c}=await wp();g&&qi(c)}async function Ai(g){const c=yn.value;c?et.orgEnabled=g:et.enabled=g;const{ok:V,body:w}=await xu(c?{scope:"org",enabled:g}:{scope:"user",enabled:g});V?(qi(w),Je(c?g?"OpenWeather enabled for your organization.":"OpenWeather disabled for your organization.":g?"OpenWeather enabled.":"OpenWeather disabled.")):(c?et.orgEnabled=!g:et.enabled=!g,Je(w.error||"Could not update."))}async function It(){Bn.value="",Ci.value=!0;const g={};for(const He of li)Ft(He)||(g[He]=Dt[He]);const c={scope:$o.value,config:g};yn.value||(c.enabled=et.enabled);const{ok:V,body:w}=await xu(c);if(Ci.value=!1,!V){Bn.value=w.error||"Could not save settings.";return}qi(w),Je(yn.value?"Organization OpenWeather settings saved.":"OpenWeather settings saved.")}async function ci(){Li.value=!0,Ht.value=null;const{ok:g,body:c}=await kp();Li.value=!1,Ht.value=g&&c.health?c.health:{status:"down",detail:c.error||"Probe failed."},Un.value=Date.now(),hs()}function ca(g){return g==="ok"?C.success:g==="degraded"?C.warning:C.danger}const Ei=he(()=>Ht.value&&Ht.value.usage||null),ms=he(()=>{const g=Ei.value;return!g||!g.minuteLimit?null:Math.max(0,Math.min(100,Math.round(g.minuteUsed/g.minuteLimit*100)))}),da=he(()=>{const g=ms.value;return g==null?"bg-accent":g>=90?"bg-danger":g>=70?"bg-amber":"bg-success"}),Ee=St({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,isOrgUser:!1,mounts:[],privateFolder:!1,privateEnabled:!1,allowPrivate:!0,rootConfigured:!1,scopes:{}}),Oi=Z("user"),Yi=Z(""),Xe=Z(""),Do=Z(!1),jt=Z(!1),en=Z(null),di=Z(null),Ji=Z({}),Fo=[{value:"",label:"Inherit"},{value:"false",label:"Read-write"},{value:"true",label:"Read-only"}],gs=he(()=>Ee.isSuperadmin),Ro=he(()=>Ee.isSuperadmin?"user":Oi.value),ar=he(()=>Ee.scopes[Ro.value]||{editableLayer:"user",fields:{}}),un=he(()=>Ro.value==="org");function zi(g){return ar.value.fields[g]||{effective:"",own:"",source:"unset",locked:!1}}function fa(g){return gs.value||zi(g).locked}function xn(g){const c=zi(g).source;return c==="global"?"Set by administrator":c==="org"?"Set by your organization":""}function rr(g){return(Fo.find(c=>c.value===g)||{}).label||"Inherit"}function vs(){Yi.value=zi("readOnly").own||""}function cn(g){Ee.available=!!g.available,Ee.orgEnabled=g.orgEnabled!==!1,Ee.enabled=!!g.enabled,Ee.canEditOrg=!!g.canEditOrg,Ee.isSuperadmin=!!g.isSuperadmin,Ee.isOrgUser=!!g.isOrgUser,Ee.mounts=Array.isArray(g.mounts)?g.mounts:[],Ee.privateFolder=!!g.privateFolder,Ee.privateEnabled=!!g.privateEnabled,Ee.allowPrivate=g.allowPrivate!==!1,Ee.rootConfigured=!!g.rootConfigured,Ee.scopes=g.scopes||{},Oi.value==="org"&&!Ee.canEditOrg&&(Oi.value="user"),vs(),Ee.loaded=!0}Nt(Oi,()=>{Xe.value="",vs()});function ha(){if(!di.value)return"";const g=Math.max(0,Math.round((Date.now()-di.value)/1e3));if(g<60)return"just now";const c=Math.round(g/60);if(c<60)return`${c} min ago`;const V=Math.round(c/60);return V<24?`${V} h ago`:`${Math.round(V/24)} d ago`}function pa(){try{en.value&&localStorage.setItem(Eu,JSON.stringify({health:en.value,ts:di.value}))}catch{}}function _s(){try{const g=localStorage.getItem(Eu);if(!g)return;const c=JSON.parse(g);c&&c.health&&(en.value=c.health,di.value=c.ts||null)}catch{}}async function lr(){_s();const{ok:g,body:c}=await _p();g&&cn(c)}async function bs(g){const c=un.value;c?Ee.orgEnabled=g:Ee.enabled=g;const{ok:V,body:w}=await Ma(c?{scope:"org",enabled:g}:{scope:"user",enabled:g});V?(cn(w),Je(c?g?"Local storage enabled for your organization.":"Local storage disabled for your organization.":g?"Local storage enabled.":"Local storage disabled.")):(c?Ee.orgEnabled=!g:Ee.enabled=!g,Je(w.error||"Could not update."))}async function ma(g){Ee.privateFolder=g;const{ok:c,body:V}=await Ma({scope:"user",privateFolder:g});c?(cn(V),Je(g?"Private folder enabled.":"Private folder disabled.")):(Ee.privateFolder=!g,Je(V.error||"Could not update."))}async function ur(g){Ee.allowPrivate=g;const{ok:c,body:V}=await Ma({scope:"org",allowPrivate:g});c?(cn(V),Je(g?"Members may now create private folders.":"Private folders disabled for your organization.")):(Ee.allowPrivate=!g,Je(V.error||"Could not update."))}async function cr(){Xe.value="",Do.value=!0;const g={};fa("readOnly")||(g.readOnly=Yi.value);const c={scope:Ro.value,config:g};un.value||(c.enabled=Ee.enabled);const{ok:V,body:w}=await Ma(c);if(Do.value=!1,!V){Xe.value=w.error||"Could not save settings.";return}cn(w),Je(un.value?"Organization local-storage settings saved.":"Local-storage settings saved.")}async function ys(){jt.value=!0,en.value=null,Ji.value={};const{ok:g,body:c}=await bp();jt.value=!1,en.value=g&&c.health?c.health:{status:"down",detail:c.error||"Probe failed."};const V={};if(Array.isArray(c.mounts))for(const w of c.mounts)V[w.id]={status:w.status,detail:w.detail};Ji.value=V,di.value=Date.now(),pa()}function ga(g){return g==="ok"?C.success:g==="degraded"?C.warning:C.danger}const va=[{id:"apis-external",label:"APIs — External",icon:"globe"},{id:"drives-external",label:"Drives — External",icon:"server"},{id:"drives-local",label:"Drives — Local",icon:"monitor"}],Bo=Z("apis-external");function Ii(g){return B.value||Bo.value===g}const Mn=Z("");let xs=null;function Je(g){Mn.value=g,clearTimeout(xs),xs=setTimeout(()=>Mn.value="",2200)}const wt=St({current:"",next:"",confirm:""}),fi=Z(""),ws=Z(!1);function dr(){if(ws.value=!1,!wt.current)return fi.value="Enter your current password.";if(wt.next.length<8)return fi.value="New password must be at least 8 characters.";if(wt.next!==wt.confirm)return fi.value="New passwords do not match.";fi.value="Validated. Connecting to the account service is pending — no password endpoint yet.",wt.current=wt.next=wt.confirm=""}const Xi=Z("");function ks(){Xi.value="Verification link would be sent once the account service is wired up."}function fr(g){const c=g.target.files&&g.target.files[0];if(!c)return;if(c.size>1.5*1024*1024){Je("Image too large (max ~1.5 MB).");return}const V=new FileReader;V.onload=()=>{be.avatar=String(V.result),Je("Photo updated.")},V.readAsDataURL(c)}function hr(){be.avatar="",Je("Photo removed.")}const _a=he(()=>{var V,w,He;const c=(be.displayName||be.name||s.email||"PV").split("@")[0].split(/[.\-_ ]+/).filter(Boolean);return((((V=c[0])==null?void 0:V[0])||"P")+(((w=c[1])==null?void 0:w[0])||((He=c[0])==null?void 0:He[1])||"V")).toUpperCase()}),Qi=Z(!1),dn=Z(""),Vn=Z(""),eo=Z(""),fn=Z([]);function Ss(g){const c="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";let V="";for(let w=0;wSs(4).toLowerCase()+"-"+Ss(4).toLowerCase()),eo.value=""}function to(){be.twoFactor=!1,fn.value=[],Qi.value=!1}const wn=navigator.userAgent;function Uo(){return/Edg\//.test(wn)?"Edge":/OPR\//.test(wn)?"Opera":/Chrome\//.test(wn)?"Chrome":/Firefox\//.test(wn)?"Firefox":/Safari\//.test(wn)?"Safari":"Browser"}function mr(){return/Windows/.test(wn)?"Windows":/Mac OS X/.test(wn)?"macOS":/Android/.test(wn)?"Android":/iPhone|iPad/.test(wn)?"iOS":/Linux/.test(wn)?"Linux":"Unknown OS"}const Gn=Date.now(),hi=Z([]),no=Z(!1),Ni=Z(""),$t=St({email:"",password:"",role:"user",organization:""}),Wt=Z(""),Vo=Z(!1),An=Z(""),ba=he(()=>{const g=[{value:"user",label:"User"},{value:"admin",label:"Admin"}];return u.value&&g.push({value:"superadmin",label:"Superadmin"}),g}),hn=Z([]);async function qn(){if(!f.value)return;const g=await rp();g.ok&&(hn.value=g.organizations.slice().sort((c,V)=>c.name.localeCompare(V.name)))}const Ts=he(()=>{const g=hn.value.map(c=>({value:c.id,label:c.name}));return u.value&&g.unshift({value:"",label:"No organization"}),g});async function Yn(){if(!f.value)return;no.value=!0,Ni.value="";const g=await ip();if(no.value=!1,!g.ok){Ni.value=g.status===403?"Manager role required.":"Could not load users.";return}hi.value=g.users.slice().sort((c,V)=>c.email.localeCompare(V.email))}function pi(g){try{const c=g.data||{},V=Object.keys(c)[0];return V&&c[V]&&c[V].message||g.message||g.error||"Invalid input."}catch{return g.error||"Could not create user."}}async function Ps(){Wt.value="";const g=$t.email.trim().toLowerCase();if(!g.includes("@"))return Wt.value="Enter a valid email.";if($t.password.length<8)return Wt.value="Password must be at least 8 characters.";Vo.value=!0;const c=u.value?$t.organization:s.organization,{ok:V,body:w}=await op(g,$t.password,$t.role,c);if(Vo.value=!1,!V)return Wt.value=pi(w);$t.email="",$t.password="",$t.role="user",$t.organization="",Je("User created."),Yn()}async function Zo(g){const{ok:c,body:V}=await ap(g.id);if(An.value="",!c)return Je(V.error||"Could not remove user.");Je("User removed."),Yn()}const tt=St({id:"",email:"",role:"user",verified:!1,password:"",organization:""}),kn=Z(""),Di=Z(!1),Ho=he(()=>!!tt.id&&tt.email===s.email);function gr(g){An.value="",tt.id=g.id,tt.email=g.email,tt.role=g.role||"user",tt.verified=!!g.verified,tt.password="",tt.organization=g.organization||"",kn.value=""}function io(){tt.id="",kn.value=""}async function vr(){kn.value="";const g=tt.email.trim().toLowerCase();if(!g.includes("@"))return kn.value="Enter a valid email.";if(tt.password&&tt.password.length<8)return kn.value="New password must be at least 8 characters (or leave blank).";const c={email:g,role:tt.role,verified:tt.verified};u.value&&(c.organization=tt.organization),tt.password&&(c.password=tt.password),Di.value=!0;const{ok:V,body:w}=await sp(tt.id,c);if(Di.value=!1,!V)return kn.value=pi(w);Je("User updated."),io(),Yn()}const oo=St({name:""}),so=Z(""),ao=Z(!1),ro=Z(""),Ot=St({id:"",name:""}),En=Z(""),Cs=he(()=>{const g={};for(const c of hi.value)c.organization&&(g[c.organization]=(g[c.organization]||0)+1);return g});async function lo(){so.value="";const g=oo.name.trim();if(!g)return so.value="Enter an organization name.";ao.value=!0;const{ok:c,body:V}=await lp(g);if(ao.value=!1,!c)return so.value=pi(V);oo.name="",Je("Organization created."),qn()}function _r(g){ro.value="",Ot.id=g.id,Ot.name=g.name,En.value=""}function Ls(){Ot.id="",En.value=""}async function ya(){En.value="";const g=Ot.name.trim();if(!g)return En.value="Enter an organization name.";const{ok:c,body:V}=await up(Ot.id,g);if(!c)return En.value=pi(V);Je("Organization renamed."),Ls(),qn(),Yn()}async function uo(g){const{ok:c,body:V}=await cp(g.id);if(ro.value="",!c)return Je(V.error||"Could not delete organization.");Je("Organization deleted."),qn()}function br(){const g={_app:"PilotVault",_kind:"settings-export",exportedAt:new Date().toISOString(),email:s.email,prefs:{...be},themeMode:ko.value},c=new Blob([JSON.stringify(g,null,2)],{type:"application/json"}),V=URL.createObjectURL(c),w=document.createElement("a");w.href=V,w.download=`pilotvault-settings-${new Date().toISOString().slice(0,10)}.json`,document.body.appendChild(w),w.click(),w.remove(),URL.revokeObjectURL(V),Je("Settings exported.")}const Zn=Z("");function xa(g){const c=g.target.files&&g.target.files[0];if(!c)return;const V=new FileReader;V.onload=()=>{try{const w=JSON.parse(String(V.result)),He=w.prefs||w;if(!ed(He))throw new Error("bad shape");w.themeMode&&Za(w.themeMode),pl(be.fontSize),ml(be.reduceMotion),Zn.value="Settings imported and applied."}catch{Zn.value="That file is not a valid PilotVault settings export."}},V.readAsText(c),g.target.value=""}const bt=St({understand:!1,typed:"",cooldown:0,armed:!1,msg:""});let co=null;const Sn=he(()=>s.email||"DELETE MY ACCOUNT"),jo=he(()=>bt.understand&&bt.typed===Sn.value);function wa(){jo.value&&(bt.armed=!0,bt.cooldown=5,clearInterval(co),co=setInterval(()=>{bt.cooldown--,bt.cooldown<=0&&clearInterval(co)},1e3))}Nt(jo,g=>{!g&&bt.armed&&(bt.armed=!1,bt.cooldown=0,clearInterval(co))});function fo(){if(!(!bt.armed||bt.cooldown>0)){try{localStorage.removeItem("pv_prefs")}catch{}bt.msg="Account deletion requires the account service. Local data was cleared and you were signed out.",setTimeout(()=>l("logout"),900)}}return ki(()=>{ie=setInterval(()=>ze.value=Date.now(),1e3),qn(),Yn(),U(),ir(),ln(),ps(),lr()}),os(()=>{clearInterval(ie),clearInterval(co),clearTimeout(xs)}),(g,c)=>(p(),m("div",Tm,[a("div",Pm,[c[72]||(c[72]=a("div",null,[a("div",{class:"eyebrow"},"Preferences"),a("h2",{class:"mt-0.5 text-[22px] font-bold tracking-tightest text-ink"},"Settings")],-1)),a("div",Cm,[M(W,{name:"search",size:16,class:"text-ink-muted"}),ee(a("input",{"onUpdate:modelValue":c[0]||(c[0]=V=>R.value=V),placeholder:"Search settings…",class:"w-full border-none bg-transparent text-sm text-ink outline-none placeholder:text-ink-muted"},null,512),[[ye,R.value]]),R.value?(p(),m("button",{key:0,class:"text-ink-muted hover:text-ink","aria-label":"Clear search",onClick:c[1]||(c[1]=V=>R.value="")},[M(W,{name:"x",size:15})])):N("",!0)])]),a("div",Lm,[ee(a("nav",Mm,[(p(!0),m(le,null,Re(T.value,V=>(p(),m("button",{key:V.id,class:Ae(["flex items-center gap-2.5 rounded px-3 py-2.5 text-left text-sm transition",[A.value===V.id?V.danger?"bg-danger-soft font-semibold text-danger-fg":"bg-accent-soft font-semibold text-accent-soft-fg":V.danger?"font-medium text-danger-fg hover:bg-danger-soft":"font-medium text-ink-secondary hover:bg-surface-2"]]),onClick:w=>A.value=V.id},[M(W,{name:V.icon,size:17},null,8,["name"]),a("span",Em,k(V.label),1)],10,Am))),128))],512),[[kh,!B.value]]),a("div",Om,[B.value&&!Y.value.length?(p(),m("div",zm," No settings match “"+k(R.value)+"”. ",1)):N("",!0),(p(!0),m(le,null,Re(Y.value,V=>(p(),m(le,{key:V.id},[B.value?(p(),m("div",Im,[M(W,{name:V.icon,size:14},null,8,["name"]),z(" "+k(V.label),1)])):N("",!0),V.id==="account"?(p(),m("div",$m,[M(Se,{title:"Full name",desc:"Shown to your team on flights and audit logs.",keywords:"full name account"},{default:xe(()=>[ee(a("input",{"onUpdate:modelValue":c[2]||(c[2]=w=>Oe(be).name=w),class:"field w-56",placeholder:"Jane Operator",onBlur:c[3]||(c[3]=w=>Je("Saved."))},null,544),[[ye,Oe(be).name]])]),_:1}),M(Se,{title:"Username",desc:"Your unique handle within PilotVault.",keywords:"username handle"},{default:xe(()=>[a("div",Nm,[c[73]||(c[73]=a("span",{class:"text-sm text-ink-muted"},"@",-1)),ee(a("input",{"onUpdate:modelValue":c[4]||(c[4]=w=>Oe(be).username=w),class:"field w-48",placeholder:"jane",onBlur:c[5]||(c[5]=w=>Je("Saved."))},null,544),[[ye,Oe(be).username]])])]),_:1}),M(Se,{title:"Email address",desc:"Used for sign-in and notifications.",keywords:"email verification verify"},{default:xe(()=>[a("div",Dm,[a("span",Fm,k(t.email||"—"),1),a("span",Rm,[M(W,{name:"mail",size:12}),c[74]||(c[74]=z(" Unverified ",-1))])])]),_:1}),M(Se,{title:"Role",desc:"Your access level in PilotVault.",keywords:"role admin user superadmin access rights permissions"},{default:xe(()=>[a("span",{class:Ae(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",y(t.role)])},[M(W,{name:_(t.role),size:12},null,8,["name"]),z(k(h(t.role)),1)],2)]),_:1}),M(Se,{title:"Organization",desc:"The organization your account belongs to.",keywords:"organization org tenant company"},{default:xe(()=>[a("span",{class:Ae(["text-sm",t.organizationName?"text-ink":"text-ink-muted"])},k(t.organizationName||(u.value?"All organizations":"None")),3)]),_:1}),M(Se,{block:"",title:"Verify email",desc:"Confirm ownership to enable password resets and alerts.",keywords:"verify email resend"},{default:xe(()=>[a("button",{class:"btn-ghost",onClick:ks},"Send verification link"),Xi.value?(p(),m("p",Bm,k(Xi.value),1)):N("",!0)]),_:1}),M(Se,{block:"",title:"Change password",desc:"Use at least 8 characters.",keywords:"password change current new"},{default:xe(()=>[a("div",Um,[ee(a("input",{"onUpdate:modelValue":c[6]||(c[6]=w=>wt.current=w),type:"password",class:"field",placeholder:"Current password"},null,512),[[ye,wt.current]]),ee(a("input",{"onUpdate:modelValue":c[7]||(c[7]=w=>wt.next=w),type:"password",class:"field",placeholder:"New password"},null,512),[[ye,wt.next]]),ee(a("input",{"onUpdate:modelValue":c[8]||(c[8]=w=>wt.confirm=w),type:"password",class:"field",placeholder:"Confirm new password"},null,512),[[ye,wt.confirm]]),a("div",Vm,[a("button",{class:"btn-accent",onClick:dr},"Update password"),fi.value?(p(),m("span",{key:0,class:Ae(["text-xs",ws.value?"text-success-fg":"text-ink-muted"])},k(fi.value),3)):N("",!0)])])]),_:1})])):V.id==="appearance"?(p(),m("div",Zm,[M(Se,{title:"Theme",desc:"Light, dark, or follow your system.",keywords:"theme light dark system appearance"},{default:xe(()=>[M(mn,{modelValue:Le.value,"onUpdate:modelValue":c[9]||(c[9]=w=>Le.value=w),options:fe},null,8,["modelValue"])]),_:1}),M(Se,{title:"Font size",desc:"Scales the entire interface for readability.",keywords:"font size accessibility text"},{default:xe(()=>[M(mn,{modelValue:Oe(be).fontSize,"onUpdate:modelValue":c[10]||(c[10]=w=>Oe(be).fontSize=w),options:Ue},null,8,["modelValue"])]),_:1}),M(Se,{title:"Reduce motion",desc:"Minimise animations and transitions.",keywords:"reduce motion accessibility animation"},{default:xe(()=>[M(Kt,{modelValue:Oe(be).reduceMotion,"onUpdate:modelValue":c[11]||(c[11]=w=>Oe(be).reduceMotion=w)},null,8,["modelValue"])]),_:1}),M(Se,{title:"Language",desc:"Interface language.",keywords:"language locale"},{default:xe(()=>[ee(a("select",{"onUpdate:modelValue":c[12]||(c[12]=w=>Oe(be).language=w),class:"field w-48"},[(p(),m(le,null,Re(Ie,([w,He])=>a("option",{key:w,value:w},k(He),9,Hm)),64))],512),[[Et,Oe(be).language]])]),_:1}),M(Se,{title:"Region",desc:"Affects number, unit and date defaults.",keywords:"region country locale"},{default:xe(()=>[ee(a("select",{"onUpdate:modelValue":c[13]||(c[13]=w=>Oe(be).region=w),class:"field w-48"},[(p(!0),m(le,null,Re(Oe(Ge),([w,He])=>(p(),m("option",{key:w,value:w},k(He),9,jm))),128))],512),[[Et,Oe(be).region]])]),_:1}),M(Se,{title:"Date format",desc:"How calendar dates are displayed.",keywords:"date format"},{default:xe(()=>[ee(a("select",{"onUpdate:modelValue":c[14]||(c[14]=w=>Oe(be).dateFormat=w),class:"field w-48"},[(p(),m(le,null,Re(Te,([w,He])=>a("option",{key:w,value:w},k(He),9,Wm)),64))],512),[[Et,Oe(be).dateFormat]])]),_:1}),M(Se,{title:"Time format",desc:"12- or 24-hour clock.",keywords:"time format clock 12 24 hour"},{default:xe(()=>[M(mn,{modelValue:Oe(be).timeFormat,"onUpdate:modelValue":c[15]||(c[15]=w=>Oe(be).timeFormat=w),options:Ne},null,8,["modelValue"])]),_:1}),M(Se,{title:"Preview",desc:"How timestamps appear across the app.",keywords:"preview date time"},{default:xe(()=>[a("span",Km,k(je.value),1)]),_:1}),c[75]||(c[75]=a("p",{class:"mt-3 text-xs text-ink-muted"}," Language & region are stored now; full localisation ships with the account service. ",-1))])):V.id==="integrations"?(p(),m("div",Gm,[B.value?N("",!0):(p(),m("div",qm,[(p(),m(le,null,Re(va,w=>a("button",{key:w.id,type:"button",class:Ae(["-mb-px inline-flex items-center gap-1.5 whitespace-nowrap border-b-2 px-3 py-2 text-sm font-semibold transition",Bo.value===w.id?"border-accent text-ink":"border-transparent text-ink-secondary hover:text-ink"]),onClick:He=>Bo.value=w.id},[M(W,{name:w.icon,size:16},null,8,["name"]),z(k(w.label),1)],10,Ym)),64))])),Ii("apis-external")?(p(),m(le,{key:1},[a("div",Jm,[a("div",Xm,[a("div",Qm,[M(W,{name:"radio",size:20})]),c[76]||(c[76]=a("div",{class:"min-w-0"},[a("div",{class:"text-sm font-semibold text-ink"},"OpenSky Network"),a("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))]),oe.loaded&&!oe.available?(p(),m("div",eg,[M(W,{name:"lock",size:14,class:"mr-1 inline"}),c[77]||(c[77]=z(" OpenSky is currently disabled by your administrator. Contact them to enable it. ",-1))])):N("",!0),oe.canEditOrg?(p(),m("div",tg,[c[78]||(c[78]=a("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),M(mn,{modelValue:We.value,"onUpdate:modelValue":c[16]||(c[16]=w=>We.value=w),options:ut},null,8,["modelValue"])])):N("",!0),ge.value?(p(),ot(Se,{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:xe(()=>[M(Kt,{"model-value":oe.orgEnabled,disabled:!oe.available,"onUpdate:modelValue":O},null,8,["model-value","disabled"])]),_:1})):(p(),ot(Se,{key:3,title:"Enable OpenSky",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin opensky"},{default:xe(()=>[M(Kt,{"model-value":oe.enabled,disabled:!oe.available||!oe.orgEnabled,"onUpdate:modelValue":O},null,8,["model-value","disabled"])]),_:1})),!ge.value&&oe.available&&!oe.orgEnabled?(p(),m("div",ng,[M(W,{name:"lock",size:13,class:"mr-1 inline"}),c[80]||(c[80]=z("OpenSky is turned off for your organization",-1)),oe.canEditOrg?(p(),m("span",ig,[...c[79]||(c[79]=[z(" — switch to ",-1),a("span",{class:"font-semibold"},"Organization",-1),z(" to turn it back on",-1)])])):N("",!0),c[81]||(c[81]=z(". ",-1))])):N("",!0),ge.value?(p(),m("div",og,[M(W,{name:"users",size:13,class:"mr-1 inline"}),c[82]||(c[82]=z("These are organization-wide settings — they apply to everyone in ",-1)),a("span",sg,k(t.organizationName||"your organization"),1),c[83]||(c[83]=z(". Leave a field blank to let each user choose their own; a value set here overrides the user's. ",-1))])):ne.value?(p(),m("div",ag," As a superadmin you manage the global OpenSky configuration in the API Server panel. The effective configuration is shown below. ")):N("",!0),oe.available&&!ge.value?(p(),m("div",rg,[a("div",lg,[a("div",ug,[M(W,{name:"signal",size:15}),c[84]||(c[84]=z("Credit usage ",-1))]),ke.value?(p(),m("span",cg,"Checked "+k(J()),1)):N("",!0)]),De.value?(p(),m(le,{key:0},[De.value.remaining!=null?(p(),m(le,{key:0},[a("div",dg,[a("span",fg,k(Ve(De.value.remaining)),1),a("span",hg,"/ "+k(Ve(De.value.daily))+" credits left today",1)]),a("div",pg,[a("div",{class:Ae(["h-full rounded-full transition-all",lt.value]),style:wo({width:ht.value+"%"})},null,6)]),a("div",mg," Used "+k(Ve(De.value.daily-De.value.remaining))+" today · "+k(De.value.probeCost)+" credit"+k(De.value.probeCost===1?"":"s")+" per query · "+k(De.value.mode),1)],64)):(p(),m(le,{key:1},[a("div",gg,[c[85]||(c[85]=z("Daily allowance: ",-1)),a("span",vg,k(Ve(De.value.daily)),1),c[86]||(c[86]=z(" credits",-1))]),a("div",_g,k(De.value.probeCost)+" credit"+k(De.value.probeCost===1?"":"s")+" per query · "+k(De.value.mode)+". OpenSky only reports live remaining credits for authenticated requests — add OAuth2 credentials below to track usage. ",1)],64))],64)):(p(),m("div",bg,[...c[87]||(c[87]=[z(" Run ",-1),a("span",{class:"font-semibold text-ink-secondary"},"Test connection",-1),z(" below to fetch your live OpenSky credit balance. ",-1)])]))])):N("",!0),M(Se,{title:"OpenSky plan",desc:"Your account tier — sets the daily credit allowance.",keywords:"plan tier credits"},{default:xe(()=>[Ce("plan")?(p(),m("span",yg,[z(k((_t.find(w=>w.value===se("plan").effective)||{}).label||se("plan").effective||"—")+" ",1),Me("plan")?(p(),m("span",xg,[M(W,{name:"lock",size:10}),z(k(Me("plan")),1)])):N("",!0)])):(p(),ot(mn,{key:1,modelValue:ue.plan,"onUpdate:modelValue":c[17]||(c[17]=w=>ue.plan=w),options:_t},null,8,["modelValue"]))]),_:1}),M(Se,{title:"Default bounding box",desc:"Automatic follows your location; or pick a region, or enter lamin,lomin,lamax,lomax by hand.",keywords:"bounding box bbox area region country continent world europe custom coordinates automatic location drone"},{default:xe(()=>[Ce("bbox")?(p(),m("span",wg,[z(k(S(se("bbox").effective)||se("bbox").effective||"—")+" ",1),Me("bbox")?(p(),m("span",kg,[M(W,{name:"lock",size:10}),z(k(Me("bbox")),1)])):N("",!0)])):(p(),m("div",Sg,[ee(a("select",{"onUpdate:modelValue":c[18]||(c[18]=w=>K.value=w),class:"field w-64"},[ge.value?N("",!0):(p(),m("option",Tg,"Automatic (by location)")),(p(),m(le,null,Re(Pt,w=>a("optgroup",{key:w.label,label:w.label},[(p(!0),m(le,null,Re(w.options,He=>(p(),m("option",{key:He.value,value:He.value},k(He.label),9,Cg))),128))],8,Pg)),64)),c[88]||(c[88]=a("option",{value:"__custom__"},"Custom…",-1))],512),[[Et,K.value]]),re.value?(p(),m("p",Lg," Live map follows drone location → your device location → your Region ("+k(we.value)+"). ",1)):N("",!0),H.value?ee((p(),m("input",{key:1,"onUpdate:modelValue":c[19]||(c[19]=w=>ue.bbox=w),class:"field w-64 font-mono",placeholder:"50.5,3.2,53.7,7.3"},null,512)),[[ye,ue.bbox]]):N("",!0)]))]),_:1}),M(Se,{title:"OAuth2 client ID",desc:"Optional — leave blank for anonymous access (lower limits).",keywords:"oauth client id credentials"},{default:xe(()=>[Ce("clientId")?(p(),m("span",Mg,[z(k(se("clientId").effective||"—")+" ",1),Me("clientId")?(p(),m("span",Ag,[M(W,{name:"lock",size:10}),z(k(Me("clientId")),1)])):N("",!0)])):ee((p(),m("input",{key:1,"onUpdate:modelValue":c[20]||(c[20]=w=>ue.clientId=w),class:"field w-64",placeholder:"your-api-client"},null,512)),[[ye,ue.clientId]])]),_:1}),M(Se,{title:"OAuth2 client secret",desc:"Paired with the client ID for authenticated access.",keywords:"oauth client secret credentials password"},{default:xe(()=>[Ce("clientSecret")?(p(),m("span",Eg,[z(k(se("clientSecret").effective||"—")+" ",1),Me("clientSecret")?(p(),m("span",Og,[M(W,{name:"lock",size:10}),z(k(Me("clientSecret")),1)])):N("",!0)])):ee((p(),m("input",{key:1,"onUpdate:modelValue":c[21]||(c[21]=w=>ue.clientSecret=w),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[ye,ue.clientSecret]])]),_:1}),oe.available&&!oe.allowAnonymous?(p(),m("div",zg," Anonymous access is disabled by the administrator — OpenSky needs OAuth2 credentials from some layer to work. ")):N("",!0),a("div",Ig,[ne.value?N("",!0):(p(),m("button",{key:0,class:"btn-accent",disabled:ae.value||!oe.available,onClick:Pe},k(ae.value?"Saving…":ge.value?"Save organization settings":"Save settings"),9,$g)),ge.value?N("",!0):(p(),m("div",Ng,[c[91]||(c[91]=a("label",{class:"text-xs text-ink-muted"},"Test area",-1)),ee(a("select",{"onUpdate:modelValue":c[22]||(c[22]=w=>de.value=w),class:"field w-44"},[c[89]||(c[89]=a("option",{value:"__default__"},"Default bounding box",-1)),(p(),m(le,null,Re(qe,w=>a("optgroup",{key:w.label,label:w.label},[(p(!0),m(le,null,Re(w.options,He=>(p(),m("option",{key:He.value,value:He.value},k(He.label),9,Fg))),128))],8,Dg)),64)),c[90]||(c[90]=a("option",{value:"__custom__"},"Custom…",-1))],512),[[Et,de.value]]),Tt.value?ee((p(),m("input",{key:0,"onUpdate:modelValue":c[23]||(c[23]=w=>xt.value=w),class:"field w-44 font-mono",placeholder:"lamin,lomin,lamax,lomax"},null,512)),[[ye,xt.value]]):N("",!0)])),ge.value?N("",!0):(p(),m("button",{key:2,class:"btn-ghost",disabled:st.value||!oe.available,onClick:gn},k(st.value?"Testing…":"Test connection"),9,Rg)),ce.value?(p(),m("span",Bg,k(ce.value),1)):N("",!0),te.value&&!ge.value?(p(),m("span",{key:4,class:Ae(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",So(te.value.status)])},[c[92]||(c[92]=a("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),z(k(te.value.detail||te.value.status),1)],2)):N("",!0)])]),a("div",Ug,[a("div",Vg,[a("div",Zg,[M(W,{name:"sun",size:20})]),c[93]||(c[93]=a("div",{class:"min-w-0"},[a("div",{class:"text-sm font-semibold text-ink"},"OpenWeather"),a("div",{class:"mt-0.5 text-xs text-ink-muted"}," Current conditions and forecast from the OpenWeather API. Configure the API key and default location your account uses. ")],-1))]),et.loaded&&!et.available?(p(),m("div",Hg,[M(W,{name:"lock",size:14,class:"mr-1 inline"}),c[94]||(c[94]=z(" OpenWeather is currently disabled by your administrator. Contact them to enable it. ",-1))])):N("",!0),et.canEditOrg?(p(),m("div",jg,[c[95]||(c[95]=a("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),M(mn,{modelValue:Ln.value,"onUpdate:modelValue":c[24]||(c[24]=w=>Ln.value=w),options:ut},null,8,["modelValue"])])):N("",!0),yn.value?(p(),ot(Se,{key:2,title:"Enable OpenWeather (organization-wide)",desc:"Turn it on or off for everyone in your organization.",keywords:"enable disable plugin openweather weather organization"},{default:xe(()=>[M(Kt,{"model-value":et.orgEnabled,disabled:!et.available,"onUpdate:modelValue":Ai},null,8,["model-value","disabled"])]),_:1})):(p(),ot(Se,{key:3,title:"Enable OpenWeather",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin openweather weather"},{default:xe(()=>[M(Kt,{"model-value":et.enabled,disabled:!et.available||!et.orgEnabled,"onUpdate:modelValue":Ai},null,8,["model-value","disabled"])]),_:1})),!yn.value&&et.available&&!et.orgEnabled?(p(),m("div",Wg,[M(W,{name:"lock",size:13,class:"mr-1 inline"}),c[97]||(c[97]=z("OpenWeather is turned off for your organization",-1)),et.canEditOrg?(p(),m("span",Kg,[...c[96]||(c[96]=[z(" — switch to ",-1),a("span",{class:"font-semibold"},"Organization",-1),z(" to turn it back on",-1)])])):N("",!0),c[98]||(c[98]=z(". ",-1))])):N("",!0),yn.value?(p(),m("div",Gg,[M(W,{name:"users",size:13,class:"mr-1 inline"}),c[99]||(c[99]=z("These are organization-wide settings — they apply to everyone in ",-1)),a("span",qg,k(t.organizationName||"your organization"),1),c[100]||(c[100]=z(". Leave the API key blank to let each user configure their own; a key set here overrides the user's. ",-1))])):Mi.value?(p(),m("div",Yg," As a superadmin you manage the global OpenWeather configuration in the API Server panel. The effective configuration is shown below. ")):N("",!0),M(Se,{title:"API key",desc:"Your OpenWeather API key (the appid parameter). Required — OpenWeather has no anonymous tier.",keywords:"api key appid secret credentials token openweather"},{default:xe(()=>[Ft("apiKey")?(p(),m("span",Jg,[z(k($e("apiKey").effective||"—")+" ",1),Qe("apiKey")?(p(),m("span",Xg,[M(W,{name:"lock",size:10}),z(k(Qe("apiKey")),1)])):N("",!0)])):ee((p(),m("input",{key:1,"onUpdate:modelValue":c[25]||(c[25]=w=>Dt.apiKey=w),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[ye,Dt.apiKey]])]),_:1}),M(Se,{title:"Units",desc:"Measurement system for temperatures and wind speed.",keywords:"units metric imperial standard celsius fahrenheit kelvin"},{default:xe(()=>[Ft("units")?(p(),m("span",Qg,[z(k((Io.find(w=>w.value===$e("units").effective)||{}).label||$e("units").effective||"—")+" ",1),Qe("units")?(p(),m("span",ev,[M(W,{name:"lock",size:10}),z(k(Qe("units")),1)])):N("",!0)])):(p(),ot(mn,{key:1,modelValue:Dt.units,"onUpdate:modelValue":c[26]||(c[26]=w=>Dt.units=w),options:Io},null,8,["modelValue"]))]),_:1}),M(Se,{title:"Default latitude",desc:"Latitude used by the health probe and calls with no location (−90…90).",keywords:"latitude location coordinates default"},{default:xe(()=>[Ft("lat")?(p(),m("span",tv,[z(k($e("lat").effective||"—")+" ",1),Qe("lat")?(p(),m("span",nv,[M(W,{name:"lock",size:10}),z(k(Qe("lat")),1)])):N("",!0)])):ee((p(),m("input",{key:1,"onUpdate:modelValue":c[27]||(c[27]=w=>Dt.lat=w),inputmode:"decimal",class:"field w-40 font-mono",placeholder:"52.2297"},null,512)),[[ye,Dt.lat]])]),_:1}),M(Se,{title:"Default longitude",desc:"Longitude used by the health probe and calls with no location (−180…180).",keywords:"longitude location coordinates default"},{default:xe(()=>[Ft("lon")?(p(),m("span",iv,[z(k($e("lon").effective||"—")+" ",1),Qe("lon")?(p(),m("span",ov,[M(W,{name:"lock",size:10}),z(k(Qe("lon")),1)])):N("",!0)])):ee((p(),m("input",{key:1,"onUpdate:modelValue":c[28]||(c[28]=w=>Dt.lon=w),inputmode:"decimal",class:"field w-40 font-mono",placeholder:"21.0122"},null,512)),[[ye,Dt.lon]])]),_:1}),M(Se,{title:"Language",desc:"Optional ISO code for human-readable weather descriptions, e.g. en, pl, de.",keywords:"language locale description"},{default:xe(()=>[Ft("lang")?(p(),m("span",sv,[z(k($e("lang").effective||"—")+" ",1),Qe("lang")?(p(),m("span",av,[M(W,{name:"lock",size:10}),z(k(Qe("lang")),1)])):N("",!0)])):ee((p(),m("input",{key:1,"onUpdate:modelValue":c[29]||(c[29]=w=>Dt.lang=w),class:"field w-24 font-mono",placeholder:"en"},null,512)),[[ye,Dt.lang]])]),_:1}),M(Se,{title:"Calls per minute limit",desc:"Your plan's per-minute limit (free tier is 60). Only used to gauge app usage below.",keywords:"calls per minute limit rate quota plan usage"},{default:xe(()=>[Ft("callsPerMinute")?(p(),m("span",rv,[z(k($e("callsPerMinute").effective||"60")+" ",1),Qe("callsPerMinute")?(p(),m("span",lv,[M(W,{name:"lock",size:10}),z(k(Qe("callsPerMinute")),1)])):N("",!0)])):ee((p(),m("input",{key:1,"onUpdate:modelValue":c[30]||(c[30]=w=>Dt.callsPerMinute=w),inputmode:"numeric",class:"field w-24 font-mono",placeholder:"60"},null,512)),[[ye,Dt.callsPerMinute]])]),_:1}),et.available&&!yn.value?(p(),m("div",uv,[a("div",cv,[a("div",dv,[M(W,{name:"signal",size:15}),c[101]||(c[101]=z("API call usage ",-1))]),Un.value?(p(),m("span",fv,"Checked "+k(No()),1)):N("",!0)]),Ei.value?(p(),m(le,{key:0},[a("div",hv,[a("span",pv,k(Ei.value.minuteUsed),1),a("span",mv,"/ "+k(Ei.value.minuteLimit||"—")+" calls this minute",1)]),ms.value!=null?(p(),m("div",gv,[a("div",{class:Ae(["h-full rounded-full transition-all",da.value]),style:wo({width:ms.value+"%"})},null,6)])):N("",!0),a("div",vv,k(Ei.value.dayUsed)+" calls today · counts only requests PilotVault makes with this key, since server start. OpenWeather does not report remaining quota — check your account dashboard for the authoritative total. ",1)],64)):(p(),m("div",_v,[...c[102]||(c[102]=[z(" Run ",-1),a("span",{class:"font-semibold text-ink-secondary"},"Test connection",-1),z(" below to record and show call usage. ",-1)])]))])):N("",!0),a("div",bv,[Mi.value?N("",!0):(p(),m("button",{key:0,class:"btn-accent",disabled:Ci.value||!et.available,onClick:It},k(Ci.value?"Saving…":yn.value?"Save organization settings":"Save settings"),9,yv)),yn.value?N("",!0):(p(),m("button",{key:1,class:"btn-ghost",disabled:Li.value||!et.available,onClick:ci},k(Li.value?"Testing…":"Test connection"),9,xv)),Bn.value?(p(),m("span",wv,k(Bn.value),1)):N("",!0),Un.value&&!yn.value?(p(),m("span",kv,"Checked "+k(No()),1)):N("",!0),Ht.value&&!yn.value?(p(),m("span",{key:4,class:Ae(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",ca(Ht.value.status)])},[c[103]||(c[103]=a("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),z(k(Ht.value.detail||Ht.value.status),1)],2)):N("",!0)])])],64)):N("",!0),Ii("drives-external")?(p(),m(le,{key:2},[a("div",Sv,[a("div",Tv,[a("div",Pv,[M(W,{name:"server",size:20})]),c[104]||(c[104]=a("div",{class:"min-w-0"},[a("div",{class:"text-sm font-semibold text-ink"},"File Transfer (FTP / SFTP)"),a("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))]),ct.loaded&&!ct.available?(p(),m("div",Cv,[M(W,{name:"lock",size:14,class:"mr-1 inline"}),c[105]||(c[105]=z(" File transfer is currently disabled by your administrator. Contact them to enable it. ",-1))])):N("",!0),ct.canEditOrg?(p(),m("div",Lv,[c[106]||(c[106]=a("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),M(mn,{modelValue:si.value,"onUpdate:modelValue":c[31]||(c[31]=w=>si.value=w),options:ut},null,8,["modelValue"])])):N("",!0),Pn.value?(p(),ot(Se,{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:xe(()=>[M(Kt,{"model-value":ct.orgEnabled,disabled:!ct.available,"onUpdate:modelValue":aa},null,8,["model-value","disabled"])]),_:1})):(p(),ot(Se,{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:xe(()=>[M(Kt,{"model-value":ct.enabled,disabled:!ct.available||!ct.orgEnabled,"onUpdate:modelValue":aa},null,8,["model-value","disabled"])]),_:1})),!Pn.value&&ct.available&&!ct.orgEnabled?(p(),m("div",Mv,[M(W,{name:"lock",size:13,class:"mr-1 inline"}),c[108]||(c[108]=z("File transfer is turned off for your organization",-1)),ct.canEditOrg?(p(),m("span",Av,[...c[107]||(c[107]=[z(" — switch to ",-1),a("span",{class:"font-semibold"},"Organization",-1),z(" to turn it back on",-1)])])):N("",!0),c[109]||(c[109]=z(". ",-1))])):N("",!0),Pn.value?(p(),m("div",Ev,[M(W,{name:"users",size:13,class:"mr-1 inline"}),c[110]||(c[110]=z("These are organization-wide settings — they apply to everyone in ",-1)),a("span",Ov,k(t.organizationName||"your organization"),1),c[111]||(c[111]=z(". Leave the connection blank to let each user configure their own; a connection set here overrides the user's. ",-1))])):as.value?(p(),m("div",zv," As a superadmin you manage the global file-transfer configuration in the API Server panel. The effective configuration is shown below. ")):N("",!0),M(Se,{title:"Protocol",desc:"SFTP (over SSH), FTPS (FTP over TLS), or plain FTP.",keywords:"protocol sftp ftps ftp"},{default:xe(()=>[Qt("protocol")?(p(),m("span",Iv,[z(k(ia(ve("protocol").effective))+" ",1),Lt("protocol")?(p(),m("span",$v,[M(W,{name:"lock",size:10}),z(k(Lt("protocol")),1)])):N("",!0)])):(p(),ot(mn,{key:1,modelValue:pt.protocol,"onUpdate:modelValue":c[32]||(c[32]=w=>pt.protocol=w),options:na},null,8,["modelValue"]))]),_:1}),M(Se,{title:"Host",desc:"Server hostname or IP address.",keywords:"host server address"},{default:xe(()=>[Qt("host")?(p(),m("span",Nv,[z(k(ve("host").effective||"—")+" ",1),Lt("host")?(p(),m("span",Dv,[M(W,{name:"lock",size:10}),z(k(Lt("host")),1)])):N("",!0)])):ee((p(),m("input",{key:1,"onUpdate:modelValue":c[33]||(c[33]=w=>pt.host=w),class:"field w-64",placeholder:"files.example.com"},null,512)),[[ye,pt.host]])]),_:1}),M(Se,{title:"Port",desc:"Leave blank for the protocol default (22 for SFTP, 21 for FTP/FTPS).",keywords:"port"},{default:xe(()=>[Qt("port")?(p(),m("span",Fv,[z(k(ve("port").effective||"default")+" ",1),Lt("port")?(p(),m("span",Rv,[M(W,{name:"lock",size:10}),z(k(Lt("port")),1)])):N("",!0)])):ee((p(),m("input",{key:1,"onUpdate:modelValue":c[34]||(c[34]=w=>pt.port=w),inputmode:"numeric",class:"field w-24 font-mono",placeholder:"22"},null,512)),[[ye,pt.port]])]),_:1}),M(Se,{title:"Username",desc:"Account used to authenticate.",keywords:"username login account"},{default:xe(()=>[Qt("username")?(p(),m("span",Bv,[z(k(ve("username").effective||"—")+" ",1),Lt("username")?(p(),m("span",Uv,[M(W,{name:"lock",size:10}),z(k(Lt("username")),1)])):N("",!0)])):ee((p(),m("input",{key:1,"onUpdate:modelValue":c[35]||(c[35]=w=>pt.username=w),class:"field w-64",placeholder:"user"},null,512)),[[ye,pt.username]])]),_:1}),M(Se,{title:"Password",desc:"Password auth for FTP/FTPS, or SFTP password login. Leave blank to use a key.",keywords:"password secret credentials"},{default:xe(()=>[Qt("password")?(p(),m("span",Vv,[z(k(ve("password").effective||"—")+" ",1),Lt("password")?(p(),m("span",Zv,[M(W,{name:"lock",size:10}),z(k(Lt("password")),1)])):N("",!0)])):ee((p(),m("input",{key:1,"onUpdate:modelValue":c[36]||(c[36]=w=>pt.password=w),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[ye,pt.password]])]),_:1}),Xt.value==="sftp"?(p(),ot(Se,{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:xe(()=>[Qt("privateKey")?(p(),m("span",Hv,[z(k(ve("privateKey").effective||"—")+" ",1),Lt("privateKey")?(p(),m("span",jv,[M(W,{name:"lock",size:10}),z(k(Lt("privateKey")),1)])):N("",!0)])):ee((p(),m("textarea",{key:1,"onUpdate:modelValue":c[37]||(c[37]=w=>pt.privateKey=w),rows:"3",class:"field w-full font-mono text-xs",placeholder:"-----BEGIN OPENSSH PRIVATE KEY-----"},null,512)),[[ye,pt.privateKey]])]),_:1})):N("",!0),Xt.value==="sftp"?(p(),ot(Se,{key:8,title:"Private key passphrase",desc:"Passphrase protecting the SSH private key, if any.",keywords:"passphrase key secret"},{default:xe(()=>[Qt("keyPassphrase")?(p(),m("span",Wv,[z(k(ve("keyPassphrase").effective||"—")+" ",1),Lt("keyPassphrase")?(p(),m("span",Kv,[M(W,{name:"lock",size:10}),z(k(Lt("keyPassphrase")),1)])):N("",!0)])):ee((p(),m("input",{key:1,"onUpdate:modelValue":c[38]||(c[38]=w=>pt.keyPassphrase=w),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[ye,pt.keyPassphrase]])]),_:1})):N("",!0),Xt.value==="sftp"?(p(),ot(Se,{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:xe(()=>[Qt("hostKeyFingerprint")?(p(),m("span",Gv,[z(k(ve("hostKeyFingerprint").effective||"—")+" ",1),Lt("hostKeyFingerprint")?(p(),m("span",qv,[M(W,{name:"lock",size:10}),z(k(Lt("hostKeyFingerprint")),1)])):N("",!0)])):ee((p(),m("input",{key:1,"onUpdate:modelValue":c[39]||(c[39]=w=>pt.hostKeyFingerprint=w),class:"field w-full font-mono text-xs",placeholder:"SHA256:…"},null,512)),[[ye,pt.hostKeyFingerprint]])]),_:1})):N("",!0),Xt.value==="ftps"?(p(),ot(Se,{key:10,title:"TLS verification",desc:"Skip only for self-signed test servers.",keywords:"tls certificate verify insecure ftps"},{default:xe(()=>[Qt("insecureSkipVerify")?(p(),m("span",Yv,[z(k(ve("insecureSkipVerify").effective==="true"?"Skip verification":"Verify certificate")+" ",1),Lt("insecureSkipVerify")?(p(),m("span",Jv,[M(W,{name:"lock",size:10}),z(k(Lt("insecureSkipVerify")),1)])):N("",!0)])):(p(),ot(mn,{key:1,modelValue:pt.insecureSkipVerify,"onUpdate:modelValue":c[40]||(c[40]=w=>pt.insecureSkipVerify=w),options:ss},null,8,["modelValue"]))]),_:1})):N("",!0),M(Se,{title:"Base path",desc:"Working directory and health-check target, e.g. /uploads.",keywords:"base path directory folder root"},{default:xe(()=>[Qt("basePath")?(p(),m("span",Xv,[z(k(ve("basePath").effective||"—")+" ",1),Lt("basePath")?(p(),m("span",Qv,[M(W,{name:"lock",size:10}),z(k(Lt("basePath")),1)])):N("",!0)])):ee((p(),m("input",{key:1,"onUpdate:modelValue":c[41]||(c[41]=w=>pt.basePath=w),class:"field w-64 font-mono",placeholder:"/uploads"},null,512)),[[ye,pt.basePath]])]),_:1}),a("div",e_,[as.value?N("",!0):(p(),m("button",{key:0,class:"btn-accent",disabled:Po.value||!ct.available,onClick:or},k(Po.value?"Saving…":Pn.value?"Save organization settings":"Save settings"),9,t_)),Pn.value?N("",!0):(p(),m("button",{key:1,class:"btn-ghost",disabled:Co.value||!ct.available,onClick:sr},k(Co.value?"Testing…":"Test connection"),9,n_)),Wi.value?(p(),m("span",i_,k(Wi.value),1)):N("",!0),Ti.value&&!Pn.value?(p(),m("span",o_,"Checked "+k(oa()),1)):N("",!0),Fn.value&&!Pn.value?(p(),m("span",{key:4,class:Ae(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",ra(Fn.value.status)])},[c[112]||(c[112]=a("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),z(k(Fn.value.detail||Fn.value.status),1)],2)):N("",!0)])]),a("div",s_,[a("div",a_,[a("div",r_,[M(W,{name:"cloud",size:20})]),c[113]||(c[113]=a("div",{class:"min-w-0"},[a("div",{class:"text-sm font-semibold text-ink"},"WebDAV"),a("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))]),dt.loaded&&!dt.available?(p(),m("div",l_,[M(W,{name:"lock",size:14,class:"mr-1 inline"}),c[114]||(c[114]=z(" WebDAV is currently disabled by your administrator. Contact them to enable it. ",-1))])):N("",!0),dt.canEditOrg?(p(),m("div",u_,[c[115]||(c[115]=a("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),M(mn,{modelValue:Rn.value,"onUpdate:modelValue":c[42]||(c[42]=w=>Rn.value=w),options:ut},null,8,["modelValue"])])):N("",!0),rt.value?(p(),ot(Se,{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:xe(()=>[M(Kt,{"model-value":dt.orgEnabled,disabled:!dt.available,"onUpdate:modelValue":ua},null,8,["model-value","disabled"])]),_:1})):(p(),ot(Se,{key:3,title:"Enable WebDAV",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin webdav"},{default:xe(()=>[M(Kt,{"model-value":dt.enabled,disabled:!dt.available||!dt.orgEnabled,"onUpdate:modelValue":ua},null,8,["model-value","disabled"])]),_:1})),!rt.value&&dt.available&&!dt.orgEnabled?(p(),m("div",c_,[M(W,{name:"lock",size:13,class:"mr-1 inline"}),c[117]||(c[117]=z("WebDAV is turned off for your organization",-1)),dt.canEditOrg?(p(),m("span",d_,[...c[116]||(c[116]=[z(" — switch to ",-1),a("span",{class:"font-semibold"},"Organization",-1),z(" to turn it back on",-1)])])):N("",!0),c[118]||(c[118]=z(". ",-1))])):N("",!0),rt.value?(p(),m("div",f_,[M(W,{name:"users",size:13,class:"mr-1 inline"}),c[119]||(c[119]=z("These are organization-wide settings — they apply to everyone in ",-1)),a("span",h_,k(t.organizationName||"your organization"),1),c[120]||(c[120]=z(". Leave the connection blank to let each user configure their own; a connection set here overrides the user's. ",-1))])):Ao.value?(p(),m("div",p_," As a superadmin you manage the global WebDAV configuration in the API Server panel. The effective configuration is shown below. ")):N("",!0),M(Se,{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:xe(()=>[bn("baseURL")?(p(),m("span",m_,[z(k(_n("baseURL").effective||"—")+" ",1),Ut("baseURL")?(p(),m("span",g_,[M(W,{name:"lock",size:10}),z(k(Ut("baseURL")),1)])):N("",!0)])):ee((p(),m("input",{key:1,"onUpdate:modelValue":c[43]||(c[43]=w=>Zt.baseURL=w),class:"field w-full font-mono text-xs",placeholder:"https://cloud.example.com/remote.php/dav/files/alice/"},null,512)),[[ye,Zt.baseURL]])]),_:1}),M(Se,{title:"Username",desc:"Account used to authenticate (leave blank for a public share).",keywords:"username login account"},{default:xe(()=>[bn("username")?(p(),m("span",v_,[z(k(_n("username").effective||"—")+" ",1),Ut("username")?(p(),m("span",__,[M(W,{name:"lock",size:10}),z(k(Ut("username")),1)])):N("",!0)])):ee((p(),m("input",{key:1,"onUpdate:modelValue":c[44]||(c[44]=w=>Zt.username=w),class:"field w-64",placeholder:"user"},null,512)),[[ye,Zt.username]])]),_:1}),M(Se,{title:"Password",desc:"Password or app-specific token for HTTP Basic auth.",keywords:"password secret credentials token"},{default:xe(()=>[bn("password")?(p(),m("span",b_,[z(k(_n("password").effective||"—")+" ",1),Ut("password")?(p(),m("span",y_,[M(W,{name:"lock",size:10}),z(k(Ut("password")),1)])):N("",!0)])):ee((p(),m("input",{key:1,"onUpdate:modelValue":c[45]||(c[45]=w=>Zt.password=w),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[ye,Zt.password]])]),_:1}),M(Se,{title:"TLS verification",desc:"Only affects HTTPS. Skip only for self-signed test servers.",keywords:"tls certificate verify insecure https"},{default:xe(()=>[bn("insecureSkipVerify")?(p(),m("span",x_,[z(k(_n("insecureSkipVerify").effective==="true"?"Skip verification":"Verify certificate")+" ",1),Ut("insecureSkipVerify")?(p(),m("span",w_,[M(W,{name:"lock",size:10}),z(k(Ut("insecureSkipVerify")),1)])):N("",!0)])):(p(),ot(mn,{key:1,modelValue:Zt.insecureSkipVerify,"onUpdate:modelValue":c[46]||(c[46]=w=>Zt.insecureSkipVerify=w),options:la},null,8,["modelValue"]))]),_:1}),M(Se,{title:"Base path",desc:"Working directory under the server URL and health-check target, e.g. /Documents.",keywords:"base path directory folder root"},{default:xe(()=>[bn("basePath")?(p(),m("span",k_,[z(k(_n("basePath").effective||"—")+" ",1),Ut("basePath")?(p(),m("span",S_,[M(W,{name:"lock",size:10}),z(k(Ut("basePath")),1)])):N("",!0)])):ee((p(),m("input",{key:1,"onUpdate:modelValue":c[47]||(c[47]=w=>Zt.basePath=w),class:"field w-64 font-mono",placeholder:"/Documents"},null,512)),[[ye,Zt.basePath]])]),_:1}),a("div",T_,[Ao.value?N("",!0):(p(),m("button",{key:0,class:"btn-accent",disabled:Lo.value||!dt.available,onClick:zo},k(Lo.value?"Saving…":rt.value?"Save organization settings":"Save settings"),9,P_)),rt.value?N("",!0):(p(),m("button",{key:1,class:"btn-ghost",disabled:Mo.value||!dt.available,onClick:ri},k(Mo.value?"Testing…":"Test connection"),9,C_)),Gi.value?(p(),m("span",L_,k(Gi.value),1)):N("",!0),Cn.value&&!rt.value?(p(),m("span",M_,"Checked "+k(Mt()),1)):N("",!0),vn.value&&!rt.value?(p(),m("span",{key:4,class:Ae(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",At(vn.value.status)])},[c[121]||(c[121]=a("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),z(k(vn.value.detail||vn.value.status),1)],2)):N("",!0)])])],64)):N("",!0),Ii("drives-local")?(p(),m("div",A_,[a("div",E_,[a("div",O_,[M(W,{name:"monitor",size:20})]),c[122]||(c[122]=a("div",{class:"min-w-0"},[a("div",{class:"text-sm font-semibold text-ink"},"Local Storage"),a("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))]),Ee.loaded&&!Ee.available?(p(),m("div",z_,[M(W,{name:"lock",size:14,class:"mr-1 inline"}),c[123]||(c[123]=z(" Local storage is currently disabled by your administrator. Contact them to enable it. ",-1))])):Ee.loaded&&!Ee.rootConfigured?(p(),m("div",I_,[M(W,{name:"alertTriangle",size:14,class:"mr-1 inline"}),c[124]||(c[124]=z(" No storage root has been configured by your administrator yet. ",-1))])):N("",!0),Ee.canEditOrg?(p(),m("div",$_,[c[125]||(c[125]=a("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),M(mn,{modelValue:Oi.value,"onUpdate:modelValue":c[48]||(c[48]=w=>Oi.value=w),options:ut},null,8,["modelValue"])])):N("",!0),un.value?(p(),ot(Se,{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:xe(()=>[M(Kt,{"model-value":Ee.orgEnabled,disabled:!Ee.available,"onUpdate:modelValue":bs},null,8,["model-value","disabled"])]),_:1})):(p(),ot(Se,{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:xe(()=>[M(Kt,{"model-value":Ee.enabled,disabled:!Ee.available||!Ee.orgEnabled,"onUpdate:modelValue":bs},null,8,["model-value","disabled"])]),_:1})),!un.value&&Ee.available&&!Ee.orgEnabled?(p(),m("div",N_,[M(W,{name:"lock",size:13,class:"mr-1 inline"}),c[127]||(c[127]=z("Local storage is turned off for your organization",-1)),Ee.canEditOrg?(p(),m("span",D_,[...c[126]||(c[126]=[z(" — switch to ",-1),a("span",{class:"font-semibold"},"Organization",-1),z(" to turn it back on",-1)])])):N("",!0),c[128]||(c[128]=z(". ",-1))])):N("",!0),un.value?(p(),m("div",F_,[M(W,{name:"users",size:13,class:"mr-1 inline"}),c[129]||(c[129]=z("These are organization-wide settings — they apply to everyone in ",-1)),a("span",R_,k(t.organizationName||"your organization"),1),c[130]||(c[130]=z(", who all share the organization folder. Members can additionally enable a private folder inside it. ",-1))])):gs.value?(p(),m("div",B_," As a superadmin you manage the global storage root in the API Server panel. The effective configuration is shown below. ")):N("",!0),un.value?(p(),ot(Se,{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:xe(()=>[M(Kt,{"model-value":Ee.allowPrivate,disabled:!Ee.available,"onUpdate:modelValue":ur},null,8,["model-value","disabled"])]),_:1})):N("",!0),un.value?N("",!0):(p(),m(le,{key:9},[M(Se,{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:xe(()=>[a("div",U_,[(p(!0),m(le,null,Re(Ee.mounts,w=>(p(),m("div",{key:w.id,class:"flex flex-wrap items-center gap-2"},[a("span",V_,k(w.path),1),w.kind==="shared"?(p(),m("span",Z_,[M(W,{name:"users",size:10}),c[131]||(c[131]=z("Shared with your organization",-1))])):(p(),m("span",H_,[M(W,{name:"lock",size:10}),c[132]||(c[132]=z("Private to you",-1))])),Ji.value[w.id]?(p(),m("span",{key:2,class:Ae(["inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[10px] font-semibold",ga(Ji.value[w.id].status)])},[c[133]||(c[133]=a("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),z(k(Ji.value[w.id].status),1)],2)):N("",!0)]))),128)),Ee.mounts.length?N("",!0):(p(),m("div",j_,k(Ee.rootConfigured?"No folder assigned yet.":"Waiting for the administrator to configure a storage root."),1))])]),_:1}),Ee.isOrgUser&&Ee.allowPrivate?(p(),ot(Se,{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:xe(()=>[M(Kt,{"model-value":Ee.privateFolder,disabled:!Ee.available||!Ee.orgEnabled,"onUpdate:modelValue":ma},null,8,["model-value","disabled"])]),_:1})):Ee.isOrgUser&&!Ee.allowPrivate?(p(),m("div",W_,[M(W,{name:"lock",size:13,class:"mr-1 inline"}),c[134]||(c[134]=z("Private folders are turned off by your organization. ",-1))])):N("",!0)],64)),M(Se,{title:"Access mode",desc:"Read-only prevents uploads, deletes and folder creation.",keywords:"read only write access mode permission"},{default:xe(()=>[fa("readOnly")?(p(),m("span",K_,[z(k(rr(zi("readOnly").effective))+" ",1),xn("readOnly")?(p(),m("span",G_,[M(W,{name:"lock",size:10}),z(k(xn("readOnly")),1)])):N("",!0)])):(p(),ot(mn,{key:1,modelValue:Yi.value,"onUpdate:modelValue":c[49]||(c[49]=w=>Yi.value=w),options:Fo},null,8,["modelValue"]))]),_:1}),a("div",q_,[gs.value?N("",!0):(p(),m("button",{key:0,class:"btn-accent",disabled:Do.value||!Ee.available,onClick:cr},k(Do.value?"Saving…":un.value?"Save organization settings":"Save settings"),9,Y_)),un.value?N("",!0):(p(),m("button",{key:1,class:"btn-ghost",disabled:jt.value||!Ee.available,onClick:ys},k(jt.value?"Testing…":"Test folder"),9,J_)),Xe.value?(p(),m("span",X_,k(Xe.value),1)):N("",!0),di.value&&!un.value?(p(),m("span",Q_,"Checked "+k(ha()),1)):N("",!0),en.value&&!un.value?(p(),m("span",{key:4,class:Ae(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",ga(en.value.status)])},[c[135]||(c[135]=a("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),z(k(en.value.detail||en.value.status),1)],2)):N("",!0)])])):N("",!0)])):V.id==="profile"?(p(),m("div",e1,[M(Se,{block:"",title:"Profile photo",desc:"PNG or JPG, up to ~1.5 MB. Stored on this device.",keywords:"avatar photo picture"},{default:xe(()=>[a("div",t1,[Oe(be).avatar?(p(),m("img",{key:0,src:Oe(be).avatar,alt:"Avatar",class:"h-16 w-16 rounded-full object-cover"},null,8,n1)):(p(),m("div",i1,k(_a.value),1)),a("div",o1,[a("label",s1,[M(W,{name:"upload",size:15,class:"mr-1.5 inline"}),c[136]||(c[136]=z("Upload ",-1)),a("input",{type:"file",accept:"image/*",class:"hidden",onChange:fr},null,32)]),Oe(be).avatar?(p(),m("button",{key:0,class:"btn-ghost",onClick:hr},"Remove")):N("",!0)])])]),_:1}),M(Se,{title:"Display name",desc:"The name shown on your public profile.",keywords:"display name profile"},{default:xe(()=>[ee(a("input",{"onUpdate:modelValue":c[50]||(c[50]=w=>Oe(be).displayName=w),class:"field w-56",placeholder:"Jane O.",onBlur:c[51]||(c[51]=w=>Je("Saved."))},null,544),[[ye,Oe(be).displayName]])]),_:1}),M(Se,{block:"",title:"Bio",desc:"A short description others can see.",keywords:"bio about description"},{default:xe(()=>[ee(a("textarea",{"onUpdate:modelValue":c[52]||(c[52]=w=>Oe(be).bio=w),rows:"3",maxlength:"240",class:"field w-full resize-none",placeholder:"Flight director, North yard operations…",onBlur:c[53]||(c[53]=w=>Je("Saved."))},null,544),[[ye,Oe(be).bio]]),a("div",a1,k((Oe(be).bio||"").length)+"/240",1)]),_:1}),M(Se,{title:"Show email on profile",desc:"Let teammates see your email address.",keywords:"show email public visibility"},{default:xe(()=>[M(Kt,{modelValue:Oe(be).showEmail,"onUpdate:modelValue":c[54]||(c[54]=w=>Oe(be).showEmail=w)},null,8,["modelValue"])]),_:1})])):V.id==="security"?(p(),m("div",r1,[M(Se,{block:"",title:"Two-factor authentication",desc:"Require a one-time code at sign-in.",keywords:"two factor 2fa authentication security"},{default:xe(()=>[a("div",l1,[a("span",{class:Ae(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",Oe(be).twoFactor?"bg-success-soft text-success-fg":"bg-surface-2 text-ink-secondary"])},[c[137]||(c[137]=a("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),z(k(Oe(be).twoFactor?"Enabled":"Disabled"),1)],2),!Oe(be).twoFactor&&!Qi.value?(p(),m("button",{key:0,class:"btn-accent",onClick:$i},"Enable 2FA")):Oe(be).twoFactor?(p(),m("button",{key:1,class:"btn-ghost",onClick:to},"Disable")):N("",!0)]),Qi.value?(p(),m("div",u1,[a("div",c1,[c[139]||(c[139]=a("div",{class:"grid h-28 w-28 place-items-center rounded bg-white p-2"},[a("svg",{viewBox:"0 0 100 100",class:"h-full w-full"},[a("rect",{width:"100",height:"100",fill:"#fff"}),a("g",{fill:"#0F1E3D"},[a("rect",{x:"6",y:"6",width:"24",height:"24"}),a("rect",{x:"70",y:"6",width:"24",height:"24"}),a("rect",{x:"6",y:"70",width:"24",height:"24"}),a("rect",{x:"12",y:"12",width:"12",height:"12",fill:"#fff"}),a("rect",{x:"76",y:"12",width:"12",height:"12",fill:"#fff"}),a("rect",{x:"12",y:"76",width:"12",height:"12",fill:"#fff"}),a("rect",{x:"40",y:"10",width:"8",height:"8"}),a("rect",{x:"52",y:"20",width:"8",height:"8"}),a("rect",{x:"40",y:"40",width:"8",height:"8"}),a("rect",{x:"60",y:"44",width:"8",height:"8"}),a("rect",{x:"44",y:"60",width:"8",height:"8"}),a("rect",{x:"70",y:"60",width:"8",height:"8"}),a("rect",{x:"80",y:"72",width:"8",height:"8"}),a("rect",{x:"60",y:"80",width:"8",height:"8"})])])],-1)),a("div",d1,[c[138]||(c[138]=a("div",{class:"text-xs text-ink-secondary"},"Scan with an authenticator app, or enter this secret:",-1)),a("div",f1,k(dn.value),1),a("div",h1,[ee(a("input",{"onUpdate:modelValue":c[55]||(c[55]=w=>Vn.value=w),inputmode:"numeric",maxlength:"6",class:"field w-28 font-mono tracking-[0.3em]",placeholder:"000000"},null,512),[[ye,Vn.value]]),a("button",{class:"btn-accent",onClick:pr},"Verify & enable")]),eo.value?(p(),m("p",p1,k(eo.value),1)):N("",!0)])])])):N("",!0),Oe(be).twoFactor&&fn.value.length?(p(),m("div",m1,[c[140]||(c[140]=a("div",{class:"text-xs font-semibold text-ink"},"Recovery codes",-1)),c[141]||(c[141]=a("div",{class:"mt-0.5 text-xs text-ink-muted"},"Store these somewhere safe — each works once.",-1)),a("div",g1,[(p(!0),m(le,null,Re(fn.value,w=>(p(),m("span",{key:w,class:"select-all"},k(w),1))),128))])])):N("",!0),c[142]||(c[142]=a("p",{class:"mt-2 text-xs text-ink-muted"},"Prototype — codes are generated locally until the account service verifies them.",-1))]),_:1}),M(Se,{block:"",title:"Active sessions",desc:"Devices currently signed in to your account.",keywords:"sessions devices logout sign out remote"},{default:xe(()=>[a("div",v1,[a("div",_1,[a("div",b1,[M(W,{name:"monitor",size:18})]),a("div",y1,[a("div",x1,[z(k(Uo())+" on "+k(mr())+" ",1),c[143]||(c[143]=a("span",{class:"ml-1 rounded-full bg-success-soft px-2 py-0.5 text-[10px] font-semibold text-success-fg"},"This device",-1))]),a("div",w1,"Signed in "+k(Oe(ku)(Oe(Gn))),1)]),a("button",{class:"btn-ghost",onClick:c[56]||(c[56]=w=>l("logout"))},"Log out")])]),c[144]||(c[144]=a("button",{class:"btn-ghost mt-2 opacity-60",disabled:"",title:"Requires the account service"}," Log out all other devices ",-1)),c[145]||(c[145]=a("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})])):V.id==="team"?(p(),m("div",k1,[tt.id?(p(),m("div",S1,[M(Se,{block:"",title:`Edit user — ${tt.email}`,desc:"Update details, change role, reset password, or set verified.",keywords:"edit user update role password verified organization"},{default:xe(()=>[a("div",T1,[a("div",P1,[ee(a("input",{"onUpdate:modelValue":c[57]||(c[57]=w=>tt.email=w),type:"email",class:"field flex-1",placeholder:"name@pilotvault.local"},null,512),[[ye,tt.email]]),ee(a("select",{"onUpdate:modelValue":c[58]||(c[58]=w=>tt.role=w),class:"field w-32",disabled:Ho.value,title:Ho.value?"You cannot change your own role":""},[(p(!0),m(le,null,Re(ba.value,w=>(p(),m("option",{key:w.value,value:w.value},k(w.label),9,L1))),128))],8,C1),[[Et,tt.role]])]),u.value?ee((p(),m("select",{key:0,"onUpdate:modelValue":c[59]||(c[59]=w=>tt.organization=w),class:"field",title:"Organization"},[(p(!0),m(le,null,Re(Ts.value,w=>(p(),m("option",{key:w.value,value:w.value},k(w.label),9,M1))),128))],512)),[[Et,tt.organization]]):N("",!0),ee(a("input",{"onUpdate:modelValue":c[60]||(c[60]=w=>tt.password=w),type:"password",class:"field",placeholder:"New password (leave blank to keep current)"},null,512),[[ye,tt.password]]),a("label",A1,[M(Kt,{modelValue:tt.verified,"onUpdate:modelValue":c[61]||(c[61]=w=>tt.verified=w)},null,8,["modelValue"]),c[146]||(c[146]=z(" Email verified ",-1))]),a("div",E1,[a("button",{class:"btn-accent",disabled:Di.value,onClick:vr},k(Di.value?"Saving…":"Save changes"),9,O1),a("button",{class:"btn-ghost",onClick:io},"Cancel"),kn.value?(p(),m("span",z1,k(kn.value),1)):N("",!0),Ho.value?(p(),m("span",I1,"Editing your own account — role locked.")):N("",!0)])])]),_:1},8,["title"])])):(p(),m("div",$1,[M(Se,{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:xe(()=>[a("div",N1,[a("div",D1,[ee(a("input",{"onUpdate:modelValue":c[62]||(c[62]=w=>$t.email=w),type:"email",class:"field flex-1",placeholder:"name@pilotvault.local"},null,512),[[ye,$t.email]]),ee(a("select",{"onUpdate:modelValue":c[63]||(c[63]=w=>$t.role=w),class:"field w-32"},[(p(!0),m(le,null,Re(ba.value,w=>(p(),m("option",{key:w.value,value:w.value},k(w.label),9,F1))),128))],512),[[Et,$t.role]])]),u.value?ee((p(),m("select",{key:0,"onUpdate:modelValue":c[64]||(c[64]=w=>$t.organization=w),class:"field",title:"Organization"},[(p(!0),m(le,null,Re(Ts.value,w=>(p(),m("option",{key:w.value,value:w.value},k(w.label),9,R1))),128))],512)),[[Et,$t.organization]]):(p(),m("div",B1,[c[147]||(c[147]=z(" New users join your organization: ",-1)),a("span",U1,k(t.organizationName||"—"),1)])),ee(a("input",{"onUpdate:modelValue":c[65]||(c[65]=w=>$t.password=w),type:"password",class:"field",placeholder:"Temporary password (min 8 chars)"},null,512),[[ye,$t.password]]),a("div",V1,[a("button",{class:"btn-accent",disabled:Vo.value,onClick:Ps},k(Vo.value?"Creating…":"Create user"),9,Z1),Wt.value?(p(),m("span",H1,k(Wt.value),1)):N("",!0)])])]),_:1})])),a("div",j1,[a("div",W1,[c[148]||(c[148]=a("div",null,[a("div",{class:"eyebrow"},"Team"),a("div",{class:"mt-0.5 text-base font-semibold text-ink"},"All users")],-1)),a("button",{class:"btn-ghost",disabled:no.value,onClick:Yn},k(no.value?"Loading…":"Refresh"),9,K1)]),Ni.value?(p(),m("div",G1,k(Ni.value),1)):!hi.value.length&&!no.value?(p(),m("div",q1,"No users yet.")):(p(),m("div",Y1,[a("table",J1,[a("thead",null,[a("tr",X1,[(p(),m(le,null,Re(["User","Role","Organization","Status",""],w=>a("th",{key:w,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(w),1)),64))])]),a("tbody",null,[(p(!0),m(le,null,Re(hi.value,w=>(p(),m("tr",{key:w.id,class:Ae(["border-b border-line last:border-0",tt.id===w.id?"bg-accent-soft":""])},[a("td",Q1,[a("span",eb,k(w.email),1),w.email===t.email?(p(),m("span",tb,"(you)")):N("",!0)]),a("td",nb,[a("span",{class:Ae(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",y(w.role||"user")])},[M(W,{name:_(w.role||"user"),size:12},null,8,["name"]),z(k(h(w.role||"user")),1)],2)]),a("td",ib,[a("span",{class:Ae(["text-sm",w.organizationName?"text-ink-secondary":"text-ink-muted"])},k(w.organizationName||"—"),3)]),a("td",ob,[a("span",{class:Ae(["text-xs",w.verified?"text-success-fg":"text-ink-muted"])},k(w.verified?"Verified":"Unverified"),3)]),a("td",sb,[An.value===w.id?(p(),m(le,{key:0},[c[149]||(c[149]=a("span",{class:"mr-2 text-xs text-ink-muted"},"Remove?",-1)),a("button",{class:"btn-ghost mr-1",onClick:c[66]||(c[66]=He=>An.value="")},"Cancel"),a("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:He=>Zo(w)}," Remove ",8,ab)],64)):(p(),m("div",rb,[a("button",{class:"btn-ghost inline-flex items-center gap-1.5",onClick:He=>gr(w)},[M(W,{name:"settings",size:14}),c[150]||(c[150]=z(" Edit ",-1))],8,lb),w.email!==t.email?(p(),m("button",{key:0,class:"btn-ghost inline-flex items-center gap-1.5",onClick:He=>An.value=w.id},[M(W,{name:"trash",size:14}),c[151]||(c[151]=z(" Remove ",-1))],8,ub)):N("",!0)]))])],2))),128))])])]))])])):V.id==="organizations"?(p(),m("div",cb,[Ot.id?(p(),m("div",db,[M(Se,{block:"",title:"Rename organization",desc:"Update the organization's display name.",keywords:"rename organization edit"},{default:xe(()=>[a("div",fb,[ee(a("input",{"onUpdate:modelValue":c[67]||(c[67]=w=>Ot.name=w),class:"field",placeholder:"Organization name",onKeyup:hu(ya,["enter"])},null,544),[[ye,Ot.name]]),a("div",hb,[a("button",{class:"btn-accent",onClick:ya},"Save changes"),a("button",{class:"btn-ghost",onClick:Ls},"Cancel"),En.value?(p(),m("span",pb,k(En.value),1)):N("",!0)])])]),_:1})])):(p(),m("div",mb,[M(Se,{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:xe(()=>[a("div",gb,[ee(a("input",{"onUpdate:modelValue":c[68]||(c[68]=w=>oo.name=w),class:"field",placeholder:"e.g. Northwind Aerial",onKeyup:hu(lo,["enter"])},null,544),[[ye,oo.name]]),a("div",vb,[a("button",{class:"btn-accent",disabled:ao.value,onClick:lo},k(ao.value?"Creating…":"Create organization"),9,_b),so.value?(p(),m("span",bb,k(so.value),1)):N("",!0)])])]),_:1})])),a("div",yb,[a("div",{class:"flex items-center justify-between px-5 py-4"},[c[152]||(c[152]=a("div",null,[a("div",{class:"eyebrow"},"Tenancy"),a("div",{class:"mt-0.5 text-base font-semibold text-ink"},"All organizations")],-1)),a("button",{class:"btn-ghost",onClick:qn},"Refresh")]),hn.value.length?(p(),m("div",wb,[a("table",kb,[a("thead",null,[a("tr",Sb,[(p(),m(le,null,Re(["Organization","Members",""],w=>a("th",{key:w,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(w),1)),64))])]),a("tbody",null,[(p(!0),m(le,null,Re(hn.value,w=>(p(),m("tr",{key:w.id,class:Ae(["border-b border-line last:border-0",Ot.id===w.id?"bg-accent-soft":""])},[a("td",Tb,[a("span",Pb,[M(W,{name:"grid",size:14,class:"text-ink-muted"}),z(k(w.name),1)])]),a("td",Cb,k(Cs.value[w.id]||0),1),a("td",Lb,[ro.value===w.id?(p(),m(le,{key:0},[c[153]||(c[153]=a("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),a("button",{class:"btn-ghost mr-1",onClick:c[69]||(c[69]=He=>ro.value="")},"Cancel"),a("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:He=>uo(w)}," Delete ",8,Mb)],64)):(p(),m("div",Ab,[a("button",{class:"btn-ghost inline-flex items-center gap-1.5",onClick:He=>_r(w)},[M(W,{name:"settings",size:14}),c[154]||(c[154]=z(" Rename ",-1))],8,Eb),a("button",{class:"btn-ghost inline-flex items-center gap-1.5",disabled:(Cs.value[w.id]||0)>0,title:(Cs.value[w.id]||0)>0?"Reassign or remove members first":"",onClick:He=>ro.value=w.id},[M(W,{name:"trash",size:14}),c[155]||(c[155]=z(" Delete ",-1))],8,Ob)]))])],2))),128))])])])):(p(),m("div",xb,"No organizations yet."))])])):V.id==="advanced"?(p(),m("div",zb,[a("div",Ib,[M(Se,{title:"Export data",desc:"Download your settings and profile as JSON.",keywords:"export data download backup"},{default:xe(()=>[a("button",{class:"btn-ghost",onClick:br},[M(W,{name:"download",size:15,class:"mr-1.5 inline"}),c[156]||(c[156]=z("Export",-1))])]),_:1}),M(Se,{block:"",title:"Import data",desc:"Restore settings from a previous export.",keywords:"import data upload restore"},{default:xe(()=>[a("label",$b,[M(W,{name:"upload",size:15,class:"mr-1.5 inline"}),c[157]||(c[157]=z("Choose file… ",-1)),a("input",{type:"file",accept:"application/json,.json",class:"hidden",onChange:xa},null,32)]),Zn.value?(p(),m("p",Nb,k(Zn.value),1)):N("",!0)]),_:1})]),a("div",Db,[a("div",Fb,[M(W,{name:"alertTriangle",size:18}),c[158]||(c[158]=a("h3",{class:"text-sm font-bold uppercase tracking-caps"},"Danger zone",-1))]),c[163]||(c[163]=a("p",{class:"mt-1 text-xs text-ink-secondary"},"Deleting your account is permanent and cannot be undone.",-1)),a("div",Rb,[c[162]||(c[162]=a("div",{class:"text-sm font-semibold text-ink"},"Delete account",-1)),a("label",Bb,[ee(a("input",{"onUpdate:modelValue":c[70]||(c[70]=w=>bt.understand=w),type:"checkbox",class:"mt-0.5 h-4 w-4 accent-[var(--danger)]"},null,512),[[Ua,bt.understand]]),c[159]||(c[159]=z(" I understand this permanently deletes my account and all associated data. ",-1))]),a("div",Ub,[a("label",Vb,[c[160]||(c[160]=z("Type ",-1)),a("span",Zb,k(Sn.value),1),c[161]||(c[161]=z(" to confirm",-1))]),ee(a("input",{"onUpdate:modelValue":c[71]||(c[71]=w=>bt.typed=w),class:"field w-full max-w-[360px] font-mono",placeholder:Sn.value},null,8,Hb),[[ye,bt.typed]])]),a("div",jb,[bt.armed?(p(),m("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:bt.cooldown>0,onClick:fo},k(bt.cooldown>0?`Confirm in ${bt.cooldown}s…`:"Permanently delete account"),9,Kb)):(p(),m("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:!jo.value,onClick:wa}," Delete account… ",8,Wb)),bt.armed&&bt.cooldown>0?(p(),m("span",Gb,"Cooling-off period — read once more.")):N("",!0)]),bt.msg?(p(),m("p",qb,k(bt.msg),1)):N("",!0)])])])):N("",!0)],64))),128))])]),M(vh,{name:"fade"},{default:xe(()=>[Mn.value?(p(),m("div",Yb,[M(W,{name:"check",size:16,class:"text-success-fg"}),z(k(Mn.value),1)])):N("",!0)]),_:1})]))}},Xb=Sm(Jb,[["__scopeId","data-v-cd994362"]]),Qb={class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},ey={class:"flex flex-wrap items-center gap-3"},ty={class:"inline-flex rounded-lg border border-line bg-surface-1 p-0.5"},ny=["onClick"],iy={class:"ml-auto flex items-center gap-2"},oy=["href"],sy={class:"grid grid-cols-4 gap-4 max-[900px]:grid-cols-2"},ay={class:"eyebrow"},ry={key:0,class:"panel border-danger/40 p-4 text-sm text-danger-fg"},ly={key:0,class:"panel p-5"},uy={class:"mb-4 flex items-center justify-between"},cy={class:"eyebrow"},dy={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},fy={class:"block"},hy={class:"block"},py={class:"block"},my={class:"block"},gy={key:0,value:""},vy=["value"],_y={class:"block"},by={class:"block"},yy={class:"block"},xy={class:"block"},wy={class:"block"},ky=["value"],Sy={class:"block"},Ty=["value"],Py={class:"block"},Cy=["value"],Ly={class:"block"},My={class:"mt-3 block"},Ay={key:0,class:"mt-3 grid grid-cols-2 gap-3 max-[760px]:grid-cols-1"},Ey={class:"block"},Oy={class:"block"},zy={class:"block"},Iy={class:"block"},$y={class:"col-span-2 block max-[760px]:col-span-1"},Ny={class:"mt-4 flex items-center gap-3"},Dy=["disabled"],Fy={key:0,class:"text-sm text-danger-fg"},Ry={class:"panel overflow-hidden p-0"},By={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},Uy={key:1,class:"grid place-items-center px-5 py-16 text-center"},Vy={key:2,class:"overflow-x-auto"},Zy={class:"w-full border-collapse text-sm"},Hy={class:"text-left"},jy={class:"whitespace-nowrap px-5 py-3 font-mono text-ink"},Wy={key:0,class:"text-ink-muted"},Ky={class:"px-5 py-3 text-ink-secondary"},Gy=["title"],qy={class:"px-5 py-3 font-mono text-ink-secondary"},Yy={class:"px-5 py-3 text-ink-secondary"},Jy={class:"px-5 py-3"},Xy=["onClick"],Qy={class:"whitespace-nowrap px-5 py-3 text-right"},ex=["onClick"],tx=["onClick"],nx=["onClick"],ix={key:0,class:"border-b border-line bg-surface-2"},ox={colspan:"7",class:"px-5 py-3"},sx={class:"flex flex-wrap gap-x-8 gap-y-1.5 text-xs"},ax={class:"text-ink-secondary"},rx={class:"text-ink"},lx={class:"text-ink-secondary"},ux={class:"text-ink"},cx={class:"text-ink-secondary"},dx={class:"font-mono text-ink"},fx={key:0,class:"text-ink-secondary"},hx={class:"text-ink"},px={key:0,class:"mt-2 space-y-1"},mx={key:1,class:"mt-2 text-xs text-success-fg"},gx={key:0,class:"panel p-5"},vx={class:"mb-4 flex items-center justify-between"},_x={class:"eyebrow"},bx={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},yx={class:"block"},xx={class:"block"},wx={class:"block"},kx={class:"block"},Sx={class:"block"},Tx={class:"block"},Px=["value"],Cx={class:"mt-3 flex flex-wrap gap-6"},Lx={class:"flex items-center gap-2 text-sm text-ink-secondary"},Mx={class:"flex items-center gap-2 text-sm text-ink-secondary"},Ax={class:"mt-4 flex items-center gap-3"},Ex=["disabled"],Ox={key:0,class:"text-sm text-danger-fg"},zx={class:"panel overflow-hidden p-0"},Ix={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},$x={key:1,class:"grid place-items-center px-5 py-16 text-center"},Nx={key:2,class:"overflow-x-auto"},Dx={class:"w-full border-collapse text-sm"},Fx={class:"text-left"},Rx={class:"px-5 py-3 font-semibold text-ink"},Bx={class:"px-5 py-3 text-ink-secondary"},Ux={class:"px-5 py-3 font-mono text-ink-secondary"},Vx={class:"px-5 py-3"},Zx={key:1,class:"text-ink-muted"},Hx={class:"px-5 py-3"},jx={class:"whitespace-nowrap px-5 py-3 text-right"},Wx=["onClick"],Kx=["onClick"],Gx=["onClick"],qx={__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,s={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=Z("flights"),u=Z([]),f=Z([]),h=Z(!1),_=Z("");async function y(){h.value=!0,_.value="";const[J,E]=await Promise.all([Jc(),Cp()]);(!J.ok||!E.ok)&&(_.value=J.status===503||E.status===503?"Logbook storage is not configured on the API Server (service account missing).":"Could not load the logbook."),u.value=J.drones,f.value=E.flights,h.value=!1}ki(y);function C(J){const E=J.compliance||{};return E.exempt?{tone:"neutral",label:"Exempt"}:(E.redFlags||[]).length?{tone:"danger",label:`${E.redFlags.length} issue${E.redFlags.length>1?"s":""}`}:{tone:"success",label:"Compliant"}}const T=Z("");function A(J){T.value=T.value===J?"":J}const R=[{value:"open",label:"Open"},{value:"specific",label:"Specific"},{value:"certified",label:"Certified"}],B=[{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"}],j=[{value:"",label:"Auto (from drone)"},{value:"manual",label:"Manual"},{value:"automatic",label:"Automatic (FDR)"}];function F(){var J;return{operationDate:new Date().toISOString().slice(0,10),startTime:"",endTime:"",drone:((J=u.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 pe=Z(!1),me=Z(""),Y=St(F()),Le=Z(""),fe=Z(!1),Ue=Z(!1);function Ne(){Object.assign(Y,F()),me.value="",Le.value="",Ue.value=!1,pe.value=!0}function Ie(J){Object.assign(Y,{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||""}),me.value=J.id,Le.value="",Ue.value=!!(J.weather||J.airspaceRef||J.observer||J.incidents||J.notes),pe.value=!0}function Ge(){pe.value=!1,me.value=""}async function we(){var I;if(Le.value="",!Y.drone){Le.value="Select a drone first (add one on the Drones tab).";return}fe.value=!0;const J={...Y,maxAltitudeAgl:Number(Y.maxAltitudeAgl)||0},E=me.value?await Mp(me.value,J):await Lp(J);if(fe.value=!1,!E.ok){Le.value=((I=E.body)==null?void 0:I.error)||"Could not save the flight.";return}pe.value=!1,await y()}const Te=Z("");async function ze(J){const E=await Ap(J.id);Te.value="",E.ok&&await y()}const ie=["","C0","C1","C2","C3","C4","C5","C6"];function je(){return{name:"",model:"",serial:"",operatorNumber:"",mtomGrams:"",isToy:!1,autologsFlights:!1,cClass:""}}const oe=Z(!1),We=Z(""),ue=St(je()),ce=Z(""),ae=Z(!1);function st(){Object.assign(ue,je()),We.value="",ce.value="",oe.value=!0}function te(J){Object.assign(ue,{name:J.name||"",model:J.model||"",serial:J.serial||"",operatorNumber:J.operatorNumber||"",mtomGrams:J.mtomGrams||"",isToy:!!J.isToy,autologsFlights:!!J.autologsFlights,cClass:J.cClass||""}),We.value=J.id,ce.value="",oe.value=!0}function ke(){oe.value=!1,We.value=""}async function De(){var I;if(ce.value="",!ue.name.trim()){ce.value="Give the drone a name.";return}ae.value=!0;const J={...ue,mtomGrams:Number(ue.mtomGrams)||0},E=We.value?await Tp(We.value,J):await Sp(J);if(ae.value=!1,!E.ok){ce.value=((I=E.body)==null?void 0:I.error)||"Could not save the drone.";return}oe.value=!1,await y()}const ht=Z("");async function lt(J){var I;const E=await Pp(J.id);ht.value="",E.ok?await y():ce.value=((I=E.body)==null?void 0:I.error)||"Could not delete the drone."}const Ve=he(()=>{const J=f.value.length,E=f.value.filter(_t=>{var ut;return(((ut=_t.compliance)==null?void 0:ut.redFlags)||[]).length}).length,I=f.value.filter(_t=>{var ut;return(ut=_t.compliance)==null?void 0:ut.required}).length;return{total:J,flagged:E,required:I,fleet:u.value.length}});return(J,E)=>(p(),m("div",Qb,[a("div",ey,[a("div",ty,[(p(),m(le,null,Re([["flights","Flights"],["drones","Drones"]],I=>a("button",{key:I[0],class:Ae(["rounded-md px-3.5 py-1.5 text-sm font-semibold transition",l.value===I[0]?"bg-accent-soft text-accent-soft-fg":"text-ink-secondary hover:text-ink"]),onClick:_t=>l.value=I[0]},k(I[1]),11,ny)),64))]),a("div",iy,[a("a",{href:Oe(Ep)(),class:"btn-ghost inline-flex items-center gap-2",title:"Download a compliance CSV (Trafikstyrelsen / police disclosure)"},[M(W,{name:"download",size:15}),E[29]||(E[29]=z(" Export CSV ",-1))],8,oy),l.value==="flights"?(p(),m("button",{key:0,class:"btn-accent inline-flex items-center gap-2",onClick:Ne},[M(W,{name:"plus",size:15}),E[30]||(E[30]=z(" Log flight ",-1))])):(p(),m("button",{key:1,class:"btn-accent inline-flex items-center gap-2",onClick:st},[M(W,{name:"plus",size:15}),E[31]||(E[31]=z(" Add drone ",-1))]))])]),a("div",sy,[(p(!0),m(le,null,Re([{label:"Flights logged",value:Ve.value.total,tone:"neutral"},{label:"Require logbook",value:Ve.value.required,tone:"neutral"},{label:"Compliance flags",value:Ve.value.flagged,tone:Ve.value.flagged?"danger":"success"},{label:"Registered drones",value:Ve.value.fleet,tone:"neutral"}],I=>(p(),m("div",{key:I.label,class:"panel p-5"},[a("div",ay,k(I.label),1),a("div",{class:Ae(["mt-2 text-[30px] font-bold leading-none tracking-tightest",I.tone==="danger"?"text-danger-fg":I.tone==="success"?"text-success-fg":"text-ink"])},k(I.value),3)]))),128))]),_.value?(p(),m("div",ry,k(_.value),1)):N("",!0),l.value==="flights"?(p(),m(le,{key:1},[pe.value?(p(),m("div",ly,[a("div",uy,[a("div",null,[a("div",cy,k(me.value?"Edit entry":"New entry"),1),E[32]||(E[32]=a("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Logbook flight (BEK 1649 §5)",-1))]),a("button",{class:"btn-icon",onClick:Ge},[M(W,{name:"x",size:16})])]),a("div",dy,[a("label",fy,[E[33]||(E[33]=a("span",{class:"eyebrow mb-1 block"},"Date",-1)),ee(a("input",{"onUpdate:modelValue":E[0]||(E[0]=I=>Y.operationDate=I),type:"date",class:"field"},null,512),[[ye,Y.operationDate]])]),a("label",hy,[E[34]||(E[34]=a("span",{class:"eyebrow mb-1 block"},"Start",-1)),ee(a("input",{"onUpdate:modelValue":E[1]||(E[1]=I=>Y.startTime=I),type:"time",class:"field"},null,512),[[ye,Y.startTime]])]),a("label",py,[E[35]||(E[35]=a("span",{class:"eyebrow mb-1 block"},"End",-1)),ee(a("input",{"onUpdate:modelValue":E[2]||(E[2]=I=>Y.endTime=I),type:"time",class:"field"},null,512),[[ye,Y.endTime]])]),a("label",my,[E[36]||(E[36]=a("span",{class:"eyebrow mb-1 block"},"Drone",-1)),ee(a("select",{"onUpdate:modelValue":E[3]||(E[3]=I=>Y.drone=I),class:"field"},[u.value.length?N("",!0):(p(),m("option",gy,"— add a drone first —")),(p(!0),m(le,null,Re(u.value,I=>(p(),m("option",{key:I.id,value:I.id},k(I.name)+k(I.model?` · ${I.model}`:""),9,vy))),128))],512),[[Et,Y.drone]])]),a("label",_y,[E[37]||(E[37]=a("span",{class:"eyebrow mb-1 block"},"Max altitude (m AGL)",-1)),ee(a("input",{"onUpdate:modelValue":E[4]||(E[4]=I=>Y.maxAltitudeAgl=I),type:"number",min:"0",class:"field",placeholder:"120"},null,512),[[ye,Y.maxAltitudeAgl]])]),a("label",by,[E[38]||(E[38]=a("span",{class:"eyebrow mb-1 block"},"Area / route",-1)),ee(a("input",{"onUpdate:modelValue":E[5]||(E[5]=I=>Y.areaRoute=I),class:"field",placeholder:"Field N of Roskilde, grid survey"},null,512),[[ye,Y.areaRoute]])]),a("label",yy,[E[39]||(E[39]=a("span",{class:"eyebrow mb-1 block"},"Remote pilot name",-1)),ee(a("input",{"onUpdate:modelValue":E[6]||(E[6]=I=>Y.pilotName=I),class:"field",placeholder:"Full name"},null,512),[[ye,Y.pilotName]])]),a("label",xy,[E[40]||(E[40]=a("span",{class:"eyebrow mb-1 block"},"Certificate ref",-1)),ee(a("input",{"onUpdate:modelValue":E[7]||(E[7]=I=>Y.certificateRef=I),class:"field",placeholder:"A2 / STS cert no."},null,512),[[ye,Y.certificateRef]])]),a("label",wy,[E[41]||(E[41]=a("span",{class:"eyebrow mb-1 block"},"Logging path",-1)),ee(a("select",{"onUpdate:modelValue":E[8]||(E[8]=I=>Y.loggingPath=I),class:"field"},[(p(),m(le,null,Re(j,I=>a("option",{key:I.value,value:I.value},k(I.label),9,ky)),64))],512),[[Et,Y.loggingPath]])]),a("label",Sy,[E[42]||(E[42]=a("span",{class:"eyebrow mb-1 block"},"Category",-1)),ee(a("select",{"onUpdate:modelValue":E[9]||(E[9]=I=>Y.category=I),class:"field"},[(p(),m(le,null,Re(R,I=>a("option",{key:I.value,value:I.value},k(I.label),9,Ty)),64))],512),[[Et,Y.category]])]),a("label",Py,[E[43]||(E[43]=a("span",{class:"eyebrow mb-1 block"},"Purpose",-1)),ee(a("select",{"onUpdate:modelValue":E[10]||(E[10]=I=>Y.purpose=I),class:"field"},[(p(),m(le,null,Re(B,I=>a("option",{key:I.value,value:I.value},k(I.label),9,Cy)),64))],512),[[Et,Y.purpose]])]),a("label",Ly,[E[44]||(E[44]=a("span",{class:"eyebrow mb-1 block"},"Authorisation ref",-1)),ee(a("input",{"onUpdate:modelValue":E[11]||(E[11]=I=>Y.authorisationRef=I),class:"field",placeholder:"Specific-category ref"},null,512),[[ye,Y.authorisationRef]])])]),a("label",My,[E[45]||(E[45]=a("span",{class:"eyebrow mb-1 block"},"FDR log URL (automatic path)",-1)),ee(a("input",{"onUpdate:modelValue":E[12]||(E[12]=I=>Y.rawFdrLogUrl=I),class:"field",placeholder:"Link to the stored flight-data-recorder export"},null,512),[[ye,Y.rawFdrLogUrl]])]),a("button",{class:"mt-4 flex items-center gap-1.5 text-sm font-semibold text-accent",onClick:E[13]||(E[13]=I=>Ue.value=!Ue.value)},[M(W,{name:Ue.value?"x":"plus",size:14},null,8,["name"]),E[46]||(E[46]=z(" Operational details (weather, airspace, incidents) ",-1))]),Ue.value?(p(),m("div",Ay,[a("label",Ey,[E[47]||(E[47]=a("span",{class:"eyebrow mb-1 block"},"Weather / wind",-1)),ee(a("input",{"onUpdate:modelValue":E[14]||(E[14]=I=>Y.weather=I),class:"field",placeholder:"6 m/s NW, CAVOK"},null,512),[[ye,Y.weather]])]),a("label",Oy,[E[48]||(E[48]=a("span",{class:"eyebrow mb-1 block"},"Airspace / NOTAM ref",-1)),ee(a("input",{"onUpdate:modelValue":E[15]||(E[15]=I=>Y.airspaceRef=I),class:"field"},null,512),[[ye,Y.airspaceRef]])]),a("label",zy,[E[49]||(E[49]=a("span",{class:"eyebrow mb-1 block"},"Observer",-1)),ee(a("input",{"onUpdate:modelValue":E[16]||(E[16]=I=>Y.observer=I),class:"field"},null,512),[[ye,Y.observer]])]),a("label",Iy,[E[50]||(E[50]=a("span",{class:"eyebrow mb-1 block"},"Incidents / anomalies",-1)),ee(a("input",{"onUpdate:modelValue":E[17]||(E[17]=I=>Y.incidents=I),class:"field",placeholder:"RTH trigger, GPS dropout…"},null,512),[[ye,Y.incidents]])]),a("label",$y,[E[51]||(E[51]=a("span",{class:"eyebrow mb-1 block"},"Notes",-1)),ee(a("textarea",{"onUpdate:modelValue":E[18]||(E[18]=I=>Y.notes=I),rows:"2",class:"field"},null,512),[[ye,Y.notes]])])])):N("",!0),a("div",Ny,[a("button",{class:"btn-accent",disabled:fe.value,onClick:we},k(fe.value?"Saving…":me.value?"Save changes":"Log flight"),9,Dy),a("button",{class:"btn-ghost",onClick:Ge},"Cancel"),Le.value?(p(),m("span",Fy,k(Le.value),1)):N("",!0)])])):N("",!0),a("div",Ry,[h.value?(p(),m("div",By,"Loading…")):f.value.length?(p(),m("div",Vy,[a("table",Zy,[a("thead",null,[a("tr",Hy,[(p(),m(le,null,Re(["Date","Drone","Area / route","Alt","Pilot","Compliance",""],I=>a("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))])]),a("tbody",null,[(p(!0),m(le,null,Re(f.value,I=>{var _t,ut,Pt,x;return p(),m(le,{key:I.id},[a("tr",{class:Ae(["border-b border-line last:border-0",me.value===I.id?"bg-accent-soft":""])},[a("td",jy,[z(k((I.operationDate||"").slice(0,10))+" ",1),I.startTime?(p(),m("span",Wy,k(I.startTime),1)):N("",!0)]),a("td",Ky,k(I.droneName||"—"),1),a("td",{class:"max-w-[220px] truncate px-5 py-3 text-ink-secondary",title:I.areaRoute},k(I.areaRoute||"—"),9,Gy),a("td",qy,k(I.maxAltitudeAgl?I.maxAltitudeAgl+" m":"—"),1),a("td",Yy,k(I.pilotName||"—"),1),a("td",Jy,[a("button",{class:Ae(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",s[C(I).tone]]),onClick:b=>A(I.id)},[C(I).tone==="danger"?(p(),ot(W,{key:0,name:"alertTriangle",size:12})):C(I).tone==="success"?(p(),ot(W,{key:1,name:"check",size:12})):N("",!0),z(" "+k(C(I).label),1)],10,Xy)]),a("td",Qy,[Te.value===I.id?(p(),m(le,{key:0},[E[54]||(E[54]=a("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),a("button",{class:"btn-ghost mr-1",onClick:E[19]||(E[19]=b=>Te.value="")},"Cancel"),a("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:b=>ze(I)},"Delete",8,ex)],64)):(p(),m(le,{key:1},[a("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:b=>Ie(I)},[M(W,{name:"sliders",size:13}),E[55]||(E[55]=z(" Edit",-1))],8,tx),a("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:b=>Te.value=I.id},[M(W,{name:"trash",size:13})],8,nx)],64))])],2),T.value===I.id?(p(),m("tr",ix,[a("td",ox,[a("div",sx,[a("span",ax,[E[56]||(E[56]=z("Logging path: ",-1)),a("b",rx,k(((_t=I.compliance)==null?void 0:_t.loggingPath)||"—"),1)]),a("span",lx,[E[57]||(E[57]=z("Category: ",-1)),a("b",ux,k(I.category||"—"),1)]),a("span",cx,[E[58]||(E[58]=z("Retain until: ",-1)),a("b",dx,k((I.retentionUntil||"").slice(0,10)||"—"),1)]),(ut=I.compliance)!=null&&ut.exempt?(p(),m("span",fx,[E[59]||(E[59]=z("Exempt: ",-1)),a("b",hx,k(I.compliance.exemptReason),1)])):N("",!0)]),(((Pt=I.compliance)==null?void 0:Pt.redFlags)||[]).length?(p(),m("ul",px,[(p(!0),m(le,null,Re(I.compliance.redFlags,(b,S)=>(p(),m("li",{key:S,class:"flex items-start gap-2 text-xs text-danger-fg"},[M(W,{name:"alertTriangle",size:13,class:"mt-px shrink-0"}),z(" "+k(b),1)]))),128))])):(x=I.compliance)!=null&&x.exempt?N("",!0):(p(),m("div",mx,"No compliance gaps detected."))])])):N("",!0)],64)}),128))])])])):(p(),m("div",Uy,[M(W,{name:"book",size:26,class:"text-ink-muted"}),E[52]||(E[52]=a("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No flights logged yet",-1)),E[53]||(E[53]=a("div",{class:"mt-1 text-xs text-ink-muted"},"Log your first operation to start the 5-year retention record.",-1))]))])],64)):(p(),m(le,{key:2},[oe.value?(p(),m("div",gx,[a("div",vx,[a("div",null,[a("div",_x,k(We.value?"Edit drone":"New drone"),1),E[60]||(E[60]=a("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Aircraft registry",-1))]),a("button",{class:"btn-icon",onClick:ke},[M(W,{name:"x",size:16})])]),a("div",bx,[a("label",yx,[E[61]||(E[61]=a("span",{class:"eyebrow mb-1 block"},"Name",-1)),ee(a("input",{"onUpdate:modelValue":E[20]||(E[20]=I=>ue.name=I),class:"field",placeholder:"Mavic-01"},null,512),[[ye,ue.name]])]),a("label",xx,[E[62]||(E[62]=a("span",{class:"eyebrow mb-1 block"},"Model",-1)),ee(a("input",{"onUpdate:modelValue":E[21]||(E[21]=I=>ue.model=I),class:"field",placeholder:"DJI Mavic 3 Enterprise"},null,512),[[ye,ue.model]])]),a("label",wx,[E[63]||(E[63]=a("span",{class:"eyebrow mb-1 block"},"Serial",-1)),ee(a("input",{"onUpdate:modelValue":E[22]||(E[22]=I=>ue.serial=I),class:"field"},null,512),[[ye,ue.serial]])]),a("label",kx,[E[64]||(E[64]=a("span",{class:"eyebrow mb-1 block"},"Operator no.",-1)),ee(a("input",{"onUpdate:modelValue":E[23]||(E[23]=I=>ue.operatorNumber=I),class:"field",placeholder:"DNK…"},null,512),[[ye,ue.operatorNumber]])]),a("label",Sx,[E[65]||(E[65]=a("span",{class:"eyebrow mb-1 block"},"MTOM (grams)",-1)),ee(a("input",{"onUpdate:modelValue":E[24]||(E[24]=I=>ue.mtomGrams=I),type:"number",min:"0",class:"field",placeholder:"920"},null,512),[[ye,ue.mtomGrams]])]),a("label",Tx,[E[66]||(E[66]=a("span",{class:"eyebrow mb-1 block"},"C-class",-1)),ee(a("select",{"onUpdate:modelValue":E[25]||(E[25]=I=>ue.cClass=I),class:"field"},[(p(),m(le,null,Re(ie,I=>a("option",{key:I,value:I},k(I||"— none —"),9,Px)),64))],512),[[Et,ue.cClass]])])]),a("div",Cx,[a("label",Lx,[ee(a("input",{"onUpdate:modelValue":E[26]||(E[26]=I=>ue.autologsFlights=I),type:"checkbox",class:"h-4 w-4 accent-[var(--accent)]"},null,512),[[Ua,ue.autologsFlights]]),E[67]||(E[67]=z(" Auto-logs flights (onboard FDR) ",-1))]),a("label",Mx,[ee(a("input",{"onUpdate:modelValue":E[27]||(E[27]=I=>ue.isToy=I),type:"checkbox",class:"h-4 w-4 accent-[var(--accent)]"},null,512),[[Ua,ue.isToy]]),E[68]||(E[68]=z(" Toy drone (logbook-exempt) ",-1))])]),a("div",Ax,[a("button",{class:"btn-accent",disabled:ae.value,onClick:De},k(ae.value?"Saving…":We.value?"Save changes":"Add drone"),9,Ex),a("button",{class:"btn-ghost",onClick:ke},"Cancel"),ce.value?(p(),m("span",Ox,k(ce.value),1)):N("",!0)])])):N("",!0),a("div",zx,[h.value?(p(),m("div",Ix,"Loading…")):u.value.length?(p(),m("div",Nx,[a("table",Dx,[a("thead",null,[a("tr",Fx,[(p(),m(le,null,Re(["Name","Model","MTOM","Class","FDR",""],I=>a("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))])]),a("tbody",null,[(p(!0),m(le,null,Re(u.value,I=>(p(),m("tr",{key:I.id,class:Ae(["border-b border-line last:border-0",We.value===I.id?"bg-accent-soft":""])},[a("td",Rx,k(I.name),1),a("td",Bx,k(I.model||"—"),1),a("td",Ux,k(I.mtomGrams?I.mtomGrams+" g":"—"),1),a("td",Vx,[I.cClass?(p(),m("span",{key:0,class:Ae(["inline-flex rounded-full px-2 py-0.5 text-[11px] font-semibold",s.accent])},k(I.cClass),3)):(p(),m("span",Zx,"—")),I.isToy?(p(),m("span",{key:2,class:Ae(["ml-1 inline-flex rounded-full px-2 py-0.5 text-[11px] font-semibold",s.neutral])},"toy",2)):N("",!0)]),a("td",Hx,[a("span",{class:Ae(["text-xs",I.autologsFlights?"text-success-fg":"text-ink-muted"])},k(I.autologsFlights?"yes":"no"),3)]),a("td",jx,[ht.value===I.id?(p(),m(le,{key:0},[E[71]||(E[71]=a("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),a("button",{class:"btn-ghost mr-1",onClick:E[28]||(E[28]=_t=>ht.value="")},"Cancel"),a("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:_t=>lt(I)},"Delete",8,Wx)],64)):(p(),m(le,{key:1},[a("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:_t=>te(I)},[M(W,{name:"sliders",size:13}),E[72]||(E[72]=z(" Edit",-1))],8,Kx),a("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:_t=>ht.value=I.id},[M(W,{name:"trash",size:13})],8,Gx)],64))])],2))),128))])])])):(p(),m("div",$x,[M(W,{name:"drone",size:26,class:"text-ink-muted"}),E[69]||(E[69]=a("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No drones registered",-1)),E[70]||(E[70]=a("div",{class:"mt-1 text-xs text-ink-muted"},"Register the airframes you fly to log flights against them.",-1))]))])],64))]))}},Yx={class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},Jx={class:"flex flex-wrap items-center gap-3"},Xx={class:"inline-flex flex-wrap rounded-lg border border-line bg-surface-1 p-0.5"},Qx=["onClick"],e0={class:"ml-auto"},t0={class:"grid grid-cols-4 gap-4 max-[900px]:grid-cols-2"},n0={class:"eyebrow"},i0={key:0,class:"panel border-danger/40 p-4 text-sm text-danger-fg"},o0={key:1,class:"panel p-5"},s0={class:"mb-4 flex items-center justify-between"},a0={class:"eyebrow"},r0={class:"mt-0.5 text-base font-semibold text-ink"},l0={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},u0={class:"col-span-2 block max-[760px]:col-span-1"},c0={class:"block"},d0=["value"],f0={class:"block"},h0=["value"],p0={class:"block"},m0=["value"],g0={class:"block"},v0={class:"block"},_0={class:"block"},b0={class:"block"},y0=["value"],x0={class:"block"},w0={class:"block"},k0={class:"block"},S0=["value"],T0={class:"mt-3 block"},P0={key:0,class:"mt-3"},C0={class:"eyebrow mb-1 block"},L0={key:1,class:"mt-3 text-xs text-ink-muted"},M0={class:"mt-4 flex items-center gap-3"},A0=["disabled"],E0={key:0,class:"text-sm text-danger-fg"},O0={class:"panel overflow-hidden p-0"},z0={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},I0={key:1,class:"grid place-items-center px-5 py-16 text-center"},$0={class:"mt-3 text-sm font-medium text-ink-secondary"},N0={class:"mt-1 text-xs text-ink-muted"},D0={key:2,class:"overflow-x-auto"},F0={class:"w-full border-collapse text-sm"},R0={class:"text-left"},B0={class:"px-5 py-3"},U0={class:"font-semibold text-ink"},V0={key:0,class:"font-mono text-[11px] text-ink-muted"},Z0={class:"px-5 py-3 text-ink-secondary"},H0={class:"px-5 py-3 text-ink-secondary"},j0={class:"px-5 py-3"},W0=["onClick"],K0={key:0,class:"mt-0.5 font-mono text-[10.5px] text-ink-muted"},G0={class:"px-5 py-3 font-mono text-ink-secondary"},q0={class:"whitespace-nowrap px-5 py-3 text-right"},Y0=["onClick"],J0=["onClick"],X0=["href"],Q0=["onClick"],ew=["onClick"],tw=["onClick"],nw={key:0,class:"border-b border-line bg-surface-2"},iw={colspan:"6",class:"px-5 py-3"},ow={class:"flex flex-wrap gap-x-8 gap-y-1.5 text-xs"},sw={class:"text-ink-secondary"},aw={class:"text-ink"},rw={class:"text-ink-secondary"},lw={class:"text-ink"},uw={key:0,class:"text-ink-secondary"},cw={class:"text-ink"},dw={key:1,class:"text-ink-secondary"},fw={class:"font-mono text-ink"},hw={key:2,class:"text-ink-secondary"},pw={class:"font-mono text-ink"},mw={class:"text-ink-secondary"},gw={class:"text-ink"},vw={key:0,class:"mt-2 space-y-1"},_w={key:1,class:"mt-2 text-xs text-success-fg"},bw={key:2,class:"mt-2 text-xs text-ink-secondary"},yw={class:"flex max-h-[90vh] w-full max-w-[920px] flex-col overflow-hidden rounded-lg border border-line bg-surface-1 shadow-2xl"},xw={class:"flex items-center gap-3 border-b border-line px-5 py-3"},ww={class:"min-w-0"},kw={class:"truncate text-sm font-semibold text-ink"},Sw={class:"truncate font-mono text-[11px] text-ink-muted"},Tw={class:"ml-auto flex items-center gap-2"},Pw=["href"],Cw=["href"],Lw={class:"flex-1 overflow-auto bg-surface-2"},Mw=["src","alt"],Aw=["src","title"],Ew={key:2,class:"grid place-items-center px-6 py-16 text-center"},Ow={class:"mt-1 text-xs text-ink-muted"},zw=["href"],Iw={__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"},s=[{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(s.map(x=>[x.value,x.label])),u=[{value:"pilot",label:"Pilot"},{value:"aircraft",label:"Aircraft"},{value:"organization",label:"Organization"},{value:"client",label:"Client"},{value:"other",label:"Other"}],f=[{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"}],_=Z([]),y=Z([]),C=Z(!1),T=Z("");async function A(){C.value=!0,T.value="";const[x,b]=await Promise.all([Op(),Jc()]);x.ok||(T.value=x.status===503?"Document storage is not configured on the API Server (service account missing).":"Could not load documents."),_.value=x.documents,y.value=b.drones||[],C.value=!1}ki(A);const R=Z("all"),B=[["all","All"],["expiring","Expiring soon"],["expired","Expired"],["pending","Pending review"],["archived","Archived"]],j=he(()=>{const x=_.value;switch(R.value){case"expiring":return x.filter(b=>{var S;return((S=b.expiry)==null?void 0:S.state)==="expiring_soon"&&b.status!=="archived"});case"expired":return x.filter(b=>{var S;return((S=b.expiry)==null?void 0:S.state)==="expired"&&b.status!=="archived"});case"pending":return x.filter(b=>b.status==="pending_review");case"archived":return x.filter(b=>b.status==="archived");default:return x.filter(b=>b.status!=="archived")}});function F(x){if(x.status==="archived")return{tone:"neutral",label:"Superseded",icon:""};const b=x.expiry||{};return b.state==="expired"?{tone:"danger",label:"Expired",icon:"alertTriangle"}:b.state==="expiring_soon"?{tone:"warning",label:`Expires in ${b.daysUntilExpiry}d`,icon:"clock"}:b.state==="valid"?{tone:"success",label:"Valid",icon:"check"}:{tone:"neutral",label:"No expiry",icon:""}}const pe=Z("");function me(x){pe.value=pe.value===x?"":x}function Y(x){return x.ownerDrone?x.ownerDroneName||"Aircraft":x.ownerRef?x.ownerRef:x.ownerType==="pilot"?"Pilot":x.ownerType?x.ownerType.charAt(0).toUpperCase()+x.ownerType.slice(1):"—"}const Le=["png","jpg","jpeg","gif","webp","svg","bmp","avif"],fe=["pdf","txt","csv","log","json","md","html","htm","xml"];function Ue(x){const b=(x||"").split(".").pop().toLowerCase();return Le.includes(b)?"image":fe.includes(b)?"frame":"none"}const Ne=Z(null),Ie=he(()=>Ne.value?Ue(Ne.value.fileName):"none"),Ge=he(()=>Ne.value?Np(Ne.value.id):"");function we(x){Ne.value=x}function Te(){Ne.value=null}function ze(x){x.key==="Escape"&&Ne.value&&Te()}ki(()=>window.addEventListener("keydown",ze)),os(()=>window.removeEventListener("keydown",ze));function ie(){return{title:"",docType:"certificate",ownerType:"pilot",ownerDrone:"",ownerRef:"",reference:"",jurisdiction:"",issueDate:"",expiryDate:"",status:"active",accessTier:"ops",notes:""}}const je=Z(!1),oe=Z(""),We=Z(""),ue=Z(""),ce=St(ie()),ae=Z(null),st=Z(null),te=Z(""),ke=Z(!1);function De(){ae.value=null,st.value&&(st.value.value="")}function ht(){Object.assign(ce,ie()),oe.value="",We.value="",ue.value="",De(),te.value="",je.value=!0}function lt(x){Object.assign(ce,{title:x.title||"",docType:x.docType||"certificate",ownerType:x.ownerType||"pilot",ownerDrone:x.ownerDrone||"",ownerRef:x.ownerRef||"",reference:x.reference||"",jurisdiction:x.jurisdiction||"",issueDate:x.issueDate||"",expiryDate:x.expiryDate||"",status:x.status||"active",accessTier:x.accessTier||"ops",notes:x.notes||""}),oe.value=x.id,We.value="",ue.value="",De(),te.value="",je.value=!0}function Ve(x){lt(x),oe.value="",We.value=x.id,ue.value=x.title,ce.status="active"}function J(){je.value=!1,oe.value="",We.value=""}function E(x){var b;ae.value=((b=x.target.files)==null?void 0:b[0])||null}async function I(){var b;if(te.value="",!ce.title.trim()){te.value="Give the document a title.";return}ke.value=!0;let x;if(oe.value)x=await Ip(oe.value,{...ce});else{const S={...ce};We.value&&(S.replaces=We.value),x=await zp(S,ae.value)}if(ke.value=!1,!x.ok){te.value=((b=x.body)==null?void 0:b.error)||"Could not save the document.";return}je.value=!1,oe.value="",We.value="",await A()}const _t=Z("");async function ut(x){var S;const b=await $p(x.id);_t.value="",b.ok?await A():te.value=((S=b.body)==null?void 0:S.error)||"Could not delete the document."}const Pt=he(()=>{const x=_.value.filter(b=>b.status!=="archived");return{total:x.length,expiring:x.filter(b=>{var S;return((S=b.expiry)==null?void 0:S.state)==="expiring_soon"}).length,expired:x.filter(b=>{var S;return((S=b.expiry)==null?void 0:S.state)==="expired"}).length,pending:_.value.filter(b=>b.status==="pending_review").length}});return(x,b)=>(p(),m("div",Yx,[a("div",Jx,[a("div",Xx,[(p(),m(le,null,Re(B,S=>a("button",{key:S[0],class:Ae(["rounded-md px-3.5 py-1.5 text-sm font-semibold transition",R.value===S[0]?"bg-accent-soft text-accent-soft-fg":"text-ink-secondary hover:text-ink"]),onClick:G=>R.value=S[0]},k(S[1]),11,Qx)),64))]),a("div",e0,[a("button",{class:"btn-accent inline-flex items-center gap-2",onClick:ht},[M(W,{name:"upload",size:15}),b[13]||(b[13]=z(" Add document ",-1))])])]),a("div",t0,[(p(!0),m(le,null,Re([{label:"Documents on file",value:Pt.value.total,tone:"neutral"},{label:"Expiring soon",value:Pt.value.expiring,tone:Pt.value.expiring?"warning":"neutral"},{label:"Expired",value:Pt.value.expired,tone:Pt.value.expired?"danger":"success"},{label:"Pending review",value:Pt.value.pending,tone:Pt.value.pending?"accent":"neutral"}],S=>(p(),m("div",{key:S.label,class:"panel p-5"},[a("div",n0,k(S.label),1),a("div",{class:Ae(["mt-2 text-[30px] font-bold leading-none tracking-tightest",S.tone==="danger"?"text-danger-fg":S.tone==="warning"?"text-amber-fg":S.tone==="success"?"text-success-fg":S.tone==="accent"?"text-accent-soft-fg":"text-ink"])},k(S.value),3)]))),128))]),T.value?(p(),m("div",i0,k(T.value),1)):N("",!0),je.value?(p(),m("div",o0,[a("div",s0,[a("div",null,[a("div",a0,k(oe.value?"Edit document":We.value?"New version":"New document"),1),a("div",r0,k(We.value?`Supersedes “${ue.value}”`:"Compliance & operational document"),1)]),a("button",{class:"btn-icon",onClick:J},[M(W,{name:"x",size:16})])]),a("div",l0,[a("label",u0,[b[14]||(b[14]=a("span",{class:"eyebrow mb-1 block"},"Title",-1)),ee(a("input",{"onUpdate:modelValue":b[0]||(b[0]=S=>ce.title=S),class:"field",placeholder:"A2 Remote Pilot Certificate — J. Dariusz"},null,512),[[ye,ce.title]])]),a("label",c0,[b[15]||(b[15]=a("span",{class:"eyebrow mb-1 block"},"Type",-1)),ee(a("select",{"onUpdate:modelValue":b[1]||(b[1]=S=>ce.docType=S),class:"field"},[(p(),m(le,null,Re(s,S=>a("option",{key:S.value,value:S.value},k(S.label),9,d0)),64))],512),[[Et,ce.docType]])]),a("label",f0,[b[16]||(b[16]=a("span",{class:"eyebrow mb-1 block"},"Owner type",-1)),ee(a("select",{"onUpdate:modelValue":b[2]||(b[2]=S=>ce.ownerType=S),class:"field"},[(p(),m(le,null,Re(u,S=>a("option",{key:S.value,value:S.value},k(S.label),9,h0)),64))],512),[[Et,ce.ownerType]])]),a("label",p0,[b[18]||(b[18]=a("span",{class:"eyebrow mb-1 block"},"Aircraft (if any)",-1)),ee(a("select",{"onUpdate:modelValue":b[3]||(b[3]=S=>ce.ownerDrone=S),class:"field"},[b[17]||(b[17]=a("option",{value:""},"— none —",-1)),(p(!0),m(le,null,Re(y.value,S=>(p(),m("option",{key:S.id,value:S.id},k(S.name)+k(S.model?` · ${S.model}`:""),9,m0))),128))],512),[[Et,ce.ownerDrone]])]),a("label",g0,[b[19]||(b[19]=a("span",{class:"eyebrow mb-1 block"},"Owner reference",-1)),ee(a("input",{"onUpdate:modelValue":b[4]||(b[4]=S=>ce.ownerRef=S),class:"field",placeholder:"Client name / serial / site"},null,512),[[ye,ce.ownerRef]])]),a("label",v0,[b[20]||(b[20]=a("span",{class:"eyebrow mb-1 block"},"Reference / number",-1)),ee(a("input",{"onUpdate:modelValue":b[5]||(b[5]=S=>ce.reference=S),class:"field",placeholder:"Cert / registration / policy no."},null,512),[[ye,ce.reference]])]),a("label",_0,[b[21]||(b[21]=a("span",{class:"eyebrow mb-1 block"},"Jurisdiction",-1)),ee(a("input",{"onUpdate:modelValue":b[6]||(b[6]=S=>ce.jurisdiction=S),class:"field",placeholder:"DK / EASA / FAA"},null,512),[[ye,ce.jurisdiction]])]),a("label",b0,[b[22]||(b[22]=a("span",{class:"eyebrow mb-1 block"},"Access tier",-1)),ee(a("select",{"onUpdate:modelValue":b[7]||(b[7]=S=>ce.accessTier=S),class:"field"},[(p(),m(le,null,Re(h,S=>a("option",{key:S.value,value:S.value},k(S.label),9,y0)),64))],512),[[Et,ce.accessTier]])]),a("label",x0,[b[23]||(b[23]=a("span",{class:"eyebrow mb-1 block"},"Issue date",-1)),ee(a("input",{"onUpdate:modelValue":b[8]||(b[8]=S=>ce.issueDate=S),type:"date",class:"field"},null,512),[[ye,ce.issueDate]])]),a("label",w0,[b[24]||(b[24]=a("span",{class:"eyebrow mb-1 block"},"Expiry date",-1)),ee(a("input",{"onUpdate:modelValue":b[9]||(b[9]=S=>ce.expiryDate=S),type:"date",class:"field"},null,512),[[ye,ce.expiryDate]])]),a("label",k0,[b[25]||(b[25]=a("span",{class:"eyebrow mb-1 block"},"Status",-1)),ee(a("select",{"onUpdate:modelValue":b[10]||(b[10]=S=>ce.status=S),class:"field"},[(p(),m(le,null,Re(f,S=>a("option",{key:S.value,value:S.value},k(S.label),9,S0)),64))],512),[[Et,ce.status]])])]),a("label",T0,[b[26]||(b[26]=a("span",{class:"eyebrow mb-1 block"},"Notes",-1)),ee(a("textarea",{"onUpdate:modelValue":b[11]||(b[11]=S=>ce.notes=S),rows:"2",class:"field",placeholder:"Conditions, renewal contacts, anything worth recording"},null,512),[[ye,ce.notes]])]),oe.value?(p(),m("div",L0,[...b[28]||(b[28]=[z(" Editing updates metadata only. To replace the file, close this and use ",-1),a("b",{class:"text-ink-secondary"},"New version",-1),z(" on the document — the old version is kept for audit. ",-1)])])):(p(),m("div",P0,[a("span",C0,"File "+k(We.value?"(new version)":"(optional)"),1),a("input",{ref_key:"fileInput",ref:st,type:"file",class:"field",onChange:E},null,544),b[27]||(b[27]=a("p",{class:"mt-1 text-xs text-ink-muted"}," Stored in PocketBase for now (object storage later). Max 50 MB. ",-1))])),a("div",M0,[a("button",{class:"btn-accent",disabled:ke.value,onClick:I},k(ke.value?"Saving…":oe.value?"Save changes":We.value?"Upload new version":"Add document"),9,A0),a("button",{class:"btn-ghost",onClick:J},"Cancel"),te.value?(p(),m("span",E0,k(te.value),1)):N("",!0)])])):N("",!0),a("div",O0,[C.value?(p(),m("div",z0,"Loading…")):j.value.length?(p(),m("div",D0,[a("table",F0,[a("thead",null,[a("tr",R0,[(p(),m(le,null,Re(["Title","Type","Owner","Expiry","Ver",""],S=>a("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))])]),a("tbody",null,[(p(!0),m(le,null,Re(j.value,S=>{var G,K;return p(),m(le,{key:S.id},[a("tr",{class:Ae(["border-b border-line last:border-0",oe.value===S.id?"bg-accent-soft":""])},[a("td",B0,[a("div",U0,k(S.title),1),S.reference?(p(),m("div",V0,k(S.reference),1)):N("",!0)]),a("td",Z0,k(Oe(l)[S.docType]||S.docType||"—"),1),a("td",H0,k(Y(S)),1),a("td",j0,[a("button",{class:Ae(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",i[F(S).tone]]),onClick:H=>me(S.id)},[F(S).icon?(p(),ot(W,{key:0,name:F(S).icon,size:12},null,8,["name"])):N("",!0),z(" "+k(F(S).label),1)],10,W0),S.expiryDate?(p(),m("div",K0,k(S.expiryDate),1)):N("",!0)]),a("td",G0,"v"+k(S.version||1),1),a("td",q0,[_t.value===S.id?(p(),m(le,{key:0},[b[29]||(b[29]=a("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),a("button",{class:"btn-ghost mr-1",onClick:b[12]||(b[12]=H=>_t.value="")},"Cancel"),a("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:H=>ut(S)},"Delete",8,Y0)],64)):(p(),m(le,{key:1},[S.hasFile?(p(),m("button",{key:0,class:"btn-ghost mr-1 inline-flex items-center gap-1",title:"Preview",onClick:H=>we(S)},[M(W,{name:"eye",size:13})],8,J0)):N("",!0),S.hasFile?(p(),m("a",{key:1,href:Oe(zr)(S.id),class:"btn-ghost mr-1 inline-flex items-center gap-1",title:"Download file"},[M(W,{name:"download",size:13})],8,X0)):N("",!0),a("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",title:"Upload new version",onClick:H=>Ve(S)},[M(W,{name:"upload",size:13})],8,Q0),a("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:H=>lt(S)},[M(W,{name:"sliders",size:13}),b[30]||(b[30]=z(" Edit",-1))],8,ew),a("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:H=>_t.value=S.id},[M(W,{name:"trash",size:13})],8,tw)],64))])],2),pe.value===S.id?(p(),m("tr",nw,[a("td",iw,[a("div",ow,[a("span",sw,[b[31]||(b[31]=z("Status: ",-1)),a("b",aw,k(S.status||"—"),1)]),a("span",rw,[b[32]||(b[32]=z("Access: ",-1)),a("b",lw,k(S.accessTier||"—"),1)]),S.jurisdiction?(p(),m("span",uw,[b[33]||(b[33]=z("Jurisdiction: ",-1)),a("b",cw,k(S.jurisdiction),1)])):N("",!0),S.issueDate?(p(),m("span",dw,[b[34]||(b[34]=z("Issued: ",-1)),a("b",fw,k(S.issueDate),1)])):N("",!0),S.expiryDate?(p(),m("span",hw,[b[35]||(b[35]=z("Expires: ",-1)),a("b",pw,k(S.expiryDate),1)])):N("",!0),a("span",mw,[b[36]||(b[36]=z("File: ",-1)),a("b",gw,k(S.hasFile?S.fileName:"none"),1)])]),(((G=S.expiry)==null?void 0:G.flags)||[]).length?(p(),m("ul",vw,[(p(!0),m(le,null,Re(S.expiry.flags,(H,re)=>(p(),m("li",{key:re,class:Ae(["flex items-start gap-2 text-xs",S.expiry.state==="expired"?"text-danger-fg":S.expiry.state==="expiring_soon"?"text-amber-fg":"text-ink-secondary"])},[M(W,{name:"alertTriangle",size:13,class:"mt-px shrink-0"}),z(" "+k(H),1)],2))),128))])):((K=S.expiry)==null?void 0:K.state)==="valid"?(p(),m("div",_w,"In force — no action needed.")):N("",!0),S.notes?(p(),m("div",bw,[b[37]||(b[37]=a("span",{class:"text-ink-muted"},"Notes:",-1)),z(" "+k(S.notes),1)])):N("",!0)])])):N("",!0)],64)}),128))])])])):(p(),m("div",I0,[M(W,{name:"fileText",size:26,class:"text-ink-muted"}),a("div",$0,k(R.value==="all"?"No documents on file yet":"Nothing in this view"),1),a("div",N0,k(R.value==="all"?"Add certificates, registrations, insurance and authorisations to track their expiry.":"Try a different filter."),1)]))]),(p(),ot(cf,{to:"body"},[Ne.value?(p(),m("div",{key:0,class:"fixed inset-0 z-50 grid place-items-center p-4",style:{background:"color-mix(in srgb, black 60%, transparent)"},onClick:hl(Te,["self"])},[a("div",yw,[a("div",xw,[a("div",ww,[a("div",kw,k(Ne.value.title),1),a("div",Sw,k(Ne.value.fileName),1)]),a("div",Tw,[a("a",{href:Ge.value,target:"_blank",rel:"noopener",class:"btn-ghost inline-flex items-center gap-1.5",title:"Open in new tab"},[M(W,{name:"globe",size:14}),b[38]||(b[38]=z(" New tab ",-1))],8,Pw),a("a",{href:Oe(zr)(Ne.value.id),class:"btn-ghost inline-flex items-center gap-1.5",title:"Download"},[M(W,{name:"download",size:14}),b[39]||(b[39]=z(" Download ",-1))],8,Cw),a("button",{class:"btn-icon",title:"Close",onClick:Te},[M(W,{name:"x",size:16})])])]),a("div",Lw,[Ie.value==="image"?(p(),m("img",{key:0,src:Ge.value,alt:Ne.value.title,class:"mx-auto block max-w-full"},null,8,Mw)):Ie.value==="frame"?(p(),m("iframe",{key:1,src:Ge.value,class:"h-[74vh] w-full border-0 bg-white",title:Ne.value.title},null,8,Aw)):(p(),m("div",Ew,[M(W,{name:"fileText",size:28,class:"text-ink-muted"}),b[41]||(b[41]=a("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"Preview isn't available for this file type",-1)),a("div",Ow,k(Ne.value.fileName),1),a("a",{href:Oe(zr)(Ne.value.id),class:"btn-accent mt-4 inline-flex items-center gap-2"},[M(W,{name:"download",size:15}),b[40]||(b[40]=z(" Download instead ",-1))],8,zw)]))])])])):N("",!0)]))]))}},$w={class:"grid h-full grid-cols-[248px_1fr] max-[900px]:grid-cols-1"},Nw={class:"flex flex-col border-r border-line bg-surface-1 px-4 py-5 max-[900px]:hidden"},Dw={class:"flex items-center gap-2.5 px-2 pb-5"},Fw={class:"flex flex-col gap-0.5"},Rw=["onClick"],Bw={class:"mt-auto flex flex-col gap-2.5"},Uw={class:"rounded-lg bg-surface-2 p-3"},Vw={class:"flex items-center gap-2"},Zw={class:"text-xs font-semibold text-ink"},Hw={class:"mt-1.5 block font-mono text-[10.5px] text-ink-muted"},jw={class:"flex items-center gap-2.5 px-2 py-1"},Ww={class:"grid h-8 w-8 place-items-center rounded-full bg-[var(--navy-800)] text-xs font-bold text-white"},Kw={class:"min-w-0 flex-1"},Gw={class:"truncate text-[13px] font-semibold text-ink"},qw={class:"flex items-center gap-1.5 text-[11px] text-ink-muted"},Yw=["title"],Jw={class:"overflow-y-auto"},Xw={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)"}},Qw={class:"mt-0.5 text-[22px] font-bold tracking-tightest text-ink"},e2={class:"ml-auto flex items-center gap-3"},t2={class:"flex h-10 w-60 items-center gap-2 rounded border border-line-strong bg-surface-1 px-3 max-[1100px]:hidden"},n2={key:0,class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},i2={class:"grid grid-cols-4 gap-4 max-[1100px]:grid-cols-2 max-[560px]:grid-cols-1"},o2={class:"flex items-center justify-between"},s2={class:"eyebrow"},a2={class:"mt-2.5 text-[34px] font-bold leading-none tracking-tightest text-ink"},r2={class:"grid grid-cols-[1.6fr_1fr] gap-5 max-[1100px]:grid-cols-1"},l2={class:"panel p-5"},u2={class:"mb-3.5 flex items-center justify-between"},c2={class:"flex items-center gap-2"},d2={class:"relative z-[1200]"},f2={class:"panel absolute right-0 z-[1200] mt-1.5 w-72 p-3.5 shadow-lg"},h2={class:"flex items-center justify-between gap-3"},p2={class:"mb-1.5 flex items-center justify-between"},m2={class:"font-mono text-[11px] text-ink-muted"},g2=["value"],v2={key:0,class:"mt-1.5 text-[11px] text-ink-muted"},_2={key:0,class:"mt-2.5 text-xs text-ink-muted"},b2={key:1,class:"mt-2.5 text-xs text-ink-muted"},y2={key:2,class:"mt-2.5 text-xs text-ink-muted"},x2={class:"panel p-5"},w2={class:"mb-3.5 flex items-center justify-between"},k2={class:"grid place-items-center py-10 text-center"},S2={class:"panel overflow-hidden p-0"},T2={class:"flex items-center justify-between px-5 py-4"},P2={class:"flex gap-2"},C2={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},L2={key:1,class:"overflow-x-auto"},M2={class:"w-full border-collapse text-sm"},A2={class:"text-left"},E2=["onClick"],O2={class:"px-5 py-3 font-mono font-bold text-ink"},z2={class:"px-5 py-3 text-ink-secondary"},I2={class:"px-5 py-3"},$2={class:"px-5 py-3 font-mono text-ink-secondary"},N2={class:"px-5 py-3"},D2={key:0,class:"flex items-center gap-2"},F2={class:"h-1.5 w-12 overflow-hidden rounded bg-surface-2"},R2={class:"font-mono text-xs text-ink-secondary"},B2={key:1,class:"font-mono text-xs text-ink-muted"},U2={class:"px-5 py-3 font-mono text-ink-secondary"},V2={class:"px-5 py-3 text-right"},Z2=["onClick"],H2={key:1,class:"p-7"},j2={class:"mb-4 flex flex-wrap items-center gap-3"},W2={class:"font-mono text-mode font-bold text-ink"},K2={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"},G2={key:1,class:"ml-auto flex flex-wrap gap-1.5"},q2=["onClick"],Y2={key:0,class:"panel grid place-items-center p-16 text-center"},J2={class:"pill"},X2={class:"pill"},Q2={class:"pill"},ek={class:"mt-1 text-sm font-semibold text-ink"},tk={class:"pill"},nk={class:"mt-1 font-mono text-sm font-bold tabular text-ink"},ik={class:"grid grid-cols-2 gap-4 max-[820px]:grid-cols-1"},ok={class:"panel p-4"},sk={class:"flex items-center gap-4"},ak={class:"h-9 flex-1 overflow-hidden rounded border border-line bg-surface-2"},rk={class:"readout"},lk={class:"panel p-4"},uk={class:"readout"},ck={class:"panel p-4"},dk={class:"space-y-1.5 text-sm"},fk={class:"flex justify-between"},hk={class:"text-ink"},pk={class:"flex justify-between"},mk={class:"text-ink"},gk={class:"flex justify-between"},vk={class:"font-mono tabular text-ink"},_k={class:"flex justify-between"},bk={class:"font-mono tabular text-ink"},yk={class:"panel p-4"},xk={class:"space-y-1.5 text-sm"},wk={class:"flex justify-between"},kk={class:"font-mono tabular text-ink"},Sk={class:"flex justify-between"},Tk={class:"font-mono tabular text-ink"},Pk={class:"flex justify-between"},Ck={class:"font-mono tabular text-ink"},Lk={class:"panel col-span-2 p-4 max-[820px]:col-span-1"},Mk={class:"panel p-4"},Ak={class:"flex flex-wrap gap-2"},Ek={class:"mt-2 min-h-[16px] text-xs text-ink-muted"},Ok={class:"panel p-4"},zk={class:"h-[180px] overflow-y-auto font-mono text-xs"},Ik={class:"text-ink-muted"},$k={class:"font-semibold text-accent"},Nk={class:"break-all text-ink"},Dk={key:5,class:"p-7"},Fk={class:"panel grid place-items-center p-16 text-center"},Rk={class:"mt-3 text-sm font-medium text-ink-secondary"},Bk={key:0,class:"mt-1 text-xs text-ink-muted"},Uk={key:1,class:"mt-1 text-xs text-ink-muted"},Vk="34,-25,72,45",Zk={__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 s=t,l=i,u=St({}),f=St({}),h=Z(null),_=Z(!1),y=St([]),C=Z(""),T=Z([]),A=St({unavailable:!1,detail:"",loaded:!1,plan:"",recommendedInterval:30}),R=he(()=>T.value.filter(U=>!U.onGround).length),B=Z(!1);let j=null;const F=[{value:"auto",label:"Auto"},{value:5,label:"5s"},{value:10,label:"10s"},{value:15,label:"15s"},{value:30,label:"30s"},{value:60,label:"60s"},{value:120,label:"120s"}],pe=he(()=>{if(be.airTrafficInterval==="auto")return A.recommendedInterval||30;const U=Number(be.airTrafficInterval);return Number.isFinite(U)&&U>0?U:30}),me=Z(null);let Y=!1;function Le(){if(!(Y||me.value!==null)){if(typeof navigator>"u"||!navigator.geolocation){me.value=!1;return}Y=!0,navigator.geolocation.getCurrentPosition(U=>{me.value={lat:U.coords.latitude,lng:U.coords.longitude},Y=!1},()=>{me.value=!1,Y=!1},{timeout:8e3,maximumAge:6e5})}}function fe(U,O,Pe){const qe=U&&U.telemetry||{},vt=qe[O],xt=qe[Pe];return typeof vt=="number"&&typeof xt=="number"&&(vt||xt)?{lat:vt,lng:xt}:null}function Ue(){const U=fe(te.value,"latitude","longitude")||st.value.map(qe=>fe(u[qe],"latitude","longitude")).find(Boolean);if(U){const qe=Ir(U.lat,U.lng);if(qe)return qe.bbox}const O=fe(te.value,"phoneLatitude","phoneLongitude")||st.value.map(qe=>fe(u[qe],"phoneLatitude","phoneLongitude")).find(Boolean);if(O){const qe=Ir(O.lat,O.lng);if(qe)return qe.bbox}if(Le(),me.value){const qe=Ir(me.value.lat,me.value.lng);if(qe)return qe.bbox}const Pe=bm(be.region);return Pe||Vk}async function Ne(){if(!be.showAirTraffic)return;const U=be.autoBbox?Ue():void 0,{states:O,unavailable:Pe,detail:qe,plan:vt,recommendedInterval:xt}=await mp(U);T.value=O,A.unavailable=Pe,A.detail=qe,A.plan=vt||"",xt&&(A.recommendedInterval=xt),A.loaded=!0}function Ie(){j&&clearInterval(j),j=setInterval(()=>{Te.value==="Overview"&&be.showAirTraffic&&Ne()},pe.value*1e3)}function Ge(){Ne(),Ie()}function we(){j&&clearInterval(j),j=null}const Te=Z("Overview"),ze=[["grid","Overview"],["radio","Live flights"],["route","Routes"],["calendar","Schedule"],["book","Logbook"],["fileText","Documents"],["server","Drives"],["settings","Settings"]],ie=he(()=>(ze.find(([,U])=>U===Te.value)||["grid"])[0]),je=Z(""),oe=Z(""),We=Z("");let ue=null,ce=null,ae=!1;const st=he(()=>Object.keys(u).sort((U,O)=>(u[O].online?1:0)-(u[U].online?1:0)||U.localeCompare(O))),te=he(()=>h.value?u[h.value]:null),ke=he(()=>te.value&&te.value.telemetry||{}),De=he(()=>!!(te.value&&te.value.online)),ht=he(()=>{const U=ke.value;return typeof U.latitude=="number"&&typeof U.longitude=="number"&&(U.latitude||U.longitude)?{lat:U.latitude,lng:U.longitude}:null}),lt=he(()=>h.value&&f[h.value]||[]),Ve=he(()=>{const U=ke.value;return typeof U.velocityX=="number"&&typeof U.velocityY=="number"?Math.hypot(U.velocityX,U.velocityY):null});function J(U){return U.online?U.connected?["In flight","success"]:["Standby","accent"]:["Offline","neutral"]}function E(U){const O=U&&U.telemetry||{};return typeof O.velocityX=="number"&&typeof O.velocityY=="number"?Math.hypot(O.velocityX,O.velocityY):null}const I=he(()=>st.value.map(U=>{const O=u[U],Pe=O.telemetry||{},[qe,vt]=J(O);return{id:U,mission:O.model||(O.connected?"Drone linked":O.online?"App online":"No signal"),status:qe,tone:vt,alt:typeof Pe.altitude=="number"?Pe.altitude.toFixed(0)+" m":"—",battery:typeof Pe.batteryPercent=="number"?Pe.batteryPercent:null,speed:E(O)}})),_t=he(()=>st.value.filter(U=>u[U].online).length),ut=he(()=>st.value.filter(U=>u[U].online&&u[U].connected).length),Pt=he(()=>st.value.filter(U=>!u[U].online).length),x=he(()=>{const U=st.value.map(O=>{var Pe;return(Pe=u[O].telemetry)==null?void 0:Pe.batteryPercent}).filter(O=>typeof O=="number");return U.length?Math.round(U.reduce((O,Pe)=>O+Pe,0)/U.length):null}),b=he(()=>[{label:"Active flights",value:String(ut.value),delta:`${_t.value} online`,tone:"success",icon:"radio"},{label:"Avg battery",value:x.value==null?"—":x.value+"%",delta:x.value==null?"no telemetry":x.value<40?"low — watch":"nominal",tone:x.value!=null&&x.value<40?"danger":"neutral",icon:"battery"},{label:"Fleet size",value:String(st.value.length),delta:`${ut.value} in flight`,tone:"neutral",icon:"grid"},{label:"Offline",value:String(Pt.value),delta:Pt.value?"needs attention":"all reachable",tone:Pt.value?"warning":"success",icon:"signal"}]),S={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"},G={success:"text-success-fg",danger:"text-danger-fg",warning:"text-amber-fg",neutral:"text-ink-muted",accent:"text-accent-soft-fg"},K=he(()=>{var Pe,qe,vt;const O=(s.email||"PV").split("@")[0].split(/[.\-_ ]+/).filter(Boolean);return((((Pe=O[0])==null?void 0:Pe[0])||"P")+(((qe=O[1])==null?void 0:qe[0])||((vt=O[0])==null?void 0:vt[1])||"V")).toUpperCase()}),H={superadmin:"Superadmin",admin:"Admin",user:"Operator"},re=he(()=>H[s.role]||"Operator"),ne=he(()=>s.organizationName||(s.role==="superadmin"?"All organizations":"No organization"));function Q(U){var Pe;u[U.deviceId]=U;const O=U.telemetry||{};typeof O.latitude=="number"&&typeof O.longitude=="number"&&(O.latitude||O.longitude)&&(f[U.deviceId]||(f[U.deviceId]=[]),f[U.deviceId].push([O.latitude,O.longitude]),f[U.deviceId].length>1e3&&f[U.deviceId].shift()),(!h.value||U.online&&!((Pe=u[h.value])!=null&&Pe.online))&&(h.value=U.deviceId)}function q(U){delete u[U],delete f[U],h.value===U&&(h.value=st.value[0]||null)}function ge(U){y.unshift({t:wu(Date.now()),tag:U.type||"?",text:JSON.stringify(se(U))}),y.length>200&&y.pop()}function se(U){const O={...U};return delete O.type,O}function Ce(){const U=location.protocol==="https:"?"wss":"ws";ue=new WebSocket(`${U}://${location.host}/bff/ws`),ue.onopen=()=>_.value=!0,ue.onclose=()=>{_.value=!1,ae||(ce=setTimeout(Ce,1500))},ue.onerror=()=>ue&&ue.close(),ue.onmessage=O=>{let Pe;try{Pe=JSON.parse(O.data)}catch{return}Pe.type==="snapshot"?(Pe.devices||[]).forEach(Q):Pe.type==="update"&&Pe.device?(Q(Pe.device),Pe.event&&Pe.device.deviceId===h.value&&ge(Pe.event)):Pe.type==="removed"&&Pe.deviceId&&q(Pe.deviceId)}}async function Me(){if(!h.value)return We.value="No device selected.";if(!je.value.trim())return We.value="Enter a command name.";let U;if(oe.value.trim())try{U=JSON.parse(oe.value)}catch{return We.value="Payload is not valid JSON."}const{ok:O,body:Pe}=await Dp(h.value,je.value.trim(),U);We.value=O?`Sent "${je.value.trim()}".`:`Error: ${Pe.error||"failed"}`}function Ze(U,O,Pe=""){return typeof U=="number"?U.toFixed(O)+Pe:"—"}function it(U){h.value=U,Te.value="Live flights"}return Nt(Te,U=>{U==="Overview"&&Ne()}),Nt(()=>be.showAirTraffic,U=>{U?Ne():T.value=[]}),Nt(pe,Ie),ki(async()=>{(await np()).forEach(Q),Ce(),Ge()}),os(()=>{ae=!0,ce&&clearTimeout(ce),ue&&ue.close(),we()}),(U,O)=>{var Pe,qe,vt,xt,rn;return p(),m("div",$w,[a("aside",Nw,[a("div",Dw,[M(nd,{size:26}),O[11]||(O[11]=a("span",{class:"text-[19px] tracking-tightest"},[a("span",{class:"font-medium text-ink-secondary"},"Pilot"),a("span",{class:"font-bold text-ink"},"Vault")],-1))]),a("nav",Fw,[(p(),m(le,null,Re(ze,([de,Tt])=>a("button",{key:Tt,class:Ae(["flex items-center gap-3 rounded px-3 py-2.5 text-left text-sm transition",Te.value===Tt?"bg-accent-soft font-semibold text-accent-soft-fg":"font-medium text-ink-secondary hover:bg-surface-2"]),onClick:gn=>Te.value=Tt},[M(W,{name:de,size:18,stroke:Te.value===Tt?2.2:1.8},null,8,["name","stroke"]),z(" "+k(Tt),1)],10,Rw)),64))]),a("div",Bw,[a("div",Uw,[a("div",Vw,[a("span",{class:Ae(["h-2 w-2 rounded-full",_.value?"bg-ready":"bg-caution"])},null,2),a("span",Zw,k(_.value?"Link healthy":"Reconnecting…"),1)]),a("span",Hw,"API gateway · "+k(_.value?"streaming":"retrying"),1)]),a("div",jw,[a("div",Ww,k(K.value),1),a("div",Kw,[a("div",Gw,k(t.email||"Operator"),1),a("div",qw,[M(W,{name:"grid",size:11,class:"shrink-0"}),a("span",{class:"truncate",title:`${re.value} · ${ne.value}`},k(re.value)+" · "+k(ne.value),9,Yw)])]),a("button",{class:"text-ink-muted transition hover:text-ink",title:"Log out","aria-label":"Log out",onClick:O[0]||(O[0]=de=>l("logout"))},[M(W,{name:"logout",size:16})])])])]),a("main",Jw,[a("header",Xw,[a("div",null,[O[12]||(O[12]=a("div",{class:"eyebrow"},"Live operations",-1)),a("h1",Qw,k(Te.value),1)]),a("div",e2,[a("div",t2,[M(W,{name:"search",size:16,class:"text-ink-muted"}),ee(a("input",{"onUpdate:modelValue":O[1]||(O[1]=de=>C.value=de),placeholder:"Search drones, routes…",class:"w-full border-none bg-transparent text-sm text-ink outline-none placeholder:text-ink-muted"},null,512),[[ye,C.value]])]),a("button",{class:"btn-accent flex items-center gap-2",onClick:O[2]||(O[2]=de=>Te.value="Live flights")},[M(W,{name:"radio",size:16}),O[13]||(O[13]=z(" Live flights ",-1))])])]),Te.value==="Overview"?(p(),m("div",n2,[a("div",i2,[(p(!0),m(le,null,Re(b.value,de=>(p(),m("div",{key:de.label,class:"panel p-5"},[a("div",o2,[a("span",s2,k(de.label),1),M(W,{name:de.icon,size:16,class:"text-ink-muted"},null,8,["name"])]),a("div",a2,k(de.value),1),a("span",{class:Ae(["mt-2 block font-mono text-[11px]",G[de.tone]])},k(de.delta),3)]))),128))]),a("div",r2,[a("div",l2,[a("div",u2,[O[18]||(O[18]=a("div",null,[a("div",{class:"eyebrow"},"Airspace"),a("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Live map")],-1)),a("div",c2,[Oe(be).showAirTraffic&&R.value?(p(),m("span",{key:0,class:Ae(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",S.accent]),title:"Live aircraft from OpenSky Network"},[M(W,{name:"radio",size:12}),z(k(R.value)+" aircraft ",1)],2)):N("",!0),ut.value?(p(),m("span",{key:1,class:Ae(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",S.success])},[O[14]||(O[14]=a("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),z(k(ut.value)+" drones ",1)],2)):N("",!0),a("div",d2,[a("button",{type:"button",class:Ae(["grid h-7 w-7 place-items-center rounded-md text-ink-muted transition hover:bg-surface-2 hover:text-ink",B.value?"bg-surface-2 text-ink":""]),title:"Map settings","aria-label":"Map settings",onClick:O[3]||(O[3]=de=>B.value=!B.value)},[M(W,{name:"settings",size:16})],2),B.value?(p(),m(le,{key:0},[a("div",{class:"fixed inset-0 z-[1190]",onClick:O[4]||(O[4]=de=>B.value=!1)}),a("div",f2,[O[17]||(O[17]=a("div",{class:"eyebrow mb-2.5"},"Map settings",-1)),a("label",h2,[O[15]||(O[15]=a("span",{class:"text-sm text-ink-secondary"},"Show live air traffic",-1)),M(Kt,{modelValue:Oe(be).showAirTraffic,"onUpdate:modelValue":O[5]||(O[5]=de=>Oe(be).showAirTraffic=de)},null,8,["modelValue"])]),a("div",{class:Ae(["mt-3.5",Oe(be).showAirTraffic?"":"pointer-events-none opacity-40"])},[a("div",p2,[O[16]||(O[16]=a("span",{class:"text-sm text-ink-secondary"},"Refresh interval",-1)),a("span",m2,"every "+k(pe.value)+"s",1)]),ee(a("select",{"onUpdate:modelValue":O[6]||(O[6]=de=>Oe(be).airTrafficInterval=de),class:"field"},[(p(),m(le,null,Re(F,de=>a("option",{key:de.value,value:de.value},k(de.label)+k(de.value==="auto"?` (plan: ${A.recommendedInterval}s)`:""),9,g2)),64))],512),[[Et,Oe(be).airTrafficInterval]]),A.plan?(p(),m("p",v2," OpenSky plan: "+k(A.plan),1)):N("",!0)],2)])],64)):N("",!0)])])]),M(Pu,{position:ht.value,trail:lt.value,aircraft:Oe(be).showAirTraffic?T.value:[]},null,8,["position","trail","aircraft"]),Oe(be).showAirTraffic?A.loaded&&A.unavailable?(p(),m("p",b2,k(A.detail||"Live air traffic is unavailable."),1)):(p(),m("p",y2," Live air traffic from OpenSky Network · updates every "+k(pe.value)+"s ",1)):(p(),m("p",_2," Live air traffic hidden · enable it in Map settings "))]),a("div",x2,[a("div",w2,[O[19]||(O[19]=a("div",null,[a("div",{class:"eyebrow"},"Today"),a("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Schedule")],-1)),M(W,{name:"clock",size:16,class:"text-ink-muted"})]),a("div",k2,[M(W,{name:"calendar",size:24,class:"text-ink-muted"}),O[20]||(O[20]=a("div",{class:"mt-2 text-sm font-medium text-ink-secondary"},"No missions scheduled",-1)),O[21]||(O[21]=a("div",{class:"mt-0.5 text-xs text-ink-muted"},"Scheduling is not wired to a backend yet.",-1))])])]),a("div",S2,[a("div",T2,[O[24]||(O[24]=a("div",null,[a("div",{class:"eyebrow"},"Fleet"),a("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Aircraft status")],-1)),a("div",P2,[a("span",{class:Ae(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",S.success])},[O[22]||(O[22]=a("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),z(k(ut.value)+" in flight ",1)],2),Pt.value?(p(),m("span",{key:0,class:Ae(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",S.warning])},[O[23]||(O[23]=a("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),z(k(Pt.value)+" offline ",1)],2)):N("",!0)])]),I.value.length?(p(),m("div",L2,[a("table",M2,[a("thead",null,[a("tr",A2,[(p(),m(le,null,Re(["Aircraft","Mission","Status","Alt","Battery","Speed",""],de=>a("th",{key:de,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(de),1)),64))])]),a("tbody",null,[(p(!0),m(le,null,Re(I.value,(de,Tt)=>(p(),m("tr",{key:de.id,class:Ae(["cursor-pointer transition hover:bg-surface-2",Ttit(de.id)},[a("td",O2,k(de.id),1),a("td",z2,k(de.mission),1),a("td",I2,[a("span",{class:Ae(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",S[de.tone]])},[O[25]||(O[25]=a("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),z(k(de.status),1)],2)]),a("td",$2,k(de.alt),1),a("td",N2,[de.battery!=null?(p(),m("div",D2,[a("div",F2,[a("div",{class:Ae(["h-full",de.battery<40?"bg-caution":"bg-ready"]),style:wo({width:de.battery+"%"})},null,6)]),a("span",R2,k(de.battery)+"%",1)])):(p(),m("span",B2,"—"))]),a("td",U2,[z(k(de.speed==null?"—":de.speed.toFixed(1))+" ",1),O[26]||(O[26]=a("span",{class:"text-ink-muted"},"m/s",-1))]),a("td",V2,[a("button",{class:"btn-ghost inline-flex items-center gap-1.5 whitespace-nowrap",onClick:hl(gn=>it(de.id),["stop"])},[M(W,{name:"play",size:14}),O[27]||(O[27]=z(" Track ",-1))],8,Z2)])],10,E2))),128))])])])):(p(),m("div",C2," No aircraft connected yet. Devices appear here as they come online. "))])])):Te.value==="Live flights"?(p(),m("div",H2,[a("div",j2,[a("span",W2,k(h.value||"No device selected"),1),te.value&&!De.value?(p(),m("span",K2,"Offline")):N("",!0),st.value.length?(p(),m("div",G2,[(p(!0),m(le,null,Re(st.value,de=>(p(),m("button",{key:de,class:Ae(["flex items-center gap-2 rounded border px-3 py-1.5 font-mono text-xs font-bold transition",de===h.value?"border-accent bg-accent-soft text-accent-soft-fg":"border-line bg-surface-1 text-ink-secondary hover:border-line-strong"]),onClick:Tt=>h.value=de},[a("span",{class:Ae(["h-2 w-2 rounded-full",u[de].online?"bg-ready":"bg-ink-muted"])},null,2),z(" "+k(de),1)],10,q2))),128))])):N("",!0)]),st.value.length?(p(),m(le,{key:1},[a("div",{class:Ae(["mb-4 grid gap-3",!De.value&&te.value?"opacity-60":""]),style:{"grid-template-columns":"repeat(auto-fit, minmax(150px, 1fr))"}},[a("div",J2,[O[30]||(O[30]=a("div",{class:"eyebrow"},"Registration",-1)),a("div",{class:Ae(["mt-1 text-sm font-semibold",De.value?((Pe=te.value)==null?void 0:Pe.registration)==="success"?"text-success-fg":"text-danger-fg":"text-ink"])},k(De.value&&((qe=te.value)!=null&&qe.registration)?te.value.registration:"—"),3)]),a("div",X2,[O[31]||(O[31]=a("div",{class:"eyebrow"},"Drone link",-1)),a("div",{class:Ae(["mt-1 text-sm font-semibold",De.value?(vt=te.value)!=null&&vt.connected?"text-success-fg":"text-danger-fg":"text-ink"])},k(te.value?De.value?te.value.connected?"connected":"no drone":"app offline":"—"),3)]),a("div",Q2,[O[32]||(O[32]=a("div",{class:"eyebrow"},"Model",-1)),a("div",ek,k(((xt=te.value)==null?void 0:xt.model)||"—"),1)]),a("div",tk,[O[33]||(O[33]=a("div",{class:"eyebrow"},"Last update",-1)),a("div",nk,k((rn=te.value)!=null&&rn.lastSeenMs?Oe(wu)(te.value.lastSeenMs):"—"),1)])],2),a("div",ik,[a("div",ok,[O[35]||(O[35]=a("div",{class:"mb-3 eyebrow"},"Battery",-1)),a("div",sk,[a("div",ak,[a("div",{class:Ae(["h-full transition-all",typeof ke.value.batteryPercent=="number"?ke.value.batteryPercent<20?"bg-warning":ke.value.batteryPercent<40?"bg-caution":"bg-ready":""]),style:wo({width:(typeof ke.value.batteryPercent=="number"?ke.value.batteryPercent:0)+"%"})},null,6)]),a("div",rk,[z(k(typeof ke.value.batteryPercent=="number"?ke.value.batteryPercent:"—"),1),O[34]||(O[34]=a("span",{class:"text-sm text-ink-secondary"},"%",-1))])])]),a("div",lk,[O[37]||(O[37]=a("div",{class:"mb-3 eyebrow"},"Altitude",-1)),a("div",uk,[z(k(Ze(ke.value.altitude,1)),1),O[36]||(O[36]=a("span",{class:"text-sm text-ink-secondary"}," m",-1))])]),a("div",ck,[O[42]||(O[42]=a("div",{class:"mb-3 eyebrow"},"Flight",-1)),a("div",dk,[a("div",fk,[O[38]||(O[38]=a("span",{class:"text-ink-secondary"},"Mode",-1)),a("b",hk,k(ke.value.flightMode||"—"),1)]),a("div",pk,[O[39]||(O[39]=a("span",{class:"text-ink-secondary"},"Flying",-1)),a("b",mk,k(ke.value.isFlying==null?"—":ke.value.isFlying?"yes":"no"),1)]),a("div",gk,[O[40]||(O[40]=a("span",{class:"text-ink-secondary"},"GPS sats",-1)),a("b",vk,k(ke.value.satelliteCount==null?"—":ke.value.satelliteCount),1)]),a("div",_k,[O[41]||(O[41]=a("span",{class:"text-ink-secondary"},"Speed (H)",-1)),a("b",bk,k(Ve.value==null?"—":Ze(Ve.value,2," m/s")),1)])])]),a("div",yk,[O[46]||(O[46]=a("div",{class:"mb-3 eyebrow"},"Position",-1)),a("div",xk,[a("div",wk,[O[43]||(O[43]=a("span",{class:"text-ink-secondary"},"Latitude",-1)),a("b",kk,k(Ze(ke.value.latitude,6)),1)]),a("div",Sk,[O[44]||(O[44]=a("span",{class:"text-ink-secondary"},"Longitude",-1)),a("b",Tk,k(Ze(ke.value.longitude,6)),1)]),a("div",Pk,[O[45]||(O[45]=a("span",{class:"text-ink-secondary"},"Vert. speed",-1)),a("b",Ck,k(Ze(typeof ke.value.velocityZ=="number"?-ke.value.velocityZ:void 0,2," m/s")),1)])])]),a("div",Lk,[O[47]||(O[47]=a("div",{class:"mb-3 eyebrow"},"Track",-1)),M(Pu,{position:ht.value,trail:lt.value},null,8,["position","trail"])]),a("div",Mk,[O[48]||(O[48]=a("div",{class:"mb-3 eyebrow"},"Send command",-1)),a("div",Ak,[ee(a("input",{"onUpdate:modelValue":O[7]||(O[7]=de=>je.value=de),class:"field flex-1",placeholder:"command (e.g. startConnection)"},null,512),[[ye,je.value]]),ee(a("input",{"onUpdate:modelValue":O[8]||(O[8]=de=>oe.value=de),class:"field flex-1",placeholder:"payload JSON (optional)"},null,512),[[ye,oe.value]]),a("button",{class:"btn-accent",onClick:Me},"Send")]),a("div",Ek,k(We.value),1)]),a("div",Ok,[O[49]||(O[49]=a("div",{class:"mb-3 eyebrow"},"Event log",-1)),a("div",zk,[(p(!0),m(le,null,Re(y,(de,Tt)=>(p(),m("div",{key:Tt,class:"border-b border-line py-1"},[a("span",Ik,k(de.t),1),a("span",$k,k(de.tag),1),a("span",Nk,k(de.text),1)]))),128))])])])],64)):(p(),m("div",Y2,[M(W,{name:"radio",size:28,class:"text-ink-muted"}),O[28]||(O[28]=a("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No aircraft online",-1)),O[29]||(O[29]=a("div",{class:"mt-1 text-xs text-ink-muted"},"Live telemetry appears here once a drone connects.",-1))]))])):Te.value==="Logbook"?(p(),ot(qx,{key:2,email:t.email,role:t.role,organization:t.organization,"organization-name":t.organizationName},null,8,["email","role","organization","organization-name"])):Te.value==="Documents"?(p(),ot(Iw,{key:3,email:t.email,role:t.role,organization:t.organization,"organization-name":t.organizationName},null,8,["email","role","organization","organization-name"])):Te.value==="Settings"?(p(),ot(Xb,{key:4,email:t.email,role:t.role,organization:t.organization,"organization-name":t.organizationName,onLogout:O[9]||(O[9]=de=>l("logout"))},null,8,["email","role","organization","organization-name"])):(p(),m("div",Dk,[a("div",Fk,[M(W,{name:ie.value,size:28,class:"text-ink-muted"},null,8,["name"]),a("div",Rk,k(Te.value),1),Te.value==="Drives"?(p(),m("div",Bk,[O[50]||(O[50]=z(" Browse and transfer files here once a drive is connected. Configure drives in ",-1)),a("button",{class:"font-semibold text-accent hover:underline",onClick:O[10]||(O[10]=de=>Te.value="Settings")},"Settings → Integrations"),O[51]||(O[51]=z(". ",-1))])):(p(),m("div",Uk,"This section is part of the console shell and has no backend yet."))])]))])])}}},Hk={key:0,class:"h-full"},jk={key:1,class:"grid h-full place-items-center text-ink-muted text-sm"},Wk={__name:"App",setup(t){const i=Z(!1),s=Z(null),l=Z("user"),u=Z(""),f=Z(""),h=Z("");function _(T){l.value=T&&T.role||"user",u.value=T&&T.organization||"",f.value=T&&T.organizationName||""}ki(async()=>{h.value=(await Qh()).apiBase||"";const T=await vu();T&&(s.value=T.email,_(T),await Su()),i.value=!0});async function y(T){s.value=T,_(await vu()),await Su()}async function C(){Vp(),await tp(),s.value=null,l.value="user",u.value="",f.value=""}return(T,A)=>i.value?(p(),m("div",Hk,[s.value?(p(),ot(Zk,{key:0,email:s.value,role:l.value,organization:u.value,"organization-name":f.value,onLogout:C},null,8,["email","role","organization","organization-name"])):(p(),ot(sm,{key:1,"default-api-base":h.value,onSignedIn:y},null,8,["default-api-base"]))])):(p(),m("div",jk,"Loading…"))}};qh(Wk).mount("#app"); diff --git a/Web App/server/dist/assets/index-DWe3LEIB.js b/Web App/server/dist/assets/index-DWe3LEIB.js new file mode 100644 index 0000000..8ee4caa --- /dev/null +++ b/Web App/server/dist/assets/index-DWe3LEIB.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 f of u)if(f.type==="childList")for(const h of f.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&l(h)}).observe(document,{childList:!0,subtree:!0});function s(u){const f={};return u.integrity&&(f.integrity=u.integrity),u.referrerPolicy&&(f.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?f.credentials="include":u.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function l(u){if(u.ep)return;u.ep=!0;const f=s(u);fetch(u.href,f)}})();/** +* @vue/shared v3.5.39 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/function Xr(t){const i=Object.create(null);for(const s of t.split(","))i[s]=1;return s=>s in i}const wt={},es=[],di=()=>{},Ou=()=>!1,ja=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),Wa=t=>t.startsWith("onUpdate:"),Ht=Object.assign,Qr=(t,i)=>{const s=t.indexOf(i);s>-1&&t.splice(s,1)},pd=Object.prototype.hasOwnProperty,vt=(t,i)=>pd.call(t,i),De=Array.isArray,ts=t=>ea(t)==="[object Map]",ls=t=>ea(t)==="[object Set]",Ll=t=>ea(t)==="[object Date]",Ge=t=>typeof t=="function",Ct=t=>typeof t=="string",ti=t=>typeof t=="symbol",_t=t=>t!==null&&typeof t=="object",zu=t=>(_t(t)||Ge(t))&&Ge(t.then)&&Ge(t.catch),Iu=Object.prototype.toString,ea=t=>Iu.call(t),md=t=>ea(t).slice(8,-1),$u=t=>ea(t)==="[object Object]",el=t=>Ct(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,Rs=Xr(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Ka=t=>{const i=Object.create(null);return(s=>i[s]||(i[s]=t(s)))},gd=/-\w/g,Qn=Ka(t=>t.replace(gd,i=>i.slice(1).toUpperCase())),vd=/\B([A-Z])/g,eo=Ka(t=>t.replace(vd,"-$1").toLowerCase()),Nu=Ka(t=>t.charAt(0).toUpperCase()+t.slice(1)),xr=Ka(t=>t?`on${Nu(t)}`:""),ci=(t,i)=>!Object.is(t,i),Ea=(t,...i)=>{for(let s=0;s{Object.defineProperty(t,i,{configurable:!0,enumerable:!1,writable:l,value:s})},Ga=t=>{const i=parseFloat(t);return isNaN(i)?t:i},_d=t=>{const i=Ct(t)?Number(t):NaN;return isNaN(i)?t:i};let Al;const qa=()=>Al||(Al=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Mo(t){if(De(t)){const i={};for(let s=0;s{if(s){const l=s.split(yd);l.length>1&&(i[l[0].trim()]=l[1].trim())}}),i}function Ae(t){let i="";if(Ct(t))i=t;else if(De(t))for(let s=0;sJi(s,i))}const Ru=t=>!!(t&&t.__v_isRef===!0),w=t=>Ct(t)?t:t==null?"":De(t)||_t(t)&&(t.toString===Iu||!Ge(t.toString))?Ru(t)?w(t.value):JSON.stringify(t,Bu,2):String(t),Bu=(t,i)=>Ru(i)?Bu(t,i.value):ts(i)?{[`Map(${i.size})`]:[...i.entries()].reduce((s,[l,u],f)=>(s[wr(l,f)+" =>"]=u,s),{})}:ls(i)?{[`Set(${i.size})`]:[...i.values()].map(s=>wr(s))}:ti(i)?wr(i):_t(i)&&!De(i)&&!$u(i)?String(i):i,wr=(t,i="")=>{var s;return ti(t)?`Symbol(${(s=t.description)!=null?s:i})`:t};/** +* @vue/reactivity v3.5.39 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let Wt;class Pd{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&&Wt&&(Wt.active?(this.parent=Wt,this.index=(Wt.scopes||(Wt.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let i,s;if(this.scopes)for(i=0,s=this.scopes.length;i0&&--this._on===0){if(Wt===this)Wt=this.prevScope;else{let i=Wt;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 s,l;for(s=0,l=this.effects.length;s0)return;if(Us){let i=Us;for(Us=void 0;i;){const s=i.next;i.next=void 0,i.flags&=-9,i=s}}let t;for(;Bs;){let i=Bs;for(Bs=void 0;i;){const s=i.next;if(i.next=void 0,i.flags&=-9,i.flags&1)try{i.trigger()}catch(l){t||(t=l)}i=s}}if(t)throw t}function Hu(t){for(let i=t.deps;i;i=i.nextDep)i.version=-1,i.prevActiveLink=i.dep.activeLink,i.dep.activeLink=i}function ju(t){let i,s=t.depsTail,l=s;for(;l;){const u=l.prevDep;l.version===-1?(l===s&&(s=u),ol(l),Ld(l)):i=l,l.dep.activeLink=l.prevActiveLink,l.prevActiveLink=void 0,l=u}t.deps=i,t.depsTail=s}function $r(t){for(let i=t.deps;i;i=i.nextDep)if(i.dep.version!==i.version||i.dep.computed&&(Wu(i.dep.computed)||i.dep.version!==i.version))return!0;return!!t._dirty}function Wu(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===Ws)||(t.globalVersion=Ws,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!$r(t))))return;t.flags|=2;const i=t.dep,s=St,l=ei;St=t,ei=!0;try{Hu(t);const u=t.fn(t._value);(i.version===0||ci(u,t._value))&&(t.flags|=128,t._value=u,i.version++)}catch(u){throw i.version++,u}finally{St=s,ei=l,ju(t),t.flags&=-3}}function ol(t,i=!1){const{dep:s,prevSub:l,nextSub:u}=t;if(l&&(l.nextSub=u,t.prevSub=void 0),u&&(u.prevSub=l,t.nextSub=void 0),s.subs===t&&(s.subs=l,!l&&s.computed)){s.computed.flags&=-5;for(let f=s.computed.deps;f;f=f.nextDep)ol(f,!0)}!i&&!--s.sc&&s.map&&s.map.delete(s.key)}function Ld(t){const{prevDep:i,nextDep:s}=t;i&&(i.nextDep=s,t.prevDep=void 0),s&&(s.prevDep=i,t.nextDep=void 0)}let ei=!0;const Ku=[];function fi(){Ku.push(ei),ei=!1}function hi(){const t=Ku.pop();ei=t===void 0?!0:t}function Ml(t){const{cleanup:i}=t;if(t.cleanup=void 0,i){const s=St;St=void 0;try{i()}finally{St=s}}}let Ws=0;class Ad{constructor(i,s){this.sub=i,this.dep=s,this.version=s.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class sl{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(!St||!ei||St===this.computed)return;let s=this.activeLink;if(s===void 0||s.sub!==St)s=this.activeLink=new Ad(St,this),St.deps?(s.prevDep=St.depsTail,St.depsTail.nextDep=s,St.depsTail=s):St.deps=St.depsTail=s,Gu(s);else if(s.version===-1&&(s.version=this.version,s.nextDep)){const l=s.nextDep;l.prevDep=s.prevDep,s.prevDep&&(s.prevDep.nextDep=l),s.prevDep=St.depsTail,s.nextDep=void 0,St.depsTail.nextDep=s,St.depsTail=s,St.deps===s&&(St.deps=l)}return s}trigger(i){this.version++,Ws++,this.notify(i)}notify(i){nl();try{for(let s=this.subs;s;s=s.prevSub)s.sub.notify()&&s.sub.dep.notify()}finally{il()}}}function Gu(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)Gu(l)}const s=t.dep.subs;s!==t&&(t.prevSub=s,s&&(s.nextSub=t)),t.dep.subs=t}}const Nr=new WeakMap,Lo=Symbol(""),Dr=Symbol(""),Ks=Symbol("");function tn(t,i,s){if(ei&&St){let l=Nr.get(t);l||Nr.set(t,l=new Map);let u=l.get(s);u||(l.set(s,u=new sl),u.map=l,u.key=s),u.track()}}function Ci(t,i,s,l,u,f){const h=Nr.get(t);if(!h){Ws++;return}const _=y=>{y&&y.trigger()};if(nl(),i==="clear")h.forEach(_);else{const y=De(t),C=y&&el(s);if(y&&s==="length"){const T=Number(l);h.forEach((M,U)=>{(U==="length"||U===Ks||!ti(U)&&U>=T)&&_(M)})}else switch((s!==void 0||h.has(void 0))&&_(h.get(s)),C&&_(h.get(Ks)),i){case"add":y?C&&_(h.get("length")):(_(h.get(Lo)),ts(t)&&_(h.get(Dr)));break;case"delete":y||(_(h.get(Lo)),ts(t)&&_(h.get(Dr)));break;case"set":ts(t)&&_(h.get(Lo));break}}il()}function Xo(t){const i=pt(t);return i===t?i:(tn(i,"iterate",Ks),Hn(t)?i:i.map(ni))}function Ya(t){return tn(t=pt(t),"iterate",Ks),t}function li(t,i){return Mi(t)?as(Ao(t)?ni(i):i):ni(i)}const Md={__proto__:null,[Symbol.iterator](){return Sr(this,Symbol.iterator,t=>li(this,t))},concat(...t){return Xo(this).concat(...t.map(i=>De(i)?Xo(i):i))},entries(){return Sr(this,"entries",t=>(t[1]=li(this,t[1]),t))},every(t,i){return ki(this,"every",t,i,void 0,arguments)},filter(t,i){return ki(this,"filter",t,i,s=>s.map(l=>li(this,l)),arguments)},find(t,i){return ki(this,"find",t,i,s=>li(this,s),arguments)},findIndex(t,i){return ki(this,"findIndex",t,i,void 0,arguments)},findLast(t,i){return ki(this,"findLast",t,i,s=>li(this,s),arguments)},findLastIndex(t,i){return ki(this,"findLastIndex",t,i,void 0,arguments)},forEach(t,i){return ki(this,"forEach",t,i,void 0,arguments)},includes(...t){return Tr(this,"includes",t)},indexOf(...t){return Tr(this,"indexOf",t)},join(t){return Xo(this).join(t)},lastIndexOf(...t){return Tr(this,"lastIndexOf",t)},map(t,i){return ki(this,"map",t,i,void 0,arguments)},pop(){return Es(this,"pop")},push(...t){return Es(this,"push",t)},reduce(t,...i){return El(this,"reduce",t,i)},reduceRight(t,...i){return El(this,"reduceRight",t,i)},shift(){return Es(this,"shift")},some(t,i){return ki(this,"some",t,i,void 0,arguments)},splice(...t){return Es(this,"splice",t)},toReversed(){return Xo(this).toReversed()},toSorted(t){return Xo(this).toSorted(t)},toSpliced(...t){return Xo(this).toSpliced(...t)},unshift(...t){return Es(this,"unshift",t)},values(){return Sr(this,"values",t=>li(this,t))}};function Sr(t,i,s){const l=Ya(t),u=l[i]();return l!==t&&!Hn(t)&&(u._next=u.next,u.next=()=>{const f=u._next();return f.done||(f.value=s(f.value)),f}),u}const Ed=Array.prototype;function ki(t,i,s,l,u,f){const h=Ya(t),_=h!==t&&!Hn(t),y=h[i];if(y!==Ed[i]){const M=y.apply(t,f);return _?ni(M):M}let C=s;h!==t&&(_?C=function(M,U){return s.call(this,li(t,M),U,t)}:s.length>2&&(C=function(M,U){return s.call(this,M,U,t)}));const T=y.call(h,C,l);return _&&u?u(T):T}function El(t,i,s,l){const u=Ya(t),f=u!==t&&!Hn(t);let h=s,_=!1;u!==t&&(f?(_=l.length===0,h=function(C,T,M){return _&&(_=!1,C=li(t,C)),s.call(this,C,li(t,T),M,t)}):s.length>3&&(h=function(C,T,M){return s.call(this,C,T,M,t)}));const y=u[i](h,...l);return _?li(t,y):y}function Tr(t,i,s){const l=pt(t);tn(l,"iterate",Ks);const u=l[i](...s);return(u===-1||u===!1)&&ll(s[0])?(s[0]=pt(s[0]),l[i](...s)):u}function Es(t,i,s=[]){fi(),nl();const l=pt(t)[i].apply(t,s);return il(),hi(),l}const Od=Xr("__proto__,__v_isRef,__isVue"),qu=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(ti));function zd(t){ti(t)||(t=String(t));const i=pt(this);return tn(i,"has",t),i.hasOwnProperty(t)}class Yu{constructor(i=!1,s=!1){this._isReadonly=i,this._isShallow=s}get(i,s,l){if(s==="__v_skip")return i.__v_skip;const u=this._isReadonly,f=this._isShallow;if(s==="__v_isReactive")return!u;if(s==="__v_isReadonly")return u;if(s==="__v_isShallow")return f;if(s==="__v_raw")return l===(u?f?Zd:ec:f?Qu:Xu).get(i)||Object.getPrototypeOf(i)===Object.getPrototypeOf(l)?i:void 0;const h=De(i);if(!u){let y;if(h&&(y=Md[s]))return y;if(s==="hasOwnProperty")return zd}const _=Reflect.get(i,s,sn(i)?i:l);if((ti(s)?qu.has(s):Od(s))||(u||tn(i,"get",s),f))return _;if(sn(_)){const y=h&&el(s)?_:_.value;return u&&_t(y)?Rr(y):y}return _t(_)?u?Rr(_):xt(_):_}}class Ju extends Yu{constructor(i=!1){super(!1,i)}set(i,s,l,u){let f=i[s];const h=De(i)&&el(s);if(!this._isShallow){const C=Mi(f);if(!Hn(l)&&!Mi(l)&&(f=pt(f),l=pt(l)),!h&&sn(f)&&!sn(l))return C||(f.value=l),!0}const _=h?Number(s)t,Ta=t=>Reflect.getPrototypeOf(t);function Fd(t,i,s){return function(...l){const u=this.__v_raw,f=pt(u),h=ts(f),_=t==="entries"||t===Symbol.iterator&&h,y=t==="keys"&&h,C=u[t](...l),T=s?Fr:i?as:ni;return!i&&tn(f,"iterate",y?Dr:Lo),Ht(Object.create(C),{next(){const{value:M,done:U}=C.next();return U?{value:M,done:U}:{value:_?[T(M[0]),T(M[1])]:T(M),done:U}}})}}function Pa(t){return function(...i){return t==="delete"?!1:t==="clear"?void 0:this}}function Rd(t,i){const s={get(u){const f=this.__v_raw,h=pt(f),_=pt(u);t||(ci(u,_)&&tn(h,"get",u),tn(h,"get",_));const{has:y}=Ta(h),C=i?Fr:t?as:ni;if(y.call(h,u))return C(f.get(u));if(y.call(h,_))return C(f.get(_));f!==h&&f.get(u)},get size(){const u=this.__v_raw;return!t&&tn(pt(u),"iterate",Lo),u.size},has(u){const f=this.__v_raw,h=pt(f),_=pt(u);return t||(ci(u,_)&&tn(h,"has",u),tn(h,"has",_)),u===_?f.has(u):f.has(u)||f.has(_)},forEach(u,f){const h=this,_=h.__v_raw,y=pt(_),C=i?Fr:t?as:ni;return!t&&tn(y,"iterate",Lo),_.forEach((T,M)=>u.call(f,C(T),C(M),h))}};return Ht(s,t?{add:Pa("add"),set:Pa("set"),delete:Pa("delete"),clear:Pa("clear")}:{add(u){const f=pt(this),h=Ta(f),_=pt(u),y=!i&&!Hn(u)&&!Mi(u)?_:u;return h.has.call(f,y)||ci(u,y)&&h.has.call(f,u)||ci(_,y)&&h.has.call(f,_)||(f.add(y),Ci(f,"add",y,y)),this},set(u,f){!i&&!Hn(f)&&!Mi(f)&&(f=pt(f));const h=pt(this),{has:_,get:y}=Ta(h);let C=_.call(h,u);C||(u=pt(u),C=_.call(h,u));const T=y.call(h,u);return h.set(u,f),C?ci(f,T)&&Ci(h,"set",u,f):Ci(h,"add",u,f),this},delete(u){const f=pt(this),{has:h,get:_}=Ta(f);let y=h.call(f,u);y||(u=pt(u),y=h.call(f,u)),_&&_.call(f,u);const C=f.delete(u);return y&&Ci(f,"delete",u,void 0),C},clear(){const u=pt(this),f=u.size!==0,h=u.clear();return f&&Ci(u,"clear",void 0,void 0),h}}),["keys","values","entries",Symbol.iterator].forEach(u=>{s[u]=Fd(u,t,i)}),s}function al(t,i){const s=Rd(t,i);return(l,u,f)=>u==="__v_isReactive"?!t:u==="__v_isReadonly"?t:u==="__v_raw"?l:Reflect.get(vt(s,u)&&u in l?s:l,u,f)}const Bd={get:al(!1,!1)},Ud={get:al(!1,!0)},Vd={get:al(!0,!1)};const Xu=new WeakMap,Qu=new WeakMap,ec=new WeakMap,Zd=new WeakMap;function Hd(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function xt(t){return Mi(t)?t:rl(t,!1,$d,Bd,Xu)}function jd(t){return rl(t,!1,Dd,Ud,Qu)}function Rr(t){return rl(t,!0,Nd,Vd,ec)}function rl(t,i,s,l,u){if(!_t(t)||t.__v_raw&&!(i&&t.__v_isReactive)||t.__v_skip||!Object.isExtensible(t))return t;const f=u.get(t);if(f)return f;const h=Hd(md(t));if(h===0)return t;const _=new Proxy(t,h===2?l:s);return u.set(t,_),_}function Ao(t){return Mi(t)?Ao(t.__v_raw):!!(t&&t.__v_isReactive)}function Mi(t){return!!(t&&t.__v_isReadonly)}function Hn(t){return!!(t&&t.__v_isShallow)}function ll(t){return t?!!t.__v_raw:!1}function pt(t){const i=t&&t.__v_raw;return i?pt(i):t}function Wd(t){return!vt(t,"__v_skip")&&Object.isExtensible(t)&&Du(t,"__v_skip",!0),t}const ni=t=>_t(t)?xt(t):t,as=t=>_t(t)?Rr(t):t;function sn(t){return t?t.__v_isRef===!0:!1}function W(t){return Kd(t,!1)}function Kd(t,i){return sn(t)?t:new Gd(t,i)}class Gd{constructor(i,s){this.dep=new sl,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=s?i:pt(i),this._value=s?i:ni(i),this.__v_isShallow=s}get value(){return this.dep.track(),this._value}set value(i){const s=this._rawValue,l=this.__v_isShallow||Hn(i)||Mi(i);i=l?i:pt(i),ci(i,s)&&(this._rawValue=i,this._value=l?i:ni(i),this.dep.trigger())}}function Oe(t){return sn(t)?t.value:t}const qd={get:(t,i,s)=>i==="__v_raw"?t:Oe(Reflect.get(t,i,s)),set:(t,i,s,l)=>{const u=t[i];return sn(u)&&!sn(s)?(u.value=s,!0):Reflect.set(t,i,s,l)}};function tc(t){return Ao(t)?t:new Proxy(t,qd)}class Yd{constructor(i,s,l){this.fn=i,this.setter=s,this._value=void 0,this.dep=new sl(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Ws-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!s,this.isSSR=l}notify(){if(this.flags|=16,!(this.flags&8)&&St!==this)return Zu(this,!0),!0}get value(){const i=this.dep.track();return Wu(this),i&&(i.version=this.dep.version),this._value}set value(i){this.setter&&this.setter(i)}}function Jd(t,i,s=!1){let l,u;return Ge(t)?l=t:(l=t.get,u=t.set),new Yd(l,u,s)}const Ca={},za=new WeakMap;let To;function Xd(t,i=!1,s=To){if(s){let l=za.get(s);l||za.set(s,l=[]),l.push(t)}}function Qd(t,i,s=wt){const{immediate:l,deep:u,once:f,scheduler:h,augmentJob:_,call:y}=s,C=ce=>u?ce:Hn(ce)||u===!1||u===0?Li(ce,1):Li(ce);let T,M,U,V,K=!1,F=!1;if(sn(t)?(M=()=>t.value,K=Hn(t)):Ao(t)?(M=()=>C(t),K=!0):De(t)?(F=!0,K=t.some(ce=>Ao(ce)||Hn(ce)),M=()=>t.map(ce=>{if(sn(ce))return ce.value;if(Ao(ce))return C(ce);if(Ge(ce))return y?y(ce,2):ce()})):Ge(t)?i?M=y?()=>y(t,2):t:M=()=>{if(U){fi();try{U()}finally{hi()}}const ce=To;To=T;try{return y?y(t,3,[V]):t(V)}finally{To=ce}}:M=di,i&&u){const ce=M,Be=u===!0?1/0:u;M=()=>Li(ce(),Be)}const me=Cd(),he=()=>{T.stop(),me&&me.active&&Qr(me.effects,T)};if(f&&i){const ce=i;i=(...Be)=>{const Ne=ce(...Be);return he(),Ne}}let Y=F?new Array(t.length).fill(Ca):Ca;const Le=ce=>{if(!(!(T.flags&1)||!T.dirty&&!ce))if(i){const Be=T.run();if(ce||u||K||(F?Be.some((Ne,ze)=>ci(Ne,Y[ze])):ci(Be,Y))){U&&U();const Ne=To;To=T;try{const ze=[Be,Y===Ca?void 0:F&&Y[0]===Ca?[]:Y,V];Y=Be,y?y(i,3,ze):i(...ze)}finally{To=Ne}}}else T.run()};return _&&_(Le),T=new Uu(M),T.scheduler=h?()=>h(Le,!1):Le,V=ce=>Xd(ce,!1,T),U=T.onStop=()=>{const ce=za.get(T);if(ce){if(y)y(ce,4);else for(const Be of ce)Be();za.delete(T)}},i?l?Le(!0):Y=T.run():h?h(Le.bind(null,!0),!0):T.run(),he.pause=T.pause.bind(T),he.resume=T.resume.bind(T),he.stop=he,he}function Li(t,i=1/0,s){if(i<=0||!_t(t)||t.__v_skip||(s=s||new Map,(s.get(t)||0)>=i))return t;if(s.set(t,i),i--,sn(t))Li(t.value,i,s);else if(De(t))for(let l=0;l{Li(l,i,s)});else if($u(t)){for(const l in t)Li(t[l],i,s);for(const l of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,l)&&Li(t[l],i,s)}return t}/** +* @vue/runtime-core v3.5.39 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/function ta(t,i,s,l){try{return l?t(...l):t()}catch(u){Ja(u,i,s)}}function Wn(t,i,s,l){if(Ge(t)){const u=ta(t,i,s,l);return u&&zu(u)&&u.catch(f=>{Ja(f,i,s)}),u}if(De(t)){const u=[];for(let f=0;f>>1,u=fn[l],f=Gs(u);f=Gs(s)?fn.push(t):fn.splice(tf(i),0,t),t.flags|=1,oc()}}function oc(){Ia||(Ia=nc.then(ac))}function nf(t){De(t)?ns.push(...t):Yi&&t.id===-1?Yi.splice(Qo+1,0,t):t.flags&1||(ns.push(t),t.flags|=1),oc()}function Ol(t,i,s=ri+1){for(;sGs(s)-Gs(l));if(ns.length=0,Yi){Yi.push(...i);return}for(Yi=i,Qo=0;Qot.id==null?t.flags&2?-1:1/0:t.id;function ac(t){try{for(ri=0;ri{l._d&&Fa(-1);const f=$a(i);let h;try{h=t(...u)}finally{$a(f),l._d&&Fa(1)}return h};return l._n=!0,l._c=!0,l._d=!0,l}function Q(t,i){if(on===null)return t;const s=nr(on),l=t.dirs||(t.dirs=[]);for(let u=0;u1)return s&&Ge(i)?i.call(l&&l.proxy):i}}const of=Symbol.for("v-scx"),sf=()=>Vs(of);function Rt(t,i,s){return uc(t,i,s)}function uc(t,i,s=wt){const{immediate:l,deep:u,flush:f,once:h}=s,_=Ht({},s),y=i&&l||!i&&f!=="post";let C;if(Xs){if(f==="sync"){const V=sf();C=V.__watcherHandles||(V.__watcherHandles=[])}else if(!y){const V=()=>{};return V.stop=di,V.resume=di,V.pause=di,V}}const T=hn;_.call=(V,K,F)=>Wn(V,T,K,F);let M=!1;f==="post"?_.scheduler=V=>{dn(V,T&&T.suspense)}:f!=="sync"&&(M=!0,_.scheduler=(V,K)=>{K?V():ul(V)}),_.augmentJob=V=>{i&&(V.flags|=4),M&&(V.flags|=2,T&&(V.id=T.uid,V.i=T))};const U=Qd(t,i,_);return Xs&&(C?C.push(U):y&&U()),U}function af(t,i,s){const l=this.proxy,u=Ct(t)?t.includes(".")?cc(l,t):()=>l[t]:t.bind(l,l);let f;Ge(i)?f=i:(f=i.handler,s=i);const h=na(this),_=uc(u,f.bind(l),s);return h(),_}function cc(t,i){const s=i.split(".");return()=>{let l=t;for(let u=0;ut.__isTeleport,Po=t=>t&&(t.disabled||t.disabled===""),rf=t=>t&&(t.defer||t.defer===""),zl=t=>typeof SVGElement<"u"&&t instanceof SVGElement,Il=t=>typeof MathMLElement=="function"&&t instanceof MathMLElement,Br=(t,i)=>{const s=t&&t.to;return Ct(s)?i?i(s):null:s},lf={name:"Teleport",__isTeleport:!0,process(t,i,s,l,u,f,h,_,y,C){const{mc:T,pc:M,pbc:U,o:{insert:V,querySelector:K,createText:F,createComment:me,parentNode:he}}=C,Y=Po(i.props);let{dynamicChildren:Le}=i;const ce=(ze,We,we)=>{ze.shapeFlag&16&&T(ze.children,We,we,u,f,h,_,y)},Be=(ze=i)=>{const We=Po(ze.props),we=ze.target=Br(ze.props,K),le=Ur(we,ze,F,V);we&&(h!=="svg"&&zl(we)?h="svg":h!=="mathml"&&Il(we)&&(h="mathml"),u&&u.isCE&&(u.ce._teleportTargets||(u.ce._teleportTargets=new Set)).add(we),We||(ce(ze,we,le),$s(ze,!1)))},Ne=ze=>{const We=()=>{if(qi.get(ze)===We){if(qi.delete(ze),Po(ze.props)){const we=he(ze.el)||s;ce(ze,we,ze.anchor),$s(ze,!0)}Be(ze)}};qi.set(ze,We),dn(We,f)};if(t==null){const ze=i.el=F(""),We=i.anchor=F("");if(V(ze,s,l),V(We,s,l),rf(i.props)||f&&f.pendingBranch){Ne(i);return}Y&&(ce(i,s,We),$s(i,!0)),Be()}else{i.el=t.el;const ze=i.anchor=t.anchor,We=qi.get(t);if(We){We.flags|=8,qi.delete(t),Ne(i);return}i.targetStart=t.targetStart;const we=i.target=t.target,le=i.targetAnchor=t.targetAnchor,Me=Po(t.props),ie=Me?s:we,Ke=Me?ze:le;if(h==="svg"||zl(we)?h="svg":(h==="mathml"||Il(we))&&(h="mathml"),Le?(U(t.dynamicChildren,Le,ie,u,f,h,_),fl(t,i,!0)):y||M(t,i,ie,Ke,u,f,h,_,!1),Y)Me?i.props&&t.props&&i.props.to!==t.props.to&&(i.props.to=t.props.to):La(i,s,ze,C,1);else if((i.props&&i.props.to)!==(t.props&&t.props.to)){const re=Br(i.props,K);re&&(i.target=re,La(i,re,null,C,0))}else Me&&La(i,we,le,C,1);$s(i,Y)}},remove(t,i,s,{um:l,o:{remove:u}},f){const{shapeFlag:h,children:_,anchor:y,targetStart:C,targetAnchor:T,target:M,props:U}=t,V=Po(U),K=f||!V,F=qi.get(t);if(F&&(F.flags|=8,qi.delete(t)),M&&(u(C),u(T)),f&&u(y),!F&&(V||M)&&h&16)for(let me=0;me<_.length;me++){const he=_[me];l(he,i,s,K,!!he.dynamicChildren)}},move:La,hydrate:uf};function La(t,i,s,{o:{insert:l},m:u},f=2){f===0&&l(t.targetAnchor,i,s);const{el:h,anchor:_,shapeFlag:y,children:C,props:T}=t,M=f===2;if(M&&l(h,i,s),!qi.has(t)&&(!M||Po(T))&&y&16)for(let U=0;U{t.isMounted=!0}),us(()=>{t.isUnmounting=!0}),t}const Vn=[Function,Array],hc={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Vn,onEnter:Vn,onAfterEnter:Vn,onEnterCancelled:Vn,onBeforeLeave:Vn,onLeave:Vn,onAfterLeave:Vn,onLeaveCancelled:Vn,onBeforeAppear:Vn,onAppear:Vn,onAfterAppear:Vn,onAppearCancelled:Vn},pc=t=>{const i=t.subTree;return i.component?pc(i.component):i},ff={name:"BaseTransition",props:hc,setup(t,{slots:i}){const s=Bc(),l=df();return()=>{const u=i.default&&vc(i.default(),!0),f=u&&u.length?mc(u):s.subTree?$():void 0;if(!f)return;const h=pt(t),{mode:_}=h;if(l.isLeaving)return Pr(f);const y=$l(f);if(!y)return Pr(f);let C=Vr(y,h,l,s,M=>C=M);y.type!==nn&&qs(y,C);let T=s.subTree&&$l(s.subTree);if(T&&T.type!==nn&&!Co(T,y)&&pc(s).type!==nn){let M=Vr(T,h,l,s);if(qs(T,M),_==="out-in"&&y.type!==nn)return l.isLeaving=!0,M.afterLeave=()=>{l.isLeaving=!1,s.job.flags&8||s.update(),delete M.afterLeave,T=void 0},Pr(f);_==="in-out"&&y.type!==nn?M.delayLeave=(U,V,K)=>{const F=gc(l,T);F[String(T.key)]=T,U[Zn]=()=>{V(),U[Zn]=void 0,delete C.delayedLeave,T=void 0},C.delayedLeave=()=>{K(),delete C.delayedLeave,T=void 0}}:T=void 0}else T&&(T=void 0);return f}}};function mc(t){let i=t[0];if(t.length>1){for(const s of t)if(s.type!==nn){i=s;break}}return i}const hf=ff;function gc(t,i){const{leavingVNodes:s}=t;let l=s.get(i.type);return l||(l=Object.create(null),s.set(i.type,l)),l}function Vr(t,i,s,l,u){const{appear:f,mode:h,persisted:_=!1,onBeforeEnter:y,onEnter:C,onAfterEnter:T,onEnterCancelled:M,onBeforeLeave:U,onLeave:V,onAfterLeave:K,onLeaveCancelled:F,onBeforeAppear:me,onAppear:he,onAfterAppear:Y,onAppearCancelled:Le}=i,ce=String(t.key),Be=gc(s,t),Ne=(we,le)=>{we&&Wn(we,l,9,le)},ze=(we,le)=>{const Me=le[1];Ne(we,le),De(we)?we.every(ie=>ie.length<=1)&&Me():we.length<=1&&Me()},We={mode:h,persisted:_,beforeEnter(we){let le=y;if(!s.isMounted)if(f)le=me||y;else return;we[Zn]&&we[Zn](!0);const Me=Be[ce];Me&&Co(t,Me)&&Me.el[Zn]&&Me.el[Zn](),Ne(le,[we])},enter(we){if(Be[ce]===t)return;let le=C,Me=T,ie=M;if(!s.isMounted)if(f)le=he||C,Me=Y||T,ie=Le||M;else return;let Ke=!1;we[Os]=qe=>{Ke||(Ke=!0,qe?Ne(ie,[we]):Ne(Me,[we]),We.delayedLeave&&We.delayedLeave(),we[Os]=void 0)};const re=we[Os].bind(null,!1);le?ze(le,[we,re]):re()},leave(we,le){const Me=String(t.key);if(we[Os]&&we[Os](!0),s.isUnmounting)return le();Ne(U,[we]);let ie=!1;we[Zn]=re=>{ie||(ie=!0,le(),re?Ne(F,[we]):Ne(K,[we]),we[Zn]=void 0,Be[Me]===t&&delete Be[Me])};const Ke=we[Zn].bind(null,!1);Be[Me]=t,V?ze(V,[we,Ke]):Ke()},clone(we){const le=Vr(we,i,s,l,u);return u&&u(le),le}};return We}function Pr(t){if(Xa(t))return t=Xi(t),t.children=null,t}function $l(t){if(!Xa(t))return fc(t.type)&&t.children?mc(t.children):t;if(t.component)return t.component.subTree;const{shapeFlag:i,children:s}=t;if(s){if(i&16)return s[0];if(i&32&&Ge(s.default))return s.default()}}function qs(t,i){t.shapeFlag&6&&t.component?(t.transition=i,qs(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 vc(t,i=!1,s){let l=[],u=0;for(let f=0;f1)for(let f=0;fZs(F,i&&(De(i)?i[me]:i),s,l,u));return}if(is(l)&&!u){l.shapeFlag&512&&l.type.__asyncResolved&&l.component.subTree.component&&Zs(t,i,s,l.component.subTree);return}const f=l.shapeFlag&4?nr(l.component):l.el,h=u?null:f,{i:_,r:y}=t,C=i&&i.r,T=_.refs===wt?_.refs={}:_.refs,M=_.setupState,U=pt(M),V=M===wt?Ou:F=>Nl(T,F)?!1:vt(U,F),K=(F,me)=>!(me&&Nl(T,me));if(C!=null&&C!==y){if(Dl(i),Ct(C))T[C]=null,V(C)&&(M[C]=null);else if(sn(C)){const F=i;K(C,F.k)&&(C.value=null),F.k&&(T[F.k]=null)}}if(Ge(y)){fi();try{ta(y,_,12,[h,T])}finally{hi()}}else{const F=Ct(y),me=sn(y);if(F||me){const he=()=>{if(t.f){const Y=F?V(y)?M[y]:T[y]:K()||!t.k?y.value:T[t.k];if(u)De(Y)&&Qr(Y,f);else if(De(Y))Y.includes(f)||Y.push(f);else if(F)T[y]=[f],V(y)&&(M[y]=T[y]);else{const Le=[f];K(y,t.k)&&(y.value=Le),t.k&&(T[t.k]=Le)}}else F?(T[y]=h,V(y)&&(M[y]=h)):me&&(K(y,t.k)&&(y.value=h),t.k&&(T[t.k]=h))};if(h){const Y=()=>{he(),Na.delete(t)};Y.id=-1,Na.set(t,Y),dn(Y,s)}else Dl(t),he()}}}function Dl(t){const i=Na.get(t);i&&(i.flags|=8,Na.delete(t))}qa().requestIdleCallback;qa().cancelIdleCallback;const is=t=>!!t.type.__asyncLoader,Xa=t=>t.type.__isKeepAlive;function pf(t,i){bc(t,"a",i)}function mf(t,i){bc(t,"da",i)}function bc(t,i,s=hn){const l=t.__wdc||(t.__wdc=()=>{let u=s;for(;u;){if(u.isDeactivated)return;u=u.parent}return t()});if(Qa(i,l,s),s){let u=s.parent;for(;u&&u.parent;)Xa(u.parent.vnode)&&gf(l,i,s,u),u=u.parent}}function gf(t,i,s,l){const u=Qa(i,t,l,!0);yc(()=>{Qr(l[i],u)},s)}function Qa(t,i,s=hn,l=!1){if(s){const u=s[t]||(s[t]=[]),f=i.__weh||(i.__weh=(...h)=>{fi();const _=na(s),y=Wn(i,s,t,h);return _(),hi(),y});return l?u.unshift(f):u.push(f),f}}const Oi=t=>(i,s=hn)=>{(!Xs||t==="sp")&&Qa(t,(...l)=>i(...l),s)},vf=Oi("bm"),Ei=Oi("m"),_f=Oi("bu"),bf=Oi("u"),us=Oi("bum"),yc=Oi("um"),yf=Oi("sp"),xf=Oi("rtg"),wf=Oi("rtc");function kf(t,i=hn){Qa("ec",t,i)}const Sf=Symbol.for("v-ndc");function Fe(t,i,s,l){let u;const f=s,h=De(t);if(h||Ct(t)){const _=h&&Ao(t);let y=!1,C=!1;_&&(y=!Hn(t),C=Mi(t),t=Ya(t)),u=new Array(t.length);for(let T=0,M=t.length;Ti(_,y,void 0,f));else{const _=Object.keys(t);u=new Array(_.length);for(let y=0,C=_.length;y0;return p(),at(oe,null,[A("slot",s,l)],C?-2:64)}let f=t[i];f&&f._c&&(f._d=!1),p();const h=f&&xc(f(s)),_=s.key||h&&h.key,y=at(oe,{key:(_&&!ti(_)?_:`_${i}`)+(!h&&l?"_fb":"")},h||[],h&&t._===1?64:-2);return y.scopeId&&(y.slotScopeIds=[y.scopeId+"-s"]),f&&f._c&&(f._d=!0),y}function xc(t){return t.some(i=>Js(i)?!(i.type===nn||i.type===oe&&!xc(i.children)):!0)?t:null}const Zr=t=>t?Uc(t)?nr(t):Zr(t.parent):null,Hs=Ht(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=>Zr(t.parent),$root:t=>Zr(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>kc(t),$forceUpdate:t=>t.f||(t.f=()=>{ul(t.update)}),$nextTick:t=>t.n||(t.n=ic.bind(t.proxy)),$watch:t=>af.bind(t)}),Cr=(t,i)=>t!==wt&&!t.__isScriptSetup&&vt(t,i),Pf={get({_:t},i){if(i==="__v_skip")return!0;const{ctx:s,setupState:l,data:u,props:f,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 s[i];case 3:return f[i]}else{if(Cr(l,i))return h[i]=1,l[i];if(u!==wt&&vt(u,i))return h[i]=2,u[i];if(vt(f,i))return h[i]=3,f[i];if(s!==wt&&vt(s,i))return h[i]=4,s[i];Hr&&(h[i]=0)}}const C=Hs[i];let T,M;if(C)return i==="$attrs"&&tn(t.attrs,"get",""),C(t);if((T=_.__cssModules)&&(T=T[i]))return T;if(s!==wt&&vt(s,i))return h[i]=4,s[i];if(M=y.config.globalProperties,vt(M,i))return M[i]},set({_:t},i,s){const{data:l,setupState:u,ctx:f}=t;return Cr(u,i)?(u[i]=s,!0):l!==wt&&vt(l,i)?(l[i]=s,!0):vt(t.props,i)||i[0]==="$"&&i.slice(1)in t?!1:(f[i]=s,!0)},has({_:{data:t,setupState:i,accessCache:s,ctx:l,appContext:u,props:f,type:h}},_){let y;return!!(s[_]||t!==wt&&_[0]!=="$"&&vt(t,_)||Cr(i,_)||vt(f,_)||vt(l,_)||vt(Hs,_)||vt(u.config.globalProperties,_)||(y=h.__cssModules)&&y[_])},defineProperty(t,i,s){return s.get!=null?t._.accessCache[i]=0:vt(s,"value")&&this.set(t,i,s.value,null),Reflect.defineProperty(t,i,s)}};function Fl(t){return De(t)?t.reduce((i,s)=>(i[s]=null,i),{}):t}let Hr=!0;function Cf(t){const i=kc(t),s=t.proxy,l=t.ctx;Hr=!1,i.beforeCreate&&Rl(i.beforeCreate,t,"bc");const{data:u,computed:f,methods:h,watch:_,provide:y,inject:C,created:T,beforeMount:M,mounted:U,beforeUpdate:V,updated:K,activated:F,deactivated:me,beforeDestroy:he,beforeUnmount:Y,destroyed:Le,unmounted:ce,render:Be,renderTracked:Ne,renderTriggered:ze,errorCaptured:We,serverPrefetch:we,expose:le,inheritAttrs:Me,components:ie,directives:Ke,filters:re}=i;if(C&&Lf(C,l,null),h)for(const de in h){const ae=h[de];Ge(ae)&&(l[de]=ae.bind(s))}if(u){const de=u.call(s,s);_t(de)&&(t.data=xt(de))}if(Hr=!0,f)for(const de in f){const ae=f[de],Lt=Ge(ae)?ae.bind(s,s):Ge(ae.get)?ae.get.bind(s,s):di,pe=!Ge(ae)&&Ge(ae.set)?ae.set.bind(s):di,Ue=ue({get:Lt,set:pe});Object.defineProperty(l,de,{enumerable:!0,configurable:!0,get:()=>Ue.value,set:Ve=>Ue.value=Ve})}if(_)for(const de in _)wc(_[de],l,s,de);if(y){const de=Ge(y)?y.call(s):y;Reflect.ownKeys(de).forEach(ae=>{lc(ae,de[ae])})}T&&Rl(T,t,"c");function fe(de,ae){De(ae)?ae.forEach(Lt=>de(Lt.bind(s))):ae&&de(ae.bind(s))}if(fe(vf,M),fe(Ei,U),fe(_f,V),fe(bf,K),fe(pf,F),fe(mf,me),fe(kf,We),fe(wf,Ne),fe(xf,ze),fe(us,Y),fe(yc,ce),fe(yf,we),De(le))if(le.length){const de=t.exposed||(t.exposed={});le.forEach(ae=>{Object.defineProperty(de,ae,{get:()=>s[ae],set:Lt=>s[ae]=Lt,enumerable:!0})})}else t.exposed||(t.exposed={});Be&&t.render===di&&(t.render=Be),Me!=null&&(t.inheritAttrs=Me),ie&&(t.components=ie),Ke&&(t.directives=Ke),we&&_c(t)}function Lf(t,i,s=di){De(t)&&(t=jr(t));for(const l in t){const u=t[l];let f;_t(u)?"default"in u?f=Vs(u.from||l,u.default,!0):f=Vs(u.from||l):f=Vs(u),sn(f)?Object.defineProperty(i,l,{enumerable:!0,configurable:!0,get:()=>f.value,set:h=>f.value=h}):i[l]=f}}function Rl(t,i,s){Wn(De(t)?t.map(l=>l.bind(i.proxy)):t.bind(i.proxy),i,s)}function wc(t,i,s,l){let u=l.includes(".")?cc(s,l):()=>s[l];if(Ct(t)){const f=i[t];Ge(f)&&Rt(u,f)}else if(Ge(t))Rt(u,t.bind(s));else if(_t(t))if(De(t))t.forEach(f=>wc(f,i,s,l));else{const f=Ge(t.handler)?t.handler.bind(s):i[t.handler];Ge(f)&&Rt(u,f,t)}}function kc(t){const i=t.type,{mixins:s,extends:l}=i,{mixins:u,optionsCache:f,config:{optionMergeStrategies:h}}=t.appContext,_=f.get(i);let y;return _?y=_:!u.length&&!s&&!l?y=i:(y={},u.length&&u.forEach(C=>Da(y,C,h,!0)),Da(y,i,h)),_t(i)&&f.set(i,y),y}function Da(t,i,s,l=!1){const{mixins:u,extends:f}=i;f&&Da(t,f,s,!0),u&&u.forEach(h=>Da(t,h,s,!0));for(const h in i)if(!(l&&h==="expose")){const _=Af[h]||s&&s[h];t[h]=_?_(t[h],i[h]):i[h]}return t}const Af={data:Bl,props:Ul,emits:Ul,methods:Ns,computed:Ns,beforeCreate:cn,created:cn,beforeMount:cn,mounted:cn,beforeUpdate:cn,updated:cn,beforeDestroy:cn,beforeUnmount:cn,destroyed:cn,unmounted:cn,activated:cn,deactivated:cn,errorCaptured:cn,serverPrefetch:cn,components:Ns,directives:Ns,watch:Ef,provide:Bl,inject:Mf};function Bl(t,i){return i?t?function(){return Ht(Ge(t)?t.call(this,this):t,Ge(i)?i.call(this,this):i)}:i:t}function Mf(t,i){return Ns(jr(t),jr(i))}function jr(t){if(De(t)){const i={};for(let s=0;si==="modelValue"||i==="model-value"?t.modelModifiers:t[`${i}Modifiers`]||t[`${Qn(i)}Modifiers`]||t[`${eo(i)}Modifiers`];function $f(t,i,...s){if(t.isUnmounted)return;const l=t.vnode.props||wt;let u=s;const f=i.startsWith("update:"),h=f&&If(l,i.slice(7));h&&(h.trim&&(u=s.map(T=>Ct(T)?T.trim():T)),h.number&&(u=s.map(Ga)));let _,y=l[_=xr(i)]||l[_=xr(Qn(i))];!y&&f&&(y=l[_=xr(eo(i))]),y&&Wn(y,t,6,u);const C=l[_+"Once"];if(C){if(!t.emitted)t.emitted={};else if(t.emitted[_])return;t.emitted[_]=!0,Wn(C,t,6,u)}}const Nf=new WeakMap;function Tc(t,i,s=!1){const l=s?Nf:i.emitsCache,u=l.get(t);if(u!==void 0)return u;const f=t.emits;let h={},_=!1;if(!Ge(t)){const y=C=>{const T=Tc(C,i,!0);T&&(_=!0,Ht(h,T))};!s&&i.mixins.length&&i.mixins.forEach(y),t.extends&&y(t.extends),t.mixins&&t.mixins.forEach(y)}return!f&&!_?(_t(t)&&l.set(t,null),null):(De(f)?f.forEach(y=>h[y]=null):Ht(h,f),_t(t)&&l.set(t,h),h)}function er(t,i){return!t||!ja(i)?!1:(i=i.slice(2),i=i==="Once"?i:i.replace(/Once$/,""),vt(t,i[0].toLowerCase()+i.slice(1))||vt(t,eo(i))||vt(t,i))}function Vl(t){const{type:i,vnode:s,proxy:l,withProxy:u,propsOptions:[f],slots:h,attrs:_,emit:y,render:C,renderCache:T,props:M,data:U,setupState:V,ctx:K,inheritAttrs:F}=t,me=$a(t);let he,Y;try{if(s.shapeFlag&4){const ce=u||l,Be=ce;he=ui(C.call(Be,ce,T,M,V,U,K)),Y=_}else{const ce=i;he=ui(ce.length>1?ce(M,{attrs:_,slots:h,emit:y}):ce(M,null)),Y=i.props?_:Df(_)}}catch(ce){js.length=0,Ja(ce,t,1),he=A(nn)}let Le=he;if(Y&&F!==!1){const ce=Object.keys(Y),{shapeFlag:Be}=Le;ce.length&&Be&7&&(f&&ce.some(Wa)&&(Y=Ff(Y,f)),Le=Xi(Le,Y,!1,!0))}return s.dirs&&(Le=Xi(Le,null,!1,!0),Le.dirs=Le.dirs?Le.dirs.concat(s.dirs):s.dirs),s.transition&&qs(Le,s.transition),he=Le,$a(me),he}const Df=t=>{let i;for(const s in t)(s==="class"||s==="style"||ja(s))&&((i||(i={}))[s]=t[s]);return i},Ff=(t,i)=>{const s={};for(const l in t)(!Wa(l)||!(l.slice(9)in i))&&(s[l]=t[l]);return s};function Rf(t,i,s){const{props:l,children:u,component:f}=t,{props:h,children:_,patchFlag:y}=i,C=f.emitsOptions;if(i.dirs||i.transition)return!0;if(s&&y>=0){if(y&1024)return!0;if(y&16)return l?Zl(l,h,C):!!h;if(y&8){const T=i.dynamicProps;for(let M=0;MObject.create(Cc),Ac=t=>Object.getPrototypeOf(t)===Cc;function Uf(t,i,s,l=!1){const u={},f=Lc();t.propsDefaults=Object.create(null),Mc(t,i,u,f);for(const h in t.propsOptions[0])h in u||(u[h]=void 0);s?t.props=l?u:jd(u):t.type.props?t.props=u:t.props=f,t.attrs=f}function Vf(t,i,s,l){const{props:u,attrs:f,vnode:{patchFlag:h}}=t,_=pt(u),[y]=t.propsOptions;let C=!1;if((l||h>0)&&!(h&16)){if(h&8){const T=t.vnode.dynamicProps;for(let M=0;M{y=!0;const[U,V]=Ec(M,i,!0);Ht(h,U),V&&_.push(...V)};!s&&i.mixins.length&&i.mixins.forEach(T),t.extends&&T(t.extends),t.mixins&&t.mixins.forEach(T)}if(!f&&!y)return _t(t)&&l.set(t,es),es;if(De(f))for(let T=0;Tt==="_"||t==="_ctx"||t==="$stable",dl=t=>De(t)?t.map(ui):[ui(t)],Hf=(t,i,s)=>{if(i._n)return i;const l=xe((...u)=>dl(i(...u)),s);return l._c=!1,l},Oc=(t,i,s)=>{const l=t._ctx;for(const u in t){if(cl(u))continue;const f=t[u];if(Ge(f))i[u]=Hf(u,f,l);else if(f!=null){const h=dl(f);i[u]=()=>h}}},zc=(t,i)=>{const s=dl(i);t.slots.default=()=>s},Ic=(t,i,s)=>{for(const l in i)(s||!cl(l))&&(t[l]=i[l])},jf=(t,i,s)=>{const l=t.slots=Lc();if(t.vnode.shapeFlag&32){const u=i._;u?(Ic(l,i,s),s&&Du(l,"_",u,!0)):Oc(i,l)}else i&&zc(t,i)},Wf=(t,i,s)=>{const{vnode:l,slots:u}=t;let f=!0,h=wt;if(l.shapeFlag&32){const _=i._;_?s&&_===1?f=!1:Ic(u,i,s):(f=!i.$stable,Oc(i,u)),h=i}else i&&(zc(t,i),h={default:1});if(f)for(const _ in u)!cl(_)&&h[_]==null&&delete u[_]},dn=Jf;function Kf(t){return Gf(t)}function Gf(t,i){const s=qa();s.__VUE__=!0;const{insert:l,remove:u,patchProp:f,createElement:h,createText:_,createComment:y,setText:C,setElementText:T,parentNode:M,nextSibling:U,setScopeId:V=di,insertStaticContent:K}=t,F=(x,b,S,B=null,R=null,Z=null,se=void 0,ne=null,ee=!!b.dynamicChildren)=>{if(x===b)return;x&&!Co(x,b)&&(B=E(x),Ve(x,R,Z,!0),x=null),b.patchFlag===-2&&(ee=!1,b.dynamicChildren=null);const{type:q,ref:ge,shapeFlag:te}=b;switch(q){case tr:me(x,b,S,B);break;case nn:he(x,b,S,B);break;case Ar:x==null&&Y(b,S,B,se);break;case oe:ie(x,b,S,B,R,Z,se,ne,ee);break;default:te&1?Be(x,b,S,B,R,Z,se,ne,ee):te&6?Ke(x,b,S,B,R,Z,se,ne,ee):(te&64||te&128)&&q.process(x,b,S,B,R,Z,se,ne,ee,dt)}ge!=null&&R?Zs(ge,x&&x.ref,Z,b||x,!b):ge==null&&x&&x.ref!=null&&Zs(x.ref,null,Z,x,!0)},me=(x,b,S,B)=>{if(x==null)l(b.el=_(b.children),S,B);else{const R=b.el=x.el;b.children!==x.children&&C(R,b.children)}},he=(x,b,S,B)=>{x==null?l(b.el=y(b.children||""),S,B):b.el=x.el},Y=(x,b,S,B)=>{[x.el,x.anchor]=K(x.children,b,S,B,x.el,x.anchor)},Le=({el:x,anchor:b},S,B)=>{let R;for(;x&&x!==b;)R=U(x),l(x,S,B),x=R;l(b,S,B)},ce=({el:x,anchor:b})=>{let S;for(;x&&x!==b;)S=U(x),u(x),x=S;u(b)},Be=(x,b,S,B,R,Z,se,ne,ee)=>{if(b.type==="svg"?se="svg":b.type==="math"&&(se="mathml"),x==null)Ne(b,S,B,R,Z,se,ne,ee);else{const q=x.el&&x.el._isVueCE?x.el:null;try{q&&q._beginPatch(),we(x,b,R,Z,se,ne,ee)}finally{q&&q._endPatch()}}},Ne=(x,b,S,B,R,Z,se,ne)=>{let ee,q;const{props:ge,shapeFlag:te,transition:Se,dirs:Te}=x;if(ee=x.el=h(x.type,Z,ge&&ge.is,ge),te&8?T(ee,x.children):te&16&&We(x.children,ee,null,B,R,Lr(x,Z),se,ne),Te&&xo(x,null,B,"created"),ze(ee,x,x.scopeId,se,B),ge){for(const Ye in ge)Ye!=="value"&&!Rs(Ye)&&f(ee,Ye,null,ge[Ye],Z,B);"value"in ge&&f(ee,"value",null,ge.value,Z),(q=ge.onVnodeBeforeMount)&&ai(q,B,x)}Te&&xo(x,null,B,"beforeMount");const Ze=qf(R,Se);Ze&&Se.beforeEnter(ee),l(ee,b,S),((q=ge&&ge.onVnodeMounted)||Ze||Te)&&dn(()=>{try{q&&ai(q,B,x),Ze&&Se.enter(ee),Te&&xo(x,null,B,"mounted")}finally{}},R)},ze=(x,b,S,B,R)=>{if(S&&V(x,S),B)for(let Z=0;Z{for(let q=ee;q{const ne=b.el=x.el;let{patchFlag:ee,dynamicChildren:q,dirs:ge}=b;ee|=x.patchFlag&16;const te=x.props||wt,Se=b.props||wt;let Te;if(S&&wo(S,!1),(Te=Se.onVnodeBeforeUpdate)&&ai(Te,S,b,x),ge&&xo(b,x,S,"beforeUpdate"),S&&wo(S,!0),q&&(!x.dynamicChildren||x.dynamicChildren.length!==q.length)&&(ee=0,se=!1,q=null),(te.innerHTML&&Se.innerHTML==null||te.textContent&&Se.textContent==null)&&T(ne,""),q?le(x.dynamicChildren,q,ne,S,B,Lr(b,R),Z):se||ae(x,b,ne,null,S,B,Lr(b,R),Z,!1),ee>0){if(ee&16)Me(ne,te,Se,S,R);else if(ee&2&&te.class!==Se.class&&f(ne,"class",null,Se.class,R),ee&4&&f(ne,"style",te.style,Se.style,R),ee&8){const Ze=b.dynamicProps;for(let Ye=0;Ye{Te&&ai(Te,S,b,x),ge&&xo(b,x,S,"updated")},B)},le=(x,b,S,B,R,Z,se)=>{for(let ne=0;ne{if(b!==S){if(b!==wt)for(const Z in b)!Rs(Z)&&!(Z in S)&&f(x,Z,b[Z],null,R,B);for(const Z in S){if(Rs(Z))continue;const se=S[Z],ne=b[Z];se!==ne&&Z!=="value"&&f(x,Z,ne,se,R,B)}"value"in S&&f(x,"value",b.value,S.value,R)}},ie=(x,b,S,B,R,Z,se,ne,ee)=>{const q=b.el=x?x.el:_(""),ge=b.anchor=x?x.anchor:_("");let{patchFlag:te,dynamicChildren:Se,slotScopeIds:Te}=b;Te&&(ne=ne?ne.concat(Te):Te),x==null?(l(q,S,B),l(ge,S,B),We(b.children||[],S,ge,R,Z,se,ne,ee)):te>0&&te&64&&Se&&x.dynamicChildren&&x.dynamicChildren.length===Se.length?(le(x.dynamicChildren,Se,S,R,Z,se,ne),(b.key!=null||R&&b===R.subTree)&&fl(x,b,!0)):ae(x,b,S,ge,R,Z,se,ne,ee)},Ke=(x,b,S,B,R,Z,se,ne,ee)=>{b.slotScopeIds=ne,x==null?b.shapeFlag&512?R.ctx.activate(b,S,B,se,ee):re(b,S,B,R,Z,se,ee):qe(x,b,ee)},re=(x,b,S,B,R,Z,se)=>{const ne=x.component=oh(x,B,R);if(Xa(x)&&(ne.ctx.renderer=dt),sh(ne,!1,se),ne.asyncDep){if(R&&R.registerDep(ne,fe,se),!x.el){const ee=ne.subTree=A(nn);he(null,ee,b,S),x.placeholder=ee.el}}else fe(ne,x,b,S,R,Z,se)},qe=(x,b,S)=>{const B=b.component=x.component;if(Rf(x,b,S))if(B.asyncDep&&!B.asyncResolved){de(B,b,S);return}else B.next=b,B.update();else b.el=x.el,B.vnode=b},fe=(x,b,S,B,R,Z,se)=>{const ne=()=>{if(x.isMounted){let{next:te,bu:Se,u:Te,parent:Ze,vnode:Ye}=x;{const Kt=$c(x);if(Kt){te&&(te.el=Ye.el,de(x,te,se)),Kt.asyncDep.then(()=>{dn(()=>{x.isUnmounted||q()},R)});return}}let st=te,ft;wo(x,!1),te?(te.el=Ye.el,de(x,te,se)):te=Ye,Se&&Ea(Se),(ft=te.props&&te.props.onVnodeBeforeUpdate)&&ai(ft,Ze,te,Ye),wo(x,!0);const Tt=Vl(x),Bt=x.subTree;x.subTree=Tt,F(Bt,Tt,M(Bt.el),E(Bt),x,R,Z),te.el=Tt.el,st===null&&Bf(x,Tt.el),Te&&dn(Te,R),(ft=te.props&&te.props.onVnodeUpdated)&&dn(()=>ai(ft,Ze,te,Ye),R)}else{let te;const{el:Se,props:Te}=b,{bm:Ze,m:Ye,parent:st,root:ft,type:Tt}=x,Bt=is(b);wo(x,!1),Ze&&Ea(Ze),!Bt&&(te=Te&&Te.onVnodeBeforeMount)&&ai(te,st,b),wo(x,!0);{ft.ce&&ft.ce._hasShadowRoot()&&ft.ce._injectChildStyle(Tt,x.parent?x.parent.type:void 0);const Kt=x.subTree=Vl(x);F(null,Kt,S,B,x,R,Z),b.el=Kt.el}if(Ye&&dn(Ye,R),!Bt&&(te=Te&&Te.onVnodeMounted)){const Kt=b;dn(()=>ai(te,st,Kt),R)}(b.shapeFlag&256||st&&is(st.vnode)&&st.vnode.shapeFlag&256)&&x.a&&dn(x.a,R),x.isMounted=!0,b=S=B=null}};x.scope.on();const ee=x.effect=new Uu(ne);x.scope.off();const q=x.update=ee.run.bind(ee),ge=x.job=ee.runIfDirty.bind(ee);ge.i=x,ge.id=x.uid,ee.scheduler=()=>ul(ge),wo(x,!0),q()},de=(x,b,S)=>{b.component=x;const B=x.vnode.props;x.vnode=b,x.next=null,Vf(x,b.props,B,S),Wf(x,b.children,S),fi(),Ol(x),hi()},ae=(x,b,S,B,R,Z,se,ne,ee=!1)=>{const q=x&&x.children,ge=x?x.shapeFlag:0,te=b.children,{patchFlag:Se,shapeFlag:Te}=b;if(Se>0){if(Se&128){pe(q,te,S,B,R,Z,se,ne,ee);return}else if(Se&256){Lt(q,te,S,B,R,Z,se,ne,ee);return}}Te&8?(ge&16&&J(q,R,Z),te!==q&&T(S,te)):ge&16?Te&16?pe(q,te,S,B,R,Z,se,ne,ee):J(q,R,Z,!0):(ge&8&&T(S,""),Te&16&&We(te,S,B,R,Z,se,ne,ee))},Lt=(x,b,S,B,R,Z,se,ne,ee)=>{x=x||es,b=b||es;const q=x.length,ge=b.length,te=Math.min(q,ge);let Se;for(Se=0;Sege?J(x,R,Z,!0,!1,te):We(b,S,B,R,Z,se,ne,ee,te)},pe=(x,b,S,B,R,Z,se,ne,ee)=>{let q=0;const ge=b.length;let te=x.length-1,Se=ge-1;for(;q<=te&&q<=Se;){const Te=x[q],Ze=b[q]=ee?Pi(b[q]):ui(b[q]);if(Co(Te,Ze))F(Te,Ze,S,null,R,Z,se,ne,ee);else break;q++}for(;q<=te&&q<=Se;){const Te=x[te],Ze=b[Se]=ee?Pi(b[Se]):ui(b[Se]);if(Co(Te,Ze))F(Te,Ze,S,null,R,Z,se,ne,ee);else break;te--,Se--}if(q>te){if(q<=Se){const Te=Se+1,Ze=TeSe)for(;q<=te;)Ve(x[q],R,Z,!0),q++;else{const Te=q,Ze=q,Ye=new Map;for(q=Ze;q<=Se;q++){const Pt=b[q]=ee?Pi(b[q]):ui(b[q]);Pt.key!=null&&Ye.set(Pt.key,q)}let st,ft=0;const Tt=Se-Ze+1;let Bt=!1,Kt=0;const Nt=new Array(Tt);for(q=0;q=Tt){Ve(Pt,R,Z,!0);continue}let Gt;if(Pt.key!=null)Gt=Ye.get(Pt.key);else for(st=Ze;st<=Se;st++)if(Nt[st-Ze]===0&&Co(Pt,b[st])){Gt=st;break}Gt===void 0?Ve(Pt,R,Z,!0):(Nt[Gt-Ze]=q+1,Gt>=Kt?Kt=Gt:Bt=!0,F(Pt,b[Gt],S,null,R,Z,se,ne,ee),ft++)}const pn=Bt?Yf(Nt):es;for(st=pn.length-1,q=Tt-1;q>=0;q--){const Pt=Ze+q,Gt=b[Pt],zn=b[Pt+1],zi=Pt+1{const{el:Z,type:se,transition:ne,children:ee,shapeFlag:q}=x;if(q&6){Ue(x.component.subTree,b,S,B);return}if(q&128){x.suspense.move(b,S,B);return}if(q&64){se.move(x,b,S,dt);return}if(se===oe){l(Z,b,S);for(let te=0;tene.enter(Z),R));else{const{leave:te,delayLeave:Se,afterLeave:Te}=ne,Ze=()=>{x.ctx.isUnmounted?u(Z):l(Z,b,S)},Ye=()=>{const st=Z._isLeaving||!!Z[Zn];Z._isLeaving&&Z[Zn](!0),ne.persisted&&!st?Ze():te(Z,()=>{Ze(),Te&&Te()})};Se?Se(Z,Ze,Ye):Ye()}else l(Z,b,S)},Ve=(x,b,S,B=!1,R=!1)=>{const{type:Z,props:se,ref:ne,children:ee,dynamicChildren:q,shapeFlag:ge,patchFlag:te,dirs:Se,cacheIndex:Te,memo:Ze}=x;if(te===-2&&(R=!1),ne!=null&&(fi(),Zs(ne,null,S,x,!0),hi()),Te!=null&&(b.renderCache[Te]=void 0),ge&256){b.ctx.deactivate(x);return}const Ye=ge&1&&Se,st=!is(x);let ft;if(st&&(ft=se&&se.onVnodeBeforeUnmount)&&ai(ft,b,x),ge&6)Ce(x.component,S,B);else{if(ge&128){x.suspense.unmount(S,B);return}Ye&&xo(x,null,b,"beforeUnmount"),ge&64?x.type.remove(x,b,S,dt,B):q&&!q.hasOnce&&(Z!==oe||te>0&&te&64)?J(q,b,S,!1,!0):(Z===oe&&te&384||!R&&ge&16)&&J(ee,b,S),B&&mt(x)}const Tt=Ze!=null&&Te==null;(st&&(ft=se&&se.onVnodeUnmounted)||Ye||Tt)&&dn(()=>{ft&&ai(ft,b,x),Ye&&xo(x,null,b,"unmounted"),Tt&&(x.el=null)},S)},mt=x=>{const{type:b,el:S,anchor:B,transition:R}=x;if(b===oe){ot(S,B);return}if(b===Ar){ce(x);return}const Z=()=>{u(S),R&&!R.persisted&&R.afterLeave&&R.afterLeave()};if(x.shapeFlag&1&&R&&!R.persisted){const{leave:se,delayLeave:ne}=R,ee=()=>se(S,Z);ne?ne(x.el,Z,ee):ee()}else Z()},ot=(x,b)=>{let S;for(;x!==b;)S=U(x),u(x),x=S;u(b)},Ce=(x,b,S)=>{const{bum:B,scope:R,job:Z,subTree:se,um:ne,m:ee,a:q}=x;jl(ee),jl(q),B&&Ea(B),R.stop(),Z&&(Z.flags|=8,Ve(se,x,b,S)),ne&&dn(ne,b),dn(()=>{x.isUnmounted=!0},b)},J=(x,b,S,B=!1,R=!1,Z=0)=>{for(let se=Z;se{if(x.shapeFlag&6)return E(x.component.subTree);if(x.shapeFlag&128)return x.suspense.next();const b=U(x.anchor||x.el),S=b&&b[dc];return S?U(S):b};let I=!1;const gt=(x,b,S)=>{let B;x==null?b._vnode&&(Ve(b._vnode,null,null,!0),B=b._vnode.component):F(b._vnode||null,x,b,null,null,null,S),b._vnode=x,I||(I=!0,Ol(B),sc(),I=!1)},dt={p:F,um:Ve,m:Ue,r:mt,mt:re,mc:We,pc:ae,pbc:le,n:E,o:t};return{render:gt,hydrate:void 0,createApp:zf(gt)}}function Lr({type:t,props:i},s){return s==="svg"&&t==="foreignObject"||s==="mathml"&&t==="annotation-xml"&&i&&i.encoding&&i.encoding.includes("html")?void 0:s}function wo({effect:t,job:i},s){s?(t.flags|=32,i.flags|=4):(t.flags&=-33,i.flags&=-5)}function qf(t,i){return(!t||t&&!t.pendingBranch)&&i&&!i.persisted}function fl(t,i,s=!1){const l=t.children,u=i.children;if(De(l)&&De(u))for(let f=0;f>1,t[s[_]]0&&(i[l]=s[f-1]),s[f]=l)}}for(f=s.length,h=s[f-1];f-- >0;)s[f]=h,h=i[h];return s}function $c(t){const i=t.subTree.component;if(i)return i.asyncDep&&!i.asyncResolved?i:$c(i)}function jl(t){if(t)for(let i=0;it.__isSuspense;function Jf(t,i){i&&i.pendingBranch?De(t)?i.effects.push(...t):i.effects.push(t):nf(t)}const oe=Symbol.for("v-fgt"),tr=Symbol.for("v-txt"),nn=Symbol.for("v-cmt"),Ar=Symbol.for("v-stc"),js=[];let On=null;function p(t=!1){js.push(On=t?null:[])}function Xf(){js.pop(),On=js[js.length-1]||null}let Ys=1;function Fa(t,i=!1){Ys+=t,t<0&&On&&i&&(On.hasOnce=!0)}function Fc(t){return t.dynamicChildren=Ys>0?On||es:null,Xf(),Ys>0&&On&&On.push(t),t}function m(t,i,s,l,u,f){return Fc(a(t,i,s,l,u,f,!0))}function at(t,i,s,l,u){return Fc(A(t,i,s,l,u,!0))}function Js(t){return t?t.__v_isVNode===!0:!1}function Co(t,i){return t.type===i.type&&t.key===i.key}const Rc=({key:t})=>t??null,Oa=({ref:t,ref_key:i,ref_for:s})=>(typeof t=="number"&&(t=""+t),t!=null?Ct(t)||sn(t)||Ge(t)?{i:on,r:t,k:i,f:!!s}:t:null);function a(t,i=null,s=null,l=0,u=null,f=t===oe?0:1,h=!1,_=!1){const y={__v_isVNode:!0,__v_skip:!0,type:t,props:i,key:i&&Rc(i),ref:i&&Oa(i),scopeId:rc,slotScopeIds:null,children:s,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:f,patchFlag:l,dynamicProps:u,dynamicChildren:null,appContext:null,ctx:on};return _?(Ra(y,s),f&128&&t.normalize(y)):s&&(y.shapeFlag|=Ct(s)?8:16),Ys>0&&!h&&On&&(y.patchFlag>0||f&6)&&y.patchFlag!==32&&On.push(y),y}const A=Qf;function Qf(t,i=null,s=null,l=0,u=null,f=!1){if((!t||t===Sf)&&(t=nn),Js(t)){const _=Xi(t,i,!0);return s&&Ra(_,s),Ys>0&&!f&&On&&(_.shapeFlag&6?On[On.indexOf(t)]=_:On.push(_)),_.patchFlag=-2,_}if(uh(t)&&(t=t.__vccOpts),i){i=eh(i);let{class:_,style:y}=i;_&&!Ct(_)&&(i.class=Ae(_)),_t(y)&&(ll(y)&&!De(y)&&(y=Ht({},y)),i.style=Mo(y))}const h=Ct(t)?1:Dc(t)?128:fc(t)?64:_t(t)?4:Ge(t)?2:0;return a(t,i,s,l,u,h,f,!0)}function eh(t){return t?ll(t)||Ac(t)?Ht({},t):t:null}function Xi(t,i,s=!1,l=!1){const{props:u,ref:f,patchFlag:h,children:_,transition:y}=t,C=i?th(u||{},i):u,T={__v_isVNode:!0,__v_skip:!0,type:t.type,props:C,key:C&&Rc(C),ref:i&&i.ref?s&&f?De(f)?f.concat(Oa(i)):[f,Oa(i)]:Oa(i):f,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!==oe?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&&Xi(t.ssContent),ssFallback:t.ssFallback&&Xi(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return y&&l&&qs(T,y.clone(T)),T}function z(t=" ",i=0){return A(tr,null,t,i)}function $(t="",i=!1){return i?(p(),at(nn,null,t)):A(nn,null,t)}function ui(t){return t==null||typeof t=="boolean"?A(nn):De(t)?A(oe,null,t.slice()):Js(t)?Pi(t):A(tr,null,String(t))}function Pi(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:Xi(t)}function Ra(t,i){let s=0;const{shapeFlag:l}=t;if(i==null)i=null;else if(De(i))s=16;else if(typeof i=="object")if(l&65){const u=i.default;u&&(u._c&&(u._d=!1),Ra(t,u()),u._c&&(u._d=!0));return}else{s=32;const u=i._;!u&&!Ac(i)?i._ctx=on:u===3&&on&&(on.slots._===1?i._=1:(i._=2,t.patchFlag|=1024))}else if(Ge(i)){if(l&65){Ra(t,{default:i});return}i={default:i,_ctx:on},s=32}else i=String(i),l&64?(s=16,i=[z(i)]):s=8;t.children=i,t.shapeFlag|=s}function th(...t){const i={};for(let s=0;shn||on;let Ba,Kr;{const t=qa(),i=(s,l)=>{let u;return(u=t[s])||(u=t[s]=[]),u.push(l),f=>{u.length>1?u.forEach(h=>h(f)):u[0](f)}};Ba=i("__VUE_INSTANCE_SETTERS__",s=>hn=s),Kr=i("__VUE_SSR_SETTERS__",s=>Xs=s)}const na=t=>{const i=hn;return Ba(t),t.scope.on(),()=>{t.scope.off(),Ba(i)}},Wl=()=>{hn&&hn.scope.off(),Ba(null)};function Uc(t){return t.vnode.shapeFlag&4}let Xs=!1;function sh(t,i=!1,s=!1){i&&Kr(i);const{props:l,children:u}=t.vnode,f=Uc(t);Uf(t,l,f,i),jf(t,u,s||i);const h=f?ah(t,i):void 0;return i&&Kr(!1),h}function ah(t,i){const s=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,Pf);const{setup:l}=s;if(l){fi();const u=t.setupContext=l.length>1?lh(t):null,f=na(t),h=ta(l,t,0,[t.props,u]),_=zu(h);if(hi(),f(),(_||t.sp)&&!is(t)&&_c(t),_){if(h.then(Wl,Wl),i)return h.then(y=>{Kl(t,y)}).catch(y=>{Ja(y,t,0)});t.asyncDep=h}else Kl(t,h)}else Vc(t)}function Kl(t,i,s){Ge(i)?t.type.__ssrInlineRender?t.ssrRender=i:t.render=i:_t(i)&&(t.setupState=tc(i)),Vc(t)}function Vc(t,i,s){const l=t.type;t.render||(t.render=l.render||di);{const u=na(t);fi();try{Cf(t)}finally{hi(),u()}}}const rh={get(t,i){return tn(t,"get",""),t[i]}};function lh(t){const i=s=>{t.exposed=s||{}};return{attrs:new Proxy(t.attrs,rh),slots:t.slots,emit:t.emit,expose:i}}function nr(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(tc(Wd(t.exposed)),{get(i,s){if(s in i)return i[s];if(s in Hs)return Hs[s](t)},has(i,s){return s in i||s in Hs}})):t.proxy}function uh(t){return Ge(t)&&"__vccOpts"in t}const ue=(t,i)=>Jd(t,i,Xs);function ch(t,i,s){try{Fa(-1);const l=arguments.length;return l===2?_t(i)&&!De(i)?Js(i)?A(t,null,[i]):A(t,i):A(t,null,i):(l>3?s=Array.prototype.slice.call(arguments,2):l===3&&Js(s)&&(s=[s]),A(t,i,s))}finally{Fa(1)}}const dh="3.5.39";/** +* @vue/runtime-dom v3.5.39 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let Gr;const Gl=typeof window<"u"&&window.trustedTypes;if(Gl)try{Gr=Gl.createPolicy("vue",{createHTML:t=>t})}catch{}const Zc=Gr?t=>Gr.createHTML(t):t=>t,fh="http://www.w3.org/2000/svg",hh="http://www.w3.org/1998/Math/MathML",Ti=typeof document<"u"?document:null,ql=Ti&&Ti.createElement("template"),ph={insert:(t,i,s)=>{i.insertBefore(t,s||null)},remove:t=>{const i=t.parentNode;i&&i.removeChild(t)},createElement:(t,i,s,l)=>{const u=i==="svg"?Ti.createElementNS(fh,t):i==="mathml"?Ti.createElementNS(hh,t):s?Ti.createElement(t,{is:s}):Ti.createElement(t);return t==="select"&&l&&l.multiple!=null&&u.setAttribute("multiple",l.multiple),u},createText:t=>Ti.createTextNode(t),createComment:t=>Ti.createComment(t),setText:(t,i)=>{t.nodeValue=i},setElementText:(t,i)=>{t.textContent=i},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>Ti.querySelector(t),setScopeId(t,i){t.setAttribute(i,"")},insertStaticContent(t,i,s,l,u,f){const h=s?s.previousSibling:i.lastChild;if(u&&(u===f||u.nextSibling))for(;i.insertBefore(u.cloneNode(!0),s),!(u===f||!(u=u.nextSibling)););else{ql.innerHTML=Zc(l==="svg"?`${t}`:l==="mathml"?`${t}`:t);const _=ql.content;if(l==="svg"||l==="mathml"){const y=_.firstChild;for(;y.firstChild;)_.appendChild(y.firstChild);_.removeChild(y)}i.insertBefore(_,s)}return[h?h.nextSibling:i.firstChild,s?s.previousSibling:i.lastChild]}},Ki="transition",zs="animation",Qs=Symbol("_vtc"),Hc={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},mh=Ht({},hc,Hc),gh=t=>(t.displayName="Transition",t.props=mh,t),vh=gh((t,{slots:i})=>ch(hf,_h(t),i)),ko=(t,i=[])=>{De(t)?t.forEach(s=>s(...i)):t&&t(...i)},Yl=t=>t?De(t)?t.some(i=>i.length>1):t.length>1:!1;function _h(t){const i={};for(const ie in t)ie in Hc||(i[ie]=t[ie]);if(t.css===!1)return i;const{name:s="v",type:l,duration:u,enterFromClass:f=`${s}-enter-from`,enterActiveClass:h=`${s}-enter-active`,enterToClass:_=`${s}-enter-to`,appearFromClass:y=f,appearActiveClass:C=h,appearToClass:T=_,leaveFromClass:M=`${s}-leave-from`,leaveActiveClass:U=`${s}-leave-active`,leaveToClass:V=`${s}-leave-to`}=t,K=bh(u),F=K&&K[0],me=K&&K[1],{onBeforeEnter:he,onEnter:Y,onEnterCancelled:Le,onLeave:ce,onLeaveCancelled:Be,onBeforeAppear:Ne=he,onAppear:ze=Y,onAppearCancelled:We=Le}=i,we=(ie,Ke,re,qe)=>{ie._enterCancelled=qe,So(ie,Ke?T:_),So(ie,Ke?C:h),re&&re()},le=(ie,Ke)=>{ie._isLeaving=!1,So(ie,M),So(ie,V),So(ie,U),Ke&&Ke()},Me=ie=>(Ke,re)=>{const qe=ie?ze:Y,fe=()=>we(Ke,ie,re);ko(qe,[Ke,fe]),Jl(()=>{So(Ke,ie?y:f),Si(Ke,ie?T:_),Yl(qe)||Xl(Ke,l,F,fe)})};return Ht(i,{onBeforeEnter(ie){ko(he,[ie]),Si(ie,f),Si(ie,h)},onBeforeAppear(ie){ko(Ne,[ie]),Si(ie,y),Si(ie,C)},onEnter:Me(!1),onAppear:Me(!0),onLeave(ie,Ke){ie._isLeaving=!0;const re=()=>le(ie,Ke);Si(ie,M),ie._enterCancelled?(Si(ie,U),tu(ie)):(tu(ie),Si(ie,U)),Jl(()=>{ie._isLeaving&&(So(ie,M),Si(ie,V),Yl(ce)||Xl(ie,l,me,re))}),ko(ce,[ie,re])},onEnterCancelled(ie){we(ie,!1,void 0,!0),ko(Le,[ie])},onAppearCancelled(ie){we(ie,!0,void 0,!0),ko(We,[ie])},onLeaveCancelled(ie){le(ie),ko(Be,[ie])}})}function bh(t){if(t==null)return null;if(_t(t))return[Mr(t.enter),Mr(t.leave)];{const i=Mr(t);return[i,i]}}function Mr(t){return _d(t)}function Si(t,i){i.split(/\s+/).forEach(s=>s&&t.classList.add(s)),(t[Qs]||(t[Qs]=new Set)).add(i)}function So(t,i){i.split(/\s+/).forEach(l=>l&&t.classList.remove(l));const s=t[Qs];s&&(s.delete(i),s.size||(t[Qs]=void 0))}function Jl(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let yh=0;function Xl(t,i,s,l){const u=t._endId=++yh,f=()=>{u===t._endId&&l()};if(s!=null)return setTimeout(f,s);const{type:h,timeout:_,propCount:y}=xh(t,i);if(!h)return l();const C=h+"end";let T=0;const M=()=>{t.removeEventListener(C,U),f()},U=V=>{V.target===t&&++T>=y&&M()};setTimeout(()=>{T(s[K]||"").split(", "),u=l(`${Ki}Delay`),f=l(`${Ki}Duration`),h=Ql(u,f),_=l(`${zs}Delay`),y=l(`${zs}Duration`),C=Ql(_,y);let T=null,M=0,U=0;i===Ki?h>0&&(T=Ki,M=h,U=f.length):i===zs?C>0&&(T=zs,M=C,U=y.length):(M=Math.max(h,C),T=M>0?h>C?Ki:zs:null,U=T?T===Ki?f.length:y.length:0);const V=T===Ki&&/\b(?:transform|all)(?:,|$)/.test(l(`${Ki}Property`).toString());return{type:T,timeout:M,propCount:U,hasTransform:V}}function Ql(t,i){for(;t.lengtheu(s)+eu(t[l])))}function eu(t){return t==="auto"?0:Number(t.slice(0,-1).replace(",","."))*1e3}function tu(t){return(t?t.ownerDocument:document).body.offsetHeight}function wh(t,i,s){const l=t[Qs];l&&(i=(i?[i,...l]:[...l]).join(" ")),i==null?t.removeAttribute("class"):s?t.setAttribute("class",i):t.className=i}const Ua=Symbol("_vod"),jc=Symbol("_vsh"),kh={name:"show",beforeMount(t,{value:i},{transition:s}){t[Ua]=t.style.display==="none"?"":t.style.display,s&&i?s.beforeEnter(t):Is(t,i)},mounted(t,{value:i},{transition:s}){s&&i&&s.enter(t)},updated(t,{value:i,oldValue:s},{transition:l}){!i!=!s&&(l?i?(l.beforeEnter(t),Is(t,!0),l.enter(t)):l.leave(t,()=>{Is(t,!1)}):Is(t,i))},beforeUnmount(t,{value:i}){Is(t,i)}};function Is(t,i){t.style.display=i?t[Ua]:"none",t[jc]=!i}const Sh=Symbol(""),Th=/(?:^|;)\s*display\s*:/;function Ph(t,i,s){const l=t.style,u=Ct(s);let f=!1;if(s&&!u){if(i)if(Ct(i))for(const h of i.split(";")){const _=h.slice(0,h.indexOf(":")).trim();s[_]==null&&Ds(l,_,"")}else for(const h in i)s[h]==null&&Ds(l,h,"");for(const h in s){h==="display"&&(f=!0);const _=s[h];_!=null?Lh(t,h,!Ct(i)&&i?i[h]:void 0,_)||Ds(l,h,_):Ds(l,h,"")}}else if(u){if(i!==s){const h=l[Sh];h&&(s+=";"+h),l.cssText=s,f=Th.test(s)}}else i&&t.removeAttribute("style");Ua in t&&(t[Ua]=f?l.display:"",t[jc]&&(l.display="none"))}const nu=/\s*!important$/;function Ds(t,i,s){if(De(s))s.forEach(l=>Ds(t,i,l));else if(s==null&&(s=""),i.startsWith("--"))t.setProperty(i,s);else{const l=Ch(t,i);nu.test(s)?t.setProperty(eo(l),s.replace(nu,""),"important"):t[l]=s}}const iu=["Webkit","Moz","ms"],Er={};function Ch(t,i){const s=Er[i];if(s)return s;let l=Qn(i);if(l!=="filter"&&l in t)return Er[i]=l;l=Nu(l);for(let u=0;uOr||(Ih.then(()=>Or=0),Or=Date.now());function Nh(t,i){const s=l=>{if(!l._vts)l._vts=Date.now();else if(l._vts<=s.attached)return;const u=s.value;if(De(u)){const f=l.stopImmediatePropagation;l.stopImmediatePropagation=()=>{f.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,Dh=(t,i,s,l,u,f)=>{const h=u==="svg";i==="class"?wh(t,l,h):i==="style"?Ph(t,s,l):ja(i)?Wa(i)||Mh(t,i,s,l,f):(i[0]==="."?(i=i.slice(1),!0):i[0]==="^"?(i=i.slice(1),!1):Fh(t,i,l,h))?(au(t,i,l),!t.tagName.includes("-")&&(i==="value"||i==="checked"||i==="selected")&&su(t,i,l,h,f,i!=="value")):t._isVueCE&&(Rh(t,i)||t._def.__asyncLoader&&(/[A-Z]/.test(i)||!Ct(l)))?au(t,Qn(i),l,f,i):(i==="true-value"?t._trueValue=l:i==="false-value"&&(t._falseValue=l),su(t,i,l,h))};function Fh(t,i,s,l){if(l)return!!(i==="innerHTML"||i==="textContent"||i in t&&lu(i)&&Ge(s));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 lu(i)&&Ct(s)?!1:i in t}function Rh(t,i){const s=t._def.props;if(!s)return!1;const l=Qn(i);return Array.isArray(s)?s.some(u=>Qn(u)===l):Object.keys(s).some(u=>Qn(u)===l)}const Qi=t=>{const i=t.props["onUpdate:modelValue"]||!1;return De(i)?s=>Ea(i,s):i};function Bh(t){t.target.composing=!0}function uu(t){const i=t.target;i.composing&&(i.composing=!1,i.dispatchEvent(new Event("input")))}const jn=Symbol("_assign");function cu(t,i,s){return i&&(t=t.trim()),s&&(t=Ga(t)),t}const ye={created(t,{modifiers:{lazy:i,trim:s,number:l}},u){t[jn]=Qi(u);const f=l||u.props&&u.props.type==="number";Ai(t,i?"change":"input",h=>{h.target.composing||t[jn](cu(t.value,s,f))}),(s||f)&&Ai(t,"change",()=>{t.value=cu(t.value,s,f)}),i||(Ai(t,"compositionstart",Bh),Ai(t,"compositionend",uu),Ai(t,"change",uu))},mounted(t,{value:i}){t.value=i??""},beforeUpdate(t,{value:i,oldValue:s,modifiers:{lazy:l,trim:u,number:f}},h){if(t[jn]=Qi(h),t.composing)return;const _=(f||t.type==="number")&&!/^0\d/.test(t.value)?Ga(t.value):t.value,y=i??"";if(_===y)return;const C=t.getRootNode();(C instanceof Document||C instanceof ShadowRoot)&&C.activeElement===t&&t.type!=="range"&&(l&&i===s||u&&t.value.trim()===y)||(t.value=y)}},Va={deep:!0,created(t,i,s){t[jn]=Qi(s),Ai(t,"change",()=>{const l=t._modelValue,u=rs(t),f=t.checked,h=t[jn];if(De(l)){const _=tl(l,u),y=_!==-1;if(f&&!y)h(l.concat(u));else if(!f&&y){const C=[...l];C.splice(_,1),h(C)}}else if(ls(l)){const _=new Set(l);f?_.add(u):_.delete(u),h(_)}else h(Wc(t,f))})},mounted:du,beforeUpdate(t,i,s){t[jn]=Qi(s),du(t,i,s)}};function du(t,{value:i,oldValue:s},l){t._modelValue=i;let u;if(De(i))u=tl(i,l.props.value)>-1;else if(ls(i))u=i.has(l.props.value);else{if(i===s)return;u=Ji(i,Wc(t,!0))}t.checked!==u&&(t.checked=u)}const Uh={created(t,{value:i},s){t.checked=Ji(i,s.props.value),t[jn]=Qi(s),Ai(t,"change",()=>{t[jn](rs(t))})},beforeUpdate(t,{value:i,oldValue:s},l){t[jn]=Qi(l),i!==s&&(t.checked=Ji(i,l.props.value))}},zt={deep:!0,created(t,{value:i,modifiers:{number:s}},l){const u=ls(i);Ai(t,"change",()=>{const f=Array.prototype.filter.call(t.options,h=>h.selected).map(h=>s?Ga(rs(h)):rs(h));t[jn](t.multiple?u?new Set(f):f:f[0]),t._assigning=!0,ic(()=>{t._assigning=!1})}),t[jn]=Qi(l)},mounted(t,{value:i}){fu(t,i)},beforeUpdate(t,i,s){t[jn]=Qi(s)},updated(t,{value:i}){t._assigning||fu(t,i)}};function fu(t,i){const s=t.multiple,l=De(i);if(!(s&&!l&&!ls(i))){for(let u=0,f=t.options.length;uString(C)===String(_)):h.selected=tl(i,_)>-1}else h.selected=i.has(_);else if(Ji(rs(h),i)){t.selectedIndex!==u&&(t.selectedIndex=u);return}}!s&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function rs(t){return"_value"in t?t._value:t.value}function Wc(t,i){const s=i?"_trueValue":"_falseValue";return s in t?t[s]:i}const Vh={created(t,i,s){Aa(t,i,s,null,"created")},mounted(t,i,s){Aa(t,i,s,null,"mounted")},beforeUpdate(t,i,s,l){Aa(t,i,s,l,"beforeUpdate")},updated(t,i,s,l){Aa(t,i,s,l,"updated")}};function Zh(t,i){switch(t){case"SELECT":return zt;case"TEXTAREA":return ye;default:switch(i){case"checkbox":return Va;case"radio":return Uh;default:return ye}}}function Aa(t,i,s,l,u){const h=Zh(t.tagName,s.props&&s.props.type)[u];h&&h(t,i,s,l)}const Hh=["ctrl","shift","alt","meta"],jh={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)=>Hh.some(s=>t[`${s}Key`]&&!i.includes(s))},hl=(t,i)=>{if(!t)return t;const s=t._withMods||(t._withMods={}),l=i.join(".");return s[l]||(s[l]=((u,...f)=>{for(let h=0;h{const s=t._withKeys||(t._withKeys={}),l=i.join(".");return s[l]||(s[l]=(u=>{if(!("key"in u))return;const f=eo(u.key);if(i.some(h=>h===f||Wh[h]===f))return t(u)}))},Kh=Ht({patchProp:Dh},ph);let pu;function Gh(){return pu||(pu=Kf(Kh))}const qh=((...t)=>{const i=Gh().createApp(...t),{mount:s}=i;return i.mount=l=>{const u=Jh(l);if(!u)return;const f=i._component;!Ge(f)&&!f.render&&!f.template&&(f.template=u.innerHTML),u.nodeType===1&&(u.textContent="");const h=s(u,!1,Yh(u));return u instanceof Element&&(u.removeAttribute("v-cloak"),u.setAttribute("data-v-app","")),h},i});function Yh(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function Jh(t){return Ct(t)?document.querySelector(t):t}const Kc="pv_theme",mu={light:"#EEF0F3",dark:"#0B1730"},Za=typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;function Gc(){return Za&&Za.matches?"dark":"light"}function Xh(){try{return localStorage.getItem(Kc)||"light"}catch{return"light"}}function qc(t){return t==="system"?Gc():t}function Yc(t){const i=document.documentElement;i.setAttribute("data-theme",t),i.style.backgroundColor=mu[t]||mu.light}const Eo=W(Xh()),ss=W(qc(Eo.value));function Ha(t){Eo.value=t;const i=qc(t);ss.value=i,Yc(i);try{localStorage.setItem(Kc,t)}catch{}}function gu(){Ha(ss.value==="dark"?"light":"dark")}Za&&Za.addEventListener("change",()=>{if(Eo.value==="system"){const t=Gc();ss.value=t,Yc(t)}});async function Qh(){try{const t=await fetch("/bff/config");return t.ok?await t.json():{apiBase:""}}catch{return{apiBase:""}}}async function vu(){try{const t=await fetch("/bff/me");return t.ok?await t.json():null}catch{return null}}async function ep(t,i,s){const l=await fetch("/bff/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t,password:i,apiBase:s})});return{ok:l.ok,status:l.status,body:await l.json().catch(()=>({}))}}async function tp(){try{await fetch("/bff/logout",{method:"POST"})}catch{}}async function np(){try{const t=await fetch("/bff/devices");return t.ok?await t.json():[]}catch{return[]}}async function ip(){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 op(t,i,s,l){const u=await fetch("/bff/users",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t,password:i,role:s,organization:l})});return{ok:u.ok,status:u.status,body:await u.json().catch(()=>({}))}}async function sp(t,i){const s=await fetch(`/bff/users/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return{ok:s.ok,status:s.status,body:await s.json().catch(()=>({}))}}async function ap(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 rp(){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 lp(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 up(t,i){const s=await fetch(`/bff/orgs/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i})});return{ok:s.ok,status:s.status,body:await s.json().catch(()=>({}))}}async function cp(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 dp(){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 fp(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 hp(){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 _u(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 pp(t){const i=t?`?bbox=${encodeURIComponent(t)}`:"",s=await fetch(`/bff/integrations/opensky/health${i}`,{method:"POST"});return{ok:s.ok,status:s.status,body:await s.json().catch(()=>({}))}}async function mp(t){try{const i=t?`?bbox=${encodeURIComponent(t)}`:"",s=await fetch(`/bff/integrations/opensky/states${i}`);if(!s.ok)return{states:[],unavailable:!0,detail:"OpenSky unavailable"};const l=await s.json();return{states:l.states||[],time:l.time,unavailable:!!l.unavailable,detail:l.detail||"",plan:l.plan||"",recommendedInterval:l.recommendedInterval||0}}catch{return{states:[],unavailable:!0,detail:"OpenSky unavailable"}}}async function gp(){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 bu(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 vp(){const t=await fetch("/bff/integrations/filetransfer/health",{method:"POST"});return{ok:t.ok,status:t.status,body:await t.json().catch(()=>({}))}}async function _p(){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 Ma(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 bp(){const t=await fetch("/bff/integrations/localstorage/health",{method:"POST"});return{ok:t.ok,status:t.status,body:await t.json().catch(()=>({}))}}async function yp(){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 yu(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 xp(){const t=await fetch("/bff/integrations/webdav/health",{method:"POST"});return{ok:t.ok,status:t.status,body:await t.json().catch(()=>({}))}}async function wp(){try{const t=await fetch("/bff/integrations/openweather");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 xu(t){const i=await fetch("/bff/integrations/openweather",{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 kp(){const t=await fetch("/bff/integrations/openweather/health",{method:"POST"});return{ok:t.ok,status:t.status,body:await t.json().catch(()=>({}))}}async function Sp(t,i){try{const s=t!=null&&i!=null?`?lat=${encodeURIComponent(t)}&lon=${encodeURIComponent(i)}`:"",l=await fetch(`/bff/integrations/openweather/current${s}`);return l.ok?await l.json():{unavailable:!0,detail:"Weather unavailable"}}catch{return{unavailable:!0,detail:"Weather unavailable"}}}async function Jc(){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 Tp(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 Pp(t,i){const s=await fetch(`/bff/drones/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return{ok:s.ok,status:s.status,body:await s.json().catch(()=>({}))}}async function Cp(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 Lp(){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 Ap(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 Mp(t,i){const s=await fetch(`/bff/flights/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return{ok:s.ok,status:s.status,body:await s.json().catch(()=>({}))}}async function Ep(t){const i=await fetch(`/bff/flights/${encodeURIComponent(t)}`,{method:"DELETE"});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}function Op(){return"/bff/logbook/export"}async function zp(t){try{const i=t!=null&&t!==""?`?expiring=${encodeURIComponent(t)}`:"",s=await fetch(`/bff/documents${i}`);return s.ok?{ok:!0,status:200,documents:(await s.json()).documents||[]}:{ok:!1,status:s.status,documents:[]}}catch{return{ok:!1,status:0,documents:[]}}}async function Ip(t,i){const s=new FormData;Object.entries(t).forEach(([u,f])=>{f!=null&&f!==""&&s.append(u,f)}),i&&s.append("file",i);const l=await fetch("/bff/documents",{method:"POST",body:s});return{ok:l.ok,status:l.status,body:await l.json().catch(()=>({}))}}async function $p(t,i){const s=await fetch(`/bff/documents/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return{ok:s.ok,status:s.status,body:await s.json().catch(()=>({}))}}async function Np(t){const i=await fetch(`/bff/documents/${encodeURIComponent(t)}`,{method:"DELETE"});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}function zr(t){return`/bff/documents/${encodeURIComponent(t)}/file`}function Dp(t){return`/bff/documents/${encodeURIComponent(t)}/file?inline=1`}async function Fp(t,i,s){const l=await fetch(`/bff/devices/${encodeURIComponent(t)}/command`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:i,payload:s})});return{ok:l.ok,body:await l.json().catch(()=>({}))}}const Xc="pv_prefs",qr={name:"",username:"",displayName:"",bio:"",avatar:"",showEmail:!1,fontSize:"md",language:"en",region:"US",dateFormat:"MDY",timeFormat:"24",reduceMotion:!1,showAirTraffic:!0,autoBbox:!0,airTrafficInterval:"auto",twoFactor:!1};function Rp(){try{return{...qr,...JSON.parse(localStorage.getItem(Xc)||"{}")||{}}}catch{return{...qr}}}const be=xt(Rp());function Qc(){try{localStorage.setItem(Xc,JSON.stringify(be))}catch{}}function ed(t){if(!t||typeof t!="object")return!1;for(const i of Object.keys(qr))i in t&&(be[i]=t[i]);return!0}const Bp={sm:15,md:16,lg:18};function pl(t){document.documentElement.style.fontSize=(Bp[t]||16)+"px"}function ml(t){document.documentElement.classList.toggle("reduce-motion",!!t)}function td(t){const i=new Date(t),s=i.getFullYear(),l=String(i.getMonth()+1).padStart(2,"0"),u=String(i.getDate()).padStart(2,"0");let f;switch(be.dateFormat){case"DMY":f=`${u}/${l}/${s}`;break;case"YMD":f=`${s}/${l}/${u}`;break;case"ISO":f=`${s}-${l}-${u}`;break;default:f=`${l}/${u}/${s}`}let h;return be.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:f,time:h}}function wu(t){return td(t).time}function ku(t){const i=td(t);return`${i.date} ${i.time}`}let gl=!1,Yr=!1,Jr=null;function Up(){return{...JSON.parse(JSON.stringify(be)),themeMode:Eo.value}}function vl(){!gl||Yr||(clearTimeout(Jr),Jr=setTimeout(()=>{fp(Up())},600))}function Vp(t){Yr=!0;try{ed(t),t.themeMode&&Ha(t.themeMode),pl(be.fontSize),ml(be.reduceMotion),Qc()}finally{Yr=!1}}async function Su(){gl=!0;const t=await dp();t&&Object.keys(t).length?Vp(t):vl()}function Zp(){gl=!1,clearTimeout(Jr)}Rt(be,()=>{Qc(),vl()},{deep:!0});Rt(Eo,vl);Rt(()=>be.fontSize,pl,{immediate:!0});Rt(()=>be.reduceMotion,ml,{immediate:!0});const Hp=["width","height"],nd={__name:"BrandMark",props:{size:{type:[Number,String],default:28}},setup(t){return(i,s)=>(p(),m("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none","aria-hidden":"true"},[...s[0]||(s[0]=[a("g",{"stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round"},[a("polyline",{points:"8,30 19,17 30,30",stroke:"var(--accent)"}),a("polyline",{points:"18,33 29,20 40,33",stroke:"currentColor"})],-1)])],8,Hp))}},jp=["title","aria-label"],Wp={key:0,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Kp={key:1,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Gp={__name:"ThemeToggle",setup(t){return(i,s)=>(p(),m("button",{class:"btn-icon",type:"button",title:Oe(ss)==="dark"?"Switch to light":"Switch to dark","aria-label":Oe(ss)==="dark"?"Switch to light theme":"Switch to dark theme",onClick:s[0]||(s[0]=(...l)=>Oe(gu)&&Oe(gu)(...l))},[Oe(ss)==="dark"?(p(),m("svg",Wp,[...s[1]||(s[1]=[a("circle",{cx:"12",cy:"12",r:"4"},null,-1),a("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)])])):(p(),m("svg",Kp,[...s[2]||(s[2]=[a("path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9z"},null,-1)])]))],8,jp))}},qp={class:"relative grid h-full place-items-center p-5"},Yp={class:"absolute right-5 top-5"},Jp={class:"mb-6 flex items-center gap-3 text-ink"},Xp={class:"relative mb-1"},Qp=["type"],em=["aria-label","title"],tm={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]"},nm={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]"},im={key:0,class:"mt-4"},om={key:1,class:"mt-4 rounded border border-line bg-danger-soft px-3 py-2 text-sm text-danger-fg"},sm=["disabled"],am={__name:"LoginView",props:{defaultApiBase:{type:String,default:""}},emits:["signed-in"],setup(t,{emit:i}){const s=t,l=i,u=W(""),f=W(""),h=W(localStorage.getItem("api_url")||s.defaultApiBase||"http://localhost:8080"),_=W(!1),y=W(!1),C=W(!1),T=W("");async function M(){C.value=!0,T.value="",localStorage.setItem("api_url",h.value.trim());const{ok:U,status:V,body:K}=await ep(u.value.trim(),f.value,h.value.trim());if(C.value=!1,U){l("signed-in",K.email);return}T.value=V===400?"Invalid email or password.":V===502?"API server can't reach PocketBase.":K.message||K.error||"Cannot reach the API server."}return(U,V)=>(p(),m("div",qp,[a("div",Yp,[A(Gp)]),a("form",{class:"panel w-[380px] p-8 shadow-md",onSubmit:hl(M,["prevent"])},[a("div",Jp,[A(nd,{size:34}),V[5]||(V[5]=a("div",{class:"leading-tight"},[a("div",{class:"text-mode"},"PilotVault"),a("div",{class:"eyebrow mt-0.5"},"Control panel")],-1))]),V[9]||(V[9]=a("label",{class:"eyebrow mb-1.5 block"},"Email",-1)),Q(a("input",{"onUpdate:modelValue":V[0]||(V[0]=K=>u.value=K),type:"email",autocomplete:"username",required:"",class:"field mb-4",placeholder:"you@example.com"},null,512),[[ye,u.value]]),V[10]||(V[10]=a("label",{class:"eyebrow mb-1.5 block"},"Password",-1)),a("div",Xp,[Q(a("input",{"onUpdate:modelValue":V[1]||(V[1]=K=>f.value=K),type:y.value?"text":"password",autocomplete:"current-password",required:"",class:"field w-full pr-10",placeholder:"••••••••"},null,8,Qp),[[Vh,f.value]]),a("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]=K=>y.value=!y.value)},[y.value?(p(),m("svg",tm,[...V[6]||(V[6]=[a("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),a("line",{x1:"1",y1:"1",x2:"23",y2:"23"},null,-1)])])):(p(),m("svg",nm,[...V[7]||(V[7]=[a("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"},null,-1),a("circle",{cx:"12",cy:"12",r:"3"},null,-1)])]))],8,em)]),_.value?(p(),m("div",im,[V[8]||(V[8]=a("label",{class:"eyebrow mb-1.5 block"},"API Server",-1)),Q(a("input",{"onUpdate:modelValue":V[3]||(V[3]=K=>h.value=K),type:"text",class:"field font-mono",placeholder:"10.2.1.101:8080"},null,512),[[ye,h.value]])])):$("",!0),T.value?(p(),m("p",om,w(T.value),1)):$("",!0),a("button",{type:"submit",class:"btn-accent mt-6 w-full",disabled:C.value},w(C.value?"Signing in…":"Sign in"),9,sm),a("button",{type:"button",class:"mx-auto mt-3 block text-xs text-ink-muted transition hover:text-ink-secondary",onClick:V[4]||(V[4]=K=>_.value=!_.value)},w(_.value?"Hide server settings":"Server settings"),1)],32)]))}};function rm(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Fs={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 lm=Fs.exports,Tu;function um(){return Tu||(Tu=1,(function(t,i){(function(s,l){l(i)})(lm,(function(s){var l="1.9.4";function u(e){var n,o,r,d;for(o=1,r=arguments.length;o"u"||!L||!L.Mixin)){e=Le(e)?e:[e];for(var n=0;n0?Math.floor(e):Math.ceil(e)};ae.prototype={clone:function(){return new ae(this.x,this.y)},add:function(e){return this.clone()._add(pe(e))},_add:function(e){return this.x+=e.x,this.y+=e.y,this},subtract:function(e){return this.clone()._subtract(pe(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 ae(this.x*e.x,this.y*e.y)},unscaleBy:function(e){return new ae(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=Lt(this.x),this.y=Lt(this.y),this},distanceTo:function(e){e=pe(e);var n=e.x-this.x,o=e.y-this.y;return Math.sqrt(n*n+o*o)},equals:function(e){return e=pe(e),e.x===this.x&&e.y===this.y},contains:function(e){return e=pe(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 pe(e,n,o){return e instanceof ae?e:Le(e)?new ae(e[0],e[1]):e==null?e:typeof e=="object"&&"x"in e&&"y"in e?new ae(e.x,e.y):new ae(e,n,o)}function Ue(e,n){if(e)for(var o=n?[e,n]:e,r=0,d=o.length;r=this.min.x&&o.x<=this.max.x&&n.y>=this.min.y&&o.y<=this.max.y},intersects:function(e){e=Ve(e);var n=this.min,o=this.max,r=e.min,d=e.max,v=d.x>=n.x&&r.x<=o.x,P=d.y>=n.y&&r.y<=o.y;return v&&P},overlaps:function(e){e=Ve(e);var n=this.min,o=this.max,r=e.min,d=e.max,v=d.x>n.x&&r.xn.y&&r.y=n.lat&&d.lat<=o.lat&&r.lng>=n.lng&&d.lng<=o.lng},intersects:function(e){e=ot(e);var n=this._southWest,o=this._northEast,r=e.getSouthWest(),d=e.getNorthEast(),v=d.lat>=n.lat&&r.lat<=o.lat,P=d.lng>=n.lng&&r.lng<=o.lng;return v&&P},overlaps:function(e){e=ot(e);var n=this._southWest,o=this._northEast,r=e.getSouthWest(),d=e.getNorthEast(),v=d.lat>n.lat&&r.latn.lng&&r.lng1,Et=(function(){var e=!1;try{var n=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassiveEventSupport",M,n),window.removeEventListener("testPassiveEventSupport",M,n)}catch{}return e})(),mn=(function(){return!!document.createElement("canvas").getContext})(),Ii=!!(document.createElementNS&&B("svg").createSVGRect),Pe=!!Ii&&(function(){var e=document.createElement("div");return e.innerHTML="",(e.firstChild&&e.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"})(),qt=!Ii&&(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}})(),Oo=navigator.platform.indexOf("Mac")===0,$n=navigator.platform.indexOf("Linux")===0;function an(e){return navigator.userAgent.toLowerCase().indexOf(e)>=0}var ve={ie:se,ielt9:ne,edge:ee,webkit:q,android:ge,android23:te,androidStock:Te,opera:Ze,chrome:Ye,gecko:st,safari:ft,phantom:Tt,opera12:Bt,win:Kt,ie3d:Nt,webkit3d:pn,gecko3d:Pt,any3d:Gt,mobile:zn,mobileWebkit:zi,mobileWebkit3d:rt,msPointer:Kn,pointer:In,touch:j,touchNative:ct,mobileOpera:O,mobileGecko:Ie,retina:it,passiveEvents:Et,canvas:mn,svg:Ii,vml:qt,inlineSvg:Pe,mac:Oo,linux:$n},rn=ve.msPointer?"MSPointerDown":"pointerdown",At=ve.msPointer?"MSPointerMove":"pointermove",oa=ve.msPointer?"MSPointerUp":"pointerup",cs=ve.msPointer?"MSPointerCancel":"pointercancel",to={touchstart:rn,touchmove:At,touchend:oa,touchcancel:cs},sa={touchstart:ds,touchmove:Gn,touchend:Gn,touchcancel:Gn},$i={},aa=!1;function ir(e,n,o){return n==="touchstart"&&ht(),sa[n]?(o=sa[n].bind(this,o),e.addEventListener(to[n],o,!1),o):(console.warn("wrong event specified:",n),M)}function ra(e,n,o){if(!to[n]){console.warn("wrong event specified:",n);return}e.removeEventListener(to[n],o,!1)}function or(e){$i[e.pointerId]=e}function sr(e){$i[e.pointerId]&&($i[e.pointerId]=e)}function la(e){delete $i[e.pointerId]}function ht(){aa||(document.addEventListener(rn,or,!0),document.addEventListener(At,sr,!0),document.addEventListener(oa,la,!0),document.addEventListener(cs,la,!0),aa=!0)}function Gn(e,n){if(n.pointerType!==(n.MSPOINTER_TYPE_MOUSE||"mouse")){n.touches=[];for(var o in $i)n.touches.push($i[o]);n.changedTouches=[n],e(n)}}function ds(e,n){n.MSPOINTER_TYPE_TOUCH&&n.pointerType===n.MSPOINTER_TYPE_TOUCH&&Dt(n),Gn(e,n)}function Yt(e){var n={},o,r;for(r in e)o=e[r],n[r]=o&&o.bind?o.bind(e):o;return e=n,n.type="dblclick",n.detail=2,n.isTrusted=!1,n._simulated=!0,n}var no=200;function zo(e,n){e.addEventListener("dblclick",n);var o=0,r;function d(v){if(v.detail!==1){r=v.detail;return}if(!(v.pointerType==="mouse"||v.sourceCapabilities&&!v.sourceCapabilities.firesTouchEvents)){var P=da(v);if(!(P.some(function(D){return D instanceof HTMLLabelElement&&D.attributes.for})&&!P.some(function(D){return D instanceof HTMLInputElement||D instanceof HTMLSelectElement}))){var N=Date.now();N-o<=no?(r++,r===2&&n(Yt(v))):r=1,o=N}}}return e.addEventListener("click",d),{dblclick:n,simDblclick:d}}function Io(e,n){e.removeEventListener("dblclick",n.dblclick),e.removeEventListener("click",n.simDblclick)}var Sn=Fo(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),Nn=Fo(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),ua=Nn==="webkitTransition"||Nn==="OTransition"?Nn+"End":"transitionend";function $o(e){return typeof e=="string"?document.getElementById(e):e}function pi(e,n){var o=e.style[n]||e.currentStyle&&e.currentStyle[n];if((!o||o==="auto")&&document.defaultView){var r=document.defaultView.getComputedStyle(e,null);o=r?r[n]:null}return o==="auto"?null:o}function lt(e,n,o){var r=document.createElement(e);return r.className=n||"",o&&o.appendChild(r),r}function ut(e){var n=e.parentNode;n&&n.removeChild(e)}function Tn(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Pn(e){var n=e.parentNode;n&&n.lastChild!==e&&n.appendChild(e)}function jt(e){var n=e.parentNode;n&&n.firstChild!==e&&n.insertBefore(e,n.firstChild)}function No(e,n){if(e.classList!==void 0)return e.classList.contains(n);var o=Do(e);return o.length>0&&new RegExp("(^|\\s)"+n+"(\\s|$)").test(o)}function je(e,n){if(e.classList!==void 0)for(var o=K(n),r=0,d=o.length;r0?2*window.devicePixelRatio:1;function fa(e){return ve.edge?e.wheelDeltaY/2:e.deltaY&&e.deltaMode===0?-e.deltaY/vs: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 Ee(e,n){var o=n.relatedTarget;if(!o)return!0;try{for(;o&&o!==e;)o=o.parentNode}catch{return!1}return o!==e}var Ui={__proto__:null,on:$e,off:Qe,stopPropagation:vi,disableScrollPropagation:gs,disableClickPropagation:Ri,preventDefault:Dt,stop:_i,getPropagationPath:da,getMousePosition:Bi,getWheelDelta:fa,isExternalTarget:Ee,addListener:$e,removeListener:Qe},oo=de.extend({run:function(e,n,o,r){this.stop(),this._el=e,this._inProgress=!0,this._duration=o||.25,this._easeOutPower=1/Math.max(r||.5,.2),this._startPos=et(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=Me(this._animate,this),this._step()},_step:function(e){var n=+new Date-this._startTime,o=this._duration*1e3;nthis.options.maxZoom)?this.setZoom(e):this},panInsideBounds:function(e,n){this._enforcingBounds=!0;var o=this.getCenter(),r=this._limitCenter(o,this._zoom,ot(e));return o.equals(r)||this.panTo(r,n),this._enforcingBounds=!1,this},panInside:function(e,n){n=n||{};var o=pe(n.paddingTopLeft||n.padding||[0,0]),r=pe(n.paddingBottomRight||n.padding||[0,0]),d=this.project(this.getCenter()),v=this.project(e),P=this.getPixelBounds(),N=Ve([P.min.add(o),P.max.subtract(r)]),D=N.getSize();if(!N.contains(v)){this._enforcingBounds=!0;var X=v.subtract(N.getCenter()),_e=N.extend(v).getSize().subtract(D);d.x+=X.x<0?-_e.x:_e.x,d.y+=X.y<0?-_e.y:_e.y,this.panTo(this.unproject(d),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 o=this.getSize(),r=n.divideBy(2).round(),d=o.divideBy(2).round(),v=r.subtract(d);return!v.x&&!v.y?this:(e.animate&&e.pan?this.panBy(v):(e.pan&&this._rawPanBy(v),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:o}))},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),o=h(this._handleGeolocationError,this);return e.watch?this._locationWatchId=navigator.geolocation.watchPosition(n,o,e):navigator.geolocation.getCurrentPosition(n,o,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,o=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: "+o+"."})}},_handleGeolocationResponse:function(e){if(this._container._leaflet_id){var n=e.coords.latitude,o=e.coords.longitude,r=new Ce(n,o),d=r.toBounds(e.coords.accuracy*2),v=this._locateOptions;if(v.setView){var P=this.getBoundsZoom(d);this.setView(r,v.maxZoom?Math.min(P,v.maxZoom):P)}var N={latlng:r,bounds:d,timestamp:e.timestamp};for(var D in e.coords)typeof e.coords[D]=="number"&&(N[D]=e.coords[D]);this.fire("locationfound",N)}},addHandler:function(e,n){if(!n)return this;var o=this[e]=new n(this);return this._handlers.push(o),this.options[e]&&o.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(),ut(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(ie(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)ut(this._panes[e]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(e,n){var o="leaflet-pane"+(e?" leaflet-"+e.replace("Pane","")+"-pane":""),r=lt("div",o,n||this._mapPane);return e&&(this._panes[e]=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 e=this.getPixelBounds(),n=this.unproject(e.getBottomLeft()),o=this.unproject(e.getTopRight());return new mt(n,o)},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,o){e=ot(e),o=pe(o||[0,0]);var r=this.getZoom()||0,d=this.getMinZoom(),v=this.getMaxZoom(),P=e.getNorthWest(),N=e.getSouthEast(),D=this.getSize().subtract(o),X=Ve(this.project(N,r),this.project(P,r)).getSize(),_e=ve.any3d?this.options.zoomSnap:1,Re=D.x/X.x,nt=D.y/X.y,un=n?Math.max(Re,nt):Math.min(Re,nt);return r=this.getScaleZoom(un,r),_e&&(r=Math.round(r/(_e/100))*(_e/100),r=n?Math.ceil(r/_e)*_e:Math.floor(r/_e)*_e),Math.max(d,Math.min(v,r))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new ae(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(e,n){var o=this._getTopLeftPoint(e,n);return new Ue(o,o.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 o=this.options.crs;return n=n===void 0?this._zoom:n,o.scale(e)/o.scale(n)},getScaleZoom:function(e,n){var o=this.options.crs;n=n===void 0?this._zoom:n;var r=o.zoom(e*o.scale(n));return isNaN(r)?1/0:r},project:function(e,n){return n=n===void 0?this._zoom:n,this.options.crs.latLngToPoint(J(e),n)},unproject:function(e,n){return n=n===void 0?this._zoom:n,this.options.crs.pointToLatLng(pe(e),n)},layerPointToLatLng:function(e){var n=pe(e).add(this.getPixelOrigin());return this.unproject(n)},latLngToLayerPoint:function(e){var n=this.project(J(e))._round();return n._subtract(this.getPixelOrigin())},wrapLatLng:function(e){return this.options.crs.wrapLatLng(J(e))},wrapLatLngBounds:function(e){return this.options.crs.wrapLatLngBounds(ot(e))},distance:function(e,n){return this.options.crs.distance(J(e),J(n))},containerPointToLayerPoint:function(e){return pe(e).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(e){return pe(e).add(this._getMapPanePos())},containerPointToLatLng:function(e){var n=this.containerPointToLayerPoint(pe(e));return this.layerPointToLatLng(n)},latLngToContainerPoint:function(e){return this.layerPointToContainerPoint(this.latLngToLayerPoint(J(e)))},mouseEventToContainerPoint:function(e){return Bi(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=$o(e);if(n){if(n._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");$e(n,"scroll",this._onScroll,this),this._containerId=y(n)},_initLayout:function(){var e=this._container;this._fadeAnimated=this.options.fadeAnimation&&ve.any3d,je(e,"leaflet-container"+(ve.touch?" leaflet-touch":"")+(ve.retina?" leaflet-retina":"")+(ve.ielt9?" leaflet-oldie":"")+(ve.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var n=pi(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),Ot(this._mapPane,new ae(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(je(e.markerPane,"leaflet-zoom-hide"),je(e.shadowPane,"leaflet-zoom-hide"))},_resetView:function(e,n,o){Ot(this._mapPane,new ae(0,0));var r=!this._loaded;this._loaded=!0,n=this._limitZoom(n),this.fire("viewprereset");var d=this._zoom!==n;this._moveStart(d,o)._move(e,n)._moveEnd(d),this.fire("viewreset"),r&&this.fire("load")},_moveStart:function(e,n){return e&&this.fire("zoomstart"),n||this.fire("movestart"),this},_move:function(e,n,o,r){n===void 0&&(n=this._zoom);var d=this._zoom!==n;return this._zoom=n,this._lastCenter=e,this._pixelOrigin=this._getNewPixelOrigin(e),r?o&&o.pinch&&this.fire("zoom",o):((d||o&&o.pinch)&&this.fire("zoom",o),this.fire("move",o)),this},_moveEnd:function(e){return e&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return ie(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(e){Ot(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?Qe:$e;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),ve.any3d&&this.options.transform3DLimit&&(e?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){ie(this._resizeRequest),this._resizeRequest=Me(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 o=[],r,d=n==="mouseout"||n==="mouseover",v=e.target||e.srcElement,P=!1;v;){if(r=this._targets[y(v)],r&&(n==="click"||n==="preclick")&&this._draggableMoved(r)){P=!0;break}if(r&&r.listens(n,!0)&&(d&&!Ee(v,e)||(o.push(r),d))||v===this._container)break;v=v.parentNode}return!o.length&&!P&&!d&&this.listens(n,!0)&&(o=[this]),o},_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 o=e.type;o==="mousedown"&&Ro(n),this._fireDOMEvent(e,o)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(e,n,o){if(e.type==="click"){var r=u({},e);r.type="preclick",this._fireDOMEvent(r,r.type,o)}var d=this._findEventTargets(e,n);if(o){for(var v=[],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(),o=this.getMaxZoom(),r=ve.any3d?this.options.zoomSnap:1;return r&&(e=Math.round(e/r)*r),Math.max(n,Math.min(o,e))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){Mt(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(e,n){var o=this._getCenterOffset(e)._trunc();return(n&&n.animate)!==!0&&!this.getSize().contains(o)?!1:(this.panBy(o,n),!0)},_createAnimProxy:function(){var e=this._proxy=lt("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(e),this.on("zoomanim",function(n){var o=Sn,r=this._proxy.style[o];mi(this._proxy,this.project(n.center,n.zoom),this.getZoomScale(n.zoom,1)),r===this._proxy.style[o]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){ut(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var e=this.getCenter(),n=this.getZoom();mi(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,o){if(this._animatingZoom)return!0;if(o=o||{},!this._zoomAnimated||o.animate===!1||this._nothingToAnimate()||Math.abs(n-this._zoom)>this.options.zoomAnimationThreshold)return!1;var r=this.getZoomScale(n),d=this._getCenterOffset(e)._divideBy(1-1/r);return o.animate!==!0&&!this.getSize().contains(d)?!1:(Me(function(){this._moveStart(!0,o.noMoveStart||!1)._animateZoom(e,n,!0)},this),!0)},_animateZoom:function(e,n,o,r){this._mapPane&&(o&&(this._animatingZoom=!0,this._animateToCenter=e,this._animateToZoom=n,je(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:e,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&&Mt(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 Vo(e,n){return new Xe(e,n)}var Xt=re.extend({options:{position:"topright"},initialize:function(e){F(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),o=this.getPosition(),r=e._controlCorners[o];return je(n,"leaflet-control"),o.indexOf("bottom")!==-1?r.insertBefore(n,r.firstChild):r.appendChild(n),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(ut(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()}}),ln=function(e){return new Xt(e)};Xe.include({addControl:function(e){return e.addTo(this),this},removeControl:function(e){return e.remove(),this},_initControlPos:function(){var e=this._controlCorners={},n="leaflet-",o=this._controlContainer=lt("div",n+"control-container",this._container);function r(d,v){var P=n+d+" "+n+v;e[d+v]=lt("div",P,o)}r("top","left"),r("top","right"),r("bottom","left"),r("bottom","right")},_clearControlPos:function(){for(var e in this._controlCorners)ut(this._controlCorners[e]);ut(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var bi=Xt.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(e,n,o,r){return o1,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)),o=n.overlay?e.type==="add"?"overlayadd":"overlayremove":e.type==="add"?"baselayerchange":null;o&&this._map.fire(o,n)},_createRadioElement:function(e,n){var o='",r=document.createElement("div");return r.innerHTML=o,r.firstChild},_addItem:function(e){var n=document.createElement("label"),o=this._map.hasLayer(e.layer),r;e.overlay?(r=document.createElement("input"),r.type="checkbox",r.className="leaflet-control-layers-selector",r.defaultChecked=o):r=this._createRadioElement("leaflet-base-layers_"+y(this),o),this._layerControlInputs.push(r),r.layerId=y(e.layer),$e(r,"click",this._onInputClick,this);var d=document.createElement("span");d.innerHTML=" "+e.name;var v=document.createElement("span");n.appendChild(v),v.appendChild(r),v.appendChild(d);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,o,r=[],d=[];this._handlingClick=!0;for(var v=e.length-1;v>=0;v--)n=e[v],o=this._getLayer(n.layerId).layer,n.checked?r.push(o):n.checked||d.push(o);for(v=0;v=0;d--)n=e[d],o=this._getLayer(n.layerId).layer,n.disabled=o.options.minZoom!==void 0&&ro.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var e=this._section;this._preventClick=!0,$e(e,"click",Dt),this.expand();var n=this;setTimeout(function(){Qe(e,"click",Dt),n._preventClick=!1})}}),so=function(e,n,o){return new bi(e,n,o)},Zo=Xt.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(e){var n="leaflet-control-zoom",o=lt("div",n+" leaflet-bar"),r=this.options;return this._zoomInButton=this._createButton(r.zoomInText,r.zoomInTitle,n+"-in",o,this._zoomIn),this._zoomOutButton=this._createButton(r.zoomOutText,r.zoomOutTitle,n+"-out",o,this._zoomOut),this._updateDisabled(),e.on("zoomend zoomlevelschange",this._updateDisabled,this),o},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,o,r,d){var v=lt("a",o,r);return v.innerHTML=e,v.href="#",v.title=n,v.setAttribute("role","button"),v.setAttribute("aria-label",n),Ri(v),$e(v,"click",_i),$e(v,"click",d,this),$e(v,"click",this._refocusOnMap,this),v},_updateDisabled:function(){var e=this._map,n="leaflet-disabled";Mt(this._zoomInButton,n),Mt(this._zoomOutButton,n),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||e._zoom===e.getMinZoom())&&(je(this._zoomOutButton,n),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||e._zoom===e.getMaxZoom())&&(je(this._zoomInButton,n),this._zoomInButton.setAttribute("aria-disabled","true"))}});Xe.mergeOptions({zoomControl:!0}),Xe.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Zo,this.addControl(this.zoomControl))});var _s=function(e){return new Zo(e)},Ho=Xt.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(e){var n="leaflet-control-scale",o=lt("div",n),r=this.options;return this._addScales(r,n+"-line",o),e.on(r.updateWhenIdle?"moveend":"move",this._update,this),e.whenReady(this._update,this),o},onRemove:function(e){e.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(e,n,o){e.metric&&(this._mScale=lt("div",n,o)),e.imperial&&(this._iScale=lt("div",n,o))},_update:function(){var e=this._map,n=e.getSize().y/2,o=e.distance(e.containerPointToLatLng([0,n]),e.containerPointToLatLng([this.options.maxWidth,n]));this._updateScales(o)},_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),o=n<1e3?n+" m":n/1e3+" km";this._updateScale(this._mScale,o,n/e)},_updateImperial:function(e){var n=e*3.2808399,o,r,d;n>5280?(o=n/5280,r=this._getRoundNum(o),this._updateScale(this._iScale,r+" mi",r/o)):(d=this._getRoundNum(n),this._updateScale(this._iScale,d+" ft",d/n))},_updateScale:function(e,n,o){e.style.width=Math.round(this.options.maxWidth*o)+"px",e.innerHTML=n},_getRoundNum:function(e){var n=Math.pow(10,(Math.floor(e)+"").length-1),o=e/n;return o=o>=10?10:o>=5?5:o>=3?3:o>=2?2:1,n*o}}),ar=function(e){return new Ho(e)},vn='',Vi=Xt.extend({options:{position:"bottomright",prefix:''+(ve.inlineSvg?vn+" ":"")+"Leaflet"},initialize:function(e){F(this,e),this._attributions={}},onAdd:function(e){e.attributionControl=this,this._container=lt("div","leaflet-control-attribution"),Ri(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 o=[];this.options.prefix&&o.push(this.options.prefix),e.length&&o.push(e.join(", ")),this._container.innerHTML=o.join(' ')}}});Xe.mergeOptions({attributionControl:!0}),Xe.addInitHook(function(){this.options.attributionControl&&new Vi().addTo(this)});var ha=function(e){return new Vi(e)};Xt.Layers=bi,Xt.Zoom=Zo,Xt.Scale=Ho,Xt.Attribution=Vi,ln.layers=so,ln.zoom=_s,ln.scale=ar,ln.attribution=ha;var Ln=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}});Ln.addTo=function(e,n){return e.addHandler(n,this),this};var rr={Events:fe},bs=ve.touch?"touchstart mousedown":"mousedown",_n=de.extend({options:{clickTolerance:3},initialize:function(e,n,o,r){F(this,r),this._element=e,this._dragStartTarget=n||e,this._preventOutline=o},enable:function(){this._enabled||($e(this._dragStartTarget,bs,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(_n._dragging===this&&this.finishDrag(!0),Qe(this._dragStartTarget,bs,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(e){if(this._enabled&&(this._moved=!1,!No(this._element,"leaflet-zoom-anim"))){if(e.touches&&e.touches.length!==1){_n._dragging===this&&this.finishDrag();return}if(!(_n._dragging||e.shiftKey||e.which!==1&&e.button!==1&&!e.touches)&&(_n._dragging=this,this._preventOutline&&Ro(this._element),Ni(),Dn(),!this._moving)){this.fire("down");var n=e.touches?e.touches[0]:e,o=Bo(this._element);this._startPoint=new ae(n.clientX,n.clientY),this._startPos=et(this._element),this._parentScale=hs(o);var r=e.type==="mousedown";$e(document,r?"mousemove":"touchmove",this._onMove,this),$e(document,r?"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,o=new ae(n.clientX,n.clientY)._subtract(this._startPoint);!o.x&&!o.y||Math.abs(o.x)+Math.abs(o.y)v&&(P=N,v=D);v>o&&(n[P]=1,ws(e,n,o,r,P),ws(e,n,o,P,d))}function va(e,n){for(var o=[e[0]],r=1,d=0,v=e.length;rn&&(o.push(e[r]),d=r);return dn.max.x&&(o|=2),e.yn.max.y&&(o|=8),o}function ks(e,n){var o=n.x-e.x,r=n.y-e.y;return o*o+r*r}function Je(e,n,o,r){var d=n.x,v=n.y,P=o.x-d,N=o.y-v,D=P*P+N*N,X;return D>0&&(X=((e.x-d)*P+(e.y-v)*N)/D,X>1?(d=o.x,v=o.y):X>0&&(d+=P*X,v+=N*X)),P=e.x-d,N=e.y-v,r?P*P+N*N:new ae(d,v)}function kt(e){return!Le(e[0])||typeof e[0][0]!="object"&&typeof e[0][0]<"u"}function yi(e){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),kt(e)}function Ss(e,n){var o,r,d,v,P,N,D,X;if(!e||e.length===0)throw new Error("latlngs not passed");kt(e)||(console.warn("latlngs are not flat! Only the first ring will be used"),e=e[0]);var _e=J([0,0]),Re=ot(e),nt=Re.getNorthWest().distanceTo(Re.getSouthWest())*Re.getNorthEast().distanceTo(Re.getNorthWest());nt<1700&&(_e=ys(e));var un=e.length,Zt=[];for(o=0;or){D=(v-r)/d,X=[N.x-D*(N.x-P.x),N.y-D*(N.y-P.y)];break}var wn=n.unproject(pe(X));return J([wn.lat+_e.lat,wn.lng+_e.lng])}var dr={__proto__:null,simplify:xs,pointToSegmentDistance:ga,closestPointOnSegment:ur,clipSegment:jo,_getEdgeIntersection:Zi,_getBitCode:Fn,_sqClosestPointOnSegment:Je,isFlat:kt,_flat:yi,polylineCenter:Ss},ao={project:function(e){return new ae(e.lng,e.lat)},unproject:function(e){return new Ce(e.y,e.x)},bounds:new Ue([-180,-90],[180,90])},Ts={R:6378137,R_MINOR:6356752314245179e-9,bounds:new Ue([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(e){var n=Math.PI/180,o=this.R,r=e.lat*n,d=this.R_MINOR/o,v=Math.sqrt(1-d*d),P=v*Math.sin(r),N=Math.tan(Math.PI/4-r/2)/Math.pow((1-P)/(1+P),v/2);return r=-o*Math.log(Math.max(N,1e-10)),new ae(e.lng*n*o,r)},unproject:function(e){for(var n=180/Math.PI,o=this.R,r=this.R_MINOR/o,d=Math.sqrt(1-r*r),v=Math.exp(-e.y/o),P=Math.PI/2-2*Math.atan(v),N=0,D=.1,X;N<15&&Math.abs(D)>1e-7;N++)X=d*Math.sin(P),X=Math.pow((1-X)/(1+X),d/2),D=Math.PI/2-2*Math.atan(v*X)-P,P+=D;return new Ce(P*n,e.x*n/o)}},fr={__proto__:null,LonLat:ao,Mercator:Ts,SphericalMercator:dt},hr=u({},I,{code:"EPSG:3395",projection:Ts,transformation:(function(){var e=.5/(Math.PI*Ts.R);return x(e,.5,-e,.5)})()}),ba=u({},I,{code:"EPSG:4326",projection:ao,transformation:x(1/180,1,-1/180,.5)}),ro=u({},E,{projection:ao,transformation:x(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 o=n.lng-e.lng,r=n.lat-e.lat;return Math.sqrt(o*o+r*r)},infinite:!0});E.Earth=I,E.EPSG3395=hr,E.EPSG3857=b,E.EPSG900913=S,E.EPSG4326=ba,E.Simple=ro;var bn=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 o=this.getEvents();n.on(o,this),this.once("remove",function(){n.off(o,this)},this)}this.onAdd(n),this.fire("add"),n.fire("layeradd",{layer:this})}}});Xe.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 o in this._layers)e.call(n,this._layers[o]);return this},_addLayers:function(e){e=e?Le(e)?e:[e]:[];for(var n=0,o=e.length;nthis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()=2&&n[0]instanceof Ce&&n[0].equals(n[o-1])&&n.pop(),n},_setLatLngs:function(e){Qt.prototype._setLatLngs.call(this,e),kt(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return kt(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var e=this._renderer._bounds,n=this.options.weight,o=new ae(n,n);if(e=new Ue(e.min.subtract(o),e.max.add(o)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(e))){if(this.options.noClip){this._parts=this._rings;return}for(var r=0,d=this._rings.length,v;re.y!=d.y>e.y&&e.x<(d.x-r.x)*(e.y-r.y)/(d.y-r.y)+r.x&&(n=!n);return n||Qt.prototype._containsPoint.call(this,e,!0)}});function ya(e,n){return new Rn(e,n)}var xn=yn.extend({initialize:function(e,n){F(this,n),this._layers={},e&&this.addData(e)},addData:function(e){var n=Le(e)?e:e.features,o,r,d;if(n){for(o=0,r=n.length;o0&&d.push(d[0].slice()),d}function tt(e,n){return e.feature?u({},e.feature,{geometry:n}):Mn(n)}function Mn(e){return e.type==="Feature"||e.type==="FeatureCollection"?e:{type:"Feature",properties:{},geometry:e}}var Wi={toGeoJSON:function(e){return tt(this,{type:"Point",coordinates:Ls(this.getLatLng(),e)})}};Wo.include(Wi),ji.include(Wi),xi.include(Wi),Qt.include({toGeoJSON:function(e){var n=!kt(this._latlngs),o=Go(this._latlngs,n?1:0,!1,e);return tt(this,{type:(n?"Multi":"")+"LineString",coordinates:o})}}),Rn.include({toGeoJSON:function(e){var n=!kt(this._latlngs),o=n&&!kt(this._latlngs[0]),r=Go(this._latlngs,o?2:n?1:0,!0,e);return n||(r=[r]),tt(this,{type:(o?"Multi":"")+"Polygon",coordinates:r})}}),Jn.include({toMultiPoint:function(e){var n=[];return this.eachLayer(function(o){n.push(o.toGeoJSON(e).geometry.coordinates)}),tt(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 o=n==="GeometryCollection",r=[];return this.eachLayer(function(d){if(d.toGeoJSON){var v=d.toGeoJSON(e);if(o)r.push(v.geometry);else{var P=Mn(v);P.type==="FeatureCollection"?r.push.apply(r,P.features):r.push(P)}}}),o?tt(this,{geometries:r,type:"GeometryCollection"}):{type:"FeatureCollection",features:r}}});function qo(e,n){return new xn(e,n)}var gr=qo,fo=bn.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(e,n,o){this._url=e,this._bounds=ot(n),F(this,o)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(je(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){ut(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&&Pn(this._image),this},bringToBack:function(){return this._map&&jt(this._image),this},setUrl:function(e){return this._url=e,this._image&&(this._image.src=e),this},setBounds:function(e){return this._bounds=ot(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:lt("img");if(je(n,"leaflet-image-layer"),this._zoomAnimated&&je(n,"leaflet-zoom-animated"),this.options.className&&je(n,this.options.className),n.onselectstart=M,n.onmousemove=M,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),o=this._map._latLngBoundsToNewLayerBounds(this._bounds,e.zoom,e.center).min;mi(this._image,o,n)},_reset:function(){var e=this._image,n=new Ue(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),o=n.getSize();Ot(e,n.min),e.style.width=o.x+"px",e.style.height=o.y+"px"},_updateOpacity:function(){gn(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()}}),vr=function(e,n,o){return new fo(e,n,o)},ho=fo.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:lt("video");if(je(n,"leaflet-image-layer"),this._zoomAnimated&&je(n,"leaflet-zoom-animated"),this.options.className&&je(n,this.options.className),n.onselectstart=M,n.onmousemove=M,n.onloadeddata=h(this.fire,this,"load"),e){for(var o=n.getElementsByTagName("source"),r=[],d=0;d0?r:[n.src];return}Le(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 v=0;vd?(n.height=d+"px",je(e,v)):Mt(e,v),this._containerWidth=this._container.offsetWidth},_animateZoom:function(e){var n=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center),o=this._getAnchor();Ot(this._container,n.add(o))},_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(pi(this._container,"marginBottom"),10)||0,o=this._container.offsetHeight+n,r=this._containerWidth,d=new ae(this._containerLeft,-o-this._containerBottom);d._add(et(this._container));var v=e.layerPointToContainerPoint(d),P=pe(this.options.autoPanPadding),N=pe(this.options.autoPanPaddingTopLeft||P),D=pe(this.options.autoPanPaddingBottomRight||P),X=e.getSize(),_e=0,Re=0;v.x+r+D.x>X.x&&(_e=v.x+r-X.x+D.x),v.x-_e-N.x<0&&(_e=v.x-N.x),v.y+o+D.y>X.y&&(Re=v.y+o-X.y+D.y),v.y-Re-N.y<0&&(Re=v.y-N.y),(_e||Re)&&(this.options.keepInView&&(this._autopanning=!0),e.fire("autopanstart").panBy([_e,Re]))}},_getAnchor:function(){return pe(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),As=function(e,n){return new Bn(e,n)};Xe.mergeOptions({closePopupOnClick:!0}),Xe.include({openPopup:function(e,n,o){return this._initOverlay(Bn,e,n,o).openOn(this),this},closePopup:function(e){return e=arguments.length?e:this._popup,e&&e.close(),this}}),bn.include({bindPopup:function(e,n){return this._popup=this._initOverlay(Bn,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 yn||(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)){_i(e);var n=e.layer||e.target;if(this._popup._source===n&&!(n instanceof ii)){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 vo=It.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(e){It.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){It.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=It.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=lt("div",n),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+y(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(e){var n,o,r=this._map,d=this._container,v=r.latLngToContainerPoint(r.getCenter()),P=r.layerPointToContainerPoint(e),N=this.options.direction,D=d.offsetWidth,X=d.offsetHeight,_e=pe(this.options.offset),Re=this._getAnchor();N==="top"?(n=D/2,o=X):N==="bottom"?(n=D/2,o=0):N==="center"?(n=D/2,o=X/2):N==="right"?(n=0,o=X/2):N==="left"?(n=D,o=X/2):P.xthis.options.maxZoom||or?this._retainParent(d,v,P,r):!1)},_retainChildren:function(e,n,o,r){for(var d=2*e;d<2*e+2;d++)for(var v=2*n;v<2*n+2;v++){var P=new ae(d,v);P.z=o+1;var N=this._tileCoordsToKey(P),D=this._tiles[N];if(D&&D.active){D.retain=!0;continue}else D&&D.loaded&&(D.retain=!0);o+1this.options.maxZoom||this.options.minZoom!==void 0&&d1){this._setView(e,o);return}for(var Re=d.min.y;Re<=d.max.y;Re++)for(var nt=d.min.x;nt<=d.max.x;nt++){var un=new ae(nt,Re);if(un.z=this._tileZoom,!!this._isValidTile(un)){var Zt=this._tiles[this._tileCoordsToKey(un)];Zt?Zt.current=!0:P.push(un)}}if(P.sort(function(wn,Jo){return wn.distanceTo(v)-Jo.distanceTo(v)}),P.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var Un=document.createDocumentFragment();for(nt=0;nto.max.x)||!n.wrapLat&&(e.yo.max.y))return!1}if(!this.options.bounds)return!0;var r=this._tileCoordsToBounds(e);return ot(this.options.bounds).overlaps(r)},_keyToBounds:function(e){return this._tileCoordsToBounds(this._keyToTileCoords(e))},_tileCoordsToNwSe:function(e){var n=this._map,o=this.getTileSize(),r=e.scaleBy(o),d=r.add(o),v=n.unproject(r,e.z),P=n.unproject(d,e.z);return[v,P]},_tileCoordsToBounds:function(e){var n=this._tileCoordsToNwSe(e),o=new mt(n[0],n[1]);return this.options.noWrap||(o=this._map.wrapLatLngBounds(o)),o},_tileCoordsToKey:function(e){return e.x+":"+e.y+":"+e.z},_keyToTileCoords:function(e){var n=e.split(":"),o=new ae(+n[0],+n[1]);return o.z=+n[2],o},_removeTile:function(e){var n=this._tiles[e];n&&(ut(n.el),delete this._tiles[e],this.fire("tileunload",{tile:n.el,coords:this._keyToTileCoords(e)}))},_initTile:function(e){je(e,"leaflet-tile");var n=this.getTileSize();e.style.width=n.x+"px",e.style.height=n.y+"px",e.onselectstart=M,e.onmousemove=M,ve.ielt9&&this.options.opacity<1&&gn(e,this.options.opacity)},_addTile:function(e,n){var o=this._getTilePos(e),r=this._tileCoordsToKey(e),d=this.createTile(this._wrapCoords(e),h(this._tileReady,this,e));this._initTile(d),this.createTile.length<2&&Me(h(this._tileReady,this,e,null,d)),Ot(d,o),this._tiles[r]={el:d,coords:e,current:!0},n.appendChild(d),this.fire("tileloadstart",{tile:d,coords:e})},_tileReady:function(e,n,o){n&&this.fire("tileerror",{error:n,tile:o,coords:e});var r=this._tileCoordsToKey(e);o=this._tiles[r],o&&(o.loaded=+new Date,this._map._fadeAnimated?(gn(o.el,0),ie(this._fadeFrame),this._fadeFrame=Me(this._updateOpacity,this)):(o.active=!0,this._pruneTiles()),n||(je(o.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:o.el,coords:e})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),ve.ielt9||!this._map._fadeAnimated?Me(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 ae(this._wrapX?T(e.x,this._wrapX):e.x,this._wrapY?T(e.y,this._wrapY):e.y);return n.z=e.z,n},_pxBoundsToTileRange:function(e){var n=this.getTileSize();return new Ue(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 br(e){return new _o(e)}var Xn=_o.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=F(this,n),n.detectRetina&&ve.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 o=document.createElement("img");return $e(o,"load",h(this._tileOnLoad,this,n,o)),$e(o,"error",h(this._tileOnError,this,n,o)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(o.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(o.referrerPolicy=this.options.referrerPolicy),o.alt="",o.src=this.getTileUrl(e),o},getTileUrl:function(e){var n={r:ve.retina?"@2x":"",s:this._getSubdomain(e),x:e.x,y:e.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var o=this._globalTileRange.max.y-e.y;this.options.tms&&(n.y=o),n["-y"]=o}return Y(this._url,u(n,this.options))},_tileOnLoad:function(e,n){ve.ielt9?setTimeout(h(e,this,null,n),0):e(null,n)},_tileOnError:function(e,n,o){var r=this.options.errorTileUrl;r&&n.getAttribute("src")!==r&&(n.src=r),e(o,n)},_onTileRemove:function(e){e.tile.onload=null},_getZoomForUrl:function(){var e=this._tileZoom,n=this.options.maxZoom,o=this.options.zoomReverse,r=this.options.zoomOffset;return o&&(e=n-e),e+r},_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=M,n.onerror=M,!n.complete)){n.src=Be;var o=this._tiles[e].coords;ut(n),delete this._tiles[e],this.fire("tileabort",{tile:n,coords:o})}},_removeTile:function(e){var n=this._tiles[e];if(n)return n.el.setAttribute("src",Be),_o.prototype._removeTile.call(this,e)},_tileReady:function(e,n,o){if(!(!this._map||o&&o.getAttribute("src")===Be))return _o.prototype._tileReady.call(this,e,n,o)}});function wa(e,n){return new Xn(e,n)}var yt=Xn.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 o=u({},this.defaultWmsParams);for(var r in n)r in this.options||(o[r]=n[r]);n=F(this,n);var d=n.detectRetina&&ve.retina?2:1,v=this.getTileSize();o.width=v.x*d,o.height=v.y*d,this.wmsParams=o},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,Xn.prototype.onAdd.call(this,e)},getTileUrl:function(e){var n=this._tileCoordsToNwSe(e),o=this._crs,r=Ve(o.project(n[0]),o.project(n[1])),d=r.min,v=r.max,P=(this._wmsVersion>=1.3&&this._crs===ba?[d.y,d.x,v.y,v.x]:[d.x,d.y,v.x,v.y]).join(","),N=Xn.prototype.getTileUrl.call(this,e);return N+me(this.wmsParams,N,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+P},setParams:function(e,n){return u(this.wmsParams,e),n||this.redraw(),this}});function bo(e,n){return new yt(e,n)}Xn.WMS=yt,wa.wms=bo;var En=bn.extend({options:{padding:.1},initialize:function(e){F(this,e),y(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),je(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 o=this._map.getZoomScale(n,this._zoom),r=this._map.getSize().multiplyBy(.5+this.options.padding),d=this._map.project(this._center,n),v=r.multiplyBy(-o).add(d).subtract(this._map._getNewPixelOrigin(e,n));ve.any3d?mi(this._container,v,o):Ot(this._container,v)},_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(),o=this._map.containerPointToLayerPoint(n.multiplyBy(-e)).round();this._bounds=new Ue(o,o.add(n.multiplyBy(1+e*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Yo=En.extend({options:{tolerance:0},getEvents:function(){var e=En.prototype.getEvents.call(this);return e.viewprereset=this._onViewPreReset,e},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){En.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var e=this._container=document.createElement("canvas");$e(e,"mousemove",this._onMouseMove,this),$e(e,"click dblclick mousedown mouseup contextmenu",this._onClick,this),$e(e,"mouseout",this._handleMouseOut,this),e._leaflet_disable_events=!0,this._ctx=e.getContext("2d")},_destroyContainer:function(){ie(this._redrawRequest),delete this._ctx,ut(this._container),Qe(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)){En.prototype._update.call(this);var e=this._bounds,n=this._container,o=e.getSize(),r=ve.retina?2:1;Ot(n,e.min),n.width=r*o.x,n.height=r*o.y,n.style.width=o.x+"px",n.style.height=o.y+"px",ve.retina&&this._ctx.scale(2,2),this._ctx.translate(-e.min.x,-e.min.y),this.fire("update")}},_reset:function(){En.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,o=n.next,r=n.prev;o?o.prev=r:this._drawLast=r,r?r.next=o:this._drawFirst=o,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(/[, ]+/),o=[],r,d;for(d=0;d')}}catch{}return function(e){return document.createElement("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}})(),g={_initContainer:function(){this._container=lt("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(En.prototype._update.call(this),this.fire("update"))},_initPath:function(e){var n=e._container=yo("shape");je(n,"leaflet-vml-shape "+(this.options.className||"")),n.coordsize="1 1",e._path=yo("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;ut(n),e.removeInteractiveTarget(n),delete this._layers[y(e)]},_updateStyle:function(e){var n=e._stroke,o=e._fill,r=e.options,d=e._container;d.stroked=!!r.stroke,d.filled=!!r.fill,r.stroke?(n||(n=e._stroke=yo("stroke")),d.appendChild(n),n.weight=r.weight+"px",n.color=r.color,n.opacity=r.opacity,r.dashArray?n.dashStyle=Le(r.dashArray)?r.dashArray.join(" "):r.dashArray.replace(/( *, *)/g," "):n.dashStyle="",n.endcap=r.lineCap.replace("butt","flat"),n.joinstyle=r.lineJoin):n&&(d.removeChild(n),e._stroke=null),r.fill?(o||(o=e._fill=yo("fill")),d.appendChild(o),o.color=r.fillColor||r.color,o.opacity=r.fillOpacity):o&&(d.removeChild(o),e._fill=null)},_updateCircle:function(e){var n=e._point.round(),o=Math.round(e._radius),r=Math.round(e._radiusY||o);this._setPath(e,e._empty()?"M0 0":"AL "+n.x+","+n.y+" "+o+","+r+" 0,"+65535*360)},_setPath:function(e,n){e._path.v=n},_bringToFront:function(e){Pn(e._container)},_bringToBack:function(e){jt(e._container)}},c=ve.vml?yo:B,H=En.extend({_initContainer:function(){this._container=c("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=c("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ut(this._container),Qe(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){En.prototype._update.call(this);var e=this._bounds,n=e.getSize(),o=this._container;(!this._svgSize||!this._svgSize.equals(n))&&(this._svgSize=n,o.setAttribute("width",n.x),o.setAttribute("height",n.y)),Ot(o,e.min),o.setAttribute("viewBox",[e.min.x,e.min.y,n.x,n.y].join(" ")),this.fire("update")}},_initPath:function(e){var n=e._path=c("path");e.options.className&&je(n,e.options.className),e.options.interactive&&je(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){ut(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,o=e.options;n&&(o.stroke?(n.setAttribute("stroke",o.color),n.setAttribute("stroke-opacity",o.opacity),n.setAttribute("stroke-width",o.weight),n.setAttribute("stroke-linecap",o.lineCap),n.setAttribute("stroke-linejoin",o.lineJoin),o.dashArray?n.setAttribute("stroke-dasharray",o.dashArray):n.removeAttribute("stroke-dasharray"),o.dashOffset?n.setAttribute("stroke-dashoffset",o.dashOffset):n.removeAttribute("stroke-dashoffset")):n.setAttribute("stroke","none"),o.fill?(n.setAttribute("fill",o.fillColor||o.color),n.setAttribute("fill-opacity",o.fillOpacity),n.setAttribute("fill-rule",o.fillRule||"evenodd")):n.setAttribute("fill","none"))},_updatePoly:function(e,n){this._setPath(e,R(e._parts,n))},_updateCircle:function(e){var n=e._point,o=Math.max(Math.round(e._radius),1),r=Math.max(Math.round(e._radiusY),1)||o,d="a"+o+","+r+" 0 1,0 ",v=e._empty()?"M0 0":"M"+(n.x-o)+","+n.y+d+o*2+",0 "+d+-o*2+",0 ";this._setPath(e,v)},_setPath:function(e,n){e._path.setAttribute("d",n)},_bringToFront:function(e){Pn(e._path)},_bringToBack:function(e){jt(e._path)}});ve.vml&&H.include(g);function k(e){return ve.svg||ve.vml?new H(e):null}Xe.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&&ka(e)||k(e)}});var He=Rn.extend({initialize:function(e,n){Rn.prototype.initialize.call(this,this._boundsToLatLngs(e),n)},setBounds:function(e){return this.setLatLngs(this._boundsToLatLngs(e))},_boundsToLatLngs:function(e){return e=ot(e),[e.getSouthWest(),e.getNorthWest(),e.getNorthEast(),e.getSouthEast()]}});function id(e,n){return new He(e,n)}H.create=c,H.pointsToPath=R,xn.geometryToLayer=oi,xn.coordsToLatLng=si,xn.coordsToLatLngs=wi,xn.latLngToCoords=Ls,xn.latLngsToCoords=Go,xn.getFeature=tt,xn.asFeature=Mn,Xe.mergeOptions({boxZoom:!0});var _l=Ln.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(){$e(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Qe(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ut(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(),Dn(),Ni(),this._startPoint=this._map.mouseEventToContainerPoint(e),$e(document,{contextmenu:_i,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(e){this._moved||(this._moved=!0,this._box=lt("div","leaflet-zoom-box",this._container),je(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(e);var n=new Ue(this._point,this._startPoint),o=n.getSize();Ot(this._box,n.min),this._box.style.width=o.x+"px",this._box.style.height=o.y+"px"},_finish:function(){this._moved&&(ut(this._box),Mt(this._container,"leaflet-crosshair")),gi(),Di(),Qe(document,{contextmenu:_i,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 mt(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())}});Xe.addInitHook("addHandler","boxZoom",_l),Xe.mergeOptions({doubleClickZoom:!0});var bl=Ln.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,o=n.getZoom(),r=n.options.zoomDelta,d=e.originalEvent.shiftKey?o-r:o+r;n.options.doubleClickZoom==="center"?n.setZoom(d):n.setZoomAround(e.containerPoint,d)}});Xe.addInitHook("addHandler","doubleClickZoom",bl),Xe.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var yl=Ln.extend({addHooks:function(){if(!this._draggable){var e=this._map;this._draggable=new _n(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))}je(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){Mt(this._map._container,"leaflet-grab"),Mt(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=ot(this._map.options.maxBounds);this._offsetLimit=Ve(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,o=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(o),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),o=this._initialWorldOffset,r=this._draggable._newPos.x,d=(r-n+o)%e+n-o,v=(r+n+o)%e-n-o,P=Math.abs(d+o)0?v:-v))-n;this._delta=0,this._startTime=null,P&&(e.options.scrollWheelZoom==="center"?e.setZoom(n+P):e.setZoomAround(this._lastMousePos,n+P))}});Xe.addInitHook("addHandler","scrollWheelZoom",wl);var od=600;Xe.mergeOptions({tapHold:ve.touchNative&&ve.safari&&ve.mobile,tapTolerance:15});var kl=Ln.extend({addHooks:function(){$e(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Qe(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 ae(n.clientX,n.clientY),this._holdTimeout=setTimeout(h(function(){this._cancel(),this._isTapValid()&&($e(document,"touchend",Dt),$e(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",n))},this),od),$e(document,"touchend touchcancel contextmenu",this._cancel,this),$e(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function e(){Qe(document,"touchend",Dt),Qe(document,"touchend touchcancel",e)},_cancel:function(){clearTimeout(this._holdTimeout),Qe(document,"touchend touchcancel contextmenu",this._cancel,this),Qe(document,"touchmove",this._onMove,this)},_onMove:function(e){var n=e.touches[0];this._newPos=new ae(n.clientX,n.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(e,n){var o=new MouseEvent(e,{bubbles:!0,cancelable:!0,view:window,screenX:n.screenX,screenY:n.screenY,clientX:n.clientX,clientY:n.clientY});o._simulated=!0,n.target.dispatchEvent(o)}});Xe.addInitHook("addHandler","tapHold",kl),Xe.mergeOptions({touchZoom:ve.touch,bounceAtZoomLimits:!0});var Sl=Ln.extend({addHooks:function(){je(this._map._container,"leaflet-touch-zoom"),$e(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){Mt(this._map._container,"leaflet-touch-zoom"),Qe(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 o=n.mouseEventToContainerPoint(e.touches[0]),r=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(o.add(r)._divideBy(2))),this._startDist=o.distanceTo(r),this._startZoom=n.getZoom(),this._moved=!1,this._zooming=!0,n._stop(),$e(document,"touchmove",this._onTouchMove,this),$e(document,"touchend touchcancel",this._onTouchEnd,this),Dt(e)}},_onTouchMove:function(e){if(!(!e.touches||e.touches.length!==2||!this._zooming)){var n=this._map,o=n.mouseEventToContainerPoint(e.touches[0]),r=n.mouseEventToContainerPoint(e.touches[1]),d=o.distanceTo(r)/this._startDist;if(this._zoom=n.getScaleZoom(d,this._startZoom),!n.options.bounceAtZoomLimits&&(this._zoomn.getMaxZoom()&&d>1)&&(this._zoom=n._limitZoom(this._zoom)),n.options.touchZoom==="center"){if(this._center=this._startLatLng,d===1)return}else{var v=o._add(r)._divideBy(2)._subtract(this._centerPoint);if(d===1&&v.x===0&&v.y===0)return;this._center=n.unproject(n.project(this._pinchStartLatLng,this._zoom).subtract(v),this._zoom)}this._moved||(n._moveStart(!0,!1),this._moved=!0),ie(this._animRequest);var P=h(n._move,n,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=Me(P,this,!0),Dt(e)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,ie(this._animRequest),Qe(document,"touchmove",this._onTouchMove,this),Qe(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))}});Xe.addInitHook("addHandler","touchZoom",Sl),Xe.BoxZoom=_l,Xe.DoubleClickZoom=bl,Xe.Drag=yl,Xe.Keyboard=xl,Xe.ScrollWheelZoom=wl,Xe.TapHold=kl,Xe.TouchZoom=Sl,s.Bounds=Ue,s.Browser=ve,s.CRS=E,s.Canvas=Yo,s.Circle=ji,s.CircleMarker=xi,s.Class=re,s.Control=Xt,s.DivIcon=Ms,s.DivOverlay=It,s.DomEvent=Ui,s.DomUtil=Cn,s.Draggable=_n,s.Evented=de,s.FeatureGroup=yn,s.GeoJSON=xn,s.GridLayer=_o,s.Handler=Ln,s.Icon=Hi,s.ImageOverlay=fo,s.LatLng=Ce,s.LatLngBounds=mt,s.Layer=bn,s.LayerGroup=Jn,s.LineUtil=dr,s.Map=Xe,s.Marker=Wo,s.Mixin=rr,s.Path=ii,s.Point=ae,s.PolyUtil=lr,s.Polygon=Rn,s.Polyline=Qt,s.Popup=Bn,s.PosAnimation=oo,s.Projection=fr,s.Rectangle=He,s.Renderer=En,s.SVG=H,s.SVGOverlay=mo,s.TileLayer=Xn,s.Tooltip=vo,s.Transformation=bt,s.Util=Ke,s.VideoOverlay=ho,s.bind=h,s.bounds=Ve,s.canvas=ka,s.circle=Ft,s.circleMarker=co,s.control=ln,s.divIcon=xa,s.extend=u,s.featureGroup=Ps,s.geoJSON=qo,s.geoJson=gr,s.gridLayer=br,s.icon=pr,s.imageOverlay=vr,s.latLng=J,s.latLngBounds=ot,s.layerGroup=lo,s.map=Vo,s.marker=mr,s.point=pe,s.polygon=ya,s.polyline=Ko,s.popup=As,s.rectangle=id,s.setOptions=F,s.stamp=y,s.svg=k,s.svgOverlay=go,s.tileLayer=wa,s.tooltip=_r,s.transformation=x,s.version=l,s.videoOverlay=po;var sd=window.L;s.noConflict=function(){return window.L=sd,this},window.L=s}))})(Fs,Fs.exports)),Fs.exports}var cm=um();const Gi=rm(cm),Pu={__name:"DeviceMap",props:{position:{type:Object,default:null},trail:{type:Array,default:()=>[]},aircraft:{type:Array,default:()=>[]}},setup(t){const i=t,s=W(null);let l,u,f,h;const _=new Map;function y(K,F){const me=getComputedStyle(document.documentElement).getPropertyValue("--accent").trim()||"#3D7BF0",he=F?"#8a94a6":me,Y=typeof K=="number"?K:0;return Gi.divIcon({className:"plane-marker",iconSize:[22,22],iconAnchor:[11,11],html:``})}function C(K){const me=[`${K.callsign||K.icao24||"aircraft"}`];return K.country&&me.push(K.country),typeof K.altitude=="number"&&me.push(`${Math.round(K.altitude)} m`),typeof K.velocity=="number"&&me.push(`${Math.round(K.velocity*3.6)} km/h`),K.onGround&&me.push("on ground"),me.join(" · ")}function T(){if(!l)return;h||(h=Gi.layerGroup().addTo(l));const K=new Set;for(const F of i.aircraft){if(typeof F.lat!="number"||typeof F.lng!="number")continue;K.add(F.icao24);const me=[F.lat,F.lng];let he=_.get(F.icao24);he?(he.setLatLng(me),he.setIcon(y(F.heading,F.onGround)),he.setTooltipContent(C(F))):(he=Gi.marker(me,{icon:y(F.heading,F.onGround)}).bindTooltip(C(F)),he.addTo(h),_.set(F.icao24,he))}for(const[F,me]of _)K.has(F)||(h.removeLayer(me),_.delete(F))}function M(){if(!l)return;const K=i.position;if(K&&(K.lat||K.lng)){const F=[K.lat,K.lng];u?u.setLatLng(F):(u=Gi.marker(F).addTo(l),l.setView(F,17))}if(f&&f.remove(),i.trail.length){const F=getComputedStyle(document.documentElement).getPropertyValue("--accent").trim()||"#3D7BF0";f=Gi.polyline(i.trail,{color:F,weight:3}).addTo(l)}}Ei(()=>{l=Gi.map(s.value,{zoomControl:!0}).setView([20,0],2),Gi.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:"© OpenStreetMap",maxZoom:19}).addTo(l),setTimeout(()=>l.invalidateSize(),60),M(),T(),(!i.position||!i.position.lat&&!i.position.lng)&&i.aircraft.length&&V()});let U=!1;function V(){if(U||!l||!i.aircraft.length)return;const K=i.aircraft.filter(F=>typeof F.lat=="number"&&typeof F.lng=="number").map(F=>[F.lat,F.lng]);K.length&&(l.fitBounds(Gi.latLngBounds(K).pad(.2)),U=!0)}return us(()=>{l&&l.remove(),l=null}),Rt(()=>i.position,M,{deep:!0}),Rt(()=>i.trail,M,{deep:!0}),Rt(()=>i.aircraft,()=>{T(),(!i.position||!i.position.lat&&!i.position.lng)&&V()},{deep:!0}),(K,F)=>(p(),m("div",{ref_key:"el",ref:s,class:"h-[320px] w-full rounded-lg"},null,512))}},dm=["width","height","stroke-width"],fm=["d"],G={__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",eye:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7z M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",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,f)=>f?"M"+u:u);return(u,f)=>(p(),m("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"},[(p(!0),m(oe,null,Fe(Oe(l),(h,_)=>(p(),m("path",{key:_,d:h},null,8,fm))),128))],8,dm))}},hm=["aria-checked","disabled"],en={__name:"Toggle",props:{modelValue:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:i}){const s=i;return(l,u)=>(p(),m("button",{type:"button",role:"switch","aria-checked":t.modelValue,disabled:t.disabled,class:Ae(["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]=f=>s("update:modelValue",!t.modelValue))},[a("span",{class:Ae(["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,hm))}},pm={class:"inline-flex rounded-[10px] border border-line bg-surface-2 p-0.5"},mm=["onClick"],kn={__name:"Segmented",props:{modelValue:{type:[String,Number],default:""},options:{type:Array,default:()=>[]}},emits:["update:modelValue"],setup(t,{emit:i}){const s=i;return(l,u)=>(p(),m("div",pm,[(p(!0),m(oe,null,Fe(t.options,f=>(p(),m("button",{key:f.value,type:"button",class:Ae(["inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-[13px] font-semibold transition",t.modelValue===f.value?"bg-surface-1 text-ink shadow-xs":"text-ink-secondary hover:text-ink"]),onClick:h=>s("update:modelValue",f.value)},[f.icon?(p(),at(G,{key:0,name:f.icon,size:15},null,8,["name"])):$("",!0),z(" "+w(f.label),1)],10,mm))),128))]))}},gm={class:"text-sm font-semibold text-ink"},vm={key:0,class:"mt-0.5 text-xs text-ink-muted"},ke={__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,s=Vs("settingsSearch",{value:""}),l=ue(()=>{const u=(s.value||"").trim().toLowerCase();return u?`${i.title} ${i.desc} ${i.keywords}`.toLowerCase().includes(u):!0});return(u,f)=>l.value?(p(),m("div",{key:0,class:Ae(["border-b border-line py-4 last:border-0",t.block?"":"flex items-center justify-between gap-6"])},[a("div",{class:Ae(t.block?"mb-3":"min-w-0")},[a("div",gm,w(t.title),1),t.desc?(p(),m("div",vm,w(t.desc),1)):$("",!0)],2),a("div",{class:Ae(t.block?"":"shrink-0")},[Tf(u.$slots,"default")],2)],2)):$("",!0)}},ia=[{code:"AL",name:"Albania",continent:"EU",bbox:"39.6,19.3,42.7,21.1"},{code:"AD",name:"Andorra",continent:"EU",bbox:"42.4,1.4,42.7,1.8"},{code:"AT",name:"Austria",continent:"EU",bbox:"46.4,9.5,49.0,17.2"},{code:"BY",name:"Belarus",continent:"EU",bbox:"51.2,23.2,56.2,32.8"},{code:"BE",name:"Belgium",continent:"EU",bbox:"49.5,2.5,51.5,6.4"},{code:"BA",name:"Bosnia and Herzegovina",continent:"EU",bbox:"42.6,15.7,45.3,19.6"},{code:"BG",name:"Bulgaria",continent:"EU",bbox:"41.2,22.4,44.2,28.6"},{code:"HR",name:"Croatia",continent:"EU",bbox:"42.4,13.5,46.6,19.4"},{code:"CY",name:"Cyprus",continent:"EU",bbox:"34.6,32.3,35.7,34.6"},{code:"CZ",name:"Czechia",continent:"EU",bbox:"48.6,12.1,51.1,18.9"},{code:"DK",name:"Denmark",continent:"EU",bbox:"54.6,8.1,57.8,12.7"},{code:"EE",name:"Estonia",continent:"EU",bbox:"57.5,21.8,59.7,28.2"},{code:"FI",name:"Finland",continent:"EU",bbox:"59.8,20.6,70.1,31.6"},{code:"FR",name:"France",continent:"EU",bbox:"41.3,-5.2,51.1,9.6"},{code:"DE",name:"Germany",continent:"EU",bbox:"47.2,5.8,55.1,15.1"},{code:"GR",name:"Greece",continent:"EU",bbox:"34.8,19.4,41.8,28.3"},{code:"HU",name:"Hungary",continent:"EU",bbox:"45.7,16.1,48.6,22.9"},{code:"IS",name:"Iceland",continent:"EU",bbox:"63.3,-24.6,66.6,-13.5"},{code:"IE",name:"Ireland",continent:"EU",bbox:"51.4,-10.6,55.4,-6.0"},{code:"IT",name:"Italy",continent:"EU",bbox:"36.6,6.6,47.1,18.6"},{code:"XK",name:"Kosovo",continent:"EU",bbox:"41.8,20.0,43.3,21.8"},{code:"LV",name:"Latvia",continent:"EU",bbox:"55.7,20.9,58.1,28.2"},{code:"LI",name:"Liechtenstein",continent:"EU",bbox:"47.0,9.4,47.3,9.6"},{code:"LT",name:"Lithuania",continent:"EU",bbox:"53.9,20.9,56.5,26.9"},{code:"LU",name:"Luxembourg",continent:"EU",bbox:"49.4,5.7,50.2,6.5"},{code:"MT",name:"Malta",continent:"EU",bbox:"35.8,14.1,36.1,14.6"},{code:"MD",name:"Moldova",continent:"EU",bbox:"45.4,26.6,48.5,30.2"},{code:"MC",name:"Monaco",continent:"EU",bbox:"43.72,7.40,43.75,7.44"},{code:"ME",name:"Montenegro",continent:"EU",bbox:"41.8,18.4,43.6,20.4"},{code:"NL",name:"Netherlands",continent:"EU",bbox:"50.7,3.3,53.7,7.2"},{code:"MK",name:"North Macedonia",continent:"EU",bbox:"40.8,20.4,42.4,23.0"},{code:"NO",name:"Norway",continent:"EU",bbox:"57.9,4.6,71.2,31.1"},{code:"PL",name:"Poland",continent:"EU",bbox:"49.0,14.1,54.9,24.2"},{code:"PT",name:"Portugal",continent:"EU",bbox:"36.9,-9.5,42.2,-6.2"},{code:"RO",name:"Romania",continent:"EU",bbox:"43.6,20.2,48.3,29.7"},{code:"SM",name:"San Marino",continent:"EU",bbox:"43.89,12.40,43.99,12.52"},{code:"RS",name:"Serbia",continent:"EU",bbox:"42.2,18.8,46.2,23.0"},{code:"SK",name:"Slovakia",continent:"EU",bbox:"47.7,16.8,49.6,22.6"},{code:"SI",name:"Slovenia",continent:"EU",bbox:"45.4,13.4,46.9,16.6"},{code:"ES",name:"Spain",continent:"EU",bbox:"35.9,-9.4,43.8,3.4"},{code:"SE",name:"Sweden",continent:"EU",bbox:"55.3,11.1,69.1,24.2"},{code:"CH",name:"Switzerland",continent:"EU",bbox:"45.8,5.9,47.8,10.5"},{code:"UA",name:"Ukraine",continent:"EU",bbox:"44.4,22.1,52.4,40.2"},{code:"GB",name:"United Kingdom",continent:"EU",bbox:"49.9,-8.7,60.9,1.8"},{code:"VA",name:"Vatican City",continent:"EU",bbox:"41.900,12.445,41.908,12.458"},{code:"RU",name:"Russia",continent:"EU",bbox:"41.2,19.6,81.9,180"},{code:"TR",name:"Turkey",continent:"EU",bbox:"35.8,25.7,42.3,44.8"},{code:"AF",name:"Afghanistan",continent:"AS",bbox:"29.4,60.5,38.5,74.9"},{code:"AM",name:"Armenia",continent:"AS",bbox:"38.8,43.4,41.3,46.6"},{code:"AZ",name:"Azerbaijan",continent:"AS",bbox:"38.4,44.8,41.9,50.4"},{code:"BH",name:"Bahrain",continent:"AS",bbox:"25.8,50.4,26.3,50.7"},{code:"BD",name:"Bangladesh",continent:"AS",bbox:"20.7,88.0,26.6,92.7"},{code:"BT",name:"Bhutan",continent:"AS",bbox:"26.7,88.7,28.3,92.1"},{code:"BN",name:"Brunei",continent:"AS",bbox:"4.0,114.0,5.1,115.4"},{code:"KH",name:"Cambodia",continent:"AS",bbox:"10.4,102.3,14.7,107.6"},{code:"CN",name:"China",continent:"AS",bbox:"18.2,73.5,53.6,134.8"},{code:"GE",name:"Georgia",continent:"AS",bbox:"41.0,40.0,43.6,46.7"},{code:"IN",name:"India",continent:"AS",bbox:"6.7,68.1,35.5,97.4"},{code:"ID",name:"Indonesia",continent:"AS",bbox:"-11.0,95.0,6.1,141.0"},{code:"IR",name:"Iran",continent:"AS",bbox:"25.0,44.0,39.8,63.3"},{code:"IQ",name:"Iraq",continent:"AS",bbox:"29.1,38.8,37.4,48.6"},{code:"IL",name:"Israel",continent:"AS",bbox:"29.5,34.2,33.3,35.9"},{code:"JP",name:"Japan",continent:"AS",bbox:"24.0,122.9,45.5,145.8"},{code:"JO",name:"Jordan",continent:"AS",bbox:"29.2,34.9,33.4,39.3"},{code:"KZ",name:"Kazakhstan",continent:"AS",bbox:"40.6,46.5,55.4,87.3"},{code:"KW",name:"Kuwait",continent:"AS",bbox:"28.5,46.5,30.1,48.4"},{code:"KG",name:"Kyrgyzstan",continent:"AS",bbox:"39.2,69.3,43.3,80.3"},{code:"LA",name:"Laos",continent:"AS",bbox:"13.9,100.1,22.5,107.7"},{code:"LB",name:"Lebanon",continent:"AS",bbox:"33.0,35.1,34.7,36.6"},{code:"MY",name:"Malaysia",continent:"AS",bbox:"0.9,99.6,7.4,119.3"},{code:"MV",name:"Maldives",continent:"AS",bbox:"-0.7,72.7,7.1,73.7"},{code:"MN",name:"Mongolia",continent:"AS",bbox:"41.6,87.7,52.1,119.9"},{code:"MM",name:"Myanmar",continent:"AS",bbox:"9.8,92.2,28.5,101.2"},{code:"NP",name:"Nepal",continent:"AS",bbox:"26.3,80.1,30.4,88.2"},{code:"KP",name:"North Korea",continent:"AS",bbox:"37.7,124.2,43.0,130.7"},{code:"OM",name:"Oman",continent:"AS",bbox:"16.6,52.0,26.4,59.8"},{code:"PK",name:"Pakistan",continent:"AS",bbox:"23.7,60.9,37.1,77.8"},{code:"PH",name:"Philippines",continent:"AS",bbox:"4.6,116.9,21.1,126.6"},{code:"QA",name:"Qatar",continent:"AS",bbox:"24.5,50.7,26.2,51.6"},{code:"SA",name:"Saudi Arabia",continent:"AS",bbox:"16.4,34.6,32.2,55.7"},{code:"SG",name:"Singapore",continent:"AS",bbox:"1.2,103.6,1.5,104.1"},{code:"KR",name:"South Korea",continent:"AS",bbox:"33.1,125.9,38.6,129.6"},{code:"LK",name:"Sri Lanka",continent:"AS",bbox:"5.9,79.7,9.8,81.9"},{code:"SY",name:"Syria",continent:"AS",bbox:"32.3,35.7,37.3,42.4"},{code:"TW",name:"Taiwan",continent:"AS",bbox:"21.9,120.0,25.3,122.0"},{code:"TJ",name:"Tajikistan",continent:"AS",bbox:"36.7,67.4,41.0,75.2"},{code:"TH",name:"Thailand",continent:"AS",bbox:"5.6,97.3,20.5,105.6"},{code:"TL",name:"Timor-Leste",continent:"AS",bbox:"-9.5,124.0,-8.1,127.3"},{code:"TM",name:"Turkmenistan",continent:"AS",bbox:"35.1,52.4,42.8,66.7"},{code:"AE",name:"United Arab Emirates",continent:"AS",bbox:"22.6,51.5,26.1,56.4"},{code:"UZ",name:"Uzbekistan",continent:"AS",bbox:"37.2,55.9,45.6,73.1"},{code:"VN",name:"Vietnam",continent:"AS",bbox:"8.2,102.1,23.4,109.5"},{code:"YE",name:"Yemen",continent:"AS",bbox:"12.1,42.5,19.0,54.5"},{code:"DZ",name:"Algeria",continent:"AF",bbox:"18.9,-8.7,37.1,12.0"},{code:"AO",name:"Angola",continent:"AF",bbox:"-18.0,11.6,-4.4,24.1"},{code:"BJ",name:"Benin",continent:"AF",bbox:"6.2,0.8,12.4,3.9"},{code:"BW",name:"Botswana",continent:"AF",bbox:"-26.9,20.0,-17.8,29.4"},{code:"BF",name:"Burkina Faso",continent:"AF",bbox:"9.4,-5.5,15.1,2.4"},{code:"BI",name:"Burundi",continent:"AF",bbox:"-4.5,29.0,-2.3,30.8"},{code:"CV",name:"Cabo Verde",continent:"AF",bbox:"14.8,-25.4,17.2,-22.7"},{code:"CM",name:"Cameroon",continent:"AF",bbox:"1.7,8.5,13.1,16.2"},{code:"CF",name:"Central African Republic",continent:"AF",bbox:"2.2,14.4,11.0,27.5"},{code:"TD",name:"Chad",continent:"AF",bbox:"7.4,13.5,23.4,24.0"},{code:"KM",name:"Comoros",continent:"AF",bbox:"-12.4,43.2,-11.4,44.5"},{code:"CG",name:"Congo",continent:"AF",bbox:"-5.0,11.1,3.7,18.6"},{code:"CD",name:"DR Congo",continent:"AF",bbox:"-13.5,12.2,5.4,31.3"},{code:"DJ",name:"Djibouti",continent:"AF",bbox:"10.9,41.7,12.7,43.4"},{code:"EG",name:"Egypt",continent:"AF",bbox:"22.0,25.0,31.7,36.9"},{code:"GQ",name:"Equatorial Guinea",continent:"AF",bbox:"0.9,9.3,3.8,11.4"},{code:"ER",name:"Eritrea",continent:"AF",bbox:"12.4,36.4,18.0,43.1"},{code:"SZ",name:"Eswatini",continent:"AF",bbox:"-27.3,30.8,-25.7,32.1"},{code:"ET",name:"Ethiopia",continent:"AF",bbox:"3.4,33.0,14.9,48.0"},{code:"GA",name:"Gabon",continent:"AF",bbox:"-4.0,8.7,2.3,14.5"},{code:"GM",name:"Gambia",continent:"AF",bbox:"13.1,-16.8,13.8,-13.8"},{code:"GH",name:"Ghana",continent:"AF",bbox:"4.7,-3.3,11.2,1.2"},{code:"GN",name:"Guinea",continent:"AF",bbox:"7.2,-15.1,12.7,-7.6"},{code:"GW",name:"Guinea-Bissau",continent:"AF",bbox:"10.9,-16.7,12.7,-13.6"},{code:"CI",name:"Ivory Coast",continent:"AF",bbox:"4.4,-8.6,10.7,-2.5"},{code:"KE",name:"Kenya",continent:"AF",bbox:"-4.7,33.9,5.5,41.9"},{code:"LS",name:"Lesotho",continent:"AF",bbox:"-30.7,27.0,-28.6,29.5"},{code:"LR",name:"Liberia",continent:"AF",bbox:"4.3,-11.5,8.6,-7.4"},{code:"LY",name:"Libya",continent:"AF",bbox:"19.5,9.3,33.2,25.2"},{code:"MG",name:"Madagascar",continent:"AF",bbox:"-25.6,43.2,-11.9,50.5"},{code:"MW",name:"Malawi",continent:"AF",bbox:"-17.1,32.7,-9.4,35.9"},{code:"ML",name:"Mali",continent:"AF",bbox:"10.1,-12.3,25.0,4.3"},{code:"MR",name:"Mauritania",continent:"AF",bbox:"14.7,-17.1,27.3,-4.8"},{code:"MU",name:"Mauritius",continent:"AF",bbox:"-20.5,57.3,-19.9,57.8"},{code:"MA",name:"Morocco",continent:"AF",bbox:"27.7,-13.2,35.9,-1.0"},{code:"MZ",name:"Mozambique",continent:"AF",bbox:"-26.9,30.2,-10.5,40.8"},{code:"NA",name:"Namibia",continent:"AF",bbox:"-28.9,11.7,-16.9,25.3"},{code:"NE",name:"Niger",continent:"AF",bbox:"11.7,0.2,23.5,16.0"},{code:"NG",name:"Nigeria",continent:"AF",bbox:"4.3,2.7,13.9,14.7"},{code:"RW",name:"Rwanda",continent:"AF",bbox:"-2.8,28.9,-1.1,30.9"},{code:"SN",name:"Senegal",continent:"AF",bbox:"12.3,-17.5,16.7,-11.4"},{code:"SL",name:"Sierra Leone",continent:"AF",bbox:"6.9,-13.3,10.0,-10.3"},{code:"SO",name:"Somalia",continent:"AF",bbox:"-1.7,40.9,12.0,51.4"},{code:"ZA",name:"South Africa",continent:"AF",bbox:"-34.8,16.5,-22.1,32.9"},{code:"SS",name:"South Sudan",continent:"AF",bbox:"3.5,24.1,12.2,35.9"},{code:"SD",name:"Sudan",continent:"AF",bbox:"8.7,21.8,22.2,38.6"},{code:"TZ",name:"Tanzania",continent:"AF",bbox:"-11.7,29.3,-1.0,40.4"},{code:"TG",name:"Togo",continent:"AF",bbox:"6.1,-0.1,11.1,1.8"},{code:"TN",name:"Tunisia",continent:"AF",bbox:"30.2,7.5,37.5,11.6"},{code:"UG",name:"Uganda",continent:"AF",bbox:"-1.5,29.6,4.2,35.0"},{code:"ZM",name:"Zambia",continent:"AF",bbox:"-18.1,21.9,-8.2,33.7"},{code:"ZW",name:"Zimbabwe",continent:"AF",bbox:"-22.4,25.2,-15.6,33.1"},{code:"CA",name:"Canada",continent:"NA",bbox:"41.7,-141.0,83.1,-52.6"},{code:"US",name:"United States",continent:"NA",bbox:"24.4,-125.0,49.4,-66.9"},{code:"MX",name:"Mexico",continent:"NA",bbox:"14.5,-118.4,32.7,-86.7"},{code:"GT",name:"Guatemala",continent:"NA",bbox:"13.7,-92.2,17.8,-88.2"},{code:"BZ",name:"Belize",continent:"NA",bbox:"15.9,-89.2,18.5,-87.8"},{code:"SV",name:"El Salvador",continent:"NA",bbox:"13.1,-90.1,14.4,-87.7"},{code:"HN",name:"Honduras",continent:"NA",bbox:"12.9,-89.4,16.5,-83.1"},{code:"NI",name:"Nicaragua",continent:"NA",bbox:"10.7,-87.7,15.0,-83.1"},{code:"CR",name:"Costa Rica",continent:"NA",bbox:"8.0,-85.9,11.2,-82.5"},{code:"PA",name:"Panama",continent:"NA",bbox:"7.2,-83.1,9.6,-77.2"},{code:"CU",name:"Cuba",continent:"NA",bbox:"19.8,-85.0,23.3,-74.1"},{code:"DO",name:"Dominican Republic",continent:"NA",bbox:"17.5,-72.0,19.9,-68.3"},{code:"HT",name:"Haiti",continent:"NA",bbox:"18.0,-74.5,20.1,-71.6"},{code:"JM",name:"Jamaica",continent:"NA",bbox:"17.7,-78.4,18.5,-76.2"},{code:"BS",name:"Bahamas",continent:"NA",bbox:"20.9,-79.0,27.3,-72.7"},{code:"TT",name:"Trinidad and Tobago",continent:"NA",bbox:"10.0,-61.9,11.4,-60.5"},{code:"AR",name:"Argentina",continent:"SA",bbox:"-55.1,-73.6,-21.8,-53.6"},{code:"BO",name:"Bolivia",continent:"SA",bbox:"-22.9,-69.6,-9.7,-57.5"},{code:"BR",name:"Brazil",continent:"SA",bbox:"-33.8,-74.0,5.3,-34.8"},{code:"CL",name:"Chile",continent:"SA",bbox:"-55.9,-75.6,-17.5,-66.4"},{code:"CO",name:"Colombia",continent:"SA",bbox:"-4.2,-79.0,12.5,-66.9"},{code:"EC",name:"Ecuador",continent:"SA",bbox:"-5.0,-81.1,1.4,-75.2"},{code:"GY",name:"Guyana",continent:"SA",bbox:"1.2,-61.4,8.6,-56.5"},{code:"PY",name:"Paraguay",continent:"SA",bbox:"-27.6,-62.6,-19.3,-54.3"},{code:"PE",name:"Peru",continent:"SA",bbox:"-18.4,-81.3,0.0,-68.7"},{code:"SR",name:"Suriname",continent:"SA",bbox:"1.8,-58.1,6.0,-54.0"},{code:"UY",name:"Uruguay",continent:"SA",bbox:"-35.0,-58.4,-30.1,-53.1"},{code:"VE",name:"Venezuela",continent:"SA",bbox:"0.6,-73.4,12.2,-59.8"},{code:"AU",name:"Australia",continent:"OC",bbox:"-43.6,113.3,-10.7,153.6"},{code:"NZ",name:"New Zealand",continent:"OC",bbox:"-47.3,166.4,-34.4,178.6"},{code:"PG",name:"Papua New Guinea",continent:"OC",bbox:"-11.7,140.8,-1.3,155.9"},{code:"FJ",name:"Fiji",continent:"OC",bbox:"-19.2,177.0,-16.0,180.0"}],_m=new Map(ia.map(t=>[t.code,t]));function bm(t){const i=String(t||"").split(",").map(s=>Number(s.trim()));return i.length!==4||i.some(s=>Number.isNaN(s))?null:i}function ym(t){const i=_m.get(t);return i?i.bbox:""}function Ir(t,i){if(typeof t!="number"||typeof i!="number"||Number.isNaN(t)||Number.isNaN(i))return null;let s=null,l=1/0;for(const u of ia){const f=bm(u.bbox);if(!f)continue;const[h,_,y,C]=f;if(ty||i<_||i>C)continue;const T=Math.abs(y-h)*Math.abs(C-_);Tt.continent==="EU").slice().sort((t,i)=>t.name.localeCompare(i.name)).map(t=>({value:t.bbox,label:t.name}))}function wm(){return ia.slice().sort((t,i)=>t.name.localeCompare(i.name)).map(t=>[t.code,t.name])}const km=[["EU","European countries"],["AS","Asian countries"],["AF","African countries"],["NA","North American countries"],["SA","South American countries"],["OC","Oceanian countries"]];function Sm(){return km.map(([t,i])=>({label:i,options:ia.filter(s=>s.continent===t).slice().sort((s,l)=>s.name.localeCompare(l.name)).map(s=>({value:s.bbox,label:s.name}))}))}const Tm=(t,i)=>{const s=t.__vccOpts||t;for(const[l,u]of i)s[l]=u;return s},Pm={class:"mx-auto max-w-[1280px] p-7"},Cm={class:"mb-5 flex flex-wrap items-end justify-between gap-4"},Lm={class:"flex h-10 w-full max-w-[280px] items-center gap-2 rounded border border-line-strong bg-surface-1 px-3"},Am={class:"grid grid-cols-[210px_1fr] gap-6 max-[760px]:grid-cols-1"},Mm={class:"flex flex-col gap-0.5 max-[760px]:flex-row max-[760px]:overflow-x-auto"},Em=["onClick"],Om={class:"whitespace-nowrap"},zm={class:"min-w-0"},Im={key:0,class:"panel p-10 text-center text-sm text-ink-muted"},$m={key:0,class:"eyebrow mb-2 mt-5 first:mt-0 flex items-center gap-2"},Nm={key:1,class:"panel mb-5 p-5"},Dm={class:"flex items-center gap-1"},Fm={class:"flex items-center gap-2"},Rm={class:"font-mono text-sm text-ink"},Bm={class:"inline-flex items-center gap-1 rounded-full bg-amber-soft px-2 py-0.5 text-[11px] font-semibold text-amber-fg"},Um={key:0,class:"mt-2 text-xs text-ink-muted"},Vm={class:"grid max-w-[420px] gap-2"},Zm={class:"flex items-center gap-3"},Hm={key:2,class:"panel mb-5 p-5"},jm=["value"],Wm=["value"],Km=["value"],Gm={class:"font-mono text-sm text-ink"},qm={key:3},Ym={key:0,class:"mb-5 flex items-center gap-1 overflow-x-auto border-b border-line"},Jm=["onClick"],Xm={class:"panel mb-5 p-5"},Qm={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},eg={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},tg={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},ng={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"},ig={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},og={key:0},sg={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},ag={class:"font-semibold text-ink-secondary"},rg={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},lg={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"},ug={class:"flex items-center justify-between gap-3"},cg={class:"flex items-center gap-2 text-sm font-semibold text-ink"},dg={key:0,class:"text-[11px] text-ink-muted"},fg={class:"mt-2 flex items-baseline gap-1.5"},hg={class:"font-mono text-2xl font-semibold text-ink"},pg={class:"text-sm text-ink-muted"},mg={class:"mt-2 h-2 w-full overflow-hidden rounded-full bg-line"},gg={class:"mt-2 text-xs text-ink-muted"},vg={class:"mt-2 text-sm text-ink"},_g={class:"font-semibold"},bg={class:"mt-1 text-xs text-ink-muted"},yg={key:1,class:"mt-2 text-xs text-ink-muted"},xg={key:0,class:"inline-flex items-center gap-2 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"},Tg={key:1,class:"flex flex-col items-end gap-2"},Pg={key:0,value:"__auto__"},Cg=["label"],Lg=["value"],Ag={key:0,class:"w-64 text-right text-[11px] leading-snug text-ink-muted"},Mg={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"},Og={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},zg={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:8,class:"border-b border-line py-3 text-xs text-amber-fg"},$g={class:"mt-4 flex flex-wrap items-center gap-3"},Ng=["disabled"],Dg={key:1,class:"flex items-center gap-2",title:"Bounding box used for Test connection — smaller areas cost fewer OpenSky credits"},Fg=["label"],Rg=["value"],Bg=["disabled"],Ug={key:3,class:"text-xs text-danger-fg"},Vg={class:"panel mb-5 p-5"},Zg={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},Hg={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},jg={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},Wg={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"},Kg={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},Gg={key:0},qg={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},Yg={class:"font-semibold text-ink-secondary"},Jg={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},Xg={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"},ev={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},tv={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"},nv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},iv={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"},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"},av={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},rv={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"},lv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},uv={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"},cv={key:7,class:"my-4 rounded-lg border border-line bg-surface-2 p-4","data-keywords":"usage quota rate limit calls per minute remaining left api"},dv={class:"flex items-center justify-between gap-3"},fv={class:"flex items-center gap-2 text-sm font-semibold text-ink"},hv={key:0,class:"text-[11px] text-ink-muted"},pv={class:"mt-2 flex items-baseline gap-1.5"},mv={class:"font-mono text-2xl font-semibold text-ink"},gv={class:"text-sm text-ink-muted"},vv={key:0,class:"mt-2 h-2 w-full overflow-hidden rounded-full bg-line"},_v={class:"mt-2 text-xs text-ink-muted"},bv={key:1,class:"mt-2 text-xs text-ink-muted"},yv={class:"mt-4 flex flex-wrap items-center gap-3"},xv=["disabled"],wv=["disabled"],kv={key:2,class:"text-xs text-danger-fg"},Sv={key:3,class:"text-[11px] text-ink-muted"},Tv={class:"panel mb-5 p-5"},Pv={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},Cv={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},Lv={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},Av={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"},Mv={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},Ev={key:0},Ov={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},zv={class:"font-semibold text-ink-secondary"},Iv={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},$v={key:0,class:"inline-flex items-center gap-2 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"},Dv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Fv={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={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Bv={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"},Uv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Vv={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"},Zv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Hv={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"},jv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Wv={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"},Kv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Gv={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"},qv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Yv={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"},Jv={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},Xv={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"},Qv={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"},t_={class:"mt-4 flex flex-wrap items-center gap-3"},n_=["disabled"],i_=["disabled"],o_={key:2,class:"text-xs text-danger-fg"},s_={key:3,class:"text-[11px] text-ink-muted"},a_={class:"panel mb-5 p-5"},r_={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},l_={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},u_={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},c_={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"},d_={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},f_={key:0},h_={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},p_={class:"font-semibold text-ink-secondary"},m_={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},g_={key:0,class:"inline-flex items-center gap-2 break-all font-mono text-sm text-ink"},v_={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"},__={key:0,class:"inline-flex items-center gap-2 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"},y_={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},x_={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"},w_={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},k_={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"},S_={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},T_={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"},P_={class:"mt-4 flex flex-wrap items-center gap-3"},C_=["disabled"],L_=["disabled"],A_={key:2,class:"text-xs text-danger-fg"},M_={key:3,class:"text-[11px] text-ink-muted"},E_={key:3,class:"panel mb-5 p-5"},O_={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},z_={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},I_={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},$_={key:1,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},N_={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"},D_={key:5,class:"border-b border-line py-3 text-xs text-amber-fg"},F_={key:0},R_={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},B_={class:"font-semibold text-ink-secondary"},U_={key:7,class:"border-b border-line py-3 text-xs text-ink-muted"},V_={class:"flex w-full flex-col gap-2"},Z_={class:"break-all font-mono text-sm text-ink"},H_={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"},j_={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"},G_={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},q_={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"},Y_={class:"mt-4 flex flex-wrap items-center gap-3"},J_=["disabled"],X_=["disabled"],Q_={key:2,class:"text-xs text-danger-fg"},e1={key:3,class:"text-[11px] text-ink-muted"},t1={key:4,class:"panel mb-5 p-5"},n1={class:"flex items-center gap-4"},i1=["src"],o1={key:1,class:"grid h-16 w-16 place-items-center rounded-full bg-[var(--navy-800)] text-lg font-bold text-white"},s1={class:"flex gap-2"},a1={class:"btn-ghost cursor-pointer"},r1={class:"mt-1 text-right text-[11px] text-ink-muted"},l1={key:5,class:"panel mb-5 p-5"},u1={class:"flex items-center gap-3"},c1={key:0,class:"mt-4 rounded-lg border border-line bg-surface-2 p-4"},d1={class:"flex flex-wrap items-center gap-4"},f1={class:"min-w-0"},h1={class:"mt-1 select-all font-mono text-sm font-bold text-ink"},p1={class:"mt-3 flex items-center gap-2"},m1={key:0,class:"mt-2 text-xs text-danger-fg"},g1={key:1,class:"mt-4 rounded-lg border border-line bg-surface-2 p-4"},v1={class:"mt-2 grid grid-cols-2 gap-1 font-mono text-xs text-ink-secondary sm:grid-cols-4"},_1={class:"rounded-lg border border-line bg-surface-2 p-3"},b1={class:"flex items-center gap-3"},y1={class:"grid h-9 w-9 place-items-center rounded-full bg-accent-soft text-accent-soft-fg"},x1={class:"min-w-0 flex-1"},w1={class:"text-sm font-semibold text-ink"},k1={class:"font-mono text-[11px] text-ink-muted"},S1={key:6,class:"mb-5"},T1={key:0,class:"panel mb-5 p-5"},P1={class:"grid max-w-[520px] gap-2"},C1={class:"flex flex-wrap gap-2"},L1=["disabled","title"],A1=["value"],M1=["value"],E1={class:"flex items-center gap-2 py-1 text-sm text-ink-secondary"},O1={class:"flex items-center gap-3"},z1=["disabled"],I1={key:0,class:"text-xs text-danger-fg"},$1={key:1,class:"text-xs text-ink-muted"},N1={key:1,class:"panel mb-5 p-5"},D1={class:"grid max-w-[520px] gap-2"},F1={class:"flex flex-wrap gap-2"},R1=["value"],B1=["value"],U1={key:1,class:"text-xs text-ink-muted"},V1={class:"font-semibold text-ink-secondary"},Z1={class:"flex items-center gap-3"},H1=["disabled"],j1={key:0,class:"text-xs text-danger-fg"},W1={class:"panel overflow-hidden p-0"},K1={class:"flex items-center justify-between px-5 py-4"},G1=["disabled"],q1={key:0,class:"px-5 pb-5 text-sm text-danger-fg"},Y1={key:1,class:"px-5 pb-8 text-sm text-ink-muted"},J1={key:2,class:"overflow-x-auto"},X1={class:"w-full border-collapse text-sm"},Q1={class:"text-left"},eb={class:"px-5 py-3"},tb={class:"text-ink"},nb={key:0,class:"ml-1.5 text-[11px] text-ink-muted"},ib={class:"px-5 py-3"},ob={class:"px-5 py-3"},sb={class:"px-5 py-3"},ab={class:"px-5 py-3 text-right"},rb=["onClick"],lb={key:1,class:"inline-flex items-center gap-1.5"},ub=["onClick"],cb=["onClick"],db={key:7,class:"mb-5"},fb={key:0,class:"panel mb-5 p-5"},hb={class:"grid max-w-[520px] gap-2"},pb={class:"flex items-center gap-3"},mb={key:0,class:"text-xs text-danger-fg"},gb={key:1,class:"panel mb-5 p-5"},vb={class:"grid max-w-[520px] gap-2"},_b={class:"flex items-center gap-3"},bb=["disabled"],yb={key:0,class:"text-xs text-danger-fg"},xb={class:"panel overflow-hidden p-0"},wb={key:0,class:"px-5 pb-8 text-sm text-ink-muted"},kb={key:1,class:"overflow-x-auto"},Sb={class:"w-full border-collapse text-sm"},Tb={class:"text-left"},Pb={class:"px-5 py-3"},Cb={class:"inline-flex items-center gap-2 text-ink"},Lb={class:"px-5 py-3 text-ink-secondary"},Ab={class:"px-5 py-3 text-right"},Mb=["onClick"],Eb={key:1,class:"inline-flex items-center gap-1.5"},Ob=["onClick"],zb=["disabled","title","onClick"],Ib={key:8,class:"mb-5"},$b={class:"panel mb-5 p-5"},Nb={class:"btn-ghost cursor-pointer"},Db={key:0,class:"mt-2 text-xs text-ink-muted"},Fb={class:"rounded-lg border p-5",style:{"border-color":"color-mix(in srgb, var(--danger) 35%, transparent)",background:"var(--danger-soft)"}},Rb={class:"flex items-center gap-2 text-danger-fg"},Bb={class:"mt-4 rounded-lg border border-line bg-surface-1 p-4"},Ub={class:"mt-3 flex items-start gap-2 text-sm text-ink-secondary"},Vb={class:"mt-3"},Zb={class:"eyebrow mb-1 block"},Hb={class:"text-ink"},jb=["placeholder"],Wb={class:"mt-4 flex flex-wrap items-center gap-3"},Kb=["disabled"],Gb=["disabled"],qb={key:2,class:"text-xs text-ink-muted"},Yb={key:0,class:"mt-3 rounded border border-line bg-surface-2 px-3 py-2 text-xs text-ink-secondary"},Jb={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"},Cu="pv.opensky.health",Lu="pv.filetransfer.health",Au="pv.webdav.health",Mu="pv.openweather.health",Eu="pv.localstorage.health",Xb={__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 s=t,l=i,u=ue(()=>s.role==="superadmin"),f=ue(()=>s.role==="admin"||s.role==="superadmin");function h(g){return g==="superadmin"?"Superadmin":g==="admin"?"Admin":"User"}function _(g){return g==="superadmin"||g==="admin"?"shield":"user"}function y(g){return g==="superadmin"||g==="admin"?C.accent:C.neutral}const C={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"},T=ue(()=>{const g=[{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 openweather weather forecast temperature api key units calls per minute usage limit quota"},{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 f.value&&g.push({id:"team",label:"User management",icon:"users",kw:"users team members add remove create delete role admin permissions rights organization"}),u.value&&g.push({id:"organizations",label:"Organizations",icon:"grid",kw:"organization org tenant company create rename delete members"}),g.push({id:"advanced",label:"Advanced",icon:"alertTriangle",kw:"export import data delete account danger zone",danger:!0}),g}),M=W("account"),U=W("");lc("settingsSearch",U);const V=ue(()=>U.value.trim().length>0),K=ue(()=>U.value.trim().toLowerCase());function F(g){return K.value?(g.label+" "+g.kw).toLowerCase().includes(K.value)||he(g.id):!0}const me={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","openweather weather forecast","api key units metric imperial","default latitude longitude language","calls per minute limit usage quota","api call usage today rate limit"],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 he(g){return K.value?(me[g]||[]).some(c=>c.includes(K.value)):!0}const Y=ue(()=>V.value?T.value.filter(F):T.value.filter(g=>g.id===M.value)),Le=ue({get:()=>Eo.value,set:g=>Ha(g)}),ce=[{value:"light",label:"Light",icon:"sun"},{value:"dark",label:"Dark",icon:"moon"},{value:"system",label:"System",icon:"monitor"}],Be=[{value:"sm",label:"Small"},{value:"md",label:"Default"},{value:"lg",label:"Large"}],Ne=[{value:"12",label:"12-hour"},{value:"24",label:"24-hour"}],ze=[["en","English"],["es","Español"],["de","Deutsch"],["fr","Français"],["pl","Polski"],["ja","日本語"]],We=wm(),we=ue(()=>(We.find(([g])=>g===be.region)||[null,be.region])[1]),le=[["MDY","MM/DD/YYYY"],["DMY","DD/MM/YYYY"],["YMD","YYYY/MM/DD"],["ISO","YYYY-MM-DD"]],Me=W(Date.now());let ie=null;const Ke=ue(()=>ku(Me.value)),re=xt({loaded:!1,available:!1,orgEnabled:!0,allowAnonymous:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),qe=W("user"),fe=xt({clientId:"",clientSecret:"",plan:"",bbox:""}),de=W(""),ae=W(!1),Lt=W(!1),pe=W(null),Ue=W(null),Ve=ue(()=>pe.value&&pe.value.credits||null),mt=ue(()=>{const g=Ve.value;return!g||!g.daily||g.remaining==null?null:Math.max(0,Math.min(100,Math.round(g.remaining/g.daily*100)))}),ot=ue(()=>{const g=mt.value;return g==null?"bg-accent":g<=10?"bg-danger":g<=30?"bg-amber":"bg-success"});function Ce(g){return typeof g=="number"?g.toLocaleString():g}function J(){if(!Ue.value)return"";const g=Math.max(0,Math.round((Date.now()-Ue.value)/1e3));if(g<60)return"just now";const c=Math.round(g/60);if(c<60)return`${c} min ago`;const H=Math.round(c/60);return H<24?`${H} h ago`:`${Math.round(H/24)} d ago`}function E(){try{pe.value&&localStorage.setItem(Cu,JSON.stringify({health:pe.value,ts:Ue.value}))}catch{}}function I(){try{const g=localStorage.getItem(Cu);if(!g)return;const c=JSON.parse(g);c&&c.health&&(pe.value=c.health,Ue.value=c.ts||null)}catch{}}const gt=[{value:"",label:"Not set"},{value:"anonymous",label:"Anonymous"},{value:"standard",label:"Standard"},{value:"contributor",label:"Contributor"}],dt=[{value:"user",label:"My settings",icon:"user"},{value:"org",label:"Organization",icon:"users"}],bt=[{label:"World",options:[{value:"-90,-180,90,180",label:"World"}]},{label:"Continents",options:[{value:"34,-25,72,45",label:"Europe"},{value:"-35,-18,38,52",label:"Africa"},{value:"5,25,82,180",label:"Asia"},{value:"7,-168,72,-52",label:"North America"},{value:"-56,-82,13,-34",label:"South America"},{value:"-48,110,-10,180",label:"Oceania"}]},{label:"European countries",options:xm()},{label:"Other countries",options:[{value:"24,-125,49.5,-66.5",label:"United States"},{value:"41.7,-141,83.1,-52.6",label:"Canada"},{value:"-43.6,113.3,-10.7,153.6",label:"Australia"},{value:"24,122.9,45.5,145.8",label:"Japan"}]}],x=bt.flatMap(g=>g.options);function b(g){const c=String(g||"").split(",").map(k=>k.trim());if(c.length!==4)return"";const H=c.map(Number);return H.some(k=>Number.isNaN(k))?"":H.join(",")}function S(g){const c=b(g),H=c&&x.find(k=>b(k.value)===c);return H?H.label:""}const B=W(!1),R=ue({get(){if(!ge.value&&be.autoBbox)return"__auto__";if(B.value)return"__custom__";const g=b(fe.bbox),c=g&&x.find(H=>b(H.value)===g);return c?c.value:"__custom__"},set(g){if(g==="__auto__"){ge.value||(be.autoBbox=!0),B.value=!1;return}if(ge.value||(be.autoBbox=!1),g==="__custom__"){B.value=!0;return}B.value=!1,fe.bbox=g}}),Z=ue(()=>R.value==="__custom__"),se=ue(()=>R.value==="__auto__"),ne=ue(()=>re.isSuperadmin),ee=ue(()=>re.isSuperadmin?"user":qe.value),q=ue(()=>re.scopes[ee.value]||{editableLayer:"user",fields:{}}),ge=ue(()=>ee.value==="org");function te(g){return q.value.fields[g]||{effective:"",own:"",source:"unset",locked:!1}}function Se(g){return ne.value||te(g).locked}function Te(g){const c=te(g).source;return c==="global"?"Set by administrator":c==="org"?"Set by your organization":""}function Ze(){fe.clientId=te("clientId").own||"",fe.clientSecret=te("clientSecret").own||"",fe.plan=te("plan").own||"",fe.bbox=te("bbox").own||"",B.value=!1}function Ye(g){re.available=!!g.available,re.orgEnabled=g.orgEnabled!==!1,re.allowAnonymous=!!g.allowAnonymous,re.enabled=!!g.enabled,re.canEditOrg=!!g.canEditOrg,re.isSuperadmin=!!g.isSuperadmin,re.scopes=g.scopes||{},qe.value==="org"&&!re.canEditOrg&&(qe.value="user"),Ze(),re.loaded=!0}Rt(qe,()=>{de.value="",Ze()});async function st(){I();const{ok:g,body:c}=await hp();g&&Ye(c)}async function ft(g){const c=ge.value;c?re.orgEnabled=g:re.enabled=g;const{ok:H,body:k}=await _u(c?{scope:"org",enabled:g}:{scope:"user",enabled:g});H?(Ye(k),Je(c?g?"OpenSky enabled for your organization.":"OpenSky disabled for your organization.":g?"OpenSky enabled.":"OpenSky disabled.")):(c?re.orgEnabled=!g:re.enabled=!g,Je(k.error||"Could not update."))}async function Tt(){de.value="",ae.value=!0;const g={};for(const He of["clientId","clientSecret","plan","bbox"])Se(He)||(g[He]=fe[He]);const c={scope:ee.value,config:g};ge.value||(c.enabled=re.enabled);const{ok:H,body:k}=await _u(c);if(ae.value=!1,!H){de.value=k.error||"Could not save settings.";return}Ye(k),Je(ge.value?"Organization OpenSky settings saved.":"OpenSky settings saved.")}const Bt=[{label:"World",options:[{value:"-90,-180,90,180",label:"World"}]},{label:"Continents",options:[{value:"34,-25,72,45",label:"Europe"},{value:"-35,-18,38,52",label:"Africa"},{value:"5,25,82,180",label:"Asia"},{value:"7,-168,72,-52",label:"North America"},{value:"-56,-82,13,-34",label:"South America"},{value:"-48,110,-10,180",label:"Oceania"}]},...Sm()],Kt=Bt.flatMap(g=>g.options),Nt=W(""),pn=W(!1),Pt=ue({get(){if(pn.value)return"__custom__";if(!Nt.value)return"__default__";const g=b(Nt.value),c=g&&Kt.find(H=>b(H.value)===g);return c?c.value:"__custom__"},set(g){if(g==="__default__"){pn.value=!1,Nt.value="";return}if(g==="__custom__"){pn.value=!0;return}pn.value=!1,Nt.value=g}}),Gt=ue(()=>Pt.value==="__custom__");async function zn(){Lt.value=!0,pe.value=null;const{ok:g,body:c}=await pp((Nt.value||"").trim()||void 0);Lt.value=!1,pe.value=g&&c.health?c.health:{status:"down",detail:c.error||"Probe failed."},Ue.value=Date.now(),E()}function zi(g){return g==="ok"?C.success:g==="degraded"?C.warning:C.danger}const rt=xt({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),Kn=W("user"),In=["protocol","host","port","username","password","privateKey","keyPassphrase","hostKeyFingerprint","insecureSkipVerify","basePath"],ct=xt(Object.fromEntries(In.map(g=>[g,""]))),j=W(""),O=W(!1),Ie=W(!1),it=W(null),Et=W(null),mn=[{value:"sftp",label:"SFTP"},{value:"ftps",label:"FTPS"},{value:"ftp",label:"FTP"}],Ii=[{value:"false",label:"Verify certificate"},{value:"true",label:"Skip verification"}],Pe=ue(()=>rt.isSuperadmin),qt=ue(()=>rt.isSuperadmin?"user":Kn.value),Oo=ue(()=>rt.scopes[qt.value]||{editableLayer:"user",fields:{}}),$n=ue(()=>qt.value==="org"),an=ue(()=>(rn("protocol")?ve("protocol").effective:ct.protocol)||"sftp");function ve(g){return Oo.value.fields[g]||{effective:"",own:"",source:"unset",locked:!1}}function rn(g){return Pe.value||ve(g).locked}function At(g){const c=ve(g).source;return c==="global"?"Set by administrator":c==="org"?"Set by your organization":""}function oa(g){return(mn.find(c=>c.value===g)||{}).label||g||"—"}function cs(){for(const g of In)ct[g]=ve(g).own||"";ct.protocol||(ct.protocol="sftp"),ct.insecureSkipVerify||(ct.insecureSkipVerify="false")}function to(g){rt.available=!!g.available,rt.orgEnabled=g.orgEnabled!==!1,rt.enabled=!!g.enabled,rt.canEditOrg=!!g.canEditOrg,rt.isSuperadmin=!!g.isSuperadmin,rt.scopes=g.scopes||{},Kn.value==="org"&&!rt.canEditOrg&&(Kn.value="user"),cs(),rt.loaded=!0}Rt(Kn,()=>{j.value="",cs()});function sa(){if(!Et.value)return"";const g=Math.max(0,Math.round((Date.now()-Et.value)/1e3));if(g<60)return"just now";const c=Math.round(g/60);if(c<60)return`${c} min ago`;const H=Math.round(c/60);return H<24?`${H} h ago`:`${Math.round(H/24)} d ago`}function $i(){try{it.value&&localStorage.setItem(Lu,JSON.stringify({health:it.value,ts:Et.value}))}catch{}}function aa(){try{const g=localStorage.getItem(Lu);if(!g)return;const c=JSON.parse(g);c&&c.health&&(it.value=c.health,Et.value=c.ts||null)}catch{}}async function ir(){aa();const{ok:g,body:c}=await gp();g&&to(c)}async function ra(g){const c=$n.value;c?rt.orgEnabled=g:rt.enabled=g;const{ok:H,body:k}=await bu(c?{scope:"org",enabled:g}:{scope:"user",enabled:g});H?(to(k),Je(c?g?"File transfer enabled for your organization.":"File transfer disabled for your organization.":g?"File transfer enabled.":"File transfer disabled.")):(c?rt.orgEnabled=!g:rt.enabled=!g,Je(k.error||"Could not update."))}async function or(){j.value="",O.value=!0;const g={};for(const He of In)rn(He)||(g[He]=ct[He]);const c={scope:qt.value,config:g};$n.value||(c.enabled=rt.enabled);const{ok:H,body:k}=await bu(c);if(O.value=!1,!H){j.value=k.error||"Could not save settings.";return}to(k),Je($n.value?"Organization file-transfer settings saved.":"File-transfer settings saved.")}async function sr(){Ie.value=!0,it.value=null;const{ok:g,body:c}=await vp();Ie.value=!1,it.value=g&&c.health?c.health:{status:"down",detail:c.error||"Probe failed."},Et.value=Date.now(),$i()}function la(g){return g==="ok"?C.success:g==="degraded"?C.warning:C.danger}const ht=xt({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),Gn=W("user"),ds=["baseURL","username","password","insecureSkipVerify","basePath"],Yt=xt(Object.fromEntries(ds.map(g=>[g,""]))),no=W(""),zo=W(!1),Io=W(!1),Sn=W(null),Nn=W(null),ua=[{value:"false",label:"Verify certificate"},{value:"true",label:"Skip verification"}],$o=ue(()=>ht.isSuperadmin),pi=ue(()=>ht.isSuperadmin?"user":Gn.value),lt=ue(()=>ht.scopes[pi.value]||{editableLayer:"user",fields:{}}),ut=ue(()=>pi.value==="org");function Tn(g){return lt.value.fields[g]||{effective:"",own:"",source:"unset",locked:!1}}function Pn(g){return $o.value||Tn(g).locked}function jt(g){const c=Tn(g).source;return c==="global"?"Set by administrator":c==="org"?"Set by your organization":""}function No(){for(const g of ds)Yt[g]=Tn(g).own||"";Yt.insecureSkipVerify||(Yt.insecureSkipVerify="false")}function je(g){ht.available=!!g.available,ht.orgEnabled=g.orgEnabled!==!1,ht.enabled=!!g.enabled,ht.canEditOrg=!!g.canEditOrg,ht.isSuperadmin=!!g.isSuperadmin,ht.scopes=g.scopes||{},Gn.value==="org"&&!ht.canEditOrg&&(Gn.value="user"),No(),ht.loaded=!0}Rt(Gn,()=>{no.value="",No()});function Mt(){if(!Nn.value)return"";const g=Math.max(0,Math.round((Date.now()-Nn.value)/1e3));if(g<60)return"just now";const c=Math.round(g/60);if(c<60)return`${c} min ago`;const H=Math.round(c/60);return H<24?`${H} h ago`:`${Math.round(H/24)} d ago`}function fs(){try{Sn.value&&localStorage.setItem(Au,JSON.stringify({health:Sn.value,ts:Nn.value}))}catch{}}function Do(){try{const g=localStorage.getItem(Au);if(!g)return;const c=JSON.parse(g);c&&c.health&&(Sn.value=c.health,Nn.value=c.ts||null)}catch{}}async function gn(){Do();const{ok:g,body:c}=await yp();g&&je(c)}async function ca(g){const c=ut.value;c?ht.orgEnabled=g:ht.enabled=g;const{ok:H,body:k}=await yu(c?{scope:"org",enabled:g}:{scope:"user",enabled:g});H?(je(k),Je(c?g?"WebDAV enabled for your organization.":"WebDAV disabled for your organization.":g?"WebDAV enabled.":"WebDAV disabled.")):(c?ht.orgEnabled=!g:ht.enabled=!g,Je(k.error||"Could not update."))}async function Fo(){no.value="",zo.value=!0;const g={};for(const He of ds)Pn(He)||(g[He]=Yt[He]);const c={scope:pi.value,config:g};ut.value||(c.enabled=ht.enabled);const{ok:H,body:k}=await yu(c);if(zo.value=!1,!H){no.value=k.error||"Could not save settings.";return}je(k),Je(ut.value?"Organization WebDAV settings saved.":"WebDAV settings saved.")}async function mi(){Io.value=!0,Sn.value=null;const{ok:g,body:c}=await xp();Io.value=!1,Sn.value=g&&c.health?c.health:{status:"down",detail:c.error||"Probe failed."},Nn.value=Date.now(),fs()}function Ot(g){return g==="ok"?C.success:g==="degraded"?C.warning:C.danger}const et=xt({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),Dn=W("user"),gi=["apiKey","units","lat","lon","lang","callsPerMinute"],Ut=xt(Object.fromEntries(gi.map(g=>[g,""]))),qn=W(""),Ni=W(!1),Di=W(!1),Jt=W(null),Yn=W(null),Ro=[{value:"",label:"Not set"},{value:"metric",label:"Metric (°C)"},{value:"imperial",label:"Imperial (°F)"},{value:"standard",label:"Standard (K)"}],Fi=ue(()=>et.isSuperadmin),Bo=ue(()=>et.isSuperadmin?"user":Dn.value),hs=ue(()=>et.scopes[Bo.value]||{editableLayer:"user",fields:{}}),Cn=ue(()=>Bo.value==="org");function $e(g){return hs.value.fields[g]||{effective:"",own:"",source:"unset",locked:!1}}function Vt(g){return Fi.value||$e(g).locked}function Qe(g){const c=$e(g).source;return c==="global"?"Set by administrator":c==="org"?"Set by your organization":""}function ps(){for(const g of gi)Ut[g]=$e(g).own||""}function io(g){et.available=!!g.available,et.orgEnabled=g.orgEnabled!==!1,et.enabled=!!g.enabled,et.canEditOrg=!!g.canEditOrg,et.isSuperadmin=!!g.isSuperadmin,et.scopes=g.scopes||{},Dn.value==="org"&&!et.canEditOrg&&(Dn.value="user"),ps(),et.loaded=!0}Rt(Dn,()=>{qn.value="",ps()});function Uo(){if(!Yn.value)return"";const g=Math.max(0,Math.round((Date.now()-Yn.value)/1e3));if(g<60)return"just now";const c=Math.round(g/60);if(c<60)return`${c} min ago`;const H=Math.round(c/60);return H<24?`${H} h ago`:`${Math.round(H/24)} d ago`}function ms(){try{Jt.value&&localStorage.setItem(Mu,JSON.stringify({health:Jt.value,ts:Yn.value}))}catch{}}function vi(){try{const g=localStorage.getItem(Mu);if(!g)return;const c=JSON.parse(g);c&&c.health&&(Jt.value=c.health,Yn.value=c.ts||null)}catch{}}async function gs(){vi();const{ok:g,body:c}=await wp();g&&io(c)}async function Ri(g){const c=Cn.value;c?et.orgEnabled=g:et.enabled=g;const{ok:H,body:k}=await xu(c?{scope:"org",enabled:g}:{scope:"user",enabled:g});H?(io(k),Je(c?g?"OpenWeather enabled for your organization.":"OpenWeather disabled for your organization.":g?"OpenWeather enabled.":"OpenWeather disabled.")):(c?et.orgEnabled=!g:et.enabled=!g,Je(k.error||"Could not update."))}async function Dt(){qn.value="",Ni.value=!0;const g={};for(const He of gi)Vt(He)||(g[He]=Ut[He]);const c={scope:Bo.value,config:g};Cn.value||(c.enabled=et.enabled);const{ok:H,body:k}=await xu(c);if(Ni.value=!1,!H){qn.value=k.error||"Could not save settings.";return}io(k),Je(Cn.value?"Organization OpenWeather settings saved.":"OpenWeather settings saved.")}async function _i(){Di.value=!0,Jt.value=null;const{ok:g,body:c}=await kp();Di.value=!1,Jt.value=g&&c.health?c.health:{status:"down",detail:c.error||"Probe failed."},Yn.value=Date.now(),ms()}function da(g){return g==="ok"?C.success:g==="degraded"?C.warning:C.danger}const Bi=ue(()=>Jt.value&&Jt.value.usage||null),vs=ue(()=>{const g=Bi.value;return!g||!g.minuteLimit?null:Math.max(0,Math.min(100,Math.round(g.minuteUsed/g.minuteLimit*100)))}),fa=ue(()=>{const g=vs.value;return g==null?"bg-accent":g>=90?"bg-danger":g>=70?"bg-amber":"bg-success"}),Ee=xt({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,isOrgUser:!1,mounts:[],privateFolder:!1,privateEnabled:!1,allowPrivate:!0,rootConfigured:!1,scopes:{}}),Ui=W("user"),oo=W(""),Xe=W(""),Vo=W(!1),Xt=W(!1),ln=W(null),bi=W(null),so=W({}),Zo=[{value:"",label:"Inherit"},{value:"false",label:"Read-write"},{value:"true",label:"Read-only"}],_s=ue(()=>Ee.isSuperadmin),Ho=ue(()=>Ee.isSuperadmin?"user":Ui.value),ar=ue(()=>Ee.scopes[Ho.value]||{editableLayer:"user",fields:{}}),vn=ue(()=>Ho.value==="org");function Vi(g){return ar.value.fields[g]||{effective:"",own:"",source:"unset",locked:!1}}function ha(g){return _s.value||Vi(g).locked}function Ln(g){const c=Vi(g).source;return c==="global"?"Set by administrator":c==="org"?"Set by your organization":""}function rr(g){return(Zo.find(c=>c.value===g)||{}).label||"Inherit"}function bs(){oo.value=Vi("readOnly").own||""}function _n(g){Ee.available=!!g.available,Ee.orgEnabled=g.orgEnabled!==!1,Ee.enabled=!!g.enabled,Ee.canEditOrg=!!g.canEditOrg,Ee.isSuperadmin=!!g.isSuperadmin,Ee.isOrgUser=!!g.isOrgUser,Ee.mounts=Array.isArray(g.mounts)?g.mounts:[],Ee.privateFolder=!!g.privateFolder,Ee.privateEnabled=!!g.privateEnabled,Ee.allowPrivate=g.allowPrivate!==!1,Ee.rootConfigured=!!g.rootConfigured,Ee.scopes=g.scopes||{},Ui.value==="org"&&!Ee.canEditOrg&&(Ui.value="user"),bs(),Ee.loaded=!0}Rt(Ui,()=>{Xe.value="",bs()});function pa(){if(!bi.value)return"";const g=Math.max(0,Math.round((Date.now()-bi.value)/1e3));if(g<60)return"just now";const c=Math.round(g/60);if(c<60)return`${c} min ago`;const H=Math.round(c/60);return H<24?`${H} h ago`:`${Math.round(H/24)} d ago`}function ma(){try{ln.value&&localStorage.setItem(Eu,JSON.stringify({health:ln.value,ts:bi.value}))}catch{}}function ys(){try{const g=localStorage.getItem(Eu);if(!g)return;const c=JSON.parse(g);c&&c.health&&(ln.value=c.health,bi.value=c.ts||null)}catch{}}async function lr(){ys();const{ok:g,body:c}=await _p();g&&_n(c)}async function xs(g){const c=vn.value;c?Ee.orgEnabled=g:Ee.enabled=g;const{ok:H,body:k}=await Ma(c?{scope:"org",enabled:g}:{scope:"user",enabled:g});H?(_n(k),Je(c?g?"Local storage enabled for your organization.":"Local storage disabled for your organization.":g?"Local storage enabled.":"Local storage disabled.")):(c?Ee.orgEnabled=!g:Ee.enabled=!g,Je(k.error||"Could not update."))}async function ga(g){Ee.privateFolder=g;const{ok:c,body:H}=await Ma({scope:"user",privateFolder:g});c?(_n(H),Je(g?"Private folder enabled.":"Private folder disabled.")):(Ee.privateFolder=!g,Je(H.error||"Could not update."))}async function ur(g){Ee.allowPrivate=g;const{ok:c,body:H}=await Ma({scope:"org",allowPrivate:g});c?(_n(H),Je(g?"Members may now create private folders.":"Private folders disabled for your organization.")):(Ee.allowPrivate=!g,Je(H.error||"Could not update."))}async function cr(){Xe.value="",Vo.value=!0;const g={};ha("readOnly")||(g.readOnly=oo.value);const c={scope:Ho.value,config:g};vn.value||(c.enabled=Ee.enabled);const{ok:H,body:k}=await Ma(c);if(Vo.value=!1,!H){Xe.value=k.error||"Could not save settings.";return}_n(k),Je(vn.value?"Organization local-storage settings saved.":"Local-storage settings saved.")}async function ws(){Xt.value=!0,ln.value=null,so.value={};const{ok:g,body:c}=await bp();Xt.value=!1,ln.value=g&&c.health?c.health:{status:"down",detail:c.error||"Probe failed."};const H={};if(Array.isArray(c.mounts))for(const k of c.mounts)H[k.id]={status:k.status,detail:k.detail};so.value=H,bi.value=Date.now(),ma()}function va(g){return g==="ok"?C.success:g==="degraded"?C.warning:C.danger}const _a=[{id:"apis-external",label:"APIs — External",icon:"globe"},{id:"drives-external",label:"Drives — External",icon:"server"},{id:"drives-local",label:"Drives — Local",icon:"monitor"}],jo=W("apis-external");function Zi(g){return V.value||jo.value===g}const Fn=W("");let ks=null;function Je(g){Fn.value=g,clearTimeout(ks),ks=setTimeout(()=>Fn.value="",2200)}const kt=xt({current:"",next:"",confirm:""}),yi=W(""),Ss=W(!1);function dr(){if(Ss.value=!1,!kt.current)return yi.value="Enter your current password.";if(kt.next.length<8)return yi.value="New password must be at least 8 characters.";if(kt.next!==kt.confirm)return yi.value="New passwords do not match.";yi.value="Validated. Connecting to the account service is pending — no password endpoint yet.",kt.current=kt.next=kt.confirm=""}const ao=W("");function Ts(){ao.value="Verification link would be sent once the account service is wired up."}function fr(g){const c=g.target.files&&g.target.files[0];if(!c)return;if(c.size>1.5*1024*1024){Je("Image too large (max ~1.5 MB).");return}const H=new FileReader;H.onload=()=>{be.avatar=String(H.result),Je("Photo updated.")},H.readAsDataURL(c)}function hr(){be.avatar="",Je("Photo removed.")}const ba=ue(()=>{var H,k,He;const c=(be.displayName||be.name||s.email||"PV").split("@")[0].split(/[.\-_ ]+/).filter(Boolean);return((((H=c[0])==null?void 0:H[0])||"P")+(((k=c[1])==null?void 0:k[0])||((He=c[0])==null?void 0:He[1])||"V")).toUpperCase()}),ro=W(!1),bn=W(""),Jn=W(""),lo=W(""),yn=W([]);function Ps(g){const c="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";let H="";for(let k=0;kPs(4).toLowerCase()+"-"+Ps(4).toLowerCase()),lo.value=""}function uo(){be.twoFactor=!1,yn.value=[],ro.value=!1}const An=navigator.userAgent;function Wo(){return/Edg\//.test(An)?"Edge":/OPR\//.test(An)?"Opera":/Chrome\//.test(An)?"Chrome":/Firefox\//.test(An)?"Firefox":/Safari\//.test(An)?"Safari":"Browser"}function mr(){return/Windows/.test(An)?"Windows":/Mac OS X/.test(An)?"macOS":/Android/.test(An)?"Android":/iPhone|iPad/.test(An)?"iOS":/Linux/.test(An)?"Linux":"Unknown OS"}const ii=Date.now(),xi=W([]),co=W(!1),ji=W(""),Ft=xt({email:"",password:"",role:"user",organization:""}),Qt=W(""),Ko=W(!1),Rn=W(""),ya=ue(()=>{const g=[{value:"user",label:"User"},{value:"admin",label:"Admin"}];return u.value&&g.push({value:"superadmin",label:"Superadmin"}),g}),xn=W([]);async function oi(){if(!f.value)return;const g=await rp();g.ok&&(xn.value=g.organizations.slice().sort((c,H)=>c.name.localeCompare(H.name)))}const Cs=ue(()=>{const g=xn.value.map(c=>({value:c.id,label:c.name}));return u.value&&g.unshift({value:"",label:"No organization"}),g});async function si(){if(!f.value)return;co.value=!0,ji.value="";const g=await ip();if(co.value=!1,!g.ok){ji.value=g.status===403?"Manager role required.":"Could not load users.";return}xi.value=g.users.slice().sort((c,H)=>c.email.localeCompare(H.email))}function wi(g){try{const c=g.data||{},H=Object.keys(c)[0];return H&&c[H]&&c[H].message||g.message||g.error||"Invalid input."}catch{return g.error||"Could not create user."}}async function Ls(){Qt.value="";const g=Ft.email.trim().toLowerCase();if(!g.includes("@"))return Qt.value="Enter a valid email.";if(Ft.password.length<8)return Qt.value="Password must be at least 8 characters.";Ko.value=!0;const c=u.value?Ft.organization:s.organization,{ok:H,body:k}=await op(g,Ft.password,Ft.role,c);if(Ko.value=!1,!H)return Qt.value=wi(k);Ft.email="",Ft.password="",Ft.role="user",Ft.organization="",Je("User created."),si()}async function Go(g){const{ok:c,body:H}=await ap(g.id);if(Rn.value="",!c)return Je(H.error||"Could not remove user.");Je("User removed."),si()}const tt=xt({id:"",email:"",role:"user",verified:!1,password:"",organization:""}),Mn=W(""),Wi=W(!1),qo=ue(()=>!!tt.id&&tt.email===s.email);function gr(g){Rn.value="",tt.id=g.id,tt.email=g.email,tt.role=g.role||"user",tt.verified=!!g.verified,tt.password="",tt.organization=g.organization||"",Mn.value=""}function fo(){tt.id="",Mn.value=""}async function vr(){Mn.value="";const g=tt.email.trim().toLowerCase();if(!g.includes("@"))return Mn.value="Enter a valid email.";if(tt.password&&tt.password.length<8)return Mn.value="New password must be at least 8 characters (or leave blank).";const c={email:g,role:tt.role,verified:tt.verified};u.value&&(c.organization=tt.organization),tt.password&&(c.password=tt.password),Wi.value=!0;const{ok:H,body:k}=await sp(tt.id,c);if(Wi.value=!1,!H)return Mn.value=wi(k);Je("User updated."),fo(),si()}const ho=xt({name:""}),po=W(""),mo=W(!1),go=W(""),It=xt({id:"",name:""}),Bn=W(""),As=ue(()=>{const g={};for(const c of xi.value)c.organization&&(g[c.organization]=(g[c.organization]||0)+1);return g});async function vo(){po.value="";const g=ho.name.trim();if(!g)return po.value="Enter an organization name.";mo.value=!0;const{ok:c,body:H}=await lp(g);if(mo.value=!1,!c)return po.value=wi(H);ho.name="",Je("Organization created."),oi()}function _r(g){go.value="",It.id=g.id,It.name=g.name,Bn.value=""}function Ms(){It.id="",Bn.value=""}async function xa(){Bn.value="";const g=It.name.trim();if(!g)return Bn.value="Enter an organization name.";const{ok:c,body:H}=await up(It.id,g);if(!c)return Bn.value=wi(H);Je("Organization renamed."),Ms(),oi(),si()}async function _o(g){const{ok:c,body:H}=await cp(g.id);if(go.value="",!c)return Je(H.error||"Could not delete organization.");Je("Organization deleted."),oi()}function br(){const g={_app:"PilotVault",_kind:"settings-export",exportedAt:new Date().toISOString(),email:s.email,prefs:{...be},themeMode:Eo.value},c=new Blob([JSON.stringify(g,null,2)],{type:"application/json"}),H=URL.createObjectURL(c),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),Je("Settings exported.")}const Xn=W("");function wa(g){const c=g.target.files&&g.target.files[0];if(!c)return;const H=new FileReader;H.onload=()=>{try{const k=JSON.parse(String(H.result)),He=k.prefs||k;if(!ed(He))throw new Error("bad shape");k.themeMode&&Ha(k.themeMode),pl(be.fontSize),ml(be.reduceMotion),Xn.value="Settings imported and applied."}catch{Xn.value="That file is not a valid PilotVault settings export."}},H.readAsText(c),g.target.value=""}const yt=xt({understand:!1,typed:"",cooldown:0,armed:!1,msg:""});let bo=null;const En=ue(()=>s.email||"DELETE MY ACCOUNT"),Yo=ue(()=>yt.understand&&yt.typed===En.value);function ka(){Yo.value&&(yt.armed=!0,yt.cooldown=5,clearInterval(bo),bo=setInterval(()=>{yt.cooldown--,yt.cooldown<=0&&clearInterval(bo)},1e3))}Rt(Yo,g=>{!g&&yt.armed&&(yt.armed=!1,yt.cooldown=0,clearInterval(bo))});function yo(){if(!(!yt.armed||yt.cooldown>0)){try{localStorage.removeItem("pv_prefs")}catch{}yt.msg="Account deletion requires the account service. Local data was cleared and you were signed out.",setTimeout(()=>l("logout"),900)}}return Ei(()=>{ie=setInterval(()=>Me.value=Date.now(),1e3),oi(),si(),st(),ir(),gn(),gs(),lr()}),us(()=>{clearInterval(ie),clearInterval(bo),clearTimeout(ks)}),(g,c)=>(p(),m("div",Pm,[a("div",Cm,[c[72]||(c[72]=a("div",null,[a("div",{class:"eyebrow"},"Preferences"),a("h2",{class:"mt-0.5 text-[22px] font-bold tracking-tightest text-ink"},"Settings")],-1)),a("div",Lm,[A(G,{name:"search",size:16,class:"text-ink-muted"}),Q(a("input",{"onUpdate:modelValue":c[0]||(c[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),[[ye,U.value]]),U.value?(p(),m("button",{key:0,class:"text-ink-muted hover:text-ink","aria-label":"Clear search",onClick:c[1]||(c[1]=H=>U.value="")},[A(G,{name:"x",size:15})])):$("",!0)])]),a("div",Am,[Q(a("nav",Mm,[(p(!0),m(oe,null,Fe(T.value,H=>(p(),m("button",{key:H.id,class:Ae(["flex items-center gap-2.5 rounded px-3 py-2.5 text-left text-sm transition",[M.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=>M.value=H.id},[A(G,{name:H.icon,size:17},null,8,["name"]),a("span",Om,w(H.label),1)],10,Em))),128))],512),[[kh,!V.value]]),a("div",zm,[V.value&&!Y.value.length?(p(),m("div",Im," No settings match “"+w(U.value)+"”. ",1)):$("",!0),(p(!0),m(oe,null,Fe(Y.value,H=>(p(),m(oe,{key:H.id},[V.value?(p(),m("div",$m,[A(G,{name:H.icon,size:14},null,8,["name"]),z(" "+w(H.label),1)])):$("",!0),H.id==="account"?(p(),m("div",Nm,[A(ke,{title:"Full name",desc:"Shown to your team on flights and audit logs.",keywords:"full name account"},{default:xe(()=>[Q(a("input",{"onUpdate:modelValue":c[2]||(c[2]=k=>Oe(be).name=k),class:"field w-56",placeholder:"Jane Operator",onBlur:c[3]||(c[3]=k=>Je("Saved."))},null,544),[[ye,Oe(be).name]])]),_:1}),A(ke,{title:"Username",desc:"Your unique handle within PilotVault.",keywords:"username handle"},{default:xe(()=>[a("div",Dm,[c[73]||(c[73]=a("span",{class:"text-sm text-ink-muted"},"@",-1)),Q(a("input",{"onUpdate:modelValue":c[4]||(c[4]=k=>Oe(be).username=k),class:"field w-48",placeholder:"jane",onBlur:c[5]||(c[5]=k=>Je("Saved."))},null,544),[[ye,Oe(be).username]])])]),_:1}),A(ke,{title:"Email address",desc:"Used for sign-in and notifications.",keywords:"email verification verify"},{default:xe(()=>[a("div",Fm,[a("span",Rm,w(t.email||"—"),1),a("span",Bm,[A(G,{name:"mail",size:12}),c[74]||(c[74]=z(" Unverified ",-1))])])]),_:1}),A(ke,{title:"Role",desc:"Your access level in PilotVault.",keywords:"role admin user superadmin access rights permissions"},{default:xe(()=>[a("span",{class:Ae(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",y(t.role)])},[A(G,{name:_(t.role),size:12},null,8,["name"]),z(w(h(t.role)),1)],2)]),_:1}),A(ke,{title:"Organization",desc:"The organization your account belongs to.",keywords:"organization org tenant company"},{default:xe(()=>[a("span",{class:Ae(["text-sm",t.organizationName?"text-ink":"text-ink-muted"])},w(t.organizationName||(u.value?"All organizations":"None")),3)]),_:1}),A(ke,{block:"",title:"Verify email",desc:"Confirm ownership to enable password resets and alerts.",keywords:"verify email resend"},{default:xe(()=>[a("button",{class:"btn-ghost",onClick:Ts},"Send verification link"),ao.value?(p(),m("p",Um,w(ao.value),1)):$("",!0)]),_:1}),A(ke,{block:"",title:"Change password",desc:"Use at least 8 characters.",keywords:"password change current new"},{default:xe(()=>[a("div",Vm,[Q(a("input",{"onUpdate:modelValue":c[6]||(c[6]=k=>kt.current=k),type:"password",class:"field",placeholder:"Current password"},null,512),[[ye,kt.current]]),Q(a("input",{"onUpdate:modelValue":c[7]||(c[7]=k=>kt.next=k),type:"password",class:"field",placeholder:"New password"},null,512),[[ye,kt.next]]),Q(a("input",{"onUpdate:modelValue":c[8]||(c[8]=k=>kt.confirm=k),type:"password",class:"field",placeholder:"Confirm new password"},null,512),[[ye,kt.confirm]]),a("div",Zm,[a("button",{class:"btn-accent",onClick:dr},"Update password"),yi.value?(p(),m("span",{key:0,class:Ae(["text-xs",Ss.value?"text-success-fg":"text-ink-muted"])},w(yi.value),3)):$("",!0)])])]),_:1})])):H.id==="appearance"?(p(),m("div",Hm,[A(ke,{title:"Theme",desc:"Light, dark, or follow your system.",keywords:"theme light dark system appearance"},{default:xe(()=>[A(kn,{modelValue:Le.value,"onUpdate:modelValue":c[9]||(c[9]=k=>Le.value=k),options:ce},null,8,["modelValue"])]),_:1}),A(ke,{title:"Font size",desc:"Scales the entire interface for readability.",keywords:"font size accessibility text"},{default:xe(()=>[A(kn,{modelValue:Oe(be).fontSize,"onUpdate:modelValue":c[10]||(c[10]=k=>Oe(be).fontSize=k),options:Be},null,8,["modelValue"])]),_:1}),A(ke,{title:"Reduce motion",desc:"Minimise animations and transitions.",keywords:"reduce motion accessibility animation"},{default:xe(()=>[A(en,{modelValue:Oe(be).reduceMotion,"onUpdate:modelValue":c[11]||(c[11]=k=>Oe(be).reduceMotion=k)},null,8,["modelValue"])]),_:1}),A(ke,{title:"Language",desc:"Interface language.",keywords:"language locale"},{default:xe(()=>[Q(a("select",{"onUpdate:modelValue":c[12]||(c[12]=k=>Oe(be).language=k),class:"field w-48"},[(p(),m(oe,null,Fe(ze,([k,He])=>a("option",{key:k,value:k},w(He),9,jm)),64))],512),[[zt,Oe(be).language]])]),_:1}),A(ke,{title:"Region",desc:"Affects number, unit and date defaults.",keywords:"region country locale"},{default:xe(()=>[Q(a("select",{"onUpdate:modelValue":c[13]||(c[13]=k=>Oe(be).region=k),class:"field w-48"},[(p(!0),m(oe,null,Fe(Oe(We),([k,He])=>(p(),m("option",{key:k,value:k},w(He),9,Wm))),128))],512),[[zt,Oe(be).region]])]),_:1}),A(ke,{title:"Date format",desc:"How calendar dates are displayed.",keywords:"date format"},{default:xe(()=>[Q(a("select",{"onUpdate:modelValue":c[14]||(c[14]=k=>Oe(be).dateFormat=k),class:"field w-48"},[(p(),m(oe,null,Fe(le,([k,He])=>a("option",{key:k,value:k},w(He),9,Km)),64))],512),[[zt,Oe(be).dateFormat]])]),_:1}),A(ke,{title:"Time format",desc:"12- or 24-hour clock.",keywords:"time format clock 12 24 hour"},{default:xe(()=>[A(kn,{modelValue:Oe(be).timeFormat,"onUpdate:modelValue":c[15]||(c[15]=k=>Oe(be).timeFormat=k),options:Ne},null,8,["modelValue"])]),_:1}),A(ke,{title:"Preview",desc:"How timestamps appear across the app.",keywords:"preview date time"},{default:xe(()=>[a("span",Gm,w(Ke.value),1)]),_:1}),c[75]||(c[75]=a("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"?(p(),m("div",qm,[V.value?$("",!0):(p(),m("div",Ym,[(p(),m(oe,null,Fe(_a,k=>a("button",{key:k.id,type:"button",class:Ae(["-mb-px inline-flex items-center gap-1.5 whitespace-nowrap border-b-2 px-3 py-2 text-sm font-semibold transition",jo.value===k.id?"border-accent text-ink":"border-transparent text-ink-secondary hover:text-ink"]),onClick:He=>jo.value=k.id},[A(G,{name:k.icon,size:16},null,8,["name"]),z(w(k.label),1)],10,Jm)),64))])),Zi("apis-external")?(p(),m(oe,{key:1},[a("div",Xm,[a("div",Qm,[a("div",eg,[A(G,{name:"radio",size:20})]),c[76]||(c[76]=a("div",{class:"min-w-0"},[a("div",{class:"text-sm font-semibold text-ink"},"OpenSky Network"),a("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))]),re.loaded&&!re.available?(p(),m("div",tg,[A(G,{name:"lock",size:14,class:"mr-1 inline"}),c[77]||(c[77]=z(" OpenSky is currently disabled by your administrator. Contact them to enable it. ",-1))])):$("",!0),re.canEditOrg?(p(),m("div",ng,[c[78]||(c[78]=a("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),A(kn,{modelValue:qe.value,"onUpdate:modelValue":c[16]||(c[16]=k=>qe.value=k),options:dt},null,8,["modelValue"])])):$("",!0),ge.value?(p(),at(ke,{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:xe(()=>[A(en,{"model-value":re.orgEnabled,disabled:!re.available,"onUpdate:modelValue":ft},null,8,["model-value","disabled"])]),_:1})):(p(),at(ke,{key:3,title:"Enable OpenSky",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin opensky"},{default:xe(()=>[A(en,{"model-value":re.enabled,disabled:!re.available||!re.orgEnabled,"onUpdate:modelValue":ft},null,8,["model-value","disabled"])]),_:1})),!ge.value&&re.available&&!re.orgEnabled?(p(),m("div",ig,[A(G,{name:"lock",size:13,class:"mr-1 inline"}),c[80]||(c[80]=z("OpenSky is turned off for your organization",-1)),re.canEditOrg?(p(),m("span",og,[...c[79]||(c[79]=[z(" — switch to ",-1),a("span",{class:"font-semibold"},"Organization",-1),z(" to turn it back on",-1)])])):$("",!0),c[81]||(c[81]=z(". ",-1))])):$("",!0),ge.value?(p(),m("div",sg,[A(G,{name:"users",size:13,class:"mr-1 inline"}),c[82]||(c[82]=z("These are organization-wide settings — they apply to everyone in ",-1)),a("span",ag,w(t.organizationName||"your organization"),1),c[83]||(c[83]=z(". Leave a field blank to let each user choose their own; a value set here overrides the user's. ",-1))])):ne.value?(p(),m("div",rg," As a superadmin you manage the global OpenSky configuration in the API Server panel. The effective configuration is shown below. ")):$("",!0),re.available&&!ge.value?(p(),m("div",lg,[a("div",ug,[a("div",cg,[A(G,{name:"signal",size:15}),c[84]||(c[84]=z("Credit usage ",-1))]),Ue.value?(p(),m("span",dg,"Checked "+w(J()),1)):$("",!0)]),Ve.value?(p(),m(oe,{key:0},[Ve.value.remaining!=null?(p(),m(oe,{key:0},[a("div",fg,[a("span",hg,w(Ce(Ve.value.remaining)),1),a("span",pg,"/ "+w(Ce(Ve.value.daily))+" credits left today",1)]),a("div",mg,[a("div",{class:Ae(["h-full rounded-full transition-all",ot.value]),style:Mo({width:mt.value+"%"})},null,6)]),a("div",gg," Used "+w(Ce(Ve.value.daily-Ve.value.remaining))+" today · "+w(Ve.value.probeCost)+" credit"+w(Ve.value.probeCost===1?"":"s")+" per query · "+w(Ve.value.mode),1)],64)):(p(),m(oe,{key:1},[a("div",vg,[c[85]||(c[85]=z("Daily allowance: ",-1)),a("span",_g,w(Ce(Ve.value.daily)),1),c[86]||(c[86]=z(" credits",-1))]),a("div",bg,w(Ve.value.probeCost)+" credit"+w(Ve.value.probeCost===1?"":"s")+" per query · "+w(Ve.value.mode)+". OpenSky only reports live remaining credits for authenticated requests — add OAuth2 credentials below to track usage. ",1)],64))],64)):(p(),m("div",yg,[...c[87]||(c[87]=[z(" Run ",-1),a("span",{class:"font-semibold text-ink-secondary"},"Test connection",-1),z(" below to fetch your live OpenSky credit balance. ",-1)])]))])):$("",!0),A(ke,{title:"OpenSky plan",desc:"Your account tier — sets the daily credit allowance.",keywords:"plan tier credits"},{default:xe(()=>[Se("plan")?(p(),m("span",xg,[z(w((gt.find(k=>k.value===te("plan").effective)||{}).label||te("plan").effective||"—")+" ",1),Te("plan")?(p(),m("span",wg,[A(G,{name:"lock",size:10}),z(w(Te("plan")),1)])):$("",!0)])):(p(),at(kn,{key:1,modelValue:fe.plan,"onUpdate:modelValue":c[17]||(c[17]=k=>fe.plan=k),options:gt},null,8,["modelValue"]))]),_:1}),A(ke,{title:"Default bounding box",desc:"Automatic follows your location; or pick a region, or enter lamin,lomin,lamax,lomax by hand.",keywords:"bounding box bbox area region country continent world europe custom coordinates automatic location drone"},{default:xe(()=>[Se("bbox")?(p(),m("span",kg,[z(w(S(te("bbox").effective)||te("bbox").effective||"—")+" ",1),Te("bbox")?(p(),m("span",Sg,[A(G,{name:"lock",size:10}),z(w(Te("bbox")),1)])):$("",!0)])):(p(),m("div",Tg,[Q(a("select",{"onUpdate:modelValue":c[18]||(c[18]=k=>R.value=k),class:"field w-64"},[ge.value?$("",!0):(p(),m("option",Pg,"Automatic (by location)")),(p(),m(oe,null,Fe(bt,k=>a("optgroup",{key:k.label,label:k.label},[(p(!0),m(oe,null,Fe(k.options,He=>(p(),m("option",{key:He.value,value:He.value},w(He.label),9,Lg))),128))],8,Cg)),64)),c[88]||(c[88]=a("option",{value:"__custom__"},"Custom…",-1))],512),[[zt,R.value]]),se.value?(p(),m("p",Ag," Live map follows drone location → your device location → your Region ("+w(we.value)+"). ",1)):$("",!0),Z.value?Q((p(),m("input",{key:1,"onUpdate:modelValue":c[19]||(c[19]=k=>fe.bbox=k),class:"field w-64 font-mono",placeholder:"50.5,3.2,53.7,7.3"},null,512)),[[ye,fe.bbox]]):$("",!0)]))]),_:1}),A(ke,{title:"OAuth2 client ID",desc:"Optional — leave blank for anonymous access (lower limits).",keywords:"oauth client id credentials"},{default:xe(()=>[Se("clientId")?(p(),m("span",Mg,[z(w(te("clientId").effective||"—")+" ",1),Te("clientId")?(p(),m("span",Eg,[A(G,{name:"lock",size:10}),z(w(Te("clientId")),1)])):$("",!0)])):Q((p(),m("input",{key:1,"onUpdate:modelValue":c[20]||(c[20]=k=>fe.clientId=k),class:"field w-64",placeholder:"your-api-client"},null,512)),[[ye,fe.clientId]])]),_:1}),A(ke,{title:"OAuth2 client secret",desc:"Paired with the client ID for authenticated access.",keywords:"oauth client secret credentials password"},{default:xe(()=>[Se("clientSecret")?(p(),m("span",Og,[z(w(te("clientSecret").effective||"—")+" ",1),Te("clientSecret")?(p(),m("span",zg,[A(G,{name:"lock",size:10}),z(w(Te("clientSecret")),1)])):$("",!0)])):Q((p(),m("input",{key:1,"onUpdate:modelValue":c[21]||(c[21]=k=>fe.clientSecret=k),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[ye,fe.clientSecret]])]),_:1}),re.available&&!re.allowAnonymous?(p(),m("div",Ig," Anonymous access is disabled by the administrator — OpenSky needs OAuth2 credentials from some layer to work. ")):$("",!0),a("div",$g,[ne.value?$("",!0):(p(),m("button",{key:0,class:"btn-accent",disabled:ae.value||!re.available,onClick:Tt},w(ae.value?"Saving…":ge.value?"Save organization settings":"Save settings"),9,Ng)),ge.value?$("",!0):(p(),m("div",Dg,[c[91]||(c[91]=a("label",{class:"text-xs text-ink-muted"},"Test area",-1)),Q(a("select",{"onUpdate:modelValue":c[22]||(c[22]=k=>Pt.value=k),class:"field w-44"},[c[89]||(c[89]=a("option",{value:"__default__"},"Default bounding box",-1)),(p(),m(oe,null,Fe(Bt,k=>a("optgroup",{key:k.label,label:k.label},[(p(!0),m(oe,null,Fe(k.options,He=>(p(),m("option",{key:He.value,value:He.value},w(He.label),9,Rg))),128))],8,Fg)),64)),c[90]||(c[90]=a("option",{value:"__custom__"},"Custom…",-1))],512),[[zt,Pt.value]]),Gt.value?Q((p(),m("input",{key:0,"onUpdate:modelValue":c[23]||(c[23]=k=>Nt.value=k),class:"field w-44 font-mono",placeholder:"lamin,lomin,lamax,lomax"},null,512)),[[ye,Nt.value]]):$("",!0)])),ge.value?$("",!0):(p(),m("button",{key:2,class:"btn-ghost",disabled:Lt.value||!re.available,onClick:zn},w(Lt.value?"Testing…":"Test connection"),9,Bg)),de.value?(p(),m("span",Ug,w(de.value),1)):$("",!0),pe.value&&!ge.value?(p(),m("span",{key:4,class:Ae(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",zi(pe.value.status)])},[c[92]||(c[92]=a("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),z(w(pe.value.detail||pe.value.status),1)],2)):$("",!0)])]),a("div",Vg,[a("div",Zg,[a("div",Hg,[A(G,{name:"sun",size:20})]),c[93]||(c[93]=a("div",{class:"min-w-0"},[a("div",{class:"text-sm font-semibold text-ink"},"OpenWeather"),a("div",{class:"mt-0.5 text-xs text-ink-muted"}," Current conditions and forecast from the OpenWeather API. Configure the API key and default location your account uses. ")],-1))]),et.loaded&&!et.available?(p(),m("div",jg,[A(G,{name:"lock",size:14,class:"mr-1 inline"}),c[94]||(c[94]=z(" OpenWeather is currently disabled by your administrator. Contact them to enable it. ",-1))])):$("",!0),et.canEditOrg?(p(),m("div",Wg,[c[95]||(c[95]=a("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),A(kn,{modelValue:Dn.value,"onUpdate:modelValue":c[24]||(c[24]=k=>Dn.value=k),options:dt},null,8,["modelValue"])])):$("",!0),Cn.value?(p(),at(ke,{key:2,title:"Enable OpenWeather (organization-wide)",desc:"Turn it on or off for everyone in your organization.",keywords:"enable disable plugin openweather weather organization"},{default:xe(()=>[A(en,{"model-value":et.orgEnabled,disabled:!et.available,"onUpdate:modelValue":Ri},null,8,["model-value","disabled"])]),_:1})):(p(),at(ke,{key:3,title:"Enable OpenWeather",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin openweather weather"},{default:xe(()=>[A(en,{"model-value":et.enabled,disabled:!et.available||!et.orgEnabled,"onUpdate:modelValue":Ri},null,8,["model-value","disabled"])]),_:1})),!Cn.value&&et.available&&!et.orgEnabled?(p(),m("div",Kg,[A(G,{name:"lock",size:13,class:"mr-1 inline"}),c[97]||(c[97]=z("OpenWeather is turned off for your organization",-1)),et.canEditOrg?(p(),m("span",Gg,[...c[96]||(c[96]=[z(" — switch to ",-1),a("span",{class:"font-semibold"},"Organization",-1),z(" to turn it back on",-1)])])):$("",!0),c[98]||(c[98]=z(". ",-1))])):$("",!0),Cn.value?(p(),m("div",qg,[A(G,{name:"users",size:13,class:"mr-1 inline"}),c[99]||(c[99]=z("These are organization-wide settings — they apply to everyone in ",-1)),a("span",Yg,w(t.organizationName||"your organization"),1),c[100]||(c[100]=z(". Leave the API key blank to let each user configure their own; a key set here overrides the user's. ",-1))])):Fi.value?(p(),m("div",Jg," As a superadmin you manage the global OpenWeather configuration in the API Server panel. The effective configuration is shown below. ")):$("",!0),A(ke,{title:"API key",desc:"Your OpenWeather API key (the appid parameter). Required — OpenWeather has no anonymous tier.",keywords:"api key appid secret credentials token openweather"},{default:xe(()=>[Vt("apiKey")?(p(),m("span",Xg,[z(w($e("apiKey").effective||"—")+" ",1),Qe("apiKey")?(p(),m("span",Qg,[A(G,{name:"lock",size:10}),z(w(Qe("apiKey")),1)])):$("",!0)])):Q((p(),m("input",{key:1,"onUpdate:modelValue":c[25]||(c[25]=k=>Ut.apiKey=k),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[ye,Ut.apiKey]])]),_:1}),A(ke,{title:"Units",desc:"Measurement system for temperatures and wind speed.",keywords:"units metric imperial standard celsius fahrenheit kelvin"},{default:xe(()=>[Vt("units")?(p(),m("span",ev,[z(w((Ro.find(k=>k.value===$e("units").effective)||{}).label||$e("units").effective||"—")+" ",1),Qe("units")?(p(),m("span",tv,[A(G,{name:"lock",size:10}),z(w(Qe("units")),1)])):$("",!0)])):(p(),at(kn,{key:1,modelValue:Ut.units,"onUpdate:modelValue":c[26]||(c[26]=k=>Ut.units=k),options:Ro},null,8,["modelValue"]))]),_:1}),A(ke,{title:"Default latitude",desc:"Latitude used by the health probe and calls with no location (−90…90).",keywords:"latitude location coordinates default"},{default:xe(()=>[Vt("lat")?(p(),m("span",nv,[z(w($e("lat").effective||"—")+" ",1),Qe("lat")?(p(),m("span",iv,[A(G,{name:"lock",size:10}),z(w(Qe("lat")),1)])):$("",!0)])):Q((p(),m("input",{key:1,"onUpdate:modelValue":c[27]||(c[27]=k=>Ut.lat=k),inputmode:"decimal",class:"field w-40 font-mono",placeholder:"52.2297"},null,512)),[[ye,Ut.lat]])]),_:1}),A(ke,{title:"Default longitude",desc:"Longitude used by the health probe and calls with no location (−180…180).",keywords:"longitude location coordinates default"},{default:xe(()=>[Vt("lon")?(p(),m("span",ov,[z(w($e("lon").effective||"—")+" ",1),Qe("lon")?(p(),m("span",sv,[A(G,{name:"lock",size:10}),z(w(Qe("lon")),1)])):$("",!0)])):Q((p(),m("input",{key:1,"onUpdate:modelValue":c[28]||(c[28]=k=>Ut.lon=k),inputmode:"decimal",class:"field w-40 font-mono",placeholder:"21.0122"},null,512)),[[ye,Ut.lon]])]),_:1}),A(ke,{title:"Language",desc:"Optional ISO code for human-readable weather descriptions, e.g. en, pl, de.",keywords:"language locale description"},{default:xe(()=>[Vt("lang")?(p(),m("span",av,[z(w($e("lang").effective||"—")+" ",1),Qe("lang")?(p(),m("span",rv,[A(G,{name:"lock",size:10}),z(w(Qe("lang")),1)])):$("",!0)])):Q((p(),m("input",{key:1,"onUpdate:modelValue":c[29]||(c[29]=k=>Ut.lang=k),class:"field w-24 font-mono",placeholder:"en"},null,512)),[[ye,Ut.lang]])]),_:1}),A(ke,{title:"Calls per minute limit",desc:"Your plan's per-minute limit (free tier is 60). Only used to gauge app usage below.",keywords:"calls per minute limit rate quota plan usage"},{default:xe(()=>[Vt("callsPerMinute")?(p(),m("span",lv,[z(w($e("callsPerMinute").effective||"60")+" ",1),Qe("callsPerMinute")?(p(),m("span",uv,[A(G,{name:"lock",size:10}),z(w(Qe("callsPerMinute")),1)])):$("",!0)])):Q((p(),m("input",{key:1,"onUpdate:modelValue":c[30]||(c[30]=k=>Ut.callsPerMinute=k),inputmode:"numeric",class:"field w-24 font-mono",placeholder:"60"},null,512)),[[ye,Ut.callsPerMinute]])]),_:1}),et.available&&!Cn.value?(p(),m("div",cv,[a("div",dv,[a("div",fv,[A(G,{name:"signal",size:15}),c[101]||(c[101]=z("API call usage ",-1))]),Yn.value?(p(),m("span",hv,"Checked "+w(Uo()),1)):$("",!0)]),Bi.value?(p(),m(oe,{key:0},[a("div",pv,[a("span",mv,w(Bi.value.minuteUsed),1),a("span",gv,"/ "+w(Bi.value.minuteLimit||"—")+" calls this minute",1)]),vs.value!=null?(p(),m("div",vv,[a("div",{class:Ae(["h-full rounded-full transition-all",fa.value]),style:Mo({width:vs.value+"%"})},null,6)])):$("",!0),a("div",_v,w(Bi.value.dayUsed)+" calls today · counts only requests PilotVault makes with this key, since server start. OpenWeather does not report remaining quota — check your account dashboard for the authoritative total. ",1)],64)):(p(),m("div",bv,[...c[102]||(c[102]=[z(" Run ",-1),a("span",{class:"font-semibold text-ink-secondary"},"Test connection",-1),z(" below to record and show call usage. ",-1)])]))])):$("",!0),a("div",yv,[Fi.value?$("",!0):(p(),m("button",{key:0,class:"btn-accent",disabled:Ni.value||!et.available,onClick:Dt},w(Ni.value?"Saving…":Cn.value?"Save organization settings":"Save settings"),9,xv)),Cn.value?$("",!0):(p(),m("button",{key:1,class:"btn-ghost",disabled:Di.value||!et.available,onClick:_i},w(Di.value?"Testing…":"Test connection"),9,wv)),qn.value?(p(),m("span",kv,w(qn.value),1)):$("",!0),Yn.value&&!Cn.value?(p(),m("span",Sv,"Checked "+w(Uo()),1)):$("",!0),Jt.value&&!Cn.value?(p(),m("span",{key:4,class:Ae(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",da(Jt.value.status)])},[c[103]||(c[103]=a("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),z(w(Jt.value.detail||Jt.value.status),1)],2)):$("",!0)])])],64)):$("",!0),Zi("drives-external")?(p(),m(oe,{key:2},[a("div",Tv,[a("div",Pv,[a("div",Cv,[A(G,{name:"server",size:20})]),c[104]||(c[104]=a("div",{class:"min-w-0"},[a("div",{class:"text-sm font-semibold text-ink"},"File Transfer (FTP / SFTP)"),a("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))]),rt.loaded&&!rt.available?(p(),m("div",Lv,[A(G,{name:"lock",size:14,class:"mr-1 inline"}),c[105]||(c[105]=z(" File transfer is currently disabled by your administrator. Contact them to enable it. ",-1))])):$("",!0),rt.canEditOrg?(p(),m("div",Av,[c[106]||(c[106]=a("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),A(kn,{modelValue:Kn.value,"onUpdate:modelValue":c[31]||(c[31]=k=>Kn.value=k),options:dt},null,8,["modelValue"])])):$("",!0),$n.value?(p(),at(ke,{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:xe(()=>[A(en,{"model-value":rt.orgEnabled,disabled:!rt.available,"onUpdate:modelValue":ra},null,8,["model-value","disabled"])]),_:1})):(p(),at(ke,{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:xe(()=>[A(en,{"model-value":rt.enabled,disabled:!rt.available||!rt.orgEnabled,"onUpdate:modelValue":ra},null,8,["model-value","disabled"])]),_:1})),!$n.value&&rt.available&&!rt.orgEnabled?(p(),m("div",Mv,[A(G,{name:"lock",size:13,class:"mr-1 inline"}),c[108]||(c[108]=z("File transfer is turned off for your organization",-1)),rt.canEditOrg?(p(),m("span",Ev,[...c[107]||(c[107]=[z(" — switch to ",-1),a("span",{class:"font-semibold"},"Organization",-1),z(" to turn it back on",-1)])])):$("",!0),c[109]||(c[109]=z(". ",-1))])):$("",!0),$n.value?(p(),m("div",Ov,[A(G,{name:"users",size:13,class:"mr-1 inline"}),c[110]||(c[110]=z("These are organization-wide settings — they apply to everyone in ",-1)),a("span",zv,w(t.organizationName||"your organization"),1),c[111]||(c[111]=z(". Leave the connection blank to let each user configure their own; a connection set here overrides the user's. ",-1))])):Pe.value?(p(),m("div",Iv," As a superadmin you manage the global file-transfer configuration in the API Server panel. The effective configuration is shown below. ")):$("",!0),A(ke,{title:"Protocol",desc:"SFTP (over SSH), FTPS (FTP over TLS), or plain FTP.",keywords:"protocol sftp ftps ftp"},{default:xe(()=>[rn("protocol")?(p(),m("span",$v,[z(w(oa(ve("protocol").effective))+" ",1),At("protocol")?(p(),m("span",Nv,[A(G,{name:"lock",size:10}),z(w(At("protocol")),1)])):$("",!0)])):(p(),at(kn,{key:1,modelValue:ct.protocol,"onUpdate:modelValue":c[32]||(c[32]=k=>ct.protocol=k),options:mn},null,8,["modelValue"]))]),_:1}),A(ke,{title:"Host",desc:"Server hostname or IP address.",keywords:"host server address"},{default:xe(()=>[rn("host")?(p(),m("span",Dv,[z(w(ve("host").effective||"—")+" ",1),At("host")?(p(),m("span",Fv,[A(G,{name:"lock",size:10}),z(w(At("host")),1)])):$("",!0)])):Q((p(),m("input",{key:1,"onUpdate:modelValue":c[33]||(c[33]=k=>ct.host=k),class:"field w-64",placeholder:"files.example.com"},null,512)),[[ye,ct.host]])]),_:1}),A(ke,{title:"Port",desc:"Leave blank for the protocol default (22 for SFTP, 21 for FTP/FTPS).",keywords:"port"},{default:xe(()=>[rn("port")?(p(),m("span",Rv,[z(w(ve("port").effective||"default")+" ",1),At("port")?(p(),m("span",Bv,[A(G,{name:"lock",size:10}),z(w(At("port")),1)])):$("",!0)])):Q((p(),m("input",{key:1,"onUpdate:modelValue":c[34]||(c[34]=k=>ct.port=k),inputmode:"numeric",class:"field w-24 font-mono",placeholder:"22"},null,512)),[[ye,ct.port]])]),_:1}),A(ke,{title:"Username",desc:"Account used to authenticate.",keywords:"username login account"},{default:xe(()=>[rn("username")?(p(),m("span",Uv,[z(w(ve("username").effective||"—")+" ",1),At("username")?(p(),m("span",Vv,[A(G,{name:"lock",size:10}),z(w(At("username")),1)])):$("",!0)])):Q((p(),m("input",{key:1,"onUpdate:modelValue":c[35]||(c[35]=k=>ct.username=k),class:"field w-64",placeholder:"user"},null,512)),[[ye,ct.username]])]),_:1}),A(ke,{title:"Password",desc:"Password auth for FTP/FTPS, or SFTP password login. Leave blank to use a key.",keywords:"password secret credentials"},{default:xe(()=>[rn("password")?(p(),m("span",Zv,[z(w(ve("password").effective||"—")+" ",1),At("password")?(p(),m("span",Hv,[A(G,{name:"lock",size:10}),z(w(At("password")),1)])):$("",!0)])):Q((p(),m("input",{key:1,"onUpdate:modelValue":c[36]||(c[36]=k=>ct.password=k),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[ye,ct.password]])]),_:1}),an.value==="sftp"?(p(),at(ke,{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:xe(()=>[rn("privateKey")?(p(),m("span",jv,[z(w(ve("privateKey").effective||"—")+" ",1),At("privateKey")?(p(),m("span",Wv,[A(G,{name:"lock",size:10}),z(w(At("privateKey")),1)])):$("",!0)])):Q((p(),m("textarea",{key:1,"onUpdate:modelValue":c[37]||(c[37]=k=>ct.privateKey=k),rows:"3",class:"field w-full font-mono text-xs",placeholder:"-----BEGIN OPENSSH PRIVATE KEY-----"},null,512)),[[ye,ct.privateKey]])]),_:1})):$("",!0),an.value==="sftp"?(p(),at(ke,{key:8,title:"Private key passphrase",desc:"Passphrase protecting the SSH private key, if any.",keywords:"passphrase key secret"},{default:xe(()=>[rn("keyPassphrase")?(p(),m("span",Kv,[z(w(ve("keyPassphrase").effective||"—")+" ",1),At("keyPassphrase")?(p(),m("span",Gv,[A(G,{name:"lock",size:10}),z(w(At("keyPassphrase")),1)])):$("",!0)])):Q((p(),m("input",{key:1,"onUpdate:modelValue":c[38]||(c[38]=k=>ct.keyPassphrase=k),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[ye,ct.keyPassphrase]])]),_:1})):$("",!0),an.value==="sftp"?(p(),at(ke,{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:xe(()=>[rn("hostKeyFingerprint")?(p(),m("span",qv,[z(w(ve("hostKeyFingerprint").effective||"—")+" ",1),At("hostKeyFingerprint")?(p(),m("span",Yv,[A(G,{name:"lock",size:10}),z(w(At("hostKeyFingerprint")),1)])):$("",!0)])):Q((p(),m("input",{key:1,"onUpdate:modelValue":c[39]||(c[39]=k=>ct.hostKeyFingerprint=k),class:"field w-full font-mono text-xs",placeholder:"SHA256:…"},null,512)),[[ye,ct.hostKeyFingerprint]])]),_:1})):$("",!0),an.value==="ftps"?(p(),at(ke,{key:10,title:"TLS verification",desc:"Skip only for self-signed test servers.",keywords:"tls certificate verify insecure ftps"},{default:xe(()=>[rn("insecureSkipVerify")?(p(),m("span",Jv,[z(w(ve("insecureSkipVerify").effective==="true"?"Skip verification":"Verify certificate")+" ",1),At("insecureSkipVerify")?(p(),m("span",Xv,[A(G,{name:"lock",size:10}),z(w(At("insecureSkipVerify")),1)])):$("",!0)])):(p(),at(kn,{key:1,modelValue:ct.insecureSkipVerify,"onUpdate:modelValue":c[40]||(c[40]=k=>ct.insecureSkipVerify=k),options:Ii},null,8,["modelValue"]))]),_:1})):$("",!0),A(ke,{title:"Base path",desc:"Working directory and health-check target, e.g. /uploads.",keywords:"base path directory folder root"},{default:xe(()=>[rn("basePath")?(p(),m("span",Qv,[z(w(ve("basePath").effective||"—")+" ",1),At("basePath")?(p(),m("span",e_,[A(G,{name:"lock",size:10}),z(w(At("basePath")),1)])):$("",!0)])):Q((p(),m("input",{key:1,"onUpdate:modelValue":c[41]||(c[41]=k=>ct.basePath=k),class:"field w-64 font-mono",placeholder:"/uploads"},null,512)),[[ye,ct.basePath]])]),_:1}),a("div",t_,[Pe.value?$("",!0):(p(),m("button",{key:0,class:"btn-accent",disabled:O.value||!rt.available,onClick:or},w(O.value?"Saving…":$n.value?"Save organization settings":"Save settings"),9,n_)),$n.value?$("",!0):(p(),m("button",{key:1,class:"btn-ghost",disabled:Ie.value||!rt.available,onClick:sr},w(Ie.value?"Testing…":"Test connection"),9,i_)),j.value?(p(),m("span",o_,w(j.value),1)):$("",!0),Et.value&&!$n.value?(p(),m("span",s_,"Checked "+w(sa()),1)):$("",!0),it.value&&!$n.value?(p(),m("span",{key:4,class:Ae(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",la(it.value.status)])},[c[112]||(c[112]=a("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),z(w(it.value.detail||it.value.status),1)],2)):$("",!0)])]),a("div",a_,[a("div",r_,[a("div",l_,[A(G,{name:"cloud",size:20})]),c[113]||(c[113]=a("div",{class:"min-w-0"},[a("div",{class:"text-sm font-semibold text-ink"},"WebDAV"),a("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))]),ht.loaded&&!ht.available?(p(),m("div",u_,[A(G,{name:"lock",size:14,class:"mr-1 inline"}),c[114]||(c[114]=z(" WebDAV is currently disabled by your administrator. Contact them to enable it. ",-1))])):$("",!0),ht.canEditOrg?(p(),m("div",c_,[c[115]||(c[115]=a("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),A(kn,{modelValue:Gn.value,"onUpdate:modelValue":c[42]||(c[42]=k=>Gn.value=k),options:dt},null,8,["modelValue"])])):$("",!0),ut.value?(p(),at(ke,{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:xe(()=>[A(en,{"model-value":ht.orgEnabled,disabled:!ht.available,"onUpdate:modelValue":ca},null,8,["model-value","disabled"])]),_:1})):(p(),at(ke,{key:3,title:"Enable WebDAV",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin webdav"},{default:xe(()=>[A(en,{"model-value":ht.enabled,disabled:!ht.available||!ht.orgEnabled,"onUpdate:modelValue":ca},null,8,["model-value","disabled"])]),_:1})),!ut.value&&ht.available&&!ht.orgEnabled?(p(),m("div",d_,[A(G,{name:"lock",size:13,class:"mr-1 inline"}),c[117]||(c[117]=z("WebDAV is turned off for your organization",-1)),ht.canEditOrg?(p(),m("span",f_,[...c[116]||(c[116]=[z(" — switch to ",-1),a("span",{class:"font-semibold"},"Organization",-1),z(" to turn it back on",-1)])])):$("",!0),c[118]||(c[118]=z(". ",-1))])):$("",!0),ut.value?(p(),m("div",h_,[A(G,{name:"users",size:13,class:"mr-1 inline"}),c[119]||(c[119]=z("These are organization-wide settings — they apply to everyone in ",-1)),a("span",p_,w(t.organizationName||"your organization"),1),c[120]||(c[120]=z(". Leave the connection blank to let each user configure their own; a connection set here overrides the user's. ",-1))])):$o.value?(p(),m("div",m_," As a superadmin you manage the global WebDAV configuration in the API Server panel. The effective configuration is shown below. ")):$("",!0),A(ke,{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:xe(()=>[Pn("baseURL")?(p(),m("span",g_,[z(w(Tn("baseURL").effective||"—")+" ",1),jt("baseURL")?(p(),m("span",v_,[A(G,{name:"lock",size:10}),z(w(jt("baseURL")),1)])):$("",!0)])):Q((p(),m("input",{key:1,"onUpdate:modelValue":c[43]||(c[43]=k=>Yt.baseURL=k),class:"field w-full font-mono text-xs",placeholder:"https://cloud.example.com/remote.php/dav/files/alice/"},null,512)),[[ye,Yt.baseURL]])]),_:1}),A(ke,{title:"Username",desc:"Account used to authenticate (leave blank for a public share).",keywords:"username login account"},{default:xe(()=>[Pn("username")?(p(),m("span",__,[z(w(Tn("username").effective||"—")+" ",1),jt("username")?(p(),m("span",b_,[A(G,{name:"lock",size:10}),z(w(jt("username")),1)])):$("",!0)])):Q((p(),m("input",{key:1,"onUpdate:modelValue":c[44]||(c[44]=k=>Yt.username=k),class:"field w-64",placeholder:"user"},null,512)),[[ye,Yt.username]])]),_:1}),A(ke,{title:"Password",desc:"Password or app-specific token for HTTP Basic auth.",keywords:"password secret credentials token"},{default:xe(()=>[Pn("password")?(p(),m("span",y_,[z(w(Tn("password").effective||"—")+" ",1),jt("password")?(p(),m("span",x_,[A(G,{name:"lock",size:10}),z(w(jt("password")),1)])):$("",!0)])):Q((p(),m("input",{key:1,"onUpdate:modelValue":c[45]||(c[45]=k=>Yt.password=k),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[ye,Yt.password]])]),_:1}),A(ke,{title:"TLS verification",desc:"Only affects HTTPS. Skip only for self-signed test servers.",keywords:"tls certificate verify insecure https"},{default:xe(()=>[Pn("insecureSkipVerify")?(p(),m("span",w_,[z(w(Tn("insecureSkipVerify").effective==="true"?"Skip verification":"Verify certificate")+" ",1),jt("insecureSkipVerify")?(p(),m("span",k_,[A(G,{name:"lock",size:10}),z(w(jt("insecureSkipVerify")),1)])):$("",!0)])):(p(),at(kn,{key:1,modelValue:Yt.insecureSkipVerify,"onUpdate:modelValue":c[46]||(c[46]=k=>Yt.insecureSkipVerify=k),options:ua},null,8,["modelValue"]))]),_:1}),A(ke,{title:"Base path",desc:"Working directory under the server URL and health-check target, e.g. /Documents.",keywords:"base path directory folder root"},{default:xe(()=>[Pn("basePath")?(p(),m("span",S_,[z(w(Tn("basePath").effective||"—")+" ",1),jt("basePath")?(p(),m("span",T_,[A(G,{name:"lock",size:10}),z(w(jt("basePath")),1)])):$("",!0)])):Q((p(),m("input",{key:1,"onUpdate:modelValue":c[47]||(c[47]=k=>Yt.basePath=k),class:"field w-64 font-mono",placeholder:"/Documents"},null,512)),[[ye,Yt.basePath]])]),_:1}),a("div",P_,[$o.value?$("",!0):(p(),m("button",{key:0,class:"btn-accent",disabled:zo.value||!ht.available,onClick:Fo},w(zo.value?"Saving…":ut.value?"Save organization settings":"Save settings"),9,C_)),ut.value?$("",!0):(p(),m("button",{key:1,class:"btn-ghost",disabled:Io.value||!ht.available,onClick:mi},w(Io.value?"Testing…":"Test connection"),9,L_)),no.value?(p(),m("span",A_,w(no.value),1)):$("",!0),Nn.value&&!ut.value?(p(),m("span",M_,"Checked "+w(Mt()),1)):$("",!0),Sn.value&&!ut.value?(p(),m("span",{key:4,class:Ae(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",Ot(Sn.value.status)])},[c[121]||(c[121]=a("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),z(w(Sn.value.detail||Sn.value.status),1)],2)):$("",!0)])])],64)):$("",!0),Zi("drives-local")?(p(),m("div",E_,[a("div",O_,[a("div",z_,[A(G,{name:"monitor",size:20})]),c[122]||(c[122]=a("div",{class:"min-w-0"},[a("div",{class:"text-sm font-semibold text-ink"},"Local Storage"),a("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))]),Ee.loaded&&!Ee.available?(p(),m("div",I_,[A(G,{name:"lock",size:14,class:"mr-1 inline"}),c[123]||(c[123]=z(" Local storage is currently disabled by your administrator. Contact them to enable it. ",-1))])):Ee.loaded&&!Ee.rootConfigured?(p(),m("div",$_,[A(G,{name:"alertTriangle",size:14,class:"mr-1 inline"}),c[124]||(c[124]=z(" No storage root has been configured by your administrator yet. ",-1))])):$("",!0),Ee.canEditOrg?(p(),m("div",N_,[c[125]||(c[125]=a("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),A(kn,{modelValue:Ui.value,"onUpdate:modelValue":c[48]||(c[48]=k=>Ui.value=k),options:dt},null,8,["modelValue"])])):$("",!0),vn.value?(p(),at(ke,{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:xe(()=>[A(en,{"model-value":Ee.orgEnabled,disabled:!Ee.available,"onUpdate:modelValue":xs},null,8,["model-value","disabled"])]),_:1})):(p(),at(ke,{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:xe(()=>[A(en,{"model-value":Ee.enabled,disabled:!Ee.available||!Ee.orgEnabled,"onUpdate:modelValue":xs},null,8,["model-value","disabled"])]),_:1})),!vn.value&&Ee.available&&!Ee.orgEnabled?(p(),m("div",D_,[A(G,{name:"lock",size:13,class:"mr-1 inline"}),c[127]||(c[127]=z("Local storage is turned off for your organization",-1)),Ee.canEditOrg?(p(),m("span",F_,[...c[126]||(c[126]=[z(" — switch to ",-1),a("span",{class:"font-semibold"},"Organization",-1),z(" to turn it back on",-1)])])):$("",!0),c[128]||(c[128]=z(". ",-1))])):$("",!0),vn.value?(p(),m("div",R_,[A(G,{name:"users",size:13,class:"mr-1 inline"}),c[129]||(c[129]=z("These are organization-wide settings — they apply to everyone in ",-1)),a("span",B_,w(t.organizationName||"your organization"),1),c[130]||(c[130]=z(", who all share the organization folder. Members can additionally enable a private folder inside it. ",-1))])):_s.value?(p(),m("div",U_," As a superadmin you manage the global storage root in the API Server panel. The effective configuration is shown below. ")):$("",!0),vn.value?(p(),at(ke,{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:xe(()=>[A(en,{"model-value":Ee.allowPrivate,disabled:!Ee.available,"onUpdate:modelValue":ur},null,8,["model-value","disabled"])]),_:1})):$("",!0),vn.value?$("",!0):(p(),m(oe,{key:9},[A(ke,{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:xe(()=>[a("div",V_,[(p(!0),m(oe,null,Fe(Ee.mounts,k=>(p(),m("div",{key:k.id,class:"flex flex-wrap items-center gap-2"},[a("span",Z_,w(k.path),1),k.kind==="shared"?(p(),m("span",H_,[A(G,{name:"users",size:10}),c[131]||(c[131]=z("Shared with your organization",-1))])):(p(),m("span",j_,[A(G,{name:"lock",size:10}),c[132]||(c[132]=z("Private to you",-1))])),so.value[k.id]?(p(),m("span",{key:2,class:Ae(["inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[10px] font-semibold",va(so.value[k.id].status)])},[c[133]||(c[133]=a("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),z(w(so.value[k.id].status),1)],2)):$("",!0)]))),128)),Ee.mounts.length?$("",!0):(p(),m("div",W_,w(Ee.rootConfigured?"No folder assigned yet.":"Waiting for the administrator to configure a storage root."),1))])]),_:1}),Ee.isOrgUser&&Ee.allowPrivate?(p(),at(ke,{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:xe(()=>[A(en,{"model-value":Ee.privateFolder,disabled:!Ee.available||!Ee.orgEnabled,"onUpdate:modelValue":ga},null,8,["model-value","disabled"])]),_:1})):Ee.isOrgUser&&!Ee.allowPrivate?(p(),m("div",K_,[A(G,{name:"lock",size:13,class:"mr-1 inline"}),c[134]||(c[134]=z("Private folders are turned off by your organization. ",-1))])):$("",!0)],64)),A(ke,{title:"Access mode",desc:"Read-only prevents uploads, deletes and folder creation.",keywords:"read only write access mode permission"},{default:xe(()=>[ha("readOnly")?(p(),m("span",G_,[z(w(rr(Vi("readOnly").effective))+" ",1),Ln("readOnly")?(p(),m("span",q_,[A(G,{name:"lock",size:10}),z(w(Ln("readOnly")),1)])):$("",!0)])):(p(),at(kn,{key:1,modelValue:oo.value,"onUpdate:modelValue":c[49]||(c[49]=k=>oo.value=k),options:Zo},null,8,["modelValue"]))]),_:1}),a("div",Y_,[_s.value?$("",!0):(p(),m("button",{key:0,class:"btn-accent",disabled:Vo.value||!Ee.available,onClick:cr},w(Vo.value?"Saving…":vn.value?"Save organization settings":"Save settings"),9,J_)),vn.value?$("",!0):(p(),m("button",{key:1,class:"btn-ghost",disabled:Xt.value||!Ee.available,onClick:ws},w(Xt.value?"Testing…":"Test folder"),9,X_)),Xe.value?(p(),m("span",Q_,w(Xe.value),1)):$("",!0),bi.value&&!vn.value?(p(),m("span",e1,"Checked "+w(pa()),1)):$("",!0),ln.value&&!vn.value?(p(),m("span",{key:4,class:Ae(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",va(ln.value.status)])},[c[135]||(c[135]=a("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),z(w(ln.value.detail||ln.value.status),1)],2)):$("",!0)])])):$("",!0)])):H.id==="profile"?(p(),m("div",t1,[A(ke,{block:"",title:"Profile photo",desc:"PNG or JPG, up to ~1.5 MB. Stored on this device.",keywords:"avatar photo picture"},{default:xe(()=>[a("div",n1,[Oe(be).avatar?(p(),m("img",{key:0,src:Oe(be).avatar,alt:"Avatar",class:"h-16 w-16 rounded-full object-cover"},null,8,i1)):(p(),m("div",o1,w(ba.value),1)),a("div",s1,[a("label",a1,[A(G,{name:"upload",size:15,class:"mr-1.5 inline"}),c[136]||(c[136]=z("Upload ",-1)),a("input",{type:"file",accept:"image/*",class:"hidden",onChange:fr},null,32)]),Oe(be).avatar?(p(),m("button",{key:0,class:"btn-ghost",onClick:hr},"Remove")):$("",!0)])])]),_:1}),A(ke,{title:"Display name",desc:"The name shown on your public profile.",keywords:"display name profile"},{default:xe(()=>[Q(a("input",{"onUpdate:modelValue":c[50]||(c[50]=k=>Oe(be).displayName=k),class:"field w-56",placeholder:"Jane O.",onBlur:c[51]||(c[51]=k=>Je("Saved."))},null,544),[[ye,Oe(be).displayName]])]),_:1}),A(ke,{block:"",title:"Bio",desc:"A short description others can see.",keywords:"bio about description"},{default:xe(()=>[Q(a("textarea",{"onUpdate:modelValue":c[52]||(c[52]=k=>Oe(be).bio=k),rows:"3",maxlength:"240",class:"field w-full resize-none",placeholder:"Flight director, North yard operations…",onBlur:c[53]||(c[53]=k=>Je("Saved."))},null,544),[[ye,Oe(be).bio]]),a("div",r1,w((Oe(be).bio||"").length)+"/240",1)]),_:1}),A(ke,{title:"Show email on profile",desc:"Let teammates see your email address.",keywords:"show email public visibility"},{default:xe(()=>[A(en,{modelValue:Oe(be).showEmail,"onUpdate:modelValue":c[54]||(c[54]=k=>Oe(be).showEmail=k)},null,8,["modelValue"])]),_:1})])):H.id==="security"?(p(),m("div",l1,[A(ke,{block:"",title:"Two-factor authentication",desc:"Require a one-time code at sign-in.",keywords:"two factor 2fa authentication security"},{default:xe(()=>[a("div",u1,[a("span",{class:Ae(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",Oe(be).twoFactor?"bg-success-soft text-success-fg":"bg-surface-2 text-ink-secondary"])},[c[137]||(c[137]=a("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),z(w(Oe(be).twoFactor?"Enabled":"Disabled"),1)],2),!Oe(be).twoFactor&&!ro.value?(p(),m("button",{key:0,class:"btn-accent",onClick:Hi},"Enable 2FA")):Oe(be).twoFactor?(p(),m("button",{key:1,class:"btn-ghost",onClick:uo},"Disable")):$("",!0)]),ro.value?(p(),m("div",c1,[a("div",d1,[c[139]||(c[139]=a("div",{class:"grid h-28 w-28 place-items-center rounded bg-white p-2"},[a("svg",{viewBox:"0 0 100 100",class:"h-full w-full"},[a("rect",{width:"100",height:"100",fill:"#fff"}),a("g",{fill:"#0F1E3D"},[a("rect",{x:"6",y:"6",width:"24",height:"24"}),a("rect",{x:"70",y:"6",width:"24",height:"24"}),a("rect",{x:"6",y:"70",width:"24",height:"24"}),a("rect",{x:"12",y:"12",width:"12",height:"12",fill:"#fff"}),a("rect",{x:"76",y:"12",width:"12",height:"12",fill:"#fff"}),a("rect",{x:"12",y:"76",width:"12",height:"12",fill:"#fff"}),a("rect",{x:"40",y:"10",width:"8",height:"8"}),a("rect",{x:"52",y:"20",width:"8",height:"8"}),a("rect",{x:"40",y:"40",width:"8",height:"8"}),a("rect",{x:"60",y:"44",width:"8",height:"8"}),a("rect",{x:"44",y:"60",width:"8",height:"8"}),a("rect",{x:"70",y:"60",width:"8",height:"8"}),a("rect",{x:"80",y:"72",width:"8",height:"8"}),a("rect",{x:"60",y:"80",width:"8",height:"8"})])])],-1)),a("div",f1,[c[138]||(c[138]=a("div",{class:"text-xs text-ink-secondary"},"Scan with an authenticator app, or enter this secret:",-1)),a("div",h1,w(bn.value),1),a("div",p1,[Q(a("input",{"onUpdate:modelValue":c[55]||(c[55]=k=>Jn.value=k),inputmode:"numeric",maxlength:"6",class:"field w-28 font-mono tracking-[0.3em]",placeholder:"000000"},null,512),[[ye,Jn.value]]),a("button",{class:"btn-accent",onClick:pr},"Verify & enable")]),lo.value?(p(),m("p",m1,w(lo.value),1)):$("",!0)])])])):$("",!0),Oe(be).twoFactor&&yn.value.length?(p(),m("div",g1,[c[140]||(c[140]=a("div",{class:"text-xs font-semibold text-ink"},"Recovery codes",-1)),c[141]||(c[141]=a("div",{class:"mt-0.5 text-xs text-ink-muted"},"Store these somewhere safe — each works once.",-1)),a("div",v1,[(p(!0),m(oe,null,Fe(yn.value,k=>(p(),m("span",{key:k,class:"select-all"},w(k),1))),128))])])):$("",!0),c[142]||(c[142]=a("p",{class:"mt-2 text-xs text-ink-muted"},"Prototype — codes are generated locally until the account service verifies them.",-1))]),_:1}),A(ke,{block:"",title:"Active sessions",desc:"Devices currently signed in to your account.",keywords:"sessions devices logout sign out remote"},{default:xe(()=>[a("div",_1,[a("div",b1,[a("div",y1,[A(G,{name:"monitor",size:18})]),a("div",x1,[a("div",w1,[z(w(Wo())+" on "+w(mr())+" ",1),c[143]||(c[143]=a("span",{class:"ml-1 rounded-full bg-success-soft px-2 py-0.5 text-[10px] font-semibold text-success-fg"},"This device",-1))]),a("div",k1,"Signed in "+w(Oe(ku)(Oe(ii))),1)]),a("button",{class:"btn-ghost",onClick:c[56]||(c[56]=k=>l("logout"))},"Log out")])]),c[144]||(c[144]=a("button",{class:"btn-ghost mt-2 opacity-60",disabled:"",title:"Requires the account service"}," Log out all other devices ",-1)),c[145]||(c[145]=a("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"?(p(),m("div",S1,[tt.id?(p(),m("div",T1,[A(ke,{block:"",title:`Edit user — ${tt.email}`,desc:"Update details, change role, reset password, or set verified.",keywords:"edit user update role password verified organization"},{default:xe(()=>[a("div",P1,[a("div",C1,[Q(a("input",{"onUpdate:modelValue":c[57]||(c[57]=k=>tt.email=k),type:"email",class:"field flex-1",placeholder:"name@pilotvault.local"},null,512),[[ye,tt.email]]),Q(a("select",{"onUpdate:modelValue":c[58]||(c[58]=k=>tt.role=k),class:"field w-32",disabled:qo.value,title:qo.value?"You cannot change your own role":""},[(p(!0),m(oe,null,Fe(ya.value,k=>(p(),m("option",{key:k.value,value:k.value},w(k.label),9,A1))),128))],8,L1),[[zt,tt.role]])]),u.value?Q((p(),m("select",{key:0,"onUpdate:modelValue":c[59]||(c[59]=k=>tt.organization=k),class:"field",title:"Organization"},[(p(!0),m(oe,null,Fe(Cs.value,k=>(p(),m("option",{key:k.value,value:k.value},w(k.label),9,M1))),128))],512)),[[zt,tt.organization]]):$("",!0),Q(a("input",{"onUpdate:modelValue":c[60]||(c[60]=k=>tt.password=k),type:"password",class:"field",placeholder:"New password (leave blank to keep current)"},null,512),[[ye,tt.password]]),a("label",E1,[A(en,{modelValue:tt.verified,"onUpdate:modelValue":c[61]||(c[61]=k=>tt.verified=k)},null,8,["modelValue"]),c[146]||(c[146]=z(" Email verified ",-1))]),a("div",O1,[a("button",{class:"btn-accent",disabled:Wi.value,onClick:vr},w(Wi.value?"Saving…":"Save changes"),9,z1),a("button",{class:"btn-ghost",onClick:fo},"Cancel"),Mn.value?(p(),m("span",I1,w(Mn.value),1)):$("",!0),qo.value?(p(),m("span",$1,"Editing your own account — role locked.")):$("",!0)])])]),_:1},8,["title"])])):(p(),m("div",N1,[A(ke,{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:xe(()=>[a("div",D1,[a("div",F1,[Q(a("input",{"onUpdate:modelValue":c[62]||(c[62]=k=>Ft.email=k),type:"email",class:"field flex-1",placeholder:"name@pilotvault.local"},null,512),[[ye,Ft.email]]),Q(a("select",{"onUpdate:modelValue":c[63]||(c[63]=k=>Ft.role=k),class:"field w-32"},[(p(!0),m(oe,null,Fe(ya.value,k=>(p(),m("option",{key:k.value,value:k.value},w(k.label),9,R1))),128))],512),[[zt,Ft.role]])]),u.value?Q((p(),m("select",{key:0,"onUpdate:modelValue":c[64]||(c[64]=k=>Ft.organization=k),class:"field",title:"Organization"},[(p(!0),m(oe,null,Fe(Cs.value,k=>(p(),m("option",{key:k.value,value:k.value},w(k.label),9,B1))),128))],512)),[[zt,Ft.organization]]):(p(),m("div",U1,[c[147]||(c[147]=z(" New users join your organization: ",-1)),a("span",V1,w(t.organizationName||"—"),1)])),Q(a("input",{"onUpdate:modelValue":c[65]||(c[65]=k=>Ft.password=k),type:"password",class:"field",placeholder:"Temporary password (min 8 chars)"},null,512),[[ye,Ft.password]]),a("div",Z1,[a("button",{class:"btn-accent",disabled:Ko.value,onClick:Ls},w(Ko.value?"Creating…":"Create user"),9,H1),Qt.value?(p(),m("span",j1,w(Qt.value),1)):$("",!0)])])]),_:1})])),a("div",W1,[a("div",K1,[c[148]||(c[148]=a("div",null,[a("div",{class:"eyebrow"},"Team"),a("div",{class:"mt-0.5 text-base font-semibold text-ink"},"All users")],-1)),a("button",{class:"btn-ghost",disabled:co.value,onClick:si},w(co.value?"Loading…":"Refresh"),9,G1)]),ji.value?(p(),m("div",q1,w(ji.value),1)):!xi.value.length&&!co.value?(p(),m("div",Y1,"No users yet.")):(p(),m("div",J1,[a("table",X1,[a("thead",null,[a("tr",Q1,[(p(),m(oe,null,Fe(["User","Role","Organization","Status",""],k=>a("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"},w(k),1)),64))])]),a("tbody",null,[(p(!0),m(oe,null,Fe(xi.value,k=>(p(),m("tr",{key:k.id,class:Ae(["border-b border-line last:border-0",tt.id===k.id?"bg-accent-soft":""])},[a("td",eb,[a("span",tb,w(k.email),1),k.email===t.email?(p(),m("span",nb,"(you)")):$("",!0)]),a("td",ib,[a("span",{class:Ae(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",y(k.role||"user")])},[A(G,{name:_(k.role||"user"),size:12},null,8,["name"]),z(w(h(k.role||"user")),1)],2)]),a("td",ob,[a("span",{class:Ae(["text-sm",k.organizationName?"text-ink-secondary":"text-ink-muted"])},w(k.organizationName||"—"),3)]),a("td",sb,[a("span",{class:Ae(["text-xs",k.verified?"text-success-fg":"text-ink-muted"])},w(k.verified?"Verified":"Unverified"),3)]),a("td",ab,[Rn.value===k.id?(p(),m(oe,{key:0},[c[149]||(c[149]=a("span",{class:"mr-2 text-xs text-ink-muted"},"Remove?",-1)),a("button",{class:"btn-ghost mr-1",onClick:c[66]||(c[66]=He=>Rn.value="")},"Cancel"),a("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:He=>Go(k)}," Remove ",8,rb)],64)):(p(),m("div",lb,[a("button",{class:"btn-ghost inline-flex items-center gap-1.5",onClick:He=>gr(k)},[A(G,{name:"settings",size:14}),c[150]||(c[150]=z(" Edit ",-1))],8,ub),k.email!==t.email?(p(),m("button",{key:0,class:"btn-ghost inline-flex items-center gap-1.5",onClick:He=>Rn.value=k.id},[A(G,{name:"trash",size:14}),c[151]||(c[151]=z(" Remove ",-1))],8,cb)):$("",!0)]))])],2))),128))])])]))])])):H.id==="organizations"?(p(),m("div",db,[It.id?(p(),m("div",fb,[A(ke,{block:"",title:"Rename organization",desc:"Update the organization's display name.",keywords:"rename organization edit"},{default:xe(()=>[a("div",hb,[Q(a("input",{"onUpdate:modelValue":c[67]||(c[67]=k=>It.name=k),class:"field",placeholder:"Organization name",onKeyup:hu(xa,["enter"])},null,544),[[ye,It.name]]),a("div",pb,[a("button",{class:"btn-accent",onClick:xa},"Save changes"),a("button",{class:"btn-ghost",onClick:Ms},"Cancel"),Bn.value?(p(),m("span",mb,w(Bn.value),1)):$("",!0)])])]),_:1})])):(p(),m("div",gb,[A(ke,{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:xe(()=>[a("div",vb,[Q(a("input",{"onUpdate:modelValue":c[68]||(c[68]=k=>ho.name=k),class:"field",placeholder:"e.g. Northwind Aerial",onKeyup:hu(vo,["enter"])},null,544),[[ye,ho.name]]),a("div",_b,[a("button",{class:"btn-accent",disabled:mo.value,onClick:vo},w(mo.value?"Creating…":"Create organization"),9,bb),po.value?(p(),m("span",yb,w(po.value),1)):$("",!0)])])]),_:1})])),a("div",xb,[a("div",{class:"flex items-center justify-between px-5 py-4"},[c[152]||(c[152]=a("div",null,[a("div",{class:"eyebrow"},"Tenancy"),a("div",{class:"mt-0.5 text-base font-semibold text-ink"},"All organizations")],-1)),a("button",{class:"btn-ghost",onClick:oi},"Refresh")]),xn.value.length?(p(),m("div",kb,[a("table",Sb,[a("thead",null,[a("tr",Tb,[(p(),m(oe,null,Fe(["Organization","Members",""],k=>a("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"},w(k),1)),64))])]),a("tbody",null,[(p(!0),m(oe,null,Fe(xn.value,k=>(p(),m("tr",{key:k.id,class:Ae(["border-b border-line last:border-0",It.id===k.id?"bg-accent-soft":""])},[a("td",Pb,[a("span",Cb,[A(G,{name:"grid",size:14,class:"text-ink-muted"}),z(w(k.name),1)])]),a("td",Lb,w(As.value[k.id]||0),1),a("td",Ab,[go.value===k.id?(p(),m(oe,{key:0},[c[153]||(c[153]=a("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),a("button",{class:"btn-ghost mr-1",onClick:c[69]||(c[69]=He=>go.value="")},"Cancel"),a("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:He=>_o(k)}," Delete ",8,Mb)],64)):(p(),m("div",Eb,[a("button",{class:"btn-ghost inline-flex items-center gap-1.5",onClick:He=>_r(k)},[A(G,{name:"settings",size:14}),c[154]||(c[154]=z(" Rename ",-1))],8,Ob),a("button",{class:"btn-ghost inline-flex items-center gap-1.5",disabled:(As.value[k.id]||0)>0,title:(As.value[k.id]||0)>0?"Reassign or remove members first":"",onClick:He=>go.value=k.id},[A(G,{name:"trash",size:14}),c[155]||(c[155]=z(" Delete ",-1))],8,zb)]))])],2))),128))])])])):(p(),m("div",wb,"No organizations yet."))])])):H.id==="advanced"?(p(),m("div",Ib,[a("div",$b,[A(ke,{title:"Export data",desc:"Download your settings and profile as JSON.",keywords:"export data download backup"},{default:xe(()=>[a("button",{class:"btn-ghost",onClick:br},[A(G,{name:"download",size:15,class:"mr-1.5 inline"}),c[156]||(c[156]=z("Export",-1))])]),_:1}),A(ke,{block:"",title:"Import data",desc:"Restore settings from a previous export.",keywords:"import data upload restore"},{default:xe(()=>[a("label",Nb,[A(G,{name:"upload",size:15,class:"mr-1.5 inline"}),c[157]||(c[157]=z("Choose file… ",-1)),a("input",{type:"file",accept:"application/json,.json",class:"hidden",onChange:wa},null,32)]),Xn.value?(p(),m("p",Db,w(Xn.value),1)):$("",!0)]),_:1})]),a("div",Fb,[a("div",Rb,[A(G,{name:"alertTriangle",size:18}),c[158]||(c[158]=a("h3",{class:"text-sm font-bold uppercase tracking-caps"},"Danger zone",-1))]),c[163]||(c[163]=a("p",{class:"mt-1 text-xs text-ink-secondary"},"Deleting your account is permanent and cannot be undone.",-1)),a("div",Bb,[c[162]||(c[162]=a("div",{class:"text-sm font-semibold text-ink"},"Delete account",-1)),a("label",Ub,[Q(a("input",{"onUpdate:modelValue":c[70]||(c[70]=k=>yt.understand=k),type:"checkbox",class:"mt-0.5 h-4 w-4 accent-[var(--danger)]"},null,512),[[Va,yt.understand]]),c[159]||(c[159]=z(" I understand this permanently deletes my account and all associated data. ",-1))]),a("div",Vb,[a("label",Zb,[c[160]||(c[160]=z("Type ",-1)),a("span",Hb,w(En.value),1),c[161]||(c[161]=z(" to confirm",-1))]),Q(a("input",{"onUpdate:modelValue":c[71]||(c[71]=k=>yt.typed=k),class:"field w-full max-w-[360px] font-mono",placeholder:En.value},null,8,jb),[[ye,yt.typed]])]),a("div",Wb,[yt.armed?(p(),m("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:yt.cooldown>0,onClick:yo},w(yt.cooldown>0?`Confirm in ${yt.cooldown}s…`:"Permanently delete account"),9,Gb)):(p(),m("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:!Yo.value,onClick:ka}," Delete account… ",8,Kb)),yt.armed&&yt.cooldown>0?(p(),m("span",qb,"Cooling-off period — read once more.")):$("",!0)]),yt.msg?(p(),m("p",Yb,w(yt.msg),1)):$("",!0)])])])):$("",!0)],64))),128))])]),A(vh,{name:"fade"},{default:xe(()=>[Fn.value?(p(),m("div",Jb,[A(G,{name:"check",size:16,class:"text-success-fg"}),z(w(Fn.value),1)])):$("",!0)]),_:1})]))}},Qb=Tm(Xb,[["__scopeId","data-v-cd994362"]]),ey={class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},ty={class:"flex flex-wrap items-center gap-3"},ny={class:"inline-flex rounded-lg border border-line bg-surface-1 p-0.5"},iy=["onClick"],oy={class:"ml-auto flex items-center gap-2"},sy=["href"],ay={class:"grid grid-cols-4 gap-4 max-[900px]:grid-cols-2"},ry={class:"eyebrow"},ly={key:0,class:"panel border-danger/40 p-4 text-sm text-danger-fg"},uy={key:0,class:"panel p-5"},cy={class:"mb-4 flex items-center justify-between"},dy={class:"eyebrow"},fy={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},hy={class:"block"},py={class:"block"},my={class:"block"},gy={class:"block"},vy={key:0,value:""},_y=["value"],by={class:"block"},yy={class:"block"},xy={class:"block"},wy={class:"block"},ky={class:"block"},Sy=["value"],Ty={class:"block"},Py=["value"],Cy={class:"block"},Ly=["value"],Ay={class:"block"},My={class:"mt-3 block"},Ey={key:0,class:"mt-3 grid grid-cols-2 gap-3 max-[760px]:grid-cols-1"},Oy={class:"block"},zy={class:"block"},Iy={class:"block"},$y={class:"block"},Ny={class:"col-span-2 block max-[760px]:col-span-1"},Dy={class:"mt-4 flex items-center gap-3"},Fy=["disabled"],Ry={key:0,class:"text-sm text-danger-fg"},By={class:"panel overflow-hidden p-0"},Uy={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},Vy={key:1,class:"grid place-items-center px-5 py-16 text-center"},Zy={key:2,class:"overflow-x-auto"},Hy={class:"w-full border-collapse text-sm"},jy={class:"text-left"},Wy={class:"whitespace-nowrap px-5 py-3 font-mono text-ink"},Ky={key:0,class:"text-ink-muted"},Gy={class:"px-5 py-3 text-ink-secondary"},qy=["title"],Yy={class:"px-5 py-3 font-mono text-ink-secondary"},Jy={class:"px-5 py-3 text-ink-secondary"},Xy={class:"px-5 py-3"},Qy=["onClick"],ex={class:"whitespace-nowrap px-5 py-3 text-right"},tx=["onClick"],nx=["onClick"],ix=["onClick"],ox={key:0,class:"border-b border-line bg-surface-2"},sx={colspan:"7",class:"px-5 py-3"},ax={class:"flex flex-wrap gap-x-8 gap-y-1.5 text-xs"},rx={class:"text-ink-secondary"},lx={class:"text-ink"},ux={class:"text-ink-secondary"},cx={class:"text-ink"},dx={class:"text-ink-secondary"},fx={class:"font-mono text-ink"},hx={key:0,class:"text-ink-secondary"},px={class:"text-ink"},mx={key:0,class:"mt-2 space-y-1"},gx={key:1,class:"mt-2 text-xs text-success-fg"},vx={key:0,class:"panel p-5"},_x={class:"mb-4 flex items-center justify-between"},bx={class:"eyebrow"},yx={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},xx={class:"block"},wx={class:"block"},kx={class:"block"},Sx={class:"block"},Tx={class:"block"},Px={class:"block"},Cx=["value"],Lx={class:"mt-3 flex flex-wrap gap-6"},Ax={class:"flex items-center gap-2 text-sm text-ink-secondary"},Mx={class:"flex items-center gap-2 text-sm text-ink-secondary"},Ex={class:"mt-4 flex items-center gap-3"},Ox=["disabled"],zx={key:0,class:"text-sm text-danger-fg"},Ix={class:"panel overflow-hidden p-0"},$x={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},Nx={key:1,class:"grid place-items-center px-5 py-16 text-center"},Dx={key:2,class:"overflow-x-auto"},Fx={class:"w-full border-collapse text-sm"},Rx={class:"text-left"},Bx={class:"px-5 py-3 font-semibold text-ink"},Ux={class:"px-5 py-3 text-ink-secondary"},Vx={class:"px-5 py-3 font-mono text-ink-secondary"},Zx={class:"px-5 py-3"},Hx={key:1,class:"text-ink-muted"},jx={class:"px-5 py-3"},Wx={class:"whitespace-nowrap px-5 py-3 text-right"},Kx=["onClick"],Gx=["onClick"],qx=["onClick"],Yx={__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,s={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=W("flights"),u=W([]),f=W([]),h=W(!1),_=W("");async function y(){h.value=!0,_.value="";const[J,E]=await Promise.all([Jc(),Lp()]);(!J.ok||!E.ok)&&(_.value=J.status===503||E.status===503?"Logbook storage is not configured on the API Server (service account missing).":"Could not load the logbook."),u.value=J.drones,f.value=E.flights,h.value=!1}Ei(y);function C(J){const E=J.compliance||{};return E.exempt?{tone:"neutral",label:"Exempt"}:(E.redFlags||[]).length?{tone:"danger",label:`${E.redFlags.length} issue${E.redFlags.length>1?"s":""}`}:{tone:"success",label:"Compliant"}}const T=W("");function M(J){T.value=T.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"}],K=[{value:"",label:"Auto (from drone)"},{value:"manual",label:"Manual"},{value:"automatic",label:"Automatic (FDR)"}];function F(){var J;return{operationDate:new Date().toISOString().slice(0,10),startTime:"",endTime:"",drone:((J=u.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 me=W(!1),he=W(""),Y=xt(F()),Le=W(""),ce=W(!1),Be=W(!1);function Ne(){Object.assign(Y,F()),he.value="",Le.value="",Be.value=!1,me.value=!0}function ze(J){Object.assign(Y,{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||""}),he.value=J.id,Le.value="",Be.value=!!(J.weather||J.airspaceRef||J.observer||J.incidents||J.notes),me.value=!0}function We(){me.value=!1,he.value=""}async function we(){var I;if(Le.value="",!Y.drone){Le.value="Select a drone first (add one on the Drones tab).";return}ce.value=!0;const J={...Y,maxAltitudeAgl:Number(Y.maxAltitudeAgl)||0},E=he.value?await Mp(he.value,J):await Ap(J);if(ce.value=!1,!E.ok){Le.value=((I=E.body)==null?void 0:I.error)||"Could not save the flight.";return}me.value=!1,await y()}const le=W("");async function Me(J){const E=await Ep(J.id);le.value="",E.ok&&await y()}const ie=["","C0","C1","C2","C3","C4","C5","C6"];function Ke(){return{name:"",model:"",serial:"",operatorNumber:"",mtomGrams:"",isToy:!1,autologsFlights:!1,cClass:""}}const re=W(!1),qe=W(""),fe=xt(Ke()),de=W(""),ae=W(!1);function Lt(){Object.assign(fe,Ke()),qe.value="",de.value="",re.value=!0}function pe(J){Object.assign(fe,{name:J.name||"",model:J.model||"",serial:J.serial||"",operatorNumber:J.operatorNumber||"",mtomGrams:J.mtomGrams||"",isToy:!!J.isToy,autologsFlights:!!J.autologsFlights,cClass:J.cClass||""}),qe.value=J.id,de.value="",re.value=!0}function Ue(){re.value=!1,qe.value=""}async function Ve(){var I;if(de.value="",!fe.name.trim()){de.value="Give the drone a name.";return}ae.value=!0;const J={...fe,mtomGrams:Number(fe.mtomGrams)||0},E=qe.value?await Pp(qe.value,J):await Tp(J);if(ae.value=!1,!E.ok){de.value=((I=E.body)==null?void 0:I.error)||"Could not save the drone.";return}re.value=!1,await y()}const mt=W("");async function ot(J){var I;const E=await Cp(J.id);mt.value="",E.ok?await y():de.value=((I=E.body)==null?void 0:I.error)||"Could not delete the drone."}const Ce=ue(()=>{const J=f.value.length,E=f.value.filter(gt=>{var dt;return(((dt=gt.compliance)==null?void 0:dt.redFlags)||[]).length}).length,I=f.value.filter(gt=>{var dt;return(dt=gt.compliance)==null?void 0:dt.required}).length;return{total:J,flagged:E,required:I,fleet:u.value.length}});return(J,E)=>(p(),m("div",ey,[a("div",ty,[a("div",ny,[(p(),m(oe,null,Fe([["flights","Flights"],["drones","Drones"]],I=>a("button",{key:I[0],class:Ae(["rounded-md px-3.5 py-1.5 text-sm font-semibold transition",l.value===I[0]?"bg-accent-soft text-accent-soft-fg":"text-ink-secondary hover:text-ink"]),onClick:gt=>l.value=I[0]},w(I[1]),11,iy)),64))]),a("div",oy,[a("a",{href:Oe(Op)(),class:"btn-ghost inline-flex items-center gap-2",title:"Download a compliance CSV (Trafikstyrelsen / police disclosure)"},[A(G,{name:"download",size:15}),E[29]||(E[29]=z(" Export CSV ",-1))],8,sy),l.value==="flights"?(p(),m("button",{key:0,class:"btn-accent inline-flex items-center gap-2",onClick:Ne},[A(G,{name:"plus",size:15}),E[30]||(E[30]=z(" Log flight ",-1))])):(p(),m("button",{key:1,class:"btn-accent inline-flex items-center gap-2",onClick:Lt},[A(G,{name:"plus",size:15}),E[31]||(E[31]=z(" Add drone ",-1))]))])]),a("div",ay,[(p(!0),m(oe,null,Fe([{label:"Flights logged",value:Ce.value.total,tone:"neutral"},{label:"Require logbook",value:Ce.value.required,tone:"neutral"},{label:"Compliance flags",value:Ce.value.flagged,tone:Ce.value.flagged?"danger":"success"},{label:"Registered drones",value:Ce.value.fleet,tone:"neutral"}],I=>(p(),m("div",{key:I.label,class:"panel p-5"},[a("div",ry,w(I.label),1),a("div",{class:Ae(["mt-2 text-[30px] font-bold leading-none tracking-tightest",I.tone==="danger"?"text-danger-fg":I.tone==="success"?"text-success-fg":"text-ink"])},w(I.value),3)]))),128))]),_.value?(p(),m("div",ly,w(_.value),1)):$("",!0),l.value==="flights"?(p(),m(oe,{key:1},[me.value?(p(),m("div",uy,[a("div",cy,[a("div",null,[a("div",dy,w(he.value?"Edit entry":"New entry"),1),E[32]||(E[32]=a("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Logbook flight (BEK 1649 §5)",-1))]),a("button",{class:"btn-icon",onClick:We},[A(G,{name:"x",size:16})])]),a("div",fy,[a("label",hy,[E[33]||(E[33]=a("span",{class:"eyebrow mb-1 block"},"Date",-1)),Q(a("input",{"onUpdate:modelValue":E[0]||(E[0]=I=>Y.operationDate=I),type:"date",class:"field"},null,512),[[ye,Y.operationDate]])]),a("label",py,[E[34]||(E[34]=a("span",{class:"eyebrow mb-1 block"},"Start",-1)),Q(a("input",{"onUpdate:modelValue":E[1]||(E[1]=I=>Y.startTime=I),type:"time",class:"field"},null,512),[[ye,Y.startTime]])]),a("label",my,[E[35]||(E[35]=a("span",{class:"eyebrow mb-1 block"},"End",-1)),Q(a("input",{"onUpdate:modelValue":E[2]||(E[2]=I=>Y.endTime=I),type:"time",class:"field"},null,512),[[ye,Y.endTime]])]),a("label",gy,[E[36]||(E[36]=a("span",{class:"eyebrow mb-1 block"},"Drone",-1)),Q(a("select",{"onUpdate:modelValue":E[3]||(E[3]=I=>Y.drone=I),class:"field"},[u.value.length?$("",!0):(p(),m("option",vy,"— add a drone first —")),(p(!0),m(oe,null,Fe(u.value,I=>(p(),m("option",{key:I.id,value:I.id},w(I.name)+w(I.model?` · ${I.model}`:""),9,_y))),128))],512),[[zt,Y.drone]])]),a("label",by,[E[37]||(E[37]=a("span",{class:"eyebrow mb-1 block"},"Max altitude (m AGL)",-1)),Q(a("input",{"onUpdate:modelValue":E[4]||(E[4]=I=>Y.maxAltitudeAgl=I),type:"number",min:"0",class:"field",placeholder:"120"},null,512),[[ye,Y.maxAltitudeAgl]])]),a("label",yy,[E[38]||(E[38]=a("span",{class:"eyebrow mb-1 block"},"Area / route",-1)),Q(a("input",{"onUpdate:modelValue":E[5]||(E[5]=I=>Y.areaRoute=I),class:"field",placeholder:"Field N of Roskilde, grid survey"},null,512),[[ye,Y.areaRoute]])]),a("label",xy,[E[39]||(E[39]=a("span",{class:"eyebrow mb-1 block"},"Remote pilot name",-1)),Q(a("input",{"onUpdate:modelValue":E[6]||(E[6]=I=>Y.pilotName=I),class:"field",placeholder:"Full name"},null,512),[[ye,Y.pilotName]])]),a("label",wy,[E[40]||(E[40]=a("span",{class:"eyebrow mb-1 block"},"Certificate ref",-1)),Q(a("input",{"onUpdate:modelValue":E[7]||(E[7]=I=>Y.certificateRef=I),class:"field",placeholder:"A2 / STS cert no."},null,512),[[ye,Y.certificateRef]])]),a("label",ky,[E[41]||(E[41]=a("span",{class:"eyebrow mb-1 block"},"Logging path",-1)),Q(a("select",{"onUpdate:modelValue":E[8]||(E[8]=I=>Y.loggingPath=I),class:"field"},[(p(),m(oe,null,Fe(K,I=>a("option",{key:I.value,value:I.value},w(I.label),9,Sy)),64))],512),[[zt,Y.loggingPath]])]),a("label",Ty,[E[42]||(E[42]=a("span",{class:"eyebrow mb-1 block"},"Category",-1)),Q(a("select",{"onUpdate:modelValue":E[9]||(E[9]=I=>Y.category=I),class:"field"},[(p(),m(oe,null,Fe(U,I=>a("option",{key:I.value,value:I.value},w(I.label),9,Py)),64))],512),[[zt,Y.category]])]),a("label",Cy,[E[43]||(E[43]=a("span",{class:"eyebrow mb-1 block"},"Purpose",-1)),Q(a("select",{"onUpdate:modelValue":E[10]||(E[10]=I=>Y.purpose=I),class:"field"},[(p(),m(oe,null,Fe(V,I=>a("option",{key:I.value,value:I.value},w(I.label),9,Ly)),64))],512),[[zt,Y.purpose]])]),a("label",Ay,[E[44]||(E[44]=a("span",{class:"eyebrow mb-1 block"},"Authorisation ref",-1)),Q(a("input",{"onUpdate:modelValue":E[11]||(E[11]=I=>Y.authorisationRef=I),class:"field",placeholder:"Specific-category ref"},null,512),[[ye,Y.authorisationRef]])])]),a("label",My,[E[45]||(E[45]=a("span",{class:"eyebrow mb-1 block"},"FDR log URL (automatic path)",-1)),Q(a("input",{"onUpdate:modelValue":E[12]||(E[12]=I=>Y.rawFdrLogUrl=I),class:"field",placeholder:"Link to the stored flight-data-recorder export"},null,512),[[ye,Y.rawFdrLogUrl]])]),a("button",{class:"mt-4 flex items-center gap-1.5 text-sm font-semibold text-accent",onClick:E[13]||(E[13]=I=>Be.value=!Be.value)},[A(G,{name:Be.value?"x":"plus",size:14},null,8,["name"]),E[46]||(E[46]=z(" Operational details (weather, airspace, incidents) ",-1))]),Be.value?(p(),m("div",Ey,[a("label",Oy,[E[47]||(E[47]=a("span",{class:"eyebrow mb-1 block"},"Weather / wind",-1)),Q(a("input",{"onUpdate:modelValue":E[14]||(E[14]=I=>Y.weather=I),class:"field",placeholder:"6 m/s NW, CAVOK"},null,512),[[ye,Y.weather]])]),a("label",zy,[E[48]||(E[48]=a("span",{class:"eyebrow mb-1 block"},"Airspace / NOTAM ref",-1)),Q(a("input",{"onUpdate:modelValue":E[15]||(E[15]=I=>Y.airspaceRef=I),class:"field"},null,512),[[ye,Y.airspaceRef]])]),a("label",Iy,[E[49]||(E[49]=a("span",{class:"eyebrow mb-1 block"},"Observer",-1)),Q(a("input",{"onUpdate:modelValue":E[16]||(E[16]=I=>Y.observer=I),class:"field"},null,512),[[ye,Y.observer]])]),a("label",$y,[E[50]||(E[50]=a("span",{class:"eyebrow mb-1 block"},"Incidents / anomalies",-1)),Q(a("input",{"onUpdate:modelValue":E[17]||(E[17]=I=>Y.incidents=I),class:"field",placeholder:"RTH trigger, GPS dropout…"},null,512),[[ye,Y.incidents]])]),a("label",Ny,[E[51]||(E[51]=a("span",{class:"eyebrow mb-1 block"},"Notes",-1)),Q(a("textarea",{"onUpdate:modelValue":E[18]||(E[18]=I=>Y.notes=I),rows:"2",class:"field"},null,512),[[ye,Y.notes]])])])):$("",!0),a("div",Dy,[a("button",{class:"btn-accent",disabled:ce.value,onClick:we},w(ce.value?"Saving…":he.value?"Save changes":"Log flight"),9,Fy),a("button",{class:"btn-ghost",onClick:We},"Cancel"),Le.value?(p(),m("span",Ry,w(Le.value),1)):$("",!0)])])):$("",!0),a("div",By,[h.value?(p(),m("div",Uy,"Loading…")):f.value.length?(p(),m("div",Zy,[a("table",Hy,[a("thead",null,[a("tr",jy,[(p(),m(oe,null,Fe(["Date","Drone","Area / route","Alt","Pilot","Compliance",""],I=>a("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"},w(I),1)),64))])]),a("tbody",null,[(p(!0),m(oe,null,Fe(f.value,I=>{var gt,dt,bt,x;return p(),m(oe,{key:I.id},[a("tr",{class:Ae(["border-b border-line last:border-0",he.value===I.id?"bg-accent-soft":""])},[a("td",Wy,[z(w((I.operationDate||"").slice(0,10))+" ",1),I.startTime?(p(),m("span",Ky,w(I.startTime),1)):$("",!0)]),a("td",Gy,w(I.droneName||"—"),1),a("td",{class:"max-w-[220px] truncate px-5 py-3 text-ink-secondary",title:I.areaRoute},w(I.areaRoute||"—"),9,qy),a("td",Yy,w(I.maxAltitudeAgl?I.maxAltitudeAgl+" m":"—"),1),a("td",Jy,w(I.pilotName||"—"),1),a("td",Xy,[a("button",{class:Ae(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",s[C(I).tone]]),onClick:b=>M(I.id)},[C(I).tone==="danger"?(p(),at(G,{key:0,name:"alertTriangle",size:12})):C(I).tone==="success"?(p(),at(G,{key:1,name:"check",size:12})):$("",!0),z(" "+w(C(I).label),1)],10,Qy)]),a("td",ex,[le.value===I.id?(p(),m(oe,{key:0},[E[54]||(E[54]=a("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),a("button",{class:"btn-ghost mr-1",onClick:E[19]||(E[19]=b=>le.value="")},"Cancel"),a("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:b=>Me(I)},"Delete",8,tx)],64)):(p(),m(oe,{key:1},[a("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:b=>ze(I)},[A(G,{name:"sliders",size:13}),E[55]||(E[55]=z(" Edit",-1))],8,nx),a("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:b=>le.value=I.id},[A(G,{name:"trash",size:13})],8,ix)],64))])],2),T.value===I.id?(p(),m("tr",ox,[a("td",sx,[a("div",ax,[a("span",rx,[E[56]||(E[56]=z("Logging path: ",-1)),a("b",lx,w(((gt=I.compliance)==null?void 0:gt.loggingPath)||"—"),1)]),a("span",ux,[E[57]||(E[57]=z("Category: ",-1)),a("b",cx,w(I.category||"—"),1)]),a("span",dx,[E[58]||(E[58]=z("Retain until: ",-1)),a("b",fx,w((I.retentionUntil||"").slice(0,10)||"—"),1)]),(dt=I.compliance)!=null&&dt.exempt?(p(),m("span",hx,[E[59]||(E[59]=z("Exempt: ",-1)),a("b",px,w(I.compliance.exemptReason),1)])):$("",!0)]),(((bt=I.compliance)==null?void 0:bt.redFlags)||[]).length?(p(),m("ul",mx,[(p(!0),m(oe,null,Fe(I.compliance.redFlags,(b,S)=>(p(),m("li",{key:S,class:"flex items-start gap-2 text-xs text-danger-fg"},[A(G,{name:"alertTriangle",size:13,class:"mt-px shrink-0"}),z(" "+w(b),1)]))),128))])):(x=I.compliance)!=null&&x.exempt?$("",!0):(p(),m("div",gx,"No compliance gaps detected."))])])):$("",!0)],64)}),128))])])])):(p(),m("div",Vy,[A(G,{name:"book",size:26,class:"text-ink-muted"}),E[52]||(E[52]=a("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No flights logged yet",-1)),E[53]||(E[53]=a("div",{class:"mt-1 text-xs text-ink-muted"},"Log your first operation to start the 5-year retention record.",-1))]))])],64)):(p(),m(oe,{key:2},[re.value?(p(),m("div",vx,[a("div",_x,[a("div",null,[a("div",bx,w(qe.value?"Edit drone":"New drone"),1),E[60]||(E[60]=a("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Aircraft registry",-1))]),a("button",{class:"btn-icon",onClick:Ue},[A(G,{name:"x",size:16})])]),a("div",yx,[a("label",xx,[E[61]||(E[61]=a("span",{class:"eyebrow mb-1 block"},"Name",-1)),Q(a("input",{"onUpdate:modelValue":E[20]||(E[20]=I=>fe.name=I),class:"field",placeholder:"Mavic-01"},null,512),[[ye,fe.name]])]),a("label",wx,[E[62]||(E[62]=a("span",{class:"eyebrow mb-1 block"},"Model",-1)),Q(a("input",{"onUpdate:modelValue":E[21]||(E[21]=I=>fe.model=I),class:"field",placeholder:"DJI Mavic 3 Enterprise"},null,512),[[ye,fe.model]])]),a("label",kx,[E[63]||(E[63]=a("span",{class:"eyebrow mb-1 block"},"Serial",-1)),Q(a("input",{"onUpdate:modelValue":E[22]||(E[22]=I=>fe.serial=I),class:"field"},null,512),[[ye,fe.serial]])]),a("label",Sx,[E[64]||(E[64]=a("span",{class:"eyebrow mb-1 block"},"Operator no.",-1)),Q(a("input",{"onUpdate:modelValue":E[23]||(E[23]=I=>fe.operatorNumber=I),class:"field",placeholder:"DNK…"},null,512),[[ye,fe.operatorNumber]])]),a("label",Tx,[E[65]||(E[65]=a("span",{class:"eyebrow mb-1 block"},"MTOM (grams)",-1)),Q(a("input",{"onUpdate:modelValue":E[24]||(E[24]=I=>fe.mtomGrams=I),type:"number",min:"0",class:"field",placeholder:"920"},null,512),[[ye,fe.mtomGrams]])]),a("label",Px,[E[66]||(E[66]=a("span",{class:"eyebrow mb-1 block"},"C-class",-1)),Q(a("select",{"onUpdate:modelValue":E[25]||(E[25]=I=>fe.cClass=I),class:"field"},[(p(),m(oe,null,Fe(ie,I=>a("option",{key:I,value:I},w(I||"— none —"),9,Cx)),64))],512),[[zt,fe.cClass]])])]),a("div",Lx,[a("label",Ax,[Q(a("input",{"onUpdate:modelValue":E[26]||(E[26]=I=>fe.autologsFlights=I),type:"checkbox",class:"h-4 w-4 accent-[var(--accent)]"},null,512),[[Va,fe.autologsFlights]]),E[67]||(E[67]=z(" Auto-logs flights (onboard FDR) ",-1))]),a("label",Mx,[Q(a("input",{"onUpdate:modelValue":E[27]||(E[27]=I=>fe.isToy=I),type:"checkbox",class:"h-4 w-4 accent-[var(--accent)]"},null,512),[[Va,fe.isToy]]),E[68]||(E[68]=z(" Toy drone (logbook-exempt) ",-1))])]),a("div",Ex,[a("button",{class:"btn-accent",disabled:ae.value,onClick:Ve},w(ae.value?"Saving…":qe.value?"Save changes":"Add drone"),9,Ox),a("button",{class:"btn-ghost",onClick:Ue},"Cancel"),de.value?(p(),m("span",zx,w(de.value),1)):$("",!0)])])):$("",!0),a("div",Ix,[h.value?(p(),m("div",$x,"Loading…")):u.value.length?(p(),m("div",Dx,[a("table",Fx,[a("thead",null,[a("tr",Rx,[(p(),m(oe,null,Fe(["Name","Model","MTOM","Class","FDR",""],I=>a("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"},w(I),1)),64))])]),a("tbody",null,[(p(!0),m(oe,null,Fe(u.value,I=>(p(),m("tr",{key:I.id,class:Ae(["border-b border-line last:border-0",qe.value===I.id?"bg-accent-soft":""])},[a("td",Bx,w(I.name),1),a("td",Ux,w(I.model||"—"),1),a("td",Vx,w(I.mtomGrams?I.mtomGrams+" g":"—"),1),a("td",Zx,[I.cClass?(p(),m("span",{key:0,class:Ae(["inline-flex rounded-full px-2 py-0.5 text-[11px] font-semibold",s.accent])},w(I.cClass),3)):(p(),m("span",Hx,"—")),I.isToy?(p(),m("span",{key:2,class:Ae(["ml-1 inline-flex rounded-full px-2 py-0.5 text-[11px] font-semibold",s.neutral])},"toy",2)):$("",!0)]),a("td",jx,[a("span",{class:Ae(["text-xs",I.autologsFlights?"text-success-fg":"text-ink-muted"])},w(I.autologsFlights?"yes":"no"),3)]),a("td",Wx,[mt.value===I.id?(p(),m(oe,{key:0},[E[71]||(E[71]=a("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),a("button",{class:"btn-ghost mr-1",onClick:E[28]||(E[28]=gt=>mt.value="")},"Cancel"),a("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:gt=>ot(I)},"Delete",8,Kx)],64)):(p(),m(oe,{key:1},[a("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:gt=>pe(I)},[A(G,{name:"sliders",size:13}),E[72]||(E[72]=z(" Edit",-1))],8,Gx),a("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:gt=>mt.value=I.id},[A(G,{name:"trash",size:13})],8,qx)],64))])],2))),128))])])])):(p(),m("div",Nx,[A(G,{name:"drone",size:26,class:"text-ink-muted"}),E[69]||(E[69]=a("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No drones registered",-1)),E[70]||(E[70]=a("div",{class:"mt-1 text-xs text-ink-muted"},"Register the airframes you fly to log flights against them.",-1))]))])],64))]))}},Jx={class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},Xx={class:"flex flex-wrap items-center gap-3"},Qx={class:"inline-flex flex-wrap rounded-lg border border-line bg-surface-1 p-0.5"},e0=["onClick"],t0={class:"ml-auto"},n0={class:"grid grid-cols-4 gap-4 max-[900px]:grid-cols-2"},i0={class:"eyebrow"},o0={key:0,class:"panel border-danger/40 p-4 text-sm text-danger-fg"},s0={key:1,class:"panel p-5"},a0={class:"mb-4 flex items-center justify-between"},r0={class:"eyebrow"},l0={class:"mt-0.5 text-base font-semibold text-ink"},u0={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},c0={class:"col-span-2 block max-[760px]:col-span-1"},d0={class:"block"},f0=["value"],h0={class:"block"},p0=["value"],m0={class:"block"},g0=["value"],v0={class:"block"},_0={class:"block"},b0={class:"block"},y0={class:"block"},x0=["value"],w0={class:"block"},k0={class:"block"},S0={class:"block"},T0=["value"],P0={class:"mt-3 block"},C0={key:0,class:"mt-3"},L0={class:"eyebrow mb-1 block"},A0={key:1,class:"mt-3 text-xs text-ink-muted"},M0={class:"mt-4 flex items-center gap-3"},E0=["disabled"],O0={key:0,class:"text-sm text-danger-fg"},z0={class:"panel overflow-hidden p-0"},I0={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},$0={key:1,class:"grid place-items-center px-5 py-16 text-center"},N0={class:"mt-3 text-sm font-medium text-ink-secondary"},D0={class:"mt-1 text-xs text-ink-muted"},F0={key:2,class:"overflow-x-auto"},R0={class:"w-full border-collapse text-sm"},B0={class:"text-left"},U0={class:"px-5 py-3"},V0={class:"font-semibold text-ink"},Z0={key:0,class:"font-mono text-[11px] text-ink-muted"},H0={class:"px-5 py-3 text-ink-secondary"},j0={class:"px-5 py-3 text-ink-secondary"},W0={class:"px-5 py-3"},K0=["onClick"],G0={key:0,class:"mt-0.5 font-mono text-[10.5px] text-ink-muted"},q0={class:"px-5 py-3 font-mono text-ink-secondary"},Y0={class:"whitespace-nowrap px-5 py-3 text-right"},J0=["onClick"],X0=["onClick"],Q0=["href"],ew=["onClick"],tw=["onClick"],nw=["onClick"],iw={key:0,class:"border-b border-line bg-surface-2"},ow={colspan:"6",class:"px-5 py-3"},sw={class:"flex flex-wrap gap-x-8 gap-y-1.5 text-xs"},aw={class:"text-ink-secondary"},rw={class:"text-ink"},lw={class:"text-ink-secondary"},uw={class:"text-ink"},cw={key:0,class:"text-ink-secondary"},dw={class:"text-ink"},fw={key:1,class:"text-ink-secondary"},hw={class:"font-mono text-ink"},pw={key:2,class:"text-ink-secondary"},mw={class:"font-mono text-ink"},gw={class:"text-ink-secondary"},vw={class:"text-ink"},_w={key:0,class:"mt-2 space-y-1"},bw={key:1,class:"mt-2 text-xs text-success-fg"},yw={key:2,class:"mt-2 text-xs text-ink-secondary"},xw={class:"flex max-h-[90vh] w-full max-w-[920px] flex-col overflow-hidden rounded-lg border border-line bg-surface-1 shadow-2xl"},ww={class:"flex items-center gap-3 border-b border-line px-5 py-3"},kw={class:"min-w-0"},Sw={class:"truncate text-sm font-semibold text-ink"},Tw={class:"truncate font-mono text-[11px] text-ink-muted"},Pw={class:"ml-auto flex items-center gap-2"},Cw=["href"],Lw=["href"],Aw={class:"flex-1 overflow-auto bg-surface-2"},Mw=["src","alt"],Ew=["src","title"],Ow={key:2,class:"grid place-items-center px-6 py-16 text-center"},zw={class:"mt-1 text-xs text-ink-muted"},Iw=["href"],$w={__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"},s=[{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(s.map(x=>[x.value,x.label])),u=[{value:"pilot",label:"Pilot"},{value:"aircraft",label:"Aircraft"},{value:"organization",label:"Organization"},{value:"client",label:"Client"},{value:"other",label:"Other"}],f=[{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"}],_=W([]),y=W([]),C=W(!1),T=W("");async function M(){C.value=!0,T.value="";const[x,b]=await Promise.all([zp(),Jc()]);x.ok||(T.value=x.status===503?"Document storage is not configured on the API Server (service account missing).":"Could not load documents."),_.value=x.documents,y.value=b.drones||[],C.value=!1}Ei(M);const U=W("all"),V=[["all","All"],["expiring","Expiring soon"],["expired","Expired"],["pending","Pending review"],["archived","Archived"]],K=ue(()=>{const x=_.value;switch(U.value){case"expiring":return x.filter(b=>{var S;return((S=b.expiry)==null?void 0:S.state)==="expiring_soon"&&b.status!=="archived"});case"expired":return x.filter(b=>{var S;return((S=b.expiry)==null?void 0:S.state)==="expired"&&b.status!=="archived"});case"pending":return x.filter(b=>b.status==="pending_review");case"archived":return x.filter(b=>b.status==="archived");default:return x.filter(b=>b.status!=="archived")}});function F(x){if(x.status==="archived")return{tone:"neutral",label:"Superseded",icon:""};const b=x.expiry||{};return b.state==="expired"?{tone:"danger",label:"Expired",icon:"alertTriangle"}:b.state==="expiring_soon"?{tone:"warning",label:`Expires in ${b.daysUntilExpiry}d`,icon:"clock"}:b.state==="valid"?{tone:"success",label:"Valid",icon:"check"}:{tone:"neutral",label:"No expiry",icon:""}}const me=W("");function he(x){me.value=me.value===x?"":x}function Y(x){return x.ownerDrone?x.ownerDroneName||"Aircraft":x.ownerRef?x.ownerRef:x.ownerType==="pilot"?"Pilot":x.ownerType?x.ownerType.charAt(0).toUpperCase()+x.ownerType.slice(1):"—"}const Le=["png","jpg","jpeg","gif","webp","svg","bmp","avif"],ce=["pdf","txt","csv","log","json","md","html","htm","xml"];function Be(x){const b=(x||"").split(".").pop().toLowerCase();return Le.includes(b)?"image":ce.includes(b)?"frame":"none"}const Ne=W(null),ze=ue(()=>Ne.value?Be(Ne.value.fileName):"none"),We=ue(()=>Ne.value?Dp(Ne.value.id):"");function we(x){Ne.value=x}function le(){Ne.value=null}function Me(x){x.key==="Escape"&&Ne.value&&le()}Ei(()=>window.addEventListener("keydown",Me)),us(()=>window.removeEventListener("keydown",Me));function ie(){return{title:"",docType:"certificate",ownerType:"pilot",ownerDrone:"",ownerRef:"",reference:"",jurisdiction:"",issueDate:"",expiryDate:"",status:"active",accessTier:"ops",notes:""}}const Ke=W(!1),re=W(""),qe=W(""),fe=W(""),de=xt(ie()),ae=W(null),Lt=W(null),pe=W(""),Ue=W(!1);function Ve(){ae.value=null,Lt.value&&(Lt.value.value="")}function mt(){Object.assign(de,ie()),re.value="",qe.value="",fe.value="",Ve(),pe.value="",Ke.value=!0}function ot(x){Object.assign(de,{title:x.title||"",docType:x.docType||"certificate",ownerType:x.ownerType||"pilot",ownerDrone:x.ownerDrone||"",ownerRef:x.ownerRef||"",reference:x.reference||"",jurisdiction:x.jurisdiction||"",issueDate:x.issueDate||"",expiryDate:x.expiryDate||"",status:x.status||"active",accessTier:x.accessTier||"ops",notes:x.notes||""}),re.value=x.id,qe.value="",fe.value="",Ve(),pe.value="",Ke.value=!0}function Ce(x){ot(x),re.value="",qe.value=x.id,fe.value=x.title,de.status="active"}function J(){Ke.value=!1,re.value="",qe.value=""}function E(x){var b;ae.value=((b=x.target.files)==null?void 0:b[0])||null}async function I(){var b;if(pe.value="",!de.title.trim()){pe.value="Give the document a title.";return}Ue.value=!0;let x;if(re.value)x=await $p(re.value,{...de});else{const S={...de};qe.value&&(S.replaces=qe.value),x=await Ip(S,ae.value)}if(Ue.value=!1,!x.ok){pe.value=((b=x.body)==null?void 0:b.error)||"Could not save the document.";return}Ke.value=!1,re.value="",qe.value="",await M()}const gt=W("");async function dt(x){var S;const b=await Np(x.id);gt.value="",b.ok?await M():pe.value=((S=b.body)==null?void 0:S.error)||"Could not delete the document."}const bt=ue(()=>{const x=_.value.filter(b=>b.status!=="archived");return{total:x.length,expiring:x.filter(b=>{var S;return((S=b.expiry)==null?void 0:S.state)==="expiring_soon"}).length,expired:x.filter(b=>{var S;return((S=b.expiry)==null?void 0:S.state)==="expired"}).length,pending:_.value.filter(b=>b.status==="pending_review").length}});return(x,b)=>(p(),m("div",Jx,[a("div",Xx,[a("div",Qx,[(p(),m(oe,null,Fe(V,S=>a("button",{key:S[0],class:Ae(["rounded-md px-3.5 py-1.5 text-sm font-semibold transition",U.value===S[0]?"bg-accent-soft text-accent-soft-fg":"text-ink-secondary hover:text-ink"]),onClick:B=>U.value=S[0]},w(S[1]),11,e0)),64))]),a("div",t0,[a("button",{class:"btn-accent inline-flex items-center gap-2",onClick:mt},[A(G,{name:"upload",size:15}),b[13]||(b[13]=z(" Add document ",-1))])])]),a("div",n0,[(p(!0),m(oe,null,Fe([{label:"Documents on file",value:bt.value.total,tone:"neutral"},{label:"Expiring soon",value:bt.value.expiring,tone:bt.value.expiring?"warning":"neutral"},{label:"Expired",value:bt.value.expired,tone:bt.value.expired?"danger":"success"},{label:"Pending review",value:bt.value.pending,tone:bt.value.pending?"accent":"neutral"}],S=>(p(),m("div",{key:S.label,class:"panel p-5"},[a("div",i0,w(S.label),1),a("div",{class:Ae(["mt-2 text-[30px] font-bold leading-none tracking-tightest",S.tone==="danger"?"text-danger-fg":S.tone==="warning"?"text-amber-fg":S.tone==="success"?"text-success-fg":S.tone==="accent"?"text-accent-soft-fg":"text-ink"])},w(S.value),3)]))),128))]),T.value?(p(),m("div",o0,w(T.value),1)):$("",!0),Ke.value?(p(),m("div",s0,[a("div",a0,[a("div",null,[a("div",r0,w(re.value?"Edit document":qe.value?"New version":"New document"),1),a("div",l0,w(qe.value?`Supersedes “${fe.value}”`:"Compliance & operational document"),1)]),a("button",{class:"btn-icon",onClick:J},[A(G,{name:"x",size:16})])]),a("div",u0,[a("label",c0,[b[14]||(b[14]=a("span",{class:"eyebrow mb-1 block"},"Title",-1)),Q(a("input",{"onUpdate:modelValue":b[0]||(b[0]=S=>de.title=S),class:"field",placeholder:"A2 Remote Pilot Certificate — J. Dariusz"},null,512),[[ye,de.title]])]),a("label",d0,[b[15]||(b[15]=a("span",{class:"eyebrow mb-1 block"},"Type",-1)),Q(a("select",{"onUpdate:modelValue":b[1]||(b[1]=S=>de.docType=S),class:"field"},[(p(),m(oe,null,Fe(s,S=>a("option",{key:S.value,value:S.value},w(S.label),9,f0)),64))],512),[[zt,de.docType]])]),a("label",h0,[b[16]||(b[16]=a("span",{class:"eyebrow mb-1 block"},"Owner type",-1)),Q(a("select",{"onUpdate:modelValue":b[2]||(b[2]=S=>de.ownerType=S),class:"field"},[(p(),m(oe,null,Fe(u,S=>a("option",{key:S.value,value:S.value},w(S.label),9,p0)),64))],512),[[zt,de.ownerType]])]),a("label",m0,[b[18]||(b[18]=a("span",{class:"eyebrow mb-1 block"},"Aircraft (if any)",-1)),Q(a("select",{"onUpdate:modelValue":b[3]||(b[3]=S=>de.ownerDrone=S),class:"field"},[b[17]||(b[17]=a("option",{value:""},"— none —",-1)),(p(!0),m(oe,null,Fe(y.value,S=>(p(),m("option",{key:S.id,value:S.id},w(S.name)+w(S.model?` · ${S.model}`:""),9,g0))),128))],512),[[zt,de.ownerDrone]])]),a("label",v0,[b[19]||(b[19]=a("span",{class:"eyebrow mb-1 block"},"Owner reference",-1)),Q(a("input",{"onUpdate:modelValue":b[4]||(b[4]=S=>de.ownerRef=S),class:"field",placeholder:"Client name / serial / site"},null,512),[[ye,de.ownerRef]])]),a("label",_0,[b[20]||(b[20]=a("span",{class:"eyebrow mb-1 block"},"Reference / number",-1)),Q(a("input",{"onUpdate:modelValue":b[5]||(b[5]=S=>de.reference=S),class:"field",placeholder:"Cert / registration / policy no."},null,512),[[ye,de.reference]])]),a("label",b0,[b[21]||(b[21]=a("span",{class:"eyebrow mb-1 block"},"Jurisdiction",-1)),Q(a("input",{"onUpdate:modelValue":b[6]||(b[6]=S=>de.jurisdiction=S),class:"field",placeholder:"DK / EASA / FAA"},null,512),[[ye,de.jurisdiction]])]),a("label",y0,[b[22]||(b[22]=a("span",{class:"eyebrow mb-1 block"},"Access tier",-1)),Q(a("select",{"onUpdate:modelValue":b[7]||(b[7]=S=>de.accessTier=S),class:"field"},[(p(),m(oe,null,Fe(h,S=>a("option",{key:S.value,value:S.value},w(S.label),9,x0)),64))],512),[[zt,de.accessTier]])]),a("label",w0,[b[23]||(b[23]=a("span",{class:"eyebrow mb-1 block"},"Issue date",-1)),Q(a("input",{"onUpdate:modelValue":b[8]||(b[8]=S=>de.issueDate=S),type:"date",class:"field"},null,512),[[ye,de.issueDate]])]),a("label",k0,[b[24]||(b[24]=a("span",{class:"eyebrow mb-1 block"},"Expiry date",-1)),Q(a("input",{"onUpdate:modelValue":b[9]||(b[9]=S=>de.expiryDate=S),type:"date",class:"field"},null,512),[[ye,de.expiryDate]])]),a("label",S0,[b[25]||(b[25]=a("span",{class:"eyebrow mb-1 block"},"Status",-1)),Q(a("select",{"onUpdate:modelValue":b[10]||(b[10]=S=>de.status=S),class:"field"},[(p(),m(oe,null,Fe(f,S=>a("option",{key:S.value,value:S.value},w(S.label),9,T0)),64))],512),[[zt,de.status]])])]),a("label",P0,[b[26]||(b[26]=a("span",{class:"eyebrow mb-1 block"},"Notes",-1)),Q(a("textarea",{"onUpdate:modelValue":b[11]||(b[11]=S=>de.notes=S),rows:"2",class:"field",placeholder:"Conditions, renewal contacts, anything worth recording"},null,512),[[ye,de.notes]])]),re.value?(p(),m("div",A0,[...b[28]||(b[28]=[z(" Editing updates metadata only. To replace the file, close this and use ",-1),a("b",{class:"text-ink-secondary"},"New version",-1),z(" on the document — the old version is kept for audit. ",-1)])])):(p(),m("div",C0,[a("span",L0,"File "+w(qe.value?"(new version)":"(optional)"),1),a("input",{ref_key:"fileInput",ref:Lt,type:"file",class:"field",onChange:E},null,544),b[27]||(b[27]=a("p",{class:"mt-1 text-xs text-ink-muted"}," Stored in PocketBase for now (object storage later). Max 50 MB. ",-1))])),a("div",M0,[a("button",{class:"btn-accent",disabled:Ue.value,onClick:I},w(Ue.value?"Saving…":re.value?"Save changes":qe.value?"Upload new version":"Add document"),9,E0),a("button",{class:"btn-ghost",onClick:J},"Cancel"),pe.value?(p(),m("span",O0,w(pe.value),1)):$("",!0)])])):$("",!0),a("div",z0,[C.value?(p(),m("div",I0,"Loading…")):K.value.length?(p(),m("div",F0,[a("table",R0,[a("thead",null,[a("tr",B0,[(p(),m(oe,null,Fe(["Title","Type","Owner","Expiry","Ver",""],S=>a("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"},w(S),1)),64))])]),a("tbody",null,[(p(!0),m(oe,null,Fe(K.value,S=>{var B,R;return p(),m(oe,{key:S.id},[a("tr",{class:Ae(["border-b border-line last:border-0",re.value===S.id?"bg-accent-soft":""])},[a("td",U0,[a("div",V0,w(S.title),1),S.reference?(p(),m("div",Z0,w(S.reference),1)):$("",!0)]),a("td",H0,w(Oe(l)[S.docType]||S.docType||"—"),1),a("td",j0,w(Y(S)),1),a("td",W0,[a("button",{class:Ae(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",i[F(S).tone]]),onClick:Z=>he(S.id)},[F(S).icon?(p(),at(G,{key:0,name:F(S).icon,size:12},null,8,["name"])):$("",!0),z(" "+w(F(S).label),1)],10,K0),S.expiryDate?(p(),m("div",G0,w(S.expiryDate),1)):$("",!0)]),a("td",q0,"v"+w(S.version||1),1),a("td",Y0,[gt.value===S.id?(p(),m(oe,{key:0},[b[29]||(b[29]=a("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),a("button",{class:"btn-ghost mr-1",onClick:b[12]||(b[12]=Z=>gt.value="")},"Cancel"),a("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:Z=>dt(S)},"Delete",8,J0)],64)):(p(),m(oe,{key:1},[S.hasFile?(p(),m("button",{key:0,class:"btn-ghost mr-1 inline-flex items-center gap-1",title:"Preview",onClick:Z=>we(S)},[A(G,{name:"eye",size:13})],8,X0)):$("",!0),S.hasFile?(p(),m("a",{key:1,href:Oe(zr)(S.id),class:"btn-ghost mr-1 inline-flex items-center gap-1",title:"Download file"},[A(G,{name:"download",size:13})],8,Q0)):$("",!0),a("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",title:"Upload new version",onClick:Z=>Ce(S)},[A(G,{name:"upload",size:13})],8,ew),a("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:Z=>ot(S)},[A(G,{name:"sliders",size:13}),b[30]||(b[30]=z(" Edit",-1))],8,tw),a("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:Z=>gt.value=S.id},[A(G,{name:"trash",size:13})],8,nw)],64))])],2),me.value===S.id?(p(),m("tr",iw,[a("td",ow,[a("div",sw,[a("span",aw,[b[31]||(b[31]=z("Status: ",-1)),a("b",rw,w(S.status||"—"),1)]),a("span",lw,[b[32]||(b[32]=z("Access: ",-1)),a("b",uw,w(S.accessTier||"—"),1)]),S.jurisdiction?(p(),m("span",cw,[b[33]||(b[33]=z("Jurisdiction: ",-1)),a("b",dw,w(S.jurisdiction),1)])):$("",!0),S.issueDate?(p(),m("span",fw,[b[34]||(b[34]=z("Issued: ",-1)),a("b",hw,w(S.issueDate),1)])):$("",!0),S.expiryDate?(p(),m("span",pw,[b[35]||(b[35]=z("Expires: ",-1)),a("b",mw,w(S.expiryDate),1)])):$("",!0),a("span",gw,[b[36]||(b[36]=z("File: ",-1)),a("b",vw,w(S.hasFile?S.fileName:"none"),1)])]),(((B=S.expiry)==null?void 0:B.flags)||[]).length?(p(),m("ul",_w,[(p(!0),m(oe,null,Fe(S.expiry.flags,(Z,se)=>(p(),m("li",{key:se,class:Ae(["flex items-start gap-2 text-xs",S.expiry.state==="expired"?"text-danger-fg":S.expiry.state==="expiring_soon"?"text-amber-fg":"text-ink-secondary"])},[A(G,{name:"alertTriangle",size:13,class:"mt-px shrink-0"}),z(" "+w(Z),1)],2))),128))])):((R=S.expiry)==null?void 0:R.state)==="valid"?(p(),m("div",bw,"In force — no action needed.")):$("",!0),S.notes?(p(),m("div",yw,[b[37]||(b[37]=a("span",{class:"text-ink-muted"},"Notes:",-1)),z(" "+w(S.notes),1)])):$("",!0)])])):$("",!0)],64)}),128))])])])):(p(),m("div",$0,[A(G,{name:"fileText",size:26,class:"text-ink-muted"}),a("div",N0,w(U.value==="all"?"No documents on file yet":"Nothing in this view"),1),a("div",D0,w(U.value==="all"?"Add certificates, registrations, insurance and authorisations to track their expiry.":"Try a different filter."),1)]))]),(p(),at(cf,{to:"body"},[Ne.value?(p(),m("div",{key:0,class:"fixed inset-0 z-50 grid place-items-center p-4",style:{background:"color-mix(in srgb, black 60%, transparent)"},onClick:hl(le,["self"])},[a("div",xw,[a("div",ww,[a("div",kw,[a("div",Sw,w(Ne.value.title),1),a("div",Tw,w(Ne.value.fileName),1)]),a("div",Pw,[a("a",{href:We.value,target:"_blank",rel:"noopener",class:"btn-ghost inline-flex items-center gap-1.5",title:"Open in new tab"},[A(G,{name:"globe",size:14}),b[38]||(b[38]=z(" New tab ",-1))],8,Cw),a("a",{href:Oe(zr)(Ne.value.id),class:"btn-ghost inline-flex items-center gap-1.5",title:"Download"},[A(G,{name:"download",size:14}),b[39]||(b[39]=z(" Download ",-1))],8,Lw),a("button",{class:"btn-icon",title:"Close",onClick:le},[A(G,{name:"x",size:16})])])]),a("div",Aw,[ze.value==="image"?(p(),m("img",{key:0,src:We.value,alt:Ne.value.title,class:"mx-auto block max-w-full"},null,8,Mw)):ze.value==="frame"?(p(),m("iframe",{key:1,src:We.value,class:"h-[74vh] w-full border-0 bg-white",title:Ne.value.title},null,8,Ew)):(p(),m("div",Ow,[A(G,{name:"fileText",size:28,class:"text-ink-muted"}),b[41]||(b[41]=a("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"Preview isn't available for this file type",-1)),a("div",zw,w(Ne.value.fileName),1),a("a",{href:Oe(zr)(Ne.value.id),class:"btn-accent mt-4 inline-flex items-center gap-2"},[A(G,{name:"download",size:15}),b[40]||(b[40]=z(" Download instead ",-1))],8,Iw)]))])])])):$("",!0)]))]))}},Nw={class:"grid h-full grid-cols-[248px_1fr] max-[900px]:grid-cols-1"},Dw={class:"flex flex-col border-r border-line bg-surface-1 px-4 py-5 max-[900px]:hidden"},Fw={class:"flex items-center gap-2.5 px-2 pb-5"},Rw={class:"flex flex-col gap-0.5"},Bw=["onClick"],Uw={class:"mt-auto flex flex-col gap-2.5"},Vw={class:"rounded-lg bg-surface-2 p-3"},Zw={class:"flex items-center gap-2"},Hw={class:"text-xs font-semibold text-ink"},jw={class:"mt-1.5 block font-mono text-[10.5px] text-ink-muted"},Ww={class:"flex items-center gap-2.5 px-2 py-1"},Kw={class:"grid h-8 w-8 place-items-center rounded-full bg-[var(--navy-800)] text-xs font-bold text-white"},Gw={class:"min-w-0 flex-1"},qw={class:"truncate text-[13px] font-semibold text-ink"},Yw={class:"flex items-center gap-1.5 text-[11px] text-ink-muted"},Jw=["title"],Xw={class:"overflow-y-auto"},Qw={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)"}},e2={class:"mt-0.5 text-[22px] font-bold tracking-tightest text-ink"},t2={class:"ml-auto flex items-center gap-3"},n2={class:"flex h-10 w-60 items-center gap-2 rounded border border-line-strong bg-surface-1 px-3 max-[1100px]:hidden"},i2={key:0,class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},o2={class:"grid grid-cols-4 gap-4 max-[1100px]:grid-cols-2 max-[560px]:grid-cols-1"},s2={class:"flex items-center justify-between"},a2={class:"eyebrow"},r2={class:"mt-2.5 text-[34px] font-bold leading-none tracking-tightest text-ink"},l2={class:"grid grid-cols-[1.6fr_1fr] gap-5 max-[1100px]:grid-cols-1"},u2={class:"panel p-5"},c2={class:"mb-3.5 flex items-center justify-between"},d2={class:"flex items-center gap-2"},f2={class:"relative z-[1200]"},h2={class:"panel absolute right-0 z-[1200] mt-1.5 w-72 p-3.5 shadow-lg"},p2={class:"flex items-center justify-between gap-3"},m2={class:"mb-1.5 flex items-center justify-between"},g2={class:"font-mono text-[11px] text-ink-muted"},v2=["value"],_2={key:0,class:"mt-1.5 text-[11px] text-ink-muted"},b2={key:0,class:"mt-2.5 text-xs text-ink-muted"},y2={key:1,class:"mt-2.5 text-xs text-ink-muted"},x2={key:2,class:"mt-2.5 text-xs text-ink-muted"},w2={class:"flex flex-col gap-5"},k2={class:"panel p-5"},S2={class:"mb-3.5 flex items-center justify-between"},T2={class:"flex items-center gap-3"},P2={class:"text-5xl leading-none"},C2={class:"min-w-0"},L2={class:"flex items-baseline gap-1"},A2={class:"text-[34px] font-bold leading-none tracking-tightest text-ink"},M2={class:"text-lg font-semibold text-ink-secondary"},E2={class:"mt-1 truncate text-sm capitalize text-ink-secondary"},O2={class:"mt-1.5 truncate text-xs text-ink-muted"},z2={class:"mt-4 grid grid-cols-2 gap-2.5"},I2={class:"rounded-lg bg-surface-2 px-3 py-2"},$2={class:"mt-0.5 font-mono text-sm text-ink"},N2={class:"rounded-lg bg-surface-2 px-3 py-2"},D2={class:"mt-0.5 font-mono text-sm text-ink"},F2={class:"rounded-lg bg-surface-2 px-3 py-2"},R2={class:"mt-0.5 font-mono text-sm text-ink"},B2={key:0},U2={class:"rounded-lg bg-surface-2 px-3 py-2"},V2={class:"mt-0.5 font-mono text-sm text-ink"},Z2={key:0},H2={key:0,class:"mt-3 text-[11px] text-ink-muted"},j2={key:1,class:"grid place-items-center py-8 text-center"},W2={class:"mt-0.5 text-xs text-ink-muted"},K2={key:2,class:"grid place-items-center py-8 text-center text-sm text-ink-muted"},G2={class:"panel p-5"},q2={class:"mb-3.5 flex items-center justify-between"},Y2={class:"grid place-items-center py-10 text-center"},J2={class:"panel overflow-hidden p-0"},X2={class:"flex items-center justify-between px-5 py-4"},Q2={class:"flex gap-2"},ek={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},tk={key:1,class:"overflow-x-auto"},nk={class:"w-full border-collapse text-sm"},ik={class:"text-left"},ok=["onClick"],sk={class:"px-5 py-3 font-mono font-bold text-ink"},ak={class:"px-5 py-3 text-ink-secondary"},rk={class:"px-5 py-3"},lk={class:"px-5 py-3 font-mono text-ink-secondary"},uk={class:"px-5 py-3"},ck={key:0,class:"flex items-center gap-2"},dk={class:"h-1.5 w-12 overflow-hidden rounded bg-surface-2"},fk={class:"font-mono text-xs text-ink-secondary"},hk={key:1,class:"font-mono text-xs text-ink-muted"},pk={class:"px-5 py-3 font-mono text-ink-secondary"},mk={class:"px-5 py-3 text-right"},gk=["onClick"],vk={key:1,class:"p-7"},_k={class:"mb-4 flex flex-wrap items-center gap-3"},bk={class:"font-mono text-mode font-bold text-ink"},yk={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"},xk={key:1,class:"ml-auto flex flex-wrap gap-1.5"},wk=["onClick"],kk={key:0,class:"panel grid place-items-center p-16 text-center"},Sk={class:"pill"},Tk={class:"pill"},Pk={class:"pill"},Ck={class:"mt-1 text-sm font-semibold text-ink"},Lk={class:"pill"},Ak={class:"mt-1 font-mono text-sm font-bold tabular text-ink"},Mk={class:"grid grid-cols-2 gap-4 max-[820px]:grid-cols-1"},Ek={class:"panel p-4"},Ok={class:"flex items-center gap-4"},zk={class:"h-9 flex-1 overflow-hidden rounded border border-line bg-surface-2"},Ik={class:"readout"},$k={class:"panel p-4"},Nk={class:"readout"},Dk={class:"panel p-4"},Fk={class:"space-y-1.5 text-sm"},Rk={class:"flex justify-between"},Bk={class:"text-ink"},Uk={class:"flex justify-between"},Vk={class:"text-ink"},Zk={class:"flex justify-between"},Hk={class:"font-mono tabular text-ink"},jk={class:"flex justify-between"},Wk={class:"font-mono tabular text-ink"},Kk={class:"panel p-4"},Gk={class:"space-y-1.5 text-sm"},qk={class:"flex justify-between"},Yk={class:"font-mono tabular text-ink"},Jk={class:"flex justify-between"},Xk={class:"font-mono tabular text-ink"},Qk={class:"flex justify-between"},eS={class:"font-mono tabular text-ink"},tS={class:"panel col-span-2 p-4 max-[820px]:col-span-1"},nS={class:"panel p-4"},iS={class:"flex flex-wrap gap-2"},oS={class:"mt-2 min-h-[16px] text-xs text-ink-muted"},sS={class:"panel p-4"},aS={class:"h-[180px] overflow-y-auto font-mono text-xs"},rS={class:"text-ink-muted"},lS={class:"font-semibold text-accent"},uS={class:"break-all text-ink"},cS={key:5,class:"p-7"},dS={class:"panel grid place-items-center p-16 text-center"},fS={class:"mt-3 text-sm font-medium text-ink-secondary"},hS={key:0,class:"mt-1 text-xs text-ink-muted"},pS={key:1,class:"mt-1 text-xs text-ink-muted"},mS="34,-25,72,45",gS=600*1e3,vS={__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 s=t,l=i,u=xt({}),f=xt({}),h=W(null),_=W(!1),y=xt([]),C=W(""),T=W([]),M=xt({unavailable:!1,detail:"",loaded:!1,plan:"",recommendedInterval:30}),U=ue(()=>T.value.filter(j=>!j.onGround).length),V=W(!1);let K=null;const F=[{value:"auto",label:"Auto"},{value:5,label:"5s"},{value:10,label:"10s"},{value:15,label:"15s"},{value:30,label:"30s"},{value:60,label:"60s"},{value:120,label:"120s"}],me=ue(()=>{if(be.airTrafficInterval==="auto")return M.recommendedInterval||30;const j=Number(be.airTrafficInterval);return Number.isFinite(j)&&j>0?j:30}),he=W(null);let Y=!1;function Le(){if(!(Y||he.value!==null)){if(typeof navigator>"u"||!navigator.geolocation){he.value=!1;return}Y=!0,navigator.geolocation.getCurrentPosition(j=>{he.value={lat:j.coords.latitude,lng:j.coords.longitude},Y=!1},()=>{he.value=!1,Y=!1},{timeout:8e3,maximumAge:6e5})}}function ce(j,O,Ie){const it=j&&j.telemetry||{},Et=it[O],mn=it[Ie];return typeof Et=="number"&&typeof mn=="number"&&(Et||mn)?{lat:Et,lng:mn}:null}function Be(){const j=ce(B.value,"latitude","longitude")||S.value.map(it=>ce(u[it],"latitude","longitude")).find(Boolean);if(j){const it=Ir(j.lat,j.lng);if(it)return it.bbox}const O=ce(B.value,"phoneLatitude","phoneLongitude")||S.value.map(it=>ce(u[it],"phoneLatitude","phoneLongitude")).find(Boolean);if(O){const it=Ir(O.lat,O.lng);if(it)return it.bbox}if(Le(),he.value){const it=Ir(he.value.lat,he.value.lng);if(it)return it.bbox}const Ie=ym(be.region);return Ie||mS}async function Ne(){if(!be.showAirTraffic)return;const j=be.autoBbox?Be():void 0,{states:O,unavailable:Ie,detail:it,plan:Et,recommendedInterval:mn}=await mp(j);T.value=O,M.unavailable=Ie,M.detail=it,M.plan=Et||"",mn&&(M.recommendedInterval=mn),M.loaded=!0}function ze(){K&&clearInterval(K),K=setInterval(()=>{Ce.value==="Overview"&&be.showAirTraffic&&Ne()},me.value*1e3)}function We(){Ne(),ze()}function we(){K&&clearInterval(K),K=null}const le=xt({loaded:!1,unavailable:!1,detail:"",data:null,units:"metric",source:"",updatedAt:0});let Me=null;function ie(){const j=ce(B.value,"latitude","longitude")||S.value.map(Ie=>ce(u[Ie],"latitude","longitude")).find(Boolean);if(j)return{lat:j.lat,lng:j.lng,source:"drone"};const O=ce(B.value,"phoneLatitude","phoneLongitude")||S.value.map(Ie=>ce(u[Ie],"phoneLatitude","phoneLongitude")).find(Boolean);return O?{lat:O.lat,lng:O.lng,source:"phone"}:he.value?{lat:he.value.lat,lng:he.value.lng,source:"browser"}:null}async function Ke(){const j=ie(),O=await Sp(j?j.lat:void 0,j?j.lng:void 0);if(le.loaded=!0,le.units=O.units||"metric",O.unavailable||!O.weather){le.unavailable=!0,le.detail=O.detail||"Weather is unavailable.",le.data=null;return}le.unavailable=!1,le.detail="",le.data=O.weather,le.source=j?j.source:"default",le.updatedAt=Date.now()}function re(){Me&&clearInterval(Me),Me=setInterval(()=>{Ce.value==="Overview"&&Ke()},gS)}function qe(){Ke(),re()}function fe(){Me&&clearInterval(Me),Me=null}const de=ue(()=>le.units==="imperial"?"°F":le.units==="standard"?"K":"°C"),ae=ue(()=>le.units==="imperial"?"mph":"m/s");function Lt(j){const O=(j||"").slice(0,2);return O==="01"?(j||"").endsWith("n")?"🌙":"☀️":{"02":"🌤️","03":"⛅","04":"☁️","09":"🌧️",10:"🌦️",11:"⛈️",13:"❄️",50:"🌫️"}[O]||"🌡️"}const pe=ue(()=>Lt(le.data&&le.data.icon)),Ue=ue(()=>{const j=le.data;return j?j.country?`${j.location}, ${j.country}`:j.location||"Unknown location":""}),Ve=ue(()=>le.source==="drone"?"at aircraft location":le.source==="phone"||le.source==="browser"?"at your location":"default location"),mt=ue(()=>le.updatedAt?new Date(le.updatedAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):"");function ot(j,O=0){return typeof j=="number"?j.toFixed(O):"—"}const Ce=W("Overview"),J=[["grid","Overview"],["radio","Live flights"],["route","Routes"],["calendar","Schedule"],["book","Logbook"],["fileText","Documents"],["server","Drives"],["settings","Settings"]],E=ue(()=>(J.find(([,j])=>j===Ce.value)||["grid"])[0]),I=W(""),gt=W(""),dt=W("");let bt=null,x=null,b=!1;const S=ue(()=>Object.keys(u).sort((j,O)=>(u[O].online?1:0)-(u[j].online?1:0)||j.localeCompare(O))),B=ue(()=>h.value?u[h.value]:null),R=ue(()=>B.value&&B.value.telemetry||{}),Z=ue(()=>!!(B.value&&B.value.online)),se=ue(()=>{const j=R.value;return typeof j.latitude=="number"&&typeof j.longitude=="number"&&(j.latitude||j.longitude)?{lat:j.latitude,lng:j.longitude}:null}),ne=ue(()=>h.value&&f[h.value]||[]),ee=ue(()=>{const j=R.value;return typeof j.velocityX=="number"&&typeof j.velocityY=="number"?Math.hypot(j.velocityX,j.velocityY):null});function q(j){return j.online?j.connected?["In flight","success"]:["Standby","accent"]:["Offline","neutral"]}function ge(j){const O=j&&j.telemetry||{};return typeof O.velocityX=="number"&&typeof O.velocityY=="number"?Math.hypot(O.velocityX,O.velocityY):null}const te=ue(()=>S.value.map(j=>{const O=u[j],Ie=O.telemetry||{},[it,Et]=q(O);return{id:j,mission:O.model||(O.connected?"Drone linked":O.online?"App online":"No signal"),status:it,tone:Et,alt:typeof Ie.altitude=="number"?Ie.altitude.toFixed(0)+" m":"—",battery:typeof Ie.batteryPercent=="number"?Ie.batteryPercent:null,speed:ge(O)}})),Se=ue(()=>S.value.filter(j=>u[j].online).length),Te=ue(()=>S.value.filter(j=>u[j].online&&u[j].connected).length),Ze=ue(()=>S.value.filter(j=>!u[j].online).length),Ye=ue(()=>{const j=S.value.map(O=>{var Ie;return(Ie=u[O].telemetry)==null?void 0:Ie.batteryPercent}).filter(O=>typeof O=="number");return j.length?Math.round(j.reduce((O,Ie)=>O+Ie,0)/j.length):null}),st=ue(()=>[{label:"Active flights",value:String(Te.value),delta:`${Se.value} online`,tone:"success",icon:"radio"},{label:"Avg battery",value:Ye.value==null?"—":Ye.value+"%",delta:Ye.value==null?"no telemetry":Ye.value<40?"low — watch":"nominal",tone:Ye.value!=null&&Ye.value<40?"danger":"neutral",icon:"battery"},{label:"Fleet size",value:String(S.value.length),delta:`${Te.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"}]),ft={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"},Tt={success:"text-success-fg",danger:"text-danger-fg",warning:"text-amber-fg",neutral:"text-ink-muted",accent:"text-accent-soft-fg"},Bt=ue(()=>{var Ie,it,Et;const O=(s.email||"PV").split("@")[0].split(/[.\-_ ]+/).filter(Boolean);return((((Ie=O[0])==null?void 0:Ie[0])||"P")+(((it=O[1])==null?void 0:it[0])||((Et=O[0])==null?void 0:Et[1])||"V")).toUpperCase()}),Kt={superadmin:"Superadmin",admin:"Admin",user:"Operator"},Nt=ue(()=>Kt[s.role]||"Operator"),pn=ue(()=>s.organizationName||(s.role==="superadmin"?"All organizations":"No organization"));function Pt(j){var Ie;u[j.deviceId]=j;const O=j.telemetry||{};typeof O.latitude=="number"&&typeof O.longitude=="number"&&(O.latitude||O.longitude)&&(f[j.deviceId]||(f[j.deviceId]=[]),f[j.deviceId].push([O.latitude,O.longitude]),f[j.deviceId].length>1e3&&f[j.deviceId].shift()),(!h.value||j.online&&!((Ie=u[h.value])!=null&&Ie.online))&&(h.value=j.deviceId)}function Gt(j){delete u[j],delete f[j],h.value===j&&(h.value=S.value[0]||null)}function zn(j){y.unshift({t:wu(Date.now()),tag:j.type||"?",text:JSON.stringify(zi(j))}),y.length>200&&y.pop()}function zi(j){const O={...j};return delete O.type,O}function rt(){const j=location.protocol==="https:"?"wss":"ws";bt=new WebSocket(`${j}://${location.host}/bff/ws`),bt.onopen=()=>_.value=!0,bt.onclose=()=>{_.value=!1,b||(x=setTimeout(rt,1500))},bt.onerror=()=>bt&&bt.close(),bt.onmessage=O=>{let Ie;try{Ie=JSON.parse(O.data)}catch{return}Ie.type==="snapshot"?(Ie.devices||[]).forEach(Pt):Ie.type==="update"&&Ie.device?(Pt(Ie.device),Ie.event&&Ie.device.deviceId===h.value&&zn(Ie.event)):Ie.type==="removed"&&Ie.deviceId&&Gt(Ie.deviceId)}}async function Kn(){if(!h.value)return dt.value="No device selected.";if(!I.value.trim())return dt.value="Enter a command name.";let j;if(gt.value.trim())try{j=JSON.parse(gt.value)}catch{return dt.value="Payload is not valid JSON."}const{ok:O,body:Ie}=await Fp(h.value,I.value.trim(),j);dt.value=O?`Sent "${I.value.trim()}".`:`Error: ${Ie.error||"failed"}`}function In(j,O,Ie=""){return typeof j=="number"?j.toFixed(O)+Ie:"—"}function ct(j){h.value=j,Ce.value="Live flights"}return Rt(Ce,j=>{j==="Overview"&&(Ne(),Ke())}),Rt(()=>be.showAirTraffic,j=>{j?Ne():T.value=[]}),Rt(me,ze),Ei(async()=>{(await np()).forEach(Pt),rt(),We(),qe()}),us(()=>{b=!0,x&&clearTimeout(x),bt&&bt.close(),we(),fe()}),(j,O)=>{var Ie,it,Et,mn,Ii;return p(),m("div",Nw,[a("aside",Dw,[a("div",Fw,[A(nd,{size:26}),O[11]||(O[11]=a("span",{class:"text-[19px] tracking-tightest"},[a("span",{class:"font-medium text-ink-secondary"},"Pilot"),a("span",{class:"font-bold text-ink"},"Vault")],-1))]),a("nav",Rw,[(p(),m(oe,null,Fe(J,([Pe,qt])=>a("button",{key:qt,class:Ae(["flex items-center gap-3 rounded px-3 py-2.5 text-left text-sm transition",Ce.value===qt?"bg-accent-soft font-semibold text-accent-soft-fg":"font-medium text-ink-secondary hover:bg-surface-2"]),onClick:Oo=>Ce.value=qt},[A(G,{name:Pe,size:18,stroke:Ce.value===qt?2.2:1.8},null,8,["name","stroke"]),z(" "+w(qt),1)],10,Bw)),64))]),a("div",Uw,[a("div",Vw,[a("div",Zw,[a("span",{class:Ae(["h-2 w-2 rounded-full",_.value?"bg-ready":"bg-caution"])},null,2),a("span",Hw,w(_.value?"Link healthy":"Reconnecting…"),1)]),a("span",jw,"API gateway · "+w(_.value?"streaming":"retrying"),1)]),a("div",Ww,[a("div",Kw,w(Bt.value),1),a("div",Gw,[a("div",qw,w(t.email||"Operator"),1),a("div",Yw,[A(G,{name:"grid",size:11,class:"shrink-0"}),a("span",{class:"truncate",title:`${Nt.value} · ${pn.value}`},w(Nt.value)+" · "+w(pn.value),9,Jw)])]),a("button",{class:"text-ink-muted transition hover:text-ink",title:"Log out","aria-label":"Log out",onClick:O[0]||(O[0]=Pe=>l("logout"))},[A(G,{name:"logout",size:16})])])])]),a("main",Xw,[a("header",Qw,[a("div",null,[O[12]||(O[12]=a("div",{class:"eyebrow"},"Live operations",-1)),a("h1",e2,w(Ce.value),1)]),a("div",t2,[a("div",n2,[A(G,{name:"search",size:16,class:"text-ink-muted"}),Q(a("input",{"onUpdate:modelValue":O[1]||(O[1]=Pe=>C.value=Pe),placeholder:"Search drones, routes…",class:"w-full border-none bg-transparent text-sm text-ink outline-none placeholder:text-ink-muted"},null,512),[[ye,C.value]])]),a("button",{class:"btn-accent flex items-center gap-2",onClick:O[2]||(O[2]=Pe=>Ce.value="Live flights")},[A(G,{name:"radio",size:16}),O[13]||(O[13]=z(" Live flights ",-1))])])]),Ce.value==="Overview"?(p(),m("div",i2,[a("div",o2,[(p(!0),m(oe,null,Fe(st.value,Pe=>(p(),m("div",{key:Pe.label,class:"panel p-5"},[a("div",s2,[a("span",a2,w(Pe.label),1),A(G,{name:Pe.icon,size:16,class:"text-ink-muted"},null,8,["name"])]),a("div",r2,w(Pe.value),1),a("span",{class:Ae(["mt-2 block font-mono text-[11px]",Tt[Pe.tone]])},w(Pe.delta),3)]))),128))]),a("div",l2,[a("div",u2,[a("div",c2,[O[18]||(O[18]=a("div",null,[a("div",{class:"eyebrow"},"Airspace"),a("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Live map")],-1)),a("div",d2,[Oe(be).showAirTraffic&&U.value?(p(),m("span",{key:0,class:Ae(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",ft.accent]),title:"Live aircraft from OpenSky Network"},[A(G,{name:"radio",size:12}),z(w(U.value)+" aircraft ",1)],2)):$("",!0),Te.value?(p(),m("span",{key:1,class:Ae(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",ft.success])},[O[14]||(O[14]=a("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),z(w(Te.value)+" drones ",1)],2)):$("",!0),a("div",f2,[a("button",{type:"button",class:Ae(["grid h-7 w-7 place-items-center rounded-md text-ink-muted transition hover:bg-surface-2 hover:text-ink",V.value?"bg-surface-2 text-ink":""]),title:"Map settings","aria-label":"Map settings",onClick:O[3]||(O[3]=Pe=>V.value=!V.value)},[A(G,{name:"settings",size:16})],2),V.value?(p(),m(oe,{key:0},[a("div",{class:"fixed inset-0 z-[1190]",onClick:O[4]||(O[4]=Pe=>V.value=!1)}),a("div",h2,[O[17]||(O[17]=a("div",{class:"eyebrow mb-2.5"},"Map settings",-1)),a("label",p2,[O[15]||(O[15]=a("span",{class:"text-sm text-ink-secondary"},"Show live air traffic",-1)),A(en,{modelValue:Oe(be).showAirTraffic,"onUpdate:modelValue":O[5]||(O[5]=Pe=>Oe(be).showAirTraffic=Pe)},null,8,["modelValue"])]),a("div",{class:Ae(["mt-3.5",Oe(be).showAirTraffic?"":"pointer-events-none opacity-40"])},[a("div",m2,[O[16]||(O[16]=a("span",{class:"text-sm text-ink-secondary"},"Refresh interval",-1)),a("span",g2,"every "+w(me.value)+"s",1)]),Q(a("select",{"onUpdate:modelValue":O[6]||(O[6]=Pe=>Oe(be).airTrafficInterval=Pe),class:"field"},[(p(),m(oe,null,Fe(F,Pe=>a("option",{key:Pe.value,value:Pe.value},w(Pe.label)+w(Pe.value==="auto"?` (plan: ${M.recommendedInterval}s)`:""),9,v2)),64))],512),[[zt,Oe(be).airTrafficInterval]]),M.plan?(p(),m("p",_2," OpenSky plan: "+w(M.plan),1)):$("",!0)],2)])],64)):$("",!0)])])]),A(Pu,{position:se.value,trail:ne.value,aircraft:Oe(be).showAirTraffic?T.value:[]},null,8,["position","trail","aircraft"]),Oe(be).showAirTraffic?M.loaded&&M.unavailable?(p(),m("p",y2,w(M.detail||"Live air traffic is unavailable."),1)):(p(),m("p",x2," Live air traffic from OpenSky Network · updates every "+w(me.value)+"s ",1)):(p(),m("p",b2," Live air traffic hidden · enable it in Map settings "))]),a("div",w2,[a("div",k2,[a("div",S2,[O[19]||(O[19]=a("div",null,[a("div",{class:"eyebrow"},"Conditions"),a("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Weather")],-1)),A(G,{name:"sun",size:16,class:"text-ink-muted"})]),le.data?(p(),m(oe,{key:0},[a("div",T2,[a("div",P2,w(pe.value),1),a("div",C2,[a("div",L2,[a("span",A2,w(ot(le.data.temp)),1),a("span",M2,w(de.value),1)]),a("div",E2,w(le.data.description||"—"),1)])]),a("div",O2,w(Ue.value)+" · "+w(Ve.value),1),a("div",z2,[a("div",I2,[O[20]||(O[20]=a("div",{class:"eyebrow"},"Feels like",-1)),a("div",$2,w(ot(le.data.feelsLike))+w(de.value),1)]),a("div",N2,[O[21]||(O[21]=a("div",{class:"eyebrow"},"Wind",-1)),a("div",D2,w(ot(le.data.windSpeed,1))+" "+w(ae.value),1)]),a("div",F2,[O[22]||(O[22]=a("div",{class:"eyebrow"},"Humidity",-1)),a("div",R2,[z(w(ot(le.data.humidity)),1),le.data.humidity!=null?(p(),m("span",B2,"%")):$("",!0)])]),a("div",U2,[O[23]||(O[23]=a("div",{class:"eyebrow"},"Cloud cover",-1)),a("div",V2,[z(w(ot(le.data.clouds)),1),le.data.clouds!=null?(p(),m("span",Z2,"%")):$("",!0)])])]),mt.value?(p(),m("div",H2,"Updated "+w(mt.value)+" · OpenWeather",1)):$("",!0)],64)):le.loaded&&le.unavailable?(p(),m("div",j2,[A(G,{name:"sun",size:24,class:"text-ink-muted"}),O[24]||(O[24]=a("div",{class:"mt-2 text-sm font-medium text-ink-secondary"},"Weather unavailable",-1)),a("div",W2,w(le.detail),1)])):(p(),m("div",K2," Loading weather… "))]),a("div",G2,[a("div",q2,[O[25]||(O[25]=a("div",null,[a("div",{class:"eyebrow"},"Today"),a("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Schedule")],-1)),A(G,{name:"clock",size:16,class:"text-ink-muted"})]),a("div",Y2,[A(G,{name:"calendar",size:24,class:"text-ink-muted"}),O[26]||(O[26]=a("div",{class:"mt-2 text-sm font-medium text-ink-secondary"},"No missions scheduled",-1)),O[27]||(O[27]=a("div",{class:"mt-0.5 text-xs text-ink-muted"},"Scheduling is not wired to a backend yet.",-1))])])])]),a("div",J2,[a("div",X2,[O[30]||(O[30]=a("div",null,[a("div",{class:"eyebrow"},"Fleet"),a("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Aircraft status")],-1)),a("div",Q2,[a("span",{class:Ae(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",ft.success])},[O[28]||(O[28]=a("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),z(w(Te.value)+" in flight ",1)],2),Ze.value?(p(),m("span",{key:0,class:Ae(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",ft.warning])},[O[29]||(O[29]=a("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),z(w(Ze.value)+" offline ",1)],2)):$("",!0)])]),te.value.length?(p(),m("div",tk,[a("table",nk,[a("thead",null,[a("tr",ik,[(p(),m(oe,null,Fe(["Aircraft","Mission","Status","Alt","Battery","Speed",""],Pe=>a("th",{key:Pe,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"},w(Pe),1)),64))])]),a("tbody",null,[(p(!0),m(oe,null,Fe(te.value,(Pe,qt)=>(p(),m("tr",{key:Pe.id,class:Ae(["cursor-pointer transition hover:bg-surface-2",qtct(Pe.id)},[a("td",sk,w(Pe.id),1),a("td",ak,w(Pe.mission),1),a("td",rk,[a("span",{class:Ae(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",ft[Pe.tone]])},[O[31]||(O[31]=a("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),z(w(Pe.status),1)],2)]),a("td",lk,w(Pe.alt),1),a("td",uk,[Pe.battery!=null?(p(),m("div",ck,[a("div",dk,[a("div",{class:Ae(["h-full",Pe.battery<40?"bg-caution":"bg-ready"]),style:Mo({width:Pe.battery+"%"})},null,6)]),a("span",fk,w(Pe.battery)+"%",1)])):(p(),m("span",hk,"—"))]),a("td",pk,[z(w(Pe.speed==null?"—":Pe.speed.toFixed(1))+" ",1),O[32]||(O[32]=a("span",{class:"text-ink-muted"},"m/s",-1))]),a("td",mk,[a("button",{class:"btn-ghost inline-flex items-center gap-1.5 whitespace-nowrap",onClick:hl(Oo=>ct(Pe.id),["stop"])},[A(G,{name:"play",size:14}),O[33]||(O[33]=z(" Track ",-1))],8,gk)])],10,ok))),128))])])])):(p(),m("div",ek," No aircraft connected yet. Devices appear here as they come online. "))])])):Ce.value==="Live flights"?(p(),m("div",vk,[a("div",_k,[a("span",bk,w(h.value||"No device selected"),1),B.value&&!Z.value?(p(),m("span",yk,"Offline")):$("",!0),S.value.length?(p(),m("div",xk,[(p(!0),m(oe,null,Fe(S.value,Pe=>(p(),m("button",{key:Pe,class:Ae(["flex items-center gap-2 rounded border px-3 py-1.5 font-mono text-xs font-bold transition",Pe===h.value?"border-accent bg-accent-soft text-accent-soft-fg":"border-line bg-surface-1 text-ink-secondary hover:border-line-strong"]),onClick:qt=>h.value=Pe},[a("span",{class:Ae(["h-2 w-2 rounded-full",u[Pe].online?"bg-ready":"bg-ink-muted"])},null,2),z(" "+w(Pe),1)],10,wk))),128))])):$("",!0)]),S.value.length?(p(),m(oe,{key:1},[a("div",{class:Ae(["mb-4 grid gap-3",!Z.value&&B.value?"opacity-60":""]),style:{"grid-template-columns":"repeat(auto-fit, minmax(150px, 1fr))"}},[a("div",Sk,[O[36]||(O[36]=a("div",{class:"eyebrow"},"Registration",-1)),a("div",{class:Ae(["mt-1 text-sm font-semibold",Z.value?((Ie=B.value)==null?void 0:Ie.registration)==="success"?"text-success-fg":"text-danger-fg":"text-ink"])},w(Z.value&&((it=B.value)!=null&&it.registration)?B.value.registration:"—"),3)]),a("div",Tk,[O[37]||(O[37]=a("div",{class:"eyebrow"},"Drone link",-1)),a("div",{class:Ae(["mt-1 text-sm font-semibold",Z.value?(Et=B.value)!=null&&Et.connected?"text-success-fg":"text-danger-fg":"text-ink"])},w(B.value?Z.value?B.value.connected?"connected":"no drone":"app offline":"—"),3)]),a("div",Pk,[O[38]||(O[38]=a("div",{class:"eyebrow"},"Model",-1)),a("div",Ck,w(((mn=B.value)==null?void 0:mn.model)||"—"),1)]),a("div",Lk,[O[39]||(O[39]=a("div",{class:"eyebrow"},"Last update",-1)),a("div",Ak,w((Ii=B.value)!=null&&Ii.lastSeenMs?Oe(wu)(B.value.lastSeenMs):"—"),1)])],2),a("div",Mk,[a("div",Ek,[O[41]||(O[41]=a("div",{class:"mb-3 eyebrow"},"Battery",-1)),a("div",Ok,[a("div",zk,[a("div",{class:Ae(["h-full transition-all",typeof R.value.batteryPercent=="number"?R.value.batteryPercent<20?"bg-warning":R.value.batteryPercent<40?"bg-caution":"bg-ready":""]),style:Mo({width:(typeof R.value.batteryPercent=="number"?R.value.batteryPercent:0)+"%"})},null,6)]),a("div",Ik,[z(w(typeof R.value.batteryPercent=="number"?R.value.batteryPercent:"—"),1),O[40]||(O[40]=a("span",{class:"text-sm text-ink-secondary"},"%",-1))])])]),a("div",$k,[O[43]||(O[43]=a("div",{class:"mb-3 eyebrow"},"Altitude",-1)),a("div",Nk,[z(w(In(R.value.altitude,1)),1),O[42]||(O[42]=a("span",{class:"text-sm text-ink-secondary"}," m",-1))])]),a("div",Dk,[O[48]||(O[48]=a("div",{class:"mb-3 eyebrow"},"Flight",-1)),a("div",Fk,[a("div",Rk,[O[44]||(O[44]=a("span",{class:"text-ink-secondary"},"Mode",-1)),a("b",Bk,w(R.value.flightMode||"—"),1)]),a("div",Uk,[O[45]||(O[45]=a("span",{class:"text-ink-secondary"},"Flying",-1)),a("b",Vk,w(R.value.isFlying==null?"—":R.value.isFlying?"yes":"no"),1)]),a("div",Zk,[O[46]||(O[46]=a("span",{class:"text-ink-secondary"},"GPS sats",-1)),a("b",Hk,w(R.value.satelliteCount==null?"—":R.value.satelliteCount),1)]),a("div",jk,[O[47]||(O[47]=a("span",{class:"text-ink-secondary"},"Speed (H)",-1)),a("b",Wk,w(ee.value==null?"—":In(ee.value,2," m/s")),1)])])]),a("div",Kk,[O[52]||(O[52]=a("div",{class:"mb-3 eyebrow"},"Position",-1)),a("div",Gk,[a("div",qk,[O[49]||(O[49]=a("span",{class:"text-ink-secondary"},"Latitude",-1)),a("b",Yk,w(In(R.value.latitude,6)),1)]),a("div",Jk,[O[50]||(O[50]=a("span",{class:"text-ink-secondary"},"Longitude",-1)),a("b",Xk,w(In(R.value.longitude,6)),1)]),a("div",Qk,[O[51]||(O[51]=a("span",{class:"text-ink-secondary"},"Vert. speed",-1)),a("b",eS,w(In(typeof R.value.velocityZ=="number"?-R.value.velocityZ:void 0,2," m/s")),1)])])]),a("div",tS,[O[53]||(O[53]=a("div",{class:"mb-3 eyebrow"},"Track",-1)),A(Pu,{position:se.value,trail:ne.value},null,8,["position","trail"])]),a("div",nS,[O[54]||(O[54]=a("div",{class:"mb-3 eyebrow"},"Send command",-1)),a("div",iS,[Q(a("input",{"onUpdate:modelValue":O[7]||(O[7]=Pe=>I.value=Pe),class:"field flex-1",placeholder:"command (e.g. startConnection)"},null,512),[[ye,I.value]]),Q(a("input",{"onUpdate:modelValue":O[8]||(O[8]=Pe=>gt.value=Pe),class:"field flex-1",placeholder:"payload JSON (optional)"},null,512),[[ye,gt.value]]),a("button",{class:"btn-accent",onClick:Kn},"Send")]),a("div",oS,w(dt.value),1)]),a("div",sS,[O[55]||(O[55]=a("div",{class:"mb-3 eyebrow"},"Event log",-1)),a("div",aS,[(p(!0),m(oe,null,Fe(y,(Pe,qt)=>(p(),m("div",{key:qt,class:"border-b border-line py-1"},[a("span",rS,w(Pe.t),1),a("span",lS,w(Pe.tag),1),a("span",uS,w(Pe.text),1)]))),128))])])])],64)):(p(),m("div",kk,[A(G,{name:"radio",size:28,class:"text-ink-muted"}),O[34]||(O[34]=a("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No aircraft online",-1)),O[35]||(O[35]=a("div",{class:"mt-1 text-xs text-ink-muted"},"Live telemetry appears here once a drone connects.",-1))]))])):Ce.value==="Logbook"?(p(),at(Yx,{key:2,email:t.email,role:t.role,organization:t.organization,"organization-name":t.organizationName},null,8,["email","role","organization","organization-name"])):Ce.value==="Documents"?(p(),at($w,{key:3,email:t.email,role:t.role,organization:t.organization,"organization-name":t.organizationName},null,8,["email","role","organization","organization-name"])):Ce.value==="Settings"?(p(),at(Qb,{key:4,email:t.email,role:t.role,organization:t.organization,"organization-name":t.organizationName,onLogout:O[9]||(O[9]=Pe=>l("logout"))},null,8,["email","role","organization","organization-name"])):(p(),m("div",cS,[a("div",dS,[A(G,{name:E.value,size:28,class:"text-ink-muted"},null,8,["name"]),a("div",fS,w(Ce.value),1),Ce.value==="Drives"?(p(),m("div",hS,[O[56]||(O[56]=z(" Browse and transfer files here once a drive is connected. Configure drives in ",-1)),a("button",{class:"font-semibold text-accent hover:underline",onClick:O[10]||(O[10]=Pe=>Ce.value="Settings")},"Settings → Integrations"),O[57]||(O[57]=z(". ",-1))])):(p(),m("div",pS,"This section is part of the console shell and has no backend yet."))])]))])])}}},_S={key:0,class:"h-full"},bS={key:1,class:"grid h-full place-items-center text-ink-muted text-sm"},yS={__name:"App",setup(t){const i=W(!1),s=W(null),l=W("user"),u=W(""),f=W(""),h=W("");function _(T){l.value=T&&T.role||"user",u.value=T&&T.organization||"",f.value=T&&T.organizationName||""}Ei(async()=>{h.value=(await Qh()).apiBase||"";const T=await vu();T&&(s.value=T.email,_(T),await Su()),i.value=!0});async function y(T){s.value=T,_(await vu()),await Su()}async function C(){Zp(),await tp(),s.value=null,l.value="user",u.value="",f.value=""}return(T,M)=>i.value?(p(),m("div",_S,[s.value?(p(),at(vS,{key:0,email:s.value,role:l.value,organization:u.value,"organization-name":f.value,onLogout:C},null,8,["email","role","organization","organization-name"])):(p(),at(am,{key:1,"default-api-base":h.value,onSignedIn:y},null,8,["default-api-base"]))])):(p(),m("div",bS,"Loading…"))}};qh(yS).mount("#app"); diff --git a/Web App/server/dist/assets/index-Dr5W1RO_.css b/Web App/server/dist/assets/index-buxVzOVb.css similarity index 72% rename from Web App/server/dist/assets/index-Dr5W1RO_.css rename to Web App/server/dist/assets/index-buxVzOVb.css index 0ae2580..d801538 100644 --- a/Web App/server/dist/assets/index-Dr5W1RO_.css +++ b/Web App/server/dist/assets/index-buxVzOVb.css @@ -1 +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)}.pointer-events-none{pointer-events:none}.\!visible{visibility:visible!important}.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.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}.z-50{z-index:50}.z-\[1190\]{z-index:1190}.z-\[1200\]{z-index:1200}.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-2\.5{margin-bottom:.625rem}.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-3\.5{margin-top:.875rem}.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-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[180px\]{height:180px}.h-\[18px\]{height:18px}.h-\[320px\]{height:320px}.h-\[74vh\]{height:74vh}.h-full{height:100%}.max-h-\[90vh\]{max-height:90vh}.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-40{width:10rem}.w-44{width:11rem}.w-48{width:12rem}.w-56{width:14rem}.w-60{width:15rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-72{width:18rem}.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}.max-w-\[920px\]{max-width:920px}.max-w-full{max-width:100%}.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-auto{overflow:auto}.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-0{border-width:0px}.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-3\.5{padding:.875rem}.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-6{padding-left:1.5rem;padding-right:1.5rem}.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-snug{line-height:1.375}.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-40{opacity:.4}.opacity-60{opacity:.6}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: var(--shadow-lg);--tw-shadow-colored: var(--shadow-lg);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.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-cd994362],.fade-leave-active[data-v-cd994362]{transition:opacity .2s}.fade-enter-from[data-v-cd994362],.fade-leave-to[data-v-cd994362]{opacity: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)}.pointer-events-none{pointer-events:none}.\!visible{visibility:visible!important}.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.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}.z-50{z-index:50}.z-\[1190\]{z-index:1190}.z-\[1200\]{z-index:1200}.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-2\.5{margin-bottom:.625rem}.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-3\.5{margin-top:.875rem}.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-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[180px\]{height:180px}.h-\[18px\]{height:18px}.h-\[320px\]{height:320px}.h-\[74vh\]{height:74vh}.h-full{height:100%}.max-h-\[90vh\]{max-height:90vh}.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-40{width:10rem}.w-44{width:11rem}.w-48{width:12rem}.w-56{width:14rem}.w-60{width:15rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-72{width:18rem}.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}.max-w-\[920px\]{max-width:920px}.max-w-full{max-width:100%}.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-auto{overflow:auto}.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-0{border-width:0px}.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-3\.5{padding:.875rem}.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-6{padding-left:1.5rem;padding-right:1.5rem}.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}.py-8{padding-top:2rem;padding-bottom:2rem}.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-5xl{font-size:3rem;line-height:1}.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}.capitalize{text-transform:capitalize}.leading-none{line-height:1}.leading-snug{line-height:1.375}.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-40{opacity:.4}.opacity-60{opacity:.6}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: var(--shadow-lg);--tw-shadow-colored: var(--shadow-lg);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.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-cd994362],.fade-leave-active[data-v-cd994362]{transition:opacity .2s}.fade-enter-from[data-v-cd994362],.fade-leave-to[data-v-cd994362]{opacity:0} diff --git a/Web App/server/dist/index.html b/Web App/server/dist/index.html index 7562e71..ba3f9ae 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 0fe2ec8..d4f028a 100644 --- a/Web App/server/main.go +++ b/Web App/server/main.go @@ -66,6 +66,7 @@ func main() { mux.HandleFunc("GET /bff/integrations/openweather", app.requireAuth(app.handleGetOpenWeather)) mux.HandleFunc("PUT /bff/integrations/openweather", app.requireAuth(app.handlePutOpenWeather)) mux.HandleFunc("POST /bff/integrations/openweather/health", app.requireAuth(app.handleOpenWeatherHealth)) + mux.HandleFunc("GET /bff/integrations/openweather/current", app.requireAuth(app.handleOpenWeatherCurrent)) // User-management (role + org scoping enforced by the API Server) mux.HandleFunc("GET /bff/users", app.requireAuth(app.handleListUsers)) mux.HandleFunc("POST /bff/users", app.requireAuth(app.handleCreateUser)) diff --git a/Web App/web/src/api.js b/Web App/web/src/api.js index 9b941cb..e4bb194 100644 --- a/Web App/web/src/api.js +++ b/Web App/web/src/api.js @@ -310,6 +310,20 @@ export async function testOpenWeather() { return { ok: r.ok, status: r.status, body: await r.json().catch(() => ({})) } } +// Current conditions for the Overview weather card. lat/lon optionally override the +// configured location (drone/device/browser point). Returns {weather, units} when +// available, or {unavailable:true, detail} when OpenWeather is off for the caller. +export async function getOpenWeatherCurrent(lat, lon) { + try { + const qs = lat != null && lon != null ? `?lat=${encodeURIComponent(lat)}&lon=${encodeURIComponent(lon)}` : '' + const r = await fetch(`/bff/integrations/openweather/current${qs}`) + if (!r.ok) return { unavailable: true, detail: 'Weather unavailable' } + return await r.json() + } catch { + return { unavailable: true, detail: 'Weather unavailable' } + } +} + /* ---------- Logbook: drones ---------- */ export async function getDrones() { diff --git a/Web App/web/src/components/Dashboard.vue b/Web App/web/src/components/Dashboard.vue index 8393d12..a0e8e59 100644 --- a/Web App/web/src/components/Dashboard.vue +++ b/Web App/web/src/components/Dashboard.vue @@ -7,7 +7,7 @@ import Settings from './Settings.vue' import Logbook from './Logbook.vue' import Documents from './Documents.vue' import Toggle from './settings/Toggle.vue' -import { getDevices, sendCommand, getOpenSkyStates } from '../api.js' +import { getDevices, sendCommand, getOpenSkyStates, getOpenWeatherCurrent } from '../api.js' import { formatTime, prefs } from '../prefs.js' import { countryForPoint, bboxForCountry } from '../countries.js' @@ -144,6 +144,94 @@ function stopAirspace() { airTimer = null } +/* ---------- OpenWeather current conditions (Overview weather card) ---------- */ +// { loaded, unavailable, detail, data: owWeather|null, units, source, updatedAt } +const weather = reactive({ loaded: false, unavailable: false, detail: '', data: null, units: 'metric', source: '', updatedAt: 0 }) +let weatherTimer = null +// Weather changes slowly and OpenWeather refreshes roughly every 10 min upstream, +// so poll gently to respect the API quota. +const WEATHER_INTERVAL_MS = 10 * 60 * 1000 + +// Resolve the point to fetch weather for, reusing the map's location cascade but +// as a single lat/lng: drone GPS → phone GPS → already-granted browser geolocation. +// Returns null when none is known, so the server uses its configured default. Does +// not prompt for geolocation itself (only reuses a point the map already obtained). +function resolveWeatherPoint() { + const drone = + devicePoint(sel.value, 'latitude', 'longitude') || + ids.value.map((id) => devicePoint(devices[id], 'latitude', 'longitude')).find(Boolean) + if (drone) return { lat: drone.lat, lng: drone.lng, source: 'drone' } + const phone = + devicePoint(sel.value, 'phoneLatitude', 'phoneLongitude') || + ids.value.map((id) => devicePoint(devices[id], 'phoneLatitude', 'phoneLongitude')).find(Boolean) + if (phone) return { lat: phone.lat, lng: phone.lng, source: 'phone' } + if (browserGeo.value) return { lat: browserGeo.value.lat, lng: browserGeo.value.lng, source: 'browser' } + return null +} + +async function refreshWeather() { + const p = resolveWeatherPoint() + const res = await getOpenWeatherCurrent(p ? p.lat : undefined, p ? p.lng : undefined) + weather.loaded = true + weather.units = res.units || 'metric' + if (res.unavailable || !res.weather) { + weather.unavailable = true + weather.detail = res.detail || 'Weather is unavailable.' + weather.data = null + return + } + weather.unavailable = false + weather.detail = '' + weather.data = res.weather + weather.source = p ? p.source : 'default' + weather.updatedAt = Date.now() +} + +function scheduleWeather() { + if (weatherTimer) clearInterval(weatherTimer) + weatherTimer = setInterval(() => { + if (active.value === 'Overview') refreshWeather() + }, WEATHER_INTERVAL_MS) +} +function startWeather() { + refreshWeather() + scheduleWeather() +} +function stopWeather() { + if (weatherTimer) clearInterval(weatherTimer) + weatherTimer = null +} + +// Temperature/wind units follow the resolved OpenWeather "units" setting. +const tempUnit = computed(() => (weather.units === 'imperial' ? '°F' : weather.units === 'standard' ? 'K' : '°C')) +const windUnit = computed(() => (weather.units === 'imperial' ? 'mph' : 'm/s')) + +// Map an OpenWeather icon code (e.g. "01d", "10n") to an emoji, so the card needs +// no external image and works offline. +function wxEmoji(icon) { + const c = (icon || '').slice(0, 2) + if (c === '01') return (icon || '').endsWith('n') ? '🌙' : '☀️' + return { '02': '🌤️', '03': '⛅', '04': '☁️', '09': '🌧️', '10': '🌦️', '11': '⛈️', '13': '❄️', '50': '🌫️' }[c] || '🌡️' +} +const weatherEmoji = computed(() => wxEmoji(weather.data && weather.data.icon)) +const weatherLocation = computed(() => { + const d = weather.data + if (!d) return '' + return d.country ? `${d.location}, ${d.country}` : d.location || 'Unknown location' +}) +const weatherSourceLabel = computed(() => { + if (weather.source === 'drone') return 'at aircraft location' + if (weather.source === 'phone' || weather.source === 'browser') return 'at your location' + return 'default location' +}) +const weatherUpdated = computed(() => + weather.updatedAt ? new Date(weather.updatedAt).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }) : '', +) +// Round a nullable numeric field for display, or "—" when absent. +function wxNum(v, digits = 0) { + return typeof v === 'number' ? v.toFixed(digits) : '—' +} + const active = ref('Overview') const NAV = [ ['grid', 'Overview'], @@ -371,7 +459,10 @@ function track(id) { // Re-fetch air traffic immediately when the operator returns to the Overview tab, // so the map isn't stale for up to a poll interval. watch(active, (v) => { - if (v === 'Overview') refreshAirspace() + if (v === 'Overview') { + refreshAirspace() + refreshWeather() + } }) // React to the "Show live air traffic" map toggle: fetch at once when enabled, @@ -392,12 +483,14 @@ onMounted(async () => { ;(await getDevices()).forEach(upsert) connect() startAirspace() + startWeather() }) onBeforeUnmount(() => { stopped = true if (retry) clearTimeout(retry) if (ws) ws.close() stopAirspace() + stopWeather() }) @@ -579,6 +672,68 @@ onBeforeUnmount(() => {

+
+ +
+
+
+
Conditions
+
Weather
+
+ +
+ + + + + +
+ +
Weather unavailable
+
{{ weather.detail }}
+
+ + +
+ Loading weather… +
+
+ +
@@ -593,6 +748,7 @@ onBeforeUnmount(() => {
Scheduling is not wired to a backend yet.
+