diff --git a/API Server/internal/plugins/builtin/opensky/opensky.go b/API Server/internal/plugins/builtin/opensky/opensky.go index a0671a6..e54bfd6 100644 --- a/API Server/internal/plugins/builtin/opensky/opensky.go +++ b/API Server/internal/plugins/builtin/opensky/opensky.go @@ -25,8 +25,10 @@ import ( const ( apiBase = "https://opensky-network.org/api" tokenURL = "https://auth.opensky-network.org/auth/realms/opensky-network/protocol/openid-connect/token" - // Small default bounding box (Netherlands) keeps the health probe cheap. - defaultBBox = "50.5,3.2,53.7,7.3" // lamin,lomin,lamax,lomax + // Default bounding box covers Europe; matches the "Europe" preset offered in + // the Web App bounding-box picker. Users can narrow it (e.g. a single country) + // to reduce per-query credit cost. + defaultBBox = "34,-25,72,45" // lamin,lomin,lamax,lomax (Europe) ) func init() { diff --git a/Web App/server/dist/assets/index-BdIdzNiz.js b/Web App/server/dist/assets/index-BdIdzNiz.js deleted file mode 100644 index d0b234c..0000000 --- a/Web App/server/dist/assets/index-BdIdzNiz.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 d of u)if(d.type==="childList")for(const h of d.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&l(h)}).observe(document,{childList:!0,subtree:!0});function o(u){const d={};return u.integrity&&(d.integrity=u.integrity),u.referrerPolicy&&(d.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?d.credentials="include":u.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function l(u){if(u.ep)return;u.ep=!0;const d=o(u);fetch(u.href,d)}})();/** -* @vue/shared v3.5.39 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/function Pr(t){const i=Object.create(null);for(const o of t.split(","))i[o]=1;return o=>o in i}const pt={},xs=[],Un=()=>{},mu=()=>!1,pa=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),ma=t=>t.startsWith("onUpdate:"),At=Object.assign,Cr=(t,i)=>{const o=t.indexOf(i);o>-1&&t.splice(o,1)},cd=Object.prototype.hasOwnProperty,ct=(t,i)=>cd.call(t,i),De=Array.isArray,ws=t=>yo(t)==="[object Map]",Es=t=>yo(t)==="[object Set]",hl=t=>yo(t)==="[object Date]",je=t=>typeof t=="function",bt=t=>typeof t=="string",Ln=t=>typeof t=="symbol",dt=t=>t!==null&&typeof t=="object",gu=t=>(dt(t)||je(t))&&je(t.then)&&je(t.catch),vu=Object.prototype.toString,yo=t=>vu.call(t),dd=t=>yo(t).slice(8,-1),_u=t=>yo(t)==="[object Object]",Lr=t=>bt(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,io=Pr(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),ga=t=>{const i=Object.create(null);return(o=>i[o]||(i[o]=t(o)))},fd=/-\w/g,Pn=ga(t=>t.replace(fd,i=>i.slice(1).toUpperCase())),hd=/\B([A-Z])/g,Ei=ga(t=>t.replace(hd,"-$1").toLowerCase()),yu=ga(t=>t.charAt(0).toUpperCase()+t.slice(1)),Ya=ga(t=>t?`on${yu(t)}`:""),Vn=(t,i)=>!Object.is(t,i),ea=(t,...i)=>{for(let o=0;o{Object.defineProperty(t,i,{configurable:!0,enumerable:!1,writable:l,value:o})},va=t=>{const i=parseFloat(t);return isNaN(i)?t:i},pd=t=>{const i=bt(t)?Number(t):NaN;return isNaN(i)?t:i};let pl;const _a=()=>pl||(pl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Cs(t){if(De(t)){const i={};for(let o=0;o{if(o){const l=o.split(gd);l.length>1&&(i[l[0].trim()]=l[1].trim())}}),i}function Oe(t){let i="";if(bt(t))i=t;else if(De(t))for(let o=0;oCi(o,i))}const wu=t=>!!(t&&t.__v_isRef===!0),k=t=>bt(t)?t:t==null?"":De(t)||dt(t)&&(t.toString===vu||!je(t.toString))?wu(t)?k(t.value):JSON.stringify(t,ku,2):String(t),ku=(t,i)=>wu(i)?ku(t,i.value):ws(i)?{[`Map(${i.size})`]:[...i.entries()].reduce((o,[l,u],d)=>(o[Ja(l,d)+" =>"]=u,o),{})}:Es(i)?{[`Set(${i.size})`]:[...i.values()].map(o=>Ja(o))}:Ln(i)?Ja(i):dt(i)&&!De(i)&&!_u(i)?String(i):i,Ja=(t,i="")=>{var o;return Ln(t)?`Symbol(${(o=t.description)!=null?o:i})`:t};/** -* @vue/reactivity v3.5.39 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/let Dt;class wd{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&&Dt&&(Dt.active?(this.parent=Dt,this.index=(Dt.scopes||(Dt.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let i,o;if(this.scopes)for(i=0,o=this.scopes.length;i0&&--this._on===0){if(Dt===this)Dt=this.prevScope;else{let i=Dt;for(;i;){if(i.prevScope===this){i.prevScope=this.prevScope;break}i=i.prevScope}}this.prevScope=void 0}}stop(i){if(this._active){this._active=!1;let o,l;for(o=0,l=this.effects.length;o0)return;if(oo){let i=oo;for(oo=void 0;i;){const o=i.next;i.next=void 0,i.flags&=-9,i=o}}let t;for(;so;){let i=so;for(so=void 0;i;){const o=i.next;if(i.next=void 0,i.flags&=-9,i.flags&1)try{i.trigger()}catch(l){t||(t=l)}i=o}}if(t)throw t}function Cu(t){for(let i=t.deps;i;i=i.nextDep)i.version=-1,i.prevActiveLink=i.dep.activeLink,i.dep.activeLink=i}function Lu(t){let i,o=t.depsTail,l=o;for(;l;){const u=l.prevDep;l.version===-1?(l===o&&(o=u),zr(l),Sd(l)):i=l,l.dep.activeLink=l.prevActiveLink,l.prevActiveLink=void 0,l=u}t.deps=i,t.depsTail=o}function ur(t){for(let i=t.deps;i;i=i.nextDep)if(i.dep.version!==i.version||i.dep.computed&&(Mu(i.dep.computed)||i.dep.version!==i.version))return!0;return!!t._dirty}function Mu(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===co)||(t.globalVersion=co,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!ur(t))))return;t.flags|=2;const i=t.dep,o=vt,l=Cn;vt=t,Cn=!0;try{Cu(t);const u=t.fn(t._value);(i.version===0||Vn(u,t._value))&&(t.flags|=128,t._value=u,i.version++)}catch(u){throw i.version++,u}finally{vt=o,Cn=l,Lu(t),t.flags&=-3}}function zr(t,i=!1){const{dep:o,prevSub:l,nextSub:u}=t;if(l&&(l.nextSub=u,t.prevSub=void 0),u&&(u.prevSub=l,t.nextSub=void 0),o.subs===t&&(o.subs=l,!l&&o.computed)){o.computed.flags&=-5;for(let d=o.computed.deps;d;d=d.nextDep)zr(d,!0)}!i&&!--o.sc&&o.map&&o.map.delete(o.key)}function Sd(t){const{prevDep:i,nextDep:o}=t;i&&(i.nextDep=o,t.prevDep=void 0),o&&(o.prevDep=i,t.nextDep=void 0)}let Cn=!0;const Eu=[];function Zn(){Eu.push(Cn),Cn=!1}function Hn(){const t=Eu.pop();Cn=t===void 0?!0:t}function ml(t){const{cleanup:i}=t;if(t.cleanup=void 0,i){const o=vt;vt=void 0;try{i()}finally{vt=o}}}let co=0;class Td{constructor(i,o){this.sub=i,this.dep=o,this.version=o.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Ar{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(!vt||!Cn||vt===this.computed)return;let o=this.activeLink;if(o===void 0||o.sub!==vt)o=this.activeLink=new Td(vt,this),vt.deps?(o.prevDep=vt.depsTail,vt.depsTail.nextDep=o,vt.depsTail=o):vt.deps=vt.depsTail=o,Ou(o);else if(o.version===-1&&(o.version=this.version,o.nextDep)){const l=o.nextDep;l.prevDep=o.prevDep,o.prevDep&&(o.prevDep.nextDep=l),o.prevDep=vt.depsTail,o.nextDep=void 0,vt.depsTail.nextDep=o,vt.depsTail=o,vt.deps===o&&(vt.deps=l)}return o}trigger(i){this.version++,co++,this.notify(i)}notify(i){Er();try{for(let o=this.subs;o;o=o.prevSub)o.sub.notify()&&o.sub.dep.notify()}finally{Or()}}}function Ou(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)Ou(l)}const o=t.dep.subs;o!==t&&(t.prevSub=o,o&&(o.nextSub=t)),t.dep.subs=t}}const cr=new WeakMap,Ji=Symbol(""),dr=Symbol(""),fo=Symbol("");function Ft(t,i,o){if(Cn&&vt){let l=cr.get(t);l||cr.set(t,l=new Map);let u=l.get(o);u||(l.set(o,u=new Ar),u.map=l,u.key=o),u.track()}}function oi(t,i,o,l,u,d){const h=cr.get(t);if(!h){co++;return}const _=y=>{y&&y.trigger()};if(Er(),i==="clear")h.forEach(_);else{const y=De(t),M=y&&Lr(o);if(y&&o==="length"){const S=Number(l);h.forEach((O,B)=>{(B==="length"||B===fo||!Ln(B)&&B>=S)&&_(O)})}else switch((o!==void 0||h.has(void 0))&&_(h.get(o)),M&&_(h.get(fo)),i){case"add":y?M&&_(h.get("length")):(_(h.get(Ji)),ws(t)&&_(h.get(dr)));break;case"delete":y||(_(h.get(Ji)),ws(t)&&_(h.get(dr)));break;case"set":ws(t)&&_(h.get(Ji));break}}Or()}function ys(t){const i=ot(t);return i===t?i:(Ft(i,"iterate",fo),mn(t)?i:i.map(Mn))}function ya(t){return Ft(t=ot(t),"iterate",fo),t}function Fn(t,i){return li(t)?Ls(Xi(t)?Mn(i):i):Mn(i)}const Pd={__proto__:null,[Symbol.iterator](){return Qa(this,Symbol.iterator,t=>Fn(this,t))},concat(...t){return ys(this).concat(...t.map(i=>De(i)?ys(i):i))},entries(){return Qa(this,"entries",t=>(t[1]=Fn(this,t[1]),t))},every(t,i){return ti(this,"every",t,i,void 0,arguments)},filter(t,i){return ti(this,"filter",t,i,o=>o.map(l=>Fn(this,l)),arguments)},find(t,i){return ti(this,"find",t,i,o=>Fn(this,o),arguments)},findIndex(t,i){return ti(this,"findIndex",t,i,void 0,arguments)},findLast(t,i){return ti(this,"findLast",t,i,o=>Fn(this,o),arguments)},findLastIndex(t,i){return ti(this,"findLastIndex",t,i,void 0,arguments)},forEach(t,i){return ti(this,"forEach",t,i,void 0,arguments)},includes(...t){return er(this,"includes",t)},indexOf(...t){return er(this,"indexOf",t)},join(t){return ys(this).join(t)},lastIndexOf(...t){return er(this,"lastIndexOf",t)},map(t,i){return ti(this,"map",t,i,void 0,arguments)},pop(){return qs(this,"pop")},push(...t){return qs(this,"push",t)},reduce(t,...i){return gl(this,"reduce",t,i)},reduceRight(t,...i){return gl(this,"reduceRight",t,i)},shift(){return qs(this,"shift")},some(t,i){return ti(this,"some",t,i,void 0,arguments)},splice(...t){return qs(this,"splice",t)},toReversed(){return ys(this).toReversed()},toSorted(t){return ys(this).toSorted(t)},toSpliced(...t){return ys(this).toSpliced(...t)},unshift(...t){return qs(this,"unshift",t)},values(){return Qa(this,"values",t=>Fn(this,t))}};function Qa(t,i,o){const l=ya(t),u=l[i]();return l!==t&&!mn(t)&&(u._next=u.next,u.next=()=>{const d=u._next();return d.done||(d.value=o(d.value)),d}),u}const Cd=Array.prototype;function ti(t,i,o,l,u,d){const h=ya(t),_=h!==t&&!mn(t),y=h[i];if(y!==Cd[i]){const O=y.apply(t,d);return _?Mn(O):O}let M=o;h!==t&&(_?M=function(O,B){return o.call(this,Fn(t,O),B,t)}:o.length>2&&(M=function(O,B){return o.call(this,O,B,t)}));const S=y.call(h,M,l);return _&&u?u(S):S}function gl(t,i,o,l){const u=ya(t),d=u!==t&&!mn(t);let h=o,_=!1;u!==t&&(d?(_=l.length===0,h=function(M,S,O){return _&&(_=!1,M=Fn(t,M)),o.call(this,M,Fn(t,S),O,t)}):o.length>3&&(h=function(M,S,O){return o.call(this,M,S,O,t)}));const y=u[i](h,...l);return _?Fn(t,y):y}function er(t,i,o){const l=ot(t);Ft(l,"iterate",fo);const u=l[i](...o);return(u===-1||u===!1)&&Dr(o[0])?(o[0]=ot(o[0]),l[i](...o)):u}function qs(t,i,o=[]){Zn(),Er();const l=ot(t)[i].apply(t,o);return Or(),Hn(),l}const Ld=Pr("__proto__,__v_isRef,__isVue"),zu=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(Ln));function Md(t){Ln(t)||(t=String(t));const i=ot(this);return Ft(i,"has",t),i.hasOwnProperty(t)}class Au{constructor(i=!1,o=!1){this._isReadonly=i,this._isShallow=o}get(i,o,l){if(o==="__v_skip")return i.__v_skip;const u=this._isReadonly,d=this._isShallow;if(o==="__v_isReactive")return!u;if(o==="__v_isReadonly")return u;if(o==="__v_isShallow")return d;if(o==="__v_raw")return l===(u?d?Fd:Nu:d?Du:Iu).get(i)||Object.getPrototypeOf(i)===Object.getPrototypeOf(l)?i:void 0;const h=De(i);if(!u){let y;if(h&&(y=Pd[o]))return y;if(o==="hasOwnProperty")return Md}const _=Reflect.get(i,o,Ut(i)?i:l);if((Ln(o)?zu.has(o):Ld(o))||(u||Ft(i,"get",o),d))return _;if(Ut(_)){const y=h&&Lr(o)?_:_.value;return u&&dt(y)?hr(y):y}return dt(_)?u?hr(_):yt(_):_}}class $u extends Au{constructor(i=!1){super(!1,i)}set(i,o,l,u){let d=i[o];const h=De(i)&&Lr(o);if(!this._isShallow){const M=li(d);if(!mn(l)&&!li(l)&&(d=ot(d),l=ot(l)),!h&&Ut(d)&&!Ut(l))return M||(d.value=l),!0}const _=h?Number(o)t,Go=t=>Reflect.getPrototypeOf(t);function $d(t,i,o){return function(...l){const u=this.__v_raw,d=ot(u),h=ws(d),_=t==="entries"||t===Symbol.iterator&&h,y=t==="keys"&&h,M=u[t](...l),S=o?fr:i?Ls:Mn;return!i&&Ft(d,"iterate",y?dr:Ji),At(Object.create(M),{next(){const{value:O,done:B}=M.next();return B?{value:O,done:B}:{value:_?[S(O[0]),S(O[1])]:S(O),done:B}}})}}function qo(t){return function(...i){return t==="delete"?!1:t==="clear"?void 0:this}}function Id(t,i){const o={get(u){const d=this.__v_raw,h=ot(d),_=ot(u);t||(Vn(u,_)&&Ft(h,"get",u),Ft(h,"get",_));const{has:y}=Go(h),M=i?fr:t?Ls:Mn;if(y.call(h,u))return M(d.get(u));if(y.call(h,_))return M(d.get(_));d!==h&&d.get(u)},get size(){const u=this.__v_raw;return!t&&Ft(ot(u),"iterate",Ji),u.size},has(u){const d=this.__v_raw,h=ot(d),_=ot(u);return t||(Vn(u,_)&&Ft(h,"has",u),Ft(h,"has",_)),u===_?d.has(u):d.has(u)||d.has(_)},forEach(u,d){const h=this,_=h.__v_raw,y=ot(_),M=i?fr:t?Ls:Mn;return!t&&Ft(y,"iterate",Ji),_.forEach((S,O)=>u.call(d,M(S),M(O),h))}};return At(o,t?{add:qo("add"),set:qo("set"),delete:qo("delete"),clear:qo("clear")}:{add(u){const d=ot(this),h=Go(d),_=ot(u),y=!i&&!mn(u)&&!li(u)?_:u;return h.has.call(d,y)||Vn(u,y)&&h.has.call(d,u)||Vn(_,y)&&h.has.call(d,_)||(d.add(y),oi(d,"add",y,y)),this},set(u,d){!i&&!mn(d)&&!li(d)&&(d=ot(d));const h=ot(this),{has:_,get:y}=Go(h);let M=_.call(h,u);M||(u=ot(u),M=_.call(h,u));const S=y.call(h,u);return h.set(u,d),M?Vn(d,S)&&oi(h,"set",u,d):oi(h,"add",u,d),this},delete(u){const d=ot(this),{has:h,get:_}=Go(d);let y=h.call(d,u);y||(u=ot(u),y=h.call(d,u)),_&&_.call(d,u);const M=d.delete(u);return y&&oi(d,"delete",u,void 0),M},clear(){const u=ot(this),d=u.size!==0,h=u.clear();return d&&oi(u,"clear",void 0,void 0),h}}),["keys","values","entries",Symbol.iterator].forEach(u=>{o[u]=$d(u,t,i)}),o}function $r(t,i){const o=Id(t,i);return(l,u,d)=>u==="__v_isReactive"?!t:u==="__v_isReadonly"?t:u==="__v_raw"?l:Reflect.get(ct(o,u)&&u in l?o:l,u,d)}const Dd={get:$r(!1,!1)},Nd={get:$r(!1,!0)},Rd={get:$r(!0,!1)};const Iu=new WeakMap,Du=new WeakMap,Nu=new WeakMap,Fd=new WeakMap;function Bd(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function yt(t){return li(t)?t:Ir(t,!1,Od,Dd,Iu)}function Vd(t){return Ir(t,!1,Ad,Nd,Du)}function hr(t){return Ir(t,!0,zd,Rd,Nu)}function Ir(t,i,o,l,u){if(!dt(t)||t.__v_raw&&!(i&&t.__v_isReactive)||t.__v_skip||!Object.isExtensible(t))return t;const d=u.get(t);if(d)return d;const h=Bd(dd(t));if(h===0)return t;const _=new Proxy(t,h===2?l:o);return u.set(t,_),_}function Xi(t){return li(t)?Xi(t.__v_raw):!!(t&&t.__v_isReactive)}function li(t){return!!(t&&t.__v_isReadonly)}function mn(t){return!!(t&&t.__v_isShallow)}function Dr(t){return t?!!t.__v_raw:!1}function ot(t){const i=t&&t.__v_raw;return i?ot(i):t}function Ud(t){return!ct(t,"__v_skip")&&Object.isExtensible(t)&&bu(t,"__v_skip",!0),t}const Mn=t=>dt(t)?yt(t):t,Ls=t=>dt(t)?hr(t):t;function Ut(t){return t?t.__v_isRef===!0:!1}function G(t){return Zd(t,!1)}function Zd(t,i){return Ut(t)?t:new Hd(t,i)}class Hd{constructor(i,o){this.dep=new Ar,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=o?i:ot(i),this._value=o?i:Mn(i),this.__v_isShallow=o}get value(){return this.dep.track(),this._value}set value(i){const o=this._rawValue,l=this.__v_isShallow||mn(i)||li(i);i=l?i:ot(i),Vn(i,o)&&(this._rawValue=i,this._value=l?i:Mn(i),this.dep.trigger())}}function $e(t){return Ut(t)?t.value:t}const jd={get:(t,i,o)=>i==="__v_raw"?t:$e(Reflect.get(t,i,o)),set:(t,i,o,l)=>{const u=t[i];return Ut(u)&&!Ut(o)?(u.value=o,!0):Reflect.set(t,i,o,l)}};function Ru(t){return Xi(t)?t:new Proxy(t,jd)}class Wd{constructor(i,o,l){this.fn=i,this.setter=o,this._value=void 0,this.dep=new Ar(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=co-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!o,this.isSSR=l}notify(){if(this.flags|=16,!(this.flags&8)&&vt!==this)return Pu(this,!0),!0}get value(){const i=this.dep.track();return Mu(this),i&&(i.version=this.dep.version),this._value}set value(i){this.setter&&this.setter(i)}}function Kd(t,i,o=!1){let l,u;return je(t)?l=t:(l=t.get,u=t.set),new Wd(l,u,o)}const Yo={},na=new WeakMap;let Gi;function Gd(t,i=!1,o=Gi){if(o){let l=na.get(o);l||na.set(o,l=[]),l.push(t)}}function qd(t,i,o=pt){const{immediate:l,deep:u,once:d,scheduler:h,augmentJob:_,call:y}=o,M=he=>u?he:mn(he)||u===!1||u===0?ai(he,1):ai(he);let S,O,B,V,Z=!1,F=!1;if(Ut(t)?(O=()=>t.value,Z=mn(t)):Xi(t)?(O=()=>M(t),Z=!0):De(t)?(F=!0,Z=t.some(he=>Xi(he)||mn(he)),O=()=>t.map(he=>{if(Ut(he))return he.value;if(Xi(he))return M(he);if(je(he))return y?y(he,2):he()})):je(t)?i?O=y?()=>y(t,2):t:O=()=>{if(B){Zn();try{B()}finally{Hn()}}const he=Gi;Gi=S;try{return y?y(t,3,[V]):t(V)}finally{Gi=he}}:O=Un,i&&u){const he=O,be=u===!0?1/0:u;O=()=>ai(he(),be)}const fe=kd(),ve=()=>{S.stop(),fe&&fe.active&&Cr(fe.effects,S)};if(d&&i){const he=i;i=(...be)=>{const Re=he(...be);return ve(),Re}}let q=F?new Array(t.length).fill(Yo):Yo;const Ce=he=>{if(!(!(S.flags&1)||!S.dirty&&!he))if(i){const be=S.run();if(he||u||Z||(F?be.some((Re,Ie)=>Vn(Re,q[Ie])):Vn(be,q))){B&&B();const Re=Gi;Gi=S;try{const Ie=[be,q===Yo?void 0:F&&q[0]===Yo?[]:q,V];q=be,y?y(i,3,Ie):i(...Ie)}finally{Gi=Re}}}else S.run()};return _&&_(Ce),S=new Su(O),S.scheduler=h?()=>h(Ce,!1):Ce,V=he=>Gd(he,!1,S),B=S.onStop=()=>{const he=na.get(S);if(he){if(y)y(he,4);else for(const be of he)be();na.delete(S)}},i?l?Ce(!0):q=S.run():h?h(Ce.bind(null,!0),!0):S.run(),ve.pause=S.pause.bind(S),ve.resume=S.resume.bind(S),ve.stop=ve,ve}function ai(t,i=1/0,o){if(i<=0||!dt(t)||t.__v_skip||(o=o||new Map,(o.get(t)||0)>=i))return t;if(o.set(t,i),i--,Ut(t))ai(t.value,i,o);else if(De(t))for(let l=0;l{ai(l,i,o)});else if(_u(t)){for(const l in t)ai(t[l],i,o);for(const l of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,l)&&ai(t[l],i,o)}return t}/** -* @vue/runtime-core v3.5.39 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/function bo(t,i,o,l){try{return l?t(...l):t()}catch(u){ba(u,i,o)}}function vn(t,i,o,l){if(je(t)){const u=bo(t,i,o,l);return u&&gu(u)&&u.catch(d=>{ba(d,i,o)}),u}if(De(t)){const u=[];for(let d=0;d>>1,u=Yt[l],d=ho(u);d=ho(o)?Yt.push(t):Yt.splice(Jd(i),0,t),t.flags|=1,Vu()}}function Vu(){ia||(ia=Fu.then(Zu))}function Xd(t){De(t)?ks.push(...t):Pi&&t.id===-1?Pi.splice(bs+1,0,t):t.flags&1||(ks.push(t),t.flags|=1),Vu()}function vl(t,i,o=Rn+1){for(;oho(o)-ho(l));if(ks.length=0,Pi){Pi.push(...i);return}for(Pi=i,bs=0;bst.id==null?t.flags&2?-1:1/0:t.id;function Zu(t){try{for(Rn=0;Rn{l._d&&ra(-1);const d=sa(i);let h;try{h=t(...u)}finally{sa(d),l._d&&ra(1)}return h};return l._n=!0,l._c=!0,l._d=!0,l}function re(t,i){if(Vt===null)return t;const o=Ta(Vt),l=t.dirs||(t.dirs=[]);for(let u=0;u1)return o&&je(i)?i.call(l&&l.proxy):i}}const Qd=Symbol.for("v-scx"),ef=()=>ao(Qd);function zt(t,i,o){return Wu(t,i,o)}function Wu(t,i,o=pt){const{immediate:l,deep:u,flush:d,once:h}=o,_=At({},o),y=i&&l||!i&&d!=="post";let M;if(vo){if(d==="sync"){const V=ef();M=V.__watcherHandles||(V.__watcherHandles=[])}else if(!y){const V=()=>{};return V.stop=Un,V.resume=Un,V.pause=Un,V}}const S=Jt;_.call=(V,Z,F)=>vn(V,S,Z,F);let O=!1;d==="post"?_.scheduler=V=>{qt(V,S&&S.suspense)}:d!=="sync"&&(O=!0,_.scheduler=(V,Z)=>{Z?V():Nr(V)}),_.augmentJob=V=>{i&&(V.flags|=4),O&&(V.flags|=2,S&&(V.id=S.uid,V.i=S))};const B=qd(t,i,_);return vo&&(M?M.push(B):y&&B()),B}function tf(t,i,o){const l=this.proxy,u=bt(t)?t.includes(".")?Ku(l,t):()=>l[t]:t.bind(l,l);let d;je(i)?d=i:(d=i.handler,o=i);const h=xo(this),_=Wu(u,d.bind(l),o);return h(),_}function Ku(t,i){const o=i.split(".");return()=>{let l=t;for(let u=0;ut.__isTeleport,qi=t=>t&&(t.disabled||t.disabled===""),nf=t=>t&&(t.defer||t.defer===""),_l=t=>typeof SVGElement<"u"&&t instanceof SVGElement,yl=t=>typeof MathMLElement=="function"&&t instanceof MathMLElement,pr=(t,i)=>{const o=t&&t.to;return bt(o)?i?i(o):null:o},sf={name:"Teleport",__isTeleport:!0,process(t,i,o,l,u,d,h,_,y,M){const{mc:S,pc:O,pbc:B,o:{insert:V,querySelector:Z,createText:F,createComment:fe,parentNode:ve}}=M,q=qi(i.props);let{dynamicChildren:Ce}=i;const he=(Ie,Ue,pe)=>{Ie.shapeFlag&16&&S(Ie.children,Ue,pe,u,d,h,_,y)},be=(Ie=i)=>{const Ue=qi(Ie.props),pe=Ie.target=pr(Ie.props,Z),Ae=mr(pe,Ie,F,V);pe&&(h!=="svg"&&_l(pe)?h="svg":h!=="mathml"&&yl(pe)&&(h="mathml"),u&&u.isCE&&(u.ce._teleportTargets||(u.ce._teleportTargets=new Set)).add(pe),Ue||(he(Ie,pe,Ae),Qs(Ie,!1)))},Re=Ie=>{const Ue=()=>{if(Ti.get(Ie)===Ue){if(Ti.delete(Ie),qi(Ie.props)){const pe=ve(Ie.el)||o;he(Ie,pe,Ie.anchor),Qs(Ie,!0)}be(Ie)}};Ti.set(Ie,Ue),qt(Ue,d)};if(t==null){const Ie=i.el=F(""),Ue=i.anchor=F("");if(V(Ie,o,l),V(Ue,o,l),nf(i.props)||d&&d.pendingBranch){Re(i);return}q&&(he(i,o,Ue),Qs(i,!0)),be()}else{i.el=t.el;const Ie=i.anchor=t.anchor,Ue=Ti.get(t);if(Ue){Ue.flags|=8,Ti.delete(t),Re(i);return}i.targetStart=t.targetStart;const pe=i.target=t.target,Ae=i.targetAnchor=t.targetAnchor,Te=qi(t.props),te=Te?o:pe,de=Te?Ie:Ae;if(h==="svg"||_l(pe)?h="svg":(h==="mathml"||yl(pe))&&(h="mathml"),Ce?(B(t.dynamicChildren,Ce,te,u,d,h,_),Br(t,i,!0)):y||O(t,i,te,de,u,d,h,_,!1),q)Te?i.props&&t.props&&i.props.to!==t.props.to&&(i.props.to=t.props.to):Jo(i,o,Ie,M,1);else if((i.props&&i.props.to)!==(t.props&&t.props.to)){const ye=pr(i.props,Z);ye&&(i.target=ye,Jo(i,ye,null,M,0))}else Te&&Jo(i,pe,Ae,M,1);Qs(i,q)}},remove(t,i,o,{um:l,o:{remove:u}},d){const{shapeFlag:h,children:_,anchor:y,targetStart:M,targetAnchor:S,target:O,props:B}=t,V=qi(B),Z=d||!V,F=Ti.get(t);if(F&&(F.flags|=8,Ti.delete(t)),O&&(u(M),u(S)),d&&u(y),!F&&(V||O)&&h&16)for(let fe=0;fe<_.length;fe++){const ve=_[fe];l(ve,i,o,Z,!!ve.dynamicChildren)}},move:Jo,hydrate:of};function Jo(t,i,o,{o:{insert:l},m:u},d=2){d===0&&l(t.targetAnchor,i,o);const{el:h,anchor:_,shapeFlag:y,children:M,props:S}=t,O=d===2;if(O&&l(h,i,o),!Ti.has(t)&&(!O||qi(S))&&y&16)for(let B=0;B{t.isMounted=!0}),Os(()=>{t.isUnmounting=!0}),t}const fn=[Function,Array],Yu={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:fn,onEnter:fn,onAfterEnter:fn,onEnterCancelled:fn,onBeforeLeave:fn,onLeave:fn,onAfterLeave:fn,onLeaveCancelled:fn,onBeforeAppear:fn,onAppear:fn,onAfterAppear:fn,onAppearCancelled:fn},Ju=t=>{const i=t.subTree;return i.component?Ju(i.component):i},lf={name:"BaseTransition",props:Yu,setup(t,{slots:i}){const o=kc(),l=rf();return()=>{const u=i.default&&ec(i.default(),!0),d=u&&u.length?Xu(u):o.subTree?R():void 0;if(!d)return;const h=ot(t),{mode:_}=h;if(l.isLeaving)return tr(d);const y=bl(d);if(!y)return tr(d);let M=gr(y,h,l,o,O=>M=O);y.type!==Bt&&po(y,M);let S=o.subTree&&bl(o.subTree);if(S&&S.type!==Bt&&!Yi(S,y)&&Ju(o).type!==Bt){let O=gr(S,h,l,o);if(po(S,O),_==="out-in"&&y.type!==Bt)return l.isLeaving=!0,O.afterLeave=()=>{l.isLeaving=!1,o.job.flags&8||o.update(),delete O.afterLeave,S=void 0},tr(d);_==="in-out"&&y.type!==Bt?O.delayLeave=(B,V,Z)=>{const F=Qu(l,S);F[String(S.key)]=S,B[pn]=()=>{V(),B[pn]=void 0,delete M.delayedLeave,S=void 0},M.delayedLeave=()=>{Z(),delete M.delayedLeave,S=void 0}}:S=void 0}else S&&(S=void 0);return d}}};function Xu(t){let i=t[0];if(t.length>1){for(const o of t)if(o.type!==Bt){i=o;break}}return i}const uf=lf;function Qu(t,i){const{leavingVNodes:o}=t;let l=o.get(i.type);return l||(l=Object.create(null),o.set(i.type,l)),l}function gr(t,i,o,l,u){const{appear:d,mode:h,persisted:_=!1,onBeforeEnter:y,onEnter:M,onAfterEnter:S,onEnterCancelled:O,onBeforeLeave:B,onLeave:V,onAfterLeave:Z,onLeaveCancelled:F,onBeforeAppear:fe,onAppear:ve,onAfterAppear:q,onAppearCancelled:Ce}=i,he=String(t.key),be=Qu(o,t),Re=(pe,Ae)=>{pe&&vn(pe,l,9,Ae)},Ie=(pe,Ae)=>{const Te=Ae[1];Re(pe,Ae),De(pe)?pe.every(te=>te.length<=1)&&Te():pe.length<=1&&Te()},Ue={mode:h,persisted:_,beforeEnter(pe){let Ae=y;if(!o.isMounted)if(d)Ae=fe||y;else return;pe[pn]&&pe[pn](!0);const Te=be[he];Te&&Yi(t,Te)&&Te.el[pn]&&Te.el[pn](),Re(Ae,[pe])},enter(pe){if(be[he]===t)return;let Ae=M,Te=S,te=O;if(!o.isMounted)if(d)Ae=ve||M,Te=q||S,te=Ce||O;else return;let de=!1;pe[Ys]=Se=>{de||(de=!0,Se?Re(te,[pe]):Re(Te,[pe]),Ue.delayedLeave&&Ue.delayedLeave(),pe[Ys]=void 0)};const ye=pe[Ys].bind(null,!1);Ae?Ie(Ae,[pe,ye]):ye()},leave(pe,Ae){const Te=String(t.key);if(pe[Ys]&&pe[Ys](!0),o.isUnmounting)return Ae();Re(B,[pe]);let te=!1;pe[pn]=ye=>{te||(te=!0,Ae(),ye?Re(F,[pe]):Re(Z,[pe]),pe[pn]=void 0,be[Te]===t&&delete be[Te])};const de=pe[pn].bind(null,!1);be[Te]=t,V?Ie(V,[pe,de]):de()},clone(pe){const Ae=gr(pe,i,o,l,u);return u&&u(Ae),Ae}};return Ue}function tr(t){if(xa(t))return t=Li(t),t.children=null,t}function bl(t){if(!xa(t))return qu(t.type)&&t.children?Xu(t.children):t;if(t.component)return t.component.subTree;const{shapeFlag:i,children:o}=t;if(o){if(i&16)return o[0];if(i&32&&je(o.default))return o.default()}}function po(t,i){t.shapeFlag&6&&t.component?(t.transition=i,po(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 ec(t,i=!1,o){let l=[],u=0;for(let d=0;d1)for(let d=0;dro(F,i&&(De(i)?i[fe]:i),o,l,u));return}if(Ss(l)&&!u){l.shapeFlag&512&&l.type.__asyncResolved&&l.component.subTree.component&&ro(t,i,o,l.component.subTree);return}const d=l.shapeFlag&4?Ta(l.component):l.el,h=u?null:d,{i:_,r:y}=t,M=i&&i.r,S=_.refs===pt?_.refs={}:_.refs,O=_.setupState,B=ot(O),V=O===pt?mu:F=>xl(S,F)?!1:ct(B,F),Z=(F,fe)=>!(fe&&xl(S,fe));if(M!=null&&M!==y){if(wl(i),bt(M))S[M]=null,V(M)&&(O[M]=null);else if(Ut(M)){const F=i;Z(M,F.k)&&(M.value=null),F.k&&(S[F.k]=null)}}if(je(y)){Zn();try{bo(y,_,12,[h,S])}finally{Hn()}}else{const F=bt(y),fe=Ut(y);if(F||fe){const ve=()=>{if(t.f){const q=F?V(y)?O[y]:S[y]:Z()||!t.k?y.value:S[t.k];if(u)De(q)&&Cr(q,d);else if(De(q))q.includes(d)||q.push(d);else if(F)S[y]=[d],V(y)&&(O[y]=S[y]);else{const Ce=[d];Z(y,t.k)&&(y.value=Ce),t.k&&(S[t.k]=Ce)}}else F?(S[y]=h,V(y)&&(O[y]=h)):fe&&(Z(y,t.k)&&(y.value=h),t.k&&(S[t.k]=h))};if(h){const q=()=>{ve(),oa.delete(t)};q.id=-1,oa.set(t,q),qt(q,o)}else wl(t),ve()}}}function wl(t){const i=oa.get(t);i&&(i.flags|=8,oa.delete(t))}_a().requestIdleCallback;_a().cancelIdleCallback;const Ss=t=>!!t.type.__asyncLoader,xa=t=>t.type.__isKeepAlive;function cf(t,i){nc(t,"a",i)}function df(t,i){nc(t,"da",i)}function nc(t,i,o=Jt){const l=t.__wdc||(t.__wdc=()=>{let u=o;for(;u;){if(u.isDeactivated)return;u=u.parent}return t()});if(wa(i,l,o),o){let u=o.parent;for(;u&&u.parent;)xa(u.parent.vnode)&&ff(l,i,o,u),u=u.parent}}function ff(t,i,o,l){const u=wa(i,t,l,!0);ic(()=>{Cr(l[i],u)},o)}function wa(t,i,o=Jt,l=!1){if(o){const u=o[t]||(o[t]=[]),d=i.__weh||(i.__weh=(...h)=>{Zn();const _=xo(o),y=vn(i,o,t,h);return _(),Hn(),y});return l?u.unshift(d):u.push(d),d}}const ci=t=>(i,o=Jt)=>{(!vo||t==="sp")&&wa(t,(...l)=>i(...l),o)},hf=ci("bm"),ui=ci("m"),pf=ci("bu"),mf=ci("u"),Os=ci("bum"),ic=ci("um"),gf=ci("sp"),vf=ci("rtg"),_f=ci("rtc");function yf(t,i=Jt){wa("ec",t,i)}const bf=Symbol.for("v-ndc");function Ve(t,i,o,l){let u;const d=o,h=De(t);if(h||bt(t)){const _=h&&Xi(t);let y=!1,M=!1;_&&(y=!mn(t),M=li(t),t=ya(t)),u=new Array(t.length);for(let S=0,O=t.length;Si(_,y,void 0,d));else{const _=Object.keys(t);u=new Array(_.length);for(let y=0,M=_.length;y0;return p(),it(ce,null,[z("slot",o,l)],M?-2:64)}let d=t[i];d&&d._c&&(d._d=!1),p();const h=d&&sc(d(o)),_=o.key||h&&h.key,y=it(ce,{key:(_&&!Ln(_)?_:`_${i}`)+(!h&&l?"_fb":"")},h||[],h&&t._===1?64:-2);return y.scopeId&&(y.slotScopeIds=[y.scopeId+"-s"]),d&&d._c&&(d._d=!0),y}function sc(t){return t.some(i=>go(i)?!(i.type===Bt||i.type===ce&&!sc(i.children)):!0)?t:null}const vr=t=>t?Sc(t)?Ta(t):vr(t.parent):null,lo=At(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=>vr(t.parent),$root:t=>vr(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>ac(t),$forceUpdate:t=>t.f||(t.f=()=>{Nr(t.update)}),$nextTick:t=>t.n||(t.n=Bu.bind(t.proxy)),$watch:t=>tf.bind(t)}),nr=(t,i)=>t!==pt&&!t.__isScriptSetup&&ct(t,i),wf={get({_:t},i){if(i==="__v_skip")return!0;const{ctx:o,setupState:l,data:u,props:d,accessCache:h,type:_,appContext:y}=t;if(i[0]!=="$"){const B=h[i];if(B!==void 0)switch(B){case 1:return l[i];case 2:return u[i];case 4:return o[i];case 3:return d[i]}else{if(nr(l,i))return h[i]=1,l[i];if(u!==pt&&ct(u,i))return h[i]=2,u[i];if(ct(d,i))return h[i]=3,d[i];if(o!==pt&&ct(o,i))return h[i]=4,o[i];_r&&(h[i]=0)}}const M=lo[i];let S,O;if(M)return i==="$attrs"&&Ft(t.attrs,"get",""),M(t);if((S=_.__cssModules)&&(S=S[i]))return S;if(o!==pt&&ct(o,i))return h[i]=4,o[i];if(O=y.config.globalProperties,ct(O,i))return O[i]},set({_:t},i,o){const{data:l,setupState:u,ctx:d}=t;return nr(u,i)?(u[i]=o,!0):l!==pt&&ct(l,i)?(l[i]=o,!0):ct(t.props,i)||i[0]==="$"&&i.slice(1)in t?!1:(d[i]=o,!0)},has({_:{data:t,setupState:i,accessCache:o,ctx:l,appContext:u,props:d,type:h}},_){let y;return!!(o[_]||t!==pt&&_[0]!=="$"&&ct(t,_)||nr(i,_)||ct(d,_)||ct(l,_)||ct(lo,_)||ct(u.config.globalProperties,_)||(y=h.__cssModules)&&y[_])},defineProperty(t,i,o){return o.get!=null?t._.accessCache[i]=0:ct(o,"value")&&this.set(t,i,o.value,null),Reflect.defineProperty(t,i,o)}};function kl(t){return De(t)?t.reduce((i,o)=>(i[o]=null,i),{}):t}let _r=!0;function kf(t){const i=ac(t),o=t.proxy,l=t.ctx;_r=!1,i.beforeCreate&&Sl(i.beforeCreate,t,"bc");const{data:u,computed:d,methods:h,watch:_,provide:y,inject:M,created:S,beforeMount:O,mounted:B,beforeUpdate:V,updated:Z,activated:F,deactivated:fe,beforeDestroy:ve,beforeUnmount:q,destroyed:Ce,unmounted:he,render:be,renderTracked:Re,renderTriggered:Ie,errorCaptured:Ue,serverPrefetch:pe,expose:Ae,inheritAttrs:Te,components:te,directives:de,filters:ye}=i;if(M&&Sf(M,l,null),h)for(const ue in h){const ie=h[ue];je(ie)&&(l[ue]=ie.bind(o))}if(u){const ue=u.call(o,o);dt(ue)&&(t.data=yt(ue))}if(_r=!0,d)for(const ue in d){const ie=d[ue],st=je(ie)?ie.bind(o,o):je(ie.get)?ie.get.bind(o,o):Un,me=!je(ie)&&je(ie.set)?ie.set.bind(o):Un,ze=Pe({get:st,set:me});Object.defineProperty(l,ue,{enumerable:!0,configurable:!0,get:()=>ze.value,set:Je=>ze.value=Je})}if(_)for(const ue in _)oc(_[ue],l,o,ue);if(y){const ue=je(y)?y.call(o):y;Reflect.ownKeys(ue).forEach(ie=>{ju(ie,ue[ie])})}S&&Sl(S,t,"c");function ae(ue,ie){De(ie)?ie.forEach(st=>ue(st.bind(o))):ie&&ue(ie.bind(o))}if(ae(hf,O),ae(ui,B),ae(pf,V),ae(mf,Z),ae(cf,F),ae(df,fe),ae(yf,Ue),ae(_f,Re),ae(vf,Ie),ae(Os,q),ae(ic,he),ae(gf,pe),De(Ae))if(Ae.length){const ue=t.exposed||(t.exposed={});Ae.forEach(ie=>{Object.defineProperty(ue,ie,{get:()=>o[ie],set:st=>o[ie]=st,enumerable:!0})})}else t.exposed||(t.exposed={});be&&t.render===Un&&(t.render=be),Te!=null&&(t.inheritAttrs=Te),te&&(t.components=te),de&&(t.directives=de),pe&&tc(t)}function Sf(t,i,o=Un){De(t)&&(t=yr(t));for(const l in t){const u=t[l];let d;dt(u)?"default"in u?d=ao(u.from||l,u.default,!0):d=ao(u.from||l):d=ao(u),Ut(d)?Object.defineProperty(i,l,{enumerable:!0,configurable:!0,get:()=>d.value,set:h=>d.value=h}):i[l]=d}}function Sl(t,i,o){vn(De(t)?t.map(l=>l.bind(i.proxy)):t.bind(i.proxy),i,o)}function oc(t,i,o,l){let u=l.includes(".")?Ku(o,l):()=>o[l];if(bt(t)){const d=i[t];je(d)&&zt(u,d)}else if(je(t))zt(u,t.bind(o));else if(dt(t))if(De(t))t.forEach(d=>oc(d,i,o,l));else{const d=je(t.handler)?t.handler.bind(o):i[t.handler];je(d)&&zt(u,d,t)}}function ac(t){const i=t.type,{mixins:o,extends:l}=i,{mixins:u,optionsCache:d,config:{optionMergeStrategies:h}}=t.appContext,_=d.get(i);let y;return _?y=_:!u.length&&!o&&!l?y=i:(y={},u.length&&u.forEach(M=>aa(y,M,h,!0)),aa(y,i,h)),dt(i)&&d.set(i,y),y}function aa(t,i,o,l=!1){const{mixins:u,extends:d}=i;d&&aa(t,d,o,!0),u&&u.forEach(h=>aa(t,h,o,!0));for(const h in i)if(!(l&&h==="expose")){const _=Tf[h]||o&&o[h];t[h]=_?_(t[h],i[h]):i[h]}return t}const Tf={data:Tl,props:Pl,emits:Pl,methods:eo,computed:eo,beforeCreate:Gt,created:Gt,beforeMount:Gt,mounted:Gt,beforeUpdate:Gt,updated:Gt,beforeDestroy:Gt,beforeUnmount:Gt,destroyed:Gt,unmounted:Gt,activated:Gt,deactivated:Gt,errorCaptured:Gt,serverPrefetch:Gt,components:eo,directives:eo,watch:Cf,provide:Tl,inject:Pf};function Tl(t,i){return i?t?function(){return At(je(t)?t.call(this,this):t,je(i)?i.call(this,this):i)}:i:t}function Pf(t,i){return eo(yr(t),yr(i))}function yr(t){if(De(t)){const i={};for(let o=0;oi==="modelValue"||i==="model-value"?t.modelModifiers:t[`${i}Modifiers`]||t[`${Pn(i)}Modifiers`]||t[`${Ei(i)}Modifiers`];function Of(t,i,...o){if(t.isUnmounted)return;const l=t.vnode.props||pt;let u=o;const d=i.startsWith("update:"),h=d&&Ef(l,i.slice(7));h&&(h.trim&&(u=o.map(S=>bt(S)?S.trim():S)),h.number&&(u=o.map(va)));let _,y=l[_=Ya(i)]||l[_=Ya(Pn(i))];!y&&d&&(y=l[_=Ya(Ei(i))]),y&&vn(y,t,6,u);const M=l[_+"Once"];if(M){if(!t.emitted)t.emitted={};else if(t.emitted[_])return;t.emitted[_]=!0,vn(M,t,6,u)}}const zf=new WeakMap;function lc(t,i,o=!1){const l=o?zf:i.emitsCache,u=l.get(t);if(u!==void 0)return u;const d=t.emits;let h={},_=!1;if(!je(t)){const y=M=>{const S=lc(M,i,!0);S&&(_=!0,At(h,S))};!o&&i.mixins.length&&i.mixins.forEach(y),t.extends&&y(t.extends),t.mixins&&t.mixins.forEach(y)}return!d&&!_?(dt(t)&&l.set(t,null),null):(De(d)?d.forEach(y=>h[y]=null):At(h,d),dt(t)&&l.set(t,h),h)}function ka(t,i){return!t||!pa(i)?!1:(i=i.slice(2),i=i==="Once"?i:i.replace(/Once$/,""),ct(t,i[0].toLowerCase()+i.slice(1))||ct(t,Ei(i))||ct(t,i))}function Cl(t){const{type:i,vnode:o,proxy:l,withProxy:u,propsOptions:[d],slots:h,attrs:_,emit:y,render:M,renderCache:S,props:O,data:B,setupState:V,ctx:Z,inheritAttrs:F}=t,fe=sa(t);let ve,q;try{if(o.shapeFlag&4){const he=u||l,be=he;ve=Bn(M.call(be,he,S,O,V,B,Z)),q=_}else{const he=i;ve=Bn(he.length>1?he(O,{attrs:_,slots:h,emit:y}):he(O,null)),q=i.props?_:Af(_)}}catch(he){uo.length=0,ba(he,t,1),ve=z(Bt)}let Ce=ve;if(q&&F!==!1){const he=Object.keys(q),{shapeFlag:be}=Ce;he.length&&be&7&&(d&&he.some(ma)&&(q=$f(q,d)),Ce=Li(Ce,q,!1,!0))}return o.dirs&&(Ce=Li(Ce,null,!1,!0),Ce.dirs=Ce.dirs?Ce.dirs.concat(o.dirs):o.dirs),o.transition&&po(Ce,o.transition),ve=Ce,sa(fe),ve}const Af=t=>{let i;for(const o in t)(o==="class"||o==="style"||pa(o))&&((i||(i={}))[o]=t[o]);return i},$f=(t,i)=>{const o={};for(const l in t)(!ma(l)||!(l.slice(9)in i))&&(o[l]=t[l]);return o};function If(t,i,o){const{props:l,children:u,component:d}=t,{props:h,children:_,patchFlag:y}=i,M=d.emitsOptions;if(i.dirs||i.transition)return!0;if(o&&y>=0){if(y&1024)return!0;if(y&16)return l?Ll(l,h,M):!!h;if(y&8){const S=i.dynamicProps;for(let O=0;OObject.create(cc),fc=t=>Object.getPrototypeOf(t)===cc;function Nf(t,i,o,l=!1){const u={},d=dc();t.propsDefaults=Object.create(null),hc(t,i,u,d);for(const h in t.propsOptions[0])h in u||(u[h]=void 0);o?t.props=l?u:Vd(u):t.type.props?t.props=u:t.props=d,t.attrs=d}function Rf(t,i,o,l){const{props:u,attrs:d,vnode:{patchFlag:h}}=t,_=ot(u),[y]=t.propsOptions;let M=!1;if((l||h>0)&&!(h&16)){if(h&8){const S=t.vnode.dynamicProps;for(let O=0;O{y=!0;const[B,V]=pc(O,i,!0);At(h,B),V&&_.push(...V)};!o&&i.mixins.length&&i.mixins.forEach(S),t.extends&&S(t.extends),t.mixins&&t.mixins.forEach(S)}if(!d&&!y)return dt(t)&&l.set(t,xs),xs;if(De(d))for(let S=0;St==="_"||t==="_ctx"||t==="$stable",Fr=t=>De(t)?t.map(Bn):[Bn(t)],Bf=(t,i,o)=>{if(i._n)return i;const l=Le((...u)=>Fr(i(...u)),o);return l._c=!1,l},mc=(t,i,o)=>{const l=t._ctx;for(const u in t){if(Rr(u))continue;const d=t[u];if(je(d))i[u]=Bf(u,d,l);else if(d!=null){const h=Fr(d);i[u]=()=>h}}},gc=(t,i)=>{const o=Fr(i);t.slots.default=()=>o},vc=(t,i,o)=>{for(const l in i)(o||!Rr(l))&&(t[l]=i[l])},Vf=(t,i,o)=>{const l=t.slots=dc();if(t.vnode.shapeFlag&32){const u=i._;u?(vc(l,i,o),o&&bu(l,"_",u,!0)):mc(i,l)}else i&&gc(t,i)},Uf=(t,i,o)=>{const{vnode:l,slots:u}=t;let d=!0,h=pt;if(l.shapeFlag&32){const _=i._;_?o&&_===1?d=!1:vc(u,i,o):(d=!i.$stable,mc(i,u)),h=i}else i&&(gc(t,i),h={default:1});if(d)for(const _ in u)!Rr(_)&&h[_]==null&&delete u[_]},qt=Kf;function Zf(t){return Hf(t)}function Hf(t,i){const o=_a();o.__VUE__=!0;const{insert:l,remove:u,patchProp:d,createElement:h,createText:_,createComment:y,setText:M,setElementText:S,parentNode:O,nextSibling:B,setScopeId:V=Un,insertStaticContent:Z}=t,F=(b,v,w,W=null,H=null,U=null,ne=void 0,se=null,ee=!!v.dynamicChildren)=>{if(b===v)return;b&&!Yi(b,v)&&(W=E(b),Je(b,H,U,!0),b=null),v.patchFlag===-2&&(ee=!1,v.dynamicChildren=null);const{type:j,ref:Me,shapeFlag:I}=v;switch(j){case Sa:fe(b,v,w,W);break;case Bt:ve(b,v,w,W);break;case sr:b==null&&q(v,w,W,ne);break;case ce:te(b,v,w,W,H,U,ne,se,ee);break;default:I&1?be(b,v,w,W,H,U,ne,se,ee):I&6?de(b,v,w,W,H,U,ne,se,ee):(I&64||I&128)&&j.process(b,v,w,W,H,U,ne,se,ee,mt)}Me!=null&&H?ro(Me,b&&b.ref,U,v||b,!v):Me==null&&b&&b.ref!=null&&ro(b.ref,null,U,b,!0)},fe=(b,v,w,W)=>{if(b==null)l(v.el=_(v.children),w,W);else{const H=v.el=b.el;v.children!==b.children&&M(H,v.children)}},ve=(b,v,w,W)=>{b==null?l(v.el=y(v.children||""),w,W):v.el=b.el},q=(b,v,w,W)=>{[b.el,b.anchor]=Z(b.children,v,w,W,b.el,b.anchor)},Ce=({el:b,anchor:v},w,W)=>{let H;for(;b&&b!==v;)H=B(b),l(b,w,W),b=H;l(v,w,W)},he=({el:b,anchor:v})=>{let w;for(;b&&b!==v;)w=B(b),u(b),b=w;u(v)},be=(b,v,w,W,H,U,ne,se,ee)=>{if(v.type==="svg"?ne="svg":v.type==="math"&&(ne="mathml"),b==null)Re(v,w,W,H,U,ne,se,ee);else{const j=b.el&&b.el._isVueCE?b.el:null;try{j&&j._beginPatch(),pe(b,v,H,U,ne,se,ee)}finally{j&&j._endPatch()}}},Re=(b,v,w,W,H,U,ne,se)=>{let ee,j;const{props:Me,shapeFlag:I,transition:P,dirs:Q}=b;if(ee=b.el=h(b.type,U,Me&&Me.is,Me),I&8?S(ee,b.children):I&16&&Ue(b.children,ee,null,W,H,ir(b,U),ne,se),Q&&Hi(b,null,W,"created"),Ie(ee,b,b.scopeId,ne,W),Me){for(const _e in Me)_e!=="value"&&!io(_e)&&d(ee,_e,null,Me[_e],U,W);"value"in Me&&d(ee,"value",null,Me.value,U),(j=Me.onVnodeBeforeMount)&&Nn(j,W,b)}Q&&Hi(b,null,W,"beforeMount");const Ne=jf(H,P);Ne&&P.beforeEnter(ee),l(ee,v,w),((j=Me&&Me.onVnodeMounted)||Ne||Q)&&qt(()=>{try{j&&Nn(j,W,b),Ne&&P.enter(ee),Q&&Hi(b,null,W,"mounted")}finally{}},H)},Ie=(b,v,w,W,H)=>{if(w&&V(b,w),W)for(let U=0;U{for(let j=ee;j{const se=v.el=b.el;let{patchFlag:ee,dynamicChildren:j,dirs:Me}=v;ee|=b.patchFlag&16;const I=b.props||pt,P=v.props||pt;let Q;if(w&&ji(w,!1),(Q=P.onVnodeBeforeUpdate)&&Nn(Q,w,v,b),Me&&Hi(v,b,w,"beforeUpdate"),w&&ji(w,!0),j&&(!b.dynamicChildren||b.dynamicChildren.length!==j.length)&&(ee=0,ne=!1,j=null),(I.innerHTML&&P.innerHTML==null||I.textContent&&P.textContent==null)&&S(se,""),j?Ae(b.dynamicChildren,j,se,w,W,ir(v,H),U):ne||ie(b,v,se,null,w,W,ir(v,H),U,!1),ee>0){if(ee&16)Te(se,I,P,w,H);else if(ee&2&&I.class!==P.class&&d(se,"class",null,P.class,H),ee&4&&d(se,"style",I.style,P.style,H),ee&8){const Ne=v.dynamicProps;for(let _e=0;_e{Q&&Nn(Q,w,v,b),Me&&Hi(v,b,w,"updated")},W)},Ae=(b,v,w,W,H,U,ne)=>{for(let se=0;se{if(v!==w){if(v!==pt)for(const U in v)!io(U)&&!(U in w)&&d(b,U,v[U],null,H,W);for(const U in w){if(io(U))continue;const ne=w[U],se=v[U];ne!==se&&U!=="value"&&d(b,U,se,ne,H,W)}"value"in w&&d(b,"value",v.value,w.value,H)}},te=(b,v,w,W,H,U,ne,se,ee)=>{const j=v.el=b?b.el:_(""),Me=v.anchor=b?b.anchor:_("");let{patchFlag:I,dynamicChildren:P,slotScopeIds:Q}=v;Q&&(se=se?se.concat(Q):Q),b==null?(l(j,w,W),l(Me,w,W),Ue(v.children||[],w,Me,H,U,ne,se,ee)):I>0&&I&64&&P&&b.dynamicChildren&&b.dynamicChildren.length===P.length?(Ae(b.dynamicChildren,P,w,H,U,ne,se),(v.key!=null||H&&v===H.subTree)&&Br(b,v,!0)):ie(b,v,w,Me,H,U,ne,se,ee)},de=(b,v,w,W,H,U,ne,se,ee)=>{v.slotScopeIds=se,b==null?v.shapeFlag&512?H.ctx.activate(v,w,W,ne,ee):ye(v,w,W,H,U,ne,ee):Se(b,v,ee)},ye=(b,v,w,W,H,U,ne)=>{const se=b.component=eh(b,W,H);if(xa(b)&&(se.ctx.renderer=mt),th(se,!1,ne),se.asyncDep){if(H&&H.registerDep(se,ae,ne),!b.el){const ee=se.subTree=z(Bt);ve(null,ee,v,w),b.placeholder=ee.el}}else ae(se,b,v,w,H,U,ne)},Se=(b,v,w)=>{const W=v.component=b.component;if(If(b,v,w))if(W.asyncDep&&!W.asyncResolved){ue(W,v,w);return}else W.next=v,W.update();else v.el=b.el,W.vnode=v},ae=(b,v,w,W,H,U,ne)=>{const se=()=>{if(b.isMounted){let{next:I,bu:P,u:Q,parent:Ne,vnode:_e}=b;{const wt=_c(b);if(wt){I&&(I.el=_e.el,ue(b,I,ne)),wt.asyncDep.then(()=>{qt(()=>{b.isUnmounted||j()},H)});return}}let We=I,rt;ji(b,!1),I?(I.el=_e.el,ue(b,I,ne)):I=_e,P&&ea(P),(rt=I.props&&I.props.onVnodeBeforeUpdate)&&Nn(rt,Ne,I,_e),ji(b,!0);const le=Cl(b),tt=b.subTree;b.subTree=le,F(tt,le,O(tt.el),E(tt),b,H,U),I.el=le.el,We===null&&Df(b,le.el),Q&&qt(Q,H),(rt=I.props&&I.props.onVnodeUpdated)&&qt(()=>Nn(rt,Ne,I,_e),H)}else{let I;const{el:P,props:Q}=v,{bm:Ne,m:_e,parent:We,root:rt,type:le}=b,tt=Ss(v);ji(b,!1),Ne&&ea(Ne),!tt&&(I=Q&&Q.onVnodeBeforeMount)&&Nn(I,We,v),ji(b,!0);{rt.ce&&rt.ce._hasShadowRoot()&&rt.ce._injectChildStyle(le,b.parent?b.parent.type:void 0);const wt=b.subTree=Cl(b);F(null,wt,w,W,b,H,U),v.el=wt.el}if(_e&&qt(_e,H),!tt&&(I=Q&&Q.onVnodeMounted)){const wt=v;qt(()=>Nn(I,We,wt),H)}(v.shapeFlag&256||We&&Ss(We.vnode)&&We.vnode.shapeFlag&256)&&b.a&&qt(b.a,H),b.isMounted=!0,v=w=W=null}};b.scope.on();const ee=b.effect=new Su(se);b.scope.off();const j=b.update=ee.run.bind(ee),Me=b.job=ee.runIfDirty.bind(ee);Me.i=b,Me.id=b.uid,ee.scheduler=()=>Nr(Me),ji(b,!0),j()},ue=(b,v,w)=>{v.component=b;const W=b.vnode.props;b.vnode=v,b.next=null,Rf(b,v.props,W,w),Uf(b,v.children,w),Zn(),vl(b),Hn()},ie=(b,v,w,W,H,U,ne,se,ee=!1)=>{const j=b&&b.children,Me=b?b.shapeFlag:0,I=v.children,{patchFlag:P,shapeFlag:Q}=v;if(P>0){if(P&128){me(j,I,w,W,H,U,ne,se,ee);return}else if(P&256){st(j,I,w,W,H,U,ne,se,ee);return}}Q&8?(Me&16&&K(j,H,U),I!==j&&S(w,I)):Me&16?Q&16?me(j,I,w,W,H,U,ne,se,ee):K(j,H,U,!0):(Me&8&&S(w,""),Q&16&&Ue(I,w,W,H,U,ne,se,ee))},st=(b,v,w,W,H,U,ne,se,ee)=>{b=b||xs,v=v||xs;const j=b.length,Me=v.length,I=Math.min(j,Me);let P;for(P=0;PMe?K(b,H,U,!0,!1,I):Ue(v,w,W,H,U,ne,se,ee,I)},me=(b,v,w,W,H,U,ne,se,ee)=>{let j=0;const Me=v.length;let I=b.length-1,P=Me-1;for(;j<=I&&j<=P;){const Q=b[j],Ne=v[j]=ee?si(v[j]):Bn(v[j]);if(Yi(Q,Ne))F(Q,Ne,w,null,H,U,ne,se,ee);else break;j++}for(;j<=I&&j<=P;){const Q=b[I],Ne=v[P]=ee?si(v[P]):Bn(v[P]);if(Yi(Q,Ne))F(Q,Ne,w,null,H,U,ne,se,ee);else break;I--,P--}if(j>I){if(j<=P){const Q=P+1,Ne=QP)for(;j<=I;)Je(b[j],H,U,!0),j++;else{const Q=j,Ne=j,_e=new Map;for(j=Ne;j<=P;j++){const Tt=v[j]=ee?si(v[j]):Bn(v[j]);Tt.key!=null&&_e.set(Tt.key,j)}let We,rt=0;const le=P-Ne+1;let tt=!1,wt=0;const _n=new Array(le);for(j=0;j=le){Je(Tt,H,U,!0);continue}let Nt;if(Tt.key!=null)Nt=_e.get(Tt.key);else for(We=Ne;We<=P;We++)if(_n[We-Ne]===0&&Yi(Tt,v[We])){Nt=We;break}Nt===void 0?Je(Tt,H,U,!0):(_n[Nt-Ne]=j+1,Nt>=wt?wt=Nt:tt=!0,F(Tt,v[Nt],w,null,H,U,ne,se,ee),rt++)}const di=tt?Wf(_n):xs;for(We=di.length-1,j=le-1;j>=0;j--){const Tt=Ne+j,Nt=v[Tt],En=v[Tt+1],Zt=Tt+1{const{el:U,type:ne,transition:se,children:ee,shapeFlag:j}=b;if(j&6){ze(b.component.subTree,v,w,W);return}if(j&128){b.suspense.move(v,w,W);return}if(j&64){ne.move(b,v,w,mt);return}if(ne===ce){l(U,v,w);for(let I=0;Ise.enter(U),H));else{const{leave:I,delayLeave:P,afterLeave:Q}=se,Ne=()=>{b.ctx.isUnmounted?u(U):l(U,v,w)},_e=()=>{const We=U._isLeaving||!!U[pn];U._isLeaving&&U[pn](!0),se.persisted&&!We?Ne():I(U,()=>{Ne(),Q&&Q()})};P?P(U,Ne,_e):_e()}else l(U,v,w)},Je=(b,v,w,W=!1,H=!1)=>{const{type:U,props:ne,ref:se,children:ee,dynamicChildren:j,shapeFlag:Me,patchFlag:I,dirs:P,cacheIndex:Q,memo:Ne}=b;if(I===-2&&(H=!1),se!=null&&(Zn(),ro(se,null,w,b,!0),Hn()),Q!=null&&(v.renderCache[Q]=void 0),Me&256){v.ctx.deactivate(b);return}const _e=Me&1&&P,We=!Ss(b);let rt;if(We&&(rt=ne&&ne.onVnodeBeforeUnmount)&&Nn(rt,v,b),Me&6)Ze(b.component,w,W);else{if(Me&128){b.suspense.unmount(w,W);return}_e&&Hi(b,null,v,"beforeUnmount"),Me&64?b.type.remove(b,v,w,mt,W):j&&!j.hasOnce&&(U!==ce||I>0&&I&64)?K(j,v,w,!1,!0):(U===ce&&I&384||!H&&Me&16)&&K(ee,v,w),W&&at(b)}const le=Ne!=null&&Q==null;(We&&(rt=ne&&ne.onVnodeUnmounted)||_e||le)&&qt(()=>{rt&&Nn(rt,v,b),_e&&Hi(b,null,v,"unmounted"),le&&(b.el=null)},w)},at=b=>{const{type:v,el:w,anchor:W,transition:H}=b;if(v===ce){et(w,W);return}if(v===sr){he(b);return}const U=()=>{u(w),H&&!H.persisted&&H.afterLeave&&H.afterLeave()};if(b.shapeFlag&1&&H&&!H.persisted){const{leave:ne,delayLeave:se}=H,ee=()=>ne(w,U);se?se(b.el,U,ee):ee()}else U()},et=(b,v)=>{let w;for(;b!==v;)w=B(b),u(b),b=w;u(v)},Ze=(b,v,w)=>{const{bum:W,scope:H,job:U,subTree:ne,um:se,m:ee,a:j}=b;El(ee),El(j),W&&ea(W),H.stop(),U&&(U.flags|=8,Je(ne,b,v,w)),se&&qt(se,v),qt(()=>{b.isUnmounted=!0},v)},K=(b,v,w,W=!1,H=!1,U=0)=>{for(let ne=U;ne{if(b.shapeFlag&6)return E(b.component.subTree);if(b.shapeFlag&128)return b.suspense.next();const v=B(b.anchor||b.el),w=v&&v[Gu];return w?B(w):v};let A=!1;const nt=(b,v,w)=>{let W;b==null?v._vnode&&(Je(v._vnode,null,null,!0),W=v._vnode.component):F(v._vnode||null,b,v,null,null,null,w),v._vnode=b,A||(A=!0,vl(W),Uu(),A=!1)},mt={p:F,um:Je,m:ze,r:at,mt:ye,mc:Ue,pc:ie,pbc:Ae,n:E,o:t};return{render:nt,hydrate:void 0,createApp:Mf(nt)}}function ir({type:t,props:i},o){return o==="svg"&&t==="foreignObject"||o==="mathml"&&t==="annotation-xml"&&i&&i.encoding&&i.encoding.includes("html")?void 0:o}function ji({effect:t,job:i},o){o?(t.flags|=32,i.flags|=4):(t.flags&=-33,i.flags&=-5)}function jf(t,i){return(!t||t&&!t.pendingBranch)&&i&&!i.persisted}function Br(t,i,o=!1){const l=t.children,u=i.children;if(De(l)&&De(u))for(let d=0;d>1,t[o[_]]0&&(i[l]=o[d-1]),o[d]=l)}}for(d=o.length,h=o[d-1];d-- >0;)o[d]=h,h=i[h];return o}function _c(t){const i=t.subTree.component;if(i)return i.asyncDep&&!i.asyncResolved?i:_c(i)}function El(t){if(t)for(let i=0;it.__isSuspense;function Kf(t,i){i&&i.pendingBranch?De(t)?i.effects.push(...t):i.effects.push(t):Xd(t)}const ce=Symbol.for("v-fgt"),Sa=Symbol.for("v-txt"),Bt=Symbol.for("v-cmt"),sr=Symbol.for("v-stc"),uo=[];let on=null;function p(t=!1){uo.push(on=t?null:[])}function Gf(){uo.pop(),on=uo[uo.length-1]||null}let mo=1;function ra(t,i=!1){mo+=t,t<0&&on&&i&&(on.hasOnce=!0)}function xc(t){return t.dynamicChildren=mo>0?on||xs:null,Gf(),mo>0&&on&&on.push(t),t}function g(t,i,o,l,u,d){return xc(r(t,i,o,l,u,d,!0))}function it(t,i,o,l,u){return xc(z(t,i,o,l,u,!0))}function go(t){return t?t.__v_isVNode===!0:!1}function Yi(t,i){return t.type===i.type&&t.key===i.key}const wc=({key:t})=>t??null,ta=({ref:t,ref_key:i,ref_for:o})=>(typeof t=="number"&&(t=""+t),t!=null?bt(t)||Ut(t)||je(t)?{i:Vt,r:t,k:i,f:!!o}:t:null);function r(t,i=null,o=null,l=0,u=null,d=t===ce?0:1,h=!1,_=!1){const y={__v_isVNode:!0,__v_skip:!0,type:t,props:i,key:i&&wc(i),ref:i&&ta(i),scopeId:Hu,slotScopeIds:null,children:o,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:d,patchFlag:l,dynamicProps:u,dynamicChildren:null,appContext:null,ctx:Vt};return _?(la(y,o),d&128&&t.normalize(y)):o&&(y.shapeFlag|=bt(o)?8:16),mo>0&&!h&&on&&(y.patchFlag>0||d&6)&&y.patchFlag!==32&&on.push(y),y}const z=qf;function qf(t,i=null,o=null,l=0,u=null,d=!1){if((!t||t===bf)&&(t=Bt),go(t)){const _=Li(t,i,!0);return o&&la(_,o),mo>0&&!d&&on&&(_.shapeFlag&6?on[on.indexOf(t)]=_:on.push(_)),_.patchFlag=-2,_}if(oh(t)&&(t=t.__vccOpts),i){i=Yf(i);let{class:_,style:y}=i;_&&!bt(_)&&(i.class=Oe(_)),dt(y)&&(Dr(y)&&!De(y)&&(y=At({},y)),i.style=Cs(y))}const h=bt(t)?1:bc(t)?128:qu(t)?64:dt(t)?4:je(t)?2:0;return r(t,i,o,l,u,h,d,!0)}function Yf(t){return t?Dr(t)||fc(t)?At({},t):t:null}function Li(t,i,o=!1,l=!1){const{props:u,ref:d,patchFlag:h,children:_,transition:y}=t,M=i?Jf(u||{},i):u,S={__v_isVNode:!0,__v_skip:!0,type:t.type,props:M,key:M&&wc(M),ref:i&&i.ref?o&&d?De(d)?d.concat(ta(i)):[d,ta(i)]:ta(i):d,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:_,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:i&&t.type!==ce?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&&Li(t.ssContent),ssFallback:t.ssFallback&&Li(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return y&&l&&po(S,y.clone(S)),S}function D(t=" ",i=0){return z(Sa,null,t,i)}function R(t="",i=!1){return i?(p(),it(Bt,null,t)):z(Bt,null,t)}function Bn(t){return t==null||typeof t=="boolean"?z(Bt):De(t)?z(ce,null,t.slice()):go(t)?si(t):z(Sa,null,String(t))}function si(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:Li(t)}function la(t,i){let o=0;const{shapeFlag:l}=t;if(i==null)i=null;else if(De(i))o=16;else if(typeof i=="object")if(l&65){const u=i.default;u&&(u._c&&(u._d=!1),la(t,u()),u._c&&(u._d=!0));return}else{o=32;const u=i._;!u&&!fc(i)?i._ctx=Vt:u===3&&Vt&&(Vt.slots._===1?i._=1:(i._=2,t.patchFlag|=1024))}else if(je(i)){if(l&65){la(t,{default:i});return}i={default:i,_ctx:Vt},o=32}else i=String(i),l&64?(o=16,i=[D(i)]):o=8;t.children=i,t.shapeFlag|=o}function Jf(...t){const i={};for(let o=0;oJt||Vt;let ua,xr;{const t=_a(),i=(o,l)=>{let u;return(u=t[o])||(u=t[o]=[]),u.push(l),d=>{u.length>1?u.forEach(h=>h(d)):u[0](d)}};ua=i("__VUE_INSTANCE_SETTERS__",o=>Jt=o),xr=i("__VUE_SSR_SETTERS__",o=>vo=o)}const xo=t=>{const i=Jt;return ua(t),t.scope.on(),()=>{t.scope.off(),ua(i)}},Ol=()=>{Jt&&Jt.scope.off(),ua(null)};function Sc(t){return t.vnode.shapeFlag&4}let vo=!1;function th(t,i=!1,o=!1){i&&xr(i);const{props:l,children:u}=t.vnode,d=Sc(t);Nf(t,l,d,i),Vf(t,u,o||i);const h=d?nh(t,i):void 0;return i&&xr(!1),h}function nh(t,i){const o=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,wf);const{setup:l}=o;if(l){Zn();const u=t.setupContext=l.length>1?sh(t):null,d=xo(t),h=bo(l,t,0,[t.props,u]),_=gu(h);if(Hn(),d(),(_||t.sp)&&!Ss(t)&&tc(t),_){if(h.then(Ol,Ol),i)return h.then(y=>{zl(t,y)}).catch(y=>{ba(y,t,0)});t.asyncDep=h}else zl(t,h)}else Tc(t)}function zl(t,i,o){je(i)?t.type.__ssrInlineRender?t.ssrRender=i:t.render=i:dt(i)&&(t.setupState=Ru(i)),Tc(t)}function Tc(t,i,o){const l=t.type;t.render||(t.render=l.render||Un);{const u=xo(t);Zn();try{kf(t)}finally{Hn(),u()}}}const ih={get(t,i){return Ft(t,"get",""),t[i]}};function sh(t){const i=o=>{t.exposed=o||{}};return{attrs:new Proxy(t.attrs,ih),slots:t.slots,emit:t.emit,expose:i}}function Ta(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(Ru(Ud(t.exposed)),{get(i,o){if(o in i)return i[o];if(o in lo)return lo[o](t)},has(i,o){return o in i||o in lo}})):t.proxy}function oh(t){return je(t)&&"__vccOpts"in t}const Pe=(t,i)=>Kd(t,i,vo);function ah(t,i,o){try{ra(-1);const l=arguments.length;return l===2?dt(i)&&!De(i)?go(i)?z(t,null,[i]):z(t,i):z(t,null,i):(l>3?o=Array.prototype.slice.call(arguments,2):l===3&&go(o)&&(o=[o]),z(t,i,o))}finally{ra(1)}}const rh="3.5.39";/** -* @vue/runtime-dom v3.5.39 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/let wr;const Al=typeof window<"u"&&window.trustedTypes;if(Al)try{wr=Al.createPolicy("vue",{createHTML:t=>t})}catch{}const Pc=wr?t=>wr.createHTML(t):t=>t,lh="http://www.w3.org/2000/svg",uh="http://www.w3.org/1998/Math/MathML",ii=typeof document<"u"?document:null,$l=ii&&ii.createElement("template"),ch={insert:(t,i,o)=>{i.insertBefore(t,o||null)},remove:t=>{const i=t.parentNode;i&&i.removeChild(t)},createElement:(t,i,o,l)=>{const u=i==="svg"?ii.createElementNS(lh,t):i==="mathml"?ii.createElementNS(uh,t):o?ii.createElement(t,{is:o}):ii.createElement(t);return t==="select"&&l&&l.multiple!=null&&u.setAttribute("multiple",l.multiple),u},createText:t=>ii.createTextNode(t),createComment:t=>ii.createComment(t),setText:(t,i)=>{t.nodeValue=i},setElementText:(t,i)=>{t.textContent=i},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>ii.querySelector(t),setScopeId(t,i){t.setAttribute(i,"")},insertStaticContent(t,i,o,l,u,d){const h=o?o.previousSibling:i.lastChild;if(u&&(u===d||u.nextSibling))for(;i.insertBefore(u.cloneNode(!0),o),!(u===d||!(u=u.nextSibling)););else{$l.innerHTML=Pc(l==="svg"?`${t}`:l==="mathml"?`${t}`:t);const _=$l.content;if(l==="svg"||l==="mathml"){const y=_.firstChild;for(;y.firstChild;)_.appendChild(y.firstChild);_.removeChild(y)}i.insertBefore(_,o)}return[h?h.nextSibling:i.firstChild,o?o.previousSibling:i.lastChild]}},ki="transition",Js="animation",_o=Symbol("_vtc"),Cc={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},dh=At({},Yu,Cc),fh=t=>(t.displayName="Transition",t.props=dh,t),hh=fh((t,{slots:i})=>ah(uf,ph(t),i)),Wi=(t,i=[])=>{De(t)?t.forEach(o=>o(...i)):t&&t(...i)},Il=t=>t?De(t)?t.some(i=>i.length>1):t.length>1:!1;function ph(t){const i={};for(const te in t)te in Cc||(i[te]=t[te]);if(t.css===!1)return i;const{name:o="v",type:l,duration:u,enterFromClass:d=`${o}-enter-from`,enterActiveClass:h=`${o}-enter-active`,enterToClass:_=`${o}-enter-to`,appearFromClass:y=d,appearActiveClass:M=h,appearToClass:S=_,leaveFromClass:O=`${o}-leave-from`,leaveActiveClass:B=`${o}-leave-active`,leaveToClass:V=`${o}-leave-to`}=t,Z=mh(u),F=Z&&Z[0],fe=Z&&Z[1],{onBeforeEnter:ve,onEnter:q,onEnterCancelled:Ce,onLeave:he,onLeaveCancelled:be,onBeforeAppear:Re=ve,onAppear:Ie=q,onAppearCancelled:Ue=Ce}=i,pe=(te,de,ye,Se)=>{te._enterCancelled=Se,Ki(te,de?S:_),Ki(te,de?M:h),ye&&ye()},Ae=(te,de)=>{te._isLeaving=!1,Ki(te,O),Ki(te,V),Ki(te,B),de&&de()},Te=te=>(de,ye)=>{const Se=te?Ie:q,ae=()=>pe(de,te,ye);Wi(Se,[de,ae]),Dl(()=>{Ki(de,te?y:d),ni(de,te?S:_),Il(Se)||Nl(de,l,F,ae)})};return At(i,{onBeforeEnter(te){Wi(ve,[te]),ni(te,d),ni(te,h)},onBeforeAppear(te){Wi(Re,[te]),ni(te,y),ni(te,M)},onEnter:Te(!1),onAppear:Te(!0),onLeave(te,de){te._isLeaving=!0;const ye=()=>Ae(te,de);ni(te,O),te._enterCancelled?(ni(te,B),Bl(te)):(Bl(te),ni(te,B)),Dl(()=>{te._isLeaving&&(Ki(te,O),ni(te,V),Il(he)||Nl(te,l,fe,ye))}),Wi(he,[te,ye])},onEnterCancelled(te){pe(te,!1,void 0,!0),Wi(Ce,[te])},onAppearCancelled(te){pe(te,!0,void 0,!0),Wi(Ue,[te])},onLeaveCancelled(te){Ae(te),Wi(be,[te])}})}function mh(t){if(t==null)return null;if(dt(t))return[or(t.enter),or(t.leave)];{const i=or(t);return[i,i]}}function or(t){return pd(t)}function ni(t,i){i.split(/\s+/).forEach(o=>o&&t.classList.add(o)),(t[_o]||(t[_o]=new Set)).add(i)}function Ki(t,i){i.split(/\s+/).forEach(l=>l&&t.classList.remove(l));const o=t[_o];o&&(o.delete(i),o.size||(t[_o]=void 0))}function Dl(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let gh=0;function Nl(t,i,o,l){const u=t._endId=++gh,d=()=>{u===t._endId&&l()};if(o!=null)return setTimeout(d,o);const{type:h,timeout:_,propCount:y}=vh(t,i);if(!h)return l();const M=h+"end";let S=0;const O=()=>{t.removeEventListener(M,B),d()},B=V=>{V.target===t&&++S>=y&&O()};setTimeout(()=>{S(o[Z]||"").split(", "),u=l(`${ki}Delay`),d=l(`${ki}Duration`),h=Rl(u,d),_=l(`${Js}Delay`),y=l(`${Js}Duration`),M=Rl(_,y);let S=null,O=0,B=0;i===ki?h>0&&(S=ki,O=h,B=d.length):i===Js?M>0&&(S=Js,O=M,B=y.length):(O=Math.max(h,M),S=O>0?h>M?ki:Js:null,B=S?S===ki?d.length:y.length:0);const V=S===ki&&/\b(?:transform|all)(?:,|$)/.test(l(`${ki}Property`).toString());return{type:S,timeout:O,propCount:B,hasTransform:V}}function Rl(t,i){for(;t.lengthFl(o)+Fl(t[l])))}function Fl(t){return t==="auto"?0:Number(t.slice(0,-1).replace(",","."))*1e3}function Bl(t){return(t?t.ownerDocument:document).body.offsetHeight}function _h(t,i,o){const l=t[_o];l&&(i=(i?[i,...l]:[...l]).join(" ")),i==null?t.removeAttribute("class"):o?t.setAttribute("class",i):t.className=i}const ca=Symbol("_vod"),Lc=Symbol("_vsh"),yh={name:"show",beforeMount(t,{value:i},{transition:o}){t[ca]=t.style.display==="none"?"":t.style.display,o&&i?o.beforeEnter(t):Xs(t,i)},mounted(t,{value:i},{transition:o}){o&&i&&o.enter(t)},updated(t,{value:i,oldValue:o},{transition:l}){!i!=!o&&(l?i?(l.beforeEnter(t),Xs(t,!0),l.enter(t)):l.leave(t,()=>{Xs(t,!1)}):Xs(t,i))},beforeUnmount(t,{value:i}){Xs(t,i)}};function Xs(t,i){t.style.display=i?t[ca]:"none",t[Lc]=!i}const bh=Symbol(""),xh=/(?:^|;)\s*display\s*:/;function wh(t,i,o){const l=t.style,u=bt(o);let d=!1;if(o&&!u){if(i)if(bt(i))for(const h of i.split(";")){const _=h.slice(0,h.indexOf(":")).trim();o[_]==null&&to(l,_,"")}else for(const h in i)o[h]==null&&to(l,h,"");for(const h in o){h==="display"&&(d=!0);const _=o[h];_!=null?Sh(t,h,!bt(i)&&i?i[h]:void 0,_)||to(l,h,_):to(l,h,"")}}else if(u){if(i!==o){const h=l[bh];h&&(o+=";"+h),l.cssText=o,d=xh.test(o)}}else i&&t.removeAttribute("style");ca in t&&(t[ca]=d?l.display:"",t[Lc]&&(l.display="none"))}const Vl=/\s*!important$/;function to(t,i,o){if(De(o))o.forEach(l=>to(t,i,l));else if(o==null&&(o=""),i.startsWith("--"))t.setProperty(i,o);else{const l=kh(t,i);Vl.test(o)?t.setProperty(Ei(l),o.replace(Vl,""),"important"):t[l]=o}}const Ul=["Webkit","Moz","ms"],ar={};function kh(t,i){const o=ar[i];if(o)return o;let l=Pn(i);if(l!=="filter"&&l in t)return ar[i]=l;l=yu(l);for(let u=0;urr||(Eh.then(()=>rr=0),rr=Date.now());function zh(t,i){const o=l=>{if(!l._vts)l._vts=Date.now();else if(l._vts<=o.attached)return;const u=o.value;if(De(u)){const d=l.stopImmediatePropagation;l.stopImmediatePropagation=()=>{d.call(l),l._stopped=!0};const h=u.slice(),_=[l];for(let y=0;yt.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,Ah=(t,i,o,l,u,d)=>{const h=u==="svg";i==="class"?_h(t,l,h):i==="style"?wh(t,o,l):pa(i)?ma(i)||Ph(t,i,o,l,d):(i[0]==="."?(i=i.slice(1),!0):i[0]==="^"?(i=i.slice(1),!1):$h(t,i,l,h))?(jl(t,i,l),!t.tagName.includes("-")&&(i==="value"||i==="checked"||i==="selected")&&Hl(t,i,l,h,d,i!=="value")):t._isVueCE&&(Ih(t,i)||t._def.__asyncLoader&&(/[A-Z]/.test(i)||!bt(l)))?jl(t,Pn(i),l,d,i):(i==="true-value"?t._trueValue=l:i==="false-value"&&(t._falseValue=l),Hl(t,i,l,h))};function $h(t,i,o,l){if(l)return!!(i==="innerHTML"||i==="textContent"||i in t&&Kl(i)&&je(o));if(i==="spellcheck"||i==="draggable"||i==="translate"||i==="autocorrect"||i==="sandbox"&&t.tagName==="IFRAME"||i==="form"||i==="list"&&t.tagName==="INPUT"||i==="type"&&t.tagName==="TEXTAREA")return!1;if(i==="width"||i==="height"){const u=t.tagName;if(u==="IMG"||u==="VIDEO"||u==="CANVAS"||u==="SOURCE")return!1}return Kl(i)&&bt(o)?!1:i in t}function Ih(t,i){const o=t._def.props;if(!o)return!1;const l=Pn(i);return Array.isArray(o)?o.some(u=>Pn(u)===l):Object.keys(o).some(u=>Pn(u)===l)}const Mi=t=>{const i=t.props["onUpdate:modelValue"]||!1;return De(i)?o=>ea(i,o):i};function Dh(t){t.target.composing=!0}function Gl(t){const i=t.target;i.composing&&(i.composing=!1,i.dispatchEvent(new Event("input")))}const gn=Symbol("_assign");function ql(t,i,o){return i&&(t=t.trim()),o&&(t=va(t)),t}const xe={created(t,{modifiers:{lazy:i,trim:o,number:l}},u){t[gn]=Mi(u);const d=l||u.props&&u.props.type==="number";ri(t,i?"change":"input",h=>{h.target.composing||t[gn](ql(t.value,o,d))}),(o||d)&&ri(t,"change",()=>{t.value=ql(t.value,o,d)}),i||(ri(t,"compositionstart",Dh),ri(t,"compositionend",Gl),ri(t,"change",Gl))},mounted(t,{value:i}){t.value=i??""},beforeUpdate(t,{value:i,oldValue:o,modifiers:{lazy:l,trim:u,number:d}},h){if(t[gn]=Mi(h),t.composing)return;const _=(d||t.type==="number")&&!/^0\d/.test(t.value)?va(t.value):t.value,y=i??"";if(_===y)return;const M=t.getRootNode();(M instanceof Document||M instanceof ShadowRoot)&&M.activeElement===t&&t.type!=="range"&&(l&&i===o||u&&t.value.trim()===y)||(t.value=y)}},da={deep:!0,created(t,i,o){t[gn]=Mi(o),ri(t,"change",()=>{const l=t._modelValue,u=Ms(t),d=t.checked,h=t[gn];if(De(l)){const _=Mr(l,u),y=_!==-1;if(d&&!y)h(l.concat(u));else if(!d&&y){const M=[...l];M.splice(_,1),h(M)}}else if(Es(l)){const _=new Set(l);d?_.add(u):_.delete(u),h(_)}else h(Mc(t,d))})},mounted:Yl,beforeUpdate(t,i,o){t[gn]=Mi(o),Yl(t,i,o)}};function Yl(t,{value:i,oldValue:o},l){t._modelValue=i;let u;if(De(i))u=Mr(i,l.props.value)>-1;else if(Es(i))u=i.has(l.props.value);else{if(i===o)return;u=Ci(i,Mc(t,!0))}t.checked!==u&&(t.checked=u)}const Nh={created(t,{value:i},o){t.checked=Ci(i,o.props.value),t[gn]=Mi(o),ri(t,"change",()=>{t[gn](Ms(t))})},beforeUpdate(t,{value:i,oldValue:o},l){t[gn]=Mi(l),i!==o&&(t.checked=Ci(i,l.props.value))}},Mt={deep:!0,created(t,{value:i,modifiers:{number:o}},l){const u=Es(i);ri(t,"change",()=>{const d=Array.prototype.filter.call(t.options,h=>h.selected).map(h=>o?va(Ms(h)):Ms(h));t[gn](t.multiple?u?new Set(d):d:d[0]),t._assigning=!0,Bu(()=>{t._assigning=!1})}),t[gn]=Mi(l)},mounted(t,{value:i}){Jl(t,i)},beforeUpdate(t,i,o){t[gn]=Mi(o)},updated(t,{value:i}){t._assigning||Jl(t,i)}};function Jl(t,i){const o=t.multiple,l=De(i);if(!(o&&!l&&!Es(i))){for(let u=0,d=t.options.length;uString(M)===String(_)):h.selected=Mr(i,_)>-1}else h.selected=i.has(_);else if(Ci(Ms(h),i)){t.selectedIndex!==u&&(t.selectedIndex=u);return}}!o&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function Ms(t){return"_value"in t?t._value:t.value}function Mc(t,i){const o=i?"_trueValue":"_falseValue";return o in t?t[o]:i}const Rh={created(t,i,o){Xo(t,i,o,null,"created")},mounted(t,i,o){Xo(t,i,o,null,"mounted")},beforeUpdate(t,i,o,l){Xo(t,i,o,l,"beforeUpdate")},updated(t,i,o,l){Xo(t,i,o,l,"updated")}};function Fh(t,i){switch(t){case"SELECT":return Mt;case"TEXTAREA":return xe;default:switch(i){case"checkbox":return da;case"radio":return Nh;default:return xe}}}function Xo(t,i,o,l,u){const h=Fh(t.tagName,o.props&&o.props.type)[u];h&&h(t,i,o,l)}const Bh=["ctrl","shift","alt","meta"],Vh={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)=>Bh.some(o=>t[`${o}Key`]&&!i.includes(o))},Vr=(t,i)=>{if(!t)return t;const o=t._withMods||(t._withMods={}),l=i.join(".");return o[l]||(o[l]=((u,...d)=>{for(let h=0;h{const o=t._withKeys||(t._withKeys={}),l=i.join(".");return o[l]||(o[l]=(u=>{if(!("key"in u))return;const d=Ei(u.key);if(i.some(h=>h===d||Uh[h]===d))return t(u)}))},Zh=At({patchProp:Ah},ch);let Ql;function Hh(){return Ql||(Ql=Zf(Zh))}const jh=((...t)=>{const i=Hh().createApp(...t),{mount:o}=i;return i.mount=l=>{const u=Kh(l);if(!u)return;const d=i._component;!je(d)&&!d.render&&!d.template&&(d.template=u.innerHTML),u.nodeType===1&&(u.textContent="");const h=o(u,!1,Wh(u));return u instanceof Element&&(u.removeAttribute("v-cloak"),u.setAttribute("data-v-app","")),h},i});function Wh(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function Kh(t){return bt(t)?document.querySelector(t):t}const Ec="pv_theme",eu={light:"#EEF0F3",dark:"#0B1730"},fa=typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;function Oc(){return fa&&fa.matches?"dark":"light"}function Gh(){try{return localStorage.getItem(Ec)||"light"}catch{return"light"}}function zc(t){return t==="system"?Oc():t}function Ac(t){const i=document.documentElement;i.setAttribute("data-theme",t),i.style.backgroundColor=eu[t]||eu.light}const Qi=G(Gh()),Ps=G(zc(Qi.value));function ha(t){Qi.value=t;const i=zc(t);Ps.value=i,Ac(i);try{localStorage.setItem(Ec,t)}catch{}}function tu(){ha(Ps.value==="dark"?"light":"dark")}fa&&fa.addEventListener("change",()=>{if(Qi.value==="system"){const t=Oc();Ps.value=t,Ac(t)}});async function qh(){try{const t=await fetch("/bff/config");return t.ok?await t.json():{apiBase:""}}catch{return{apiBase:""}}}async function nu(){try{const t=await fetch("/bff/me");return t.ok?await t.json():null}catch{return null}}async function Yh(t,i,o){const l=await fetch("/bff/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t,password:i,apiBase:o})});return{ok:l.ok,status:l.status,body:await l.json().catch(()=>({}))}}async function Jh(){try{await fetch("/bff/logout",{method:"POST"})}catch{}}async function Xh(){try{const t=await fetch("/bff/devices");return t.ok?await t.json():[]}catch{return[]}}async function Qh(){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 ep(t,i,o,l){const u=await fetch("/bff/users",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t,password:i,role:o,organization:l})});return{ok:u.ok,status:u.status,body:await u.json().catch(()=>({}))}}async function tp(t,i){const o=await fetch(`/bff/users/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return{ok:o.ok,status:o.status,body:await o.json().catch(()=>({}))}}async function np(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 ip(){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 sp(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 op(t,i){const o=await fetch(`/bff/orgs/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i})});return{ok:o.ok,status:o.status,body:await o.json().catch(()=>({}))}}async function ap(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 rp(){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 lp(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 up(){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 iu(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 cp(){const t=await fetch("/bff/integrations/opensky/health",{method:"POST"});return{ok:t.ok,status:t.status,body:await t.json().catch(()=>({}))}}async function dp(){try{const t=await fetch("/bff/integrations/opensky/states");if(!t.ok)return{states:[],unavailable:!0,detail:"OpenSky unavailable"};const i=await t.json();return{states:i.states||[],time:i.time,unavailable:!!i.unavailable,detail:i.detail||"",plan:i.plan||"",recommendedInterval:i.recommendedInterval||0}}catch{return{states:[],unavailable:!0,detail:"OpenSky unavailable"}}}async function fp(){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 su(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 hp(){const t=await fetch("/bff/integrations/filetransfer/health",{method:"POST"});return{ok:t.ok,status:t.status,body:await t.json().catch(()=>({}))}}async function pp(){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 Qo(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 mp(){const t=await fetch("/bff/integrations/localstorage/health",{method:"POST"});return{ok:t.ok,status:t.status,body:await t.json().catch(()=>({}))}}async function gp(){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 ou(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 vp(){const t=await fetch("/bff/integrations/webdav/health",{method:"POST"});return{ok:t.ok,status:t.status,body:await t.json().catch(()=>({}))}}async function $c(){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 _p(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 yp(t,i){const o=await fetch(`/bff/drones/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return{ok:o.ok,status:o.status,body:await o.json().catch(()=>({}))}}async function bp(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 xp(){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 wp(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 kp(t,i){const o=await fetch(`/bff/flights/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return{ok:o.ok,status:o.status,body:await o.json().catch(()=>({}))}}async function Sp(t){const i=await fetch(`/bff/flights/${encodeURIComponent(t)}`,{method:"DELETE"});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}function Tp(){return"/bff/logbook/export"}async function Pp(t){try{const i=t!=null&&t!==""?`?expiring=${encodeURIComponent(t)}`:"",o=await fetch(`/bff/documents${i}`);return o.ok?{ok:!0,status:200,documents:(await o.json()).documents||[]}:{ok:!1,status:o.status,documents:[]}}catch{return{ok:!1,status:0,documents:[]}}}async function Cp(t,i){const o=new FormData;Object.entries(t).forEach(([u,d])=>{d!=null&&d!==""&&o.append(u,d)}),i&&o.append("file",i);const l=await fetch("/bff/documents",{method:"POST",body:o});return{ok:l.ok,status:l.status,body:await l.json().catch(()=>({}))}}async function Lp(t,i){const o=await fetch(`/bff/documents/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return{ok:o.ok,status:o.status,body:await o.json().catch(()=>({}))}}async function Mp(t){const i=await fetch(`/bff/documents/${encodeURIComponent(t)}`,{method:"DELETE"});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}function lr(t){return`/bff/documents/${encodeURIComponent(t)}/file`}function Ep(t){return`/bff/documents/${encodeURIComponent(t)}/file?inline=1`}async function Op(t,i,o){const l=await fetch(`/bff/devices/${encodeURIComponent(t)}/command`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:i,payload:o})});return{ok:l.ok,body:await l.json().catch(()=>({}))}}const Ic="pv_prefs",kr={name:"",username:"",displayName:"",bio:"",avatar:"",showEmail:!1,fontSize:"md",language:"en",region:"US",dateFormat:"MDY",timeFormat:"24",reduceMotion:!1,showAirTraffic:!0,airTrafficInterval:"auto",twoFactor:!1};function zp(){try{return{...kr,...JSON.parse(localStorage.getItem(Ic)||"{}")||{}}}catch{return{...kr}}}const ke=yt(zp());function Dc(){try{localStorage.setItem(Ic,JSON.stringify(ke))}catch{}}function Nc(t){if(!t||typeof t!="object")return!1;for(const i of Object.keys(kr))i in t&&(ke[i]=t[i]);return!0}const Ap={sm:15,md:16,lg:18};function Ur(t){document.documentElement.style.fontSize=(Ap[t]||16)+"px"}function Zr(t){document.documentElement.classList.toggle("reduce-motion",!!t)}function Rc(t){const i=new Date(t),o=i.getFullYear(),l=String(i.getMonth()+1).padStart(2,"0"),u=String(i.getDate()).padStart(2,"0");let d;switch(ke.dateFormat){case"DMY":d=`${u}/${l}/${o}`;break;case"YMD":d=`${o}/${l}/${u}`;break;case"ISO":d=`${o}-${l}-${u}`;break;default:d=`${l}/${u}/${o}`}let h;return ke.timeFormat==="12"?h=i.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0}):h=`${String(i.getHours()).padStart(2,"0")}:${String(i.getMinutes()).padStart(2,"0")}:${String(i.getSeconds()).padStart(2,"0")}`,{date:d,time:h}}function au(t){return Rc(t).time}function ru(t){const i=Rc(t);return`${i.date} ${i.time}`}let Hr=!1,Sr=!1,Tr=null;function $p(){return{...JSON.parse(JSON.stringify(ke)),themeMode:Qi.value}}function jr(){!Hr||Sr||(clearTimeout(Tr),Tr=setTimeout(()=>{lp($p())},600))}function Ip(t){Sr=!0;try{Nc(t),t.themeMode&&ha(t.themeMode),Ur(ke.fontSize),Zr(ke.reduceMotion),Dc()}finally{Sr=!1}}async function lu(){Hr=!0;const t=await rp();t&&Object.keys(t).length?Ip(t):jr()}function Dp(){Hr=!1,clearTimeout(Tr)}zt(ke,()=>{Dc(),jr()},{deep:!0});zt(Qi,jr);zt(()=>ke.fontSize,Ur,{immediate:!0});zt(()=>ke.reduceMotion,Zr,{immediate:!0});const Np=["width","height"],Fc={__name:"BrandMark",props:{size:{type:[Number,String],default:28}},setup(t){return(i,o)=>(p(),g("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none","aria-hidden":"true"},[...o[0]||(o[0]=[r("g",{"stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round"},[r("polyline",{points:"8,30 19,17 30,30",stroke:"var(--accent)"}),r("polyline",{points:"18,33 29,20 40,33",stroke:"currentColor"})],-1)])],8,Np))}},Rp=["title","aria-label"],Fp={key:0,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Bp={key:1,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Vp={__name:"ThemeToggle",setup(t){return(i,o)=>(p(),g("button",{class:"btn-icon",type:"button",title:$e(Ps)==="dark"?"Switch to light":"Switch to dark","aria-label":$e(Ps)==="dark"?"Switch to light theme":"Switch to dark theme",onClick:o[0]||(o[0]=(...l)=>$e(tu)&&$e(tu)(...l))},[$e(Ps)==="dark"?(p(),g("svg",Fp,[...o[1]||(o[1]=[r("circle",{cx:"12",cy:"12",r:"4"},null,-1),r("path",{d:"M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41"},null,-1)])])):(p(),g("svg",Bp,[...o[2]||(o[2]=[r("path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9z"},null,-1)])]))],8,Rp))}},Up={class:"relative grid h-full place-items-center p-5"},Zp={class:"absolute right-5 top-5"},Hp={class:"mb-6 flex items-center gap-3 text-ink"},jp={class:"relative mb-1"},Wp=["type"],Kp=["aria-label","title"],Gp={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]"},qp={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]"},Yp={key:0,class:"mt-4"},Jp={key:1,class:"mt-4 rounded border border-line bg-danger-soft px-3 py-2 text-sm text-danger-fg"},Xp=["disabled"],Qp={__name:"LoginView",props:{defaultApiBase:{type:String,default:""}},emits:["signed-in"],setup(t,{emit:i}){const o=t,l=i,u=G(""),d=G(""),h=G(localStorage.getItem("api_url")||o.defaultApiBase||"http://localhost:8080"),_=G(!1),y=G(!1),M=G(!1),S=G("");async function O(){M.value=!0,S.value="",localStorage.setItem("api_url",h.value.trim());const{ok:B,status:V,body:Z}=await Yh(u.value.trim(),d.value,h.value.trim());if(M.value=!1,B){l("signed-in",Z.email);return}S.value=V===400?"Invalid email or password.":V===502?"API server can't reach PocketBase.":Z.message||Z.error||"Cannot reach the API server."}return(B,V)=>(p(),g("div",Up,[r("div",Zp,[z(Vp)]),r("form",{class:"panel w-[380px] p-8 shadow-md",onSubmit:Vr(O,["prevent"])},[r("div",Hp,[z(Fc,{size:34}),V[5]||(V[5]=r("div",{class:"leading-tight"},[r("div",{class:"text-mode"},"PilotVault"),r("div",{class:"eyebrow mt-0.5"},"Control panel")],-1))]),V[9]||(V[9]=r("label",{class:"eyebrow mb-1.5 block"},"Email",-1)),re(r("input",{"onUpdate:modelValue":V[0]||(V[0]=Z=>u.value=Z),type:"email",autocomplete:"username",required:"",class:"field mb-4",placeholder:"you@example.com"},null,512),[[xe,u.value]]),V[10]||(V[10]=r("label",{class:"eyebrow mb-1.5 block"},"Password",-1)),r("div",jp,[re(r("input",{"onUpdate:modelValue":V[1]||(V[1]=Z=>d.value=Z),type:y.value?"text":"password",autocomplete:"current-password",required:"",class:"field w-full pr-10",placeholder:"••••••••"},null,8,Wp),[[Rh,d.value]]),r("button",{type:"button",class:"absolute inset-y-0 right-0 grid w-10 place-items-center text-ink-muted transition hover:text-ink-secondary","aria-label":y.value?"Hide password":"Show password",title:y.value?"Hide password":"Show password",onClick:V[2]||(V[2]=Z=>y.value=!y.value)},[y.value?(p(),g("svg",Gp,[...V[6]||(V[6]=[r("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"},null,-1),r("line",{x1:"1",y1:"1",x2:"23",y2:"23"},null,-1)])])):(p(),g("svg",qp,[...V[7]||(V[7]=[r("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"},null,-1),r("circle",{cx:"12",cy:"12",r:"3"},null,-1)])]))],8,Kp)]),_.value?(p(),g("div",Yp,[V[8]||(V[8]=r("label",{class:"eyebrow mb-1.5 block"},"API Server",-1)),re(r("input",{"onUpdate:modelValue":V[3]||(V[3]=Z=>h.value=Z),type:"text",class:"field font-mono",placeholder:"10.2.1.101:8080"},null,512),[[xe,h.value]])])):R("",!0),S.value?(p(),g("p",Jp,k(S.value),1)):R("",!0),r("button",{type:"submit",class:"btn-accent mt-6 w-full",disabled:M.value},k(M.value?"Signing in…":"Sign in"),9,Xp),r("button",{type:"button",class:"mx-auto mt-3 block text-xs text-ink-muted transition hover:text-ink-secondary",onClick:V[4]||(V[4]=Z=>_.value=!_.value)},k(_.value?"Hide server settings":"Server settings"),1)],32)]))}};function em(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var no={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 tm=no.exports,uu;function nm(){return uu||(uu=1,(function(t,i){(function(o,l){l(i)})(tm,(function(o){var l="1.9.4";function u(e){var n,s,a,c;for(s=1,a=arguments.length;s"u"||!L||!L.Mixin)){e=Ce(e)?e:[e];for(var n=0;n0?Math.floor(e):Math.ceil(e)};ie.prototype={clone:function(){return new ie(this.x,this.y)},add:function(e){return this.clone()._add(me(e))},_add:function(e){return this.x+=e.x,this.y+=e.y,this},subtract:function(e){return this.clone()._subtract(me(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 ie(this.x*e.x,this.y*e.y)},unscaleBy:function(e){return new ie(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=me(e);var n=e.x-this.x,s=e.y-this.y;return Math.sqrt(n*n+s*s)},equals:function(e){return e=me(e),e.x===this.x&&e.y===this.y},contains:function(e){return e=me(e),Math.abs(e.x)<=Math.abs(this.x)&&Math.abs(e.y)<=Math.abs(this.y)},toString:function(){return"Point("+B(this.x)+", "+B(this.y)+")"}};function me(e,n,s){return e instanceof ie?e:Ce(e)?new ie(e[0],e[1]):e==null?e:typeof e=="object"&&"x"in e&&"y"in e?new ie(e.x,e.y):new ie(e,n,s)}function ze(e,n){if(e)for(var s=n?[e,n]:e,a=0,c=s.length;a=this.min.x&&s.x<=this.max.x&&n.y>=this.min.y&&s.y<=this.max.y},intersects:function(e){e=Je(e);var n=this.min,s=this.max,a=e.min,c=e.max,m=c.x>=n.x&&a.x<=s.x,C=c.y>=n.y&&a.y<=s.y;return m&&C},overlaps:function(e){e=Je(e);var n=this.min,s=this.max,a=e.min,c=e.max,m=c.x>n.x&&a.xn.y&&a.y=n.lat&&c.lat<=s.lat&&a.lng>=n.lng&&c.lng<=s.lng},intersects:function(e){e=et(e);var n=this._southWest,s=this._northEast,a=e.getSouthWest(),c=e.getNorthEast(),m=c.lat>=n.lat&&a.lat<=s.lat,C=c.lng>=n.lng&&a.lng<=s.lng;return m&&C},overlaps:function(e){e=et(e);var n=this._southWest,s=this._northEast,a=e.getSouthWest(),c=e.getNorthEast(),m=c.lat>n.lat&&a.latn.lng&&a.lng1,La=(function(){var e=!1;try{var n=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassiveEventSupport",O,n),window.removeEventListener("testPassiveEventSupport",O,n)}catch{}return e})(),Ma=(function(){return!!document.createElement("canvas").getContext})(),As=!!(document.createElementNS&&W("svg").createSVGRect),ko=!!As&&(function(){var e=document.createElement("div");return e.innerHTML="",(e.firstChild&&e.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"})(),Ea=!As&&(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}})(),Oa=navigator.platform.indexOf("Mac")===0,za=navigator.platform.indexOf("Linux")===0;function Ke(e){return navigator.userAgent.toLowerCase().indexOf(e)>=0}var we={ie:ne,ielt9:se,edge:ee,webkit:j,android:Me,android23:I,androidStock:Q,opera:Ne,chrome:_e,gecko:We,safari:rt,phantom:le,opera12:tt,win:wt,ie3d:_n,webkit3d:di,gecko3d:Tt,any3d:Nt,mobile:En,mobileWebkit:Zt,mobileWebkit3d:es,msPointer:$t,pointer:Ht,touch:Pa,touchNative:xt,mobileOpera:wo,mobileGecko:zs,retina:Ca,passiveEvents:La,canvas:Ma,svg:As,vml:Ea,inlineSvg:ko,mac:Oa,linux:za},ts=we.msPointer?"MSPointerDown":"pointerdown",It=we.msPointer?"MSPointerMove":"pointermove",fi=we.msPointer?"MSPointerUp":"pointerup",Oi=we.msPointer?"MSPointerCancel":"pointercancel",hi={touchstart:ts,touchmove:It,touchend:fi,touchcancel:Oi},an={touchstart:To,touchmove:jt,touchend:jt,touchcancel:jt},nn={},So=!1;function $s(e,n,s){return n==="touchstart"&&pi(),an[n]?(s=an[n].bind(this,s),e.addEventListener(hi[n],s,!1),s):(console.warn("wrong event specified:",n),O)}function Is(e,n,s){if(!hi[n]){console.warn("wrong event specified:",n);return}e.removeEventListener(hi[n],s,!1)}function Aa(e){nn[e.pointerId]=e}function rn(e){nn[e.pointerId]&&(nn[e.pointerId]=e)}function yn(e){delete nn[e.pointerId]}function pi(){So||(document.addEventListener(ts,Aa,!0),document.addEventListener(It,rn,!0),document.addEventListener(fi,yn,!0),document.addEventListener(Oi,yn,!0),So=!0)}function jt(e,n){if(n.pointerType!==(n.MSPOINTER_TYPE_MOUSE||"mouse")){n.touches=[];for(var s in nn)n.touches.push(nn[s]);n.changedTouches=[n],e(n)}}function To(e,n){n.MSPOINTER_TYPE_TOUCH&&n.pointerType===n.MSPOINTER_TYPE_TOUCH&&Lt(n),jt(e,n)}function Ds(e){var n={},s,a;for(a in e)s=e[a],n[a]=s&&s.bind?s.bind(e):s;return e=n,n.type="dblclick",n.detail=2,n.isTrusted=!1,n._simulated=!0,n}var $a=200;function Ia(e,n){e.addEventListener("dblclick",n);var s=0,a;function c(m){if(m.detail!==1){a=m.detail;return}if(!(m.pointerType==="mouse"||m.sourceCapabilities&&!m.sourceCapabilities.firesTouchEvents)){var C=Mo(m);if(!(C.some(function(N){return N instanceof HTMLLabelElement&&N.attributes.for})&&!C.some(function(N){return N instanceof HTMLInputElement||N instanceof HTMLSelectElement}))){var $=Date.now();$-s<=$a?(a++,a===2&&n(Ds(m))):a=1,s=$}}}return e.addEventListener("click",c),{dblclick:n,simDblclick:c}}function Da(e,n){e.removeEventListener("dblclick",n.dblclick),e.removeEventListener("click",n.simDblclick)}var Ns=ns(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),mi=ns(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),Po=mi==="webkitTransition"||mi==="OTransition"?mi+"End":"transitionend";function Co(e){return typeof e=="string"?document.getElementById(e):e}function zi(e,n){var s=e.style[n]||e.currentStyle&&e.currentStyle[n];if((!s||s==="auto")&&document.defaultView){var a=document.defaultView.getComputedStyle(e,null);s=a?a[n]:null}return s==="auto"?null:s}function oe(e,n,s){var a=document.createElement(e);return a.className=n||"",s&&s.appendChild(a),a}function lt(e){var n=e.parentNode;n&&n.removeChild(e)}function jn(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function ln(e){var n=e.parentNode;n&&n.lastChild!==e&&n.appendChild(e)}function bn(e){var n=e.parentNode;n&&n.firstChild!==e&&n.insertBefore(e,n.firstChild)}function gi(e,n){if(e.classList!==void 0)return e.classList.contains(n);var s=Ai(e);return s.length>0&&new RegExp("(^|\\s)"+n+"(\\s|$)").test(s)}function Fe(e,n){if(e.classList!==void 0)for(var s=Z(n),a=0,c=s.length;a0?2*window.devicePixelRatio:1;function Oo(e){return we.edge?e.wheelDeltaY/2:e.deltaY&&e.deltaMode===0?-e.deltaY/Ra:e.deltaY&&e.deltaMode===1?-e.deltaY*20:e.deltaY&&e.deltaMode===2?-e.deltaY*60:e.deltaX||e.deltaZ?0:e.wheelDelta?(e.wheelDeltaY||e.wheelDelta)/2:e.detail&&Math.abs(e.detail)<32765?-e.detail*20:e.detail?e.detail/-32765*60:0}function Kn(e,n){var s=n.relatedTarget;if(!s)return!0;try{for(;s&&s!==e;)s=s.parentNode}catch{return!1}return s!==e}var zo={__proto__:null,on:He,off:ut,stopPropagation:St,disableScrollPropagation:zn,disableClickPropagation:yi,preventDefault:Lt,stop:wn,getPropagationPath:Mo,getMousePosition:Eo,getWheelDelta:Oo,isExternalTarget:Kn,addListener:He,removeListener:ut},Di=ue.extend({run:function(e,n,s,a){this.stop(),this._el=e,this._inProgress=!0,this._duration=s||.25,this._easeOutPower=1/Math.max(a||.5,.2),this._startPos=On(e),this._offset=n.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=Te(this._animate,this),this._step()},_step:function(e){var n=+new Date-this._startTime,s=this._duration*1e3;nthis.options.maxZoom)?this.setZoom(e):this},panInsideBounds:function(e,n){this._enforcingBounds=!0;var s=this.getCenter(),a=this._limitCenter(s,this._zoom,et(e));return s.equals(a)||this.panTo(a,n),this._enforcingBounds=!1,this},panInside:function(e,n){n=n||{};var s=me(n.paddingTopLeft||n.padding||[0,0]),a=me(n.paddingBottomRight||n.padding||[0,0]),c=this.project(this.getCenter()),m=this.project(e),C=this.getPixelBounds(),$=Je([C.min.add(s),C.max.subtract(a)]),N=$.getSize();if(!$.contains(m)){this._enforcingBounds=!0;var J=m.subtract($.getCenter()),ge=$.extend(m).getSize().subtract(N);c.x+=J.x<0?-ge.x:ge.x,c.y+=J.y<0?-ge.y:ge.y,this.panTo(this.unproject(c),n),this._enforcingBounds=!1}return this},invalidateSize:function(e){if(!this._loaded)return this;e=u({animate:!1,pan:!0},e===!0?{animate:!0}:e);var n=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var s=this.getSize(),a=n.divideBy(2).round(),c=s.divideBy(2).round(),m=a.subtract(c);return!m.x&&!m.y?this:(e.animate&&e.pan?this.panBy(m):(e.pan&&this._rawPanBy(m),this.fire("move"),e.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(h(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:n,newSize:s}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(e){if(e=this._locateOptions=u({timeout:1e4,watch:!1},e),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var n=h(this._handleGeolocationResponse,this),s=h(this._handleGeolocationError,this);return e.watch?this._locationWatchId=navigator.geolocation.watchPosition(n,s,e):navigator.geolocation.getCurrentPosition(n,s,e),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(e){if(this._container._leaflet_id){var n=e.code,s=e.message||(n===1?"permission denied":n===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:n,message:"Geolocation error: "+s+"."})}},_handleGeolocationResponse:function(e){if(this._container._leaflet_id){var n=e.coords.latitude,s=e.coords.longitude,a=new Ze(n,s),c=a.toBounds(e.coords.accuracy*2),m=this._locateOptions;if(m.setView){var C=this.getBoundsZoom(c);this.setView(a,m.maxZoom?Math.min(C,m.maxZoom):C)}var $={latlng:a,bounds:c,timestamp:e.timestamp};for(var N in e.coords)typeof e.coords[N]=="number"&&($[N]=e.coords[N]);this.fire("locationfound",$)}},addHandler:function(e,n){if(!n)return this;var s=this[e]=new n(this);return this._handlers.push(s),this.options[e]&&s.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),lt(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(te(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)lt(this._panes[e]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(e,n){var s="leaflet-pane"+(e?" leaflet-"+e.replace("Pane","")+"-pane":""),a=oe("div",s,n||this._mapPane);return e&&(this._panes[e]=a),a},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var e=this.getPixelBounds(),n=this.unproject(e.getBottomLeft()),s=this.unproject(e.getTopRight());return new at(n,s)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(e,n,s){e=et(e),s=me(s||[0,0]);var a=this.getZoom()||0,c=this.getMinZoom(),m=this.getMaxZoom(),C=e.getNorthWest(),$=e.getSouthEast(),N=this.getSize().subtract(s),J=Je(this.project($,a),this.project(C,a)).getSize(),ge=we.any3d?this.options.zoomSnap:1,Be=N.x/J.x,qe=N.y/J.y,Kt=n?Math.max(Be,qe):Math.min(Be,qe);return a=this.getScaleZoom(Kt,a),ge&&(a=Math.round(a/(ge/100))*(ge/100),a=n?Math.ceil(a/ge)*ge:Math.floor(a/ge)*ge),Math.max(c,Math.min(m,a))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new ie(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(e,n){var s=this._getTopLeftPoint(e,n);return new ze(s,s.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(e){return this.options.crs.getProjectedBounds(e===void 0?this.getZoom():e)},getPane:function(e){return typeof e=="string"?this._panes[e]:e},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(e,n){var s=this.options.crs;return n=n===void 0?this._zoom:n,s.scale(e)/s.scale(n)},getScaleZoom:function(e,n){var s=this.options.crs;n=n===void 0?this._zoom:n;var a=s.zoom(e*s.scale(n));return isNaN(a)?1/0:a},project:function(e,n){return n=n===void 0?this._zoom:n,this.options.crs.latLngToPoint(K(e),n)},unproject:function(e,n){return n=n===void 0?this._zoom:n,this.options.crs.pointToLatLng(me(e),n)},layerPointToLatLng:function(e){var n=me(e).add(this.getPixelOrigin());return this.unproject(n)},latLngToLayerPoint:function(e){var n=this.project(K(e))._round();return n._subtract(this.getPixelOrigin())},wrapLatLng:function(e){return this.options.crs.wrapLatLng(K(e))},wrapLatLngBounds:function(e){return this.options.crs.wrapLatLngBounds(et(e))},distance:function(e,n){return this.options.crs.distance(K(e),K(n))},containerPointToLayerPoint:function(e){return me(e).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(e){return me(e).add(this._getMapPanePos())},containerPointToLatLng:function(e){var n=this.containerPointToLayerPoint(me(e));return this.layerPointToLatLng(n)},latLngToContainerPoint:function(e){return this.layerPointToContainerPoint(this.latLngToLayerPoint(K(e)))},mouseEventToContainerPoint:function(e){return Eo(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=Co(e);if(n){if(n._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");He(n,"scroll",this._onScroll,this),this._containerId=y(n)},_initLayout:function(){var e=this._container;this._fadeAnimated=this.options.fadeAnimation&&we.any3d,Fe(e,"leaflet-container"+(we.touch?" leaflet-touch":"")+(we.retina?" leaflet-retina":"")+(we.ielt9?" leaflet-oldie":"")+(we.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var n=zi(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),_t(this._mapPane,new ie(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(Fe(e.markerPane,"leaflet-zoom-hide"),Fe(e.shadowPane,"leaflet-zoom-hide"))},_resetView:function(e,n,s){_t(this._mapPane,new ie(0,0));var a=!this._loaded;this._loaded=!0,n=this._limitZoom(n),this.fire("viewprereset");var c=this._zoom!==n;this._moveStart(c,s)._move(e,n)._moveEnd(c),this.fire("viewreset"),a&&this.fire("load")},_moveStart:function(e,n){return e&&this.fire("zoomstart"),n||this.fire("movestart"),this},_move:function(e,n,s,a){n===void 0&&(n=this._zoom);var c=this._zoom!==n;return this._zoom=n,this._lastCenter=e,this._pixelOrigin=this._getNewPixelOrigin(e),a?s&&s.pinch&&this.fire("zoom",s):((c||s&&s.pinch)&&this.fire("zoom",s),this.fire("move",s)),this},_moveEnd:function(e){return e&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return te(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(e){_t(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?ut:He;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),we.any3d&&this.options.transform3DLimit&&(e?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){te(this._resizeRequest),this._resizeRequest=Te(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var e=this._getMapPanePos();Math.max(Math.abs(e.x),Math.abs(e.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(e,n){for(var s=[],a,c=n==="mouseout"||n==="mouseover",m=e.target||e.srcElement,C=!1;m;){if(a=this._targets[y(m)],a&&(n==="click"||n==="preclick")&&this._draggableMoved(a)){C=!0;break}if(a&&a.listens(n,!0)&&(c&&!Kn(m,e)||(s.push(a),c))||m===this._container)break;m=m.parentNode}return!s.length&&!C&&!c&&this.listens(n,!0)&&(s=[this]),s},_isClickDisabled:function(e){for(;e&&e!==this._container;){if(e._leaflet_disable_click)return!0;e=e.parentNode}},_handleDOMEvent:function(e){var n=e.target||e.srcElement;if(!(!this._loaded||n._leaflet_disable_events||e.type==="click"&&this._isClickDisabled(n))){var s=e.type;s==="mousedown"&&os(n),this._fireDOMEvent(e,s)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(e,n,s){if(e.type==="click"){var a=u({},e);a.type="preclick",this._fireDOMEvent(a,a.type,s)}var c=this._findEventTargets(e,n);if(s){for(var m=[],C=0;C0?Math.round(e-n)/2:Math.max(0,Math.ceil(e))-Math.max(0,Math.floor(n))},_limitZoom:function(e){var n=this.getMinZoom(),s=this.getMaxZoom(),a=we.any3d?this.options.zoomSnap:1;return a&&(e=Math.round(e/a)*a),Math.max(n,Math.min(s,e))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){ft(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(e,n){var s=this._getCenterOffset(e)._trunc();return(n&&n.animate)!==!0&&!this.getSize().contains(s)?!1:(this.panBy(s,n),!0)},_createAnimProxy:function(){var e=this._proxy=oe("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(e),this.on("zoomanim",function(n){var s=Ns,a=this._proxy.style[s];Pt(this._proxy,this.project(n.center,n.zoom),this.getZoomScale(n.zoom,1)),a===this._proxy.style[s]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){lt(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var e=this.getCenter(),n=this.getZoom();Pt(this._proxy,this.project(e,n),this.getZoomScale(n,1))},_catchTransitionEnd:function(e){this._animatingZoom&&e.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(e,n,s){if(this._animatingZoom)return!0;if(s=s||{},!this._zoomAnimated||s.animate===!1||this._nothingToAnimate()||Math.abs(n-this._zoom)>this.options.zoomAnimationThreshold)return!1;var a=this.getZoomScale(n),c=this._getCenterOffset(e)._divideBy(1-1/a);return s.animate!==!0&&!this.getSize().contains(c)?!1:(Te(function(){this._moveStart(!0,s.noMoveStart||!1)._animateZoom(e,n,!0)},this),!0)},_animateZoom:function(e,n,s,a){this._mapPane&&(s&&(this._animatingZoom=!0,this._animateToCenter=e,this._animateToZoom=n,Fe(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:e,zoom:n,noUpdate:a}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(h(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&ft(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 ls(e,n){return new Ge(e,n)}var Wt=ye.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),s=this.getPosition(),a=e._controlCorners[s];return Fe(n,"leaflet-control"),s.indexOf("bottom")!==-1?a.insertBefore(n,a.firstChild):a.appendChild(n),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(lt(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()}}),Ni=function(e){return new Wt(e)};Ge.include({addControl:function(e){return e.addTo(this),this},removeControl:function(e){return e.remove(),this},_initControlPos:function(){var e=this._controlCorners={},n="leaflet-",s=this._controlContainer=oe("div",n+"control-container",this._container);function a(c,m){var C=n+c+" "+n+m;e[c+m]=oe("div",C,s)}a("top","left"),a("top","right"),a("bottom","left"),a("bottom","right")},_clearControlPos:function(){for(var e in this._controlCorners)lt(this._controlCorners[e]);lt(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Ao=Wt.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(e,n,s,a){return s1,this._baseLayersList.style.display=e?"":"none"),this._separator.style.display=n&&e?"":"none",this},_onLayerChange:function(e){this._handlingClick||this._update();var n=this._getLayer(y(e.target)),s=n.overlay?e.type==="add"?"overlayadd":"overlayremove":e.type==="add"?"baselayerchange":null;s&&this._map.fire(s,n)},_createRadioElement:function(e,n){var s='",a=document.createElement("div");return a.innerHTML=s,a.firstChild},_addItem:function(e){var n=document.createElement("label"),s=this._map.hasLayer(e.layer),a;e.overlay?(a=document.createElement("input"),a.type="checkbox",a.className="leaflet-control-layers-selector",a.defaultChecked=s):a=this._createRadioElement("leaflet-base-layers_"+y(this),s),this._layerControlInputs.push(a),a.layerId=y(e.layer),He(a,"click",this._onInputClick,this);var c=document.createElement("span");c.innerHTML=" "+e.name;var m=document.createElement("span");n.appendChild(m),m.appendChild(a),m.appendChild(c);var C=e.overlay?this._overlaysList:this._baseLayersList;return C.appendChild(n),this._checkDisabledLayers(),n},_onInputClick:function(){if(!this._preventClick){var e=this._layerControlInputs,n,s,a=[],c=[];this._handlingClick=!0;for(var m=e.length-1;m>=0;m--)n=e[m],s=this._getLayer(n.layerId).layer,n.checked?a.push(s):n.checked||c.push(s);for(m=0;m=0;c--)n=e[c],s=this._getLayer(n.layerId).layer,n.disabled=s.options.minZoom!==void 0&&as.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var e=this._section;this._preventClick=!0,He(e,"click",Lt),this.expand();var n=this;setTimeout(function(){ut(e,"click",Lt),n._preventClick=!1})}}),Fa=function(e,n,s){return new Ao(e,n,s)},Xt=Wt.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(e){var n="leaflet-control-zoom",s=oe("div",n+" leaflet-bar"),a=this.options;return this._zoomInButton=this._createButton(a.zoomInText,a.zoomInTitle,n+"-in",s,this._zoomIn),this._zoomOutButton=this._createButton(a.zoomOutText,a.zoomOutTitle,n+"-out",s,this._zoomOut),this._updateDisabled(),e.on("zoomend zoomlevelschange",this._updateDisabled,this),s},onRemove:function(e){e.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(e){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(e.shiftKey?3:1))},_createButton:function(e,n,s,a,c){var m=oe("a",s,a);return m.innerHTML=e,m.href="#",m.title=n,m.setAttribute("role","button"),m.setAttribute("aria-label",n),yi(m),He(m,"click",wn),He(m,"click",c,this),He(m,"click",this._refocusOnMap,this),m},_updateDisabled:function(){var e=this._map,n="leaflet-disabled";ft(this._zoomInButton,n),ft(this._zoomOutButton,n),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||e._zoom===e.getMinZoom())&&(Fe(this._zoomOutButton,n),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||e._zoom===e.getMaxZoom())&&(Fe(this._zoomInButton,n),this._zoomInButton.setAttribute("aria-disabled","true"))}});Ge.mergeOptions({zoomControl:!0}),Ge.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Xt,this.addControl(this.zoomControl))});var Ba=function(e){return new Xt(e)},$o=Wt.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(e){var n="leaflet-control-scale",s=oe("div",n),a=this.options;return this._addScales(a,n+"-line",s),e.on(a.updateWhenIdle?"moveend":"move",this._update,this),e.whenReady(this._update,this),s},onRemove:function(e){e.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(e,n,s){e.metric&&(this._mScale=oe("div",n,s)),e.imperial&&(this._iScale=oe("div",n,s))},_update:function(){var e=this._map,n=e.getSize().y/2,s=e.distance(e.containerPointToLatLng([0,n]),e.containerPointToLatLng([this.options.maxWidth,n]));this._updateScales(s)},_updateScales:function(e){this.options.metric&&e&&this._updateMetric(e),this.options.imperial&&e&&this._updateImperial(e)},_updateMetric:function(e){var n=this._getRoundNum(e),s=n<1e3?n+" m":n/1e3+" km";this._updateScale(this._mScale,s,n/e)},_updateImperial:function(e){var n=e*3.2808399,s,a,c;n>5280?(s=n/5280,a=this._getRoundNum(s),this._updateScale(this._iScale,a+" mi",a/s)):(c=this._getRoundNum(n),this._updateScale(this._iScale,c+" ft",c/n))},_updateScale:function(e,n,s){e.style.width=Math.round(this.options.maxWidth*s)+"px",e.innerHTML=n},_getRoundNum:function(e){var n=Math.pow(10,(Math.floor(e)+"").length-1),s=e/n;return s=s>=10?10:s>=5?5:s>=3?3:s>=2?2:1,n*s}}),Va=function(e){return new $o(e)},us='',Gn=Wt.extend({options:{position:"bottomright",prefix:''+(we.inlineSvg?us+" ":"")+"Leaflet"},initialize:function(e){F(this,e),this._attributions={}},onAdd:function(e){e.attributionControl=this,this._container=oe("div","leaflet-control-attribution"),yi(this._container);for(var n in e._layers)e._layers[n].getAttribution&&this.addAttribution(e._layers[n].getAttribution());return this._update(),e.on("layeradd",this._addAttribution,this),this._container},onRemove:function(e){e.off("layeradd",this._addAttribution,this)},_addAttribution:function(e){e.layer.getAttribution&&(this.addAttribution(e.layer.getAttribution()),e.layer.once("remove",function(){this.removeAttribution(e.layer.getAttribution())},this))},setPrefix:function(e){return this.options.prefix=e,this._update(),this},addAttribution:function(e){return e?(this._attributions[e]||(this._attributions[e]=0),this._attributions[e]++,this._update(),this):this},removeAttribution:function(e){return e?(this._attributions[e]&&(this._attributions[e]--,this._update()),this):this},_update:function(){if(this._map){var e=[];for(var n in this._attributions)this._attributions[n]&&e.push(n);var s=[];this.options.prefix&&s.push(this.options.prefix),e.length&&s.push(e.join(", ")),this._container.innerHTML=s.join(' ')}}});Ge.mergeOptions({attributionControl:!0}),Ge.addInitHook(function(){this.options.attributionControl&&new Gn().addTo(this)});var cs=function(e){return new Gn(e)};Wt.Layers=Ao,Wt.Zoom=Xt,Wt.Scale=$o,Wt.Attribution=Gn,Ni.layers=Fa,Ni.zoom=Ba,Ni.scale=Va,Ni.attribution=cs;var ht=ye.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}});ht.addTo=function(e,n){return e.addHandler(n,this),this};var bi={Events:ae},Ri=we.touch?"touchstart mousedown":"mousedown",Qt=ue.extend({options:{clickTolerance:3},initialize:function(e,n,s,a){F(this,a),this._element=e,this._dragStartTarget=n||e,this._preventOutline=s},enable:function(){this._enabled||(He(this._dragStartTarget,Ri,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Qt._dragging===this&&this.finishDrag(!0),ut(this._dragStartTarget,Ri,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(e){if(this._enabled&&(this._moved=!1,!gi(this._element,"leaflet-zoom-anim"))){if(e.touches&&e.touches.length!==1){Qt._dragging===this&&this.finishDrag();return}if(!(Qt._dragging||e.shiftKey||e.which!==1&&e.button!==1&&!e.touches)&&(Qt._dragging=this,this._preventOutline&&os(this._element),Fs(),vi(),!this._moving)){this.fire("down");var n=e.touches?e.touches[0]:e,s=Lo(this._element);this._startPoint=new ie(n.clientX,n.clientY),this._startPos=On(this._element),this._parentScale=Us(s);var a=e.type==="mousedown";He(document,a?"mousemove":"touchmove",this._onMove,this),He(document,a?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(e){if(this._enabled){if(e.touches&&e.touches.length>1){this._moved=!0;return}var n=e.touches&&e.touches.length===1?e.touches[0]:e,s=new ie(n.clientX,n.clientY)._subtract(this._startPoint);!s.x&&!s.y||Math.abs(s.x)+Math.abs(s.y)m&&(C=$,m=N);m>s&&(n[C]=1,Xe(e,n,s,a,C),Xe(e,n,s,C,c))}function An(e,n){for(var s=[e[0]],a=1,c=0,m=e.length;an&&(s.push(e[a]),c=a);return cn.max.x&&(s|=2),e.yn.max.y&&(s|=8),s}function Ha(e,n){var s=n.x-e.x,a=n.y-e.y;return s*s+a*a}function In(e,n,s,a){var c=n.x,m=n.y,C=s.x-c,$=s.y-m,N=C*C+$*$,J;return N>0&&(J=((e.x-c)*C+(e.y-m)*$)/N,J>1?(c=s.x,m=s.y):J>0&&(c+=C*J,m+=$*J)),C=e.x-c,$=e.y-m,a?C*C+$*$:new ie(c,m)}function Et(e){return!Ce(e[0])||typeof e[0][0]!="object"&&typeof e[0][0]<"u"}function Ui(e){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Et(e)}function xi(e,n){var s,a,c,m,C,$,N,J;if(!e||e.length===0)throw new Error("latlngs not passed");Et(e)||(console.warn("latlngs are not flat! Only the first ring will be used"),e=e[0]);var ge=K([0,0]),Be=et(e),qe=Be.getNorthWest().distanceTo(Be.getSouthWest())*Be.getNorthEast().distanceTo(Be.getNorthWest());qe<1700&&(ge=qn(e));var Kt=e.length,Ot=[];for(s=0;sa){N=(m-a)/c,J=[$.x-N*($.x-C.x),$.y-N*($.y-C.y)];break}var en=n.unproject(me(J));return K([en.lat+ge.lat,en.lng+ge.lng])}var kn={__proto__:null,simplify:Yn,pointToSegmentDistance:Bi,closestPointOnSegment:Ua,clipSegment:ds,_getEdgeIntersection:fs,_getBitCode:$n,_sqClosestPointOnSegment:In,isFlat:Et,_flat:Ui,polylineCenter:xi},Sn={project:function(e){return new ie(e.lng,e.lat)},unproject:function(e){return new Ze(e.y,e.x)},bounds:new ze([-180,-90],[180,90])},Zi={R:6378137,R_MINOR:6356752314245179e-9,bounds:new ze([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(e){var n=Math.PI/180,s=this.R,a=e.lat*n,c=this.R_MINOR/s,m=Math.sqrt(1-c*c),C=m*Math.sin(a),$=Math.tan(Math.PI/4-a/2)/Math.pow((1-C)/(1+C),m/2);return a=-s*Math.log(Math.max($,1e-10)),new ie(e.lng*n*s,a)},unproject:function(e){for(var n=180/Math.PI,s=this.R,a=this.R_MINOR/s,c=Math.sqrt(1-a*a),m=Math.exp(-e.y/s),C=Math.PI/2-2*Math.atan(m),$=0,N=.1,J;$<15&&Math.abs(N)>1e-7;$++)J=c*Math.sin(C),J=Math.pow((1-J)/(1+J),c/2),N=Math.PI/2-2*Math.atan(m*J)-C,C+=N;return new Ze(C*n,e.x*n/s)}},Do={__proto__:null,LonLat:Sn,Mercator:Zi,SphericalMercator:mt},ja=u({},A,{code:"EPSG:3395",projection:Zi,transformation:(function(){var e=.5/(Math.PI*Zi.R);return b(e,.5,-e,.5)})()}),Hs=u({},A,{code:"EPSG:4326",projection:Sn,transformation:b(1/180,1,-1/180,.5)}),No=u({},E,{projection:Sn,transformation:b(1,0,-1,0),scale:function(e){return Math.pow(2,e)},zoom:function(e){return Math.log(e)/Math.LN2},distance:function(e,n){var s=n.lng-e.lng,a=n.lat-e.lat;return Math.sqrt(s*s+a*a)},infinite:!0});E.Earth=A,E.EPSG3395=ja,E.EPSG3857=v,E.EPSG900913=w,E.EPSG4326=Hs,E.Simple=No;var sn=ue.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(e){return e.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(e){return e&&e.removeLayer(this),this},getPane:function(e){return this._map.getPane(e?this.options[e]||e:this.options.pane)},addInteractiveTarget:function(e){return this._map._targets[y(e)]=this,this},removeInteractiveTarget:function(e){return delete this._map._targets[y(e)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(e){var n=e.target;if(n.hasLayer(this)){if(this._map=n,this._zoomAnimated=n._zoomAnimated,this.getEvents){var s=this.getEvents();n.on(s,this),this.once("remove",function(){n.off(s,this)},this)}this.onAdd(n),this.fire("add"),n.fire("layeradd",{layer:this})}}});Ge.include({addLayer:function(e){if(!e._layerAdd)throw new Error("The provided object is not a Layer.");var n=y(e);return this._layers[n]?this:(this._layers[n]=e,e._mapToAdd=this,e.beforeAdd&&e.beforeAdd(this),this.whenReady(e._layerAdd,e),this)},removeLayer:function(e){var n=y(e);return this._layers[n]?(this._loaded&&e.onRemove(this),delete this._layers[n],this._loaded&&(this.fire("layerremove",{layer:e}),e.fire("remove")),e._map=e._mapToAdd=null,this):this},hasLayer:function(e){return y(e)in this._layers},eachLayer:function(e,n){for(var s in this._layers)e.call(n,this._layers[s]);return this},_addLayers:function(e){e=e?Ce(e)?e:[e]:[];for(var n=0,s=e.length;nthis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()=2&&n[0]instanceof Ze&&n[0].equals(n[s-1])&&n.pop(),n},_setLatLngs:function(e){Xn.prototype._setLatLngs.call(this,e),Et(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Et(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var e=this._renderer._bounds,n=this.options.weight,s=new ie(n,n);if(e=new ze(e.min.subtract(s),e.max.add(s)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(e))){if(this.options.noClip){this._parts=this._rings;return}for(var a=0,c=this._rings.length,m;ae.y!=c.y>e.y&&e.x<(c.x-a.x)*(e.y-a.y)/(c.y-a.y)+a.x&&(n=!n);return n||Xn.prototype._containsPoint.call(this,e,!0)}});function Uc(e,n){return new ms(e,n)}var Qn=Tn.extend({initialize:function(e,n){F(this,n),this._layers={},e&&this.addData(e)},addData:function(e){var n=Ce(e)?e:e.features,s,a,c;if(n){for(s=0,a=n.length;s0&&c.push(c[0].slice()),c}function gs(e,n){return e.feature?u({},e.feature,{geometry:n}):Uo(n)}function Uo(e){return e.type==="Feature"||e.type==="FeatureCollection"?e:{type:"Feature",properties:{},geometry:e}}var Ga={toGeoJSON:function(e){return gs(this,{type:"Point",coordinates:Ka(this.getLatLng(),e)})}};ps.include(Ga),Qe.include(Ga),Y.include(Ga),Xn.include({toGeoJSON:function(e){var n=!Et(this._latlngs),s=Vo(this._latlngs,n?1:0,!1,e);return gs(this,{type:(n?"Multi":"")+"LineString",coordinates:s})}}),ms.include({toGeoJSON:function(e){var n=!Et(this._latlngs),s=n&&!Et(this._latlngs[0]),a=Vo(this._latlngs,s?2:n?1:0,!0,e);return n||(a=[a]),gs(this,{type:(s?"Multi":"")+"Polygon",coordinates:a})}}),wi.include({toMultiPoint:function(e){var n=[];return this.eachLayer(function(s){n.push(s.toGeoJSON(e).geometry.coordinates)}),gs(this,{type:"MultiPoint",coordinates:n})},toGeoJSON:function(e){var n=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(n==="MultiPoint")return this.toMultiPoint(e);var s=n==="GeometryCollection",a=[];return this.eachLayer(function(c){if(c.toGeoJSON){var m=c.toGeoJSON(e);if(s)a.push(m.geometry);else{var C=Uo(m);C.type==="FeatureCollection"?a.push.apply(a,C.features):a.push(C)}}}),s?gs(this,{geometries:a,type:"GeometryCollection"}):{type:"FeatureCollection",features:a}}});function Kr(e,n){return new Qn(e,n)}var Zc=Kr,Zo=sn.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(e,n,s){this._url=e,this._bounds=et(n),F(this,s)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(Fe(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){lt(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(e){return this.options.opacity=e,this._image&&this._updateOpacity(),this},setStyle:function(e){return e.opacity&&this.setOpacity(e.opacity),this},bringToFront:function(){return this._map&&ln(this._image),this},bringToBack:function(){return this._map&&bn(this._image),this},setUrl:function(e){return this._url=e,this._image&&(this._image.src=e),this},setBounds:function(e){return this._bounds=et(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:oe("img");if(Fe(n,"leaflet-image-layer"),this._zoomAnimated&&Fe(n,"leaflet-zoom-animated"),this.options.className&&Fe(n,this.options.className),n.onselectstart=O,n.onmousemove=O,n.onload=h(this.fire,this,"load"),n.onerror=h(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(n.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),e){this._url=n.src;return}n.src=this._url,n.alt=this.options.alt},_animateZoom:function(e){var n=this._map.getZoomScale(e.zoom),s=this._map._latLngBoundsToNewLayerBounds(this._bounds,e.zoom,e.center).min;Pt(this._image,s,n)},_reset:function(){var e=this._image,n=new ze(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),s=n.getSize();_t(e,n.min),e.style.width=s.x+"px",e.style.height=s.y+"px"},_updateOpacity:function(){Rt(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()}}),Hc=function(e,n,s){return new Zo(e,n,s)},Gr=Zo.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:oe("video");if(Fe(n,"leaflet-image-layer"),this._zoomAnimated&&Fe(n,"leaflet-zoom-animated"),this.options.className&&Fe(n,this.options.className),n.onselectstart=O,n.onmousemove=O,n.onloadeddata=h(this.fire,this,"load"),e){for(var s=n.getElementsByTagName("source"),a=[],c=0;c0?a:[n.src];return}Ce(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 m=0;mc?(n.height=c+"px",Fe(e,m)):ft(e,m),this._containerWidth=this._container.offsetWidth},_animateZoom:function(e){var n=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center),s=this._getAnchor();_t(this._container,n.add(s))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var e=this._map,n=parseInt(zi(this._container,"marginBottom"),10)||0,s=this._container.offsetHeight+n,a=this._containerWidth,c=new ie(this._containerLeft,-s-this._containerBottom);c._add(On(this._container));var m=e.layerPointToContainerPoint(c),C=me(this.options.autoPanPadding),$=me(this.options.autoPanPaddingTopLeft||C),N=me(this.options.autoPanPaddingBottomRight||C),J=e.getSize(),ge=0,Be=0;m.x+a+N.x>J.x&&(ge=m.x+a-J.x+N.x),m.x-ge-$.x<0&&(ge=m.x-$.x),m.y+s+N.y>J.y&&(Be=m.y+s-J.y+N.y),m.y-Be-$.y<0&&(Be=m.y-$.y),(ge||Be)&&(this.options.keepInView&&(this._autopanning=!0),e.fire("autopanstart").panBy([ge,Be]))}},_getAnchor:function(){return me(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Kc=function(e,n){return new Ho(e,n)};Ge.mergeOptions({closePopupOnClick:!0}),Ge.include({openPopup:function(e,n,s){return this._initOverlay(Ho,e,n,s).openOn(this),this},closePopup:function(e){return e=arguments.length?e:this._popup,e&&e.close(),this}}),sn.include({bindPopup:function(e,n){return this._popup=this._initOverlay(Ho,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 Tn||(this._popup._source=this),this._popup._prepareOpen(e||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(e){return this._popup&&this._popup.setContent(e),this},getPopup:function(){return this._popup},_openPopup:function(e){if(!(!this._popup||!this._map)){wn(e);var n=e.layer||e.target;if(this._popup._source===n&&!(n instanceof f)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(e.latlng);return}this._popup._source=n,this.openPopup(e.latlng)}},_movePopup:function(e){this._popup.setLatLng(e.latlng)},_onKeyPress:function(e){e.originalEvent.keyCode===13&&this._openPopup(e)}});var jo=Dn.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(e){Dn.prototype.onAdd.call(this,e),this.setOpacity(this.options.opacity),e.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(e){Dn.prototype.onRemove.call(this,e),e.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var e=Dn.prototype.getEvents.call(this);return this.options.permanent||(e.preclick=this.close),e},_initLayout:function(){var e="leaflet-tooltip",n=e+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=oe("div",n),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+y(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(e){var n,s,a=this._map,c=this._container,m=a.latLngToContainerPoint(a.getCenter()),C=a.layerPointToContainerPoint(e),$=this.options.direction,N=c.offsetWidth,J=c.offsetHeight,ge=me(this.options.offset),Be=this._getAnchor();$==="top"?(n=N/2,s=J):$==="bottom"?(n=N/2,s=0):$==="center"?(n=N/2,s=J/2):$==="right"?(n=0,s=J/2):$==="left"?(n=N,s=J/2):C.xthis.options.maxZoom||sa?this._retainParent(c,m,C,a):!1)},_retainChildren:function(e,n,s,a){for(var c=2*e;c<2*e+2;c++)for(var m=2*n;m<2*n+2;m++){var C=new ie(c,m);C.z=s+1;var $=this._tileCoordsToKey(C),N=this._tiles[$];if(N&&N.active){N.retain=!0;continue}else N&&N.loaded&&(N.retain=!0);s+1this.options.maxZoom||this.options.minZoom!==void 0&&c1){this._setView(e,s);return}for(var Be=c.min.y;Be<=c.max.y;Be++)for(var qe=c.min.x;qe<=c.max.x;qe++){var Kt=new ie(qe,Be);if(Kt.z=this._tileZoom,!!this._isValidTile(Kt)){var Ot=this._tiles[this._tileCoordsToKey(Kt)];Ot?Ot.current=!0:C.push(Kt)}}if(C.sort(function(en,_s){return en.distanceTo(m)-_s.distanceTo(m)}),C.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var dn=document.createDocumentFragment();for(qe=0;qes.max.x)||!n.wrapLat&&(e.ys.max.y))return!1}if(!this.options.bounds)return!0;var a=this._tileCoordsToBounds(e);return et(this.options.bounds).overlaps(a)},_keyToBounds:function(e){return this._tileCoordsToBounds(this._keyToTileCoords(e))},_tileCoordsToNwSe:function(e){var n=this._map,s=this.getTileSize(),a=e.scaleBy(s),c=a.add(s),m=n.unproject(a,e.z),C=n.unproject(c,e.z);return[m,C]},_tileCoordsToBounds:function(e){var n=this._tileCoordsToNwSe(e),s=new at(n[0],n[1]);return this.options.noWrap||(s=this._map.wrapLatLngBounds(s)),s},_tileCoordsToKey:function(e){return e.x+":"+e.y+":"+e.z},_keyToTileCoords:function(e){var n=e.split(":"),s=new ie(+n[0],+n[1]);return s.z=+n[2],s},_removeTile:function(e){var n=this._tiles[e];n&&(lt(n.el),delete this._tiles[e],this.fire("tileunload",{tile:n.el,coords:this._keyToTileCoords(e)}))},_initTile:function(e){Fe(e,"leaflet-tile");var n=this.getTileSize();e.style.width=n.x+"px",e.style.height=n.y+"px",e.onselectstart=O,e.onmousemove=O,we.ielt9&&this.options.opacity<1&&Rt(e,this.options.opacity)},_addTile:function(e,n){var s=this._getTilePos(e),a=this._tileCoordsToKey(e),c=this.createTile(this._wrapCoords(e),h(this._tileReady,this,e));this._initTile(c),this.createTile.length<2&&Te(h(this._tileReady,this,e,null,c)),_t(c,s),this._tiles[a]={el:c,coords:e,current:!0},n.appendChild(c),this.fire("tileloadstart",{tile:c,coords:e})},_tileReady:function(e,n,s){n&&this.fire("tileerror",{error:n,tile:s,coords:e});var a=this._tileCoordsToKey(e);s=this._tiles[a],s&&(s.loaded=+new Date,this._map._fadeAnimated?(Rt(s.el,0),te(this._fadeFrame),this._fadeFrame=Te(this._updateOpacity,this)):(s.active=!0,this._pruneTiles()),n||(Fe(s.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:s.el,coords:e})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),we.ielt9||!this._map._fadeAnimated?Te(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 ie(this._wrapX?S(e.x,this._wrapX):e.x,this._wrapY?S(e.y,this._wrapY):e.y);return n.z=e.z,n},_pxBoundsToTileRange:function(e){var n=this.getTileSize();return new ze(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 Yc(e){return new Ws(e)}var vs=Ws.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&&we.retina&&n.maxZoom>0?(n.tileSize=Math.floor(n.tileSize/2),n.zoomReverse?(n.zoomOffset--,n.minZoom=Math.min(n.maxZoom,n.minZoom+1)):(n.zoomOffset++,n.maxZoom=Math.max(n.minZoom,n.maxZoom-1)),n.minZoom=Math.max(0,n.minZoom)):n.zoomReverse?n.minZoom=Math.min(n.maxZoom,n.minZoom):n.maxZoom=Math.max(n.minZoom,n.maxZoom),typeof n.subdomains=="string"&&(n.subdomains=n.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(e,n){return this._url===e&&n===void 0&&(n=!0),this._url=e,n||this.redraw(),this},createTile:function(e,n){var s=document.createElement("img");return He(s,"load",h(this._tileOnLoad,this,n,s)),He(s,"error",h(this._tileOnError,this,n,s)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(s.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(s.referrerPolicy=this.options.referrerPolicy),s.alt="",s.src=this.getTileUrl(e),s},getTileUrl:function(e){var n={r:we.retina?"@2x":"",s:this._getSubdomain(e),x:e.x,y:e.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var s=this._globalTileRange.max.y-e.y;this.options.tms&&(n.y=s),n["-y"]=s}return q(this._url,u(n,this.options))},_tileOnLoad:function(e,n){we.ielt9?setTimeout(h(e,this,null,n),0):e(null,n)},_tileOnError:function(e,n,s){var a=this.options.errorTileUrl;a&&n.getAttribute("src")!==a&&(n.src=a),e(s,n)},_onTileRemove:function(e){e.tile.onload=null},_getZoomForUrl:function(){var e=this._tileZoom,n=this.options.maxZoom,s=this.options.zoomReverse,a=this.options.zoomOffset;return s&&(e=n-e),e+a},_getSubdomain:function(e){var n=Math.abs(e.x+e.y)%this.options.subdomains.length;return this.options.subdomains[n]},_abortLoading:function(){var e,n;for(e in this._tiles)if(this._tiles[e].coords.z!==this._tileZoom&&(n=this._tiles[e].el,n.onload=O,n.onerror=O,!n.complete)){n.src=be;var s=this._tiles[e].coords;lt(n),delete this._tiles[e],this.fire("tileabort",{tile:n,coords:s})}},_removeTile:function(e){var n=this._tiles[e];if(n)return n.el.setAttribute("src",be),Ws.prototype._removeTile.call(this,e)},_tileReady:function(e,n,s){if(!(!this._map||s&&s.getAttribute("src")===be))return Ws.prototype._tileReady.call(this,e,n,s)}});function Jr(e,n){return new vs(e,n)}var Xr=vs.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(e,n){this._url=e;var s=u({},this.defaultWmsParams);for(var a in n)a in this.options||(s[a]=n[a]);n=F(this,n);var c=n.detectRetina&&we.retina?2:1,m=this.getTileSize();s.width=m.x*c,s.height=m.y*c,this.wmsParams=s},onAdd:function(e){this._crs=this.options.crs||e.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var n=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[n]=this._crs.code,vs.prototype.onAdd.call(this,e)},getTileUrl:function(e){var n=this._tileCoordsToNwSe(e),s=this._crs,a=Je(s.project(n[0]),s.project(n[1])),c=a.min,m=a.max,C=(this._wmsVersion>=1.3&&this._crs===Hs?[c.y,c.x,m.y,m.x]:[c.x,c.y,m.x,m.y]).join(","),$=vs.prototype.getTileUrl.call(this,e);return $+fe(this.wmsParams,$,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+C},setParams:function(e,n){return u(this.wmsParams,e),n||this.redraw(),this}});function Jc(e,n){return new Xr(e,n)}vs.WMS=Xr,Jr.wms=Jc;var ei=sn.extend({options:{padding:.1},initialize:function(e){F(this,e),y(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),Fe(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var e={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(e.zoomanim=this._onAnimZoom),e},_onAnimZoom:function(e){this._updateTransform(e.center,e.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(e,n){var s=this._map.getZoomScale(n,this._zoom),a=this._map.getSize().multiplyBy(.5+this.options.padding),c=this._map.project(this._center,n),m=a.multiplyBy(-s).add(c).subtract(this._map._getNewPixelOrigin(e,n));we.any3d?Pt(this._container,m,s):_t(this._container,m)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var e in this._layers)this._layers[e]._reset()},_onZoomEnd:function(){for(var e in this._layers)this._layers[e]._project()},_updatePaths:function(){for(var e in this._layers)this._layers[e]._update()},_update:function(){var e=this.options.padding,n=this._map.getSize(),s=this._map.containerPointToLayerPoint(n.multiplyBy(-e)).round();this._bounds=new ze(s,s.add(n.multiplyBy(1+e*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Qr=ei.extend({options:{tolerance:0},getEvents:function(){var e=ei.prototype.getEvents.call(this);return e.viewprereset=this._onViewPreReset,e},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){ei.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var e=this._container=document.createElement("canvas");He(e,"mousemove",this._onMouseMove,this),He(e,"click dblclick mousedown mouseup contextmenu",this._onClick,this),He(e,"mouseout",this._handleMouseOut,this),e._leaflet_disable_events=!0,this._ctx=e.getContext("2d")},_destroyContainer:function(){te(this._redrawRequest),delete this._ctx,lt(this._container),ut(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var e;this._redrawBounds=null;for(var n in this._layers)e=this._layers[n],e._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){ei.prototype._update.call(this);var e=this._bounds,n=this._container,s=e.getSize(),a=we.retina?2:1;_t(n,e.min),n.width=a*s.x,n.height=a*s.y,n.style.width=s.x+"px",n.style.height=s.y+"px",we.retina&&this._ctx.scale(2,2),this._ctx.translate(-e.min.x,-e.min.y),this.fire("update")}},_reset:function(){ei.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(e){this._updateDashArray(e),this._layers[y(e)]=e;var n=e._order={layer:e,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=n),this._drawLast=n,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(e){this._requestRedraw(e)},_removePath:function(e){var n=e._order,s=n.next,a=n.prev;s?s.prev=a:this._drawLast=a,a?a.next=s:this._drawFirst=s,delete e._order,delete this._layers[y(e)],this._requestRedraw(e)},_updatePath:function(e){this._extendRedrawBounds(e),e._project(),e._update(),this._requestRedraw(e)},_updateStyle:function(e){this._updateDashArray(e),this._requestRedraw(e)},_updateDashArray:function(e){if(typeof e.options.dashArray=="string"){var n=e.options.dashArray.split(/[, ]+/),s=[],a,c;for(c=0;c')}}catch{}return function(e){return document.createElement("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}})(),Xc={_initContainer:function(){this._container=oe("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(ei.prototype._update.call(this),this.fire("update"))},_initPath:function(e){var n=e._container=Ks("shape");Fe(n,"leaflet-vml-shape "+(this.options.className||"")),n.coordsize="1 1",e._path=Ks("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;lt(n),e.removeInteractiveTarget(n),delete this._layers[y(e)]},_updateStyle:function(e){var n=e._stroke,s=e._fill,a=e.options,c=e._container;c.stroked=!!a.stroke,c.filled=!!a.fill,a.stroke?(n||(n=e._stroke=Ks("stroke")),c.appendChild(n),n.weight=a.weight+"px",n.color=a.color,n.opacity=a.opacity,a.dashArray?n.dashStyle=Ce(a.dashArray)?a.dashArray.join(" "):a.dashArray.replace(/( *, *)/g," "):n.dashStyle="",n.endcap=a.lineCap.replace("butt","flat"),n.joinstyle=a.lineJoin):n&&(c.removeChild(n),e._stroke=null),a.fill?(s||(s=e._fill=Ks("fill")),c.appendChild(s),s.color=a.fillColor||a.color,s.opacity=a.fillOpacity):s&&(c.removeChild(s),e._fill=null)},_updateCircle:function(e){var n=e._point.round(),s=Math.round(e._radius),a=Math.round(e._radiusY||s);this._setPath(e,e._empty()?"M0 0":"AL "+n.x+","+n.y+" "+s+","+a+" 0,"+65535*360)},_setPath:function(e,n){e._path.v=n},_bringToFront:function(e){ln(e._container)},_bringToBack:function(e){bn(e._container)}},Wo=we.vml?Ks:W,Gs=ei.extend({_initContainer:function(){this._container=Wo("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Wo("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){lt(this._container),ut(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){ei.prototype._update.call(this);var e=this._bounds,n=e.getSize(),s=this._container;(!this._svgSize||!this._svgSize.equals(n))&&(this._svgSize=n,s.setAttribute("width",n.x),s.setAttribute("height",n.y)),_t(s,e.min),s.setAttribute("viewBox",[e.min.x,e.min.y,n.x,n.y].join(" ")),this.fire("update")}},_initPath:function(e){var n=e._path=Wo("path");e.options.className&&Fe(n,e.options.className),e.options.interactive&&Fe(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){lt(e._path),e.removeInteractiveTarget(e._path),delete this._layers[y(e)]},_updatePath:function(e){e._project(),e._update()},_updateStyle:function(e){var n=e._path,s=e.options;n&&(s.stroke?(n.setAttribute("stroke",s.color),n.setAttribute("stroke-opacity",s.opacity),n.setAttribute("stroke-width",s.weight),n.setAttribute("stroke-linecap",s.lineCap),n.setAttribute("stroke-linejoin",s.lineJoin),s.dashArray?n.setAttribute("stroke-dasharray",s.dashArray):n.removeAttribute("stroke-dasharray"),s.dashOffset?n.setAttribute("stroke-dashoffset",s.dashOffset):n.removeAttribute("stroke-dashoffset")):n.setAttribute("stroke","none"),s.fill?(n.setAttribute("fill",s.fillColor||s.color),n.setAttribute("fill-opacity",s.fillOpacity),n.setAttribute("fill-rule",s.fillRule||"evenodd")):n.setAttribute("fill","none"))},_updatePoly:function(e,n){this._setPath(e,H(e._parts,n))},_updateCircle:function(e){var n=e._point,s=Math.max(Math.round(e._radius),1),a=Math.max(Math.round(e._radiusY),1)||s,c="a"+s+","+a+" 0 1,0 ",m=e._empty()?"M0 0":"M"+(n.x-s)+","+n.y+c+s*2+",0 "+c+-s*2+",0 ";this._setPath(e,m)},_setPath:function(e,n){e._path.setAttribute("d",n)},_bringToFront:function(e){ln(e._path)},_bringToBack:function(e){bn(e._path)}});we.vml&&Gs.include(Xc);function tl(e){return we.svg||we.vml?new Gs(e):null}Ge.include({getRenderer:function(e){var n=e.options.renderer||this._getPaneRenderer(e.options.pane)||this.options.renderer||this._renderer;return n||(n=this._renderer=this._createRenderer()),this.hasLayer(n)||this.addLayer(n),n},_getPaneRenderer:function(e){if(e==="overlayPane"||e===void 0)return!1;var n=this._paneRenderers[e];return n===void 0&&(n=this._createRenderer({pane:e}),this._paneRenderers[e]=n),n},_createRenderer:function(e){return this.options.preferCanvas&&el(e)||tl(e)}});var nl=ms.extend({initialize:function(e,n){ms.prototype.initialize.call(this,this._boundsToLatLngs(e),n)},setBounds:function(e){return this.setLatLngs(this._boundsToLatLngs(e))},_boundsToLatLngs:function(e){return e=et(e),[e.getSouthWest(),e.getNorthWest(),e.getNorthEast(),e.getSouthEast()]}});function Qc(e,n){return new nl(e,n)}Gs.create=Wo,Gs.pointsToPath=H,Qn.geometryToLayer=Fo,Qn.coordsToLatLng=Wa,Qn.coordsToLatLngs=Bo,Qn.latLngToCoords=Ka,Qn.latLngsToCoords=Vo,Qn.getFeature=gs,Qn.asFeature=Uo,Ge.mergeOptions({boxZoom:!0});var il=ht.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(){He(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){ut(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){lt(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(),vi(),Fs(),this._startPoint=this._map.mouseEventToContainerPoint(e),He(document,{contextmenu:wn,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(e){this._moved||(this._moved=!0,this._box=oe("div","leaflet-zoom-box",this._container),Fe(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(e);var n=new ze(this._point,this._startPoint),s=n.getSize();_t(this._box,n.min),this._box.style.width=s.x+"px",this._box.style.height=s.y+"px"},_finish:function(){this._moved&&(lt(this._box),ft(this._container,"leaflet-crosshair")),$i(),Bs(),ut(document,{contextmenu:wn,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(e){if(!(e.which!==1&&e.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(h(this._resetState,this),0);var n=new at(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(n).fire("boxzoomend",{boxZoomBounds:n})}},_onKeyDown:function(e){e.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});Ge.addInitHook("addHandler","boxZoom",il),Ge.mergeOptions({doubleClickZoom:!0});var sl=ht.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(e){var n=this._map,s=n.getZoom(),a=n.options.zoomDelta,c=e.originalEvent.shiftKey?s-a:s+a;n.options.doubleClickZoom==="center"?n.setZoom(c):n.setZoomAround(e.containerPoint,c)}});Ge.addInitHook("addHandler","doubleClickZoom",sl),Ge.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var ol=ht.extend({addHooks:function(){if(!this._draggable){var e=this._map;this._draggable=new Qt(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))}Fe(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){ft(this._map._container,"leaflet-grab"),ft(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=et(this._map.options.maxBounds);this._offsetLimit=Je(this._map.latLngToContainerPoint(n.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(n.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;e.fire("movestart").fire("dragstart"),e.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(e){if(this._map.options.inertia){var n=this._lastTime=+new Date,s=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(s),this._times.push(n),this._prunePositions(n)}this._map.fire("move",e).fire("drag",e)},_prunePositions:function(e){for(;this._positions.length>1&&e-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var e=this._map.getSize().divideBy(2),n=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=n.subtract(e).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(e,n){return e-(e-n)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var e=this._draggable._newPos.subtract(this._draggable._startPos),n=this._offsetLimit;e.xn.max.x&&(e.x=this._viscousLimit(e.x,n.max.x)),e.y>n.max.y&&(e.y=this._viscousLimit(e.y,n.max.y)),this._draggable._newPos=this._draggable._startPos.add(e)}},_onPreDragWrap:function(){var e=this._worldWidth,n=Math.round(e/2),s=this._initialWorldOffset,a=this._draggable._newPos.x,c=(a-n+s)%e+n-s,m=(a+n+s)%e-n-s,C=Math.abs(c+s)0?m:-m))-n;this._delta=0,this._startTime=null,C&&(e.options.scrollWheelZoom==="center"?e.setZoom(n+C):e.setZoomAround(this._lastMousePos,n+C))}});Ge.addInitHook("addHandler","scrollWheelZoom",rl);var ed=600;Ge.mergeOptions({tapHold:we.touchNative&&we.safari&&we.mobile,tapTolerance:15});var ll=ht.extend({addHooks:function(){He(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){ut(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 ie(n.clientX,n.clientY),this._holdTimeout=setTimeout(h(function(){this._cancel(),this._isTapValid()&&(He(document,"touchend",Lt),He(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",n))},this),ed),He(document,"touchend touchcancel contextmenu",this._cancel,this),He(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function e(){ut(document,"touchend",Lt),ut(document,"touchend touchcancel",e)},_cancel:function(){clearTimeout(this._holdTimeout),ut(document,"touchend touchcancel contextmenu",this._cancel,this),ut(document,"touchmove",this._onMove,this)},_onMove:function(e){var n=e.touches[0];this._newPos=new ie(n.clientX,n.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(e,n){var s=new MouseEvent(e,{bubbles:!0,cancelable:!0,view:window,screenX:n.screenX,screenY:n.screenY,clientX:n.clientX,clientY:n.clientY});s._simulated=!0,n.target.dispatchEvent(s)}});Ge.addInitHook("addHandler","tapHold",ll),Ge.mergeOptions({touchZoom:we.touch,bounceAtZoomLimits:!0});var ul=ht.extend({addHooks:function(){Fe(this._map._container,"leaflet-touch-zoom"),He(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){ft(this._map._container,"leaflet-touch-zoom"),ut(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(e){var n=this._map;if(!(!e.touches||e.touches.length!==2||n._animatingZoom||this._zooming)){var s=n.mouseEventToContainerPoint(e.touches[0]),a=n.mouseEventToContainerPoint(e.touches[1]);this._centerPoint=n.getSize()._divideBy(2),this._startLatLng=n.containerPointToLatLng(this._centerPoint),n.options.touchZoom!=="center"&&(this._pinchStartLatLng=n.containerPointToLatLng(s.add(a)._divideBy(2))),this._startDist=s.distanceTo(a),this._startZoom=n.getZoom(),this._moved=!1,this._zooming=!0,n._stop(),He(document,"touchmove",this._onTouchMove,this),He(document,"touchend touchcancel",this._onTouchEnd,this),Lt(e)}},_onTouchMove:function(e){if(!(!e.touches||e.touches.length!==2||!this._zooming)){var n=this._map,s=n.mouseEventToContainerPoint(e.touches[0]),a=n.mouseEventToContainerPoint(e.touches[1]),c=s.distanceTo(a)/this._startDist;if(this._zoom=n.getScaleZoom(c,this._startZoom),!n.options.bounceAtZoomLimits&&(this._zoomn.getMaxZoom()&&c>1)&&(this._zoom=n._limitZoom(this._zoom)),n.options.touchZoom==="center"){if(this._center=this._startLatLng,c===1)return}else{var m=s._add(a)._divideBy(2)._subtract(this._centerPoint);if(c===1&&m.x===0&&m.y===0)return;this._center=n.unproject(n.project(this._pinchStartLatLng,this._zoom).subtract(m),this._zoom)}this._moved||(n._moveStart(!0,!1),this._moved=!0),te(this._animRequest);var C=h(n._move,n,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=Te(C,this,!0),Lt(e)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,te(this._animRequest),ut(document,"touchmove",this._onTouchMove,this),ut(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});Ge.addInitHook("addHandler","touchZoom",ul),Ge.BoxZoom=il,Ge.DoubleClickZoom=sl,Ge.Drag=ol,Ge.Keyboard=al,Ge.ScrollWheelZoom=rl,Ge.TapHold=ll,Ge.TouchZoom=ul,o.Bounds=ze,o.Browser=we,o.CRS=E,o.Canvas=Qr,o.Circle=Qe,o.CircleMarker=Y,o.Class=ye,o.Control=Wt,o.DivIcon=Yr,o.DivOverlay=Dn,o.DomEvent=zo,o.DomUtil=Na,o.Draggable=Qt,o.Evented=ue,o.FeatureGroup=Tn,o.GeoJSON=Qn,o.GridLayer=Ws,o.Handler=ht,o.Icon=cn,o.ImageOverlay=Zo,o.LatLng=Ze,o.LatLngBounds=at,o.Layer=sn,o.LayerGroup=wi,o.LineUtil=kn,o.Map=Ge,o.Marker=ps,o.Mixin=bi,o.Path=f,o.Point=ie,o.PolyUtil=Io,o.Polygon=ms,o.Polyline=Xn,o.Popup=Ho,o.PosAnimation=Di,o.Projection=Do,o.Rectangle=nl,o.Renderer=ei,o.SVG=Gs,o.SVGOverlay=qr,o.TileLayer=vs,o.Tooltip=jo,o.Transformation=kt,o.Util=de,o.VideoOverlay=Gr,o.bind=h,o.bounds=Je,o.canvas=el,o.circle=Bc,o.circleMarker=T,o.control=Ni,o.divIcon=qc,o.extend=u,o.featureGroup=gt,o.geoJSON=Kr,o.geoJson=Zc,o.gridLayer=Yc,o.icon=js,o.imageOverlay=Hc,o.latLng=K,o.latLngBounds=et,o.layerGroup=hs,o.map=ls,o.marker=x,o.point=me,o.polygon=Uc,o.polyline=Vc,o.popup=Kc,o.rectangle=Qc,o.setOptions=F,o.stamp=y,o.svg=tl,o.svgOverlay=Wc,o.tileLayer=Jr,o.tooltip=Gc,o.transformation=b,o.version=l,o.videoOverlay=jc;var td=window.L;o.noConflict=function(){return window.L=td,this},window.L=o}))})(no,no.exports)),no.exports}var im=nm();const Si=em(im),cu={__name:"DeviceMap",props:{position:{type:Object,default:null},trail:{type:Array,default:()=>[]},aircraft:{type:Array,default:()=>[]}},setup(t){const i=t,o=G(null);let l,u,d,h;const _=new Map;function y(Z,F){const fe=getComputedStyle(document.documentElement).getPropertyValue("--accent").trim()||"#3D7BF0",ve=F?"#8a94a6":fe,q=typeof Z=="number"?Z:0;return Si.divIcon({className:"plane-marker",iconSize:[22,22],iconAnchor:[11,11],html:``})}function M(Z){const fe=[`${Z.callsign||Z.icao24||"aircraft"}`];return Z.country&&fe.push(Z.country),typeof Z.altitude=="number"&&fe.push(`${Math.round(Z.altitude)} m`),typeof Z.velocity=="number"&&fe.push(`${Math.round(Z.velocity*3.6)} km/h`),Z.onGround&&fe.push("on ground"),fe.join(" · ")}function S(){if(!l)return;h||(h=Si.layerGroup().addTo(l));const Z=new Set;for(const F of i.aircraft){if(typeof F.lat!="number"||typeof F.lng!="number")continue;Z.add(F.icao24);const fe=[F.lat,F.lng];let ve=_.get(F.icao24);ve?(ve.setLatLng(fe),ve.setIcon(y(F.heading,F.onGround)),ve.setTooltipContent(M(F))):(ve=Si.marker(fe,{icon:y(F.heading,F.onGround)}).bindTooltip(M(F)),ve.addTo(h),_.set(F.icao24,ve))}for(const[F,fe]of _)Z.has(F)||(h.removeLayer(fe),_.delete(F))}function O(){if(!l)return;const Z=i.position;if(Z&&(Z.lat||Z.lng)){const F=[Z.lat,Z.lng];u?u.setLatLng(F):(u=Si.marker(F).addTo(l),l.setView(F,17))}if(d&&d.remove(),i.trail.length){const F=getComputedStyle(document.documentElement).getPropertyValue("--accent").trim()||"#3D7BF0";d=Si.polyline(i.trail,{color:F,weight:3}).addTo(l)}}ui(()=>{l=Si.map(o.value,{zoomControl:!0}).setView([20,0],2),Si.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:"© OpenStreetMap",maxZoom:19}).addTo(l),setTimeout(()=>l.invalidateSize(),60),O(),S(),(!i.position||!i.position.lat&&!i.position.lng)&&i.aircraft.length&&V()});let B=!1;function V(){if(B||!l||!i.aircraft.length)return;const Z=i.aircraft.filter(F=>typeof F.lat=="number"&&typeof F.lng=="number").map(F=>[F.lat,F.lng]);Z.length&&(l.fitBounds(Si.latLngBounds(Z).pad(.2)),B=!0)}return Os(()=>{l&&l.remove(),l=null}),zt(()=>i.position,O,{deep:!0}),zt(()=>i.trail,O,{deep:!0}),zt(()=>i.aircraft,()=>{S(),(!i.position||!i.position.lat&&!i.position.lng)&&V()},{deep:!0}),(Z,F)=>(p(),g("div",{ref_key:"el",ref:o,class:"h-[320px] w-full rounded-lg"},null,512))}},sm=["width","height","stroke-width"],om=["d"],X={__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,d)=>d?"M"+u:u);return(u,d)=>(p(),g("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),g(ce,null,Ve($e(l),(h,_)=>(p(),g("path",{key:_,d:h},null,8,om))),128))],8,sm))}},am=["aria-checked","disabled"],tn={__name:"Toggle",props:{modelValue:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:i}){const o=i;return(l,u)=>(p(),g("button",{type:"button",role:"switch","aria-checked":t.modelValue,disabled:t.disabled,class:Oe(["relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition disabled:opacity-40",t.modelValue?"bg-accent":"bg-surface-2 border border-line-strong"]),onClick:u[0]||(u[0]=d=>o("update:modelValue",!t.modelValue))},[r("span",{class:Oe(["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,am))}},rm={class:"inline-flex rounded-[10px] border border-line bg-surface-2 p-0.5"},lm=["onClick"],hn={__name:"Segmented",props:{modelValue:{type:[String,Number],default:""},options:{type:Array,default:()=>[]}},emits:["update:modelValue"],setup(t,{emit:i}){const o=i;return(l,u)=>(p(),g("div",rm,[(p(!0),g(ce,null,Ve(t.options,d=>(p(),g("button",{key:d.value,type:"button",class:Oe(["inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-[13px] font-semibold transition",t.modelValue===d.value?"bg-surface-1 text-ink shadow-xs":"text-ink-secondary hover:text-ink"]),onClick:h=>o("update:modelValue",d.value)},[d.icon?(p(),it(X,{key:0,name:d.icon,size:15},null,8,["name"])):R("",!0),D(" "+k(d.label),1)],10,lm))),128))]))}},um={class:"text-sm font-semibold text-ink"},cm={key:0,class:"mt-0.5 text-xs text-ink-muted"},Ee={__name:"Row",props:{title:{type:String,default:""},desc:{type:String,default:""},keywords:{type:String,default:""},block:{type:Boolean,default:!1}},setup(t){const i=t,o=ao("settingsSearch",{value:""}),l=Pe(()=>{const u=(o.value||"").trim().toLowerCase();return u?`${i.title} ${i.desc} ${i.keywords}`.toLowerCase().includes(u):!0});return(u,d)=>l.value?(p(),g("div",{key:0,class:Oe(["border-b border-line py-4 last:border-0",t.block?"":"flex items-center justify-between gap-6"])},[r("div",{class:Oe(t.block?"mb-3":"min-w-0")},[r("div",um,k(t.title),1),t.desc?(p(),g("div",cm,k(t.desc),1)):R("",!0)],2),r("div",{class:Oe(t.block?"":"shrink-0")},[xf(u.$slots,"default")],2)],2)):R("",!0)}},dm=(t,i)=>{const o=t.__vccOpts||t;for(const[l,u]of i)o[l]=u;return o},fm={class:"mx-auto max-w-[1280px] p-7"},hm={class:"mb-5 flex flex-wrap items-end justify-between gap-4"},pm={class:"flex h-10 w-full max-w-[280px] items-center gap-2 rounded border border-line-strong bg-surface-1 px-3"},mm={class:"grid grid-cols-[210px_1fr] gap-6 max-[760px]:grid-cols-1"},gm={class:"flex flex-col gap-0.5 max-[760px]:flex-row max-[760px]:overflow-x-auto"},vm=["onClick"],_m={class:"whitespace-nowrap"},ym={class:"min-w-0"},bm={key:0,class:"panel p-10 text-center text-sm text-ink-muted"},xm={key:0,class:"eyebrow mb-2 mt-5 first:mt-0 flex items-center gap-2"},wm={key:1,class:"panel mb-5 p-5"},km={class:"flex items-center gap-1"},Sm={class:"flex items-center gap-2"},Tm={class:"font-mono text-sm text-ink"},Pm={class:"inline-flex items-center gap-1 rounded-full bg-amber-soft px-2 py-0.5 text-[11px] font-semibold text-amber-fg"},Cm={key:0,class:"mt-2 text-xs text-ink-muted"},Lm={class:"grid max-w-[420px] gap-2"},Mm={class:"flex items-center gap-3"},Em={key:2,class:"panel mb-5 p-5"},Om=["value"],zm=["value"],Am=["value"],$m={class:"font-mono text-sm text-ink"},Im={key:3},Dm={key:0,class:"mb-5 flex items-center gap-1 overflow-x-auto border-b border-line"},Nm=["onClick"],Rm={key:1,class:"panel mb-5 p-5"},Fm={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},Bm={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},Vm={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},Um={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"},Zm={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},Hm={key:0},jm={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},Wm={class:"font-semibold text-ink-secondary"},Km={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},Gm={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"},qm={class:"flex items-center justify-between gap-3"},Ym={class:"flex items-center gap-2 text-sm font-semibold text-ink"},Jm={key:0,class:"text-[11px] text-ink-muted"},Xm={class:"mt-2 flex items-baseline gap-1.5"},Qm={class:"font-mono text-2xl font-semibold text-ink"},eg={class:"text-sm text-ink-muted"},tg={class:"mt-2 h-2 w-full overflow-hidden rounded-full bg-line"},ng={class:"mt-2 text-xs text-ink-muted"},ig={class:"mt-2 text-sm text-ink"},sg={class:"font-semibold"},og={class:"mt-1 text-xs text-ink-muted"},ag={key:1,class:"mt-2 text-xs text-ink-muted"},rg={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},lg={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"},ug={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},cg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},dg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},fg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},hg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},pg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},mg={key:8,class:"border-b border-line py-3 text-xs text-amber-fg"},gg={class:"mt-4 flex flex-wrap items-center gap-3"},vg=["disabled"],_g=["disabled"],yg={key:2,class:"text-xs text-danger-fg"},bg={class:"panel mb-5 p-5"},xg={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},wg={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},kg={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},Sg={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"},Tg={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},Pg={key:0},Cg={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},Lg={class:"font-semibold text-ink-secondary"},Mg={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},Eg={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},Og={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},zg={key:0,class:"inline-flex items-center gap-2 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"},$g={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Ig={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Dg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Ng={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"},Rg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Fg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Bg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Vg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Ug={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"},Hg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},jg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Wg={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},Kg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Gg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},qg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Yg={class:"mt-4 flex flex-wrap items-center gap-3"},Jg=["disabled"],Xg=["disabled"],Qg={key:2,class:"text-xs text-danger-fg"},ev={key:3,class:"text-[11px] text-ink-muted"},tv={class:"panel mb-5 p-5"},nv={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},iv={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},sv={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},ov={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"},av={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},rv={key:0},lv={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},uv={class:"font-semibold text-ink-secondary"},cv={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},dv={key:0,class:"inline-flex items-center gap-2 break-all 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"},hv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},pv={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},mv={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"},vv={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"},yv={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"},xv={class:"mt-4 flex flex-wrap items-center gap-3"},wv=["disabled"],kv=["disabled"],Sv={key:2,class:"text-xs text-danger-fg"},Tv={key:3,class:"text-[11px] text-ink-muted"},Pv={key:3,class:"panel mb-5 p-5"},Cv={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},Lv={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},Mv={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},Ev={key:1,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},Ov={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"},zv={key:5,class:"border-b border-line py-3 text-xs text-amber-fg"},Av={key:0},$v={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},Iv={class:"font-semibold text-ink-secondary"},Dv={key:7,class:"border-b border-line py-3 text-xs text-ink-muted"},Nv={class:"flex w-full flex-col gap-2"},Rv={class:"break-all 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"},Bv={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"},Vv={key:0,class:"text-xs text-ink-muted"},Uv={key:1,class:"border-b border-line py-3 text-xs text-ink-muted"},Zv={key:0,class:"inline-flex items-center gap-2 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={class:"mt-4 flex flex-wrap items-center gap-3"},Wv=["disabled"],Kv=["disabled"],Gv={key:2,class:"text-xs text-danger-fg"},qv={key:3,class:"text-[11px] text-ink-muted"},Yv={key:4,class:"panel mb-5 p-5"},Jv={class:"flex items-center gap-4"},Xv=["src"],Qv={key:1,class:"grid h-16 w-16 place-items-center rounded-full bg-[var(--navy-800)] text-lg font-bold text-white"},e_={class:"flex gap-2"},t_={class:"btn-ghost cursor-pointer"},n_={class:"mt-1 text-right text-[11px] text-ink-muted"},i_={key:5,class:"panel mb-5 p-5"},s_={class:"flex items-center gap-3"},o_={key:0,class:"mt-4 rounded-lg border border-line bg-surface-2 p-4"},a_={class:"flex flex-wrap items-center gap-4"},r_={class:"min-w-0"},l_={class:"mt-1 select-all font-mono text-sm font-bold text-ink"},u_={class:"mt-3 flex items-center gap-2"},c_={key:0,class:"mt-2 text-xs text-danger-fg"},d_={key:1,class:"mt-4 rounded-lg border border-line bg-surface-2 p-4"},f_={class:"mt-2 grid grid-cols-2 gap-1 font-mono text-xs text-ink-secondary sm:grid-cols-4"},h_={class:"rounded-lg border border-line bg-surface-2 p-3"},p_={class:"flex items-center gap-3"},m_={class:"grid h-9 w-9 place-items-center rounded-full bg-accent-soft text-accent-soft-fg"},g_={class:"min-w-0 flex-1"},v_={class:"text-sm font-semibold text-ink"},__={class:"font-mono text-[11px] text-ink-muted"},y_={key:6,class:"mb-5"},b_={key:0,class:"panel mb-5 p-5"},x_={class:"grid max-w-[520px] gap-2"},w_={class:"flex flex-wrap gap-2"},k_=["disabled","title"],S_=["value"],T_=["value"],P_={class:"flex items-center gap-2 py-1 text-sm text-ink-secondary"},C_={class:"flex items-center gap-3"},L_=["disabled"],M_={key:0,class:"text-xs text-danger-fg"},E_={key:1,class:"text-xs text-ink-muted"},O_={key:1,class:"panel mb-5 p-5"},z_={class:"grid max-w-[520px] gap-2"},A_={class:"flex flex-wrap gap-2"},$_=["value"],I_=["value"],D_={key:1,class:"text-xs text-ink-muted"},N_={class:"font-semibold text-ink-secondary"},R_={class:"flex items-center gap-3"},F_=["disabled"],B_={key:0,class:"text-xs text-danger-fg"},V_={class:"panel overflow-hidden p-0"},U_={class:"flex items-center justify-between px-5 py-4"},Z_=["disabled"],H_={key:0,class:"px-5 pb-5 text-sm text-danger-fg"},j_={key:1,class:"px-5 pb-8 text-sm text-ink-muted"},W_={key:2,class:"overflow-x-auto"},K_={class:"w-full border-collapse text-sm"},G_={class:"text-left"},q_={class:"px-5 py-3"},Y_={class:"text-ink"},J_={key:0,class:"ml-1.5 text-[11px] text-ink-muted"},X_={class:"px-5 py-3"},Q_={class:"px-5 py-3"},ey={class:"px-5 py-3"},ty={class:"px-5 py-3 text-right"},ny=["onClick"],iy={key:1,class:"inline-flex items-center gap-1.5"},sy=["onClick"],oy=["onClick"],ay={key:7,class:"mb-5"},ry={key:0,class:"panel mb-5 p-5"},ly={class:"grid max-w-[520px] gap-2"},uy={class:"flex items-center gap-3"},cy={key:0,class:"text-xs text-danger-fg"},dy={key:1,class:"panel mb-5 p-5"},fy={class:"grid max-w-[520px] gap-2"},hy={class:"flex items-center gap-3"},py=["disabled"],my={key:0,class:"text-xs text-danger-fg"},gy={class:"panel overflow-hidden p-0"},vy={key:0,class:"px-5 pb-8 text-sm text-ink-muted"},_y={key:1,class:"overflow-x-auto"},yy={class:"w-full border-collapse text-sm"},by={class:"text-left"},xy={class:"px-5 py-3"},wy={class:"inline-flex items-center gap-2 text-ink"},ky={class:"px-5 py-3 text-ink-secondary"},Sy={class:"px-5 py-3 text-right"},Ty=["onClick"],Py={key:1,class:"inline-flex items-center gap-1.5"},Cy=["onClick"],Ly=["disabled","title","onClick"],My={key:8,class:"mb-5"},Ey={class:"panel mb-5 p-5"},Oy={class:"btn-ghost cursor-pointer"},zy={key:0,class:"mt-2 text-xs text-ink-muted"},Ay={class:"rounded-lg border p-5",style:{"border-color":"color-mix(in srgb, var(--danger) 35%, transparent)",background:"var(--danger-soft)"}},$y={class:"flex items-center gap-2 text-danger-fg"},Iy={class:"mt-4 rounded-lg border border-line bg-surface-1 p-4"},Dy={class:"mt-3 flex items-start gap-2 text-sm text-ink-secondary"},Ny={class:"mt-3"},Ry={class:"eyebrow mb-1 block"},Fy={class:"text-ink"},By=["placeholder"],Vy={class:"mt-4 flex flex-wrap items-center gap-3"},Uy=["disabled"],Zy=["disabled"],Hy={key:2,class:"text-xs text-ink-muted"},jy={key:0,class:"mt-3 rounded border border-line bg-surface-2 px-3 py-2 text-xs text-ink-secondary"},Wy={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"},du="pv.opensky.health",fu="pv.filetransfer.health",hu="pv.webdav.health",pu="pv.localstorage.health",Ky={__name:"Settings",props:{email:{type:String,default:""},role:{type:String,default:"user"},organization:{type:String,default:""},organizationName:{type:String,default:""}},emits:["logout"],setup(t,{emit:i}){const o=t,l=i,u=Pe(()=>o.role==="superadmin"),d=Pe(()=>o.role==="admin"||o.role==="superadmin");function h(x){return x==="superadmin"?"Superadmin":x==="admin"?"Admin":"User"}function _(x){return x==="superadmin"||x==="admin"?"shield":"user"}function y(x){return x==="superadmin"||x==="admin"?M.accent:M.neutral}const M={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=Pe(()=>{const x=[{id:"account",label:"Account",icon:"user",kw:"name username email password verification login credentials role"},{id:"appearance",label:"Appearance",icon:"sliders",kw:"theme light dark system language region font size accessibility date time format motion"},{id:"integrations",label:"Integrations",icon:"radio",kw:"opensky flights adsb aircraft plugin oauth credentials bounding box plan connection ftp sftp ftps file transfer server host upload download local storage folder drive isolated private read only webdav nextcloud owncloud dav url https"},{id:"profile",label:"Profile",icon:"image",kw:"avatar photo display name bio public"},{id:"security",label:"Privacy & Security",icon:"shield",kw:"two factor authentication 2fa sessions devices logout security privacy"}];return d.value&&x.push({id:"team",label:"User management",icon:"users",kw:"users team members add remove create delete role admin permissions rights organization"}),u.value&&x.push({id:"organizations",label:"Organizations",icon:"grid",kw:"organization org tenant company create rename delete members"}),x.push({id:"advanced",label:"Advanced",icon:"alertTriangle",kw:"export import data delete account danger zone",danger:!0}),x}),O=G("account"),B=G("");ju("settingsSearch",B);const V=Pe(()=>B.value.trim().length>0),Z=Pe(()=>B.value.trim().toLowerCase());function F(x){return Z.value?(x.label+" "+x.kw).toLowerCase().includes(Z.value)||ve(x.id):!0}const fe={account:["full name","username","email address verification verify","password change current new"],appearance:["theme light dark system","language","region","font size accessibility","reduce motion","date format","time format clock"],integrations:["opensky live flights","enable plugin","oauth client id secret","plan credits","bounding box","test connection","file transfer ftp sftp ftps","server host port username password","private key passphrase","base path directory","local storage folder drive","private isolated folder","read only access mode","webdav nextcloud owncloud dav","server url username password tls","base path directory folder"],profile:["profile photo avatar","display name","bio about","show email public"],security:["two factor authentication","active sessions devices","sign out"],team:["add user create account","members list role admin remove delete","organization org assign"],organizations:["add organization create","rename organization","delete organization members"],advanced:["export data download","import data upload","delete account permanent danger"]};function ve(x){return Z.value?(fe[x]||[]).some(f=>f.includes(Z.value)):!0}const q=Pe(()=>V.value?S.value.filter(F):S.value.filter(x=>x.id===O.value)),Ce=Pe({get:()=>Qi.value,set:x=>ha(x)}),he=[{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"}],Re=[{value:"12",label:"12-hour"},{value:"24",label:"24-hour"}],Ie=[["en","English"],["es","Español"],["de","Deutsch"],["fr","Français"],["pl","Polski"],["ja","日本語"]],Ue=[["US","United States"],["GB","United Kingdom"],["EU","European Union"],["CA","Canada"],["AU","Australia"],["JP","Japan"]],pe=[["MDY","MM/DD/YYYY"],["DMY","DD/MM/YYYY"],["YMD","YYYY/MM/DD"],["ISO","YYYY-MM-DD"]],Ae=G(Date.now());let Te=null;const te=Pe(()=>ru(Ae.value)),de=yt({loaded:!1,available:!1,orgEnabled:!0,allowAnonymous:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),ye=G("user"),Se=yt({clientId:"",clientSecret:"",plan:"",bbox:""}),ae=G(""),ue=G(!1),ie=G(!1),st=G(null),me=G(null),ze=Pe(()=>st.value&&st.value.credits||null),Je=Pe(()=>{const x=ze.value;return!x||!x.daily||x.remaining==null?null:Math.max(0,Math.min(100,Math.round(x.remaining/x.daily*100)))}),at=Pe(()=>{const x=Je.value;return x==null?"bg-accent":x<=10?"bg-danger":x<=30?"bg-amber":"bg-success"});function et(x){return typeof x=="number"?x.toLocaleString():x}function Ze(){if(!me.value)return"";const x=Math.max(0,Math.round((Date.now()-me.value)/1e3));if(x<60)return"just now";const f=Math.round(x/60);if(f<60)return`${f} min ago`;const Y=Math.round(f/60);return Y<24?`${Y} h ago`:`${Math.round(Y/24)} d ago`}function K(){try{st.value&&localStorage.setItem(du,JSON.stringify({health:st.value,ts:me.value}))}catch{}}function E(){try{const x=localStorage.getItem(du);if(!x)return;const f=JSON.parse(x);f&&f.health&&(st.value=f.health,me.value=f.ts||null)}catch{}}const A=[{value:"",label:"Not set"},{value:"anonymous",label:"Anonymous"},{value:"standard",label:"Standard"},{value:"contributor",label:"Contributor"}],nt=[{value:"user",label:"My settings",icon:"user"},{value:"org",label:"Organization",icon:"users"}],mt=Pe(()=>de.isSuperadmin),kt=Pe(()=>de.isSuperadmin?"user":ye.value),b=Pe(()=>de.scopes[kt.value]||{editableLayer:"user",fields:{}}),v=Pe(()=>kt.value==="org");function w(x){return b.value.fields[x]||{effective:"",own:"",source:"unset",locked:!1}}function W(x){return mt.value||w(x).locked}function H(x){const f=w(x).source;return f==="global"?"Set by administrator":f==="org"?"Set by your organization":""}function U(){Se.clientId=w("clientId").own||"",Se.clientSecret=w("clientSecret").own||"",Se.plan=w("plan").own||"",Se.bbox=w("bbox").own||""}function ne(x){de.available=!!x.available,de.orgEnabled=x.orgEnabled!==!1,de.allowAnonymous=!!x.allowAnonymous,de.enabled=!!x.enabled,de.canEditOrg=!!x.canEditOrg,de.isSuperadmin=!!x.isSuperadmin,de.scopes=x.scopes||{},ye.value==="org"&&!de.canEditOrg&&(ye.value="user"),U(),de.loaded=!0}zt(ye,()=>{ae.value="",U()});async function se(){E();const{ok:x,body:f}=await up();x&&ne(f)}async function ee(x){const f=v.value;f?de.orgEnabled=x:de.enabled=x;const{ok:Y,body:T}=await iu(f?{scope:"org",enabled:x}:{scope:"user",enabled:x});Y?(ne(T),Ye(f?x?"OpenSky enabled for your organization.":"OpenSky disabled for your organization.":x?"OpenSky enabled.":"OpenSky disabled.")):(f?de.orgEnabled=!x:de.enabled=!x,Ye(T.error||"Could not update."))}async function j(){ae.value="",ue.value=!0;const x={};for(const Qe of["clientId","clientSecret","plan","bbox"])W(Qe)||(x[Qe]=Se[Qe]);const f={scope:kt.value,config:x};v.value||(f.enabled=de.enabled);const{ok:Y,body:T}=await iu(f);if(ue.value=!1,!Y){ae.value=T.error||"Could not save settings.";return}ne(T),Ye(v.value?"Organization OpenSky settings saved.":"OpenSky settings saved.")}async function Me(){ie.value=!0,st.value=null;const{ok:x,body:f}=await cp();ie.value=!1,st.value=x&&f.health?f.health:{status:"down",detail:f.error||"Probe failed."},me.value=Date.now(),K()}function I(x){return x==="ok"?M.success:x==="degraded"?M.warning:M.danger}const P=yt({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),Q=G("user"),Ne=["protocol","host","port","username","password","privateKey","keyPassphrase","hostKeyFingerprint","insecureSkipVerify","basePath"],_e=yt(Object.fromEntries(Ne.map(x=>[x,""]))),We=G(""),rt=G(!1),le=G(!1),tt=G(null),wt=G(null),_n=[{value:"sftp",label:"SFTP"},{value:"ftps",label:"FTPS"},{value:"ftp",label:"FTP"}],di=[{value:"false",label:"Verify certificate"},{value:"true",label:"Skip verification"}],Tt=Pe(()=>P.isSuperadmin),Nt=Pe(()=>P.isSuperadmin?"user":Q.value),En=Pe(()=>P.scopes[Nt.value]||{editableLayer:"user",fields:{}}),Zt=Pe(()=>Nt.value==="org"),es=Pe(()=>(Ht("protocol")?$t("protocol").effective:_e.protocol)||"sftp");function $t(x){return En.value.fields[x]||{effective:"",own:"",source:"unset",locked:!1}}function Ht(x){return Tt.value||$t(x).locked}function xt(x){const f=$t(x).source;return f==="global"?"Set by administrator":f==="org"?"Set by your organization":""}function Pa(x){return(_n.find(f=>f.value===x)||{}).label||x||"—"}function wo(){for(const x of Ne)_e[x]=$t(x).own||"";_e.protocol||(_e.protocol="sftp"),_e.insecureSkipVerify||(_e.insecureSkipVerify="false")}function zs(x){P.available=!!x.available,P.orgEnabled=x.orgEnabled!==!1,P.enabled=!!x.enabled,P.canEditOrg=!!x.canEditOrg,P.isSuperadmin=!!x.isSuperadmin,P.scopes=x.scopes||{},Q.value==="org"&&!P.canEditOrg&&(Q.value="user"),wo(),P.loaded=!0}zt(Q,()=>{We.value="",wo()});function Ca(){if(!wt.value)return"";const x=Math.max(0,Math.round((Date.now()-wt.value)/1e3));if(x<60)return"just now";const f=Math.round(x/60);if(f<60)return`${f} min ago`;const Y=Math.round(f/60);return Y<24?`${Y} h ago`:`${Math.round(Y/24)} d ago`}function La(){try{tt.value&&localStorage.setItem(fu,JSON.stringify({health:tt.value,ts:wt.value}))}catch{}}function Ma(){try{const x=localStorage.getItem(fu);if(!x)return;const f=JSON.parse(x);f&&f.health&&(tt.value=f.health,wt.value=f.ts||null)}catch{}}async function As(){Ma();const{ok:x,body:f}=await fp();x&&zs(f)}async function ko(x){const f=Zt.value;f?P.orgEnabled=x:P.enabled=x;const{ok:Y,body:T}=await su(f?{scope:"org",enabled:x}:{scope:"user",enabled:x});Y?(zs(T),Ye(f?x?"File transfer enabled for your organization.":"File transfer disabled for your organization.":x?"File transfer enabled.":"File transfer disabled.")):(f?P.orgEnabled=!x:P.enabled=!x,Ye(T.error||"Could not update."))}async function Ea(){We.value="",rt.value=!0;const x={};for(const Qe of Ne)Ht(Qe)||(x[Qe]=_e[Qe]);const f={scope:Nt.value,config:x};Zt.value||(f.enabled=P.enabled);const{ok:Y,body:T}=await su(f);if(rt.value=!1,!Y){We.value=T.error||"Could not save settings.";return}zs(T),Ye(Zt.value?"Organization file-transfer settings saved.":"File-transfer settings saved.")}async function Oa(){le.value=!0,tt.value=null;const{ok:x,body:f}=await hp();le.value=!1,tt.value=x&&f.health?f.health:{status:"down",detail:f.error||"Probe failed."},wt.value=Date.now(),La()}function za(x){return x==="ok"?M.success:x==="degraded"?M.warning:M.danger}const Ke=yt({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),we=G("user"),ts=["baseURL","username","password","insecureSkipVerify","basePath"],It=yt(Object.fromEntries(ts.map(x=>[x,""]))),fi=G(""),Oi=G(!1),hi=G(!1),an=G(null),nn=G(null),So=[{value:"false",label:"Verify certificate"},{value:"true",label:"Skip verification"}],$s=Pe(()=>Ke.isSuperadmin),Is=Pe(()=>Ke.isSuperadmin?"user":we.value),Aa=Pe(()=>Ke.scopes[Is.value]||{editableLayer:"user",fields:{}}),rn=Pe(()=>Is.value==="org");function yn(x){return Aa.value.fields[x]||{effective:"",own:"",source:"unset",locked:!1}}function pi(x){return $s.value||yn(x).locked}function jt(x){const f=yn(x).source;return f==="global"?"Set by administrator":f==="org"?"Set by your organization":""}function To(){for(const x of ts)It[x]=yn(x).own||"";It.insecureSkipVerify||(It.insecureSkipVerify="false")}function Ds(x){Ke.available=!!x.available,Ke.orgEnabled=x.orgEnabled!==!1,Ke.enabled=!!x.enabled,Ke.canEditOrg=!!x.canEditOrg,Ke.isSuperadmin=!!x.isSuperadmin,Ke.scopes=x.scopes||{},we.value==="org"&&!Ke.canEditOrg&&(we.value="user"),To(),Ke.loaded=!0}zt(we,()=>{fi.value="",To()});function $a(){if(!nn.value)return"";const x=Math.max(0,Math.round((Date.now()-nn.value)/1e3));if(x<60)return"just now";const f=Math.round(x/60);if(f<60)return`${f} min ago`;const Y=Math.round(f/60);return Y<24?`${Y} h ago`:`${Math.round(Y/24)} d ago`}function Ia(){try{an.value&&localStorage.setItem(hu,JSON.stringify({health:an.value,ts:nn.value}))}catch{}}function Da(){try{const x=localStorage.getItem(hu);if(!x)return;const f=JSON.parse(x);f&&f.health&&(an.value=f.health,nn.value=f.ts||null)}catch{}}async function Ns(){Da();const{ok:x,body:f}=await gp();x&&Ds(f)}async function mi(x){const f=rn.value;f?Ke.orgEnabled=x:Ke.enabled=x;const{ok:Y,body:T}=await ou(f?{scope:"org",enabled:x}:{scope:"user",enabled:x});Y?(Ds(T),Ye(f?x?"WebDAV enabled for your organization.":"WebDAV disabled for your organization.":x?"WebDAV enabled.":"WebDAV disabled.")):(f?Ke.orgEnabled=!x:Ke.enabled=!x,Ye(T.error||"Could not update."))}async function Po(){fi.value="",Oi.value=!0;const x={};for(const Qe of ts)pi(Qe)||(x[Qe]=It[Qe]);const f={scope:Is.value,config:x};rn.value||(f.enabled=Ke.enabled);const{ok:Y,body:T}=await ou(f);if(Oi.value=!1,!Y){fi.value=T.error||"Could not save settings.";return}Ds(T),Ye(rn.value?"Organization WebDAV settings saved.":"WebDAV settings saved.")}async function Co(){hi.value=!0,an.value=null;const{ok:x,body:f}=await vp();hi.value=!1,an.value=x&&f.health?f.health:{status:"down",detail:f.error||"Probe failed."},nn.value=Date.now(),Ia()}function zi(x){return x==="ok"?M.success:x==="degraded"?M.warning:M.danger}const oe=yt({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,isOrgUser:!1,mounts:[],privateFolder:!1,privateEnabled:!1,allowPrivate:!0,rootConfigured:!1,scopes:{}}),lt=G("user"),jn=G(""),ln=G(""),bn=G(!1),gi=G(!1),Fe=G(null),ft=G(null),Wn=G({}),Ai=[{value:"",label:"Inherit"},{value:"false",label:"Read-write"},{value:"true",label:"Read-only"}],Rt=Pe(()=>oe.isSuperadmin),Rs=Pe(()=>oe.isSuperadmin?"user":lt.value),ns=Pe(()=>oe.scopes[Rs.value]||{editableLayer:"user",fields:{}}),Pt=Pe(()=>Rs.value==="org");function _t(x){return ns.value.fields[x]||{effective:"",own:"",source:"unset",locked:!1}}function On(x){return Rt.value||_t(x).locked}function vi(x){const f=_t(x).source;return f==="global"?"Set by administrator":f==="org"?"Set by your organization":""}function $i(x){return(Ai.find(f=>f.value===x)||{}).label||"Inherit"}function is(){jn.value=_t("readOnly").own||""}function xn(x){oe.available=!!x.available,oe.orgEnabled=x.orgEnabled!==!1,oe.enabled=!!x.enabled,oe.canEditOrg=!!x.canEditOrg,oe.isSuperadmin=!!x.isSuperadmin,oe.isOrgUser=!!x.isOrgUser,oe.mounts=Array.isArray(x.mounts)?x.mounts:[],oe.privateFolder=!!x.privateFolder,oe.privateEnabled=!!x.privateEnabled,oe.allowPrivate=x.allowPrivate!==!1,oe.rootConfigured=!!x.rootConfigured,oe.scopes=x.scopes||{},lt.value==="org"&&!oe.canEditOrg&&(lt.value="user"),is(),oe.loaded=!0}zt(lt,()=>{ln.value="",is()});function Fs(){if(!ft.value)return"";const x=Math.max(0,Math.round((Date.now()-ft.value)/1e3));if(x<60)return"just now";const f=Math.round(x/60);if(f<60)return`${f} min ago`;const Y=Math.round(f/60);return Y<24?`${Y} h ago`:`${Math.round(Y/24)} d ago`}function Bs(){try{Fe.value&&localStorage.setItem(pu,JSON.stringify({health:Fe.value,ts:ft.value}))}catch{}}function ss(){try{const x=localStorage.getItem(pu);if(!x)return;const f=JSON.parse(x);f&&f.health&&(Fe.value=f.health,ft.value=f.ts||null)}catch{}}async function Vs(){ss();const{ok:x,body:f}=await pp();x&&xn(f)}async function os(x){const f=Pt.value;f?oe.orgEnabled=x:oe.enabled=x;const{ok:Y,body:T}=await Qo(f?{scope:"org",enabled:x}:{scope:"user",enabled:x});Y?(xn(T),Ye(f?x?"Local storage enabled for your organization.":"Local storage disabled for your organization.":x?"Local storage enabled.":"Local storage disabled.")):(f?oe.orgEnabled=!x:oe.enabled=!x,Ye(T.error||"Could not update."))}async function as(x){oe.privateFolder=x;const{ok:f,body:Y}=await Qo({scope:"user",privateFolder:x});f?(xn(Y),Ye(x?"Private folder enabled.":"Private folder disabled.")):(oe.privateFolder=!x,Ye(Y.error||"Could not update."))}async function Lo(x){oe.allowPrivate=x;const{ok:f,body:Y}=await Qo({scope:"org",allowPrivate:x});f?(xn(Y),Ye(x?"Members may now create private folders.":"Private folders disabled for your organization.")):(oe.allowPrivate=!x,Ye(Y.error||"Could not update."))}async function Us(){ln.value="",bn.value=!0;const x={};On("readOnly")||(x.readOnly=jn.value);const f={scope:Rs.value,config:x};Pt.value||(f.enabled=oe.enabled);const{ok:Y,body:T}=await Qo(f);if(bn.value=!1,!Y){ln.value=T.error||"Could not save settings.";return}xn(T),Ye(Pt.value?"Organization local-storage settings saved.":"Local-storage settings saved.")}async function Na(){gi.value=!0,Fe.value=null,Wn.value={};const{ok:x,body:f}=await mp();gi.value=!1,Fe.value=x&&f.health?f.health:{status:"down",detail:f.error||"Probe failed."};const Y={};if(Array.isArray(f.mounts))for(const T of f.mounts)Y[T.id]={status:T.status,detail:T.detail};Wn.value=Y,ft.value=Date.now(),Bs()}function He(x){return x==="ok"?M.success:x==="degraded"?M.warning:M.danger}const un=[{id:"apis-external",label:"APIs — External",icon:"globe"},{id:"drives-external",label:"Drives — External",icon:"server"},{id:"drives-local",label:"Drives — Local",icon:"monitor"}],ut=G("apis-external");function rs(x){return V.value||ut.value===x}const _i=G("");let Ii=null;function Ye(x){_i.value=x,clearTimeout(Ii),Ii=setTimeout(()=>_i.value="",2200)}const St=yt({current:"",next:"",confirm:""}),zn=G(""),yi=G(!1);function Lt(){if(yi.value=!1,!St.current)return zn.value="Enter your current password.";if(St.next.length<8)return zn.value="New password must be at least 8 characters.";if(St.next!==St.confirm)return zn.value="New passwords do not match.";zn.value="Validated. Connecting to the account service is pending — no password endpoint yet.",St.current=St.next=St.confirm=""}const wn=G("");function Mo(){wn.value="Verification link would be sent once the account service is wired up."}function Eo(x){const f=x.target.files&&x.target.files[0];if(!f)return;if(f.size>1.5*1024*1024){Ye("Image too large (max ~1.5 MB).");return}const Y=new FileReader;Y.onload=()=>{ke.avatar=String(Y.result),Ye("Photo updated.")},Y.readAsDataURL(f)}function Ra(){ke.avatar="",Ye("Photo removed.")}const Oo=Pe(()=>{var Y,T,Qe;const f=(ke.displayName||ke.name||o.email||"PV").split("@")[0].split(/[.\-_ ]+/).filter(Boolean);return((((Y=f[0])==null?void 0:Y[0])||"P")+(((T=f[1])==null?void 0:T[0])||((Qe=f[0])==null?void 0:Qe[1])||"V")).toUpperCase()}),Kn=G(!1),zo=G(""),Di=G(""),Ge=G(""),ls=G([]);function Wt(x){const f="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";let Y="";for(let T=0;TWt(4).toLowerCase()+"-"+Wt(4).toLowerCase()),Ge.value=""}function Fa(){ke.twoFactor=!1,ls.value=[],Kn.value=!1}const Xt=navigator.userAgent;function Ba(){return/Edg\//.test(Xt)?"Edge":/OPR\//.test(Xt)?"Opera":/Chrome\//.test(Xt)?"Chrome":/Firefox\//.test(Xt)?"Firefox":/Safari\//.test(Xt)?"Safari":"Browser"}function $o(){return/Windows/.test(Xt)?"Windows":/Mac OS X/.test(Xt)?"macOS":/Android/.test(Xt)?"Android":/iPhone|iPad/.test(Xt)?"iOS":/Linux/.test(Xt)?"Linux":"Unknown OS"}const Va=Date.now(),us=G([]),Gn=G(!1),cs=G(""),ht=yt({email:"",password:"",role:"user",organization:""}),bi=G(""),Ri=G(!1),Qt=G(""),Zs=Pe(()=>{const x=[{value:"user",label:"User"},{value:"admin",label:"Admin"}];return u.value&&x.push({value:"superadmin",label:"Superadmin"}),x}),Fi=G([]);async function qn(){if(!d.value)return;const x=await ip();x.ok&&(Fi.value=x.organizations.slice().sort((f,Y)=>f.name.localeCompare(Y.name)))}const Io=Pe(()=>{const x=Fi.value.map(f=>({value:f.id,label:f.name}));return u.value&&x.unshift({value:"",label:"No organization"}),x});async function Yn(){if(!d.value)return;Gn.value=!0,cs.value="";const x=await Qh();if(Gn.value=!1,!x.ok){cs.value=x.status===403?"Manager role required.":"Could not load users.";return}us.value=x.users.slice().sort((f,Y)=>f.email.localeCompare(Y.email))}function Bi(x){try{const f=x.data||{},Y=Object.keys(f)[0];return Y&&f[Y]&&f[Y].message||x.message||x.error||"Invalid input."}catch{return x.error||"Could not create user."}}async function Ua(){bi.value="";const x=ht.email.trim().toLowerCase();if(!x.includes("@"))return bi.value="Enter a valid email.";if(ht.password.length<8)return bi.value="Password must be at least 8 characters.";Ri.value=!0;const f=u.value?ht.organization:o.organization,{ok:Y,body:T}=await ep(x,ht.password,ht.role,f);if(Ri.value=!1,!Y)return bi.value=Bi(T);ht.email="",ht.password="",ht.role="user",ht.organization="",Ye("User created."),Yn()}async function Za(x){const{ok:f,body:Y}=await np(x.id);if(Qt.value="",!f)return Ye(Y.error||"Could not remove user.");Ye("User removed."),Yn()}const Xe=yt({id:"",email:"",role:"user",verified:!1,password:"",organization:""}),An=G(""),Vi=G(!1),ds=Pe(()=>!!Xe.id&&Xe.email===o.email);function fs(x){Qt.value="",Xe.id=x.id,Xe.email=x.email,Xe.role=x.role||"user",Xe.verified=!!x.verified,Xe.password="",Xe.organization=x.organization||"",An.value=""}function $n(){Xe.id="",An.value=""}async function Ha(){An.value="";const x=Xe.email.trim().toLowerCase();if(!x.includes("@"))return An.value="Enter a valid email.";if(Xe.password&&Xe.password.length<8)return An.value="New password must be at least 8 characters (or leave blank).";const f={email:x,role:Xe.role,verified:Xe.verified};u.value&&(f.organization=Xe.organization),Xe.password&&(f.password=Xe.password),Vi.value=!0;const{ok:Y,body:T}=await tp(Xe.id,f);if(Vi.value=!1,!Y)return An.value=Bi(T);Ye("User updated."),$n(),Yn()}const In=yt({name:""}),Et=G(""),Ui=G(!1),xi=G(""),kn=yt({id:"",name:""}),Sn=G(""),Zi=Pe(()=>{const x={};for(const f of us.value)f.organization&&(x[f.organization]=(x[f.organization]||0)+1);return x});async function Do(){Et.value="";const x=In.name.trim();if(!x)return Et.value="Enter an organization name.";Ui.value=!0;const{ok:f,body:Y}=await sp(x);if(Ui.value=!1,!f)return Et.value=Bi(Y);In.name="",Ye("Organization created."),qn()}function ja(x){xi.value="",kn.id=x.id,kn.name=x.name,Sn.value=""}function Hs(){kn.id="",Sn.value=""}async function No(){Sn.value="";const x=kn.name.trim();if(!x)return Sn.value="Enter an organization name.";const{ok:f,body:Y}=await op(kn.id,x);if(!f)return Sn.value=Bi(Y);Ye("Organization renamed."),Hs(),qn(),Yn()}async function sn(x){const{ok:f,body:Y}=await ap(x.id);if(xi.value="",!f)return Ye(Y.error||"Could not delete organization.");Ye("Organization deleted."),qn()}function wi(){const x={_app:"PilotVault",_kind:"settings-export",exportedAt:new Date().toISOString(),email:o.email,prefs:{...ke},themeMode:Qi.value},f=new Blob([JSON.stringify(x,null,2)],{type:"application/json"}),Y=URL.createObjectURL(f),T=document.createElement("a");T.href=Y,T.download=`pilotvault-settings-${new Date().toISOString().slice(0,10)}.json`,document.body.appendChild(T),T.click(),T.remove(),URL.revokeObjectURL(Y),Ye("Settings exported.")}const hs=G("");function Tn(x){const f=x.target.files&&x.target.files[0];if(!f)return;const Y=new FileReader;Y.onload=()=>{try{const T=JSON.parse(String(Y.result)),Qe=T.prefs||T;if(!Nc(Qe))throw new Error("bad shape");T.themeMode&&ha(T.themeMode),Ur(ke.fontSize),Zr(ke.reduceMotion),hs.value="Settings imported and applied."}catch{hs.value="That file is not a valid PilotVault settings export."}},Y.readAsText(f),x.target.value=""}const gt=yt({understand:!1,typed:"",cooldown:0,armed:!1,msg:""});let cn=null;const js=Pe(()=>o.email||"DELETE MY ACCOUNT"),Jn=Pe(()=>gt.understand&>.typed===js.value);function Ro(){Jn.value&&(gt.armed=!0,gt.cooldown=5,clearInterval(cn),cn=setInterval(()=>{gt.cooldown--,gt.cooldown<=0&&clearInterval(cn)},1e3))}zt(Jn,x=>{!x&>.armed&&(gt.armed=!1,gt.cooldown=0,clearInterval(cn))});function ps(){if(!(!gt.armed||gt.cooldown>0)){try{localStorage.removeItem("pv_prefs")}catch{}gt.msg="Account deletion requires the account service. Local data was cleared and you were signed out.",setTimeout(()=>l("logout"),900)}}return ui(()=>{Te=setInterval(()=>Ae.value=Date.now(),1e3),qn(),Yn(),se(),As(),Ns(),Vs()}),Os(()=>{clearInterval(Te),clearInterval(cn),clearTimeout(Ii)}),(x,f)=>(p(),g("div",fm,[r("div",hm,[f[62]||(f[62]=r("div",null,[r("div",{class:"eyebrow"},"Preferences"),r("h2",{class:"mt-0.5 text-[22px] font-bold tracking-tightest text-ink"},"Settings")],-1)),r("div",pm,[z(X,{name:"search",size:16,class:"text-ink-muted"}),re(r("input",{"onUpdate:modelValue":f[0]||(f[0]=Y=>B.value=Y),placeholder:"Search settings…",class:"w-full border-none bg-transparent text-sm text-ink outline-none placeholder:text-ink-muted"},null,512),[[xe,B.value]]),B.value?(p(),g("button",{key:0,class:"text-ink-muted hover:text-ink","aria-label":"Clear search",onClick:f[1]||(f[1]=Y=>B.value="")},[z(X,{name:"x",size:15})])):R("",!0)])]),r("div",mm,[re(r("nav",gm,[(p(!0),g(ce,null,Ve(S.value,Y=>(p(),g("button",{key:Y.id,class:Oe(["flex items-center gap-2.5 rounded px-3 py-2.5 text-left text-sm transition",[O.value===Y.id?Y.danger?"bg-danger-soft font-semibold text-danger-fg":"bg-accent-soft font-semibold text-accent-soft-fg":Y.danger?"font-medium text-danger-fg hover:bg-danger-soft":"font-medium text-ink-secondary hover:bg-surface-2"]]),onClick:T=>O.value=Y.id},[z(X,{name:Y.icon,size:17},null,8,["name"]),r("span",_m,k(Y.label),1)],10,vm))),128))],512),[[yh,!V.value]]),r("div",ym,[V.value&&!q.value.length?(p(),g("div",bm," No settings match “"+k(B.value)+"”. ",1)):R("",!0),(p(!0),g(ce,null,Ve(q.value,Y=>(p(),g(ce,{key:Y.id},[V.value?(p(),g("div",xm,[z(X,{name:Y.icon,size:14},null,8,["name"]),D(" "+k(Y.label),1)])):R("",!0),Y.id==="account"?(p(),g("div",wm,[z(Ee,{title:"Full name",desc:"Shown to your team on flights and audit logs.",keywords:"full name account"},{default:Le(()=>[re(r("input",{"onUpdate:modelValue":f[2]||(f[2]=T=>$e(ke).name=T),class:"field w-56",placeholder:"Jane Operator",onBlur:f[3]||(f[3]=T=>Ye("Saved."))},null,544),[[xe,$e(ke).name]])]),_:1}),z(Ee,{title:"Username",desc:"Your unique handle within PilotVault.",keywords:"username handle"},{default:Le(()=>[r("div",km,[f[63]||(f[63]=r("span",{class:"text-sm text-ink-muted"},"@",-1)),re(r("input",{"onUpdate:modelValue":f[4]||(f[4]=T=>$e(ke).username=T),class:"field w-48",placeholder:"jane",onBlur:f[5]||(f[5]=T=>Ye("Saved."))},null,544),[[xe,$e(ke).username]])])]),_:1}),z(Ee,{title:"Email address",desc:"Used for sign-in and notifications.",keywords:"email verification verify"},{default:Le(()=>[r("div",Sm,[r("span",Tm,k(t.email||"—"),1),r("span",Pm,[z(X,{name:"mail",size:12}),f[64]||(f[64]=D(" Unverified ",-1))])])]),_:1}),z(Ee,{title:"Role",desc:"Your access level in PilotVault.",keywords:"role admin user superadmin access rights permissions"},{default:Le(()=>[r("span",{class:Oe(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",y(t.role)])},[z(X,{name:_(t.role),size:12},null,8,["name"]),D(k(h(t.role)),1)],2)]),_:1}),z(Ee,{title:"Organization",desc:"The organization your account belongs to.",keywords:"organization org tenant company"},{default:Le(()=>[r("span",{class:Oe(["text-sm",t.organizationName?"text-ink":"text-ink-muted"])},k(t.organizationName||(u.value?"All organizations":"None")),3)]),_:1}),z(Ee,{block:"",title:"Verify email",desc:"Confirm ownership to enable password resets and alerts.",keywords:"verify email resend"},{default:Le(()=>[r("button",{class:"btn-ghost",onClick:Mo},"Send verification link"),wn.value?(p(),g("p",Cm,k(wn.value),1)):R("",!0)]),_:1}),z(Ee,{block:"",title:"Change password",desc:"Use at least 8 characters.",keywords:"password change current new"},{default:Le(()=>[r("div",Lm,[re(r("input",{"onUpdate:modelValue":f[6]||(f[6]=T=>St.current=T),type:"password",class:"field",placeholder:"Current password"},null,512),[[xe,St.current]]),re(r("input",{"onUpdate:modelValue":f[7]||(f[7]=T=>St.next=T),type:"password",class:"field",placeholder:"New password"},null,512),[[xe,St.next]]),re(r("input",{"onUpdate:modelValue":f[8]||(f[8]=T=>St.confirm=T),type:"password",class:"field",placeholder:"Confirm new password"},null,512),[[xe,St.confirm]]),r("div",Mm,[r("button",{class:"btn-accent",onClick:Lt},"Update password"),zn.value?(p(),g("span",{key:0,class:Oe(["text-xs",yi.value?"text-success-fg":"text-ink-muted"])},k(zn.value),3)):R("",!0)])])]),_:1})])):Y.id==="appearance"?(p(),g("div",Em,[z(Ee,{title:"Theme",desc:"Light, dark, or follow your system.",keywords:"theme light dark system appearance"},{default:Le(()=>[z(hn,{modelValue:Ce.value,"onUpdate:modelValue":f[9]||(f[9]=T=>Ce.value=T),options:he},null,8,["modelValue"])]),_:1}),z(Ee,{title:"Font size",desc:"Scales the entire interface for readability.",keywords:"font size accessibility text"},{default:Le(()=>[z(hn,{modelValue:$e(ke).fontSize,"onUpdate:modelValue":f[10]||(f[10]=T=>$e(ke).fontSize=T),options:be},null,8,["modelValue"])]),_:1}),z(Ee,{title:"Reduce motion",desc:"Minimise animations and transitions.",keywords:"reduce motion accessibility animation"},{default:Le(()=>[z(tn,{modelValue:$e(ke).reduceMotion,"onUpdate:modelValue":f[11]||(f[11]=T=>$e(ke).reduceMotion=T)},null,8,["modelValue"])]),_:1}),z(Ee,{title:"Language",desc:"Interface language.",keywords:"language locale"},{default:Le(()=>[re(r("select",{"onUpdate:modelValue":f[12]||(f[12]=T=>$e(ke).language=T),class:"field w-48"},[(p(),g(ce,null,Ve(Ie,([T,Qe])=>r("option",{key:T,value:T},k(Qe),9,Om)),64))],512),[[Mt,$e(ke).language]])]),_:1}),z(Ee,{title:"Region",desc:"Affects number, unit and date defaults.",keywords:"region country locale"},{default:Le(()=>[re(r("select",{"onUpdate:modelValue":f[13]||(f[13]=T=>$e(ke).region=T),class:"field w-48"},[(p(),g(ce,null,Ve(Ue,([T,Qe])=>r("option",{key:T,value:T},k(Qe),9,zm)),64))],512),[[Mt,$e(ke).region]])]),_:1}),z(Ee,{title:"Date format",desc:"How calendar dates are displayed.",keywords:"date format"},{default:Le(()=>[re(r("select",{"onUpdate:modelValue":f[14]||(f[14]=T=>$e(ke).dateFormat=T),class:"field w-48"},[(p(),g(ce,null,Ve(pe,([T,Qe])=>r("option",{key:T,value:T},k(Qe),9,Am)),64))],512),[[Mt,$e(ke).dateFormat]])]),_:1}),z(Ee,{title:"Time format",desc:"12- or 24-hour clock.",keywords:"time format clock 12 24 hour"},{default:Le(()=>[z(hn,{modelValue:$e(ke).timeFormat,"onUpdate:modelValue":f[15]||(f[15]=T=>$e(ke).timeFormat=T),options:Re},null,8,["modelValue"])]),_:1}),z(Ee,{title:"Preview",desc:"How timestamps appear across the app.",keywords:"preview date time"},{default:Le(()=>[r("span",$m,k(te.value),1)]),_:1}),f[65]||(f[65]=r("p",{class:"mt-3 text-xs text-ink-muted"}," Language & region are stored now; full localisation ships with the account service. ",-1))])):Y.id==="integrations"?(p(),g("div",Im,[V.value?R("",!0):(p(),g("div",Dm,[(p(),g(ce,null,Ve(un,T=>r("button",{key:T.id,type:"button",class:Oe(["-mb-px inline-flex items-center gap-1.5 whitespace-nowrap border-b-2 px-3 py-2 text-sm font-semibold transition",ut.value===T.id?"border-accent text-ink":"border-transparent text-ink-secondary hover:text-ink"]),onClick:Qe=>ut.value=T.id},[z(X,{name:T.icon,size:16},null,8,["name"]),D(k(T.label),1)],10,Nm)),64))])),rs("apis-external")?(p(),g("div",Rm,[r("div",Fm,[r("div",Bm,[z(X,{name:"radio",size:20})]),f[66]||(f[66]=r("div",{class:"min-w-0"},[r("div",{class:"text-sm font-semibold text-ink"},"OpenSky Network"),r("div",{class:"mt-0.5 text-xs text-ink-muted"}," Live ADS-B aircraft data. Configure your own OAuth2 credentials, plan and default bounding box. ")],-1))]),de.loaded&&!de.available?(p(),g("div",Vm,[z(X,{name:"lock",size:14,class:"mr-1 inline"}),f[67]||(f[67]=D(" OpenSky is currently disabled by your administrator. Contact them to enable it. ",-1))])):R("",!0),de.canEditOrg?(p(),g("div",Um,[f[68]||(f[68]=r("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),z(hn,{modelValue:ye.value,"onUpdate:modelValue":f[16]||(f[16]=T=>ye.value=T),options:nt},null,8,["modelValue"])])):R("",!0),v.value?(p(),it(Ee,{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:Le(()=>[z(tn,{"model-value":de.orgEnabled,disabled:!de.available,"onUpdate:modelValue":ee},null,8,["model-value","disabled"])]),_:1})):(p(),it(Ee,{key:3,title:"Enable OpenSky",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin opensky"},{default:Le(()=>[z(tn,{"model-value":de.enabled,disabled:!de.available||!de.orgEnabled,"onUpdate:modelValue":ee},null,8,["model-value","disabled"])]),_:1})),!v.value&&de.available&&!de.orgEnabled?(p(),g("div",Zm,[z(X,{name:"lock",size:13,class:"mr-1 inline"}),f[70]||(f[70]=D("OpenSky is turned off for your organization",-1)),de.canEditOrg?(p(),g("span",Hm,[...f[69]||(f[69]=[D(" — switch to ",-1),r("span",{class:"font-semibold"},"Organization",-1),D(" to turn it back on",-1)])])):R("",!0),f[71]||(f[71]=D(". ",-1))])):R("",!0),v.value?(p(),g("div",jm,[z(X,{name:"users",size:13,class:"mr-1 inline"}),f[72]||(f[72]=D("These are organization-wide settings — they apply to everyone in ",-1)),r("span",Wm,k(t.organizationName||"your organization"),1),f[73]||(f[73]=D(". Leave a field blank to let each user choose their own; a value set here overrides the user's. ",-1))])):mt.value?(p(),g("div",Km," As a superadmin you manage the global OpenSky configuration in the API Server panel. The effective configuration is shown below. ")):R("",!0),de.available&&!v.value?(p(),g("div",Gm,[r("div",qm,[r("div",Ym,[z(X,{name:"signal",size:15}),f[74]||(f[74]=D("Credit usage ",-1))]),me.value?(p(),g("span",Jm,"Checked "+k(Ze()),1)):R("",!0)]),ze.value?(p(),g(ce,{key:0},[ze.value.remaining!=null?(p(),g(ce,{key:0},[r("div",Xm,[r("span",Qm,k(et(ze.value.remaining)),1),r("span",eg,"/ "+k(et(ze.value.daily))+" credits left today",1)]),r("div",tg,[r("div",{class:Oe(["h-full rounded-full transition-all",at.value]),style:Cs({width:Je.value+"%"})},null,6)]),r("div",ng," Used "+k(et(ze.value.daily-ze.value.remaining))+" today · "+k(ze.value.probeCost)+" credit"+k(ze.value.probeCost===1?"":"s")+" per query · "+k(ze.value.mode),1)],64)):(p(),g(ce,{key:1},[r("div",ig,[f[75]||(f[75]=D("Daily allowance: ",-1)),r("span",sg,k(et(ze.value.daily)),1),f[76]||(f[76]=D(" credits",-1))]),r("div",og,k(ze.value.probeCost)+" credit"+k(ze.value.probeCost===1?"":"s")+" per query · "+k(ze.value.mode)+". OpenSky only reports live remaining credits for authenticated requests — add OAuth2 credentials below to track usage. ",1)],64))],64)):(p(),g("div",ag,[...f[77]||(f[77]=[D(" Run ",-1),r("span",{class:"font-semibold text-ink-secondary"},"Test connection",-1),D(" below to fetch your live OpenSky credit balance. ",-1)])]))])):R("",!0),z(Ee,{title:"OpenSky plan",desc:"Your account tier — sets the daily credit allowance.",keywords:"plan tier credits"},{default:Le(()=>[W("plan")?(p(),g("span",rg,[D(k((A.find(T=>T.value===w("plan").effective)||{}).label||w("plan").effective||"—")+" ",1),H("plan")?(p(),g("span",lg,[z(X,{name:"lock",size:10}),D(k(H("plan")),1)])):R("",!0)])):(p(),it(hn,{key:1,modelValue:Se.plan,"onUpdate:modelValue":f[17]||(f[17]=T=>Se.plan=T),options:A},null,8,["modelValue"]))]),_:1}),z(Ee,{title:"Default bounding box",desc:"lamin,lomin,lamax,lomax — used for live queries and the health probe.",keywords:"bounding box bbox area"},{default:Le(()=>[W("bbox")?(p(),g("span",ug,[D(k(w("bbox").effective||"—")+" ",1),H("bbox")?(p(),g("span",cg,[z(X,{name:"lock",size:10}),D(k(H("bbox")),1)])):R("",!0)])):re((p(),g("input",{key:1,"onUpdate:modelValue":f[18]||(f[18]=T=>Se.bbox=T),class:"field w-64 font-mono",placeholder:"50.5,3.2,53.7,7.3"},null,512)),[[xe,Se.bbox]])]),_:1}),z(Ee,{title:"OAuth2 client ID",desc:"Optional — leave blank for anonymous access (lower limits).",keywords:"oauth client id credentials"},{default:Le(()=>[W("clientId")?(p(),g("span",dg,[D(k(w("clientId").effective||"—")+" ",1),H("clientId")?(p(),g("span",fg,[z(X,{name:"lock",size:10}),D(k(H("clientId")),1)])):R("",!0)])):re((p(),g("input",{key:1,"onUpdate:modelValue":f[19]||(f[19]=T=>Se.clientId=T),class:"field w-64",placeholder:"your-api-client"},null,512)),[[xe,Se.clientId]])]),_:1}),z(Ee,{title:"OAuth2 client secret",desc:"Paired with the client ID for authenticated access.",keywords:"oauth client secret credentials password"},{default:Le(()=>[W("clientSecret")?(p(),g("span",hg,[D(k(w("clientSecret").effective||"—")+" ",1),H("clientSecret")?(p(),g("span",pg,[z(X,{name:"lock",size:10}),D(k(H("clientSecret")),1)])):R("",!0)])):re((p(),g("input",{key:1,"onUpdate:modelValue":f[20]||(f[20]=T=>Se.clientSecret=T),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[xe,Se.clientSecret]])]),_:1}),de.available&&!de.allowAnonymous?(p(),g("div",mg," Anonymous access is disabled by the administrator — OpenSky needs OAuth2 credentials from some layer to work. ")):R("",!0),r("div",gg,[mt.value?R("",!0):(p(),g("button",{key:0,class:"btn-accent",disabled:ue.value||!de.available,onClick:j},k(ue.value?"Saving…":v.value?"Save organization settings":"Save settings"),9,vg)),v.value?R("",!0):(p(),g("button",{key:1,class:"btn-ghost",disabled:ie.value||!de.available,onClick:Me},k(ie.value?"Testing…":"Test connection"),9,_g)),ae.value?(p(),g("span",yg,k(ae.value),1)):R("",!0),st.value&&!v.value?(p(),g("span",{key:3,class:Oe(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",I(st.value.status)])},[f[78]||(f[78]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(k(st.value.detail||st.value.status),1)],2)):R("",!0)])])):R("",!0),rs("drives-external")?(p(),g(ce,{key:2},[r("div",bg,[r("div",xg,[r("div",wg,[z(X,{name:"server",size:20})]),f[79]||(f[79]=r("div",{class:"min-w-0"},[r("div",{class:"text-sm font-semibold text-ink"},"File Transfer (FTP / SFTP)"),r("div",{class:"mt-0.5 text-xs text-ink-muted"}," Connect to an FTP, FTPS or SFTP server. Configure the connection your account uses for file transfers. ")],-1))]),P.loaded&&!P.available?(p(),g("div",kg,[z(X,{name:"lock",size:14,class:"mr-1 inline"}),f[80]||(f[80]=D(" File transfer is currently disabled by your administrator. Contact them to enable it. ",-1))])):R("",!0),P.canEditOrg?(p(),g("div",Sg,[f[81]||(f[81]=r("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),z(hn,{modelValue:Q.value,"onUpdate:modelValue":f[21]||(f[21]=T=>Q.value=T),options:nt},null,8,["modelValue"])])):R("",!0),Zt.value?(p(),it(Ee,{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:Le(()=>[z(tn,{"model-value":P.orgEnabled,disabled:!P.available,"onUpdate:modelValue":ko},null,8,["model-value","disabled"])]),_:1})):(p(),it(Ee,{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:Le(()=>[z(tn,{"model-value":P.enabled,disabled:!P.available||!P.orgEnabled,"onUpdate:modelValue":ko},null,8,["model-value","disabled"])]),_:1})),!Zt.value&&P.available&&!P.orgEnabled?(p(),g("div",Tg,[z(X,{name:"lock",size:13,class:"mr-1 inline"}),f[83]||(f[83]=D("File transfer is turned off for your organization",-1)),P.canEditOrg?(p(),g("span",Pg,[...f[82]||(f[82]=[D(" — switch to ",-1),r("span",{class:"font-semibold"},"Organization",-1),D(" to turn it back on",-1)])])):R("",!0),f[84]||(f[84]=D(". ",-1))])):R("",!0),Zt.value?(p(),g("div",Cg,[z(X,{name:"users",size:13,class:"mr-1 inline"}),f[85]||(f[85]=D("These are organization-wide settings — they apply to everyone in ",-1)),r("span",Lg,k(t.organizationName||"your organization"),1),f[86]||(f[86]=D(". Leave the connection blank to let each user configure their own; a connection set here overrides the user's. ",-1))])):Tt.value?(p(),g("div",Mg," As a superadmin you manage the global file-transfer configuration in the API Server panel. The effective configuration is shown below. ")):R("",!0),z(Ee,{title:"Protocol",desc:"SFTP (over SSH), FTPS (FTP over TLS), or plain FTP.",keywords:"protocol sftp ftps ftp"},{default:Le(()=>[Ht("protocol")?(p(),g("span",Eg,[D(k(Pa($t("protocol").effective))+" ",1),xt("protocol")?(p(),g("span",Og,[z(X,{name:"lock",size:10}),D(k(xt("protocol")),1)])):R("",!0)])):(p(),it(hn,{key:1,modelValue:_e.protocol,"onUpdate:modelValue":f[22]||(f[22]=T=>_e.protocol=T),options:_n},null,8,["modelValue"]))]),_:1}),z(Ee,{title:"Host",desc:"Server hostname or IP address.",keywords:"host server address"},{default:Le(()=>[Ht("host")?(p(),g("span",zg,[D(k($t("host").effective||"—")+" ",1),xt("host")?(p(),g("span",Ag,[z(X,{name:"lock",size:10}),D(k(xt("host")),1)])):R("",!0)])):re((p(),g("input",{key:1,"onUpdate:modelValue":f[23]||(f[23]=T=>_e.host=T),class:"field w-64",placeholder:"files.example.com"},null,512)),[[xe,_e.host]])]),_:1}),z(Ee,{title:"Port",desc:"Leave blank for the protocol default (22 for SFTP, 21 for FTP/FTPS).",keywords:"port"},{default:Le(()=>[Ht("port")?(p(),g("span",$g,[D(k($t("port").effective||"default")+" ",1),xt("port")?(p(),g("span",Ig,[z(X,{name:"lock",size:10}),D(k(xt("port")),1)])):R("",!0)])):re((p(),g("input",{key:1,"onUpdate:modelValue":f[24]||(f[24]=T=>_e.port=T),inputmode:"numeric",class:"field w-24 font-mono",placeholder:"22"},null,512)),[[xe,_e.port]])]),_:1}),z(Ee,{title:"Username",desc:"Account used to authenticate.",keywords:"username login account"},{default:Le(()=>[Ht("username")?(p(),g("span",Dg,[D(k($t("username").effective||"—")+" ",1),xt("username")?(p(),g("span",Ng,[z(X,{name:"lock",size:10}),D(k(xt("username")),1)])):R("",!0)])):re((p(),g("input",{key:1,"onUpdate:modelValue":f[25]||(f[25]=T=>_e.username=T),class:"field w-64",placeholder:"user"},null,512)),[[xe,_e.username]])]),_:1}),z(Ee,{title:"Password",desc:"Password auth for FTP/FTPS, or SFTP password login. Leave blank to use a key.",keywords:"password secret credentials"},{default:Le(()=>[Ht("password")?(p(),g("span",Rg,[D(k($t("password").effective||"—")+" ",1),xt("password")?(p(),g("span",Fg,[z(X,{name:"lock",size:10}),D(k(xt("password")),1)])):R("",!0)])):re((p(),g("input",{key:1,"onUpdate:modelValue":f[26]||(f[26]=T=>_e.password=T),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[xe,_e.password]])]),_:1}),es.value==="sftp"?(p(),it(Ee,{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:Le(()=>[Ht("privateKey")?(p(),g("span",Bg,[D(k($t("privateKey").effective||"—")+" ",1),xt("privateKey")?(p(),g("span",Vg,[z(X,{name:"lock",size:10}),D(k(xt("privateKey")),1)])):R("",!0)])):re((p(),g("textarea",{key:1,"onUpdate:modelValue":f[27]||(f[27]=T=>_e.privateKey=T),rows:"3",class:"field w-full font-mono text-xs",placeholder:"-----BEGIN OPENSSH PRIVATE KEY-----"},null,512)),[[xe,_e.privateKey]])]),_:1})):R("",!0),es.value==="sftp"?(p(),it(Ee,{key:8,title:"Private key passphrase",desc:"Passphrase protecting the SSH private key, if any.",keywords:"passphrase key secret"},{default:Le(()=>[Ht("keyPassphrase")?(p(),g("span",Ug,[D(k($t("keyPassphrase").effective||"—")+" ",1),xt("keyPassphrase")?(p(),g("span",Zg,[z(X,{name:"lock",size:10}),D(k(xt("keyPassphrase")),1)])):R("",!0)])):re((p(),g("input",{key:1,"onUpdate:modelValue":f[28]||(f[28]=T=>_e.keyPassphrase=T),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[xe,_e.keyPassphrase]])]),_:1})):R("",!0),es.value==="sftp"?(p(),it(Ee,{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:Le(()=>[Ht("hostKeyFingerprint")?(p(),g("span",Hg,[D(k($t("hostKeyFingerprint").effective||"—")+" ",1),xt("hostKeyFingerprint")?(p(),g("span",jg,[z(X,{name:"lock",size:10}),D(k(xt("hostKeyFingerprint")),1)])):R("",!0)])):re((p(),g("input",{key:1,"onUpdate:modelValue":f[29]||(f[29]=T=>_e.hostKeyFingerprint=T),class:"field w-full font-mono text-xs",placeholder:"SHA256:…"},null,512)),[[xe,_e.hostKeyFingerprint]])]),_:1})):R("",!0),es.value==="ftps"?(p(),it(Ee,{key:10,title:"TLS verification",desc:"Skip only for self-signed test servers.",keywords:"tls certificate verify insecure ftps"},{default:Le(()=>[Ht("insecureSkipVerify")?(p(),g("span",Wg,[D(k($t("insecureSkipVerify").effective==="true"?"Skip verification":"Verify certificate")+" ",1),xt("insecureSkipVerify")?(p(),g("span",Kg,[z(X,{name:"lock",size:10}),D(k(xt("insecureSkipVerify")),1)])):R("",!0)])):(p(),it(hn,{key:1,modelValue:_e.insecureSkipVerify,"onUpdate:modelValue":f[30]||(f[30]=T=>_e.insecureSkipVerify=T),options:di},null,8,["modelValue"]))]),_:1})):R("",!0),z(Ee,{title:"Base path",desc:"Working directory and health-check target, e.g. /uploads.",keywords:"base path directory folder root"},{default:Le(()=>[Ht("basePath")?(p(),g("span",Gg,[D(k($t("basePath").effective||"—")+" ",1),xt("basePath")?(p(),g("span",qg,[z(X,{name:"lock",size:10}),D(k(xt("basePath")),1)])):R("",!0)])):re((p(),g("input",{key:1,"onUpdate:modelValue":f[31]||(f[31]=T=>_e.basePath=T),class:"field w-64 font-mono",placeholder:"/uploads"},null,512)),[[xe,_e.basePath]])]),_:1}),r("div",Yg,[Tt.value?R("",!0):(p(),g("button",{key:0,class:"btn-accent",disabled:rt.value||!P.available,onClick:Ea},k(rt.value?"Saving…":Zt.value?"Save organization settings":"Save settings"),9,Jg)),Zt.value?R("",!0):(p(),g("button",{key:1,class:"btn-ghost",disabled:le.value||!P.available,onClick:Oa},k(le.value?"Testing…":"Test connection"),9,Xg)),We.value?(p(),g("span",Qg,k(We.value),1)):R("",!0),wt.value&&!Zt.value?(p(),g("span",ev,"Checked "+k(Ca()),1)):R("",!0),tt.value&&!Zt.value?(p(),g("span",{key:4,class:Oe(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",za(tt.value.status)])},[f[87]||(f[87]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(k(tt.value.detail||tt.value.status),1)],2)):R("",!0)])]),r("div",tv,[r("div",nv,[r("div",iv,[z(X,{name:"cloud",size:20})]),f[88]||(f[88]=r("div",{class:"min-w-0"},[r("div",{class:"text-sm font-semibold text-ink"},"WebDAV"),r("div",{class:"mt-0.5 text-xs text-ink-muted"}," Connect to a WebDAV server (Nextcloud, ownCloud, IIS, …). Configure the connection your account uses. ")],-1))]),Ke.loaded&&!Ke.available?(p(),g("div",sv,[z(X,{name:"lock",size:14,class:"mr-1 inline"}),f[89]||(f[89]=D(" WebDAV is currently disabled by your administrator. Contact them to enable it. ",-1))])):R("",!0),Ke.canEditOrg?(p(),g("div",ov,[f[90]||(f[90]=r("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),z(hn,{modelValue:we.value,"onUpdate:modelValue":f[32]||(f[32]=T=>we.value=T),options:nt},null,8,["modelValue"])])):R("",!0),rn.value?(p(),it(Ee,{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:Le(()=>[z(tn,{"model-value":Ke.orgEnabled,disabled:!Ke.available,"onUpdate:modelValue":mi},null,8,["model-value","disabled"])]),_:1})):(p(),it(Ee,{key:3,title:"Enable WebDAV",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin webdav"},{default:Le(()=>[z(tn,{"model-value":Ke.enabled,disabled:!Ke.available||!Ke.orgEnabled,"onUpdate:modelValue":mi},null,8,["model-value","disabled"])]),_:1})),!rn.value&&Ke.available&&!Ke.orgEnabled?(p(),g("div",av,[z(X,{name:"lock",size:13,class:"mr-1 inline"}),f[92]||(f[92]=D("WebDAV is turned off for your organization",-1)),Ke.canEditOrg?(p(),g("span",rv,[...f[91]||(f[91]=[D(" — switch to ",-1),r("span",{class:"font-semibold"},"Organization",-1),D(" to turn it back on",-1)])])):R("",!0),f[93]||(f[93]=D(". ",-1))])):R("",!0),rn.value?(p(),g("div",lv,[z(X,{name:"users",size:13,class:"mr-1 inline"}),f[94]||(f[94]=D("These are organization-wide settings — they apply to everyone in ",-1)),r("span",uv,k(t.organizationName||"your organization"),1),f[95]||(f[95]=D(". Leave the connection blank to let each user configure their own; a connection set here overrides the user's. ",-1))])):$s.value?(p(),g("div",cv," As a superadmin you manage the global WebDAV configuration in the API Server panel. The effective configuration is shown below. ")):R("",!0),z(Ee,{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:Le(()=>[pi("baseURL")?(p(),g("span",dv,[D(k(yn("baseURL").effective||"—")+" ",1),jt("baseURL")?(p(),g("span",fv,[z(X,{name:"lock",size:10}),D(k(jt("baseURL")),1)])):R("",!0)])):re((p(),g("input",{key:1,"onUpdate:modelValue":f[33]||(f[33]=T=>It.baseURL=T),class:"field w-full font-mono text-xs",placeholder:"https://cloud.example.com/remote.php/dav/files/alice/"},null,512)),[[xe,It.baseURL]])]),_:1}),z(Ee,{title:"Username",desc:"Account used to authenticate (leave blank for a public share).",keywords:"username login account"},{default:Le(()=>[pi("username")?(p(),g("span",hv,[D(k(yn("username").effective||"—")+" ",1),jt("username")?(p(),g("span",pv,[z(X,{name:"lock",size:10}),D(k(jt("username")),1)])):R("",!0)])):re((p(),g("input",{key:1,"onUpdate:modelValue":f[34]||(f[34]=T=>It.username=T),class:"field w-64",placeholder:"user"},null,512)),[[xe,It.username]])]),_:1}),z(Ee,{title:"Password",desc:"Password or app-specific token for HTTP Basic auth.",keywords:"password secret credentials token"},{default:Le(()=>[pi("password")?(p(),g("span",mv,[D(k(yn("password").effective||"—")+" ",1),jt("password")?(p(),g("span",gv,[z(X,{name:"lock",size:10}),D(k(jt("password")),1)])):R("",!0)])):re((p(),g("input",{key:1,"onUpdate:modelValue":f[35]||(f[35]=T=>It.password=T),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[xe,It.password]])]),_:1}),z(Ee,{title:"TLS verification",desc:"Only affects HTTPS. Skip only for self-signed test servers.",keywords:"tls certificate verify insecure https"},{default:Le(()=>[pi("insecureSkipVerify")?(p(),g("span",vv,[D(k(yn("insecureSkipVerify").effective==="true"?"Skip verification":"Verify certificate")+" ",1),jt("insecureSkipVerify")?(p(),g("span",_v,[z(X,{name:"lock",size:10}),D(k(jt("insecureSkipVerify")),1)])):R("",!0)])):(p(),it(hn,{key:1,modelValue:It.insecureSkipVerify,"onUpdate:modelValue":f[36]||(f[36]=T=>It.insecureSkipVerify=T),options:So},null,8,["modelValue"]))]),_:1}),z(Ee,{title:"Base path",desc:"Working directory under the server URL and health-check target, e.g. /Documents.",keywords:"base path directory folder root"},{default:Le(()=>[pi("basePath")?(p(),g("span",yv,[D(k(yn("basePath").effective||"—")+" ",1),jt("basePath")?(p(),g("span",bv,[z(X,{name:"lock",size:10}),D(k(jt("basePath")),1)])):R("",!0)])):re((p(),g("input",{key:1,"onUpdate:modelValue":f[37]||(f[37]=T=>It.basePath=T),class:"field w-64 font-mono",placeholder:"/Documents"},null,512)),[[xe,It.basePath]])]),_:1}),r("div",xv,[$s.value?R("",!0):(p(),g("button",{key:0,class:"btn-accent",disabled:Oi.value||!Ke.available,onClick:Po},k(Oi.value?"Saving…":rn.value?"Save organization settings":"Save settings"),9,wv)),rn.value?R("",!0):(p(),g("button",{key:1,class:"btn-ghost",disabled:hi.value||!Ke.available,onClick:Co},k(hi.value?"Testing…":"Test connection"),9,kv)),fi.value?(p(),g("span",Sv,k(fi.value),1)):R("",!0),nn.value&&!rn.value?(p(),g("span",Tv,"Checked "+k($a()),1)):R("",!0),an.value&&!rn.value?(p(),g("span",{key:4,class:Oe(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",zi(an.value.status)])},[f[96]||(f[96]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(k(an.value.detail||an.value.status),1)],2)):R("",!0)])])],64)):R("",!0),rs("drives-local")?(p(),g("div",Pv,[r("div",Cv,[r("div",Lv,[z(X,{name:"monitor",size:20})]),f[97]||(f[97]=r("div",{class:"min-w-0"},[r("div",{class:"text-sm font-semibold text-ink"},"Local Storage"),r("div",{class:"mt-0.5 text-xs text-ink-muted"}," A private folder on the server for your files. Each user has their own; members of an organization share one. ")],-1))]),oe.loaded&&!oe.available?(p(),g("div",Mv,[z(X,{name:"lock",size:14,class:"mr-1 inline"}),f[98]||(f[98]=D(" Local storage is currently disabled by your administrator. Contact them to enable it. ",-1))])):oe.loaded&&!oe.rootConfigured?(p(),g("div",Ev,[z(X,{name:"alertTriangle",size:14,class:"mr-1 inline"}),f[99]||(f[99]=D(" No storage root has been configured by your administrator yet. ",-1))])):R("",!0),oe.canEditOrg?(p(),g("div",Ov,[f[100]||(f[100]=r("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),z(hn,{modelValue:lt.value,"onUpdate:modelValue":f[38]||(f[38]=T=>lt.value=T),options:nt},null,8,["modelValue"])])):R("",!0),Pt.value?(p(),it(Ee,{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:Le(()=>[z(tn,{"model-value":oe.orgEnabled,disabled:!oe.available,"onUpdate:modelValue":os},null,8,["model-value","disabled"])]),_:1})):(p(),it(Ee,{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:Le(()=>[z(tn,{"model-value":oe.enabled,disabled:!oe.available||!oe.orgEnabled,"onUpdate:modelValue":os},null,8,["model-value","disabled"])]),_:1})),!Pt.value&&oe.available&&!oe.orgEnabled?(p(),g("div",zv,[z(X,{name:"lock",size:13,class:"mr-1 inline"}),f[102]||(f[102]=D("Local storage is turned off for your organization",-1)),oe.canEditOrg?(p(),g("span",Av,[...f[101]||(f[101]=[D(" — switch to ",-1),r("span",{class:"font-semibold"},"Organization",-1),D(" to turn it back on",-1)])])):R("",!0),f[103]||(f[103]=D(". ",-1))])):R("",!0),Pt.value?(p(),g("div",$v,[z(X,{name:"users",size:13,class:"mr-1 inline"}),f[104]||(f[104]=D("These are organization-wide settings — they apply to everyone in ",-1)),r("span",Iv,k(t.organizationName||"your organization"),1),f[105]||(f[105]=D(", who all share the organization folder. Members can additionally enable a private folder inside it. ",-1))])):Rt.value?(p(),g("div",Dv," As a superadmin you manage the global storage root in the API Server panel. The effective configuration is shown below. ")):R("",!0),Pt.value?(p(),it(Ee,{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:Le(()=>[z(tn,{"model-value":oe.allowPrivate,disabled:!oe.available,"onUpdate:modelValue":Lo},null,8,["model-value","disabled"])]),_:1})):R("",!0),Pt.value?R("",!0):(p(),g(ce,{key:9},[z(Ee,{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:Le(()=>[r("div",Nv,[(p(!0),g(ce,null,Ve(oe.mounts,T=>(p(),g("div",{key:T.id,class:"flex flex-wrap items-center gap-2"},[r("span",Rv,k(T.path),1),T.kind==="shared"?(p(),g("span",Fv,[z(X,{name:"users",size:10}),f[106]||(f[106]=D("Shared with your organization",-1))])):(p(),g("span",Bv,[z(X,{name:"lock",size:10}),f[107]||(f[107]=D("Private to you",-1))])),Wn.value[T.id]?(p(),g("span",{key:2,class:Oe(["inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[10px] font-semibold",He(Wn.value[T.id].status)])},[f[108]||(f[108]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(k(Wn.value[T.id].status),1)],2)):R("",!0)]))),128)),oe.mounts.length?R("",!0):(p(),g("div",Vv,k(oe.rootConfigured?"No folder assigned yet.":"Waiting for the administrator to configure a storage root."),1))])]),_:1}),oe.isOrgUser&&oe.allowPrivate?(p(),it(Ee,{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:Le(()=>[z(tn,{"model-value":oe.privateFolder,disabled:!oe.available||!oe.orgEnabled,"onUpdate:modelValue":as},null,8,["model-value","disabled"])]),_:1})):oe.isOrgUser&&!oe.allowPrivate?(p(),g("div",Uv,[z(X,{name:"lock",size:13,class:"mr-1 inline"}),f[109]||(f[109]=D("Private folders are turned off by your organization. ",-1))])):R("",!0)],64)),z(Ee,{title:"Access mode",desc:"Read-only prevents uploads, deletes and folder creation.",keywords:"read only write access mode permission"},{default:Le(()=>[On("readOnly")?(p(),g("span",Zv,[D(k($i(_t("readOnly").effective))+" ",1),vi("readOnly")?(p(),g("span",Hv,[z(X,{name:"lock",size:10}),D(k(vi("readOnly")),1)])):R("",!0)])):(p(),it(hn,{key:1,modelValue:jn.value,"onUpdate:modelValue":f[39]||(f[39]=T=>jn.value=T),options:Ai},null,8,["modelValue"]))]),_:1}),r("div",jv,[Rt.value?R("",!0):(p(),g("button",{key:0,class:"btn-accent",disabled:bn.value||!oe.available,onClick:Us},k(bn.value?"Saving…":Pt.value?"Save organization settings":"Save settings"),9,Wv)),Pt.value?R("",!0):(p(),g("button",{key:1,class:"btn-ghost",disabled:gi.value||!oe.available,onClick:Na},k(gi.value?"Testing…":"Test folder"),9,Kv)),ln.value?(p(),g("span",Gv,k(ln.value),1)):R("",!0),ft.value&&!Pt.value?(p(),g("span",qv,"Checked "+k(Fs()),1)):R("",!0),Fe.value&&!Pt.value?(p(),g("span",{key:4,class:Oe(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",He(Fe.value.status)])},[f[110]||(f[110]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(k(Fe.value.detail||Fe.value.status),1)],2)):R("",!0)])])):R("",!0)])):Y.id==="profile"?(p(),g("div",Yv,[z(Ee,{block:"",title:"Profile photo",desc:"PNG or JPG, up to ~1.5 MB. Stored on this device.",keywords:"avatar photo picture"},{default:Le(()=>[r("div",Jv,[$e(ke).avatar?(p(),g("img",{key:0,src:$e(ke).avatar,alt:"Avatar",class:"h-16 w-16 rounded-full object-cover"},null,8,Xv)):(p(),g("div",Qv,k(Oo.value),1)),r("div",e_,[r("label",t_,[z(X,{name:"upload",size:15,class:"mr-1.5 inline"}),f[111]||(f[111]=D("Upload ",-1)),r("input",{type:"file",accept:"image/*",class:"hidden",onChange:Eo},null,32)]),$e(ke).avatar?(p(),g("button",{key:0,class:"btn-ghost",onClick:Ra},"Remove")):R("",!0)])])]),_:1}),z(Ee,{title:"Display name",desc:"The name shown on your public profile.",keywords:"display name profile"},{default:Le(()=>[re(r("input",{"onUpdate:modelValue":f[40]||(f[40]=T=>$e(ke).displayName=T),class:"field w-56",placeholder:"Jane O.",onBlur:f[41]||(f[41]=T=>Ye("Saved."))},null,544),[[xe,$e(ke).displayName]])]),_:1}),z(Ee,{block:"",title:"Bio",desc:"A short description others can see.",keywords:"bio about description"},{default:Le(()=>[re(r("textarea",{"onUpdate:modelValue":f[42]||(f[42]=T=>$e(ke).bio=T),rows:"3",maxlength:"240",class:"field w-full resize-none",placeholder:"Flight director, North yard operations…",onBlur:f[43]||(f[43]=T=>Ye("Saved."))},null,544),[[xe,$e(ke).bio]]),r("div",n_,k(($e(ke).bio||"").length)+"/240",1)]),_:1}),z(Ee,{title:"Show email on profile",desc:"Let teammates see your email address.",keywords:"show email public visibility"},{default:Le(()=>[z(tn,{modelValue:$e(ke).showEmail,"onUpdate:modelValue":f[44]||(f[44]=T=>$e(ke).showEmail=T)},null,8,["modelValue"])]),_:1})])):Y.id==="security"?(p(),g("div",i_,[z(Ee,{block:"",title:"Two-factor authentication",desc:"Require a one-time code at sign-in.",keywords:"two factor 2fa authentication security"},{default:Le(()=>[r("div",s_,[r("span",{class:Oe(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",$e(ke).twoFactor?"bg-success-soft text-success-fg":"bg-surface-2 text-ink-secondary"])},[f[112]||(f[112]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(k($e(ke).twoFactor?"Enabled":"Disabled"),1)],2),!$e(ke).twoFactor&&!Kn.value?(p(),g("button",{key:0,class:"btn-accent",onClick:Ni},"Enable 2FA")):$e(ke).twoFactor?(p(),g("button",{key:1,class:"btn-ghost",onClick:Fa},"Disable")):R("",!0)]),Kn.value?(p(),g("div",o_,[r("div",a_,[f[114]||(f[114]=r("div",{class:"grid h-28 w-28 place-items-center rounded bg-white p-2"},[r("svg",{viewBox:"0 0 100 100",class:"h-full w-full"},[r("rect",{width:"100",height:"100",fill:"#fff"}),r("g",{fill:"#0F1E3D"},[r("rect",{x:"6",y:"6",width:"24",height:"24"}),r("rect",{x:"70",y:"6",width:"24",height:"24"}),r("rect",{x:"6",y:"70",width:"24",height:"24"}),r("rect",{x:"12",y:"12",width:"12",height:"12",fill:"#fff"}),r("rect",{x:"76",y:"12",width:"12",height:"12",fill:"#fff"}),r("rect",{x:"12",y:"76",width:"12",height:"12",fill:"#fff"}),r("rect",{x:"40",y:"10",width:"8",height:"8"}),r("rect",{x:"52",y:"20",width:"8",height:"8"}),r("rect",{x:"40",y:"40",width:"8",height:"8"}),r("rect",{x:"60",y:"44",width:"8",height:"8"}),r("rect",{x:"44",y:"60",width:"8",height:"8"}),r("rect",{x:"70",y:"60",width:"8",height:"8"}),r("rect",{x:"80",y:"72",width:"8",height:"8"}),r("rect",{x:"60",y:"80",width:"8",height:"8"})])])],-1)),r("div",r_,[f[113]||(f[113]=r("div",{class:"text-xs text-ink-secondary"},"Scan with an authenticator app, or enter this secret:",-1)),r("div",l_,k(zo.value),1),r("div",u_,[re(r("input",{"onUpdate:modelValue":f[45]||(f[45]=T=>Di.value=T),inputmode:"numeric",maxlength:"6",class:"field w-28 font-mono tracking-[0.3em]",placeholder:"000000"},null,512),[[xe,Di.value]]),r("button",{class:"btn-accent",onClick:Ao},"Verify & enable")]),Ge.value?(p(),g("p",c_,k(Ge.value),1)):R("",!0)])])])):R("",!0),$e(ke).twoFactor&&ls.value.length?(p(),g("div",d_,[f[115]||(f[115]=r("div",{class:"text-xs font-semibold text-ink"},"Recovery codes",-1)),f[116]||(f[116]=r("div",{class:"mt-0.5 text-xs text-ink-muted"},"Store these somewhere safe — each works once.",-1)),r("div",f_,[(p(!0),g(ce,null,Ve(ls.value,T=>(p(),g("span",{key:T,class:"select-all"},k(T),1))),128))])])):R("",!0),f[117]||(f[117]=r("p",{class:"mt-2 text-xs text-ink-muted"},"Prototype — codes are generated locally until the account service verifies them.",-1))]),_:1}),z(Ee,{block:"",title:"Active sessions",desc:"Devices currently signed in to your account.",keywords:"sessions devices logout sign out remote"},{default:Le(()=>[r("div",h_,[r("div",p_,[r("div",m_,[z(X,{name:"monitor",size:18})]),r("div",g_,[r("div",v_,[D(k(Ba())+" on "+k($o())+" ",1),f[118]||(f[118]=r("span",{class:"ml-1 rounded-full bg-success-soft px-2 py-0.5 text-[10px] font-semibold text-success-fg"},"This device",-1))]),r("div",__,"Signed in "+k($e(ru)($e(Va))),1)]),r("button",{class:"btn-ghost",onClick:f[46]||(f[46]=T=>l("logout"))},"Log out")])]),f[119]||(f[119]=r("button",{class:"btn-ghost mt-2 opacity-60",disabled:"",title:"Requires the account service"}," Log out all other devices ",-1)),f[120]||(f[120]=r("p",{class:"mt-2 text-xs text-ink-muted"}," Only this session is visible from the browser; enumerating and revoking remote sessions needs the account service. ",-1))]),_:1})])):Y.id==="team"?(p(),g("div",y_,[Xe.id?(p(),g("div",b_,[z(Ee,{block:"",title:`Edit user — ${Xe.email}`,desc:"Update details, change role, reset password, or set verified.",keywords:"edit user update role password verified organization"},{default:Le(()=>[r("div",x_,[r("div",w_,[re(r("input",{"onUpdate:modelValue":f[47]||(f[47]=T=>Xe.email=T),type:"email",class:"field flex-1",placeholder:"name@pilotvault.local"},null,512),[[xe,Xe.email]]),re(r("select",{"onUpdate:modelValue":f[48]||(f[48]=T=>Xe.role=T),class:"field w-32",disabled:ds.value,title:ds.value?"You cannot change your own role":""},[(p(!0),g(ce,null,Ve(Zs.value,T=>(p(),g("option",{key:T.value,value:T.value},k(T.label),9,S_))),128))],8,k_),[[Mt,Xe.role]])]),u.value?re((p(),g("select",{key:0,"onUpdate:modelValue":f[49]||(f[49]=T=>Xe.organization=T),class:"field",title:"Organization"},[(p(!0),g(ce,null,Ve(Io.value,T=>(p(),g("option",{key:T.value,value:T.value},k(T.label),9,T_))),128))],512)),[[Mt,Xe.organization]]):R("",!0),re(r("input",{"onUpdate:modelValue":f[50]||(f[50]=T=>Xe.password=T),type:"password",class:"field",placeholder:"New password (leave blank to keep current)"},null,512),[[xe,Xe.password]]),r("label",P_,[z(tn,{modelValue:Xe.verified,"onUpdate:modelValue":f[51]||(f[51]=T=>Xe.verified=T)},null,8,["modelValue"]),f[121]||(f[121]=D(" Email verified ",-1))]),r("div",C_,[r("button",{class:"btn-accent",disabled:Vi.value,onClick:Ha},k(Vi.value?"Saving…":"Save changes"),9,L_),r("button",{class:"btn-ghost",onClick:$n},"Cancel"),An.value?(p(),g("span",M_,k(An.value),1)):R("",!0),ds.value?(p(),g("span",E_,"Editing your own account — role locked.")):R("",!0)])])]),_:1},8,["title"])])):(p(),g("div",O_,[z(Ee,{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:Le(()=>[r("div",z_,[r("div",A_,[re(r("input",{"onUpdate:modelValue":f[52]||(f[52]=T=>ht.email=T),type:"email",class:"field flex-1",placeholder:"name@pilotvault.local"},null,512),[[xe,ht.email]]),re(r("select",{"onUpdate:modelValue":f[53]||(f[53]=T=>ht.role=T),class:"field w-32"},[(p(!0),g(ce,null,Ve(Zs.value,T=>(p(),g("option",{key:T.value,value:T.value},k(T.label),9,$_))),128))],512),[[Mt,ht.role]])]),u.value?re((p(),g("select",{key:0,"onUpdate:modelValue":f[54]||(f[54]=T=>ht.organization=T),class:"field",title:"Organization"},[(p(!0),g(ce,null,Ve(Io.value,T=>(p(),g("option",{key:T.value,value:T.value},k(T.label),9,I_))),128))],512)),[[Mt,ht.organization]]):(p(),g("div",D_,[f[122]||(f[122]=D(" New users join your organization: ",-1)),r("span",N_,k(t.organizationName||"—"),1)])),re(r("input",{"onUpdate:modelValue":f[55]||(f[55]=T=>ht.password=T),type:"password",class:"field",placeholder:"Temporary password (min 8 chars)"},null,512),[[xe,ht.password]]),r("div",R_,[r("button",{class:"btn-accent",disabled:Ri.value,onClick:Ua},k(Ri.value?"Creating…":"Create user"),9,F_),bi.value?(p(),g("span",B_,k(bi.value),1)):R("",!0)])])]),_:1})])),r("div",V_,[r("div",U_,[f[123]||(f[123]=r("div",null,[r("div",{class:"eyebrow"},"Team"),r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"All users")],-1)),r("button",{class:"btn-ghost",disabled:Gn.value,onClick:Yn},k(Gn.value?"Loading…":"Refresh"),9,Z_)]),cs.value?(p(),g("div",H_,k(cs.value),1)):!us.value.length&&!Gn.value?(p(),g("div",j_,"No users yet.")):(p(),g("div",W_,[r("table",K_,[r("thead",null,[r("tr",G_,[(p(),g(ce,null,Ve(["User","Role","Organization","Status",""],T=>r("th",{key:T,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(T),1)),64))])]),r("tbody",null,[(p(!0),g(ce,null,Ve(us.value,T=>(p(),g("tr",{key:T.id,class:Oe(["border-b border-line last:border-0",Xe.id===T.id?"bg-accent-soft":""])},[r("td",q_,[r("span",Y_,k(T.email),1),T.email===t.email?(p(),g("span",J_,"(you)")):R("",!0)]),r("td",X_,[r("span",{class:Oe(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",y(T.role||"user")])},[z(X,{name:_(T.role||"user"),size:12},null,8,["name"]),D(k(h(T.role||"user")),1)],2)]),r("td",Q_,[r("span",{class:Oe(["text-sm",T.organizationName?"text-ink-secondary":"text-ink-muted"])},k(T.organizationName||"—"),3)]),r("td",ey,[r("span",{class:Oe(["text-xs",T.verified?"text-success-fg":"text-ink-muted"])},k(T.verified?"Verified":"Unverified"),3)]),r("td",ty,[Qt.value===T.id?(p(),g(ce,{key:0},[f[124]||(f[124]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Remove?",-1)),r("button",{class:"btn-ghost mr-1",onClick:f[56]||(f[56]=Qe=>Qt.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:Qe=>Za(T)}," Remove ",8,ny)],64)):(p(),g("div",iy,[r("button",{class:"btn-ghost inline-flex items-center gap-1.5",onClick:Qe=>fs(T)},[z(X,{name:"settings",size:14}),f[125]||(f[125]=D(" Edit ",-1))],8,sy),T.email!==t.email?(p(),g("button",{key:0,class:"btn-ghost inline-flex items-center gap-1.5",onClick:Qe=>Qt.value=T.id},[z(X,{name:"trash",size:14}),f[126]||(f[126]=D(" Remove ",-1))],8,oy)):R("",!0)]))])],2))),128))])])]))])])):Y.id==="organizations"?(p(),g("div",ay,[kn.id?(p(),g("div",ry,[z(Ee,{block:"",title:"Rename organization",desc:"Update the organization's display name.",keywords:"rename organization edit"},{default:Le(()=>[r("div",ly,[re(r("input",{"onUpdate:modelValue":f[57]||(f[57]=T=>kn.name=T),class:"field",placeholder:"Organization name",onKeyup:Xl(No,["enter"])},null,544),[[xe,kn.name]]),r("div",uy,[r("button",{class:"btn-accent",onClick:No},"Save changes"),r("button",{class:"btn-ghost",onClick:Hs},"Cancel"),Sn.value?(p(),g("span",cy,k(Sn.value),1)):R("",!0)])])]),_:1})])):(p(),g("div",dy,[z(Ee,{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:Le(()=>[r("div",fy,[re(r("input",{"onUpdate:modelValue":f[58]||(f[58]=T=>In.name=T),class:"field",placeholder:"e.g. Northwind Aerial",onKeyup:Xl(Do,["enter"])},null,544),[[xe,In.name]]),r("div",hy,[r("button",{class:"btn-accent",disabled:Ui.value,onClick:Do},k(Ui.value?"Creating…":"Create organization"),9,py),Et.value?(p(),g("span",my,k(Et.value),1)):R("",!0)])])]),_:1})])),r("div",gy,[r("div",{class:"flex items-center justify-between px-5 py-4"},[f[127]||(f[127]=r("div",null,[r("div",{class:"eyebrow"},"Tenancy"),r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"All organizations")],-1)),r("button",{class:"btn-ghost",onClick:qn},"Refresh")]),Fi.value.length?(p(),g("div",_y,[r("table",yy,[r("thead",null,[r("tr",by,[(p(),g(ce,null,Ve(["Organization","Members",""],T=>r("th",{key:T,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(T),1)),64))])]),r("tbody",null,[(p(!0),g(ce,null,Ve(Fi.value,T=>(p(),g("tr",{key:T.id,class:Oe(["border-b border-line last:border-0",kn.id===T.id?"bg-accent-soft":""])},[r("td",xy,[r("span",wy,[z(X,{name:"grid",size:14,class:"text-ink-muted"}),D(k(T.name),1)])]),r("td",ky,k(Zi.value[T.id]||0),1),r("td",Sy,[xi.value===T.id?(p(),g(ce,{key:0},[f[128]||(f[128]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),r("button",{class:"btn-ghost mr-1",onClick:f[59]||(f[59]=Qe=>xi.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:Qe=>sn(T)}," Delete ",8,Ty)],64)):(p(),g("div",Py,[r("button",{class:"btn-ghost inline-flex items-center gap-1.5",onClick:Qe=>ja(T)},[z(X,{name:"settings",size:14}),f[129]||(f[129]=D(" Rename ",-1))],8,Cy),r("button",{class:"btn-ghost inline-flex items-center gap-1.5",disabled:(Zi.value[T.id]||0)>0,title:(Zi.value[T.id]||0)>0?"Reassign or remove members first":"",onClick:Qe=>xi.value=T.id},[z(X,{name:"trash",size:14}),f[130]||(f[130]=D(" Delete ",-1))],8,Ly)]))])],2))),128))])])])):(p(),g("div",vy,"No organizations yet."))])])):Y.id==="advanced"?(p(),g("div",My,[r("div",Ey,[z(Ee,{title:"Export data",desc:"Download your settings and profile as JSON.",keywords:"export data download backup"},{default:Le(()=>[r("button",{class:"btn-ghost",onClick:wi},[z(X,{name:"download",size:15,class:"mr-1.5 inline"}),f[131]||(f[131]=D("Export",-1))])]),_:1}),z(Ee,{block:"",title:"Import data",desc:"Restore settings from a previous export.",keywords:"import data upload restore"},{default:Le(()=>[r("label",Oy,[z(X,{name:"upload",size:15,class:"mr-1.5 inline"}),f[132]||(f[132]=D("Choose file… ",-1)),r("input",{type:"file",accept:"application/json,.json",class:"hidden",onChange:Tn},null,32)]),hs.value?(p(),g("p",zy,k(hs.value),1)):R("",!0)]),_:1})]),r("div",Ay,[r("div",$y,[z(X,{name:"alertTriangle",size:18}),f[133]||(f[133]=r("h3",{class:"text-sm font-bold uppercase tracking-caps"},"Danger zone",-1))]),f[138]||(f[138]=r("p",{class:"mt-1 text-xs text-ink-secondary"},"Deleting your account is permanent and cannot be undone.",-1)),r("div",Iy,[f[137]||(f[137]=r("div",{class:"text-sm font-semibold text-ink"},"Delete account",-1)),r("label",Dy,[re(r("input",{"onUpdate:modelValue":f[60]||(f[60]=T=>gt.understand=T),type:"checkbox",class:"mt-0.5 h-4 w-4 accent-[var(--danger)]"},null,512),[[da,gt.understand]]),f[134]||(f[134]=D(" I understand this permanently deletes my account and all associated data. ",-1))]),r("div",Ny,[r("label",Ry,[f[135]||(f[135]=D("Type ",-1)),r("span",Fy,k(js.value),1),f[136]||(f[136]=D(" to confirm",-1))]),re(r("input",{"onUpdate:modelValue":f[61]||(f[61]=T=>gt.typed=T),class:"field w-full max-w-[360px] font-mono",placeholder:js.value},null,8,By),[[xe,gt.typed]])]),r("div",Vy,[gt.armed?(p(),g("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:gt.cooldown>0,onClick:ps},k(gt.cooldown>0?`Confirm in ${gt.cooldown}s…`:"Permanently delete account"),9,Zy)):(p(),g("button",{key:0,class:"rounded bg-danger px-4 py-2.5 text-sm font-semibold text-white transition enabled:hover:brightness-110 disabled:cursor-not-allowed disabled:opacity-40",disabled:!Jn.value,onClick:Ro}," Delete account… ",8,Uy)),gt.armed&>.cooldown>0?(p(),g("span",Hy,"Cooling-off period — read once more.")):R("",!0)]),gt.msg?(p(),g("p",jy,k(gt.msg),1)):R("",!0)])])])):R("",!0)],64))),128))])]),z(hh,{name:"fade"},{default:Le(()=>[_i.value?(p(),g("div",Wy,[z(X,{name:"check",size:16,class:"text-success-fg"}),D(k(_i.value),1)])):R("",!0)]),_:1})]))}},Gy=dm(Ky,[["__scopeId","data-v-4fe25eb7"]]),qy={class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},Yy={class:"flex flex-wrap items-center gap-3"},Jy={class:"inline-flex rounded-lg border border-line bg-surface-1 p-0.5"},Xy=["onClick"],Qy={class:"ml-auto flex items-center gap-2"},e1=["href"],t1={class:"grid grid-cols-4 gap-4 max-[900px]:grid-cols-2"},n1={class:"eyebrow"},i1={key:0,class:"panel border-danger/40 p-4 text-sm text-danger-fg"},s1={key:0,class:"panel p-5"},o1={class:"mb-4 flex items-center justify-between"},a1={class:"eyebrow"},r1={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},l1={class:"block"},u1={class:"block"},c1={class:"block"},d1={class:"block"},f1={key:0,value:""},h1=["value"],p1={class:"block"},m1={class:"block"},g1={class:"block"},v1={class:"block"},_1={class:"block"},y1=["value"],b1={class:"block"},x1=["value"],w1={class:"block"},k1=["value"],S1={class:"block"},T1={class:"mt-3 block"},P1={key:0,class:"mt-3 grid grid-cols-2 gap-3 max-[760px]:grid-cols-1"},C1={class:"block"},L1={class:"block"},M1={class:"block"},E1={class:"block"},O1={class:"col-span-2 block max-[760px]:col-span-1"},z1={class:"mt-4 flex items-center gap-3"},A1=["disabled"],$1={key:0,class:"text-sm text-danger-fg"},I1={class:"panel overflow-hidden p-0"},D1={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},N1={key:1,class:"grid place-items-center px-5 py-16 text-center"},R1={key:2,class:"overflow-x-auto"},F1={class:"w-full border-collapse text-sm"},B1={class:"text-left"},V1={class:"whitespace-nowrap px-5 py-3 font-mono text-ink"},U1={key:0,class:"text-ink-muted"},Z1={class:"px-5 py-3 text-ink-secondary"},H1=["title"],j1={class:"px-5 py-3 font-mono text-ink-secondary"},W1={class:"px-5 py-3 text-ink-secondary"},K1={class:"px-5 py-3"},G1=["onClick"],q1={class:"whitespace-nowrap px-5 py-3 text-right"},Y1=["onClick"],J1=["onClick"],X1=["onClick"],Q1={key:0,class:"border-b border-line bg-surface-2"},eb={colspan:"7",class:"px-5 py-3"},tb={class:"flex flex-wrap gap-x-8 gap-y-1.5 text-xs"},nb={class:"text-ink-secondary"},ib={class:"text-ink"},sb={class:"text-ink-secondary"},ob={class:"text-ink"},ab={class:"text-ink-secondary"},rb={class:"font-mono text-ink"},lb={key:0,class:"text-ink-secondary"},ub={class:"text-ink"},cb={key:0,class:"mt-2 space-y-1"},db={key:1,class:"mt-2 text-xs text-success-fg"},fb={key:0,class:"panel p-5"},hb={class:"mb-4 flex items-center justify-between"},pb={class:"eyebrow"},mb={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},gb={class:"block"},vb={class:"block"},_b={class:"block"},yb={class:"block"},bb={class:"block"},xb={class:"block"},wb=["value"],kb={class:"mt-3 flex flex-wrap gap-6"},Sb={class:"flex items-center gap-2 text-sm text-ink-secondary"},Tb={class:"flex items-center gap-2 text-sm text-ink-secondary"},Pb={class:"mt-4 flex items-center gap-3"},Cb=["disabled"],Lb={key:0,class:"text-sm text-danger-fg"},Mb={class:"panel overflow-hidden p-0"},Eb={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},Ob={key:1,class:"grid place-items-center px-5 py-16 text-center"},zb={key:2,class:"overflow-x-auto"},Ab={class:"w-full border-collapse text-sm"},$b={class:"text-left"},Ib={class:"px-5 py-3 font-semibold text-ink"},Db={class:"px-5 py-3 text-ink-secondary"},Nb={class:"px-5 py-3 font-mono text-ink-secondary"},Rb={class:"px-5 py-3"},Fb={key:1,class:"text-ink-muted"},Bb={class:"px-5 py-3"},Vb={class:"whitespace-nowrap px-5 py-3 text-right"},Ub=["onClick"],Zb=["onClick"],Hb=["onClick"],jb={__name:"Logbook",props:{email:{type:String,default:""},role:{type:String,default:"user"},organization:{type:String,default:""},organizationName:{type:String,default:""}},setup(t){const i=t,o={success:"bg-success-soft text-success-fg",warning:"bg-amber-soft text-amber-fg",danger:"bg-danger-soft text-danger-fg",accent:"bg-accent-soft text-accent-soft-fg",neutral:"bg-surface-2 text-ink-secondary"},l=G("flights"),u=G([]),d=G([]),h=G(!1),_=G("");async function y(){h.value=!0,_.value="";const[K,E]=await Promise.all([$c(),xp()]);(!K.ok||!E.ok)&&(_.value=K.status===503||E.status===503?"Logbook storage is not configured on the API Server (service account missing).":"Could not load the logbook."),u.value=K.drones,d.value=E.flights,h.value=!1}ui(y);function M(K){const E=K.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 S=G("");function O(K){S.value=S.value===K?"":K}const B=[{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"}],Z=[{value:"",label:"Auto (from drone)"},{value:"manual",label:"Manual"},{value:"automatic",label:"Automatic (FDR)"}];function F(){var K;return{operationDate:new Date().toISOString().slice(0,10),startTime:"",endTime:"",drone:((K=u.value[0])==null?void 0:K.id)||"",areaRoute:"",maxAltitudeAgl:"",pilotName:i.email,certificateRef:"",category:"open",purpose:"commercial",loggingPath:"",rawFdrLogUrl:"",authorisationRef:"",weather:"",airspaceRef:"",observer:"",incidents:"",notes:""}}const fe=G(!1),ve=G(""),q=yt(F()),Ce=G(""),he=G(!1),be=G(!1);function Re(){Object.assign(q,F()),ve.value="",Ce.value="",be.value=!1,fe.value=!0}function Ie(K){Object.assign(q,{operationDate:(K.operationDate||"").slice(0,10),startTime:K.startTime||"",endTime:K.endTime||"",drone:K.drone||"",areaRoute:K.areaRoute||"",maxAltitudeAgl:K.maxAltitudeAgl||"",pilotName:K.pilotName||"",certificateRef:K.certificateRef||"",category:K.category||"open",purpose:K.purpose||"commercial",loggingPath:K.loggingPath||"",rawFdrLogUrl:K.rawFdrLogUrl||"",authorisationRef:K.authorisationRef||"",weather:K.weather||"",airspaceRef:K.airspaceRef||"",observer:K.observer||"",incidents:K.incidents||"",notes:K.notes||""}),ve.value=K.id,Ce.value="",be.value=!!(K.weather||K.airspaceRef||K.observer||K.incidents||K.notes),fe.value=!0}function Ue(){fe.value=!1,ve.value=""}async function pe(){var A;if(Ce.value="",!q.drone){Ce.value="Select a drone first (add one on the Drones tab).";return}he.value=!0;const K={...q,maxAltitudeAgl:Number(q.maxAltitudeAgl)||0},E=ve.value?await kp(ve.value,K):await wp(K);if(he.value=!1,!E.ok){Ce.value=((A=E.body)==null?void 0:A.error)||"Could not save the flight.";return}fe.value=!1,await y()}const Ae=G("");async function Te(K){const E=await Sp(K.id);Ae.value="",E.ok&&await y()}const te=["","C0","C1","C2","C3","C4","C5","C6"];function de(){return{name:"",model:"",serial:"",operatorNumber:"",mtomGrams:"",isToy:!1,autologsFlights:!1,cClass:""}}const ye=G(!1),Se=G(""),ae=yt(de()),ue=G(""),ie=G(!1);function st(){Object.assign(ae,de()),Se.value="",ue.value="",ye.value=!0}function me(K){Object.assign(ae,{name:K.name||"",model:K.model||"",serial:K.serial||"",operatorNumber:K.operatorNumber||"",mtomGrams:K.mtomGrams||"",isToy:!!K.isToy,autologsFlights:!!K.autologsFlights,cClass:K.cClass||""}),Se.value=K.id,ue.value="",ye.value=!0}function ze(){ye.value=!1,Se.value=""}async function Je(){var A;if(ue.value="",!ae.name.trim()){ue.value="Give the drone a name.";return}ie.value=!0;const K={...ae,mtomGrams:Number(ae.mtomGrams)||0},E=Se.value?await yp(Se.value,K):await _p(K);if(ie.value=!1,!E.ok){ue.value=((A=E.body)==null?void 0:A.error)||"Could not save the drone.";return}ye.value=!1,await y()}const at=G("");async function et(K){var A;const E=await bp(K.id);at.value="",E.ok?await y():ue.value=((A=E.body)==null?void 0:A.error)||"Could not delete the drone."}const Ze=Pe(()=>{const K=d.value.length,E=d.value.filter(nt=>{var mt;return(((mt=nt.compliance)==null?void 0:mt.redFlags)||[]).length}).length,A=d.value.filter(nt=>{var mt;return(mt=nt.compliance)==null?void 0:mt.required}).length;return{total:K,flagged:E,required:A,fleet:u.value.length}});return(K,E)=>(p(),g("div",qy,[r("div",Yy,[r("div",Jy,[(p(),g(ce,null,Ve([["flights","Flights"],["drones","Drones"]],A=>r("button",{key:A[0],class:Oe(["rounded-md px-3.5 py-1.5 text-sm font-semibold transition",l.value===A[0]?"bg-accent-soft text-accent-soft-fg":"text-ink-secondary hover:text-ink"]),onClick:nt=>l.value=A[0]},k(A[1]),11,Xy)),64))]),r("div",Qy,[r("a",{href:$e(Tp)(),class:"btn-ghost inline-flex items-center gap-2",title:"Download a compliance CSV (Trafikstyrelsen / police disclosure)"},[z(X,{name:"download",size:15}),E[29]||(E[29]=D(" Export CSV ",-1))],8,e1),l.value==="flights"?(p(),g("button",{key:0,class:"btn-accent inline-flex items-center gap-2",onClick:Re},[z(X,{name:"plus",size:15}),E[30]||(E[30]=D(" Log flight ",-1))])):(p(),g("button",{key:1,class:"btn-accent inline-flex items-center gap-2",onClick:st},[z(X,{name:"plus",size:15}),E[31]||(E[31]=D(" Add drone ",-1))]))])]),r("div",t1,[(p(!0),g(ce,null,Ve([{label:"Flights logged",value:Ze.value.total,tone:"neutral"},{label:"Require logbook",value:Ze.value.required,tone:"neutral"},{label:"Compliance flags",value:Ze.value.flagged,tone:Ze.value.flagged?"danger":"success"},{label:"Registered drones",value:Ze.value.fleet,tone:"neutral"}],A=>(p(),g("div",{key:A.label,class:"panel p-5"},[r("div",n1,k(A.label),1),r("div",{class:Oe(["mt-2 text-[30px] font-bold leading-none tracking-tightest",A.tone==="danger"?"text-danger-fg":A.tone==="success"?"text-success-fg":"text-ink"])},k(A.value),3)]))),128))]),_.value?(p(),g("div",i1,k(_.value),1)):R("",!0),l.value==="flights"?(p(),g(ce,{key:1},[fe.value?(p(),g("div",s1,[r("div",o1,[r("div",null,[r("div",a1,k(ve.value?"Edit entry":"New entry"),1),E[32]||(E[32]=r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Logbook flight (BEK 1649 §5)",-1))]),r("button",{class:"btn-icon",onClick:Ue},[z(X,{name:"x",size:16})])]),r("div",r1,[r("label",l1,[E[33]||(E[33]=r("span",{class:"eyebrow mb-1 block"},"Date",-1)),re(r("input",{"onUpdate:modelValue":E[0]||(E[0]=A=>q.operationDate=A),type:"date",class:"field"},null,512),[[xe,q.operationDate]])]),r("label",u1,[E[34]||(E[34]=r("span",{class:"eyebrow mb-1 block"},"Start",-1)),re(r("input",{"onUpdate:modelValue":E[1]||(E[1]=A=>q.startTime=A),type:"time",class:"field"},null,512),[[xe,q.startTime]])]),r("label",c1,[E[35]||(E[35]=r("span",{class:"eyebrow mb-1 block"},"End",-1)),re(r("input",{"onUpdate:modelValue":E[2]||(E[2]=A=>q.endTime=A),type:"time",class:"field"},null,512),[[xe,q.endTime]])]),r("label",d1,[E[36]||(E[36]=r("span",{class:"eyebrow mb-1 block"},"Drone",-1)),re(r("select",{"onUpdate:modelValue":E[3]||(E[3]=A=>q.drone=A),class:"field"},[u.value.length?R("",!0):(p(),g("option",f1,"— add a drone first —")),(p(!0),g(ce,null,Ve(u.value,A=>(p(),g("option",{key:A.id,value:A.id},k(A.name)+k(A.model?` · ${A.model}`:""),9,h1))),128))],512),[[Mt,q.drone]])]),r("label",p1,[E[37]||(E[37]=r("span",{class:"eyebrow mb-1 block"},"Max altitude (m AGL)",-1)),re(r("input",{"onUpdate:modelValue":E[4]||(E[4]=A=>q.maxAltitudeAgl=A),type:"number",min:"0",class:"field",placeholder:"120"},null,512),[[xe,q.maxAltitudeAgl]])]),r("label",m1,[E[38]||(E[38]=r("span",{class:"eyebrow mb-1 block"},"Area / route",-1)),re(r("input",{"onUpdate:modelValue":E[5]||(E[5]=A=>q.areaRoute=A),class:"field",placeholder:"Field N of Roskilde, grid survey"},null,512),[[xe,q.areaRoute]])]),r("label",g1,[E[39]||(E[39]=r("span",{class:"eyebrow mb-1 block"},"Remote pilot name",-1)),re(r("input",{"onUpdate:modelValue":E[6]||(E[6]=A=>q.pilotName=A),class:"field",placeholder:"Full name"},null,512),[[xe,q.pilotName]])]),r("label",v1,[E[40]||(E[40]=r("span",{class:"eyebrow mb-1 block"},"Certificate ref",-1)),re(r("input",{"onUpdate:modelValue":E[7]||(E[7]=A=>q.certificateRef=A),class:"field",placeholder:"A2 / STS cert no."},null,512),[[xe,q.certificateRef]])]),r("label",_1,[E[41]||(E[41]=r("span",{class:"eyebrow mb-1 block"},"Logging path",-1)),re(r("select",{"onUpdate:modelValue":E[8]||(E[8]=A=>q.loggingPath=A),class:"field"},[(p(),g(ce,null,Ve(Z,A=>r("option",{key:A.value,value:A.value},k(A.label),9,y1)),64))],512),[[Mt,q.loggingPath]])]),r("label",b1,[E[42]||(E[42]=r("span",{class:"eyebrow mb-1 block"},"Category",-1)),re(r("select",{"onUpdate:modelValue":E[9]||(E[9]=A=>q.category=A),class:"field"},[(p(),g(ce,null,Ve(B,A=>r("option",{key:A.value,value:A.value},k(A.label),9,x1)),64))],512),[[Mt,q.category]])]),r("label",w1,[E[43]||(E[43]=r("span",{class:"eyebrow mb-1 block"},"Purpose",-1)),re(r("select",{"onUpdate:modelValue":E[10]||(E[10]=A=>q.purpose=A),class:"field"},[(p(),g(ce,null,Ve(V,A=>r("option",{key:A.value,value:A.value},k(A.label),9,k1)),64))],512),[[Mt,q.purpose]])]),r("label",S1,[E[44]||(E[44]=r("span",{class:"eyebrow mb-1 block"},"Authorisation ref",-1)),re(r("input",{"onUpdate:modelValue":E[11]||(E[11]=A=>q.authorisationRef=A),class:"field",placeholder:"Specific-category ref"},null,512),[[xe,q.authorisationRef]])])]),r("label",T1,[E[45]||(E[45]=r("span",{class:"eyebrow mb-1 block"},"FDR log URL (automatic path)",-1)),re(r("input",{"onUpdate:modelValue":E[12]||(E[12]=A=>q.rawFdrLogUrl=A),class:"field",placeholder:"Link to the stored flight-data-recorder export"},null,512),[[xe,q.rawFdrLogUrl]])]),r("button",{class:"mt-4 flex items-center gap-1.5 text-sm font-semibold text-accent",onClick:E[13]||(E[13]=A=>be.value=!be.value)},[z(X,{name:be.value?"x":"plus",size:14},null,8,["name"]),E[46]||(E[46]=D(" Operational details (weather, airspace, incidents) ",-1))]),be.value?(p(),g("div",P1,[r("label",C1,[E[47]||(E[47]=r("span",{class:"eyebrow mb-1 block"},"Weather / wind",-1)),re(r("input",{"onUpdate:modelValue":E[14]||(E[14]=A=>q.weather=A),class:"field",placeholder:"6 m/s NW, CAVOK"},null,512),[[xe,q.weather]])]),r("label",L1,[E[48]||(E[48]=r("span",{class:"eyebrow mb-1 block"},"Airspace / NOTAM ref",-1)),re(r("input",{"onUpdate:modelValue":E[15]||(E[15]=A=>q.airspaceRef=A),class:"field"},null,512),[[xe,q.airspaceRef]])]),r("label",M1,[E[49]||(E[49]=r("span",{class:"eyebrow mb-1 block"},"Observer",-1)),re(r("input",{"onUpdate:modelValue":E[16]||(E[16]=A=>q.observer=A),class:"field"},null,512),[[xe,q.observer]])]),r("label",E1,[E[50]||(E[50]=r("span",{class:"eyebrow mb-1 block"},"Incidents / anomalies",-1)),re(r("input",{"onUpdate:modelValue":E[17]||(E[17]=A=>q.incidents=A),class:"field",placeholder:"RTH trigger, GPS dropout…"},null,512),[[xe,q.incidents]])]),r("label",O1,[E[51]||(E[51]=r("span",{class:"eyebrow mb-1 block"},"Notes",-1)),re(r("textarea",{"onUpdate:modelValue":E[18]||(E[18]=A=>q.notes=A),rows:"2",class:"field"},null,512),[[xe,q.notes]])])])):R("",!0),r("div",z1,[r("button",{class:"btn-accent",disabled:he.value,onClick:pe},k(he.value?"Saving…":ve.value?"Save changes":"Log flight"),9,A1),r("button",{class:"btn-ghost",onClick:Ue},"Cancel"),Ce.value?(p(),g("span",$1,k(Ce.value),1)):R("",!0)])])):R("",!0),r("div",I1,[h.value?(p(),g("div",D1,"Loading…")):d.value.length?(p(),g("div",R1,[r("table",F1,[r("thead",null,[r("tr",B1,[(p(),g(ce,null,Ve(["Date","Drone","Area / route","Alt","Pilot","Compliance",""],A=>r("th",{key:A,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(A),1)),64))])]),r("tbody",null,[(p(!0),g(ce,null,Ve(d.value,A=>{var nt,mt,kt,b;return p(),g(ce,{key:A.id},[r("tr",{class:Oe(["border-b border-line last:border-0",ve.value===A.id?"bg-accent-soft":""])},[r("td",V1,[D(k((A.operationDate||"").slice(0,10))+" ",1),A.startTime?(p(),g("span",U1,k(A.startTime),1)):R("",!0)]),r("td",Z1,k(A.droneName||"—"),1),r("td",{class:"max-w-[220px] truncate px-5 py-3 text-ink-secondary",title:A.areaRoute},k(A.areaRoute||"—"),9,H1),r("td",j1,k(A.maxAltitudeAgl?A.maxAltitudeAgl+" m":"—"),1),r("td",W1,k(A.pilotName||"—"),1),r("td",K1,[r("button",{class:Oe(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",o[M(A).tone]]),onClick:v=>O(A.id)},[M(A).tone==="danger"?(p(),it(X,{key:0,name:"alertTriangle",size:12})):M(A).tone==="success"?(p(),it(X,{key:1,name:"check",size:12})):R("",!0),D(" "+k(M(A).label),1)],10,G1)]),r("td",q1,[Ae.value===A.id?(p(),g(ce,{key:0},[E[54]||(E[54]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),r("button",{class:"btn-ghost mr-1",onClick:E[19]||(E[19]=v=>Ae.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:v=>Te(A)},"Delete",8,Y1)],64)):(p(),g(ce,{key:1},[r("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:v=>Ie(A)},[z(X,{name:"sliders",size:13}),E[55]||(E[55]=D(" Edit",-1))],8,J1),r("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:v=>Ae.value=A.id},[z(X,{name:"trash",size:13})],8,X1)],64))])],2),S.value===A.id?(p(),g("tr",Q1,[r("td",eb,[r("div",tb,[r("span",nb,[E[56]||(E[56]=D("Logging path: ",-1)),r("b",ib,k(((nt=A.compliance)==null?void 0:nt.loggingPath)||"—"),1)]),r("span",sb,[E[57]||(E[57]=D("Category: ",-1)),r("b",ob,k(A.category||"—"),1)]),r("span",ab,[E[58]||(E[58]=D("Retain until: ",-1)),r("b",rb,k((A.retentionUntil||"").slice(0,10)||"—"),1)]),(mt=A.compliance)!=null&&mt.exempt?(p(),g("span",lb,[E[59]||(E[59]=D("Exempt: ",-1)),r("b",ub,k(A.compliance.exemptReason),1)])):R("",!0)]),(((kt=A.compliance)==null?void 0:kt.redFlags)||[]).length?(p(),g("ul",cb,[(p(!0),g(ce,null,Ve(A.compliance.redFlags,(v,w)=>(p(),g("li",{key:w,class:"flex items-start gap-2 text-xs text-danger-fg"},[z(X,{name:"alertTriangle",size:13,class:"mt-px shrink-0"}),D(" "+k(v),1)]))),128))])):(b=A.compliance)!=null&&b.exempt?R("",!0):(p(),g("div",db,"No compliance gaps detected."))])])):R("",!0)],64)}),128))])])])):(p(),g("div",N1,[z(X,{name:"book",size:26,class:"text-ink-muted"}),E[52]||(E[52]=r("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No flights logged yet",-1)),E[53]||(E[53]=r("div",{class:"mt-1 text-xs text-ink-muted"},"Log your first operation to start the 5-year retention record.",-1))]))])],64)):(p(),g(ce,{key:2},[ye.value?(p(),g("div",fb,[r("div",hb,[r("div",null,[r("div",pb,k(Se.value?"Edit drone":"New drone"),1),E[60]||(E[60]=r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Aircraft registry",-1))]),r("button",{class:"btn-icon",onClick:ze},[z(X,{name:"x",size:16})])]),r("div",mb,[r("label",gb,[E[61]||(E[61]=r("span",{class:"eyebrow mb-1 block"},"Name",-1)),re(r("input",{"onUpdate:modelValue":E[20]||(E[20]=A=>ae.name=A),class:"field",placeholder:"Mavic-01"},null,512),[[xe,ae.name]])]),r("label",vb,[E[62]||(E[62]=r("span",{class:"eyebrow mb-1 block"},"Model",-1)),re(r("input",{"onUpdate:modelValue":E[21]||(E[21]=A=>ae.model=A),class:"field",placeholder:"DJI Mavic 3 Enterprise"},null,512),[[xe,ae.model]])]),r("label",_b,[E[63]||(E[63]=r("span",{class:"eyebrow mb-1 block"},"Serial",-1)),re(r("input",{"onUpdate:modelValue":E[22]||(E[22]=A=>ae.serial=A),class:"field"},null,512),[[xe,ae.serial]])]),r("label",yb,[E[64]||(E[64]=r("span",{class:"eyebrow mb-1 block"},"Operator no.",-1)),re(r("input",{"onUpdate:modelValue":E[23]||(E[23]=A=>ae.operatorNumber=A),class:"field",placeholder:"DNK…"},null,512),[[xe,ae.operatorNumber]])]),r("label",bb,[E[65]||(E[65]=r("span",{class:"eyebrow mb-1 block"},"MTOM (grams)",-1)),re(r("input",{"onUpdate:modelValue":E[24]||(E[24]=A=>ae.mtomGrams=A),type:"number",min:"0",class:"field",placeholder:"920"},null,512),[[xe,ae.mtomGrams]])]),r("label",xb,[E[66]||(E[66]=r("span",{class:"eyebrow mb-1 block"},"C-class",-1)),re(r("select",{"onUpdate:modelValue":E[25]||(E[25]=A=>ae.cClass=A),class:"field"},[(p(),g(ce,null,Ve(te,A=>r("option",{key:A,value:A},k(A||"— none —"),9,wb)),64))],512),[[Mt,ae.cClass]])])]),r("div",kb,[r("label",Sb,[re(r("input",{"onUpdate:modelValue":E[26]||(E[26]=A=>ae.autologsFlights=A),type:"checkbox",class:"h-4 w-4 accent-[var(--accent)]"},null,512),[[da,ae.autologsFlights]]),E[67]||(E[67]=D(" Auto-logs flights (onboard FDR) ",-1))]),r("label",Tb,[re(r("input",{"onUpdate:modelValue":E[27]||(E[27]=A=>ae.isToy=A),type:"checkbox",class:"h-4 w-4 accent-[var(--accent)]"},null,512),[[da,ae.isToy]]),E[68]||(E[68]=D(" Toy drone (logbook-exempt) ",-1))])]),r("div",Pb,[r("button",{class:"btn-accent",disabled:ie.value,onClick:Je},k(ie.value?"Saving…":Se.value?"Save changes":"Add drone"),9,Cb),r("button",{class:"btn-ghost",onClick:ze},"Cancel"),ue.value?(p(),g("span",Lb,k(ue.value),1)):R("",!0)])])):R("",!0),r("div",Mb,[h.value?(p(),g("div",Eb,"Loading…")):u.value.length?(p(),g("div",zb,[r("table",Ab,[r("thead",null,[r("tr",$b,[(p(),g(ce,null,Ve(["Name","Model","MTOM","Class","FDR",""],A=>r("th",{key:A,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(A),1)),64))])]),r("tbody",null,[(p(!0),g(ce,null,Ve(u.value,A=>(p(),g("tr",{key:A.id,class:Oe(["border-b border-line last:border-0",Se.value===A.id?"bg-accent-soft":""])},[r("td",Ib,k(A.name),1),r("td",Db,k(A.model||"—"),1),r("td",Nb,k(A.mtomGrams?A.mtomGrams+" g":"—"),1),r("td",Rb,[A.cClass?(p(),g("span",{key:0,class:Oe(["inline-flex rounded-full px-2 py-0.5 text-[11px] font-semibold",o.accent])},k(A.cClass),3)):(p(),g("span",Fb,"—")),A.isToy?(p(),g("span",{key:2,class:Oe(["ml-1 inline-flex rounded-full px-2 py-0.5 text-[11px] font-semibold",o.neutral])},"toy",2)):R("",!0)]),r("td",Bb,[r("span",{class:Oe(["text-xs",A.autologsFlights?"text-success-fg":"text-ink-muted"])},k(A.autologsFlights?"yes":"no"),3)]),r("td",Vb,[at.value===A.id?(p(),g(ce,{key:0},[E[71]||(E[71]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),r("button",{class:"btn-ghost mr-1",onClick:E[28]||(E[28]=nt=>at.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:nt=>et(A)},"Delete",8,Ub)],64)):(p(),g(ce,{key:1},[r("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:nt=>me(A)},[z(X,{name:"sliders",size:13}),E[72]||(E[72]=D(" Edit",-1))],8,Zb),r("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:nt=>at.value=A.id},[z(X,{name:"trash",size:13})],8,Hb)],64))])],2))),128))])])])):(p(),g("div",Ob,[z(X,{name:"drone",size:26,class:"text-ink-muted"}),E[69]||(E[69]=r("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No drones registered",-1)),E[70]||(E[70]=r("div",{class:"mt-1 text-xs text-ink-muted"},"Register the airframes you fly to log flights against them.",-1))]))])],64))]))}},Wb={class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},Kb={class:"flex flex-wrap items-center gap-3"},Gb={class:"inline-flex flex-wrap rounded-lg border border-line bg-surface-1 p-0.5"},qb=["onClick"],Yb={class:"ml-auto"},Jb={class:"grid grid-cols-4 gap-4 max-[900px]:grid-cols-2"},Xb={class:"eyebrow"},Qb={key:0,class:"panel border-danger/40 p-4 text-sm text-danger-fg"},ex={key:1,class:"panel p-5"},tx={class:"mb-4 flex items-center justify-between"},nx={class:"eyebrow"},ix={class:"mt-0.5 text-base font-semibold text-ink"},sx={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},ox={class:"col-span-2 block max-[760px]:col-span-1"},ax={class:"block"},rx=["value"],lx={class:"block"},ux=["value"],cx={class:"block"},dx=["value"],fx={class:"block"},hx={class:"block"},px={class:"block"},mx={class:"block"},gx=["value"],vx={class:"block"},_x={class:"block"},yx={class:"block"},bx=["value"],xx={class:"mt-3 block"},wx={key:0,class:"mt-3"},kx={class:"eyebrow mb-1 block"},Sx={key:1,class:"mt-3 text-xs text-ink-muted"},Tx={class:"mt-4 flex items-center gap-3"},Px=["disabled"],Cx={key:0,class:"text-sm text-danger-fg"},Lx={class:"panel overflow-hidden p-0"},Mx={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},Ex={key:1,class:"grid place-items-center px-5 py-16 text-center"},Ox={class:"mt-3 text-sm font-medium text-ink-secondary"},zx={class:"mt-1 text-xs text-ink-muted"},Ax={key:2,class:"overflow-x-auto"},$x={class:"w-full border-collapse text-sm"},Ix={class:"text-left"},Dx={class:"px-5 py-3"},Nx={class:"font-semibold text-ink"},Rx={key:0,class:"font-mono text-[11px] text-ink-muted"},Fx={class:"px-5 py-3 text-ink-secondary"},Bx={class:"px-5 py-3 text-ink-secondary"},Vx={class:"px-5 py-3"},Ux=["onClick"],Zx={key:0,class:"mt-0.5 font-mono text-[10.5px] text-ink-muted"},Hx={class:"px-5 py-3 font-mono text-ink-secondary"},jx={class:"whitespace-nowrap px-5 py-3 text-right"},Wx=["onClick"],Kx=["onClick"],Gx=["href"],qx=["onClick"],Yx=["onClick"],Jx=["onClick"],Xx={key:0,class:"border-b border-line bg-surface-2"},Qx={colspan:"6",class:"px-5 py-3"},e0={class:"flex flex-wrap gap-x-8 gap-y-1.5 text-xs"},t0={class:"text-ink-secondary"},n0={class:"text-ink"},i0={class:"text-ink-secondary"},s0={class:"text-ink"},o0={key:0,class:"text-ink-secondary"},a0={class:"text-ink"},r0={key:1,class:"text-ink-secondary"},l0={class:"font-mono text-ink"},u0={key:2,class:"text-ink-secondary"},c0={class:"font-mono text-ink"},d0={class:"text-ink-secondary"},f0={class:"text-ink"},h0={key:0,class:"mt-2 space-y-1"},p0={key:1,class:"mt-2 text-xs text-success-fg"},m0={key:2,class:"mt-2 text-xs text-ink-secondary"},g0={class:"flex max-h-[90vh] w-full max-w-[920px] flex-col overflow-hidden rounded-lg border border-line bg-surface-1 shadow-2xl"},v0={class:"flex items-center gap-3 border-b border-line px-5 py-3"},_0={class:"min-w-0"},y0={class:"truncate text-sm font-semibold text-ink"},b0={class:"truncate font-mono text-[11px] text-ink-muted"},x0={class:"ml-auto flex items-center gap-2"},w0=["href"],k0=["href"],S0={class:"flex-1 overflow-auto bg-surface-2"},T0=["src","alt"],P0=["src","title"],C0={key:2,class:"grid place-items-center px-6 py-16 text-center"},L0={class:"mt-1 text-xs text-ink-muted"},M0=["href"],E0={__name:"Documents",props:{email:{type:String,default:""},role:{type:String,default:"user"},organization:{type:String,default:""},organizationName:{type:String,default:""}},setup(t){const i={success:"bg-success-soft text-success-fg",warning:"bg-amber-soft text-amber-fg",danger:"bg-danger-soft text-danger-fg",accent:"bg-accent-soft text-accent-soft-fg",neutral:"bg-surface-2 text-ink-secondary"},o=[{value:"certificate",label:"Pilot certificate"},{value:"medical",label:"Medical / training"},{value:"insurance",label:"Insurance / liability"},{value:"background_check",label:"Background check / waiver"},{value:"registration",label:"Aircraft registration"},{value:"maintenance",label:"Maintenance log"},{value:"conformity",label:"Conformity / compliance"},{value:"firmware",label:"Firmware / software"},{value:"incident",label:"Incident / repair report"},{value:"flight_log",label:"Flight log"},{value:"checklist",label:"Pre-flight checklist"},{value:"airspace_auth",label:"Airspace authorisation"},{value:"mission_plan",label:"Mission plan / flight path"},{value:"risk_assessment",label:"Risk assessment / survey"},{value:"contract",label:"Contract / SOW"},{value:"client_insurance",label:"Client insurance cert"},{value:"delivery_report",label:"Delivery / media handoff"},{value:"other",label:"Other"}],l=Object.fromEntries(o.map(b=>[b.value,b.label])),u=[{value:"pilot",label:"Pilot"},{value:"aircraft",label:"Aircraft"},{value:"organization",label:"Organization"},{value:"client",label:"Client"},{value:"other",label:"Other"}],d=[{value:"active",label:"Active"},{value:"pending_review",label:"Pending review"},{value:"archived",label:"Archived"}],h=[{value:"pilot",label:"Pilot"},{value:"ops",label:"Ops manager"},{value:"admin",label:"Admin"},{value:"client",label:"Client-facing"}],_=G([]),y=G([]),M=G(!1),S=G("");async function O(){M.value=!0,S.value="";const[b,v]=await Promise.all([Pp(),$c()]);b.ok||(S.value=b.status===503?"Document storage is not configured on the API Server (service account missing).":"Could not load documents."),_.value=b.documents,y.value=v.drones||[],M.value=!1}ui(O);const B=G("all"),V=[["all","All"],["expiring","Expiring soon"],["expired","Expired"],["pending","Pending review"],["archived","Archived"]],Z=Pe(()=>{const b=_.value;switch(B.value){case"expiring":return b.filter(v=>{var w;return((w=v.expiry)==null?void 0:w.state)==="expiring_soon"&&v.status!=="archived"});case"expired":return b.filter(v=>{var w;return((w=v.expiry)==null?void 0:w.state)==="expired"&&v.status!=="archived"});case"pending":return b.filter(v=>v.status==="pending_review");case"archived":return b.filter(v=>v.status==="archived");default:return b.filter(v=>v.status!=="archived")}});function F(b){if(b.status==="archived")return{tone:"neutral",label:"Superseded",icon:""};const v=b.expiry||{};return v.state==="expired"?{tone:"danger",label:"Expired",icon:"alertTriangle"}:v.state==="expiring_soon"?{tone:"warning",label:`Expires in ${v.daysUntilExpiry}d`,icon:"clock"}:v.state==="valid"?{tone:"success",label:"Valid",icon:"check"}:{tone:"neutral",label:"No expiry",icon:""}}const fe=G("");function ve(b){fe.value=fe.value===b?"":b}function q(b){return b.ownerDrone?b.ownerDroneName||"Aircraft":b.ownerRef?b.ownerRef:b.ownerType==="pilot"?"Pilot":b.ownerType?b.ownerType.charAt(0).toUpperCase()+b.ownerType.slice(1):"—"}const Ce=["png","jpg","jpeg","gif","webp","svg","bmp","avif"],he=["pdf","txt","csv","log","json","md","html","htm","xml"];function be(b){const v=(b||"").split(".").pop().toLowerCase();return Ce.includes(v)?"image":he.includes(v)?"frame":"none"}const Re=G(null),Ie=Pe(()=>Re.value?be(Re.value.fileName):"none"),Ue=Pe(()=>Re.value?Ep(Re.value.id):"");function pe(b){Re.value=b}function Ae(){Re.value=null}function Te(b){b.key==="Escape"&&Re.value&&Ae()}ui(()=>window.addEventListener("keydown",Te)),Os(()=>window.removeEventListener("keydown",Te));function te(){return{title:"",docType:"certificate",ownerType:"pilot",ownerDrone:"",ownerRef:"",reference:"",jurisdiction:"",issueDate:"",expiryDate:"",status:"active",accessTier:"ops",notes:""}}const de=G(!1),ye=G(""),Se=G(""),ae=G(""),ue=yt(te()),ie=G(null),st=G(null),me=G(""),ze=G(!1);function Je(){ie.value=null,st.value&&(st.value.value="")}function at(){Object.assign(ue,te()),ye.value="",Se.value="",ae.value="",Je(),me.value="",de.value=!0}function et(b){Object.assign(ue,{title:b.title||"",docType:b.docType||"certificate",ownerType:b.ownerType||"pilot",ownerDrone:b.ownerDrone||"",ownerRef:b.ownerRef||"",reference:b.reference||"",jurisdiction:b.jurisdiction||"",issueDate:b.issueDate||"",expiryDate:b.expiryDate||"",status:b.status||"active",accessTier:b.accessTier||"ops",notes:b.notes||""}),ye.value=b.id,Se.value="",ae.value="",Je(),me.value="",de.value=!0}function Ze(b){et(b),ye.value="",Se.value=b.id,ae.value=b.title,ue.status="active"}function K(){de.value=!1,ye.value="",Se.value=""}function E(b){var v;ie.value=((v=b.target.files)==null?void 0:v[0])||null}async function A(){var v;if(me.value="",!ue.title.trim()){me.value="Give the document a title.";return}ze.value=!0;let b;if(ye.value)b=await Lp(ye.value,{...ue});else{const w={...ue};Se.value&&(w.replaces=Se.value),b=await Cp(w,ie.value)}if(ze.value=!1,!b.ok){me.value=((v=b.body)==null?void 0:v.error)||"Could not save the document.";return}de.value=!1,ye.value="",Se.value="",await O()}const nt=G("");async function mt(b){var w;const v=await Mp(b.id);nt.value="",v.ok?await O():me.value=((w=v.body)==null?void 0:w.error)||"Could not delete the document."}const kt=Pe(()=>{const b=_.value.filter(v=>v.status!=="archived");return{total:b.length,expiring:b.filter(v=>{var w;return((w=v.expiry)==null?void 0:w.state)==="expiring_soon"}).length,expired:b.filter(v=>{var w;return((w=v.expiry)==null?void 0:w.state)==="expired"}).length,pending:_.value.filter(v=>v.status==="pending_review").length}});return(b,v)=>(p(),g("div",Wb,[r("div",Kb,[r("div",Gb,[(p(),g(ce,null,Ve(V,w=>r("button",{key:w[0],class:Oe(["rounded-md px-3.5 py-1.5 text-sm font-semibold transition",B.value===w[0]?"bg-accent-soft text-accent-soft-fg":"text-ink-secondary hover:text-ink"]),onClick:W=>B.value=w[0]},k(w[1]),11,qb)),64))]),r("div",Yb,[r("button",{class:"btn-accent inline-flex items-center gap-2",onClick:at},[z(X,{name:"upload",size:15}),v[13]||(v[13]=D(" Add document ",-1))])])]),r("div",Jb,[(p(!0),g(ce,null,Ve([{label:"Documents on file",value:kt.value.total,tone:"neutral"},{label:"Expiring soon",value:kt.value.expiring,tone:kt.value.expiring?"warning":"neutral"},{label:"Expired",value:kt.value.expired,tone:kt.value.expired?"danger":"success"},{label:"Pending review",value:kt.value.pending,tone:kt.value.pending?"accent":"neutral"}],w=>(p(),g("div",{key:w.label,class:"panel p-5"},[r("div",Xb,k(w.label),1),r("div",{class:Oe(["mt-2 text-[30px] font-bold leading-none tracking-tightest",w.tone==="danger"?"text-danger-fg":w.tone==="warning"?"text-amber-fg":w.tone==="success"?"text-success-fg":w.tone==="accent"?"text-accent-soft-fg":"text-ink"])},k(w.value),3)]))),128))]),S.value?(p(),g("div",Qb,k(S.value),1)):R("",!0),de.value?(p(),g("div",ex,[r("div",tx,[r("div",null,[r("div",nx,k(ye.value?"Edit document":Se.value?"New version":"New document"),1),r("div",ix,k(Se.value?`Supersedes “${ae.value}”`:"Compliance & operational document"),1)]),r("button",{class:"btn-icon",onClick:K},[z(X,{name:"x",size:16})])]),r("div",sx,[r("label",ox,[v[14]||(v[14]=r("span",{class:"eyebrow mb-1 block"},"Title",-1)),re(r("input",{"onUpdate:modelValue":v[0]||(v[0]=w=>ue.title=w),class:"field",placeholder:"A2 Remote Pilot Certificate — J. Dariusz"},null,512),[[xe,ue.title]])]),r("label",ax,[v[15]||(v[15]=r("span",{class:"eyebrow mb-1 block"},"Type",-1)),re(r("select",{"onUpdate:modelValue":v[1]||(v[1]=w=>ue.docType=w),class:"field"},[(p(),g(ce,null,Ve(o,w=>r("option",{key:w.value,value:w.value},k(w.label),9,rx)),64))],512),[[Mt,ue.docType]])]),r("label",lx,[v[16]||(v[16]=r("span",{class:"eyebrow mb-1 block"},"Owner type",-1)),re(r("select",{"onUpdate:modelValue":v[2]||(v[2]=w=>ue.ownerType=w),class:"field"},[(p(),g(ce,null,Ve(u,w=>r("option",{key:w.value,value:w.value},k(w.label),9,ux)),64))],512),[[Mt,ue.ownerType]])]),r("label",cx,[v[18]||(v[18]=r("span",{class:"eyebrow mb-1 block"},"Aircraft (if any)",-1)),re(r("select",{"onUpdate:modelValue":v[3]||(v[3]=w=>ue.ownerDrone=w),class:"field"},[v[17]||(v[17]=r("option",{value:""},"— none —",-1)),(p(!0),g(ce,null,Ve(y.value,w=>(p(),g("option",{key:w.id,value:w.id},k(w.name)+k(w.model?` · ${w.model}`:""),9,dx))),128))],512),[[Mt,ue.ownerDrone]])]),r("label",fx,[v[19]||(v[19]=r("span",{class:"eyebrow mb-1 block"},"Owner reference",-1)),re(r("input",{"onUpdate:modelValue":v[4]||(v[4]=w=>ue.ownerRef=w),class:"field",placeholder:"Client name / serial / site"},null,512),[[xe,ue.ownerRef]])]),r("label",hx,[v[20]||(v[20]=r("span",{class:"eyebrow mb-1 block"},"Reference / number",-1)),re(r("input",{"onUpdate:modelValue":v[5]||(v[5]=w=>ue.reference=w),class:"field",placeholder:"Cert / registration / policy no."},null,512),[[xe,ue.reference]])]),r("label",px,[v[21]||(v[21]=r("span",{class:"eyebrow mb-1 block"},"Jurisdiction",-1)),re(r("input",{"onUpdate:modelValue":v[6]||(v[6]=w=>ue.jurisdiction=w),class:"field",placeholder:"DK / EASA / FAA"},null,512),[[xe,ue.jurisdiction]])]),r("label",mx,[v[22]||(v[22]=r("span",{class:"eyebrow mb-1 block"},"Access tier",-1)),re(r("select",{"onUpdate:modelValue":v[7]||(v[7]=w=>ue.accessTier=w),class:"field"},[(p(),g(ce,null,Ve(h,w=>r("option",{key:w.value,value:w.value},k(w.label),9,gx)),64))],512),[[Mt,ue.accessTier]])]),r("label",vx,[v[23]||(v[23]=r("span",{class:"eyebrow mb-1 block"},"Issue date",-1)),re(r("input",{"onUpdate:modelValue":v[8]||(v[8]=w=>ue.issueDate=w),type:"date",class:"field"},null,512),[[xe,ue.issueDate]])]),r("label",_x,[v[24]||(v[24]=r("span",{class:"eyebrow mb-1 block"},"Expiry date",-1)),re(r("input",{"onUpdate:modelValue":v[9]||(v[9]=w=>ue.expiryDate=w),type:"date",class:"field"},null,512),[[xe,ue.expiryDate]])]),r("label",yx,[v[25]||(v[25]=r("span",{class:"eyebrow mb-1 block"},"Status",-1)),re(r("select",{"onUpdate:modelValue":v[10]||(v[10]=w=>ue.status=w),class:"field"},[(p(),g(ce,null,Ve(d,w=>r("option",{key:w.value,value:w.value},k(w.label),9,bx)),64))],512),[[Mt,ue.status]])])]),r("label",xx,[v[26]||(v[26]=r("span",{class:"eyebrow mb-1 block"},"Notes",-1)),re(r("textarea",{"onUpdate:modelValue":v[11]||(v[11]=w=>ue.notes=w),rows:"2",class:"field",placeholder:"Conditions, renewal contacts, anything worth recording"},null,512),[[xe,ue.notes]])]),ye.value?(p(),g("div",Sx,[...v[28]||(v[28]=[D(" Editing updates metadata only. To replace the file, close this and use ",-1),r("b",{class:"text-ink-secondary"},"New version",-1),D(" on the document — the old version is kept for audit. ",-1)])])):(p(),g("div",wx,[r("span",kx,"File "+k(Se.value?"(new version)":"(optional)"),1),r("input",{ref_key:"fileInput",ref:st,type:"file",class:"field",onChange:E},null,544),v[27]||(v[27]=r("p",{class:"mt-1 text-xs text-ink-muted"}," Stored in PocketBase for now (object storage later). Max 50 MB. ",-1))])),r("div",Tx,[r("button",{class:"btn-accent",disabled:ze.value,onClick:A},k(ze.value?"Saving…":ye.value?"Save changes":Se.value?"Upload new version":"Add document"),9,Px),r("button",{class:"btn-ghost",onClick:K},"Cancel"),me.value?(p(),g("span",Cx,k(me.value),1)):R("",!0)])])):R("",!0),r("div",Lx,[M.value?(p(),g("div",Mx,"Loading…")):Z.value.length?(p(),g("div",Ax,[r("table",$x,[r("thead",null,[r("tr",Ix,[(p(),g(ce,null,Ve(["Title","Type","Owner","Expiry","Ver",""],w=>r("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))])]),r("tbody",null,[(p(!0),g(ce,null,Ve(Z.value,w=>{var W,H;return p(),g(ce,{key:w.id},[r("tr",{class:Oe(["border-b border-line last:border-0",ye.value===w.id?"bg-accent-soft":""])},[r("td",Dx,[r("div",Nx,k(w.title),1),w.reference?(p(),g("div",Rx,k(w.reference),1)):R("",!0)]),r("td",Fx,k($e(l)[w.docType]||w.docType||"—"),1),r("td",Bx,k(q(w)),1),r("td",Vx,[r("button",{class:Oe(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",i[F(w).tone]]),onClick:U=>ve(w.id)},[F(w).icon?(p(),it(X,{key:0,name:F(w).icon,size:12},null,8,["name"])):R("",!0),D(" "+k(F(w).label),1)],10,Ux),w.expiryDate?(p(),g("div",Zx,k(w.expiryDate),1)):R("",!0)]),r("td",Hx,"v"+k(w.version||1),1),r("td",jx,[nt.value===w.id?(p(),g(ce,{key:0},[v[29]||(v[29]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),r("button",{class:"btn-ghost mr-1",onClick:v[12]||(v[12]=U=>nt.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:U=>mt(w)},"Delete",8,Wx)],64)):(p(),g(ce,{key:1},[w.hasFile?(p(),g("button",{key:0,class:"btn-ghost mr-1 inline-flex items-center gap-1",title:"Preview",onClick:U=>pe(w)},[z(X,{name:"eye",size:13})],8,Kx)):R("",!0),w.hasFile?(p(),g("a",{key:1,href:$e(lr)(w.id),class:"btn-ghost mr-1 inline-flex items-center gap-1",title:"Download file"},[z(X,{name:"download",size:13})],8,Gx)):R("",!0),r("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",title:"Upload new version",onClick:U=>Ze(w)},[z(X,{name:"upload",size:13})],8,qx),r("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:U=>et(w)},[z(X,{name:"sliders",size:13}),v[30]||(v[30]=D(" Edit",-1))],8,Yx),r("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:U=>nt.value=w.id},[z(X,{name:"trash",size:13})],8,Jx)],64))])],2),fe.value===w.id?(p(),g("tr",Xx,[r("td",Qx,[r("div",e0,[r("span",t0,[v[31]||(v[31]=D("Status: ",-1)),r("b",n0,k(w.status||"—"),1)]),r("span",i0,[v[32]||(v[32]=D("Access: ",-1)),r("b",s0,k(w.accessTier||"—"),1)]),w.jurisdiction?(p(),g("span",o0,[v[33]||(v[33]=D("Jurisdiction: ",-1)),r("b",a0,k(w.jurisdiction),1)])):R("",!0),w.issueDate?(p(),g("span",r0,[v[34]||(v[34]=D("Issued: ",-1)),r("b",l0,k(w.issueDate),1)])):R("",!0),w.expiryDate?(p(),g("span",u0,[v[35]||(v[35]=D("Expires: ",-1)),r("b",c0,k(w.expiryDate),1)])):R("",!0),r("span",d0,[v[36]||(v[36]=D("File: ",-1)),r("b",f0,k(w.hasFile?w.fileName:"none"),1)])]),(((W=w.expiry)==null?void 0:W.flags)||[]).length?(p(),g("ul",h0,[(p(!0),g(ce,null,Ve(w.expiry.flags,(U,ne)=>(p(),g("li",{key:ne,class:Oe(["flex items-start gap-2 text-xs",w.expiry.state==="expired"?"text-danger-fg":w.expiry.state==="expiring_soon"?"text-amber-fg":"text-ink-secondary"])},[z(X,{name:"alertTriangle",size:13,class:"mt-px shrink-0"}),D(" "+k(U),1)],2))),128))])):((H=w.expiry)==null?void 0:H.state)==="valid"?(p(),g("div",p0,"In force — no action needed.")):R("",!0),w.notes?(p(),g("div",m0,[v[37]||(v[37]=r("span",{class:"text-ink-muted"},"Notes:",-1)),D(" "+k(w.notes),1)])):R("",!0)])])):R("",!0)],64)}),128))])])])):(p(),g("div",Ex,[z(X,{name:"fileText",size:26,class:"text-ink-muted"}),r("div",Ox,k(B.value==="all"?"No documents on file yet":"Nothing in this view"),1),r("div",zx,k(B.value==="all"?"Add certificates, registrations, insurance and authorisations to track their expiry.":"Try a different filter."),1)]))]),(p(),it(af,{to:"body"},[Re.value?(p(),g("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:Vr(Ae,["self"])},[r("div",g0,[r("div",v0,[r("div",_0,[r("div",y0,k(Re.value.title),1),r("div",b0,k(Re.value.fileName),1)]),r("div",x0,[r("a",{href:Ue.value,target:"_blank",rel:"noopener",class:"btn-ghost inline-flex items-center gap-1.5",title:"Open in new tab"},[z(X,{name:"globe",size:14}),v[38]||(v[38]=D(" New tab ",-1))],8,w0),r("a",{href:$e(lr)(Re.value.id),class:"btn-ghost inline-flex items-center gap-1.5",title:"Download"},[z(X,{name:"download",size:14}),v[39]||(v[39]=D(" Download ",-1))],8,k0),r("button",{class:"btn-icon",title:"Close",onClick:Ae},[z(X,{name:"x",size:16})])])]),r("div",S0,[Ie.value==="image"?(p(),g("img",{key:0,src:Ue.value,alt:Re.value.title,class:"mx-auto block max-w-full"},null,8,T0)):Ie.value==="frame"?(p(),g("iframe",{key:1,src:Ue.value,class:"h-[74vh] w-full border-0 bg-white",title:Re.value.title},null,8,P0)):(p(),g("div",C0,[z(X,{name:"fileText",size:28,class:"text-ink-muted"}),v[41]||(v[41]=r("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"Preview isn't available for this file type",-1)),r("div",L0,k(Re.value.fileName),1),r("a",{href:$e(lr)(Re.value.id),class:"btn-accent mt-4 inline-flex items-center gap-2"},[z(X,{name:"download",size:15}),v[40]||(v[40]=D(" Download instead ",-1))],8,M0)]))])])])):R("",!0)]))]))}},O0={class:"grid h-full grid-cols-[248px_1fr] max-[900px]:grid-cols-1"},z0={class:"flex flex-col border-r border-line bg-surface-1 px-4 py-5 max-[900px]:hidden"},A0={class:"flex items-center gap-2.5 px-2 pb-5"},$0={class:"flex flex-col gap-0.5"},I0=["onClick"],D0={class:"mt-auto flex flex-col gap-2.5"},N0={class:"rounded-lg bg-surface-2 p-3"},R0={class:"flex items-center gap-2"},F0={class:"text-xs font-semibold text-ink"},B0={class:"mt-1.5 block font-mono text-[10.5px] text-ink-muted"},V0={class:"flex items-center gap-2.5 px-2 py-1"},U0={class:"grid h-8 w-8 place-items-center rounded-full bg-[var(--navy-800)] text-xs font-bold text-white"},Z0={class:"min-w-0 flex-1"},H0={class:"truncate text-[13px] font-semibold text-ink"},j0={class:"flex items-center gap-1.5 text-[11px] text-ink-muted"},W0=["title"],K0={class:"overflow-y-auto"},G0={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)"}},q0={class:"mt-0.5 text-[22px] font-bold tracking-tightest text-ink"},Y0={class:"ml-auto flex items-center gap-3"},J0={class:"flex h-10 w-60 items-center gap-2 rounded border border-line-strong bg-surface-1 px-3 max-[1100px]:hidden"},X0={key:0,class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},Q0={class:"grid grid-cols-4 gap-4 max-[1100px]:grid-cols-2 max-[560px]:grid-cols-1"},ew={class:"flex items-center justify-between"},tw={class:"eyebrow"},nw={class:"mt-2.5 text-[34px] font-bold leading-none tracking-tightest text-ink"},iw={class:"grid grid-cols-[1.6fr_1fr] gap-5 max-[1100px]:grid-cols-1"},sw={class:"panel p-5"},ow={class:"mb-3.5 flex items-center justify-between"},aw={class:"flex items-center gap-2"},rw={class:"relative z-[1200]"},lw={class:"panel absolute right-0 z-[1200] mt-1.5 w-72 p-3.5 shadow-lg"},uw={class:"flex items-center justify-between gap-3"},cw={class:"mb-1.5 flex items-center justify-between"},dw={class:"font-mono text-[11px] text-ink-muted"},fw=["value"],hw={key:0,class:"mt-1.5 text-[11px] text-ink-muted"},pw={key:0,class:"mt-2.5 text-xs text-ink-muted"},mw={key:1,class:"mt-2.5 text-xs text-ink-muted"},gw={key:2,class:"mt-2.5 text-xs text-ink-muted"},vw={class:"panel p-5"},_w={class:"mb-3.5 flex items-center justify-between"},yw={class:"grid place-items-center py-10 text-center"},bw={class:"panel overflow-hidden p-0"},xw={class:"flex items-center justify-between px-5 py-4"},ww={class:"flex gap-2"},kw={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},Sw={key:1,class:"overflow-x-auto"},Tw={class:"w-full border-collapse text-sm"},Pw={class:"text-left"},Cw=["onClick"],Lw={class:"px-5 py-3 font-mono font-bold text-ink"},Mw={class:"px-5 py-3 text-ink-secondary"},Ew={class:"px-5 py-3"},Ow={class:"px-5 py-3 font-mono text-ink-secondary"},zw={class:"px-5 py-3"},Aw={key:0,class:"flex items-center gap-2"},$w={class:"h-1.5 w-12 overflow-hidden rounded bg-surface-2"},Iw={class:"font-mono text-xs text-ink-secondary"},Dw={key:1,class:"font-mono text-xs text-ink-muted"},Nw={class:"px-5 py-3 font-mono text-ink-secondary"},Rw={class:"px-5 py-3 text-right"},Fw=["onClick"],Bw={key:1,class:"p-7"},Vw={class:"mb-4 flex flex-wrap items-center gap-3"},Uw={class:"font-mono text-mode font-bold text-ink"},Zw={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"},Hw={key:1,class:"ml-auto flex flex-wrap gap-1.5"},jw=["onClick"],Ww={key:0,class:"panel grid place-items-center p-16 text-center"},Kw={class:"pill"},Gw={class:"pill"},qw={class:"pill"},Yw={class:"mt-1 text-sm font-semibold text-ink"},Jw={class:"pill"},Xw={class:"mt-1 font-mono text-sm font-bold tabular text-ink"},Qw={class:"grid grid-cols-2 gap-4 max-[820px]:grid-cols-1"},ek={class:"panel p-4"},tk={class:"flex items-center gap-4"},nk={class:"h-9 flex-1 overflow-hidden rounded border border-line bg-surface-2"},ik={class:"readout"},sk={class:"panel p-4"},ok={class:"readout"},ak={class:"panel p-4"},rk={class:"space-y-1.5 text-sm"},lk={class:"flex justify-between"},uk={class:"text-ink"},ck={class:"flex justify-between"},dk={class:"text-ink"},fk={class:"flex justify-between"},hk={class:"font-mono tabular text-ink"},pk={class:"flex justify-between"},mk={class:"font-mono tabular text-ink"},gk={class:"panel p-4"},vk={class:"space-y-1.5 text-sm"},_k={class:"flex justify-between"},yk={class:"font-mono tabular text-ink"},bk={class:"flex justify-between"},xk={class:"font-mono tabular text-ink"},wk={class:"flex justify-between"},kk={class:"font-mono tabular text-ink"},Sk={class:"panel col-span-2 p-4 max-[820px]:col-span-1"},Tk={class:"panel p-4"},Pk={class:"flex flex-wrap gap-2"},Ck={class:"mt-2 min-h-[16px] text-xs text-ink-muted"},Lk={class:"panel p-4"},Mk={class:"h-[180px] overflow-y-auto font-mono text-xs"},Ek={class:"text-ink-muted"},Ok={class:"font-semibold text-accent"},zk={class:"break-all text-ink"},Ak={key:5,class:"p-7"},$k={class:"panel grid place-items-center p-16 text-center"},Ik={class:"mt-3 text-sm font-medium text-ink-secondary"},Dk={key:0,class:"mt-1 text-xs text-ink-muted"},Nk={key:1,class:"mt-1 text-xs text-ink-muted"},Rk={__name:"Dashboard",props:{email:{type:String,default:""},role:{type:String,default:"user"},organization:{type:String,default:""},organizationName:{type:String,default:""}},emits:["logout"],setup(t,{emit:i}){const o=t,l=i,u=yt({}),d=yt({}),h=G(null),_=G(!1),y=yt([]),M=G(""),S=G([]),O=yt({unavailable:!1,detail:"",loaded:!1,plan:"",recommendedInterval:30}),B=Pe(()=>S.value.filter(I=>!I.onGround).length),V=G(!1);let Z=null;const F=[{value:"auto",label:"Auto"},{value:15,label:"15s"},{value:30,label:"30s"},{value:60,label:"60s"},{value:120,label:"120s"}],fe=Pe(()=>{if(ke.airTrafficInterval==="auto")return O.recommendedInterval||30;const I=Number(ke.airTrafficInterval);return Number.isFinite(I)&&I>0?I:30});async function ve(){if(!ke.showAirTraffic)return;const{states:I,unavailable:P,detail:Q,plan:Ne,recommendedInterval:_e}=await dp();S.value=I,O.unavailable=P,O.detail=Q,O.plan=Ne||"",_e&&(O.recommendedInterval=_e),O.loaded=!0}function q(){Z&&clearInterval(Z),Z=setInterval(()=>{be.value==="Overview"&&ke.showAirTraffic&&ve()},fe.value*1e3)}function Ce(){ve(),q()}function he(){Z&&clearInterval(Z),Z=null}const be=G("Overview"),Re=[["grid","Overview"],["radio","Live flights"],["route","Routes"],["calendar","Schedule"],["book","Logbook"],["fileText","Documents"],["server","Drives"],["settings","Settings"]],Ie=Pe(()=>(Re.find(([,I])=>I===be.value)||["grid"])[0]),Ue=G(""),pe=G(""),Ae=G("");let Te=null,te=null,de=!1;const ye=Pe(()=>Object.keys(u).sort((I,P)=>(u[P].online?1:0)-(u[I].online?1:0)||I.localeCompare(P))),Se=Pe(()=>h.value?u[h.value]:null),ae=Pe(()=>Se.value&&Se.value.telemetry||{}),ue=Pe(()=>!!(Se.value&&Se.value.online)),ie=Pe(()=>{const I=ae.value;return typeof I.latitude=="number"&&typeof I.longitude=="number"&&(I.latitude||I.longitude)?{lat:I.latitude,lng:I.longitude}:null}),st=Pe(()=>h.value&&d[h.value]||[]),me=Pe(()=>{const I=ae.value;return typeof I.velocityX=="number"&&typeof I.velocityY=="number"?Math.hypot(I.velocityX,I.velocityY):null});function ze(I){return I.online?I.connected?["In flight","success"]:["Standby","accent"]:["Offline","neutral"]}function Je(I){const P=I&&I.telemetry||{};return typeof P.velocityX=="number"&&typeof P.velocityY=="number"?Math.hypot(P.velocityX,P.velocityY):null}const at=Pe(()=>ye.value.map(I=>{const P=u[I],Q=P.telemetry||{},[Ne,_e]=ze(P);return{id:I,mission:P.model||(P.connected?"Drone linked":P.online?"App online":"No signal"),status:Ne,tone:_e,alt:typeof Q.altitude=="number"?Q.altitude.toFixed(0)+" m":"—",battery:typeof Q.batteryPercent=="number"?Q.batteryPercent:null,speed:Je(P)}})),et=Pe(()=>ye.value.filter(I=>u[I].online).length),Ze=Pe(()=>ye.value.filter(I=>u[I].online&&u[I].connected).length),K=Pe(()=>ye.value.filter(I=>!u[I].online).length),E=Pe(()=>{const I=ye.value.map(P=>{var Q;return(Q=u[P].telemetry)==null?void 0:Q.batteryPercent}).filter(P=>typeof P=="number");return I.length?Math.round(I.reduce((P,Q)=>P+Q,0)/I.length):null}),A=Pe(()=>[{label:"Active flights",value:String(Ze.value),delta:`${et.value} online`,tone:"success",icon:"radio"},{label:"Avg battery",value:E.value==null?"—":E.value+"%",delta:E.value==null?"no telemetry":E.value<40?"low — watch":"nominal",tone:E.value!=null&&E.value<40?"danger":"neutral",icon:"battery"},{label:"Fleet size",value:String(ye.value.length),delta:`${Ze.value} in flight`,tone:"neutral",icon:"grid"},{label:"Offline",value:String(K.value),delta:K.value?"needs attention":"all reachable",tone:K.value?"warning":"success",icon:"signal"}]),nt={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"},mt={success:"text-success-fg",danger:"text-danger-fg",warning:"text-amber-fg",neutral:"text-ink-muted",accent:"text-accent-soft-fg"},kt=Pe(()=>{var Q,Ne,_e;const P=(o.email||"PV").split("@")[0].split(/[.\-_ ]+/).filter(Boolean);return((((Q=P[0])==null?void 0:Q[0])||"P")+(((Ne=P[1])==null?void 0:Ne[0])||((_e=P[0])==null?void 0:_e[1])||"V")).toUpperCase()}),b={superadmin:"Superadmin",admin:"Admin",user:"Operator"},v=Pe(()=>b[o.role]||"Operator"),w=Pe(()=>o.organizationName||(o.role==="superadmin"?"All organizations":"No organization"));function W(I){var Q;u[I.deviceId]=I;const P=I.telemetry||{};typeof P.latitude=="number"&&typeof P.longitude=="number"&&(P.latitude||P.longitude)&&(d[I.deviceId]||(d[I.deviceId]=[]),d[I.deviceId].push([P.latitude,P.longitude]),d[I.deviceId].length>1e3&&d[I.deviceId].shift()),(!h.value||I.online&&!((Q=u[h.value])!=null&&Q.online))&&(h.value=I.deviceId)}function H(I){delete u[I],delete d[I],h.value===I&&(h.value=ye.value[0]||null)}function U(I){y.unshift({t:au(Date.now()),tag:I.type||"?",text:JSON.stringify(ne(I))}),y.length>200&&y.pop()}function ne(I){const P={...I};return delete P.type,P}function se(){const I=location.protocol==="https:"?"wss":"ws";Te=new WebSocket(`${I}://${location.host}/bff/ws`),Te.onopen=()=>_.value=!0,Te.onclose=()=>{_.value=!1,de||(te=setTimeout(se,1500))},Te.onerror=()=>Te&&Te.close(),Te.onmessage=P=>{let Q;try{Q=JSON.parse(P.data)}catch{return}Q.type==="snapshot"?(Q.devices||[]).forEach(W):Q.type==="update"&&Q.device?(W(Q.device),Q.event&&Q.device.deviceId===h.value&&U(Q.event)):Q.type==="removed"&&Q.deviceId&&H(Q.deviceId)}}async function ee(){if(!h.value)return Ae.value="No device selected.";if(!Ue.value.trim())return Ae.value="Enter a command name.";let I;if(pe.value.trim())try{I=JSON.parse(pe.value)}catch{return Ae.value="Payload is not valid JSON."}const{ok:P,body:Q}=await Op(h.value,Ue.value.trim(),I);Ae.value=P?`Sent "${Ue.value.trim()}".`:`Error: ${Q.error||"failed"}`}function j(I,P,Q=""){return typeof I=="number"?I.toFixed(P)+Q:"—"}function Me(I){h.value=I,be.value="Live flights"}return zt(be,I=>{I==="Overview"&&ve()}),zt(()=>ke.showAirTraffic,I=>{I?ve():S.value=[]}),zt(fe,q),ui(async()=>{(await Xh()).forEach(W),se(),Ce()}),Os(()=>{de=!0,te&&clearTimeout(te),Te&&Te.close(),he()}),(I,P)=>{var Q,Ne,_e,We,rt;return p(),g("div",O0,[r("aside",z0,[r("div",A0,[z(Fc,{size:26}),P[11]||(P[11]=r("span",{class:"text-[19px] tracking-tightest"},[r("span",{class:"font-medium text-ink-secondary"},"Pilot"),r("span",{class:"font-bold text-ink"},"Vault")],-1))]),r("nav",$0,[(p(),g(ce,null,Ve(Re,([le,tt])=>r("button",{key:tt,class:Oe(["flex items-center gap-3 rounded px-3 py-2.5 text-left text-sm transition",be.value===tt?"bg-accent-soft font-semibold text-accent-soft-fg":"font-medium text-ink-secondary hover:bg-surface-2"]),onClick:wt=>be.value=tt},[z(X,{name:le,size:18,stroke:be.value===tt?2.2:1.8},null,8,["name","stroke"]),D(" "+k(tt),1)],10,I0)),64))]),r("div",D0,[r("div",N0,[r("div",R0,[r("span",{class:Oe(["h-2 w-2 rounded-full",_.value?"bg-ready":"bg-caution"])},null,2),r("span",F0,k(_.value?"Link healthy":"Reconnecting…"),1)]),r("span",B0,"API gateway · "+k(_.value?"streaming":"retrying"),1)]),r("div",V0,[r("div",U0,k(kt.value),1),r("div",Z0,[r("div",H0,k(t.email||"Operator"),1),r("div",j0,[z(X,{name:"grid",size:11,class:"shrink-0"}),r("span",{class:"truncate",title:`${v.value} · ${w.value}`},k(v.value)+" · "+k(w.value),9,W0)])]),r("button",{class:"text-ink-muted transition hover:text-ink",title:"Log out","aria-label":"Log out",onClick:P[0]||(P[0]=le=>l("logout"))},[z(X,{name:"logout",size:16})])])])]),r("main",K0,[r("header",G0,[r("div",null,[P[12]||(P[12]=r("div",{class:"eyebrow"},"Live operations",-1)),r("h1",q0,k(be.value),1)]),r("div",Y0,[r("div",J0,[z(X,{name:"search",size:16,class:"text-ink-muted"}),re(r("input",{"onUpdate:modelValue":P[1]||(P[1]=le=>M.value=le),placeholder:"Search drones, routes…",class:"w-full border-none bg-transparent text-sm text-ink outline-none placeholder:text-ink-muted"},null,512),[[xe,M.value]])]),r("button",{class:"btn-accent flex items-center gap-2",onClick:P[2]||(P[2]=le=>be.value="Live flights")},[z(X,{name:"radio",size:16}),P[13]||(P[13]=D(" Live flights ",-1))])])]),be.value==="Overview"?(p(),g("div",X0,[r("div",Q0,[(p(!0),g(ce,null,Ve(A.value,le=>(p(),g("div",{key:le.label,class:"panel p-5"},[r("div",ew,[r("span",tw,k(le.label),1),z(X,{name:le.icon,size:16,class:"text-ink-muted"},null,8,["name"])]),r("div",nw,k(le.value),1),r("span",{class:Oe(["mt-2 block font-mono text-[11px]",mt[le.tone]])},k(le.delta),3)]))),128))]),r("div",iw,[r("div",sw,[r("div",ow,[P[18]||(P[18]=r("div",null,[r("div",{class:"eyebrow"},"Airspace"),r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Live map")],-1)),r("div",aw,[$e(ke).showAirTraffic&&B.value?(p(),g("span",{key:0,class:Oe(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",nt.accent]),title:"Live aircraft from OpenSky Network"},[z(X,{name:"radio",size:12}),D(k(B.value)+" aircraft ",1)],2)):R("",!0),Ze.value?(p(),g("span",{key:1,class:Oe(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",nt.success])},[P[14]||(P[14]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(k(Ze.value)+" drones ",1)],2)):R("",!0),r("div",rw,[r("button",{type:"button",class:Oe(["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:P[3]||(P[3]=le=>V.value=!V.value)},[z(X,{name:"settings",size:16})],2),V.value?(p(),g(ce,{key:0},[r("div",{class:"fixed inset-0 z-[1190]",onClick:P[4]||(P[4]=le=>V.value=!1)}),r("div",lw,[P[17]||(P[17]=r("div",{class:"eyebrow mb-2.5"},"Map settings",-1)),r("label",uw,[P[15]||(P[15]=r("span",{class:"text-sm text-ink-secondary"},"Show live air traffic",-1)),z(tn,{modelValue:$e(ke).showAirTraffic,"onUpdate:modelValue":P[5]||(P[5]=le=>$e(ke).showAirTraffic=le)},null,8,["modelValue"])]),r("div",{class:Oe(["mt-3.5",$e(ke).showAirTraffic?"":"pointer-events-none opacity-40"])},[r("div",cw,[P[16]||(P[16]=r("span",{class:"text-sm text-ink-secondary"},"Refresh interval",-1)),r("span",dw,"every "+k(fe.value)+"s",1)]),re(r("select",{"onUpdate:modelValue":P[6]||(P[6]=le=>$e(ke).airTrafficInterval=le),class:"field"},[(p(),g(ce,null,Ve(F,le=>r("option",{key:le.value,value:le.value},k(le.label)+k(le.value==="auto"?` (plan: ${O.recommendedInterval}s)`:""),9,fw)),64))],512),[[Mt,$e(ke).airTrafficInterval]]),O.plan?(p(),g("p",hw," OpenSky plan: "+k(O.plan),1)):R("",!0)],2)])],64)):R("",!0)])])]),z(cu,{position:ie.value,trail:st.value,aircraft:$e(ke).showAirTraffic?S.value:[]},null,8,["position","trail","aircraft"]),$e(ke).showAirTraffic?O.loaded&&O.unavailable?(p(),g("p",mw,k(O.detail||"Live air traffic is unavailable."),1)):(p(),g("p",gw," Live air traffic from OpenSky Network · updates every "+k(fe.value)+"s ",1)):(p(),g("p",pw," Live air traffic hidden · enable it in Map settings "))]),r("div",vw,[r("div",_w,[P[19]||(P[19]=r("div",null,[r("div",{class:"eyebrow"},"Today"),r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Schedule")],-1)),z(X,{name:"clock",size:16,class:"text-ink-muted"})]),r("div",yw,[z(X,{name:"calendar",size:24,class:"text-ink-muted"}),P[20]||(P[20]=r("div",{class:"mt-2 text-sm font-medium text-ink-secondary"},"No missions scheduled",-1)),P[21]||(P[21]=r("div",{class:"mt-0.5 text-xs text-ink-muted"},"Scheduling is not wired to a backend yet.",-1))])])]),r("div",bw,[r("div",xw,[P[24]||(P[24]=r("div",null,[r("div",{class:"eyebrow"},"Fleet"),r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Aircraft status")],-1)),r("div",ww,[r("span",{class:Oe(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",nt.success])},[P[22]||(P[22]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(k(Ze.value)+" in flight ",1)],2),K.value?(p(),g("span",{key:0,class:Oe(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",nt.warning])},[P[23]||(P[23]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(k(K.value)+" offline ",1)],2)):R("",!0)])]),at.value.length?(p(),g("div",Sw,[r("table",Tw,[r("thead",null,[r("tr",Pw,[(p(),g(ce,null,Ve(["Aircraft","Mission","Status","Alt","Battery","Speed",""],le=>r("th",{key:le,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(le),1)),64))])]),r("tbody",null,[(p(!0),g(ce,null,Ve(at.value,(le,tt)=>(p(),g("tr",{key:le.id,class:Oe(["cursor-pointer transition hover:bg-surface-2",ttMe(le.id)},[r("td",Lw,k(le.id),1),r("td",Mw,k(le.mission),1),r("td",Ew,[r("span",{class:Oe(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",nt[le.tone]])},[P[25]||(P[25]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(k(le.status),1)],2)]),r("td",Ow,k(le.alt),1),r("td",zw,[le.battery!=null?(p(),g("div",Aw,[r("div",$w,[r("div",{class:Oe(["h-full",le.battery<40?"bg-caution":"bg-ready"]),style:Cs({width:le.battery+"%"})},null,6)]),r("span",Iw,k(le.battery)+"%",1)])):(p(),g("span",Dw,"—"))]),r("td",Nw,[D(k(le.speed==null?"—":le.speed.toFixed(1))+" ",1),P[26]||(P[26]=r("span",{class:"text-ink-muted"},"m/s",-1))]),r("td",Rw,[r("button",{class:"btn-ghost inline-flex items-center gap-1.5 whitespace-nowrap",onClick:Vr(wt=>Me(le.id),["stop"])},[z(X,{name:"play",size:14}),P[27]||(P[27]=D(" Track ",-1))],8,Fw)])],10,Cw))),128))])])])):(p(),g("div",kw," No aircraft connected yet. Devices appear here as they come online. "))])])):be.value==="Live flights"?(p(),g("div",Bw,[r("div",Vw,[r("span",Uw,k(h.value||"No device selected"),1),Se.value&&!ue.value?(p(),g("span",Zw,"Offline")):R("",!0),ye.value.length?(p(),g("div",Hw,[(p(!0),g(ce,null,Ve(ye.value,le=>(p(),g("button",{key:le,class:Oe(["flex items-center gap-2 rounded border px-3 py-1.5 font-mono text-xs font-bold transition",le===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=le},[r("span",{class:Oe(["h-2 w-2 rounded-full",u[le].online?"bg-ready":"bg-ink-muted"])},null,2),D(" "+k(le),1)],10,jw))),128))])):R("",!0)]),ye.value.length?(p(),g(ce,{key:1},[r("div",{class:Oe(["mb-4 grid gap-3",!ue.value&&Se.value?"opacity-60":""]),style:{"grid-template-columns":"repeat(auto-fit, minmax(150px, 1fr))"}},[r("div",Kw,[P[30]||(P[30]=r("div",{class:"eyebrow"},"Registration",-1)),r("div",{class:Oe(["mt-1 text-sm font-semibold",ue.value?((Q=Se.value)==null?void 0:Q.registration)==="success"?"text-success-fg":"text-danger-fg":"text-ink"])},k(ue.value&&((Ne=Se.value)!=null&&Ne.registration)?Se.value.registration:"—"),3)]),r("div",Gw,[P[31]||(P[31]=r("div",{class:"eyebrow"},"Drone link",-1)),r("div",{class:Oe(["mt-1 text-sm font-semibold",ue.value?(_e=Se.value)!=null&&_e.connected?"text-success-fg":"text-danger-fg":"text-ink"])},k(Se.value?ue.value?Se.value.connected?"connected":"no drone":"app offline":"—"),3)]),r("div",qw,[P[32]||(P[32]=r("div",{class:"eyebrow"},"Model",-1)),r("div",Yw,k(((We=Se.value)==null?void 0:We.model)||"—"),1)]),r("div",Jw,[P[33]||(P[33]=r("div",{class:"eyebrow"},"Last update",-1)),r("div",Xw,k((rt=Se.value)!=null&&rt.lastSeenMs?$e(au)(Se.value.lastSeenMs):"—"),1)])],2),r("div",Qw,[r("div",ek,[P[35]||(P[35]=r("div",{class:"mb-3 eyebrow"},"Battery",-1)),r("div",tk,[r("div",nk,[r("div",{class:Oe(["h-full transition-all",typeof ae.value.batteryPercent=="number"?ae.value.batteryPercent<20?"bg-warning":ae.value.batteryPercent<40?"bg-caution":"bg-ready":""]),style:Cs({width:(typeof ae.value.batteryPercent=="number"?ae.value.batteryPercent:0)+"%"})},null,6)]),r("div",ik,[D(k(typeof ae.value.batteryPercent=="number"?ae.value.batteryPercent:"—"),1),P[34]||(P[34]=r("span",{class:"text-sm text-ink-secondary"},"%",-1))])])]),r("div",sk,[P[37]||(P[37]=r("div",{class:"mb-3 eyebrow"},"Altitude",-1)),r("div",ok,[D(k(j(ae.value.altitude,1)),1),P[36]||(P[36]=r("span",{class:"text-sm text-ink-secondary"}," m",-1))])]),r("div",ak,[P[42]||(P[42]=r("div",{class:"mb-3 eyebrow"},"Flight",-1)),r("div",rk,[r("div",lk,[P[38]||(P[38]=r("span",{class:"text-ink-secondary"},"Mode",-1)),r("b",uk,k(ae.value.flightMode||"—"),1)]),r("div",ck,[P[39]||(P[39]=r("span",{class:"text-ink-secondary"},"Flying",-1)),r("b",dk,k(ae.value.isFlying==null?"—":ae.value.isFlying?"yes":"no"),1)]),r("div",fk,[P[40]||(P[40]=r("span",{class:"text-ink-secondary"},"GPS sats",-1)),r("b",hk,k(ae.value.satelliteCount==null?"—":ae.value.satelliteCount),1)]),r("div",pk,[P[41]||(P[41]=r("span",{class:"text-ink-secondary"},"Speed (H)",-1)),r("b",mk,k(me.value==null?"—":j(me.value,2," m/s")),1)])])]),r("div",gk,[P[46]||(P[46]=r("div",{class:"mb-3 eyebrow"},"Position",-1)),r("div",vk,[r("div",_k,[P[43]||(P[43]=r("span",{class:"text-ink-secondary"},"Latitude",-1)),r("b",yk,k(j(ae.value.latitude,6)),1)]),r("div",bk,[P[44]||(P[44]=r("span",{class:"text-ink-secondary"},"Longitude",-1)),r("b",xk,k(j(ae.value.longitude,6)),1)]),r("div",wk,[P[45]||(P[45]=r("span",{class:"text-ink-secondary"},"Vert. speed",-1)),r("b",kk,k(j(typeof ae.value.velocityZ=="number"?-ae.value.velocityZ:void 0,2," m/s")),1)])])]),r("div",Sk,[P[47]||(P[47]=r("div",{class:"mb-3 eyebrow"},"Track",-1)),z(cu,{position:ie.value,trail:st.value},null,8,["position","trail"])]),r("div",Tk,[P[48]||(P[48]=r("div",{class:"mb-3 eyebrow"},"Send command",-1)),r("div",Pk,[re(r("input",{"onUpdate:modelValue":P[7]||(P[7]=le=>Ue.value=le),class:"field flex-1",placeholder:"command (e.g. startConnection)"},null,512),[[xe,Ue.value]]),re(r("input",{"onUpdate:modelValue":P[8]||(P[8]=le=>pe.value=le),class:"field flex-1",placeholder:"payload JSON (optional)"},null,512),[[xe,pe.value]]),r("button",{class:"btn-accent",onClick:ee},"Send")]),r("div",Ck,k(Ae.value),1)]),r("div",Lk,[P[49]||(P[49]=r("div",{class:"mb-3 eyebrow"},"Event log",-1)),r("div",Mk,[(p(!0),g(ce,null,Ve(y,(le,tt)=>(p(),g("div",{key:tt,class:"border-b border-line py-1"},[r("span",Ek,k(le.t),1),r("span",Ok,k(le.tag),1),r("span",zk,k(le.text),1)]))),128))])])])],64)):(p(),g("div",Ww,[z(X,{name:"radio",size:28,class:"text-ink-muted"}),P[28]||(P[28]=r("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No aircraft online",-1)),P[29]||(P[29]=r("div",{class:"mt-1 text-xs text-ink-muted"},"Live telemetry appears here once a drone connects.",-1))]))])):be.value==="Logbook"?(p(),it(jb,{key:2,email:t.email,role:t.role,organization:t.organization,"organization-name":t.organizationName},null,8,["email","role","organization","organization-name"])):be.value==="Documents"?(p(),it(E0,{key:3,email:t.email,role:t.role,organization:t.organization,"organization-name":t.organizationName},null,8,["email","role","organization","organization-name"])):be.value==="Settings"?(p(),it(Gy,{key:4,email:t.email,role:t.role,organization:t.organization,"organization-name":t.organizationName,onLogout:P[9]||(P[9]=le=>l("logout"))},null,8,["email","role","organization","organization-name"])):(p(),g("div",Ak,[r("div",$k,[z(X,{name:Ie.value,size:28,class:"text-ink-muted"},null,8,["name"]),r("div",Ik,k(be.value),1),be.value==="Drives"?(p(),g("div",Dk,[P[50]||(P[50]=D(" Browse and transfer files here once a drive is connected. Configure drives in ",-1)),r("button",{class:"font-semibold text-accent hover:underline",onClick:P[10]||(P[10]=le=>be.value="Settings")},"Settings → Integrations"),P[51]||(P[51]=D(". ",-1))])):(p(),g("div",Nk,"This section is part of the console shell and has no backend yet."))])]))])])}}},Fk={key:0,class:"h-full"},Bk={key:1,class:"grid h-full place-items-center text-ink-muted text-sm"},Vk={__name:"App",setup(t){const i=G(!1),o=G(null),l=G("user"),u=G(""),d=G(""),h=G("");function _(S){l.value=S&&S.role||"user",u.value=S&&S.organization||"",d.value=S&&S.organizationName||""}ui(async()=>{h.value=(await qh()).apiBase||"";const S=await nu();S&&(o.value=S.email,_(S),await lu()),i.value=!0});async function y(S){o.value=S,_(await nu()),await lu()}async function M(){Dp(),await Jh(),o.value=null,l.value="user",u.value="",d.value=""}return(S,O)=>i.value?(p(),g("div",Fk,[o.value?(p(),it(Rk,{key:0,email:o.value,role:l.value,organization:u.value,"organization-name":d.value,onLogout:M},null,8,["email","role","organization","organization-name"])):(p(),it(Qp,{key:1,"default-api-base":h.value,onSignedIn:y},null,8,["default-api-base"]))])):(p(),g("div",Bk,"Loading…"))}};jh(Vk).mount("#app"); diff --git a/Web App/server/dist/assets/index-CznFJTz4.js b/Web App/server/dist/assets/index-CznFJTz4.js new file mode 100644 index 0000000..1b251c5 --- /dev/null +++ b/Web App/server/dist/assets/index-CznFJTz4.js @@ -0,0 +1,20 @@ +(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))l(u);new MutationObserver(u=>{for(const d of u)if(d.type==="childList")for(const h of d.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&l(h)}).observe(document,{childList:!0,subtree:!0});function o(u){const d={};return u.integrity&&(d.integrity=u.integrity),u.referrerPolicy&&(d.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?d.credentials="include":u.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function l(u){if(u.ep)return;u.ep=!0;const d=o(u);fetch(u.href,d)}})();/** +* @vue/shared v3.5.39 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/function Mr(t){const i=Object.create(null);for(const o of t.split(","))i[o]=1;return o=>o in i}const mt={},Ms=[],Un=()=>{},_u=()=>!1,wa=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),ka=t=>t.startsWith("onUpdate:"),It=Object.assign,Er=(t,i)=>{const o=t.indexOf(i);o>-1&&t.splice(o,1)},cd=Object.prototype.hasOwnProperty,ct=(t,i)=>cd.call(t,i),De=Array.isArray,Es=t=>$o(t)==="[object Map]",Rs=t=>$o(t)==="[object Set]",gl=t=>$o(t)==="[object Date]",We=t=>typeof t=="function",xt=t=>typeof t=="string",Ln=t=>typeof t=="symbol",dt=t=>t!==null&&typeof t=="object",yu=t=>(dt(t)||We(t))&&We(t.then)&&We(t.catch),bu=Object.prototype.toString,$o=t=>bu.call(t),dd=t=>$o(t).slice(8,-1),xu=t=>$o(t)==="[object Object]",Or=t=>xt(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,yo=Mr(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Sa=t=>{const i=Object.create(null);return(o=>i[o]||(i[o]=t(o)))},fd=/-\w/g,Pn=Sa(t=>t.replace(fd,i=>i.slice(1).toUpperCase())),hd=/\B([A-Z])/g,zi=Sa(t=>t.replace(hd,"-$1").toLowerCase()),wu=Sa(t=>t.charAt(0).toUpperCase()+t.slice(1)),Qa=Sa(t=>t?`on${wu(t)}`:""),Vn=(t,i)=>!Object.is(t,i),la=(t,...i)=>{for(let o=0;o{Object.defineProperty(t,i,{configurable:!0,enumerable:!1,writable:l,value:o})},Ta=t=>{const i=parseFloat(t);return isNaN(i)?t:i},pd=t=>{const i=xt(t)?Number(t):NaN;return isNaN(i)?t:i};let vl;const Pa=()=>vl||(vl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Is(t){if(De(t)){const i={};for(let o=0;o{if(o){const l=o.split(gd);l.length>1&&(i[l[0].trim()]=l[1].trim())}}),i}function Ee(t){let i="";if(xt(t))i=t;else if(De(t))for(let o=0;oMi(o,i))}const Tu=t=>!!(t&&t.__v_isRef===!0),S=t=>xt(t)?t:t==null?"":De(t)||dt(t)&&(t.toString===bu||!We(t.toString))?Tu(t)?S(t.value):JSON.stringify(t,Pu,2):String(t),Pu=(t,i)=>Tu(i)?Pu(t,i.value):Es(i)?{[`Map(${i.size})`]:[...i.entries()].reduce((o,[l,u],d)=>(o[er(l,d)+" =>"]=u,o),{})}:Rs(i)?{[`Set(${i.size})`]:[...i.values()].map(o=>er(o))}:Ln(i)?er(i):dt(i)&&!De(i)&&!xu(i)?String(i):i,er=(t,i="")=>{var o;return Ln(t)?`Symbol(${(o=t.description)!=null?o:i})`:t};/** +* @vue/reactivity v3.5.39 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let Rt;class wd{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&&Rt&&(Rt.active?(this.parent=Rt,this.index=(Rt.scopes||(Rt.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let i,o;if(this.scopes)for(i=0,o=this.scopes.length;i0&&--this._on===0){if(Rt===this)Rt=this.prevScope;else{let i=Rt;for(;i;){if(i.prevScope===this){i.prevScope=this.prevScope;break}i=i.prevScope}}this.prevScope=void 0}}stop(i){if(this._active){this._active=!1;let o,l;for(o=0,l=this.effects.length;o0)return;if(xo){let i=xo;for(xo=void 0;i;){const o=i.next;i.next=void 0,i.flags&=-9,i=o}}let t;for(;bo;){let i=bo;for(bo=void 0;i;){const o=i.next;if(i.next=void 0,i.flags&=-9,i.flags&1)try{i.trigger()}catch(l){t||(t=l)}i=o}}if(t)throw t}function Eu(t){for(let i=t.deps;i;i=i.nextDep)i.version=-1,i.prevActiveLink=i.dep.activeLink,i.dep.activeLink=i}function Ou(t){let i,o=t.depsTail,l=o;for(;l;){const u=l.prevDep;l.version===-1?(l===o&&(o=u),Ir(l),Sd(l)):i=l,l.dep.activeLink=l.prevActiveLink,l.prevActiveLink=void 0,l=u}t.deps=i,t.depsTail=o}function fr(t){for(let i=t.deps;i;i=i.nextDep)if(i.dep.version!==i.version||i.dep.computed&&(zu(i.dep.computed)||i.dep.version!==i.version))return!0;return!!t._dirty}function zu(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===Po)||(t.globalVersion=Po,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!fr(t))))return;t.flags|=2;const i=t.dep,o=gt,l=Cn;gt=t,Cn=!0;try{Eu(t);const u=t.fn(t._value);(i.version===0||Vn(u,t._value))&&(t.flags|=128,t._value=u,i.version++)}catch(u){throw i.version++,u}finally{gt=o,Cn=l,Ou(t),t.flags&=-3}}function Ir(t,i=!1){const{dep:o,prevSub:l,nextSub:u}=t;if(l&&(l.nextSub=u,t.prevSub=void 0),u&&(u.prevSub=l,t.nextSub=void 0),o.subs===t&&(o.subs=l,!l&&o.computed)){o.computed.flags&=-5;for(let d=o.computed.deps;d;d=d.nextDep)Ir(d,!0)}!i&&!--o.sc&&o.map&&o.map.delete(o.key)}function Sd(t){const{prevDep:i,nextDep:o}=t;i&&(i.nextDep=o,t.prevDep=void 0),o&&(o.prevDep=i,t.nextDep=void 0)}let Cn=!0;const Au=[];function Zn(){Au.push(Cn),Cn=!1}function Hn(){const t=Au.pop();Cn=t===void 0?!0:t}function _l(t){const{cleanup:i}=t;if(t.cleanup=void 0,i){const o=gt;gt=void 0;try{i()}finally{gt=o}}}let Po=0;class Td{constructor(i,o){this.sub=i,this.dep=o,this.version=o.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Dr{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(!gt||!Cn||gt===this.computed)return;let o=this.activeLink;if(o===void 0||o.sub!==gt)o=this.activeLink=new Td(gt,this),gt.deps?(o.prevDep=gt.depsTail,gt.depsTail.nextDep=o,gt.depsTail=o):gt.deps=gt.depsTail=o,$u(o);else if(o.version===-1&&(o.version=this.version,o.nextDep)){const l=o.nextDep;l.prevDep=o.prevDep,o.prevDep&&(o.prevDep.nextDep=l),o.prevDep=gt.depsTail,o.nextDep=void 0,gt.depsTail.nextDep=o,gt.depsTail=o,gt.deps===o&&(gt.deps=l)}return o}trigger(i){this.version++,Po++,this.notify(i)}notify(i){Ar();try{for(let o=this.subs;o;o=o.prevSub)o.sub.notify()&&o.sub.dep.notify()}finally{$r()}}}function $u(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)$u(l)}const o=t.dep.subs;o!==t&&(t.prevSub=o,o&&(o.nextSub=t)),t.dep.subs=t}}const hr=new WeakMap,os=Symbol(""),pr=Symbol(""),Co=Symbol("");function Zt(t,i,o){if(Cn&>){let l=hr.get(t);l||hr.set(t,l=new Map);let u=l.get(o);u||(l.set(o,u=new Dr),u.map=l,u.key=o),u.track()}}function li(t,i,o,l,u,d){const h=hr.get(t);if(!h){Po++;return}const v=y=>{y&&y.trigger()};if(Ar(),i==="clear")h.forEach(v);else{const y=De(t),C=y&&Or(o);if(y&&o==="length"){const T=Number(l);h.forEach((O,B)=>{(B==="length"||B===Co||!Ln(B)&&B>=T)&&v(O)})}else switch((o!==void 0||h.has(void 0))&&v(h.get(o)),C&&v(h.get(Co)),i){case"add":y?C&&v(h.get("length")):(v(h.get(os)),Es(t)&&v(h.get(pr)));break;case"delete":y||(v(h.get(os)),Es(t)&&v(h.get(pr)));break;case"set":Es(t)&&v(h.get(os));break}}$r()}function Cs(t){const i=lt(t);return i===t?i:(Zt(i,"iterate",Co),wn(t)?i:i.map(Mn))}function Ca(t){return Zt(t=lt(t),"iterate",Co),t}function Fn(t,i){return di(t)?Ds(as(t)?Mn(i):i):Mn(i)}const Pd={__proto__:null,[Symbol.iterator](){return nr(this,Symbol.iterator,t=>Fn(this,t))},concat(...t){return Cs(this).concat(...t.map(i=>De(i)?Cs(i):i))},entries(){return nr(this,"entries",t=>(t[1]=Fn(this,t[1]),t))},every(t,i){return si(this,"every",t,i,void 0,arguments)},filter(t,i){return si(this,"filter",t,i,o=>o.map(l=>Fn(this,l)),arguments)},find(t,i){return si(this,"find",t,i,o=>Fn(this,o),arguments)},findIndex(t,i){return si(this,"findIndex",t,i,void 0,arguments)},findLast(t,i){return si(this,"findLast",t,i,o=>Fn(this,o),arguments)},findLastIndex(t,i){return si(this,"findLastIndex",t,i,void 0,arguments)},forEach(t,i){return si(this,"forEach",t,i,void 0,arguments)},includes(...t){return ir(this,"includes",t)},indexOf(...t){return ir(this,"indexOf",t)},join(t){return Cs(this).join(t)},lastIndexOf(...t){return ir(this,"lastIndexOf",t)},map(t,i){return si(this,"map",t,i,void 0,arguments)},pop(){return co(this,"pop")},push(...t){return co(this,"push",t)},reduce(t,...i){return yl(this,"reduce",t,i)},reduceRight(t,...i){return yl(this,"reduceRight",t,i)},shift(){return co(this,"shift")},some(t,i){return si(this,"some",t,i,void 0,arguments)},splice(...t){return co(this,"splice",t)},toReversed(){return Cs(this).toReversed()},toSorted(t){return Cs(this).toSorted(t)},toSpliced(...t){return Cs(this).toSpliced(...t)},unshift(...t){return co(this,"unshift",t)},values(){return nr(this,"values",t=>Fn(this,t))}};function nr(t,i,o){const l=Ca(t),u=l[i]();return l!==t&&!wn(t)&&(u._next=u.next,u.next=()=>{const d=u._next();return d.done||(d.value=o(d.value)),d}),u}const Cd=Array.prototype;function si(t,i,o,l,u,d){const h=Ca(t),v=h!==t&&!wn(t),y=h[i];if(y!==Cd[i]){const O=y.apply(t,d);return v?Mn(O):O}let C=o;h!==t&&(v?C=function(O,B){return o.call(this,Fn(t,O),B,t)}:o.length>2&&(C=function(O,B){return o.call(this,O,B,t)}));const T=y.call(h,C,l);return v&&u?u(T):T}function yl(t,i,o,l){const u=Ca(t),d=u!==t&&!wn(t);let h=o,v=!1;u!==t&&(d?(v=l.length===0,h=function(C,T,O){return v&&(v=!1,C=Fn(t,C)),o.call(this,C,Fn(t,T),O,t)}):o.length>3&&(h=function(C,T,O){return o.call(this,C,T,O,t)}));const y=u[i](h,...l);return v?Fn(t,y):y}function ir(t,i,o){const l=lt(t);Zt(l,"iterate",Co);const u=l[i](...o);return(u===-1||u===!1)&&Fr(o[0])?(o[0]=lt(o[0]),l[i](...o)):u}function co(t,i,o=[]){Zn(),Ar();const l=lt(t)[i].apply(t,o);return $r(),Hn(),l}const Ld=Mr("__proto__,__v_isRef,__isVue"),Iu=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(Ln));function Md(t){Ln(t)||(t=String(t));const i=lt(this);return Zt(i,"has",t),i.hasOwnProperty(t)}class Du{constructor(i=!1,o=!1){this._isReadonly=i,this._isShallow=o}get(i,o,l){if(o==="__v_skip")return i.__v_skip;const u=this._isReadonly,d=this._isShallow;if(o==="__v_isReactive")return!u;if(o==="__v_isReadonly")return u;if(o==="__v_isShallow")return d;if(o==="__v_raw")return l===(u?d?Fd:Bu:d?Fu:Ru).get(i)||Object.getPrototypeOf(i)===Object.getPrototypeOf(l)?i:void 0;const h=De(i);if(!u){let y;if(h&&(y=Pd[o]))return y;if(o==="hasOwnProperty")return Md}const v=Reflect.get(i,o,Wt(i)?i:l);if((Ln(o)?Iu.has(o):Ld(o))||(u||Zt(i,"get",o),d))return v;if(Wt(v)){const y=h&&Or(o)?v:v.value;return u&&dt(y)?gr(y):y}return dt(v)?u?gr(v):bt(v):v}}class Nu extends Du{constructor(i=!1){super(!1,i)}set(i,o,l,u){let d=i[o];const h=De(i)&&Or(o);if(!this._isShallow){const C=di(d);if(!wn(l)&&!di(l)&&(d=lt(d),l=lt(l)),!h&&Wt(d)&&!Wt(l))return C||(d.value=l),!0}const v=h?Number(o)t,na=t=>Reflect.getPrototypeOf(t);function $d(t,i,o){return function(...l){const u=this.__v_raw,d=lt(u),h=Es(d),v=t==="entries"||t===Symbol.iterator&&h,y=t==="keys"&&h,C=u[t](...l),T=o?mr:i?Ds:Mn;return!i&&Zt(d,"iterate",y?pr:os),It(Object.create(C),{next(){const{value:O,done:B}=C.next();return B?{value:O,done:B}:{value:v?[T(O[0]),T(O[1])]:T(O),done:B}}})}}function ia(t){return function(...i){return t==="delete"?!1:t==="clear"?void 0:this}}function Id(t,i){const o={get(u){const d=this.__v_raw,h=lt(d),v=lt(u);t||(Vn(u,v)&&Zt(h,"get",u),Zt(h,"get",v));const{has:y}=na(h),C=i?mr:t?Ds:Mn;if(y.call(h,u))return C(d.get(u));if(y.call(h,v))return C(d.get(v));d!==h&&d.get(u)},get size(){const u=this.__v_raw;return!t&&Zt(lt(u),"iterate",os),u.size},has(u){const d=this.__v_raw,h=lt(d),v=lt(u);return t||(Vn(u,v)&&Zt(h,"has",u),Zt(h,"has",v)),u===v?d.has(u):d.has(u)||d.has(v)},forEach(u,d){const h=this,v=h.__v_raw,y=lt(v),C=i?mr:t?Ds:Mn;return!t&&Zt(y,"iterate",os),v.forEach((T,O)=>u.call(d,C(T),C(O),h))}};return It(o,t?{add:ia("add"),set:ia("set"),delete:ia("delete"),clear:ia("clear")}:{add(u){const d=lt(this),h=na(d),v=lt(u),y=!i&&!wn(u)&&!di(u)?v:u;return h.has.call(d,y)||Vn(u,y)&&h.has.call(d,u)||Vn(v,y)&&h.has.call(d,v)||(d.add(y),li(d,"add",y,y)),this},set(u,d){!i&&!wn(d)&&!di(d)&&(d=lt(d));const h=lt(this),{has:v,get:y}=na(h);let C=v.call(h,u);C||(u=lt(u),C=v.call(h,u));const T=y.call(h,u);return h.set(u,d),C?Vn(d,T)&&li(h,"set",u,d):li(h,"add",u,d),this},delete(u){const d=lt(this),{has:h,get:v}=na(d);let y=h.call(d,u);y||(u=lt(u),y=h.call(d,u)),v&&v.call(d,u);const C=d.delete(u);return y&&li(d,"delete",u,void 0),C},clear(){const u=lt(this),d=u.size!==0,h=u.clear();return d&&li(u,"clear",void 0,void 0),h}}),["keys","values","entries",Symbol.iterator].forEach(u=>{o[u]=$d(u,t,i)}),o}function Nr(t,i){const o=Id(t,i);return(l,u,d)=>u==="__v_isReactive"?!t:u==="__v_isReadonly"?t:u==="__v_raw"?l:Reflect.get(ct(o,u)&&u in l?o:l,u,d)}const Dd={get:Nr(!1,!1)},Nd={get:Nr(!1,!0)},Rd={get:Nr(!0,!1)};const Ru=new WeakMap,Fu=new WeakMap,Bu=new WeakMap,Fd=new WeakMap;function Bd(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function bt(t){return di(t)?t:Rr(t,!1,Od,Dd,Ru)}function Vd(t){return Rr(t,!1,Ad,Nd,Fu)}function gr(t){return Rr(t,!0,zd,Rd,Bu)}function Rr(t,i,o,l,u){if(!dt(t)||t.__v_raw&&!(i&&t.__v_isReactive)||t.__v_skip||!Object.isExtensible(t))return t;const d=u.get(t);if(d)return d;const h=Bd(dd(t));if(h===0)return t;const v=new Proxy(t,h===2?l:o);return u.set(t,v),v}function as(t){return di(t)?as(t.__v_raw):!!(t&&t.__v_isReactive)}function di(t){return!!(t&&t.__v_isReadonly)}function wn(t){return!!(t&&t.__v_isShallow)}function Fr(t){return t?!!t.__v_raw:!1}function lt(t){const i=t&&t.__v_raw;return i?lt(i):t}function Ud(t){return!ct(t,"__v_skip")&&Object.isExtensible(t)&&ku(t,"__v_skip",!0),t}const Mn=t=>dt(t)?bt(t):t,Ds=t=>dt(t)?gr(t):t;function Wt(t){return t?t.__v_isRef===!0:!1}function j(t){return Zd(t,!1)}function Zd(t,i){return Wt(t)?t:new Hd(t,i)}class Hd{constructor(i,o){this.dep=new Dr,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=o?i:lt(i),this._value=o?i:Mn(i),this.__v_isShallow=o}get value(){return this.dep.track(),this._value}set value(i){const o=this._rawValue,l=this.__v_isShallow||wn(i)||di(i);i=l?i:lt(i),Vn(i,o)&&(this._rawValue=i,this._value=l?i:Mn(i),this.dep.trigger())}}function $e(t){return Wt(t)?t.value:t}const jd={get:(t,i,o)=>i==="__v_raw"?t:$e(Reflect.get(t,i,o)),set:(t,i,o,l)=>{const u=t[i];return Wt(u)&&!Wt(o)?(u.value=o,!0):Reflect.set(t,i,o,l)}};function Vu(t){return as(t)?t:new Proxy(t,jd)}class Wd{constructor(i,o,l){this.fn=i,this.setter=o,this._value=void 0,this.dep=new Dr(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Po-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!o,this.isSSR=l}notify(){if(this.flags|=16,!(this.flags&8)&>!==this)return Mu(this,!0),!0}get value(){const i=this.dep.track();return zu(this),i&&(i.version=this.dep.version),this._value}set value(i){this.setter&&this.setter(i)}}function Kd(t,i,o=!1){let l,u;return We(t)?l=t:(l=t.get,u=t.set),new Wd(l,u,o)}const sa={},ca=new WeakMap;let ns;function Gd(t,i=!1,o=ns){if(o){let l=ca.get(o);l||ca.set(o,l=[]),l.push(t)}}function qd(t,i,o=mt){const{immediate:l,deep:u,once:d,scheduler:h,augmentJob:v,call:y}=o,C=he=>u?he:wn(he)||u===!1||u===0?ui(he,1):ui(he);let T,O,B,V,H=!1,F=!1;if(Wt(t)?(O=()=>t.value,H=wn(t)):as(t)?(O=()=>C(t),H=!0):De(t)?(F=!0,H=t.some(he=>as(he)||wn(he)),O=()=>t.map(he=>{if(Wt(he))return he.value;if(as(he))return C(he);if(We(he))return y?y(he,2):he()})):We(t)?i?O=y?()=>y(t,2):t:O=()=>{if(B){Zn();try{B()}finally{Hn()}}const he=ns;ns=T;try{return y?y(t,3,[V]):t(V)}finally{ns=he}}:O=Un,i&&u){const he=O,ye=u===!0?1/0:u;O=()=>ui(he(),ye)}const fe=kd(),ve=()=>{T.stop(),fe&&fe.active&&Er(fe.effects,T)};if(d&&i){const he=i;i=(...ye)=>{const Ne=he(...ye);return ve(),Ne}}let Y=F?new Array(t.length).fill(sa):sa;const Pe=he=>{if(!(!(T.flags&1)||!T.dirty&&!he))if(i){const ye=T.run();if(he||u||H||(F?ye.some((Ne,Ie)=>Vn(Ne,Y[Ie])):Vn(ye,Y))){B&&B();const Ne=ns;ns=T;try{const Ie=[ye,Y===sa?void 0:F&&Y[0]===sa?[]:Y,V];Y=ye,y?y(i,3,Ie):i(...Ie)}finally{ns=Ne}}}else T.run()};return v&&v(Pe),T=new Cu(O),T.scheduler=h?()=>h(Pe,!1):Pe,V=he=>Gd(he,!1,T),B=T.onStop=()=>{const he=ca.get(T);if(he){if(y)y(he,4);else for(const ye of he)ye();ca.delete(T)}},i?l?Pe(!0):Y=T.run():h?h(Pe.bind(null,!0),!0):T.run(),ve.pause=T.pause.bind(T),ve.resume=T.resume.bind(T),ve.stop=ve,ve}function ui(t,i=1/0,o){if(i<=0||!dt(t)||t.__v_skip||(o=o||new Map,(o.get(t)||0)>=i))return t;if(o.set(t,i),i--,Wt(t))ui(t.value,i,o);else if(De(t))for(let l=0;l{ui(l,i,o)});else if(xu(t)){for(const l in t)ui(t[l],i,o);for(const l of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,l)&&ui(t[l],i,o)}return t}/** +* @vue/runtime-core v3.5.39 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/function Io(t,i,o,l){try{return l?t(...l):t()}catch(u){La(u,i,o)}}function Sn(t,i,o,l){if(We(t)){const u=Io(t,i,o,l);return u&&yu(u)&&u.catch(d=>{La(d,i,o)}),u}if(De(t)){const u=[];for(let d=0;d>>1,u=Jt[l],d=Lo(u);d=Lo(o)?Jt.push(t):Jt.splice(Jd(i),0,t),t.flags|=1,Hu()}}function Hu(){da||(da=Uu.then(Wu))}function Xd(t){De(t)?Os.push(...t):Li&&t.id===-1?Li.splice(Ls+1,0,t):t.flags&1||(Os.push(t),t.flags|=1),Hu()}function bl(t,i,o=Rn+1){for(;oLo(o)-Lo(l));if(Os.length=0,Li){Li.push(...i);return}for(Li=i,Ls=0;Lst.id==null?t.flags&2?-1:1/0:t.id;function Wu(t){try{for(Rn=0;Rn{l._d&&ma(-1);const d=fa(i);let h;try{h=t(...u)}finally{fa(d),l._d&&ma(1)}return h};return l._n=!0,l._c=!0,l._d=!0,l}function oe(t,i){if(jt===null)return t;const o=Aa(jt),l=t.dirs||(t.dirs=[]);for(let u=0;u1)return o&&We(i)?i.call(l&&l.proxy):i}}const Qd=Symbol.for("v-scx"),ef=()=>wo(Qd);function $t(t,i,o){return qu(t,i,o)}function qu(t,i,o=mt){const{immediate:l,deep:u,flush:d,once:h}=o,v=It({},o),y=i&&l||!i&&d!=="post";let C;if(zo){if(d==="sync"){const V=ef();C=V.__watcherHandles||(V.__watcherHandles=[])}else if(!y){const V=()=>{};return V.stop=Un,V.resume=Un,V.pause=Un,V}}const T=Xt;v.call=(V,H,F)=>Sn(V,T,H,F);let O=!1;d==="post"?v.scheduler=V=>{Yt(V,T&&T.suspense)}:d!=="sync"&&(O=!0,v.scheduler=(V,H)=>{H?V():Br(V)}),v.augmentJob=V=>{i&&(V.flags|=4),O&&(V.flags|=2,T&&(V.id=T.uid,V.i=T))};const B=qd(t,i,v);return zo&&(C?C.push(B):y&&B()),B}function tf(t,i,o){const l=this.proxy,u=xt(t)?t.includes(".")?Yu(l,t):()=>l[t]:t.bind(l,l);let d;We(i)?d=i:(d=i.handler,o=i);const h=Do(this),v=qu(u,d.bind(l),o);return h(),v}function Yu(t,i){const o=i.split(".");return()=>{let l=t;for(let u=0;ut.__isTeleport,is=t=>t&&(t.disabled||t.disabled===""),nf=t=>t&&(t.defer||t.defer===""),xl=t=>typeof SVGElement<"u"&&t instanceof SVGElement,wl=t=>typeof MathMLElement=="function"&&t instanceof MathMLElement,vr=(t,i)=>{const o=t&&t.to;return xt(o)?i?i(o):null:o},sf={name:"Teleport",__isTeleport:!0,process(t,i,o,l,u,d,h,v,y,C){const{mc:T,pc:O,pbc:B,o:{insert:V,querySelector:H,createText:F,createComment:fe,parentNode:ve}}=C,Y=is(i.props);let{dynamicChildren:Pe}=i;const he=(Ie,Ve,pe)=>{Ie.shapeFlag&16&&T(Ie.children,Ve,pe,u,d,h,v,y)},ye=(Ie=i)=>{const Ve=is(Ie.props),pe=Ie.target=vr(Ie.props,H),ze=_r(pe,Ie,F,V);pe&&(h!=="svg"&&xl(pe)?h="svg":h!=="mathml"&&wl(pe)&&(h="mathml"),u&&u.isCE&&(u.ce._teleportTargets||(u.ce._teleportTargets=new Set)).add(pe),Ve||(he(Ie,pe,ze),mo(Ie,!1)))},Ne=Ie=>{const Ve=()=>{if(Ci.get(Ie)===Ve){if(Ci.delete(Ie),is(Ie.props)){const pe=ve(Ie.el)||o;he(Ie,pe,Ie.anchor),mo(Ie,!0)}ye(Ie)}};Ci.set(Ie,Ve),Yt(Ve,d)};if(t==null){const Ie=i.el=F(""),Ve=i.anchor=F("");if(V(Ie,o,l),V(Ve,o,l),nf(i.props)||d&&d.pendingBranch){Ne(i);return}Y&&(he(i,o,Ve),mo(i,!0)),ye()}else{i.el=t.el;const Ie=i.anchor=t.anchor,Ve=Ci.get(t);if(Ve){Ve.flags|=8,Ci.delete(t),Ne(i);return}i.targetStart=t.targetStart;const pe=i.target=t.target,ze=i.targetAnchor=t.targetAnchor,Te=is(t.props),te=Te?o:pe,de=Te?Ie:ze;if(h==="svg"||xl(pe)?h="svg":(h==="mathml"||wl(pe))&&(h="mathml"),Pe?(B(t.dynamicChildren,Pe,te,u,d,h,v),Zr(t,i,!0)):y||O(t,i,te,de,u,d,h,v,!1),Y)Te?i.props&&t.props&&i.props.to!==t.props.to&&(i.props.to=t.props.to):oa(i,o,Ie,C,1);else if((i.props&&i.props.to)!==(t.props&&t.props.to)){const _e=vr(i.props,H);_e&&(i.target=_e,oa(i,_e,null,C,0))}else Te&&oa(i,pe,ze,C,1);mo(i,Y)}},remove(t,i,o,{um:l,o:{remove:u}},d){const{shapeFlag:h,children:v,anchor:y,targetStart:C,targetAnchor:T,target:O,props:B}=t,V=is(B),H=d||!V,F=Ci.get(t);if(F&&(F.flags|=8,Ci.delete(t)),O&&(u(C),u(T)),d&&u(y),!F&&(V||O)&&h&16)for(let fe=0;fe{t.isMounted=!0}),Fs(()=>{t.isUnmounting=!0}),t}const yn=[Function,Array],Qu={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:yn,onEnter:yn,onAfterEnter:yn,onEnterCancelled:yn,onBeforeLeave:yn,onLeave:yn,onAfterLeave:yn,onLeaveCancelled:yn,onBeforeAppear:yn,onAppear:yn,onAfterAppear:yn,onAppearCancelled:yn},ec=t=>{const i=t.subTree;return i.component?ec(i.component):i},lf={name:"BaseTransition",props:Qu,setup(t,{slots:i}){const o=Pc(),l=rf();return()=>{const u=i.default&&ic(i.default(),!0),d=u&&u.length?tc(u):o.subTree?R():void 0;if(!d)return;const h=lt(t),{mode:v}=h;if(l.isLeaving)return sr(d);const y=kl(d);if(!y)return sr(d);let C=yr(y,h,l,o,O=>C=O);y.type!==Ht&&Mo(y,C);let T=o.subTree&&kl(o.subTree);if(T&&T.type!==Ht&&!ss(T,y)&&ec(o).type!==Ht){let O=yr(T,h,l,o);if(Mo(T,O),v==="out-in"&&y.type!==Ht)return l.isLeaving=!0,O.afterLeave=()=>{l.isLeaving=!1,o.job.flags&8||o.update(),delete O.afterLeave,T=void 0},sr(d);v==="in-out"&&y.type!==Ht?O.delayLeave=(B,V,H)=>{const F=nc(l,T);F[String(T.key)]=T,B[xn]=()=>{V(),B[xn]=void 0,delete C.delayedLeave,T=void 0},C.delayedLeave=()=>{H(),delete C.delayedLeave,T=void 0}}:T=void 0}else T&&(T=void 0);return d}}};function tc(t){let i=t[0];if(t.length>1){for(const o of t)if(o.type!==Ht){i=o;break}}return i}const uf=lf;function nc(t,i){const{leavingVNodes:o}=t;let l=o.get(i.type);return l||(l=Object.create(null),o.set(i.type,l)),l}function yr(t,i,o,l,u){const{appear:d,mode:h,persisted:v=!1,onBeforeEnter:y,onEnter:C,onAfterEnter:T,onEnterCancelled:O,onBeforeLeave:B,onLeave:V,onAfterLeave:H,onLeaveCancelled:F,onBeforeAppear:fe,onAppear:ve,onAfterAppear:Y,onAppearCancelled:Pe}=i,he=String(t.key),ye=nc(o,t),Ne=(pe,ze)=>{pe&&Sn(pe,l,9,ze)},Ie=(pe,ze)=>{const Te=ze[1];Ne(pe,ze),De(pe)?pe.every(te=>te.length<=1)&&Te():pe.length<=1&&Te()},Ve={mode:h,persisted:v,beforeEnter(pe){let ze=y;if(!o.isMounted)if(d)ze=fe||y;else return;pe[xn]&&pe[xn](!0);const Te=ye[he];Te&&ss(t,Te)&&Te.el[xn]&&Te.el[xn](),Ne(ze,[pe])},enter(pe){if(ye[he]===t)return;let ze=C,Te=T,te=O;if(!o.isMounted)if(d)ze=ve||C,Te=Y||T,te=Pe||O;else return;let de=!1;pe[fo]=be=>{de||(de=!0,be?Ne(te,[pe]):Ne(Te,[pe]),Ve.delayedLeave&&Ve.delayedLeave(),pe[fo]=void 0)};const _e=pe[fo].bind(null,!1);ze?Ie(ze,[pe,_e]):_e()},leave(pe,ze){const Te=String(t.key);if(pe[fo]&&pe[fo](!0),o.isUnmounting)return ze();Ne(B,[pe]);let te=!1;pe[xn]=_e=>{te||(te=!0,ze(),_e?Ne(F,[pe]):Ne(H,[pe]),pe[xn]=void 0,ye[Te]===t&&delete ye[Te])};const de=pe[xn].bind(null,!1);ye[Te]=t,V?Ie(V,[pe,de]):de()},clone(pe){const ze=yr(pe,i,o,l,u);return u&&u(ze),ze}};return Ve}function sr(t){if(Ma(t))return t=Ei(t),t.children=null,t}function kl(t){if(!Ma(t))return Xu(t.type)&&t.children?tc(t.children):t;if(t.component)return t.component.subTree;const{shapeFlag:i,children:o}=t;if(o){if(i&16)return o[0];if(i&32&&We(o.default))return o.default()}}function Mo(t,i){t.shapeFlag&6&&t.component?(t.transition=i,Mo(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 ic(t,i=!1,o){let l=[],u=0;for(let d=0;d1)for(let d=0;dko(F,i&&(De(i)?i[fe]:i),o,l,u));return}if(zs(l)&&!u){l.shapeFlag&512&&l.type.__asyncResolved&&l.component.subTree.component&&ko(t,i,o,l.component.subTree);return}const d=l.shapeFlag&4?Aa(l.component):l.el,h=u?null:d,{i:v,r:y}=t,C=i&&i.r,T=v.refs===mt?v.refs={}:v.refs,O=v.setupState,B=lt(O),V=O===mt?_u:F=>Sl(T,F)?!1:ct(B,F),H=(F,fe)=>!(fe&&Sl(T,fe));if(C!=null&&C!==y){if(Tl(i),xt(C))T[C]=null,V(C)&&(O[C]=null);else if(Wt(C)){const F=i;H(C,F.k)&&(C.value=null),F.k&&(T[F.k]=null)}}if(We(y)){Zn();try{Io(y,v,12,[h,T])}finally{Hn()}}else{const F=xt(y),fe=Wt(y);if(F||fe){const ve=()=>{if(t.f){const Y=F?V(y)?O[y]:T[y]:H()||!t.k?y.value:T[t.k];if(u)De(Y)&&Er(Y,d);else if(De(Y))Y.includes(d)||Y.push(d);else if(F)T[y]=[d],V(y)&&(O[y]=T[y]);else{const Pe=[d];H(y,t.k)&&(y.value=Pe),t.k&&(T[t.k]=Pe)}}else F?(T[y]=h,V(y)&&(O[y]=h)):fe&&(H(y,t.k)&&(y.value=h),t.k&&(T[t.k]=h))};if(h){const Y=()=>{ve(),ha.delete(t)};Y.id=-1,ha.set(t,Y),Yt(Y,o)}else Tl(t),ve()}}}function Tl(t){const i=ha.get(t);i&&(i.flags|=8,ha.delete(t))}Pa().requestIdleCallback;Pa().cancelIdleCallback;const zs=t=>!!t.type.__asyncLoader,Ma=t=>t.type.__isKeepAlive;function cf(t,i){oc(t,"a",i)}function df(t,i){oc(t,"da",i)}function oc(t,i,o=Xt){const l=t.__wdc||(t.__wdc=()=>{let u=o;for(;u;){if(u.isDeactivated)return;u=u.parent}return t()});if(Ea(i,l,o),o){let u=o.parent;for(;u&&u.parent;)Ma(u.parent.vnode)&&ff(l,i,o,u),u=u.parent}}function ff(t,i,o,l){const u=Ea(i,t,l,!0);ac(()=>{Er(l[i],u)},o)}function Ea(t,i,o=Xt,l=!1){if(o){const u=o[t]||(o[t]=[]),d=i.__weh||(i.__weh=(...h)=>{Zn();const v=Do(o),y=Sn(i,o,t,h);return v(),Hn(),y});return l?u.unshift(d):u.push(d),d}}const hi=t=>(i,o=Xt)=>{(!zo||t==="sp")&&Ea(t,(...l)=>i(...l),o)},hf=hi("bm"),fi=hi("m"),pf=hi("bu"),mf=hi("u"),Fs=hi("bum"),ac=hi("um"),gf=hi("sp"),vf=hi("rtg"),_f=hi("rtc");function yf(t,i=Xt){Ea("ec",t,i)}const bf=Symbol.for("v-ndc");function Be(t,i,o,l){let u;const d=o,h=De(t);if(h||xt(t)){const v=h&&as(t);let y=!1,C=!1;v&&(y=!wn(t),C=di(t),t=Ca(t)),u=new Array(t.length);for(let T=0,O=t.length;Ti(v,y,void 0,d));else{const v=Object.keys(t);u=new Array(v.length);for(let y=0,C=v.length;y0;return p(),at(re,null,[z("slot",o,l)],C?-2:64)}let d=t[i];d&&d._c&&(d._d=!1),p();const h=d&&rc(d(o)),v=o.key||h&&h.key,y=at(re,{key:(v&&!Ln(v)?v:`_${i}`)+(!h&&l?"_fb":"")},h||[],h&&t._===1?64:-2);return y.scopeId&&(y.slotScopeIds=[y.scopeId+"-s"]),d&&d._c&&(d._d=!0),y}function rc(t){return t.some(i=>Oo(i)?!(i.type===Ht||i.type===re&&!rc(i.children)):!0)?t:null}const br=t=>t?Cc(t)?Aa(t):br(t.parent):null,So=It(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=>br(t.parent),$root:t=>br(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>uc(t),$forceUpdate:t=>t.f||(t.f=()=>{Br(t.update)}),$nextTick:t=>t.n||(t.n=Zu.bind(t.proxy)),$watch:t=>tf.bind(t)}),or=(t,i)=>t!==mt&&!t.__isScriptSetup&&ct(t,i),wf={get({_:t},i){if(i==="__v_skip")return!0;const{ctx:o,setupState:l,data:u,props:d,accessCache:h,type:v,appContext:y}=t;if(i[0]!=="$"){const B=h[i];if(B!==void 0)switch(B){case 1:return l[i];case 2:return u[i];case 4:return o[i];case 3:return d[i]}else{if(or(l,i))return h[i]=1,l[i];if(u!==mt&&ct(u,i))return h[i]=2,u[i];if(ct(d,i))return h[i]=3,d[i];if(o!==mt&&ct(o,i))return h[i]=4,o[i];xr&&(h[i]=0)}}const C=So[i];let T,O;if(C)return i==="$attrs"&&Zt(t.attrs,"get",""),C(t);if((T=v.__cssModules)&&(T=T[i]))return T;if(o!==mt&&ct(o,i))return h[i]=4,o[i];if(O=y.config.globalProperties,ct(O,i))return O[i]},set({_:t},i,o){const{data:l,setupState:u,ctx:d}=t;return or(u,i)?(u[i]=o,!0):l!==mt&&ct(l,i)?(l[i]=o,!0):ct(t.props,i)||i[0]==="$"&&i.slice(1)in t?!1:(d[i]=o,!0)},has({_:{data:t,setupState:i,accessCache:o,ctx:l,appContext:u,props:d,type:h}},v){let y;return!!(o[v]||t!==mt&&v[0]!=="$"&&ct(t,v)||or(i,v)||ct(d,v)||ct(l,v)||ct(So,v)||ct(u.config.globalProperties,v)||(y=h.__cssModules)&&y[v])},defineProperty(t,i,o){return o.get!=null?t._.accessCache[i]=0:ct(o,"value")&&this.set(t,i,o.value,null),Reflect.defineProperty(t,i,o)}};function Pl(t){return De(t)?t.reduce((i,o)=>(i[o]=null,i),{}):t}let xr=!0;function kf(t){const i=uc(t),o=t.proxy,l=t.ctx;xr=!1,i.beforeCreate&&Cl(i.beforeCreate,t,"bc");const{data:u,computed:d,methods:h,watch:v,provide:y,inject:C,created:T,beforeMount:O,mounted:B,beforeUpdate:V,updated:H,activated:F,deactivated:fe,beforeDestroy:ve,beforeUnmount:Y,destroyed:Pe,unmounted:he,render:ye,renderTracked:Ne,renderTriggered:Ie,errorCaptured:Ve,serverPrefetch:pe,expose:ze,inheritAttrs:Te,components:te,directives:de,filters:_e}=i;if(C&&Sf(C,l,null),h)for(const le in h){const ie=h[le];We(ie)&&(l[le]=ie.bind(o))}if(u){const le=u.call(o,o);dt(le)&&(t.data=bt(le))}if(xr=!0,d)for(const le in d){const ie=d[le],rt=We(ie)?ie.bind(o,o):We(ie.get)?ie.get.bind(o,o):Un,me=!We(ie)&&We(ie.set)?ie.set.bind(o):Un,Oe=ke({get:rt,set:me});Object.defineProperty(l,le,{enumerable:!0,configurable:!0,get:()=>Oe.value,set:Xe=>Oe.value=Xe})}if(v)for(const le in v)lc(v[le],l,o,le);if(y){const le=We(y)?y.call(o):y;Reflect.ownKeys(le).forEach(ie=>{Gu(ie,le[ie])})}T&&Cl(T,t,"c");function ae(le,ie){De(ie)?ie.forEach(rt=>le(rt.bind(o))):ie&&le(ie.bind(o))}if(ae(hf,O),ae(fi,B),ae(pf,V),ae(mf,H),ae(cf,F),ae(df,fe),ae(yf,Ve),ae(_f,Ne),ae(vf,Ie),ae(Fs,Y),ae(ac,he),ae(gf,pe),De(ze))if(ze.length){const le=t.exposed||(t.exposed={});ze.forEach(ie=>{Object.defineProperty(le,ie,{get:()=>o[ie],set:rt=>o[ie]=rt,enumerable:!0})})}else t.exposed||(t.exposed={});ye&&t.render===Un&&(t.render=ye),Te!=null&&(t.inheritAttrs=Te),te&&(t.components=te),de&&(t.directives=de),pe&&sc(t)}function Sf(t,i,o=Un){De(t)&&(t=wr(t));for(const l in t){const u=t[l];let d;dt(u)?"default"in u?d=wo(u.from||l,u.default,!0):d=wo(u.from||l):d=wo(u),Wt(d)?Object.defineProperty(i,l,{enumerable:!0,configurable:!0,get:()=>d.value,set:h=>d.value=h}):i[l]=d}}function Cl(t,i,o){Sn(De(t)?t.map(l=>l.bind(i.proxy)):t.bind(i.proxy),i,o)}function lc(t,i,o,l){let u=l.includes(".")?Yu(o,l):()=>o[l];if(xt(t)){const d=i[t];We(d)&&$t(u,d)}else if(We(t))$t(u,t.bind(o));else if(dt(t))if(De(t))t.forEach(d=>lc(d,i,o,l));else{const d=We(t.handler)?t.handler.bind(o):i[t.handler];We(d)&&$t(u,d,t)}}function uc(t){const i=t.type,{mixins:o,extends:l}=i,{mixins:u,optionsCache:d,config:{optionMergeStrategies:h}}=t.appContext,v=d.get(i);let y;return v?y=v:!u.length&&!o&&!l?y=i:(y={},u.length&&u.forEach(C=>pa(y,C,h,!0)),pa(y,i,h)),dt(i)&&d.set(i,y),y}function pa(t,i,o,l=!1){const{mixins:u,extends:d}=i;d&&pa(t,d,o,!0),u&&u.forEach(h=>pa(t,h,o,!0));for(const h in i)if(!(l&&h==="expose")){const v=Tf[h]||o&&o[h];t[h]=v?v(t[h],i[h]):i[h]}return t}const Tf={data:Ll,props:Ml,emits:Ml,methods:go,computed:go,beforeCreate:qt,created:qt,beforeMount:qt,mounted:qt,beforeUpdate:qt,updated:qt,beforeDestroy:qt,beforeUnmount:qt,destroyed:qt,unmounted:qt,activated:qt,deactivated:qt,errorCaptured:qt,serverPrefetch:qt,components:go,directives:go,watch:Cf,provide:Ll,inject:Pf};function Ll(t,i){return i?t?function(){return It(We(t)?t.call(this,this):t,We(i)?i.call(this,this):i)}:i:t}function Pf(t,i){return go(wr(t),wr(i))}function wr(t){if(De(t)){const i={};for(let o=0;oi==="modelValue"||i==="model-value"?t.modelModifiers:t[`${i}Modifiers`]||t[`${Pn(i)}Modifiers`]||t[`${zi(i)}Modifiers`];function Of(t,i,...o){if(t.isUnmounted)return;const l=t.vnode.props||mt;let u=o;const d=i.startsWith("update:"),h=d&&Ef(l,i.slice(7));h&&(h.trim&&(u=o.map(T=>xt(T)?T.trim():T)),h.number&&(u=o.map(Ta)));let v,y=l[v=Qa(i)]||l[v=Qa(Pn(i))];!y&&d&&(y=l[v=Qa(zi(i))]),y&&Sn(y,t,6,u);const C=l[v+"Once"];if(C){if(!t.emitted)t.emitted={};else if(t.emitted[v])return;t.emitted[v]=!0,Sn(C,t,6,u)}}const zf=new WeakMap;function dc(t,i,o=!1){const l=o?zf:i.emitsCache,u=l.get(t);if(u!==void 0)return u;const d=t.emits;let h={},v=!1;if(!We(t)){const y=C=>{const T=dc(C,i,!0);T&&(v=!0,It(h,T))};!o&&i.mixins.length&&i.mixins.forEach(y),t.extends&&y(t.extends),t.mixins&&t.mixins.forEach(y)}return!d&&!v?(dt(t)&&l.set(t,null),null):(De(d)?d.forEach(y=>h[y]=null):It(h,d),dt(t)&&l.set(t,h),h)}function Oa(t,i){return!t||!wa(i)?!1:(i=i.slice(2),i=i==="Once"?i:i.replace(/Once$/,""),ct(t,i[0].toLowerCase()+i.slice(1))||ct(t,zi(i))||ct(t,i))}function El(t){const{type:i,vnode:o,proxy:l,withProxy:u,propsOptions:[d],slots:h,attrs:v,emit:y,render:C,renderCache:T,props:O,data:B,setupState:V,ctx:H,inheritAttrs:F}=t,fe=fa(t);let ve,Y;try{if(o.shapeFlag&4){const he=u||l,ye=he;ve=Bn(C.call(ye,he,T,O,V,B,H)),Y=v}else{const he=i;ve=Bn(he.length>1?he(O,{attrs:v,slots:h,emit:y}):he(O,null)),Y=i.props?v:Af(v)}}catch(he){To.length=0,La(he,t,1),ve=z(Ht)}let Pe=ve;if(Y&&F!==!1){const he=Object.keys(Y),{shapeFlag:ye}=Pe;he.length&&ye&7&&(d&&he.some(ka)&&(Y=$f(Y,d)),Pe=Ei(Pe,Y,!1,!0))}return o.dirs&&(Pe=Ei(Pe,null,!1,!0),Pe.dirs=Pe.dirs?Pe.dirs.concat(o.dirs):o.dirs),o.transition&&Mo(Pe,o.transition),ve=Pe,fa(fe),ve}const Af=t=>{let i;for(const o in t)(o==="class"||o==="style"||wa(o))&&((i||(i={}))[o]=t[o]);return i},$f=(t,i)=>{const o={};for(const l in t)(!ka(l)||!(l.slice(9)in i))&&(o[l]=t[l]);return o};function If(t,i,o){const{props:l,children:u,component:d}=t,{props:h,children:v,patchFlag:y}=i,C=d.emitsOptions;if(i.dirs||i.transition)return!0;if(o&&y>=0){if(y&1024)return!0;if(y&16)return l?Ol(l,h,C):!!h;if(y&8){const T=i.dynamicProps;for(let O=0;OObject.create(hc),mc=t=>Object.getPrototypeOf(t)===hc;function Nf(t,i,o,l=!1){const u={},d=pc();t.propsDefaults=Object.create(null),gc(t,i,u,d);for(const h in t.propsOptions[0])h in u||(u[h]=void 0);o?t.props=l?u:Vd(u):t.type.props?t.props=u:t.props=d,t.attrs=d}function Rf(t,i,o,l){const{props:u,attrs:d,vnode:{patchFlag:h}}=t,v=lt(u),[y]=t.propsOptions;let C=!1;if((l||h>0)&&!(h&16)){if(h&8){const T=t.vnode.dynamicProps;for(let O=0;O{y=!0;const[B,V]=vc(O,i,!0);It(h,B),V&&v.push(...V)};!o&&i.mixins.length&&i.mixins.forEach(T),t.extends&&T(t.extends),t.mixins&&t.mixins.forEach(T)}if(!d&&!y)return dt(t)&&l.set(t,Ms),Ms;if(De(d))for(let T=0;Tt==="_"||t==="_ctx"||t==="$stable",Ur=t=>De(t)?t.map(Bn):[Bn(t)],Bf=(t,i,o)=>{if(i._n)return i;const l=Ce((...u)=>Ur(i(...u)),o);return l._c=!1,l},_c=(t,i,o)=>{const l=t._ctx;for(const u in t){if(Vr(u))continue;const d=t[u];if(We(d))i[u]=Bf(u,d,l);else if(d!=null){const h=Ur(d);i[u]=()=>h}}},yc=(t,i)=>{const o=Ur(i);t.slots.default=()=>o},bc=(t,i,o)=>{for(const l in i)(o||!Vr(l))&&(t[l]=i[l])},Vf=(t,i,o)=>{const l=t.slots=pc();if(t.vnode.shapeFlag&32){const u=i._;u?(bc(l,i,o),o&&ku(l,"_",u,!0)):_c(i,l)}else i&&yc(t,i)},Uf=(t,i,o)=>{const{vnode:l,slots:u}=t;let d=!0,h=mt;if(l.shapeFlag&32){const v=i._;v?o&&v===1?d=!1:bc(u,i,o):(d=!i.$stable,_c(i,u)),h=i}else i&&(yc(t,i),h={default:1});if(d)for(const v in u)!Vr(v)&&h[v]==null&&delete u[v]},Yt=Kf;function Zf(t){return Hf(t)}function Hf(t,i){const o=Pa();o.__VUE__=!0;const{insert:l,remove:u,patchProp:d,createElement:h,createText:v,createComment:y,setText:C,setElementText:T,parentNode:O,nextSibling:B,setScopeId:V=Un,insertStaticContent:H}=t,F=(b,_,w,K=null,G=null,Z=null,ne=void 0,se=null,Q=!!_.dynamicChildren)=>{if(b===_)return;b&&!ss(b,_)&&(K=E(b),Xe(b,G,Z,!0),b=null),_.patchFlag===-2&&(Q=!1,_.dynamicChildren=null);const{type:U,ref:Se,shapeFlag:I}=_;switch(U){case za:fe(b,_,w,K);break;case Ht:ve(b,_,w,K);break;case rr:b==null&&Y(_,w,K,ne);break;case re:te(b,_,w,K,G,Z,ne,se,Q);break;default:I&1?ye(b,_,w,K,G,Z,ne,se,Q):I&6?de(b,_,w,K,G,Z,ne,se,Q):(I&64||I&128)&&U.process(b,_,w,K,G,Z,ne,se,Q,vt)}Se!=null&&G?ko(Se,b&&b.ref,Z,_||b,!_):Se==null&&b&&b.ref!=null&&ko(b.ref,null,Z,b,!0)},fe=(b,_,w,K)=>{if(b==null)l(_.el=v(_.children),w,K);else{const G=_.el=b.el;_.children!==b.children&&C(G,_.children)}},ve=(b,_,w,K)=>{b==null?l(_.el=y(_.children||""),w,K):_.el=b.el},Y=(b,_,w,K)=>{[b.el,b.anchor]=H(b.children,_,w,K,b.el,b.anchor)},Pe=({el:b,anchor:_},w,K)=>{let G;for(;b&&b!==_;)G=B(b),l(b,w,K),b=G;l(_,w,K)},he=({el:b,anchor:_})=>{let w;for(;b&&b!==_;)w=B(b),u(b),b=w;u(_)},ye=(b,_,w,K,G,Z,ne,se,Q)=>{if(_.type==="svg"?ne="svg":_.type==="math"&&(ne="mathml"),b==null)Ne(_,w,K,G,Z,ne,se,Q);else{const U=b.el&&b.el._isVueCE?b.el:null;try{U&&U._beginPatch(),pe(b,_,G,Z,ne,se,Q)}finally{U&&U._endPatch()}}},Ne=(b,_,w,K,G,Z,ne,se)=>{let Q,U;const{props:Se,shapeFlag:I,transition:M,dirs:ee}=b;if(Q=b.el=h(b.type,Z,Se&&Se.is,Se),I&8?T(Q,b.children):I&16&&Ve(b.children,Q,null,K,G,ar(b,Z),ne,se),ee&&Xi(b,null,K,"created"),Ie(Q,b,b.scopeId,ne,K),Se){for(const Ze in Se)Ze!=="value"&&!yo(Ze)&&d(Q,Ze,null,Se[Ze],Z,K);"value"in Se&&d(Q,"value",null,Se.value,Z),(U=Se.onVnodeBeforeMount)&&Nn(U,K,b)}ee&&Xi(b,null,K,"beforeMount");const Re=jf(G,M);Re&&M.beforeEnter(Q),l(Q,_,w),((U=Se&&Se.onVnodeMounted)||Re||ee)&&Yt(()=>{try{U&&Nn(U,K,b),Re&&M.enter(Q),ee&&Xi(b,null,K,"mounted")}finally{}},G)},Ie=(b,_,w,K,G)=>{if(w&&V(b,w),K)for(let Z=0;Z{for(let U=Q;U{const se=_.el=b.el;let{patchFlag:Q,dynamicChildren:U,dirs:Se}=_;Q|=b.patchFlag&16;const I=b.props||mt,M=_.props||mt;let ee;if(w&&Qi(w,!1),(ee=M.onVnodeBeforeUpdate)&&Nn(ee,w,_,b),Se&&Xi(_,b,w,"beforeUpdate"),w&&Qi(w,!0),U&&(!b.dynamicChildren||b.dynamicChildren.length!==U.length)&&(Q=0,ne=!1,U=null),(I.innerHTML&&M.innerHTML==null||I.textContent&&M.textContent==null)&&T(se,""),U?ze(b.dynamicChildren,U,se,w,K,ar(_,G),Z):ne||ie(b,_,se,null,w,K,ar(_,G),Z,!1),Q>0){if(Q&16)Te(se,I,M,w,G);else if(Q&2&&I.class!==M.class&&d(se,"class",null,M.class,G),Q&4&&d(se,"style",I.style,M.style,G),Q&8){const Re=_.dynamicProps;for(let Ze=0;Ze{ee&&Nn(ee,w,_,b),Se&&Xi(_,b,w,"updated")},K)},ze=(b,_,w,K,G,Z,ne)=>{for(let se=0;se<_.length;se++){const Q=b[se],U=_[se],Se=Q.el&&(Q.type===re||!ss(Q,U)||Q.shapeFlag&198)?O(Q.el):w;F(Q,U,Se,null,K,G,Z,ne,!0)}},Te=(b,_,w,K,G)=>{if(_!==w){if(_!==mt)for(const Z in _)!yo(Z)&&!(Z in w)&&d(b,Z,_[Z],null,G,K);for(const Z in w){if(yo(Z))continue;const ne=w[Z],se=_[Z];ne!==se&&Z!=="value"&&d(b,Z,se,ne,G,K)}"value"in w&&d(b,"value",_.value,w.value,G)}},te=(b,_,w,K,G,Z,ne,se,Q)=>{const U=_.el=b?b.el:v(""),Se=_.anchor=b?b.anchor:v("");let{patchFlag:I,dynamicChildren:M,slotScopeIds:ee}=_;ee&&(se=se?se.concat(ee):ee),b==null?(l(U,w,K),l(Se,w,K),Ve(_.children||[],w,Se,G,Z,ne,se,Q)):I>0&&I&64&&M&&b.dynamicChildren&&b.dynamicChildren.length===M.length?(ze(b.dynamicChildren,M,w,G,Z,ne,se),(_.key!=null||G&&_===G.subTree)&&Zr(b,_,!0)):ie(b,_,w,Se,G,Z,ne,se,Q)},de=(b,_,w,K,G,Z,ne,se,Q)=>{_.slotScopeIds=se,b==null?_.shapeFlag&512?G.ctx.activate(_,w,K,ne,Q):_e(_,w,K,G,Z,ne,Q):be(b,_,Q)},_e=(b,_,w,K,G,Z,ne)=>{const se=b.component=eh(b,K,G);if(Ma(b)&&(se.ctx.renderer=vt),th(se,!1,ne),se.asyncDep){if(G&&G.registerDep(se,ae,ne),!b.el){const Q=se.subTree=z(Ht);ve(null,Q,_,w),b.placeholder=Q.el}}else ae(se,b,_,w,G,Z,ne)},be=(b,_,w)=>{const K=_.component=b.component;if(If(b,_,w))if(K.asyncDep&&!K.asyncResolved){le(K,_,w);return}else K.next=_,K.update();else _.el=b.el,K.vnode=_},ae=(b,_,w,K,G,Z,ne)=>{const se=()=>{if(b.isMounted){let{next:I,bu:M,u:ee,parent:Re,vnode:Ze}=b;{const wt=xc(b);if(wt){I&&(I.el=Ze.el,le(b,I,ne)),wt.asyncDep.then(()=>{Yt(()=>{b.isUnmounted||U()},G)});return}}let Ye=I,ht;Qi(b,!1),I?(I.el=Ze.el,le(b,I,ne)):I=Ze,M&&la(M),(ht=I.props&&I.props.onVnodeBeforeUpdate)&&Nn(ht,Re,I,Ze),Qi(b,!0);const ue=El(b),Ae=b.subTree;b.subTree=ue,F(Ae,ue,O(Ae.el),E(Ae),b,G,Z),I.el=ue.el,Ye===null&&Df(b,ue.el),ee&&Yt(ee,G),(ht=I.props&&I.props.onVnodeUpdated)&&Yt(()=>Nn(ht,Re,I,Ze),G)}else{let I;const{el:M,props:ee}=_,{bm:Re,m:Ze,parent:Ye,root:ht,type:ue}=b,Ae=zs(_);Qi(b,!1),Re&&la(Re),!Ae&&(I=ee&&ee.onVnodeBeforeMount)&&Nn(I,Ye,_),Qi(b,!0);{ht.ce&&ht.ce._hasShadowRoot()&&ht.ce._injectChildStyle(ue,b.parent?b.parent.type:void 0);const wt=b.subTree=El(b);F(null,wt,w,K,b,G,Z),_.el=wt.el}if(Ze&&Yt(Ze,G),!Ae&&(I=ee&&ee.onVnodeMounted)){const wt=_;Yt(()=>Nn(I,Ye,wt),G)}(_.shapeFlag&256||Ye&&zs(Ye.vnode)&&Ye.vnode.shapeFlag&256)&&b.a&&Yt(b.a,G),b.isMounted=!0,_=w=K=null}};b.scope.on();const Q=b.effect=new Cu(se);b.scope.off();const U=b.update=Q.run.bind(Q),Se=b.job=Q.runIfDirty.bind(Q);Se.i=b,Se.id=b.uid,Q.scheduler=()=>Br(Se),Qi(b,!0),U()},le=(b,_,w)=>{_.component=b;const K=b.vnode.props;b.vnode=_,b.next=null,Rf(b,_.props,K,w),Uf(b,_.children,w),Zn(),bl(b),Hn()},ie=(b,_,w,K,G,Z,ne,se,Q=!1)=>{const U=b&&b.children,Se=b?b.shapeFlag:0,I=_.children,{patchFlag:M,shapeFlag:ee}=_;if(M>0){if(M&128){me(U,I,w,K,G,Z,ne,se,Q);return}else if(M&256){rt(U,I,w,K,G,Z,ne,se,Q);return}}ee&8?(Se&16&&W(U,G,Z),I!==U&&T(w,I)):Se&16?ee&16?me(U,I,w,K,G,Z,ne,se,Q):W(U,G,Z,!0):(Se&8&&T(w,""),ee&16&&Ve(I,w,K,G,Z,ne,se,Q))},rt=(b,_,w,K,G,Z,ne,se,Q)=>{b=b||Ms,_=_||Ms;const U=b.length,Se=_.length,I=Math.min(U,Se);let M;for(M=0;MSe?W(b,G,Z,!0,!1,I):Ve(_,w,K,G,Z,ne,se,Q,I)},me=(b,_,w,K,G,Z,ne,se,Q)=>{let U=0;const Se=_.length;let I=b.length-1,M=Se-1;for(;U<=I&&U<=M;){const ee=b[U],Re=_[U]=Q?ri(_[U]):Bn(_[U]);if(ss(ee,Re))F(ee,Re,w,null,G,Z,ne,se,Q);else break;U++}for(;U<=I&&U<=M;){const ee=b[I],Re=_[M]=Q?ri(_[M]):Bn(_[M]);if(ss(ee,Re))F(ee,Re,w,null,G,Z,ne,se,Q);else break;I--,M--}if(U>I){if(U<=M){const ee=M+1,Re=eeM)for(;U<=I;)Xe(b[U],G,Z,!0),U++;else{const ee=U,Re=U,Ze=new Map;for(U=Re;U<=M;U++){const kt=_[U]=Q?ri(_[U]):Bn(_[U]);kt.key!=null&&Ze.set(kt.key,U)}let Ye,ht=0;const ue=M-Re+1;let Ae=!1,wt=0;const cn=new Array(ue);for(U=0;U=ue){Xe(kt,G,Z,!0);continue}let Dt;if(kt.key!=null)Dt=Ze.get(kt.key);else for(Ye=Re;Ye<=M;Ye++)if(cn[Ye-Re]===0&&ss(kt,_[Ye])){Dt=Ye;break}Dt===void 0?Xe(kt,G,Z,!0):(cn[Dt-Re]=U+1,Dt>=wt?wt=Dt:Ae=!0,F(kt,_[Dt],w,null,G,Z,ne,se,Q),ht++)}const tt=Ae?Wf(cn):Ms;for(Ye=tt.length-1,U=ue-1;U>=0;U--){const kt=Re+U,Dt=_[kt],on=_[kt+1],Qt=kt+1{const{el:Z,type:ne,transition:se,children:Q,shapeFlag:U}=b;if(U&6){Oe(b.component.subTree,_,w,K);return}if(U&128){b.suspense.move(_,w,K);return}if(U&64){ne.move(b,_,w,vt);return}if(ne===re){l(Z,_,w);for(let I=0;Ise.enter(Z),G));else{const{leave:I,delayLeave:M,afterLeave:ee}=se,Re=()=>{b.ctx.isUnmounted?u(Z):l(Z,_,w)},Ze=()=>{const Ye=Z._isLeaving||!!Z[xn];Z._isLeaving&&Z[xn](!0),se.persisted&&!Ye?Re():I(Z,()=>{Re(),ee&&ee()})};M?M(Z,Re,Ze):Ze()}else l(Z,_,w)},Xe=(b,_,w,K=!1,G=!1)=>{const{type:Z,props:ne,ref:se,children:Q,dynamicChildren:U,shapeFlag:Se,patchFlag:I,dirs:M,cacheIndex:ee,memo:Re}=b;if(I===-2&&(G=!1),se!=null&&(Zn(),ko(se,null,w,b,!0),Hn()),ee!=null&&(_.renderCache[ee]=void 0),Se&256){_.ctx.deactivate(b);return}const Ze=Se&1&&M,Ye=!zs(b);let ht;if(Ye&&(ht=ne&&ne.onVnodeBeforeUnmount)&&Nn(ht,_,b),Se&6)Ue(b.component,w,K);else{if(Se&128){b.suspense.unmount(w,K);return}Ze&&Xi(b,null,_,"beforeUnmount"),Se&64?b.type.remove(b,_,w,vt,K):U&&!U.hasOnce&&(Z!==re||I>0&&I&64)?W(U,_,w,!1,!0):(Z===re&&I&384||!G&&Se&16)&&W(Q,_,w),K&&ut(b)}const ue=Re!=null&&ee==null;(Ye&&(ht=ne&&ne.onVnodeUnmounted)||Ze||ue)&&Yt(()=>{ht&&Nn(ht,_,b),Ze&&Xi(b,null,_,"unmounted"),ue&&(b.el=null)},w)},ut=b=>{const{type:_,el:w,anchor:K,transition:G}=b;if(_===re){et(w,K);return}if(_===rr){he(b);return}const Z=()=>{u(w),G&&!G.persisted&&G.afterLeave&&G.afterLeave()};if(b.shapeFlag&1&&G&&!G.persisted){const{leave:ne,delayLeave:se}=G,Q=()=>ne(w,Z);se?se(b.el,Z,Q):Q()}else Z()},et=(b,_)=>{let w;for(;b!==_;)w=B(b),u(b),b=w;u(_)},Ue=(b,_,w)=>{const{bum:K,scope:G,job:Z,subTree:ne,um:se,m:Q,a:U}=b;Al(Q),Al(U),K&&la(K),G.stop(),Z&&(Z.flags|=8,Xe(ne,b,_,w)),se&&Yt(se,_),Yt(()=>{b.isUnmounted=!0},_)},W=(b,_,w,K=!1,G=!1,Z=0)=>{for(let ne=Z;ne{if(b.shapeFlag&6)return E(b.component.subTree);if(b.shapeFlag&128)return b.suspense.next();const _=B(b.anchor||b.el),w=_&&_[Ju];return w?B(w):_};let A=!1;const it=(b,_,w)=>{let K;b==null?_._vnode&&(Xe(_._vnode,null,null,!0),K=_._vnode.component):F(_._vnode||null,b,_,null,null,null,w),_._vnode=b,A||(A=!0,bl(K),ju(),A=!1)},vt={p:F,um:Xe,m:Oe,r:ut,mt:_e,mc:Ve,pc:ie,pbc:ze,n:E,o:t};return{render:it,hydrate:void 0,createApp:Mf(it)}}function ar({type:t,props:i},o){return o==="svg"&&t==="foreignObject"||o==="mathml"&&t==="annotation-xml"&&i&&i.encoding&&i.encoding.includes("html")?void 0:o}function Qi({effect:t,job:i},o){o?(t.flags|=32,i.flags|=4):(t.flags&=-33,i.flags&=-5)}function jf(t,i){return(!t||t&&!t.pendingBranch)&&i&&!i.persisted}function Zr(t,i,o=!1){const l=t.children,u=i.children;if(De(l)&&De(u))for(let d=0;d>1,t[o[v]]0&&(i[l]=o[d-1]),o[d]=l)}}for(d=o.length,h=o[d-1];d-- >0;)o[d]=h,h=i[h];return o}function xc(t){const i=t.subTree.component;if(i)return i.asyncDep&&!i.asyncResolved?i:xc(i)}function Al(t){if(t)for(let i=0;it.__isSuspense;function Kf(t,i){i&&i.pendingBranch?De(t)?i.effects.push(...t):i.effects.push(t):Xd(t)}const re=Symbol.for("v-fgt"),za=Symbol.for("v-txt"),Ht=Symbol.for("v-cmt"),rr=Symbol.for("v-stc"),To=[];let un=null;function p(t=!1){To.push(un=t?null:[])}function Gf(){To.pop(),un=To[To.length-1]||null}let Eo=1;function ma(t,i=!1){Eo+=t,t<0&&un&&i&&(un.hasOnce=!0)}function Sc(t){return t.dynamicChildren=Eo>0?un||Ms:null,Gf(),Eo>0&&un&&un.push(t),t}function g(t,i,o,l,u,d){return Sc(r(t,i,o,l,u,d,!0))}function at(t,i,o,l,u){return Sc(z(t,i,o,l,u,!0))}function Oo(t){return t?t.__v_isVNode===!0:!1}function ss(t,i){return t.type===i.type&&t.key===i.key}const Tc=({key:t})=>t??null,ua=({ref:t,ref_key:i,ref_for:o})=>(typeof t=="number"&&(t=""+t),t!=null?xt(t)||Wt(t)||We(t)?{i:jt,r:t,k:i,f:!!o}:t:null);function r(t,i=null,o=null,l=0,u=null,d=t===re?0:1,h=!1,v=!1){const y={__v_isVNode:!0,__v_skip:!0,type:t,props:i,key:i&&Tc(i),ref:i&&ua(i),scopeId:Ku,slotScopeIds:null,children:o,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:d,patchFlag:l,dynamicProps:u,dynamicChildren:null,appContext:null,ctx:jt};return v?(ga(y,o),d&128&&t.normalize(y)):o&&(y.shapeFlag|=xt(o)?8:16),Eo>0&&!h&&un&&(y.patchFlag>0||d&6)&&y.patchFlag!==32&&un.push(y),y}const z=qf;function qf(t,i=null,o=null,l=0,u=null,d=!1){if((!t||t===bf)&&(t=Ht),Oo(t)){const v=Ei(t,i,!0);return o&&ga(v,o),Eo>0&&!d&&un&&(v.shapeFlag&6?un[un.indexOf(t)]=v:un.push(v)),v.patchFlag=-2,v}if(oh(t)&&(t=t.__vccOpts),i){i=Yf(i);let{class:v,style:y}=i;v&&!xt(v)&&(i.class=Ee(v)),dt(y)&&(Fr(y)&&!De(y)&&(y=It({},y)),i.style=Is(y))}const h=xt(t)?1:kc(t)?128:Xu(t)?64:dt(t)?4:We(t)?2:0;return r(t,i,o,l,u,h,d,!0)}function Yf(t){return t?Fr(t)||mc(t)?It({},t):t:null}function Ei(t,i,o=!1,l=!1){const{props:u,ref:d,patchFlag:h,children:v,transition:y}=t,C=i?Jf(u||{},i):u,T={__v_isVNode:!0,__v_skip:!0,type:t.type,props:C,key:C&&Tc(C),ref:i&&i.ref?o&&d?De(d)?d.concat(ua(i)):[d,ua(i)]:ua(i):d,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:v,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:i&&t.type!==re?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&&Ei(t.ssContent),ssFallback:t.ssFallback&&Ei(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return y&&l&&Mo(T,y.clone(T)),T}function D(t=" ",i=0){return z(za,null,t,i)}function R(t="",i=!1){return i?(p(),at(Ht,null,t)):z(Ht,null,t)}function Bn(t){return t==null||typeof t=="boolean"?z(Ht):De(t)?z(re,null,t.slice()):Oo(t)?ri(t):z(za,null,String(t))}function ri(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:Ei(t)}function ga(t,i){let o=0;const{shapeFlag:l}=t;if(i==null)i=null;else if(De(i))o=16;else if(typeof i=="object")if(l&65){const u=i.default;u&&(u._c&&(u._d=!1),ga(t,u()),u._c&&(u._d=!0));return}else{o=32;const u=i._;!u&&!mc(i)?i._ctx=jt:u===3&&jt&&(jt.slots._===1?i._=1:(i._=2,t.patchFlag|=1024))}else if(We(i)){if(l&65){ga(t,{default:i});return}i={default:i,_ctx:jt},o=32}else i=String(i),l&64?(o=16,i=[D(i)]):o=8;t.children=i,t.shapeFlag|=o}function Jf(...t){const i={};for(let o=0;oXt||jt;let va,Sr;{const t=Pa(),i=(o,l)=>{let u;return(u=t[o])||(u=t[o]=[]),u.push(l),d=>{u.length>1?u.forEach(h=>h(d)):u[0](d)}};va=i("__VUE_INSTANCE_SETTERS__",o=>Xt=o),Sr=i("__VUE_SSR_SETTERS__",o=>zo=o)}const Do=t=>{const i=Xt;return va(t),t.scope.on(),()=>{t.scope.off(),va(i)}},$l=()=>{Xt&&Xt.scope.off(),va(null)};function Cc(t){return t.vnode.shapeFlag&4}let zo=!1;function th(t,i=!1,o=!1){i&&Sr(i);const{props:l,children:u}=t.vnode,d=Cc(t);Nf(t,l,d,i),Vf(t,u,o||i);const h=d?nh(t,i):void 0;return i&&Sr(!1),h}function nh(t,i){const o=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,wf);const{setup:l}=o;if(l){Zn();const u=t.setupContext=l.length>1?sh(t):null,d=Do(t),h=Io(l,t,0,[t.props,u]),v=yu(h);if(Hn(),d(),(v||t.sp)&&!zs(t)&&sc(t),v){if(h.then($l,$l),i)return h.then(y=>{Il(t,y)}).catch(y=>{La(y,t,0)});t.asyncDep=h}else Il(t,h)}else Lc(t)}function Il(t,i,o){We(i)?t.type.__ssrInlineRender?t.ssrRender=i:t.render=i:dt(i)&&(t.setupState=Vu(i)),Lc(t)}function Lc(t,i,o){const l=t.type;t.render||(t.render=l.render||Un);{const u=Do(t);Zn();try{kf(t)}finally{Hn(),u()}}}const ih={get(t,i){return Zt(t,"get",""),t[i]}};function sh(t){const i=o=>{t.exposed=o||{}};return{attrs:new Proxy(t.attrs,ih),slots:t.slots,emit:t.emit,expose:i}}function Aa(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(Vu(Ud(t.exposed)),{get(i,o){if(o in i)return i[o];if(o in So)return So[o](t)},has(i,o){return o in i||o in So}})):t.proxy}function oh(t){return We(t)&&"__vccOpts"in t}const ke=(t,i)=>Kd(t,i,zo);function ah(t,i,o){try{ma(-1);const l=arguments.length;return l===2?dt(i)&&!De(i)?Oo(i)?z(t,null,[i]):z(t,i):z(t,null,i):(l>3?o=Array.prototype.slice.call(arguments,2):l===3&&Oo(o)&&(o=[o]),z(t,i,o))}finally{ma(1)}}const rh="3.5.39";/** +* @vue/runtime-dom v3.5.39 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let Tr;const Dl=typeof window<"u"&&window.trustedTypes;if(Dl)try{Tr=Dl.createPolicy("vue",{createHTML:t=>t})}catch{}const Mc=Tr?t=>Tr.createHTML(t):t=>t,lh="http://www.w3.org/2000/svg",uh="http://www.w3.org/1998/Math/MathML",ai=typeof document<"u"?document:null,Nl=ai&&ai.createElement("template"),ch={insert:(t,i,o)=>{i.insertBefore(t,o||null)},remove:t=>{const i=t.parentNode;i&&i.removeChild(t)},createElement:(t,i,o,l)=>{const u=i==="svg"?ai.createElementNS(lh,t):i==="mathml"?ai.createElementNS(uh,t):o?ai.createElement(t,{is:o}):ai.createElement(t);return t==="select"&&l&&l.multiple!=null&&u.setAttribute("multiple",l.multiple),u},createText:t=>ai.createTextNode(t),createComment:t=>ai.createComment(t),setText:(t,i)=>{t.nodeValue=i},setElementText:(t,i)=>{t.textContent=i},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>ai.querySelector(t),setScopeId(t,i){t.setAttribute(i,"")},insertStaticContent(t,i,o,l,u,d){const h=o?o.previousSibling:i.lastChild;if(u&&(u===d||u.nextSibling))for(;i.insertBefore(u.cloneNode(!0),o),!(u===d||!(u=u.nextSibling)););else{Nl.innerHTML=Mc(l==="svg"?`${t}`:l==="mathml"?`${t}`:t);const v=Nl.content;if(l==="svg"||l==="mathml"){const y=v.firstChild;for(;y.firstChild;)v.appendChild(y.firstChild);v.removeChild(y)}i.insertBefore(v,o)}return[h?h.nextSibling:i.firstChild,o?o.previousSibling:i.lastChild]}},Ti="transition",ho="animation",Ao=Symbol("_vtc"),Ec={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},dh=It({},Qu,Ec),fh=t=>(t.displayName="Transition",t.props=dh,t),hh=fh((t,{slots:i})=>ah(uf,ph(t),i)),es=(t,i=[])=>{De(t)?t.forEach(o=>o(...i)):t&&t(...i)},Rl=t=>t?De(t)?t.some(i=>i.length>1):t.length>1:!1;function ph(t){const i={};for(const te in t)te in Ec||(i[te]=t[te]);if(t.css===!1)return i;const{name:o="v",type:l,duration:u,enterFromClass:d=`${o}-enter-from`,enterActiveClass:h=`${o}-enter-active`,enterToClass:v=`${o}-enter-to`,appearFromClass:y=d,appearActiveClass:C=h,appearToClass:T=v,leaveFromClass:O=`${o}-leave-from`,leaveActiveClass:B=`${o}-leave-active`,leaveToClass:V=`${o}-leave-to`}=t,H=mh(u),F=H&&H[0],fe=H&&H[1],{onBeforeEnter:ve,onEnter:Y,onEnterCancelled:Pe,onLeave:he,onLeaveCancelled:ye,onBeforeAppear:Ne=ve,onAppear:Ie=Y,onAppearCancelled:Ve=Pe}=i,pe=(te,de,_e,be)=>{te._enterCancelled=be,ts(te,de?T:v),ts(te,de?C:h),_e&&_e()},ze=(te,de)=>{te._isLeaving=!1,ts(te,O),ts(te,V),ts(te,B),de&&de()},Te=te=>(de,_e)=>{const be=te?Ie:Y,ae=()=>pe(de,te,_e);es(be,[de,ae]),Fl(()=>{ts(de,te?y:d),oi(de,te?T:v),Rl(be)||Bl(de,l,F,ae)})};return It(i,{onBeforeEnter(te){es(ve,[te]),oi(te,d),oi(te,h)},onBeforeAppear(te){es(Ne,[te]),oi(te,y),oi(te,C)},onEnter:Te(!1),onAppear:Te(!0),onLeave(te,de){te._isLeaving=!0;const _e=()=>ze(te,de);oi(te,O),te._enterCancelled?(oi(te,B),Zl(te)):(Zl(te),oi(te,B)),Fl(()=>{te._isLeaving&&(ts(te,O),oi(te,V),Rl(he)||Bl(te,l,fe,_e))}),es(he,[te,_e])},onEnterCancelled(te){pe(te,!1,void 0,!0),es(Pe,[te])},onAppearCancelled(te){pe(te,!0,void 0,!0),es(Ve,[te])},onLeaveCancelled(te){ze(te),es(ye,[te])}})}function mh(t){if(t==null)return null;if(dt(t))return[lr(t.enter),lr(t.leave)];{const i=lr(t);return[i,i]}}function lr(t){return pd(t)}function oi(t,i){i.split(/\s+/).forEach(o=>o&&t.classList.add(o)),(t[Ao]||(t[Ao]=new Set)).add(i)}function ts(t,i){i.split(/\s+/).forEach(l=>l&&t.classList.remove(l));const o=t[Ao];o&&(o.delete(i),o.size||(t[Ao]=void 0))}function Fl(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let gh=0;function Bl(t,i,o,l){const u=t._endId=++gh,d=()=>{u===t._endId&&l()};if(o!=null)return setTimeout(d,o);const{type:h,timeout:v,propCount:y}=vh(t,i);if(!h)return l();const C=h+"end";let T=0;const O=()=>{t.removeEventListener(C,B),d()},B=V=>{V.target===t&&++T>=y&&O()};setTimeout(()=>{T(o[H]||"").split(", "),u=l(`${Ti}Delay`),d=l(`${Ti}Duration`),h=Vl(u,d),v=l(`${ho}Delay`),y=l(`${ho}Duration`),C=Vl(v,y);let T=null,O=0,B=0;i===Ti?h>0&&(T=Ti,O=h,B=d.length):i===ho?C>0&&(T=ho,O=C,B=y.length):(O=Math.max(h,C),T=O>0?h>C?Ti:ho:null,B=T?T===Ti?d.length:y.length:0);const V=T===Ti&&/\b(?:transform|all)(?:,|$)/.test(l(`${Ti}Property`).toString());return{type:T,timeout:O,propCount:B,hasTransform:V}}function Vl(t,i){for(;t.lengthUl(o)+Ul(t[l])))}function Ul(t){return t==="auto"?0:Number(t.slice(0,-1).replace(",","."))*1e3}function Zl(t){return(t?t.ownerDocument:document).body.offsetHeight}function _h(t,i,o){const l=t[Ao];l&&(i=(i?[i,...l]:[...l]).join(" ")),i==null?t.removeAttribute("class"):o?t.setAttribute("class",i):t.className=i}const _a=Symbol("_vod"),Oc=Symbol("_vsh"),yh={name:"show",beforeMount(t,{value:i},{transition:o}){t[_a]=t.style.display==="none"?"":t.style.display,o&&i?o.beforeEnter(t):po(t,i)},mounted(t,{value:i},{transition:o}){o&&i&&o.enter(t)},updated(t,{value:i,oldValue:o},{transition:l}){!i!=!o&&(l?i?(l.beforeEnter(t),po(t,!0),l.enter(t)):l.leave(t,()=>{po(t,!1)}):po(t,i))},beforeUnmount(t,{value:i}){po(t,i)}};function po(t,i){t.style.display=i?t[_a]:"none",t[Oc]=!i}const bh=Symbol(""),xh=/(?:^|;)\s*display\s*:/;function wh(t,i,o){const l=t.style,u=xt(o);let d=!1;if(o&&!u){if(i)if(xt(i))for(const h of i.split(";")){const v=h.slice(0,h.indexOf(":")).trim();o[v]==null&&vo(l,v,"")}else for(const h in i)o[h]==null&&vo(l,h,"");for(const h in o){h==="display"&&(d=!0);const v=o[h];v!=null?Sh(t,h,!xt(i)&&i?i[h]:void 0,v)||vo(l,h,v):vo(l,h,"")}}else if(u){if(i!==o){const h=l[bh];h&&(o+=";"+h),l.cssText=o,d=xh.test(o)}}else i&&t.removeAttribute("style");_a in t&&(t[_a]=d?l.display:"",t[Oc]&&(l.display="none"))}const Hl=/\s*!important$/;function vo(t,i,o){if(De(o))o.forEach(l=>vo(t,i,l));else if(o==null&&(o=""),i.startsWith("--"))t.setProperty(i,o);else{const l=kh(t,i);Hl.test(o)?t.setProperty(zi(l),o.replace(Hl,""),"important"):t[l]=o}}const jl=["Webkit","Moz","ms"],ur={};function kh(t,i){const o=ur[i];if(o)return o;let l=Pn(i);if(l!=="filter"&&l in t)return ur[i]=l;l=wu(l);for(let u=0;ucr||(Eh.then(()=>cr=0),cr=Date.now());function zh(t,i){const o=l=>{if(!l._vts)l._vts=Date.now();else if(l._vts<=o.attached)return;const u=o.value;if(De(u)){const d=l.stopImmediatePropagation;l.stopImmediatePropagation=()=>{d.call(l),l._stopped=!0};const h=u.slice(),v=[l];for(let y=0;yt.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,Ah=(t,i,o,l,u,d)=>{const h=u==="svg";i==="class"?_h(t,l,h):i==="style"?wh(t,o,l):wa(i)?ka(i)||Ph(t,i,o,l,d):(i[0]==="."?(i=i.slice(1),!0):i[0]==="^"?(i=i.slice(1),!1):$h(t,i,l,h))?(Gl(t,i,l),!t.tagName.includes("-")&&(i==="value"||i==="checked"||i==="selected")&&Kl(t,i,l,h,d,i!=="value")):t._isVueCE&&(Ih(t,i)||t._def.__asyncLoader&&(/[A-Z]/.test(i)||!xt(l)))?Gl(t,Pn(i),l,d,i):(i==="true-value"?t._trueValue=l:i==="false-value"&&(t._falseValue=l),Kl(t,i,l,h))};function $h(t,i,o,l){if(l)return!!(i==="innerHTML"||i==="textContent"||i in t&&Yl(i)&&We(o));if(i==="spellcheck"||i==="draggable"||i==="translate"||i==="autocorrect"||i==="sandbox"&&t.tagName==="IFRAME"||i==="form"||i==="list"&&t.tagName==="INPUT"||i==="type"&&t.tagName==="TEXTAREA")return!1;if(i==="width"||i==="height"){const u=t.tagName;if(u==="IMG"||u==="VIDEO"||u==="CANVAS"||u==="SOURCE")return!1}return Yl(i)&&xt(o)?!1:i in t}function Ih(t,i){const o=t._def.props;if(!o)return!1;const l=Pn(i);return Array.isArray(o)?o.some(u=>Pn(u)===l):Object.keys(o).some(u=>Pn(u)===l)}const Oi=t=>{const i=t.props["onUpdate:modelValue"]||!1;return De(i)?o=>la(i,o):i};function Dh(t){t.target.composing=!0}function Jl(t){const i=t.target;i.composing&&(i.composing=!1,i.dispatchEvent(new Event("input")))}const kn=Symbol("_assign");function Xl(t,i,o){return i&&(t=t.trim()),o&&(t=Ta(t)),t}const xe={created(t,{modifiers:{lazy:i,trim:o,number:l}},u){t[kn]=Oi(u);const d=l||u.props&&u.props.type==="number";ci(t,i?"change":"input",h=>{h.target.composing||t[kn](Xl(t.value,o,d))}),(o||d)&&ci(t,"change",()=>{t.value=Xl(t.value,o,d)}),i||(ci(t,"compositionstart",Dh),ci(t,"compositionend",Jl),ci(t,"change",Jl))},mounted(t,{value:i}){t.value=i??""},beforeUpdate(t,{value:i,oldValue:o,modifiers:{lazy:l,trim:u,number:d}},h){if(t[kn]=Oi(h),t.composing)return;const v=(d||t.type==="number")&&!/^0\d/.test(t.value)?Ta(t.value):t.value,y=i??"";if(v===y)return;const C=t.getRootNode();(C instanceof Document||C instanceof ShadowRoot)&&C.activeElement===t&&t.type!=="range"&&(l&&i===o||u&&t.value.trim()===y)||(t.value=y)}},ya={deep:!0,created(t,i,o){t[kn]=Oi(o),ci(t,"change",()=>{const l=t._modelValue,u=Ns(t),d=t.checked,h=t[kn];if(De(l)){const v=zr(l,u),y=v!==-1;if(d&&!y)h(l.concat(u));else if(!d&&y){const C=[...l];C.splice(v,1),h(C)}}else if(Rs(l)){const v=new Set(l);d?v.add(u):v.delete(u),h(v)}else h(zc(t,d))})},mounted:Ql,beforeUpdate(t,i,o){t[kn]=Oi(o),Ql(t,i,o)}};function Ql(t,{value:i,oldValue:o},l){t._modelValue=i;let u;if(De(i))u=zr(i,l.props.value)>-1;else if(Rs(i))u=i.has(l.props.value);else{if(i===o)return;u=Mi(i,zc(t,!0))}t.checked!==u&&(t.checked=u)}const Nh={created(t,{value:i},o){t.checked=Mi(i,o.props.value),t[kn]=Oi(o),ci(t,"change",()=>{t[kn](Ns(t))})},beforeUpdate(t,{value:i,oldValue:o},l){t[kn]=Oi(l),i!==o&&(t.checked=Mi(i,l.props.value))}},Et={deep:!0,created(t,{value:i,modifiers:{number:o}},l){const u=Rs(i);ci(t,"change",()=>{const d=Array.prototype.filter.call(t.options,h=>h.selected).map(h=>o?Ta(Ns(h)):Ns(h));t[kn](t.multiple?u?new Set(d):d:d[0]),t._assigning=!0,Zu(()=>{t._assigning=!1})}),t[kn]=Oi(l)},mounted(t,{value:i}){eu(t,i)},beforeUpdate(t,i,o){t[kn]=Oi(o)},updated(t,{value:i}){t._assigning||eu(t,i)}};function eu(t,i){const o=t.multiple,l=De(i);if(!(o&&!l&&!Rs(i))){for(let u=0,d=t.options.length;uString(C)===String(v)):h.selected=zr(i,v)>-1}else h.selected=i.has(v);else if(Mi(Ns(h),i)){t.selectedIndex!==u&&(t.selectedIndex=u);return}}!o&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function Ns(t){return"_value"in t?t._value:t.value}function zc(t,i){const o=i?"_trueValue":"_falseValue";return o in t?t[o]:i}const Rh={created(t,i,o){aa(t,i,o,null,"created")},mounted(t,i,o){aa(t,i,o,null,"mounted")},beforeUpdate(t,i,o,l){aa(t,i,o,l,"beforeUpdate")},updated(t,i,o,l){aa(t,i,o,l,"updated")}};function Fh(t,i){switch(t){case"SELECT":return Et;case"TEXTAREA":return xe;default:switch(i){case"checkbox":return ya;case"radio":return Nh;default:return xe}}}function aa(t,i,o,l,u){const h=Fh(t.tagName,o.props&&o.props.type)[u];h&&h(t,i,o,l)}const Bh=["ctrl","shift","alt","meta"],Vh={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)=>Bh.some(o=>t[`${o}Key`]&&!i.includes(o))},Hr=(t,i)=>{if(!t)return t;const o=t._withMods||(t._withMods={}),l=i.join(".");return o[l]||(o[l]=((u,...d)=>{for(let h=0;h{const o=t._withKeys||(t._withKeys={}),l=i.join(".");return o[l]||(o[l]=(u=>{if(!("key"in u))return;const d=zi(u.key);if(i.some(h=>h===d||Uh[h]===d))return t(u)}))},Zh=It({patchProp:Ah},ch);let nu;function Hh(){return nu||(nu=Zf(Zh))}const jh=((...t)=>{const i=Hh().createApp(...t),{mount:o}=i;return i.mount=l=>{const u=Kh(l);if(!u)return;const d=i._component;!We(d)&&!d.render&&!d.template&&(d.template=u.innerHTML),u.nodeType===1&&(u.textContent="");const h=o(u,!1,Wh(u));return u instanceof Element&&(u.removeAttribute("v-cloak"),u.setAttribute("data-v-app","")),h},i});function Wh(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function Kh(t){return xt(t)?document.querySelector(t):t}const Ac="pv_theme",iu={light:"#EEF0F3",dark:"#0B1730"},ba=typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;function $c(){return ba&&ba.matches?"dark":"light"}function Gh(){try{return localStorage.getItem(Ac)||"light"}catch{return"light"}}function Ic(t){return t==="system"?$c():t}function Dc(t){const i=document.documentElement;i.setAttribute("data-theme",t),i.style.backgroundColor=iu[t]||iu.light}const rs=j(Gh()),$s=j(Ic(rs.value));function xa(t){rs.value=t;const i=Ic(t);$s.value=i,Dc(i);try{localStorage.setItem(Ac,t)}catch{}}function su(){xa($s.value==="dark"?"light":"dark")}ba&&ba.addEventListener("change",()=>{if(rs.value==="system"){const t=$c();$s.value=t,Dc(t)}});async function qh(){try{const t=await fetch("/bff/config");return t.ok?await t.json():{apiBase:""}}catch{return{apiBase:""}}}async function ou(){try{const t=await fetch("/bff/me");return t.ok?await t.json():null}catch{return null}}async function Yh(t,i,o){const l=await fetch("/bff/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t,password:i,apiBase:o})});return{ok:l.ok,status:l.status,body:await l.json().catch(()=>({}))}}async function Jh(){try{await fetch("/bff/logout",{method:"POST"})}catch{}}async function Xh(){try{const t=await fetch("/bff/devices");return t.ok?await t.json():[]}catch{return[]}}async function Qh(){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 ep(t,i,o,l){const u=await fetch("/bff/users",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t,password:i,role:o,organization:l})});return{ok:u.ok,status:u.status,body:await u.json().catch(()=>({}))}}async function tp(t,i){const o=await fetch(`/bff/users/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return{ok:o.ok,status:o.status,body:await o.json().catch(()=>({}))}}async function np(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 ip(){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 sp(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 op(t,i){const o=await fetch(`/bff/orgs/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i})});return{ok:o.ok,status:o.status,body:await o.json().catch(()=>({}))}}async function ap(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 rp(){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 lp(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 up(){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 au(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 cp(){const t=await fetch("/bff/integrations/opensky/health",{method:"POST"});return{ok:t.ok,status:t.status,body:await t.json().catch(()=>({}))}}async function dp(){try{const t=await fetch("/bff/integrations/opensky/states");if(!t.ok)return{states:[],unavailable:!0,detail:"OpenSky unavailable"};const i=await t.json();return{states:i.states||[],time:i.time,unavailable:!!i.unavailable,detail:i.detail||"",plan:i.plan||"",recommendedInterval:i.recommendedInterval||0}}catch{return{states:[],unavailable:!0,detail:"OpenSky unavailable"}}}async function fp(){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 ru(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 hp(){const t=await fetch("/bff/integrations/filetransfer/health",{method:"POST"});return{ok:t.ok,status:t.status,body:await t.json().catch(()=>({}))}}async function pp(){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 ra(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 mp(){const t=await fetch("/bff/integrations/localstorage/health",{method:"POST"});return{ok:t.ok,status:t.status,body:await t.json().catch(()=>({}))}}async function gp(){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 lu(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 vp(){const t=await fetch("/bff/integrations/webdav/health",{method:"POST"});return{ok:t.ok,status:t.status,body:await t.json().catch(()=>({}))}}async function Nc(){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 _p(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 yp(t,i){const o=await fetch(`/bff/drones/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return{ok:o.ok,status:o.status,body:await o.json().catch(()=>({}))}}async function bp(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 xp(){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 wp(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 kp(t,i){const o=await fetch(`/bff/flights/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return{ok:o.ok,status:o.status,body:await o.json().catch(()=>({}))}}async function Sp(t){const i=await fetch(`/bff/flights/${encodeURIComponent(t)}`,{method:"DELETE"});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}function Tp(){return"/bff/logbook/export"}async function Pp(t){try{const i=t!=null&&t!==""?`?expiring=${encodeURIComponent(t)}`:"",o=await fetch(`/bff/documents${i}`);return o.ok?{ok:!0,status:200,documents:(await o.json()).documents||[]}:{ok:!1,status:o.status,documents:[]}}catch{return{ok:!1,status:0,documents:[]}}}async function Cp(t,i){const o=new FormData;Object.entries(t).forEach(([u,d])=>{d!=null&&d!==""&&o.append(u,d)}),i&&o.append("file",i);const l=await fetch("/bff/documents",{method:"POST",body:o});return{ok:l.ok,status:l.status,body:await l.json().catch(()=>({}))}}async function Lp(t,i){const o=await fetch(`/bff/documents/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return{ok:o.ok,status:o.status,body:await o.json().catch(()=>({}))}}async function Mp(t){const i=await fetch(`/bff/documents/${encodeURIComponent(t)}`,{method:"DELETE"});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}function dr(t){return`/bff/documents/${encodeURIComponent(t)}/file`}function Ep(t){return`/bff/documents/${encodeURIComponent(t)}/file?inline=1`}async function Op(t,i,o){const l=await fetch(`/bff/devices/${encodeURIComponent(t)}/command`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:i,payload:o})});return{ok:l.ok,body:await l.json().catch(()=>({}))}}const Rc="pv_prefs",Pr={name:"",username:"",displayName:"",bio:"",avatar:"",showEmail:!1,fontSize:"md",language:"en",region:"US",dateFormat:"MDY",timeFormat:"24",reduceMotion:!1,showAirTraffic:!0,airTrafficInterval:"auto",twoFactor:!1};function zp(){try{return{...Pr,...JSON.parse(localStorage.getItem(Rc)||"{}")||{}}}catch{return{...Pr}}}const we=bt(zp());function Fc(){try{localStorage.setItem(Rc,JSON.stringify(we))}catch{}}function Bc(t){if(!t||typeof t!="object")return!1;for(const i of Object.keys(Pr))i in t&&(we[i]=t[i]);return!0}const Ap={sm:15,md:16,lg:18};function jr(t){document.documentElement.style.fontSize=(Ap[t]||16)+"px"}function Wr(t){document.documentElement.classList.toggle("reduce-motion",!!t)}function Vc(t){const i=new Date(t),o=i.getFullYear(),l=String(i.getMonth()+1).padStart(2,"0"),u=String(i.getDate()).padStart(2,"0");let d;switch(we.dateFormat){case"DMY":d=`${u}/${l}/${o}`;break;case"YMD":d=`${o}/${l}/${u}`;break;case"ISO":d=`${o}-${l}-${u}`;break;default:d=`${l}/${u}/${o}`}let h;return we.timeFormat==="12"?h=i.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0}):h=`${String(i.getHours()).padStart(2,"0")}:${String(i.getMinutes()).padStart(2,"0")}:${String(i.getSeconds()).padStart(2,"0")}`,{date:d,time:h}}function uu(t){return Vc(t).time}function cu(t){const i=Vc(t);return`${i.date} ${i.time}`}let Kr=!1,Cr=!1,Lr=null;function $p(){return{...JSON.parse(JSON.stringify(we)),themeMode:rs.value}}function Gr(){!Kr||Cr||(clearTimeout(Lr),Lr=setTimeout(()=>{lp($p())},600))}function Ip(t){Cr=!0;try{Bc(t),t.themeMode&&xa(t.themeMode),jr(we.fontSize),Wr(we.reduceMotion),Fc()}finally{Cr=!1}}async function du(){Kr=!0;const t=await rp();t&&Object.keys(t).length?Ip(t):Gr()}function Dp(){Kr=!1,clearTimeout(Lr)}$t(we,()=>{Fc(),Gr()},{deep:!0});$t(rs,Gr);$t(()=>we.fontSize,jr,{immediate:!0});$t(()=>we.reduceMotion,Wr,{immediate:!0});const Np=["width","height"],Uc={__name:"BrandMark",props:{size:{type:[Number,String],default:28}},setup(t){return(i,o)=>(p(),g("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none","aria-hidden":"true"},[...o[0]||(o[0]=[r("g",{"stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round"},[r("polyline",{points:"8,30 19,17 30,30",stroke:"var(--accent)"}),r("polyline",{points:"18,33 29,20 40,33",stroke:"currentColor"})],-1)])],8,Np))}},Rp=["title","aria-label"],Fp={key:0,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Bp={key:1,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Vp={__name:"ThemeToggle",setup(t){return(i,o)=>(p(),g("button",{class:"btn-icon",type:"button",title:$e($s)==="dark"?"Switch to light":"Switch to dark","aria-label":$e($s)==="dark"?"Switch to light theme":"Switch to dark theme",onClick:o[0]||(o[0]=(...l)=>$e(su)&&$e(su)(...l))},[$e($s)==="dark"?(p(),g("svg",Fp,[...o[1]||(o[1]=[r("circle",{cx:"12",cy:"12",r:"4"},null,-1),r("path",{d:"M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41"},null,-1)])])):(p(),g("svg",Bp,[...o[2]||(o[2]=[r("path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9z"},null,-1)])]))],8,Rp))}},Up={class:"relative grid h-full place-items-center p-5"},Zp={class:"absolute right-5 top-5"},Hp={class:"mb-6 flex items-center gap-3 text-ink"},jp={class:"relative mb-1"},Wp=["type"],Kp=["aria-label","title"],Gp={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]"},qp={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]"},Yp={key:0,class:"mt-4"},Jp={key:1,class:"mt-4 rounded border border-line bg-danger-soft px-3 py-2 text-sm text-danger-fg"},Xp=["disabled"],Qp={__name:"LoginView",props:{defaultApiBase:{type:String,default:""}},emits:["signed-in"],setup(t,{emit:i}){const o=t,l=i,u=j(""),d=j(""),h=j(localStorage.getItem("api_url")||o.defaultApiBase||"http://localhost:8080"),v=j(!1),y=j(!1),C=j(!1),T=j("");async function O(){C.value=!0,T.value="",localStorage.setItem("api_url",h.value.trim());const{ok:B,status:V,body:H}=await Yh(u.value.trim(),d.value,h.value.trim());if(C.value=!1,B){l("signed-in",H.email);return}T.value=V===400?"Invalid email or password.":V===502?"API server can't reach PocketBase.":H.message||H.error||"Cannot reach the API server."}return(B,V)=>(p(),g("div",Up,[r("div",Zp,[z(Vp)]),r("form",{class:"panel w-[380px] p-8 shadow-md",onSubmit:Hr(O,["prevent"])},[r("div",Hp,[z(Uc,{size:34}),V[5]||(V[5]=r("div",{class:"leading-tight"},[r("div",{class:"text-mode"},"PilotVault"),r("div",{class:"eyebrow mt-0.5"},"Control panel")],-1))]),V[9]||(V[9]=r("label",{class:"eyebrow mb-1.5 block"},"Email",-1)),oe(r("input",{"onUpdate:modelValue":V[0]||(V[0]=H=>u.value=H),type:"email",autocomplete:"username",required:"",class:"field mb-4",placeholder:"you@example.com"},null,512),[[xe,u.value]]),V[10]||(V[10]=r("label",{class:"eyebrow mb-1.5 block"},"Password",-1)),r("div",jp,[oe(r("input",{"onUpdate:modelValue":V[1]||(V[1]=H=>d.value=H),type:y.value?"text":"password",autocomplete:"current-password",required:"",class:"field w-full pr-10",placeholder:"••••••••"},null,8,Wp),[[Rh,d.value]]),r("button",{type:"button",class:"absolute inset-y-0 right-0 grid w-10 place-items-center text-ink-muted transition hover:text-ink-secondary","aria-label":y.value?"Hide password":"Show password",title:y.value?"Hide password":"Show password",onClick:V[2]||(V[2]=H=>y.value=!y.value)},[y.value?(p(),g("svg",Gp,[...V[6]||(V[6]=[r("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"},null,-1),r("line",{x1:"1",y1:"1",x2:"23",y2:"23"},null,-1)])])):(p(),g("svg",qp,[...V[7]||(V[7]=[r("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"},null,-1),r("circle",{cx:"12",cy:"12",r:"3"},null,-1)])]))],8,Kp)]),v.value?(p(),g("div",Yp,[V[8]||(V[8]=r("label",{class:"eyebrow mb-1.5 block"},"API Server",-1)),oe(r("input",{"onUpdate:modelValue":V[3]||(V[3]=H=>h.value=H),type:"text",class:"field font-mono",placeholder:"10.2.1.101:8080"},null,512),[[xe,h.value]])])):R("",!0),T.value?(p(),g("p",Jp,S(T.value),1)):R("",!0),r("button",{type:"submit",class:"btn-accent mt-6 w-full",disabled:C.value},S(C.value?"Signing in…":"Sign in"),9,Xp),r("button",{type:"button",class:"mx-auto mt-3 block text-xs text-ink-muted transition hover:text-ink-secondary",onClick:V[4]||(V[4]=H=>v.value=!v.value)},S(v.value?"Hide server settings":"Server settings"),1)],32)]))}};function em(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var _o={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 tm=_o.exports,fu;function nm(){return fu||(fu=1,(function(t,i){(function(o,l){l(i)})(tm,(function(o){var l="1.9.4";function u(e){var n,s,a,c;for(s=1,a=arguments.length;s"u"||!L||!L.Mixin)){e=Pe(e)?e:[e];for(var n=0;n0?Math.floor(e):Math.ceil(e)};ie.prototype={clone:function(){return new ie(this.x,this.y)},add:function(e){return this.clone()._add(me(e))},_add:function(e){return this.x+=e.x,this.y+=e.y,this},subtract:function(e){return this.clone()._subtract(me(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 ie(this.x*e.x,this.y*e.y)},unscaleBy:function(e){return new ie(this.x/e.x,this.y/e.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=rt(this.x),this.y=rt(this.y),this},distanceTo:function(e){e=me(e);var n=e.x-this.x,s=e.y-this.y;return Math.sqrt(n*n+s*s)},equals:function(e){return e=me(e),e.x===this.x&&e.y===this.y},contains:function(e){return e=me(e),Math.abs(e.x)<=Math.abs(this.x)&&Math.abs(e.y)<=Math.abs(this.y)},toString:function(){return"Point("+B(this.x)+", "+B(this.y)+")"}};function me(e,n,s){return e instanceof ie?e:Pe(e)?new ie(e[0],e[1]):e==null?e:typeof e=="object"&&"x"in e&&"y"in e?new ie(e.x,e.y):new ie(e,n,s)}function Oe(e,n){if(e)for(var s=n?[e,n]:e,a=0,c=s.length;a=this.min.x&&s.x<=this.max.x&&n.y>=this.min.y&&s.y<=this.max.y},intersects:function(e){e=Xe(e);var n=this.min,s=this.max,a=e.min,c=e.max,m=c.x>=n.x&&a.x<=s.x,P=c.y>=n.y&&a.y<=s.y;return m&&P},overlaps:function(e){e=Xe(e);var n=this.min,s=this.max,a=e.min,c=e.max,m=c.x>n.x&&a.xn.y&&a.y=n.lat&&c.lat<=s.lat&&a.lng>=n.lng&&c.lng<=s.lng},intersects:function(e){e=et(e);var n=this._southWest,s=this._northEast,a=e.getSouthWest(),c=e.getNorthEast(),m=c.lat>=n.lat&&a.lat<=s.lat,P=c.lng>=n.lng&&a.lng<=s.lng;return m&&P},overlaps:function(e){e=et(e);var n=this._southWest,s=this._northEast,a=e.getSouthWest(),c=e.getNorthEast(),m=c.lat>n.lat&&a.latn.lng&&a.lng1,Ft=(function(){var e=!1;try{var n=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassiveEventSupport",O,n),window.removeEventListener("testPassiveEventSupport",O,n)}catch{}return e})(),en=(function(){return!!document.createElement("canvas").getContext})(),yt=!!(document.createElementNS&&K("svg").createSVGRect),Ia=!!yt&&(function(){var e=document.createElement("div");return e.innerHTML="",(e.firstChild&&e.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"})(),Ro=!yt&&(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}})(),Us=navigator.platform.indexOf("Mac")===0,Da=navigator.platform.indexOf("Linux")===0;function fn(e){return navigator.userAgent.toLowerCase().indexOf(e)>=0}var Le={ie:ne,ielt9:se,edge:Q,webkit:U,android:Se,android23:I,androidStock:ee,opera:Re,chrome:Ze,gecko:Ye,safari:ht,phantom:ue,opera12:Ae,win:wt,ie3d:cn,webkit3d:tt,gecko3d:kt,any3d:Dt,mobile:on,mobileWebkit:Qt,mobileWebkit3d:pi,msPointer:Bs,pointer:No,touch:Vs,touchNative:ls,mobileOpera:$a,mobileGecko:dn,retina:us,passiveEvents:Ft,canvas:en,svg:yt,vml:Ro,inlineSvg:Ia,mac:Us,linux:Da},Fo=Le.msPointer?"MSPointerDown":"pointerdown",Zs=Le.msPointer?"MSPointerMove":"pointermove",Bo=Le.msPointer?"MSPointerUp":"pointerup",Vo=Le.msPointer?"MSPointerCancel":"pointercancel",Hs={touchstart:Fo,touchmove:Zs,touchend:Bo,touchcancel:Vo},ot={touchstart:js,touchmove:hs,touchend:hs,touchcancel:hs},an={},cs=!1;function Bt(e,n,s){return n==="touchstart"&&mi(),ot[n]?(s=ot[n].bind(this,s),e.addEventListener(Hs[n],s,!1),s):(console.warn("wrong event specified:",n),O)}function Ai(e,n,s){if(!Hs[n]){console.warn("wrong event specified:",n);return}e.removeEventListener(Hs[n],s,!1)}function ds(e){an[e.pointerId]=e}function fs(e){an[e.pointerId]&&(an[e.pointerId]=e)}function hn(e){delete an[e.pointerId]}function mi(){cs||(document.addEventListener(Fo,ds,!0),document.addEventListener(Zs,fs,!0),document.addEventListener(Bo,hn,!0),document.addEventListener(Vo,hn,!0),cs=!0)}function hs(e,n){if(n.pointerType!==(n.MSPOINTER_TYPE_MOUSE||"mouse")){n.touches=[];for(var s in an)n.touches.push(an[s]);n.changedTouches=[n],e(n)}}function js(e,n){n.MSPOINTER_TYPE_TOUCH&&n.pointerType===n.MSPOINTER_TYPE_TOUCH&&St(n),hs(e,n)}function Ws(e){var n={},s,a;for(a in e)s=e[a],n[a]=s&&s.bind?s.bind(e):s;return e=n,n.type="dblclick",n.detail=2,n.isTrusted=!1,n._simulated=!0,n}var Na=200;function pn(e,n){e.addEventListener("dblclick",n);var s=0,a;function c(m){if(m.detail!==1){a=m.detail;return}if(!(m.pointerType==="mouse"||m.sourceCapabilities&&!m.sourceCapabilities.firesTouchEvents)){var P=_s(m);if(!(P.some(function(N){return N instanceof HTMLLabelElement&&N.attributes.for})&&!P.some(function(N){return N instanceof HTMLInputElement||N instanceof HTMLSelectElement}))){var $=Date.now();$-s<=Na?(a++,a===2&&n(Ws(m))):a=1,s=$}}}return e.addEventListener("click",c),{dblclick:n,simDblclick:c}}function En(e,n){e.removeEventListener("dblclick",n.dblclick),e.removeEventListener("click",n.simDblclick)}var On=Kn(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),Vt=Kn(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),Ks=Vt==="webkitTransition"||Vt==="OTransition"?Vt+"End":"transitionend";function ps(e){return typeof e=="string"?document.getElementById(e):e}function $i(e,n){var s=e.style[n]||e.currentStyle&&e.currentStyle[n];if((!s||s==="auto")&&document.defaultView){var a=document.defaultView.getComputedStyle(e,null);s=a?a[n]:null}return s==="auto"?null:s}function nt(e,n,s){var a=document.createElement(e);return a.className=n||"",s&&s.appendChild(a),a}function _t(e){var n=e.parentNode;n&&n.removeChild(e)}function ms(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function jn(e){var n=e.parentNode;n&&n.lastChild!==e&&n.appendChild(e)}function gi(e){var n=e.parentNode;n&&n.firstChild!==e&&n.insertBefore(e,n.firstChild)}function Gs(e,n){if(e.classList!==void 0)return e.classList.contains(n);var s=Wn(e);return s.length>0&&new RegExp("(^|\\s)"+n+"(\\s|$)").test(s)}function je(e,n){if(e.classList!==void 0)for(var s=H(n),a=0,c=s.length;a0?2*window.devicePixelRatio:1;function Yn(e){return Le.edge?e.wheelDeltaY/2:e.deltaY&&e.deltaMode===0?-e.deltaY/Kt: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 ys(e,n){var s=n.relatedTarget;if(!s)return!0;try{for(;s&&s!==e;)s=s.parentNode}catch{return!1}return s!==e}var Fa={__proto__:null,on:He,off:ft,stopPropagation:An,disableScrollPropagation:eo,disableClickPropagation:qn,preventDefault:St,stop:gn,getPropagationPath:_s,getMousePosition:Qe,getWheelDelta:Yn,isExternalTarget:ys,addListener:He,removeListener:ft},bs=le.extend({run:function(e,n,s,a){this.stop(),this._el=e,this._inProgress=!0,this._duration=s||.25,this._easeOutPower=1/Math.max(a||.5,.2),this._startPos=rn(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=Te(this._animate,this),this._step()},_step:function(e){var n=+new Date-this._startTime,s=this._duration*1e3;nthis.options.maxZoom)?this.setZoom(e):this},panInsideBounds:function(e,n){this._enforcingBounds=!0;var s=this.getCenter(),a=this._limitCenter(s,this._zoom,et(e));return s.equals(a)||this.panTo(a,n),this._enforcingBounds=!1,this},panInside:function(e,n){n=n||{};var s=me(n.paddingTopLeft||n.padding||[0,0]),a=me(n.paddingBottomRight||n.padding||[0,0]),c=this.project(this.getCenter()),m=this.project(e),P=this.getPixelBounds(),$=Xe([P.min.add(s),P.max.subtract(a)]),N=$.getSize();if(!$.contains(m)){this._enforcingBounds=!0;var J=m.subtract($.getCenter()),ge=$.extend(m).getSize().subtract(N);c.x+=J.x<0?-ge.x:ge.x,c.y+=J.y<0?-ge.y:ge.y,this.panTo(this.unproject(c),n),this._enforcingBounds=!1}return this},invalidateSize:function(e){if(!this._loaded)return this;e=u({animate:!1,pan:!0},e===!0?{animate:!0}:e);var n=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var s=this.getSize(),a=n.divideBy(2).round(),c=s.divideBy(2).round(),m=a.subtract(c);return!m.x&&!m.y?this:(e.animate&&e.pan?this.panBy(m):(e.pan&&this._rawPanBy(m),this.fire("move"),e.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(h(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:n,newSize:s}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(e){if(e=this._locateOptions=u({timeout:1e4,watch:!1},e),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var n=h(this._handleGeolocationResponse,this),s=h(this._handleGeolocationError,this);return e.watch?this._locationWatchId=navigator.geolocation.watchPosition(n,s,e):navigator.geolocation.getCurrentPosition(n,s,e),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(e){if(this._container._leaflet_id){var n=e.code,s=e.message||(n===1?"permission denied":n===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:n,message:"Geolocation error: "+s+"."})}},_handleGeolocationResponse:function(e){if(this._container._leaflet_id){var n=e.coords.latitude,s=e.coords.longitude,a=new Ue(n,s),c=a.toBounds(e.coords.accuracy*2),m=this._locateOptions;if(m.setView){var P=this.getBoundsZoom(c);this.setView(a,m.maxZoom?Math.min(P,m.maxZoom):P)}var $={latlng:a,bounds:c,timestamp:e.timestamp};for(var N in e.coords)typeof e.coords[N]=="number"&&($[N]=e.coords[N]);this.fire("locationfound",$)}},addHandler:function(e,n){if(!n)return this;var s=this[e]=new n(this);return this._handlers.push(s),this.options[e]&&s.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),_t(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(te(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)_t(this._panes[e]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(e,n){var s="leaflet-pane"+(e?" leaflet-"+e.replace("Pane","")+"-pane":""),a=nt("div",s,n||this._mapPane);return e&&(this._panes[e]=a),a},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var e=this.getPixelBounds(),n=this.unproject(e.getBottomLeft()),s=this.unproject(e.getTopRight());return new ut(n,s)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(e,n,s){e=et(e),s=me(s||[0,0]);var a=this.getZoom()||0,c=this.getMinZoom(),m=this.getMaxZoom(),P=e.getNorthWest(),$=e.getSouthEast(),N=this.getSize().subtract(s),J=Xe(this.project($,a),this.project(P,a)).getSize(),ge=Le.any3d?this.options.zoomSnap:1,Fe=N.x/J.x,Ge=N.y/J.y,Gt=n?Math.max(Fe,Ge):Math.min(Fe,Ge);return a=this.getScaleZoom(Gt,a),ge&&(a=Math.round(a/(ge/100))*(ge/100),a=n?Math.ceil(a/ge)*ge:Math.floor(a/ge)*ge),Math.max(c,Math.min(m,a))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new ie(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(e,n){var s=this._getTopLeftPoint(e,n);return new Oe(s,s.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(e){return this.options.crs.getProjectedBounds(e===void 0?this.getZoom():e)},getPane:function(e){return typeof e=="string"?this._panes[e]:e},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(e,n){var s=this.options.crs;return n=n===void 0?this._zoom:n,s.scale(e)/s.scale(n)},getScaleZoom:function(e,n){var s=this.options.crs;n=n===void 0?this._zoom:n;var a=s.zoom(e*s.scale(n));return isNaN(a)?1/0:a},project:function(e,n){return n=n===void 0?this._zoom:n,this.options.crs.latLngToPoint(W(e),n)},unproject:function(e,n){return n=n===void 0?this._zoom:n,this.options.crs.pointToLatLng(me(e),n)},layerPointToLatLng:function(e){var n=me(e).add(this.getPixelOrigin());return this.unproject(n)},latLngToLayerPoint:function(e){var n=this.project(W(e))._round();return n._subtract(this.getPixelOrigin())},wrapLatLng:function(e){return this.options.crs.wrapLatLng(W(e))},wrapLatLngBounds:function(e){return this.options.crs.wrapLatLngBounds(et(e))},distance:function(e,n){return this.options.crs.distance(W(e),W(n))},containerPointToLayerPoint:function(e){return me(e).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(e){return me(e).add(this._getMapPanePos())},containerPointToLatLng:function(e){var n=this.containerPointToLayerPoint(me(e));return this.layerPointToLatLng(n)},latLngToContainerPoint:function(e){return this.layerPointToContainerPoint(this.latLngToLayerPoint(W(e)))},mouseEventToContainerPoint:function(e){return Qe(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=ps(e);if(n){if(n._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");He(n,"scroll",this._onScroll,this),this._containerId=y(n)},_initLayout:function(){var e=this._container;this._fadeAnimated=this.options.fadeAnimation&&Le.any3d,je(e,"leaflet-container"+(Le.touch?" leaflet-touch":"")+(Le.retina?" leaflet-retina":"")+(Le.ielt9?" leaflet-oldie":"")+(Le.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var n=$i(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),pt(this._mapPane,new ie(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,s){pt(this._mapPane,new ie(0,0));var a=!this._loaded;this._loaded=!0,n=this._limitZoom(n),this.fire("viewprereset");var c=this._zoom!==n;this._moveStart(c,s)._move(e,n)._moveEnd(c),this.fire("viewreset"),a&&this.fire("load")},_moveStart:function(e,n){return e&&this.fire("zoomstart"),n||this.fire("movestart"),this},_move:function(e,n,s,a){n===void 0&&(n=this._zoom);var c=this._zoom!==n;return this._zoom=n,this._lastCenter=e,this._pixelOrigin=this._getNewPixelOrigin(e),a?s&&s.pinch&&this.fire("zoom",s):((c||s&&s.pinch)&&this.fire("zoom",s),this.fire("move",s)),this},_moveEnd:function(e){return e&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return te(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(e){pt(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?ft:He;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),Le.any3d&&this.options.transform3DLimit&&(e?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){te(this._resizeRequest),this._resizeRequest=Te(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var e=this._getMapPanePos();Math.max(Math.abs(e.x),Math.abs(e.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(e,n){for(var s=[],a,c=n==="mouseout"||n==="mouseover",m=e.target||e.srcElement,P=!1;m;){if(a=this._targets[y(m)],a&&(n==="click"||n==="preclick")&&this._draggableMoved(a)){P=!0;break}if(a&&a.listens(n,!0)&&(c&&!ys(m,e)||(s.push(a),c))||m===this._container)break;m=m.parentNode}return!s.length&&!P&&!c&&this.listens(n,!0)&&(s=[this]),s},_isClickDisabled:function(e){for(;e&&e!==this._container;){if(e._leaflet_disable_click)return!0;e=e.parentNode}},_handleDOMEvent:function(e){var n=e.target||e.srcElement;if(!(!this._loaded||n._leaflet_disable_events||e.type==="click"&&this._isClickDisabled(n))){var s=e.type;s==="mousedown"&&qs(n),this._fireDOMEvent(e,s)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(e,n,s){if(e.type==="click"){var a=u({},e);a.type="preclick",this._fireDOMEvent(a,a.type,s)}var c=this._findEventTargets(e,n);if(s){for(var m=[],P=0;P0?Math.round(e-n)/2:Math.max(0,Math.ceil(e))-Math.max(0,Math.floor(n))},_limitZoom:function(e){var n=this.getMinZoom(),s=this.getMaxZoom(),a=Le.any3d?this.options.zoomSnap:1;return a&&(e=Math.round(e/a)*a),Math.max(n,Math.min(s,e))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){ce(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(e,n){var s=this._getCenterOffset(e)._trunc();return(n&&n.animate)!==!0&&!this.getSize().contains(s)?!1:(this.panBy(s,n),!0)},_createAnimProxy:function(){var e=this._proxy=nt("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(e),this.on("zoomanim",function(n){var s=On,a=this._proxy.style[s];Nt(this._proxy,this.project(n.center,n.zoom),this.getZoomScale(n.zoom,1)),a===this._proxy.style[s]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){_t(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var e=this.getCenter(),n=this.getZoom();Nt(this._proxy,this.project(e,n),this.getZoomScale(n,1))},_catchTransitionEnd:function(e){this._animatingZoom&&e.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(e,n,s){if(this._animatingZoom)return!0;if(s=s||{},!this._zoomAnimated||s.animate===!1||this._nothingToAnimate()||Math.abs(n-this._zoom)>this.options.zoomAnimationThreshold)return!1;var a=this.getZoomScale(n),c=this._getCenterOffset(e)._divideBy(1-1/a);return s.animate!==!0&&!this.getSize().contains(c)?!1:(Te(function(){this._moveStart(!0,s.noMoveStart||!1)._animateZoom(e,n,!0)},this),!0)},_animateZoom:function(e,n,s,a){this._mapPane&&(s&&(this._animatingZoom=!0,this._animateToCenter=e,this._animateToZoom=n,je(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:e,zoom:n,noUpdate:a}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(h(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&ce(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 Ba(e,n){return new Je(e,n)}var ln=_e.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),s=this.getPosition(),a=e._controlCorners[s];return je(n,"leaflet-control"),s.indexOf("bottom")!==-1?a.insertBefore(n,a.firstChild):a.appendChild(n),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(_t(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()}}),Fi=function(e){return new ln(e)};Je.include({addControl:function(e){return e.addTo(this),this},removeControl:function(e){return e.remove(),this},_initControlPos:function(){var e=this._controlCorners={},n="leaflet-",s=this._controlContainer=nt("div",n+"control-container",this._container);function a(c,m){var P=n+c+" "+n+m;e[c+m]=nt("div",P,s)}a("top","left"),a("top","right"),a("bottom","left"),a("bottom","right")},_clearControlPos:function(){for(var e in this._controlCorners)_t(this._controlCorners[e]);_t(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var bi=ln.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(e,n,s,a){return s1,this._baseLayersList.style.display=e?"":"none"),this._separator.style.display=n&&e?"":"none",this},_onLayerChange:function(e){this._handlingClick||this._update();var n=this._getLayer(y(e.target)),s=n.overlay?e.type==="add"?"overlayadd":"overlayremove":e.type==="add"?"baselayerchange":null;s&&this._map.fire(s,n)},_createRadioElement:function(e,n){var s='",a=document.createElement("div");return a.innerHTML=s,a.firstChild},_addItem:function(e){var n=document.createElement("label"),s=this._map.hasLayer(e.layer),a;e.overlay?(a=document.createElement("input"),a.type="checkbox",a.className="leaflet-control-layers-selector",a.defaultChecked=s):a=this._createRadioElement("leaflet-base-layers_"+y(this),s),this._layerControlInputs.push(a),a.layerId=y(e.layer),He(a,"click",this._onInputClick,this);var c=document.createElement("span");c.innerHTML=" "+e.name;var m=document.createElement("span");n.appendChild(m),m.appendChild(a),m.appendChild(c);var P=e.overlay?this._overlaysList:this._baseLayersList;return P.appendChild(n),this._checkDisabledLayers(),n},_onInputClick:function(){if(!this._preventClick){var e=this._layerControlInputs,n,s,a=[],c=[];this._handlingClick=!0;for(var m=e.length-1;m>=0;m--)n=e[m],s=this._getLayer(n.layerId).layer,n.checked?a.push(s):n.checked||c.push(s);for(m=0;m=0;c--)n=e[c],s=this._getLayer(n.layerId).layer,n.disabled=s.options.minZoom!==void 0&&as.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var e=this._section;this._preventClick=!0,He(e,"click",St),this.expand();var n=this;setTimeout(function(){ft(e,"click",St),n._preventClick=!1})}}),Zo=function(e,n,s){return new bi(e,n,s)},xi=ln.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(e){var n="leaflet-control-zoom",s=nt("div",n+" leaflet-bar"),a=this.options;return this._zoomInButton=this._createButton(a.zoomInText,a.zoomInTitle,n+"-in",s,this._zoomIn),this._zoomOutButton=this._createButton(a.zoomOutText,a.zoomOutTitle,n+"-out",s,this._zoomOut),this._updateDisabled(),e.on("zoomend zoomlevelschange",this._updateDisabled,this),s},onRemove:function(e){e.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(e){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(e.shiftKey?3:1))},_createButton:function(e,n,s,a,c){var m=nt("a",s,a);return m.innerHTML=e,m.href="#",m.title=n,m.setAttribute("role","button"),m.setAttribute("aria-label",n),qn(m),He(m,"click",gn),He(m,"click",c,this),He(m,"click",this._refocusOnMap,this),m},_updateDisabled:function(){var e=this._map,n="leaflet-disabled";ce(this._zoomInButton,n),ce(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"))}});Je.mergeOptions({zoomControl:!0}),Je.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new xi,this.addControl(this.zoomControl))});var Bi=function(e){return new xi(e)},Vi=ln.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(e){var n="leaflet-control-scale",s=nt("div",n),a=this.options;return this._addScales(a,n+"-line",s),e.on(a.updateWhenIdle?"moveend":"move",this._update,this),e.whenReady(this._update,this),s},onRemove:function(e){e.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(e,n,s){e.metric&&(this._mScale=nt("div",n,s)),e.imperial&&(this._iScale=nt("div",n,s))},_update:function(){var e=this._map,n=e.getSize().y/2,s=e.distance(e.containerPointToLatLng([0,n]),e.containerPointToLatLng([this.options.maxWidth,n]));this._updateScales(s)},_updateScales:function(e){this.options.metric&&e&&this._updateMetric(e),this.options.imperial&&e&&this._updateImperial(e)},_updateMetric:function(e){var n=this._getRoundNum(e),s=n<1e3?n+" m":n/1e3+" km";this._updateScale(this._mScale,s,n/e)},_updateImperial:function(e){var n=e*3.2808399,s,a,c;n>5280?(s=n/5280,a=this._getRoundNum(s),this._updateScale(this._iScale,a+" mi",a/s)):(c=this._getRoundNum(n),this._updateScale(this._iScale,c+" ft",c/n))},_updateScale:function(e,n,s){e.style.width=Math.round(this.options.maxWidth*s)+"px",e.innerHTML=n},_getRoundNum:function(e){var n=Math.pow(10,(Math.floor(e)+"").length-1),s=e/n;return s=s>=10?10:s>=5?5:s>=3?3:s>=2?2:1,n*s}}),to=function(e){return new Vi(e)},Va='',no=ln.extend({options:{position:"bottomright",prefix:''+(Le.inlineSvg?Va+" ":"")+"Leaflet"},initialize:function(e){F(this,e),this._attributions={}},onAdd:function(e){e.attributionControl=this,this._container=nt("div","leaflet-control-attribution"),qn(this._container);for(var n in e._layers)e._layers[n].getAttribution&&this.addAttribution(e._layers[n].getAttribution());return this._update(),e.on("layeradd",this._addAttribution,this),this._container},onRemove:function(e){e.off("layeradd",this._addAttribution,this)},_addAttribution:function(e){e.layer.getAttribution&&(this.addAttribution(e.layer.getAttribution()),e.layer.once("remove",function(){this.removeAttribution(e.layer.getAttribution())},this))},setPrefix:function(e){return this.options.prefix=e,this._update(),this},addAttribution:function(e){return e?(this._attributions[e]||(this._attributions[e]=0),this._attributions[e]++,this._update(),this):this},removeAttribution:function(e){return e?(this._attributions[e]&&(this._attributions[e]--,this._update()),this):this},_update:function(){if(this._map){var e=[];for(var n in this._attributions)this._attributions[n]&&e.push(n);var s=[];this.options.prefix&&s.push(this.options.prefix),e.length&&s.push(e.join(", ")),this._container.innerHTML=s.join(' ')}}});Je.mergeOptions({attributionControl:!0}),Je.addInitHook(function(){this.options.attributionControl&&new no().addTo(this)});var Ua=function(e){return new no(e)};ln.Layers=bi,ln.Zoom=xi,ln.Scale=Vi,ln.Attribution=no,Fi.layers=Zo,Fi.zoom=Bi,Fi.scale=to,Fi.attribution=Ua;var Tt=_e.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}});Tt.addTo=function(e,n){return e.addHandler(n,this),this};var Za={Events:ae},Ho=Le.touch?"touchstart mousedown":"mousedown",$n=le.extend({options:{clickTolerance:3},initialize:function(e,n,s,a){F(this,a),this._element=e,this._dragStartTarget=n||e,this._preventOutline=s},enable:function(){this._enabled||(He(this._dragStartTarget,Ho,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&($n._dragging===this&&this.finishDrag(!0),ft(this._dragStartTarget,Ho,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(e){if(this._enabled&&(this._moved=!1,!Gs(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&&qs(this._element),Ut(),vi(),!this._moving)){this.fire("down");var n=e.touches?e.touches[0]:e,s=yi(this._element);this._startPoint=new ie(n.clientX,n.clientY),this._startPos=rn(this._element),this._parentScale=Ys(s);var a=e.type==="mousedown";He(document,a?"mousemove":"touchmove",this._onMove,this),He(document,a?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(e){if(this._enabled){if(e.touches&&e.touches.length>1){this._moved=!0;return}var n=e.touches&&e.touches.length===1?e.touches[0]:e,s=new ie(n.clientX,n.clientY)._subtract(this._startPoint);!s.x&&!s.y||Math.abs(s.x)+Math.abs(s.y)m&&(P=$,m=N);m>s&&(n[P]=1,Si(e,n,s,a,P),Si(e,n,s,P,c))}function ji(e,n){for(var s=[e[0]],a=1,c=0,m=e.length;an&&(s.push(e[a]),c=a);return cn.max.x&&(s|=2),e.yn.max.y&&(s|=8),s}function Ha(e,n){var s=n.x-e.x,a=n.y-e.y;return s*s+a*a}function qe(e,n,s,a){var c=n.x,m=n.y,P=s.x-c,$=s.y-m,N=P*P+$*$,J;return N>0&&(J=((e.x-c)*P+(e.y-m)*$)/N,J>1?(c=s.x,m=s.y):J>0&&(c+=P*J,m+=$*J)),P=e.x-c,$=e.y-m,a?P*P+$*$:new ie(c,m)}function Pt(e){return!Pe(e[0])||typeof e[0][0]!="object"&&typeof e[0][0]<"u"}function Wi(e){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Pt(e)}function xs(e,n){var s,a,c,m,P,$,N,J;if(!e||e.length===0)throw new Error("latlngs not passed");Pt(e)||(console.warn("latlngs are not flat! Only the first ring will be used"),e=e[0]);var ge=W([0,0]),Fe=et(e),Ge=Fe.getNorthWest().distanceTo(Fe.getSouthWest())*Fe.getNorthEast().distanceTo(Fe.getNorthWest());Ge<1700&&(ge=ki(e));var Gt=e.length,At=[];for(s=0;sa){N=(m-a)/c,J=[$.x-N*($.x-P.x),$.y-N*($.y-P.y)];break}var nn=n.unproject(me(J));return W([nn.lat+ge.lat,nn.lng+ge.lng])}var ja={__proto__:null,simplify:Jn,pointToSegmentDistance:Zi,closestPointOnSegment:Hi,clipSegment:Xn,_getEdgeIntersection:Qn,_getBitCode:ei,_sqClosestPointOnSegment:qe,isFlat:Pt,_flat:Wi,polylineCenter:xs},ws={project:function(e){return new ie(e.lng,e.lat)},unproject:function(e){return new Ue(e.y,e.x)},bounds:new Oe([-180,-90],[180,90])},so={R:6378137,R_MINOR:6356752314245179e-9,bounds:new Oe([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(e){var n=Math.PI/180,s=this.R,a=e.lat*n,c=this.R_MINOR/s,m=Math.sqrt(1-c*c),P=m*Math.sin(a),$=Math.tan(Math.PI/4-a/2)/Math.pow((1-P)/(1+P),m/2);return a=-s*Math.log(Math.max($,1e-10)),new ie(e.lng*n*s,a)},unproject:function(e){for(var n=180/Math.PI,s=this.R,a=this.R_MINOR/s,c=Math.sqrt(1-a*a),m=Math.exp(-e.y/s),P=Math.PI/2-2*Math.atan(m),$=0,N=.1,J;$<15&&Math.abs(N)>1e-7;$++)J=c*Math.sin(P),J=Math.pow((1-J)/(1+J),c/2),N=Math.PI/2-2*Math.atan(m*J)-P,P+=N;return new Ue(P*n,e.x*n/s)}},ks={__proto__:null,LonLat:ws,Mercator:so,SphericalMercator:vt},Ki=u({},A,{code:"EPSG:3395",projection:so,transformation:(function(){var e=.5/(Math.PI*so.R);return b(e,.5,-e,.5)})()}),Gi=u({},A,{code:"EPSG:4326",projection:ws,transformation:b(1/180,1,-1/180,.5)}),qi=u({},E,{projection:ws,transformation:b(1,0,-1,0),scale:function(e){return Math.pow(2,e)},zoom:function(e){return Math.log(e)/Math.LN2},distance:function(e,n){var s=n.lng-e.lng,a=n.lat-e.lat;return Math.sqrt(s*s+a*a)},infinite:!0});E.Earth=A,E.EPSG3395=Ki,E.EPSG3857=_,E.EPSG900913=w,E.EPSG4326=Gi,E.Simple=qi;var Ct=le.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(e){return e.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(e){return e&&e.removeLayer(this),this},getPane:function(e){return this._map.getPane(e?this.options[e]||e:this.options.pane)},addInteractiveTarget:function(e){return this._map._targets[y(e)]=this,this},removeInteractiveTarget:function(e){return delete this._map._targets[y(e)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(e){var n=e.target;if(n.hasLayer(this)){if(this._map=n,this._zoomAnimated=n._zoomAnimated,this.getEvents){var s=this.getEvents();n.on(s,this),this.once("remove",function(){n.off(s,this)},this)}this.onAdd(n),this.fire("add"),n.fire("layeradd",{layer:this})}}});Je.include({addLayer:function(e){if(!e._layerAdd)throw new Error("The provided object is not a Layer.");var n=y(e);return this._layers[n]?this:(this._layers[n]=e,e._mapToAdd=this,e.beforeAdd&&e.beforeAdd(this),this.whenReady(e._layerAdd,e),this)},removeLayer:function(e){var n=y(e);return this._layers[n]?(this._loaded&&e.onRemove(this),delete this._layers[n],this._loaded&&(this.fire("layerremove",{layer:e}),e.fire("remove")),e._map=e._mapToAdd=null,this):this},hasLayer:function(e){return y(e)in this._layers},eachLayer:function(e,n){for(var s in this._layers)e.call(n,this._layers[s]);return this},_addLayers:function(e){e=e?Pe(e)?e:[e]:[];for(var n=0,s=e.length;nthis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()=2&&n[0]instanceof Ue&&n[0].equals(n[s-1])&&n.pop(),n},_setLatLngs:function(e){Tn.prototype._setLatLngs.call(this,e),Pt(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Pt(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var e=this._renderer._bounds,n=this.options.weight,s=new ie(n,n);if(e=new Oe(e.min.subtract(s),e.max.add(s)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(e))){if(this.options.noClip){this._parts=this._rings;return}for(var a=0,c=this._rings.length,m;ae.y!=c.y>e.y&&e.x<(c.x-a.x)*(e.y-a.y)/(c.y-a.y)+a.x&&(n=!n);return n||Tn.prototype._containsPoint.call(this,e,!0)}});function q(e,n){return new f(e,n)}var k=vn.extend({initialize:function(e,n){F(this,n),this._layers={},e&&this.addData(e)},addData:function(e){var n=Pe(e)?e:e.features,s,a,c;if(n){for(s=0,a=n.length;s0&&c.push(c[0].slice()),c}function Ss(e,n){return e.feature?u({},e.feature,{geometry:n}):Yo(n)}function Yo(e){return e.type==="Feature"||e.type==="FeatureCollection"?e:{type:"Feature",properties:{},geometry:e}}var Ja={toGeoJSON:function(e){return Ss(this,{type:"Point",coordinates:Ya(this.getLatLng(),e)})}};ni.include(Ja),Ji.include(Ja),In.include(Ja),Tn.include({toGeoJSON:function(e){var n=!Pt(this._latlngs),s=qo(this._latlngs,n?1:0,!1,e);return Ss(this,{type:(n?"Multi":"")+"LineString",coordinates:s})}}),f.include({toGeoJSON:function(e){var n=!Pt(this._latlngs),s=n&&!Pt(this._latlngs[0]),a=qo(this._latlngs,s?2:n?1:0,!0,e);return n||(a=[a]),Ss(this,{type:(s?"Multi":"")+"Polygon",coordinates:a})}}),tn.include({toMultiPoint:function(e){var n=[];return this.eachLayer(function(s){n.push(s.toGeoJSON(e).geometry.coordinates)}),Ss(this,{type:"MultiPoint",coordinates:n})},toGeoJSON:function(e){var n=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(n==="MultiPoint")return this.toMultiPoint(e);var s=n==="GeometryCollection",a=[];return this.eachLayer(function(c){if(c.toGeoJSON){var m=c.toGeoJSON(e);if(s)a.push(m.geometry);else{var P=Yo(m);P.type==="FeatureCollection"?a.push.apply(a,P.features):a.push(P)}}}),s?Ss(this,{geometries:a,type:"GeometryCollection"}):{type:"FeatureCollection",features:a}}});function Yr(e,n){return new k(e,n)}var Zc=Yr,Jo=Ct.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(e,n,s){this._url=e,this._bounds=et(n),F(this,s)},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(){_t(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&&jn(this._image),this},bringToBack:function(){return this._map&&gi(this._image),this},setUrl:function(e){return this._url=e,this._image&&(this._image.src=e),this},setBounds:function(e){return this._bounds=et(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:nt("img");if(je(n,"leaflet-image-layer"),this._zoomAnimated&&je(n,"leaflet-zoom-animated"),this.options.className&&je(n,this.options.className),n.onselectstart=O,n.onmousemove=O,n.onload=h(this.fire,this,"load"),n.onerror=h(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(n.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),e){this._url=n.src;return}n.src=this._url,n.alt=this.options.alt},_animateZoom:function(e){var n=this._map.getZoomScale(e.zoom),s=this._map._latLngBoundsToNewLayerBounds(this._bounds,e.zoom,e.center).min;Nt(this._image,s,n)},_reset:function(){var e=this._image,n=new Oe(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),s=n.getSize();pt(e,n.min),e.style.width=s.x+"px",e.style.height=s.y+"px"},_updateOpacity:function(){zt(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()}}),Hc=function(e,n,s){return new Jo(e,n,s)},Jr=Jo.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:nt("video");if(je(n,"leaflet-image-layer"),this._zoomAnimated&&je(n,"leaflet-zoom-animated"),this.options.className&&je(n,this.options.className),n.onselectstart=O,n.onmousemove=O,n.onloadeddata=h(this.fire,this,"load"),e){for(var s=n.getElementsByTagName("source"),a=[],c=0;c0?a:[n.src];return}Pe(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 m=0;mc?(n.height=c+"px",je(e,m)):ce(e,m),this._containerWidth=this._container.offsetWidth},_animateZoom:function(e){var n=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center),s=this._getAnchor();pt(this._container,n.add(s))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var e=this._map,n=parseInt($i(this._container,"marginBottom"),10)||0,s=this._container.offsetHeight+n,a=this._containerWidth,c=new ie(this._containerLeft,-s-this._containerBottom);c._add(rn(this._container));var m=e.layerPointToContainerPoint(c),P=me(this.options.autoPanPadding),$=me(this.options.autoPanPaddingTopLeft||P),N=me(this.options.autoPanPaddingBottomRight||P),J=e.getSize(),ge=0,Fe=0;m.x+a+N.x>J.x&&(ge=m.x+a-J.x+N.x),m.x-ge-$.x<0&&(ge=m.x-$.x),m.y+s+N.y>J.y&&(Fe=m.y+s-J.y+N.y),m.y-Fe-$.y<0&&(Fe=m.y-$.y),(ge||Fe)&&(this.options.keepInView&&(this._autopanning=!0),e.fire("autopanstart").panBy([ge,Fe]))}},_getAnchor:function(){return me(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Kc=function(e,n){return new Xo(e,n)};Je.mergeOptions({closePopupOnClick:!0}),Je.include({openPopup:function(e,n,s){return this._initOverlay(Xo,e,n,s).openOn(this),this},closePopup:function(e){return e=arguments.length?e:this._popup,e&&e.close(),this}}),Ct.include({bindPopup:function(e,n){return this._popup=this._initOverlay(Xo,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 vn||(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)){gn(e);var n=e.layer||e.target;if(this._popup._source===n&&!(n instanceof st)){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 Qo=Dn.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(e){Dn.prototype.onAdd.call(this,e),this.setOpacity(this.options.opacity),e.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(e){Dn.prototype.onRemove.call(this,e),e.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var e=Dn.prototype.getEvents.call(this);return this.options.permanent||(e.preclick=this.close),e},_initLayout:function(){var e="leaflet-tooltip",n=e+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=nt("div",n),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+y(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(e){var n,s,a=this._map,c=this._container,m=a.latLngToContainerPoint(a.getCenter()),P=a.layerPointToContainerPoint(e),$=this.options.direction,N=c.offsetWidth,J=c.offsetHeight,ge=me(this.options.offset),Fe=this._getAnchor();$==="top"?(n=N/2,s=J):$==="bottom"?(n=N/2,s=0):$==="center"?(n=N/2,s=J/2):$==="right"?(n=0,s=J/2):$==="left"?(n=N,s=J/2):P.xthis.options.maxZoom||sa?this._retainParent(c,m,P,a):!1)},_retainChildren:function(e,n,s,a){for(var c=2*e;c<2*e+2;c++)for(var m=2*n;m<2*n+2;m++){var P=new ie(c,m);P.z=s+1;var $=this._tileCoordsToKey(P),N=this._tiles[$];if(N&&N.active){N.retain=!0;continue}else N&&N.loaded&&(N.retain=!0);s+1this.options.maxZoom||this.options.minZoom!==void 0&&c1){this._setView(e,s);return}for(var Fe=c.min.y;Fe<=c.max.y;Fe++)for(var Ge=c.min.x;Ge<=c.max.x;Ge++){var Gt=new ie(Ge,Fe);if(Gt.z=this._tileZoom,!!this._isValidTile(Gt)){var At=this._tiles[this._tileCoordsToKey(Gt)];At?At.current=!0:P.push(Gt)}}if(P.sort(function(nn,Ps){return nn.distanceTo(m)-Ps.distanceTo(m)}),P.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var _n=document.createDocumentFragment();for(Ge=0;Ges.max.x)||!n.wrapLat&&(e.ys.max.y))return!1}if(!this.options.bounds)return!0;var a=this._tileCoordsToBounds(e);return et(this.options.bounds).overlaps(a)},_keyToBounds:function(e){return this._tileCoordsToBounds(this._keyToTileCoords(e))},_tileCoordsToNwSe:function(e){var n=this._map,s=this.getTileSize(),a=e.scaleBy(s),c=a.add(s),m=n.unproject(a,e.z),P=n.unproject(c,e.z);return[m,P]},_tileCoordsToBounds:function(e){var n=this._tileCoordsToNwSe(e),s=new ut(n[0],n[1]);return this.options.noWrap||(s=this._map.wrapLatLngBounds(s)),s},_tileCoordsToKey:function(e){return e.x+":"+e.y+":"+e.z},_keyToTileCoords:function(e){var n=e.split(":"),s=new ie(+n[0],+n[1]);return s.z=+n[2],s},_removeTile:function(e){var n=this._tiles[e];n&&(_t(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=O,e.onmousemove=O,Le.ielt9&&this.options.opacity<1&&zt(e,this.options.opacity)},_addTile:function(e,n){var s=this._getTilePos(e),a=this._tileCoordsToKey(e),c=this.createTile(this._wrapCoords(e),h(this._tileReady,this,e));this._initTile(c),this.createTile.length<2&&Te(h(this._tileReady,this,e,null,c)),pt(c,s),this._tiles[a]={el:c,coords:e,current:!0},n.appendChild(c),this.fire("tileloadstart",{tile:c,coords:e})},_tileReady:function(e,n,s){n&&this.fire("tileerror",{error:n,tile:s,coords:e});var a=this._tileCoordsToKey(e);s=this._tiles[a],s&&(s.loaded=+new Date,this._map._fadeAnimated?(zt(s.el,0),te(this._fadeFrame),this._fadeFrame=Te(this._updateOpacity,this)):(s.active=!0,this._pruneTiles()),n||(je(s.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:s.el,coords:e})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Le.ielt9||!this._map._fadeAnimated?Te(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 ie(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 Oe(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 Yc(e){return new ro(e)}var Ts=ro.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&&Le.retina&&n.maxZoom>0?(n.tileSize=Math.floor(n.tileSize/2),n.zoomReverse?(n.zoomOffset--,n.minZoom=Math.min(n.maxZoom,n.minZoom+1)):(n.zoomOffset++,n.maxZoom=Math.max(n.minZoom,n.maxZoom-1)),n.minZoom=Math.max(0,n.minZoom)):n.zoomReverse?n.minZoom=Math.min(n.maxZoom,n.minZoom):n.maxZoom=Math.max(n.minZoom,n.maxZoom),typeof n.subdomains=="string"&&(n.subdomains=n.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(e,n){return this._url===e&&n===void 0&&(n=!0),this._url=e,n||this.redraw(),this},createTile:function(e,n){var s=document.createElement("img");return He(s,"load",h(this._tileOnLoad,this,n,s)),He(s,"error",h(this._tileOnError,this,n,s)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(s.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(s.referrerPolicy=this.options.referrerPolicy),s.alt="",s.src=this.getTileUrl(e),s},getTileUrl:function(e){var n={r:Le.retina?"@2x":"",s:this._getSubdomain(e),x:e.x,y:e.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var s=this._globalTileRange.max.y-e.y;this.options.tms&&(n.y=s),n["-y"]=s}return Y(this._url,u(n,this.options))},_tileOnLoad:function(e,n){Le.ielt9?setTimeout(h(e,this,null,n),0):e(null,n)},_tileOnError:function(e,n,s){var a=this.options.errorTileUrl;a&&n.getAttribute("src")!==a&&(n.src=a),e(s,n)},_onTileRemove:function(e){e.tile.onload=null},_getZoomForUrl:function(){var e=this._tileZoom,n=this.options.maxZoom,s=this.options.zoomReverse,a=this.options.zoomOffset;return s&&(e=n-e),e+a},_getSubdomain:function(e){var n=Math.abs(e.x+e.y)%this.options.subdomains.length;return this.options.subdomains[n]},_abortLoading:function(){var e,n;for(e in this._tiles)if(this._tiles[e].coords.z!==this._tileZoom&&(n=this._tiles[e].el,n.onload=O,n.onerror=O,!n.complete)){n.src=ye;var s=this._tiles[e].coords;_t(n),delete this._tiles[e],this.fire("tileabort",{tile:n,coords:s})}},_removeTile:function(e){var n=this._tiles[e];if(n)return n.el.setAttribute("src",ye),ro.prototype._removeTile.call(this,e)},_tileReady:function(e,n,s){if(!(!this._map||s&&s.getAttribute("src")===ye))return ro.prototype._tileReady.call(this,e,n,s)}});function el(e,n){return new Ts(e,n)}var tl=Ts.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(e,n){this._url=e;var s=u({},this.defaultWmsParams);for(var a in n)a in this.options||(s[a]=n[a]);n=F(this,n);var c=n.detectRetina&&Le.retina?2:1,m=this.getTileSize();s.width=m.x*c,s.height=m.y*c,this.wmsParams=s},onAdd:function(e){this._crs=this.options.crs||e.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var n=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[n]=this._crs.code,Ts.prototype.onAdd.call(this,e)},getTileUrl:function(e){var n=this._tileCoordsToNwSe(e),s=this._crs,a=Xe(s.project(n[0]),s.project(n[1])),c=a.min,m=a.max,P=(this._wmsVersion>=1.3&&this._crs===Gi?[c.y,c.x,m.y,m.x]:[c.x,c.y,m.x,m.y]).join(","),$=Ts.prototype.getTileUrl.call(this,e);return $+fe(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 Jc(e,n){return new tl(e,n)}Ts.WMS=tl,el.wms=Jc;var ii=Ct.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 s=this._map.getZoomScale(n,this._zoom),a=this._map.getSize().multiplyBy(.5+this.options.padding),c=this._map.project(this._center,n),m=a.multiplyBy(-s).add(c).subtract(this._map._getNewPixelOrigin(e,n));Le.any3d?Nt(this._container,m,s):pt(this._container,m)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var e in this._layers)this._layers[e]._reset()},_onZoomEnd:function(){for(var e in this._layers)this._layers[e]._project()},_updatePaths:function(){for(var e in this._layers)this._layers[e]._update()},_update:function(){var e=this.options.padding,n=this._map.getSize(),s=this._map.containerPointToLayerPoint(n.multiplyBy(-e)).round();this._bounds=new Oe(s,s.add(n.multiplyBy(1+e*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),nl=ii.extend({options:{tolerance:0},getEvents:function(){var e=ii.prototype.getEvents.call(this);return e.viewprereset=this._onViewPreReset,e},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){ii.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var e=this._container=document.createElement("canvas");He(e,"mousemove",this._onMouseMove,this),He(e,"click dblclick mousedown mouseup contextmenu",this._onClick,this),He(e,"mouseout",this._handleMouseOut,this),e._leaflet_disable_events=!0,this._ctx=e.getContext("2d")},_destroyContainer:function(){te(this._redrawRequest),delete this._ctx,_t(this._container),ft(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)){ii.prototype._update.call(this);var e=this._bounds,n=this._container,s=e.getSize(),a=Le.retina?2:1;pt(n,e.min),n.width=a*s.x,n.height=a*s.y,n.style.width=s.x+"px",n.style.height=s.y+"px",Le.retina&&this._ctx.scale(2,2),this._ctx.translate(-e.min.x,-e.min.y),this.fire("update")}},_reset:function(){ii.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(e){this._updateDashArray(e),this._layers[y(e)]=e;var n=e._order={layer:e,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=n),this._drawLast=n,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(e){this._requestRedraw(e)},_removePath:function(e){var n=e._order,s=n.next,a=n.prev;s?s.prev=a:this._drawLast=a,a?a.next=s:this._drawFirst=s,delete e._order,delete this._layers[y(e)],this._requestRedraw(e)},_updatePath:function(e){this._extendRedrawBounds(e),e._project(),e._update(),this._requestRedraw(e)},_updateStyle:function(e){this._updateDashArray(e),this._requestRedraw(e)},_updateDashArray:function(e){if(typeof e.options.dashArray=="string"){var n=e.options.dashArray.split(/[, ]+/),s=[],a,c;for(c=0;c')}}catch{}return function(e){return document.createElement("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}})(),Xc={_initContainer:function(){this._container=nt("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(ii.prototype._update.call(this),this.fire("update"))},_initPath:function(e){var n=e._container=lo("shape");je(n,"leaflet-vml-shape "+(this.options.className||"")),n.coordsize="1 1",e._path=lo("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;_t(n),e.removeInteractiveTarget(n),delete this._layers[y(e)]},_updateStyle:function(e){var n=e._stroke,s=e._fill,a=e.options,c=e._container;c.stroked=!!a.stroke,c.filled=!!a.fill,a.stroke?(n||(n=e._stroke=lo("stroke")),c.appendChild(n),n.weight=a.weight+"px",n.color=a.color,n.opacity=a.opacity,a.dashArray?n.dashStyle=Pe(a.dashArray)?a.dashArray.join(" "):a.dashArray.replace(/( *, *)/g," "):n.dashStyle="",n.endcap=a.lineCap.replace("butt","flat"),n.joinstyle=a.lineJoin):n&&(c.removeChild(n),e._stroke=null),a.fill?(s||(s=e._fill=lo("fill")),c.appendChild(s),s.color=a.fillColor||a.color,s.opacity=a.fillOpacity):s&&(c.removeChild(s),e._fill=null)},_updateCircle:function(e){var n=e._point.round(),s=Math.round(e._radius),a=Math.round(e._radiusY||s);this._setPath(e,e._empty()?"M0 0":"AL "+n.x+","+n.y+" "+s+","+a+" 0,"+65535*360)},_setPath:function(e,n){e._path.v=n},_bringToFront:function(e){jn(e._container)},_bringToBack:function(e){gi(e._container)}},ea=Le.vml?lo:K,uo=ii.extend({_initContainer:function(){this._container=ea("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=ea("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){_t(this._container),ft(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){ii.prototype._update.call(this);var e=this._bounds,n=e.getSize(),s=this._container;(!this._svgSize||!this._svgSize.equals(n))&&(this._svgSize=n,s.setAttribute("width",n.x),s.setAttribute("height",n.y)),pt(s,e.min),s.setAttribute("viewBox",[e.min.x,e.min.y,n.x,n.y].join(" ")),this.fire("update")}},_initPath:function(e){var n=e._path=ea("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){_t(e._path),e.removeInteractiveTarget(e._path),delete this._layers[y(e)]},_updatePath:function(e){e._project(),e._update()},_updateStyle:function(e){var n=e._path,s=e.options;n&&(s.stroke?(n.setAttribute("stroke",s.color),n.setAttribute("stroke-opacity",s.opacity),n.setAttribute("stroke-width",s.weight),n.setAttribute("stroke-linecap",s.lineCap),n.setAttribute("stroke-linejoin",s.lineJoin),s.dashArray?n.setAttribute("stroke-dasharray",s.dashArray):n.removeAttribute("stroke-dasharray"),s.dashOffset?n.setAttribute("stroke-dashoffset",s.dashOffset):n.removeAttribute("stroke-dashoffset")):n.setAttribute("stroke","none"),s.fill?(n.setAttribute("fill",s.fillColor||s.color),n.setAttribute("fill-opacity",s.fillOpacity),n.setAttribute("fill-rule",s.fillRule||"evenodd")):n.setAttribute("fill","none"))},_updatePoly:function(e,n){this._setPath(e,G(e._parts,n))},_updateCircle:function(e){var n=e._point,s=Math.max(Math.round(e._radius),1),a=Math.max(Math.round(e._radiusY),1)||s,c="a"+s+","+a+" 0 1,0 ",m=e._empty()?"M0 0":"M"+(n.x-s)+","+n.y+c+s*2+",0 "+c+-s*2+",0 ";this._setPath(e,m)},_setPath:function(e,n){e._path.setAttribute("d",n)},_bringToFront:function(e){jn(e._path)},_bringToBack:function(e){gi(e._path)}});Le.vml&&uo.include(Xc);function sl(e){return Le.svg||Le.vml?new uo(e):null}Je.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&&il(e)||sl(e)}});var ol=f.extend({initialize:function(e,n){f.prototype.initialize.call(this,this._boundsToLatLngs(e),n)},setBounds:function(e){return this.setLatLngs(this._boundsToLatLngs(e))},_boundsToLatLngs:function(e){return e=et(e),[e.getSouthWest(),e.getNorthWest(),e.getNorthEast(),e.getSouthEast()]}});function Qc(e,n){return new ol(e,n)}uo.create=ea,uo.pointsToPath=G,k.geometryToLayer=Ke,k.coordsToLatLng=qa,k.coordsToLatLngs=Go,k.latLngToCoords=Ya,k.latLngsToCoords=qo,k.getFeature=Ss,k.asFeature=Yo,Je.mergeOptions({boxZoom:!0});var al=Tt.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(){He(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){ft(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){_t(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(),vi(),Ut(),this._startPoint=this._map.mouseEventToContainerPoint(e),He(document,{contextmenu:gn,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(e){this._moved||(this._moved=!0,this._box=nt("div","leaflet-zoom-box",this._container),je(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(e);var n=new Oe(this._point,this._startPoint),s=n.getSize();pt(this._box,n.min),this._box.style.width=s.x+"px",this._box.style.height=s.y+"px"},_finish:function(){this._moved&&(_t(this._box),ce(this._container,"leaflet-crosshair")),Gn(),_i(),ft(document,{contextmenu:gn,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 ut(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())}});Je.addInitHook("addHandler","boxZoom",al),Je.mergeOptions({doubleClickZoom:!0});var rl=Tt.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(e){var n=this._map,s=n.getZoom(),a=n.options.zoomDelta,c=e.originalEvent.shiftKey?s-a:s+a;n.options.doubleClickZoom==="center"?n.setZoom(c):n.setZoomAround(e.containerPoint,c)}});Je.addInitHook("addHandler","doubleClickZoom",rl),Je.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var ll=Tt.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(){ce(this._map._container,"leaflet-grab"),ce(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=et(this._map.options.maxBounds);this._offsetLimit=Xe(this._map.latLngToContainerPoint(n.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(n.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;e.fire("movestart").fire("dragstart"),e.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(e){if(this._map.options.inertia){var n=this._lastTime=+new Date,s=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(s),this._times.push(n),this._prunePositions(n)}this._map.fire("move",e).fire("drag",e)},_prunePositions:function(e){for(;this._positions.length>1&&e-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var e=this._map.getSize().divideBy(2),n=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=n.subtract(e).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(e,n){return e-(e-n)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var e=this._draggable._newPos.subtract(this._draggable._startPos),n=this._offsetLimit;e.xn.max.x&&(e.x=this._viscousLimit(e.x,n.max.x)),e.y>n.max.y&&(e.y=this._viscousLimit(e.y,n.max.y)),this._draggable._newPos=this._draggable._startPos.add(e)}},_onPreDragWrap:function(){var e=this._worldWidth,n=Math.round(e/2),s=this._initialWorldOffset,a=this._draggable._newPos.x,c=(a-n+s)%e+n-s,m=(a+n+s)%e-n-s,P=Math.abs(c+s)0?m:-m))-n;this._delta=0,this._startTime=null,P&&(e.options.scrollWheelZoom==="center"?e.setZoom(n+P):e.setZoomAround(this._lastMousePos,n+P))}});Je.addInitHook("addHandler","scrollWheelZoom",cl);var ed=600;Je.mergeOptions({tapHold:Le.touchNative&&Le.safari&&Le.mobile,tapTolerance:15});var dl=Tt.extend({addHooks:function(){He(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){ft(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 ie(n.clientX,n.clientY),this._holdTimeout=setTimeout(h(function(){this._cancel(),this._isTapValid()&&(He(document,"touchend",St),He(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",n))},this),ed),He(document,"touchend touchcancel contextmenu",this._cancel,this),He(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function e(){ft(document,"touchend",St),ft(document,"touchend touchcancel",e)},_cancel:function(){clearTimeout(this._holdTimeout),ft(document,"touchend touchcancel contextmenu",this._cancel,this),ft(document,"touchmove",this._onMove,this)},_onMove:function(e){var n=e.touches[0];this._newPos=new ie(n.clientX,n.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(e,n){var s=new MouseEvent(e,{bubbles:!0,cancelable:!0,view:window,screenX:n.screenX,screenY:n.screenY,clientX:n.clientX,clientY:n.clientY});s._simulated=!0,n.target.dispatchEvent(s)}});Je.addInitHook("addHandler","tapHold",dl),Je.mergeOptions({touchZoom:Le.touch,bounceAtZoomLimits:!0});var fl=Tt.extend({addHooks:function(){je(this._map._container,"leaflet-touch-zoom"),He(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){ce(this._map._container,"leaflet-touch-zoom"),ft(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(e){var n=this._map;if(!(!e.touches||e.touches.length!==2||n._animatingZoom||this._zooming)){var s=n.mouseEventToContainerPoint(e.touches[0]),a=n.mouseEventToContainerPoint(e.touches[1]);this._centerPoint=n.getSize()._divideBy(2),this._startLatLng=n.containerPointToLatLng(this._centerPoint),n.options.touchZoom!=="center"&&(this._pinchStartLatLng=n.containerPointToLatLng(s.add(a)._divideBy(2))),this._startDist=s.distanceTo(a),this._startZoom=n.getZoom(),this._moved=!1,this._zooming=!0,n._stop(),He(document,"touchmove",this._onTouchMove,this),He(document,"touchend touchcancel",this._onTouchEnd,this),St(e)}},_onTouchMove:function(e){if(!(!e.touches||e.touches.length!==2||!this._zooming)){var n=this._map,s=n.mouseEventToContainerPoint(e.touches[0]),a=n.mouseEventToContainerPoint(e.touches[1]),c=s.distanceTo(a)/this._startDist;if(this._zoom=n.getScaleZoom(c,this._startZoom),!n.options.bounceAtZoomLimits&&(this._zoomn.getMaxZoom()&&c>1)&&(this._zoom=n._limitZoom(this._zoom)),n.options.touchZoom==="center"){if(this._center=this._startLatLng,c===1)return}else{var m=s._add(a)._divideBy(2)._subtract(this._centerPoint);if(c===1&&m.x===0&&m.y===0)return;this._center=n.unproject(n.project(this._pinchStartLatLng,this._zoom).subtract(m),this._zoom)}this._moved||(n._moveStart(!0,!1),this._moved=!0),te(this._animRequest);var P=h(n._move,n,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=Te(P,this,!0),St(e)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,te(this._animRequest),ft(document,"touchmove",this._onTouchMove,this),ft(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))}});Je.addInitHook("addHandler","touchZoom",fl),Je.BoxZoom=al,Je.DoubleClickZoom=rl,Je.Drag=ll,Je.Keyboard=ul,Je.ScrollWheelZoom=cl,Je.TapHold=dl,Je.TouchZoom=fl,o.Bounds=Oe,o.Browser=Le,o.CRS=E,o.Canvas=nl,o.Circle=Ji,o.CircleMarker=In,o.Class=_e,o.Control=ln,o.DivIcon=Qr,o.DivOverlay=Dn,o.DomEvent=Fa,o.DomUtil=Ra,o.Draggable=$n,o.Evented=le,o.FeatureGroup=vn,o.GeoJSON=k,o.GridLayer=ro,o.Handler=Tt,o.Icon=ti,o.ImageOverlay=Jo,o.LatLng=Ue,o.LatLngBounds=ut,o.Layer=Ct,o.LayerGroup=tn,o.LineUtil=ja,o.Map=Je,o.Marker=ni,o.Mixin=Za,o.Path=st,o.Point=ie,o.PolyUtil=Ot,o.Polygon=f,o.Polyline=Tn,o.Popup=Xo,o.PosAnimation=bs,o.Projection=ks,o.Rectangle=ol,o.Renderer=ii,o.SVG=uo,o.SVGOverlay=Xr,o.TileLayer=Ts,o.Tooltip=Qo,o.Transformation=Lt,o.Util=de,o.VideoOverlay=Jr,o.bind=h,o.bounds=Xe,o.canvas=il,o.circle=Ga,o.circleMarker=ao,o.control=Fi,o.divIcon=qc,o.extend=u,o.featureGroup=Wa,o.geoJSON=Yr,o.geoJson=Zc,o.gridLayer=Yc,o.icon=Wo,o.imageOverlay=Hc,o.latLng=W,o.latLngBounds=et,o.layerGroup=oo,o.map=Ba,o.marker=Ka,o.point=me,o.polygon=q,o.polyline=x,o.popup=Kc,o.rectangle=Qc,o.setOptions=F,o.stamp=y,o.svg=sl,o.svgOverlay=Wc,o.tileLayer=el,o.tooltip=Gc,o.transformation=b,o.version=l,o.videoOverlay=jc;var td=window.L;o.noConflict=function(){return window.L=td,this},window.L=o}))})(_o,_o.exports)),_o.exports}var im=nm();const Pi=em(im),hu={__name:"DeviceMap",props:{position:{type:Object,default:null},trail:{type:Array,default:()=>[]},aircraft:{type:Array,default:()=>[]}},setup(t){const i=t,o=j(null);let l,u,d,h;const v=new Map;function y(H,F){const fe=getComputedStyle(document.documentElement).getPropertyValue("--accent").trim()||"#3D7BF0",ve=F?"#8a94a6":fe,Y=typeof H=="number"?H:0;return Pi.divIcon({className:"plane-marker",iconSize:[22,22],iconAnchor:[11,11],html:``})}function C(H){const fe=[`${H.callsign||H.icao24||"aircraft"}`];return H.country&&fe.push(H.country),typeof H.altitude=="number"&&fe.push(`${Math.round(H.altitude)} m`),typeof H.velocity=="number"&&fe.push(`${Math.round(H.velocity*3.6)} km/h`),H.onGround&&fe.push("on ground"),fe.join(" · ")}function T(){if(!l)return;h||(h=Pi.layerGroup().addTo(l));const H=new Set;for(const F of i.aircraft){if(typeof F.lat!="number"||typeof F.lng!="number")continue;H.add(F.icao24);const fe=[F.lat,F.lng];let ve=v.get(F.icao24);ve?(ve.setLatLng(fe),ve.setIcon(y(F.heading,F.onGround)),ve.setTooltipContent(C(F))):(ve=Pi.marker(fe,{icon:y(F.heading,F.onGround)}).bindTooltip(C(F)),ve.addTo(h),v.set(F.icao24,ve))}for(const[F,fe]of v)H.has(F)||(h.removeLayer(fe),v.delete(F))}function O(){if(!l)return;const H=i.position;if(H&&(H.lat||H.lng)){const F=[H.lat,H.lng];u?u.setLatLng(F):(u=Pi.marker(F).addTo(l),l.setView(F,17))}if(d&&d.remove(),i.trail.length){const F=getComputedStyle(document.documentElement).getPropertyValue("--accent").trim()||"#3D7BF0";d=Pi.polyline(i.trail,{color:F,weight:3}).addTo(l)}}fi(()=>{l=Pi.map(o.value,{zoomControl:!0}).setView([20,0],2),Pi.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:"© OpenStreetMap",maxZoom:19}).addTo(l),setTimeout(()=>l.invalidateSize(),60),O(),T(),(!i.position||!i.position.lat&&!i.position.lng)&&i.aircraft.length&&V()});let B=!1;function V(){if(B||!l||!i.aircraft.length)return;const H=i.aircraft.filter(F=>typeof F.lat=="number"&&typeof F.lng=="number").map(F=>[F.lat,F.lng]);H.length&&(l.fitBounds(Pi.latLngBounds(H).pad(.2)),B=!0)}return Fs(()=>{l&&l.remove(),l=null}),$t(()=>i.position,O,{deep:!0}),$t(()=>i.trail,O,{deep:!0}),$t(()=>i.aircraft,()=>{T(),(!i.position||!i.position.lat&&!i.position.lng)&&V()},{deep:!0}),(H,F)=>(p(),g("div",{ref_key:"el",ref:o,class:"h-[320px] w-full rounded-lg"},null,512))}},sm=["width","height","stroke-width"],om=["d"],X={__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,d)=>d?"M"+u:u);return(u,d)=>(p(),g("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),g(re,null,Be($e(l),(h,v)=>(p(),g("path",{key:v,d:h},null,8,om))),128))],8,sm))}},am=["aria-checked","disabled"],sn={__name:"Toggle",props:{modelValue:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:i}){const o=i;return(l,u)=>(p(),g("button",{type:"button",role:"switch","aria-checked":t.modelValue,disabled:t.disabled,class:Ee(["relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition disabled:opacity-40",t.modelValue?"bg-accent":"bg-surface-2 border border-line-strong"]),onClick:u[0]||(u[0]=d=>o("update:modelValue",!t.modelValue))},[r("span",{class:Ee(["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,am))}},rm={class:"inline-flex rounded-[10px] border border-line bg-surface-2 p-0.5"},lm=["onClick"],bn={__name:"Segmented",props:{modelValue:{type:[String,Number],default:""},options:{type:Array,default:()=>[]}},emits:["update:modelValue"],setup(t,{emit:i}){const o=i;return(l,u)=>(p(),g("div",rm,[(p(!0),g(re,null,Be(t.options,d=>(p(),g("button",{key:d.value,type:"button",class:Ee(["inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-[13px] font-semibold transition",t.modelValue===d.value?"bg-surface-1 text-ink shadow-xs":"text-ink-secondary hover:text-ink"]),onClick:h=>o("update:modelValue",d.value)},[d.icon?(p(),at(X,{key:0,name:d.icon,size:15},null,8,["name"])):R("",!0),D(" "+S(d.label),1)],10,lm))),128))]))}},um={class:"text-sm font-semibold text-ink"},cm={key:0,class:"mt-0.5 text-xs text-ink-muted"},Me={__name:"Row",props:{title:{type:String,default:""},desc:{type:String,default:""},keywords:{type:String,default:""},block:{type:Boolean,default:!1}},setup(t){const i=t,o=wo("settingsSearch",{value:""}),l=ke(()=>{const u=(o.value||"").trim().toLowerCase();return u?`${i.title} ${i.desc} ${i.keywords}`.toLowerCase().includes(u):!0});return(u,d)=>l.value?(p(),g("div",{key:0,class:Ee(["border-b border-line py-4 last:border-0",t.block?"":"flex items-center justify-between gap-6"])},[r("div",{class:Ee(t.block?"mb-3":"min-w-0")},[r("div",um,S(t.title),1),t.desc?(p(),g("div",cm,S(t.desc),1)):R("",!0)],2),r("div",{class:Ee(t.block?"":"shrink-0")},[xf(u.$slots,"default")],2)],2)):R("",!0)}},dm=(t,i)=>{const o=t.__vccOpts||t;for(const[l,u]of i)o[l]=u;return o},fm={class:"mx-auto max-w-[1280px] p-7"},hm={class:"mb-5 flex flex-wrap items-end justify-between gap-4"},pm={class:"flex h-10 w-full max-w-[280px] items-center gap-2 rounded border border-line-strong bg-surface-1 px-3"},mm={class:"grid grid-cols-[210px_1fr] gap-6 max-[760px]:grid-cols-1"},gm={class:"flex flex-col gap-0.5 max-[760px]:flex-row max-[760px]:overflow-x-auto"},vm=["onClick"],_m={class:"whitespace-nowrap"},ym={class:"min-w-0"},bm={key:0,class:"panel p-10 text-center text-sm text-ink-muted"},xm={key:0,class:"eyebrow mb-2 mt-5 first:mt-0 flex items-center gap-2"},wm={key:1,class:"panel mb-5 p-5"},km={class:"flex items-center gap-1"},Sm={class:"flex items-center gap-2"},Tm={class:"font-mono text-sm text-ink"},Pm={class:"inline-flex items-center gap-1 rounded-full bg-amber-soft px-2 py-0.5 text-[11px] font-semibold text-amber-fg"},Cm={key:0,class:"mt-2 text-xs text-ink-muted"},Lm={class:"grid max-w-[420px] gap-2"},Mm={class:"flex items-center gap-3"},Em={key:2,class:"panel mb-5 p-5"},Om=["value"],zm=["value"],Am=["value"],$m={class:"font-mono text-sm text-ink"},Im={key:3},Dm={key:0,class:"mb-5 flex items-center gap-1 overflow-x-auto border-b border-line"},Nm=["onClick"],Rm={key:1,class:"panel mb-5 p-5"},Fm={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},Bm={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},Vm={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},Um={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"},Zm={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},Hm={key:0},jm={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},Wm={class:"font-semibold text-ink-secondary"},Km={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},Gm={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"},qm={class:"flex items-center justify-between gap-3"},Ym={class:"flex items-center gap-2 text-sm font-semibold text-ink"},Jm={key:0,class:"text-[11px] text-ink-muted"},Xm={class:"mt-2 flex items-baseline gap-1.5"},Qm={class:"font-mono text-2xl font-semibold text-ink"},eg={class:"text-sm text-ink-muted"},tg={class:"mt-2 h-2 w-full overflow-hidden rounded-full bg-line"},ng={class:"mt-2 text-xs text-ink-muted"},ig={class:"mt-2 text-sm text-ink"},sg={class:"font-semibold"},og={class:"mt-1 text-xs text-ink-muted"},ag={key:1,class:"mt-2 text-xs text-ink-muted"},rg={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},lg={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"},ug={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},cg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},dg={key:1,class:"flex flex-col items-end gap-2"},fg=["label"],hg=["value"],pg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},mg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},gg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},vg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},_g={key:8,class:"border-b border-line py-3 text-xs text-amber-fg"},yg={class:"mt-4 flex flex-wrap items-center gap-3"},bg=["disabled"],xg=["disabled"],wg={key:2,class:"text-xs text-danger-fg"},kg={class:"panel mb-5 p-5"},Sg={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},Tg={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},Pg={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},Cg={key:1,class:"mb-4 flex flex-col gap-2 border-b border-line pb-4 sm:flex-row sm:items-center sm:justify-between"},Lg={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},Mg={key:0},Eg={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},Og={class:"font-semibold text-ink-secondary"},zg={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},Ag={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"},Ig={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Dg={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"},Ng={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Rg={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"},Fg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Bg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Vg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Ug={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Zg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Hg={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"},jg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Wg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Kg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Gg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},qg={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},Yg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},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={class:"mt-4 flex flex-wrap items-center gap-3"},ev=["disabled"],tv=["disabled"],nv={key:2,class:"text-xs text-danger-fg"},iv={key:3,class:"text-[11px] text-ink-muted"},sv={class:"panel mb-5 p-5"},ov={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},av={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},rv={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"},uv={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},cv={key:0},dv={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},fv={class:"font-semibold text-ink-secondary"},hv={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},pv={key:0,class:"inline-flex items-center gap-2 break-all font-mono text-sm text-ink"},mv={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"},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"},_v={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"},bv={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"},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"},Sv={class:"mt-4 flex flex-wrap items-center gap-3"},Tv=["disabled"],Pv=["disabled"],Cv={key:2,class:"text-xs text-danger-fg"},Lv={key:3,class:"text-[11px] text-ink-muted"},Mv={key:3,class:"panel mb-5 p-5"},Ev={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},Ov={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},zv={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 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},$v={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"},Iv={key:5,class:"border-b border-line py-3 text-xs text-amber-fg"},Dv={key:0},Nv={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},Rv={class:"font-semibold text-ink-secondary"},Fv={key:7,class:"border-b border-line py-3 text-xs text-ink-muted"},Bv={class:"flex w-full flex-col gap-2"},Vv={class:"break-all 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"},Zv={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"},Hv={key:0,class:"text-xs text-ink-muted"},jv={key:1,class:"border-b border-line py-3 text-xs text-ink-muted"},Wv={key:0,class:"inline-flex items-center gap-2 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={class:"mt-4 flex flex-wrap items-center gap-3"},qv=["disabled"],Yv=["disabled"],Jv={key:2,class:"text-xs text-danger-fg"},Xv={key:3,class:"text-[11px] text-ink-muted"},Qv={key:4,class:"panel mb-5 p-5"},e_={class:"flex items-center gap-4"},t_=["src"],n_={key:1,class:"grid h-16 w-16 place-items-center rounded-full bg-[var(--navy-800)] text-lg font-bold text-white"},i_={class:"flex gap-2"},s_={class:"btn-ghost cursor-pointer"},o_={class:"mt-1 text-right text-[11px] text-ink-muted"},a_={key:5,class:"panel mb-5 p-5"},r_={class:"flex items-center gap-3"},l_={key:0,class:"mt-4 rounded-lg border border-line bg-surface-2 p-4"},u_={class:"flex flex-wrap items-center gap-4"},c_={class:"min-w-0"},d_={class:"mt-1 select-all font-mono text-sm font-bold text-ink"},f_={class:"mt-3 flex items-center gap-2"},h_={key:0,class:"mt-2 text-xs text-danger-fg"},p_={key:1,class:"mt-4 rounded-lg border border-line bg-surface-2 p-4"},m_={class:"mt-2 grid grid-cols-2 gap-1 font-mono text-xs text-ink-secondary sm:grid-cols-4"},g_={class:"rounded-lg border border-line bg-surface-2 p-3"},v_={class:"flex items-center gap-3"},__={class:"grid h-9 w-9 place-items-center rounded-full bg-accent-soft text-accent-soft-fg"},y_={class:"min-w-0 flex-1"},b_={class:"text-sm font-semibold text-ink"},x_={class:"font-mono text-[11px] text-ink-muted"},w_={key:6,class:"mb-5"},k_={key:0,class:"panel mb-5 p-5"},S_={class:"grid max-w-[520px] gap-2"},T_={class:"flex flex-wrap gap-2"},P_=["disabled","title"],C_=["value"],L_=["value"],M_={class:"flex items-center gap-2 py-1 text-sm text-ink-secondary"},E_={class:"flex items-center gap-3"},O_=["disabled"],z_={key:0,class:"text-xs text-danger-fg"},A_={key:1,class:"text-xs text-ink-muted"},$_={key:1,class:"panel mb-5 p-5"},I_={class:"grid max-w-[520px] gap-2"},D_={class:"flex flex-wrap gap-2"},N_=["value"],R_=["value"],F_={key:1,class:"text-xs text-ink-muted"},B_={class:"font-semibold text-ink-secondary"},V_={class:"flex items-center gap-3"},U_=["disabled"],Z_={key:0,class:"text-xs text-danger-fg"},H_={class:"panel overflow-hidden p-0"},j_={class:"flex items-center justify-between px-5 py-4"},W_=["disabled"],K_={key:0,class:"px-5 pb-5 text-sm text-danger-fg"},G_={key:1,class:"px-5 pb-8 text-sm text-ink-muted"},q_={key:2,class:"overflow-x-auto"},Y_={class:"w-full border-collapse text-sm"},J_={class:"text-left"},X_={class:"px-5 py-3"},Q_={class:"text-ink"},ey={key:0,class:"ml-1.5 text-[11px] text-ink-muted"},ty={class:"px-5 py-3"},ny={class:"px-5 py-3"},iy={class:"px-5 py-3"},sy={class:"px-5 py-3 text-right"},oy=["onClick"],ay={key:1,class:"inline-flex items-center gap-1.5"},ry=["onClick"],ly=["onClick"],uy={key:7,class:"mb-5"},cy={key:0,class:"panel mb-5 p-5"},dy={class:"grid max-w-[520px] gap-2"},fy={class:"flex items-center gap-3"},hy={key:0,class:"text-xs text-danger-fg"},py={key:1,class:"panel mb-5 p-5"},my={class:"grid max-w-[520px] gap-2"},gy={class:"flex items-center gap-3"},vy=["disabled"],_y={key:0,class:"text-xs text-danger-fg"},yy={class:"panel overflow-hidden p-0"},by={key:0,class:"px-5 pb-8 text-sm text-ink-muted"},xy={key:1,class:"overflow-x-auto"},wy={class:"w-full border-collapse text-sm"},ky={class:"text-left"},Sy={class:"px-5 py-3"},Ty={class:"inline-flex items-center gap-2 text-ink"},Py={class:"px-5 py-3 text-ink-secondary"},Cy={class:"px-5 py-3 text-right"},Ly=["onClick"],My={key:1,class:"inline-flex items-center gap-1.5"},Ey=["onClick"],Oy=["disabled","title","onClick"],zy={key:8,class:"mb-5"},Ay={class:"panel mb-5 p-5"},$y={class:"btn-ghost cursor-pointer"},Iy={key:0,class:"mt-2 text-xs text-ink-muted"},Dy={class:"rounded-lg border p-5",style:{"border-color":"color-mix(in srgb, var(--danger) 35%, transparent)",background:"var(--danger-soft)"}},Ny={class:"flex items-center gap-2 text-danger-fg"},Ry={class:"mt-4 rounded-lg border border-line bg-surface-1 p-4"},Fy={class:"mt-3 flex items-start gap-2 text-sm text-ink-secondary"},By={class:"mt-3"},Vy={class:"eyebrow mb-1 block"},Uy={class:"text-ink"},Zy=["placeholder"],Hy={class:"mt-4 flex flex-wrap items-center gap-3"},jy=["disabled"],Wy=["disabled"],Ky={key:2,class:"text-xs text-ink-muted"},Gy={key:0,class:"mt-3 rounded border border-line bg-surface-2 px-3 py-2 text-xs text-ink-secondary"},qy={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"},pu="pv.opensky.health",mu="pv.filetransfer.health",gu="pv.webdav.health",vu="pv.localstorage.health",Yy={__name:"Settings",props:{email:{type:String,default:""},role:{type:String,default:"user"},organization:{type:String,default:""},organizationName:{type:String,default:""}},emits:["logout"],setup(t,{emit:i}){const o=t,l=i,u=ke(()=>o.role==="superadmin"),d=ke(()=>o.role==="admin"||o.role==="superadmin");function h(x){return x==="superadmin"?"Superadmin":x==="admin"?"Admin":"User"}function v(x){return x==="superadmin"||x==="admin"?"shield":"user"}function y(x){return x==="superadmin"||x==="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=ke(()=>{const x=[{id:"account",label:"Account",icon:"user",kw:"name username email password verification login credentials role"},{id:"appearance",label:"Appearance",icon:"sliders",kw:"theme light dark system language region font size accessibility date time format motion"},{id:"integrations",label:"Integrations",icon:"radio",kw:"opensky flights adsb aircraft plugin oauth credentials bounding box plan connection ftp sftp ftps file transfer server host upload download local storage folder drive isolated private read only webdav nextcloud owncloud dav url https"},{id:"profile",label:"Profile",icon:"image",kw:"avatar photo display name bio public"},{id:"security",label:"Privacy & Security",icon:"shield",kw:"two factor authentication 2fa sessions devices logout security privacy"}];return d.value&&x.push({id:"team",label:"User management",icon:"users",kw:"users team members add remove create delete role admin permissions rights organization"}),u.value&&x.push({id:"organizations",label:"Organizations",icon:"grid",kw:"organization org tenant company create rename delete members"}),x.push({id:"advanced",label:"Advanced",icon:"alertTriangle",kw:"export import data delete account danger zone",danger:!0}),x}),O=j("account"),B=j("");Gu("settingsSearch",B);const V=ke(()=>B.value.trim().length>0),H=ke(()=>B.value.trim().toLowerCase());function F(x){return H.value?(x.label+" "+x.kw).toLowerCase().includes(H.value)||ve(x.id):!0}const fe={account:["full name","username","email address verification verify","password change current new"],appearance:["theme light dark system","language","region","font size accessibility","reduce motion","date format","time format clock"],integrations:["opensky live flights","enable plugin","oauth client id secret","plan credits","bounding box","test connection","file transfer ftp sftp ftps","server host port username password","private key passphrase","base path directory","local storage folder drive","private isolated folder","read only access mode","webdav nextcloud owncloud dav","server url username password tls","base path directory folder"],profile:["profile photo avatar","display name","bio about","show email public"],security:["two factor authentication","active sessions devices","sign out"],team:["add user create account","members list role admin remove delete","organization org assign"],organizations:["add organization create","rename organization","delete organization members"],advanced:["export data download","import data upload","delete account permanent danger"]};function ve(x){return H.value?(fe[x]||[]).some(f=>f.includes(H.value)):!0}const Y=ke(()=>V.value?T.value.filter(F):T.value.filter(x=>x.id===O.value)),Pe=ke({get:()=>rs.value,set:x=>xa(x)}),he=[{value:"light",label:"Light",icon:"sun"},{value:"dark",label:"Dark",icon:"moon"},{value:"system",label:"System",icon:"monitor"}],ye=[{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","日本語"]],Ve=[["US","United States"],["GB","United Kingdom"],["EU","European Union"],["CA","Canada"],["AU","Australia"],["JP","Japan"]],pe=[["MDY","MM/DD/YYYY"],["DMY","DD/MM/YYYY"],["YMD","YYYY/MM/DD"],["ISO","YYYY-MM-DD"]],ze=j(Date.now());let Te=null;const te=ke(()=>cu(ze.value)),de=bt({loaded:!1,available:!1,orgEnabled:!0,allowAnonymous:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),_e=j("user"),be=bt({clientId:"",clientSecret:"",plan:"",bbox:""}),ae=j(""),le=j(!1),ie=j(!1),rt=j(null),me=j(null),Oe=ke(()=>rt.value&&rt.value.credits||null),Xe=ke(()=>{const x=Oe.value;return!x||!x.daily||x.remaining==null?null:Math.max(0,Math.min(100,Math.round(x.remaining/x.daily*100)))}),ut=ke(()=>{const x=Xe.value;return x==null?"bg-accent":x<=10?"bg-danger":x<=30?"bg-amber":"bg-success"});function et(x){return typeof x=="number"?x.toLocaleString():x}function Ue(){if(!me.value)return"";const x=Math.max(0,Math.round((Date.now()-me.value)/1e3));if(x<60)return"just now";const f=Math.round(x/60);if(f<60)return`${f} min ago`;const q=Math.round(f/60);return q<24?`${q} h ago`:`${Math.round(q/24)} d ago`}function W(){try{rt.value&&localStorage.setItem(pu,JSON.stringify({health:rt.value,ts:me.value}))}catch{}}function E(){try{const x=localStorage.getItem(pu);if(!x)return;const f=JSON.parse(x);f&&f.health&&(rt.value=f.health,me.value=f.ts||null)}catch{}}const A=[{value:"",label:"Not set"},{value:"anonymous",label:"Anonymous"},{value:"standard",label:"Standard"},{value:"contributor",label:"Contributor"}],it=[{value:"user",label:"My settings",icon:"user"},{value:"org",label:"Organization",icon:"users"}],vt=[{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:"Countries",options:[{value:"49,14.1,54.9,24.2",label:"Poland"},{value:"50.5,3.2,53.7,7.3",label:"Netherlands"},{value:"47.2,5.8,55.1,15.1",label:"Germany"},{value:"41.3,-5.2,51.1,9.6",label:"France"},{value:"49.9,-8.7,59,1.8",label:"United Kingdom"},{value:"35.9,-9.6,43.8,3.4",label:"Spain"},{value:"36.6,6.6,47.1,18.6",label:"Italy"},{value:"24,-125,49.5,-66.5",label:"United States"}]}],Lt=vt.flatMap(x=>x.options);function b(x){const f=String(x||"").split(",").map(k=>k.trim());if(f.length!==4)return"";const q=f.map(Number);return q.some(k=>Number.isNaN(k))?"":q.join(",")}function _(x){const f=b(x),q=f&&Lt.find(k=>b(k.value)===f);return q?q.label:""}const w=j(!1),K=ke({get(){if(w.value)return"__custom__";const x=b(be.bbox),f=x&&Lt.find(q=>b(q.value)===x);return f?f.value:"__custom__"},set(x){if(x==="__custom__"){w.value=!0;return}w.value=!1,be.bbox=x}}),G=ke(()=>K.value==="__custom__"),Z=ke(()=>de.isSuperadmin),ne=ke(()=>de.isSuperadmin?"user":_e.value),se=ke(()=>de.scopes[ne.value]||{editableLayer:"user",fields:{}}),Q=ke(()=>ne.value==="org");function U(x){return se.value.fields[x]||{effective:"",own:"",source:"unset",locked:!1}}function Se(x){return Z.value||U(x).locked}function I(x){const f=U(x).source;return f==="global"?"Set by administrator":f==="org"?"Set by your organization":""}function M(){be.clientId=U("clientId").own||"",be.clientSecret=U("clientSecret").own||"",be.plan=U("plan").own||"",be.bbox=U("bbox").own||"",w.value=!1}function ee(x){de.available=!!x.available,de.orgEnabled=x.orgEnabled!==!1,de.allowAnonymous=!!x.allowAnonymous,de.enabled=!!x.enabled,de.canEditOrg=!!x.canEditOrg,de.isSuperadmin=!!x.isSuperadmin,de.scopes=x.scopes||{},_e.value==="org"&&!de.canEditOrg&&(_e.value="user"),M(),de.loaded=!0}$t(_e,()=>{ae.value="",M()});async function Re(){E();const{ok:x,body:f}=await up();x&&ee(f)}async function Ze(x){const f=Q.value;f?de.orgEnabled=x:de.enabled=x;const{ok:q,body:k}=await au(f?{scope:"org",enabled:x}:{scope:"user",enabled:x});q?(ee(k),Qe(f?x?"OpenSky enabled for your organization.":"OpenSky disabled for your organization.":x?"OpenSky enabled.":"OpenSky disabled.")):(f?de.orgEnabled=!x:de.enabled=!x,Qe(k.error||"Could not update."))}async function Ye(){ae.value="",le.value=!0;const x={};for(const Ke of["clientId","clientSecret","plan","bbox"])Se(Ke)||(x[Ke]=be[Ke]);const f={scope:ne.value,config:x};Q.value||(f.enabled=de.enabled);const{ok:q,body:k}=await au(f);if(le.value=!1,!q){ae.value=k.error||"Could not save settings.";return}ee(k),Qe(Q.value?"Organization OpenSky settings saved.":"OpenSky settings saved.")}async function ht(){ie.value=!0,rt.value=null;const{ok:x,body:f}=await cp();ie.value=!1,rt.value=x&&f.health?f.health:{status:"down",detail:f.error||"Probe failed."},me.value=Date.now(),W()}function ue(x){return x==="ok"?C.success:x==="degraded"?C.warning:C.danger}const Ae=bt({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),wt=j("user"),cn=["protocol","host","port","username","password","privateKey","keyPassphrase","hostKeyFingerprint","insecureSkipVerify","basePath"],tt=bt(Object.fromEntries(cn.map(x=>[x,""]))),kt=j(""),Dt=j(!1),on=j(!1),Qt=j(null),pi=j(null),Bs=[{value:"sftp",label:"SFTP"},{value:"ftps",label:"FTPS"},{value:"ftp",label:"FTP"}],No=[{value:"false",label:"Verify certificate"},{value:"true",label:"Skip verification"}],ls=ke(()=>Ae.isSuperadmin),Vs=ke(()=>Ae.isSuperadmin?"user":wt.value),$a=ke(()=>Ae.scopes[Vs.value]||{editableLayer:"user",fields:{}}),dn=ke(()=>Vs.value==="org"),us=ke(()=>(en("protocol")?Ft("protocol").effective:tt.protocol)||"sftp");function Ft(x){return $a.value.fields[x]||{effective:"",own:"",source:"unset",locked:!1}}function en(x){return ls.value||Ft(x).locked}function yt(x){const f=Ft(x).source;return f==="global"?"Set by administrator":f==="org"?"Set by your organization":""}function Ia(x){return(Bs.find(f=>f.value===x)||{}).label||x||"—"}function Ro(){for(const x of cn)tt[x]=Ft(x).own||"";tt.protocol||(tt.protocol="sftp"),tt.insecureSkipVerify||(tt.insecureSkipVerify="false")}function Us(x){Ae.available=!!x.available,Ae.orgEnabled=x.orgEnabled!==!1,Ae.enabled=!!x.enabled,Ae.canEditOrg=!!x.canEditOrg,Ae.isSuperadmin=!!x.isSuperadmin,Ae.scopes=x.scopes||{},wt.value==="org"&&!Ae.canEditOrg&&(wt.value="user"),Ro(),Ae.loaded=!0}$t(wt,()=>{kt.value="",Ro()});function Da(){if(!pi.value)return"";const x=Math.max(0,Math.round((Date.now()-pi.value)/1e3));if(x<60)return"just now";const f=Math.round(x/60);if(f<60)return`${f} min ago`;const q=Math.round(f/60);return q<24?`${q} h ago`:`${Math.round(q/24)} d ago`}function fn(){try{Qt.value&&localStorage.setItem(mu,JSON.stringify({health:Qt.value,ts:pi.value}))}catch{}}function Le(){try{const x=localStorage.getItem(mu);if(!x)return;const f=JSON.parse(x);f&&f.health&&(Qt.value=f.health,pi.value=f.ts||null)}catch{}}async function Fo(){Le();const{ok:x,body:f}=await fp();x&&Us(f)}async function Zs(x){const f=dn.value;f?Ae.orgEnabled=x:Ae.enabled=x;const{ok:q,body:k}=await ru(f?{scope:"org",enabled:x}:{scope:"user",enabled:x});q?(Us(k),Qe(f?x?"File transfer enabled for your organization.":"File transfer disabled for your organization.":x?"File transfer enabled.":"File transfer disabled.")):(f?Ae.orgEnabled=!x:Ae.enabled=!x,Qe(k.error||"Could not update."))}async function Bo(){kt.value="",Dt.value=!0;const x={};for(const Ke of cn)en(Ke)||(x[Ke]=tt[Ke]);const f={scope:Vs.value,config:x};dn.value||(f.enabled=Ae.enabled);const{ok:q,body:k}=await ru(f);if(Dt.value=!1,!q){kt.value=k.error||"Could not save settings.";return}Us(k),Qe(dn.value?"Organization file-transfer settings saved.":"File-transfer settings saved.")}async function Vo(){on.value=!0,Qt.value=null;const{ok:x,body:f}=await hp();on.value=!1,Qt.value=x&&f.health?f.health:{status:"down",detail:f.error||"Probe failed."},pi.value=Date.now(),fn()}function Hs(x){return x==="ok"?C.success:x==="degraded"?C.warning:C.danger}const ot=bt({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),an=j("user"),cs=["baseURL","username","password","insecureSkipVerify","basePath"],Bt=bt(Object.fromEntries(cs.map(x=>[x,""]))),Ai=j(""),ds=j(!1),fs=j(!1),hn=j(null),mi=j(null),hs=[{value:"false",label:"Verify certificate"},{value:"true",label:"Skip verification"}],js=ke(()=>ot.isSuperadmin),Ws=ke(()=>ot.isSuperadmin?"user":an.value),Na=ke(()=>ot.scopes[Ws.value]||{editableLayer:"user",fields:{}}),pn=ke(()=>Ws.value==="org");function En(x){return Na.value.fields[x]||{effective:"",own:"",source:"unset",locked:!1}}function On(x){return js.value||En(x).locked}function Vt(x){const f=En(x).source;return f==="global"?"Set by administrator":f==="org"?"Set by your organization":""}function Ks(){for(const x of cs)Bt[x]=En(x).own||"";Bt.insecureSkipVerify||(Bt.insecureSkipVerify="false")}function ps(x){ot.available=!!x.available,ot.orgEnabled=x.orgEnabled!==!1,ot.enabled=!!x.enabled,ot.canEditOrg=!!x.canEditOrg,ot.isSuperadmin=!!x.isSuperadmin,ot.scopes=x.scopes||{},an.value==="org"&&!ot.canEditOrg&&(an.value="user"),Ks(),ot.loaded=!0}$t(an,()=>{Ai.value="",Ks()});function $i(){if(!mi.value)return"";const x=Math.max(0,Math.round((Date.now()-mi.value)/1e3));if(x<60)return"just now";const f=Math.round(x/60);if(f<60)return`${f} min ago`;const q=Math.round(f/60);return q<24?`${q} h ago`:`${Math.round(q/24)} d ago`}function nt(){try{hn.value&&localStorage.setItem(gu,JSON.stringify({health:hn.value,ts:mi.value}))}catch{}}function _t(){try{const x=localStorage.getItem(gu);if(!x)return;const f=JSON.parse(x);f&&f.health&&(hn.value=f.health,mi.value=f.ts||null)}catch{}}async function ms(){_t();const{ok:x,body:f}=await gp();x&&ps(f)}async function jn(x){const f=pn.value;f?ot.orgEnabled=x:ot.enabled=x;const{ok:q,body:k}=await lu(f?{scope:"org",enabled:x}:{scope:"user",enabled:x});q?(ps(k),Qe(f?x?"WebDAV enabled for your organization.":"WebDAV disabled for your organization.":x?"WebDAV enabled.":"WebDAV disabled.")):(f?ot.orgEnabled=!x:ot.enabled=!x,Qe(k.error||"Could not update."))}async function gi(){Ai.value="",ds.value=!0;const x={};for(const Ke of cs)On(Ke)||(x[Ke]=Bt[Ke]);const f={scope:Ws.value,config:x};pn.value||(f.enabled=ot.enabled);const{ok:q,body:k}=await lu(f);if(ds.value=!1,!q){Ai.value=k.error||"Could not save settings.";return}ps(k),Qe(pn.value?"Organization WebDAV settings saved.":"WebDAV settings saved.")}async function Gs(){fs.value=!0,hn.value=null;const{ok:x,body:f}=await vp();fs.value=!1,hn.value=x&&f.health?f.health:{status:"down",detail:f.error||"Probe failed."},mi.value=Date.now(),nt()}function je(x){return x==="ok"?C.success:x==="degraded"?C.warning:C.danger}const ce=bt({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,isOrgUser:!1,mounts:[],privateFolder:!1,privateEnabled:!1,allowPrivate:!0,rootConfigured:!1,scopes:{}}),zn=j("user"),Wn=j(""),zt=j(""),gs=j(!1),Kn=j(!1),Nt=j(null),pt=j(null),rn=j({}),vi=[{value:"",label:"Inherit"},{value:"false",label:"Read-write"},{value:"true",label:"Read-only"}],Gn=ke(()=>ce.isSuperadmin),Ii=ke(()=>ce.isSuperadmin?"user":zn.value),Di=ke(()=>ce.scopes[Ii.value]||{editableLayer:"user",fields:{}}),Ut=ke(()=>Ii.value==="org");function _i(x){return Di.value.fields[x]||{effective:"",own:"",source:"unset",locked:!1}}function Ni(x){return Gn.value||_i(x).locked}function vs(x){const f=_i(x).source;return f==="global"?"Set by administrator":f==="org"?"Set by your organization":""}function qs(x){return(vi.find(f=>f.value===x)||{}).label||"Inherit"}function Ri(){Wn.value=_i("readOnly").own||""}function yi(x){ce.available=!!x.available,ce.orgEnabled=x.orgEnabled!==!1,ce.enabled=!!x.enabled,ce.canEditOrg=!!x.canEditOrg,ce.isSuperadmin=!!x.isSuperadmin,ce.isOrgUser=!!x.isOrgUser,ce.mounts=Array.isArray(x.mounts)?x.mounts:[],ce.privateFolder=!!x.privateFolder,ce.privateEnabled=!!x.privateEnabled,ce.allowPrivate=x.allowPrivate!==!1,ce.rootConfigured=!!x.rootConfigured,ce.scopes=x.scopes||{},zn.value==="org"&&!ce.canEditOrg&&(zn.value="user"),Ri(),ce.loaded=!0}$t(zn,()=>{zt.value="",Ri()});function Ys(){if(!pt.value)return"";const x=Math.max(0,Math.round((Date.now()-pt.value)/1e3));if(x<60)return"just now";const f=Math.round(x/60);if(f<60)return`${f} min ago`;const q=Math.round(f/60);return q<24?`${q} h ago`:`${Math.round(q/24)} d ago`}function Ra(){try{Nt.value&&localStorage.setItem(vu,JSON.stringify({health:Nt.value,ts:pt.value}))}catch{}}function He(){try{const x=localStorage.getItem(vu);if(!x)return;const f=JSON.parse(x);f&&f.health&&(Nt.value=f.health,pt.value=f.ts||null)}catch{}}async function mn(){He();const{ok:x,body:f}=await pp();x&&yi(f)}async function ft(x){const f=Ut.value;f?ce.orgEnabled=x:ce.enabled=x;const{ok:q,body:k}=await ra(f?{scope:"org",enabled:x}:{scope:"user",enabled:x});q?(yi(k),Qe(f?x?"Local storage enabled for your organization.":"Local storage disabled for your organization.":x?"Local storage enabled.":"Local storage disabled.")):(f?ce.orgEnabled=!x:ce.enabled=!x,Qe(k.error||"Could not update."))}async function Uo(x){ce.privateFolder=x;const{ok:f,body:q}=await ra({scope:"user",privateFolder:x});f?(yi(q),Qe(x?"Private folder enabled.":"Private folder disabled.")):(ce.privateFolder=!x,Qe(q.error||"Could not update."))}async function Js(x){ce.allowPrivate=x;const{ok:f,body:q}=await ra({scope:"org",allowPrivate:x});f?(yi(q),Qe(x?"Members may now create private folders.":"Private folders disabled for your organization.")):(ce.allowPrivate=!x,Qe(q.error||"Could not update."))}async function Xs(){zt.value="",gs.value=!0;const x={};Ni("readOnly")||(x.readOnly=Wn.value);const f={scope:Ii.value,config:x};Ut.value||(f.enabled=ce.enabled);const{ok:q,body:k}=await ra(f);if(gs.value=!1,!q){zt.value=k.error||"Could not save settings.";return}yi(k),Qe(Ut.value?"Organization local-storage settings saved.":"Local-storage settings saved.")}async function Qs(){Kn.value=!0,Nt.value=null,rn.value={};const{ok:x,body:f}=await mp();Kn.value=!1,Nt.value=x&&f.health?f.health:{status:"down",detail:f.error||"Probe failed."};const q={};if(Array.isArray(f.mounts))for(const k of f.mounts)q[k.id]={status:k.status,detail:k.detail};rn.value=q,pt.value=Date.now(),Ra()}function An(x){return x==="ok"?C.success:x==="degraded"?C.warning:C.danger}const eo=[{id:"apis-external",label:"APIs — External",icon:"globe"},{id:"drives-external",label:"Drives — External",icon:"server"},{id:"drives-local",label:"Drives — Local",icon:"monitor"}],qn=j("apis-external");function St(x){return V.value||qn.value===x}const gn=j("");let _s=null;function Qe(x){gn.value=x,clearTimeout(_s),_s=setTimeout(()=>gn.value="",2200)}const Kt=bt({current:"",next:"",confirm:""}),Yn=j(""),ys=j(!1);function Fa(){if(ys.value=!1,!Kt.current)return Yn.value="Enter your current password.";if(Kt.next.length<8)return Yn.value="New password must be at least 8 characters.";if(Kt.next!==Kt.confirm)return Yn.value="New passwords do not match.";Yn.value="Validated. Connecting to the account service is pending — no password endpoint yet.",Kt.current=Kt.next=Kt.confirm=""}const bs=j("");function Je(){bs.value="Verification link would be sent once the account service is wired up."}function Ba(x){const f=x.target.files&&x.target.files[0];if(!f)return;if(f.size>1.5*1024*1024){Qe("Image too large (max ~1.5 MB).");return}const q=new FileReader;q.onload=()=>{we.avatar=String(q.result),Qe("Photo updated.")},q.readAsDataURL(f)}function ln(){we.avatar="",Qe("Photo removed.")}const Fi=ke(()=>{var q,k,Ke;const f=(we.displayName||we.name||o.email||"PV").split("@")[0].split(/[.\-_ ]+/).filter(Boolean);return((((q=f[0])==null?void 0:q[0])||"P")+(((k=f[1])==null?void 0:k[0])||((Ke=f[0])==null?void 0:Ke[1])||"V")).toUpperCase()}),bi=j(!1),Zo=j(""),xi=j(""),Bi=j(""),Vi=j([]);function to(x){const f="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";let q="";for(let k=0;kto(4).toLowerCase()+"-"+to(4).toLowerCase()),Bi.value=""}function Ua(){we.twoFactor=!1,Vi.value=[],bi.value=!1}const Tt=navigator.userAgent;function Za(){return/Edg\//.test(Tt)?"Edge":/OPR\//.test(Tt)?"Opera":/Chrome\//.test(Tt)?"Chrome":/Firefox\//.test(Tt)?"Firefox":/Safari\//.test(Tt)?"Safari":"Browser"}function Ho(){return/Windows/.test(Tt)?"Windows":/Mac OS X/.test(Tt)?"macOS":/Android/.test(Tt)?"Android":/iPhone|iPad/.test(Tt)?"iOS":/Linux/.test(Tt)?"Linux":"Unknown OS"}const $n=Date.now(),Ui=j([]),wi=j(!1),ki=j(""),Ot=bt({email:"",password:"",role:"user",organization:""}),Jn=j(""),Zi=j(!1),Hi=j(""),jo=ke(()=>{const x=[{value:"user",label:"User"},{value:"admin",label:"Admin"}];return u.value&&x.push({value:"superadmin",label:"Superadmin"}),x}),Si=j([]);async function ji(){if(!d.value)return;const x=await ip();x.ok&&(Si.value=x.organizations.slice().sort((f,q)=>f.name.localeCompare(q.name)))}const io=ke(()=>{const x=Si.value.map(f=>({value:f.id,label:f.name}));return u.value&&x.unshift({value:"",label:"No organization"}),x});async function Xn(){if(!d.value)return;wi.value=!0,ki.value="";const x=await Qh();if(wi.value=!1,!x.ok){ki.value=x.status===403?"Manager role required.":"Could not load users.";return}Ui.value=x.users.slice().sort((f,q)=>f.email.localeCompare(q.email))}function Qn(x){try{const f=x.data||{},q=Object.keys(f)[0];return q&&f[q]&&f[q].message||x.message||x.error||"Invalid input."}catch{return x.error||"Could not create user."}}async function ei(){Jn.value="";const x=Ot.email.trim().toLowerCase();if(!x.includes("@"))return Jn.value="Enter a valid email.";if(Ot.password.length<8)return Jn.value="Password must be at least 8 characters.";Zi.value=!0;const f=u.value?Ot.organization:o.organization,{ok:q,body:k}=await ep(x,Ot.password,Ot.role,f);if(Zi.value=!1,!q)return Jn.value=Qn(k);Ot.email="",Ot.password="",Ot.role="user",Ot.organization="",Qe("User created."),Xn()}async function Ha(x){const{ok:f,body:q}=await np(x.id);if(Hi.value="",!f)return Qe(q.error||"Could not remove user.");Qe("User removed."),Xn()}const qe=bt({id:"",email:"",role:"user",verified:!1,password:"",organization:""}),Pt=j(""),Wi=j(!1),xs=ke(()=>!!qe.id&&qe.email===o.email);function ja(x){Hi.value="",qe.id=x.id,qe.email=x.email,qe.role=x.role||"user",qe.verified=!!x.verified,qe.password="",qe.organization=x.organization||"",Pt.value=""}function ws(){qe.id="",Pt.value=""}async function so(){Pt.value="";const x=qe.email.trim().toLowerCase();if(!x.includes("@"))return Pt.value="Enter a valid email.";if(qe.password&&qe.password.length<8)return Pt.value="New password must be at least 8 characters (or leave blank).";const f={email:x,role:qe.role,verified:qe.verified};u.value&&(f.organization=qe.organization),qe.password&&(f.password=qe.password),Wi.value=!0;const{ok:q,body:k}=await tp(qe.id,f);if(Wi.value=!1,!q)return Pt.value=Qn(k);Qe("User updated."),ws(),Xn()}const ks=bt({name:""}),Ki=j(""),Gi=j(!1),qi=j(""),Ct=bt({id:"",name:""}),tn=j(""),oo=ke(()=>{const x={};for(const f of Ui.value)f.organization&&(x[f.organization]=(x[f.organization]||0)+1);return x});async function vn(){Ki.value="";const x=ks.name.trim();if(!x)return Ki.value="Enter an organization name.";Gi.value=!0;const{ok:f,body:q}=await sp(x);if(Gi.value=!1,!f)return Ki.value=Qn(q);ks.name="",Qe("Organization created."),ji()}function Wa(x){qi.value="",Ct.id=x.id,Ct.name=x.name,tn.value=""}function ti(){Ct.id="",tn.value=""}async function Wo(){tn.value="";const x=Ct.name.trim();if(!x)return tn.value="Enter an organization name.";const{ok:f,body:q}=await op(Ct.id,x);if(!f)return tn.value=Qn(q);Qe("Organization renamed."),ti(),ji(),Xn()}async function Yi(x){const{ok:f,body:q}=await ap(x.id);if(qi.value="",!f)return Qe(q.error||"Could not delete organization.");Qe("Organization deleted."),ji()}function Ko(){const x={_app:"PilotVault",_kind:"settings-export",exportedAt:new Date().toISOString(),email:o.email,prefs:{...we},themeMode:rs.value},f=new Blob([JSON.stringify(x,null,2)],{type:"application/json"}),q=URL.createObjectURL(f),k=document.createElement("a");k.href=q,k.download=`pilotvault-settings-${new Date().toISOString().slice(0,10)}.json`,document.body.appendChild(k),k.click(),k.remove(),URL.revokeObjectURL(q),Qe("Settings exported.")}const ni=j("");function Ka(x){const f=x.target.files&&x.target.files[0];if(!f)return;const q=new FileReader;q.onload=()=>{try{const k=JSON.parse(String(q.result)),Ke=k.prefs||k;if(!Bc(Ke))throw new Error("bad shape");k.themeMode&&xa(k.themeMode),jr(we.fontSize),Wr(we.reduceMotion),ni.value="Settings imported and applied."}catch{ni.value="That file is not a valid PilotVault settings export."}},q.readAsText(f),x.target.value=""}const st=bt({understand:!1,typed:"",cooldown:0,armed:!1,msg:""});let In=null;const ao=ke(()=>o.email||"DELETE MY ACCOUNT"),Ji=ke(()=>st.understand&&st.typed===ao.value);function Ga(){Ji.value&&(st.armed=!0,st.cooldown=5,clearInterval(In),In=setInterval(()=>{st.cooldown--,st.cooldown<=0&&clearInterval(In)},1e3))}$t(Ji,x=>{!x&&st.armed&&(st.armed=!1,st.cooldown=0,clearInterval(In))});function Tn(){if(!(!st.armed||st.cooldown>0)){try{localStorage.removeItem("pv_prefs")}catch{}st.msg="Account deletion requires the account service. Local data was cleared and you were signed out.",setTimeout(()=>l("logout"),900)}}return fi(()=>{Te=setInterval(()=>ze.value=Date.now(),1e3),ji(),Xn(),Re(),Fo(),ms(),mn()}),Fs(()=>{clearInterval(Te),clearInterval(In),clearTimeout(_s)}),(x,f)=>(p(),g("div",fm,[r("div",hm,[f[63]||(f[63]=r("div",null,[r("div",{class:"eyebrow"},"Preferences"),r("h2",{class:"mt-0.5 text-[22px] font-bold tracking-tightest text-ink"},"Settings")],-1)),r("div",pm,[z(X,{name:"search",size:16,class:"text-ink-muted"}),oe(r("input",{"onUpdate:modelValue":f[0]||(f[0]=q=>B.value=q),placeholder:"Search settings…",class:"w-full border-none bg-transparent text-sm text-ink outline-none placeholder:text-ink-muted"},null,512),[[xe,B.value]]),B.value?(p(),g("button",{key:0,class:"text-ink-muted hover:text-ink","aria-label":"Clear search",onClick:f[1]||(f[1]=q=>B.value="")},[z(X,{name:"x",size:15})])):R("",!0)])]),r("div",mm,[oe(r("nav",gm,[(p(!0),g(re,null,Be(T.value,q=>(p(),g("button",{key:q.id,class:Ee(["flex items-center gap-2.5 rounded px-3 py-2.5 text-left text-sm transition",[O.value===q.id?q.danger?"bg-danger-soft font-semibold text-danger-fg":"bg-accent-soft font-semibold text-accent-soft-fg":q.danger?"font-medium text-danger-fg hover:bg-danger-soft":"font-medium text-ink-secondary hover:bg-surface-2"]]),onClick:k=>O.value=q.id},[z(X,{name:q.icon,size:17},null,8,["name"]),r("span",_m,S(q.label),1)],10,vm))),128))],512),[[yh,!V.value]]),r("div",ym,[V.value&&!Y.value.length?(p(),g("div",bm," No settings match “"+S(B.value)+"”. ",1)):R("",!0),(p(!0),g(re,null,Be(Y.value,q=>(p(),g(re,{key:q.id},[V.value?(p(),g("div",xm,[z(X,{name:q.icon,size:14},null,8,["name"]),D(" "+S(q.label),1)])):R("",!0),q.id==="account"?(p(),g("div",wm,[z(Me,{title:"Full name",desc:"Shown to your team on flights and audit logs.",keywords:"full name account"},{default:Ce(()=>[oe(r("input",{"onUpdate:modelValue":f[2]||(f[2]=k=>$e(we).name=k),class:"field w-56",placeholder:"Jane Operator",onBlur:f[3]||(f[3]=k=>Qe("Saved."))},null,544),[[xe,$e(we).name]])]),_:1}),z(Me,{title:"Username",desc:"Your unique handle within PilotVault.",keywords:"username handle"},{default:Ce(()=>[r("div",km,[f[64]||(f[64]=r("span",{class:"text-sm text-ink-muted"},"@",-1)),oe(r("input",{"onUpdate:modelValue":f[4]||(f[4]=k=>$e(we).username=k),class:"field w-48",placeholder:"jane",onBlur:f[5]||(f[5]=k=>Qe("Saved."))},null,544),[[xe,$e(we).username]])])]),_:1}),z(Me,{title:"Email address",desc:"Used for sign-in and notifications.",keywords:"email verification verify"},{default:Ce(()=>[r("div",Sm,[r("span",Tm,S(t.email||"—"),1),r("span",Pm,[z(X,{name:"mail",size:12}),f[65]||(f[65]=D(" Unverified ",-1))])])]),_:1}),z(Me,{title:"Role",desc:"Your access level in PilotVault.",keywords:"role admin user superadmin access rights permissions"},{default:Ce(()=>[r("span",{class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",y(t.role)])},[z(X,{name:v(t.role),size:12},null,8,["name"]),D(S(h(t.role)),1)],2)]),_:1}),z(Me,{title:"Organization",desc:"The organization your account belongs to.",keywords:"organization org tenant company"},{default:Ce(()=>[r("span",{class:Ee(["text-sm",t.organizationName?"text-ink":"text-ink-muted"])},S(t.organizationName||(u.value?"All organizations":"None")),3)]),_:1}),z(Me,{block:"",title:"Verify email",desc:"Confirm ownership to enable password resets and alerts.",keywords:"verify email resend"},{default:Ce(()=>[r("button",{class:"btn-ghost",onClick:Je},"Send verification link"),bs.value?(p(),g("p",Cm,S(bs.value),1)):R("",!0)]),_:1}),z(Me,{block:"",title:"Change password",desc:"Use at least 8 characters.",keywords:"password change current new"},{default:Ce(()=>[r("div",Lm,[oe(r("input",{"onUpdate:modelValue":f[6]||(f[6]=k=>Kt.current=k),type:"password",class:"field",placeholder:"Current password"},null,512),[[xe,Kt.current]]),oe(r("input",{"onUpdate:modelValue":f[7]||(f[7]=k=>Kt.next=k),type:"password",class:"field",placeholder:"New password"},null,512),[[xe,Kt.next]]),oe(r("input",{"onUpdate:modelValue":f[8]||(f[8]=k=>Kt.confirm=k),type:"password",class:"field",placeholder:"Confirm new password"},null,512),[[xe,Kt.confirm]]),r("div",Mm,[r("button",{class:"btn-accent",onClick:Fa},"Update password"),Yn.value?(p(),g("span",{key:0,class:Ee(["text-xs",ys.value?"text-success-fg":"text-ink-muted"])},S(Yn.value),3)):R("",!0)])])]),_:1})])):q.id==="appearance"?(p(),g("div",Em,[z(Me,{title:"Theme",desc:"Light, dark, or follow your system.",keywords:"theme light dark system appearance"},{default:Ce(()=>[z(bn,{modelValue:Pe.value,"onUpdate:modelValue":f[9]||(f[9]=k=>Pe.value=k),options:he},null,8,["modelValue"])]),_:1}),z(Me,{title:"Font size",desc:"Scales the entire interface for readability.",keywords:"font size accessibility text"},{default:Ce(()=>[z(bn,{modelValue:$e(we).fontSize,"onUpdate:modelValue":f[10]||(f[10]=k=>$e(we).fontSize=k),options:ye},null,8,["modelValue"])]),_:1}),z(Me,{title:"Reduce motion",desc:"Minimise animations and transitions.",keywords:"reduce motion accessibility animation"},{default:Ce(()=>[z(sn,{modelValue:$e(we).reduceMotion,"onUpdate:modelValue":f[11]||(f[11]=k=>$e(we).reduceMotion=k)},null,8,["modelValue"])]),_:1}),z(Me,{title:"Language",desc:"Interface language.",keywords:"language locale"},{default:Ce(()=>[oe(r("select",{"onUpdate:modelValue":f[12]||(f[12]=k=>$e(we).language=k),class:"field w-48"},[(p(),g(re,null,Be(Ie,([k,Ke])=>r("option",{key:k,value:k},S(Ke),9,Om)),64))],512),[[Et,$e(we).language]])]),_:1}),z(Me,{title:"Region",desc:"Affects number, unit and date defaults.",keywords:"region country locale"},{default:Ce(()=>[oe(r("select",{"onUpdate:modelValue":f[13]||(f[13]=k=>$e(we).region=k),class:"field w-48"},[(p(),g(re,null,Be(Ve,([k,Ke])=>r("option",{key:k,value:k},S(Ke),9,zm)),64))],512),[[Et,$e(we).region]])]),_:1}),z(Me,{title:"Date format",desc:"How calendar dates are displayed.",keywords:"date format"},{default:Ce(()=>[oe(r("select",{"onUpdate:modelValue":f[14]||(f[14]=k=>$e(we).dateFormat=k),class:"field w-48"},[(p(),g(re,null,Be(pe,([k,Ke])=>r("option",{key:k,value:k},S(Ke),9,Am)),64))],512),[[Et,$e(we).dateFormat]])]),_:1}),z(Me,{title:"Time format",desc:"12- or 24-hour clock.",keywords:"time format clock 12 24 hour"},{default:Ce(()=>[z(bn,{modelValue:$e(we).timeFormat,"onUpdate:modelValue":f[15]||(f[15]=k=>$e(we).timeFormat=k),options:Ne},null,8,["modelValue"])]),_:1}),z(Me,{title:"Preview",desc:"How timestamps appear across the app.",keywords:"preview date time"},{default:Ce(()=>[r("span",$m,S(te.value),1)]),_:1}),f[66]||(f[66]=r("p",{class:"mt-3 text-xs text-ink-muted"}," Language & region are stored now; full localisation ships with the account service. ",-1))])):q.id==="integrations"?(p(),g("div",Im,[V.value?R("",!0):(p(),g("div",Dm,[(p(),g(re,null,Be(eo,k=>r("button",{key:k.id,type:"button",class:Ee(["-mb-px inline-flex items-center gap-1.5 whitespace-nowrap border-b-2 px-3 py-2 text-sm font-semibold transition",qn.value===k.id?"border-accent text-ink":"border-transparent text-ink-secondary hover:text-ink"]),onClick:Ke=>qn.value=k.id},[z(X,{name:k.icon,size:16},null,8,["name"]),D(S(k.label),1)],10,Nm)),64))])),St("apis-external")?(p(),g("div",Rm,[r("div",Fm,[r("div",Bm,[z(X,{name:"radio",size:20})]),f[67]||(f[67]=r("div",{class:"min-w-0"},[r("div",{class:"text-sm font-semibold text-ink"},"OpenSky Network"),r("div",{class:"mt-0.5 text-xs text-ink-muted"}," Live ADS-B aircraft data. Configure your own OAuth2 credentials, plan and default bounding box. ")],-1))]),de.loaded&&!de.available?(p(),g("div",Vm,[z(X,{name:"lock",size:14,class:"mr-1 inline"}),f[68]||(f[68]=D(" OpenSky is currently disabled by your administrator. Contact them to enable it. ",-1))])):R("",!0),de.canEditOrg?(p(),g("div",Um,[f[69]||(f[69]=r("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),z(bn,{modelValue:_e.value,"onUpdate:modelValue":f[16]||(f[16]=k=>_e.value=k),options:it},null,8,["modelValue"])])):R("",!0),Q.value?(p(),at(Me,{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:Ce(()=>[z(sn,{"model-value":de.orgEnabled,disabled:!de.available,"onUpdate:modelValue":Ze},null,8,["model-value","disabled"])]),_:1})):(p(),at(Me,{key:3,title:"Enable OpenSky",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin opensky"},{default:Ce(()=>[z(sn,{"model-value":de.enabled,disabled:!de.available||!de.orgEnabled,"onUpdate:modelValue":Ze},null,8,["model-value","disabled"])]),_:1})),!Q.value&&de.available&&!de.orgEnabled?(p(),g("div",Zm,[z(X,{name:"lock",size:13,class:"mr-1 inline"}),f[71]||(f[71]=D("OpenSky is turned off for your organization",-1)),de.canEditOrg?(p(),g("span",Hm,[...f[70]||(f[70]=[D(" — switch to ",-1),r("span",{class:"font-semibold"},"Organization",-1),D(" to turn it back on",-1)])])):R("",!0),f[72]||(f[72]=D(". ",-1))])):R("",!0),Q.value?(p(),g("div",jm,[z(X,{name:"users",size:13,class:"mr-1 inline"}),f[73]||(f[73]=D("These are organization-wide settings — they apply to everyone in ",-1)),r("span",Wm,S(t.organizationName||"your organization"),1),f[74]||(f[74]=D(". Leave a field blank to let each user choose their own; a value set here overrides the user's. ",-1))])):Z.value?(p(),g("div",Km," As a superadmin you manage the global OpenSky configuration in the API Server panel. The effective configuration is shown below. ")):R("",!0),de.available&&!Q.value?(p(),g("div",Gm,[r("div",qm,[r("div",Ym,[z(X,{name:"signal",size:15}),f[75]||(f[75]=D("Credit usage ",-1))]),me.value?(p(),g("span",Jm,"Checked "+S(Ue()),1)):R("",!0)]),Oe.value?(p(),g(re,{key:0},[Oe.value.remaining!=null?(p(),g(re,{key:0},[r("div",Xm,[r("span",Qm,S(et(Oe.value.remaining)),1),r("span",eg,"/ "+S(et(Oe.value.daily))+" credits left today",1)]),r("div",tg,[r("div",{class:Ee(["h-full rounded-full transition-all",ut.value]),style:Is({width:Xe.value+"%"})},null,6)]),r("div",ng," Used "+S(et(Oe.value.daily-Oe.value.remaining))+" today · "+S(Oe.value.probeCost)+" credit"+S(Oe.value.probeCost===1?"":"s")+" per query · "+S(Oe.value.mode),1)],64)):(p(),g(re,{key:1},[r("div",ig,[f[76]||(f[76]=D("Daily allowance: ",-1)),r("span",sg,S(et(Oe.value.daily)),1),f[77]||(f[77]=D(" credits",-1))]),r("div",og,S(Oe.value.probeCost)+" credit"+S(Oe.value.probeCost===1?"":"s")+" per query · "+S(Oe.value.mode)+". OpenSky only reports live remaining credits for authenticated requests — add OAuth2 credentials below to track usage. ",1)],64))],64)):(p(),g("div",ag,[...f[78]||(f[78]=[D(" Run ",-1),r("span",{class:"font-semibold text-ink-secondary"},"Test connection",-1),D(" below to fetch your live OpenSky credit balance. ",-1)])]))])):R("",!0),z(Me,{title:"OpenSky plan",desc:"Your account tier — sets the daily credit allowance.",keywords:"plan tier credits"},{default:Ce(()=>[Se("plan")?(p(),g("span",rg,[D(S((A.find(k=>k.value===U("plan").effective)||{}).label||U("plan").effective||"—")+" ",1),I("plan")?(p(),g("span",lg,[z(X,{name:"lock",size:10}),D(S(I("plan")),1)])):R("",!0)])):(p(),at(bn,{key:1,modelValue:be.plan,"onUpdate:modelValue":f[17]||(f[17]=k=>be.plan=k),options:A},null,8,["modelValue"]))]),_:1}),z(Me,{title:"Default bounding box",desc:"Pick a region, or choose Custom to enter lamin,lomin,lamax,lomax by hand — used for live queries and the health probe.",keywords:"bounding box bbox area region country continent world europe custom coordinates"},{default:Ce(()=>[Se("bbox")?(p(),g("span",ug,[D(S(_(U("bbox").effective)||U("bbox").effective||"—")+" ",1),I("bbox")?(p(),g("span",cg,[z(X,{name:"lock",size:10}),D(S(I("bbox")),1)])):R("",!0)])):(p(),g("div",dg,[oe(r("select",{"onUpdate:modelValue":f[18]||(f[18]=k=>K.value=k),class:"field w-64"},[(p(),g(re,null,Be(vt,k=>r("optgroup",{key:k.label,label:k.label},[(p(!0),g(re,null,Be(k.options,Ke=>(p(),g("option",{key:Ke.value,value:Ke.value},S(Ke.label),9,hg))),128))],8,fg)),64)),f[79]||(f[79]=r("option",{value:"__custom__"},"Custom…",-1))],512),[[Et,K.value]]),G.value?oe((p(),g("input",{key:0,"onUpdate:modelValue":f[19]||(f[19]=k=>be.bbox=k),class:"field w-64 font-mono",placeholder:"50.5,3.2,53.7,7.3"},null,512)),[[xe,be.bbox]]):R("",!0)]))]),_:1}),z(Me,{title:"OAuth2 client ID",desc:"Optional — leave blank for anonymous access (lower limits).",keywords:"oauth client id credentials"},{default:Ce(()=>[Se("clientId")?(p(),g("span",pg,[D(S(U("clientId").effective||"—")+" ",1),I("clientId")?(p(),g("span",mg,[z(X,{name:"lock",size:10}),D(S(I("clientId")),1)])):R("",!0)])):oe((p(),g("input",{key:1,"onUpdate:modelValue":f[20]||(f[20]=k=>be.clientId=k),class:"field w-64",placeholder:"your-api-client"},null,512)),[[xe,be.clientId]])]),_:1}),z(Me,{title:"OAuth2 client secret",desc:"Paired with the client ID for authenticated access.",keywords:"oauth client secret credentials password"},{default:Ce(()=>[Se("clientSecret")?(p(),g("span",gg,[D(S(U("clientSecret").effective||"—")+" ",1),I("clientSecret")?(p(),g("span",vg,[z(X,{name:"lock",size:10}),D(S(I("clientSecret")),1)])):R("",!0)])):oe((p(),g("input",{key:1,"onUpdate:modelValue":f[21]||(f[21]=k=>be.clientSecret=k),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[xe,be.clientSecret]])]),_:1}),de.available&&!de.allowAnonymous?(p(),g("div",_g," Anonymous access is disabled by the administrator — OpenSky needs OAuth2 credentials from some layer to work. ")):R("",!0),r("div",yg,[Z.value?R("",!0):(p(),g("button",{key:0,class:"btn-accent",disabled:le.value||!de.available,onClick:Ye},S(le.value?"Saving…":Q.value?"Save organization settings":"Save settings"),9,bg)),Q.value?R("",!0):(p(),g("button",{key:1,class:"btn-ghost",disabled:ie.value||!de.available,onClick:ht},S(ie.value?"Testing…":"Test connection"),9,xg)),ae.value?(p(),g("span",wg,S(ae.value),1)):R("",!0),rt.value&&!Q.value?(p(),g("span",{key:3,class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",ue(rt.value.status)])},[f[80]||(f[80]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(S(rt.value.detail||rt.value.status),1)],2)):R("",!0)])])):R("",!0),St("drives-external")?(p(),g(re,{key:2},[r("div",kg,[r("div",Sg,[r("div",Tg,[z(X,{name:"server",size:20})]),f[81]||(f[81]=r("div",{class:"min-w-0"},[r("div",{class:"text-sm font-semibold text-ink"},"File Transfer (FTP / SFTP)"),r("div",{class:"mt-0.5 text-xs text-ink-muted"}," Connect to an FTP, FTPS or SFTP server. Configure the connection your account uses for file transfers. ")],-1))]),Ae.loaded&&!Ae.available?(p(),g("div",Pg,[z(X,{name:"lock",size:14,class:"mr-1 inline"}),f[82]||(f[82]=D(" File transfer is currently disabled by your administrator. Contact them to enable it. ",-1))])):R("",!0),Ae.canEditOrg?(p(),g("div",Cg,[f[83]||(f[83]=r("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),z(bn,{modelValue:wt.value,"onUpdate:modelValue":f[22]||(f[22]=k=>wt.value=k),options:it},null,8,["modelValue"])])):R("",!0),dn.value?(p(),at(Me,{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:Ce(()=>[z(sn,{"model-value":Ae.orgEnabled,disabled:!Ae.available,"onUpdate:modelValue":Zs},null,8,["model-value","disabled"])]),_:1})):(p(),at(Me,{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:Ce(()=>[z(sn,{"model-value":Ae.enabled,disabled:!Ae.available||!Ae.orgEnabled,"onUpdate:modelValue":Zs},null,8,["model-value","disabled"])]),_:1})),!dn.value&&Ae.available&&!Ae.orgEnabled?(p(),g("div",Lg,[z(X,{name:"lock",size:13,class:"mr-1 inline"}),f[85]||(f[85]=D("File transfer is turned off for your organization",-1)),Ae.canEditOrg?(p(),g("span",Mg,[...f[84]||(f[84]=[D(" — switch to ",-1),r("span",{class:"font-semibold"},"Organization",-1),D(" to turn it back on",-1)])])):R("",!0),f[86]||(f[86]=D(". ",-1))])):R("",!0),dn.value?(p(),g("div",Eg,[z(X,{name:"users",size:13,class:"mr-1 inline"}),f[87]||(f[87]=D("These are organization-wide settings — they apply to everyone in ",-1)),r("span",Og,S(t.organizationName||"your organization"),1),f[88]||(f[88]=D(". Leave the connection blank to let each user configure their own; a connection set here overrides the user's. ",-1))])):ls.value?(p(),g("div",zg," As a superadmin you manage the global file-transfer configuration in the API Server panel. The effective configuration is shown below. ")):R("",!0),z(Me,{title:"Protocol",desc:"SFTP (over SSH), FTPS (FTP over TLS), or plain FTP.",keywords:"protocol sftp ftps ftp"},{default:Ce(()=>[en("protocol")?(p(),g("span",Ag,[D(S(Ia(Ft("protocol").effective))+" ",1),yt("protocol")?(p(),g("span",$g,[z(X,{name:"lock",size:10}),D(S(yt("protocol")),1)])):R("",!0)])):(p(),at(bn,{key:1,modelValue:tt.protocol,"onUpdate:modelValue":f[23]||(f[23]=k=>tt.protocol=k),options:Bs},null,8,["modelValue"]))]),_:1}),z(Me,{title:"Host",desc:"Server hostname or IP address.",keywords:"host server address"},{default:Ce(()=>[en("host")?(p(),g("span",Ig,[D(S(Ft("host").effective||"—")+" ",1),yt("host")?(p(),g("span",Dg,[z(X,{name:"lock",size:10}),D(S(yt("host")),1)])):R("",!0)])):oe((p(),g("input",{key:1,"onUpdate:modelValue":f[24]||(f[24]=k=>tt.host=k),class:"field w-64",placeholder:"files.example.com"},null,512)),[[xe,tt.host]])]),_:1}),z(Me,{title:"Port",desc:"Leave blank for the protocol default (22 for SFTP, 21 for FTP/FTPS).",keywords:"port"},{default:Ce(()=>[en("port")?(p(),g("span",Ng,[D(S(Ft("port").effective||"default")+" ",1),yt("port")?(p(),g("span",Rg,[z(X,{name:"lock",size:10}),D(S(yt("port")),1)])):R("",!0)])):oe((p(),g("input",{key:1,"onUpdate:modelValue":f[25]||(f[25]=k=>tt.port=k),inputmode:"numeric",class:"field w-24 font-mono",placeholder:"22"},null,512)),[[xe,tt.port]])]),_:1}),z(Me,{title:"Username",desc:"Account used to authenticate.",keywords:"username login account"},{default:Ce(()=>[en("username")?(p(),g("span",Fg,[D(S(Ft("username").effective||"—")+" ",1),yt("username")?(p(),g("span",Bg,[z(X,{name:"lock",size:10}),D(S(yt("username")),1)])):R("",!0)])):oe((p(),g("input",{key:1,"onUpdate:modelValue":f[26]||(f[26]=k=>tt.username=k),class:"field w-64",placeholder:"user"},null,512)),[[xe,tt.username]])]),_:1}),z(Me,{title:"Password",desc:"Password auth for FTP/FTPS, or SFTP password login. Leave blank to use a key.",keywords:"password secret credentials"},{default:Ce(()=>[en("password")?(p(),g("span",Vg,[D(S(Ft("password").effective||"—")+" ",1),yt("password")?(p(),g("span",Ug,[z(X,{name:"lock",size:10}),D(S(yt("password")),1)])):R("",!0)])):oe((p(),g("input",{key:1,"onUpdate:modelValue":f[27]||(f[27]=k=>tt.password=k),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[xe,tt.password]])]),_:1}),us.value==="sftp"?(p(),at(Me,{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:Ce(()=>[en("privateKey")?(p(),g("span",Zg,[D(S(Ft("privateKey").effective||"—")+" ",1),yt("privateKey")?(p(),g("span",Hg,[z(X,{name:"lock",size:10}),D(S(yt("privateKey")),1)])):R("",!0)])):oe((p(),g("textarea",{key:1,"onUpdate:modelValue":f[28]||(f[28]=k=>tt.privateKey=k),rows:"3",class:"field w-full font-mono text-xs",placeholder:"-----BEGIN OPENSSH PRIVATE KEY-----"},null,512)),[[xe,tt.privateKey]])]),_:1})):R("",!0),us.value==="sftp"?(p(),at(Me,{key:8,title:"Private key passphrase",desc:"Passphrase protecting the SSH private key, if any.",keywords:"passphrase key secret"},{default:Ce(()=>[en("keyPassphrase")?(p(),g("span",jg,[D(S(Ft("keyPassphrase").effective||"—")+" ",1),yt("keyPassphrase")?(p(),g("span",Wg,[z(X,{name:"lock",size:10}),D(S(yt("keyPassphrase")),1)])):R("",!0)])):oe((p(),g("input",{key:1,"onUpdate:modelValue":f[29]||(f[29]=k=>tt.keyPassphrase=k),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[xe,tt.keyPassphrase]])]),_:1})):R("",!0),us.value==="sftp"?(p(),at(Me,{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:Ce(()=>[en("hostKeyFingerprint")?(p(),g("span",Kg,[D(S(Ft("hostKeyFingerprint").effective||"—")+" ",1),yt("hostKeyFingerprint")?(p(),g("span",Gg,[z(X,{name:"lock",size:10}),D(S(yt("hostKeyFingerprint")),1)])):R("",!0)])):oe((p(),g("input",{key:1,"onUpdate:modelValue":f[30]||(f[30]=k=>tt.hostKeyFingerprint=k),class:"field w-full font-mono text-xs",placeholder:"SHA256:…"},null,512)),[[xe,tt.hostKeyFingerprint]])]),_:1})):R("",!0),us.value==="ftps"?(p(),at(Me,{key:10,title:"TLS verification",desc:"Skip only for self-signed test servers.",keywords:"tls certificate verify insecure ftps"},{default:Ce(()=>[en("insecureSkipVerify")?(p(),g("span",qg,[D(S(Ft("insecureSkipVerify").effective==="true"?"Skip verification":"Verify certificate")+" ",1),yt("insecureSkipVerify")?(p(),g("span",Yg,[z(X,{name:"lock",size:10}),D(S(yt("insecureSkipVerify")),1)])):R("",!0)])):(p(),at(bn,{key:1,modelValue:tt.insecureSkipVerify,"onUpdate:modelValue":f[31]||(f[31]=k=>tt.insecureSkipVerify=k),options:No},null,8,["modelValue"]))]),_:1})):R("",!0),z(Me,{title:"Base path",desc:"Working directory and health-check target, e.g. /uploads.",keywords:"base path directory folder root"},{default:Ce(()=>[en("basePath")?(p(),g("span",Jg,[D(S(Ft("basePath").effective||"—")+" ",1),yt("basePath")?(p(),g("span",Xg,[z(X,{name:"lock",size:10}),D(S(yt("basePath")),1)])):R("",!0)])):oe((p(),g("input",{key:1,"onUpdate:modelValue":f[32]||(f[32]=k=>tt.basePath=k),class:"field w-64 font-mono",placeholder:"/uploads"},null,512)),[[xe,tt.basePath]])]),_:1}),r("div",Qg,[ls.value?R("",!0):(p(),g("button",{key:0,class:"btn-accent",disabled:Dt.value||!Ae.available,onClick:Bo},S(Dt.value?"Saving…":dn.value?"Save organization settings":"Save settings"),9,ev)),dn.value?R("",!0):(p(),g("button",{key:1,class:"btn-ghost",disabled:on.value||!Ae.available,onClick:Vo},S(on.value?"Testing…":"Test connection"),9,tv)),kt.value?(p(),g("span",nv,S(kt.value),1)):R("",!0),pi.value&&!dn.value?(p(),g("span",iv,"Checked "+S(Da()),1)):R("",!0),Qt.value&&!dn.value?(p(),g("span",{key:4,class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",Hs(Qt.value.status)])},[f[89]||(f[89]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(S(Qt.value.detail||Qt.value.status),1)],2)):R("",!0)])]),r("div",sv,[r("div",ov,[r("div",av,[z(X,{name:"cloud",size:20})]),f[90]||(f[90]=r("div",{class:"min-w-0"},[r("div",{class:"text-sm font-semibold text-ink"},"WebDAV"),r("div",{class:"mt-0.5 text-xs text-ink-muted"}," Connect to a WebDAV server (Nextcloud, ownCloud, IIS, …). Configure the connection your account uses. ")],-1))]),ot.loaded&&!ot.available?(p(),g("div",rv,[z(X,{name:"lock",size:14,class:"mr-1 inline"}),f[91]||(f[91]=D(" WebDAV is currently disabled by your administrator. Contact them to enable it. ",-1))])):R("",!0),ot.canEditOrg?(p(),g("div",lv,[f[92]||(f[92]=r("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),z(bn,{modelValue:an.value,"onUpdate:modelValue":f[33]||(f[33]=k=>an.value=k),options:it},null,8,["modelValue"])])):R("",!0),pn.value?(p(),at(Me,{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:Ce(()=>[z(sn,{"model-value":ot.orgEnabled,disabled:!ot.available,"onUpdate:modelValue":jn},null,8,["model-value","disabled"])]),_:1})):(p(),at(Me,{key:3,title:"Enable WebDAV",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin webdav"},{default:Ce(()=>[z(sn,{"model-value":ot.enabled,disabled:!ot.available||!ot.orgEnabled,"onUpdate:modelValue":jn},null,8,["model-value","disabled"])]),_:1})),!pn.value&&ot.available&&!ot.orgEnabled?(p(),g("div",uv,[z(X,{name:"lock",size:13,class:"mr-1 inline"}),f[94]||(f[94]=D("WebDAV is turned off for your organization",-1)),ot.canEditOrg?(p(),g("span",cv,[...f[93]||(f[93]=[D(" — switch to ",-1),r("span",{class:"font-semibold"},"Organization",-1),D(" to turn it back on",-1)])])):R("",!0),f[95]||(f[95]=D(". ",-1))])):R("",!0),pn.value?(p(),g("div",dv,[z(X,{name:"users",size:13,class:"mr-1 inline"}),f[96]||(f[96]=D("These are organization-wide settings — they apply to everyone in ",-1)),r("span",fv,S(t.organizationName||"your organization"),1),f[97]||(f[97]=D(". Leave the connection blank to let each user configure their own; a connection set here overrides the user's. ",-1))])):js.value?(p(),g("div",hv," As a superadmin you manage the global WebDAV configuration in the API Server panel. The effective configuration is shown below. ")):R("",!0),z(Me,{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:Ce(()=>[On("baseURL")?(p(),g("span",pv,[D(S(En("baseURL").effective||"—")+" ",1),Vt("baseURL")?(p(),g("span",mv,[z(X,{name:"lock",size:10}),D(S(Vt("baseURL")),1)])):R("",!0)])):oe((p(),g("input",{key:1,"onUpdate:modelValue":f[34]||(f[34]=k=>Bt.baseURL=k),class:"field w-full font-mono text-xs",placeholder:"https://cloud.example.com/remote.php/dav/files/alice/"},null,512)),[[xe,Bt.baseURL]])]),_:1}),z(Me,{title:"Username",desc:"Account used to authenticate (leave blank for a public share).",keywords:"username login account"},{default:Ce(()=>[On("username")?(p(),g("span",gv,[D(S(En("username").effective||"—")+" ",1),Vt("username")?(p(),g("span",vv,[z(X,{name:"lock",size:10}),D(S(Vt("username")),1)])):R("",!0)])):oe((p(),g("input",{key:1,"onUpdate:modelValue":f[35]||(f[35]=k=>Bt.username=k),class:"field w-64",placeholder:"user"},null,512)),[[xe,Bt.username]])]),_:1}),z(Me,{title:"Password",desc:"Password or app-specific token for HTTP Basic auth.",keywords:"password secret credentials token"},{default:Ce(()=>[On("password")?(p(),g("span",_v,[D(S(En("password").effective||"—")+" ",1),Vt("password")?(p(),g("span",yv,[z(X,{name:"lock",size:10}),D(S(Vt("password")),1)])):R("",!0)])):oe((p(),g("input",{key:1,"onUpdate:modelValue":f[36]||(f[36]=k=>Bt.password=k),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[xe,Bt.password]])]),_:1}),z(Me,{title:"TLS verification",desc:"Only affects HTTPS. Skip only for self-signed test servers.",keywords:"tls certificate verify insecure https"},{default:Ce(()=>[On("insecureSkipVerify")?(p(),g("span",bv,[D(S(En("insecureSkipVerify").effective==="true"?"Skip verification":"Verify certificate")+" ",1),Vt("insecureSkipVerify")?(p(),g("span",xv,[z(X,{name:"lock",size:10}),D(S(Vt("insecureSkipVerify")),1)])):R("",!0)])):(p(),at(bn,{key:1,modelValue:Bt.insecureSkipVerify,"onUpdate:modelValue":f[37]||(f[37]=k=>Bt.insecureSkipVerify=k),options:hs},null,8,["modelValue"]))]),_:1}),z(Me,{title:"Base path",desc:"Working directory under the server URL and health-check target, e.g. /Documents.",keywords:"base path directory folder root"},{default:Ce(()=>[On("basePath")?(p(),g("span",wv,[D(S(En("basePath").effective||"—")+" ",1),Vt("basePath")?(p(),g("span",kv,[z(X,{name:"lock",size:10}),D(S(Vt("basePath")),1)])):R("",!0)])):oe((p(),g("input",{key:1,"onUpdate:modelValue":f[38]||(f[38]=k=>Bt.basePath=k),class:"field w-64 font-mono",placeholder:"/Documents"},null,512)),[[xe,Bt.basePath]])]),_:1}),r("div",Sv,[js.value?R("",!0):(p(),g("button",{key:0,class:"btn-accent",disabled:ds.value||!ot.available,onClick:gi},S(ds.value?"Saving…":pn.value?"Save organization settings":"Save settings"),9,Tv)),pn.value?R("",!0):(p(),g("button",{key:1,class:"btn-ghost",disabled:fs.value||!ot.available,onClick:Gs},S(fs.value?"Testing…":"Test connection"),9,Pv)),Ai.value?(p(),g("span",Cv,S(Ai.value),1)):R("",!0),mi.value&&!pn.value?(p(),g("span",Lv,"Checked "+S($i()),1)):R("",!0),hn.value&&!pn.value?(p(),g("span",{key:4,class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",je(hn.value.status)])},[f[98]||(f[98]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(S(hn.value.detail||hn.value.status),1)],2)):R("",!0)])])],64)):R("",!0),St("drives-local")?(p(),g("div",Mv,[r("div",Ev,[r("div",Ov,[z(X,{name:"monitor",size:20})]),f[99]||(f[99]=r("div",{class:"min-w-0"},[r("div",{class:"text-sm font-semibold text-ink"},"Local Storage"),r("div",{class:"mt-0.5 text-xs text-ink-muted"}," A private folder on the server for your files. Each user has their own; members of an organization share one. ")],-1))]),ce.loaded&&!ce.available?(p(),g("div",zv,[z(X,{name:"lock",size:14,class:"mr-1 inline"}),f[100]||(f[100]=D(" Local storage is currently disabled by your administrator. Contact them to enable it. ",-1))])):ce.loaded&&!ce.rootConfigured?(p(),g("div",Av,[z(X,{name:"alertTriangle",size:14,class:"mr-1 inline"}),f[101]||(f[101]=D(" No storage root has been configured by your administrator yet. ",-1))])):R("",!0),ce.canEditOrg?(p(),g("div",$v,[f[102]||(f[102]=r("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),z(bn,{modelValue:zn.value,"onUpdate:modelValue":f[39]||(f[39]=k=>zn.value=k),options:it},null,8,["modelValue"])])):R("",!0),Ut.value?(p(),at(Me,{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:Ce(()=>[z(sn,{"model-value":ce.orgEnabled,disabled:!ce.available,"onUpdate:modelValue":ft},null,8,["model-value","disabled"])]),_:1})):(p(),at(Me,{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:Ce(()=>[z(sn,{"model-value":ce.enabled,disabled:!ce.available||!ce.orgEnabled,"onUpdate:modelValue":ft},null,8,["model-value","disabled"])]),_:1})),!Ut.value&&ce.available&&!ce.orgEnabled?(p(),g("div",Iv,[z(X,{name:"lock",size:13,class:"mr-1 inline"}),f[104]||(f[104]=D("Local storage is turned off for your organization",-1)),ce.canEditOrg?(p(),g("span",Dv,[...f[103]||(f[103]=[D(" — switch to ",-1),r("span",{class:"font-semibold"},"Organization",-1),D(" to turn it back on",-1)])])):R("",!0),f[105]||(f[105]=D(". ",-1))])):R("",!0),Ut.value?(p(),g("div",Nv,[z(X,{name:"users",size:13,class:"mr-1 inline"}),f[106]||(f[106]=D("These are organization-wide settings — they apply to everyone in ",-1)),r("span",Rv,S(t.organizationName||"your organization"),1),f[107]||(f[107]=D(", who all share the organization folder. Members can additionally enable a private folder inside it. ",-1))])):Gn.value?(p(),g("div",Fv," As a superadmin you manage the global storage root in the API Server panel. The effective configuration is shown below. ")):R("",!0),Ut.value?(p(),at(Me,{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:Ce(()=>[z(sn,{"model-value":ce.allowPrivate,disabled:!ce.available,"onUpdate:modelValue":Js},null,8,["model-value","disabled"])]),_:1})):R("",!0),Ut.value?R("",!0):(p(),g(re,{key:9},[z(Me,{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:Ce(()=>[r("div",Bv,[(p(!0),g(re,null,Be(ce.mounts,k=>(p(),g("div",{key:k.id,class:"flex flex-wrap items-center gap-2"},[r("span",Vv,S(k.path),1),k.kind==="shared"?(p(),g("span",Uv,[z(X,{name:"users",size:10}),f[108]||(f[108]=D("Shared with your organization",-1))])):(p(),g("span",Zv,[z(X,{name:"lock",size:10}),f[109]||(f[109]=D("Private to you",-1))])),rn.value[k.id]?(p(),g("span",{key:2,class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[10px] font-semibold",An(rn.value[k.id].status)])},[f[110]||(f[110]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(S(rn.value[k.id].status),1)],2)):R("",!0)]))),128)),ce.mounts.length?R("",!0):(p(),g("div",Hv,S(ce.rootConfigured?"No folder assigned yet.":"Waiting for the administrator to configure a storage root."),1))])]),_:1}),ce.isOrgUser&&ce.allowPrivate?(p(),at(Me,{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:Ce(()=>[z(sn,{"model-value":ce.privateFolder,disabled:!ce.available||!ce.orgEnabled,"onUpdate:modelValue":Uo},null,8,["model-value","disabled"])]),_:1})):ce.isOrgUser&&!ce.allowPrivate?(p(),g("div",jv,[z(X,{name:"lock",size:13,class:"mr-1 inline"}),f[111]||(f[111]=D("Private folders are turned off by your organization. ",-1))])):R("",!0)],64)),z(Me,{title:"Access mode",desc:"Read-only prevents uploads, deletes and folder creation.",keywords:"read only write access mode permission"},{default:Ce(()=>[Ni("readOnly")?(p(),g("span",Wv,[D(S(qs(_i("readOnly").effective))+" ",1),vs("readOnly")?(p(),g("span",Kv,[z(X,{name:"lock",size:10}),D(S(vs("readOnly")),1)])):R("",!0)])):(p(),at(bn,{key:1,modelValue:Wn.value,"onUpdate:modelValue":f[40]||(f[40]=k=>Wn.value=k),options:vi},null,8,["modelValue"]))]),_:1}),r("div",Gv,[Gn.value?R("",!0):(p(),g("button",{key:0,class:"btn-accent",disabled:gs.value||!ce.available,onClick:Xs},S(gs.value?"Saving…":Ut.value?"Save organization settings":"Save settings"),9,qv)),Ut.value?R("",!0):(p(),g("button",{key:1,class:"btn-ghost",disabled:Kn.value||!ce.available,onClick:Qs},S(Kn.value?"Testing…":"Test folder"),9,Yv)),zt.value?(p(),g("span",Jv,S(zt.value),1)):R("",!0),pt.value&&!Ut.value?(p(),g("span",Xv,"Checked "+S(Ys()),1)):R("",!0),Nt.value&&!Ut.value?(p(),g("span",{key:4,class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",An(Nt.value.status)])},[f[112]||(f[112]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(S(Nt.value.detail||Nt.value.status),1)],2)):R("",!0)])])):R("",!0)])):q.id==="profile"?(p(),g("div",Qv,[z(Me,{block:"",title:"Profile photo",desc:"PNG or JPG, up to ~1.5 MB. Stored on this device.",keywords:"avatar photo picture"},{default:Ce(()=>[r("div",e_,[$e(we).avatar?(p(),g("img",{key:0,src:$e(we).avatar,alt:"Avatar",class:"h-16 w-16 rounded-full object-cover"},null,8,t_)):(p(),g("div",n_,S(Fi.value),1)),r("div",i_,[r("label",s_,[z(X,{name:"upload",size:15,class:"mr-1.5 inline"}),f[113]||(f[113]=D("Upload ",-1)),r("input",{type:"file",accept:"image/*",class:"hidden",onChange:Ba},null,32)]),$e(we).avatar?(p(),g("button",{key:0,class:"btn-ghost",onClick:ln},"Remove")):R("",!0)])])]),_:1}),z(Me,{title:"Display name",desc:"The name shown on your public profile.",keywords:"display name profile"},{default:Ce(()=>[oe(r("input",{"onUpdate:modelValue":f[41]||(f[41]=k=>$e(we).displayName=k),class:"field w-56",placeholder:"Jane O.",onBlur:f[42]||(f[42]=k=>Qe("Saved."))},null,544),[[xe,$e(we).displayName]])]),_:1}),z(Me,{block:"",title:"Bio",desc:"A short description others can see.",keywords:"bio about description"},{default:Ce(()=>[oe(r("textarea",{"onUpdate:modelValue":f[43]||(f[43]=k=>$e(we).bio=k),rows:"3",maxlength:"240",class:"field w-full resize-none",placeholder:"Flight director, North yard operations…",onBlur:f[44]||(f[44]=k=>Qe("Saved."))},null,544),[[xe,$e(we).bio]]),r("div",o_,S(($e(we).bio||"").length)+"/240",1)]),_:1}),z(Me,{title:"Show email on profile",desc:"Let teammates see your email address.",keywords:"show email public visibility"},{default:Ce(()=>[z(sn,{modelValue:$e(we).showEmail,"onUpdate:modelValue":f[45]||(f[45]=k=>$e(we).showEmail=k)},null,8,["modelValue"])]),_:1})])):q.id==="security"?(p(),g("div",a_,[z(Me,{block:"",title:"Two-factor authentication",desc:"Require a one-time code at sign-in.",keywords:"two factor 2fa authentication security"},{default:Ce(()=>[r("div",r_,[r("span",{class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",$e(we).twoFactor?"bg-success-soft text-success-fg":"bg-surface-2 text-ink-secondary"])},[f[114]||(f[114]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(S($e(we).twoFactor?"Enabled":"Disabled"),1)],2),!$e(we).twoFactor&&!bi.value?(p(),g("button",{key:0,class:"btn-accent",onClick:Va},"Enable 2FA")):$e(we).twoFactor?(p(),g("button",{key:1,class:"btn-ghost",onClick:Ua},"Disable")):R("",!0)]),bi.value?(p(),g("div",l_,[r("div",u_,[f[116]||(f[116]=r("div",{class:"grid h-28 w-28 place-items-center rounded bg-white p-2"},[r("svg",{viewBox:"0 0 100 100",class:"h-full w-full"},[r("rect",{width:"100",height:"100",fill:"#fff"}),r("g",{fill:"#0F1E3D"},[r("rect",{x:"6",y:"6",width:"24",height:"24"}),r("rect",{x:"70",y:"6",width:"24",height:"24"}),r("rect",{x:"6",y:"70",width:"24",height:"24"}),r("rect",{x:"12",y:"12",width:"12",height:"12",fill:"#fff"}),r("rect",{x:"76",y:"12",width:"12",height:"12",fill:"#fff"}),r("rect",{x:"12",y:"76",width:"12",height:"12",fill:"#fff"}),r("rect",{x:"40",y:"10",width:"8",height:"8"}),r("rect",{x:"52",y:"20",width:"8",height:"8"}),r("rect",{x:"40",y:"40",width:"8",height:"8"}),r("rect",{x:"60",y:"44",width:"8",height:"8"}),r("rect",{x:"44",y:"60",width:"8",height:"8"}),r("rect",{x:"70",y:"60",width:"8",height:"8"}),r("rect",{x:"80",y:"72",width:"8",height:"8"}),r("rect",{x:"60",y:"80",width:"8",height:"8"})])])],-1)),r("div",c_,[f[115]||(f[115]=r("div",{class:"text-xs text-ink-secondary"},"Scan with an authenticator app, or enter this secret:",-1)),r("div",d_,S(Zo.value),1),r("div",f_,[oe(r("input",{"onUpdate:modelValue":f[46]||(f[46]=k=>xi.value=k),inputmode:"numeric",maxlength:"6",class:"field w-28 font-mono tracking-[0.3em]",placeholder:"000000"},null,512),[[xe,xi.value]]),r("button",{class:"btn-accent",onClick:no},"Verify & enable")]),Bi.value?(p(),g("p",h_,S(Bi.value),1)):R("",!0)])])])):R("",!0),$e(we).twoFactor&&Vi.value.length?(p(),g("div",p_,[f[117]||(f[117]=r("div",{class:"text-xs font-semibold text-ink"},"Recovery codes",-1)),f[118]||(f[118]=r("div",{class:"mt-0.5 text-xs text-ink-muted"},"Store these somewhere safe — each works once.",-1)),r("div",m_,[(p(!0),g(re,null,Be(Vi.value,k=>(p(),g("span",{key:k,class:"select-all"},S(k),1))),128))])])):R("",!0),f[119]||(f[119]=r("p",{class:"mt-2 text-xs text-ink-muted"},"Prototype — codes are generated locally until the account service verifies them.",-1))]),_:1}),z(Me,{block:"",title:"Active sessions",desc:"Devices currently signed in to your account.",keywords:"sessions devices logout sign out remote"},{default:Ce(()=>[r("div",g_,[r("div",v_,[r("div",__,[z(X,{name:"monitor",size:18})]),r("div",y_,[r("div",b_,[D(S(Za())+" on "+S(Ho())+" ",1),f[120]||(f[120]=r("span",{class:"ml-1 rounded-full bg-success-soft px-2 py-0.5 text-[10px] font-semibold text-success-fg"},"This device",-1))]),r("div",x_,"Signed in "+S($e(cu)($e($n))),1)]),r("button",{class:"btn-ghost",onClick:f[47]||(f[47]=k=>l("logout"))},"Log out")])]),f[121]||(f[121]=r("button",{class:"btn-ghost mt-2 opacity-60",disabled:"",title:"Requires the account service"}," Log out all other devices ",-1)),f[122]||(f[122]=r("p",{class:"mt-2 text-xs text-ink-muted"}," Only this session is visible from the browser; enumerating and revoking remote sessions needs the account service. ",-1))]),_:1})])):q.id==="team"?(p(),g("div",w_,[qe.id?(p(),g("div",k_,[z(Me,{block:"",title:`Edit user — ${qe.email}`,desc:"Update details, change role, reset password, or set verified.",keywords:"edit user update role password verified organization"},{default:Ce(()=>[r("div",S_,[r("div",T_,[oe(r("input",{"onUpdate:modelValue":f[48]||(f[48]=k=>qe.email=k),type:"email",class:"field flex-1",placeholder:"name@pilotvault.local"},null,512),[[xe,qe.email]]),oe(r("select",{"onUpdate:modelValue":f[49]||(f[49]=k=>qe.role=k),class:"field w-32",disabled:xs.value,title:xs.value?"You cannot change your own role":""},[(p(!0),g(re,null,Be(jo.value,k=>(p(),g("option",{key:k.value,value:k.value},S(k.label),9,C_))),128))],8,P_),[[Et,qe.role]])]),u.value?oe((p(),g("select",{key:0,"onUpdate:modelValue":f[50]||(f[50]=k=>qe.organization=k),class:"field",title:"Organization"},[(p(!0),g(re,null,Be(io.value,k=>(p(),g("option",{key:k.value,value:k.value},S(k.label),9,L_))),128))],512)),[[Et,qe.organization]]):R("",!0),oe(r("input",{"onUpdate:modelValue":f[51]||(f[51]=k=>qe.password=k),type:"password",class:"field",placeholder:"New password (leave blank to keep current)"},null,512),[[xe,qe.password]]),r("label",M_,[z(sn,{modelValue:qe.verified,"onUpdate:modelValue":f[52]||(f[52]=k=>qe.verified=k)},null,8,["modelValue"]),f[123]||(f[123]=D(" Email verified ",-1))]),r("div",E_,[r("button",{class:"btn-accent",disabled:Wi.value,onClick:so},S(Wi.value?"Saving…":"Save changes"),9,O_),r("button",{class:"btn-ghost",onClick:ws},"Cancel"),Pt.value?(p(),g("span",z_,S(Pt.value),1)):R("",!0),xs.value?(p(),g("span",A_,"Editing your own account — role locked.")):R("",!0)])])]),_:1},8,["title"])])):(p(),g("div",$_,[z(Me,{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:Ce(()=>[r("div",I_,[r("div",D_,[oe(r("input",{"onUpdate:modelValue":f[53]||(f[53]=k=>Ot.email=k),type:"email",class:"field flex-1",placeholder:"name@pilotvault.local"},null,512),[[xe,Ot.email]]),oe(r("select",{"onUpdate:modelValue":f[54]||(f[54]=k=>Ot.role=k),class:"field w-32"},[(p(!0),g(re,null,Be(jo.value,k=>(p(),g("option",{key:k.value,value:k.value},S(k.label),9,N_))),128))],512),[[Et,Ot.role]])]),u.value?oe((p(),g("select",{key:0,"onUpdate:modelValue":f[55]||(f[55]=k=>Ot.organization=k),class:"field",title:"Organization"},[(p(!0),g(re,null,Be(io.value,k=>(p(),g("option",{key:k.value,value:k.value},S(k.label),9,R_))),128))],512)),[[Et,Ot.organization]]):(p(),g("div",F_,[f[124]||(f[124]=D(" New users join your organization: ",-1)),r("span",B_,S(t.organizationName||"—"),1)])),oe(r("input",{"onUpdate:modelValue":f[56]||(f[56]=k=>Ot.password=k),type:"password",class:"field",placeholder:"Temporary password (min 8 chars)"},null,512),[[xe,Ot.password]]),r("div",V_,[r("button",{class:"btn-accent",disabled:Zi.value,onClick:ei},S(Zi.value?"Creating…":"Create user"),9,U_),Jn.value?(p(),g("span",Z_,S(Jn.value),1)):R("",!0)])])]),_:1})])),r("div",H_,[r("div",j_,[f[125]||(f[125]=r("div",null,[r("div",{class:"eyebrow"},"Team"),r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"All users")],-1)),r("button",{class:"btn-ghost",disabled:wi.value,onClick:Xn},S(wi.value?"Loading…":"Refresh"),9,W_)]),ki.value?(p(),g("div",K_,S(ki.value),1)):!Ui.value.length&&!wi.value?(p(),g("div",G_,"No users yet.")):(p(),g("div",q_,[r("table",Y_,[r("thead",null,[r("tr",J_,[(p(),g(re,null,Be(["User","Role","Organization","Status",""],k=>r("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"},S(k),1)),64))])]),r("tbody",null,[(p(!0),g(re,null,Be(Ui.value,k=>(p(),g("tr",{key:k.id,class:Ee(["border-b border-line last:border-0",qe.id===k.id?"bg-accent-soft":""])},[r("td",X_,[r("span",Q_,S(k.email),1),k.email===t.email?(p(),g("span",ey,"(you)")):R("",!0)]),r("td",ty,[r("span",{class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",y(k.role||"user")])},[z(X,{name:v(k.role||"user"),size:12},null,8,["name"]),D(S(h(k.role||"user")),1)],2)]),r("td",ny,[r("span",{class:Ee(["text-sm",k.organizationName?"text-ink-secondary":"text-ink-muted"])},S(k.organizationName||"—"),3)]),r("td",iy,[r("span",{class:Ee(["text-xs",k.verified?"text-success-fg":"text-ink-muted"])},S(k.verified?"Verified":"Unverified"),3)]),r("td",sy,[Hi.value===k.id?(p(),g(re,{key:0},[f[126]||(f[126]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Remove?",-1)),r("button",{class:"btn-ghost mr-1",onClick:f[57]||(f[57]=Ke=>Hi.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:Ke=>Ha(k)}," Remove ",8,oy)],64)):(p(),g("div",ay,[r("button",{class:"btn-ghost inline-flex items-center gap-1.5",onClick:Ke=>ja(k)},[z(X,{name:"settings",size:14}),f[127]||(f[127]=D(" Edit ",-1))],8,ry),k.email!==t.email?(p(),g("button",{key:0,class:"btn-ghost inline-flex items-center gap-1.5",onClick:Ke=>Hi.value=k.id},[z(X,{name:"trash",size:14}),f[128]||(f[128]=D(" Remove ",-1))],8,ly)):R("",!0)]))])],2))),128))])])]))])])):q.id==="organizations"?(p(),g("div",uy,[Ct.id?(p(),g("div",cy,[z(Me,{block:"",title:"Rename organization",desc:"Update the organization's display name.",keywords:"rename organization edit"},{default:Ce(()=>[r("div",dy,[oe(r("input",{"onUpdate:modelValue":f[58]||(f[58]=k=>Ct.name=k),class:"field",placeholder:"Organization name",onKeyup:tu(Wo,["enter"])},null,544),[[xe,Ct.name]]),r("div",fy,[r("button",{class:"btn-accent",onClick:Wo},"Save changes"),r("button",{class:"btn-ghost",onClick:ti},"Cancel"),tn.value?(p(),g("span",hy,S(tn.value),1)):R("",!0)])])]),_:1})])):(p(),g("div",py,[z(Me,{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:Ce(()=>[r("div",my,[oe(r("input",{"onUpdate:modelValue":f[59]||(f[59]=k=>ks.name=k),class:"field",placeholder:"e.g. Northwind Aerial",onKeyup:tu(vn,["enter"])},null,544),[[xe,ks.name]]),r("div",gy,[r("button",{class:"btn-accent",disabled:Gi.value,onClick:vn},S(Gi.value?"Creating…":"Create organization"),9,vy),Ki.value?(p(),g("span",_y,S(Ki.value),1)):R("",!0)])])]),_:1})])),r("div",yy,[r("div",{class:"flex items-center justify-between px-5 py-4"},[f[129]||(f[129]=r("div",null,[r("div",{class:"eyebrow"},"Tenancy"),r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"All organizations")],-1)),r("button",{class:"btn-ghost",onClick:ji},"Refresh")]),Si.value.length?(p(),g("div",xy,[r("table",wy,[r("thead",null,[r("tr",ky,[(p(),g(re,null,Be(["Organization","Members",""],k=>r("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"},S(k),1)),64))])]),r("tbody",null,[(p(!0),g(re,null,Be(Si.value,k=>(p(),g("tr",{key:k.id,class:Ee(["border-b border-line last:border-0",Ct.id===k.id?"bg-accent-soft":""])},[r("td",Sy,[r("span",Ty,[z(X,{name:"grid",size:14,class:"text-ink-muted"}),D(S(k.name),1)])]),r("td",Py,S(oo.value[k.id]||0),1),r("td",Cy,[qi.value===k.id?(p(),g(re,{key:0},[f[130]||(f[130]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),r("button",{class:"btn-ghost mr-1",onClick:f[60]||(f[60]=Ke=>qi.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:Ke=>Yi(k)}," Delete ",8,Ly)],64)):(p(),g("div",My,[r("button",{class:"btn-ghost inline-flex items-center gap-1.5",onClick:Ke=>Wa(k)},[z(X,{name:"settings",size:14}),f[131]||(f[131]=D(" Rename ",-1))],8,Ey),r("button",{class:"btn-ghost inline-flex items-center gap-1.5",disabled:(oo.value[k.id]||0)>0,title:(oo.value[k.id]||0)>0?"Reassign or remove members first":"",onClick:Ke=>qi.value=k.id},[z(X,{name:"trash",size:14}),f[132]||(f[132]=D(" Delete ",-1))],8,Oy)]))])],2))),128))])])])):(p(),g("div",by,"No organizations yet."))])])):q.id==="advanced"?(p(),g("div",zy,[r("div",Ay,[z(Me,{title:"Export data",desc:"Download your settings and profile as JSON.",keywords:"export data download backup"},{default:Ce(()=>[r("button",{class:"btn-ghost",onClick:Ko},[z(X,{name:"download",size:15,class:"mr-1.5 inline"}),f[133]||(f[133]=D("Export",-1))])]),_:1}),z(Me,{block:"",title:"Import data",desc:"Restore settings from a previous export.",keywords:"import data upload restore"},{default:Ce(()=>[r("label",$y,[z(X,{name:"upload",size:15,class:"mr-1.5 inline"}),f[134]||(f[134]=D("Choose file… ",-1)),r("input",{type:"file",accept:"application/json,.json",class:"hidden",onChange:Ka},null,32)]),ni.value?(p(),g("p",Iy,S(ni.value),1)):R("",!0)]),_:1})]),r("div",Dy,[r("div",Ny,[z(X,{name:"alertTriangle",size:18}),f[135]||(f[135]=r("h3",{class:"text-sm font-bold uppercase tracking-caps"},"Danger zone",-1))]),f[140]||(f[140]=r("p",{class:"mt-1 text-xs text-ink-secondary"},"Deleting your account is permanent and cannot be undone.",-1)),r("div",Ry,[f[139]||(f[139]=r("div",{class:"text-sm font-semibold text-ink"},"Delete account",-1)),r("label",Fy,[oe(r("input",{"onUpdate:modelValue":f[61]||(f[61]=k=>st.understand=k),type:"checkbox",class:"mt-0.5 h-4 w-4 accent-[var(--danger)]"},null,512),[[ya,st.understand]]),f[136]||(f[136]=D(" I understand this permanently deletes my account and all associated data. ",-1))]),r("div",By,[r("label",Vy,[f[137]||(f[137]=D("Type ",-1)),r("span",Uy,S(ao.value),1),f[138]||(f[138]=D(" to confirm",-1))]),oe(r("input",{"onUpdate:modelValue":f[62]||(f[62]=k=>st.typed=k),class:"field w-full max-w-[360px] font-mono",placeholder:ao.value},null,8,Zy),[[xe,st.typed]])]),r("div",Hy,[st.armed?(p(),g("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:st.cooldown>0,onClick:Tn},S(st.cooldown>0?`Confirm in ${st.cooldown}s…`:"Permanently delete account"),9,Wy)):(p(),g("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:!Ji.value,onClick:Ga}," Delete account… ",8,jy)),st.armed&&st.cooldown>0?(p(),g("span",Ky,"Cooling-off period — read once more.")):R("",!0)]),st.msg?(p(),g("p",Gy,S(st.msg),1)):R("",!0)])])])):R("",!0)],64))),128))])]),z(hh,{name:"fade"},{default:Ce(()=>[gn.value?(p(),g("div",qy,[z(X,{name:"check",size:16,class:"text-success-fg"}),D(S(gn.value),1)])):R("",!0)]),_:1})]))}},Jy=dm(Yy,[["__scopeId","data-v-2b0c86a6"]]),Xy={class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},Qy={class:"flex flex-wrap items-center gap-3"},e1={class:"inline-flex rounded-lg border border-line bg-surface-1 p-0.5"},t1=["onClick"],n1={class:"ml-auto flex items-center gap-2"},i1=["href"],s1={class:"grid grid-cols-4 gap-4 max-[900px]:grid-cols-2"},o1={class:"eyebrow"},a1={key:0,class:"panel border-danger/40 p-4 text-sm text-danger-fg"},r1={key:0,class:"panel p-5"},l1={class:"mb-4 flex items-center justify-between"},u1={class:"eyebrow"},c1={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},d1={class:"block"},f1={class:"block"},h1={class:"block"},p1={class:"block"},m1={key:0,value:""},g1=["value"],v1={class:"block"},_1={class:"block"},y1={class:"block"},b1={class:"block"},x1={class:"block"},w1=["value"],k1={class:"block"},S1=["value"],T1={class:"block"},P1=["value"],C1={class:"block"},L1={class:"mt-3 block"},M1={key:0,class:"mt-3 grid grid-cols-2 gap-3 max-[760px]:grid-cols-1"},E1={class:"block"},O1={class:"block"},z1={class:"block"},A1={class:"block"},$1={class:"col-span-2 block max-[760px]:col-span-1"},I1={class:"mt-4 flex items-center gap-3"},D1=["disabled"],N1={key:0,class:"text-sm text-danger-fg"},R1={class:"panel overflow-hidden p-0"},F1={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},B1={key:1,class:"grid place-items-center px-5 py-16 text-center"},V1={key:2,class:"overflow-x-auto"},U1={class:"w-full border-collapse text-sm"},Z1={class:"text-left"},H1={class:"whitespace-nowrap px-5 py-3 font-mono text-ink"},j1={key:0,class:"text-ink-muted"},W1={class:"px-5 py-3 text-ink-secondary"},K1=["title"],G1={class:"px-5 py-3 font-mono text-ink-secondary"},q1={class:"px-5 py-3 text-ink-secondary"},Y1={class:"px-5 py-3"},J1=["onClick"],X1={class:"whitespace-nowrap px-5 py-3 text-right"},Q1=["onClick"],eb=["onClick"],tb=["onClick"],nb={key:0,class:"border-b border-line bg-surface-2"},ib={colspan:"7",class:"px-5 py-3"},sb={class:"flex flex-wrap gap-x-8 gap-y-1.5 text-xs"},ob={class:"text-ink-secondary"},ab={class:"text-ink"},rb={class:"text-ink-secondary"},lb={class:"text-ink"},ub={class:"text-ink-secondary"},cb={class:"font-mono text-ink"},db={key:0,class:"text-ink-secondary"},fb={class:"text-ink"},hb={key:0,class:"mt-2 space-y-1"},pb={key:1,class:"mt-2 text-xs text-success-fg"},mb={key:0,class:"panel p-5"},gb={class:"mb-4 flex items-center justify-between"},vb={class:"eyebrow"},_b={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},yb={class:"block"},bb={class:"block"},xb={class:"block"},wb={class:"block"},kb={class:"block"},Sb={class:"block"},Tb=["value"],Pb={class:"mt-3 flex flex-wrap gap-6"},Cb={class:"flex items-center gap-2 text-sm text-ink-secondary"},Lb={class:"flex items-center gap-2 text-sm text-ink-secondary"},Mb={class:"mt-4 flex items-center gap-3"},Eb=["disabled"],Ob={key:0,class:"text-sm text-danger-fg"},zb={class:"panel overflow-hidden p-0"},Ab={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},$b={key:1,class:"grid place-items-center px-5 py-16 text-center"},Ib={key:2,class:"overflow-x-auto"},Db={class:"w-full border-collapse text-sm"},Nb={class:"text-left"},Rb={class:"px-5 py-3 font-semibold text-ink"},Fb={class:"px-5 py-3 text-ink-secondary"},Bb={class:"px-5 py-3 font-mono text-ink-secondary"},Vb={class:"px-5 py-3"},Ub={key:1,class:"text-ink-muted"},Zb={class:"px-5 py-3"},Hb={class:"whitespace-nowrap px-5 py-3 text-right"},jb=["onClick"],Wb=["onClick"],Kb=["onClick"],Gb={__name:"Logbook",props:{email:{type:String,default:""},role:{type:String,default:"user"},organization:{type:String,default:""},organizationName:{type:String,default:""}},setup(t){const i=t,o={success:"bg-success-soft text-success-fg",warning:"bg-amber-soft text-amber-fg",danger:"bg-danger-soft text-danger-fg",accent:"bg-accent-soft text-accent-soft-fg",neutral:"bg-surface-2 text-ink-secondary"},l=j("flights"),u=j([]),d=j([]),h=j(!1),v=j("");async function y(){h.value=!0,v.value="";const[W,E]=await Promise.all([Nc(),xp()]);(!W.ok||!E.ok)&&(v.value=W.status===503||E.status===503?"Logbook storage is not configured on the API Server (service account missing).":"Could not load the logbook."),u.value=W.drones,d.value=E.flights,h.value=!1}fi(y);function C(W){const E=W.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=j("");function O(W){T.value=T.value===W?"":W}const B=[{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"}],H=[{value:"",label:"Auto (from drone)"},{value:"manual",label:"Manual"},{value:"automatic",label:"Automatic (FDR)"}];function F(){var W;return{operationDate:new Date().toISOString().slice(0,10),startTime:"",endTime:"",drone:((W=u.value[0])==null?void 0:W.id)||"",areaRoute:"",maxAltitudeAgl:"",pilotName:i.email,certificateRef:"",category:"open",purpose:"commercial",loggingPath:"",rawFdrLogUrl:"",authorisationRef:"",weather:"",airspaceRef:"",observer:"",incidents:"",notes:""}}const fe=j(!1),ve=j(""),Y=bt(F()),Pe=j(""),he=j(!1),ye=j(!1);function Ne(){Object.assign(Y,F()),ve.value="",Pe.value="",ye.value=!1,fe.value=!0}function Ie(W){Object.assign(Y,{operationDate:(W.operationDate||"").slice(0,10),startTime:W.startTime||"",endTime:W.endTime||"",drone:W.drone||"",areaRoute:W.areaRoute||"",maxAltitudeAgl:W.maxAltitudeAgl||"",pilotName:W.pilotName||"",certificateRef:W.certificateRef||"",category:W.category||"open",purpose:W.purpose||"commercial",loggingPath:W.loggingPath||"",rawFdrLogUrl:W.rawFdrLogUrl||"",authorisationRef:W.authorisationRef||"",weather:W.weather||"",airspaceRef:W.airspaceRef||"",observer:W.observer||"",incidents:W.incidents||"",notes:W.notes||""}),ve.value=W.id,Pe.value="",ye.value=!!(W.weather||W.airspaceRef||W.observer||W.incidents||W.notes),fe.value=!0}function Ve(){fe.value=!1,ve.value=""}async function pe(){var A;if(Pe.value="",!Y.drone){Pe.value="Select a drone first (add one on the Drones tab).";return}he.value=!0;const W={...Y,maxAltitudeAgl:Number(Y.maxAltitudeAgl)||0},E=ve.value?await kp(ve.value,W):await wp(W);if(he.value=!1,!E.ok){Pe.value=((A=E.body)==null?void 0:A.error)||"Could not save the flight.";return}fe.value=!1,await y()}const ze=j("");async function Te(W){const E=await Sp(W.id);ze.value="",E.ok&&await y()}const te=["","C0","C1","C2","C3","C4","C5","C6"];function de(){return{name:"",model:"",serial:"",operatorNumber:"",mtomGrams:"",isToy:!1,autologsFlights:!1,cClass:""}}const _e=j(!1),be=j(""),ae=bt(de()),le=j(""),ie=j(!1);function rt(){Object.assign(ae,de()),be.value="",le.value="",_e.value=!0}function me(W){Object.assign(ae,{name:W.name||"",model:W.model||"",serial:W.serial||"",operatorNumber:W.operatorNumber||"",mtomGrams:W.mtomGrams||"",isToy:!!W.isToy,autologsFlights:!!W.autologsFlights,cClass:W.cClass||""}),be.value=W.id,le.value="",_e.value=!0}function Oe(){_e.value=!1,be.value=""}async function Xe(){var A;if(le.value="",!ae.name.trim()){le.value="Give the drone a name.";return}ie.value=!0;const W={...ae,mtomGrams:Number(ae.mtomGrams)||0},E=be.value?await yp(be.value,W):await _p(W);if(ie.value=!1,!E.ok){le.value=((A=E.body)==null?void 0:A.error)||"Could not save the drone.";return}_e.value=!1,await y()}const ut=j("");async function et(W){var A;const E=await bp(W.id);ut.value="",E.ok?await y():le.value=((A=E.body)==null?void 0:A.error)||"Could not delete the drone."}const Ue=ke(()=>{const W=d.value.length,E=d.value.filter(it=>{var vt;return(((vt=it.compliance)==null?void 0:vt.redFlags)||[]).length}).length,A=d.value.filter(it=>{var vt;return(vt=it.compliance)==null?void 0:vt.required}).length;return{total:W,flagged:E,required:A,fleet:u.value.length}});return(W,E)=>(p(),g("div",Xy,[r("div",Qy,[r("div",e1,[(p(),g(re,null,Be([["flights","Flights"],["drones","Drones"]],A=>r("button",{key:A[0],class:Ee(["rounded-md px-3.5 py-1.5 text-sm font-semibold transition",l.value===A[0]?"bg-accent-soft text-accent-soft-fg":"text-ink-secondary hover:text-ink"]),onClick:it=>l.value=A[0]},S(A[1]),11,t1)),64))]),r("div",n1,[r("a",{href:$e(Tp)(),class:"btn-ghost inline-flex items-center gap-2",title:"Download a compliance CSV (Trafikstyrelsen / police disclosure)"},[z(X,{name:"download",size:15}),E[29]||(E[29]=D(" Export CSV ",-1))],8,i1),l.value==="flights"?(p(),g("button",{key:0,class:"btn-accent inline-flex items-center gap-2",onClick:Ne},[z(X,{name:"plus",size:15}),E[30]||(E[30]=D(" Log flight ",-1))])):(p(),g("button",{key:1,class:"btn-accent inline-flex items-center gap-2",onClick:rt},[z(X,{name:"plus",size:15}),E[31]||(E[31]=D(" Add drone ",-1))]))])]),r("div",s1,[(p(!0),g(re,null,Be([{label:"Flights logged",value:Ue.value.total,tone:"neutral"},{label:"Require logbook",value:Ue.value.required,tone:"neutral"},{label:"Compliance flags",value:Ue.value.flagged,tone:Ue.value.flagged?"danger":"success"},{label:"Registered drones",value:Ue.value.fleet,tone:"neutral"}],A=>(p(),g("div",{key:A.label,class:"panel p-5"},[r("div",o1,S(A.label),1),r("div",{class:Ee(["mt-2 text-[30px] font-bold leading-none tracking-tightest",A.tone==="danger"?"text-danger-fg":A.tone==="success"?"text-success-fg":"text-ink"])},S(A.value),3)]))),128))]),v.value?(p(),g("div",a1,S(v.value),1)):R("",!0),l.value==="flights"?(p(),g(re,{key:1},[fe.value?(p(),g("div",r1,[r("div",l1,[r("div",null,[r("div",u1,S(ve.value?"Edit entry":"New entry"),1),E[32]||(E[32]=r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Logbook flight (BEK 1649 §5)",-1))]),r("button",{class:"btn-icon",onClick:Ve},[z(X,{name:"x",size:16})])]),r("div",c1,[r("label",d1,[E[33]||(E[33]=r("span",{class:"eyebrow mb-1 block"},"Date",-1)),oe(r("input",{"onUpdate:modelValue":E[0]||(E[0]=A=>Y.operationDate=A),type:"date",class:"field"},null,512),[[xe,Y.operationDate]])]),r("label",f1,[E[34]||(E[34]=r("span",{class:"eyebrow mb-1 block"},"Start",-1)),oe(r("input",{"onUpdate:modelValue":E[1]||(E[1]=A=>Y.startTime=A),type:"time",class:"field"},null,512),[[xe,Y.startTime]])]),r("label",h1,[E[35]||(E[35]=r("span",{class:"eyebrow mb-1 block"},"End",-1)),oe(r("input",{"onUpdate:modelValue":E[2]||(E[2]=A=>Y.endTime=A),type:"time",class:"field"},null,512),[[xe,Y.endTime]])]),r("label",p1,[E[36]||(E[36]=r("span",{class:"eyebrow mb-1 block"},"Drone",-1)),oe(r("select",{"onUpdate:modelValue":E[3]||(E[3]=A=>Y.drone=A),class:"field"},[u.value.length?R("",!0):(p(),g("option",m1,"— add a drone first —")),(p(!0),g(re,null,Be(u.value,A=>(p(),g("option",{key:A.id,value:A.id},S(A.name)+S(A.model?` · ${A.model}`:""),9,g1))),128))],512),[[Et,Y.drone]])]),r("label",v1,[E[37]||(E[37]=r("span",{class:"eyebrow mb-1 block"},"Max altitude (m AGL)",-1)),oe(r("input",{"onUpdate:modelValue":E[4]||(E[4]=A=>Y.maxAltitudeAgl=A),type:"number",min:"0",class:"field",placeholder:"120"},null,512),[[xe,Y.maxAltitudeAgl]])]),r("label",_1,[E[38]||(E[38]=r("span",{class:"eyebrow mb-1 block"},"Area / route",-1)),oe(r("input",{"onUpdate:modelValue":E[5]||(E[5]=A=>Y.areaRoute=A),class:"field",placeholder:"Field N of Roskilde, grid survey"},null,512),[[xe,Y.areaRoute]])]),r("label",y1,[E[39]||(E[39]=r("span",{class:"eyebrow mb-1 block"},"Remote pilot name",-1)),oe(r("input",{"onUpdate:modelValue":E[6]||(E[6]=A=>Y.pilotName=A),class:"field",placeholder:"Full name"},null,512),[[xe,Y.pilotName]])]),r("label",b1,[E[40]||(E[40]=r("span",{class:"eyebrow mb-1 block"},"Certificate ref",-1)),oe(r("input",{"onUpdate:modelValue":E[7]||(E[7]=A=>Y.certificateRef=A),class:"field",placeholder:"A2 / STS cert no."},null,512),[[xe,Y.certificateRef]])]),r("label",x1,[E[41]||(E[41]=r("span",{class:"eyebrow mb-1 block"},"Logging path",-1)),oe(r("select",{"onUpdate:modelValue":E[8]||(E[8]=A=>Y.loggingPath=A),class:"field"},[(p(),g(re,null,Be(H,A=>r("option",{key:A.value,value:A.value},S(A.label),9,w1)),64))],512),[[Et,Y.loggingPath]])]),r("label",k1,[E[42]||(E[42]=r("span",{class:"eyebrow mb-1 block"},"Category",-1)),oe(r("select",{"onUpdate:modelValue":E[9]||(E[9]=A=>Y.category=A),class:"field"},[(p(),g(re,null,Be(B,A=>r("option",{key:A.value,value:A.value},S(A.label),9,S1)),64))],512),[[Et,Y.category]])]),r("label",T1,[E[43]||(E[43]=r("span",{class:"eyebrow mb-1 block"},"Purpose",-1)),oe(r("select",{"onUpdate:modelValue":E[10]||(E[10]=A=>Y.purpose=A),class:"field"},[(p(),g(re,null,Be(V,A=>r("option",{key:A.value,value:A.value},S(A.label),9,P1)),64))],512),[[Et,Y.purpose]])]),r("label",C1,[E[44]||(E[44]=r("span",{class:"eyebrow mb-1 block"},"Authorisation ref",-1)),oe(r("input",{"onUpdate:modelValue":E[11]||(E[11]=A=>Y.authorisationRef=A),class:"field",placeholder:"Specific-category ref"},null,512),[[xe,Y.authorisationRef]])])]),r("label",L1,[E[45]||(E[45]=r("span",{class:"eyebrow mb-1 block"},"FDR log URL (automatic path)",-1)),oe(r("input",{"onUpdate:modelValue":E[12]||(E[12]=A=>Y.rawFdrLogUrl=A),class:"field",placeholder:"Link to the stored flight-data-recorder export"},null,512),[[xe,Y.rawFdrLogUrl]])]),r("button",{class:"mt-4 flex items-center gap-1.5 text-sm font-semibold text-accent",onClick:E[13]||(E[13]=A=>ye.value=!ye.value)},[z(X,{name:ye.value?"x":"plus",size:14},null,8,["name"]),E[46]||(E[46]=D(" Operational details (weather, airspace, incidents) ",-1))]),ye.value?(p(),g("div",M1,[r("label",E1,[E[47]||(E[47]=r("span",{class:"eyebrow mb-1 block"},"Weather / wind",-1)),oe(r("input",{"onUpdate:modelValue":E[14]||(E[14]=A=>Y.weather=A),class:"field",placeholder:"6 m/s NW, CAVOK"},null,512),[[xe,Y.weather]])]),r("label",O1,[E[48]||(E[48]=r("span",{class:"eyebrow mb-1 block"},"Airspace / NOTAM ref",-1)),oe(r("input",{"onUpdate:modelValue":E[15]||(E[15]=A=>Y.airspaceRef=A),class:"field"},null,512),[[xe,Y.airspaceRef]])]),r("label",z1,[E[49]||(E[49]=r("span",{class:"eyebrow mb-1 block"},"Observer",-1)),oe(r("input",{"onUpdate:modelValue":E[16]||(E[16]=A=>Y.observer=A),class:"field"},null,512),[[xe,Y.observer]])]),r("label",A1,[E[50]||(E[50]=r("span",{class:"eyebrow mb-1 block"},"Incidents / anomalies",-1)),oe(r("input",{"onUpdate:modelValue":E[17]||(E[17]=A=>Y.incidents=A),class:"field",placeholder:"RTH trigger, GPS dropout…"},null,512),[[xe,Y.incidents]])]),r("label",$1,[E[51]||(E[51]=r("span",{class:"eyebrow mb-1 block"},"Notes",-1)),oe(r("textarea",{"onUpdate:modelValue":E[18]||(E[18]=A=>Y.notes=A),rows:"2",class:"field"},null,512),[[xe,Y.notes]])])])):R("",!0),r("div",I1,[r("button",{class:"btn-accent",disabled:he.value,onClick:pe},S(he.value?"Saving…":ve.value?"Save changes":"Log flight"),9,D1),r("button",{class:"btn-ghost",onClick:Ve},"Cancel"),Pe.value?(p(),g("span",N1,S(Pe.value),1)):R("",!0)])])):R("",!0),r("div",R1,[h.value?(p(),g("div",F1,"Loading…")):d.value.length?(p(),g("div",V1,[r("table",U1,[r("thead",null,[r("tr",Z1,[(p(),g(re,null,Be(["Date","Drone","Area / route","Alt","Pilot","Compliance",""],A=>r("th",{key:A,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"},S(A),1)),64))])]),r("tbody",null,[(p(!0),g(re,null,Be(d.value,A=>{var it,vt,Lt,b;return p(),g(re,{key:A.id},[r("tr",{class:Ee(["border-b border-line last:border-0",ve.value===A.id?"bg-accent-soft":""])},[r("td",H1,[D(S((A.operationDate||"").slice(0,10))+" ",1),A.startTime?(p(),g("span",j1,S(A.startTime),1)):R("",!0)]),r("td",W1,S(A.droneName||"—"),1),r("td",{class:"max-w-[220px] truncate px-5 py-3 text-ink-secondary",title:A.areaRoute},S(A.areaRoute||"—"),9,K1),r("td",G1,S(A.maxAltitudeAgl?A.maxAltitudeAgl+" m":"—"),1),r("td",q1,S(A.pilotName||"—"),1),r("td",Y1,[r("button",{class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",o[C(A).tone]]),onClick:_=>O(A.id)},[C(A).tone==="danger"?(p(),at(X,{key:0,name:"alertTriangle",size:12})):C(A).tone==="success"?(p(),at(X,{key:1,name:"check",size:12})):R("",!0),D(" "+S(C(A).label),1)],10,J1)]),r("td",X1,[ze.value===A.id?(p(),g(re,{key:0},[E[54]||(E[54]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),r("button",{class:"btn-ghost mr-1",onClick:E[19]||(E[19]=_=>ze.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:_=>Te(A)},"Delete",8,Q1)],64)):(p(),g(re,{key:1},[r("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:_=>Ie(A)},[z(X,{name:"sliders",size:13}),E[55]||(E[55]=D(" Edit",-1))],8,eb),r("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:_=>ze.value=A.id},[z(X,{name:"trash",size:13})],8,tb)],64))])],2),T.value===A.id?(p(),g("tr",nb,[r("td",ib,[r("div",sb,[r("span",ob,[E[56]||(E[56]=D("Logging path: ",-1)),r("b",ab,S(((it=A.compliance)==null?void 0:it.loggingPath)||"—"),1)]),r("span",rb,[E[57]||(E[57]=D("Category: ",-1)),r("b",lb,S(A.category||"—"),1)]),r("span",ub,[E[58]||(E[58]=D("Retain until: ",-1)),r("b",cb,S((A.retentionUntil||"").slice(0,10)||"—"),1)]),(vt=A.compliance)!=null&&vt.exempt?(p(),g("span",db,[E[59]||(E[59]=D("Exempt: ",-1)),r("b",fb,S(A.compliance.exemptReason),1)])):R("",!0)]),(((Lt=A.compliance)==null?void 0:Lt.redFlags)||[]).length?(p(),g("ul",hb,[(p(!0),g(re,null,Be(A.compliance.redFlags,(_,w)=>(p(),g("li",{key:w,class:"flex items-start gap-2 text-xs text-danger-fg"},[z(X,{name:"alertTriangle",size:13,class:"mt-px shrink-0"}),D(" "+S(_),1)]))),128))])):(b=A.compliance)!=null&&b.exempt?R("",!0):(p(),g("div",pb,"No compliance gaps detected."))])])):R("",!0)],64)}),128))])])])):(p(),g("div",B1,[z(X,{name:"book",size:26,class:"text-ink-muted"}),E[52]||(E[52]=r("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No flights logged yet",-1)),E[53]||(E[53]=r("div",{class:"mt-1 text-xs text-ink-muted"},"Log your first operation to start the 5-year retention record.",-1))]))])],64)):(p(),g(re,{key:2},[_e.value?(p(),g("div",mb,[r("div",gb,[r("div",null,[r("div",vb,S(be.value?"Edit drone":"New drone"),1),E[60]||(E[60]=r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Aircraft registry",-1))]),r("button",{class:"btn-icon",onClick:Oe},[z(X,{name:"x",size:16})])]),r("div",_b,[r("label",yb,[E[61]||(E[61]=r("span",{class:"eyebrow mb-1 block"},"Name",-1)),oe(r("input",{"onUpdate:modelValue":E[20]||(E[20]=A=>ae.name=A),class:"field",placeholder:"Mavic-01"},null,512),[[xe,ae.name]])]),r("label",bb,[E[62]||(E[62]=r("span",{class:"eyebrow mb-1 block"},"Model",-1)),oe(r("input",{"onUpdate:modelValue":E[21]||(E[21]=A=>ae.model=A),class:"field",placeholder:"DJI Mavic 3 Enterprise"},null,512),[[xe,ae.model]])]),r("label",xb,[E[63]||(E[63]=r("span",{class:"eyebrow mb-1 block"},"Serial",-1)),oe(r("input",{"onUpdate:modelValue":E[22]||(E[22]=A=>ae.serial=A),class:"field"},null,512),[[xe,ae.serial]])]),r("label",wb,[E[64]||(E[64]=r("span",{class:"eyebrow mb-1 block"},"Operator no.",-1)),oe(r("input",{"onUpdate:modelValue":E[23]||(E[23]=A=>ae.operatorNumber=A),class:"field",placeholder:"DNK…"},null,512),[[xe,ae.operatorNumber]])]),r("label",kb,[E[65]||(E[65]=r("span",{class:"eyebrow mb-1 block"},"MTOM (grams)",-1)),oe(r("input",{"onUpdate:modelValue":E[24]||(E[24]=A=>ae.mtomGrams=A),type:"number",min:"0",class:"field",placeholder:"920"},null,512),[[xe,ae.mtomGrams]])]),r("label",Sb,[E[66]||(E[66]=r("span",{class:"eyebrow mb-1 block"},"C-class",-1)),oe(r("select",{"onUpdate:modelValue":E[25]||(E[25]=A=>ae.cClass=A),class:"field"},[(p(),g(re,null,Be(te,A=>r("option",{key:A,value:A},S(A||"— none —"),9,Tb)),64))],512),[[Et,ae.cClass]])])]),r("div",Pb,[r("label",Cb,[oe(r("input",{"onUpdate:modelValue":E[26]||(E[26]=A=>ae.autologsFlights=A),type:"checkbox",class:"h-4 w-4 accent-[var(--accent)]"},null,512),[[ya,ae.autologsFlights]]),E[67]||(E[67]=D(" Auto-logs flights (onboard FDR) ",-1))]),r("label",Lb,[oe(r("input",{"onUpdate:modelValue":E[27]||(E[27]=A=>ae.isToy=A),type:"checkbox",class:"h-4 w-4 accent-[var(--accent)]"},null,512),[[ya,ae.isToy]]),E[68]||(E[68]=D(" Toy drone (logbook-exempt) ",-1))])]),r("div",Mb,[r("button",{class:"btn-accent",disabled:ie.value,onClick:Xe},S(ie.value?"Saving…":be.value?"Save changes":"Add drone"),9,Eb),r("button",{class:"btn-ghost",onClick:Oe},"Cancel"),le.value?(p(),g("span",Ob,S(le.value),1)):R("",!0)])])):R("",!0),r("div",zb,[h.value?(p(),g("div",Ab,"Loading…")):u.value.length?(p(),g("div",Ib,[r("table",Db,[r("thead",null,[r("tr",Nb,[(p(),g(re,null,Be(["Name","Model","MTOM","Class","FDR",""],A=>r("th",{key:A,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"},S(A),1)),64))])]),r("tbody",null,[(p(!0),g(re,null,Be(u.value,A=>(p(),g("tr",{key:A.id,class:Ee(["border-b border-line last:border-0",be.value===A.id?"bg-accent-soft":""])},[r("td",Rb,S(A.name),1),r("td",Fb,S(A.model||"—"),1),r("td",Bb,S(A.mtomGrams?A.mtomGrams+" g":"—"),1),r("td",Vb,[A.cClass?(p(),g("span",{key:0,class:Ee(["inline-flex rounded-full px-2 py-0.5 text-[11px] font-semibold",o.accent])},S(A.cClass),3)):(p(),g("span",Ub,"—")),A.isToy?(p(),g("span",{key:2,class:Ee(["ml-1 inline-flex rounded-full px-2 py-0.5 text-[11px] font-semibold",o.neutral])},"toy",2)):R("",!0)]),r("td",Zb,[r("span",{class:Ee(["text-xs",A.autologsFlights?"text-success-fg":"text-ink-muted"])},S(A.autologsFlights?"yes":"no"),3)]),r("td",Hb,[ut.value===A.id?(p(),g(re,{key:0},[E[71]||(E[71]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),r("button",{class:"btn-ghost mr-1",onClick:E[28]||(E[28]=it=>ut.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:it=>et(A)},"Delete",8,jb)],64)):(p(),g(re,{key:1},[r("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:it=>me(A)},[z(X,{name:"sliders",size:13}),E[72]||(E[72]=D(" Edit",-1))],8,Wb),r("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:it=>ut.value=A.id},[z(X,{name:"trash",size:13})],8,Kb)],64))])],2))),128))])])])):(p(),g("div",$b,[z(X,{name:"drone",size:26,class:"text-ink-muted"}),E[69]||(E[69]=r("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No drones registered",-1)),E[70]||(E[70]=r("div",{class:"mt-1 text-xs text-ink-muted"},"Register the airframes you fly to log flights against them.",-1))]))])],64))]))}},qb={class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},Yb={class:"flex flex-wrap items-center gap-3"},Jb={class:"inline-flex flex-wrap rounded-lg border border-line bg-surface-1 p-0.5"},Xb=["onClick"],Qb={class:"ml-auto"},ex={class:"grid grid-cols-4 gap-4 max-[900px]:grid-cols-2"},tx={class:"eyebrow"},nx={key:0,class:"panel border-danger/40 p-4 text-sm text-danger-fg"},ix={key:1,class:"panel p-5"},sx={class:"mb-4 flex items-center justify-between"},ox={class:"eyebrow"},ax={class:"mt-0.5 text-base font-semibold text-ink"},rx={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},lx={class:"col-span-2 block max-[760px]:col-span-1"},ux={class:"block"},cx=["value"],dx={class:"block"},fx=["value"],hx={class:"block"},px=["value"],mx={class:"block"},gx={class:"block"},vx={class:"block"},_x={class:"block"},yx=["value"],bx={class:"block"},xx={class:"block"},wx={class:"block"},kx=["value"],Sx={class:"mt-3 block"},Tx={key:0,class:"mt-3"},Px={class:"eyebrow mb-1 block"},Cx={key:1,class:"mt-3 text-xs text-ink-muted"},Lx={class:"mt-4 flex items-center gap-3"},Mx=["disabled"],Ex={key:0,class:"text-sm text-danger-fg"},Ox={class:"panel overflow-hidden p-0"},zx={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},Ax={key:1,class:"grid place-items-center px-5 py-16 text-center"},$x={class:"mt-3 text-sm font-medium text-ink-secondary"},Ix={class:"mt-1 text-xs text-ink-muted"},Dx={key:2,class:"overflow-x-auto"},Nx={class:"w-full border-collapse text-sm"},Rx={class:"text-left"},Fx={class:"px-5 py-3"},Bx={class:"font-semibold text-ink"},Vx={key:0,class:"font-mono text-[11px] text-ink-muted"},Ux={class:"px-5 py-3 text-ink-secondary"},Zx={class:"px-5 py-3 text-ink-secondary"},Hx={class:"px-5 py-3"},jx=["onClick"],Wx={key:0,class:"mt-0.5 font-mono text-[10.5px] text-ink-muted"},Kx={class:"px-5 py-3 font-mono text-ink-secondary"},Gx={class:"whitespace-nowrap px-5 py-3 text-right"},qx=["onClick"],Yx=["onClick"],Jx=["href"],Xx=["onClick"],Qx=["onClick"],e0=["onClick"],t0={key:0,class:"border-b border-line bg-surface-2"},n0={colspan:"6",class:"px-5 py-3"},i0={class:"flex flex-wrap gap-x-8 gap-y-1.5 text-xs"},s0={class:"text-ink-secondary"},o0={class:"text-ink"},a0={class:"text-ink-secondary"},r0={class:"text-ink"},l0={key:0,class:"text-ink-secondary"},u0={class:"text-ink"},c0={key:1,class:"text-ink-secondary"},d0={class:"font-mono text-ink"},f0={key:2,class:"text-ink-secondary"},h0={class:"font-mono text-ink"},p0={class:"text-ink-secondary"},m0={class:"text-ink"},g0={key:0,class:"mt-2 space-y-1"},v0={key:1,class:"mt-2 text-xs text-success-fg"},_0={key:2,class:"mt-2 text-xs text-ink-secondary"},y0={class:"flex max-h-[90vh] w-full max-w-[920px] flex-col overflow-hidden rounded-lg border border-line bg-surface-1 shadow-2xl"},b0={class:"flex items-center gap-3 border-b border-line px-5 py-3"},x0={class:"min-w-0"},w0={class:"truncate text-sm font-semibold text-ink"},k0={class:"truncate font-mono text-[11px] text-ink-muted"},S0={class:"ml-auto flex items-center gap-2"},T0=["href"],P0=["href"],C0={class:"flex-1 overflow-auto bg-surface-2"},L0=["src","alt"],M0=["src","title"],E0={key:2,class:"grid place-items-center px-6 py-16 text-center"},O0={class:"mt-1 text-xs text-ink-muted"},z0=["href"],A0={__name:"Documents",props:{email:{type:String,default:""},role:{type:String,default:"user"},organization:{type:String,default:""},organizationName:{type:String,default:""}},setup(t){const i={success:"bg-success-soft text-success-fg",warning:"bg-amber-soft text-amber-fg",danger:"bg-danger-soft text-danger-fg",accent:"bg-accent-soft text-accent-soft-fg",neutral:"bg-surface-2 text-ink-secondary"},o=[{value:"certificate",label:"Pilot certificate"},{value:"medical",label:"Medical / training"},{value:"insurance",label:"Insurance / liability"},{value:"background_check",label:"Background check / waiver"},{value:"registration",label:"Aircraft registration"},{value:"maintenance",label:"Maintenance log"},{value:"conformity",label:"Conformity / compliance"},{value:"firmware",label:"Firmware / software"},{value:"incident",label:"Incident / repair report"},{value:"flight_log",label:"Flight log"},{value:"checklist",label:"Pre-flight checklist"},{value:"airspace_auth",label:"Airspace authorisation"},{value:"mission_plan",label:"Mission plan / flight path"},{value:"risk_assessment",label:"Risk assessment / survey"},{value:"contract",label:"Contract / SOW"},{value:"client_insurance",label:"Client insurance cert"},{value:"delivery_report",label:"Delivery / media handoff"},{value:"other",label:"Other"}],l=Object.fromEntries(o.map(b=>[b.value,b.label])),u=[{value:"pilot",label:"Pilot"},{value:"aircraft",label:"Aircraft"},{value:"organization",label:"Organization"},{value:"client",label:"Client"},{value:"other",label:"Other"}],d=[{value:"active",label:"Active"},{value:"pending_review",label:"Pending review"},{value:"archived",label:"Archived"}],h=[{value:"pilot",label:"Pilot"},{value:"ops",label:"Ops manager"},{value:"admin",label:"Admin"},{value:"client",label:"Client-facing"}],v=j([]),y=j([]),C=j(!1),T=j("");async function O(){C.value=!0,T.value="";const[b,_]=await Promise.all([Pp(),Nc()]);b.ok||(T.value=b.status===503?"Document storage is not configured on the API Server (service account missing).":"Could not load documents."),v.value=b.documents,y.value=_.drones||[],C.value=!1}fi(O);const B=j("all"),V=[["all","All"],["expiring","Expiring soon"],["expired","Expired"],["pending","Pending review"],["archived","Archived"]],H=ke(()=>{const b=v.value;switch(B.value){case"expiring":return b.filter(_=>{var w;return((w=_.expiry)==null?void 0:w.state)==="expiring_soon"&&_.status!=="archived"});case"expired":return b.filter(_=>{var w;return((w=_.expiry)==null?void 0:w.state)==="expired"&&_.status!=="archived"});case"pending":return b.filter(_=>_.status==="pending_review");case"archived":return b.filter(_=>_.status==="archived");default:return b.filter(_=>_.status!=="archived")}});function F(b){if(b.status==="archived")return{tone:"neutral",label:"Superseded",icon:""};const _=b.expiry||{};return _.state==="expired"?{tone:"danger",label:"Expired",icon:"alertTriangle"}:_.state==="expiring_soon"?{tone:"warning",label:`Expires in ${_.daysUntilExpiry}d`,icon:"clock"}:_.state==="valid"?{tone:"success",label:"Valid",icon:"check"}:{tone:"neutral",label:"No expiry",icon:""}}const fe=j("");function ve(b){fe.value=fe.value===b?"":b}function Y(b){return b.ownerDrone?b.ownerDroneName||"Aircraft":b.ownerRef?b.ownerRef:b.ownerType==="pilot"?"Pilot":b.ownerType?b.ownerType.charAt(0).toUpperCase()+b.ownerType.slice(1):"—"}const Pe=["png","jpg","jpeg","gif","webp","svg","bmp","avif"],he=["pdf","txt","csv","log","json","md","html","htm","xml"];function ye(b){const _=(b||"").split(".").pop().toLowerCase();return Pe.includes(_)?"image":he.includes(_)?"frame":"none"}const Ne=j(null),Ie=ke(()=>Ne.value?ye(Ne.value.fileName):"none"),Ve=ke(()=>Ne.value?Ep(Ne.value.id):"");function pe(b){Ne.value=b}function ze(){Ne.value=null}function Te(b){b.key==="Escape"&&Ne.value&&ze()}fi(()=>window.addEventListener("keydown",Te)),Fs(()=>window.removeEventListener("keydown",Te));function te(){return{title:"",docType:"certificate",ownerType:"pilot",ownerDrone:"",ownerRef:"",reference:"",jurisdiction:"",issueDate:"",expiryDate:"",status:"active",accessTier:"ops",notes:""}}const de=j(!1),_e=j(""),be=j(""),ae=j(""),le=bt(te()),ie=j(null),rt=j(null),me=j(""),Oe=j(!1);function Xe(){ie.value=null,rt.value&&(rt.value.value="")}function ut(){Object.assign(le,te()),_e.value="",be.value="",ae.value="",Xe(),me.value="",de.value=!0}function et(b){Object.assign(le,{title:b.title||"",docType:b.docType||"certificate",ownerType:b.ownerType||"pilot",ownerDrone:b.ownerDrone||"",ownerRef:b.ownerRef||"",reference:b.reference||"",jurisdiction:b.jurisdiction||"",issueDate:b.issueDate||"",expiryDate:b.expiryDate||"",status:b.status||"active",accessTier:b.accessTier||"ops",notes:b.notes||""}),_e.value=b.id,be.value="",ae.value="",Xe(),me.value="",de.value=!0}function Ue(b){et(b),_e.value="",be.value=b.id,ae.value=b.title,le.status="active"}function W(){de.value=!1,_e.value="",be.value=""}function E(b){var _;ie.value=((_=b.target.files)==null?void 0:_[0])||null}async function A(){var _;if(me.value="",!le.title.trim()){me.value="Give the document a title.";return}Oe.value=!0;let b;if(_e.value)b=await Lp(_e.value,{...le});else{const w={...le};be.value&&(w.replaces=be.value),b=await Cp(w,ie.value)}if(Oe.value=!1,!b.ok){me.value=((_=b.body)==null?void 0:_.error)||"Could not save the document.";return}de.value=!1,_e.value="",be.value="",await O()}const it=j("");async function vt(b){var w;const _=await Mp(b.id);it.value="",_.ok?await O():me.value=((w=_.body)==null?void 0:w.error)||"Could not delete the document."}const Lt=ke(()=>{const b=v.value.filter(_=>_.status!=="archived");return{total:b.length,expiring:b.filter(_=>{var w;return((w=_.expiry)==null?void 0:w.state)==="expiring_soon"}).length,expired:b.filter(_=>{var w;return((w=_.expiry)==null?void 0:w.state)==="expired"}).length,pending:v.value.filter(_=>_.status==="pending_review").length}});return(b,_)=>(p(),g("div",qb,[r("div",Yb,[r("div",Jb,[(p(),g(re,null,Be(V,w=>r("button",{key:w[0],class:Ee(["rounded-md px-3.5 py-1.5 text-sm font-semibold transition",B.value===w[0]?"bg-accent-soft text-accent-soft-fg":"text-ink-secondary hover:text-ink"]),onClick:K=>B.value=w[0]},S(w[1]),11,Xb)),64))]),r("div",Qb,[r("button",{class:"btn-accent inline-flex items-center gap-2",onClick:ut},[z(X,{name:"upload",size:15}),_[13]||(_[13]=D(" Add document ",-1))])])]),r("div",ex,[(p(!0),g(re,null,Be([{label:"Documents on file",value:Lt.value.total,tone:"neutral"},{label:"Expiring soon",value:Lt.value.expiring,tone:Lt.value.expiring?"warning":"neutral"},{label:"Expired",value:Lt.value.expired,tone:Lt.value.expired?"danger":"success"},{label:"Pending review",value:Lt.value.pending,tone:Lt.value.pending?"accent":"neutral"}],w=>(p(),g("div",{key:w.label,class:"panel p-5"},[r("div",tx,S(w.label),1),r("div",{class:Ee(["mt-2 text-[30px] font-bold leading-none tracking-tightest",w.tone==="danger"?"text-danger-fg":w.tone==="warning"?"text-amber-fg":w.tone==="success"?"text-success-fg":w.tone==="accent"?"text-accent-soft-fg":"text-ink"])},S(w.value),3)]))),128))]),T.value?(p(),g("div",nx,S(T.value),1)):R("",!0),de.value?(p(),g("div",ix,[r("div",sx,[r("div",null,[r("div",ox,S(_e.value?"Edit document":be.value?"New version":"New document"),1),r("div",ax,S(be.value?`Supersedes “${ae.value}”`:"Compliance & operational document"),1)]),r("button",{class:"btn-icon",onClick:W},[z(X,{name:"x",size:16})])]),r("div",rx,[r("label",lx,[_[14]||(_[14]=r("span",{class:"eyebrow mb-1 block"},"Title",-1)),oe(r("input",{"onUpdate:modelValue":_[0]||(_[0]=w=>le.title=w),class:"field",placeholder:"A2 Remote Pilot Certificate — J. Dariusz"},null,512),[[xe,le.title]])]),r("label",ux,[_[15]||(_[15]=r("span",{class:"eyebrow mb-1 block"},"Type",-1)),oe(r("select",{"onUpdate:modelValue":_[1]||(_[1]=w=>le.docType=w),class:"field"},[(p(),g(re,null,Be(o,w=>r("option",{key:w.value,value:w.value},S(w.label),9,cx)),64))],512),[[Et,le.docType]])]),r("label",dx,[_[16]||(_[16]=r("span",{class:"eyebrow mb-1 block"},"Owner type",-1)),oe(r("select",{"onUpdate:modelValue":_[2]||(_[2]=w=>le.ownerType=w),class:"field"},[(p(),g(re,null,Be(u,w=>r("option",{key:w.value,value:w.value},S(w.label),9,fx)),64))],512),[[Et,le.ownerType]])]),r("label",hx,[_[18]||(_[18]=r("span",{class:"eyebrow mb-1 block"},"Aircraft (if any)",-1)),oe(r("select",{"onUpdate:modelValue":_[3]||(_[3]=w=>le.ownerDrone=w),class:"field"},[_[17]||(_[17]=r("option",{value:""},"— none —",-1)),(p(!0),g(re,null,Be(y.value,w=>(p(),g("option",{key:w.id,value:w.id},S(w.name)+S(w.model?` · ${w.model}`:""),9,px))),128))],512),[[Et,le.ownerDrone]])]),r("label",mx,[_[19]||(_[19]=r("span",{class:"eyebrow mb-1 block"},"Owner reference",-1)),oe(r("input",{"onUpdate:modelValue":_[4]||(_[4]=w=>le.ownerRef=w),class:"field",placeholder:"Client name / serial / site"},null,512),[[xe,le.ownerRef]])]),r("label",gx,[_[20]||(_[20]=r("span",{class:"eyebrow mb-1 block"},"Reference / number",-1)),oe(r("input",{"onUpdate:modelValue":_[5]||(_[5]=w=>le.reference=w),class:"field",placeholder:"Cert / registration / policy no."},null,512),[[xe,le.reference]])]),r("label",vx,[_[21]||(_[21]=r("span",{class:"eyebrow mb-1 block"},"Jurisdiction",-1)),oe(r("input",{"onUpdate:modelValue":_[6]||(_[6]=w=>le.jurisdiction=w),class:"field",placeholder:"DK / EASA / FAA"},null,512),[[xe,le.jurisdiction]])]),r("label",_x,[_[22]||(_[22]=r("span",{class:"eyebrow mb-1 block"},"Access tier",-1)),oe(r("select",{"onUpdate:modelValue":_[7]||(_[7]=w=>le.accessTier=w),class:"field"},[(p(),g(re,null,Be(h,w=>r("option",{key:w.value,value:w.value},S(w.label),9,yx)),64))],512),[[Et,le.accessTier]])]),r("label",bx,[_[23]||(_[23]=r("span",{class:"eyebrow mb-1 block"},"Issue date",-1)),oe(r("input",{"onUpdate:modelValue":_[8]||(_[8]=w=>le.issueDate=w),type:"date",class:"field"},null,512),[[xe,le.issueDate]])]),r("label",xx,[_[24]||(_[24]=r("span",{class:"eyebrow mb-1 block"},"Expiry date",-1)),oe(r("input",{"onUpdate:modelValue":_[9]||(_[9]=w=>le.expiryDate=w),type:"date",class:"field"},null,512),[[xe,le.expiryDate]])]),r("label",wx,[_[25]||(_[25]=r("span",{class:"eyebrow mb-1 block"},"Status",-1)),oe(r("select",{"onUpdate:modelValue":_[10]||(_[10]=w=>le.status=w),class:"field"},[(p(),g(re,null,Be(d,w=>r("option",{key:w.value,value:w.value},S(w.label),9,kx)),64))],512),[[Et,le.status]])])]),r("label",Sx,[_[26]||(_[26]=r("span",{class:"eyebrow mb-1 block"},"Notes",-1)),oe(r("textarea",{"onUpdate:modelValue":_[11]||(_[11]=w=>le.notes=w),rows:"2",class:"field",placeholder:"Conditions, renewal contacts, anything worth recording"},null,512),[[xe,le.notes]])]),_e.value?(p(),g("div",Cx,[..._[28]||(_[28]=[D(" Editing updates metadata only. To replace the file, close this and use ",-1),r("b",{class:"text-ink-secondary"},"New version",-1),D(" on the document — the old version is kept for audit. ",-1)])])):(p(),g("div",Tx,[r("span",Px,"File "+S(be.value?"(new version)":"(optional)"),1),r("input",{ref_key:"fileInput",ref:rt,type:"file",class:"field",onChange:E},null,544),_[27]||(_[27]=r("p",{class:"mt-1 text-xs text-ink-muted"}," Stored in PocketBase for now (object storage later). Max 50 MB. ",-1))])),r("div",Lx,[r("button",{class:"btn-accent",disabled:Oe.value,onClick:A},S(Oe.value?"Saving…":_e.value?"Save changes":be.value?"Upload new version":"Add document"),9,Mx),r("button",{class:"btn-ghost",onClick:W},"Cancel"),me.value?(p(),g("span",Ex,S(me.value),1)):R("",!0)])])):R("",!0),r("div",Ox,[C.value?(p(),g("div",zx,"Loading…")):H.value.length?(p(),g("div",Dx,[r("table",Nx,[r("thead",null,[r("tr",Rx,[(p(),g(re,null,Be(["Title","Type","Owner","Expiry","Ver",""],w=>r("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"},S(w),1)),64))])]),r("tbody",null,[(p(!0),g(re,null,Be(H.value,w=>{var K,G;return p(),g(re,{key:w.id},[r("tr",{class:Ee(["border-b border-line last:border-0",_e.value===w.id?"bg-accent-soft":""])},[r("td",Fx,[r("div",Bx,S(w.title),1),w.reference?(p(),g("div",Vx,S(w.reference),1)):R("",!0)]),r("td",Ux,S($e(l)[w.docType]||w.docType||"—"),1),r("td",Zx,S(Y(w)),1),r("td",Hx,[r("button",{class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",i[F(w).tone]]),onClick:Z=>ve(w.id)},[F(w).icon?(p(),at(X,{key:0,name:F(w).icon,size:12},null,8,["name"])):R("",!0),D(" "+S(F(w).label),1)],10,jx),w.expiryDate?(p(),g("div",Wx,S(w.expiryDate),1)):R("",!0)]),r("td",Kx,"v"+S(w.version||1),1),r("td",Gx,[it.value===w.id?(p(),g(re,{key:0},[_[29]||(_[29]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),r("button",{class:"btn-ghost mr-1",onClick:_[12]||(_[12]=Z=>it.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:Z=>vt(w)},"Delete",8,qx)],64)):(p(),g(re,{key:1},[w.hasFile?(p(),g("button",{key:0,class:"btn-ghost mr-1 inline-flex items-center gap-1",title:"Preview",onClick:Z=>pe(w)},[z(X,{name:"eye",size:13})],8,Yx)):R("",!0),w.hasFile?(p(),g("a",{key:1,href:$e(dr)(w.id),class:"btn-ghost mr-1 inline-flex items-center gap-1",title:"Download file"},[z(X,{name:"download",size:13})],8,Jx)):R("",!0),r("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",title:"Upload new version",onClick:Z=>Ue(w)},[z(X,{name:"upload",size:13})],8,Xx),r("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:Z=>et(w)},[z(X,{name:"sliders",size:13}),_[30]||(_[30]=D(" Edit",-1))],8,Qx),r("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:Z=>it.value=w.id},[z(X,{name:"trash",size:13})],8,e0)],64))])],2),fe.value===w.id?(p(),g("tr",t0,[r("td",n0,[r("div",i0,[r("span",s0,[_[31]||(_[31]=D("Status: ",-1)),r("b",o0,S(w.status||"—"),1)]),r("span",a0,[_[32]||(_[32]=D("Access: ",-1)),r("b",r0,S(w.accessTier||"—"),1)]),w.jurisdiction?(p(),g("span",l0,[_[33]||(_[33]=D("Jurisdiction: ",-1)),r("b",u0,S(w.jurisdiction),1)])):R("",!0),w.issueDate?(p(),g("span",c0,[_[34]||(_[34]=D("Issued: ",-1)),r("b",d0,S(w.issueDate),1)])):R("",!0),w.expiryDate?(p(),g("span",f0,[_[35]||(_[35]=D("Expires: ",-1)),r("b",h0,S(w.expiryDate),1)])):R("",!0),r("span",p0,[_[36]||(_[36]=D("File: ",-1)),r("b",m0,S(w.hasFile?w.fileName:"none"),1)])]),(((K=w.expiry)==null?void 0:K.flags)||[]).length?(p(),g("ul",g0,[(p(!0),g(re,null,Be(w.expiry.flags,(Z,ne)=>(p(),g("li",{key:ne,class:Ee(["flex items-start gap-2 text-xs",w.expiry.state==="expired"?"text-danger-fg":w.expiry.state==="expiring_soon"?"text-amber-fg":"text-ink-secondary"])},[z(X,{name:"alertTriangle",size:13,class:"mt-px shrink-0"}),D(" "+S(Z),1)],2))),128))])):((G=w.expiry)==null?void 0:G.state)==="valid"?(p(),g("div",v0,"In force — no action needed.")):R("",!0),w.notes?(p(),g("div",_0,[_[37]||(_[37]=r("span",{class:"text-ink-muted"},"Notes:",-1)),D(" "+S(w.notes),1)])):R("",!0)])])):R("",!0)],64)}),128))])])])):(p(),g("div",Ax,[z(X,{name:"fileText",size:26,class:"text-ink-muted"}),r("div",$x,S(B.value==="all"?"No documents on file yet":"Nothing in this view"),1),r("div",Ix,S(B.value==="all"?"Add certificates, registrations, insurance and authorisations to track their expiry.":"Try a different filter."),1)]))]),(p(),at(af,{to:"body"},[Ne.value?(p(),g("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:Hr(ze,["self"])},[r("div",y0,[r("div",b0,[r("div",x0,[r("div",w0,S(Ne.value.title),1),r("div",k0,S(Ne.value.fileName),1)]),r("div",S0,[r("a",{href:Ve.value,target:"_blank",rel:"noopener",class:"btn-ghost inline-flex items-center gap-1.5",title:"Open in new tab"},[z(X,{name:"globe",size:14}),_[38]||(_[38]=D(" New tab ",-1))],8,T0),r("a",{href:$e(dr)(Ne.value.id),class:"btn-ghost inline-flex items-center gap-1.5",title:"Download"},[z(X,{name:"download",size:14}),_[39]||(_[39]=D(" Download ",-1))],8,P0),r("button",{class:"btn-icon",title:"Close",onClick:ze},[z(X,{name:"x",size:16})])])]),r("div",C0,[Ie.value==="image"?(p(),g("img",{key:0,src:Ve.value,alt:Ne.value.title,class:"mx-auto block max-w-full"},null,8,L0)):Ie.value==="frame"?(p(),g("iframe",{key:1,src:Ve.value,class:"h-[74vh] w-full border-0 bg-white",title:Ne.value.title},null,8,M0)):(p(),g("div",E0,[z(X,{name:"fileText",size:28,class:"text-ink-muted"}),_[41]||(_[41]=r("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"Preview isn't available for this file type",-1)),r("div",O0,S(Ne.value.fileName),1),r("a",{href:$e(dr)(Ne.value.id),class:"btn-accent mt-4 inline-flex items-center gap-2"},[z(X,{name:"download",size:15}),_[40]||(_[40]=D(" Download instead ",-1))],8,z0)]))])])])):R("",!0)]))]))}},$0={class:"grid h-full grid-cols-[248px_1fr] max-[900px]:grid-cols-1"},I0={class:"flex flex-col border-r border-line bg-surface-1 px-4 py-5 max-[900px]:hidden"},D0={class:"flex items-center gap-2.5 px-2 pb-5"},N0={class:"flex flex-col gap-0.5"},R0=["onClick"],F0={class:"mt-auto flex flex-col gap-2.5"},B0={class:"rounded-lg bg-surface-2 p-3"},V0={class:"flex items-center gap-2"},U0={class:"text-xs font-semibold text-ink"},Z0={class:"mt-1.5 block font-mono text-[10.5px] text-ink-muted"},H0={class:"flex items-center gap-2.5 px-2 py-1"},j0={class:"grid h-8 w-8 place-items-center rounded-full bg-[var(--navy-800)] text-xs font-bold text-white"},W0={class:"min-w-0 flex-1"},K0={class:"truncate text-[13px] font-semibold text-ink"},G0={class:"flex items-center gap-1.5 text-[11px] text-ink-muted"},q0=["title"],Y0={class:"overflow-y-auto"},J0={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)"}},X0={class:"mt-0.5 text-[22px] font-bold tracking-tightest text-ink"},Q0={class:"ml-auto flex items-center gap-3"},ew={class:"flex h-10 w-60 items-center gap-2 rounded border border-line-strong bg-surface-1 px-3 max-[1100px]:hidden"},tw={key:0,class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},nw={class:"grid grid-cols-4 gap-4 max-[1100px]:grid-cols-2 max-[560px]:grid-cols-1"},iw={class:"flex items-center justify-between"},sw={class:"eyebrow"},ow={class:"mt-2.5 text-[34px] font-bold leading-none tracking-tightest text-ink"},aw={class:"grid grid-cols-[1.6fr_1fr] gap-5 max-[1100px]:grid-cols-1"},rw={class:"panel p-5"},lw={class:"mb-3.5 flex items-center justify-between"},uw={class:"flex items-center gap-2"},cw={class:"relative z-[1200]"},dw={class:"panel absolute right-0 z-[1200] mt-1.5 w-72 p-3.5 shadow-lg"},fw={class:"flex items-center justify-between gap-3"},hw={class:"mb-1.5 flex items-center justify-between"},pw={class:"font-mono text-[11px] text-ink-muted"},mw=["value"],gw={key:0,class:"mt-1.5 text-[11px] text-ink-muted"},vw={key:0,class:"mt-2.5 text-xs text-ink-muted"},_w={key:1,class:"mt-2.5 text-xs text-ink-muted"},yw={key:2,class:"mt-2.5 text-xs text-ink-muted"},bw={class:"panel p-5"},xw={class:"mb-3.5 flex items-center justify-between"},ww={class:"grid place-items-center py-10 text-center"},kw={class:"panel overflow-hidden p-0"},Sw={class:"flex items-center justify-between px-5 py-4"},Tw={class:"flex gap-2"},Pw={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},Cw={key:1,class:"overflow-x-auto"},Lw={class:"w-full border-collapse text-sm"},Mw={class:"text-left"},Ew=["onClick"],Ow={class:"px-5 py-3 font-mono font-bold text-ink"},zw={class:"px-5 py-3 text-ink-secondary"},Aw={class:"px-5 py-3"},$w={class:"px-5 py-3 font-mono text-ink-secondary"},Iw={class:"px-5 py-3"},Dw={key:0,class:"flex items-center gap-2"},Nw={class:"h-1.5 w-12 overflow-hidden rounded bg-surface-2"},Rw={class:"font-mono text-xs text-ink-secondary"},Fw={key:1,class:"font-mono text-xs text-ink-muted"},Bw={class:"px-5 py-3 font-mono text-ink-secondary"},Vw={class:"px-5 py-3 text-right"},Uw=["onClick"],Zw={key:1,class:"p-7"},Hw={class:"mb-4 flex flex-wrap items-center gap-3"},jw={class:"font-mono text-mode font-bold text-ink"},Ww={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"},Kw={key:1,class:"ml-auto flex flex-wrap gap-1.5"},Gw=["onClick"],qw={key:0,class:"panel grid place-items-center p-16 text-center"},Yw={class:"pill"},Jw={class:"pill"},Xw={class:"pill"},Qw={class:"mt-1 text-sm font-semibold text-ink"},ek={class:"pill"},tk={class:"mt-1 font-mono text-sm font-bold tabular text-ink"},nk={class:"grid grid-cols-2 gap-4 max-[820px]:grid-cols-1"},ik={class:"panel p-4"},sk={class:"flex items-center gap-4"},ok={class:"h-9 flex-1 overflow-hidden rounded border border-line bg-surface-2"},ak={class:"readout"},rk={class:"panel p-4"},lk={class:"readout"},uk={class:"panel p-4"},ck={class:"space-y-1.5 text-sm"},dk={class:"flex justify-between"},fk={class:"text-ink"},hk={class:"flex justify-between"},pk={class:"text-ink"},mk={class:"flex justify-between"},gk={class:"font-mono tabular text-ink"},vk={class:"flex justify-between"},_k={class:"font-mono tabular text-ink"},yk={class:"panel p-4"},bk={class:"space-y-1.5 text-sm"},xk={class:"flex justify-between"},wk={class:"font-mono tabular text-ink"},kk={class:"flex justify-between"},Sk={class:"font-mono tabular text-ink"},Tk={class:"flex justify-between"},Pk={class:"font-mono tabular text-ink"},Ck={class:"panel col-span-2 p-4 max-[820px]:col-span-1"},Lk={class:"panel p-4"},Mk={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"},Ak={class:"text-ink-muted"},$k={class:"font-semibold text-accent"},Ik={class:"break-all text-ink"},Dk={key:5,class:"p-7"},Nk={class:"panel grid place-items-center p-16 text-center"},Rk={class:"mt-3 text-sm font-medium text-ink-secondary"},Fk={key:0,class:"mt-1 text-xs text-ink-muted"},Bk={key:1,class:"mt-1 text-xs text-ink-muted"},Vk={__name:"Dashboard",props:{email:{type:String,default:""},role:{type:String,default:"user"},organization:{type:String,default:""},organizationName:{type:String,default:""}},emits:["logout"],setup(t,{emit:i}){const o=t,l=i,u=bt({}),d=bt({}),h=j(null),v=j(!1),y=bt([]),C=j(""),T=j([]),O=bt({unavailable:!1,detail:"",loaded:!1,plan:"",recommendedInterval:30}),B=ke(()=>T.value.filter(I=>!I.onGround).length),V=j(!1);let H=null;const F=[{value:"auto",label:"Auto"},{value:15,label:"15s"},{value:30,label:"30s"},{value:60,label:"60s"},{value:120,label:"120s"}],fe=ke(()=>{if(we.airTrafficInterval==="auto")return O.recommendedInterval||30;const I=Number(we.airTrafficInterval);return Number.isFinite(I)&&I>0?I:30});async function ve(){if(!we.showAirTraffic)return;const{states:I,unavailable:M,detail:ee,plan:Re,recommendedInterval:Ze}=await dp();T.value=I,O.unavailable=M,O.detail=ee,O.plan=Re||"",Ze&&(O.recommendedInterval=Ze),O.loaded=!0}function Y(){H&&clearInterval(H),H=setInterval(()=>{ye.value==="Overview"&&we.showAirTraffic&&ve()},fe.value*1e3)}function Pe(){ve(),Y()}function he(){H&&clearInterval(H),H=null}const ye=j("Overview"),Ne=[["grid","Overview"],["radio","Live flights"],["route","Routes"],["calendar","Schedule"],["book","Logbook"],["fileText","Documents"],["server","Drives"],["settings","Settings"]],Ie=ke(()=>(Ne.find(([,I])=>I===ye.value)||["grid"])[0]),Ve=j(""),pe=j(""),ze=j("");let Te=null,te=null,de=!1;const _e=ke(()=>Object.keys(u).sort((I,M)=>(u[M].online?1:0)-(u[I].online?1:0)||I.localeCompare(M))),be=ke(()=>h.value?u[h.value]:null),ae=ke(()=>be.value&&be.value.telemetry||{}),le=ke(()=>!!(be.value&&be.value.online)),ie=ke(()=>{const I=ae.value;return typeof I.latitude=="number"&&typeof I.longitude=="number"&&(I.latitude||I.longitude)?{lat:I.latitude,lng:I.longitude}:null}),rt=ke(()=>h.value&&d[h.value]||[]),me=ke(()=>{const I=ae.value;return typeof I.velocityX=="number"&&typeof I.velocityY=="number"?Math.hypot(I.velocityX,I.velocityY):null});function Oe(I){return I.online?I.connected?["In flight","success"]:["Standby","accent"]:["Offline","neutral"]}function Xe(I){const M=I&&I.telemetry||{};return typeof M.velocityX=="number"&&typeof M.velocityY=="number"?Math.hypot(M.velocityX,M.velocityY):null}const ut=ke(()=>_e.value.map(I=>{const M=u[I],ee=M.telemetry||{},[Re,Ze]=Oe(M);return{id:I,mission:M.model||(M.connected?"Drone linked":M.online?"App online":"No signal"),status:Re,tone:Ze,alt:typeof ee.altitude=="number"?ee.altitude.toFixed(0)+" m":"—",battery:typeof ee.batteryPercent=="number"?ee.batteryPercent:null,speed:Xe(M)}})),et=ke(()=>_e.value.filter(I=>u[I].online).length),Ue=ke(()=>_e.value.filter(I=>u[I].online&&u[I].connected).length),W=ke(()=>_e.value.filter(I=>!u[I].online).length),E=ke(()=>{const I=_e.value.map(M=>{var ee;return(ee=u[M].telemetry)==null?void 0:ee.batteryPercent}).filter(M=>typeof M=="number");return I.length?Math.round(I.reduce((M,ee)=>M+ee,0)/I.length):null}),A=ke(()=>[{label:"Active flights",value:String(Ue.value),delta:`${et.value} online`,tone:"success",icon:"radio"},{label:"Avg battery",value:E.value==null?"—":E.value+"%",delta:E.value==null?"no telemetry":E.value<40?"low — watch":"nominal",tone:E.value!=null&&E.value<40?"danger":"neutral",icon:"battery"},{label:"Fleet size",value:String(_e.value.length),delta:`${Ue.value} in flight`,tone:"neutral",icon:"grid"},{label:"Offline",value:String(W.value),delta:W.value?"needs attention":"all reachable",tone:W.value?"warning":"success",icon:"signal"}]),it={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"},vt={success:"text-success-fg",danger:"text-danger-fg",warning:"text-amber-fg",neutral:"text-ink-muted",accent:"text-accent-soft-fg"},Lt=ke(()=>{var ee,Re,Ze;const M=(o.email||"PV").split("@")[0].split(/[.\-_ ]+/).filter(Boolean);return((((ee=M[0])==null?void 0:ee[0])||"P")+(((Re=M[1])==null?void 0:Re[0])||((Ze=M[0])==null?void 0:Ze[1])||"V")).toUpperCase()}),b={superadmin:"Superadmin",admin:"Admin",user:"Operator"},_=ke(()=>b[o.role]||"Operator"),w=ke(()=>o.organizationName||(o.role==="superadmin"?"All organizations":"No organization"));function K(I){var ee;u[I.deviceId]=I;const M=I.telemetry||{};typeof M.latitude=="number"&&typeof M.longitude=="number"&&(M.latitude||M.longitude)&&(d[I.deviceId]||(d[I.deviceId]=[]),d[I.deviceId].push([M.latitude,M.longitude]),d[I.deviceId].length>1e3&&d[I.deviceId].shift()),(!h.value||I.online&&!((ee=u[h.value])!=null&&ee.online))&&(h.value=I.deviceId)}function G(I){delete u[I],delete d[I],h.value===I&&(h.value=_e.value[0]||null)}function Z(I){y.unshift({t:uu(Date.now()),tag:I.type||"?",text:JSON.stringify(ne(I))}),y.length>200&&y.pop()}function ne(I){const M={...I};return delete M.type,M}function se(){const I=location.protocol==="https:"?"wss":"ws";Te=new WebSocket(`${I}://${location.host}/bff/ws`),Te.onopen=()=>v.value=!0,Te.onclose=()=>{v.value=!1,de||(te=setTimeout(se,1500))},Te.onerror=()=>Te&&Te.close(),Te.onmessage=M=>{let ee;try{ee=JSON.parse(M.data)}catch{return}ee.type==="snapshot"?(ee.devices||[]).forEach(K):ee.type==="update"&&ee.device?(K(ee.device),ee.event&&ee.device.deviceId===h.value&&Z(ee.event)):ee.type==="removed"&&ee.deviceId&&G(ee.deviceId)}}async function Q(){if(!h.value)return ze.value="No device selected.";if(!Ve.value.trim())return ze.value="Enter a command name.";let I;if(pe.value.trim())try{I=JSON.parse(pe.value)}catch{return ze.value="Payload is not valid JSON."}const{ok:M,body:ee}=await Op(h.value,Ve.value.trim(),I);ze.value=M?`Sent "${Ve.value.trim()}".`:`Error: ${ee.error||"failed"}`}function U(I,M,ee=""){return typeof I=="number"?I.toFixed(M)+ee:"—"}function Se(I){h.value=I,ye.value="Live flights"}return $t(ye,I=>{I==="Overview"&&ve()}),$t(()=>we.showAirTraffic,I=>{I?ve():T.value=[]}),$t(fe,Y),fi(async()=>{(await Xh()).forEach(K),se(),Pe()}),Fs(()=>{de=!0,te&&clearTimeout(te),Te&&Te.close(),he()}),(I,M)=>{var ee,Re,Ze,Ye,ht;return p(),g("div",$0,[r("aside",I0,[r("div",D0,[z(Uc,{size:26}),M[11]||(M[11]=r("span",{class:"text-[19px] tracking-tightest"},[r("span",{class:"font-medium text-ink-secondary"},"Pilot"),r("span",{class:"font-bold text-ink"},"Vault")],-1))]),r("nav",N0,[(p(),g(re,null,Be(Ne,([ue,Ae])=>r("button",{key:Ae,class:Ee(["flex items-center gap-3 rounded px-3 py-2.5 text-left text-sm transition",ye.value===Ae?"bg-accent-soft font-semibold text-accent-soft-fg":"font-medium text-ink-secondary hover:bg-surface-2"]),onClick:wt=>ye.value=Ae},[z(X,{name:ue,size:18,stroke:ye.value===Ae?2.2:1.8},null,8,["name","stroke"]),D(" "+S(Ae),1)],10,R0)),64))]),r("div",F0,[r("div",B0,[r("div",V0,[r("span",{class:Ee(["h-2 w-2 rounded-full",v.value?"bg-ready":"bg-caution"])},null,2),r("span",U0,S(v.value?"Link healthy":"Reconnecting…"),1)]),r("span",Z0,"API gateway · "+S(v.value?"streaming":"retrying"),1)]),r("div",H0,[r("div",j0,S(Lt.value),1),r("div",W0,[r("div",K0,S(t.email||"Operator"),1),r("div",G0,[z(X,{name:"grid",size:11,class:"shrink-0"}),r("span",{class:"truncate",title:`${_.value} · ${w.value}`},S(_.value)+" · "+S(w.value),9,q0)])]),r("button",{class:"text-ink-muted transition hover:text-ink",title:"Log out","aria-label":"Log out",onClick:M[0]||(M[0]=ue=>l("logout"))},[z(X,{name:"logout",size:16})])])])]),r("main",Y0,[r("header",J0,[r("div",null,[M[12]||(M[12]=r("div",{class:"eyebrow"},"Live operations",-1)),r("h1",X0,S(ye.value),1)]),r("div",Q0,[r("div",ew,[z(X,{name:"search",size:16,class:"text-ink-muted"}),oe(r("input",{"onUpdate:modelValue":M[1]||(M[1]=ue=>C.value=ue),placeholder:"Search drones, routes…",class:"w-full border-none bg-transparent text-sm text-ink outline-none placeholder:text-ink-muted"},null,512),[[xe,C.value]])]),r("button",{class:"btn-accent flex items-center gap-2",onClick:M[2]||(M[2]=ue=>ye.value="Live flights")},[z(X,{name:"radio",size:16}),M[13]||(M[13]=D(" Live flights ",-1))])])]),ye.value==="Overview"?(p(),g("div",tw,[r("div",nw,[(p(!0),g(re,null,Be(A.value,ue=>(p(),g("div",{key:ue.label,class:"panel p-5"},[r("div",iw,[r("span",sw,S(ue.label),1),z(X,{name:ue.icon,size:16,class:"text-ink-muted"},null,8,["name"])]),r("div",ow,S(ue.value),1),r("span",{class:Ee(["mt-2 block font-mono text-[11px]",vt[ue.tone]])},S(ue.delta),3)]))),128))]),r("div",aw,[r("div",rw,[r("div",lw,[M[18]||(M[18]=r("div",null,[r("div",{class:"eyebrow"},"Airspace"),r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Live map")],-1)),r("div",uw,[$e(we).showAirTraffic&&B.value?(p(),g("span",{key:0,class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",it.accent]),title:"Live aircraft from OpenSky Network"},[z(X,{name:"radio",size:12}),D(S(B.value)+" aircraft ",1)],2)):R("",!0),Ue.value?(p(),g("span",{key:1,class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",it.success])},[M[14]||(M[14]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(S(Ue.value)+" drones ",1)],2)):R("",!0),r("div",cw,[r("button",{type:"button",class:Ee(["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:M[3]||(M[3]=ue=>V.value=!V.value)},[z(X,{name:"settings",size:16})],2),V.value?(p(),g(re,{key:0},[r("div",{class:"fixed inset-0 z-[1190]",onClick:M[4]||(M[4]=ue=>V.value=!1)}),r("div",dw,[M[17]||(M[17]=r("div",{class:"eyebrow mb-2.5"},"Map settings",-1)),r("label",fw,[M[15]||(M[15]=r("span",{class:"text-sm text-ink-secondary"},"Show live air traffic",-1)),z(sn,{modelValue:$e(we).showAirTraffic,"onUpdate:modelValue":M[5]||(M[5]=ue=>$e(we).showAirTraffic=ue)},null,8,["modelValue"])]),r("div",{class:Ee(["mt-3.5",$e(we).showAirTraffic?"":"pointer-events-none opacity-40"])},[r("div",hw,[M[16]||(M[16]=r("span",{class:"text-sm text-ink-secondary"},"Refresh interval",-1)),r("span",pw,"every "+S(fe.value)+"s",1)]),oe(r("select",{"onUpdate:modelValue":M[6]||(M[6]=ue=>$e(we).airTrafficInterval=ue),class:"field"},[(p(),g(re,null,Be(F,ue=>r("option",{key:ue.value,value:ue.value},S(ue.label)+S(ue.value==="auto"?` (plan: ${O.recommendedInterval}s)`:""),9,mw)),64))],512),[[Et,$e(we).airTrafficInterval]]),O.plan?(p(),g("p",gw," OpenSky plan: "+S(O.plan),1)):R("",!0)],2)])],64)):R("",!0)])])]),z(hu,{position:ie.value,trail:rt.value,aircraft:$e(we).showAirTraffic?T.value:[]},null,8,["position","trail","aircraft"]),$e(we).showAirTraffic?O.loaded&&O.unavailable?(p(),g("p",_w,S(O.detail||"Live air traffic is unavailable."),1)):(p(),g("p",yw," Live air traffic from OpenSky Network · updates every "+S(fe.value)+"s ",1)):(p(),g("p",vw," Live air traffic hidden · enable it in Map settings "))]),r("div",bw,[r("div",xw,[M[19]||(M[19]=r("div",null,[r("div",{class:"eyebrow"},"Today"),r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Schedule")],-1)),z(X,{name:"clock",size:16,class:"text-ink-muted"})]),r("div",ww,[z(X,{name:"calendar",size:24,class:"text-ink-muted"}),M[20]||(M[20]=r("div",{class:"mt-2 text-sm font-medium text-ink-secondary"},"No missions scheduled",-1)),M[21]||(M[21]=r("div",{class:"mt-0.5 text-xs text-ink-muted"},"Scheduling is not wired to a backend yet.",-1))])])]),r("div",kw,[r("div",Sw,[M[24]||(M[24]=r("div",null,[r("div",{class:"eyebrow"},"Fleet"),r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Aircraft status")],-1)),r("div",Tw,[r("span",{class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",it.success])},[M[22]||(M[22]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(S(Ue.value)+" in flight ",1)],2),W.value?(p(),g("span",{key:0,class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",it.warning])},[M[23]||(M[23]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(S(W.value)+" offline ",1)],2)):R("",!0)])]),ut.value.length?(p(),g("div",Cw,[r("table",Lw,[r("thead",null,[r("tr",Mw,[(p(),g(re,null,Be(["Aircraft","Mission","Status","Alt","Battery","Speed",""],ue=>r("th",{key:ue,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"},S(ue),1)),64))])]),r("tbody",null,[(p(!0),g(re,null,Be(ut.value,(ue,Ae)=>(p(),g("tr",{key:ue.id,class:Ee(["cursor-pointer transition hover:bg-surface-2",AeSe(ue.id)},[r("td",Ow,S(ue.id),1),r("td",zw,S(ue.mission),1),r("td",Aw,[r("span",{class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",it[ue.tone]])},[M[25]||(M[25]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(S(ue.status),1)],2)]),r("td",$w,S(ue.alt),1),r("td",Iw,[ue.battery!=null?(p(),g("div",Dw,[r("div",Nw,[r("div",{class:Ee(["h-full",ue.battery<40?"bg-caution":"bg-ready"]),style:Is({width:ue.battery+"%"})},null,6)]),r("span",Rw,S(ue.battery)+"%",1)])):(p(),g("span",Fw,"—"))]),r("td",Bw,[D(S(ue.speed==null?"—":ue.speed.toFixed(1))+" ",1),M[26]||(M[26]=r("span",{class:"text-ink-muted"},"m/s",-1))]),r("td",Vw,[r("button",{class:"btn-ghost inline-flex items-center gap-1.5 whitespace-nowrap",onClick:Hr(wt=>Se(ue.id),["stop"])},[z(X,{name:"play",size:14}),M[27]||(M[27]=D(" Track ",-1))],8,Uw)])],10,Ew))),128))])])])):(p(),g("div",Pw," No aircraft connected yet. Devices appear here as they come online. "))])])):ye.value==="Live flights"?(p(),g("div",Zw,[r("div",Hw,[r("span",jw,S(h.value||"No device selected"),1),be.value&&!le.value?(p(),g("span",Ww,"Offline")):R("",!0),_e.value.length?(p(),g("div",Kw,[(p(!0),g(re,null,Be(_e.value,ue=>(p(),g("button",{key:ue,class:Ee(["flex items-center gap-2 rounded border px-3 py-1.5 font-mono text-xs font-bold transition",ue===h.value?"border-accent bg-accent-soft text-accent-soft-fg":"border-line bg-surface-1 text-ink-secondary hover:border-line-strong"]),onClick:Ae=>h.value=ue},[r("span",{class:Ee(["h-2 w-2 rounded-full",u[ue].online?"bg-ready":"bg-ink-muted"])},null,2),D(" "+S(ue),1)],10,Gw))),128))])):R("",!0)]),_e.value.length?(p(),g(re,{key:1},[r("div",{class:Ee(["mb-4 grid gap-3",!le.value&&be.value?"opacity-60":""]),style:{"grid-template-columns":"repeat(auto-fit, minmax(150px, 1fr))"}},[r("div",Yw,[M[30]||(M[30]=r("div",{class:"eyebrow"},"Registration",-1)),r("div",{class:Ee(["mt-1 text-sm font-semibold",le.value?((ee=be.value)==null?void 0:ee.registration)==="success"?"text-success-fg":"text-danger-fg":"text-ink"])},S(le.value&&((Re=be.value)!=null&&Re.registration)?be.value.registration:"—"),3)]),r("div",Jw,[M[31]||(M[31]=r("div",{class:"eyebrow"},"Drone link",-1)),r("div",{class:Ee(["mt-1 text-sm font-semibold",le.value?(Ze=be.value)!=null&&Ze.connected?"text-success-fg":"text-danger-fg":"text-ink"])},S(be.value?le.value?be.value.connected?"connected":"no drone":"app offline":"—"),3)]),r("div",Xw,[M[32]||(M[32]=r("div",{class:"eyebrow"},"Model",-1)),r("div",Qw,S(((Ye=be.value)==null?void 0:Ye.model)||"—"),1)]),r("div",ek,[M[33]||(M[33]=r("div",{class:"eyebrow"},"Last update",-1)),r("div",tk,S((ht=be.value)!=null&&ht.lastSeenMs?$e(uu)(be.value.lastSeenMs):"—"),1)])],2),r("div",nk,[r("div",ik,[M[35]||(M[35]=r("div",{class:"mb-3 eyebrow"},"Battery",-1)),r("div",sk,[r("div",ok,[r("div",{class:Ee(["h-full transition-all",typeof ae.value.batteryPercent=="number"?ae.value.batteryPercent<20?"bg-warning":ae.value.batteryPercent<40?"bg-caution":"bg-ready":""]),style:Is({width:(typeof ae.value.batteryPercent=="number"?ae.value.batteryPercent:0)+"%"})},null,6)]),r("div",ak,[D(S(typeof ae.value.batteryPercent=="number"?ae.value.batteryPercent:"—"),1),M[34]||(M[34]=r("span",{class:"text-sm text-ink-secondary"},"%",-1))])])]),r("div",rk,[M[37]||(M[37]=r("div",{class:"mb-3 eyebrow"},"Altitude",-1)),r("div",lk,[D(S(U(ae.value.altitude,1)),1),M[36]||(M[36]=r("span",{class:"text-sm text-ink-secondary"}," m",-1))])]),r("div",uk,[M[42]||(M[42]=r("div",{class:"mb-3 eyebrow"},"Flight",-1)),r("div",ck,[r("div",dk,[M[38]||(M[38]=r("span",{class:"text-ink-secondary"},"Mode",-1)),r("b",fk,S(ae.value.flightMode||"—"),1)]),r("div",hk,[M[39]||(M[39]=r("span",{class:"text-ink-secondary"},"Flying",-1)),r("b",pk,S(ae.value.isFlying==null?"—":ae.value.isFlying?"yes":"no"),1)]),r("div",mk,[M[40]||(M[40]=r("span",{class:"text-ink-secondary"},"GPS sats",-1)),r("b",gk,S(ae.value.satelliteCount==null?"—":ae.value.satelliteCount),1)]),r("div",vk,[M[41]||(M[41]=r("span",{class:"text-ink-secondary"},"Speed (H)",-1)),r("b",_k,S(me.value==null?"—":U(me.value,2," m/s")),1)])])]),r("div",yk,[M[46]||(M[46]=r("div",{class:"mb-3 eyebrow"},"Position",-1)),r("div",bk,[r("div",xk,[M[43]||(M[43]=r("span",{class:"text-ink-secondary"},"Latitude",-1)),r("b",wk,S(U(ae.value.latitude,6)),1)]),r("div",kk,[M[44]||(M[44]=r("span",{class:"text-ink-secondary"},"Longitude",-1)),r("b",Sk,S(U(ae.value.longitude,6)),1)]),r("div",Tk,[M[45]||(M[45]=r("span",{class:"text-ink-secondary"},"Vert. speed",-1)),r("b",Pk,S(U(typeof ae.value.velocityZ=="number"?-ae.value.velocityZ:void 0,2," m/s")),1)])])]),r("div",Ck,[M[47]||(M[47]=r("div",{class:"mb-3 eyebrow"},"Track",-1)),z(hu,{position:ie.value,trail:rt.value},null,8,["position","trail"])]),r("div",Lk,[M[48]||(M[48]=r("div",{class:"mb-3 eyebrow"},"Send command",-1)),r("div",Mk,[oe(r("input",{"onUpdate:modelValue":M[7]||(M[7]=ue=>Ve.value=ue),class:"field flex-1",placeholder:"command (e.g. startConnection)"},null,512),[[xe,Ve.value]]),oe(r("input",{"onUpdate:modelValue":M[8]||(M[8]=ue=>pe.value=ue),class:"field flex-1",placeholder:"payload JSON (optional)"},null,512),[[xe,pe.value]]),r("button",{class:"btn-accent",onClick:Q},"Send")]),r("div",Ek,S(ze.value),1)]),r("div",Ok,[M[49]||(M[49]=r("div",{class:"mb-3 eyebrow"},"Event log",-1)),r("div",zk,[(p(!0),g(re,null,Be(y,(ue,Ae)=>(p(),g("div",{key:Ae,class:"border-b border-line py-1"},[r("span",Ak,S(ue.t),1),r("span",$k,S(ue.tag),1),r("span",Ik,S(ue.text),1)]))),128))])])])],64)):(p(),g("div",qw,[z(X,{name:"radio",size:28,class:"text-ink-muted"}),M[28]||(M[28]=r("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No aircraft online",-1)),M[29]||(M[29]=r("div",{class:"mt-1 text-xs text-ink-muted"},"Live telemetry appears here once a drone connects.",-1))]))])):ye.value==="Logbook"?(p(),at(Gb,{key:2,email:t.email,role:t.role,organization:t.organization,"organization-name":t.organizationName},null,8,["email","role","organization","organization-name"])):ye.value==="Documents"?(p(),at(A0,{key:3,email:t.email,role:t.role,organization:t.organization,"organization-name":t.organizationName},null,8,["email","role","organization","organization-name"])):ye.value==="Settings"?(p(),at(Jy,{key:4,email:t.email,role:t.role,organization:t.organization,"organization-name":t.organizationName,onLogout:M[9]||(M[9]=ue=>l("logout"))},null,8,["email","role","organization","organization-name"])):(p(),g("div",Dk,[r("div",Nk,[z(X,{name:Ie.value,size:28,class:"text-ink-muted"},null,8,["name"]),r("div",Rk,S(ye.value),1),ye.value==="Drives"?(p(),g("div",Fk,[M[50]||(M[50]=D(" Browse and transfer files here once a drive is connected. Configure drives in ",-1)),r("button",{class:"font-semibold text-accent hover:underline",onClick:M[10]||(M[10]=ue=>ye.value="Settings")},"Settings → Integrations"),M[51]||(M[51]=D(". ",-1))])):(p(),g("div",Bk,"This section is part of the console shell and has no backend yet."))])]))])])}}},Uk={key:0,class:"h-full"},Zk={key:1,class:"grid h-full place-items-center text-ink-muted text-sm"},Hk={__name:"App",setup(t){const i=j(!1),o=j(null),l=j("user"),u=j(""),d=j(""),h=j("");function v(T){l.value=T&&T.role||"user",u.value=T&&T.organization||"",d.value=T&&T.organizationName||""}fi(async()=>{h.value=(await qh()).apiBase||"";const T=await ou();T&&(o.value=T.email,v(T),await du()),i.value=!0});async function y(T){o.value=T,v(await ou()),await du()}async function C(){Dp(),await Jh(),o.value=null,l.value="user",u.value="",d.value=""}return(T,O)=>i.value?(p(),g("div",Uk,[o.value?(p(),at(Vk,{key:0,email:o.value,role:l.value,organization:u.value,"organization-name":d.value,onLogout:C},null,8,["email","role","organization","organization-name"])):(p(),at(Qp,{key:1,"default-api-base":h.value,onSignedIn:y},null,8,["default-api-base"]))])):(p(),g("div",Zk,"Loading…"))}};jh(Hk).mount("#app"); diff --git a/Web App/server/dist/assets/index-CYeDXsw9.css b/Web App/server/dist/assets/index-D0ghlckk.css similarity index 99% rename from Web App/server/dist/assets/index-CYeDXsw9.css rename to Web App/server/dist/assets/index-D0ghlckk.css index 4aacac5..0053adf 100644 --- a/Web App/server/dist/assets/index-CYeDXsw9.css +++ b/Web App/server/dist/assets/index-D0ghlckk.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-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-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-4fe25eb7],.fade-leave-active[data-v-4fe25eb7]{transition:opacity .2s}.fade-enter-from[data-v-4fe25eb7],.fade-leave-to[data-v-4fe25eb7]{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-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-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-2b0c86a6],.fade-leave-active[data-v-2b0c86a6]{transition:opacity .2s}.fade-enter-from[data-v-2b0c86a6],.fade-leave-to[data-v-2b0c86a6]{opacity:0} diff --git a/Web App/server/dist/index.html b/Web App/server/dist/index.html index c172fb4..1a5c597 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/web/src/components/Settings.vue b/Web App/web/src/components/Settings.vue index c6abba9..0214429 100644 --- a/Web App/web/src/components/Settings.vue +++ b/Web App/web/src/components/Settings.vue @@ -206,6 +206,68 @@ const OS_SCOPE_OPTS = [ { value: 'org', label: 'Organization', icon: 'users' }, ] +// Predefined bounding boxes (lamin,lomin,lamax,lomax). The picker offers these +// plus a "Custom…" option that reveals the free-text field for manual entry. +// Europe is the default (kept in sync with the API Server's defaultBBox). +const OS_BBOX_GROUPS = [ + { 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: 'Countries', options: [ + { value: '49,14.1,54.9,24.2', label: 'Poland' }, + { value: '50.5,3.2,53.7,7.3', label: 'Netherlands' }, + { value: '47.2,5.8,55.1,15.1', label: 'Germany' }, + { value: '41.3,-5.2,51.1,9.6', label: 'France' }, + { value: '49.9,-8.7,59,1.8', label: 'United Kingdom' }, + { value: '35.9,-9.6,43.8,3.4', label: 'Spain' }, + { value: '36.6,6.6,47.1,18.6', label: 'Italy' }, + { value: '24,-125,49.5,-66.5', label: 'United States' }, + ] }, +] +const OS_BBOX_FLAT = OS_BBOX_GROUPS.flatMap((g) => g.options) + +// Normalise a bbox string to "n1,n2,n3,n4" so preset matching ignores spacing +// and trailing-zero differences; returns '' when it isn't four valid numbers. +function osNormBbox(s) { + const parts = String(s || '').split(',').map((x) => x.trim()) + if (parts.length !== 4) return '' + const nums = parts.map(Number) + if (nums.some((n) => Number.isNaN(n))) return '' + return nums.join(',') +} +// Friendly label for a bbox value when it matches a preset (else ''). +function osBboxLabel(v) { + const norm = osNormBbox(v) + const m = norm && OS_BBOX_FLAT.find((o) => osNormBbox(o.value) === norm) + return m ? m.label : '' +} + +// Manual-entry toggle: sticky once the user picks "Custom…", and implied when +// the current value doesn't match any preset. +const osBboxCustom = ref(false) +const osBboxPreset = computed({ + get() { + if (osBboxCustom.value) return '__custom__' + const norm = osNormBbox(osForm.bbox) + const match = norm && OS_BBOX_FLAT.find((o) => osNormBbox(o.value) === norm) + return match ? match.value : '__custom__' + }, + set(v) { + if (v === '__custom__') { osBboxCustom.value = true; return } + osBboxCustom.value = false + osForm.bbox = v + }, +}) +const osBboxManual = computed(() => osBboxPreset.value === '__custom__') + // Superadmin edits the global layer in the API panel — read-only in the Web App. const osReadOnly = computed(() => os.isSuperadmin) // The scope key currently in view (superadmin always sees the single read-only view). @@ -233,6 +295,8 @@ function fillOsForm() { osForm.clientSecret = osField('clientSecret').own || '' osForm.plan = osField('plan').own || '' osForm.bbox = osField('bbox').own || '' + // Show the preset dropdown; the getter falls back to Custom for non-preset values. + osBboxCustom.value = false } function applyOpenSkyView(body) { @@ -1433,14 +1497,22 @@ onBeforeUnmount(() => { - + - +
+ + +