@signalk/freeboard-sk 3.2.0-beta.6 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -1
- package/public/assets/features-corpus.json +1 -1
- package/public/{chunk-3KP5HHSO.js → chunk-6ZXMFU55.js} +1 -1
- package/public/{chunk-UAI4UQWR.js → chunk-A2UDMCI5.js} +1 -1
- package/public/{chunk-ZXYQTYUX.js → chunk-GFDZNVNU.js} +3 -3
- package/public/{chunk-DQW7FXC3.js → chunk-HT6GODHM.js} +1 -1
- package/public/{chunk-2EN5AEYB.js → chunk-P57WKW3G.js} +1 -1
- package/public/{chunk-HR7N5JKE.js → chunk-RQKGK2KO.js} +1 -1
- package/public/{chunk-QRN5ZQCW.js → chunk-XXGLBGHG.js} +1 -1
- package/public/{chunk-RTUHMTWY.js → chunk-YB4RBYE2.js} +1 -1
- package/public/index.html +1 -1
- package/public/{main-LS4DSS4G.js → main-LYWXFV5I.js} +4 -4
|
@@ -749,7 +749,7 @@ To display the radar overlay WebGL support is required.`)}init(e){return Y(this,
|
|
|
749
749
|
.cdk-drag-preview * {
|
|
750
750
|
pointer-events: none !important;
|
|
751
751
|
}
|
|
752
|
-
`],encapsulation:2,changeDetection:0})}return n})(),_C=(()=>{class n{_ngZone=M(Wi);_document=M(jo);_styleLoader=M(Dr);_renderer=M(jw).createRenderer(null,null);_cleanupDocumentTouchmove;_scroll=new Oe;_dropInstances=new Set;_dragInstances=new Set;_activeDragInstances=$([]);_globalListeners;_draggingPredicate=t=>t.isDragging();_domNodesToDirectives=null;pointerMove=new Oe;pointerUp=new Oe;constructor(){}registerDropContainer(t){this._dropInstances.has(t)||this._dropInstances.add(t)}registerDragItem(t){this._dragInstances.add(t),this._dragInstances.size===1&&this._ngZone.runOutsideAngular(()=>{this._cleanupDocumentTouchmove?.(),this._cleanupDocumentTouchmove=this._renderer.listen(this._document,"touchmove",this._persistentTouchmoveListener,MI)})}removeDropContainer(t){this._dropInstances.delete(t)}removeDragItem(t){this._dragInstances.delete(t),this.stopDragging(t),this._dragInstances.size===0&&this._cleanupDocumentTouchmove?.()}startDragging(t,i){if(!(this._activeDragInstances().indexOf(t)>-1)&&(this._styleLoader.load(Kse),this._activeDragInstances.update(r=>[...r,t]),this._activeDragInstances().length===1)){let r=i.type.startsWith("touch"),o=s=>this.pointerUp.next(s),a=[["scroll",s=>this._scroll.next(s),$_],["selectstart",this._preventDefaultWhileDragging,MI]];r?a.push(["touchend",o,$_],["touchcancel",o,$_]):a.push(["mouseup",o,$_]),r||a.push(["mousemove",s=>this.pointerMove.next(s),MI]),this._ngZone.runOutsideAngular(()=>{this._globalListeners=a.map(([s,l,c])=>this._renderer.listen(this._document,s,l,c))})}}stopDragging(t){this._activeDragInstances.update(i=>{let r=i.indexOf(t);return r>-1?(i.splice(r,1),[...i]):i}),this._activeDragInstances().length===0&&this._clearGlobalListeners()}isDragging(t){return this._activeDragInstances().indexOf(t)>-1}scrolled(t){let i=[this._scroll];return t&&t!==this._document&&i.push(new Ku(r=>this._ngZone.runOutsideAngular(()=>{let o=this._renderer.listen(t,"scroll",a=>{this._activeDragInstances().length&&r.next(a)},$_);return()=>{o()}}))),Er(...i)}registerDirectiveNode(t,i){this._domNodesToDirectives??=new WeakMap,this._domNodesToDirectives.set(t,i)}removeDirectiveNode(t){this._domNodesToDirectives?.delete(t)}getDragDirectiveForNode(t){return this._domNodesToDirectives?.get(t)||null}ngOnDestroy(){this._dragInstances.forEach(t=>this.removeDragItem(t)),this._dropInstances.forEach(t=>this.removeDropContainer(t)),this._domNodesToDirectives=null,this._clearGlobalListeners(),this.pointerMove.complete(),this.pointerUp.complete()}_preventDefaultWhileDragging=t=>{this._activeDragInstances().length>0&&t.preventDefault()};_persistentTouchmoveListener=t=>{this._activeDragInstances().length>0&&(this._activeDragInstances().some(this._draggingPredicate)&&t.preventDefault(),this.pointerMove.next(t))};_clearGlobalListeners(){this._globalListeners?.forEach(t=>t()),this._globalListeners=void 0}static \u0275fac=function(i){return new(i||n)};static \u0275prov=Je({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function fV(n){let e=n.toLowerCase().indexOf("ms")>-1?1:1e3;return parseFloat(n)*e}function qse(n){let e=getComputedStyle(n),t=SI(e,"transition-property"),i=t.find(s=>s==="transform"||s==="all");if(!i)return 0;let r=t.indexOf(i),o=SI(e,"transition-duration"),a=SI(e,"transition-delay");return fV(o[r])+fV(a[r])}function SI(n,e){return n.getPropertyValue(e).split(",").map(i=>i.trim())}var Zse=new Set(["position"]),II=class{_document;_rootElement;_direction;_initialDomRect;_previewTemplate;_previewClass;_pickupPositionOnPage;_initialTransform;_zIndex;_renderer;_previewEmbeddedView=null;_preview;get element(){return this._preview}constructor(e,t,i,r,o,a,s,l,c,d){this._document=e,this._rootElement=t,this._direction=i,this._initialDomRect=r,this._previewTemplate=o,this._previewClass=a,this._pickupPositionOnPage=s,this._initialTransform=l,this._zIndex=c,this._renderer=d}attach(e){this._preview=this._createPreview(),e.appendChild(this._preview),gV(this._preview)&&this._preview.showPopover()}destroy(){this._preview.remove(),this._previewEmbeddedView?.destroy(),this._preview=this._previewEmbeddedView=null}setTransform(e){this._preview.style.transform=e}getBoundingClientRect(){return this._preview.getBoundingClientRect()}addClass(e){this._preview.classList.add(e)}getTransitionDuration(){return qse(this._preview)}addEventListener(e,t){return this._renderer.listen(this._preview,e,t)}_createPreview(){let e=this._previewTemplate,t=this._previewClass,i=e?e.template:null,r;if(i&&e){let o=e.matchSize?this._initialDomRect:null,a=e.viewContainer.createEmbeddedView(i,e.context);a.detectChanges(),r=wV(a,this._document),this._previewEmbeddedView=a,e.matchSize?mV(r,o):r.style.transform=Z_(this._pickupPositionOnPage.x,this._pickupPositionOnPage.y)}else r=TI(this._rootElement),mV(r,this._initialDomRect),this._initialTransform&&(r.style.transform=this._initialTransform);return LI(r.style,{"pointer-events":"none",margin:gV(r)?"0 auto 0 0":"0",position:"fixed",top:"0",left:"0","z-index":this._zIndex+""},Zse),Kf(r,!1),r.classList.add("cdk-drag-preview"),r.setAttribute("popover","manual"),r.setAttribute("dir",this._direction),t&&(Array.isArray(t)?t.forEach(o=>r.classList.add(o)):r.classList.add(t)),r}};function gV(n){return"showPopover"in n}var Xse={passive:!0},_V={passive:!1},Yse={passive:!1,capture:!0},Qse=800,yV="cdk-drag-placeholder",vV=new Set(["position"]);function MV(n,e,t={dragStartThreshold:5,pointerDirectionChangeThreshold:5}){let i=n.get(Pn,null,{optional:!0})||n.get(jw).createRenderer(null,null);return new kI(e,t,n.get(jo),n.get(Wi),n.get(rh),n.get(_C),i)}var kI=class{_config;_document;_ngZone;_viewportRuler;_dragDropRegistry;_renderer;_rootElementCleanups;_cleanupShadowRootSelectStart;_preview=null;_previewContainer;_placeholderRef=null;_placeholder;_pickupPositionInElement;_pickupPositionOnPage;_marker;_anchor=null;_passiveTransform={x:0,y:0};_activeTransform={x:0,y:0};_initialTransform;_hasStartedDragging=$(!1);_hasMoved=!1;_initialContainer;_initialIndex;_parentPositions;_moveEvents=new Oe;_pointerDirectionDelta;_pointerPositionAtLastDirectionChange;_lastKnownPointerPosition;_rootElement;_ownerSVGElement=null;_rootElementTapHighlight;_pointerMoveSubscription=ir.EMPTY;_pointerUpSubscription=ir.EMPTY;_scrollSubscription=ir.EMPTY;_resizeSubscription=ir.EMPTY;_lastTouchEventTime;_dragStartTime;_boundaryElement=null;_nativeInteractionsEnabled=!0;_initialDomRect;_previewRect;_boundaryRect;_previewTemplate;_placeholderTemplate;_handles=[];_disabledHandles=new Set;_dropContainer;_direction="ltr";_parentDragRef=null;_cachedShadowRoot;lockAxis=null;dragStartDelay=0;previewClass;scale=1;get disabled(){return this._disabled||!!(this._dropContainer&&this._dropContainer.disabled)}set disabled(e){e!==this._disabled&&(this._disabled=e,this._toggleNativeDragInteractions(),this._handles.forEach(t=>Kf(t,e)))}_disabled=!1;beforeStarted=new Oe;started=new Oe;released=new Oe;ended=new Oe;entered=new Oe;exited=new Oe;dropped=new Oe;moved=this._moveEvents;data;constrainPosition;constructor(e,t,i,r,o,a,s){this._config=t,this._document=i,this._ngZone=r,this._viewportRuler=o,this._dragDropRegistry=a,this._renderer=s,this.withRootElement(e).withParent(t.parentDragRef||null),this._parentPositions=new hC(i),a.registerDragItem(this)}getPlaceholderElement(){return this._placeholder}getRootElement(){return this._rootElement}getVisibleElement(){return this.isDragging()?this.getPlaceholderElement():this.getRootElement()}withHandles(e){this._handles=e.map(i=>Vc(i)),this._handles.forEach(i=>Kf(i,this.disabled)),this._toggleNativeDragInteractions();let t=new Set;return this._disabledHandles.forEach(i=>{this._handles.indexOf(i)>-1&&t.add(i)}),this._disabledHandles=t,this}withPreviewTemplate(e){return this._previewTemplate=e,this}withPlaceholderTemplate(e){return this._placeholderTemplate=e,this}withRootElement(e){let t=Vc(e);if(t!==this._rootElement){this._removeRootElementListeners();let i=this._renderer;this._rootElementCleanups=this._ngZone.runOutsideAngular(()=>[i.listen(t,"mousedown",this._pointerDown,_V),i.listen(t,"touchstart",this._pointerDown,Xse),i.listen(t,"dragstart",this._nativeDragStart,_V)]),this._initialTransform=void 0,this._rootElement=t}return typeof SVGElement<"u"&&this._rootElement instanceof SVGElement&&(this._ownerSVGElement=this._rootElement.ownerSVGElement),this}withBoundaryElement(e){return this._boundaryElement=e?Vc(e):null,this._resizeSubscription.unsubscribe(),e&&(this._resizeSubscription=this._viewportRuler.change(10).subscribe(()=>this._containInsideBoundaryOnResize())),this}withParent(e){return this._parentDragRef=e,this}dispose(){this._removeRootElementListeners(),this.isDragging()&&this._rootElement?.remove(),this._marker?.remove(),this._destroyPreview(),this._destroyPlaceholder(),this._dragDropRegistry.removeDragItem(this),this._removeListeners(),this.beforeStarted.complete(),this.started.complete(),this.released.complete(),this.ended.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this._moveEvents.complete(),this._handles=[],this._disabledHandles.clear(),this._dropContainer=void 0,this._resizeSubscription.unsubscribe(),this._parentPositions.clear(),this._boundaryElement=this._rootElement=this._ownerSVGElement=this._placeholderTemplate=this._previewTemplate=this._marker=this._parentDragRef=null}isDragging(){return this._hasStartedDragging()&&this._dragDropRegistry.isDragging(this)}reset(){this._rootElement.style.transform=this._initialTransform||"",this._activeTransform={x:0,y:0},this._passiveTransform={x:0,y:0}}resetToBoundary(){if(this._boundaryElement&&this._rootElement&&$se(this._boundaryElement.getBoundingClientRect(),this._rootElement.getBoundingClientRect())){let e=this._boundaryElement.getBoundingClientRect(),t=this._rootElement.getBoundingClientRect(),i=0,r=0;t.left<e.left?i=e.left-t.left:t.right>e.right&&(i=e.right-t.right),t.top<e.top?r=e.top-t.top:t.bottom>e.bottom&&(r=e.bottom-t.bottom);let o=this._activeTransform.x,a=this._activeTransform.y,s=o+i,l=a+r;this._rootElement.style.transform=Z_(s,l),this._activeTransform={x:s,y:l},this._passiveTransform={x:s,y:l}}}disableHandle(e){!this._disabledHandles.has(e)&&this._handles.indexOf(e)>-1&&(this._disabledHandles.add(e),Kf(e,!0))}enableHandle(e){this._disabledHandles.has(e)&&(this._disabledHandles.delete(e),Kf(e,this.disabled))}withDirection(e){return this._direction=e,this}_withDropContainer(e){this._dropContainer=e}getFreeDragPosition(){let e=this.isDragging()?this._activeTransform:this._passiveTransform;return{x:e.x,y:e.y}}setFreeDragPosition(e){return this._activeTransform={x:0,y:0},this._passiveTransform.x=e.x,this._passiveTransform.y=e.y,this._dropContainer||this._applyRootElementTransform(e.x,e.y),this}withPreviewContainer(e){return this._previewContainer=e,this}_sortFromLastPointerPosition(){let e=this._lastKnownPointerPosition;e&&this._dropContainer&&this._updateActiveDropContainer(this._getConstrainedPointerPosition(e),e)}_removeListeners(){this._pointerMoveSubscription.unsubscribe(),this._pointerUpSubscription.unsubscribe(),this._scrollSubscription.unsubscribe(),this._cleanupShadowRootSelectStart?.(),this._cleanupShadowRootSelectStart=void 0}_destroyPreview(){this._preview?.destroy(),this._preview=null}_destroyPlaceholder(){this._anchor?.remove(),this._placeholder?.remove(),this._placeholderRef?.destroy(),this._placeholder=this._anchor=this._placeholderRef=null}_pointerDown=e=>{if(this.beforeStarted.next(),this._handles.length){let t=this._getTargetHandle(e);t&&!this._disabledHandles.has(t)&&!this.disabled&&this._initializeDragSequence(t,e)}else this.disabled||this._initializeDragSequence(this._rootElement,e)};_pointerMove=e=>{let t=this._getPointerPositionOnPage(e);if(!this._hasStartedDragging()){let r=Math.abs(t.x-this._pickupPositionOnPage.x),o=Math.abs(t.y-this._pickupPositionOnPage.y);if(r+o>=this._config.dragStartThreshold){let s=Date.now()>=this._dragStartTime+this._getDragStartDelay(e),l=this._dropContainer;if(!s){this._endDragSequence(e);return}(!l||!l.isDragging()&&!l.isReceiving())&&(e.cancelable&&e.preventDefault(),this._hasStartedDragging.set(!0),this._ngZone.run(()=>this._startDragSequence(e)))}return}e.cancelable&&e.preventDefault();let i=this._getConstrainedPointerPosition(t);if(this._hasMoved=!0,this._lastKnownPointerPosition=t,this._updatePointerDirectionDelta(i),this._dropContainer)this._updateActiveDropContainer(i,t);else{let r=this.constrainPosition?this._initialDomRect:this._pickupPositionOnPage,o=this._activeTransform;o.x=i.x-r.x+this._passiveTransform.x,o.y=i.y-r.y+this._passiveTransform.y,this._applyRootElementTransform(o.x,o.y)}this._moveEvents.observers.length&&this._ngZone.run(()=>{this._moveEvents.next({source:this,pointerPosition:i,event:e,distance:this._getDragDistance(i),delta:this._pointerDirectionDelta})})};_pointerUp=e=>{this._endDragSequence(e)};_endDragSequence(e){if(this._dragDropRegistry.isDragging(this)&&(this._removeListeners(),this._dragDropRegistry.stopDragging(this),this._toggleNativeDragInteractions(),this._handles&&(this._rootElement.style.webkitTapHighlightColor=this._rootElementTapHighlight),!!this._hasStartedDragging()))if(this.released.next({source:this,event:e}),this._dropContainer)this._dropContainer._stopScrolling(),this._animatePreviewToPlaceholder().then(()=>{this._cleanupDragArtifacts(e),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)});else{this._passiveTransform.x=this._activeTransform.x;let t=this._getPointerPositionOnPage(e);this._passiveTransform.y=this._activeTransform.y,this._ngZone.run(()=>{this.ended.next({source:this,distance:this._getDragDistance(t),dropPoint:t,event:e})}),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)}}_startDragSequence(e){K_(e)&&(this._lastTouchEventTime=Date.now()),this._toggleNativeDragInteractions();let t=this._getShadowRoot(),i=this._dropContainer;if(t&&this._ngZone.runOutsideAngular(()=>{this._cleanupShadowRootSelectStart=this._renderer.listen(t,"selectstart",Jse,Yse)}),i){let r=this._rootElement,o=r.parentNode,a=this._placeholder=this._createPlaceholderElement(),s=this._marker=this._marker||this._document.createComment("");o.insertBefore(s,r),this._initialTransform=r.style.transform||"",this._preview=new II(this._document,this._rootElement,this._direction,this._initialDomRect,this._previewTemplate||null,this.previewClass||null,this._pickupPositionOnPage,this._initialTransform,this._config.zIndex||1e3,this._renderer),this._preview.attach(this._getPreviewInsertionPoint(o,t)),hV(r,!1,vV),this._document.body.appendChild(o.replaceChild(a,r)),this.started.next({source:this,event:e}),i.start(),this._initialContainer=i,this._initialIndex=i.getItemIndex(this)}else this.started.next({source:this,event:e}),this._initialContainer=this._initialIndex=void 0;this._parentPositions.cache(i?i.getScrollableParents():[])}_initializeDragSequence(e,t){this._parentDragRef&&t.stopPropagation();let i=this.isDragging(),r=K_(t),o=!r&&t.button!==0,a=this._rootElement,s=xg(t),l=!r&&this._lastTouchEventTime&&this._lastTouchEventTime+Qse>Date.now(),c=r?k1(t):I1(t);if(s&&s.draggable&&t.type==="mousedown"&&t.preventDefault(),i||o||l||c)return;if(this._handles.length){let m=a.style;this._rootElementTapHighlight=m.webkitTapHighlightColor||"",m.webkitTapHighlightColor="transparent"}this._hasMoved=!1,this._hasStartedDragging.set(this._hasMoved),this._removeListeners(),this._initialDomRect=this._rootElement.getBoundingClientRect(),this._pointerMoveSubscription=this._dragDropRegistry.pointerMove.subscribe(this._pointerMove),this._pointerUpSubscription=this._dragDropRegistry.pointerUp.subscribe(this._pointerUp),this._scrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(m=>this._updateOnScroll(m)),this._boundaryElement&&(this._boundaryRect=AI(this._boundaryElement));let d=this._previewTemplate;this._pickupPositionInElement=d&&d.template&&!d.matchSize?{x:0,y:0}:this._getPointerPositionInElement(this._initialDomRect,e,t);let p=this._pickupPositionOnPage=this._lastKnownPointerPosition=this._getPointerPositionOnPage(t);this._pointerDirectionDelta={x:0,y:0},this._pointerPositionAtLastDirectionChange={x:p.x,y:p.y},this._dragStartTime=Date.now(),this._dragDropRegistry.startDragging(this,t)}_cleanupDragArtifacts(e){hV(this._rootElement,!0,vV),this._marker.parentNode.replaceChild(this._rootElement,this._marker),this._destroyPreview(),this._destroyPlaceholder(),this._initialDomRect=this._boundaryRect=this._previewRect=this._initialTransform=void 0,this._ngZone.run(()=>{let t=this._dropContainer,i=t.getItemIndex(this),r=this._getPointerPositionOnPage(e),o=this._getDragDistance(r),a=t._isOverContainer(r.x,r.y);this.ended.next({source:this,distance:o,dropPoint:r,event:e}),this.dropped.next({item:this,currentIndex:i,previousIndex:this._initialIndex,container:t,previousContainer:this._initialContainer,isPointerOverContainer:a,distance:o,dropPoint:r,event:e}),t.drop(this,i,this._initialIndex,this._initialContainer,a,o,r,e),this._dropContainer=this._initialContainer})}_updateActiveDropContainer({x:e,y:t},{x:i,y:r}){let o=this._initialContainer._getSiblingContainerFromPosition(this,e,t);!o&&this._dropContainer!==this._initialContainer&&this._initialContainer._isOverContainer(e,t)&&(o=this._initialContainer),o&&o!==this._dropContainer&&this._ngZone.run(()=>{let a=this._dropContainer.getItemIndex(this),s=this._dropContainer.getItemAtIndex(a+1)?.getVisibleElement()||null;this.exited.next({item:this,container:this._dropContainer}),this._dropContainer.exit(this),this._conditionallyInsertAnchor(o,this._dropContainer,s),this._dropContainer=o,this._dropContainer.enter(this,e,t,o===this._initialContainer&&o.sortingDisabled?this._initialIndex:void 0),this.entered.next({item:this,container:o,currentIndex:o.getItemIndex(this)})}),this.isDragging()&&(this._dropContainer._startScrollingIfNecessary(i,r),this._dropContainer._sortItem(this,e,t,this._pointerDirectionDelta),this.constrainPosition?this._applyPreviewTransform(e,t):this._applyPreviewTransform(e-this._pickupPositionInElement.x,t-this._pickupPositionInElement.y))}_animatePreviewToPlaceholder(){if(!this._hasMoved)return Promise.resolve();let e=this._placeholder.getBoundingClientRect();this._preview.addClass("cdk-drag-animating"),this._applyPreviewTransform(e.left,e.top);let t=this._preview.getTransitionDuration();return t===0?Promise.resolve():this._ngZone.runOutsideAngular(()=>new Promise(i=>{let r=s=>{(!s||this._preview&&xg(s)===this._preview.element&&s.propertyName==="transform")&&(a(),i(),clearTimeout(o))},o=setTimeout(r,t*1.5),a=this._preview.addEventListener("transitionend",r)}))}_createPlaceholderElement(){let e=this._placeholderTemplate,t=e?e.template:null,i;return t?(this._placeholderRef=e.viewContainer.createEmbeddedView(t,e.context),this._placeholderRef.detectChanges(),i=wV(this._placeholderRef,this._document)):i=TI(this._rootElement),i.style.pointerEvents="none",i.classList.add(yV),i}_getPointerPositionInElement(e,t,i){let r=t===this._rootElement?null:t,o=r?r.getBoundingClientRect():e,a=K_(i)?i.targetTouches[0]:i,s=this._getViewportScrollPosition(),l=a.pageX-o.left-s.left,c=a.pageY-o.top-s.top;return{x:o.left-e.left+l,y:o.top-e.top+c}}_getPointerPositionOnPage(e){let t=this._getViewportScrollPosition(),i=K_(e)?e.touches[0]||e.changedTouches[0]||{pageX:0,pageY:0}:e,r=i.pageX-t.left,o=i.pageY-t.top;if(this._ownerSVGElement){let a=this._ownerSVGElement.getScreenCTM();if(a){let s=this._ownerSVGElement.createSVGPoint();return s.x=r,s.y=o,s.matrixTransform(a.inverse())}}return{x:r,y:o}}_getConstrainedPointerPosition(e){let t=this._dropContainer?this._dropContainer.lockAxis:null,{x:i,y:r}=this.constrainPosition?this.constrainPosition(e,this,this._initialDomRect,this._pickupPositionInElement):e;if(this.lockAxis==="x"||t==="x"?r=this._pickupPositionOnPage.y-(this.constrainPosition?this._pickupPositionInElement.y:0):(this.lockAxis==="y"||t==="y")&&(i=this._pickupPositionOnPage.x-(this.constrainPosition?this._pickupPositionInElement.x:0)),this._boundaryRect){let{x:o,y:a}=this.constrainPosition?{x:0,y:0}:this._pickupPositionInElement,s=this._boundaryRect,{width:l,height:c}=this._getPreviewRect(),d=s.top+a,p=s.bottom-(c-a),m=s.left+o,g=s.right-(l-o);i=bV(i,m,g),r=bV(r,d,p)}return{x:i,y:r}}_updatePointerDirectionDelta(e){let{x:t,y:i}=e,r=this._pointerDirectionDelta,o=this._pointerPositionAtLastDirectionChange,a=Math.abs(t-o.x),s=Math.abs(i-o.y);return a>this._config.pointerDirectionChangeThreshold&&(r.x=t>o.x?1:-1,o.x=t),s>this._config.pointerDirectionChangeThreshold&&(r.y=i>o.y?1:-1,o.y=i),r}_toggleNativeDragInteractions(){if(!this._rootElement||!this._handles)return;let e=this._handles.length>0||!this.isDragging();e!==this._nativeInteractionsEnabled&&(this._nativeInteractionsEnabled=e,Kf(this._rootElement,e))}_removeRootElementListeners(){this._rootElementCleanups?.forEach(e=>e()),this._rootElementCleanups=void 0}_applyRootElementTransform(e,t){let i=1/this.scale,r=Z_(e*i,t*i),o=this._rootElement.style;this._initialTransform==null&&(this._initialTransform=o.transform&&o.transform!="none"?o.transform:""),o.transform=mC(r,this._initialTransform)}_applyPreviewTransform(e,t){let i=this._previewTemplate?.template?void 0:this._initialTransform,r=Z_(e,t);this._preview.setTransform(mC(r,i))}_getDragDistance(e){let t=this._pickupPositionOnPage;return t?{x:e.x-t.x,y:e.y-t.y}:{x:0,y:0}}_cleanupCachedDimensions(){this._boundaryRect=this._previewRect=void 0,this._parentPositions.clear()}_containInsideBoundaryOnResize(){let{x:e,y:t}=this._passiveTransform;if(e===0&&t===0||this.isDragging()||!this._boundaryElement)return;let i=this._rootElement.getBoundingClientRect(),r=this._boundaryElement.getBoundingClientRect();if(r.width===0&&r.height===0||i.width===0&&i.height===0)return;let o=r.left-i.left,a=i.right-r.right,s=r.top-i.top,l=i.bottom-r.bottom;r.width>i.width?(o>0&&(e+=o),a>0&&(e-=a)):e=0,r.height>i.height?(s>0&&(t+=s),l>0&&(t-=l)):t=0,(e!==this._passiveTransform.x||t!==this._passiveTransform.y)&&this.setFreeDragPosition({y:t,x:e})}_getDragStartDelay(e){let t=this.dragStartDelay;return typeof t=="number"?t:K_(e)?t.touch:t?t.mouse:0}_updateOnScroll(e){let t=this._parentPositions.handleScroll(e);if(t){let i=xg(e);this._boundaryRect&&i!==this._boundaryElement&&i.contains(this._boundaryElement)&&q_(this._boundaryRect,t.top,t.left),this._pickupPositionOnPage.x+=t.left,this._pickupPositionOnPage.y+=t.top,this._dropContainer||(this._activeTransform.x-=t.left,this._activeTransform.y-=t.top,this._applyRootElementTransform(this._activeTransform.x,this._activeTransform.y))}}_getViewportScrollPosition(){return this._parentPositions.positions.get(this._document)?.scrollPosition||this._parentPositions.getViewportScrollPosition()}_getShadowRoot(){return this._cachedShadowRoot===void 0&&(this._cachedShadowRoot=T1(this._rootElement)),this._cachedShadowRoot}_getPreviewInsertionPoint(e,t){let i=this._previewContainer||"global";if(i==="parent")return e;if(i==="global"){let r=this._document;return t||r.fullscreenElement||r.webkitFullscreenElement||r.mozFullScreenElement||r.msFullscreenElement||r.body}return Vc(i)}_getPreviewRect(){return(!this._previewRect||!this._previewRect.width&&!this._previewRect.height)&&(this._previewRect=this._preview?this._preview.getBoundingClientRect():this._initialDomRect),this._previewRect}_nativeDragStart=e=>{if(this._handles.length){let t=this._getTargetHandle(e);t&&!this._disabledHandles.has(t)&&!this.disabled&&e.preventDefault()}else this.disabled||e.preventDefault()};_getTargetHandle(e){return this._handles.find(t=>e.target&&(e.target===t||t.contains(e.target)))}_conditionallyInsertAnchor(e,t,i){if(e===this._initialContainer)this._anchor?.remove(),this._anchor=null;else if(t===this._initialContainer&&t.hasAnchor){let r=this._anchor??=TI(this._placeholder);r.classList.remove(yV),r.classList.add("cdk-drag-anchor"),r.style.transform="",i?i.before(r):Vc(t.element).appendChild(r)}}};function bV(n,e,t){return Math.max(e,Math.min(t,n))}function K_(n){return n.type[0]==="t"}function Jse(n){n.preventDefault()}function cl(n,e,t){let i=DI(e,n.length-1),r=DI(t,n.length-1);if(i===r)return;let o=n[i],a=r<i?-1:1;for(let s=i;s!==r;s+=a)n[s]=n[s+a];n[r]=o}function SV(n,e,t,i){let r=DI(i,e.length);n.length&&e.splice(r,0,n[t])}function DI(n,e){return Math.max(0,Math.min(e,n))}var fC=class{_dragDropRegistry;_element;_sortPredicate;_itemPositions=[];_activeDraggables;orientation="vertical";direction="ltr";constructor(e){this._dragDropRegistry=e}_previousSwap={drag:null,delta:0,overlaps:!1};start(e){this.withItems(e)}sort(e,t,i,r){let o=this._itemPositions,a=this._getItemIndexFromPointerPosition(e,t,i,r);if(a===-1&&o.length>0)return null;let s=this.orientation==="horizontal",l=o.findIndex(S=>S.drag===e),c=o[a],d=o[l].clientRect,p=c.clientRect,m=l>a?1:-1,g=this._getItemOffsetPx(d,p,m),y=this._getSiblingOffsetPx(l,o,m),b=o.slice();return cl(o,l,a),o.forEach((S,E)=>{if(b[E]===S)return;let k=S.drag===e,I=k?g:y,C=k?e.getPlaceholderElement():S.drag.getRootElement();S.offset+=I;let x=Math.round(S.offset*(1/S.drag.scale));s?(C.style.transform=mC(`translate3d(${x}px, 0, 0)`,S.initialTransform),q_(S.clientRect,0,I)):(C.style.transform=mC(`translate3d(0, ${x}px, 0)`,S.initialTransform),q_(S.clientRect,I,0))}),this._previousSwap.overlaps=EI(p,t,i),this._previousSwap.drag=c.drag,this._previousSwap.delta=s?r.x:r.y,{previousIndex:l,currentIndex:a}}enter(e,t,i,r){let o=this._activeDraggables,a=o.indexOf(e),s=e.getPlaceholderElement();a>-1&&o.splice(a,1);let l=r==null||r<0?this._getItemIndexFromPointerPosition(e,t,i):r,c=o[l];if(c===e&&(c=o[l+1]),!c&&(l==null||l===-1||l<o.length-1)&&this._shouldEnterAsFirstChild(t,i)&&(c=o[0]),c&&!this._dragDropRegistry.isDragging(c)){let d=c.getRootElement();d.parentElement.insertBefore(s,d),o.splice(l,0,e)}else this._element.appendChild(s),o.push(e);s.style.transform="",this._cacheItemPositions()}withItems(e){this._activeDraggables=e.slice(),this._cacheItemPositions()}withSortPredicate(e){this._sortPredicate=e}reset(){this._activeDraggables?.forEach(e=>{let t=e.getRootElement();if(t){let i=this._itemPositions.find(r=>r.drag===e)?.initialTransform;t.style.transform=i||""}}),this._itemPositions=[],this._activeDraggables=[],this._previousSwap.drag=null,this._previousSwap.delta=0,this._previousSwap.overlaps=!1}getActiveItemsSnapshot(){return this._activeDraggables}getItemIndex(e){return this._getVisualItemPositions().findIndex(t=>t.drag===e)}getItemAtIndex(e){return this._getVisualItemPositions()[e]?.drag||null}updateOnScroll(e,t){this._itemPositions.forEach(({clientRect:i})=>{q_(i,e,t)}),this._itemPositions.forEach(({drag:i})=>{this._dragDropRegistry.isDragging(i)&&i._sortFromLastPointerPosition()})}withElementContainer(e){this._element=e}_cacheItemPositions(){let e=this.orientation==="horizontal";this._itemPositions=this._activeDraggables.map(t=>{let i=t.getVisibleElement();return{drag:t,offset:0,initialTransform:i.style.transform||"",clientRect:AI(i)}}).sort((t,i)=>e?t.clientRect.left-i.clientRect.left:t.clientRect.top-i.clientRect.top)}_getVisualItemPositions(){return this.orientation==="horizontal"&&this.direction==="rtl"?this._itemPositions.slice().reverse():this._itemPositions}_getItemOffsetPx(e,t,i){let r=this.orientation==="horizontal",o=r?t.left-e.left:t.top-e.top;return i===-1&&(o+=r?t.width-e.width:t.height-e.height),o}_getSiblingOffsetPx(e,t,i){let r=this.orientation==="horizontal",o=t[e].clientRect,a=t[e+i*-1],s=o[r?"width":"height"]*i;if(a){let l=r?"left":"top",c=r?"right":"bottom";i===-1?s-=a.clientRect[l]-o[c]:s+=o[l]-a.clientRect[c]}return s}_shouldEnterAsFirstChild(e,t){if(!this._activeDraggables.length)return!1;let i=this._itemPositions,r=this.orientation==="horizontal";if(i[0].drag!==this._activeDraggables[0]){let a=i[i.length-1].clientRect;return r?e>=a.right:t>=a.bottom}else{let a=i[0].clientRect;return r?e<=a.left:t<=a.top}}_getItemIndexFromPointerPosition(e,t,i,r){let o=this.orientation==="horizontal",a=this._itemPositions.findIndex(({drag:s,clientRect:l})=>{if(s===e)return!1;if(r){let c=o?r.x:r.y;if(s===this._previousSwap.drag&&this._previousSwap.overlaps&&c===this._previousSwap.delta)return!1}return o?t>=Math.floor(l.left)&&t<Math.floor(l.right):i>=Math.floor(l.top)&&i<Math.floor(l.bottom)});return a===-1||!this._sortPredicate(a,e)?-1:a}},PI=class{_document;_dragDropRegistry;_element;_sortPredicate;_rootNode;_activeItems;_previousSwap={drag:null,deltaX:0,deltaY:0,overlaps:!1};_relatedNodes=[];constructor(e,t){this._document=e,this._dragDropRegistry=t}start(e){let t=this._element.childNodes;this._relatedNodes=[];for(let i=0;i<t.length;i++){let r=t[i];this._relatedNodes.push([r,r.nextSibling])}this.withItems(e)}sort(e,t,i,r){let o=this._getItemIndexFromPointerPosition(e,t,i),a=this._previousSwap;if(o===-1||this._activeItems[o]===e)return null;let s=this._activeItems[o];if(a.drag===s&&a.overlaps&&a.deltaX===r.x&&a.deltaY===r.y)return null;let l=this.getItemIndex(e),c=e.getPlaceholderElement(),d=s.getRootElement();o>l?d.after(c):d.before(c),cl(this._activeItems,l,o);let p=this._getRootNode().elementFromPoint(t,i);return a.deltaX=r.x,a.deltaY=r.y,a.drag=s,a.overlaps=d===p||d.contains(p),{previousIndex:l,currentIndex:o}}enter(e,t,i,r){let o=this._activeItems.indexOf(e);o>-1&&this._activeItems.splice(o,1);let a=r==null||r<0?this._getItemIndexFromPointerPosition(e,t,i):r;a===-1&&(a=this._getClosestItemIndexToPointer(e,t,i));let s=this._activeItems[a];s&&!this._dragDropRegistry.isDragging(s)?(this._activeItems.splice(a,0,e),s.getRootElement().before(e.getPlaceholderElement())):(this._activeItems.push(e),this._element.appendChild(e.getPlaceholderElement()))}withItems(e){this._activeItems=e.slice()}withSortPredicate(e){this._sortPredicate=e}reset(){let e=this._element,t=this._previousSwap;for(let i=this._relatedNodes.length-1;i>-1;i--){let[r,o]=this._relatedNodes[i];r.parentNode===e&&r.nextSibling!==o&&(o===null?e.appendChild(r):o.parentNode===e&&e.insertBefore(r,o))}this._relatedNodes=[],this._activeItems=[],t.drag=null,t.deltaX=t.deltaY=0,t.overlaps=!1}getActiveItemsSnapshot(){return this._activeItems}getItemIndex(e){return this._activeItems.indexOf(e)}getItemAtIndex(e){return this._activeItems[e]||null}updateOnScroll(){this._activeItems.forEach(e=>{this._dragDropRegistry.isDragging(e)&&e._sortFromLastPointerPosition()})}withElementContainer(e){e!==this._element&&(this._element=e,this._rootNode=void 0)}_getItemIndexFromPointerPosition(e,t,i){let r=this._getRootNode().elementFromPoint(Math.floor(t),Math.floor(i)),o=r?this._activeItems.findIndex(a=>{let s=a.getRootElement();return r===s||s.contains(r)}):-1;return o===-1||!this._sortPredicate(o,e)?-1:o}_getRootNode(){return this._rootNode||(this._rootNode=T1(this._element)||this._document),this._rootNode}_getClosestItemIndexToPointer(e,t,i){if(this._activeItems.length===0)return-1;if(this._activeItems.length===1)return 0;let r=1/0,o=-1;for(let a=0;a<this._activeItems.length;a++){let s=this._activeItems[a];if(s!==e){let{x:l,y:c}=s.getRootElement().getBoundingClientRect(),d=Math.hypot(t-l,i-c);d<r&&(r=d,o=a)}}return o}},xV=.05,TV=.05,ll=(function(n){return n[n.NONE=0]="NONE",n[n.UP=1]="UP",n[n.DOWN=2]="DOWN",n})(ll||{}),Ca=(function(n){return n[n.NONE=0]="NONE",n[n.LEFT=1]="LEFT",n[n.RIGHT=2]="RIGHT",n})(Ca||{});function EV(n,e){return new RI(e,n.get(_C),n.get(jo),n.get(Wi),n.get(rh))}var RI=class{_dragDropRegistry;_ngZone;_viewportRuler;element;disabled=!1;sortingDisabled=!1;lockAxis=null;autoScrollDisabled=!1;autoScrollStep=2;hasAnchor=!1;enterPredicate=()=>!0;sortPredicate=()=>!0;beforeStarted=new Oe;entered=new Oe;exited=new Oe;dropped=new Oe;sorted=new Oe;receivingStarted=new Oe;receivingStopped=new Oe;data;_container;_isDragging=!1;_parentPositions;_sortStrategy;_domRect;_draggables=[];_siblings=[];_activeSiblings=new Set;_viewportScrollSubscription=ir.EMPTY;_verticalScrollDirection=ll.NONE;_horizontalScrollDirection=Ca.NONE;_scrollNode;_stopScrollTimers=new Oe;_cachedShadowRoot=null;_document;_scrollableElements=[];_initialScrollSnap;_direction="ltr";constructor(e,t,i,r,o){this._dragDropRegistry=t,this._ngZone=r,this._viewportRuler=o;let a=this.element=Vc(e);this._document=i,this.withOrientation("vertical").withElementContainer(a),t.registerDropContainer(this),this._parentPositions=new hC(i)}dispose(){this._stopScrolling(),this._stopScrollTimers.complete(),this._viewportScrollSubscription.unsubscribe(),this.beforeStarted.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this.sorted.complete(),this.receivingStarted.complete(),this.receivingStopped.complete(),this._activeSiblings.clear(),this._scrollNode=null,this._parentPositions.clear(),this._dragDropRegistry.removeDropContainer(this)}isDragging(){return this._isDragging}start(){this._draggingStarted(),this._notifyReceivingSiblings()}enter(e,t,i,r){this._draggingStarted(),r==null&&this.sortingDisabled&&(r=this._draggables.indexOf(e)),this._sortStrategy.enter(e,t,i,r),this._cacheParentPositions(),this._notifyReceivingSiblings(),this.entered.next({item:e,container:this,currentIndex:this.getItemIndex(e)})}exit(e){this._reset(),this.exited.next({item:e,container:this})}drop(e,t,i,r,o,a,s,l={}){this._reset(),this.dropped.next({item:e,currentIndex:t,previousIndex:i,container:this,previousContainer:r,isPointerOverContainer:o,distance:a,dropPoint:s,event:l})}withItems(e){let t=this._draggables;return this._draggables=e,e.forEach(i=>i._withDropContainer(this)),this.isDragging()&&(t.filter(r=>r.isDragging()).every(r=>e.indexOf(r)===-1)?this._reset():this._sortStrategy.withItems(this._draggables)),this}withDirection(e){return this._direction=e,this._sortStrategy instanceof fC&&(this._sortStrategy.direction=e),this}connectedTo(e){return this._siblings=e.slice(),this}withOrientation(e){if(e==="mixed")this._sortStrategy=new PI(this._document,this._dragDropRegistry);else{let t=new fC(this._dragDropRegistry);t.direction=this._direction,t.orientation=e,this._sortStrategy=t}return this._sortStrategy.withElementContainer(this._container),this._sortStrategy.withSortPredicate((t,i)=>this.sortPredicate(t,i,this)),this}withScrollableParents(e){let t=this._container;return this._scrollableElements=e.indexOf(t)===-1?[t,...e]:e.slice(),this}withElementContainer(e){if(e===this._container)return this;let t=Vc(this.element),i=this._scrollableElements.indexOf(this._container),r=this._scrollableElements.indexOf(e);return i>-1&&this._scrollableElements.splice(i,1),r>-1&&this._scrollableElements.splice(r,1),this._sortStrategy&&this._sortStrategy.withElementContainer(e),this._cachedShadowRoot=null,this._scrollableElements.unshift(e),this._container=e,this}getScrollableParents(){return this._scrollableElements}getItemIndex(e){return this._isDragging?this._sortStrategy.getItemIndex(e):this._draggables.indexOf(e)}getItemAtIndex(e){return this._isDragging?this._sortStrategy.getItemAtIndex(e):this._draggables[e]||null}isReceiving(){return this._activeSiblings.size>0}_sortItem(e,t,i,r){if(this.sortingDisabled||!this._domRect||!pV(this._domRect,xV,t,i))return;let o=this._sortStrategy.sort(e,t,i,r);o&&this.sorted.next({previousIndex:o.previousIndex,currentIndex:o.currentIndex,container:this,item:e})}_startScrollingIfNecessary(e,t){if(this.autoScrollDisabled)return;let i,r=ll.NONE,o=Ca.NONE;if(this._parentPositions.positions.forEach((a,s)=>{s===this._document||!a.clientRect||i||pV(a.clientRect,xV,e,t)&&([r,o]=ele(s,a.clientRect,this._direction,e,t),(r||o)&&(i=s))}),!r&&!o){let{width:a,height:s}=this._viewportRuler.getViewportSize(),l={width:a,height:s,top:0,right:a,bottom:s,left:0};r=IV(l,t),o=kV(l,e),i=window}i&&(r!==this._verticalScrollDirection||o!==this._horizontalScrollDirection||i!==this._scrollNode)&&(this._verticalScrollDirection=r,this._horizontalScrollDirection=o,this._scrollNode=i,(r||o)&&i?this._ngZone.runOutsideAngular(this._startScrollInterval):this._stopScrolling())}_stopScrolling(){this._stopScrollTimers.next()}_draggingStarted(){let e=this._container.style;this.beforeStarted.next(),this._isDragging=!0,this._initialScrollSnap=e.msScrollSnapType||e.scrollSnapType||"",e.scrollSnapType=e.msScrollSnapType="none",this._sortStrategy.start(this._draggables),this._cacheParentPositions(),this._viewportScrollSubscription.unsubscribe(),this._listenToScrollEvents()}_cacheParentPositions(){this._parentPositions.cache(this._scrollableElements),this._domRect=this._parentPositions.positions.get(this._container).clientRect}_reset(){this._isDragging=!1;let e=this._container.style;e.scrollSnapType=e.msScrollSnapType=this._initialScrollSnap,this._siblings.forEach(t=>t._stopReceiving(this)),this._sortStrategy.reset(),this._stopScrolling(),this._viewportScrollSubscription.unsubscribe(),this._parentPositions.clear()}_startScrollInterval=()=>{this._stopScrolling(),$k(0,jk).pipe(xi(this._stopScrollTimers)).subscribe(()=>{let e=this._scrollNode,t=this.autoScrollStep;this._verticalScrollDirection===ll.UP?e.scrollBy(0,-t):this._verticalScrollDirection===ll.DOWN&&e.scrollBy(0,t),this._horizontalScrollDirection===Ca.LEFT?e.scrollBy(-t,0):this._horizontalScrollDirection===Ca.RIGHT&&e.scrollBy(t,0)})};_isOverContainer(e,t){return this._domRect!=null&&EI(this._domRect,e,t)}_getSiblingContainerFromPosition(e,t,i){return this._siblings.find(r=>r._canReceive(e,t,i))}_canReceive(e,t,i){if(!this._domRect||!EI(this._domRect,t,i)||!this.enterPredicate(e,this))return!1;let r=this._getShadowRoot().elementFromPoint(t,i);return r?r===this._container||this._container.contains(r):!1}_startReceiving(e,t){let i=this._activeSiblings;!i.has(e)&&t.every(r=>this.enterPredicate(r,this)||this._draggables.indexOf(r)>-1)&&(i.add(e),this._cacheParentPositions(),this._listenToScrollEvents(),this.receivingStarted.next({initiator:e,receiver:this,items:t}))}_stopReceiving(e){this._activeSiblings.delete(e),this._viewportScrollSubscription.unsubscribe(),this.receivingStopped.next({initiator:e,receiver:this})}_listenToScrollEvents(){this._viewportScrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(e=>{if(this.isDragging()){let t=this._parentPositions.handleScroll(e);t&&this._sortStrategy.updateOnScroll(t.top,t.left)}else this.isReceiving()&&this._cacheParentPositions()})}_getShadowRoot(){if(!this._cachedShadowRoot){let e=T1(this._container);this._cachedShadowRoot=e||this._document}return this._cachedShadowRoot}_notifyReceivingSiblings(){let e=this._sortStrategy.getActiveItemsSnapshot().filter(t=>t.isDragging());this._siblings.forEach(t=>t._startReceiving(this,e))}};function IV(n,e){let{top:t,bottom:i,height:r}=n,o=r*TV;return e>=t-o&&e<=t+o?ll.UP:e>=i-o&&e<=i+o?ll.DOWN:ll.NONE}function kV(n,e){let{left:t,right:i,width:r}=n,o=r*TV;return e>=t-o&&e<=t+o?Ca.LEFT:e>=i-o&&e<=i+o?Ca.RIGHT:Ca.NONE}function ele(n,e,t,i,r){let o=IV(e,r),a=kV(e,i),s=ll.NONE,l=Ca.NONE;if(o){let c=n.scrollTop;o===ll.UP?c>0&&(s=ll.UP):n.scrollHeight-c>n.clientHeight&&(s=ll.DOWN)}if(a){let c=n.scrollLeft;t==="rtl"?a===Ca.RIGHT?c<0&&(l=Ca.RIGHT):n.scrollWidth+c>n.clientWidth&&(l=Ca.LEFT):a===Ca.LEFT?c>0&&(l=Ca.LEFT):n.scrollWidth-c>n.clientWidth&&(l=Ca.RIGHT)}return[s,l]}var tle=(()=>{class n{_injector=M(Zr);constructor(){}createDrag(t,i){return MV(this._injector,t,i)}createDropList(t){return EV(this._injector,t)}static \u0275fac=function(i){return new(i||n)};static \u0275prov=Je({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),gC=new Ct("CDK_DRAG_PARENT");var DV=new Ct("CdkDragHandle"),dl=(()=>{class n{element=M(ft);_parentDrag=M(gC,{optional:!0,skipSelf:!0});_dragDropRegistry=M(_C);_stateChanges=new Oe;get disabled(){return this._disabled}set disabled(t){this._disabled=t,this._stateChanges.next(this)}_disabled=!1;constructor(){this._parentDrag?._addHandle(this)}ngAfterViewInit(){if(!this._parentDrag){let t=this.element.nativeElement.parentElement;for(;t;){let i=this._dragDropRegistry.getDragDirectiveForNode(t);if(i){this._parentDrag=i,i._addHandle(this);break}t=t.parentElement}}}ngOnDestroy(){this._parentDrag?._removeHandle(this),this._stateChanges.complete()}static \u0275fac=function(i){return new(i||n)};static \u0275dir=pt({type:n,selectors:[["","cdkDragHandle",""]],hostAttrs:[1,"cdk-drag-handle"],inputs:{disabled:[2,"cdkDragHandleDisabled","disabled",He]},features:[Ft([{provide:DV,useExisting:n}])]})}return n})(),PV=new Ct("CDK_DRAG_CONFIG"),RV=new Ct("CdkDropList"),So=(()=>{class n{element=M(ft);dropContainer=M(RV,{optional:!0,skipSelf:!0});_ngZone=M(Wi);_viewContainerRef=M(ua);_dir=M(uo,{optional:!0});_changeDetectorRef=M(ae);_selfHandle=M(DV,{optional:!0,self:!0});_parentDrag=M(gC,{optional:!0,skipSelf:!0});_dragDropRegistry=M(_C);_destroyed=new Oe;_handles=new fl([]);_previewTemplate=null;_placeholderTemplate=null;_dragRef;data;lockAxis=null;rootElementSelector;boundaryElement;dragStartDelay;freeDragPosition;get disabled(){return this._disabled||!!(this.dropContainer&&this.dropContainer.disabled)}set disabled(t){this._disabled=t,this._dragRef.disabled=this._disabled}_disabled=!1;constrainPosition;previewClass;previewContainer;scale=1;started=new me;released=new me;ended=new me;entered=new me;exited=new me;dropped=new me;moved=new Ku(t=>{let i=this._dragRef.moved.pipe(Fr(r=>({source:this,pointerPosition:r.pointerPosition,event:r.event,delta:r.delta,distance:r.distance}))).subscribe(t);return()=>{i.unsubscribe()}});_injector=M(Zr);constructor(){let t=this.dropContainer,i=M(PV,{optional:!0});this._dragRef=MV(this._injector,this.element,{dragStartThreshold:i&&i.dragStartThreshold!=null?i.dragStartThreshold:5,pointerDirectionChangeThreshold:i&&i.pointerDirectionChangeThreshold!=null?i.pointerDirectionChangeThreshold:5,zIndex:i?.zIndex}),this._dragRef.data=this,this._dragDropRegistry.registerDirectiveNode(this.element.nativeElement,this),i&&this._assignDefaults(i),t&&(t.addItem(this),t._dropListRef.beforeStarted.pipe(xi(this._destroyed)).subscribe(()=>{this._dragRef.scale=this.scale})),this._syncInputs(this._dragRef),this._handleEvents(this._dragRef)}getPlaceholderElement(){return this._dragRef.getPlaceholderElement()}getRootElement(){return this._dragRef.getRootElement()}reset(){this._dragRef.reset()}resetToBoundary(){this._dragRef.resetToBoundary()}getFreeDragPosition(){return this._dragRef.getFreeDragPosition()}setFreeDragPosition(t){this._dragRef.setFreeDragPosition(t)}ngAfterViewInit(){ss(()=>{this._updateRootElement(),this._setupHandlesListener(),this._dragRef.scale=this.scale,this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition)},{injector:this._injector})}ngOnChanges(t){let i=t.rootElementSelector,r=t.freeDragPosition;i&&!i.firstChange&&this._updateRootElement(),this._dragRef.scale=this.scale,r&&!r.firstChange&&this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition)}ngOnDestroy(){this.dropContainer&&this.dropContainer.removeItem(this),this._dragDropRegistry.removeDirectiveNode(this.element.nativeElement),this._ngZone.runOutsideAngular(()=>{this._handles.complete(),this._destroyed.next(),this._destroyed.complete(),this._dragRef.dispose()})}_addHandle(t){let i=this._handles.getValue();i.push(t),this._handles.next(i)}_removeHandle(t){let i=this._handles.getValue(),r=i.indexOf(t);r>-1&&(i.splice(r,1),this._handles.next(i))}_setPreviewTemplate(t){this._previewTemplate=t}_resetPreviewTemplate(t){t===this._previewTemplate&&(this._previewTemplate=null)}_setPlaceholderTemplate(t){this._placeholderTemplate=t}_resetPlaceholderTemplate(t){t===this._placeholderTemplate&&(this._placeholderTemplate=null)}_updateRootElement(){let t=this.element.nativeElement,i=t;this.rootElementSelector&&(i=t.closest!==void 0?t.closest(this.rootElementSelector):t.parentElement?.closest(this.rootElementSelector)),this._dragRef.withRootElement(i||t)}_getBoundaryElement(){let t=this.boundaryElement;return t?typeof t=="string"?this.element.nativeElement.closest(t):Vc(t):null}_syncInputs(t){t.beforeStarted.subscribe(()=>{if(!t.isDragging()){let i=this._dir,r=this.dragStartDelay,o=this._placeholderTemplate?{template:this._placeholderTemplate.templateRef,context:this._placeholderTemplate.data,viewContainer:this._viewContainerRef}:null,a=this._previewTemplate?{template:this._previewTemplate.templateRef,context:this._previewTemplate.data,matchSize:this._previewTemplate.matchSize,viewContainer:this._viewContainerRef}:null;t.disabled=this.disabled,t.lockAxis=this.lockAxis,t.scale=this.scale,t.dragStartDelay=typeof r=="object"&&r?r:$w(r),t.constrainPosition=this.constrainPosition,t.previewClass=this.previewClass,t.withBoundaryElement(this._getBoundaryElement()).withPlaceholderTemplate(o).withPreviewTemplate(a).withPreviewContainer(this.previewContainer||"global"),i&&t.withDirection(i.value)}}),t.beforeStarted.pipe(zo(1)).subscribe(()=>{if(this._parentDrag){t.withParent(this._parentDrag._dragRef);return}let i=this.element.nativeElement.parentElement;for(;i;){let r=this._dragDropRegistry.getDragDirectiveForNode(i);if(r){t.withParent(r._dragRef);break}i=i.parentElement}})}_handleEvents(t){t.started.subscribe(i=>{this.started.emit({source:this,event:i.event}),this._changeDetectorRef.markForCheck()}),t.released.subscribe(i=>{this.released.emit({source:this,event:i.event})}),t.ended.subscribe(i=>{this.ended.emit({source:this,distance:i.distance,dropPoint:i.dropPoint,event:i.event}),this._changeDetectorRef.markForCheck()}),t.entered.subscribe(i=>{this.entered.emit({container:i.container.data,item:this,currentIndex:i.currentIndex})}),t.exited.subscribe(i=>{this.exited.emit({container:i.container.data,item:this})}),t.dropped.subscribe(i=>{this.dropped.emit({previousIndex:i.previousIndex,currentIndex:i.currentIndex,previousContainer:i.previousContainer.data,container:i.container.data,isPointerOverContainer:i.isPointerOverContainer,item:this,distance:i.distance,dropPoint:i.dropPoint,event:i.event})})}_assignDefaults(t){let{lockAxis:i,dragStartDelay:r,constrainPosition:o,previewClass:a,boundaryElement:s,draggingDisabled:l,rootElementSelector:c,previewContainer:d}=t;this.disabled=l??!1,this.dragStartDelay=r||0,this.lockAxis=i||null,o&&(this.constrainPosition=o),a&&(this.previewClass=a),s&&(this.boundaryElement=s),c&&(this.rootElementSelector=c),d&&(this.previewContainer=d)}_setupHandlesListener(){this._handles.pipe(da(t=>{let i=t.map(r=>r.element);this._selfHandle&&this.rootElementSelector&&i.push(this.element),this._dragRef.withHandles(i)}),fr(t=>Er(...t.map(i=>i._stateChanges.pipe(hn(i))))),xi(this._destroyed)).subscribe(t=>{let i=this._dragRef,r=t.element.nativeElement;t.disabled?i.disableHandle(r):i.enableHandle(r)})}static \u0275fac=function(i){return new(i||n)};static \u0275dir=pt({type:n,selectors:[["","cdkDrag",""]],hostAttrs:[1,"cdk-drag"],hostVars:4,hostBindings:function(i,r){i&2&&ht("cdk-drag-disabled",r.disabled)("cdk-drag-dragging",r._dragRef.isDragging())},inputs:{data:[0,"cdkDragData","data"],lockAxis:[0,"cdkDragLockAxis","lockAxis"],rootElementSelector:[0,"cdkDragRootElement","rootElementSelector"],boundaryElement:[0,"cdkDragBoundary","boundaryElement"],dragStartDelay:[0,"cdkDragStartDelay","dragStartDelay"],freeDragPosition:[0,"cdkDragFreeDragPosition","freeDragPosition"],disabled:[2,"cdkDragDisabled","disabled",He],constrainPosition:[0,"cdkDragConstrainPosition","constrainPosition"],previewClass:[0,"cdkDragPreviewClass","previewClass"],previewContainer:[0,"cdkDragPreviewContainer","previewContainer"],scale:[2,"cdkDragScale","scale",Ii]},outputs:{started:"cdkDragStarted",released:"cdkDragReleased",ended:"cdkDragEnded",entered:"cdkDragEntered",exited:"cdkDragExited",dropped:"cdkDragDropped",moved:"cdkDragMoved"},exportAs:["cdkDrag"],features:[Ft([{provide:gC,useExisting:n}]),Se]})}return n})(),CV=new Ct("CdkDropListGroup");var qf=(()=>{class n{element=M(ft);_changeDetectorRef=M(ae);_scrollDispatcher=M(Kw);_dir=M(uo,{optional:!0});_group=M(CV,{optional:!0,skipSelf:!0});_latestSortedRefs;_destroyed=new Oe;_scrollableParentsResolved=!1;static _dropLists=[];_dropListRef;connectedTo=[];data;orientation="vertical";id=M(nr).getId("cdk-drop-list-");lockAxis=null;get disabled(){return this._disabled||!!this._group&&this._group.disabled}set disabled(t){this._dropListRef.disabled=this._disabled=t}_disabled=!1;sortingDisabled=!1;enterPredicate=()=>!0;sortPredicate=()=>!0;autoScrollDisabled=!1;autoScrollStep;elementContainerSelector=null;hasAnchor=!1;dropped=new me;entered=new me;exited=new me;sorted=new me;_unsortedItems=new Set;constructor(){let t=M(PV,{optional:!0}),i=M(Zr);this._dropListRef=EV(i,this.element),this._dropListRef.data=this,t&&this._assignDefaults(t),this._dropListRef.enterPredicate=(r,o)=>this.enterPredicate(r.data,o.data),this._dropListRef.sortPredicate=(r,o,a)=>this.sortPredicate(r,o.data,a.data),this._setupInputSyncSubscription(this._dropListRef),this._handleEvents(this._dropListRef),n._dropLists.push(this),this._group&&this._group._items.add(this)}addItem(t){this._unsortedItems.add(t),t._dragRef._withDropContainer(this._dropListRef),this._dropListRef.isDragging()&&this._syncItemsWithRef(this.getSortedItems().map(i=>i._dragRef))}removeItem(t){if(this._unsortedItems.delete(t),this._latestSortedRefs){let i=this._latestSortedRefs.indexOf(t._dragRef);i>-1&&(this._latestSortedRefs.splice(i,1),this._syncItemsWithRef(this._latestSortedRefs))}}getSortedItems(){return Array.from(this._unsortedItems).sort((t,i)=>t._dragRef.getVisibleElement().compareDocumentPosition(i._dragRef.getVisibleElement())&Node.DOCUMENT_POSITION_FOLLOWING?-1:1)}ngOnDestroy(){let t=n._dropLists.indexOf(this);t>-1&&n._dropLists.splice(t,1),this._group&&this._group._items.delete(this),this._latestSortedRefs=void 0,this._unsortedItems.clear(),this._dropListRef.dispose(),this._destroyed.next(),this._destroyed.complete()}_setupInputSyncSubscription(t){this._dir&&this._dir.change.pipe(hn(this._dir.value),xi(this._destroyed)).subscribe(i=>t.withDirection(i)),t.beforeStarted.subscribe(()=>{let i=cD(this.connectedTo).map(r=>{if(typeof r=="string"){let o=n._dropLists.find(a=>a.id===r);return o}return r});if(this._group&&this._group._items.forEach(r=>{i.indexOf(r)===-1&&i.push(r)}),!this._scrollableParentsResolved){let r=this._scrollDispatcher.getAncestorScrollContainers(this.element).map(o=>o.getElementRef().nativeElement);this._dropListRef.withScrollableParents(r),this._scrollableParentsResolved=!0}if(this.elementContainerSelector){let r=this.element.nativeElement.querySelector(this.elementContainerSelector);t.withElementContainer(r)}t.disabled=this.disabled,t.lockAxis=this.lockAxis,t.sortingDisabled=this.sortingDisabled,t.autoScrollDisabled=this.autoScrollDisabled,t.autoScrollStep=$w(this.autoScrollStep,2),t.hasAnchor=this.hasAnchor,t.connectedTo(i.filter(r=>r&&r!==this).map(r=>r._dropListRef)).withOrientation(this.orientation)})}_handleEvents(t){t.beforeStarted.subscribe(()=>{this._syncItemsWithRef(this.getSortedItems().map(i=>i._dragRef)),this._changeDetectorRef.markForCheck()}),t.entered.subscribe(i=>{this.entered.emit({container:this,item:i.item.data,currentIndex:i.currentIndex})}),t.exited.subscribe(i=>{this.exited.emit({container:this,item:i.item.data}),this._changeDetectorRef.markForCheck()}),t.sorted.subscribe(i=>{this.sorted.emit({previousIndex:i.previousIndex,currentIndex:i.currentIndex,container:this,item:i.item.data})}),t.dropped.subscribe(i=>{this.dropped.emit({previousIndex:i.previousIndex,currentIndex:i.currentIndex,previousContainer:i.previousContainer.data,container:i.container.data,item:i.item.data,isPointerOverContainer:i.isPointerOverContainer,distance:i.distance,dropPoint:i.dropPoint,event:i.event}),this._changeDetectorRef.markForCheck()}),Er(t.receivingStarted,t.receivingStopped).subscribe(()=>this._changeDetectorRef.markForCheck())}_assignDefaults(t){let{lockAxis:i,draggingDisabled:r,sortingDisabled:o,listAutoScrollDisabled:a,listOrientation:s}=t;this.disabled=r??!1,this.sortingDisabled=o??!1,this.autoScrollDisabled=a??!1,this.orientation=s||"vertical",this.lockAxis=i||null}_syncItemsWithRef(t){this._latestSortedRefs=t,this._dropListRef.withItems(t)}static \u0275fac=function(i){return new(i||n)};static \u0275dir=pt({type:n,selectors:[["","cdkDropList",""],["cdk-drop-list"]],hostAttrs:[1,"cdk-drop-list"],hostVars:7,hostBindings:function(i,r){i&2&&(Ye("id",r.id),ht("cdk-drop-list-disabled",r.disabled)("cdk-drop-list-dragging",r._dropListRef.isDragging())("cdk-drop-list-receiving",r._dropListRef.isReceiving()))},inputs:{connectedTo:[0,"cdkDropListConnectedTo","connectedTo"],data:[0,"cdkDropListData","data"],orientation:[0,"cdkDropListOrientation","orientation"],id:"id",lockAxis:[0,"cdkDropListLockAxis","lockAxis"],disabled:[2,"cdkDropListDisabled","disabled",He],sortingDisabled:[2,"cdkDropListSortingDisabled","sortingDisabled",He],enterPredicate:[0,"cdkDropListEnterPredicate","enterPredicate"],sortPredicate:[0,"cdkDropListSortPredicate","sortPredicate"],autoScrollDisabled:[2,"cdkDropListAutoScrollDisabled","autoScrollDisabled",He],autoScrollStep:[0,"cdkDropListAutoScrollStep","autoScrollStep"],elementContainerSelector:[0,"cdkDropListElementContainer","elementContainerSelector"],hasAnchor:[2,"cdkDropListHasAnchor","hasAnchor",He]},outputs:{dropped:"cdkDropListDropped",entered:"cdkDropListEntered",exited:"cdkDropListExited",sorted:"cdkDropListSorted"},exportAs:["cdkDropList"],features:[Ft([{provide:CV,useValue:void 0},{provide:RV,useExisting:n}])]})}return n})();var ile=new Ct("CdkDragPlaceholder"),AV=(()=>{class n{templateRef=M(Yr);_drag=M(gC,{optional:!0});data;constructor(){this._drag?._setPlaceholderTemplate(this)}ngOnDestroy(){this._drag?._resetPlaceholderTemplate(this)}static \u0275fac=function(i){return new(i||n)};static \u0275dir=pt({type:n,selectors:[["ng-template","cdkDragPlaceholder",""]],inputs:{data:"data"},features:[Ft([{provide:ile,useExisting:n}])]})}return n})();var yC=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=wi({type:n});static \u0275inj=Ci({providers:[tle],imports:[E1]})}return n})();var X_=100,nle=200,OV=n=>Number.isFinite(n)?Math.min(nle,Math.max(0,Math.round(n*100))):X_,FV=n=>n/100,vC=class n{brightness=$(X_);contrast=$(X_);dialogRef=M(ci);data=M(_i);initialPosition=this.data.position??{x:0,y:0};ngOnInit(){this.brightness.set(OV(this.data.value?.brightness??1)),this.contrast.set(OV(this.data.value?.contrast??1))}onBrightnessChange(e){this.brightness.set(Number(e.target.value)),this.emitChange()}onContrastChange(e){this.contrast.set(Number(e.target.value)),this.emitChange()}reset(){this.brightness.set(X_),this.contrast.set(X_),this.emitChange()}onDragEnded(e){typeof this.data?.onMoved=="function"&&this.data.onMoved(e.source.getFreeDragPosition())}currentValue(){return{brightness:FV(this.brightness()),contrast:FV(this.contrast())}}emitChange(){typeof this.data?.onChange=="function"&&this.data.onChange(this.currentValue())}handleClose(e){this.dialogRef.close({apply:e,value:this.currentValue()})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["ap-image-adjustment-dialog"]],decls:30,vars:13,consts:[["cdkDrag","","cdkDragRootElement",".cdk-overlay-pane",1,"_ap-image-adjustment",2,"overflow","hidden","color","var(--mat-app-text-color)",3,"cdkDragEnded","cdkDragFreeDragPosition"],["cdkDragHandle","",2,"display","flex","align-items","center","cursor","move","padding","4px 4px 0 12px"],[2,"opacity","0.6"],[2,"flex","1 1 auto","min-width","0","padding-left","8px","font-weight","500","overflow","hidden","text-overflow","ellipsis","white-space","nowrap",3,"title"],["mat-icon-button","","aria-label","Close",3,"click"],[2,"padding","0 24px","overflow","hidden","margin-top","-4px"],[2,"display","flex","align-items","center","margin","-11px 0"],[2,"width","72px","font-size","13px"],[2,"flex","1 1 auto","min-width","0",3,"min","max","step"],["matSliderThumb","","aria-label","Brightness",3,"input","value"],[2,"min-width","44px","text-align","right","font-size","13px"],["matSliderThumb","","aria-label","Contrast",3,"input","value"],[2,"min-height","38px","padding","0 8px 2px"],["mat-button","",3,"click"],[2,"flex","1 1 auto"]],template:function(t,i){t&1&&(u(0,"div",0),T("cdkDragEnded",function(o){return i.onDragEnded(o)}),u(1,"div",1)(2,"mat-icon",2),_(3,"tune"),h(),u(4,"div",3),_(5),h(),u(6,"button",4),T("click",function(){return i.handleClose(!1)}),u(7,"mat-icon"),_(8,"close"),h()()(),u(9,"mat-dialog-content",5)(10,"div",6)(11,"div",7),_(12,"Brightness"),h(),u(13,"mat-slider",8)(14,"input",9),T("input",function(o){return i.onBrightnessChange(o)}),h()(),u(15,"div",10),_(16),h()(),u(17,"div",6)(18,"div",7),_(19,"Contrast"),h(),u(20,"mat-slider",8)(21,"input",11),T("input",function(o){return i.onContrastChange(o)}),h()(),u(22,"div",10),_(23),h()()(),u(24,"mat-dialog-actions",12)(25,"button",13),T("click",function(){return i.reset()}),_(26,"RESET"),h(),z(27,"span",14),u(28,"button",13),T("click",function(){return i.handleClose(!0)}),_(29,"SAVE"),h()()()),t&2&&(w("cdkDragFreeDragPosition",i.initialPosition),f(4),w("title",i.data.text),f(),K(" ",i.data.text," "),f(8),w("min",0)("max",200)("step",1),f(),w("value",i.brightness()),f(2),K(" ",i.brightness(),"% "),f(4),w("min",0)("max",200)("step",1),f(),w("value",i.contrast()),f(2),K(" ",i.contrast(),"% "))},dependencies:[Zl,ql,vl,se,ce,ue,Ze,Fe,di,Oi,ki,ye,So,dl],encapsulation:2})};function OI(n){let e=n*10,t=e+Number.EPSILON*Math.max(1,Math.abs(e));return Math.floor(t)/10}function NV(n){return OI(n).toFixed(1)}function rle(n,e){if(n&1&&(u(0,"div",11),_(1),h()),n&2){let t=v();f(),K(" ",t.error()," ")}}function ole(n,e){if(n&1&&(u(0,"div",12),_(1),h()),n&2){let t=v();f(),K(" ",t.summary()," ")}}var FI=1,NI=28;function BV(n){if(n==null||String(n).trim()==="")return{invalid:!1};let e=Number(n);return!Number.isFinite(e)||e<FI||e>NI?{invalid:!0}:{value:e,invalid:!1}}function ale(n){return n.invalid?`Enter a zoom level between ${FI} and ${NI}`:null}function GV(n){return typeof n=="number"?`from z${n}`:""}function VV(n){return Number.isFinite(n)?String(OI(n)):""}var bC=class n{ZOOM_ENTRY_MIN=FI;ZOOM_ENTRY_MAX=NI;text=$("");dialogRef=M(ci);data=M(_i);error=Qe(()=>ale(BV(this.text())));summary=Qe(()=>{let e=this.currentValue();return typeof e=="number"?`Hidden below z${e}`:"Shown at every zoom level"});ngOnInit(){this.text.set(typeof this.data.value=="number"?String(this.data.value):"")}declaredText(){let{declaredMin:e,declaredMax:t}=this.data;return typeof e=="number"&&typeof t=="number"?`data z${e}\u2013z${t}`:"data zoom range unknown"}currentZoomText(){return VV(this.data.currentZoom())}onTextChange(e){this.setText(e.target.value)}useCurrentZoom(){this.setText(VV(this.data.currentZoom()))}clear(){this.setText("")}setText(e){this.text.set(e),!this.error()&&typeof this.data?.onChange=="function"&&this.data.onChange(this.currentValue())}currentValue(){return BV(this.text()).value}handleClose(e){this.dialogRef.close({apply:e,value:this.currentValue()})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["ap-chart-min-zoom-dialog"]],decls:27,vars:10,consts:[["cdkDrag","","cdkDragRootElement",".cdk-overlay-pane",1,"_ap-chart-min-zoom",2,"overflow","hidden","color","var(--mat-app-text-color)"],["cdkDragHandle","",2,"display","flex","align-items","center","cursor","move","padding","4px 4px 0 12px"],[2,"opacity","0.6"],[2,"flex","1 1 auto","min-width","0","padding-left","8px","font-weight","500","overflow","hidden","text-overflow","ellipsis","white-space","nowrap",3,"title"],["mat-icon-button","","aria-label","Close",3,"click"],[2,"padding","0 16px","font-size","12px","opacity","0.7","margin-top","-4px"],[2,"display","flex","align-items","center","gap","4px","padding","10px 8px 0 16px"],[2,"font-size","13px"],["type","number","inputmode","decimal","step","any","aria-label","Lowest zoom level to show this chart at",2,"width","70px","height","34px","box-sizing","border-box","padding","0 0 0 8px","font","inherit","font-size","14px","color","inherit","background","transparent","border","1px solid rgba(128, 128, 128, 0.5)","border-radius","4px",3,"change","min","max","value"],["mat-icon-button","","aria-label","Use the current map zoom","matTooltip","Use current map zoom",3,"click"],["mat-icon-button","","aria-label","Clear","matTooltip","Clear",3,"click","disabled"],["role","alert",1,"mat-mdc-form-field-error",2,"padding","4px 16px 0","font-size","12px"],[2,"padding","4px 16px 0","font-size","12px","opacity","0.7"],[2,"min-height","38px","padding","0 8px 2px"],[2,"flex","1 1 auto"],["mat-button","",3,"click","disabled"]],template:function(t,i){t&1&&(u(0,"div",0)(1,"div",1)(2,"mat-icon",2),_(3,"vertical_align_bottom"),h(),u(4,"div",3),_(5),h(),u(6,"button",4),T("click",function(){return i.handleClose(!1)}),u(7,"mat-icon"),_(8,"close"),h()()(),u(9,"div",5),_(10),h(),u(11,"div",6)(12,"div",7),_(13,"Show from"),h(),u(14,"input",8),T("change",function(o){return i.onTextChange(o)}),h(),u(15,"button",9),T("click",function(){return i.useCurrentZoom()}),u(16,"mat-icon"),_(17,"my_location"),h()(),u(18,"button",10),T("click",function(){return i.clear()}),u(19,"mat-icon"),_(20,"close"),h()()(),R(21,rle,2,1,"div",11)(22,ole,2,1,"div",12),u(23,"mat-dialog-actions",13),z(24,"span",14),u(25,"button",15),T("click",function(){return i.handleClose(!0)}),_(26," APPLY "),h()()()),t&2&&(f(4),w("title",i.data.text),f(),K(" ",i.data.text," "),f(5),Nr(" ",i.declaredText()," \xB7 map at z",i.currentZoomText()," "),f(4),w("min",i.ZOOM_ENTRY_MIN)("max",i.ZOOM_ENTRY_MAX)("value",i.text()),f(4),w("disabled",i.text()===""),f(3),A(i.error()?21:22),f(4),w("disabled",!!i.error()))},dependencies:[se,ce,ue,Ze,Fe,di,Oi,ye,Te,So,dl],encapsulation:2})};function sle(n,e){if(n&1){let t=H();Vi(0,"div",8)(1,"div",9),Nc("keydown",function(r){O(t);let o=v();return F(o.onKeyDown(r,"head"))}),Xi()()}if(n&2){let t=v();vt("left",t.headPct(),"%"),Ir("title",t.label()(t.position())),f(),Ye("aria-valuemin",t.min())("aria-valuemax",t.max())("aria-valuenow",t.position())("aria-valuetext",t.label()(t.position()))}}var lle=30,cle=10;function dle(n,e,t,i,r,o){let a=cle*o,s;switch(n){case"ArrowLeft":case"ArrowDown":s=t-(e?a:o);break;case"ArrowRight":case"ArrowUp":s=t+(e?a:o);break;case"PageDown":s=t-a;break;case"PageUp":s=t+a;break;case"Home":s=i;break;case"End":s=r;break;default:return null}return zV(s,i,r,o)}function zV(n,e,t,i){let r=e+Math.round((n-e)/i)*i;return Math.min(t,Math.max(e,r))}function ule(n,e,t){return e==="start"?{min:t,max:Math.max(n.max,t)}:{min:Math.min(n.min,t),max:t}}var Zf=class n{min=Z.required();max=Z.required();step=Z.required();position=Z.required();loop=Z.required();label=Z(()=>"");names=Z({start:"Loop start",end:"Loop end"});positionChange=xe();loopChange=xe();host=M(ft);dragging=null;hasHead=Qe(()=>this.position()!==null);headPct=Qe(()=>this.pct(this.position()??this.min()));loopPct=Qe(()=>({min:this.pct(this.loop().min),max:this.pct(this.loop().max)}));pct(e){let t=this.max()-this.min();if(t<=0)return 0;let i=(e-this.min())/t;return Math.min(100,Math.max(0,i*100))}positionAt(e){let i=(this.host.nativeElement.querySelector(".axis")??this.host.nativeElement).getBoundingClientRect(),r=i.width>0?(e.clientX-i.left)/i.width:0,o=this.min()+Math.min(1,Math.max(0,r))*(this.max()-this.min());return zV(o,this.min(),this.max(),this.step())}onPointerDown(e){if(e.button!==0&&e.pointerType==="mouse")return;let t=e.currentTarget,i=e.clientY-t.getBoundingClientRect().top;if(this.hasHead()&&i<lle)this.dragging="head";else{let r=this.positionAt(e),{min:o,max:a}=this.loop();this.dragging=Math.abs(r-o)<=Math.abs(r-a)?"start":"end"}t.setPointerCapture(e.pointerId),this.host.nativeElement.querySelector(`[data-handle="${this.dragging}"]`)?.focus({preventScroll:!0}),this.apply(e),e.preventDefault()}onKeyDown(e,t){let i=t==="head"?this.position():t==="start"?this.loop().min:this.loop().max,r=dle(e.key,e.shiftKey,i,this.min(),this.max(),this.step());r!==null&&(e.preventDefault(),this.moveHandle(t,r))}onPointerMove(e){this.dragging&&this.apply(e)}onPointerUp(e){if(!this.dragging)return;this.dragging=null;let t=e.currentTarget;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId)}apply(e){this.dragging&&this.moveHandle(this.dragging,this.positionAt(e))}moveHandle(e,t){if(e==="head"){t!==this.position()&&this.positionChange.emit(t);return}let i=ule(this.loop(),e,t),r=this.loop();(i.min!==r.min||i.max!==r.max)&&this.loopChange.emit(i)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["ap-chart-time-bar"]],inputs:{min:[1,"min"],max:[1,"max"],step:[1,"step"],position:[1,"position"],loop:[1,"loop"],label:[1,"label"],names:[1,"names"]},outputs:{positionChange:"positionChange",loopChange:"loopChange"},decls:9,vars:22,consts:[["role","group",1,"bar",3,"pointerdown","pointermove","pointerup","pointercancel"],[1,"axis"],[1,"track"],[1,"band"],[1,"edge",3,"title"],["role","slider","tabindex","0","data-handle","start",1,"knob",3,"keydown"],["role","slider","tabindex","0","data-handle","end",1,"knob",3,"keydown"],[1,"head",3,"left","title"],[1,"head",3,"title"],["role","slider","tabindex","0","data-handle","head","aria-label","Instant shown",1,"knob",3,"keydown"]],template:function(t,i){t&1&&(Vi(0,"div",0),Nc("pointerdown",function(o){return i.onPointerDown(o)})("pointermove",function(o){return i.onPointerMove(o)})("pointerup",function(o){return i.onPointerUp(o)})("pointercancel",function(o){return i.onPointerUp(o)}),Vi(1,"div",1),Fc(2,"div",2)(3,"div",3),Vi(4,"div",4)(5,"div",5),Nc("keydown",function(o){return i.onKeyDown(o,"start")}),Xi()(),Vi(6,"div",4)(7,"div",6),Nc("keydown",function(o){return i.onKeyDown(o,"end")}),Xi()(),R(8,sle,2,7,"div",7),Xi()()),t&2&&(Ye("aria-label",i.hasHead()?"Time scrub and loop bar":"Time range bar"),f(3),vt("left",i.loopPct().min,"%")("width",i.loopPct().max-i.loopPct().min,"%"),f(),vt("left",i.loopPct().min,"%"),Ir("title",i.names().start+": "+i.label()(i.loop().min)),f(),Ye("aria-label",i.names().start)("aria-valuemin",i.min())("aria-valuemax",i.max())("aria-valuenow",i.loop().min)("aria-valuetext",i.label()(i.loop().min)),f(),vt("left",i.loopPct().max,"%"),Ir("title",i.names().end+": "+i.label()(i.loop().max)),f(),Ye("aria-label",i.names().end)("aria-valuemin",i.min())("aria-valuemax",i.max())("aria-valuenow",i.loop().max)("aria-valuetext",i.label()(i.loop().max)),f(),A(i.hasHead()?8:-1))},styles:["[_nghost-%COMP%]{display:block;--bar-track: rgba(0, 0, 0, .18);--bar-band: rgba(79, 148, 212, .28);--bar-head: #1f4e8c;--bar-edge: #f2b84b;--bar-knob-shadow: rgba(0, 0, 0, .35);--bar-focus: #1f4e8c}.dark-theme[_nghost-%COMP%], .dark-theme [_nghost-%COMP%]{--bar-track: rgba(255, 255, 255, .22);--bar-band: rgba(127, 212, 255, .24);--bar-head: #3b7ddb;--bar-knob-shadow: rgba(0, 0, 0, .6);--bar-focus: #7fd4ff}.bar[_ngcontent-%COMP%]{position:relative;height:52px;-webkit-user-select:none;user-select:none;touch-action:none;cursor:pointer}.axis[_ngcontent-%COMP%]{position:absolute;inset:0 12px}.track[_ngcontent-%COMP%]{position:absolute;left:0;right:0;top:13px;height:4px;border-radius:2px;background:var(--bar-track)}.band[_ngcontent-%COMP%]{position:absolute;top:4px;height:48px;background:var(--bar-band);border-radius:3px;pointer-events:none}.edge[_ngcontent-%COMP%]{position:absolute;top:13px;height:30px;width:2px;margin-left:-1px;background:var(--bar-edge);pointer-events:none}.edge[_ngcontent-%COMP%] .knob[_ngcontent-%COMP%]{top:auto;bottom:-9px;background:var(--bar-edge)}.head[_ngcontent-%COMP%]{position:absolute;top:0;height:30px;width:2px;margin-left:-1px;background:var(--bar-head);pointer-events:none}.knob[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--bar-focus);outline-offset:2px}.knob[_ngcontent-%COMP%]{position:absolute;top:6px;left:50%;width:18px;height:18px;margin-left:-9px;border-radius:50%;background:var(--bar-head);box-shadow:0 1px 4px var(--bar-knob-shadow)}"],changeDetection:0})};function ple(n,e){if(n&1){let t=H();u(0,"ap-chart-time-bar",13),T("positionChange",function(r){O(t);let o=v();return F(o.onScrub(r))})("loopChange",function(r){O(t);let o=v();return F(o.onLoop(r))}),h(),u(1,"div",14)(2,"mat-form-field",15)(3,"mat-label"),_(4,"Speed"),h(),u(5,"mat-select",16),T("valueChange",function(r){O(t);let o=v();return F(o.setSpeed(r))}),u(6,"mat-option",17),_(7,"Slow"),h(),u(8,"mat-option",18),_(9,"Medium"),h(),u(10,"mat-option",19),_(11,"Fast"),h(),u(12,"mat-option",20),_(13,"X-fast"),h()()(),u(14,"span",21),_(15),h()()}if(n&2){let t=v();w("min",t.window().min)("max",t.window().max)("step",e.step)("position",t.position())("loop",t.loopRange())("label",t.thumbLabel),f(5),w("value",t.speed()),f(10),X(t.loopText())}}var BI={slow:1400,medium:700,fast:350,xfast:150},jV=12*36e5;function VI(n,e){if(!n.frames)return Math.max(n.step,Math.floor(jV/n.step)*n.step);let t=Math.min(n.max,Math.max(n.min,Math.round(e))),i=lo(n.frames[t])-jV,r=t;for(;r>0&&lo(n.frames[r-1])>=i;)r--;return Math.max(1,t-r)}function UV(n,e){let t=VI(n,e),i=Math.min(n.max,Math.max(n.min+t,e));return{min:Math.max(n.min,i-t),max:i}}function hle(n,e){let t=Id(n,null),i=VI(n,t);return t-e<=i?Math.max(t,e):e}function mle(n,e,t){let i=UV(n,e);return t>i.max?t:t<i.min?Math.min(n.max,t+VI(n,t)):e}function fle(n,e,t=n){let i=XE(n);if(!(i>e.head))return e;let r=l=>lo(na(t,l)),o=l=>Id(n,new Date(l).toISOString());if(r(e.windowEnd)<e.head)return st(ne({},e),{head:i});let a=i-e.head,s=l=>l===null?null:o(r(l)+a);return{head:i,windowEnd:o(r(e.windowEnd)+a),loopStart:s(e.loopStart),loopEnd:s(e.loopEnd)}}var WV={start:36e5,end:0};function HV(n,e,t,i){let r=d=>Id(n,na(n,Id(n,new Date(t-Math.max(0,d)).toISOString()))),o=r(i.start),a=r(i.end);if(Math.max(o,a)<e.min||Math.min(o,a)>e.max)return HV(n,e,lo(na(n,e.max)),WV);let s=d=>Math.min(e.max,Math.max(e.min,d)),l=s(Math.min(o,a)),c=s(Math.max(o,a));return{min:l,max:c}}function gle(n,e,t){let i=r=>lo(na(n,r));return{start:Math.max(0,e-i(t.min)),end:Math.max(0,e-i(t.max))}}function _le(n,e,t){let i=e??n.min,r=t??n.max;return i>n.max||r<n.min||i>r?n:{min:Math.max(n.min,i),max:Math.min(n.max,r)}}function yle(n){let e=Math.round(n/6e4);if(e<1)return`${Math.round(n/1e3)} s`;if(e<60)return`${e} min`;let t=Math.floor(e/60),i=e%60;if(t<24)return i?`${t} h ${i} min`:`${t} h`;let r=Math.floor(t/24),o=t%24;return o?`${r} d ${o} h`:`${r} d`}function CC(n,e="medium"){if(n===null)return"Live";let t=new Date(n);return Number.isFinite(t.valueOf())?t.toLocaleString(void 0,{dateStyle:e,timeStyle:"short"}):n}function Kp(n){return CC(n,"short")}var xC=class n{dialogRef=M(ci);data=M(_i);timeline=Qe(()=>Up(this.data.dimension?.()));current=Qe(()=>this.data.dimension?.()?.current!==!1);playing=$(!1);speed=$("medium");playTimer;clock=$(Date.now());clockTimer=setInterval(()=>this.clock.set(Date.now()),A2);position=Qe(()=>{this.clock();let e=this.timeline();return e?Id(e,this.data.value()):0});windowEnd=$(this.initialWindowEnd());window=Qe(()=>{let e=this.timeline();return e?UV(e,this.windowEnd()):{min:0,max:0}});initialPosition=this.data.position??{x:0,y:0};latestMs=this.initialLatestMs();seenTimeline=this.timeline();loopStart=$(this.initialLoop().min);loopEnd=$(this.initialLoop().max);loopRange=Qe(()=>_le(this.window(),this.loopStart(),this.loopEnd()));loopText=Qe(()=>{let e=this.loopRange(),t=this.timeline();return t?`${Kp(na(t,e.min))} \u2192 `+Kp(na(t,e.max)):""});valueText=Qe(()=>(this.clock(),CC(Cc(this.data.dimension?.(),this.data.value()))));thumbLabel=e=>{let t=this.timeline();return t?Kp(na(t,e)):""};constructor(){Me(()=>{let e=this.timeline(),t=this.position();this.clock(),ha(()=>{e&&(this.followHead(e),this.windowEnd.set(mle(e,this.windowEnd(),t)))})})}followHead(e){let t={head:this.latestMs,windowEnd:this.windowEnd(),loopStart:this.loopStart(),loopEnd:this.loopEnd()},i=fle(e,t,this.seenTimeline??e);this.seenTimeline=e,i!==t&&(this.latestMs=i.head,this.windowEnd.set(i.windowEnd),this.loopStart.set(i.loopStart),this.loopEnd.set(i.loopEnd))}ngOnDestroy(){this.stopPlayback(),clearInterval(this.clockTimer)}rangeText(){let e=this.timeline();return e?e.frames?`${e.frames.length} frames`:`every ${yle(e.step)}`:"no frames advertised"}onScrub(e){let t=this.timeline();t&&(this.stopPlayback(),this.data.onChange(na(t,e)))}step(e){let t=this.timeline();t&&(this.stopPlayback(),this.data.onChange(QF(t,this.data.value(),e,this.current())))}onLoop(e){this.loopStart.set(e.min),this.loopEnd.set(e.max);let t=this.timeline();t&&typeof this.data.onLoopChange=="function"&&this.data.onLoopChange(gle(t,this.latestMs,e))}onDragEnded(e){typeof this.data?.onMoved=="function"&&this.data.onMoved(e.source.getFreeDragPosition())}initialWindowEnd(){let e=this.timeline();return e?hle(e,this.position()):0}initialLatestMs(){let e=this.timeline();return e?XE(e):0}initialLoop(){let e=this.timeline();return e?HV(e,this.window(),this.latestMs,this.data.loop??WV):{min:0,max:0}}goLive(){this.stopPlayback(),this.data.onChange(null)}togglePlay(){if(this.playing()){this.stopPlayback();return}this.timeline()&&(this.playing.set(!0),this.tick(),this.startTimer())}setSpeed(e){this.speed.set(e),this.playing()&&(clearInterval(this.playTimer),this.startTimer())}startTimer(){this.playTimer=setInterval(()=>this.tick(),BI[this.speed()])}tick(){let e=this.timeline();e&&this.data.onChange(JF(e,this.data.value(),this.loopRange()))}stopPlayback(){this.playTimer&&(clearInterval(this.playTimer),this.playTimer=void 0),this.playing.set(!1)}handleClose(){this.dialogRef.close()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["ap-chart-time-dialog"]],decls:27,vars:14,consts:[["cdkDrag","","cdkDragRootElement",".cdk-overlay-pane",1,"_ap-chart-time",2,"overflow","hidden","color","var(--mat-app-text-color)",3,"cdkDragEnded","cdkDragFreeDragPosition"],["cdkDragHandle","",2,"display","flex","align-items","center","cursor","move","padding","4px 4px 0 12px"],[2,"opacity","0.6"],[2,"flex","1 1 auto","min-width","0","padding-left","8px","font-weight","500","overflow","hidden","text-overflow","ellipsis","white-space","nowrap",3,"title"],["mat-icon-button","","aria-label","Close",3,"click"],[2,"padding","0 16px","font-size","12px","opacity","0.7","margin-top","-4px"],["aria-live","polite",2,"padding","6px 16px 0","font-size","15px","font-weight","500"],[2,"min-height","38px","padding","0 8px 2px"],["mat-icon-button","","aria-label","Previous frame","matTooltip","Previous frame",3,"click","disabled"],["mat-icon-button","",3,"click","matTooltip","disabled"],["mat-icon-button","","aria-label","Next frame","matTooltip","Next frame",3,"click","disabled"],[2,"flex","1 1 auto"],["mat-button","",3,"click","matTooltip","disabled"],[2,"padding","4px 4px 0",3,"positionChange","loopChange","min","max","step","position","loop","label"],[2,"display","flex","align-items","center","gap","6px","padding","2px 16px 0 12px","font-size","11px"],["appearance","outline","subscriptSizing","dynamic",1,"_ap-speed"],["aria-label","Playback speed","panelClass","_ap-speed-panel",3,"valueChange","value"],["value","slow"],["value","medium"],["value","fast"],["value","xfast"],[2,"flex","1 1 auto","text-align","right","opacity","0.7"]],template:function(t,i){if(t&1&&(u(0,"div",0),T("cdkDragEnded",function(o){return i.onDragEnded(o)}),u(1,"div",1)(2,"mat-icon",2),_(3,"schedule"),h(),u(4,"div",3),_(5),h(),u(6,"button",4),T("click",function(){return i.handleClose()}),u(7,"mat-icon"),_(8,"close"),h()()(),u(9,"div",5),_(10),h(),u(11,"div",6),_(12),h(),R(13,ple,16,8),u(14,"mat-dialog-actions",7)(15,"button",8),T("click",function(){return i.step(-1)}),u(16,"mat-icon"),_(17,"navigate_before"),h()(),u(18,"button",9),T("click",function(){return i.togglePlay()}),u(19,"mat-icon"),_(20),h()(),u(21,"button",10),T("click",function(){return i.step(1)}),u(22,"mat-icon"),_(23,"navigate_next"),h()(),z(24,"span",11),u(25,"button",12),T("click",function(){return i.goLive()}),_(26," NOW "),h()()()),t&2){let r;w("cdkDragFreeDragPosition",i.initialPosition),f(4),w("title",i.data.text),f(),K(" ",i.data.text," "),f(5),K(" ",i.rangeText()," "),f(2),K(" ",i.valueText()," "),f(),A((r=i.timeline())?13:-1,r),f(2),w("disabled",!i.timeline()),f(3),w("matTooltip",i.playing()?"Pause":"Play")("disabled",!i.timeline()),Ye("aria-label",i.playing()?"Pause":"Play"),f(2),X(i.playing()?"pause":"play_arrow"),f(),w("disabled",!i.timeline()||i.data.value()===null),f(4),w("matTooltip",i.current()?"Return to the live frame":"Return to the newest frame")("disabled",i.data.value()===null)}},dependencies:[se,ce,ue,Ze,Fe,di,Oi,ye,Te,Da,Gt,Vt,Ra,zs,Gs,Zf,So,dl],styles:["._ap-speed[_ngcontent-%COMP%]{width:92px;font-size:11px}._ap-speed[_ngcontent-%COMP%] .mat-mdc-text-field-wrapper{padding-top:0;padding-bottom:0}._ap-speed[_ngcontent-%COMP%] .mat-mdc-form-field-infix{min-height:30px;padding-top:6px;padding-bottom:4px}._ap-speed[_ngcontent-%COMP%] .mat-mdc-select-value, ._ap-speed[_ngcontent-%COMP%] .mat-mdc-floating-label{font-size:11px}"]})};var $V="3.2.0-beta.6";var KV=500,Xf=1.5,ble=1,xle=2147483647;function qV(n){return typeof n!="number"||!Number.isFinite(n)?Xf*1e3:Math.min(Math.max(n,ble)*1e3,xle)}var wC=class{constructor(e=()=>{}){this.onExpire=e}onExpire;_marker=$(null);timer;seq=0;get marker(){return this._marker.asReadonly()}get active(){return this._marker()!==null}pin(e,t,i){this.stopTimer(),this._marker.set({id:++this.seq,position:e,worldOffset:t,fadeMs:i}),this.timer=setTimeout(()=>{this.timer=void 0,this._marker.set(null),this.onExpire()},i)}release(){this.stopTimer(),this._marker.set(null)}stopTimer(){clearTimeout(this.timer),this.timer=void 0}};function ZV(n){let e=!0,t=Object.keys(n);return Object.keys(zI()).forEach(i=>{t.includes(i)||(e=!1)}),e}function GI(n,e){if(typeof n.ui>"u"?n.ui={mapNorthUp:!0,mapMove:!1,mapConstrainZoom:!1,invertColor:!1,toolbarButtons:!0,showCourseData:!0,showAisTargets:!0,showNotes:!0,autoNightMode:!1}:(typeof n.ui.showCourseData>"u"&&(n.ui.showCourseData=!0),typeof n.ui.showAisTargets>"u"&&(n.ui.showAisTargets=!0),typeof n.ui.showNotes>"u"&&(n.ui.showNotes=!0)),typeof n.imageAdjustPalettePos>"u"&&(n.imageAdjustPalettePos=null),typeof n.timePalettePos>"u"&&(n.timePalettePos=null),typeof n.trackHistoryPalettePos>"u"&&(n.trackHistoryPalettePos=null),typeof n.display>"u"?n.display={fab:"wpt",disableWakelock:!1,darkMode:{enabled:!1,source:0},nightMode:!1,muteSound:!1,depthAlarm:{enabled:!1,smoothing:1e4},plugins:{instruments:"/@signalk/instrumentpanel",startOnOpen:!0,parameters:null,favourites:[]},preferInfoPanel:!0,singleClickNoteDetails:!1,windIndicator:"barb",statusBar:{liveEta:!1,referenceSpeed:6,tapFadeSpeed:Xf}}:(typeof n.display.preferInfoPanel>"u"&&(n.display.preferInfoPanel=!0),typeof n.display.singleClickNoteDetails>"u"&&(n.display.singleClickNoteDetails=!1),typeof n.display.windIndicator>"u"&&(n.display.windIndicator="barb"),typeof n.display.statusBar>"u"?n.display.statusBar={liveEta:!1,referenceSpeed:6,tapFadeSpeed:Xf}:typeof n.display.statusBar.tapFadeSpeed>"u"&&(n.display.statusBar.tapFadeSpeed=Xf)),typeof n.units.temperature>"u"&&(n.units.temperature="C"),n.units.temperature=n.units.temperature.toUpperCase(),n.units.depth=n.units.depth==="ft"?"foot":n.units.depth,typeof n.units.length>"u"&&(n.units.length=n.units.depth??"m"),n.units.speed=n.units.speed==="msec"?"m/s":n.units.speed==="kmh"?"km/h":n.units.speed,n.units.distance=n.units.distance==="m"?"kilometer":n.units.distance==="ft"?"naut-mile":n.units.distance,typeof n.map.s57Options>"u"?n.map.s57Options={graphicsStyle:"Paper",boundaries:"Plain",colors:4,shallowDepth:2,safetyDepth:3,deepDepth:6,colorTable:0,otherLayers:Gf.otherLayers,depthUnit:n.units.depth??"m"}:(typeof n.map.s57Options.otherLayers>"u"&&(n.map.s57Options.otherLayers=Gf.otherLayers),typeof n.map.s57Options.depthUnit>"u"&&(n.map.s57Options.depthUnit=n.units.depth??"m")),typeof n.map.labelsMinZoom>"u"&&(n.map.labelsMinZoom=8),typeof n.map.panBehavior>"u"){let i=n.map;n.map.panBehavior=A6(i.lockMoveMap),delete i.lockMoveMap}typeof n.map.refollowDelay!="number"&&(n.map.refollowDelay=0),typeof n.map.popoverMulti>"u"&&(n.map.popoverMulti=!1);let t=n.map.centerOffsetAbeam;if(n.map.centerOffset=L6(n.map.centerOffset,t),delete n.map.centerOffsetAbeam,typeof n.map.doubleClickZoom>"u"&&(n.map.doubleClickZoom=!1),typeof n.map.overZoomTiles>"u"&&(n.map.overZoomTiles=!0),n.units.positionFormat||(n.units.positionFormat="XY"),typeof n.units.headingAttribute>"u"&&(n.units.headingAttribute="navigation.headingTrue"),typeof n.units.preferredPaths>"u"&&(n.units.preferredPaths={tws:"environment.wind.speedTrue",twd:"environment.wind.directionTrue",heading:"auto",course:"navigation.courseGreatCircle"}),n.units.autoHeadingApplied||(n.units.preferredPaths.heading==="navigation.courseOverGroundTrue"&&(n.units.preferredPaths.heading="auto"),n.units.autoHeadingApplied=!0),typeof n.units.useServerPrefs>"u"&&(n.units.useServerPrefs=!1),typeof n.course>"u"?n.course={autoNextPointOnArrival:!1,autoNextPointDelay:5e3,autoNextPointTrigger:"perpendicularPassed",arrivalCircle:100}:typeof n.course.arrivalCircle>"u"&&(n.course.arrivalCircle=100),typeof n.vessels>"u"?n.vessels={fixedLocationMode:!1,fixedPosition:[0,0],trail:!0,windVectors:!0,laylines:!1,selfLines:{cog:{length:10,color:"rgba(204, 12, 225, 0.7)",weight:1,dash:"none"},heading:{length:-1,color:"rgba(221, 99, 0, 0.5)",weight:4,dash:"none"}},aisCogLine:10,iconScale:.9,rangeCircles:!1,rangeCirclesFixed:!1,rangeCirclesDistance:1e3,rangeCircleCount:4,rangeCircleMinZoom:8,aisStaleAge:36e4,aisMaxAge:54e4,aisWindApparent:!1,aisWindMinZoom:15,aisShowTrack:!1,aisTrackLength:12,trailSource:"auto",trailDuration:24,trailResolution:{lastHour:"5s",next23:"1m",beyond24:"5m"}}:(n.vessels.trailSource=aP(n.vessels.trailFromServer,n.vessels.trailSource),delete n.vessels.trailFromServer,typeof n.vessels.aisTrackLength>"u"&&(n.vessels.aisTrackLength=12),typeof n.vessels.rangeCircleCount>"u"&&(n.vessels.rangeCircleCount=4),typeof n.vessels.rangeCircleMinZoom>"u"&&(n.vessels.rangeCircleMinZoom=8),typeof n.vessels.rangeCirclesFixed>"u"&&(n.vessels.rangeCirclesFixed=!1),typeof n.vessels.rangeCirclesDistance>"u"&&(n.vessels.rangeCirclesDistance=1e3),typeof n.vessels.selfLines>"u"&&(n.vessels.selfLines={cog:{length:n.vessels.cogLine??10,color:"rgba(204, 12, 225, 0.7)",weight:1,dash:"none"},heading:{length:n.vessels.headingLineSize??-1,color:"rgba(221, 99, 0, 0.5)",weight:4,dash:"none"}},delete n.vessels.cogLine,delete n.vessels.headingLineSize)),typeof n.resources>"u"?n.resources={fetchFilter:"?position=[%map:longitude%,%map:latitude%]&distance=%fetch:radius%",fetchRadius:0,notes:{rootFilter:"?position=[%map:longitude%,%map:latitude%]&distance=%note:radius%",getRadius:20,groupNameEdit:!1,groupRequiresPosition:!1,minZoom:10},video:{enable:!1,url:""},paths:[]}:(typeof n.resources.notes.minZoom>"u"&&(n.resources.notes.minZoom=10),typeof n.resources.video>"u"&&(n.resources.video={enable:!1,url:""}),typeof n.resources.paths>"u"&&(n.resources.paths=[]),typeof n.resources.fetchFilter>"u"&&(n.resources.fetchFilter="?position=[%map:longitude%,%map:latitude%]&distance=%fetch:radius%"),typeof n.resources.fetchRadius>"u"&&(n.resources.fetchRadius=0)),typeof n.signalk>"u"?n.signalk={vessels:!0,atons:!0,aircraft:!1,sar:!1,meteo:!0,maxRadius:0,proxied:!0}:n.signalk.proxied=!0,typeof n.anchor>"u"&&(n.anchor={radius:40,setRadius:!1,manualSet:!1,rodeLength:50}),(!n.plotterExtensions||typeof n.plotterExtensions!="object"||Array.isArray(n.plotterExtensions))&&(n.plotterExtensions={widgets:[]}),delete n.plotterExtensions.enabled,Array.isArray(n.plotterExtensions.widgets)||(n.plotterExtensions.widgets=[]),n.plotterExtensions.widgets=n.plotterExtensions.widgets.map(i=>(i.corner&&!i.anchor&&(i.anchor=i.corner==="tl"?"tr":i.corner,delete i.corner),i)).filter(i=>["tr","ct","cb","bl","br"].includes(i.anchor)),typeof n.radars>"u"?n.radars={deviceId:"",opacity:1}:typeof n.radars.opacity>"u"&&(n.radars.opacity=1),typeof n.selections>"u"&&(n.selections={routes:[],waypoints:[],regions:[],tracks:null,charts:["openstreetmap","openseamap"],chartOrder:["openstreetmap","openseamap"],chartOpacity:{},chartImageAdjustment:{},chartDisplayMinZoom:{},chartTimeLoop:{},aisTargets:null,aisTargetTypes:[],aisFilterByShipType:!1,aisState:[],resourceSets:{},infolayers:null,weatherWindEnabled:!1,oceanCurrentsEnabled:!1,tidalCurrentsEnabled:!1}),typeof n.selections.aisTargetTypes>"u"&&(n.selections.aisTargetTypes=[]),typeof n.selections.aisFilterByShipType>"u"&&(n.selections.aisFilterByShipType=!1),typeof n.selections.aisState>"u"&&(n.selections.aisState=[]),typeof n.selections.chartOrder>"u"&&(n.selections.chartOrder=[]),typeof n.selections.chartOpacity>"u"&&(n.selections.chartOpacity={}),typeof n.selections.chartImageAdjustment>"u"&&(n.selections.chartImageAdjustment={}),typeof n.selections.chartDisplayMinZoom>"u"&&(n.selections.chartDisplayMinZoom={}),typeof n.selections.chartTimeLoop>"u"&&(n.selections.chartTimeLoop={}),typeof n.selections.tracks>"u"&&(n.selections.tracks=[]),typeof n.selections.resourceSets>"u"&&(n.selections.resourceSets={}),typeof n.selections.infolayers>"u"&&(n.selections.infolayers=[]),typeof n.selections.regions>"u"&&(n.selections.regions=[]),typeof n.selections.weatherWindEnabled>"u"&&(n.selections.weatherWindEnabled=!1),typeof n.selections.oceanCurrentsEnabled>"u"&&(n.selections.oceanCurrentsEnabled=!1),typeof n.selections.tidalCurrentsEnabled>"u"&&(n.selections.tidalCurrentsEnabled=!1),delete n.selections.notes,typeof e.northup<"u"&&(n.ui.mapNorthUp=e.northup!=="0"),typeof e.movemap<"u"&&(n.ui.mapMove=e.movemap!=="0"),e.zoom)try{let i=parseInt(e.zoom);isNaN(i)||(n.map.zoomLevel=i>28?28:i<1?1:i)}catch(i){console.warn(`Invalid zoom level parameter (${e.zoom} supplied!`)}}function zI(){return{ui:{mapNorthUp:!0,mapMove:!1,mapConstrainZoom:!1,toolbarButtons:!0,invertColor:!1,showCourseData:!0,showAisTargets:!0,showNotes:!0,autoNightMode:!1},imageAdjustPalettePos:null,timePalettePos:null,trackHistoryPalettePos:null,display:{fab:"wpt",disableWakelock:!1,darkMode:{enabled:!1,source:0},nightMode:!1,muteSound:!1,depthAlarm:{enabled:!1,smoothing:1e4},plugins:{instruments:"/@signalk/instrumentpanel",startOnOpen:!0,parameters:null,favourites:[]},preferInfoPanel:!0,singleClickNoteDetails:!1,windIndicator:"barb",statusBar:{liveEta:!1,referenceSpeed:6,tapFadeSpeed:Xf}},units:{distance:"kilometer",depth:"m",length:"m",speed:"kn",temperature:"C",positionFormat:"XY",headingAttribute:"navigation.headingTrue",preferredPaths:{tws:"environment.wind.speedTrue",twd:"environment.wind.directionTrue",heading:"auto",course:"navigation.courseGreatCircle"},autoHeadingApplied:!0,useServerPrefs:!1},map:{zoomLevel:2,center:[0,0],rotation:0,panBehavior:"offset",refollowDelay:0,animate:!1,labelsMinZoom:8,doubleClickZoom:!1,overZoomTiles:!0,centerOffset:{x:0,y:0},s57Options:{graphicsStyle:"Paper",boundaries:"Plain",colors:4,shallowDepth:2,safetyDepth:3,deepDepth:6,colorTable:0,otherLayers:Gf.otherLayers,depthUnit:"m"},popoverMulti:!1},course:{autoNextPointOnArrival:!1,autoNextPointDelay:5e3,autoNextPointTrigger:"perpendicularPassed",arrivalCircle:100},vessels:{fixedLocationMode:!1,fixedPosition:[0,0],trail:!0,windVectors:!0,laylines:!1,selfLines:{cog:{length:10,color:"rgba(204, 12, 225, 0.7)",weight:1,dash:"none"},heading:{length:-1,color:"rgba(221, 99, 0, 0.5)",weight:4,dash:"none"}},aisCogLine:10,iconScale:.9,rangeCircles:!1,rangeCirclesFixed:!1,rangeCirclesDistance:1e3,rangeCircleCount:4,rangeCircleMinZoom:8,aisStaleAge:36e4,aisMaxAge:54e4,aisWindApparent:!1,aisWindMinZoom:15,aisShowTrack:!1,aisTrackLength:12,trailSource:"auto",trailDuration:24,trailResolution:{lastHour:"5s",next23:"1m",beyond24:"5m"}},resources:{fetchFilter:"?position=[%map:longitude%,%map:latitude%]&distance=%fetch:radius%",fetchRadius:0,notes:{rootFilter:"?position=[%map:longitude%,%map:latitude%]&distance=%note:radius%",getRadius:20,groupNameEdit:!1,groupRequiresPosition:!0,minZoom:10},video:{enable:!1,url:null},paths:[]},signalk:{vessels:!0,atons:!0,aircraft:!1,sar:!1,meteo:!0,maxRadius:0,proxied:!0},anchor:{radius:40,setRadius:!1,manualSet:!1,rodeLength:50},radars:{deviceId:void 0,opacity:1},experiments:!1,plotterExtensions:{widgets:[]},selections:{routes:[],waypoints:[],regions:[],tracks:null,charts:["openstreetmap","openseamap"],chartOrder:["openstreetmap","openseamap"],chartOpacity:{},chartImageAdjustment:{},chartDisplayMinZoom:{},chartTimeLoop:{},aisTargets:null,aisTargetTypes:[],aisFilterByShipType:!1,aisState:[],resourceSets:{},infolayers:null,weatherWindEnabled:!1,oceanCurrentsEnabled:!1,tidalCurrentsEnabled:!1}}}function XV(){return{loginRequired:!1,chartBounds:{show:!1,charts:[]},selfId:null,activeRoute:null,activeRouteReversed:!1,activeRouteCircular:!1,activeRouteIsEditing:!1,editingId:null,activeWaypoint:null,serverTrail:!1,server:null,lastGet:null,map:{atClick:{features:[],lonlat:[0,0]}},vessels:{showSelf:!1,self:new Ad,aisTargets:new Map,aisTracks:new Map,activeId:null,active:null,closest:[],prefAvailablePaths:{},flagged:[],showTrack:[]},aircraft:new Map,atons:new Map,sar:new Map,meteo:new Map,racing:{startLine:[]}}}var MC=(n,e)=>{if(!n)return n;let t=n.split("%");return t.length>1&&(n=t.map(r=>r==="map:latitude"?e.map.center[1]:r==="map:longitude"?e.map.center[0]:r==="map:zoom"?Math.floor(e.map.zoomLevel):r==="note:radius"?(e.units.distance==="kilometer"?e.resources.notes.getRadius:Math.floor(Ue.nauticalMilesToKm(e.resources.notes.getRadius)))*1e3:r==="fetch:radius"?(e.units.distance==="kilometer"?e.resources.notes.getRadius:Math.floor(Ue.nauticalMilesToKm(e.resources.fetchRadius)))*1e3:r).join("")),n};var YV="symbols";var QV={id:"freeboard",name:"Freeboard-SK",description:"Signal K Chart Plotter.",version:$V,url:"https://github.com/signalk/freeboard-sk",logo:"./assets/img/app_logo.png"},Cle="1.0.0",Q_={host:"localhost",port:3e3,ssl:!1},oe=class n extends Z1{skApiVersion=2;hostDef={name:void 0,port:void 0,ssl:!1,url:void 0,params:{}};sessionToken;STANDARD_RESOURCES=["routes","waypoints","regions","notes","charts"];CUSTOM_RESOURCES=[{name:"tracks",description:"Freeboard GPX track imports.",featureKey:"resourceTracks"},{name:"infolayers",description:"Freeboard map overlays.",featureKey:"infoLayers",createIfMissing:!1},{name:"groups",description:"Freeboard resource groups.",featureKey:"resourceGroups"}];get IGNORE_RESOURCES(){return this.STANDARD_RESOURCES.concat(this.CUSTOM_RESOURCES.map(e=>e.name),["buddies",$D,YV])}serverConfig={unitPreferences:$(void 0),pathDisplayUnits:$({})};MAP_ZOOM_EXTENT={min:2,max:28};AudioContext=window.AudioContext||window.webkitAudioContext;audio={context:new AudioContext};db;watchingSKLogin;kioskMode=$(!1);hasAuthToken=$(!1);isLoggedIn=$(!1);instrumentPanelAvailable=$(!0);skAuthChange=$(void 0);sIsFetching=$(!1);sTrueMagChoice=$("");instrumentPanel=$({open:!1,activate:!1});uiCtrl=$({alertList:!1,autopilotConsole:!1,radarLayer:!1,routeBuilder:!1,suppressContextMenu:!1,forceNightMode:!1});uiConfig=$({mapNorthUp:!0,mapMove:!1,mapConstrainZoom:!1,toolbarButtons:!1,invertColor:!1,showCourseData:!0,showAisTargets:!0,showNotes:!0,autoNightMode:!1});featureFlags=$({anchorApi:!0,autopilotApi:!1,weatherApi:!1,radarApi:!1,notificationApi:!1,resourceGroups:!1,resourceTracks:!1,infoLayers:!1,buddyList:!1,tidalApi:!1,tracksApi:!1});trackSource=$(null);vesselTrackSelection$=new Oe;selfLines=$({cog:{fill:{color:"rgba(204, 12, 225, 0.7)"},stroke:{color:"rgba(204, 12, 225, 0.7)",width:1,lineDash:null}},heading:{fill:{color:"rgba(221, 99, 0, 0.5)"},stroke:{color:"rgba(221, 99, 0, 0.5)",width:4,lineDash:null}}});selfTrail=$([]);trailStamps=new ty;selfTrailFromServer=$([]);selfTrailTimed=$(null);aisTracksTimed=$(new Map);mapExtent=$([]);mapViewTopCenter=$([0,0]);mapViewRightCenter=$([0,0]);mapViewRotation=$(0);mapZoom=$(0);mapMoveRequest=$(null);signalk=M(Lt);worker=M(Nn);dialog=M(ln);snackbar=M(kD);iconReg=M(A1);dom=M(Ud);s57=M($p);constructor(){super(QV),this.config=zI(),this.data=XV(),this.suppressPersist=!0,this.db=new jI,this.db.dbUpdate$.subscribe(e=>{if(e.action)switch(e.action){case"db_init":e.value&&this.config.vessels.trail&&this.db.getTrail().then(t=>{this.selfTrail.update(()=>t&&t.value?t.value:[])});break;case"trail_save":e.value||this.debug("app.trail.save.error","warn");break}}),this.signalk.setAppId(QV.id),this.signalk.setAppVersion(Cle),this.initAppIcons(),this.parseLaunchUrl(),this.instrumentPanelAvailable.update(()=>this.isTopWindow()),this.isTopWindow()||window.addEventListener("message",e=>{this.parseMessageFromParent(e)}),this.testForInternet(),this.loadConfig(),this.parseLocalConfig(),Me(()=>{this.uiConfig(),this.debug("AppFacade.effect().uiConfig",this.uiConfig()),this.config.ui=this.uiConfig(),this.saveConfigDebounced()}),Me(()=>{this.alignUnitPrefs(this.serverConfig.unitPreferences())})}useInfoPanel(){return!window.matchMedia("(max-width: 760px)").matches&&!this.instrumentPanel().open&&this.config.display.preferInfoPanel}fetchUnitPrefsFromSKServer(){this.signalk.get("/signalk/v1/unitpreferences/active").subscribe({next:e=>{this.serverConfig.unitPreferences.set(e),this.refreshPathDisplayUnits()},error:()=>{this.debug("No server unit preferences...using fallback!")}})}twsDisplayUnitPath(){return this.config.units.preferredPaths.tws??"environment.wind.speedTrue"}displayUnitPaths(){return[this.twsDisplayUnitPath(),"environment.wind.speedApparent"]}refreshPathDisplayUnits(){if(!this.config.units.useServerPrefs){this.serverConfig.pathDisplayUnits.set({});return}this.displayUnitPaths().forEach(e=>this.fetchPathDisplayUnits(e))}fetchPathDisplayUnits(e){let t=e.split(".").join("/");this.signalk.get(`/signalk/v1/api/vessels/self/${t}/meta`).subscribe({next:i=>{this.config.units.useServerPrefs&&i?.displayUnits?.targetUnit?this.setPathDisplayUnits(e,i.displayUnits):this.clearPathDisplayUnits(e)},error:()=>{this.debug(`No display units for path: ${e}`),this.clearPathDisplayUnits(e)}})}parseMessageFromParent(e){if(ls()||e.origin===window.location.origin){this.debug("parseMessageFromParent()",e.origin,e.data);let{settings:t,commands:i}=e.data;if(!t&&!i){this.debug("parseMessageFromParent() - invalid data!");return}typeof t?.autoNightMode=="boolean"&&(this.config.display.nightMode=t.autoNightMode,this.uiConfig.update(r=>Object.assign({},r,{autoNightMode:this.config.display.nightMode}))),typeof i?.nightModeEnable=="boolean"&&this.uiCtrl.update(r=>Object.assign({},r,{forceNightMode:i.nightModeEnable}))}else{this.debug("parseMessageFromParent() - untrusted origin!",e.origin);return}}parseLocalConfig(){GI(this.config,this.hostDef.params),this.s57.init(this.config.map.s57Options),this.doPostConfigLoad()}get lineDashMap(){return new Map([["none","none"],["short","2 2"],["medium","4 4"],["long","8 4"],["alt","8 4 2 4"]])}formatLineDashArray(e){return e==="none"?null:Array.from(this.lineDashMap.get(e)).filter(t=>t!==" ").map(t=>Number(t))}doPostConfigLoad(){this.uiConfig.update(()=>this.config.ui),this.config.vessels.fixedLocationMode&&(this.data.vessels.self.position=[...this.config.vessels.fixedPosition],this.data.vessels.showSelf=!0,this.config.map.center=[...this.config.vessels.fixedPosition]),this.selfLines.update(()=>({cog:{fill:{color:this.config.vessels.selfLines.cog.color},stroke:{color:this.config.vessels.selfLines.cog.color,width:this.config.vessels.selfLines.cog.weight,lineDash:this.formatLineDashArray(this.config.vessels.selfLines.cog.dash)}},heading:{fill:{color:this.config.vessels.selfLines.heading.color},stroke:{color:this.config.vessels.selfLines.heading.color,width:this.config.vessels.selfLines.heading.weight,lineDash:this.formatLineDashArray(this.config.vessels.selfLines.heading.dash)}}})),this.sTrueMagChoice.set(this.config.units.headingAttribute),this.s57.setOptions(this.config.map.s57Options),this.mapZoom.set(this.config.map.zoomLevel),this.debug("doPostConfigLoad(): emit config$.ready"),this.emitConfigEvent("ready"),this.suppressPersist=!1}loadUserConfigfromServer(){return Y(this,null,function*(){return new Promise(e=>{this.signalk.isLoggedIn().subscribe({next:t=>{if(this.isLoggedIn.set(t),t)this.debug("loadUserConfigfromServer(): Is authenticated. Fetching config from SK Server..."),this.signalk.appDataGet("/").subscribe({next:i=>{Object.keys(i).length===0&&e(!1),GI(i,this.hostDef.params),ZV(i)&&(this.config=i,this.doPostConfigLoad(),this.alignCustomResourcesPaths(),this.alignUnitPrefs(this.serverConfig.unitPreferences()),this.saveConfig()),e(!0)},error:()=>{console.info("applicationData: Unable to retrieve settings from server!"),e(!1)}});else return this.debug("loadUserConfigfromServer(): Not authenticated to SK Server!"),e(!1)},error:()=>{this.isLoggedIn.set(!1),this.debug("loadUserConfigfromServer(): Error fetching loginStatus!"),e(!1)}})})})}getPathDisplayUnits(e){return this.serverConfig.pathDisplayUnits()[e]}setPathDisplayUnits(e,t){this.serverConfig.pathDisplayUnits.update(i=>st(ne({},i),{[e]:t}))}clearPathDisplayUnits(e){this.serverConfig.pathDisplayUnits.update(t=>{if(!(e in t))return t;let i=ne({},t);return delete i[e],i})}alignUnitPrefs(e){if(this.config.units.useServerPrefs){if(this.debug("Aligning Unit preferences from server:",e),!e?.categories){this.debug("No Unit preferences available!");return}e.categories.speed&&(this.config.units.speed=["kn","m/s","km/h","mph"].includes(e.categories.speed.targetUnit)?e.categories.speed.targetUnit:this.config.units.speed,Ue.setSymbol(e.categories.speed.targetUnit,e.categories.speed.symbol)),e.categories.temperature&&(this.config.units.temperature=["C","F"].includes(e.categories.temperature.targetUnit)?e.categories.temperature.targetUnit:this.config.units.temperature,Ue.setSymbol(e.categories.temperature.targetUnit,e.categories.temperature.symbol)),e.categories.distance&&(this.config.units.distance=["kilometer","naut-mile"].includes(e.categories.distance.targetUnit)?e.categories.distance.targetUnit:this.config.units.distance,Ue.setSymbol(e.categories.distance.targetUnit,e.categories.distance.symbol)),e.categories.depth&&(this.config.units.depth=["m","foot"].includes(e.categories.depth.targetUnit)?e.categories.depth.targetUnit:this.config.units.depth,Ue.setSymbol(e.categories.depth.targetUnit,e.categories.depth.symbol)),e.categories.length&&(this.config.units.length=["m","foot"].includes(e.categories.length.targetUnit)?e.categories.length.targetUnit:this.config.units.length,Ue.setSymbol(e.categories.length.targetUnit,e.categories.length.symbol))}}initAppIcons(){x5().forEach(e=>{this.iconReg.addSvgIcon(e.id,this.dom.bypassSecurityTrustResourceUrl(e.path))})}parseLaunchUrl(e=window.location){e.search&&e.search.slice(1).split("&").forEach(i=>{let r=i.split("=");this.hostDef.params[r[0]]=r.length>1?r[1]:null}),this.hostDef.name=typeof this.hostDef.params?.host<"u"?this.hostDef.params.host:this.devMode&&Q_.host?Q_.host:e.hostname,this.hostDef.ssl=!!(e.protocol==="https:"||this.devMode&&Q_.ssl),this.hostDef.port=typeof this.hostDef.params.port<"u"?parseInt(this.hostDef.params.port):this.devMode&&Q_.port?Q_.port:parseInt(e.port),this.hostDef.port=isNaN(this.hostDef.port)?this.hostDef.ssl?443:80:this.hostDef.port,this.hostDef.url=`${this.hostDef.ssl?"https:":"http:"}//${this.hostDef.name}:${this.hostDef.port}`,this.kioskMode.update(()=>typeof this.hostDef.params.kiosk<"u"),typeof this.hostDef.params.token<"u"&&this.setAuthToken(this.hostDef.params.token,!1),this.debug("host:",this.hostDef)}testForInternet(){window.fetch("https://tile.openstreetmap.org").then(()=>{console.info("Internet connection detected.")}).catch(()=>{console.warn("No Internet connection detected!");let e=this.config.selections.charts;(e.includes("openstreetmap")||e.includes("openseamap"))&&(this.kioskMode()||this.showAlert("Internet Map Service Unavailable: ",`Unable to display Open Street / Sea Maps!
|
|
752
|
+
`],encapsulation:2,changeDetection:0})}return n})(),_C=(()=>{class n{_ngZone=M(Wi);_document=M(jo);_styleLoader=M(Dr);_renderer=M(jw).createRenderer(null,null);_cleanupDocumentTouchmove;_scroll=new Oe;_dropInstances=new Set;_dragInstances=new Set;_activeDragInstances=$([]);_globalListeners;_draggingPredicate=t=>t.isDragging();_domNodesToDirectives=null;pointerMove=new Oe;pointerUp=new Oe;constructor(){}registerDropContainer(t){this._dropInstances.has(t)||this._dropInstances.add(t)}registerDragItem(t){this._dragInstances.add(t),this._dragInstances.size===1&&this._ngZone.runOutsideAngular(()=>{this._cleanupDocumentTouchmove?.(),this._cleanupDocumentTouchmove=this._renderer.listen(this._document,"touchmove",this._persistentTouchmoveListener,MI)})}removeDropContainer(t){this._dropInstances.delete(t)}removeDragItem(t){this._dragInstances.delete(t),this.stopDragging(t),this._dragInstances.size===0&&this._cleanupDocumentTouchmove?.()}startDragging(t,i){if(!(this._activeDragInstances().indexOf(t)>-1)&&(this._styleLoader.load(Kse),this._activeDragInstances.update(r=>[...r,t]),this._activeDragInstances().length===1)){let r=i.type.startsWith("touch"),o=s=>this.pointerUp.next(s),a=[["scroll",s=>this._scroll.next(s),$_],["selectstart",this._preventDefaultWhileDragging,MI]];r?a.push(["touchend",o,$_],["touchcancel",o,$_]):a.push(["mouseup",o,$_]),r||a.push(["mousemove",s=>this.pointerMove.next(s),MI]),this._ngZone.runOutsideAngular(()=>{this._globalListeners=a.map(([s,l,c])=>this._renderer.listen(this._document,s,l,c))})}}stopDragging(t){this._activeDragInstances.update(i=>{let r=i.indexOf(t);return r>-1?(i.splice(r,1),[...i]):i}),this._activeDragInstances().length===0&&this._clearGlobalListeners()}isDragging(t){return this._activeDragInstances().indexOf(t)>-1}scrolled(t){let i=[this._scroll];return t&&t!==this._document&&i.push(new Ku(r=>this._ngZone.runOutsideAngular(()=>{let o=this._renderer.listen(t,"scroll",a=>{this._activeDragInstances().length&&r.next(a)},$_);return()=>{o()}}))),Er(...i)}registerDirectiveNode(t,i){this._domNodesToDirectives??=new WeakMap,this._domNodesToDirectives.set(t,i)}removeDirectiveNode(t){this._domNodesToDirectives?.delete(t)}getDragDirectiveForNode(t){return this._domNodesToDirectives?.get(t)||null}ngOnDestroy(){this._dragInstances.forEach(t=>this.removeDragItem(t)),this._dropInstances.forEach(t=>this.removeDropContainer(t)),this._domNodesToDirectives=null,this._clearGlobalListeners(),this.pointerMove.complete(),this.pointerUp.complete()}_preventDefaultWhileDragging=t=>{this._activeDragInstances().length>0&&t.preventDefault()};_persistentTouchmoveListener=t=>{this._activeDragInstances().length>0&&(this._activeDragInstances().some(this._draggingPredicate)&&t.preventDefault(),this.pointerMove.next(t))};_clearGlobalListeners(){this._globalListeners?.forEach(t=>t()),this._globalListeners=void 0}static \u0275fac=function(i){return new(i||n)};static \u0275prov=Je({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function fV(n){let e=n.toLowerCase().indexOf("ms")>-1?1:1e3;return parseFloat(n)*e}function qse(n){let e=getComputedStyle(n),t=SI(e,"transition-property"),i=t.find(s=>s==="transform"||s==="all");if(!i)return 0;let r=t.indexOf(i),o=SI(e,"transition-duration"),a=SI(e,"transition-delay");return fV(o[r])+fV(a[r])}function SI(n,e){return n.getPropertyValue(e).split(",").map(i=>i.trim())}var Zse=new Set(["position"]),II=class{_document;_rootElement;_direction;_initialDomRect;_previewTemplate;_previewClass;_pickupPositionOnPage;_initialTransform;_zIndex;_renderer;_previewEmbeddedView=null;_preview;get element(){return this._preview}constructor(e,t,i,r,o,a,s,l,c,d){this._document=e,this._rootElement=t,this._direction=i,this._initialDomRect=r,this._previewTemplate=o,this._previewClass=a,this._pickupPositionOnPage=s,this._initialTransform=l,this._zIndex=c,this._renderer=d}attach(e){this._preview=this._createPreview(),e.appendChild(this._preview),gV(this._preview)&&this._preview.showPopover()}destroy(){this._preview.remove(),this._previewEmbeddedView?.destroy(),this._preview=this._previewEmbeddedView=null}setTransform(e){this._preview.style.transform=e}getBoundingClientRect(){return this._preview.getBoundingClientRect()}addClass(e){this._preview.classList.add(e)}getTransitionDuration(){return qse(this._preview)}addEventListener(e,t){return this._renderer.listen(this._preview,e,t)}_createPreview(){let e=this._previewTemplate,t=this._previewClass,i=e?e.template:null,r;if(i&&e){let o=e.matchSize?this._initialDomRect:null,a=e.viewContainer.createEmbeddedView(i,e.context);a.detectChanges(),r=wV(a,this._document),this._previewEmbeddedView=a,e.matchSize?mV(r,o):r.style.transform=Z_(this._pickupPositionOnPage.x,this._pickupPositionOnPage.y)}else r=TI(this._rootElement),mV(r,this._initialDomRect),this._initialTransform&&(r.style.transform=this._initialTransform);return LI(r.style,{"pointer-events":"none",margin:gV(r)?"0 auto 0 0":"0",position:"fixed",top:"0",left:"0","z-index":this._zIndex+""},Zse),Kf(r,!1),r.classList.add("cdk-drag-preview"),r.setAttribute("popover","manual"),r.setAttribute("dir",this._direction),t&&(Array.isArray(t)?t.forEach(o=>r.classList.add(o)):r.classList.add(t)),r}};function gV(n){return"showPopover"in n}var Xse={passive:!0},_V={passive:!1},Yse={passive:!1,capture:!0},Qse=800,yV="cdk-drag-placeholder",vV=new Set(["position"]);function MV(n,e,t={dragStartThreshold:5,pointerDirectionChangeThreshold:5}){let i=n.get(Pn,null,{optional:!0})||n.get(jw).createRenderer(null,null);return new kI(e,t,n.get(jo),n.get(Wi),n.get(rh),n.get(_C),i)}var kI=class{_config;_document;_ngZone;_viewportRuler;_dragDropRegistry;_renderer;_rootElementCleanups;_cleanupShadowRootSelectStart;_preview=null;_previewContainer;_placeholderRef=null;_placeholder;_pickupPositionInElement;_pickupPositionOnPage;_marker;_anchor=null;_passiveTransform={x:0,y:0};_activeTransform={x:0,y:0};_initialTransform;_hasStartedDragging=$(!1);_hasMoved=!1;_initialContainer;_initialIndex;_parentPositions;_moveEvents=new Oe;_pointerDirectionDelta;_pointerPositionAtLastDirectionChange;_lastKnownPointerPosition;_rootElement;_ownerSVGElement=null;_rootElementTapHighlight;_pointerMoveSubscription=ir.EMPTY;_pointerUpSubscription=ir.EMPTY;_scrollSubscription=ir.EMPTY;_resizeSubscription=ir.EMPTY;_lastTouchEventTime;_dragStartTime;_boundaryElement=null;_nativeInteractionsEnabled=!0;_initialDomRect;_previewRect;_boundaryRect;_previewTemplate;_placeholderTemplate;_handles=[];_disabledHandles=new Set;_dropContainer;_direction="ltr";_parentDragRef=null;_cachedShadowRoot;lockAxis=null;dragStartDelay=0;previewClass;scale=1;get disabled(){return this._disabled||!!(this._dropContainer&&this._dropContainer.disabled)}set disabled(e){e!==this._disabled&&(this._disabled=e,this._toggleNativeDragInteractions(),this._handles.forEach(t=>Kf(t,e)))}_disabled=!1;beforeStarted=new Oe;started=new Oe;released=new Oe;ended=new Oe;entered=new Oe;exited=new Oe;dropped=new Oe;moved=this._moveEvents;data;constrainPosition;constructor(e,t,i,r,o,a,s){this._config=t,this._document=i,this._ngZone=r,this._viewportRuler=o,this._dragDropRegistry=a,this._renderer=s,this.withRootElement(e).withParent(t.parentDragRef||null),this._parentPositions=new hC(i),a.registerDragItem(this)}getPlaceholderElement(){return this._placeholder}getRootElement(){return this._rootElement}getVisibleElement(){return this.isDragging()?this.getPlaceholderElement():this.getRootElement()}withHandles(e){this._handles=e.map(i=>Vc(i)),this._handles.forEach(i=>Kf(i,this.disabled)),this._toggleNativeDragInteractions();let t=new Set;return this._disabledHandles.forEach(i=>{this._handles.indexOf(i)>-1&&t.add(i)}),this._disabledHandles=t,this}withPreviewTemplate(e){return this._previewTemplate=e,this}withPlaceholderTemplate(e){return this._placeholderTemplate=e,this}withRootElement(e){let t=Vc(e);if(t!==this._rootElement){this._removeRootElementListeners();let i=this._renderer;this._rootElementCleanups=this._ngZone.runOutsideAngular(()=>[i.listen(t,"mousedown",this._pointerDown,_V),i.listen(t,"touchstart",this._pointerDown,Xse),i.listen(t,"dragstart",this._nativeDragStart,_V)]),this._initialTransform=void 0,this._rootElement=t}return typeof SVGElement<"u"&&this._rootElement instanceof SVGElement&&(this._ownerSVGElement=this._rootElement.ownerSVGElement),this}withBoundaryElement(e){return this._boundaryElement=e?Vc(e):null,this._resizeSubscription.unsubscribe(),e&&(this._resizeSubscription=this._viewportRuler.change(10).subscribe(()=>this._containInsideBoundaryOnResize())),this}withParent(e){return this._parentDragRef=e,this}dispose(){this._removeRootElementListeners(),this.isDragging()&&this._rootElement?.remove(),this._marker?.remove(),this._destroyPreview(),this._destroyPlaceholder(),this._dragDropRegistry.removeDragItem(this),this._removeListeners(),this.beforeStarted.complete(),this.started.complete(),this.released.complete(),this.ended.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this._moveEvents.complete(),this._handles=[],this._disabledHandles.clear(),this._dropContainer=void 0,this._resizeSubscription.unsubscribe(),this._parentPositions.clear(),this._boundaryElement=this._rootElement=this._ownerSVGElement=this._placeholderTemplate=this._previewTemplate=this._marker=this._parentDragRef=null}isDragging(){return this._hasStartedDragging()&&this._dragDropRegistry.isDragging(this)}reset(){this._rootElement.style.transform=this._initialTransform||"",this._activeTransform={x:0,y:0},this._passiveTransform={x:0,y:0}}resetToBoundary(){if(this._boundaryElement&&this._rootElement&&$se(this._boundaryElement.getBoundingClientRect(),this._rootElement.getBoundingClientRect())){let e=this._boundaryElement.getBoundingClientRect(),t=this._rootElement.getBoundingClientRect(),i=0,r=0;t.left<e.left?i=e.left-t.left:t.right>e.right&&(i=e.right-t.right),t.top<e.top?r=e.top-t.top:t.bottom>e.bottom&&(r=e.bottom-t.bottom);let o=this._activeTransform.x,a=this._activeTransform.y,s=o+i,l=a+r;this._rootElement.style.transform=Z_(s,l),this._activeTransform={x:s,y:l},this._passiveTransform={x:s,y:l}}}disableHandle(e){!this._disabledHandles.has(e)&&this._handles.indexOf(e)>-1&&(this._disabledHandles.add(e),Kf(e,!0))}enableHandle(e){this._disabledHandles.has(e)&&(this._disabledHandles.delete(e),Kf(e,this.disabled))}withDirection(e){return this._direction=e,this}_withDropContainer(e){this._dropContainer=e}getFreeDragPosition(){let e=this.isDragging()?this._activeTransform:this._passiveTransform;return{x:e.x,y:e.y}}setFreeDragPosition(e){return this._activeTransform={x:0,y:0},this._passiveTransform.x=e.x,this._passiveTransform.y=e.y,this._dropContainer||this._applyRootElementTransform(e.x,e.y),this}withPreviewContainer(e){return this._previewContainer=e,this}_sortFromLastPointerPosition(){let e=this._lastKnownPointerPosition;e&&this._dropContainer&&this._updateActiveDropContainer(this._getConstrainedPointerPosition(e),e)}_removeListeners(){this._pointerMoveSubscription.unsubscribe(),this._pointerUpSubscription.unsubscribe(),this._scrollSubscription.unsubscribe(),this._cleanupShadowRootSelectStart?.(),this._cleanupShadowRootSelectStart=void 0}_destroyPreview(){this._preview?.destroy(),this._preview=null}_destroyPlaceholder(){this._anchor?.remove(),this._placeholder?.remove(),this._placeholderRef?.destroy(),this._placeholder=this._anchor=this._placeholderRef=null}_pointerDown=e=>{if(this.beforeStarted.next(),this._handles.length){let t=this._getTargetHandle(e);t&&!this._disabledHandles.has(t)&&!this.disabled&&this._initializeDragSequence(t,e)}else this.disabled||this._initializeDragSequence(this._rootElement,e)};_pointerMove=e=>{let t=this._getPointerPositionOnPage(e);if(!this._hasStartedDragging()){let r=Math.abs(t.x-this._pickupPositionOnPage.x),o=Math.abs(t.y-this._pickupPositionOnPage.y);if(r+o>=this._config.dragStartThreshold){let s=Date.now()>=this._dragStartTime+this._getDragStartDelay(e),l=this._dropContainer;if(!s){this._endDragSequence(e);return}(!l||!l.isDragging()&&!l.isReceiving())&&(e.cancelable&&e.preventDefault(),this._hasStartedDragging.set(!0),this._ngZone.run(()=>this._startDragSequence(e)))}return}e.cancelable&&e.preventDefault();let i=this._getConstrainedPointerPosition(t);if(this._hasMoved=!0,this._lastKnownPointerPosition=t,this._updatePointerDirectionDelta(i),this._dropContainer)this._updateActiveDropContainer(i,t);else{let r=this.constrainPosition?this._initialDomRect:this._pickupPositionOnPage,o=this._activeTransform;o.x=i.x-r.x+this._passiveTransform.x,o.y=i.y-r.y+this._passiveTransform.y,this._applyRootElementTransform(o.x,o.y)}this._moveEvents.observers.length&&this._ngZone.run(()=>{this._moveEvents.next({source:this,pointerPosition:i,event:e,distance:this._getDragDistance(i),delta:this._pointerDirectionDelta})})};_pointerUp=e=>{this._endDragSequence(e)};_endDragSequence(e){if(this._dragDropRegistry.isDragging(this)&&(this._removeListeners(),this._dragDropRegistry.stopDragging(this),this._toggleNativeDragInteractions(),this._handles&&(this._rootElement.style.webkitTapHighlightColor=this._rootElementTapHighlight),!!this._hasStartedDragging()))if(this.released.next({source:this,event:e}),this._dropContainer)this._dropContainer._stopScrolling(),this._animatePreviewToPlaceholder().then(()=>{this._cleanupDragArtifacts(e),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)});else{this._passiveTransform.x=this._activeTransform.x;let t=this._getPointerPositionOnPage(e);this._passiveTransform.y=this._activeTransform.y,this._ngZone.run(()=>{this.ended.next({source:this,distance:this._getDragDistance(t),dropPoint:t,event:e})}),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)}}_startDragSequence(e){K_(e)&&(this._lastTouchEventTime=Date.now()),this._toggleNativeDragInteractions();let t=this._getShadowRoot(),i=this._dropContainer;if(t&&this._ngZone.runOutsideAngular(()=>{this._cleanupShadowRootSelectStart=this._renderer.listen(t,"selectstart",Jse,Yse)}),i){let r=this._rootElement,o=r.parentNode,a=this._placeholder=this._createPlaceholderElement(),s=this._marker=this._marker||this._document.createComment("");o.insertBefore(s,r),this._initialTransform=r.style.transform||"",this._preview=new II(this._document,this._rootElement,this._direction,this._initialDomRect,this._previewTemplate||null,this.previewClass||null,this._pickupPositionOnPage,this._initialTransform,this._config.zIndex||1e3,this._renderer),this._preview.attach(this._getPreviewInsertionPoint(o,t)),hV(r,!1,vV),this._document.body.appendChild(o.replaceChild(a,r)),this.started.next({source:this,event:e}),i.start(),this._initialContainer=i,this._initialIndex=i.getItemIndex(this)}else this.started.next({source:this,event:e}),this._initialContainer=this._initialIndex=void 0;this._parentPositions.cache(i?i.getScrollableParents():[])}_initializeDragSequence(e,t){this._parentDragRef&&t.stopPropagation();let i=this.isDragging(),r=K_(t),o=!r&&t.button!==0,a=this._rootElement,s=xg(t),l=!r&&this._lastTouchEventTime&&this._lastTouchEventTime+Qse>Date.now(),c=r?k1(t):I1(t);if(s&&s.draggable&&t.type==="mousedown"&&t.preventDefault(),i||o||l||c)return;if(this._handles.length){let m=a.style;this._rootElementTapHighlight=m.webkitTapHighlightColor||"",m.webkitTapHighlightColor="transparent"}this._hasMoved=!1,this._hasStartedDragging.set(this._hasMoved),this._removeListeners(),this._initialDomRect=this._rootElement.getBoundingClientRect(),this._pointerMoveSubscription=this._dragDropRegistry.pointerMove.subscribe(this._pointerMove),this._pointerUpSubscription=this._dragDropRegistry.pointerUp.subscribe(this._pointerUp),this._scrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(m=>this._updateOnScroll(m)),this._boundaryElement&&(this._boundaryRect=AI(this._boundaryElement));let d=this._previewTemplate;this._pickupPositionInElement=d&&d.template&&!d.matchSize?{x:0,y:0}:this._getPointerPositionInElement(this._initialDomRect,e,t);let p=this._pickupPositionOnPage=this._lastKnownPointerPosition=this._getPointerPositionOnPage(t);this._pointerDirectionDelta={x:0,y:0},this._pointerPositionAtLastDirectionChange={x:p.x,y:p.y},this._dragStartTime=Date.now(),this._dragDropRegistry.startDragging(this,t)}_cleanupDragArtifacts(e){hV(this._rootElement,!0,vV),this._marker.parentNode.replaceChild(this._rootElement,this._marker),this._destroyPreview(),this._destroyPlaceholder(),this._initialDomRect=this._boundaryRect=this._previewRect=this._initialTransform=void 0,this._ngZone.run(()=>{let t=this._dropContainer,i=t.getItemIndex(this),r=this._getPointerPositionOnPage(e),o=this._getDragDistance(r),a=t._isOverContainer(r.x,r.y);this.ended.next({source:this,distance:o,dropPoint:r,event:e}),this.dropped.next({item:this,currentIndex:i,previousIndex:this._initialIndex,container:t,previousContainer:this._initialContainer,isPointerOverContainer:a,distance:o,dropPoint:r,event:e}),t.drop(this,i,this._initialIndex,this._initialContainer,a,o,r,e),this._dropContainer=this._initialContainer})}_updateActiveDropContainer({x:e,y:t},{x:i,y:r}){let o=this._initialContainer._getSiblingContainerFromPosition(this,e,t);!o&&this._dropContainer!==this._initialContainer&&this._initialContainer._isOverContainer(e,t)&&(o=this._initialContainer),o&&o!==this._dropContainer&&this._ngZone.run(()=>{let a=this._dropContainer.getItemIndex(this),s=this._dropContainer.getItemAtIndex(a+1)?.getVisibleElement()||null;this.exited.next({item:this,container:this._dropContainer}),this._dropContainer.exit(this),this._conditionallyInsertAnchor(o,this._dropContainer,s),this._dropContainer=o,this._dropContainer.enter(this,e,t,o===this._initialContainer&&o.sortingDisabled?this._initialIndex:void 0),this.entered.next({item:this,container:o,currentIndex:o.getItemIndex(this)})}),this.isDragging()&&(this._dropContainer._startScrollingIfNecessary(i,r),this._dropContainer._sortItem(this,e,t,this._pointerDirectionDelta),this.constrainPosition?this._applyPreviewTransform(e,t):this._applyPreviewTransform(e-this._pickupPositionInElement.x,t-this._pickupPositionInElement.y))}_animatePreviewToPlaceholder(){if(!this._hasMoved)return Promise.resolve();let e=this._placeholder.getBoundingClientRect();this._preview.addClass("cdk-drag-animating"),this._applyPreviewTransform(e.left,e.top);let t=this._preview.getTransitionDuration();return t===0?Promise.resolve():this._ngZone.runOutsideAngular(()=>new Promise(i=>{let r=s=>{(!s||this._preview&&xg(s)===this._preview.element&&s.propertyName==="transform")&&(a(),i(),clearTimeout(o))},o=setTimeout(r,t*1.5),a=this._preview.addEventListener("transitionend",r)}))}_createPlaceholderElement(){let e=this._placeholderTemplate,t=e?e.template:null,i;return t?(this._placeholderRef=e.viewContainer.createEmbeddedView(t,e.context),this._placeholderRef.detectChanges(),i=wV(this._placeholderRef,this._document)):i=TI(this._rootElement),i.style.pointerEvents="none",i.classList.add(yV),i}_getPointerPositionInElement(e,t,i){let r=t===this._rootElement?null:t,o=r?r.getBoundingClientRect():e,a=K_(i)?i.targetTouches[0]:i,s=this._getViewportScrollPosition(),l=a.pageX-o.left-s.left,c=a.pageY-o.top-s.top;return{x:o.left-e.left+l,y:o.top-e.top+c}}_getPointerPositionOnPage(e){let t=this._getViewportScrollPosition(),i=K_(e)?e.touches[0]||e.changedTouches[0]||{pageX:0,pageY:0}:e,r=i.pageX-t.left,o=i.pageY-t.top;if(this._ownerSVGElement){let a=this._ownerSVGElement.getScreenCTM();if(a){let s=this._ownerSVGElement.createSVGPoint();return s.x=r,s.y=o,s.matrixTransform(a.inverse())}}return{x:r,y:o}}_getConstrainedPointerPosition(e){let t=this._dropContainer?this._dropContainer.lockAxis:null,{x:i,y:r}=this.constrainPosition?this.constrainPosition(e,this,this._initialDomRect,this._pickupPositionInElement):e;if(this.lockAxis==="x"||t==="x"?r=this._pickupPositionOnPage.y-(this.constrainPosition?this._pickupPositionInElement.y:0):(this.lockAxis==="y"||t==="y")&&(i=this._pickupPositionOnPage.x-(this.constrainPosition?this._pickupPositionInElement.x:0)),this._boundaryRect){let{x:o,y:a}=this.constrainPosition?{x:0,y:0}:this._pickupPositionInElement,s=this._boundaryRect,{width:l,height:c}=this._getPreviewRect(),d=s.top+a,p=s.bottom-(c-a),m=s.left+o,g=s.right-(l-o);i=bV(i,m,g),r=bV(r,d,p)}return{x:i,y:r}}_updatePointerDirectionDelta(e){let{x:t,y:i}=e,r=this._pointerDirectionDelta,o=this._pointerPositionAtLastDirectionChange,a=Math.abs(t-o.x),s=Math.abs(i-o.y);return a>this._config.pointerDirectionChangeThreshold&&(r.x=t>o.x?1:-1,o.x=t),s>this._config.pointerDirectionChangeThreshold&&(r.y=i>o.y?1:-1,o.y=i),r}_toggleNativeDragInteractions(){if(!this._rootElement||!this._handles)return;let e=this._handles.length>0||!this.isDragging();e!==this._nativeInteractionsEnabled&&(this._nativeInteractionsEnabled=e,Kf(this._rootElement,e))}_removeRootElementListeners(){this._rootElementCleanups?.forEach(e=>e()),this._rootElementCleanups=void 0}_applyRootElementTransform(e,t){let i=1/this.scale,r=Z_(e*i,t*i),o=this._rootElement.style;this._initialTransform==null&&(this._initialTransform=o.transform&&o.transform!="none"?o.transform:""),o.transform=mC(r,this._initialTransform)}_applyPreviewTransform(e,t){let i=this._previewTemplate?.template?void 0:this._initialTransform,r=Z_(e,t);this._preview.setTransform(mC(r,i))}_getDragDistance(e){let t=this._pickupPositionOnPage;return t?{x:e.x-t.x,y:e.y-t.y}:{x:0,y:0}}_cleanupCachedDimensions(){this._boundaryRect=this._previewRect=void 0,this._parentPositions.clear()}_containInsideBoundaryOnResize(){let{x:e,y:t}=this._passiveTransform;if(e===0&&t===0||this.isDragging()||!this._boundaryElement)return;let i=this._rootElement.getBoundingClientRect(),r=this._boundaryElement.getBoundingClientRect();if(r.width===0&&r.height===0||i.width===0&&i.height===0)return;let o=r.left-i.left,a=i.right-r.right,s=r.top-i.top,l=i.bottom-r.bottom;r.width>i.width?(o>0&&(e+=o),a>0&&(e-=a)):e=0,r.height>i.height?(s>0&&(t+=s),l>0&&(t-=l)):t=0,(e!==this._passiveTransform.x||t!==this._passiveTransform.y)&&this.setFreeDragPosition({y:t,x:e})}_getDragStartDelay(e){let t=this.dragStartDelay;return typeof t=="number"?t:K_(e)?t.touch:t?t.mouse:0}_updateOnScroll(e){let t=this._parentPositions.handleScroll(e);if(t){let i=xg(e);this._boundaryRect&&i!==this._boundaryElement&&i.contains(this._boundaryElement)&&q_(this._boundaryRect,t.top,t.left),this._pickupPositionOnPage.x+=t.left,this._pickupPositionOnPage.y+=t.top,this._dropContainer||(this._activeTransform.x-=t.left,this._activeTransform.y-=t.top,this._applyRootElementTransform(this._activeTransform.x,this._activeTransform.y))}}_getViewportScrollPosition(){return this._parentPositions.positions.get(this._document)?.scrollPosition||this._parentPositions.getViewportScrollPosition()}_getShadowRoot(){return this._cachedShadowRoot===void 0&&(this._cachedShadowRoot=T1(this._rootElement)),this._cachedShadowRoot}_getPreviewInsertionPoint(e,t){let i=this._previewContainer||"global";if(i==="parent")return e;if(i==="global"){let r=this._document;return t||r.fullscreenElement||r.webkitFullscreenElement||r.mozFullScreenElement||r.msFullscreenElement||r.body}return Vc(i)}_getPreviewRect(){return(!this._previewRect||!this._previewRect.width&&!this._previewRect.height)&&(this._previewRect=this._preview?this._preview.getBoundingClientRect():this._initialDomRect),this._previewRect}_nativeDragStart=e=>{if(this._handles.length){let t=this._getTargetHandle(e);t&&!this._disabledHandles.has(t)&&!this.disabled&&e.preventDefault()}else this.disabled||e.preventDefault()};_getTargetHandle(e){return this._handles.find(t=>e.target&&(e.target===t||t.contains(e.target)))}_conditionallyInsertAnchor(e,t,i){if(e===this._initialContainer)this._anchor?.remove(),this._anchor=null;else if(t===this._initialContainer&&t.hasAnchor){let r=this._anchor??=TI(this._placeholder);r.classList.remove(yV),r.classList.add("cdk-drag-anchor"),r.style.transform="",i?i.before(r):Vc(t.element).appendChild(r)}}};function bV(n,e,t){return Math.max(e,Math.min(t,n))}function K_(n){return n.type[0]==="t"}function Jse(n){n.preventDefault()}function cl(n,e,t){let i=DI(e,n.length-1),r=DI(t,n.length-1);if(i===r)return;let o=n[i],a=r<i?-1:1;for(let s=i;s!==r;s+=a)n[s]=n[s+a];n[r]=o}function SV(n,e,t,i){let r=DI(i,e.length);n.length&&e.splice(r,0,n[t])}function DI(n,e){return Math.max(0,Math.min(e,n))}var fC=class{_dragDropRegistry;_element;_sortPredicate;_itemPositions=[];_activeDraggables;orientation="vertical";direction="ltr";constructor(e){this._dragDropRegistry=e}_previousSwap={drag:null,delta:0,overlaps:!1};start(e){this.withItems(e)}sort(e,t,i,r){let o=this._itemPositions,a=this._getItemIndexFromPointerPosition(e,t,i,r);if(a===-1&&o.length>0)return null;let s=this.orientation==="horizontal",l=o.findIndex(S=>S.drag===e),c=o[a],d=o[l].clientRect,p=c.clientRect,m=l>a?1:-1,g=this._getItemOffsetPx(d,p,m),y=this._getSiblingOffsetPx(l,o,m),b=o.slice();return cl(o,l,a),o.forEach((S,E)=>{if(b[E]===S)return;let k=S.drag===e,I=k?g:y,C=k?e.getPlaceholderElement():S.drag.getRootElement();S.offset+=I;let x=Math.round(S.offset*(1/S.drag.scale));s?(C.style.transform=mC(`translate3d(${x}px, 0, 0)`,S.initialTransform),q_(S.clientRect,0,I)):(C.style.transform=mC(`translate3d(0, ${x}px, 0)`,S.initialTransform),q_(S.clientRect,I,0))}),this._previousSwap.overlaps=EI(p,t,i),this._previousSwap.drag=c.drag,this._previousSwap.delta=s?r.x:r.y,{previousIndex:l,currentIndex:a}}enter(e,t,i,r){let o=this._activeDraggables,a=o.indexOf(e),s=e.getPlaceholderElement();a>-1&&o.splice(a,1);let l=r==null||r<0?this._getItemIndexFromPointerPosition(e,t,i):r,c=o[l];if(c===e&&(c=o[l+1]),!c&&(l==null||l===-1||l<o.length-1)&&this._shouldEnterAsFirstChild(t,i)&&(c=o[0]),c&&!this._dragDropRegistry.isDragging(c)){let d=c.getRootElement();d.parentElement.insertBefore(s,d),o.splice(l,0,e)}else this._element.appendChild(s),o.push(e);s.style.transform="",this._cacheItemPositions()}withItems(e){this._activeDraggables=e.slice(),this._cacheItemPositions()}withSortPredicate(e){this._sortPredicate=e}reset(){this._activeDraggables?.forEach(e=>{let t=e.getRootElement();if(t){let i=this._itemPositions.find(r=>r.drag===e)?.initialTransform;t.style.transform=i||""}}),this._itemPositions=[],this._activeDraggables=[],this._previousSwap.drag=null,this._previousSwap.delta=0,this._previousSwap.overlaps=!1}getActiveItemsSnapshot(){return this._activeDraggables}getItemIndex(e){return this._getVisualItemPositions().findIndex(t=>t.drag===e)}getItemAtIndex(e){return this._getVisualItemPositions()[e]?.drag||null}updateOnScroll(e,t){this._itemPositions.forEach(({clientRect:i})=>{q_(i,e,t)}),this._itemPositions.forEach(({drag:i})=>{this._dragDropRegistry.isDragging(i)&&i._sortFromLastPointerPosition()})}withElementContainer(e){this._element=e}_cacheItemPositions(){let e=this.orientation==="horizontal";this._itemPositions=this._activeDraggables.map(t=>{let i=t.getVisibleElement();return{drag:t,offset:0,initialTransform:i.style.transform||"",clientRect:AI(i)}}).sort((t,i)=>e?t.clientRect.left-i.clientRect.left:t.clientRect.top-i.clientRect.top)}_getVisualItemPositions(){return this.orientation==="horizontal"&&this.direction==="rtl"?this._itemPositions.slice().reverse():this._itemPositions}_getItemOffsetPx(e,t,i){let r=this.orientation==="horizontal",o=r?t.left-e.left:t.top-e.top;return i===-1&&(o+=r?t.width-e.width:t.height-e.height),o}_getSiblingOffsetPx(e,t,i){let r=this.orientation==="horizontal",o=t[e].clientRect,a=t[e+i*-1],s=o[r?"width":"height"]*i;if(a){let l=r?"left":"top",c=r?"right":"bottom";i===-1?s-=a.clientRect[l]-o[c]:s+=o[l]-a.clientRect[c]}return s}_shouldEnterAsFirstChild(e,t){if(!this._activeDraggables.length)return!1;let i=this._itemPositions,r=this.orientation==="horizontal";if(i[0].drag!==this._activeDraggables[0]){let a=i[i.length-1].clientRect;return r?e>=a.right:t>=a.bottom}else{let a=i[0].clientRect;return r?e<=a.left:t<=a.top}}_getItemIndexFromPointerPosition(e,t,i,r){let o=this.orientation==="horizontal",a=this._itemPositions.findIndex(({drag:s,clientRect:l})=>{if(s===e)return!1;if(r){let c=o?r.x:r.y;if(s===this._previousSwap.drag&&this._previousSwap.overlaps&&c===this._previousSwap.delta)return!1}return o?t>=Math.floor(l.left)&&t<Math.floor(l.right):i>=Math.floor(l.top)&&i<Math.floor(l.bottom)});return a===-1||!this._sortPredicate(a,e)?-1:a}},PI=class{_document;_dragDropRegistry;_element;_sortPredicate;_rootNode;_activeItems;_previousSwap={drag:null,deltaX:0,deltaY:0,overlaps:!1};_relatedNodes=[];constructor(e,t){this._document=e,this._dragDropRegistry=t}start(e){let t=this._element.childNodes;this._relatedNodes=[];for(let i=0;i<t.length;i++){let r=t[i];this._relatedNodes.push([r,r.nextSibling])}this.withItems(e)}sort(e,t,i,r){let o=this._getItemIndexFromPointerPosition(e,t,i),a=this._previousSwap;if(o===-1||this._activeItems[o]===e)return null;let s=this._activeItems[o];if(a.drag===s&&a.overlaps&&a.deltaX===r.x&&a.deltaY===r.y)return null;let l=this.getItemIndex(e),c=e.getPlaceholderElement(),d=s.getRootElement();o>l?d.after(c):d.before(c),cl(this._activeItems,l,o);let p=this._getRootNode().elementFromPoint(t,i);return a.deltaX=r.x,a.deltaY=r.y,a.drag=s,a.overlaps=d===p||d.contains(p),{previousIndex:l,currentIndex:o}}enter(e,t,i,r){let o=this._activeItems.indexOf(e);o>-1&&this._activeItems.splice(o,1);let a=r==null||r<0?this._getItemIndexFromPointerPosition(e,t,i):r;a===-1&&(a=this._getClosestItemIndexToPointer(e,t,i));let s=this._activeItems[a];s&&!this._dragDropRegistry.isDragging(s)?(this._activeItems.splice(a,0,e),s.getRootElement().before(e.getPlaceholderElement())):(this._activeItems.push(e),this._element.appendChild(e.getPlaceholderElement()))}withItems(e){this._activeItems=e.slice()}withSortPredicate(e){this._sortPredicate=e}reset(){let e=this._element,t=this._previousSwap;for(let i=this._relatedNodes.length-1;i>-1;i--){let[r,o]=this._relatedNodes[i];r.parentNode===e&&r.nextSibling!==o&&(o===null?e.appendChild(r):o.parentNode===e&&e.insertBefore(r,o))}this._relatedNodes=[],this._activeItems=[],t.drag=null,t.deltaX=t.deltaY=0,t.overlaps=!1}getActiveItemsSnapshot(){return this._activeItems}getItemIndex(e){return this._activeItems.indexOf(e)}getItemAtIndex(e){return this._activeItems[e]||null}updateOnScroll(){this._activeItems.forEach(e=>{this._dragDropRegistry.isDragging(e)&&e._sortFromLastPointerPosition()})}withElementContainer(e){e!==this._element&&(this._element=e,this._rootNode=void 0)}_getItemIndexFromPointerPosition(e,t,i){let r=this._getRootNode().elementFromPoint(Math.floor(t),Math.floor(i)),o=r?this._activeItems.findIndex(a=>{let s=a.getRootElement();return r===s||s.contains(r)}):-1;return o===-1||!this._sortPredicate(o,e)?-1:o}_getRootNode(){return this._rootNode||(this._rootNode=T1(this._element)||this._document),this._rootNode}_getClosestItemIndexToPointer(e,t,i){if(this._activeItems.length===0)return-1;if(this._activeItems.length===1)return 0;let r=1/0,o=-1;for(let a=0;a<this._activeItems.length;a++){let s=this._activeItems[a];if(s!==e){let{x:l,y:c}=s.getRootElement().getBoundingClientRect(),d=Math.hypot(t-l,i-c);d<r&&(r=d,o=a)}}return o}},xV=.05,TV=.05,ll=(function(n){return n[n.NONE=0]="NONE",n[n.UP=1]="UP",n[n.DOWN=2]="DOWN",n})(ll||{}),Ca=(function(n){return n[n.NONE=0]="NONE",n[n.LEFT=1]="LEFT",n[n.RIGHT=2]="RIGHT",n})(Ca||{});function EV(n,e){return new RI(e,n.get(_C),n.get(jo),n.get(Wi),n.get(rh))}var RI=class{_dragDropRegistry;_ngZone;_viewportRuler;element;disabled=!1;sortingDisabled=!1;lockAxis=null;autoScrollDisabled=!1;autoScrollStep=2;hasAnchor=!1;enterPredicate=()=>!0;sortPredicate=()=>!0;beforeStarted=new Oe;entered=new Oe;exited=new Oe;dropped=new Oe;sorted=new Oe;receivingStarted=new Oe;receivingStopped=new Oe;data;_container;_isDragging=!1;_parentPositions;_sortStrategy;_domRect;_draggables=[];_siblings=[];_activeSiblings=new Set;_viewportScrollSubscription=ir.EMPTY;_verticalScrollDirection=ll.NONE;_horizontalScrollDirection=Ca.NONE;_scrollNode;_stopScrollTimers=new Oe;_cachedShadowRoot=null;_document;_scrollableElements=[];_initialScrollSnap;_direction="ltr";constructor(e,t,i,r,o){this._dragDropRegistry=t,this._ngZone=r,this._viewportRuler=o;let a=this.element=Vc(e);this._document=i,this.withOrientation("vertical").withElementContainer(a),t.registerDropContainer(this),this._parentPositions=new hC(i)}dispose(){this._stopScrolling(),this._stopScrollTimers.complete(),this._viewportScrollSubscription.unsubscribe(),this.beforeStarted.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this.sorted.complete(),this.receivingStarted.complete(),this.receivingStopped.complete(),this._activeSiblings.clear(),this._scrollNode=null,this._parentPositions.clear(),this._dragDropRegistry.removeDropContainer(this)}isDragging(){return this._isDragging}start(){this._draggingStarted(),this._notifyReceivingSiblings()}enter(e,t,i,r){this._draggingStarted(),r==null&&this.sortingDisabled&&(r=this._draggables.indexOf(e)),this._sortStrategy.enter(e,t,i,r),this._cacheParentPositions(),this._notifyReceivingSiblings(),this.entered.next({item:e,container:this,currentIndex:this.getItemIndex(e)})}exit(e){this._reset(),this.exited.next({item:e,container:this})}drop(e,t,i,r,o,a,s,l={}){this._reset(),this.dropped.next({item:e,currentIndex:t,previousIndex:i,container:this,previousContainer:r,isPointerOverContainer:o,distance:a,dropPoint:s,event:l})}withItems(e){let t=this._draggables;return this._draggables=e,e.forEach(i=>i._withDropContainer(this)),this.isDragging()&&(t.filter(r=>r.isDragging()).every(r=>e.indexOf(r)===-1)?this._reset():this._sortStrategy.withItems(this._draggables)),this}withDirection(e){return this._direction=e,this._sortStrategy instanceof fC&&(this._sortStrategy.direction=e),this}connectedTo(e){return this._siblings=e.slice(),this}withOrientation(e){if(e==="mixed")this._sortStrategy=new PI(this._document,this._dragDropRegistry);else{let t=new fC(this._dragDropRegistry);t.direction=this._direction,t.orientation=e,this._sortStrategy=t}return this._sortStrategy.withElementContainer(this._container),this._sortStrategy.withSortPredicate((t,i)=>this.sortPredicate(t,i,this)),this}withScrollableParents(e){let t=this._container;return this._scrollableElements=e.indexOf(t)===-1?[t,...e]:e.slice(),this}withElementContainer(e){if(e===this._container)return this;let t=Vc(this.element),i=this._scrollableElements.indexOf(this._container),r=this._scrollableElements.indexOf(e);return i>-1&&this._scrollableElements.splice(i,1),r>-1&&this._scrollableElements.splice(r,1),this._sortStrategy&&this._sortStrategy.withElementContainer(e),this._cachedShadowRoot=null,this._scrollableElements.unshift(e),this._container=e,this}getScrollableParents(){return this._scrollableElements}getItemIndex(e){return this._isDragging?this._sortStrategy.getItemIndex(e):this._draggables.indexOf(e)}getItemAtIndex(e){return this._isDragging?this._sortStrategy.getItemAtIndex(e):this._draggables[e]||null}isReceiving(){return this._activeSiblings.size>0}_sortItem(e,t,i,r){if(this.sortingDisabled||!this._domRect||!pV(this._domRect,xV,t,i))return;let o=this._sortStrategy.sort(e,t,i,r);o&&this.sorted.next({previousIndex:o.previousIndex,currentIndex:o.currentIndex,container:this,item:e})}_startScrollingIfNecessary(e,t){if(this.autoScrollDisabled)return;let i,r=ll.NONE,o=Ca.NONE;if(this._parentPositions.positions.forEach((a,s)=>{s===this._document||!a.clientRect||i||pV(a.clientRect,xV,e,t)&&([r,o]=ele(s,a.clientRect,this._direction,e,t),(r||o)&&(i=s))}),!r&&!o){let{width:a,height:s}=this._viewportRuler.getViewportSize(),l={width:a,height:s,top:0,right:a,bottom:s,left:0};r=IV(l,t),o=kV(l,e),i=window}i&&(r!==this._verticalScrollDirection||o!==this._horizontalScrollDirection||i!==this._scrollNode)&&(this._verticalScrollDirection=r,this._horizontalScrollDirection=o,this._scrollNode=i,(r||o)&&i?this._ngZone.runOutsideAngular(this._startScrollInterval):this._stopScrolling())}_stopScrolling(){this._stopScrollTimers.next()}_draggingStarted(){let e=this._container.style;this.beforeStarted.next(),this._isDragging=!0,this._initialScrollSnap=e.msScrollSnapType||e.scrollSnapType||"",e.scrollSnapType=e.msScrollSnapType="none",this._sortStrategy.start(this._draggables),this._cacheParentPositions(),this._viewportScrollSubscription.unsubscribe(),this._listenToScrollEvents()}_cacheParentPositions(){this._parentPositions.cache(this._scrollableElements),this._domRect=this._parentPositions.positions.get(this._container).clientRect}_reset(){this._isDragging=!1;let e=this._container.style;e.scrollSnapType=e.msScrollSnapType=this._initialScrollSnap,this._siblings.forEach(t=>t._stopReceiving(this)),this._sortStrategy.reset(),this._stopScrolling(),this._viewportScrollSubscription.unsubscribe(),this._parentPositions.clear()}_startScrollInterval=()=>{this._stopScrolling(),$k(0,jk).pipe(xi(this._stopScrollTimers)).subscribe(()=>{let e=this._scrollNode,t=this.autoScrollStep;this._verticalScrollDirection===ll.UP?e.scrollBy(0,-t):this._verticalScrollDirection===ll.DOWN&&e.scrollBy(0,t),this._horizontalScrollDirection===Ca.LEFT?e.scrollBy(-t,0):this._horizontalScrollDirection===Ca.RIGHT&&e.scrollBy(t,0)})};_isOverContainer(e,t){return this._domRect!=null&&EI(this._domRect,e,t)}_getSiblingContainerFromPosition(e,t,i){return this._siblings.find(r=>r._canReceive(e,t,i))}_canReceive(e,t,i){if(!this._domRect||!EI(this._domRect,t,i)||!this.enterPredicate(e,this))return!1;let r=this._getShadowRoot().elementFromPoint(t,i);return r?r===this._container||this._container.contains(r):!1}_startReceiving(e,t){let i=this._activeSiblings;!i.has(e)&&t.every(r=>this.enterPredicate(r,this)||this._draggables.indexOf(r)>-1)&&(i.add(e),this._cacheParentPositions(),this._listenToScrollEvents(),this.receivingStarted.next({initiator:e,receiver:this,items:t}))}_stopReceiving(e){this._activeSiblings.delete(e),this._viewportScrollSubscription.unsubscribe(),this.receivingStopped.next({initiator:e,receiver:this})}_listenToScrollEvents(){this._viewportScrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(e=>{if(this.isDragging()){let t=this._parentPositions.handleScroll(e);t&&this._sortStrategy.updateOnScroll(t.top,t.left)}else this.isReceiving()&&this._cacheParentPositions()})}_getShadowRoot(){if(!this._cachedShadowRoot){let e=T1(this._container);this._cachedShadowRoot=e||this._document}return this._cachedShadowRoot}_notifyReceivingSiblings(){let e=this._sortStrategy.getActiveItemsSnapshot().filter(t=>t.isDragging());this._siblings.forEach(t=>t._startReceiving(this,e))}};function IV(n,e){let{top:t,bottom:i,height:r}=n,o=r*TV;return e>=t-o&&e<=t+o?ll.UP:e>=i-o&&e<=i+o?ll.DOWN:ll.NONE}function kV(n,e){let{left:t,right:i,width:r}=n,o=r*TV;return e>=t-o&&e<=t+o?Ca.LEFT:e>=i-o&&e<=i+o?Ca.RIGHT:Ca.NONE}function ele(n,e,t,i,r){let o=IV(e,r),a=kV(e,i),s=ll.NONE,l=Ca.NONE;if(o){let c=n.scrollTop;o===ll.UP?c>0&&(s=ll.UP):n.scrollHeight-c>n.clientHeight&&(s=ll.DOWN)}if(a){let c=n.scrollLeft;t==="rtl"?a===Ca.RIGHT?c<0&&(l=Ca.RIGHT):n.scrollWidth+c>n.clientWidth&&(l=Ca.LEFT):a===Ca.LEFT?c>0&&(l=Ca.LEFT):n.scrollWidth-c>n.clientWidth&&(l=Ca.RIGHT)}return[s,l]}var tle=(()=>{class n{_injector=M(Zr);constructor(){}createDrag(t,i){return MV(this._injector,t,i)}createDropList(t){return EV(this._injector,t)}static \u0275fac=function(i){return new(i||n)};static \u0275prov=Je({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),gC=new Ct("CDK_DRAG_PARENT");var DV=new Ct("CdkDragHandle"),dl=(()=>{class n{element=M(ft);_parentDrag=M(gC,{optional:!0,skipSelf:!0});_dragDropRegistry=M(_C);_stateChanges=new Oe;get disabled(){return this._disabled}set disabled(t){this._disabled=t,this._stateChanges.next(this)}_disabled=!1;constructor(){this._parentDrag?._addHandle(this)}ngAfterViewInit(){if(!this._parentDrag){let t=this.element.nativeElement.parentElement;for(;t;){let i=this._dragDropRegistry.getDragDirectiveForNode(t);if(i){this._parentDrag=i,i._addHandle(this);break}t=t.parentElement}}}ngOnDestroy(){this._parentDrag?._removeHandle(this),this._stateChanges.complete()}static \u0275fac=function(i){return new(i||n)};static \u0275dir=pt({type:n,selectors:[["","cdkDragHandle",""]],hostAttrs:[1,"cdk-drag-handle"],inputs:{disabled:[2,"cdkDragHandleDisabled","disabled",He]},features:[Ft([{provide:DV,useExisting:n}])]})}return n})(),PV=new Ct("CDK_DRAG_CONFIG"),RV=new Ct("CdkDropList"),So=(()=>{class n{element=M(ft);dropContainer=M(RV,{optional:!0,skipSelf:!0});_ngZone=M(Wi);_viewContainerRef=M(ua);_dir=M(uo,{optional:!0});_changeDetectorRef=M(ae);_selfHandle=M(DV,{optional:!0,self:!0});_parentDrag=M(gC,{optional:!0,skipSelf:!0});_dragDropRegistry=M(_C);_destroyed=new Oe;_handles=new fl([]);_previewTemplate=null;_placeholderTemplate=null;_dragRef;data;lockAxis=null;rootElementSelector;boundaryElement;dragStartDelay;freeDragPosition;get disabled(){return this._disabled||!!(this.dropContainer&&this.dropContainer.disabled)}set disabled(t){this._disabled=t,this._dragRef.disabled=this._disabled}_disabled=!1;constrainPosition;previewClass;previewContainer;scale=1;started=new me;released=new me;ended=new me;entered=new me;exited=new me;dropped=new me;moved=new Ku(t=>{let i=this._dragRef.moved.pipe(Fr(r=>({source:this,pointerPosition:r.pointerPosition,event:r.event,delta:r.delta,distance:r.distance}))).subscribe(t);return()=>{i.unsubscribe()}});_injector=M(Zr);constructor(){let t=this.dropContainer,i=M(PV,{optional:!0});this._dragRef=MV(this._injector,this.element,{dragStartThreshold:i&&i.dragStartThreshold!=null?i.dragStartThreshold:5,pointerDirectionChangeThreshold:i&&i.pointerDirectionChangeThreshold!=null?i.pointerDirectionChangeThreshold:5,zIndex:i?.zIndex}),this._dragRef.data=this,this._dragDropRegistry.registerDirectiveNode(this.element.nativeElement,this),i&&this._assignDefaults(i),t&&(t.addItem(this),t._dropListRef.beforeStarted.pipe(xi(this._destroyed)).subscribe(()=>{this._dragRef.scale=this.scale})),this._syncInputs(this._dragRef),this._handleEvents(this._dragRef)}getPlaceholderElement(){return this._dragRef.getPlaceholderElement()}getRootElement(){return this._dragRef.getRootElement()}reset(){this._dragRef.reset()}resetToBoundary(){this._dragRef.resetToBoundary()}getFreeDragPosition(){return this._dragRef.getFreeDragPosition()}setFreeDragPosition(t){this._dragRef.setFreeDragPosition(t)}ngAfterViewInit(){ss(()=>{this._updateRootElement(),this._setupHandlesListener(),this._dragRef.scale=this.scale,this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition)},{injector:this._injector})}ngOnChanges(t){let i=t.rootElementSelector,r=t.freeDragPosition;i&&!i.firstChange&&this._updateRootElement(),this._dragRef.scale=this.scale,r&&!r.firstChange&&this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition)}ngOnDestroy(){this.dropContainer&&this.dropContainer.removeItem(this),this._dragDropRegistry.removeDirectiveNode(this.element.nativeElement),this._ngZone.runOutsideAngular(()=>{this._handles.complete(),this._destroyed.next(),this._destroyed.complete(),this._dragRef.dispose()})}_addHandle(t){let i=this._handles.getValue();i.push(t),this._handles.next(i)}_removeHandle(t){let i=this._handles.getValue(),r=i.indexOf(t);r>-1&&(i.splice(r,1),this._handles.next(i))}_setPreviewTemplate(t){this._previewTemplate=t}_resetPreviewTemplate(t){t===this._previewTemplate&&(this._previewTemplate=null)}_setPlaceholderTemplate(t){this._placeholderTemplate=t}_resetPlaceholderTemplate(t){t===this._placeholderTemplate&&(this._placeholderTemplate=null)}_updateRootElement(){let t=this.element.nativeElement,i=t;this.rootElementSelector&&(i=t.closest!==void 0?t.closest(this.rootElementSelector):t.parentElement?.closest(this.rootElementSelector)),this._dragRef.withRootElement(i||t)}_getBoundaryElement(){let t=this.boundaryElement;return t?typeof t=="string"?this.element.nativeElement.closest(t):Vc(t):null}_syncInputs(t){t.beforeStarted.subscribe(()=>{if(!t.isDragging()){let i=this._dir,r=this.dragStartDelay,o=this._placeholderTemplate?{template:this._placeholderTemplate.templateRef,context:this._placeholderTemplate.data,viewContainer:this._viewContainerRef}:null,a=this._previewTemplate?{template:this._previewTemplate.templateRef,context:this._previewTemplate.data,matchSize:this._previewTemplate.matchSize,viewContainer:this._viewContainerRef}:null;t.disabled=this.disabled,t.lockAxis=this.lockAxis,t.scale=this.scale,t.dragStartDelay=typeof r=="object"&&r?r:$w(r),t.constrainPosition=this.constrainPosition,t.previewClass=this.previewClass,t.withBoundaryElement(this._getBoundaryElement()).withPlaceholderTemplate(o).withPreviewTemplate(a).withPreviewContainer(this.previewContainer||"global"),i&&t.withDirection(i.value)}}),t.beforeStarted.pipe(zo(1)).subscribe(()=>{if(this._parentDrag){t.withParent(this._parentDrag._dragRef);return}let i=this.element.nativeElement.parentElement;for(;i;){let r=this._dragDropRegistry.getDragDirectiveForNode(i);if(r){t.withParent(r._dragRef);break}i=i.parentElement}})}_handleEvents(t){t.started.subscribe(i=>{this.started.emit({source:this,event:i.event}),this._changeDetectorRef.markForCheck()}),t.released.subscribe(i=>{this.released.emit({source:this,event:i.event})}),t.ended.subscribe(i=>{this.ended.emit({source:this,distance:i.distance,dropPoint:i.dropPoint,event:i.event}),this._changeDetectorRef.markForCheck()}),t.entered.subscribe(i=>{this.entered.emit({container:i.container.data,item:this,currentIndex:i.currentIndex})}),t.exited.subscribe(i=>{this.exited.emit({container:i.container.data,item:this})}),t.dropped.subscribe(i=>{this.dropped.emit({previousIndex:i.previousIndex,currentIndex:i.currentIndex,previousContainer:i.previousContainer.data,container:i.container.data,isPointerOverContainer:i.isPointerOverContainer,item:this,distance:i.distance,dropPoint:i.dropPoint,event:i.event})})}_assignDefaults(t){let{lockAxis:i,dragStartDelay:r,constrainPosition:o,previewClass:a,boundaryElement:s,draggingDisabled:l,rootElementSelector:c,previewContainer:d}=t;this.disabled=l??!1,this.dragStartDelay=r||0,this.lockAxis=i||null,o&&(this.constrainPosition=o),a&&(this.previewClass=a),s&&(this.boundaryElement=s),c&&(this.rootElementSelector=c),d&&(this.previewContainer=d)}_setupHandlesListener(){this._handles.pipe(da(t=>{let i=t.map(r=>r.element);this._selfHandle&&this.rootElementSelector&&i.push(this.element),this._dragRef.withHandles(i)}),fr(t=>Er(...t.map(i=>i._stateChanges.pipe(hn(i))))),xi(this._destroyed)).subscribe(t=>{let i=this._dragRef,r=t.element.nativeElement;t.disabled?i.disableHandle(r):i.enableHandle(r)})}static \u0275fac=function(i){return new(i||n)};static \u0275dir=pt({type:n,selectors:[["","cdkDrag",""]],hostAttrs:[1,"cdk-drag"],hostVars:4,hostBindings:function(i,r){i&2&&ht("cdk-drag-disabled",r.disabled)("cdk-drag-dragging",r._dragRef.isDragging())},inputs:{data:[0,"cdkDragData","data"],lockAxis:[0,"cdkDragLockAxis","lockAxis"],rootElementSelector:[0,"cdkDragRootElement","rootElementSelector"],boundaryElement:[0,"cdkDragBoundary","boundaryElement"],dragStartDelay:[0,"cdkDragStartDelay","dragStartDelay"],freeDragPosition:[0,"cdkDragFreeDragPosition","freeDragPosition"],disabled:[2,"cdkDragDisabled","disabled",He],constrainPosition:[0,"cdkDragConstrainPosition","constrainPosition"],previewClass:[0,"cdkDragPreviewClass","previewClass"],previewContainer:[0,"cdkDragPreviewContainer","previewContainer"],scale:[2,"cdkDragScale","scale",Ii]},outputs:{started:"cdkDragStarted",released:"cdkDragReleased",ended:"cdkDragEnded",entered:"cdkDragEntered",exited:"cdkDragExited",dropped:"cdkDragDropped",moved:"cdkDragMoved"},exportAs:["cdkDrag"],features:[Ft([{provide:gC,useExisting:n}]),Se]})}return n})(),CV=new Ct("CdkDropListGroup");var qf=(()=>{class n{element=M(ft);_changeDetectorRef=M(ae);_scrollDispatcher=M(Kw);_dir=M(uo,{optional:!0});_group=M(CV,{optional:!0,skipSelf:!0});_latestSortedRefs;_destroyed=new Oe;_scrollableParentsResolved=!1;static _dropLists=[];_dropListRef;connectedTo=[];data;orientation="vertical";id=M(nr).getId("cdk-drop-list-");lockAxis=null;get disabled(){return this._disabled||!!this._group&&this._group.disabled}set disabled(t){this._dropListRef.disabled=this._disabled=t}_disabled=!1;sortingDisabled=!1;enterPredicate=()=>!0;sortPredicate=()=>!0;autoScrollDisabled=!1;autoScrollStep;elementContainerSelector=null;hasAnchor=!1;dropped=new me;entered=new me;exited=new me;sorted=new me;_unsortedItems=new Set;constructor(){let t=M(PV,{optional:!0}),i=M(Zr);this._dropListRef=EV(i,this.element),this._dropListRef.data=this,t&&this._assignDefaults(t),this._dropListRef.enterPredicate=(r,o)=>this.enterPredicate(r.data,o.data),this._dropListRef.sortPredicate=(r,o,a)=>this.sortPredicate(r,o.data,a.data),this._setupInputSyncSubscription(this._dropListRef),this._handleEvents(this._dropListRef),n._dropLists.push(this),this._group&&this._group._items.add(this)}addItem(t){this._unsortedItems.add(t),t._dragRef._withDropContainer(this._dropListRef),this._dropListRef.isDragging()&&this._syncItemsWithRef(this.getSortedItems().map(i=>i._dragRef))}removeItem(t){if(this._unsortedItems.delete(t),this._latestSortedRefs){let i=this._latestSortedRefs.indexOf(t._dragRef);i>-1&&(this._latestSortedRefs.splice(i,1),this._syncItemsWithRef(this._latestSortedRefs))}}getSortedItems(){return Array.from(this._unsortedItems).sort((t,i)=>t._dragRef.getVisibleElement().compareDocumentPosition(i._dragRef.getVisibleElement())&Node.DOCUMENT_POSITION_FOLLOWING?-1:1)}ngOnDestroy(){let t=n._dropLists.indexOf(this);t>-1&&n._dropLists.splice(t,1),this._group&&this._group._items.delete(this),this._latestSortedRefs=void 0,this._unsortedItems.clear(),this._dropListRef.dispose(),this._destroyed.next(),this._destroyed.complete()}_setupInputSyncSubscription(t){this._dir&&this._dir.change.pipe(hn(this._dir.value),xi(this._destroyed)).subscribe(i=>t.withDirection(i)),t.beforeStarted.subscribe(()=>{let i=cD(this.connectedTo).map(r=>{if(typeof r=="string"){let o=n._dropLists.find(a=>a.id===r);return o}return r});if(this._group&&this._group._items.forEach(r=>{i.indexOf(r)===-1&&i.push(r)}),!this._scrollableParentsResolved){let r=this._scrollDispatcher.getAncestorScrollContainers(this.element).map(o=>o.getElementRef().nativeElement);this._dropListRef.withScrollableParents(r),this._scrollableParentsResolved=!0}if(this.elementContainerSelector){let r=this.element.nativeElement.querySelector(this.elementContainerSelector);t.withElementContainer(r)}t.disabled=this.disabled,t.lockAxis=this.lockAxis,t.sortingDisabled=this.sortingDisabled,t.autoScrollDisabled=this.autoScrollDisabled,t.autoScrollStep=$w(this.autoScrollStep,2),t.hasAnchor=this.hasAnchor,t.connectedTo(i.filter(r=>r&&r!==this).map(r=>r._dropListRef)).withOrientation(this.orientation)})}_handleEvents(t){t.beforeStarted.subscribe(()=>{this._syncItemsWithRef(this.getSortedItems().map(i=>i._dragRef)),this._changeDetectorRef.markForCheck()}),t.entered.subscribe(i=>{this.entered.emit({container:this,item:i.item.data,currentIndex:i.currentIndex})}),t.exited.subscribe(i=>{this.exited.emit({container:this,item:i.item.data}),this._changeDetectorRef.markForCheck()}),t.sorted.subscribe(i=>{this.sorted.emit({previousIndex:i.previousIndex,currentIndex:i.currentIndex,container:this,item:i.item.data})}),t.dropped.subscribe(i=>{this.dropped.emit({previousIndex:i.previousIndex,currentIndex:i.currentIndex,previousContainer:i.previousContainer.data,container:i.container.data,item:i.item.data,isPointerOverContainer:i.isPointerOverContainer,distance:i.distance,dropPoint:i.dropPoint,event:i.event}),this._changeDetectorRef.markForCheck()}),Er(t.receivingStarted,t.receivingStopped).subscribe(()=>this._changeDetectorRef.markForCheck())}_assignDefaults(t){let{lockAxis:i,draggingDisabled:r,sortingDisabled:o,listAutoScrollDisabled:a,listOrientation:s}=t;this.disabled=r??!1,this.sortingDisabled=o??!1,this.autoScrollDisabled=a??!1,this.orientation=s||"vertical",this.lockAxis=i||null}_syncItemsWithRef(t){this._latestSortedRefs=t,this._dropListRef.withItems(t)}static \u0275fac=function(i){return new(i||n)};static \u0275dir=pt({type:n,selectors:[["","cdkDropList",""],["cdk-drop-list"]],hostAttrs:[1,"cdk-drop-list"],hostVars:7,hostBindings:function(i,r){i&2&&(Ye("id",r.id),ht("cdk-drop-list-disabled",r.disabled)("cdk-drop-list-dragging",r._dropListRef.isDragging())("cdk-drop-list-receiving",r._dropListRef.isReceiving()))},inputs:{connectedTo:[0,"cdkDropListConnectedTo","connectedTo"],data:[0,"cdkDropListData","data"],orientation:[0,"cdkDropListOrientation","orientation"],id:"id",lockAxis:[0,"cdkDropListLockAxis","lockAxis"],disabled:[2,"cdkDropListDisabled","disabled",He],sortingDisabled:[2,"cdkDropListSortingDisabled","sortingDisabled",He],enterPredicate:[0,"cdkDropListEnterPredicate","enterPredicate"],sortPredicate:[0,"cdkDropListSortPredicate","sortPredicate"],autoScrollDisabled:[2,"cdkDropListAutoScrollDisabled","autoScrollDisabled",He],autoScrollStep:[0,"cdkDropListAutoScrollStep","autoScrollStep"],elementContainerSelector:[0,"cdkDropListElementContainer","elementContainerSelector"],hasAnchor:[2,"cdkDropListHasAnchor","hasAnchor",He]},outputs:{dropped:"cdkDropListDropped",entered:"cdkDropListEntered",exited:"cdkDropListExited",sorted:"cdkDropListSorted"},exportAs:["cdkDropList"],features:[Ft([{provide:CV,useValue:void 0},{provide:RV,useExisting:n}])]})}return n})();var ile=new Ct("CdkDragPlaceholder"),AV=(()=>{class n{templateRef=M(Yr);_drag=M(gC,{optional:!0});data;constructor(){this._drag?._setPlaceholderTemplate(this)}ngOnDestroy(){this._drag?._resetPlaceholderTemplate(this)}static \u0275fac=function(i){return new(i||n)};static \u0275dir=pt({type:n,selectors:[["ng-template","cdkDragPlaceholder",""]],inputs:{data:"data"},features:[Ft([{provide:ile,useExisting:n}])]})}return n})();var yC=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=wi({type:n});static \u0275inj=Ci({providers:[tle],imports:[E1]})}return n})();var X_=100,nle=200,OV=n=>Number.isFinite(n)?Math.min(nle,Math.max(0,Math.round(n*100))):X_,FV=n=>n/100,vC=class n{brightness=$(X_);contrast=$(X_);dialogRef=M(ci);data=M(_i);initialPosition=this.data.position??{x:0,y:0};ngOnInit(){this.brightness.set(OV(this.data.value?.brightness??1)),this.contrast.set(OV(this.data.value?.contrast??1))}onBrightnessChange(e){this.brightness.set(Number(e.target.value)),this.emitChange()}onContrastChange(e){this.contrast.set(Number(e.target.value)),this.emitChange()}reset(){this.brightness.set(X_),this.contrast.set(X_),this.emitChange()}onDragEnded(e){typeof this.data?.onMoved=="function"&&this.data.onMoved(e.source.getFreeDragPosition())}currentValue(){return{brightness:FV(this.brightness()),contrast:FV(this.contrast())}}emitChange(){typeof this.data?.onChange=="function"&&this.data.onChange(this.currentValue())}handleClose(e){this.dialogRef.close({apply:e,value:this.currentValue()})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["ap-image-adjustment-dialog"]],decls:30,vars:13,consts:[["cdkDrag","","cdkDragRootElement",".cdk-overlay-pane",1,"_ap-image-adjustment",2,"overflow","hidden","color","var(--mat-app-text-color)",3,"cdkDragEnded","cdkDragFreeDragPosition"],["cdkDragHandle","",2,"display","flex","align-items","center","cursor","move","padding","4px 4px 0 12px"],[2,"opacity","0.6"],[2,"flex","1 1 auto","min-width","0","padding-left","8px","font-weight","500","overflow","hidden","text-overflow","ellipsis","white-space","nowrap",3,"title"],["mat-icon-button","","aria-label","Close",3,"click"],[2,"padding","0 24px","overflow","hidden","margin-top","-4px"],[2,"display","flex","align-items","center","margin","-11px 0"],[2,"width","72px","font-size","13px"],[2,"flex","1 1 auto","min-width","0",3,"min","max","step"],["matSliderThumb","","aria-label","Brightness",3,"input","value"],[2,"min-width","44px","text-align","right","font-size","13px"],["matSliderThumb","","aria-label","Contrast",3,"input","value"],[2,"min-height","38px","padding","0 8px 2px"],["mat-button","",3,"click"],[2,"flex","1 1 auto"]],template:function(t,i){t&1&&(u(0,"div",0),T("cdkDragEnded",function(o){return i.onDragEnded(o)}),u(1,"div",1)(2,"mat-icon",2),_(3,"tune"),h(),u(4,"div",3),_(5),h(),u(6,"button",4),T("click",function(){return i.handleClose(!1)}),u(7,"mat-icon"),_(8,"close"),h()()(),u(9,"mat-dialog-content",5)(10,"div",6)(11,"div",7),_(12,"Brightness"),h(),u(13,"mat-slider",8)(14,"input",9),T("input",function(o){return i.onBrightnessChange(o)}),h()(),u(15,"div",10),_(16),h()(),u(17,"div",6)(18,"div",7),_(19,"Contrast"),h(),u(20,"mat-slider",8)(21,"input",11),T("input",function(o){return i.onContrastChange(o)}),h()(),u(22,"div",10),_(23),h()()(),u(24,"mat-dialog-actions",12)(25,"button",13),T("click",function(){return i.reset()}),_(26,"RESET"),h(),z(27,"span",14),u(28,"button",13),T("click",function(){return i.handleClose(!0)}),_(29,"SAVE"),h()()()),t&2&&(w("cdkDragFreeDragPosition",i.initialPosition),f(4),w("title",i.data.text),f(),K(" ",i.data.text," "),f(8),w("min",0)("max",200)("step",1),f(),w("value",i.brightness()),f(2),K(" ",i.brightness(),"% "),f(4),w("min",0)("max",200)("step",1),f(),w("value",i.contrast()),f(2),K(" ",i.contrast(),"% "))},dependencies:[Zl,ql,vl,se,ce,ue,Ze,Fe,di,Oi,ki,ye,So,dl],encapsulation:2})};function OI(n){let e=n*10,t=e+Number.EPSILON*Math.max(1,Math.abs(e));return Math.floor(t)/10}function NV(n){return OI(n).toFixed(1)}function rle(n,e){if(n&1&&(u(0,"div",11),_(1),h()),n&2){let t=v();f(),K(" ",t.error()," ")}}function ole(n,e){if(n&1&&(u(0,"div",12),_(1),h()),n&2){let t=v();f(),K(" ",t.summary()," ")}}var FI=1,NI=28;function BV(n){if(n==null||String(n).trim()==="")return{invalid:!1};let e=Number(n);return!Number.isFinite(e)||e<FI||e>NI?{invalid:!0}:{value:e,invalid:!1}}function ale(n){return n.invalid?`Enter a zoom level between ${FI} and ${NI}`:null}function GV(n){return typeof n=="number"?`from z${n}`:""}function VV(n){return Number.isFinite(n)?String(OI(n)):""}var bC=class n{ZOOM_ENTRY_MIN=FI;ZOOM_ENTRY_MAX=NI;text=$("");dialogRef=M(ci);data=M(_i);error=Qe(()=>ale(BV(this.text())));summary=Qe(()=>{let e=this.currentValue();return typeof e=="number"?`Hidden below z${e}`:"Shown at every zoom level"});ngOnInit(){this.text.set(typeof this.data.value=="number"?String(this.data.value):"")}declaredText(){let{declaredMin:e,declaredMax:t}=this.data;return typeof e=="number"&&typeof t=="number"?`data z${e}\u2013z${t}`:"data zoom range unknown"}currentZoomText(){return VV(this.data.currentZoom())}onTextChange(e){this.setText(e.target.value)}useCurrentZoom(){this.setText(VV(this.data.currentZoom()))}clear(){this.setText("")}setText(e){this.text.set(e),!this.error()&&typeof this.data?.onChange=="function"&&this.data.onChange(this.currentValue())}currentValue(){return BV(this.text()).value}handleClose(e){this.dialogRef.close({apply:e,value:this.currentValue()})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["ap-chart-min-zoom-dialog"]],decls:27,vars:10,consts:[["cdkDrag","","cdkDragRootElement",".cdk-overlay-pane",1,"_ap-chart-min-zoom",2,"overflow","hidden","color","var(--mat-app-text-color)"],["cdkDragHandle","",2,"display","flex","align-items","center","cursor","move","padding","4px 4px 0 12px"],[2,"opacity","0.6"],[2,"flex","1 1 auto","min-width","0","padding-left","8px","font-weight","500","overflow","hidden","text-overflow","ellipsis","white-space","nowrap",3,"title"],["mat-icon-button","","aria-label","Close",3,"click"],[2,"padding","0 16px","font-size","12px","opacity","0.7","margin-top","-4px"],[2,"display","flex","align-items","center","gap","4px","padding","10px 8px 0 16px"],[2,"font-size","13px"],["type","number","inputmode","decimal","step","any","aria-label","Lowest zoom level to show this chart at",2,"width","70px","height","34px","box-sizing","border-box","padding","0 0 0 8px","font","inherit","font-size","14px","color","inherit","background","transparent","border","1px solid rgba(128, 128, 128, 0.5)","border-radius","4px",3,"change","min","max","value"],["mat-icon-button","","aria-label","Use the current map zoom","matTooltip","Use current map zoom",3,"click"],["mat-icon-button","","aria-label","Clear","matTooltip","Clear",3,"click","disabled"],["role","alert",1,"mat-mdc-form-field-error",2,"padding","4px 16px 0","font-size","12px"],[2,"padding","4px 16px 0","font-size","12px","opacity","0.7"],[2,"min-height","38px","padding","0 8px 2px"],[2,"flex","1 1 auto"],["mat-button","",3,"click","disabled"]],template:function(t,i){t&1&&(u(0,"div",0)(1,"div",1)(2,"mat-icon",2),_(3,"vertical_align_bottom"),h(),u(4,"div",3),_(5),h(),u(6,"button",4),T("click",function(){return i.handleClose(!1)}),u(7,"mat-icon"),_(8,"close"),h()()(),u(9,"div",5),_(10),h(),u(11,"div",6)(12,"div",7),_(13,"Show from"),h(),u(14,"input",8),T("change",function(o){return i.onTextChange(o)}),h(),u(15,"button",9),T("click",function(){return i.useCurrentZoom()}),u(16,"mat-icon"),_(17,"my_location"),h()(),u(18,"button",10),T("click",function(){return i.clear()}),u(19,"mat-icon"),_(20,"close"),h()()(),R(21,rle,2,1,"div",11)(22,ole,2,1,"div",12),u(23,"mat-dialog-actions",13),z(24,"span",14),u(25,"button",15),T("click",function(){return i.handleClose(!0)}),_(26," APPLY "),h()()()),t&2&&(f(4),w("title",i.data.text),f(),K(" ",i.data.text," "),f(5),Nr(" ",i.declaredText()," \xB7 map at z",i.currentZoomText()," "),f(4),w("min",i.ZOOM_ENTRY_MIN)("max",i.ZOOM_ENTRY_MAX)("value",i.text()),f(4),w("disabled",i.text()===""),f(3),A(i.error()?21:22),f(4),w("disabled",!!i.error()))},dependencies:[se,ce,ue,Ze,Fe,di,Oi,ye,Te,So,dl],encapsulation:2})};function sle(n,e){if(n&1){let t=H();Vi(0,"div",8)(1,"div",9),Nc("keydown",function(r){O(t);let o=v();return F(o.onKeyDown(r,"head"))}),Xi()()}if(n&2){let t=v();vt("left",t.headPct(),"%"),Ir("title",t.label()(t.position())),f(),Ye("aria-valuemin",t.min())("aria-valuemax",t.max())("aria-valuenow",t.position())("aria-valuetext",t.label()(t.position()))}}var lle=30,cle=10;function dle(n,e,t,i,r,o){let a=cle*o,s;switch(n){case"ArrowLeft":case"ArrowDown":s=t-(e?a:o);break;case"ArrowRight":case"ArrowUp":s=t+(e?a:o);break;case"PageDown":s=t-a;break;case"PageUp":s=t+a;break;case"Home":s=i;break;case"End":s=r;break;default:return null}return zV(s,i,r,o)}function zV(n,e,t,i){let r=e+Math.round((n-e)/i)*i;return Math.min(t,Math.max(e,r))}function ule(n,e,t){return e==="start"?{min:t,max:Math.max(n.max,t)}:{min:Math.min(n.min,t),max:t}}var Zf=class n{min=Z.required();max=Z.required();step=Z.required();position=Z.required();loop=Z.required();label=Z(()=>"");names=Z({start:"Loop start",end:"Loop end"});positionChange=xe();loopChange=xe();host=M(ft);dragging=null;hasHead=Qe(()=>this.position()!==null);headPct=Qe(()=>this.pct(this.position()??this.min()));loopPct=Qe(()=>({min:this.pct(this.loop().min),max:this.pct(this.loop().max)}));pct(e){let t=this.max()-this.min();if(t<=0)return 0;let i=(e-this.min())/t;return Math.min(100,Math.max(0,i*100))}positionAt(e){let i=(this.host.nativeElement.querySelector(".axis")??this.host.nativeElement).getBoundingClientRect(),r=i.width>0?(e.clientX-i.left)/i.width:0,o=this.min()+Math.min(1,Math.max(0,r))*(this.max()-this.min());return zV(o,this.min(),this.max(),this.step())}onPointerDown(e){if(e.button!==0&&e.pointerType==="mouse")return;let t=e.currentTarget,i=e.clientY-t.getBoundingClientRect().top;if(this.hasHead()&&i<lle)this.dragging="head";else{let r=this.positionAt(e),{min:o,max:a}=this.loop();this.dragging=Math.abs(r-o)<=Math.abs(r-a)?"start":"end"}t.setPointerCapture(e.pointerId),this.host.nativeElement.querySelector(`[data-handle="${this.dragging}"]`)?.focus({preventScroll:!0}),this.apply(e),e.preventDefault()}onKeyDown(e,t){let i=t==="head"?this.position():t==="start"?this.loop().min:this.loop().max,r=dle(e.key,e.shiftKey,i,this.min(),this.max(),this.step());r!==null&&(e.preventDefault(),this.moveHandle(t,r))}onPointerMove(e){this.dragging&&this.apply(e)}onPointerUp(e){if(!this.dragging)return;this.dragging=null;let t=e.currentTarget;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId)}apply(e){this.dragging&&this.moveHandle(this.dragging,this.positionAt(e))}moveHandle(e,t){if(e==="head"){t!==this.position()&&this.positionChange.emit(t);return}let i=ule(this.loop(),e,t),r=this.loop();(i.min!==r.min||i.max!==r.max)&&this.loopChange.emit(i)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["ap-chart-time-bar"]],inputs:{min:[1,"min"],max:[1,"max"],step:[1,"step"],position:[1,"position"],loop:[1,"loop"],label:[1,"label"],names:[1,"names"]},outputs:{positionChange:"positionChange",loopChange:"loopChange"},decls:9,vars:22,consts:[["role","group",1,"bar",3,"pointerdown","pointermove","pointerup","pointercancel"],[1,"axis"],[1,"track"],[1,"band"],[1,"edge",3,"title"],["role","slider","tabindex","0","data-handle","start",1,"knob",3,"keydown"],["role","slider","tabindex","0","data-handle","end",1,"knob",3,"keydown"],[1,"head",3,"left","title"],[1,"head",3,"title"],["role","slider","tabindex","0","data-handle","head","aria-label","Instant shown",1,"knob",3,"keydown"]],template:function(t,i){t&1&&(Vi(0,"div",0),Nc("pointerdown",function(o){return i.onPointerDown(o)})("pointermove",function(o){return i.onPointerMove(o)})("pointerup",function(o){return i.onPointerUp(o)})("pointercancel",function(o){return i.onPointerUp(o)}),Vi(1,"div",1),Fc(2,"div",2)(3,"div",3),Vi(4,"div",4)(5,"div",5),Nc("keydown",function(o){return i.onKeyDown(o,"start")}),Xi()(),Vi(6,"div",4)(7,"div",6),Nc("keydown",function(o){return i.onKeyDown(o,"end")}),Xi()(),R(8,sle,2,7,"div",7),Xi()()),t&2&&(Ye("aria-label",i.hasHead()?"Time scrub and loop bar":"Time range bar"),f(3),vt("left",i.loopPct().min,"%")("width",i.loopPct().max-i.loopPct().min,"%"),f(),vt("left",i.loopPct().min,"%"),Ir("title",i.names().start+": "+i.label()(i.loop().min)),f(),Ye("aria-label",i.names().start)("aria-valuemin",i.min())("aria-valuemax",i.max())("aria-valuenow",i.loop().min)("aria-valuetext",i.label()(i.loop().min)),f(),vt("left",i.loopPct().max,"%"),Ir("title",i.names().end+": "+i.label()(i.loop().max)),f(),Ye("aria-label",i.names().end)("aria-valuemin",i.min())("aria-valuemax",i.max())("aria-valuenow",i.loop().max)("aria-valuetext",i.label()(i.loop().max)),f(),A(i.hasHead()?8:-1))},styles:["[_nghost-%COMP%]{display:block;--bar-track: rgba(0, 0, 0, .18);--bar-band: rgba(79, 148, 212, .28);--bar-head: #1f4e8c;--bar-edge: #f2b84b;--bar-knob-shadow: rgba(0, 0, 0, .35);--bar-focus: #1f4e8c}.dark-theme[_nghost-%COMP%], .dark-theme [_nghost-%COMP%]{--bar-track: rgba(255, 255, 255, .22);--bar-band: rgba(127, 212, 255, .24);--bar-head: #3b7ddb;--bar-knob-shadow: rgba(0, 0, 0, .6);--bar-focus: #7fd4ff}.bar[_ngcontent-%COMP%]{position:relative;height:52px;-webkit-user-select:none;user-select:none;touch-action:none;cursor:pointer}.axis[_ngcontent-%COMP%]{position:absolute;inset:0 12px}.track[_ngcontent-%COMP%]{position:absolute;left:0;right:0;top:13px;height:4px;border-radius:2px;background:var(--bar-track)}.band[_ngcontent-%COMP%]{position:absolute;top:4px;height:48px;background:var(--bar-band);border-radius:3px;pointer-events:none}.edge[_ngcontent-%COMP%]{position:absolute;top:13px;height:30px;width:2px;margin-left:-1px;background:var(--bar-edge);pointer-events:none}.edge[_ngcontent-%COMP%] .knob[_ngcontent-%COMP%]{top:auto;bottom:-9px;background:var(--bar-edge)}.head[_ngcontent-%COMP%]{position:absolute;top:0;height:30px;width:2px;margin-left:-1px;background:var(--bar-head);pointer-events:none}.knob[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--bar-focus);outline-offset:2px}.knob[_ngcontent-%COMP%]{position:absolute;top:6px;left:50%;width:18px;height:18px;margin-left:-9px;border-radius:50%;background:var(--bar-head);box-shadow:0 1px 4px var(--bar-knob-shadow)}"],changeDetection:0})};function ple(n,e){if(n&1){let t=H();u(0,"ap-chart-time-bar",13),T("positionChange",function(r){O(t);let o=v();return F(o.onScrub(r))})("loopChange",function(r){O(t);let o=v();return F(o.onLoop(r))}),h(),u(1,"div",14)(2,"mat-form-field",15)(3,"mat-label"),_(4,"Speed"),h(),u(5,"mat-select",16),T("valueChange",function(r){O(t);let o=v();return F(o.setSpeed(r))}),u(6,"mat-option",17),_(7,"Slow"),h(),u(8,"mat-option",18),_(9,"Medium"),h(),u(10,"mat-option",19),_(11,"Fast"),h(),u(12,"mat-option",20),_(13,"X-fast"),h()()(),u(14,"span",21),_(15),h()()}if(n&2){let t=v();w("min",t.window().min)("max",t.window().max)("step",e.step)("position",t.position())("loop",t.loopRange())("label",t.thumbLabel),f(5),w("value",t.speed()),f(10),X(t.loopText())}}var BI={slow:1400,medium:700,fast:350,xfast:150},jV=12*36e5;function VI(n,e){if(!n.frames)return Math.max(n.step,Math.floor(jV/n.step)*n.step);let t=Math.min(n.max,Math.max(n.min,Math.round(e))),i=lo(n.frames[t])-jV,r=t;for(;r>0&&lo(n.frames[r-1])>=i;)r--;return Math.max(1,t-r)}function UV(n,e){let t=VI(n,e),i=Math.min(n.max,Math.max(n.min+t,e));return{min:Math.max(n.min,i-t),max:i}}function hle(n,e){let t=Id(n,null),i=VI(n,t);return t-e<=i?Math.max(t,e):e}function mle(n,e,t){let i=UV(n,e);return t>i.max?t:t<i.min?Math.min(n.max,t+VI(n,t)):e}function fle(n,e,t=n){let i=XE(n);if(!(i>e.head))return e;let r=l=>lo(na(t,l)),o=l=>Id(n,new Date(l).toISOString());if(r(e.windowEnd)<e.head)return st(ne({},e),{head:i});let a=i-e.head,s=l=>l===null?null:o(r(l)+a);return{head:i,windowEnd:o(r(e.windowEnd)+a),loopStart:s(e.loopStart),loopEnd:s(e.loopEnd)}}var WV={start:36e5,end:0};function HV(n,e,t,i){let r=d=>Id(n,na(n,Id(n,new Date(t-Math.max(0,d)).toISOString()))),o=r(i.start),a=r(i.end);if(Math.max(o,a)<e.min||Math.min(o,a)>e.max)return HV(n,e,lo(na(n,e.max)),WV);let s=d=>Math.min(e.max,Math.max(e.min,d)),l=s(Math.min(o,a)),c=s(Math.max(o,a));return{min:l,max:c}}function gle(n,e,t){let i=r=>lo(na(n,r));return{start:Math.max(0,e-i(t.min)),end:Math.max(0,e-i(t.max))}}function _le(n,e,t){let i=e??n.min,r=t??n.max;return i>n.max||r<n.min||i>r?n:{min:Math.max(n.min,i),max:Math.min(n.max,r)}}function yle(n){let e=Math.round(n/6e4);if(e<1)return`${Math.round(n/1e3)} s`;if(e<60)return`${e} min`;let t=Math.floor(e/60),i=e%60;if(t<24)return i?`${t} h ${i} min`:`${t} h`;let r=Math.floor(t/24),o=t%24;return o?`${r} d ${o} h`:`${r} d`}function CC(n,e="medium"){if(n===null)return"Live";let t=new Date(n);return Number.isFinite(t.valueOf())?t.toLocaleString(void 0,{dateStyle:e,timeStyle:"short"}):n}function Kp(n){return CC(n,"short")}var xC=class n{dialogRef=M(ci);data=M(_i);timeline=Qe(()=>Up(this.data.dimension?.()));current=Qe(()=>this.data.dimension?.()?.current!==!1);playing=$(!1);speed=$("medium");playTimer;clock=$(Date.now());clockTimer=setInterval(()=>this.clock.set(Date.now()),A2);position=Qe(()=>{this.clock();let e=this.timeline();return e?Id(e,this.data.value()):0});windowEnd=$(this.initialWindowEnd());window=Qe(()=>{let e=this.timeline();return e?UV(e,this.windowEnd()):{min:0,max:0}});initialPosition=this.data.position??{x:0,y:0};latestMs=this.initialLatestMs();seenTimeline=this.timeline();loopStart=$(this.initialLoop().min);loopEnd=$(this.initialLoop().max);loopRange=Qe(()=>_le(this.window(),this.loopStart(),this.loopEnd()));loopText=Qe(()=>{let e=this.loopRange(),t=this.timeline();return t?`${Kp(na(t,e.min))} \u2192 `+Kp(na(t,e.max)):""});valueText=Qe(()=>(this.clock(),CC(Cc(this.data.dimension?.(),this.data.value()))));thumbLabel=e=>{let t=this.timeline();return t?Kp(na(t,e)):""};constructor(){Me(()=>{let e=this.timeline(),t=this.position();this.clock(),ha(()=>{e&&(this.followHead(e),this.windowEnd.set(mle(e,this.windowEnd(),t)))})})}followHead(e){let t={head:this.latestMs,windowEnd:this.windowEnd(),loopStart:this.loopStart(),loopEnd:this.loopEnd()},i=fle(e,t,this.seenTimeline??e);this.seenTimeline=e,i!==t&&(this.latestMs=i.head,this.windowEnd.set(i.windowEnd),this.loopStart.set(i.loopStart),this.loopEnd.set(i.loopEnd))}ngOnDestroy(){this.stopPlayback(),clearInterval(this.clockTimer)}rangeText(){let e=this.timeline();return e?e.frames?`${e.frames.length} frames`:`every ${yle(e.step)}`:"no frames advertised"}onScrub(e){let t=this.timeline();t&&(this.stopPlayback(),this.data.onChange(na(t,e)))}step(e){let t=this.timeline();t&&(this.stopPlayback(),this.data.onChange(QF(t,this.data.value(),e,this.current())))}onLoop(e){this.loopStart.set(e.min),this.loopEnd.set(e.max);let t=this.timeline();t&&typeof this.data.onLoopChange=="function"&&this.data.onLoopChange(gle(t,this.latestMs,e))}onDragEnded(e){typeof this.data?.onMoved=="function"&&this.data.onMoved(e.source.getFreeDragPosition())}initialWindowEnd(){let e=this.timeline();return e?hle(e,this.position()):0}initialLatestMs(){let e=this.timeline();return e?XE(e):0}initialLoop(){let e=this.timeline();return e?HV(e,this.window(),this.latestMs,this.data.loop??WV):{min:0,max:0}}goLive(){this.stopPlayback(),this.data.onChange(null)}togglePlay(){if(this.playing()){this.stopPlayback();return}this.timeline()&&(this.playing.set(!0),this.tick(),this.startTimer())}setSpeed(e){this.speed.set(e),this.playing()&&(clearInterval(this.playTimer),this.startTimer())}startTimer(){this.playTimer=setInterval(()=>this.tick(),BI[this.speed()])}tick(){let e=this.timeline();e&&this.data.onChange(JF(e,this.data.value(),this.loopRange()))}stopPlayback(){this.playTimer&&(clearInterval(this.playTimer),this.playTimer=void 0),this.playing.set(!1)}handleClose(){this.dialogRef.close()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["ap-chart-time-dialog"]],decls:27,vars:14,consts:[["cdkDrag","","cdkDragRootElement",".cdk-overlay-pane",1,"_ap-chart-time",2,"overflow","hidden","color","var(--mat-app-text-color)",3,"cdkDragEnded","cdkDragFreeDragPosition"],["cdkDragHandle","",2,"display","flex","align-items","center","cursor","move","padding","4px 4px 0 12px"],[2,"opacity","0.6"],[2,"flex","1 1 auto","min-width","0","padding-left","8px","font-weight","500","overflow","hidden","text-overflow","ellipsis","white-space","nowrap",3,"title"],["mat-icon-button","","aria-label","Close",3,"click"],[2,"padding","0 16px","font-size","12px","opacity","0.7","margin-top","-4px"],["aria-live","polite",2,"padding","6px 16px 0","font-size","15px","font-weight","500"],[2,"min-height","38px","padding","0 8px 2px"],["mat-icon-button","","aria-label","Previous frame","matTooltip","Previous frame",3,"click","disabled"],["mat-icon-button","",3,"click","matTooltip","disabled"],["mat-icon-button","","aria-label","Next frame","matTooltip","Next frame",3,"click","disabled"],[2,"flex","1 1 auto"],["mat-button","",3,"click","matTooltip","disabled"],[2,"padding","4px 4px 0",3,"positionChange","loopChange","min","max","step","position","loop","label"],[2,"display","flex","align-items","center","gap","6px","padding","2px 16px 0 12px","font-size","11px"],["appearance","outline","subscriptSizing","dynamic",1,"_ap-speed"],["aria-label","Playback speed","panelClass","_ap-speed-panel",3,"valueChange","value"],["value","slow"],["value","medium"],["value","fast"],["value","xfast"],[2,"flex","1 1 auto","text-align","right","opacity","0.7"]],template:function(t,i){if(t&1&&(u(0,"div",0),T("cdkDragEnded",function(o){return i.onDragEnded(o)}),u(1,"div",1)(2,"mat-icon",2),_(3,"schedule"),h(),u(4,"div",3),_(5),h(),u(6,"button",4),T("click",function(){return i.handleClose()}),u(7,"mat-icon"),_(8,"close"),h()()(),u(9,"div",5),_(10),h(),u(11,"div",6),_(12),h(),R(13,ple,16,8),u(14,"mat-dialog-actions",7)(15,"button",8),T("click",function(){return i.step(-1)}),u(16,"mat-icon"),_(17,"navigate_before"),h()(),u(18,"button",9),T("click",function(){return i.togglePlay()}),u(19,"mat-icon"),_(20),h()(),u(21,"button",10),T("click",function(){return i.step(1)}),u(22,"mat-icon"),_(23,"navigate_next"),h()(),z(24,"span",11),u(25,"button",12),T("click",function(){return i.goLive()}),_(26," NOW "),h()()()),t&2){let r;w("cdkDragFreeDragPosition",i.initialPosition),f(4),w("title",i.data.text),f(),K(" ",i.data.text," "),f(5),K(" ",i.rangeText()," "),f(2),K(" ",i.valueText()," "),f(),A((r=i.timeline())?13:-1,r),f(2),w("disabled",!i.timeline()),f(3),w("matTooltip",i.playing()?"Pause":"Play")("disabled",!i.timeline()),Ye("aria-label",i.playing()?"Pause":"Play"),f(2),X(i.playing()?"pause":"play_arrow"),f(),w("disabled",!i.timeline()||i.data.value()===null),f(4),w("matTooltip",i.current()?"Return to the live frame":"Return to the newest frame")("disabled",i.data.value()===null)}},dependencies:[se,ce,ue,Ze,Fe,di,Oi,ye,Te,Da,Gt,Vt,Ra,zs,Gs,Zf,So,dl],styles:["._ap-speed[_ngcontent-%COMP%]{width:92px;font-size:11px}._ap-speed[_ngcontent-%COMP%] .mat-mdc-text-field-wrapper{padding-top:0;padding-bottom:0}._ap-speed[_ngcontent-%COMP%] .mat-mdc-form-field-infix{min-height:30px;padding-top:6px;padding-bottom:4px}._ap-speed[_ngcontent-%COMP%] .mat-mdc-select-value, ._ap-speed[_ngcontent-%COMP%] .mat-mdc-floating-label{font-size:11px}"]})};var $V="3.2.0";var KV=500,Xf=1.5,ble=1,xle=2147483647;function qV(n){return typeof n!="number"||!Number.isFinite(n)?Xf*1e3:Math.min(Math.max(n,ble)*1e3,xle)}var wC=class{constructor(e=()=>{}){this.onExpire=e}onExpire;_marker=$(null);timer;seq=0;get marker(){return this._marker.asReadonly()}get active(){return this._marker()!==null}pin(e,t,i){this.stopTimer(),this._marker.set({id:++this.seq,position:e,worldOffset:t,fadeMs:i}),this.timer=setTimeout(()=>{this.timer=void 0,this._marker.set(null),this.onExpire()},i)}release(){this.stopTimer(),this._marker.set(null)}stopTimer(){clearTimeout(this.timer),this.timer=void 0}};function ZV(n){let e=!0,t=Object.keys(n);return Object.keys(zI()).forEach(i=>{t.includes(i)||(e=!1)}),e}function GI(n,e){if(typeof n.ui>"u"?n.ui={mapNorthUp:!0,mapMove:!1,mapConstrainZoom:!1,invertColor:!1,toolbarButtons:!0,showCourseData:!0,showAisTargets:!0,showNotes:!0,autoNightMode:!1}:(typeof n.ui.showCourseData>"u"&&(n.ui.showCourseData=!0),typeof n.ui.showAisTargets>"u"&&(n.ui.showAisTargets=!0),typeof n.ui.showNotes>"u"&&(n.ui.showNotes=!0)),typeof n.imageAdjustPalettePos>"u"&&(n.imageAdjustPalettePos=null),typeof n.timePalettePos>"u"&&(n.timePalettePos=null),typeof n.trackHistoryPalettePos>"u"&&(n.trackHistoryPalettePos=null),typeof n.display>"u"?n.display={fab:"wpt",disableWakelock:!1,darkMode:{enabled:!1,source:0},nightMode:!1,muteSound:!1,depthAlarm:{enabled:!1,smoothing:1e4},plugins:{instruments:"/@signalk/instrumentpanel",startOnOpen:!0,parameters:null,favourites:[]},preferInfoPanel:!0,singleClickNoteDetails:!1,windIndicator:"barb",statusBar:{liveEta:!1,referenceSpeed:6,tapFadeSpeed:Xf}}:(typeof n.display.preferInfoPanel>"u"&&(n.display.preferInfoPanel=!0),typeof n.display.singleClickNoteDetails>"u"&&(n.display.singleClickNoteDetails=!1),typeof n.display.windIndicator>"u"&&(n.display.windIndicator="barb"),typeof n.display.statusBar>"u"?n.display.statusBar={liveEta:!1,referenceSpeed:6,tapFadeSpeed:Xf}:typeof n.display.statusBar.tapFadeSpeed>"u"&&(n.display.statusBar.tapFadeSpeed=Xf)),typeof n.units.temperature>"u"&&(n.units.temperature="C"),n.units.temperature=n.units.temperature.toUpperCase(),n.units.depth=n.units.depth==="ft"?"foot":n.units.depth,typeof n.units.length>"u"&&(n.units.length=n.units.depth??"m"),n.units.speed=n.units.speed==="msec"?"m/s":n.units.speed==="kmh"?"km/h":n.units.speed,n.units.distance=n.units.distance==="m"?"kilometer":n.units.distance==="ft"?"naut-mile":n.units.distance,typeof n.map.s57Options>"u"?n.map.s57Options={graphicsStyle:"Paper",boundaries:"Plain",colors:4,shallowDepth:2,safetyDepth:3,deepDepth:6,colorTable:0,otherLayers:Gf.otherLayers,depthUnit:n.units.depth??"m"}:(typeof n.map.s57Options.otherLayers>"u"&&(n.map.s57Options.otherLayers=Gf.otherLayers),typeof n.map.s57Options.depthUnit>"u"&&(n.map.s57Options.depthUnit=n.units.depth??"m")),typeof n.map.labelsMinZoom>"u"&&(n.map.labelsMinZoom=8),typeof n.map.panBehavior>"u"){let i=n.map;n.map.panBehavior=A6(i.lockMoveMap),delete i.lockMoveMap}typeof n.map.refollowDelay!="number"&&(n.map.refollowDelay=0),typeof n.map.popoverMulti>"u"&&(n.map.popoverMulti=!1);let t=n.map.centerOffsetAbeam;if(n.map.centerOffset=L6(n.map.centerOffset,t),delete n.map.centerOffsetAbeam,typeof n.map.doubleClickZoom>"u"&&(n.map.doubleClickZoom=!1),typeof n.map.overZoomTiles>"u"&&(n.map.overZoomTiles=!0),n.units.positionFormat||(n.units.positionFormat="XY"),typeof n.units.headingAttribute>"u"&&(n.units.headingAttribute="navigation.headingTrue"),typeof n.units.preferredPaths>"u"&&(n.units.preferredPaths={tws:"environment.wind.speedTrue",twd:"environment.wind.directionTrue",heading:"auto",course:"navigation.courseGreatCircle"}),n.units.autoHeadingApplied||(n.units.preferredPaths.heading==="navigation.courseOverGroundTrue"&&(n.units.preferredPaths.heading="auto"),n.units.autoHeadingApplied=!0),typeof n.units.useServerPrefs>"u"&&(n.units.useServerPrefs=!1),typeof n.course>"u"?n.course={autoNextPointOnArrival:!1,autoNextPointDelay:5e3,autoNextPointTrigger:"perpendicularPassed",arrivalCircle:100}:typeof n.course.arrivalCircle>"u"&&(n.course.arrivalCircle=100),typeof n.vessels>"u"?n.vessels={fixedLocationMode:!1,fixedPosition:[0,0],trail:!0,windVectors:!0,laylines:!1,selfLines:{cog:{length:10,color:"rgba(204, 12, 225, 0.7)",weight:1,dash:"none"},heading:{length:-1,color:"rgba(221, 99, 0, 0.5)",weight:4,dash:"none"}},aisCogLine:10,iconScale:.9,rangeCircles:!1,rangeCirclesFixed:!1,rangeCirclesDistance:1e3,rangeCircleCount:4,rangeCircleMinZoom:8,aisStaleAge:36e4,aisMaxAge:54e4,aisWindApparent:!1,aisWindMinZoom:15,aisShowTrack:!1,aisTrackLength:12,trailSource:"auto",trailDuration:24,trailResolution:{lastHour:"5s",next23:"1m",beyond24:"5m"}}:(n.vessels.trailSource=aP(n.vessels.trailFromServer,n.vessels.trailSource),delete n.vessels.trailFromServer,typeof n.vessels.aisTrackLength>"u"&&(n.vessels.aisTrackLength=12),typeof n.vessels.rangeCircleCount>"u"&&(n.vessels.rangeCircleCount=4),typeof n.vessels.rangeCircleMinZoom>"u"&&(n.vessels.rangeCircleMinZoom=8),typeof n.vessels.rangeCirclesFixed>"u"&&(n.vessels.rangeCirclesFixed=!1),typeof n.vessels.rangeCirclesDistance>"u"&&(n.vessels.rangeCirclesDistance=1e3),typeof n.vessels.selfLines>"u"&&(n.vessels.selfLines={cog:{length:n.vessels.cogLine??10,color:"rgba(204, 12, 225, 0.7)",weight:1,dash:"none"},heading:{length:n.vessels.headingLineSize??-1,color:"rgba(221, 99, 0, 0.5)",weight:4,dash:"none"}},delete n.vessels.cogLine,delete n.vessels.headingLineSize)),typeof n.resources>"u"?n.resources={fetchFilter:"?position=[%map:longitude%,%map:latitude%]&distance=%fetch:radius%",fetchRadius:0,notes:{rootFilter:"?position=[%map:longitude%,%map:latitude%]&distance=%note:radius%",getRadius:20,groupNameEdit:!1,groupRequiresPosition:!1,minZoom:10},video:{enable:!1,url:""},paths:[]}:(typeof n.resources.notes.minZoom>"u"&&(n.resources.notes.minZoom=10),typeof n.resources.video>"u"&&(n.resources.video={enable:!1,url:""}),typeof n.resources.paths>"u"&&(n.resources.paths=[]),typeof n.resources.fetchFilter>"u"&&(n.resources.fetchFilter="?position=[%map:longitude%,%map:latitude%]&distance=%fetch:radius%"),typeof n.resources.fetchRadius>"u"&&(n.resources.fetchRadius=0)),typeof n.signalk>"u"?n.signalk={vessels:!0,atons:!0,aircraft:!1,sar:!1,meteo:!0,maxRadius:0,proxied:!0}:n.signalk.proxied=!0,typeof n.anchor>"u"&&(n.anchor={radius:40,setRadius:!1,manualSet:!1,rodeLength:50}),(!n.plotterExtensions||typeof n.plotterExtensions!="object"||Array.isArray(n.plotterExtensions))&&(n.plotterExtensions={widgets:[]}),delete n.plotterExtensions.enabled,Array.isArray(n.plotterExtensions.widgets)||(n.plotterExtensions.widgets=[]),n.plotterExtensions.widgets=n.plotterExtensions.widgets.map(i=>(i.corner&&!i.anchor&&(i.anchor=i.corner==="tl"?"tr":i.corner,delete i.corner),i)).filter(i=>["tr","ct","cb","bl","br"].includes(i.anchor)),typeof n.radars>"u"?n.radars={deviceId:"",opacity:1}:typeof n.radars.opacity>"u"&&(n.radars.opacity=1),typeof n.selections>"u"&&(n.selections={routes:[],waypoints:[],regions:[],tracks:null,charts:["openstreetmap","openseamap"],chartOrder:["openstreetmap","openseamap"],chartOpacity:{},chartImageAdjustment:{},chartDisplayMinZoom:{},chartTimeLoop:{},aisTargets:null,aisTargetTypes:[],aisFilterByShipType:!1,aisState:[],resourceSets:{},infolayers:null,weatherWindEnabled:!1,oceanCurrentsEnabled:!1,tidalCurrentsEnabled:!1}),typeof n.selections.aisTargetTypes>"u"&&(n.selections.aisTargetTypes=[]),typeof n.selections.aisFilterByShipType>"u"&&(n.selections.aisFilterByShipType=!1),typeof n.selections.aisState>"u"&&(n.selections.aisState=[]),typeof n.selections.chartOrder>"u"&&(n.selections.chartOrder=[]),typeof n.selections.chartOpacity>"u"&&(n.selections.chartOpacity={}),typeof n.selections.chartImageAdjustment>"u"&&(n.selections.chartImageAdjustment={}),typeof n.selections.chartDisplayMinZoom>"u"&&(n.selections.chartDisplayMinZoom={}),typeof n.selections.chartTimeLoop>"u"&&(n.selections.chartTimeLoop={}),typeof n.selections.tracks>"u"&&(n.selections.tracks=[]),typeof n.selections.resourceSets>"u"&&(n.selections.resourceSets={}),typeof n.selections.infolayers>"u"&&(n.selections.infolayers=[]),typeof n.selections.regions>"u"&&(n.selections.regions=[]),typeof n.selections.weatherWindEnabled>"u"&&(n.selections.weatherWindEnabled=!1),typeof n.selections.oceanCurrentsEnabled>"u"&&(n.selections.oceanCurrentsEnabled=!1),typeof n.selections.tidalCurrentsEnabled>"u"&&(n.selections.tidalCurrentsEnabled=!1),delete n.selections.notes,typeof e.northup<"u"&&(n.ui.mapNorthUp=e.northup!=="0"),typeof e.movemap<"u"&&(n.ui.mapMove=e.movemap!=="0"),e.zoom)try{let i=parseInt(e.zoom);isNaN(i)||(n.map.zoomLevel=i>28?28:i<1?1:i)}catch(i){console.warn(`Invalid zoom level parameter (${e.zoom} supplied!`)}}function zI(){return{ui:{mapNorthUp:!0,mapMove:!1,mapConstrainZoom:!1,toolbarButtons:!0,invertColor:!1,showCourseData:!0,showAisTargets:!0,showNotes:!0,autoNightMode:!1},imageAdjustPalettePos:null,timePalettePos:null,trackHistoryPalettePos:null,display:{fab:"wpt",disableWakelock:!1,darkMode:{enabled:!1,source:0},nightMode:!1,muteSound:!1,depthAlarm:{enabled:!1,smoothing:1e4},plugins:{instruments:"/@signalk/instrumentpanel",startOnOpen:!0,parameters:null,favourites:[]},preferInfoPanel:!0,singleClickNoteDetails:!1,windIndicator:"barb",statusBar:{liveEta:!1,referenceSpeed:6,tapFadeSpeed:Xf}},units:{distance:"kilometer",depth:"m",length:"m",speed:"kn",temperature:"C",positionFormat:"XY",headingAttribute:"navigation.headingTrue",preferredPaths:{tws:"environment.wind.speedTrue",twd:"environment.wind.directionTrue",heading:"auto",course:"navigation.courseGreatCircle"},autoHeadingApplied:!0,useServerPrefs:!1},map:{zoomLevel:2,center:[0,0],rotation:0,panBehavior:"offset",refollowDelay:0,animate:!1,labelsMinZoom:8,doubleClickZoom:!1,overZoomTiles:!0,centerOffset:{x:0,y:0},s57Options:{graphicsStyle:"Paper",boundaries:"Plain",colors:4,shallowDepth:2,safetyDepth:3,deepDepth:6,colorTable:0,otherLayers:Gf.otherLayers,depthUnit:"m"},popoverMulti:!1},course:{autoNextPointOnArrival:!1,autoNextPointDelay:5e3,autoNextPointTrigger:"perpendicularPassed",arrivalCircle:100},vessels:{fixedLocationMode:!1,fixedPosition:[0,0],trail:!0,windVectors:!0,laylines:!1,selfLines:{cog:{length:10,color:"rgba(204, 12, 225, 0.7)",weight:1,dash:"none"},heading:{length:-1,color:"rgba(221, 99, 0, 0.5)",weight:4,dash:"none"}},aisCogLine:10,iconScale:.9,rangeCircles:!1,rangeCirclesFixed:!1,rangeCirclesDistance:1e3,rangeCircleCount:4,rangeCircleMinZoom:8,aisStaleAge:36e4,aisMaxAge:54e4,aisWindApparent:!1,aisWindMinZoom:15,aisShowTrack:!1,aisTrackLength:12,trailSource:"auto",trailDuration:24,trailResolution:{lastHour:"5s",next23:"1m",beyond24:"5m"}},resources:{fetchFilter:"?position=[%map:longitude%,%map:latitude%]&distance=%fetch:radius%",fetchRadius:0,notes:{rootFilter:"?position=[%map:longitude%,%map:latitude%]&distance=%note:radius%",getRadius:20,groupNameEdit:!1,groupRequiresPosition:!0,minZoom:10},video:{enable:!1,url:null},paths:[]},signalk:{vessels:!0,atons:!0,aircraft:!1,sar:!1,meteo:!0,maxRadius:0,proxied:!0},anchor:{radius:40,setRadius:!1,manualSet:!1,rodeLength:50},radars:{deviceId:void 0,opacity:1},experiments:!1,plotterExtensions:{widgets:[]},selections:{routes:[],waypoints:[],regions:[],tracks:null,charts:["openstreetmap","openseamap"],chartOrder:["openstreetmap","openseamap"],chartOpacity:{},chartImageAdjustment:{},chartDisplayMinZoom:{},chartTimeLoop:{},aisTargets:null,aisTargetTypes:[],aisFilterByShipType:!1,aisState:[],resourceSets:{},infolayers:null,weatherWindEnabled:!1,oceanCurrentsEnabled:!1,tidalCurrentsEnabled:!1}}}function XV(){return{loginRequired:!1,chartBounds:{show:!1,charts:[]},selfId:null,activeRoute:null,activeRouteReversed:!1,activeRouteCircular:!1,activeRouteIsEditing:!1,editingId:null,activeWaypoint:null,serverTrail:!1,server:null,lastGet:null,map:{atClick:{features:[],lonlat:[0,0]}},vessels:{showSelf:!1,self:new Ad,aisTargets:new Map,aisTracks:new Map,activeId:null,active:null,closest:[],prefAvailablePaths:{},flagged:[],showTrack:[]},aircraft:new Map,atons:new Map,sar:new Map,meteo:new Map,racing:{startLine:[]}}}var MC=(n,e)=>{if(!n)return n;let t=n.split("%");return t.length>1&&(n=t.map(r=>r==="map:latitude"?e.map.center[1]:r==="map:longitude"?e.map.center[0]:r==="map:zoom"?Math.floor(e.map.zoomLevel):r==="note:radius"?(e.units.distance==="kilometer"?e.resources.notes.getRadius:Math.floor(Ue.nauticalMilesToKm(e.resources.notes.getRadius)))*1e3:r==="fetch:radius"?(e.units.distance==="kilometer"?e.resources.notes.getRadius:Math.floor(Ue.nauticalMilesToKm(e.resources.fetchRadius)))*1e3:r).join("")),n};var YV="symbols";var QV={id:"freeboard",name:"Freeboard-SK",description:"Signal K Chart Plotter.",version:$V,url:"https://github.com/signalk/freeboard-sk",logo:"./assets/img/app_logo.png"},Cle="1.0.0",Q_={host:"localhost",port:3e3,ssl:!1},oe=class n extends Z1{skApiVersion=2;hostDef={name:void 0,port:void 0,ssl:!1,url:void 0,params:{}};sessionToken;STANDARD_RESOURCES=["routes","waypoints","regions","notes","charts"];CUSTOM_RESOURCES=[{name:"tracks",description:"Freeboard GPX track imports.",featureKey:"resourceTracks"},{name:"infolayers",description:"Freeboard map overlays.",featureKey:"infoLayers",createIfMissing:!1},{name:"groups",description:"Freeboard resource groups.",featureKey:"resourceGroups"}];get IGNORE_RESOURCES(){return this.STANDARD_RESOURCES.concat(this.CUSTOM_RESOURCES.map(e=>e.name),["buddies",$D,YV])}serverConfig={unitPreferences:$(void 0),pathDisplayUnits:$({})};MAP_ZOOM_EXTENT={min:2,max:28};AudioContext=window.AudioContext||window.webkitAudioContext;audio={context:new AudioContext};db;watchingSKLogin;kioskMode=$(!1);hasAuthToken=$(!1);isLoggedIn=$(!1);instrumentPanelAvailable=$(!0);skAuthChange=$(void 0);sIsFetching=$(!1);sTrueMagChoice=$("");instrumentPanel=$({open:!1,activate:!1});uiCtrl=$({alertList:!1,autopilotConsole:!1,radarLayer:!1,routeBuilder:!1,suppressContextMenu:!1,forceNightMode:!1});uiConfig=$({mapNorthUp:!0,mapMove:!1,mapConstrainZoom:!1,toolbarButtons:!1,invertColor:!1,showCourseData:!0,showAisTargets:!0,showNotes:!0,autoNightMode:!1});featureFlags=$({anchorApi:!0,autopilotApi:!1,weatherApi:!1,radarApi:!1,notificationApi:!1,resourceGroups:!1,resourceTracks:!1,infoLayers:!1,buddyList:!1,tidalApi:!1,tracksApi:!1});trackSource=$(null);vesselTrackSelection$=new Oe;selfLines=$({cog:{fill:{color:"rgba(204, 12, 225, 0.7)"},stroke:{color:"rgba(204, 12, 225, 0.7)",width:1,lineDash:null}},heading:{fill:{color:"rgba(221, 99, 0, 0.5)"},stroke:{color:"rgba(221, 99, 0, 0.5)",width:4,lineDash:null}}});selfTrail=$([]);trailStamps=new ty;selfTrailFromServer=$([]);selfTrailTimed=$(null);aisTracksTimed=$(new Map);mapExtent=$([]);mapViewTopCenter=$([0,0]);mapViewRightCenter=$([0,0]);mapViewRotation=$(0);mapZoom=$(0);mapMoveRequest=$(null);signalk=M(Lt);worker=M(Nn);dialog=M(ln);snackbar=M(kD);iconReg=M(A1);dom=M(Ud);s57=M($p);constructor(){super(QV),this.config=zI(),this.data=XV(),this.suppressPersist=!0,this.db=new jI,this.db.dbUpdate$.subscribe(e=>{if(e.action)switch(e.action){case"db_init":e.value&&this.config.vessels.trail&&this.db.getTrail().then(t=>{this.selfTrail.update(()=>t&&t.value?t.value:[])});break;case"trail_save":e.value||this.debug("app.trail.save.error","warn");break}}),this.signalk.setAppId(QV.id),this.signalk.setAppVersion(Cle),this.initAppIcons(),this.parseLaunchUrl(),this.instrumentPanelAvailable.update(()=>this.isTopWindow()),this.isTopWindow()||window.addEventListener("message",e=>{this.parseMessageFromParent(e)}),this.testForInternet(),this.loadConfig(),this.parseLocalConfig(),Me(()=>{this.uiConfig(),this.debug("AppFacade.effect().uiConfig",this.uiConfig()),this.config.ui=this.uiConfig(),this.saveConfigDebounced()}),Me(()=>{this.alignUnitPrefs(this.serverConfig.unitPreferences())})}useInfoPanel(){return!window.matchMedia("(max-width: 760px)").matches&&!this.instrumentPanel().open&&this.config.display.preferInfoPanel}fetchUnitPrefsFromSKServer(){this.signalk.get("/signalk/v1/unitpreferences/active").subscribe({next:e=>{this.serverConfig.unitPreferences.set(e),this.refreshPathDisplayUnits()},error:()=>{this.debug("No server unit preferences...using fallback!")}})}twsDisplayUnitPath(){return this.config.units.preferredPaths.tws??"environment.wind.speedTrue"}displayUnitPaths(){return[this.twsDisplayUnitPath(),"environment.wind.speedApparent"]}refreshPathDisplayUnits(){if(!this.config.units.useServerPrefs){this.serverConfig.pathDisplayUnits.set({});return}this.displayUnitPaths().forEach(e=>this.fetchPathDisplayUnits(e))}fetchPathDisplayUnits(e){let t=e.split(".").join("/");this.signalk.get(`/signalk/v1/api/vessels/self/${t}/meta`).subscribe({next:i=>{this.config.units.useServerPrefs&&i?.displayUnits?.targetUnit?this.setPathDisplayUnits(e,i.displayUnits):this.clearPathDisplayUnits(e)},error:()=>{this.debug(`No display units for path: ${e}`),this.clearPathDisplayUnits(e)}})}parseMessageFromParent(e){if(ls()||e.origin===window.location.origin){this.debug("parseMessageFromParent()",e.origin,e.data);let{settings:t,commands:i}=e.data;if(!t&&!i){this.debug("parseMessageFromParent() - invalid data!");return}typeof t?.autoNightMode=="boolean"&&(this.config.display.nightMode=t.autoNightMode,this.uiConfig.update(r=>Object.assign({},r,{autoNightMode:this.config.display.nightMode}))),typeof i?.nightModeEnable=="boolean"&&this.uiCtrl.update(r=>Object.assign({},r,{forceNightMode:i.nightModeEnable}))}else{this.debug("parseMessageFromParent() - untrusted origin!",e.origin);return}}parseLocalConfig(){GI(this.config,this.hostDef.params),this.s57.init(this.config.map.s57Options),this.doPostConfigLoad()}get lineDashMap(){return new Map([["none","none"],["short","2 2"],["medium","4 4"],["long","8 4"],["alt","8 4 2 4"]])}formatLineDashArray(e){return e==="none"?null:Array.from(this.lineDashMap.get(e)).filter(t=>t!==" ").map(t=>Number(t))}doPostConfigLoad(){this.uiConfig.update(()=>this.config.ui),this.config.vessels.fixedLocationMode&&(this.data.vessels.self.position=[...this.config.vessels.fixedPosition],this.data.vessels.showSelf=!0,this.config.map.center=[...this.config.vessels.fixedPosition]),this.selfLines.update(()=>({cog:{fill:{color:this.config.vessels.selfLines.cog.color},stroke:{color:this.config.vessels.selfLines.cog.color,width:this.config.vessels.selfLines.cog.weight,lineDash:this.formatLineDashArray(this.config.vessels.selfLines.cog.dash)}},heading:{fill:{color:this.config.vessels.selfLines.heading.color},stroke:{color:this.config.vessels.selfLines.heading.color,width:this.config.vessels.selfLines.heading.weight,lineDash:this.formatLineDashArray(this.config.vessels.selfLines.heading.dash)}}})),this.sTrueMagChoice.set(this.config.units.headingAttribute),this.s57.setOptions(this.config.map.s57Options),this.mapZoom.set(this.config.map.zoomLevel),this.debug("doPostConfigLoad(): emit config$.ready"),this.emitConfigEvent("ready"),this.suppressPersist=!1}loadUserConfigfromServer(){return Y(this,null,function*(){return new Promise(e=>{this.signalk.isLoggedIn().subscribe({next:t=>{if(this.isLoggedIn.set(t),t)this.debug("loadUserConfigfromServer(): Is authenticated. Fetching config from SK Server..."),this.signalk.appDataGet("/").subscribe({next:i=>{Object.keys(i).length===0&&e(!1),GI(i,this.hostDef.params),ZV(i)&&(this.config=i,this.doPostConfigLoad(),this.alignCustomResourcesPaths(),this.alignUnitPrefs(this.serverConfig.unitPreferences()),this.saveConfig()),e(!0)},error:()=>{console.info("applicationData: Unable to retrieve settings from server!"),e(!1)}});else return this.debug("loadUserConfigfromServer(): Not authenticated to SK Server!"),e(!1)},error:()=>{this.isLoggedIn.set(!1),this.debug("loadUserConfigfromServer(): Error fetching loginStatus!"),e(!1)}})})})}getPathDisplayUnits(e){return this.serverConfig.pathDisplayUnits()[e]}setPathDisplayUnits(e,t){this.serverConfig.pathDisplayUnits.update(i=>st(ne({},i),{[e]:t}))}clearPathDisplayUnits(e){this.serverConfig.pathDisplayUnits.update(t=>{if(!(e in t))return t;let i=ne({},t);return delete i[e],i})}alignUnitPrefs(e){if(this.config.units.useServerPrefs){if(this.debug("Aligning Unit preferences from server:",e),!e?.categories){this.debug("No Unit preferences available!");return}e.categories.speed&&(this.config.units.speed=["kn","m/s","km/h","mph"].includes(e.categories.speed.targetUnit)?e.categories.speed.targetUnit:this.config.units.speed,Ue.setSymbol(e.categories.speed.targetUnit,e.categories.speed.symbol)),e.categories.temperature&&(this.config.units.temperature=["C","F"].includes(e.categories.temperature.targetUnit)?e.categories.temperature.targetUnit:this.config.units.temperature,Ue.setSymbol(e.categories.temperature.targetUnit,e.categories.temperature.symbol)),e.categories.distance&&(this.config.units.distance=["kilometer","naut-mile"].includes(e.categories.distance.targetUnit)?e.categories.distance.targetUnit:this.config.units.distance,Ue.setSymbol(e.categories.distance.targetUnit,e.categories.distance.symbol)),e.categories.depth&&(this.config.units.depth=["m","foot"].includes(e.categories.depth.targetUnit)?e.categories.depth.targetUnit:this.config.units.depth,Ue.setSymbol(e.categories.depth.targetUnit,e.categories.depth.symbol)),e.categories.length&&(this.config.units.length=["m","foot"].includes(e.categories.length.targetUnit)?e.categories.length.targetUnit:this.config.units.length,Ue.setSymbol(e.categories.length.targetUnit,e.categories.length.symbol))}}initAppIcons(){x5().forEach(e=>{this.iconReg.addSvgIcon(e.id,this.dom.bypassSecurityTrustResourceUrl(e.path))})}parseLaunchUrl(e=window.location){e.search&&e.search.slice(1).split("&").forEach(i=>{let r=i.split("=");this.hostDef.params[r[0]]=r.length>1?r[1]:null}),this.hostDef.name=typeof this.hostDef.params?.host<"u"?this.hostDef.params.host:this.devMode&&Q_.host?Q_.host:e.hostname,this.hostDef.ssl=!!(e.protocol==="https:"||this.devMode&&Q_.ssl),this.hostDef.port=typeof this.hostDef.params.port<"u"?parseInt(this.hostDef.params.port):this.devMode&&Q_.port?Q_.port:parseInt(e.port),this.hostDef.port=isNaN(this.hostDef.port)?this.hostDef.ssl?443:80:this.hostDef.port,this.hostDef.url=`${this.hostDef.ssl?"https:":"http:"}//${this.hostDef.name}:${this.hostDef.port}`,this.kioskMode.update(()=>typeof this.hostDef.params.kiosk<"u"),typeof this.hostDef.params.token<"u"&&this.setAuthToken(this.hostDef.params.token,!1),this.debug("host:",this.hostDef)}testForInternet(){window.fetch("https://tile.openstreetmap.org").then(()=>{console.info("Internet connection detected.")}).catch(()=>{console.warn("No Internet connection detected!");let e=this.config.selections.charts;(e.includes("openstreetmap")||e.includes("openseamap"))&&(this.kioskMode()||this.showAlert("Internet Map Service Unavailable: ",`Unable to display Open Street / Sea Maps!
|
|
753
753
|
|
|
754
754
|
Please check your Internet connection or select maps from the local network.
|
|
755
755
|
|
|
@@ -1515,7 +1515,7 @@ Please login and try again.
|
|
|
1515
1515
|
animation: none !important;
|
|
1516
1516
|
}
|
|
1517
1517
|
`],encapsulation:2})}return n})(),ck=class{index;tab};var WG=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=wi({type:n});static \u0275inj=Ci({imports:[wn]})}return n})();var jC=(n,e)=>e.id;function Mde(n,e){n&1&&(u(0,"mat-error"),_(1," Please enter a name."),h())}function Sde(n,e){if(n&1){let t=H();u(0,"mat-checkbox",24),T("change",function(r){O(t);let o=v(2);return F(o.mask.routes=r.checked)}),_(1,"Hide routes."),h()}if(n&2){let t=v(2);w("checked",t.mask.routes)}}function Tde(n,e){if(n&1){let t=H();u(0,"mat-list-item")(1,"div",25)(2,"div",26),_(3),h(),u(4,"div")(5,"button",27),T("click",function(){let r=O(t).$implicit,o=v(2);return F(o.removeItem("route",r.id))}),u(6,"mat-icon",28),_(7,"delete"),h()()()()()}if(n&2){let t=e.$implicit;f(3),K(" ",t.name," ")}}function Ede(n,e){if(n&1){let t=H();u(0,"mat-checkbox",24),T("change",function(r){O(t);let o=v(2);return F(o.mask.waypoints=r.checked)}),_(1,"Hide waypoints."),h()}if(n&2){let t=v(2);w("checked",t.mask.waypoints)}}function Ide(n,e){if(n&1){let t=H();u(0,"mat-list-item")(1,"div",25)(2,"div",26),_(3),h(),u(4,"div")(5,"button",27),T("click",function(){let r=O(t).$implicit,o=v(2);return F(o.removeItem("waypoint",r.id))}),u(6,"mat-icon",28),_(7,"delete"),h()()()()()}if(n&2){let t=e.$implicit;f(3),K(" ",t.name," ")}}function kde(n,e){if(n&1){let t=H();u(0,"mat-checkbox",24),T("change",function(r){O(t);let o=v(2);return F(o.mask.regions=r.checked)}),_(1,"Hide regions."),h()}if(n&2){let t=v(2);w("checked",t.mask.regions)}}function Dde(n,e){if(n&1){let t=H();u(0,"mat-list-item")(1,"div",25)(2,"div",26),_(3),h(),u(4,"div")(5,"button",27),T("click",function(){let r=O(t).$implicit,o=v(2);return F(o.removeItem("region",r.id))}),u(6,"mat-icon",28),_(7,"delete"),h()()()()()}if(n&2){let t=e.$implicit;f(3),K(" ",t.name," ")}}function Pde(n,e){if(n&1){let t=H();u(0,"mat-list-item")(1,"div",25)(2,"div",26),_(3),h(),u(4,"div")(5,"button",27),T("click",function(){let r=O(t).$implicit,o=v(2);return F(o.removeItem("chart",r.id))}),u(6,"mat-icon",28),_(7,"delete"),h()()()()()}if(n&2){let t=e.$implicit;f(3),K(" ",t.name," ")}}function Rde(n,e){if(n&1&&(u(0,"mat-tab",19),R(1,Sde,2,1,"mat-checkbox",20),u(2,"mat-list"),Ae(3,Tde,8,1,"mat-list-item",null,jC),h()(),u(5,"mat-tab",21),R(6,Ede,2,1,"mat-checkbox",20),u(7,"mat-list"),Ae(8,Ide,8,1,"mat-list-item",null,jC),h()(),u(10,"mat-tab",22),R(11,kde,2,1,"mat-checkbox",20),u(12,"mat-list"),Ae(13,Dde,8,1,"mat-list-item",null,jC),h()(),u(15,"mat-tab",23)(16,"mat-list"),Ae(17,Pde,8,1,"mat-list-item",null,jC),h()()),n&2){let t=v();f(),A(t.gItem.routes.length?-1:1),f(2),Le(t.gItem.routes),f(3),A(t.gItem.waypoints.length?-1:6),f(2),Le(t.gItem.waypoints),f(3),A(t.gItem.regions.length?-1:11),f(2),Le(t.gItem.regions),f(4),Le(t.gItem.charts)}}var UC=class n{gItem;selTab=0;wpts=[];rtes=[];regions=[];charts=[];mask={routes:!1,waypoints:!1,regions:!1,charts:!1};dialogRef=M(ci);skres=M(Mt);destroyRef=M(gi);dialog=M(ln);data=M(_i);constructor(){}ngOnInit(){this.gItem={name:this.data.group.name??"",description:this.data.group.description??"",routes:[],waypoints:[],regions:[],charts:[]}}ngAfterViewInit(){this.mask.routes=!!this.data.group.routes,this.skres.listFromServer("routes").then(e=>{this.data.group.routes&&(e.forEach(t=>{this.data.group.routes.includes(t[0])&&this.gItem.routes.push({id:t[0],name:t[1].name})}),this.sortIt(this.gItem.routes))}),this.mask.waypoints=!!this.data.group.waypoints,this.skres.listFromServer("waypoints").then(e=>{this.data.group.waypoints&&(e.forEach(t=>{this.data.group.waypoints.includes(t[0])&&this.gItem.waypoints.push({id:t[0],name:t[1].name})}),this.sortIt(this.gItem.waypoints))}),this.mask.regions=!!this.data.group.regions,this.skres.listFromServer("regions").then(e=>{this.data.group.regions&&(e.forEach(t=>{this.data.group.regions.includes(t[0])&&this.gItem.regions.push({id:t[0],name:t[1].name})}),this.sortIt(this.gItem.regions))}),this.skres.listFromServer("charts").then(e=>{this.data.group.charts&&(e.forEach(t=>{this.data.group.charts.includes(t[0])&&this.gItem.charts.push({id:t[0],name:t[1].name})}),this.sortIt(this.gItem.charts))}),this.bgLoadResources()}removeItem(e,t){let i=e==="route"?this.gItem.routes:e==="waypoint"?this.gItem.waypoints:e==="region"?this.gItem.regions:e==="chart"?this.gItem.charts:[],r=i.findIndex(o=>o.id===t);r!==-1&&i.splice(r,1)}handleClose(e){e&&(this.data.group.name=this.gItem.name,this.data.group.description=this.gItem.description,this.gItem.routes.length!==0?this.data.group.routes=this.gItem.routes.map(t=>t.id):this.mask.routes?this.data.group.routes=[]:delete this.data.group.routes,this.gItem.waypoints.length!==0?this.data.group.waypoints=this.gItem.waypoints.map(t=>t.id):this.mask.waypoints?this.data.group.waypoints=[]:delete this.data.group.waypoints,this.gItem.regions.length!==0?this.data.group.regions=this.gItem.regions.map(t=>t.id):this.mask.regions?this.data.group.regions=[]:delete this.data.group.regions,this.gItem.charts.length!==0?this.data.group.charts=this.gItem.charts.map(t=>t.id):delete this.data.group.charts),this.dialogRef.close({save:e,group:this.data.group})}tabSelected(e){this.selTab=e}sortIt(e){return e.sort((t,i)=>{let r=t.name?.toLowerCase(),o=i.name?.toLowerCase();return r>o?1:-1})}addResources(){let e,t,i;if(this.selTab===1){e="Routes",t={svgIcon:"route",class:"ob"};let r=this.gItem.routes.map(o=>o.id);i=this.rtes.filter(o=>!r.includes(o.id))}if(this.selTab===2){e="Waypoints",t={name:"location_on"};let r=this.gItem.waypoints.map(o=>o.id);i=this.wpts.filter(o=>!r.includes(o.id))}if(this.selTab===3){e="Regions",t={name:"tab_unselected"};let r=this.gItem.regions.map(o=>o.id);i=this.regions.filter(o=>!r.includes(o.id))}if(this.selTab===4){e="Charts",t={name:"map"};let r=this.gItem.charts.map(o=>o.id);i=this.charts.filter(o=>!r.includes(o.id))}this.dialog.open(uC,{data:{title:`Select ${e}`,icon:t,items:this.sortIt(i)}}).afterClosed().pipe(Zt(this.destroyRef)).subscribe(r=>{r&&(this.selTab===1&&(this.gItem.routes=[].concat(this.gItem.routes,r),this.sortIt(this.gItem.routes)),this.selTab===2&&(this.gItem.waypoints=[].concat(this.gItem.waypoints,r),this.sortIt(this.gItem.waypoints)),this.selTab===3&&(this.gItem.regions=[].concat(this.gItem.regions,r),this.sortIt(this.gItem.regions)),this.selTab===4&&(this.gItem.charts=[].concat(this.gItem.charts,r),this.sortIt(this.gItem.charts)))})}bgLoadResources(){["routes","waypoints","regions","charts"].forEach(e=>{this.skres.listFromServer(e).then(t=>{let i=t.map(r=>({id:r[0],name:r[1].name}));e==="routes"?this.rtes=i:e==="waypoints"?this.wpts=i:e==="regions"?this.regions=i:e==="charts"&&(this.charts=i)})})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["ap-resourcegroupdialog"]],decls:37,vars:7,consts:[["inpname","ngModel"],["inpcmt","ngModel"],[1,"_ap-group"],[2,"background-color","transparent"],[1,"icon-region"],[2,"flex","1 1 auto","text-align","center"],[2,"width","50px","text-align","right"],["mat-icon-button","",3,"click"],["dynamicHeight","false",3,"selectedTabChange"],["label","Details"],[2,"padding-top","10px"],["floatLabel","always",2,"width","100%"],["matInput","","type","text","required","",3,"ngModelChange","ngModel"],["matInput","","rows","3",3,"ngModelChange","ngModel"],["align","end"],[2,"text-align","left","flex","1"],["mat-flat-button","","matTooltip","Add Resource",3,"click","disabled"],[2,"text-align","right","flex","1"],["mat-flat-button","",3,"click","disabled"],["label","Routes"],[3,"checked"],["label","Waypoints"],["label","Regions"],["label","Charts"],[3,"change","checked"],[2,"display","flex"],[2,"flex","1 1 auto","overflow","hidden","text-overflow","ellipsis","whitespace","pre"],["mat-icon-button","","matTooltip","Remove",3,"click"],[1,"icon-warn"]],template:function(t,i){if(t&1){let r=H();u(0,"div",2)(1,"mat-toolbar",3)(2,"div")(3,"mat-icon",4),_(4,"category"),h()(),u(5,"span",5),_(6),h(),u(7,"div",6)(8,"button",7),T("click",function(){return i.handleClose(!1)}),u(9,"mat-icon"),_(10,"close"),h()()()(),u(11,"mat-dialog-content")(12,"mat-tab-group",8),T("selectedTabChange",function(a){return i.tabSelected(a.index)}),u(13,"mat-tab",9)(14,"div",10)(15,"div")(16,"mat-form-field",11)(17,"mat-label"),_(18,"Name"),h(),u(19,"input",12,0),Qt("ngModelChange",function(a){return O(r),Yt(i.gItem.name,a)||(i.gItem.name=a),F(a)}),h(),R(21,Mde,2,0,"mat-error"),h()(),u(22,"div")(23,"mat-form-field",11)(24,"mat-label"),_(25,"Description"),h(),u(26,"textarea",13,1),Qt("ngModelChange",function(a){return O(r),Yt(i.gItem.description,a)||(i.gItem.description=a),F(a)}),_(28," "),h()()()()(),R(29,Rde,19,3),h()(),u(30,"mat-dialog-actions",14)(31,"div",15)(32,"button",16),T("click",function(){return i.addResources()}),_(33," ADD "),h()(),u(34,"div",17)(35,"button",18),T("click",function(){return i.handleClose(!0)}),_(36," SAVE "),h()()()()}if(t&2){let r=Be(20);f(6),K(" ",i.data.addMode?"New Group":"Group Information"," "),f(13),Xt("ngModel",i.gItem.name),f(2),A(r.invalid&&(r.dirty||r.touched)?21:-1),f(5),Xt("ngModel",i.gItem.description),f(3),A(i.data.addMode?-1:29),f(3),w("disabled",i.selTab===0),f(3),w("disabled",r.invalid)}},dependencies:[Dt,qn,fn,po,gn,Pt,ui,Gt,Vt,ho,se,ce,ue,Ze,Fe,di,Oi,ki,WG,uk,UG,An,G1,mo,ye,Te,Fi,cn,Rt,zt],styles:["._ap-group[_ngcontent-%COMP%]{min-width:300px}"]})};var $r=class n{constructor(e,t,i){this.dialog=e;this.signalk=t;this.app=i}dialog;signalk;app;skres=M(Mt);applied=new Oe;applied$=this.applied.asObservable();applyGroup(e,t){return Y(this,null,function*(){if(!GC(t))return[];let i=LG(t,this.app.config.selections),r={routes:()=>this.skres.refreshRoutes(),waypoints:()=>this.skres.refreshWaypoints(),regions:()=>this.skres.refreshRegions(),charts:()=>this.skres.refreshCharts()};return yield Promise.all(i.map(o=>r[o]())),this.app.saveConfig(),this.applied.next({id:e,applied:i}),i})}listFromServer(){return new Promise((e,t)=>{this.signalk.api.get(this.app.skApiVersion,"/resources/groups")?.subscribe(r=>{let o=[];Object.entries(r).forEach(a=>{o.push([a[0],a[1],!1])}),o.sort((a,s)=>{let l=a[1].name?.toLowerCase(),c=s[1].name?.toLowerCase();return l>c?1:-1}),e(o)},r=>t(r))})}fromServer(e){return new Promise((t,i)=>{this.signalk.api.get(this.app.skApiVersion,`/resources/groups/${e}`).subscribe(r=>t(r),r=>i(r))})}deleteFromServer(e){return new Promise((t,i)=>{this.signalk.api.delete(this.app.skApiVersion,`/resources/groups/${e}`).subscribe(()=>t(),r=>i(r))})}putToServer(e,t){return new Promise((i,r)=>{this.signalk.api.put(this.app.skApiVersion,`/resources/groups/${e}`,t).subscribe(o=>i(o),o=>r(o))})}postToServer(e){return new Promise((t,i)=>{this.signalk.api.post(this.app.skApiVersion,"/resources/groups",e).subscribe(r=>t(r),r=>i(r))})}editGroupInfo(e){return Y(this,null,function*(){let t;if(!e)t={name:"",description:"",routes:[],waypoints:[],charts:[],regions:[]};else try{this.app.sIsFetching.set(!0),t=yield this.fromServer(e),this.app.sIsFetching.set(!1)}catch(i){this.app.sIsFetching.set(!1),this.app.parseHttpErrorResponse(i);return}this.dialog.open(UC,{disableClose:!0,data:{addMode:!e,group:t}}).afterClosed().subscribe(i=>{i.save&&(e?this.putToServer(e,i.group).catch(r=>this.app.parseHttpErrorResponse(r)):this.postToServer(i.group))})})}deleteGroup(e){e&&this.app.showConfirm(`Do you want to delete this Group from the server?
|
|
1518
|
-
`,"Delete Group:","YES","NO").subscribe(t=>Y(this,null,function*(){if(t&&t.ok)try{yield this.deleteFromServer(e)}catch(i){this.app.parseHttpErrorResponse(i)}}))}addToGroup(e,t,i){return Y(this,null,function*(){if(!i)return;Array.isArray(i)||(i=[i]);let r=yield this.fromServer(e);if(t==="route"){Array.isArray(r.routes)||(r.routes=[]);let o=i.filter(a=>!r.routes.includes(a));r.routes=r.routes.concat(o)}if(t==="waypoint"){Array.isArray(r.waypoints)||(r.waypoints=[]);let o=i.filter(a=>!r.waypoints.includes(a));r.waypoints=r.waypoints.concat(o)}if(t==="region"){Array.isArray(r.regions)||(r.regions=[]);let o=i.filter(a=>!r.regions.includes(a));r.regions=r.regions.concat(o)}if(t==="chart"){Array.isArray(r.charts)||(r.charts=[]);let o=i.filter(a=>!r.charts.includes(a));r.charts=r.charts.concat(o)}yield this.putToServer(e,r)})}with(e,t){return new Promise((i,r)=>{(!e||!t)&&i([]),this.signalk.api.get(this.app.skApiVersion,"/resources/groups")?.subscribe(a=>{let s=Object.entries(a).filter(l=>Array.isArray(l[1][e])?l[1][e].includes(t):!1);s.sort((l,c)=>{let d=l[1].name?.toLowerCase(),p=c[1].name?.toLowerCase();return d>p?1:-1}),i(s)},a=>r(a))})}static \u0275fac=function(t){return new(t||n)(ut(ln),ut(Lt),ut(oe))};static \u0275prov=Je({token:n,factory:n.\u0275fac,providedIn:"root"})};var HG="fb-plotterext-state",Lde="embedding-host",Ode=1e3,Fde=new Set(["eq","ne","lt","lte","gt","gte","in","contains","regex","exists"]),Nde=n=>!!n&&typeof n=="object"&&typeof n.path=="string"&&n.path.length>0&&Fde.has(n.op),zu=class n{constructor(e,t,i,r,o,a,s,l){this.app=e;this.signalk=t;this.dialog=i;this.skres=r;this.mapService=o;this.routeRegistry=a;this.stream=s;this.skgroups=l;ls()&&(window.fbPlotterExt=this),window.addEventListener("resize",()=>this.viewportTick.update(c=>c+1)),this.bridgeRouteEvents(),this.skgroups.applied$.subscribe(c=>this.broadcastMessage("resourceGroup.applied",c)),Me(()=>this.syncVisibleFromSelections()),Me(()=>this.emitChartChanges(this.skres.charts())),Me(()=>this.emitNightModeChange(this.readNightMode())),Me(()=>this.emitMapViewChange(this.mapView()))}app;signalk;dialog;skres;mapService;routeRegistry;stream;skgroups;manifests=$({});activeWidgets=$([]);initialized=$(!1);viewportTick=$(0);actionButtonLift=Qe(()=>{this.viewportTick();let e=this.activeWidgets().filter(i=>i.anchor==="br");if(!e.length)return 0;let t=e.some(i=>i.row===0)?2:1;return t*H1()+(t-1)*W1+6});statusBarLift=Qe(()=>{this.viewportTick();let e=this.activeWidgets().filter(i=>i.anchor==="cb");if(!e.length)return 0;let t=e.some(i=>i.row===0)?2:1;return t*H1()+(t-1)*W1+4});toolbarTopOffset=Qe(()=>{this.viewportTick();let e=this.activeWidgets().filter(i=>i.anchor==="tr");if(!e.length)return 0;let t=e.some(i=>i.row===1)?2:1;return t*H1()+(t-1)*W1+4});toolbarButtons=Qe(()=>{let e=[];for(let[t,i]of Object.entries(this.manifests()))if(this.isCompatible(i))for(let r of i.buttons??[])r.apiVersion!==void 0&&r.apiVersion!=="1"||e.push({extension:t,extensionName:i.name,button:r});return e});backgroundRuntimes=Qe(()=>{let e=[];for(let[t,i]of Object.entries(this.manifests()))if(this.isCompatible(i))for(let r of i.background??[])r.apiVersion!==void 0&&r.apiVersion!=="1"||r.type!=="iframe"||!r.url||e.push({key:`${t}/${r.id}`,extension:t,extensionName:i.name,runtime:r});return e});openPanels=$([]);visiblePanel=Qe(()=>this.openPanels().find(e=>e.visible)??null);openPanel(e,t){let r=this.manifests()[e]?.panels?.find(a=>a.id===t);if(!r||r.type!=="iframe"||!r.url||r.apiVersion!==void 0&&r.apiVersion!=="1")return!1;let o=`${e}/${t}`;return this.openPanels.update(a=>{let s=a.filter(l=>l.key===o||l.panel.lifecycle==="keepAlive").map(l=>st(ne({},l),{visible:l.key===o}));return s.some(l=>l.key===o)?s:[...s,{key:o,extension:e,panel:r,visible:!0}]}),!0}closeVisiblePanel(){let e=this.openPanels().find(t=>t.visible);e&&this.closePanel(e.key)}closePanel(e){this.openPanels.update(t=>{let i=t.find(r=>r.key===e);return i?i.panel.lifecycle==="keepAlive"?t.map(r=>r.key===e?st(ne({},r),{visible:!1}):r):t.filter(r=>r.key!==e):t})}togglePanel(e,t){let i=`${e}/${t}`;return this.visiblePanel()?.key===i?(this.closeVisiblePanel(),!0):this.openPanel(e,t)}uiPanelMethods(e){let t=i=>{let r=i?.panel;if(!r)throw new jt("panel is required",{code:ji.INVALID_PARAMS,reason:"UNKNOWN_PANEL"});return r};return{"ui.openPanel":i=>Y(this,null,function*(){let r=t(i);if(!this.openPanel(e,r))throw new jt(`No such panel: ${r}`,{code:ji.INVALID_PARAMS,reason:"UNKNOWN_PANEL"});return{}}),"ui.togglePanel":i=>Y(this,null,function*(){let r=t(i);if(!this.togglePanel(e,r))throw new jt(`No such panel: ${r}`,{code:ji.INVALID_PARAMS,reason:"UNKNOWN_PANEL"});return{}})}}handleButtonAction(e,t){let i=t.action;if(!i)return;if(i.type==="sendMessage"){i.topic&&this.broadcastMessage(i.topic,i.params);return}let r=i.panel;r&&(i.type==="togglePanel"?this.togglePanel(e,r):i.type==="openPanel"&&this.openPanel(e,r))}resourceFilters=$({});visibleNotes=Qe(()=>{let e=this.skres.notes(),t=this.resourceFilters().notes;if(!t||!Object.keys(t).length)return e;let i=Object.values(t);return e.filter(([r,o])=>i.every(a=>this.passesFilter(a,r,o)))});filterChips=Qe(()=>{let e=[];for(let[t,i]of Object.entries(this.resourceFilters()))for(let[r,o]of Object.entries(i))e.push({type:t,extension:r,label:o.label??`${this.manifests()[r]?.name??r} filter`});return e});setResourceFilter(e,t,i){this.resourceFilters.update(r=>st(ne({},r),{[t]:st(ne({},r[t]??{}),{[e]:i})})),this.publishToExtension(e,"filters.changed",{type:t,active:!0})}clearResourceFilter(e,t){this.resourceFilters.update(i=>{let r=ne({},i[t]??{});delete r[e];let o=ne({},i);return Object.keys(r).length?o[t]=r:delete o[t],o}),this.publishToExtension(e,"filters.changed",{type:t,active:!1})}passesFilter(e,t,i){let r=!0;return e.ids&&(r=e.ids.includes(t)),r&&e.match&&(r=e.match.every(o=>this.evalCondition(o,i))),e.mode==="exclude"?!r:r}evalCondition(e,t){let i=t;for(let r of e.path.split(".")){if(i===null||typeof i!="object"){i=void 0;break}i=i[r]}switch(e.op){case"exists":return i!==void 0;case"eq":return this.refEquals(i,e.value,e.exact);case"ne":return!this.refEquals(i,e.value,e.exact);case"lt":return typeof i=="number"&&i<e.value;case"lte":return typeof i=="number"&&i<=e.value;case"gt":return typeof i=="number"&&i>e.value;case"gte":return typeof i=="number"&&i>=e.value;case"in":return Array.isArray(e.value)&&e.value.some(r=>this.refEquals(i,r,e.exact));case"contains":return typeof i=="string"?i.toLowerCase().includes(String(e.value).toLowerCase()):Array.isArray(i)&&i.includes(e.value);case"regex":{if(typeof i!="string"||typeof e.value!="string"||i.length>2e3)return!1;let r=this.compileRegex(e.value);return r?r.test(i):!1}default:return!1}}symbolLocalId(e){if(typeof e!="string")return null;let t=/^[A-Za-z0-9_-]+:([^:]+)$/.exec(e);return t?t[1]:null}refEquals(e,t,i){return e===t?!0:i?!1:typeof t=="string"&&!t.includes(":")&&this.symbolLocalId(e)===t||typeof e=="string"&&!e.includes(":")&&this.symbolLocalId(t)===e}compileRegex(e){if(e.length>200)return null;try{return new RegExp(e)}catch(t){return null}}contexts=new Set;embeddingHostDetach=null;ws=null;wsReady=!1;pathRefs=new Map;reconnectTimer=null;pointsFromRoute(e,t){return zC(e,t)}pointsEqual(e,t){return e.length!==t.length?!1:e.every((i,r)=>{let o=t[r];return i.position[0]===o.position[0]&&i.position[1]===o.position[1]&&(i.position[2]??null)===(o.position[2]??null)&&(i.name??null)===(o.name??null)&&(i.description??null)===(o.description??null)&&(i.href??null)===(o.href??null)})}syncVisibleFromSelections(){let e=this.skres.routes(),t=new Set(e.map(i=>i[0]));for(let[i,r]of e){let o=r.feature?.geometry?.coordinates??[],a=r.feature?.properties?.coordinatesMeta,s=this.pointsFromRoute(o,a),l=this.routeRegistry.getByHref(i);if(l){l.saved&&!l.dirty&&((l.name??null)!==(r.name??null)||(l.description??null)!==(r.description??null)||!this.pointsEqual(l.points,s))&&this.routeRegistry.show({routeId:l.routeId,name:r.name??null,description:r.description??null,points:s,href:i});continue}this.routeRegistry.show({routeId:i,name:r.name??null,description:r.description??null,points:s,href:i})}for(let i of this.routeRegistry.all())i.saved&&!i.dirty&&i.href&&!t.has(i.href)&&this.routeRegistry.delete(i.routeId,!0)}bridgeRouteEvents(){this.routeRegistry.events$.subscribe(e=>{switch(e.type){case"visible":this.broadcastMessage("route.visible",{routeId:e.routeId,rev:e.rev,name:e.name,pointCount:e.pointCount,saved:e.saved,dirty:e.dirty});break;case"hidden":this.broadcastMessage("route.hidden",{routeId:e.routeId,rev:e.rev,saved:e.saved});break;case"dirty":this.broadcastMessage("route.dirty",ne({routeId:e.routeId,rev:e.rev},e.reason!==void 0?{reason:e.reason}:{}));break}})}routeMethods(){return DG(this.routeRegistry,{onSave:(e,t)=>this.saveBuffer(e,t),onShow:e=>this.showRoute(e),onHide:e=>this.hideRoute(e),onDelete:e=>this.deleteRoute(e)})}chartMethods(){return PG({listAvailableOrdered:()=>this.skres.chartsForHostApi(),setVisibility:(e,t)=>this.skres.setChartsVisibility(e,t),setOpacity:(e,t)=>this.skres.setChartsOpacity(e,t),setOrder:e=>this.skres.setChartsOrder(e),isTemporal:e=>this.skres.chartIsTemporal(e),setTime:(e,t)=>this.skres.setChartsTime(e,t)})}resourceGroupMethods(){return OG({fetchGroup:e=>this.skgroups.fromServer(e),applyGroup:(e,t)=>this.skgroups.applyGroup(e,t)})}nightModeMethods(){return RG({getState:()=>this.readNightMode(),setState:e=>this.applyNightMode(e)})}readNightMode(){return{enabled:this.stream.selfNightMode()||this.app.uiCtrl().forceNightMode,auto:this.app.config.display.nightMode??!1}}applyNightMode(e){let t=e.auto;if(typeof t=="boolean"){if(t)this.app.uiCtrl.update(r=>st(ne({},r),{forceNightMode:!1}));else if(typeof e.enabled!="boolean"){let r=this.readNightMode().enabled;this.app.uiCtrl.update(o=>st(ne({},o),{forceNightMode:r}))}this.app.config.display.nightMode=t,this.app.uiConfig.update(r=>st(ne({},r),{autoNightMode:t}))}let i=e.enabled;typeof i=="boolean"&&(this.app.config.display.nightMode=!1,this.app.uiConfig.update(r=>st(ne({},r),{autoNightMode:!1})),this.app.uiCtrl.update(r=>st(ne({},r),{forceNightMode:i}))),this.stream.refreshSelfNightMode(),this.emitNightModeChange(this.readNightMode())}prevNightMode=null;emitNightModeChange(e){let t=this.prevNightMode;this.prevNightMode=e,t!==null&&(t.enabled===e.enabled&&t.auto===e.auto||this.broadcastMessage("nightMode.changed",e))}prevChartSnapshot=null;emitChartChanges(e){let t=e.map(d=>d[0]).reverse(),i=new Map(e.map(d=>[d[0],typeof d[1]?.defaultOpacity=="number"?d[1].defaultOpacity:1])),r=new Map(e.map(d=>[d[0],d[1]?.timeValue??null])),o=this.prevChartSnapshot;if(this.prevChartSnapshot={order:t,opacity:i,time:r},!o)return;let a=new Set(o.order),s=new Set(t);for(let d of t)a.has(d)||this.broadcastMessage("chart.visibility",{id:d,visible:!0});for(let d of o.order)s.has(d)||this.broadcastMessage("chart.visibility",{id:d,visible:!1});for(let[d,p]of i){let m=o.opacity.get(d);m!==void 0&&m!==p&&this.broadcastMessage("chart.opacity",{id:d,opacity:p})}for(let[d,p]of r)o.time.has(d)&&o.time.get(d)!==p&&this.broadcastMessage("chart.time",{id:d,time:p});let l=o.order.filter(d=>s.has(d)),c=t.filter(d=>a.has(d));l.length===c.length&&l.some((d,p)=>d!==c[p])&&this.broadcastMessage("chart.order",{order:t})}hideRoute(e){let t=this.routeRegistry.get(e);t&&(t.saved&&t.href?(this.skres.routeHide(t.href),this.routeRegistry.delete(e,!0)):this.routeRegistry.delete(e,!1))}deleteRoute(e){return Y(this,null,function*(){let t=this.routeRegistry.get(e);if(t){if(t.saved&&t.href)try{yield this.skres.deleteFromServer("routes",t.href)}catch(i){throw this.app.parseHttpErrorResponse(i),new jt("Failed to delete route",{reason:"routes.deleteFailed"})}this.routeRegistry.delete(e,!1)}})}showRoute(e){return Y(this,null,function*(){let t=this.routeRegistry.getByHref(e);if(t)return{routeId:t.routeId,rev:t.rev};this.skres.selectionAdd("routes",e),yield this.skres.refreshRoutes();let i=this.skres.fromCache("routes",e);if(!i)throw this.skres.selectionRemove("routes",e),new jt("No such route",{reason:"routes.badRef"});let r=i[1],o=r.feature?.geometry?.coordinates??[],a=r.feature?.properties?.coordinatesMeta,s=this.pointsFromRoute(o,a),l=this.routeRegistry.show({routeId:e,name:r.name??null,description:r.description??null,points:s,href:e});return{routeId:l.routeId,rev:l.rev}})}saveNativeRouteEdit(e,t,i){return Y(this,null,function*(){let r=this.pointsFromRoute(t,i),o=this.routeRegistry.get(e);if(!o){let c=this.skres.fromCache("routes",e),d=c?c[1].name??null:null,p=c?c[1].description??null:null;this.routeRegistry.show({routeId:e,name:d,description:p,points:r,href:e})}this.routeRegistry.replace(e,r),o=this.routeRegistry.get(e);let a=o?.href??e;if(!(yield this.skres.updateRouteCoords(a,t,i)))return;let l=this.routeRegistry.markSaved(e,a)??0;this.broadcastMessage("route.saved",{routeId:e,rev:l,href:a,name:o?.name??null,saved:!0,dirty:!1})})}saveBuffer(i){return Y(this,arguments,function*(e,t={}){let r=this.routeRegistry.get(e);if(!r)return null;let[,o]=this.skres.buildRoute(r.points.map(p=>p.position)),a=sg(r.points);a&&(o.feature.properties.coordinatesMeta=a),o.name=t.name??r.name??"",o.description=t.description??r.description??"",t.temporary&&!r.href&&(o.feature.properties.temporary=EG(new Date));let s=r.href?this.skres.fromCache("routes",r.href)?.[1]:void 0;Zp(s)&&!t.promote&&(o.feature.properties.temporary=s.feature.properties.temporary);let l;if(r.href)try{yield this.skres.putToServer("routes",r.href,o),l=r.href}catch(p){throw this.app.parseHttpErrorResponse(p),new jt("Failed to save route",{reason:"routes.saveFailed"})}else if(t.dialog)try{l=yield this.skres.saveNewRoute(o)}catch(p){throw new jt("Failed to save route",{reason:"routes.saveFailed"})}else try{l=(yield this.skres.postToServer("routes",o)).id,this.skres.selectionAdd("routes",l)}catch(p){throw this.app.parseHttpErrorResponse(p),new jt("Failed to save route",{reason:"routes.saveFailed"})}if(!l)return null;let c=o.name||null,d=this.routeRegistry.markSaved(e,l,c,o.description||null)??r.rev+1;return this.broadcastMessage("route.saved",{routeId:e,rev:d,href:l,name:c,saved:!0,dirty:!1}),this.app.data.editingId="",{href:l,rev:d}})}init(){return Y(this,null,function*(){try{let e=yield rs(this.signalk.api.get(this.app.skApiVersion,"/resources/plotterExtensions")),t={};if(e&&typeof e=="object")for(let[i,r]of Object.entries(e))this.isManifest(r)&&(t[i]=r);this.manifests.set(t)}catch(e){this.manifests.set({})}this.refreshActiveWidgets(),this.initialized.set(!0),this.attachEmbeddingHostOnce()})}isCompatible(e){return e.apiVersion!=="1"?!1:(e.requires??[]).every(t=>Jw.includes(t))}isManifest(e){return typeof e=="object"&&e!==null&&typeof e.name=="string"&&typeof e.apiVersion=="string"}widgetDef(e,t){return this.manifests()[e]?.widgets?.find(r=>r.id===t)??null}placements(){return this.app.config.plotterExtensions.widgets}occupancy(e){let{cols:t,rows:i}=U1[e],r=Array.from({length:i},()=>Array.from({length:t},()=>!1));for(let o of this.activeWidgets()){if(o.anchor!==e)continue;let a=this.widgetDef(o.extension,o.widget),s=tM(a?.size??"1x1");for(let l=o.row;l<o.row+s.rows&&l<i;l++)for(let c=o.col;c<o.col+s.cols&&c<t;c++)r[l][c]=!0}return r}cellOccupied(e,t){return this.occupancy(e)[t.row]?.[t.col]??!0}isValidOrigin(e,t,i,r){let{cols:o,rows:a}=U1[e];if(i.col+t.cols>o||i.row+t.rows>a)return!1;for(let s=i.row;s<i.row+t.rows;s++)for(let l=i.col;l<i.col+t.cols;l++)if(r[s][l])return!1;if(t.rows===1){let s=eM[e]==="bottom"?a-1:0;if(i.row!==s){for(let l=i.col;l<i.col+t.cols;l++)if(!r[s][l])return!1}}return!0}originOrder(e){let t=U1[e].rows,i=Array.from({length:t},(s,l)=>l),r=eM[e]==="bottom"?[...i].reverse():i,o=KD[e],a=[];for(let s of r)for(let l of o)a.push({col:l,row:s});return a}findOrigin(e,t,i){let r=tM(t.size),o=this.occupancy(e);for(let a of this.originOrder(e))if(this.isValidOrigin(e,r,a,o)&&!(i&&!(i.col>=a.col&&i.col<a.col+r.cols&&i.row>=a.row&&i.row<a.row+r.rows)))return a;return null}addableWidgets(e,t){let i=[];for(let[r,o]of Object.entries(this.manifests()))if(this.isCompatible(o))for(let a of o.widgets??[]){if(a.type!=="iframe"||a.apiVersion!==void 0&&a.apiVersion!=="1")continue;let s=this.findOrigin(e,a,t);s&&i.push({extension:r,extensionName:o.name,widget:a,origin:s})}return i}hitTester=null;registerHitTester(e){return this.hitTester=e,()=>{this.hitTester===e&&(this.hitTester=null)}}addableCellAt(e,t){let i=this.hitTester?.(e,t);return!i||this.cellOccupied(i.anchor,i.cell)||!this.addableWidgets(i.anchor,i.cell).length?null:i}openAddWidgetPicker(e,t){return Y(this,null,function*(){let i=this.addableWidgets(e,t);if(!i.length)return;let{PlotterAddWidgetDialog:r}=yield import("./chunk-OVB2ZLN5.js");this.dialog.open(r,{data:{anchor:e,candidates:i},width:"340px"}).afterClosed().subscribe(o=>{if(!o)return;let a=this.placeWidget(o.extension,o.widget,e,o.origin);this.widgetHasConfigPanel(a)&&this.openConfigPanel(a)})})}placeWidget(e,t,i,r){let o={instanceId:ek(),extension:e,widget:t.id,anchor:i,col:r.col,row:r.row};return this.app.config.plotterExtensions.widgets.push(o),this.app.saveConfig(),this.refreshActiveWidgets(),o}removeWidget(e){let t=this.app.config.plotterExtensions.widgets,i=t.findIndex(r=>r.instanceId===e);if(i!==-1){let[r]=t.splice(i,1);this.clearInstanceState(r.extension,e),this.app.saveConfig(),this.refreshActiveWidgets()}}refreshActiveWidgets(){let e=this.manifests();this.activeWidgets.set(this.placements().filter(t=>{let i=e[t.extension];return i&&this.isCompatible(i)&&i.widgets?.some(r=>r.id===t.widget&&(r.apiVersion===void 0||r.apiVersion==="1"))}))}resolveAssetUrl(e){let t=this.app.hostDef?.url||window.location.origin;try{let i=new URL(t),r=new URL(e,t);return r.protocol!=="http:"&&r.protocol!=="https:"||r.origin!==i.origin?"about:blank":r.toString()}catch(i){return"about:blank"}}assetOrigin(e){try{return new URL(this.resolveAssetUrl(e)).origin}catch(t){return"*"}}attachWidget(e,t){let i={extension:t.extension,conn:null,skSubs:new Map,skSubSeq:0},r=this.widgetDef(t.extension,t.widget)?.url??"";return i.conn=new og({port:rg(e.contentWindow,{origin:this.assetOrigin(r)}),hostInfo:this.hostInfo(),context:{kind:"widget",id:t.widget,instanceId:t.instanceId,targetInstance:null},methods:st(ne(ne(ne(ne(ne(ne(ne(ne(ne(ne({},this.stateMethods(t.extension,t.instanceId)),this.signalkMethods(i)),this.unitsMethods()),this.resourcesMethods(t.extension)),this.mapMethods()),this.routeMethods()),this.chartMethods()),this.nightModeMethods()),this.resourceGroupMethods()),this.uiPanelMethods(t.extension)),{"ui.openConfigPanel":()=>Y(this,null,function*(){return this.openConfigPanel(t),{}}),"ui.toggleConfigPanel":()=>Y(this,null,function*(){return this.toggleConfigPanel(t),{}})}),onError:o=>console.warn("plotterext widget error",o)}),this.contexts.add(i),()=>this.detach(i)}attachPanel(e,t){let i={extension:t.extension,conn:null,skSubs:new Map,skSubSeq:0};return i.conn=new og({port:rg(e.contentWindow,{origin:this.assetOrigin(t.panel.url??"")}),hostInfo:this.hostInfo(),context:{kind:"panel",id:t.panel.id,instanceId:null,targetInstance:t.targetInstance??null,targetWidget:t.targetWidget??null},methods:st(ne(ne(ne(ne(ne(ne(ne(ne(ne(ne({},this.stateMethods(t.extension,t.targetInstance??null)),this.signalkMethods(i)),this.unitsMethods()),this.resourcesMethods(t.extension)),this.mapMethods()),this.routeMethods()),this.chartMethods()),this.nightModeMethods()),this.resourceGroupMethods()),this.uiPanelMethods(t.extension)),{"ui.closePanel":()=>Y(this,null,function*(){return t.close(),{}})}),onError:r=>console.warn("plotterext panel error",r)}),this.contexts.add(i),()=>this.detach(i)}attachBackground(e,t){let i={extension:t.extension,conn:null,skSubs:new Map,skSubSeq:0};return i.conn=new og({port:rg(e.contentWindow,{origin:this.assetOrigin(t.runtime.url)}),hostInfo:this.hostInfo(),context:{kind:"background",id:t.runtime.id,instanceId:null},methods:ne(ne(ne(ne(ne(ne(ne(ne(ne(ne({},this.stateMethods(t.extension,null)),this.signalkMethods(i)),this.unitsMethods()),this.resourcesMethods(t.extension)),this.mapMethods()),this.routeMethods()),this.chartMethods()),this.nightModeMethods()),this.resourceGroupMethods()),this.uiPanelMethods(t.extension)),onError:r=>console.warn("plotterext background error",r)}),this.contexts.add(i),()=>this.detach(i)}attachEmbeddingHost(e=rg(window.parent,{origin:window.location.origin})){let t=Lde,i={extension:t,conn:null,skSubs:new Map,skSubSeq:0};return i.conn=new og({port:e,hostInfo:this.hostInfo(),adoptCallerId:!0,context:{kind:"embedding-host",id:t,instanceId:null},methods:ne(ne(ne(ne(ne(ne(ne(ne(ne(ne({},this.stateMethods(t,null)),this.signalkMethods(i)),this.unitsMethods()),this.resourcesMethods(t)),this.mapMethods()),this.routeMethods()),this.chartMethods()),this.nightModeMethods()),this.resourceGroupMethods()),this.uiPanelMethods(t)),onError:r=>console.warn("plotterext embedding-host error",r)}),this.contexts.add(i),()=>this.detach(i)}attachEmbeddingHostOnce(){this.embeddingHostDetach||this.app.isTopWindow()||(this.embeddingHostDetach=this.attachEmbeddingHost())}detach(e){if(this.contexts.has(e)){this.contexts.delete(e);for(let[,t]of e.skSubs)this.releasePaths(t);e.skSubs.clear(),e.conn.close()}}hostInfo(){return{host:"freeboard-sk",hostVersion:this.app.data?.server?.version??"dev",apiVersion:"1",capabilities:Jw}}configDialogRef=null;configDialogInstance=null;widgetHasConfigPanel(e){let t=this.manifests()[e.extension],i=this.widgetDef(e.extension,e.widget),r=t?.panels?.find(o=>o.id===i?.configPanel);return!!(r&&r.type==="iframe"&&r.url)}openConfigPanel(e){let t=this.manifests()[e.extension],i=this.widgetDef(e.extension,e.widget),r=t?.panels?.find(a=>a.id===i?.configPanel),o=r&&r.type==="iframe"&&r.url&&(r.apiVersion===void 0||r.apiVersion==="1")?r:null;import("./chunk-3KP5HHSO.js").then(({PlotterPanelDialog:a})=>{let s=this.dialog.open(a,{data:{extension:e.extension,panel:o,title:i?.title??e.widget,targetInstance:e.instanceId,targetWidget:e.widget},width:"440px",maxHeight:"85vh"});this.configDialogRef=s,this.configDialogInstance=e.instanceId,s.afterClosed().subscribe(()=>{this.configDialogRef===s&&(this.configDialogRef=null,this.configDialogInstance=null)})})}toggleConfigPanel(e){if(this.configDialogRef&&this.configDialogInstance===e.instanceId){this.configDialogRef.close();return}this.openConfigPanel(e)}loadStore(){try{return JSON.parse(localStorage.getItem(HG)??"{}")}catch(e){return{}}}saveStore(e){localStorage.setItem(HG,JSON.stringify(e))}clearInstanceState(e,t){let i=this.loadStore();i[e]?.instances?.[t]&&(delete i[e].instances[t],this.saveStore(i))}stateMethods(e,t){let i=(r,o)=>{let a=r[e]=r[e]??{};if((o??(t?"instance":"extension"))==="instance"){if(!t)throw new jt("No widget instance in scope",{code:ji.INVALID_PARAMS,reason:"NO_INSTANCE"});return a.instances=a.instances??{},a.instances[t]=a.instances[t]??{}}return a.extension=a.extension??{}};return{"state.get":r=>Y(this,null,function*(){let{scope:o,keys:a}=r??{},s=i(this.loadStore(),o);if(!a)return{values:s};let l={};for(let c of a)c in s&&(l[c]=s[c]);return{values:l}}),"state.set":r=>Y(this,null,function*(){let{scope:o,values:a}=r??{};if(!a||typeof a!="object")throw new jt("state.set requires a values object",{code:ji.INVALID_PARAMS,reason:"INVALID_VALUES"});let s=this.loadStore(),l=i(s,o);Object.assign(l,a),this.saveStore(s);let c=(o??(t?"instance":"extension"))==="instance";return this.publishToExtension(e,"state.changed",{scope:c?"instance":"extension",instanceId:c?t:null,keys:Object.keys(a)}),{}})}}publishToExtension(e,t,i){for(let r of this.contexts)r.extension===e&&r.conn.publish(t,i)}broadcastMessage(e,t){for(let i of this.contexts)i.conn.publish(e,t)}resourcesMethods(e){return{"resources.list":t=>Y(this,null,function*(){let{type:i,query:r}=t??{};if(typeof i!="string"||!/^[A-Za-z][A-Za-z0-9_-]*$/.test(i))throw new jt("resources.list requires a resource type",{code:ji.INVALID_PARAMS,reason:"INVALID_TYPE"});let o=this.serializeQuery(r);try{return(yield rs(this.signalk.api.get(this.app.skApiVersion,`/resources/${i}${o}`)))??{}}catch(a){throw new jt(`resources.list ${i} failed`,{reason:"LIST_FAILED",data:{message:a?.message}})}}),"resources.setFilter":t=>Y(this,null,function*(){let{type:i,filter:r}=t??{};if(typeof i!="string"||!r||r.mode!=="include"&&r.mode!=="exclude"||r.ids===void 0&&r.match===void 0||r.ids!==void 0&&(!Array.isArray(r.ids)||!r.ids.every(o=>typeof o=="string"))||r.match!==void 0&&(!Array.isArray(r.match)||!r.match.every(Nde)))throw new jt("resources.setFilter requires a type and a filter with mode plus ids and/or match",{code:ji.INVALID_PARAMS,reason:"INVALID_FILTER"});return this.setResourceFilter(e,i,r),{}}),"resources.clearFilter":t=>Y(this,null,function*(){let{type:i}=t??{};if(typeof i!="string")throw new jt("resources.clearFilter requires a type",{code:ji.INVALID_PARAMS,reason:"INVALID_TYPE"});return this.clearResourceFilter(e,i),{}})}}serializeQuery(e){if(!e||typeof e!="object")return"";let t=[];for(let[i,r]of Object.entries(e)){if(r==null)continue;let o=Array.isArray(r)?JSON.stringify(r):String(r);t.push(`${encodeURIComponent(i)}=${encodeURIComponent(o)}`)}return t.length?`?${t.join("&")}`:""}mapView(){let e=this.app.mapExtent();return{center:this.app.config.map.center,zoom:this.app.config.map.zoomLevel,bounds:ng(e)??e}}prevMapView=null;emitMapViewChange(e){let t=this.prevMapView;this.prevMapView=e,!(t===null||t.zoom===e.zoom&&t.center[0]===e.center[0]&&t.center[1]===e.center[1]&&t.bounds.length===e.bounds.length&&t.bounds.every((r,o)=>r===e.bounds[o]))&&this.broadcastMessage("map.view",e)}mapMethods(){return{"map.getView":()=>Y(this,null,function*(){return this.mapView()}),"map.center":e=>Y(this,null,function*(){let{position:t,zoom:i}=e??{};if(!Array.isArray(t)||t.length!==2||!t.every(r=>typeof r=="number"))throw new jt("map.center requires position [lon, lat]",{code:ji.INVALID_PARAMS,reason:"INVALID_POSITION"});return this.app.mapMoveRequest.set(ne({center:t},typeof i=="number"?{zoom:i}:{})),{}}),"map.fitBounds":e=>Y(this,null,function*(){let t=ng(e?.bounds);if(!t)throw new jt("map.fitBounds requires bounds [west, south, east, north]",{code:ji.INVALID_PARAMS,reason:"INVALID_BOUNDS"});return this.app.mapMoveRequest.set(this.fitView(t)),{}})}}fitView(e){let t=this.mapService.getMaps()[0],i=t?.getSize(),r={min:this.app.MAP_ZOOM_EXTENT?.min??0,max:Math.min(this.app.MAP_ZOOM_EXTENT?.max??18,ey)};return!t||!i?{center:Mg(e,[1,1],r).center,zoom:12}:Mg(e,[i[0],i[1]],r,t.getView().getRotation())}pulseMapResize(e=320){let t=0,i=()=>{this.mapService.updateSize(),t+=16,t<e&&requestAnimationFrame(i)};requestAnimationFrame(i)}unitsMethods(){return{"units.get":()=>Y(this,null,function*(){let e=this.app.config.units;return{units:{speed:e.speed,distance:e.distance,depth:e.depth,length:e.length,temperature:e.temperature}}})}}signalkMethods(e){return{"signalk.subscribe":t=>Y(this,null,function*(){let{paths:i}=t??{};if(!Array.isArray(i)||i.length===0||!i.every(o=>typeof o=="string"&&o.length>0&&!o.includes("*")))throw new jt("signalk.subscribe requires an array of literal Signal K paths",{code:ji.INVALID_PARAMS,reason:"INVALID_PATHS"});let r=`sk-${++e.skSubSeq}`;return e.skSubs.set(r,i),this.acquirePaths(i),{subscriptionId:r}}),"signalk.unsubscribe":t=>Y(this,null,function*(){let{subscriptionId:i}=t??{},r=i?e.skSubs.get(i):null;if(!r)throw new jt("Unknown subscriptionId",{code:ji.INVALID_PARAMS,reason:"UNKNOWN_SUBSCRIPTION"});return e.skSubs.delete(i),this.releasePaths(r),{}}),"signalk.put":t=>Y(this,null,function*(){let{path:i,value:r}=t??{};if(typeof i!="string"||!i.length)throw new jt("signalk.put requires a path",{code:ji.INVALID_PARAMS,reason:"INVALID_PATH"});try{return(yield rs(this.signalk.api.put(1,`vessels/self/${i.split(".").join("/")}`,r)))??{}}catch(o){throw new jt(`PUT ${i} failed`,{reason:"PUT_FAILED",data:{message:o?.message}})}})}}acquirePaths(e){let t=[];for(let i of e){let r=this.pathRefs.get(i)??0;this.pathRefs.set(i,r+1),r===0&&t.push(i)}t.length&&(this.ensureSocket(),this.sendSubscribe(t))}releasePaths(e){let t=[];for(let i of e){let r=this.pathRefs.get(i)??0;r<=1?(this.pathRefs.delete(i),t.push(i)):this.pathRefs.set(i,r-1)}t.length&&this.wsReady&&this.wsSend({context:"vessels.self",unsubscribe:t.map(i=>({path:i}))}),this.pathRefs.size===0&&this.closeSocket()}ensureSocket(){if(this.ws)return;let e=this.app.data?.server?this.signalk.server?.endpoints?.v1?.["signalk-ws"]:null;if(!e){console.warn("plotterext: no signalk-ws endpoint available");return}let t=`${e}?subscribe=none`,i=this.app.getFBToken();i&&(t+=`&token=${i}`);let r=new WebSocket(t);this.ws=r,r.onopen=()=>{this.wsReady=!0;let o=[...this.pathRefs.keys()];o.length&&this.sendSubscribe(o)},r.onmessage=o=>this.handleDelta(o.data),r.onclose=()=>{this.ws===r&&(this.ws=null,this.wsReady=!1,this.pathRefs.size&&!this.reconnectTimer&&(this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.ensureSocket()},3e3)))},r.onerror=()=>{}}closeSocket(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null);let e=this.ws;this.ws=null,this.wsReady=!1,e?.close()}sendSubscribe(e){this.wsReady&&this.wsSend({context:"vessels.self",subscribe:e.map(t=>({path:t,period:Ode,policy:"instant",minPeriod:200}))})}wsSend(e){this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify(e))}handleDelta(e){let t;try{t=JSON.parse(e)}catch(i){return}if(Array.isArray(t.updates)){for(let i of t.updates)if(Array.isArray(i.values))for(let r of i.values){if(!r?.path||!this.pathRefs.has(r.path))continue;let o={path:r.path,value:r.value,timestamp:i.timestamp,$source:i.$source??i.source?.label};for(let a of this.contexts)a.conn.publish(`sk.${r.path}`,o)}}}static \u0275fac=function(t){return new(t||n)(ut(oe),ut(Lt),ut(ln),ut(Mt),ut(ys),ut(pl),ut(es),ut($r))};static \u0275prov=Je({token:n,factory:n.\u0275fac,providedIn:"root"})};function Bde(n,e){if(n&1&&z(0,"wpt-button",1),n&2){let t=v();w("position",t.app.data.vessels.self.position)("active",t.app.data.vessels.showSelf)}}function Vde(n,e){n&1&&z(0,"pob-button")}function Gde(n,e){if(n&1&&z(0,"autopilot-button",2),n&2){let t=v();w("active",t.app.featureFlags().autopilotApi&&t.app.data.vessels.self.autopilot.default)}}function zde(n,e){if(n&1){let t=H();u(0,"radar-button",3),T("click",function(){O(t);let r=v();return F(r.radarClick.emit())}),h()}if(n&2){let t=v();w("active",t.app.featureFlags().radarApi&&t.radarApi.radarId().length!==0)}}var $G=class n{action=Z();radarClick=xe();app=M(oe);radarApi=M(Sc);plotterExt=M(zu);bottomOffset=Qe(()=>{let e=this.plotterExt.actionButtonLift();return e>0?e:23});constructor(){}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["mfb-container"]],inputs:{action:[1,"action"]},outputs:{radarClick:"radarClick"},decls:5,vars:6,consts:[[1,"mfb-container"],[3,"position","active"],[3,"active"],[3,"click","active"]],template:function(t,i){t&1&&(u(0,"div",0),R(1,Bde,1,2,"wpt-button",1),R(2,Vde,1,0,"pob-button"),R(3,Gde,1,1,"autopilot-button",2),R(4,zde,1,1,"radar-button",2),h()),t&2&&(vt("bottom",i.bottomOffset(),"px"),f(),A(i.action()==="wpt"?1:-1),f(),A(i.action()==="pob"?2:-1),f(),A(i.action()==="autopilot"?3:-1),f(),A(i.action()==="radar"?4:-1))},dependencies:[OC,FC,NC,BC],styles:[".mfb-container[_ngcontent-%COMP%]{position:absolute;bottom:23px;right:5px;z-index:5000}"]})};function KG(n,e=10){let t=n.anchorY-n.top,i=n.bottom-n.anchorY;return t>=n.height+e?{placement:"top"}:i>=n.height+e?{placement:"bottom"}:i>t?{placement:"bottom",maxHeight:Math.max(i-e,0)}:{placement:"top",maxHeight:Math.max(t-e,0)}}var jde=["box"],Ude=["*"],Wde=(n,e,t)=>({measure:n,compact:e,docked:t}),Hde=n=>({measure:n});function $de(n,e){if(n&1&&(u(0,"mat-icon"),z(1,"country-flag",8),h()),n&2){let t=v(2);f(),w("mmsi",t.mmsi)("host",t.app.hostDef.url)}}function Kde(n,e){if(n&1&&z(0,"mat-icon",9),n&2){let t=v(2);Et(t.icon==null?null:t.icon.class),w("svgIcon",t.icon.svgIcon)}}function qde(n,e){if(n&1&&(u(0,"mat-icon"),_(1),h()),n&2){let t=v(2);Et(t.icon==null?null:t.icon.class),f(),X(t.icon==null?null:t.icon.name)}}function Zde(n,e){if(n&1&&_(0),n&2){let t=v(2);K(" \xA0",t.title," ")}}function Xde(n,e){if(n&1){let t=H();u(0,"div")(1,"button",10),T("click",function(){O(t);let r=v(2);return F(r.handleClose())}),u(2,"mat-icon"),_(3,"close"),h()()()}}function Yde(n,e){if(n&1){let t=H();u(0,"div")(1,"button",11),T("click",function(){O(t);let r=v(2);return F(r.handleNavTo())}),u(2,"mat-icon"),_(3,"near_me"),h()()()}}function Qde(n,e){if(n&1&&(u(0,"div",2)(1,"div",5),R(2,$de,2,2,"mat-icon"),R(3,Kde,1,3,"mat-icon",6)(4,qde,2,3,"mat-icon",7),R(5,Zde,1,1),h(),R(6,Xde,4,0,"div"),R(7,Yde,4,0,"div"),h()),n&2){let t=v();f(),w("ngClass",Gi(6,Hde,t.measure)),f(),A(t.mmsi?2:-1),f(),A(t.icon!=null&&t.icon.svgIcon?3:t.icon!=null&&t.icon.name?4:-1),f(2),A(t.title?5:-1),f(),A(t.canClose?6:-1),f(),A(!t.canClose&&t.navTo?7:-1)}}var jn=class n{title;mmsi;icon;canClose=!0;measure=!1;compact=!1;docked=!1;navTo=!1;closed=new me;navigateTo=new me;box;app=M(oe);placement=$("top");overlay=M(Su,{optional:!0});resizeObserver;constructor(){ss(()=>{this.updatePlacement(),typeof ResizeObserver<"u"&&(this.resizeObserver=new ResizeObserver(()=>this.updatePlacement()),this.resizeObserver.observe(this.box.nativeElement))}),this.overlay?.repositioned.pipe(Zt()).subscribe(()=>this.updatePlacement()),M(gi).onDestroy(()=>this.resizeObserver?.disconnect())}updatePlacement(){let e=this.box?.nativeElement,t=e?.offsetParent;if(this.docked||!t)return;e.style.maxHeight="";let i=e.closest(".ol-viewport")?.getBoundingClientRect(),r=KG({anchorY:t.getBoundingClientRect().top,height:e.getBoundingClientRect().height,top:Math.max(i?.top??0,0),bottom:Math.min(i?.bottom??window.innerHeight,window.innerHeight)}),o=r.maxHeight!==void 0;e.style.maxHeight=o?`${r.maxHeight}px`:"",e.classList.toggle("capped",o),this.placement.set(r.placement)}handleClose(){this.closed.emit()}handleNavTo(){this.navigateTo.emit()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["ap-popover"]],viewQuery:function(t,i){if(t&1&&Ot(jde,7),t&2){let r;Ee(r=Ie())&&(i.box=r.first)}},inputs:{title:"title",mmsi:"mmsi",icon:"icon",canClose:"canClose",measure:"measure",compact:"compact",docked:"docked",navTo:"navTo"},outputs:{closed:"closed",navigateTo:"navigateTo"},ngContentSelectors:Ude,decls:6,vars:10,consts:[["box",""],[1,"popover","in","mat-app-background",3,"ngClass"],[1,"popover-title"],[1,"popover-content"],[1,"arrow",2,"left","50%"],[2,"flex","1 1 auto","overflow","hidden","display","-webkit-box","-webkit-box-orient","vertical","-webkit-line-clamp","1","line-clamp","1","text-overflow","ellipsis",3,"ngClass"],[3,"class","svgIcon"],[3,"class"],[3,"mmsi","host"],[3,"svgIcon"],["mat-icon-button","",3,"click"],["mat-icon-button","","matTooltip","Navigate to here",3,"click"]],template:function(t,i){t&1&&(fe(),u(0,"div",1,0),R(2,Qde,8,8,"div",2),u(3,"div",3),de(4),h(),z(5,"div",4),h()),t&2&&(ht("top",i.placement()==="top")("bottom",i.placement()==="bottom"),w("ngClass",nh(6,Wde,i.measure,i.compact,i.docked)),f(2),A(i.title||i.icon||i.mmsi||i.canClose||i.navTo?2:-1))},dependencies:[mn,Rn,ue,Fe,ye,Te,se,ce,LC],styles:['.popover[_ngcontent-%COMP%]{position:absolute;top:0;left:0;transform:translate(-50%,-100%);z-index:3990;display:block;max-width:276px;min-width:270px;padding:1px;font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;-webkit-background-clip:padding-box;background-clip:padding-box;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px #0003;line-break:auto}.popover.top[_ngcontent-%COMP%]{margin-top:-10px;margin-left:10px}.popover.bottom[_ngcontent-%COMP%]{transform:translate(-50%);margin-top:10px;margin-left:10px}.popover-title[_ngcontent-%COMP%]{padding:2px 0 2px 5px;margin:0;display:flex;line-height:2.5em;font-size:12pt;background-color:#fafafa82;border-radius:5px 5px 0 0;min-width:110px}.popover-content[_ngcontent-%COMP%]{padding:9px 14px;max-height:330px;overflow:auto}.popover.capped[_ngcontent-%COMP%]{display:flex;flex-direction:column}.popover.capped[_ngcontent-%COMP%] > .popover-title[_ngcontent-%COMP%]{flex-shrink:0}.popover.capped[_ngcontent-%COMP%] > .popover-content[_ngcontent-%COMP%]{flex:1 1 auto;min-height:0}.popover[_ngcontent-%COMP%] > .arrow[_ngcontent-%COMP%], .popover[_ngcontent-%COMP%] > .arrow[_ngcontent-%COMP%]:after{position:absolute;display:block;width:0;height:0;border-style:solid}.popover[_ngcontent-%COMP%] > .arrow[_ngcontent-%COMP%]{border-width:11px}.popover[_ngcontent-%COMP%] > .arrow[_ngcontent-%COMP%]:after{content:"";border-width:10px}.popover.top[_ngcontent-%COMP%] > .arrow[_ngcontent-%COMP%]{bottom:-11px;left:50%;margin-left:-11px;border-bottom-width:0;border-right-width:0;border-left-width:0}.popover.top[_ngcontent-%COMP%] > .arrow[_ngcontent-%COMP%]:after{bottom:1px;margin-left:-10px;content:" ";border-bottom-width:0}.popover.bottom[_ngcontent-%COMP%] > .arrow[_ngcontent-%COMP%]{top:-11px;left:50%;margin-left:-11px;border-top-width:0;border-right-width:0;border-left-width:0}.popover.bottom[_ngcontent-%COMP%] > .arrow[_ngcontent-%COMP%]:after{top:1px;margin-left:-10px;content:" ";border-top-width:0}.popover.measure[_ngcontent-%COMP%]{min-width:100px;background-color:#39c}.popover.measure[_ngcontent-%COMP%] > .popover-content[_ngcontent-%COMP%]{display:none}.popover.measure[_ngcontent-%COMP%] > .popover-title[_ngcontent-%COMP%]{color:#fff;font-weight:700;border-bottom:none;background-color:inherit;text-align:left;width:max-content}.popover.top.measure[_ngcontent-%COMP%] > .arrow[_ngcontent-%COMP%]{bottom:-11px;left:50%;margin-left:-11px;border-bottom-width:0;border-right-width:0;border-left-width:0}.popover.top.measure[_ngcontent-%COMP%] > .arrow[_ngcontent-%COMP%]:after{bottom:1px;margin-left:-10px;content:" ";border-bottom-width:0;border-top-color:#39c}.popover.bottom.measure[_ngcontent-%COMP%] > .arrow[_ngcontent-%COMP%]:after{border-bottom-color:#39c}.popover-action-button[_ngcontent-%COMP%]{flex:1 1 45%}.popover.docked[_ngcontent-%COMP%]{position:static;transform:none;margin:0}.popover.docked[_ngcontent-%COMP%] > .arrow[_ngcontent-%COMP%]{display:none}.popover.compact[_ngcontent-%COMP%]{min-width:0;max-width:170px;width:fit-content}.popover.compact[_ngcontent-%COMP%] > .popover-title[_ngcontent-%COMP%]{padding:0;line-height:0;min-height:0;min-width:unset}.popover.compact[_ngcontent-%COMP%] > .popover-content[_ngcontent-%COMP%]{padding:6px 10px}'],changeDetection:0})};var Jde=n=>({class:"",name:n});function eue(n,e){if(n&1&&(u(0,"li"),_(1),h()),n&2){let t=e.$implicit;f(),X(t)}}function tue(n,e){if(n&1&&(u(0,"ol",4),Ae(1,eue,2,1,"li",null,wt),h()),n&2){let t=v(2);f(),Le(t.mode.steps)}}function iue(n,e){if(n&1){let t=H();u(0,"div",0)(1,"ap-popover",2),T("closed",function(){O(t);let r=v();return F(r.close())}),z(2,"fb-measurements",3),R(3,tue,3,0,"ol",4),u(4,"div",5)(5,"div",6)(6,"button",7),T("click",function(){O(t);let r=v();return F(r.undoLast())}),u(7,"mat-icon"),_(8,"undo"),h(),_(9," UNDO "),h()(),u(10,"div",6)(11,"button",8),T("click",function(){O(t);let r=v();return F(r.finishEditing())}),u(12,"mat-icon"),_(13,"check"),h(),_(14),h()(),u(15,"div",6)(16,"button",9),T("click",function(){O(t);let r=v();return F(r.close())}),u(17,"mat-icon",10),_(18,"close"),h(),_(19," CANCEL "),h()()()()()}if(n&2){let t=v();f(),w("docked",!0)("canClose",!0)("title",t.mode.iconText)("icon",Gi(13,Jde,t.mode.iconName)),f(),w("coords",t.mapInteract.measurement().coords)("index",t.mapInteract.measurement().index)("totalOnly",t.mapInteract.isDrawing())("card",!0),f(),A(t.mode.steps.length!==0?3:-1),f(3),w("disabled",!t.mapInteract.canUndo()),f(5),w("disabled",!t.canFinish())("matTooltip",t.mapInteract.isModifying()?"Save changes":"Finish \u2014 keep changes"),f(3),K(" ",t.mapInteract.isModifying()?"SAVE":"FINISH"," ")}}function nue(n,e){if(n&1&&(u(0,"div",14),_(1),h()),n&2){let t=v(3);f(),K(" ",t.mode.description," ")}}function rue(n,e){if(n&1&&(u(0,"li"),_(1),h()),n&2){let t=e.$implicit;f(),X(t)}}function oue(n,e){if(n&1&&(u(0,"div",14)(1,"ol",17),Ae(2,rue,2,1,"li",null,wt),h()()),n&2){let t=v(3);f(2),Le(t.mode.steps)}}function aue(n,e){if(n&1){let t=H();u(0,"div",11)(1,"div")(2,"span",13)(3,"mat-icon"),_(4),h(),_(5),h(),R(6,nue,2,1,"div",14),R(7,oue,4,0,"div",14),h(),u(8,"div",15)(9,"a",16),T("click",function(){O(t);let r=v(2);return F(r.close())}),u(10,"mat-icon",10),_(11,"close"),h(),_(12),h()()()}if(n&2){let t=v(2);f(4),X(t.mode.iconName),f(),K(" ",t.mode.iconText," "),f(),A(t.mode.description.length!==0?6:-1),f(),A(t.mode.steps.length!==0?7:-1),f(2),w("matTooltip",t.mapInteract.isModifying()?"Finish Editing":"Cancel Operation"),f(3),K(" ",t.mapInteract.isModifying()?"FINISH":"CANCEL"," ")}}function sue(n,e){if(n&1){let t=H();u(0,"fb-measurements",18),T("cancel",function(){O(t);let r=v(2);return F(r.close())}),h()}if(n&2){let t=v(2);w("coords",t.mapInteract.measurement().coords)("index",t.mapInteract.measurement().index)}}function lue(n,e){if(n&1&&(u(0,"div",1),R(1,aue,13,6,"div",11),R(2,sue,1,2,"fb-measurements",12),h()),n&2){let t=v();f(),A(t.showHelpPanel()?1:-1),f(),A(t.showMeasurePanel()?2:-1)}}var qG=class n{finish=xe();cancel=xe();undo=xe();showHelpPanel;showMeasurePanel;isRouteEditing;canFinish;mode={iconName:"",iconText:"",description:"",steps:[]};app=M(oe);mapInteract=M(Tc);constructor(){this.showHelpPanel=Qe(()=>this.mapInteract.isDrawing()&&this.mapInteract.draw.resourceType!=="route"||this.mapInteract.isModifying()||this.mapInteract.isBoxSelecting()||this.mapInteract.isMeasuring()&&this.mapInteract.measureGeometryType==="Circle"),this.showMeasurePanel=Qe(()=>this.mapInteract.isMeasuring()&&this.mapInteract.measureGeometryType==="LineString"),this.isRouteEditing=Qe(()=>this.mapInteract.draw.resourceType==="route"&&(this.mapInteract.isDrawing()||this.mapInteract.isModifying())),this.canFinish=Qe(()=>this.mapInteract.isModifying()||this.mapInteract.measurement().coords.length>=2),this.isRouteEditing()?this.mode=this.mapInteract.isDrawing()?{iconName:"edit",iconText:"Draw New Route",description:"",steps:["Click / tap the map to add each point.","Double-click, or press Finish, to end."]}:{iconName:"edit",iconText:this.mapInteract.draw.name?`Modify ${this.mapInteract.draw.name}`:"Modify Route",description:"",steps:["Click and drag to move a point.","Ctrl-Click or press-and-hold to remove a point."]}:this.showHelpPanel()&&(this.mapInteract.isDrawing()?this.mode={iconName:"edit",iconText:"Drawing Help",description:this.mapInteract.draw.resourceType==="region"?"":"Click on the Map where to drop the feature.",steps:this.mapInteract.draw.resourceType==="region"?["Click on the Map to place a vertex of the Region.","Click on the last point to end drawing."]:[]}:this.mapInteract.isModifying()?this.mode={iconName:"edit",iconText:"Modify",description:this.mapInteract.draw.forSave.id==="anchor"?"Click and drag to move anchor.":"",steps:this.mapInteract.draw.forSave.id!=="anchor"?["Click and drag to move point.","Ctrl-Click or press-and-hold to remove point from a line."]:[]}:this.mapInteract.isBoxSelecting()?this.mode={iconName:"highlight_alt",iconText:"Select",description:"",steps:["Click and drag to select area.","On touch devices, press and hold then drag."]}:this.mapInteract.isMeasuring()&&this.mapInteract.measureGeometryType==="Circle"&&(this.mode={iconName:"straighten",iconText:"Measure",description:"",steps:["Click on the Map to start.","On touch devices, press and hold then move."]}))}close(){this.cancel.emit()}finishEditing(){this.finish.emit()}undoLast(){this.undo.emit()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["fb-interact-help"]],outputs:{finish:"finish",cancel:"cancel",undo:"undo"},decls:2,vars:1,consts:[[1,"_ap_interact_dock"],[1,"mat-app-background","_ap_interact_help"],[3,"closed","docked","canClose","title","icon"],[3,"coords","index","totalOnly","card"],[1,"_ap_steps"],[1,"_ap_action_row"],[1,"_ap_action_button"],["mat-button","","matTooltip","Undo last change (Ctrl/Cmd-Z)","matTooltipPosition","after",3,"click","disabled"],["mat-button","","color","primary","matTooltipPosition","after",3,"click","disabled","matTooltip"],["mat-button","","matTooltip","Cancel \u2014 discard changes","matTooltipPosition","after",1,"icon-warn",3,"click"],[1,"icon-warn"],[1,"mat-app-background","measurePanel"],["matTooltip","Click on the Map to start. Click cancel or the last point to end.",3,"coords","index"],[2,"font-weight","bold","padding","5px"],[2,"padding","5px"],[2,"text-align","center","padding","6px 0 8px"],["mat-raised-button","","matTooltipPosition","left",1,"icon-warn",3,"click","matTooltip"],[2,"margin-block-start","0.2em","margin-block-end","0.2em","padding-inline-start","15px"],["matTooltip","Click on the Map to start. Click cancel or the last point to end.",3,"cancel","coords","index"]],template:function(t,i){t&1&&R(0,iue,20,15,"div",0)(1,lue,3,2,"div",1),t&2&&A(i.isRouteEditing()?0:1)},dependencies:[se,ce,ue,Ze,Te,Rt,AC,jn],styles:["._ap_interact_help[_ngcontent-%COMP%]{position:fixed;min-width:200px;top:60px;left:50px;border:black 1px solid;font-family:roboto;font-size:10pt}._ap_interact_dock[_ngcontent-%COMP%]{position:fixed;top:60px;left:50px;font-family:roboto;font-size:10pt}._ap_steps[_ngcontent-%COMP%]{margin-block-start:.2em;margin-block-end:.4em;padding-inline-start:18px}._ap_action_row[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap}._ap_action_button[_ngcontent-%COMP%]{flex:1 1 45%}._ap_row[_ngcontent-%COMP%]{display:flex;flex-wrap:no-wrap;flex:2}._ap_row[_ngcontent-%COMP%] .icon-label[_ngcontent-%COMP%]{width:30px}._ap_row[_ngcontent-%COMP%] .row-label[_ngcontent-%COMP%]{font-weight:500;min-width:60px}._ap_measurements[_ngcontent-%COMP%] .value[_ngcontent-%COMP%]{padding-right:10px}@media only screen and (max-width:500px){._ap_measurements[_ngcontent-%COMP%]{left:0;width:100%}}"],changeDetection:0})};var ZG=70,cue=40,Mt=class n{reOpen;app=M(oe);dialog=M(ln);chartPaletteRef;chartPaletteEdit;signalk=M(Lt);worker=M(Nn);mapInteract=M(Tc);constructor(){this.worker.resource$().subscribe(e=>this.processResourceMessage(e)),Me(()=>{let e=this.chartCacheSignal();ha(()=>this.syncChartTimeRefreshers(e))})}selectionIsFiltered(e){return Array.isArray(this.app.config.selections[e])}selectionHas(e,t){return!this.app.config.selections[e]||!this.selectionIsFiltered(e)?!1:this.app.config.selections[e].includes(t)}selectionAdd(e,t){if(!(typeof this.app.config.selections[e]>"u")&&this.selectionIsFiltered(e)){let i=typeof t=="string"?[t]:t;i=i.filter(r=>!this.app.config.selections[e].includes(r)),this.app.config.selections[e]=this.app.config.selections[e].concat(i),this.app.saveConfig()}}selectionRemove(e,t){if(!(typeof this.app.config.selections[e]>"u")&&this.selectionIsFiltered(e)){let i=typeof t=="string"?[t]:t;this.app.config.selections[e]=this.app.config.selections[e].filter(r=>!i.includes(r)),this.app.saveConfig()}}selectionUnfilter(e){this.app.config.selections[e]=null,this.app.saveConfig()}selectionClear(e){this.app.config.selections[e]=[],this.app.saveConfig()}selectionClean(e,t){Array.isArray(this.app.config.selections[e])&&(this.app.config.selections[e]=this.app.config.selections[e].filter(i=>t.includes(i)),this.app.saveConfig())}fetchRelatedNotes(e,t){return Y(this,null,function*(){try{return yield this.listFromServer("notes",`href=/resources/${e}/${t}`)}catch(i){return[]}})}getCacheRef(e){switch(e){case"routes":return this.routeCacheSignal;case"waypoints":return this.waypointCacheSignal;case"notes":return this.noteCacheSignal;case"regions":return this.regionCacheSignal;case"charts":return this.chartCacheSignal;case"tracks":return this.trackCacheSignal}}fromCache(e,t){if(["routes","waypoints","notes","regions","charts","tracks"].includes(e)){let i=this.getCacheRef(e);if(!i){this.app.showAlert("Error","Collection not found!");return}return i().find(r=>r[0]===t)}else return!this.app.data[e]||!Array.isArray(this.app.data[e])?void 0:this.app.data[e].find(r=>r[0]===t)??void 0}listFromServer(e,t){return t?t=t.startsWith("?")?t:`?${t}`:t="",new Promise((i,r)=>{this.signalk.api.get(this.app.skApiVersion,`/resources/${e}${t}`)?.subscribe(a=>{let s=[];Object.keys(a).forEach(l=>{s.push([l,this.transform(e,a[l],l),this.selectionIsFiltered(e)?this.selectionHas(e,l):!0])}),i(s)},a=>r(a))})}fromServer(e,t){return new Promise((i,r)=>{this.signalk.api.get(this.app.skApiVersion,`/resources/${e}/${t}`).subscribe(o=>i(this.transform(e,o,t)),o=>r(o))})}transform(e,t,i){switch(e){case"regions":return this.transformRegion(t,i);case"routes":return this.transformRoute(t,i);case"waypoints":return this.transformWaypoint(t,i);case"notes":return this.transformNote(t,i);case"charts":return this.transformChart(t,i);case"tracks":return this.transformTrack(t)}}deleteFromServer(e,t,i){let r=i?`?provider=${i}`:"";return new Promise((o,a)=>{this.signalk.api.delete(this.app.skApiVersion,`/resources/${e}/${t}${r}`).subscribe(()=>o(),s=>a(s))})}putToServer(e,t,i,r){let o=r?`?provider=${r}`:"";return new Promise((a,s)=>{this.signalk.api.put(this.app.skApiVersion,`/resources/${e}/${t}${r?o:""}`,i).subscribe(l=>a(l),l=>s(l))})}postToServer(e,t){return new Promise((i,r)=>{this.signalk.api.post(this.app.skApiVersion,`/resources/${e}`,t).subscribe(o=>i(o),o=>r(o))})}processResourceMessage(e){if(!Array.isArray(e))return;let t={routes:!1,waypoints:!1,notes:!1,regions:!1,charts:!1};e.forEach(i=>{let r=i.path.split(".");if(r.length===3){let o=r[1],a=r[2];if(o==="charts"&&this.absorbChartDelta(a,i.value))return;o in t&&(t[o]=!0),this.selectionIsFiltered(o)&&!i.value&&this.app.config.selections[o].includes(a)&&(this.app.config.selections[o].splice(this.app.config.selections[o].indexOf(a),1),this.app.saveConfig())}}),t.routes&&this.refreshRoutes(),t.waypoints&&this.refreshWaypoints(),t.regions&&this.refreshRegions(),t.notes&&this.refreshNotes(),t.charts&&this.refreshCharts()}absorbChartDelta(e,t){let i=this.chartCacheSignal().find(a=>a[0]===e);if(!i||!t||typeof t!="object")return!1;let r;try{r=this.transformChart(ne({},t),e)}catch(a){return!1}let o=a=>{let s=this.withoutLocalState(a);return delete s.time,JSON.stringify(s)};return o(r)!==o(i[1])?!1:(this.chartSetTimeDimension(e,r.time),!0)}resourceProperties(e){switch(e.type){case"waypoint":this.editWaypointInfo(e.id);break;case"route":this.editRouteInfo(e.id);break;case"note":this.showNoteDetails(e.id);break;case"region":this.editRegionInfo(e.id);break;case"chart":this.editChartInfo(e.id);break;case"track":this.editTrackInfo(e.id);break}}chartCacheSignal=$([]);charts=this.chartCacheSignal.asReadonly();chartTimeRefreshers=new Map;appendOSM(e){let t=[["openstreetmap",new oa({name:"World Map",description:"Open Street Map"}),this.app&&this.selectionIsFiltered("charts")?this.app.config.selections.charts.includes("openstreetmap"):!0],["openseamap",new oa({name:"Sea Map",description:"Open Sea Map",url:"https://tiles.openseamap.org/seamark/{z}/{x}/{y}.png",minzoom:1,maxzoom:24,bounds:[-180,-90,180,90],type:"tilelayer"}),this.app&&this.selectionIsFiltered("charts")?this.app.config.selections.charts.includes("openseamap"):!0]];return this.app&&t.forEach(i=>{let r=this.app.config.selections.chartOpacity[i[0]];typeof r<"u"&&(i[1].defaultOpacity=r);let o=this.app.config.selections.chartImageAdjustment?.[i[0]];typeof o<"u"&&(i[1].imageAdjustment=o);let a=this.app.config.selections.chartDisplayMinZoom?.[i[0]];typeof a<"u"&&(i[1].displayMinZoom=a)}),e.push(t[1]),e.unshift(t[0]),e}refreshCharts(e){return Y(this,null,function*(){e&&e[0]!=="?"&&(e="?"+e),this.app.debug(`** refreshCharts(): ${e}`);try{let t=yield this.listChartsFromServer(e);this.appendOSM(t);let i=t.filter(r=>r[2]);i=this.sortByScaleDesc(i),i=this.arrangeChartLayers(i),this.chartCacheSignal.set(this.withShownInstants(i)),this.setMapZoomRange()}catch(t){this.app.debug("** refreshCharts:",t);let i=this.appendOSM([]);this.chartCacheSignal.set(i),this.setMapZoomRange()}this.migrateAdoptedOverlays()})}adoptedOverlays=new Map;leftoverOverlays=new Map;overlaysToTop=new Set;overlaysUnavailable=!1;overlayMigrationTried=!1;listChartsFromServer(e){return Y(this,null,function*(){let t=yield this.listFromServer("charts",e);return this.adoptOverlays(t)})}listOverlays(){return this.overlaysUnavailable?Promise.resolve({}):new Promise(e=>{this.signalk.api.get(this.app.skApiVersion,"/resources/infolayers").subscribe({next:t=>e(t&&typeof t=="object"?t:{}),error:t=>{t?.status===400||t?.status===404?this.overlaysUnavailable=!0:this.app.debug("** listOverlays:",t),e({})}})})}adoptOverlays(e){return Y(this,null,function*(){let t=yield this.listOverlays();this.adoptedOverlays.clear(),this.leftoverOverlays.clear();let i=new Set(e.map(a=>a[0])),r=Array.isArray(this.app.config.selections.chartOrder)?this.app.config.selections.chartOrder:[],o=!1;return Object.entries(t).forEach(([a,s])=>{if(!XI(s))return;let l=ZI(a);if(i.has(l)){this.leftoverOverlays.set(l,a);return}this.adoptedOverlays.set(l,a),r.includes(l)||((!this.selectionIsFiltered("infolayers")||this.selectionHas("infolayers",a))&&this.selectionIsFiltered("charts")&&!this.app.config.selections.charts.includes(l)&&(this.app.config.selections.charts.push(l),o=!0),this.overlaysToTop.add(l)),e.push([l,this.transformChart(PC(a,s),l),this.selectionIsFiltered("charts")?this.selectionHas("charts",l):!0])}),o&&this.app.saveConfig(),e})}migrateAdoptedOverlays(){return Y(this,null,function*(){if(this.overlayMigrationTried||this.adoptedOverlays.size===0&&this.leftoverOverlays.size===0)return;this.overlayMigrationTried=!0;let e=0;for(let[t,i]of this.adoptedOverlays){let r;try{r=yield this.fetchOverlay(i)}catch(a){this.app.debug(`** overlay ${i}: not migrated (read)`,a);continue}let o=this.transformChart(PC(i,r),t);try{yield this.postToServer("charts",this.withoutLocalState(o))}catch(a){this.app.debug(`** overlay ${i}: not migrated (write)`,a);break}this.leftoverOverlays.set(t,i),e++}for(let[t,i]of this.leftoverOverlays)try{yield this.deleteOverlay(i),this.app.debug(`** overlay ${i}: migrated to chart ${t}`)}catch(r){this.app.debug(`** overlay ${i}: not removed`,r)}e>0&&this.refreshCharts()})}fetchOverlay(e){return new Promise((t,i)=>{this.signalk.api.get(this.app.skApiVersion,`/resources/infolayers/${e}`).subscribe({next:r=>{XI(r)?t(r):i(new Error(`Overlay ${e}: not an InfoLayer`))},error:r=>i(r)})})}readChart(e){return Y(this,null,function*(){let t=this.adoptedOverlays.get(e);return t?this.transformChart(PC(t,yield this.fetchOverlay(t)),e):this.fromServer("charts",e)})}deleteOverlay(e){return Y(this,null,function*(){try{yield this.deleteFromServer("infolayers",e)}catch(t){if(t?.status!==404)throw t}})}migrateOverlayWithEdits(e,t){return Y(this,null,function*(){let i=this.adoptedOverlays.get(e);t.identifier=e,yield this.postToServer("charts",this.withoutLocalState(t)),i&&(yield this.deleteOverlay(i)),this.selectionAdd("charts",e),this.refreshCharts()})}withShownInstants(e){let t=new Map;return this.chartCacheSignal().forEach(i=>{typeof i[1]?.timeValue=="string"&&t.set(i[0],i[1].timeValue)}),e.map(i=>{let r=t.get(i[0]);if(r===void 0||!i[1]?.time)return i;let o=new oa(i[1]);return o.timeValue=r,[i[0],o,i[2]]})}transformChart(e,t){e.tilemapUrl&&(e.url=e.tilemapUrl),e.chartLayers&&(e.layers=e.chartLayers),e.serverType&&!e.type&&(e.type=e.serverType),e.type&&(e.url.startsWith("/")||!e.url.startsWith("http"))&&(e.url=this.app.hostDef.url+e.url);let i=e.time?.url;typeof i=="string"&&!/^https?:\/\//i.test(i)&&(e.time=st(ne({},e.time),{url:`${this.app.hostDef.url.replace(/\/+$/,"")}/${i.replace(/^\/+/,"")}`}));let r=typeof e.defaultOpacity=="number"?e.defaultOpacity:null;typeof this.app.config.selections.chartOpacity[t]<"u"&&(e.defaultOpacity=this.app.config.selections.chartOpacity[t]);let o=this.app.config.selections.chartImageAdjustment?.[t];typeof o<"u"&&(e.imageAdjustment=o);let a=this.app.config.selections.chartDisplayMinZoom?.[t];typeof a<"u"&&(e.displayMinZoom=a);let s=new oa(e);return s.resourceOpacity=r,s}setMapZoomRange(e){let t={min:2,max:28};if(e||!this.app.uiConfig().mapConstrainZoom)this.app.MAP_ZOOM_EXTENT=t;else{let i={min:1e3,max:-1};this.chartCacheSignal().forEach(r=>{r[2]&&(r[1].minZoom<i.min&&(i.min=r[1].minZoom),r[1].maxZoom>i.max&&(i.max=r[1].maxZoom))}),this.app.MAP_ZOOM_EXTENT={min:i.min===1e3?t.min:i.min,max:i.max===-1?t.max:i.max},this.app.debug("*** MAP_ZOOM_EXTENT",this.app.MAP_ZOOM_EXTENT)}}deleteChart(e){e&&this.app.showConfirm(`Do you want to delete this Chart source?
|
|
1518
|
+
`,"Delete Group:","YES","NO").subscribe(t=>Y(this,null,function*(){if(t&&t.ok)try{yield this.deleteFromServer(e)}catch(i){this.app.parseHttpErrorResponse(i)}}))}addToGroup(e,t,i){return Y(this,null,function*(){if(!i)return;Array.isArray(i)||(i=[i]);let r=yield this.fromServer(e);if(t==="route"){Array.isArray(r.routes)||(r.routes=[]);let o=i.filter(a=>!r.routes.includes(a));r.routes=r.routes.concat(o)}if(t==="waypoint"){Array.isArray(r.waypoints)||(r.waypoints=[]);let o=i.filter(a=>!r.waypoints.includes(a));r.waypoints=r.waypoints.concat(o)}if(t==="region"){Array.isArray(r.regions)||(r.regions=[]);let o=i.filter(a=>!r.regions.includes(a));r.regions=r.regions.concat(o)}if(t==="chart"){Array.isArray(r.charts)||(r.charts=[]);let o=i.filter(a=>!r.charts.includes(a));r.charts=r.charts.concat(o)}yield this.putToServer(e,r)})}with(e,t){return new Promise((i,r)=>{(!e||!t)&&i([]),this.signalk.api.get(this.app.skApiVersion,"/resources/groups")?.subscribe(a=>{let s=Object.entries(a).filter(l=>Array.isArray(l[1][e])?l[1][e].includes(t):!1);s.sort((l,c)=>{let d=l[1].name?.toLowerCase(),p=c[1].name?.toLowerCase();return d>p?1:-1}),i(s)},a=>r(a))})}static \u0275fac=function(t){return new(t||n)(ut(ln),ut(Lt),ut(oe))};static \u0275prov=Je({token:n,factory:n.\u0275fac,providedIn:"root"})};var HG="fb-plotterext-state",Lde="embedding-host",Ode=1e3,Fde=new Set(["eq","ne","lt","lte","gt","gte","in","contains","regex","exists"]),Nde=n=>!!n&&typeof n=="object"&&typeof n.path=="string"&&n.path.length>0&&Fde.has(n.op),zu=class n{constructor(e,t,i,r,o,a,s,l){this.app=e;this.signalk=t;this.dialog=i;this.skres=r;this.mapService=o;this.routeRegistry=a;this.stream=s;this.skgroups=l;ls()&&(window.fbPlotterExt=this),window.addEventListener("resize",()=>this.viewportTick.update(c=>c+1)),this.bridgeRouteEvents(),this.skgroups.applied$.subscribe(c=>this.broadcastMessage("resourceGroup.applied",c)),Me(()=>this.syncVisibleFromSelections()),Me(()=>this.emitChartChanges(this.skres.charts())),Me(()=>this.emitNightModeChange(this.readNightMode())),Me(()=>this.emitMapViewChange(this.mapView()))}app;signalk;dialog;skres;mapService;routeRegistry;stream;skgroups;manifests=$({});activeWidgets=$([]);initialized=$(!1);viewportTick=$(0);actionButtonLift=Qe(()=>{this.viewportTick();let e=this.activeWidgets().filter(i=>i.anchor==="br");if(!e.length)return 0;let t=e.some(i=>i.row===0)?2:1;return t*H1()+(t-1)*W1+6});statusBarLift=Qe(()=>{this.viewportTick();let e=this.activeWidgets().filter(i=>i.anchor==="cb");if(!e.length)return 0;let t=e.some(i=>i.row===0)?2:1;return t*H1()+(t-1)*W1+4});toolbarTopOffset=Qe(()=>{this.viewportTick();let e=this.activeWidgets().filter(i=>i.anchor==="tr");if(!e.length)return 0;let t=e.some(i=>i.row===1)?2:1;return t*H1()+(t-1)*W1+4});toolbarButtons=Qe(()=>{let e=[];for(let[t,i]of Object.entries(this.manifests()))if(this.isCompatible(i))for(let r of i.buttons??[])r.apiVersion!==void 0&&r.apiVersion!=="1"||e.push({extension:t,extensionName:i.name,button:r});return e});backgroundRuntimes=Qe(()=>{let e=[];for(let[t,i]of Object.entries(this.manifests()))if(this.isCompatible(i))for(let r of i.background??[])r.apiVersion!==void 0&&r.apiVersion!=="1"||r.type!=="iframe"||!r.url||e.push({key:`${t}/${r.id}`,extension:t,extensionName:i.name,runtime:r});return e});openPanels=$([]);visiblePanel=Qe(()=>this.openPanels().find(e=>e.visible)??null);openPanel(e,t){let r=this.manifests()[e]?.panels?.find(a=>a.id===t);if(!r||r.type!=="iframe"||!r.url||r.apiVersion!==void 0&&r.apiVersion!=="1")return!1;let o=`${e}/${t}`;return this.openPanels.update(a=>{let s=a.filter(l=>l.key===o||l.panel.lifecycle==="keepAlive").map(l=>st(ne({},l),{visible:l.key===o}));return s.some(l=>l.key===o)?s:[...s,{key:o,extension:e,panel:r,visible:!0}]}),!0}closeVisiblePanel(){let e=this.openPanels().find(t=>t.visible);e&&this.closePanel(e.key)}closePanel(e){this.openPanels.update(t=>{let i=t.find(r=>r.key===e);return i?i.panel.lifecycle==="keepAlive"?t.map(r=>r.key===e?st(ne({},r),{visible:!1}):r):t.filter(r=>r.key!==e):t})}togglePanel(e,t){let i=`${e}/${t}`;return this.visiblePanel()?.key===i?(this.closeVisiblePanel(),!0):this.openPanel(e,t)}uiPanelMethods(e){let t=i=>{let r=i?.panel;if(!r)throw new jt("panel is required",{code:ji.INVALID_PARAMS,reason:"UNKNOWN_PANEL"});return r};return{"ui.openPanel":i=>Y(this,null,function*(){let r=t(i);if(!this.openPanel(e,r))throw new jt(`No such panel: ${r}`,{code:ji.INVALID_PARAMS,reason:"UNKNOWN_PANEL"});return{}}),"ui.togglePanel":i=>Y(this,null,function*(){let r=t(i);if(!this.togglePanel(e,r))throw new jt(`No such panel: ${r}`,{code:ji.INVALID_PARAMS,reason:"UNKNOWN_PANEL"});return{}})}}handleButtonAction(e,t){let i=t.action;if(!i)return;if(i.type==="sendMessage"){i.topic&&this.broadcastMessage(i.topic,i.params);return}let r=i.panel;r&&(i.type==="togglePanel"?this.togglePanel(e,r):i.type==="openPanel"&&this.openPanel(e,r))}resourceFilters=$({});visibleNotes=Qe(()=>{let e=this.skres.notes(),t=this.resourceFilters().notes;if(!t||!Object.keys(t).length)return e;let i=Object.values(t);return e.filter(([r,o])=>i.every(a=>this.passesFilter(a,r,o)))});filterChips=Qe(()=>{let e=[];for(let[t,i]of Object.entries(this.resourceFilters()))for(let[r,o]of Object.entries(i))e.push({type:t,extension:r,label:o.label??`${this.manifests()[r]?.name??r} filter`});return e});setResourceFilter(e,t,i){this.resourceFilters.update(r=>st(ne({},r),{[t]:st(ne({},r[t]??{}),{[e]:i})})),this.publishToExtension(e,"filters.changed",{type:t,active:!0})}clearResourceFilter(e,t){this.resourceFilters.update(i=>{let r=ne({},i[t]??{});delete r[e];let o=ne({},i);return Object.keys(r).length?o[t]=r:delete o[t],o}),this.publishToExtension(e,"filters.changed",{type:t,active:!1})}passesFilter(e,t,i){let r=!0;return e.ids&&(r=e.ids.includes(t)),r&&e.match&&(r=e.match.every(o=>this.evalCondition(o,i))),e.mode==="exclude"?!r:r}evalCondition(e,t){let i=t;for(let r of e.path.split(".")){if(i===null||typeof i!="object"){i=void 0;break}i=i[r]}switch(e.op){case"exists":return i!==void 0;case"eq":return this.refEquals(i,e.value,e.exact);case"ne":return!this.refEquals(i,e.value,e.exact);case"lt":return typeof i=="number"&&i<e.value;case"lte":return typeof i=="number"&&i<=e.value;case"gt":return typeof i=="number"&&i>e.value;case"gte":return typeof i=="number"&&i>=e.value;case"in":return Array.isArray(e.value)&&e.value.some(r=>this.refEquals(i,r,e.exact));case"contains":return typeof i=="string"?i.toLowerCase().includes(String(e.value).toLowerCase()):Array.isArray(i)&&i.includes(e.value);case"regex":{if(typeof i!="string"||typeof e.value!="string"||i.length>2e3)return!1;let r=this.compileRegex(e.value);return r?r.test(i):!1}default:return!1}}symbolLocalId(e){if(typeof e!="string")return null;let t=/^[A-Za-z0-9_-]+:([^:]+)$/.exec(e);return t?t[1]:null}refEquals(e,t,i){return e===t?!0:i?!1:typeof t=="string"&&!t.includes(":")&&this.symbolLocalId(e)===t||typeof e=="string"&&!e.includes(":")&&this.symbolLocalId(t)===e}compileRegex(e){if(e.length>200)return null;try{return new RegExp(e)}catch(t){return null}}contexts=new Set;embeddingHostDetach=null;ws=null;wsReady=!1;pathRefs=new Map;reconnectTimer=null;pointsFromRoute(e,t){return zC(e,t)}pointsEqual(e,t){return e.length!==t.length?!1:e.every((i,r)=>{let o=t[r];return i.position[0]===o.position[0]&&i.position[1]===o.position[1]&&(i.position[2]??null)===(o.position[2]??null)&&(i.name??null)===(o.name??null)&&(i.description??null)===(o.description??null)&&(i.href??null)===(o.href??null)})}syncVisibleFromSelections(){let e=this.skres.routes(),t=new Set(e.map(i=>i[0]));for(let[i,r]of e){let o=r.feature?.geometry?.coordinates??[],a=r.feature?.properties?.coordinatesMeta,s=this.pointsFromRoute(o,a),l=this.routeRegistry.getByHref(i);if(l){l.saved&&!l.dirty&&((l.name??null)!==(r.name??null)||(l.description??null)!==(r.description??null)||!this.pointsEqual(l.points,s))&&this.routeRegistry.show({routeId:l.routeId,name:r.name??null,description:r.description??null,points:s,href:i});continue}this.routeRegistry.show({routeId:i,name:r.name??null,description:r.description??null,points:s,href:i})}for(let i of this.routeRegistry.all())i.saved&&!i.dirty&&i.href&&!t.has(i.href)&&this.routeRegistry.delete(i.routeId,!0)}bridgeRouteEvents(){this.routeRegistry.events$.subscribe(e=>{switch(e.type){case"visible":this.broadcastMessage("route.visible",{routeId:e.routeId,rev:e.rev,name:e.name,pointCount:e.pointCount,saved:e.saved,dirty:e.dirty});break;case"hidden":this.broadcastMessage("route.hidden",{routeId:e.routeId,rev:e.rev,saved:e.saved});break;case"dirty":this.broadcastMessage("route.dirty",ne({routeId:e.routeId,rev:e.rev},e.reason!==void 0?{reason:e.reason}:{}));break}})}routeMethods(){return DG(this.routeRegistry,{onSave:(e,t)=>this.saveBuffer(e,t),onShow:e=>this.showRoute(e),onHide:e=>this.hideRoute(e),onDelete:e=>this.deleteRoute(e)})}chartMethods(){return PG({listAvailableOrdered:()=>this.skres.chartsForHostApi(),setVisibility:(e,t)=>this.skres.setChartsVisibility(e,t),setOpacity:(e,t)=>this.skres.setChartsOpacity(e,t),setOrder:e=>this.skres.setChartsOrder(e),isTemporal:e=>this.skres.chartIsTemporal(e),setTime:(e,t)=>this.skres.setChartsTime(e,t)})}resourceGroupMethods(){return OG({fetchGroup:e=>this.skgroups.fromServer(e),applyGroup:(e,t)=>this.skgroups.applyGroup(e,t)})}nightModeMethods(){return RG({getState:()=>this.readNightMode(),setState:e=>this.applyNightMode(e)})}readNightMode(){return{enabled:this.stream.selfNightMode()||this.app.uiCtrl().forceNightMode,auto:this.app.config.display.nightMode??!1}}applyNightMode(e){let t=e.auto;if(typeof t=="boolean"){if(t)this.app.uiCtrl.update(r=>st(ne({},r),{forceNightMode:!1}));else if(typeof e.enabled!="boolean"){let r=this.readNightMode().enabled;this.app.uiCtrl.update(o=>st(ne({},o),{forceNightMode:r}))}this.app.config.display.nightMode=t,this.app.uiConfig.update(r=>st(ne({},r),{autoNightMode:t}))}let i=e.enabled;typeof i=="boolean"&&(this.app.config.display.nightMode=!1,this.app.uiConfig.update(r=>st(ne({},r),{autoNightMode:!1})),this.app.uiCtrl.update(r=>st(ne({},r),{forceNightMode:i}))),this.stream.refreshSelfNightMode(),this.emitNightModeChange(this.readNightMode())}prevNightMode=null;emitNightModeChange(e){let t=this.prevNightMode;this.prevNightMode=e,t!==null&&(t.enabled===e.enabled&&t.auto===e.auto||this.broadcastMessage("nightMode.changed",e))}prevChartSnapshot=null;emitChartChanges(e){let t=e.map(d=>d[0]).reverse(),i=new Map(e.map(d=>[d[0],typeof d[1]?.defaultOpacity=="number"?d[1].defaultOpacity:1])),r=new Map(e.map(d=>[d[0],d[1]?.timeValue??null])),o=this.prevChartSnapshot;if(this.prevChartSnapshot={order:t,opacity:i,time:r},!o)return;let a=new Set(o.order),s=new Set(t);for(let d of t)a.has(d)||this.broadcastMessage("chart.visibility",{id:d,visible:!0});for(let d of o.order)s.has(d)||this.broadcastMessage("chart.visibility",{id:d,visible:!1});for(let[d,p]of i){let m=o.opacity.get(d);m!==void 0&&m!==p&&this.broadcastMessage("chart.opacity",{id:d,opacity:p})}for(let[d,p]of r)o.time.has(d)&&o.time.get(d)!==p&&this.broadcastMessage("chart.time",{id:d,time:p});let l=o.order.filter(d=>s.has(d)),c=t.filter(d=>a.has(d));l.length===c.length&&l.some((d,p)=>d!==c[p])&&this.broadcastMessage("chart.order",{order:t})}hideRoute(e){let t=this.routeRegistry.get(e);t&&(t.saved&&t.href?(this.skres.routeHide(t.href),this.routeRegistry.delete(e,!0)):this.routeRegistry.delete(e,!1))}deleteRoute(e){return Y(this,null,function*(){let t=this.routeRegistry.get(e);if(t){if(t.saved&&t.href)try{yield this.skres.deleteFromServer("routes",t.href)}catch(i){throw this.app.parseHttpErrorResponse(i),new jt("Failed to delete route",{reason:"routes.deleteFailed"})}this.routeRegistry.delete(e,!1)}})}showRoute(e){return Y(this,null,function*(){let t=this.routeRegistry.getByHref(e);if(t)return{routeId:t.routeId,rev:t.rev};this.skres.selectionAdd("routes",e),yield this.skres.refreshRoutes();let i=this.skres.fromCache("routes",e);if(!i)throw this.skres.selectionRemove("routes",e),new jt("No such route",{reason:"routes.badRef"});let r=i[1],o=r.feature?.geometry?.coordinates??[],a=r.feature?.properties?.coordinatesMeta,s=this.pointsFromRoute(o,a),l=this.routeRegistry.show({routeId:e,name:r.name??null,description:r.description??null,points:s,href:e});return{routeId:l.routeId,rev:l.rev}})}saveNativeRouteEdit(e,t,i){return Y(this,null,function*(){let r=this.pointsFromRoute(t,i),o=this.routeRegistry.get(e);if(!o){let c=this.skres.fromCache("routes",e),d=c?c[1].name??null:null,p=c?c[1].description??null:null;this.routeRegistry.show({routeId:e,name:d,description:p,points:r,href:e})}this.routeRegistry.replace(e,r),o=this.routeRegistry.get(e);let a=o?.href??e;if(!(yield this.skres.updateRouteCoords(a,t,i)))return;let l=this.routeRegistry.markSaved(e,a)??0;this.broadcastMessage("route.saved",{routeId:e,rev:l,href:a,name:o?.name??null,saved:!0,dirty:!1})})}saveBuffer(i){return Y(this,arguments,function*(e,t={}){let r=this.routeRegistry.get(e);if(!r)return null;let[,o]=this.skres.buildRoute(r.points.map(p=>p.position)),a=sg(r.points);a&&(o.feature.properties.coordinatesMeta=a),o.name=t.name??r.name??"",o.description=t.description??r.description??"",t.temporary&&!r.href&&(o.feature.properties.temporary=EG(new Date));let s=r.href?this.skres.fromCache("routes",r.href)?.[1]:void 0;Zp(s)&&!t.promote&&(o.feature.properties.temporary=s.feature.properties.temporary);let l;if(r.href)try{yield this.skres.putToServer("routes",r.href,o),l=r.href}catch(p){throw this.app.parseHttpErrorResponse(p),new jt("Failed to save route",{reason:"routes.saveFailed"})}else if(t.dialog)try{l=yield this.skres.saveNewRoute(o)}catch(p){throw new jt("Failed to save route",{reason:"routes.saveFailed"})}else try{l=(yield this.skres.postToServer("routes",o)).id,this.skres.selectionAdd("routes",l)}catch(p){throw this.app.parseHttpErrorResponse(p),new jt("Failed to save route",{reason:"routes.saveFailed"})}if(!l)return null;let c=o.name||null,d=this.routeRegistry.markSaved(e,l,c,o.description||null)??r.rev+1;return this.broadcastMessage("route.saved",{routeId:e,rev:d,href:l,name:c,saved:!0,dirty:!1}),this.app.data.editingId="",{href:l,rev:d}})}init(){return Y(this,null,function*(){try{let e=yield rs(this.signalk.api.get(this.app.skApiVersion,"/resources/plotterExtensions")),t={};if(e&&typeof e=="object")for(let[i,r]of Object.entries(e))this.isManifest(r)&&(t[i]=r);this.manifests.set(t)}catch(e){this.manifests.set({})}this.refreshActiveWidgets(),this.initialized.set(!0),this.attachEmbeddingHostOnce()})}isCompatible(e){return e.apiVersion!=="1"?!1:(e.requires??[]).every(t=>Jw.includes(t))}isManifest(e){return typeof e=="object"&&e!==null&&typeof e.name=="string"&&typeof e.apiVersion=="string"}widgetDef(e,t){return this.manifests()[e]?.widgets?.find(r=>r.id===t)??null}placements(){return this.app.config.plotterExtensions.widgets}occupancy(e){let{cols:t,rows:i}=U1[e],r=Array.from({length:i},()=>Array.from({length:t},()=>!1));for(let o of this.activeWidgets()){if(o.anchor!==e)continue;let a=this.widgetDef(o.extension,o.widget),s=tM(a?.size??"1x1");for(let l=o.row;l<o.row+s.rows&&l<i;l++)for(let c=o.col;c<o.col+s.cols&&c<t;c++)r[l][c]=!0}return r}cellOccupied(e,t){return this.occupancy(e)[t.row]?.[t.col]??!0}isValidOrigin(e,t,i,r){let{cols:o,rows:a}=U1[e];if(i.col+t.cols>o||i.row+t.rows>a)return!1;for(let s=i.row;s<i.row+t.rows;s++)for(let l=i.col;l<i.col+t.cols;l++)if(r[s][l])return!1;if(t.rows===1){let s=eM[e]==="bottom"?a-1:0;if(i.row!==s){for(let l=i.col;l<i.col+t.cols;l++)if(!r[s][l])return!1}}return!0}originOrder(e){let t=U1[e].rows,i=Array.from({length:t},(s,l)=>l),r=eM[e]==="bottom"?[...i].reverse():i,o=KD[e],a=[];for(let s of r)for(let l of o)a.push({col:l,row:s});return a}findOrigin(e,t,i){let r=tM(t.size),o=this.occupancy(e);for(let a of this.originOrder(e))if(this.isValidOrigin(e,r,a,o)&&!(i&&!(i.col>=a.col&&i.col<a.col+r.cols&&i.row>=a.row&&i.row<a.row+r.rows)))return a;return null}addableWidgets(e,t){let i=[];for(let[r,o]of Object.entries(this.manifests()))if(this.isCompatible(o))for(let a of o.widgets??[]){if(a.type!=="iframe"||a.apiVersion!==void 0&&a.apiVersion!=="1")continue;let s=this.findOrigin(e,a,t);s&&i.push({extension:r,extensionName:o.name,widget:a,origin:s})}return i}hitTester=null;registerHitTester(e){return this.hitTester=e,()=>{this.hitTester===e&&(this.hitTester=null)}}addableCellAt(e,t){let i=this.hitTester?.(e,t);return!i||this.cellOccupied(i.anchor,i.cell)||!this.addableWidgets(i.anchor,i.cell).length?null:i}openAddWidgetPicker(e,t){return Y(this,null,function*(){let i=this.addableWidgets(e,t);if(!i.length)return;let{PlotterAddWidgetDialog:r}=yield import("./chunk-OVB2ZLN5.js");this.dialog.open(r,{data:{anchor:e,candidates:i},width:"340px"}).afterClosed().subscribe(o=>{if(!o)return;let a=this.placeWidget(o.extension,o.widget,e,o.origin);this.widgetHasConfigPanel(a)&&this.openConfigPanel(a)})})}placeWidget(e,t,i,r){let o={instanceId:ek(),extension:e,widget:t.id,anchor:i,col:r.col,row:r.row};return this.app.config.plotterExtensions.widgets.push(o),this.app.saveConfig(),this.refreshActiveWidgets(),o}removeWidget(e){let t=this.app.config.plotterExtensions.widgets,i=t.findIndex(r=>r.instanceId===e);if(i!==-1){let[r]=t.splice(i,1);this.clearInstanceState(r.extension,e),this.app.saveConfig(),this.refreshActiveWidgets()}}refreshActiveWidgets(){let e=this.manifests();this.activeWidgets.set(this.placements().filter(t=>{let i=e[t.extension];return i&&this.isCompatible(i)&&i.widgets?.some(r=>r.id===t.widget&&(r.apiVersion===void 0||r.apiVersion==="1"))}))}resolveAssetUrl(e){let t=this.app.hostDef?.url||window.location.origin;try{let i=new URL(t),r=new URL(e,t);return r.protocol!=="http:"&&r.protocol!=="https:"||r.origin!==i.origin?"about:blank":r.toString()}catch(i){return"about:blank"}}assetOrigin(e){try{return new URL(this.resolveAssetUrl(e)).origin}catch(t){return"*"}}attachWidget(e,t){let i={extension:t.extension,conn:null,skSubs:new Map,skSubSeq:0},r=this.widgetDef(t.extension,t.widget)?.url??"";return i.conn=new og({port:rg(e.contentWindow,{origin:this.assetOrigin(r)}),hostInfo:this.hostInfo(),context:{kind:"widget",id:t.widget,instanceId:t.instanceId,targetInstance:null},methods:st(ne(ne(ne(ne(ne(ne(ne(ne(ne(ne({},this.stateMethods(t.extension,t.instanceId)),this.signalkMethods(i)),this.unitsMethods()),this.resourcesMethods(t.extension)),this.mapMethods()),this.routeMethods()),this.chartMethods()),this.nightModeMethods()),this.resourceGroupMethods()),this.uiPanelMethods(t.extension)),{"ui.openConfigPanel":()=>Y(this,null,function*(){return this.openConfigPanel(t),{}}),"ui.toggleConfigPanel":()=>Y(this,null,function*(){return this.toggleConfigPanel(t),{}})}),onError:o=>console.warn("plotterext widget error",o)}),this.contexts.add(i),()=>this.detach(i)}attachPanel(e,t){let i={extension:t.extension,conn:null,skSubs:new Map,skSubSeq:0};return i.conn=new og({port:rg(e.contentWindow,{origin:this.assetOrigin(t.panel.url??"")}),hostInfo:this.hostInfo(),context:{kind:"panel",id:t.panel.id,instanceId:null,targetInstance:t.targetInstance??null,targetWidget:t.targetWidget??null},methods:st(ne(ne(ne(ne(ne(ne(ne(ne(ne(ne({},this.stateMethods(t.extension,t.targetInstance??null)),this.signalkMethods(i)),this.unitsMethods()),this.resourcesMethods(t.extension)),this.mapMethods()),this.routeMethods()),this.chartMethods()),this.nightModeMethods()),this.resourceGroupMethods()),this.uiPanelMethods(t.extension)),{"ui.closePanel":()=>Y(this,null,function*(){return t.close(),{}})}),onError:r=>console.warn("plotterext panel error",r)}),this.contexts.add(i),()=>this.detach(i)}attachBackground(e,t){let i={extension:t.extension,conn:null,skSubs:new Map,skSubSeq:0};return i.conn=new og({port:rg(e.contentWindow,{origin:this.assetOrigin(t.runtime.url)}),hostInfo:this.hostInfo(),context:{kind:"background",id:t.runtime.id,instanceId:null},methods:ne(ne(ne(ne(ne(ne(ne(ne(ne(ne({},this.stateMethods(t.extension,null)),this.signalkMethods(i)),this.unitsMethods()),this.resourcesMethods(t.extension)),this.mapMethods()),this.routeMethods()),this.chartMethods()),this.nightModeMethods()),this.resourceGroupMethods()),this.uiPanelMethods(t.extension)),onError:r=>console.warn("plotterext background error",r)}),this.contexts.add(i),()=>this.detach(i)}attachEmbeddingHost(e=rg(window.parent,{origin:window.location.origin})){let t=Lde,i={extension:t,conn:null,skSubs:new Map,skSubSeq:0};return i.conn=new og({port:e,hostInfo:this.hostInfo(),adoptCallerId:!0,context:{kind:"embedding-host",id:t,instanceId:null},methods:ne(ne(ne(ne(ne(ne(ne(ne(ne(ne({},this.stateMethods(t,null)),this.signalkMethods(i)),this.unitsMethods()),this.resourcesMethods(t)),this.mapMethods()),this.routeMethods()),this.chartMethods()),this.nightModeMethods()),this.resourceGroupMethods()),this.uiPanelMethods(t)),onError:r=>console.warn("plotterext embedding-host error",r)}),this.contexts.add(i),()=>this.detach(i)}attachEmbeddingHostOnce(){this.embeddingHostDetach||this.app.isTopWindow()||(this.embeddingHostDetach=this.attachEmbeddingHost())}detach(e){if(this.contexts.has(e)){this.contexts.delete(e);for(let[,t]of e.skSubs)this.releasePaths(t);e.skSubs.clear(),e.conn.close()}}hostInfo(){return{host:"freeboard-sk",hostVersion:this.app.data?.server?.version??"dev",apiVersion:"1",capabilities:Jw}}configDialogRef=null;configDialogInstance=null;widgetHasConfigPanel(e){let t=this.manifests()[e.extension],i=this.widgetDef(e.extension,e.widget),r=t?.panels?.find(o=>o.id===i?.configPanel);return!!(r&&r.type==="iframe"&&r.url)}openConfigPanel(e){let t=this.manifests()[e.extension],i=this.widgetDef(e.extension,e.widget),r=t?.panels?.find(a=>a.id===i?.configPanel),o=r&&r.type==="iframe"&&r.url&&(r.apiVersion===void 0||r.apiVersion==="1")?r:null;import("./chunk-6ZXMFU55.js").then(({PlotterPanelDialog:a})=>{let s=this.dialog.open(a,{data:{extension:e.extension,panel:o,title:i?.title??e.widget,targetInstance:e.instanceId,targetWidget:e.widget},width:"440px",maxHeight:"85vh"});this.configDialogRef=s,this.configDialogInstance=e.instanceId,s.afterClosed().subscribe(()=>{this.configDialogRef===s&&(this.configDialogRef=null,this.configDialogInstance=null)})})}toggleConfigPanel(e){if(this.configDialogRef&&this.configDialogInstance===e.instanceId){this.configDialogRef.close();return}this.openConfigPanel(e)}loadStore(){try{return JSON.parse(localStorage.getItem(HG)??"{}")}catch(e){return{}}}saveStore(e){localStorage.setItem(HG,JSON.stringify(e))}clearInstanceState(e,t){let i=this.loadStore();i[e]?.instances?.[t]&&(delete i[e].instances[t],this.saveStore(i))}stateMethods(e,t){let i=(r,o)=>{let a=r[e]=r[e]??{};if((o??(t?"instance":"extension"))==="instance"){if(!t)throw new jt("No widget instance in scope",{code:ji.INVALID_PARAMS,reason:"NO_INSTANCE"});return a.instances=a.instances??{},a.instances[t]=a.instances[t]??{}}return a.extension=a.extension??{}};return{"state.get":r=>Y(this,null,function*(){let{scope:o,keys:a}=r??{},s=i(this.loadStore(),o);if(!a)return{values:s};let l={};for(let c of a)c in s&&(l[c]=s[c]);return{values:l}}),"state.set":r=>Y(this,null,function*(){let{scope:o,values:a}=r??{};if(!a||typeof a!="object")throw new jt("state.set requires a values object",{code:ji.INVALID_PARAMS,reason:"INVALID_VALUES"});let s=this.loadStore(),l=i(s,o);Object.assign(l,a),this.saveStore(s);let c=(o??(t?"instance":"extension"))==="instance";return this.publishToExtension(e,"state.changed",{scope:c?"instance":"extension",instanceId:c?t:null,keys:Object.keys(a)}),{}})}}publishToExtension(e,t,i){for(let r of this.contexts)r.extension===e&&r.conn.publish(t,i)}broadcastMessage(e,t){for(let i of this.contexts)i.conn.publish(e,t)}resourcesMethods(e){return{"resources.list":t=>Y(this,null,function*(){let{type:i,query:r}=t??{};if(typeof i!="string"||!/^[A-Za-z][A-Za-z0-9_-]*$/.test(i))throw new jt("resources.list requires a resource type",{code:ji.INVALID_PARAMS,reason:"INVALID_TYPE"});let o=this.serializeQuery(r);try{return(yield rs(this.signalk.api.get(this.app.skApiVersion,`/resources/${i}${o}`)))??{}}catch(a){throw new jt(`resources.list ${i} failed`,{reason:"LIST_FAILED",data:{message:a?.message}})}}),"resources.setFilter":t=>Y(this,null,function*(){let{type:i,filter:r}=t??{};if(typeof i!="string"||!r||r.mode!=="include"&&r.mode!=="exclude"||r.ids===void 0&&r.match===void 0||r.ids!==void 0&&(!Array.isArray(r.ids)||!r.ids.every(o=>typeof o=="string"))||r.match!==void 0&&(!Array.isArray(r.match)||!r.match.every(Nde)))throw new jt("resources.setFilter requires a type and a filter with mode plus ids and/or match",{code:ji.INVALID_PARAMS,reason:"INVALID_FILTER"});return this.setResourceFilter(e,i,r),{}}),"resources.clearFilter":t=>Y(this,null,function*(){let{type:i}=t??{};if(typeof i!="string")throw new jt("resources.clearFilter requires a type",{code:ji.INVALID_PARAMS,reason:"INVALID_TYPE"});return this.clearResourceFilter(e,i),{}})}}serializeQuery(e){if(!e||typeof e!="object")return"";let t=[];for(let[i,r]of Object.entries(e)){if(r==null)continue;let o=Array.isArray(r)?JSON.stringify(r):String(r);t.push(`${encodeURIComponent(i)}=${encodeURIComponent(o)}`)}return t.length?`?${t.join("&")}`:""}mapView(){let e=this.app.mapExtent();return{center:this.app.config.map.center,zoom:this.app.config.map.zoomLevel,bounds:ng(e)??e}}prevMapView=null;emitMapViewChange(e){let t=this.prevMapView;this.prevMapView=e,!(t===null||t.zoom===e.zoom&&t.center[0]===e.center[0]&&t.center[1]===e.center[1]&&t.bounds.length===e.bounds.length&&t.bounds.every((r,o)=>r===e.bounds[o]))&&this.broadcastMessage("map.view",e)}mapMethods(){return{"map.getView":()=>Y(this,null,function*(){return this.mapView()}),"map.center":e=>Y(this,null,function*(){let{position:t,zoom:i}=e??{};if(!Array.isArray(t)||t.length!==2||!t.every(r=>typeof r=="number"))throw new jt("map.center requires position [lon, lat]",{code:ji.INVALID_PARAMS,reason:"INVALID_POSITION"});return this.app.mapMoveRequest.set(ne({center:t},typeof i=="number"?{zoom:i}:{})),{}}),"map.fitBounds":e=>Y(this,null,function*(){let t=ng(e?.bounds);if(!t)throw new jt("map.fitBounds requires bounds [west, south, east, north]",{code:ji.INVALID_PARAMS,reason:"INVALID_BOUNDS"});return this.app.mapMoveRequest.set(this.fitView(t)),{}})}}fitView(e){let t=this.mapService.getMaps()[0],i=t?.getSize(),r={min:this.app.MAP_ZOOM_EXTENT?.min??0,max:Math.min(this.app.MAP_ZOOM_EXTENT?.max??18,ey)};return!t||!i?{center:Mg(e,[1,1],r).center,zoom:12}:Mg(e,[i[0],i[1]],r,t.getView().getRotation())}pulseMapResize(e=320){let t=0,i=()=>{this.mapService.updateSize(),t+=16,t<e&&requestAnimationFrame(i)};requestAnimationFrame(i)}unitsMethods(){return{"units.get":()=>Y(this,null,function*(){let e=this.app.config.units;return{units:{speed:e.speed,distance:e.distance,depth:e.depth,length:e.length,temperature:e.temperature}}})}}signalkMethods(e){return{"signalk.subscribe":t=>Y(this,null,function*(){let{paths:i}=t??{};if(!Array.isArray(i)||i.length===0||!i.every(o=>typeof o=="string"&&o.length>0&&!o.includes("*")))throw new jt("signalk.subscribe requires an array of literal Signal K paths",{code:ji.INVALID_PARAMS,reason:"INVALID_PATHS"});let r=`sk-${++e.skSubSeq}`;return e.skSubs.set(r,i),this.acquirePaths(i),{subscriptionId:r}}),"signalk.unsubscribe":t=>Y(this,null,function*(){let{subscriptionId:i}=t??{},r=i?e.skSubs.get(i):null;if(!r)throw new jt("Unknown subscriptionId",{code:ji.INVALID_PARAMS,reason:"UNKNOWN_SUBSCRIPTION"});return e.skSubs.delete(i),this.releasePaths(r),{}}),"signalk.put":t=>Y(this,null,function*(){let{path:i,value:r}=t??{};if(typeof i!="string"||!i.length)throw new jt("signalk.put requires a path",{code:ji.INVALID_PARAMS,reason:"INVALID_PATH"});try{return(yield rs(this.signalk.api.put(1,`vessels/self/${i.split(".").join("/")}`,r)))??{}}catch(o){throw new jt(`PUT ${i} failed`,{reason:"PUT_FAILED",data:{message:o?.message}})}})}}acquirePaths(e){let t=[];for(let i of e){let r=this.pathRefs.get(i)??0;this.pathRefs.set(i,r+1),r===0&&t.push(i)}t.length&&(this.ensureSocket(),this.sendSubscribe(t))}releasePaths(e){let t=[];for(let i of e){let r=this.pathRefs.get(i)??0;r<=1?(this.pathRefs.delete(i),t.push(i)):this.pathRefs.set(i,r-1)}t.length&&this.wsReady&&this.wsSend({context:"vessels.self",unsubscribe:t.map(i=>({path:i}))}),this.pathRefs.size===0&&this.closeSocket()}ensureSocket(){if(this.ws)return;let e=this.app.data?.server?this.signalk.server?.endpoints?.v1?.["signalk-ws"]:null;if(!e){console.warn("plotterext: no signalk-ws endpoint available");return}let t=`${e}?subscribe=none`,i=this.app.getFBToken();i&&(t+=`&token=${i}`);let r=new WebSocket(t);this.ws=r,r.onopen=()=>{this.wsReady=!0;let o=[...this.pathRefs.keys()];o.length&&this.sendSubscribe(o)},r.onmessage=o=>this.handleDelta(o.data),r.onclose=()=>{this.ws===r&&(this.ws=null,this.wsReady=!1,this.pathRefs.size&&!this.reconnectTimer&&(this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.ensureSocket()},3e3)))},r.onerror=()=>{}}closeSocket(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null);let e=this.ws;this.ws=null,this.wsReady=!1,e?.close()}sendSubscribe(e){this.wsReady&&this.wsSend({context:"vessels.self",subscribe:e.map(t=>({path:t,period:Ode,policy:"instant",minPeriod:200}))})}wsSend(e){this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify(e))}handleDelta(e){let t;try{t=JSON.parse(e)}catch(i){return}if(Array.isArray(t.updates)){for(let i of t.updates)if(Array.isArray(i.values))for(let r of i.values){if(!r?.path||!this.pathRefs.has(r.path))continue;let o={path:r.path,value:r.value,timestamp:i.timestamp,$source:i.$source??i.source?.label};for(let a of this.contexts)a.conn.publish(`sk.${r.path}`,o)}}}static \u0275fac=function(t){return new(t||n)(ut(oe),ut(Lt),ut(ln),ut(Mt),ut(ys),ut(pl),ut(es),ut($r))};static \u0275prov=Je({token:n,factory:n.\u0275fac,providedIn:"root"})};function Bde(n,e){if(n&1&&z(0,"wpt-button",1),n&2){let t=v();w("position",t.app.data.vessels.self.position)("active",t.app.data.vessels.showSelf)}}function Vde(n,e){n&1&&z(0,"pob-button")}function Gde(n,e){if(n&1&&z(0,"autopilot-button",2),n&2){let t=v();w("active",t.app.featureFlags().autopilotApi&&t.app.data.vessels.self.autopilot.default)}}function zde(n,e){if(n&1){let t=H();u(0,"radar-button",3),T("click",function(){O(t);let r=v();return F(r.radarClick.emit())}),h()}if(n&2){let t=v();w("active",t.app.featureFlags().radarApi&&t.radarApi.radarId().length!==0)}}var $G=class n{action=Z();radarClick=xe();app=M(oe);radarApi=M(Sc);plotterExt=M(zu);bottomOffset=Qe(()=>{let e=this.plotterExt.actionButtonLift();return e>0?e:23});constructor(){}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["mfb-container"]],inputs:{action:[1,"action"]},outputs:{radarClick:"radarClick"},decls:5,vars:6,consts:[[1,"mfb-container"],[3,"position","active"],[3,"active"],[3,"click","active"]],template:function(t,i){t&1&&(u(0,"div",0),R(1,Bde,1,2,"wpt-button",1),R(2,Vde,1,0,"pob-button"),R(3,Gde,1,1,"autopilot-button",2),R(4,zde,1,1,"radar-button",2),h()),t&2&&(vt("bottom",i.bottomOffset(),"px"),f(),A(i.action()==="wpt"?1:-1),f(),A(i.action()==="pob"?2:-1),f(),A(i.action()==="autopilot"?3:-1),f(),A(i.action()==="radar"?4:-1))},dependencies:[OC,FC,NC,BC],styles:[".mfb-container[_ngcontent-%COMP%]{position:absolute;bottom:23px;right:5px;z-index:5000}"]})};function KG(n,e=10){let t=n.anchorY-n.top,i=n.bottom-n.anchorY;return t>=n.height+e?{placement:"top"}:i>=n.height+e?{placement:"bottom"}:i>t?{placement:"bottom",maxHeight:Math.max(i-e,0)}:{placement:"top",maxHeight:Math.max(t-e,0)}}var jde=["box"],Ude=["*"],Wde=(n,e,t)=>({measure:n,compact:e,docked:t}),Hde=n=>({measure:n});function $de(n,e){if(n&1&&(u(0,"mat-icon"),z(1,"country-flag",8),h()),n&2){let t=v(2);f(),w("mmsi",t.mmsi)("host",t.app.hostDef.url)}}function Kde(n,e){if(n&1&&z(0,"mat-icon",9),n&2){let t=v(2);Et(t.icon==null?null:t.icon.class),w("svgIcon",t.icon.svgIcon)}}function qde(n,e){if(n&1&&(u(0,"mat-icon"),_(1),h()),n&2){let t=v(2);Et(t.icon==null?null:t.icon.class),f(),X(t.icon==null?null:t.icon.name)}}function Zde(n,e){if(n&1&&_(0),n&2){let t=v(2);K(" \xA0",t.title," ")}}function Xde(n,e){if(n&1){let t=H();u(0,"div")(1,"button",10),T("click",function(){O(t);let r=v(2);return F(r.handleClose())}),u(2,"mat-icon"),_(3,"close"),h()()()}}function Yde(n,e){if(n&1){let t=H();u(0,"div")(1,"button",11),T("click",function(){O(t);let r=v(2);return F(r.handleNavTo())}),u(2,"mat-icon"),_(3,"near_me"),h()()()}}function Qde(n,e){if(n&1&&(u(0,"div",2)(1,"div",5),R(2,$de,2,2,"mat-icon"),R(3,Kde,1,3,"mat-icon",6)(4,qde,2,3,"mat-icon",7),R(5,Zde,1,1),h(),R(6,Xde,4,0,"div"),R(7,Yde,4,0,"div"),h()),n&2){let t=v();f(),w("ngClass",Gi(6,Hde,t.measure)),f(),A(t.mmsi?2:-1),f(),A(t.icon!=null&&t.icon.svgIcon?3:t.icon!=null&&t.icon.name?4:-1),f(2),A(t.title?5:-1),f(),A(t.canClose?6:-1),f(),A(!t.canClose&&t.navTo?7:-1)}}var jn=class n{title;mmsi;icon;canClose=!0;measure=!1;compact=!1;docked=!1;navTo=!1;closed=new me;navigateTo=new me;box;app=M(oe);placement=$("top");overlay=M(Su,{optional:!0});resizeObserver;constructor(){ss(()=>{this.updatePlacement(),typeof ResizeObserver<"u"&&(this.resizeObserver=new ResizeObserver(()=>this.updatePlacement()),this.resizeObserver.observe(this.box.nativeElement))}),this.overlay?.repositioned.pipe(Zt()).subscribe(()=>this.updatePlacement()),M(gi).onDestroy(()=>this.resizeObserver?.disconnect())}updatePlacement(){let e=this.box?.nativeElement,t=e?.offsetParent;if(this.docked||!t)return;e.style.maxHeight="";let i=e.closest(".ol-viewport")?.getBoundingClientRect(),r=KG({anchorY:t.getBoundingClientRect().top,height:e.getBoundingClientRect().height,top:Math.max(i?.top??0,0),bottom:Math.min(i?.bottom??window.innerHeight,window.innerHeight)}),o=r.maxHeight!==void 0;e.style.maxHeight=o?`${r.maxHeight}px`:"",e.classList.toggle("capped",o),this.placement.set(r.placement)}handleClose(){this.closed.emit()}handleNavTo(){this.navigateTo.emit()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["ap-popover"]],viewQuery:function(t,i){if(t&1&&Ot(jde,7),t&2){let r;Ee(r=Ie())&&(i.box=r.first)}},inputs:{title:"title",mmsi:"mmsi",icon:"icon",canClose:"canClose",measure:"measure",compact:"compact",docked:"docked",navTo:"navTo"},outputs:{closed:"closed",navigateTo:"navigateTo"},ngContentSelectors:Ude,decls:6,vars:10,consts:[["box",""],[1,"popover","in","mat-app-background",3,"ngClass"],[1,"popover-title"],[1,"popover-content"],[1,"arrow",2,"left","50%"],[2,"flex","1 1 auto","overflow","hidden","display","-webkit-box","-webkit-box-orient","vertical","-webkit-line-clamp","1","line-clamp","1","text-overflow","ellipsis",3,"ngClass"],[3,"class","svgIcon"],[3,"class"],[3,"mmsi","host"],[3,"svgIcon"],["mat-icon-button","",3,"click"],["mat-icon-button","","matTooltip","Navigate to here",3,"click"]],template:function(t,i){t&1&&(fe(),u(0,"div",1,0),R(2,Qde,8,8,"div",2),u(3,"div",3),de(4),h(),z(5,"div",4),h()),t&2&&(ht("top",i.placement()==="top")("bottom",i.placement()==="bottom"),w("ngClass",nh(6,Wde,i.measure,i.compact,i.docked)),f(2),A(i.title||i.icon||i.mmsi||i.canClose||i.navTo?2:-1))},dependencies:[mn,Rn,ue,Fe,ye,Te,se,ce,LC],styles:['.popover[_ngcontent-%COMP%]{position:absolute;top:0;left:0;transform:translate(-50%,-100%);z-index:3990;display:block;max-width:276px;min-width:270px;padding:1px;font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;-webkit-background-clip:padding-box;background-clip:padding-box;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px #0003;line-break:auto}.popover.top[_ngcontent-%COMP%]{margin-top:-10px;margin-left:10px}.popover.bottom[_ngcontent-%COMP%]{transform:translate(-50%);margin-top:10px;margin-left:10px}.popover-title[_ngcontent-%COMP%]{padding:2px 0 2px 5px;margin:0;display:flex;line-height:2.5em;font-size:12pt;background-color:#fafafa82;border-radius:5px 5px 0 0;min-width:110px}.popover-content[_ngcontent-%COMP%]{padding:9px 14px;max-height:330px;overflow:auto}.popover.capped[_ngcontent-%COMP%]{display:flex;flex-direction:column}.popover.capped[_ngcontent-%COMP%] > .popover-title[_ngcontent-%COMP%]{flex-shrink:0}.popover.capped[_ngcontent-%COMP%] > .popover-content[_ngcontent-%COMP%]{flex:1 1 auto;min-height:0}.popover[_ngcontent-%COMP%] > .arrow[_ngcontent-%COMP%], .popover[_ngcontent-%COMP%] > .arrow[_ngcontent-%COMP%]:after{position:absolute;display:block;width:0;height:0;border-style:solid}.popover[_ngcontent-%COMP%] > .arrow[_ngcontent-%COMP%]{border-width:11px}.popover[_ngcontent-%COMP%] > .arrow[_ngcontent-%COMP%]:after{content:"";border-width:10px}.popover.top[_ngcontent-%COMP%] > .arrow[_ngcontent-%COMP%]{bottom:-11px;left:50%;margin-left:-11px;border-bottom-width:0;border-right-width:0;border-left-width:0}.popover.top[_ngcontent-%COMP%] > .arrow[_ngcontent-%COMP%]:after{bottom:1px;margin-left:-10px;content:" ";border-bottom-width:0}.popover.bottom[_ngcontent-%COMP%] > .arrow[_ngcontent-%COMP%]{top:-11px;left:50%;margin-left:-11px;border-top-width:0;border-right-width:0;border-left-width:0}.popover.bottom[_ngcontent-%COMP%] > .arrow[_ngcontent-%COMP%]:after{top:1px;margin-left:-10px;content:" ";border-top-width:0}.popover.measure[_ngcontent-%COMP%]{min-width:100px;background-color:#39c}.popover.measure[_ngcontent-%COMP%] > .popover-content[_ngcontent-%COMP%]{display:none}.popover.measure[_ngcontent-%COMP%] > .popover-title[_ngcontent-%COMP%]{color:#fff;font-weight:700;border-bottom:none;background-color:inherit;text-align:left;width:max-content}.popover.top.measure[_ngcontent-%COMP%] > .arrow[_ngcontent-%COMP%]{bottom:-11px;left:50%;margin-left:-11px;border-bottom-width:0;border-right-width:0;border-left-width:0}.popover.top.measure[_ngcontent-%COMP%] > .arrow[_ngcontent-%COMP%]:after{bottom:1px;margin-left:-10px;content:" ";border-bottom-width:0;border-top-color:#39c}.popover.bottom.measure[_ngcontent-%COMP%] > .arrow[_ngcontent-%COMP%]:after{border-bottom-color:#39c}.popover-action-button[_ngcontent-%COMP%]{flex:1 1 45%}.popover.docked[_ngcontent-%COMP%]{position:static;transform:none;margin:0}.popover.docked[_ngcontent-%COMP%] > .arrow[_ngcontent-%COMP%]{display:none}.popover.compact[_ngcontent-%COMP%]{min-width:0;max-width:170px;width:fit-content}.popover.compact[_ngcontent-%COMP%] > .popover-title[_ngcontent-%COMP%]{padding:0;line-height:0;min-height:0;min-width:unset}.popover.compact[_ngcontent-%COMP%] > .popover-content[_ngcontent-%COMP%]{padding:6px 10px}'],changeDetection:0})};var Jde=n=>({class:"",name:n});function eue(n,e){if(n&1&&(u(0,"li"),_(1),h()),n&2){let t=e.$implicit;f(),X(t)}}function tue(n,e){if(n&1&&(u(0,"ol",4),Ae(1,eue,2,1,"li",null,wt),h()),n&2){let t=v(2);f(),Le(t.mode.steps)}}function iue(n,e){if(n&1){let t=H();u(0,"div",0)(1,"ap-popover",2),T("closed",function(){O(t);let r=v();return F(r.close())}),z(2,"fb-measurements",3),R(3,tue,3,0,"ol",4),u(4,"div",5)(5,"div",6)(6,"button",7),T("click",function(){O(t);let r=v();return F(r.undoLast())}),u(7,"mat-icon"),_(8,"undo"),h(),_(9," UNDO "),h()(),u(10,"div",6)(11,"button",8),T("click",function(){O(t);let r=v();return F(r.finishEditing())}),u(12,"mat-icon"),_(13,"check"),h(),_(14),h()(),u(15,"div",6)(16,"button",9),T("click",function(){O(t);let r=v();return F(r.close())}),u(17,"mat-icon",10),_(18,"close"),h(),_(19," CANCEL "),h()()()()()}if(n&2){let t=v();f(),w("docked",!0)("canClose",!0)("title",t.mode.iconText)("icon",Gi(13,Jde,t.mode.iconName)),f(),w("coords",t.mapInteract.measurement().coords)("index",t.mapInteract.measurement().index)("totalOnly",t.mapInteract.isDrawing())("card",!0),f(),A(t.mode.steps.length!==0?3:-1),f(3),w("disabled",!t.mapInteract.canUndo()),f(5),w("disabled",!t.canFinish())("matTooltip",t.mapInteract.isModifying()?"Save changes":"Finish \u2014 keep changes"),f(3),K(" ",t.mapInteract.isModifying()?"SAVE":"FINISH"," ")}}function nue(n,e){if(n&1&&(u(0,"div",14),_(1),h()),n&2){let t=v(3);f(),K(" ",t.mode.description," ")}}function rue(n,e){if(n&1&&(u(0,"li"),_(1),h()),n&2){let t=e.$implicit;f(),X(t)}}function oue(n,e){if(n&1&&(u(0,"div",14)(1,"ol",17),Ae(2,rue,2,1,"li",null,wt),h()()),n&2){let t=v(3);f(2),Le(t.mode.steps)}}function aue(n,e){if(n&1){let t=H();u(0,"div",11)(1,"div")(2,"span",13)(3,"mat-icon"),_(4),h(),_(5),h(),R(6,nue,2,1,"div",14),R(7,oue,4,0,"div",14),h(),u(8,"div",15)(9,"a",16),T("click",function(){O(t);let r=v(2);return F(r.close())}),u(10,"mat-icon",10),_(11,"close"),h(),_(12),h()()()}if(n&2){let t=v(2);f(4),X(t.mode.iconName),f(),K(" ",t.mode.iconText," "),f(),A(t.mode.description.length!==0?6:-1),f(),A(t.mode.steps.length!==0?7:-1),f(2),w("matTooltip",t.mapInteract.isModifying()?"Finish Editing":"Cancel Operation"),f(3),K(" ",t.mapInteract.isModifying()?"FINISH":"CANCEL"," ")}}function sue(n,e){if(n&1){let t=H();u(0,"fb-measurements",18),T("cancel",function(){O(t);let r=v(2);return F(r.close())}),h()}if(n&2){let t=v(2);w("coords",t.mapInteract.measurement().coords)("index",t.mapInteract.measurement().index)}}function lue(n,e){if(n&1&&(u(0,"div",1),R(1,aue,13,6,"div",11),R(2,sue,1,2,"fb-measurements",12),h()),n&2){let t=v();f(),A(t.showHelpPanel()?1:-1),f(),A(t.showMeasurePanel()?2:-1)}}var qG=class n{finish=xe();cancel=xe();undo=xe();showHelpPanel;showMeasurePanel;isRouteEditing;canFinish;mode={iconName:"",iconText:"",description:"",steps:[]};app=M(oe);mapInteract=M(Tc);constructor(){this.showHelpPanel=Qe(()=>this.mapInteract.isDrawing()&&this.mapInteract.draw.resourceType!=="route"||this.mapInteract.isModifying()||this.mapInteract.isBoxSelecting()||this.mapInteract.isMeasuring()&&this.mapInteract.measureGeometryType==="Circle"),this.showMeasurePanel=Qe(()=>this.mapInteract.isMeasuring()&&this.mapInteract.measureGeometryType==="LineString"),this.isRouteEditing=Qe(()=>this.mapInteract.draw.resourceType==="route"&&(this.mapInteract.isDrawing()||this.mapInteract.isModifying())),this.canFinish=Qe(()=>this.mapInteract.isModifying()||this.mapInteract.measurement().coords.length>=2),this.isRouteEditing()?this.mode=this.mapInteract.isDrawing()?{iconName:"edit",iconText:"Draw New Route",description:"",steps:["Click / tap the map to add each point.","Double-click, or press Finish, to end."]}:{iconName:"edit",iconText:this.mapInteract.draw.name?`Modify ${this.mapInteract.draw.name}`:"Modify Route",description:"",steps:["Click and drag to move a point.","Ctrl-Click or press-and-hold to remove a point."]}:this.showHelpPanel()&&(this.mapInteract.isDrawing()?this.mode={iconName:"edit",iconText:"Drawing Help",description:this.mapInteract.draw.resourceType==="region"?"":"Click on the Map where to drop the feature.",steps:this.mapInteract.draw.resourceType==="region"?["Click on the Map to place a vertex of the Region.","Click on the last point to end drawing."]:[]}:this.mapInteract.isModifying()?this.mode={iconName:"edit",iconText:"Modify",description:this.mapInteract.draw.forSave.id==="anchor"?"Click and drag to move anchor.":"",steps:this.mapInteract.draw.forSave.id!=="anchor"?["Click and drag to move point.","Ctrl-Click or press-and-hold to remove point from a line."]:[]}:this.mapInteract.isBoxSelecting()?this.mode={iconName:"highlight_alt",iconText:"Select",description:"",steps:["Click and drag to select area.","On touch devices, press and hold then drag."]}:this.mapInteract.isMeasuring()&&this.mapInteract.measureGeometryType==="Circle"&&(this.mode={iconName:"straighten",iconText:"Measure",description:"",steps:["Click on the Map to start.","On touch devices, press and hold then move."]}))}close(){this.cancel.emit()}finishEditing(){this.finish.emit()}undoLast(){this.undo.emit()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["fb-interact-help"]],outputs:{finish:"finish",cancel:"cancel",undo:"undo"},decls:2,vars:1,consts:[[1,"_ap_interact_dock"],[1,"mat-app-background","_ap_interact_help"],[3,"closed","docked","canClose","title","icon"],[3,"coords","index","totalOnly","card"],[1,"_ap_steps"],[1,"_ap_action_row"],[1,"_ap_action_button"],["mat-button","","matTooltip","Undo last change (Ctrl/Cmd-Z)","matTooltipPosition","after",3,"click","disabled"],["mat-button","","color","primary","matTooltipPosition","after",3,"click","disabled","matTooltip"],["mat-button","","matTooltip","Cancel \u2014 discard changes","matTooltipPosition","after",1,"icon-warn",3,"click"],[1,"icon-warn"],[1,"mat-app-background","measurePanel"],["matTooltip","Click on the Map to start. Click cancel or the last point to end.",3,"coords","index"],[2,"font-weight","bold","padding","5px"],[2,"padding","5px"],[2,"text-align","center","padding","6px 0 8px"],["mat-raised-button","","matTooltipPosition","left",1,"icon-warn",3,"click","matTooltip"],[2,"margin-block-start","0.2em","margin-block-end","0.2em","padding-inline-start","15px"],["matTooltip","Click on the Map to start. Click cancel or the last point to end.",3,"cancel","coords","index"]],template:function(t,i){t&1&&R(0,iue,20,15,"div",0)(1,lue,3,2,"div",1),t&2&&A(i.isRouteEditing()?0:1)},dependencies:[se,ce,ue,Ze,Te,Rt,AC,jn],styles:["._ap_interact_help[_ngcontent-%COMP%]{position:fixed;min-width:200px;top:60px;left:50px;border:black 1px solid;font-family:roboto;font-size:10pt}._ap_interact_dock[_ngcontent-%COMP%]{position:fixed;top:60px;left:50px;font-family:roboto;font-size:10pt}._ap_steps[_ngcontent-%COMP%]{margin-block-start:.2em;margin-block-end:.4em;padding-inline-start:18px}._ap_action_row[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap}._ap_action_button[_ngcontent-%COMP%]{flex:1 1 45%}._ap_row[_ngcontent-%COMP%]{display:flex;flex-wrap:no-wrap;flex:2}._ap_row[_ngcontent-%COMP%] .icon-label[_ngcontent-%COMP%]{width:30px}._ap_row[_ngcontent-%COMP%] .row-label[_ngcontent-%COMP%]{font-weight:500;min-width:60px}._ap_measurements[_ngcontent-%COMP%] .value[_ngcontent-%COMP%]{padding-right:10px}@media only screen and (max-width:500px){._ap_measurements[_ngcontent-%COMP%]{left:0;width:100%}}"],changeDetection:0})};var ZG=70,cue=40,Mt=class n{reOpen;app=M(oe);dialog=M(ln);chartPaletteRef;chartPaletteEdit;signalk=M(Lt);worker=M(Nn);mapInteract=M(Tc);constructor(){this.worker.resource$().subscribe(e=>this.processResourceMessage(e)),Me(()=>{let e=this.chartCacheSignal();ha(()=>this.syncChartTimeRefreshers(e))})}selectionIsFiltered(e){return Array.isArray(this.app.config.selections[e])}selectionHas(e,t){return!this.app.config.selections[e]||!this.selectionIsFiltered(e)?!1:this.app.config.selections[e].includes(t)}selectionAdd(e,t){if(!(typeof this.app.config.selections[e]>"u")&&this.selectionIsFiltered(e)){let i=typeof t=="string"?[t]:t;i=i.filter(r=>!this.app.config.selections[e].includes(r)),this.app.config.selections[e]=this.app.config.selections[e].concat(i),this.app.saveConfig()}}selectionRemove(e,t){if(!(typeof this.app.config.selections[e]>"u")&&this.selectionIsFiltered(e)){let i=typeof t=="string"?[t]:t;this.app.config.selections[e]=this.app.config.selections[e].filter(r=>!i.includes(r)),this.app.saveConfig()}}selectionUnfilter(e){this.app.config.selections[e]=null,this.app.saveConfig()}selectionClear(e){this.app.config.selections[e]=[],this.app.saveConfig()}selectionClean(e,t){Array.isArray(this.app.config.selections[e])&&(this.app.config.selections[e]=this.app.config.selections[e].filter(i=>t.includes(i)),this.app.saveConfig())}fetchRelatedNotes(e,t){return Y(this,null,function*(){try{return yield this.listFromServer("notes",`href=/resources/${e}/${t}`)}catch(i){return[]}})}getCacheRef(e){switch(e){case"routes":return this.routeCacheSignal;case"waypoints":return this.waypointCacheSignal;case"notes":return this.noteCacheSignal;case"regions":return this.regionCacheSignal;case"charts":return this.chartCacheSignal;case"tracks":return this.trackCacheSignal}}fromCache(e,t){if(["routes","waypoints","notes","regions","charts","tracks"].includes(e)){let i=this.getCacheRef(e);if(!i){this.app.showAlert("Error","Collection not found!");return}return i().find(r=>r[0]===t)}else return!this.app.data[e]||!Array.isArray(this.app.data[e])?void 0:this.app.data[e].find(r=>r[0]===t)??void 0}listFromServer(e,t){return t?t=t.startsWith("?")?t:`?${t}`:t="",new Promise((i,r)=>{this.signalk.api.get(this.app.skApiVersion,`/resources/${e}${t}`)?.subscribe(a=>{let s=[];Object.keys(a).forEach(l=>{s.push([l,this.transform(e,a[l],l),this.selectionIsFiltered(e)?this.selectionHas(e,l):!0])}),i(s)},a=>r(a))})}fromServer(e,t){return new Promise((i,r)=>{this.signalk.api.get(this.app.skApiVersion,`/resources/${e}/${t}`).subscribe(o=>i(this.transform(e,o,t)),o=>r(o))})}transform(e,t,i){switch(e){case"regions":return this.transformRegion(t,i);case"routes":return this.transformRoute(t,i);case"waypoints":return this.transformWaypoint(t,i);case"notes":return this.transformNote(t,i);case"charts":return this.transformChart(t,i);case"tracks":return this.transformTrack(t)}}deleteFromServer(e,t,i){let r=i?`?provider=${i}`:"";return new Promise((o,a)=>{this.signalk.api.delete(this.app.skApiVersion,`/resources/${e}/${t}${r}`).subscribe(()=>o(),s=>a(s))})}putToServer(e,t,i,r){let o=r?`?provider=${r}`:"";return new Promise((a,s)=>{this.signalk.api.put(this.app.skApiVersion,`/resources/${e}/${t}${r?o:""}`,i).subscribe(l=>a(l),l=>s(l))})}postToServer(e,t){return new Promise((i,r)=>{this.signalk.api.post(this.app.skApiVersion,`/resources/${e}`,t).subscribe(o=>i(o),o=>r(o))})}processResourceMessage(e){if(!Array.isArray(e))return;let t={routes:!1,waypoints:!1,notes:!1,regions:!1,charts:!1};e.forEach(i=>{let r=i.path.split(".");if(r.length===3){let o=r[1],a=r[2];if(o==="charts"&&this.absorbChartDelta(a,i.value))return;o in t&&(t[o]=!0),this.selectionIsFiltered(o)&&!i.value&&this.app.config.selections[o].includes(a)&&(this.app.config.selections[o].splice(this.app.config.selections[o].indexOf(a),1),this.app.saveConfig())}}),t.routes&&this.refreshRoutes(),t.waypoints&&this.refreshWaypoints(),t.regions&&this.refreshRegions(),t.notes&&this.refreshNotes(),t.charts&&this.refreshCharts()}absorbChartDelta(e,t){let i=this.chartCacheSignal().find(a=>a[0]===e);if(!i||!t||typeof t!="object")return!1;let r;try{r=this.transformChart(ne({},t),e)}catch(a){return!1}let o=a=>{let s=this.withoutLocalState(a);return delete s.time,JSON.stringify(s)};return o(r)!==o(i[1])?!1:(this.chartSetTimeDimension(e,r.time),!0)}resourceProperties(e){switch(e.type){case"waypoint":this.editWaypointInfo(e.id);break;case"route":this.editRouteInfo(e.id);break;case"note":this.showNoteDetails(e.id);break;case"region":this.editRegionInfo(e.id);break;case"chart":this.editChartInfo(e.id);break;case"track":this.editTrackInfo(e.id);break}}chartCacheSignal=$([]);charts=this.chartCacheSignal.asReadonly();chartTimeRefreshers=new Map;appendOSM(e){let t=[["openstreetmap",new oa({name:"World Map",description:"Open Street Map"}),this.app&&this.selectionIsFiltered("charts")?this.app.config.selections.charts.includes("openstreetmap"):!0],["openseamap",new oa({name:"Sea Map",description:"Open Sea Map",url:"https://tiles.openseamap.org/seamark/{z}/{x}/{y}.png",minzoom:1,maxzoom:24,bounds:[-180,-90,180,90],type:"tilelayer"}),this.app&&this.selectionIsFiltered("charts")?this.app.config.selections.charts.includes("openseamap"):!0]];return this.app&&t.forEach(i=>{let r=this.app.config.selections.chartOpacity[i[0]];typeof r<"u"&&(i[1].defaultOpacity=r);let o=this.app.config.selections.chartImageAdjustment?.[i[0]];typeof o<"u"&&(i[1].imageAdjustment=o);let a=this.app.config.selections.chartDisplayMinZoom?.[i[0]];typeof a<"u"&&(i[1].displayMinZoom=a)}),e.push(t[1]),e.unshift(t[0]),e}refreshCharts(e){return Y(this,null,function*(){e&&e[0]!=="?"&&(e="?"+e),this.app.debug(`** refreshCharts(): ${e}`);try{let t=yield this.listChartsFromServer(e);this.appendOSM(t);let i=t.filter(r=>r[2]);i=this.sortByScaleDesc(i),i=this.arrangeChartLayers(i),this.chartCacheSignal.set(this.withShownInstants(i)),this.setMapZoomRange()}catch(t){this.app.debug("** refreshCharts:",t);let i=this.appendOSM([]);this.chartCacheSignal.set(i),this.setMapZoomRange()}this.migrateAdoptedOverlays()})}adoptedOverlays=new Map;leftoverOverlays=new Map;overlaysToTop=new Set;overlaysUnavailable=!1;overlayMigrationTried=!1;listChartsFromServer(e){return Y(this,null,function*(){let t=yield this.listFromServer("charts",e);return this.adoptOverlays(t)})}listOverlays(){return this.overlaysUnavailable?Promise.resolve({}):new Promise(e=>{this.signalk.api.get(this.app.skApiVersion,"/resources/infolayers").subscribe({next:t=>e(t&&typeof t=="object"?t:{}),error:t=>{t?.status===400||t?.status===404?this.overlaysUnavailable=!0:this.app.debug("** listOverlays:",t),e({})}})})}adoptOverlays(e){return Y(this,null,function*(){let t=yield this.listOverlays();this.adoptedOverlays.clear(),this.leftoverOverlays.clear();let i=new Set(e.map(a=>a[0])),r=Array.isArray(this.app.config.selections.chartOrder)?this.app.config.selections.chartOrder:[],o=!1;return Object.entries(t).forEach(([a,s])=>{if(!XI(s))return;let l=ZI(a);if(i.has(l)){this.leftoverOverlays.set(l,a);return}this.adoptedOverlays.set(l,a),r.includes(l)||((!this.selectionIsFiltered("infolayers")||this.selectionHas("infolayers",a))&&this.selectionIsFiltered("charts")&&!this.app.config.selections.charts.includes(l)&&(this.app.config.selections.charts.push(l),o=!0),this.overlaysToTop.add(l)),e.push([l,this.transformChart(PC(a,s),l),this.selectionIsFiltered("charts")?this.selectionHas("charts",l):!0])}),o&&this.app.saveConfig(),e})}migrateAdoptedOverlays(){return Y(this,null,function*(){if(this.overlayMigrationTried||this.adoptedOverlays.size===0&&this.leftoverOverlays.size===0)return;this.overlayMigrationTried=!0;let e=0;for(let[t,i]of this.adoptedOverlays){let r;try{r=yield this.fetchOverlay(i)}catch(a){this.app.debug(`** overlay ${i}: not migrated (read)`,a);continue}let o=this.transformChart(PC(i,r),t);try{yield this.postToServer("charts",this.withoutLocalState(o))}catch(a){this.app.debug(`** overlay ${i}: not migrated (write)`,a);break}this.leftoverOverlays.set(t,i),e++}for(let[t,i]of this.leftoverOverlays)try{yield this.deleteOverlay(i),this.app.debug(`** overlay ${i}: migrated to chart ${t}`)}catch(r){this.app.debug(`** overlay ${i}: not removed`,r)}e>0&&this.refreshCharts()})}fetchOverlay(e){return new Promise((t,i)=>{this.signalk.api.get(this.app.skApiVersion,`/resources/infolayers/${e}`).subscribe({next:r=>{XI(r)?t(r):i(new Error(`Overlay ${e}: not an InfoLayer`))},error:r=>i(r)})})}readChart(e){return Y(this,null,function*(){let t=this.adoptedOverlays.get(e);return t?this.transformChart(PC(t,yield this.fetchOverlay(t)),e):this.fromServer("charts",e)})}deleteOverlay(e){return Y(this,null,function*(){try{yield this.deleteFromServer("infolayers",e)}catch(t){if(t?.status!==404)throw t}})}migrateOverlayWithEdits(e,t){return Y(this,null,function*(){let i=this.adoptedOverlays.get(e);t.identifier=e,yield this.postToServer("charts",this.withoutLocalState(t)),i&&(yield this.deleteOverlay(i)),this.selectionAdd("charts",e),this.refreshCharts()})}withShownInstants(e){let t=new Map;return this.chartCacheSignal().forEach(i=>{typeof i[1]?.timeValue=="string"&&t.set(i[0],i[1].timeValue)}),e.map(i=>{let r=t.get(i[0]);if(r===void 0||!i[1]?.time)return i;let o=new oa(i[1]);return o.timeValue=r,[i[0],o,i[2]]})}transformChart(e,t){e.tilemapUrl&&(e.url=e.tilemapUrl),e.chartLayers&&(e.layers=e.chartLayers),e.serverType&&!e.type&&(e.type=e.serverType),e.type&&(e.url.startsWith("/")||!e.url.startsWith("http"))&&(e.url=this.app.hostDef.url+e.url);let i=e.time?.url;typeof i=="string"&&!/^https?:\/\//i.test(i)&&(e.time=st(ne({},e.time),{url:`${this.app.hostDef.url.replace(/\/+$/,"")}/${i.replace(/^\/+/,"")}`}));let r=typeof e.defaultOpacity=="number"?e.defaultOpacity:null;typeof this.app.config.selections.chartOpacity[t]<"u"&&(e.defaultOpacity=this.app.config.selections.chartOpacity[t]);let o=this.app.config.selections.chartImageAdjustment?.[t];typeof o<"u"&&(e.imageAdjustment=o);let a=this.app.config.selections.chartDisplayMinZoom?.[t];typeof a<"u"&&(e.displayMinZoom=a);let s=new oa(e);return s.resourceOpacity=r,s}setMapZoomRange(e){let t={min:2,max:28};if(e||!this.app.uiConfig().mapConstrainZoom)this.app.MAP_ZOOM_EXTENT=t;else{let i={min:1e3,max:-1};this.chartCacheSignal().forEach(r=>{r[2]&&(r[1].minZoom<i.min&&(i.min=r[1].minZoom),r[1].maxZoom>i.max&&(i.max=r[1].maxZoom))}),this.app.MAP_ZOOM_EXTENT={min:i.min===1e3?t.min:i.min,max:i.max===-1?t.max:i.max},this.app.debug("*** MAP_ZOOM_EXTENT",this.app.MAP_ZOOM_EXTENT)}}deleteChart(e){e&&this.app.showConfirm(`Do you want to delete this Chart source?
|
|
1519
1519
|
`,"Delete Chart:","YES","NO").subscribe(t=>{t&&t.ok&&this.deleteChartFromServer(e).then(()=>this.forgetChartSettings(e)).catch(i=>this.app.parseHttpErrorResponse(i))})}deleteChartFromServer(e){return Y(this,null,function*(){let t=hG(e);if(!t)return this.deleteFromServer("charts",e,"resources-provider");if(!this.adoptedOverlays.has(e))try{yield this.deleteFromServer("charts",e,"resources-provider")}catch(i){if(i?.status!==404)throw i}yield this.deleteOverlay(t),this.refreshCharts()})}forgetChartSettings(e){let t=this.app.config.selections,i=[t.chartOpacity,t.chartImageAdjustment,t.chartDisplayMinZoom,t.chartTimeLoop].filter(r=>e in r);i.length!==0&&(i.forEach(r=>delete r[e]),this.app.saveConfig())}sortByScaleDesc(e){return e.sort((t,i)=>i[1].scale-t[1].scale)}arrangeChartLayers(e){Array.isArray(this.app.config.selections.chartOrder)||(this.app.config.selections.chartOrder=[]);let t=this.app.config.selections.chartOrder;e.forEach(o=>{t.includes(o[0])||t.push(o[0])}),e.forEach(o=>{this.overlaysToTop.has(o[0])&&(this.overlaysToTop.delete(o[0]),t.splice(t.indexOf(o[0]),1),t.push(o[0]))});let i=e.map(o=>o[0]),r=t.filter(o=>i.includes(o));for(let o=0;o<r.length;o++){let a=e.findIndex(s=>s[0]===r[o]);a!==-1&&cl(e,a,o+1)}return e.slice()}chartReorder(){this.chartCacheSignal.update(e=>this.arrangeChartLayers(e))}chartAddFromServer(e){e?this.selectionIsFiltered("charts")&&this.selectionAdd("charts",e):this.selectionUnfilter("charts"),this.refreshCharts()}chartAdd(e){this.chartCacheSignal.update(t=>(this.selectionIsFiltered("charts")&&this.selectionAdd("charts",e.map(i=>i[0])),this.arrangeChartLayers(t.concat(e))))}chartRemove(e){this.chartCacheSignal.update(t=>e?(this.selectionRemove("charts",e),t.filter(i=>!e.includes(i[0]))):(this.selectionClear("charts"),this.app.saveConfig(),[]))}chartSetOpacity(e,t){if(!e||!Number.isFinite(t))return;this.chartCacheSignal().findIndex(r=>r[0]===e)!==-1&&this.chartCacheSignal.update(r=>r.map(o=>{if(o[0]!==e)return o;let a=new oa(o[1]);return a.defaultOpacity=t,[o[0],a,o[2]]}))}chartSetImageAdjustment(e,t){if(!e||!t)return;this.chartCacheSignal().findIndex(r=>r[0]===e)!==-1&&this.chartCacheSignal.update(r=>r.map(o=>{if(o[0]!==e)return o;let a=new oa(o[1]);return a.imageAdjustment=t,[o[0],a,o[2]]}))}chartSetDisplayMinZoom(e,t){if(!e)return;this.chartCacheSignal().findIndex(r=>r[0]===e)!==-1&&this.chartCacheSignal.update(r=>r.map(o=>{if(o[0]!==e)return o;let a=new oa(o[1]);return a.displayMinZoom=t,[o[0],a,o[2]]}))}chartSetTime(e,t){if(!e||t!==null&&!Au(t))return;let i=this.chartCacheSignal().find(r=>r[0]===e);!i||!this.chartIsTemporal(i)||i[1].timeValue===t||this.chartCacheSignal.update(r=>r.map(o=>{if(o[0]!==e)return o;let a=new oa(o[1]);return a.timeValue=t,[o[0],a,o[2]]}))}syncChartTimeRefreshers(e){let t=new Map;e.forEach(i=>{this.chartIsTemporal(i)&&Lu(i[1].refreshInterval)!==void 0&&t.set(i[0],i)}),this.chartTimeRefreshers.forEach((i,r)=>{Lu(t.get(r)?.[1].refreshInterval)!==i.interval&&(clearInterval(i.timer),this.chartTimeRefreshers.delete(r))}),t.forEach((i,r)=>{if(this.chartTimeRefreshers.has(r))return;let o=Lu(i[1].refreshInterval);this.chartTimeRefreshers.set(r,{interval:o,timer:setInterval(()=>this.chartRefreshTimeDimension(r),o),pending:null}),this.chartIsUserAddedMapService(i)&&this.chartRefreshTimeDimension(r)})}chartRefreshTimeDimension(e){return Y(this,null,function*(){let t=this.chartTimeRefreshers.get(e),i=this.chartCacheSignal().find(o=>o[0]===e);if(!t||!i)return;let r=Date.now();if(!(t.pending!==null&&r-t.pending<t.interval)){t.pending=r;try{let o=yield Promise.race([this.chartIsUserAddedMapService(i)?this.chartTimeFromMapService(i):this.readChart(e),new Promise(a=>setTimeout(()=>a(void 0),t.interval))]);if(o&&this.chartSetTimeDimension(e,o.time)&&this.chartIsUserAddedMapService(i)&&!this.adoptedOverlays.has(e)){let a=this.chartCacheSignal().find(s=>s[0]===e);a&&this.putToServer("charts",e,this.withoutLocalState(a[1])).catch(s=>this.app.debug(`** chartRefreshTimeDimension(${e}): write-back failed`,s))}}catch(o){this.app.debug(`** chartRefreshTimeDimension(${e}): re-read failed`,o)}finally{t.pending===r&&(t.pending=null)}}})}chartIsUserAddedMapService(e){let t=e[1]?.type?.toLowerCase();return e[1]?.source?.toLowerCase()==="resources-provider"&&(t==="wms"||t==="wmts")}chartTimeFromMapService(e){return Y(this,null,function*(){let t=e[1].url,i=e[1].type?.toLowerCase()==="wmts"?yield j2(t):yield z2(t);return{time:G2(i,e[1].layers)}})}chartSetTimeDimension(e,t){let i=this.chartCacheSignal().find(r=>r[0]===e);return!i||JSON.stringify(i[1].time)===JSON.stringify(t)?!1:(this.chartCacheSignal.update(r=>r.map(o=>{if(o[0]!==e)return o;let a=new oa(o[1]);return a.time=t,[o[0],a,o[2]]})),!0)}setChartsTime(e,t){Array.isArray(e)&&e.forEach(i=>this.chartSetTime(i,t))}chartIsTemporal(e){let t=e?.[1]?.time;if(!t||Up(t)===null)return!1;let i=e[1].type?.toLowerCase(),r=e[1].format?.toLowerCase(),o=typeof t.url=="string"&&t.url.length>0;return i?i==="tilelayer"?o&&!(r==="pbf"||r==="mvt"):i==="tilejson"?o:i==="wms"||i==="wmts":o}openChartTime(e){let t=e[0],i,r=this.openChartPalette(xC,{width:"320px",data:{text:e[1]?.name??"",dimension:Qe(()=>this.chartCacheSignal().find(o=>o[0]===t)?.[1]?.time),value:Qe(()=>this.chartCacheSignal().find(o=>o[0]===t)?.[1]?.timeValue??null),onChange:o=>{this.chartSetTime(t,o)},loop:this.app.config.selections.chartTimeLoop?.[t]??null,onLoopChange:o=>{i=o},position:this.onScreenPalettePosition(this.app.config.timePalettePos,320),onMoved:o=>{this.app.config.timePalettePos=o,this.app.saveConfig()}}},`time:${t}`);r.afterClosed().subscribe(()=>{let o=this.paletteHandedOver(`time:${t}`,r);this.releaseChartPalette(r),o||this.chartSetTime(t,null),i&&(this.app.config.selections.chartTimeLoop[t]=i,this.app.saveConfig())})}openImageAdjustment(e){let t=e[0],i=ne({brightness:1,contrast:1},this.app.config.selections.chartImageAdjustment[t]??e[1]?.imageAdjustment),r=this.openChartPalette(vC,{width:"290px",data:{text:e[1]?.name??"",value:ne({},i),position:this.onScreenPalettePosition(this.app.config.imageAdjustPalettePos,290),onChange:o=>{this.chartSetImageAdjustment(t,o)},onMoved:o=>{this.app.config.imageAdjustPalettePos=o,this.app.saveConfig()}}},`imageAdjustment:${t}`);r.afterClosed().subscribe(o=>{let a=this.paletteHandedOver(`imageAdjustment:${t}`,r);this.releaseChartPalette(r),o?.apply?(this.app.config.selections.chartImageAdjustment[t]=o.value,this.chartSetImageAdjustment(t,o.value),this.app.saveConfig()):a||this.chartSetImageAdjustment(t,i)})}openDisplayMinZoom(e,t){let i=e[0],r=this.app.config.selections.chartDisplayMinZoom[i]??e[1]?.displayMinZoom,o=this.openChartPalette(bC,{width:"300px",data:{text:e[1]?.name??"",value:r,declaredMin:e[1]?.minZoom,declaredMax:e[1]?.maxZoom,currentZoom:()=>this.app.mapZoom(),onChange:a=>{this.chartSetDisplayMinZoom(i,a)}}},`displayMinZoom:${i}`);o.afterClosed().subscribe(a=>{let s=this.paletteHandedOver(`displayMinZoom:${i}`,o);this.releaseChartPalette(o),a?.apply?(typeof a.value=="number"?this.app.config.selections.chartDisplayMinZoom[i]=a.value:delete this.app.config.selections.chartDisplayMinZoom[i],this.chartSetDisplayMinZoom(i,a.value),this.app.saveConfig(),t?.(a.value)):s||this.chartSetDisplayMinZoom(i,r)})}openChartPalette(e,t,i){this.chartPaletteRef?.close();let r=this.dialog.open(e,ne({hasBackdrop:!1,disableClose:!0,autoFocus:!1,restoreFocus:!1,position:{top:`${ZG}px`,left:`${this.chartDialogLeft()}px`}},t));return this.chartPaletteRef=r,this.chartPaletteEdit=i,r}releaseChartPalette(e){this.chartPaletteRef===e&&(this.chartPaletteRef=void 0,this.chartPaletteEdit=void 0)}paletteHandedOver(e,t){return this.chartPaletteRef!==t&&this.chartPaletteEdit===e}onScreenPalettePosition(e,t){if(!e)return e;let i=this.chartDialogLeft(),r=window.innerWidth-i-t-8,o=-(i-8),a=Math.max(0,window.innerHeight-ZG-cue);return{x:Math.max(o,Math.min(e.x,r)),y:Math.max(0,Math.min(e.y,a))}}chartDialogLeft(){return Math.max(8,Math.min(323,window.innerWidth-300-16))}chartSelected(e){e=Array.isArray(e)?e:[e],e.forEach(t=>{this.selectionHas("charts",t)?this.selectionRemove("charts",t):this.selectionAdd("charts",t)}),this.refreshCharts()}chartsForHostApi(){return Y(this,null,function*(){let e;try{e=this.appendOSM(yield this.listChartsFromServer())}catch(a){this.app.debug("** chartsForHostApi:",a),e=this.appendOSM([])}let t=new Set(e.map(a=>a[0])),i=this.chartCacheSignal().slice().reverse().filter(a=>t.has(a[0])),r=new Set(i.map(a=>a[0])),o=e.filter(a=>!r.has(a[0]));return i.concat(o)})}setChartsVisibility(e,t){return Y(this,null,function*(){if(!Array.isArray(e)||e.length===0)return;let i;try{i=this.appendOSM(yield this.listChartsFromServer())}catch(a){this.app.debug("** setChartsVisibility:",a);return}let r=new Set(i.filter(a=>a[2]).map(a=>a[0])),o=!1;e.forEach(a=>{r.has(a)!==t&&(o=!0,t?r.add(a):r.delete(a))}),o&&(r.size>=i.length?this.selectionUnfilter("charts"):(this.selectionClear("charts"),this.selectionAdd("charts",[...r])),yield this.refreshCharts())})}setChartsOpacity(e,t){!Array.isArray(e)||!Number.isFinite(t)||t<0||t>1||(e.forEach(i=>{this.app.config.selections.chartOpacity[i]=t,this.chartSetOpacity(i,t)}),this.app.saveConfig())}setChartsOrder(e){if(!Array.isArray(e))return;let t=Array.isArray(this.app.config.selections.chartOrder)?this.app.config.selections.chartOrder.slice():[],i=e.slice().reverse(),r=new Set(i),o=t.filter(a=>!r.has(a));this.app.config.selections.chartOrder=o.concat(i),this.app.saveConfig(),this.chartReorder()}newChart(e){e&&this.dialog.open(d1,{disableClose:!0,data:e}).afterClosed().subscribe(t=>Y(this,null,function*(){if(t.save)try{let i=yield this.postToServer("charts",this.withoutLocalState(t.chart));this.selectionAdd("charts",i.id)}catch(i){this.app.parseHttpErrorResponse(i)}}))}editChartInfo(e){return Y(this,null,function*(){if(!e)return;let t;if(["openseamap","openstreetmap"].includes(e))t=new oa({name:e==="openseamap"?"Sea Map":"World Map",description:e==="openseamap"?"Open Sea Map":"Open Street Map",url:`https://${e==="openseamap"?"tiles.openseamap.org/seamark":"tile.openstreetmap.org}/{z}/{x}/{y}.png"}`,minzoom:1,maxzoom:24,bounds:[-180,-90,180,90],type:"tilelayer"});else try{this.app.sIsFetching.set(!0),t=yield this.readChart(e),this.app.sIsFetching.set(!1)}catch(i){this.app.sIsFetching.set(!1),this.app.parseHttpErrorResponse(i);return}this.dialog.open(d1,{disableClose:!0,data:t}).afterClosed().subscribe(i=>{i.save&&(this.adoptedOverlays.has(e)?this.migrateOverlayWithEdits(e,i.chart):this.putToServer("charts",e,this.withoutLocalState(i.chart))).catch(o=>this.app.parseHttpErrorResponse(o))})})}withoutLocalState(e){let t=ne({},e);return e.resourceOpacity===null?delete t.defaultOpacity:typeof e.resourceOpacity=="number"&&(t.defaultOpacity=e.resourceOpacity),delete t.resourceOpacity,delete t.imageAdjustment,delete t.displayMinZoom,delete t.timeValue,t}seedChartCache(e,t){return Y(this,null,function*(){if(!e||!Array.isArray(t)){this.app.showAlert("Selection Error","Invalid selection data!");return}let i=r=>({minLon:r[0][0],minLat:r[0][1],maxLon:r[1][0],maxLat:r[1][1]});if(t.length!==2){this.app.showAlert("Selection Error","Invalid selection!");return}this.dialog.open(RC,{data:{chart:e,bbox:t}}).afterClosed().subscribe(r=>{if(r>0){let o={bbox:i(t),maxZoom:r};this.app.debug(`Submit chart seed job ${JSON.stringify(o)} for chart ${e[0]}`),this.signalk.post(`/signalk/chart-tiles/cache/${e[0]}`,o).subscribe({next:()=>{this.app.showAlert("Chart Cache","Tile cache seed job created successfully.")},error:a=>{this.app.parseHttpErrorResponse(a)}})}})})}routeCacheSignal=$([]);routes=this.routeCacheSignal.asReadonly();refreshRoutes(e){return Y(this,null,function*(){e&&e[0]!=="?"&&(e="?"+e),this.app.debug(`** refreshRoutes(): ${e}`);try{this.app.data.activeRoute&&this.selectionAdd("routes",this.app.data.activeRoute);let i=(yield this.listFromServer("routes",e)).filter(r=>r[2]);this.routeCacheSignal.set(i)}catch(t){this.app.debug("** refreshRoutes:",t),this.routeCacheSignal.set([])}})}transformRoute(e,t){if(typeof e.start<"u"&&delete e.start,typeof e.end<"u"&&delete e.end,typeof e.name>"u"&&(e.name="Rte-"+t.slice(-6)),e.feature&&!e.feature.properties&&(e.feature.properties={}),typeof e.feature?.properties?.points<"u"&&!Array.isArray(e.feature.properties.points)&&e.feature.properties.points.names&&Array.isArray(e.feature.properties.points.names)){let i=[];e.feature.properties.points.names.forEach(r=>{r?i.push({name:r}):i.push({name:""})}),e.feature.properties.coordinatesMeta=i,delete e.feature.properties.points}return e.feature?.properties?.coordinatesMeta&&e.feature.properties.coordinatesMeta.length!==e.feature.geometry.coordinates.length&&delete e.feature.properties.coordinatesMeta,new Ts(e)}routeAddFromServer(e){e?this.selectionIsFiltered("routes")&&this.selectionAdd("routes",e):this.selectionUnfilter("routes"),this.refreshRoutes()}routeAdd(e){this.routeCacheSignal.update(t=>(this.selectionIsFiltered("routes")&&this.selectionAdd("routes",e.map(i=>i[0])),t.concat(e)))}routeRemove(e){this.routeCacheSignal.update(t=>e?(this.selectionRemove("routes",e),t.filter(i=>!e.includes(i[0]))):(this.selectionClear("routes"),[]))}routeHide(e){if(!this.selectionIsFiltered("routes")){let t=this.routeCacheSignal().map(i=>i[0]);this.selectionClear("routes"),this.selectionAdd("routes",t)}this.routeRemove([e])}buildRoute(e){let t=new Ts,i=this.signalk.uuid;return t.feature.geometry.coordinates=ri.normaliseCoords(e),t.distance=ri.routeLength(t.feature.geometry.coordinates),[i,t,!0]}newRouteAt(e,t){if(!e)return;let i=this.buildRoute(e);t&&Array.isArray(t)&&(i[1].feature.properties.coordinatesMeta=t),this.newRoute(i[1])}newRoute(e){e&&this.dialog.open(cg,{disableClose:!0,data:{title:"New Route",route:e}}).afterClosed().subscribe(t=>Y(this,null,function*(){if(t.save)try{let i=yield this.postToServer("routes",t.route);this.selectionAdd("routes",i.id)}catch(i){this.app.parseHttpErrorResponse(i)}}))}saveNewRoute(e){return new Promise((t,i)=>{this.dialog.open(cg,{disableClose:!0,data:{title:"Route Details",route:e}}).afterClosed().subscribe(r=>Y(this,null,function*(){if(r?.save)try{let o=yield this.postToServer("routes",r.route);this.selectionAdd("routes",o.id),t(o.id)}catch(o){this.app.parseHttpErrorResponse(o),i(o)}else t(null)}))})}editRouteInfo(e){return Y(this,null,function*(){if(!e)return;let t;try{this.app.sIsFetching.set(!0),t=yield this.fromServer("routes",e),this.app.sIsFetching.set(!1)}catch(i){this.app.sIsFetching.set(!1),this.app.parseHttpErrorResponse(i);return}this.dialog.open(cg,{disableClose:!0,data:{title:"Route Details",addMode:!1,route:t}}).afterClosed().subscribe(i=>{i.save&&(IG(i.route),this.putToServer("routes",e,i.route).catch(r=>this.app.parseHttpErrorResponse(r)))})})}deleteRoute(e){return Y(this,null,function*(){if(!e)return!1;let t=yield this.fetchRelatedNotes("routes",e),i=t?.length!==0?"Delete attached Notes.":"";return new Promise(r=>{this.app.showConfirm(`Do you want to delete this Route from the server?
|
|
1520
1520
|
`,"Delete Route:","YES","NO",i).subscribe(o=>Y(this,null,function*(){if(o&&o.ok)try{if(yield this.deleteFromServer("routes",e),o.checked){let a=yield Promise.allSettled(t.map(s=>this.deleteFromServer("notes",s[0])));for(let s of a)s.status==="rejected"&&this.app.parseHttpErrorResponse(s.reason)}r(!0)}catch(a){this.app.parseHttpErrorResponse(a),r(!1)}else r(!1)}))})})}updateRouteCoords(e,t,i){let r=this.fromCache("routes",e);if(!r)return Promise.resolve(!1);let o=r[1];return o.feature.geometry.coordinates=ri.normaliseCoords(t),o.distance=ri.routeLength(o.feature.geometry.coordinates),i&&(o.feature.properties.coordinatesMeta=FG(i)),this.putToServer("routes",e,o).then(()=>!0).catch(a=>(this.app.parseHttpErrorResponse(a),!1))}waypointCacheSignal=$([]);waypoints=this.waypointCacheSignal.asReadonly();refreshWaypoints(e){return Y(this,null,function*(){e&&e[0]!=="?"&&(e="?"+e),this.app.debug(`** refreshWaypoints(): ${e}`);try{this.app.data.activeWaypoint&&this.selectionAdd("waypoints",this.app.data.activeWaypoint);let i=(yield this.listFromServer("waypoints",e)).filter(r=>r[2]);this.waypointCacheSignal.set(i)}catch(t){this.app.debug("** refreshWaypoints:",t),this.waypointCacheSignal.set([])}})}transformWaypoint(e,t){if(typeof e.position<"u"&&delete e.position,e.feature&&!e.feature.properties&&(e.feature.properties={}),!e.name)if(e.feature.properties.name)e.name=e.feature.properties.name,delete e.feature.properties.name;else{let i="Wpt-"+t.slice(-6);e.name=i}return e.description||(e.feature.properties.description?(e.description=e.feature.properties.description,delete e.feature.properties.description):e.feature.properties.cmt&&(e.description=e.feature.properties.cmt)),e.feature.properties.skType&&(e.type=e.feature.properties.skType,delete e.feature.properties.skType),e.type&&(e.type=e.type.toLowerCase()),new Od(e)}waypointAddFromServer(e){e?this.selectionIsFiltered&&this.selectionAdd("waypoints",e):this.selectionUnfilter("waypoints"),this.refreshWaypoints()}waypointAdd(e){this.waypointCacheSignal.update(t=>(this.selectionIsFiltered("waypoints")&&this.selectionAdd("waypoints",e.map(i=>i[0])),t.concat(e)))}waypointRemove(e){this.waypointCacheSignal.update(t=>e?(this.selectionRemove("waypoints",e),t.filter(i=>!e.includes(i[0]))):(this.selectionClear("waypoints"),[]))}buildWaypoint(e){let t=new Od,i=this.signalk.uuid;return t.feature.geometry.coordinates=ri.normaliseCoords(e),[i,t,!0]}newWaypointAt(e,t){if(!e)return;let i=this.buildWaypoint(e);i[1].name=t??`Wpt-${Date.now().toString().slice(-5)}`,this.newWaypoint(i[1])}newWaypoint(e){e&&this.dialog.open(u1,{disableClose:!0,data:{title:"New Waypoint",waypoint:e}}).afterClosed().subscribe(t=>Y(this,null,function*(){if(t.save)try{let i=yield this.postToServer("waypoints",t.waypoint);this.selectionAdd("waypoints",i.id)}catch(i){this.app.parseHttpErrorResponse(i)}}))}editWaypointInfo(e){return Y(this,null,function*(){if(!e)return;let t;try{this.app.sIsFetching.set(!0),t=yield this.fromServer("waypoints",e),this.app.sIsFetching.set(!1)}catch(i){this.app.sIsFetching.set(!1),this.app.parseHttpErrorResponse(i);return}this.dialog.open(u1,{disableClose:!0,data:{title:"Waypoint Details",addMode:!1,waypoint:t}}).afterClosed().subscribe(i=>{i.save&&this.putToServer("waypoints",e,i.waypoint).catch(r=>this.app.parseHttpErrorResponse(r))})})}deleteWaypoint(e){return Y(this,null,function*(){if(!e)return;let t=yield this.fetchRelatedNotes("waypoints",e),i=t?.length!==0?"Delete attached Notes.":"";this.app.showConfirm(`Do you want to delete this Waypoint from the server?
|
|
1521
1521
|
`,"Delete Waypoint:","YES","NO",i).subscribe(r=>Y(this,null,function*(){if(r&&r.ok)try{yield this.deleteFromServer("waypoints",e),r.checked&&t.forEach(o=>{this.deleteFromServer("notes",o[0])})}catch(o){this.app.parseHttpErrorResponse(o)}}))})}updateWaypointPosition(e,t){if(!e||!t)return;let i=this.fromCache("waypoints",e);if(!i)return;let r=i[1];r.feature.geometry.coordinates=ri.normaliseCoords(t),r.position={latitude:r.feature.geometry.coordinates[1],longitude:r.feature.geometry.coordinates[0]},this.putToServer("waypoints",e,r).catch(o=>{this.app.parseHttpErrorResponse(o)})}regionCacheSignal=$([]);regions=this.regionCacheSignal.asReadonly();refreshRegions(e){return Y(this,null,function*(){e&&e[0]!=="?"&&(e="?"+e),this.app.debug(`** refreshRegions->query: ${e}`);try{let i=(yield this.listFromServer("regions",e)).filter(r=>r[2]);this.regionCacheSignal.set(i)}catch(t){this.app.debug("** refreshRegions:",t)}})}transformRegion(e,t){if(typeof e.geohash<"u"&&typeof e.geohash=="string"){let i=pk.default.decode_bbox(e.geohash),r=new Nd;return r.name="Region-"+t.slice(-6),r.feature.geometry.coordinates=[[[i[1],i[0]],[i[3],i[0]],[i[3],i[2]],[i[1],i[2]],[i[1],i[0]]]],r}else return new Nd(e)}newRegion(e){e&&this.dialog.open(c1,{disableClose:!0,data:{region:e}}).afterClosed().subscribe(t=>Y(this,null,function*(){if(t.save)try{let i=yield this.postToServer("regions",t.region);this.selectionAdd("regions",i.id)}catch(i){this.app.parseHttpErrorResponse(i)}}))}editRegionInfo(e){return Y(this,null,function*(){if(!e)return;let t;try{this.app.sIsFetching.set(!0),t=yield this.fromServer("regions",e),this.app.sIsFetching.set(!1)}catch(i){this.app.sIsFetching.set(!1),this.app.parseHttpErrorResponse(i);return}this.dialog.open(c1,{disableClose:!0,data:{region:t}}).afterClosed().subscribe(i=>{i.save&&this.putToServer("regions",e,i.region).catch(r=>this.app.parseHttpErrorResponse(r))})})}deleteRegion(e){return Y(this,null,function*(){if(!e)return;let t=yield this.fetchRelatedNotes("regions",e),i=t?.length!==0?"Delete attached Notes.":"";this.app.showConfirm(`Do you want to delete this Region from the server?
|
|
@@ -4094,7 +4094,7 @@ Do you want to create a new group?`,"Group").pipe(Zt(this.destroyRef)).subscribe
|
|
|
4094
4094
|
`],encapsulation:2,changeDetection:0})}return n})(),Qz=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=wi({type:n});static \u0275inj=Ci({imports:[Fs,Yz,wn]})}return n})();function p0e(n,e){if(n&1){let t=H();u(0,"button",18),T("click",function(){O(t);let r=v();return F(r.filterKeyUp(""))}),u(1,"mat-icon"),_(2,"close"),h()()}}function h0e(n,e){n&1&&z(0,"mat-progress-bar",15)}function m0e(n,e){if(n&1){let t=H();u(0,"mat-card",19)(1,"mat-card-content")(2,"div",20)(3,"div",21)(4,"div",22)(5,"b"),_(6),h()(),u(7,"div",23),_(8),h(),u(9,"div"),z(10,"i"),h()(),u(11,"div",24)(12,"mat-checkbox",25),T("change",function(r){let o=O(t).$implicit,a=v();return F(a.itemSelect(r.checked,o[0]))}),h()()()(),u(13,"mat-card-actions")(14,"div",7)(15,"div",26)(16,"button",27),T("click",function(){let r=O(t).$implicit,o=v();return F(o.itemDelete(r[0]))}),u(17,"mat-icon"),_(18,"delete"),h()()(),u(19,"div")(20,"button",28),T("click",function(){let r=O(t).$implicit,o=v();return F(o.itemProperties(r[0]))}),u(21,"mat-icon"),_(22,"edit"),h()()()()()()}if(n&2){let t=e.$implicit;f(6),X(t[1].name),f(2),K(" ",t[1].description," "),f(4),w("checked",t[2])("disabled",t[2])}}var Jz=class n{closed=xe();fullList=[];filteredList=$([]);filterText="";selectedGroup;app=M(oe);worker=M(Nn);skgroups=M($r);skres=M(Mt);signalk=M(Lt);constructor(){Me(()=>{this.worker.resourceUpdate().path.includes("resources.groups")&&this.initItems(!0)})}ngOnInit(){this.initItems()}ngOnChanges(){this.initItems()}close(){this.closed.emit()}initItems(e){return Y(this,null,function*(){if(this.app.sIsFetching()){this.app.debug("** isFetching() ... exit.");return}this.app.sIsFetching.set(!(e??!1));try{if(this.app.sIsFetching.set(!1),this.fullList=yield this.skgroups.listFromServer(),this.selectedGroup){let t=this.fullList.find(i=>i[0]===this.selectedGroup);t[2]=!0}this.doFilter()}catch(t){this.app.sIsFetching.set(!1),this.app.parseHttpErrorResponse(t)}})}doFilter(){let e=()=>{t.sort((i,r)=>{let o=i[1].name?.toLowerCase(),a=r[1].name?.toLowerCase();return o>a?1:-1})},t;this.filterText.length===0?t=this.fullList.slice(0):t=this.fullList.filter(i=>i[1].name?.toLowerCase().includes(this.filterText?.toLowerCase())),e(),this.filteredList.update(()=>t.slice(0))}filterKeyUp(e){this.filterText=e??"",this.doFilter()}itemSelect(e,t){let i,r;this.fullList.forEach(o=>{o[0]===t?(o[2]=!0,r=o[1]):o[2]=!1}),this.filteredList.update(o=>(i=o.findIndex(a=>a[0]===t),i!==-1&&(o[i][2]=e),o.forEach(a=>a[2]=a[0]===t),o)),i!==-1&&r&&(e?(this.selectedGroup=t,this.skgroups.applyGroup(t,r)):this.app.saveConfig())}itemProperties(e){this.skgroups.editGroupInfo(e)}itemDelete(e){this.skgroups.deleteGroup(e)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["group-list"]],outputs:{closed:"closed"},features:[Se],decls:30,vars:4,consts:[["ftext",""],[1,"resourcelist"],[2,"border-radius","unset"],[1,"title-block"],[2,"width","50px"],["mat-icon-button","","matTooltip","Close Group List","matTooltipPosition","right",3,"click"],[2,"flex","1 1 auto","padding-top","7px"],[2,"display","flex"],[2,"flex","1 1 auto","padding-left","3px"],["floatLabel","always",2,"width","180px"],["type","text","matInput","",3,"ngModelChange","keyup","ngModel"],["matSuffix","","mat-icon-button",""],["mat-icon-button","","matTooltip","New Group","matTooltipPosition","below",3,"click"],["mat-icon-button","","matTooltip","Reload Groups","matTooltipPosition","below",3,"click"],[1,"resources"],["mode","query"],["itemSize","120",1,"vscroller"],["style","border-bottom: silver 1px outset; border-radius: unset",4,"cdkVirtualFor","cdkVirtualForOf"],["matSuffix","","mat-icon-button","",3,"click"],[2,"border-bottom","silver 1px outset","border-radius","unset"],[2,"display","flex","padding-left","5px"],[2,"flex","1 1 auto","width","215px"],[2,"padding-top","11px","text-overflow","ellipsis","overflow-x","hidden","white-space","pre"],[2,"text-overflow","ellipsis","overflow-x","hidden","white-space","pre"],[2,"text-align","right"],["matTooltip","Display Group Resources","matTooltipPosition","left",3,"change","checked","disabled"],[2,"flex","1 1 auto"],["mat-icon-button","","matTooltip","Delete Group","matTooltipPosition","above",3,"click"],["mat-icon-button","","matTooltip","Edit Group Properties","matTooltipPosition","above",3,"click"]],template:function(t,i){if(t&1){let r=H();u(0,"div",1)(1,"mat-card",2)(2,"mat-card-title")(3,"div",3)(4,"div",4)(5,"button",5),T("click",function(){return i.close()}),u(6,"mat-icon"),_(7,"arrow_back"),h()()(),u(8,"div",6),_(9,"Resource Groups"),h()()(),u(10,"mat-card-content")(11,"div",7)(12,"div",8)(13,"mat-form-field",9)(14,"mat-label"),_(15,"Type to filter list"),h(),u(16,"input",10,0),Qt("ngModelChange",function(a){return O(r),Yt(i.filterText,a)||(i.filterText=a),F(a)}),T("keyup",function(){O(r);let a=Be(17);return F(i.filterKeyUp(a.value))}),h(),R(18,p0e,3,0,"button",11),h()(),u(19,"div")(20,"button",12),T("click",function(){return i.itemProperties(void 0)}),u(21,"mat-icon"),_(22,"add"),h()(),u(23,"button",13),T("click",function(){return i.initItems()}),u(24,"mat-icon"),_(25,"refresh"),h()()()()()(),u(26,"div",14),R(27,h0e,1,0,"mat-progress-bar",15),u(28,"cdk-virtual-scroll-viewport",16),St(29,m0e,23,4,"mat-card",17),h()()()}t&2&&(f(16),Xt("ngModel",i.filterText),f(2),A(i.filterText?18:-1),f(9),A(i.app.sIsFetching()?27:-1),f(2),w("cdkVirtualForOf",i.filteredList()))},dependencies:[ye,Te,se,ce,et,Bt,Xn,ti,Zn,Fi,cn,ue,Fe,Dt,qn,fn,gn,Pt,ui,Gt,Vt,Yn,ka,Ta,Ia,Ea,To,Mr,Qz],styles:[".resourcelist[_ngcontent-%COMP%]{min-width:180px;position:relative;height:100%}.resourcelist[_ngcontent-%COMP%] .title-block[_ngcontent-%COMP%]{padding-left:5px;display:flex}.resourcelist[_ngcontent-%COMP%] .title-block[_ngcontent-%COMP%] .title-text[_ngcontent-%COMP%]{font-family:roboto;font-size:14pt;font-weight:500}.resourcelist[_ngcontent-%COMP%] .resources[_ngcontent-%COMP%]{overflow-y:auto;position:absolute;inset:125px 0 0}.resourcelist[_ngcontent-%COMP%] .resources.vessels[_ngcontent-%COMP%], .resourcelist[_ngcontent-%COMP%] .resources.charts[_ngcontent-%COMP%]{top:160px}.resourcelist[_ngcontent-%COMP%] .vessel-filter[_ngcontent-%COMP%] .filter-label[_ngcontent-%COMP%]{padding-right:8px}.resourcelist[_ngcontent-%COMP%] .vessel-filter[_ngcontent-%COMP%] .filter-toggles[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.resourcelist[_ngcontent-%COMP%] .vessel-filter.stacked[_ngcontent-%COMP%]{flex-direction:column;align-items:flex-start}.resourcelist[_ngcontent-%COMP%] .vessel-filter.stacked[_ngcontent-%COMP%] .filter-toggles[_ngcontent-%COMP%]{width:100%}.resourcelist[_ngcontent-%COMP%] .vessel-filter.stacked[_ngcontent-%COMP%] .filter-toggles[_ngcontent-%COMP%] mat-slide-toggle[_ngcontent-%COMP%]{flex:1 1 0}.resourcelist[_ngcontent-%COMP%] .resources.vessels.buddies[_ngcontent-%COMP%]{top:185px}.resourcelist[_ngcontent-%COMP%] .vscroller[_ngcontent-%COMP%]{position:absolute;inset:0;border-top:silver 1px outset}.resourcelist[_ngcontent-%COMP%] .resources.charts[_ngcontent-%COMP%] .vscroller[_ngcontent-%COMP%]{top:22px;bottom:22px}.resourcelist[_ngcontent-%COMP%] .resources.charts[_ngcontent-%COMP%] .stack-caption[_ngcontent-%COMP%]{position:absolute;left:0;right:0;height:22px;display:flex;align-items:center;padding:0 8px;background:var(--mat-app-background-color);color:var(--mat-app-text-color);font-size:10pt;font-style:italic}.resourcelist[_ngcontent-%COMP%] .resources.charts[_ngcontent-%COMP%] .stack-caption-top[_ngcontent-%COMP%]{top:0;border-bottom:silver 1px outset}.resourcelist[_ngcontent-%COMP%] .resources.charts[_ngcontent-%COMP%] .stack-caption-bottom[_ngcontent-%COMP%]{bottom:0;border-top:silver 1px outset}.resourcelist[_ngcontent-%COMP%] .resources.charts[_ngcontent-%COMP%] .stack-caption-hint[_ngcontent-%COMP%]{flex:1 1 auto;text-align:right;opacity:.7}.chart-drop-placeholder[_ngcontent-%COMP%]{background:#ccc;border:dotted 3px #999;min-height:60px;transition:transform .25s cubic-bezier(0,0,.2,1)}.cdk-drag-preview[_ngcontent-%COMP%]{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-animating[_ngcontent-%COMP%], .cdk-drop-list-dragging[_ngcontent-%COMP%] .mat-mdc-card[_ngcontent-%COMP%]:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}"],changeDetection:0})};var f0e=(n,e)=>e[0];function g0e(n,e){n&1&&z(0,"mat-progress-bar",6)}function _0e(n,e){if(n&1){let t=H();u(0,"mat-card")(1,"mat-card-content")(2,"div",7)(3,"div",8)(4,"mat-checkbox",9),T("change",function(r){let o=O(t),a=o.$implicit,s=o.$index,l=v(2);return F(l.handleCheck(r.checked,a[0],s))}),h()(),u(5,"div",10)(6,"div",11),_(7),h(),u(8,"div",12),_(9),h()(),z(10,"div",8),h()()()}if(n&2){let t=e.$implicit;f(4),w("checked",t[2]),f(3),K(" ",t[1].name," "),f(2),K(" ",t[1].description," ")}}function y0e(n,e){if(n&1&&Ae(0,_0e,11,3,"mat-card",null,f0e),n&2){let t=v();Le(t.resList())}}var ej=class n{constructor(e,t,i,r){this.app=e;this.skresOther=t;this.modalRef=i;this.data=r}app;skresOther;modalRef;data;resList=$([]);title="Resources: ";ngOnInit(){this.data.path!=="undefined"&&(this.title+=this.data.path),this.getItems()}closeModal(){this.modalRef.dismiss()}getItems(e){return Y(this,null,function*(){try{e||this.app.sIsFetching.set(!0);let t=yield this.skresOther.customListFromServer(this.data.path,"ResourceSet");this.app.sIsFetching.set(!1),this.resList.set(t)}catch(t){this.app.sIsFetching.set(!1),this.resList.set([])}})}handleCheck(e,t,i){this.resList.update(r=>{if(r[i][2]=e,e)this.app.config.selections.resourceSets[this.data.path].push(t);else{let o=this.app.config.selections.resourceSets[this.data.path].indexOf(t);o!==-1&&this.app.config.selections.resourceSets[this.data.path].splice(o,1)}return[].concat(r)}),this.app.saveConfig(),this.skresOther.refreshResourceSetsInBounds(this.data.path)}clearSelections(){this.resList.update(e=>(e.forEach(t=>t[2]=!1),e)),this.app.config.selections.resourceSets[this.data.path]=[],this.app.saveConfig(),this.skresOther.refreshResourceSetsInBounds(this.data.path)}static \u0275fac=function(t){return new(t||n)(ie(oe),ie(dg),ie(_r),ie(Jr))};static \u0275cmp=U({type:n,selectors:[["ap-resourceset-modal"]],decls:17,vars:3,consts:[[1,"_ap-resource-set"],[2,"background-color","transparent"],["mat-icon-button","","matTooltip","Clear selections","matTooltipPosition","below",3,"click","disabled"],["mat-icon-button","","matTooltip","Refresh list entries","matTooltipPosition","below",3,"click"],[2,"flex","1 1 auto","padding-left","20px","text-align","center"],["mat-icon-button","","matTooltip","Close","matTooltipPosition","below",3,"click"],["mode","indeterminate"],[2,"display","flex","flex-wrap","no-wrap"],[2,"width","45px"],[3,"change","checked"],[2,"flex","1 1 auto"],[1,"key-label"],[1,"key-desc"]],template:function(t,i){t&1&&(u(0,"div",0)(1,"mat-toolbar",1)(2,"span")(3,"button",2),T("click",function(){return i.clearSelections()}),u(4,"mat-icon"),_(5,"clear_all"),h()(),u(6,"button",3),T("click",function(){return i.getItems(!0)}),u(7,"mat-icon"),_(8,"refresh"),h()()(),u(9,"span",4),_(10),h(),u(11,"span")(12,"button",5),T("click",function(){return i.closeModal()}),u(13,"mat-icon"),_(14,"keyboard_arrow_down"),h()()()(),R(15,g0e,1,0,"mat-progress-bar",6)(16,y0e,2,0),h()),t&2&&(f(3),w("disabled",i.app.config.selections.resourceSets[i.data.path].length===0),f(7),K(" ",i.title," "),f(5),A(i.app.sIsFetching()?15:16))},dependencies:[ye,Te,se,ce,et,Bt,ti,ue,Fe,Rt,zt,Fi,cn,To,Mr],styles:["._ap-resource-set[_ngcontent-%COMP%]{font-family:arial;min-width:300px}._ap-resource-set[_ngcontent-%COMP%] .key-label[_ngcontent-%COMP%]{font-weight:500}._ap-resource-set[_ngcontent-%COMP%] .key-desc[_ngcontent-%COMP%]{font-style:italic}"]})};var tj=class n{constructor(e,t,i,r){this.app=e;this.cdr=t;this.modalRef=i;this.data=r}app;cdr;modalRef;data;properties={};title="ResourceSet Feature: ";ngOnInit(){this.parse()}closeModal(){this.modalRef.dismiss()}parse(){let e=this.data.id.split("."),t=Number(e[e.length-1]),i=this.data.item.values.features,r=t<i.length?i[t]:i[0];this.title=r.properties.name??"Feature",this.properties={name:r.properties.name??"",description:r.properties.description??"","position.latitude":r.geometry.coordinates[1],"position.longitude":r.geometry.coordinates[0],"resourceset.name":this.data.item.name,"resourceset.description":this.data.item.description,"resourceset.collection":e[1]}}static \u0275fac=function(t){return new(t||n)(ie(oe),ie(ae),ie(_r),ie(Jr))};static \u0275cmp=U({type:n,selectors:[["ap-resourceset-feature-modal"]],decls:30,vars:5,consts:[[1,"_ap-resource-set-feature"],[2,"background-color","transparent"],[2,"flex","1 1 auto","padding-left","20px","text-align","center"],["mat-icon-button","","matTooltip","Close","matTooltipPosition","left",3,"click"],[2,"padding-bottom","5px","display","flex"],[2,"font-weight","bold","vertical-align","top"],[2,"padding-left","10px"],["target","notelink",2,"overflow-y","auto","height","60px"]],template:function(t,i){t&1&&(u(0,"div",0)(1,"mat-toolbar",1),z(2,"span"),u(3,"span",2),_(4),h(),u(5,"span")(6,"button",3),T("click",function(){return i.closeModal()}),u(7,"mat-icon"),_(8,"keyboard_arrow_down"),h()()()(),u(9,"mat-card")(10,"mat-card-content")(11,"div",4)(12,"div",5),_(13,"Name:"),h(),u(14,"div",6),_(15),h()(),u(16,"div",5),_(17,"Description:"),h(),u(18,"div",7),_(19),h(),u(20,"div",4)(21,"div",5),_(22," Resource Set: "),h(),u(23,"div",6),_(24),h()(),u(25,"div",4)(26,"div",5),_(27," Collection: "),h(),u(28,"div",6),_(29),h()()()()()),t&2&&(f(4),K(" ",i.title," "),f(11),X(i.properties.name),f(4),K(" ",i.properties.description," "),f(5),K(" ",i.properties["resourceset.name"]," "),f(5),K(" ",i.properties["resourceset.collection"]," "))},dependencies:[ye,Te,se,ce,et,Bt,ti,ue,Fe,Rt,zt,Fi],styles:["._ap-resource-set-feature[_ngcontent-%COMP%]{font-family:arial;min-width:300px}._ap-resource-set-feature[_ngcontent-%COMP%] .key-label[_ngcontent-%COMP%]{font-weight:500}._ap-resource-set-feature[_ngcontent-%COMP%] .key-desc[_ngcontent-%COMP%]{font-style:italic}"]})};var ij=(n,e)=>e.ms;function v0e(n,e){if(n&1){let t=H();u(0,"div",8),_(1," WIND (SIGNAL K WEATHER API) "),h(),u(2,"div",9)(3,"mat-checkbox",11),T("change",function(r){O(t);let o=v();return F(o.toggleWeatherWind(r.checked))}),_(4," Enable wind layer "),h()()}if(n&2){let t=v();f(3),w("checked",t.app.config.selections.weatherWindEnabled)}}function b0e(n,e){if(n&1&&z(0,"div",32),n&2){let t=e.$implicit,i=v(3);vt("left",t.pct,"%")("border-left",t.isDayStart?"2px dashed #7fd4ff":i.app.uiConfig().invertColor?"1px solid rgba(255,255,255,0.1)":"1px solid rgba(0,0,0,0.12)")}}function x0e(n,e){if(n&1&&(u(0,"span",35),_(1),h()),n&2){let t=v().$implicit,i=v(3);vt("color",i.app.uiConfig().invertColor?"#7fa8cf":"#4a6a8a"),f(),X(t.label)}}function C0e(n,e){if(n&1&&(u(0,"div",33),R(1,x0e,2,3,"span",34),h()),n&2){let t=e.$implicit;vt("left",t.pct,"%"),f(),A(t.label?1:-1)}}function w0e(n,e){if(n&1&&z(0,"div",36),n&2){let t=v(3);vt("left",t.nowTickPct(),"%")("border-left","1px dashed "+(t.app.uiConfig().invertColor?"rgba(255,255,255,0.45)":"rgba(0,0,0,0.4)"))}}function M0e(n,e){if(n&1){let t=H();u(0,"div",13)(1,"div",14,0),T("pointerdown",function(r){O(t);let o=Be(2),a=v(2);return F(a.onBarPointerDown(r,o))}),u(3,"div",15),z(4,"div",16),Ae(5,b0e,1,4,"div",17,ij),Ae(7,C0e,2,3,"div",18,ij),h(),R(9,w0e,1,4,"div",19),z(10,"div",20),u(11,"div",21),_(12),h()(),u(13,"div",22)(14,"button",23),T("click",function(){O(t);let r=v(2);return F(r.currents.stepBackBig())}),u(15,"mat-icon",24),_(16,"skip_previous"),h()(),u(17,"button",25),T("click",function(){O(t);let r=v(2);return F(r.currents.stepBack())}),u(18,"mat-icon",24),_(19,"chevron_left"),h()(),u(20,"button",26),T("click",function(){O(t);let r=v(2);return F(r.currents.togglePlay())}),u(21,"mat-icon",27),_(22),h()(),u(23,"button",28),T("click",function(){O(t);let r=v(2);return F(r.currents.stepForward())}),u(24,"mat-icon",24),_(25,"chevron_right"),h()(),u(26,"button",29),T("click",function(){O(t);let r=v(2);return F(r.currents.stepForwardBig())}),u(27,"mat-icon",24),_(28,"skip_next"),h()(),z(29,"span",30),u(30,"button",31),T("click",function(){O(t);let r=v(2);return F(r.currents.resetToNow())}),_(31," Now "),h()()()}if(n&2){let t=v(2);f(3),vt("background",t.app.uiConfig().invertColor?"rgba(11,26,43,0.85)":"rgba(240,244,248,0.9)")("border",t.app.uiConfig().invertColor?"1px solid rgba(79,148,212,0.35)":"1px solid rgba(79,148,212,0.5)"),f(),vt("background",t.currents.barBgGradient()),f(),Le(t.currents.hourTicks()),f(2),Le(t.currents.hourLabels()),f(2),A(t.nowTickPct()!=null?9:-1),f(3),K(" ",t.fmtScrubTime()," "),f(8),w("matTooltip",t.currents.isPlaying()?"Pause":"Play"),f(2),X(t.currents.isPlaying()?"pause":"play_arrow")}}function S0e(n,e){if(n&1){let t=H();z(0,"div",7),u(1,"div",8),_(2," TIDAL CURRENTS (SIGNALK PLUGIN) "),h(),u(3,"div",9)(4,"mat-checkbox",12),T("change",function(r){O(t);let o=v();return F(o.toggleTidalCurrents(r.checked))}),_(5," Enable tidal currents layer "),h()(),R(6,M0e,32,10,"div",13)}if(n&2){let t=v();f(4),w("checked",t.app.config.selections.tidalCurrentsEnabled),f(2),A(t.app.config.selections.tidalCurrentsEnabled?6:-1)}}var nj=class n{closed=xe();app=M(oe);currents=M(Rd);ngZone=M(Wi);dragState=null;onDocPointerMove=e=>{if(!this.dragState)return;let t=e.clientX-this.dragState.startX;if(!this.dragState.isDragging&&Math.abs(t)>3&&(this.dragState.isDragging=!0),this.dragState.isDragging){let i=-(t/this.dragState.barWidth)*24;this.currents.scrubTime.set(this.dragState.startTime+i*36e5)}};onDocPointerUp=e=>{if(this.dragState){if(!this.dragState.isDragging){let i=((e.clientX-this.dragState.elLeft)/this.dragState.barWidth-.5)*24,r=this.dragState.startTime+i*36e5;this.currents.scrubTime.set(r)}this.dragState=null,document.removeEventListener("pointermove",this.onDocPointerMove),document.removeEventListener("pointerup",this.onDocPointerUp),this.currents.dragEnd$.next()}};ngOnDestroy(){this.dragState&&(document.removeEventListener("pointermove",this.onDocPointerMove),document.removeEventListener("pointerup",this.onDocPointerUp)),this.currents.pause()}close(){this.closed.emit()}fmtScrubTime(){let e=this.currents.scrubTime(),t=e?new Date(e):new Date,i=new Date,r=t.getFullYear()===i.getFullYear()&&t.getMonth()===i.getMonth()&&t.getDate()===i.getDate(),o=new Date(i);o.setDate(o.getDate()+1);let a=t.getFullYear()===o.getFullYear()&&t.getMonth()===o.getMonth()&&t.getDate()===o.getDate(),s=new Date(i);s.setDate(s.getDate()-1);let l=t.getFullYear()===s.getFullYear()&&t.getMonth()===s.getMonth()&&t.getDate()===s.getDate(),c;r?c="Today":a?c="Tomorrow":l?c="Yesterday":c=t.toLocaleDateString(void 0,{weekday:"short",month:"short",day:"numeric"});let d=p=>String(p).padStart(2,"0");return`${c} \xB7 ${d(t.getHours())}:${d(t.getMinutes())}`}nowTickPct(){let e=this.currents.scrubTime();if(e===null)return null;let t=50+(Date.now()-e)/(24*36e5)*100;return t<0||t>100?null:t}onBarPointerDown(e,t){let i=t.getBoundingClientRect();this.dragState={startX:e.clientX,barWidth:i.width,startTime:this.currents.scrubTime()??Date.now(),isDragging:!1,elLeft:i.left},this.ngZone.runOutsideAngular(()=>{document.addEventListener("pointermove",this.onDocPointerMove),document.addEventListener("pointerup",this.onDocPointerUp)})}toggleWeatherWind(e){this.app.config?.selections&&(this.app.config.selections.weatherWindEnabled=e,this.app.saveConfig())}toggleOceanCurrents(e){this.app.config?.selections&&(this.app.config.selections.oceanCurrentsEnabled=e,this.app.saveConfig())}toggleTidalCurrents(e){this.app.config?.selections&&(e||this.currents.pause(),this.app.config.selections.tidalCurrentsEnabled=e,this.app.saveConfig())}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["weather-list"]],outputs:{closed:"closed"},decls:19,vars:3,consts:[["timeBar",""],[1,"resourcelist"],[2,"border-radius","unset","height","100%","box-sizing","border-box"],[1,"title-block"],[2,"width","50px"],["mat-icon-button","","matTooltip","Close Weather","matTooltipPosition","right",3,"click"],[2,"flex","1 1 auto","padding-top","7px"],[2,"border-bottom","1px solid #ccc","margin","8px 0"],[2,"font-size","11px","font-weight","500","padding","4px 0","color","#888"],[2,"display","flex","align-items","center","padding","2px 0"],["matTooltip","Toggle ocean currents overlay","matTooltipPosition","right",3,"change","checked"],["matTooltip","Toggle wind overlay","matTooltipPosition","right",3,"change","checked"],["matTooltip","Toggle tidal currents overlay","matTooltipPosition","right",3,"change","checked"],[2,"margin-top","6px","border-top","1px solid #333","padding-top","6px"],[2,"position","relative","height","28px","margin-bottom","10px","user-select","none","touch-action","none",3,"pointerdown"],[2,"position","relative","height","24px","border-radius","4px","overflow","hidden","cursor","pointer","backdrop-filter","blur(6px)"],[2,"position","absolute","inset","0","pointer-events","none"],[2,"position","absolute","top","0","bottom","0","pointer-events","none",3,"left","borderLeft"],[2,"position","absolute","top","0","bottom","0","transform","translateX(-50%)","pointer-events","none","display","flex","align-items","center","justify-content","center",3,"left"],[2,"position","absolute","top","0","bottom","0","pointer-events","none","z-index","1",3,"left","borderLeft"],[2,"position","absolute","top","0","bottom","0","left","50%","width","3px","background","#f2b84b","box-shadow","0 0 6px rgba(242, 184, 75, 0.8)","transform","translateX(-1.5px)","pointer-events","none","z-index","2"],[2,"position","absolute","top","-4px","left","50%","transform","translate(-50%, -100%)","background","#f2b84b","color","#1a2c3d","font-size","10px","font-weight","700","padding","2px 7px","border-radius","9px","white-space","nowrap","pointer-events","none","z-index","3","box-shadow","0 2px 6px rgba(0, 0, 0, 0.4)"],[2,"display","flex","align-items","center","gap","3px"],["mat-icon-button","","matTooltip","-6h","matTooltipPosition","below",2,"width","26px","height","26px","line-height","26px",3,"click"],[2,"font-size","14px"],["mat-icon-button","","matTooltip","-1h","matTooltipPosition","below",2,"width","26px","height","26px","line-height","26px",3,"click"],["mat-icon-button","","matTooltipPosition","below",2,"width","30px","height","30px","line-height","30px",3,"click","matTooltip"],[2,"font-size","18px"],["mat-icon-button","","matTooltip","+1h","matTooltipPosition","below",2,"width","26px","height","26px","line-height","26px",3,"click"],["mat-icon-button","","matTooltip","+6h","matTooltipPosition","below",2,"width","26px","height","26px","line-height","26px",3,"click"],[2,"flex","1"],["mat-button","","matTooltip","Reset to Now","matTooltipPosition","below",2,"min-width","unset","padding","0 8px","font-size","11px","line-height","26px","height","26px",3,"click"],[2,"position","absolute","top","0","bottom","0","pointer-events","none"],[2,"position","absolute","top","0","bottom","0","transform","translateX(-50%)","pointer-events","none","display","flex","align-items","center","justify-content","center"],[2,"font-size","9px","white-space","nowrap","margin-top","18px",3,"color"],[2,"font-size","9px","white-space","nowrap","margin-top","18px"],[2,"position","absolute","top","0","bottom","0","pointer-events","none","z-index","1"]],template:function(t,i){t&1&&(u(0,"div",1)(1,"mat-card",2)(2,"mat-card-title")(3,"div",3)(4,"div",4)(5,"button",5),T("click",function(){return i.close()}),u(6,"mat-icon"),_(7,"arrow_back"),h()()(),u(8,"div",6),_(9,"Weather"),h()()(),u(10,"mat-card-content"),R(11,v0e,5,1),z(12,"div",7),u(13,"div",8),_(14," OCEAN CURRENTS (OPEN-METEO) "),h(),u(15,"div",9)(16,"mat-checkbox",10),T("change",function(o){return i.toggleOceanCurrents(o.checked)}),_(17," Enable ocean currents layer "),h()(),R(18,S0e,7,2),h()()()),t&2&&(f(11),A(i.app.featureFlags().weatherApi?11:-1),f(5),w("checked",i.app.config.selections.oceanCurrentsEnabled),f(2),A(i.app.featureFlags().tidalApi?18:-1))},dependencies:[ye,Te,se,ce,et,Bt,ti,Zn,Fi,cn,ue,Ze,Fe,aa],styles:[".resourcelist[_ngcontent-%COMP%]{min-width:180px;position:relative;height:100%}.resourcelist[_ngcontent-%COMP%] .title-block[_ngcontent-%COMP%]{padding-left:5px;display:flex}.resourcelist[_ngcontent-%COMP%] .title-block[_ngcontent-%COMP%] .title-text[_ngcontent-%COMP%]{font-family:roboto;font-size:14pt;font-weight:500}.resourcelist[_ngcontent-%COMP%] .resources[_ngcontent-%COMP%]{overflow-y:auto;position:absolute;inset:125px 0 0}.resourcelist[_ngcontent-%COMP%] .resources.vessels[_ngcontent-%COMP%], .resourcelist[_ngcontent-%COMP%] .resources.charts[_ngcontent-%COMP%]{top:160px}.resourcelist[_ngcontent-%COMP%] .vessel-filter[_ngcontent-%COMP%] .filter-label[_ngcontent-%COMP%]{padding-right:8px}.resourcelist[_ngcontent-%COMP%] .vessel-filter[_ngcontent-%COMP%] .filter-toggles[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.resourcelist[_ngcontent-%COMP%] .vessel-filter.stacked[_ngcontent-%COMP%]{flex-direction:column;align-items:flex-start}.resourcelist[_ngcontent-%COMP%] .vessel-filter.stacked[_ngcontent-%COMP%] .filter-toggles[_ngcontent-%COMP%]{width:100%}.resourcelist[_ngcontent-%COMP%] .vessel-filter.stacked[_ngcontent-%COMP%] .filter-toggles[_ngcontent-%COMP%] mat-slide-toggle[_ngcontent-%COMP%]{flex:1 1 0}.resourcelist[_ngcontent-%COMP%] .resources.vessels.buddies[_ngcontent-%COMP%]{top:185px}.resourcelist[_ngcontent-%COMP%] .vscroller[_ngcontent-%COMP%]{position:absolute;inset:0;border-top:silver 1px outset}.resourcelist[_ngcontent-%COMP%] .resources.charts[_ngcontent-%COMP%] .vscroller[_ngcontent-%COMP%]{top:22px;bottom:22px}.resourcelist[_ngcontent-%COMP%] .resources.charts[_ngcontent-%COMP%] .stack-caption[_ngcontent-%COMP%]{position:absolute;left:0;right:0;height:22px;display:flex;align-items:center;padding:0 8px;background:var(--mat-app-background-color);color:var(--mat-app-text-color);font-size:10pt;font-style:italic}.resourcelist[_ngcontent-%COMP%] .resources.charts[_ngcontent-%COMP%] .stack-caption-top[_ngcontent-%COMP%]{top:0;border-bottom:silver 1px outset}.resourcelist[_ngcontent-%COMP%] .resources.charts[_ngcontent-%COMP%] .stack-caption-bottom[_ngcontent-%COMP%]{bottom:0;border-top:silver 1px outset}.resourcelist[_ngcontent-%COMP%] .resources.charts[_ngcontent-%COMP%] .stack-caption-hint[_ngcontent-%COMP%]{flex:1 1 auto;text-align:right;opacity:.7}.chart-drop-placeholder[_ngcontent-%COMP%]{background:#ccc;border:dotted 3px #999;min-height:60px;transition:transform .25s cubic-bezier(0,0,.2,1)}.cdk-drag-preview[_ngcontent-%COMP%]{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-animating[_ngcontent-%COMP%], .cdk-drop-list-dragging[_ngcontent-%COMP%] .mat-mdc-card[_ngcontent-%COMP%]:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}"],changeDetection:0})};function T0e(n,e){if(n&1){let t=H();u(0,"div",6)(1,"div",8)(2,"button",9),T("click",function(){O(t);let r=v();return F(r.notiMgr.acknowledge(r.data.alert.path))}),u(3,"mat-icon"),_(4,"check"),h(),_(5," Acknowledge "),h()()()}}function E0e(n,e){if(n&1&&z(0,"signalk-details-list",11),n&2){let t=v(2);w("details",t.properties)}}function I0e(n,e){if(n&1){let t=H();u(0,"button",10),T("click",function(){O(t);let r=v();return F(r.toggleProperties())}),u(1,"span"),_(2),h(),u(3,"mat-icon"),_(4),h()(),R(5,E0e,1,1,"signalk-details-list",11)}if(n&2){let t=v();f(2),K("Show ",t.showProperties?"Less":"More"),f(2),X(t.showProperties?"keyboard_arrow_down":"keyboard_arrow_right"),f(),A(t.showProperties?5:-1)}}var cw=class n{constructor(e){this.data=e}data;showProperties=!0;hasProperties=!1;properties;raisedAt;notiMgr=M(ul);modalRef=M(_r);ngOnInit(){this.parseAlertInfo()}toggleProperties(){this.showProperties=!this.showProperties}parseAlertInfo(){this.properties=this.data.alert.properties??{},this.hasProperties=Object.keys(this.properties).length!==0;let e=new Date(this.data.alert.createdAt);this.raisedAt=`${e.toLocaleDateString()} ${e.toLocaleTimeString()}`}static \u0275fac=function(t){return new(t||n)(ie(Jr))};static \u0275cmp=U({type:n,selectors:[["ap-alert-modal"]],decls:36,vars:10,consts:[[1,"_ap-alert"],[2,"background-color","transparent"],[3,"svgIcon"],[2,"flex","1 1 auto","padding-left","20px","text-align","center"],["mat-icon-button","","matTooltip","Close","matTooltipPosition","below",3,"click"],[2,"display","flex","flex-direction","column"],[2,"display","flex"],[1,"key-label"],[2,"flex","1 1 auto"],["mat-raised-button","",1,"button-warn",3,"click"],["mat-stroked-button","",3,"click"],[3,"details"]],template:function(t,i){t&1&&(u(0,"div",0)(1,"mat-toolbar",1)(2,"span")(3,"mat-icon",2),_(4),h()(),u(5,"span",3),_(6," Alert Information "),h(),u(7,"span")(8,"button",4),T("click",function(){return i.modalRef.dismiss()}),u(9,"mat-icon"),_(10,"keyboard_arrow_down"),h()()()(),u(11,"mat-card")(12,"mat-card-content")(13,"div",5),R(14,T0e,6,0,"div",6),u(15,"div",6)(16,"div",7),_(17,"Message:"),h(),u(18,"div",8),_(19),h()(),u(20,"div",6)(21,"div",7),_(22,"Type:"),h(),u(23,"div",8),_(24),h()(),u(25,"div",6)(26,"div",7),_(27,"Priority:"),h(),u(28,"div",8),_(29),h()(),u(30,"div",6)(31,"div",7),_(32,"Raised at:"),h(),u(33,"div",8),_(34),h()(),R(35,I0e,6,3),h()()()()),t&2&&(f(3),Et(i.data.alert.icon.class),w("svgIcon",i.data.alert.icon.svgIcon),f(),K(" ",i.data.alert.icon.name),f(10),A(i.data.alert.canAcknowledge&&!i.data.alert.acknowledged?14:-1),f(5),X(i.data.alert.message),f(5),X(i.data.alert.type),f(5),X(i.data.alert.priority),f(5),X(i.raisedAt),f(),A(i.hasProperties?35:-1))},dependencies:[ye,Te,se,ce,et,Bt,ti,ue,Ze,Fe,Rt,zt,Ld],styles:["._ap-alert[_ngcontent-%COMP%]{font-family:arial;min-width:300px}._ap-alert[_ngcontent-%COMP%] .key-label[_ngcontent-%COMP%]{width:150px;font-weight:700}"]})};var ul=class n{alertMap;pendingActions={acknowledged:new Map,silenced:new Map};alertsSignal=$([]);alerts=this.alertsSignal.asReadonly();mobSignal=$([]);mobAlerts=this.mobSignal.asReadonly();app=M(oe);worker=M(Nn);signalk=M(Lt);bottomSheet=M(Qu);constructor(){this.alertMap=new Map,this.worker.notification$().subscribe(e=>{this.processMessage(e)})}emitSignals(){let e={emergency:1,alarm:2,warn:3,alert:4,normal:5,nominal:6},t=Array.from(this.alertMap,([i,r])=>[i,this.withPendingActions(r)]).sort((i,r)=>{let o=e[i[1].priority],a=e[r[1].priority];return o===a?r[1].createdAt-i[1].createdAt:o-a});this.alertsSignal.update(()=>t),this.mobSignal.update(()=>t.filter(i=>i[1].type==="mob")),this.app.data.vessels.closest=t.filter(i=>i[1].type==="cpa").map(i=>i[1].properties?.vesselId)}processMessage(e){e.result&&this.parse(e.result)}parse(e){let t=this.getAlertType(e.path);if(t==="depth"&&!this.app.config.display.depthAlarm.enabled)return;if(!e.value||e.value?.state==="normal"){this.alertMap.has(e.path)&&(this.dropPendingActions(this.alertMap.get(e.path).id),this.alertMap.delete(e.path),this.emitSignals());return}let i;if(this.app.featureFlags().notificationApi){let r=e.value,o=this.alertMap.get(e.path);o&&o.id!==r.id&&this.dropPendingActions(o.id),this.settlePendingActions(r),i={id:r.id,path:e.path,priority:r.state,message:r.message,sound:r.method.includes("sound"),visual:r.method.includes("visual"),properties:{},acknowledged:r.status.acknowledged,silenced:r.status.silenced,icon:{},type:void 0,canAcknowledge:r.status.canAcknowledge,canSilence:r.status.canSilence,canCancel:r.status.canClear,createdAt:r.createdAt?new Date(r.createdAt).valueOf():Date.now()}}if(i.type=t,i.icon=Px(i),e.value.position&&(i.properties.position=e.value.position),["buddy"].includes(t)){this.app.showMessage(i.message,!this.app.config.display.muteSound&&i.sound);return}else i.type==="cpa"&&(i.properties=this.parseCpa(e.value)),this.alertMap.set(i.path,i),this.emitSignals()}getAlertType(e){let t=e.split(".");return this.isStandardAlarm(t[1])||e.includes("notifications.area")||e.includes("notifications.buddy")||e.includes("notifications.meteo.warning")?t[1]:e.includes("notifications.navigation.closestApproach")?"cpa":e.includes("notifications.environment.depth.")||e.includes("notifications.navigation.anchor")?t[2]:e.includes("notifications.navigation.course.perpendicularPassed")||e.includes("notifications.navigation.course.arrivalCircleEntered")?t[3]:"notification"}isStandardAlarm(e){return["mob","sinking","fire","piracy","flooding","collision","grounding","listing","adrift","abandon","aground"].includes(e)}getAlert(e){let t=this.alerts().find(i=>i[0]===e);return t?t[1]:void 0}showAlertInfo(e){if(!this.alertMap.has(e)){this.app.showAlert("Alert","Alert not found!");return}this.bottomSheet.open(cw,{data:{alert:this.getAlert(e)}}).afterDismissed().subscribe(()=>{})}acknowledge(e){this.applyAlertAction(e,"acknowledge","acknowledged")}silence(e){this.applyAlertAction(e,"silence","silenced")}applyAlertAction(e,t,i){let r=this.alertMap.get(e),o=this.pendingActions[i];if(!r||r[i]||o.has(r.id)||!this.app.featureFlags().notificationApi)return;let{id:a}=r,s={state:r.priority};o.set(a,s),this.emitSignals(),this.signalk.api.post(this.app.skApiVersion,`notifications/${a}/${t}`,{}).subscribe(()=>{this.app.debug(`${t} ${a}, ${e}`)},l=>{o.get(a)===s&&(o.delete(a),this.emitSignals()),this.app.parseHttpErrorResponse(l)})}withPendingActions(e){let t=e.acknowledged||this.pendingActions.acknowledged.has(e.id),i=e.silenced||this.pendingActions.silenced.has(e.id);return t===e.acknowledged&&i===e.silenced?e:st(ne({},e),{acknowledged:t,silenced:i})}settlePendingActions(e){for(let t of["acknowledged","silenced"]){let i=this.pendingActions[t].get(e.id);i&&(e.status[t]||e.state!==i.state)&&this.pendingActions[t].delete(e.id)}}dropPendingActions(e){this.pendingActions.acknowledged.delete(e),this.pendingActions.silenced.delete(e)}silenceAll(){this.app.featureFlags().notificationApi&&this.signalk.api.post(this.app.skApiVersion,"notifications/silenceAll",{}).subscribe(()=>{this.app.debug("Silenced All alerts")},e=>{this.app.parseHttpErrorResponse(e)})}clear(e){if(this.alertMap.has(e)){let t=this.alertMap.get(e);this.app.featureFlags().notificationApi&&this.signalk.api.delete(this.app.skApiVersion,`notifications/${t.id}`).subscribe(()=>{this.app.debug(`Cleared ${t.id}, ${e}`)},i=>{this.app.parseHttpErrorResponse(i)})}}raiseServerAlarm(e,t){this.app.featureFlags().notificationApi&&this.signalk.api.post(this.app.skApiVersion,"notifications/mob",{message:t}).subscribe(i=>{this.app.debug(`MOB Alarm raised (${i.id})`)},i=>{this.app.parseHttpErrorResponse(i)})}cancelServerAlarm(e){this.app.featureFlags().notificationApi&&this.signalk.api.delete(this.app.skApiVersion,`notifications/${e.id}`).subscribe(()=>{this.app.debug(`Cleared ${e.id}`)},t=>{this.app.parseHttpErrorResponse(t)})}parseCpa(e){return{vesselId:e.other??void 0}}static \u0275fac=function(t){return new(t||n)};static \u0275prov=Je({token:n,factory:n.\u0275fac,providedIn:"root"})};var k0e=()=>["emergency","alarm"],D0e=(n,e,t)=>({"blink-text":n,"red-text":e,"amber-text":t}),P0e=(n,e)=>e[0];function R0e(n,e){if(n&1&&(u(0,"div")(1,"button",16)(2,"mat-icon"),_(3,"warning"),h(),_(4," Raise "),h()()),n&2){v();let t=Be(1);f(),w("matMenuTriggerFor",t)}}function A0e(n,e){if(n&1){let t=H();u(0,"button",21),T("click",function(){O(t);let r=v().$implicit,o=v();return F(o.muteAlert(r[1].path))}),z(1,"mat-icon",18),h(),_(2," \xA0 ")}if(n&2){let t=v().$implicit;w("matTooltip",t[1].silenced?"Silenced":"Silence")("disabled",t[1].acknowledged||t[1].silenced),f(),Et(t[1].acknowledged?"":"ob"),w("svgIcon",t[1].silenced?"sound-off-fill":"sound-high-fill")}}function L0e(n,e){if(n&1){let t=H();u(0,"button",23),T("click",function(){O(t);let r=v(2).$implicit,o=v();return F(o.ackAlert(r[1].path))}),u(1,"mat-icon"),_(2,"check"),h()()}if(n&2){let t=v(2).$implicit;w("disabled",t[1].acknowledged)}}function O0e(n,e){if(n&1){let t=H();u(0,"button",25),T("click",function(){O(t);let r=v(3).$implicit,o=v();return F(o.clearAlert(r[1].path))}),u(1,"mat-icon"),_(2,"close"),h()()}if(n&2){let t=v(3).$implicit;w("disabled",!t[1].acknowledged)}}function F0e(n,e){if(n&1&&R(0,O0e,3,1,"button",24),n&2){let t=v(2).$implicit;A(t[1].canCancel?0:-1)}}function N0e(n,e){if(n&1&&R(0,L0e,3,1,"button",22)(1,F0e,1,1),n&2){let t=v().$implicit;A(t[1].acknowledged?1:0)}}function B0e(n,e){if(n&1){let t=H();u(0,"div",15)(1,"div",17),T("click",function(){let r=O(t).$implicit,o=v();return F(o.notiMgr.showAlertInfo(r[1].path))}),u(2,"mat-icon",18),_(3),h()(),u(4,"div",19),T("click",function(){let r=O(t).$implicit,o=v();return F(o.notiMgr.showAlertInfo(r[1].path))}),_(5),h(),u(6,"div",20),R(7,A0e,3,5),R(8,N0e,2,1),h()()}if(n&2){let t=e.$implicit,i=v();f(2),Et(t[1].icon.class),w("svgIcon",t[1].icon.svgIcon),f(),X(t[1].icon.name),f(),w("ngClass",nh(9,D0e,t[1].canAcknowledge&&!t[1].acknowledged,kr(8,k0e).includes(t[1].priority),t[1].priority==="alert")),f(),K(" ",t[1].message," "),f(2),A(i.app.featureFlags().notificationApi&&t[1].sound&&t[1].canSilence?7:-1),f(),A(i.app.featureFlags().notificationApi&&t[1].canAcknowledge?8:-1)}}var rj=class n{alerts=Z([]);closed=new me;app=M(oe);notiMgr=M(ul);constructor(){}handleClose(){this.closed.emit()}togglePlaySound(){this.app.config.display.muteSound=!this.app.config.display.muteSound,this.app.saveConfig()}ackAlert(e){this.notiMgr.acknowledge(e)}muteAlert(e){this.notiMgr.silence(e)}clearAlert(e){this.notiMgr.clear(e)}silenceAll(){this.notiMgr.silenceAll()}raiseAlarm(e){let t=e==="mob"?"Person Overboard!":void 0;this.notiMgr.raiseServerAlarm(e,t)}setIcon(e){return Px(e).svgIcon}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["alert-list"]],inputs:{alerts:[1,"alerts"]},outputs:{closed:"closed"},decls:26,vars:2,consts:[["alarmsmenu","matMenu"],["mat-menu-item","",3,"click"],["svgIcon","alarm-mob",1,"ob"],["appearance","outlined"],["cdkDrag","",1,"alert-list-main","mat-app-background"],["cdkDragHandle","",1,"title"],[2,"flex","1 1 auto","font-size","14pt","line-height","2.5em","text-align","center","cursor","grab"],[2,"display","flex"],["mat-icon-button","","matTooltip","Silence All",3,"click"],["svgIcon","sound-off-fill",1,"ob"],["matTooltip","Sound on /off",3,"toggleChange","checked"],["mat-icon-button","",3,"click"],[1,"content"],[1,"alert-list-container"],[1,"alert-list"],[1,"alert-box"],["mat-raised-button","","matTooltip","Raise Alarm",1,"button-warn",3,"matMenuTriggerFor"],[2,"width","40px",3,"click"],[3,"svgIcon"],[1,"alert-text",3,"click","ngClass"],[2,"width","90px"],["mat-icon-button","","matTooltipPosition","below",3,"click","matTooltip","disabled"],["mat-icon-button","","matTooltip","Acknowledge","matTooltipPosition","below",3,"disabled"],["mat-icon-button","","matTooltip","Acknowledge","matTooltipPosition","below",3,"click","disabled"],["mat-icon-button","","matTooltip","Clear / Cancel","matTooltipPosition","below",3,"disabled"],["mat-icon-button","","matTooltip","Clear / Cancel","matTooltipPosition","below",3,"click","disabled"]],template:function(t,i){t&1&&(u(0,"mat-menu",null,0)(2,"button",1),T("click",function(){return i.raiseAlarm("mob")}),z(3,"mat-icon",2),_(4," \xA0Overboard! "),h()(),u(5,"mat-card",3)(6,"div",4)(7,"div",5),R(8,R0e,5,1,"div"),u(9,"div",6),_(10," Alert List "),h(),u(11,"div",7)(12,"button",8),T("click",function(){return i.silenceAll()}),z(13,"mat-icon",9),h(),_(14," \xA0 \xA0 "),u(15,"div")(16,"mat-slide-toggle",10),T("toggleChange",function(){return i.togglePlaySound()}),h()(),_(17," \xA0 "),u(18,"button",11),T("click",function(){return i.handleClose()}),u(19,"mat-icon"),_(20,"close"),h()()()(),u(21,"div",12)(22,"div",13)(23,"div",14),Ae(24,B0e,9,13,"div",15,P0e),h()()()()()),t&2&&(f(8),A(i.app.featureFlags().notificationApi?8:-1),f(8),w("checked",!i.app.config.display.muteSound),f(8),Le(i.alerts()))},dependencies:[ye,Te,mn,Rn,ue,Ze,Fe,et,Bt,se,ce,Ec,is,Is,hl,aa,Vo,Dt,So],styles:[".alert-list-main[_ngcontent-%COMP%]{position:fixed;z-index:6100;--hA: 100vh;--lA: 100vw;top:calc((var(--hA)* .1));left:calc((var(--lA)* .1));display:flex;flex-direction:column;font-family:Roboto,Arial,Helvetica,sans-serif;width:90vw;max-width:650px;height:40vh;border:2px gray solid}.alert-list-main[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{padding:3px 5px 0;font-weight:500;font-size:14px;line-height:23px;display:flex}.alert-list-main[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{padding:0 5px;line-height:23px;margin:0;flex:1 1 auto;overflow:hidden;text-align:center;display:flex;flex-direction:column}.alert-list-container[_ngcontent-%COMP%]{display:inline-block;vertical-align:top;overflow-y:auto;flex:1 1 auto}.alert-list[_ngcontent-%COMP%]{border:solid 1px rgba(200,200,200,.3);min-height:99%;border-radius:4px;overflow:hidden;display:block}.alert-box[_ngcontent-%COMP%]{padding:15px 10px;border-bottom:solid 1px #ccc;display:flex;flex-direction:row;align-items:center;justify-content:space-between;box-sizing:border-box;width:100%}.alert-text[_ngcontent-%COMP%]{flex:2;text-align:left;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;line-clamp:3;text-overflow:ellipsis}.red-text[_ngcontent-%COMP%]{color:red}.amber-text[_ngcontent-%COMP%]{color:#b36505}.blink-text[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_blink 1s infinite;animation-fill-mode:both}@keyframes _ngcontent-%COMP%_blink{0%{opacity:1}50%{opacity:0}to{opacity:1}}"],changeDetection:0})};function V0e(n,e){if(n&1&&(u(0,"mat-icon"),_(1),h()),n&2){let t=v(2);f(),X(t.icon)}}function G0e(n,e){if(n&1){let t=H();_(0," \xA0 "),u(1,"button",1),T("click",function(){O(t);let r=v();return F(r.action())}),R(2,V0e,2,1,"mat-icon"),_(3),h()}if(n&2){let t=v();f(2),A(t.icon?2:-1),f(),K(" ",t.cancelledLabel," ")}}function z0e(n,e){if(n&1){let t=H();u(0,"button",2),T("click",function(){O(t);let r=v();return F(r.cancel())}),_(1),h()}if(n&2){let t=v();w("disabled",t.disabled),f(),Nr(" ",t.label," ",t.timeLeft()," secs ")}}var dw=class n{period=5e3;label;icon;cancelledLabel;disabled;nextPoint=new me;timer;timeLeft=$(this.period??5);cancelled=$(!1);constructor(){}ngOnInit(){this.timeLeft.update(()=>isNaN(this.period)?5:this.period/1e3),this.label=this.label??"Action in ",this.cancelledLabel=this.cancelledLabel??"OK",this.timer=setInterval(()=>{this.timeLeft.update(e=>e-1),this.timeLeft()===0&&(this.disabled=!0,this.action(),clearInterval(this.timer),this.timer=null)},1e3)}ngOnDestroy(){this.timer&&clearInterval(this.timer)}cancel(){this.timer&&(clearInterval(this.timer),this.timer=null),this.cancelled.set(!0)}action(){this.nextPoint.emit()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["timer-button"]],inputs:{period:"period",label:"label",icon:"icon",cancelledLabel:"cancelledLabel",disabled:"disabled"},outputs:{nextPoint:"nextPoint"},decls:3,vars:1,consts:[["mat-button","",3,"disabled"],["mat-raised-button","",3,"click"],["mat-button","",3,"click","disabled"]],template:function(t,i){t&1&&(u(0,"div"),R(1,G0e,4,2)(2,z0e,2,3,"button",0),h()),t&2&&(f(),A(i.cancelled()?1:2))},dependencies:[ue,Ze,se,ce],encapsulation:2,changeDetection:0})};function j0e(n,e){n&1&&z(0,"span")}function U0e(n,e){if(n&1&&z(0,"mat-progress-bar",0),n&2){let t=v(3);w("value",t.progressValue())}}function W0e(n,e){if(n&1){let t=H();u(0,"div",7)(1,"button",9),T("click",function(){O(t);let r=v(3);return F(r.muteAlarm())}),z(2,"mat-icon",10),_(3),h()()}if(n&2){let t=v(3);f(),w("disabled",t.alert().silenced),f(),w("svgIcon",t.alert().silenced?"sound-off-fill":"sound-unavailable-fill"),f(),K(" ",t.alert().silenced?"MUTED":"MUTE"," ")}}function H0e(n,e){if(n&1){let t=H();u(0,"div")(1,"button",11),T("click",function(){O(t);let r=v(3);return F(r.ackAlarm())}),u(2,"mat-icon"),_(3,"check"),h(),_(4," ACK "),h()()}}function $0e(n,e){if(n&1){let t=H();u(0,"button",12),T("click",function(){O(t);let r=v(3);return F(r.hide())}),u(1,"mat-icon"),_(2,"clear_all"),h(),_(3," Dismiss "),h()}}function K0e(n,e){if(n&1){let t=H();u(0,"timer-button",14),T("nextPoint",function(){O(t);let r=v(5);return F(r.endRoute())}),h()}if(n&2){let t=v(5);w("disabled",t.nextPointClicked)("icon","clear_all")("label","End Route in")("cancelledLabel","End Route")("period",t.app.config.course.autoNextPointDelay)}}function q0e(n,e){if(n&1){let t=H();u(0,"timer-button",14),T("nextPoint",function(){O(t);let r=v(5);return F(r.gotoNextPoint())}),h()}if(n&2){let t=v(5);w("disabled",t.nextPointClicked)("icon","skip_next")("label","Next point in")("cancelledLabel","NEXT POINT")("period",t.app.config.course.autoNextPointDelay)}}function Z0e(n,e){if(n&1&&(u(0,"div"),R(1,K0e,1,5,"timer-button",13)(2,q0e,1,5,"timer-button",13),h()),n&2){v();let t=pa(0);f(),A(t?1:2)}}function X0e(n,e){if(n&1){let t=H();u(0,"button",16),T("click",function(){O(t);let r=v(5);return F(r.endRoute())}),u(1,"mat-icon"),_(2,"clear_all"),h(),_(3," END ROUTE "),h()}if(n&2){let t=v(5);w("disabled",t.nextPointClicked)}}function Y0e(n,e){if(n&1){let t=H();u(0,"button",16),T("click",function(){O(t);let r=v(5);return F(r.gotoNextPoint())}),u(1,"mat-icon"),_(2,"skip_next"),h(),_(3," NEXT POINT "),h()}if(n&2){let t=v(5);w("disabled",t.nextPointClicked)}}function Q0e(n,e){if(n&1&&R(0,X0e,4,1,"button",15)(1,Y0e,4,1,"button",15),n&2){v();let t=pa(0);A(t?0:1)}}function J0e(n,e){if(n&1&&(As(0),u(1,"div"),R(2,Z0e,3,1,"div")(3,Q0e,2,1),h()),n&2){let t=v(3);Ls(t.course.courseData().pointIndex===t.course.courseData().pointTotal-1),f(2),A(t.app.config.course.autoNextPointOnArrival&&t.app.config.course.autoNextPointTrigger===t.alert().type?2:t.showStaticNextPoint?3:-1)}}function e_e(n,e){if(n&1&&(u(0,"div"),R(1,U0e,1,1,"mat-progress-bar",0),u(2,"mat-card",1)(3,"mat-card-content")(4,"div",2)(5,"div",3)(6,"mat-icon",4),_(7),h()(),u(8,"div",5),_(9),h()()(),u(10,"mat-card-actions")(11,"div",6),R(12,W0e,4,3,"div",7),R(13,H0e,5,0,"div")(14,$0e,4,0,"button",8),R(15,J0e,4,2,"div"),h()()()()),n&2){let t=v(2);f(),A(t.alert().canAcknowledge?-1:1),f(5),Et(t.alert().icon.class),w("svgIcon",t.alert().icon.svgIcon),f(),X(t.alert().icon.name),f(2),K(" ",t.alert().message," "),f(3),A(t.alert().sound&&t.alert().canSilence?12:-1),f(),A(t.alert().canAcknowledge?13:14),f(2),A(t.app.data.activeRoute?15:-1)}}function t_e(n,e){if(n&1&&R(0,e_e,16,9,"div"),n&2){let t=v();A(t.alert().visual&&!t.alert().acknowledged?0:-1)}}var oj={emergency:"./assets/sound/woop.mp3",alarm:"./assets/sound/woop.mp3",alert:"./assets/sound/ding.mp3",warn:"./assets/sound/ding.mp3"},aj=class n{alert=Z();acknowledged=Z(!1);silenced=Z(!1);audioStatus=Z();doNotPlaySound=Z(!1);hidden=$(!1);progressValue=$(100);nextPoint=new me;routeEnd=new me;showStaticNextPoint=!1;showAutoNextPoint=!1;nextPointClicked=!1;audio;source;soundFile=oj.warn;timerRef;app=M(oe);notiMgr=M(ul);course=M(Wr);ngZone=M(Wi);constructor(){Me(()=>{this.acknowledged(),this.silenced();let e=this.alert();this.showStaticNextPoint=["perpendicularPassed","arrivalCircleEntered"].includes(e.type),this.showAutoNextPoint=this.showStaticNextPoint&&this.app.config.course.autoNextPointTrigger===e.type,this.doNotPlaySound(),this.processAudio(),!this.timerRef&&!["emergency","alarm"].includes(this.alert().priority)&&!this.showAutoNextPoint&&this.ngZone.runOutsideAngular(()=>{this.timerRef=setInterval(()=>{this.progressValue()>0?this.progressValue.update(t=>t-4):(this.hidden.set(!0),clearInterval(this.timerRef))},100)})})}ngOnDestroy(){this.timerRef&&(clearInterval(this.timerRef),this.timerRef=null),this.audio.pause(),this.audio=null,this.source=null}hide(){this.hidden.set(!0)}ackAlarm(){this.notiMgr.acknowledge(this.alert().path)}muteAlarm(){this.notiMgr.silence(this.alert().path)}processAudio(){this.soundFile=oj[this.alert().priority],this.app.audio.context&&(this.audio||(this.audio=new Audio),this.source||(this.source=this.app.audio.context.createMediaElementSource(this.audio),this.source.connect(this.app.audio.context.destination)),this.audioStatus()==="running"&&(this.alert().sound?this.doNotPlaySound()||this.alert().silenced||this.alert().acknowledged?this.audio.pause():(this.audio.loop=["emergency","alarm"].includes(this.alert().priority),this.audio.src=this.soundFile,this.audio.play().then(()=>{}).catch(()=>{})):this.audio.pause()))}gotoNextPoint(){this.nextPointClicked=!0,this.nextPoint.emit(),this.hide()}endRoute(){this.nextPointClicked=!0,this.routeEnd.emit(),this.hide()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["fb-alert"]],inputs:{alert:[1,"alert"],acknowledged:[1,"acknowledged"],silenced:[1,"silenced"],audioStatus:[1,"audioStatus"],doNotPlaySound:[1,"doNotPlaySound"]},outputs:{nextPoint:"nextPoint",routeEnd:"routeEnd"},decls:2,vars:1,consts:[["mode","determinate",3,"value"],[2,"padding","5px","border-radius","0"],[2,"display","flex","width","100%"],[2,"width","35px"],[3,"svgIcon"],[2,"overflow","hidden","display","-webkit-box","-webkit-box-orient","vertical","-webkit-line-clamp","2","line-clamp","2","text-overflow","ellipsis"],[2,"display","flex","flex-wrap","wrap"],[2,"text-align","left"],["mat-raised-button","","matTooltip","Dismiss","matTooltipPosition","left"],["mat-raised-button","",3,"click","disabled"],[1,"ob",3,"svgIcon"],["mat-raised-button","",3,"click"],["mat-raised-button","","matTooltip","Dismiss","matTooltipPosition","left",3,"click"],[3,"disabled","icon","label","cancelledLabel","period"],[3,"nextPoint","disabled","icon","label","cancelledLabel","period"],["mat-button","",3,"disabled"],["mat-button","",3,"click","disabled"]],template:function(t,i){t&1&&R(0,j0e,1,0,"span")(1,t_e,1,1),t&2&&A(i.app.uiCtrl().alertList||i.hidden()?0:1)},dependencies:[se,ce,ue,Ze,et,Bt,Xn,ti,To,Mr,dw],encapsulation:2,changeDetection:0})};var uw=class n{disabled;direction=new me;constructor(){}action(e){this.direction.emit(e)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["nsew-buttons"]],inputs:{disabled:"disabled"},outputs:{direction:"direction"},decls:25,vars:4,consts:[[1,"nsew"],[1,"btnRow"],[1,"btnDiv"],["mat-mini-fab","",3,"click","disabled"]],template:function(t,i){t&1&&(u(0,"div",0)(1,"div",1),z(2,"div",2),u(3,"div",2)(4,"button",3),T("click",function(){return i.action(0)}),u(5,"mat-icon"),_(6,"arrow_upward"),h()()(),z(7,"div",2),h(),u(8,"div",1)(9,"div",2)(10,"button",3),T("click",function(){return i.action(270)}),u(11,"mat-icon"),_(12,"arrow_back"),h()()(),z(13,"div",2),u(14,"div",2)(15,"button",3),T("click",function(){return i.action(90)}),u(16,"mat-icon"),_(17,"arrow_forward"),h()()()(),u(18,"div",1),z(19,"div",2),u(20,"div",2)(21,"button",3),T("click",function(){return i.action(180)}),u(22,"mat-icon"),_(23,"arrow_downward"),h()()(),z(24,"div",2),h()()),t&2&&(f(4),w("disabled",i.disabled),f(6),w("disabled",i.disabled),f(5),w("disabled",i.disabled),f(6),w("disabled",i.disabled))},dependencies:[ue,Ns,se,ce],styles:[".nsew[_ngcontent-%COMP%]{border:silver 0px solid}.nsew[_ngcontent-%COMP%] .btnRow[_ngcontent-%COMP%]{display:flex;flex-wrap:no-wrap}.nsew[_ngcontent-%COMP%] .btnDiv[_ngcontent-%COMP%]{width:50px}"],changeDetection:0})};var lj=la(ds());var hg=class n{constructor(e,t,i){this.app=e;this.signalk=t;this.stream=i;Me(()=>{this.stream.selfAnchor()&&this.parseAnchorStatus(this.stream.selfAnchor())})}app;signalk;stream;raisedSignal=$(!0);raised=this.raisedSignal.asReadonly();positionSignal=$(null);position=this.positionSignal.asReadonly();radiusSignal=$(0);radius=this.radiusSignal.asReadonly();setRaisedSignal(e){this.raisedSignal.set(e)}setAnchorPosition(e){if(e)return new Promise((t,i)=>{this.signalk.post("/plugins/anchoralarm/setAnchorPosition",{position:{latitude:e[1],longitude:e[0]}}).subscribe({next:()=>t(!0),error:r=>{i(r)}})})}queryAnchorStatus(e,t){this.app.debug("Retrieving anchor status..."),e=!e||e==="self"?"vessels/self":e,this.signalk.api.get(`/${e}/navigation/anchor`).subscribe(i=>{let o={position:i.position?.value?[i.position.value.longitude,i.position.value.latitude]:null,maxRadius:i.maxRadius?.value?i.maxRadius.value:null,radius:i.currentRadius?.value?i.currentRadius.value:null};this.parseAnchorStatus(o,t)},()=>{this.positionSignal.set([0,0]),this.raisedSignal.set(!0)})}parseAnchorStatus(e,t){e.position&&typeof e.position[0]=="number"&&typeof e.position[0]=="number"?(this.positionSignal.set(e.position),this.raisedSignal.set(!1)):(t&&this.positionSignal.set(t),this.raisedSignal.set(!0)),this.radiusSignal.set(e.maxRadius??-1)}static \u0275fac=function(t){return new(t||n)(ut(oe),ut(Lt),ut(es))};static \u0275prov=Je({token:n,factory:n.\u0275fac,providedIn:"root"})};var i_e=["slideCtl"];function n_e(n,e){n&1&&(u(0,"mat-error"),_(1,"Value must be greater than 0."),h())}function r_e(n,e){n&1&&(u(0,"mat-error"),_(1,"Value must be greater than 0."),h())}function o_e(n,e){if(n&1){let t=H();u(0,"div")(1,"mat-stepper",20,5)(3,"mat-step",21)(4,"i"),_(5,"When rode is out click "),u(6,"b"),_(7,"Set"),h(),_(8,"."),h(),u(9,"div")(10,"button",22),T("click",function(){O(t);let r=v();return F(r.stepSetRode())}),_(11," Set "),h()()(),u(12,"mat-step",23)(13,"div")(14,"div"),z(15,"br"),u(16,"b"),_(17,"Adjust Radius:"),h()(),u(18,"div",24)(19,"div")(20,"mat-slider",25)(21,"input",26),T("valueChange",function(r){O(t);let o=v();return F(o.setRadius(r))}),h()()(),u(22,"div",27),_(23),h()()(),u(24,"div")(25,"div"),z(26,"br"),u(27,"b"),_(28,"Shift Anchor:"),h()(),u(29,"nsew-buttons",28),T("direction",function(r){O(t);let o=v();return F(o.shiftAnchor(r))}),h(),u(30,"div",29),_(31," Click on anchor to enable drag. "),h()()()()()}if(n&2){let t=v();f(),w("linear",!0)("selectedIndex",t.rodeOut?1:0),f(2),w("label",t.rodeOut?"Anchor Set":"Let out rode"),f(17),w("disabled",t.disableRaiseDrop)("displayWith",t.formatSliderLabel)("min",t.min)("max",t.max),f(),w("value",t.sliderValue),f(2),K(" ",t.displayRadius()," ")}}var sj=class n{radius;min=5;max=250;raised=!0;showSelf=!1;closed=new me;slideCtl;bgImage;sliderValue;rodeOut=!1;convert=Ue;useDefaultRadius;useSetManual;defaultRodeLength=$(10);defaultAlarmRadius=$(10);disableRaiseDrop;anchor=M(hg);app=M(oe);signalk=M(Lt);destroyRef=M(gi);radiusValue=$(0);formattedRadiusValue=Qe(()=>!Number.isFinite(this.radiusValue())||this.raised?"--":`${Math.round(this.radiusValue())}${Ue.getSymbol(this.app.config.units.length)}`);displayRadius=$("--");constructor(){}ngOnInit(){this.useDefaultRadius=this.app.config.anchor.setRadius,this.useSetManual=this.app.config.anchor.manualSet,this.defaultRodeLength.update(()=>Math.round(this.transformValue(this.app.config.anchor.rodeLength))),this.defaultAlarmRadius.update(()=>Math.round(this.transformValue(this.app.config.anchor.radius)))}ngOnChanges(e){e.radius&&(e.radius.previousValue===-1?(this.sliderValue=Math.round(e.radius.currentValue),this.max=this.sliderValue+100):e.radius.firstChange&&e.radius.currentValue!==-1&&(this.sliderValue=Math.round(e.radius.currentValue),this.max=this.sliderValue+100),this.radiusValue.update(()=>this.transformValue(e.radius.currentValue)),this.displayRadius.update(()=>this.formatTransformedValue(e.radius.currentValue))),this.bgImage=`url('${this.raised?"./assets/img/anchor-radius-raised.png":"./assets/img/anchor-radius.png"}')`,this.rodeOut=!this.raised&&this.radius!==-1,this.disableRaiseDrop=!this.showSelf||this.raised&&this.useSetManual}transformValue(e){return Ue.transform(e,"m",this.app.config.units.length)}formatTransformedValue(e){return`${Math.round(this.transformValue(e))} ${Ue.getSymbol(this.app.config.units.length)}`}get formatSliderLabel(){return e=>this.formatTransformedValue(e)}onDefaultRadiusChecked(e){this.useDefaultRadius=e.checked,this.app.config.anchor.setRadius=e.checked,e.checked||this.defaultAlarmRadius.update(()=>Math.round(this.transformValue(this.app.config.anchor.radius))),this.app.saveConfig()}onDefaultRadiusChange(e){this.app.config.anchor.radius=Math.round(Ue.transform(e,this.app.config.units.length,"m"))}onSetManualCheck(e){this.useSetManual=e.checked,this.app.config.anchor.manualSet=e.checked,e.checked||this.defaultRodeLength.update(()=>Math.round(this.transformValue(this.app.config.anchor.rodeLength))),this.disableRaiseDrop=this.raised&&this.useSetManual,this.app.saveConfig()}stepSetRode(){this.setRadius()}setRadius(e){this.rodeOut=!0,this.displayRadius.update(()=>this.formatTransformedValue(e)),this.raised||this.signalk.post("/plugins/anchoralarm/setRadius",typeof e=="number"?{radius:e}:{}).pipe(Zt(this.destroyRef)).subscribe({next:()=>{this.app.config.anchor.radius=e,this.app.saveConfig()},error:t=>{this.app.parseHttpErrorResponse(t)}})}setManualAnchor(){if(typeof this.defaultRodeLength()!="number"){this.app.showAlert("Error","Rode length value is not a number!");return}this.app.config.anchor.rodeLength=Math.round(Ue.transform(this.defaultRodeLength(),this.app.config.units.length,"m")),this.signalk.post("/plugins/anchoralarm/setManualAnchor",{rodeLength:this.app.config.anchor.rodeLength}).pipe(Zt(this.destroyRef)).subscribe({next:()=>{this.app.saveConfig()},error:e=>{this.app.parseHttpErrorResponse(e)}})}dropRaiseAnchor(e){e.checked?this.dropAnchor(this.useDefaultRadius?this.app.config.anchor.radius:void 0):this.raiseAnchor()}dropAnchor(e){this.app.config.anchor.radius=e,this.anchor.setRaisedSignal(!1),this.signalk.post("/plugins/anchoralarm/dropAnchor",typeof e=="number"?{radius:e}:{}).pipe(Zt(this.destroyRef)).subscribe({next:()=>{this.app.saveConfig()},error:t=>{this.anchor.setRaisedSignal(!0),this.app.parseHttpErrorResponse(t)}})}raiseAnchor(){this.signalk.post("/plugins/anchoralarm/raiseAnchor",{}).pipe(Zt(this.destroyRef)).subscribe({next:()=>{},error:e=>{this.app.parseHttpErrorResponse(e)}})}shiftAnchor(e){let i=(0,lj.computeDestinationPoint)(this.anchor.position(),1,e);this.anchor.setAnchorPosition([i.longitude,i.latitude]).catch(r=>{this.app.parseHttpErrorResponse(r)})}close(){this.closed.emit()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["anchor-watch"]],viewQuery:function(t,i){if(t&1&&Ot(i_e,7),t&2){let r;Ee(r=Ie())&&(i.slideCtl=r.first)}},inputs:{radius:"radius",min:"min",max:"max",raised:"raised",showSelf:"showSelf"},outputs:{closed:"closed"},features:[Se],decls:51,vars:24,consts:[["slideCtl",""],["chkDefaultRadius",""],["ctlAlarmRadius","ngModel"],["chkSetManual",""],["ctlRodeLength","ngModel"],["stepper",""],[1,"anchorwatch","mat-app-background"],[1,"title-block"],[2,"width","50px"],["mat-icon-button","","matTooltip","Close","matTooltipPosition","left",3,"click"],[2,"flex","1 1 auto","padding-top","7px"],[2,"width","150px","height","150px","color","black","background-position","top left","background-size","cover"],[2,"position","relative","top","30px","left","80px","width","35px","text-align","right"],[2,"width","100%"],[3,"change","hideIcon","disabled","checked"],[2,"flex","2"],[3,"change","checked","disabled"],["floatLabel","always",2,"max-width","130px"],["matInput","","required","","type","number","min","1","step","1",3,"ngModelChange","ngModel","disabled"],["mat-raised-button","",3,"click","disabled"],["orientation","vertical",3,"linear","selectedIndex"],["editable","false",3,"label"],["mat-mini-fab","","matStepperNext","",3,"click"],["label","Adjust","editable","false"],[2,"display","flex"],["discrete","","step","1","tickInterval","1",3,"disabled","displayWith","min","max"],["matSliderThumb","",3,"valueChange","value"],[2,"flex","1","font-size","10pt","line-height","3em","text-align","right"],[3,"direction"],[2,"font-style","italic","font-size","small"]],template:function(t,i){if(t&1){let r=H();u(0,"div",6)(1,"mat-card")(2,"mat-card-title")(3,"div",7)(4,"div",8)(5,"button",9),T("click",function(){return i.close()}),u(6,"mat-icon"),_(7,"arrow_back"),h()()(),u(8,"div",10),_(9,"Anchor Watch"),h()()(),u(10,"mat-card-content")(11,"div")(12,"b"),_(13,"Status:"),h()(),u(14,"div",11)(15,"b",12),_(16),h()()(),u(17,"mat-card-actions")(18,"div",13)(19,"div"),_(20," RAISE "),u(21,"mat-slide-toggle",14,0),T("change",function(a){return i.dropRaiseAnchor(a)}),h(),_(23," DROP "),h(),u(24,"div")(25,"div",15)(26,"mat-checkbox",16,1),T("change",function(a){return i.onDefaultRadiusChecked(a)}),_(28,"Set Radius "),h()(),u(29,"div")(30,"mat-form-field",17)(31,"mat-label"),_(32),h(),u(33,"input",18,2),T("ngModelChange",function(a){return i.onDefaultRadiusChange(a)}),h(),R(35,n_e,2,0,"mat-error"),h()()(),u(36,"div")(37,"div")(38,"mat-checkbox",16,3),T("change",function(a){return i.onSetManualCheck(a)}),h()(),u(40,"div",15)(41,"button",19),T("click",function(){return i.setManualAnchor()}),_(42," Manual Set "),h()(),u(43,"div")(44,"mat-form-field",17)(45,"mat-label"),_(46),h(),u(47,"input",18,4),Qt("ngModelChange",function(a){return O(r),Yt(i.defaultRodeLength,a)||(i.defaultRodeLength=a),F(a)}),h(),R(49,r_e,2,0,"mat-error"),h()()()()()(),R(50,o_e,32,9,"div"),h()}if(t&2){let r=Be(34),o=Be(48);f(14),vt("background-image",i.bgImage),f(2),K(" ",i.formattedRadiusValue()," "),f(5),w("hideIcon",!0)("disabled",i.disableRaiseDrop||r.invalid)("checked",!i.raised),f(3),vt("display",i.raised?"flex":"none"),f(2),w("checked",i.useDefaultRadius)("disabled",!i.raised||i.useSetManual),f(6),K("Alarm Radius (",i.convert.getSymbol(i.app.config.units.length),")"),f(),w("ngModel",i.defaultAlarmRadius())("disabled",!i.raised||!i.useDefaultRadius||i.useSetManual),f(2),A(r.invalid&&(r.dirty||r.touched)?35:-1),f(),vt("display",i.raised?"flex":"none"),f(2),w("checked",i.useSetManual)("disabled",!i.raised||i.useDefaultRadius),f(3),w("disabled",!i.raised||i.useDefaultRadius||!i.useSetManual||o.invalid),f(5),K("Rode Length (",i.convert.getSymbol(i.app.config.units.length),")"),f(),Xt("ngModel",i.defaultRodeLength),w("disabled",!i.raised||i.useDefaultRadius||!i.useSetManual),f(2),A(o.invalid&&(o.dirty||o.touched)?49:-1),f(),A(i.raised?-1:50)}},dependencies:[se,ce,ue,Ze,Ns,Fe,et,Bt,Xn,ti,Zn,Fi,cn,Dt,qn,ah,fn,po,sh,gn,Pt,ui,Gt,Vt,ho,aa,Vo,Zl,ql,vl,ye,Te,Yf,t1,i1,rG,uw],styles:[".anchorwatch[_ngcontent-%COMP%]{min-width:150px;position:relative;height:100%;overflow-y:scroll}.anchorwatch[_ngcontent-%COMP%] .title-block[_ngcontent-%COMP%]{padding-left:5px;display:flex}.anchorwatch[_ngcontent-%COMP%] .title-block[_ngcontent-%COMP%] .title-text[_ngcontent-%COMP%]{font-family:roboto;font-size:14pt;font-weight:500}.anchorwatch[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{overflow-y:auto;position:absolute;inset:50px 0 0}"],changeDetection:0})};var pw=class n{constructor(e,t){this.signalk=e;this.app=t}signalk;app;getPath(e){return`vessels/self/autopilots/${e??"_default"}`}fetchOptions(e){return new Promise((t,i)=>{this.signalk.api.get(this.app.skApiVersion,this.getPath(e)).subscribe(r=>{r.options?t(r.options):i(new Error("Invalid autopilot options!"))},()=>i(new Error("No autopilot providers found!")))})}engage(e){return new Promise((t,i)=>{this.signalk.api.post(this.app.skApiVersion,`${this.getPath(e)}/engage`,null).subscribe(()=>t(),r=>i(r))})}disengage(e){return new Promise((t,i)=>{this.signalk.api.post(this.app.skApiVersion,`${this.getPath(e)}/disengage`,null).subscribe(()=>t(),r=>i(r))})}adjustTarget(e,t){return new Promise((i,r)=>{if(typeof e!="number"){r(new Error("Invalid value supplied!"));return}this.signalk.api.put(this.app.skApiVersion,`${this.getPath(t)}/target/adjust`,{value:e,units:"deg"}).subscribe(()=>i(),o=>r(o))})}dodge(e,t){return new Promise((i,r)=>{e?this.signalk.api.post(this.app.skApiVersion,`${this.getPath(t)}/dodge`,null).subscribe(()=>i(),o=>r(o)):this.signalk.api.delete(this.app.skApiVersion,`${this.getPath(t)}/dodge`).subscribe(()=>i(),o=>r(o))})}adjustDodge(e,t){return new Promise((i,r)=>{if(typeof e!="number"){r(new Error("Invalid value supplied!"));return}this.signalk.api.put(this.app.skApiVersion,`${this.getPath(t)}/dodge`,{value:e,units:"deg"}).subscribe(()=>i(),o=>r(o))})}mode(e,t){return new Promise((i,r)=>{if(typeof e!="string"){r(new Error("Invalid value supplied!"));return}this.signalk.api.put(this.app.skApiVersion,`${this.getPath(t)}/mode`,{value:e}).subscribe(()=>i(),o=>r(o))})}state(e,t){return new Promise((i,r)=>{if(typeof e!="string"){r(new Error("Invalid value supplied!"));return}this.signalk.api.put(this.app.skApiVersion,`${this.getPath(t)}/state`,{value:e}).subscribe(()=>i(),o=>r(o))})}static \u0275fac=function(t){return new(t||n)(ut(Lt),ut(oe))};static \u0275prov=Je({token:n,factory:n.\u0275fac,providedIn:"root"})};var s_e=(n,e)=>({"button-warn":n,"button-primary":e}),l_e=(n,e)=>({"button-accent":n,"button-toolbar":e}),c_e=(n,e)=>e.name;function d_e(n,e){n&1&&(u(0,"mat-icon"),_(1,"check"),h())}function u_e(n,e){n&1&&(u(0,"mat-icon"),_(1,"ok"),h())}function p_e(n,e){if(n&1){let t=H();u(0,"button",23),T("click",function(){let r=O(t).$implicit,o=v();return F(o.setMode(r))}),u(1,"span"),_(2),h(),R(3,d_e,2,0,"mat-icon")(4,u_e,2,0,"mat-icon"),h()}if(n&2){let t=e.$implicit,i=v();f(2),X(t),f(),A(t===i.apData().mode?3:4)}}function h_e(n,e){n&1&&(u(0,"mat-icon"),_(1,"check"),h())}function m_e(n,e){n&1&&(u(0,"mat-icon"),_(1,"ok"),h())}function f_e(n,e){if(n&1){let t=H();u(0,"button",23),T("click",function(){let r=O(t).$implicit,o=v();return F(o.setState(r.name))}),u(1,"span"),_(2),h(),R(3,h_e,2,0,"mat-icon")(4,m_e,2,0,"mat-icon"),h()}if(n&2){let t=e.$implicit,i=v();f(2),X(t.name),f(),A(t.name===i.apData().state?3:4)}}function g_e(n,e){n&1&&(u(0,"span"),_(1,"Target"),h())}function __e(n,e){n&1&&(u(0,"span"),_(1,"No Pilot"),h())}function y_e(n,e){if(n&1&&(u(0,"span"),_(1),h()),n&2){let t=v();f(),X(t.formatTargetValue(t.apData().target))}}function v_e(n,e){n&1&&(u(0,"span"),_(1,"--"),h())}function b_e(n,e){if(n&1&&(u(0,"span"),_(1),h()),n&2){let t=v();f(),X(t.apData().state)}}function x_e(n,e){n&1&&(u(0,"span"),_(1,"--"),h())}function C_e(n,e){if(n&1&&(u(0,"span"),_(1),h()),n&2){let t=v();f(),X(t.apData().mode)}}function w_e(n,e){n&1&&(u(0,"span"),_(1,"--"),h())}function M_e(n,e){if(n&1&&(u(0,"button",18),z(1,"div",24),h()),n&2){let t=v(),i=Be(5);w("matMenuTriggerFor",i)("disabled",t.noPilot())("ngClass",gl(4,s_e,t.apData().enabled,!t.apData().enabled)),f(),w("innerText",t.formatLabel(t.apData().state))}}function S_e(n,e){if(n&1){let t=H();u(0,"mat-slide-toggle",25),T("toggleChange",function(){O(t);let r=v();return F(r.toggleEngaged())}),h()}if(n&2){let t=v();w("checked",t.apData().enabled)("disabled",t.noPilot())("matTooltip",t.apData().enabled?"Disengage":"Engage")}}function T_e(n,e){if(n&1&&(u(0,"button",20),_(1," Mode "),h()),n&2){let t=v(),i=Be(1);w("matMenuTriggerFor",i)("disabled",t.noPilot()||t.modeOptions().length===0)}}function E_e(n,e){if(n&1){let t=H();u(0,"div",21)(1,"div",17)(2,"button",26),T("click",function(){O(t);let r=v();return F(r.dodgeAdjust(-10))}),_(3," <<"),h(),_(4,"\xA0 "),u(5,"button",27),T("click",function(){O(t);let r=v();return F(r.dodgeAdjust(-1))}),_(6," < "),h()(),u(7,"div")(8,"button",27),T("click",function(){O(t);let r=v();return F(r.dodgeAdjust(1))}),_(9," >"),h(),_(10,"\xA0 "),u(11,"button",26),T("click",function(){O(t);let r=v();return F(r.dodgeAdjust(10))}),_(12," >> "),h()()()}if(n&2){let t=v();f(2),w("disabled",!t.apData().default||t.apData().state==="off-line"),f(3),w("disabled",!t.apData().default||t.apData().state==="off-line"),f(3),w("disabled",!t.apData().default||t.apData().state==="off-line"),f(3),w("disabled",!t.apData().default||t.apData().state==="off-line")}}function I_e(n,e){if(n&1){let t=H();u(0,"div",21)(1,"div",17)(2,"button",26),T("click",function(){O(t);let r=v();return F(r.targetAdjust(-10))}),_(3," -10"),h(),_(4,"\xA0 "),u(5,"button",27),T("click",function(){O(t);let r=v();return F(r.targetAdjust(-1))}),_(6," -1 "),h()(),u(7,"div")(8,"button",27),T("click",function(){O(t);let r=v();return F(r.targetAdjust(1))}),_(9," +1"),h(),_(10,"\xA0 "),u(11,"button",26),T("click",function(){O(t);let r=v();return F(r.targetAdjust(10))}),_(12," +10 "),h()()()}if(n&2){let t=v();f(2),w("disabled",!t.apData().default||t.apData().state==="off-line"),f(3),w("disabled",!t.apData().default||t.apData().state==="off-line"),f(3),w("disabled",!t.apData().default||t.apData().state==="off-line"),f(3),w("disabled",!t.apData().default||t.apData().state==="off-line")}}function k_e(n,e){if(n&1){let t=H();u(0,"button",28),T("click",function(){O(t);let r=v();return F(r.toggleDodge())}),_(1," Dodge "),h()}if(n&2){let t=v();w("ngClass",gl(2,l_e,t.apData().mode==="dodge",t.apData().mode!=="dodge"))("disabled",t.noPilot())}}var cj=class n{constructor(e,t){this.app=e;this.autopilot=t;Me(()=>{this.apData().default!==this.currentPilot&&(this.app.debug("changed default pilot:",this.currentPilot,this.apData().default),this.currentPilot=this.apData().default,this.fetchAPOptions())})}app;autopilot;close=new me;modeOptions=$([]);stateOptions=$([]);currentPilot;apData=Z({});noPilot=Qe(()=>!this.app.featureFlags().autopilotApi||!this.apData().default||!this.apData().state||this.apData().state==="off-line");dodgeAction=Qe(()=>this.apData().availableActions?.includes("dodge"));handleClose(){this.close.emit()}fetchAPOptions(){return Y(this,null,function*(){try{let e=yield this.autopilot.fetchOptions();e.modes&&Array.isArray(e.modes)&&this.modeOptions.set(e.modes),e.states&&Array.isArray(e.states)&&this.stateOptions.set(e.states)}catch(e){this.modeOptions.set([]),this.stateOptions.set([]),this.app.showMessage("No autopilot providers found!")}})}toggleEngaged(){return Y(this,null,function*(){try{this.apData().enabled?yield this.autopilot.disengage():yield this.autopilot.engage()}catch(e){let t=`Error setting Autopilot state!
|
|
4095
4095
|
`;e.status===403?(t+="Unauthorised: Please login.",this.app.showAlert(`Error (${e.status}):`,t)):this.app.showMessage(e.error?.message??"Device returned an error!")}})}targetAdjust(e){return Y(this,null,function*(){try{yield this.autopilot.adjustTarget(e)}catch(t){t.status===403?this.app.showAlert(`Error (${t.status}):`,"Unauthorised: Please login."):this.app.showMessage(t.error?.message??"Device returned an error!")}})}toggleDodge(){return Y(this,null,function*(){try{yield this.autopilot.dodge(this.apData().mode!=="dodge"),this.app.debug("Set dodge mode.")}catch(e){e.status===403?this.app.showAlert(`Error (${e.status}):`,"Unauthorised: Please login."):this.app.showMessage(e.error?.message??"Device returned an error!")}})}dodgeAdjust(e){return Y(this,null,function*(){try{yield this.autopilot.adjustDodge(e)}catch(t){t.status===403?this.app.showAlert(`Error (${t.status}):`,"Unauthorised: Please login."):this.app.showMessage(t.error?.message??"Device returned an error!")}})}setMode(e){return Y(this,null,function*(){try{yield this.autopilot.mode(e)}catch(t){let i=`Error setting Autopilot mode!
|
|
4096
4096
|
`;t.status===403?(i+="Unauthorised: Please login.",this.app.showAlert(`Error (${t.status}):`,i)):this.app.showMessage(t.error?.message??"Device returned an error!")}})}setState(e){return Y(this,null,function*(){try{yield this.autopilot.state(e)}catch(t){let i=`Error setting Autopilot state!
|
|
4097
|
-
`;t.status===403?(i+="Unauthorised: Please login.",this.app.showAlert(`Error (${t.status}):`,i)):this.app.showMessage(t.error?.message??"Device returned an error!")}})}dragEventHandler(e,t){this.app.debug("e:",e,"type:",t,e.event.srcElement.clientLeft,e.event.srcElement.clientTop)}formatLabel(e){return e?e.toUpperCase():"..."}formatTargetValue(e){return typeof e=="number"?Ue.radiansToDegrees(e)?.toFixed(1):"--"}static \u0275fac=function(t){return new(t||n)(ie(oe),ie(pw))};static \u0275cmp=U({type:n,selectors:[["autopilot-console"]],inputs:{apData:[1,"apData"]},outputs:{close:"close"},decls:48,vars:9,consts:[["modemenu","matMenu"],["statemenu","matMenu"],["mat-menu-item",""],["cdkDragHandle",""],["cdkDrag","",1,"autopilot-console",3,"cdkDragReleased"],[1,"title",2,"cursor","grab"],[2,"text-align","center","width","100%"],["matTooltip","Close",1,"icon-warn",2,"cursor","pointer",3,"click"],[1,"content"],[2,"height","45px","color","whitesmoke"],[1,"lcd"],[2,"padding","5px 0","display","flex"],[1,"dial-text-title"],[1,"dial-text"],[1,"dial-text-value"],[2,"padding","10px 0","display","flex"],[1,"button-bar"],[2,"width","50%"],["mat-raised-button","",1,"button-primary",2,"max-width","100px",3,"matMenuTriggerFor","disabled","ngClass"],[3,"checked","disabled","matTooltip"],["mat-raised-button","",1,"button-secondary",3,"matMenuTriggerFor","disabled"],[1,"button-bar-thin"],["mat-raised-button","",3,"ngClass","disabled"],["mat-menu-item","",3,"click"],[2,"white-space","pre","text-overflow","ellipsis","overflow","hidden","max-width","90px",3,"innerText"],[3,"toggleChange","checked","disabled","matTooltip"],["mat-mini-fab","",1,"button-secondary",3,"click","disabled"],["mat-mini-fab","",1,"button-toolbar",3,"click","disabled"],["mat-raised-button","",3,"click","ngClass","disabled"]],template:function(t,i){t&1&&(u(0,"mat-menu",null,0),Ae(2,p_e,5,2,"button",2,wt),h(),u(4,"mat-menu",null,1),Ae(6,f_e,5,2,"button",2,c_e),h(),u(8,"mat-card",3)(9,"div",4),T("cdkDragReleased",function(o){return i.dragEventHandler(o,"released")}),u(10,"div",5)(11,"div",6)(12,"mat-icon",7),T("click",function(){return i.handleClose()}),_(13,"close"),h()()(),u(14,"mat-card-content")(15,"div",8)(16,"div",9),_(17," Autopilot"),z(18,"br"),_(19),h(),u(20,"div",10)(21,"div",11)(22,"div",12),R(23,g_e,2,0,"span")(24,__e,2,0,"span"),h()(),u(25,"div",13)(26,"div",14),R(27,y_e,2,1,"span")(28,v_e,2,0,"span"),_(29," \xB0 "),h()(),u(30,"div",15)(31,"div",12),R(32,b_e,2,1,"span")(33,x_e,2,0,"span"),h(),u(34,"div",12),R(35,C_e,2,1,"span")(36,w_e,2,0,"span"),h()()(),u(37,"div",16)(38,"div",17),R(39,M_e,2,7,"button",18)(40,S_e,1,3,"mat-slide-toggle",19),h(),u(41,"div"),R(42,T_e,2,2,"button",20),h()(),R(43,E_e,13,4,"div",21)(44,I_e,13,4,"div",21),u(45,"div",21)(46,"div",6),R(47,k_e,2,5,"button",22),h()()()()()()),t&2&&(f(2),Le(i.modeOptions()),f(4),Le(i.stateOptions()),f(13),K(" ",i.apData().default??""," "),f(4),A(i.apData().default?23:24),f(4),A(i.apData().default||i.apData().state==="off-line"?27:28),f(5),A(i.apData().default||i.apData().state==="off-line"?32:33),f(3),A(i.apData().default||i.apData().state==="off-line"?35:36),f(4),A(i.stateOptions().length>2?39:40),f(3),A(i.modeOptions().length!==0?42:-1),f(),A(i.apData().mode==="dodge"?43:44),f(4),A(i.dodgeAction()?47:-1))},dependencies:[ye,Te,mn,Rn,yC,So,dl,ue,Ze,Ns,et,Bt,ti,se,ce,Ec,is,Is,hl,aa,Vo,Dt],styles:['.autopilot-console[_ngcontent-%COMP%]{position:absolute;z-index:6010;top:130px;left:50px;display:flex;flex-direction:column;font-family:Roboto,Arial,Helvetica,sans-serif;font-size:10pt;width:238px;height:400px;background-image:url("./media/autopilot-GCOLQT5X.png");background-color:transparent;border-radius:115px}.autopilot-console[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{padding:10px 0 0;font-weight:500;font-size:14px;line-height:23px;display:flex;color:#ede0dd;text-align:center}.autopilot-console[_ngcontent-%COMP%] .title[_ngcontent-%COMP%] .closer[_ngcontent-%COMP%]:hover{cursor:pointer}.autopilot-console[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{padding:0 5px;margin:0;flex:1 1 auto;text-align:center}.autopilot-console[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .lcd[_ngcontent-%COMP%]{padding:5px 0;color:#000;margin:0 15px}.autopilot-console[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .dial-text[_ngcontent-%COMP%]{font-family:roboto;flex:1 1 auto}.autopilot-console[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .dial-text-title[_ngcontent-%COMP%]{font-size:10pt;font-weight:500;flex:1}.autopilot-console[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .dial-text-value[_ngcontent-%COMP%]{font-size:37pt;font-weight:500}.autopilot-console[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .dial-text-units[_ngcontent-%COMP%]{font-size:10pt}.autopilot-console[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .button-bar[_ngcontent-%COMP%]{display:flex;flex-wrap:nowrap;padding:30px 0 10px}.autopilot-console[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .button-bar-thin[_ngcontent-%COMP%]{display:flex;flex-wrap:nowrap;padding:10px 0 0}'],changeDetection:0})};var hw="/resources/buddies",mw=class n{constructor(e,t){this.signalk=e;this.app=t}signalk;app;list(){return this.signalk.api.get(this.app.skApiVersion,`${hw}`)}add(e,t){return this.signalk.api.post(this.app.skApiVersion,`${hw}`,{urn:e,name:t})}update(e,t){return this.signalk.api.put(this.app.skApiVersion,`${hw}/${e}`,{name:t})}remove(e){return this.signalk.api.delete(this.app.skApiVersion,`${hw}/${e}`)}static \u0275fac=function(t){return new(t||n)(ut(Lt),ut(oe))};static \u0275prov=Je({token:n,factory:n.\u0275fac,providedIn:"root"})};var D_e=["*"],dj=class n{closed=xe();infoPanel=M(Ic);close(){this.infoPanel.close(),this.closed.emit()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["info-panel"]],outputs:{closed:"closed"},ngContentSelectors:D_e,decls:8,vars:0,consts:[[2,"position","relative"],[2,"text-align","right"],["mat-list-item","","matIconButton","",3,"click"],[2,"position","fixed","bottom","0","top","60px","width","247px"]],template:function(t,i){t&1&&(fe(),u(0,"div",0)(1,"mat-nav-list",1)(2,"a",2),T("click",function(){return i.close()}),u(3,"mat-icon"),_(4,"close"),h()(),z(5,"mat-divider"),h()(),u(6,"div",3),de(7),h())},dependencies:[An,Vs,mo,Pa,se,ce],encapsulation:2,changeDetection:0})};function P_e(n,e){if(n&1&&z(0,"h1",8),n&2){let t=e.$implicit;w("remarkNode",t)}}function R_e(n,e){if(n&1&&(u(0,"remark",1),St(1,P_e,1,1,"ng-template",7),h()),n&2){let t=v();w("processor",t.mdProcessor)("markdown",t.resource()[1].description??"")}}function A_e(n,e){if(n&1&&z(0,"div",2),n&2){let t=v();w("innerHTML",t.resource()[1].description??"",zd)}}function L_e(n,e){if(n&1&&(u(0,"div",10),_(1),h()),n&2){let t=v().$implicit;f(),K(" ",t[1]," ")}}function O_e(n,e){if(n&1&&(z(0,"div",11),bt(1,"coords")),n&2){let t=v().$implicit,i=v();w("innerText",Mi(1,1,t[1],i.app.config.units.positionFormat,!0))}}function F_e(n,e){if(n&1&&(z(0,"div",11),bt(1,"coords")),n&2){let t=v().$implicit,i=v();w("innerText",$n(1,1,t[1],i.app.config.units.positionFormat))}}function N_e(n,e){if(n&1&&(u(0,"div",3)(1,"div",9),_(2),h(),R(3,L_e,2,1,"div",10),R(4,O_e,2,5,"div",11),R(5,F_e,2,4,"div",11),h()),n&2){let t=e.$implicit;f(2),K("",t[0],":"),f(),A(t[0]!=="Latitude"&&t[0]!=="Longitude"?3:-1),f(),A(t[0]==="Latitude"?4:-1),f(),A(t[0]==="Longitude"?5:-1)}}function B_e(n,e){if(n&1){let t=H();u(0,"div",6)(1,"button",12),T("click",function(){O(t);let r=v();return F(r.emitModify())}),u(2,"mat-icon"),_(3,"touch_app"),h(),_(4),h()()}if(n&2){let t=v();vt("order",t.type()==="route"?1:null),f(),w("disabled",t.ctrl.isReadOnly),f(3),K(" ",t.ctrl.modifyLabel," ")}}function V_e(n,e){if(n&1){let t=H();u(0,"div",6)(1,"button",13),T("click",function(){O(t);let r=v();return F(r.emitAddNote())}),u(2,"mat-icon"),_(3,"local_offer"),h(),_(4," ADD "),h()()}}function G_e(n,e){if(n&1){let t=H();u(0,"div",6)(1,"button",14),T("click",function(){O(t);let r=v();return F(r.emitHide())}),u(2,"mat-icon"),_(3,"visibility_off"),h(),_(4," HIDE "),h()()}if(n&2){let t=v();vt("order",t.type()==="route"?6:null),f(),w("disabled",t.ctrl.isActive)}}function z_e(n,e){if(n&1){let t=H();u(0,"div",6)(1,"button",15),T("click",function(){O(t);let r=v();return F(r.emitDelete())}),u(2,"mat-icon"),_(3,"delete"),h(),_(4," DELETE "),h()()}if(n&2){let t=v();vt("order",t.type()==="route"?7:null),f(),w("disabled",t.ctrl.isReadOnly||t.ctrl.isActive)}}function j_e(n,e){if(n&1){let t=H();u(0,"div",6)(1,"button",16),T("click",function(){O(t);let r=v();return F(r.emitActive(!0))}),u(2,"mat-icon"),_(3,"near_me"),h(),_(4),h()()}if(n&2){let t=v();vt("order",t.type()==="route"?2:null),f(),w("matTooltip",t.type()==="waypoint"?"Navigate to Waypoint":"Navigate to first point"),f(3),K(" ",t.ctrl.activeText," ")}}function U_e(n,e){if(n&1){let t=H();u(0,"div",6)(1,"button",17),T("click",function(){O(t);let r=v();return F(r.emitActive(!1))}),u(2,"mat-icon"),_(3,"clear_all"),h(),_(4," STOP "),h()()}if(n&2){let t=v();vt("order",t.type()==="route"?2:null)}}function W_e(n,e){if(n&1){let t=H();u(0,"div",6)(1,"button",18),T("click",function(){O(t);let r=v();return F(r.emitPoints())}),u(2,"mat-icon"),_(3,"location_on"),h(),_(4," POINTS "),h()()}if(n&2){let t=v();vt("order",t.type()==="route"?3:null)}}function H_e(n,e){if(n&1){let t=H();u(0,"div",6)(1,"button",19),T("click",function(){O(t);let r=v();return F(r.emitRelated())}),u(2,"mat-icon"),_(3,"style"),h(),_(4," GROUP "),h()()}}function $_e(n,e){if(n&1){let t=H();u(0,"div",6)(1,"button",20),T("click",function(){O(t);let r=v();return F(r.emitNotes())}),u(2,"mat-icon"),_(3,"local_offer"),h(),_(4," NOTES "),h()()}if(n&2){let t=v();vt("order",t.type()==="route"?4:null)}}function K_e(n,e){if(n&1){let t=H();u(0,"div",6)(1,"button",21),T("click",function(){O(t);let r=v();return F(r.emitInfo())}),u(2,"mat-icon"),_(3,"info_outline"),h(),_(4," INFO "),h()()}if(n&2){let t=v();vt("order",t.type()==="route"?5:null)}}function q_e(n,e){if(n&1){let t=H();u(0,"div",6)(1,"button",22),T("click",function(){O(t);let r=v();return F(r.emitSave())}),u(2,"mat-icon"),_(3,"save"),h(),_(4," SAVE "),h()()}if(n&2){let t=v();vt("order",t.type()==="route"?2:null)}}function Z_e(n,e){if(n&1&&(u(0,"div",5),_(1),h(),u(2,"div",6),_(3),h()),n&2){let t=v().$implicit;f(),K("",t[0],":"),f(2),K(" ",t[1]," ")}}function X_e(n,e){if(n&1&&(u(0,"div",4)(1,"div",5),_(2),h(),u(3,"div",7),_(4),h()()),n&2){let t=v().$implicit;f(2),K("",t[0],":"),f(2),K(" ",t[1]," ")}}function Y_e(n,e){if(n&1&&R(0,Z_e,4,2)(1,X_e,5,2,"div",4),n&2){let t=e.$implicit;A(t[0]==="Description"?0:1)}}var uj='.popover[_ngcontent-%COMP%]{position:absolute;top:0;left:0;transform:translate(-50%,-100%);z-index:3990;display:block;max-width:276px;min-width:270px;padding:1px;font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;-webkit-background-clip:padding-box;background-clip:padding-box;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px #0003;line-break:auto}.popover.top[_ngcontent-%COMP%]{margin-top:-10px;margin-left:10px}.popover.bottom[_ngcontent-%COMP%]{transform:translate(-50%);margin-top:10px;margin-left:10px}.popover-title[_ngcontent-%COMP%]{padding:2px 0 2px 5px;margin:0;display:flex;line-height:2.5em;font-size:12pt;background-color:#fafafa82;border-radius:5px 5px 0 0;min-width:110px}.popover-content[_ngcontent-%COMP%]{padding:9px 14px;max-height:330px;overflow:auto}.popover.capped[_ngcontent-%COMP%]{display:flex;flex-direction:column}.popover.capped[_ngcontent-%COMP%] > .popover-title[_ngcontent-%COMP%]{flex-shrink:0}.popover.capped[_ngcontent-%COMP%] > .popover-content[_ngcontent-%COMP%]{flex:1 1 auto;min-height:0}.popover[_ngcontent-%COMP%] > .arrow[_ngcontent-%COMP%], .popover[_ngcontent-%COMP%] > .arrow[_ngcontent-%COMP%]:after{position:absolute;display:block;width:0;height:0;border-style:solid}.popover[_ngcontent-%COMP%] > .arrow[_ngcontent-%COMP%]{border-width:11px}.popover[_ngcontent-%COMP%] > .arrow[_ngcontent-%COMP%]:after{content:"";border-width:10px}.popover.top[_ngcontent-%COMP%] > .arrow[_ngcontent-%COMP%]{bottom:-11px;left:50%;margin-left:-11px;border-bottom-width:0;border-right-width:0;border-left-width:0}.popover.top[_ngcontent-%COMP%] > .arrow[_ngcontent-%COMP%]:after{bottom:1px;margin-left:-10px;content:" ";border-bottom-width:0}.popover.bottom[_ngcontent-%COMP%] > .arrow[_ngcontent-%COMP%]{top:-11px;left:50%;margin-left:-11px;border-top-width:0;border-right-width:0;border-left-width:0}.popover.bottom[_ngcontent-%COMP%] > .arrow[_ngcontent-%COMP%]:after{top:1px;margin-left:-10px;content:" ";border-top-width:0}.popover.measure[_ngcontent-%COMP%]{min-width:100px;background-color:#39c}.popover.measure[_ngcontent-%COMP%] > .popover-content[_ngcontent-%COMP%]{display:none}.popover.measure[_ngcontent-%COMP%] > .popover-title[_ngcontent-%COMP%]{color:#fff;font-weight:700;border-bottom:none;background-color:inherit;text-align:left;width:max-content}.popover.top.measure[_ngcontent-%COMP%] > .arrow[_ngcontent-%COMP%]{bottom:-11px;left:50%;margin-left:-11px;border-bottom-width:0;border-right-width:0;border-left-width:0}.popover.top.measure[_ngcontent-%COMP%] > .arrow[_ngcontent-%COMP%]:after{bottom:1px;margin-left:-10px;content:" ";border-bottom-width:0;border-top-color:#39c}.popover.bottom.measure[_ngcontent-%COMP%] > .arrow[_ngcontent-%COMP%]:after{border-bottom-color:#39c}.popover-action-button[_ngcontent-%COMP%]{flex:1 1 45%}.popover.docked[_ngcontent-%COMP%]{position:static;transform:none;margin:0}.popover.docked[_ngcontent-%COMP%] > .arrow[_ngcontent-%COMP%]{display:none}.popover.compact[_ngcontent-%COMP%]{min-width:0;max-width:170px;width:fit-content}.popover.compact[_ngcontent-%COMP%] > .popover-title[_ngcontent-%COMP%]{padding:0;line-height:0;min-height:0;min-width:unset}.popover.compact[_ngcontent-%COMP%] > .popover-content[_ngcontent-%COMP%]{padding:6px 10px}',fw=class n{mdProcessor=Br;title=Z();resource=Z();type=Z();active=Z();featureCount=Z(0);units=Z("m");canClose=Z();canSave=Z(!1);canStart=Z(!1);modify=xe();save=xe();delete=xe();hide=xe();addNote=xe();activated=xe();deactivated=xe();related=xe();info=xe();closed=xe();points=xe();notes=xe();_title=Ma(()=>this.title());properties;ctrl={showInfoButton:!1,showModifyButton:!1,showDeleteButton:!1,showHideButton:!1,showAddNoteButton:!1,showRelatedButton:!1,showPointsButton:!1,showNotesButton:!1,showSaveButton:!1,canActivate:!1,isActive:!1,activeText:"ACTIVE",isReadOnly:!1,modifyLabel:"MOVE"};hasMarkdown=$(!1);icon;app=M(oe);constructor(){Me(()=>this.computeControls())}computeControls(){this.resource(),this.type(),this.active(),this.parse(),this.ctrl.showModifyButton=this.type()!=="destination"&&this.featureCount()>0,this.ctrl.modifyLabel=this.type()==="route"||this.type()==="region"?"MODIFY":"MOVE",this.ctrl.showSaveButton=this.type()==="route"&&this.canSave(),this.ctrl.showSaveButton&&(this.ctrl.showDeleteButton=!0,this.ctrl.canActivate=this.canStart(),this.ctrl.showNotesButton=!1,this.ctrl.showInfoButton=!1,this.ctrl.showHideButton=!1)}parse(){this.type()==="destination"&&this.parseDestination(),this.type()==="waypoint"&&this.parseWaypoint(),this.type()==="route"&&this.parseRoute(),this.type()==="note"&&this.parseNote(),this.type()==="region"&&this.parseRegion()}parseDestination(){let e=this.resource()[1];this.icon=void 0,this.ctrl.isActive=!this.app.data.activeRoute,this.ctrl.activeText="GO TO",this.ctrl.canActivate=!this.app.data.activeRoute,this.ctrl.showInfoButton=!1,this.ctrl.showModifyButton=!1,this.ctrl.showDeleteButton=!1,this.ctrl.showHideButton=!1,this.ctrl.showNotesButton=!1,this.ctrl.showAddNoteButton=!1,this.ctrl.showPointsButton=!1,this.ctrl.showRelatedButton=!1,this.properties=[],e.name&&this.properties.push(["Name",e.name]),e.description&&this.properties.push(["Desc.",e.description]),this.properties.push(["Latitude",e.feature.geometry.coordinates[1]]),this.properties.push(["Longitude",e.feature.geometry.coordinates[0]]),this.hasMarkdown.set(!0)}parseWaypoint(){let e=this.resource()[1];this.ctrl.isReadOnly=e.feature.properties?.readOnly,this.ctrl.isActive=!!(this.active()&&this.active()===this.resource()[0]),this.ctrl.activeText="GO TO",this.ctrl.canActivate=!0,this.ctrl.showInfoButton=!0,this.ctrl.showModifyButton=!this.ctrl.isReadOnly,this.ctrl.showDeleteButton=this.app.useInfoPanel()?!1:!this.ctrl.isReadOnly,this.ctrl.showHideButton=!1,this.ctrl.showNotesButton=!this.app.useInfoPanel(),this.ctrl.showAddNoteButton=!1,this.ctrl.showPointsButton=!1,this.ctrl.showRelatedButton=!1,this.properties=[],this.icon=Fn("waypoints",e),this._title.set(e.name??""),this.properties.push(["Latitude",e.feature.geometry.coordinates[1]]),this.properties.push(["Longitude",e.feature.geometry.coordinates[0]]),this.hasMarkdown.set(!0)}parseRoute(){let e=this.resource()[1];this.ctrl.isReadOnly=e.feature.properties?.readOnly,this.ctrl.isActive=!!(this.active()&&this.active()===this.resource()[0]),this.ctrl.activeText="START",this.ctrl.canActivate=!0,this.ctrl.showInfoButton=!0,this.ctrl.showModifyButton=!this.ctrl.isReadOnly,this.ctrl.showPointsButton=!this.app.useInfoPanel(),this.ctrl.showNotesButton=!this.app.useInfoPanel(),this.ctrl.showAddNoteButton=!1,this.ctrl.showRelatedButton=!1,this.ctrl.showDeleteButton=!this.ctrl.isReadOnly,this.ctrl.showHideButton=!0,this.icon=Fn("routes",e),this._title.set(e.name??""),this.properties=[];let t=this.app.formatValueForDisplay(e.distance,"m");this.properties.push(["Distance",t]),this.hasMarkdown.set(!0)}parseNote(){let e=this.resource()[1];this.ctrl.isReadOnly=e.properties?.readOnly,this.ctrl.isActive=!1,this.ctrl.activeText="",this.ctrl.canActivate=!1,this.ctrl.showInfoButton=!0,this.ctrl.showModifyButton=!this.ctrl.isReadOnly,this.ctrl.showDeleteButton=this.app.useInfoPanel()?!1:!this.ctrl.isReadOnly,this.ctrl.showHideButton=!1,this.ctrl.showAddNoteButton=!1,this.ctrl.showNotesButton=!1,this.ctrl.showPointsButton=!1,this.ctrl.showRelatedButton=!!(e.group&&this.app.config.resources.notes.groupNameEdit),this.icon=Fn("notes",e),this._title.set(e.name??""),this.properties=[],this.ctrl.isReadOnly=e.properties?.readOnly,this.hasMarkdown.update(()=>e.mimeType?.includes("markdown"))}parseRegion(){let e=this.resource()[1];this.ctrl.isReadOnly=e.feature.properties?.readOnly,this.ctrl.isActive=!1,this.ctrl.activeText="",this.ctrl.canActivate=!1,this.ctrl.showInfoButton=!0,this.ctrl.showModifyButton=e.feature.geometry.type==="MultiPolygon"?!1:!this.ctrl.isReadOnly,this.ctrl.showDeleteButton=this.app.useInfoPanel()?!1:!this.ctrl.isReadOnly,this.ctrl.showHideButton=!1,this.ctrl.showAddNoteButton=!1,this.ctrl.showNotesButton=!this.app.useInfoPanel(),this.ctrl.showPointsButton=!1,this.ctrl.showRelatedButton=!1,this.properties=[],this.icon=Fn("regions",e),this._title.set(e.name??""),this.hasMarkdown.set(!0)}emitModify(){this.modify.emit()}emitSave(){this.save.emit()}emitAddNote(){this.addNote.emit()}emitDelete(){this.delete.emit()}emitHide(){this.hide.emit()}emitActive(e){e?this.activated.emit():this.deactivated.emit()}emitPoints(){this.points.emit()}emitNotes(){this.notes.emit()}emitInfo(){this.info.emit()}emitRelated(){this.related.emit(this.resource()[1].group)}handleClose(){this.closed.emit()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["resource-popover"]],inputs:{title:[1,"title"],resource:[1,"resource"],type:[1,"type"],active:[1,"active"],featureCount:[1,"featureCount"],units:[1,"units"],canClose:[1,"canClose"],canSave:[1,"canSave"],canStart:[1,"canStart"]},outputs:{modify:"modify",save:"save",delete:"delete",hide:"hide",addNote:"addNote",activated:"activated",deactivated:"deactivated",related:"related",info:"info",closed:"closed",points:"points",notes:"notes"},decls:17,vars:14,consts:[[3,"closed","title","icon","canClose"],[2,"flex","1 1 auto","text-align","left","font-style","italic","overflow","hidden","display","-webkit-box","-webkit-box-orient","vertical","-webkit-line-clamp","2","line-clamp","2","text-overflow","ellipsis",3,"processor","markdown"],[2,"flex","1 1 auto","text-align","left","font-style","italic","overflow","hidden","display","-webkit-box","-webkit-box-orient","vertical","-webkit-line-clamp","2","line-clamp","2","text-overflow","ellipsis",3,"innerHTML"],[2,"display","flex"],[2,"display","flex","flex-wrap","wrap"],[1,"popover-action-button",3,"order"],[1,"popover-action-button"],["remarkTemplate","heading"],[2,"font-size","10pt",3,"remarkNode"],[2,"font-weight","bold"],[2,"flex","1 1 auto","text-align","right","white-space","nowrap","overflow-x","hidden","text-overflow","ellipsis"],[2,"flex","1 1 auto","text-align","right",3,"innerText"],["mat-button","","matTooltip","Modify / Move","matTooltipPosition","after",3,"click","disabled"],["mat-button","","matTooltip","Add Note","matTooltipPosition","after",3,"click"],["mat-button","","matTooltip","Hide from Chart","matTooltipPosition","after",3,"click","disabled"],["mat-button","","matTooltip","Delete","matTooltipPosition","after",3,"click","disabled"],["mat-button","","matTooltipPosition","after",3,"click","matTooltip"],["mat-button","","matTooltip","Stop Navigating","matTooltipPosition","after",3,"click"],["mat-button","","matTooltip","Route Points","matTooltipPosition","after",3,"click"],["mat-button","","matTooltip","Notes in Group","matTooltipPosition","after",3,"click"],["mat-button","","matTooltipPosition","after","matTooltip","Show Notes",3,"click"],["mat-button","","matTooltip","Show Details","matTooltipPosition","after",3,"click"],["mat-button","","color","primary","matTooltip","Save Route","matTooltipPosition","after",3,"click"]],template:function(t,i){t&1&&(u(0,"ap-popover",0),T("closed",function(){return i.handleClose()}),R(1,R_e,2,2,"remark",1)(2,A_e,1,1,"div",2),Ae(3,N_e,6,4,"div",3,wt),u(5,"div",4),R(6,B_e,5,4,"div",5),R(7,V_e,5,0,"div",6),R(8,G_e,5,3,"div",5),R(9,z_e,5,3,"div",5),R(10,j_e,5,4,"div",5)(11,U_e,5,2,"div",5),R(12,W_e,5,2,"div",5),R(13,H_e,5,0,"div",6),R(14,$_e,5,2,"div",5),R(15,K_e,5,2,"div",5),R(16,q_e,5,2,"div",5),h()()),t&2&&(w("title",i._title())("icon",i.icon)("canClose",i.canClose()),f(),A(i.hasMarkdown()?1:2),f(2),Le(i.properties),f(3),A(i.ctrl.showModifyButton?6:-1),f(),A(i.ctrl.showAddNoteButton?7:-1),f(),A(i.ctrl.showHideButton?8:-1),f(),A(i.ctrl.showDeleteButton?9:-1),f(),A(i.ctrl.canActivate&&!i.ctrl.isActive?10:i.ctrl.canActivate&&i.ctrl.isActive?11:-1),f(2),A(i.ctrl.showPointsButton?12:-1),f(),A(i.ctrl.showRelatedButton?13:-1),f(),A(i.ctrl.showNotesButton?14:-1),f(),A(i.ctrl.showInfoButton?15:-1),f(),A(i.ctrl.showSaveButton?16:-1))},dependencies:[ue,Ze,ye,Te,se,ce,jn,Vr,go,fo,Qi],styles:[uj],changeDetection:0})},gw=class n{title=Z();resource=Z();canClose=Z();info=xe();closed=xe();properties;icon;app=M(oe);constructor(){Me(()=>{this.title(),this.resource(),this.canClose(),this.parse()})}ngOnChanges(){this.parse()}parse(){this.properties=[],this.properties.push(["Name",this.resource().properties.name??""]),this.properties.push(["Description",this.resource().properties.description??""]),this.icon={name:"star",svgIcon:void 0}}emitInfo(){this.info.emit()}handleClose(){this.closed.emit()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["resourceset-popover"]],inputs:{title:[1,"title"],resource:[1,"resource"],canClose:[1,"canClose"]},outputs:{info:"info",closed:"closed"},features:[Se],decls:9,vars:3,consts:[[3,"closed","title","icon","canClose"],[2,"display","flex","flex-wrap","wrap"],[1,"popover-action-button"],["mat-button","","matTooltip","Show Properties","matTooltipPosition","after",3,"click"],[2,"display","flex"],[2,"font-weight","bold"],[2,"flex","1 1 auto","overflow-x","auto","height","60px"],[2,"flex","1 1 auto","text-align","right","white-space","nowrap","overflow-x","auto","text-overflow","ellipsis"]],template:function(t,i){t&1&&(u(0,"ap-popover",0),T("closed",function(){return i.handleClose()}),Ae(1,Y_e,2,1,null,null,wt),u(3,"div",1)(4,"div",2)(5,"button",3),T("click",function(){return i.emitInfo()}),u(6,"mat-icon"),_(7,"info_outline"),h(),_(8," INFO "),h()()()()),t&2&&(w("title",i.title())("icon",i.icon)("canClose",i.canClose()),f(),Le(i.properties))},dependencies:[ue,Ze,ye,Te,se,ce,jn],styles:[uj],changeDetection:0})};var pj=["speedtext"],Q_e=["speedunitstext"],J_e=["dial"],hj=["headingtext"],mj=["pointer"],fj=["needlehi"],gj=["needlelo"],mg=n=>({hide:n}),e1e=["labeltext"],_w=class{minValue=0;maxValue=360;minAngle=0;maxAngle=360;_scale=1;pointers={value:null,lo:null,hi:null};constructor(e){e&&(this.minValue=e.minValue?e.minValue:this.minValue,this.maxValue=e.maxValue?e.maxValue:this.maxValue,this.minAngle=e.minAngle?e.minAngle:this.minAngle,this.maxAngle=e.maxAngle?e.maxAngle:this.maxAngle),this._init()}_init(){let e=this.minAngle>this.maxAngle?360-this.minAngle+this.maxAngle:this.maxAngle-this.minAngle,t=this.maxValue-this.minValue;this._scale=e/t}getAngle(e){let t=this._checkInRange(e);return t=t-this.minValue,t*this._scale+this.minAngle}_checkInRange(e){return isNaN(e)?0:e>this.maxValue?this.maxValue:e<this.minValue?this.minValue:e}},yw=class n extends _w{speed;speedunits="knots";heading;needle;windtrue;windapparent;speedtext;speedunitstext;dial;headingtext;pointer;needlehi;needlelo;valueStr="0\xBA";ptrOffset=0;renderer=M(Pn);constructor(){super(null)}ngOnInit(){this.pointers.value=this.dial,this.pointers.value2=this.pointer,this.pointers.hi=this.needlehi,this.pointers.lo=this.needlelo,this.updateDial()}ngOnChanges(e){this.updateDial(e)}updateDial(e=null){let t={heading:null,needle:null,windtrue:null,windapparent:null,speed:null};if(t.heading=e&&e.heading?e.heading.currentValue:this.heading,t.needle=e&&e.needle?e.needle.currentValue:this.needle,t.windtrue=e&&e.hi?e.windtrue.currentValue:this.windtrue,t.windapparent=e&&e.windapparent?e.windapparent.currentValue:this.windapparent,t.speed=e&&e.speed?e.speed.currentValue:this.speed,this.renderer.setProperty(this.speedtext.nativeElement,"innerHTML",`${typeof this.speed=="number"?this.speed.toFixed(1):"-"}`),this.renderer.setProperty(this.speedunitstext.nativeElement,"innerHTML",this.speedunits),this.pointers.value)if(t.heading=parseFloat(t.heading),isNaN(t.heading)&&(t.heading=null),this.ptrOffset=t.heading!==null?t.heading:0,t.heading!==null){t.heading=t.heading>360?t.heading-360:t.heading,this.valueStr=t.heading.toFixed(0)+"\xBA";let i=0-this.getAngle(t.heading);this.renderer.setAttribute(this.dial.nativeElement,"transform","rotate("+i+" 100 100)"),this.renderer.setProperty(this.headingtext.nativeElement,"innerHTML",this.valueStr)}else this.renderer.setAttribute(this.dial.nativeElement,"transform","rotate("+(0-this.getAngle(0))+" 100 100)"),this.renderer.setProperty(this.headingtext.nativeElement,"innerHTML","--");if(this.pointers.value2&&(t.needle=parseFloat(t.needle),isNaN(t.needle)&&(t.needle=null),t.needle!==null)){let i=this.getAngle(t.needle)-this.ptrOffset;this.renderer.setAttribute(this.pointer.nativeElement,"transform","rotate("+i+" 100 100)")}if(this.pointers.hi&&(t.windtrue=parseFloat(t.windtrue),isNaN(t.windtrue)&&(t.windtrue=null),t.windtrue!==null)){let i=t.windtrue<0?t.windtrue:this.getAngle(t.windtrue)-this.ptrOffset;this.renderer.setAttribute(this.needlehi.nativeElement,"transform","rotate("+i+" 100 100)")}if(this.pointers.lo&&(t.windapparent=parseFloat(t.windapparent),isNaN(t.windapparent)&&(t.windapparent=null),t.windapparent!==null)){let i=t.windapparent;this.renderer.setAttribute(this.needlelo.nativeElement,"transform","rotate("+i+" 100 100)")}}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["ap-compass"]],viewQuery:function(t,i){if(t&1&&Ot(pj,7)(Q_e,7)(J_e,7)(hj,7)(mj,7)(fj,7)(gj,7),t&2){let r;Ee(r=Ie())&&(i.speedtext=r.first),Ee(r=Ie())&&(i.speedunitstext=r.first),Ee(r=Ie())&&(i.dial=r.first),Ee(r=Ie())&&(i.headingtext=r.first),Ee(r=Ie())&&(i.pointer=r.first),Ee(r=Ie())&&(i.needlehi=r.first),Ee(r=Ie())&&(i.needlelo=r.first)}},inputs:{speed:"speed",speedunits:"speedunits",heading:"heading",needle:"needle",windtrue:"windtrue",windapparent:"windapparent"},features:[it,Se],decls:428,vars:9,consts:[["dial",""],["headingtext",""],["speedtext",""],["speedunitstext",""],["needlelo",""],["needlehi",""],["pointer",""],[0,"xmlns","svg","http://www.w3.org/2000/svg","xmlns","http://www.w3.org/2000/svg",0,"xmlns","xlink","http://www.w3.org/1999/xlink",0,"xmlns","rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#",0,"xmlns","dc","http://purl.org/dc/elements/1.1/","version","1.1","encoding","UTF-8","viewBox","0 0 200 200"],["x","-0.5","y","-0.5","width","2","height","2","color-interpolation-filters","sRGB","id","shadow"],["stdDeviation","5"],["x","-0.5","y","-0.5","width","3","height","3","color-interpolation-filters","sRGB","id","shadow2"],["stdDeviation","1"],["type","text/css"],["x","0","width","200","y","0","height","200",1,"compass","bgRect"],[1,"compass"],["cx","100","cy","100","r","90",1,"bgDial"],["d","M 100 185 A 85 85 0 0 0 100 15",1,"starboard"],["d","M 99.99999999999999 15 A 85 85 0 0 0 100 185",1,"port"],["id","dial",1,"compass"],["d","M 100,45 L 100,65",1,"longDiv"],["d","M 100,155 L 100,135",1,"longDiv"],["d","M 45,100 L 65,100",1,"shortDiv"],["d","M 155,100 L 135,100",1,"shortDiv"],["d","M 100,30 L 100,19",1,"longDiv"],["d","M 101.30893048279626,25.011422863270653 L 101.41364492141996,19.012336692332312",1,"shortDiv"],["d","M 102.61746225268757,25.045687973567823 L 102.82685923290258,19.049343011453246",1,"shortDiv"],["d","M 103.92519671822079,25.102784893406962 L 104.23921245567846,19.111007684879525",1,"shortDiv"],["d","M 105.2317355308094,25.182696230513187 L 105.65027437327414,19.197311928954235",1,"shortDiv"],["d","M 106.53668070607436,25.285397643119083 L 107.0596151625603,19.308229454568604",1,"shortDiv"],["d","M 107.83963474507401,25.410857847379503 L 108.46680552467993,19.443726475169868",1,"shortDiv"],["d","M 109.14020075538606,25.559038626900858 L 109.87141681581694,19.60376171705292",1,"shortDiv"],["d","M 110.43798257200491,25.72989484438223 L 111.2730211777653,19.788286431932804",1,"shortDiv"],["d","M 111.73258487801732,25.923374455364666 L 112.6711916682587,19.997244411793844",1,"shortDiv"],["d","M 113.02361332501978,26.139418524084405 L 114.06550239102135,20.230572006011144",1,"shortDiv"],["d","M 114.31067465324087,26.377961241425197 L 115.45552862550014,20.488198140739215",1,"shortDiv"],["d","M 115.59337681133195,26.638929944964573 L 116.84084695623851,20.77004434056174",1,"shortDiv"],["d","M 116.87132907578987,26.922245141107354 L 118.22103540185307,21.076024752395952",1,"shortDiv"],["d","M 118.14414216997508,27.22782052930026 L 119.59567354357308,21.40604617164429",1,"shortDiv"],["d","M 119.41142838268905,27.55556302831988 L 120.96434265330419,21.76000807058547",1,"shortDiv"],["d","M 120.67280168627494,27.905372804626083 L 122.32662582117693,22.13780262899617",1,"shortDiv"],["d","M 121.92787785420526,28.277143302772345 L 123.68210808254167,22.539314766994124",1,"shortDiv"],["d","M 123.17627457812105,28.67076127786349 L 125.03037654437074,22.96442218009257",1,"shortDiv"],["d","M 124.41761158428675,29.086106830051236 L 126.37102051102968,23.412995376455342",1,"shortDiv"],["d","M 125.65151074942516,29.523053441056874 L 127.70363160937916,23.884897716341413",1,"shortDiv"],["d","M 126.87759621589751,29.98146801270987 L 129.02780391316932,24.37998545372666",1,"shortDiv"],["d","M 128.0954945061934,30.461210907490937 L 130.34313406668886,24.898107780090214",1,"shortDiv"],["d","M 129.30483463669552,30.962135991066972 L 131.64922140763116,25.439106870352333",1,"shortDiv"],["d","M 130.50524823068503,31.48409067680494 L 132.94566808913982,26.002817930949334",1,"shortDiv"],["d","M 131.69636963055245,32.02691597225126 L 134.23207920099665,26.589069250031358",1,"shortDiv"],["d","M 132.8778360091808,32.59044652756248 L 135.50806288991527,27.197682249767468",1,"shortDiv"],["d","M 134.049287480466,33.174510685872406 L 136.7732304789033,27.8284715407422",1,"shortDiv"],["d","M 135.21036720894182,33.77893053558047 L 138.02719658565715,28.481244978426915",1,"shortDiv"],["d","M 136.3607215184753,34.40352196454532 L 139.26957923995332,29.15580372170895",1,"shortDiv"],["d","M 137.5,35.0480947161671 L 140.5,29.851942293460468",1,"shortDiv"],["d","M 138.62785561825405,35.712452447341576 L 141.7180840677144,30.569448643128908",1,"shortDiv"],["d","M 139.74394481749036,36.39639278826805 L 142.9234604028896,31.308104211329493",1,"shortDiv"],["d","M 140.84792762612705,37.099707404093195 L 144.1157618362172,32.067683996420655",1,"shortDiv"],["d","M 141.939467760306,37.82218205837188 L 145.2946251811305,32.847956623041625",1,"shortDiv"],["d","M 143.01823272632845,38.56359667832562 L 146.45969134443473,33.64868441259166",1,"shortDiv"],["d","M 144.0838939219355,39.32372542187894 L 147.61060543569033,34.46962345562926",1,"shortDiv"],["d","M 145.1361267364036,40.10233674645304 L 148.74701687531592,35.310523686169276",1,"shortDiv"],["d","M 146.17461064942438,40.89919347949585 L 149.86857950137832,36.171128957855515",1,"shortDiv"],["d","M 147.1990293287378,41.71405289072718 L 150.97495167503683,37.051177121985354",1,"shortDiv"],["d","M 148.20907072649044,42.54666676607665 L 152.06579638460968,37.95040010736278",1,"shortDiv"],["d","M 149.20442717428804,43.3967814832921 L 153.1407813482311,38.868524001955464",1,"shortDiv"],["d","M 150.18479547691436,44.264138089195434 L 154.1995791150675,39.80526913633106",1,"shortDiv"],["d","M 151.14987700468737,45.148472378562204 L 155.2418671650624,40.76035016884718",1,"shortDiv"],["d","M 152.0993777844248,46.04951497460116 L 156.26732800717878,41.733476172569254",1,"shortDiv"],["d","M 127.55320713028647,33.48067365918736 L 130.99735802157227,25.16575786658578",1,"shortDiv"],["d","M 149.49747468305833,50.50252531694167 L 157.27564927611036,42.72435072388965",1,"longDiv"],["d","M 153.95048502539885,47.900622215575204 L 158.26652382743075,43.732671992821224",1,"shortDiv"],["d","M 154.85152762143778,48.85012299531262 L 159.2396498311528,44.758132834937626",1,"shortDiv"],["d","M 155.73586191080457,49.81520452308563 L 160.19473086366895,45.800420884932485",1,"shortDiv"],["d","M 156.6032185167079,50.79557282571196 L 161.13147599804455,46.85921865176891",1,"shortDiv"],["d","M 157.45333323392336,51.79092927350955 L 162.04959989263722,47.93420361539031",1,"shortDiv"],["d","M 158.28594710927283,52.800970671262185 L 162.94882287801465,49.025048324963166",1,"shortDiv"],["d","M 159.10080652050414,53.82538935057563 L 163.82887104214447,50.13142049862168",1,"shortDiv"],["d","M 159.89766325354697,54.86387326359638 L 164.6894763138307,51.25298312468409",1,"shortDiv"],["d","M 160.67627457812105,55.916106078064516 L 165.53037654437074,52.389394564309676",1,"shortDiv"],["d","M 161.4364033216744,56.981767273671544 L 166.35131558740835,53.54030865556527",1,"shortDiv"],["d","M 162.17781794162812,58.06053223969399 L 167.15204337695837,54.70537481886951",1,"shortDiv"],["d","M 162.90029259590682,59.15207237387296 L 167.93231600357933,55.8842381637828",1,"shortDiv"],["d","M 163.60360721173197,60.256055182509634 L 168.6918957886705,57.076539597110404",1,"shortDiv"],["d","M 164.2875475526584,61.37214438174592 L 169.4305513568711,58.28191593228559",1,"shortDiv"],["d","M 164.9519052838329,62.49999999999999 L 170.14805770653953,59.49999999999999",1,"shortDiv"],["d","M 165.59647803545468,63.63927848152472 L 170.84419627829107,60.73042076004669",1,"shortDiv"],["d","M 166.22106946441951,64.78963279105818 L 171.51875502157307,61.97280341434284",1,"shortDiv"],["d","M 166.8254893141276,65.950712519534 L 172.1715284592578,63.226769521096706",1,"shortDiv"],["d","M 167.40955347243752,67.12216399081919 L 172.80231775023253,64.49193711008473",1,"shortDiv"],["d","M 167.97308402774874,68.30363036944755 L 173.41093074996866,65.76792079900335",1,"shortDiv"],["d","M 168.51590932319505,69.49475176931499 L 173.99718206905067,67.05433191086018",1,"shortDiv"],["d","M 169.037864008933,70.69516536330447 L 174.56089312964767,68.35077859236883",1,"shortDiv"],["d","M 169.53878909250906,71.90450549380658 L 175.1018922199098,69.65686593331111",1,"shortDiv"],["d","M 170.01853198729015,73.12240378410247 L 175.62001454627335,70.97219608683068",1,"shortDiv"],["d","M 170.47694655894313,74.34848925057484 L 176.1151022836586,72.29636839062083",1,"shortDiv"],["d","M 170.91389316994875,75.58238841571324 L 176.58700462354466,73.6289794889703",1,"shortDiv"],["d","M 171.3292387221365,76.82372542187895 L 177.03557781990742,74.96962345562926",1,"shortDiv"],["d","M 171.72285669722766,78.07212214579474 L 177.46068523300588,76.31789191745833",1,"shortDiv"],["d","M 172.0946271953739,79.32719831372506 L 177.86219737100384,77.67337417882307",1,"shortDiv"],["d","M 172.44443697168012,80.58857161731093 L 178.23999192941454,79.0356573466958",1,"shortDiv"],["d","M 172.77217947069974,81.85585783002492 L 178.59395382835572,80.40432645642692",1,"shortDiv"],["d","M 173.07775485889266,83.12867092421011 L 178.92397524760406,81.77896459814693",1,"shortDiv"],["d","M 173.36107005503544,84.40662318866805 L 179.22995565943825,83.1591530437615",1,"shortDiv"],["d","M 173.6220387585748,85.68932534675913 L 179.5118018592608,84.54447137449986",1,"shortDiv"],["d","M 173.86058147591558,86.97638667498022 L 179.76942799398887,85.93449760897863",1,"shortDiv"],["d","M 174.07662554463533,88.26741512198268 L 180.00275558820616,87.3288083317413",1,"shortDiv"],["d","M 174.27010515561778,89.56201742799509 L 180.21171356806718,88.7269788222347",1,"shortDiv"],["d","M 174.44096137309913,90.85979924461394 L 180.39623828294708,90.12858318418306",1,"shortDiv"],["d","M 174.5891421526205,92.16036525492598 L 180.55627352483015,91.53319447532004",1,"shortDiv"],["d","M 174.7146023568809,93.46331929392564 L 180.69177054543138,92.9403848374397",1,"shortDiv"],["d","M 174.8173037694868,94.7682644691906 L 180.80268807104576,94.34972562672584",1,"shortDiv"],["d","M 174.89721510659302,96.07480328177923 L 180.88899231512048,95.76078754432156",1,"shortDiv"],["d","M 174.95431202643218,97.38253774731243 L 180.95065698854677,97.17314076709741",1,"shortDiv"],["d","M 174.98857713672936,98.69106951720373 L 180.98766330766767,98.58635507858003",1,"shortDiv"],["d","M 166.51932634081265,72.44679286971353 L 174.83424213341422,69.00264197842772",1,"shortDiv"],["d","M 170,100 L 181,100",1,"longDiv"],["d","M 174.98857713672936,101.30893048279626 L 180.98766330766767,101.41364492141996",1,"shortDiv"],["d","M 174.95431202643218,102.61746225268757 L 180.95065698854677,102.82685923290258",1,"shortDiv"],["d","M 174.89721510659302,103.92519671822079 L 180.88899231512048,104.23921245567846",1,"shortDiv"],["d","M 174.8173037694868,105.2317355308094 L 180.80268807104576,105.65027437327416",1,"shortDiv"],["d","M 174.7146023568809,106.53668070607435 L 180.69177054543138,107.0596151625603",1,"shortDiv"],["d","M 174.58914215262052,107.839634745074 L 180.55627352483015,108.46680552467993",1,"shortDiv"],["d","M 174.44096137309916,109.14020075538605 L 180.39623828294708,109.87141681581693",1,"shortDiv"],["d","M 174.27010515561778,110.4379825720049 L 180.21171356806718,111.27302117776529",1,"shortDiv"],["d","M 174.07662554463533,111.7325848780173 L 180.00275558820616,112.6711916682587",1,"shortDiv"],["d","M 173.86058147591558,113.02361332501977 L 179.76942799398887,114.06550239102135",1,"shortDiv"],["d","M 173.6220387585748,114.31067465324087 L 179.5118018592608,115.45552862550014",1,"shortDiv"],["d","M 173.36107005503544,115.59337681133195 L 179.22995565943825,116.84084695623851",1,"shortDiv"],["d","M 173.07775485889266,116.87132907578987 L 178.92397524760406,118.22103540185307",1,"shortDiv"],["d","M 172.77217947069974,118.14414216997507 L 178.59395382835572,119.59567354357307",1,"shortDiv"],["d","M 172.44443697168012,119.41142838268905 L 178.23999192941454,120.96434265330417",1,"shortDiv"],["d","M 172.0946271953739,120.67280168627494 L 177.86219737100384,122.32662582117692",1,"shortDiv"],["d","M 171.72285669722766,121.92787785420525 L 177.46068523300588,123.68210808254167",1,"shortDiv"],["d","M 171.32923872213652,123.17627457812105 L 177.03557781990745,125.03037654437074",1,"shortDiv"],["d","M 170.91389316994878,124.41761158428675 L 176.58700462354466,126.37102051102968",1,"shortDiv"],["d","M 170.47694655894313,125.65151074942516 L 176.1151022836586,127.70363160937916",1,"shortDiv"],["d","M 170.01853198729015,126.87759621589751 L 175.62001454627335,129.02780391316932",1,"shortDiv"],["d","M 169.53878909250906,128.0954945061934 L 175.1018922199098,130.3431340666889",1,"shortDiv"],["d","M 169.037864008933,129.30483463669552 L 174.56089312964767,131.64922140763116",1,"shortDiv"],["d","M 168.51590932319507,130.505248230685 L 173.99718206905067,132.94566808913982",1,"shortDiv"],["d","M 167.97308402774877,131.69636963055245 L 173.41093074996866,134.23207920099665",1,"shortDiv"],["d","M 167.40955347243752,132.8778360091808 L 172.80231775023253,135.50806288991527",1,"shortDiv"],["d","M 166.8254893141276,134.049287480466 L 172.1715284592578,136.7732304789033",1,"shortDiv"],["d","M 166.22106946441954,135.2103672089418 L 171.5187550215731,138.02719658565712",1,"shortDiv"],["d","M 165.5964780354547,136.36072151847526 L 170.84419627829107,139.2695792399533",1,"shortDiv"],["d","M 164.9519052838329,137.5 L 170.14805770653953,140.49999999999997",1,"shortDiv"],["d","M 164.28754755265842,138.62785561825407 L 169.4305513568711,141.7180840677144",1,"shortDiv"],["d","M 163.60360721173197,139.74394481749036 L 168.6918957886705,142.9234604028896",1,"shortDiv"],["d","M 162.90029259590682,140.84792762612705 L 167.93231600357933,144.1157618362172",1,"shortDiv"],["d","M 162.17781794162812,141.939467760306 L 167.15204337695837,145.29462518113047",1,"shortDiv"],["d","M 161.4364033216744,143.01823272632845 L 166.35131558740832,146.45969134443473",1,"shortDiv"],["d","M 160.67627457812105,144.08389392193547 L 165.53037654437074,147.61060543569033",1,"shortDiv"],["d","M 159.89766325354697,145.1361267364036 L 164.68947631383074,148.7470168753159",1,"shortDiv"],["d","M 159.10080652050414,146.17461064942438 L 163.8288710421445,149.86857950137832",1,"shortDiv"],["d","M 158.28594710927283,147.1990293287378 L 162.94882287801465,150.97495167503683",1,"shortDiv"],["d","M 157.45333323392336,148.20907072649044 L 162.04959989263722,152.06579638460968",1,"shortDiv"],["d","M 156.6032185167079,149.20442717428804 L 161.13147599804455,153.1407813482311",1,"shortDiv"],["d","M 155.73586191080457,150.18479547691436 L 160.19473086366895,154.1995791150675",1,"shortDiv"],["d","M 154.8515276214378,151.14987700468737 L 159.2396498311528,155.24186716506236",1,"shortDiv"],["d","M 153.95048502539885,152.0993777844248 L 158.26652382743075,156.26732800717878",1,"shortDiv"],["d","M 166.51932634081265,127.55320713028647 L 174.83424213341422,130.99735802157227",1,"shortDiv"],["d","M 149.49747468305833,149.49747468305833 L 157.27564927611036,157.27564927611036",1,"longDiv"],["d","M 152.0993777844248,153.95048502539882 L 156.2673280071788,158.26652382743072",1,"shortDiv"],["d","M 151.1498770046874,154.85152762143778 L 155.2418671650624,159.2396498311528",1,"shortDiv"],["d","M 150.18479547691436,155.73586191080454 L 154.19957911506754,160.19473086366892",1,"shortDiv"],["d","M 149.20442717428804,156.6032185167079 L 153.1407813482311,161.13147599804455",1,"shortDiv"],["d","M 148.20907072649047,157.45333323392333 L 152.0657963846097,162.04959989263722",1,"shortDiv"],["d","M 147.1990293287378,158.28594710927283 L 150.97495167503683,162.94882287801465",1,"shortDiv"],["d","M 146.17461064942438,159.10080652050414 L 149.86857950137832,163.82887104214447",1,"shortDiv"],["d","M 145.1361267364036,159.89766325354697 L 148.7470168753159,164.6894763138307",1,"shortDiv"],["d","M 144.0838939219355,160.67627457812105 L 147.61060543569033,165.53037654437074",1,"shortDiv"],["d","M 143.01823272632848,161.4364033216744 L 146.45969134443476,166.35131558740832",1,"shortDiv"],["d","M 141.939467760306,162.17781794162812 L 145.2946251811305,167.15204337695837",1,"shortDiv"],["d","M 140.84792762612705,162.9002925959068 L 144.11576183621722,167.93231600357933",1,"shortDiv"],["d","M 139.74394481749036,163.60360721173197 L 142.9234604028896,168.6918957886705",1,"shortDiv"],["d","M 138.62785561825407,164.2875475526584 L 141.71808406771441,169.4305513568711",1,"shortDiv"],["d","M 137.5,164.9519052838329 L 140.5,170.14805770653953",1,"shortDiv"],["d","M 136.3607215184753,165.59647803545468 L 139.26957923995332,170.84419627829107",1,"shortDiv"],["d","M 135.21036720894182,166.22106946441954 L 138.02719658565715,171.5187550215731",1,"shortDiv"],["d","M 134.049287480466,166.8254893141276 L 136.7732304789033,172.1715284592578",1,"shortDiv"],["d","M 132.87783600918084,167.4095534724375 L 135.5080628899153,172.80231775023253",1,"shortDiv"],["d","M 131.69636963055245,167.97308402774874 L 134.23207920099665,173.41093074996866",1,"shortDiv"],["d","M 130.50524823068503,168.51590932319505 L 132.94566808913984,173.99718206905067",1,"shortDiv"],["d","M 129.30483463669555,169.037864008933 L 131.64922140763116,174.56089312964767",1,"shortDiv"],["d","M 128.0954945061934,169.53878909250903 L 130.3431340666889,175.10189221990976",1,"shortDiv"],["d","M 126.87759621589751,170.01853198729015 L 129.02780391316932,175.62001454627335",1,"shortDiv"],["d","M 125.65151074942517,170.47694655894313 L 127.70363160937919,176.1151022836586",1,"shortDiv"],["d","M 124.41761158428675,170.91389316994878 L 126.37102051102968,176.58700462354466",1,"shortDiv"],["d","M 123.17627457812107,171.3292387221365 L 125.03037654437075,177.03557781990742",1,"shortDiv"],["d","M 121.92787785420528,171.72285669722766 L 123.6821080825417,177.46068523300588",1,"shortDiv"],["d","M 120.67280168627494,172.0946271953739 L 122.32662582117693,177.86219737100384",1,"shortDiv"],["d","M 119.41142838268908,172.44443697168012 L 120.9643426533042,178.23999192941454",1,"shortDiv"],["d","M 118.14414216997508,172.77217947069974 L 119.59567354357308,178.59395382835572",1,"shortDiv"],["d","M 116.87132907578989,173.07775485889263 L 118.22103540185307,178.92397524760406",1,"shortDiv"],["d","M 115.59337681133195,173.36107005503544 L 116.84084695623851,179.22995565943825",1,"shortDiv"],["d","M 114.31067465324088,173.6220387585748 L 115.45552862550014,179.5118018592608",1,"shortDiv"],["d","M 113.02361332501977,173.86058147591558 L 114.06550239102135,179.76942799398887",1,"shortDiv"],["d","M 111.73258487801732,174.0766255446353 L 112.67119166825871,180.00275558820616",1,"shortDiv"],["d","M 110.43798257200493,174.27010515561778 L 111.27302117776533,180.21171356806718",1,"shortDiv"],["d","M 109.14020075538606,174.44096137309913 L 109.87141681581696,180.39623828294708",1,"shortDiv"],["d","M 107.83963474507404,174.5891421526205 L 108.46680552467996,180.55627352483015",1,"shortDiv"],["d","M 106.53668070607436,174.7146023568809 L 107.05961516256032,180.69177054543138",1,"shortDiv"],["d","M 105.23173553080942,174.8173037694868 L 105.65027437327417,180.80268807104576",1,"shortDiv"],["d","M 103.92519671822079,174.89721510659302 L 104.23921245567846,180.88899231512048",1,"shortDiv"],["d","M 102.61746225268759,174.95431202643218 L 102.82685923290259,180.95065698854677",1,"shortDiv"],["d","M 101.30893048279626,174.98857713672936 L 101.41364492141996,180.98766330766767",1,"shortDiv"],["d","M 127.55320713028647,166.51932634081265 L 130.99735802157227,174.83424213341422",1,"shortDiv"],["d","M 100.00000000000001,170 L 100.00000000000001,181",1,"longDiv"],["d","M 98.69106951720376,174.98857713672936 L 98.58635507858006,180.98766330766767",1,"shortDiv"],["d","M 97.38253774731243,174.95431202643218 L 97.17314076709742,180.95065698854677",1,"shortDiv"],["d","M 96.07480328177924,174.89721510659302 L 95.76078754432157,180.88899231512048",1,"shortDiv"],["d","M 94.7682644691906,174.8173037694868 L 94.34972562672586,180.80268807104576",1,"shortDiv"],["d","M 93.46331929392565,174.7146023568809 L 92.94038483743971,180.69177054543138",1,"shortDiv"],["d","M 92.16036525492599,174.5891421526205 L 91.53319447532007,180.55627352483015",1,"shortDiv"],["d","M 90.85979924461395,174.44096137309916 L 90.12858318418307,180.39623828294708",1,"shortDiv"],["d","M 89.56201742799509,174.27010515561778 L 88.7269788222347,180.21171356806718",1,"shortDiv"],["d","M 88.2674151219827,174.07662554463533 L 87.32880833174131,180.00275558820616",1,"shortDiv"],["d","M 86.97638667498025,173.8605814759156 L 85.93449760897867,179.76942799398887",1,"shortDiv"],["d","M 85.68932534675915,173.6220387585748 L 84.54447137449988,179.5118018592608",1,"shortDiv"],["d","M 84.40662318866806,173.36107005503544 L 83.15915304376152,179.22995565943825",1,"shortDiv"],["d","M 83.12867092421013,173.07775485889266 L 81.77896459814694,178.92397524760406",1,"shortDiv"],["d","M 81.85585783002495,172.77217947069974 L 80.40432645642693,178.59395382835572",1,"shortDiv"],["d","M 80.58857161731095,172.44443697168012 L 79.03565734669581,178.23999192941454",1,"shortDiv"],["d","M 79.32719831372508,172.0946271953739 L 77.67337417882308,177.86219737100384",1,"shortDiv"],["d","M 78.07212214579474,171.72285669722766 L 76.31789191745833,177.46068523300588",1,"shortDiv"],["d","M 76.82372542187895,171.32923872213652 L 74.96962345562928,177.03557781990745",1,"shortDiv"],["d","M 75.58238841571327,170.91389316994878 L 73.62897948897033,176.58700462354466",1,"shortDiv"],["d","M 74.34848925057486,170.47694655894313 L 72.29636839062084,176.1151022836586",1,"shortDiv"],["d","M 73.1224037841025,170.01853198729015 L 70.9721960868307,175.62001454627335",1,"shortDiv"],["d","M 71.9045054938066,169.53878909250906 L 69.65686593331112,175.1018922199098",1,"shortDiv"],["d","M 70.69516536330448,169.037864008933 L 68.35077859236884,174.56089312964767",1,"shortDiv"],["d","M 69.49475176931499,168.51590932319505 L 67.05433191086018,173.99718206905067",1,"shortDiv"],["d","M 68.30363036944755,167.97308402774877 L 65.76792079900335,173.41093074996866",1,"shortDiv"],["d","M 67.12216399081919,167.40955347243752 L 64.49193711008473,172.80231775023253",1,"shortDiv"],["d","M 65.950712519534,166.8254893141276 L 63.22676952109672,172.1715284592578",1,"shortDiv"],["d","M 64.78963279105821,166.22106946441954 L 61.97280341434287,171.5187550215731",1,"shortDiv"],["d","M 63.63927848152473,165.5964780354547 L 60.730420760046705,170.84419627829107",1,"shortDiv"],["d","M 62.50000000000002,164.9519052838329 L 59.50000000000002,170.14805770653953",1,"shortDiv"],["d","M 61.37214438174594,164.28754755265842 L 58.281915932285614,169.4305513568711",1,"shortDiv"],["d","M 60.25605518250964,163.60360721173197 L 57.07653959711041,168.6918957886705",1,"shortDiv"],["d","M 59.15207237387297,162.90029259590682 L 55.884238163782804,167.93231600357933",1,"shortDiv"],["d","M 58.060532239694,162.17781794162815 L 54.705374818869515,167.15204337695837",1,"shortDiv"],["d","M 56.98176727367154,161.4364033216744 L 53.54030865556526,166.35131558740835",1,"shortDiv"],["d","M 55.91610607806452,160.67627457812105 L 52.38939456430968,165.53037654437074",1,"shortDiv"],["d","M 54.863873263596396,159.89766325354697 L 51.25298312468411,164.68947631383074",1,"shortDiv"],["d","M 53.825389350575634,159.10080652050414 L 50.13142049862169,163.8288710421445",1,"shortDiv"],["d","M 52.800970671262206,158.28594710927283 L 49.02504832496318,162.94882287801465",1,"shortDiv"],["d","M 51.790929273509555,157.45333323392336 L 47.934203615390324,162.04959989263722",1,"shortDiv"],["d","M 50.79557282571197,156.6032185167079 L 46.85921865176893,161.13147599804455",1,"shortDiv"],["d","M 49.81520452308563,155.73586191080457 L 45.800420884932485,160.19473086366895",1,"shortDiv"],["d","M 48.850122995312624,154.8515276214378 L 44.75813283493763,159.2396498311528",1,"shortDiv"],["d","M 47.9006222155752,153.95048502539885 L 43.73267199282121,158.26652382743075",1,"shortDiv"],["d","M 72.44679286971355,166.51932634081265 L 69.00264197842773,174.83424213341425",1,"shortDiv"],["d","M 50.50252531694168,149.49747468305833 L 42.72435072388966,157.27564927611036",1,"longDiv"],["d","M 46.04951497460119,152.0993777844248 L 41.73347617256928,156.2673280071788",1,"shortDiv"],["d","M 45.14847237856222,151.1498770046874 L 40.76035016884719,155.2418671650624",1,"shortDiv"],["d","M 44.26413808919545,150.1847954769144 L 39.805269136331084,154.19957911506754",1,"shortDiv"],["d","M 43.39678148329211,149.20442717428804 L 38.86852400195548,153.1407813482311",1,"shortDiv"],["d","M 42.546666766076655,148.20907072649047 L 37.95040010736279,152.0657963846097",1,"shortDiv"],["d","M 41.71405289072721,147.19902932873782 L 37.05117712198538,150.97495167503686",1,"shortDiv"],["d","M 40.89919347949584,146.17461064942435 L 36.17112895785551,149.8685795013783",1,"shortDiv"],["d","M 40.10233674645304,145.1361267364036 L 35.310523686169276,148.74701687531592",1,"shortDiv"],["d","M 39.32372542187895,144.0838939219355 L 34.46962345562926,147.61060543569033",1,"shortDiv"],["d","M 38.56359667832563,143.01823272632848 L 33.64868441259168,146.45969134443476",1,"shortDiv"],["d","M 37.822182058371894,141.93946776030606 L 32.84795662304164,145.29462518113053",1,"shortDiv"],["d","M 37.099707404093195,140.84792762612702 L 32.067683996420655,144.1157618362172",1,"shortDiv"],["d","M 36.39639278826806,139.7439448174904 L 31.308104211329507,142.9234604028896",1,"shortDiv"],["d","M 35.71245244734159,138.6278556182541 L 30.569448643128922,141.71808406771441",1,"shortDiv"],["d","M 35.04809471616713,137.50000000000003 L 29.851942293460496,140.50000000000003",1,"shortDiv"],["d","M 34.403521964545305,136.36072151847526 L 29.155803721708935,139.2695792399533",1,"shortDiv"],["d","M 33.77893053558047,135.21036720894182 L 28.481244978426915,138.02719658565715",1,"shortDiv"],["d","M 33.17451068587242,134.04928748046603 L 27.828471540742214,136.77323047890332",1,"shortDiv"],["d","M 32.59044652756249,132.87783600918084 L 27.19768224976748,135.5080628899153",1,"shortDiv"],["d","M 32.026915972251274,131.6963696305525 L 26.589069250031372,134.23207920099668",1,"shortDiv"],["d","M 31.484090676804925,130.505248230685 L 26.00281793094932,132.94566808913982",1,"shortDiv"],["d","M 30.962135991066987,129.30483463669555 L 25.439106870352333,131.6492214076312",1,"shortDiv"],["d","M 30.46121090749095,128.09549450619343 L 24.89810778009023,130.3431340666889",1,"shortDiv"],["d","M 29.981468012709882,126.87759621589755 L 24.37998545372666,129.02780391316935",1,"shortDiv"],["d","M 29.523053441056874,125.65151074942514 L 23.884897716341413,127.70363160937916",1,"shortDiv"],["d","M 29.086106830051236,124.41761158428675 L 23.412995376455342,126.37102051102968",1,"shortDiv"],["d","M 28.67076127786349,123.17627457812107 L 22.96442218009257,125.03037654437075",1,"shortDiv"],["d","M 28.277143302772345,121.92787785420528 L 22.53931476699414,123.6821080825417",1,"shortDiv"],["d","M 27.905372804626097,120.67280168627498 L 22.137802628996184,122.32662582117698",1,"shortDiv"],["d","M 27.55556302831988,119.41142838268905 L 21.76000807058547,120.96434265330417",1,"shortDiv"],["d","M 27.22782052930026,118.14414216997508 L 21.40604617164429,119.5956735435731",1,"shortDiv"],["d","M 26.922245141107368,116.8713290757899 L 21.076024752395952,118.22103540185309",1,"shortDiv"],["d","M 26.638929944964588,115.59337681133198 L 20.770044340561753,116.84084695623855",1,"shortDiv"],["d","M 26.377961241425197,114.31067465324085 L 20.488198140739215,115.45552862550011",1,"shortDiv"],["d","M 26.139418524084405,113.02361332501978 L 20.230572006011144,114.06550239102135",1,"shortDiv"],["d","M 25.92337445536468,111.73258487801732 L 19.997244411793844,112.67119166825871",1,"shortDiv"],["d","M 25.72989484438223,110.43798257200494 L 19.788286431932804,111.27302117776533",1,"shortDiv"],["d","M 25.559038626900858,109.1402007553861 L 19.60376171705292,109.87141681581699",1,"shortDiv"],["d","M 25.41085784737949,107.83963474507401 L 19.443726475169854,108.46680552467993",1,"shortDiv"],["d","M 25.285397643119083,106.53668070607436 L 19.308229454568604,107.05961516256032",1,"shortDiv"],["d","M 25.182696230513187,105.23173553080942 L 19.197311928954235,105.65027437327417",1,"shortDiv"],["d","M 25.102784893406962,103.92519671822082 L 19.111007684879525,104.23921245567848",1,"shortDiv"],["d","M 25.045687973567823,102.61746225268756 L 19.049343011453246,102.82685923290256",1,"shortDiv"],["d","M 25.011422863270653,101.30893048279626 L 19.012336692332312,101.41364492141996",1,"shortDiv"],["d","M 33.480673659187374,127.55320713028651 L 25.165757866585793,130.99735802157232",1,"shortDiv"],["d","M 30,100.00000000000001 L 19,100.00000000000001",1,"longDiv"],["d","M 25.011422863270653,98.69106951720377 L 19.012336692332312,98.58635507858007",1,"shortDiv"],["d","M 25.045687973567823,97.38253774731247 L 19.049343011453246,97.17314076709746",1,"shortDiv"],["d","M 25.102784893406962,96.07480328177921 L 19.111007684879525,95.76078754432154",1,"shortDiv"],["d","M 25.182696230513173,94.76826446919061 L 19.197311928954235,94.34972562672586",1,"shortDiv"],["d","M 25.285397643119083,93.46331929392566 L 19.308229454568604,92.94038483743971",1,"shortDiv"],["d","M 25.41085784737949,92.16036525492602 L 19.443726475169854,91.5331944753201",1,"shortDiv"],["d","M 25.559038626900858,90.85979924461392 L 19.60376171705292,90.12858318418304",1,"shortDiv"],["d","M 25.72989484438223,89.56201742799509 L 19.788286431932804,88.7269788222347",1,"shortDiv"],["d","M 25.923374455364666,88.2674151219827 L 19.997244411793844,87.32880833174131",1,"shortDiv"],["d","M 26.13941852408439,86.97638667498025 L 20.230572006011144,85.93449760897867",1,"shortDiv"],["d","M 26.377961241425197,85.68932534675918 L 20.488198140739215,84.54447137449992",1,"shortDiv"],["d","M 26.638929944964588,84.40662318866805 L 20.770044340561753,83.15915304376148",1,"shortDiv"],["d","M 26.922245141107354,83.12867092421013 L 21.076024752395952,81.77896459814694",1,"shortDiv"],["d","M 27.22782052930026,81.85585783002495 L 21.406046171644277,80.40432645642693",1,"shortDiv"],["d","M 27.555563028319867,80.58857161731098 L 21.760008070585457,79.03565734669586",1,"shortDiv"],["d","M 27.905372804626097,79.32719831372505 L 22.137802628996184,77.67337417882305",1,"shortDiv"],["d","M 28.277143302772345,78.07212214579475 L 22.539314766994124,76.31789191745833",1,"shortDiv"],["d","M 28.670761277863477,76.82372542187896 L 22.964422180092555,74.96962345562928",1,"shortDiv"],["d","M 29.08610683005122,75.58238841571327 L 23.412995376455328,73.62897948897034",1,"shortDiv"],["d","M 29.52305344105686,74.34848925057489 L 23.884897716341413,72.29636839062088",1,"shortDiv"],["d","M 29.98146801270987,73.12240378410247 L 24.37998545372666,70.97219608683068",1,"shortDiv"],["d","M 30.461210907490937,71.9045054938066 L 24.898107780090214,69.65686593331114",1,"shortDiv"],["d","M 30.96213599106696,70.69516536330448 L 25.43910687035232,68.35077859236884",1,"shortDiv"],["d","M 31.484090676804925,69.49475176931502 L 26.002817930949305,67.05433191086021",1,"shortDiv"],["d","M 32.02691597225126,68.30363036944753 L 26.589069250031358,65.76792079900333",1,"shortDiv"],["d","M 32.59044652756248,67.12216399081919 L 27.197682249767468,64.49193711008473",1,"shortDiv"],["d","M 33.174510685872406,65.950712519534 L 27.828471540742186,63.22676952109672",1,"shortDiv"],["d","M 33.77893053558047,64.78963279105821 L 28.4812449784269,61.97280341434288",1,"shortDiv"],["d","M 34.403521964545334,63.639278481524705 L 29.15580372170895,60.73042076004668",1,"shortDiv"],["d","M 35.0480947161671,62.49999999999999 L 29.851942293460468,59.49999999999999",1,"shortDiv"],["d","M 35.712452447341576,61.37214438174594 L 30.569448643128908,58.281915932285614",1,"shortDiv"],["d","M 36.396392788268045,60.25605518250965 L 31.308104211329493,57.07653959711042",1,"shortDiv"],["d","M 37.09970740409318,59.152072373873004 L 32.06768399642064,55.88423816378284",1,"shortDiv"],["d","M 37.82218205837188,58.06053223969398 L 32.847956623041625,54.705374818869494",1,"shortDiv"],["d","M 38.56359667832562,56.981767273671544 L 33.64868441259166,53.54030865556527",1,"shortDiv"],["d","M 39.32372542187893,55.91610607806453 L 34.46962345562925,52.3893945643097",1,"shortDiv"],["d","M 40.10233674645302,54.8638732635964 L 35.31052368616926,51.252983124684114",1,"shortDiv"],["d","M 40.89919347949582,53.82538935057566 L 36.17112895785549,50.131420498621715",1,"shortDiv"],["d","M 41.71405289072719,52.800970671262185 L 37.05117712198537,49.025048324963166",1,"shortDiv"],["d","M 42.54666676607664,51.790929273509555 L 37.950400107362775,47.934203615390324",1,"shortDiv"],["d","M 43.39678148329209,50.79557282571197 L 38.86852400195546,46.85921865176893",1,"shortDiv"],["d","M 44.264138089195406,49.81520452308567 L 39.80526913633104,45.80042088493252",1,"shortDiv"],["d","M 45.148472378562175,48.85012299531265 L 40.76035016884715,44.75813283493767",1,"shortDiv"],["d","M 46.049514974601166,47.900622215575204 L 41.73347617256926,43.732671992821224",1,"shortDiv"],["d","M 33.48067365918736,72.44679286971352 L 25.16575786658578,69.0026419784277",1,"shortDiv"],["d","M 50.502525316941664,50.502525316941686 L 42.724350723889636,42.724350723889664",1,"longDiv"],["d","M 47.90062221557518,46.04951497460119 L 43.732671992821196,41.73347617256928",1,"shortDiv"],["d","M 48.85012299531258,45.148472378562246 L 44.75813283493759,40.76035016884723",1,"shortDiv"],["d","M 49.81520452308564,44.264138089195434 L 45.80042088493249,39.80526913633106",1,"shortDiv"],["d","M 50.79557282571194,43.39678148329211 L 46.8592186517689,38.86852400195548",1,"shortDiv"],["d","M 51.79092927350953,42.546666766076655 L 47.934203615390295,37.95040010736279",1,"shortDiv"],["d","M 52.800970671262164,41.71405289072722 L 49.02504832496314,37.05117712198539",1,"shortDiv"],["d","M 53.825389350575634,40.89919347949585 L 50.13142049862169,36.171128957855515",1,"shortDiv"],["d","M 54.86387326359638,40.10233674645304 L 51.25298312468409,35.310523686169276",1,"shortDiv"],["d","M 55.9161060780645,39.323725421878954 L 52.389394564309654,34.469623455629275",1,"shortDiv"],["d","M 56.981767273671515,38.56359667832563 L 53.540308655565234,33.64868441259168",1,"shortDiv"],["d","M 58.06053223969395,37.822182058371894 L 54.705374818869466,32.84795662304164",1,"shortDiv"],["d","M 59.152072373872976,37.099707404093195 L 55.88423816378282,32.067683996420655",1,"shortDiv"],["d","M 60.25605518250963,36.39639278826806 L 57.0765395971104,31.308104211329507",1,"shortDiv"],["d","M 61.37214438174591,35.71245244734159 L 58.281915932285585,30.569448643128922",1,"shortDiv"],["d","M 62.499999999999964,35.04809471616713 L 59.499999999999964,29.851942293460496",1,"shortDiv"],["d","M 63.639278481524734,34.403521964545305 L 60.73042076004671,29.155803721708935",1,"shortDiv"],["d","M 64.78963279105818,33.77893053558047 L 61.97280341434284,28.481244978426915",1,"shortDiv"],["d","M 65.95071251953398,33.17451068587242 L 63.22676952109669,27.828471540742214",1,"shortDiv"],["d","M 67.12216399081916,32.59044652756249 L 64.4919371100847,27.19768224976748",1,"shortDiv"],["d","M 68.3036303694475,32.026915972251274 L 65.76792079900329,26.589069250031372",1,"shortDiv"],["d","M 69.49475176931499,31.484090676804925 L 67.05433191086018,26.00281793094932",1,"shortDiv"],["d","M 70.69516536330445,30.962135991066987 L 68.35077859236881,25.439106870352333",1,"shortDiv"],["d","M 71.90450549380657,30.46121090749095 L 69.6568659333111,24.89810778009023",1,"shortDiv"],["d","M 73.12240378410245,29.981468012709882 L 70.97219608683064,24.37998545372666",1,"shortDiv"],["d","M 74.34848925057486,29.523053441056874 L 72.29636839062084,23.884897716341413",1,"shortDiv"],["d","M 75.58238841571324,29.086106830051236 L 73.62897948897032,23.412995376455342",1,"shortDiv"],["d","M 76.82372542187893,28.67076127786349 L 74.96962345562925,22.96442218009257",1,"shortDiv"],["d","M 78.07212214579471,28.277143302772345 L 76.3178919174583,22.53931476699414",1,"shortDiv"],["d","M 79.32719831372502,27.905372804626097 L 77.67337417882302,22.137802628996184",1,"shortDiv"],["d","M 80.58857161731095,27.55556302831988 L 79.03565734669583,21.76000807058547",1,"shortDiv"],["d","M 81.85585783002492,27.22782052930026 L 80.4043264564269,21.40604617164429",1,"shortDiv"],["d","M 83.1286709242101,26.922245141107368 L 81.7789645981469,21.076024752395952",1,"shortDiv"],["d","M 84.40662318866801,26.638929944964588 L 83.15915304376145,20.770044340561753",1,"shortDiv"],["d","M 85.68932534675915,26.377961241425197 L 84.54447137449988,20.488198140739215",1,"shortDiv"],["d","M 86.97638667498022,26.139418524084405 L 85.93449760897863,20.230572006011144",1,"shortDiv"],["d","M 88.26741512198267,25.92337445536468 L 87.32880833174129,19.997244411793844",1,"shortDiv"],["d","M 89.56201742799506,25.72989484438223 L 88.72697882223466,19.788286431932804",1,"shortDiv"],["d","M 90.8597992446139,25.559038626900858 L 90.128583184183,19.60376171705292",1,"shortDiv"],["d","M 92.16036525492599,25.410857847379503 L 91.53319447532007,19.443726475169868",1,"shortDiv"],["d","M 93.46331929392562,25.285397643119083 L 92.94038483743968,19.308229454568604",1,"shortDiv"],["d","M 94.76826446919058,25.182696230513187 L 94.34972562672583,19.197311928954235",1,"shortDiv"],["d","M 96.07480328177917,25.102784893406962 L 95.7607875443215,19.111007684879525",1,"shortDiv"],["d","M 97.38253774731244,25.045687973567823 L 97.17314076709744,19.049343011453246",1,"shortDiv"],["d","M 98.69106951720373,25.011422863270653 L 98.58635507858003,19.012336692332312",1,"shortDiv"],["d","M 72.44679286971349,33.480673659187374 L 69.00264197842768,25.165757866585793",1,"shortDiv"],["d","M 99.99999999999999,30 L 99.99999999999999,19",1,"longDiv"],["x","100","y","40","id","pcN",1,"scale"],["x","100","y","40","id","pcE","transform","rotate(90,100,100)",1,"scale"],["x","100","y","40","id","pcS","transform","rotate(180,100,100)",1,"scale"],["x","100","y","40","id","pcW","transform","rotate(270,100,100)",1,"scale"],["x","100","y","40","id","pcNE","transform","rotate(45,100,100)",1,"scale"],["x","100","y","40","id","pcSE","transform","rotate(135,100,100)",1,"scale"],["x","100","y","40","id","pcSW","transform","rotate(225,100,100)",1,"scale"],["x","100","y","40","id","pcNW","transform","rotate(315,100,100)",1,"scale"],[1,"compass",2,"z-index","1000"],["x","100","y","95","id","headingtext",1,"value"],["x","100","y","115","id","speedtext",1,"value"],["x","100","y","130",1,"speedunits"],["id","gLoPointer",1,"compass",3,"ngClass"],["transform","rotate(0 100 100)","id","needlelo"],["d","M 100,79 l 6,-49 -6,-20 -6,20 6,49 z","id","loPointer"],["id","gHiPointer",1,"compass",3,"ngClass"],["transform","rotate(0 100 100)","id","needlehi"],["d","M 100,79 l 5,-49 -5,-10 -5,10 5,49 z","id","hiPointer"],["id","pointer",1,"compass",3,"ngClass"],["transform","rotate(0 100 100)","id","needle"],["d","M 95,70 l 5,-30 5,30 -10,0 z","id","pointerShaftInner"],["transform","rotate(0 100 100)"],["d","M 100,20 l 8,-10 -16,0 8,10 z","id","topMark"]],template:function(t,i){t&1&&(Eo(),u(0,"svg",7)(1,"defs")(2,"filter",8),z(3,"feGaussianBlur",9),h(),u(4,"filter",10),z(5,"feGaussianBlur",11),h()(),u(6,"style",12),_(7," .hide { display:none; } .compass text { font-style:normal; font-variant:normal; font-weight:normal; font-stretch:normal; font-family:Arial; text-align:center; text-anchor:middle; stroke:none; fill-opacity:1; } .compass text.label { /** label **/ font-size:10px; fill: #dcff85; } .compass text.value, .compass text.unit { /** units **/ font-size:12px; font-weight: bold; fill: black; fill-opacity:0.9; } .compass text.speedunits { font-size:10pt; fill: black; } .compass text.value { /** Heading Value **/ font-size:22px; } .compass text.cardinal_point { /** scale 12,3,6,9 oclock positions **/ font-size:20px; font-weight: bold; fill: black; } .compass text.intermediate_point { /** scale remainder **/ font-size:16px; fill: black; font-weight: bold; } .compass text.scale { font-size: 12px; font-weight: bold; fill: black; } .compass path.shortDiv { fill:none; fill-rule:evenodd; stroke: black; stroke-width:0.5; stroke-linecap:butt; stroke-linejoin:miter; stroke-miterlimit:4; stroke-dasharray:none; stroke-opacity:1; } .compass path.longDiv { fill:none; fill-rule:evenodd; /*stroke: #dcff85;*/ stroke: black; stroke-width:2; stroke-linecap:butt; stroke-linejoin:miter; stroke-miterlimit:4; stroke-dasharray:none; stroke-opacity:1; } rect.compass.bgRect { fill:transparent; stroke: none; } .compass .bgDial { fill: lightgray; stroke: gray; stroke-width: 2px; } .compass #pointerShaftInner { fill: orangered; stroke:orangered; stroke-width:0.3; stroke-opacity:1; display: block; } .compass #hiPointer { fill:olive; fill-opacity:0.8; display: block; } .compass #loPointer { fill: rgb(16, 75, 16); fill-opacity:0.8; display: block; } .compass #topMark { stroke: #3d3b3b; stroke-width: 1; fill: gray; fill-opacity:1; display: block; } .compass path.port { fill:none; stroke: red; stroke-width:6; stroke-linecap:butt; stroke-linejoin:miter; stroke-miterlimit:4; stroke-dasharray:none; stroke-opacity:1; } .compass path.starboard { fill:none; stroke: green; stroke-width:6; stroke-linecap:butt; stroke-linejoin:miter; stroke-miterlimit:4; stroke-dasharray:none; stroke-opacity:1; } .dark-theme { .compass text.speedunits, .compass text.label { /** label **/ fill: #dcff85; } .compass text.value, .compass text.unit { /** units **/ fill: #00ff00; } .compass text.scale { fill: #dcff85; } .compass .bgDial { fill: transparent; stroke: #deff8b; } .compass #topMark { fill: #dcff85; stroke: unset; } .compass text.cardinal_point { /** scale 12,3,6,9 oclock positions **/ fill: #dcff85; } .compass text.intermediate_point { /** scale remainder **/ fill: #dcff85; } .compass path.shortDiv { stroke: #dcff85; } .compass path.longDiv { stroke: #dcff85; } } "),h(),z(8,"rect",13),u(9,"g",14),z(10,"circle",15),h(),u(11,"g",14),z(12,"path",16)(13,"path",17),h(),u(14,"g",18,0),z(16,"path",19)(17,"path",20)(18,"path",21)(19,"path",22)(20,"path",23)(21,"path",24)(22,"path",25)(23,"path",26)(24,"path",27)(25,"path",28)(26,"path",29)(27,"path",30)(28,"path",31)(29,"path",32)(30,"path",33)(31,"path",34)(32,"path",35)(33,"path",36)(34,"path",37)(35,"path",38)(36,"path",39)(37,"path",40)(38,"path",41)(39,"path",42)(40,"path",43)(41,"path",44)(42,"path",45)(43,"path",46)(44,"path",47)(45,"path",48)(46,"path",49)(47,"path",50)(48,"path",51)(49,"path",52)(50,"path",53)(51,"path",54)(52,"path",55)(53,"path",56)(54,"path",57)(55,"path",58)(56,"path",59)(57,"path",60)(58,"path",61)(59,"path",62)(60,"path",63)(61,"path",64)(62,"path",65)(63,"path",66)(64,"path",67)(65,"path",68)(66,"path",69)(67,"path",70)(68,"path",71)(69,"path",72)(70,"path",73)(71,"path",74)(72,"path",75)(73,"path",76)(74,"path",77)(75,"path",78)(76,"path",79)(77,"path",80)(78,"path",81)(79,"path",82)(80,"path",83)(81,"path",84)(82,"path",85)(83,"path",86)(84,"path",87)(85,"path",88)(86,"path",89)(87,"path",90)(88,"path",91)(89,"path",92)(90,"path",93)(91,"path",94)(92,"path",95)(93,"path",96)(94,"path",97)(95,"path",98)(96,"path",99)(97,"path",100)(98,"path",101)(99,"path",102)(100,"path",103)(101,"path",104)(102,"path",105)(103,"path",106)(104,"path",107)(105,"path",108)(106,"path",109)(107,"path",110)(108,"path",111)(109,"path",112)(110,"path",113)(111,"path",114)(112,"path",115)(113,"path",116)(114,"path",117)(115,"path",118)(116,"path",119)(117,"path",120)(118,"path",121)(119,"path",122)(120,"path",123)(121,"path",124)(122,"path",125)(123,"path",126)(124,"path",127)(125,"path",128)(126,"path",129)(127,"path",130)(128,"path",131)(129,"path",132)(130,"path",133)(131,"path",134)(132,"path",135)(133,"path",136)(134,"path",137)(135,"path",138)(136,"path",139)(137,"path",140)(138,"path",141)(139,"path",142)(140,"path",143)(141,"path",144)(142,"path",145)(143,"path",146)(144,"path",147)(145,"path",148)(146,"path",149)(147,"path",150)(148,"path",151)(149,"path",152)(150,"path",153)(151,"path",154)(152,"path",155)(153,"path",156)(154,"path",157)(155,"path",158)(156,"path",159)(157,"path",160)(158,"path",161)(159,"path",162)(160,"path",163)(161,"path",164)(162,"path",165)(163,"path",166)(164,"path",167)(165,"path",168)(166,"path",169)(167,"path",170)(168,"path",171)(169,"path",172)(170,"path",173)(171,"path",174)(172,"path",175)(173,"path",176)(174,"path",177)(175,"path",178)(176,"path",179)(177,"path",180)(178,"path",181)(179,"path",182)(180,"path",183)(181,"path",184)(182,"path",185)(183,"path",186)(184,"path",187)(185,"path",188)(186,"path",189)(187,"path",190)(188,"path",191)(189,"path",192)(190,"path",193)(191,"path",194)(192,"path",195)(193,"path",196)(194,"path",197)(195,"path",198)(196,"path",199)(197,"path",200)(198,"path",201)(199,"path",202)(200,"path",203)(201,"path",204)(202,"path",205)(203,"path",206)(204,"path",207)(205,"path",208)(206,"path",209)(207,"path",210)(208,"path",211)(209,"path",212)(210,"path",213)(211,"path",214)(212,"path",215)(213,"path",216)(214,"path",217)(215,"path",218)(216,"path",219)(217,"path",220)(218,"path",221)(219,"path",222)(220,"path",223)(221,"path",224)(222,"path",225)(223,"path",226)(224,"path",227)(225,"path",228)(226,"path",229)(227,"path",230)(228,"path",231)(229,"path",232)(230,"path",233)(231,"path",234)(232,"path",235)(233,"path",236)(234,"path",237)(235,"path",238)(236,"path",239)(237,"path",240)(238,"path",241)(239,"path",242)(240,"path",243)(241,"path",244)(242,"path",245)(243,"path",246)(244,"path",247)(245,"path",248)(246,"path",249)(247,"path",250)(248,"path",251)(249,"path",252)(250,"path",253)(251,"path",254)(252,"path",255)(253,"path",256)(254,"path",257)(255,"path",258)(256,"path",259)(257,"path",260)(258,"path",261)(259,"path",262)(260,"path",263)(261,"path",264)(262,"path",265)(263,"path",266)(264,"path",267)(265,"path",268)(266,"path",269)(267,"path",270)(268,"path",271)(269,"path",272)(270,"path",273)(271,"path",274),z(272,"path",275)(273,"path",276)(274,"path",277)(275,"path",278)(276,"path",279)(277,"path",280)(278,"path",281)(279,"path",282)(280,"path",283)(281,"path",284)(282,"path",285)(283,"path",286)(284,"path",287)(285,"path",288)(286,"path",289)(287,"path",290)(288,"path",291)(289,"path",292)(290,"path",293)(291,"path",294)(292,"path",295)(293,"path",296)(294,"path",297)(295,"path",298)(296,"path",299)(297,"path",300)(298,"path",301)(299,"path",302)(300,"path",303)(301,"path",304)(302,"path",305)(303,"path",306)(304,"path",307)(305,"path",308)(306,"path",309)(307,"path",310)(308,"path",311)(309,"path",312)(310,"path",313)(311,"path",314)(312,"path",315)(313,"path",316)(314,"path",317)(315,"path",318)(316,"path",319)(317,"path",320)(318,"path",321)(319,"path",322)(320,"path",323)(321,"path",324)(322,"path",325)(323,"path",326)(324,"path",327)(325,"path",328)(326,"path",329)(327,"path",330)(328,"path",331)(329,"path",332)(330,"path",333)(331,"path",334)(332,"path",335)(333,"path",336)(334,"path",337)(335,"path",338)(336,"path",339)(337,"path",340)(338,"path",341)(339,"path",342)(340,"path",343)(341,"path",344)(342,"path",345)(343,"path",346)(344,"path",347)(345,"path",348)(346,"path",349)(347,"path",350)(348,"path",351)(349,"path",352)(350,"path",353)(351,"path",354)(352,"path",355)(353,"path",356)(354,"path",357)(355,"path",358)(356,"path",359)(357,"path",360)(358,"path",361)(359,"path",362)(360,"path",363)(361,"path",364)(362,"path",365)(363,"path",366)(364,"path",367)(365,"path",368)(366,"path",369)(367,"path",370)(368,"path",371)(369,"path",372)(370,"path",373)(371,"path",374)(372,"path",375)(373,"path",376)(374,"path",377)(375,"path",378)(376,"path",379)(377,"path",380)(378,"path",381)(379,"path",382)(380,"path",383)(381,"path",384)(382,"path",385)(383,"path",386)(384,"path",387)(385,"path",388)(386,"path",389)(387,"path",390)(388,"path",391),u(389,"text",392),_(390,"N"),h(),u(391,"text",393),_(392,"E"),h(),u(393,"text",394),_(394,"S"),h(),u(395,"text",395),_(396,"W"),h(),u(397,"text",396),_(398,"NE"),h(),u(399,"text",397),_(400,"SE"),h(),u(401,"text",398),_(402,"SW"),h(),u(403,"text",399),_(404,"NW"),h()(),u(405,"g",400)(406,"text",401,1),_(408,"0\xBA"),h(),z(409,"text",402,2)(411,"text",403,3),h(),u(413,"g",404)(414,"g",405,4),z(416,"path",406),h()(),u(417,"g",407)(418,"g",408,5),z(420,"path",409),h()(),u(421,"g",410,6)(423,"g",411),z(424,"path",412),h()(),u(425,"g",14)(426,"g",413),z(427,"path",414),h()()()),t&2&&(f(413),w("ngClass",Gi(3,mg,i.windapparent==null||i.windapparent==null)),f(4),w("ngClass",Gi(5,mg,i.windtrue==null||i.windtrue==null)),f(4),w("ngClass",Gi(7,mg,i.needle==null||i.needle==null)))},dependencies:[mn,Rn],encapsulation:2,changeDetection:0})},vw=class n extends _w{label="";speed;heading;windtrue;windapparent;labeltext;headingtext;speedtext;pointer;needlehi;needlelo;showPointer=!0;showWindTrue=!0;showWindApparent=!0;renderer=M(Pn);constructor(){super(null)}ngOnInit(){this.updateDial()}ngOnChanges(e){this.updateDial(e)}renderValue(e,t=0,i=!1){if(isNaN(e)||typeof e!="number")return"--";let r=typeof t=="number"?e.toFixed(t):e.toString();return e<10&&i?"0"+r:r}updateDial(e){let t={windtrue:!1,windapparent:!1,label:null,heading:null,speed:null};t.heading=e&&e.heading?e.heading.currentValue:this.heading,t.speed=e&&e.speed?e.speed.currentValue:this.speed,t.label=e&&e.label?e.label.currentValue:this.label,this.labeltext&&this.labeltext.nativeElement&&this.renderer.setProperty(this.labeltext.nativeElement,"innerHTML",t.label),this.speedtext&&this.speedtext.nativeElement&&this.renderer.setProperty(this.speedtext.nativeElement,"innerHTML",this.renderValue(t.speed,1));let i=this.renderValue(t.heading,0),r=i==="--"?this.minValue:t.heading;this.showPointer=i!=="--"&&!this.windtrue&&!this.windapparent,this.pointer&&this.pointer.nativeElement&&this.renderer.setAttribute(this.pointer.nativeElement,"transform","rotate("+this.getAngle(r)+" 100 100)"),this.headingtext&&this.headingtext.nativeElement&&this.renderer.setProperty(this.headingtext.nativeElement,"innerHTML",i+"\xBA"),this.showWindTrue=i!=="--"&&this.windtrue,this.needlehi&&this.needlehi.nativeElement&&this.renderer.setAttribute(this.needlehi.nativeElement,"transform","rotate("+this.getAngle(r)+" 100 100)"),this.showWindApparent=i!=="--"&&this.windapparent&&!this.windtrue,this.needlehi&&this.needlehi.nativeElement&&this.renderer.setAttribute(this.needlelo.nativeElement,"transform","rotate("+this.getAngle(r)+" 100 100)")}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["ap-compass-northup"]],viewQuery:function(t,i){if(t&1&&Ot(e1e,7)(hj,7)(pj,7)(mj,7)(fj,7)(gj,7),t&2){let r;Ee(r=Ie())&&(i.labeltext=r.first),Ee(r=Ie())&&(i.headingtext=r.first),Ee(r=Ie())&&(i.speedtext=r.first),Ee(r=Ie())&&(i.pointer=r.first),Ee(r=Ie())&&(i.needlehi=r.first),Ee(r=Ie())&&(i.needlelo=r.first)}},inputs:{label:"label",speed:"speed",heading:"heading",windtrue:"windtrue",windapparent:"windapparent"},features:[it,Se],decls:424,vars:9,consts:[["dial",""],["headingtext",""],["speedtext",""],["labeltext",""],["needlelo",""],["needlehi",""],["pointer",""],[0,"xmlns","svg","http://www.w3.org/2000/svg","xmlns","http://www.w3.org/2000/svg",0,"xmlns","xlink","http://www.w3.org/1999/xlink",0,"xmlns","rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#",0,"xmlns","dc","http://purl.org/dc/elements/1.1/","version","1.1","encoding","UTF-8","viewBox","0 0 200 200"],["x","-0.5","y","-0.5","width","2","height","2","color-interpolation-filters","sRGB","id","shadow"],["stdDeviation","5"],["x","-0.5","y","-0.5","width","3","height","3","color-interpolation-filters","sRGB","id","shadow2"],["stdDeviation","1"],["type","text/css"],["x","0","width","200","y","0","height","200",1,"compass_nup","bgRect"],[1,"compass_nup"],["cx","100","cy","100","r","90",1,"bgDial"],["id","dial",1,"compass_nup"],["d","M 100,45 L 100,65",1,"longDiv"],["d","M 100,155 L 100,135",1,"longDiv"],["d","M 45,100 L 65,100",1,"longDiv"],["d","M 155,100 L 135,100",1,"longDiv"],["d","M 100,30 L 100,19",1,"longDiv"],["d","M 101.30893048279626,25.011422863270653 L 101.41364492141996,19.012336692332312",1,"shortDiv"],["d","M 102.61746225268757,25.045687973567823 L 102.82685923290258,19.049343011453246",1,"shortDiv"],["d","M 103.92519671822079,25.102784893406962 L 104.23921245567846,19.111007684879525",1,"shortDiv"],["d","M 105.2317355308094,25.182696230513187 L 105.65027437327414,19.197311928954235",1,"shortDiv"],["d","M 106.53668070607436,25.285397643119083 L 107.0596151625603,19.308229454568604",1,"shortDiv"],["d","M 107.83963474507401,25.410857847379503 L 108.46680552467993,19.443726475169868",1,"shortDiv"],["d","M 109.14020075538606,25.559038626900858 L 109.87141681581694,19.60376171705292",1,"shortDiv"],["d","M 110.43798257200491,25.72989484438223 L 111.2730211777653,19.788286431932804",1,"shortDiv"],["d","M 111.73258487801732,25.923374455364666 L 112.6711916682587,19.997244411793844",1,"shortDiv"],["d","M 113.02361332501978,26.139418524084405 L 114.06550239102135,20.230572006011144",1,"shortDiv"],["d","M 114.31067465324087,26.377961241425197 L 115.45552862550014,20.488198140739215",1,"shortDiv"],["d","M 115.59337681133195,26.638929944964573 L 116.84084695623851,20.77004434056174",1,"shortDiv"],["d","M 116.87132907578987,26.922245141107354 L 118.22103540185307,21.076024752395952",1,"shortDiv"],["d","M 118.14414216997508,27.22782052930026 L 119.59567354357308,21.40604617164429",1,"shortDiv"],["d","M 119.41142838268905,27.55556302831988 L 120.96434265330419,21.76000807058547",1,"shortDiv"],["d","M 120.67280168627494,27.905372804626083 L 122.32662582117693,22.13780262899617",1,"shortDiv"],["d","M 121.92787785420526,28.277143302772345 L 123.68210808254167,22.539314766994124",1,"shortDiv"],["d","M 123.17627457812105,28.67076127786349 L 125.03037654437074,22.96442218009257",1,"shortDiv"],["d","M 124.41761158428675,29.086106830051236 L 126.37102051102968,23.412995376455342",1,"shortDiv"],["d","M 125.65151074942516,29.523053441056874 L 127.70363160937916,23.884897716341413",1,"shortDiv"],["d","M 126.87759621589751,29.98146801270987 L 129.02780391316932,24.37998545372666",1,"shortDiv"],["d","M 128.0954945061934,30.461210907490937 L 130.34313406668886,24.898107780090214",1,"shortDiv"],["d","M 129.30483463669552,30.962135991066972 L 131.64922140763116,25.439106870352333",1,"shortDiv"],["d","M 130.50524823068503,31.48409067680494 L 132.94566808913982,26.002817930949334",1,"shortDiv"],["d","M 131.69636963055245,32.02691597225126 L 134.23207920099665,26.589069250031358",1,"shortDiv"],["d","M 132.8778360091808,32.59044652756248 L 135.50806288991527,27.197682249767468",1,"shortDiv"],["d","M 134.049287480466,33.174510685872406 L 136.7732304789033,27.8284715407422",1,"shortDiv"],["d","M 135.21036720894182,33.77893053558047 L 138.02719658565715,28.481244978426915",1,"shortDiv"],["d","M 136.3607215184753,34.40352196454532 L 139.26957923995332,29.15580372170895",1,"shortDiv"],["d","M 137.5,35.0480947161671 L 140.5,29.851942293460468",1,"shortDiv"],["d","M 138.62785561825405,35.712452447341576 L 141.7180840677144,30.569448643128908",1,"shortDiv"],["d","M 139.74394481749036,36.39639278826805 L 142.9234604028896,31.308104211329493",1,"shortDiv"],["d","M 140.84792762612705,37.099707404093195 L 144.1157618362172,32.067683996420655",1,"shortDiv"],["d","M 141.939467760306,37.82218205837188 L 145.2946251811305,32.847956623041625",1,"shortDiv"],["d","M 143.01823272632845,38.56359667832562 L 146.45969134443473,33.64868441259166",1,"shortDiv"],["d","M 144.0838939219355,39.32372542187894 L 147.61060543569033,34.46962345562926",1,"shortDiv"],["d","M 145.1361267364036,40.10233674645304 L 148.74701687531592,35.310523686169276",1,"shortDiv"],["d","M 146.17461064942438,40.89919347949585 L 149.86857950137832,36.171128957855515",1,"shortDiv"],["d","M 147.1990293287378,41.71405289072718 L 150.97495167503683,37.051177121985354",1,"shortDiv"],["d","M 148.20907072649044,42.54666676607665 L 152.06579638460968,37.95040010736278",1,"shortDiv"],["d","M 149.20442717428804,43.3967814832921 L 153.1407813482311,38.868524001955464",1,"shortDiv"],["d","M 150.18479547691436,44.264138089195434 L 154.1995791150675,39.80526913633106",1,"shortDiv"],["d","M 151.14987700468737,45.148472378562204 L 155.2418671650624,40.76035016884718",1,"shortDiv"],["d","M 152.0993777844248,46.04951497460116 L 156.26732800717878,41.733476172569254",1,"shortDiv"],["d","M 127.55320713028647,33.48067365918736 L 130.99735802157227,25.16575786658578",1,"shortDiv"],["d","M 149.49747468305833,50.50252531694167 L 157.27564927611036,42.72435072388965",1,"longDiv"],["d","M 153.95048502539885,47.900622215575204 L 158.26652382743075,43.732671992821224",1,"shortDiv"],["d","M 154.85152762143778,48.85012299531262 L 159.2396498311528,44.758132834937626",1,"shortDiv"],["d","M 155.73586191080457,49.81520452308563 L 160.19473086366895,45.800420884932485",1,"shortDiv"],["d","M 156.6032185167079,50.79557282571196 L 161.13147599804455,46.85921865176891",1,"shortDiv"],["d","M 157.45333323392336,51.79092927350955 L 162.04959989263722,47.93420361539031",1,"shortDiv"],["d","M 158.28594710927283,52.800970671262185 L 162.94882287801465,49.025048324963166",1,"shortDiv"],["d","M 159.10080652050414,53.82538935057563 L 163.82887104214447,50.13142049862168",1,"shortDiv"],["d","M 159.89766325354697,54.86387326359638 L 164.6894763138307,51.25298312468409",1,"shortDiv"],["d","M 160.67627457812105,55.916106078064516 L 165.53037654437074,52.389394564309676",1,"shortDiv"],["d","M 161.4364033216744,56.981767273671544 L 166.35131558740835,53.54030865556527",1,"shortDiv"],["d","M 162.17781794162812,58.06053223969399 L 167.15204337695837,54.70537481886951",1,"shortDiv"],["d","M 162.90029259590682,59.15207237387296 L 167.93231600357933,55.8842381637828",1,"shortDiv"],["d","M 163.60360721173197,60.256055182509634 L 168.6918957886705,57.076539597110404",1,"shortDiv"],["d","M 164.2875475526584,61.37214438174592 L 169.4305513568711,58.28191593228559",1,"shortDiv"],["d","M 164.9519052838329,62.49999999999999 L 170.14805770653953,59.49999999999999",1,"shortDiv"],["d","M 165.59647803545468,63.63927848152472 L 170.84419627829107,60.73042076004669",1,"shortDiv"],["d","M 166.22106946441951,64.78963279105818 L 171.51875502157307,61.97280341434284",1,"shortDiv"],["d","M 166.8254893141276,65.950712519534 L 172.1715284592578,63.226769521096706",1,"shortDiv"],["d","M 167.40955347243752,67.12216399081919 L 172.80231775023253,64.49193711008473",1,"shortDiv"],["d","M 167.97308402774874,68.30363036944755 L 173.41093074996866,65.76792079900335",1,"shortDiv"],["d","M 168.51590932319505,69.49475176931499 L 173.99718206905067,67.05433191086018",1,"shortDiv"],["d","M 169.037864008933,70.69516536330447 L 174.56089312964767,68.35077859236883",1,"shortDiv"],["d","M 169.53878909250906,71.90450549380658 L 175.1018922199098,69.65686593331111",1,"shortDiv"],["d","M 170.01853198729015,73.12240378410247 L 175.62001454627335,70.97219608683068",1,"shortDiv"],["d","M 170.47694655894313,74.34848925057484 L 176.1151022836586,72.29636839062083",1,"shortDiv"],["d","M 170.91389316994875,75.58238841571324 L 176.58700462354466,73.6289794889703",1,"shortDiv"],["d","M 171.3292387221365,76.82372542187895 L 177.03557781990742,74.96962345562926",1,"shortDiv"],["d","M 171.72285669722766,78.07212214579474 L 177.46068523300588,76.31789191745833",1,"shortDiv"],["d","M 172.0946271953739,79.32719831372506 L 177.86219737100384,77.67337417882307",1,"shortDiv"],["d","M 172.44443697168012,80.58857161731093 L 178.23999192941454,79.0356573466958",1,"shortDiv"],["d","M 172.77217947069974,81.85585783002492 L 178.59395382835572,80.40432645642692",1,"shortDiv"],["d","M 173.07775485889266,83.12867092421011 L 178.92397524760406,81.77896459814693",1,"shortDiv"],["d","M 173.36107005503544,84.40662318866805 L 179.22995565943825,83.1591530437615",1,"shortDiv"],["d","M 173.6220387585748,85.68932534675913 L 179.5118018592608,84.54447137449986",1,"shortDiv"],["d","M 173.86058147591558,86.97638667498022 L 179.76942799398887,85.93449760897863",1,"shortDiv"],["d","M 174.07662554463533,88.26741512198268 L 180.00275558820616,87.3288083317413",1,"shortDiv"],["d","M 174.27010515561778,89.56201742799509 L 180.21171356806718,88.7269788222347",1,"shortDiv"],["d","M 174.44096137309913,90.85979924461394 L 180.39623828294708,90.12858318418306",1,"shortDiv"],["d","M 174.5891421526205,92.16036525492598 L 180.55627352483015,91.53319447532004",1,"shortDiv"],["d","M 174.7146023568809,93.46331929392564 L 180.69177054543138,92.9403848374397",1,"shortDiv"],["d","M 174.8173037694868,94.7682644691906 L 180.80268807104576,94.34972562672584",1,"shortDiv"],["d","M 174.89721510659302,96.07480328177923 L 180.88899231512048,95.76078754432156",1,"shortDiv"],["d","M 174.95431202643218,97.38253774731243 L 180.95065698854677,97.17314076709741",1,"shortDiv"],["d","M 174.98857713672936,98.69106951720373 L 180.98766330766767,98.58635507858003",1,"shortDiv"],["d","M 166.51932634081265,72.44679286971353 L 174.83424213341422,69.00264197842772",1,"shortDiv"],["d","M 170,100 L 181,100",1,"longDiv"],["d","M 174.98857713672936,101.30893048279626 L 180.98766330766767,101.41364492141996",1,"shortDiv"],["d","M 174.95431202643218,102.61746225268757 L 180.95065698854677,102.82685923290258",1,"shortDiv"],["d","M 174.89721510659302,103.92519671822079 L 180.88899231512048,104.23921245567846",1,"shortDiv"],["d","M 174.8173037694868,105.2317355308094 L 180.80268807104576,105.65027437327416",1,"shortDiv"],["d","M 174.7146023568809,106.53668070607435 L 180.69177054543138,107.0596151625603",1,"shortDiv"],["d","M 174.58914215262052,107.839634745074 L 180.55627352483015,108.46680552467993",1,"shortDiv"],["d","M 174.44096137309916,109.14020075538605 L 180.39623828294708,109.87141681581693",1,"shortDiv"],["d","M 174.27010515561778,110.4379825720049 L 180.21171356806718,111.27302117776529",1,"shortDiv"],["d","M 174.07662554463533,111.7325848780173 L 180.00275558820616,112.6711916682587",1,"shortDiv"],["d","M 173.86058147591558,113.02361332501977 L 179.76942799398887,114.06550239102135",1,"shortDiv"],["d","M 173.6220387585748,114.31067465324087 L 179.5118018592608,115.45552862550014",1,"shortDiv"],["d","M 173.36107005503544,115.59337681133195 L 179.22995565943825,116.84084695623851",1,"shortDiv"],["d","M 173.07775485889266,116.87132907578987 L 178.92397524760406,118.22103540185307",1,"shortDiv"],["d","M 172.77217947069974,118.14414216997507 L 178.59395382835572,119.59567354357307",1,"shortDiv"],["d","M 172.44443697168012,119.41142838268905 L 178.23999192941454,120.96434265330417",1,"shortDiv"],["d","M 172.0946271953739,120.67280168627494 L 177.86219737100384,122.32662582117692",1,"shortDiv"],["d","M 171.72285669722766,121.92787785420525 L 177.46068523300588,123.68210808254167",1,"shortDiv"],["d","M 171.32923872213652,123.17627457812105 L 177.03557781990745,125.03037654437074",1,"shortDiv"],["d","M 170.91389316994878,124.41761158428675 L 176.58700462354466,126.37102051102968",1,"shortDiv"],["d","M 170.47694655894313,125.65151074942516 L 176.1151022836586,127.70363160937916",1,"shortDiv"],["d","M 170.01853198729015,126.87759621589751 L 175.62001454627335,129.02780391316932",1,"shortDiv"],["d","M 169.53878909250906,128.0954945061934 L 175.1018922199098,130.3431340666889",1,"shortDiv"],["d","M 169.037864008933,129.30483463669552 L 174.56089312964767,131.64922140763116",1,"shortDiv"],["d","M 168.51590932319507,130.505248230685 L 173.99718206905067,132.94566808913982",1,"shortDiv"],["d","M 167.97308402774877,131.69636963055245 L 173.41093074996866,134.23207920099665",1,"shortDiv"],["d","M 167.40955347243752,132.8778360091808 L 172.80231775023253,135.50806288991527",1,"shortDiv"],["d","M 166.8254893141276,134.049287480466 L 172.1715284592578,136.7732304789033",1,"shortDiv"],["d","M 166.22106946441954,135.2103672089418 L 171.5187550215731,138.02719658565712",1,"shortDiv"],["d","M 165.5964780354547,136.36072151847526 L 170.84419627829107,139.2695792399533",1,"shortDiv"],["d","M 164.9519052838329,137.5 L 170.14805770653953,140.49999999999997",1,"shortDiv"],["d","M 164.28754755265842,138.62785561825407 L 169.4305513568711,141.7180840677144",1,"shortDiv"],["d","M 163.60360721173197,139.74394481749036 L 168.6918957886705,142.9234604028896",1,"shortDiv"],["d","M 162.90029259590682,140.84792762612705 L 167.93231600357933,144.1157618362172",1,"shortDiv"],["d","M 162.17781794162812,141.939467760306 L 167.15204337695837,145.29462518113047",1,"shortDiv"],["d","M 161.4364033216744,143.01823272632845 L 166.35131558740832,146.45969134443473",1,"shortDiv"],["d","M 160.67627457812105,144.08389392193547 L 165.53037654437074,147.61060543569033",1,"shortDiv"],["d","M 159.89766325354697,145.1361267364036 L 164.68947631383074,148.7470168753159",1,"shortDiv"],["d","M 159.10080652050414,146.17461064942438 L 163.8288710421445,149.86857950137832",1,"shortDiv"],["d","M 158.28594710927283,147.1990293287378 L 162.94882287801465,150.97495167503683",1,"shortDiv"],["d","M 157.45333323392336,148.20907072649044 L 162.04959989263722,152.06579638460968",1,"shortDiv"],["d","M 156.6032185167079,149.20442717428804 L 161.13147599804455,153.1407813482311",1,"shortDiv"],["d","M 155.73586191080457,150.18479547691436 L 160.19473086366895,154.1995791150675",1,"shortDiv"],["d","M 154.8515276214378,151.14987700468737 L 159.2396498311528,155.24186716506236",1,"shortDiv"],["d","M 153.95048502539885,152.0993777844248 L 158.26652382743075,156.26732800717878",1,"shortDiv"],["d","M 166.51932634081265,127.55320713028647 L 174.83424213341422,130.99735802157227",1,"shortDiv"],["d","M 149.49747468305833,149.49747468305833 L 157.27564927611036,157.27564927611036",1,"longDiv"],["d","M 152.0993777844248,153.95048502539882 L 156.2673280071788,158.26652382743072",1,"shortDiv"],["d","M 151.1498770046874,154.85152762143778 L 155.2418671650624,159.2396498311528",1,"shortDiv"],["d","M 150.18479547691436,155.73586191080454 L 154.19957911506754,160.19473086366892",1,"shortDiv"],["d","M 149.20442717428804,156.6032185167079 L 153.1407813482311,161.13147599804455",1,"shortDiv"],["d","M 148.20907072649047,157.45333323392333 L 152.0657963846097,162.04959989263722",1,"shortDiv"],["d","M 147.1990293287378,158.28594710927283 L 150.97495167503683,162.94882287801465",1,"shortDiv"],["d","M 146.17461064942438,159.10080652050414 L 149.86857950137832,163.82887104214447",1,"shortDiv"],["d","M 145.1361267364036,159.89766325354697 L 148.7470168753159,164.6894763138307",1,"shortDiv"],["d","M 144.0838939219355,160.67627457812105 L 147.61060543569033,165.53037654437074",1,"shortDiv"],["d","M 143.01823272632848,161.4364033216744 L 146.45969134443476,166.35131558740832",1,"shortDiv"],["d","M 141.939467760306,162.17781794162812 L 145.2946251811305,167.15204337695837",1,"shortDiv"],["d","M 140.84792762612705,162.9002925959068 L 144.11576183621722,167.93231600357933",1,"shortDiv"],["d","M 139.74394481749036,163.60360721173197 L 142.9234604028896,168.6918957886705",1,"shortDiv"],["d","M 138.62785561825407,164.2875475526584 L 141.71808406771441,169.4305513568711",1,"shortDiv"],["d","M 137.5,164.9519052838329 L 140.5,170.14805770653953",1,"shortDiv"],["d","M 136.3607215184753,165.59647803545468 L 139.26957923995332,170.84419627829107",1,"shortDiv"],["d","M 135.21036720894182,166.22106946441954 L 138.02719658565715,171.5187550215731",1,"shortDiv"],["d","M 134.049287480466,166.8254893141276 L 136.7732304789033,172.1715284592578",1,"shortDiv"],["d","M 132.87783600918084,167.4095534724375 L 135.5080628899153,172.80231775023253",1,"shortDiv"],["d","M 131.69636963055245,167.97308402774874 L 134.23207920099665,173.41093074996866",1,"shortDiv"],["d","M 130.50524823068503,168.51590932319505 L 132.94566808913984,173.99718206905067",1,"shortDiv"],["d","M 129.30483463669555,169.037864008933 L 131.64922140763116,174.56089312964767",1,"shortDiv"],["d","M 128.0954945061934,169.53878909250903 L 130.3431340666889,175.10189221990976",1,"shortDiv"],["d","M 126.87759621589751,170.01853198729015 L 129.02780391316932,175.62001454627335",1,"shortDiv"],["d","M 125.65151074942517,170.47694655894313 L 127.70363160937919,176.1151022836586",1,"shortDiv"],["d","M 124.41761158428675,170.91389316994878 L 126.37102051102968,176.58700462354466",1,"shortDiv"],["d","M 123.17627457812107,171.3292387221365 L 125.03037654437075,177.03557781990742",1,"shortDiv"],["d","M 121.92787785420528,171.72285669722766 L 123.6821080825417,177.46068523300588",1,"shortDiv"],["d","M 120.67280168627494,172.0946271953739 L 122.32662582117693,177.86219737100384",1,"shortDiv"],["d","M 119.41142838268908,172.44443697168012 L 120.9643426533042,178.23999192941454",1,"shortDiv"],["d","M 118.14414216997508,172.77217947069974 L 119.59567354357308,178.59395382835572",1,"shortDiv"],["d","M 116.87132907578989,173.07775485889263 L 118.22103540185307,178.92397524760406",1,"shortDiv"],["d","M 115.59337681133195,173.36107005503544 L 116.84084695623851,179.22995565943825",1,"shortDiv"],["d","M 114.31067465324088,173.6220387585748 L 115.45552862550014,179.5118018592608",1,"shortDiv"],["d","M 113.02361332501977,173.86058147591558 L 114.06550239102135,179.76942799398887",1,"shortDiv"],["d","M 111.73258487801732,174.0766255446353 L 112.67119166825871,180.00275558820616",1,"shortDiv"],["d","M 110.43798257200493,174.27010515561778 L 111.27302117776533,180.21171356806718",1,"shortDiv"],["d","M 109.14020075538606,174.44096137309913 L 109.87141681581696,180.39623828294708",1,"shortDiv"],["d","M 107.83963474507404,174.5891421526205 L 108.46680552467996,180.55627352483015",1,"shortDiv"],["d","M 106.53668070607436,174.7146023568809 L 107.05961516256032,180.69177054543138",1,"shortDiv"],["d","M 105.23173553080942,174.8173037694868 L 105.65027437327417,180.80268807104576",1,"shortDiv"],["d","M 103.92519671822079,174.89721510659302 L 104.23921245567846,180.88899231512048",1,"shortDiv"],["d","M 102.61746225268759,174.95431202643218 L 102.82685923290259,180.95065698854677",1,"shortDiv"],["d","M 101.30893048279626,174.98857713672936 L 101.41364492141996,180.98766330766767",1,"shortDiv"],["d","M 127.55320713028647,166.51932634081265 L 130.99735802157227,174.83424213341422",1,"shortDiv"],["d","M 100.00000000000001,170 L 100.00000000000001,181",1,"longDiv"],["d","M 98.69106951720376,174.98857713672936 L 98.58635507858006,180.98766330766767",1,"shortDiv"],["d","M 97.38253774731243,174.95431202643218 L 97.17314076709742,180.95065698854677",1,"shortDiv"],["d","M 96.07480328177924,174.89721510659302 L 95.76078754432157,180.88899231512048",1,"shortDiv"],["d","M 94.7682644691906,174.8173037694868 L 94.34972562672586,180.80268807104576",1,"shortDiv"],["d","M 93.46331929392565,174.7146023568809 L 92.94038483743971,180.69177054543138",1,"shortDiv"],["d","M 92.16036525492599,174.5891421526205 L 91.53319447532007,180.55627352483015",1,"shortDiv"],["d","M 90.85979924461395,174.44096137309916 L 90.12858318418307,180.39623828294708",1,"shortDiv"],["d","M 89.56201742799509,174.27010515561778 L 88.7269788222347,180.21171356806718",1,"shortDiv"],["d","M 88.2674151219827,174.07662554463533 L 87.32880833174131,180.00275558820616",1,"shortDiv"],["d","M 86.97638667498025,173.8605814759156 L 85.93449760897867,179.76942799398887",1,"shortDiv"],["d","M 85.68932534675915,173.6220387585748 L 84.54447137449988,179.5118018592608",1,"shortDiv"],["d","M 84.40662318866806,173.36107005503544 L 83.15915304376152,179.22995565943825",1,"shortDiv"],["d","M 83.12867092421013,173.07775485889266 L 81.77896459814694,178.92397524760406",1,"shortDiv"],["d","M 81.85585783002495,172.77217947069974 L 80.40432645642693,178.59395382835572",1,"shortDiv"],["d","M 80.58857161731095,172.44443697168012 L 79.03565734669581,178.23999192941454",1,"shortDiv"],["d","M 79.32719831372508,172.0946271953739 L 77.67337417882308,177.86219737100384",1,"shortDiv"],["d","M 78.07212214579474,171.72285669722766 L 76.31789191745833,177.46068523300588",1,"shortDiv"],["d","M 76.82372542187895,171.32923872213652 L 74.96962345562928,177.03557781990745",1,"shortDiv"],["d","M 75.58238841571327,170.91389316994878 L 73.62897948897033,176.58700462354466",1,"shortDiv"],["d","M 74.34848925057486,170.47694655894313 L 72.29636839062084,176.1151022836586",1,"shortDiv"],["d","M 73.1224037841025,170.01853198729015 L 70.9721960868307,175.62001454627335",1,"shortDiv"],["d","M 71.9045054938066,169.53878909250906 L 69.65686593331112,175.1018922199098",1,"shortDiv"],["d","M 70.69516536330448,169.037864008933 L 68.35077859236884,174.56089312964767",1,"shortDiv"],["d","M 69.49475176931499,168.51590932319505 L 67.05433191086018,173.99718206905067",1,"shortDiv"],["d","M 68.30363036944755,167.97308402774877 L 65.76792079900335,173.41093074996866",1,"shortDiv"],["d","M 67.12216399081919,167.40955347243752 L 64.49193711008473,172.80231775023253",1,"shortDiv"],["d","M 65.950712519534,166.8254893141276 L 63.22676952109672,172.1715284592578",1,"shortDiv"],["d","M 64.78963279105821,166.22106946441954 L 61.97280341434287,171.5187550215731",1,"shortDiv"],["d","M 63.63927848152473,165.5964780354547 L 60.730420760046705,170.84419627829107",1,"shortDiv"],["d","M 62.50000000000002,164.9519052838329 L 59.50000000000002,170.14805770653953",1,"shortDiv"],["d","M 61.37214438174594,164.28754755265842 L 58.281915932285614,169.4305513568711",1,"shortDiv"],["d","M 60.25605518250964,163.60360721173197 L 57.07653959711041,168.6918957886705",1,"shortDiv"],["d","M 59.15207237387297,162.90029259590682 L 55.884238163782804,167.93231600357933",1,"shortDiv"],["d","M 58.060532239694,162.17781794162815 L 54.705374818869515,167.15204337695837",1,"shortDiv"],["d","M 56.98176727367154,161.4364033216744 L 53.54030865556526,166.35131558740835",1,"shortDiv"],["d","M 55.91610607806452,160.67627457812105 L 52.38939456430968,165.53037654437074",1,"shortDiv"],["d","M 54.863873263596396,159.89766325354697 L 51.25298312468411,164.68947631383074",1,"shortDiv"],["d","M 53.825389350575634,159.10080652050414 L 50.13142049862169,163.8288710421445",1,"shortDiv"],["d","M 52.800970671262206,158.28594710927283 L 49.02504832496318,162.94882287801465",1,"shortDiv"],["d","M 51.790929273509555,157.45333323392336 L 47.934203615390324,162.04959989263722",1,"shortDiv"],["d","M 50.79557282571197,156.6032185167079 L 46.85921865176893,161.13147599804455",1,"shortDiv"],["d","M 49.81520452308563,155.73586191080457 L 45.800420884932485,160.19473086366895",1,"shortDiv"],["d","M 48.850122995312624,154.8515276214378 L 44.75813283493763,159.2396498311528",1,"shortDiv"],["d","M 47.9006222155752,153.95048502539885 L 43.73267199282121,158.26652382743075",1,"shortDiv"],["d","M 72.44679286971355,166.51932634081265 L 69.00264197842773,174.83424213341425",1,"shortDiv"],["d","M 50.50252531694168,149.49747468305833 L 42.72435072388966,157.27564927611036",1,"longDiv"],["d","M 46.04951497460119,152.0993777844248 L 41.73347617256928,156.2673280071788",1,"shortDiv"],["d","M 45.14847237856222,151.1498770046874 L 40.76035016884719,155.2418671650624",1,"shortDiv"],["d","M 44.26413808919545,150.1847954769144 L 39.805269136331084,154.19957911506754",1,"shortDiv"],["d","M 43.39678148329211,149.20442717428804 L 38.86852400195548,153.1407813482311",1,"shortDiv"],["d","M 42.546666766076655,148.20907072649047 L 37.95040010736279,152.0657963846097",1,"shortDiv"],["d","M 41.71405289072721,147.19902932873782 L 37.05117712198538,150.97495167503686",1,"shortDiv"],["d","M 40.89919347949584,146.17461064942435 L 36.17112895785551,149.8685795013783",1,"shortDiv"],["d","M 40.10233674645304,145.1361267364036 L 35.310523686169276,148.74701687531592",1,"shortDiv"],["d","M 39.32372542187895,144.0838939219355 L 34.46962345562926,147.61060543569033",1,"shortDiv"],["d","M 38.56359667832563,143.01823272632848 L 33.64868441259168,146.45969134443476",1,"shortDiv"],["d","M 37.822182058371894,141.93946776030606 L 32.84795662304164,145.29462518113053",1,"shortDiv"],["d","M 37.099707404093195,140.84792762612702 L 32.067683996420655,144.1157618362172",1,"shortDiv"],["d","M 36.39639278826806,139.7439448174904 L 31.308104211329507,142.9234604028896",1,"shortDiv"],["d","M 35.71245244734159,138.6278556182541 L 30.569448643128922,141.71808406771441",1,"shortDiv"],["d","M 35.04809471616713,137.50000000000003 L 29.851942293460496,140.50000000000003",1,"shortDiv"],["d","M 34.403521964545305,136.36072151847526 L 29.155803721708935,139.2695792399533",1,"shortDiv"],["d","M 33.77893053558047,135.21036720894182 L 28.481244978426915,138.02719658565715",1,"shortDiv"],["d","M 33.17451068587242,134.04928748046603 L 27.828471540742214,136.77323047890332",1,"shortDiv"],["d","M 32.59044652756249,132.87783600918084 L 27.19768224976748,135.5080628899153",1,"shortDiv"],["d","M 32.026915972251274,131.6963696305525 L 26.589069250031372,134.23207920099668",1,"shortDiv"],["d","M 31.484090676804925,130.505248230685 L 26.00281793094932,132.94566808913982",1,"shortDiv"],["d","M 30.962135991066987,129.30483463669555 L 25.439106870352333,131.6492214076312",1,"shortDiv"],["d","M 30.46121090749095,128.09549450619343 L 24.89810778009023,130.3431340666889",1,"shortDiv"],["d","M 29.981468012709882,126.87759621589755 L 24.37998545372666,129.02780391316935",1,"shortDiv"],["d","M 29.523053441056874,125.65151074942514 L 23.884897716341413,127.70363160937916",1,"shortDiv"],["d","M 29.086106830051236,124.41761158428675 L 23.412995376455342,126.37102051102968",1,"shortDiv"],["d","M 28.67076127786349,123.17627457812107 L 22.96442218009257,125.03037654437075",1,"shortDiv"],["d","M 28.277143302772345,121.92787785420528 L 22.53931476699414,123.6821080825417",1,"shortDiv"],["d","M 27.905372804626097,120.67280168627498 L 22.137802628996184,122.32662582117698",1,"shortDiv"],["d","M 27.55556302831988,119.41142838268905 L 21.76000807058547,120.96434265330417",1,"shortDiv"],["d","M 27.22782052930026,118.14414216997508 L 21.40604617164429,119.5956735435731",1,"shortDiv"],["d","M 26.922245141107368,116.8713290757899 L 21.076024752395952,118.22103540185309",1,"shortDiv"],["d","M 26.638929944964588,115.59337681133198 L 20.770044340561753,116.84084695623855",1,"shortDiv"],["d","M 26.377961241425197,114.31067465324085 L 20.488198140739215,115.45552862550011",1,"shortDiv"],["d","M 26.139418524084405,113.02361332501978 L 20.230572006011144,114.06550239102135",1,"shortDiv"],["d","M 25.92337445536468,111.73258487801732 L 19.997244411793844,112.67119166825871",1,"shortDiv"],["d","M 25.72989484438223,110.43798257200494 L 19.788286431932804,111.27302117776533",1,"shortDiv"],["d","M 25.559038626900858,109.1402007553861 L 19.60376171705292,109.87141681581699",1,"shortDiv"],["d","M 25.41085784737949,107.83963474507401 L 19.443726475169854,108.46680552467993",1,"shortDiv"],["d","M 25.285397643119083,106.53668070607436 L 19.308229454568604,107.05961516256032",1,"shortDiv"],["d","M 25.182696230513187,105.23173553080942 L 19.197311928954235,105.65027437327417",1,"shortDiv"],["d","M 25.102784893406962,103.92519671822082 L 19.111007684879525,104.23921245567848",1,"shortDiv"],["d","M 25.045687973567823,102.61746225268756 L 19.049343011453246,102.82685923290256",1,"shortDiv"],["d","M 25.011422863270653,101.30893048279626 L 19.012336692332312,101.41364492141996",1,"shortDiv"],["d","M 33.480673659187374,127.55320713028651 L 25.165757866585793,130.99735802157232",1,"shortDiv"],["d","M 30,100.00000000000001 L 19,100.00000000000001",1,"longDiv"],["d","M 25.011422863270653,98.69106951720377 L 19.012336692332312,98.58635507858007",1,"shortDiv"],["d","M 25.045687973567823,97.38253774731247 L 19.049343011453246,97.17314076709746",1,"shortDiv"],["d","M 25.102784893406962,96.07480328177921 L 19.111007684879525,95.76078754432154",1,"shortDiv"],["d","M 25.182696230513173,94.76826446919061 L 19.197311928954235,94.34972562672586",1,"shortDiv"],["d","M 25.285397643119083,93.46331929392566 L 19.308229454568604,92.94038483743971",1,"shortDiv"],["d","M 25.41085784737949,92.16036525492602 L 19.443726475169854,91.5331944753201",1,"shortDiv"],["d","M 25.559038626900858,90.85979924461392 L 19.60376171705292,90.12858318418304",1,"shortDiv"],["d","M 25.72989484438223,89.56201742799509 L 19.788286431932804,88.7269788222347",1,"shortDiv"],["d","M 25.923374455364666,88.2674151219827 L 19.997244411793844,87.32880833174131",1,"shortDiv"],["d","M 26.13941852408439,86.97638667498025 L 20.230572006011144,85.93449760897867",1,"shortDiv"],["d","M 26.377961241425197,85.68932534675918 L 20.488198140739215,84.54447137449992",1,"shortDiv"],["d","M 26.638929944964588,84.40662318866805 L 20.770044340561753,83.15915304376148",1,"shortDiv"],["d","M 26.922245141107354,83.12867092421013 L 21.076024752395952,81.77896459814694",1,"shortDiv"],["d","M 27.22782052930026,81.85585783002495 L 21.406046171644277,80.40432645642693",1,"shortDiv"],["d","M 27.555563028319867,80.58857161731098 L 21.760008070585457,79.03565734669586",1,"shortDiv"],["d","M 27.905372804626097,79.32719831372505 L 22.137802628996184,77.67337417882305",1,"shortDiv"],["d","M 28.277143302772345,78.07212214579475 L 22.539314766994124,76.31789191745833",1,"shortDiv"],["d","M 28.670761277863477,76.82372542187896 L 22.964422180092555,74.96962345562928",1,"shortDiv"],["d","M 29.08610683005122,75.58238841571327 L 23.412995376455328,73.62897948897034",1,"shortDiv"],["d","M 29.52305344105686,74.34848925057489 L 23.884897716341413,72.29636839062088",1,"shortDiv"],["d","M 29.98146801270987,73.12240378410247 L 24.37998545372666,70.97219608683068",1,"shortDiv"],["d","M 30.461210907490937,71.9045054938066 L 24.898107780090214,69.65686593331114",1,"shortDiv"],["d","M 30.96213599106696,70.69516536330448 L 25.43910687035232,68.35077859236884",1,"shortDiv"],["d","M 31.484090676804925,69.49475176931502 L 26.002817930949305,67.05433191086021",1,"shortDiv"],["d","M 32.02691597225126,68.30363036944753 L 26.589069250031358,65.76792079900333",1,"shortDiv"],["d","M 32.59044652756248,67.12216399081919 L 27.197682249767468,64.49193711008473",1,"shortDiv"],["d","M 33.174510685872406,65.950712519534 L 27.828471540742186,63.22676952109672",1,"shortDiv"],["d","M 33.77893053558047,64.78963279105821 L 28.4812449784269,61.97280341434288",1,"shortDiv"],["d","M 34.403521964545334,63.639278481524705 L 29.15580372170895,60.73042076004668",1,"shortDiv"],["d","M 35.0480947161671,62.49999999999999 L 29.851942293460468,59.49999999999999",1,"shortDiv"],["d","M 35.712452447341576,61.37214438174594 L 30.569448643128908,58.281915932285614",1,"shortDiv"],["d","M 36.396392788268045,60.25605518250965 L 31.308104211329493,57.07653959711042",1,"shortDiv"],["d","M 37.09970740409318,59.152072373873004 L 32.06768399642064,55.88423816378284",1,"shortDiv"],["d","M 37.82218205837188,58.06053223969398 L 32.847956623041625,54.705374818869494",1,"shortDiv"],["d","M 38.56359667832562,56.981767273671544 L 33.64868441259166,53.54030865556527",1,"shortDiv"],["d","M 39.32372542187893,55.91610607806453 L 34.46962345562925,52.3893945643097",1,"shortDiv"],["d","M 40.10233674645302,54.8638732635964 L 35.31052368616926,51.252983124684114",1,"shortDiv"],["d","M 40.89919347949582,53.82538935057566 L 36.17112895785549,50.131420498621715",1,"shortDiv"],["d","M 41.71405289072719,52.800970671262185 L 37.05117712198537,49.025048324963166",1,"shortDiv"],["d","M 42.54666676607664,51.790929273509555 L 37.950400107362775,47.934203615390324",1,"shortDiv"],["d","M 43.39678148329209,50.79557282571197 L 38.86852400195546,46.85921865176893",1,"shortDiv"],["d","M 44.264138089195406,49.81520452308567 L 39.80526913633104,45.80042088493252",1,"shortDiv"],["d","M 45.148472378562175,48.85012299531265 L 40.76035016884715,44.75813283493767",1,"shortDiv"],["d","M 46.049514974601166,47.900622215575204 L 41.73347617256926,43.732671992821224",1,"shortDiv"],["d","M 33.48067365918736,72.44679286971352 L 25.16575786658578,69.0026419784277",1,"shortDiv"],["d","M 50.502525316941664,50.502525316941686 L 42.724350723889636,42.724350723889664",1,"longDiv"],["d","M 47.90062221557518,46.04951497460119 L 43.732671992821196,41.73347617256928",1,"shortDiv"],["d","M 48.85012299531258,45.148472378562246 L 44.75813283493759,40.76035016884723",1,"shortDiv"],["d","M 49.81520452308564,44.264138089195434 L 45.80042088493249,39.80526913633106",1,"shortDiv"],["d","M 50.79557282571194,43.39678148329211 L 46.8592186517689,38.86852400195548",1,"shortDiv"],["d","M 51.79092927350953,42.546666766076655 L 47.934203615390295,37.95040010736279",1,"shortDiv"],["d","M 52.800970671262164,41.71405289072722 L 49.02504832496314,37.05117712198539",1,"shortDiv"],["d","M 53.825389350575634,40.89919347949585 L 50.13142049862169,36.171128957855515",1,"shortDiv"],["d","M 54.86387326359638,40.10233674645304 L 51.25298312468409,35.310523686169276",1,"shortDiv"],["d","M 55.9161060780645,39.323725421878954 L 52.389394564309654,34.469623455629275",1,"shortDiv"],["d","M 56.981767273671515,38.56359667832563 L 53.540308655565234,33.64868441259168",1,"shortDiv"],["d","M 58.06053223969395,37.822182058371894 L 54.705374818869466,32.84795662304164",1,"shortDiv"],["d","M 59.152072373872976,37.099707404093195 L 55.88423816378282,32.067683996420655",1,"shortDiv"],["d","M 60.25605518250963,36.39639278826806 L 57.0765395971104,31.308104211329507",1,"shortDiv"],["d","M 61.37214438174591,35.71245244734159 L 58.281915932285585,30.569448643128922",1,"shortDiv"],["d","M 62.499999999999964,35.04809471616713 L 59.499999999999964,29.851942293460496",1,"shortDiv"],["d","M 63.639278481524734,34.403521964545305 L 60.73042076004671,29.155803721708935",1,"shortDiv"],["d","M 64.78963279105818,33.77893053558047 L 61.97280341434284,28.481244978426915",1,"shortDiv"],["d","M 65.95071251953398,33.17451068587242 L 63.22676952109669,27.828471540742214",1,"shortDiv"],["d","M 67.12216399081916,32.59044652756249 L 64.4919371100847,27.19768224976748",1,"shortDiv"],["d","M 68.3036303694475,32.026915972251274 L 65.76792079900329,26.589069250031372",1,"shortDiv"],["d","M 69.49475176931499,31.484090676804925 L 67.05433191086018,26.00281793094932",1,"shortDiv"],["d","M 70.69516536330445,30.962135991066987 L 68.35077859236881,25.439106870352333",1,"shortDiv"],["d","M 71.90450549380657,30.46121090749095 L 69.6568659333111,24.89810778009023",1,"shortDiv"],["d","M 73.12240378410245,29.981468012709882 L 70.97219608683064,24.37998545372666",1,"shortDiv"],["d","M 74.34848925057486,29.523053441056874 L 72.29636839062084,23.884897716341413",1,"shortDiv"],["d","M 75.58238841571324,29.086106830051236 L 73.62897948897032,23.412995376455342",1,"shortDiv"],["d","M 76.82372542187893,28.67076127786349 L 74.96962345562925,22.96442218009257",1,"shortDiv"],["d","M 78.07212214579471,28.277143302772345 L 76.3178919174583,22.53931476699414",1,"shortDiv"],["d","M 79.32719831372502,27.905372804626097 L 77.67337417882302,22.137802628996184",1,"shortDiv"],["d","M 80.58857161731095,27.55556302831988 L 79.03565734669583,21.76000807058547",1,"shortDiv"],["d","M 81.85585783002492,27.22782052930026 L 80.4043264564269,21.40604617164429",1,"shortDiv"],["d","M 83.1286709242101,26.922245141107368 L 81.7789645981469,21.076024752395952",1,"shortDiv"],["d","M 84.40662318866801,26.638929944964588 L 83.15915304376145,20.770044340561753",1,"shortDiv"],["d","M 85.68932534675915,26.377961241425197 L 84.54447137449988,20.488198140739215",1,"shortDiv"],["d","M 86.97638667498022,26.139418524084405 L 85.93449760897863,20.230572006011144",1,"shortDiv"],["d","M 88.26741512198267,25.92337445536468 L 87.32880833174129,19.997244411793844",1,"shortDiv"],["d","M 89.56201742799506,25.72989484438223 L 88.72697882223466,19.788286431932804",1,"shortDiv"],["d","M 90.8597992446139,25.559038626900858 L 90.128583184183,19.60376171705292",1,"shortDiv"],["d","M 92.16036525492599,25.410857847379503 L 91.53319447532007,19.443726475169868",1,"shortDiv"],["d","M 93.46331929392562,25.285397643119083 L 92.94038483743968,19.308229454568604",1,"shortDiv"],["d","M 94.76826446919058,25.182696230513187 L 94.34972562672583,19.197311928954235",1,"shortDiv"],["d","M 96.07480328177917,25.102784893406962 L 95.7607875443215,19.111007684879525",1,"shortDiv"],["d","M 97.38253774731244,25.045687973567823 L 97.17314076709744,19.049343011453246",1,"shortDiv"],["d","M 98.69106951720373,25.011422863270653 L 98.58635507858003,19.012336692332312",1,"shortDiv"],["d","M 72.44679286971349,33.480673659187374 L 69.00264197842768,25.165757866585793",1,"shortDiv"],["d","M 99.99999999999999,30 L 99.99999999999999,19",1,"longDiv"],["x","100","y","40","id","pcN",1,"scale"],["x","100","y","40","id","pcE","transform","rotate(90,100,100)",1,"scale"],["x","100","y","40","id","pcS","transform","rotate(180,100,100)",1,"scale"],["x","100","y","40","id","pcW","transform","rotate(270,100,100)",1,"scale"],["x","100","y","40","id","pcNE","transform","rotate(45,100,100)",1,"scale"],["x","100","y","40","id","pcSE","transform","rotate(135,100,100)",1,"scale"],["x","100","y","40","id","pcSW","transform","rotate(225,100,100)",1,"scale"],["x","100","y","40","id","pcNW","transform","rotate(315,100,100)",1,"scale"],[1,"compass_nup",2,"z-index","1000"],["x","100","y","95","id","headingtext",1,"value"],["x","100","y","115","id","speedtext",1,"value"],["x","100","y","130","id","labeltext",1,"label"],["id","gLoPointer",1,"compass_nup",3,"ngClass"],["transform","rotate(0 100 100)","id","needlelo"],["d","M 100,79 l 5,-69 -10,0 5,69 z","id","loPointer"],["id","gHiPointer",1,"compass_nup",3,"ngClass"],["transform","rotate(0 100 100)","id","needlehi"],["d","M 100,79 l 5,-69 -10,0 5,69 z","id","hiPointer"],["id","pointer",1,"compass_nup",3,"ngClass"],["transform","rotate(0 100 100)","id","needle"],["d","M 95,70 l 5,-30 5,30 -10,0 z","id","pointerShaftInner"]],template:function(t,i){t&1&&(Eo(),u(0,"svg",7)(1,"defs")(2,"filter",8),z(3,"feGaussianBlur",9),h(),u(4,"filter",10),z(5,"feGaussianBlur",11),h()(),u(6,"style",12),_(7," .hide { display:none; } text { font-style:normal; font-variant:normal; font-weight:normal; font-stretch:normal; font-family:Arial; text-align:center; text-anchor:middle; stroke:none; fill-opacity:1; } .compass_nup text.label { /** label **/ font-size:12px; fill: black; } .compass_nup text.value, .compass_nup text.unit { /** units **/ font-size:12px; font-weight: bold; fill: black; fill-opacity:0.9; } .compass_nup text.value { /** Heading Value **/ font-size:20px; } .compass_nup text.cardinal_point { /** scale 12,3,6,9 oclock positions **/ font-size:20px; font-weight: bold; fill: black; } .compass_nup text.intermediate_point { /** scale remainder **/ font-size:16px; fill: black; font-weight: bold; } .compass_nup text.scale { font-size: 12px; font-weight: bold; fill: black; } .compass_nup path.shortDiv { fill:none; fill-rule:evenodd; stroke: gray; stroke-width:0.5; stroke-linecap:butt; stroke-linejoin:miter; stroke-miterlimit:4; stroke-dasharray:none; stroke-opacity:1; } .compass_nup path.longDiv { fill:none; fill-rule:evenodd; stroke: black; stroke-width:2; stroke-linecap:butt; stroke-linejoin:miter; stroke-miterlimit:4; stroke-dasharray:none; stroke-opacity:1; } rect.compass_nup.bgRect { fill:transparent; stroke: none; } .compass_nup .bgDial { fill: lightgray; stroke: black; stroke-width: 2px; } .compass_nup #pointerShaftInner { fill: #9d4626; stroke: #9d4626; stroke-width: 0.3; stroke-opacity: 1; display: block; } .compass_nup #hiPointer { fill:olive; fill-opacity:1; display: block; } .compass_nup #loPointer { fill: rgb(16, 75, 16); fill-opacity:1; display: block; } .dark-theme { .compass_nup text.label { /** label **/ fill: #dcff85; } .compass_nup text.value, .compass_nup text.unit { /** units **/ fill: #00ff00; } .compass_nup .bgDial { fill: transparent; stroke: #deff8b; } .compass_nup text.scale { fill: #dcff85; } .compass_nup text.cardinal_point { /** scale 12,3,6,9 oclock positions **/ fill: #dcff85; } .compass_nup text.intermediate_point { /** scale remainder **/ fill: #dcff85; } .compass_nup path.shortDiv { stroke: red; } .compass_nup path.longDiv { stroke: #dcff85; } } "),h(),z(8,"rect",13),u(9,"g",14),z(10,"circle",15),h(),u(11,"g",16,0),z(13,"path",17)(14,"path",18)(15,"path",19)(16,"path",20)(17,"path",21)(18,"path",22)(19,"path",23)(20,"path",24)(21,"path",25)(22,"path",26)(23,"path",27)(24,"path",28)(25,"path",29)(26,"path",30)(27,"path",31)(28,"path",32)(29,"path",33)(30,"path",34)(31,"path",35)(32,"path",36)(33,"path",37)(34,"path",38)(35,"path",39)(36,"path",40)(37,"path",41)(38,"path",42)(39,"path",43)(40,"path",44)(41,"path",45)(42,"path",46)(43,"path",47)(44,"path",48)(45,"path",49)(46,"path",50)(47,"path",51)(48,"path",52)(49,"path",53)(50,"path",54)(51,"path",55)(52,"path",56)(53,"path",57)(54,"path",58)(55,"path",59)(56,"path",60)(57,"path",61)(58,"path",62)(59,"path",63)(60,"path",64)(61,"path",65)(62,"path",66)(63,"path",67)(64,"path",68)(65,"path",69)(66,"path",70)(67,"path",71)(68,"path",72)(69,"path",73)(70,"path",74)(71,"path",75)(72,"path",76)(73,"path",77)(74,"path",78)(75,"path",79)(76,"path",80)(77,"path",81)(78,"path",82)(79,"path",83)(80,"path",84)(81,"path",85)(82,"path",86)(83,"path",87)(84,"path",88)(85,"path",89)(86,"path",90)(87,"path",91)(88,"path",92)(89,"path",93)(90,"path",94)(91,"path",95)(92,"path",96)(93,"path",97)(94,"path",98)(95,"path",99)(96,"path",100)(97,"path",101)(98,"path",102)(99,"path",103)(100,"path",104)(101,"path",105)(102,"path",106)(103,"path",107)(104,"path",108)(105,"path",109)(106,"path",110)(107,"path",111)(108,"path",112)(109,"path",113)(110,"path",114)(111,"path",115)(112,"path",116)(113,"path",117)(114,"path",118)(115,"path",119)(116,"path",120)(117,"path",121)(118,"path",122)(119,"path",123)(120,"path",124)(121,"path",125)(122,"path",126)(123,"path",127)(124,"path",128)(125,"path",129)(126,"path",130)(127,"path",131)(128,"path",132)(129,"path",133)(130,"path",134)(131,"path",135)(132,"path",136)(133,"path",137)(134,"path",138)(135,"path",139)(136,"path",140)(137,"path",141)(138,"path",142)(139,"path",143)(140,"path",144)(141,"path",145)(142,"path",146)(143,"path",147)(144,"path",148)(145,"path",149)(146,"path",150)(147,"path",151)(148,"path",152)(149,"path",153)(150,"path",154)(151,"path",155)(152,"path",156)(153,"path",157)(154,"path",158)(155,"path",159)(156,"path",160)(157,"path",161)(158,"path",162)(159,"path",163)(160,"path",164)(161,"path",165)(162,"path",166)(163,"path",167)(164,"path",168)(165,"path",169)(166,"path",170)(167,"path",171)(168,"path",172)(169,"path",173)(170,"path",174)(171,"path",175)(172,"path",176)(173,"path",177)(174,"path",178)(175,"path",179)(176,"path",180)(177,"path",181)(178,"path",182)(179,"path",183)(180,"path",184)(181,"path",185)(182,"path",186)(183,"path",187)(184,"path",188)(185,"path",189)(186,"path",190)(187,"path",191)(188,"path",192)(189,"path",193)(190,"path",194)(191,"path",195)(192,"path",196)(193,"path",197)(194,"path",198)(195,"path",199)(196,"path",200)(197,"path",201)(198,"path",202)(199,"path",203)(200,"path",204)(201,"path",205)(202,"path",206)(203,"path",207)(204,"path",208)(205,"path",209)(206,"path",210)(207,"path",211)(208,"path",212)(209,"path",213)(210,"path",214)(211,"path",215)(212,"path",216)(213,"path",217)(214,"path",218)(215,"path",219)(216,"path",220)(217,"path",221)(218,"path",222)(219,"path",223)(220,"path",224)(221,"path",225)(222,"path",226)(223,"path",227)(224,"path",228)(225,"path",229)(226,"path",230)(227,"path",231)(228,"path",232)(229,"path",233)(230,"path",234)(231,"path",235)(232,"path",236)(233,"path",237)(234,"path",238)(235,"path",239)(236,"path",240)(237,"path",241)(238,"path",242)(239,"path",243)(240,"path",244)(241,"path",245)(242,"path",246)(243,"path",247)(244,"path",248)(245,"path",249)(246,"path",250)(247,"path",251)(248,"path",252)(249,"path",253)(250,"path",254)(251,"path",255)(252,"path",256)(253,"path",257)(254,"path",258)(255,"path",259)(256,"path",260)(257,"path",261)(258,"path",262)(259,"path",263)(260,"path",264)(261,"path",265)(262,"path",266)(263,"path",267)(264,"path",268)(265,"path",269)(266,"path",270)(267,"path",271)(268,"path",272),z(269,"path",273)(270,"path",274)(271,"path",275)(272,"path",276)(273,"path",277)(274,"path",278)(275,"path",279)(276,"path",280)(277,"path",281)(278,"path",282)(279,"path",283)(280,"path",284)(281,"path",285)(282,"path",286)(283,"path",287)(284,"path",288)(285,"path",289)(286,"path",290)(287,"path",291)(288,"path",292)(289,"path",293)(290,"path",294)(291,"path",295)(292,"path",296)(293,"path",297)(294,"path",298)(295,"path",299)(296,"path",300)(297,"path",301)(298,"path",302)(299,"path",303)(300,"path",304)(301,"path",305)(302,"path",306)(303,"path",307)(304,"path",308)(305,"path",309)(306,"path",310)(307,"path",311)(308,"path",312)(309,"path",313)(310,"path",314)(311,"path",315)(312,"path",316)(313,"path",317)(314,"path",318)(315,"path",319)(316,"path",320)(317,"path",321)(318,"path",322)(319,"path",323)(320,"path",324)(321,"path",325)(322,"path",326)(323,"path",327)(324,"path",328)(325,"path",329)(326,"path",330)(327,"path",331)(328,"path",332)(329,"path",333)(330,"path",334)(331,"path",335)(332,"path",336)(333,"path",337)(334,"path",338)(335,"path",339)(336,"path",340)(337,"path",341)(338,"path",342)(339,"path",343)(340,"path",344)(341,"path",345)(342,"path",346)(343,"path",347)(344,"path",348)(345,"path",349)(346,"path",350)(347,"path",351)(348,"path",352)(349,"path",353)(350,"path",354)(351,"path",355)(352,"path",356)(353,"path",357)(354,"path",358)(355,"path",359)(356,"path",360)(357,"path",361)(358,"path",362)(359,"path",363)(360,"path",364)(361,"path",365)(362,"path",366)(363,"path",367)(364,"path",368)(365,"path",369)(366,"path",370)(367,"path",371)(368,"path",372)(369,"path",373)(370,"path",374)(371,"path",375)(372,"path",376)(373,"path",377)(374,"path",378)(375,"path",379)(376,"path",380)(377,"path",381)(378,"path",382)(379,"path",383)(380,"path",384)(381,"path",385)(382,"path",386)(383,"path",387)(384,"path",388)(385,"path",389),u(386,"text",390),_(387,"N"),h(),u(388,"text",391),_(389,"E"),h(),u(390,"text",392),_(391,"S"),h(),u(392,"text",393),_(393,"W"),h(),u(394,"text",394),_(395,"NE"),h(),u(396,"text",395),_(397,"SE"),h(),u(398,"text",396),_(399,"SW"),h(),u(400,"text",397),_(401,"NW"),h()(),u(402,"g",398)(403,"text",399,1),_(405,"0\xBA"),h(),u(406,"text",400,2),_(408,"0"),h(),u(409,"text",401,3),_(411,"Heading"),h()(),u(412,"g",402)(413,"g",403,4),z(415,"path",404),h()(),u(416,"g",405)(417,"g",406,5),z(419,"path",407),h()(),u(420,"g",408,6)(422,"g",409),z(423,"path",410),h()()()),t&2&&(f(412),w("ngClass",Gi(3,mg,!i.showWindApparent)),f(4),w("ngClass",Gi(5,mg,!i.showWindTrue)),f(4),w("ngClass",Gi(7,mg,!i.showPointer)))},dependencies:[mn,Rn],encapsulation:2,changeDetection:0})};function ikt(n,e,t={}){switch(n){case"7d":case"30d":case"all":return iy(n,e);case"history":return t.history??null;case"custom":return t1e(t.custom)?t.custom:null;default:return null}}function t1e(n){return!!n&&Number.isFinite(n.from)&&Number.isFinite(n.to)&&n.from<n.to}function nkt(n,e,t){return hh(st(ne({context:n},ny(e)),{times:"true",provider:t}))}var _j=n=>`${n[0]},${n[1]}`;function yj(n,e){let t=new Map;return e?.lines.forEach((i,r)=>i.forEach((o,a)=>{let s=e.times[r]?.[a];if(s){let l=_j(o),c=t.get(l);c?c.times.push(s):t.set(l,{times:[s],next:0})}})),{lines:n,times:n.map(i=>i.map(r=>{let o=t.get(_j(r));return o?o.times[o.next++]:void 0}))}}function vj(n,e,t,i){if(!n)return i;let r=e??{lines:t,times:t.map(o=>o.map(()=>{}))};return ry(r,i)}function i1e(n){let e=n.lines.map((t,i)=>({line:t,times:n.times[i]??[]})).filter(t=>t.line.length>1);return{lines:e.map(t=>t.line),times:e.map(t=>t.times)}}function n1e(n){return Array.isArray(n)&&n.some(e=>e?.length>1)}function r1e(n){let e=1/0,t=-1/0;return n.forEach(i=>i.forEach(r=>{let o=r?Date.parse(r):NaN;Number.isFinite(o)&&(e=Math.min(e,o),t=Math.max(t,o))})),Number.isFinite(e)?{from:e,to:t}:void 0}var bw=n=>String(n).padStart(2,"0"),fg=n=>`${n.getFullYear()}-${bw(n.getMonth()+1)}-${bw(n.getDate())}`,g1=n=>`${bw(n.getHours())}:${bw(n.getMinutes())}`;function o1e(n){let e=new Date(n.from),t=new Date(n.to);return fg(e)===fg(t)?`${fg(e)} ${g1(e)}\u2013${g1(t)}`:`${fg(e)} ${g1(e)} \u2013 ${fg(t)} ${g1(t)}`}function a1e(n,e,t){let i=r1e(e);if(i)return`${n} ${o1e(i)}`;let r=new Date(t);return`${n} (exported ${fg(r)} ${g1(r)})`}function bj(n,e,t){return e&&t?`${e} (${t})`:e||t||n.split(":").pop()}function rkt(n,e,t){let i=i1e(e);if(i.lines.length!==0)return{name:a1e(n,i.times,t),lines:i.lines,times:i.times}}function xj(n){return n.showAll?n.zoom>=n.minZoom:n.picked}function Lk(n){return n.trackDisplayed&&n1e(n.lines)?"displayed":n.historyShown?"history":null}function okt(n,e){return{feature:{type:"Feature",id:n,geometry:{type:"MultiLineString",coordinates:e.lines},properties:{name:e.name,coordTimes:e.times}}}}var xw=class n{app=M(oe);dialog=M(ln);skres=M(Mt);exportResources(){return this.open({routes:this.skres.routes(),tracks:[this.ownTrail()]})}exportOwnTrail(e="displayed"){return this.open({routes:[],tracks:[this.ownTrail()],tracksOnly:!0,initialChoice:e})}exportVesselTrack(e,t="displayed"){let i=this.vesselTrack(e);return i?this.open({routes:[],tracks:[i],tracksOnly:!0,initialChoice:t}):Promise.resolve()}ownTrail(){let e=this.app.data.vessels.self?.name;return{context:"self",label:e?`${e} trail`:"Vessel trail",displayed:vj(this.app.selfTrailFromServer().length>0,this.app.selfTrailTimed(),this.app.selfTrailFromServer(),this.app.localTrailTimed())}}tailOnly(e){let t=this.app.trackSource();return!(t?.api==="v2"?this.app.aisTracksTimed().has(e):t?.api==="v1"&&t.v1AisTracks)}vesselTrack(e){let t=this.app.data.vessels.aisTargets.get(e),i=this.app.data.vessels.aisTracks.get(e)??t?.track;if(!t&&!i)return;let r=this.app.aisTracksTimed().get(e);return{context:e,label:bj(e,t?.name,t?.mmsi),displayed:yj(i??[],r),tailOnly:this.tailOnly(e)}}open(e){return Y(this,null,function*(){let{GPXExportDialog:t}=yield import("./chunk-HR7N5JKE.js");return new Promise(i=>this.dialog.open(t,{disableClose:!0,data:e}).afterClosed().subscribe(r=>{r===0?this.app.showMsgBox("GPX Save",e.tracksOnly?"Track saved to GPX file successfully.":"Resources saved to GPX file successfully."):r>0&&this.app.showAlert("GPX Save","Error saving resources to GPX file!"),i()}))})}static \u0275fac=function(t){return new(t||n)};static \u0275prov=Je({token:n,factory:n.\u0275fac,providedIn:"root"})};function s1e(n,e){if(n&1){let t=H();u(0,"button",18),T("click",function(){O(t);let r=v();return F(r.handleMarkPosition())}),u(1,"mat-icon"),_(2,"add_location"),h()()}}function l1e(n,e){if(n&1){let t=H();u(0,"button",22),T("click",function(){O(t);let r=v(2);return F(r.toggleBuddy())}),u(1,"mat-icon"),_(2),h()()}if(n&2){let t=v(2);f(2),X(t.vessel().buddy?"group_remove":"group_add")}}function c1e(n,e){if(n&1){let t=H();u(0,"button",19),T("click",function(){O(t);let r=v();return F(r.toggleFlag())}),u(1,"mat-icon"),_(2),h()(),R(3,l1e,3,1,"button",20),u(4,"button",21),T("click",function(){O(t);let r=v();return F(r.focusVessel(!0))}),u(5,"mat-icon"),_(6,"center_focus_weak"),h()()}if(n&2){let t=v();w("matTooltip",t.isFlagged?"Un-flag vessel":"Flag vessel"),f(2),X(t.isFlagged?"clear_all":"flag"),f(),A(!t.isSelf()&&t.app.featureFlags().buddyList?3:-1)}}function d1e(n,e){if(n&1){let t=H();u(0,"button",23),T("click",function(){O(t);let r=v();return F(r.focusVessel(!1))}),u(1,"mat-icon"),_(2,"clear_all"),h()()}}function u1e(n,e){if(n&1){let t=H();u(0,"span",5)(1,"button",24),T("click",function(){O(t);let r=v();return F(r.toggleTrack())}),u(2,"mat-icon"),_(3),h()()()}if(n&2){let t=v(),i=t.app.isVesselTrackShown(t.vessel().id);w("matTooltip",t.app.config.vessels.aisShowTrack?'Turn off "Show all tracks" to enable':i?"Hide vessel track":"Show vessel track"),f(),w("disabled",t.app.config.vessels.aisShowTrack),f(2),X(i?"layers_clear":"route")}}function p1e(n,e){if(n&1){let t=H();As(0),u(1,"span",5)(2,"button",24),T("click",function(){O(t);let r=pa(0),o=v();return F(o.toggleHistory(r))}),u(3,"mat-icon"),_(4),h()()()}if(n&2){let t=v(),i=Ls(t.historyContext()),r=t.trackHistory.isShown(i),o=t.trackHistory.hasHistory(i)===!1;f(),w("matTooltip",r?"Hide track history":o?"No recorded track history":"Show track history"),f(),w("disabled",o&&!r),f(2),X(r?"history_toggle_off":"history")}}function h1e(n,e){if(n&1){let t=H();u(0,"button",19),T("click",function(){O(t);let r=v(),o=pa(8);return F(r.exportTrack(o))}),u(1,"mat-icon"),_(2,"download"),h()()}if(n&2){let t=v();w("matTooltip",t.isSelf()||!t.gpxExport.tailOnly(t.vessel().id)?"Export track to GPX":"Export track to GPX (only the positions gathered while Freeboard was open)")}}function m1e(n,e){if(n&1&&(u(0,"div",1)(1,"div",9),_(2,"Callsign (VHF):"),h(),z(3,"div",10),h()),n&2){let t=v();f(3),w("innerText",t.vessel().callsignVhf)}}function f1e(n,e){if(n&1&&(u(0,"div",1)(1,"div",9),_(2,"Callsign (HF):"),h(),z(3,"div",10),h()),n&2){let t=v();f(3),w("innerText",t.vessel().callsignHf)}}function g1e(n,e){if(n&1&&(u(0,"div",1)(1,"div",9),_(2,"Range:"),h(),u(3,"div",11),_(4),h()()),n&2){let t=v(2);f(4),K(" ",t.distToSelf," ")}}function _1e(n,e){if(n&1&&(u(0,"div",1)(1,"div",9),_(2,"CPA:"),h(),u(3,"div",11),_(4),h()(),u(5,"div",1)(6,"div",9),_(7,"TCPA:"),h(),u(8,"div",11),_(9),h()()),n&2){let t=v(2);f(4),K(" ",t.cpa??"--"," "),f(5),K(" ",t.tcpa??"--"," ")}}function y1e(n,e){if(n&1&&(R(0,g1e,5,1,"div",1),R(1,_1e,10,2)),n&2){let t=v();A(t.vessel().distanceToSelf?0:-1),f(),A(t.vessel().closestApproach?1:-1)}}var Cw=class n{title=Z();vessel=Z();useMagnetic=Z();isActive=Z();isSelf=Z();canClose=Z();info=xe();closed=xe();focused=xe();markPosition=xe();_title;_icon;convert=Ue;timeLastUpdate;timeAgo;speedUnits;distToSelf;cpa;tcpa;position=[0,0];positionTimestamp="";isFlagged=!1;app=M(oe);buddies=M(mw);trackHistory=M(Uu);gpxExport=M(xw);destroyRef=M(gi);historyContext(){return this.isSelf()?"self":this.vessel().id}windSpeed(e,t){return Number.isFinite(e)?this.app.formatValueForDisplay(e,"m/s",{path:t}):"--"}constructor(){this.trackHistory.refreshRecorded(),Me(()=>{if(!this.vessel()){this.handleClose();return}if(this.isFlagged=this.app.data.vessels.flagged.includes(this.vessel().id),this._title=this.title()??this.vessel().name??this.vessel().mmsi??this.vessel().callsignVhf??this.vessel().callsignHf??"Vessel:",this._icon=this.vessel().type?.id?xa(this.vessel().type?.id):{name:"directions_boat",svgIcon:void 0},this.position=[this.vessel().position[0],this.vessel().position[1]],this.position=ri.normaliseCoords(this.position),this.vessel().positionTimestamp){let t=new Date(this.vessel().positionTimestamp);this.positionTimestamp=`${t.getHours()}:${("00"+t.getMinutes()).slice(-2)}`}this.timeLastUpdate=`${this.vessel().lastUpdated.getHours()}:${("00"+this.vessel().lastUpdated.getMinutes()).slice(-2)}`;let e=(new Date().valueOf()-this.vessel().lastUpdated.valueOf())/1e3;this.timeAgo=e<60?"":`(${Math.floor(e/60)} min ago)`,this.distToSelf=this.app.formatValueForDisplay(this.vessel().distanceToSelf,"m"),this.vessel().closestApproach&&(typeof this.vessel().closestApproach.distance=="number"&&(this.cpa=this.app.formatValueForDisplay(this.vessel().closestApproach.distance,"m")),typeof this.vessel().closestApproach.timeTo=="number"&&(this.tcpa=this.app.formatValueForDisplay(this.vessel().closestApproach.timeTo,"s")))})}ngOnInit(){if(!this.vessel()){this.handleClose();return}this.isFlagged=this.app.data.vessels.flagged.includes(this.vessel().id)}handleMarkPosition(){this.markPosition.emit(this.vessel().position)}handleInfo(){this.info.emit(this.vessel().id)}focusVessel(e){this.removeFlag(),this.focused.emit(e)}toggleBuddy(){let e=this.vessel().id.split(".").slice(1).join(".");if(this.vessel().buddy)this.buddies.remove(e).pipe(Zt(this.destroyRef)).subscribe(()=>{this.app.showMessage("Buddy successfully removed.",!1,3e3)},()=>{this.app.showMessage("Error removing buddy!",!1,3e3)});else{let t=this.vessel().name??this.vessel().mmsi??this.vessel().callsignVhf??e.slice(-5);this.buddies.add(e,t).pipe(Zt(this.destroyRef)).subscribe(()=>{this.app.showMessage(`Buddy added (${t})`,!1,3e3)},()=>{this.app.showMessage(`Error adding buddy!(${t})`,!1,5e3)})}}toggleTrack(){this.app.toggleVesselTrack(this.vessel().id)}trackExportOffer(){if(this.isSelf())return Lk({trackDisplayed:this.app.config.vessels.trail,lines:this.gpxExport.ownTrail().displayed.lines,historyShown:this.trackHistory.available()&&this.trackHistory.isShown("self")});let e=this.vessel().id;return Lk({trackDisplayed:xj({showAll:this.app.config.vessels.aisShowTrack,picked:this.app.isVesselTrackShown(e),zoom:this.app.mapZoom(),minZoom:Y1}),lines:this.app.data.vessels.aisTracks.get(e),historyShown:this.trackHistory.available()&&this.trackHistory.isShown(e)})}exportTrack(e){this.isSelf()?this.gpxExport.exportOwnTrail(e):this.gpxExport.exportVesselTrack(this.vessel().id,e)}toggleHistory(e){let t=!this.trackHistory.isShown(e);this.trackHistory.toggle(e),t&&this.handleClose()}toggleFlag(){this.isFlagged?this.removeFlag():this.app.data.vessels.flagged.includes(this.vessel().id)||(this.app.data.vessels.flagged=[this.vessel().id].concat(this.app.data.vessels.flagged)),this.isFlagged=!this.isFlagged,this.closed.emit()}removeFlag(){this.app.data.vessels.flagged.includes(this.vessel().id)&&(this.app.data.vessels.flagged.splice(this.app.data.vessels.flagged.indexOf(this.vessel().id),1),this.app.data.vessels.flagged=[].concat(this.app.data.vessels.flagged))}handleClose(){this.closed.emit()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["vessel-popover"]],inputs:{title:[1,"title"],vessel:[1,"vessel"],useMagnetic:[1,"useMagnetic"],isActive:[1,"isActive"],isSelf:[1,"isSelf"],canClose:[1,"canClose"]},outputs:{info:"info",closed:"closed",focused:"focused",markPosition:"markPosition"},decls:56,vars:32,consts:[[3,"closed","title","mmsi","icon","canClose"],[2,"display","flex"],[2,"flex","1 1 auto"],["mat-icon-button","","matTooltip","Add Waypoint at vessel location"],["mat-icon-button","","matTooltip","Clear vessel focus"],[3,"matTooltip"],["mat-icon-button","",3,"matTooltip"],[2,"text-align","right"],["mat-icon-button","","matTooltip","Show Properties",3,"click"],[2,"font-weight","bold"],[2,"flex","1 1 auto","text-align","right",3,"innerText"],[2,"flex","1 1 auto","text-align","right"],[2,"display","flex","flex-wrap","no-wrap"],[2,"width","120px"],[3,"heading","windtrue","windapparent","speed","speedunits"],[2,"text-align","right","flex","auto"],[2,"border-right","olive 10px solid","padding-left","5px"],[2,"border-right","rgb(16, 75, 16) 10px solid",";padding-left","5px"],["mat-icon-button","","matTooltip","Add Waypoint at vessel location",3,"click"],["mat-icon-button","",3,"click","matTooltip"],["mat-icon-button","","matTooltip","Is Buddy"],["mat-icon-button","","matTooltip","Focus vessel",3,"click"],["mat-icon-button","","matTooltip","Is Buddy",3,"click"],["mat-icon-button","","matTooltip","Clear vessel focus",3,"click"],["mat-icon-button","",3,"click","disabled"]],template:function(t,i){if(t&1&&(u(0,"ap-popover",0),T("closed",function(){return i.handleClose()}),u(1,"div",1)(2,"div",2),R(3,s1e,3,0,"button",3)(4,c1e,7,3),R(5,d1e,3,0,"button",4),R(6,u1e,4,3,"span",5),R(7,p1e,5,4,"span",5),As(8),R(9,h1e,3,1,"button",6),h(),u(10,"div",7)(11,"button",8),T("click",function(){return i.handleInfo()}),u(12,"mat-icon"),_(13,"info_outline"),h()()()(),z(14,"mat-divider"),R(15,m1e,4,1,"div",1)(16,f1e,4,1,"div",1),u(17,"div",1)(18,"div",9),_(19,"Latitude:"),h(),z(20,"div",10),bt(21,"coords"),h(),u(22,"div",1)(23,"div",9),_(24,"Longitude:"),h(),z(25,"div",10),bt(26,"coords"),h(),u(27,"div",1)(28,"div",9),_(29,"Last Position:"),h(),u(30,"div",11),_(31),h()(),R(32,y1e,2,2),u(33,"div",1)(34,"div",9),_(35,"Last Update:"),h(),u(36,"div",11),_(37),h()(),u(38,"div",12)(39,"div",13),z(40,"ap-compass",14),h(),u(41,"div",15),_(42," \xA0"),z(43,"br"),u(44,"div")(45,"div",16)(46,"span",9),_(47),h()(),u(48,"div",11),_(49),h()(),u(50,"div")(51,"div",17)(52,"span",9),_(53," Wind (A):"),h()(),u(54,"div",11),_(55),h()()()()()),t&2){w("title",i._title)("mmsi",i.vessel().mmsi)("icon",i._icon)("canClose",i.canClose()),f(3),A(i.isActive()?3:4),f(2),A(i.isActive()&&!i.isSelf()?5:-1),f(),A(i.isSelf()?-1:6),f(),A(i.trackHistory.available()?7:-1),f();let r=Ls(i.trackExportOffer());f(),A(r?9:-1),f(6),A(i.vessel().callsignVhf?15:i.vessel().callsignHf?16:-1),f(5),w("innerText",Mi(21,25,i.position[1],i.app.config.units.positionFormat,!0)),f(5),w("innerText",$n(26,29,i.position[0],i.app.config.units.positionFormat)),f(6),K(" ",i.positionTimestamp," "),f(),A(i.isSelf()?-1:32),f(5),Nr(" ",i.timeLastUpdate," ",i.timeAgo," "),f(3),w("heading",i.convert.radiansToDegrees(i.vessel().orientation))("windtrue",i.vessel().wind.direction!==null?i.convert.radiansToDegrees(i.vessel().wind.direction):null)("windapparent",i.vessel().wind.awa!==null?i.convert.radiansToDegrees(i.vessel().wind.awa):null)("speed",i.app.formatSpeed(i.vessel().sog))("speedunits",i.app.formattedSpeedUnits),f(7),K(" Wind (",i.useMagnetic()?"M":"T","):"),f(2),K(" ",i.windSpeed(i.vessel().wind.tws,i.app.twsDisplayUnitPath())," "),f(6),K(" ",i.windSpeed(i.vessel().wind.aws,"environment.wind.speedApparent")," ")}},dependencies:[ue,Fe,ye,Te,se,ce,Pa,jn,yw,Qi],encapsulation:2,changeDetection:0})};var v1e=n=>({"icon-warn":n});function b1e(n,e){if(n&1&&z(0,"mat-icon",4),n&2){let t=v().$implicit;Et(t.icon.class),w("svgIcon",t.icon.svgIcon)}}function x1e(n,e){if(n&1&&(u(0,"mat-icon",5),_(1),h()),n&2){let t=v().$implicit;Et(t.icon.class),w("ngClass",Gi(4,v1e,t.text&&t.text.indexOf("self")!==-1)),f(),K(" ",t.icon.name," ")}}function C1e(n,e){if(n&1){let t=H();u(0,"mat-list-item",1),T("click",function(){let r=O(t).$implicit,o=v();return F(o.handleSelect(r))}),R(1,b1e,1,3,"mat-icon",2)(2,x1e,2,6,"mat-icon",3),_(3),h()}if(n&2){let t=e.$implicit;f(),A(t.icon.svgIcon?1:2),f(2),K(" ",t.text," ")}}var ww=class n{title=Z();features=Z([]);canClose=Z();closed=xe();selected=xe();handleSelect(e){this.selected.emit(e)}handleClose(){this.closed.emit()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["feature-list-popover"]],inputs:{title:[1,"title"],features:[1,"features"],canClose:[1,"canClose"]},outputs:{closed:"closed",selected:"selected"},decls:4,vars:2,consts:[[3,"closed","title","canClose"],[3,"click"],[3,"svgIcon","class"],[3,"class","ngClass"],[3,"svgIcon"],[3,"ngClass"]],template:function(t,i){t&1&&(u(0,"ap-popover",0),T("closed",function(){return i.handleClose()}),u(1,"mat-nav-list"),Ae(2,C1e,4,2,"mat-list-item",null,wt),h()()),t&2&&(w("title",i.title())("canClose",i.canClose()),f(2),Le(i.features()))},dependencies:[mn,Rn,An,Vs,mo,ue,ye,se,ce,jn],encapsulation:2,changeDetection:0})};var w1e=()=>({name:"map"});function M1e(n,e){if(n&1){let t=H();u(0,"mat-list-item",1),T("click",function(){let r=O(t).$implicit,o=v();return F(o.handleSelect(r.id))}),u(1,"mat-icon"),_(2,"map"),h(),_(3),h()}if(n&2){let t=e.$implicit;f(3),K(" ",t.text," ")}}var Mw=class n{features=Z([]);canClose=Z();closed=xe();selected=xe();title="Click to Show / Hide Chart";handleSelect(e){this.selected.emit(e)}handleClose(){this.closed.emit()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["chart-list-popover"]],inputs:{features:[1,"features"],canClose:[1,"canClose"]},outputs:{closed:"closed",selected:"selected"},decls:4,vars:4,consts:[[3,"closed","title","canClose","icon"],[3,"click"]],template:function(t,i){t&1&&(u(0,"ap-popover",0),T("closed",function(){return i.handleClose()}),u(1,"mat-nav-list"),Ae(2,M1e,4,1,"mat-list-item",null,wt),h()()),t&2&&(w("title",i.title)("canClose",i.canClose())("icon",kr(3,w1e)),f(2),Le(i.features()))},dependencies:[An,Vs,mo,ue,ye,se,ce,jn],encapsulation:2,changeDetection:0})};var Sw=class n{title;aircraft;canClose;info=new me;closed=new me;_title;timeLastUpdate;timeAgo;app=M(oe);constructor(){}ngOnInit(){this.aircraft?this._title=this.title||this.aircraft.name||this.aircraft.mmsi||"Aircraft:":this.handleClose()}ngOnChanges(){if(!this.aircraft){this.handleClose();return}this.timeLastUpdate=`${this.aircraft.lastUpdated.getHours()}:${("00"+this.aircraft.lastUpdated.getMinutes()).slice(-2)}`;let e=(new Date().valueOf()-this.aircraft.lastUpdated.valueOf())/1e3;this.timeAgo=e<60?"":`(${Math.floor(e/60)} min ago)`}handleInfo(){this.info.emit(this.aircraft.id)}handleClose(){this.closed.emit()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["aircraft-popover"]],inputs:{title:"title",aircraft:"aircraft",canClose:"canClose"},outputs:{info:"info",closed:"closed"},features:[Se],decls:39,vars:16,consts:[[3,"closed","title","canClose"],[2,"display","flex"],[2,"font-weight","bold"],[2,"flex","1 1 auto","text-align","right"],[2,"flex","1 1 auto","text-align","right",3,"innerText"],[2,"flex","1 1 auto"],[1,"popover-action-button"],["mat-button","","matTooltip","Show Properties",3,"click"]],template:function(t,i){t&1&&(u(0,"ap-popover",0),T("closed",function(){return i.handleClose()}),u(1,"div",1)(2,"div",2),_(3,"Name:"),h(),u(4,"div",3),_(5),h()(),u(6,"div",1)(7,"div",2),_(8,"Call sign VHF:"),h(),u(9,"div",3),_(10),h()(),u(11,"div",1)(12,"div",2),_(13,"Call sign HF:"),h(),u(14,"div",3),_(15),h()(),u(16,"div",1)(17,"div",2),_(18,"Latitude:"),h(),z(19,"div",4),bt(20,"coords"),h(),u(21,"div",1)(22,"div",2),_(23,"Longitude:"),h(),z(24,"div",4),bt(25,"coords"),h(),u(26,"div",1)(27,"div",2),_(28,"Last Update:"),h(),u(29,"div",3),_(30),h()(),u(31,"div",1)(32,"div",5),_(33,"\xA0"),h(),u(34,"div",6)(35,"button",7),T("click",function(){return i.handleInfo()}),u(36,"mat-icon"),_(37,"info_outline"),h(),_(38," INFO "),h()()()()),t&2&&(w("title",i._title)("canClose",i.canClose),f(5),X(i.aircraft.name),f(5),K(" ",i.aircraft.callsignVhf," "),f(5),K(" ",i.aircraft.callsignHf," "),f(4),w("innerText",Mi(20,9,i.aircraft.position[1],i.app.config.units.positionFormat,!0)),f(5),w("innerText",$n(25,13,i.aircraft.position[0],i.app.config.units.positionFormat)),f(6),Nr(" ",i.timeLastUpdate," ",i.timeAgo," "))},dependencies:[ue,Ze,ye,Te,se,ce,jn,Qi],encapsulation:2,changeDetection:0})};var Tw=class n{title=Z();id=Z();alarm=Z();canClose=Z();info=xe();goto=xe();closed=xe();_title;app=M(oe);constructor(){Me(()=>{if(this.id(),!this.alarm()){this.handleClose();return}})}ngOnInit(){this.alarm()?this._title=this.title()||"Alarm:":this.handleClose()}handleInfo(){this.info.emit(this.alarm().path)}handleGoto(){this.goto.emit([this.alarm().properties.position.longitude,this.alarm().properties.position.latitude])}handleClose(){this.closed.emit()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["alarm-popover"]],inputs:{title:[1,"title"],id:[1,"id"],alarm:[1,"alarm"],canClose:[1,"canClose"]},outputs:{info:"info",goto:"goto",closed:"closed"},decls:34,vars:15,consts:[[3,"closed","title","canClose","icon"],[2,"display","flex"],[2,"font-weight","bold"],[2,"flex","1 1 auto","text-align","left","padding-left","5px","overflow","hidden","display","-webkit-box","-webkit-box-orient","vertical","-webkit-line-clamp","2","line-clamp","2","text-overflow","ellipsis"],[2,"flex","1 1 auto","text-align","right"],[2,"flex","1 1 auto","text-align","right",3,"innerText"],[2,"flex","1 1 auto"],[1,"popover-action-button"],["mat-button","","matTooltip","Navigate to here",3,"click"],["mat-button","","matTooltip","Show Properties",3,"click"]],template:function(t,i){t&1&&(u(0,"ap-popover",0),T("closed",function(){return i.handleClose()}),u(1,"div",1)(2,"div",2),_(3,"Message:"),h(),u(4,"div",3),_(5),h()(),u(6,"div",1)(7,"div",2),_(8,"Type:"),h(),u(9,"div",4),_(10),h()(),u(11,"div",1)(12,"div",2),_(13,"Latitude:"),h(),z(14,"div",5),bt(15,"coords"),h(),u(16,"div",1)(17,"div",2),_(18,"Longitude:"),h(),z(19,"div",5),bt(20,"coords"),h(),u(21,"div",1)(22,"div",6),_(23,"\xA0"),h(),u(24,"div",7)(25,"button",8),T("click",function(){return i.handleGoto()}),u(26,"mat-icon"),_(27,"near_me"),h(),_(28," GO TO "),h()(),u(29,"div",7)(30,"button",9),T("click",function(){return i.handleInfo()}),u(31,"mat-icon"),_(32,"info_outline"),h(),_(33," INFO "),h()()()()),t&2&&(w("title",i._title)("canClose",i.canClose())("icon",i.alarm().icon),f(5),K(" ",i.alarm().message," "),f(5),X(i.alarm().type),f(4),w("innerText",Mi(15,7,i.alarm().properties.position.latitude,i.app.config.units.positionFormat,!0)),f(5),w("innerText",Mi(20,11,i.alarm().properties.position.longitude,i.app.config.units.positionFormat,!1)))},dependencies:[ue,Ze,ye,Te,se,ce,jn,Qi],encapsulation:2,changeDetection:0})};function S1e(n,e){if(n&1&&(u(0,"div",1)(1,"div",2),_(2,"Temperature:"),h(),u(3,"div",3),_(4),h()()),n&2){let t=v();f(4),K(" ",t.app.formatValueForDisplay(t.aton().temperature,"K")," ")}}function T1e(n,e){if(n&1&&(u(0,"div",5)(1,"div",2),_(2,"Wind:"),h(),u(3,"div",9),z(4,"ap-compass-northup",10),h()()),n&2){let t=v();f(4),w("heading",t.convert.radiansToDegrees(t.aton().twd))("speed",t.app.formatSpeed(t.aton().tws))("label",t.app.formattedSpeedUnits)("windtrue",!0)}}var Ew=class n{title=Z();aton=Z();canClose=Z();info=xe();closed=xe();_title;_icon;timeLastUpdate;timeAgo;convert=Ue;isMeteo;app=M(oe);constructor(){Me(()=>{if(!this.aton()){this.handleClose();return}this._title=this.title()||this.aton().name||this.aton().mmsi||"AtoN:",this.isMeteo=this.aton().id.includes("meteo"),this._icon={name:this.isMeteo?"air":"beenhere",svgIcon:void 0},this.timeLastUpdate=`${this.aton().lastUpdated.getHours()}:${("00"+this.aton().lastUpdated.getMinutes()).slice(-2)}`;let e=(new Date().valueOf()-this.aton().lastUpdated.valueOf())/1e3;this.timeAgo=e<60?"":`(${Math.floor(e/60)} min ago)`})}ngOnInit(){this.aton()?(this.isMeteo=this.aton().id.includes("meteo"),this._icon={name:this.isMeteo?"air":"beenhere",svgIcon:void 0}):this.handleClose()}handleInfo(){this.info.emit(this.aton().id)}handleClose(){this.closed.emit()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["aton-popover"]],inputs:{title:[1,"title"],aton:[1,"aton"],canClose:[1,"canClose"]},outputs:{info:"info",closed:"closed"},decls:31,vars:17,consts:[[3,"closed","title","canClose","icon"],[2,"display","flex"],[2,"font-weight","bold"],[2,"flex","1 1 auto","text-align","right"],[2,"flex","1 1 auto","text-align","right",3,"innerText"],[2,"display","flex","flex-wrap","no-wrap"],[2,"flex","1 1 auto"],[1,"popover-action-button"],["mat-button","","matTooltip","Show Properties",3,"click"],[2,"width","150px"],[3,"heading","speed","label","windtrue"]],template:function(t,i){t&1&&(u(0,"ap-popover",0),T("closed",function(){return i.handleClose()}),u(1,"div",1)(2,"div",2),_(3,"Type:"),h(),u(4,"div",3),_(5),h()(),u(6,"div",1)(7,"div",2),_(8,"Latitude:"),h(),z(9,"div",4),bt(10,"coords"),h(),u(11,"div",1)(12,"div",2),_(13,"Longitude:"),h(),z(14,"div",4),bt(15,"coords"),h(),u(16,"div",1)(17,"div",2),_(18,"Last Update:"),h(),u(19,"div",3),_(20),h()(),R(21,S1e,5,1,"div",1),R(22,T1e,5,4,"div",5),u(23,"div",1)(24,"div",6),_(25,"\xA0"),h(),u(26,"div",7)(27,"button",8),T("click",function(){return i.handleInfo()}),u(28,"mat-icon"),_(29,"info_outline"),h(),_(30," INFO "),h()()()()),t&2&&(w("title",i._title)("canClose",i.canClose())("icon",i._icon),f(5),K(" ",i.aton().type.name," "),f(4),w("innerText",Mi(10,10,i.aton().position[1],i.app.config.units.positionFormat,!0)),f(5),w("innerText",$n(15,14,i.aton().position[0],i.app.config.units.positionFormat)),f(6),Nr(" ",i.timeLastUpdate," ",i.timeAgo," "),f(),A(i.isMeteo&&i.aton().temperature!==void 0?21:-1),f(),A(i.isMeteo&&i.aton().tws!==void 0&&i.aton().twd!==void 0?22:-1))},dependencies:[ue,Ze,ye,Te,se,ce,jn,vw,Qi],encapsulation:2,changeDetection:0})};var E1e=(n,e)=>e.key;function I1e(n,e){if(n&1&&(u(0,"div",1)(1,"div",3),_(2),h(),u(3,"div",4),_(4),h()()),n&2){let t=e.$implicit;f(2),K(" ",t.label,": "),f(2),X(t.value)}}function k1e(n,e){n&1&&(u(0,"div",2),_(1,"No details available"),h())}var Ok={SOUNDG:"Sounding",DEPCNT:"Depth Contour",OBSTRN:"Obstruction",UWTROC:"Underwater Rock",WRECKS:"Wreck",LIGHTS:"Light",BOYLAT:"Lateral Buoy",BOYCAR:"Cardinal Buoy",BOYISD:"Isolated Danger Buoy",BOYSAW:"Safe Water Buoy",BOYSPP:"Special Purpose Buoy",BCNLAT:"Lateral Beacon",BCNCAR:"Cardinal Beacon",BCNISD:"Isolated Danger Beacon",BCNSAW:"Safe Water Beacon",BCNSPP:"Special Purpose Beacon",LNDMRK:"Landmark",SLCONS:"Shoreline Construction",RESARE:"Restricted Area",ACHARE:"Anchorage Area",CBLSUB:"Submarine Cable",PIPSOL:"Submarine Pipeline",BERTHS:"Berth",MORFAC:"Mooring Facility",DISMAR:"Distance Mark",CURENT:"Current",TOPMAR:"Top Mark",RTPBCN:"Radar Transponder Beacon",RDOSTA:"Radio Station",RADSTA:"Radar Station",FOGSIG:"Fog Signal",PILBOP:"Pilot Boarding Place",CGUSTA:"Coast Guard Station",RSCSTA:"Rescue Station",SISTAT:"Signal Station",SISTAW:"Signal Station Warning",HRBFAC:"Harbour Facility",SMCFAC:"Small Craft Facility",CRANES:"Crane",GATCON:"Gate",BRIDGE:"Bridge",CONVYR:"Conveyor",PIPOHD:"Overhead Pipeline",CBLOHD:"Overhead Cable",OFSPLF:"Offshore Platform",LITFLT:"Light Float",LITVES:"Light Vessel",FSHFAC:"Fishing Facility"},Cj=new Set(["LIGHTS","BOYLAT","BOYCAR","BOYISD","BOYSAW","BOYSPP","BCNLAT","BCNCAR","BCNISD","BCNSAW","BCNSPP","TOPMAR","RTPBCN","RDOSTA","RADSTA","FOGSIG","LITFLT","LITVES","OBSTRN","UWTROC","WRECKS","LNDMRK","SLCONS","BRIDGE","OFSPLF","PILBOP","CRANES","GATCON","MORFAC","BERTHS","HRBFAC","SMCFAC","CBLSUB","CBLOHD","PIPSOL","PIPOHD","CGUSTA","RSCSTA","SISTAT","SISTAW","DISMAR","CURENT","FSHFAC","CONVYR","RESARE","ACHARE"]),D1e={1:"White",2:"Black",3:"Red",4:"Green",5:"Blue",6:"Yellow",7:"Grey",8:"Brown",9:"Amber",10:"Violet",11:"Orange",12:"Magenta",13:"Pink"},P1e={1:"Partly submerged",2:"Always dry",3:"Always under water",4:"Covers and uncovers",5:"Awash",6:"Subject to flooding",7:"Floating"},R1e={1:"Snag/stump",2:"Wellhead",3:"Diffuser",4:"Crib",5:"Fish haven",6:"Foul area",7:"Foul ground",8:"Ice boom",9:"Ground tackle",10:"Boom"},A1e={1:"Non-dangerous",2:"Dangerous",3:"Distributed remains",4:"Mast showing",5:"Hull showing"},L1e={1:"Conical (nun)",2:"Can (cylindrical)",3:"Spherical",4:"Pillar",5:"Spar",6:"Barrel",7:"Super-buoy",8:"Ice buoy"},O1e={1:"Stake/pole",2:"Withy",3:"Tower",4:"Lattice",5:"Pile",6:"Cairn",7:"Buoyant"},F1e={1:"Port",2:"Starboard",3:"Preferred channel starboard",4:"Preferred channel port"},N1e={1:"Directional",4:"Leading",5:"Aero",6:"Air obstruction",7:"Fog detector",8:"Flood",9:"Strip",10:"Subsidiary",11:"Spotlight",12:"Front",13:"Rear",14:"Lower",15:"Upper"},B1e={1:"Fixed",2:"Flashing",3:"Long flashing",4:"Quick flashing",5:"Very quick flashing",6:"Ultra quick flashing",7:"Isophase",8:"Occulting",9:"Interrupted quick",10:"Interrupted very quick",11:"Morse code",12:"Fixed/flashing",25:"Quick + long flash",26:"VQ + long flash",27:"UQ + long flash",28:"Alternating",29:"Fixed & alternating flashing"},V1e={1:"Under construction",2:"Ruined",3:"Under reclamation",5:"Planned"},G1e={1:"Permanent",2:"Occasional",3:"Recommended",4:"Not in use",5:"Intermittent",6:"Reserved",7:"Temporary",8:"Private",9:"Mandatory",11:"Extinguished",12:"Illuminated",13:"Historic",14:"Public",15:"Synchronized",16:"Watched",17:"Un-watched",18:"Doubtful"},z1e={1:"Anchoring prohibited",2:"Anchoring restricted",3:"Fishing prohibited",4:"Fishing restricted",5:"Trawling prohibited",6:"Trawling restricted",7:"Entry prohibited",8:"Entry restricted",9:"Dredging prohibited",10:"Dredging restricted",11:"Diving prohibited",12:"Diving restricted",13:"No wake",14:"Area to be avoided",27:"Speed restricted"},j1e={1:"Horizontal stripes",2:"Vertical stripes",3:"Diagonal stripes",4:"Squared",5:"Border stripes",6:"Single colour"},U1e={1:"Cone, point up",2:"Cone, point down",3:"Sphere",4:"Two spheres",5:"Cylinder",6:"Board",7:"X-shape",8:"Upright cross",9:"Cube, point up",10:"Two cones point to point",11:"Two cones base to base",12:"Rhombus",13:"Two cones point up",14:"Two cones point down",33:"Flag"},W1e={1:"North",2:"East",3:"South",4:"West"},H1e={1:"Firing danger area",2:"Target",3:"Marker ship",4:"Degaussing range",5:"Barge",6:"Cable",7:"Spoil ground",8:"Outfall",9:"ODAS",10:"Recording",11:"Seaplane anchorage",12:"Recreation zone",13:"Private",14:"Mooring",15:"LANBY",16:"Leading",17:"Measured distance",18:"Notice",19:"TSS",20:"No anchoring",21:"No berthing",22:"No overtaking",23:"No two-way traffic",24:"Reduced wake",25:"Speed limit",26:"Stop",27:"Warning",28:"Sound ship siren",39:"Environmental",45:"AIS",51:"No entry"},$1e={COLOUR:D1e,WATLEV:P1e,CATOBS:R1e,CATWRK:A1e,BOYSHP:L1e,BCNSHP:O1e,CATLAM:F1e,CATLIT:N1e,LITCHR:B1e,CONDTN:V1e,STATUS:G1e,RESTRN:z1e,COLPAT:j1e,TOPSHP:U1e,CATCAM:W1e,CATSPM:H1e},K1e=[{key:"OBJNAM",label:"Name"},{key:"NOBJNM",label:"Local Name"},{key:"INFORM",label:"Information"},{key:"NINFOM",label:"Note"},{key:"DEPTH",label:"Depth"},{key:"VALSOU",label:"Depth"},{key:"DRVAL1",label:"Min Depth"},{key:"DRVAL2",label:"Max Depth"},{key:"VALDCO",label:"Contour Depth"},{key:"CATWRK",label:"Type"},{key:"CATOBS",label:"Type"},{key:"WATLEV",label:"Water Level"},{key:"CATLAM",label:"Lateral"},{key:"CATCAM",label:"Cardinal"},{key:"CATSPM",label:"Purpose"},{key:"BOYSHP",label:"Shape"},{key:"BCNSHP",label:"Shape"},{key:"TOPSHP",label:"Top Mark"},{key:"COLOUR",label:"Colour"},{key:"COLPAT",label:"Pattern"},{key:"LITCHR",label:"Character"},{key:"CATLIT",label:"Category"},{key:"SIGPER",label:"Period"},{key:"VALNMR",label:"Range"},{key:"HEIGHT",label:"Height"},{key:"RESTRN",label:"Restriction"},{key:"CONDTN",label:"Condition"},{key:"STATUS",label:"Status"},{key:"CONRAD",label:"Radar Conspicuous"},{key:"CONVIS",label:"Visually Conspicuous"},{key:"VERLEN",label:"Vertical Clearance"},{key:"HORLEN",label:"Length"},{key:"HORWID",label:"Width"}];function q1e(n){if(Array.isArray(n))return n.map(t=>String(t).trim()).filter(t=>t!=="");let e=String(n).trim();if(e===""||e==="[]")return[];if(e.startsWith("[")&&e.endsWith("]"))try{let t=JSON.parse(e);if(Array.isArray(t))return t.map(i=>String(i).trim()).filter(i=>i!=="")}catch(t){}return e.split(",").map(t=>t.trim()).filter(t=>t!=="")}function Z1e(n,e){let t=q1e(e);if(t.length===0)return"";let i=$1e[n];return i?t.map(r=>i[r]||r).join(", "):t.join(", ")}var X1e=new Set(["DEPTH","VALSOU","DRVAL1","DRVAL2","VALDCO"]),Y1e=new Set(["HEIGHT","VERLEN","HORLEN","HORWID"]),Iw=class n{title=Z();properties=Z();canClose=Z();closed=xe();app=M(oe);_title;displayProps=[];constructor(){Me(()=>{if(!this.properties())return;let e=this.properties().layer||"";this._title=this.title()||Ok[e]||e||"Chart Feature",this.displayProps=[];for(let t of K1e){let i=this.properties()[t.key];i==null||i===""||this.displayProps.push({key:t.key,label:t.label,value:this.formatValue(t.key,i)})}})}formatValue(e,t){if(X1e.has(e)){let i=parseFloat(String(t));return isNaN(i)?String(t):this.app.formatValueForDisplay(i,"m",{category:"depth"})}if(Y1e.has(e)){let i=parseFloat(String(t));return isNaN(i)?String(t):this.app.formatValueForDisplay(i,"m",{category:"length"})}if(e==="SIGPER"){let i=parseFloat(String(t));return isNaN(i)?String(t):i+"s"}if(e==="VALNMR"){let i=parseFloat(String(t));return isNaN(i)?String(t):i+" NM"}return e==="CONRAD"||e==="CONVIS"?t===1||t==="1"?"Yes":"No":Z1e(e,t)}handleClose(){this.closed.emit()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["s57-popover"]],inputs:{title:[1,"title"],properties:[1,"properties"],canClose:[1,"canClose"]},outputs:{closed:"closed"},decls:4,vars:3,consts:[[3,"closed","title","canClose"],[2,"display","flex","padding","2px 0"],[2,"color","#888"],[2,"font-weight","bold","min-width","100px"],[2,"flex","1 1 auto","text-align","right"]],template:function(t,i){t&1&&(u(0,"ap-popover",0),T("closed",function(){return i.handleClose()}),Ae(1,I1e,5,2,"div",1,E1e),R(3,k1e,2,0,"div",2),h()),t&2&&(w("title",i._title)("canClose",i.canClose()),f(),Le(i.displayProps),f(2),A(i.displayProps.length===0?3:-1))},dependencies:[mn,ue,se,jn],encapsulation:2,changeDetection:0})};function Q1e(n,e){n&1&&_(0," (next) ")}function J1e(n,e){if(n&1&&(u(0,"div",1)(1,"div",2),_(2,"Latitude:"),h(),z(3,"div",8),bt(4,"coords"),h(),u(5,"div",1)(6,"div",2),_(7,"Longitude:"),h(),z(8,"div",8),bt(9,"coords"),h()),n&2){let t=v();f(3),w("innerText",Mi(4,2,t.point().position[1],t.app.config.units.positionFormat,!0)),f(5),w("innerText",Mi(9,6,t.point().position[0],t.app.config.units.positionFormat,!1))}}function eye(n,e){if(n&1){let t=H();u(0,"div",6)(1,"button",9),T("click",function(){O(t);let r=v();return F(r.skip.emit(r.point().index))}),u(2,"mat-icon"),_(3,"skip_next"),h(),_(4," SKIP "),h()()}}var kw=class n{point=Z.required();canClose=Z();rejoin=xe();skip=xe();closed=xe();app=M(oe);icon={class:"icon-route",name:"location_on"};canSkip(){return this.point().isNext&&this.point().index<this.point().total-1}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["route-point-popover"]],inputs:{point:[1,"point"],canClose:[1,"canClose"]},outputs:{rejoin:"rejoin",skip:"skip",closed:"closed"},decls:17,vars:8,consts:[[3,"closed","title","canClose","icon"],[2,"display","flex"],[2,"font-weight","bold"],[2,"flex","1 1 auto","text-align","right"],[2,"display","flex","flex-wrap","wrap"],[2,"flex","1 1 auto"],[1,"popover-action-button"],["mat-button","","matTooltip","Go straight to this point, then follow the route on","matTooltipPosition","after",3,"click"],[2,"flex","1 1 auto","text-align","right",3,"innerText"],["mat-button","","matTooltip","Go straight to the point after this one","matTooltipPosition","after",3,"click"]],template:function(t,i){t&1&&(u(0,"ap-popover",0),T("closed",function(){return i.closed.emit()}),u(1,"div",1)(2,"div",2),_(3,"Point:"),h(),u(4,"div",3),_(5),R(6,Q1e,1,0),h()(),R(7,J1e,10,10),u(8,"div",4)(9,"div",5),_(10,"\xA0"),h(),u(11,"div",6)(12,"button",7),T("click",function(){return i.rejoin.emit(i.point().index)}),u(13,"mat-icon"),_(14,"near_me"),h(),_(15," REJOIN HERE "),h()(),R(16,eye,5,0,"div",6),h()()),t&2&&(w("title",i.point().name||"Route point")("canClose",i.canClose())("icon",i.icon),f(5),Nr(" ",i.point().index+1," of ",i.point().total," "),f(),A(i.point().isNext?6:-1),f(),A(i.point().position?7:-1),f(9),A(i.canSkip()?16:-1))},dependencies:[ue,Ze,ye,Te,se,ce,jn,Qi],encapsulation:2,changeDetection:0})};var y1=la(ds());var Gd=la(ds());var Fk={targetAngle:[],port:[],starboard:[]},wj=n=>Array.isArray(n)&&Number.isFinite(n[0])&&Number.isFinite(n[1]);function Mj(n,e,t){let i=rf(t);return!wj(n)||!wj(e)||i===null?null:{vessel:n,mark:e,twd:i,beatAngle:t.performance.beatAngle,gybeAngle:t.performance.gybeAngle}}function Sj(n){let{vessel:e,mark:t}=n,i=Ue.radiansToDegrees(n.twd),r=us.add(i,180),o=(0,Gd.getGreatCircleBearing)(e,t),a=(0,Gd.getDistance)(e,t,.01),s=Math.abs(us.difference(o,i))<90,l=Ue.radiansToDegrees(n.beatAngle??Math.PI/4),c=typeof n.gybeAngle=="number"?Ue.radiansToDegrees(n.gybeAngle):void 0,d=typeof c=="number"?180-Math.abs(c):void 0,p=D=>{let V=(0,Gd.computeDestinationPoint)(t,a,us.add(r,D)),W=(0,Gd.computeDestinationPoint)(t,a,us.add(r,-D));return[[V.longitude,V.latitude],t,[W.longitude,W.latitude]]};if(!s&&typeof c!="number")return Fk;let m=s?l:d,g=p(s?l:c);if(!(s?Math.abs(us.difference(o,i))<l:Math.abs(us.difference(o,r))<d))return{targetAngle:g,port:[],starboard:[]};let b=us.difference(i,o),S=Ue.degreesToRadians(m-b),E=Ue.degreesToRadians(m+b),k=Math.PI-(E+S),I=a*Math.sin(E)/Math.sin(k),C=a*Math.sin(S)/Math.sin(k),x=(0,Gd.computeDestinationPoint)(e,I,us.add(i,m)),P=(0,Gd.computeDestinationPoint)(e,C,us.add(i,0-m)),j=[x.longitude,x.latitude],G=[P.longitude,P.latitude];return{targetAngle:g,port:[[G,e],[j,e]],starboard:[[j,t],[t,G]]}}function Tj(n){return n.ctrlKey||n.metaKey||n.altKey||Nk(n)?null:n.key==="+"?"in":n.key==="-"?"out":null}function Nk(n){let e=n.target,t=e?.tagName;return t==="INPUT"||t==="TEXTAREA"||t==="SELECT"||!!e?.isContentEditable}function Ej(n){return n.ctrlKey||n.metaKey||n.altKey||n.shiftKey||Nk(n)?!1:n.key==="ArrowUp"||n.key==="ArrowDown"||n.key==="ArrowLeft"||n.key==="ArrowRight"}var Dw=class{constructor(e){this.onExpire=e}onExpire;timer=null;delayMs=0;get armed(){return this.timer!==null}arm(e){this.cancel(),!(!Number.isFinite(e)||e<=0)&&(this.delayMs=e*1e3,this.start())}reset(){this.armed&&this.start()}cancel(){this.timer!==null&&(clearTimeout(this.timer),this.timer=null)}start(){this.cancel(),this.timer=setTimeout(()=>{this.timer=null,this.onExpire()},this.delayMs)}};function Ij(n,e){return n.zoomChanged===!0?!0:!e||!n.lonlat?!1:n.lonlat[0]!==e[0]||n.lonlat[1]!==e[1]}var kj=la(ds());var tye=1/1.94384;function Dj(n,e,t,i){let r=ri.distanceTo(n,e)??0,o=(0,kj.getGreatCircleBearing)(n,e)??0,a=typeof t=="number"&&t>tye?t:i??0,s=a>0?r/a:null;return{bearing:o,distance:r,timeToGo:s}}var Pj=[{name:"scaleline",options:{bar:!0,steps:2,text:!1,minWidth:64,units:"nautical"}}],Rj={line:[new he({stroke:new be({color:"white",width:5,lineDash:[5,5]})}),new he({fill:new Ve({color:"#3399CC"}),stroke:new be({color:"#3399CC",width:3,lineDash:[5,5]})})],marker:new he({image:new Hi({radius:3,stroke:new be({width:2,color:"white"}),fill:new Ve({color:"#3399CC"})})})},Aj={startLine:new he({stroke:new be({color:"black",width:2,lineDash:[4,4]}),text:new It({text:"START",offsetY:10})})},Lj={default:new he({stroke:new be({color:"green",width:2,lineDash:[20,5,5,5]}),text:new It({text:"",offsetY:10})}),active:new he({stroke:new be({color:"blue",width:4})})},Oj={default:new he({stroke:new be({color:"#e8932b",width:3,lineDash:[10,6]}),text:new It({text:"",offsetY:10})}),active:new he({stroke:new be({color:"#e8932b",width:4})})},Fj={line:new he({fill:new Ve({color:"green"}),stroke:new be({color:"black",width:2,lineDash:[5,5]})}),circle:new he({fill:new Ve({color:"rgba(0, 255, 0, .3)"}),stroke:new be({color:"red",width:2,lineDash:[5,5]})}),anchor:new he({image:new tn({src:"./assets/img/anchor.png",size:[26,26],scale:.75,anchor:[13,1],anchorXUnits:"pixels",anchorYUnits:"pixels",rotateWithView:!1})})},Nj={"notice-to-mariners":new he({stroke:new be({color:"rgb(206, 107, 132)",lineDash:[5,5],width:2}),fill:new Ve({color:"rgba(206, 107, 132, 0.2)"}),text:new It({text:"",offsetY:0})}),hazard:new he({stroke:new be({color:"rgba(241, 60, 60, 1)",lineDash:[5,5,2],width:2}),fill:new Ve({color:"rgba(241, 60, 60, 0.5)"}),text:new It({text:"",offsetY:0,stroke:new be({color:"silver"}),padding:[2,2,2,2],backgroundFill:new Ve({color:"white"}),backgroundStroke:new be({color:"rgba(241, 60, 60, 1)"})})})},Bj={mob:new he({image:new tn({src:"./assets/img/alarms/mob.svg",rotateWithView:!1,rotation:0,scale:1,anchor:[12,12],anchorXUnits:"pixels",anchorYUnits:"pixels"})})},Vj={marker:new he({image:new tn({src:"./assets/img/waypoints/marker-green.png",anchor:[10.5,25],anchorXUnits:"pixels",anchorYUnits:"pixels",rotateWithView:!1}),text:new It({text:"",offsetY:-30})})},iye=new tn({src:"./assets/img/aircraft_active.png",rotateWithView:!0,rotation:0}),nye=new tn({src:"./assets/img/aircraft_inactive.png",rotateWithView:!0,rotation:0}),Gj={default:new he({image:iye,text:new It({text:"",offsetY:-12})}),inactive:new he({image:nye,text:new It({text:"",offsetY:-12})})},rye=new tn({src:"./assets/img/sar_active.png",rotateWithView:!1,rotation:0}),zj={default:new he({image:rye,text:new It({text:"",offsetY:-18})})},jj={port:new he({fill:new Ve({color:"green"}),stroke:new be({color:"green",width:1,lineDash:[5,5]})}),starboard:new he({fill:new Ve({color:"red"}),stroke:new be({color:"red",width:1,lineDash:[5,5]})})},Uj=new he({fill:new Ve({color:"green"}),stroke:new be({color:"gray",width:1,lineDash:[15,5,3,5]})}),Jp={default:void 0,measure:[new he({stroke:new be({color:"white",width:5,lineDash:[5,5]})}),new he({image:new Hi({radius:6,stroke:new be({width:2,color:"white"}),fill:new Ve({color:"#3399CC"})}),fill:new Ve({color:"#3399CC"}),stroke:new be({color:"#3399CC",width:3,lineDash:[5,5]})})],route:[new he({stroke:new be({color:"white",width:5})}),new he({image:new Hi({radius:6,stroke:new be({width:2,color:"white"}),fill:new Ve({color:"green"})}),stroke:new be({color:"green",width:3})})],region:[new he({stroke:new be({color:"rgba(255,255,255,0.4)",width:5}),fill:new Ve({color:"rgba(255,255,255,0.4)"})}),new he({stroke:new be({color:"purple",width:2}),image:new Hi({radius:6,stroke:new be({width:2,color:"white"}),fill:new Ve({color:"purple"})})})],radius:[new he({image:new Hi({radius:6,stroke:new be({width:2,color:"white"}),fill:new Ve({color:"rgba(25, 183, 211, 0.4)"})})}),new he({fill:new Ve({color:"rgba(25, 183, 211, 0.4)"}),stroke:new be({color:"white",width:3,lineDash:[5,5]})})]};var _1=2*20037508342789244e-9;function Wj(n){return!n.onRoute&&!n.vertexDeleted}function oye(n,e,t,i=_1){let r=(e+t)/2,o=Mm(r-n[0],i);return[n[0]+o,n[1]]}function Hj(n,e,t,i,r,o=_1){let a=oye(t,i,r,o);return{after:[...n,a],meta:e?[...e,{name:""}]:void 0,undo:{coordinates:n.map(s=>[...s]),coordsMetadata:e?e.map(s=>ne({},s)):void 0}}}function $j(n,e,t,i){for(let o=0;o<t.length&&o<e.length;o++){let a=n[o]?.[0]!==e[o][0]||n[o]?.[1]!==e[o][1],s=t[o]?.href;if(a&&s){let r=t[o],{href:l}=r,c=zk(r,["href"]);t[o]=st(ne({},c),{name:c.name||i?.(s)||""})}}}function Pw(n,e){if(e.length<2)return-1;let t=e.length-2,i=Math.min(n.length,e.length);for(let r=0;r<i;r++)if(n[r][0]!==e[r][0]||n[r][1]!==e[r][1])return Math.min(Math.max(r-1,0),t);return n.length===e.length?-1:t}var gg=class n{constructor(e,t){this.http=e;this.sk=t}http;sk;currentCellDeg=.1;currentsCacheTtlMs=1800*1e3;currentsCacheMax=512;currentsCache=new Map;getWindSamples(e){if(e.length===0)return li([]);let t=e.map(i=>this.sk.api.get(2,`/weather/observations?lat=${i.latitude}&lon=${i.longitude}`).pipe(Lc(()=>li(null))));return Wk(t).pipe(Fr(i=>{let r=[];return i.forEach((o,a)=>{let s=o?.[0];!s?.wind||typeof s.wind.speedTrue!="number"||typeof s.wind.directionTrue!="number"||r.push({latitude:e[a].latitude,longitude:e[a].longitude,speed:s.wind.speedTrue,direction:s.wind.directionTrue})}),r}))}getOceanCurrentSamples(e){if(e.length===0)return li([]);let t=Date.now(),i=e.map(c=>this.currentCellKey(c)),r=new Map;if(i.forEach(c=>{if(r.has(c))return;let d=this.currentsCache.get(c);(!d||t-d.at>=this.currentsCacheTtlMs)&&r.set(c,this.currentCellCenter(c))}),r.size===0)return li(this.buildCurrentSamples(e,i));let o=Array.from(r.entries()),a=o.map(([,c])=>c.latitude.toFixed(4)).join(","),s=o.map(([,c])=>c.longitude.toFixed(4)).join(","),l=`https://marine-api.open-meteo.com/v1/marine?latitude=${a}&longitude=${s}¤t=ocean_current_velocity,ocean_current_direction`;return this.http.get(l).pipe(Fr(c=>Array.isArray(c)?c:[c]),da(c=>{c.length!==o.length||c.some(d=>d?.error)||c.forEach((d,p)=>{let m=d?.current?.ocean_current_velocity,g=d?.current?.ocean_current_direction;this.cacheCurrentCell(o[p][0],typeof m=="number"&&typeof g=="number"?{velocity:m,direction:g}:null)})}),Fr(()=>this.buildCurrentSamples(e,i)),Lc(()=>li(this.buildCurrentSamples(e,i))))}buildCurrentSamples(e,t){let i=[];return e.forEach((r,o)=>{let a=this.currentsCache.get(t[o])?.value;a&&i.push({latitude:r.latitude,longitude:r.longitude,velocity:a.velocity,direction:a.direction})}),i}currentCellKey(e){let t=Math.floor(e.longitude/this.currentCellDeg),i=Math.floor(e.latitude/this.currentCellDeg);return`${t}:${i}`}currentCellCenter(e){let[t,i]=e.split(":").map(Number);return{latitude:(i+.5)*this.currentCellDeg,longitude:(t+.5)*this.currentCellDeg}}cacheCurrentCell(e,t){if(this.currentsCache.delete(e),this.currentsCache.size>=this.currentsCacheMax){let i=this.currentsCache.keys().next().value;i!==void 0&&this.currentsCache.delete(i)}this.currentsCache.set(e,{at:Date.now(),value:t})}static \u0275fac=function(t){return new(t||n)(ut(Sa),ut(Lt))};static \u0275prov=Je({token:n,factory:n.\u0275fac,providedIn:"root"})};var aye=["*"],Rw=class n{constructor(e,t,i,r,o){this.mapComponent=e;this.weather=t;this.mapImages=i;this.app=r;o.detach()}mapComponent;weather;mapImages;app;show=!1;opacity=.55;indicator="barb";layer;source;refresh$=new Oe;refreshSub;zIndex=55;gridColumns=5;gridRows=4;ngOnChanges(e){typeof e.opacity<"u"&&this.layer&&this.layer.setOpacity(this.normalizedOpacity),e.indicator&&!e.indicator.firstChange&&this.layer?.changed(),this.show?this.addLayer():this.removeLayer()}ngOnDestroy(){this.refreshSub?.unsubscribe(),this.removeLayer()}addLayer(){if(this.layer){this.layer.setOpacity(this.normalizedOpacity),this.refresh$.next();return}this.source=new kt,this.layer=new At({source:this.source,opacity:this.normalizedOpacity,zIndex:this.zIndex,style:e=>this.createWindStyle(e)}),this.layer.set("id","signal-k-weather-wind"),this.layer.set("name","Weather Wind"),this.mapComponent.getMap().addLayer(this.layer),this.refreshSub=this.refresh$.pipe(th(400),fr(()=>this.fetchWind())).subscribe(),this.mapComponent.getMap().on("moveend",this.onMoveEnd),this.refresh$.next(),this.mapComponent.getMap().render()}removeLayer(){let e=this.mapComponent.getMap();!e||!this.layer||(e.un("moveend",this.onMoveEnd),this.refreshSub?.unsubscribe(),this.refreshSub=void 0,e.removeLayer(this.layer),this.source?.clear(),this.source=void 0,this.layer=void 0,e.render())}onMoveEnd=()=>{this.refresh$.next()};get normalizedOpacity(){return Math.max(0,Math.min(1,this.opacity??1))}fetchWind(){if(!this.show||!this.source)return li([]);let e=this.getSamplePoints();return e.length===0?li([]):this.weather.getWindSamples(e).pipe(da(t=>this.renderWind(t)),Lc(t=>(console.warn("SK Weather wind layer unavailable.",t),li([]))))}getSamplePoints(){let e=this.mapComponent.getMap(),t=e.getSize();if(!t)return[];let i=Jn(e.getView().calculateExtent(t),"EPSG:3857","EPSG:4326"),r=Math.max(-180,i[0]),o=Math.max(-80,i[1]),a=Math.min(180,i[2]),s=Math.min(80,i[3]),l=[];for(let c=0;c<this.gridRows;c++){let d=s-(s-o)*(c+.5)/this.gridRows;for(let p=0;p<this.gridColumns;p++){let m=r+(a-r)*(p+.5)/this.gridColumns;l.push({latitude:d,longitude:m})}}return l}renderWind(e){this.source.clear(),this.source.addFeatures(e.map(t=>new je({geometry:new ot(lt([t.longitude,t.latitude])),speed:t.speed,direction:t.direction})))}createWindStyle(e){let t=Number(e.get("direction"))||0,i=Number(e.get("speed"))||0;return this.indicator==="barb"?this.createBarbStyle(t,i):this.createArrowStyle(t,i)}createArrowStyle(e,t){let i=this.mapImages.getWindArrow().clone();return i.setRotation(e+Math.PI),i.setRotateWithView(!0),new he({image:i,text:this.speedLabel(t,26)})}createBarbStyle(e,t){let i=this.mapImages.getMeteoIcon(t).clone();return Dp(t)&&i.setRotation(e),i.setRotateWithView(!0),new he({image:i,text:this.speedLabel(t,10)})}speedLabel(e,t){return new It({text:this.app.formatValueForDisplay(e,"m/s",{precision:0,path:this.app.twsDisplayUnitPath()}),offsetY:t,font:"11px Roboto, Arial, sans-serif",fill:new Ve({color:"rgba(20, 60, 95, 0.95)"}),stroke:new be({color:"rgba(255, 255, 255, 0.9)",width:3})})}static \u0275fac=function(t){return new(t||n)(ie(ke),ie(gg),ie(er),ie(oe),ie(ae))};static \u0275cmp=U({type:n,selectors:[["fb-weather-wind"]],inputs:{show:"show",opacity:"opacity",indicator:"indicator"},features:[Se],ngContentSelectors:aye,decls:1,vars:0,template:function(t,i){t&1&&(fe(),de(0))},encapsulation:2,changeDetection:0})};var sye=["*"],qj=85;function lye(n,e,t,i=un){let[r,o,a,s]=n,l=(a-r)/e,c=(s-o)/t;if(!(l>0)||!(c>0))return[];let d=Math.floor(r/l)*l,p=Math.floor(o/c)*c,m=y=>Number(y.toFixed(4)),g=[];for(let y=0;y<t;y++)for(let b=0;b<e;b++){let[S,E]=i([d+(b+.5)*l,p+(y+.5)*c]);if(E<-qj||E>qj)continue;let k=((S+180)%360+360)%360-180;g.push({latitude:m(E),longitude:m(k)})}return g}var Aw=class n{constructor(e,t,i,r){this.mapComponent=e;this.weather=t;this.mapImages=i;r.detach()}mapComponent;weather;mapImages;show=!1;opacity=.55;layer;source;refresh$=new Oe;refreshSub;zIndex=56;gridColumns=10;gridRows=8;ngOnChanges(e){typeof e.opacity<"u"&&this.layer&&this.layer.setOpacity(this.normalizedOpacity),this.show?this.addLayer():this.removeLayer()}ngOnDestroy(){this.refreshSub?.unsubscribe(),this.removeLayer()}addLayer(){if(this.layer){this.layer.setOpacity(this.normalizedOpacity),this.refresh$.next();return}this.source=new kt,this.layer=new At({source:this.source,opacity:this.normalizedOpacity,zIndex:this.zIndex,style:e=>this.createArrowStyle(e)}),this.layer.set("id","openmeteo-currents"),this.layer.set("name","Open-Meteo Ocean Currents"),this.mapComponent.getMap().addLayer(this.layer),this.refreshSub=this.refresh$.pipe(th(600),Fr(()=>this.getSamplePoints()),C1((e,t)=>this.pointsKey(e)===this.pointsKey(t)),fr(e=>this.fetchCurrents(e))).subscribe(),this.mapComponent.getMap().on("moveend",this.onMoveEnd),this.refresh$.next(),this.mapComponent.getMap().render()}removeLayer(){let e=this.mapComponent.getMap();!e||!this.layer||(e.un("moveend",this.onMoveEnd),this.refreshSub?.unsubscribe(),this.refreshSub=void 0,e.removeLayer(this.layer),this.source?.clear(),this.source=void 0,this.layer=void 0,e.render())}onMoveEnd=()=>{this.refresh$.next()};get normalizedOpacity(){return Math.max(0,Math.min(1,this.opacity??1))}fetchCurrents(e){return!this.show||!this.source?li([]):e.length===0?(this.source.clear(),li([])):this.weather.getOceanCurrentSamples(e).pipe(da(t=>this.renderCurrents(t)),Lc(()=>li([])))}getSamplePoints(){let e=this.mapComponent.getMap(),t=e.getSize();return t?lye(e.getView().calculateExtent(t),this.gridColumns,this.gridRows):[]}pointsKey(e){return e.map(t=>`${t.latitude},${t.longitude}`).join(";")}renderCurrents(e){this.source.clear(),this.source.addFeatures(e.map(t=>new je({geometry:new ot(lt([t.longitude,t.latitude])),velocity:t.velocity,direction:t.direction})))}createArrowStyle(e){let t=Number(e.get("velocity"))||0,i=Number(e.get("direction"))||0,r=this.getFlowRotation(i),o=Math.min(1,t/2),a=Math.round(38+o*190),s=Math.round(150-o*100),l=Math.round(245-o*200),c=`rgb(${a}, ${s}, ${l})`,d=this.mapImages.getOceanCurrentArrow().clone();return d.setRotation(r),d.setScale(.65+Math.min(.5,t/8)),d.setColor(c),d.setRotateWithView(!0),new he({image:d,text:new It({text:`${(t/1.852).toFixed(1)} kn`,offsetY:28,font:"11px Roboto, Arial, sans-serif",fill:new Ve({color:"rgba(255, 255, 255, 0.95)"}),stroke:new be({color:"rgba(20, 60, 95, 0.9)",width:3})})})}getFlowRotation(e){return e*Math.PI/180}static \u0275fac=function(t){return new(t||n)(ie(ke),ie(gg),ie(er),ie(ae))};static \u0275cmp=U({type:n,selectors:[["fb-weather-currents"]],inputs:{show:"show",opacity:"opacity"},features:[Se],ngContentSelectors:sye,decls:1,vars:0,template:function(t,i){t&1&&(fe(),de(0))},encapsulation:2,changeDetection:0})};var cye=new Set(["vessels","ais-vessels"]),dye=new Set(["trail","track-vessels","trackhistory"]),Zj=n=>n.split(".")[0];function Xj(n){let e=[...n];return e.some(t=>cye.has(Zj(t)))?e.filter(t=>dye.has(Zj(t))):[]}function Yj(n,e,t){return ry(e&&n?n:{lines:[],times:[]},t)}var uye=["olMap"],pye=["routeDraw"],hye=()=>({precision:0}),mye=()=>({class:"",name:"history"}),fye=n=>["From",n],gye=n=>["To",n],_ye=n=>["Duration",n],yye=n=>["Here at",n],vye=(n,e,t,i)=>[n,e,t,i],bye=()=>({declutter:!0}),Bk=(n,e)=>e[0],xye=(n,e)=>e.id;function Cye(n,e){if(n&1){let t=H();u(0,"ol-dragbox",46),T("boxStart",function(r){O(t);let o=v();return F(o.onDragBoxStart(r))})("boxEnd",function(r){O(t);let o=v();return F(o.onDragBoxEnd(r))})("boxCancel",function(){O(t);let r=v();return F(r.onDragBoxCancel())}),h()}}function wye(n,e){if(n&1){let t=H();u(0,"ol-draw",47),T("drawStart",function(r){O(t);let o=v();return F(o.onMeasureStart(r))})("drawEnd",function(){O(t);let r=v();return F(r.onMeasureEnd())}),h()}if(n&2){let t=v();Uw(t.mapInteract.draw.style),w("type",t.mapInteract.measureGeometryType)("stopClick",!1)}}function Mye(n,e){if(n&1){let t=H();u(0,"ol-draw",48,2),T("drawEnd",function(r){O(t);let o=v();return F(o.onDrawEnd(r))}),h()}if(n&2){let t=v();Uw(t.mapInteract.draw.style),w("type",t.mapInteract.draw.featureType)("stopClick",t.mapInteract.draw.resourceType!=="route")}}function Sye(n,e){if(n&1){let t=H();u(0,"ol-modify",49),T("modifyStart",function(r){O(t);let o=v();return F(o.onModifyStart(r))})("modifyEnd",function(r){O(t);let o=v();return F(o.onModifyEnd(r))}),h()}if(n&2){let t=v();w("features",t.mapInteract.draw.features)}}function Tye(n,e){n&1&&(u(0,"span"),_(1,"Lat:\xA0"),h())}function Eye(n,e){n&1&&(u(0,"span"),_(1,"Lon:\xA0"),h())}function Iye(n,e){if(n&1&&(_(0," \xA0 "),z(1,"span",12)),n&2){let t=v(),i=v();f(),w("innerText","ETA: "+i.app.formatValueForDisplay(t.timeToGo,"s"))}}function kye(n,e){if(n&1&&(_(0," \xA0 "),z(1,"span",12),_(2," \xA0 "),z(3,"span",12),R(4,Iye,2,1)),n&2){let t=e,i=v();f(),w("innerText","Brg: "+i.app.formatValueForDisplay(t.bearing,"deg",kr(3,hye))),f(2),w("innerText","Dist: "+i.app.formatValueForDisplay(t.distance,"m")),f(),A(t.timeToGo!==null?4:-1)}}function Dye(n,e){if(n&1&&z(0,"fb-s57-chart",50),n&2){let t=v(),i=t.$implicit,r=t.$index;w("zIndex",10+r)("chart",i)}}function Pye(n,e){if(n&1&&z(0,"fb-mapstylejson-chart",50),n&2){let t=v(),i=t.$implicit,r=t.$index;w("zIndex",10+r)("chart",i)}}function Rye(n,e){if(n&1&&z(0,"fb-tilejson-chart",51),n&2){let t=v(),i=t.$implicit,r=t.$index,o=v();w("zIndex",10+r)("chart",i)("overZoomTiles",o.overZoomTiles)("mapMaxZoom",o.app.MAP_ZOOM_EXTENT.max)}}function Aye(n,e){if(n&1&&z(0,"fb-wms-chart",51),n&2){let t=v(),i=t.$implicit,r=t.$index,o=v();w("zIndex",10+r)("chart",i)("overZoomTiles",o.overZoomTiles)("mapMaxZoom",o.app.MAP_ZOOM_EXTENT.max)}}function Lye(n,e){if(n&1&&z(0,"fb-wmts-chart",51),n&2){let t=v(),i=t.$implicit,r=t.$index,o=v();w("zIndex",10+r)("chart",i)("overZoomTiles",o.overZoomTiles)("mapMaxZoom",o.app.MAP_ZOOM_EXTENT.max)}}function Oye(n,e){if(n&1&&z(0,"fb-tilelayer-vector",51),n&2){let t=v(),i=t.$implicit,r=t.$index,o=v();w("zIndex",10+r)("chart",i)("overZoomTiles",o.overZoomTiles)("mapMaxZoom",o.app.MAP_ZOOM_EXTENT.max)}}function Fye(n,e){if(n&1&&z(0,"fb-tilelayer-raster",51),n&2){let t=v(),i=t.$implicit,r=t.$index,o=v();w("zIndex",10+r)("chart",i)("overZoomTiles",o.overZoomTiles)("mapMaxZoom",o.app.MAP_ZOOM_EXTENT.max)}}function Nye(n,e){if(n&1&&R(0,Dye,1,2,"fb-s57-chart",50)(1,Pye,1,2,"fb-mapstylejson-chart",50)(2,Rye,1,4,"fb-tilejson-chart",51)(3,Aye,1,4,"fb-wms-chart",51)(4,Lye,1,4,"fb-wmts-chart",51)(5,Oye,1,4,"fb-tilelayer-vector",51)(6,Fye,1,4,"fb-tilelayer-raster",51),n&2){let t=e.$implicit;A((t[1].type==null?null:t[1].type.toLowerCase())==="s-57"?0:(t[1].type==null?null:t[1].type.toLowerCase())==="mapstylejson"?1:(t[1].type==null?null:t[1].type.toLowerCase())==="tilejson"?2:(t[1].type==null?null:t[1].type.toLowerCase())==="wms"?3:(t[1].type==null?null:t[1].type.toLowerCase())==="wmts"?4:(t[1].type==null?null:t[1].type.toLowerCase())==="tilelayer"&&((t[1].format==null?null:t[1].format.toLowerCase())==="pbf"||(t[1].format==null?null:t[1].format.toLowerCase())==="mvt")?5:t[0]==="openstreetmap"||(t[1].type==null?null:t[1].type.toLowerCase())==="tilelayer"||!(t[1]!=null&&t[1].type)?6:-1)}}function Bye(n,e){if(n&1){let t=H();u(0,"fb-radar",52),T("onError",function(r){O(t);let o=v();return F(o.handleRadarError(r))}),h()}if(n&2){let t=v();w("position",t.dfeat.self.position)("heading",t.dfeat.self.orientation)("mapZoom",t.mapZoomLevel())("zIndex",99)("opacity",t.app.config.radars.opacity)}}function Vye(n,e){if(n&1&&z(0,"fb-tracks",14),n&2){let t=v();w("darkMode",t.app.uiConfig().invertColor)("tracks",t.skres.tracks())("labelMinZoom",t.app.config.map.labelsMinZoom)("mapZoom",t.mapZoomLevel())("zIndex",100)}}function Gye(n,e){if(n&1&&z(0,"fb-track-history",15),n&2){let t=v();w("tracks",t.trackHistory.tracks())("zIndex",105)}}function zye(n,e){if(n&1&&z(0,"fb-track-history-ghosts",16),n&2){let t=v();w("ghosts",t.trackHistory.ghosts())("iconScale",t.app.config.vessels.iconScale)("zIndex",995)}}function jye(n,e){if(n&1&&z(0,"ais-targets-track",17),n&2){let t=v();w("tracks",t.app.data.vessels.aisTracks)("showAll",t.app.config.vessels.aisShowTrack)("selectedIds",t.app.data.vessels.showTrack)("tracksMinZoom",t.aisTrackMinZoom)("updateIds",t.skstream.aisStatus().updated)("removeIds",t.skstream.aisStatus().expired)("mapZoom",t.mapZoomLevel())("zIndex",110)}}function Uye(n,e){if(n&1&&(u(0,"div"),z(1,"fb-resource-sets",53),h()),n&2){let t=e.$implicit,i=e.$index,r=v();f(),w("darkMode",r.app.uiConfig().invertColor)("collection",t[0])("resourceSets",t[1])("labelMinZoom",r.app.config.map.labelsMinZoom)("mapZoom",r.mapZoomLevel())("zIndex",120+i)}}function Wye(n,e){if(n&1&&z(0,"fb-route-direction",19),n&2){let t=v();w("points",t.course.courseData().activeRoutePoints)("pointIndex",t.course.courseData().pointIndex)("reverse",t.app.data.activeRouteReversed)("zIndex",550)}}function Hye(n,e){if(n&1&&z(0,"sk-ais-targets",23),n&2){let t=v();w("darkMode",t.app.uiConfig().invertColor)("targets",t.dfeat.meteo)("windIndicator",t.app.config.display.windIndicator)("labelMinZoom",t.app.config.map.labelsMinZoom)("mapZoom",t.mapZoomLevel())("updateIds",t.skstream.aisStatus().updated)("staleIds",t.skstream.aisStatus().stale)("removeIds",t.skstream.aisStatus().expired)("inactiveTime",t.app.config.vessels.aisStaleAge)("zIndex",220)}}function $ye(n,e){if(n&1&&z(0,"sk-ais-wind",54),n&2){let t=v(2);w("targetContext","vessels")("targets",t.dfeat.ais)("vectorApparent",t.app.config.vessels.aisWindApparent)("mapZoom",t.mapZoomLevel())("labelMinZoom",t.app.config.map.labelsMinZoom)("focusId",t.app.data.vessels.activeId)("filterIds",t.app.config.selections.aisTargets)("filterByShipType",t.app.config.selections.aisFilterByShipType)("filterShipTypes",t.app.config.selections.aisTargetTypes)("updateIds",t.skstream.aisStatus().updated)("staleIds",t.skstream.aisStatus().stale)("removeIds",t.skstream.aisStatus().expired)("inactiveTime",t.app.config.vessels.aisStaleAge)("zIndex",900)("darkMode",t.app.uiConfig().invertColor)}}function Kye(n,e){if(n&1&&(u(0,"div"),R(1,$ye,1,15,"sk-ais-wind",54),z(2,"sk-ais-flags",55)(3,"sk-ais-vessels",56),h()),n&2){let t=v();f(),A(t.mapZoomLevel()>=t.app.config.vessels.aisWindMinZoom?1:-1),f(),w("flagged",t.app.data.vessels.flagged)("targetContext","vessels")("targets",t.dfeat.ais)("mapZoom",t.mapZoomLevel())("labelMinZoom",t.app.config.map.labelsMinZoom)("focusId",t.app.data.vessels.activeId)("filterIds",t.app.config.selections.aisTargets)("filterByShipType",t.app.config.selections.aisFilterByShipType)("filterShipTypes",t.app.config.selections.aisTargetTypes)("updateIds",t.skstream.aisStatus().updated)("staleIds",t.skstream.aisStatus().stale)("removeIds",t.skstream.aisStatus().expired)("inactiveTime",t.app.config.vessels.aisStaleAge)("zIndex",985)("darkMode",t.app.uiConfig().invertColor),f(),w("darkMode",t.app.uiConfig().invertColor)("targets",t.dfeat.ais)("labelMinZoom",t.app.config.map.labelsMinZoom)("mapZoom",t.mapZoomLevel())("updateIds",t.skstream.aisStatus().updated)("staleIds",t.skstream.aisStatus().stale)("removeIds",t.skstream.aisStatus().expired)("inactiveTime",t.app.config.vessels.aisStaleAge)("zIndex",980)("focusId",t.app.data.vessels.activeId)("filterIds",t.app.config.selections.aisTargets)("filterByShipType",t.app.config.selections.aisFilterByShipType)("filterShipTypes",t.app.config.selections.aisTargetTypes)("cogLineLength",t.app.config.vessels.aisCogLine)}}function qye(n,e){if(n&1&&z(0,"sk-ais-targets",24),n&2){let t=v();w("darkMode",t.app.uiConfig().invertColor)("targets",t.dfeat.aircraft)("targetStyles",t.featureStyles.aircraft)("labelMinZoom",t.app.config.map.labelsMinZoom)("mapZoom",t.mapZoomLevel())("updateIds",t.skstream.aisStatus().updated)("staleIds",t.skstream.aisStatus().stale)("removeIds",t.skstream.aisStatus().expired)("inactiveTime",t.app.config.vessels.aisStaleAge)("zIndex",910)}}function Zye(n,e){if(n&1&&z(0,"sk-ais-targets",25),n&2){let t=v();w("darkMode",t.app.uiConfig().invertColor)("targets",t.dfeat.sar)("targetStyles",t.featureStyles.sar)("labelMinZoom",t.app.config.map.labelsMinZoom)("mapZoom",t.mapZoomLevel())("updateIds",t.skstream.aisStatus().updated)("staleIds",t.skstream.aisStatus().stale)("removeIds",t.skstream.aisStatus().expired)("inactiveTime",t.app.config.vessels.aisStaleAge)("zIndex",920)}}function Xye(n,e){if(n&1&&z(0,"fb-notes",28),n&2){let t=v();w("notes",t.plotterExt.visibleNotes())("zIndex",450)}}function Yye(n,e){if(n&1){let t=H();u(0,"ol-overlay",29)(1,"ap-popover",57),T("closed",function(){O(t);let r=v();return F(r.popoverClosed())})("navigateTo",function(){O(t);let r=v();return r.onContextMenuAction("nav_to",r.overlay().position),F(r.popoverClosed())}),h()(),z(2,"fb-bearing-line",58)}if(n&2){let t=v();w("position",t.overlay().position)("worldOffset",t.overlay().worldOffset??0)("positioning","top-center"),f(),w("title",t.overlay().title)("canClose",!1)("measure",!0)("navTo",!0),f(),w("markerPosition",t.overlay().position)("vesselPosition",t.dfeat.active.position)("showMarker",!1)("bearingStyles",t.featureStyles.bearingDistance)("labelMinZoom",t.app.config.map.labelsMinZoom)("mapZoom",t.mapZoomLevel())("zIndex",335)}}function Qye(n,e){if(n&1){let t=H();u(0,"ap-popover",71),T("closed",function(){O(t);let r=v(2);return F(r.popoverClosed())}),h()}if(n&2){let t=v(2);w("title",t.overlay().title)("canClose",!1)("measure",!0)}}function Jye(n,e){if(n&1){let t=H();u(0,"chart-list-popover",72),T("selected",function(r){O(t);let o=v(2);return F(o.toggleFeatureSelection(r,"charts"))})("closed",function(){O(t);let r=v(2);return F(r.popoverClosed())}),h()}if(n&2){let t=v(2);w("canClose",t.app.config.map.popoverMulti)("features",t.overlay().content)}}function eve(n,e){if(n&1){let t=H();u(0,"feature-list-popover",73),T("selected",function(r){O(t);let o=v(2);return F(o.featureListSelection(r))})("closed",function(){O(t);let r=v(2);return F(r.popoverClosed())}),h()}if(n&2){let t=v(2);w("canClose",t.app.config.map.popoverMulti)("title",t.overlay().title)("features",t.overlay().content)}}function tve(n,e){if(n&1){let t=H();u(0,"s57-popover",74),T("closed",function(){O(t);let r=v(2);return F(r.popoverClosed())}),h()}if(n&2){let t=v(2);w("canClose",t.app.config.map.popoverMulti)("properties",t.overlay().s57Feature)}}function ive(n,e){if(n&1&&(u(0,"div",77)(1,"div",78),_(2),h(),u(3,"div",79),_(4),h()()),n&2){let t=v().$implicit;f(2),K("",t[0],":"),f(2),K(" ",t[1]," ")}}function nve(n,e){if(n&1&&R(0,ive,5,2,"div",77),n&2){let t=e.$implicit;A(t[1]?0:-1)}}function rve(n,e){if(n&1&&Ae(0,nve,1,1,null,null,Bk),n&2){v();let t=pa(0);Le(nD(8,vye,Gi(0,fye,t.start),Gi(2,gye,t.end),Gi(4,_ye,t.duration),Gi(6,yye,t.at)))}}function ove(n,e){n&1&&(u(0,"div",76),_(1,"No recording times available"),h())}function ave(n,e){if(n&1){let t=H();As(0),u(1,"ap-popover",75),T("closed",function(){O(t);let r=v(2);return F(r.popoverClosed())}),R(2,rve,2,13)(3,ove,2,0,"div",76),h()}if(n&2){let t=v(2),i=Ls(t.overlay().trackHistory);f(),w("title",i==null?null:i.name)("icon",kr(5,mye))("canClose",t.app.config.map.popoverMulti),f(),A(i!=null&&i.start?2:3)}}function sve(n,e){if(n&1){let t=H();u(0,"ap-popover",80),T("closed",function(){O(t);let r=v(2);return F(r.popoverClosed())}),u(1,"div",81)(2,"mat-icon",82),_(3,"water"),h(),u(4,"div",83)(5,"div",84)(6,"mat-icon",85),_(7,"air"),h(),u(8,"span"),_(9),h()(),u(10,"div",84)(11,"mat-icon",85),_(12,"explore"),h(),u(13,"span"),_(14),h()()()()()}if(n&2){let t,i,r=v(2);w("canClose",r.app.config.map.popoverMulti)("compact",!0),f(9),X((t=r.overlay().tidal)==null?null:t.speedLabel),f(5),X((i=r.overlay().tidal)==null?null:i.directionLabel)}}function lve(n,e){if(n&1){let t=H();u(0,"resource-popover",86),T("modify",function(){O(t);let r=v(2);return r.modifyFeature(),F(r.popoverClosed())})("save",function(){O(t);let r=v(2);return r.saveRouteFromPopover(),F(r.popoverClosed())})("delete",function(){O(t);let r=v(2);return r.deleteFeature(r.overlay().id,r.overlay().type),F(r.popoverClosed())})("hide",function(){O(t);let r=v(2);return r.hideFeature(r.overlay().id,r.overlay().type),F(r.popoverClosed())})("addNote",function(){O(t);let r=v(2);return r.skres.showNoteEditor({type:r.overlay().type,href:{id:r.overlay().id,exists:!0}}),F(r.popoverClosed())})("activated",function(){O(t);let r=v(2);return r.setActiveFeature(),F(r.popoverClosed())})("deactivated",function(){O(t);let r=v(2);return r.clearActiveFeature(),F(r.popoverClosed())})("related",function(r){O(t);let o=v(2);return o.skres.showRelatedNotes(r,"group"),F(o.popoverClosed())})("notes",function(){O(t);let r=v(2);return r.skres.showRelatedNotes(r.overlay().id,r.overlay().type,r.overlay().readOnly),F(r.popoverClosed())})("info",function(){O(t);let r=v(2);return r.popoverInfo(),F(r.popoverClosed())})("points",function(){O(t);let r=v(2);return r.popoverPoints(),F(r.popoverClosed())})("closed",function(){O(t);let r=v(2);return F(r.popoverClosed())}),h()}if(n&2){let t=v(2);w("canClose",t.app.config.map.popoverMulti)("title",t.overlay().title)("type",t.overlay().type)("resource",t.overlay().resource)("active",t.app.data.activeWaypoint?t.app.data.activeWaypoint:t.app.data.activeRoute)("featureCount",t.overlay().featureCount)("units",t.scaleUnits())("canSave",t.isUnsavedRoute())("canStart",t.isDraftRoute())}}function cve(n,e){if(n&1){let t=H();u(0,"resourceset-popover",87),T("modify",function(){O(t);let r=v(2);return r.modifyFeature(),F(r.popoverClosed())})("delete",function(){O(t);let r=v(2);return r.deleteFeature(r.overlay().id,r.overlay().type),F(r.popoverClosed())})("info",function(){O(t);let r=v(2);return r.itemInfo(r.overlay().id,r.overlay().type),F(r.popoverClosed())})("closed",function(){O(t);let r=v(2);return F(r.popoverClosed())}),h()}if(n&2){let t=v(2);w("canClose",t.app.config.map.popoverMulti)("title",t.overlay().title)("resource",t.overlay().resourceSet)}}function dve(n,e){if(n&1){let t=H();u(0,"div")(1,"vessel-popover",88),T("info",function(){O(t);let r=v(2);return r.itemInfo(r.overlay().id,r.overlay().type,r.overlay().isSelf),F(r.popoverClosed())})("focused",function(r){O(t);let o=v(2);return F(o.setActiveVessel(r?o.overlay().id:null))})("markPosition",function(r){O(t);let o=v(2);return o.skres.newWaypointAt(r),F(o.popoverClosed())})("closed",function(){O(t);let r=v(2);return F(r.popoverClosed())}),h()()}if(n&2){let t=v(2);f(),w("canClose",t.app.config.map.popoverMulti)("vessel",t.overlay().vessel)("useMagnetic",t.app.useMagnetic)("isActive",t.app.data.vessels.activeId===t.overlay().id)("isSelf",t.overlay().isSelf)}}function uve(n,e){if(n&1){let t=H();u(0,"aton-popover",89),T("info",function(){O(t);let r=v(2);return r.itemInfo(r.overlay().id,r.overlay().type),F(r.popoverClosed())})("closed",function(){O(t);let r=v(2);return F(r.popoverClosed())}),h()}if(n&2){let t=v(2);w("canClose",t.app.config.map.popoverMulti)("aton",t.overlay().aton)}}function pve(n,e){if(n&1){let t=H();u(0,"aircraft-popover",90),T("info",function(){O(t);let r=v(2);return r.itemInfo(r.overlay().id,r.overlay().type),F(r.popoverClosed())})("closed",function(){O(t);let r=v(2);return F(r.popoverClosed())}),h()}if(n&2){let t=v(2);w("canClose",t.app.config.map.popoverMulti)("aircraft",t.overlay().aircraft)}}function hve(n,e){if(n&1){let t=H();u(0,"route-point-popover",91),T("rejoin",function(r){O(t);let o=v(2);return o.rejoinRouteAt(r),F(o.popoverClosed())})("skip",function(r){O(t);let o=v(2);return o.skipRoutePoint(r),F(o.popoverClosed())})("closed",function(){O(t);let r=v(2);return F(r.popoverClosed())}),h()}if(n&2){let t=v(2);w("canClose",t.app.config.map.popoverMulti)("point",t.overlay().routePoint)}}function mve(n,e){if(n&1){let t=H();u(0,"alarm-popover",92),T("info",function(){O(t);let r=v(2);return r.itemInfo(r.overlay().id,r.overlay().type),F(r.popoverClosed())})("goto",function(r){O(t);let o=v(2);return o.onContextMenuAction("nav_to",r),F(o.popoverClosed())})("closed",function(){O(t);let r=v(2);return F(r.popoverClosed())}),h()}if(n&2){let t=v(2);w("canClose",t.app.config.map.popoverMulti)("alarm",t.overlay().alarm)("id",t.overlay().id)}}function fve(n,e){if(n&1&&(u(0,"ol-overlay",29),R(1,Qye,1,3,"ap-popover",59),R(2,Jye,1,2,"chart-list-popover",60),R(3,eve,1,3,"feature-list-popover",61),R(4,tve,1,2,"s57-popover",62),R(5,ave,4,6,"ap-popover",63),R(6,sve,15,4,"ap-popover",64),R(7,lve,1,9,"resource-popover",65),R(8,cve,1,3,"resourceset-popover",66),R(9,dve,2,5,"div"),R(10,uve,1,2,"aton-popover",67),R(11,pve,1,2,"aircraft-popover",68),R(12,hve,1,2,"route-point-popover",69),R(13,mve,1,3,"alarm-popover",70),h()),n&2){let t=v();w("position",t.overlay().position)("worldOffset",t.overlay().worldOffset??0)("positioning","top-center"),f(),A(t.mapInteract.isMeasuring()?1:-1),f(),A(t.overlay().type==="chartlist"?2:-1),f(),A(t.overlay().type==="list"?3:-1),f(),A(t.overlay().type==="s57"?4:-1),f(),A(t.overlay().type==="trackhistory"?5:-1),f(),A(t.overlay().type==="tidal"?6:-1),f(),A(t.overlay().type==="destination"||t.overlay().type==="waypoint"||t.overlay().type==="route"||t.overlay().type==="note"||t.overlay().type==="region"?7:-1),f(),A(t.overlay().type==="rset"?8:-1),f(),A(t.overlay().type==="ais"?9:-1),f(),A(t.overlay().type==="aton"||t.overlay().type==="meteo"?10:-1),f(),A(t.overlay().type==="aircraft"?11:-1),f(),A(t.overlay().type==="rtept"?12:-1),f(),A(t.overlay().type==="alarm"?13:-1)}}function gve(n,e){if(n&1&&z(0,"fb-anchor-alarm",30),n&2){let t=v();w("radius",t.anchor.radius())("anchorPosition",t.anchor.position())("vesselPosition",t.dfeat.self.position)("anchorStyles",t.featureStyles.anchor)("zIndex",300)}}function _ve(n,e){if(n&1&&z(0,"fb-cpa-alarms",31),n&2){let t=v();w("cpaLines",t.dfeat.closest)("zIndex",350)}}function yve(n,e){if(n&1&&z(0,"fb-xte-path",93),n&2){let t=v(2);w("startPosition",t.dfeat.navData.startPosition)("destPosition",t.dfeat.navData.position)("zIndex",340)("visible",!0)}}function vve(n,e){if(n&1&&z(0,"fb-target-angle",95)(1,"fb-layline",96),n&2){let t=v(2);w("line",t.perfTargetAngle())("lineStyle",t.featureStyles.targetAngle)("position",t.app.data.vessels.active.position)("twd",t.trueWindDirection(t.app.data.vessels.self))("mapZoom",t.mapZoomLevel())("zIndex",345),f(),w("lines",t.perfLaylines())("laylineStyles",t.featureStyles.layline)("position",t.app.data.vessels.active.position)("twd",t.trueWindDirection(t.app.data.vessels.self))("mapZoom",t.mapZoomLevel())("zIndex",330)}}function bve(n,e){if(n&1&&z(0,"fb-bearing-line",58),n&2){let t=v(2);w("markerPosition",t.dfeat.navData.position)("vesselPosition",t.dfeat.active.position)("showMarker",!t.app.data.activeWaypoint)("markerName",t.course.courseData().destPointName)("bearingStyles",t.featureStyles.destination)("labelMinZoom",t.app.config.map.labelsMinZoom)("mapZoom",t.mapZoomLevel())("zIndex",335)}}function xve(n,e){if(n&1&&z(0,"fb-arrival-circle",94),n&2){let t=v(2);w("radius",t.course.courseData().arrivalCircle)("position",t.dfeat.navData.position)("zIndex",335)}}function Cve(n,e){if(n&1&&(R(0,yve,1,4,"fb-xte-path",93),R(1,vve,2,12),R(2,bve,1,8,"fb-bearing-line",58),R(3,xve,1,3,"fb-arrival-circle",94)),n&2){let t=v();A(t.dfeat.navData.startPosition?0:-1),f(),A(t.app.config.vessels.laylines&&t.perfTargetAngle().length!==0?1:-1),f(),A(t.dfeat.navData.position?2:-1),f(),A(t.course.courseData().arrivalCircle?3:-1)}}function wve(n,e){if(n&1&&z(0,"fb-range-circles",33),n&2){let t=v();w("position",t.dfeat.active.position)("maxCircles",t.app.config.vessels.rangeCircleCount)("fixedMode",t.app.config.vessels.rangeCirclesFixed)("fixedDistance",t.app.config.vessels.rangeCirclesDistance)("mapZoom",t.mapZoomLevel())("darkMode",t.app.uiConfig().invertColor)("minZoom",t.app.config.vessels.rangeCircleMinZoom)("units",t.scaleUnits())("zIndex",340)}}function Mve(n,e){if(n&1&&z(0,"fb-heading-line",34),n&2){let t=v();w("coords",t.vesselLines().heading)("lineStyle",t.app.selfLines().heading)("mapZoom",t.mapZoomLevel())("zIndex",344)}}function Sve(n,e){if(n&1&&z(0,"fb-cog-line",35),n&2){let t=v();w("coords",t.vesselLines().cog)("cogTime",t.app.config.vessels.selfLines.cog.length)("lineStyle",t.app.selfLines().cog)("units",t.app.config.units.distance)("darkMode",t.app.uiConfig().invertColor)("labelMinZoom",t.app.config.map.labelsMinZoom)("mapZoom",t.mapZoomLevel())("zIndex",345)}}function Tve(n,e){if(n&1&&z(0,"fb-wind-lines",36),n&2){let t=v();w("twd",t.trueWindDirection(t.dfeat.active))("tws",t.dfeat.active.wind.tws)("awa",t.dfeat.active.wind.awa+t.dfeat.active.orientation)("aws",t.dfeat.active.wind.aws)("position",t.dfeat.self.position)("zIndex",350)}}function Eve(n,e){if(n&1&&z(0,"fb-vessel-trail",38),n&2){let t=v();w("localTrail",t.app.selfTrail())("serverTrail",t.app.selfTrailFromServer())("zIndex",990)}}function Ive(n,e){if(n&1&&(u(0,"ol-overlay",41),z(1,"div",97),h()),n&2){let t=e.$implicit;w("position",t.position)("worldOffset",t.worldOffset)("positioning","center-center")("stopEvent",!1),f(),vt("animation-duration",t.fadeMs+"ms")}}function kve(n,e){if(n&1&&z(0,"fb-chart-bounds",42),n&2){let t=v();w("zIndex",250)("charts",t.app.data.chartBounds.charts)("layerProperties",kr(3,bye))}}function Dve(n,e){if(n&1){let t=H();u(0,"button",101),T("contextmenu",function(r){return r.preventDefault()})("click",function(){O(t);let r=v().item,o=v();return F(o.onContextMenuAction("nav_to",r))}),u(1,"mat-icon"),_(2,"near_me"),h(),_(3," Navigate to here "),h()}}function Pve(n,e){if(n&1){let t=H();u(0,"button",102),T("click",function(){O(t);let r=v().item,o=v();return F(o.onContextMenuAction("cleardestination",r))}),u(1,"mat-icon"),_(2,"clear_all"),h(),u(3,"span"),_(4,"Stop Navigating"),h()()}}function Rve(n,e){n&1&&z(0,"mat-divider")}function Ave(n,e){if(n&1){let t=H();u(0,"button",99),T("click",function(){O(t);let r=v().item,o=v();return F(o.onContextMenuAction("add_note",r))})("contextmenu",function(r){return r.preventDefault()}),u(1,"mat-icon"),_(2,"local_offer"),h(),_(3," Add Note here "),h()}}function Lve(n,e){if(n&1){let t=H();u(0,"button",101),T("contextmenu",function(r){return r.preventDefault()})("click",function(){O(t);let r=v().item,o=v();return F(o.onContextMenuAction("bearing_dist",r))}),u(1,"mat-icon"),_(2,"arrow_right_alt"),h(),_(3," Bearing & Distance "),h()}}function Ove(n,e){if(n&1){let t=H();u(0,"button",102),T("click",function(){O(t);let r=v().item,o=v();return F(o.onContextMenuAction("cleartrail",r))}),u(1,"mat-icon"),_(2,"clear_all"),h(),u(3,"span"),_(4),h()()}if(n&2){let t=v(2);f(4),K("",t.app.data.serverTrail?"Refresh":"Clear"," Trail")}}function Fve(n,e){if(n&1){let t=H();u(0,"button",102),T("click",function(){O(t);let r=v().item,o=v();return F(o.onContextMenuAction("weather_forecast",r))}),u(1,"mat-icon"),_(2,"air"),h(),u(3,"span"),_(4,"Weather Forecast"),h()()}}function Nve(n,e){if(n&1){let t=H();u(0,"button",102),T("click",function(){O(t);let r=v().item,o=v();return F(o.onContextMenuAction("get_feature_info",r))}),u(1,"mat-icon"),_(2,"info"),h(),u(3,"span"),_(4,"Get Feature Info"),h()()}}function Bve(n,e){if(n&1){let t=H();z(0,"mat-divider"),u(1,"button",99),T("click",function(){O(t);let r=v().item,o=v();return F(o.onContextMenuAction("add_widget",r))})("contextmenu",function(r){return r.preventDefault()}),u(2,"mat-icon"),_(3,"widgets"),h(),_(4," Add widget here "),h()}}function Vve(n,e){if(n&1){let t=H();R(0,Dve,4,0,"button",98),R(1,Pve,5,0,"button",98),R(2,Rve,1,0,"mat-divider"),u(3,"button",99),T("click",function(){let r=O(t).item,o=v();return F(o.onContextMenuAction("add_wpt",r))})("contextmenu",function(r){return r.preventDefault()}),u(4,"mat-icon",100),_(5,"add_location"),h(),_(6," Add Waypoint here "),h(),R(7,Ave,4,0,"button",98),z(8,"mat-divider"),R(9,Lve,4,0,"button",98),u(10,"button",99),T("click",function(){let r=O(t).item,o=v();return F(o.onContextMenuAction("measure",r))})("contextmenu",function(r){return r.preventDefault()}),u(11,"mat-icon"),_(12,"straighten"),h(),_(13," Measure "),h(),z(14,"mat-divider"),R(15,Ove,5,1,"button",98),u(16,"button",99),T("click",function(){let r=O(t).item,o=v();return F(o.onContextMenuAction("trail2route",r))})("contextmenu",function(r){return r.preventDefault()}),u(17,"mat-icon"),_(18,"insights"),h(),_(19," Trail to Route "),h(),z(20,"mat-divider"),u(21,"button",99),T("click",function(){let r=O(t).item,o=v();return F(o.onContextMenuAction("anchor",r))})("contextmenu",function(r){return r.preventDefault()}),u(22,"mat-icon"),_(23,"anchor"),h(),_(24," Anchor Watch "),h(),R(25,Fve,5,0,"button",98),R(26,Nve,5,0,"button",98),R(27,Bve,5,0)}if(n&2){let t=v();A(t.app.data.vessels.showSelf?0:-1),f(),A(t.course.courseData().position?1:-1),f(),A(t.app.data.vessels.showSelf||t.course.courseData().position?2:-1),f(5),A(t.mapZoomLevel()>=t.app.config.resources.notes.minZoom?7:-1),f(2),A(t.app.data.vessels.showSelf?9:-1),f(6),A(t.app.config.vessels.trail&&t.app.selfTrail().length!==0?15:-1),f(10),A(t.app.featureFlags().weatherApi?25:-1),f(),A(t.app.config.experiments&&t.mapService.featureUrls().length?26:-1),f(),A(t.addableWidgetCell?27:-1)}}var Gve=2e3,Vk=class n{setFocus;mapCenter=[0,0];mapZoom=1;movingMap=!1;northUp=!0;measureMode;drawMode;modifyMode=!1;activeRoute;vesselTrail=[];dblClickZoom=!1;overZoomTiles=!0;drawEnded=new me;activate=new me;deactivate=new me;info=new me;exitMovingMap=new me;resumeMovingMap=new me;focusVessel=new me;menuItemSelected=new me;contextMenu;olMap;routeDraw;scaleUnits=Z("");perfLaylines=$({port:[],starboard:[]});perfTargetAngle=$([]);vesselLines=$({cog:[],heading:[]});overlay=$({id:null,type:null,icon:null,position:[0,0],show:!1,title:"",content:null,featureCount:0,readOnly:!1,isSelf:!1});olMapControls=Pj;trueWindDirection=rf;olMapInteractions=$([]);mapZoomLevel=$(1);mapZoomText=Qe(()=>NV(this.mapZoomLevel()));mapCenterPositon=$([0,0]);mapRotation=$(0);showNoteslayer=$(!1);featureStyles={route:Lj,region:Nj,anchor:Fj,alarm:Bj,destination:Vj,aircraft:Gj,sar:zj,layline:jj,targetAngle:Uj,raceCourse:Aj,bearingDistance:Rj};draftRouteStyles=Oj;bufferRoutes=Qe(()=>this.routeBuffers.live().filter(e=>!e.saved||e.dirty).map(e=>this.bufferToFBRoute(e)));dfeat={aircraft:new Map,atons:new Map,sar:new Map,meteo:new Map,self:new Ad,ais:new Map,active:new Ad,navData:{position:null,startPosition:null},closest:[]};saveTimer;isDirty=!1;userPanned=!1;offsetGraceTimer;lastMoveCenter=null;refollow=new Dw(()=>this.ngZone.run(()=>this.resumeMovingMap.emit()));offsetSuppressed=!1;clickWorldOffset=0;clickMercX=0;mouse=$({pixel:null,coords:[0,0],xy:null});cursorInfo=$(null);cursorPin=new wC(()=>this.cursorInfo.set(null));cursorMarkers=Qe(()=>{let e=this.cursorPin.marker();return e?[e]:[]});pointerDownAt=0;contextMenuPosition={x:"0px",y:"0px"};addableWidgetCell=null;obsList=[];http=M(Sa);app=M(oe);skres=M(Mt);skresOther=M(dg);skstream=M(es);anchor=M(hg);notiMgr=M(ul);plotterExt=M(zu);course=M(Wr);mapInteract=M(Tc);mapService=M(ys);settings=M(Wf);bottomSheet=M(Qu);infoPanel=M(Ic);routeBuffers=M(pl);tidalCurrents=M(Rd);trackHistory=M(Uu);aisTrackMinZoom=Y1;ngZone=M(Wi);constructor(){Me(()=>{this.scaleUnits()&&this.setScaleUnits()}),this.toggleDblClickZoom()}ngAfterViewInit(){this.setScaleUnits(),setTimeout(()=>{this.setFocus="xxx"},500)}ngOnInit(){this.obsList.push(this.skstream.vessels$().subscribe(()=>this.onVessels())),this.obsList.push(this.settings.change$.subscribe(e=>{this.renderMapContents(e.includes("fetchNotes")),e.includes("trailSource")&&(this.app.serverTrailWanted()||this.app.selfTrailFromServer.update(()=>[]))}))}ngOnDestroy(){this.stopSaveTimer(),this.stopOffsetGrace(),this.refollow.cancel(),this.cursorPin.release(),this.obsList.forEach(e=>e.unsubscribe())}ngOnChanges(e){e.vesselTrail&&this.drawVesselLines(),e&&e.mapCenter&&e.mapCenter.currentValue&&this.mapCenterPositon.set(e.mapCenter.currentValue),e&&e.mapZoom&&typeof e.mapZoom.currentValue=="number"&&(this.mapZoomLevel.set(e.mapZoom.currentValue),this.renderMapContents(!0)),e&&e.movingMap&&!e.movingMap.firstChange&&(e.movingMap.currentValue?(this.refollow.cancel(),this.startSaveTimer(),this.startOffsetGrace()):(this.stopSaveTimer(),this.stopOffsetGrace(),this.userPanned=!1)),e&&e.northUp&&this.rotateMap(),e&&e.measureMode&&this.applyInteractionMode(0,e.measureMode.currentValue),e&&e.drawMode&&this.applyInteractionMode(1,e.drawMode.currentValue),e&&e.modifyMode&&!e.modifyMode.firstChange&&this.applyInteractionMode(2,e.modifyMode.currentValue),e&&e.dblClickZoom&&this.toggleDblClickZoom(e.dblClickZoom.currentValue)}setScaleUnits(){try{let e=["kilometer","m"].includes(this.scaleUnits())?"metric":"nautical";this.olMap.getMap().getControls().getArray()[0].setUnits(e)}catch(e){}}wmsParams(e){return{LAYERS:e.layers?e.layers.join(","):""}}startSaveTimer(){this.saveTimer||(this.saveTimer=setInterval(()=>{this.isDirty&&(this.app.saveConfig(),this.isDirty=!1)},3e4))}stopSaveTimer(){this.saveTimer&&(clearInterval(this.saveTimer),this.saveTimer=null)}onVessels(){let e=this.dfeat.self.position;this.dfeat.self=this.app.data.vessels.self,(!this.dfeat.self.position||!Array.isArray(this.dfeat.self.position))&&(this.dfeat.self.position=e),this.dfeat.ais=this.app.data.vessels.aisTargets,this.dfeat.aircraft=this.app.data.aircraft,this.dfeat.sar=this.app.data.sar,this.dfeat.meteo=this.app.data.meteo,this.dfeat.atons=this.app.data.atons,this.dfeat.active=this.app.data.vessels.active,this.dfeat.navData.position=this.course.courseData().position,this.dfeat.navData.startPosition=this.course.courseData().startPosition;let t=()=>{let i=[];return this.app.data.vessels.self.position&&this.app.data.vessels.closest.forEach(r=>{if(this.app.data.vessels.aisTargets.has(r)){let o=this.app.data.vessels.aisTargets.get(r);o.position&&i.push([o.position,this.app.data.vessels.self.position])}}),i};this.dfeat.closest=t(),this.dfeat.self.positionReceived&&(this.app.data.vessels.showSelf=!0),this.overlay().show&&["ais","aton","aircraft"].includes(this.overlay().type)&&(this.overlay().isSelf?this.overlay.update(i=>Object.assign({},i,{position:this.dfeat.self.position,vessel:this.dfeat.self})):this.overlay().type==="ais"&&!this.dfeat.ais.has(this.overlay().id)||this.overlay().type==="atons"&&!this.dfeat.atons.has(this.overlay().id)||this.overlay().type==="aircraft"&&!this.dfeat.aircraft.has(this.overlay().id)?this.overlay().show=!1:this.overlay().type==="ais"&&this.overlay.update(i=>Object.assign({},i,{position:this.dfeat.ais.get(i.id).position,vessel:this.dfeat.ais.get(i.id)}))),this.drawVesselLines(this.app.data.vessels.self.positionReceived),this.rotateMap(),this.movingMap&&this.centerVessel()}handleRadarError(e){this.app.showAlert("Radar",e.message),this.app.uiCtrl.update(t=>Object.assign(t,{radarLayer:!1}))}toggleDblClickZoom(e){let t=[{name:"dragpan"},{name:"dragzoom"},{name:"keyboardpan"},{name:"mousewheelzoom"},{name:"pinchzoom"}];this.olMapInteractions.update(()=>e?[{name:"doubleclickzoom"}].concat(t):[].concat(t))}onContextMenuAction(e,t){switch(e){case"add_wpt":this.skres.newWaypointAt(t);break;case"add_note":this.skres.showNoteEditor({position:t});break;case"nav_to":this.app.data.activeWaypoint=null,this.course.courseData().pointNames=[],this.course.setDestination({latitude:t[1],longitude:t[0]});break;case"bearing_dist":this.formatPopover("bearing_dist",t);break;case"weather_forecast":this.bottomSheet.open(Lw,{disableClose:!0,data:{title:"Forecast",position:t,subTitle:"Location: Cursor Position"}});break;case"measure":this.mapInteract.startMeasuring();break;case"add_widget":this.addableWidgetCell&&this.plotterExt.openAddWidgetPicker(this.addableWidgetCell.anchor,this.addableWidgetCell.cell);break;case"get_feature_info":this.getFeatureInfo();break;default:this.menuItemSelected.emit(e);break}}onMapReady(){let e=this.olMap?.getMap()?.getView().getZoom();typeof e=="number"&&(this.skstream.postMapView(this.olMap.getMapExtent(),e),this.trackHistory.setView(this.olMap.getMapExtent(),e))}onMapMoveEnd(e){if(this.app.config.map.zoomLevel=e.zoom,this.app.mapZoom.set(e.zoom),this.app.mapExtent.update(()=>e.extent),this.skstream.postMapView(e.extent,e.zoom),this.trackHistory.setView(e.extent,e.zoom),this.app.mapViewTopCenter.update(()=>e.topCenter),this.app.mapViewRightCenter.update(()=>e.rightCenter),this.app.mapViewRotation.update(()=>e.rotation),this.app.config.map.center=e.lonlat,this.userPanned){this.userPanned=!1,this.stopOffsetGrace();let t=this.app.applyPanGesture(e.lonlat);t==="release"?this.exitMovingMap.emit(!0):t==="adopted"&&this.app.saveConfigDebounced()}Ij(e,this.lastMoveCenter)&&this.refollow.reset(),this.lastMoveCenter=e.lonlat,this.drawVesselLines(),this.movingMap?this.isDirty=!0:(this.app.saveConfigDebounced(),this.isDirty=!1),this.renderMapContents(e.zoomChanged)}onMapPointerMove(e){if(this.mouse.set({pixel:e.pixel,xy:e.coordinate,coords:ri.normaliseCoords(e.lonlat)}),this.updateCursorInfo(e.lonlat),this.mapInteract.isMeasuring()){if(this.mapInteract.measureGeometryType==="LineString"&&this.mapInteract.measurement().coords.length!==0){let t=e.lonlat,i=this.mapInteract.distanceFromLastPoint(t),r=(0,y1.getGreatCircleBearing)(this.mapInteract.measurement().coords.slice(-1)[0],t);this.overlay.update(o=>Object.assign({},o,{position:t,worldOffset:e.worldOffset??0,title:`${this.app.formatValueForDisplay(i,"m")} ${this.app.formatValueForDisplay(r,"deg")}`}))}else if(this.mapInteract.measureGeometryType==="Circle"){let t=e.lonlat,i=this.mapInteract.distanceFromCenter(t),r=(0,y1.getGreatCircleBearing)(this.mapInteract.measurement().center??t,t);this.overlay.update(o=>Object.assign({},o,{position:t,worldOffset:e.worldOffset??0,title:`${this.app.formatValueForDisplay(i,"m")} ${this.app.formatValueForDisplay(r,"deg")}`}))}}}onMapPointerDrag(){this.onUserPan()}onUserPan(){this.refollow.reset(),this.app.uiConfig().mapMove&&(this.app.config.map.panBehavior==="exit"?(this.ngZone.run(()=>this.exitMovingMap.emit(!0)),this.refollow.arm(this.app.config.map.refollowDelay)):this.app.config.map.panBehavior==="offset"&&(this.userPanned=!0))}updateCursorInfo(e,t=!1){if(this.cursorPin.active&&!t)return;let i=this.app.data.vessels.self;if(!this.app.config.display.statusBar?.liveEta||!i?.positionReceived||!i.position){this.cursorInfo.set(null);return}let r=Ue.transform(1,"m/s",this.app.config.units.speed)??1,o=this.app.config.display.statusBar.referenceSpeed,a=r>0&&typeof o=="number"?o/r:0;this.cursorInfo.set(Dj(i.position,e,i.sog,a))}pinCursorAtTap(e,t){!this.app.config.display.statusBar?.liveEta||Date.now()-this.pointerDownAt>KV||(this.cursorPin.pin(e,t,qV(this.app.config.display.statusBar.tapFadeSpeed)),this.updateCursorInfo(e,!0))}onMapPointerDown(e){this.pointerDownAt=Date.now(),this.mouse.update(t=>st(ne({},t),{coords:ri.normaliseCoords(e.lonlat)})),this.contextMenuPosition.x=e.originalEvent.clientX+"px",this.contextMenuPosition.y=e.originalEvent.clientY+"px"}onMapSingleClick(e){this.clickWorldOffset=e.worldOffset??0,this.clickMercX=lt(e.lonlat)[0]+this.clickWorldOffset,this.app.data.map.atClick={features:e.features,lonlat:e.lonlat},this.mapInteract.isMeasuring()?this.parseClickInMeasureMode(e.lonlat):this.mapInteract.isDrawing()&&this.mapInteract.draw.resourceType==="route"?this.onDrawClick(e.features):this.mapInteract.isModifying()&&this.mapInteract.draw.resourceType==="route"?this.extendRouteInModify(e):!this.mapInteract.isDrawing()&&!this.mapInteract.isModifying()&&(this.app.config.map.popoverMulti||this.overlay.update(t=>Object.assign({},t,{show:!1})),this.processMapClick(e),this.pinCursorAtTap(e.lonlat,e.worldOffset??0))}onMapRightClick(e){let t=e.lonlat;this.clickWorldOffset=e.worldOffset??0,this.clickMercX=lt(t)[0]+this.clickWorldOffset,this.app.data.map.atClick={features:e.features,lonlat:t},this.app.debug("onRightClick()",this.app.data.map.atClick),this.mapInteract.isMeasuring()&&this.parseClickInMeasureMode(t)}onMapContextMenu(e){this.app.debug("onMapContextMenu()",this.app.data.map.atClick),this.onContextMenu(e)}onContextMenu(e){if(this.app.debug("onContextMenu()",this.app.data.map.atClick),!(this.app.uiCtrl().suppressContextMenu||this.overlay().show)&&(e.preventDefault(),this.contextMenuPosition.x=e.clientX+"px",this.contextMenuPosition.y=e.clientY+"px",this.addableWidgetCell=this.plotterExt.addableCellAt(e.clientX,e.clientY),this.contextMenu.menuData={item:this.mouse().coords},!this.mapInteract.isMeasuring())){if(!this.modifyMode){if(!this.mouse().xy)return;this.contextMenu.openMenu(),document.getElementsByClassName("cdk-overlay-backdrop")[0].addEventListener("contextmenu",t=>{t.preventDefault(),this.contextMenu.closeMenu()})}}}parseClickInMeasureMode(e){this.mapInteract.measureGeometryType==="LineString"&&this.mapInteract.measurement().coords.length!==0&&this.onMeasureClick(e)}toggleFeatureSelection(e,t){t==="charts"&&this.skres.chartSelected(e)}onDragBoxStart(e){let t=un(e.coordinate);this.mapInteract.initBoxCoord(t)}onDragBoxEnd(e){let t=un(e.coordinate);this.mapInteract.stopBoxSelection(t)}onDragBoxCancel(){this.app.debug("onDragBoxCancel()..."),this.mapInteract.stopBoxSelection()}onMeasureStart(e){this.app.debug("onMeasureStart()...",this.mapInteract.measureGeometryType);let t;if(this.mapInteract.measureGeometryType==="LineString"){let i=e.feature.getGeometry().getCoordinates().map(r=>un(r));i=i.slice(0,i.length-1),this.mapInteract.measurementCoords=i,t=i}else{let i=e.feature.getGeometry(),r=un(i.getCenter()),o=i.getRadius();this.mapInteract.measurementCenter=r,this.mapInteract.measurementRadius=o,t=this.mapInteract.measurementCenter,this.app.debug(this.mapInteract.measurement)}this.formatPopover(null,null),this.overlay.update(i=>Object.assign({},i,{position:t,title:"0",show:!0,type:"measure"}))}onMeasureClick(e){if(this.app.debug("onMeasureClick()..."),!Array.isArray(e))return;let t=this.mapInteract.measurement().coords[this.mapInteract.measurement().coords.length-1];if(e[0]===t[0]&&e[1]===t[1])return;let i=this.mapInteract.addMeasurementCoord(e),r=this.mapInteract.measurement().coords.slice(-2),o=(0,y1.getGreatCircleBearing)(r[0],r[1])??0;this.overlay.update(a=>Object.assign({},a,{position:e,title:`${this.app.formatValueForDisplay(i,"m")} ${this.app.formatValueForDisplay(o,"deg")}`}))}onMeasureEnd(){this.app.debug("onMeasureEnd()..."),this.overlay.update(e=>Object.assign({},e,{show:!1})),this.mapInteract.stopMeasuring()}onDrawClick(e){if(Array.isArray(e)&&this.mapInteract.draw.resourceType==="route"){let t;e.forEach(i=>{i.getGeometry().getType()==="LineString"&&(t=i.getGeometry().getCoordinates().map(r=>un(r)),t=t.slice(0,t.length-1))}),this.mapInteract.measurementCoords=t}}finishDrawing(){this.routeDraw?.finishDrawing()}undoInteraction(){this.mapInteract.isDrawing()?this.undoDrawPoint():this.mapInteract.isModifying()&&this.undoModify()}undoDrawPoint(){this.routeDraw?.removeLastPoint();let e=this.mapInteract.measurement().coords;this.mapInteract.measurementCoords=e.slice(0,Math.max(0,e.length-1))}undoModify(){let e=this.mapInteract.popModifyUndo();if(!e)return;let t=this.mapInteract.draw.features?.getArray()[0];if(!t)return;let i=t.getGeometry().getCoordinates();t.getGeometry().setCoordinates(e.coordinates),t.set("pointMetadata",e.coordsMetadata??null),this.mapInteract.draw.coordinates=e.coordinates,this.mapInteract.draw.forSave.coordsMetadata=e.coordsMetadata;let r=this.transformCoordsArray(e.coordinates);this.mapInteract.draw.forSave.coords=r,this.mapInteract.measurementCoords=r,this.mapInteract.measurementIndex=Pw(i,e.coordinates)}onDrawEnd(e){this.ngZone.run(()=>{this.mapInteract.stopDrawing(e.feature),this.drawEnded.emit(this.mapInteract.draw)})}getUnsavedRouteBuffer(e){let t=this.routeBuffers.get(e);return t&&(!t.saved||t.dirty)?t:void 0}bufferToFBRoute(e){let t=new Ts;t.name=e.name??"",t.description=e.description??"",t.feature.geometry.coordinates=e.points.map(r=>r.position);let i=sg(e.points);return i&&(t.feature.properties.coordinatesMeta=i),t.distance=ri.routeLength(t.feature.geometry.coordinates),[e.routeId,t,!0]}isUnsavedRoute(){if(this.overlay().type!=="route")return!1;let e=this.routeBuffers.get(this.overlay().id);return!!e&&(!e.saved||e.dirty)}isDraftRoute(){if(this.overlay().type!=="route")return!1;let e=this.routeBuffers.get(this.overlay().id);return!!e&&!e.saved}saveRouteFromPopover(){return Y(this,null,function*(){try{yield this.plotterExt.saveBuffer(this.overlay().id,{dialog:!0,promote:!0})}catch(e){}})}modifyFeature(e){if(this.mapInteract.draw.features.getLength()===0)return;let t=this.mapInteract.draw.features.getArray()[0]?.getGeometry();if(t){let i=t.getExtent(),r=(i[0]+i[2])/2,o=Mm(this.clickMercX-r,_1);o&&this.mapInteract.draw.features.forEach(a=>a.getGeometry()?.translate(o,0))}if(this.mapInteract.startModifying(this.overlay()),this.overlay().type==="route"){let i=this.overlay().id,r=this.overlay().resource;this.mapInteract.draw.name=Array.isArray(r)?r[1]?.name??"":"",this.mapInteract.measurementCoords=this.routeBuffers.has(i)?this.routeBuffers.get(i).points.map(o=>o.position):this.skres.fromCache("routes",i)[1].feature.geometry.coordinates}e==="anchor"&&(this.overlay().type=e,this.mapInteract.draw.forSave.id=e)}onModifyStart(e){let t=e.features.getArray()[0];if(this.mapInteract.draw.coordinates=t.getGeometry().getCoordinates(),this.mapInteract.draw.forSave.id||(this.mapInteract.draw.forSave.id=t.getId()),t.getGeometry().getType()==="LineString"){let i=t.get("pointMetadata");i&&(this.mapInteract.draw.forSave.coordsMetadata=i)}}onModifyEnd(e){this.ngZone.run(()=>this.applyModifyEnd(e))}applyModifyEnd(e){let t=e.features.getArray()[0],i=t.getId(),r=t.getGeometry().getCoordinates();if(i.split(".")[0]==="route"){let a=this.mapInteract.draw.forSave.coordsMetadata;this.mapInteract.pushModifyUndo({coordinates:this.mapInteract.draw.coordinates.map(s=>[...s]),coordsMetadata:a?a.map(s=>ne({},s)):void 0})}t.getGeometry().getType()==="LineString"&&this.updateCoordsMeta(this.mapInteract.draw.coordinates,r,this.mapInteract.draw.forSave.coordsMetadata);let o;if(i.split(".")[0]==="route")o=this.transformCoordsArray(r),this.mapInteract.measurementCoords=o,this.mapInteract.measurementIndex=Pw(this.mapInteract.draw.coordinates,r);else if(i.split(".")[0]==="region"){for(let a=0;a<r.length;a++)if(this.isCoordsArray(r[a]))r[a]=this.transformCoordsArray(r[a]);else for(let s=0;s<r[a].length;s++)this.isCoordsArray(r[a][s])?r[a][s]=this.transformCoordsArray(r[a][s]):console.log("Invalid polygon coordinates!");o=r}else o=un(r),i==="anchor"&&this.anchor.setAnchorPosition(o).catch(a=>{this.app.parseHttpErrorResponse(a)});this.mapInteract.draw.forSave.coords=o,this.app.data.activeRoute&&this.mapInteract.draw.forSave.id.indexOf(this.app.data.activeRoute)!==-1?this.app.data.activeRouteIsEditing=!0:this.app.data.activeRouteIsEditing=!1,this.app.data.editingId=this.mapInteract.draw.forSave.id,this.app.debug(this.mapInteract.draw.forSave)}extendRouteInModify(e){let t=this.mapInteract.draw.features?.getArray()[0],i=t?.getGeometry();if(!t||i?.getType()!=="LineString")return;let r=i,o=Tp(e.originalEvent?.pointerType,10,15),a=this.olMap.getMap().getFeaturesAtPixel(e.pixel,{hitTolerance:o}).some(p=>p.getId()===t.getId());if(!Wj({onRoute:a,vertexDeleted:jA(this.olMap.getMap())}))return;let s=this.mapInteract.draw.forSave.coordsMetadata;if(!s){let p=t.get("pointMetadata");s=Array.isArray(p)?p:void 0}let l=r.getExtent(),c=Hj(r.getCoordinates(),s,lt(e.lonlat),l[0],l[2]);this.mapInteract.pushModifyUndo(c.undo),r.setCoordinates(c.after),c.meta&&t.set("pointMetadata",c.meta),this.mapInteract.draw.forSave.id||(this.mapInteract.draw.forSave.id=t.getId()),this.mapInteract.draw.forSave.coordsMetadata=c.meta,this.mapInteract.draw.coordinates=c.after;let d=this.transformCoordsArray(c.after);this.mapInteract.draw.forSave.coords=d,this.mapInteract.measurementCoords=d,this.mapInteract.measurementIndex=Pw(c.undo.coordinates,c.after),this.app.data.activeRouteIsEditing=!!this.app.data.activeRoute&&this.mapInteract.draw.forSave.id.indexOf(this.app.data.activeRoute)!==-1,this.app.data.editingId=this.mapInteract.draw.forSave.id}activeRoutePoint(e){let t=this.course.courseData(),i=Yp(e,t.pointTotal,this.app.data.activeRouteReversed);return{index:e,total:t.pointTotal,name:t.pointNames?.[i]||void 0,position:t.activeRoutePoints?.[i],isNext:e===t.pointIndex}}activeRouteHasUnsavedEdits(){return ag(this.routeBuffers.getForRoute(this.activeRoute))}activeRoutePointAt(e,t,i){let r=t.getGeometry();if(!this.activeRoute||i!==this.activeRoute||!(r instanceof Nt)||this.activeRouteHasUnsavedEdits())return null;let o=r.getCoordinates(),a=YG(o,e.coordinate,e.map.getView().getResolution(),e.originalEvent?.pointerType==="touch"?hk.touch:hk.mouse,_1);return a.length?QG(a.map(s=>Yp(s,o.length,this.app.data.activeRouteReversed)),this.course.courseData().pointIndex):null}processMapClick(e){this.s57Features={},this.trackHistoryFeatures={};let t=new Map,i=new Map,r=[],o=!1;if(e.features.forEach(a=>{let s=a.getId(),l=!1,c,d,p,m,g,y,b;if(s&&typeof s=="string"){let S=s.split(".");if(S[0]==="chart-backdrop"){o=!0;return}switch(S[0]==="chart-bound"&&i.set(s,{id:S[1],coord:e.lonlat,icon:"map",text:a.get("name")}),S[0]){case"rset":l=!0,y={name:"star",svgIcon:void 0},b=a.get("name");break;case"alarm":l=!0,y={name:"notification_important",svgIcon:void 0},b=`Alarm: ${a.get("type")}`;break;case"anchor":l=!0,y={name:"anchor",svgIcon:void 0},b=`${S[0]}`;break;case"dest":l=!0,y={name:"flag",svgIcon:void 0},b="Destination";break;case"note":{y={svgIcon:a.get("icon"),name:void 0},l=!0,b=this.skres.fromCache("notes",S[1])[1].name??"";break}case"route":{let E=this.activeRoutePointAt(e,a,S[1]);if(E!==null){s=`rtept.${E}`,y={name:"location_on",svgIcon:void 0,class:"icon-route"},l=!0,b=this.activeRoutePoint(E).name||`Route point ${E+1}`;break}y={svgIcon:"route",name:void 0,class:"icon-route"},l=!0;let k=this.getUnsavedRouteBuffer(S[1]);k?b=k.name||"Route (unsaved)":b=this.skres.fromCache("routes",S[1])[1].name;break}case"waypoint":{y={name:"location_on",svgIcon:void 0,class:"icon-waypoint"},l=!0,b=this.skres.fromCache("waypoints",S[1])[1].name??"";break}case"atons":case"aton":case"shore":y={name:"beenhere",svgIcon:void 0},l=!0,c=this.app.data.atons.get(s),b=c?c.name||c.mmsi:"";break;case"sar":y={name:"tour",svgIcon:void 0},l=!0,d=this.app.data.sar.get(s),b=d?d.name||d.mmsi:"SaR Beacon";break;case"meteo":y={name:"air",svgIcon:void 0},l=!0,p=this.app.data.meteo.get(s),b=p?p.name||p.mmsi:"Weather Station";break;case"ais-vessels":y={name:"directions_boat",svgIcon:void 0},l=!0,g=this.dfeat.ais.get(`vessels.${S[1]}`),b=g?g.name||g.mmsi:"";break;case"vessels":y={name:"directions_boat",svgIcon:void 0},l=!0,b=this.dfeat.self.name?this.dfeat.self.name+" (self)":"self";break;case"region":l=!0,y={name:"tab_unselected",svgIcon:void 0,class:"icon-region"},b=a.get("name");break;case"aircraft":y={name:"airplanemode_active",svgIcon:void 0},l=!0,m=this.app.data.aircraft.get(s),b=m?m.name||m.mmsi:"";break;case ef:l=!0,y={name:"history",svgIcon:void 0},b=`Track history: ${this.trackHistory.label(a.get("context"))}`,this.trackHistoryFeatures[s]={context:a.get("context"),lines:[a.get("line")],times:a.get("times")?[a.get("times")]:void 0,at:e.lonlat};break;case"track-vessels":{let E=s.slice(6),k=this.app.aisTracksTimed().get(E);k&&(l=!0,y={name:"history",svgIcon:void 0},b=`Vessel track: ${this.trackHistory.label(E)}`,this.trackHistoryFeatures[s]={context:E,lines:k.lines,times:k.times,at:e.lonlat});break}case"trail":{let E=s==="trail.self.server"||s==="trail.self.local"?Yj(this.app.selfTrailTimed(),this.app.selfTrailFromServer().length>0,this.app.localTrailTimed()):null;E?.lines.length&&(l=!0,y={name:"history",svgIcon:void 0},b="Vessel trail",this.trackHistoryFeatures[s]={context:"self",lines:E.lines,times:E.times,at:e.lonlat});break}case"tidal":l=!0,y={name:"water",svgIcon:void 0},b=a.get("name"),this.tidalFeatures[s]={speedKn:Number(a.get("driftKts"))||0,direction:Number(a.get("setDeg"))||0};break}}else if(!s&&a.getProperties){let S=a.getProperties();S.RCID&&Cj.has(S.layer)&&(s=`s57.${S.LNAM}`,l=!0,y={name:"beenhere",svgIcon:void 0},b=Ok[S.layer],this.s57Features[s]=S)}l&&!t.has(s)&&(t.set(s,{id:s,coord:e.lonlat,icon:y,text:b}),r.push(a))}),Xj(t.keys()).forEach(a=>t.delete(a)),[...t.keys()].some(a=>a.startsWith("rtept."))&&[...t.keys()].filter(a=>a.startsWith("dest.")).forEach(a=>t.delete(a)),t.has("trail.self.server")&&t.has("trail.self.local")&&t.delete("trail.self.local"),i.size>0){this.formatPopover("chartlist.",e.lonlat,i);return}if(!o)if(this.mapInteract.draw.features=new Vn(r),t.size===1){let a=t.values().next().value;this.formatPopover(a.id,a.coord)}else t.size>1&&this.formatPopover("list.",e.lonlat,t)}s57Features={};trackHistoryFeatures={};tidalFeatures={};formatPopover(e,t,i){if(!e){this.overlay.update(l=>Object.assign({},l,{show:!1}));return}let r={show:!1,content:[],id:null,type:null,title:null,featureCount:this.mapInteract.draw.features?.getLength(),position:t,worldOffset:this.clickWorldOffset,readOnly:!1,isSelf:!1},o,a=e.split("."),s;switch(a[0]){case"s57":r.id=e,r.title="S57 Feature",r.type="s57",r.s57Feature=this.s57Features[e],r.position=t,r.show=!0,r.readOnly=!0;break;case"anchor":this.modifyFeature("anchor");return;case"bearing_dist":{let l=ri.distanceTo(this.app.data.vessels.self.position,t)??0,c=(0,y1.getGreatCircleBearing)(this.app.data.vessels.self.position,t)??0;r.type=a[0],r.title=`${this.app.formatValueForDisplay(l,"m")} ${this.app.formatValueForDisplay(c,"deg")}`,r.position=t,r.show=!0;break}case"list":r.type=a[0],r.title="Features",r.content=[],i.forEach(l=>r.content.push(l)),r.show=!0;break;case"chartlist":r.type=a[0],r.content=[],i.forEach(l=>r.content.push(l)),r.show=!0;break;case"alarm":{s=e.split(".").slice(1).join(".");let l=this.notiMgr.getAlert(s);if(!l)return!1;r.type=a[0],r.alarm=l,r.id=s,r.show=!0;break}case"vessels":r.type="ais",r.isSelf=!0,r.vessel=this.dfeat.self,r.position=this.dfeat.self.position,r.show=!0;break;case"ais-vessels":if(s=e.slice(4),!this.dfeat.ais.has(s))return!1;r.type="ais",r.id=s,r.vessel=this.dfeat.ais.get(s),r.position=r.vessel.position,r.show=!0;break;case"atons":case"aton":case"shore":if(!this.app.data.atons.has(e))return!1;r.type="aton",r.id=e,r.aton=this.app.data.atons.get(e),r.position=r.aton.position,r.show=!0;break;case"sar":if(!this.app.data.sar.has(e))return!1;r.type="aton",r.id=e,r.aton=this.app.data.sar.get(e),r.position=r.aton.position,r.show=!0;break;case"meteo":if(!this.app.data.meteo.has(e))return!1;r.type=a[0],r.id=e,r.aton=this.app.data.meteo.get(e),r.position=r.aton.position,r.show=!0;break;case"aircraft":if(!this.app.data.aircraft.has(e))return!1;r.type=a[0],r.id=e,r.aircraft=this.app.data.aircraft.get(e),r.position=r.aircraft.position,r.show=!0;break;case"trail":case"track-vessels":case ef:{let l=this.trackHistoryFeatures[e];if(!l)return;let c=DP(l.lines,l.times,l.at),d=p=>Kp(new Date(p).toISOString());r.id=e,r.type=ef,r.position=t,r.show=!0,r.readOnly=!0,r.trackHistory={name:this.trackHistory.label(l.context),start:c&&d(c.start),end:c&&d(c.end),duration:c&&IP(c.duration),at:c?.atTime!==void 0?d(c.atTime):void 0};break}case"tidal":{let l=this.tidalFeatures[e];r.id=e,r.type="tidal",r.position=t,r.show=!0,r.readOnly=!0,l&&(r.tidal={speedLabel:this.tidalCurrents.formatSpeed(l.speedKn),directionLabel:`${this.app.formatValueForDisplay(l.direction,"deg",{precision:0})}T`});break}case"region":if(o=[this.skres.fromCache("regions",a[1])],!o)return!1;r.id=a[1],r.type=a[0],r.title="Region",r.resource=o[0],r.show=!0,r.readOnly=o[0][1]?.feature?.properties?.readOnly??!1,this.infoPanel.opened()&&(this.overlay.set(r),this.popoverInfo());break;case"note":if(o=this.skres.fromCache("notes",a[1]),!o)return!1;r.readOnly=o[1]?.properties?.readOnly??!1,r.id=a[1],r.type=a[0],r.title="Note",r.resource=o,r.show=!0,this.app.config.display.singleClickNoteDetails?(r.show=!1,this.overlay.set(r),this.popoverInfo()):this.infoPanel.opened()&&(this.overlay.set(r),this.popoverInfo());break;case"route":{let l=this.getUnsavedRouteBuffer(a[1]);if(l){let c=this.bufferToFBRoute(l)[1];c.name=c.name||"(unsaved)",r.id=a[1],r.type="route",r.title="Route (unsaved)",r.resource=[a[1],c],r.show=!0,r.readOnly=!1}else{if(o=[this.skres.fromCache("routes",a[1])],!o)return!1;r.id=a[1],r.type=a[0],r.title="Route",r.resource=o[0],r.show=!0,r.readOnly=o[0][1]?.feature?.properties?.readOnly??!1}this.infoPanel.opened()&&(this.overlay.set(r),this.popoverInfo());break}case"waypoint":if(o=[this.skres.fromCache("waypoints",a[1])],!o)return!1;r.id=a[1],r.type=a[0],r.resource=o[0],r.title="Waypoint",r.show=!0,r.readOnly=o[0][1]?.feature?.properties?.readOnly??!1,this.infoPanel.opened()&&(this.overlay.set(r),this.popoverInfo());break;case"rtept":{let l=Number(a[1]);r.id=e,r.type="rtept",r.routePoint=this.activeRoutePoint(l),r.title=r.routePoint.name||"Route point",r.show=!0;break}case"dest":r.id=e,r.type="destination",r.resource=this.skres.buildWaypoint(t),r.title=this.course.courseData().destPointName??"Destination",r.show=!0;break;case"rset":r.id=e,r.type=a[0],r.resourceSet=this.skresOther.fromResourceSetCache(e,!0),r.title=r.resourceSet?.properties?.name??"Resource Set",r.show=!!r.resourceSet;break;default:return}this.overlay.set(r)}featureListSelection(e){let t=new Vn;this.mapInteract.draw.features.forEach(i=>{i.getId()===e.id&&t.push(i)}),this.mapInteract.draw.features=t,this.formatPopover(e.id,e.coord)}popoverInfo(){let e=`${this.overlay().type}s`;if(["notes","regions","waypoints","routes"].includes(e)&&this.app.useInfoPanel()){let t=this.getUnsavedRouteBuffer(this.overlay().id);e==="routes"&&t?this.infoPanel.openWith("routes",this.bufferToFBRoute(t)):this.infoPanel.open(e,this.overlay().id)}else this.skres.resourceProperties(this.overlay())}popoverClosed(){this.overlay.update(e=>Object.assign({},e,{show:!1}))}updateCoordsMeta(e,t,i){if(!i)return;let r=t.length>e.length?"ADD":t.length<e.length?"DELETE":"MOVE";function o(a){return a.map(s=>`${s[0]} - ${s[1]}`)}if(r==="MOVE")return $j(e,t,i,a=>this.skres.fromCache("waypoints",a.split("/").pop())?.[1]?.name),i;if(e=o(e),t=o(t),r==="DELETE"){for(let a=0;a<e.length;a++)t.includes(e[a])||i.splice(a,1);return i}else if(r==="ADD"){for(let a=0;a<t.length;a++)if(e[a]!==t[a]){i.splice(a,0,{name:""});break}return i}else return i}onMapKeydown(e){let t=Tj(e);if(t){e.preventDefault(),this.zoomMap(t==="in");return}Ej(e)&&this.onUserPan()}zoomMap(e){let{min:t,max:i}=this.app.MAP_ZOOM_EXTENT,r=this.app.config.map.zoomLevel,o=e?Math.min(r+1,i):Math.max(r-1,t);if(o!==r){if(this.movingMap&&!this.offsetSuppressed&&!this.userPanned){let a=this.app.config.map.centerOffset;(a.x||a.y)&&this.mapCenterPositon.set(this.app.calcMapCenter(!0,o-r,this.mapRotation()))}this.mapZoomLevel.set(o),this.app.config.map.zoomLevel=o}}rotateMap(){this.northUp?this.mapRotation.set(0):this.mapRotation.update(()=>0-this.dfeat.active.orientation)}centerVessel(){if(this.userPanned)return;let e=this.app.calcMapCenter(!this.offsetSuppressed,0,this.mapRotation());this.mapCenterPositon.update(()=>e)}startOffsetGrace(){this.stopOffsetGrace(),this.offsetSuppressed=!0,this.centerVessel(),this.offsetGraceTimer=setTimeout(()=>{this.offsetSuppressed=!1,this.centerVessel()},Gve)}stopOffsetGrace(){clearTimeout(this.offsetGraceTimer),this.offsetGraceTimer=void 0,this.offsetSuppressed=!1}drawVesselLines(e=!1){let t=this.mapZoomLevel(),i=t<29?Cx[Math.floor(t)]:60,r=10;e&&this.app.addToSelfTrail(this.dfeat.self.position),this.buildLaylines(),this.vesselLines.update(()=>{let o=this.dfeat.active.vectors.cog??[],a=this.dfeat.active.sog||0,s=this.app.config.vessels.selfLines.heading.length===-1?(a>r?r:a)*i:Ue.nauticalMilesToKm(this.app.config.vessels.selfLines.heading.length)*1e3,l=[this.dfeat.active.position,ri.rhumbDestination(this.dfeat.active.position,this.dfeat.active.orientation,s)];return{cog:o,heading:l}})}buildLaylines(){let e=this.app.config.vessels.laylines&&typeof(this.app.data.vessels.active.headingTrue??this.app.data.vessels.active.headingMagnetic)=="number"?Mj(this.app.data.vessels.active.position,this.dfeat.navData.position,this.app.data.vessels.self):null,t=e?Sj(e):Fk;this.perfTargetAngle.set(t.targetAngle),this.perfLaylines.set({port:t.port,starboard:t.starboard})}deleteFeature(e,t){return Y(this,null,function*(){switch(t){case"waypoint":this.skres.deleteWaypoint(e);break;case"route":{let i=this.routeBuffers.get(e);i&&!i.saved?this.routeBuffers.delete(e):(yield this.skres.deleteRoute(i?.href??e))&&i&&this.routeBuffers.delete(e,!1);break}case"note":this.skres.deleteNote(e);break;case"region":this.skres.deleteRegion(e);break}})}hideFeature(e,t){t==="route"&&this.skres.routeHide(e)}setActiveFeature(){this.overlay().type==="waypoint"?this.course.navigateToWaypoint(this.overlay().id):this.activate.emit(this.overlay().id)}clearActiveFeature(){this.deactivate.emit(this.overlay().id)}rejoinRouteAt(e){this.course.rejoinRouteAt(e)}skipRoutePoint(e){this.course.skipRoutePoint(e)}itemInfo(e,t,i=!1){t==="ais"&&i?this.info.emit({id:e,type:"self"}):this.info.emit({id:e,type:t})}popoverPoints(){let e=this.getUnsavedRouteBuffer(this.overlay().id);this.info.emit({id:this.overlay().id,type:this.overlay().type,resource:e?this.bufferToFBRoute(e):void 0})}setActiveVessel(e=null){this.focusVessel.emit(e)}applyInteractionMode(e,t){this.overlay.update(i=>Object.assign({},i,{show:!1})),e===0&&(this.mapInteract.draw.style=t?this.mapInteract.measureGeometryType==="Circle"?Jp.radius:Jp.measure:Jp.default),e===1&&(this.mapInteract.draw.style=this.mapInteract.draw.resourceType==="route"?Jp.route:this.mapInteract.draw.resourceType==="region"?Jp.region:Jp.default)}isCoordsArray(e){return Array.isArray(e)?Array.isArray(e[0])&&typeof e[0][0]=="number":!1}transformCoordsArray(e){return e.map(t=>un(t))}applyStyle(){return new he({fill:new Ve({color:"#e0d10e"}),stroke:new be({color:"#444",width:1})})}renderMapContents(e){this.shouldFetchNotes(e)&&(this.skres.refreshNotes(),this.app.debug("fetching Notes...")),this.shouldFetchResourceSets(e)&&(this.app.debug("fetching ResourceSets..."),this.skresOther.refreshResourceSetsInBounds())}mapMoveThresholdExceeded(e){if(!this.app.data.lastGet)return this.app.data.lastGet=this.app.config.map.center,!0;let t=ri.distanceTo(this.app.data.lastGet,this.app.config.map.center);this.app.debug(`distance map moved: ${t}`);let i=this.app.config.units.distance==="kilometer"?e*1e3:Ue.nauticalMilesToKm(e)*1e3;return this.app.debug(`mapMoveThresholdExceeded: ${t>=i/2}`),t>=i/2?(this.app.data.lastGet=this.app.config.map.center,!0):!1}shouldFetchResourceSets(e){return this.app.config.resources.fetchRadius!==0&&this.app.config.resources.fetchFilter&&this.skresOther.anyResourceSetSelection()?e?!0:this.mapMoveThresholdExceeded(50):!1}shouldFetchNotes(e){return this.showNoteslayer.update(()=>this.app.config.ui.showNotes&&this.app.config.map.zoomLevel>=this.app.config.resources.notes.minZoom),this.app.debug(`lastGet: ${this.app.data.lastGet}`),this.app.debug(`getRadius: ${this.app.config.resources.notes.getRadius}`),e?!(this.mapZoomLevel()<this.app.config.resources.notes.minZoom):this.mapMoveThresholdExceeded(this.app.config.resources.notes.getRadius)}getFeatureInfo(){}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["fb-map"]],viewQuery:function(t,i){if(t&1&&Ot(hl,7)(uye,5)(pye,5),t&2){let r;Ee(r=Ie())&&(i.contextMenu=r.first),Ee(r=Ie())&&(i.olMap=r.first),Ee(r=Ie())&&(i.routeDraw=r.first)}},inputs:{setFocus:"setFocus",mapCenter:"mapCenter",mapZoom:"mapZoom",movingMap:"movingMap",northUp:"northUp",measureMode:"measureMode",drawMode:"drawMode",modifyMode:"modifyMode",activeRoute:"activeRoute",vesselTrail:"vesselTrail",dblClickZoom:"dblClickZoom",overZoomTiles:"overZoomTiles",scaleUnits:[1,"scaleUnits"]},outputs:{drawEnded:"drawEnded",activate:"activate",deactivate:"deactivate",info:"info",exitMovingMap:"exitMovingMap",resumeMovingMap:"resumeMovingMap",focusVessel:"focusVessel",menuItemSelected:"menuItemSelected"},features:[Se],decls:74,vars:128,consts:[["olMap",""],["contextMenu","matMenu"],["routeDraw",""],["olView","",3,"mapMoveEnd","mapReady","mapSingleClick","mapRightClick","mapPointerDown","mapPointerMove","mapPointerDrag","mapContextMenu","contextmenu","keydown","logo","olInteractions","olControls","setFocus","zoom","center","rotation","minZoom","maxZoom","enableAnimation"],[3,"type","style","stopClick"],[3,"type","stopClick","style"],[3,"features"],[1,"ol-zoom"],["mat-mini-fab","","matTooltip","Zoom out",1,"button-accent",3,"click","disabled"],["mat-mini-fab","","matTooltip","Zoom in",1,"button-accent",3,"click","disabled"],[1,"ol-mouse-position"],[2,"background-color","rgba(250, 250, 250, 0.7)","padding","0 5px 0 5px"],[3,"innerText"],[3,"position","heading","mapZoom","zIndex","opacity"],[3,"darkMode","tracks","labelMinZoom","mapZoom","zIndex"],[3,"tracks","zIndex"],[3,"ghosts","iconScale","zIndex"],["targetContext","vessels",3,"tracks","showAll","selectedIds","tracksMinZoom","updateIds","removeIds","mapZoom","zIndex"],[3,"routes","routeStyles","activeRoute","darkMode","labelMinZoom","mapZoom","zIndex"],[3,"points","pointIndex","reverse","zIndex"],[3,"darkMode","waypoints","activeWaypoint","labelMinZoom","mapZoom","zIndex"],["targetContext","atons",3,"darkMode","targets","labelMinZoom","mapZoom","updateIds","staleIds","removeIds","inactiveTime","zIndex"],["targetContext","shore.basestations",3,"darkMode","targets","labelMinZoom","mapZoom","updateIds","staleIds","removeIds","inactiveTime","zIndex"],["targetContext","meteo",3,"darkMode","targets","windIndicator","labelMinZoom","mapZoom","updateIds","staleIds","removeIds","inactiveTime","zIndex"],["targetContext","aircraft",3,"darkMode","targets","targetStyles","labelMinZoom","mapZoom","updateIds","staleIds","removeIds","inactiveTime","zIndex"],["targetContext","sar",3,"darkMode","targets","targetStyles","labelMinZoom","mapZoom","updateIds","staleIds","removeIds","inactiveTime","zIndex"],[3,"startLine","racecourseStyles","darkMode","labelMinZoom","mapZoom","zIndex"],[3,"regions","regionStyles","darkMode","labelMinZoom","mapZoom","zIndex"],[3,"notes","zIndex"],[3,"position","worldOffset","positioning"],[3,"radius","anchorPosition","vesselPosition","anchorStyles","zIndex"],[3,"cpaLines","zIndex"],[3,"alarms","alarmStyles","zIndex"],[3,"position","maxCircles","fixedMode","fixedDistance","mapZoom","darkMode","minZoom","units","zIndex"],[3,"coords","lineStyle","mapZoom","zIndex"],[3,"coords","cogTime","lineStyle","units","darkMode","labelMinZoom","mapZoom","zIndex"],[3,"twd","tws","awa","aws","position","zIndex"],[3,"position","heading","id","activeId","iconScale","fixedLocation","stale","zIndex"],[3,"localTrail","serverTrail","trailStyles","zIndex"],[3,"show","opacity","indicator"],[3,"show","opacity"],[3,"position","worldOffset","positioning","stopEvent"],[3,"zIndex","charts","layerProperties"],[2,"visibility","hidden","position","fixed",3,"matMenuTriggerFor"],[3,"contextmenu"],["matMenuContent",""],[3,"boxStart","boxEnd","boxCancel"],[3,"drawStart","drawEnd","type","stopClick"],[3,"drawEnd","type","stopClick"],[3,"modifyStart","modifyEnd","features"],[3,"zIndex","chart"],[3,"zIndex","chart","overZoomTiles","mapMaxZoom"],[3,"onError","position","heading","mapZoom","zIndex","opacity"],[3,"darkMode","collection","resourceSets","labelMinZoom","mapZoom","zIndex"],[3,"targetContext","targets","vectorApparent","mapZoom","labelMinZoom","focusId","filterIds","filterByShipType","filterShipTypes","updateIds","staleIds","removeIds","inactiveTime","zIndex","darkMode"],[3,"flagged","targetContext","targets","mapZoom","labelMinZoom","focusId","filterIds","filterByShipType","filterShipTypes","updateIds","staleIds","removeIds","inactiveTime","zIndex","darkMode"],["targetContext","vessels",3,"darkMode","targets","labelMinZoom","mapZoom","updateIds","staleIds","removeIds","inactiveTime","zIndex","focusId","filterIds","filterByShipType","filterShipTypes","cogLineLength"],[3,"closed","navigateTo","title","canClose","measure","navTo"],[3,"markerPosition","vesselPosition","showMarker","markerName","bearingStyles","labelMinZoom","mapZoom","zIndex"],[3,"title","canClose","measure"],[3,"canClose","features"],[3,"canClose","title","features"],[3,"canClose","properties"],[3,"title","icon","canClose"],[3,"canClose","compact"],[3,"canClose","title","type","resource","active","featureCount","units","canSave","canStart"],[3,"canClose","title","resource"],[3,"canClose","aton"],[3,"canClose","aircraft"],[3,"canClose","point"],[3,"canClose","alarm","id"],[3,"closed","title","canClose","measure"],[3,"selected","closed","canClose","features"],[3,"selected","closed","canClose","title","features"],[3,"closed","canClose","properties"],[3,"closed","title","icon","canClose"],[2,"opacity","0.7"],[2,"display","flex","gap","12px"],[2,"font-weight","bold"],[2,"flex","1 1 auto","text-align","right"],[3,"closed","canClose","compact"],[2,"display","flex","align-items","center","gap","8px"],[2,"font-size","22px","height","22px","width","22px"],[2,"display","flex","flex-direction","column","gap","2px"],[2,"display","flex","align-items","center","gap","6px"],[2,"font-size","16px","height","16px","width","16px"],[3,"modify","save","delete","hide","addNote","activated","deactivated","related","notes","info","points","closed","canClose","title","type","resource","active","featureCount","units","canSave","canStart"],[3,"modify","delete","info","closed","canClose","title","resource"],[3,"info","focused","markPosition","closed","canClose","vessel","useMagnetic","isActive","isSelf"],[3,"info","closed","canClose","aton"],[3,"info","closed","canClose","aircraft"],[3,"rejoin","skip","closed","canClose","point"],[3,"info","goto","closed","canClose","alarm","id"],[3,"color","startPosition","destPosition","zIndex","visible","layerProperties"],[3,"radius","position","zIndex"],[3,"line","lineStyle","position","twd","mapZoom","zIndex"],[3,"lines","laylineStyles","position","twd","mapZoom","zIndex"],[1,"cursor-marker"],["mat-menu-item",""],["mat-menu-item","",3,"click","contextmenu"],[1,"icon-waypoint"],["mat-menu-item","",3,"contextmenu","click"],["mat-menu-item","",3,"click"]],template:function(t,i){if(t&1&&(u(0,"ol-map",3,0),T("mapMoveEnd",function(o){return i.onMapMoveEnd(o)})("mapReady",function(){return i.onMapReady()})("mapSingleClick",function(o){return i.onMapSingleClick(o)})("mapRightClick",function(o){return i.onMapRightClick(o)})("mapPointerDown",function(o){return i.onMapPointerDown(o)})("mapPointerMove",function(o){return i.onMapPointerMove(o)})("mapPointerDrag",function(){return i.onMapPointerDrag()})("mapContextMenu",function(o){return i.onMapContextMenu(o)})("contextmenu",function(o){return i.onContextMenu(o)})("keydown",function(o){return i.onMapKeydown(o)}),R(2,Cye,1,0,"ol-dragbox"),R(3,wye,1,4,"ol-draw",4),R(4,Mye,2,4,"ol-draw",5),R(5,Sye,1,1,"ol-modify",6),u(6,"ol-control")(7,"ol-content")(8,"div",7)(9,"button",8),T("click",function(){return i.zoomMap(!1)}),u(10,"mat-icon"),_(11,"remove"),h()(),_(12," \xA0 "),u(13,"button",9),T("click",function(){return i.zoomMap(!0)}),u(14,"mat-icon"),_(15,"add"),h()()()()(),u(16,"ol-control")(17,"ol-content")(18,"div",10)(19,"span",11),R(20,Tye,2,0,"span"),z(21,"span",12),bt(22,"coords"),_(23," \xA0 "),R(24,Eye,2,0,"span"),z(25,"span",12),bt(26,"coords"),_(27," \xA0 "),z(28,"span",12),R(29,kye,5,4),h()()()(),Ae(30,Nye,7,1,null,null,Bk),R(32,Bye,1,5,"fb-radar",13),R(33,Vye,1,5,"fb-tracks",14),R(34,Gye,1,2,"fb-track-history",15),R(35,zye,1,3,"fb-track-history-ghosts",16),R(36,jye,1,8,"ais-targets-track",17),Ae(37,Uye,2,6,"div",null,Bk),z(39,"fb-routes",18)(40,"fb-routes",18),R(41,Wye,1,4,"fb-route-direction",19),z(42,"fb-waypoints",20)(43,"sk-ais-targets",21)(44,"sk-ais-targets",22),R(45,Hye,1,10,"sk-ais-targets",23),R(46,Kye,4,30,"div"),R(47,qye,1,10,"sk-ais-targets",24),R(48,Zye,1,10,"sk-ais-targets",25),z(49,"racing-start-line",26)(50,"fb-regions",27),R(51,Xye,1,2,"fb-notes",28),R(52,Yye,3,14),R(53,fve,14,16,"ol-overlay",29),R(54,gve,1,5,"fb-anchor-alarm",30),R(55,_ve,1,2,"fb-cpa-alarms",31),z(56,"fb-alarms",32),R(57,Cve,4,4),R(58,wve,1,9,"fb-range-circles",33),R(59,Mve,1,4,"fb-heading-line",34),R(60,Sve,1,8,"fb-cog-line",35),R(61,Tve,1,6,"fb-wind-lines",36),z(62,"fb-vessel",37),R(63,Eve,1,3,"fb-vessel-trail",38),z(64,"fb-weather-wind",39)(65,"fb-weather-currents",40)(66,"fb-tidal-currents",40),Ae(67,Ive,2,6,"ol-overlay",41,xye),R(69,kve,1,4,"fb-chart-bounds",42),h(),z(70,"div",43),u(71,"mat-menu",44,1),T("contextmenu",function(o){return o.preventDefault()}),St(73,Vve,28,9,"ng-template",45),h()),t&2){let r,o=Be(72);vt("cursor",i.mapInteract.isDrawing()||i.mapInteract.isModifying()||i.mapInteract.isMeasuring()?"crosshair":"initial"),w("logo",!1)("olInteractions",i.olMapInteractions())("olControls",i.olMapControls)("setFocus",i.setFocus)("zoom",i.mapZoomLevel())("center",i.mapCenterPositon())("rotation",i.mapRotation())("minZoom",i.app.MAP_ZOOM_EXTENT.min)("maxZoom",i.app.MAP_ZOOM_EXTENT.max)("enableAnimation",!1),f(2),A(i.mapInteract.isBoxSelecting()?2:-1),f(),A(i.mapInteract.isMeasuring()?3:-1),f(),A(i.mapInteract.isDrawing()?4:-1),f(),A(i.mapInteract.isModifying()&&i.mapInteract.draw.features?5:-1),f(4),w("disabled",i.mapZoomLevel()<=i.app.MAP_ZOOM_EXTENT.min),f(4),w("disabled",i.mapZoomLevel()>=i.app.MAP_ZOOM_EXTENT.max),f(5),vt("bottom",i.plotterExt.statusBarLift()>0?i.plotterExt.statusBarLift()+"px":null),f(2),A(i.app.config.units.positionFormat==="XY"?20:-1),f(),w("innerText",Mi(22,121,i.mouse().coords[1],i.app.config.units.positionFormat,!0)),f(3),A(i.app.config.units.positionFormat==="XY"?24:-1),f(),w("innerText",$n(26,125,i.mouse().coords[0],i.app.config.units.positionFormat)),f(3),w("innerText","Zm: "+i.mapZoomText()),f(),A((r=i.cursorInfo())?29:-1,r),f(),Le(i.skres.charts()),f(2),A(i.app.uiCtrl().radarLayer?32:-1),f(),A(i.app.featureFlags().resourceTracks?33:-1),f(),A(i.trackHistory.shown().length>0?34:-1),f(),A(i.trackHistory.ghosts().length>0?35:-1),f(),A(i.app.config.ui.showAisTargets&&(i.app.config.vessels.aisShowTrack||i.app.data.vessels.showTrack.length>0)?36:-1),f(),Le(i.skresOther.resourceSets()),f(2),w("routes",i.skres.routes())("routeStyles",i.featureStyles.route)("activeRoute",i.activeRoute)("darkMode",i.app.uiConfig().invertColor)("labelMinZoom",i.app.config.map.labelsMinZoom)("mapZoom",i.mapZoomLevel())("zIndex",500),f(),w("routes",i.bufferRoutes())("routeStyles",i.draftRouteStyles)("activeRoute",i.activeRoute)("darkMode",i.app.uiConfig().invertColor)("labelMinZoom",i.app.config.map.labelsMinZoom)("mapZoom",i.mapZoomLevel())("zIndex",510),f(),A(i.activeRoute&&!i.app.data.activeRouteIsEditing?41:-1),f(),w("darkMode",i.app.uiConfig().invertColor)("waypoints",i.skres.waypoints())("activeWaypoint",i.app.data.activeWaypoint)("labelMinZoom",i.app.config.map.labelsMinZoom)("mapZoom",i.mapZoomLevel())("zIndex",600),f(),w("darkMode",i.app.uiConfig().invertColor)("targets",i.dfeat.atons)("labelMinZoom",i.app.config.map.labelsMinZoom)("mapZoom",i.mapZoomLevel())("updateIds",i.skstream.aisStatus().updated)("staleIds",i.skstream.aisStatus().stale)("removeIds",i.skstream.aisStatus().expired)("inactiveTime",i.app.config.vessels.aisStaleAge)("zIndex",200),f(),w("darkMode",i.app.uiConfig().invertColor)("targets",i.dfeat.atons)("labelMinZoom",i.app.config.map.labelsMinZoom)("mapZoom",i.mapZoomLevel())("updateIds",i.skstream.aisStatus().updated)("staleIds",i.skstream.aisStatus().stale)("removeIds",i.skstream.aisStatus().expired)("inactiveTime",i.app.config.vessels.aisStaleAge)("zIndex",210),f(),A(i.app.config.ui.showAisTargets?45:-1),f(),A(i.app.config.ui.showAisTargets?46:-1),f(),A(i.app.config.ui.showAisTargets?47:-1),f(),A(i.app.config.ui.showAisTargets?48:-1),f(),w("startLine",i.app.data.racing.startLine)("racecourseStyles",i.featureStyles.raceCourse)("darkMode",i.app.uiConfig().invertColor)("labelMinZoom",i.app.config.map.labelsMinZoom)("mapZoom",i.mapZoomLevel())("zIndex",540),f(),w("regions",i.skres.regions())("regionStyles",i.featureStyles.region)("darkMode",i.app.uiConfig().invertColor)("labelMinZoom",i.app.config.map.labelsMinZoom)("mapZoom",i.mapZoomLevel())("zIndex",400),f(),A(i.showNoteslayer()?51:-1),f(),A(i.overlay().show&&i.overlay().type==="bearing_dist"?52:-1),f(),A(i.overlay().show&&!i.mapInteract.isModifying()?53:-1),f(),A(i.anchor.raised()?-1:54),f(),A(i.dfeat.closest.length!==0?55:-1),f(),w("alarms",i.notiMgr.mobAlerts())("alarmStyles",i.featureStyles.alarm)("zIndex",995),f(),A(i.anchor.raised()&&i.dfeat.navData.position?57:-1),f(),A(i.app.config.vessels.rangeCircles?58:-1),f(),A(i.app.config.vessels.selfLines.cog.length!==0?59:-1),f(),A(i.app.config.vessels.selfLines.cog.length!==0?60:-1),f(),A(i.app.config.vessels.windVectors?61:-1),f(),w("position",i.dfeat.self.position)("heading",i.dfeat.self.orientation)("id",""+i.app.data.selfId)("activeId",i.app.data.vessels.activeId)("iconScale",i.app.config.vessels.iconScale)("fixedLocation",i.app.config.vessels.fixedLocationMode)("stale",i.skstream.selfPositionStale()&&!i.app.config.vessels.fixedLocationMode)("zIndex",999),f(),A(i.app.config.vessels.trail&&i.app.data.vessels.showSelf?63:-1),f(),w("show",i.app.config.selections.weatherWindEnabled)("opacity",.55)("indicator",i.app.config.display.windIndicator),f(),w("show",i.app.config.selections.oceanCurrentsEnabled)("opacity",.55),f(),w("show",i.app.config.selections.tidalCurrentsEnabled)("opacity",.7),f(),Le(i.cursorMarkers()),f(2),A(i.app.data.chartBounds.show?69:-1),f(),vt("left",i.contextMenuPosition.x)("top",i.contextMenuPosition.y),w("matMenuTriggerFor",o)}},dependencies:[ye,Te,An,Pa,se,ce,ue,Ns,et,Ec,is,Is,bz,hl,$f,Sm,Tu,Mu,ke,Su,Eu,Em,Im,km,Dm,Fm,Nm,Iu,Bm,Vm,Uf,Gm,zm,jm,Um,Wm,Hm,$m,Km,qm,Zm,Ym,Qm,Jm,p_,Xm,tf,nf,of,af,sf,lf,cf,df,uf,Hf,Af,Lf,Of,Ff,Nf,Bf,jf,jn,ww,Mw,Ew,Sw,Tw,fw,gw,kw,Cw,Iw,Rw,Aw,W_,Qi],styles:[".mapButton[_ngcontent-%COMP%]{position:fixed;z-index:4000}.control[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-start;margin:20px}.ol-mouse-position[_ngcontent-%COMP%]{width:100%;top:unset;bottom:10px;left:unset;right:unset;text-align:center;color:#1e1e1e;font-family:roboto}.ol-zoom[_ngcontent-%COMP%]{position:fixed;top:10px;left:60px;color:#1e1e1e;font-family:roboto;background-color:transparent;height:45px} .ol-dragbox{background-color:#fff6!important;border-color:#649600!important;border-style:solid;border-width:1px}.cursor-marker[_ngcontent-%COMP%]{width:14px;height:14px;border-radius:50%;background-color:#ff5722e6;border:2px solid rgba(255,255,255,.95);box-shadow:0 0 3px #0009;pointer-events:none;animation:_ngcontent-%COMP%_cursor-marker-fade 1.5s linear forwards}@keyframes _ngcontent-%COMP%_cursor-marker-fade{0%{opacity:1}to{opacity:0}}.nosmall[_ngcontent-%COMP%]{display:block}@media only screen and (max-width:400px){.nosmall[_ngcontent-%COMP%]{display:none}.ol-mouse-position[_ngcontent-%COMP%]{bottom:2px}}"]})};var zve=["button"],jve=["*"];function Uve(n,e){if(n&1&&(u(0,"div",2),z(1,"mat-pseudo-checkbox",6),h()),n&2){let t=v();f(),w("disabled",t.disabled)}}var Qj=new Ct("MAT_BUTTON_TOGGLE_DEFAULT_OPTIONS",{providedIn:"root",factory:()=>({hideSingleSelectionIndicator:!1,hideMultipleSelectionIndicator:!1,disabledInteractive:!1})}),Jj=new Ct("MatButtonToggleGroup"),Wve={provide:cs,useExisting:os(()=>Gk),multi:!0},Ow=class{source;value;constructor(e,t){this.source=e,this.value=t}},Gk=(()=>{class n{_changeDetector=M(ae);_dir=M(uo,{optional:!0});_multiple=!1;_disabled=!1;_disabledInteractive=!1;_selectionModel;_rawValue;_controlValueAccessorChangeFn=()=>{};_onTouched=()=>{};_buttonToggles;appearance;get name(){return this._name}set name(t){this._name=t,this._markButtonsForCheck()}_name=M(nr).getId("mat-button-toggle-group-");vertical=!1;get value(){let t=this._selectionModel?this._selectionModel.selected:[];return this.multiple?t.map(i=>i.value):t[0]?t[0].value:void 0}set value(t){this._setSelectionByValue(t),this.valueChange.emit(this.value)}valueChange=new me;get selected(){let t=this._selectionModel?this._selectionModel.selected:[];return this.multiple?t:t[0]||null}get multiple(){return this._multiple}set multiple(t){this._multiple=t,this._markButtonsForCheck()}get disabled(){return this._disabled}set disabled(t){this._disabled=t,this._markButtonsForCheck()}get disabledInteractive(){return this._disabledInteractive}set disabledInteractive(t){this._disabledInteractive=t,this._markButtonsForCheck()}get dir(){return this._dir&&this._dir.value==="rtl"?"rtl":"ltr"}change=new me;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(t){this._hideSingleSelectionIndicator=t,this._markButtonsForCheck()}_hideSingleSelectionIndicator;get hideMultipleSelectionIndicator(){return this._hideMultipleSelectionIndicator}set hideMultipleSelectionIndicator(t){this._hideMultipleSelectionIndicator=t,this._markButtonsForCheck()}_hideMultipleSelectionIndicator;constructor(){let t=M(Qj,{optional:!0});this.appearance=t&&t.appearance?t.appearance:"standard",this._hideSingleSelectionIndicator=t?.hideSingleSelectionIndicator??!1,this._hideMultipleSelectionIndicator=t?.hideMultipleSelectionIndicator??!1}ngOnInit(){this._selectionModel=new V1(this.multiple,void 0,!1)}ngAfterContentInit(){this._selectionModel.select(...this._buttonToggles.filter(t=>t.checked)),this.multiple||this._initializeTabIndex()}writeValue(t){this.value=t,this._changeDetector.markForCheck()}registerOnChange(t){this._controlValueAccessorChangeFn=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t}_keydown(t){if(this.multiple||this.disabled||Os(t))return;let r=t.target.id,o=this._buttonToggles.toArray().findIndex(s=>s.buttonId===r),a=null;switch(t.keyCode){case 32:case 13:a=this._buttonToggles.get(o)||null;break;case 38:a=this._getNextButton(o,-1);break;case 37:a=this._getNextButton(o,this.dir==="ltr"?-1:1);break;case 40:a=this._getNextButton(o,1);break;case 39:a=this._getNextButton(o,this.dir==="ltr"?1:-1);break;default:return}a&&(t.preventDefault(),a._onButtonClick(),a.focus())}_emitChangeEvent(t){let i=new Ow(t,this.value);this._rawValue=i.value,this._controlValueAccessorChangeFn(i.value),this.change.emit(i)}_syncButtonToggle(t,i,r=!1,o=!1){!this.multiple&&this.selected&&!t.checked&&(this.selected.checked=!1),this._selectionModel?i?this._selectionModel.select(t):this._selectionModel.deselect(t):o=!0,o?Promise.resolve().then(()=>this._updateModelValue(t,r)):this._updateModelValue(t,r)}_isSelected(t){return this._selectionModel&&this._selectionModel.isSelected(t)}_isPrechecked(t){return typeof this._rawValue>"u"?!1:this.multiple&&Array.isArray(this._rawValue)?this._rawValue.some(i=>t.value!=null&&i===t.value):t.value===this._rawValue}_initializeTabIndex(){if(this._buttonToggles.forEach(t=>{t.tabIndex=-1}),this.selected)this.selected.tabIndex=0;else for(let t=0;t<this._buttonToggles.length;t++){let i=this._buttonToggles.get(t);if(!i.disabled){i.tabIndex=0;break}}}_getNextButton(t,i){let r=this._buttonToggles;for(let o=1;o<=r.length;o++){let a=(t+i*o+r.length)%r.length,s=r.get(a);if(s&&!s.disabled)return s}return null}_setSelectionByValue(t){if(this._rawValue=t,!this._buttonToggles)return;let i=this._buttonToggles.toArray();if(this.multiple&&t?(Array.isArray(t),this._clearSelection(),t.forEach(r=>this._selectValue(r,i))):(this._clearSelection(),this._selectValue(t,i)),!this.multiple&&i.every(r=>r.tabIndex===-1)){for(let r of i)if(!r.disabled){r.tabIndex=0;break}}}_clearSelection(){this._selectionModel.clear(),this._buttonToggles.forEach(t=>{t.checked=!1,this.multiple||(t.tabIndex=-1)})}_selectValue(t,i){for(let r of i)if(r.value===t){r.checked=!0,this._selectionModel.select(r),this.multiple||(r.tabIndex=0);break}}_updateModelValue(t,i){i&&this._emitChangeEvent(t),this.valueChange.emit(this.value)}_markButtonsForCheck(){this._buttonToggles?.forEach(t=>t._markForCheck())}static \u0275fac=function(i){return new(i||n)};static \u0275dir=pt({type:n,selectors:[["mat-button-toggle-group"]],contentQueries:function(i,r,o){if(i&1&&sn(o,Fw,5),i&2){let a;Ee(a=Ie())&&(r._buttonToggles=a)}},hostAttrs:[1,"mat-button-toggle-group"],hostVars:6,hostBindings:function(i,r){i&1&&T("keydown",function(a){return r._keydown(a)}),i&2&&(Ye("role",r.multiple?"group":"radiogroup")("aria-disabled",r.disabled),ht("mat-button-toggle-vertical",r.vertical)("mat-button-toggle-group-appearance-standard",r.appearance==="standard"))},inputs:{appearance:"appearance",name:"name",vertical:[2,"vertical","vertical",He],value:"value",multiple:[2,"multiple","multiple",He],disabled:[2,"disabled","disabled",He],disabledInteractive:[2,"disabledInteractive","disabledInteractive",He],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",He],hideMultipleSelectionIndicator:[2,"hideMultipleSelectionIndicator","hideMultipleSelectionIndicator",He]},outputs:{valueChange:"valueChange",change:"change"},exportAs:["matButtonToggleGroup"],features:[Ft([Wve,{provide:Jj,useExisting:n}])]})}return n})(),Fw=(()=>{class n{_changeDetectorRef=M(ae);_elementRef=M(ft);_focusMonitor=M(Uo);_idGenerator=M(nr);_animationDisabled=Kn();_checked=!1;ariaLabel;ariaLabelledby=null;_buttonElement;buttonToggleGroup;get buttonId(){return`${this.id}-button`}id;name;value;get tabIndex(){return this._tabIndex()}set tabIndex(t){this._tabIndex.set(t)}_tabIndex;disableRipple=!1;get appearance(){return this.buttonToggleGroup?this.buttonToggleGroup.appearance:this._appearance}set appearance(t){this._appearance=t}_appearance;get checked(){return this.buttonToggleGroup?this.buttonToggleGroup._isSelected(this):this._checked}set checked(t){t!==this._checked&&(this._checked=t,this.buttonToggleGroup&&this.buttonToggleGroup._syncButtonToggle(this,this._checked),this._changeDetectorRef.markForCheck())}get disabled(){return this._disabled||this.buttonToggleGroup&&this.buttonToggleGroup.disabled}set disabled(t){this._disabled=t}_disabled=!1;get disabledInteractive(){return this._disabledInteractive||this.buttonToggleGroup!==null&&this.buttonToggleGroup.disabledInteractive}set disabledInteractive(t){this._disabledInteractive=t}_disabledInteractive;change=new me;constructor(){M(Dr).load(Qr);let t=M(Jj,{optional:!0}),i=M(new Ul("tabindex"),{optional:!0})||"",r=M(Qj,{optional:!0});this._tabIndex=$(parseInt(i)||0),this.buttonToggleGroup=t,this._appearance=r&&r.appearance?r.appearance:"standard",this._disabledInteractive=r?.disabledInteractive??!1}ngOnInit(){let t=this.buttonToggleGroup;this.id=this.id||this._idGenerator.getId("mat-button-toggle-"),t&&(t._isPrechecked(this)?this.checked=!0:t._isSelected(this)!==this._checked&&t._syncButtonToggle(this,this._checked))}ngAfterViewInit(){this._animationDisabled||this._elementRef.nativeElement.classList.add("mat-button-toggle-animations-enabled"),this._focusMonitor.monitor(this._elementRef,!0)}ngOnDestroy(){let t=this.buttonToggleGroup;this._focusMonitor.stopMonitoring(this._elementRef),t&&t._isSelected(this)&&t._syncButtonToggle(this,!1,!1,!0)}focus(t){this._buttonElement.nativeElement.focus(t)}_onButtonClick(){if(this.disabled)return;let t=this.isSingleSelector()?!0:!this._checked;if(t!==this._checked&&(this._checked=t,this.buttonToggleGroup&&(this.buttonToggleGroup._syncButtonToggle(this,this._checked,!0),this.buttonToggleGroup._onTouched())),this.isSingleSelector()){let i=this.buttonToggleGroup._buttonToggles.find(r=>r.tabIndex===0);i&&(i.tabIndex=-1),this.tabIndex=0}this.change.emit(new Ow(this,this.value))}_markForCheck(){this._changeDetectorRef.markForCheck()}_getButtonName(){return this.isSingleSelector()?this.buttonToggleGroup.name:this.name||null}isSingleSelector(){return this.buttonToggleGroup&&!this.buttonToggleGroup.multiple}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=U({type:n,selectors:[["mat-button-toggle"]],viewQuery:function(i,r){if(i&1&&Ot(zve,5),i&2){let o;Ee(o=Ie())&&(r._buttonElement=o.first)}},hostAttrs:["role","presentation",1,"mat-button-toggle"],hostVars:14,hostBindings:function(i,r){i&1&&T("focus",function(){return r.focus()}),i&2&&(Ye("aria-label",null)("aria-labelledby",null)("id",r.id)("name",null),ht("mat-button-toggle-standalone",!r.buttonToggleGroup)("mat-button-toggle-checked",r.checked)("mat-button-toggle-disabled",r.disabled)("mat-button-toggle-disabled-interactive",r.disabledInteractive)("mat-button-toggle-appearance-standard",r.appearance==="standard"))},inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],id:"id",name:"name",value:"value",tabIndex:"tabIndex",disableRipple:[2,"disableRipple","disableRipple",He],appearance:"appearance",checked:[2,"checked","checked",He],disabled:[2,"disabled","disabled",He],disabledInteractive:[2,"disabledInteractive","disabledInteractive",He]},outputs:{change:"change"},exportAs:["matButtonToggle"],ngContentSelectors:jve,decls:7,vars:13,consts:[["button",""],["type","button",1,"mat-button-toggle-button","mat-focus-indicator",3,"click","id","disabled"],[1,"mat-button-toggle-checkbox-wrapper"],[1,"mat-button-toggle-label-content"],[1,"mat-button-toggle-focus-overlay"],["matRipple","",1,"mat-button-toggle-ripple",3,"matRippleTrigger","matRippleDisabled"],["state","checked","aria-hidden","true","appearance","minimal",3,"disabled"]],template:function(i,r){if(i&1&&(fe(),u(0,"button",1,0),T("click",function(){return r._onButtonClick()}),R(2,Uve,2,1,"div",2),u(3,"span",3),de(4),h()(),z(5,"span",4)(6,"span",5)),i&2){let o=Be(1);w("id",r.buttonId)("disabled",r.disabled&&!r.disabledInteractive||null),Ye("role",r.isSingleSelector()?"radio":"button")("tabindex",r.disabled&&!r.disabledInteractive?-1:r.tabIndex)("aria-pressed",r.isSingleSelector()?null:r.checked)("aria-checked",r.isSingleSelector()?r.checked:null)("name",r._getButtonName())("aria-label",r.ariaLabel)("aria-labelledby",r.ariaLabelledby)("aria-disabled",r.disabled&&r.disabledInteractive?"true":null),f(2),A(r.buttonToggleGroup&&(!r.buttonToggleGroup.multiple&&!r.buttonToggleGroup.hideSingleSelectionIndicator||r.buttonToggleGroup.multiple&&!r.buttonToggleGroup.hideMultipleSelectionIndicator)?2:-1),f(4),w("matRippleTrigger",o)("matRippleDisabled",r.disableRipple||r.disabled)}},dependencies:[Wo,ND],styles:[`.mat-button-toggle-standalone,
|
|
4097
|
+
`;t.status===403?(i+="Unauthorised: Please login.",this.app.showAlert(`Error (${t.status}):`,i)):this.app.showMessage(t.error?.message??"Device returned an error!")}})}dragEventHandler(e,t){this.app.debug("e:",e,"type:",t,e.event.srcElement.clientLeft,e.event.srcElement.clientTop)}formatLabel(e){return e?e.toUpperCase():"..."}formatTargetValue(e){return typeof e=="number"?Ue.radiansToDegrees(e)?.toFixed(1):"--"}static \u0275fac=function(t){return new(t||n)(ie(oe),ie(pw))};static \u0275cmp=U({type:n,selectors:[["autopilot-console"]],inputs:{apData:[1,"apData"]},outputs:{close:"close"},decls:48,vars:9,consts:[["modemenu","matMenu"],["statemenu","matMenu"],["mat-menu-item",""],["cdkDragHandle",""],["cdkDrag","",1,"autopilot-console",3,"cdkDragReleased"],[1,"title",2,"cursor","grab"],[2,"text-align","center","width","100%"],["matTooltip","Close",1,"icon-warn",2,"cursor","pointer",3,"click"],[1,"content"],[2,"height","45px","color","whitesmoke"],[1,"lcd"],[2,"padding","5px 0","display","flex"],[1,"dial-text-title"],[1,"dial-text"],[1,"dial-text-value"],[2,"padding","10px 0","display","flex"],[1,"button-bar"],[2,"width","50%"],["mat-raised-button","",1,"button-primary",2,"max-width","100px",3,"matMenuTriggerFor","disabled","ngClass"],[3,"checked","disabled","matTooltip"],["mat-raised-button","",1,"button-secondary",3,"matMenuTriggerFor","disabled"],[1,"button-bar-thin"],["mat-raised-button","",3,"ngClass","disabled"],["mat-menu-item","",3,"click"],[2,"white-space","pre","text-overflow","ellipsis","overflow","hidden","max-width","90px",3,"innerText"],[3,"toggleChange","checked","disabled","matTooltip"],["mat-mini-fab","",1,"button-secondary",3,"click","disabled"],["mat-mini-fab","",1,"button-toolbar",3,"click","disabled"],["mat-raised-button","",3,"click","ngClass","disabled"]],template:function(t,i){t&1&&(u(0,"mat-menu",null,0),Ae(2,p_e,5,2,"button",2,wt),h(),u(4,"mat-menu",null,1),Ae(6,f_e,5,2,"button",2,c_e),h(),u(8,"mat-card",3)(9,"div",4),T("cdkDragReleased",function(o){return i.dragEventHandler(o,"released")}),u(10,"div",5)(11,"div",6)(12,"mat-icon",7),T("click",function(){return i.handleClose()}),_(13,"close"),h()()(),u(14,"mat-card-content")(15,"div",8)(16,"div",9),_(17," Autopilot"),z(18,"br"),_(19),h(),u(20,"div",10)(21,"div",11)(22,"div",12),R(23,g_e,2,0,"span")(24,__e,2,0,"span"),h()(),u(25,"div",13)(26,"div",14),R(27,y_e,2,1,"span")(28,v_e,2,0,"span"),_(29," \xB0 "),h()(),u(30,"div",15)(31,"div",12),R(32,b_e,2,1,"span")(33,x_e,2,0,"span"),h(),u(34,"div",12),R(35,C_e,2,1,"span")(36,w_e,2,0,"span"),h()()(),u(37,"div",16)(38,"div",17),R(39,M_e,2,7,"button",18)(40,S_e,1,3,"mat-slide-toggle",19),h(),u(41,"div"),R(42,T_e,2,2,"button",20),h()(),R(43,E_e,13,4,"div",21)(44,I_e,13,4,"div",21),u(45,"div",21)(46,"div",6),R(47,k_e,2,5,"button",22),h()()()()()()),t&2&&(f(2),Le(i.modeOptions()),f(4),Le(i.stateOptions()),f(13),K(" ",i.apData().default??""," "),f(4),A(i.apData().default?23:24),f(4),A(i.apData().default||i.apData().state==="off-line"?27:28),f(5),A(i.apData().default||i.apData().state==="off-line"?32:33),f(3),A(i.apData().default||i.apData().state==="off-line"?35:36),f(4),A(i.stateOptions().length>2?39:40),f(3),A(i.modeOptions().length!==0?42:-1),f(),A(i.apData().mode==="dodge"?43:44),f(4),A(i.dodgeAction()?47:-1))},dependencies:[ye,Te,mn,Rn,yC,So,dl,ue,Ze,Ns,et,Bt,ti,se,ce,Ec,is,Is,hl,aa,Vo,Dt],styles:['.autopilot-console[_ngcontent-%COMP%]{position:absolute;z-index:6010;top:130px;left:50px;display:flex;flex-direction:column;font-family:Roboto,Arial,Helvetica,sans-serif;font-size:10pt;width:238px;height:400px;background-image:url("./media/autopilot-GCOLQT5X.png");background-color:transparent;border-radius:115px}.autopilot-console[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{padding:10px 0 0;font-weight:500;font-size:14px;line-height:23px;display:flex;color:#ede0dd;text-align:center}.autopilot-console[_ngcontent-%COMP%] .title[_ngcontent-%COMP%] .closer[_ngcontent-%COMP%]:hover{cursor:pointer}.autopilot-console[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{padding:0 5px;margin:0;flex:1 1 auto;text-align:center}.autopilot-console[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .lcd[_ngcontent-%COMP%]{padding:5px 0;color:#000;margin:0 15px}.autopilot-console[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .dial-text[_ngcontent-%COMP%]{font-family:roboto;flex:1 1 auto}.autopilot-console[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .dial-text-title[_ngcontent-%COMP%]{font-size:10pt;font-weight:500;flex:1}.autopilot-console[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .dial-text-value[_ngcontent-%COMP%]{font-size:37pt;font-weight:500}.autopilot-console[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .dial-text-units[_ngcontent-%COMP%]{font-size:10pt}.autopilot-console[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .button-bar[_ngcontent-%COMP%]{display:flex;flex-wrap:nowrap;padding:30px 0 10px}.autopilot-console[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .button-bar-thin[_ngcontent-%COMP%]{display:flex;flex-wrap:nowrap;padding:10px 0 0}'],changeDetection:0})};var hw="/resources/buddies",mw=class n{constructor(e,t){this.signalk=e;this.app=t}signalk;app;list(){return this.signalk.api.get(this.app.skApiVersion,`${hw}`)}add(e,t){return this.signalk.api.post(this.app.skApiVersion,`${hw}`,{urn:e,name:t})}update(e,t){return this.signalk.api.put(this.app.skApiVersion,`${hw}/${e}`,{name:t})}remove(e){return this.signalk.api.delete(this.app.skApiVersion,`${hw}/${e}`)}static \u0275fac=function(t){return new(t||n)(ut(Lt),ut(oe))};static \u0275prov=Je({token:n,factory:n.\u0275fac,providedIn:"root"})};var D_e=["*"],dj=class n{closed=xe();infoPanel=M(Ic);close(){this.infoPanel.close(),this.closed.emit()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["info-panel"]],outputs:{closed:"closed"},ngContentSelectors:D_e,decls:8,vars:0,consts:[[2,"position","relative"],[2,"text-align","right"],["mat-list-item","","matIconButton","",3,"click"],[2,"position","fixed","bottom","0","top","60px","width","247px"]],template:function(t,i){t&1&&(fe(),u(0,"div",0)(1,"mat-nav-list",1)(2,"a",2),T("click",function(){return i.close()}),u(3,"mat-icon"),_(4,"close"),h()(),z(5,"mat-divider"),h()(),u(6,"div",3),de(7),h())},dependencies:[An,Vs,mo,Pa,se,ce],encapsulation:2,changeDetection:0})};function P_e(n,e){if(n&1&&z(0,"h1",8),n&2){let t=e.$implicit;w("remarkNode",t)}}function R_e(n,e){if(n&1&&(u(0,"remark",1),St(1,P_e,1,1,"ng-template",7),h()),n&2){let t=v();w("processor",t.mdProcessor)("markdown",t.resource()[1].description??"")}}function A_e(n,e){if(n&1&&z(0,"div",2),n&2){let t=v();w("innerHTML",t.resource()[1].description??"",zd)}}function L_e(n,e){if(n&1&&(u(0,"div",10),_(1),h()),n&2){let t=v().$implicit;f(),K(" ",t[1]," ")}}function O_e(n,e){if(n&1&&(z(0,"div",11),bt(1,"coords")),n&2){let t=v().$implicit,i=v();w("innerText",Mi(1,1,t[1],i.app.config.units.positionFormat,!0))}}function F_e(n,e){if(n&1&&(z(0,"div",11),bt(1,"coords")),n&2){let t=v().$implicit,i=v();w("innerText",$n(1,1,t[1],i.app.config.units.positionFormat))}}function N_e(n,e){if(n&1&&(u(0,"div",3)(1,"div",9),_(2),h(),R(3,L_e,2,1,"div",10),R(4,O_e,2,5,"div",11),R(5,F_e,2,4,"div",11),h()),n&2){let t=e.$implicit;f(2),K("",t[0],":"),f(),A(t[0]!=="Latitude"&&t[0]!=="Longitude"?3:-1),f(),A(t[0]==="Latitude"?4:-1),f(),A(t[0]==="Longitude"?5:-1)}}function B_e(n,e){if(n&1){let t=H();u(0,"div",6)(1,"button",12),T("click",function(){O(t);let r=v();return F(r.emitModify())}),u(2,"mat-icon"),_(3,"touch_app"),h(),_(4),h()()}if(n&2){let t=v();vt("order",t.type()==="route"?1:null),f(),w("disabled",t.ctrl.isReadOnly),f(3),K(" ",t.ctrl.modifyLabel," ")}}function V_e(n,e){if(n&1){let t=H();u(0,"div",6)(1,"button",13),T("click",function(){O(t);let r=v();return F(r.emitAddNote())}),u(2,"mat-icon"),_(3,"local_offer"),h(),_(4," ADD "),h()()}}function G_e(n,e){if(n&1){let t=H();u(0,"div",6)(1,"button",14),T("click",function(){O(t);let r=v();return F(r.emitHide())}),u(2,"mat-icon"),_(3,"visibility_off"),h(),_(4," HIDE "),h()()}if(n&2){let t=v();vt("order",t.type()==="route"?6:null),f(),w("disabled",t.ctrl.isActive)}}function z_e(n,e){if(n&1){let t=H();u(0,"div",6)(1,"button",15),T("click",function(){O(t);let r=v();return F(r.emitDelete())}),u(2,"mat-icon"),_(3,"delete"),h(),_(4," DELETE "),h()()}if(n&2){let t=v();vt("order",t.type()==="route"?7:null),f(),w("disabled",t.ctrl.isReadOnly||t.ctrl.isActive)}}function j_e(n,e){if(n&1){let t=H();u(0,"div",6)(1,"button",16),T("click",function(){O(t);let r=v();return F(r.emitActive(!0))}),u(2,"mat-icon"),_(3,"near_me"),h(),_(4),h()()}if(n&2){let t=v();vt("order",t.type()==="route"?2:null),f(),w("matTooltip",t.type()==="waypoint"?"Navigate to Waypoint":"Navigate to first point"),f(3),K(" ",t.ctrl.activeText," ")}}function U_e(n,e){if(n&1){let t=H();u(0,"div",6)(1,"button",17),T("click",function(){O(t);let r=v();return F(r.emitActive(!1))}),u(2,"mat-icon"),_(3,"clear_all"),h(),_(4," STOP "),h()()}if(n&2){let t=v();vt("order",t.type()==="route"?2:null)}}function W_e(n,e){if(n&1){let t=H();u(0,"div",6)(1,"button",18),T("click",function(){O(t);let r=v();return F(r.emitPoints())}),u(2,"mat-icon"),_(3,"location_on"),h(),_(4," POINTS "),h()()}if(n&2){let t=v();vt("order",t.type()==="route"?3:null)}}function H_e(n,e){if(n&1){let t=H();u(0,"div",6)(1,"button",19),T("click",function(){O(t);let r=v();return F(r.emitRelated())}),u(2,"mat-icon"),_(3,"style"),h(),_(4," GROUP "),h()()}}function $_e(n,e){if(n&1){let t=H();u(0,"div",6)(1,"button",20),T("click",function(){O(t);let r=v();return F(r.emitNotes())}),u(2,"mat-icon"),_(3,"local_offer"),h(),_(4," NOTES "),h()()}if(n&2){let t=v();vt("order",t.type()==="route"?4:null)}}function K_e(n,e){if(n&1){let t=H();u(0,"div",6)(1,"button",21),T("click",function(){O(t);let r=v();return F(r.emitInfo())}),u(2,"mat-icon"),_(3,"info_outline"),h(),_(4," INFO "),h()()}if(n&2){let t=v();vt("order",t.type()==="route"?5:null)}}function q_e(n,e){if(n&1){let t=H();u(0,"div",6)(1,"button",22),T("click",function(){O(t);let r=v();return F(r.emitSave())}),u(2,"mat-icon"),_(3,"save"),h(),_(4," SAVE "),h()()}if(n&2){let t=v();vt("order",t.type()==="route"?2:null)}}function Z_e(n,e){if(n&1&&(u(0,"div",5),_(1),h(),u(2,"div",6),_(3),h()),n&2){let t=v().$implicit;f(),K("",t[0],":"),f(2),K(" ",t[1]," ")}}function X_e(n,e){if(n&1&&(u(0,"div",4)(1,"div",5),_(2),h(),u(3,"div",7),_(4),h()()),n&2){let t=v().$implicit;f(2),K("",t[0],":"),f(2),K(" ",t[1]," ")}}function Y_e(n,e){if(n&1&&R(0,Z_e,4,2)(1,X_e,5,2,"div",4),n&2){let t=e.$implicit;A(t[0]==="Description"?0:1)}}var uj='.popover[_ngcontent-%COMP%]{position:absolute;top:0;left:0;transform:translate(-50%,-100%);z-index:3990;display:block;max-width:276px;min-width:270px;padding:1px;font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;-webkit-background-clip:padding-box;background-clip:padding-box;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px #0003;line-break:auto}.popover.top[_ngcontent-%COMP%]{margin-top:-10px;margin-left:10px}.popover.bottom[_ngcontent-%COMP%]{transform:translate(-50%);margin-top:10px;margin-left:10px}.popover-title[_ngcontent-%COMP%]{padding:2px 0 2px 5px;margin:0;display:flex;line-height:2.5em;font-size:12pt;background-color:#fafafa82;border-radius:5px 5px 0 0;min-width:110px}.popover-content[_ngcontent-%COMP%]{padding:9px 14px;max-height:330px;overflow:auto}.popover.capped[_ngcontent-%COMP%]{display:flex;flex-direction:column}.popover.capped[_ngcontent-%COMP%] > .popover-title[_ngcontent-%COMP%]{flex-shrink:0}.popover.capped[_ngcontent-%COMP%] > .popover-content[_ngcontent-%COMP%]{flex:1 1 auto;min-height:0}.popover[_ngcontent-%COMP%] > .arrow[_ngcontent-%COMP%], .popover[_ngcontent-%COMP%] > .arrow[_ngcontent-%COMP%]:after{position:absolute;display:block;width:0;height:0;border-style:solid}.popover[_ngcontent-%COMP%] > .arrow[_ngcontent-%COMP%]{border-width:11px}.popover[_ngcontent-%COMP%] > .arrow[_ngcontent-%COMP%]:after{content:"";border-width:10px}.popover.top[_ngcontent-%COMP%] > .arrow[_ngcontent-%COMP%]{bottom:-11px;left:50%;margin-left:-11px;border-bottom-width:0;border-right-width:0;border-left-width:0}.popover.top[_ngcontent-%COMP%] > .arrow[_ngcontent-%COMP%]:after{bottom:1px;margin-left:-10px;content:" ";border-bottom-width:0}.popover.bottom[_ngcontent-%COMP%] > .arrow[_ngcontent-%COMP%]{top:-11px;left:50%;margin-left:-11px;border-top-width:0;border-right-width:0;border-left-width:0}.popover.bottom[_ngcontent-%COMP%] > .arrow[_ngcontent-%COMP%]:after{top:1px;margin-left:-10px;content:" ";border-top-width:0}.popover.measure[_ngcontent-%COMP%]{min-width:100px;background-color:#39c}.popover.measure[_ngcontent-%COMP%] > .popover-content[_ngcontent-%COMP%]{display:none}.popover.measure[_ngcontent-%COMP%] > .popover-title[_ngcontent-%COMP%]{color:#fff;font-weight:700;border-bottom:none;background-color:inherit;text-align:left;width:max-content}.popover.top.measure[_ngcontent-%COMP%] > .arrow[_ngcontent-%COMP%]{bottom:-11px;left:50%;margin-left:-11px;border-bottom-width:0;border-right-width:0;border-left-width:0}.popover.top.measure[_ngcontent-%COMP%] > .arrow[_ngcontent-%COMP%]:after{bottom:1px;margin-left:-10px;content:" ";border-bottom-width:0;border-top-color:#39c}.popover.bottom.measure[_ngcontent-%COMP%] > .arrow[_ngcontent-%COMP%]:after{border-bottom-color:#39c}.popover-action-button[_ngcontent-%COMP%]{flex:1 1 45%}.popover.docked[_ngcontent-%COMP%]{position:static;transform:none;margin:0}.popover.docked[_ngcontent-%COMP%] > .arrow[_ngcontent-%COMP%]{display:none}.popover.compact[_ngcontent-%COMP%]{min-width:0;max-width:170px;width:fit-content}.popover.compact[_ngcontent-%COMP%] > .popover-title[_ngcontent-%COMP%]{padding:0;line-height:0;min-height:0;min-width:unset}.popover.compact[_ngcontent-%COMP%] > .popover-content[_ngcontent-%COMP%]{padding:6px 10px}',fw=class n{mdProcessor=Br;title=Z();resource=Z();type=Z();active=Z();featureCount=Z(0);units=Z("m");canClose=Z();canSave=Z(!1);canStart=Z(!1);modify=xe();save=xe();delete=xe();hide=xe();addNote=xe();activated=xe();deactivated=xe();related=xe();info=xe();closed=xe();points=xe();notes=xe();_title=Ma(()=>this.title());properties;ctrl={showInfoButton:!1,showModifyButton:!1,showDeleteButton:!1,showHideButton:!1,showAddNoteButton:!1,showRelatedButton:!1,showPointsButton:!1,showNotesButton:!1,showSaveButton:!1,canActivate:!1,isActive:!1,activeText:"ACTIVE",isReadOnly:!1,modifyLabel:"MOVE"};hasMarkdown=$(!1);icon;app=M(oe);constructor(){Me(()=>this.computeControls())}computeControls(){this.resource(),this.type(),this.active(),this.parse(),this.ctrl.showModifyButton=this.type()!=="destination"&&this.featureCount()>0,this.ctrl.modifyLabel=this.type()==="route"||this.type()==="region"?"MODIFY":"MOVE",this.ctrl.showSaveButton=this.type()==="route"&&this.canSave(),this.ctrl.showSaveButton&&(this.ctrl.showDeleteButton=!0,this.ctrl.canActivate=this.canStart(),this.ctrl.showNotesButton=!1,this.ctrl.showInfoButton=!1,this.ctrl.showHideButton=!1)}parse(){this.type()==="destination"&&this.parseDestination(),this.type()==="waypoint"&&this.parseWaypoint(),this.type()==="route"&&this.parseRoute(),this.type()==="note"&&this.parseNote(),this.type()==="region"&&this.parseRegion()}parseDestination(){let e=this.resource()[1];this.icon=void 0,this.ctrl.isActive=!this.app.data.activeRoute,this.ctrl.activeText="GO TO",this.ctrl.canActivate=!this.app.data.activeRoute,this.ctrl.showInfoButton=!1,this.ctrl.showModifyButton=!1,this.ctrl.showDeleteButton=!1,this.ctrl.showHideButton=!1,this.ctrl.showNotesButton=!1,this.ctrl.showAddNoteButton=!1,this.ctrl.showPointsButton=!1,this.ctrl.showRelatedButton=!1,this.properties=[],e.name&&this.properties.push(["Name",e.name]),e.description&&this.properties.push(["Desc.",e.description]),this.properties.push(["Latitude",e.feature.geometry.coordinates[1]]),this.properties.push(["Longitude",e.feature.geometry.coordinates[0]]),this.hasMarkdown.set(!0)}parseWaypoint(){let e=this.resource()[1];this.ctrl.isReadOnly=e.feature.properties?.readOnly,this.ctrl.isActive=!!(this.active()&&this.active()===this.resource()[0]),this.ctrl.activeText="GO TO",this.ctrl.canActivate=!0,this.ctrl.showInfoButton=!0,this.ctrl.showModifyButton=!this.ctrl.isReadOnly,this.ctrl.showDeleteButton=this.app.useInfoPanel()?!1:!this.ctrl.isReadOnly,this.ctrl.showHideButton=!1,this.ctrl.showNotesButton=!this.app.useInfoPanel(),this.ctrl.showAddNoteButton=!1,this.ctrl.showPointsButton=!1,this.ctrl.showRelatedButton=!1,this.properties=[],this.icon=Fn("waypoints",e),this._title.set(e.name??""),this.properties.push(["Latitude",e.feature.geometry.coordinates[1]]),this.properties.push(["Longitude",e.feature.geometry.coordinates[0]]),this.hasMarkdown.set(!0)}parseRoute(){let e=this.resource()[1];this.ctrl.isReadOnly=e.feature.properties?.readOnly,this.ctrl.isActive=!!(this.active()&&this.active()===this.resource()[0]),this.ctrl.activeText="START",this.ctrl.canActivate=!0,this.ctrl.showInfoButton=!0,this.ctrl.showModifyButton=!this.ctrl.isReadOnly,this.ctrl.showPointsButton=!this.app.useInfoPanel(),this.ctrl.showNotesButton=!this.app.useInfoPanel(),this.ctrl.showAddNoteButton=!1,this.ctrl.showRelatedButton=!1,this.ctrl.showDeleteButton=!this.ctrl.isReadOnly,this.ctrl.showHideButton=!0,this.icon=Fn("routes",e),this._title.set(e.name??""),this.properties=[];let t=this.app.formatValueForDisplay(e.distance,"m");this.properties.push(["Distance",t]),this.hasMarkdown.set(!0)}parseNote(){let e=this.resource()[1];this.ctrl.isReadOnly=e.properties?.readOnly,this.ctrl.isActive=!1,this.ctrl.activeText="",this.ctrl.canActivate=!1,this.ctrl.showInfoButton=!0,this.ctrl.showModifyButton=!this.ctrl.isReadOnly,this.ctrl.showDeleteButton=this.app.useInfoPanel()?!1:!this.ctrl.isReadOnly,this.ctrl.showHideButton=!1,this.ctrl.showAddNoteButton=!1,this.ctrl.showNotesButton=!1,this.ctrl.showPointsButton=!1,this.ctrl.showRelatedButton=!!(e.group&&this.app.config.resources.notes.groupNameEdit),this.icon=Fn("notes",e),this._title.set(e.name??""),this.properties=[],this.ctrl.isReadOnly=e.properties?.readOnly,this.hasMarkdown.update(()=>e.mimeType?.includes("markdown"))}parseRegion(){let e=this.resource()[1];this.ctrl.isReadOnly=e.feature.properties?.readOnly,this.ctrl.isActive=!1,this.ctrl.activeText="",this.ctrl.canActivate=!1,this.ctrl.showInfoButton=!0,this.ctrl.showModifyButton=e.feature.geometry.type==="MultiPolygon"?!1:!this.ctrl.isReadOnly,this.ctrl.showDeleteButton=this.app.useInfoPanel()?!1:!this.ctrl.isReadOnly,this.ctrl.showHideButton=!1,this.ctrl.showAddNoteButton=!1,this.ctrl.showNotesButton=!this.app.useInfoPanel(),this.ctrl.showPointsButton=!1,this.ctrl.showRelatedButton=!1,this.properties=[],this.icon=Fn("regions",e),this._title.set(e.name??""),this.hasMarkdown.set(!0)}emitModify(){this.modify.emit()}emitSave(){this.save.emit()}emitAddNote(){this.addNote.emit()}emitDelete(){this.delete.emit()}emitHide(){this.hide.emit()}emitActive(e){e?this.activated.emit():this.deactivated.emit()}emitPoints(){this.points.emit()}emitNotes(){this.notes.emit()}emitInfo(){this.info.emit()}emitRelated(){this.related.emit(this.resource()[1].group)}handleClose(){this.closed.emit()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["resource-popover"]],inputs:{title:[1,"title"],resource:[1,"resource"],type:[1,"type"],active:[1,"active"],featureCount:[1,"featureCount"],units:[1,"units"],canClose:[1,"canClose"],canSave:[1,"canSave"],canStart:[1,"canStart"]},outputs:{modify:"modify",save:"save",delete:"delete",hide:"hide",addNote:"addNote",activated:"activated",deactivated:"deactivated",related:"related",info:"info",closed:"closed",points:"points",notes:"notes"},decls:17,vars:14,consts:[[3,"closed","title","icon","canClose"],[2,"flex","1 1 auto","text-align","left","font-style","italic","overflow","hidden","display","-webkit-box","-webkit-box-orient","vertical","-webkit-line-clamp","2","line-clamp","2","text-overflow","ellipsis",3,"processor","markdown"],[2,"flex","1 1 auto","text-align","left","font-style","italic","overflow","hidden","display","-webkit-box","-webkit-box-orient","vertical","-webkit-line-clamp","2","line-clamp","2","text-overflow","ellipsis",3,"innerHTML"],[2,"display","flex"],[2,"display","flex","flex-wrap","wrap"],[1,"popover-action-button",3,"order"],[1,"popover-action-button"],["remarkTemplate","heading"],[2,"font-size","10pt",3,"remarkNode"],[2,"font-weight","bold"],[2,"flex","1 1 auto","text-align","right","white-space","nowrap","overflow-x","hidden","text-overflow","ellipsis"],[2,"flex","1 1 auto","text-align","right",3,"innerText"],["mat-button","","matTooltip","Modify / Move","matTooltipPosition","after",3,"click","disabled"],["mat-button","","matTooltip","Add Note","matTooltipPosition","after",3,"click"],["mat-button","","matTooltip","Hide from Chart","matTooltipPosition","after",3,"click","disabled"],["mat-button","","matTooltip","Delete","matTooltipPosition","after",3,"click","disabled"],["mat-button","","matTooltipPosition","after",3,"click","matTooltip"],["mat-button","","matTooltip","Stop Navigating","matTooltipPosition","after",3,"click"],["mat-button","","matTooltip","Route Points","matTooltipPosition","after",3,"click"],["mat-button","","matTooltip","Notes in Group","matTooltipPosition","after",3,"click"],["mat-button","","matTooltipPosition","after","matTooltip","Show Notes",3,"click"],["mat-button","","matTooltip","Show Details","matTooltipPosition","after",3,"click"],["mat-button","","color","primary","matTooltip","Save Route","matTooltipPosition","after",3,"click"]],template:function(t,i){t&1&&(u(0,"ap-popover",0),T("closed",function(){return i.handleClose()}),R(1,R_e,2,2,"remark",1)(2,A_e,1,1,"div",2),Ae(3,N_e,6,4,"div",3,wt),u(5,"div",4),R(6,B_e,5,4,"div",5),R(7,V_e,5,0,"div",6),R(8,G_e,5,3,"div",5),R(9,z_e,5,3,"div",5),R(10,j_e,5,4,"div",5)(11,U_e,5,2,"div",5),R(12,W_e,5,2,"div",5),R(13,H_e,5,0,"div",6),R(14,$_e,5,2,"div",5),R(15,K_e,5,2,"div",5),R(16,q_e,5,2,"div",5),h()()),t&2&&(w("title",i._title())("icon",i.icon)("canClose",i.canClose()),f(),A(i.hasMarkdown()?1:2),f(2),Le(i.properties),f(3),A(i.ctrl.showModifyButton?6:-1),f(),A(i.ctrl.showAddNoteButton?7:-1),f(),A(i.ctrl.showHideButton?8:-1),f(),A(i.ctrl.showDeleteButton?9:-1),f(),A(i.ctrl.canActivate&&!i.ctrl.isActive?10:i.ctrl.canActivate&&i.ctrl.isActive?11:-1),f(2),A(i.ctrl.showPointsButton?12:-1),f(),A(i.ctrl.showRelatedButton?13:-1),f(),A(i.ctrl.showNotesButton?14:-1),f(),A(i.ctrl.showInfoButton?15:-1),f(),A(i.ctrl.showSaveButton?16:-1))},dependencies:[ue,Ze,ye,Te,se,ce,jn,Vr,go,fo,Qi],styles:[uj],changeDetection:0})},gw=class n{title=Z();resource=Z();canClose=Z();info=xe();closed=xe();properties;icon;app=M(oe);constructor(){Me(()=>{this.title(),this.resource(),this.canClose(),this.parse()})}ngOnChanges(){this.parse()}parse(){this.properties=[],this.properties.push(["Name",this.resource().properties.name??""]),this.properties.push(["Description",this.resource().properties.description??""]),this.icon={name:"star",svgIcon:void 0}}emitInfo(){this.info.emit()}handleClose(){this.closed.emit()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["resourceset-popover"]],inputs:{title:[1,"title"],resource:[1,"resource"],canClose:[1,"canClose"]},outputs:{info:"info",closed:"closed"},features:[Se],decls:9,vars:3,consts:[[3,"closed","title","icon","canClose"],[2,"display","flex","flex-wrap","wrap"],[1,"popover-action-button"],["mat-button","","matTooltip","Show Properties","matTooltipPosition","after",3,"click"],[2,"display","flex"],[2,"font-weight","bold"],[2,"flex","1 1 auto","overflow-x","auto","height","60px"],[2,"flex","1 1 auto","text-align","right","white-space","nowrap","overflow-x","auto","text-overflow","ellipsis"]],template:function(t,i){t&1&&(u(0,"ap-popover",0),T("closed",function(){return i.handleClose()}),Ae(1,Y_e,2,1,null,null,wt),u(3,"div",1)(4,"div",2)(5,"button",3),T("click",function(){return i.emitInfo()}),u(6,"mat-icon"),_(7,"info_outline"),h(),_(8," INFO "),h()()()()),t&2&&(w("title",i.title())("icon",i.icon)("canClose",i.canClose()),f(),Le(i.properties))},dependencies:[ue,Ze,ye,Te,se,ce,jn],styles:[uj],changeDetection:0})};var pj=["speedtext"],Q_e=["speedunitstext"],J_e=["dial"],hj=["headingtext"],mj=["pointer"],fj=["needlehi"],gj=["needlelo"],mg=n=>({hide:n}),e1e=["labeltext"],_w=class{minValue=0;maxValue=360;minAngle=0;maxAngle=360;_scale=1;pointers={value:null,lo:null,hi:null};constructor(e){e&&(this.minValue=e.minValue?e.minValue:this.minValue,this.maxValue=e.maxValue?e.maxValue:this.maxValue,this.minAngle=e.minAngle?e.minAngle:this.minAngle,this.maxAngle=e.maxAngle?e.maxAngle:this.maxAngle),this._init()}_init(){let e=this.minAngle>this.maxAngle?360-this.minAngle+this.maxAngle:this.maxAngle-this.minAngle,t=this.maxValue-this.minValue;this._scale=e/t}getAngle(e){let t=this._checkInRange(e);return t=t-this.minValue,t*this._scale+this.minAngle}_checkInRange(e){return isNaN(e)?0:e>this.maxValue?this.maxValue:e<this.minValue?this.minValue:e}},yw=class n extends _w{speed;speedunits="knots";heading;needle;windtrue;windapparent;speedtext;speedunitstext;dial;headingtext;pointer;needlehi;needlelo;valueStr="0\xBA";ptrOffset=0;renderer=M(Pn);constructor(){super(null)}ngOnInit(){this.pointers.value=this.dial,this.pointers.value2=this.pointer,this.pointers.hi=this.needlehi,this.pointers.lo=this.needlelo,this.updateDial()}ngOnChanges(e){this.updateDial(e)}updateDial(e=null){let t={heading:null,needle:null,windtrue:null,windapparent:null,speed:null};if(t.heading=e&&e.heading?e.heading.currentValue:this.heading,t.needle=e&&e.needle?e.needle.currentValue:this.needle,t.windtrue=e&&e.hi?e.windtrue.currentValue:this.windtrue,t.windapparent=e&&e.windapparent?e.windapparent.currentValue:this.windapparent,t.speed=e&&e.speed?e.speed.currentValue:this.speed,this.renderer.setProperty(this.speedtext.nativeElement,"innerHTML",`${typeof this.speed=="number"?this.speed.toFixed(1):"-"}`),this.renderer.setProperty(this.speedunitstext.nativeElement,"innerHTML",this.speedunits),this.pointers.value)if(t.heading=parseFloat(t.heading),isNaN(t.heading)&&(t.heading=null),this.ptrOffset=t.heading!==null?t.heading:0,t.heading!==null){t.heading=t.heading>360?t.heading-360:t.heading,this.valueStr=t.heading.toFixed(0)+"\xBA";let i=0-this.getAngle(t.heading);this.renderer.setAttribute(this.dial.nativeElement,"transform","rotate("+i+" 100 100)"),this.renderer.setProperty(this.headingtext.nativeElement,"innerHTML",this.valueStr)}else this.renderer.setAttribute(this.dial.nativeElement,"transform","rotate("+(0-this.getAngle(0))+" 100 100)"),this.renderer.setProperty(this.headingtext.nativeElement,"innerHTML","--");if(this.pointers.value2&&(t.needle=parseFloat(t.needle),isNaN(t.needle)&&(t.needle=null),t.needle!==null)){let i=this.getAngle(t.needle)-this.ptrOffset;this.renderer.setAttribute(this.pointer.nativeElement,"transform","rotate("+i+" 100 100)")}if(this.pointers.hi&&(t.windtrue=parseFloat(t.windtrue),isNaN(t.windtrue)&&(t.windtrue=null),t.windtrue!==null)){let i=t.windtrue<0?t.windtrue:this.getAngle(t.windtrue)-this.ptrOffset;this.renderer.setAttribute(this.needlehi.nativeElement,"transform","rotate("+i+" 100 100)")}if(this.pointers.lo&&(t.windapparent=parseFloat(t.windapparent),isNaN(t.windapparent)&&(t.windapparent=null),t.windapparent!==null)){let i=t.windapparent;this.renderer.setAttribute(this.needlelo.nativeElement,"transform","rotate("+i+" 100 100)")}}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["ap-compass"]],viewQuery:function(t,i){if(t&1&&Ot(pj,7)(Q_e,7)(J_e,7)(hj,7)(mj,7)(fj,7)(gj,7),t&2){let r;Ee(r=Ie())&&(i.speedtext=r.first),Ee(r=Ie())&&(i.speedunitstext=r.first),Ee(r=Ie())&&(i.dial=r.first),Ee(r=Ie())&&(i.headingtext=r.first),Ee(r=Ie())&&(i.pointer=r.first),Ee(r=Ie())&&(i.needlehi=r.first),Ee(r=Ie())&&(i.needlelo=r.first)}},inputs:{speed:"speed",speedunits:"speedunits",heading:"heading",needle:"needle",windtrue:"windtrue",windapparent:"windapparent"},features:[it,Se],decls:428,vars:9,consts:[["dial",""],["headingtext",""],["speedtext",""],["speedunitstext",""],["needlelo",""],["needlehi",""],["pointer",""],[0,"xmlns","svg","http://www.w3.org/2000/svg","xmlns","http://www.w3.org/2000/svg",0,"xmlns","xlink","http://www.w3.org/1999/xlink",0,"xmlns","rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#",0,"xmlns","dc","http://purl.org/dc/elements/1.1/","version","1.1","encoding","UTF-8","viewBox","0 0 200 200"],["x","-0.5","y","-0.5","width","2","height","2","color-interpolation-filters","sRGB","id","shadow"],["stdDeviation","5"],["x","-0.5","y","-0.5","width","3","height","3","color-interpolation-filters","sRGB","id","shadow2"],["stdDeviation","1"],["type","text/css"],["x","0","width","200","y","0","height","200",1,"compass","bgRect"],[1,"compass"],["cx","100","cy","100","r","90",1,"bgDial"],["d","M 100 185 A 85 85 0 0 0 100 15",1,"starboard"],["d","M 99.99999999999999 15 A 85 85 0 0 0 100 185",1,"port"],["id","dial",1,"compass"],["d","M 100,45 L 100,65",1,"longDiv"],["d","M 100,155 L 100,135",1,"longDiv"],["d","M 45,100 L 65,100",1,"shortDiv"],["d","M 155,100 L 135,100",1,"shortDiv"],["d","M 100,30 L 100,19",1,"longDiv"],["d","M 101.30893048279626,25.011422863270653 L 101.41364492141996,19.012336692332312",1,"shortDiv"],["d","M 102.61746225268757,25.045687973567823 L 102.82685923290258,19.049343011453246",1,"shortDiv"],["d","M 103.92519671822079,25.102784893406962 L 104.23921245567846,19.111007684879525",1,"shortDiv"],["d","M 105.2317355308094,25.182696230513187 L 105.65027437327414,19.197311928954235",1,"shortDiv"],["d","M 106.53668070607436,25.285397643119083 L 107.0596151625603,19.308229454568604",1,"shortDiv"],["d","M 107.83963474507401,25.410857847379503 L 108.46680552467993,19.443726475169868",1,"shortDiv"],["d","M 109.14020075538606,25.559038626900858 L 109.87141681581694,19.60376171705292",1,"shortDiv"],["d","M 110.43798257200491,25.72989484438223 L 111.2730211777653,19.788286431932804",1,"shortDiv"],["d","M 111.73258487801732,25.923374455364666 L 112.6711916682587,19.997244411793844",1,"shortDiv"],["d","M 113.02361332501978,26.139418524084405 L 114.06550239102135,20.230572006011144",1,"shortDiv"],["d","M 114.31067465324087,26.377961241425197 L 115.45552862550014,20.488198140739215",1,"shortDiv"],["d","M 115.59337681133195,26.638929944964573 L 116.84084695623851,20.77004434056174",1,"shortDiv"],["d","M 116.87132907578987,26.922245141107354 L 118.22103540185307,21.076024752395952",1,"shortDiv"],["d","M 118.14414216997508,27.22782052930026 L 119.59567354357308,21.40604617164429",1,"shortDiv"],["d","M 119.41142838268905,27.55556302831988 L 120.96434265330419,21.76000807058547",1,"shortDiv"],["d","M 120.67280168627494,27.905372804626083 L 122.32662582117693,22.13780262899617",1,"shortDiv"],["d","M 121.92787785420526,28.277143302772345 L 123.68210808254167,22.539314766994124",1,"shortDiv"],["d","M 123.17627457812105,28.67076127786349 L 125.03037654437074,22.96442218009257",1,"shortDiv"],["d","M 124.41761158428675,29.086106830051236 L 126.37102051102968,23.412995376455342",1,"shortDiv"],["d","M 125.65151074942516,29.523053441056874 L 127.70363160937916,23.884897716341413",1,"shortDiv"],["d","M 126.87759621589751,29.98146801270987 L 129.02780391316932,24.37998545372666",1,"shortDiv"],["d","M 128.0954945061934,30.461210907490937 L 130.34313406668886,24.898107780090214",1,"shortDiv"],["d","M 129.30483463669552,30.962135991066972 L 131.64922140763116,25.439106870352333",1,"shortDiv"],["d","M 130.50524823068503,31.48409067680494 L 132.94566808913982,26.002817930949334",1,"shortDiv"],["d","M 131.69636963055245,32.02691597225126 L 134.23207920099665,26.589069250031358",1,"shortDiv"],["d","M 132.8778360091808,32.59044652756248 L 135.50806288991527,27.197682249767468",1,"shortDiv"],["d","M 134.049287480466,33.174510685872406 L 136.7732304789033,27.8284715407422",1,"shortDiv"],["d","M 135.21036720894182,33.77893053558047 L 138.02719658565715,28.481244978426915",1,"shortDiv"],["d","M 136.3607215184753,34.40352196454532 L 139.26957923995332,29.15580372170895",1,"shortDiv"],["d","M 137.5,35.0480947161671 L 140.5,29.851942293460468",1,"shortDiv"],["d","M 138.62785561825405,35.712452447341576 L 141.7180840677144,30.569448643128908",1,"shortDiv"],["d","M 139.74394481749036,36.39639278826805 L 142.9234604028896,31.308104211329493",1,"shortDiv"],["d","M 140.84792762612705,37.099707404093195 L 144.1157618362172,32.067683996420655",1,"shortDiv"],["d","M 141.939467760306,37.82218205837188 L 145.2946251811305,32.847956623041625",1,"shortDiv"],["d","M 143.01823272632845,38.56359667832562 L 146.45969134443473,33.64868441259166",1,"shortDiv"],["d","M 144.0838939219355,39.32372542187894 L 147.61060543569033,34.46962345562926",1,"shortDiv"],["d","M 145.1361267364036,40.10233674645304 L 148.74701687531592,35.310523686169276",1,"shortDiv"],["d","M 146.17461064942438,40.89919347949585 L 149.86857950137832,36.171128957855515",1,"shortDiv"],["d","M 147.1990293287378,41.71405289072718 L 150.97495167503683,37.051177121985354",1,"shortDiv"],["d","M 148.20907072649044,42.54666676607665 L 152.06579638460968,37.95040010736278",1,"shortDiv"],["d","M 149.20442717428804,43.3967814832921 L 153.1407813482311,38.868524001955464",1,"shortDiv"],["d","M 150.18479547691436,44.264138089195434 L 154.1995791150675,39.80526913633106",1,"shortDiv"],["d","M 151.14987700468737,45.148472378562204 L 155.2418671650624,40.76035016884718",1,"shortDiv"],["d","M 152.0993777844248,46.04951497460116 L 156.26732800717878,41.733476172569254",1,"shortDiv"],["d","M 127.55320713028647,33.48067365918736 L 130.99735802157227,25.16575786658578",1,"shortDiv"],["d","M 149.49747468305833,50.50252531694167 L 157.27564927611036,42.72435072388965",1,"longDiv"],["d","M 153.95048502539885,47.900622215575204 L 158.26652382743075,43.732671992821224",1,"shortDiv"],["d","M 154.85152762143778,48.85012299531262 L 159.2396498311528,44.758132834937626",1,"shortDiv"],["d","M 155.73586191080457,49.81520452308563 L 160.19473086366895,45.800420884932485",1,"shortDiv"],["d","M 156.6032185167079,50.79557282571196 L 161.13147599804455,46.85921865176891",1,"shortDiv"],["d","M 157.45333323392336,51.79092927350955 L 162.04959989263722,47.93420361539031",1,"shortDiv"],["d","M 158.28594710927283,52.800970671262185 L 162.94882287801465,49.025048324963166",1,"shortDiv"],["d","M 159.10080652050414,53.82538935057563 L 163.82887104214447,50.13142049862168",1,"shortDiv"],["d","M 159.89766325354697,54.86387326359638 L 164.6894763138307,51.25298312468409",1,"shortDiv"],["d","M 160.67627457812105,55.916106078064516 L 165.53037654437074,52.389394564309676",1,"shortDiv"],["d","M 161.4364033216744,56.981767273671544 L 166.35131558740835,53.54030865556527",1,"shortDiv"],["d","M 162.17781794162812,58.06053223969399 L 167.15204337695837,54.70537481886951",1,"shortDiv"],["d","M 162.90029259590682,59.15207237387296 L 167.93231600357933,55.8842381637828",1,"shortDiv"],["d","M 163.60360721173197,60.256055182509634 L 168.6918957886705,57.076539597110404",1,"shortDiv"],["d","M 164.2875475526584,61.37214438174592 L 169.4305513568711,58.28191593228559",1,"shortDiv"],["d","M 164.9519052838329,62.49999999999999 L 170.14805770653953,59.49999999999999",1,"shortDiv"],["d","M 165.59647803545468,63.63927848152472 L 170.84419627829107,60.73042076004669",1,"shortDiv"],["d","M 166.22106946441951,64.78963279105818 L 171.51875502157307,61.97280341434284",1,"shortDiv"],["d","M 166.8254893141276,65.950712519534 L 172.1715284592578,63.226769521096706",1,"shortDiv"],["d","M 167.40955347243752,67.12216399081919 L 172.80231775023253,64.49193711008473",1,"shortDiv"],["d","M 167.97308402774874,68.30363036944755 L 173.41093074996866,65.76792079900335",1,"shortDiv"],["d","M 168.51590932319505,69.49475176931499 L 173.99718206905067,67.05433191086018",1,"shortDiv"],["d","M 169.037864008933,70.69516536330447 L 174.56089312964767,68.35077859236883",1,"shortDiv"],["d","M 169.53878909250906,71.90450549380658 L 175.1018922199098,69.65686593331111",1,"shortDiv"],["d","M 170.01853198729015,73.12240378410247 L 175.62001454627335,70.97219608683068",1,"shortDiv"],["d","M 170.47694655894313,74.34848925057484 L 176.1151022836586,72.29636839062083",1,"shortDiv"],["d","M 170.91389316994875,75.58238841571324 L 176.58700462354466,73.6289794889703",1,"shortDiv"],["d","M 171.3292387221365,76.82372542187895 L 177.03557781990742,74.96962345562926",1,"shortDiv"],["d","M 171.72285669722766,78.07212214579474 L 177.46068523300588,76.31789191745833",1,"shortDiv"],["d","M 172.0946271953739,79.32719831372506 L 177.86219737100384,77.67337417882307",1,"shortDiv"],["d","M 172.44443697168012,80.58857161731093 L 178.23999192941454,79.0356573466958",1,"shortDiv"],["d","M 172.77217947069974,81.85585783002492 L 178.59395382835572,80.40432645642692",1,"shortDiv"],["d","M 173.07775485889266,83.12867092421011 L 178.92397524760406,81.77896459814693",1,"shortDiv"],["d","M 173.36107005503544,84.40662318866805 L 179.22995565943825,83.1591530437615",1,"shortDiv"],["d","M 173.6220387585748,85.68932534675913 L 179.5118018592608,84.54447137449986",1,"shortDiv"],["d","M 173.86058147591558,86.97638667498022 L 179.76942799398887,85.93449760897863",1,"shortDiv"],["d","M 174.07662554463533,88.26741512198268 L 180.00275558820616,87.3288083317413",1,"shortDiv"],["d","M 174.27010515561778,89.56201742799509 L 180.21171356806718,88.7269788222347",1,"shortDiv"],["d","M 174.44096137309913,90.85979924461394 L 180.39623828294708,90.12858318418306",1,"shortDiv"],["d","M 174.5891421526205,92.16036525492598 L 180.55627352483015,91.53319447532004",1,"shortDiv"],["d","M 174.7146023568809,93.46331929392564 L 180.69177054543138,92.9403848374397",1,"shortDiv"],["d","M 174.8173037694868,94.7682644691906 L 180.80268807104576,94.34972562672584",1,"shortDiv"],["d","M 174.89721510659302,96.07480328177923 L 180.88899231512048,95.76078754432156",1,"shortDiv"],["d","M 174.95431202643218,97.38253774731243 L 180.95065698854677,97.17314076709741",1,"shortDiv"],["d","M 174.98857713672936,98.69106951720373 L 180.98766330766767,98.58635507858003",1,"shortDiv"],["d","M 166.51932634081265,72.44679286971353 L 174.83424213341422,69.00264197842772",1,"shortDiv"],["d","M 170,100 L 181,100",1,"longDiv"],["d","M 174.98857713672936,101.30893048279626 L 180.98766330766767,101.41364492141996",1,"shortDiv"],["d","M 174.95431202643218,102.61746225268757 L 180.95065698854677,102.82685923290258",1,"shortDiv"],["d","M 174.89721510659302,103.92519671822079 L 180.88899231512048,104.23921245567846",1,"shortDiv"],["d","M 174.8173037694868,105.2317355308094 L 180.80268807104576,105.65027437327416",1,"shortDiv"],["d","M 174.7146023568809,106.53668070607435 L 180.69177054543138,107.0596151625603",1,"shortDiv"],["d","M 174.58914215262052,107.839634745074 L 180.55627352483015,108.46680552467993",1,"shortDiv"],["d","M 174.44096137309916,109.14020075538605 L 180.39623828294708,109.87141681581693",1,"shortDiv"],["d","M 174.27010515561778,110.4379825720049 L 180.21171356806718,111.27302117776529",1,"shortDiv"],["d","M 174.07662554463533,111.7325848780173 L 180.00275558820616,112.6711916682587",1,"shortDiv"],["d","M 173.86058147591558,113.02361332501977 L 179.76942799398887,114.06550239102135",1,"shortDiv"],["d","M 173.6220387585748,114.31067465324087 L 179.5118018592608,115.45552862550014",1,"shortDiv"],["d","M 173.36107005503544,115.59337681133195 L 179.22995565943825,116.84084695623851",1,"shortDiv"],["d","M 173.07775485889266,116.87132907578987 L 178.92397524760406,118.22103540185307",1,"shortDiv"],["d","M 172.77217947069974,118.14414216997507 L 178.59395382835572,119.59567354357307",1,"shortDiv"],["d","M 172.44443697168012,119.41142838268905 L 178.23999192941454,120.96434265330417",1,"shortDiv"],["d","M 172.0946271953739,120.67280168627494 L 177.86219737100384,122.32662582117692",1,"shortDiv"],["d","M 171.72285669722766,121.92787785420525 L 177.46068523300588,123.68210808254167",1,"shortDiv"],["d","M 171.32923872213652,123.17627457812105 L 177.03557781990745,125.03037654437074",1,"shortDiv"],["d","M 170.91389316994878,124.41761158428675 L 176.58700462354466,126.37102051102968",1,"shortDiv"],["d","M 170.47694655894313,125.65151074942516 L 176.1151022836586,127.70363160937916",1,"shortDiv"],["d","M 170.01853198729015,126.87759621589751 L 175.62001454627335,129.02780391316932",1,"shortDiv"],["d","M 169.53878909250906,128.0954945061934 L 175.1018922199098,130.3431340666889",1,"shortDiv"],["d","M 169.037864008933,129.30483463669552 L 174.56089312964767,131.64922140763116",1,"shortDiv"],["d","M 168.51590932319507,130.505248230685 L 173.99718206905067,132.94566808913982",1,"shortDiv"],["d","M 167.97308402774877,131.69636963055245 L 173.41093074996866,134.23207920099665",1,"shortDiv"],["d","M 167.40955347243752,132.8778360091808 L 172.80231775023253,135.50806288991527",1,"shortDiv"],["d","M 166.8254893141276,134.049287480466 L 172.1715284592578,136.7732304789033",1,"shortDiv"],["d","M 166.22106946441954,135.2103672089418 L 171.5187550215731,138.02719658565712",1,"shortDiv"],["d","M 165.5964780354547,136.36072151847526 L 170.84419627829107,139.2695792399533",1,"shortDiv"],["d","M 164.9519052838329,137.5 L 170.14805770653953,140.49999999999997",1,"shortDiv"],["d","M 164.28754755265842,138.62785561825407 L 169.4305513568711,141.7180840677144",1,"shortDiv"],["d","M 163.60360721173197,139.74394481749036 L 168.6918957886705,142.9234604028896",1,"shortDiv"],["d","M 162.90029259590682,140.84792762612705 L 167.93231600357933,144.1157618362172",1,"shortDiv"],["d","M 162.17781794162812,141.939467760306 L 167.15204337695837,145.29462518113047",1,"shortDiv"],["d","M 161.4364033216744,143.01823272632845 L 166.35131558740832,146.45969134443473",1,"shortDiv"],["d","M 160.67627457812105,144.08389392193547 L 165.53037654437074,147.61060543569033",1,"shortDiv"],["d","M 159.89766325354697,145.1361267364036 L 164.68947631383074,148.7470168753159",1,"shortDiv"],["d","M 159.10080652050414,146.17461064942438 L 163.8288710421445,149.86857950137832",1,"shortDiv"],["d","M 158.28594710927283,147.1990293287378 L 162.94882287801465,150.97495167503683",1,"shortDiv"],["d","M 157.45333323392336,148.20907072649044 L 162.04959989263722,152.06579638460968",1,"shortDiv"],["d","M 156.6032185167079,149.20442717428804 L 161.13147599804455,153.1407813482311",1,"shortDiv"],["d","M 155.73586191080457,150.18479547691436 L 160.19473086366895,154.1995791150675",1,"shortDiv"],["d","M 154.8515276214378,151.14987700468737 L 159.2396498311528,155.24186716506236",1,"shortDiv"],["d","M 153.95048502539885,152.0993777844248 L 158.26652382743075,156.26732800717878",1,"shortDiv"],["d","M 166.51932634081265,127.55320713028647 L 174.83424213341422,130.99735802157227",1,"shortDiv"],["d","M 149.49747468305833,149.49747468305833 L 157.27564927611036,157.27564927611036",1,"longDiv"],["d","M 152.0993777844248,153.95048502539882 L 156.2673280071788,158.26652382743072",1,"shortDiv"],["d","M 151.1498770046874,154.85152762143778 L 155.2418671650624,159.2396498311528",1,"shortDiv"],["d","M 150.18479547691436,155.73586191080454 L 154.19957911506754,160.19473086366892",1,"shortDiv"],["d","M 149.20442717428804,156.6032185167079 L 153.1407813482311,161.13147599804455",1,"shortDiv"],["d","M 148.20907072649047,157.45333323392333 L 152.0657963846097,162.04959989263722",1,"shortDiv"],["d","M 147.1990293287378,158.28594710927283 L 150.97495167503683,162.94882287801465",1,"shortDiv"],["d","M 146.17461064942438,159.10080652050414 L 149.86857950137832,163.82887104214447",1,"shortDiv"],["d","M 145.1361267364036,159.89766325354697 L 148.7470168753159,164.6894763138307",1,"shortDiv"],["d","M 144.0838939219355,160.67627457812105 L 147.61060543569033,165.53037654437074",1,"shortDiv"],["d","M 143.01823272632848,161.4364033216744 L 146.45969134443476,166.35131558740832",1,"shortDiv"],["d","M 141.939467760306,162.17781794162812 L 145.2946251811305,167.15204337695837",1,"shortDiv"],["d","M 140.84792762612705,162.9002925959068 L 144.11576183621722,167.93231600357933",1,"shortDiv"],["d","M 139.74394481749036,163.60360721173197 L 142.9234604028896,168.6918957886705",1,"shortDiv"],["d","M 138.62785561825407,164.2875475526584 L 141.71808406771441,169.4305513568711",1,"shortDiv"],["d","M 137.5,164.9519052838329 L 140.5,170.14805770653953",1,"shortDiv"],["d","M 136.3607215184753,165.59647803545468 L 139.26957923995332,170.84419627829107",1,"shortDiv"],["d","M 135.21036720894182,166.22106946441954 L 138.02719658565715,171.5187550215731",1,"shortDiv"],["d","M 134.049287480466,166.8254893141276 L 136.7732304789033,172.1715284592578",1,"shortDiv"],["d","M 132.87783600918084,167.4095534724375 L 135.5080628899153,172.80231775023253",1,"shortDiv"],["d","M 131.69636963055245,167.97308402774874 L 134.23207920099665,173.41093074996866",1,"shortDiv"],["d","M 130.50524823068503,168.51590932319505 L 132.94566808913984,173.99718206905067",1,"shortDiv"],["d","M 129.30483463669555,169.037864008933 L 131.64922140763116,174.56089312964767",1,"shortDiv"],["d","M 128.0954945061934,169.53878909250903 L 130.3431340666889,175.10189221990976",1,"shortDiv"],["d","M 126.87759621589751,170.01853198729015 L 129.02780391316932,175.62001454627335",1,"shortDiv"],["d","M 125.65151074942517,170.47694655894313 L 127.70363160937919,176.1151022836586",1,"shortDiv"],["d","M 124.41761158428675,170.91389316994878 L 126.37102051102968,176.58700462354466",1,"shortDiv"],["d","M 123.17627457812107,171.3292387221365 L 125.03037654437075,177.03557781990742",1,"shortDiv"],["d","M 121.92787785420528,171.72285669722766 L 123.6821080825417,177.46068523300588",1,"shortDiv"],["d","M 120.67280168627494,172.0946271953739 L 122.32662582117693,177.86219737100384",1,"shortDiv"],["d","M 119.41142838268908,172.44443697168012 L 120.9643426533042,178.23999192941454",1,"shortDiv"],["d","M 118.14414216997508,172.77217947069974 L 119.59567354357308,178.59395382835572",1,"shortDiv"],["d","M 116.87132907578989,173.07775485889263 L 118.22103540185307,178.92397524760406",1,"shortDiv"],["d","M 115.59337681133195,173.36107005503544 L 116.84084695623851,179.22995565943825",1,"shortDiv"],["d","M 114.31067465324088,173.6220387585748 L 115.45552862550014,179.5118018592608",1,"shortDiv"],["d","M 113.02361332501977,173.86058147591558 L 114.06550239102135,179.76942799398887",1,"shortDiv"],["d","M 111.73258487801732,174.0766255446353 L 112.67119166825871,180.00275558820616",1,"shortDiv"],["d","M 110.43798257200493,174.27010515561778 L 111.27302117776533,180.21171356806718",1,"shortDiv"],["d","M 109.14020075538606,174.44096137309913 L 109.87141681581696,180.39623828294708",1,"shortDiv"],["d","M 107.83963474507404,174.5891421526205 L 108.46680552467996,180.55627352483015",1,"shortDiv"],["d","M 106.53668070607436,174.7146023568809 L 107.05961516256032,180.69177054543138",1,"shortDiv"],["d","M 105.23173553080942,174.8173037694868 L 105.65027437327417,180.80268807104576",1,"shortDiv"],["d","M 103.92519671822079,174.89721510659302 L 104.23921245567846,180.88899231512048",1,"shortDiv"],["d","M 102.61746225268759,174.95431202643218 L 102.82685923290259,180.95065698854677",1,"shortDiv"],["d","M 101.30893048279626,174.98857713672936 L 101.41364492141996,180.98766330766767",1,"shortDiv"],["d","M 127.55320713028647,166.51932634081265 L 130.99735802157227,174.83424213341422",1,"shortDiv"],["d","M 100.00000000000001,170 L 100.00000000000001,181",1,"longDiv"],["d","M 98.69106951720376,174.98857713672936 L 98.58635507858006,180.98766330766767",1,"shortDiv"],["d","M 97.38253774731243,174.95431202643218 L 97.17314076709742,180.95065698854677",1,"shortDiv"],["d","M 96.07480328177924,174.89721510659302 L 95.76078754432157,180.88899231512048",1,"shortDiv"],["d","M 94.7682644691906,174.8173037694868 L 94.34972562672586,180.80268807104576",1,"shortDiv"],["d","M 93.46331929392565,174.7146023568809 L 92.94038483743971,180.69177054543138",1,"shortDiv"],["d","M 92.16036525492599,174.5891421526205 L 91.53319447532007,180.55627352483015",1,"shortDiv"],["d","M 90.85979924461395,174.44096137309916 L 90.12858318418307,180.39623828294708",1,"shortDiv"],["d","M 89.56201742799509,174.27010515561778 L 88.7269788222347,180.21171356806718",1,"shortDiv"],["d","M 88.2674151219827,174.07662554463533 L 87.32880833174131,180.00275558820616",1,"shortDiv"],["d","M 86.97638667498025,173.8605814759156 L 85.93449760897867,179.76942799398887",1,"shortDiv"],["d","M 85.68932534675915,173.6220387585748 L 84.54447137449988,179.5118018592608",1,"shortDiv"],["d","M 84.40662318866806,173.36107005503544 L 83.15915304376152,179.22995565943825",1,"shortDiv"],["d","M 83.12867092421013,173.07775485889266 L 81.77896459814694,178.92397524760406",1,"shortDiv"],["d","M 81.85585783002495,172.77217947069974 L 80.40432645642693,178.59395382835572",1,"shortDiv"],["d","M 80.58857161731095,172.44443697168012 L 79.03565734669581,178.23999192941454",1,"shortDiv"],["d","M 79.32719831372508,172.0946271953739 L 77.67337417882308,177.86219737100384",1,"shortDiv"],["d","M 78.07212214579474,171.72285669722766 L 76.31789191745833,177.46068523300588",1,"shortDiv"],["d","M 76.82372542187895,171.32923872213652 L 74.96962345562928,177.03557781990745",1,"shortDiv"],["d","M 75.58238841571327,170.91389316994878 L 73.62897948897033,176.58700462354466",1,"shortDiv"],["d","M 74.34848925057486,170.47694655894313 L 72.29636839062084,176.1151022836586",1,"shortDiv"],["d","M 73.1224037841025,170.01853198729015 L 70.9721960868307,175.62001454627335",1,"shortDiv"],["d","M 71.9045054938066,169.53878909250906 L 69.65686593331112,175.1018922199098",1,"shortDiv"],["d","M 70.69516536330448,169.037864008933 L 68.35077859236884,174.56089312964767",1,"shortDiv"],["d","M 69.49475176931499,168.51590932319505 L 67.05433191086018,173.99718206905067",1,"shortDiv"],["d","M 68.30363036944755,167.97308402774877 L 65.76792079900335,173.41093074996866",1,"shortDiv"],["d","M 67.12216399081919,167.40955347243752 L 64.49193711008473,172.80231775023253",1,"shortDiv"],["d","M 65.950712519534,166.8254893141276 L 63.22676952109672,172.1715284592578",1,"shortDiv"],["d","M 64.78963279105821,166.22106946441954 L 61.97280341434287,171.5187550215731",1,"shortDiv"],["d","M 63.63927848152473,165.5964780354547 L 60.730420760046705,170.84419627829107",1,"shortDiv"],["d","M 62.50000000000002,164.9519052838329 L 59.50000000000002,170.14805770653953",1,"shortDiv"],["d","M 61.37214438174594,164.28754755265842 L 58.281915932285614,169.4305513568711",1,"shortDiv"],["d","M 60.25605518250964,163.60360721173197 L 57.07653959711041,168.6918957886705",1,"shortDiv"],["d","M 59.15207237387297,162.90029259590682 L 55.884238163782804,167.93231600357933",1,"shortDiv"],["d","M 58.060532239694,162.17781794162815 L 54.705374818869515,167.15204337695837",1,"shortDiv"],["d","M 56.98176727367154,161.4364033216744 L 53.54030865556526,166.35131558740835",1,"shortDiv"],["d","M 55.91610607806452,160.67627457812105 L 52.38939456430968,165.53037654437074",1,"shortDiv"],["d","M 54.863873263596396,159.89766325354697 L 51.25298312468411,164.68947631383074",1,"shortDiv"],["d","M 53.825389350575634,159.10080652050414 L 50.13142049862169,163.8288710421445",1,"shortDiv"],["d","M 52.800970671262206,158.28594710927283 L 49.02504832496318,162.94882287801465",1,"shortDiv"],["d","M 51.790929273509555,157.45333323392336 L 47.934203615390324,162.04959989263722",1,"shortDiv"],["d","M 50.79557282571197,156.6032185167079 L 46.85921865176893,161.13147599804455",1,"shortDiv"],["d","M 49.81520452308563,155.73586191080457 L 45.800420884932485,160.19473086366895",1,"shortDiv"],["d","M 48.850122995312624,154.8515276214378 L 44.75813283493763,159.2396498311528",1,"shortDiv"],["d","M 47.9006222155752,153.95048502539885 L 43.73267199282121,158.26652382743075",1,"shortDiv"],["d","M 72.44679286971355,166.51932634081265 L 69.00264197842773,174.83424213341425",1,"shortDiv"],["d","M 50.50252531694168,149.49747468305833 L 42.72435072388966,157.27564927611036",1,"longDiv"],["d","M 46.04951497460119,152.0993777844248 L 41.73347617256928,156.2673280071788",1,"shortDiv"],["d","M 45.14847237856222,151.1498770046874 L 40.76035016884719,155.2418671650624",1,"shortDiv"],["d","M 44.26413808919545,150.1847954769144 L 39.805269136331084,154.19957911506754",1,"shortDiv"],["d","M 43.39678148329211,149.20442717428804 L 38.86852400195548,153.1407813482311",1,"shortDiv"],["d","M 42.546666766076655,148.20907072649047 L 37.95040010736279,152.0657963846097",1,"shortDiv"],["d","M 41.71405289072721,147.19902932873782 L 37.05117712198538,150.97495167503686",1,"shortDiv"],["d","M 40.89919347949584,146.17461064942435 L 36.17112895785551,149.8685795013783",1,"shortDiv"],["d","M 40.10233674645304,145.1361267364036 L 35.310523686169276,148.74701687531592",1,"shortDiv"],["d","M 39.32372542187895,144.0838939219355 L 34.46962345562926,147.61060543569033",1,"shortDiv"],["d","M 38.56359667832563,143.01823272632848 L 33.64868441259168,146.45969134443476",1,"shortDiv"],["d","M 37.822182058371894,141.93946776030606 L 32.84795662304164,145.29462518113053",1,"shortDiv"],["d","M 37.099707404093195,140.84792762612702 L 32.067683996420655,144.1157618362172",1,"shortDiv"],["d","M 36.39639278826806,139.7439448174904 L 31.308104211329507,142.9234604028896",1,"shortDiv"],["d","M 35.71245244734159,138.6278556182541 L 30.569448643128922,141.71808406771441",1,"shortDiv"],["d","M 35.04809471616713,137.50000000000003 L 29.851942293460496,140.50000000000003",1,"shortDiv"],["d","M 34.403521964545305,136.36072151847526 L 29.155803721708935,139.2695792399533",1,"shortDiv"],["d","M 33.77893053558047,135.21036720894182 L 28.481244978426915,138.02719658565715",1,"shortDiv"],["d","M 33.17451068587242,134.04928748046603 L 27.828471540742214,136.77323047890332",1,"shortDiv"],["d","M 32.59044652756249,132.87783600918084 L 27.19768224976748,135.5080628899153",1,"shortDiv"],["d","M 32.026915972251274,131.6963696305525 L 26.589069250031372,134.23207920099668",1,"shortDiv"],["d","M 31.484090676804925,130.505248230685 L 26.00281793094932,132.94566808913982",1,"shortDiv"],["d","M 30.962135991066987,129.30483463669555 L 25.439106870352333,131.6492214076312",1,"shortDiv"],["d","M 30.46121090749095,128.09549450619343 L 24.89810778009023,130.3431340666889",1,"shortDiv"],["d","M 29.981468012709882,126.87759621589755 L 24.37998545372666,129.02780391316935",1,"shortDiv"],["d","M 29.523053441056874,125.65151074942514 L 23.884897716341413,127.70363160937916",1,"shortDiv"],["d","M 29.086106830051236,124.41761158428675 L 23.412995376455342,126.37102051102968",1,"shortDiv"],["d","M 28.67076127786349,123.17627457812107 L 22.96442218009257,125.03037654437075",1,"shortDiv"],["d","M 28.277143302772345,121.92787785420528 L 22.53931476699414,123.6821080825417",1,"shortDiv"],["d","M 27.905372804626097,120.67280168627498 L 22.137802628996184,122.32662582117698",1,"shortDiv"],["d","M 27.55556302831988,119.41142838268905 L 21.76000807058547,120.96434265330417",1,"shortDiv"],["d","M 27.22782052930026,118.14414216997508 L 21.40604617164429,119.5956735435731",1,"shortDiv"],["d","M 26.922245141107368,116.8713290757899 L 21.076024752395952,118.22103540185309",1,"shortDiv"],["d","M 26.638929944964588,115.59337681133198 L 20.770044340561753,116.84084695623855",1,"shortDiv"],["d","M 26.377961241425197,114.31067465324085 L 20.488198140739215,115.45552862550011",1,"shortDiv"],["d","M 26.139418524084405,113.02361332501978 L 20.230572006011144,114.06550239102135",1,"shortDiv"],["d","M 25.92337445536468,111.73258487801732 L 19.997244411793844,112.67119166825871",1,"shortDiv"],["d","M 25.72989484438223,110.43798257200494 L 19.788286431932804,111.27302117776533",1,"shortDiv"],["d","M 25.559038626900858,109.1402007553861 L 19.60376171705292,109.87141681581699",1,"shortDiv"],["d","M 25.41085784737949,107.83963474507401 L 19.443726475169854,108.46680552467993",1,"shortDiv"],["d","M 25.285397643119083,106.53668070607436 L 19.308229454568604,107.05961516256032",1,"shortDiv"],["d","M 25.182696230513187,105.23173553080942 L 19.197311928954235,105.65027437327417",1,"shortDiv"],["d","M 25.102784893406962,103.92519671822082 L 19.111007684879525,104.23921245567848",1,"shortDiv"],["d","M 25.045687973567823,102.61746225268756 L 19.049343011453246,102.82685923290256",1,"shortDiv"],["d","M 25.011422863270653,101.30893048279626 L 19.012336692332312,101.41364492141996",1,"shortDiv"],["d","M 33.480673659187374,127.55320713028651 L 25.165757866585793,130.99735802157232",1,"shortDiv"],["d","M 30,100.00000000000001 L 19,100.00000000000001",1,"longDiv"],["d","M 25.011422863270653,98.69106951720377 L 19.012336692332312,98.58635507858007",1,"shortDiv"],["d","M 25.045687973567823,97.38253774731247 L 19.049343011453246,97.17314076709746",1,"shortDiv"],["d","M 25.102784893406962,96.07480328177921 L 19.111007684879525,95.76078754432154",1,"shortDiv"],["d","M 25.182696230513173,94.76826446919061 L 19.197311928954235,94.34972562672586",1,"shortDiv"],["d","M 25.285397643119083,93.46331929392566 L 19.308229454568604,92.94038483743971",1,"shortDiv"],["d","M 25.41085784737949,92.16036525492602 L 19.443726475169854,91.5331944753201",1,"shortDiv"],["d","M 25.559038626900858,90.85979924461392 L 19.60376171705292,90.12858318418304",1,"shortDiv"],["d","M 25.72989484438223,89.56201742799509 L 19.788286431932804,88.7269788222347",1,"shortDiv"],["d","M 25.923374455364666,88.2674151219827 L 19.997244411793844,87.32880833174131",1,"shortDiv"],["d","M 26.13941852408439,86.97638667498025 L 20.230572006011144,85.93449760897867",1,"shortDiv"],["d","M 26.377961241425197,85.68932534675918 L 20.488198140739215,84.54447137449992",1,"shortDiv"],["d","M 26.638929944964588,84.40662318866805 L 20.770044340561753,83.15915304376148",1,"shortDiv"],["d","M 26.922245141107354,83.12867092421013 L 21.076024752395952,81.77896459814694",1,"shortDiv"],["d","M 27.22782052930026,81.85585783002495 L 21.406046171644277,80.40432645642693",1,"shortDiv"],["d","M 27.555563028319867,80.58857161731098 L 21.760008070585457,79.03565734669586",1,"shortDiv"],["d","M 27.905372804626097,79.32719831372505 L 22.137802628996184,77.67337417882305",1,"shortDiv"],["d","M 28.277143302772345,78.07212214579475 L 22.539314766994124,76.31789191745833",1,"shortDiv"],["d","M 28.670761277863477,76.82372542187896 L 22.964422180092555,74.96962345562928",1,"shortDiv"],["d","M 29.08610683005122,75.58238841571327 L 23.412995376455328,73.62897948897034",1,"shortDiv"],["d","M 29.52305344105686,74.34848925057489 L 23.884897716341413,72.29636839062088",1,"shortDiv"],["d","M 29.98146801270987,73.12240378410247 L 24.37998545372666,70.97219608683068",1,"shortDiv"],["d","M 30.461210907490937,71.9045054938066 L 24.898107780090214,69.65686593331114",1,"shortDiv"],["d","M 30.96213599106696,70.69516536330448 L 25.43910687035232,68.35077859236884",1,"shortDiv"],["d","M 31.484090676804925,69.49475176931502 L 26.002817930949305,67.05433191086021",1,"shortDiv"],["d","M 32.02691597225126,68.30363036944753 L 26.589069250031358,65.76792079900333",1,"shortDiv"],["d","M 32.59044652756248,67.12216399081919 L 27.197682249767468,64.49193711008473",1,"shortDiv"],["d","M 33.174510685872406,65.950712519534 L 27.828471540742186,63.22676952109672",1,"shortDiv"],["d","M 33.77893053558047,64.78963279105821 L 28.4812449784269,61.97280341434288",1,"shortDiv"],["d","M 34.403521964545334,63.639278481524705 L 29.15580372170895,60.73042076004668",1,"shortDiv"],["d","M 35.0480947161671,62.49999999999999 L 29.851942293460468,59.49999999999999",1,"shortDiv"],["d","M 35.712452447341576,61.37214438174594 L 30.569448643128908,58.281915932285614",1,"shortDiv"],["d","M 36.396392788268045,60.25605518250965 L 31.308104211329493,57.07653959711042",1,"shortDiv"],["d","M 37.09970740409318,59.152072373873004 L 32.06768399642064,55.88423816378284",1,"shortDiv"],["d","M 37.82218205837188,58.06053223969398 L 32.847956623041625,54.705374818869494",1,"shortDiv"],["d","M 38.56359667832562,56.981767273671544 L 33.64868441259166,53.54030865556527",1,"shortDiv"],["d","M 39.32372542187893,55.91610607806453 L 34.46962345562925,52.3893945643097",1,"shortDiv"],["d","M 40.10233674645302,54.8638732635964 L 35.31052368616926,51.252983124684114",1,"shortDiv"],["d","M 40.89919347949582,53.82538935057566 L 36.17112895785549,50.131420498621715",1,"shortDiv"],["d","M 41.71405289072719,52.800970671262185 L 37.05117712198537,49.025048324963166",1,"shortDiv"],["d","M 42.54666676607664,51.790929273509555 L 37.950400107362775,47.934203615390324",1,"shortDiv"],["d","M 43.39678148329209,50.79557282571197 L 38.86852400195546,46.85921865176893",1,"shortDiv"],["d","M 44.264138089195406,49.81520452308567 L 39.80526913633104,45.80042088493252",1,"shortDiv"],["d","M 45.148472378562175,48.85012299531265 L 40.76035016884715,44.75813283493767",1,"shortDiv"],["d","M 46.049514974601166,47.900622215575204 L 41.73347617256926,43.732671992821224",1,"shortDiv"],["d","M 33.48067365918736,72.44679286971352 L 25.16575786658578,69.0026419784277",1,"shortDiv"],["d","M 50.502525316941664,50.502525316941686 L 42.724350723889636,42.724350723889664",1,"longDiv"],["d","M 47.90062221557518,46.04951497460119 L 43.732671992821196,41.73347617256928",1,"shortDiv"],["d","M 48.85012299531258,45.148472378562246 L 44.75813283493759,40.76035016884723",1,"shortDiv"],["d","M 49.81520452308564,44.264138089195434 L 45.80042088493249,39.80526913633106",1,"shortDiv"],["d","M 50.79557282571194,43.39678148329211 L 46.8592186517689,38.86852400195548",1,"shortDiv"],["d","M 51.79092927350953,42.546666766076655 L 47.934203615390295,37.95040010736279",1,"shortDiv"],["d","M 52.800970671262164,41.71405289072722 L 49.02504832496314,37.05117712198539",1,"shortDiv"],["d","M 53.825389350575634,40.89919347949585 L 50.13142049862169,36.171128957855515",1,"shortDiv"],["d","M 54.86387326359638,40.10233674645304 L 51.25298312468409,35.310523686169276",1,"shortDiv"],["d","M 55.9161060780645,39.323725421878954 L 52.389394564309654,34.469623455629275",1,"shortDiv"],["d","M 56.981767273671515,38.56359667832563 L 53.540308655565234,33.64868441259168",1,"shortDiv"],["d","M 58.06053223969395,37.822182058371894 L 54.705374818869466,32.84795662304164",1,"shortDiv"],["d","M 59.152072373872976,37.099707404093195 L 55.88423816378282,32.067683996420655",1,"shortDiv"],["d","M 60.25605518250963,36.39639278826806 L 57.0765395971104,31.308104211329507",1,"shortDiv"],["d","M 61.37214438174591,35.71245244734159 L 58.281915932285585,30.569448643128922",1,"shortDiv"],["d","M 62.499999999999964,35.04809471616713 L 59.499999999999964,29.851942293460496",1,"shortDiv"],["d","M 63.639278481524734,34.403521964545305 L 60.73042076004671,29.155803721708935",1,"shortDiv"],["d","M 64.78963279105818,33.77893053558047 L 61.97280341434284,28.481244978426915",1,"shortDiv"],["d","M 65.95071251953398,33.17451068587242 L 63.22676952109669,27.828471540742214",1,"shortDiv"],["d","M 67.12216399081916,32.59044652756249 L 64.4919371100847,27.19768224976748",1,"shortDiv"],["d","M 68.3036303694475,32.026915972251274 L 65.76792079900329,26.589069250031372",1,"shortDiv"],["d","M 69.49475176931499,31.484090676804925 L 67.05433191086018,26.00281793094932",1,"shortDiv"],["d","M 70.69516536330445,30.962135991066987 L 68.35077859236881,25.439106870352333",1,"shortDiv"],["d","M 71.90450549380657,30.46121090749095 L 69.6568659333111,24.89810778009023",1,"shortDiv"],["d","M 73.12240378410245,29.981468012709882 L 70.97219608683064,24.37998545372666",1,"shortDiv"],["d","M 74.34848925057486,29.523053441056874 L 72.29636839062084,23.884897716341413",1,"shortDiv"],["d","M 75.58238841571324,29.086106830051236 L 73.62897948897032,23.412995376455342",1,"shortDiv"],["d","M 76.82372542187893,28.67076127786349 L 74.96962345562925,22.96442218009257",1,"shortDiv"],["d","M 78.07212214579471,28.277143302772345 L 76.3178919174583,22.53931476699414",1,"shortDiv"],["d","M 79.32719831372502,27.905372804626097 L 77.67337417882302,22.137802628996184",1,"shortDiv"],["d","M 80.58857161731095,27.55556302831988 L 79.03565734669583,21.76000807058547",1,"shortDiv"],["d","M 81.85585783002492,27.22782052930026 L 80.4043264564269,21.40604617164429",1,"shortDiv"],["d","M 83.1286709242101,26.922245141107368 L 81.7789645981469,21.076024752395952",1,"shortDiv"],["d","M 84.40662318866801,26.638929944964588 L 83.15915304376145,20.770044340561753",1,"shortDiv"],["d","M 85.68932534675915,26.377961241425197 L 84.54447137449988,20.488198140739215",1,"shortDiv"],["d","M 86.97638667498022,26.139418524084405 L 85.93449760897863,20.230572006011144",1,"shortDiv"],["d","M 88.26741512198267,25.92337445536468 L 87.32880833174129,19.997244411793844",1,"shortDiv"],["d","M 89.56201742799506,25.72989484438223 L 88.72697882223466,19.788286431932804",1,"shortDiv"],["d","M 90.8597992446139,25.559038626900858 L 90.128583184183,19.60376171705292",1,"shortDiv"],["d","M 92.16036525492599,25.410857847379503 L 91.53319447532007,19.443726475169868",1,"shortDiv"],["d","M 93.46331929392562,25.285397643119083 L 92.94038483743968,19.308229454568604",1,"shortDiv"],["d","M 94.76826446919058,25.182696230513187 L 94.34972562672583,19.197311928954235",1,"shortDiv"],["d","M 96.07480328177917,25.102784893406962 L 95.7607875443215,19.111007684879525",1,"shortDiv"],["d","M 97.38253774731244,25.045687973567823 L 97.17314076709744,19.049343011453246",1,"shortDiv"],["d","M 98.69106951720373,25.011422863270653 L 98.58635507858003,19.012336692332312",1,"shortDiv"],["d","M 72.44679286971349,33.480673659187374 L 69.00264197842768,25.165757866585793",1,"shortDiv"],["d","M 99.99999999999999,30 L 99.99999999999999,19",1,"longDiv"],["x","100","y","40","id","pcN",1,"scale"],["x","100","y","40","id","pcE","transform","rotate(90,100,100)",1,"scale"],["x","100","y","40","id","pcS","transform","rotate(180,100,100)",1,"scale"],["x","100","y","40","id","pcW","transform","rotate(270,100,100)",1,"scale"],["x","100","y","40","id","pcNE","transform","rotate(45,100,100)",1,"scale"],["x","100","y","40","id","pcSE","transform","rotate(135,100,100)",1,"scale"],["x","100","y","40","id","pcSW","transform","rotate(225,100,100)",1,"scale"],["x","100","y","40","id","pcNW","transform","rotate(315,100,100)",1,"scale"],[1,"compass",2,"z-index","1000"],["x","100","y","95","id","headingtext",1,"value"],["x","100","y","115","id","speedtext",1,"value"],["x","100","y","130",1,"speedunits"],["id","gLoPointer",1,"compass",3,"ngClass"],["transform","rotate(0 100 100)","id","needlelo"],["d","M 100,79 l 6,-49 -6,-20 -6,20 6,49 z","id","loPointer"],["id","gHiPointer",1,"compass",3,"ngClass"],["transform","rotate(0 100 100)","id","needlehi"],["d","M 100,79 l 5,-49 -5,-10 -5,10 5,49 z","id","hiPointer"],["id","pointer",1,"compass",3,"ngClass"],["transform","rotate(0 100 100)","id","needle"],["d","M 95,70 l 5,-30 5,30 -10,0 z","id","pointerShaftInner"],["transform","rotate(0 100 100)"],["d","M 100,20 l 8,-10 -16,0 8,10 z","id","topMark"]],template:function(t,i){t&1&&(Eo(),u(0,"svg",7)(1,"defs")(2,"filter",8),z(3,"feGaussianBlur",9),h(),u(4,"filter",10),z(5,"feGaussianBlur",11),h()(),u(6,"style",12),_(7," .hide { display:none; } .compass text { font-style:normal; font-variant:normal; font-weight:normal; font-stretch:normal; font-family:Arial; text-align:center; text-anchor:middle; stroke:none; fill-opacity:1; } .compass text.label { /** label **/ font-size:10px; fill: #dcff85; } .compass text.value, .compass text.unit { /** units **/ font-size:12px; font-weight: bold; fill: black; fill-opacity:0.9; } .compass text.speedunits { font-size:10pt; fill: black; } .compass text.value { /** Heading Value **/ font-size:22px; } .compass text.cardinal_point { /** scale 12,3,6,9 oclock positions **/ font-size:20px; font-weight: bold; fill: black; } .compass text.intermediate_point { /** scale remainder **/ font-size:16px; fill: black; font-weight: bold; } .compass text.scale { font-size: 12px; font-weight: bold; fill: black; } .compass path.shortDiv { fill:none; fill-rule:evenodd; stroke: black; stroke-width:0.5; stroke-linecap:butt; stroke-linejoin:miter; stroke-miterlimit:4; stroke-dasharray:none; stroke-opacity:1; } .compass path.longDiv { fill:none; fill-rule:evenodd; /*stroke: #dcff85;*/ stroke: black; stroke-width:2; stroke-linecap:butt; stroke-linejoin:miter; stroke-miterlimit:4; stroke-dasharray:none; stroke-opacity:1; } rect.compass.bgRect { fill:transparent; stroke: none; } .compass .bgDial { fill: lightgray; stroke: gray; stroke-width: 2px; } .compass #pointerShaftInner { fill: orangered; stroke:orangered; stroke-width:0.3; stroke-opacity:1; display: block; } .compass #hiPointer { fill:olive; fill-opacity:0.8; display: block; } .compass #loPointer { fill: rgb(16, 75, 16); fill-opacity:0.8; display: block; } .compass #topMark { stroke: #3d3b3b; stroke-width: 1; fill: gray; fill-opacity:1; display: block; } .compass path.port { fill:none; stroke: red; stroke-width:6; stroke-linecap:butt; stroke-linejoin:miter; stroke-miterlimit:4; stroke-dasharray:none; stroke-opacity:1; } .compass path.starboard { fill:none; stroke: green; stroke-width:6; stroke-linecap:butt; stroke-linejoin:miter; stroke-miterlimit:4; stroke-dasharray:none; stroke-opacity:1; } .dark-theme { .compass text.speedunits, .compass text.label { /** label **/ fill: #dcff85; } .compass text.value, .compass text.unit { /** units **/ fill: #00ff00; } .compass text.scale { fill: #dcff85; } .compass .bgDial { fill: transparent; stroke: #deff8b; } .compass #topMark { fill: #dcff85; stroke: unset; } .compass text.cardinal_point { /** scale 12,3,6,9 oclock positions **/ fill: #dcff85; } .compass text.intermediate_point { /** scale remainder **/ fill: #dcff85; } .compass path.shortDiv { stroke: #dcff85; } .compass path.longDiv { stroke: #dcff85; } } "),h(),z(8,"rect",13),u(9,"g",14),z(10,"circle",15),h(),u(11,"g",14),z(12,"path",16)(13,"path",17),h(),u(14,"g",18,0),z(16,"path",19)(17,"path",20)(18,"path",21)(19,"path",22)(20,"path",23)(21,"path",24)(22,"path",25)(23,"path",26)(24,"path",27)(25,"path",28)(26,"path",29)(27,"path",30)(28,"path",31)(29,"path",32)(30,"path",33)(31,"path",34)(32,"path",35)(33,"path",36)(34,"path",37)(35,"path",38)(36,"path",39)(37,"path",40)(38,"path",41)(39,"path",42)(40,"path",43)(41,"path",44)(42,"path",45)(43,"path",46)(44,"path",47)(45,"path",48)(46,"path",49)(47,"path",50)(48,"path",51)(49,"path",52)(50,"path",53)(51,"path",54)(52,"path",55)(53,"path",56)(54,"path",57)(55,"path",58)(56,"path",59)(57,"path",60)(58,"path",61)(59,"path",62)(60,"path",63)(61,"path",64)(62,"path",65)(63,"path",66)(64,"path",67)(65,"path",68)(66,"path",69)(67,"path",70)(68,"path",71)(69,"path",72)(70,"path",73)(71,"path",74)(72,"path",75)(73,"path",76)(74,"path",77)(75,"path",78)(76,"path",79)(77,"path",80)(78,"path",81)(79,"path",82)(80,"path",83)(81,"path",84)(82,"path",85)(83,"path",86)(84,"path",87)(85,"path",88)(86,"path",89)(87,"path",90)(88,"path",91)(89,"path",92)(90,"path",93)(91,"path",94)(92,"path",95)(93,"path",96)(94,"path",97)(95,"path",98)(96,"path",99)(97,"path",100)(98,"path",101)(99,"path",102)(100,"path",103)(101,"path",104)(102,"path",105)(103,"path",106)(104,"path",107)(105,"path",108)(106,"path",109)(107,"path",110)(108,"path",111)(109,"path",112)(110,"path",113)(111,"path",114)(112,"path",115)(113,"path",116)(114,"path",117)(115,"path",118)(116,"path",119)(117,"path",120)(118,"path",121)(119,"path",122)(120,"path",123)(121,"path",124)(122,"path",125)(123,"path",126)(124,"path",127)(125,"path",128)(126,"path",129)(127,"path",130)(128,"path",131)(129,"path",132)(130,"path",133)(131,"path",134)(132,"path",135)(133,"path",136)(134,"path",137)(135,"path",138)(136,"path",139)(137,"path",140)(138,"path",141)(139,"path",142)(140,"path",143)(141,"path",144)(142,"path",145)(143,"path",146)(144,"path",147)(145,"path",148)(146,"path",149)(147,"path",150)(148,"path",151)(149,"path",152)(150,"path",153)(151,"path",154)(152,"path",155)(153,"path",156)(154,"path",157)(155,"path",158)(156,"path",159)(157,"path",160)(158,"path",161)(159,"path",162)(160,"path",163)(161,"path",164)(162,"path",165)(163,"path",166)(164,"path",167)(165,"path",168)(166,"path",169)(167,"path",170)(168,"path",171)(169,"path",172)(170,"path",173)(171,"path",174)(172,"path",175)(173,"path",176)(174,"path",177)(175,"path",178)(176,"path",179)(177,"path",180)(178,"path",181)(179,"path",182)(180,"path",183)(181,"path",184)(182,"path",185)(183,"path",186)(184,"path",187)(185,"path",188)(186,"path",189)(187,"path",190)(188,"path",191)(189,"path",192)(190,"path",193)(191,"path",194)(192,"path",195)(193,"path",196)(194,"path",197)(195,"path",198)(196,"path",199)(197,"path",200)(198,"path",201)(199,"path",202)(200,"path",203)(201,"path",204)(202,"path",205)(203,"path",206)(204,"path",207)(205,"path",208)(206,"path",209)(207,"path",210)(208,"path",211)(209,"path",212)(210,"path",213)(211,"path",214)(212,"path",215)(213,"path",216)(214,"path",217)(215,"path",218)(216,"path",219)(217,"path",220)(218,"path",221)(219,"path",222)(220,"path",223)(221,"path",224)(222,"path",225)(223,"path",226)(224,"path",227)(225,"path",228)(226,"path",229)(227,"path",230)(228,"path",231)(229,"path",232)(230,"path",233)(231,"path",234)(232,"path",235)(233,"path",236)(234,"path",237)(235,"path",238)(236,"path",239)(237,"path",240)(238,"path",241)(239,"path",242)(240,"path",243)(241,"path",244)(242,"path",245)(243,"path",246)(244,"path",247)(245,"path",248)(246,"path",249)(247,"path",250)(248,"path",251)(249,"path",252)(250,"path",253)(251,"path",254)(252,"path",255)(253,"path",256)(254,"path",257)(255,"path",258)(256,"path",259)(257,"path",260)(258,"path",261)(259,"path",262)(260,"path",263)(261,"path",264)(262,"path",265)(263,"path",266)(264,"path",267)(265,"path",268)(266,"path",269)(267,"path",270)(268,"path",271)(269,"path",272)(270,"path",273)(271,"path",274),z(272,"path",275)(273,"path",276)(274,"path",277)(275,"path",278)(276,"path",279)(277,"path",280)(278,"path",281)(279,"path",282)(280,"path",283)(281,"path",284)(282,"path",285)(283,"path",286)(284,"path",287)(285,"path",288)(286,"path",289)(287,"path",290)(288,"path",291)(289,"path",292)(290,"path",293)(291,"path",294)(292,"path",295)(293,"path",296)(294,"path",297)(295,"path",298)(296,"path",299)(297,"path",300)(298,"path",301)(299,"path",302)(300,"path",303)(301,"path",304)(302,"path",305)(303,"path",306)(304,"path",307)(305,"path",308)(306,"path",309)(307,"path",310)(308,"path",311)(309,"path",312)(310,"path",313)(311,"path",314)(312,"path",315)(313,"path",316)(314,"path",317)(315,"path",318)(316,"path",319)(317,"path",320)(318,"path",321)(319,"path",322)(320,"path",323)(321,"path",324)(322,"path",325)(323,"path",326)(324,"path",327)(325,"path",328)(326,"path",329)(327,"path",330)(328,"path",331)(329,"path",332)(330,"path",333)(331,"path",334)(332,"path",335)(333,"path",336)(334,"path",337)(335,"path",338)(336,"path",339)(337,"path",340)(338,"path",341)(339,"path",342)(340,"path",343)(341,"path",344)(342,"path",345)(343,"path",346)(344,"path",347)(345,"path",348)(346,"path",349)(347,"path",350)(348,"path",351)(349,"path",352)(350,"path",353)(351,"path",354)(352,"path",355)(353,"path",356)(354,"path",357)(355,"path",358)(356,"path",359)(357,"path",360)(358,"path",361)(359,"path",362)(360,"path",363)(361,"path",364)(362,"path",365)(363,"path",366)(364,"path",367)(365,"path",368)(366,"path",369)(367,"path",370)(368,"path",371)(369,"path",372)(370,"path",373)(371,"path",374)(372,"path",375)(373,"path",376)(374,"path",377)(375,"path",378)(376,"path",379)(377,"path",380)(378,"path",381)(379,"path",382)(380,"path",383)(381,"path",384)(382,"path",385)(383,"path",386)(384,"path",387)(385,"path",388)(386,"path",389)(387,"path",390)(388,"path",391),u(389,"text",392),_(390,"N"),h(),u(391,"text",393),_(392,"E"),h(),u(393,"text",394),_(394,"S"),h(),u(395,"text",395),_(396,"W"),h(),u(397,"text",396),_(398,"NE"),h(),u(399,"text",397),_(400,"SE"),h(),u(401,"text",398),_(402,"SW"),h(),u(403,"text",399),_(404,"NW"),h()(),u(405,"g",400)(406,"text",401,1),_(408,"0\xBA"),h(),z(409,"text",402,2)(411,"text",403,3),h(),u(413,"g",404)(414,"g",405,4),z(416,"path",406),h()(),u(417,"g",407)(418,"g",408,5),z(420,"path",409),h()(),u(421,"g",410,6)(423,"g",411),z(424,"path",412),h()(),u(425,"g",14)(426,"g",413),z(427,"path",414),h()()()),t&2&&(f(413),w("ngClass",Gi(3,mg,i.windapparent==null||i.windapparent==null)),f(4),w("ngClass",Gi(5,mg,i.windtrue==null||i.windtrue==null)),f(4),w("ngClass",Gi(7,mg,i.needle==null||i.needle==null)))},dependencies:[mn,Rn],encapsulation:2,changeDetection:0})},vw=class n extends _w{label="";speed;heading;windtrue;windapparent;labeltext;headingtext;speedtext;pointer;needlehi;needlelo;showPointer=!0;showWindTrue=!0;showWindApparent=!0;renderer=M(Pn);constructor(){super(null)}ngOnInit(){this.updateDial()}ngOnChanges(e){this.updateDial(e)}renderValue(e,t=0,i=!1){if(isNaN(e)||typeof e!="number")return"--";let r=typeof t=="number"?e.toFixed(t):e.toString();return e<10&&i?"0"+r:r}updateDial(e){let t={windtrue:!1,windapparent:!1,label:null,heading:null,speed:null};t.heading=e&&e.heading?e.heading.currentValue:this.heading,t.speed=e&&e.speed?e.speed.currentValue:this.speed,t.label=e&&e.label?e.label.currentValue:this.label,this.labeltext&&this.labeltext.nativeElement&&this.renderer.setProperty(this.labeltext.nativeElement,"innerHTML",t.label),this.speedtext&&this.speedtext.nativeElement&&this.renderer.setProperty(this.speedtext.nativeElement,"innerHTML",this.renderValue(t.speed,1));let i=this.renderValue(t.heading,0),r=i==="--"?this.minValue:t.heading;this.showPointer=i!=="--"&&!this.windtrue&&!this.windapparent,this.pointer&&this.pointer.nativeElement&&this.renderer.setAttribute(this.pointer.nativeElement,"transform","rotate("+this.getAngle(r)+" 100 100)"),this.headingtext&&this.headingtext.nativeElement&&this.renderer.setProperty(this.headingtext.nativeElement,"innerHTML",i+"\xBA"),this.showWindTrue=i!=="--"&&this.windtrue,this.needlehi&&this.needlehi.nativeElement&&this.renderer.setAttribute(this.needlehi.nativeElement,"transform","rotate("+this.getAngle(r)+" 100 100)"),this.showWindApparent=i!=="--"&&this.windapparent&&!this.windtrue,this.needlehi&&this.needlehi.nativeElement&&this.renderer.setAttribute(this.needlelo.nativeElement,"transform","rotate("+this.getAngle(r)+" 100 100)")}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["ap-compass-northup"]],viewQuery:function(t,i){if(t&1&&Ot(e1e,7)(hj,7)(pj,7)(mj,7)(fj,7)(gj,7),t&2){let r;Ee(r=Ie())&&(i.labeltext=r.first),Ee(r=Ie())&&(i.headingtext=r.first),Ee(r=Ie())&&(i.speedtext=r.first),Ee(r=Ie())&&(i.pointer=r.first),Ee(r=Ie())&&(i.needlehi=r.first),Ee(r=Ie())&&(i.needlelo=r.first)}},inputs:{label:"label",speed:"speed",heading:"heading",windtrue:"windtrue",windapparent:"windapparent"},features:[it,Se],decls:424,vars:9,consts:[["dial",""],["headingtext",""],["speedtext",""],["labeltext",""],["needlelo",""],["needlehi",""],["pointer",""],[0,"xmlns","svg","http://www.w3.org/2000/svg","xmlns","http://www.w3.org/2000/svg",0,"xmlns","xlink","http://www.w3.org/1999/xlink",0,"xmlns","rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#",0,"xmlns","dc","http://purl.org/dc/elements/1.1/","version","1.1","encoding","UTF-8","viewBox","0 0 200 200"],["x","-0.5","y","-0.5","width","2","height","2","color-interpolation-filters","sRGB","id","shadow"],["stdDeviation","5"],["x","-0.5","y","-0.5","width","3","height","3","color-interpolation-filters","sRGB","id","shadow2"],["stdDeviation","1"],["type","text/css"],["x","0","width","200","y","0","height","200",1,"compass_nup","bgRect"],[1,"compass_nup"],["cx","100","cy","100","r","90",1,"bgDial"],["id","dial",1,"compass_nup"],["d","M 100,45 L 100,65",1,"longDiv"],["d","M 100,155 L 100,135",1,"longDiv"],["d","M 45,100 L 65,100",1,"longDiv"],["d","M 155,100 L 135,100",1,"longDiv"],["d","M 100,30 L 100,19",1,"longDiv"],["d","M 101.30893048279626,25.011422863270653 L 101.41364492141996,19.012336692332312",1,"shortDiv"],["d","M 102.61746225268757,25.045687973567823 L 102.82685923290258,19.049343011453246",1,"shortDiv"],["d","M 103.92519671822079,25.102784893406962 L 104.23921245567846,19.111007684879525",1,"shortDiv"],["d","M 105.2317355308094,25.182696230513187 L 105.65027437327414,19.197311928954235",1,"shortDiv"],["d","M 106.53668070607436,25.285397643119083 L 107.0596151625603,19.308229454568604",1,"shortDiv"],["d","M 107.83963474507401,25.410857847379503 L 108.46680552467993,19.443726475169868",1,"shortDiv"],["d","M 109.14020075538606,25.559038626900858 L 109.87141681581694,19.60376171705292",1,"shortDiv"],["d","M 110.43798257200491,25.72989484438223 L 111.2730211777653,19.788286431932804",1,"shortDiv"],["d","M 111.73258487801732,25.923374455364666 L 112.6711916682587,19.997244411793844",1,"shortDiv"],["d","M 113.02361332501978,26.139418524084405 L 114.06550239102135,20.230572006011144",1,"shortDiv"],["d","M 114.31067465324087,26.377961241425197 L 115.45552862550014,20.488198140739215",1,"shortDiv"],["d","M 115.59337681133195,26.638929944964573 L 116.84084695623851,20.77004434056174",1,"shortDiv"],["d","M 116.87132907578987,26.922245141107354 L 118.22103540185307,21.076024752395952",1,"shortDiv"],["d","M 118.14414216997508,27.22782052930026 L 119.59567354357308,21.40604617164429",1,"shortDiv"],["d","M 119.41142838268905,27.55556302831988 L 120.96434265330419,21.76000807058547",1,"shortDiv"],["d","M 120.67280168627494,27.905372804626083 L 122.32662582117693,22.13780262899617",1,"shortDiv"],["d","M 121.92787785420526,28.277143302772345 L 123.68210808254167,22.539314766994124",1,"shortDiv"],["d","M 123.17627457812105,28.67076127786349 L 125.03037654437074,22.96442218009257",1,"shortDiv"],["d","M 124.41761158428675,29.086106830051236 L 126.37102051102968,23.412995376455342",1,"shortDiv"],["d","M 125.65151074942516,29.523053441056874 L 127.70363160937916,23.884897716341413",1,"shortDiv"],["d","M 126.87759621589751,29.98146801270987 L 129.02780391316932,24.37998545372666",1,"shortDiv"],["d","M 128.0954945061934,30.461210907490937 L 130.34313406668886,24.898107780090214",1,"shortDiv"],["d","M 129.30483463669552,30.962135991066972 L 131.64922140763116,25.439106870352333",1,"shortDiv"],["d","M 130.50524823068503,31.48409067680494 L 132.94566808913982,26.002817930949334",1,"shortDiv"],["d","M 131.69636963055245,32.02691597225126 L 134.23207920099665,26.589069250031358",1,"shortDiv"],["d","M 132.8778360091808,32.59044652756248 L 135.50806288991527,27.197682249767468",1,"shortDiv"],["d","M 134.049287480466,33.174510685872406 L 136.7732304789033,27.8284715407422",1,"shortDiv"],["d","M 135.21036720894182,33.77893053558047 L 138.02719658565715,28.481244978426915",1,"shortDiv"],["d","M 136.3607215184753,34.40352196454532 L 139.26957923995332,29.15580372170895",1,"shortDiv"],["d","M 137.5,35.0480947161671 L 140.5,29.851942293460468",1,"shortDiv"],["d","M 138.62785561825405,35.712452447341576 L 141.7180840677144,30.569448643128908",1,"shortDiv"],["d","M 139.74394481749036,36.39639278826805 L 142.9234604028896,31.308104211329493",1,"shortDiv"],["d","M 140.84792762612705,37.099707404093195 L 144.1157618362172,32.067683996420655",1,"shortDiv"],["d","M 141.939467760306,37.82218205837188 L 145.2946251811305,32.847956623041625",1,"shortDiv"],["d","M 143.01823272632845,38.56359667832562 L 146.45969134443473,33.64868441259166",1,"shortDiv"],["d","M 144.0838939219355,39.32372542187894 L 147.61060543569033,34.46962345562926",1,"shortDiv"],["d","M 145.1361267364036,40.10233674645304 L 148.74701687531592,35.310523686169276",1,"shortDiv"],["d","M 146.17461064942438,40.89919347949585 L 149.86857950137832,36.171128957855515",1,"shortDiv"],["d","M 147.1990293287378,41.71405289072718 L 150.97495167503683,37.051177121985354",1,"shortDiv"],["d","M 148.20907072649044,42.54666676607665 L 152.06579638460968,37.95040010736278",1,"shortDiv"],["d","M 149.20442717428804,43.3967814832921 L 153.1407813482311,38.868524001955464",1,"shortDiv"],["d","M 150.18479547691436,44.264138089195434 L 154.1995791150675,39.80526913633106",1,"shortDiv"],["d","M 151.14987700468737,45.148472378562204 L 155.2418671650624,40.76035016884718",1,"shortDiv"],["d","M 152.0993777844248,46.04951497460116 L 156.26732800717878,41.733476172569254",1,"shortDiv"],["d","M 127.55320713028647,33.48067365918736 L 130.99735802157227,25.16575786658578",1,"shortDiv"],["d","M 149.49747468305833,50.50252531694167 L 157.27564927611036,42.72435072388965",1,"longDiv"],["d","M 153.95048502539885,47.900622215575204 L 158.26652382743075,43.732671992821224",1,"shortDiv"],["d","M 154.85152762143778,48.85012299531262 L 159.2396498311528,44.758132834937626",1,"shortDiv"],["d","M 155.73586191080457,49.81520452308563 L 160.19473086366895,45.800420884932485",1,"shortDiv"],["d","M 156.6032185167079,50.79557282571196 L 161.13147599804455,46.85921865176891",1,"shortDiv"],["d","M 157.45333323392336,51.79092927350955 L 162.04959989263722,47.93420361539031",1,"shortDiv"],["d","M 158.28594710927283,52.800970671262185 L 162.94882287801465,49.025048324963166",1,"shortDiv"],["d","M 159.10080652050414,53.82538935057563 L 163.82887104214447,50.13142049862168",1,"shortDiv"],["d","M 159.89766325354697,54.86387326359638 L 164.6894763138307,51.25298312468409",1,"shortDiv"],["d","M 160.67627457812105,55.916106078064516 L 165.53037654437074,52.389394564309676",1,"shortDiv"],["d","M 161.4364033216744,56.981767273671544 L 166.35131558740835,53.54030865556527",1,"shortDiv"],["d","M 162.17781794162812,58.06053223969399 L 167.15204337695837,54.70537481886951",1,"shortDiv"],["d","M 162.90029259590682,59.15207237387296 L 167.93231600357933,55.8842381637828",1,"shortDiv"],["d","M 163.60360721173197,60.256055182509634 L 168.6918957886705,57.076539597110404",1,"shortDiv"],["d","M 164.2875475526584,61.37214438174592 L 169.4305513568711,58.28191593228559",1,"shortDiv"],["d","M 164.9519052838329,62.49999999999999 L 170.14805770653953,59.49999999999999",1,"shortDiv"],["d","M 165.59647803545468,63.63927848152472 L 170.84419627829107,60.73042076004669",1,"shortDiv"],["d","M 166.22106946441951,64.78963279105818 L 171.51875502157307,61.97280341434284",1,"shortDiv"],["d","M 166.8254893141276,65.950712519534 L 172.1715284592578,63.226769521096706",1,"shortDiv"],["d","M 167.40955347243752,67.12216399081919 L 172.80231775023253,64.49193711008473",1,"shortDiv"],["d","M 167.97308402774874,68.30363036944755 L 173.41093074996866,65.76792079900335",1,"shortDiv"],["d","M 168.51590932319505,69.49475176931499 L 173.99718206905067,67.05433191086018",1,"shortDiv"],["d","M 169.037864008933,70.69516536330447 L 174.56089312964767,68.35077859236883",1,"shortDiv"],["d","M 169.53878909250906,71.90450549380658 L 175.1018922199098,69.65686593331111",1,"shortDiv"],["d","M 170.01853198729015,73.12240378410247 L 175.62001454627335,70.97219608683068",1,"shortDiv"],["d","M 170.47694655894313,74.34848925057484 L 176.1151022836586,72.29636839062083",1,"shortDiv"],["d","M 170.91389316994875,75.58238841571324 L 176.58700462354466,73.6289794889703",1,"shortDiv"],["d","M 171.3292387221365,76.82372542187895 L 177.03557781990742,74.96962345562926",1,"shortDiv"],["d","M 171.72285669722766,78.07212214579474 L 177.46068523300588,76.31789191745833",1,"shortDiv"],["d","M 172.0946271953739,79.32719831372506 L 177.86219737100384,77.67337417882307",1,"shortDiv"],["d","M 172.44443697168012,80.58857161731093 L 178.23999192941454,79.0356573466958",1,"shortDiv"],["d","M 172.77217947069974,81.85585783002492 L 178.59395382835572,80.40432645642692",1,"shortDiv"],["d","M 173.07775485889266,83.12867092421011 L 178.92397524760406,81.77896459814693",1,"shortDiv"],["d","M 173.36107005503544,84.40662318866805 L 179.22995565943825,83.1591530437615",1,"shortDiv"],["d","M 173.6220387585748,85.68932534675913 L 179.5118018592608,84.54447137449986",1,"shortDiv"],["d","M 173.86058147591558,86.97638667498022 L 179.76942799398887,85.93449760897863",1,"shortDiv"],["d","M 174.07662554463533,88.26741512198268 L 180.00275558820616,87.3288083317413",1,"shortDiv"],["d","M 174.27010515561778,89.56201742799509 L 180.21171356806718,88.7269788222347",1,"shortDiv"],["d","M 174.44096137309913,90.85979924461394 L 180.39623828294708,90.12858318418306",1,"shortDiv"],["d","M 174.5891421526205,92.16036525492598 L 180.55627352483015,91.53319447532004",1,"shortDiv"],["d","M 174.7146023568809,93.46331929392564 L 180.69177054543138,92.9403848374397",1,"shortDiv"],["d","M 174.8173037694868,94.7682644691906 L 180.80268807104576,94.34972562672584",1,"shortDiv"],["d","M 174.89721510659302,96.07480328177923 L 180.88899231512048,95.76078754432156",1,"shortDiv"],["d","M 174.95431202643218,97.38253774731243 L 180.95065698854677,97.17314076709741",1,"shortDiv"],["d","M 174.98857713672936,98.69106951720373 L 180.98766330766767,98.58635507858003",1,"shortDiv"],["d","M 166.51932634081265,72.44679286971353 L 174.83424213341422,69.00264197842772",1,"shortDiv"],["d","M 170,100 L 181,100",1,"longDiv"],["d","M 174.98857713672936,101.30893048279626 L 180.98766330766767,101.41364492141996",1,"shortDiv"],["d","M 174.95431202643218,102.61746225268757 L 180.95065698854677,102.82685923290258",1,"shortDiv"],["d","M 174.89721510659302,103.92519671822079 L 180.88899231512048,104.23921245567846",1,"shortDiv"],["d","M 174.8173037694868,105.2317355308094 L 180.80268807104576,105.65027437327416",1,"shortDiv"],["d","M 174.7146023568809,106.53668070607435 L 180.69177054543138,107.0596151625603",1,"shortDiv"],["d","M 174.58914215262052,107.839634745074 L 180.55627352483015,108.46680552467993",1,"shortDiv"],["d","M 174.44096137309916,109.14020075538605 L 180.39623828294708,109.87141681581693",1,"shortDiv"],["d","M 174.27010515561778,110.4379825720049 L 180.21171356806718,111.27302117776529",1,"shortDiv"],["d","M 174.07662554463533,111.7325848780173 L 180.00275558820616,112.6711916682587",1,"shortDiv"],["d","M 173.86058147591558,113.02361332501977 L 179.76942799398887,114.06550239102135",1,"shortDiv"],["d","M 173.6220387585748,114.31067465324087 L 179.5118018592608,115.45552862550014",1,"shortDiv"],["d","M 173.36107005503544,115.59337681133195 L 179.22995565943825,116.84084695623851",1,"shortDiv"],["d","M 173.07775485889266,116.87132907578987 L 178.92397524760406,118.22103540185307",1,"shortDiv"],["d","M 172.77217947069974,118.14414216997507 L 178.59395382835572,119.59567354357307",1,"shortDiv"],["d","M 172.44443697168012,119.41142838268905 L 178.23999192941454,120.96434265330417",1,"shortDiv"],["d","M 172.0946271953739,120.67280168627494 L 177.86219737100384,122.32662582117692",1,"shortDiv"],["d","M 171.72285669722766,121.92787785420525 L 177.46068523300588,123.68210808254167",1,"shortDiv"],["d","M 171.32923872213652,123.17627457812105 L 177.03557781990745,125.03037654437074",1,"shortDiv"],["d","M 170.91389316994878,124.41761158428675 L 176.58700462354466,126.37102051102968",1,"shortDiv"],["d","M 170.47694655894313,125.65151074942516 L 176.1151022836586,127.70363160937916",1,"shortDiv"],["d","M 170.01853198729015,126.87759621589751 L 175.62001454627335,129.02780391316932",1,"shortDiv"],["d","M 169.53878909250906,128.0954945061934 L 175.1018922199098,130.3431340666889",1,"shortDiv"],["d","M 169.037864008933,129.30483463669552 L 174.56089312964767,131.64922140763116",1,"shortDiv"],["d","M 168.51590932319507,130.505248230685 L 173.99718206905067,132.94566808913982",1,"shortDiv"],["d","M 167.97308402774877,131.69636963055245 L 173.41093074996866,134.23207920099665",1,"shortDiv"],["d","M 167.40955347243752,132.8778360091808 L 172.80231775023253,135.50806288991527",1,"shortDiv"],["d","M 166.8254893141276,134.049287480466 L 172.1715284592578,136.7732304789033",1,"shortDiv"],["d","M 166.22106946441954,135.2103672089418 L 171.5187550215731,138.02719658565712",1,"shortDiv"],["d","M 165.5964780354547,136.36072151847526 L 170.84419627829107,139.2695792399533",1,"shortDiv"],["d","M 164.9519052838329,137.5 L 170.14805770653953,140.49999999999997",1,"shortDiv"],["d","M 164.28754755265842,138.62785561825407 L 169.4305513568711,141.7180840677144",1,"shortDiv"],["d","M 163.60360721173197,139.74394481749036 L 168.6918957886705,142.9234604028896",1,"shortDiv"],["d","M 162.90029259590682,140.84792762612705 L 167.93231600357933,144.1157618362172",1,"shortDiv"],["d","M 162.17781794162812,141.939467760306 L 167.15204337695837,145.29462518113047",1,"shortDiv"],["d","M 161.4364033216744,143.01823272632845 L 166.35131558740832,146.45969134443473",1,"shortDiv"],["d","M 160.67627457812105,144.08389392193547 L 165.53037654437074,147.61060543569033",1,"shortDiv"],["d","M 159.89766325354697,145.1361267364036 L 164.68947631383074,148.7470168753159",1,"shortDiv"],["d","M 159.10080652050414,146.17461064942438 L 163.8288710421445,149.86857950137832",1,"shortDiv"],["d","M 158.28594710927283,147.1990293287378 L 162.94882287801465,150.97495167503683",1,"shortDiv"],["d","M 157.45333323392336,148.20907072649044 L 162.04959989263722,152.06579638460968",1,"shortDiv"],["d","M 156.6032185167079,149.20442717428804 L 161.13147599804455,153.1407813482311",1,"shortDiv"],["d","M 155.73586191080457,150.18479547691436 L 160.19473086366895,154.1995791150675",1,"shortDiv"],["d","M 154.8515276214378,151.14987700468737 L 159.2396498311528,155.24186716506236",1,"shortDiv"],["d","M 153.95048502539885,152.0993777844248 L 158.26652382743075,156.26732800717878",1,"shortDiv"],["d","M 166.51932634081265,127.55320713028647 L 174.83424213341422,130.99735802157227",1,"shortDiv"],["d","M 149.49747468305833,149.49747468305833 L 157.27564927611036,157.27564927611036",1,"longDiv"],["d","M 152.0993777844248,153.95048502539882 L 156.2673280071788,158.26652382743072",1,"shortDiv"],["d","M 151.1498770046874,154.85152762143778 L 155.2418671650624,159.2396498311528",1,"shortDiv"],["d","M 150.18479547691436,155.73586191080454 L 154.19957911506754,160.19473086366892",1,"shortDiv"],["d","M 149.20442717428804,156.6032185167079 L 153.1407813482311,161.13147599804455",1,"shortDiv"],["d","M 148.20907072649047,157.45333323392333 L 152.0657963846097,162.04959989263722",1,"shortDiv"],["d","M 147.1990293287378,158.28594710927283 L 150.97495167503683,162.94882287801465",1,"shortDiv"],["d","M 146.17461064942438,159.10080652050414 L 149.86857950137832,163.82887104214447",1,"shortDiv"],["d","M 145.1361267364036,159.89766325354697 L 148.7470168753159,164.6894763138307",1,"shortDiv"],["d","M 144.0838939219355,160.67627457812105 L 147.61060543569033,165.53037654437074",1,"shortDiv"],["d","M 143.01823272632848,161.4364033216744 L 146.45969134443476,166.35131558740832",1,"shortDiv"],["d","M 141.939467760306,162.17781794162812 L 145.2946251811305,167.15204337695837",1,"shortDiv"],["d","M 140.84792762612705,162.9002925959068 L 144.11576183621722,167.93231600357933",1,"shortDiv"],["d","M 139.74394481749036,163.60360721173197 L 142.9234604028896,168.6918957886705",1,"shortDiv"],["d","M 138.62785561825407,164.2875475526584 L 141.71808406771441,169.4305513568711",1,"shortDiv"],["d","M 137.5,164.9519052838329 L 140.5,170.14805770653953",1,"shortDiv"],["d","M 136.3607215184753,165.59647803545468 L 139.26957923995332,170.84419627829107",1,"shortDiv"],["d","M 135.21036720894182,166.22106946441954 L 138.02719658565715,171.5187550215731",1,"shortDiv"],["d","M 134.049287480466,166.8254893141276 L 136.7732304789033,172.1715284592578",1,"shortDiv"],["d","M 132.87783600918084,167.4095534724375 L 135.5080628899153,172.80231775023253",1,"shortDiv"],["d","M 131.69636963055245,167.97308402774874 L 134.23207920099665,173.41093074996866",1,"shortDiv"],["d","M 130.50524823068503,168.51590932319505 L 132.94566808913984,173.99718206905067",1,"shortDiv"],["d","M 129.30483463669555,169.037864008933 L 131.64922140763116,174.56089312964767",1,"shortDiv"],["d","M 128.0954945061934,169.53878909250903 L 130.3431340666889,175.10189221990976",1,"shortDiv"],["d","M 126.87759621589751,170.01853198729015 L 129.02780391316932,175.62001454627335",1,"shortDiv"],["d","M 125.65151074942517,170.47694655894313 L 127.70363160937919,176.1151022836586",1,"shortDiv"],["d","M 124.41761158428675,170.91389316994878 L 126.37102051102968,176.58700462354466",1,"shortDiv"],["d","M 123.17627457812107,171.3292387221365 L 125.03037654437075,177.03557781990742",1,"shortDiv"],["d","M 121.92787785420528,171.72285669722766 L 123.6821080825417,177.46068523300588",1,"shortDiv"],["d","M 120.67280168627494,172.0946271953739 L 122.32662582117693,177.86219737100384",1,"shortDiv"],["d","M 119.41142838268908,172.44443697168012 L 120.9643426533042,178.23999192941454",1,"shortDiv"],["d","M 118.14414216997508,172.77217947069974 L 119.59567354357308,178.59395382835572",1,"shortDiv"],["d","M 116.87132907578989,173.07775485889263 L 118.22103540185307,178.92397524760406",1,"shortDiv"],["d","M 115.59337681133195,173.36107005503544 L 116.84084695623851,179.22995565943825",1,"shortDiv"],["d","M 114.31067465324088,173.6220387585748 L 115.45552862550014,179.5118018592608",1,"shortDiv"],["d","M 113.02361332501977,173.86058147591558 L 114.06550239102135,179.76942799398887",1,"shortDiv"],["d","M 111.73258487801732,174.0766255446353 L 112.67119166825871,180.00275558820616",1,"shortDiv"],["d","M 110.43798257200493,174.27010515561778 L 111.27302117776533,180.21171356806718",1,"shortDiv"],["d","M 109.14020075538606,174.44096137309913 L 109.87141681581696,180.39623828294708",1,"shortDiv"],["d","M 107.83963474507404,174.5891421526205 L 108.46680552467996,180.55627352483015",1,"shortDiv"],["d","M 106.53668070607436,174.7146023568809 L 107.05961516256032,180.69177054543138",1,"shortDiv"],["d","M 105.23173553080942,174.8173037694868 L 105.65027437327417,180.80268807104576",1,"shortDiv"],["d","M 103.92519671822079,174.89721510659302 L 104.23921245567846,180.88899231512048",1,"shortDiv"],["d","M 102.61746225268759,174.95431202643218 L 102.82685923290259,180.95065698854677",1,"shortDiv"],["d","M 101.30893048279626,174.98857713672936 L 101.41364492141996,180.98766330766767",1,"shortDiv"],["d","M 127.55320713028647,166.51932634081265 L 130.99735802157227,174.83424213341422",1,"shortDiv"],["d","M 100.00000000000001,170 L 100.00000000000001,181",1,"longDiv"],["d","M 98.69106951720376,174.98857713672936 L 98.58635507858006,180.98766330766767",1,"shortDiv"],["d","M 97.38253774731243,174.95431202643218 L 97.17314076709742,180.95065698854677",1,"shortDiv"],["d","M 96.07480328177924,174.89721510659302 L 95.76078754432157,180.88899231512048",1,"shortDiv"],["d","M 94.7682644691906,174.8173037694868 L 94.34972562672586,180.80268807104576",1,"shortDiv"],["d","M 93.46331929392565,174.7146023568809 L 92.94038483743971,180.69177054543138",1,"shortDiv"],["d","M 92.16036525492599,174.5891421526205 L 91.53319447532007,180.55627352483015",1,"shortDiv"],["d","M 90.85979924461395,174.44096137309916 L 90.12858318418307,180.39623828294708",1,"shortDiv"],["d","M 89.56201742799509,174.27010515561778 L 88.7269788222347,180.21171356806718",1,"shortDiv"],["d","M 88.2674151219827,174.07662554463533 L 87.32880833174131,180.00275558820616",1,"shortDiv"],["d","M 86.97638667498025,173.8605814759156 L 85.93449760897867,179.76942799398887",1,"shortDiv"],["d","M 85.68932534675915,173.6220387585748 L 84.54447137449988,179.5118018592608",1,"shortDiv"],["d","M 84.40662318866806,173.36107005503544 L 83.15915304376152,179.22995565943825",1,"shortDiv"],["d","M 83.12867092421013,173.07775485889266 L 81.77896459814694,178.92397524760406",1,"shortDiv"],["d","M 81.85585783002495,172.77217947069974 L 80.40432645642693,178.59395382835572",1,"shortDiv"],["d","M 80.58857161731095,172.44443697168012 L 79.03565734669581,178.23999192941454",1,"shortDiv"],["d","M 79.32719831372508,172.0946271953739 L 77.67337417882308,177.86219737100384",1,"shortDiv"],["d","M 78.07212214579474,171.72285669722766 L 76.31789191745833,177.46068523300588",1,"shortDiv"],["d","M 76.82372542187895,171.32923872213652 L 74.96962345562928,177.03557781990745",1,"shortDiv"],["d","M 75.58238841571327,170.91389316994878 L 73.62897948897033,176.58700462354466",1,"shortDiv"],["d","M 74.34848925057486,170.47694655894313 L 72.29636839062084,176.1151022836586",1,"shortDiv"],["d","M 73.1224037841025,170.01853198729015 L 70.9721960868307,175.62001454627335",1,"shortDiv"],["d","M 71.9045054938066,169.53878909250906 L 69.65686593331112,175.1018922199098",1,"shortDiv"],["d","M 70.69516536330448,169.037864008933 L 68.35077859236884,174.56089312964767",1,"shortDiv"],["d","M 69.49475176931499,168.51590932319505 L 67.05433191086018,173.99718206905067",1,"shortDiv"],["d","M 68.30363036944755,167.97308402774877 L 65.76792079900335,173.41093074996866",1,"shortDiv"],["d","M 67.12216399081919,167.40955347243752 L 64.49193711008473,172.80231775023253",1,"shortDiv"],["d","M 65.950712519534,166.8254893141276 L 63.22676952109672,172.1715284592578",1,"shortDiv"],["d","M 64.78963279105821,166.22106946441954 L 61.97280341434287,171.5187550215731",1,"shortDiv"],["d","M 63.63927848152473,165.5964780354547 L 60.730420760046705,170.84419627829107",1,"shortDiv"],["d","M 62.50000000000002,164.9519052838329 L 59.50000000000002,170.14805770653953",1,"shortDiv"],["d","M 61.37214438174594,164.28754755265842 L 58.281915932285614,169.4305513568711",1,"shortDiv"],["d","M 60.25605518250964,163.60360721173197 L 57.07653959711041,168.6918957886705",1,"shortDiv"],["d","M 59.15207237387297,162.90029259590682 L 55.884238163782804,167.93231600357933",1,"shortDiv"],["d","M 58.060532239694,162.17781794162815 L 54.705374818869515,167.15204337695837",1,"shortDiv"],["d","M 56.98176727367154,161.4364033216744 L 53.54030865556526,166.35131558740835",1,"shortDiv"],["d","M 55.91610607806452,160.67627457812105 L 52.38939456430968,165.53037654437074",1,"shortDiv"],["d","M 54.863873263596396,159.89766325354697 L 51.25298312468411,164.68947631383074",1,"shortDiv"],["d","M 53.825389350575634,159.10080652050414 L 50.13142049862169,163.8288710421445",1,"shortDiv"],["d","M 52.800970671262206,158.28594710927283 L 49.02504832496318,162.94882287801465",1,"shortDiv"],["d","M 51.790929273509555,157.45333323392336 L 47.934203615390324,162.04959989263722",1,"shortDiv"],["d","M 50.79557282571197,156.6032185167079 L 46.85921865176893,161.13147599804455",1,"shortDiv"],["d","M 49.81520452308563,155.73586191080457 L 45.800420884932485,160.19473086366895",1,"shortDiv"],["d","M 48.850122995312624,154.8515276214378 L 44.75813283493763,159.2396498311528",1,"shortDiv"],["d","M 47.9006222155752,153.95048502539885 L 43.73267199282121,158.26652382743075",1,"shortDiv"],["d","M 72.44679286971355,166.51932634081265 L 69.00264197842773,174.83424213341425",1,"shortDiv"],["d","M 50.50252531694168,149.49747468305833 L 42.72435072388966,157.27564927611036",1,"longDiv"],["d","M 46.04951497460119,152.0993777844248 L 41.73347617256928,156.2673280071788",1,"shortDiv"],["d","M 45.14847237856222,151.1498770046874 L 40.76035016884719,155.2418671650624",1,"shortDiv"],["d","M 44.26413808919545,150.1847954769144 L 39.805269136331084,154.19957911506754",1,"shortDiv"],["d","M 43.39678148329211,149.20442717428804 L 38.86852400195548,153.1407813482311",1,"shortDiv"],["d","M 42.546666766076655,148.20907072649047 L 37.95040010736279,152.0657963846097",1,"shortDiv"],["d","M 41.71405289072721,147.19902932873782 L 37.05117712198538,150.97495167503686",1,"shortDiv"],["d","M 40.89919347949584,146.17461064942435 L 36.17112895785551,149.8685795013783",1,"shortDiv"],["d","M 40.10233674645304,145.1361267364036 L 35.310523686169276,148.74701687531592",1,"shortDiv"],["d","M 39.32372542187895,144.0838939219355 L 34.46962345562926,147.61060543569033",1,"shortDiv"],["d","M 38.56359667832563,143.01823272632848 L 33.64868441259168,146.45969134443476",1,"shortDiv"],["d","M 37.822182058371894,141.93946776030606 L 32.84795662304164,145.29462518113053",1,"shortDiv"],["d","M 37.099707404093195,140.84792762612702 L 32.067683996420655,144.1157618362172",1,"shortDiv"],["d","M 36.39639278826806,139.7439448174904 L 31.308104211329507,142.9234604028896",1,"shortDiv"],["d","M 35.71245244734159,138.6278556182541 L 30.569448643128922,141.71808406771441",1,"shortDiv"],["d","M 35.04809471616713,137.50000000000003 L 29.851942293460496,140.50000000000003",1,"shortDiv"],["d","M 34.403521964545305,136.36072151847526 L 29.155803721708935,139.2695792399533",1,"shortDiv"],["d","M 33.77893053558047,135.21036720894182 L 28.481244978426915,138.02719658565715",1,"shortDiv"],["d","M 33.17451068587242,134.04928748046603 L 27.828471540742214,136.77323047890332",1,"shortDiv"],["d","M 32.59044652756249,132.87783600918084 L 27.19768224976748,135.5080628899153",1,"shortDiv"],["d","M 32.026915972251274,131.6963696305525 L 26.589069250031372,134.23207920099668",1,"shortDiv"],["d","M 31.484090676804925,130.505248230685 L 26.00281793094932,132.94566808913982",1,"shortDiv"],["d","M 30.962135991066987,129.30483463669555 L 25.439106870352333,131.6492214076312",1,"shortDiv"],["d","M 30.46121090749095,128.09549450619343 L 24.89810778009023,130.3431340666889",1,"shortDiv"],["d","M 29.981468012709882,126.87759621589755 L 24.37998545372666,129.02780391316935",1,"shortDiv"],["d","M 29.523053441056874,125.65151074942514 L 23.884897716341413,127.70363160937916",1,"shortDiv"],["d","M 29.086106830051236,124.41761158428675 L 23.412995376455342,126.37102051102968",1,"shortDiv"],["d","M 28.67076127786349,123.17627457812107 L 22.96442218009257,125.03037654437075",1,"shortDiv"],["d","M 28.277143302772345,121.92787785420528 L 22.53931476699414,123.6821080825417",1,"shortDiv"],["d","M 27.905372804626097,120.67280168627498 L 22.137802628996184,122.32662582117698",1,"shortDiv"],["d","M 27.55556302831988,119.41142838268905 L 21.76000807058547,120.96434265330417",1,"shortDiv"],["d","M 27.22782052930026,118.14414216997508 L 21.40604617164429,119.5956735435731",1,"shortDiv"],["d","M 26.922245141107368,116.8713290757899 L 21.076024752395952,118.22103540185309",1,"shortDiv"],["d","M 26.638929944964588,115.59337681133198 L 20.770044340561753,116.84084695623855",1,"shortDiv"],["d","M 26.377961241425197,114.31067465324085 L 20.488198140739215,115.45552862550011",1,"shortDiv"],["d","M 26.139418524084405,113.02361332501978 L 20.230572006011144,114.06550239102135",1,"shortDiv"],["d","M 25.92337445536468,111.73258487801732 L 19.997244411793844,112.67119166825871",1,"shortDiv"],["d","M 25.72989484438223,110.43798257200494 L 19.788286431932804,111.27302117776533",1,"shortDiv"],["d","M 25.559038626900858,109.1402007553861 L 19.60376171705292,109.87141681581699",1,"shortDiv"],["d","M 25.41085784737949,107.83963474507401 L 19.443726475169854,108.46680552467993",1,"shortDiv"],["d","M 25.285397643119083,106.53668070607436 L 19.308229454568604,107.05961516256032",1,"shortDiv"],["d","M 25.182696230513187,105.23173553080942 L 19.197311928954235,105.65027437327417",1,"shortDiv"],["d","M 25.102784893406962,103.92519671822082 L 19.111007684879525,104.23921245567848",1,"shortDiv"],["d","M 25.045687973567823,102.61746225268756 L 19.049343011453246,102.82685923290256",1,"shortDiv"],["d","M 25.011422863270653,101.30893048279626 L 19.012336692332312,101.41364492141996",1,"shortDiv"],["d","M 33.480673659187374,127.55320713028651 L 25.165757866585793,130.99735802157232",1,"shortDiv"],["d","M 30,100.00000000000001 L 19,100.00000000000001",1,"longDiv"],["d","M 25.011422863270653,98.69106951720377 L 19.012336692332312,98.58635507858007",1,"shortDiv"],["d","M 25.045687973567823,97.38253774731247 L 19.049343011453246,97.17314076709746",1,"shortDiv"],["d","M 25.102784893406962,96.07480328177921 L 19.111007684879525,95.76078754432154",1,"shortDiv"],["d","M 25.182696230513173,94.76826446919061 L 19.197311928954235,94.34972562672586",1,"shortDiv"],["d","M 25.285397643119083,93.46331929392566 L 19.308229454568604,92.94038483743971",1,"shortDiv"],["d","M 25.41085784737949,92.16036525492602 L 19.443726475169854,91.5331944753201",1,"shortDiv"],["d","M 25.559038626900858,90.85979924461392 L 19.60376171705292,90.12858318418304",1,"shortDiv"],["d","M 25.72989484438223,89.56201742799509 L 19.788286431932804,88.7269788222347",1,"shortDiv"],["d","M 25.923374455364666,88.2674151219827 L 19.997244411793844,87.32880833174131",1,"shortDiv"],["d","M 26.13941852408439,86.97638667498025 L 20.230572006011144,85.93449760897867",1,"shortDiv"],["d","M 26.377961241425197,85.68932534675918 L 20.488198140739215,84.54447137449992",1,"shortDiv"],["d","M 26.638929944964588,84.40662318866805 L 20.770044340561753,83.15915304376148",1,"shortDiv"],["d","M 26.922245141107354,83.12867092421013 L 21.076024752395952,81.77896459814694",1,"shortDiv"],["d","M 27.22782052930026,81.85585783002495 L 21.406046171644277,80.40432645642693",1,"shortDiv"],["d","M 27.555563028319867,80.58857161731098 L 21.760008070585457,79.03565734669586",1,"shortDiv"],["d","M 27.905372804626097,79.32719831372505 L 22.137802628996184,77.67337417882305",1,"shortDiv"],["d","M 28.277143302772345,78.07212214579475 L 22.539314766994124,76.31789191745833",1,"shortDiv"],["d","M 28.670761277863477,76.82372542187896 L 22.964422180092555,74.96962345562928",1,"shortDiv"],["d","M 29.08610683005122,75.58238841571327 L 23.412995376455328,73.62897948897034",1,"shortDiv"],["d","M 29.52305344105686,74.34848925057489 L 23.884897716341413,72.29636839062088",1,"shortDiv"],["d","M 29.98146801270987,73.12240378410247 L 24.37998545372666,70.97219608683068",1,"shortDiv"],["d","M 30.461210907490937,71.9045054938066 L 24.898107780090214,69.65686593331114",1,"shortDiv"],["d","M 30.96213599106696,70.69516536330448 L 25.43910687035232,68.35077859236884",1,"shortDiv"],["d","M 31.484090676804925,69.49475176931502 L 26.002817930949305,67.05433191086021",1,"shortDiv"],["d","M 32.02691597225126,68.30363036944753 L 26.589069250031358,65.76792079900333",1,"shortDiv"],["d","M 32.59044652756248,67.12216399081919 L 27.197682249767468,64.49193711008473",1,"shortDiv"],["d","M 33.174510685872406,65.950712519534 L 27.828471540742186,63.22676952109672",1,"shortDiv"],["d","M 33.77893053558047,64.78963279105821 L 28.4812449784269,61.97280341434288",1,"shortDiv"],["d","M 34.403521964545334,63.639278481524705 L 29.15580372170895,60.73042076004668",1,"shortDiv"],["d","M 35.0480947161671,62.49999999999999 L 29.851942293460468,59.49999999999999",1,"shortDiv"],["d","M 35.712452447341576,61.37214438174594 L 30.569448643128908,58.281915932285614",1,"shortDiv"],["d","M 36.396392788268045,60.25605518250965 L 31.308104211329493,57.07653959711042",1,"shortDiv"],["d","M 37.09970740409318,59.152072373873004 L 32.06768399642064,55.88423816378284",1,"shortDiv"],["d","M 37.82218205837188,58.06053223969398 L 32.847956623041625,54.705374818869494",1,"shortDiv"],["d","M 38.56359667832562,56.981767273671544 L 33.64868441259166,53.54030865556527",1,"shortDiv"],["d","M 39.32372542187893,55.91610607806453 L 34.46962345562925,52.3893945643097",1,"shortDiv"],["d","M 40.10233674645302,54.8638732635964 L 35.31052368616926,51.252983124684114",1,"shortDiv"],["d","M 40.89919347949582,53.82538935057566 L 36.17112895785549,50.131420498621715",1,"shortDiv"],["d","M 41.71405289072719,52.800970671262185 L 37.05117712198537,49.025048324963166",1,"shortDiv"],["d","M 42.54666676607664,51.790929273509555 L 37.950400107362775,47.934203615390324",1,"shortDiv"],["d","M 43.39678148329209,50.79557282571197 L 38.86852400195546,46.85921865176893",1,"shortDiv"],["d","M 44.264138089195406,49.81520452308567 L 39.80526913633104,45.80042088493252",1,"shortDiv"],["d","M 45.148472378562175,48.85012299531265 L 40.76035016884715,44.75813283493767",1,"shortDiv"],["d","M 46.049514974601166,47.900622215575204 L 41.73347617256926,43.732671992821224",1,"shortDiv"],["d","M 33.48067365918736,72.44679286971352 L 25.16575786658578,69.0026419784277",1,"shortDiv"],["d","M 50.502525316941664,50.502525316941686 L 42.724350723889636,42.724350723889664",1,"longDiv"],["d","M 47.90062221557518,46.04951497460119 L 43.732671992821196,41.73347617256928",1,"shortDiv"],["d","M 48.85012299531258,45.148472378562246 L 44.75813283493759,40.76035016884723",1,"shortDiv"],["d","M 49.81520452308564,44.264138089195434 L 45.80042088493249,39.80526913633106",1,"shortDiv"],["d","M 50.79557282571194,43.39678148329211 L 46.8592186517689,38.86852400195548",1,"shortDiv"],["d","M 51.79092927350953,42.546666766076655 L 47.934203615390295,37.95040010736279",1,"shortDiv"],["d","M 52.800970671262164,41.71405289072722 L 49.02504832496314,37.05117712198539",1,"shortDiv"],["d","M 53.825389350575634,40.89919347949585 L 50.13142049862169,36.171128957855515",1,"shortDiv"],["d","M 54.86387326359638,40.10233674645304 L 51.25298312468409,35.310523686169276",1,"shortDiv"],["d","M 55.9161060780645,39.323725421878954 L 52.389394564309654,34.469623455629275",1,"shortDiv"],["d","M 56.981767273671515,38.56359667832563 L 53.540308655565234,33.64868441259168",1,"shortDiv"],["d","M 58.06053223969395,37.822182058371894 L 54.705374818869466,32.84795662304164",1,"shortDiv"],["d","M 59.152072373872976,37.099707404093195 L 55.88423816378282,32.067683996420655",1,"shortDiv"],["d","M 60.25605518250963,36.39639278826806 L 57.0765395971104,31.308104211329507",1,"shortDiv"],["d","M 61.37214438174591,35.71245244734159 L 58.281915932285585,30.569448643128922",1,"shortDiv"],["d","M 62.499999999999964,35.04809471616713 L 59.499999999999964,29.851942293460496",1,"shortDiv"],["d","M 63.639278481524734,34.403521964545305 L 60.73042076004671,29.155803721708935",1,"shortDiv"],["d","M 64.78963279105818,33.77893053558047 L 61.97280341434284,28.481244978426915",1,"shortDiv"],["d","M 65.95071251953398,33.17451068587242 L 63.22676952109669,27.828471540742214",1,"shortDiv"],["d","M 67.12216399081916,32.59044652756249 L 64.4919371100847,27.19768224976748",1,"shortDiv"],["d","M 68.3036303694475,32.026915972251274 L 65.76792079900329,26.589069250031372",1,"shortDiv"],["d","M 69.49475176931499,31.484090676804925 L 67.05433191086018,26.00281793094932",1,"shortDiv"],["d","M 70.69516536330445,30.962135991066987 L 68.35077859236881,25.439106870352333",1,"shortDiv"],["d","M 71.90450549380657,30.46121090749095 L 69.6568659333111,24.89810778009023",1,"shortDiv"],["d","M 73.12240378410245,29.981468012709882 L 70.97219608683064,24.37998545372666",1,"shortDiv"],["d","M 74.34848925057486,29.523053441056874 L 72.29636839062084,23.884897716341413",1,"shortDiv"],["d","M 75.58238841571324,29.086106830051236 L 73.62897948897032,23.412995376455342",1,"shortDiv"],["d","M 76.82372542187893,28.67076127786349 L 74.96962345562925,22.96442218009257",1,"shortDiv"],["d","M 78.07212214579471,28.277143302772345 L 76.3178919174583,22.53931476699414",1,"shortDiv"],["d","M 79.32719831372502,27.905372804626097 L 77.67337417882302,22.137802628996184",1,"shortDiv"],["d","M 80.58857161731095,27.55556302831988 L 79.03565734669583,21.76000807058547",1,"shortDiv"],["d","M 81.85585783002492,27.22782052930026 L 80.4043264564269,21.40604617164429",1,"shortDiv"],["d","M 83.1286709242101,26.922245141107368 L 81.7789645981469,21.076024752395952",1,"shortDiv"],["d","M 84.40662318866801,26.638929944964588 L 83.15915304376145,20.770044340561753",1,"shortDiv"],["d","M 85.68932534675915,26.377961241425197 L 84.54447137449988,20.488198140739215",1,"shortDiv"],["d","M 86.97638667498022,26.139418524084405 L 85.93449760897863,20.230572006011144",1,"shortDiv"],["d","M 88.26741512198267,25.92337445536468 L 87.32880833174129,19.997244411793844",1,"shortDiv"],["d","M 89.56201742799506,25.72989484438223 L 88.72697882223466,19.788286431932804",1,"shortDiv"],["d","M 90.8597992446139,25.559038626900858 L 90.128583184183,19.60376171705292",1,"shortDiv"],["d","M 92.16036525492599,25.410857847379503 L 91.53319447532007,19.443726475169868",1,"shortDiv"],["d","M 93.46331929392562,25.285397643119083 L 92.94038483743968,19.308229454568604",1,"shortDiv"],["d","M 94.76826446919058,25.182696230513187 L 94.34972562672583,19.197311928954235",1,"shortDiv"],["d","M 96.07480328177917,25.102784893406962 L 95.7607875443215,19.111007684879525",1,"shortDiv"],["d","M 97.38253774731244,25.045687973567823 L 97.17314076709744,19.049343011453246",1,"shortDiv"],["d","M 98.69106951720373,25.011422863270653 L 98.58635507858003,19.012336692332312",1,"shortDiv"],["d","M 72.44679286971349,33.480673659187374 L 69.00264197842768,25.165757866585793",1,"shortDiv"],["d","M 99.99999999999999,30 L 99.99999999999999,19",1,"longDiv"],["x","100","y","40","id","pcN",1,"scale"],["x","100","y","40","id","pcE","transform","rotate(90,100,100)",1,"scale"],["x","100","y","40","id","pcS","transform","rotate(180,100,100)",1,"scale"],["x","100","y","40","id","pcW","transform","rotate(270,100,100)",1,"scale"],["x","100","y","40","id","pcNE","transform","rotate(45,100,100)",1,"scale"],["x","100","y","40","id","pcSE","transform","rotate(135,100,100)",1,"scale"],["x","100","y","40","id","pcSW","transform","rotate(225,100,100)",1,"scale"],["x","100","y","40","id","pcNW","transform","rotate(315,100,100)",1,"scale"],[1,"compass_nup",2,"z-index","1000"],["x","100","y","95","id","headingtext",1,"value"],["x","100","y","115","id","speedtext",1,"value"],["x","100","y","130","id","labeltext",1,"label"],["id","gLoPointer",1,"compass_nup",3,"ngClass"],["transform","rotate(0 100 100)","id","needlelo"],["d","M 100,79 l 5,-69 -10,0 5,69 z","id","loPointer"],["id","gHiPointer",1,"compass_nup",3,"ngClass"],["transform","rotate(0 100 100)","id","needlehi"],["d","M 100,79 l 5,-69 -10,0 5,69 z","id","hiPointer"],["id","pointer",1,"compass_nup",3,"ngClass"],["transform","rotate(0 100 100)","id","needle"],["d","M 95,70 l 5,-30 5,30 -10,0 z","id","pointerShaftInner"]],template:function(t,i){t&1&&(Eo(),u(0,"svg",7)(1,"defs")(2,"filter",8),z(3,"feGaussianBlur",9),h(),u(4,"filter",10),z(5,"feGaussianBlur",11),h()(),u(6,"style",12),_(7," .hide { display:none; } text { font-style:normal; font-variant:normal; font-weight:normal; font-stretch:normal; font-family:Arial; text-align:center; text-anchor:middle; stroke:none; fill-opacity:1; } .compass_nup text.label { /** label **/ font-size:12px; fill: black; } .compass_nup text.value, .compass_nup text.unit { /** units **/ font-size:12px; font-weight: bold; fill: black; fill-opacity:0.9; } .compass_nup text.value { /** Heading Value **/ font-size:20px; } .compass_nup text.cardinal_point { /** scale 12,3,6,9 oclock positions **/ font-size:20px; font-weight: bold; fill: black; } .compass_nup text.intermediate_point { /** scale remainder **/ font-size:16px; fill: black; font-weight: bold; } .compass_nup text.scale { font-size: 12px; font-weight: bold; fill: black; } .compass_nup path.shortDiv { fill:none; fill-rule:evenodd; stroke: gray; stroke-width:0.5; stroke-linecap:butt; stroke-linejoin:miter; stroke-miterlimit:4; stroke-dasharray:none; stroke-opacity:1; } .compass_nup path.longDiv { fill:none; fill-rule:evenodd; stroke: black; stroke-width:2; stroke-linecap:butt; stroke-linejoin:miter; stroke-miterlimit:4; stroke-dasharray:none; stroke-opacity:1; } rect.compass_nup.bgRect { fill:transparent; stroke: none; } .compass_nup .bgDial { fill: lightgray; stroke: black; stroke-width: 2px; } .compass_nup #pointerShaftInner { fill: #9d4626; stroke: #9d4626; stroke-width: 0.3; stroke-opacity: 1; display: block; } .compass_nup #hiPointer { fill:olive; fill-opacity:1; display: block; } .compass_nup #loPointer { fill: rgb(16, 75, 16); fill-opacity:1; display: block; } .dark-theme { .compass_nup text.label { /** label **/ fill: #dcff85; } .compass_nup text.value, .compass_nup text.unit { /** units **/ fill: #00ff00; } .compass_nup .bgDial { fill: transparent; stroke: #deff8b; } .compass_nup text.scale { fill: #dcff85; } .compass_nup text.cardinal_point { /** scale 12,3,6,9 oclock positions **/ fill: #dcff85; } .compass_nup text.intermediate_point { /** scale remainder **/ fill: #dcff85; } .compass_nup path.shortDiv { stroke: red; } .compass_nup path.longDiv { stroke: #dcff85; } } "),h(),z(8,"rect",13),u(9,"g",14),z(10,"circle",15),h(),u(11,"g",16,0),z(13,"path",17)(14,"path",18)(15,"path",19)(16,"path",20)(17,"path",21)(18,"path",22)(19,"path",23)(20,"path",24)(21,"path",25)(22,"path",26)(23,"path",27)(24,"path",28)(25,"path",29)(26,"path",30)(27,"path",31)(28,"path",32)(29,"path",33)(30,"path",34)(31,"path",35)(32,"path",36)(33,"path",37)(34,"path",38)(35,"path",39)(36,"path",40)(37,"path",41)(38,"path",42)(39,"path",43)(40,"path",44)(41,"path",45)(42,"path",46)(43,"path",47)(44,"path",48)(45,"path",49)(46,"path",50)(47,"path",51)(48,"path",52)(49,"path",53)(50,"path",54)(51,"path",55)(52,"path",56)(53,"path",57)(54,"path",58)(55,"path",59)(56,"path",60)(57,"path",61)(58,"path",62)(59,"path",63)(60,"path",64)(61,"path",65)(62,"path",66)(63,"path",67)(64,"path",68)(65,"path",69)(66,"path",70)(67,"path",71)(68,"path",72)(69,"path",73)(70,"path",74)(71,"path",75)(72,"path",76)(73,"path",77)(74,"path",78)(75,"path",79)(76,"path",80)(77,"path",81)(78,"path",82)(79,"path",83)(80,"path",84)(81,"path",85)(82,"path",86)(83,"path",87)(84,"path",88)(85,"path",89)(86,"path",90)(87,"path",91)(88,"path",92)(89,"path",93)(90,"path",94)(91,"path",95)(92,"path",96)(93,"path",97)(94,"path",98)(95,"path",99)(96,"path",100)(97,"path",101)(98,"path",102)(99,"path",103)(100,"path",104)(101,"path",105)(102,"path",106)(103,"path",107)(104,"path",108)(105,"path",109)(106,"path",110)(107,"path",111)(108,"path",112)(109,"path",113)(110,"path",114)(111,"path",115)(112,"path",116)(113,"path",117)(114,"path",118)(115,"path",119)(116,"path",120)(117,"path",121)(118,"path",122)(119,"path",123)(120,"path",124)(121,"path",125)(122,"path",126)(123,"path",127)(124,"path",128)(125,"path",129)(126,"path",130)(127,"path",131)(128,"path",132)(129,"path",133)(130,"path",134)(131,"path",135)(132,"path",136)(133,"path",137)(134,"path",138)(135,"path",139)(136,"path",140)(137,"path",141)(138,"path",142)(139,"path",143)(140,"path",144)(141,"path",145)(142,"path",146)(143,"path",147)(144,"path",148)(145,"path",149)(146,"path",150)(147,"path",151)(148,"path",152)(149,"path",153)(150,"path",154)(151,"path",155)(152,"path",156)(153,"path",157)(154,"path",158)(155,"path",159)(156,"path",160)(157,"path",161)(158,"path",162)(159,"path",163)(160,"path",164)(161,"path",165)(162,"path",166)(163,"path",167)(164,"path",168)(165,"path",169)(166,"path",170)(167,"path",171)(168,"path",172)(169,"path",173)(170,"path",174)(171,"path",175)(172,"path",176)(173,"path",177)(174,"path",178)(175,"path",179)(176,"path",180)(177,"path",181)(178,"path",182)(179,"path",183)(180,"path",184)(181,"path",185)(182,"path",186)(183,"path",187)(184,"path",188)(185,"path",189)(186,"path",190)(187,"path",191)(188,"path",192)(189,"path",193)(190,"path",194)(191,"path",195)(192,"path",196)(193,"path",197)(194,"path",198)(195,"path",199)(196,"path",200)(197,"path",201)(198,"path",202)(199,"path",203)(200,"path",204)(201,"path",205)(202,"path",206)(203,"path",207)(204,"path",208)(205,"path",209)(206,"path",210)(207,"path",211)(208,"path",212)(209,"path",213)(210,"path",214)(211,"path",215)(212,"path",216)(213,"path",217)(214,"path",218)(215,"path",219)(216,"path",220)(217,"path",221)(218,"path",222)(219,"path",223)(220,"path",224)(221,"path",225)(222,"path",226)(223,"path",227)(224,"path",228)(225,"path",229)(226,"path",230)(227,"path",231)(228,"path",232)(229,"path",233)(230,"path",234)(231,"path",235)(232,"path",236)(233,"path",237)(234,"path",238)(235,"path",239)(236,"path",240)(237,"path",241)(238,"path",242)(239,"path",243)(240,"path",244)(241,"path",245)(242,"path",246)(243,"path",247)(244,"path",248)(245,"path",249)(246,"path",250)(247,"path",251)(248,"path",252)(249,"path",253)(250,"path",254)(251,"path",255)(252,"path",256)(253,"path",257)(254,"path",258)(255,"path",259)(256,"path",260)(257,"path",261)(258,"path",262)(259,"path",263)(260,"path",264)(261,"path",265)(262,"path",266)(263,"path",267)(264,"path",268)(265,"path",269)(266,"path",270)(267,"path",271)(268,"path",272),z(269,"path",273)(270,"path",274)(271,"path",275)(272,"path",276)(273,"path",277)(274,"path",278)(275,"path",279)(276,"path",280)(277,"path",281)(278,"path",282)(279,"path",283)(280,"path",284)(281,"path",285)(282,"path",286)(283,"path",287)(284,"path",288)(285,"path",289)(286,"path",290)(287,"path",291)(288,"path",292)(289,"path",293)(290,"path",294)(291,"path",295)(292,"path",296)(293,"path",297)(294,"path",298)(295,"path",299)(296,"path",300)(297,"path",301)(298,"path",302)(299,"path",303)(300,"path",304)(301,"path",305)(302,"path",306)(303,"path",307)(304,"path",308)(305,"path",309)(306,"path",310)(307,"path",311)(308,"path",312)(309,"path",313)(310,"path",314)(311,"path",315)(312,"path",316)(313,"path",317)(314,"path",318)(315,"path",319)(316,"path",320)(317,"path",321)(318,"path",322)(319,"path",323)(320,"path",324)(321,"path",325)(322,"path",326)(323,"path",327)(324,"path",328)(325,"path",329)(326,"path",330)(327,"path",331)(328,"path",332)(329,"path",333)(330,"path",334)(331,"path",335)(332,"path",336)(333,"path",337)(334,"path",338)(335,"path",339)(336,"path",340)(337,"path",341)(338,"path",342)(339,"path",343)(340,"path",344)(341,"path",345)(342,"path",346)(343,"path",347)(344,"path",348)(345,"path",349)(346,"path",350)(347,"path",351)(348,"path",352)(349,"path",353)(350,"path",354)(351,"path",355)(352,"path",356)(353,"path",357)(354,"path",358)(355,"path",359)(356,"path",360)(357,"path",361)(358,"path",362)(359,"path",363)(360,"path",364)(361,"path",365)(362,"path",366)(363,"path",367)(364,"path",368)(365,"path",369)(366,"path",370)(367,"path",371)(368,"path",372)(369,"path",373)(370,"path",374)(371,"path",375)(372,"path",376)(373,"path",377)(374,"path",378)(375,"path",379)(376,"path",380)(377,"path",381)(378,"path",382)(379,"path",383)(380,"path",384)(381,"path",385)(382,"path",386)(383,"path",387)(384,"path",388)(385,"path",389),u(386,"text",390),_(387,"N"),h(),u(388,"text",391),_(389,"E"),h(),u(390,"text",392),_(391,"S"),h(),u(392,"text",393),_(393,"W"),h(),u(394,"text",394),_(395,"NE"),h(),u(396,"text",395),_(397,"SE"),h(),u(398,"text",396),_(399,"SW"),h(),u(400,"text",397),_(401,"NW"),h()(),u(402,"g",398)(403,"text",399,1),_(405,"0\xBA"),h(),u(406,"text",400,2),_(408,"0"),h(),u(409,"text",401,3),_(411,"Heading"),h()(),u(412,"g",402)(413,"g",403,4),z(415,"path",404),h()(),u(416,"g",405)(417,"g",406,5),z(419,"path",407),h()(),u(420,"g",408,6)(422,"g",409),z(423,"path",410),h()()()),t&2&&(f(412),w("ngClass",Gi(3,mg,!i.showWindApparent)),f(4),w("ngClass",Gi(5,mg,!i.showWindTrue)),f(4),w("ngClass",Gi(7,mg,!i.showPointer)))},dependencies:[mn,Rn],encapsulation:2,changeDetection:0})};function ikt(n,e,t={}){switch(n){case"7d":case"30d":case"all":return iy(n,e);case"history":return t.history??null;case"custom":return t1e(t.custom)?t.custom:null;default:return null}}function t1e(n){return!!n&&Number.isFinite(n.from)&&Number.isFinite(n.to)&&n.from<n.to}function nkt(n,e,t){return hh(st(ne({context:n},ny(e)),{times:"true",provider:t}))}var _j=n=>`${n[0]},${n[1]}`;function yj(n,e){let t=new Map;return e?.lines.forEach((i,r)=>i.forEach((o,a)=>{let s=e.times[r]?.[a];if(s){let l=_j(o),c=t.get(l);c?c.times.push(s):t.set(l,{times:[s],next:0})}})),{lines:n,times:n.map(i=>i.map(r=>{let o=t.get(_j(r));return o?o.times[o.next++]:void 0}))}}function vj(n,e,t,i){if(!n)return i;let r=e??{lines:t,times:t.map(o=>o.map(()=>{}))};return ry(r,i)}function i1e(n){let e=n.lines.map((t,i)=>({line:t,times:n.times[i]??[]})).filter(t=>t.line.length>1);return{lines:e.map(t=>t.line),times:e.map(t=>t.times)}}function n1e(n){return Array.isArray(n)&&n.some(e=>e?.length>1)}function r1e(n){let e=1/0,t=-1/0;return n.forEach(i=>i.forEach(r=>{let o=r?Date.parse(r):NaN;Number.isFinite(o)&&(e=Math.min(e,o),t=Math.max(t,o))})),Number.isFinite(e)?{from:e,to:t}:void 0}var bw=n=>String(n).padStart(2,"0"),fg=n=>`${n.getFullYear()}-${bw(n.getMonth()+1)}-${bw(n.getDate())}`,g1=n=>`${bw(n.getHours())}:${bw(n.getMinutes())}`;function o1e(n){let e=new Date(n.from),t=new Date(n.to);return fg(e)===fg(t)?`${fg(e)} ${g1(e)}\u2013${g1(t)}`:`${fg(e)} ${g1(e)} \u2013 ${fg(t)} ${g1(t)}`}function a1e(n,e,t){let i=r1e(e);if(i)return`${n} ${o1e(i)}`;let r=new Date(t);return`${n} (exported ${fg(r)} ${g1(r)})`}function bj(n,e,t){return e&&t?`${e} (${t})`:e||t||n.split(":").pop()}function rkt(n,e,t){let i=i1e(e);if(i.lines.length!==0)return{name:a1e(n,i.times,t),lines:i.lines,times:i.times}}function xj(n){return n.showAll?n.zoom>=n.minZoom:n.picked}function Lk(n){return n.trackDisplayed&&n1e(n.lines)?"displayed":n.historyShown?"history":null}function okt(n,e){return{feature:{type:"Feature",id:n,geometry:{type:"MultiLineString",coordinates:e.lines},properties:{name:e.name,coordTimes:e.times}}}}var xw=class n{app=M(oe);dialog=M(ln);skres=M(Mt);exportResources(){return this.open({routes:this.skres.routes(),tracks:[this.ownTrail()]})}exportOwnTrail(e="displayed"){return this.open({routes:[],tracks:[this.ownTrail()],tracksOnly:!0,initialChoice:e})}exportVesselTrack(e,t="displayed"){let i=this.vesselTrack(e);return i?this.open({routes:[],tracks:[i],tracksOnly:!0,initialChoice:t}):Promise.resolve()}ownTrail(){let e=this.app.data.vessels.self?.name;return{context:"self",label:e?`${e} trail`:"Vessel trail",displayed:vj(this.app.selfTrailFromServer().length>0,this.app.selfTrailTimed(),this.app.selfTrailFromServer(),this.app.localTrailTimed())}}tailOnly(e){let t=this.app.trackSource();return!(t?.api==="v2"?this.app.aisTracksTimed().has(e):t?.api==="v1"&&t.v1AisTracks)}vesselTrack(e){let t=this.app.data.vessels.aisTargets.get(e),i=this.app.data.vessels.aisTracks.get(e)??t?.track;if(!t&&!i)return;let r=this.app.aisTracksTimed().get(e);return{context:e,label:bj(e,t?.name,t?.mmsi),displayed:yj(i??[],r),tailOnly:this.tailOnly(e)}}open(e){return Y(this,null,function*(){let{GPXExportDialog:t}=yield import("./chunk-RQKGK2KO.js");return new Promise(i=>this.dialog.open(t,{disableClose:!0,data:e}).afterClosed().subscribe(r=>{r===0?this.app.showMsgBox("GPX Save",e.tracksOnly?"Track saved to GPX file successfully.":"Resources saved to GPX file successfully."):r>0&&this.app.showAlert("GPX Save","Error saving resources to GPX file!"),i()}))})}static \u0275fac=function(t){return new(t||n)};static \u0275prov=Je({token:n,factory:n.\u0275fac,providedIn:"root"})};function s1e(n,e){if(n&1){let t=H();u(0,"button",18),T("click",function(){O(t);let r=v();return F(r.handleMarkPosition())}),u(1,"mat-icon"),_(2,"add_location"),h()()}}function l1e(n,e){if(n&1){let t=H();u(0,"button",22),T("click",function(){O(t);let r=v(2);return F(r.toggleBuddy())}),u(1,"mat-icon"),_(2),h()()}if(n&2){let t=v(2);f(2),X(t.vessel().buddy?"group_remove":"group_add")}}function c1e(n,e){if(n&1){let t=H();u(0,"button",19),T("click",function(){O(t);let r=v();return F(r.toggleFlag())}),u(1,"mat-icon"),_(2),h()(),R(3,l1e,3,1,"button",20),u(4,"button",21),T("click",function(){O(t);let r=v();return F(r.focusVessel(!0))}),u(5,"mat-icon"),_(6,"center_focus_weak"),h()()}if(n&2){let t=v();w("matTooltip",t.isFlagged?"Un-flag vessel":"Flag vessel"),f(2),X(t.isFlagged?"clear_all":"flag"),f(),A(!t.isSelf()&&t.app.featureFlags().buddyList?3:-1)}}function d1e(n,e){if(n&1){let t=H();u(0,"button",23),T("click",function(){O(t);let r=v();return F(r.focusVessel(!1))}),u(1,"mat-icon"),_(2,"clear_all"),h()()}}function u1e(n,e){if(n&1){let t=H();u(0,"span",5)(1,"button",24),T("click",function(){O(t);let r=v();return F(r.toggleTrack())}),u(2,"mat-icon"),_(3),h()()()}if(n&2){let t=v(),i=t.app.isVesselTrackShown(t.vessel().id);w("matTooltip",t.app.config.vessels.aisShowTrack?'Turn off "Show all tracks" to enable':i?"Hide vessel track":"Show vessel track"),f(),w("disabled",t.app.config.vessels.aisShowTrack),f(2),X(i?"layers_clear":"route")}}function p1e(n,e){if(n&1){let t=H();As(0),u(1,"span",5)(2,"button",24),T("click",function(){O(t);let r=pa(0),o=v();return F(o.toggleHistory(r))}),u(3,"mat-icon"),_(4),h()()()}if(n&2){let t=v(),i=Ls(t.historyContext()),r=t.trackHistory.isShown(i),o=t.trackHistory.hasHistory(i)===!1;f(),w("matTooltip",r?"Hide track history":o?"No recorded track history":"Show track history"),f(),w("disabled",o&&!r),f(2),X(r?"history_toggle_off":"history")}}function h1e(n,e){if(n&1){let t=H();u(0,"button",19),T("click",function(){O(t);let r=v(),o=pa(8);return F(r.exportTrack(o))}),u(1,"mat-icon"),_(2,"download"),h()()}if(n&2){let t=v();w("matTooltip",t.isSelf()||!t.gpxExport.tailOnly(t.vessel().id)?"Export track to GPX":"Export track to GPX (only the positions gathered while Freeboard was open)")}}function m1e(n,e){if(n&1&&(u(0,"div",1)(1,"div",9),_(2,"Callsign (VHF):"),h(),z(3,"div",10),h()),n&2){let t=v();f(3),w("innerText",t.vessel().callsignVhf)}}function f1e(n,e){if(n&1&&(u(0,"div",1)(1,"div",9),_(2,"Callsign (HF):"),h(),z(3,"div",10),h()),n&2){let t=v();f(3),w("innerText",t.vessel().callsignHf)}}function g1e(n,e){if(n&1&&(u(0,"div",1)(1,"div",9),_(2,"Range:"),h(),u(3,"div",11),_(4),h()()),n&2){let t=v(2);f(4),K(" ",t.distToSelf," ")}}function _1e(n,e){if(n&1&&(u(0,"div",1)(1,"div",9),_(2,"CPA:"),h(),u(3,"div",11),_(4),h()(),u(5,"div",1)(6,"div",9),_(7,"TCPA:"),h(),u(8,"div",11),_(9),h()()),n&2){let t=v(2);f(4),K(" ",t.cpa??"--"," "),f(5),K(" ",t.tcpa??"--"," ")}}function y1e(n,e){if(n&1&&(R(0,g1e,5,1,"div",1),R(1,_1e,10,2)),n&2){let t=v();A(t.vessel().distanceToSelf?0:-1),f(),A(t.vessel().closestApproach?1:-1)}}var Cw=class n{title=Z();vessel=Z();useMagnetic=Z();isActive=Z();isSelf=Z();canClose=Z();info=xe();closed=xe();focused=xe();markPosition=xe();_title;_icon;convert=Ue;timeLastUpdate;timeAgo;speedUnits;distToSelf;cpa;tcpa;position=[0,0];positionTimestamp="";isFlagged=!1;app=M(oe);buddies=M(mw);trackHistory=M(Uu);gpxExport=M(xw);destroyRef=M(gi);historyContext(){return this.isSelf()?"self":this.vessel().id}windSpeed(e,t){return Number.isFinite(e)?this.app.formatValueForDisplay(e,"m/s",{path:t}):"--"}constructor(){this.trackHistory.refreshRecorded(),Me(()=>{if(!this.vessel()){this.handleClose();return}if(this.isFlagged=this.app.data.vessels.flagged.includes(this.vessel().id),this._title=this.title()??this.vessel().name??this.vessel().mmsi??this.vessel().callsignVhf??this.vessel().callsignHf??"Vessel:",this._icon=this.vessel().type?.id?xa(this.vessel().type?.id):{name:"directions_boat",svgIcon:void 0},this.position=[this.vessel().position[0],this.vessel().position[1]],this.position=ri.normaliseCoords(this.position),this.vessel().positionTimestamp){let t=new Date(this.vessel().positionTimestamp);this.positionTimestamp=`${t.getHours()}:${("00"+t.getMinutes()).slice(-2)}`}this.timeLastUpdate=`${this.vessel().lastUpdated.getHours()}:${("00"+this.vessel().lastUpdated.getMinutes()).slice(-2)}`;let e=(new Date().valueOf()-this.vessel().lastUpdated.valueOf())/1e3;this.timeAgo=e<60?"":`(${Math.floor(e/60)} min ago)`,this.distToSelf=this.app.formatValueForDisplay(this.vessel().distanceToSelf,"m"),this.vessel().closestApproach&&(typeof this.vessel().closestApproach.distance=="number"&&(this.cpa=this.app.formatValueForDisplay(this.vessel().closestApproach.distance,"m")),typeof this.vessel().closestApproach.timeTo=="number"&&(this.tcpa=this.app.formatValueForDisplay(this.vessel().closestApproach.timeTo,"s")))})}ngOnInit(){if(!this.vessel()){this.handleClose();return}this.isFlagged=this.app.data.vessels.flagged.includes(this.vessel().id)}handleMarkPosition(){this.markPosition.emit(this.vessel().position)}handleInfo(){this.info.emit(this.vessel().id)}focusVessel(e){this.removeFlag(),this.focused.emit(e)}toggleBuddy(){let e=this.vessel().id.split(".").slice(1).join(".");if(this.vessel().buddy)this.buddies.remove(e).pipe(Zt(this.destroyRef)).subscribe(()=>{this.app.showMessage("Buddy successfully removed.",!1,3e3)},()=>{this.app.showMessage("Error removing buddy!",!1,3e3)});else{let t=this.vessel().name??this.vessel().mmsi??this.vessel().callsignVhf??e.slice(-5);this.buddies.add(e,t).pipe(Zt(this.destroyRef)).subscribe(()=>{this.app.showMessage(`Buddy added (${t})`,!1,3e3)},()=>{this.app.showMessage(`Error adding buddy!(${t})`,!1,5e3)})}}toggleTrack(){this.app.toggleVesselTrack(this.vessel().id)}trackExportOffer(){if(this.isSelf())return Lk({trackDisplayed:this.app.config.vessels.trail,lines:this.gpxExport.ownTrail().displayed.lines,historyShown:this.trackHistory.available()&&this.trackHistory.isShown("self")});let e=this.vessel().id;return Lk({trackDisplayed:xj({showAll:this.app.config.vessels.aisShowTrack,picked:this.app.isVesselTrackShown(e),zoom:this.app.mapZoom(),minZoom:Y1}),lines:this.app.data.vessels.aisTracks.get(e),historyShown:this.trackHistory.available()&&this.trackHistory.isShown(e)})}exportTrack(e){this.isSelf()?this.gpxExport.exportOwnTrail(e):this.gpxExport.exportVesselTrack(this.vessel().id,e)}toggleHistory(e){let t=!this.trackHistory.isShown(e);this.trackHistory.toggle(e),t&&this.handleClose()}toggleFlag(){this.isFlagged?this.removeFlag():this.app.data.vessels.flagged.includes(this.vessel().id)||(this.app.data.vessels.flagged=[this.vessel().id].concat(this.app.data.vessels.flagged)),this.isFlagged=!this.isFlagged,this.closed.emit()}removeFlag(){this.app.data.vessels.flagged.includes(this.vessel().id)&&(this.app.data.vessels.flagged.splice(this.app.data.vessels.flagged.indexOf(this.vessel().id),1),this.app.data.vessels.flagged=[].concat(this.app.data.vessels.flagged))}handleClose(){this.closed.emit()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["vessel-popover"]],inputs:{title:[1,"title"],vessel:[1,"vessel"],useMagnetic:[1,"useMagnetic"],isActive:[1,"isActive"],isSelf:[1,"isSelf"],canClose:[1,"canClose"]},outputs:{info:"info",closed:"closed",focused:"focused",markPosition:"markPosition"},decls:56,vars:32,consts:[[3,"closed","title","mmsi","icon","canClose"],[2,"display","flex"],[2,"flex","1 1 auto"],["mat-icon-button","","matTooltip","Add Waypoint at vessel location"],["mat-icon-button","","matTooltip","Clear vessel focus"],[3,"matTooltip"],["mat-icon-button","",3,"matTooltip"],[2,"text-align","right"],["mat-icon-button","","matTooltip","Show Properties",3,"click"],[2,"font-weight","bold"],[2,"flex","1 1 auto","text-align","right",3,"innerText"],[2,"flex","1 1 auto","text-align","right"],[2,"display","flex","flex-wrap","no-wrap"],[2,"width","120px"],[3,"heading","windtrue","windapparent","speed","speedunits"],[2,"text-align","right","flex","auto"],[2,"border-right","olive 10px solid","padding-left","5px"],[2,"border-right","rgb(16, 75, 16) 10px solid",";padding-left","5px"],["mat-icon-button","","matTooltip","Add Waypoint at vessel location",3,"click"],["mat-icon-button","",3,"click","matTooltip"],["mat-icon-button","","matTooltip","Is Buddy"],["mat-icon-button","","matTooltip","Focus vessel",3,"click"],["mat-icon-button","","matTooltip","Is Buddy",3,"click"],["mat-icon-button","","matTooltip","Clear vessel focus",3,"click"],["mat-icon-button","",3,"click","disabled"]],template:function(t,i){if(t&1&&(u(0,"ap-popover",0),T("closed",function(){return i.handleClose()}),u(1,"div",1)(2,"div",2),R(3,s1e,3,0,"button",3)(4,c1e,7,3),R(5,d1e,3,0,"button",4),R(6,u1e,4,3,"span",5),R(7,p1e,5,4,"span",5),As(8),R(9,h1e,3,1,"button",6),h(),u(10,"div",7)(11,"button",8),T("click",function(){return i.handleInfo()}),u(12,"mat-icon"),_(13,"info_outline"),h()()()(),z(14,"mat-divider"),R(15,m1e,4,1,"div",1)(16,f1e,4,1,"div",1),u(17,"div",1)(18,"div",9),_(19,"Latitude:"),h(),z(20,"div",10),bt(21,"coords"),h(),u(22,"div",1)(23,"div",9),_(24,"Longitude:"),h(),z(25,"div",10),bt(26,"coords"),h(),u(27,"div",1)(28,"div",9),_(29,"Last Position:"),h(),u(30,"div",11),_(31),h()(),R(32,y1e,2,2),u(33,"div",1)(34,"div",9),_(35,"Last Update:"),h(),u(36,"div",11),_(37),h()(),u(38,"div",12)(39,"div",13),z(40,"ap-compass",14),h(),u(41,"div",15),_(42," \xA0"),z(43,"br"),u(44,"div")(45,"div",16)(46,"span",9),_(47),h()(),u(48,"div",11),_(49),h()(),u(50,"div")(51,"div",17)(52,"span",9),_(53," Wind (A):"),h()(),u(54,"div",11),_(55),h()()()()()),t&2){w("title",i._title)("mmsi",i.vessel().mmsi)("icon",i._icon)("canClose",i.canClose()),f(3),A(i.isActive()?3:4),f(2),A(i.isActive()&&!i.isSelf()?5:-1),f(),A(i.isSelf()?-1:6),f(),A(i.trackHistory.available()?7:-1),f();let r=Ls(i.trackExportOffer());f(),A(r?9:-1),f(6),A(i.vessel().callsignVhf?15:i.vessel().callsignHf?16:-1),f(5),w("innerText",Mi(21,25,i.position[1],i.app.config.units.positionFormat,!0)),f(5),w("innerText",$n(26,29,i.position[0],i.app.config.units.positionFormat)),f(6),K(" ",i.positionTimestamp," "),f(),A(i.isSelf()?-1:32),f(5),Nr(" ",i.timeLastUpdate," ",i.timeAgo," "),f(3),w("heading",i.convert.radiansToDegrees(i.vessel().orientation))("windtrue",i.vessel().wind.direction!==null?i.convert.radiansToDegrees(i.vessel().wind.direction):null)("windapparent",i.vessel().wind.awa!==null?i.convert.radiansToDegrees(i.vessel().wind.awa):null)("speed",i.app.formatSpeed(i.vessel().sog))("speedunits",i.app.formattedSpeedUnits),f(7),K(" Wind (",i.useMagnetic()?"M":"T","):"),f(2),K(" ",i.windSpeed(i.vessel().wind.tws,i.app.twsDisplayUnitPath())," "),f(6),K(" ",i.windSpeed(i.vessel().wind.aws,"environment.wind.speedApparent")," ")}},dependencies:[ue,Fe,ye,Te,se,ce,Pa,jn,yw,Qi],encapsulation:2,changeDetection:0})};var v1e=n=>({"icon-warn":n});function b1e(n,e){if(n&1&&z(0,"mat-icon",4),n&2){let t=v().$implicit;Et(t.icon.class),w("svgIcon",t.icon.svgIcon)}}function x1e(n,e){if(n&1&&(u(0,"mat-icon",5),_(1),h()),n&2){let t=v().$implicit;Et(t.icon.class),w("ngClass",Gi(4,v1e,t.text&&t.text.indexOf("self")!==-1)),f(),K(" ",t.icon.name," ")}}function C1e(n,e){if(n&1){let t=H();u(0,"mat-list-item",1),T("click",function(){let r=O(t).$implicit,o=v();return F(o.handleSelect(r))}),R(1,b1e,1,3,"mat-icon",2)(2,x1e,2,6,"mat-icon",3),_(3),h()}if(n&2){let t=e.$implicit;f(),A(t.icon.svgIcon?1:2),f(2),K(" ",t.text," ")}}var ww=class n{title=Z();features=Z([]);canClose=Z();closed=xe();selected=xe();handleSelect(e){this.selected.emit(e)}handleClose(){this.closed.emit()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["feature-list-popover"]],inputs:{title:[1,"title"],features:[1,"features"],canClose:[1,"canClose"]},outputs:{closed:"closed",selected:"selected"},decls:4,vars:2,consts:[[3,"closed","title","canClose"],[3,"click"],[3,"svgIcon","class"],[3,"class","ngClass"],[3,"svgIcon"],[3,"ngClass"]],template:function(t,i){t&1&&(u(0,"ap-popover",0),T("closed",function(){return i.handleClose()}),u(1,"mat-nav-list"),Ae(2,C1e,4,2,"mat-list-item",null,wt),h()()),t&2&&(w("title",i.title())("canClose",i.canClose()),f(2),Le(i.features()))},dependencies:[mn,Rn,An,Vs,mo,ue,ye,se,ce,jn],encapsulation:2,changeDetection:0})};var w1e=()=>({name:"map"});function M1e(n,e){if(n&1){let t=H();u(0,"mat-list-item",1),T("click",function(){let r=O(t).$implicit,o=v();return F(o.handleSelect(r.id))}),u(1,"mat-icon"),_(2,"map"),h(),_(3),h()}if(n&2){let t=e.$implicit;f(3),K(" ",t.text," ")}}var Mw=class n{features=Z([]);canClose=Z();closed=xe();selected=xe();title="Click to Show / Hide Chart";handleSelect(e){this.selected.emit(e)}handleClose(){this.closed.emit()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["chart-list-popover"]],inputs:{features:[1,"features"],canClose:[1,"canClose"]},outputs:{closed:"closed",selected:"selected"},decls:4,vars:4,consts:[[3,"closed","title","canClose","icon"],[3,"click"]],template:function(t,i){t&1&&(u(0,"ap-popover",0),T("closed",function(){return i.handleClose()}),u(1,"mat-nav-list"),Ae(2,M1e,4,1,"mat-list-item",null,wt),h()()),t&2&&(w("title",i.title)("canClose",i.canClose())("icon",kr(3,w1e)),f(2),Le(i.features()))},dependencies:[An,Vs,mo,ue,ye,se,ce,jn],encapsulation:2,changeDetection:0})};var Sw=class n{title;aircraft;canClose;info=new me;closed=new me;_title;timeLastUpdate;timeAgo;app=M(oe);constructor(){}ngOnInit(){this.aircraft?this._title=this.title||this.aircraft.name||this.aircraft.mmsi||"Aircraft:":this.handleClose()}ngOnChanges(){if(!this.aircraft){this.handleClose();return}this.timeLastUpdate=`${this.aircraft.lastUpdated.getHours()}:${("00"+this.aircraft.lastUpdated.getMinutes()).slice(-2)}`;let e=(new Date().valueOf()-this.aircraft.lastUpdated.valueOf())/1e3;this.timeAgo=e<60?"":`(${Math.floor(e/60)} min ago)`}handleInfo(){this.info.emit(this.aircraft.id)}handleClose(){this.closed.emit()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["aircraft-popover"]],inputs:{title:"title",aircraft:"aircraft",canClose:"canClose"},outputs:{info:"info",closed:"closed"},features:[Se],decls:39,vars:16,consts:[[3,"closed","title","canClose"],[2,"display","flex"],[2,"font-weight","bold"],[2,"flex","1 1 auto","text-align","right"],[2,"flex","1 1 auto","text-align","right",3,"innerText"],[2,"flex","1 1 auto"],[1,"popover-action-button"],["mat-button","","matTooltip","Show Properties",3,"click"]],template:function(t,i){t&1&&(u(0,"ap-popover",0),T("closed",function(){return i.handleClose()}),u(1,"div",1)(2,"div",2),_(3,"Name:"),h(),u(4,"div",3),_(5),h()(),u(6,"div",1)(7,"div",2),_(8,"Call sign VHF:"),h(),u(9,"div",3),_(10),h()(),u(11,"div",1)(12,"div",2),_(13,"Call sign HF:"),h(),u(14,"div",3),_(15),h()(),u(16,"div",1)(17,"div",2),_(18,"Latitude:"),h(),z(19,"div",4),bt(20,"coords"),h(),u(21,"div",1)(22,"div",2),_(23,"Longitude:"),h(),z(24,"div",4),bt(25,"coords"),h(),u(26,"div",1)(27,"div",2),_(28,"Last Update:"),h(),u(29,"div",3),_(30),h()(),u(31,"div",1)(32,"div",5),_(33,"\xA0"),h(),u(34,"div",6)(35,"button",7),T("click",function(){return i.handleInfo()}),u(36,"mat-icon"),_(37,"info_outline"),h(),_(38," INFO "),h()()()()),t&2&&(w("title",i._title)("canClose",i.canClose),f(5),X(i.aircraft.name),f(5),K(" ",i.aircraft.callsignVhf," "),f(5),K(" ",i.aircraft.callsignHf," "),f(4),w("innerText",Mi(20,9,i.aircraft.position[1],i.app.config.units.positionFormat,!0)),f(5),w("innerText",$n(25,13,i.aircraft.position[0],i.app.config.units.positionFormat)),f(6),Nr(" ",i.timeLastUpdate," ",i.timeAgo," "))},dependencies:[ue,Ze,ye,Te,se,ce,jn,Qi],encapsulation:2,changeDetection:0})};var Tw=class n{title=Z();id=Z();alarm=Z();canClose=Z();info=xe();goto=xe();closed=xe();_title;app=M(oe);constructor(){Me(()=>{if(this.id(),!this.alarm()){this.handleClose();return}})}ngOnInit(){this.alarm()?this._title=this.title()||"Alarm:":this.handleClose()}handleInfo(){this.info.emit(this.alarm().path)}handleGoto(){this.goto.emit([this.alarm().properties.position.longitude,this.alarm().properties.position.latitude])}handleClose(){this.closed.emit()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["alarm-popover"]],inputs:{title:[1,"title"],id:[1,"id"],alarm:[1,"alarm"],canClose:[1,"canClose"]},outputs:{info:"info",goto:"goto",closed:"closed"},decls:34,vars:15,consts:[[3,"closed","title","canClose","icon"],[2,"display","flex"],[2,"font-weight","bold"],[2,"flex","1 1 auto","text-align","left","padding-left","5px","overflow","hidden","display","-webkit-box","-webkit-box-orient","vertical","-webkit-line-clamp","2","line-clamp","2","text-overflow","ellipsis"],[2,"flex","1 1 auto","text-align","right"],[2,"flex","1 1 auto","text-align","right",3,"innerText"],[2,"flex","1 1 auto"],[1,"popover-action-button"],["mat-button","","matTooltip","Navigate to here",3,"click"],["mat-button","","matTooltip","Show Properties",3,"click"]],template:function(t,i){t&1&&(u(0,"ap-popover",0),T("closed",function(){return i.handleClose()}),u(1,"div",1)(2,"div",2),_(3,"Message:"),h(),u(4,"div",3),_(5),h()(),u(6,"div",1)(7,"div",2),_(8,"Type:"),h(),u(9,"div",4),_(10),h()(),u(11,"div",1)(12,"div",2),_(13,"Latitude:"),h(),z(14,"div",5),bt(15,"coords"),h(),u(16,"div",1)(17,"div",2),_(18,"Longitude:"),h(),z(19,"div",5),bt(20,"coords"),h(),u(21,"div",1)(22,"div",6),_(23,"\xA0"),h(),u(24,"div",7)(25,"button",8),T("click",function(){return i.handleGoto()}),u(26,"mat-icon"),_(27,"near_me"),h(),_(28," GO TO "),h()(),u(29,"div",7)(30,"button",9),T("click",function(){return i.handleInfo()}),u(31,"mat-icon"),_(32,"info_outline"),h(),_(33," INFO "),h()()()()),t&2&&(w("title",i._title)("canClose",i.canClose())("icon",i.alarm().icon),f(5),K(" ",i.alarm().message," "),f(5),X(i.alarm().type),f(4),w("innerText",Mi(15,7,i.alarm().properties.position.latitude,i.app.config.units.positionFormat,!0)),f(5),w("innerText",Mi(20,11,i.alarm().properties.position.longitude,i.app.config.units.positionFormat,!1)))},dependencies:[ue,Ze,ye,Te,se,ce,jn,Qi],encapsulation:2,changeDetection:0})};function S1e(n,e){if(n&1&&(u(0,"div",1)(1,"div",2),_(2,"Temperature:"),h(),u(3,"div",3),_(4),h()()),n&2){let t=v();f(4),K(" ",t.app.formatValueForDisplay(t.aton().temperature,"K")," ")}}function T1e(n,e){if(n&1&&(u(0,"div",5)(1,"div",2),_(2,"Wind:"),h(),u(3,"div",9),z(4,"ap-compass-northup",10),h()()),n&2){let t=v();f(4),w("heading",t.convert.radiansToDegrees(t.aton().twd))("speed",t.app.formatSpeed(t.aton().tws))("label",t.app.formattedSpeedUnits)("windtrue",!0)}}var Ew=class n{title=Z();aton=Z();canClose=Z();info=xe();closed=xe();_title;_icon;timeLastUpdate;timeAgo;convert=Ue;isMeteo;app=M(oe);constructor(){Me(()=>{if(!this.aton()){this.handleClose();return}this._title=this.title()||this.aton().name||this.aton().mmsi||"AtoN:",this.isMeteo=this.aton().id.includes("meteo"),this._icon={name:this.isMeteo?"air":"beenhere",svgIcon:void 0},this.timeLastUpdate=`${this.aton().lastUpdated.getHours()}:${("00"+this.aton().lastUpdated.getMinutes()).slice(-2)}`;let e=(new Date().valueOf()-this.aton().lastUpdated.valueOf())/1e3;this.timeAgo=e<60?"":`(${Math.floor(e/60)} min ago)`})}ngOnInit(){this.aton()?(this.isMeteo=this.aton().id.includes("meteo"),this._icon={name:this.isMeteo?"air":"beenhere",svgIcon:void 0}):this.handleClose()}handleInfo(){this.info.emit(this.aton().id)}handleClose(){this.closed.emit()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["aton-popover"]],inputs:{title:[1,"title"],aton:[1,"aton"],canClose:[1,"canClose"]},outputs:{info:"info",closed:"closed"},decls:31,vars:17,consts:[[3,"closed","title","canClose","icon"],[2,"display","flex"],[2,"font-weight","bold"],[2,"flex","1 1 auto","text-align","right"],[2,"flex","1 1 auto","text-align","right",3,"innerText"],[2,"display","flex","flex-wrap","no-wrap"],[2,"flex","1 1 auto"],[1,"popover-action-button"],["mat-button","","matTooltip","Show Properties",3,"click"],[2,"width","150px"],[3,"heading","speed","label","windtrue"]],template:function(t,i){t&1&&(u(0,"ap-popover",0),T("closed",function(){return i.handleClose()}),u(1,"div",1)(2,"div",2),_(3,"Type:"),h(),u(4,"div",3),_(5),h()(),u(6,"div",1)(7,"div",2),_(8,"Latitude:"),h(),z(9,"div",4),bt(10,"coords"),h(),u(11,"div",1)(12,"div",2),_(13,"Longitude:"),h(),z(14,"div",4),bt(15,"coords"),h(),u(16,"div",1)(17,"div",2),_(18,"Last Update:"),h(),u(19,"div",3),_(20),h()(),R(21,S1e,5,1,"div",1),R(22,T1e,5,4,"div",5),u(23,"div",1)(24,"div",6),_(25,"\xA0"),h(),u(26,"div",7)(27,"button",8),T("click",function(){return i.handleInfo()}),u(28,"mat-icon"),_(29,"info_outline"),h(),_(30," INFO "),h()()()()),t&2&&(w("title",i._title)("canClose",i.canClose())("icon",i._icon),f(5),K(" ",i.aton().type.name," "),f(4),w("innerText",Mi(10,10,i.aton().position[1],i.app.config.units.positionFormat,!0)),f(5),w("innerText",$n(15,14,i.aton().position[0],i.app.config.units.positionFormat)),f(6),Nr(" ",i.timeLastUpdate," ",i.timeAgo," "),f(),A(i.isMeteo&&i.aton().temperature!==void 0?21:-1),f(),A(i.isMeteo&&i.aton().tws!==void 0&&i.aton().twd!==void 0?22:-1))},dependencies:[ue,Ze,ye,Te,se,ce,jn,vw,Qi],encapsulation:2,changeDetection:0})};var E1e=(n,e)=>e.key;function I1e(n,e){if(n&1&&(u(0,"div",1)(1,"div",3),_(2),h(),u(3,"div",4),_(4),h()()),n&2){let t=e.$implicit;f(2),K(" ",t.label,": "),f(2),X(t.value)}}function k1e(n,e){n&1&&(u(0,"div",2),_(1,"No details available"),h())}var Ok={SOUNDG:"Sounding",DEPCNT:"Depth Contour",OBSTRN:"Obstruction",UWTROC:"Underwater Rock",WRECKS:"Wreck",LIGHTS:"Light",BOYLAT:"Lateral Buoy",BOYCAR:"Cardinal Buoy",BOYISD:"Isolated Danger Buoy",BOYSAW:"Safe Water Buoy",BOYSPP:"Special Purpose Buoy",BCNLAT:"Lateral Beacon",BCNCAR:"Cardinal Beacon",BCNISD:"Isolated Danger Beacon",BCNSAW:"Safe Water Beacon",BCNSPP:"Special Purpose Beacon",LNDMRK:"Landmark",SLCONS:"Shoreline Construction",RESARE:"Restricted Area",ACHARE:"Anchorage Area",CBLSUB:"Submarine Cable",PIPSOL:"Submarine Pipeline",BERTHS:"Berth",MORFAC:"Mooring Facility",DISMAR:"Distance Mark",CURENT:"Current",TOPMAR:"Top Mark",RTPBCN:"Radar Transponder Beacon",RDOSTA:"Radio Station",RADSTA:"Radar Station",FOGSIG:"Fog Signal",PILBOP:"Pilot Boarding Place",CGUSTA:"Coast Guard Station",RSCSTA:"Rescue Station",SISTAT:"Signal Station",SISTAW:"Signal Station Warning",HRBFAC:"Harbour Facility",SMCFAC:"Small Craft Facility",CRANES:"Crane",GATCON:"Gate",BRIDGE:"Bridge",CONVYR:"Conveyor",PIPOHD:"Overhead Pipeline",CBLOHD:"Overhead Cable",OFSPLF:"Offshore Platform",LITFLT:"Light Float",LITVES:"Light Vessel",FSHFAC:"Fishing Facility"},Cj=new Set(["LIGHTS","BOYLAT","BOYCAR","BOYISD","BOYSAW","BOYSPP","BCNLAT","BCNCAR","BCNISD","BCNSAW","BCNSPP","TOPMAR","RTPBCN","RDOSTA","RADSTA","FOGSIG","LITFLT","LITVES","OBSTRN","UWTROC","WRECKS","LNDMRK","SLCONS","BRIDGE","OFSPLF","PILBOP","CRANES","GATCON","MORFAC","BERTHS","HRBFAC","SMCFAC","CBLSUB","CBLOHD","PIPSOL","PIPOHD","CGUSTA","RSCSTA","SISTAT","SISTAW","DISMAR","CURENT","FSHFAC","CONVYR","RESARE","ACHARE"]),D1e={1:"White",2:"Black",3:"Red",4:"Green",5:"Blue",6:"Yellow",7:"Grey",8:"Brown",9:"Amber",10:"Violet",11:"Orange",12:"Magenta",13:"Pink"},P1e={1:"Partly submerged",2:"Always dry",3:"Always under water",4:"Covers and uncovers",5:"Awash",6:"Subject to flooding",7:"Floating"},R1e={1:"Snag/stump",2:"Wellhead",3:"Diffuser",4:"Crib",5:"Fish haven",6:"Foul area",7:"Foul ground",8:"Ice boom",9:"Ground tackle",10:"Boom"},A1e={1:"Non-dangerous",2:"Dangerous",3:"Distributed remains",4:"Mast showing",5:"Hull showing"},L1e={1:"Conical (nun)",2:"Can (cylindrical)",3:"Spherical",4:"Pillar",5:"Spar",6:"Barrel",7:"Super-buoy",8:"Ice buoy"},O1e={1:"Stake/pole",2:"Withy",3:"Tower",4:"Lattice",5:"Pile",6:"Cairn",7:"Buoyant"},F1e={1:"Port",2:"Starboard",3:"Preferred channel starboard",4:"Preferred channel port"},N1e={1:"Directional",4:"Leading",5:"Aero",6:"Air obstruction",7:"Fog detector",8:"Flood",9:"Strip",10:"Subsidiary",11:"Spotlight",12:"Front",13:"Rear",14:"Lower",15:"Upper"},B1e={1:"Fixed",2:"Flashing",3:"Long flashing",4:"Quick flashing",5:"Very quick flashing",6:"Ultra quick flashing",7:"Isophase",8:"Occulting",9:"Interrupted quick",10:"Interrupted very quick",11:"Morse code",12:"Fixed/flashing",25:"Quick + long flash",26:"VQ + long flash",27:"UQ + long flash",28:"Alternating",29:"Fixed & alternating flashing"},V1e={1:"Under construction",2:"Ruined",3:"Under reclamation",5:"Planned"},G1e={1:"Permanent",2:"Occasional",3:"Recommended",4:"Not in use",5:"Intermittent",6:"Reserved",7:"Temporary",8:"Private",9:"Mandatory",11:"Extinguished",12:"Illuminated",13:"Historic",14:"Public",15:"Synchronized",16:"Watched",17:"Un-watched",18:"Doubtful"},z1e={1:"Anchoring prohibited",2:"Anchoring restricted",3:"Fishing prohibited",4:"Fishing restricted",5:"Trawling prohibited",6:"Trawling restricted",7:"Entry prohibited",8:"Entry restricted",9:"Dredging prohibited",10:"Dredging restricted",11:"Diving prohibited",12:"Diving restricted",13:"No wake",14:"Area to be avoided",27:"Speed restricted"},j1e={1:"Horizontal stripes",2:"Vertical stripes",3:"Diagonal stripes",4:"Squared",5:"Border stripes",6:"Single colour"},U1e={1:"Cone, point up",2:"Cone, point down",3:"Sphere",4:"Two spheres",5:"Cylinder",6:"Board",7:"X-shape",8:"Upright cross",9:"Cube, point up",10:"Two cones point to point",11:"Two cones base to base",12:"Rhombus",13:"Two cones point up",14:"Two cones point down",33:"Flag"},W1e={1:"North",2:"East",3:"South",4:"West"},H1e={1:"Firing danger area",2:"Target",3:"Marker ship",4:"Degaussing range",5:"Barge",6:"Cable",7:"Spoil ground",8:"Outfall",9:"ODAS",10:"Recording",11:"Seaplane anchorage",12:"Recreation zone",13:"Private",14:"Mooring",15:"LANBY",16:"Leading",17:"Measured distance",18:"Notice",19:"TSS",20:"No anchoring",21:"No berthing",22:"No overtaking",23:"No two-way traffic",24:"Reduced wake",25:"Speed limit",26:"Stop",27:"Warning",28:"Sound ship siren",39:"Environmental",45:"AIS",51:"No entry"},$1e={COLOUR:D1e,WATLEV:P1e,CATOBS:R1e,CATWRK:A1e,BOYSHP:L1e,BCNSHP:O1e,CATLAM:F1e,CATLIT:N1e,LITCHR:B1e,CONDTN:V1e,STATUS:G1e,RESTRN:z1e,COLPAT:j1e,TOPSHP:U1e,CATCAM:W1e,CATSPM:H1e},K1e=[{key:"OBJNAM",label:"Name"},{key:"NOBJNM",label:"Local Name"},{key:"INFORM",label:"Information"},{key:"NINFOM",label:"Note"},{key:"DEPTH",label:"Depth"},{key:"VALSOU",label:"Depth"},{key:"DRVAL1",label:"Min Depth"},{key:"DRVAL2",label:"Max Depth"},{key:"VALDCO",label:"Contour Depth"},{key:"CATWRK",label:"Type"},{key:"CATOBS",label:"Type"},{key:"WATLEV",label:"Water Level"},{key:"CATLAM",label:"Lateral"},{key:"CATCAM",label:"Cardinal"},{key:"CATSPM",label:"Purpose"},{key:"BOYSHP",label:"Shape"},{key:"BCNSHP",label:"Shape"},{key:"TOPSHP",label:"Top Mark"},{key:"COLOUR",label:"Colour"},{key:"COLPAT",label:"Pattern"},{key:"LITCHR",label:"Character"},{key:"CATLIT",label:"Category"},{key:"SIGPER",label:"Period"},{key:"VALNMR",label:"Range"},{key:"HEIGHT",label:"Height"},{key:"RESTRN",label:"Restriction"},{key:"CONDTN",label:"Condition"},{key:"STATUS",label:"Status"},{key:"CONRAD",label:"Radar Conspicuous"},{key:"CONVIS",label:"Visually Conspicuous"},{key:"VERLEN",label:"Vertical Clearance"},{key:"HORLEN",label:"Length"},{key:"HORWID",label:"Width"}];function q1e(n){if(Array.isArray(n))return n.map(t=>String(t).trim()).filter(t=>t!=="");let e=String(n).trim();if(e===""||e==="[]")return[];if(e.startsWith("[")&&e.endsWith("]"))try{let t=JSON.parse(e);if(Array.isArray(t))return t.map(i=>String(i).trim()).filter(i=>i!=="")}catch(t){}return e.split(",").map(t=>t.trim()).filter(t=>t!=="")}function Z1e(n,e){let t=q1e(e);if(t.length===0)return"";let i=$1e[n];return i?t.map(r=>i[r]||r).join(", "):t.join(", ")}var X1e=new Set(["DEPTH","VALSOU","DRVAL1","DRVAL2","VALDCO"]),Y1e=new Set(["HEIGHT","VERLEN","HORLEN","HORWID"]),Iw=class n{title=Z();properties=Z();canClose=Z();closed=xe();app=M(oe);_title;displayProps=[];constructor(){Me(()=>{if(!this.properties())return;let e=this.properties().layer||"";this._title=this.title()||Ok[e]||e||"Chart Feature",this.displayProps=[];for(let t of K1e){let i=this.properties()[t.key];i==null||i===""||this.displayProps.push({key:t.key,label:t.label,value:this.formatValue(t.key,i)})}})}formatValue(e,t){if(X1e.has(e)){let i=parseFloat(String(t));return isNaN(i)?String(t):this.app.formatValueForDisplay(i,"m",{category:"depth"})}if(Y1e.has(e)){let i=parseFloat(String(t));return isNaN(i)?String(t):this.app.formatValueForDisplay(i,"m",{category:"length"})}if(e==="SIGPER"){let i=parseFloat(String(t));return isNaN(i)?String(t):i+"s"}if(e==="VALNMR"){let i=parseFloat(String(t));return isNaN(i)?String(t):i+" NM"}return e==="CONRAD"||e==="CONVIS"?t===1||t==="1"?"Yes":"No":Z1e(e,t)}handleClose(){this.closed.emit()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["s57-popover"]],inputs:{title:[1,"title"],properties:[1,"properties"],canClose:[1,"canClose"]},outputs:{closed:"closed"},decls:4,vars:3,consts:[[3,"closed","title","canClose"],[2,"display","flex","padding","2px 0"],[2,"color","#888"],[2,"font-weight","bold","min-width","100px"],[2,"flex","1 1 auto","text-align","right"]],template:function(t,i){t&1&&(u(0,"ap-popover",0),T("closed",function(){return i.handleClose()}),Ae(1,I1e,5,2,"div",1,E1e),R(3,k1e,2,0,"div",2),h()),t&2&&(w("title",i._title)("canClose",i.canClose()),f(),Le(i.displayProps),f(2),A(i.displayProps.length===0?3:-1))},dependencies:[mn,ue,se,jn],encapsulation:2,changeDetection:0})};function Q1e(n,e){n&1&&_(0," (next) ")}function J1e(n,e){if(n&1&&(u(0,"div",1)(1,"div",2),_(2,"Latitude:"),h(),z(3,"div",8),bt(4,"coords"),h(),u(5,"div",1)(6,"div",2),_(7,"Longitude:"),h(),z(8,"div",8),bt(9,"coords"),h()),n&2){let t=v();f(3),w("innerText",Mi(4,2,t.point().position[1],t.app.config.units.positionFormat,!0)),f(5),w("innerText",Mi(9,6,t.point().position[0],t.app.config.units.positionFormat,!1))}}function eye(n,e){if(n&1){let t=H();u(0,"div",6)(1,"button",9),T("click",function(){O(t);let r=v();return F(r.skip.emit(r.point().index))}),u(2,"mat-icon"),_(3,"skip_next"),h(),_(4," SKIP "),h()()}}var kw=class n{point=Z.required();canClose=Z();rejoin=xe();skip=xe();closed=xe();app=M(oe);icon={class:"icon-route",name:"location_on"};canSkip(){return this.point().isNext&&this.point().index<this.point().total-1}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["route-point-popover"]],inputs:{point:[1,"point"],canClose:[1,"canClose"]},outputs:{rejoin:"rejoin",skip:"skip",closed:"closed"},decls:17,vars:8,consts:[[3,"closed","title","canClose","icon"],[2,"display","flex"],[2,"font-weight","bold"],[2,"flex","1 1 auto","text-align","right"],[2,"display","flex","flex-wrap","wrap"],[2,"flex","1 1 auto"],[1,"popover-action-button"],["mat-button","","matTooltip","Go straight to this point, then follow the route on","matTooltipPosition","after",3,"click"],[2,"flex","1 1 auto","text-align","right",3,"innerText"],["mat-button","","matTooltip","Go straight to the point after this one","matTooltipPosition","after",3,"click"]],template:function(t,i){t&1&&(u(0,"ap-popover",0),T("closed",function(){return i.closed.emit()}),u(1,"div",1)(2,"div",2),_(3,"Point:"),h(),u(4,"div",3),_(5),R(6,Q1e,1,0),h()(),R(7,J1e,10,10),u(8,"div",4)(9,"div",5),_(10,"\xA0"),h(),u(11,"div",6)(12,"button",7),T("click",function(){return i.rejoin.emit(i.point().index)}),u(13,"mat-icon"),_(14,"near_me"),h(),_(15," REJOIN HERE "),h()(),R(16,eye,5,0,"div",6),h()()),t&2&&(w("title",i.point().name||"Route point")("canClose",i.canClose())("icon",i.icon),f(5),Nr(" ",i.point().index+1," of ",i.point().total," "),f(),A(i.point().isNext?6:-1),f(),A(i.point().position?7:-1),f(9),A(i.canSkip()?16:-1))},dependencies:[ue,Ze,ye,Te,se,ce,jn,Qi],encapsulation:2,changeDetection:0})};var y1=la(ds());var Gd=la(ds());var Fk={targetAngle:[],port:[],starboard:[]},wj=n=>Array.isArray(n)&&Number.isFinite(n[0])&&Number.isFinite(n[1]);function Mj(n,e,t){let i=rf(t);return!wj(n)||!wj(e)||i===null?null:{vessel:n,mark:e,twd:i,beatAngle:t.performance.beatAngle,gybeAngle:t.performance.gybeAngle}}function Sj(n){let{vessel:e,mark:t}=n,i=Ue.radiansToDegrees(n.twd),r=us.add(i,180),o=(0,Gd.getGreatCircleBearing)(e,t),a=(0,Gd.getDistance)(e,t,.01),s=Math.abs(us.difference(o,i))<90,l=Ue.radiansToDegrees(n.beatAngle??Math.PI/4),c=typeof n.gybeAngle=="number"?Ue.radiansToDegrees(n.gybeAngle):void 0,d=typeof c=="number"?180-Math.abs(c):void 0,p=D=>{let V=(0,Gd.computeDestinationPoint)(t,a,us.add(r,D)),W=(0,Gd.computeDestinationPoint)(t,a,us.add(r,-D));return[[V.longitude,V.latitude],t,[W.longitude,W.latitude]]};if(!s&&typeof c!="number")return Fk;let m=s?l:d,g=p(s?l:c);if(!(s?Math.abs(us.difference(o,i))<l:Math.abs(us.difference(o,r))<d))return{targetAngle:g,port:[],starboard:[]};let b=us.difference(i,o),S=Ue.degreesToRadians(m-b),E=Ue.degreesToRadians(m+b),k=Math.PI-(E+S),I=a*Math.sin(E)/Math.sin(k),C=a*Math.sin(S)/Math.sin(k),x=(0,Gd.computeDestinationPoint)(e,I,us.add(i,m)),P=(0,Gd.computeDestinationPoint)(e,C,us.add(i,0-m)),j=[x.longitude,x.latitude],G=[P.longitude,P.latitude];return{targetAngle:g,port:[[G,e],[j,e]],starboard:[[j,t],[t,G]]}}function Tj(n){return n.ctrlKey||n.metaKey||n.altKey||Nk(n)?null:n.key==="+"?"in":n.key==="-"?"out":null}function Nk(n){let e=n.target,t=e?.tagName;return t==="INPUT"||t==="TEXTAREA"||t==="SELECT"||!!e?.isContentEditable}function Ej(n){return n.ctrlKey||n.metaKey||n.altKey||n.shiftKey||Nk(n)?!1:n.key==="ArrowUp"||n.key==="ArrowDown"||n.key==="ArrowLeft"||n.key==="ArrowRight"}var Dw=class{constructor(e){this.onExpire=e}onExpire;timer=null;delayMs=0;get armed(){return this.timer!==null}arm(e){this.cancel(),!(!Number.isFinite(e)||e<=0)&&(this.delayMs=e*1e3,this.start())}reset(){this.armed&&this.start()}cancel(){this.timer!==null&&(clearTimeout(this.timer),this.timer=null)}start(){this.cancel(),this.timer=setTimeout(()=>{this.timer=null,this.onExpire()},this.delayMs)}};function Ij(n,e){return n.zoomChanged===!0?!0:!e||!n.lonlat?!1:n.lonlat[0]!==e[0]||n.lonlat[1]!==e[1]}var kj=la(ds());var tye=1/1.94384;function Dj(n,e,t,i){let r=ri.distanceTo(n,e)??0,o=(0,kj.getGreatCircleBearing)(n,e)??0,a=typeof t=="number"&&t>tye?t:i??0,s=a>0?r/a:null;return{bearing:o,distance:r,timeToGo:s}}var Pj=[{name:"scaleline",options:{bar:!0,steps:2,text:!1,minWidth:64,units:"nautical"}}],Rj={line:[new he({stroke:new be({color:"white",width:5,lineDash:[5,5]})}),new he({fill:new Ve({color:"#3399CC"}),stroke:new be({color:"#3399CC",width:3,lineDash:[5,5]})})],marker:new he({image:new Hi({radius:3,stroke:new be({width:2,color:"white"}),fill:new Ve({color:"#3399CC"})})})},Aj={startLine:new he({stroke:new be({color:"black",width:2,lineDash:[4,4]}),text:new It({text:"START",offsetY:10})})},Lj={default:new he({stroke:new be({color:"green",width:2,lineDash:[20,5,5,5]}),text:new It({text:"",offsetY:10})}),active:new he({stroke:new be({color:"blue",width:4})})},Oj={default:new he({stroke:new be({color:"#e8932b",width:3,lineDash:[10,6]}),text:new It({text:"",offsetY:10})}),active:new he({stroke:new be({color:"#e8932b",width:4})})},Fj={line:new he({fill:new Ve({color:"green"}),stroke:new be({color:"black",width:2,lineDash:[5,5]})}),circle:new he({fill:new Ve({color:"rgba(0, 255, 0, .3)"}),stroke:new be({color:"red",width:2,lineDash:[5,5]})}),anchor:new he({image:new tn({src:"./assets/img/anchor.png",size:[26,26],scale:.75,anchor:[13,1],anchorXUnits:"pixels",anchorYUnits:"pixels",rotateWithView:!1})})},Nj={"notice-to-mariners":new he({stroke:new be({color:"rgb(206, 107, 132)",lineDash:[5,5],width:2}),fill:new Ve({color:"rgba(206, 107, 132, 0.2)"}),text:new It({text:"",offsetY:0})}),hazard:new he({stroke:new be({color:"rgba(241, 60, 60, 1)",lineDash:[5,5,2],width:2}),fill:new Ve({color:"rgba(241, 60, 60, 0.5)"}),text:new It({text:"",offsetY:0,stroke:new be({color:"silver"}),padding:[2,2,2,2],backgroundFill:new Ve({color:"white"}),backgroundStroke:new be({color:"rgba(241, 60, 60, 1)"})})})},Bj={mob:new he({image:new tn({src:"./assets/img/alarms/mob.svg",rotateWithView:!1,rotation:0,scale:1,anchor:[12,12],anchorXUnits:"pixels",anchorYUnits:"pixels"})})},Vj={marker:new he({image:new tn({src:"./assets/img/waypoints/marker-green.png",anchor:[10.5,25],anchorXUnits:"pixels",anchorYUnits:"pixels",rotateWithView:!1}),text:new It({text:"",offsetY:-30})})},iye=new tn({src:"./assets/img/aircraft_active.png",rotateWithView:!0,rotation:0}),nye=new tn({src:"./assets/img/aircraft_inactive.png",rotateWithView:!0,rotation:0}),Gj={default:new he({image:iye,text:new It({text:"",offsetY:-12})}),inactive:new he({image:nye,text:new It({text:"",offsetY:-12})})},rye=new tn({src:"./assets/img/sar_active.png",rotateWithView:!1,rotation:0}),zj={default:new he({image:rye,text:new It({text:"",offsetY:-18})})},jj={port:new he({fill:new Ve({color:"green"}),stroke:new be({color:"green",width:1,lineDash:[5,5]})}),starboard:new he({fill:new Ve({color:"red"}),stroke:new be({color:"red",width:1,lineDash:[5,5]})})},Uj=new he({fill:new Ve({color:"green"}),stroke:new be({color:"gray",width:1,lineDash:[15,5,3,5]})}),Jp={default:void 0,measure:[new he({stroke:new be({color:"white",width:5,lineDash:[5,5]})}),new he({image:new Hi({radius:6,stroke:new be({width:2,color:"white"}),fill:new Ve({color:"#3399CC"})}),fill:new Ve({color:"#3399CC"}),stroke:new be({color:"#3399CC",width:3,lineDash:[5,5]})})],route:[new he({stroke:new be({color:"white",width:5})}),new he({image:new Hi({radius:6,stroke:new be({width:2,color:"white"}),fill:new Ve({color:"green"})}),stroke:new be({color:"green",width:3})})],region:[new he({stroke:new be({color:"rgba(255,255,255,0.4)",width:5}),fill:new Ve({color:"rgba(255,255,255,0.4)"})}),new he({stroke:new be({color:"purple",width:2}),image:new Hi({radius:6,stroke:new be({width:2,color:"white"}),fill:new Ve({color:"purple"})})})],radius:[new he({image:new Hi({radius:6,stroke:new be({width:2,color:"white"}),fill:new Ve({color:"rgba(25, 183, 211, 0.4)"})})}),new he({fill:new Ve({color:"rgba(25, 183, 211, 0.4)"}),stroke:new be({color:"white",width:3,lineDash:[5,5]})})]};var _1=2*20037508342789244e-9;function Wj(n){return!n.onRoute&&!n.vertexDeleted}function oye(n,e,t,i=_1){let r=(e+t)/2,o=Mm(r-n[0],i);return[n[0]+o,n[1]]}function Hj(n,e,t,i,r,o=_1){let a=oye(t,i,r,o);return{after:[...n,a],meta:e?[...e,{name:""}]:void 0,undo:{coordinates:n.map(s=>[...s]),coordsMetadata:e?e.map(s=>ne({},s)):void 0}}}function $j(n,e,t,i){for(let o=0;o<t.length&&o<e.length;o++){let a=n[o]?.[0]!==e[o][0]||n[o]?.[1]!==e[o][1],s=t[o]?.href;if(a&&s){let r=t[o],{href:l}=r,c=zk(r,["href"]);t[o]=st(ne({},c),{name:c.name||i?.(s)||""})}}}function Pw(n,e){if(e.length<2)return-1;let t=e.length-2,i=Math.min(n.length,e.length);for(let r=0;r<i;r++)if(n[r][0]!==e[r][0]||n[r][1]!==e[r][1])return Math.min(Math.max(r-1,0),t);return n.length===e.length?-1:t}var gg=class n{constructor(e,t){this.http=e;this.sk=t}http;sk;currentCellDeg=.1;currentsCacheTtlMs=1800*1e3;currentsCacheMax=512;currentsCache=new Map;getWindSamples(e){if(e.length===0)return li([]);let t=e.map(i=>this.sk.api.get(2,`/weather/observations?lat=${i.latitude}&lon=${i.longitude}`).pipe(Lc(()=>li(null))));return Wk(t).pipe(Fr(i=>{let r=[];return i.forEach((o,a)=>{let s=o?.[0];!s?.wind||typeof s.wind.speedTrue!="number"||typeof s.wind.directionTrue!="number"||r.push({latitude:e[a].latitude,longitude:e[a].longitude,speed:s.wind.speedTrue,direction:s.wind.directionTrue})}),r}))}getOceanCurrentSamples(e){if(e.length===0)return li([]);let t=Date.now(),i=e.map(c=>this.currentCellKey(c)),r=new Map;if(i.forEach(c=>{if(r.has(c))return;let d=this.currentsCache.get(c);(!d||t-d.at>=this.currentsCacheTtlMs)&&r.set(c,this.currentCellCenter(c))}),r.size===0)return li(this.buildCurrentSamples(e,i));let o=Array.from(r.entries()),a=o.map(([,c])=>c.latitude.toFixed(4)).join(","),s=o.map(([,c])=>c.longitude.toFixed(4)).join(","),l=`https://marine-api.open-meteo.com/v1/marine?latitude=${a}&longitude=${s}¤t=ocean_current_velocity,ocean_current_direction`;return this.http.get(l).pipe(Fr(c=>Array.isArray(c)?c:[c]),da(c=>{c.length!==o.length||c.some(d=>d?.error)||c.forEach((d,p)=>{let m=d?.current?.ocean_current_velocity,g=d?.current?.ocean_current_direction;this.cacheCurrentCell(o[p][0],typeof m=="number"&&typeof g=="number"?{velocity:m,direction:g}:null)})}),Fr(()=>this.buildCurrentSamples(e,i)),Lc(()=>li(this.buildCurrentSamples(e,i))))}buildCurrentSamples(e,t){let i=[];return e.forEach((r,o)=>{let a=this.currentsCache.get(t[o])?.value;a&&i.push({latitude:r.latitude,longitude:r.longitude,velocity:a.velocity,direction:a.direction})}),i}currentCellKey(e){let t=Math.floor(e.longitude/this.currentCellDeg),i=Math.floor(e.latitude/this.currentCellDeg);return`${t}:${i}`}currentCellCenter(e){let[t,i]=e.split(":").map(Number);return{latitude:(i+.5)*this.currentCellDeg,longitude:(t+.5)*this.currentCellDeg}}cacheCurrentCell(e,t){if(this.currentsCache.delete(e),this.currentsCache.size>=this.currentsCacheMax){let i=this.currentsCache.keys().next().value;i!==void 0&&this.currentsCache.delete(i)}this.currentsCache.set(e,{at:Date.now(),value:t})}static \u0275fac=function(t){return new(t||n)(ut(Sa),ut(Lt))};static \u0275prov=Je({token:n,factory:n.\u0275fac,providedIn:"root"})};var aye=["*"],Rw=class n{constructor(e,t,i,r,o){this.mapComponent=e;this.weather=t;this.mapImages=i;this.app=r;o.detach()}mapComponent;weather;mapImages;app;show=!1;opacity=.55;indicator="barb";layer;source;refresh$=new Oe;refreshSub;zIndex=55;gridColumns=5;gridRows=4;ngOnChanges(e){typeof e.opacity<"u"&&this.layer&&this.layer.setOpacity(this.normalizedOpacity),e.indicator&&!e.indicator.firstChange&&this.layer?.changed(),this.show?this.addLayer():this.removeLayer()}ngOnDestroy(){this.refreshSub?.unsubscribe(),this.removeLayer()}addLayer(){if(this.layer){this.layer.setOpacity(this.normalizedOpacity),this.refresh$.next();return}this.source=new kt,this.layer=new At({source:this.source,opacity:this.normalizedOpacity,zIndex:this.zIndex,style:e=>this.createWindStyle(e)}),this.layer.set("id","signal-k-weather-wind"),this.layer.set("name","Weather Wind"),this.mapComponent.getMap().addLayer(this.layer),this.refreshSub=this.refresh$.pipe(th(400),fr(()=>this.fetchWind())).subscribe(),this.mapComponent.getMap().on("moveend",this.onMoveEnd),this.refresh$.next(),this.mapComponent.getMap().render()}removeLayer(){let e=this.mapComponent.getMap();!e||!this.layer||(e.un("moveend",this.onMoveEnd),this.refreshSub?.unsubscribe(),this.refreshSub=void 0,e.removeLayer(this.layer),this.source?.clear(),this.source=void 0,this.layer=void 0,e.render())}onMoveEnd=()=>{this.refresh$.next()};get normalizedOpacity(){return Math.max(0,Math.min(1,this.opacity??1))}fetchWind(){if(!this.show||!this.source)return li([]);let e=this.getSamplePoints();return e.length===0?li([]):this.weather.getWindSamples(e).pipe(da(t=>this.renderWind(t)),Lc(t=>(console.warn("SK Weather wind layer unavailable.",t),li([]))))}getSamplePoints(){let e=this.mapComponent.getMap(),t=e.getSize();if(!t)return[];let i=Jn(e.getView().calculateExtent(t),"EPSG:3857","EPSG:4326"),r=Math.max(-180,i[0]),o=Math.max(-80,i[1]),a=Math.min(180,i[2]),s=Math.min(80,i[3]),l=[];for(let c=0;c<this.gridRows;c++){let d=s-(s-o)*(c+.5)/this.gridRows;for(let p=0;p<this.gridColumns;p++){let m=r+(a-r)*(p+.5)/this.gridColumns;l.push({latitude:d,longitude:m})}}return l}renderWind(e){this.source.clear(),this.source.addFeatures(e.map(t=>new je({geometry:new ot(lt([t.longitude,t.latitude])),speed:t.speed,direction:t.direction})))}createWindStyle(e){let t=Number(e.get("direction"))||0,i=Number(e.get("speed"))||0;return this.indicator==="barb"?this.createBarbStyle(t,i):this.createArrowStyle(t,i)}createArrowStyle(e,t){let i=this.mapImages.getWindArrow().clone();return i.setRotation(e+Math.PI),i.setRotateWithView(!0),new he({image:i,text:this.speedLabel(t,26)})}createBarbStyle(e,t){let i=this.mapImages.getMeteoIcon(t).clone();return Dp(t)&&i.setRotation(e),i.setRotateWithView(!0),new he({image:i,text:this.speedLabel(t,10)})}speedLabel(e,t){return new It({text:this.app.formatValueForDisplay(e,"m/s",{precision:0,path:this.app.twsDisplayUnitPath()}),offsetY:t,font:"11px Roboto, Arial, sans-serif",fill:new Ve({color:"rgba(20, 60, 95, 0.95)"}),stroke:new be({color:"rgba(255, 255, 255, 0.9)",width:3})})}static \u0275fac=function(t){return new(t||n)(ie(ke),ie(gg),ie(er),ie(oe),ie(ae))};static \u0275cmp=U({type:n,selectors:[["fb-weather-wind"]],inputs:{show:"show",opacity:"opacity",indicator:"indicator"},features:[Se],ngContentSelectors:aye,decls:1,vars:0,template:function(t,i){t&1&&(fe(),de(0))},encapsulation:2,changeDetection:0})};var sye=["*"],qj=85;function lye(n,e,t,i=un){let[r,o,a,s]=n,l=(a-r)/e,c=(s-o)/t;if(!(l>0)||!(c>0))return[];let d=Math.floor(r/l)*l,p=Math.floor(o/c)*c,m=y=>Number(y.toFixed(4)),g=[];for(let y=0;y<t;y++)for(let b=0;b<e;b++){let[S,E]=i([d+(b+.5)*l,p+(y+.5)*c]);if(E<-qj||E>qj)continue;let k=((S+180)%360+360)%360-180;g.push({latitude:m(E),longitude:m(k)})}return g}var Aw=class n{constructor(e,t,i,r){this.mapComponent=e;this.weather=t;this.mapImages=i;r.detach()}mapComponent;weather;mapImages;show=!1;opacity=.55;layer;source;refresh$=new Oe;refreshSub;zIndex=56;gridColumns=10;gridRows=8;ngOnChanges(e){typeof e.opacity<"u"&&this.layer&&this.layer.setOpacity(this.normalizedOpacity),this.show?this.addLayer():this.removeLayer()}ngOnDestroy(){this.refreshSub?.unsubscribe(),this.removeLayer()}addLayer(){if(this.layer){this.layer.setOpacity(this.normalizedOpacity),this.refresh$.next();return}this.source=new kt,this.layer=new At({source:this.source,opacity:this.normalizedOpacity,zIndex:this.zIndex,style:e=>this.createArrowStyle(e)}),this.layer.set("id","openmeteo-currents"),this.layer.set("name","Open-Meteo Ocean Currents"),this.mapComponent.getMap().addLayer(this.layer),this.refreshSub=this.refresh$.pipe(th(600),Fr(()=>this.getSamplePoints()),C1((e,t)=>this.pointsKey(e)===this.pointsKey(t)),fr(e=>this.fetchCurrents(e))).subscribe(),this.mapComponent.getMap().on("moveend",this.onMoveEnd),this.refresh$.next(),this.mapComponent.getMap().render()}removeLayer(){let e=this.mapComponent.getMap();!e||!this.layer||(e.un("moveend",this.onMoveEnd),this.refreshSub?.unsubscribe(),this.refreshSub=void 0,e.removeLayer(this.layer),this.source?.clear(),this.source=void 0,this.layer=void 0,e.render())}onMoveEnd=()=>{this.refresh$.next()};get normalizedOpacity(){return Math.max(0,Math.min(1,this.opacity??1))}fetchCurrents(e){return!this.show||!this.source?li([]):e.length===0?(this.source.clear(),li([])):this.weather.getOceanCurrentSamples(e).pipe(da(t=>this.renderCurrents(t)),Lc(()=>li([])))}getSamplePoints(){let e=this.mapComponent.getMap(),t=e.getSize();return t?lye(e.getView().calculateExtent(t),this.gridColumns,this.gridRows):[]}pointsKey(e){return e.map(t=>`${t.latitude},${t.longitude}`).join(";")}renderCurrents(e){this.source.clear(),this.source.addFeatures(e.map(t=>new je({geometry:new ot(lt([t.longitude,t.latitude])),velocity:t.velocity,direction:t.direction})))}createArrowStyle(e){let t=Number(e.get("velocity"))||0,i=Number(e.get("direction"))||0,r=this.getFlowRotation(i),o=Math.min(1,t/2),a=Math.round(38+o*190),s=Math.round(150-o*100),l=Math.round(245-o*200),c=`rgb(${a}, ${s}, ${l})`,d=this.mapImages.getOceanCurrentArrow().clone();return d.setRotation(r),d.setScale(.65+Math.min(.5,t/8)),d.setColor(c),d.setRotateWithView(!0),new he({image:d,text:new It({text:`${(t/1.852).toFixed(1)} kn`,offsetY:28,font:"11px Roboto, Arial, sans-serif",fill:new Ve({color:"rgba(255, 255, 255, 0.95)"}),stroke:new be({color:"rgba(20, 60, 95, 0.9)",width:3})})})}getFlowRotation(e){return e*Math.PI/180}static \u0275fac=function(t){return new(t||n)(ie(ke),ie(gg),ie(er),ie(ae))};static \u0275cmp=U({type:n,selectors:[["fb-weather-currents"]],inputs:{show:"show",opacity:"opacity"},features:[Se],ngContentSelectors:sye,decls:1,vars:0,template:function(t,i){t&1&&(fe(),de(0))},encapsulation:2,changeDetection:0})};var cye=new Set(["vessels","ais-vessels"]),dye=new Set(["trail","track-vessels","trackhistory"]),Zj=n=>n.split(".")[0];function Xj(n){let e=[...n];return e.some(t=>cye.has(Zj(t)))?e.filter(t=>dye.has(Zj(t))):[]}function Yj(n,e,t){return ry(e&&n?n:{lines:[],times:[]},t)}var uye=["olMap"],pye=["routeDraw"],hye=()=>({precision:0}),mye=()=>({class:"",name:"history"}),fye=n=>["From",n],gye=n=>["To",n],_ye=n=>["Duration",n],yye=n=>["Here at",n],vye=(n,e,t,i)=>[n,e,t,i],bye=()=>({declutter:!0}),Bk=(n,e)=>e[0],xye=(n,e)=>e.id;function Cye(n,e){if(n&1){let t=H();u(0,"ol-dragbox",46),T("boxStart",function(r){O(t);let o=v();return F(o.onDragBoxStart(r))})("boxEnd",function(r){O(t);let o=v();return F(o.onDragBoxEnd(r))})("boxCancel",function(){O(t);let r=v();return F(r.onDragBoxCancel())}),h()}}function wye(n,e){if(n&1){let t=H();u(0,"ol-draw",47),T("drawStart",function(r){O(t);let o=v();return F(o.onMeasureStart(r))})("drawEnd",function(){O(t);let r=v();return F(r.onMeasureEnd())}),h()}if(n&2){let t=v();Uw(t.mapInteract.draw.style),w("type",t.mapInteract.measureGeometryType)("stopClick",!1)}}function Mye(n,e){if(n&1){let t=H();u(0,"ol-draw",48,2),T("drawEnd",function(r){O(t);let o=v();return F(o.onDrawEnd(r))}),h()}if(n&2){let t=v();Uw(t.mapInteract.draw.style),w("type",t.mapInteract.draw.featureType)("stopClick",t.mapInteract.draw.resourceType!=="route")}}function Sye(n,e){if(n&1){let t=H();u(0,"ol-modify",49),T("modifyStart",function(r){O(t);let o=v();return F(o.onModifyStart(r))})("modifyEnd",function(r){O(t);let o=v();return F(o.onModifyEnd(r))}),h()}if(n&2){let t=v();w("features",t.mapInteract.draw.features)}}function Tye(n,e){n&1&&(u(0,"span"),_(1,"Lat:\xA0"),h())}function Eye(n,e){n&1&&(u(0,"span"),_(1,"Lon:\xA0"),h())}function Iye(n,e){if(n&1&&(_(0," \xA0 "),z(1,"span",12)),n&2){let t=v(),i=v();f(),w("innerText","ETA: "+i.app.formatValueForDisplay(t.timeToGo,"s"))}}function kye(n,e){if(n&1&&(_(0," \xA0 "),z(1,"span",12),_(2," \xA0 "),z(3,"span",12),R(4,Iye,2,1)),n&2){let t=e,i=v();f(),w("innerText","Brg: "+i.app.formatValueForDisplay(t.bearing,"deg",kr(3,hye))),f(2),w("innerText","Dist: "+i.app.formatValueForDisplay(t.distance,"m")),f(),A(t.timeToGo!==null?4:-1)}}function Dye(n,e){if(n&1&&z(0,"fb-s57-chart",50),n&2){let t=v(),i=t.$implicit,r=t.$index;w("zIndex",10+r)("chart",i)}}function Pye(n,e){if(n&1&&z(0,"fb-mapstylejson-chart",50),n&2){let t=v(),i=t.$implicit,r=t.$index;w("zIndex",10+r)("chart",i)}}function Rye(n,e){if(n&1&&z(0,"fb-tilejson-chart",51),n&2){let t=v(),i=t.$implicit,r=t.$index,o=v();w("zIndex",10+r)("chart",i)("overZoomTiles",o.overZoomTiles)("mapMaxZoom",o.app.MAP_ZOOM_EXTENT.max)}}function Aye(n,e){if(n&1&&z(0,"fb-wms-chart",51),n&2){let t=v(),i=t.$implicit,r=t.$index,o=v();w("zIndex",10+r)("chart",i)("overZoomTiles",o.overZoomTiles)("mapMaxZoom",o.app.MAP_ZOOM_EXTENT.max)}}function Lye(n,e){if(n&1&&z(0,"fb-wmts-chart",51),n&2){let t=v(),i=t.$implicit,r=t.$index,o=v();w("zIndex",10+r)("chart",i)("overZoomTiles",o.overZoomTiles)("mapMaxZoom",o.app.MAP_ZOOM_EXTENT.max)}}function Oye(n,e){if(n&1&&z(0,"fb-tilelayer-vector",51),n&2){let t=v(),i=t.$implicit,r=t.$index,o=v();w("zIndex",10+r)("chart",i)("overZoomTiles",o.overZoomTiles)("mapMaxZoom",o.app.MAP_ZOOM_EXTENT.max)}}function Fye(n,e){if(n&1&&z(0,"fb-tilelayer-raster",51),n&2){let t=v(),i=t.$implicit,r=t.$index,o=v();w("zIndex",10+r)("chart",i)("overZoomTiles",o.overZoomTiles)("mapMaxZoom",o.app.MAP_ZOOM_EXTENT.max)}}function Nye(n,e){if(n&1&&R(0,Dye,1,2,"fb-s57-chart",50)(1,Pye,1,2,"fb-mapstylejson-chart",50)(2,Rye,1,4,"fb-tilejson-chart",51)(3,Aye,1,4,"fb-wms-chart",51)(4,Lye,1,4,"fb-wmts-chart",51)(5,Oye,1,4,"fb-tilelayer-vector",51)(6,Fye,1,4,"fb-tilelayer-raster",51),n&2){let t=e.$implicit;A((t[1].type==null?null:t[1].type.toLowerCase())==="s-57"?0:(t[1].type==null?null:t[1].type.toLowerCase())==="mapstylejson"?1:(t[1].type==null?null:t[1].type.toLowerCase())==="tilejson"?2:(t[1].type==null?null:t[1].type.toLowerCase())==="wms"?3:(t[1].type==null?null:t[1].type.toLowerCase())==="wmts"?4:(t[1].type==null?null:t[1].type.toLowerCase())==="tilelayer"&&((t[1].format==null?null:t[1].format.toLowerCase())==="pbf"||(t[1].format==null?null:t[1].format.toLowerCase())==="mvt")?5:t[0]==="openstreetmap"||(t[1].type==null?null:t[1].type.toLowerCase())==="tilelayer"||!(t[1]!=null&&t[1].type)?6:-1)}}function Bye(n,e){if(n&1){let t=H();u(0,"fb-radar",52),T("onError",function(r){O(t);let o=v();return F(o.handleRadarError(r))}),h()}if(n&2){let t=v();w("position",t.dfeat.self.position)("heading",t.dfeat.self.orientation)("mapZoom",t.mapZoomLevel())("zIndex",99)("opacity",t.app.config.radars.opacity)}}function Vye(n,e){if(n&1&&z(0,"fb-tracks",14),n&2){let t=v();w("darkMode",t.app.uiConfig().invertColor)("tracks",t.skres.tracks())("labelMinZoom",t.app.config.map.labelsMinZoom)("mapZoom",t.mapZoomLevel())("zIndex",100)}}function Gye(n,e){if(n&1&&z(0,"fb-track-history",15),n&2){let t=v();w("tracks",t.trackHistory.tracks())("zIndex",105)}}function zye(n,e){if(n&1&&z(0,"fb-track-history-ghosts",16),n&2){let t=v();w("ghosts",t.trackHistory.ghosts())("iconScale",t.app.config.vessels.iconScale)("zIndex",995)}}function jye(n,e){if(n&1&&z(0,"ais-targets-track",17),n&2){let t=v();w("tracks",t.app.data.vessels.aisTracks)("showAll",t.app.config.vessels.aisShowTrack)("selectedIds",t.app.data.vessels.showTrack)("tracksMinZoom",t.aisTrackMinZoom)("updateIds",t.skstream.aisStatus().updated)("removeIds",t.skstream.aisStatus().expired)("mapZoom",t.mapZoomLevel())("zIndex",110)}}function Uye(n,e){if(n&1&&(u(0,"div"),z(1,"fb-resource-sets",53),h()),n&2){let t=e.$implicit,i=e.$index,r=v();f(),w("darkMode",r.app.uiConfig().invertColor)("collection",t[0])("resourceSets",t[1])("labelMinZoom",r.app.config.map.labelsMinZoom)("mapZoom",r.mapZoomLevel())("zIndex",120+i)}}function Wye(n,e){if(n&1&&z(0,"fb-route-direction",19),n&2){let t=v();w("points",t.course.courseData().activeRoutePoints)("pointIndex",t.course.courseData().pointIndex)("reverse",t.app.data.activeRouteReversed)("zIndex",550)}}function Hye(n,e){if(n&1&&z(0,"sk-ais-targets",23),n&2){let t=v();w("darkMode",t.app.uiConfig().invertColor)("targets",t.dfeat.meteo)("windIndicator",t.app.config.display.windIndicator)("labelMinZoom",t.app.config.map.labelsMinZoom)("mapZoom",t.mapZoomLevel())("updateIds",t.skstream.aisStatus().updated)("staleIds",t.skstream.aisStatus().stale)("removeIds",t.skstream.aisStatus().expired)("inactiveTime",t.app.config.vessels.aisStaleAge)("zIndex",220)}}function $ye(n,e){if(n&1&&z(0,"sk-ais-wind",54),n&2){let t=v(2);w("targetContext","vessels")("targets",t.dfeat.ais)("vectorApparent",t.app.config.vessels.aisWindApparent)("mapZoom",t.mapZoomLevel())("labelMinZoom",t.app.config.map.labelsMinZoom)("focusId",t.app.data.vessels.activeId)("filterIds",t.app.config.selections.aisTargets)("filterByShipType",t.app.config.selections.aisFilterByShipType)("filterShipTypes",t.app.config.selections.aisTargetTypes)("updateIds",t.skstream.aisStatus().updated)("staleIds",t.skstream.aisStatus().stale)("removeIds",t.skstream.aisStatus().expired)("inactiveTime",t.app.config.vessels.aisStaleAge)("zIndex",900)("darkMode",t.app.uiConfig().invertColor)}}function Kye(n,e){if(n&1&&(u(0,"div"),R(1,$ye,1,15,"sk-ais-wind",54),z(2,"sk-ais-flags",55)(3,"sk-ais-vessels",56),h()),n&2){let t=v();f(),A(t.mapZoomLevel()>=t.app.config.vessels.aisWindMinZoom?1:-1),f(),w("flagged",t.app.data.vessels.flagged)("targetContext","vessels")("targets",t.dfeat.ais)("mapZoom",t.mapZoomLevel())("labelMinZoom",t.app.config.map.labelsMinZoom)("focusId",t.app.data.vessels.activeId)("filterIds",t.app.config.selections.aisTargets)("filterByShipType",t.app.config.selections.aisFilterByShipType)("filterShipTypes",t.app.config.selections.aisTargetTypes)("updateIds",t.skstream.aisStatus().updated)("staleIds",t.skstream.aisStatus().stale)("removeIds",t.skstream.aisStatus().expired)("inactiveTime",t.app.config.vessels.aisStaleAge)("zIndex",985)("darkMode",t.app.uiConfig().invertColor),f(),w("darkMode",t.app.uiConfig().invertColor)("targets",t.dfeat.ais)("labelMinZoom",t.app.config.map.labelsMinZoom)("mapZoom",t.mapZoomLevel())("updateIds",t.skstream.aisStatus().updated)("staleIds",t.skstream.aisStatus().stale)("removeIds",t.skstream.aisStatus().expired)("inactiveTime",t.app.config.vessels.aisStaleAge)("zIndex",980)("focusId",t.app.data.vessels.activeId)("filterIds",t.app.config.selections.aisTargets)("filterByShipType",t.app.config.selections.aisFilterByShipType)("filterShipTypes",t.app.config.selections.aisTargetTypes)("cogLineLength",t.app.config.vessels.aisCogLine)}}function qye(n,e){if(n&1&&z(0,"sk-ais-targets",24),n&2){let t=v();w("darkMode",t.app.uiConfig().invertColor)("targets",t.dfeat.aircraft)("targetStyles",t.featureStyles.aircraft)("labelMinZoom",t.app.config.map.labelsMinZoom)("mapZoom",t.mapZoomLevel())("updateIds",t.skstream.aisStatus().updated)("staleIds",t.skstream.aisStatus().stale)("removeIds",t.skstream.aisStatus().expired)("inactiveTime",t.app.config.vessels.aisStaleAge)("zIndex",910)}}function Zye(n,e){if(n&1&&z(0,"sk-ais-targets",25),n&2){let t=v();w("darkMode",t.app.uiConfig().invertColor)("targets",t.dfeat.sar)("targetStyles",t.featureStyles.sar)("labelMinZoom",t.app.config.map.labelsMinZoom)("mapZoom",t.mapZoomLevel())("updateIds",t.skstream.aisStatus().updated)("staleIds",t.skstream.aisStatus().stale)("removeIds",t.skstream.aisStatus().expired)("inactiveTime",t.app.config.vessels.aisStaleAge)("zIndex",920)}}function Xye(n,e){if(n&1&&z(0,"fb-notes",28),n&2){let t=v();w("notes",t.plotterExt.visibleNotes())("zIndex",450)}}function Yye(n,e){if(n&1){let t=H();u(0,"ol-overlay",29)(1,"ap-popover",57),T("closed",function(){O(t);let r=v();return F(r.popoverClosed())})("navigateTo",function(){O(t);let r=v();return r.onContextMenuAction("nav_to",r.overlay().position),F(r.popoverClosed())}),h()(),z(2,"fb-bearing-line",58)}if(n&2){let t=v();w("position",t.overlay().position)("worldOffset",t.overlay().worldOffset??0)("positioning","top-center"),f(),w("title",t.overlay().title)("canClose",!1)("measure",!0)("navTo",!0),f(),w("markerPosition",t.overlay().position)("vesselPosition",t.dfeat.active.position)("showMarker",!1)("bearingStyles",t.featureStyles.bearingDistance)("labelMinZoom",t.app.config.map.labelsMinZoom)("mapZoom",t.mapZoomLevel())("zIndex",335)}}function Qye(n,e){if(n&1){let t=H();u(0,"ap-popover",71),T("closed",function(){O(t);let r=v(2);return F(r.popoverClosed())}),h()}if(n&2){let t=v(2);w("title",t.overlay().title)("canClose",!1)("measure",!0)}}function Jye(n,e){if(n&1){let t=H();u(0,"chart-list-popover",72),T("selected",function(r){O(t);let o=v(2);return F(o.toggleFeatureSelection(r,"charts"))})("closed",function(){O(t);let r=v(2);return F(r.popoverClosed())}),h()}if(n&2){let t=v(2);w("canClose",t.app.config.map.popoverMulti)("features",t.overlay().content)}}function eve(n,e){if(n&1){let t=H();u(0,"feature-list-popover",73),T("selected",function(r){O(t);let o=v(2);return F(o.featureListSelection(r))})("closed",function(){O(t);let r=v(2);return F(r.popoverClosed())}),h()}if(n&2){let t=v(2);w("canClose",t.app.config.map.popoverMulti)("title",t.overlay().title)("features",t.overlay().content)}}function tve(n,e){if(n&1){let t=H();u(0,"s57-popover",74),T("closed",function(){O(t);let r=v(2);return F(r.popoverClosed())}),h()}if(n&2){let t=v(2);w("canClose",t.app.config.map.popoverMulti)("properties",t.overlay().s57Feature)}}function ive(n,e){if(n&1&&(u(0,"div",77)(1,"div",78),_(2),h(),u(3,"div",79),_(4),h()()),n&2){let t=v().$implicit;f(2),K("",t[0],":"),f(2),K(" ",t[1]," ")}}function nve(n,e){if(n&1&&R(0,ive,5,2,"div",77),n&2){let t=e.$implicit;A(t[1]?0:-1)}}function rve(n,e){if(n&1&&Ae(0,nve,1,1,null,null,Bk),n&2){v();let t=pa(0);Le(nD(8,vye,Gi(0,fye,t.start),Gi(2,gye,t.end),Gi(4,_ye,t.duration),Gi(6,yye,t.at)))}}function ove(n,e){n&1&&(u(0,"div",76),_(1,"No recording times available"),h())}function ave(n,e){if(n&1){let t=H();As(0),u(1,"ap-popover",75),T("closed",function(){O(t);let r=v(2);return F(r.popoverClosed())}),R(2,rve,2,13)(3,ove,2,0,"div",76),h()}if(n&2){let t=v(2),i=Ls(t.overlay().trackHistory);f(),w("title",i==null?null:i.name)("icon",kr(5,mye))("canClose",t.app.config.map.popoverMulti),f(),A(i!=null&&i.start?2:3)}}function sve(n,e){if(n&1){let t=H();u(0,"ap-popover",80),T("closed",function(){O(t);let r=v(2);return F(r.popoverClosed())}),u(1,"div",81)(2,"mat-icon",82),_(3,"water"),h(),u(4,"div",83)(5,"div",84)(6,"mat-icon",85),_(7,"air"),h(),u(8,"span"),_(9),h()(),u(10,"div",84)(11,"mat-icon",85),_(12,"explore"),h(),u(13,"span"),_(14),h()()()()()}if(n&2){let t,i,r=v(2);w("canClose",r.app.config.map.popoverMulti)("compact",!0),f(9),X((t=r.overlay().tidal)==null?null:t.speedLabel),f(5),X((i=r.overlay().tidal)==null?null:i.directionLabel)}}function lve(n,e){if(n&1){let t=H();u(0,"resource-popover",86),T("modify",function(){O(t);let r=v(2);return r.modifyFeature(),F(r.popoverClosed())})("save",function(){O(t);let r=v(2);return r.saveRouteFromPopover(),F(r.popoverClosed())})("delete",function(){O(t);let r=v(2);return r.deleteFeature(r.overlay().id,r.overlay().type),F(r.popoverClosed())})("hide",function(){O(t);let r=v(2);return r.hideFeature(r.overlay().id,r.overlay().type),F(r.popoverClosed())})("addNote",function(){O(t);let r=v(2);return r.skres.showNoteEditor({type:r.overlay().type,href:{id:r.overlay().id,exists:!0}}),F(r.popoverClosed())})("activated",function(){O(t);let r=v(2);return r.setActiveFeature(),F(r.popoverClosed())})("deactivated",function(){O(t);let r=v(2);return r.clearActiveFeature(),F(r.popoverClosed())})("related",function(r){O(t);let o=v(2);return o.skres.showRelatedNotes(r,"group"),F(o.popoverClosed())})("notes",function(){O(t);let r=v(2);return r.skres.showRelatedNotes(r.overlay().id,r.overlay().type,r.overlay().readOnly),F(r.popoverClosed())})("info",function(){O(t);let r=v(2);return r.popoverInfo(),F(r.popoverClosed())})("points",function(){O(t);let r=v(2);return r.popoverPoints(),F(r.popoverClosed())})("closed",function(){O(t);let r=v(2);return F(r.popoverClosed())}),h()}if(n&2){let t=v(2);w("canClose",t.app.config.map.popoverMulti)("title",t.overlay().title)("type",t.overlay().type)("resource",t.overlay().resource)("active",t.app.data.activeWaypoint?t.app.data.activeWaypoint:t.app.data.activeRoute)("featureCount",t.overlay().featureCount)("units",t.scaleUnits())("canSave",t.isUnsavedRoute())("canStart",t.isDraftRoute())}}function cve(n,e){if(n&1){let t=H();u(0,"resourceset-popover",87),T("modify",function(){O(t);let r=v(2);return r.modifyFeature(),F(r.popoverClosed())})("delete",function(){O(t);let r=v(2);return r.deleteFeature(r.overlay().id,r.overlay().type),F(r.popoverClosed())})("info",function(){O(t);let r=v(2);return r.itemInfo(r.overlay().id,r.overlay().type),F(r.popoverClosed())})("closed",function(){O(t);let r=v(2);return F(r.popoverClosed())}),h()}if(n&2){let t=v(2);w("canClose",t.app.config.map.popoverMulti)("title",t.overlay().title)("resource",t.overlay().resourceSet)}}function dve(n,e){if(n&1){let t=H();u(0,"div")(1,"vessel-popover",88),T("info",function(){O(t);let r=v(2);return r.itemInfo(r.overlay().id,r.overlay().type,r.overlay().isSelf),F(r.popoverClosed())})("focused",function(r){O(t);let o=v(2);return F(o.setActiveVessel(r?o.overlay().id:null))})("markPosition",function(r){O(t);let o=v(2);return o.skres.newWaypointAt(r),F(o.popoverClosed())})("closed",function(){O(t);let r=v(2);return F(r.popoverClosed())}),h()()}if(n&2){let t=v(2);f(),w("canClose",t.app.config.map.popoverMulti)("vessel",t.overlay().vessel)("useMagnetic",t.app.useMagnetic)("isActive",t.app.data.vessels.activeId===t.overlay().id)("isSelf",t.overlay().isSelf)}}function uve(n,e){if(n&1){let t=H();u(0,"aton-popover",89),T("info",function(){O(t);let r=v(2);return r.itemInfo(r.overlay().id,r.overlay().type),F(r.popoverClosed())})("closed",function(){O(t);let r=v(2);return F(r.popoverClosed())}),h()}if(n&2){let t=v(2);w("canClose",t.app.config.map.popoverMulti)("aton",t.overlay().aton)}}function pve(n,e){if(n&1){let t=H();u(0,"aircraft-popover",90),T("info",function(){O(t);let r=v(2);return r.itemInfo(r.overlay().id,r.overlay().type),F(r.popoverClosed())})("closed",function(){O(t);let r=v(2);return F(r.popoverClosed())}),h()}if(n&2){let t=v(2);w("canClose",t.app.config.map.popoverMulti)("aircraft",t.overlay().aircraft)}}function hve(n,e){if(n&1){let t=H();u(0,"route-point-popover",91),T("rejoin",function(r){O(t);let o=v(2);return o.rejoinRouteAt(r),F(o.popoverClosed())})("skip",function(r){O(t);let o=v(2);return o.skipRoutePoint(r),F(o.popoverClosed())})("closed",function(){O(t);let r=v(2);return F(r.popoverClosed())}),h()}if(n&2){let t=v(2);w("canClose",t.app.config.map.popoverMulti)("point",t.overlay().routePoint)}}function mve(n,e){if(n&1){let t=H();u(0,"alarm-popover",92),T("info",function(){O(t);let r=v(2);return r.itemInfo(r.overlay().id,r.overlay().type),F(r.popoverClosed())})("goto",function(r){O(t);let o=v(2);return o.onContextMenuAction("nav_to",r),F(o.popoverClosed())})("closed",function(){O(t);let r=v(2);return F(r.popoverClosed())}),h()}if(n&2){let t=v(2);w("canClose",t.app.config.map.popoverMulti)("alarm",t.overlay().alarm)("id",t.overlay().id)}}function fve(n,e){if(n&1&&(u(0,"ol-overlay",29),R(1,Qye,1,3,"ap-popover",59),R(2,Jye,1,2,"chart-list-popover",60),R(3,eve,1,3,"feature-list-popover",61),R(4,tve,1,2,"s57-popover",62),R(5,ave,4,6,"ap-popover",63),R(6,sve,15,4,"ap-popover",64),R(7,lve,1,9,"resource-popover",65),R(8,cve,1,3,"resourceset-popover",66),R(9,dve,2,5,"div"),R(10,uve,1,2,"aton-popover",67),R(11,pve,1,2,"aircraft-popover",68),R(12,hve,1,2,"route-point-popover",69),R(13,mve,1,3,"alarm-popover",70),h()),n&2){let t=v();w("position",t.overlay().position)("worldOffset",t.overlay().worldOffset??0)("positioning","top-center"),f(),A(t.mapInteract.isMeasuring()?1:-1),f(),A(t.overlay().type==="chartlist"?2:-1),f(),A(t.overlay().type==="list"?3:-1),f(),A(t.overlay().type==="s57"?4:-1),f(),A(t.overlay().type==="trackhistory"?5:-1),f(),A(t.overlay().type==="tidal"?6:-1),f(),A(t.overlay().type==="destination"||t.overlay().type==="waypoint"||t.overlay().type==="route"||t.overlay().type==="note"||t.overlay().type==="region"?7:-1),f(),A(t.overlay().type==="rset"?8:-1),f(),A(t.overlay().type==="ais"?9:-1),f(),A(t.overlay().type==="aton"||t.overlay().type==="meteo"?10:-1),f(),A(t.overlay().type==="aircraft"?11:-1),f(),A(t.overlay().type==="rtept"?12:-1),f(),A(t.overlay().type==="alarm"?13:-1)}}function gve(n,e){if(n&1&&z(0,"fb-anchor-alarm",30),n&2){let t=v();w("radius",t.anchor.radius())("anchorPosition",t.anchor.position())("vesselPosition",t.dfeat.self.position)("anchorStyles",t.featureStyles.anchor)("zIndex",300)}}function _ve(n,e){if(n&1&&z(0,"fb-cpa-alarms",31),n&2){let t=v();w("cpaLines",t.dfeat.closest)("zIndex",350)}}function yve(n,e){if(n&1&&z(0,"fb-xte-path",93),n&2){let t=v(2);w("startPosition",t.dfeat.navData.startPosition)("destPosition",t.dfeat.navData.position)("zIndex",340)("visible",!0)}}function vve(n,e){if(n&1&&z(0,"fb-target-angle",95)(1,"fb-layline",96),n&2){let t=v(2);w("line",t.perfTargetAngle())("lineStyle",t.featureStyles.targetAngle)("position",t.app.data.vessels.active.position)("twd",t.trueWindDirection(t.app.data.vessels.self))("mapZoom",t.mapZoomLevel())("zIndex",345),f(),w("lines",t.perfLaylines())("laylineStyles",t.featureStyles.layline)("position",t.app.data.vessels.active.position)("twd",t.trueWindDirection(t.app.data.vessels.self))("mapZoom",t.mapZoomLevel())("zIndex",330)}}function bve(n,e){if(n&1&&z(0,"fb-bearing-line",58),n&2){let t=v(2);w("markerPosition",t.dfeat.navData.position)("vesselPosition",t.dfeat.active.position)("showMarker",!t.app.data.activeWaypoint)("markerName",t.course.courseData().destPointName)("bearingStyles",t.featureStyles.destination)("labelMinZoom",t.app.config.map.labelsMinZoom)("mapZoom",t.mapZoomLevel())("zIndex",335)}}function xve(n,e){if(n&1&&z(0,"fb-arrival-circle",94),n&2){let t=v(2);w("radius",t.course.courseData().arrivalCircle)("position",t.dfeat.navData.position)("zIndex",335)}}function Cve(n,e){if(n&1&&(R(0,yve,1,4,"fb-xte-path",93),R(1,vve,2,12),R(2,bve,1,8,"fb-bearing-line",58),R(3,xve,1,3,"fb-arrival-circle",94)),n&2){let t=v();A(t.dfeat.navData.startPosition?0:-1),f(),A(t.app.config.vessels.laylines&&t.perfTargetAngle().length!==0?1:-1),f(),A(t.dfeat.navData.position?2:-1),f(),A(t.course.courseData().arrivalCircle?3:-1)}}function wve(n,e){if(n&1&&z(0,"fb-range-circles",33),n&2){let t=v();w("position",t.dfeat.active.position)("maxCircles",t.app.config.vessels.rangeCircleCount)("fixedMode",t.app.config.vessels.rangeCirclesFixed)("fixedDistance",t.app.config.vessels.rangeCirclesDistance)("mapZoom",t.mapZoomLevel())("darkMode",t.app.uiConfig().invertColor)("minZoom",t.app.config.vessels.rangeCircleMinZoom)("units",t.scaleUnits())("zIndex",340)}}function Mve(n,e){if(n&1&&z(0,"fb-heading-line",34),n&2){let t=v();w("coords",t.vesselLines().heading)("lineStyle",t.app.selfLines().heading)("mapZoom",t.mapZoomLevel())("zIndex",344)}}function Sve(n,e){if(n&1&&z(0,"fb-cog-line",35),n&2){let t=v();w("coords",t.vesselLines().cog)("cogTime",t.app.config.vessels.selfLines.cog.length)("lineStyle",t.app.selfLines().cog)("units",t.app.config.units.distance)("darkMode",t.app.uiConfig().invertColor)("labelMinZoom",t.app.config.map.labelsMinZoom)("mapZoom",t.mapZoomLevel())("zIndex",345)}}function Tve(n,e){if(n&1&&z(0,"fb-wind-lines",36),n&2){let t=v();w("twd",t.trueWindDirection(t.dfeat.active))("tws",t.dfeat.active.wind.tws)("awa",t.dfeat.active.wind.awa+t.dfeat.active.orientation)("aws",t.dfeat.active.wind.aws)("position",t.dfeat.self.position)("zIndex",350)}}function Eve(n,e){if(n&1&&z(0,"fb-vessel-trail",38),n&2){let t=v();w("localTrail",t.app.selfTrail())("serverTrail",t.app.selfTrailFromServer())("zIndex",990)}}function Ive(n,e){if(n&1&&(u(0,"ol-overlay",41),z(1,"div",97),h()),n&2){let t=e.$implicit;w("position",t.position)("worldOffset",t.worldOffset)("positioning","center-center")("stopEvent",!1),f(),vt("animation-duration",t.fadeMs+"ms")}}function kve(n,e){if(n&1&&z(0,"fb-chart-bounds",42),n&2){let t=v();w("zIndex",250)("charts",t.app.data.chartBounds.charts)("layerProperties",kr(3,bye))}}function Dve(n,e){if(n&1){let t=H();u(0,"button",101),T("contextmenu",function(r){return r.preventDefault()})("click",function(){O(t);let r=v().item,o=v();return F(o.onContextMenuAction("nav_to",r))}),u(1,"mat-icon"),_(2,"near_me"),h(),_(3," Navigate to here "),h()}}function Pve(n,e){if(n&1){let t=H();u(0,"button",102),T("click",function(){O(t);let r=v().item,o=v();return F(o.onContextMenuAction("cleardestination",r))}),u(1,"mat-icon"),_(2,"clear_all"),h(),u(3,"span"),_(4,"Stop Navigating"),h()()}}function Rve(n,e){n&1&&z(0,"mat-divider")}function Ave(n,e){if(n&1){let t=H();u(0,"button",99),T("click",function(){O(t);let r=v().item,o=v();return F(o.onContextMenuAction("add_note",r))})("contextmenu",function(r){return r.preventDefault()}),u(1,"mat-icon"),_(2,"local_offer"),h(),_(3," Add Note here "),h()}}function Lve(n,e){if(n&1){let t=H();u(0,"button",101),T("contextmenu",function(r){return r.preventDefault()})("click",function(){O(t);let r=v().item,o=v();return F(o.onContextMenuAction("bearing_dist",r))}),u(1,"mat-icon"),_(2,"arrow_right_alt"),h(),_(3," Bearing & Distance "),h()}}function Ove(n,e){if(n&1){let t=H();u(0,"button",102),T("click",function(){O(t);let r=v().item,o=v();return F(o.onContextMenuAction("cleartrail",r))}),u(1,"mat-icon"),_(2,"clear_all"),h(),u(3,"span"),_(4),h()()}if(n&2){let t=v(2);f(4),K("",t.app.data.serverTrail?"Refresh":"Clear"," Trail")}}function Fve(n,e){if(n&1){let t=H();u(0,"button",102),T("click",function(){O(t);let r=v().item,o=v();return F(o.onContextMenuAction("weather_forecast",r))}),u(1,"mat-icon"),_(2,"air"),h(),u(3,"span"),_(4,"Weather Forecast"),h()()}}function Nve(n,e){if(n&1){let t=H();u(0,"button",102),T("click",function(){O(t);let r=v().item,o=v();return F(o.onContextMenuAction("get_feature_info",r))}),u(1,"mat-icon"),_(2,"info"),h(),u(3,"span"),_(4,"Get Feature Info"),h()()}}function Bve(n,e){if(n&1){let t=H();z(0,"mat-divider"),u(1,"button",99),T("click",function(){O(t);let r=v().item,o=v();return F(o.onContextMenuAction("add_widget",r))})("contextmenu",function(r){return r.preventDefault()}),u(2,"mat-icon"),_(3,"widgets"),h(),_(4," Add widget here "),h()}}function Vve(n,e){if(n&1){let t=H();R(0,Dve,4,0,"button",98),R(1,Pve,5,0,"button",98),R(2,Rve,1,0,"mat-divider"),u(3,"button",99),T("click",function(){let r=O(t).item,o=v();return F(o.onContextMenuAction("add_wpt",r))})("contextmenu",function(r){return r.preventDefault()}),u(4,"mat-icon",100),_(5,"add_location"),h(),_(6," Add Waypoint here "),h(),R(7,Ave,4,0,"button",98),z(8,"mat-divider"),R(9,Lve,4,0,"button",98),u(10,"button",99),T("click",function(){let r=O(t).item,o=v();return F(o.onContextMenuAction("measure",r))})("contextmenu",function(r){return r.preventDefault()}),u(11,"mat-icon"),_(12,"straighten"),h(),_(13," Measure "),h(),z(14,"mat-divider"),R(15,Ove,5,1,"button",98),u(16,"button",99),T("click",function(){let r=O(t).item,o=v();return F(o.onContextMenuAction("trail2route",r))})("contextmenu",function(r){return r.preventDefault()}),u(17,"mat-icon"),_(18,"insights"),h(),_(19," Trail to Route "),h(),z(20,"mat-divider"),u(21,"button",99),T("click",function(){let r=O(t).item,o=v();return F(o.onContextMenuAction("anchor",r))})("contextmenu",function(r){return r.preventDefault()}),u(22,"mat-icon"),_(23,"anchor"),h(),_(24," Anchor Watch "),h(),R(25,Fve,5,0,"button",98),R(26,Nve,5,0,"button",98),R(27,Bve,5,0)}if(n&2){let t=v();A(t.app.data.vessels.showSelf?0:-1),f(),A(t.course.courseData().position?1:-1),f(),A(t.app.data.vessels.showSelf||t.course.courseData().position?2:-1),f(5),A(t.mapZoomLevel()>=t.app.config.resources.notes.minZoom?7:-1),f(2),A(t.app.data.vessels.showSelf?9:-1),f(6),A(t.app.config.vessels.trail&&t.app.selfTrail().length!==0?15:-1),f(10),A(t.app.featureFlags().weatherApi?25:-1),f(),A(t.app.config.experiments&&t.mapService.featureUrls().length?26:-1),f(),A(t.addableWidgetCell?27:-1)}}var Gve=2e3,Vk=class n{setFocus;mapCenter=[0,0];mapZoom=1;movingMap=!1;northUp=!0;measureMode;drawMode;modifyMode=!1;activeRoute;vesselTrail=[];dblClickZoom=!1;overZoomTiles=!0;drawEnded=new me;activate=new me;deactivate=new me;info=new me;exitMovingMap=new me;resumeMovingMap=new me;focusVessel=new me;menuItemSelected=new me;contextMenu;olMap;routeDraw;scaleUnits=Z("");perfLaylines=$({port:[],starboard:[]});perfTargetAngle=$([]);vesselLines=$({cog:[],heading:[]});overlay=$({id:null,type:null,icon:null,position:[0,0],show:!1,title:"",content:null,featureCount:0,readOnly:!1,isSelf:!1});olMapControls=Pj;trueWindDirection=rf;olMapInteractions=$([]);mapZoomLevel=$(1);mapZoomText=Qe(()=>NV(this.mapZoomLevel()));mapCenterPositon=$([0,0]);mapRotation=$(0);showNoteslayer=$(!1);featureStyles={route:Lj,region:Nj,anchor:Fj,alarm:Bj,destination:Vj,aircraft:Gj,sar:zj,layline:jj,targetAngle:Uj,raceCourse:Aj,bearingDistance:Rj};draftRouteStyles=Oj;bufferRoutes=Qe(()=>this.routeBuffers.live().filter(e=>!e.saved||e.dirty).map(e=>this.bufferToFBRoute(e)));dfeat={aircraft:new Map,atons:new Map,sar:new Map,meteo:new Map,self:new Ad,ais:new Map,active:new Ad,navData:{position:null,startPosition:null},closest:[]};saveTimer;isDirty=!1;userPanned=!1;offsetGraceTimer;lastMoveCenter=null;refollow=new Dw(()=>this.ngZone.run(()=>this.resumeMovingMap.emit()));offsetSuppressed=!1;clickWorldOffset=0;clickMercX=0;mouse=$({pixel:null,coords:[0,0],xy:null});cursorInfo=$(null);cursorPin=new wC(()=>this.cursorInfo.set(null));cursorMarkers=Qe(()=>{let e=this.cursorPin.marker();return e?[e]:[]});pointerDownAt=0;contextMenuPosition={x:"0px",y:"0px"};addableWidgetCell=null;obsList=[];http=M(Sa);app=M(oe);skres=M(Mt);skresOther=M(dg);skstream=M(es);anchor=M(hg);notiMgr=M(ul);plotterExt=M(zu);course=M(Wr);mapInteract=M(Tc);mapService=M(ys);settings=M(Wf);bottomSheet=M(Qu);infoPanel=M(Ic);routeBuffers=M(pl);tidalCurrents=M(Rd);trackHistory=M(Uu);aisTrackMinZoom=Y1;ngZone=M(Wi);constructor(){Me(()=>{this.scaleUnits()&&this.setScaleUnits()}),this.toggleDblClickZoom()}ngAfterViewInit(){this.setScaleUnits(),setTimeout(()=>{this.setFocus="xxx"},500)}ngOnInit(){this.obsList.push(this.skstream.vessels$().subscribe(()=>this.onVessels())),this.obsList.push(this.settings.change$.subscribe(e=>{this.renderMapContents(e.includes("fetchNotes")),e.includes("trailSource")&&(this.app.serverTrailWanted()||this.app.selfTrailFromServer.update(()=>[]))}))}ngOnDestroy(){this.stopSaveTimer(),this.stopOffsetGrace(),this.refollow.cancel(),this.cursorPin.release(),this.obsList.forEach(e=>e.unsubscribe())}ngOnChanges(e){e.vesselTrail&&this.drawVesselLines(),e&&e.mapCenter&&e.mapCenter.currentValue&&this.mapCenterPositon.set(e.mapCenter.currentValue),e&&e.mapZoom&&typeof e.mapZoom.currentValue=="number"&&(this.mapZoomLevel.set(e.mapZoom.currentValue),this.renderMapContents(!0)),e&&e.movingMap&&!e.movingMap.firstChange&&(e.movingMap.currentValue?(this.refollow.cancel(),this.startSaveTimer(),this.startOffsetGrace()):(this.stopSaveTimer(),this.stopOffsetGrace(),this.userPanned=!1)),e&&e.northUp&&this.rotateMap(),e&&e.measureMode&&this.applyInteractionMode(0,e.measureMode.currentValue),e&&e.drawMode&&this.applyInteractionMode(1,e.drawMode.currentValue),e&&e.modifyMode&&!e.modifyMode.firstChange&&this.applyInteractionMode(2,e.modifyMode.currentValue),e&&e.dblClickZoom&&this.toggleDblClickZoom(e.dblClickZoom.currentValue)}setScaleUnits(){try{let e=["kilometer","m"].includes(this.scaleUnits())?"metric":"nautical";this.olMap.getMap().getControls().getArray()[0].setUnits(e)}catch(e){}}wmsParams(e){return{LAYERS:e.layers?e.layers.join(","):""}}startSaveTimer(){this.saveTimer||(this.saveTimer=setInterval(()=>{this.isDirty&&(this.app.saveConfig(),this.isDirty=!1)},3e4))}stopSaveTimer(){this.saveTimer&&(clearInterval(this.saveTimer),this.saveTimer=null)}onVessels(){let e=this.dfeat.self.position;this.dfeat.self=this.app.data.vessels.self,(!this.dfeat.self.position||!Array.isArray(this.dfeat.self.position))&&(this.dfeat.self.position=e),this.dfeat.ais=this.app.data.vessels.aisTargets,this.dfeat.aircraft=this.app.data.aircraft,this.dfeat.sar=this.app.data.sar,this.dfeat.meteo=this.app.data.meteo,this.dfeat.atons=this.app.data.atons,this.dfeat.active=this.app.data.vessels.active,this.dfeat.navData.position=this.course.courseData().position,this.dfeat.navData.startPosition=this.course.courseData().startPosition;let t=()=>{let i=[];return this.app.data.vessels.self.position&&this.app.data.vessels.closest.forEach(r=>{if(this.app.data.vessels.aisTargets.has(r)){let o=this.app.data.vessels.aisTargets.get(r);o.position&&i.push([o.position,this.app.data.vessels.self.position])}}),i};this.dfeat.closest=t(),this.dfeat.self.positionReceived&&(this.app.data.vessels.showSelf=!0),this.overlay().show&&["ais","aton","aircraft"].includes(this.overlay().type)&&(this.overlay().isSelf?this.overlay.update(i=>Object.assign({},i,{position:this.dfeat.self.position,vessel:this.dfeat.self})):this.overlay().type==="ais"&&!this.dfeat.ais.has(this.overlay().id)||this.overlay().type==="atons"&&!this.dfeat.atons.has(this.overlay().id)||this.overlay().type==="aircraft"&&!this.dfeat.aircraft.has(this.overlay().id)?this.overlay().show=!1:this.overlay().type==="ais"&&this.overlay.update(i=>Object.assign({},i,{position:this.dfeat.ais.get(i.id).position,vessel:this.dfeat.ais.get(i.id)}))),this.drawVesselLines(this.app.data.vessels.self.positionReceived),this.rotateMap(),this.movingMap&&this.centerVessel()}handleRadarError(e){this.app.showAlert("Radar",e.message),this.app.uiCtrl.update(t=>Object.assign(t,{radarLayer:!1}))}toggleDblClickZoom(e){let t=[{name:"dragpan"},{name:"dragzoom"},{name:"keyboardpan"},{name:"mousewheelzoom"},{name:"pinchzoom"}];this.olMapInteractions.update(()=>e?[{name:"doubleclickzoom"}].concat(t):[].concat(t))}onContextMenuAction(e,t){switch(e){case"add_wpt":this.skres.newWaypointAt(t);break;case"add_note":this.skres.showNoteEditor({position:t});break;case"nav_to":this.app.data.activeWaypoint=null,this.course.courseData().pointNames=[],this.course.setDestination({latitude:t[1],longitude:t[0]});break;case"bearing_dist":this.formatPopover("bearing_dist",t);break;case"weather_forecast":this.bottomSheet.open(Lw,{disableClose:!0,data:{title:"Forecast",position:t,subTitle:"Location: Cursor Position"}});break;case"measure":this.mapInteract.startMeasuring();break;case"add_widget":this.addableWidgetCell&&this.plotterExt.openAddWidgetPicker(this.addableWidgetCell.anchor,this.addableWidgetCell.cell);break;case"get_feature_info":this.getFeatureInfo();break;default:this.menuItemSelected.emit(e);break}}onMapReady(){let e=this.olMap?.getMap()?.getView().getZoom();typeof e=="number"&&(this.skstream.postMapView(this.olMap.getMapExtent(),e),this.trackHistory.setView(this.olMap.getMapExtent(),e))}onMapMoveEnd(e){if(this.app.config.map.zoomLevel=e.zoom,this.app.mapZoom.set(e.zoom),this.app.mapExtent.update(()=>e.extent),this.skstream.postMapView(e.extent,e.zoom),this.trackHistory.setView(e.extent,e.zoom),this.app.mapViewTopCenter.update(()=>e.topCenter),this.app.mapViewRightCenter.update(()=>e.rightCenter),this.app.mapViewRotation.update(()=>e.rotation),this.app.config.map.center=e.lonlat,this.userPanned){this.userPanned=!1,this.stopOffsetGrace();let t=this.app.applyPanGesture(e.lonlat);t==="release"?this.exitMovingMap.emit(!0):t==="adopted"&&this.app.saveConfigDebounced()}Ij(e,this.lastMoveCenter)&&this.refollow.reset(),this.lastMoveCenter=e.lonlat,this.drawVesselLines(),this.movingMap?this.isDirty=!0:(this.app.saveConfigDebounced(),this.isDirty=!1),this.renderMapContents(e.zoomChanged)}onMapPointerMove(e){if(this.mouse.set({pixel:e.pixel,xy:e.coordinate,coords:ri.normaliseCoords(e.lonlat)}),this.updateCursorInfo(e.lonlat),this.mapInteract.isMeasuring()){if(this.mapInteract.measureGeometryType==="LineString"&&this.mapInteract.measurement().coords.length!==0){let t=e.lonlat,i=this.mapInteract.distanceFromLastPoint(t),r=(0,y1.getGreatCircleBearing)(this.mapInteract.measurement().coords.slice(-1)[0],t);this.overlay.update(o=>Object.assign({},o,{position:t,worldOffset:e.worldOffset??0,title:`${this.app.formatValueForDisplay(i,"m")} ${this.app.formatValueForDisplay(r,"deg")}`}))}else if(this.mapInteract.measureGeometryType==="Circle"){let t=e.lonlat,i=this.mapInteract.distanceFromCenter(t),r=(0,y1.getGreatCircleBearing)(this.mapInteract.measurement().center??t,t);this.overlay.update(o=>Object.assign({},o,{position:t,worldOffset:e.worldOffset??0,title:`${this.app.formatValueForDisplay(i,"m")} ${this.app.formatValueForDisplay(r,"deg")}`}))}}}onMapPointerDrag(){this.onUserPan()}onUserPan(){this.refollow.reset(),this.app.uiConfig().mapMove&&(this.app.config.map.panBehavior==="exit"?(this.ngZone.run(()=>this.exitMovingMap.emit(!0)),this.refollow.arm(this.app.config.map.refollowDelay)):this.app.config.map.panBehavior==="offset"&&(this.userPanned=!0))}updateCursorInfo(e,t=!1){if(this.cursorPin.active&&!t)return;let i=this.app.data.vessels.self;if(!this.app.config.display.statusBar?.liveEta||!i?.positionReceived||!i.position){this.cursorInfo.set(null);return}let r=Ue.transform(1,"m/s",this.app.config.units.speed)??1,o=this.app.config.display.statusBar.referenceSpeed,a=r>0&&typeof o=="number"?o/r:0;this.cursorInfo.set(Dj(i.position,e,i.sog,a))}pinCursorAtTap(e,t){!this.app.config.display.statusBar?.liveEta||Date.now()-this.pointerDownAt>KV||(this.cursorPin.pin(e,t,qV(this.app.config.display.statusBar.tapFadeSpeed)),this.updateCursorInfo(e,!0))}onMapPointerDown(e){this.pointerDownAt=Date.now(),this.mouse.update(t=>st(ne({},t),{coords:ri.normaliseCoords(e.lonlat)})),this.contextMenuPosition.x=e.originalEvent.clientX+"px",this.contextMenuPosition.y=e.originalEvent.clientY+"px"}onMapSingleClick(e){this.clickWorldOffset=e.worldOffset??0,this.clickMercX=lt(e.lonlat)[0]+this.clickWorldOffset,this.app.data.map.atClick={features:e.features,lonlat:e.lonlat},this.mapInteract.isMeasuring()?this.parseClickInMeasureMode(e.lonlat):this.mapInteract.isDrawing()&&this.mapInteract.draw.resourceType==="route"?this.onDrawClick(e.features):this.mapInteract.isModifying()&&this.mapInteract.draw.resourceType==="route"?this.extendRouteInModify(e):!this.mapInteract.isDrawing()&&!this.mapInteract.isModifying()&&(this.app.config.map.popoverMulti||this.overlay.update(t=>Object.assign({},t,{show:!1})),this.processMapClick(e),this.pinCursorAtTap(e.lonlat,e.worldOffset??0))}onMapRightClick(e){let t=e.lonlat;this.clickWorldOffset=e.worldOffset??0,this.clickMercX=lt(t)[0]+this.clickWorldOffset,this.app.data.map.atClick={features:e.features,lonlat:t},this.app.debug("onRightClick()",this.app.data.map.atClick),this.mapInteract.isMeasuring()&&this.parseClickInMeasureMode(t)}onMapContextMenu(e){this.app.debug("onMapContextMenu()",this.app.data.map.atClick),this.onContextMenu(e)}onContextMenu(e){if(this.app.debug("onContextMenu()",this.app.data.map.atClick),!(this.app.uiCtrl().suppressContextMenu||this.overlay().show)&&(e.preventDefault(),this.contextMenuPosition.x=e.clientX+"px",this.contextMenuPosition.y=e.clientY+"px",this.addableWidgetCell=this.plotterExt.addableCellAt(e.clientX,e.clientY),this.contextMenu.menuData={item:this.mouse().coords},!this.mapInteract.isMeasuring())){if(!this.modifyMode){if(!this.mouse().xy)return;this.contextMenu.openMenu(),document.getElementsByClassName("cdk-overlay-backdrop")[0].addEventListener("contextmenu",t=>{t.preventDefault(),this.contextMenu.closeMenu()})}}}parseClickInMeasureMode(e){this.mapInteract.measureGeometryType==="LineString"&&this.mapInteract.measurement().coords.length!==0&&this.onMeasureClick(e)}toggleFeatureSelection(e,t){t==="charts"&&this.skres.chartSelected(e)}onDragBoxStart(e){let t=un(e.coordinate);this.mapInteract.initBoxCoord(t)}onDragBoxEnd(e){let t=un(e.coordinate);this.mapInteract.stopBoxSelection(t)}onDragBoxCancel(){this.app.debug("onDragBoxCancel()..."),this.mapInteract.stopBoxSelection()}onMeasureStart(e){this.app.debug("onMeasureStart()...",this.mapInteract.measureGeometryType);let t;if(this.mapInteract.measureGeometryType==="LineString"){let i=e.feature.getGeometry().getCoordinates().map(r=>un(r));i=i.slice(0,i.length-1),this.mapInteract.measurementCoords=i,t=i}else{let i=e.feature.getGeometry(),r=un(i.getCenter()),o=i.getRadius();this.mapInteract.measurementCenter=r,this.mapInteract.measurementRadius=o,t=this.mapInteract.measurementCenter,this.app.debug(this.mapInteract.measurement)}this.formatPopover(null,null),this.overlay.update(i=>Object.assign({},i,{position:t,title:"0",show:!0,type:"measure"}))}onMeasureClick(e){if(this.app.debug("onMeasureClick()..."),!Array.isArray(e))return;let t=this.mapInteract.measurement().coords[this.mapInteract.measurement().coords.length-1];if(e[0]===t[0]&&e[1]===t[1])return;let i=this.mapInteract.addMeasurementCoord(e),r=this.mapInteract.measurement().coords.slice(-2),o=(0,y1.getGreatCircleBearing)(r[0],r[1])??0;this.overlay.update(a=>Object.assign({},a,{position:e,title:`${this.app.formatValueForDisplay(i,"m")} ${this.app.formatValueForDisplay(o,"deg")}`}))}onMeasureEnd(){this.app.debug("onMeasureEnd()..."),this.overlay.update(e=>Object.assign({},e,{show:!1})),this.mapInteract.stopMeasuring()}onDrawClick(e){if(Array.isArray(e)&&this.mapInteract.draw.resourceType==="route"){let t;e.forEach(i=>{i.getGeometry().getType()==="LineString"&&(t=i.getGeometry().getCoordinates().map(r=>un(r)),t=t.slice(0,t.length-1))}),this.mapInteract.measurementCoords=t}}finishDrawing(){this.routeDraw?.finishDrawing()}undoInteraction(){this.mapInteract.isDrawing()?this.undoDrawPoint():this.mapInteract.isModifying()&&this.undoModify()}undoDrawPoint(){this.routeDraw?.removeLastPoint();let e=this.mapInteract.measurement().coords;this.mapInteract.measurementCoords=e.slice(0,Math.max(0,e.length-1))}undoModify(){let e=this.mapInteract.popModifyUndo();if(!e)return;let t=this.mapInteract.draw.features?.getArray()[0];if(!t)return;let i=t.getGeometry().getCoordinates();t.getGeometry().setCoordinates(e.coordinates),t.set("pointMetadata",e.coordsMetadata??null),this.mapInteract.draw.coordinates=e.coordinates,this.mapInteract.draw.forSave.coordsMetadata=e.coordsMetadata;let r=this.transformCoordsArray(e.coordinates);this.mapInteract.draw.forSave.coords=r,this.mapInteract.measurementCoords=r,this.mapInteract.measurementIndex=Pw(i,e.coordinates)}onDrawEnd(e){this.ngZone.run(()=>{this.mapInteract.stopDrawing(e.feature),this.drawEnded.emit(this.mapInteract.draw)})}getUnsavedRouteBuffer(e){let t=this.routeBuffers.get(e);return t&&(!t.saved||t.dirty)?t:void 0}bufferToFBRoute(e){let t=new Ts;t.name=e.name??"",t.description=e.description??"",t.feature.geometry.coordinates=e.points.map(r=>r.position);let i=sg(e.points);return i&&(t.feature.properties.coordinatesMeta=i),t.distance=ri.routeLength(t.feature.geometry.coordinates),[e.routeId,t,!0]}isUnsavedRoute(){if(this.overlay().type!=="route")return!1;let e=this.routeBuffers.get(this.overlay().id);return!!e&&(!e.saved||e.dirty)}isDraftRoute(){if(this.overlay().type!=="route")return!1;let e=this.routeBuffers.get(this.overlay().id);return!!e&&!e.saved}saveRouteFromPopover(){return Y(this,null,function*(){try{yield this.plotterExt.saveBuffer(this.overlay().id,{dialog:!0,promote:!0})}catch(e){}})}modifyFeature(e){if(this.mapInteract.draw.features.getLength()===0)return;let t=this.mapInteract.draw.features.getArray()[0]?.getGeometry();if(t){let i=t.getExtent(),r=(i[0]+i[2])/2,o=Mm(this.clickMercX-r,_1);o&&this.mapInteract.draw.features.forEach(a=>a.getGeometry()?.translate(o,0))}if(this.mapInteract.startModifying(this.overlay()),this.overlay().type==="route"){let i=this.overlay().id,r=this.overlay().resource;this.mapInteract.draw.name=Array.isArray(r)?r[1]?.name??"":"",this.mapInteract.measurementCoords=this.routeBuffers.has(i)?this.routeBuffers.get(i).points.map(o=>o.position):this.skres.fromCache("routes",i)[1].feature.geometry.coordinates}e==="anchor"&&(this.overlay().type=e,this.mapInteract.draw.forSave.id=e)}onModifyStart(e){let t=e.features.getArray()[0];if(this.mapInteract.draw.coordinates=t.getGeometry().getCoordinates(),this.mapInteract.draw.forSave.id||(this.mapInteract.draw.forSave.id=t.getId()),t.getGeometry().getType()==="LineString"){let i=t.get("pointMetadata");i&&(this.mapInteract.draw.forSave.coordsMetadata=i)}}onModifyEnd(e){this.ngZone.run(()=>this.applyModifyEnd(e))}applyModifyEnd(e){let t=e.features.getArray()[0],i=t.getId(),r=t.getGeometry().getCoordinates();if(i.split(".")[0]==="route"){let a=this.mapInteract.draw.forSave.coordsMetadata;this.mapInteract.pushModifyUndo({coordinates:this.mapInteract.draw.coordinates.map(s=>[...s]),coordsMetadata:a?a.map(s=>ne({},s)):void 0})}t.getGeometry().getType()==="LineString"&&this.updateCoordsMeta(this.mapInteract.draw.coordinates,r,this.mapInteract.draw.forSave.coordsMetadata);let o;if(i.split(".")[0]==="route")o=this.transformCoordsArray(r),this.mapInteract.measurementCoords=o,this.mapInteract.measurementIndex=Pw(this.mapInteract.draw.coordinates,r);else if(i.split(".")[0]==="region"){for(let a=0;a<r.length;a++)if(this.isCoordsArray(r[a]))r[a]=this.transformCoordsArray(r[a]);else for(let s=0;s<r[a].length;s++)this.isCoordsArray(r[a][s])?r[a][s]=this.transformCoordsArray(r[a][s]):console.log("Invalid polygon coordinates!");o=r}else o=un(r),i==="anchor"&&this.anchor.setAnchorPosition(o).catch(a=>{this.app.parseHttpErrorResponse(a)});this.mapInteract.draw.forSave.coords=o,this.app.data.activeRoute&&this.mapInteract.draw.forSave.id.indexOf(this.app.data.activeRoute)!==-1?this.app.data.activeRouteIsEditing=!0:this.app.data.activeRouteIsEditing=!1,this.app.data.editingId=this.mapInteract.draw.forSave.id,this.app.debug(this.mapInteract.draw.forSave)}extendRouteInModify(e){let t=this.mapInteract.draw.features?.getArray()[0],i=t?.getGeometry();if(!t||i?.getType()!=="LineString")return;let r=i,o=Tp(e.originalEvent?.pointerType,10,15),a=this.olMap.getMap().getFeaturesAtPixel(e.pixel,{hitTolerance:o}).some(p=>p.getId()===t.getId());if(!Wj({onRoute:a,vertexDeleted:jA(this.olMap.getMap())}))return;let s=this.mapInteract.draw.forSave.coordsMetadata;if(!s){let p=t.get("pointMetadata");s=Array.isArray(p)?p:void 0}let l=r.getExtent(),c=Hj(r.getCoordinates(),s,lt(e.lonlat),l[0],l[2]);this.mapInteract.pushModifyUndo(c.undo),r.setCoordinates(c.after),c.meta&&t.set("pointMetadata",c.meta),this.mapInteract.draw.forSave.id||(this.mapInteract.draw.forSave.id=t.getId()),this.mapInteract.draw.forSave.coordsMetadata=c.meta,this.mapInteract.draw.coordinates=c.after;let d=this.transformCoordsArray(c.after);this.mapInteract.draw.forSave.coords=d,this.mapInteract.measurementCoords=d,this.mapInteract.measurementIndex=Pw(c.undo.coordinates,c.after),this.app.data.activeRouteIsEditing=!!this.app.data.activeRoute&&this.mapInteract.draw.forSave.id.indexOf(this.app.data.activeRoute)!==-1,this.app.data.editingId=this.mapInteract.draw.forSave.id}activeRoutePoint(e){let t=this.course.courseData(),i=Yp(e,t.pointTotal,this.app.data.activeRouteReversed);return{index:e,total:t.pointTotal,name:t.pointNames?.[i]||void 0,position:t.activeRoutePoints?.[i],isNext:e===t.pointIndex}}activeRouteHasUnsavedEdits(){return ag(this.routeBuffers.getForRoute(this.activeRoute))}activeRoutePointAt(e,t,i){let r=t.getGeometry();if(!this.activeRoute||i!==this.activeRoute||!(r instanceof Nt)||this.activeRouteHasUnsavedEdits())return null;let o=r.getCoordinates(),a=YG(o,e.coordinate,e.map.getView().getResolution(),e.originalEvent?.pointerType==="touch"?hk.touch:hk.mouse,_1);return a.length?QG(a.map(s=>Yp(s,o.length,this.app.data.activeRouteReversed)),this.course.courseData().pointIndex):null}processMapClick(e){this.s57Features={},this.trackHistoryFeatures={};let t=new Map,i=new Map,r=[],o=!1;if(e.features.forEach(a=>{let s=a.getId(),l=!1,c,d,p,m,g,y,b;if(s&&typeof s=="string"){let S=s.split(".");if(S[0]==="chart-backdrop"){o=!0;return}switch(S[0]==="chart-bound"&&i.set(s,{id:S[1],coord:e.lonlat,icon:"map",text:a.get("name")}),S[0]){case"rset":l=!0,y={name:"star",svgIcon:void 0},b=a.get("name");break;case"alarm":l=!0,y={name:"notification_important",svgIcon:void 0},b=`Alarm: ${a.get("type")}`;break;case"anchor":l=!0,y={name:"anchor",svgIcon:void 0},b=`${S[0]}`;break;case"dest":l=!0,y={name:"flag",svgIcon:void 0},b="Destination";break;case"note":{y={svgIcon:a.get("icon"),name:void 0},l=!0,b=this.skres.fromCache("notes",S[1])[1].name??"";break}case"route":{let E=this.activeRoutePointAt(e,a,S[1]);if(E!==null){s=`rtept.${E}`,y={name:"location_on",svgIcon:void 0,class:"icon-route"},l=!0,b=this.activeRoutePoint(E).name||`Route point ${E+1}`;break}y={svgIcon:"route",name:void 0,class:"icon-route"},l=!0;let k=this.getUnsavedRouteBuffer(S[1]);k?b=k.name||"Route (unsaved)":b=this.skres.fromCache("routes",S[1])[1].name;break}case"waypoint":{y={name:"location_on",svgIcon:void 0,class:"icon-waypoint"},l=!0,b=this.skres.fromCache("waypoints",S[1])[1].name??"";break}case"atons":case"aton":case"shore":y={name:"beenhere",svgIcon:void 0},l=!0,c=this.app.data.atons.get(s),b=c?c.name||c.mmsi:"";break;case"sar":y={name:"tour",svgIcon:void 0},l=!0,d=this.app.data.sar.get(s),b=d?d.name||d.mmsi:"SaR Beacon";break;case"meteo":y={name:"air",svgIcon:void 0},l=!0,p=this.app.data.meteo.get(s),b=p?p.name||p.mmsi:"Weather Station";break;case"ais-vessels":y={name:"directions_boat",svgIcon:void 0},l=!0,g=this.dfeat.ais.get(`vessels.${S[1]}`),b=g?g.name||g.mmsi:"";break;case"vessels":y={name:"directions_boat",svgIcon:void 0},l=!0,b=this.dfeat.self.name?this.dfeat.self.name+" (self)":"self";break;case"region":l=!0,y={name:"tab_unselected",svgIcon:void 0,class:"icon-region"},b=a.get("name");break;case"aircraft":y={name:"airplanemode_active",svgIcon:void 0},l=!0,m=this.app.data.aircraft.get(s),b=m?m.name||m.mmsi:"";break;case ef:l=!0,y={name:"history",svgIcon:void 0},b=`Track history: ${this.trackHistory.label(a.get("context"))}`,this.trackHistoryFeatures[s]={context:a.get("context"),lines:[a.get("line")],times:a.get("times")?[a.get("times")]:void 0,at:e.lonlat};break;case"track-vessels":{let E=s.slice(6),k=this.app.aisTracksTimed().get(E);k&&(l=!0,y={name:"history",svgIcon:void 0},b=`Vessel track: ${this.trackHistory.label(E)}`,this.trackHistoryFeatures[s]={context:E,lines:k.lines,times:k.times,at:e.lonlat});break}case"trail":{let E=s==="trail.self.server"||s==="trail.self.local"?Yj(this.app.selfTrailTimed(),this.app.selfTrailFromServer().length>0,this.app.localTrailTimed()):null;E?.lines.length&&(l=!0,y={name:"history",svgIcon:void 0},b="Vessel trail",this.trackHistoryFeatures[s]={context:"self",lines:E.lines,times:E.times,at:e.lonlat});break}case"tidal":l=!0,y={name:"water",svgIcon:void 0},b=a.get("name"),this.tidalFeatures[s]={speedKn:Number(a.get("driftKts"))||0,direction:Number(a.get("setDeg"))||0};break}}else if(!s&&a.getProperties){let S=a.getProperties();S.RCID&&Cj.has(S.layer)&&(s=`s57.${S.LNAM}`,l=!0,y={name:"beenhere",svgIcon:void 0},b=Ok[S.layer],this.s57Features[s]=S)}l&&!t.has(s)&&(t.set(s,{id:s,coord:e.lonlat,icon:y,text:b}),r.push(a))}),Xj(t.keys()).forEach(a=>t.delete(a)),[...t.keys()].some(a=>a.startsWith("rtept."))&&[...t.keys()].filter(a=>a.startsWith("dest.")).forEach(a=>t.delete(a)),t.has("trail.self.server")&&t.has("trail.self.local")&&t.delete("trail.self.local"),i.size>0){this.formatPopover("chartlist.",e.lonlat,i);return}if(!o)if(this.mapInteract.draw.features=new Vn(r),t.size===1){let a=t.values().next().value;this.formatPopover(a.id,a.coord)}else t.size>1&&this.formatPopover("list.",e.lonlat,t)}s57Features={};trackHistoryFeatures={};tidalFeatures={};formatPopover(e,t,i){if(!e){this.overlay.update(l=>Object.assign({},l,{show:!1}));return}let r={show:!1,content:[],id:null,type:null,title:null,featureCount:this.mapInteract.draw.features?.getLength(),position:t,worldOffset:this.clickWorldOffset,readOnly:!1,isSelf:!1},o,a=e.split("."),s;switch(a[0]){case"s57":r.id=e,r.title="S57 Feature",r.type="s57",r.s57Feature=this.s57Features[e],r.position=t,r.show=!0,r.readOnly=!0;break;case"anchor":this.modifyFeature("anchor");return;case"bearing_dist":{let l=ri.distanceTo(this.app.data.vessels.self.position,t)??0,c=(0,y1.getGreatCircleBearing)(this.app.data.vessels.self.position,t)??0;r.type=a[0],r.title=`${this.app.formatValueForDisplay(l,"m")} ${this.app.formatValueForDisplay(c,"deg")}`,r.position=t,r.show=!0;break}case"list":r.type=a[0],r.title="Features",r.content=[],i.forEach(l=>r.content.push(l)),r.show=!0;break;case"chartlist":r.type=a[0],r.content=[],i.forEach(l=>r.content.push(l)),r.show=!0;break;case"alarm":{s=e.split(".").slice(1).join(".");let l=this.notiMgr.getAlert(s);if(!l)return!1;r.type=a[0],r.alarm=l,r.id=s,r.show=!0;break}case"vessels":r.type="ais",r.isSelf=!0,r.vessel=this.dfeat.self,r.position=this.dfeat.self.position,r.show=!0;break;case"ais-vessels":if(s=e.slice(4),!this.dfeat.ais.has(s))return!1;r.type="ais",r.id=s,r.vessel=this.dfeat.ais.get(s),r.position=r.vessel.position,r.show=!0;break;case"atons":case"aton":case"shore":if(!this.app.data.atons.has(e))return!1;r.type="aton",r.id=e,r.aton=this.app.data.atons.get(e),r.position=r.aton.position,r.show=!0;break;case"sar":if(!this.app.data.sar.has(e))return!1;r.type="aton",r.id=e,r.aton=this.app.data.sar.get(e),r.position=r.aton.position,r.show=!0;break;case"meteo":if(!this.app.data.meteo.has(e))return!1;r.type=a[0],r.id=e,r.aton=this.app.data.meteo.get(e),r.position=r.aton.position,r.show=!0;break;case"aircraft":if(!this.app.data.aircraft.has(e))return!1;r.type=a[0],r.id=e,r.aircraft=this.app.data.aircraft.get(e),r.position=r.aircraft.position,r.show=!0;break;case"trail":case"track-vessels":case ef:{let l=this.trackHistoryFeatures[e];if(!l)return;let c=DP(l.lines,l.times,l.at),d=p=>Kp(new Date(p).toISOString());r.id=e,r.type=ef,r.position=t,r.show=!0,r.readOnly=!0,r.trackHistory={name:this.trackHistory.label(l.context),start:c&&d(c.start),end:c&&d(c.end),duration:c&&IP(c.duration),at:c?.atTime!==void 0?d(c.atTime):void 0};break}case"tidal":{let l=this.tidalFeatures[e];r.id=e,r.type="tidal",r.position=t,r.show=!0,r.readOnly=!0,l&&(r.tidal={speedLabel:this.tidalCurrents.formatSpeed(l.speedKn),directionLabel:`${this.app.formatValueForDisplay(l.direction,"deg",{precision:0})}T`});break}case"region":if(o=[this.skres.fromCache("regions",a[1])],!o)return!1;r.id=a[1],r.type=a[0],r.title="Region",r.resource=o[0],r.show=!0,r.readOnly=o[0][1]?.feature?.properties?.readOnly??!1,this.infoPanel.opened()&&(this.overlay.set(r),this.popoverInfo());break;case"note":if(o=this.skres.fromCache("notes",a[1]),!o)return!1;r.readOnly=o[1]?.properties?.readOnly??!1,r.id=a[1],r.type=a[0],r.title="Note",r.resource=o,r.show=!0,this.app.config.display.singleClickNoteDetails?(r.show=!1,this.overlay.set(r),this.popoverInfo()):this.infoPanel.opened()&&(this.overlay.set(r),this.popoverInfo());break;case"route":{let l=this.getUnsavedRouteBuffer(a[1]);if(l){let c=this.bufferToFBRoute(l)[1];c.name=c.name||"(unsaved)",r.id=a[1],r.type="route",r.title="Route (unsaved)",r.resource=[a[1],c],r.show=!0,r.readOnly=!1}else{if(o=[this.skres.fromCache("routes",a[1])],!o)return!1;r.id=a[1],r.type=a[0],r.title="Route",r.resource=o[0],r.show=!0,r.readOnly=o[0][1]?.feature?.properties?.readOnly??!1}this.infoPanel.opened()&&(this.overlay.set(r),this.popoverInfo());break}case"waypoint":if(o=[this.skres.fromCache("waypoints",a[1])],!o)return!1;r.id=a[1],r.type=a[0],r.resource=o[0],r.title="Waypoint",r.show=!0,r.readOnly=o[0][1]?.feature?.properties?.readOnly??!1,this.infoPanel.opened()&&(this.overlay.set(r),this.popoverInfo());break;case"rtept":{let l=Number(a[1]);r.id=e,r.type="rtept",r.routePoint=this.activeRoutePoint(l),r.title=r.routePoint.name||"Route point",r.show=!0;break}case"dest":r.id=e,r.type="destination",r.resource=this.skres.buildWaypoint(t),r.title=this.course.courseData().destPointName??"Destination",r.show=!0;break;case"rset":r.id=e,r.type=a[0],r.resourceSet=this.skresOther.fromResourceSetCache(e,!0),r.title=r.resourceSet?.properties?.name??"Resource Set",r.show=!!r.resourceSet;break;default:return}this.overlay.set(r)}featureListSelection(e){let t=new Vn;this.mapInteract.draw.features.forEach(i=>{i.getId()===e.id&&t.push(i)}),this.mapInteract.draw.features=t,this.formatPopover(e.id,e.coord)}popoverInfo(){let e=`${this.overlay().type}s`;if(["notes","regions","waypoints","routes"].includes(e)&&this.app.useInfoPanel()){let t=this.getUnsavedRouteBuffer(this.overlay().id);e==="routes"&&t?this.infoPanel.openWith("routes",this.bufferToFBRoute(t)):this.infoPanel.open(e,this.overlay().id)}else this.skres.resourceProperties(this.overlay())}popoverClosed(){this.overlay.update(e=>Object.assign({},e,{show:!1}))}updateCoordsMeta(e,t,i){if(!i)return;let r=t.length>e.length?"ADD":t.length<e.length?"DELETE":"MOVE";function o(a){return a.map(s=>`${s[0]} - ${s[1]}`)}if(r==="MOVE")return $j(e,t,i,a=>this.skres.fromCache("waypoints",a.split("/").pop())?.[1]?.name),i;if(e=o(e),t=o(t),r==="DELETE"){for(let a=0;a<e.length;a++)t.includes(e[a])||i.splice(a,1);return i}else if(r==="ADD"){for(let a=0;a<t.length;a++)if(e[a]!==t[a]){i.splice(a,0,{name:""});break}return i}else return i}onMapKeydown(e){let t=Tj(e);if(t){e.preventDefault(),this.zoomMap(t==="in");return}Ej(e)&&this.onUserPan()}zoomMap(e){let{min:t,max:i}=this.app.MAP_ZOOM_EXTENT,r=this.app.config.map.zoomLevel,o=e?Math.min(r+1,i):Math.max(r-1,t);if(o!==r){if(this.movingMap&&!this.offsetSuppressed&&!this.userPanned){let a=this.app.config.map.centerOffset;(a.x||a.y)&&this.mapCenterPositon.set(this.app.calcMapCenter(!0,o-r,this.mapRotation()))}this.mapZoomLevel.set(o),this.app.config.map.zoomLevel=o}}rotateMap(){this.northUp?this.mapRotation.set(0):this.mapRotation.update(()=>0-this.dfeat.active.orientation)}centerVessel(){if(this.userPanned)return;let e=this.app.calcMapCenter(!this.offsetSuppressed,0,this.mapRotation());this.mapCenterPositon.update(()=>e)}startOffsetGrace(){this.stopOffsetGrace(),this.offsetSuppressed=!0,this.centerVessel(),this.offsetGraceTimer=setTimeout(()=>{this.offsetSuppressed=!1,this.centerVessel()},Gve)}stopOffsetGrace(){clearTimeout(this.offsetGraceTimer),this.offsetGraceTimer=void 0,this.offsetSuppressed=!1}drawVesselLines(e=!1){let t=this.mapZoomLevel(),i=t<29?Cx[Math.floor(t)]:60,r=10;e&&this.app.addToSelfTrail(this.dfeat.self.position),this.buildLaylines(),this.vesselLines.update(()=>{let o=this.dfeat.active.vectors.cog??[],a=this.dfeat.active.sog||0,s=this.app.config.vessels.selfLines.heading.length===-1?(a>r?r:a)*i:Ue.nauticalMilesToKm(this.app.config.vessels.selfLines.heading.length)*1e3,l=[this.dfeat.active.position,ri.rhumbDestination(this.dfeat.active.position,this.dfeat.active.orientation,s)];return{cog:o,heading:l}})}buildLaylines(){let e=this.app.config.vessels.laylines&&typeof(this.app.data.vessels.active.headingTrue??this.app.data.vessels.active.headingMagnetic)=="number"?Mj(this.app.data.vessels.active.position,this.dfeat.navData.position,this.app.data.vessels.self):null,t=e?Sj(e):Fk;this.perfTargetAngle.set(t.targetAngle),this.perfLaylines.set({port:t.port,starboard:t.starboard})}deleteFeature(e,t){return Y(this,null,function*(){switch(t){case"waypoint":this.skres.deleteWaypoint(e);break;case"route":{let i=this.routeBuffers.get(e);i&&!i.saved?this.routeBuffers.delete(e):(yield this.skres.deleteRoute(i?.href??e))&&i&&this.routeBuffers.delete(e,!1);break}case"note":this.skres.deleteNote(e);break;case"region":this.skres.deleteRegion(e);break}})}hideFeature(e,t){t==="route"&&this.skres.routeHide(e)}setActiveFeature(){this.overlay().type==="waypoint"?this.course.navigateToWaypoint(this.overlay().id):this.activate.emit(this.overlay().id)}clearActiveFeature(){this.deactivate.emit(this.overlay().id)}rejoinRouteAt(e){this.course.rejoinRouteAt(e)}skipRoutePoint(e){this.course.skipRoutePoint(e)}itemInfo(e,t,i=!1){t==="ais"&&i?this.info.emit({id:e,type:"self"}):this.info.emit({id:e,type:t})}popoverPoints(){let e=this.getUnsavedRouteBuffer(this.overlay().id);this.info.emit({id:this.overlay().id,type:this.overlay().type,resource:e?this.bufferToFBRoute(e):void 0})}setActiveVessel(e=null){this.focusVessel.emit(e)}applyInteractionMode(e,t){this.overlay.update(i=>Object.assign({},i,{show:!1})),e===0&&(this.mapInteract.draw.style=t?this.mapInteract.measureGeometryType==="Circle"?Jp.radius:Jp.measure:Jp.default),e===1&&(this.mapInteract.draw.style=this.mapInteract.draw.resourceType==="route"?Jp.route:this.mapInteract.draw.resourceType==="region"?Jp.region:Jp.default)}isCoordsArray(e){return Array.isArray(e)?Array.isArray(e[0])&&typeof e[0][0]=="number":!1}transformCoordsArray(e){return e.map(t=>un(t))}applyStyle(){return new he({fill:new Ve({color:"#e0d10e"}),stroke:new be({color:"#444",width:1})})}renderMapContents(e){this.shouldFetchNotes(e)&&(this.skres.refreshNotes(),this.app.debug("fetching Notes...")),this.shouldFetchResourceSets(e)&&(this.app.debug("fetching ResourceSets..."),this.skresOther.refreshResourceSetsInBounds())}mapMoveThresholdExceeded(e){if(!this.app.data.lastGet)return this.app.data.lastGet=this.app.config.map.center,!0;let t=ri.distanceTo(this.app.data.lastGet,this.app.config.map.center);this.app.debug(`distance map moved: ${t}`);let i=this.app.config.units.distance==="kilometer"?e*1e3:Ue.nauticalMilesToKm(e)*1e3;return this.app.debug(`mapMoveThresholdExceeded: ${t>=i/2}`),t>=i/2?(this.app.data.lastGet=this.app.config.map.center,!0):!1}shouldFetchResourceSets(e){return this.app.config.resources.fetchRadius!==0&&this.app.config.resources.fetchFilter&&this.skresOther.anyResourceSetSelection()?e?!0:this.mapMoveThresholdExceeded(50):!1}shouldFetchNotes(e){return this.showNoteslayer.update(()=>this.app.config.ui.showNotes&&this.app.config.map.zoomLevel>=this.app.config.resources.notes.minZoom),this.app.debug(`lastGet: ${this.app.data.lastGet}`),this.app.debug(`getRadius: ${this.app.config.resources.notes.getRadius}`),e?!(this.mapZoomLevel()<this.app.config.resources.notes.minZoom):this.mapMoveThresholdExceeded(this.app.config.resources.notes.getRadius)}getFeatureInfo(){}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["fb-map"]],viewQuery:function(t,i){if(t&1&&Ot(hl,7)(uye,5)(pye,5),t&2){let r;Ee(r=Ie())&&(i.contextMenu=r.first),Ee(r=Ie())&&(i.olMap=r.first),Ee(r=Ie())&&(i.routeDraw=r.first)}},inputs:{setFocus:"setFocus",mapCenter:"mapCenter",mapZoom:"mapZoom",movingMap:"movingMap",northUp:"northUp",measureMode:"measureMode",drawMode:"drawMode",modifyMode:"modifyMode",activeRoute:"activeRoute",vesselTrail:"vesselTrail",dblClickZoom:"dblClickZoom",overZoomTiles:"overZoomTiles",scaleUnits:[1,"scaleUnits"]},outputs:{drawEnded:"drawEnded",activate:"activate",deactivate:"deactivate",info:"info",exitMovingMap:"exitMovingMap",resumeMovingMap:"resumeMovingMap",focusVessel:"focusVessel",menuItemSelected:"menuItemSelected"},features:[Se],decls:74,vars:128,consts:[["olMap",""],["contextMenu","matMenu"],["routeDraw",""],["olView","",3,"mapMoveEnd","mapReady","mapSingleClick","mapRightClick","mapPointerDown","mapPointerMove","mapPointerDrag","mapContextMenu","contextmenu","keydown","logo","olInteractions","olControls","setFocus","zoom","center","rotation","minZoom","maxZoom","enableAnimation"],[3,"type","style","stopClick"],[3,"type","stopClick","style"],[3,"features"],[1,"ol-zoom"],["mat-mini-fab","","matTooltip","Zoom out",1,"button-accent",3,"click","disabled"],["mat-mini-fab","","matTooltip","Zoom in",1,"button-accent",3,"click","disabled"],[1,"ol-mouse-position"],[2,"background-color","rgba(250, 250, 250, 0.7)","padding","0 5px 0 5px"],[3,"innerText"],[3,"position","heading","mapZoom","zIndex","opacity"],[3,"darkMode","tracks","labelMinZoom","mapZoom","zIndex"],[3,"tracks","zIndex"],[3,"ghosts","iconScale","zIndex"],["targetContext","vessels",3,"tracks","showAll","selectedIds","tracksMinZoom","updateIds","removeIds","mapZoom","zIndex"],[3,"routes","routeStyles","activeRoute","darkMode","labelMinZoom","mapZoom","zIndex"],[3,"points","pointIndex","reverse","zIndex"],[3,"darkMode","waypoints","activeWaypoint","labelMinZoom","mapZoom","zIndex"],["targetContext","atons",3,"darkMode","targets","labelMinZoom","mapZoom","updateIds","staleIds","removeIds","inactiveTime","zIndex"],["targetContext","shore.basestations",3,"darkMode","targets","labelMinZoom","mapZoom","updateIds","staleIds","removeIds","inactiveTime","zIndex"],["targetContext","meteo",3,"darkMode","targets","windIndicator","labelMinZoom","mapZoom","updateIds","staleIds","removeIds","inactiveTime","zIndex"],["targetContext","aircraft",3,"darkMode","targets","targetStyles","labelMinZoom","mapZoom","updateIds","staleIds","removeIds","inactiveTime","zIndex"],["targetContext","sar",3,"darkMode","targets","targetStyles","labelMinZoom","mapZoom","updateIds","staleIds","removeIds","inactiveTime","zIndex"],[3,"startLine","racecourseStyles","darkMode","labelMinZoom","mapZoom","zIndex"],[3,"regions","regionStyles","darkMode","labelMinZoom","mapZoom","zIndex"],[3,"notes","zIndex"],[3,"position","worldOffset","positioning"],[3,"radius","anchorPosition","vesselPosition","anchorStyles","zIndex"],[3,"cpaLines","zIndex"],[3,"alarms","alarmStyles","zIndex"],[3,"position","maxCircles","fixedMode","fixedDistance","mapZoom","darkMode","minZoom","units","zIndex"],[3,"coords","lineStyle","mapZoom","zIndex"],[3,"coords","cogTime","lineStyle","units","darkMode","labelMinZoom","mapZoom","zIndex"],[3,"twd","tws","awa","aws","position","zIndex"],[3,"position","heading","id","activeId","iconScale","fixedLocation","stale","zIndex"],[3,"localTrail","serverTrail","trailStyles","zIndex"],[3,"show","opacity","indicator"],[3,"show","opacity"],[3,"position","worldOffset","positioning","stopEvent"],[3,"zIndex","charts","layerProperties"],[2,"visibility","hidden","position","fixed",3,"matMenuTriggerFor"],[3,"contextmenu"],["matMenuContent",""],[3,"boxStart","boxEnd","boxCancel"],[3,"drawStart","drawEnd","type","stopClick"],[3,"drawEnd","type","stopClick"],[3,"modifyStart","modifyEnd","features"],[3,"zIndex","chart"],[3,"zIndex","chart","overZoomTiles","mapMaxZoom"],[3,"onError","position","heading","mapZoom","zIndex","opacity"],[3,"darkMode","collection","resourceSets","labelMinZoom","mapZoom","zIndex"],[3,"targetContext","targets","vectorApparent","mapZoom","labelMinZoom","focusId","filterIds","filterByShipType","filterShipTypes","updateIds","staleIds","removeIds","inactiveTime","zIndex","darkMode"],[3,"flagged","targetContext","targets","mapZoom","labelMinZoom","focusId","filterIds","filterByShipType","filterShipTypes","updateIds","staleIds","removeIds","inactiveTime","zIndex","darkMode"],["targetContext","vessels",3,"darkMode","targets","labelMinZoom","mapZoom","updateIds","staleIds","removeIds","inactiveTime","zIndex","focusId","filterIds","filterByShipType","filterShipTypes","cogLineLength"],[3,"closed","navigateTo","title","canClose","measure","navTo"],[3,"markerPosition","vesselPosition","showMarker","markerName","bearingStyles","labelMinZoom","mapZoom","zIndex"],[3,"title","canClose","measure"],[3,"canClose","features"],[3,"canClose","title","features"],[3,"canClose","properties"],[3,"title","icon","canClose"],[3,"canClose","compact"],[3,"canClose","title","type","resource","active","featureCount","units","canSave","canStart"],[3,"canClose","title","resource"],[3,"canClose","aton"],[3,"canClose","aircraft"],[3,"canClose","point"],[3,"canClose","alarm","id"],[3,"closed","title","canClose","measure"],[3,"selected","closed","canClose","features"],[3,"selected","closed","canClose","title","features"],[3,"closed","canClose","properties"],[3,"closed","title","icon","canClose"],[2,"opacity","0.7"],[2,"display","flex","gap","12px"],[2,"font-weight","bold"],[2,"flex","1 1 auto","text-align","right"],[3,"closed","canClose","compact"],[2,"display","flex","align-items","center","gap","8px"],[2,"font-size","22px","height","22px","width","22px"],[2,"display","flex","flex-direction","column","gap","2px"],[2,"display","flex","align-items","center","gap","6px"],[2,"font-size","16px","height","16px","width","16px"],[3,"modify","save","delete","hide","addNote","activated","deactivated","related","notes","info","points","closed","canClose","title","type","resource","active","featureCount","units","canSave","canStart"],[3,"modify","delete","info","closed","canClose","title","resource"],[3,"info","focused","markPosition","closed","canClose","vessel","useMagnetic","isActive","isSelf"],[3,"info","closed","canClose","aton"],[3,"info","closed","canClose","aircraft"],[3,"rejoin","skip","closed","canClose","point"],[3,"info","goto","closed","canClose","alarm","id"],[3,"color","startPosition","destPosition","zIndex","visible","layerProperties"],[3,"radius","position","zIndex"],[3,"line","lineStyle","position","twd","mapZoom","zIndex"],[3,"lines","laylineStyles","position","twd","mapZoom","zIndex"],[1,"cursor-marker"],["mat-menu-item",""],["mat-menu-item","",3,"click","contextmenu"],[1,"icon-waypoint"],["mat-menu-item","",3,"contextmenu","click"],["mat-menu-item","",3,"click"]],template:function(t,i){if(t&1&&(u(0,"ol-map",3,0),T("mapMoveEnd",function(o){return i.onMapMoveEnd(o)})("mapReady",function(){return i.onMapReady()})("mapSingleClick",function(o){return i.onMapSingleClick(o)})("mapRightClick",function(o){return i.onMapRightClick(o)})("mapPointerDown",function(o){return i.onMapPointerDown(o)})("mapPointerMove",function(o){return i.onMapPointerMove(o)})("mapPointerDrag",function(){return i.onMapPointerDrag()})("mapContextMenu",function(o){return i.onMapContextMenu(o)})("contextmenu",function(o){return i.onContextMenu(o)})("keydown",function(o){return i.onMapKeydown(o)}),R(2,Cye,1,0,"ol-dragbox"),R(3,wye,1,4,"ol-draw",4),R(4,Mye,2,4,"ol-draw",5),R(5,Sye,1,1,"ol-modify",6),u(6,"ol-control")(7,"ol-content")(8,"div",7)(9,"button",8),T("click",function(){return i.zoomMap(!1)}),u(10,"mat-icon"),_(11,"remove"),h()(),_(12," \xA0 "),u(13,"button",9),T("click",function(){return i.zoomMap(!0)}),u(14,"mat-icon"),_(15,"add"),h()()()()(),u(16,"ol-control")(17,"ol-content")(18,"div",10)(19,"span",11),R(20,Tye,2,0,"span"),z(21,"span",12),bt(22,"coords"),_(23," \xA0 "),R(24,Eye,2,0,"span"),z(25,"span",12),bt(26,"coords"),_(27," \xA0 "),z(28,"span",12),R(29,kye,5,4),h()()()(),Ae(30,Nye,7,1,null,null,Bk),R(32,Bye,1,5,"fb-radar",13),R(33,Vye,1,5,"fb-tracks",14),R(34,Gye,1,2,"fb-track-history",15),R(35,zye,1,3,"fb-track-history-ghosts",16),R(36,jye,1,8,"ais-targets-track",17),Ae(37,Uye,2,6,"div",null,Bk),z(39,"fb-routes",18)(40,"fb-routes",18),R(41,Wye,1,4,"fb-route-direction",19),z(42,"fb-waypoints",20)(43,"sk-ais-targets",21)(44,"sk-ais-targets",22),R(45,Hye,1,10,"sk-ais-targets",23),R(46,Kye,4,30,"div"),R(47,qye,1,10,"sk-ais-targets",24),R(48,Zye,1,10,"sk-ais-targets",25),z(49,"racing-start-line",26)(50,"fb-regions",27),R(51,Xye,1,2,"fb-notes",28),R(52,Yye,3,14),R(53,fve,14,16,"ol-overlay",29),R(54,gve,1,5,"fb-anchor-alarm",30),R(55,_ve,1,2,"fb-cpa-alarms",31),z(56,"fb-alarms",32),R(57,Cve,4,4),R(58,wve,1,9,"fb-range-circles",33),R(59,Mve,1,4,"fb-heading-line",34),R(60,Sve,1,8,"fb-cog-line",35),R(61,Tve,1,6,"fb-wind-lines",36),z(62,"fb-vessel",37),R(63,Eve,1,3,"fb-vessel-trail",38),z(64,"fb-weather-wind",39)(65,"fb-weather-currents",40)(66,"fb-tidal-currents",40),Ae(67,Ive,2,6,"ol-overlay",41,xye),R(69,kve,1,4,"fb-chart-bounds",42),h(),z(70,"div",43),u(71,"mat-menu",44,1),T("contextmenu",function(o){return o.preventDefault()}),St(73,Vve,28,9,"ng-template",45),h()),t&2){let r,o=Be(72);vt("cursor",i.mapInteract.isDrawing()||i.mapInteract.isModifying()||i.mapInteract.isMeasuring()?"crosshair":"initial"),w("logo",!1)("olInteractions",i.olMapInteractions())("olControls",i.olMapControls)("setFocus",i.setFocus)("zoom",i.mapZoomLevel())("center",i.mapCenterPositon())("rotation",i.mapRotation())("minZoom",i.app.MAP_ZOOM_EXTENT.min)("maxZoom",i.app.MAP_ZOOM_EXTENT.max)("enableAnimation",!1),f(2),A(i.mapInteract.isBoxSelecting()?2:-1),f(),A(i.mapInteract.isMeasuring()?3:-1),f(),A(i.mapInteract.isDrawing()?4:-1),f(),A(i.mapInteract.isModifying()&&i.mapInteract.draw.features?5:-1),f(4),w("disabled",i.mapZoomLevel()<=i.app.MAP_ZOOM_EXTENT.min),f(4),w("disabled",i.mapZoomLevel()>=i.app.MAP_ZOOM_EXTENT.max),f(5),vt("bottom",i.plotterExt.statusBarLift()>0?i.plotterExt.statusBarLift()+"px":null),f(2),A(i.app.config.units.positionFormat==="XY"?20:-1),f(),w("innerText",Mi(22,121,i.mouse().coords[1],i.app.config.units.positionFormat,!0)),f(3),A(i.app.config.units.positionFormat==="XY"?24:-1),f(),w("innerText",$n(26,125,i.mouse().coords[0],i.app.config.units.positionFormat)),f(3),w("innerText","Zm: "+i.mapZoomText()),f(),A((r=i.cursorInfo())?29:-1,r),f(),Le(i.skres.charts()),f(2),A(i.app.uiCtrl().radarLayer?32:-1),f(),A(i.app.featureFlags().resourceTracks?33:-1),f(),A(i.trackHistory.shown().length>0?34:-1),f(),A(i.trackHistory.ghosts().length>0?35:-1),f(),A(i.app.config.ui.showAisTargets&&(i.app.config.vessels.aisShowTrack||i.app.data.vessels.showTrack.length>0)?36:-1),f(),Le(i.skresOther.resourceSets()),f(2),w("routes",i.skres.routes())("routeStyles",i.featureStyles.route)("activeRoute",i.activeRoute)("darkMode",i.app.uiConfig().invertColor)("labelMinZoom",i.app.config.map.labelsMinZoom)("mapZoom",i.mapZoomLevel())("zIndex",500),f(),w("routes",i.bufferRoutes())("routeStyles",i.draftRouteStyles)("activeRoute",i.activeRoute)("darkMode",i.app.uiConfig().invertColor)("labelMinZoom",i.app.config.map.labelsMinZoom)("mapZoom",i.mapZoomLevel())("zIndex",510),f(),A(i.activeRoute&&!i.app.data.activeRouteIsEditing?41:-1),f(),w("darkMode",i.app.uiConfig().invertColor)("waypoints",i.skres.waypoints())("activeWaypoint",i.app.data.activeWaypoint)("labelMinZoom",i.app.config.map.labelsMinZoom)("mapZoom",i.mapZoomLevel())("zIndex",600),f(),w("darkMode",i.app.uiConfig().invertColor)("targets",i.dfeat.atons)("labelMinZoom",i.app.config.map.labelsMinZoom)("mapZoom",i.mapZoomLevel())("updateIds",i.skstream.aisStatus().updated)("staleIds",i.skstream.aisStatus().stale)("removeIds",i.skstream.aisStatus().expired)("inactiveTime",i.app.config.vessels.aisStaleAge)("zIndex",200),f(),w("darkMode",i.app.uiConfig().invertColor)("targets",i.dfeat.atons)("labelMinZoom",i.app.config.map.labelsMinZoom)("mapZoom",i.mapZoomLevel())("updateIds",i.skstream.aisStatus().updated)("staleIds",i.skstream.aisStatus().stale)("removeIds",i.skstream.aisStatus().expired)("inactiveTime",i.app.config.vessels.aisStaleAge)("zIndex",210),f(),A(i.app.config.ui.showAisTargets?45:-1),f(),A(i.app.config.ui.showAisTargets?46:-1),f(),A(i.app.config.ui.showAisTargets?47:-1),f(),A(i.app.config.ui.showAisTargets?48:-1),f(),w("startLine",i.app.data.racing.startLine)("racecourseStyles",i.featureStyles.raceCourse)("darkMode",i.app.uiConfig().invertColor)("labelMinZoom",i.app.config.map.labelsMinZoom)("mapZoom",i.mapZoomLevel())("zIndex",540),f(),w("regions",i.skres.regions())("regionStyles",i.featureStyles.region)("darkMode",i.app.uiConfig().invertColor)("labelMinZoom",i.app.config.map.labelsMinZoom)("mapZoom",i.mapZoomLevel())("zIndex",400),f(),A(i.showNoteslayer()?51:-1),f(),A(i.overlay().show&&i.overlay().type==="bearing_dist"?52:-1),f(),A(i.overlay().show&&!i.mapInteract.isModifying()?53:-1),f(),A(i.anchor.raised()?-1:54),f(),A(i.dfeat.closest.length!==0?55:-1),f(),w("alarms",i.notiMgr.mobAlerts())("alarmStyles",i.featureStyles.alarm)("zIndex",995),f(),A(i.anchor.raised()&&i.dfeat.navData.position?57:-1),f(),A(i.app.config.vessels.rangeCircles?58:-1),f(),A(i.app.config.vessels.selfLines.cog.length!==0?59:-1),f(),A(i.app.config.vessels.selfLines.cog.length!==0?60:-1),f(),A(i.app.config.vessels.windVectors?61:-1),f(),w("position",i.dfeat.self.position)("heading",i.dfeat.self.orientation)("id",""+i.app.data.selfId)("activeId",i.app.data.vessels.activeId)("iconScale",i.app.config.vessels.iconScale)("fixedLocation",i.app.config.vessels.fixedLocationMode)("stale",i.skstream.selfPositionStale()&&!i.app.config.vessels.fixedLocationMode)("zIndex",999),f(),A(i.app.config.vessels.trail&&i.app.data.vessels.showSelf?63:-1),f(),w("show",i.app.config.selections.weatherWindEnabled)("opacity",.55)("indicator",i.app.config.display.windIndicator),f(),w("show",i.app.config.selections.oceanCurrentsEnabled)("opacity",.55),f(),w("show",i.app.config.selections.tidalCurrentsEnabled)("opacity",.7),f(),Le(i.cursorMarkers()),f(2),A(i.app.data.chartBounds.show?69:-1),f(),vt("left",i.contextMenuPosition.x)("top",i.contextMenuPosition.y),w("matMenuTriggerFor",o)}},dependencies:[ye,Te,An,Pa,se,ce,ue,Ns,et,Ec,is,Is,bz,hl,$f,Sm,Tu,Mu,ke,Su,Eu,Em,Im,km,Dm,Fm,Nm,Iu,Bm,Vm,Uf,Gm,zm,jm,Um,Wm,Hm,$m,Km,qm,Zm,Ym,Qm,Jm,p_,Xm,tf,nf,of,af,sf,lf,cf,df,uf,Hf,Af,Lf,Of,Ff,Nf,Bf,jf,jn,ww,Mw,Ew,Sw,Tw,fw,gw,kw,Cw,Iw,Rw,Aw,W_,Qi],styles:[".mapButton[_ngcontent-%COMP%]{position:fixed;z-index:4000}.control[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-start;margin:20px}.ol-mouse-position[_ngcontent-%COMP%]{width:100%;top:unset;bottom:10px;left:unset;right:unset;text-align:center;color:#1e1e1e;font-family:roboto}.ol-zoom[_ngcontent-%COMP%]{position:fixed;top:10px;left:60px;color:#1e1e1e;font-family:roboto;background-color:transparent;height:45px} .ol-dragbox{background-color:#fff6!important;border-color:#649600!important;border-style:solid;border-width:1px}.cursor-marker[_ngcontent-%COMP%]{width:14px;height:14px;border-radius:50%;background-color:#ff5722e6;border:2px solid rgba(255,255,255,.95);box-shadow:0 0 3px #0009;pointer-events:none;animation:_ngcontent-%COMP%_cursor-marker-fade 1.5s linear forwards}@keyframes _ngcontent-%COMP%_cursor-marker-fade{0%{opacity:1}to{opacity:0}}.nosmall[_ngcontent-%COMP%]{display:block}@media only screen and (max-width:400px){.nosmall[_ngcontent-%COMP%]{display:none}.ol-mouse-position[_ngcontent-%COMP%]{bottom:2px}}"]})};var zve=["button"],jve=["*"];function Uve(n,e){if(n&1&&(u(0,"div",2),z(1,"mat-pseudo-checkbox",6),h()),n&2){let t=v();f(),w("disabled",t.disabled)}}var Qj=new Ct("MAT_BUTTON_TOGGLE_DEFAULT_OPTIONS",{providedIn:"root",factory:()=>({hideSingleSelectionIndicator:!1,hideMultipleSelectionIndicator:!1,disabledInteractive:!1})}),Jj=new Ct("MatButtonToggleGroup"),Wve={provide:cs,useExisting:os(()=>Gk),multi:!0},Ow=class{source;value;constructor(e,t){this.source=e,this.value=t}},Gk=(()=>{class n{_changeDetector=M(ae);_dir=M(uo,{optional:!0});_multiple=!1;_disabled=!1;_disabledInteractive=!1;_selectionModel;_rawValue;_controlValueAccessorChangeFn=()=>{};_onTouched=()=>{};_buttonToggles;appearance;get name(){return this._name}set name(t){this._name=t,this._markButtonsForCheck()}_name=M(nr).getId("mat-button-toggle-group-");vertical=!1;get value(){let t=this._selectionModel?this._selectionModel.selected:[];return this.multiple?t.map(i=>i.value):t[0]?t[0].value:void 0}set value(t){this._setSelectionByValue(t),this.valueChange.emit(this.value)}valueChange=new me;get selected(){let t=this._selectionModel?this._selectionModel.selected:[];return this.multiple?t:t[0]||null}get multiple(){return this._multiple}set multiple(t){this._multiple=t,this._markButtonsForCheck()}get disabled(){return this._disabled}set disabled(t){this._disabled=t,this._markButtonsForCheck()}get disabledInteractive(){return this._disabledInteractive}set disabledInteractive(t){this._disabledInteractive=t,this._markButtonsForCheck()}get dir(){return this._dir&&this._dir.value==="rtl"?"rtl":"ltr"}change=new me;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(t){this._hideSingleSelectionIndicator=t,this._markButtonsForCheck()}_hideSingleSelectionIndicator;get hideMultipleSelectionIndicator(){return this._hideMultipleSelectionIndicator}set hideMultipleSelectionIndicator(t){this._hideMultipleSelectionIndicator=t,this._markButtonsForCheck()}_hideMultipleSelectionIndicator;constructor(){let t=M(Qj,{optional:!0});this.appearance=t&&t.appearance?t.appearance:"standard",this._hideSingleSelectionIndicator=t?.hideSingleSelectionIndicator??!1,this._hideMultipleSelectionIndicator=t?.hideMultipleSelectionIndicator??!1}ngOnInit(){this._selectionModel=new V1(this.multiple,void 0,!1)}ngAfterContentInit(){this._selectionModel.select(...this._buttonToggles.filter(t=>t.checked)),this.multiple||this._initializeTabIndex()}writeValue(t){this.value=t,this._changeDetector.markForCheck()}registerOnChange(t){this._controlValueAccessorChangeFn=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t}_keydown(t){if(this.multiple||this.disabled||Os(t))return;let r=t.target.id,o=this._buttonToggles.toArray().findIndex(s=>s.buttonId===r),a=null;switch(t.keyCode){case 32:case 13:a=this._buttonToggles.get(o)||null;break;case 38:a=this._getNextButton(o,-1);break;case 37:a=this._getNextButton(o,this.dir==="ltr"?-1:1);break;case 40:a=this._getNextButton(o,1);break;case 39:a=this._getNextButton(o,this.dir==="ltr"?1:-1);break;default:return}a&&(t.preventDefault(),a._onButtonClick(),a.focus())}_emitChangeEvent(t){let i=new Ow(t,this.value);this._rawValue=i.value,this._controlValueAccessorChangeFn(i.value),this.change.emit(i)}_syncButtonToggle(t,i,r=!1,o=!1){!this.multiple&&this.selected&&!t.checked&&(this.selected.checked=!1),this._selectionModel?i?this._selectionModel.select(t):this._selectionModel.deselect(t):o=!0,o?Promise.resolve().then(()=>this._updateModelValue(t,r)):this._updateModelValue(t,r)}_isSelected(t){return this._selectionModel&&this._selectionModel.isSelected(t)}_isPrechecked(t){return typeof this._rawValue>"u"?!1:this.multiple&&Array.isArray(this._rawValue)?this._rawValue.some(i=>t.value!=null&&i===t.value):t.value===this._rawValue}_initializeTabIndex(){if(this._buttonToggles.forEach(t=>{t.tabIndex=-1}),this.selected)this.selected.tabIndex=0;else for(let t=0;t<this._buttonToggles.length;t++){let i=this._buttonToggles.get(t);if(!i.disabled){i.tabIndex=0;break}}}_getNextButton(t,i){let r=this._buttonToggles;for(let o=1;o<=r.length;o++){let a=(t+i*o+r.length)%r.length,s=r.get(a);if(s&&!s.disabled)return s}return null}_setSelectionByValue(t){if(this._rawValue=t,!this._buttonToggles)return;let i=this._buttonToggles.toArray();if(this.multiple&&t?(Array.isArray(t),this._clearSelection(),t.forEach(r=>this._selectValue(r,i))):(this._clearSelection(),this._selectValue(t,i)),!this.multiple&&i.every(r=>r.tabIndex===-1)){for(let r of i)if(!r.disabled){r.tabIndex=0;break}}}_clearSelection(){this._selectionModel.clear(),this._buttonToggles.forEach(t=>{t.checked=!1,this.multiple||(t.tabIndex=-1)})}_selectValue(t,i){for(let r of i)if(r.value===t){r.checked=!0,this._selectionModel.select(r),this.multiple||(r.tabIndex=0);break}}_updateModelValue(t,i){i&&this._emitChangeEvent(t),this.valueChange.emit(this.value)}_markButtonsForCheck(){this._buttonToggles?.forEach(t=>t._markForCheck())}static \u0275fac=function(i){return new(i||n)};static \u0275dir=pt({type:n,selectors:[["mat-button-toggle-group"]],contentQueries:function(i,r,o){if(i&1&&sn(o,Fw,5),i&2){let a;Ee(a=Ie())&&(r._buttonToggles=a)}},hostAttrs:[1,"mat-button-toggle-group"],hostVars:6,hostBindings:function(i,r){i&1&&T("keydown",function(a){return r._keydown(a)}),i&2&&(Ye("role",r.multiple?"group":"radiogroup")("aria-disabled",r.disabled),ht("mat-button-toggle-vertical",r.vertical)("mat-button-toggle-group-appearance-standard",r.appearance==="standard"))},inputs:{appearance:"appearance",name:"name",vertical:[2,"vertical","vertical",He],value:"value",multiple:[2,"multiple","multiple",He],disabled:[2,"disabled","disabled",He],disabledInteractive:[2,"disabledInteractive","disabledInteractive",He],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",He],hideMultipleSelectionIndicator:[2,"hideMultipleSelectionIndicator","hideMultipleSelectionIndicator",He]},outputs:{valueChange:"valueChange",change:"change"},exportAs:["matButtonToggleGroup"],features:[Ft([Wve,{provide:Jj,useExisting:n}])]})}return n})(),Fw=(()=>{class n{_changeDetectorRef=M(ae);_elementRef=M(ft);_focusMonitor=M(Uo);_idGenerator=M(nr);_animationDisabled=Kn();_checked=!1;ariaLabel;ariaLabelledby=null;_buttonElement;buttonToggleGroup;get buttonId(){return`${this.id}-button`}id;name;value;get tabIndex(){return this._tabIndex()}set tabIndex(t){this._tabIndex.set(t)}_tabIndex;disableRipple=!1;get appearance(){return this.buttonToggleGroup?this.buttonToggleGroup.appearance:this._appearance}set appearance(t){this._appearance=t}_appearance;get checked(){return this.buttonToggleGroup?this.buttonToggleGroup._isSelected(this):this._checked}set checked(t){t!==this._checked&&(this._checked=t,this.buttonToggleGroup&&this.buttonToggleGroup._syncButtonToggle(this,this._checked),this._changeDetectorRef.markForCheck())}get disabled(){return this._disabled||this.buttonToggleGroup&&this.buttonToggleGroup.disabled}set disabled(t){this._disabled=t}_disabled=!1;get disabledInteractive(){return this._disabledInteractive||this.buttonToggleGroup!==null&&this.buttonToggleGroup.disabledInteractive}set disabledInteractive(t){this._disabledInteractive=t}_disabledInteractive;change=new me;constructor(){M(Dr).load(Qr);let t=M(Jj,{optional:!0}),i=M(new Ul("tabindex"),{optional:!0})||"",r=M(Qj,{optional:!0});this._tabIndex=$(parseInt(i)||0),this.buttonToggleGroup=t,this._appearance=r&&r.appearance?r.appearance:"standard",this._disabledInteractive=r?.disabledInteractive??!1}ngOnInit(){let t=this.buttonToggleGroup;this.id=this.id||this._idGenerator.getId("mat-button-toggle-"),t&&(t._isPrechecked(this)?this.checked=!0:t._isSelected(this)!==this._checked&&t._syncButtonToggle(this,this._checked))}ngAfterViewInit(){this._animationDisabled||this._elementRef.nativeElement.classList.add("mat-button-toggle-animations-enabled"),this._focusMonitor.monitor(this._elementRef,!0)}ngOnDestroy(){let t=this.buttonToggleGroup;this._focusMonitor.stopMonitoring(this._elementRef),t&&t._isSelected(this)&&t._syncButtonToggle(this,!1,!1,!0)}focus(t){this._buttonElement.nativeElement.focus(t)}_onButtonClick(){if(this.disabled)return;let t=this.isSingleSelector()?!0:!this._checked;if(t!==this._checked&&(this._checked=t,this.buttonToggleGroup&&(this.buttonToggleGroup._syncButtonToggle(this,this._checked,!0),this.buttonToggleGroup._onTouched())),this.isSingleSelector()){let i=this.buttonToggleGroup._buttonToggles.find(r=>r.tabIndex===0);i&&(i.tabIndex=-1),this.tabIndex=0}this.change.emit(new Ow(this,this.value))}_markForCheck(){this._changeDetectorRef.markForCheck()}_getButtonName(){return this.isSingleSelector()?this.buttonToggleGroup.name:this.name||null}isSingleSelector(){return this.buttonToggleGroup&&!this.buttonToggleGroup.multiple}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=U({type:n,selectors:[["mat-button-toggle"]],viewQuery:function(i,r){if(i&1&&Ot(zve,5),i&2){let o;Ee(o=Ie())&&(r._buttonElement=o.first)}},hostAttrs:["role","presentation",1,"mat-button-toggle"],hostVars:14,hostBindings:function(i,r){i&1&&T("focus",function(){return r.focus()}),i&2&&(Ye("aria-label",null)("aria-labelledby",null)("id",r.id)("name",null),ht("mat-button-toggle-standalone",!r.buttonToggleGroup)("mat-button-toggle-checked",r.checked)("mat-button-toggle-disabled",r.disabled)("mat-button-toggle-disabled-interactive",r.disabledInteractive)("mat-button-toggle-appearance-standard",r.appearance==="standard"))},inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],id:"id",name:"name",value:"value",tabIndex:"tabIndex",disableRipple:[2,"disableRipple","disableRipple",He],appearance:"appearance",checked:[2,"checked","checked",He],disabled:[2,"disabled","disabled",He],disabledInteractive:[2,"disabledInteractive","disabledInteractive",He]},outputs:{change:"change"},exportAs:["matButtonToggle"],ngContentSelectors:jve,decls:7,vars:13,consts:[["button",""],["type","button",1,"mat-button-toggle-button","mat-focus-indicator",3,"click","id","disabled"],[1,"mat-button-toggle-checkbox-wrapper"],[1,"mat-button-toggle-label-content"],[1,"mat-button-toggle-focus-overlay"],["matRipple","",1,"mat-button-toggle-ripple",3,"matRippleTrigger","matRippleDisabled"],["state","checked","aria-hidden","true","appearance","minimal",3,"disabled"]],template:function(i,r){if(i&1&&(fe(),u(0,"button",1,0),T("click",function(){return r._onButtonClick()}),R(2,Uve,2,1,"div",2),u(3,"span",3),de(4),h()(),z(5,"span",4)(6,"span",5)),i&2){let o=Be(1);w("id",r.buttonId)("disabled",r.disabled&&!r.disabledInteractive||null),Ye("role",r.isSingleSelector()?"radio":"button")("tabindex",r.disabled&&!r.disabledInteractive?-1:r.tabIndex)("aria-pressed",r.isSingleSelector()?null:r.checked)("aria-checked",r.isSingleSelector()?r.checked:null)("name",r._getButtonName())("aria-label",r.ariaLabel)("aria-labelledby",r.ariaLabelledby)("aria-disabled",r.disabled&&r.disabledInteractive?"true":null),f(2),A(r.buttonToggleGroup&&(!r.buttonToggleGroup.multiple&&!r.buttonToggleGroup.hideSingleSelectionIndicator||r.buttonToggleGroup.multiple&&!r.buttonToggleGroup.hideMultipleSelectionIndicator)?2:-1),f(4),w("matRippleTrigger",o)("matRippleDisabled",r.disableRipple||r.disabled)}},dependencies:[Wo,ND],styles:[`.mat-button-toggle-standalone,
|
|
4098
4098
|
.mat-button-toggle-group {
|
|
4099
4099
|
position: relative;
|
|
4100
4100
|
display: inline-flex;
|