this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(e.shiftKey?3:1))},_createButton:function(e,n,s,a,c){var p=se("a",s,a);return p.innerHTML=e,p.href="#",p.title=n,p.setAttribute("role","button"),p.setAttribute("aria-label",n),_i(p),Ve(p,"click",wn),Ve(p,"click",c,this),Ve(p,"click",this._refocusOnMap,this),p},_updateDisabled:function(){var e=this._map,n="leaflet-disabled";ut(this._zoomInButton,n),ut(this._zoomOutButton,n),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||e._zoom===e.getMinZoom())&&(Oe(this._zoomOutButton,n),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||e._zoom===e.getMaxZoom())&&(Oe(this._zoomInButton,n),this._zoomInButton.setAttribute("aria-disabled","true"))}});Ge.mergeOptions({zoomControl:!0}),Ge.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Yt,this.addControl(this.zoomControl))});var Da=function(e){return new Yt(e)},Mo=Ht.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(e){var n="leaflet-control-scale",s=se("div",n),a=this.options;return this._addScales(a,n+"-line",s),e.on(a.updateWhenIdle?"moveend":"move",this._update,this),e.whenReady(this._update,this),s},onRemove:function(e){e.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(e,n,s){e.metric&&(this._mScale=se("div",n,s)),e.imperial&&(this._iScale=se("div",n,s))},_update:function(){var e=this._map,n=e.getSize().y/2,s=e.distance(e.containerPointToLatLng([0,n]),e.containerPointToLatLng([this.options.maxWidth,n]));this._updateScales(s)},_updateScales:function(e){this.options.metric&&e&&this._updateMetric(e),this.options.imperial&&e&&this._updateImperial(e)},_updateMetric:function(e){var n=this._getRoundNum(e),s=n<1e3?n+" m":n/1e3+" km";this._updateScale(this._mScale,s,n/e)},_updateImperial:function(e){var n=e*3.2808399,s,a,c;n>5280?(s=n/5280,a=this._getRoundNum(s),this._updateScale(this._iScale,a+" mi",a/s)):(c=this._getRoundNum(n),this._updateScale(this._iScale,c+" ft",c/n))},_updateScale:function(e,n,s){e.style.width=Math.round(this.options.maxWidth*s)+"px",e.innerHTML=n},_getRoundNum:function(e){var n=Math.pow(10,(Math.floor(e)+"").length-1),s=e/n;return s=s>=10?10:s>=5?5:s>=3?3:s>=2?2:1,n*s}}),Na=function(e){return new Mo(e)},as=' ',Gn=Ht.extend({options:{position:"bottomright",prefix:''+(_e.inlineSvg?as+" ":"")+"Leaflet "},initialize:function(e){X(this,e),this._attributions={}},onAdd:function(e){e.attributionControl=this,this._container=se("div","leaflet-control-attribution"),_i(this._container);for(var n in e._layers)e._layers[n].getAttribution&&this.addAttribution(e._layers[n].getAttribution());return this._update(),e.on("layeradd",this._addAttribution,this),this._container},onRemove:function(e){e.off("layeradd",this._addAttribution,this)},_addAttribution:function(e){e.layer.getAttribution&&(this.addAttribution(e.layer.getAttribution()),e.layer.once("remove",function(){this.removeAttribution(e.layer.getAttribution())},this))},setPrefix:function(e){return this.options.prefix=e,this._update(),this},addAttribution:function(e){return e?(this._attributions[e]||(this._attributions[e]=0),this._attributions[e]++,this._update(),this):this},removeAttribution:function(e){return e?(this._attributions[e]&&(this._attributions[e]--,this._update()),this):this},_update:function(){if(this._map){var e=[];for(var n in this._attributions)this._attributions[n]&&e.push(n);var s=[];this.options.prefix&&s.push(this.options.prefix),e.length&&s.push(e.join(", ")),this._container.innerHTML=s.join(' | ')}}});Ge.mergeOptions({attributionControl:!0}),Ge.addInitHook(function(){this.options.attributionControl&&new Gn().addTo(this)});var rs=function(e){return new Gn(e)};Ht.Layers=Lo,Ht.Zoom=Yt,Ht.Scale=Mo,Ht.Attribution=Gn,$i.layers=$a,$i.zoom=Da,$i.scale=Na,$i.attribution=rs;var ct=Re.extend({initialize:function(e){this._map=e},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});ct.addTo=function(e,n){return e.addHandler(n,this),this};var yi={Events:he},Di=_e.touch?"touchstart mousedown":"mousedown",Jt=De.extend({options:{clickTolerance:3},initialize:function(e,n,s,a){X(this,a),this._element=e,this._dragStartTarget=n||e,this._preventOutline=s},enable:function(){this._enabled||(Ve(this._dragStartTarget,Di,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Jt._dragging===this&&this.finishDrag(!0),st(this._dragStartTarget,Di,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(e){if(this._enabled&&(this._moved=!1,!mi(this._element,"leaflet-zoom-anim"))){if(e.touches&&e.touches.length!==1){Jt._dragging===this&&this.finishDrag();return}if(!(Jt._dragging||e.shiftKey||e.which!==1&&e.button!==1&&!e.touches)&&(Jt._dragging=this,this._preventOutline&&ns(this._element),$s(),gi(),!this._moving)){this.fire("down");var n=e.touches?e.touches[0]:e,s=ko(this._element);this._startPoint=new ne(n.clientX,n.clientY),this._startPos=On(this._element),this._parentScale=Rs(s);var a=e.type==="mousedown";Ve(document,a?"mousemove":"touchmove",this._onMove,this),Ve(document,a?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(e){if(this._enabled){if(e.touches&&e.touches.length>1){this._moved=!0;return}var n=e.touches&&e.touches.length===1?e.touches[0]:e,s=new ne(n.clientX,n.clientY)._subtract(this._startPoint);!s.x&&!s.y||Math.abs(s.x)+Math.abs(s.y)p&&(P=A,p=N);p>s&&(n[P]=1,Xe(e,n,s,a,P),Xe(e,n,s,P,c))}function An(e,n){for(var s=[e[0]],a=1,c=0,p=e.length;an&&(s.push(e[a]),c=a);return cn.max.x&&(s|=2),e.yn.max.y&&(s|=8),s}function Ba(e,n){var s=n.x-e.x,a=n.y-e.y;return s*s+a*a}function $n(e,n,s,a){var c=n.x,p=n.y,P=s.x-c,A=s.y-p,N=P*P+A*A,q;return N>0&&(q=((e.x-c)*P+(e.y-p)*A)/N,q>1?(c=s.x,p=s.y):q>0&&(c+=P*q,p+=A*q)),P=e.x-c,A=e.y-p,a?P*P+A*A:new ne(c,p)}function Lt(e){return!me(e[0])||typeof e[0][0]!="object"&&typeof e[0][0]<"u"}function Bi(e){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Lt(e)}function bi(e,n){var s,a,c,p,P,A,N,q;if(!e||e.length===0)throw new Error("latlngs not passed");Lt(e)||(console.warn("latlngs are not flat! Only the first ring will be used"),e=e[0]);var fe=W([0,0]),Ie=$(e),qe=Ie.getNorthWest().distanceTo(Ie.getSouthWest())*Ie.getNorthEast().distanceTo(Ie.getNorthWest());qe<1700&&(fe=qn(e));var jt=e.length,Mt=[];for(s=0;sa){N=(p-a)/c,q=[A.x-N*(A.x-P.x),A.y-N*(A.y-P.y)];break}var Xt=n.unproject(ge(q));return W([Xt.lat+fe.lat,Xt.lng+fe.lng])}var kn={__proto__:null,simplify:Yn,pointToSegmentDistance:Ri,closestPointOnSegment:Ra,clipSegment:ls,_getEdgeIntersection:us,_getBitCode:In,_sqClosestPointOnSegment:$n,isFlat:Lt,_flat:Bi,polylineCenter:bi},Sn={project:function(e){return new ne(e.lng,e.lat)},unproject:function(e){return new I(e.y,e.x)},bounds:new Me([-180,-90],[180,90])},Vi={R:6378137,R_MINOR:6356752314245179e-9,bounds:new Me([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(e){var n=Math.PI/180,s=this.R,a=e.lat*n,c=this.R_MINOR/s,p=Math.sqrt(1-c*c),P=p*Math.sin(a),A=Math.tan(Math.PI/4-a/2)/Math.pow((1-P)/(1+P),p/2);return a=-s*Math.log(Math.max(A,1e-10)),new ne(e.lng*n*s,a)},unproject:function(e){for(var n=180/Math.PI,s=this.R,a=this.R_MINOR/s,c=Math.sqrt(1-a*a),p=Math.exp(-e.y/s),P=Math.PI/2-2*Math.atan(p),A=0,N=.1,q;A<15&&Math.abs(N)>1e-7;A++)q=c*Math.sin(P),q=Math.pow((1-q)/(1+q),c/2),N=Math.PI/2-2*Math.atan(p*q)-P,P+=N;return new I(P*n,e.x*n/s)}},Oo={__proto__:null,LonLat:Sn,Mercator:Vi,SphericalMercator:lt},Va=u({},O,{code:"EPSG:3395",projection:Vi,transformation:(function(){var e=.5/(Math.PI*Vi.R);return b(e,.5,-e,.5)})()}),Bs=u({},O,{code:"EPSG:4326",projection:Sn,transformation:b(1/180,1,-1/180,.5)}),zo=u({},C,{projection:Sn,transformation:b(1,0,-1,0),scale:function(e){return Math.pow(2,e)},zoom:function(e){return Math.log(e)/Math.LN2},distance:function(e,n){var s=n.lng-e.lng,a=n.lat-e.lat;return Math.sqrt(s*s+a*a)},infinite:!0});C.Earth=O,C.EPSG3395=Va,C.EPSG3857=g,C.EPSG900913=M,C.EPSG4326=Bs,C.Simple=zo;var nn=De.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(e){return e.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(e){return e&&e.removeLayer(this),this},getPane:function(e){return this._map.getPane(e?this.options[e]||e:this.options.pane)},addInteractiveTarget:function(e){return this._map._targets[y(e)]=this,this},removeInteractiveTarget:function(e){return delete this._map._targets[y(e)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(e){var n=e.target;if(n.hasLayer(this)){if(this._map=n,this._zoomAnimated=n._zoomAnimated,this.getEvents){var s=this.getEvents();n.on(s,this),this.once("remove",function(){n.off(s,this)},this)}this.onAdd(n),this.fire("add"),n.fire("layeradd",{layer:this})}}});Ge.include({addLayer:function(e){if(!e._layerAdd)throw new Error("The provided object is not a Layer.");var n=y(e);return this._layers[n]?this:(this._layers[n]=e,e._mapToAdd=this,e.beforeAdd&&e.beforeAdd(this),this.whenReady(e._layerAdd,e),this)},removeLayer:function(e){var n=y(e);return this._layers[n]?(this._loaded&&e.onRemove(this),delete this._layers[n],this._loaded&&(this.fire("layerremove",{layer:e}),e.fire("remove")),e._map=e._mapToAdd=null,this):this},hasLayer:function(e){return y(e)in this._layers},eachLayer:function(e,n){for(var s in this._layers)e.call(n,this._layers[s]);return this},_addLayers:function(e){e=e?me(e)?e:[e]:[];for(var n=0,s=e.length;nthis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()=2&&n[0]instanceof I&&n[0].equals(n[s-1])&&n.pop(),n},_setLatLngs:function(e){Xn.prototype._setLatLngs.call(this,e),Lt(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Lt(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var e=this._renderer._bounds,n=this.options.weight,s=new ne(n,n);if(e=new Me(e.min.subtract(s),e.max.add(s)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(e))){if(this.options.noClip){this._parts=this._rings;return}for(var a=0,c=this._rings.length,p;ae.y!=c.y>e.y&&e.x<(c.x-a.x)*(e.y-a.y)/(c.y-a.y)+a.x&&(n=!n);return n||Xn.prototype._containsPoint.call(this,e,!0)}});function zc(e,n){return new fs(e,n)}var Qn=Pn.extend({initialize:function(e,n){X(this,n),this._layers={},e&&this.addData(e)},addData:function(e){var n=me(e)?e:e.features,s,a,c;if(n){for(s=0,a=n.length;s0&&c.push(c[0].slice()),c}function hs(e,n){return e.feature?u({},e.feature,{geometry:n}):No(n)}function No(e){return e.type==="Feature"||e.type==="FeatureCollection"?e:{type:"Feature",properties:{},geometry:e}}var Ha={toGeoJSON:function(e){return hs(this,{type:"Point",coordinates:Za(this.getLatLng(),e)})}};ds.include(Ha),Qe.include(Ha),G.include(Ha),Xn.include({toGeoJSON:function(e){var n=!Lt(this._latlngs),s=Do(this._latlngs,n?1:0,!1,e);return hs(this,{type:(n?"Multi":"")+"LineString",coordinates:s})}}),fs.include({toGeoJSON:function(e){var n=!Lt(this._latlngs),s=n&&!Lt(this._latlngs[0]),a=Do(this._latlngs,s?2:n?1:0,!0,e);return n||(a=[a]),hs(this,{type:(s?"Multi":"")+"Polygon",coordinates:a})}}),xi.include({toMultiPoint:function(e){var n=[];return this.eachLayer(function(s){n.push(s.toGeoJSON(e).geometry.coordinates)}),hs(this,{type:"MultiPoint",coordinates:n})},toGeoJSON:function(e){var n=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(n==="MultiPoint")return this.toMultiPoint(e);var s=n==="GeometryCollection",a=[];return this.eachLayer(function(c){if(c.toGeoJSON){var p=c.toGeoJSON(e);if(s)a.push(p.geometry);else{var P=No(p);P.type==="FeatureCollection"?a.push.apply(a,P.features):a.push(P)}}}),s?hs(this,{geometries:a,type:"GeometryCollection"}):{type:"FeatureCollection",features:a}}});function Rr(e,n){return new Qn(e,n)}var Ac=Rr,Ro=nn.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(e,n,s){this._url=e,this._bounds=$(n),X(this,s)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(Oe(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){it(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(e){return this.options.opacity=e,this._image&&this._updateOpacity(),this},setStyle:function(e){return e.opacity&&this.setOpacity(e.opacity),this},bringToFront:function(){return this._map&&ln(this._image),this},bringToBack:function(){return this._map&&bn(this._image),this},setUrl:function(e){return this._url=e,this._image&&(this._image.src=e),this},setBounds:function(e){return this._bounds=$(e),this._map&&this._reset(),this},getEvents:function(){var e={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(e.zoomanim=this._animateZoom),e},setZIndex:function(e){return this.options.zIndex=e,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var e=this._url.tagName==="IMG",n=this._image=e?this._url:se("img");if(Oe(n,"leaflet-image-layer"),this._zoomAnimated&&Oe(n,"leaflet-zoom-animated"),this.options.className&&Oe(n,this.options.className),n.onselectstart=z,n.onmousemove=z,n.onload=h(this.fire,this,"load"),n.onerror=h(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(n.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),e){this._url=n.src;return}n.src=this._url,n.alt=this.options.alt},_animateZoom:function(e){var n=this._map.getZoomScale(e.zoom),s=this._map._latLngBoundsToNewLayerBounds(this._bounds,e.zoom,e.center).min;St(this._image,s,n)},_reset:function(){var e=this._image,n=new Me(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),s=n.getSize();vt(e,n.min),e.style.width=s.x+"px",e.style.height=s.y+"px"},_updateOpacity:function(){Dt(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var e=this.options.errorOverlayUrl;e&&this._url!==e&&(this._url=e,this._image.src=e)},getCenter:function(){return this._bounds.getCenter()}}),Ic=function(e,n,s){return new Ro(e,n,s)},Fr=Ro.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var e=this._url.tagName==="VIDEO",n=this._image=e?this._url:se("video");if(Oe(n,"leaflet-image-layer"),this._zoomAnimated&&Oe(n,"leaflet-zoom-animated"),this.options.className&&Oe(n,this.options.className),n.onselectstart=z,n.onmousemove=z,n.onloadeddata=h(this.fire,this,"load"),e){for(var s=n.getElementsByTagName("source"),a=[],c=0;c0?a:[n.src];return}me(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(n.style,"objectFit")&&(n.style.objectFit="fill"),n.autoplay=!!this.options.autoplay,n.loop=!!this.options.loop,n.muted=!!this.options.muted,n.playsInline=!!this.options.playsInline;for(var p=0;p×',Ve(a,"click",function(c){Ct(c),this.close()},this)}},_updateLayout:function(){var e=this._contentNode,n=e.style;n.width="",n.whiteSpace="nowrap";var s=e.offsetWidth;s=Math.min(s,this.options.maxWidth),s=Math.max(s,this.options.minWidth),n.width=s+1+"px",n.whiteSpace="",n.height="";var a=e.offsetHeight,c=this.options.maxHeight,p="leaflet-popup-scrolled";c&&a>c?(n.height=c+"px",Oe(e,p)):ut(e,p),this._containerWidth=this._container.offsetWidth},_animateZoom:function(e){var n=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center),s=this._getAnchor();vt(this._container,n.add(s))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var e=this._map,n=parseInt(Ei(this._container,"marginBottom"),10)||0,s=this._container.offsetHeight+n,a=this._containerWidth,c=new ne(this._containerLeft,-s-this._containerBottom);c._add(On(this._container));var p=e.layerPointToContainerPoint(c),P=ge(this.options.autoPanPadding),A=ge(this.options.autoPanPaddingTopLeft||P),N=ge(this.options.autoPanPaddingBottomRight||P),q=e.getSize(),fe=0,Ie=0;p.x+a+N.x>q.x&&(fe=p.x+a-q.x+N.x),p.x-fe-A.x<0&&(fe=p.x-A.x),p.y+s+N.y>q.y&&(Ie=p.y+s-q.y+N.y),p.y-Ie-A.y<0&&(Ie=p.y-A.y),(fe||Ie)&&(this.options.keepInView&&(this._autopanning=!0),e.fire("autopanstart").panBy([fe,Ie]))}},_getAnchor:function(){return ge(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Nc=function(e,n){return new Fo(e,n)};Ge.mergeOptions({closePopupOnClick:!0}),Ge.include({openPopup:function(e,n,s){return this._initOverlay(Fo,e,n,s).openOn(this),this},closePopup:function(e){return e=arguments.length?e:this._popup,e&&e.close(),this}}),nn.include({bindPopup:function(e,n){return this._popup=this._initOverlay(Fo,this._popup,e,n),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(e){return this._popup&&(this instanceof Pn||(this._popup._source=this),this._popup._prepareOpen(e||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(e){return this._popup&&this._popup.setContent(e),this},getPopup:function(){return this._popup},_openPopup:function(e){if(!(!this._popup||!this._map)){wn(e);var n=e.layer||e.target;if(this._popup._source===n&&!(n instanceof f)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(e.latlng);return}this._popup._source=n,this.openPopup(e.latlng)}},_movePopup:function(e){this._popup.setLatLng(e.latlng)},_onKeyPress:function(e){e.originalEvent.keyCode===13&&this._openPopup(e)}});var Bo=Dn.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(e){Dn.prototype.onAdd.call(this,e),this.setOpacity(this.options.opacity),e.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(e){Dn.prototype.onRemove.call(this,e),e.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var e=Dn.prototype.getEvents.call(this);return this.options.permanent||(e.preclick=this.close),e},_initLayout:function(){var e="leaflet-tooltip",n=e+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=se("div",n),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+y(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(e){var n,s,a=this._map,c=this._container,p=a.latLngToContainerPoint(a.getCenter()),P=a.layerPointToContainerPoint(e),A=this.options.direction,N=c.offsetWidth,q=c.offsetHeight,fe=ge(this.options.offset),Ie=this._getAnchor();A==="top"?(n=N/2,s=q):A==="bottom"?(n=N/2,s=0):A==="center"?(n=N/2,s=q/2):A==="right"?(n=0,s=q/2):A==="left"?(n=N,s=q/2):P.xthis.options.maxZoom||sa?this._retainParent(c,p,P,a):!1)},_retainChildren:function(e,n,s,a){for(var c=2*e;c<2*e+2;c++)for(var p=2*n;p<2*n+2;p++){var P=new ne(c,p);P.z=s+1;var A=this._tileCoordsToKey(P),N=this._tiles[A];if(N&&N.active){N.retain=!0;continue}else N&&N.loaded&&(N.retain=!0);s+1this.options.maxZoom||this.options.minZoom!==void 0&&c1){this._setView(e,s);return}for(var Ie=c.min.y;Ie<=c.max.y;Ie++)for(var qe=c.min.x;qe<=c.max.x;qe++){var jt=new ne(qe,Ie);if(jt.z=this._tileZoom,!!this._isValidTile(jt)){var Mt=this._tiles[this._tileCoordsToKey(jt)];Mt?Mt.current=!0:P.push(jt)}}if(P.sort(function(Xt,ms){return Xt.distanceTo(p)-ms.distanceTo(p)}),P.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var dn=document.createDocumentFragment();for(qe=0;qes.max.x)||!n.wrapLat&&(e.ys.max.y))return!1}if(!this.options.bounds)return!0;var a=this._tileCoordsToBounds(e);return $(this.options.bounds).overlaps(a)},_keyToBounds:function(e){return this._tileCoordsToBounds(this._keyToTileCoords(e))},_tileCoordsToNwSe:function(e){var n=this._map,s=this.getTileSize(),a=e.scaleBy(s),c=a.add(s),p=n.unproject(a,e.z),P=n.unproject(c,e.z);return[p,P]},_tileCoordsToBounds:function(e){var n=this._tileCoordsToNwSe(e),s=new te(n[0],n[1]);return this.options.noWrap||(s=this._map.wrapLatLngBounds(s)),s},_tileCoordsToKey:function(e){return e.x+":"+e.y+":"+e.z},_keyToTileCoords:function(e){var n=e.split(":"),s=new ne(+n[0],+n[1]);return s.z=+n[2],s},_removeTile:function(e){var n=this._tiles[e];n&&(it(n.el),delete this._tiles[e],this.fire("tileunload",{tile:n.el,coords:this._keyToTileCoords(e)}))},_initTile:function(e){Oe(e,"leaflet-tile");var n=this.getTileSize();e.style.width=n.x+"px",e.style.height=n.y+"px",e.onselectstart=z,e.onmousemove=z,_e.ielt9&&this.options.opacity<1&&Dt(e,this.options.opacity)},_addTile:function(e,n){var s=this._getTilePos(e),a=this._tileCoordsToKey(e),c=this.createTile(this._wrapCoords(e),h(this._tileReady,this,e));this._initTile(c),this.createTile.length<2&&Ce(h(this._tileReady,this,e,null,c)),vt(c,s),this._tiles[a]={el:c,coords:e,current:!0},n.appendChild(c),this.fire("tileloadstart",{tile:c,coords:e})},_tileReady:function(e,n,s){n&&this.fire("tileerror",{error:n,tile:s,coords:e});var a=this._tileCoordsToKey(e);s=this._tiles[a],s&&(s.loaded=+new Date,this._map._fadeAnimated?(Dt(s.el,0),ee(this._fadeFrame),this._fadeFrame=Ce(this._updateOpacity,this)):(s.active=!0,this._pruneTiles()),n||(Oe(s.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:s.el,coords:e})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),_e.ielt9||!this._map._fadeAnimated?Ce(this._pruneTiles,this):setTimeout(h(this._pruneTiles,this),250)))},_getTilePos:function(e){return e.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(e){var n=new ne(this._wrapX?w(e.x,this._wrapX):e.x,this._wrapY?w(e.y,this._wrapY):e.y);return n.z=e.z,n},_pxBoundsToTileRange:function(e){var n=this.getTileSize();return new Me(e.min.unscaleBy(n).floor(),e.max.unscaleBy(n).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var e in this._tiles)if(!this._tiles[e].loaded)return!1;return!0}});function Bc(e){return new Us(e)}var ps=Us.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(e,n){this._url=e,n=X(this,n),n.detectRetina&&_e.retina&&n.maxZoom>0?(n.tileSize=Math.floor(n.tileSize/2),n.zoomReverse?(n.zoomOffset--,n.minZoom=Math.min(n.maxZoom,n.minZoom+1)):(n.zoomOffset++,n.maxZoom=Math.max(n.minZoom,n.maxZoom-1)),n.minZoom=Math.max(0,n.minZoom)):n.zoomReverse?n.minZoom=Math.min(n.maxZoom,n.minZoom):n.maxZoom=Math.max(n.minZoom,n.maxZoom),typeof n.subdomains=="string"&&(n.subdomains=n.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(e,n){return this._url===e&&n===void 0&&(n=!0),this._url=e,n||this.redraw(),this},createTile:function(e,n){var s=document.createElement("img");return Ve(s,"load",h(this._tileOnLoad,this,n,s)),Ve(s,"error",h(this._tileOnError,this,n,s)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(s.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(s.referrerPolicy=this.options.referrerPolicy),s.alt="",s.src=this.getTileUrl(e),s},getTileUrl:function(e){var n={r:_e.retina?"@2x":"",s:this._getSubdomain(e),x:e.x,y:e.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var s=this._globalTileRange.max.y-e.y;this.options.tms&&(n.y=s),n["-y"]=s}return Q(this._url,u(n,this.options))},_tileOnLoad:function(e,n){_e.ielt9?setTimeout(h(e,this,null,n),0):e(null,n)},_tileOnError:function(e,n,s){var a=this.options.errorTileUrl;a&&n.getAttribute("src")!==a&&(n.src=a),e(s,n)},_onTileRemove:function(e){e.tile.onload=null},_getZoomForUrl:function(){var e=this._tileZoom,n=this.options.maxZoom,s=this.options.zoomReverse,a=this.options.zoomOffset;return s&&(e=n-e),e+a},_getSubdomain:function(e){var n=Math.abs(e.x+e.y)%this.options.subdomains.length;return this.options.subdomains[n]},_abortLoading:function(){var e,n;for(e in this._tiles)if(this._tiles[e].coords.z!==this._tileZoom&&(n=this._tiles[e].el,n.onload=z,n.onerror=z,!n.complete)){n.src=de;var s=this._tiles[e].coords;it(n),delete this._tiles[e],this.fire("tileabort",{tile:n,coords:s})}},_removeTile:function(e){var n=this._tiles[e];if(n)return n.el.setAttribute("src",de),Us.prototype._removeTile.call(this,e)},_tileReady:function(e,n,s){if(!(!this._map||s&&s.getAttribute("src")===de))return Us.prototype._tileReady.call(this,e,n,s)}});function Ur(e,n){return new ps(e,n)}var Zr=ps.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(e,n){this._url=e;var s=u({},this.defaultWmsParams);for(var a in n)a in this.options||(s[a]=n[a]);n=X(this,n);var c=n.detectRetina&&_e.retina?2:1,p=this.getTileSize();s.width=p.x*c,s.height=p.y*c,this.wmsParams=s},onAdd:function(e){this._crs=this.options.crs||e.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var n=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[n]=this._crs.code,ps.prototype.onAdd.call(this,e)},getTileUrl:function(e){var n=this._tileCoordsToNwSe(e),s=this._crs,a=je(s.project(n[0]),s.project(n[1])),c=a.min,p=a.max,P=(this._wmsVersion>=1.3&&this._crs===Bs?[c.y,c.x,p.y,p.x]:[c.x,c.y,p.x,p.y]).join(","),A=ps.prototype.getTileUrl.call(this,e);return A+Ae(this.wmsParams,A,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+P},setParams:function(e,n){return u(this.wmsParams,e),n||this.redraw(),this}});function Vc(e,n){return new Zr(e,n)}ps.WMS=Zr,Ur.wms=Vc;var ei=nn.extend({options:{padding:.1},initialize:function(e){X(this,e),y(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),Oe(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var e={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(e.zoomanim=this._onAnimZoom),e},_onAnimZoom:function(e){this._updateTransform(e.center,e.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(e,n){var s=this._map.getZoomScale(n,this._zoom),a=this._map.getSize().multiplyBy(.5+this.options.padding),c=this._map.project(this._center,n),p=a.multiplyBy(-s).add(c).subtract(this._map._getNewPixelOrigin(e,n));_e.any3d?St(this._container,p,s):vt(this._container,p)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var e in this._layers)this._layers[e]._reset()},_onZoomEnd:function(){for(var e in this._layers)this._layers[e]._project()},_updatePaths:function(){for(var e in this._layers)this._layers[e]._update()},_update:function(){var e=this.options.padding,n=this._map.getSize(),s=this._map.containerPointToLayerPoint(n.multiplyBy(-e)).round();this._bounds=new Me(s,s.add(n.multiplyBy(1+e*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Hr=ei.extend({options:{tolerance:0},getEvents:function(){var e=ei.prototype.getEvents.call(this);return e.viewprereset=this._onViewPreReset,e},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){ei.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var e=this._container=document.createElement("canvas");Ve(e,"mousemove",this._onMouseMove,this),Ve(e,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Ve(e,"mouseout",this._handleMouseOut,this),e._leaflet_disable_events=!0,this._ctx=e.getContext("2d")},_destroyContainer:function(){ee(this._redrawRequest),delete this._ctx,it(this._container),st(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var e;this._redrawBounds=null;for(var n in this._layers)e=this._layers[n],e._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){ei.prototype._update.call(this);var e=this._bounds,n=this._container,s=e.getSize(),a=_e.retina?2:1;vt(n,e.min),n.width=a*s.x,n.height=a*s.y,n.style.width=s.x+"px",n.style.height=s.y+"px",_e.retina&&this._ctx.scale(2,2),this._ctx.translate(-e.min.x,-e.min.y),this.fire("update")}},_reset:function(){ei.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(e){this._updateDashArray(e),this._layers[y(e)]=e;var n=e._order={layer:e,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=n),this._drawLast=n,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(e){this._requestRedraw(e)},_removePath:function(e){var n=e._order,s=n.next,a=n.prev;s?s.prev=a:this._drawLast=a,a?a.next=s:this._drawFirst=s,delete e._order,delete this._layers[y(e)],this._requestRedraw(e)},_updatePath:function(e){this._extendRedrawBounds(e),e._project(),e._update(),this._requestRedraw(e)},_updateStyle:function(e){this._updateDashArray(e),this._requestRedraw(e)},_updateDashArray:function(e){if(typeof e.options.dashArray=="string"){var n=e.options.dashArray.split(/[, ]+/),s=[],a,c;for(c=0;c')}}catch{}return function(e){return document.createElement("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}})(),Uc={_initContainer:function(){this._container=se("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(ei.prototype._update.call(this),this.fire("update"))},_initPath:function(e){var n=e._container=Zs("shape");Oe(n,"leaflet-vml-shape "+(this.options.className||"")),n.coordsize="1 1",e._path=Zs("path"),n.appendChild(e._path),this._updateStyle(e),this._layers[y(e)]=e},_addPath:function(e){var n=e._container;this._container.appendChild(n),e.options.interactive&&e.addInteractiveTarget(n)},_removePath:function(e){var n=e._container;it(n),e.removeInteractiveTarget(n),delete this._layers[y(e)]},_updateStyle:function(e){var n=e._stroke,s=e._fill,a=e.options,c=e._container;c.stroked=!!a.stroke,c.filled=!!a.fill,a.stroke?(n||(n=e._stroke=Zs("stroke")),c.appendChild(n),n.weight=a.weight+"px",n.color=a.color,n.opacity=a.opacity,a.dashArray?n.dashStyle=me(a.dashArray)?a.dashArray.join(" "):a.dashArray.replace(/( *, *)/g," "):n.dashStyle="",n.endcap=a.lineCap.replace("butt","flat"),n.joinstyle=a.lineJoin):n&&(c.removeChild(n),e._stroke=null),a.fill?(s||(s=e._fill=Zs("fill")),c.appendChild(s),s.color=a.fillColor||a.color,s.opacity=a.fillOpacity):s&&(c.removeChild(s),e._fill=null)},_updateCircle:function(e){var n=e._point.round(),s=Math.round(e._radius),a=Math.round(e._radiusY||s);this._setPath(e,e._empty()?"M0 0":"AL "+n.x+","+n.y+" "+s+","+a+" 0,"+65535*360)},_setPath:function(e,n){e._path.v=n},_bringToFront:function(e){ln(e._container)},_bringToBack:function(e){bn(e._container)}},Vo=_e.vml?Zs:Z,Hs=ei.extend({_initContainer:function(){this._container=Vo("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Vo("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){it(this._container),st(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){ei.prototype._update.call(this);var e=this._bounds,n=e.getSize(),s=this._container;(!this._svgSize||!this._svgSize.equals(n))&&(this._svgSize=n,s.setAttribute("width",n.x),s.setAttribute("height",n.y)),vt(s,e.min),s.setAttribute("viewBox",[e.min.x,e.min.y,n.x,n.y].join(" ")),this.fire("update")}},_initPath:function(e){var n=e._path=Vo("path");e.options.className&&Oe(n,e.options.className),e.options.interactive&&Oe(n,"leaflet-interactive"),this._updateStyle(e),this._layers[y(e)]=e},_addPath:function(e){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(e._path),e.addInteractiveTarget(e._path)},_removePath:function(e){it(e._path),e.removeInteractiveTarget(e._path),delete this._layers[y(e)]},_updatePath:function(e){e._project(),e._update()},_updateStyle:function(e){var n=e._path,s=e.options;n&&(s.stroke?(n.setAttribute("stroke",s.color),n.setAttribute("stroke-opacity",s.opacity),n.setAttribute("stroke-width",s.weight),n.setAttribute("stroke-linecap",s.lineCap),n.setAttribute("stroke-linejoin",s.lineJoin),s.dashArray?n.setAttribute("stroke-dasharray",s.dashArray):n.removeAttribute("stroke-dasharray"),s.dashOffset?n.setAttribute("stroke-dashoffset",s.dashOffset):n.removeAttribute("stroke-dashoffset")):n.setAttribute("stroke","none"),s.fill?(n.setAttribute("fill",s.fillColor||s.color),n.setAttribute("fill-opacity",s.fillOpacity),n.setAttribute("fill-rule",s.fillRule||"evenodd")):n.setAttribute("fill","none"))},_updatePoly:function(e,n){this._setPath(e,B(e._parts,n))},_updateCircle:function(e){var n=e._point,s=Math.max(Math.round(e._radius),1),a=Math.max(Math.round(e._radiusY),1)||s,c="a"+s+","+a+" 0 1,0 ",p=e._empty()?"M0 0":"M"+(n.x-s)+","+n.y+c+s*2+",0 "+c+-s*2+",0 ";this._setPath(e,p)},_setPath:function(e,n){e._path.setAttribute("d",n)},_bringToFront:function(e){ln(e._path)},_bringToBack:function(e){bn(e._path)}});_e.vml&&Hs.include(Uc);function Wr(e){return _e.svg||_e.vml?new Hs(e):null}Ge.include({getRenderer:function(e){var n=e.options.renderer||this._getPaneRenderer(e.options.pane)||this.options.renderer||this._renderer;return n||(n=this._renderer=this._createRenderer()),this.hasLayer(n)||this.addLayer(n),n},_getPaneRenderer:function(e){if(e==="overlayPane"||e===void 0)return!1;var n=this._paneRenderers[e];return n===void 0&&(n=this._createRenderer({pane:e}),this._paneRenderers[e]=n),n},_createRenderer:function(e){return this.options.preferCanvas&&jr(e)||Wr(e)}});var Kr=fs.extend({initialize:function(e,n){fs.prototype.initialize.call(this,this._boundsToLatLngs(e),n)},setBounds:function(e){return this.setLatLngs(this._boundsToLatLngs(e))},_boundsToLatLngs:function(e){return e=$(e),[e.getSouthWest(),e.getNorthWest(),e.getNorthEast(),e.getSouthEast()]}});function Zc(e,n){return new Kr(e,n)}Hs.create=Vo,Hs.pointsToPath=B,Qn.geometryToLayer=Io,Qn.coordsToLatLng=Ua,Qn.coordsToLatLngs=$o,Qn.latLngToCoords=Za,Qn.latLngsToCoords=Do,Qn.getFeature=hs,Qn.asFeature=No,Ge.mergeOptions({boxZoom:!0});var Gr=ct.extend({initialize:function(e){this._map=e,this._container=e._container,this._pane=e._panes.overlayPane,this._resetStateTimeout=0,e.on("unload",this._destroy,this)},addHooks:function(){Ve(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){st(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){it(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(e){if(!e.shiftKey||e.which!==1&&e.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),gi(),$s(),this._startPoint=this._map.mouseEventToContainerPoint(e),Ve(document,{contextmenu:wn,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(e){this._moved||(this._moved=!0,this._box=se("div","leaflet-zoom-box",this._container),Oe(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(e);var n=new Me(this._point,this._startPoint),s=n.getSize();vt(this._box,n.min),this._box.style.width=s.x+"px",this._box.style.height=s.y+"px"},_finish:function(){this._moved&&(it(this._box),ut(this._container,"leaflet-crosshair")),zi(),Ds(),st(document,{contextmenu:wn,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(e){if(!(e.which!==1&&e.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(h(this._resetState,this),0);var n=new te(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(n).fire("boxzoomend",{boxZoomBounds:n})}},_onKeyDown:function(e){e.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});Ge.addInitHook("addHandler","boxZoom",Gr),Ge.mergeOptions({doubleClickZoom:!0});var qr=ct.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(e){var n=this._map,s=n.getZoom(),a=n.options.zoomDelta,c=e.originalEvent.shiftKey?s-a:s+a;n.options.doubleClickZoom==="center"?n.setZoom(c):n.setZoomAround(e.containerPoint,c)}});Ge.addInitHook("addHandler","doubleClickZoom",qr),Ge.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Yr=ct.extend({addHooks:function(){if(!this._draggable){var e=this._map;this._draggable=new Jt(e._mapPane,e._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),e.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),e.on("zoomend",this._onZoomEnd,this),e.whenReady(this._onZoomEnd,this))}Oe(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){ut(this._map._container,"leaflet-grab"),ut(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var e=this._map;if(e._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var n=$(this._map.options.maxBounds);this._offsetLimit=je(this._map.latLngToContainerPoint(n.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(n.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;e.fire("movestart").fire("dragstart"),e.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(e){if(this._map.options.inertia){var n=this._lastTime=+new Date,s=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(s),this._times.push(n),this._prunePositions(n)}this._map.fire("move",e).fire("drag",e)},_prunePositions:function(e){for(;this._positions.length>1&&e-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var e=this._map.getSize().divideBy(2),n=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=n.subtract(e).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(e,n){return e-(e-n)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var e=this._draggable._newPos.subtract(this._draggable._startPos),n=this._offsetLimit;e.xn.max.x&&(e.x=this._viscousLimit(e.x,n.max.x)),e.y>n.max.y&&(e.y=this._viscousLimit(e.y,n.max.y)),this._draggable._newPos=this._draggable._startPos.add(e)}},_onPreDragWrap:function(){var e=this._worldWidth,n=Math.round(e/2),s=this._initialWorldOffset,a=this._draggable._newPos.x,c=(a-n+s)%e+n-s,p=(a+n+s)%e-n-s,P=Math.abs(c+s)0?p:-p))-n;this._delta=0,this._startTime=null,P&&(e.options.scrollWheelZoom==="center"?e.setZoom(n+P):e.setZoomAround(this._lastMousePos,n+P))}});Ge.addInitHook("addHandler","scrollWheelZoom",Xr);var Hc=600;Ge.mergeOptions({tapHold:_e.touchNative&&_e.safari&&_e.mobile,tapTolerance:15});var Qr=ct.extend({addHooks:function(){Ve(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){st(this._map._container,"touchstart",this._onDown,this)},_onDown:function(e){if(clearTimeout(this._holdTimeout),e.touches.length===1){var n=e.touches[0];this._startPos=this._newPos=new ne(n.clientX,n.clientY),this._holdTimeout=setTimeout(h(function(){this._cancel(),this._isTapValid()&&(Ve(document,"touchend",Ct),Ve(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",n))},this),Hc),Ve(document,"touchend touchcancel contextmenu",this._cancel,this),Ve(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function e(){st(document,"touchend",Ct),st(document,"touchend touchcancel",e)},_cancel:function(){clearTimeout(this._holdTimeout),st(document,"touchend touchcancel contextmenu",this._cancel,this),st(document,"touchmove",this._onMove,this)},_onMove:function(e){var n=e.touches[0];this._newPos=new ne(n.clientX,n.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(e,n){var s=new MouseEvent(e,{bubbles:!0,cancelable:!0,view:window,screenX:n.screenX,screenY:n.screenY,clientX:n.clientX,clientY:n.clientY});s._simulated=!0,n.target.dispatchEvent(s)}});Ge.addInitHook("addHandler","tapHold",Qr),Ge.mergeOptions({touchZoom:_e.touch,bounceAtZoomLimits:!0});var el=ct.extend({addHooks:function(){Oe(this._map._container,"leaflet-touch-zoom"),Ve(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){ut(this._map._container,"leaflet-touch-zoom"),st(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(e){var n=this._map;if(!(!e.touches||e.touches.length!==2||n._animatingZoom||this._zooming)){var s=n.mouseEventToContainerPoint(e.touches[0]),a=n.mouseEventToContainerPoint(e.touches[1]);this._centerPoint=n.getSize()._divideBy(2),this._startLatLng=n.containerPointToLatLng(this._centerPoint),n.options.touchZoom!=="center"&&(this._pinchStartLatLng=n.containerPointToLatLng(s.add(a)._divideBy(2))),this._startDist=s.distanceTo(a),this._startZoom=n.getZoom(),this._moved=!1,this._zooming=!0,n._stop(),Ve(document,"touchmove",this._onTouchMove,this),Ve(document,"touchend touchcancel",this._onTouchEnd,this),Ct(e)}},_onTouchMove:function(e){if(!(!e.touches||e.touches.length!==2||!this._zooming)){var n=this._map,s=n.mouseEventToContainerPoint(e.touches[0]),a=n.mouseEventToContainerPoint(e.touches[1]),c=s.distanceTo(a)/this._startDist;if(this._zoom=n.getScaleZoom(c,this._startZoom),!n.options.bounceAtZoomLimits&&(this._zoomn.getMaxZoom()&&c>1)&&(this._zoom=n._limitZoom(this._zoom)),n.options.touchZoom==="center"){if(this._center=this._startLatLng,c===1)return}else{var p=s._add(a)._divideBy(2)._subtract(this._centerPoint);if(c===1&&p.x===0&&p.y===0)return;this._center=n.unproject(n.project(this._pinchStartLatLng,this._zoom).subtract(p),this._zoom)}this._moved||(n._moveStart(!0,!1),this._moved=!0),ee(this._animRequest);var P=h(n._move,n,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=Ce(P,this,!0),Ct(e)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,ee(this._animRequest),st(document,"touchmove",this._onTouchMove,this),st(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});Ge.addInitHook("addHandler","touchZoom",el),Ge.BoxZoom=Gr,Ge.DoubleClickZoom=qr,Ge.Drag=Yr,Ge.Keyboard=Jr,Ge.ScrollWheelZoom=Xr,Ge.TapHold=Qr,Ge.TouchZoom=el,o.Bounds=Me,o.Browser=_e,o.CRS=C,o.Canvas=Hr,o.Circle=Qe,o.CircleMarker=G,o.Class=Re,o.Control=Ht,o.DivIcon=Vr,o.DivOverlay=Dn,o.DomEvent=Co,o.DomUtil=Aa,o.Draggable=Jt,o.Evented=De,o.FeatureGroup=Pn,o.GeoJSON=Qn,o.GridLayer=Us,o.Handler=ct,o.Icon=cn,o.ImageOverlay=Ro,o.LatLng=I,o.LatLngBounds=te,o.Layer=nn,o.LayerGroup=xi,o.LineUtil=kn,o.Map=Ge,o.Marker=ds,o.Mixin=yi,o.Path=f,o.Point=ne,o.PolyUtil=Eo,o.Polygon=fs,o.Polyline=Xn,o.Popup=Fo,o.PosAnimation=Ii,o.Projection=Oo,o.Rectangle=Kr,o.Renderer=ei,o.SVG=Hs,o.SVGOverlay=Br,o.TileLayer=ps,o.Tooltip=Bo,o.Transformation=qt,o.Util=pe,o.VideoOverlay=Fr,o.bind=h,o.bounds=je,o.canvas=jr,o.circle=Ec,o.circleMarker=S,o.control=$i,o.divIcon=Fc,o.extend=u,o.featureGroup=pt,o.geoJSON=Rr,o.geoJson=Ac,o.gridLayer=Bc,o.icon=Vs,o.imageOverlay=Ic,o.latLng=W,o.latLngBounds=$,o.layerGroup=cs,o.map=os,o.marker=x,o.point=ge,o.polygon=zc,o.polyline=Oc,o.popup=Nc,o.rectangle=Zc,o.setOptions=X,o.stamp=y,o.svg=Wr,o.svgOverlay=Dc,o.tileLayer=Ur,o.tooltip=Rc,o.transformation=b,o.version=l,o.videoOverlay=$c;var jc=window.L;o.noConflict=function(){return window.L=jc,this},window.L=o}))})(Js,Js.exports)),Js.exports}var Zp=Up();const Go=Bp(Zp),Ql={__name:"DeviceMap",props:{position:{type:Object,default:null},trail:{type:Array,default:()=>[]}},setup(t){const i=t,o=K(null);let l,u,d;function h(){if(!l)return;const _=i.position;if(_&&(_.lat||_.lng)){const y=[_.lat,_.lng];u?u.setLatLng(y):(u=Go.marker(y).addTo(l),l.setView(y,17))}if(d&&d.remove(),i.trail.length){const y=getComputedStyle(document.documentElement).getPropertyValue("--accent").trim()||"#3D7BF0";d=Go.polyline(i.trail,{color:y,weight:3}).addTo(l)}}return Li(()=>{l=Go.map(o.value,{zoomControl:!0}).setView([20,0],2),Go.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:"© OpenStreetMap",maxZoom:19}).addTo(l),setTimeout(()=>l.invalidateSize(),60),h()}),en(()=>i.position,h,{deep:!0}),en(()=>i.trail,h,{deep:!0}),(_,y)=>(m(),v("div",{ref_key:"el",ref:o,class:"h-[320px] w-full rounded-lg"},null,512))}},Hp=["width","height","stroke-width"],jp=["d"],J={__name:"Icon",props:{name:{type:String,required:!0},size:{type:[Number,String],default:18},stroke:{type:[Number,String],default:2}},setup(t){const l=({grid:"M3 3h7v7H3zM14 3h7v7h-7zM14 14h7v7h-7zM3 14h7v7H3z",radio:"M4.9 19.1a10 10 0 0 1 0-14.2M7.8 16.2a6 6 0 0 1 0-8.4M16.2 7.8a6 6 0 0 1 0 8.4M19.1 4.9a10 10 0 0 1 0 14.2M12 13a1 1 0 1 0 0-2 1 1 0 0 0 0 2z",route:"M6 19a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM18 11a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM6 13V9a4 4 0 0 1 4-4h4",calendar:"M8 2v4M16 2v4M3 10h18M5 4h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z",book:"M4 19.5A2.5 2.5 0 0 1 6.5 17H20M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z",fileText:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8zM14 2v6h6M16 13H8M16 17H8M10 9H8",settings:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z",search:"M11 19a8 8 0 1 0 0-16 8 8 0 0 0 0 16zM21 21l-4.3-4.3",plus:"M12 5v14M5 12h14",battery:"M3 8h14a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H3a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1zM22 11v2",signal:"M2 20h.01M7 20v-4M12 20v-8M17 20V8M22 20V4",clock:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM12 7v5l3 2",chevronRight:"M9 6l6 6-6 6",play:"M6 3l14 9-14 9V3z",logout:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4M16 17l5-5-5-5M21 12H9",wind:"M12.8 19.6A2 2 0 1 0 14 16H2M17.5 8a2.5 2.5 0 1 1 2 4H2M9.6 4.6A2 2 0 1 1 11 8H2",drone:"M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8zM6 6 4 4M18 6l2-2M6 18l-2 2M18 18l2 2",user:"M20 21a8 8 0 1 0-16 0M12 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8z",users:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM23 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75",shield:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z",sliders:"M4 21v-7M4 10V3M12 21v-9M12 8V3M20 21v-5M20 12V3M1 14h6M9 8h6M17 16h6",alertTriangle:"M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0zM12 9v4M12 17h.01",download:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3",upload:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12",trash:"M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6M10 11v6M14 11v6",check:"M20 6 9 17l-5-5",mail:"M4 4h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2zM22 6l-10 7L2 6",lock:"M5 11h14a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-6a2 2 0 0 1 2-2zM7 11V7a5 5 0 0 1 10 0v4",monitor:"M3 4h18a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1zM8 21h8M12 17v4",globe:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM3 12h18M12 3a15 15 0 0 1 0 18 15 15 0 0 1 0-18z",smartphone:"M7 2h10a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zM11 18h2",image:"M4 4h16a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1zM8.5 11a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zM21 15l-5-5L5 21",type:"M4 7V4h16v3M9 20h6M12 4v16",sun:"M12 17a5 5 0 1 0 0-10 5 5 0 0 0 0 10zM12 1v2M12 21v2M4.2 4.2l1.4 1.4M18.4 18.4l1.4 1.4M1 12h2M21 12h2M4.2 19.8l1.4-1.4M18.4 5.6l1.4-1.4",moon:"M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z",x:"M18 6 6 18M6 6l12 12",server:"M20 4H4a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zM20 13H4a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-3a2 2 0 0 0-2-2zM6 7.5h.01M6 16.5h.01",cloud:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9z"}[t.name]||"").split(" M").map((u,d)=>d?"M"+u:u);return(u,d)=>(m(),v("svg",{width:t.size,height:t.size,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":t.stroke,"stroke-linecap":"round","stroke-linejoin":"round",style:{flex:"none"},"aria-hidden":"true"},[(m(!0),v(le,null,Fe(Ue(l),(h,_)=>(m(),v("path",{key:_,d:h},null,8,jp))),128))],8,Hp))}},Wp=["aria-checked","disabled"],sn={__name:"Toggle",props:{modelValue:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:i}){const o=i;return(l,u)=>(m(),v("button",{type:"button",role:"switch","aria-checked":t.modelValue,disabled:t.disabled,class:Le(["relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition disabled:opacity-40",t.modelValue?"bg-accent":"bg-surface-2 border border-line-strong"]),onClick:u[0]||(u[0]=d=>o("update:modelValue",!t.modelValue))},[r("span",{class:Le(["inline-block h-4 w-4 transform rounded-full bg-white shadow-sm transition",t.modelValue?"translate-x-6":"translate-x-1"])},null,2)],10,Wp))}},Kp={class:"inline-flex rounded-[10px] border border-line bg-surface-2 p-0.5"},Gp=["onClick"],hn={__name:"Segmented",props:{modelValue:{type:[String,Number],default:""},options:{type:Array,default:()=>[]}},emits:["update:modelValue"],setup(t,{emit:i}){const o=i;return(l,u)=>(m(),v("div",Kp,[(m(!0),v(le,null,Fe(t.options,d=>(m(),v("button",{key:d.value,type:"button",class:Le(["inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-[13px] font-semibold transition",t.modelValue===d.value?"bg-surface-1 text-ink shadow-xs":"text-ink-secondary hover:text-ink"]),onClick:h=>o("update:modelValue",d.value)},[d.icon?(m(),et(J,{key:0,name:d.icon,size:15},null,8,["name"])):R("",!0),D(" "+k(d.label),1)],10,Gp))),128))]))}},qp={class:"text-sm font-semibold text-ink"},Yp={key:0,class:"mt-0.5 text-xs text-ink-muted"},xe={__name:"Row",props:{title:{type:String,default:""},desc:{type:String,default:""},keywords:{type:String,default:""},block:{type:Boolean,default:!1}},setup(t){const i=t,o=to("settingsSearch",{value:""}),l=we(()=>{const u=(o.value||"").trim().toLowerCase();return u?`${i.title} ${i.desc} ${i.keywords}`.toLowerCase().includes(u):!0});return(u,d)=>l.value?(m(),v("div",{key:0,class:Le(["border-b border-line py-4 last:border-0",t.block?"":"flex items-center justify-between gap-6"])},[r("div",{class:Le(t.block?"mb-3":"min-w-0")},[r("div",qp,k(t.title),1),t.desc?(m(),v("div",Yp,k(t.desc),1)):R("",!0)],2),r("div",{class:Le(t.block?"":"shrink-0")},[lf(u.$slots,"default")],2)],2)):R("",!0)}},Jp=(t,i)=>{const o=t.__vccOpts||t;for(const[l,u]of i)o[l]=u;return o},Xp={class:"mx-auto max-w-[1280px] p-7"},Qp={class:"mb-5 flex flex-wrap items-end justify-between gap-4"},em={class:"flex h-10 w-full max-w-[280px] items-center gap-2 rounded border border-line-strong bg-surface-1 px-3"},tm={class:"grid grid-cols-[210px_1fr] gap-6 max-[760px]:grid-cols-1"},nm={class:"flex flex-col gap-0.5 max-[760px]:flex-row max-[760px]:overflow-x-auto"},im=["onClick"],sm={class:"whitespace-nowrap"},om={class:"min-w-0"},am={key:0,class:"panel p-10 text-center text-sm text-ink-muted"},rm={key:0,class:"eyebrow mb-2 mt-5 first:mt-0 flex items-center gap-2"},lm={key:1,class:"panel mb-5 p-5"},um={class:"flex items-center gap-1"},cm={class:"flex items-center gap-2"},dm={class:"font-mono text-sm text-ink"},fm={class:"inline-flex items-center gap-1 rounded-full bg-amber-soft px-2 py-0.5 text-[11px] font-semibold text-amber-fg"},hm={key:0,class:"mt-2 text-xs text-ink-muted"},pm={class:"grid max-w-[420px] gap-2"},mm={class:"flex items-center gap-3"},gm={key:2,class:"panel mb-5 p-5"},vm=["value"],_m=["value"],ym=["value"],bm={class:"font-mono text-sm text-ink"},xm={key:3},wm={key:0,class:"mb-5 flex items-center gap-1 overflow-x-auto border-b border-line"},km=["onClick"],Sm={key:1,class:"panel mb-5 p-5"},Pm={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},Tm={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},Cm={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},Lm={key:1,class:"mb-4 flex flex-col gap-2 border-b border-line pb-4 sm:flex-row sm:items-center sm:justify-between"},Mm={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},Em={key:0},Om={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},zm={class:"font-semibold text-ink-secondary"},Am={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},Im={key:7,class:"my-4 rounded-lg border border-line bg-surface-2 p-4","data-keywords":"credits usage quota remaining daily allowance rate limit"},$m={class:"flex items-center justify-between gap-3"},Dm={class:"flex items-center gap-2 text-sm font-semibold text-ink"},Nm={key:0,class:"text-[11px] text-ink-muted"},Rm={class:"mt-2 flex items-baseline gap-1.5"},Fm={class:"font-mono text-2xl font-semibold text-ink"},Bm={class:"text-sm text-ink-muted"},Vm={class:"mt-2 h-2 w-full overflow-hidden rounded-full bg-line"},Um={class:"mt-2 text-xs text-ink-muted"},Zm={class:"mt-2 text-sm text-ink"},Hm={class:"font-semibold"},jm={class:"mt-1 text-xs text-ink-muted"},Wm={key:1,class:"mt-2 text-xs text-ink-muted"},Km={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},Gm={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},qm={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Ym={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Jm={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Xm={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Qm={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},eg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},tg={key:8,class:"border-b border-line py-3 text-xs text-amber-fg"},ng={class:"mt-4 flex flex-wrap items-center gap-3"},ig=["disabled"],sg=["disabled"],og={key:2,class:"text-xs text-danger-fg"},ag={class:"panel mb-5 p-5"},rg={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},lg={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},ug={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},cg={key:1,class:"mb-4 flex flex-col gap-2 border-b border-line pb-4 sm:flex-row sm:items-center sm:justify-between"},dg={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},fg={key:0},hg={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},pg={class:"font-semibold text-ink-secondary"},mg={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},gg={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},vg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},_g={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},yg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},bg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},xg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},wg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},kg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Sg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Pg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Tg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Cg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Lg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Mg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Eg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Og={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},zg={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},Ag={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Ig={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},$g={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Dg={class:"mt-4 flex flex-wrap items-center gap-3"},Ng=["disabled"],Rg=["disabled"],Fg={key:2,class:"text-xs text-danger-fg"},Bg={key:3,class:"text-[11px] text-ink-muted"},Vg={class:"panel mb-5 p-5"},Ug={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},Zg={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},Hg={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},jg={key:1,class:"mb-4 flex flex-col gap-2 border-b border-line pb-4 sm:flex-row sm:items-center sm:justify-between"},Wg={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},Kg={key:0},Gg={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},qg={class:"font-semibold text-ink-secondary"},Yg={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},Jg={key:0,class:"inline-flex items-center gap-2 break-all font-mono text-sm text-ink"},Xg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Qg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},ev={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},tv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},nv={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},iv={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},sv={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},ov={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},av={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},rv={class:"mt-4 flex flex-wrap items-center gap-3"},lv=["disabled"],uv=["disabled"],cv={key:2,class:"text-xs text-danger-fg"},dv={key:3,class:"text-[11px] text-ink-muted"},fv={key:3,class:"panel mb-5 p-5"},hv={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},pv={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},mv={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},gv={key:1,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},vv={key:2,class:"mb-4 flex flex-col gap-2 border-b border-line pb-4 sm:flex-row sm:items-center sm:justify-between"},_v={key:5,class:"border-b border-line py-3 text-xs text-amber-fg"},yv={key:0},bv={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},xv={class:"font-semibold text-ink-secondary"},wv={key:7,class:"border-b border-line py-3 text-xs text-ink-muted"},kv={class:"flex w-full flex-col gap-2"},Sv={class:"break-all font-mono text-sm text-ink"},Pv={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Tv={key:1,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Cv={key:0,class:"text-xs text-ink-muted"},Lv={key:1,class:"border-b border-line py-3 text-xs text-ink-muted"},Mv={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},Ev={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Ov={class:"mt-4 flex flex-wrap items-center gap-3"},zv=["disabled"],Av=["disabled"],Iv={key:2,class:"text-xs text-danger-fg"},$v={key:3,class:"text-[11px] text-ink-muted"},Dv={key:4,class:"panel mb-5 p-5"},Nv={class:"flex items-center gap-4"},Rv=["src"],Fv={key:1,class:"grid h-16 w-16 place-items-center rounded-full bg-[var(--navy-800)] text-lg font-bold text-white"},Bv={class:"flex gap-2"},Vv={class:"btn-ghost cursor-pointer"},Uv={class:"mt-1 text-right text-[11px] text-ink-muted"},Zv={key:5,class:"panel mb-5 p-5"},Hv={class:"flex items-center gap-3"},jv={key:0,class:"mt-4 rounded-lg border border-line bg-surface-2 p-4"},Wv={class:"flex flex-wrap items-center gap-4"},Kv={class:"min-w-0"},Gv={class:"mt-1 select-all font-mono text-sm font-bold text-ink"},qv={class:"mt-3 flex items-center gap-2"},Yv={key:0,class:"mt-2 text-xs text-danger-fg"},Jv={key:1,class:"mt-4 rounded-lg border border-line bg-surface-2 p-4"},Xv={class:"mt-2 grid grid-cols-2 gap-1 font-mono text-xs text-ink-secondary sm:grid-cols-4"},Qv={class:"rounded-lg border border-line bg-surface-2 p-3"},e_={class:"flex items-center gap-3"},t_={class:"grid h-9 w-9 place-items-center rounded-full bg-accent-soft text-accent-soft-fg"},n_={class:"min-w-0 flex-1"},i_={class:"text-sm font-semibold text-ink"},s_={class:"font-mono text-[11px] text-ink-muted"},o_={key:6,class:"mb-5"},a_={key:0,class:"panel mb-5 p-5"},r_={class:"grid max-w-[520px] gap-2"},l_={class:"flex flex-wrap gap-2"},u_=["disabled","title"],c_=["value"],d_=["value"],f_={class:"flex items-center gap-2 py-1 text-sm text-ink-secondary"},h_={class:"flex items-center gap-3"},p_=["disabled"],m_={key:0,class:"text-xs text-danger-fg"},g_={key:1,class:"text-xs text-ink-muted"},v_={key:1,class:"panel mb-5 p-5"},__={class:"grid max-w-[520px] gap-2"},y_={class:"flex flex-wrap gap-2"},b_=["value"],x_=["value"],w_={key:1,class:"text-xs text-ink-muted"},k_={class:"font-semibold text-ink-secondary"},S_={class:"flex items-center gap-3"},P_=["disabled"],T_={key:0,class:"text-xs text-danger-fg"},C_={class:"panel overflow-hidden p-0"},L_={class:"flex items-center justify-between px-5 py-4"},M_=["disabled"],E_={key:0,class:"px-5 pb-5 text-sm text-danger-fg"},O_={key:1,class:"px-5 pb-8 text-sm text-ink-muted"},z_={key:2,class:"overflow-x-auto"},A_={class:"w-full border-collapse text-sm"},I_={class:"text-left"},$_={class:"px-5 py-3"},D_={class:"text-ink"},N_={key:0,class:"ml-1.5 text-[11px] text-ink-muted"},R_={class:"px-5 py-3"},F_={class:"px-5 py-3"},B_={class:"px-5 py-3"},V_={class:"px-5 py-3 text-right"},U_=["onClick"],Z_={key:1,class:"inline-flex items-center gap-1.5"},H_=["onClick"],j_=["onClick"],W_={key:7,class:"mb-5"},K_={key:0,class:"panel mb-5 p-5"},G_={class:"grid max-w-[520px] gap-2"},q_={class:"flex items-center gap-3"},Y_={key:0,class:"text-xs text-danger-fg"},J_={key:1,class:"panel mb-5 p-5"},X_={class:"grid max-w-[520px] gap-2"},Q_={class:"flex items-center gap-3"},ey=["disabled"],ty={key:0,class:"text-xs text-danger-fg"},ny={class:"panel overflow-hidden p-0"},iy={key:0,class:"px-5 pb-8 text-sm text-ink-muted"},sy={key:1,class:"overflow-x-auto"},oy={class:"w-full border-collapse text-sm"},ay={class:"text-left"},ry={class:"px-5 py-3"},ly={class:"inline-flex items-center gap-2 text-ink"},uy={class:"px-5 py-3 text-ink-secondary"},cy={class:"px-5 py-3 text-right"},dy=["onClick"],fy={key:1,class:"inline-flex items-center gap-1.5"},hy=["onClick"],py=["disabled","title","onClick"],my={key:8,class:"mb-5"},gy={class:"panel mb-5 p-5"},vy={class:"btn-ghost cursor-pointer"},_y={key:0,class:"mt-2 text-xs text-ink-muted"},yy={class:"rounded-lg border p-5",style:{"border-color":"color-mix(in srgb, var(--danger) 35%, transparent)",background:"var(--danger-soft)"}},by={class:"flex items-center gap-2 text-danger-fg"},xy={class:"mt-4 rounded-lg border border-line bg-surface-1 p-4"},wy={class:"mt-3 flex items-start gap-2 text-sm text-ink-secondary"},ky={class:"mt-3"},Sy={class:"eyebrow mb-1 block"},Py={class:"text-ink"},Ty=["placeholder"],Cy={class:"mt-4 flex flex-wrap items-center gap-3"},Ly=["disabled"],My=["disabled"],Ey={key:2,class:"text-xs text-ink-muted"},Oy={key:0,class:"mt-3 rounded border border-line bg-surface-2 px-3 py-2 text-xs text-ink-secondary"},zy={key:0,class:"fixed bottom-5 right-5 z-20 flex items-center gap-2 rounded-lg border border-line bg-surface-1 px-4 py-2.5 text-sm text-ink shadow-md"},eu="pv.opensky.health",tu="pv.filetransfer.health",nu="pv.webdav.health",iu="pv.localstorage.health",Ay={__name:"Settings",props:{email:{type:String,default:""},role:{type:String,default:"user"},organization:{type:String,default:""},organizationName:{type:String,default:""}},emits:["logout"],setup(t,{emit:i}){const o=t,l=i,u=we(()=>o.role==="superadmin"),d=we(()=>o.role==="admin"||o.role==="superadmin");function h(x){return x==="superadmin"?"Superadmin":x==="admin"?"Admin":"User"}function _(x){return x==="superadmin"||x==="admin"?"shield":"user"}function y(x){return x==="superadmin"||x==="admin"?T.accent:T.neutral}const T={success:"bg-success-soft text-success-fg",warning:"bg-amber-soft text-amber-fg",danger:"bg-danger-soft text-danger-fg",accent:"bg-accent-soft text-accent-soft-fg",neutral:"bg-surface-2 text-ink-secondary"},w=we(()=>{const x=[{id:"account",label:"Account",icon:"user",kw:"name username email password verification login credentials role"},{id:"appearance",label:"Appearance",icon:"sliders",kw:"theme light dark system language region font size accessibility date time format motion"},{id:"integrations",label:"Integrations",icon:"radio",kw:"opensky flights adsb aircraft plugin oauth credentials bounding box plan connection ftp sftp ftps file transfer server host upload download local storage folder drive isolated private read only webdav nextcloud owncloud dav url https"},{id:"profile",label:"Profile",icon:"image",kw:"avatar photo display name bio public"},{id:"security",label:"Privacy & Security",icon:"shield",kw:"two factor authentication 2fa sessions devices logout security privacy"}];return d.value&&x.push({id:"team",label:"User management",icon:"users",kw:"users team members add remove create delete role admin permissions rights organization"}),u.value&&x.push({id:"organizations",label:"Organizations",icon:"grid",kw:"organization org tenant company create rename delete members"}),x.push({id:"advanced",label:"Advanced",icon:"alertTriangle",kw:"export import data delete account danger zone",danger:!0}),x}),z=K("account"),U=K("");Iu("settingsSearch",U);const V=we(()=>U.value.trim().length>0),ue=we(()=>U.value.trim().toLowerCase());function X(x){return ue.value?(x.label+" "+x.kw).toLowerCase().includes(ue.value)||$e(x.id):!0}const Ae={account:["full name","username","email address verification verify","password change current new"],appearance:["theme light dark system","language","region","font size accessibility","reduce motion","date format","time format clock"],integrations:["opensky live flights","enable plugin","oauth client id secret","plan credits","bounding box","test connection","file transfer ftp sftp ftps","server host port username password","private key passphrase","base path directory","local storage folder drive","private isolated folder","read only access mode","webdav nextcloud owncloud dav","server url username password tls","base path directory folder"],profile:["profile photo avatar","display name","bio about","show email public"],security:["two factor authentication","active sessions devices","sign out"],team:["add user create account","members list role admin remove delete","organization org assign"],organizations:["add organization create","rename organization","delete organization members"],advanced:["export data download","import data upload","delete account permanent danger"]};function $e(x){return ue.value?(Ae[x]||[]).some(f=>f.includes(ue.value)):!0}const Q=we(()=>V.value?w.value.filter(X):w.value.filter(x=>x.id===z.value)),me=we({get:()=>Yi.value,set:x=>la(x)}),oe=[{value:"light",label:"Light",icon:"sun"},{value:"dark",label:"Dark",icon:"moon"},{value:"system",label:"System",icon:"monitor"}],de=[{value:"sm",label:"Small"},{value:"md",label:"Default"},{value:"lg",label:"Large"}],Ne=[{value:"12",label:"12-hour"},{value:"24",label:"24-hour"}],nt=[["en","English"],["es","Español"],["de","Deutsch"],["fr","Français"],["pl","Polski"],["ja","日本語"]],ke=[["US","United States"],["GB","United Kingdom"],["EU","European Union"],["CA","Canada"],["AU","Australia"],["JP","Japan"]],Te=[["MDY","MM/DD/YYYY"],["DMY","DD/MM/YYYY"],["YMD","YYYY/MM/DD"],["ISO","YYYY-MM-DD"]],Be=K(Date.now());let Ce=null;const ee=we(()=>Yl(Be.value)),pe=bt({loaded:!1,available:!1,orgEnabled:!0,allowAnonymous:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),Re=K("user"),Ze=bt({clientId:"",clientSecret:"",plan:"",bbox:""}),he=K(""),De=K(!1),ne=K(!1),rt=K(null),ge=K(null),Me=we(()=>rt.value&&rt.value.credits||null),je=we(()=>{const x=Me.value;return!x||!x.daily||x.remaining==null?null:Math.max(0,Math.min(100,Math.round(x.remaining/x.daily*100)))}),te=we(()=>{const x=je.value;return x==null?"bg-accent":x<=10?"bg-danger":x<=30?"bg-amber":"bg-success"});function $(x){return typeof x=="number"?x.toLocaleString():x}function I(){if(!ge.value)return"";const x=Math.max(0,Math.round((Date.now()-ge.value)/1e3));if(x<60)return"just now";const f=Math.round(x/60);if(f<60)return`${f} min ago`;const G=Math.round(f/60);return G<24?`${G} h ago`:`${Math.round(G/24)} d ago`}function W(){try{rt.value&&localStorage.setItem(eu,JSON.stringify({health:rt.value,ts:ge.value}))}catch{}}function C(){try{const x=localStorage.getItem(eu);if(!x)return;const f=JSON.parse(x);f&&f.health&&(rt.value=f.health,ge.value=f.ts||null)}catch{}}const O=[{value:"",label:"Not set"},{value:"anonymous",label:"Anonymous"},{value:"standard",label:"Standard"},{value:"contributor",label:"Contributor"}],ht=[{value:"user",label:"My settings",icon:"user"},{value:"org",label:"Organization",icon:"users"}],lt=we(()=>pe.isSuperadmin),qt=we(()=>pe.isSuperadmin?"user":Re.value),b=we(()=>pe.scopes[qt.value]||{editableLayer:"user",fields:{}}),g=we(()=>qt.value==="org");function M(x){return b.value.fields[x]||{effective:"",own:"",source:"unset",locked:!1}}function Z(x){return lt.value||M(x).locked}function B(x){const f=M(x).source;return f==="global"?"Set by administrator":f==="org"?"Set by your organization":""}function H(){Ze.clientId=M("clientId").own||"",Ze.clientSecret=M("clientSecret").own||"",Ze.plan=M("plan").own||"",Ze.bbox=M("bbox").own||""}function ie(x){pe.available=!!x.available,pe.orgEnabled=x.orgEnabled!==!1,pe.allowAnonymous=!!x.allowAnonymous,pe.enabled=!!x.enabled,pe.canEditOrg=!!x.canEditOrg,pe.isSuperadmin=!!x.isSuperadmin,pe.scopes=x.scopes||{},Re.value==="org"&&!pe.canEditOrg&&(Re.value="user"),H(),pe.loaded=!0}en(Re,()=>{he.value="",H()});async function F(){C();const{ok:x,body:f}=await Yh();x&&ie(f)}async function Y(x){const f=g.value;f?pe.orgEnabled=x:pe.enabled=x;const{ok:G,body:S}=await Wl(f?{scope:"org",enabled:x}:{scope:"user",enabled:x});G?(ie(S),Je(f?x?"OpenSky enabled for your organization.":"OpenSky disabled for your organization.":x?"OpenSky enabled.":"OpenSky disabled.")):(f?pe.orgEnabled=!x:pe.enabled=!x,Je(S.error||"Could not update."))}async function j(){he.value="",De.value=!0;const x={};for(const Qe of["clientId","clientSecret","plan","bbox"])Z(Qe)||(x[Qe]=Ze[Qe]);const f={scope:qt.value,config:x};g.value||(f.enabled=pe.enabled);const{ok:G,body:S}=await Wl(f);if(De.value=!1,!G){he.value=S.error||"Could not save settings.";return}ie(S),Je(g.value?"Organization OpenSky settings saved.":"OpenSky settings saved.")}async function Se(){ne.value=!0,rt.value=null;const{ok:x,body:f}=await Jh();ne.value=!1,rt.value=x&&f.health?f.health:{status:"down",detail:f.error||"Probe failed."},ge.value=Date.now(),W()}function ce(x){return x==="ok"?T.success:x==="degraded"?T.warning:T.danger}const ae=bt({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),Pe=K("user"),We=["protocol","host","port","username","password","privateKey","keyPassphrase","hostKeyFingerprint","insecureSkipVerify","basePath"],be=bt(Object.fromEntries(We.map(x=>[x,""]))),Ye=K(""),dt=K(!1),gt=K(!1),_t=K(null),Tt=K(null),_n=[{value:"sftp",label:"SFTP"},{value:"ftps",label:"FTPS"},{value:"ftp",label:"FTP"}],ci=[{value:"false",label:"Verify certificate"},{value:"true",label:"Skip verification"}],kt=we(()=>ae.isSuperadmin),$t=we(()=>ae.isSuperadmin?"user":Pe.value),En=we(()=>ae.scopes[$t.value]||{editableLayer:"user",fields:{}}),Vt=we(()=>$t.value==="org"),Ji=we(()=>(Ut("protocol")?zt("protocol").effective:be.protocol)||"sftp");function zt(x){return En.value.fields[x]||{effective:"",own:"",source:"unset",locked:!1}}function Ut(x){return kt.value||zt(x).locked}function yt(x){const f=zt(x).source;return f==="global"?"Set by administrator":f==="org"?"Set by your organization":""}function wa(x){return(_n.find(f=>f.value===x)||{}).label||x||"—"}function vo(){for(const x of We)be[x]=zt(x).own||"";be.protocol||(be.protocol="sftp"),be.insecureSkipVerify||(be.insecureSkipVerify="false")}function Ls(x){ae.available=!!x.available,ae.orgEnabled=x.orgEnabled!==!1,ae.enabled=!!x.enabled,ae.canEditOrg=!!x.canEditOrg,ae.isSuperadmin=!!x.isSuperadmin,ae.scopes=x.scopes||{},Pe.value==="org"&&!ae.canEditOrg&&(Pe.value="user"),vo(),ae.loaded=!0}en(Pe,()=>{Ye.value="",vo()});function ka(){if(!Tt.value)return"";const x=Math.max(0,Math.round((Date.now()-Tt.value)/1e3));if(x<60)return"just now";const f=Math.round(x/60);if(f<60)return`${f} min ago`;const G=Math.round(f/60);return G<24?`${G} h ago`:`${Math.round(G/24)} d ago`}function Sa(){try{_t.value&&localStorage.setItem(tu,JSON.stringify({health:_t.value,ts:Tt.value}))}catch{}}function Pa(){try{const x=localStorage.getItem(tu);if(!x)return;const f=JSON.parse(x);f&&f.health&&(_t.value=f.health,Tt.value=f.ts||null)}catch{}}async function Ms(){Pa();const{ok:x,body:f}=await Xh();x&&Ls(f)}async function _o(x){const f=Vt.value;f?ae.orgEnabled=x:ae.enabled=x;const{ok:G,body:S}=await Kl(f?{scope:"org",enabled:x}:{scope:"user",enabled:x});G?(Ls(S),Je(f?x?"File transfer enabled for your organization.":"File transfer disabled for your organization.":x?"File transfer enabled.":"File transfer disabled.")):(f?ae.orgEnabled=!x:ae.enabled=!x,Je(S.error||"Could not update."))}async function Ta(){Ye.value="",dt.value=!0;const x={};for(const Qe of We)Ut(Qe)||(x[Qe]=be[Qe]);const f={scope:$t.value,config:x};Vt.value||(f.enabled=ae.enabled);const{ok:G,body:S}=await Kl(f);if(dt.value=!1,!G){Ye.value=S.error||"Could not save settings.";return}Ls(S),Je(Vt.value?"Organization file-transfer settings saved.":"File-transfer settings saved.")}async function Ca(){gt.value=!0,_t.value=null;const{ok:x,body:f}=await Qh();gt.value=!1,_t.value=x&&f.health?f.health:{status:"down",detail:f.error||"Probe failed."},Tt.value=Date.now(),Sa()}function La(x){return x==="ok"?T.success:x==="degraded"?T.warning:T.danger}const Ke=bt({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),_e=K("user"),Xi=["baseURL","username","password","insecureSkipVerify","basePath"],At=bt(Object.fromEntries(Xi.map(x=>[x,""]))),di=K(""),Mi=K(!1),fi=K(!1),an=K(null),tn=K(null),yo=[{value:"false",label:"Verify certificate"},{value:"true",label:"Skip verification"}],Es=we(()=>Ke.isSuperadmin),Os=we(()=>Ke.isSuperadmin?"user":_e.value),Ma=we(()=>Ke.scopes[Os.value]||{editableLayer:"user",fields:{}}),rn=we(()=>Os.value==="org");function yn(x){return Ma.value.fields[x]||{effective:"",own:"",source:"unset",locked:!1}}function hi(x){return Es.value||yn(x).locked}function Zt(x){const f=yn(x).source;return f==="global"?"Set by administrator":f==="org"?"Set by your organization":""}function bo(){for(const x of Xi)At[x]=yn(x).own||"";At.insecureSkipVerify||(At.insecureSkipVerify="false")}function zs(x){Ke.available=!!x.available,Ke.orgEnabled=x.orgEnabled!==!1,Ke.enabled=!!x.enabled,Ke.canEditOrg=!!x.canEditOrg,Ke.isSuperadmin=!!x.isSuperadmin,Ke.scopes=x.scopes||{},_e.value==="org"&&!Ke.canEditOrg&&(_e.value="user"),bo(),Ke.loaded=!0}en(_e,()=>{di.value="",bo()});function Ea(){if(!tn.value)return"";const x=Math.max(0,Math.round((Date.now()-tn.value)/1e3));if(x<60)return"just now";const f=Math.round(x/60);if(f<60)return`${f} min ago`;const G=Math.round(f/60);return G<24?`${G} h ago`:`${Math.round(G/24)} d ago`}function Oa(){try{an.value&&localStorage.setItem(nu,JSON.stringify({health:an.value,ts:tn.value}))}catch{}}function za(){try{const x=localStorage.getItem(nu);if(!x)return;const f=JSON.parse(x);f&&f.health&&(an.value=f.health,tn.value=f.ts||null)}catch{}}async function As(){za();const{ok:x,body:f}=await np();x&&zs(f)}async function pi(x){const f=rn.value;f?Ke.orgEnabled=x:Ke.enabled=x;const{ok:G,body:S}=await Gl(f?{scope:"org",enabled:x}:{scope:"user",enabled:x});G?(zs(S),Je(f?x?"WebDAV enabled for your organization.":"WebDAV disabled for your organization.":x?"WebDAV enabled.":"WebDAV disabled.")):(f?Ke.orgEnabled=!x:Ke.enabled=!x,Je(S.error||"Could not update."))}async function xo(){di.value="",Mi.value=!0;const x={};for(const Qe of Xi)hi(Qe)||(x[Qe]=At[Qe]);const f={scope:Os.value,config:x};rn.value||(f.enabled=Ke.enabled);const{ok:G,body:S}=await Gl(f);if(Mi.value=!1,!G){di.value=S.error||"Could not save settings.";return}zs(S),Je(rn.value?"Organization WebDAV settings saved.":"WebDAV settings saved.")}async function wo(){fi.value=!0,an.value=null;const{ok:x,body:f}=await ip();fi.value=!1,an.value=x&&f.health?f.health:{status:"down",detail:f.error||"Probe failed."},tn.value=Date.now(),Oa()}function Ei(x){return x==="ok"?T.success:x==="degraded"?T.warning:T.danger}const se=bt({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,isOrgUser:!1,mounts:[],privateFolder:!1,privateEnabled:!1,allowPrivate:!0,rootConfigured:!1,scopes:{}}),it=K("user"),jn=K(""),ln=K(""),bn=K(!1),mi=K(!1),Oe=K(null),ut=K(null),Wn=K({}),Oi=[{value:"",label:"Inherit"},{value:"false",label:"Read-write"},{value:"true",label:"Read-only"}],Dt=we(()=>se.isSuperadmin),Is=we(()=>se.isSuperadmin?"user":it.value),Qi=we(()=>se.scopes[Is.value]||{editableLayer:"user",fields:{}}),St=we(()=>Is.value==="org");function vt(x){return Qi.value.fields[x]||{effective:"",own:"",source:"unset",locked:!1}}function On(x){return Dt.value||vt(x).locked}function gi(x){const f=vt(x).source;return f==="global"?"Set by administrator":f==="org"?"Set by your organization":""}function zi(x){return(Oi.find(f=>f.value===x)||{}).label||"Inherit"}function es(){jn.value=vt("readOnly").own||""}function xn(x){se.available=!!x.available,se.orgEnabled=x.orgEnabled!==!1,se.enabled=!!x.enabled,se.canEditOrg=!!x.canEditOrg,se.isSuperadmin=!!x.isSuperadmin,se.isOrgUser=!!x.isOrgUser,se.mounts=Array.isArray(x.mounts)?x.mounts:[],se.privateFolder=!!x.privateFolder,se.privateEnabled=!!x.privateEnabled,se.allowPrivate=x.allowPrivate!==!1,se.rootConfigured=!!x.rootConfigured,se.scopes=x.scopes||{},it.value==="org"&&!se.canEditOrg&&(it.value="user"),es(),se.loaded=!0}en(it,()=>{ln.value="",es()});function $s(){if(!ut.value)return"";const x=Math.max(0,Math.round((Date.now()-ut.value)/1e3));if(x<60)return"just now";const f=Math.round(x/60);if(f<60)return`${f} min ago`;const G=Math.round(f/60);return G<24?`${G} h ago`:`${Math.round(G/24)} d ago`}function Ds(){try{Oe.value&&localStorage.setItem(iu,JSON.stringify({health:Oe.value,ts:ut.value}))}catch{}}function ts(){try{const x=localStorage.getItem(iu);if(!x)return;const f=JSON.parse(x);f&&f.health&&(Oe.value=f.health,ut.value=f.ts||null)}catch{}}async function Ns(){ts();const{ok:x,body:f}=await ep();x&&xn(f)}async function ns(x){const f=St.value;f?se.orgEnabled=x:se.enabled=x;const{ok:G,body:S}=await Ko(f?{scope:"org",enabled:x}:{scope:"user",enabled:x});G?(xn(S),Je(f?x?"Local storage enabled for your organization.":"Local storage disabled for your organization.":x?"Local storage enabled.":"Local storage disabled.")):(f?se.orgEnabled=!x:se.enabled=!x,Je(S.error||"Could not update."))}async function is(x){se.privateFolder=x;const{ok:f,body:G}=await Ko({scope:"user",privateFolder:x});f?(xn(G),Je(x?"Private folder enabled.":"Private folder disabled.")):(se.privateFolder=!x,Je(G.error||"Could not update."))}async function ko(x){se.allowPrivate=x;const{ok:f,body:G}=await Ko({scope:"org",allowPrivate:x});f?(xn(G),Je(x?"Members may now create private folders.":"Private folders disabled for your organization.")):(se.allowPrivate=!x,Je(G.error||"Could not update."))}async function Rs(){ln.value="",bn.value=!0;const x={};On("readOnly")||(x.readOnly=jn.value);const f={scope:Is.value,config:x};St.value||(f.enabled=se.enabled);const{ok:G,body:S}=await Ko(f);if(bn.value=!1,!G){ln.value=S.error||"Could not save settings.";return}xn(S),Je(St.value?"Organization local-storage settings saved.":"Local-storage settings saved.")}async function Aa(){mi.value=!0,Oe.value=null,Wn.value={};const{ok:x,body:f}=await tp();mi.value=!1,Oe.value=x&&f.health?f.health:{status:"down",detail:f.error||"Probe failed."};const G={};if(Array.isArray(f.mounts))for(const S of f.mounts)G[S.id]={status:S.status,detail:S.detail};Wn.value=G,ut.value=Date.now(),Ds()}function Ve(x){return x==="ok"?T.success:x==="degraded"?T.warning:T.danger}const un=[{id:"apis-external",label:"APIs — External",icon:"globe"},{id:"drives-external",label:"Drives — External",icon:"server"},{id:"drives-local",label:"Drives — Local",icon:"monitor"}],st=K("apis-external");function ss(x){return V.value||st.value===x}const vi=K("");let Ai=null;function Je(x){vi.value=x,clearTimeout(Ai),Ai=setTimeout(()=>vi.value="",2200)}const wt=bt({current:"",next:"",confirm:""}),zn=K(""),_i=K(!1);function Ct(){if(_i.value=!1,!wt.current)return zn.value="Enter your current password.";if(wt.next.length<8)return zn.value="New password must be at least 8 characters.";if(wt.next!==wt.confirm)return zn.value="New passwords do not match.";zn.value="Validated. Connecting to the account service is pending — no password endpoint yet.",wt.current=wt.next=wt.confirm=""}const wn=K("");function So(){wn.value="Verification link would be sent once the account service is wired up."}function Po(x){const f=x.target.files&&x.target.files[0];if(!f)return;if(f.size>1.5*1024*1024){Je("Image too large (max ~1.5 MB).");return}const G=new FileReader;G.onload=()=>{ze.avatar=String(G.result),Je("Photo updated.")},G.readAsDataURL(f)}function Ia(){ze.avatar="",Je("Photo removed.")}const To=we(()=>{var G,S,Qe;const f=(ze.displayName||ze.name||o.email||"PV").split("@")[0].split(/[.\-_ ]+/).filter(Boolean);return((((G=f[0])==null?void 0:G[0])||"P")+(((S=f[1])==null?void 0:S[0])||((Qe=f[0])==null?void 0:Qe[1])||"V")).toUpperCase()}),Kn=K(!1),Co=K(""),Ii=K(""),Ge=K(""),os=K([]);function Ht(x){const f="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";let G="";for(let S=0;SHt(4).toLowerCase()+"-"+Ht(4).toLowerCase()),Ge.value=""}function $a(){ze.twoFactor=!1,os.value=[],Kn.value=!1}const Yt=navigator.userAgent;function Da(){return/Edg\//.test(Yt)?"Edge":/OPR\//.test(Yt)?"Opera":/Chrome\//.test(Yt)?"Chrome":/Firefox\//.test(Yt)?"Firefox":/Safari\//.test(Yt)?"Safari":"Browser"}function Mo(){return/Windows/.test(Yt)?"Windows":/Mac OS X/.test(Yt)?"macOS":/Android/.test(Yt)?"Android":/iPhone|iPad/.test(Yt)?"iOS":/Linux/.test(Yt)?"Linux":"Unknown OS"}const Na=Date.now(),as=K([]),Gn=K(!1),rs=K(""),ct=bt({email:"",password:"",role:"user",organization:""}),yi=K(""),Di=K(!1),Jt=K(""),Fs=we(()=>{const x=[{value:"user",label:"User"},{value:"admin",label:"Admin"}];return u.value&&x.push({value:"superadmin",label:"Superadmin"}),x}),Ni=K([]);async function qn(){if(!d.value)return;const x=await Hh();x.ok&&(Ni.value=x.organizations.slice().sort((f,G)=>f.name.localeCompare(G.name)))}const Eo=we(()=>{const x=Ni.value.map(f=>({value:f.id,label:f.name}));return u.value&&x.unshift({value:"",label:"No organization"}),x});async function Yn(){if(!d.value)return;Gn.value=!0,rs.value="";const x=await Bh();if(Gn.value=!1,!x.ok){rs.value=x.status===403?"Manager role required.":"Could not load users.";return}as.value=x.users.slice().sort((f,G)=>f.email.localeCompare(G.email))}function Ri(x){try{const f=x.data||{},G=Object.keys(f)[0];return G&&f[G]&&f[G].message||x.message||x.error||"Invalid input."}catch{return x.error||"Could not create user."}}async function Ra(){yi.value="";const x=ct.email.trim().toLowerCase();if(!x.includes("@"))return yi.value="Enter a valid email.";if(ct.password.length<8)return yi.value="Password must be at least 8 characters.";Di.value=!0;const f=u.value?ct.organization:o.organization,{ok:G,body:S}=await Vh(x,ct.password,ct.role,f);if(Di.value=!1,!G)return yi.value=Ri(S);ct.email="",ct.password="",ct.role="user",ct.organization="",Je("User created."),Yn()}async function Fa(x){const{ok:f,body:G}=await Zh(x.id);if(Jt.value="",!f)return Je(G.error||"Could not remove user.");Je("User removed."),Yn()}const Xe=bt({id:"",email:"",role:"user",verified:!1,password:"",organization:""}),An=K(""),Fi=K(!1),ls=we(()=>!!Xe.id&&Xe.email===o.email);function us(x){Jt.value="",Xe.id=x.id,Xe.email=x.email,Xe.role=x.role||"user",Xe.verified=!!x.verified,Xe.password="",Xe.organization=x.organization||"",An.value=""}function In(){Xe.id="",An.value=""}async function Ba(){An.value="";const x=Xe.email.trim().toLowerCase();if(!x.includes("@"))return An.value="Enter a valid email.";if(Xe.password&&Xe.password.length<8)return An.value="New password must be at least 8 characters (or leave blank).";const f={email:x,role:Xe.role,verified:Xe.verified};u.value&&(f.organization=Xe.organization),Xe.password&&(f.password=Xe.password),Fi.value=!0;const{ok:G,body:S}=await Uh(Xe.id,f);if(Fi.value=!1,!G)return An.value=Ri(S);Je("User updated."),In(),Yn()}const $n=bt({name:""}),Lt=K(""),Bi=K(!1),bi=K(""),kn=bt({id:"",name:""}),Sn=K(""),Vi=we(()=>{const x={};for(const f of as.value)f.organization&&(x[f.organization]=(x[f.organization]||0)+1);return x});async function Oo(){Lt.value="";const x=$n.name.trim();if(!x)return Lt.value="Enter an organization name.";Bi.value=!0;const{ok:f,body:G}=await jh(x);if(Bi.value=!1,!f)return Lt.value=Ri(G);$n.name="",Je("Organization created."),qn()}function Va(x){bi.value="",kn.id=x.id,kn.name=x.name,Sn.value=""}function Bs(){kn.id="",Sn.value=""}async function zo(){Sn.value="";const x=kn.name.trim();if(!x)return Sn.value="Enter an organization name.";const{ok:f,body:G}=await Wh(kn.id,x);if(!f)return Sn.value=Ri(G);Je("Organization renamed."),Bs(),qn(),Yn()}async function nn(x){const{ok:f,body:G}=await Kh(x.id);if(bi.value="",!f)return Je(G.error||"Could not delete organization.");Je("Organization deleted."),qn()}function xi(){const x={_app:"PilotVault",_kind:"settings-export",exportedAt:new Date().toISOString(),email:o.email,prefs:{...ze},themeMode:Yi.value},f=new Blob([JSON.stringify(x,null,2)],{type:"application/json"}),G=URL.createObjectURL(f),S=document.createElement("a");S.href=G,S.download=`pilotvault-settings-${new Date().toISOString().slice(0,10)}.json`,document.body.appendChild(S),S.click(),S.remove(),URL.revokeObjectURL(G),Je("Settings exported.")}const cs=K("");function Pn(x){const f=x.target.files&&x.target.files[0];if(!f)return;const G=new FileReader;G.onload=()=>{try{const S=JSON.parse(String(G.result)),Qe=S.prefs||S;if(!Cc(Qe))throw new Error("bad shape");S.themeMode&&la(S.themeMode),Ar(ze.fontSize),Ir(ze.reduceMotion),cs.value="Settings imported and applied."}catch{cs.value="That file is not a valid PilotVault settings export."}},G.readAsText(f),x.target.value=""}const pt=bt({understand:!1,typed:"",cooldown:0,armed:!1,msg:""});let cn=null;const Vs=we(()=>o.email||"DELETE MY ACCOUNT"),Jn=we(()=>pt.understand&&pt.typed===Vs.value);function Ao(){Jn.value&&(pt.armed=!0,pt.cooldown=5,clearInterval(cn),cn=setInterval(()=>{pt.cooldown--,pt.cooldown<=0&&clearInterval(cn)},1e3))}en(Jn,x=>{!x&&pt.armed&&(pt.armed=!1,pt.cooldown=0,clearInterval(cn))});function ds(){if(!(!pt.armed||pt.cooldown>0)){try{localStorage.removeItem("pv_prefs")}catch{}pt.msg="Account deletion requires the account service. Local data was cleared and you were signed out.",setTimeout(()=>l("logout"),900)}}return Li(()=>{Ce=setInterval(()=>Be.value=Date.now(),1e3),qn(),Yn(),F(),Ms(),As(),Ns()}),_a(()=>{clearInterval(Ce),clearInterval(cn),clearTimeout(Ai)}),(x,f)=>(m(),v("div",Xp,[r("div",Qp,[f[62]||(f[62]=r("div",null,[r("div",{class:"eyebrow"},"Preferences"),r("h2",{class:"mt-0.5 text-[22px] font-bold tracking-tightest text-ink"},"Settings")],-1)),r("div",em,[E(J,{name:"search",size:16,class:"text-ink-muted"}),re(r("input",{"onUpdate:modelValue":f[0]||(f[0]=G=>U.value=G),placeholder:"Search settings…",class:"w-full border-none bg-transparent text-sm text-ink outline-none placeholder:text-ink-muted"},null,512),[[ve,U.value]]),U.value?(m(),v("button",{key:0,class:"text-ink-muted hover:text-ink","aria-label":"Clear search",onClick:f[1]||(f[1]=G=>U.value="")},[E(J,{name:"x",size:15})])):R("",!0)])]),r("div",tm,[re(r("nav",nm,[(m(!0),v(le,null,Fe(w.value,G=>(m(),v("button",{key:G.id,class:Le(["flex items-center gap-2.5 rounded px-3 py-2.5 text-left text-sm transition",[z.value===G.id?G.danger?"bg-danger-soft font-semibold text-danger-fg":"bg-accent-soft font-semibold text-accent-soft-fg":G.danger?"font-medium text-danger-fg hover:bg-danger-soft":"font-medium text-ink-secondary hover:bg-surface-2"]]),onClick:S=>z.value=G.id},[E(J,{name:G.icon,size:17},null,8,["name"]),r("span",sm,k(G.label),1)],10,im))),128))],512),[[ah,!V.value]]),r("div",om,[V.value&&!Q.value.length?(m(),v("div",am," No settings match “"+k(U.value)+"”. ",1)):R("",!0),(m(!0),v(le,null,Fe(Q.value,G=>(m(),v(le,{key:G.id},[V.value?(m(),v("div",rm,[E(J,{name:G.icon,size:14},null,8,["name"]),D(" "+k(G.label),1)])):R("",!0),G.id==="account"?(m(),v("div",lm,[E(xe,{title:"Full name",desc:"Shown to your team on flights and audit logs.",keywords:"full name account"},{default:ye(()=>[re(r("input",{"onUpdate:modelValue":f[2]||(f[2]=S=>Ue(ze).name=S),class:"field w-56",placeholder:"Jane Operator",onBlur:f[3]||(f[3]=S=>Je("Saved."))},null,544),[[ve,Ue(ze).name]])]),_:1}),E(xe,{title:"Username",desc:"Your unique handle within PilotVault.",keywords:"username handle"},{default:ye(()=>[r("div",um,[f[63]||(f[63]=r("span",{class:"text-sm text-ink-muted"},"@",-1)),re(r("input",{"onUpdate:modelValue":f[4]||(f[4]=S=>Ue(ze).username=S),class:"field w-48",placeholder:"jane",onBlur:f[5]||(f[5]=S=>Je("Saved."))},null,544),[[ve,Ue(ze).username]])])]),_:1}),E(xe,{title:"Email address",desc:"Used for sign-in and notifications.",keywords:"email verification verify"},{default:ye(()=>[r("div",cm,[r("span",dm,k(t.email||"—"),1),r("span",fm,[E(J,{name:"mail",size:12}),f[64]||(f[64]=D(" Unverified ",-1))])])]),_:1}),E(xe,{title:"Role",desc:"Your access level in PilotVault.",keywords:"role admin user superadmin access rights permissions"},{default:ye(()=>[r("span",{class:Le(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",y(t.role)])},[E(J,{name:_(t.role),size:12},null,8,["name"]),D(k(h(t.role)),1)],2)]),_:1}),E(xe,{title:"Organization",desc:"The organization your account belongs to.",keywords:"organization org tenant company"},{default:ye(()=>[r("span",{class:Le(["text-sm",t.organizationName?"text-ink":"text-ink-muted"])},k(t.organizationName||(u.value?"All organizations":"None")),3)]),_:1}),E(xe,{block:"",title:"Verify email",desc:"Confirm ownership to enable password resets and alerts.",keywords:"verify email resend"},{default:ye(()=>[r("button",{class:"btn-ghost",onClick:So},"Send verification link"),wn.value?(m(),v("p",hm,k(wn.value),1)):R("",!0)]),_:1}),E(xe,{block:"",title:"Change password",desc:"Use at least 8 characters.",keywords:"password change current new"},{default:ye(()=>[r("div",pm,[re(r("input",{"onUpdate:modelValue":f[6]||(f[6]=S=>wt.current=S),type:"password",class:"field",placeholder:"Current password"},null,512),[[ve,wt.current]]),re(r("input",{"onUpdate:modelValue":f[7]||(f[7]=S=>wt.next=S),type:"password",class:"field",placeholder:"New password"},null,512),[[ve,wt.next]]),re(r("input",{"onUpdate:modelValue":f[8]||(f[8]=S=>wt.confirm=S),type:"password",class:"field",placeholder:"Confirm new password"},null,512),[[ve,wt.confirm]]),r("div",mm,[r("button",{class:"btn-accent",onClick:Ct},"Update password"),zn.value?(m(),v("span",{key:0,class:Le(["text-xs",_i.value?"text-success-fg":"text-ink-muted"])},k(zn.value),3)):R("",!0)])])]),_:1})])):G.id==="appearance"?(m(),v("div",gm,[E(xe,{title:"Theme",desc:"Light, dark, or follow your system.",keywords:"theme light dark system appearance"},{default:ye(()=>[E(hn,{modelValue:me.value,"onUpdate:modelValue":f[9]||(f[9]=S=>me.value=S),options:oe},null,8,["modelValue"])]),_:1}),E(xe,{title:"Font size",desc:"Scales the entire interface for readability.",keywords:"font size accessibility text"},{default:ye(()=>[E(hn,{modelValue:Ue(ze).fontSize,"onUpdate:modelValue":f[10]||(f[10]=S=>Ue(ze).fontSize=S),options:de},null,8,["modelValue"])]),_:1}),E(xe,{title:"Reduce motion",desc:"Minimise animations and transitions.",keywords:"reduce motion accessibility animation"},{default:ye(()=>[E(sn,{modelValue:Ue(ze).reduceMotion,"onUpdate:modelValue":f[11]||(f[11]=S=>Ue(ze).reduceMotion=S)},null,8,["modelValue"])]),_:1}),E(xe,{title:"Language",desc:"Interface language.",keywords:"language locale"},{default:ye(()=>[re(r("select",{"onUpdate:modelValue":f[12]||(f[12]=S=>Ue(ze).language=S),class:"field w-48"},[(m(),v(le,null,Fe(nt,([S,Qe])=>r("option",{key:S,value:S},k(Qe),9,vm)),64))],512),[[Et,Ue(ze).language]])]),_:1}),E(xe,{title:"Region",desc:"Affects number, unit and date defaults.",keywords:"region country locale"},{default:ye(()=>[re(r("select",{"onUpdate:modelValue":f[13]||(f[13]=S=>Ue(ze).region=S),class:"field w-48"},[(m(),v(le,null,Fe(ke,([S,Qe])=>r("option",{key:S,value:S},k(Qe),9,_m)),64))],512),[[Et,Ue(ze).region]])]),_:1}),E(xe,{title:"Date format",desc:"How calendar dates are displayed.",keywords:"date format"},{default:ye(()=>[re(r("select",{"onUpdate:modelValue":f[14]||(f[14]=S=>Ue(ze).dateFormat=S),class:"field w-48"},[(m(),v(le,null,Fe(Te,([S,Qe])=>r("option",{key:S,value:S},k(Qe),9,ym)),64))],512),[[Et,Ue(ze).dateFormat]])]),_:1}),E(xe,{title:"Time format",desc:"12- or 24-hour clock.",keywords:"time format clock 12 24 hour"},{default:ye(()=>[E(hn,{modelValue:Ue(ze).timeFormat,"onUpdate:modelValue":f[15]||(f[15]=S=>Ue(ze).timeFormat=S),options:Ne},null,8,["modelValue"])]),_:1}),E(xe,{title:"Preview",desc:"How timestamps appear across the app.",keywords:"preview date time"},{default:ye(()=>[r("span",bm,k(ee.value),1)]),_:1}),f[65]||(f[65]=r("p",{class:"mt-3 text-xs text-ink-muted"}," Language & region are stored now; full localisation ships with the account service. ",-1))])):G.id==="integrations"?(m(),v("div",xm,[V.value?R("",!0):(m(),v("div",wm,[(m(),v(le,null,Fe(un,S=>r("button",{key:S.id,type:"button",class:Le(["-mb-px inline-flex items-center gap-1.5 whitespace-nowrap border-b-2 px-3 py-2 text-sm font-semibold transition",st.value===S.id?"border-accent text-ink":"border-transparent text-ink-secondary hover:text-ink"]),onClick:Qe=>st.value=S.id},[E(J,{name:S.icon,size:16},null,8,["name"]),D(k(S.label),1)],10,km)),64))])),ss("apis-external")?(m(),v("div",Sm,[r("div",Pm,[r("div",Tm,[E(J,{name:"radio",size:20})]),f[66]||(f[66]=r("div",{class:"min-w-0"},[r("div",{class:"text-sm font-semibold text-ink"},"OpenSky Network"),r("div",{class:"mt-0.5 text-xs text-ink-muted"}," Live ADS-B aircraft data. Configure your own OAuth2 credentials, plan and default bounding box. ")],-1))]),pe.loaded&&!pe.available?(m(),v("div",Cm,[E(J,{name:"lock",size:14,class:"mr-1 inline"}),f[67]||(f[67]=D(" OpenSky is currently disabled by your administrator. Contact them to enable it. ",-1))])):R("",!0),pe.canEditOrg?(m(),v("div",Lm,[f[68]||(f[68]=r("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),E(hn,{modelValue:Re.value,"onUpdate:modelValue":f[16]||(f[16]=S=>Re.value=S),options:ht},null,8,["modelValue"])])):R("",!0),g.value?(m(),et(xe,{key:2,title:"Enable OpenSky (organization-wide)",desc:"Turn OpenSky on or off for everyone in your organization.",keywords:"enable disable plugin opensky organization"},{default:ye(()=>[E(sn,{"model-value":pe.orgEnabled,disabled:!pe.available,"onUpdate:modelValue":Y},null,8,["model-value","disabled"])]),_:1})):(m(),et(xe,{key:3,title:"Enable OpenSky",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin opensky"},{default:ye(()=>[E(sn,{"model-value":pe.enabled,disabled:!pe.available||!pe.orgEnabled,"onUpdate:modelValue":Y},null,8,["model-value","disabled"])]),_:1})),!g.value&&pe.available&&!pe.orgEnabled?(m(),v("div",Mm,[E(J,{name:"lock",size:13,class:"mr-1 inline"}),f[70]||(f[70]=D("OpenSky is turned off for your organization",-1)),pe.canEditOrg?(m(),v("span",Em,[...f[69]||(f[69]=[D(" — switch to ",-1),r("span",{class:"font-semibold"},"Organization",-1),D(" to turn it back on",-1)])])):R("",!0),f[71]||(f[71]=D(". ",-1))])):R("",!0),g.value?(m(),v("div",Om,[E(J,{name:"users",size:13,class:"mr-1 inline"}),f[72]||(f[72]=D("These are organization-wide settings — they apply to everyone in ",-1)),r("span",zm,k(t.organizationName||"your organization"),1),f[73]||(f[73]=D(". Leave a field blank to let each user choose their own; a value set here overrides the user's. ",-1))])):lt.value?(m(),v("div",Am," As a superadmin you manage the global OpenSky configuration in the API Server panel. The effective configuration is shown below. ")):R("",!0),pe.available&&!g.value?(m(),v("div",Im,[r("div",$m,[r("div",Dm,[E(J,{name:"signal",size:15}),f[74]||(f[74]=D("Credit usage ",-1))]),ge.value?(m(),v("span",Nm,"Checked "+k(I()),1)):R("",!0)]),Me.value?(m(),v(le,{key:0},[Me.value.remaining!=null?(m(),v(le,{key:0},[r("div",Rm,[r("span",Fm,k($(Me.value.remaining)),1),r("span",Bm,"/ "+k($(Me.value.daily))+" credits left today",1)]),r("div",Vm,[r("div",{class:Le(["h-full rounded-full transition-all",te.value]),style:Ss({width:je.value+"%"})},null,6)]),r("div",Um," Used "+k($(Me.value.daily-Me.value.remaining))+" today · "+k(Me.value.probeCost)+" credit"+k(Me.value.probeCost===1?"":"s")+" per query · "+k(Me.value.mode),1)],64)):(m(),v(le,{key:1},[r("div",Zm,[f[75]||(f[75]=D("Daily allowance: ",-1)),r("span",Hm,k($(Me.value.daily)),1),f[76]||(f[76]=D(" credits",-1))]),r("div",jm,k(Me.value.probeCost)+" credit"+k(Me.value.probeCost===1?"":"s")+" per query · "+k(Me.value.mode)+". OpenSky only reports live remaining credits for authenticated requests — add OAuth2 credentials below to track usage. ",1)],64))],64)):(m(),v("div",Wm,[...f[77]||(f[77]=[D(" Run ",-1),r("span",{class:"font-semibold text-ink-secondary"},"Test connection",-1),D(" below to fetch your live OpenSky credit balance. ",-1)])]))])):R("",!0),E(xe,{title:"OpenSky plan",desc:"Your account tier — sets the daily credit allowance.",keywords:"plan tier credits"},{default:ye(()=>[Z("plan")?(m(),v("span",Km,[D(k((O.find(S=>S.value===M("plan").effective)||{}).label||M("plan").effective||"—")+" ",1),B("plan")?(m(),v("span",Gm,[E(J,{name:"lock",size:10}),D(k(B("plan")),1)])):R("",!0)])):(m(),et(hn,{key:1,modelValue:Ze.plan,"onUpdate:modelValue":f[17]||(f[17]=S=>Ze.plan=S),options:O},null,8,["modelValue"]))]),_:1}),E(xe,{title:"Default bounding box",desc:"lamin,lomin,lamax,lomax — used for live queries and the health probe.",keywords:"bounding box bbox area"},{default:ye(()=>[Z("bbox")?(m(),v("span",qm,[D(k(M("bbox").effective||"—")+" ",1),B("bbox")?(m(),v("span",Ym,[E(J,{name:"lock",size:10}),D(k(B("bbox")),1)])):R("",!0)])):re((m(),v("input",{key:1,"onUpdate:modelValue":f[18]||(f[18]=S=>Ze.bbox=S),class:"field w-64 font-mono",placeholder:"50.5,3.2,53.7,7.3"},null,512)),[[ve,Ze.bbox]])]),_:1}),E(xe,{title:"OAuth2 client ID",desc:"Optional — leave blank for anonymous access (lower limits).",keywords:"oauth client id credentials"},{default:ye(()=>[Z("clientId")?(m(),v("span",Jm,[D(k(M("clientId").effective||"—")+" ",1),B("clientId")?(m(),v("span",Xm,[E(J,{name:"lock",size:10}),D(k(B("clientId")),1)])):R("",!0)])):re((m(),v("input",{key:1,"onUpdate:modelValue":f[19]||(f[19]=S=>Ze.clientId=S),class:"field w-64",placeholder:"your-api-client"},null,512)),[[ve,Ze.clientId]])]),_:1}),E(xe,{title:"OAuth2 client secret",desc:"Paired with the client ID for authenticated access.",keywords:"oauth client secret credentials password"},{default:ye(()=>[Z("clientSecret")?(m(),v("span",Qm,[D(k(M("clientSecret").effective||"—")+" ",1),B("clientSecret")?(m(),v("span",eg,[E(J,{name:"lock",size:10}),D(k(B("clientSecret")),1)])):R("",!0)])):re((m(),v("input",{key:1,"onUpdate:modelValue":f[20]||(f[20]=S=>Ze.clientSecret=S),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[ve,Ze.clientSecret]])]),_:1}),pe.available&&!pe.allowAnonymous?(m(),v("div",tg," Anonymous access is disabled by the administrator — OpenSky needs OAuth2 credentials from some layer to work. ")):R("",!0),r("div",ng,[lt.value?R("",!0):(m(),v("button",{key:0,class:"btn-accent",disabled:De.value||!pe.available,onClick:j},k(De.value?"Saving…":g.value?"Save organization settings":"Save settings"),9,ig)),g.value?R("",!0):(m(),v("button",{key:1,class:"btn-ghost",disabled:ne.value||!pe.available,onClick:Se},k(ne.value?"Testing…":"Test connection"),9,sg)),he.value?(m(),v("span",og,k(he.value),1)):R("",!0),rt.value&&!g.value?(m(),v("span",{key:3,class:Le(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",ce(rt.value.status)])},[f[78]||(f[78]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(k(rt.value.detail||rt.value.status),1)],2)):R("",!0)])])):R("",!0),ss("drives-external")?(m(),v(le,{key:2},[r("div",ag,[r("div",rg,[r("div",lg,[E(J,{name:"server",size:20})]),f[79]||(f[79]=r("div",{class:"min-w-0"},[r("div",{class:"text-sm font-semibold text-ink"},"File Transfer (FTP / SFTP)"),r("div",{class:"mt-0.5 text-xs text-ink-muted"}," Connect to an FTP, FTPS or SFTP server. Configure the connection your account uses for file transfers. ")],-1))]),ae.loaded&&!ae.available?(m(),v("div",ug,[E(J,{name:"lock",size:14,class:"mr-1 inline"}),f[80]||(f[80]=D(" File transfer is currently disabled by your administrator. Contact them to enable it. ",-1))])):R("",!0),ae.canEditOrg?(m(),v("div",cg,[f[81]||(f[81]=r("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),E(hn,{modelValue:Pe.value,"onUpdate:modelValue":f[21]||(f[21]=S=>Pe.value=S),options:ht},null,8,["modelValue"])])):R("",!0),Vt.value?(m(),et(xe,{key:2,title:"Enable file transfer (organization-wide)",desc:"Turn it on or off for everyone in your organization.",keywords:"enable disable plugin ftp sftp organization"},{default:ye(()=>[E(sn,{"model-value":ae.orgEnabled,disabled:!ae.available,"onUpdate:modelValue":_o},null,8,["model-value","disabled"])]),_:1})):(m(),et(xe,{key:3,title:"Enable file transfer",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin ftp sftp"},{default:ye(()=>[E(sn,{"model-value":ae.enabled,disabled:!ae.available||!ae.orgEnabled,"onUpdate:modelValue":_o},null,8,["model-value","disabled"])]),_:1})),!Vt.value&&ae.available&&!ae.orgEnabled?(m(),v("div",dg,[E(J,{name:"lock",size:13,class:"mr-1 inline"}),f[83]||(f[83]=D("File transfer is turned off for your organization",-1)),ae.canEditOrg?(m(),v("span",fg,[...f[82]||(f[82]=[D(" — switch to ",-1),r("span",{class:"font-semibold"},"Organization",-1),D(" to turn it back on",-1)])])):R("",!0),f[84]||(f[84]=D(". ",-1))])):R("",!0),Vt.value?(m(),v("div",hg,[E(J,{name:"users",size:13,class:"mr-1 inline"}),f[85]||(f[85]=D("These are organization-wide settings — they apply to everyone in ",-1)),r("span",pg,k(t.organizationName||"your organization"),1),f[86]||(f[86]=D(". Leave the connection blank to let each user configure their own; a connection set here overrides the user's. ",-1))])):kt.value?(m(),v("div",mg," As a superadmin you manage the global file-transfer configuration in the API Server panel. The effective configuration is shown below. ")):R("",!0),E(xe,{title:"Protocol",desc:"SFTP (over SSH), FTPS (FTP over TLS), or plain FTP.",keywords:"protocol sftp ftps ftp"},{default:ye(()=>[Ut("protocol")?(m(),v("span",gg,[D(k(wa(zt("protocol").effective))+" ",1),yt("protocol")?(m(),v("span",vg,[E(J,{name:"lock",size:10}),D(k(yt("protocol")),1)])):R("",!0)])):(m(),et(hn,{key:1,modelValue:be.protocol,"onUpdate:modelValue":f[22]||(f[22]=S=>be.protocol=S),options:_n},null,8,["modelValue"]))]),_:1}),E(xe,{title:"Host",desc:"Server hostname or IP address.",keywords:"host server address"},{default:ye(()=>[Ut("host")?(m(),v("span",_g,[D(k(zt("host").effective||"—")+" ",1),yt("host")?(m(),v("span",yg,[E(J,{name:"lock",size:10}),D(k(yt("host")),1)])):R("",!0)])):re((m(),v("input",{key:1,"onUpdate:modelValue":f[23]||(f[23]=S=>be.host=S),class:"field w-64",placeholder:"files.example.com"},null,512)),[[ve,be.host]])]),_:1}),E(xe,{title:"Port",desc:"Leave blank for the protocol default (22 for SFTP, 21 for FTP/FTPS).",keywords:"port"},{default:ye(()=>[Ut("port")?(m(),v("span",bg,[D(k(zt("port").effective||"default")+" ",1),yt("port")?(m(),v("span",xg,[E(J,{name:"lock",size:10}),D(k(yt("port")),1)])):R("",!0)])):re((m(),v("input",{key:1,"onUpdate:modelValue":f[24]||(f[24]=S=>be.port=S),inputmode:"numeric",class:"field w-24 font-mono",placeholder:"22"},null,512)),[[ve,be.port]])]),_:1}),E(xe,{title:"Username",desc:"Account used to authenticate.",keywords:"username login account"},{default:ye(()=>[Ut("username")?(m(),v("span",wg,[D(k(zt("username").effective||"—")+" ",1),yt("username")?(m(),v("span",kg,[E(J,{name:"lock",size:10}),D(k(yt("username")),1)])):R("",!0)])):re((m(),v("input",{key:1,"onUpdate:modelValue":f[25]||(f[25]=S=>be.username=S),class:"field w-64",placeholder:"user"},null,512)),[[ve,be.username]])]),_:1}),E(xe,{title:"Password",desc:"Password auth for FTP/FTPS, or SFTP password login. Leave blank to use a key.",keywords:"password secret credentials"},{default:ye(()=>[Ut("password")?(m(),v("span",Sg,[D(k(zt("password").effective||"—")+" ",1),yt("password")?(m(),v("span",Pg,[E(J,{name:"lock",size:10}),D(k(yt("password")),1)])):R("",!0)])):re((m(),v("input",{key:1,"onUpdate:modelValue":f[26]||(f[26]=S=>be.password=S),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[ve,be.password]])]),_:1}),Ji.value==="sftp"?(m(),et(xe,{key:7,block:"",title:"SSH private key",desc:"PEM key for SFTP key auth — used instead of, or alongside, a password.",keywords:"private key ssh pem identity"},{default:ye(()=>[Ut("privateKey")?(m(),v("span",Tg,[D(k(zt("privateKey").effective||"—")+" ",1),yt("privateKey")?(m(),v("span",Cg,[E(J,{name:"lock",size:10}),D(k(yt("privateKey")),1)])):R("",!0)])):re((m(),v("textarea",{key:1,"onUpdate:modelValue":f[27]||(f[27]=S=>be.privateKey=S),rows:"3",class:"field w-full font-mono text-xs",placeholder:"-----BEGIN OPENSSH PRIVATE KEY-----"},null,512)),[[ve,be.privateKey]])]),_:1})):R("",!0),Ji.value==="sftp"?(m(),et(xe,{key:8,title:"Private key passphrase",desc:"Passphrase protecting the SSH private key, if any.",keywords:"passphrase key secret"},{default:ye(()=>[Ut("keyPassphrase")?(m(),v("span",Lg,[D(k(zt("keyPassphrase").effective||"—")+" ",1),yt("keyPassphrase")?(m(),v("span",Mg,[E(J,{name:"lock",size:10}),D(k(yt("keyPassphrase")),1)])):R("",!0)])):re((m(),v("input",{key:1,"onUpdate:modelValue":f[28]||(f[28]=S=>be.keyPassphrase=S),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[ve,be.keyPassphrase]])]),_:1})):R("",!0),Ji.value==="sftp"?(m(),et(xe,{key:9,title:"Host key fingerprint",desc:"Optional SHA256:… fingerprint to pin the server's host key. Blank accepts any key.",keywords:"host key fingerprint verify trust"},{default:ye(()=>[Ut("hostKeyFingerprint")?(m(),v("span",Eg,[D(k(zt("hostKeyFingerprint").effective||"—")+" ",1),yt("hostKeyFingerprint")?(m(),v("span",Og,[E(J,{name:"lock",size:10}),D(k(yt("hostKeyFingerprint")),1)])):R("",!0)])):re((m(),v("input",{key:1,"onUpdate:modelValue":f[29]||(f[29]=S=>be.hostKeyFingerprint=S),class:"field w-full font-mono text-xs",placeholder:"SHA256:…"},null,512)),[[ve,be.hostKeyFingerprint]])]),_:1})):R("",!0),Ji.value==="ftps"?(m(),et(xe,{key:10,title:"TLS verification",desc:"Skip only for self-signed test servers.",keywords:"tls certificate verify insecure ftps"},{default:ye(()=>[Ut("insecureSkipVerify")?(m(),v("span",zg,[D(k(zt("insecureSkipVerify").effective==="true"?"Skip verification":"Verify certificate")+" ",1),yt("insecureSkipVerify")?(m(),v("span",Ag,[E(J,{name:"lock",size:10}),D(k(yt("insecureSkipVerify")),1)])):R("",!0)])):(m(),et(hn,{key:1,modelValue:be.insecureSkipVerify,"onUpdate:modelValue":f[30]||(f[30]=S=>be.insecureSkipVerify=S),options:ci},null,8,["modelValue"]))]),_:1})):R("",!0),E(xe,{title:"Base path",desc:"Working directory and health-check target, e.g. /uploads.",keywords:"base path directory folder root"},{default:ye(()=>[Ut("basePath")?(m(),v("span",Ig,[D(k(zt("basePath").effective||"—")+" ",1),yt("basePath")?(m(),v("span",$g,[E(J,{name:"lock",size:10}),D(k(yt("basePath")),1)])):R("",!0)])):re((m(),v("input",{key:1,"onUpdate:modelValue":f[31]||(f[31]=S=>be.basePath=S),class:"field w-64 font-mono",placeholder:"/uploads"},null,512)),[[ve,be.basePath]])]),_:1}),r("div",Dg,[kt.value?R("",!0):(m(),v("button",{key:0,class:"btn-accent",disabled:dt.value||!ae.available,onClick:Ta},k(dt.value?"Saving…":Vt.value?"Save organization settings":"Save settings"),9,Ng)),Vt.value?R("",!0):(m(),v("button",{key:1,class:"btn-ghost",disabled:gt.value||!ae.available,onClick:Ca},k(gt.value?"Testing…":"Test connection"),9,Rg)),Ye.value?(m(),v("span",Fg,k(Ye.value),1)):R("",!0),Tt.value&&!Vt.value?(m(),v("span",Bg,"Checked "+k(ka()),1)):R("",!0),_t.value&&!Vt.value?(m(),v("span",{key:4,class:Le(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",La(_t.value.status)])},[f[87]||(f[87]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(k(_t.value.detail||_t.value.status),1)],2)):R("",!0)])]),r("div",Vg,[r("div",Ug,[r("div",Zg,[E(J,{name:"cloud",size:20})]),f[88]||(f[88]=r("div",{class:"min-w-0"},[r("div",{class:"text-sm font-semibold text-ink"},"WebDAV"),r("div",{class:"mt-0.5 text-xs text-ink-muted"}," Connect to a WebDAV server (Nextcloud, ownCloud, IIS, …). Configure the connection your account uses. ")],-1))]),Ke.loaded&&!Ke.available?(m(),v("div",Hg,[E(J,{name:"lock",size:14,class:"mr-1 inline"}),f[89]||(f[89]=D(" WebDAV is currently disabled by your administrator. Contact them to enable it. ",-1))])):R("",!0),Ke.canEditOrg?(m(),v("div",jg,[f[90]||(f[90]=r("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),E(hn,{modelValue:_e.value,"onUpdate:modelValue":f[32]||(f[32]=S=>_e.value=S),options:ht},null,8,["modelValue"])])):R("",!0),rn.value?(m(),et(xe,{key:2,title:"Enable WebDAV (organization-wide)",desc:"Turn it on or off for everyone in your organization.",keywords:"enable disable plugin webdav organization"},{default:ye(()=>[E(sn,{"model-value":Ke.orgEnabled,disabled:!Ke.available,"onUpdate:modelValue":pi},null,8,["model-value","disabled"])]),_:1})):(m(),et(xe,{key:3,title:"Enable WebDAV",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin webdav"},{default:ye(()=>[E(sn,{"model-value":Ke.enabled,disabled:!Ke.available||!Ke.orgEnabled,"onUpdate:modelValue":pi},null,8,["model-value","disabled"])]),_:1})),!rn.value&&Ke.available&&!Ke.orgEnabled?(m(),v("div",Wg,[E(J,{name:"lock",size:13,class:"mr-1 inline"}),f[92]||(f[92]=D("WebDAV is turned off for your organization",-1)),Ke.canEditOrg?(m(),v("span",Kg,[...f[91]||(f[91]=[D(" — switch to ",-1),r("span",{class:"font-semibold"},"Organization",-1),D(" to turn it back on",-1)])])):R("",!0),f[93]||(f[93]=D(". ",-1))])):R("",!0),rn.value?(m(),v("div",Gg,[E(J,{name:"users",size:13,class:"mr-1 inline"}),f[94]||(f[94]=D("These are organization-wide settings — they apply to everyone in ",-1)),r("span",qg,k(t.organizationName||"your organization"),1),f[95]||(f[95]=D(". Leave the connection blank to let each user configure their own; a connection set here overrides the user's. ",-1))])):Es.value?(m(),v("div",Yg," As a superadmin you manage the global WebDAV configuration in the API Server panel. The effective configuration is shown below. ")):R("",!0),E(xe,{block:"",title:"Server URL",desc:"WebDAV endpoint including scheme, e.g. https://cloud.example.com/remote.php/dav/files/alice/.",keywords:"url server address endpoint webdav host"},{default:ye(()=>[hi("baseURL")?(m(),v("span",Jg,[D(k(yn("baseURL").effective||"—")+" ",1),Zt("baseURL")?(m(),v("span",Xg,[E(J,{name:"lock",size:10}),D(k(Zt("baseURL")),1)])):R("",!0)])):re((m(),v("input",{key:1,"onUpdate:modelValue":f[33]||(f[33]=S=>At.baseURL=S),class:"field w-full font-mono text-xs",placeholder:"https://cloud.example.com/remote.php/dav/files/alice/"},null,512)),[[ve,At.baseURL]])]),_:1}),E(xe,{title:"Username",desc:"Account used to authenticate (leave blank for a public share).",keywords:"username login account"},{default:ye(()=>[hi("username")?(m(),v("span",Qg,[D(k(yn("username").effective||"—")+" ",1),Zt("username")?(m(),v("span",ev,[E(J,{name:"lock",size:10}),D(k(Zt("username")),1)])):R("",!0)])):re((m(),v("input",{key:1,"onUpdate:modelValue":f[34]||(f[34]=S=>At.username=S),class:"field w-64",placeholder:"user"},null,512)),[[ve,At.username]])]),_:1}),E(xe,{title:"Password",desc:"Password or app-specific token for HTTP Basic auth.",keywords:"password secret credentials token"},{default:ye(()=>[hi("password")?(m(),v("span",tv,[D(k(yn("password").effective||"—")+" ",1),Zt("password")?(m(),v("span",nv,[E(J,{name:"lock",size:10}),D(k(Zt("password")),1)])):R("",!0)])):re((m(),v("input",{key:1,"onUpdate:modelValue":f[35]||(f[35]=S=>At.password=S),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[ve,At.password]])]),_:1}),E(xe,{title:"TLS verification",desc:"Only affects HTTPS. Skip only for self-signed test servers.",keywords:"tls certificate verify insecure https"},{default:ye(()=>[hi("insecureSkipVerify")?(m(),v("span",iv,[D(k(yn("insecureSkipVerify").effective==="true"?"Skip verification":"Verify certificate")+" ",1),Zt("insecureSkipVerify")?(m(),v("span",sv,[E(J,{name:"lock",size:10}),D(k(Zt("insecureSkipVerify")),1)])):R("",!0)])):(m(),et(hn,{key:1,modelValue:At.insecureSkipVerify,"onUpdate:modelValue":f[36]||(f[36]=S=>At.insecureSkipVerify=S),options:yo},null,8,["modelValue"]))]),_:1}),E(xe,{title:"Base path",desc:"Working directory under the server URL and health-check target, e.g. /Documents.",keywords:"base path directory folder root"},{default:ye(()=>[hi("basePath")?(m(),v("span",ov,[D(k(yn("basePath").effective||"—")+" ",1),Zt("basePath")?(m(),v("span",av,[E(J,{name:"lock",size:10}),D(k(Zt("basePath")),1)])):R("",!0)])):re((m(),v("input",{key:1,"onUpdate:modelValue":f[37]||(f[37]=S=>At.basePath=S),class:"field w-64 font-mono",placeholder:"/Documents"},null,512)),[[ve,At.basePath]])]),_:1}),r("div",rv,[Es.value?R("",!0):(m(),v("button",{key:0,class:"btn-accent",disabled:Mi.value||!Ke.available,onClick:xo},k(Mi.value?"Saving…":rn.value?"Save organization settings":"Save settings"),9,lv)),rn.value?R("",!0):(m(),v("button",{key:1,class:"btn-ghost",disabled:fi.value||!Ke.available,onClick:wo},k(fi.value?"Testing…":"Test connection"),9,uv)),di.value?(m(),v("span",cv,k(di.value),1)):R("",!0),tn.value&&!rn.value?(m(),v("span",dv,"Checked "+k(Ea()),1)):R("",!0),an.value&&!rn.value?(m(),v("span",{key:4,class:Le(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",Ei(an.value.status)])},[f[96]||(f[96]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(k(an.value.detail||an.value.status),1)],2)):R("",!0)])])],64)):R("",!0),ss("drives-local")?(m(),v("div",fv,[r("div",hv,[r("div",pv,[E(J,{name:"monitor",size:20})]),f[97]||(f[97]=r("div",{class:"min-w-0"},[r("div",{class:"text-sm font-semibold text-ink"},"Local Storage"),r("div",{class:"mt-0.5 text-xs text-ink-muted"}," A private folder on the server for your files. Each user has their own; members of an organization share one. ")],-1))]),se.loaded&&!se.available?(m(),v("div",mv,[E(J,{name:"lock",size:14,class:"mr-1 inline"}),f[98]||(f[98]=D(" Local storage is currently disabled by your administrator. Contact them to enable it. ",-1))])):se.loaded&&!se.rootConfigured?(m(),v("div",gv,[E(J,{name:"alertTriangle",size:14,class:"mr-1 inline"}),f[99]||(f[99]=D(" No storage root has been configured by your administrator yet. ",-1))])):R("",!0),se.canEditOrg?(m(),v("div",vv,[f[100]||(f[100]=r("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),E(hn,{modelValue:it.value,"onUpdate:modelValue":f[38]||(f[38]=S=>it.value=S),options:ht},null,8,["modelValue"])])):R("",!0),St.value?(m(),et(xe,{key:3,title:"Enable local storage (organization-wide)",desc:"Turn it on or off for everyone in your organization.",keywords:"enable disable plugin local storage folder organization"},{default:ye(()=>[E(sn,{"model-value":se.orgEnabled,disabled:!se.available,"onUpdate:modelValue":ns},null,8,["model-value","disabled"])]),_:1})):(m(),et(xe,{key:4,title:"Enable local storage",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin local storage folder"},{default:ye(()=>[E(sn,{"model-value":se.enabled,disabled:!se.available||!se.orgEnabled,"onUpdate:modelValue":ns},null,8,["model-value","disabled"])]),_:1})),!St.value&&se.available&&!se.orgEnabled?(m(),v("div",_v,[E(J,{name:"lock",size:13,class:"mr-1 inline"}),f[102]||(f[102]=D("Local storage is turned off for your organization",-1)),se.canEditOrg?(m(),v("span",yv,[...f[101]||(f[101]=[D(" — switch to ",-1),r("span",{class:"font-semibold"},"Organization",-1),D(" to turn it back on",-1)])])):R("",!0),f[103]||(f[103]=D(". ",-1))])):R("",!0),St.value?(m(),v("div",bv,[E(J,{name:"users",size:13,class:"mr-1 inline"}),f[104]||(f[104]=D("These are organization-wide settings — they apply to everyone in ",-1)),r("span",xv,k(t.organizationName||"your organization"),1),f[105]||(f[105]=D(", who all share the organization folder. Members can additionally enable a private folder inside it. ",-1))])):Dt.value?(m(),v("div",wv," As a superadmin you manage the global storage root in the API Server panel. The effective configuration is shown below. ")):R("",!0),St.value?(m(),et(xe,{key:8,title:"Private folders",desc:"Let members create a private folder inside the organization folder, reachable only by them.",keywords:"private folder members allow policy organization"},{default:ye(()=>[E(sn,{"model-value":se.allowPrivate,disabled:!se.available,"onUpdate:modelValue":ko},null,8,["model-value","disabled"])]),_:1})):R("",!0),St.value?R("",!0):(m(),v(le,{key:9},[E(xe,{block:"",title:"Your folders",desc:"Assigned automatically and isolated — no one else can reach your private folder.",keywords:"folder directory path storage location isolated private shared"},{default:ye(()=>[r("div",kv,[(m(!0),v(le,null,Fe(se.mounts,S=>(m(),v("div",{key:S.id,class:"flex flex-wrap items-center gap-2"},[r("span",Sv,k(S.path),1),S.kind==="shared"?(m(),v("span",Pv,[E(J,{name:"users",size:10}),f[106]||(f[106]=D("Shared with your organization",-1))])):(m(),v("span",Tv,[E(J,{name:"lock",size:10}),f[107]||(f[107]=D("Private to you",-1))])),Wn.value[S.id]?(m(),v("span",{key:2,class:Le(["inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[10px] font-semibold",Ve(Wn.value[S.id].status)])},[f[108]||(f[108]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(k(Wn.value[S.id].status),1)],2)):R("",!0)]))),128)),se.mounts.length?R("",!0):(m(),v("div",Cv,k(se.rootConfigured?"No folder assigned yet.":"Waiting for the administrator to configure a storage root."),1))])]),_:1}),se.isOrgUser&&se.allowPrivate?(m(),et(xe,{key:0,title:"My private folder",desc:"Add a private folder inside the organization folder, reachable only by you — you keep the shared folder too.",keywords:"private folder personal isolated organization inside"},{default:ye(()=>[E(sn,{"model-value":se.privateFolder,disabled:!se.available||!se.orgEnabled,"onUpdate:modelValue":is},null,8,["model-value","disabled"])]),_:1})):se.isOrgUser&&!se.allowPrivate?(m(),v("div",Lv,[E(J,{name:"lock",size:13,class:"mr-1 inline"}),f[109]||(f[109]=D("Private folders are turned off by your organization. ",-1))])):R("",!0)],64)),E(xe,{title:"Access mode",desc:"Read-only prevents uploads, deletes and folder creation.",keywords:"read only write access mode permission"},{default:ye(()=>[On("readOnly")?(m(),v("span",Mv,[D(k(zi(vt("readOnly").effective))+" ",1),gi("readOnly")?(m(),v("span",Ev,[E(J,{name:"lock",size:10}),D(k(gi("readOnly")),1)])):R("",!0)])):(m(),et(hn,{key:1,modelValue:jn.value,"onUpdate:modelValue":f[39]||(f[39]=S=>jn.value=S),options:Oi},null,8,["modelValue"]))]),_:1}),r("div",Ov,[Dt.value?R("",!0):(m(),v("button",{key:0,class:"btn-accent",disabled:bn.value||!se.available,onClick:Rs},k(bn.value?"Saving…":St.value?"Save organization settings":"Save settings"),9,zv)),St.value?R("",!0):(m(),v("button",{key:1,class:"btn-ghost",disabled:mi.value||!se.available,onClick:Aa},k(mi.value?"Testing…":"Test folder"),9,Av)),ln.value?(m(),v("span",Iv,k(ln.value),1)):R("",!0),ut.value&&!St.value?(m(),v("span",$v,"Checked "+k($s()),1)):R("",!0),Oe.value&&!St.value?(m(),v("span",{key:4,class:Le(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",Ve(Oe.value.status)])},[f[110]||(f[110]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(k(Oe.value.detail||Oe.value.status),1)],2)):R("",!0)])])):R("",!0)])):G.id==="profile"?(m(),v("div",Dv,[E(xe,{block:"",title:"Profile photo",desc:"PNG or JPG, up to ~1.5 MB. Stored on this device.",keywords:"avatar photo picture"},{default:ye(()=>[r("div",Nv,[Ue(ze).avatar?(m(),v("img",{key:0,src:Ue(ze).avatar,alt:"Avatar",class:"h-16 w-16 rounded-full object-cover"},null,8,Rv)):(m(),v("div",Fv,k(To.value),1)),r("div",Bv,[r("label",Vv,[E(J,{name:"upload",size:15,class:"mr-1.5 inline"}),f[111]||(f[111]=D("Upload ",-1)),r("input",{type:"file",accept:"image/*",class:"hidden",onChange:Po},null,32)]),Ue(ze).avatar?(m(),v("button",{key:0,class:"btn-ghost",onClick:Ia},"Remove")):R("",!0)])])]),_:1}),E(xe,{title:"Display name",desc:"The name shown on your public profile.",keywords:"display name profile"},{default:ye(()=>[re(r("input",{"onUpdate:modelValue":f[40]||(f[40]=S=>Ue(ze).displayName=S),class:"field w-56",placeholder:"Jane O.",onBlur:f[41]||(f[41]=S=>Je("Saved."))},null,544),[[ve,Ue(ze).displayName]])]),_:1}),E(xe,{block:"",title:"Bio",desc:"A short description others can see.",keywords:"bio about description"},{default:ye(()=>[re(r("textarea",{"onUpdate:modelValue":f[42]||(f[42]=S=>Ue(ze).bio=S),rows:"3",maxlength:"240",class:"field w-full resize-none",placeholder:"Flight director, North yard operations…",onBlur:f[43]||(f[43]=S=>Je("Saved."))},null,544),[[ve,Ue(ze).bio]]),r("div",Uv,k((Ue(ze).bio||"").length)+"/240",1)]),_:1}),E(xe,{title:"Show email on profile",desc:"Let teammates see your email address.",keywords:"show email public visibility"},{default:ye(()=>[E(sn,{modelValue:Ue(ze).showEmail,"onUpdate:modelValue":f[44]||(f[44]=S=>Ue(ze).showEmail=S)},null,8,["modelValue"])]),_:1})])):G.id==="security"?(m(),v("div",Zv,[E(xe,{block:"",title:"Two-factor authentication",desc:"Require a one-time code at sign-in.",keywords:"two factor 2fa authentication security"},{default:ye(()=>[r("div",Hv,[r("span",{class:Le(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",Ue(ze).twoFactor?"bg-success-soft text-success-fg":"bg-surface-2 text-ink-secondary"])},[f[112]||(f[112]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(k(Ue(ze).twoFactor?"Enabled":"Disabled"),1)],2),!Ue(ze).twoFactor&&!Kn.value?(m(),v("button",{key:0,class:"btn-accent",onClick:$i},"Enable 2FA")):Ue(ze).twoFactor?(m(),v("button",{key:1,class:"btn-ghost",onClick:$a},"Disable")):R("",!0)]),Kn.value?(m(),v("div",jv,[r("div",Wv,[f[114]||(f[114]=r("div",{class:"grid h-28 w-28 place-items-center rounded bg-white p-2"},[r("svg",{viewBox:"0 0 100 100",class:"h-full w-full"},[r("rect",{width:"100",height:"100",fill:"#fff"}),r("g",{fill:"#0F1E3D"},[r("rect",{x:"6",y:"6",width:"24",height:"24"}),r("rect",{x:"70",y:"6",width:"24",height:"24"}),r("rect",{x:"6",y:"70",width:"24",height:"24"}),r("rect",{x:"12",y:"12",width:"12",height:"12",fill:"#fff"}),r("rect",{x:"76",y:"12",width:"12",height:"12",fill:"#fff"}),r("rect",{x:"12",y:"76",width:"12",height:"12",fill:"#fff"}),r("rect",{x:"40",y:"10",width:"8",height:"8"}),r("rect",{x:"52",y:"20",width:"8",height:"8"}),r("rect",{x:"40",y:"40",width:"8",height:"8"}),r("rect",{x:"60",y:"44",width:"8",height:"8"}),r("rect",{x:"44",y:"60",width:"8",height:"8"}),r("rect",{x:"70",y:"60",width:"8",height:"8"}),r("rect",{x:"80",y:"72",width:"8",height:"8"}),r("rect",{x:"60",y:"80",width:"8",height:"8"})])])],-1)),r("div",Kv,[f[113]||(f[113]=r("div",{class:"text-xs text-ink-secondary"},"Scan with an authenticator app, or enter this secret:",-1)),r("div",Gv,k(Co.value),1),r("div",qv,[re(r("input",{"onUpdate:modelValue":f[45]||(f[45]=S=>Ii.value=S),inputmode:"numeric",maxlength:"6",class:"field w-28 font-mono tracking-[0.3em]",placeholder:"000000"},null,512),[[ve,Ii.value]]),r("button",{class:"btn-accent",onClick:Lo},"Verify & enable")]),Ge.value?(m(),v("p",Yv,k(Ge.value),1)):R("",!0)])])])):R("",!0),Ue(ze).twoFactor&&os.value.length?(m(),v("div",Jv,[f[115]||(f[115]=r("div",{class:"text-xs font-semibold text-ink"},"Recovery codes",-1)),f[116]||(f[116]=r("div",{class:"mt-0.5 text-xs text-ink-muted"},"Store these somewhere safe — each works once.",-1)),r("div",Xv,[(m(!0),v(le,null,Fe(os.value,S=>(m(),v("span",{key:S,class:"select-all"},k(S),1))),128))])])):R("",!0),f[117]||(f[117]=r("p",{class:"mt-2 text-xs text-ink-muted"},"Prototype — codes are generated locally until the account service verifies them.",-1))]),_:1}),E(xe,{block:"",title:"Active sessions",desc:"Devices currently signed in to your account.",keywords:"sessions devices logout sign out remote"},{default:ye(()=>[r("div",Qv,[r("div",e_,[r("div",t_,[E(J,{name:"monitor",size:18})]),r("div",n_,[r("div",i_,[D(k(Da())+" on "+k(Mo())+" ",1),f[118]||(f[118]=r("span",{class:"ml-1 rounded-full bg-success-soft px-2 py-0.5 text-[10px] font-semibold text-success-fg"},"This device",-1))]),r("div",s_,"Signed in "+k(Ue(Yl)(Ue(Na))),1)]),r("button",{class:"btn-ghost",onClick:f[46]||(f[46]=S=>l("logout"))},"Log out")])]),f[119]||(f[119]=r("button",{class:"btn-ghost mt-2 opacity-60",disabled:"",title:"Requires the account service"}," Log out all other devices ",-1)),f[120]||(f[120]=r("p",{class:"mt-2 text-xs text-ink-muted"}," Only this session is visible from the browser; enumerating and revoking remote sessions needs the account service. ",-1))]),_:1})])):G.id==="team"?(m(),v("div",o_,[Xe.id?(m(),v("div",a_,[E(xe,{block:"",title:`Edit user — ${Xe.email}`,desc:"Update details, change role, reset password, or set verified.",keywords:"edit user update role password verified organization"},{default:ye(()=>[r("div",r_,[r("div",l_,[re(r("input",{"onUpdate:modelValue":f[47]||(f[47]=S=>Xe.email=S),type:"email",class:"field flex-1",placeholder:"name@pilotvault.local"},null,512),[[ve,Xe.email]]),re(r("select",{"onUpdate:modelValue":f[48]||(f[48]=S=>Xe.role=S),class:"field w-32",disabled:ls.value,title:ls.value?"You cannot change your own role":""},[(m(!0),v(le,null,Fe(Fs.value,S=>(m(),v("option",{key:S.value,value:S.value},k(S.label),9,c_))),128))],8,u_),[[Et,Xe.role]])]),u.value?re((m(),v("select",{key:0,"onUpdate:modelValue":f[49]||(f[49]=S=>Xe.organization=S),class:"field",title:"Organization"},[(m(!0),v(le,null,Fe(Eo.value,S=>(m(),v("option",{key:S.value,value:S.value},k(S.label),9,d_))),128))],512)),[[Et,Xe.organization]]):R("",!0),re(r("input",{"onUpdate:modelValue":f[50]||(f[50]=S=>Xe.password=S),type:"password",class:"field",placeholder:"New password (leave blank to keep current)"},null,512),[[ve,Xe.password]]),r("label",f_,[E(sn,{modelValue:Xe.verified,"onUpdate:modelValue":f[51]||(f[51]=S=>Xe.verified=S)},null,8,["modelValue"]),f[121]||(f[121]=D(" Email verified ",-1))]),r("div",h_,[r("button",{class:"btn-accent",disabled:Fi.value,onClick:Ba},k(Fi.value?"Saving…":"Save changes"),9,p_),r("button",{class:"btn-ghost",onClick:In},"Cancel"),An.value?(m(),v("span",m_,k(An.value),1)):R("",!0),ls.value?(m(),v("span",g_,"Editing your own account — role locked.")):R("",!0)])])]),_:1},8,["title"])])):(m(),v("div",v_,[E(xe,{block:"",title:"Add user",desc:"Create a new account. Admins add users within their organization; superadmins can target any.",keywords:"add user create account role admin organization"},{default:ye(()=>[r("div",__,[r("div",y_,[re(r("input",{"onUpdate:modelValue":f[52]||(f[52]=S=>ct.email=S),type:"email",class:"field flex-1",placeholder:"name@pilotvault.local"},null,512),[[ve,ct.email]]),re(r("select",{"onUpdate:modelValue":f[53]||(f[53]=S=>ct.role=S),class:"field w-32"},[(m(!0),v(le,null,Fe(Fs.value,S=>(m(),v("option",{key:S.value,value:S.value},k(S.label),9,b_))),128))],512),[[Et,ct.role]])]),u.value?re((m(),v("select",{key:0,"onUpdate:modelValue":f[54]||(f[54]=S=>ct.organization=S),class:"field",title:"Organization"},[(m(!0),v(le,null,Fe(Eo.value,S=>(m(),v("option",{key:S.value,value:S.value},k(S.label),9,x_))),128))],512)),[[Et,ct.organization]]):(m(),v("div",w_,[f[122]||(f[122]=D(" New users join your organization: ",-1)),r("span",k_,k(t.organizationName||"—"),1)])),re(r("input",{"onUpdate:modelValue":f[55]||(f[55]=S=>ct.password=S),type:"password",class:"field",placeholder:"Temporary password (min 8 chars)"},null,512),[[ve,ct.password]]),r("div",S_,[r("button",{class:"btn-accent",disabled:Di.value,onClick:Ra},k(Di.value?"Creating…":"Create user"),9,P_),yi.value?(m(),v("span",T_,k(yi.value),1)):R("",!0)])])]),_:1})])),r("div",C_,[r("div",L_,[f[123]||(f[123]=r("div",null,[r("div",{class:"eyebrow"},"Team"),r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"All users")],-1)),r("button",{class:"btn-ghost",disabled:Gn.value,onClick:Yn},k(Gn.value?"Loading…":"Refresh"),9,M_)]),rs.value?(m(),v("div",E_,k(rs.value),1)):!as.value.length&&!Gn.value?(m(),v("div",O_,"No users yet.")):(m(),v("div",z_,[r("table",A_,[r("thead",null,[r("tr",I_,[(m(),v(le,null,Fe(["User","Role","Organization","Status",""],S=>r("th",{key:S,class:"border-y border-line bg-surface-2 px-5 py-2.5 font-mono text-[10.5px] font-normal uppercase tracking-caps text-ink-muted"},k(S),1)),64))])]),r("tbody",null,[(m(!0),v(le,null,Fe(as.value,S=>(m(),v("tr",{key:S.id,class:Le(["border-b border-line last:border-0",Xe.id===S.id?"bg-accent-soft":""])},[r("td",$_,[r("span",D_,k(S.email),1),S.email===t.email?(m(),v("span",N_,"(you)")):R("",!0)]),r("td",R_,[r("span",{class:Le(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",y(S.role||"user")])},[E(J,{name:_(S.role||"user"),size:12},null,8,["name"]),D(k(h(S.role||"user")),1)],2)]),r("td",F_,[r("span",{class:Le(["text-sm",S.organizationName?"text-ink-secondary":"text-ink-muted"])},k(S.organizationName||"—"),3)]),r("td",B_,[r("span",{class:Le(["text-xs",S.verified?"text-success-fg":"text-ink-muted"])},k(S.verified?"Verified":"Unverified"),3)]),r("td",V_,[Jt.value===S.id?(m(),v(le,{key:0},[f[124]||(f[124]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Remove?",-1)),r("button",{class:"btn-ghost mr-1",onClick:f[56]||(f[56]=Qe=>Jt.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:Qe=>Fa(S)}," Remove ",8,U_)],64)):(m(),v("div",Z_,[r("button",{class:"btn-ghost inline-flex items-center gap-1.5",onClick:Qe=>us(S)},[E(J,{name:"settings",size:14}),f[125]||(f[125]=D(" Edit ",-1))],8,H_),S.email!==t.email?(m(),v("button",{key:0,class:"btn-ghost inline-flex items-center gap-1.5",onClick:Qe=>Jt.value=S.id},[E(J,{name:"trash",size:14}),f[126]||(f[126]=D(" Remove ",-1))],8,j_)):R("",!0)]))])],2))),128))])])]))])])):G.id==="organizations"?(m(),v("div",W_,[kn.id?(m(),v("div",K_,[E(xe,{block:"",title:"Rename organization",desc:"Update the organization's display name.",keywords:"rename organization edit"},{default:ye(()=>[r("div",G_,[re(r("input",{"onUpdate:modelValue":f[57]||(f[57]=S=>kn.name=S),class:"field",placeholder:"Organization name",onKeyup:Vl(zo,["enter"])},null,544),[[ve,kn.name]]),r("div",q_,[r("button",{class:"btn-accent",onClick:zo},"Save changes"),r("button",{class:"btn-ghost",onClick:Bs},"Cancel"),Sn.value?(m(),v("span",Y_,k(Sn.value),1)):R("",!0)])])]),_:1})])):(m(),v("div",J_,[E(xe,{block:"",title:"Add organization",desc:"Create a new organization. Assign admins and users to it from User management.",keywords:"add organization create tenant company"},{default:ye(()=>[r("div",X_,[re(r("input",{"onUpdate:modelValue":f[58]||(f[58]=S=>$n.name=S),class:"field",placeholder:"e.g. Northwind Aerial",onKeyup:Vl(Oo,["enter"])},null,544),[[ve,$n.name]]),r("div",Q_,[r("button",{class:"btn-accent",disabled:Bi.value,onClick:Oo},k(Bi.value?"Creating…":"Create organization"),9,ey),Lt.value?(m(),v("span",ty,k(Lt.value),1)):R("",!0)])])]),_:1})])),r("div",ny,[r("div",{class:"flex items-center justify-between px-5 py-4"},[f[127]||(f[127]=r("div",null,[r("div",{class:"eyebrow"},"Tenancy"),r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"All organizations")],-1)),r("button",{class:"btn-ghost",onClick:qn},"Refresh")]),Ni.value.length?(m(),v("div",sy,[r("table",oy,[r("thead",null,[r("tr",ay,[(m(),v(le,null,Fe(["Organization","Members",""],S=>r("th",{key:S,class:"border-y border-line bg-surface-2 px-5 py-2.5 font-mono text-[10.5px] font-normal uppercase tracking-caps text-ink-muted"},k(S),1)),64))])]),r("tbody",null,[(m(!0),v(le,null,Fe(Ni.value,S=>(m(),v("tr",{key:S.id,class:Le(["border-b border-line last:border-0",kn.id===S.id?"bg-accent-soft":""])},[r("td",ry,[r("span",ly,[E(J,{name:"grid",size:14,class:"text-ink-muted"}),D(k(S.name),1)])]),r("td",uy,k(Vi.value[S.id]||0),1),r("td",cy,[bi.value===S.id?(m(),v(le,{key:0},[f[128]||(f[128]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),r("button",{class:"btn-ghost mr-1",onClick:f[59]||(f[59]=Qe=>bi.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:Qe=>nn(S)}," Delete ",8,dy)],64)):(m(),v("div",fy,[r("button",{class:"btn-ghost inline-flex items-center gap-1.5",onClick:Qe=>Va(S)},[E(J,{name:"settings",size:14}),f[129]||(f[129]=D(" Rename ",-1))],8,hy),r("button",{class:"btn-ghost inline-flex items-center gap-1.5",disabled:(Vi.value[S.id]||0)>0,title:(Vi.value[S.id]||0)>0?"Reassign or remove members first":"",onClick:Qe=>bi.value=S.id},[E(J,{name:"trash",size:14}),f[130]||(f[130]=D(" Delete ",-1))],8,py)]))])],2))),128))])])])):(m(),v("div",iy,"No organizations yet."))])])):G.id==="advanced"?(m(),v("div",my,[r("div",gy,[E(xe,{title:"Export data",desc:"Download your settings and profile as JSON.",keywords:"export data download backup"},{default:ye(()=>[r("button",{class:"btn-ghost",onClick:xi},[E(J,{name:"download",size:15,class:"mr-1.5 inline"}),f[131]||(f[131]=D("Export",-1))])]),_:1}),E(xe,{block:"",title:"Import data",desc:"Restore settings from a previous export.",keywords:"import data upload restore"},{default:ye(()=>[r("label",vy,[E(J,{name:"upload",size:15,class:"mr-1.5 inline"}),f[132]||(f[132]=D("Choose file… ",-1)),r("input",{type:"file",accept:"application/json,.json",class:"hidden",onChange:Pn},null,32)]),cs.value?(m(),v("p",_y,k(cs.value),1)):R("",!0)]),_:1})]),r("div",yy,[r("div",by,[E(J,{name:"alertTriangle",size:18}),f[133]||(f[133]=r("h3",{class:"text-sm font-bold uppercase tracking-caps"},"Danger zone",-1))]),f[138]||(f[138]=r("p",{class:"mt-1 text-xs text-ink-secondary"},"Deleting your account is permanent and cannot be undone.",-1)),r("div",xy,[f[137]||(f[137]=r("div",{class:"text-sm font-semibold text-ink"},"Delete account",-1)),r("label",wy,[re(r("input",{"onUpdate:modelValue":f[60]||(f[60]=S=>pt.understand=S),type:"checkbox",class:"mt-0.5 h-4 w-4 accent-[var(--danger)]"},null,512),[[aa,pt.understand]]),f[134]||(f[134]=D(" I understand this permanently deletes my account and all associated data. ",-1))]),r("div",ky,[r("label",Sy,[f[135]||(f[135]=D("Type ",-1)),r("span",Py,k(Vs.value),1),f[136]||(f[136]=D(" to confirm",-1))]),re(r("input",{"onUpdate:modelValue":f[61]||(f[61]=S=>pt.typed=S),class:"field w-full max-w-[360px] font-mono",placeholder:Vs.value},null,8,Ty),[[ve,pt.typed]])]),r("div",Cy,[pt.armed?(m(),v("button",{key:1,class:"rounded bg-danger px-4 py-2.5 text-sm font-semibold text-white transition enabled:hover:brightness-110 disabled:cursor-not-allowed disabled:opacity-50",disabled:pt.cooldown>0,onClick:ds},k(pt.cooldown>0?`Confirm in ${pt.cooldown}s…`:"Permanently delete account"),9,My)):(m(),v("button",{key:0,class:"rounded bg-danger px-4 py-2.5 text-sm font-semibold text-white transition enabled:hover:brightness-110 disabled:cursor-not-allowed disabled:opacity-40",disabled:!Jn.value,onClick:Ao}," Delete account… ",8,Ly)),pt.armed&&pt.cooldown>0?(m(),v("span",Ey,"Cooling-off period — read once more.")):R("",!0)]),pt.msg?(m(),v("p",Oy,k(pt.msg),1)):R("",!0)])])])):R("",!0)],64))),128))])]),E(eh,{name:"fade"},{default:ye(()=>[vi.value?(m(),v("div",zy,[E(J,{name:"check",size:16,class:"text-success-fg"}),D(k(vi.value),1)])):R("",!0)]),_:1})]))}},Iy=Jp(Ay,[["__scopeId","data-v-4fe25eb7"]]),$y={class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},Dy={class:"flex flex-wrap items-center gap-3"},Ny={class:"inline-flex rounded-lg border border-line bg-surface-1 p-0.5"},Ry=["onClick"],Fy={class:"ml-auto flex items-center gap-2"},By=["href"],Vy={class:"grid grid-cols-4 gap-4 max-[900px]:grid-cols-2"},Uy={class:"eyebrow"},Zy={key:0,class:"panel border-danger/40 p-4 text-sm text-danger-fg"},Hy={key:0,class:"panel p-5"},jy={class:"mb-4 flex items-center justify-between"},Wy={class:"eyebrow"},Ky={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},Gy={class:"block"},qy={class:"block"},Yy={class:"block"},Jy={class:"block"},Xy={key:0,value:""},Qy=["value"],e1={class:"block"},t1={class:"block"},n1={class:"block"},i1={class:"block"},s1={class:"block"},o1=["value"],a1={class:"block"},r1=["value"],l1={class:"block"},u1=["value"],c1={class:"block"},d1={class:"mt-3 block"},f1={key:0,class:"mt-3 grid grid-cols-2 gap-3 max-[760px]:grid-cols-1"},h1={class:"block"},p1={class:"block"},m1={class:"block"},g1={class:"block"},v1={class:"col-span-2 block max-[760px]:col-span-1"},_1={class:"mt-4 flex items-center gap-3"},y1=["disabled"],b1={key:0,class:"text-sm text-danger-fg"},x1={class:"panel overflow-hidden p-0"},w1={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},k1={key:1,class:"grid place-items-center px-5 py-16 text-center"},S1={key:2,class:"overflow-x-auto"},P1={class:"w-full border-collapse text-sm"},T1={class:"text-left"},C1={class:"whitespace-nowrap px-5 py-3 font-mono text-ink"},L1={key:0,class:"text-ink-muted"},M1={class:"px-5 py-3 text-ink-secondary"},E1=["title"],O1={class:"px-5 py-3 font-mono text-ink-secondary"},z1={class:"px-5 py-3 text-ink-secondary"},A1={class:"px-5 py-3"},I1=["onClick"],$1={class:"whitespace-nowrap px-5 py-3 text-right"},D1=["onClick"],N1=["onClick"],R1=["onClick"],F1={key:0,class:"border-b border-line bg-surface-2"},B1={colspan:"7",class:"px-5 py-3"},V1={class:"flex flex-wrap gap-x-8 gap-y-1.5 text-xs"},U1={class:"text-ink-secondary"},Z1={class:"text-ink"},H1={class:"text-ink-secondary"},j1={class:"text-ink"},W1={class:"text-ink-secondary"},K1={class:"font-mono text-ink"},G1={key:0,class:"text-ink-secondary"},q1={class:"text-ink"},Y1={key:0,class:"mt-2 space-y-1"},J1={key:1,class:"mt-2 text-xs text-success-fg"},X1={key:0,class:"panel p-5"},Q1={class:"mb-4 flex items-center justify-between"},eb={class:"eyebrow"},tb={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},nb={class:"block"},ib={class:"block"},sb={class:"block"},ob={class:"block"},ab={class:"block"},rb={class:"block"},lb=["value"],ub={class:"mt-3 flex flex-wrap gap-6"},cb={class:"flex items-center gap-2 text-sm text-ink-secondary"},db={class:"flex items-center gap-2 text-sm text-ink-secondary"},fb={class:"mt-4 flex items-center gap-3"},hb=["disabled"],pb={key:0,class:"text-sm text-danger-fg"},mb={class:"panel overflow-hidden p-0"},gb={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},vb={key:1,class:"grid place-items-center px-5 py-16 text-center"},_b={key:2,class:"overflow-x-auto"},yb={class:"w-full border-collapse text-sm"},bb={class:"text-left"},xb={class:"px-5 py-3 font-semibold text-ink"},wb={class:"px-5 py-3 text-ink-secondary"},kb={class:"px-5 py-3 font-mono text-ink-secondary"},Sb={class:"px-5 py-3"},Pb={key:1,class:"text-ink-muted"},Tb={class:"px-5 py-3"},Cb={class:"whitespace-nowrap px-5 py-3 text-right"},Lb=["onClick"],Mb=["onClick"],Eb=["onClick"],Ob={__name:"Logbook",props:{email:{type:String,default:""},role:{type:String,default:"user"},organization:{type:String,default:""},organizationName:{type:String,default:""}},setup(t){const i=t,o={success:"bg-success-soft text-success-fg",warning:"bg-amber-soft text-amber-fg",danger:"bg-danger-soft text-danger-fg",accent:"bg-accent-soft text-accent-soft-fg",neutral:"bg-surface-2 text-ink-secondary"},l=K("flights"),u=K([]),d=K([]),h=K(!1),_=K("");async function y(){h.value=!0,_.value="";const[W,C]=await Promise.all([Sc(),rp()]);(!W.ok||!C.ok)&&(_.value=W.status===503||C.status===503?"Logbook storage is not configured on the API Server (service account missing).":"Could not load the logbook."),u.value=W.drones,d.value=C.flights,h.value=!1}Li(y);function T(W){const C=W.compliance||{};return C.exempt?{tone:"neutral",label:"Exempt"}:(C.redFlags||[]).length?{tone:"danger",label:`${C.redFlags.length} issue${C.redFlags.length>1?"s":""}`}:{tone:"success",label:"Compliant"}}const w=K("");function z(W){w.value=w.value===W?"":W}const U=[{value:"open",label:"Open"},{value:"specific",label:"Specific"},{value:"certified",label:"Certified"}],V=[{value:"commercial",label:"Commercial"},{value:"research",label:"Research"},{value:"public",label:"Public-benefit"},{value:"hobby",label:"Private hobby"},{value:"club_area",label:"Model-club area"}],ue=[{value:"",label:"Auto (from drone)"},{value:"manual",label:"Manual"},{value:"automatic",label:"Automatic (FDR)"}];function X(){var W;return{operationDate:new Date().toISOString().slice(0,10),startTime:"",endTime:"",drone:((W=u.value[0])==null?void 0:W.id)||"",areaRoute:"",maxAltitudeAgl:"",pilotName:i.email,certificateRef:"",category:"open",purpose:"commercial",loggingPath:"",rawFdrLogUrl:"",authorisationRef:"",weather:"",airspaceRef:"",observer:"",incidents:"",notes:""}}const Ae=K(!1),$e=K(""),Q=bt(X()),me=K(""),oe=K(!1),de=K(!1);function Ne(){Object.assign(Q,X()),$e.value="",me.value="",de.value=!1,Ae.value=!0}function nt(W){Object.assign(Q,{operationDate:(W.operationDate||"").slice(0,10),startTime:W.startTime||"",endTime:W.endTime||"",drone:W.drone||"",areaRoute:W.areaRoute||"",maxAltitudeAgl:W.maxAltitudeAgl||"",pilotName:W.pilotName||"",certificateRef:W.certificateRef||"",category:W.category||"open",purpose:W.purpose||"commercial",loggingPath:W.loggingPath||"",rawFdrLogUrl:W.rawFdrLogUrl||"",authorisationRef:W.authorisationRef||"",weather:W.weather||"",airspaceRef:W.airspaceRef||"",observer:W.observer||"",incidents:W.incidents||"",notes:W.notes||""}),$e.value=W.id,me.value="",de.value=!!(W.weather||W.airspaceRef||W.observer||W.incidents||W.notes),Ae.value=!0}function ke(){Ae.value=!1,$e.value=""}async function Te(){var O;if(me.value="",!Q.drone){me.value="Select a drone first (add one on the Drones tab).";return}oe.value=!0;const W={...Q,maxAltitudeAgl:Number(Q.maxAltitudeAgl)||0},C=$e.value?await up($e.value,W):await lp(W);if(oe.value=!1,!C.ok){me.value=((O=C.body)==null?void 0:O.error)||"Could not save the flight.";return}Ae.value=!1,await y()}const Be=K("");async function Ce(W){const C=await cp(W.id);Be.value="",C.ok&&await y()}const ee=["","C0","C1","C2","C3","C4","C5","C6"];function pe(){return{name:"",model:"",serial:"",operatorNumber:"",mtomGrams:"",isToy:!1,autologsFlights:!1,cClass:""}}const Re=K(!1),Ze=K(""),he=bt(pe()),De=K(""),ne=K(!1);function rt(){Object.assign(he,pe()),Ze.value="",De.value="",Re.value=!0}function ge(W){Object.assign(he,{name:W.name||"",model:W.model||"",serial:W.serial||"",operatorNumber:W.operatorNumber||"",mtomGrams:W.mtomGrams||"",isToy:!!W.isToy,autologsFlights:!!W.autologsFlights,cClass:W.cClass||""}),Ze.value=W.id,De.value="",Re.value=!0}function Me(){Re.value=!1,Ze.value=""}async function je(){var O;if(De.value="",!he.name.trim()){De.value="Give the drone a name.";return}ne.value=!0;const W={...he,mtomGrams:Number(he.mtomGrams)||0},C=Ze.value?await op(Ze.value,W):await sp(W);if(ne.value=!1,!C.ok){De.value=((O=C.body)==null?void 0:O.error)||"Could not save the drone.";return}Re.value=!1,await y()}const te=K("");async function $(W){var O;const C=await ap(W.id);te.value="",C.ok?await y():De.value=((O=C.body)==null?void 0:O.error)||"Could not delete the drone."}const I=we(()=>{const W=d.value.length,C=d.value.filter(ht=>{var lt;return(((lt=ht.compliance)==null?void 0:lt.redFlags)||[]).length}).length,O=d.value.filter(ht=>{var lt;return(lt=ht.compliance)==null?void 0:lt.required}).length;return{total:W,flagged:C,required:O,fleet:u.value.length}});return(W,C)=>(m(),v("div",$y,[r("div",Dy,[r("div",Ny,[(m(),v(le,null,Fe([["flights","Flights"],["drones","Drones"]],O=>r("button",{key:O[0],class:Le(["rounded-md px-3.5 py-1.5 text-sm font-semibold transition",l.value===O[0]?"bg-accent-soft text-accent-soft-fg":"text-ink-secondary hover:text-ink"]),onClick:ht=>l.value=O[0]},k(O[1]),11,Ry)),64))]),r("div",Fy,[r("a",{href:Ue(dp)(),class:"btn-ghost inline-flex items-center gap-2",title:"Download a compliance CSV (Trafikstyrelsen / police disclosure)"},[E(J,{name:"download",size:15}),C[29]||(C[29]=D(" Export CSV ",-1))],8,By),l.value==="flights"?(m(),v("button",{key:0,class:"btn-accent inline-flex items-center gap-2",onClick:Ne},[E(J,{name:"plus",size:15}),C[30]||(C[30]=D(" Log flight ",-1))])):(m(),v("button",{key:1,class:"btn-accent inline-flex items-center gap-2",onClick:rt},[E(J,{name:"plus",size:15}),C[31]||(C[31]=D(" Add drone ",-1))]))])]),r("div",Vy,[(m(!0),v(le,null,Fe([{label:"Flights logged",value:I.value.total,tone:"neutral"},{label:"Require logbook",value:I.value.required,tone:"neutral"},{label:"Compliance flags",value:I.value.flagged,tone:I.value.flagged?"danger":"success"},{label:"Registered drones",value:I.value.fleet,tone:"neutral"}],O=>(m(),v("div",{key:O.label,class:"panel p-5"},[r("div",Uy,k(O.label),1),r("div",{class:Le(["mt-2 text-[30px] font-bold leading-none tracking-tightest",O.tone==="danger"?"text-danger-fg":O.tone==="success"?"text-success-fg":"text-ink"])},k(O.value),3)]))),128))]),_.value?(m(),v("div",Zy,k(_.value),1)):R("",!0),l.value==="flights"?(m(),v(le,{key:1},[Ae.value?(m(),v("div",Hy,[r("div",jy,[r("div",null,[r("div",Wy,k($e.value?"Edit entry":"New entry"),1),C[32]||(C[32]=r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Logbook flight (BEK 1649 §5)",-1))]),r("button",{class:"btn-icon",onClick:ke},[E(J,{name:"x",size:16})])]),r("div",Ky,[r("label",Gy,[C[33]||(C[33]=r("span",{class:"eyebrow mb-1 block"},"Date",-1)),re(r("input",{"onUpdate:modelValue":C[0]||(C[0]=O=>Q.operationDate=O),type:"date",class:"field"},null,512),[[ve,Q.operationDate]])]),r("label",qy,[C[34]||(C[34]=r("span",{class:"eyebrow mb-1 block"},"Start",-1)),re(r("input",{"onUpdate:modelValue":C[1]||(C[1]=O=>Q.startTime=O),type:"time",class:"field"},null,512),[[ve,Q.startTime]])]),r("label",Yy,[C[35]||(C[35]=r("span",{class:"eyebrow mb-1 block"},"End",-1)),re(r("input",{"onUpdate:modelValue":C[2]||(C[2]=O=>Q.endTime=O),type:"time",class:"field"},null,512),[[ve,Q.endTime]])]),r("label",Jy,[C[36]||(C[36]=r("span",{class:"eyebrow mb-1 block"},"Drone",-1)),re(r("select",{"onUpdate:modelValue":C[3]||(C[3]=O=>Q.drone=O),class:"field"},[u.value.length?R("",!0):(m(),v("option",Xy,"— add a drone first —")),(m(!0),v(le,null,Fe(u.value,O=>(m(),v("option",{key:O.id,value:O.id},k(O.name)+k(O.model?` · ${O.model}`:""),9,Qy))),128))],512),[[Et,Q.drone]])]),r("label",e1,[C[37]||(C[37]=r("span",{class:"eyebrow mb-1 block"},"Max altitude (m AGL)",-1)),re(r("input",{"onUpdate:modelValue":C[4]||(C[4]=O=>Q.maxAltitudeAgl=O),type:"number",min:"0",class:"field",placeholder:"120"},null,512),[[ve,Q.maxAltitudeAgl]])]),r("label",t1,[C[38]||(C[38]=r("span",{class:"eyebrow mb-1 block"},"Area / route",-1)),re(r("input",{"onUpdate:modelValue":C[5]||(C[5]=O=>Q.areaRoute=O),class:"field",placeholder:"Field N of Roskilde, grid survey"},null,512),[[ve,Q.areaRoute]])]),r("label",n1,[C[39]||(C[39]=r("span",{class:"eyebrow mb-1 block"},"Remote pilot name",-1)),re(r("input",{"onUpdate:modelValue":C[6]||(C[6]=O=>Q.pilotName=O),class:"field",placeholder:"Full name"},null,512),[[ve,Q.pilotName]])]),r("label",i1,[C[40]||(C[40]=r("span",{class:"eyebrow mb-1 block"},"Certificate ref",-1)),re(r("input",{"onUpdate:modelValue":C[7]||(C[7]=O=>Q.certificateRef=O),class:"field",placeholder:"A2 / STS cert no."},null,512),[[ve,Q.certificateRef]])]),r("label",s1,[C[41]||(C[41]=r("span",{class:"eyebrow mb-1 block"},"Logging path",-1)),re(r("select",{"onUpdate:modelValue":C[8]||(C[8]=O=>Q.loggingPath=O),class:"field"},[(m(),v(le,null,Fe(ue,O=>r("option",{key:O.value,value:O.value},k(O.label),9,o1)),64))],512),[[Et,Q.loggingPath]])]),r("label",a1,[C[42]||(C[42]=r("span",{class:"eyebrow mb-1 block"},"Category",-1)),re(r("select",{"onUpdate:modelValue":C[9]||(C[9]=O=>Q.category=O),class:"field"},[(m(),v(le,null,Fe(U,O=>r("option",{key:O.value,value:O.value},k(O.label),9,r1)),64))],512),[[Et,Q.category]])]),r("label",l1,[C[43]||(C[43]=r("span",{class:"eyebrow mb-1 block"},"Purpose",-1)),re(r("select",{"onUpdate:modelValue":C[10]||(C[10]=O=>Q.purpose=O),class:"field"},[(m(),v(le,null,Fe(V,O=>r("option",{key:O.value,value:O.value},k(O.label),9,u1)),64))],512),[[Et,Q.purpose]])]),r("label",c1,[C[44]||(C[44]=r("span",{class:"eyebrow mb-1 block"},"Authorisation ref",-1)),re(r("input",{"onUpdate:modelValue":C[11]||(C[11]=O=>Q.authorisationRef=O),class:"field",placeholder:"Specific-category ref"},null,512),[[ve,Q.authorisationRef]])])]),r("label",d1,[C[45]||(C[45]=r("span",{class:"eyebrow mb-1 block"},"FDR log URL (automatic path)",-1)),re(r("input",{"onUpdate:modelValue":C[12]||(C[12]=O=>Q.rawFdrLogUrl=O),class:"field",placeholder:"Link to the stored flight-data-recorder export"},null,512),[[ve,Q.rawFdrLogUrl]])]),r("button",{class:"mt-4 flex items-center gap-1.5 text-sm font-semibold text-accent",onClick:C[13]||(C[13]=O=>de.value=!de.value)},[E(J,{name:de.value?"x":"plus",size:14},null,8,["name"]),C[46]||(C[46]=D(" Operational details (weather, airspace, incidents) ",-1))]),de.value?(m(),v("div",f1,[r("label",h1,[C[47]||(C[47]=r("span",{class:"eyebrow mb-1 block"},"Weather / wind",-1)),re(r("input",{"onUpdate:modelValue":C[14]||(C[14]=O=>Q.weather=O),class:"field",placeholder:"6 m/s NW, CAVOK"},null,512),[[ve,Q.weather]])]),r("label",p1,[C[48]||(C[48]=r("span",{class:"eyebrow mb-1 block"},"Airspace / NOTAM ref",-1)),re(r("input",{"onUpdate:modelValue":C[15]||(C[15]=O=>Q.airspaceRef=O),class:"field"},null,512),[[ve,Q.airspaceRef]])]),r("label",m1,[C[49]||(C[49]=r("span",{class:"eyebrow mb-1 block"},"Observer",-1)),re(r("input",{"onUpdate:modelValue":C[16]||(C[16]=O=>Q.observer=O),class:"field"},null,512),[[ve,Q.observer]])]),r("label",g1,[C[50]||(C[50]=r("span",{class:"eyebrow mb-1 block"},"Incidents / anomalies",-1)),re(r("input",{"onUpdate:modelValue":C[17]||(C[17]=O=>Q.incidents=O),class:"field",placeholder:"RTH trigger, GPS dropout…"},null,512),[[ve,Q.incidents]])]),r("label",v1,[C[51]||(C[51]=r("span",{class:"eyebrow mb-1 block"},"Notes",-1)),re(r("textarea",{"onUpdate:modelValue":C[18]||(C[18]=O=>Q.notes=O),rows:"2",class:"field"},null,512),[[ve,Q.notes]])])])):R("",!0),r("div",_1,[r("button",{class:"btn-accent",disabled:oe.value,onClick:Te},k(oe.value?"Saving…":$e.value?"Save changes":"Log flight"),9,y1),r("button",{class:"btn-ghost",onClick:ke},"Cancel"),me.value?(m(),v("span",b1,k(me.value),1)):R("",!0)])])):R("",!0),r("div",x1,[h.value?(m(),v("div",w1,"Loading…")):d.value.length?(m(),v("div",S1,[r("table",P1,[r("thead",null,[r("tr",T1,[(m(),v(le,null,Fe(["Date","Drone","Area / route","Alt","Pilot","Compliance",""],O=>r("th",{key:O,class:"border-y border-line bg-surface-2 px-5 py-2.5 font-mono text-[10.5px] font-normal uppercase tracking-caps text-ink-muted"},k(O),1)),64))])]),r("tbody",null,[(m(!0),v(le,null,Fe(d.value,O=>{var ht,lt,qt,b;return m(),v(le,{key:O.id},[r("tr",{class:Le(["border-b border-line last:border-0",$e.value===O.id?"bg-accent-soft":""])},[r("td",C1,[D(k((O.operationDate||"").slice(0,10))+" ",1),O.startTime?(m(),v("span",L1,k(O.startTime),1)):R("",!0)]),r("td",M1,k(O.droneName||"—"),1),r("td",{class:"max-w-[220px] truncate px-5 py-3 text-ink-secondary",title:O.areaRoute},k(O.areaRoute||"—"),9,E1),r("td",O1,k(O.maxAltitudeAgl?O.maxAltitudeAgl+" m":"—"),1),r("td",z1,k(O.pilotName||"—"),1),r("td",A1,[r("button",{class:Le(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",o[T(O).tone]]),onClick:g=>z(O.id)},[T(O).tone==="danger"?(m(),et(J,{key:0,name:"alertTriangle",size:12})):T(O).tone==="success"?(m(),et(J,{key:1,name:"check",size:12})):R("",!0),D(" "+k(T(O).label),1)],10,I1)]),r("td",$1,[Be.value===O.id?(m(),v(le,{key:0},[C[54]||(C[54]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),r("button",{class:"btn-ghost mr-1",onClick:C[19]||(C[19]=g=>Be.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:g=>Ce(O)},"Delete",8,D1)],64)):(m(),v(le,{key:1},[r("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:g=>nt(O)},[E(J,{name:"sliders",size:13}),C[55]||(C[55]=D(" Edit",-1))],8,N1),r("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:g=>Be.value=O.id},[E(J,{name:"trash",size:13})],8,R1)],64))])],2),w.value===O.id?(m(),v("tr",F1,[r("td",B1,[r("div",V1,[r("span",U1,[C[56]||(C[56]=D("Logging path: ",-1)),r("b",Z1,k(((ht=O.compliance)==null?void 0:ht.loggingPath)||"—"),1)]),r("span",H1,[C[57]||(C[57]=D("Category: ",-1)),r("b",j1,k(O.category||"—"),1)]),r("span",W1,[C[58]||(C[58]=D("Retain until: ",-1)),r("b",K1,k((O.retentionUntil||"").slice(0,10)||"—"),1)]),(lt=O.compliance)!=null&<.exempt?(m(),v("span",G1,[C[59]||(C[59]=D("Exempt: ",-1)),r("b",q1,k(O.compliance.exemptReason),1)])):R("",!0)]),(((qt=O.compliance)==null?void 0:qt.redFlags)||[]).length?(m(),v("ul",Y1,[(m(!0),v(le,null,Fe(O.compliance.redFlags,(g,M)=>(m(),v("li",{key:M,class:"flex items-start gap-2 text-xs text-danger-fg"},[E(J,{name:"alertTriangle",size:13,class:"mt-px shrink-0"}),D(" "+k(g),1)]))),128))])):(b=O.compliance)!=null&&b.exempt?R("",!0):(m(),v("div",J1,"No compliance gaps detected."))])])):R("",!0)],64)}),128))])])])):(m(),v("div",k1,[E(J,{name:"book",size:26,class:"text-ink-muted"}),C[52]||(C[52]=r("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No flights logged yet",-1)),C[53]||(C[53]=r("div",{class:"mt-1 text-xs text-ink-muted"},"Log your first operation to start the 5-year retention record.",-1))]))])],64)):(m(),v(le,{key:2},[Re.value?(m(),v("div",X1,[r("div",Q1,[r("div",null,[r("div",eb,k(Ze.value?"Edit drone":"New drone"),1),C[60]||(C[60]=r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Aircraft registry",-1))]),r("button",{class:"btn-icon",onClick:Me},[E(J,{name:"x",size:16})])]),r("div",tb,[r("label",nb,[C[61]||(C[61]=r("span",{class:"eyebrow mb-1 block"},"Name",-1)),re(r("input",{"onUpdate:modelValue":C[20]||(C[20]=O=>he.name=O),class:"field",placeholder:"Mavic-01"},null,512),[[ve,he.name]])]),r("label",ib,[C[62]||(C[62]=r("span",{class:"eyebrow mb-1 block"},"Model",-1)),re(r("input",{"onUpdate:modelValue":C[21]||(C[21]=O=>he.model=O),class:"field",placeholder:"DJI Mavic 3 Enterprise"},null,512),[[ve,he.model]])]),r("label",sb,[C[63]||(C[63]=r("span",{class:"eyebrow mb-1 block"},"Serial",-1)),re(r("input",{"onUpdate:modelValue":C[22]||(C[22]=O=>he.serial=O),class:"field"},null,512),[[ve,he.serial]])]),r("label",ob,[C[64]||(C[64]=r("span",{class:"eyebrow mb-1 block"},"Operator no.",-1)),re(r("input",{"onUpdate:modelValue":C[23]||(C[23]=O=>he.operatorNumber=O),class:"field",placeholder:"DNK…"},null,512),[[ve,he.operatorNumber]])]),r("label",ab,[C[65]||(C[65]=r("span",{class:"eyebrow mb-1 block"},"MTOM (grams)",-1)),re(r("input",{"onUpdate:modelValue":C[24]||(C[24]=O=>he.mtomGrams=O),type:"number",min:"0",class:"field",placeholder:"920"},null,512),[[ve,he.mtomGrams]])]),r("label",rb,[C[66]||(C[66]=r("span",{class:"eyebrow mb-1 block"},"C-class",-1)),re(r("select",{"onUpdate:modelValue":C[25]||(C[25]=O=>he.cClass=O),class:"field"},[(m(),v(le,null,Fe(ee,O=>r("option",{key:O,value:O},k(O||"— none —"),9,lb)),64))],512),[[Et,he.cClass]])])]),r("div",ub,[r("label",cb,[re(r("input",{"onUpdate:modelValue":C[26]||(C[26]=O=>he.autologsFlights=O),type:"checkbox",class:"h-4 w-4 accent-[var(--accent)]"},null,512),[[aa,he.autologsFlights]]),C[67]||(C[67]=D(" Auto-logs flights (onboard FDR) ",-1))]),r("label",db,[re(r("input",{"onUpdate:modelValue":C[27]||(C[27]=O=>he.isToy=O),type:"checkbox",class:"h-4 w-4 accent-[var(--accent)]"},null,512),[[aa,he.isToy]]),C[68]||(C[68]=D(" Toy drone (logbook-exempt) ",-1))])]),r("div",fb,[r("button",{class:"btn-accent",disabled:ne.value,onClick:je},k(ne.value?"Saving…":Ze.value?"Save changes":"Add drone"),9,hb),r("button",{class:"btn-ghost",onClick:Me},"Cancel"),De.value?(m(),v("span",pb,k(De.value),1)):R("",!0)])])):R("",!0),r("div",mb,[h.value?(m(),v("div",gb,"Loading…")):u.value.length?(m(),v("div",_b,[r("table",yb,[r("thead",null,[r("tr",bb,[(m(),v(le,null,Fe(["Name","Model","MTOM","Class","FDR",""],O=>r("th",{key:O,class:"border-y border-line bg-surface-2 px-5 py-2.5 font-mono text-[10.5px] font-normal uppercase tracking-caps text-ink-muted"},k(O),1)),64))])]),r("tbody",null,[(m(!0),v(le,null,Fe(u.value,O=>(m(),v("tr",{key:O.id,class:Le(["border-b border-line last:border-0",Ze.value===O.id?"bg-accent-soft":""])},[r("td",xb,k(O.name),1),r("td",wb,k(O.model||"—"),1),r("td",kb,k(O.mtomGrams?O.mtomGrams+" g":"—"),1),r("td",Sb,[O.cClass?(m(),v("span",{key:0,class:Le(["inline-flex rounded-full px-2 py-0.5 text-[11px] font-semibold",o.accent])},k(O.cClass),3)):(m(),v("span",Pb,"—")),O.isToy?(m(),v("span",{key:2,class:Le(["ml-1 inline-flex rounded-full px-2 py-0.5 text-[11px] font-semibold",o.neutral])},"toy",2)):R("",!0)]),r("td",Tb,[r("span",{class:Le(["text-xs",O.autologsFlights?"text-success-fg":"text-ink-muted"])},k(O.autologsFlights?"yes":"no"),3)]),r("td",Cb,[te.value===O.id?(m(),v(le,{key:0},[C[71]||(C[71]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),r("button",{class:"btn-ghost mr-1",onClick:C[28]||(C[28]=ht=>te.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:ht=>$(O)},"Delete",8,Lb)],64)):(m(),v(le,{key:1},[r("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:ht=>ge(O)},[E(J,{name:"sliders",size:13}),C[72]||(C[72]=D(" Edit",-1))],8,Mb),r("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:ht=>te.value=O.id},[E(J,{name:"trash",size:13})],8,Eb)],64))])],2))),128))])])])):(m(),v("div",vb,[E(J,{name:"drone",size:26,class:"text-ink-muted"}),C[69]||(C[69]=r("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No drones registered",-1)),C[70]||(C[70]=r("div",{class:"mt-1 text-xs text-ink-muted"},"Register the airframes you fly to log flights against them.",-1))]))])],64))]))}},zb={class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},Ab={class:"flex flex-wrap items-center gap-3"},Ib={class:"inline-flex flex-wrap rounded-lg border border-line bg-surface-1 p-0.5"},$b=["onClick"],Db={class:"ml-auto"},Nb={class:"grid grid-cols-4 gap-4 max-[900px]:grid-cols-2"},Rb={class:"eyebrow"},Fb={key:0,class:"panel border-danger/40 p-4 text-sm text-danger-fg"},Bb={key:1,class:"panel p-5"},Vb={class:"mb-4 flex items-center justify-between"},Ub={class:"eyebrow"},Zb={class:"mt-0.5 text-base font-semibold text-ink"},Hb={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},jb={class:"col-span-2 block max-[760px]:col-span-1"},Wb={class:"block"},Kb=["value"],Gb={class:"block"},qb=["value"],Yb={class:"block"},Jb=["value"],Xb={class:"block"},Qb={class:"block"},ex={class:"block"},tx={class:"block"},nx=["value"],ix={class:"block"},sx={class:"block"},ox={class:"block"},ax=["value"],rx={class:"mt-3 block"},lx={key:0,class:"mt-3"},ux={class:"eyebrow mb-1 block"},cx={key:1,class:"mt-3 text-xs text-ink-muted"},dx={class:"mt-4 flex items-center gap-3"},fx=["disabled"],hx={key:0,class:"text-sm text-danger-fg"},px={class:"panel overflow-hidden p-0"},mx={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},gx={key:1,class:"grid place-items-center px-5 py-16 text-center"},vx={class:"mt-3 text-sm font-medium text-ink-secondary"},_x={class:"mt-1 text-xs text-ink-muted"},yx={key:2,class:"overflow-x-auto"},bx={class:"w-full border-collapse text-sm"},xx={class:"text-left"},wx={class:"px-5 py-3"},kx={class:"font-semibold text-ink"},Sx={key:0,class:"font-mono text-[11px] text-ink-muted"},Px={class:"px-5 py-3 text-ink-secondary"},Tx={class:"px-5 py-3 text-ink-secondary"},Cx={class:"px-5 py-3"},Lx=["onClick"],Mx={key:0,class:"mt-0.5 font-mono text-[10.5px] text-ink-muted"},Ex={class:"px-5 py-3 font-mono text-ink-secondary"},Ox={class:"whitespace-nowrap px-5 py-3 text-right"},zx=["onClick"],Ax=["href"],Ix=["onClick"],$x=["onClick"],Dx=["onClick"],Nx={key:0,class:"border-b border-line bg-surface-2"},Rx={colspan:"6",class:"px-5 py-3"},Fx={class:"flex flex-wrap gap-x-8 gap-y-1.5 text-xs"},Bx={class:"text-ink-secondary"},Vx={class:"text-ink"},Ux={class:"text-ink-secondary"},Zx={class:"text-ink"},Hx={key:0,class:"text-ink-secondary"},jx={class:"text-ink"},Wx={key:1,class:"text-ink-secondary"},Kx={class:"font-mono text-ink"},Gx={key:2,class:"text-ink-secondary"},qx={class:"font-mono text-ink"},Yx={class:"text-ink-secondary"},Jx={class:"text-ink"},Xx={key:0,class:"mt-2 space-y-1"},Qx={key:1,class:"mt-2 text-xs text-success-fg"},e0={key:2,class:"mt-2 text-xs text-ink-secondary"},t0={__name:"Documents",props:{email:{type:String,default:""},role:{type:String,default:"user"},organization:{type:String,default:""},organizationName:{type:String,default:""}},setup(t){const i={success:"bg-success-soft text-success-fg",warning:"bg-amber-soft text-amber-fg",danger:"bg-danger-soft text-danger-fg",accent:"bg-accent-soft text-accent-soft-fg",neutral:"bg-surface-2 text-ink-secondary"},o=[{value:"certificate",label:"Pilot certificate"},{value:"medical",label:"Medical / training"},{value:"insurance",label:"Insurance / liability"},{value:"background_check",label:"Background check / waiver"},{value:"registration",label:"Aircraft registration"},{value:"maintenance",label:"Maintenance log"},{value:"conformity",label:"Conformity / compliance"},{value:"firmware",label:"Firmware / software"},{value:"incident",label:"Incident / repair report"},{value:"flight_log",label:"Flight log"},{value:"checklist",label:"Pre-flight checklist"},{value:"airspace_auth",label:"Airspace authorisation"},{value:"mission_plan",label:"Mission plan / flight path"},{value:"risk_assessment",label:"Risk assessment / survey"},{value:"contract",label:"Contract / SOW"},{value:"client_insurance",label:"Client insurance cert"},{value:"delivery_report",label:"Delivery / media handoff"},{value:"other",label:"Other"}],l=Object.fromEntries(o.map(te=>[te.value,te.label])),u=[{value:"pilot",label:"Pilot"},{value:"aircraft",label:"Aircraft"},{value:"organization",label:"Organization"},{value:"client",label:"Client"},{value:"other",label:"Other"}],d=[{value:"active",label:"Active"},{value:"pending_review",label:"Pending review"},{value:"archived",label:"Archived"}],h=[{value:"pilot",label:"Pilot"},{value:"ops",label:"Ops manager"},{value:"admin",label:"Admin"},{value:"client",label:"Client-facing"}],_=K([]),y=K([]),T=K(!1),w=K("");async function z(){T.value=!0,w.value="";const[te,$]=await Promise.all([fp(),Sc()]);te.ok||(w.value=te.status===503?"Document storage is not configured on the API Server (service account missing).":"Could not load documents."),_.value=te.documents,y.value=$.drones||[],T.value=!1}Li(z);const U=K("all"),V=[["all","All"],["expiring","Expiring soon"],["expired","Expired"],["pending","Pending review"],["archived","Archived"]],ue=we(()=>{const te=_.value;switch(U.value){case"expiring":return te.filter($=>{var I;return((I=$.expiry)==null?void 0:I.state)==="expiring_soon"&&$.status!=="archived"});case"expired":return te.filter($=>{var I;return((I=$.expiry)==null?void 0:I.state)==="expired"&&$.status!=="archived"});case"pending":return te.filter($=>$.status==="pending_review");case"archived":return te.filter($=>$.status==="archived");default:return te.filter($=>$.status!=="archived")}});function X(te){if(te.status==="archived")return{tone:"neutral",label:"Superseded",icon:""};const $=te.expiry||{};return $.state==="expired"?{tone:"danger",label:"Expired",icon:"alertTriangle"}:$.state==="expiring_soon"?{tone:"warning",label:`Expires in ${$.daysUntilExpiry}d`,icon:"clock"}:$.state==="valid"?{tone:"success",label:"Valid",icon:"check"}:{tone:"neutral",label:"No expiry",icon:""}}const Ae=K("");function $e(te){Ae.value=Ae.value===te?"":te}function Q(te){return te.ownerDrone?te.ownerDroneName||"Aircraft":te.ownerRef?te.ownerRef:te.ownerType==="pilot"?"Pilot":te.ownerType?te.ownerType.charAt(0).toUpperCase()+te.ownerType.slice(1):"—"}function me(){return{title:"",docType:"certificate",ownerType:"pilot",ownerDrone:"",ownerRef:"",reference:"",jurisdiction:"",issueDate:"",expiryDate:"",status:"active",accessTier:"ops",notes:""}}const oe=K(!1),de=K(""),Ne=K(""),nt=K(""),ke=bt(me()),Te=K(null),Be=K(null),Ce=K(""),ee=K(!1);function pe(){Te.value=null,Be.value&&(Be.value.value="")}function Re(){Object.assign(ke,me()),de.value="",Ne.value="",nt.value="",pe(),Ce.value="",oe.value=!0}function Ze(te){Object.assign(ke,{title:te.title||"",docType:te.docType||"certificate",ownerType:te.ownerType||"pilot",ownerDrone:te.ownerDrone||"",ownerRef:te.ownerRef||"",reference:te.reference||"",jurisdiction:te.jurisdiction||"",issueDate:te.issueDate||"",expiryDate:te.expiryDate||"",status:te.status||"active",accessTier:te.accessTier||"ops",notes:te.notes||""}),de.value=te.id,Ne.value="",nt.value="",pe(),Ce.value="",oe.value=!0}function he(te){Ze(te),de.value="",Ne.value=te.id,nt.value=te.title,ke.status="active"}function De(){oe.value=!1,de.value="",Ne.value=""}function ne(te){var $;Te.value=(($=te.target.files)==null?void 0:$[0])||null}async function rt(){var $;if(Ce.value="",!ke.title.trim()){Ce.value="Give the document a title.";return}ee.value=!0;let te;if(de.value)te=await pp(de.value,{...ke});else{const I={...ke};Ne.value&&(I.replaces=Ne.value),te=await hp(I,Te.value)}if(ee.value=!1,!te.ok){Ce.value=(($=te.body)==null?void 0:$.error)||"Could not save the document.";return}oe.value=!1,de.value="",Ne.value="",await z()}const ge=K("");async function Me(te){var I;const $=await mp(te.id);ge.value="",$.ok?await z():Ce.value=((I=$.body)==null?void 0:I.error)||"Could not delete the document."}const je=we(()=>{const te=_.value.filter($=>$.status!=="archived");return{total:te.length,expiring:te.filter($=>{var I;return((I=$.expiry)==null?void 0:I.state)==="expiring_soon"}).length,expired:te.filter($=>{var I;return((I=$.expiry)==null?void 0:I.state)==="expired"}).length,pending:_.value.filter($=>$.status==="pending_review").length}});return(te,$)=>(m(),v("div",zb,[r("div",Ab,[r("div",Ib,[(m(),v(le,null,Fe(V,I=>r("button",{key:I[0],class:Le(["rounded-md px-3.5 py-1.5 text-sm font-semibold transition",U.value===I[0]?"bg-accent-soft text-accent-soft-fg":"text-ink-secondary hover:text-ink"]),onClick:W=>U.value=I[0]},k(I[1]),11,$b)),64))]),r("div",Db,[r("button",{class:"btn-accent inline-flex items-center gap-2",onClick:Re},[E(J,{name:"upload",size:15}),$[13]||($[13]=D(" Add document ",-1))])])]),r("div",Nb,[(m(!0),v(le,null,Fe([{label:"Documents on file",value:je.value.total,tone:"neutral"},{label:"Expiring soon",value:je.value.expiring,tone:je.value.expiring?"warning":"neutral"},{label:"Expired",value:je.value.expired,tone:je.value.expired?"danger":"success"},{label:"Pending review",value:je.value.pending,tone:je.value.pending?"accent":"neutral"}],I=>(m(),v("div",{key:I.label,class:"panel p-5"},[r("div",Rb,k(I.label),1),r("div",{class:Le(["mt-2 text-[30px] font-bold leading-none tracking-tightest",I.tone==="danger"?"text-danger-fg":I.tone==="warning"?"text-amber-fg":I.tone==="success"?"text-success-fg":I.tone==="accent"?"text-accent-soft-fg":"text-ink"])},k(I.value),3)]))),128))]),w.value?(m(),v("div",Fb,k(w.value),1)):R("",!0),oe.value?(m(),v("div",Bb,[r("div",Vb,[r("div",null,[r("div",Ub,k(de.value?"Edit document":Ne.value?"New version":"New document"),1),r("div",Zb,k(Ne.value?`Supersedes “${nt.value}”`:"Compliance & operational document"),1)]),r("button",{class:"btn-icon",onClick:De},[E(J,{name:"x",size:16})])]),r("div",Hb,[r("label",jb,[$[14]||($[14]=r("span",{class:"eyebrow mb-1 block"},"Title",-1)),re(r("input",{"onUpdate:modelValue":$[0]||($[0]=I=>ke.title=I),class:"field",placeholder:"A2 Remote Pilot Certificate — J. Dariusz"},null,512),[[ve,ke.title]])]),r("label",Wb,[$[15]||($[15]=r("span",{class:"eyebrow mb-1 block"},"Type",-1)),re(r("select",{"onUpdate:modelValue":$[1]||($[1]=I=>ke.docType=I),class:"field"},[(m(),v(le,null,Fe(o,I=>r("option",{key:I.value,value:I.value},k(I.label),9,Kb)),64))],512),[[Et,ke.docType]])]),r("label",Gb,[$[16]||($[16]=r("span",{class:"eyebrow mb-1 block"},"Owner type",-1)),re(r("select",{"onUpdate:modelValue":$[2]||($[2]=I=>ke.ownerType=I),class:"field"},[(m(),v(le,null,Fe(u,I=>r("option",{key:I.value,value:I.value},k(I.label),9,qb)),64))],512),[[Et,ke.ownerType]])]),r("label",Yb,[$[18]||($[18]=r("span",{class:"eyebrow mb-1 block"},"Aircraft (if any)",-1)),re(r("select",{"onUpdate:modelValue":$[3]||($[3]=I=>ke.ownerDrone=I),class:"field"},[$[17]||($[17]=r("option",{value:""},"— none —",-1)),(m(!0),v(le,null,Fe(y.value,I=>(m(),v("option",{key:I.id,value:I.id},k(I.name)+k(I.model?` · ${I.model}`:""),9,Jb))),128))],512),[[Et,ke.ownerDrone]])]),r("label",Xb,[$[19]||($[19]=r("span",{class:"eyebrow mb-1 block"},"Owner reference",-1)),re(r("input",{"onUpdate:modelValue":$[4]||($[4]=I=>ke.ownerRef=I),class:"field",placeholder:"Client name / serial / site"},null,512),[[ve,ke.ownerRef]])]),r("label",Qb,[$[20]||($[20]=r("span",{class:"eyebrow mb-1 block"},"Reference / number",-1)),re(r("input",{"onUpdate:modelValue":$[5]||($[5]=I=>ke.reference=I),class:"field",placeholder:"Cert / registration / policy no."},null,512),[[ve,ke.reference]])]),r("label",ex,[$[21]||($[21]=r("span",{class:"eyebrow mb-1 block"},"Jurisdiction",-1)),re(r("input",{"onUpdate:modelValue":$[6]||($[6]=I=>ke.jurisdiction=I),class:"field",placeholder:"DK / EASA / FAA"},null,512),[[ve,ke.jurisdiction]])]),r("label",tx,[$[22]||($[22]=r("span",{class:"eyebrow mb-1 block"},"Access tier",-1)),re(r("select",{"onUpdate:modelValue":$[7]||($[7]=I=>ke.accessTier=I),class:"field"},[(m(),v(le,null,Fe(h,I=>r("option",{key:I.value,value:I.value},k(I.label),9,nx)),64))],512),[[Et,ke.accessTier]])]),r("label",ix,[$[23]||($[23]=r("span",{class:"eyebrow mb-1 block"},"Issue date",-1)),re(r("input",{"onUpdate:modelValue":$[8]||($[8]=I=>ke.issueDate=I),type:"date",class:"field"},null,512),[[ve,ke.issueDate]])]),r("label",sx,[$[24]||($[24]=r("span",{class:"eyebrow mb-1 block"},"Expiry date",-1)),re(r("input",{"onUpdate:modelValue":$[9]||($[9]=I=>ke.expiryDate=I),type:"date",class:"field"},null,512),[[ve,ke.expiryDate]])]),r("label",ox,[$[25]||($[25]=r("span",{class:"eyebrow mb-1 block"},"Status",-1)),re(r("select",{"onUpdate:modelValue":$[10]||($[10]=I=>ke.status=I),class:"field"},[(m(),v(le,null,Fe(d,I=>r("option",{key:I.value,value:I.value},k(I.label),9,ax)),64))],512),[[Et,ke.status]])])]),r("label",rx,[$[26]||($[26]=r("span",{class:"eyebrow mb-1 block"},"Notes",-1)),re(r("textarea",{"onUpdate:modelValue":$[11]||($[11]=I=>ke.notes=I),rows:"2",class:"field",placeholder:"Conditions, renewal contacts, anything worth recording"},null,512),[[ve,ke.notes]])]),de.value?(m(),v("div",cx,[...$[28]||($[28]=[D(" Editing updates metadata only. To replace the file, close this and use ",-1),r("b",{class:"text-ink-secondary"},"New version",-1),D(" on the document — the old version is kept for audit. ",-1)])])):(m(),v("div",lx,[r("span",ux,"File "+k(Ne.value?"(new version)":"(optional)"),1),r("input",{ref_key:"fileInput",ref:Be,type:"file",class:"field",onChange:ne},null,544),$[27]||($[27]=r("p",{class:"mt-1 text-xs text-ink-muted"}," Stored in PocketBase for now (object storage later). Max 50 MB. ",-1))])),r("div",dx,[r("button",{class:"btn-accent",disabled:ee.value,onClick:rt},k(ee.value?"Saving…":de.value?"Save changes":Ne.value?"Upload new version":"Add document"),9,fx),r("button",{class:"btn-ghost",onClick:De},"Cancel"),Ce.value?(m(),v("span",hx,k(Ce.value),1)):R("",!0)])])):R("",!0),r("div",px,[T.value?(m(),v("div",mx,"Loading…")):ue.value.length?(m(),v("div",yx,[r("table",bx,[r("thead",null,[r("tr",xx,[(m(),v(le,null,Fe(["Title","Type","Owner","Expiry","Ver",""],I=>r("th",{key:I,class:"border-y border-line bg-surface-2 px-5 py-2.5 font-mono text-[10.5px] font-normal uppercase tracking-caps text-ink-muted"},k(I),1)),64))])]),r("tbody",null,[(m(!0),v(le,null,Fe(ue.value,I=>{var W,C;return m(),v(le,{key:I.id},[r("tr",{class:Le(["border-b border-line last:border-0",de.value===I.id?"bg-accent-soft":""])},[r("td",wx,[r("div",kx,k(I.title),1),I.reference?(m(),v("div",Sx,k(I.reference),1)):R("",!0)]),r("td",Px,k(Ue(l)[I.docType]||I.docType||"—"),1),r("td",Tx,k(Q(I)),1),r("td",Cx,[r("button",{class:Le(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",i[X(I).tone]]),onClick:O=>$e(I.id)},[X(I).icon?(m(),et(J,{key:0,name:X(I).icon,size:12},null,8,["name"])):R("",!0),D(" "+k(X(I).label),1)],10,Lx),I.expiryDate?(m(),v("div",Mx,k(I.expiryDate),1)):R("",!0)]),r("td",Ex,"v"+k(I.version||1),1),r("td",Ox,[ge.value===I.id?(m(),v(le,{key:0},[$[29]||($[29]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),r("button",{class:"btn-ghost mr-1",onClick:$[12]||($[12]=O=>ge.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:O=>Me(I)},"Delete",8,zx)],64)):(m(),v(le,{key:1},[I.hasFile?(m(),v("a",{key:0,href:Ue(gp)(I.id),class:"btn-ghost mr-1 inline-flex items-center gap-1",title:"Download file"},[E(J,{name:"download",size:13})],8,Ax)):R("",!0),r("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",title:"Upload new version",onClick:O=>he(I)},[E(J,{name:"upload",size:13})],8,Ix),r("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:O=>Ze(I)},[E(J,{name:"sliders",size:13}),$[30]||($[30]=D(" Edit",-1))],8,$x),r("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:O=>ge.value=I.id},[E(J,{name:"trash",size:13})],8,Dx)],64))])],2),Ae.value===I.id?(m(),v("tr",Nx,[r("td",Rx,[r("div",Fx,[r("span",Bx,[$[31]||($[31]=D("Status: ",-1)),r("b",Vx,k(I.status||"—"),1)]),r("span",Ux,[$[32]||($[32]=D("Access: ",-1)),r("b",Zx,k(I.accessTier||"—"),1)]),I.jurisdiction?(m(),v("span",Hx,[$[33]||($[33]=D("Jurisdiction: ",-1)),r("b",jx,k(I.jurisdiction),1)])):R("",!0),I.issueDate?(m(),v("span",Wx,[$[34]||($[34]=D("Issued: ",-1)),r("b",Kx,k(I.issueDate),1)])):R("",!0),I.expiryDate?(m(),v("span",Gx,[$[35]||($[35]=D("Expires: ",-1)),r("b",qx,k(I.expiryDate),1)])):R("",!0),r("span",Yx,[$[36]||($[36]=D("File: ",-1)),r("b",Jx,k(I.hasFile?I.fileName:"none"),1)])]),(((W=I.expiry)==null?void 0:W.flags)||[]).length?(m(),v("ul",Xx,[(m(!0),v(le,null,Fe(I.expiry.flags,(O,ht)=>(m(),v("li",{key:ht,class:Le(["flex items-start gap-2 text-xs",I.expiry.state==="expired"?"text-danger-fg":I.expiry.state==="expiring_soon"?"text-amber-fg":"text-ink-secondary"])},[E(J,{name:"alertTriangle",size:13,class:"mt-px shrink-0"}),D(" "+k(O),1)],2))),128))])):((C=I.expiry)==null?void 0:C.state)==="valid"?(m(),v("div",Qx,"In force — no action needed.")):R("",!0),I.notes?(m(),v("div",e0,[$[37]||($[37]=r("span",{class:"text-ink-muted"},"Notes:",-1)),D(" "+k(I.notes),1)])):R("",!0)])])):R("",!0)],64)}),128))])])])):(m(),v("div",gx,[E(J,{name:"fileText",size:26,class:"text-ink-muted"}),r("div",vx,k(U.value==="all"?"No documents on file yet":"Nothing in this view"),1),r("div",_x,k(U.value==="all"?"Add certificates, registrations, insurance and authorisations to track their expiry.":"Try a different filter."),1)]))])]))}},n0={class:"grid h-full grid-cols-[248px_1fr] max-[900px]:grid-cols-1"},i0={class:"flex flex-col border-r border-line bg-surface-1 px-4 py-5 max-[900px]:hidden"},s0={class:"flex items-center gap-2.5 px-2 pb-5"},o0={class:"flex flex-col gap-0.5"},a0=["onClick"],r0={class:"mt-auto flex flex-col gap-2.5"},l0={class:"rounded-lg bg-surface-2 p-3"},u0={class:"flex items-center gap-2"},c0={class:"text-xs font-semibold text-ink"},d0={class:"mt-1.5 block font-mono text-[10.5px] text-ink-muted"},f0={class:"flex items-center gap-2.5 px-2 py-1"},h0={class:"grid h-8 w-8 place-items-center rounded-full bg-[var(--navy-800)] text-xs font-bold text-white"},p0={class:"min-w-0 flex-1"},m0={class:"truncate text-[13px] font-semibold text-ink"},g0={class:"flex items-center gap-1.5 text-[11px] text-ink-muted"},v0=["title"],_0={class:"overflow-y-auto"},y0={class:"sticky top-0 z-10 flex items-center gap-4 border-b border-line px-7 py-3.5",style:{background:"color-mix(in srgb, var(--bg-app) 82%, transparent)","backdrop-filter":"blur(10px)"}},b0={class:"mt-0.5 text-[22px] font-bold tracking-tightest text-ink"},x0={class:"ml-auto flex items-center gap-3"},w0={class:"flex h-10 w-60 items-center gap-2 rounded border border-line-strong bg-surface-1 px-3 max-[1100px]:hidden"},k0={key:0,class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},S0={class:"grid grid-cols-4 gap-4 max-[1100px]:grid-cols-2 max-[560px]:grid-cols-1"},P0={class:"flex items-center justify-between"},T0={class:"eyebrow"},C0={class:"mt-2.5 text-[34px] font-bold leading-none tracking-tightest text-ink"},L0={class:"grid grid-cols-[1.6fr_1fr] gap-5 max-[1100px]:grid-cols-1"},M0={class:"panel p-5"},E0={class:"mb-3.5 flex items-center justify-between"},O0={class:"panel p-5"},z0={class:"mb-3.5 flex items-center justify-between"},A0={class:"grid place-items-center py-10 text-center"},I0={class:"panel overflow-hidden p-0"},$0={class:"flex items-center justify-between px-5 py-4"},D0={class:"flex gap-2"},N0={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},R0={key:1,class:"overflow-x-auto"},F0={class:"w-full border-collapse text-sm"},B0={class:"text-left"},V0=["onClick"],U0={class:"px-5 py-3 font-mono font-bold text-ink"},Z0={class:"px-5 py-3 text-ink-secondary"},H0={class:"px-5 py-3"},j0={class:"px-5 py-3 font-mono text-ink-secondary"},W0={class:"px-5 py-3"},K0={key:0,class:"flex items-center gap-2"},G0={class:"h-1.5 w-12 overflow-hidden rounded bg-surface-2"},q0={class:"font-mono text-xs text-ink-secondary"},Y0={key:1,class:"font-mono text-xs text-ink-muted"},J0={class:"px-5 py-3 font-mono text-ink-secondary"},X0={class:"px-5 py-3 text-right"},Q0=["onClick"],ew={key:1,class:"p-7"},tw={class:"mb-4 flex flex-wrap items-center gap-3"},nw={class:"font-mono text-mode font-bold text-ink"},iw={key:0,class:"rounded-full bg-danger-soft px-2.5 py-0.5 font-mono text-[10px] font-bold uppercase tracking-caps text-danger-fg"},sw={key:1,class:"ml-auto flex flex-wrap gap-1.5"},ow=["onClick"],aw={key:0,class:"panel grid place-items-center p-16 text-center"},rw={class:"pill"},lw={class:"pill"},uw={class:"pill"},cw={class:"mt-1 text-sm font-semibold text-ink"},dw={class:"pill"},fw={class:"mt-1 font-mono text-sm font-bold tabular text-ink"},hw={class:"grid grid-cols-2 gap-4 max-[820px]:grid-cols-1"},pw={class:"panel p-4"},mw={class:"flex items-center gap-4"},gw={class:"h-9 flex-1 overflow-hidden rounded border border-line bg-surface-2"},vw={class:"readout"},_w={class:"panel p-4"},yw={class:"readout"},bw={class:"panel p-4"},xw={class:"space-y-1.5 text-sm"},ww={class:"flex justify-between"},kw={class:"text-ink"},Sw={class:"flex justify-between"},Pw={class:"text-ink"},Tw={class:"flex justify-between"},Cw={class:"font-mono tabular text-ink"},Lw={class:"flex justify-between"},Mw={class:"font-mono tabular text-ink"},Ew={class:"panel p-4"},Ow={class:"space-y-1.5 text-sm"},zw={class:"flex justify-between"},Aw={class:"font-mono tabular text-ink"},Iw={class:"flex justify-between"},$w={class:"font-mono tabular text-ink"},Dw={class:"flex justify-between"},Nw={class:"font-mono tabular text-ink"},Rw={class:"panel col-span-2 p-4 max-[820px]:col-span-1"},Fw={class:"panel p-4"},Bw={class:"flex flex-wrap gap-2"},Vw={class:"mt-2 min-h-[16px] text-xs text-ink-muted"},Uw={class:"panel p-4"},Zw={class:"h-[180px] overflow-y-auto font-mono text-xs"},Hw={class:"text-ink-muted"},jw={class:"font-semibold text-accent"},Ww={class:"break-all text-ink"},Kw={key:5,class:"p-7"},Gw={class:"panel grid place-items-center p-16 text-center"},qw={class:"mt-3 text-sm font-medium text-ink-secondary"},Yw={key:0,class:"mt-1 text-xs text-ink-muted"},Jw={key:1,class:"mt-1 text-xs text-ink-muted"},Xw={__name:"Dashboard",props:{email:{type:String,default:""},role:{type:String,default:"user"},organization:{type:String,default:""},organizationName:{type:String,default:""}},emits:["logout"],setup(t,{emit:i}){const o=t,l=i,u=bt({}),d=bt({}),h=K(null),_=K(!1),y=bt([]),T=K(""),w=K("Overview"),z=[["grid","Overview"],["radio","Live flights"],["route","Routes"],["calendar","Schedule"],["book","Logbook"],["fileText","Documents"],["server","Drives"],["settings","Settings"]],U=we(()=>(z.find(([,b])=>b===w.value)||["grid"])[0]),V=K(""),ue=K(""),X=K("");let Ae=null,$e=null,Q=!1;const me=we(()=>Object.keys(u).sort((b,g)=>(u[g].online?1:0)-(u[b].online?1:0)||b.localeCompare(g))),oe=we(()=>h.value?u[h.value]:null),de=we(()=>oe.value&&oe.value.telemetry||{}),Ne=we(()=>!!(oe.value&&oe.value.online)),nt=we(()=>{const b=de.value;return typeof b.latitude=="number"&&typeof b.longitude=="number"&&(b.latitude||b.longitude)?{lat:b.latitude,lng:b.longitude}:null}),ke=we(()=>h.value&&d[h.value]||[]),Te=we(()=>{const b=de.value;return typeof b.velocityX=="number"&&typeof b.velocityY=="number"?Math.hypot(b.velocityX,b.velocityY):null});function Be(b){return b.online?b.connected?["In flight","success"]:["Standby","accent"]:["Offline","neutral"]}function Ce(b){const g=b&&b.telemetry||{};return typeof g.velocityX=="number"&&typeof g.velocityY=="number"?Math.hypot(g.velocityX,g.velocityY):null}const ee=we(()=>me.value.map(b=>{const g=u[b],M=g.telemetry||{},[Z,B]=Be(g);return{id:b,mission:g.model||(g.connected?"Drone linked":g.online?"App online":"No signal"),status:Z,tone:B,alt:typeof M.altitude=="number"?M.altitude.toFixed(0)+" m":"—",battery:typeof M.batteryPercent=="number"?M.batteryPercent:null,speed:Ce(g)}})),pe=we(()=>me.value.filter(b=>u[b].online).length),Re=we(()=>me.value.filter(b=>u[b].online&&u[b].connected).length),Ze=we(()=>me.value.filter(b=>!u[b].online).length),he=we(()=>{const b=me.value.map(g=>{var M;return(M=u[g].telemetry)==null?void 0:M.batteryPercent}).filter(g=>typeof g=="number");return b.length?Math.round(b.reduce((g,M)=>g+M,0)/b.length):null}),De=we(()=>[{label:"Active flights",value:String(Re.value),delta:`${pe.value} online`,tone:"success",icon:"radio"},{label:"Avg battery",value:he.value==null?"—":he.value+"%",delta:he.value==null?"no telemetry":he.value<40?"low — watch":"nominal",tone:he.value!=null&&he.value<40?"danger":"neutral",icon:"battery"},{label:"Fleet size",value:String(me.value.length),delta:`${Re.value} in flight`,tone:"neutral",icon:"grid"},{label:"Offline",value:String(Ze.value),delta:Ze.value?"needs attention":"all reachable",tone:Ze.value?"warning":"success",icon:"signal"}]),ne={success:"bg-success-soft text-success-fg",warning:"bg-amber-soft text-amber-fg",danger:"bg-danger-soft text-danger-fg",accent:"bg-accent-soft text-accent-soft-fg",neutral:"bg-surface-2 text-ink-secondary"},rt={success:"text-success-fg",danger:"text-danger-fg",warning:"text-amber-fg",neutral:"text-ink-muted",accent:"text-accent-soft-fg"},ge=we(()=>{var M,Z,B;const g=(o.email||"PV").split("@")[0].split(/[.\-_ ]+/).filter(Boolean);return((((M=g[0])==null?void 0:M[0])||"P")+(((Z=g[1])==null?void 0:Z[0])||((B=g[0])==null?void 0:B[1])||"V")).toUpperCase()}),Me={superadmin:"Superadmin",admin:"Admin",user:"Operator"},je=we(()=>Me[o.role]||"Operator"),te=we(()=>o.organizationName||(o.role==="superadmin"?"All organizations":"No organization"));function $(b){var M;u[b.deviceId]=b;const g=b.telemetry||{};typeof g.latitude=="number"&&typeof g.longitude=="number"&&(g.latitude||g.longitude)&&(d[b.deviceId]||(d[b.deviceId]=[]),d[b.deviceId].push([g.latitude,g.longitude]),d[b.deviceId].length>1e3&&d[b.deviceId].shift()),(!h.value||b.online&&!((M=u[h.value])!=null&&M.online))&&(h.value=b.deviceId)}function I(b){delete u[b],delete d[b],h.value===b&&(h.value=me.value[0]||null)}function W(b){y.unshift({t:ql(Date.now()),tag:b.type||"?",text:JSON.stringify(C(b))}),y.length>200&&y.pop()}function C(b){const g={...b};return delete g.type,g}function O(){const b=location.protocol==="https:"?"wss":"ws";Ae=new WebSocket(`${b}://${location.host}/bff/ws`),Ae.onopen=()=>_.value=!0,Ae.onclose=()=>{_.value=!1,Q||($e=setTimeout(O,1500))},Ae.onerror=()=>Ae&&Ae.close(),Ae.onmessage=g=>{let M;try{M=JSON.parse(g.data)}catch{return}M.type==="snapshot"?(M.devices||[]).forEach($):M.type==="update"&&M.device?($(M.device),M.event&&M.device.deviceId===h.value&&W(M.event)):M.type==="removed"&&M.deviceId&&I(M.deviceId)}}async function ht(){if(!h.value)return X.value="No device selected.";if(!V.value.trim())return X.value="Enter a command name.";let b;if(ue.value.trim())try{b=JSON.parse(ue.value)}catch{return X.value="Payload is not valid JSON."}const{ok:g,body:M}=await vp(h.value,V.value.trim(),b);X.value=g?`Sent "${V.value.trim()}".`:`Error: ${M.error||"failed"}`}function lt(b,g,M=""){return typeof b=="number"?b.toFixed(g)+M:"—"}function qt(b){h.value=b,w.value="Live flights"}return Li(async()=>{(await Fh()).forEach($),O()}),_a(()=>{Q=!0,$e&&clearTimeout($e),Ae&&Ae.close()}),(b,g)=>{var M,Z,B,H,ie;return m(),v("div",n0,[r("aside",i0,[r("div",s0,[E(Mc,{size:26}),g[7]||(g[7]=r("span",{class:"text-[19px] tracking-tightest"},[r("span",{class:"font-medium text-ink-secondary"},"Pilot"),r("span",{class:"font-bold text-ink"},"Vault")],-1))]),r("nav",o0,[(m(),v(le,null,Fe(z,([F,Y])=>r("button",{key:Y,class:Le(["flex items-center gap-3 rounded px-3 py-2.5 text-left text-sm transition",w.value===Y?"bg-accent-soft font-semibold text-accent-soft-fg":"font-medium text-ink-secondary hover:bg-surface-2"]),onClick:j=>w.value=Y},[E(J,{name:F,size:18,stroke:w.value===Y?2.2:1.8},null,8,["name","stroke"]),D(" "+k(Y),1)],10,a0)),64))]),r("div",r0,[r("div",l0,[r("div",u0,[r("span",{class:Le(["h-2 w-2 rounded-full",_.value?"bg-ready":"bg-caution"])},null,2),r("span",c0,k(_.value?"Link healthy":"Reconnecting…"),1)]),r("span",d0,"API gateway · "+k(_.value?"streaming":"retrying"),1)]),r("div",f0,[r("div",h0,k(ge.value),1),r("div",p0,[r("div",m0,k(t.email||"Operator"),1),r("div",g0,[E(J,{name:"grid",size:11,class:"shrink-0"}),r("span",{class:"truncate",title:`${je.value} · ${te.value}`},k(je.value)+" · "+k(te.value),9,v0)])]),r("button",{class:"text-ink-muted transition hover:text-ink",title:"Log out","aria-label":"Log out",onClick:g[0]||(g[0]=F=>l("logout"))},[E(J,{name:"logout",size:16})])])])]),r("main",_0,[r("header",y0,[r("div",null,[g[8]||(g[8]=r("div",{class:"eyebrow"},"Live operations",-1)),r("h1",b0,k(w.value),1)]),r("div",x0,[r("div",w0,[E(J,{name:"search",size:16,class:"text-ink-muted"}),re(r("input",{"onUpdate:modelValue":g[1]||(g[1]=F=>T.value=F),placeholder:"Search drones, routes…",class:"w-full border-none bg-transparent text-sm text-ink outline-none placeholder:text-ink-muted"},null,512),[[ve,T.value]])]),r("button",{class:"btn-accent flex items-center gap-2",onClick:g[2]||(g[2]=F=>w.value="Live flights")},[E(J,{name:"radio",size:16}),g[9]||(g[9]=D(" Live flights ",-1))])])]),w.value==="Overview"?(m(),v("div",k0,[r("div",S0,[(m(!0),v(le,null,Fe(De.value,F=>(m(),v("div",{key:F.label,class:"panel p-5"},[r("div",P0,[r("span",T0,k(F.label),1),E(J,{name:F.icon,size:16,class:"text-ink-muted"},null,8,["name"])]),r("div",C0,k(F.value),1),r("span",{class:Le(["mt-2 block font-mono text-[11px]",rt[F.tone]])},k(F.delta),3)]))),128))]),r("div",L0,[r("div",M0,[r("div",E0,[g[11]||(g[11]=r("div",null,[r("div",{class:"eyebrow"},"Airspace"),r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Live map")],-1)),Re.value?(m(),v("span",{key:0,class:Le(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",ne.success])},[g[10]||(g[10]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(k(Re.value)+" airborne ",1)],2)):R("",!0)]),E(Ql,{position:nt.value,trail:ke.value},null,8,["position","trail"])]),r("div",O0,[r("div",z0,[g[12]||(g[12]=r("div",null,[r("div",{class:"eyebrow"},"Today"),r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Schedule")],-1)),E(J,{name:"clock",size:16,class:"text-ink-muted"})]),r("div",A0,[E(J,{name:"calendar",size:24,class:"text-ink-muted"}),g[13]||(g[13]=r("div",{class:"mt-2 text-sm font-medium text-ink-secondary"},"No missions scheduled",-1)),g[14]||(g[14]=r("div",{class:"mt-0.5 text-xs text-ink-muted"},"Scheduling is not wired to a backend yet.",-1))])])]),r("div",I0,[r("div",$0,[g[17]||(g[17]=r("div",null,[r("div",{class:"eyebrow"},"Fleet"),r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Aircraft status")],-1)),r("div",D0,[r("span",{class:Le(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",ne.success])},[g[15]||(g[15]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(k(Re.value)+" in flight ",1)],2),Ze.value?(m(),v("span",{key:0,class:Le(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",ne.warning])},[g[16]||(g[16]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(k(Ze.value)+" offline ",1)],2)):R("",!0)])]),ee.value.length?(m(),v("div",R0,[r("table",F0,[r("thead",null,[r("tr",B0,[(m(),v(le,null,Fe(["Aircraft","Mission","Status","Alt","Battery","Speed",""],F=>r("th",{key:F,class:"border-y border-line bg-surface-2 px-5 py-2.5 font-mono text-[10.5px] font-normal uppercase tracking-caps text-ink-muted"},k(F),1)),64))])]),r("tbody",null,[(m(!0),v(le,null,Fe(ee.value,(F,Y)=>(m(),v("tr",{key:F.id,class:Le(["cursor-pointer transition hover:bg-surface-2",Yqt(F.id)},[r("td",U0,k(F.id),1),r("td",Z0,k(F.mission),1),r("td",H0,[r("span",{class:Le(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",ne[F.tone]])},[g[18]||(g[18]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(k(F.status),1)],2)]),r("td",j0,k(F.alt),1),r("td",W0,[F.battery!=null?(m(),v("div",K0,[r("div",G0,[r("div",{class:Le(["h-full",F.battery<40?"bg-caution":"bg-ready"]),style:Ss({width:F.battery+"%"})},null,6)]),r("span",q0,k(F.battery)+"%",1)])):(m(),v("span",Y0,"—"))]),r("td",J0,[D(k(F.speed==null?"—":F.speed.toFixed(1))+" ",1),g[19]||(g[19]=r("span",{class:"text-ink-muted"},"m/s",-1))]),r("td",X0,[r("button",{class:"btn-ghost inline-flex items-center gap-1.5 whitespace-nowrap",onClick:yc(j=>qt(F.id),["stop"])},[E(J,{name:"play",size:14}),g[20]||(g[20]=D(" Track ",-1))],8,Q0)])],10,V0))),128))])])])):(m(),v("div",N0," No aircraft connected yet. Devices appear here as they come online. "))])])):w.value==="Live flights"?(m(),v("div",ew,[r("div",tw,[r("span",nw,k(h.value||"No device selected"),1),oe.value&&!Ne.value?(m(),v("span",iw,"Offline")):R("",!0),me.value.length?(m(),v("div",sw,[(m(!0),v(le,null,Fe(me.value,F=>(m(),v("button",{key:F,class:Le(["flex items-center gap-2 rounded border px-3 py-1.5 font-mono text-xs font-bold transition",F===h.value?"border-accent bg-accent-soft text-accent-soft-fg":"border-line bg-surface-1 text-ink-secondary hover:border-line-strong"]),onClick:Y=>h.value=F},[r("span",{class:Le(["h-2 w-2 rounded-full",u[F].online?"bg-ready":"bg-ink-muted"])},null,2),D(" "+k(F),1)],10,ow))),128))])):R("",!0)]),me.value.length?(m(),v(le,{key:1},[r("div",{class:Le(["mb-4 grid gap-3",!Ne.value&&oe.value?"opacity-60":""]),style:{"grid-template-columns":"repeat(auto-fit, minmax(150px, 1fr))"}},[r("div",rw,[g[23]||(g[23]=r("div",{class:"eyebrow"},"Registration",-1)),r("div",{class:Le(["mt-1 text-sm font-semibold",Ne.value?((M=oe.value)==null?void 0:M.registration)==="success"?"text-success-fg":"text-danger-fg":"text-ink"])},k(Ne.value&&((Z=oe.value)!=null&&Z.registration)?oe.value.registration:"—"),3)]),r("div",lw,[g[24]||(g[24]=r("div",{class:"eyebrow"},"Drone link",-1)),r("div",{class:Le(["mt-1 text-sm font-semibold",Ne.value?(B=oe.value)!=null&&B.connected?"text-success-fg":"text-danger-fg":"text-ink"])},k(oe.value?Ne.value?oe.value.connected?"connected":"no drone":"app offline":"—"),3)]),r("div",uw,[g[25]||(g[25]=r("div",{class:"eyebrow"},"Model",-1)),r("div",cw,k(((H=oe.value)==null?void 0:H.model)||"—"),1)]),r("div",dw,[g[26]||(g[26]=r("div",{class:"eyebrow"},"Last update",-1)),r("div",fw,k((ie=oe.value)!=null&&ie.lastSeenMs?Ue(ql)(oe.value.lastSeenMs):"—"),1)])],2),r("div",hw,[r("div",pw,[g[28]||(g[28]=r("div",{class:"mb-3 eyebrow"},"Battery",-1)),r("div",mw,[r("div",gw,[r("div",{class:Le(["h-full transition-all",typeof de.value.batteryPercent=="number"?de.value.batteryPercent<20?"bg-warning":de.value.batteryPercent<40?"bg-caution":"bg-ready":""]),style:Ss({width:(typeof de.value.batteryPercent=="number"?de.value.batteryPercent:0)+"%"})},null,6)]),r("div",vw,[D(k(typeof de.value.batteryPercent=="number"?de.value.batteryPercent:"—"),1),g[27]||(g[27]=r("span",{class:"text-sm text-ink-secondary"},"%",-1))])])]),r("div",_w,[g[30]||(g[30]=r("div",{class:"mb-3 eyebrow"},"Altitude",-1)),r("div",yw,[D(k(lt(de.value.altitude,1)),1),g[29]||(g[29]=r("span",{class:"text-sm text-ink-secondary"}," m",-1))])]),r("div",bw,[g[35]||(g[35]=r("div",{class:"mb-3 eyebrow"},"Flight",-1)),r("div",xw,[r("div",ww,[g[31]||(g[31]=r("span",{class:"text-ink-secondary"},"Mode",-1)),r("b",kw,k(de.value.flightMode||"—"),1)]),r("div",Sw,[g[32]||(g[32]=r("span",{class:"text-ink-secondary"},"Flying",-1)),r("b",Pw,k(de.value.isFlying==null?"—":de.value.isFlying?"yes":"no"),1)]),r("div",Tw,[g[33]||(g[33]=r("span",{class:"text-ink-secondary"},"GPS sats",-1)),r("b",Cw,k(de.value.satelliteCount==null?"—":de.value.satelliteCount),1)]),r("div",Lw,[g[34]||(g[34]=r("span",{class:"text-ink-secondary"},"Speed (H)",-1)),r("b",Mw,k(Te.value==null?"—":lt(Te.value,2," m/s")),1)])])]),r("div",Ew,[g[39]||(g[39]=r("div",{class:"mb-3 eyebrow"},"Position",-1)),r("div",Ow,[r("div",zw,[g[36]||(g[36]=r("span",{class:"text-ink-secondary"},"Latitude",-1)),r("b",Aw,k(lt(de.value.latitude,6)),1)]),r("div",Iw,[g[37]||(g[37]=r("span",{class:"text-ink-secondary"},"Longitude",-1)),r("b",$w,k(lt(de.value.longitude,6)),1)]),r("div",Dw,[g[38]||(g[38]=r("span",{class:"text-ink-secondary"},"Vert. speed",-1)),r("b",Nw,k(lt(typeof de.value.velocityZ=="number"?-de.value.velocityZ:void 0,2," m/s")),1)])])]),r("div",Rw,[g[40]||(g[40]=r("div",{class:"mb-3 eyebrow"},"Track",-1)),E(Ql,{position:nt.value,trail:ke.value},null,8,["position","trail"])]),r("div",Fw,[g[41]||(g[41]=r("div",{class:"mb-3 eyebrow"},"Send command",-1)),r("div",Bw,[re(r("input",{"onUpdate:modelValue":g[3]||(g[3]=F=>V.value=F),class:"field flex-1",placeholder:"command (e.g. startConnection)"},null,512),[[ve,V.value]]),re(r("input",{"onUpdate:modelValue":g[4]||(g[4]=F=>ue.value=F),class:"field flex-1",placeholder:"payload JSON (optional)"},null,512),[[ve,ue.value]]),r("button",{class:"btn-accent",onClick:ht},"Send")]),r("div",Vw,k(X.value),1)]),r("div",Uw,[g[42]||(g[42]=r("div",{class:"mb-3 eyebrow"},"Event log",-1)),r("div",Zw,[(m(!0),v(le,null,Fe(y,(F,Y)=>(m(),v("div",{key:Y,class:"border-b border-line py-1"},[r("span",Hw,k(F.t),1),r("span",jw,k(F.tag),1),r("span",Ww,k(F.text),1)]))),128))])])])],64)):(m(),v("div",aw,[E(J,{name:"radio",size:28,class:"text-ink-muted"}),g[21]||(g[21]=r("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No aircraft online",-1)),g[22]||(g[22]=r("div",{class:"mt-1 text-xs text-ink-muted"},"Live telemetry appears here once a drone connects.",-1))]))])):w.value==="Logbook"?(m(),et(Ob,{key:2,email:t.email,role:t.role,organization:t.organization,"organization-name":t.organizationName},null,8,["email","role","organization","organization-name"])):w.value==="Documents"?(m(),et(t0,{key:3,email:t.email,role:t.role,organization:t.organization,"organization-name":t.organizationName},null,8,["email","role","organization","organization-name"])):w.value==="Settings"?(m(),et(Iy,{key:4,email:t.email,role:t.role,organization:t.organization,"organization-name":t.organizationName,onLogout:g[5]||(g[5]=F=>l("logout"))},null,8,["email","role","organization","organization-name"])):(m(),v("div",Kw,[r("div",Gw,[E(J,{name:U.value,size:28,class:"text-ink-muted"},null,8,["name"]),r("div",qw,k(w.value),1),w.value==="Drives"?(m(),v("div",Yw,[g[43]||(g[43]=D(" Browse and transfer files here once a drive is connected. Configure drives in ",-1)),r("button",{class:"font-semibold text-accent hover:underline",onClick:g[6]||(g[6]=F=>w.value="Settings")},"Settings → Integrations"),g[44]||(g[44]=D(". ",-1))])):(m(),v("div",Jw,"This section is part of the console shell and has no backend yet."))])]))])])}}},Qw={key:0,class:"h-full"},ek={key:1,class:"grid h-full place-items-center text-ink-muted text-sm"},tk={__name:"App",setup(t){const i=K(!1),o=K(null),l=K("user"),u=K(""),d=K(""),h=K("");function _(w){l.value=w&&w.role||"user",u.value=w&&w.organization||"",d.value=w&&w.organizationName||""}Li(async()=>{h.value=(await Dh()).apiBase||"";const w=await jl();w&&(o.value=w.email,_(w),await Jl()),i.value=!0});async function y(w){o.value=w,_(await jl()),await Jl()}async function T(){wp(),await Rh(),o.value=null,l.value="user",u.value="",d.value=""}return(w,z)=>i.value?(m(),v("div",Qw,[o.value?(m(),et(Xw,{key:0,email:o.value,role:l.value,organization:u.value,"organization-name":d.value,onLogout:T},null,8,["email","role","organization","organization-name"])):(m(),et(Fp,{key:1,"default-api-base":h.value,onSignedIn:y},null,8,["default-api-base"]))])):(m(),v("div",ek,"Loading…"))}};zh(tk).mount("#app");
diff --git a/Web App/server/dist/assets/index-By3vEu-b.js b/Web App/server/dist/assets/index-By3vEu-b.js
new file mode 100644
index 0000000..4c620d1
--- /dev/null
+++ b/Web App/server/dist/assets/index-By3vEu-b.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 p of d.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&l(p)}).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 ht={},bs=[],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:"),zt=Object.assign,Cr=(t,i)=>{const o=t.indexOf(i);o>-1&&t.splice(o,1)},cd=Object.prototype.hasOwnProperty,at=(t,i)=>cd.call(t,i),Ae=Array.isArray,xs=t=>vo(t)==="[object Map]",Ms=t=>vo(t)==="[object Set]",hl=t=>vo(t)==="[object Date]",Ze=t=>typeof t=="function",_t=t=>typeof t=="string",Ln=t=>typeof t=="symbol",rt=t=>t!==null&&typeof t=="object",gu=t=>(rt(t)||Ze(t))&&Ze(t.then)&&Ze(t.catch),vu=Object.prototype.toString,vo=t=>vu.call(t),dd=t=>vo(t).slice(8,-1),_u=t=>vo(t)==="[object Object]",Lr=t=>_t(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,to=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,Mi=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=_t(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 Ps(t){if(Ae(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 Me(t){let i="";if(_t(t))i=t;else if(Ae(t))for(let o=0;oPi(o,i))}const wu=t=>!!(t&&t.__v_isRef===!0),S=t=>_t(t)?t:t==null?"":Ae(t)||rt(t)&&(t.toString===vu||!Ze(t.toString))?wu(t)?S(t.value):JSON.stringify(t,ku,2):String(t),ku=(t,i)=>wu(i)?ku(t,i.value):xs(i)?{[`Map(${i.size})`]:[...i.entries()].reduce((o,[l,u],d)=>(o[Ja(l,d)+" =>"]=u,o),{})}:Ms(i)?{[`Set(${i.size})`]:[...i.values()].map(o=>Ja(o))}:Ln(i)?Ja(i):rt(i)&&!Ae(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 It;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&&It&&(It.active?(this.parent=It,this.index=(It.scopes||(It.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let i,o;if(this.scopes)for(i=0,o=this.scopes.length;i0&&--this._on===0){if(It===this)It=this.prevScope;else{let i=It;for(;i;){if(i.prevScope===this){i.prevScope=this.prevScope;break}i=i.prevScope}}this.prevScope=void 0}}stop(i){if(this._active){this._active=!1;let o,l;for(o=0,l=this.effects.length;o0)return;if(io){let i=io;for(io=void 0;i;){const o=i.next;i.next=void 0,i.flags&=-9,i=o}}let t;for(;no;){let i=no;for(no=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===lo)||(t.globalVersion=lo,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!ur(t))))return;t.flags|=2;const i=t.dep,o=mt,l=Cn;mt=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{mt=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=mt;mt=void 0;try{i()}finally{mt=o}}}let lo=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(!mt||!Cn||mt===this.computed)return;let o=this.activeLink;if(o===void 0||o.sub!==mt)o=this.activeLink=new Td(mt,this),mt.deps?(o.prevDep=mt.depsTail,mt.depsTail.nextDep=o,mt.depsTail=o):mt.deps=mt.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=mt.depsTail,o.nextDep=void 0,mt.depsTail.nextDep=o,mt.depsTail=o,mt.deps===o&&(mt.deps=l)}return o}trigger(i){this.version++,lo++,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,Yi=Symbol(""),dr=Symbol(""),uo=Symbol("");function Rt(t,i,o){if(Cn&&mt){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 p=cr.get(t);if(!p){lo++;return}const _=b=>{b&&b.trigger()};if(Er(),i==="clear")p.forEach(_);else{const b=Ae(t),C=b&&Lr(o);if(b&&o==="length"){const k=Number(l);p.forEach((O,R)=>{(R==="length"||R===uo||!Ln(R)&&R>=k)&&_(O)})}else switch((o!==void 0||p.has(void 0))&&_(p.get(o)),C&&_(p.get(uo)),i){case"add":b?C&&_(p.get("length")):(_(p.get(Yi)),xs(t)&&_(p.get(dr)));break;case"delete":b||(_(p.get(Yi)),xs(t)&&_(p.get(dr)));break;case"set":xs(t)&&_(p.get(Yi));break}}Or()}function _s(t){const i=tt(t);return i===t?i:(Rt(i,"iterate",uo),mn(t)?i:i.map(Mn))}function ya(t){return Rt(t=tt(t),"iterate",uo),t}function Fn(t,i){return li(t)?Cs(Ji(t)?Mn(i):i):Mn(i)}const Pd={__proto__:null,[Symbol.iterator](){return Qa(this,Symbol.iterator,t=>Fn(this,t))},concat(...t){return _s(this).concat(...t.map(i=>Ae(i)?_s(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 _s(this).join(t)},lastIndexOf(...t){return er(this,"lastIndexOf",t)},map(t,i){return ti(this,"map",t,i,void 0,arguments)},pop(){return Ks(this,"pop")},push(...t){return Ks(this,"push",t)},reduce(t,...i){return gl(this,"reduce",t,i)},reduceRight(t,...i){return gl(this,"reduceRight",t,i)},shift(){return Ks(this,"shift")},some(t,i){return ti(this,"some",t,i,void 0,arguments)},splice(...t){return Ks(this,"splice",t)},toReversed(){return _s(this).toReversed()},toSorted(t){return _s(this).toSorted(t)},toSpliced(...t){return _s(this).toSpliced(...t)},unshift(...t){return Ks(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 p=ya(t),_=p!==t&&!mn(t),b=p[i];if(b!==Cd[i]){const O=b.apply(t,d);return _?Mn(O):O}let C=o;p!==t&&(_?C=function(O,R){return o.call(this,Fn(t,O),R,t)}:o.length>2&&(C=function(O,R){return o.call(this,O,R,t)}));const k=b.call(p,C,l);return _&&u?u(k):k}function gl(t,i,o,l){const u=ya(t),d=u!==t&&!mn(t);let p=o,_=!1;u!==t&&(d?(_=l.length===0,p=function(C,k,O){return _&&(_=!1,C=Fn(t,C)),o.call(this,C,Fn(t,k),O,t)}):o.length>3&&(p=function(C,k,O){return o.call(this,C,k,O,t)}));const b=u[i](p,...l);return _?Fn(t,b):b}function er(t,i,o){const l=tt(t);Rt(l,"iterate",uo);const u=l[i](...o);return(u===-1||u===!1)&&Dr(o[0])?(o[0]=tt(o[0]),l[i](...o)):u}function Ks(t,i,o=[]){Zn(),Er();const l=tt(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=tt(this);return Rt(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 p=Ae(i);if(!u){let b;if(p&&(b=Pd[o]))return b;if(o==="hasOwnProperty")return Md}const _=Reflect.get(i,o,Vt(i)?i:l);if((Ln(o)?zu.has(o):Ld(o))||(u||Rt(i,"get",o),d))return _;if(Vt(_)){const b=p&&Lr(o)?_:_.value;return u&&rt(b)?hr(b):b}return rt(_)?u?hr(_):xt(_):_}}class $u extends Au{constructor(i=!1){super(!1,i)}set(i,o,l,u){let d=i[o];const p=Ae(i)&&Lr(o);if(!this._isShallow){const C=li(d);if(!mn(l)&&!li(l)&&(d=tt(d),l=tt(l)),!p&&Vt(d)&&!Vt(l))return C||(d.value=l),!0}const _=p?Number(o)t,Ko=t=>Reflect.getPrototypeOf(t);function $d(t,i,o){return function(...l){const u=this.__v_raw,d=tt(u),p=xs(d),_=t==="entries"||t===Symbol.iterator&&p,b=t==="keys"&&p,C=u[t](...l),k=o?fr:i?Cs:Mn;return!i&&Rt(d,"iterate",b?dr:Yi),zt(Object.create(C),{next(){const{value:O,done:R}=C.next();return R?{value:O,done:R}:{value:_?[k(O[0]),k(O[1])]:k(O),done:R}}})}}function Go(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,p=tt(d),_=tt(u);t||(Vn(u,_)&&Rt(p,"get",u),Rt(p,"get",_));const{has:b}=Ko(p),C=i?fr:t?Cs:Mn;if(b.call(p,u))return C(d.get(u));if(b.call(p,_))return C(d.get(_));d!==p&&d.get(u)},get size(){const u=this.__v_raw;return!t&&Rt(tt(u),"iterate",Yi),u.size},has(u){const d=this.__v_raw,p=tt(d),_=tt(u);return t||(Vn(u,_)&&Rt(p,"has",u),Rt(p,"has",_)),u===_?d.has(u):d.has(u)||d.has(_)},forEach(u,d){const p=this,_=p.__v_raw,b=tt(_),C=i?fr:t?Cs:Mn;return!t&&Rt(b,"iterate",Yi),_.forEach((k,O)=>u.call(d,C(k),C(O),p))}};return zt(o,t?{add:Go("add"),set:Go("set"),delete:Go("delete"),clear:Go("clear")}:{add(u){const d=tt(this),p=Ko(d),_=tt(u),b=!i&&!mn(u)&&!li(u)?_:u;return p.has.call(d,b)||Vn(u,b)&&p.has.call(d,u)||Vn(_,b)&&p.has.call(d,_)||(d.add(b),oi(d,"add",b,b)),this},set(u,d){!i&&!mn(d)&&!li(d)&&(d=tt(d));const p=tt(this),{has:_,get:b}=Ko(p);let C=_.call(p,u);C||(u=tt(u),C=_.call(p,u));const k=b.call(p,u);return p.set(u,d),C?Vn(d,k)&&oi(p,"set",u,d):oi(p,"add",u,d),this},delete(u){const d=tt(this),{has:p,get:_}=Ko(d);let b=p.call(d,u);b||(u=tt(u),b=p.call(d,u)),_&&_.call(d,u);const C=d.delete(u);return b&&oi(d,"delete",u,void 0),C},clear(){const u=tt(this),d=u.size!==0,p=u.clear();return d&&oi(u,"clear",void 0,void 0),p}}),["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(at(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 xt(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(!rt(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 p=Bd(dd(t));if(p===0)return t;const _=new Proxy(t,p===2?l:o);return u.set(t,_),_}function Ji(t){return li(t)?Ji(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 tt(t){const i=t&&t.__v_raw;return i?tt(i):t}function Ud(t){return!at(t,"__v_skip")&&Object.isExtensible(t)&&bu(t,"__v_skip",!0),t}const Mn=t=>rt(t)?xt(t):t,Cs=t=>rt(t)?hr(t):t;function Vt(t){return t?t.__v_isRef===!0:!1}function H(t){return Zd(t,!1)}function Zd(t,i){return Vt(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:tt(i),this._value=o?i:Mn(i),this.__v_isShallow=o}get value(){return this.dep.track(),this._value}set value(i){const o=this._rawValue,l=this.__v_isShallow||mn(i)||li(i);i=l?i:tt(i),Vn(i,o)&&(this._rawValue=i,this._value=l?i:Mn(i),this.dep.trigger())}}function Re(t){return Vt(t)?t.value:t}const jd={get:(t,i,o)=>i==="__v_raw"?t:Re(Reflect.get(t,i,o)),set:(t,i,o,l)=>{const u=t[i];return Vt(u)&&!Vt(o)?(u.value=o,!0):Reflect.set(t,i,o,l)}};function Ru(t){return Ji(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=lo-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!o,this.isSSR=l}notify(){if(this.flags|=16,!(this.flags&8)&&mt!==this)return 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 Ze(t)?l=t:(l=t.get,u=t.set),new Wd(l,u,o)}const qo={},na=new WeakMap;let Ki;function Gd(t,i=!1,o=Ki){if(o){let l=na.get(o);l||na.set(o,l=[]),l.push(t)}}function qd(t,i,o=ht){const{immediate:l,deep:u,once:d,scheduler:p,augmentJob:_,call:b}=o,C=ie=>u?ie:mn(ie)||u===!1||u===0?ai(ie,1):ai(ie);let k,O,R,F,X=!1,q=!1;if(Vt(t)?(O=()=>t.value,X=mn(t)):Ji(t)?(O=()=>C(t),X=!0):Ae(t)?(q=!0,X=t.some(ie=>Ji(ie)||mn(ie)),O=()=>t.map(ie=>{if(Vt(ie))return ie.value;if(Ji(ie))return C(ie);if(Ze(ie))return b?b(ie,2):ie()})):Ze(t)?i?O=b?()=>b(t,2):t:O=()=>{if(R){Zn();try{R()}finally{Hn()}}const ie=Ki;Ki=k;try{return b?b(t,3,[F]):t(F)}finally{Ki=ie}}:O=Un,i&&u){const ie=O,me=u===!0?1/0:u;O=()=>ai(ie(),me)}const ge=kd(),we=()=>{k.stop(),ge&&ge.active&&Cr(ge.effects,k)};if(d&&i){const ie=i;i=(...me)=>{const Le=ie(...me);return we(),Le}}let K=q?new Array(t.length).fill(qo):qo;const fe=ie=>{if(!(!(k.flags&1)||!k.dirty&&!ie))if(i){const me=k.run();if(ie||u||X||(q?me.some((Le,Ee)=>Vn(Le,K[Ee])):Vn(me,K))){R&&R();const Le=Ki;Ki=k;try{const Ee=[me,K===qo?void 0:q&&K[0]===qo?[]:K,F];K=me,b?b(i,3,Ee):i(...Ee)}finally{Ki=Le}}}else k.run()};return _&&_(fe),k=new Su(O),k.scheduler=p?()=>p(fe,!1):fe,F=ie=>Gd(ie,!1,k),R=k.onStop=()=>{const ie=na.get(k);if(ie){if(b)b(ie,4);else for(const me of ie)me();na.delete(k)}},i?l?fe(!0):K=k.run():p?p(fe.bind(null,!0),!0):k.run(),we.pause=k.pause.bind(k),we.resume=k.resume.bind(k),we.stop=we,we}function ai(t,i=1/0,o){if(i<=0||!rt(t)||t.__v_skip||(o=o||new Map,(o.get(t)||0)>=i))return t;if(o.set(t,i),i--,Vt(t))ai(t.value,i,o);else if(Ae(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 _o(t,i,o,l){try{return l?t(...l):t()}catch(u){ba(u,i,o)}}function vn(t,i,o,l){if(Ze(t)){const u=_o(t,i,o,l);return u&&gu(u)&&u.catch(d=>{ba(d,i,o)}),u}if(Ae(t)){const u=[];for(let d=0;d>>1,u=qt[l],d=co(u);d=co(o)?qt.push(t):qt.splice(Jd(i),0,t),t.flags|=1,Vu()}}function Vu(){ia||(ia=Fu.then(Zu))}function Xd(t){Ae(t)?ws.push(...t):Ti&&t.id===-1?Ti.splice(ys+1,0,t):t.flags&1||(ws.push(t),t.flags|=1),Vu()}function vl(t,i,o=Rn+1){for(;oco(o)-co(l));if(ws.length=0,Ti){Ti.push(...i);return}for(Ti=i,ys=0;yst.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 p;try{p=t(...u)}finally{sa(d),l._d&&ra(1)}return p};return l._n=!0,l._c=!0,l._d=!0,l}function oe(t,i){if(Bt===null)return t;const o=Ta(Bt),l=t.dirs||(t.dirs=[]);for(let u=0;u1)return o&&Ze(i)?i.call(l&&l.proxy):i}}const Qd=Symbol.for("v-scx"),ef=()=>so(Qd);function en(t,i,o){return Wu(t,i,o)}function Wu(t,i,o=ht){const{immediate:l,deep:u,flush:d,once:p}=o,_=zt({},o),b=i&&l||!i&&d!=="post";let C;if(mo){if(d==="sync"){const F=ef();C=F.__watcherHandles||(F.__watcherHandles=[])}else if(!b){const F=()=>{};return F.stop=Un,F.resume=Un,F.pause=Un,F}}const k=Yt;_.call=(F,X,q)=>vn(F,k,X,q);let O=!1;d==="post"?_.scheduler=F=>{Gt(F,k&&k.suspense)}:d!=="sync"&&(O=!0,_.scheduler=(F,X)=>{X?F():Nr(F)}),_.augmentJob=F=>{i&&(F.flags|=4),O&&(F.flags|=2,k&&(F.id=k.uid,F.i=k))};const R=qd(t,i,_);return mo&&(C?C.push(R):b&&R()),R}function tf(t,i,o){const l=this.proxy,u=_t(t)?t.includes(".")?Ku(l,t):()=>l[t]:t.bind(l,l);let d;Ze(i)?d=i:(d=i.handler,o=i);const p=bo(this),_=Wu(u,d.bind(l),o);return p(),_}function Ku(t,i){const o=i.split(".");return()=>{let l=t;for(let u=0;ut.__isTeleport,Gi=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 _t(o)?i?i(o):null:o},sf={name:"Teleport",__isTeleport:!0,process(t,i,o,l,u,d,p,_,b,C){const{mc:k,pc:O,pbc:R,o:{insert:F,querySelector:X,createText:q,createComment:ge,parentNode:we}}=C,K=Gi(i.props);let{dynamicChildren:fe}=i;const ie=(Ee,Ve,pe)=>{Ee.shapeFlag&16&&k(Ee.children,Ve,pe,u,d,p,_,b)},me=(Ee=i)=>{const Ve=Gi(Ee.props),pe=Ee.target=pr(Ee.props,X),$e=mr(pe,Ee,q,F);pe&&(p!=="svg"&&_l(pe)?p="svg":p!=="mathml"&&yl(pe)&&(p="mathml"),u&&u.isCE&&(u.ce._teleportTargets||(u.ce._teleportTargets=new Set)).add(pe),Ve||(ie(Ee,pe,$e),Js(Ee,!1)))},Le=Ee=>{const Ve=()=>{if(Si.get(Ee)===Ve){if(Si.delete(Ee),Gi(Ee.props)){const pe=we(Ee.el)||o;ie(Ee,pe,Ee.anchor),Js(Ee,!0)}me(Ee)}};Si.set(Ee,Ve),Gt(Ve,d)};if(t==null){const Ee=i.el=q(""),Ve=i.anchor=q("");if(F(Ee,o,l),F(Ve,o,l),nf(i.props)||d&&d.pendingBranch){Le(i);return}K&&(ie(i,o,Ve),Js(i,!0)),me()}else{i.el=t.el;const Ee=i.anchor=t.anchor,Ve=Si.get(t);if(Ve){Ve.flags|=8,Si.delete(t),Le(i);return}i.targetStart=t.targetStart;const pe=i.target=t.target,$e=i.targetAnchor=t.targetAnchor,Oe=Gi(t.props),Q=Oe?o:pe,ue=Oe?Ee:$e;if(p==="svg"||_l(pe)?p="svg":(p==="mathml"||yl(pe))&&(p="mathml"),fe?(R(t.dynamicChildren,fe,Q,u,d,p,_),Br(t,i,!0)):b||O(t,i,Q,ue,u,d,p,_,!1),K)Oe?i.props&&t.props&&i.props.to!==t.props.to&&(i.props.to=t.props.to):Yo(i,o,Ee,C,1);else if((i.props&&i.props.to)!==(t.props&&t.props.to)){const ye=pr(i.props,X);ye&&(i.target=ye,Yo(i,ye,null,C,0))}else Oe&&Yo(i,pe,$e,C,1);Js(i,K)}},remove(t,i,o,{um:l,o:{remove:u}},d){const{shapeFlag:p,children:_,anchor:b,targetStart:C,targetAnchor:k,target:O,props:R}=t,F=Gi(R),X=d||!F,q=Si.get(t);if(q&&(q.flags|=8,Si.delete(t)),O&&(u(C),u(k)),d&&u(b),!q&&(F||O)&&p&16)for(let ge=0;ge<_.length;ge++){const we=_[ge];l(we,i,o,X,!!we.dynamicChildren)}},move:Yo,hydrate:of};function Yo(t,i,o,{o:{insert:l},m:u},d=2){d===0&&l(t.targetAnchor,i,o);const{el:p,anchor:_,shapeFlag:b,children:C,props:k}=t,O=d===2;if(O&&l(p,i,o),!Si.has(t)&&(!O||Gi(k))&&b&16)for(let R=0;R{t.isMounted=!0}),yo(()=>{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?D():void 0;if(!d)return;const p=tt(t),{mode:_}=p;if(l.isLeaving)return tr(d);const b=bl(d);if(!b)return tr(d);let C=gr(b,p,l,o,O=>C=O);b.type!==Ft&&fo(b,C);let k=o.subTree&&bl(o.subTree);if(k&&k.type!==Ft&&!qi(k,b)&&Ju(o).type!==Ft){let O=gr(k,p,l,o);if(fo(k,O),_==="out-in"&&b.type!==Ft)return l.isLeaving=!0,O.afterLeave=()=>{l.isLeaving=!1,o.job.flags&8||o.update(),delete O.afterLeave,k=void 0},tr(d);_==="in-out"&&b.type!==Ft?O.delayLeave=(R,F,X)=>{const q=Qu(l,k);q[String(k.key)]=k,R[pn]=()=>{F(),R[pn]=void 0,delete C.delayedLeave,k=void 0},C.delayedLeave=()=>{X(),delete C.delayedLeave,k=void 0}}:k=void 0}else k&&(k=void 0);return d}}};function Xu(t){let i=t[0];if(t.length>1){for(const o of t)if(o.type!==Ft){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:p,persisted:_=!1,onBeforeEnter:b,onEnter:C,onAfterEnter:k,onEnterCancelled:O,onBeforeLeave:R,onLeave:F,onAfterLeave:X,onLeaveCancelled:q,onBeforeAppear:ge,onAppear:we,onAfterAppear:K,onAppearCancelled:fe}=i,ie=String(t.key),me=Qu(o,t),Le=(pe,$e)=>{pe&&vn(pe,l,9,$e)},Ee=(pe,$e)=>{const Oe=$e[1];Le(pe,$e),Ae(pe)?pe.every(Q=>Q.length<=1)&&Oe():pe.length<=1&&Oe()},Ve={mode:p,persisted:_,beforeEnter(pe){let $e=b;if(!o.isMounted)if(d)$e=ge||b;else return;pe[pn]&&pe[pn](!0);const Oe=me[ie];Oe&&qi(t,Oe)&&Oe.el[pn]&&Oe.el[pn](),Le($e,[pe])},enter(pe){if(me[ie]===t)return;let $e=C,Oe=k,Q=O;if(!o.isMounted)if(d)$e=we||C,Oe=K||k,Q=fe||O;else return;let ue=!1;pe[Gs]=ze=>{ue||(ue=!0,ze?Le(Q,[pe]):Le(Oe,[pe]),Ve.delayedLeave&&Ve.delayedLeave(),pe[Gs]=void 0)};const ye=pe[Gs].bind(null,!1);$e?Ee($e,[pe,ye]):ye()},leave(pe,$e){const Oe=String(t.key);if(pe[Gs]&&pe[Gs](!0),o.isUnmounting)return $e();Le(R,[pe]);let Q=!1;pe[pn]=ye=>{Q||(Q=!0,$e(),ye?Le(q,[pe]):Le(X,[pe]),pe[pn]=void 0,me[Oe]===t&&delete me[Oe])};const ue=pe[pn].bind(null,!1);me[Oe]=t,F?Ee(F,[pe,ue]):ue()},clone(pe){const $e=gr(pe,i,o,l,u);return u&&u($e),$e}};return Ve}function tr(t){if(xa(t))return t=Ci(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&&Ze(o.default))return o.default()}}function fo(t,i){t.shapeFlag&6&&t.component?(t.transition=i,fo(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;doo(q,i&&(Ae(i)?i[ge]:i),o,l,u));return}if(ks(l)&&!u){l.shapeFlag&512&&l.type.__asyncResolved&&l.component.subTree.component&&oo(t,i,o,l.component.subTree);return}const d=l.shapeFlag&4?Ta(l.component):l.el,p=u?null:d,{i:_,r:b}=t,C=i&&i.r,k=_.refs===ht?_.refs={}:_.refs,O=_.setupState,R=tt(O),F=O===ht?mu:q=>xl(k,q)?!1:at(R,q),X=(q,ge)=>!(ge&&xl(k,ge));if(C!=null&&C!==b){if(wl(i),_t(C))k[C]=null,F(C)&&(O[C]=null);else if(Vt(C)){const q=i;X(C,q.k)&&(C.value=null),q.k&&(k[q.k]=null)}}if(Ze(b)){Zn();try{_o(b,_,12,[p,k])}finally{Hn()}}else{const q=_t(b),ge=Vt(b);if(q||ge){const we=()=>{if(t.f){const K=q?F(b)?O[b]:k[b]:X()||!t.k?b.value:k[t.k];if(u)Ae(K)&&Cr(K,d);else if(Ae(K))K.includes(d)||K.push(d);else if(q)k[b]=[d],F(b)&&(O[b]=k[b]);else{const fe=[d];X(b,t.k)&&(b.value=fe),t.k&&(k[t.k]=fe)}}else q?(k[b]=p,F(b)&&(O[b]=p)):ge&&(X(b,t.k)&&(b.value=p),t.k&&(k[t.k]=p))};if(p){const K=()=>{we(),oa.delete(t)};K.id=-1,oa.set(t,K),Gt(K,o)}else wl(t),we()}}}function wl(t){const i=oa.get(t);i&&(i.flags|=8,oa.delete(t))}_a().requestIdleCallback;_a().cancelIdleCallback;const ks=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=Yt){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=Yt,l=!1){if(o){const u=o[t]||(o[t]=[]),d=i.__weh||(i.__weh=(...p)=>{Zn();const _=bo(o),b=vn(i,o,t,p);return _(),Hn(),b});return l?u.unshift(d):u.push(d),d}}const ci=t=>(i,o=Yt)=>{(!mo||t==="sp")&&wa(t,(...l)=>i(...l),o)},hf=ci("bm"),ui=ci("m"),pf=ci("bu"),mf=ci("u"),yo=ci("bum"),ic=ci("um"),gf=ci("sp"),vf=ci("rtg"),_f=ci("rtc");function yf(t,i=Yt){wa("ec",t,i)}const bf=Symbol.for("v-ndc");function Fe(t,i,o,l){let u;const d=o,p=Ae(t);if(p||_t(t)){const _=p&&Ji(t);let b=!1,C=!1;_&&(b=!mn(t),C=li(t),t=ya(t)),u=new Array(t.length);for(let k=0,O=t.length;ki(_,b,void 0,d));else{const _=Object.keys(t);u=new Array(_.length);for(let b=0,C=_.length;b0;return v(),et(ae,null,[E("slot",o,l)],C?-2:64)}let d=t[i];d&&d._c&&(d._d=!1),v();const p=d&&sc(d(o)),_=o.key||p&&p.key,b=et(ae,{key:(_&&!Ln(_)?_:`_${i}`)+(!p&&l?"_fb":"")},p||[],p&&t._===1?64:-2);return b.scopeId&&(b.slotScopeIds=[b.scopeId+"-s"]),d&&d._c&&(d._d=!0),b}function sc(t){return t.some(i=>po(i)?!(i.type===Ft||i.type===ae&&!sc(i.children)):!0)?t:null}const vr=t=>t?Sc(t)?Ta(t):vr(t.parent):null,ao=zt(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!==ht&&!t.__isScriptSetup&&at(t,i),wf={get({_:t},i){if(i==="__v_skip")return!0;const{ctx:o,setupState:l,data:u,props:d,accessCache:p,type:_,appContext:b}=t;if(i[0]!=="$"){const R=p[i];if(R!==void 0)switch(R){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 p[i]=1,l[i];if(u!==ht&&at(u,i))return p[i]=2,u[i];if(at(d,i))return p[i]=3,d[i];if(o!==ht&&at(o,i))return p[i]=4,o[i];_r&&(p[i]=0)}}const C=ao[i];let k,O;if(C)return i==="$attrs"&&Rt(t.attrs,"get",""),C(t);if((k=_.__cssModules)&&(k=k[i]))return k;if(o!==ht&&at(o,i))return p[i]=4,o[i];if(O=b.config.globalProperties,at(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!==ht&&at(l,i)?(l[i]=o,!0):at(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:p}},_){let b;return!!(o[_]||t!==ht&&_[0]!=="$"&&at(t,_)||nr(i,_)||at(d,_)||at(l,_)||at(ao,_)||at(u.config.globalProperties,_)||(b=p.__cssModules)&&b[_])},defineProperty(t,i,o){return o.get!=null?t._.accessCache[i]=0:at(o,"value")&&this.set(t,i,o.value,null),Reflect.defineProperty(t,i,o)}};function kl(t){return Ae(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:p,watch:_,provide:b,inject:C,created:k,beforeMount:O,mounted:R,beforeUpdate:F,updated:X,activated:q,deactivated:ge,beforeDestroy:we,beforeUnmount:K,destroyed:fe,unmounted:ie,render:me,renderTracked:Le,renderTriggered:Ee,errorCaptured:Ve,serverPrefetch:pe,expose:$e,inheritAttrs:Oe,components:Q,directives:ue,filters:ye}=i;if(C&&Sf(C,l,null),p)for(const re in p){const ee=p[re];Ze(ee)&&(l[re]=ee.bind(o))}if(u){const re=u.call(o,o);rt(re)&&(t.data=xt(re))}if(_r=!0,d)for(const re in d){const ee=d[re],nt=Ze(ee)?ee.bind(o,o):Ze(ee.get)?ee.get.bind(o,o):Un,he=!Ze(ee)&&Ze(ee.set)?ee.set.bind(o):Un,Te=xe({get:nt,set:he});Object.defineProperty(l,re,{enumerable:!0,configurable:!0,get:()=>Te.value,set:qe=>Te.value=qe})}if(_)for(const re in _)oc(_[re],l,o,re);if(b){const re=Ze(b)?b.call(o):b;Reflect.ownKeys(re).forEach(ee=>{ju(ee,re[ee])})}k&&Sl(k,t,"c");function ce(re,ee){Ae(ee)?ee.forEach(nt=>re(nt.bind(o))):ee&&re(ee.bind(o))}if(ce(hf,O),ce(ui,R),ce(pf,F),ce(mf,X),ce(cf,q),ce(df,ge),ce(yf,Ve),ce(_f,Le),ce(vf,Ee),ce(yo,K),ce(ic,ie),ce(gf,pe),Ae($e))if($e.length){const re=t.exposed||(t.exposed={});$e.forEach(ee=>{Object.defineProperty(re,ee,{get:()=>o[ee],set:nt=>o[ee]=nt,enumerable:!0})})}else t.exposed||(t.exposed={});me&&t.render===Un&&(t.render=me),Oe!=null&&(t.inheritAttrs=Oe),Q&&(t.components=Q),ue&&(t.directives=ue),pe&&tc(t)}function Sf(t,i,o=Un){Ae(t)&&(t=yr(t));for(const l in t){const u=t[l];let d;rt(u)?"default"in u?d=so(u.from||l,u.default,!0):d=so(u.from||l):d=so(u),Vt(d)?Object.defineProperty(i,l,{enumerable:!0,configurable:!0,get:()=>d.value,set:p=>d.value=p}):i[l]=d}}function Sl(t,i,o){vn(Ae(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(_t(t)){const d=i[t];Ze(d)&&en(u,d)}else if(Ze(t))en(u,t.bind(o));else if(rt(t))if(Ae(t))t.forEach(d=>oc(d,i,o,l));else{const d=Ze(t.handler)?t.handler.bind(o):i[t.handler];Ze(d)&&en(u,d,t)}}function ac(t){const i=t.type,{mixins:o,extends:l}=i,{mixins:u,optionsCache:d,config:{optionMergeStrategies:p}}=t.appContext,_=d.get(i);let b;return _?b=_:!u.length&&!o&&!l?b=i:(b={},u.length&&u.forEach(C=>aa(b,C,p,!0)),aa(b,i,p)),rt(i)&&d.set(i,b),b}function aa(t,i,o,l=!1){const{mixins:u,extends:d}=i;d&&aa(t,d,o,!0),u&&u.forEach(p=>aa(t,p,o,!0));for(const p in i)if(!(l&&p==="expose")){const _=Tf[p]||o&&o[p];t[p]=_?_(t[p],i[p]):i[p]}return t}const Tf={data:Tl,props:Pl,emits:Pl,methods:Xs,computed:Xs,beforeCreate:Kt,created:Kt,beforeMount:Kt,mounted:Kt,beforeUpdate:Kt,updated:Kt,beforeDestroy:Kt,beforeUnmount:Kt,destroyed:Kt,unmounted:Kt,activated:Kt,deactivated:Kt,errorCaptured:Kt,serverPrefetch:Kt,components:Xs,directives:Xs,watch:Cf,provide:Tl,inject:Pf};function Tl(t,i){return i?t?function(){return zt(Ze(t)?t.call(this,this):t,Ze(i)?i.call(this,this):i)}:i:t}function Pf(t,i){return Xs(yr(t),yr(i))}function yr(t){if(Ae(t)){const i={};for(let o=0;oi==="modelValue"||i==="model-value"?t.modelModifiers:t[`${i}Modifiers`]||t[`${Pn(i)}Modifiers`]||t[`${Mi(i)}Modifiers`];function Of(t,i,...o){if(t.isUnmounted)return;const l=t.vnode.props||ht;let u=o;const d=i.startsWith("update:"),p=d&&Ef(l,i.slice(7));p&&(p.trim&&(u=o.map(k=>_t(k)?k.trim():k)),p.number&&(u=o.map(va)));let _,b=l[_=Ya(i)]||l[_=Ya(Pn(i))];!b&&d&&(b=l[_=Ya(Mi(i))]),b&&vn(b,t,6,u);const C=l[_+"Once"];if(C){if(!t.emitted)t.emitted={};else if(t.emitted[_])return;t.emitted[_]=!0,vn(C,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 p={},_=!1;if(!Ze(t)){const b=C=>{const k=lc(C,i,!0);k&&(_=!0,zt(p,k))};!o&&i.mixins.length&&i.mixins.forEach(b),t.extends&&b(t.extends),t.mixins&&t.mixins.forEach(b)}return!d&&!_?(rt(t)&&l.set(t,null),null):(Ae(d)?d.forEach(b=>p[b]=null):zt(p,d),rt(t)&&l.set(t,p),p)}function ka(t,i){return!t||!pa(i)?!1:(i=i.slice(2),i=i==="Once"?i:i.replace(/Once$/,""),at(t,i[0].toLowerCase()+i.slice(1))||at(t,Mi(i))||at(t,i))}function Cl(t){const{type:i,vnode:o,proxy:l,withProxy:u,propsOptions:[d],slots:p,attrs:_,emit:b,render:C,renderCache:k,props:O,data:R,setupState:F,ctx:X,inheritAttrs:q}=t,ge=sa(t);let we,K;try{if(o.shapeFlag&4){const ie=u||l,me=ie;we=Bn(C.call(me,ie,k,O,F,R,X)),K=_}else{const ie=i;we=Bn(ie.length>1?ie(O,{attrs:_,slots:p,emit:b}):ie(O,null)),K=i.props?_:Af(_)}}catch(ie){ro.length=0,ba(ie,t,1),we=E(Ft)}let fe=we;if(K&&q!==!1){const ie=Object.keys(K),{shapeFlag:me}=fe;ie.length&&me&7&&(d&&ie.some(ma)&&(K=$f(K,d)),fe=Ci(fe,K,!1,!0))}return o.dirs&&(fe=Ci(fe,null,!1,!0),fe.dirs=fe.dirs?fe.dirs.concat(o.dirs):o.dirs),o.transition&&fo(fe,o.transition),we=fe,sa(ge),we}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:p,children:_,patchFlag:b}=i,C=d.emitsOptions;if(i.dirs||i.transition)return!0;if(o&&b>=0){if(b&1024)return!0;if(b&16)return l?Ll(l,p,C):!!p;if(b&8){const k=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 p in t.propsOptions[0])p in u||(u[p]=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:p}}=t,_=tt(u),[b]=t.propsOptions;let C=!1;if((l||p>0)&&!(p&16)){if(p&8){const k=t.vnode.dynamicProps;for(let O=0;O{b=!0;const[R,F]=pc(O,i,!0);zt(p,R),F&&_.push(...F)};!o&&i.mixins.length&&i.mixins.forEach(k),t.extends&&k(t.extends),t.mixins&&t.mixins.forEach(k)}if(!d&&!b)return rt(t)&&l.set(t,bs),bs;if(Ae(d))for(let k=0;kt==="_"||t==="_ctx"||t==="$stable",Fr=t=>Ae(t)?t.map(Bn):[Bn(t)],Bf=(t,i,o)=>{if(i._n)return i;const l=be((...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(Ze(d))i[u]=Bf(u,d,l);else if(d!=null){const p=Fr(d);i[u]=()=>p}}},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,p=ht;if(l.shapeFlag&32){const _=i._;_?o&&_===1?d=!1:vc(u,i,o):(d=!i.$stable,mc(i,u)),p=i}else i&&(gc(t,i),p={default:1});if(d)for(const _ in u)!Rr(_)&&p[_]==null&&delete u[_]},Gt=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:p,createText:_,createComment:b,setText:C,setElementText:k,parentNode:O,nextSibling:R,setScopeId:F=Un,insertStaticContent:X}=t,q=(m,f,x,U=null,B=null,V=null,te=void 0,N=null,J=!!f.dynamicChildren)=>{if(m===f)return;m&&!qi(m,f)&&(U=M(m),qe(m,B,V,!0),m=null),f.patchFlag===-2&&(J=!1,f.dynamicChildren=null);const{type:Z,ref:Pe,shapeFlag:le}=f;switch(Z){case Sa:ge(m,f,x,U);break;case Ft:we(m,f,x,U);break;case sr:m==null&&K(f,x,U,te);break;case ae:Q(m,f,x,U,B,V,te,N,J);break;default:le&1?me(m,f,x,U,B,V,te,N,J):le&6?ue(m,f,x,U,B,V,te,N,J):(le&64||le&128)&&Z.process(m,f,x,U,B,V,te,N,J,it)}Pe!=null&&B?oo(Pe,m&&m.ref,V,f||m,!f):Pe==null&&m&&m.ref!=null&&oo(m.ref,null,V,m,!0)},ge=(m,f,x,U)=>{if(m==null)l(f.el=_(f.children),x,U);else{const B=f.el=m.el;f.children!==m.children&&C(B,f.children)}},we=(m,f,x,U)=>{m==null?l(f.el=b(f.children||""),x,U):f.el=m.el},K=(m,f,x,U)=>{[m.el,m.anchor]=X(m.children,f,x,U,m.el,m.anchor)},fe=({el:m,anchor:f},x,U)=>{let B;for(;m&&m!==f;)B=R(m),l(m,x,U),m=B;l(f,x,U)},ie=({el:m,anchor:f})=>{let x;for(;m&&m!==f;)x=R(m),u(m),m=x;u(f)},me=(m,f,x,U,B,V,te,N,J)=>{if(f.type==="svg"?te="svg":f.type==="math"&&(te="mathml"),m==null)Le(f,x,U,B,V,te,N,J);else{const Z=m.el&&m.el._isVueCE?m.el:null;try{Z&&Z._beginPatch(),pe(m,f,B,V,te,N,J)}finally{Z&&Z._endPatch()}}},Le=(m,f,x,U,B,V,te,N)=>{let J,Z;const{props:Pe,shapeFlag:le,transition:se,dirs:Ce}=m;if(J=m.el=p(m.type,V,Pe&&Pe.is,Pe),le&8?k(J,m.children):le&16&&Ve(m.children,J,null,U,B,ir(m,V),te,N),Ce&&Zi(m,null,U,"created"),Ee(J,m,m.scopeId,te,U),Pe){for(const ke in Pe)ke!=="value"&&!to(ke)&&d(J,ke,null,Pe[ke],V,U);"value"in Pe&&d(J,"value",null,Pe.value,V),(Z=Pe.onVnodeBeforeMount)&&Nn(Z,U,m)}Ce&&Zi(m,null,U,"beforeMount");const He=jf(B,se);He&&se.beforeEnter(J),l(J,f,x),((Z=Pe&&Pe.onVnodeMounted)||He||Ce)&&Gt(()=>{try{Z&&Nn(Z,U,m),He&&se.enter(J),Ce&&Zi(m,null,U,"mounted")}finally{}},B)},Ee=(m,f,x,U,B)=>{if(x&&F(m,x),U)for(let V=0;V{for(let Z=J;Z{const N=f.el=m.el;let{patchFlag:J,dynamicChildren:Z,dirs:Pe}=f;J|=m.patchFlag&16;const le=m.props||ht,se=f.props||ht;let Ce;if(x&&Hi(x,!1),(Ce=se.onVnodeBeforeUpdate)&&Nn(Ce,x,f,m),Pe&&Zi(f,m,x,"beforeUpdate"),x&&Hi(x,!0),Z&&(!m.dynamicChildren||m.dynamicChildren.length!==Z.length)&&(J=0,te=!1,Z=null),(le.innerHTML&&se.innerHTML==null||le.textContent&&se.textContent==null)&&k(N,""),Z?$e(m.dynamicChildren,Z,N,x,U,ir(f,B),V):te||ee(m,f,N,null,x,U,ir(f,B),V,!1),J>0){if(J&16)Oe(N,le,se,x,B);else if(J&2&&le.class!==se.class&&d(N,"class",null,se.class,B),J&4&&d(N,"style",le.style,se.style,B),J&8){const He=f.dynamicProps;for(let ke=0;ke{Ce&&Nn(Ce,x,f,m),Pe&&Zi(f,m,x,"updated")},U)},$e=(m,f,x,U,B,V,te)=>{for(let N=0;N{if(f!==x){if(f!==ht)for(const V in f)!to(V)&&!(V in x)&&d(m,V,f[V],null,B,U);for(const V in x){if(to(V))continue;const te=x[V],N=f[V];te!==N&&V!=="value"&&d(m,V,N,te,B,U)}"value"in x&&d(m,"value",f.value,x.value,B)}},Q=(m,f,x,U,B,V,te,N,J)=>{const Z=f.el=m?m.el:_(""),Pe=f.anchor=m?m.anchor:_("");let{patchFlag:le,dynamicChildren:se,slotScopeIds:Ce}=f;Ce&&(N=N?N.concat(Ce):Ce),m==null?(l(Z,x,U),l(Pe,x,U),Ve(f.children||[],x,Pe,B,V,te,N,J)):le>0&&le&64&&se&&m.dynamicChildren&&m.dynamicChildren.length===se.length?($e(m.dynamicChildren,se,x,B,V,te,N),(f.key!=null||B&&f===B.subTree)&&Br(m,f,!0)):ee(m,f,x,Pe,B,V,te,N,J)},ue=(m,f,x,U,B,V,te,N,J)=>{f.slotScopeIds=N,m==null?f.shapeFlag&512?B.ctx.activate(f,x,U,te,J):ye(f,x,U,B,V,te,J):ze(m,f,J)},ye=(m,f,x,U,B,V,te)=>{const N=m.component=eh(m,U,B);if(xa(m)&&(N.ctx.renderer=it),th(N,!1,te),N.asyncDep){if(B&&B.registerDep(N,ce,te),!m.el){const J=N.subTree=E(Ft);we(null,J,f,x),m.placeholder=J.el}}else ce(N,m,f,x,B,V,te)},ze=(m,f,x)=>{const U=f.component=m.component;if(If(m,f,x))if(U.asyncDep&&!U.asyncResolved){re(U,f,x);return}else U.next=f,U.update();else f.el=m.el,U.vnode=f},ce=(m,f,x,U,B,V,te)=>{const N=()=>{if(m.isMounted){let{next:le,bu:se,u:Ce,parent:He,vnode:ke}=m;{const Ct=_c(m);if(Ct){le&&(le.el=ke.el,re(m,le,te)),Ct.asyncDep.then(()=>{Gt(()=>{m.isUnmounted||Z()},B)});return}}let Ge=le,ft;Hi(m,!1),le?(le.el=ke.el,re(m,le,te)):le=ke,se&&ea(se),(ft=le.props&&le.props.onVnodeBeforeUpdate)&&Nn(ft,He,le,ke),Hi(m,!0);const gt=Cl(m),yt=m.subTree;m.subTree=gt,q(yt,gt,O(yt.el),M(yt),m,B,V),le.el=gt.el,Ge===null&&Df(m,gt.el),Ce&&Gt(Ce,B),(ft=le.props&&le.props.onVnodeUpdated)&&Gt(()=>Nn(ft,He,le,ke),B)}else{let le;const{el:se,props:Ce}=f,{bm:He,m:ke,parent:Ge,root:ft,type:gt}=m,yt=ks(f);Hi(m,!1),He&&ea(He),!yt&&(le=Ce&&Ce.onVnodeBeforeMount)&&Nn(le,Ge,f),Hi(m,!0);{ft.ce&&ft.ce._hasShadowRoot()&&ft.ce._injectChildStyle(gt,m.parent?m.parent.type:void 0);const Ct=m.subTree=Cl(m);q(null,Ct,x,U,m,B,V),f.el=Ct.el}if(ke&&Gt(ke,B),!yt&&(le=Ce&&Ce.onVnodeMounted)){const Ct=f;Gt(()=>Nn(le,Ge,Ct),B)}(f.shapeFlag&256||Ge&&ks(Ge.vnode)&&Ge.vnode.shapeFlag&256)&&m.a&&Gt(m.a,B),m.isMounted=!0,f=x=U=null}};m.scope.on();const J=m.effect=new Su(N);m.scope.off();const Z=m.update=J.run.bind(J),Pe=m.job=J.runIfDirty.bind(J);Pe.i=m,Pe.id=m.uid,J.scheduler=()=>Nr(Pe),Hi(m,!0),Z()},re=(m,f,x)=>{f.component=m;const U=m.vnode.props;m.vnode=f,m.next=null,Rf(m,f.props,U,x),Uf(m,f.children,x),Zn(),vl(m),Hn()},ee=(m,f,x,U,B,V,te,N,J=!1)=>{const Z=m&&m.children,Pe=m?m.shapeFlag:0,le=f.children,{patchFlag:se,shapeFlag:Ce}=f;if(se>0){if(se&128){he(Z,le,x,U,B,V,te,N,J);return}else if(se&256){nt(Z,le,x,U,B,V,te,N,J);return}}Ce&8?(Pe&16&&j(Z,B,V),le!==Z&&k(x,le)):Pe&16?Ce&16?he(Z,le,x,U,B,V,te,N,J):j(Z,B,V,!0):(Pe&8&&k(x,""),Ce&16&&Ve(le,x,U,B,V,te,N,J))},nt=(m,f,x,U,B,V,te,N,J)=>{m=m||bs,f=f||bs;const Z=m.length,Pe=f.length,le=Math.min(Z,Pe);let se;for(se=0;sePe?j(m,B,V,!0,!1,le):Ve(f,x,U,B,V,te,N,J,le)},he=(m,f,x,U,B,V,te,N,J)=>{let Z=0;const Pe=f.length;let le=m.length-1,se=Pe-1;for(;Z<=le&&Z<=se;){const Ce=m[Z],He=f[Z]=J?si(f[Z]):Bn(f[Z]);if(qi(Ce,He))q(Ce,He,x,null,B,V,te,N,J);else break;Z++}for(;Z<=le&&Z<=se;){const Ce=m[le],He=f[se]=J?si(f[se]):Bn(f[se]);if(qi(Ce,He))q(Ce,He,x,null,B,V,te,N,J);else break;le--,se--}if(Z>le){if(Z<=se){const Ce=se+1,He=Cese)for(;Z<=le;)qe(m[Z],B,V,!0),Z++;else{const Ce=Z,He=Z,ke=new Map;for(Z=He;Z<=se;Z++){const St=f[Z]=J?si(f[Z]):Bn(f[Z]);St.key!=null&&ke.set(St.key,Z)}let Ge,ft=0;const gt=se-He+1;let yt=!1,Ct=0;const _n=new Array(gt);for(Z=0;Z=gt){qe(St,B,V,!0);continue}let Dt;if(St.key!=null)Dt=ke.get(St.key);else for(Ge=He;Ge<=se;Ge++)if(_n[Ge-He]===0&&qi(St,f[Ge])){Dt=Ge;break}Dt===void 0?qe(St,B,V,!0):(_n[Dt-He]=Z+1,Dt>=Ct?Ct=Dt:yt=!0,q(St,f[Dt],x,null,B,V,te,N,J),ft++)}const di=yt?Wf(_n):bs;for(Ge=di.length-1,Z=gt-1;Z>=0;Z--){const St=He+Z,Dt=f[St],En=f[St+1],Ut=St+1{const{el:V,type:te,transition:N,children:J,shapeFlag:Z}=m;if(Z&6){Te(m.component.subTree,f,x,U);return}if(Z&128){m.suspense.move(f,x,U);return}if(Z&64){te.move(m,f,x,it);return}if(te===ae){l(V,f,x);for(let le=0;leN.enter(V),B));else{const{leave:le,delayLeave:se,afterLeave:Ce}=N,He=()=>{m.ctx.isUnmounted?u(V):l(V,f,x)},ke=()=>{const Ge=V._isLeaving||!!V[pn];V._isLeaving&&V[pn](!0),N.persisted&&!Ge?He():le(V,()=>{He(),Ce&&Ce()})};se?se(V,He,ke):ke()}else l(V,f,x)},qe=(m,f,x,U=!1,B=!1)=>{const{type:V,props:te,ref:N,children:J,dynamicChildren:Z,shapeFlag:Pe,patchFlag:le,dirs:se,cacheIndex:Ce,memo:He}=m;if(le===-2&&(B=!1),N!=null&&(Zn(),oo(N,null,x,m,!0),Hn()),Ce!=null&&(f.renderCache[Ce]=void 0),Pe&256){f.ctx.deactivate(m);return}const ke=Pe&1&&se,Ge=!ks(m);let ft;if(Ge&&(ft=te&&te.onVnodeBeforeUnmount)&&Nn(ft,f,m),Pe&6)Ue(m.component,x,U);else{if(Pe&128){m.suspense.unmount(x,U);return}ke&&Zi(m,null,f,"beforeUnmount"),Pe&64?m.type.remove(m,f,x,it,U):Z&&!Z.hasOnce&&(V!==ae||le>0&&le&64)?j(Z,f,x,!1,!0):(V===ae&&le&384||!B&&Pe&16)&&j(J,f,x),U&<(m)}const gt=He!=null&&Ce==null;(Ge&&(ft=te&&te.onVnodeUnmounted)||ke||gt)&&Gt(()=>{ft&&Nn(ft,f,m),ke&&Zi(m,null,f,"unmounted"),gt&&(m.el=null)},x)},lt=m=>{const{type:f,el:x,anchor:U,transition:B}=m;if(f===ae){Ye(x,U);return}if(f===sr){ie(m);return}const V=()=>{u(x),B&&!B.persisted&&B.afterLeave&&B.afterLeave()};if(m.shapeFlag&1&&B&&!B.persisted){const{leave:te,delayLeave:N}=B,J=()=>te(x,V);N?N(m.el,V,J):J()}else V()},Ye=(m,f)=>{let x;for(;m!==f;)x=R(m),u(m),m=x;u(f)},Ue=(m,f,x)=>{const{bum:U,scope:B,job:V,subTree:te,um:N,m:J,a:Z}=m;El(J),El(Z),U&&ea(U),B.stop(),V&&(V.flags|=8,qe(te,m,f,x)),N&&Gt(N,f),Gt(()=>{m.isUnmounted=!0},f)},j=(m,f,x,U=!1,B=!1,V=0)=>{for(let te=V;te{if(m.shapeFlag&6)return M(m.component.subTree);if(m.shapeFlag&128)return m.suspense.next();const f=R(m.anchor||m.el),x=f&&f[Gu];return x?R(x):f};let z=!1;const ut=(m,f,x)=>{let U;m==null?f._vnode&&(qe(f._vnode,null,null,!0),U=f._vnode.component):q(f._vnode||null,m,f,null,null,null,x),f._vnode=m,z||(z=!0,vl(U),Uu(),z=!1)},it={p:q,um:qe,m:Te,r:lt,mt:ye,mc:Ve,pc:ee,pbc:$e,n:M,o:t};return{render:ut,hydrate:void 0,createApp:Mf(ut)}}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 Hi({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(Ae(l)&&Ae(u))for(let d=0;d>1,t[o[_]]0&&(i[l]=o[d-1]),o[d]=l)}}for(d=o.length,p=o[d-1];d-- >0;)o[d]=p,p=i[p];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?Ae(t)?i.effects.push(...t):i.effects.push(t):Xd(t)}const ae=Symbol.for("v-fgt"),Sa=Symbol.for("v-txt"),Ft=Symbol.for("v-cmt"),sr=Symbol.for("v-stc"),ro=[];let on=null;function v(t=!1){ro.push(on=t?null:[])}function Gf(){ro.pop(),on=ro[ro.length-1]||null}let ho=1;function ra(t,i=!1){ho+=t,t<0&&on&&i&&(on.hasOnce=!0)}function xc(t){return t.dynamicChildren=ho>0?on||bs:null,Gf(),ho>0&&on&&on.push(t),t}function y(t,i,o,l,u,d){return xc(r(t,i,o,l,u,d,!0))}function et(t,i,o,l,u){return xc(E(t,i,o,l,u,!0))}function po(t){return t?t.__v_isVNode===!0:!1}function qi(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?_t(t)||Vt(t)||Ze(t)?{i:Bt,r:t,k:i,f:!!o}:t:null);function r(t,i=null,o=null,l=0,u=null,d=t===ae?0:1,p=!1,_=!1){const b={__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:Bt};return _?(la(b,o),d&128&&t.normalize(b)):o&&(b.shapeFlag|=_t(o)?8:16),ho>0&&!p&&on&&(b.patchFlag>0||d&6)&&b.patchFlag!==32&&on.push(b),b}const E=qf;function qf(t,i=null,o=null,l=0,u=null,d=!1){if((!t||t===bf)&&(t=Ft),po(t)){const _=Ci(t,i,!0);return o&&la(_,o),ho>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:b}=i;_&&!_t(_)&&(i.class=Me(_)),rt(b)&&(Dr(b)&&!Ae(b)&&(b=zt({},b)),i.style=Ps(b))}const p=_t(t)?1:bc(t)?128:qu(t)?64:rt(t)?4:Ze(t)?2:0;return r(t,i,o,l,u,p,d,!0)}function Yf(t){return t?Dr(t)||fc(t)?zt({},t):t:null}function Ci(t,i,o=!1,l=!1){const{props:u,ref:d,patchFlag:p,children:_,transition:b}=t,C=i?Jf(u||{},i):u,k={__v_isVNode:!0,__v_skip:!0,type:t.type,props:C,key:C&&wc(C),ref:i&&i.ref?o&&d?Ae(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!==ae?p===-1?16:p|16:p,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:b,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&Ci(t.ssContent),ssFallback:t.ssFallback&&Ci(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return b&&l&&fo(k,b.clone(k)),k}function $(t=" ",i=0){return E(Sa,null,t,i)}function D(t="",i=!1){return i?(v(),et(Ft,null,t)):E(Ft,null,t)}function Bn(t){return t==null||typeof t=="boolean"?E(Ft):Ae(t)?E(ae,null,t.slice()):po(t)?si(t):E(Sa,null,String(t))}function si(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:Ci(t)}function la(t,i){let o=0;const{shapeFlag:l}=t;if(i==null)i=null;else if(Ae(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=Bt:u===3&&Bt&&(Bt.slots._===1?i._=1:(i._=2,t.patchFlag|=1024))}else if(Ze(i)){if(l&65){la(t,{default:i});return}i={default:i,_ctx:Bt},o=32}else i=String(i),l&64?(o=16,i=[$(i)]):o=8;t.children=i,t.shapeFlag|=o}function Jf(...t){const i={};for(let o=0;oYt||Bt;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(p=>p(d)):u[0](d)}};ua=i("__VUE_INSTANCE_SETTERS__",o=>Yt=o),xr=i("__VUE_SSR_SETTERS__",o=>mo=o)}const bo=t=>{const i=Yt;return ua(t),t.scope.on(),()=>{t.scope.off(),ua(i)}},Ol=()=>{Yt&&Yt.scope.off(),ua(null)};function Sc(t){return t.vnode.shapeFlag&4}let mo=!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 p=d?nh(t,i):void 0;return i&&xr(!1),p}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=bo(t),p=_o(l,t,0,[t.props,u]),_=gu(p);if(Hn(),d(),(_||t.sp)&&!ks(t)&&tc(t),_){if(p.then(Ol,Ol),i)return p.then(b=>{zl(t,b)}).catch(b=>{ba(b,t,0)});t.asyncDep=p}else zl(t,p)}else Tc(t)}function zl(t,i,o){Ze(i)?t.type.__ssrInlineRender?t.ssrRender=i:t.render=i:rt(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=bo(t);Zn();try{kf(t)}finally{Hn(),u()}}}const ih={get(t,i){return Rt(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 ao)return ao[o](t)},has(i,o){return o in i||o in ao}})):t.proxy}function oh(t){return Ze(t)&&"__vccOpts"in t}const xe=(t,i)=>Kd(t,i,mo);function ah(t,i,o){try{ra(-1);const l=arguments.length;return l===2?rt(i)&&!Ae(i)?po(i)?E(t,null,[i]):E(t,i):E(t,null,i):(l>3?o=Array.prototype.slice.call(arguments,2):l===3&&po(o)&&(o=[o]),E(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 p=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 b=_.firstChild;for(;b.firstChild;)_.appendChild(b.firstChild);_.removeChild(b)}i.insertBefore(_,o)}return[p?p.nextSibling:i.firstChild,o?o.previousSibling:i.lastChild]}},ki="transition",qs="animation",go=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=zt({},Yu,Cc),fh=t=>(t.displayName="Transition",t.props=dh,t),hh=fh((t,{slots:i})=>ah(uf,ph(t),i)),ji=(t,i=[])=>{Ae(t)?t.forEach(o=>o(...i)):t&&t(...i)},Il=t=>t?Ae(t)?t.some(i=>i.length>1):t.length>1:!1;function ph(t){const i={};for(const Q in t)Q in Cc||(i[Q]=t[Q]);if(t.css===!1)return i;const{name:o="v",type:l,duration:u,enterFromClass:d=`${o}-enter-from`,enterActiveClass:p=`${o}-enter-active`,enterToClass:_=`${o}-enter-to`,appearFromClass:b=d,appearActiveClass:C=p,appearToClass:k=_,leaveFromClass:O=`${o}-leave-from`,leaveActiveClass:R=`${o}-leave-active`,leaveToClass:F=`${o}-leave-to`}=t,X=mh(u),q=X&&X[0],ge=X&&X[1],{onBeforeEnter:we,onEnter:K,onEnterCancelled:fe,onLeave:ie,onLeaveCancelled:me,onBeforeAppear:Le=we,onAppear:Ee=K,onAppearCancelled:Ve=fe}=i,pe=(Q,ue,ye,ze)=>{Q._enterCancelled=ze,Wi(Q,ue?k:_),Wi(Q,ue?C:p),ye&&ye()},$e=(Q,ue)=>{Q._isLeaving=!1,Wi(Q,O),Wi(Q,F),Wi(Q,R),ue&&ue()},Oe=Q=>(ue,ye)=>{const ze=Q?Ee:K,ce=()=>pe(ue,Q,ye);ji(ze,[ue,ce]),Dl(()=>{Wi(ue,Q?b:d),ni(ue,Q?k:_),Il(ze)||Nl(ue,l,q,ce)})};return zt(i,{onBeforeEnter(Q){ji(we,[Q]),ni(Q,d),ni(Q,p)},onBeforeAppear(Q){ji(Le,[Q]),ni(Q,b),ni(Q,C)},onEnter:Oe(!1),onAppear:Oe(!0),onLeave(Q,ue){Q._isLeaving=!0;const ye=()=>$e(Q,ue);ni(Q,O),Q._enterCancelled?(ni(Q,R),Bl(Q)):(Bl(Q),ni(Q,R)),Dl(()=>{Q._isLeaving&&(Wi(Q,O),ni(Q,F),Il(ie)||Nl(Q,l,ge,ye))}),ji(ie,[Q,ye])},onEnterCancelled(Q){pe(Q,!1,void 0,!0),ji(fe,[Q])},onAppearCancelled(Q){pe(Q,!0,void 0,!0),ji(Ve,[Q])},onLeaveCancelled(Q){$e(Q),ji(me,[Q])}})}function mh(t){if(t==null)return null;if(rt(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[go]||(t[go]=new Set)).add(i)}function Wi(t,i){i.split(/\s+/).forEach(l=>l&&t.classList.remove(l));const o=t[go];o&&(o.delete(i),o.size||(t[go]=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:p,timeout:_,propCount:b}=vh(t,i);if(!p)return l();const C=p+"end";let k=0;const O=()=>{t.removeEventListener(C,R),d()},R=F=>{F.target===t&&++k>=b&&O()};setTimeout(()=>{k(o[X]||"").split(", "),u=l(`${ki}Delay`),d=l(`${ki}Duration`),p=Rl(u,d),_=l(`${qs}Delay`),b=l(`${qs}Duration`),C=Rl(_,b);let k=null,O=0,R=0;i===ki?p>0&&(k=ki,O=p,R=d.length):i===qs?C>0&&(k=qs,O=C,R=b.length):(O=Math.max(p,C),k=O>0?p>C?ki:qs:null,R=k?k===ki?d.length:b.length:0);const F=k===ki&&/\b(?:transform|all)(?:,|$)/.test(l(`${ki}Property`).toString());return{type:k,timeout:O,propCount:R,hasTransform:F}}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[go];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):Ys(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),Ys(t,!0),l.enter(t)):l.leave(t,()=>{Ys(t,!1)}):Ys(t,i))},beforeUnmount(t,{value:i}){Ys(t,i)}};function Ys(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=_t(o);let d=!1;if(o&&!u){if(i)if(_t(i))for(const p of i.split(";")){const _=p.slice(0,p.indexOf(":")).trim();o[_]==null&&Qs(l,_,"")}else for(const p in i)o[p]==null&&Qs(l,p,"");for(const p in o){p==="display"&&(d=!0);const _=o[p];_!=null?Sh(t,p,!_t(i)&&i?i[p]:void 0,_)||Qs(l,p,_):Qs(l,p,"")}}else if(u){if(i!==o){const p=l[bh];p&&(o+=";"+p),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 Qs(t,i,o){if(Ae(o))o.forEach(l=>Qs(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(Mi(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(Ae(u)){const d=l.stopImmediatePropagation;l.stopImmediatePropagation=()=>{d.call(l),l._stopped=!0};const p=u.slice(),_=[l];for(let b=0;bt.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,Ah=(t,i,o,l,u,d)=>{const p=u==="svg";i==="class"?_h(t,l,p):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,p))?(jl(t,i,l),!t.tagName.includes("-")&&(i==="value"||i==="checked"||i==="selected")&&Hl(t,i,l,p,d,i!=="value")):t._isVueCE&&(Ih(t,i)||t._def.__asyncLoader&&(/[A-Z]/.test(i)||!_t(l)))?jl(t,Pn(i),l,d,i):(i==="true-value"?t._trueValue=l:i==="false-value"&&(t._falseValue=l),Hl(t,i,l,p))};function $h(t,i,o,l){if(l)return!!(i==="innerHTML"||i==="textContent"||i in t&&Kl(i)&&Ze(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)&&_t(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 Li=t=>{const i=t.props["onUpdate:modelValue"]||!1;return Ae(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 ve={created(t,{modifiers:{lazy:i,trim:o,number:l}},u){t[gn]=Li(u);const d=l||u.props&&u.props.type==="number";ri(t,i?"change":"input",p=>{p.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}},p){if(t[gn]=Li(p),t.composing)return;const _=(d||t.type==="number")&&!/^0\d/.test(t.value)?va(t.value):t.value,b=i??"";if(_===b)return;const C=t.getRootNode();(C instanceof Document||C instanceof ShadowRoot)&&C.activeElement===t&&t.type!=="range"&&(l&&i===o||u&&t.value.trim()===b)||(t.value=b)}},da={deep:!0,created(t,i,o){t[gn]=Li(o),ri(t,"change",()=>{const l=t._modelValue,u=Ls(t),d=t.checked,p=t[gn];if(Ae(l)){const _=Mr(l,u),b=_!==-1;if(d&&!b)p(l.concat(u));else if(!d&&b){const C=[...l];C.splice(_,1),p(C)}}else if(Ms(l)){const _=new Set(l);d?_.add(u):_.delete(u),p(_)}else p(Mc(t,d))})},mounted:Yl,beforeUpdate(t,i,o){t[gn]=Li(o),Yl(t,i,o)}};function Yl(t,{value:i,oldValue:o},l){t._modelValue=i;let u;if(Ae(i))u=Mr(i,l.props.value)>-1;else if(Ms(i))u=i.has(l.props.value);else{if(i===o)return;u=Pi(i,Mc(t,!0))}t.checked!==u&&(t.checked=u)}const Nh={created(t,{value:i},o){t.checked=Pi(i,o.props.value),t[gn]=Li(o),ri(t,"change",()=>{t[gn](Ls(t))})},beforeUpdate(t,{value:i,oldValue:o},l){t[gn]=Li(l),i!==o&&(t.checked=Pi(i,l.props.value))}},Ot={deep:!0,created(t,{value:i,modifiers:{number:o}},l){const u=Ms(i);ri(t,"change",()=>{const d=Array.prototype.filter.call(t.options,p=>p.selected).map(p=>o?va(Ls(p)):Ls(p));t[gn](t.multiple?u?new Set(d):d:d[0]),t._assigning=!0,Bu(()=>{t._assigning=!1})}),t[gn]=Li(l)},mounted(t,{value:i}){Jl(t,i)},beforeUpdate(t,i,o){t[gn]=Li(o)},updated(t,{value:i}){t._assigning||Jl(t,i)}};function Jl(t,i){const o=t.multiple,l=Ae(i);if(!(o&&!l&&!Ms(i))){for(let u=0,d=t.options.length;uString(C)===String(_)):p.selected=Mr(i,_)>-1}else p.selected=i.has(_);else if(Pi(Ls(p),i)){t.selectedIndex!==u&&(t.selectedIndex=u);return}}!o&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function Ls(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){Jo(t,i,o,null,"created")},mounted(t,i,o){Jo(t,i,o,null,"mounted")},beforeUpdate(t,i,o,l){Jo(t,i,o,l,"beforeUpdate")},updated(t,i,o,l){Jo(t,i,o,l,"updated")}};function Fh(t,i){switch(t){case"SELECT":return Ot;case"TEXTAREA":return ve;default:switch(i){case"checkbox":return da;case"radio":return Nh;default:return ve}}}function Jo(t,i,o,l,u){const p=Fh(t.tagName,o.props&&o.props.type)[u];p&&p(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 p=0;p{const o=t._withKeys||(t._withKeys={}),l=i.join(".");return o[l]||(o[l]=(u=>{if(!("key"in u))return;const d=Mi(u.key);if(i.some(p=>p===d||Uh[p]===d))return t(u)}))},Zh=zt({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;!Ze(d)&&!d.render&&!d.template&&(d.template=u.innerHTML),u.nodeType===1&&(u.textContent="");const p=o(u,!1,Wh(u));return u instanceof Element&&(u.removeAttribute("v-cloak"),u.setAttribute("data-v-app","")),p},i});function Wh(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function Kh(t){return _t(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 Xi=H(Gh()),Ts=H(zc(Xi.value));function ha(t){Xi.value=t;const i=zc(t);Ts.value=i,Ac(i);try{localStorage.setItem(Ec,t)}catch{}}function tu(){ha(Ts.value==="dark"?"light":"dark")}fa&&fa.addEventListener("change",()=>{if(Xi.value==="system"){const t=Oc();Ts.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/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 fp(){const t=await fetch("/bff/integrations/filetransfer/health",{method:"POST"});return{ok:t.ok,status:t.status,body:await t.json().catch(()=>({}))}}async function hp(){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 Xo(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 pp(){const t=await fetch("/bff/integrations/localstorage/health",{method:"POST"});return{ok:t.ok,status:t.status,body:await t.json().catch(()=>({}))}}async function mp(){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 gp(){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 vp(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 _p(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 yp(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 bp(){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 xp(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 wp(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 kp(t){const i=await fetch(`/bff/flights/${encodeURIComponent(t)}`,{method:"DELETE"});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}function Sp(){return"/bff/logbook/export"}async function Tp(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 Pp(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 Cp(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 Lp(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 Mp(t){return`/bff/documents/${encodeURIComponent(t)}/file?inline=1`}async function Ep(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,twoFactor:!1};function Op(){try{return{...kr,...JSON.parse(localStorage.getItem(Ic)||"{}")||{}}}catch{return{...kr}}}const De=xt(Op());function Dc(){try{localStorage.setItem(Ic,JSON.stringify(De))}catch{}}function Nc(t){if(!t||typeof t!="object")return!1;for(const i of Object.keys(kr))i in t&&(De[i]=t[i]);return!0}const zp={sm:15,md:16,lg:18};function Ur(t){document.documentElement.style.fontSize=(zp[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(De.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 p;return De.timeFormat==="12"?p=i.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0}):p=`${String(i.getHours()).padStart(2,"0")}:${String(i.getMinutes()).padStart(2,"0")}:${String(i.getSeconds()).padStart(2,"0")}`,{date:d,time:p}}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 Ap(){return{...JSON.parse(JSON.stringify(De)),themeMode:Xi.value}}function jr(){!Hr||Sr||(clearTimeout(Tr),Tr=setTimeout(()=>{lp(Ap())},600))}function $p(t){Sr=!0;try{Nc(t),t.themeMode&&ha(t.themeMode),Ur(De.fontSize),Zr(De.reduceMotion),Dc()}finally{Sr=!1}}async function lu(){Hr=!0;const t=await rp();t&&Object.keys(t).length?$p(t):jr()}function Ip(){Hr=!1,clearTimeout(Tr)}en(De,()=>{Dc(),jr()},{deep:!0});en(Xi,jr);en(()=>De.fontSize,Ur,{immediate:!0});en(()=>De.reduceMotion,Zr,{immediate:!0});const Dp=["width","height"],Fc={__name:"BrandMark",props:{size:{type:[Number,String],default:28}},setup(t){return(i,o)=>(v(),y("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,Dp))}},Np=["title","aria-label"],Rp={key:0,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Fp={key:1,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Bp={__name:"ThemeToggle",setup(t){return(i,o)=>(v(),y("button",{class:"btn-icon",type:"button",title:Re(Ts)==="dark"?"Switch to light":"Switch to dark","aria-label":Re(Ts)==="dark"?"Switch to light theme":"Switch to dark theme",onClick:o[0]||(o[0]=(...l)=>Re(tu)&&Re(tu)(...l))},[Re(Ts)==="dark"?(v(),y("svg",Rp,[...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)])])):(v(),y("svg",Fp,[...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,Np))}},Vp={class:"relative grid h-full place-items-center p-5"},Up={class:"absolute right-5 top-5"},Zp={class:"mb-6 flex items-center gap-3 text-ink"},Hp={class:"relative mb-1"},jp=["type"],Wp=["aria-label","title"],Kp={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]"},Gp={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]"},qp={key:0,class:"mt-4"},Yp={key:1,class:"mt-4 rounded border border-line bg-danger-soft px-3 py-2 text-sm text-danger-fg"},Jp=["disabled"],Xp={__name:"LoginView",props:{defaultApiBase:{type:String,default:""}},emits:["signed-in"],setup(t,{emit:i}){const o=t,l=i,u=H(""),d=H(""),p=H(localStorage.getItem("api_url")||o.defaultApiBase||"http://localhost:8080"),_=H(!1),b=H(!1),C=H(!1),k=H("");async function O(){C.value=!0,k.value="",localStorage.setItem("api_url",p.value.trim());const{ok:R,status:F,body:X}=await Yh(u.value.trim(),d.value,p.value.trim());if(C.value=!1,R){l("signed-in",X.email);return}k.value=F===400?"Invalid email or password.":F===502?"API server can't reach PocketBase.":X.message||X.error||"Cannot reach the API server."}return(R,F)=>(v(),y("div",Vp,[r("div",Up,[E(Bp)]),r("form",{class:"panel w-[380px] p-8 shadow-md",onSubmit:Vr(O,["prevent"])},[r("div",Zp,[E(Fc,{size:34}),F[5]||(F[5]=r("div",{class:"leading-tight"},[r("div",{class:"text-mode"},"PilotVault"),r("div",{class:"eyebrow mt-0.5"},"Control panel")],-1))]),F[9]||(F[9]=r("label",{class:"eyebrow mb-1.5 block"},"Email",-1)),oe(r("input",{"onUpdate:modelValue":F[0]||(F[0]=X=>u.value=X),type:"email",autocomplete:"username",required:"",class:"field mb-4",placeholder:"you@example.com"},null,512),[[ve,u.value]]),F[10]||(F[10]=r("label",{class:"eyebrow mb-1.5 block"},"Password",-1)),r("div",Hp,[oe(r("input",{"onUpdate:modelValue":F[1]||(F[1]=X=>d.value=X),type:b.value?"text":"password",autocomplete:"current-password",required:"",class:"field w-full pr-10",placeholder:"••••••••"},null,8,jp),[[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":b.value?"Hide password":"Show password",title:b.value?"Hide password":"Show password",onClick:F[2]||(F[2]=X=>b.value=!b.value)},[b.value?(v(),y("svg",Kp,[...F[6]||(F[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)])])):(v(),y("svg",Gp,[...F[7]||(F[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,Wp)]),_.value?(v(),y("div",qp,[F[8]||(F[8]=r("label",{class:"eyebrow mb-1.5 block"},"API Server",-1)),oe(r("input",{"onUpdate:modelValue":F[3]||(F[3]=X=>p.value=X),type:"text",class:"field font-mono",placeholder:"10.2.1.101:8080"},null,512),[[ve,p.value]])])):D("",!0),k.value?(v(),y("p",Yp,S(k.value),1)):D("",!0),r("button",{type:"submit",class:"btn-accent mt-6 w-full",disabled:C.value},S(C.value?"Signing in…":"Sign in"),9,Jp),r("button",{type:"button",class:"mx-auto mt-3 block text-xs text-ink-muted transition hover:text-ink-secondary",onClick:F[4]||(F[4]=X=>_.value=!_.value)},S(_.value?"Hide server settings":"Server settings"),1)],32)]))}};function Qp(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var eo={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 em=eo.exports,uu;function tm(){return uu||(uu=1,(function(t,i){(function(o,l){l(i)})(em,(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=fe(e)?e:[e];for(var n=0;n0?Math.floor(e):Math.ceil(e)};ee.prototype={clone:function(){return new ee(this.x,this.y)},add:function(e){return this.clone()._add(he(e))},_add:function(e){return this.x+=e.x,this.y+=e.y,this},subtract:function(e){return this.clone()._subtract(he(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 ee(this.x*e.x,this.y*e.y)},unscaleBy:function(e){return new ee(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=nt(this.x),this.y=nt(this.y),this},distanceTo:function(e){e=he(e);var n=e.x-this.x,s=e.y-this.y;return Math.sqrt(n*n+s*s)},equals:function(e){return e=he(e),e.x===this.x&&e.y===this.y},contains:function(e){return e=he(e),Math.abs(e.x)<=Math.abs(this.x)&&Math.abs(e.y)<=Math.abs(this.y)},toString:function(){return"Point("+R(this.x)+", "+R(this.y)+")"}};function he(e,n,s){return e instanceof ee?e:fe(e)?new ee(e[0],e[1]):e==null?e:typeof e=="object"&&"x"in e&&"y"in e?new ee(e.x,e.y):new ee(e,n,s)}function Te(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=qe(e);var n=this.min,s=this.max,a=e.min,c=e.max,g=c.x>=n.x&&a.x<=s.x,P=c.y>=n.y&&a.y<=s.y;return g&&P},overlaps:function(e){e=qe(e);var n=this.min,s=this.max,a=e.min,c=e.max,g=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=Ye(e);var n=this._southWest,s=this._northEast,a=e.getSouthWest(),c=e.getNorthEast(),g=c.lat>=n.lat&&a.lat<=s.lat,P=c.lng>=n.lng&&a.lng<=s.lng;return g&&P},overlaps:function(e){e=Ye(e);var n=this._southWest,s=this._northEast,a=e.getSouthWest(),c=e.getNorthEast(),g=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})(),Os=!!(document.createElementNS&&U("svg").createSVGRect),wo=!!Os&&(function(){var e=document.createElement("div");return e.innerHTML=" ",(e.firstChild&&e.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"})(),Ea=!Os&&(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 je(e){return navigator.userAgent.toLowerCase().indexOf(e)>=0}var _e={ie:te,ielt9:N,edge:J,webkit:Z,android:Pe,android23:le,androidStock:Ce,opera:He,chrome:ke,gecko:Ge,safari:ft,phantom:gt,opera12:yt,win:Ct,ie3d:_n,webkit3d:di,gecko3d:St,any3d:Dt,mobile:En,mobileWebkit:Ut,mobileWebkit3d:Qi,msPointer:At,pointer:Zt,touch:Pa,touchNative:bt,mobileOpera:xo,mobileGecko:Es,retina:Ca,passiveEvents:La,canvas:Ma,svg:Os,vml:Ea,inlineSvg:wo,mac:Oa,linux:za},es=_e.msPointer?"MSPointerDown":"pointerdown",$t=_e.msPointer?"MSPointerMove":"pointermove",fi=_e.msPointer?"MSPointerUp":"pointerup",Ei=_e.msPointer?"MSPointerCancel":"pointercancel",hi={touchstart:es,touchmove:$t,touchend:fi,touchcancel:Ei},an={touchstart:So,touchmove:Ht,touchend:Ht,touchcancel:Ht},tn={},ko=!1;function zs(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 As(e,n,s){if(!hi[n]){console.warn("wrong event specified:",n);return}e.removeEventListener(hi[n],s,!1)}function Aa(e){tn[e.pointerId]=e}function rn(e){tn[e.pointerId]&&(tn[e.pointerId]=e)}function yn(e){delete tn[e.pointerId]}function pi(){ko||(document.addEventListener(es,Aa,!0),document.addEventListener($t,rn,!0),document.addEventListener(fi,yn,!0),document.addEventListener(Ei,yn,!0),ko=!0)}function Ht(e,n){if(n.pointerType!==(n.MSPOINTER_TYPE_MOUSE||"mouse")){n.touches=[];for(var s in tn)n.touches.push(tn[s]);n.changedTouches=[n],e(n)}}function So(e,n){n.MSPOINTER_TYPE_TOUCH&&n.pointerType===n.MSPOINTER_TYPE_TOUCH&&Lt(n),Ht(e,n)}function $s(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(g){if(g.detail!==1){a=g.detail;return}if(!(g.pointerType==="mouse"||g.sourceCapabilities&&!g.sourceCapabilities.firesTouchEvents)){var P=Lo(g);if(!(P.some(function(I){return I instanceof HTMLLabelElement&&I.attributes.for})&&!P.some(function(I){return I instanceof HTMLInputElement||I instanceof HTMLSelectElement}))){var A=Date.now();A-s<=$a?(a++,a===2&&n($s(g))):a=1,s=A}}}return e.addEventListener("click",c),{dblclick:n,simDblclick:c}}function Da(e,n){e.removeEventListener("dblclick",n.dblclick),e.removeEventListener("click",n.simDblclick)}var Is=ts(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),mi=ts(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),To=mi==="webkitTransition"||mi==="OTransition"?mi+"End":"transitionend";function Po(e){return typeof e=="string"?document.getElementById(e):e}function Oi(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 ne(e,n,s){var a=document.createElement(e);return a.className=n||"",s&&s.appendChild(a),a}function st(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=zi(e);return s.length>0&&new RegExp("(^|\\s)"+n+"(\\s|$)").test(s)}function Ie(e,n){if(e.classList!==void 0)for(var s=X(n),a=0,c=s.length;a0?2*window.devicePixelRatio:1;function Eo(e){return _e.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 Oo={__proto__:null,on:Be,off:ot,stopPropagation:kt,disableScrollPropagation:zn,disableClickPropagation:yi,preventDefault:Lt,stop:wn,getPropagationPath:Lo,getMousePosition:Mo,getWheelDelta:Eo,isExternalTarget:Kn,addListener:Be,removeListener:ot},Ii=re.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=Oe(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,Ye(e));return s.equals(a)||this.panTo(a,n),this._enforcingBounds=!1,this},panInside:function(e,n){n=n||{};var s=he(n.paddingTopLeft||n.padding||[0,0]),a=he(n.paddingBottomRight||n.padding||[0,0]),c=this.project(this.getCenter()),g=this.project(e),P=this.getPixelBounds(),A=qe([P.min.add(s),P.max.subtract(a)]),I=A.getSize();if(!A.contains(g)){this._enforcingBounds=!0;var G=g.subtract(A.getCenter()),de=A.extend(g).getSize().subtract(I);c.x+=G.x<0?-de.x:de.x,c.y+=G.y<0?-de.y:de.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(),g=a.subtract(c);return!g.x&&!g.y?this:(e.animate&&e.pan?this.panBy(g):(e.pan&&this._rawPanBy(g),this.fire("move"),e.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(p(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=p(this._handleGeolocationResponse,this),s=p(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),g=this._locateOptions;if(g.setView){var P=this.getBoundsZoom(c);this.setView(a,g.maxZoom?Math.min(P,g.maxZoom):P)}var A={latlng:a,bounds:c,timestamp:e.timestamp};for(var I in e.coords)typeof e.coords[I]=="number"&&(A[I]=e.coords[I]);this.fire("locationfound",A)}},addHandler:function(e,n){if(!n)return this;var s=this[e]=new n(this);return this._handlers.push(s),this.options[e]&&s.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),st(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(Q(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)st(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=ne("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 lt(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=Ye(e),s=he(s||[0,0]);var a=this.getZoom()||0,c=this.getMinZoom(),g=this.getMaxZoom(),P=e.getNorthWest(),A=e.getSouthEast(),I=this.getSize().subtract(s),G=qe(this.project(A,a),this.project(P,a)).getSize(),de=_e.any3d?this.options.zoomSnap:1,Ne=I.x/G.x,Ke=I.y/G.y,Wt=n?Math.max(Ne,Ke):Math.min(Ne,Ke);return a=this.getScaleZoom(Wt,a),de&&(a=Math.round(a/(de/100))*(de/100),a=n?Math.ceil(a/de)*de:Math.floor(a/de)*de),Math.max(c,Math.min(g,a))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new ee(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 Te(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(j(e),n)},unproject:function(e,n){return n=n===void 0?this._zoom:n,this.options.crs.pointToLatLng(he(e),n)},layerPointToLatLng:function(e){var n=he(e).add(this.getPixelOrigin());return this.unproject(n)},latLngToLayerPoint:function(e){var n=this.project(j(e))._round();return n._subtract(this.getPixelOrigin())},wrapLatLng:function(e){return this.options.crs.wrapLatLng(j(e))},wrapLatLngBounds:function(e){return this.options.crs.wrapLatLngBounds(Ye(e))},distance:function(e,n){return this.options.crs.distance(j(e),j(n))},containerPointToLayerPoint:function(e){return he(e).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(e){return he(e).add(this._getMapPanePos())},containerPointToLatLng:function(e){var n=this.containerPointToLayerPoint(he(e));return this.layerPointToLatLng(n)},latLngToContainerPoint:function(e){return this.layerPointToContainerPoint(this.latLngToLayerPoint(j(e)))},mouseEventToContainerPoint:function(e){return Mo(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=Po(e);if(n){if(n._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");Be(n,"scroll",this._onScroll,this),this._containerId=b(n)},_initLayout:function(){var e=this._container;this._fadeAnimated=this.options.fadeAnimation&&_e.any3d,Ie(e,"leaflet-container"+(_e.touch?" leaflet-touch":"")+(_e.retina?" leaflet-retina":"")+(_e.ielt9?" leaflet-oldie":"")+(_e.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var n=Oi(e,"position");n!=="absolute"&&n!=="relative"&&n!=="fixed"&&n!=="sticky"&&(e.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var e=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),vt(this._mapPane,new ee(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(Ie(e.markerPane,"leaflet-zoom-hide"),Ie(e.shadowPane,"leaflet-zoom-hide"))},_resetView:function(e,n,s){vt(this._mapPane,new ee(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 Q(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(e){vt(this._mapPane,this._getMapPanePos().subtract(e))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(e){this._targets={},this._targets[b(this._container)]=this;var n=e?ot:Be;n(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&n(window,"resize",this._onResize,this),_e.any3d&&this.options.transform3DLimit&&(e?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){Q(this._resizeRequest),this._resizeRequest=Oe(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",g=e.target||e.srcElement,P=!1;g;){if(a=this._targets[b(g)],a&&(n==="click"||n==="preclick")&&this._draggableMoved(a)){P=!0;break}if(a&&a.listens(n,!0)&&(c&&!Kn(g,e)||(s.push(a),c))||g===this._container)break;g=g.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"&&ss(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 g=[],P=0;P0?Math.round(e-n)/2:Math.max(0,Math.ceil(e))-Math.max(0,Math.floor(n))},_limitZoom:function(e){var n=this.getMinZoom(),s=this.getMaxZoom(),a=_e.any3d?this.options.zoomSnap:1;return a&&(e=Math.round(e/a)*a),Math.max(n,Math.min(s,e))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){ct(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=ne("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(e),this.on("zoomanim",function(n){var s=Is,a=this._proxy.style[s];Tt(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(){st(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var e=this.getCenter(),n=this.getZoom();Tt(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:(Oe(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,Ie(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(p(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&ct(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 rs(e,n){return new We(e,n)}var jt=ye.extend({options:{position:"topright"},initialize:function(e){q(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 Ie(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?(st(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()}}),Di=function(e){return new jt(e)};We.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=ne("div",n+"control-container",this._container);function a(c,g){var P=n+c+" "+n+g;e[c+g]=ne("div",P,s)}a("top","left"),a("top","right"),a("bottom","left"),a("bottom","right")},_clearControlPos:function(){for(var e in this._controlCorners)st(this._controlCorners[e]);st(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var zo=jt.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(b(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_"+b(this),s),this._layerControlInputs.push(a),a.layerId=b(e.layer),Be(a,"click",this._onInputClick,this);var c=document.createElement("span");c.innerHTML=" "+e.name;var g=document.createElement("span");n.appendChild(g),g.appendChild(a),g.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 g=e.length-1;g>=0;g--)n=e[g],s=this._getLayer(n.layerId).layer,n.checked?a.push(s):n.checked||c.push(s);for(g=0;g=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,Be(e,"click",Lt),this.expand();var n=this;setTimeout(function(){ot(e,"click",Lt),n._preventClick=!1})}}),Fa=function(e,n,s){return new zo(e,n,s)},Jt=jt.extend({options:{position:"topleft",zoomInText:'+ ',zoomInTitle:"Zoom in",zoomOutText:'− ',zoomOutTitle:"Zoom out"},onAdd:function(e){var n="leaflet-control-zoom",s=ne("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 g=ne("a",s,a);return g.innerHTML=e,g.href="#",g.title=n,g.setAttribute("role","button"),g.setAttribute("aria-label",n),yi(g),Be(g,"click",wn),Be(g,"click",c,this),Be(g,"click",this._refocusOnMap,this),g},_updateDisabled:function(){var e=this._map,n="leaflet-disabled";ct(this._zoomInButton,n),ct(this._zoomOutButton,n),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||e._zoom===e.getMinZoom())&&(Ie(this._zoomOutButton,n),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||e._zoom===e.getMaxZoom())&&(Ie(this._zoomInButton,n),this._zoomInButton.setAttribute("aria-disabled","true"))}});We.mergeOptions({zoomControl:!0}),We.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Jt,this.addControl(this.zoomControl))});var Ba=function(e){return new Jt(e)},Ao=jt.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(e){var n="leaflet-control-scale",s=ne("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=ne("div",n,s)),e.imperial&&(this._iScale=ne("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 Ao(e)},ls=' ',Gn=jt.extend({options:{position:"bottomright",prefix:''+(_e.inlineSvg?ls+" ":"")+"Leaflet "},initialize:function(e){q(this,e),this._attributions={}},onAdd:function(e){e.attributionControl=this,this._container=ne("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(' | ')}}});We.mergeOptions({attributionControl:!0}),We.addInitHook(function(){this.options.attributionControl&&new Gn().addTo(this)});var us=function(e){return new Gn(e)};jt.Layers=zo,jt.Zoom=Jt,jt.Scale=Ao,jt.Attribution=Gn,Di.layers=Fa,Di.zoom=Ba,Di.scale=Va,Di.attribution=us;var dt=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}});dt.addTo=function(e,n){return e.addHandler(n,this),this};var bi={Events:ce},Ni=_e.touch?"touchstart mousedown":"mousedown",Xt=re.extend({options:{clickTolerance:3},initialize:function(e,n,s,a){q(this,a),this._element=e,this._dragStartTarget=n||e,this._preventOutline=s},enable:function(){this._enabled||(Be(this._dragStartTarget,Ni,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Xt._dragging===this&&this.finishDrag(!0),ot(this._dragStartTarget,Ni,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){Xt._dragging===this&&this.finishDrag();return}if(!(Xt._dragging||e.shiftKey||e.which!==1&&e.button!==1&&!e.touches)&&(Xt._dragging=this,this._preventOutline&&ss(this._element),Ns(),vi(),!this._moving)){this.fire("down");var n=e.touches?e.touches[0]:e,s=Co(this._element);this._startPoint=new ee(n.clientX,n.clientY),this._startPos=On(this._element),this._parentScale=Bs(s);var a=e.type==="mousedown";Be(document,a?"mousemove":"touchmove",this._onMove,this),Be(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 ee(n.clientX,n.clientY)._subtract(this._startPoint);!s.x&&!s.y||Math.abs(s.x)+Math.abs(s.y)g&&(P=A,g=I);g>s&&(n[P]=1,Xe(e,n,s,a,P),Xe(e,n,s,P,c))}function An(e,n){for(var s=[e[0]],a=1,c=0,g=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,g=n.y,P=s.x-c,A=s.y-g,I=P*P+A*A,G;return I>0&&(G=((e.x-c)*P+(e.y-g)*A)/I,G>1?(c=s.x,g=s.y):G>0&&(c+=P*G,g+=A*G)),P=e.x-c,A=e.y-g,a?P*P+A*A:new ee(c,g)}function Mt(e){return!fe(e[0])||typeof e[0][0]!="object"&&typeof e[0][0]<"u"}function Vi(e){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Mt(e)}function xi(e,n){var s,a,c,g,P,A,I,G;if(!e||e.length===0)throw new Error("latlngs not passed");Mt(e)||(console.warn("latlngs are not flat! Only the first ring will be used"),e=e[0]);var de=j([0,0]),Ne=Ye(e),Ke=Ne.getNorthWest().distanceTo(Ne.getSouthWest())*Ne.getNorthEast().distanceTo(Ne.getNorthWest());Ke<1700&&(de=qn(e));var Wt=e.length,Et=[];for(s=0;sa){I=(g-a)/c,G=[A.x-I*(A.x-P.x),A.y-I*(A.y-P.y)];break}var Qt=n.unproject(he(G));return j([Qt.lat+de.lat,Qt.lng+de.lng])}var kn={__proto__:null,simplify:Yn,pointToSegmentDistance:Fi,closestPointOnSegment:Ua,clipSegment:cs,_getEdgeIntersection:ds,_getBitCode:$n,_sqClosestPointOnSegment:In,isFlat:Mt,_flat:Vi,polylineCenter:xi},Sn={project:function(e){return new ee(e.lng,e.lat)},unproject:function(e){return new Ue(e.y,e.x)},bounds:new Te([-180,-90],[180,90])},Ui={R:6378137,R_MINOR:6356752314245179e-9,bounds:new Te([-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,g=Math.sqrt(1-c*c),P=g*Math.sin(a),A=Math.tan(Math.PI/4-a/2)/Math.pow((1-P)/(1+P),g/2);return a=-s*Math.log(Math.max(A,1e-10)),new ee(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),g=Math.exp(-e.y/s),P=Math.PI/2-2*Math.atan(g),A=0,I=.1,G;A<15&&Math.abs(I)>1e-7;A++)G=c*Math.sin(P),G=Math.pow((1-G)/(1+G),c/2),I=Math.PI/2-2*Math.atan(g*G)-P,P+=I;return new Ue(P*n,e.x*n/s)}},Io={__proto__:null,LonLat:Sn,Mercator:Ui,SphericalMercator:it},ja=u({},z,{code:"EPSG:3395",projection:Ui,transformation:(function(){var e=.5/(Math.PI*Ui.R);return m(e,.5,-e,.5)})()}),Us=u({},z,{code:"EPSG:4326",projection:Sn,transformation:m(1/180,1,-1/180,.5)}),Do=u({},M,{projection:Sn,transformation:m(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});M.Earth=z,M.EPSG3395=ja,M.EPSG3857=f,M.EPSG900913=x,M.EPSG4326=Us,M.Simple=Do;var nn=re.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[b(e)]=this,this},removeInteractiveTarget:function(e){return delete this._map._targets[b(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})}}});We.include({addLayer:function(e){if(!e._layerAdd)throw new Error("The provided object is not a Layer.");var n=b(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=b(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 b(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?fe(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){Xn.prototype._setLatLngs.call(this,e),Mt(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Mt(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var e=this._renderer._bounds,n=this.options.weight,s=new ee(n,n);if(e=new Te(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,g;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 ps(e,n)}var Qn=Tn.extend({initialize:function(e,n){q(this,n),this._layers={},e&&this.addData(e)},addData:function(e){var n=fe(e)?e:e.features,s,a,c;if(n){for(s=0,a=n.length;s0&&c.push(c[0].slice()),c}function ms(e,n){return e.feature?u({},e.feature,{geometry:n}):Vo(n)}function Vo(e){return e.type==="Feature"||e.type==="FeatureCollection"?e:{type:"Feature",properties:{},geometry:e}}var Ga={toGeoJSON:function(e){return ms(this,{type:"Point",coordinates:Ka(this.getLatLng(),e)})}};hs.include(Ga),Qe.include(Ga),W.include(Ga),Xn.include({toGeoJSON:function(e){var n=!Mt(this._latlngs),s=Bo(this._latlngs,n?1:0,!1,e);return ms(this,{type:(n?"Multi":"")+"LineString",coordinates:s})}}),ps.include({toGeoJSON:function(e){var n=!Mt(this._latlngs),s=n&&!Mt(this._latlngs[0]),a=Bo(this._latlngs,s?2:n?1:0,!0,e);return n||(a=[a]),ms(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)}),ms(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 g=c.toGeoJSON(e);if(s)a.push(g.geometry);else{var P=Vo(g);P.type==="FeatureCollection"?a.push.apply(a,P.features):a.push(P)}}}),s?ms(this,{geometries:a,type:"GeometryCollection"}):{type:"FeatureCollection",features:a}}});function Kr(e,n){return new Qn(e,n)}var Zc=Kr,Uo=nn.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(e,n,s){this._url=e,this._bounds=Ye(n),q(this,s)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(Ie(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){st(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=Ye(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:ne("img");if(Ie(n,"leaflet-image-layer"),this._zoomAnimated&&Ie(n,"leaflet-zoom-animated"),this.options.className&&Ie(n,this.options.className),n.onselectstart=O,n.onmousemove=O,n.onload=p(this.fire,this,"load"),n.onerror=p(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;Tt(this._image,s,n)},_reset:function(){var e=this._image,n=new Te(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),s=n.getSize();vt(e,n.min),e.style.width=s.x+"px",e.style.height=s.y+"px"},_updateOpacity:function(){Nt(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 Uo(e,n,s)},Gr=Uo.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:ne("video");if(Ie(n,"leaflet-image-layer"),this._zoomAnimated&&Ie(n,"leaflet-zoom-animated"),this.options.className&&Ie(n,this.options.className),n.onselectstart=O,n.onmousemove=O,n.onloadeddata=p(this.fire,this,"load"),e){for(var s=n.getElementsByTagName("source"),a=[],c=0;c0?a:[n.src];return}fe(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 g=0;g×',Be(a,"click",function(c){Lt(c),this.close()},this)}},_updateLayout:function(){var e=this._contentNode,n=e.style;n.width="",n.whiteSpace="nowrap";var s=e.offsetWidth;s=Math.min(s,this.options.maxWidth),s=Math.max(s,this.options.minWidth),n.width=s+1+"px",n.whiteSpace="",n.height="";var a=e.offsetHeight,c=this.options.maxHeight,g="leaflet-popup-scrolled";c&&a>c?(n.height=c+"px",Ie(e,g)):ct(e,g),this._containerWidth=this._container.offsetWidth},_animateZoom:function(e){var n=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center),s=this._getAnchor();vt(this._container,n.add(s))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var e=this._map,n=parseInt(Oi(this._container,"marginBottom"),10)||0,s=this._container.offsetHeight+n,a=this._containerWidth,c=new ee(this._containerLeft,-s-this._containerBottom);c._add(On(this._container));var g=e.layerPointToContainerPoint(c),P=he(this.options.autoPanPadding),A=he(this.options.autoPanPaddingTopLeft||P),I=he(this.options.autoPanPaddingBottomRight||P),G=e.getSize(),de=0,Ne=0;g.x+a+I.x>G.x&&(de=g.x+a-G.x+I.x),g.x-de-A.x<0&&(de=g.x-A.x),g.y+s+I.y>G.y&&(Ne=g.y+s-G.y+I.y),g.y-Ne-A.y<0&&(Ne=g.y-A.y),(de||Ne)&&(this.options.keepInView&&(this._autopanning=!0),e.fire("autopanstart").panBy([de,Ne]))}},_getAnchor:function(){return he(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Kc=function(e,n){return new Zo(e,n)};We.mergeOptions({closePopupOnClick:!0}),We.include({openPopup:function(e,n,s){return this._initOverlay(Zo,e,n,s).openOn(this),this},closePopup:function(e){return e=arguments.length?e:this._popup,e&&e.close(),this}}),nn.include({bindPopup:function(e,n){return this._popup=this._initOverlay(Zo,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 h)){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 Ho=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=ne("div",n),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+b(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(e){var n,s,a=this._map,c=this._container,g=a.latLngToContainerPoint(a.getCenter()),P=a.layerPointToContainerPoint(e),A=this.options.direction,I=c.offsetWidth,G=c.offsetHeight,de=he(this.options.offset),Ne=this._getAnchor();A==="top"?(n=I/2,s=G):A==="bottom"?(n=I/2,s=0):A==="center"?(n=I/2,s=G/2):A==="right"?(n=0,s=G/2):A==="left"?(n=I,s=G/2):P.xthis.options.maxZoom||sa?this._retainParent(c,g,P,a):!1)},_retainChildren:function(e,n,s,a){for(var c=2*e;c<2*e+2;c++)for(var g=2*n;g<2*n+2;g++){var P=new ee(c,g);P.z=s+1;var A=this._tileCoordsToKey(P),I=this._tiles[A];if(I&&I.active){I.retain=!0;continue}else I&&I.loaded&&(I.retain=!0);s+1this.options.maxZoom||this.options.minZoom!==void 0&&c1){this._setView(e,s);return}for(var Ne=c.min.y;Ne<=c.max.y;Ne++)for(var Ke=c.min.x;Ke<=c.max.x;Ke++){var Wt=new ee(Ke,Ne);if(Wt.z=this._tileZoom,!!this._isValidTile(Wt)){var Et=this._tiles[this._tileCoordsToKey(Wt)];Et?Et.current=!0:P.push(Wt)}}if(P.sort(function(Qt,vs){return Qt.distanceTo(g)-vs.distanceTo(g)}),P.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var dn=document.createDocumentFragment();for(Ke=0;Kes.max.x)||!n.wrapLat&&(e.ys.max.y))return!1}if(!this.options.bounds)return!0;var a=this._tileCoordsToBounds(e);return Ye(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),g=n.unproject(a,e.z),P=n.unproject(c,e.z);return[g,P]},_tileCoordsToBounds:function(e){var n=this._tileCoordsToNwSe(e),s=new lt(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 ee(+n[0],+n[1]);return s.z=+n[2],s},_removeTile:function(e){var n=this._tiles[e];n&&(st(n.el),delete this._tiles[e],this.fire("tileunload",{tile:n.el,coords:this._keyToTileCoords(e)}))},_initTile:function(e){Ie(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,_e.ielt9&&this.options.opacity<1&&Nt(e,this.options.opacity)},_addTile:function(e,n){var s=this._getTilePos(e),a=this._tileCoordsToKey(e),c=this.createTile(this._wrapCoords(e),p(this._tileReady,this,e));this._initTile(c),this.createTile.length<2&&Oe(p(this._tileReady,this,e,null,c)),vt(c,s),this._tiles[a]={el:c,coords:e,current:!0},n.appendChild(c),this.fire("tileloadstart",{tile:c,coords:e})},_tileReady:function(e,n,s){n&&this.fire("tileerror",{error:n,tile:s,coords:e});var a=this._tileCoordsToKey(e);s=this._tiles[a],s&&(s.loaded=+new Date,this._map._fadeAnimated?(Nt(s.el,0),Q(this._fadeFrame),this._fadeFrame=Oe(this._updateOpacity,this)):(s.active=!0,this._pruneTiles()),n||(Ie(s.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:s.el,coords:e})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),_e.ielt9||!this._map._fadeAnimated?Oe(this._pruneTiles,this):setTimeout(p(this._pruneTiles,this),250)))},_getTilePos:function(e){return e.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(e){var n=new ee(this._wrapX?k(e.x,this._wrapX):e.x,this._wrapY?k(e.y,this._wrapY):e.y);return n.z=e.z,n},_pxBoundsToTileRange:function(e){var n=this.getTileSize();return new Te(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 Hs(e)}var gs=Hs.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=q(this,n),n.detectRetina&&_e.retina&&n.maxZoom>0?(n.tileSize=Math.floor(n.tileSize/2),n.zoomReverse?(n.zoomOffset--,n.minZoom=Math.min(n.maxZoom,n.minZoom+1)):(n.zoomOffset++,n.maxZoom=Math.max(n.minZoom,n.maxZoom-1)),n.minZoom=Math.max(0,n.minZoom)):n.zoomReverse?n.minZoom=Math.min(n.maxZoom,n.minZoom):n.maxZoom=Math.max(n.minZoom,n.maxZoom),typeof n.subdomains=="string"&&(n.subdomains=n.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(e,n){return this._url===e&&n===void 0&&(n=!0),this._url=e,n||this.redraw(),this},createTile:function(e,n){var s=document.createElement("img");return Be(s,"load",p(this._tileOnLoad,this,n,s)),Be(s,"error",p(this._tileOnError,this,n,s)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(s.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(s.referrerPolicy=this.options.referrerPolicy),s.alt="",s.src=this.getTileUrl(e),s},getTileUrl:function(e){var n={r:_e.retina?"@2x":"",s:this._getSubdomain(e),x:e.x,y:e.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var s=this._globalTileRange.max.y-e.y;this.options.tms&&(n.y=s),n["-y"]=s}return K(this._url,u(n,this.options))},_tileOnLoad:function(e,n){_e.ielt9?setTimeout(p(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=me;var s=this._tiles[e].coords;st(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",me),Hs.prototype._removeTile.call(this,e)},_tileReady:function(e,n,s){if(!(!this._map||s&&s.getAttribute("src")===me))return Hs.prototype._tileReady.call(this,e,n,s)}});function Jr(e,n){return new gs(e,n)}var Xr=gs.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=q(this,n);var c=n.detectRetina&&_e.retina?2:1,g=this.getTileSize();s.width=g.x*c,s.height=g.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,gs.prototype.onAdd.call(this,e)},getTileUrl:function(e){var n=this._tileCoordsToNwSe(e),s=this._crs,a=qe(s.project(n[0]),s.project(n[1])),c=a.min,g=a.max,P=(this._wmsVersion>=1.3&&this._crs===Us?[c.y,c.x,g.y,g.x]:[c.x,c.y,g.x,g.y]).join(","),A=gs.prototype.getTileUrl.call(this,e);return A+ge(this.wmsParams,A,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+P},setParams:function(e,n){return u(this.wmsParams,e),n||this.redraw(),this}});function Jc(e,n){return new Xr(e,n)}gs.WMS=Xr,Jr.wms=Jc;var ei=nn.extend({options:{padding:.1},initialize:function(e){q(this,e),b(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),Ie(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),g=a.multiplyBy(-s).add(c).subtract(this._map._getNewPixelOrigin(e,n));_e.any3d?Tt(this._container,g,s):vt(this._container,g)},_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 Te(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");Be(e,"mousemove",this._onMouseMove,this),Be(e,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Be(e,"mouseout",this._handleMouseOut,this),e._leaflet_disable_events=!0,this._ctx=e.getContext("2d")},_destroyContainer:function(){Q(this._redrawRequest),delete this._ctx,st(this._container),ot(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var e;this._redrawBounds=null;for(var n in this._layers)e=this._layers[n],e._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){ei.prototype._update.call(this);var e=this._bounds,n=this._container,s=e.getSize(),a=_e.retina?2:1;vt(n,e.min),n.width=a*s.x,n.height=a*s.y,n.style.width=s.x+"px",n.style.height=s.y+"px",_e.retina&&this._ctx.scale(2,2),this._ctx.translate(-e.min.x,-e.min.y),this.fire("update")}},_reset:function(){ei.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(e){this._updateDashArray(e),this._layers[b(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[b(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=ne("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(ei.prototype._update.call(this),this.fire("update"))},_initPath:function(e){var n=e._container=js("shape");Ie(n,"leaflet-vml-shape "+(this.options.className||"")),n.coordsize="1 1",e._path=js("path"),n.appendChild(e._path),this._updateStyle(e),this._layers[b(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;st(n),e.removeInteractiveTarget(n),delete this._layers[b(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=js("stroke")),c.appendChild(n),n.weight=a.weight+"px",n.color=a.color,n.opacity=a.opacity,a.dashArray?n.dashStyle=fe(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=js("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)}},jo=_e.vml?js:U,Ws=ei.extend({_initContainer:function(){this._container=jo("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=jo("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){st(this._container),ot(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){ei.prototype._update.call(this);var e=this._bounds,n=e.getSize(),s=this._container;(!this._svgSize||!this._svgSize.equals(n))&&(this._svgSize=n,s.setAttribute("width",n.x),s.setAttribute("height",n.y)),vt(s,e.min),s.setAttribute("viewBox",[e.min.x,e.min.y,n.x,n.y].join(" ")),this.fire("update")}},_initPath:function(e){var n=e._path=jo("path");e.options.className&&Ie(n,e.options.className),e.options.interactive&&Ie(n,"leaflet-interactive"),this._updateStyle(e),this._layers[b(e)]=e},_addPath:function(e){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(e._path),e.addInteractiveTarget(e._path)},_removePath:function(e){st(e._path),e.removeInteractiveTarget(e._path),delete this._layers[b(e)]},_updatePath:function(e){e._project(),e._update()},_updateStyle:function(e){var n=e._path,s=e.options;n&&(s.stroke?(n.setAttribute("stroke",s.color),n.setAttribute("stroke-opacity",s.opacity),n.setAttribute("stroke-width",s.weight),n.setAttribute("stroke-linecap",s.lineCap),n.setAttribute("stroke-linejoin",s.lineJoin),s.dashArray?n.setAttribute("stroke-dasharray",s.dashArray):n.removeAttribute("stroke-dasharray"),s.dashOffset?n.setAttribute("stroke-dashoffset",s.dashOffset):n.removeAttribute("stroke-dashoffset")):n.setAttribute("stroke","none"),s.fill?(n.setAttribute("fill",s.fillColor||s.color),n.setAttribute("fill-opacity",s.fillOpacity),n.setAttribute("fill-rule",s.fillRule||"evenodd")):n.setAttribute("fill","none"))},_updatePoly:function(e,n){this._setPath(e,B(e._parts,n))},_updateCircle:function(e){var n=e._point,s=Math.max(Math.round(e._radius),1),a=Math.max(Math.round(e._radiusY),1)||s,c="a"+s+","+a+" 0 1,0 ",g=e._empty()?"M0 0":"M"+(n.x-s)+","+n.y+c+s*2+",0 "+c+-s*2+",0 ";this._setPath(e,g)},_setPath:function(e,n){e._path.setAttribute("d",n)},_bringToFront:function(e){ln(e._path)},_bringToBack:function(e){bn(e._path)}});_e.vml&&Ws.include(Xc);function tl(e){return _e.svg||_e.vml?new Ws(e):null}We.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=ps.extend({initialize:function(e,n){ps.prototype.initialize.call(this,this._boundsToLatLngs(e),n)},setBounds:function(e){return this.setLatLngs(this._boundsToLatLngs(e))},_boundsToLatLngs:function(e){return e=Ye(e),[e.getSouthWest(),e.getNorthWest(),e.getNorthEast(),e.getSouthEast()]}});function Qc(e,n){return new nl(e,n)}Ws.create=jo,Ws.pointsToPath=B,Qn.geometryToLayer=Ro,Qn.coordsToLatLng=Wa,Qn.coordsToLatLngs=Fo,Qn.latLngToCoords=Ka,Qn.latLngsToCoords=Bo,Qn.getFeature=ms,Qn.asFeature=Vo,We.mergeOptions({boxZoom:!0});var il=dt.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(){Be(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){ot(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){st(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(),Ns(),this._startPoint=this._map.mouseEventToContainerPoint(e),Be(document,{contextmenu:wn,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(e){this._moved||(this._moved=!0,this._box=ne("div","leaflet-zoom-box",this._container),Ie(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(e);var n=new Te(this._point,this._startPoint),s=n.getSize();vt(this._box,n.min),this._box.style.width=s.x+"px",this._box.style.height=s.y+"px"},_finish:function(){this._moved&&(st(this._box),ct(this._container,"leaflet-crosshair")),Ai(),Rs(),ot(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(p(this._resetState,this),0);var n=new lt(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())}});We.addInitHook("addHandler","boxZoom",il),We.mergeOptions({doubleClickZoom:!0});var sl=dt.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)}});We.addInitHook("addHandler","doubleClickZoom",sl),We.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var ol=dt.extend({addHooks:function(){if(!this._draggable){var e=this._map;this._draggable=new Xt(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))}Ie(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){ct(this._map._container,"leaflet-grab"),ct(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=Ye(this._map.options.maxBounds);this._offsetLimit=qe(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,g=(a+n+s)%e-n-s,P=Math.abs(c+s)0?g:-g))-n;this._delta=0,this._startTime=null,P&&(e.options.scrollWheelZoom==="center"?e.setZoom(n+P):e.setZoomAround(this._lastMousePos,n+P))}});We.addInitHook("addHandler","scrollWheelZoom",rl);var ed=600;We.mergeOptions({tapHold:_e.touchNative&&_e.safari&&_e.mobile,tapTolerance:15});var ll=dt.extend({addHooks:function(){Be(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){ot(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 ee(n.clientX,n.clientY),this._holdTimeout=setTimeout(p(function(){this._cancel(),this._isTapValid()&&(Be(document,"touchend",Lt),Be(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",n))},this),ed),Be(document,"touchend touchcancel contextmenu",this._cancel,this),Be(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function e(){ot(document,"touchend",Lt),ot(document,"touchend touchcancel",e)},_cancel:function(){clearTimeout(this._holdTimeout),ot(document,"touchend touchcancel contextmenu",this._cancel,this),ot(document,"touchmove",this._onMove,this)},_onMove:function(e){var n=e.touches[0];this._newPos=new ee(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)}});We.addInitHook("addHandler","tapHold",ll),We.mergeOptions({touchZoom:_e.touch,bounceAtZoomLimits:!0});var ul=dt.extend({addHooks:function(){Ie(this._map._container,"leaflet-touch-zoom"),Be(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){ct(this._map._container,"leaflet-touch-zoom"),ot(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(),Be(document,"touchmove",this._onTouchMove,this),Be(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 g=s._add(a)._divideBy(2)._subtract(this._centerPoint);if(c===1&&g.x===0&&g.y===0)return;this._center=n.unproject(n.project(this._pinchStartLatLng,this._zoom).subtract(g),this._zoom)}this._moved||(n._moveStart(!0,!1),this._moved=!0),Q(this._animRequest);var P=p(n._move,n,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=Oe(P,this,!0),Lt(e)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,Q(this._animRequest),ot(document,"touchmove",this._onTouchMove,this),ot(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))}});We.addInitHook("addHandler","touchZoom",ul),We.BoxZoom=il,We.DoubleClickZoom=sl,We.Drag=ol,We.Keyboard=al,We.ScrollWheelZoom=rl,We.TapHold=ll,We.TouchZoom=ul,o.Bounds=Te,o.Browser=_e,o.CRS=M,o.Canvas=Qr,o.Circle=Qe,o.CircleMarker=W,o.Class=ye,o.Control=jt,o.DivIcon=Yr,o.DivOverlay=Dn,o.DomEvent=Oo,o.DomUtil=Na,o.Draggable=Xt,o.Evented=re,o.FeatureGroup=Tn,o.GeoJSON=Qn,o.GridLayer=Hs,o.Handler=dt,o.Icon=cn,o.ImageOverlay=Uo,o.LatLng=Ue,o.LatLngBounds=lt,o.Layer=nn,o.LayerGroup=wi,o.LineUtil=kn,o.Map=We,o.Marker=hs,o.Mixin=bi,o.Path=h,o.Point=ee,o.PolyUtil=$o,o.Polygon=ps,o.Polyline=Xn,o.Popup=Zo,o.PosAnimation=Ii,o.Projection=Io,o.Rectangle=nl,o.Renderer=ei,o.SVG=Ws,o.SVGOverlay=qr,o.TileLayer=gs,o.Tooltip=Ho,o.Transformation=wt,o.Util=ue,o.VideoOverlay=Gr,o.bind=p,o.bounds=qe,o.canvas=el,o.circle=Bc,o.circleMarker=T,o.control=Di,o.divIcon=qc,o.extend=u,o.featureGroup=pt,o.geoJSON=Kr,o.geoJson=Zc,o.gridLayer=Yc,o.icon=Zs,o.imageOverlay=Hc,o.latLng=j,o.latLngBounds=Ye,o.layerGroup=fs,o.map=rs,o.marker=w,o.point=he,o.polygon=Uc,o.polyline=Vc,o.popup=Kc,o.rectangle=Qc,o.setOptions=q,o.stamp=b,o.svg=tl,o.svgOverlay=Wc,o.tileLayer=Jr,o.tooltip=Gc,o.transformation=m,o.version=l,o.videoOverlay=jc;var td=window.L;o.noConflict=function(){return window.L=td,this},window.L=o}))})(eo,eo.exports)),eo.exports}var nm=tm();const Qo=Qp(nm),cu={__name:"DeviceMap",props:{position:{type:Object,default:null},trail:{type:Array,default:()=>[]}},setup(t){const i=t,o=H(null);let l,u,d;function p(){if(!l)return;const _=i.position;if(_&&(_.lat||_.lng)){const b=[_.lat,_.lng];u?u.setLatLng(b):(u=Qo.marker(b).addTo(l),l.setView(b,17))}if(d&&d.remove(),i.trail.length){const b=getComputedStyle(document.documentElement).getPropertyValue("--accent").trim()||"#3D7BF0";d=Qo.polyline(i.trail,{color:b,weight:3}).addTo(l)}}return ui(()=>{l=Qo.map(o.value,{zoomControl:!0}).setView([20,0],2),Qo.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:"© OpenStreetMap",maxZoom:19}).addTo(l),setTimeout(()=>l.invalidateSize(),60),p()}),en(()=>i.position,p,{deep:!0}),en(()=>i.trail,p,{deep:!0}),(_,b)=>(v(),y("div",{ref_key:"el",ref:o,class:"h-[320px] w-full rounded-lg"},null,512))}},im=["width","height","stroke-width"],sm=["d"],Y={__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)=>(v(),y("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"},[(v(!0),y(ae,null,Fe(Re(l),(p,_)=>(v(),y("path",{key:_,d:p},null,8,sm))),128))],8,im))}},om=["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)=>(v(),y("button",{type:"button",role:"switch","aria-checked":t.modelValue,disabled:t.disabled,class:Me(["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:Me(["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,om))}},am={class:"inline-flex rounded-[10px] border border-line bg-surface-2 p-0.5"},rm=["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)=>(v(),y("div",am,[(v(!0),y(ae,null,Fe(t.options,d=>(v(),y("button",{key:d.value,type:"button",class:Me(["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:p=>o("update:modelValue",d.value)},[d.icon?(v(),et(Y,{key:0,name:d.icon,size:15},null,8,["name"])):D("",!0),$(" "+S(d.label),1)],10,rm))),128))]))}},lm={class:"text-sm font-semibold text-ink"},um={key:0,class:"mt-0.5 text-xs text-ink-muted"},Se={__name:"Row",props:{title:{type:String,default:""},desc:{type:String,default:""},keywords:{type:String,default:""},block:{type:Boolean,default:!1}},setup(t){const i=t,o=so("settingsSearch",{value:""}),l=xe(()=>{const u=(o.value||"").trim().toLowerCase();return u?`${i.title} ${i.desc} ${i.keywords}`.toLowerCase().includes(u):!0});return(u,d)=>l.value?(v(),y("div",{key:0,class:Me(["border-b border-line py-4 last:border-0",t.block?"":"flex items-center justify-between gap-6"])},[r("div",{class:Me(t.block?"mb-3":"min-w-0")},[r("div",lm,S(t.title),1),t.desc?(v(),y("div",um,S(t.desc),1)):D("",!0)],2),r("div",{class:Me(t.block?"":"shrink-0")},[xf(u.$slots,"default")],2)],2)):D("",!0)}},cm=(t,i)=>{const o=t.__vccOpts||t;for(const[l,u]of i)o[l]=u;return o},dm={class:"mx-auto max-w-[1280px] p-7"},fm={class:"mb-5 flex flex-wrap items-end justify-between gap-4"},hm={class:"flex h-10 w-full max-w-[280px] items-center gap-2 rounded border border-line-strong bg-surface-1 px-3"},pm={class:"grid grid-cols-[210px_1fr] gap-6 max-[760px]:grid-cols-1"},mm={class:"flex flex-col gap-0.5 max-[760px]:flex-row max-[760px]:overflow-x-auto"},gm=["onClick"],vm={class:"whitespace-nowrap"},_m={class:"min-w-0"},ym={key:0,class:"panel p-10 text-center text-sm text-ink-muted"},bm={key:0,class:"eyebrow mb-2 mt-5 first:mt-0 flex items-center gap-2"},xm={key:1,class:"panel mb-5 p-5"},wm={class:"flex items-center gap-1"},km={class:"flex items-center gap-2"},Sm={class:"font-mono text-sm text-ink"},Tm={class:"inline-flex items-center gap-1 rounded-full bg-amber-soft px-2 py-0.5 text-[11px] font-semibold text-amber-fg"},Pm={key:0,class:"mt-2 text-xs text-ink-muted"},Cm={class:"grid max-w-[420px] gap-2"},Lm={class:"flex items-center gap-3"},Mm={key:2,class:"panel mb-5 p-5"},Em=["value"],Om=["value"],zm=["value"],Am={class:"font-mono text-sm text-ink"},$m={key:3},Im={key:0,class:"mb-5 flex items-center gap-1 overflow-x-auto border-b border-line"},Dm=["onClick"],Nm={key:1,class:"panel mb-5 p-5"},Rm={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},Fm={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},Bm={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},Vm={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"},Um={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},Zm={key:0},Hm={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},jm={class:"font-semibold text-ink-secondary"},Wm={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},Km={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"},Gm={class:"flex items-center justify-between gap-3"},qm={class:"flex items-center gap-2 text-sm font-semibold text-ink"},Ym={key:0,class:"text-[11px] text-ink-muted"},Jm={class:"mt-2 flex items-baseline gap-1.5"},Xm={class:"font-mono text-2xl font-semibold text-ink"},Qm={class:"text-sm text-ink-muted"},eg={class:"mt-2 h-2 w-full overflow-hidden rounded-full bg-line"},tg={class:"mt-2 text-xs text-ink-muted"},ng={class:"mt-2 text-sm text-ink"},ig={class:"font-semibold"},sg={class:"mt-1 text-xs text-ink-muted"},og={key:1,class:"mt-2 text-xs text-ink-muted"},ag={key:0,class:"inline-flex items-center gap-2 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"},lg={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"},cg={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"},fg={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"},pg={key:8,class:"border-b border-line py-3 text-xs text-amber-fg"},mg={class:"mt-4 flex flex-wrap items-center gap-3"},gg=["disabled"],vg=["disabled"],_g={key:2,class:"text-xs text-danger-fg"},yg={class:"panel mb-5 p-5"},bg={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},xg={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},wg={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},kg={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"},Sg={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},Tg={key:0},Pg={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},Cg={class:"font-semibold text-ink-secondary"},Lg={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},Mg={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},Eg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Og={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},zg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Ag={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},$g={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},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 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={class:"mt-4 flex flex-wrap items-center gap-3"},Yg=["disabled"],Jg=["disabled"],Xg={key:2,class:"text-xs text-danger-fg"},Qg={key:3,class:"text-[11px] text-ink-muted"},ev={class:"panel mb-5 p-5"},tv={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},nv={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},iv={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},sv={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"},ov={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},av={key:0},rv={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},lv={class:"font-semibold text-ink-secondary"},uv={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},cv={key:0,class:"inline-flex items-center gap-2 break-all font-mono text-sm text-ink"},dv={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},fv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},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"},pv={key:0,class:"inline-flex items-center gap-2 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 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={class:"mt-4 flex flex-wrap items-center gap-3"},xv=["disabled"],wv=["disabled"],kv={key:2,class:"text-xs text-danger-fg"},Sv={key:3,class:"text-[11px] text-ink-muted"},Tv={key:3,class:"panel mb-5 p-5"},Pv={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},Cv={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},Lv={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},Mv={key:1,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},Ev={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"},Ov={key:5,class:"border-b border-line py-3 text-xs text-amber-fg"},zv={key:0},Av={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},$v={class:"font-semibold text-ink-secondary"},Iv={key:7,class:"border-b border-line py-3 text-xs text-ink-muted"},Dv={class:"flex w-full flex-col gap-2"},Nv={class:"break-all font-mono text-sm text-ink"},Rv={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Fv={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"},Bv={key:0,class:"text-xs text-ink-muted"},Vv={key:1,class:"border-b border-line py-3 text-xs text-ink-muted"},Uv={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},Zv={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Hv={class:"mt-4 flex flex-wrap items-center gap-3"},jv=["disabled"],Wv=["disabled"],Kv={key:2,class:"text-xs text-danger-fg"},Gv={key:3,class:"text-[11px] text-ink-muted"},qv={key:4,class:"panel mb-5 p-5"},Yv={class:"flex items-center gap-4"},Jv=["src"],Xv={key:1,class:"grid h-16 w-16 place-items-center rounded-full bg-[var(--navy-800)] text-lg font-bold text-white"},Qv={class:"flex gap-2"},e_={class:"btn-ghost cursor-pointer"},t_={class:"mt-1 text-right text-[11px] text-ink-muted"},n_={key:5,class:"panel mb-5 p-5"},i_={class:"flex items-center gap-3"},s_={key:0,class:"mt-4 rounded-lg border border-line bg-surface-2 p-4"},o_={class:"flex flex-wrap items-center gap-4"},a_={class:"min-w-0"},r_={class:"mt-1 select-all font-mono text-sm font-bold text-ink"},l_={class:"mt-3 flex items-center gap-2"},u_={key:0,class:"mt-2 text-xs text-danger-fg"},c_={key:1,class:"mt-4 rounded-lg border border-line bg-surface-2 p-4"},d_={class:"mt-2 grid grid-cols-2 gap-1 font-mono text-xs text-ink-secondary sm:grid-cols-4"},f_={class:"rounded-lg border border-line bg-surface-2 p-3"},h_={class:"flex items-center gap-3"},p_={class:"grid h-9 w-9 place-items-center rounded-full bg-accent-soft text-accent-soft-fg"},m_={class:"min-w-0 flex-1"},g_={class:"text-sm font-semibold text-ink"},v_={class:"font-mono text-[11px] text-ink-muted"},__={key:6,class:"mb-5"},y_={key:0,class:"panel mb-5 p-5"},b_={class:"grid max-w-[520px] gap-2"},x_={class:"flex flex-wrap gap-2"},w_=["disabled","title"],k_=["value"],S_=["value"],T_={class:"flex items-center gap-2 py-1 text-sm text-ink-secondary"},P_={class:"flex items-center gap-3"},C_=["disabled"],L_={key:0,class:"text-xs text-danger-fg"},M_={key:1,class:"text-xs text-ink-muted"},E_={key:1,class:"panel mb-5 p-5"},O_={class:"grid max-w-[520px] gap-2"},z_={class:"flex flex-wrap gap-2"},A_=["value"],$_=["value"],I_={key:1,class:"text-xs text-ink-muted"},D_={class:"font-semibold text-ink-secondary"},N_={class:"flex items-center gap-3"},R_=["disabled"],F_={key:0,class:"text-xs text-danger-fg"},B_={class:"panel overflow-hidden p-0"},V_={class:"flex items-center justify-between px-5 py-4"},U_=["disabled"],Z_={key:0,class:"px-5 pb-5 text-sm text-danger-fg"},H_={key:1,class:"px-5 pb-8 text-sm text-ink-muted"},j_={key:2,class:"overflow-x-auto"},W_={class:"w-full border-collapse text-sm"},K_={class:"text-left"},G_={class:"px-5 py-3"},q_={class:"text-ink"},Y_={key:0,class:"ml-1.5 text-[11px] text-ink-muted"},J_={class:"px-5 py-3"},X_={class:"px-5 py-3"},Q_={class:"px-5 py-3"},ey={class:"px-5 py-3 text-right"},ty=["onClick"],ny={key:1,class:"inline-flex items-center gap-1.5"},iy=["onClick"],sy=["onClick"],oy={key:7,class:"mb-5"},ay={key:0,class:"panel mb-5 p-5"},ry={class:"grid max-w-[520px] gap-2"},ly={class:"flex items-center gap-3"},uy={key:0,class:"text-xs text-danger-fg"},cy={key:1,class:"panel mb-5 p-5"},dy={class:"grid max-w-[520px] gap-2"},fy={class:"flex items-center gap-3"},hy=["disabled"],py={key:0,class:"text-xs text-danger-fg"},my={class:"panel overflow-hidden p-0"},gy={key:0,class:"px-5 pb-8 text-sm text-ink-muted"},vy={key:1,class:"overflow-x-auto"},_y={class:"w-full border-collapse text-sm"},yy={class:"text-left"},by={class:"px-5 py-3"},xy={class:"inline-flex items-center gap-2 text-ink"},wy={class:"px-5 py-3 text-ink-secondary"},ky={class:"px-5 py-3 text-right"},Sy=["onClick"],Ty={key:1,class:"inline-flex items-center gap-1.5"},Py=["onClick"],Cy=["disabled","title","onClick"],Ly={key:8,class:"mb-5"},My={class:"panel mb-5 p-5"},Ey={class:"btn-ghost cursor-pointer"},Oy={key:0,class:"mt-2 text-xs text-ink-muted"},zy={class:"rounded-lg border p-5",style:{"border-color":"color-mix(in srgb, var(--danger) 35%, transparent)",background:"var(--danger-soft)"}},Ay={class:"flex items-center gap-2 text-danger-fg"},$y={class:"mt-4 rounded-lg border border-line bg-surface-1 p-4"},Iy={class:"mt-3 flex items-start gap-2 text-sm text-ink-secondary"},Dy={class:"mt-3"},Ny={class:"eyebrow mb-1 block"},Ry={class:"text-ink"},Fy=["placeholder"],By={class:"mt-4 flex flex-wrap items-center gap-3"},Vy=["disabled"],Uy=["disabled"],Zy={key:2,class:"text-xs text-ink-muted"},Hy={key:0,class:"mt-3 rounded border border-line bg-surface-2 px-3 py-2 text-xs text-ink-secondary"},jy={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",Wy={__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=xe(()=>o.role==="superadmin"),d=xe(()=>o.role==="admin"||o.role==="superadmin");function p(w){return w==="superadmin"?"Superadmin":w==="admin"?"Admin":"User"}function _(w){return w==="superadmin"||w==="admin"?"shield":"user"}function b(w){return w==="superadmin"||w==="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"},k=xe(()=>{const w=[{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&&w.push({id:"team",label:"User management",icon:"users",kw:"users team members add remove create delete role admin permissions rights organization"}),u.value&&w.push({id:"organizations",label:"Organizations",icon:"grid",kw:"organization org tenant company create rename delete members"}),w.push({id:"advanced",label:"Advanced",icon:"alertTriangle",kw:"export import data delete account danger zone",danger:!0}),w}),O=H("account"),R=H("");ju("settingsSearch",R);const F=xe(()=>R.value.trim().length>0),X=xe(()=>R.value.trim().toLowerCase());function q(w){return X.value?(w.label+" "+w.kw).toLowerCase().includes(X.value)||we(w.id):!0}const ge={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 we(w){return X.value?(ge[w]||[]).some(h=>h.includes(X.value)):!0}const K=xe(()=>F.value?k.value.filter(q):k.value.filter(w=>w.id===O.value)),fe=xe({get:()=>Xi.value,set:w=>ha(w)}),ie=[{value:"light",label:"Light",icon:"sun"},{value:"dark",label:"Dark",icon:"moon"},{value:"system",label:"System",icon:"monitor"}],me=[{value:"sm",label:"Small"},{value:"md",label:"Default"},{value:"lg",label:"Large"}],Le=[{value:"12",label:"12-hour"},{value:"24",label:"24-hour"}],Ee=[["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"]],$e=H(Date.now());let Oe=null;const Q=xe(()=>ru($e.value)),ue=xt({loaded:!1,available:!1,orgEnabled:!0,allowAnonymous:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),ye=H("user"),ze=xt({clientId:"",clientSecret:"",plan:"",bbox:""}),ce=H(""),re=H(!1),ee=H(!1),nt=H(null),he=H(null),Te=xe(()=>nt.value&&nt.value.credits||null),qe=xe(()=>{const w=Te.value;return!w||!w.daily||w.remaining==null?null:Math.max(0,Math.min(100,Math.round(w.remaining/w.daily*100)))}),lt=xe(()=>{const w=qe.value;return w==null?"bg-accent":w<=10?"bg-danger":w<=30?"bg-amber":"bg-success"});function Ye(w){return typeof w=="number"?w.toLocaleString():w}function Ue(){if(!he.value)return"";const w=Math.max(0,Math.round((Date.now()-he.value)/1e3));if(w<60)return"just now";const h=Math.round(w/60);if(h<60)return`${h} min ago`;const W=Math.round(h/60);return W<24?`${W} h ago`:`${Math.round(W/24)} d ago`}function j(){try{nt.value&&localStorage.setItem(du,JSON.stringify({health:nt.value,ts:he.value}))}catch{}}function M(){try{const w=localStorage.getItem(du);if(!w)return;const h=JSON.parse(w);h&&h.health&&(nt.value=h.health,he.value=h.ts||null)}catch{}}const z=[{value:"",label:"Not set"},{value:"anonymous",label:"Anonymous"},{value:"standard",label:"Standard"},{value:"contributor",label:"Contributor"}],ut=[{value:"user",label:"My settings",icon:"user"},{value:"org",label:"Organization",icon:"users"}],it=xe(()=>ue.isSuperadmin),wt=xe(()=>ue.isSuperadmin?"user":ye.value),m=xe(()=>ue.scopes[wt.value]||{editableLayer:"user",fields:{}}),f=xe(()=>wt.value==="org");function x(w){return m.value.fields[w]||{effective:"",own:"",source:"unset",locked:!1}}function U(w){return it.value||x(w).locked}function B(w){const h=x(w).source;return h==="global"?"Set by administrator":h==="org"?"Set by your organization":""}function V(){ze.clientId=x("clientId").own||"",ze.clientSecret=x("clientSecret").own||"",ze.plan=x("plan").own||"",ze.bbox=x("bbox").own||""}function te(w){ue.available=!!w.available,ue.orgEnabled=w.orgEnabled!==!1,ue.allowAnonymous=!!w.allowAnonymous,ue.enabled=!!w.enabled,ue.canEditOrg=!!w.canEditOrg,ue.isSuperadmin=!!w.isSuperadmin,ue.scopes=w.scopes||{},ye.value==="org"&&!ue.canEditOrg&&(ye.value="user"),V(),ue.loaded=!0}en(ye,()=>{ce.value="",V()});async function N(){M();const{ok:w,body:h}=await up();w&&te(h)}async function J(w){const h=f.value;h?ue.orgEnabled=w:ue.enabled=w;const{ok:W,body:T}=await iu(h?{scope:"org",enabled:w}:{scope:"user",enabled:w});W?(te(T),Je(h?w?"OpenSky enabled for your organization.":"OpenSky disabled for your organization.":w?"OpenSky enabled.":"OpenSky disabled.")):(h?ue.orgEnabled=!w:ue.enabled=!w,Je(T.error||"Could not update."))}async function Z(){ce.value="",re.value=!0;const w={};for(const Qe of["clientId","clientSecret","plan","bbox"])U(Qe)||(w[Qe]=ze[Qe]);const h={scope:wt.value,config:w};f.value||(h.enabled=ue.enabled);const{ok:W,body:T}=await iu(h);if(re.value=!1,!W){ce.value=T.error||"Could not save settings.";return}te(T),Je(f.value?"Organization OpenSky settings saved.":"OpenSky settings saved.")}async function Pe(){ee.value=!0,nt.value=null;const{ok:w,body:h}=await cp();ee.value=!1,nt.value=w&&h.health?h.health:{status:"down",detail:h.error||"Probe failed."},he.value=Date.now(),j()}function le(w){return w==="ok"?C.success:w==="degraded"?C.warning:C.danger}const se=xt({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),Ce=H("user"),He=["protocol","host","port","username","password","privateKey","keyPassphrase","hostKeyFingerprint","insecureSkipVerify","basePath"],ke=xt(Object.fromEntries(He.map(w=>[w,""]))),Ge=H(""),ft=H(!1),gt=H(!1),yt=H(null),Ct=H(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"}],St=xe(()=>se.isSuperadmin),Dt=xe(()=>se.isSuperadmin?"user":Ce.value),En=xe(()=>se.scopes[Dt.value]||{editableLayer:"user",fields:{}}),Ut=xe(()=>Dt.value==="org"),Qi=xe(()=>(Zt("protocol")?At("protocol").effective:ke.protocol)||"sftp");function At(w){return En.value.fields[w]||{effective:"",own:"",source:"unset",locked:!1}}function Zt(w){return St.value||At(w).locked}function bt(w){const h=At(w).source;return h==="global"?"Set by administrator":h==="org"?"Set by your organization":""}function Pa(w){return(_n.find(h=>h.value===w)||{}).label||w||"—"}function xo(){for(const w of He)ke[w]=At(w).own||"";ke.protocol||(ke.protocol="sftp"),ke.insecureSkipVerify||(ke.insecureSkipVerify="false")}function Es(w){se.available=!!w.available,se.orgEnabled=w.orgEnabled!==!1,se.enabled=!!w.enabled,se.canEditOrg=!!w.canEditOrg,se.isSuperadmin=!!w.isSuperadmin,se.scopes=w.scopes||{},Ce.value==="org"&&!se.canEditOrg&&(Ce.value="user"),xo(),se.loaded=!0}en(Ce,()=>{Ge.value="",xo()});function Ca(){if(!Ct.value)return"";const w=Math.max(0,Math.round((Date.now()-Ct.value)/1e3));if(w<60)return"just now";const h=Math.round(w/60);if(h<60)return`${h} min ago`;const W=Math.round(h/60);return W<24?`${W} h ago`:`${Math.round(W/24)} d ago`}function La(){try{yt.value&&localStorage.setItem(fu,JSON.stringify({health:yt.value,ts:Ct.value}))}catch{}}function Ma(){try{const w=localStorage.getItem(fu);if(!w)return;const h=JSON.parse(w);h&&h.health&&(yt.value=h.health,Ct.value=h.ts||null)}catch{}}async function Os(){Ma();const{ok:w,body:h}=await dp();w&&Es(h)}async function wo(w){const h=Ut.value;h?se.orgEnabled=w:se.enabled=w;const{ok:W,body:T}=await su(h?{scope:"org",enabled:w}:{scope:"user",enabled:w});W?(Es(T),Je(h?w?"File transfer enabled for your organization.":"File transfer disabled for your organization.":w?"File transfer enabled.":"File transfer disabled.")):(h?se.orgEnabled=!w:se.enabled=!w,Je(T.error||"Could not update."))}async function Ea(){Ge.value="",ft.value=!0;const w={};for(const Qe of He)Zt(Qe)||(w[Qe]=ke[Qe]);const h={scope:Dt.value,config:w};Ut.value||(h.enabled=se.enabled);const{ok:W,body:T}=await su(h);if(ft.value=!1,!W){Ge.value=T.error||"Could not save settings.";return}Es(T),Je(Ut.value?"Organization file-transfer settings saved.":"File-transfer settings saved.")}async function Oa(){gt.value=!0,yt.value=null;const{ok:w,body:h}=await fp();gt.value=!1,yt.value=w&&h.health?h.health:{status:"down",detail:h.error||"Probe failed."},Ct.value=Date.now(),La()}function za(w){return w==="ok"?C.success:w==="degraded"?C.warning:C.danger}const je=xt({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),_e=H("user"),es=["baseURL","username","password","insecureSkipVerify","basePath"],$t=xt(Object.fromEntries(es.map(w=>[w,""]))),fi=H(""),Ei=H(!1),hi=H(!1),an=H(null),tn=H(null),ko=[{value:"false",label:"Verify certificate"},{value:"true",label:"Skip verification"}],zs=xe(()=>je.isSuperadmin),As=xe(()=>je.isSuperadmin?"user":_e.value),Aa=xe(()=>je.scopes[As.value]||{editableLayer:"user",fields:{}}),rn=xe(()=>As.value==="org");function yn(w){return Aa.value.fields[w]||{effective:"",own:"",source:"unset",locked:!1}}function pi(w){return zs.value||yn(w).locked}function Ht(w){const h=yn(w).source;return h==="global"?"Set by administrator":h==="org"?"Set by your organization":""}function So(){for(const w of es)$t[w]=yn(w).own||"";$t.insecureSkipVerify||($t.insecureSkipVerify="false")}function $s(w){je.available=!!w.available,je.orgEnabled=w.orgEnabled!==!1,je.enabled=!!w.enabled,je.canEditOrg=!!w.canEditOrg,je.isSuperadmin=!!w.isSuperadmin,je.scopes=w.scopes||{},_e.value==="org"&&!je.canEditOrg&&(_e.value="user"),So(),je.loaded=!0}en(_e,()=>{fi.value="",So()});function $a(){if(!tn.value)return"";const w=Math.max(0,Math.round((Date.now()-tn.value)/1e3));if(w<60)return"just now";const h=Math.round(w/60);if(h<60)return`${h} min ago`;const W=Math.round(h/60);return W<24?`${W} h ago`:`${Math.round(W/24)} d ago`}function Ia(){try{an.value&&localStorage.setItem(hu,JSON.stringify({health:an.value,ts:tn.value}))}catch{}}function Da(){try{const w=localStorage.getItem(hu);if(!w)return;const h=JSON.parse(w);h&&h.health&&(an.value=h.health,tn.value=h.ts||null)}catch{}}async function Is(){Da();const{ok:w,body:h}=await mp();w&&$s(h)}async function mi(w){const h=rn.value;h?je.orgEnabled=w:je.enabled=w;const{ok:W,body:T}=await ou(h?{scope:"org",enabled:w}:{scope:"user",enabled:w});W?($s(T),Je(h?w?"WebDAV enabled for your organization.":"WebDAV disabled for your organization.":w?"WebDAV enabled.":"WebDAV disabled.")):(h?je.orgEnabled=!w:je.enabled=!w,Je(T.error||"Could not update."))}async function To(){fi.value="",Ei.value=!0;const w={};for(const Qe of es)pi(Qe)||(w[Qe]=$t[Qe]);const h={scope:As.value,config:w};rn.value||(h.enabled=je.enabled);const{ok:W,body:T}=await ou(h);if(Ei.value=!1,!W){fi.value=T.error||"Could not save settings.";return}$s(T),Je(rn.value?"Organization WebDAV settings saved.":"WebDAV settings saved.")}async function Po(){hi.value=!0,an.value=null;const{ok:w,body:h}=await gp();hi.value=!1,an.value=w&&h.health?h.health:{status:"down",detail:h.error||"Probe failed."},tn.value=Date.now(),Ia()}function Oi(w){return w==="ok"?C.success:w==="degraded"?C.warning:C.danger}const ne=xt({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,isOrgUser:!1,mounts:[],privateFolder:!1,privateEnabled:!1,allowPrivate:!0,rootConfigured:!1,scopes:{}}),st=H("user"),jn=H(""),ln=H(""),bn=H(!1),gi=H(!1),Ie=H(null),ct=H(null),Wn=H({}),zi=[{value:"",label:"Inherit"},{value:"false",label:"Read-write"},{value:"true",label:"Read-only"}],Nt=xe(()=>ne.isSuperadmin),Ds=xe(()=>ne.isSuperadmin?"user":st.value),ts=xe(()=>ne.scopes[Ds.value]||{editableLayer:"user",fields:{}}),Tt=xe(()=>Ds.value==="org");function vt(w){return ts.value.fields[w]||{effective:"",own:"",source:"unset",locked:!1}}function On(w){return Nt.value||vt(w).locked}function vi(w){const h=vt(w).source;return h==="global"?"Set by administrator":h==="org"?"Set by your organization":""}function Ai(w){return(zi.find(h=>h.value===w)||{}).label||"Inherit"}function ns(){jn.value=vt("readOnly").own||""}function xn(w){ne.available=!!w.available,ne.orgEnabled=w.orgEnabled!==!1,ne.enabled=!!w.enabled,ne.canEditOrg=!!w.canEditOrg,ne.isSuperadmin=!!w.isSuperadmin,ne.isOrgUser=!!w.isOrgUser,ne.mounts=Array.isArray(w.mounts)?w.mounts:[],ne.privateFolder=!!w.privateFolder,ne.privateEnabled=!!w.privateEnabled,ne.allowPrivate=w.allowPrivate!==!1,ne.rootConfigured=!!w.rootConfigured,ne.scopes=w.scopes||{},st.value==="org"&&!ne.canEditOrg&&(st.value="user"),ns(),ne.loaded=!0}en(st,()=>{ln.value="",ns()});function Ns(){if(!ct.value)return"";const w=Math.max(0,Math.round((Date.now()-ct.value)/1e3));if(w<60)return"just now";const h=Math.round(w/60);if(h<60)return`${h} min ago`;const W=Math.round(h/60);return W<24?`${W} h ago`:`${Math.round(W/24)} d ago`}function Rs(){try{Ie.value&&localStorage.setItem(pu,JSON.stringify({health:Ie.value,ts:ct.value}))}catch{}}function is(){try{const w=localStorage.getItem(pu);if(!w)return;const h=JSON.parse(w);h&&h.health&&(Ie.value=h.health,ct.value=h.ts||null)}catch{}}async function Fs(){is();const{ok:w,body:h}=await hp();w&&xn(h)}async function ss(w){const h=Tt.value;h?ne.orgEnabled=w:ne.enabled=w;const{ok:W,body:T}=await Xo(h?{scope:"org",enabled:w}:{scope:"user",enabled:w});W?(xn(T),Je(h?w?"Local storage enabled for your organization.":"Local storage disabled for your organization.":w?"Local storage enabled.":"Local storage disabled.")):(h?ne.orgEnabled=!w:ne.enabled=!w,Je(T.error||"Could not update."))}async function os(w){ne.privateFolder=w;const{ok:h,body:W}=await Xo({scope:"user",privateFolder:w});h?(xn(W),Je(w?"Private folder enabled.":"Private folder disabled.")):(ne.privateFolder=!w,Je(W.error||"Could not update."))}async function Co(w){ne.allowPrivate=w;const{ok:h,body:W}=await Xo({scope:"org",allowPrivate:w});h?(xn(W),Je(w?"Members may now create private folders.":"Private folders disabled for your organization.")):(ne.allowPrivate=!w,Je(W.error||"Could not update."))}async function Bs(){ln.value="",bn.value=!0;const w={};On("readOnly")||(w.readOnly=jn.value);const h={scope:Ds.value,config:w};Tt.value||(h.enabled=ne.enabled);const{ok:W,body:T}=await Xo(h);if(bn.value=!1,!W){ln.value=T.error||"Could not save settings.";return}xn(T),Je(Tt.value?"Organization local-storage settings saved.":"Local-storage settings saved.")}async function Na(){gi.value=!0,Ie.value=null,Wn.value={};const{ok:w,body:h}=await pp();gi.value=!1,Ie.value=w&&h.health?h.health:{status:"down",detail:h.error||"Probe failed."};const W={};if(Array.isArray(h.mounts))for(const T of h.mounts)W[T.id]={status:T.status,detail:T.detail};Wn.value=W,ct.value=Date.now(),Rs()}function Be(w){return w==="ok"?C.success:w==="degraded"?C.warning:C.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"}],ot=H("apis-external");function as(w){return F.value||ot.value===w}const _i=H("");let $i=null;function Je(w){_i.value=w,clearTimeout($i),$i=setTimeout(()=>_i.value="",2200)}const kt=xt({current:"",next:"",confirm:""}),zn=H(""),yi=H(!1);function Lt(){if(yi.value=!1,!kt.current)return zn.value="Enter your current password.";if(kt.next.length<8)return zn.value="New password must be at least 8 characters.";if(kt.next!==kt.confirm)return zn.value="New passwords do not match.";zn.value="Validated. Connecting to the account service is pending — no password endpoint yet.",kt.current=kt.next=kt.confirm=""}const wn=H("");function Lo(){wn.value="Verification link would be sent once the account service is wired up."}function Mo(w){const h=w.target.files&&w.target.files[0];if(!h)return;if(h.size>1.5*1024*1024){Je("Image too large (max ~1.5 MB).");return}const W=new FileReader;W.onload=()=>{De.avatar=String(W.result),Je("Photo updated.")},W.readAsDataURL(h)}function Ra(){De.avatar="",Je("Photo removed.")}const Eo=xe(()=>{var W,T,Qe;const h=(De.displayName||De.name||o.email||"PV").split("@")[0].split(/[.\-_ ]+/).filter(Boolean);return((((W=h[0])==null?void 0:W[0])||"P")+(((T=h[1])==null?void 0:T[0])||((Qe=h[0])==null?void 0:Qe[1])||"V")).toUpperCase()}),Kn=H(!1),Oo=H(""),Ii=H(""),We=H(""),rs=H([]);function jt(w){const h="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";let W="";for(let T=0;Tjt(4).toLowerCase()+"-"+jt(4).toLowerCase()),We.value=""}function Fa(){De.twoFactor=!1,rs.value=[],Kn.value=!1}const Jt=navigator.userAgent;function Ba(){return/Edg\//.test(Jt)?"Edge":/OPR\//.test(Jt)?"Opera":/Chrome\//.test(Jt)?"Chrome":/Firefox\//.test(Jt)?"Firefox":/Safari\//.test(Jt)?"Safari":"Browser"}function Ao(){return/Windows/.test(Jt)?"Windows":/Mac OS X/.test(Jt)?"macOS":/Android/.test(Jt)?"Android":/iPhone|iPad/.test(Jt)?"iOS":/Linux/.test(Jt)?"Linux":"Unknown OS"}const Va=Date.now(),ls=H([]),Gn=H(!1),us=H(""),dt=xt({email:"",password:"",role:"user",organization:""}),bi=H(""),Ni=H(!1),Xt=H(""),Vs=xe(()=>{const w=[{value:"user",label:"User"},{value:"admin",label:"Admin"}];return u.value&&w.push({value:"superadmin",label:"Superadmin"}),w}),Ri=H([]);async function qn(){if(!d.value)return;const w=await ip();w.ok&&(Ri.value=w.organizations.slice().sort((h,W)=>h.name.localeCompare(W.name)))}const $o=xe(()=>{const w=Ri.value.map(h=>({value:h.id,label:h.name}));return u.value&&w.unshift({value:"",label:"No organization"}),w});async function Yn(){if(!d.value)return;Gn.value=!0,us.value="";const w=await Qh();if(Gn.value=!1,!w.ok){us.value=w.status===403?"Manager role required.":"Could not load users.";return}ls.value=w.users.slice().sort((h,W)=>h.email.localeCompare(W.email))}function Fi(w){try{const h=w.data||{},W=Object.keys(h)[0];return W&&h[W]&&h[W].message||w.message||w.error||"Invalid input."}catch{return w.error||"Could not create user."}}async function Ua(){bi.value="";const w=dt.email.trim().toLowerCase();if(!w.includes("@"))return bi.value="Enter a valid email.";if(dt.password.length<8)return bi.value="Password must be at least 8 characters.";Ni.value=!0;const h=u.value?dt.organization:o.organization,{ok:W,body:T}=await ep(w,dt.password,dt.role,h);if(Ni.value=!1,!W)return bi.value=Fi(T);dt.email="",dt.password="",dt.role="user",dt.organization="",Je("User created."),Yn()}async function Za(w){const{ok:h,body:W}=await np(w.id);if(Xt.value="",!h)return Je(W.error||"Could not remove user.");Je("User removed."),Yn()}const Xe=xt({id:"",email:"",role:"user",verified:!1,password:"",organization:""}),An=H(""),Bi=H(!1),cs=xe(()=>!!Xe.id&&Xe.email===o.email);function ds(w){Xt.value="",Xe.id=w.id,Xe.email=w.email,Xe.role=w.role||"user",Xe.verified=!!w.verified,Xe.password="",Xe.organization=w.organization||"",An.value=""}function $n(){Xe.id="",An.value=""}async function Ha(){An.value="";const w=Xe.email.trim().toLowerCase();if(!w.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 h={email:w,role:Xe.role,verified:Xe.verified};u.value&&(h.organization=Xe.organization),Xe.password&&(h.password=Xe.password),Bi.value=!0;const{ok:W,body:T}=await tp(Xe.id,h);if(Bi.value=!1,!W)return An.value=Fi(T);Je("User updated."),$n(),Yn()}const In=xt({name:""}),Mt=H(""),Vi=H(!1),xi=H(""),kn=xt({id:"",name:""}),Sn=H(""),Ui=xe(()=>{const w={};for(const h of ls.value)h.organization&&(w[h.organization]=(w[h.organization]||0)+1);return w});async function Io(){Mt.value="";const w=In.name.trim();if(!w)return Mt.value="Enter an organization name.";Vi.value=!0;const{ok:h,body:W}=await sp(w);if(Vi.value=!1,!h)return Mt.value=Fi(W);In.name="",Je("Organization created."),qn()}function ja(w){xi.value="",kn.id=w.id,kn.name=w.name,Sn.value=""}function Us(){kn.id="",Sn.value=""}async function Do(){Sn.value="";const w=kn.name.trim();if(!w)return Sn.value="Enter an organization name.";const{ok:h,body:W}=await op(kn.id,w);if(!h)return Sn.value=Fi(W);Je("Organization renamed."),Us(),qn(),Yn()}async function nn(w){const{ok:h,body:W}=await ap(w.id);if(xi.value="",!h)return Je(W.error||"Could not delete organization.");Je("Organization deleted."),qn()}function wi(){const w={_app:"PilotVault",_kind:"settings-export",exportedAt:new Date().toISOString(),email:o.email,prefs:{...De},themeMode:Xi.value},h=new Blob([JSON.stringify(w,null,2)],{type:"application/json"}),W=URL.createObjectURL(h),T=document.createElement("a");T.href=W,T.download=`pilotvault-settings-${new Date().toISOString().slice(0,10)}.json`,document.body.appendChild(T),T.click(),T.remove(),URL.revokeObjectURL(W),Je("Settings exported.")}const fs=H("");function Tn(w){const h=w.target.files&&w.target.files[0];if(!h)return;const W=new FileReader;W.onload=()=>{try{const T=JSON.parse(String(W.result)),Qe=T.prefs||T;if(!Nc(Qe))throw new Error("bad shape");T.themeMode&&ha(T.themeMode),Ur(De.fontSize),Zr(De.reduceMotion),fs.value="Settings imported and applied."}catch{fs.value="That file is not a valid PilotVault settings export."}},W.readAsText(h),w.target.value=""}const pt=xt({understand:!1,typed:"",cooldown:0,armed:!1,msg:""});let cn=null;const Zs=xe(()=>o.email||"DELETE MY ACCOUNT"),Jn=xe(()=>pt.understand&&pt.typed===Zs.value);function No(){Jn.value&&(pt.armed=!0,pt.cooldown=5,clearInterval(cn),cn=setInterval(()=>{pt.cooldown--,pt.cooldown<=0&&clearInterval(cn)},1e3))}en(Jn,w=>{!w&&pt.armed&&(pt.armed=!1,pt.cooldown=0,clearInterval(cn))});function hs(){if(!(!pt.armed||pt.cooldown>0)){try{localStorage.removeItem("pv_prefs")}catch{}pt.msg="Account deletion requires the account service. Local data was cleared and you were signed out.",setTimeout(()=>l("logout"),900)}}return ui(()=>{Oe=setInterval(()=>$e.value=Date.now(),1e3),qn(),Yn(),N(),Os(),Is(),Fs()}),yo(()=>{clearInterval(Oe),clearInterval(cn),clearTimeout($i)}),(w,h)=>(v(),y("div",dm,[r("div",fm,[h[62]||(h[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",hm,[E(Y,{name:"search",size:16,class:"text-ink-muted"}),oe(r("input",{"onUpdate:modelValue":h[0]||(h[0]=W=>R.value=W),placeholder:"Search settings…",class:"w-full border-none bg-transparent text-sm text-ink outline-none placeholder:text-ink-muted"},null,512),[[ve,R.value]]),R.value?(v(),y("button",{key:0,class:"text-ink-muted hover:text-ink","aria-label":"Clear search",onClick:h[1]||(h[1]=W=>R.value="")},[E(Y,{name:"x",size:15})])):D("",!0)])]),r("div",pm,[oe(r("nav",mm,[(v(!0),y(ae,null,Fe(k.value,W=>(v(),y("button",{key:W.id,class:Me(["flex items-center gap-2.5 rounded px-3 py-2.5 text-left text-sm transition",[O.value===W.id?W.danger?"bg-danger-soft font-semibold text-danger-fg":"bg-accent-soft font-semibold text-accent-soft-fg":W.danger?"font-medium text-danger-fg hover:bg-danger-soft":"font-medium text-ink-secondary hover:bg-surface-2"]]),onClick:T=>O.value=W.id},[E(Y,{name:W.icon,size:17},null,8,["name"]),r("span",vm,S(W.label),1)],10,gm))),128))],512),[[yh,!F.value]]),r("div",_m,[F.value&&!K.value.length?(v(),y("div",ym," No settings match “"+S(R.value)+"”. ",1)):D("",!0),(v(!0),y(ae,null,Fe(K.value,W=>(v(),y(ae,{key:W.id},[F.value?(v(),y("div",bm,[E(Y,{name:W.icon,size:14},null,8,["name"]),$(" "+S(W.label),1)])):D("",!0),W.id==="account"?(v(),y("div",xm,[E(Se,{title:"Full name",desc:"Shown to your team on flights and audit logs.",keywords:"full name account"},{default:be(()=>[oe(r("input",{"onUpdate:modelValue":h[2]||(h[2]=T=>Re(De).name=T),class:"field w-56",placeholder:"Jane Operator",onBlur:h[3]||(h[3]=T=>Je("Saved."))},null,544),[[ve,Re(De).name]])]),_:1}),E(Se,{title:"Username",desc:"Your unique handle within PilotVault.",keywords:"username handle"},{default:be(()=>[r("div",wm,[h[63]||(h[63]=r("span",{class:"text-sm text-ink-muted"},"@",-1)),oe(r("input",{"onUpdate:modelValue":h[4]||(h[4]=T=>Re(De).username=T),class:"field w-48",placeholder:"jane",onBlur:h[5]||(h[5]=T=>Je("Saved."))},null,544),[[ve,Re(De).username]])])]),_:1}),E(Se,{title:"Email address",desc:"Used for sign-in and notifications.",keywords:"email verification verify"},{default:be(()=>[r("div",km,[r("span",Sm,S(t.email||"—"),1),r("span",Tm,[E(Y,{name:"mail",size:12}),h[64]||(h[64]=$(" Unverified ",-1))])])]),_:1}),E(Se,{title:"Role",desc:"Your access level in PilotVault.",keywords:"role admin user superadmin access rights permissions"},{default:be(()=>[r("span",{class:Me(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",b(t.role)])},[E(Y,{name:_(t.role),size:12},null,8,["name"]),$(S(p(t.role)),1)],2)]),_:1}),E(Se,{title:"Organization",desc:"The organization your account belongs to.",keywords:"organization org tenant company"},{default:be(()=>[r("span",{class:Me(["text-sm",t.organizationName?"text-ink":"text-ink-muted"])},S(t.organizationName||(u.value?"All organizations":"None")),3)]),_:1}),E(Se,{block:"",title:"Verify email",desc:"Confirm ownership to enable password resets and alerts.",keywords:"verify email resend"},{default:be(()=>[r("button",{class:"btn-ghost",onClick:Lo},"Send verification link"),wn.value?(v(),y("p",Pm,S(wn.value),1)):D("",!0)]),_:1}),E(Se,{block:"",title:"Change password",desc:"Use at least 8 characters.",keywords:"password change current new"},{default:be(()=>[r("div",Cm,[oe(r("input",{"onUpdate:modelValue":h[6]||(h[6]=T=>kt.current=T),type:"password",class:"field",placeholder:"Current password"},null,512),[[ve,kt.current]]),oe(r("input",{"onUpdate:modelValue":h[7]||(h[7]=T=>kt.next=T),type:"password",class:"field",placeholder:"New password"},null,512),[[ve,kt.next]]),oe(r("input",{"onUpdate:modelValue":h[8]||(h[8]=T=>kt.confirm=T),type:"password",class:"field",placeholder:"Confirm new password"},null,512),[[ve,kt.confirm]]),r("div",Lm,[r("button",{class:"btn-accent",onClick:Lt},"Update password"),zn.value?(v(),y("span",{key:0,class:Me(["text-xs",yi.value?"text-success-fg":"text-ink-muted"])},S(zn.value),3)):D("",!0)])])]),_:1})])):W.id==="appearance"?(v(),y("div",Mm,[E(Se,{title:"Theme",desc:"Light, dark, or follow your system.",keywords:"theme light dark system appearance"},{default:be(()=>[E(hn,{modelValue:fe.value,"onUpdate:modelValue":h[9]||(h[9]=T=>fe.value=T),options:ie},null,8,["modelValue"])]),_:1}),E(Se,{title:"Font size",desc:"Scales the entire interface for readability.",keywords:"font size accessibility text"},{default:be(()=>[E(hn,{modelValue:Re(De).fontSize,"onUpdate:modelValue":h[10]||(h[10]=T=>Re(De).fontSize=T),options:me},null,8,["modelValue"])]),_:1}),E(Se,{title:"Reduce motion",desc:"Minimise animations and transitions.",keywords:"reduce motion accessibility animation"},{default:be(()=>[E(sn,{modelValue:Re(De).reduceMotion,"onUpdate:modelValue":h[11]||(h[11]=T=>Re(De).reduceMotion=T)},null,8,["modelValue"])]),_:1}),E(Se,{title:"Language",desc:"Interface language.",keywords:"language locale"},{default:be(()=>[oe(r("select",{"onUpdate:modelValue":h[12]||(h[12]=T=>Re(De).language=T),class:"field w-48"},[(v(),y(ae,null,Fe(Ee,([T,Qe])=>r("option",{key:T,value:T},S(Qe),9,Em)),64))],512),[[Ot,Re(De).language]])]),_:1}),E(Se,{title:"Region",desc:"Affects number, unit and date defaults.",keywords:"region country locale"},{default:be(()=>[oe(r("select",{"onUpdate:modelValue":h[13]||(h[13]=T=>Re(De).region=T),class:"field w-48"},[(v(),y(ae,null,Fe(Ve,([T,Qe])=>r("option",{key:T,value:T},S(Qe),9,Om)),64))],512),[[Ot,Re(De).region]])]),_:1}),E(Se,{title:"Date format",desc:"How calendar dates are displayed.",keywords:"date format"},{default:be(()=>[oe(r("select",{"onUpdate:modelValue":h[14]||(h[14]=T=>Re(De).dateFormat=T),class:"field w-48"},[(v(),y(ae,null,Fe(pe,([T,Qe])=>r("option",{key:T,value:T},S(Qe),9,zm)),64))],512),[[Ot,Re(De).dateFormat]])]),_:1}),E(Se,{title:"Time format",desc:"12- or 24-hour clock.",keywords:"time format clock 12 24 hour"},{default:be(()=>[E(hn,{modelValue:Re(De).timeFormat,"onUpdate:modelValue":h[15]||(h[15]=T=>Re(De).timeFormat=T),options:Le},null,8,["modelValue"])]),_:1}),E(Se,{title:"Preview",desc:"How timestamps appear across the app.",keywords:"preview date time"},{default:be(()=>[r("span",Am,S(Q.value),1)]),_:1}),h[65]||(h[65]=r("p",{class:"mt-3 text-xs text-ink-muted"}," Language & region are stored now; full localisation ships with the account service. ",-1))])):W.id==="integrations"?(v(),y("div",$m,[F.value?D("",!0):(v(),y("div",Im,[(v(),y(ae,null,Fe(un,T=>r("button",{key:T.id,type:"button",class:Me(["-mb-px inline-flex items-center gap-1.5 whitespace-nowrap border-b-2 px-3 py-2 text-sm font-semibold transition",ot.value===T.id?"border-accent text-ink":"border-transparent text-ink-secondary hover:text-ink"]),onClick:Qe=>ot.value=T.id},[E(Y,{name:T.icon,size:16},null,8,["name"]),$(S(T.label),1)],10,Dm)),64))])),as("apis-external")?(v(),y("div",Nm,[r("div",Rm,[r("div",Fm,[E(Y,{name:"radio",size:20})]),h[66]||(h[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))]),ue.loaded&&!ue.available?(v(),y("div",Bm,[E(Y,{name:"lock",size:14,class:"mr-1 inline"}),h[67]||(h[67]=$(" OpenSky is currently disabled by your administrator. Contact them to enable it. ",-1))])):D("",!0),ue.canEditOrg?(v(),y("div",Vm,[h[68]||(h[68]=r("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),E(hn,{modelValue:ye.value,"onUpdate:modelValue":h[16]||(h[16]=T=>ye.value=T),options:ut},null,8,["modelValue"])])):D("",!0),f.value?(v(),et(Se,{key:2,title:"Enable OpenSky (organization-wide)",desc:"Turn OpenSky on or off for everyone in your organization.",keywords:"enable disable plugin opensky organization"},{default:be(()=>[E(sn,{"model-value":ue.orgEnabled,disabled:!ue.available,"onUpdate:modelValue":J},null,8,["model-value","disabled"])]),_:1})):(v(),et(Se,{key:3,title:"Enable OpenSky",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin opensky"},{default:be(()=>[E(sn,{"model-value":ue.enabled,disabled:!ue.available||!ue.orgEnabled,"onUpdate:modelValue":J},null,8,["model-value","disabled"])]),_:1})),!f.value&&ue.available&&!ue.orgEnabled?(v(),y("div",Um,[E(Y,{name:"lock",size:13,class:"mr-1 inline"}),h[70]||(h[70]=$("OpenSky is turned off for your organization",-1)),ue.canEditOrg?(v(),y("span",Zm,[...h[69]||(h[69]=[$(" — switch to ",-1),r("span",{class:"font-semibold"},"Organization",-1),$(" to turn it back on",-1)])])):D("",!0),h[71]||(h[71]=$(". ",-1))])):D("",!0),f.value?(v(),y("div",Hm,[E(Y,{name:"users",size:13,class:"mr-1 inline"}),h[72]||(h[72]=$("These are organization-wide settings — they apply to everyone in ",-1)),r("span",jm,S(t.organizationName||"your organization"),1),h[73]||(h[73]=$(". Leave a field blank to let each user choose their own; a value set here overrides the user's. ",-1))])):it.value?(v(),y("div",Wm," As a superadmin you manage the global OpenSky configuration in the API Server panel. The effective configuration is shown below. ")):D("",!0),ue.available&&!f.value?(v(),y("div",Km,[r("div",Gm,[r("div",qm,[E(Y,{name:"signal",size:15}),h[74]||(h[74]=$("Credit usage ",-1))]),he.value?(v(),y("span",Ym,"Checked "+S(Ue()),1)):D("",!0)]),Te.value?(v(),y(ae,{key:0},[Te.value.remaining!=null?(v(),y(ae,{key:0},[r("div",Jm,[r("span",Xm,S(Ye(Te.value.remaining)),1),r("span",Qm,"/ "+S(Ye(Te.value.daily))+" credits left today",1)]),r("div",eg,[r("div",{class:Me(["h-full rounded-full transition-all",lt.value]),style:Ps({width:qe.value+"%"})},null,6)]),r("div",tg," Used "+S(Ye(Te.value.daily-Te.value.remaining))+" today · "+S(Te.value.probeCost)+" credit"+S(Te.value.probeCost===1?"":"s")+" per query · "+S(Te.value.mode),1)],64)):(v(),y(ae,{key:1},[r("div",ng,[h[75]||(h[75]=$("Daily allowance: ",-1)),r("span",ig,S(Ye(Te.value.daily)),1),h[76]||(h[76]=$(" credits",-1))]),r("div",sg,S(Te.value.probeCost)+" credit"+S(Te.value.probeCost===1?"":"s")+" per query · "+S(Te.value.mode)+". OpenSky only reports live remaining credits for authenticated requests — add OAuth2 credentials below to track usage. ",1)],64))],64)):(v(),y("div",og,[...h[77]||(h[77]=[$(" Run ",-1),r("span",{class:"font-semibold text-ink-secondary"},"Test connection",-1),$(" below to fetch your live OpenSky credit balance. ",-1)])]))])):D("",!0),E(Se,{title:"OpenSky plan",desc:"Your account tier — sets the daily credit allowance.",keywords:"plan tier credits"},{default:be(()=>[U("plan")?(v(),y("span",ag,[$(S((z.find(T=>T.value===x("plan").effective)||{}).label||x("plan").effective||"—")+" ",1),B("plan")?(v(),y("span",rg,[E(Y,{name:"lock",size:10}),$(S(B("plan")),1)])):D("",!0)])):(v(),et(hn,{key:1,modelValue:ze.plan,"onUpdate:modelValue":h[17]||(h[17]=T=>ze.plan=T),options:z},null,8,["modelValue"]))]),_:1}),E(Se,{title:"Default bounding box",desc:"lamin,lomin,lamax,lomax — used for live queries and the health probe.",keywords:"bounding box bbox area"},{default:be(()=>[U("bbox")?(v(),y("span",lg,[$(S(x("bbox").effective||"—")+" ",1),B("bbox")?(v(),y("span",ug,[E(Y,{name:"lock",size:10}),$(S(B("bbox")),1)])):D("",!0)])):oe((v(),y("input",{key:1,"onUpdate:modelValue":h[18]||(h[18]=T=>ze.bbox=T),class:"field w-64 font-mono",placeholder:"50.5,3.2,53.7,7.3"},null,512)),[[ve,ze.bbox]])]),_:1}),E(Se,{title:"OAuth2 client ID",desc:"Optional — leave blank for anonymous access (lower limits).",keywords:"oauth client id credentials"},{default:be(()=>[U("clientId")?(v(),y("span",cg,[$(S(x("clientId").effective||"—")+" ",1),B("clientId")?(v(),y("span",dg,[E(Y,{name:"lock",size:10}),$(S(B("clientId")),1)])):D("",!0)])):oe((v(),y("input",{key:1,"onUpdate:modelValue":h[19]||(h[19]=T=>ze.clientId=T),class:"field w-64",placeholder:"your-api-client"},null,512)),[[ve,ze.clientId]])]),_:1}),E(Se,{title:"OAuth2 client secret",desc:"Paired with the client ID for authenticated access.",keywords:"oauth client secret credentials password"},{default:be(()=>[U("clientSecret")?(v(),y("span",fg,[$(S(x("clientSecret").effective||"—")+" ",1),B("clientSecret")?(v(),y("span",hg,[E(Y,{name:"lock",size:10}),$(S(B("clientSecret")),1)])):D("",!0)])):oe((v(),y("input",{key:1,"onUpdate:modelValue":h[20]||(h[20]=T=>ze.clientSecret=T),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[ve,ze.clientSecret]])]),_:1}),ue.available&&!ue.allowAnonymous?(v(),y("div",pg," Anonymous access is disabled by the administrator — OpenSky needs OAuth2 credentials from some layer to work. ")):D("",!0),r("div",mg,[it.value?D("",!0):(v(),y("button",{key:0,class:"btn-accent",disabled:re.value||!ue.available,onClick:Z},S(re.value?"Saving…":f.value?"Save organization settings":"Save settings"),9,gg)),f.value?D("",!0):(v(),y("button",{key:1,class:"btn-ghost",disabled:ee.value||!ue.available,onClick:Pe},S(ee.value?"Testing…":"Test connection"),9,vg)),ce.value?(v(),y("span",_g,S(ce.value),1)):D("",!0),nt.value&&!f.value?(v(),y("span",{key:3,class:Me(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",le(nt.value.status)])},[h[78]||(h[78]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(S(nt.value.detail||nt.value.status),1)],2)):D("",!0)])])):D("",!0),as("drives-external")?(v(),y(ae,{key:2},[r("div",yg,[r("div",bg,[r("div",xg,[E(Y,{name:"server",size:20})]),h[79]||(h[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))]),se.loaded&&!se.available?(v(),y("div",wg,[E(Y,{name:"lock",size:14,class:"mr-1 inline"}),h[80]||(h[80]=$(" File transfer is currently disabled by your administrator. Contact them to enable it. ",-1))])):D("",!0),se.canEditOrg?(v(),y("div",kg,[h[81]||(h[81]=r("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),E(hn,{modelValue:Ce.value,"onUpdate:modelValue":h[21]||(h[21]=T=>Ce.value=T),options:ut},null,8,["modelValue"])])):D("",!0),Ut.value?(v(),et(Se,{key:2,title:"Enable file transfer (organization-wide)",desc:"Turn it on or off for everyone in your organization.",keywords:"enable disable plugin ftp sftp organization"},{default:be(()=>[E(sn,{"model-value":se.orgEnabled,disabled:!se.available,"onUpdate:modelValue":wo},null,8,["model-value","disabled"])]),_:1})):(v(),et(Se,{key:3,title:"Enable file transfer",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin ftp sftp"},{default:be(()=>[E(sn,{"model-value":se.enabled,disabled:!se.available||!se.orgEnabled,"onUpdate:modelValue":wo},null,8,["model-value","disabled"])]),_:1})),!Ut.value&&se.available&&!se.orgEnabled?(v(),y("div",Sg,[E(Y,{name:"lock",size:13,class:"mr-1 inline"}),h[83]||(h[83]=$("File transfer is turned off for your organization",-1)),se.canEditOrg?(v(),y("span",Tg,[...h[82]||(h[82]=[$(" — switch to ",-1),r("span",{class:"font-semibold"},"Organization",-1),$(" to turn it back on",-1)])])):D("",!0),h[84]||(h[84]=$(". ",-1))])):D("",!0),Ut.value?(v(),y("div",Pg,[E(Y,{name:"users",size:13,class:"mr-1 inline"}),h[85]||(h[85]=$("These are organization-wide settings — they apply to everyone in ",-1)),r("span",Cg,S(t.organizationName||"your organization"),1),h[86]||(h[86]=$(". Leave the connection blank to let each user configure their own; a connection set here overrides the user's. ",-1))])):St.value?(v(),y("div",Lg," As a superadmin you manage the global file-transfer configuration in the API Server panel. The effective configuration is shown below. ")):D("",!0),E(Se,{title:"Protocol",desc:"SFTP (over SSH), FTPS (FTP over TLS), or plain FTP.",keywords:"protocol sftp ftps ftp"},{default:be(()=>[Zt("protocol")?(v(),y("span",Mg,[$(S(Pa(At("protocol").effective))+" ",1),bt("protocol")?(v(),y("span",Eg,[E(Y,{name:"lock",size:10}),$(S(bt("protocol")),1)])):D("",!0)])):(v(),et(hn,{key:1,modelValue:ke.protocol,"onUpdate:modelValue":h[22]||(h[22]=T=>ke.protocol=T),options:_n},null,8,["modelValue"]))]),_:1}),E(Se,{title:"Host",desc:"Server hostname or IP address.",keywords:"host server address"},{default:be(()=>[Zt("host")?(v(),y("span",Og,[$(S(At("host").effective||"—")+" ",1),bt("host")?(v(),y("span",zg,[E(Y,{name:"lock",size:10}),$(S(bt("host")),1)])):D("",!0)])):oe((v(),y("input",{key:1,"onUpdate:modelValue":h[23]||(h[23]=T=>ke.host=T),class:"field w-64",placeholder:"files.example.com"},null,512)),[[ve,ke.host]])]),_:1}),E(Se,{title:"Port",desc:"Leave blank for the protocol default (22 for SFTP, 21 for FTP/FTPS).",keywords:"port"},{default:be(()=>[Zt("port")?(v(),y("span",Ag,[$(S(At("port").effective||"default")+" ",1),bt("port")?(v(),y("span",$g,[E(Y,{name:"lock",size:10}),$(S(bt("port")),1)])):D("",!0)])):oe((v(),y("input",{key:1,"onUpdate:modelValue":h[24]||(h[24]=T=>ke.port=T),inputmode:"numeric",class:"field w-24 font-mono",placeholder:"22"},null,512)),[[ve,ke.port]])]),_:1}),E(Se,{title:"Username",desc:"Account used to authenticate.",keywords:"username login account"},{default:be(()=>[Zt("username")?(v(),y("span",Ig,[$(S(At("username").effective||"—")+" ",1),bt("username")?(v(),y("span",Dg,[E(Y,{name:"lock",size:10}),$(S(bt("username")),1)])):D("",!0)])):oe((v(),y("input",{key:1,"onUpdate:modelValue":h[25]||(h[25]=T=>ke.username=T),class:"field w-64",placeholder:"user"},null,512)),[[ve,ke.username]])]),_:1}),E(Se,{title:"Password",desc:"Password auth for FTP/FTPS, or SFTP password login. Leave blank to use a key.",keywords:"password secret credentials"},{default:be(()=>[Zt("password")?(v(),y("span",Ng,[$(S(At("password").effective||"—")+" ",1),bt("password")?(v(),y("span",Rg,[E(Y,{name:"lock",size:10}),$(S(bt("password")),1)])):D("",!0)])):oe((v(),y("input",{key:1,"onUpdate:modelValue":h[26]||(h[26]=T=>ke.password=T),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[ve,ke.password]])]),_:1}),Qi.value==="sftp"?(v(),et(Se,{key:7,block:"",title:"SSH private key",desc:"PEM key for SFTP key auth — used instead of, or alongside, a password.",keywords:"private key ssh pem identity"},{default:be(()=>[Zt("privateKey")?(v(),y("span",Fg,[$(S(At("privateKey").effective||"—")+" ",1),bt("privateKey")?(v(),y("span",Bg,[E(Y,{name:"lock",size:10}),$(S(bt("privateKey")),1)])):D("",!0)])):oe((v(),y("textarea",{key:1,"onUpdate:modelValue":h[27]||(h[27]=T=>ke.privateKey=T),rows:"3",class:"field w-full font-mono text-xs",placeholder:"-----BEGIN OPENSSH PRIVATE KEY-----"},null,512)),[[ve,ke.privateKey]])]),_:1})):D("",!0),Qi.value==="sftp"?(v(),et(Se,{key:8,title:"Private key passphrase",desc:"Passphrase protecting the SSH private key, if any.",keywords:"passphrase key secret"},{default:be(()=>[Zt("keyPassphrase")?(v(),y("span",Vg,[$(S(At("keyPassphrase").effective||"—")+" ",1),bt("keyPassphrase")?(v(),y("span",Ug,[E(Y,{name:"lock",size:10}),$(S(bt("keyPassphrase")),1)])):D("",!0)])):oe((v(),y("input",{key:1,"onUpdate:modelValue":h[28]||(h[28]=T=>ke.keyPassphrase=T),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[ve,ke.keyPassphrase]])]),_:1})):D("",!0),Qi.value==="sftp"?(v(),et(Se,{key:9,title:"Host key fingerprint",desc:"Optional SHA256:… fingerprint to pin the server's host key. Blank accepts any key.",keywords:"host key fingerprint verify trust"},{default:be(()=>[Zt("hostKeyFingerprint")?(v(),y("span",Zg,[$(S(At("hostKeyFingerprint").effective||"—")+" ",1),bt("hostKeyFingerprint")?(v(),y("span",Hg,[E(Y,{name:"lock",size:10}),$(S(bt("hostKeyFingerprint")),1)])):D("",!0)])):oe((v(),y("input",{key:1,"onUpdate:modelValue":h[29]||(h[29]=T=>ke.hostKeyFingerprint=T),class:"field w-full font-mono text-xs",placeholder:"SHA256:…"},null,512)),[[ve,ke.hostKeyFingerprint]])]),_:1})):D("",!0),Qi.value==="ftps"?(v(),et(Se,{key:10,title:"TLS verification",desc:"Skip only for self-signed test servers.",keywords:"tls certificate verify insecure ftps"},{default:be(()=>[Zt("insecureSkipVerify")?(v(),y("span",jg,[$(S(At("insecureSkipVerify").effective==="true"?"Skip verification":"Verify certificate")+" ",1),bt("insecureSkipVerify")?(v(),y("span",Wg,[E(Y,{name:"lock",size:10}),$(S(bt("insecureSkipVerify")),1)])):D("",!0)])):(v(),et(hn,{key:1,modelValue:ke.insecureSkipVerify,"onUpdate:modelValue":h[30]||(h[30]=T=>ke.insecureSkipVerify=T),options:di},null,8,["modelValue"]))]),_:1})):D("",!0),E(Se,{title:"Base path",desc:"Working directory and health-check target, e.g. /uploads.",keywords:"base path directory folder root"},{default:be(()=>[Zt("basePath")?(v(),y("span",Kg,[$(S(At("basePath").effective||"—")+" ",1),bt("basePath")?(v(),y("span",Gg,[E(Y,{name:"lock",size:10}),$(S(bt("basePath")),1)])):D("",!0)])):oe((v(),y("input",{key:1,"onUpdate:modelValue":h[31]||(h[31]=T=>ke.basePath=T),class:"field w-64 font-mono",placeholder:"/uploads"},null,512)),[[ve,ke.basePath]])]),_:1}),r("div",qg,[St.value?D("",!0):(v(),y("button",{key:0,class:"btn-accent",disabled:ft.value||!se.available,onClick:Ea},S(ft.value?"Saving…":Ut.value?"Save organization settings":"Save settings"),9,Yg)),Ut.value?D("",!0):(v(),y("button",{key:1,class:"btn-ghost",disabled:gt.value||!se.available,onClick:Oa},S(gt.value?"Testing…":"Test connection"),9,Jg)),Ge.value?(v(),y("span",Xg,S(Ge.value),1)):D("",!0),Ct.value&&!Ut.value?(v(),y("span",Qg,"Checked "+S(Ca()),1)):D("",!0),yt.value&&!Ut.value?(v(),y("span",{key:4,class:Me(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",za(yt.value.status)])},[h[87]||(h[87]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(S(yt.value.detail||yt.value.status),1)],2)):D("",!0)])]),r("div",ev,[r("div",tv,[r("div",nv,[E(Y,{name:"cloud",size:20})]),h[88]||(h[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))]),je.loaded&&!je.available?(v(),y("div",iv,[E(Y,{name:"lock",size:14,class:"mr-1 inline"}),h[89]||(h[89]=$(" WebDAV is currently disabled by your administrator. Contact them to enable it. ",-1))])):D("",!0),je.canEditOrg?(v(),y("div",sv,[h[90]||(h[90]=r("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),E(hn,{modelValue:_e.value,"onUpdate:modelValue":h[32]||(h[32]=T=>_e.value=T),options:ut},null,8,["modelValue"])])):D("",!0),rn.value?(v(),et(Se,{key:2,title:"Enable WebDAV (organization-wide)",desc:"Turn it on or off for everyone in your organization.",keywords:"enable disable plugin webdav organization"},{default:be(()=>[E(sn,{"model-value":je.orgEnabled,disabled:!je.available,"onUpdate:modelValue":mi},null,8,["model-value","disabled"])]),_:1})):(v(),et(Se,{key:3,title:"Enable WebDAV",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin webdav"},{default:be(()=>[E(sn,{"model-value":je.enabled,disabled:!je.available||!je.orgEnabled,"onUpdate:modelValue":mi},null,8,["model-value","disabled"])]),_:1})),!rn.value&&je.available&&!je.orgEnabled?(v(),y("div",ov,[E(Y,{name:"lock",size:13,class:"mr-1 inline"}),h[92]||(h[92]=$("WebDAV is turned off for your organization",-1)),je.canEditOrg?(v(),y("span",av,[...h[91]||(h[91]=[$(" — switch to ",-1),r("span",{class:"font-semibold"},"Organization",-1),$(" to turn it back on",-1)])])):D("",!0),h[93]||(h[93]=$(". ",-1))])):D("",!0),rn.value?(v(),y("div",rv,[E(Y,{name:"users",size:13,class:"mr-1 inline"}),h[94]||(h[94]=$("These are organization-wide settings — they apply to everyone in ",-1)),r("span",lv,S(t.organizationName||"your organization"),1),h[95]||(h[95]=$(". Leave the connection blank to let each user configure their own; a connection set here overrides the user's. ",-1))])):zs.value?(v(),y("div",uv," As a superadmin you manage the global WebDAV configuration in the API Server panel. The effective configuration is shown below. ")):D("",!0),E(Se,{block:"",title:"Server URL",desc:"WebDAV endpoint including scheme, e.g. https://cloud.example.com/remote.php/dav/files/alice/.",keywords:"url server address endpoint webdav host"},{default:be(()=>[pi("baseURL")?(v(),y("span",cv,[$(S(yn("baseURL").effective||"—")+" ",1),Ht("baseURL")?(v(),y("span",dv,[E(Y,{name:"lock",size:10}),$(S(Ht("baseURL")),1)])):D("",!0)])):oe((v(),y("input",{key:1,"onUpdate:modelValue":h[33]||(h[33]=T=>$t.baseURL=T),class:"field w-full font-mono text-xs",placeholder:"https://cloud.example.com/remote.php/dav/files/alice/"},null,512)),[[ve,$t.baseURL]])]),_:1}),E(Se,{title:"Username",desc:"Account used to authenticate (leave blank for a public share).",keywords:"username login account"},{default:be(()=>[pi("username")?(v(),y("span",fv,[$(S(yn("username").effective||"—")+" ",1),Ht("username")?(v(),y("span",hv,[E(Y,{name:"lock",size:10}),$(S(Ht("username")),1)])):D("",!0)])):oe((v(),y("input",{key:1,"onUpdate:modelValue":h[34]||(h[34]=T=>$t.username=T),class:"field w-64",placeholder:"user"},null,512)),[[ve,$t.username]])]),_:1}),E(Se,{title:"Password",desc:"Password or app-specific token for HTTP Basic auth.",keywords:"password secret credentials token"},{default:be(()=>[pi("password")?(v(),y("span",pv,[$(S(yn("password").effective||"—")+" ",1),Ht("password")?(v(),y("span",mv,[E(Y,{name:"lock",size:10}),$(S(Ht("password")),1)])):D("",!0)])):oe((v(),y("input",{key:1,"onUpdate:modelValue":h[35]||(h[35]=T=>$t.password=T),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[ve,$t.password]])]),_:1}),E(Se,{title:"TLS verification",desc:"Only affects HTTPS. Skip only for self-signed test servers.",keywords:"tls certificate verify insecure https"},{default:be(()=>[pi("insecureSkipVerify")?(v(),y("span",gv,[$(S(yn("insecureSkipVerify").effective==="true"?"Skip verification":"Verify certificate")+" ",1),Ht("insecureSkipVerify")?(v(),y("span",vv,[E(Y,{name:"lock",size:10}),$(S(Ht("insecureSkipVerify")),1)])):D("",!0)])):(v(),et(hn,{key:1,modelValue:$t.insecureSkipVerify,"onUpdate:modelValue":h[36]||(h[36]=T=>$t.insecureSkipVerify=T),options:ko},null,8,["modelValue"]))]),_:1}),E(Se,{title:"Base path",desc:"Working directory under the server URL and health-check target, e.g. /Documents.",keywords:"base path directory folder root"},{default:be(()=>[pi("basePath")?(v(),y("span",_v,[$(S(yn("basePath").effective||"—")+" ",1),Ht("basePath")?(v(),y("span",yv,[E(Y,{name:"lock",size:10}),$(S(Ht("basePath")),1)])):D("",!0)])):oe((v(),y("input",{key:1,"onUpdate:modelValue":h[37]||(h[37]=T=>$t.basePath=T),class:"field w-64 font-mono",placeholder:"/Documents"},null,512)),[[ve,$t.basePath]])]),_:1}),r("div",bv,[zs.value?D("",!0):(v(),y("button",{key:0,class:"btn-accent",disabled:Ei.value||!je.available,onClick:To},S(Ei.value?"Saving…":rn.value?"Save organization settings":"Save settings"),9,xv)),rn.value?D("",!0):(v(),y("button",{key:1,class:"btn-ghost",disabled:hi.value||!je.available,onClick:Po},S(hi.value?"Testing…":"Test connection"),9,wv)),fi.value?(v(),y("span",kv,S(fi.value),1)):D("",!0),tn.value&&!rn.value?(v(),y("span",Sv,"Checked "+S($a()),1)):D("",!0),an.value&&!rn.value?(v(),y("span",{key:4,class:Me(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",Oi(an.value.status)])},[h[96]||(h[96]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(S(an.value.detail||an.value.status),1)],2)):D("",!0)])])],64)):D("",!0),as("drives-local")?(v(),y("div",Tv,[r("div",Pv,[r("div",Cv,[E(Y,{name:"monitor",size:20})]),h[97]||(h[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))]),ne.loaded&&!ne.available?(v(),y("div",Lv,[E(Y,{name:"lock",size:14,class:"mr-1 inline"}),h[98]||(h[98]=$(" Local storage is currently disabled by your administrator. Contact them to enable it. ",-1))])):ne.loaded&&!ne.rootConfigured?(v(),y("div",Mv,[E(Y,{name:"alertTriangle",size:14,class:"mr-1 inline"}),h[99]||(h[99]=$(" No storage root has been configured by your administrator yet. ",-1))])):D("",!0),ne.canEditOrg?(v(),y("div",Ev,[h[100]||(h[100]=r("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),E(hn,{modelValue:st.value,"onUpdate:modelValue":h[38]||(h[38]=T=>st.value=T),options:ut},null,8,["modelValue"])])):D("",!0),Tt.value?(v(),et(Se,{key:3,title:"Enable local storage (organization-wide)",desc:"Turn it on or off for everyone in your organization.",keywords:"enable disable plugin local storage folder organization"},{default:be(()=>[E(sn,{"model-value":ne.orgEnabled,disabled:!ne.available,"onUpdate:modelValue":ss},null,8,["model-value","disabled"])]),_:1})):(v(),et(Se,{key:4,title:"Enable local storage",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin local storage folder"},{default:be(()=>[E(sn,{"model-value":ne.enabled,disabled:!ne.available||!ne.orgEnabled,"onUpdate:modelValue":ss},null,8,["model-value","disabled"])]),_:1})),!Tt.value&&ne.available&&!ne.orgEnabled?(v(),y("div",Ov,[E(Y,{name:"lock",size:13,class:"mr-1 inline"}),h[102]||(h[102]=$("Local storage is turned off for your organization",-1)),ne.canEditOrg?(v(),y("span",zv,[...h[101]||(h[101]=[$(" — switch to ",-1),r("span",{class:"font-semibold"},"Organization",-1),$(" to turn it back on",-1)])])):D("",!0),h[103]||(h[103]=$(". ",-1))])):D("",!0),Tt.value?(v(),y("div",Av,[E(Y,{name:"users",size:13,class:"mr-1 inline"}),h[104]||(h[104]=$("These are organization-wide settings — they apply to everyone in ",-1)),r("span",$v,S(t.organizationName||"your organization"),1),h[105]||(h[105]=$(", who all share the organization folder. Members can additionally enable a private folder inside it. ",-1))])):Nt.value?(v(),y("div",Iv," As a superadmin you manage the global storage root in the API Server panel. The effective configuration is shown below. ")):D("",!0),Tt.value?(v(),et(Se,{key:8,title:"Private folders",desc:"Let members create a private folder inside the organization folder, reachable only by them.",keywords:"private folder members allow policy organization"},{default:be(()=>[E(sn,{"model-value":ne.allowPrivate,disabled:!ne.available,"onUpdate:modelValue":Co},null,8,["model-value","disabled"])]),_:1})):D("",!0),Tt.value?D("",!0):(v(),y(ae,{key:9},[E(Se,{block:"",title:"Your folders",desc:"Assigned automatically and isolated — no one else can reach your private folder.",keywords:"folder directory path storage location isolated private shared"},{default:be(()=>[r("div",Dv,[(v(!0),y(ae,null,Fe(ne.mounts,T=>(v(),y("div",{key:T.id,class:"flex flex-wrap items-center gap-2"},[r("span",Nv,S(T.path),1),T.kind==="shared"?(v(),y("span",Rv,[E(Y,{name:"users",size:10}),h[106]||(h[106]=$("Shared with your organization",-1))])):(v(),y("span",Fv,[E(Y,{name:"lock",size:10}),h[107]||(h[107]=$("Private to you",-1))])),Wn.value[T.id]?(v(),y("span",{key:2,class:Me(["inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[10px] font-semibold",Be(Wn.value[T.id].status)])},[h[108]||(h[108]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(S(Wn.value[T.id].status),1)],2)):D("",!0)]))),128)),ne.mounts.length?D("",!0):(v(),y("div",Bv,S(ne.rootConfigured?"No folder assigned yet.":"Waiting for the administrator to configure a storage root."),1))])]),_:1}),ne.isOrgUser&&ne.allowPrivate?(v(),et(Se,{key:0,title:"My private folder",desc:"Add a private folder inside the organization folder, reachable only by you — you keep the shared folder too.",keywords:"private folder personal isolated organization inside"},{default:be(()=>[E(sn,{"model-value":ne.privateFolder,disabled:!ne.available||!ne.orgEnabled,"onUpdate:modelValue":os},null,8,["model-value","disabled"])]),_:1})):ne.isOrgUser&&!ne.allowPrivate?(v(),y("div",Vv,[E(Y,{name:"lock",size:13,class:"mr-1 inline"}),h[109]||(h[109]=$("Private folders are turned off by your organization. ",-1))])):D("",!0)],64)),E(Se,{title:"Access mode",desc:"Read-only prevents uploads, deletes and folder creation.",keywords:"read only write access mode permission"},{default:be(()=>[On("readOnly")?(v(),y("span",Uv,[$(S(Ai(vt("readOnly").effective))+" ",1),vi("readOnly")?(v(),y("span",Zv,[E(Y,{name:"lock",size:10}),$(S(vi("readOnly")),1)])):D("",!0)])):(v(),et(hn,{key:1,modelValue:jn.value,"onUpdate:modelValue":h[39]||(h[39]=T=>jn.value=T),options:zi},null,8,["modelValue"]))]),_:1}),r("div",Hv,[Nt.value?D("",!0):(v(),y("button",{key:0,class:"btn-accent",disabled:bn.value||!ne.available,onClick:Bs},S(bn.value?"Saving…":Tt.value?"Save organization settings":"Save settings"),9,jv)),Tt.value?D("",!0):(v(),y("button",{key:1,class:"btn-ghost",disabled:gi.value||!ne.available,onClick:Na},S(gi.value?"Testing…":"Test folder"),9,Wv)),ln.value?(v(),y("span",Kv,S(ln.value),1)):D("",!0),ct.value&&!Tt.value?(v(),y("span",Gv,"Checked "+S(Ns()),1)):D("",!0),Ie.value&&!Tt.value?(v(),y("span",{key:4,class:Me(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",Be(Ie.value.status)])},[h[110]||(h[110]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(S(Ie.value.detail||Ie.value.status),1)],2)):D("",!0)])])):D("",!0)])):W.id==="profile"?(v(),y("div",qv,[E(Se,{block:"",title:"Profile photo",desc:"PNG or JPG, up to ~1.5 MB. Stored on this device.",keywords:"avatar photo picture"},{default:be(()=>[r("div",Yv,[Re(De).avatar?(v(),y("img",{key:0,src:Re(De).avatar,alt:"Avatar",class:"h-16 w-16 rounded-full object-cover"},null,8,Jv)):(v(),y("div",Xv,S(Eo.value),1)),r("div",Qv,[r("label",e_,[E(Y,{name:"upload",size:15,class:"mr-1.5 inline"}),h[111]||(h[111]=$("Upload ",-1)),r("input",{type:"file",accept:"image/*",class:"hidden",onChange:Mo},null,32)]),Re(De).avatar?(v(),y("button",{key:0,class:"btn-ghost",onClick:Ra},"Remove")):D("",!0)])])]),_:1}),E(Se,{title:"Display name",desc:"The name shown on your public profile.",keywords:"display name profile"},{default:be(()=>[oe(r("input",{"onUpdate:modelValue":h[40]||(h[40]=T=>Re(De).displayName=T),class:"field w-56",placeholder:"Jane O.",onBlur:h[41]||(h[41]=T=>Je("Saved."))},null,544),[[ve,Re(De).displayName]])]),_:1}),E(Se,{block:"",title:"Bio",desc:"A short description others can see.",keywords:"bio about description"},{default:be(()=>[oe(r("textarea",{"onUpdate:modelValue":h[42]||(h[42]=T=>Re(De).bio=T),rows:"3",maxlength:"240",class:"field w-full resize-none",placeholder:"Flight director, North yard operations…",onBlur:h[43]||(h[43]=T=>Je("Saved."))},null,544),[[ve,Re(De).bio]]),r("div",t_,S((Re(De).bio||"").length)+"/240",1)]),_:1}),E(Se,{title:"Show email on profile",desc:"Let teammates see your email address.",keywords:"show email public visibility"},{default:be(()=>[E(sn,{modelValue:Re(De).showEmail,"onUpdate:modelValue":h[44]||(h[44]=T=>Re(De).showEmail=T)},null,8,["modelValue"])]),_:1})])):W.id==="security"?(v(),y("div",n_,[E(Se,{block:"",title:"Two-factor authentication",desc:"Require a one-time code at sign-in.",keywords:"two factor 2fa authentication security"},{default:be(()=>[r("div",i_,[r("span",{class:Me(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",Re(De).twoFactor?"bg-success-soft text-success-fg":"bg-surface-2 text-ink-secondary"])},[h[112]||(h[112]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(S(Re(De).twoFactor?"Enabled":"Disabled"),1)],2),!Re(De).twoFactor&&!Kn.value?(v(),y("button",{key:0,class:"btn-accent",onClick:Di},"Enable 2FA")):Re(De).twoFactor?(v(),y("button",{key:1,class:"btn-ghost",onClick:Fa},"Disable")):D("",!0)]),Kn.value?(v(),y("div",s_,[r("div",o_,[h[114]||(h[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",a_,[h[113]||(h[113]=r("div",{class:"text-xs text-ink-secondary"},"Scan with an authenticator app, or enter this secret:",-1)),r("div",r_,S(Oo.value),1),r("div",l_,[oe(r("input",{"onUpdate:modelValue":h[45]||(h[45]=T=>Ii.value=T),inputmode:"numeric",maxlength:"6",class:"field w-28 font-mono tracking-[0.3em]",placeholder:"000000"},null,512),[[ve,Ii.value]]),r("button",{class:"btn-accent",onClick:zo},"Verify & enable")]),We.value?(v(),y("p",u_,S(We.value),1)):D("",!0)])])])):D("",!0),Re(De).twoFactor&&rs.value.length?(v(),y("div",c_,[h[115]||(h[115]=r("div",{class:"text-xs font-semibold text-ink"},"Recovery codes",-1)),h[116]||(h[116]=r("div",{class:"mt-0.5 text-xs text-ink-muted"},"Store these somewhere safe — each works once.",-1)),r("div",d_,[(v(!0),y(ae,null,Fe(rs.value,T=>(v(),y("span",{key:T,class:"select-all"},S(T),1))),128))])])):D("",!0),h[117]||(h[117]=r("p",{class:"mt-2 text-xs text-ink-muted"},"Prototype — codes are generated locally until the account service verifies them.",-1))]),_:1}),E(Se,{block:"",title:"Active sessions",desc:"Devices currently signed in to your account.",keywords:"sessions devices logout sign out remote"},{default:be(()=>[r("div",f_,[r("div",h_,[r("div",p_,[E(Y,{name:"monitor",size:18})]),r("div",m_,[r("div",g_,[$(S(Ba())+" on "+S(Ao())+" ",1),h[118]||(h[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",v_,"Signed in "+S(Re(ru)(Re(Va))),1)]),r("button",{class:"btn-ghost",onClick:h[46]||(h[46]=T=>l("logout"))},"Log out")])]),h[119]||(h[119]=r("button",{class:"btn-ghost mt-2 opacity-60",disabled:"",title:"Requires the account service"}," Log out all other devices ",-1)),h[120]||(h[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})])):W.id==="team"?(v(),y("div",__,[Xe.id?(v(),y("div",y_,[E(Se,{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:be(()=>[r("div",b_,[r("div",x_,[oe(r("input",{"onUpdate:modelValue":h[47]||(h[47]=T=>Xe.email=T),type:"email",class:"field flex-1",placeholder:"name@pilotvault.local"},null,512),[[ve,Xe.email]]),oe(r("select",{"onUpdate:modelValue":h[48]||(h[48]=T=>Xe.role=T),class:"field w-32",disabled:cs.value,title:cs.value?"You cannot change your own role":""},[(v(!0),y(ae,null,Fe(Vs.value,T=>(v(),y("option",{key:T.value,value:T.value},S(T.label),9,k_))),128))],8,w_),[[Ot,Xe.role]])]),u.value?oe((v(),y("select",{key:0,"onUpdate:modelValue":h[49]||(h[49]=T=>Xe.organization=T),class:"field",title:"Organization"},[(v(!0),y(ae,null,Fe($o.value,T=>(v(),y("option",{key:T.value,value:T.value},S(T.label),9,S_))),128))],512)),[[Ot,Xe.organization]]):D("",!0),oe(r("input",{"onUpdate:modelValue":h[50]||(h[50]=T=>Xe.password=T),type:"password",class:"field",placeholder:"New password (leave blank to keep current)"},null,512),[[ve,Xe.password]]),r("label",T_,[E(sn,{modelValue:Xe.verified,"onUpdate:modelValue":h[51]||(h[51]=T=>Xe.verified=T)},null,8,["modelValue"]),h[121]||(h[121]=$(" Email verified ",-1))]),r("div",P_,[r("button",{class:"btn-accent",disabled:Bi.value,onClick:Ha},S(Bi.value?"Saving…":"Save changes"),9,C_),r("button",{class:"btn-ghost",onClick:$n},"Cancel"),An.value?(v(),y("span",L_,S(An.value),1)):D("",!0),cs.value?(v(),y("span",M_,"Editing your own account — role locked.")):D("",!0)])])]),_:1},8,["title"])])):(v(),y("div",E_,[E(Se,{block:"",title:"Add user",desc:"Create a new account. Admins add users within their organization; superadmins can target any.",keywords:"add user create account role admin organization"},{default:be(()=>[r("div",O_,[r("div",z_,[oe(r("input",{"onUpdate:modelValue":h[52]||(h[52]=T=>dt.email=T),type:"email",class:"field flex-1",placeholder:"name@pilotvault.local"},null,512),[[ve,dt.email]]),oe(r("select",{"onUpdate:modelValue":h[53]||(h[53]=T=>dt.role=T),class:"field w-32"},[(v(!0),y(ae,null,Fe(Vs.value,T=>(v(),y("option",{key:T.value,value:T.value},S(T.label),9,A_))),128))],512),[[Ot,dt.role]])]),u.value?oe((v(),y("select",{key:0,"onUpdate:modelValue":h[54]||(h[54]=T=>dt.organization=T),class:"field",title:"Organization"},[(v(!0),y(ae,null,Fe($o.value,T=>(v(),y("option",{key:T.value,value:T.value},S(T.label),9,$_))),128))],512)),[[Ot,dt.organization]]):(v(),y("div",I_,[h[122]||(h[122]=$(" New users join your organization: ",-1)),r("span",D_,S(t.organizationName||"—"),1)])),oe(r("input",{"onUpdate:modelValue":h[55]||(h[55]=T=>dt.password=T),type:"password",class:"field",placeholder:"Temporary password (min 8 chars)"},null,512),[[ve,dt.password]]),r("div",N_,[r("button",{class:"btn-accent",disabled:Ni.value,onClick:Ua},S(Ni.value?"Creating…":"Create user"),9,R_),bi.value?(v(),y("span",F_,S(bi.value),1)):D("",!0)])])]),_:1})])),r("div",B_,[r("div",V_,[h[123]||(h[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},S(Gn.value?"Loading…":"Refresh"),9,U_)]),us.value?(v(),y("div",Z_,S(us.value),1)):!ls.value.length&&!Gn.value?(v(),y("div",H_,"No users yet.")):(v(),y("div",j_,[r("table",W_,[r("thead",null,[r("tr",K_,[(v(),y(ae,null,Fe(["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"},S(T),1)),64))])]),r("tbody",null,[(v(!0),y(ae,null,Fe(ls.value,T=>(v(),y("tr",{key:T.id,class:Me(["border-b border-line last:border-0",Xe.id===T.id?"bg-accent-soft":""])},[r("td",G_,[r("span",q_,S(T.email),1),T.email===t.email?(v(),y("span",Y_,"(you)")):D("",!0)]),r("td",J_,[r("span",{class:Me(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",b(T.role||"user")])},[E(Y,{name:_(T.role||"user"),size:12},null,8,["name"]),$(S(p(T.role||"user")),1)],2)]),r("td",X_,[r("span",{class:Me(["text-sm",T.organizationName?"text-ink-secondary":"text-ink-muted"])},S(T.organizationName||"—"),3)]),r("td",Q_,[r("span",{class:Me(["text-xs",T.verified?"text-success-fg":"text-ink-muted"])},S(T.verified?"Verified":"Unverified"),3)]),r("td",ey,[Xt.value===T.id?(v(),y(ae,{key:0},[h[124]||(h[124]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Remove?",-1)),r("button",{class:"btn-ghost mr-1",onClick:h[56]||(h[56]=Qe=>Xt.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,ty)],64)):(v(),y("div",ny,[r("button",{class:"btn-ghost inline-flex items-center gap-1.5",onClick:Qe=>ds(T)},[E(Y,{name:"settings",size:14}),h[125]||(h[125]=$(" Edit ",-1))],8,iy),T.email!==t.email?(v(),y("button",{key:0,class:"btn-ghost inline-flex items-center gap-1.5",onClick:Qe=>Xt.value=T.id},[E(Y,{name:"trash",size:14}),h[126]||(h[126]=$(" Remove ",-1))],8,sy)):D("",!0)]))])],2))),128))])])]))])])):W.id==="organizations"?(v(),y("div",oy,[kn.id?(v(),y("div",ay,[E(Se,{block:"",title:"Rename organization",desc:"Update the organization's display name.",keywords:"rename organization edit"},{default:be(()=>[r("div",ry,[oe(r("input",{"onUpdate:modelValue":h[57]||(h[57]=T=>kn.name=T),class:"field",placeholder:"Organization name",onKeyup:Xl(Do,["enter"])},null,544),[[ve,kn.name]]),r("div",ly,[r("button",{class:"btn-accent",onClick:Do},"Save changes"),r("button",{class:"btn-ghost",onClick:Us},"Cancel"),Sn.value?(v(),y("span",uy,S(Sn.value),1)):D("",!0)])])]),_:1})])):(v(),y("div",cy,[E(Se,{block:"",title:"Add organization",desc:"Create a new organization. Assign admins and users to it from User management.",keywords:"add organization create tenant company"},{default:be(()=>[r("div",dy,[oe(r("input",{"onUpdate:modelValue":h[58]||(h[58]=T=>In.name=T),class:"field",placeholder:"e.g. Northwind Aerial",onKeyup:Xl(Io,["enter"])},null,544),[[ve,In.name]]),r("div",fy,[r("button",{class:"btn-accent",disabled:Vi.value,onClick:Io},S(Vi.value?"Creating…":"Create organization"),9,hy),Mt.value?(v(),y("span",py,S(Mt.value),1)):D("",!0)])])]),_:1})])),r("div",my,[r("div",{class:"flex items-center justify-between px-5 py-4"},[h[127]||(h[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")]),Ri.value.length?(v(),y("div",vy,[r("table",_y,[r("thead",null,[r("tr",yy,[(v(),y(ae,null,Fe(["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"},S(T),1)),64))])]),r("tbody",null,[(v(!0),y(ae,null,Fe(Ri.value,T=>(v(),y("tr",{key:T.id,class:Me(["border-b border-line last:border-0",kn.id===T.id?"bg-accent-soft":""])},[r("td",by,[r("span",xy,[E(Y,{name:"grid",size:14,class:"text-ink-muted"}),$(S(T.name),1)])]),r("td",wy,S(Ui.value[T.id]||0),1),r("td",ky,[xi.value===T.id?(v(),y(ae,{key:0},[h[128]||(h[128]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),r("button",{class:"btn-ghost mr-1",onClick:h[59]||(h[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=>nn(T)}," Delete ",8,Sy)],64)):(v(),y("div",Ty,[r("button",{class:"btn-ghost inline-flex items-center gap-1.5",onClick:Qe=>ja(T)},[E(Y,{name:"settings",size:14}),h[129]||(h[129]=$(" Rename ",-1))],8,Py),r("button",{class:"btn-ghost inline-flex items-center gap-1.5",disabled:(Ui.value[T.id]||0)>0,title:(Ui.value[T.id]||0)>0?"Reassign or remove members first":"",onClick:Qe=>xi.value=T.id},[E(Y,{name:"trash",size:14}),h[130]||(h[130]=$(" Delete ",-1))],8,Cy)]))])],2))),128))])])])):(v(),y("div",gy,"No organizations yet."))])])):W.id==="advanced"?(v(),y("div",Ly,[r("div",My,[E(Se,{title:"Export data",desc:"Download your settings and profile as JSON.",keywords:"export data download backup"},{default:be(()=>[r("button",{class:"btn-ghost",onClick:wi},[E(Y,{name:"download",size:15,class:"mr-1.5 inline"}),h[131]||(h[131]=$("Export",-1))])]),_:1}),E(Se,{block:"",title:"Import data",desc:"Restore settings from a previous export.",keywords:"import data upload restore"},{default:be(()=>[r("label",Ey,[E(Y,{name:"upload",size:15,class:"mr-1.5 inline"}),h[132]||(h[132]=$("Choose file… ",-1)),r("input",{type:"file",accept:"application/json,.json",class:"hidden",onChange:Tn},null,32)]),fs.value?(v(),y("p",Oy,S(fs.value),1)):D("",!0)]),_:1})]),r("div",zy,[r("div",Ay,[E(Y,{name:"alertTriangle",size:18}),h[133]||(h[133]=r("h3",{class:"text-sm font-bold uppercase tracking-caps"},"Danger zone",-1))]),h[138]||(h[138]=r("p",{class:"mt-1 text-xs text-ink-secondary"},"Deleting your account is permanent and cannot be undone.",-1)),r("div",$y,[h[137]||(h[137]=r("div",{class:"text-sm font-semibold text-ink"},"Delete account",-1)),r("label",Iy,[oe(r("input",{"onUpdate:modelValue":h[60]||(h[60]=T=>pt.understand=T),type:"checkbox",class:"mt-0.5 h-4 w-4 accent-[var(--danger)]"},null,512),[[da,pt.understand]]),h[134]||(h[134]=$(" I understand this permanently deletes my account and all associated data. ",-1))]),r("div",Dy,[r("label",Ny,[h[135]||(h[135]=$("Type ",-1)),r("span",Ry,S(Zs.value),1),h[136]||(h[136]=$(" to confirm",-1))]),oe(r("input",{"onUpdate:modelValue":h[61]||(h[61]=T=>pt.typed=T),class:"field w-full max-w-[360px] font-mono",placeholder:Zs.value},null,8,Fy),[[ve,pt.typed]])]),r("div",By,[pt.armed?(v(),y("button",{key:1,class:"rounded bg-danger px-4 py-2.5 text-sm font-semibold text-white transition enabled:hover:brightness-110 disabled:cursor-not-allowed disabled:opacity-50",disabled:pt.cooldown>0,onClick:hs},S(pt.cooldown>0?`Confirm in ${pt.cooldown}s…`:"Permanently delete account"),9,Uy)):(v(),y("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:No}," Delete account… ",8,Vy)),pt.armed&&pt.cooldown>0?(v(),y("span",Zy,"Cooling-off period — read once more.")):D("",!0)]),pt.msg?(v(),y("p",Hy,S(pt.msg),1)):D("",!0)])])])):D("",!0)],64))),128))])]),E(hh,{name:"fade"},{default:be(()=>[_i.value?(v(),y("div",jy,[E(Y,{name:"check",size:16,class:"text-success-fg"}),$(S(_i.value),1)])):D("",!0)]),_:1})]))}},Ky=cm(Wy,[["__scopeId","data-v-4fe25eb7"]]),Gy={class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},qy={class:"flex flex-wrap items-center gap-3"},Yy={class:"inline-flex rounded-lg border border-line bg-surface-1 p-0.5"},Jy=["onClick"],Xy={class:"ml-auto flex items-center gap-2"},Qy=["href"],e1={class:"grid grid-cols-4 gap-4 max-[900px]:grid-cols-2"},t1={class:"eyebrow"},n1={key:0,class:"panel border-danger/40 p-4 text-sm text-danger-fg"},i1={key:0,class:"panel p-5"},s1={class:"mb-4 flex items-center justify-between"},o1={class:"eyebrow"},a1={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},r1={class:"block"},l1={class:"block"},u1={class:"block"},c1={class:"block"},d1={key:0,value:""},f1=["value"],h1={class:"block"},p1={class:"block"},m1={class:"block"},g1={class:"block"},v1={class:"block"},_1=["value"],y1={class:"block"},b1=["value"],x1={class:"block"},w1=["value"],k1={class:"block"},S1={class:"mt-3 block"},T1={key:0,class:"mt-3 grid grid-cols-2 gap-3 max-[760px]:grid-cols-1"},P1={class:"block"},C1={class:"block"},L1={class:"block"},M1={class:"block"},E1={class:"col-span-2 block max-[760px]:col-span-1"},O1={class:"mt-4 flex items-center gap-3"},z1=["disabled"],A1={key:0,class:"text-sm text-danger-fg"},$1={class:"panel overflow-hidden p-0"},I1={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},D1={key:1,class:"grid place-items-center px-5 py-16 text-center"},N1={key:2,class:"overflow-x-auto"},R1={class:"w-full border-collapse text-sm"},F1={class:"text-left"},B1={class:"whitespace-nowrap px-5 py-3 font-mono text-ink"},V1={key:0,class:"text-ink-muted"},U1={class:"px-5 py-3 text-ink-secondary"},Z1=["title"],H1={class:"px-5 py-3 font-mono text-ink-secondary"},j1={class:"px-5 py-3 text-ink-secondary"},W1={class:"px-5 py-3"},K1=["onClick"],G1={class:"whitespace-nowrap px-5 py-3 text-right"},q1=["onClick"],Y1=["onClick"],J1=["onClick"],X1={key:0,class:"border-b border-line bg-surface-2"},Q1={colspan:"7",class:"px-5 py-3"},eb={class:"flex flex-wrap gap-x-8 gap-y-1.5 text-xs"},tb={class:"text-ink-secondary"},nb={class:"text-ink"},ib={class:"text-ink-secondary"},sb={class:"text-ink"},ob={class:"text-ink-secondary"},ab={class:"font-mono text-ink"},rb={key:0,class:"text-ink-secondary"},lb={class:"text-ink"},ub={key:0,class:"mt-2 space-y-1"},cb={key:1,class:"mt-2 text-xs text-success-fg"},db={key:0,class:"panel p-5"},fb={class:"mb-4 flex items-center justify-between"},hb={class:"eyebrow"},pb={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},mb={class:"block"},gb={class:"block"},vb={class:"block"},_b={class:"block"},yb={class:"block"},bb={class:"block"},xb=["value"],wb={class:"mt-3 flex flex-wrap gap-6"},kb={class:"flex items-center gap-2 text-sm text-ink-secondary"},Sb={class:"flex items-center gap-2 text-sm text-ink-secondary"},Tb={class:"mt-4 flex items-center gap-3"},Pb=["disabled"],Cb={key:0,class:"text-sm text-danger-fg"},Lb={class:"panel overflow-hidden p-0"},Mb={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},Eb={key:1,class:"grid place-items-center px-5 py-16 text-center"},Ob={key:2,class:"overflow-x-auto"},zb={class:"w-full border-collapse text-sm"},Ab={class:"text-left"},$b={class:"px-5 py-3 font-semibold text-ink"},Ib={class:"px-5 py-3 text-ink-secondary"},Db={class:"px-5 py-3 font-mono text-ink-secondary"},Nb={class:"px-5 py-3"},Rb={key:1,class:"text-ink-muted"},Fb={class:"px-5 py-3"},Bb={class:"whitespace-nowrap px-5 py-3 text-right"},Vb=["onClick"],Ub=["onClick"],Zb=["onClick"],Hb={__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=H("flights"),u=H([]),d=H([]),p=H(!1),_=H("");async function b(){p.value=!0,_.value="";const[j,M]=await Promise.all([$c(),bp()]);(!j.ok||!M.ok)&&(_.value=j.status===503||M.status===503?"Logbook storage is not configured on the API Server (service account missing).":"Could not load the logbook."),u.value=j.drones,d.value=M.flights,p.value=!1}ui(b);function C(j){const M=j.compliance||{};return M.exempt?{tone:"neutral",label:"Exempt"}:(M.redFlags||[]).length?{tone:"danger",label:`${M.redFlags.length} issue${M.redFlags.length>1?"s":""}`}:{tone:"success",label:"Compliant"}}const k=H("");function O(j){k.value=k.value===j?"":j}const R=[{value:"open",label:"Open"},{value:"specific",label:"Specific"},{value:"certified",label:"Certified"}],F=[{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"}],X=[{value:"",label:"Auto (from drone)"},{value:"manual",label:"Manual"},{value:"automatic",label:"Automatic (FDR)"}];function q(){var j;return{operationDate:new Date().toISOString().slice(0,10),startTime:"",endTime:"",drone:((j=u.value[0])==null?void 0:j.id)||"",areaRoute:"",maxAltitudeAgl:"",pilotName:i.email,certificateRef:"",category:"open",purpose:"commercial",loggingPath:"",rawFdrLogUrl:"",authorisationRef:"",weather:"",airspaceRef:"",observer:"",incidents:"",notes:""}}const ge=H(!1),we=H(""),K=xt(q()),fe=H(""),ie=H(!1),me=H(!1);function Le(){Object.assign(K,q()),we.value="",fe.value="",me.value=!1,ge.value=!0}function Ee(j){Object.assign(K,{operationDate:(j.operationDate||"").slice(0,10),startTime:j.startTime||"",endTime:j.endTime||"",drone:j.drone||"",areaRoute:j.areaRoute||"",maxAltitudeAgl:j.maxAltitudeAgl||"",pilotName:j.pilotName||"",certificateRef:j.certificateRef||"",category:j.category||"open",purpose:j.purpose||"commercial",loggingPath:j.loggingPath||"",rawFdrLogUrl:j.rawFdrLogUrl||"",authorisationRef:j.authorisationRef||"",weather:j.weather||"",airspaceRef:j.airspaceRef||"",observer:j.observer||"",incidents:j.incidents||"",notes:j.notes||""}),we.value=j.id,fe.value="",me.value=!!(j.weather||j.airspaceRef||j.observer||j.incidents||j.notes),ge.value=!0}function Ve(){ge.value=!1,we.value=""}async function pe(){var z;if(fe.value="",!K.drone){fe.value="Select a drone first (add one on the Drones tab).";return}ie.value=!0;const j={...K,maxAltitudeAgl:Number(K.maxAltitudeAgl)||0},M=we.value?await wp(we.value,j):await xp(j);if(ie.value=!1,!M.ok){fe.value=((z=M.body)==null?void 0:z.error)||"Could not save the flight.";return}ge.value=!1,await b()}const $e=H("");async function Oe(j){const M=await kp(j.id);$e.value="",M.ok&&await b()}const Q=["","C0","C1","C2","C3","C4","C5","C6"];function ue(){return{name:"",model:"",serial:"",operatorNumber:"",mtomGrams:"",isToy:!1,autologsFlights:!1,cClass:""}}const ye=H(!1),ze=H(""),ce=xt(ue()),re=H(""),ee=H(!1);function nt(){Object.assign(ce,ue()),ze.value="",re.value="",ye.value=!0}function he(j){Object.assign(ce,{name:j.name||"",model:j.model||"",serial:j.serial||"",operatorNumber:j.operatorNumber||"",mtomGrams:j.mtomGrams||"",isToy:!!j.isToy,autologsFlights:!!j.autologsFlights,cClass:j.cClass||""}),ze.value=j.id,re.value="",ye.value=!0}function Te(){ye.value=!1,ze.value=""}async function qe(){var z;if(re.value="",!ce.name.trim()){re.value="Give the drone a name.";return}ee.value=!0;const j={...ce,mtomGrams:Number(ce.mtomGrams)||0},M=ze.value?await _p(ze.value,j):await vp(j);if(ee.value=!1,!M.ok){re.value=((z=M.body)==null?void 0:z.error)||"Could not save the drone.";return}ye.value=!1,await b()}const lt=H("");async function Ye(j){var z;const M=await yp(j.id);lt.value="",M.ok?await b():re.value=((z=M.body)==null?void 0:z.error)||"Could not delete the drone."}const Ue=xe(()=>{const j=d.value.length,M=d.value.filter(ut=>{var it;return(((it=ut.compliance)==null?void 0:it.redFlags)||[]).length}).length,z=d.value.filter(ut=>{var it;return(it=ut.compliance)==null?void 0:it.required}).length;return{total:j,flagged:M,required:z,fleet:u.value.length}});return(j,M)=>(v(),y("div",Gy,[r("div",qy,[r("div",Yy,[(v(),y(ae,null,Fe([["flights","Flights"],["drones","Drones"]],z=>r("button",{key:z[0],class:Me(["rounded-md px-3.5 py-1.5 text-sm font-semibold transition",l.value===z[0]?"bg-accent-soft text-accent-soft-fg":"text-ink-secondary hover:text-ink"]),onClick:ut=>l.value=z[0]},S(z[1]),11,Jy)),64))]),r("div",Xy,[r("a",{href:Re(Sp)(),class:"btn-ghost inline-flex items-center gap-2",title:"Download a compliance CSV (Trafikstyrelsen / police disclosure)"},[E(Y,{name:"download",size:15}),M[29]||(M[29]=$(" Export CSV ",-1))],8,Qy),l.value==="flights"?(v(),y("button",{key:0,class:"btn-accent inline-flex items-center gap-2",onClick:Le},[E(Y,{name:"plus",size:15}),M[30]||(M[30]=$(" Log flight ",-1))])):(v(),y("button",{key:1,class:"btn-accent inline-flex items-center gap-2",onClick:nt},[E(Y,{name:"plus",size:15}),M[31]||(M[31]=$(" Add drone ",-1))]))])]),r("div",e1,[(v(!0),y(ae,null,Fe([{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"}],z=>(v(),y("div",{key:z.label,class:"panel p-5"},[r("div",t1,S(z.label),1),r("div",{class:Me(["mt-2 text-[30px] font-bold leading-none tracking-tightest",z.tone==="danger"?"text-danger-fg":z.tone==="success"?"text-success-fg":"text-ink"])},S(z.value),3)]))),128))]),_.value?(v(),y("div",n1,S(_.value),1)):D("",!0),l.value==="flights"?(v(),y(ae,{key:1},[ge.value?(v(),y("div",i1,[r("div",s1,[r("div",null,[r("div",o1,S(we.value?"Edit entry":"New entry"),1),M[32]||(M[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},[E(Y,{name:"x",size:16})])]),r("div",a1,[r("label",r1,[M[33]||(M[33]=r("span",{class:"eyebrow mb-1 block"},"Date",-1)),oe(r("input",{"onUpdate:modelValue":M[0]||(M[0]=z=>K.operationDate=z),type:"date",class:"field"},null,512),[[ve,K.operationDate]])]),r("label",l1,[M[34]||(M[34]=r("span",{class:"eyebrow mb-1 block"},"Start",-1)),oe(r("input",{"onUpdate:modelValue":M[1]||(M[1]=z=>K.startTime=z),type:"time",class:"field"},null,512),[[ve,K.startTime]])]),r("label",u1,[M[35]||(M[35]=r("span",{class:"eyebrow mb-1 block"},"End",-1)),oe(r("input",{"onUpdate:modelValue":M[2]||(M[2]=z=>K.endTime=z),type:"time",class:"field"},null,512),[[ve,K.endTime]])]),r("label",c1,[M[36]||(M[36]=r("span",{class:"eyebrow mb-1 block"},"Drone",-1)),oe(r("select",{"onUpdate:modelValue":M[3]||(M[3]=z=>K.drone=z),class:"field"},[u.value.length?D("",!0):(v(),y("option",d1,"— add a drone first —")),(v(!0),y(ae,null,Fe(u.value,z=>(v(),y("option",{key:z.id,value:z.id},S(z.name)+S(z.model?` · ${z.model}`:""),9,f1))),128))],512),[[Ot,K.drone]])]),r("label",h1,[M[37]||(M[37]=r("span",{class:"eyebrow mb-1 block"},"Max altitude (m AGL)",-1)),oe(r("input",{"onUpdate:modelValue":M[4]||(M[4]=z=>K.maxAltitudeAgl=z),type:"number",min:"0",class:"field",placeholder:"120"},null,512),[[ve,K.maxAltitudeAgl]])]),r("label",p1,[M[38]||(M[38]=r("span",{class:"eyebrow mb-1 block"},"Area / route",-1)),oe(r("input",{"onUpdate:modelValue":M[5]||(M[5]=z=>K.areaRoute=z),class:"field",placeholder:"Field N of Roskilde, grid survey"},null,512),[[ve,K.areaRoute]])]),r("label",m1,[M[39]||(M[39]=r("span",{class:"eyebrow mb-1 block"},"Remote pilot name",-1)),oe(r("input",{"onUpdate:modelValue":M[6]||(M[6]=z=>K.pilotName=z),class:"field",placeholder:"Full name"},null,512),[[ve,K.pilotName]])]),r("label",g1,[M[40]||(M[40]=r("span",{class:"eyebrow mb-1 block"},"Certificate ref",-1)),oe(r("input",{"onUpdate:modelValue":M[7]||(M[7]=z=>K.certificateRef=z),class:"field",placeholder:"A2 / STS cert no."},null,512),[[ve,K.certificateRef]])]),r("label",v1,[M[41]||(M[41]=r("span",{class:"eyebrow mb-1 block"},"Logging path",-1)),oe(r("select",{"onUpdate:modelValue":M[8]||(M[8]=z=>K.loggingPath=z),class:"field"},[(v(),y(ae,null,Fe(X,z=>r("option",{key:z.value,value:z.value},S(z.label),9,_1)),64))],512),[[Ot,K.loggingPath]])]),r("label",y1,[M[42]||(M[42]=r("span",{class:"eyebrow mb-1 block"},"Category",-1)),oe(r("select",{"onUpdate:modelValue":M[9]||(M[9]=z=>K.category=z),class:"field"},[(v(),y(ae,null,Fe(R,z=>r("option",{key:z.value,value:z.value},S(z.label),9,b1)),64))],512),[[Ot,K.category]])]),r("label",x1,[M[43]||(M[43]=r("span",{class:"eyebrow mb-1 block"},"Purpose",-1)),oe(r("select",{"onUpdate:modelValue":M[10]||(M[10]=z=>K.purpose=z),class:"field"},[(v(),y(ae,null,Fe(F,z=>r("option",{key:z.value,value:z.value},S(z.label),9,w1)),64))],512),[[Ot,K.purpose]])]),r("label",k1,[M[44]||(M[44]=r("span",{class:"eyebrow mb-1 block"},"Authorisation ref",-1)),oe(r("input",{"onUpdate:modelValue":M[11]||(M[11]=z=>K.authorisationRef=z),class:"field",placeholder:"Specific-category ref"},null,512),[[ve,K.authorisationRef]])])]),r("label",S1,[M[45]||(M[45]=r("span",{class:"eyebrow mb-1 block"},"FDR log URL (automatic path)",-1)),oe(r("input",{"onUpdate:modelValue":M[12]||(M[12]=z=>K.rawFdrLogUrl=z),class:"field",placeholder:"Link to the stored flight-data-recorder export"},null,512),[[ve,K.rawFdrLogUrl]])]),r("button",{class:"mt-4 flex items-center gap-1.5 text-sm font-semibold text-accent",onClick:M[13]||(M[13]=z=>me.value=!me.value)},[E(Y,{name:me.value?"x":"plus",size:14},null,8,["name"]),M[46]||(M[46]=$(" Operational details (weather, airspace, incidents) ",-1))]),me.value?(v(),y("div",T1,[r("label",P1,[M[47]||(M[47]=r("span",{class:"eyebrow mb-1 block"},"Weather / wind",-1)),oe(r("input",{"onUpdate:modelValue":M[14]||(M[14]=z=>K.weather=z),class:"field",placeholder:"6 m/s NW, CAVOK"},null,512),[[ve,K.weather]])]),r("label",C1,[M[48]||(M[48]=r("span",{class:"eyebrow mb-1 block"},"Airspace / NOTAM ref",-1)),oe(r("input",{"onUpdate:modelValue":M[15]||(M[15]=z=>K.airspaceRef=z),class:"field"},null,512),[[ve,K.airspaceRef]])]),r("label",L1,[M[49]||(M[49]=r("span",{class:"eyebrow mb-1 block"},"Observer",-1)),oe(r("input",{"onUpdate:modelValue":M[16]||(M[16]=z=>K.observer=z),class:"field"},null,512),[[ve,K.observer]])]),r("label",M1,[M[50]||(M[50]=r("span",{class:"eyebrow mb-1 block"},"Incidents / anomalies",-1)),oe(r("input",{"onUpdate:modelValue":M[17]||(M[17]=z=>K.incidents=z),class:"field",placeholder:"RTH trigger, GPS dropout…"},null,512),[[ve,K.incidents]])]),r("label",E1,[M[51]||(M[51]=r("span",{class:"eyebrow mb-1 block"},"Notes",-1)),oe(r("textarea",{"onUpdate:modelValue":M[18]||(M[18]=z=>K.notes=z),rows:"2",class:"field"},null,512),[[ve,K.notes]])])])):D("",!0),r("div",O1,[r("button",{class:"btn-accent",disabled:ie.value,onClick:pe},S(ie.value?"Saving…":we.value?"Save changes":"Log flight"),9,z1),r("button",{class:"btn-ghost",onClick:Ve},"Cancel"),fe.value?(v(),y("span",A1,S(fe.value),1)):D("",!0)])])):D("",!0),r("div",$1,[p.value?(v(),y("div",I1,"Loading…")):d.value.length?(v(),y("div",N1,[r("table",R1,[r("thead",null,[r("tr",F1,[(v(),y(ae,null,Fe(["Date","Drone","Area / route","Alt","Pilot","Compliance",""],z=>r("th",{key:z,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(z),1)),64))])]),r("tbody",null,[(v(!0),y(ae,null,Fe(d.value,z=>{var ut,it,wt,m;return v(),y(ae,{key:z.id},[r("tr",{class:Me(["border-b border-line last:border-0",we.value===z.id?"bg-accent-soft":""])},[r("td",B1,[$(S((z.operationDate||"").slice(0,10))+" ",1),z.startTime?(v(),y("span",V1,S(z.startTime),1)):D("",!0)]),r("td",U1,S(z.droneName||"—"),1),r("td",{class:"max-w-[220px] truncate px-5 py-3 text-ink-secondary",title:z.areaRoute},S(z.areaRoute||"—"),9,Z1),r("td",H1,S(z.maxAltitudeAgl?z.maxAltitudeAgl+" m":"—"),1),r("td",j1,S(z.pilotName||"—"),1),r("td",W1,[r("button",{class:Me(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",o[C(z).tone]]),onClick:f=>O(z.id)},[C(z).tone==="danger"?(v(),et(Y,{key:0,name:"alertTriangle",size:12})):C(z).tone==="success"?(v(),et(Y,{key:1,name:"check",size:12})):D("",!0),$(" "+S(C(z).label),1)],10,K1)]),r("td",G1,[$e.value===z.id?(v(),y(ae,{key:0},[M[54]||(M[54]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),r("button",{class:"btn-ghost mr-1",onClick:M[19]||(M[19]=f=>$e.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:f=>Oe(z)},"Delete",8,q1)],64)):(v(),y(ae,{key:1},[r("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:f=>Ee(z)},[E(Y,{name:"sliders",size:13}),M[55]||(M[55]=$(" Edit",-1))],8,Y1),r("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:f=>$e.value=z.id},[E(Y,{name:"trash",size:13})],8,J1)],64))])],2),k.value===z.id?(v(),y("tr",X1,[r("td",Q1,[r("div",eb,[r("span",tb,[M[56]||(M[56]=$("Logging path: ",-1)),r("b",nb,S(((ut=z.compliance)==null?void 0:ut.loggingPath)||"—"),1)]),r("span",ib,[M[57]||(M[57]=$("Category: ",-1)),r("b",sb,S(z.category||"—"),1)]),r("span",ob,[M[58]||(M[58]=$("Retain until: ",-1)),r("b",ab,S((z.retentionUntil||"").slice(0,10)||"—"),1)]),(it=z.compliance)!=null&&it.exempt?(v(),y("span",rb,[M[59]||(M[59]=$("Exempt: ",-1)),r("b",lb,S(z.compliance.exemptReason),1)])):D("",!0)]),(((wt=z.compliance)==null?void 0:wt.redFlags)||[]).length?(v(),y("ul",ub,[(v(!0),y(ae,null,Fe(z.compliance.redFlags,(f,x)=>(v(),y("li",{key:x,class:"flex items-start gap-2 text-xs text-danger-fg"},[E(Y,{name:"alertTriangle",size:13,class:"mt-px shrink-0"}),$(" "+S(f),1)]))),128))])):(m=z.compliance)!=null&&m.exempt?D("",!0):(v(),y("div",cb,"No compliance gaps detected."))])])):D("",!0)],64)}),128))])])])):(v(),y("div",D1,[E(Y,{name:"book",size:26,class:"text-ink-muted"}),M[52]||(M[52]=r("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No flights logged yet",-1)),M[53]||(M[53]=r("div",{class:"mt-1 text-xs text-ink-muted"},"Log your first operation to start the 5-year retention record.",-1))]))])],64)):(v(),y(ae,{key:2},[ye.value?(v(),y("div",db,[r("div",fb,[r("div",null,[r("div",hb,S(ze.value?"Edit drone":"New drone"),1),M[60]||(M[60]=r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Aircraft registry",-1))]),r("button",{class:"btn-icon",onClick:Te},[E(Y,{name:"x",size:16})])]),r("div",pb,[r("label",mb,[M[61]||(M[61]=r("span",{class:"eyebrow mb-1 block"},"Name",-1)),oe(r("input",{"onUpdate:modelValue":M[20]||(M[20]=z=>ce.name=z),class:"field",placeholder:"Mavic-01"},null,512),[[ve,ce.name]])]),r("label",gb,[M[62]||(M[62]=r("span",{class:"eyebrow mb-1 block"},"Model",-1)),oe(r("input",{"onUpdate:modelValue":M[21]||(M[21]=z=>ce.model=z),class:"field",placeholder:"DJI Mavic 3 Enterprise"},null,512),[[ve,ce.model]])]),r("label",vb,[M[63]||(M[63]=r("span",{class:"eyebrow mb-1 block"},"Serial",-1)),oe(r("input",{"onUpdate:modelValue":M[22]||(M[22]=z=>ce.serial=z),class:"field"},null,512),[[ve,ce.serial]])]),r("label",_b,[M[64]||(M[64]=r("span",{class:"eyebrow mb-1 block"},"Operator no.",-1)),oe(r("input",{"onUpdate:modelValue":M[23]||(M[23]=z=>ce.operatorNumber=z),class:"field",placeholder:"DNK…"},null,512),[[ve,ce.operatorNumber]])]),r("label",yb,[M[65]||(M[65]=r("span",{class:"eyebrow mb-1 block"},"MTOM (grams)",-1)),oe(r("input",{"onUpdate:modelValue":M[24]||(M[24]=z=>ce.mtomGrams=z),type:"number",min:"0",class:"field",placeholder:"920"},null,512),[[ve,ce.mtomGrams]])]),r("label",bb,[M[66]||(M[66]=r("span",{class:"eyebrow mb-1 block"},"C-class",-1)),oe(r("select",{"onUpdate:modelValue":M[25]||(M[25]=z=>ce.cClass=z),class:"field"},[(v(),y(ae,null,Fe(Q,z=>r("option",{key:z,value:z},S(z||"— none —"),9,xb)),64))],512),[[Ot,ce.cClass]])])]),r("div",wb,[r("label",kb,[oe(r("input",{"onUpdate:modelValue":M[26]||(M[26]=z=>ce.autologsFlights=z),type:"checkbox",class:"h-4 w-4 accent-[var(--accent)]"},null,512),[[da,ce.autologsFlights]]),M[67]||(M[67]=$(" Auto-logs flights (onboard FDR) ",-1))]),r("label",Sb,[oe(r("input",{"onUpdate:modelValue":M[27]||(M[27]=z=>ce.isToy=z),type:"checkbox",class:"h-4 w-4 accent-[var(--accent)]"},null,512),[[da,ce.isToy]]),M[68]||(M[68]=$(" Toy drone (logbook-exempt) ",-1))])]),r("div",Tb,[r("button",{class:"btn-accent",disabled:ee.value,onClick:qe},S(ee.value?"Saving…":ze.value?"Save changes":"Add drone"),9,Pb),r("button",{class:"btn-ghost",onClick:Te},"Cancel"),re.value?(v(),y("span",Cb,S(re.value),1)):D("",!0)])])):D("",!0),r("div",Lb,[p.value?(v(),y("div",Mb,"Loading…")):u.value.length?(v(),y("div",Ob,[r("table",zb,[r("thead",null,[r("tr",Ab,[(v(),y(ae,null,Fe(["Name","Model","MTOM","Class","FDR",""],z=>r("th",{key:z,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(z),1)),64))])]),r("tbody",null,[(v(!0),y(ae,null,Fe(u.value,z=>(v(),y("tr",{key:z.id,class:Me(["border-b border-line last:border-0",ze.value===z.id?"bg-accent-soft":""])},[r("td",$b,S(z.name),1),r("td",Ib,S(z.model||"—"),1),r("td",Db,S(z.mtomGrams?z.mtomGrams+" g":"—"),1),r("td",Nb,[z.cClass?(v(),y("span",{key:0,class:Me(["inline-flex rounded-full px-2 py-0.5 text-[11px] font-semibold",o.accent])},S(z.cClass),3)):(v(),y("span",Rb,"—")),z.isToy?(v(),y("span",{key:2,class:Me(["ml-1 inline-flex rounded-full px-2 py-0.5 text-[11px] font-semibold",o.neutral])},"toy",2)):D("",!0)]),r("td",Fb,[r("span",{class:Me(["text-xs",z.autologsFlights?"text-success-fg":"text-ink-muted"])},S(z.autologsFlights?"yes":"no"),3)]),r("td",Bb,[lt.value===z.id?(v(),y(ae,{key:0},[M[71]||(M[71]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),r("button",{class:"btn-ghost mr-1",onClick:M[28]||(M[28]=ut=>lt.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:ut=>Ye(z)},"Delete",8,Vb)],64)):(v(),y(ae,{key:1},[r("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:ut=>he(z)},[E(Y,{name:"sliders",size:13}),M[72]||(M[72]=$(" Edit",-1))],8,Ub),r("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:ut=>lt.value=z.id},[E(Y,{name:"trash",size:13})],8,Zb)],64))])],2))),128))])])])):(v(),y("div",Eb,[E(Y,{name:"drone",size:26,class:"text-ink-muted"}),M[69]||(M[69]=r("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No drones registered",-1)),M[70]||(M[70]=r("div",{class:"mt-1 text-xs text-ink-muted"},"Register the airframes you fly to log flights against them.",-1))]))])],64))]))}},jb={class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},Wb={class:"flex flex-wrap items-center gap-3"},Kb={class:"inline-flex flex-wrap rounded-lg border border-line bg-surface-1 p-0.5"},Gb=["onClick"],qb={class:"ml-auto"},Yb={class:"grid grid-cols-4 gap-4 max-[900px]:grid-cols-2"},Jb={class:"eyebrow"},Xb={key:0,class:"panel border-danger/40 p-4 text-sm text-danger-fg"},Qb={key:1,class:"panel p-5"},ex={class:"mb-4 flex items-center justify-between"},tx={class:"eyebrow"},nx={class:"mt-0.5 text-base font-semibold text-ink"},ix={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},sx={class:"col-span-2 block max-[760px]:col-span-1"},ox={class:"block"},ax=["value"],rx={class:"block"},lx=["value"],ux={class:"block"},cx=["value"],dx={class:"block"},fx={class:"block"},hx={class:"block"},px={class:"block"},mx=["value"],gx={class:"block"},vx={class:"block"},_x={class:"block"},yx=["value"],bx={class:"mt-3 block"},xx={key:0,class:"mt-3"},wx={class:"eyebrow mb-1 block"},kx={key:1,class:"mt-3 text-xs text-ink-muted"},Sx={class:"mt-4 flex items-center gap-3"},Tx=["disabled"],Px={key:0,class:"text-sm text-danger-fg"},Cx={class:"panel overflow-hidden p-0"},Lx={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},Mx={key:1,class:"grid place-items-center px-5 py-16 text-center"},Ex={class:"mt-3 text-sm font-medium text-ink-secondary"},Ox={class:"mt-1 text-xs text-ink-muted"},zx={key:2,class:"overflow-x-auto"},Ax={class:"w-full border-collapse text-sm"},$x={class:"text-left"},Ix={class:"px-5 py-3"},Dx={class:"font-semibold text-ink"},Nx={key:0,class:"font-mono text-[11px] text-ink-muted"},Rx={class:"px-5 py-3 text-ink-secondary"},Fx={class:"px-5 py-3 text-ink-secondary"},Bx={class:"px-5 py-3"},Vx=["onClick"],Ux={key:0,class:"mt-0.5 font-mono text-[10.5px] text-ink-muted"},Zx={class:"px-5 py-3 font-mono text-ink-secondary"},Hx={class:"whitespace-nowrap px-5 py-3 text-right"},jx=["onClick"],Wx=["onClick"],Kx=["href"],Gx=["onClick"],qx=["onClick"],Yx=["onClick"],Jx={key:0,class:"border-b border-line bg-surface-2"},Xx={colspan:"6",class:"px-5 py-3"},Qx={class:"flex flex-wrap gap-x-8 gap-y-1.5 text-xs"},e0={class:"text-ink-secondary"},t0={class:"text-ink"},n0={class:"text-ink-secondary"},i0={class:"text-ink"},s0={key:0,class:"text-ink-secondary"},o0={class:"text-ink"},a0={key:1,class:"text-ink-secondary"},r0={class:"font-mono text-ink"},l0={key:2,class:"text-ink-secondary"},u0={class:"font-mono text-ink"},c0={class:"text-ink-secondary"},d0={class:"text-ink"},f0={key:0,class:"mt-2 space-y-1"},h0={key:1,class:"mt-2 text-xs text-success-fg"},p0={key:2,class:"mt-2 text-xs text-ink-secondary"},m0={class:"flex max-h-[90vh] w-full max-w-[920px] flex-col overflow-hidden rounded-lg border border-line bg-surface-1 shadow-2xl"},g0={class:"flex items-center gap-3 border-b border-line px-5 py-3"},v0={class:"min-w-0"},_0={class:"truncate text-sm font-semibold text-ink"},y0={class:"truncate font-mono text-[11px] text-ink-muted"},b0={class:"ml-auto flex items-center gap-2"},x0=["href"],w0=["href"],k0={class:"flex-1 overflow-auto bg-surface-2"},S0=["src","alt"],T0=["src","title"],P0={key:2,class:"grid place-items-center px-6 py-16 text-center"},C0={class:"mt-1 text-xs text-ink-muted"},L0=["href"],M0={__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(m=>[m.value,m.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"}],p=[{value:"pilot",label:"Pilot"},{value:"ops",label:"Ops manager"},{value:"admin",label:"Admin"},{value:"client",label:"Client-facing"}],_=H([]),b=H([]),C=H(!1),k=H("");async function O(){C.value=!0,k.value="";const[m,f]=await Promise.all([Tp(),$c()]);m.ok||(k.value=m.status===503?"Document storage is not configured on the API Server (service account missing).":"Could not load documents."),_.value=m.documents,b.value=f.drones||[],C.value=!1}ui(O);const R=H("all"),F=[["all","All"],["expiring","Expiring soon"],["expired","Expired"],["pending","Pending review"],["archived","Archived"]],X=xe(()=>{const m=_.value;switch(R.value){case"expiring":return m.filter(f=>{var x;return((x=f.expiry)==null?void 0:x.state)==="expiring_soon"&&f.status!=="archived"});case"expired":return m.filter(f=>{var x;return((x=f.expiry)==null?void 0:x.state)==="expired"&&f.status!=="archived"});case"pending":return m.filter(f=>f.status==="pending_review");case"archived":return m.filter(f=>f.status==="archived");default:return m.filter(f=>f.status!=="archived")}});function q(m){if(m.status==="archived")return{tone:"neutral",label:"Superseded",icon:""};const f=m.expiry||{};return f.state==="expired"?{tone:"danger",label:"Expired",icon:"alertTriangle"}:f.state==="expiring_soon"?{tone:"warning",label:`Expires in ${f.daysUntilExpiry}d`,icon:"clock"}:f.state==="valid"?{tone:"success",label:"Valid",icon:"check"}:{tone:"neutral",label:"No expiry",icon:""}}const ge=H("");function we(m){ge.value=ge.value===m?"":m}function K(m){return m.ownerDrone?m.ownerDroneName||"Aircraft":m.ownerRef?m.ownerRef:m.ownerType==="pilot"?"Pilot":m.ownerType?m.ownerType.charAt(0).toUpperCase()+m.ownerType.slice(1):"—"}const fe=["png","jpg","jpeg","gif","webp","svg","bmp","avif"],ie=["pdf","txt","csv","log","json","md","html","htm","xml"];function me(m){const f=(m||"").split(".").pop().toLowerCase();return fe.includes(f)?"image":ie.includes(f)?"frame":"none"}const Le=H(null),Ee=xe(()=>Le.value?me(Le.value.fileName):"none"),Ve=xe(()=>Le.value?Mp(Le.value.id):"");function pe(m){Le.value=m}function $e(){Le.value=null}function Oe(m){m.key==="Escape"&&Le.value&&$e()}ui(()=>window.addEventListener("keydown",Oe)),yo(()=>window.removeEventListener("keydown",Oe));function Q(){return{title:"",docType:"certificate",ownerType:"pilot",ownerDrone:"",ownerRef:"",reference:"",jurisdiction:"",issueDate:"",expiryDate:"",status:"active",accessTier:"ops",notes:""}}const ue=H(!1),ye=H(""),ze=H(""),ce=H(""),re=xt(Q()),ee=H(null),nt=H(null),he=H(""),Te=H(!1);function qe(){ee.value=null,nt.value&&(nt.value.value="")}function lt(){Object.assign(re,Q()),ye.value="",ze.value="",ce.value="",qe(),he.value="",ue.value=!0}function Ye(m){Object.assign(re,{title:m.title||"",docType:m.docType||"certificate",ownerType:m.ownerType||"pilot",ownerDrone:m.ownerDrone||"",ownerRef:m.ownerRef||"",reference:m.reference||"",jurisdiction:m.jurisdiction||"",issueDate:m.issueDate||"",expiryDate:m.expiryDate||"",status:m.status||"active",accessTier:m.accessTier||"ops",notes:m.notes||""}),ye.value=m.id,ze.value="",ce.value="",qe(),he.value="",ue.value=!0}function Ue(m){Ye(m),ye.value="",ze.value=m.id,ce.value=m.title,re.status="active"}function j(){ue.value=!1,ye.value="",ze.value=""}function M(m){var f;ee.value=((f=m.target.files)==null?void 0:f[0])||null}async function z(){var f;if(he.value="",!re.title.trim()){he.value="Give the document a title.";return}Te.value=!0;let m;if(ye.value)m=await Cp(ye.value,{...re});else{const x={...re};ze.value&&(x.replaces=ze.value),m=await Pp(x,ee.value)}if(Te.value=!1,!m.ok){he.value=((f=m.body)==null?void 0:f.error)||"Could not save the document.";return}ue.value=!1,ye.value="",ze.value="",await O()}const ut=H("");async function it(m){var x;const f=await Lp(m.id);ut.value="",f.ok?await O():he.value=((x=f.body)==null?void 0:x.error)||"Could not delete the document."}const wt=xe(()=>{const m=_.value.filter(f=>f.status!=="archived");return{total:m.length,expiring:m.filter(f=>{var x;return((x=f.expiry)==null?void 0:x.state)==="expiring_soon"}).length,expired:m.filter(f=>{var x;return((x=f.expiry)==null?void 0:x.state)==="expired"}).length,pending:_.value.filter(f=>f.status==="pending_review").length}});return(m,f)=>(v(),y("div",jb,[r("div",Wb,[r("div",Kb,[(v(),y(ae,null,Fe(F,x=>r("button",{key:x[0],class:Me(["rounded-md px-3.5 py-1.5 text-sm font-semibold transition",R.value===x[0]?"bg-accent-soft text-accent-soft-fg":"text-ink-secondary hover:text-ink"]),onClick:U=>R.value=x[0]},S(x[1]),11,Gb)),64))]),r("div",qb,[r("button",{class:"btn-accent inline-flex items-center gap-2",onClick:lt},[E(Y,{name:"upload",size:15}),f[13]||(f[13]=$(" Add document ",-1))])])]),r("div",Yb,[(v(!0),y(ae,null,Fe([{label:"Documents on file",value:wt.value.total,tone:"neutral"},{label:"Expiring soon",value:wt.value.expiring,tone:wt.value.expiring?"warning":"neutral"},{label:"Expired",value:wt.value.expired,tone:wt.value.expired?"danger":"success"},{label:"Pending review",value:wt.value.pending,tone:wt.value.pending?"accent":"neutral"}],x=>(v(),y("div",{key:x.label,class:"panel p-5"},[r("div",Jb,S(x.label),1),r("div",{class:Me(["mt-2 text-[30px] font-bold leading-none tracking-tightest",x.tone==="danger"?"text-danger-fg":x.tone==="warning"?"text-amber-fg":x.tone==="success"?"text-success-fg":x.tone==="accent"?"text-accent-soft-fg":"text-ink"])},S(x.value),3)]))),128))]),k.value?(v(),y("div",Xb,S(k.value),1)):D("",!0),ue.value?(v(),y("div",Qb,[r("div",ex,[r("div",null,[r("div",tx,S(ye.value?"Edit document":ze.value?"New version":"New document"),1),r("div",nx,S(ze.value?`Supersedes “${ce.value}”`:"Compliance & operational document"),1)]),r("button",{class:"btn-icon",onClick:j},[E(Y,{name:"x",size:16})])]),r("div",ix,[r("label",sx,[f[14]||(f[14]=r("span",{class:"eyebrow mb-1 block"},"Title",-1)),oe(r("input",{"onUpdate:modelValue":f[0]||(f[0]=x=>re.title=x),class:"field",placeholder:"A2 Remote Pilot Certificate — J. Dariusz"},null,512),[[ve,re.title]])]),r("label",ox,[f[15]||(f[15]=r("span",{class:"eyebrow mb-1 block"},"Type",-1)),oe(r("select",{"onUpdate:modelValue":f[1]||(f[1]=x=>re.docType=x),class:"field"},[(v(),y(ae,null,Fe(o,x=>r("option",{key:x.value,value:x.value},S(x.label),9,ax)),64))],512),[[Ot,re.docType]])]),r("label",rx,[f[16]||(f[16]=r("span",{class:"eyebrow mb-1 block"},"Owner type",-1)),oe(r("select",{"onUpdate:modelValue":f[2]||(f[2]=x=>re.ownerType=x),class:"field"},[(v(),y(ae,null,Fe(u,x=>r("option",{key:x.value,value:x.value},S(x.label),9,lx)),64))],512),[[Ot,re.ownerType]])]),r("label",ux,[f[18]||(f[18]=r("span",{class:"eyebrow mb-1 block"},"Aircraft (if any)",-1)),oe(r("select",{"onUpdate:modelValue":f[3]||(f[3]=x=>re.ownerDrone=x),class:"field"},[f[17]||(f[17]=r("option",{value:""},"— none —",-1)),(v(!0),y(ae,null,Fe(b.value,x=>(v(),y("option",{key:x.id,value:x.id},S(x.name)+S(x.model?` · ${x.model}`:""),9,cx))),128))],512),[[Ot,re.ownerDrone]])]),r("label",dx,[f[19]||(f[19]=r("span",{class:"eyebrow mb-1 block"},"Owner reference",-1)),oe(r("input",{"onUpdate:modelValue":f[4]||(f[4]=x=>re.ownerRef=x),class:"field",placeholder:"Client name / serial / site"},null,512),[[ve,re.ownerRef]])]),r("label",fx,[f[20]||(f[20]=r("span",{class:"eyebrow mb-1 block"},"Reference / number",-1)),oe(r("input",{"onUpdate:modelValue":f[5]||(f[5]=x=>re.reference=x),class:"field",placeholder:"Cert / registration / policy no."},null,512),[[ve,re.reference]])]),r("label",hx,[f[21]||(f[21]=r("span",{class:"eyebrow mb-1 block"},"Jurisdiction",-1)),oe(r("input",{"onUpdate:modelValue":f[6]||(f[6]=x=>re.jurisdiction=x),class:"field",placeholder:"DK / EASA / FAA"},null,512),[[ve,re.jurisdiction]])]),r("label",px,[f[22]||(f[22]=r("span",{class:"eyebrow mb-1 block"},"Access tier",-1)),oe(r("select",{"onUpdate:modelValue":f[7]||(f[7]=x=>re.accessTier=x),class:"field"},[(v(),y(ae,null,Fe(p,x=>r("option",{key:x.value,value:x.value},S(x.label),9,mx)),64))],512),[[Ot,re.accessTier]])]),r("label",gx,[f[23]||(f[23]=r("span",{class:"eyebrow mb-1 block"},"Issue date",-1)),oe(r("input",{"onUpdate:modelValue":f[8]||(f[8]=x=>re.issueDate=x),type:"date",class:"field"},null,512),[[ve,re.issueDate]])]),r("label",vx,[f[24]||(f[24]=r("span",{class:"eyebrow mb-1 block"},"Expiry date",-1)),oe(r("input",{"onUpdate:modelValue":f[9]||(f[9]=x=>re.expiryDate=x),type:"date",class:"field"},null,512),[[ve,re.expiryDate]])]),r("label",_x,[f[25]||(f[25]=r("span",{class:"eyebrow mb-1 block"},"Status",-1)),oe(r("select",{"onUpdate:modelValue":f[10]||(f[10]=x=>re.status=x),class:"field"},[(v(),y(ae,null,Fe(d,x=>r("option",{key:x.value,value:x.value},S(x.label),9,yx)),64))],512),[[Ot,re.status]])])]),r("label",bx,[f[26]||(f[26]=r("span",{class:"eyebrow mb-1 block"},"Notes",-1)),oe(r("textarea",{"onUpdate:modelValue":f[11]||(f[11]=x=>re.notes=x),rows:"2",class:"field",placeholder:"Conditions, renewal contacts, anything worth recording"},null,512),[[ve,re.notes]])]),ye.value?(v(),y("div",kx,[...f[28]||(f[28]=[$(" Editing updates metadata only. To replace the file, close this and use ",-1),r("b",{class:"text-ink-secondary"},"New version",-1),$(" on the document — the old version is kept for audit. ",-1)])])):(v(),y("div",xx,[r("span",wx,"File "+S(ze.value?"(new version)":"(optional)"),1),r("input",{ref_key:"fileInput",ref:nt,type:"file",class:"field",onChange:M},null,544),f[27]||(f[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",Sx,[r("button",{class:"btn-accent",disabled:Te.value,onClick:z},S(Te.value?"Saving…":ye.value?"Save changes":ze.value?"Upload new version":"Add document"),9,Tx),r("button",{class:"btn-ghost",onClick:j},"Cancel"),he.value?(v(),y("span",Px,S(he.value),1)):D("",!0)])])):D("",!0),r("div",Cx,[C.value?(v(),y("div",Lx,"Loading…")):X.value.length?(v(),y("div",zx,[r("table",Ax,[r("thead",null,[r("tr",$x,[(v(),y(ae,null,Fe(["Title","Type","Owner","Expiry","Ver",""],x=>r("th",{key:x,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(x),1)),64))])]),r("tbody",null,[(v(!0),y(ae,null,Fe(X.value,x=>{var U,B;return v(),y(ae,{key:x.id},[r("tr",{class:Me(["border-b border-line last:border-0",ye.value===x.id?"bg-accent-soft":""])},[r("td",Ix,[r("div",Dx,S(x.title),1),x.reference?(v(),y("div",Nx,S(x.reference),1)):D("",!0)]),r("td",Rx,S(Re(l)[x.docType]||x.docType||"—"),1),r("td",Fx,S(K(x)),1),r("td",Bx,[r("button",{class:Me(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",i[q(x).tone]]),onClick:V=>we(x.id)},[q(x).icon?(v(),et(Y,{key:0,name:q(x).icon,size:12},null,8,["name"])):D("",!0),$(" "+S(q(x).label),1)],10,Vx),x.expiryDate?(v(),y("div",Ux,S(x.expiryDate),1)):D("",!0)]),r("td",Zx,"v"+S(x.version||1),1),r("td",Hx,[ut.value===x.id?(v(),y(ae,{key:0},[f[29]||(f[29]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),r("button",{class:"btn-ghost mr-1",onClick:f[12]||(f[12]=V=>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:V=>it(x)},"Delete",8,jx)],64)):(v(),y(ae,{key:1},[x.hasFile?(v(),y("button",{key:0,class:"btn-ghost mr-1 inline-flex items-center gap-1",title:"Preview",onClick:V=>pe(x)},[E(Y,{name:"eye",size:13})],8,Wx)):D("",!0),x.hasFile?(v(),y("a",{key:1,href:Re(lr)(x.id),class:"btn-ghost mr-1 inline-flex items-center gap-1",title:"Download file"},[E(Y,{name:"download",size:13})],8,Kx)):D("",!0),r("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",title:"Upload new version",onClick:V=>Ue(x)},[E(Y,{name:"upload",size:13})],8,Gx),r("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:V=>Ye(x)},[E(Y,{name:"sliders",size:13}),f[30]||(f[30]=$(" Edit",-1))],8,qx),r("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:V=>ut.value=x.id},[E(Y,{name:"trash",size:13})],8,Yx)],64))])],2),ge.value===x.id?(v(),y("tr",Jx,[r("td",Xx,[r("div",Qx,[r("span",e0,[f[31]||(f[31]=$("Status: ",-1)),r("b",t0,S(x.status||"—"),1)]),r("span",n0,[f[32]||(f[32]=$("Access: ",-1)),r("b",i0,S(x.accessTier||"—"),1)]),x.jurisdiction?(v(),y("span",s0,[f[33]||(f[33]=$("Jurisdiction: ",-1)),r("b",o0,S(x.jurisdiction),1)])):D("",!0),x.issueDate?(v(),y("span",a0,[f[34]||(f[34]=$("Issued: ",-1)),r("b",r0,S(x.issueDate),1)])):D("",!0),x.expiryDate?(v(),y("span",l0,[f[35]||(f[35]=$("Expires: ",-1)),r("b",u0,S(x.expiryDate),1)])):D("",!0),r("span",c0,[f[36]||(f[36]=$("File: ",-1)),r("b",d0,S(x.hasFile?x.fileName:"none"),1)])]),(((U=x.expiry)==null?void 0:U.flags)||[]).length?(v(),y("ul",f0,[(v(!0),y(ae,null,Fe(x.expiry.flags,(V,te)=>(v(),y("li",{key:te,class:Me(["flex items-start gap-2 text-xs",x.expiry.state==="expired"?"text-danger-fg":x.expiry.state==="expiring_soon"?"text-amber-fg":"text-ink-secondary"])},[E(Y,{name:"alertTriangle",size:13,class:"mt-px shrink-0"}),$(" "+S(V),1)],2))),128))])):((B=x.expiry)==null?void 0:B.state)==="valid"?(v(),y("div",h0,"In force — no action needed.")):D("",!0),x.notes?(v(),y("div",p0,[f[37]||(f[37]=r("span",{class:"text-ink-muted"},"Notes:",-1)),$(" "+S(x.notes),1)])):D("",!0)])])):D("",!0)],64)}),128))])])])):(v(),y("div",Mx,[E(Y,{name:"fileText",size:26,class:"text-ink-muted"}),r("div",Ex,S(R.value==="all"?"No documents on file yet":"Nothing in this view"),1),r("div",Ox,S(R.value==="all"?"Add certificates, registrations, insurance and authorisations to track their expiry.":"Try a different filter."),1)]))]),(v(),et(af,{to:"body"},[Le.value?(v(),y("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($e,["self"])},[r("div",m0,[r("div",g0,[r("div",v0,[r("div",_0,S(Le.value.title),1),r("div",y0,S(Le.value.fileName),1)]),r("div",b0,[r("a",{href:Ve.value,target:"_blank",rel:"noopener",class:"btn-ghost inline-flex items-center gap-1.5",title:"Open in new tab"},[E(Y,{name:"globe",size:14}),f[38]||(f[38]=$(" New tab ",-1))],8,x0),r("a",{href:Re(lr)(Le.value.id),class:"btn-ghost inline-flex items-center gap-1.5",title:"Download"},[E(Y,{name:"download",size:14}),f[39]||(f[39]=$(" Download ",-1))],8,w0),r("button",{class:"btn-icon",title:"Close",onClick:$e},[E(Y,{name:"x",size:16})])])]),r("div",k0,[Ee.value==="image"?(v(),y("img",{key:0,src:Ve.value,alt:Le.value.title,class:"mx-auto block max-w-full"},null,8,S0)):Ee.value==="frame"?(v(),y("iframe",{key:1,src:Ve.value,class:"h-[74vh] w-full border-0 bg-white",title:Le.value.title},null,8,T0)):(v(),y("div",P0,[E(Y,{name:"fileText",size:28,class:"text-ink-muted"}),f[41]||(f[41]=r("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"Preview isn't available for this file type",-1)),r("div",C0,S(Le.value.fileName),1),r("a",{href:Re(lr)(Le.value.id),class:"btn-accent mt-4 inline-flex items-center gap-2"},[E(Y,{name:"download",size:15}),f[40]||(f[40]=$(" Download instead ",-1))],8,L0)]))])])])):D("",!0)]))]))}},E0={class:"grid h-full grid-cols-[248px_1fr] max-[900px]:grid-cols-1"},O0={class:"flex flex-col border-r border-line bg-surface-1 px-4 py-5 max-[900px]:hidden"},z0={class:"flex items-center gap-2.5 px-2 pb-5"},A0={class:"flex flex-col gap-0.5"},$0=["onClick"],I0={class:"mt-auto flex flex-col gap-2.5"},D0={class:"rounded-lg bg-surface-2 p-3"},N0={class:"flex items-center gap-2"},R0={class:"text-xs font-semibold text-ink"},F0={class:"mt-1.5 block font-mono text-[10.5px] text-ink-muted"},B0={class:"flex items-center gap-2.5 px-2 py-1"},V0={class:"grid h-8 w-8 place-items-center rounded-full bg-[var(--navy-800)] text-xs font-bold text-white"},U0={class:"min-w-0 flex-1"},Z0={class:"truncate text-[13px] font-semibold text-ink"},H0={class:"flex items-center gap-1.5 text-[11px] text-ink-muted"},j0=["title"],W0={class:"overflow-y-auto"},K0={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)"}},G0={class:"mt-0.5 text-[22px] font-bold tracking-tightest text-ink"},q0={class:"ml-auto flex items-center gap-3"},Y0={class:"flex h-10 w-60 items-center gap-2 rounded border border-line-strong bg-surface-1 px-3 max-[1100px]:hidden"},J0={key:0,class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},X0={class:"grid grid-cols-4 gap-4 max-[1100px]:grid-cols-2 max-[560px]:grid-cols-1"},Q0={class:"flex items-center justify-between"},ew={class:"eyebrow"},tw={class:"mt-2.5 text-[34px] font-bold leading-none tracking-tightest text-ink"},nw={class:"grid grid-cols-[1.6fr_1fr] gap-5 max-[1100px]:grid-cols-1"},iw={class:"panel p-5"},sw={class:"mb-3.5 flex items-center justify-between"},ow={class:"panel p-5"},aw={class:"mb-3.5 flex items-center justify-between"},rw={class:"grid place-items-center py-10 text-center"},lw={class:"panel overflow-hidden p-0"},uw={class:"flex items-center justify-between px-5 py-4"},cw={class:"flex gap-2"},dw={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},fw={key:1,class:"overflow-x-auto"},hw={class:"w-full border-collapse text-sm"},pw={class:"text-left"},mw=["onClick"],gw={class:"px-5 py-3 font-mono font-bold text-ink"},vw={class:"px-5 py-3 text-ink-secondary"},_w={class:"px-5 py-3"},yw={class:"px-5 py-3 font-mono text-ink-secondary"},bw={class:"px-5 py-3"},xw={key:0,class:"flex items-center gap-2"},ww={class:"h-1.5 w-12 overflow-hidden rounded bg-surface-2"},kw={class:"font-mono text-xs text-ink-secondary"},Sw={key:1,class:"font-mono text-xs text-ink-muted"},Tw={class:"px-5 py-3 font-mono text-ink-secondary"},Pw={class:"px-5 py-3 text-right"},Cw=["onClick"],Lw={key:1,class:"p-7"},Mw={class:"mb-4 flex flex-wrap items-center gap-3"},Ew={class:"font-mono text-mode font-bold text-ink"},Ow={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"},zw={key:1,class:"ml-auto flex flex-wrap gap-1.5"},Aw=["onClick"],$w={key:0,class:"panel grid place-items-center p-16 text-center"},Iw={class:"pill"},Dw={class:"pill"},Nw={class:"pill"},Rw={class:"mt-1 text-sm font-semibold text-ink"},Fw={class:"pill"},Bw={class:"mt-1 font-mono text-sm font-bold tabular text-ink"},Vw={class:"grid grid-cols-2 gap-4 max-[820px]:grid-cols-1"},Uw={class:"panel p-4"},Zw={class:"flex items-center gap-4"},Hw={class:"h-9 flex-1 overflow-hidden rounded border border-line bg-surface-2"},jw={class:"readout"},Ww={class:"panel p-4"},Kw={class:"readout"},Gw={class:"panel p-4"},qw={class:"space-y-1.5 text-sm"},Yw={class:"flex justify-between"},Jw={class:"text-ink"},Xw={class:"flex justify-between"},Qw={class:"text-ink"},ek={class:"flex justify-between"},tk={class:"font-mono tabular text-ink"},nk={class:"flex justify-between"},ik={class:"font-mono tabular text-ink"},sk={class:"panel p-4"},ok={class:"space-y-1.5 text-sm"},ak={class:"flex justify-between"},rk={class:"font-mono tabular text-ink"},lk={class:"flex justify-between"},uk={class:"font-mono tabular text-ink"},ck={class:"flex justify-between"},dk={class:"font-mono tabular text-ink"},fk={class:"panel col-span-2 p-4 max-[820px]:col-span-1"},hk={class:"panel p-4"},pk={class:"flex flex-wrap gap-2"},mk={class:"mt-2 min-h-[16px] text-xs text-ink-muted"},gk={class:"panel p-4"},vk={class:"h-[180px] overflow-y-auto font-mono text-xs"},_k={class:"text-ink-muted"},yk={class:"font-semibold text-accent"},bk={class:"break-all text-ink"},xk={key:5,class:"p-7"},wk={class:"panel grid place-items-center p-16 text-center"},kk={class:"mt-3 text-sm font-medium text-ink-secondary"},Sk={key:0,class:"mt-1 text-xs text-ink-muted"},Tk={key:1,class:"mt-1 text-xs text-ink-muted"},Pk={__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=xt({}),d=xt({}),p=H(null),_=H(!1),b=xt([]),C=H(""),k=H("Overview"),O=[["grid","Overview"],["radio","Live flights"],["route","Routes"],["calendar","Schedule"],["book","Logbook"],["fileText","Documents"],["server","Drives"],["settings","Settings"]],R=xe(()=>(O.find(([,m])=>m===k.value)||["grid"])[0]),F=H(""),X=H(""),q=H("");let ge=null,we=null,K=!1;const fe=xe(()=>Object.keys(u).sort((m,f)=>(u[f].online?1:0)-(u[m].online?1:0)||m.localeCompare(f))),ie=xe(()=>p.value?u[p.value]:null),me=xe(()=>ie.value&&ie.value.telemetry||{}),Le=xe(()=>!!(ie.value&&ie.value.online)),Ee=xe(()=>{const m=me.value;return typeof m.latitude=="number"&&typeof m.longitude=="number"&&(m.latitude||m.longitude)?{lat:m.latitude,lng:m.longitude}:null}),Ve=xe(()=>p.value&&d[p.value]||[]),pe=xe(()=>{const m=me.value;return typeof m.velocityX=="number"&&typeof m.velocityY=="number"?Math.hypot(m.velocityX,m.velocityY):null});function $e(m){return m.online?m.connected?["In flight","success"]:["Standby","accent"]:["Offline","neutral"]}function Oe(m){const f=m&&m.telemetry||{};return typeof f.velocityX=="number"&&typeof f.velocityY=="number"?Math.hypot(f.velocityX,f.velocityY):null}const Q=xe(()=>fe.value.map(m=>{const f=u[m],x=f.telemetry||{},[U,B]=$e(f);return{id:m,mission:f.model||(f.connected?"Drone linked":f.online?"App online":"No signal"),status:U,tone:B,alt:typeof x.altitude=="number"?x.altitude.toFixed(0)+" m":"—",battery:typeof x.batteryPercent=="number"?x.batteryPercent:null,speed:Oe(f)}})),ue=xe(()=>fe.value.filter(m=>u[m].online).length),ye=xe(()=>fe.value.filter(m=>u[m].online&&u[m].connected).length),ze=xe(()=>fe.value.filter(m=>!u[m].online).length),ce=xe(()=>{const m=fe.value.map(f=>{var x;return(x=u[f].telemetry)==null?void 0:x.batteryPercent}).filter(f=>typeof f=="number");return m.length?Math.round(m.reduce((f,x)=>f+x,0)/m.length):null}),re=xe(()=>[{label:"Active flights",value:String(ye.value),delta:`${ue.value} online`,tone:"success",icon:"radio"},{label:"Avg battery",value:ce.value==null?"—":ce.value+"%",delta:ce.value==null?"no telemetry":ce.value<40?"low — watch":"nominal",tone:ce.value!=null&&ce.value<40?"danger":"neutral",icon:"battery"},{label:"Fleet size",value:String(fe.value.length),delta:`${ye.value} in flight`,tone:"neutral",icon:"grid"},{label:"Offline",value:String(ze.value),delta:ze.value?"needs attention":"all reachable",tone:ze.value?"warning":"success",icon:"signal"}]),ee={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"},nt={success:"text-success-fg",danger:"text-danger-fg",warning:"text-amber-fg",neutral:"text-ink-muted",accent:"text-accent-soft-fg"},he=xe(()=>{var x,U,B;const f=(o.email||"PV").split("@")[0].split(/[.\-_ ]+/).filter(Boolean);return((((x=f[0])==null?void 0:x[0])||"P")+(((U=f[1])==null?void 0:U[0])||((B=f[0])==null?void 0:B[1])||"V")).toUpperCase()}),Te={superadmin:"Superadmin",admin:"Admin",user:"Operator"},qe=xe(()=>Te[o.role]||"Operator"),lt=xe(()=>o.organizationName||(o.role==="superadmin"?"All organizations":"No organization"));function Ye(m){var x;u[m.deviceId]=m;const f=m.telemetry||{};typeof f.latitude=="number"&&typeof f.longitude=="number"&&(f.latitude||f.longitude)&&(d[m.deviceId]||(d[m.deviceId]=[]),d[m.deviceId].push([f.latitude,f.longitude]),d[m.deviceId].length>1e3&&d[m.deviceId].shift()),(!p.value||m.online&&!((x=u[p.value])!=null&&x.online))&&(p.value=m.deviceId)}function Ue(m){delete u[m],delete d[m],p.value===m&&(p.value=fe.value[0]||null)}function j(m){b.unshift({t:au(Date.now()),tag:m.type||"?",text:JSON.stringify(M(m))}),b.length>200&&b.pop()}function M(m){const f={...m};return delete f.type,f}function z(){const m=location.protocol==="https:"?"wss":"ws";ge=new WebSocket(`${m}://${location.host}/bff/ws`),ge.onopen=()=>_.value=!0,ge.onclose=()=>{_.value=!1,K||(we=setTimeout(z,1500))},ge.onerror=()=>ge&&ge.close(),ge.onmessage=f=>{let x;try{x=JSON.parse(f.data)}catch{return}x.type==="snapshot"?(x.devices||[]).forEach(Ye):x.type==="update"&&x.device?(Ye(x.device),x.event&&x.device.deviceId===p.value&&j(x.event)):x.type==="removed"&&x.deviceId&&Ue(x.deviceId)}}async function ut(){if(!p.value)return q.value="No device selected.";if(!F.value.trim())return q.value="Enter a command name.";let m;if(X.value.trim())try{m=JSON.parse(X.value)}catch{return q.value="Payload is not valid JSON."}const{ok:f,body:x}=await Ep(p.value,F.value.trim(),m);q.value=f?`Sent "${F.value.trim()}".`:`Error: ${x.error||"failed"}`}function it(m,f,x=""){return typeof m=="number"?m.toFixed(f)+x:"—"}function wt(m){p.value=m,k.value="Live flights"}return ui(async()=>{(await Xh()).forEach(Ye),z()}),yo(()=>{K=!0,we&&clearTimeout(we),ge&&ge.close()}),(m,f)=>{var x,U,B,V,te;return v(),y("div",E0,[r("aside",O0,[r("div",z0,[E(Fc,{size:26}),f[7]||(f[7]=r("span",{class:"text-[19px] tracking-tightest"},[r("span",{class:"font-medium text-ink-secondary"},"Pilot"),r("span",{class:"font-bold text-ink"},"Vault")],-1))]),r("nav",A0,[(v(),y(ae,null,Fe(O,([N,J])=>r("button",{key:J,class:Me(["flex items-center gap-3 rounded px-3 py-2.5 text-left text-sm transition",k.value===J?"bg-accent-soft font-semibold text-accent-soft-fg":"font-medium text-ink-secondary hover:bg-surface-2"]),onClick:Z=>k.value=J},[E(Y,{name:N,size:18,stroke:k.value===J?2.2:1.8},null,8,["name","stroke"]),$(" "+S(J),1)],10,$0)),64))]),r("div",I0,[r("div",D0,[r("div",N0,[r("span",{class:Me(["h-2 w-2 rounded-full",_.value?"bg-ready":"bg-caution"])},null,2),r("span",R0,S(_.value?"Link healthy":"Reconnecting…"),1)]),r("span",F0,"API gateway · "+S(_.value?"streaming":"retrying"),1)]),r("div",B0,[r("div",V0,S(he.value),1),r("div",U0,[r("div",Z0,S(t.email||"Operator"),1),r("div",H0,[E(Y,{name:"grid",size:11,class:"shrink-0"}),r("span",{class:"truncate",title:`${qe.value} · ${lt.value}`},S(qe.value)+" · "+S(lt.value),9,j0)])]),r("button",{class:"text-ink-muted transition hover:text-ink",title:"Log out","aria-label":"Log out",onClick:f[0]||(f[0]=N=>l("logout"))},[E(Y,{name:"logout",size:16})])])])]),r("main",W0,[r("header",K0,[r("div",null,[f[8]||(f[8]=r("div",{class:"eyebrow"},"Live operations",-1)),r("h1",G0,S(k.value),1)]),r("div",q0,[r("div",Y0,[E(Y,{name:"search",size:16,class:"text-ink-muted"}),oe(r("input",{"onUpdate:modelValue":f[1]||(f[1]=N=>C.value=N),placeholder:"Search drones, routes…",class:"w-full border-none bg-transparent text-sm text-ink outline-none placeholder:text-ink-muted"},null,512),[[ve,C.value]])]),r("button",{class:"btn-accent flex items-center gap-2",onClick:f[2]||(f[2]=N=>k.value="Live flights")},[E(Y,{name:"radio",size:16}),f[9]||(f[9]=$(" Live flights ",-1))])])]),k.value==="Overview"?(v(),y("div",J0,[r("div",X0,[(v(!0),y(ae,null,Fe(re.value,N=>(v(),y("div",{key:N.label,class:"panel p-5"},[r("div",Q0,[r("span",ew,S(N.label),1),E(Y,{name:N.icon,size:16,class:"text-ink-muted"},null,8,["name"])]),r("div",tw,S(N.value),1),r("span",{class:Me(["mt-2 block font-mono text-[11px]",nt[N.tone]])},S(N.delta),3)]))),128))]),r("div",nw,[r("div",iw,[r("div",sw,[f[11]||(f[11]=r("div",null,[r("div",{class:"eyebrow"},"Airspace"),r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Live map")],-1)),ye.value?(v(),y("span",{key:0,class:Me(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",ee.success])},[f[10]||(f[10]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(S(ye.value)+" airborne ",1)],2)):D("",!0)]),E(cu,{position:Ee.value,trail:Ve.value},null,8,["position","trail"])]),r("div",ow,[r("div",aw,[f[12]||(f[12]=r("div",null,[r("div",{class:"eyebrow"},"Today"),r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Schedule")],-1)),E(Y,{name:"clock",size:16,class:"text-ink-muted"})]),r("div",rw,[E(Y,{name:"calendar",size:24,class:"text-ink-muted"}),f[13]||(f[13]=r("div",{class:"mt-2 text-sm font-medium text-ink-secondary"},"No missions scheduled",-1)),f[14]||(f[14]=r("div",{class:"mt-0.5 text-xs text-ink-muted"},"Scheduling is not wired to a backend yet.",-1))])])]),r("div",lw,[r("div",uw,[f[17]||(f[17]=r("div",null,[r("div",{class:"eyebrow"},"Fleet"),r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Aircraft status")],-1)),r("div",cw,[r("span",{class:Me(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",ee.success])},[f[15]||(f[15]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(S(ye.value)+" in flight ",1)],2),ze.value?(v(),y("span",{key:0,class:Me(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",ee.warning])},[f[16]||(f[16]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(S(ze.value)+" offline ",1)],2)):D("",!0)])]),Q.value.length?(v(),y("div",fw,[r("table",hw,[r("thead",null,[r("tr",pw,[(v(),y(ae,null,Fe(["Aircraft","Mission","Status","Alt","Battery","Speed",""],N=>r("th",{key:N,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(N),1)),64))])]),r("tbody",null,[(v(!0),y(ae,null,Fe(Q.value,(N,J)=>(v(),y("tr",{key:N.id,class:Me(["cursor-pointer transition hover:bg-surface-2",Jwt(N.id)},[r("td",gw,S(N.id),1),r("td",vw,S(N.mission),1),r("td",_w,[r("span",{class:Me(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",ee[N.tone]])},[f[18]||(f[18]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(S(N.status),1)],2)]),r("td",yw,S(N.alt),1),r("td",bw,[N.battery!=null?(v(),y("div",xw,[r("div",ww,[r("div",{class:Me(["h-full",N.battery<40?"bg-caution":"bg-ready"]),style:Ps({width:N.battery+"%"})},null,6)]),r("span",kw,S(N.battery)+"%",1)])):(v(),y("span",Sw,"—"))]),r("td",Tw,[$(S(N.speed==null?"—":N.speed.toFixed(1))+" ",1),f[19]||(f[19]=r("span",{class:"text-ink-muted"},"m/s",-1))]),r("td",Pw,[r("button",{class:"btn-ghost inline-flex items-center gap-1.5 whitespace-nowrap",onClick:Vr(Z=>wt(N.id),["stop"])},[E(Y,{name:"play",size:14}),f[20]||(f[20]=$(" Track ",-1))],8,Cw)])],10,mw))),128))])])])):(v(),y("div",dw," No aircraft connected yet. Devices appear here as they come online. "))])])):k.value==="Live flights"?(v(),y("div",Lw,[r("div",Mw,[r("span",Ew,S(p.value||"No device selected"),1),ie.value&&!Le.value?(v(),y("span",Ow,"Offline")):D("",!0),fe.value.length?(v(),y("div",zw,[(v(!0),y(ae,null,Fe(fe.value,N=>(v(),y("button",{key:N,class:Me(["flex items-center gap-2 rounded border px-3 py-1.5 font-mono text-xs font-bold transition",N===p.value?"border-accent bg-accent-soft text-accent-soft-fg":"border-line bg-surface-1 text-ink-secondary hover:border-line-strong"]),onClick:J=>p.value=N},[r("span",{class:Me(["h-2 w-2 rounded-full",u[N].online?"bg-ready":"bg-ink-muted"])},null,2),$(" "+S(N),1)],10,Aw))),128))])):D("",!0)]),fe.value.length?(v(),y(ae,{key:1},[r("div",{class:Me(["mb-4 grid gap-3",!Le.value&&ie.value?"opacity-60":""]),style:{"grid-template-columns":"repeat(auto-fit, minmax(150px, 1fr))"}},[r("div",Iw,[f[23]||(f[23]=r("div",{class:"eyebrow"},"Registration",-1)),r("div",{class:Me(["mt-1 text-sm font-semibold",Le.value?((x=ie.value)==null?void 0:x.registration)==="success"?"text-success-fg":"text-danger-fg":"text-ink"])},S(Le.value&&((U=ie.value)!=null&&U.registration)?ie.value.registration:"—"),3)]),r("div",Dw,[f[24]||(f[24]=r("div",{class:"eyebrow"},"Drone link",-1)),r("div",{class:Me(["mt-1 text-sm font-semibold",Le.value?(B=ie.value)!=null&&B.connected?"text-success-fg":"text-danger-fg":"text-ink"])},S(ie.value?Le.value?ie.value.connected?"connected":"no drone":"app offline":"—"),3)]),r("div",Nw,[f[25]||(f[25]=r("div",{class:"eyebrow"},"Model",-1)),r("div",Rw,S(((V=ie.value)==null?void 0:V.model)||"—"),1)]),r("div",Fw,[f[26]||(f[26]=r("div",{class:"eyebrow"},"Last update",-1)),r("div",Bw,S((te=ie.value)!=null&&te.lastSeenMs?Re(au)(ie.value.lastSeenMs):"—"),1)])],2),r("div",Vw,[r("div",Uw,[f[28]||(f[28]=r("div",{class:"mb-3 eyebrow"},"Battery",-1)),r("div",Zw,[r("div",Hw,[r("div",{class:Me(["h-full transition-all",typeof me.value.batteryPercent=="number"?me.value.batteryPercent<20?"bg-warning":me.value.batteryPercent<40?"bg-caution":"bg-ready":""]),style:Ps({width:(typeof me.value.batteryPercent=="number"?me.value.batteryPercent:0)+"%"})},null,6)]),r("div",jw,[$(S(typeof me.value.batteryPercent=="number"?me.value.batteryPercent:"—"),1),f[27]||(f[27]=r("span",{class:"text-sm text-ink-secondary"},"%",-1))])])]),r("div",Ww,[f[30]||(f[30]=r("div",{class:"mb-3 eyebrow"},"Altitude",-1)),r("div",Kw,[$(S(it(me.value.altitude,1)),1),f[29]||(f[29]=r("span",{class:"text-sm text-ink-secondary"}," m",-1))])]),r("div",Gw,[f[35]||(f[35]=r("div",{class:"mb-3 eyebrow"},"Flight",-1)),r("div",qw,[r("div",Yw,[f[31]||(f[31]=r("span",{class:"text-ink-secondary"},"Mode",-1)),r("b",Jw,S(me.value.flightMode||"—"),1)]),r("div",Xw,[f[32]||(f[32]=r("span",{class:"text-ink-secondary"},"Flying",-1)),r("b",Qw,S(me.value.isFlying==null?"—":me.value.isFlying?"yes":"no"),1)]),r("div",ek,[f[33]||(f[33]=r("span",{class:"text-ink-secondary"},"GPS sats",-1)),r("b",tk,S(me.value.satelliteCount==null?"—":me.value.satelliteCount),1)]),r("div",nk,[f[34]||(f[34]=r("span",{class:"text-ink-secondary"},"Speed (H)",-1)),r("b",ik,S(pe.value==null?"—":it(pe.value,2," m/s")),1)])])]),r("div",sk,[f[39]||(f[39]=r("div",{class:"mb-3 eyebrow"},"Position",-1)),r("div",ok,[r("div",ak,[f[36]||(f[36]=r("span",{class:"text-ink-secondary"},"Latitude",-1)),r("b",rk,S(it(me.value.latitude,6)),1)]),r("div",lk,[f[37]||(f[37]=r("span",{class:"text-ink-secondary"},"Longitude",-1)),r("b",uk,S(it(me.value.longitude,6)),1)]),r("div",ck,[f[38]||(f[38]=r("span",{class:"text-ink-secondary"},"Vert. speed",-1)),r("b",dk,S(it(typeof me.value.velocityZ=="number"?-me.value.velocityZ:void 0,2," m/s")),1)])])]),r("div",fk,[f[40]||(f[40]=r("div",{class:"mb-3 eyebrow"},"Track",-1)),E(cu,{position:Ee.value,trail:Ve.value},null,8,["position","trail"])]),r("div",hk,[f[41]||(f[41]=r("div",{class:"mb-3 eyebrow"},"Send command",-1)),r("div",pk,[oe(r("input",{"onUpdate:modelValue":f[3]||(f[3]=N=>F.value=N),class:"field flex-1",placeholder:"command (e.g. startConnection)"},null,512),[[ve,F.value]]),oe(r("input",{"onUpdate:modelValue":f[4]||(f[4]=N=>X.value=N),class:"field flex-1",placeholder:"payload JSON (optional)"},null,512),[[ve,X.value]]),r("button",{class:"btn-accent",onClick:ut},"Send")]),r("div",mk,S(q.value),1)]),r("div",gk,[f[42]||(f[42]=r("div",{class:"mb-3 eyebrow"},"Event log",-1)),r("div",vk,[(v(!0),y(ae,null,Fe(b,(N,J)=>(v(),y("div",{key:J,class:"border-b border-line py-1"},[r("span",_k,S(N.t),1),r("span",yk,S(N.tag),1),r("span",bk,S(N.text),1)]))),128))])])])],64)):(v(),y("div",$w,[E(Y,{name:"radio",size:28,class:"text-ink-muted"}),f[21]||(f[21]=r("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No aircraft online",-1)),f[22]||(f[22]=r("div",{class:"mt-1 text-xs text-ink-muted"},"Live telemetry appears here once a drone connects.",-1))]))])):k.value==="Logbook"?(v(),et(Hb,{key:2,email:t.email,role:t.role,organization:t.organization,"organization-name":t.organizationName},null,8,["email","role","organization","organization-name"])):k.value==="Documents"?(v(),et(M0,{key:3,email:t.email,role:t.role,organization:t.organization,"organization-name":t.organizationName},null,8,["email","role","organization","organization-name"])):k.value==="Settings"?(v(),et(Ky,{key:4,email:t.email,role:t.role,organization:t.organization,"organization-name":t.organizationName,onLogout:f[5]||(f[5]=N=>l("logout"))},null,8,["email","role","organization","organization-name"])):(v(),y("div",xk,[r("div",wk,[E(Y,{name:R.value,size:28,class:"text-ink-muted"},null,8,["name"]),r("div",kk,S(k.value),1),k.value==="Drives"?(v(),y("div",Sk,[f[43]||(f[43]=$(" Browse and transfer files here once a drive is connected. Configure drives in ",-1)),r("button",{class:"font-semibold text-accent hover:underline",onClick:f[6]||(f[6]=N=>k.value="Settings")},"Settings → Integrations"),f[44]||(f[44]=$(". ",-1))])):(v(),y("div",Tk,"This section is part of the console shell and has no backend yet."))])]))])])}}},Ck={key:0,class:"h-full"},Lk={key:1,class:"grid h-full place-items-center text-ink-muted text-sm"},Mk={__name:"App",setup(t){const i=H(!1),o=H(null),l=H("user"),u=H(""),d=H(""),p=H("");function _(k){l.value=k&&k.role||"user",u.value=k&&k.organization||"",d.value=k&&k.organizationName||""}ui(async()=>{p.value=(await qh()).apiBase||"";const k=await nu();k&&(o.value=k.email,_(k),await lu()),i.value=!0});async function b(k){o.value=k,_(await nu()),await lu()}async function C(){Ip(),await Jh(),o.value=null,l.value="user",u.value="",d.value=""}return(k,O)=>i.value?(v(),y("div",Ck,[o.value?(v(),et(Pk,{key:0,email:o.value,role:l.value,organization:u.value,"organization-name":d.value,onLogout:C},null,8,["email","role","organization","organization-name"])):(v(),et(Xp,{key:1,"default-api-base":p.value,onSignedIn:b},null,8,["default-api-base"]))])):(v(),y("div",Lk,"Loading…"))}};jh(Mk).mount("#app");
diff --git a/Web App/server/dist/assets/index-CoIRbg0g.css b/Web App/server/dist/assets/index-CoIRbg0g.css
new file mode 100644
index 0000000..09db3b2
--- /dev/null
+++ b/Web App/server/dist/assets/index-CoIRbg0g.css
@@ -0,0 +1 @@
+:root,[data-theme=light]{--navy-950: #0B1730;--navy-900: #0F1E3D;--navy-800: #1B2E52;--navy-700: #26406E;--blue-50: #EAF1FE;--blue-100: #D6E3FD;--blue-200: #B4CDFA;--blue-300: #8FB4F6;--blue-400: #5B93F5;--blue-500: #3D7BF0;--blue-600: #2B62CC;--blue-700: #1F4CA0;--slate-0: #FFFFFF;--slate-50: #F6F7F9;--slate-100: #EEF0F3;--slate-150: #E6E9EE;--slate-200: #DCE0E7;--slate-300: #C5CCD7;--slate-400: #97A1B0;--slate-500: #6B7688;--slate-600: #4C5566;--slate-700: #333B4A;--slate-800: #1E2635;--slate-900: #131A28;--slate-950: #0B111C;--steel: #5A6B85;--green-500: #1F8A5B;--green-100: #DCF1E7;--green-600:#177049;--amber-500: #D9852B;--amber-100: #FBEBD5;--amber-600:#B86C1B;--red-500: #D64545;--red-100: #FBE0E0;--red-600: #B83232;--bg-app: var(--slate-100);--bg-subtle: var(--slate-50);--surface: var(--slate-0);--surface-2: var(--slate-50);--surface-inset: var(--slate-100);--border: var(--slate-200);--border-strong: var(--slate-300);--border-subtle: var(--slate-150);--text-primary: var(--navy-900);--text-secondary:var(--steel);--text-tertiary: var(--slate-400);--text-inverse: var(--slate-0);--text-on-accent:#FFFFFF;--accent: var(--blue-500);--accent-hover: var(--blue-600);--accent-active: var(--blue-700);--accent-soft: var(--blue-50);--accent-soft-fg:var(--blue-700);--focus-ring: color-mix(in srgb, var(--blue-500) 45%, transparent);--success: var(--green-500);--success-soft: var(--green-100);--success-fg: var(--green-600);--warning: var(--amber-500);--warning-soft: var(--amber-100);--warning-fg: var(--amber-600);--danger: var(--red-500);--danger-soft: var(--red-100);--danger-fg: var(--red-600);--overlay: color-mix(in srgb, var(--navy-950) 55%, transparent);--font-sans: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;--font-mono: "Space Mono", ui-monospace, "SF Mono", "JetBrains Mono", monospace;--radius-xs: 4px;--radius-sm: 6px;--radius-md: 10px;--radius-lg: 14px;--radius-xl: 20px;--radius-pill: 999px;--shadow-xs: 0 1px 2px rgba(15,30,61,.06);--shadow-sm: 0 1px 2px rgba(15,30,61,.06), 0 1px 3px rgba(15,30,61,.04);--shadow-md: 0 2px 4px rgba(15,30,61,.06), 0 6px 16px rgba(15,30,61,.08);--shadow-lg: 0 8px 24px rgba(15,30,61,.1), 0 2px 6px rgba(15,30,61,.06);--ease-standard: cubic-bezier(.4, 0, .2, 1);--ease-out: cubic-bezier(.16, 1, .3, 1);--dur-fast: .12s;--dur-base: .2s;color-scheme:light}[data-theme=dark]{--bg-app: var(--navy-950);--bg-subtle: var(--slate-950);--surface: #10203F;--surface-2: #142748;--surface-inset: var(--navy-950);--border: color-mix(in srgb, #FFFFFF 10%, transparent);--border-strong: color-mix(in srgb, #FFFFFF 18%, transparent);--border-subtle: color-mix(in srgb, #FFFFFF 6%, transparent);--text-primary: #F4F7FC;--text-secondary:#8FA0BE;--text-tertiary: #5E6E8C;--text-inverse: var(--navy-900);--text-on-accent:#FFFFFF;--accent: var(--blue-400);--accent-hover: var(--blue-300);--accent-active: var(--blue-200);--accent-soft: color-mix(in srgb, var(--blue-500) 18%, transparent);--accent-soft-fg:var(--blue-300);--focus-ring: color-mix(in srgb, var(--blue-400) 55%, transparent);--success:var(--green-500);--success-soft: color-mix(in srgb, var(--green-500) 22%, transparent);--success-fg:#5FD3A0;--warning:var(--amber-500);--warning-soft: color-mix(in srgb, var(--amber-500) 22%, transparent);--warning-fg:#F0B26A;--danger: var(--red-500);--danger-soft: color-mix(in srgb, var(--red-500) 22%, transparent);--danger-fg: #F08A8A;--overlay: color-mix(in srgb, #000000 62%, transparent);--shadow-xs: 0 1px 2px rgba(0,0,0,.35);--shadow-sm: 0 1px 3px rgba(0,0,0,.4);--shadow-md: 0 4px 12px rgba(0,0,0,.45);--shadow-lg: 0 12px 32px rgba(0,0,0,.5);color-scheme:dark}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Space Grotesk,ui-sans-serif,system-ui,-apple-system,Segoe UI,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:Space Mono,ui-monospace,SF Mono,JetBrains Mono,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.tabular{font-variant-numeric:tabular-nums}.eyebrow{font-family:Space Mono,ui-monospace,SF Mono,JetBrains Mono,monospace;font-size:11px;text-transform:uppercase;letter-spacing:.14em;color:var(--text-tertiary)}.readout{font-variant-numeric:tabular-nums;font-family:Space Mono,ui-monospace,SF Mono,JetBrains Mono,monospace;font-size:30px;line-height:1;font-weight:500;color:var(--text-primary)}.panel{border-radius:14px;border-width:1px;border-color:var(--border);background-color:var(--surface);--tw-shadow: var(--shadow-xs);--tw-shadow-colored: var(--shadow-xs);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.pill{border-radius:10px;border-width:1px;border-color:var(--border);background-color:var(--surface-2);padding:.5rem .75rem}.field{width:100%;border-radius:10px;border-width:1px;border-color:var(--border);background-color:var(--surface-2);padding:.625rem .75rem;font-size:.875rem;line-height:1.25rem;color:var(--text-primary);outline:2px solid transparent;outline-offset:2px;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.field::-moz-placeholder{color:var(--text-tertiary)}.field::placeholder{color:var(--text-tertiary)}.field{transition-duration:var(--dur-fast)}.field:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--focus-ring)}.btn-accent{border-radius:10px;background-color:var(--accent);padding:.625rem 1rem;font-size:.875rem;line-height:1.25rem;font-weight:600;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.btn-accent:hover{background-color:var(--accent-hover)}.btn-accent:active{--tw-translate-y: 1px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.btn-accent:disabled{opacity:.5}.btn-accent{transition-duration:var(--dur-fast)}.btn-ghost{border-radius:10px;border-width:1px;border-color:var(--border);background-color:var(--surface);padding:.375rem .75rem;font-size:.875rem;line-height:1.25rem;color:var(--text-secondary);transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.btn-ghost:hover{border-color:var(--border-strong);color:var(--text-primary)}.btn-ghost:active{--tw-translate-y: 1px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.btn-ghost{transition-duration:var(--dur-fast)}.btn-icon{display:grid;height:2.25rem;width:2.25rem;place-items:center;border-radius:10px;border-width:1px;border-color:var(--border);background-color:var(--surface);color:var(--text-secondary);transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.btn-icon:hover{border-color:var(--border-strong);color:var(--text-primary)}.btn-icon{transition-duration:var(--dur-fast)}.\!visible{visibility:visible!important}.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-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}.col-span-2{grid-column:span 2 / span 2}.mx-auto{margin-left:auto;margin-right:auto}.my-4{margin-top:1rem;margin-bottom:1rem}.-mb-px{margin-bottom:-1px}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-3\.5{margin-bottom:.875rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.ml-1{margin-left:.25rem}.ml-1\.5{margin-left:.375rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-1\.5{margin-right:.375rem}.mr-2{margin-right:.5rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-2\.5{margin-top:.625rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.mt-auto{margin-top:auto}.mt-px{margin-top:1px}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-16{height:4rem}.h-2{height:.5rem}.h-28{height:7rem}.h-4{height:1rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[180px\]{height:180px}.h-\[18px\]{height:18px}.h-\[320px\]{height:320px}.h-\[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-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-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-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-md{--tw-shadow: var(--shadow-md);--tw-shadow-colored: var(--shadow-md);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: var(--shadow-sm);--tw-shadow-colored: var(--shadow-sm);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xs{--tw-shadow: var(--shadow-xs);--tw-shadow-colored: var(--shadow-xs);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}html,body,#app{height:100%}html{background-color:var(--bg-app);transition:background-color var(--dur-base) var(--ease-standard)}body{font-family:Space Grotesk,ui-sans-serif,system-ui,-apple-system,Segoe UI,sans-serif;color:var(--text-primary);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#app{background-color:var(--bg-app);min-height:100vh;transition:background-color var(--dur-base) var(--ease-standard)}html.reduce-motion *,html.reduce-motion *:before,html.reduce-motion *:after{transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important}.leaflet-container{background:var(--surface-inset);font-family:var(--font-sans)}.leaflet-control-attribution{background:color-mix(in srgb,var(--surface) 82%,transparent)!important;color:var(--text-tertiary)!important}.leaflet-control-attribution a{color:var(--text-secondary)!important}.placeholder\:text-ink-muted::-moz-placeholder{color:var(--text-tertiary)}.placeholder\:text-ink-muted::placeholder{color:var(--text-tertiary)}.first\:mt-0:first-child{margin-top:0}.last\:border-0:last-child{border-width:0px}.hover\:border-line-strong:hover{border-color:var(--border-strong)}.hover\:bg-danger-soft:hover{background-color:var(--danger-soft)}.hover\:bg-surface-2:hover{background-color:var(--surface-2)}.hover\:text-ink:hover{color:var(--text-primary)}.hover\:text-ink-secondary:hover{color:var(--text-secondary)}.hover\:underline:hover{text-decoration-line:underline}.hover\:brightness-110:hover{--tw-brightness: brightness(1.1);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.enabled\:hover\:brightness-110:hover:enabled{--tw-brightness: brightness(1.1);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}@media(max-width:1100px){.max-\[1100px\]\:hidden{display:none}.max-\[1100px\]\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.max-\[1100px\]\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:900px){.max-\[900px\]\:hidden{display:none}.max-\[900px\]\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.max-\[900px\]\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:820px){.max-\[820px\]\:col-span-1{grid-column:span 1 / span 1}.max-\[820px\]\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}}@media(max-width:760px){.max-\[760px\]\:col-span-1{grid-column:span 1 / span 1}.max-\[760px\]\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.max-\[760px\]\:flex-row{flex-direction:row}.max-\[760px\]\:overflow-x-auto{overflow-x:auto}}@media(max-width:560px){.max-\[560px\]\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}}@media(min-width:640px){.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:justify-between{justify-content:space-between}}.fade-enter-active[data-v-4fe25eb7],.fade-leave-active[data-v-4fe25eb7]{transition:opacity .2s}.fade-enter-from[data-v-4fe25eb7],.fade-leave-to[data-v-4fe25eb7]{opacity:0}
diff --git a/Web App/server/dist/index.html b/Web App/server/dist/index.html
index c06d8e6..2a83f98 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/api.js b/Web App/web/src/api.js
index 14de9d4..63d1df6 100644
--- a/Web App/web/src/api.js
+++ b/Web App/web/src/api.js
@@ -378,6 +378,12 @@ export function documentFileUrl(id) {
return `/bff/documents/${encodeURIComponent(id)}/file`
}
+// URL that streams a document's stored blob for inline preview (rendered in
+// place rather than downloaded).
+export function documentPreviewUrl(id) {
+ return `/bff/documents/${encodeURIComponent(id)}/file?inline=1`
+}
+
export async function sendCommand(id, command, payload) {
const r = await fetch(`/bff/devices/${encodeURIComponent(id)}/command`, {
method: 'POST',
diff --git a/Web App/web/src/components/Documents.vue b/Web App/web/src/components/Documents.vue
index b2fc8dd..a404874 100644
--- a/Web App/web/src/components/Documents.vue
+++ b/Web App/web/src/components/Documents.vue
@@ -1,9 +1,9 @@