@signalk/freeboard-sk 3.0.0-rc.2 → 3.0.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.
@@ -697,7 +697,7 @@ To display the radar overlay WebGL support is required.`)}init(e){return ee(this
697
697
  .cdk-drag-preview * {
698
698
  pointer-events: none !important;
699
699
  }
700
- `],encapsulation:2,changeDetection:0})}return n})(),ux=(()=>{class n{_ngZone=M(zi);_document=M(Wo);_styleLoader=M(Ir);_renderer=M(bC).createRenderer(null,null);_cleanupDocumentTouchmove;_scroll=new Ge;_dropInstances=new Set;_dragInstances=new Set;_activeDragInstances=J([]);_globalListeners;_draggingPredicate=t=>t.isDragging();_domNodesToDirectives=null;pointerMove=new Ge;pointerUp=new Ge;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,BT)})}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(Hie),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),m1],["selectstart",this._preventDefaultWhileDragging,BT]];r?a.push(["touchend",o,m1],["touchcancel",o,m1]):a.push(["mouseup",o,m1]),r||a.push(["mousemove",s=>this.pointerMove.next(s),BT]),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 Eu(r=>this._ngZone.runOutsideAngular(()=>{let o=this._renderer.listen(t,"scroll",a=>{this._activeDragInstances().length&&r.next(a)},m1);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=et({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function YO(n){let e=n.toLowerCase().indexOf("ms")>-1?1:1e3;return parseFloat(n)*e}function Kie(n){let e=getComputedStyle(n),t=VT(e,"transition-property"),i=t.find(s=>s==="transform"||s==="all");if(!i)return 0;let r=t.indexOf(i),o=VT(e,"transition-duration"),a=VT(e,"transition-delay");return YO(o[r])+YO(a[r])}function VT(n,e){return n.getPropertyValue(e).split(",").map(i=>i.trim())}var $ie=new Set(["position"]),zT=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),QO(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 Kie(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=oF(a,this._document),this._previewEmbeddedView=a,e.matchSize?XO(r,o):r.style.transform=_1(this._pickupPositionOnPage.x,this._pickupPositionOnPage.y)}else r=GT(this._rootElement),XO(r,this._initialDomRect),this._initialTransform&&(r.style.transform=this._initialTransform);return qT(r.style,{"pointer-events":"none",margin:QO(r)?"0 auto 0 0":"0",position:"fixed",top:"0",left:"0","z-index":this._zIndex+""},$ie),mf(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 QO(n){return"showPopover"in n}var qie={passive:!0},JO={passive:!1},Zie={passive:!1,capture:!0},Xie=800,eF="cdk-drag-placeholder",tF=new Set(["position"]);function aF(n,e,t={dragStartThreshold:5,pointerDirectionChangeThreshold:5}){let i=n.get(On,null,{optional:!0})||n.get(bC).createRenderer(null,null);return new WT(e,t,n.get(Wo),n.get(zi),n.get(kp),n.get(ux),i)}var WT=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=J(!1);_hasMoved=!1;_initialContainer;_initialIndex;_parentPositions;_moveEvents=new Ge;_pointerDirectionDelta;_pointerPositionAtLastDirectionChange;_lastKnownPointerPosition;_rootElement;_ownerSVGElement=null;_rootElementTapHighlight;_pointerMoveSubscription=nr.EMPTY;_pointerUpSubscription=nr.EMPTY;_scrollSubscription=nr.EMPTY;_resizeSubscription=nr.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=>mf(t,e)))}_disabled=!1;beforeStarted=new Ge;started=new Ge;released=new Ge;ended=new Ge;entered=new Ge;exited=new Ge;dropped=new Ge;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 sx(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=>Sc(i)),this._handles.forEach(i=>mf(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=Sc(e);if(t!==this._rootElement){this._removeRootElementListeners();let i=this._renderer;this._rootElementCleanups=this._ngZone.runOutsideAngular(()=>[i.listen(t,"mousedown",this._pointerDown,JO),i.listen(t,"touchstart",this._pointerDown,qie),i.listen(t,"dragstart",this._nativeDragStart,JO)]),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?Sc(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&&Uie(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=_1(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),mf(e,!0))}enableHandle(e){this._disabledHandles.has(e)&&(this._disabledHandles.delete(e),mf(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){f1(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",Yie,Zie)}),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 zT(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)),ZO(r,!1,tF),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=f1(t),o=!r&&t.button!==0,a=this._rootElement,s=Wf(t),l=!r&&this._lastTouchEventTime&&this._lastTouchEventTime+Xie>Date.now(),c=r?Z1(t):q1(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=$T(this._boundaryElement));let d=this._previewTemplate;this._pickupPositionInElement=d&&d.template&&!d.matchSize?{x:0,y:0}:this._getPointerPositionInElement(this._initialDomRect,e,t);let h=this._pickupPositionOnPage=this._lastKnownPointerPosition=this._getPointerPositionOnPage(t);this._pointerDirectionDelta={x:0,y:0},this._pointerPositionAtLastDirectionChange={x:h.x,y:h.y},this._dragStartTime=Date.now(),this._dragDropRegistry.startDragging(this,t)}_cleanupDragArtifacts(e){ZO(this._rootElement,!0,tF),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&&Wf(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=oF(this._placeholderRef,this._document)):i=GT(this._rootElement),i.style.pointerEvents="none",i.classList.add(eF),i}_getPointerPositionInElement(e,t,i){let r=t===this._rootElement?null:t,o=r?r.getBoundingClientRect():e,a=f1(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=f1(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,h=s.bottom-(c-a),m=s.left+o,f=s.right-(l-o);i=iF(i,m,f),r=iF(r,d,h)}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,mf(this._rootElement,e))}_removeRootElementListeners(){this._rootElementCleanups?.forEach(e=>e()),this._rootElementCleanups=void 0}_applyRootElementTransform(e,t){let i=1/this.scale,r=_1(e*i,t*i),o=this._rootElement.style;this._initialTransform==null&&(this._initialTransform=o.transform&&o.transform!="none"?o.transform:""),o.transform=lx(r,this._initialTransform)}_applyPreviewTransform(e,t){let i=this._previewTemplate?.template?void 0:this._initialTransform,r=_1(e,t);this._preview.setTransform(lx(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:f1(e)?t.touch:t?t.mouse:0}_updateOnScroll(e){let t=this._parentPositions.handleScroll(e);if(t){let i=Wf(e);this._boundaryRect&&i!==this._boundaryElement&&i.contains(this._boundaryElement)&&g1(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=K1(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 Sc(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??=GT(this._placeholder);r.classList.remove(eF),r.classList.add("cdk-drag-anchor"),r.style.transform="",i?i.before(r):Sc(t.element).appendChild(r)}}};function iF(n,e,t){return Math.max(e,Math.min(t,n))}function f1(n){return n.type[0]==="t"}function Yie(n){n.preventDefault()}function Js(n,e,t){let i=UT(e,n.length-1),r=UT(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 sF(n,e,t,i){let r=UT(i,e.length);n.length&&e.splice(r,0,n[t])}function UT(n,e){return Math.max(0,Math.min(e,n))}var cx=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,h=c.clientRect,m=l>a?1:-1,f=this._getItemOffsetPx(d,h,m),y=this._getSiblingOffsetPx(l,o,m),b=o.slice();return Js(o,l,a),o.forEach((S,I)=>{if(b[I]===S)return;let D=S.drag===e,E=D?f:y,C=D?e.getPlaceholderElement():S.drag.getRootElement();S.offset+=E;let x=Math.round(S.offset*(1/S.drag.scale));s?(C.style.transform=lx(`translate3d(${x}px, 0, 0)`,S.initialTransform),g1(S.clientRect,0,E)):(C.style.transform=lx(`translate3d(0, ${x}px, 0)`,S.initialTransform),g1(S.clientRect,E,0))}),this._previousSwap.overlaps=jT(h,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})=>{g1(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:$T(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}},HT=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),Js(this._activeItems,l,o);let h=this._getRootNode().elementFromPoint(t,i);return a.deltaX=r.x,a.deltaY=r.y,a.drag=s,a.overlaps=d===h||d.contains(h),{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=K1(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}},nF=.05,lF=.05,Qs=(function(n){return n[n.NONE=0]="NONE",n[n.UP=1]="UP",n[n.DOWN=2]="DOWN",n})(Qs||{}),Ca=(function(n){return n[n.NONE=0]="NONE",n[n.LEFT=1]="LEFT",n[n.RIGHT=2]="RIGHT",n})(Ca||{});function cF(n,e){return new KT(e,n.get(ux),n.get(Wo),n.get(zi),n.get(kp))}var KT=class{_dragDropRegistry;_ngZone;_viewportRuler;element;disabled=!1;sortingDisabled=!1;lockAxis=null;autoScrollDisabled=!1;autoScrollStep=2;hasAnchor=!1;enterPredicate=()=>!0;sortPredicate=()=>!0;beforeStarted=new Ge;entered=new Ge;exited=new Ge;dropped=new Ge;sorted=new Ge;receivingStarted=new Ge;receivingStopped=new Ge;data;_container;_isDragging=!1;_parentPositions;_sortStrategy;_domRect;_draggables=[];_siblings=[];_activeSiblings=new Set;_viewportScrollSubscription=nr.EMPTY;_verticalScrollDirection=Qs.NONE;_horizontalScrollDirection=Ca.NONE;_scrollNode;_stopScrollTimers=new Ge;_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=Sc(e);this._document=i,this.withOrientation("vertical").withElementContainer(a),t.registerDropContainer(this),this._parentPositions=new sx(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 cx&&(this._sortStrategy.direction=e),this}connectedTo(e){return this._siblings=e.slice(),this}withOrientation(e){if(e==="mixed")this._sortStrategy=new HT(this._document,this._dragDropRegistry);else{let t=new cx(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=Sc(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||!qO(this._domRect,nF,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=Qs.NONE,o=Ca.NONE;if(this._parentPositions.positions.forEach((a,s)=>{s===this._document||!a.clientRect||i||qO(a.clientRect,nF,e,t)&&([r,o]=Qie(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=dF(l,t),o=uF(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(),zE(0,VE).pipe(vi(this._stopScrollTimers)).subscribe(()=>{let e=this._scrollNode,t=this.autoScrollStep;this._verticalScrollDirection===Qs.UP?e.scrollBy(0,-t):this._verticalScrollDirection===Qs.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&&jT(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||!jT(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=K1(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 dF(n,e){let{top:t,bottom:i,height:r}=n,o=r*lF;return e>=t-o&&e<=t+o?Qs.UP:e>=i-o&&e<=i+o?Qs.DOWN:Qs.NONE}function uF(n,e){let{left:t,right:i,width:r}=n,o=r*lF;return e>=t-o&&e<=t+o?Ca.LEFT:e>=i-o&&e<=i+o?Ca.RIGHT:Ca.NONE}function Qie(n,e,t,i,r){let o=dF(e,r),a=uF(e,i),s=Qs.NONE,l=Ca.NONE;if(o){let c=n.scrollTop;o===Qs.UP?c>0&&(s=Qs.UP):n.scrollHeight-c>n.clientHeight&&(s=Qs.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 Jie=(()=>{class n{_injector=M(Wr);constructor(){}createDrag(t,i){return aF(this._injector,t,i)}createDropList(t){return cF(this._injector,t)}static \u0275fac=function(i){return new(i||n)};static \u0275prov=et({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),dx=new Ct("CDK_DRAG_PARENT");var pF=new Ct("CdkDragHandle"),ff=(()=>{class n{element=M(wt);_parentDrag=M(dx,{optional:!0,skipSelf:!0});_dragDropRegistry=M(ux);_stateChanges=new Ge;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=st({type:n,selectors:[["","cdkDragHandle",""]],hostAttrs:[1,"cdk-drag-handle"],inputs:{disabled:[2,"cdkDragHandleDisabled","disabled",He]},features:[Rt([{provide:pF,useExisting:n}])]})}return n})(),hF=new Ct("CDK_DRAG_CONFIG"),mF=new Ct("CdkDropList"),el=(()=>{class n{element=M(wt);dropContainer=M(mF,{optional:!0,skipSelf:!0});_ngZone=M(zi);_viewContainerRef=M(pa);_dir=M(oo,{optional:!0});_changeDetectorRef=M(oe);_selfHandle=M(pF,{optional:!0,self:!0});_parentDrag=M(dx,{optional:!0,skipSelf:!0});_dragDropRegistry=M(ux);_destroyed=new Ge;_handles=new ol([]);_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 pe;released=new pe;ended=new pe;entered=new pe;exited=new pe;dropped=new pe;moved=new Eu(t=>{let i=this._dragRef.moved.pipe(Or(r=>({source:this,pointerPosition:r.pointerPosition,event:r.event,delta:r.delta,distance:r.distance}))).subscribe(t);return()=>{i.unsubscribe()}});_injector=M(Wr);constructor(){let t=this.dropContainer,i=M(hF,{optional:!0});this._dragRef=aF(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(vi(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(){sl(()=>{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):Sc(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:wC(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(ua(t=>{let i=t.map(r=>r.element);this._selfHandle&&this.rootElementSelector&&i.push(this.element),this._dragRef.withHandles(i)}),hr(t=>Er(...t.map(i=>i._stateChanges.pipe(un(i))))),vi(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=st({type:n,selectors:[["","cdkDrag",""]],hostAttrs:[1,"cdk-drag"],hostVars:4,hostBindings:function(i,r){i&2&&yt("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",Wi]},outputs:{started:"cdkDragStarted",released:"cdkDragReleased",ended:"cdkDragEnded",entered:"cdkDragEntered",exited:"cdkDragExited",dropped:"cdkDragDropped",moved:"cdkDragMoved"},exportAs:["cdkDrag"],features:[Rt([{provide:dx,useExisting:n}]),Me]})}return n})(),rF=new Ct("CdkDropListGroup");var gf=(()=>{class n{element=M(wt);_changeDetectorRef=M(oe);_scrollDispatcher=M(SC);_dir=M(oo,{optional:!0});_group=M(rF,{optional:!0,skipSelf:!0});_latestSortedRefs;_destroyed=new Ge;_scrollableParentsResolved=!1;static _dropLists=[];_dropListRef;connectedTo=[];data;orientation="vertical";id=M(rr).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 pe;entered=new pe;exited=new pe;sorted=new pe;_unsortedItems=new Set;constructor(){let t=M(hF,{optional:!0}),i=M(Wr);this._dropListRef=cF(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(un(this._dir.value),vi(this._destroyed)).subscribe(i=>t.withDirection(i)),t.beforeStarted.subscribe(()=>{let i=cI(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=wC(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=st({type:n,selectors:[["","cdkDropList",""],["cdk-drop-list"]],hostAttrs:[1,"cdk-drop-list"],hostVars:7,hostBindings:function(i,r){i&2&&(lt("id",r.id),yt("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:[Rt([{provide:rF,useValue:void 0},{provide:mF,useExisting:n}])]})}return n})();var ene=new Ct("CdkDragPlaceholder"),fF=(()=>{class n{templateRef=M(Hr);_drag=M(dx,{optional:!0});data;constructor(){this._drag?._setPlaceholderTemplate(this)}ngOnDestroy(){this._drag?._resetPlaceholderTemplate(this)}static \u0275fac=function(i){return new(i||n)};static \u0275dir=st({type:n,selectors:[["ng-template","cdkDragPlaceholder",""]],inputs:{data:"data"},features:[Rt([{provide:ene,useExisting:n}])]})}return n})();var px=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=Mi({type:n});static \u0275inj=Si({providers:[Jie],imports:[$1]})}return n})();var y1=100,tne=200,_F=n=>Number.isFinite(n)?Math.min(tne,Math.max(0,Math.round(n*100))):y1,yF=n=>n/100,hx=class n{brightness=J(y1);contrast=J(y1);dialogRef=M(ui);data=M(pi);initialPosition=this.data.position??{x:0,y:0};ngOnInit(){this.brightness.set(_F(this.data.value?.brightness??1)),this.contrast.set(_F(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(y1),this.contrast.set(y1),this.emitChange()}onDragEnded(e){typeof this.data?.onMoved=="function"&&this.data.onMoved(e.source.getFreeDragPosition())}currentValue(){return{brightness:yF(this.brightness()),contrast:yF(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=W({type:n,selectors:[["ap-image-adjustment-dialog"]],decls:30,vars:12,consts:[["cdkDrag","","cdkDragRootElement",".cdk-overlay-pane",1,"_ap-image-adjustment",2,"overflow","hidden",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","padding-left","8px","font-weight","500"],["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"),p(),u(4,"div",3),_(5),p(),u(6,"button",4),T("click",function(){return i.handleClose(!1)}),u(7,"mat-icon"),_(8,"close"),p()()(),u(9,"mat-dialog-content",5)(10,"div",6)(11,"div",7),_(12,"Brightness"),p(),u(13,"mat-slider",8)(14,"input",9),T("input",function(o){return i.onBrightnessChange(o)}),p()(),u(15,"div",10),_(16),p()(),u(17,"div",6)(18,"div",7),_(19,"Contrast"),p(),u(20,"mat-slider",8)(21,"input",11),T("input",function(o){return i.onContrastChange(o)}),p()(),u(22,"div",10),_(23),p()()(),u(24,"mat-dialog-actions",12)(25,"button",13),T("click",function(){return i.reset()}),_(26,"RESET"),p(),j(27,"span",14),u(28,"button",13),T("click",function(){return i.handleClose(!0)}),_(29,"SAVE"),p()()()),t&2&&(w("cdkDragFreeDragPosition",i.initialPosition),g(5),q(" ",i.data.text," "),g(8),w("min",0)("max",200)("step",1),g(),w("value",i.brightness()),g(2),q(" ",i.brightness(),"% "),g(4),w("min",0)("max",200)("step",1),g(),w("value",i.contrast()),g(2),q(" ",i.contrast(),"% "))},dependencies:[Rs,Ps,ss,ae,le,ue,Ze,Ne,mi,Ni,hi,ve,el,ff],encapsulation:2})};var vF="3.0.0-rc.2";function bF(n){let e=!0,t=Object.keys(n);return Object.keys(XT()).forEach(i=>{t.includes(i)||(e=!1)}),e}function ZT(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.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}}:(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})),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:sf.otherLayers,depthUnit:n.units.depth??"m"}:(typeof n.map.s57Options.otherLayers>"u"&&(n.map.s57Options.otherLayers=sf.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.lockMoveMap>"u"&&(n.map.lockMoveMap=!1),typeof n.map.popoverMulti>"u"&&(n.map.popoverMulti=!1),typeof n.map.centerOffset>"u"&&(n.map.centerOffset=0),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:"navigation.courseOverGroundTrue",course:"navigation.courseGreatCircle"}),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,trailFromServer:!1,trailDuration:24,trailResolution:{lastHour:"5s",next23:"1m",beyond24:"5m"}}:(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(t=>(t.corner&&!t.anchor&&(t.anchor=t.corner==="tl"?"tr":t.corner,delete t.corner),t)).filter(t=>["tr","ct","cb","bl","br"].includes(t.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:{},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.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),n.selections.notes,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 t=parseInt(e.zoom);isNaN(t)||(n.map.zoomLevel=t>28?28:t<1?1:t)}catch(t){console.warn(`Invalid zoom level parameter (${e.zoom} supplied!`)}}function XT(){return{ui:{mapNorthUp:!0,mapMove:!1,mapConstrainZoom:!1,toolbarButtons:!0,invertColor:!1,showCourseData:!0,showAisTargets:!0,showNotes:!0,autoNightMode:!1},imageAdjustPalettePos: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}},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:"navigation.courseOverGroundTrue",course:"navigation.courseGreatCircle"},useServerPrefs:!1},map:{zoomLevel:2,center:[0,0],rotation:0,lockMoveMap:!0,animate:!1,labelsMinZoom:8,doubleClickZoom:!1,overZoomTiles:!0,centerOffset:0,s57Options:{graphicsStyle:"Paper",boundaries:"Plain",colors:4,shallowDepth:2,safetyDepth:3,deepDepth:6,colorTable:0,otherLayers:sf.otherLayers,depthUnit:"m"},popoverMulti:!1},course:{autoNextPointOnArrival:!1,autoNextPointDelay:5e3,autoNextPointTrigger:"perpendicularPassed",arrivalCircle:100},vessels:{fixedLocationMode:!1,fixedPosition:[0,0],trail:!1,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,trailFromServer:!1,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:{},aisTargets:null,aisTargetTypes:[],aisFilterByShipType:!1,aisState:[],resourceSets:{},infolayers:null,weatherWindEnabled:!1,oceanCurrentsEnabled:!1,tidalCurrentsEnabled:!1}}}function xF(){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 _d,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 mx=(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(We.nauticalMilesToKm(e.resources.notes.getRadius)))*1e3:r==="fetch:radius"?(e.units.distance==="kilometer"?e.resources.notes.getRadius:Math.floor(We.nauticalMilesToKm(e.resources.fetchRadius)))*1e3:r).join("")),n};var CF="symbols";var wF={id:"freeboard",name:"Freeboard-SK",description:"Signal K Chart Plotter.",version:vF,url:"https://github.com/signalk/freeboard-sk",logo:"./assets/img/app_logo.png"},nne="1.0.0",v1={host:"localhost",port:3e3,ssl:!1},re=class n extends m_{skApiVersion=2;hostDef={name:void 0,port:void 0,ssl:!1,url:void 0,params:{}};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"},{name:"groups",description:"Freeboard resource groups.",featureKey:"resourceGroups"}];get IGNORE_RESOURCES(){return this.STANDARD_RESOURCES.concat(this.CUSTOM_RESOURCES.map(e=>e.name),["buddies",$I,CF])}serverConfig={unitPreferences:J(void 0),pathDisplayUnits:J({})};MAP_ZOOM_EXTENT={min:2,max:28};AudioContext=window.AudioContext||window.webkitAudioContext;audio={context:new AudioContext};db;watchingSKLogin;kioskMode=J(!1);hasAuthToken=J(!1);isLoggedIn=J(!1);instrumentPanelAvailable=J(!0);skAuthChange=J(void 0);sIsFetching=J(!1);sTrueMagChoice=J("");instrumentPanel=J({open:!1,activate:!1});uiCtrl=J({alertList:!1,autopilotConsole:!1,radarLayer:!1,routeBuilder:!1,suppressContextMenu:!1,forceNightMode:!1});uiConfig=J({mapNorthUp:!0,mapMove:!1,mapConstrainZoom:!1,toolbarButtons:!1,invertColor:!1,showCourseData:!0,showAisTargets:!0,showNotes:!0,autoNightMode:!1});featureFlags=J({anchorApi:!0,autopilotApi:!1,weatherApi:!1,radarApi:!1,notificationApi:!1,resourceGroups:!1,resourceTracks:!1,infoLayers:!1,buddyList:!1,tidalApi:!1});selfLines=J({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=J([]);selfTrailFromServer=J([]);mapExtent=J([]);mapViewTopCenter=J([0,0]);mapViewRightCenter=J([0,0]);mapViewRotation=J(0);mapMoveRequest=J(null);signalk=M(Ft);worker=M(Hn);dialog=M(bn);snackbar=M(GI);iconReg=M(Q1);dom=M(Md);s57=M(bp);constructor(){super(wF),this.config=XT(),this.data=xF(),this.suppressPersist=!0,this.db=new YT,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(wF.id),this.signalk.setAppVersion(nne),this.initAppIcons(),this.parseLaunchUrl(),this.instrumentPanelAvailable.update(()=>this.isTopWindow()),this.isTopWindow()||window.addEventListener("message",e=>{this.parseMessageFromParent(e)}),this.testForInternet(),this.loadConfig(),this.parseLocalConfig(),Te(()=>{this.uiConfig(),this.debug("AppFacade.effect().uiConfig",this.uiConfig()),this.config.ui=this.uiConfig(),this.saveConfigDebounced()}),Te(()=>{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(os()||e.origin===this.hostDef.url){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(){ZT(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(e=>({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.debug("doPostConfigLoad(): emit config$.ready"),this.emitConfigEvent("ready"),this.suppressPersist=!1}loadUserConfigfromServer(){return ee(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),ZT(i,this.hostDef.params),bF(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=>yi(he({},i),{[e]:t}))}clearPathDisplayUnits(e){this.serverConfig.pathDisplayUnits.update(t=>{if(!(e in t))return t;let i=he({},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,We.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,We.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,We.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,We.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,We.setSymbol(e.categories.length.targetUnit,e.categories.length.symbol))}}initAppIcons(){_4().forEach(e=>{this.iconReg.addSvgIcon(e.id,this.dom.bypassSecurityTrustResourceUrl(e.path))})}parseLaunchUrl(){window.location.search&&window.location.search.slice(1).split("&").forEach(t=>{let i=t.split("=");this.hostDef.params[i[0]]=i.length>1?i[1]:null}),this.hostDef.name=typeof this.hostDef.params?.host<"u"?this.hostDef.params.host:this.devMode&&v1.host?v1.host:window.location.hostname,this.hostDef.ssl=!!(window.location.protocol==="https:"||this.devMode&&v1.ssl),this.hostDef.port=typeof this.hostDef.params.port<"u"?parseInt(this.hostDef.params.port):this.devMode&&v1.port?v1.port:parseInt(window.location.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.persistToken(this.hostDef.params.token),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!
700
+ `],encapsulation:2,changeDetection:0})}return n})(),ux=(()=>{class n{_ngZone=M(zi);_document=M(Wo);_styleLoader=M(Ir);_renderer=M(bC).createRenderer(null,null);_cleanupDocumentTouchmove;_scroll=new Ge;_dropInstances=new Set;_dragInstances=new Set;_activeDragInstances=J([]);_globalListeners;_draggingPredicate=t=>t.isDragging();_domNodesToDirectives=null;pointerMove=new Ge;pointerUp=new Ge;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,BT)})}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(Hie),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),m1],["selectstart",this._preventDefaultWhileDragging,BT]];r?a.push(["touchend",o,m1],["touchcancel",o,m1]):a.push(["mouseup",o,m1]),r||a.push(["mousemove",s=>this.pointerMove.next(s),BT]),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 Eu(r=>this._ngZone.runOutsideAngular(()=>{let o=this._renderer.listen(t,"scroll",a=>{this._activeDragInstances().length&&r.next(a)},m1);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=et({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function YO(n){let e=n.toLowerCase().indexOf("ms")>-1?1:1e3;return parseFloat(n)*e}function Kie(n){let e=getComputedStyle(n),t=VT(e,"transition-property"),i=t.find(s=>s==="transform"||s==="all");if(!i)return 0;let r=t.indexOf(i),o=VT(e,"transition-duration"),a=VT(e,"transition-delay");return YO(o[r])+YO(a[r])}function VT(n,e){return n.getPropertyValue(e).split(",").map(i=>i.trim())}var $ie=new Set(["position"]),zT=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),QO(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 Kie(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=oF(a,this._document),this._previewEmbeddedView=a,e.matchSize?XO(r,o):r.style.transform=_1(this._pickupPositionOnPage.x,this._pickupPositionOnPage.y)}else r=GT(this._rootElement),XO(r,this._initialDomRect),this._initialTransform&&(r.style.transform=this._initialTransform);return qT(r.style,{"pointer-events":"none",margin:QO(r)?"0 auto 0 0":"0",position:"fixed",top:"0",left:"0","z-index":this._zIndex+""},$ie),mf(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 QO(n){return"showPopover"in n}var qie={passive:!0},JO={passive:!1},Zie={passive:!1,capture:!0},Xie=800,eF="cdk-drag-placeholder",tF=new Set(["position"]);function aF(n,e,t={dragStartThreshold:5,pointerDirectionChangeThreshold:5}){let i=n.get(On,null,{optional:!0})||n.get(bC).createRenderer(null,null);return new WT(e,t,n.get(Wo),n.get(zi),n.get(kp),n.get(ux),i)}var WT=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=J(!1);_hasMoved=!1;_initialContainer;_initialIndex;_parentPositions;_moveEvents=new Ge;_pointerDirectionDelta;_pointerPositionAtLastDirectionChange;_lastKnownPointerPosition;_rootElement;_ownerSVGElement=null;_rootElementTapHighlight;_pointerMoveSubscription=nr.EMPTY;_pointerUpSubscription=nr.EMPTY;_scrollSubscription=nr.EMPTY;_resizeSubscription=nr.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=>mf(t,e)))}_disabled=!1;beforeStarted=new Ge;started=new Ge;released=new Ge;ended=new Ge;entered=new Ge;exited=new Ge;dropped=new Ge;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 sx(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=>Sc(i)),this._handles.forEach(i=>mf(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=Sc(e);if(t!==this._rootElement){this._removeRootElementListeners();let i=this._renderer;this._rootElementCleanups=this._ngZone.runOutsideAngular(()=>[i.listen(t,"mousedown",this._pointerDown,JO),i.listen(t,"touchstart",this._pointerDown,qie),i.listen(t,"dragstart",this._nativeDragStart,JO)]),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?Sc(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&&Uie(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=_1(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),mf(e,!0))}enableHandle(e){this._disabledHandles.has(e)&&(this._disabledHandles.delete(e),mf(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){f1(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",Yie,Zie)}),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 zT(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)),ZO(r,!1,tF),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=f1(t),o=!r&&t.button!==0,a=this._rootElement,s=Wf(t),l=!r&&this._lastTouchEventTime&&this._lastTouchEventTime+Xie>Date.now(),c=r?Z1(t):q1(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=$T(this._boundaryElement));let d=this._previewTemplate;this._pickupPositionInElement=d&&d.template&&!d.matchSize?{x:0,y:0}:this._getPointerPositionInElement(this._initialDomRect,e,t);let h=this._pickupPositionOnPage=this._lastKnownPointerPosition=this._getPointerPositionOnPage(t);this._pointerDirectionDelta={x:0,y:0},this._pointerPositionAtLastDirectionChange={x:h.x,y:h.y},this._dragStartTime=Date.now(),this._dragDropRegistry.startDragging(this,t)}_cleanupDragArtifacts(e){ZO(this._rootElement,!0,tF),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&&Wf(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=oF(this._placeholderRef,this._document)):i=GT(this._rootElement),i.style.pointerEvents="none",i.classList.add(eF),i}_getPointerPositionInElement(e,t,i){let r=t===this._rootElement?null:t,o=r?r.getBoundingClientRect():e,a=f1(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=f1(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,h=s.bottom-(c-a),m=s.left+o,f=s.right-(l-o);i=iF(i,m,f),r=iF(r,d,h)}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,mf(this._rootElement,e))}_removeRootElementListeners(){this._rootElementCleanups?.forEach(e=>e()),this._rootElementCleanups=void 0}_applyRootElementTransform(e,t){let i=1/this.scale,r=_1(e*i,t*i),o=this._rootElement.style;this._initialTransform==null&&(this._initialTransform=o.transform&&o.transform!="none"?o.transform:""),o.transform=lx(r,this._initialTransform)}_applyPreviewTransform(e,t){let i=this._previewTemplate?.template?void 0:this._initialTransform,r=_1(e,t);this._preview.setTransform(lx(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:f1(e)?t.touch:t?t.mouse:0}_updateOnScroll(e){let t=this._parentPositions.handleScroll(e);if(t){let i=Wf(e);this._boundaryRect&&i!==this._boundaryElement&&i.contains(this._boundaryElement)&&g1(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=K1(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 Sc(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??=GT(this._placeholder);r.classList.remove(eF),r.classList.add("cdk-drag-anchor"),r.style.transform="",i?i.before(r):Sc(t.element).appendChild(r)}}};function iF(n,e,t){return Math.max(e,Math.min(t,n))}function f1(n){return n.type[0]==="t"}function Yie(n){n.preventDefault()}function Js(n,e,t){let i=UT(e,n.length-1),r=UT(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 sF(n,e,t,i){let r=UT(i,e.length);n.length&&e.splice(r,0,n[t])}function UT(n,e){return Math.max(0,Math.min(e,n))}var cx=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,h=c.clientRect,m=l>a?1:-1,f=this._getItemOffsetPx(d,h,m),y=this._getSiblingOffsetPx(l,o,m),b=o.slice();return Js(o,l,a),o.forEach((S,I)=>{if(b[I]===S)return;let D=S.drag===e,E=D?f:y,C=D?e.getPlaceholderElement():S.drag.getRootElement();S.offset+=E;let x=Math.round(S.offset*(1/S.drag.scale));s?(C.style.transform=lx(`translate3d(${x}px, 0, 0)`,S.initialTransform),g1(S.clientRect,0,E)):(C.style.transform=lx(`translate3d(0, ${x}px, 0)`,S.initialTransform),g1(S.clientRect,E,0))}),this._previousSwap.overlaps=jT(h,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})=>{g1(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:$T(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}},HT=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),Js(this._activeItems,l,o);let h=this._getRootNode().elementFromPoint(t,i);return a.deltaX=r.x,a.deltaY=r.y,a.drag=s,a.overlaps=d===h||d.contains(h),{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=K1(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}},nF=.05,lF=.05,Qs=(function(n){return n[n.NONE=0]="NONE",n[n.UP=1]="UP",n[n.DOWN=2]="DOWN",n})(Qs||{}),Ca=(function(n){return n[n.NONE=0]="NONE",n[n.LEFT=1]="LEFT",n[n.RIGHT=2]="RIGHT",n})(Ca||{});function cF(n,e){return new KT(e,n.get(ux),n.get(Wo),n.get(zi),n.get(kp))}var KT=class{_dragDropRegistry;_ngZone;_viewportRuler;element;disabled=!1;sortingDisabled=!1;lockAxis=null;autoScrollDisabled=!1;autoScrollStep=2;hasAnchor=!1;enterPredicate=()=>!0;sortPredicate=()=>!0;beforeStarted=new Ge;entered=new Ge;exited=new Ge;dropped=new Ge;sorted=new Ge;receivingStarted=new Ge;receivingStopped=new Ge;data;_container;_isDragging=!1;_parentPositions;_sortStrategy;_domRect;_draggables=[];_siblings=[];_activeSiblings=new Set;_viewportScrollSubscription=nr.EMPTY;_verticalScrollDirection=Qs.NONE;_horizontalScrollDirection=Ca.NONE;_scrollNode;_stopScrollTimers=new Ge;_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=Sc(e);this._document=i,this.withOrientation("vertical").withElementContainer(a),t.registerDropContainer(this),this._parentPositions=new sx(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 cx&&(this._sortStrategy.direction=e),this}connectedTo(e){return this._siblings=e.slice(),this}withOrientation(e){if(e==="mixed")this._sortStrategy=new HT(this._document,this._dragDropRegistry);else{let t=new cx(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=Sc(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||!qO(this._domRect,nF,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=Qs.NONE,o=Ca.NONE;if(this._parentPositions.positions.forEach((a,s)=>{s===this._document||!a.clientRect||i||qO(a.clientRect,nF,e,t)&&([r,o]=Qie(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=dF(l,t),o=uF(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(),zE(0,VE).pipe(vi(this._stopScrollTimers)).subscribe(()=>{let e=this._scrollNode,t=this.autoScrollStep;this._verticalScrollDirection===Qs.UP?e.scrollBy(0,-t):this._verticalScrollDirection===Qs.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&&jT(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||!jT(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=K1(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 dF(n,e){let{top:t,bottom:i,height:r}=n,o=r*lF;return e>=t-o&&e<=t+o?Qs.UP:e>=i-o&&e<=i+o?Qs.DOWN:Qs.NONE}function uF(n,e){let{left:t,right:i,width:r}=n,o=r*lF;return e>=t-o&&e<=t+o?Ca.LEFT:e>=i-o&&e<=i+o?Ca.RIGHT:Ca.NONE}function Qie(n,e,t,i,r){let o=dF(e,r),a=uF(e,i),s=Qs.NONE,l=Ca.NONE;if(o){let c=n.scrollTop;o===Qs.UP?c>0&&(s=Qs.UP):n.scrollHeight-c>n.clientHeight&&(s=Qs.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 Jie=(()=>{class n{_injector=M(Wr);constructor(){}createDrag(t,i){return aF(this._injector,t,i)}createDropList(t){return cF(this._injector,t)}static \u0275fac=function(i){return new(i||n)};static \u0275prov=et({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),dx=new Ct("CDK_DRAG_PARENT");var pF=new Ct("CdkDragHandle"),ff=(()=>{class n{element=M(wt);_parentDrag=M(dx,{optional:!0,skipSelf:!0});_dragDropRegistry=M(ux);_stateChanges=new Ge;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=st({type:n,selectors:[["","cdkDragHandle",""]],hostAttrs:[1,"cdk-drag-handle"],inputs:{disabled:[2,"cdkDragHandleDisabled","disabled",He]},features:[Rt([{provide:pF,useExisting:n}])]})}return n})(),hF=new Ct("CDK_DRAG_CONFIG"),mF=new Ct("CdkDropList"),el=(()=>{class n{element=M(wt);dropContainer=M(mF,{optional:!0,skipSelf:!0});_ngZone=M(zi);_viewContainerRef=M(pa);_dir=M(oo,{optional:!0});_changeDetectorRef=M(oe);_selfHandle=M(pF,{optional:!0,self:!0});_parentDrag=M(dx,{optional:!0,skipSelf:!0});_dragDropRegistry=M(ux);_destroyed=new Ge;_handles=new ol([]);_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 pe;released=new pe;ended=new pe;entered=new pe;exited=new pe;dropped=new pe;moved=new Eu(t=>{let i=this._dragRef.moved.pipe(Or(r=>({source:this,pointerPosition:r.pointerPosition,event:r.event,delta:r.delta,distance:r.distance}))).subscribe(t);return()=>{i.unsubscribe()}});_injector=M(Wr);constructor(){let t=this.dropContainer,i=M(hF,{optional:!0});this._dragRef=aF(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(vi(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(){sl(()=>{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):Sc(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:wC(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(ua(t=>{let i=t.map(r=>r.element);this._selfHandle&&this.rootElementSelector&&i.push(this.element),this._dragRef.withHandles(i)}),hr(t=>Er(...t.map(i=>i._stateChanges.pipe(un(i))))),vi(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=st({type:n,selectors:[["","cdkDrag",""]],hostAttrs:[1,"cdk-drag"],hostVars:4,hostBindings:function(i,r){i&2&&yt("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",Wi]},outputs:{started:"cdkDragStarted",released:"cdkDragReleased",ended:"cdkDragEnded",entered:"cdkDragEntered",exited:"cdkDragExited",dropped:"cdkDragDropped",moved:"cdkDragMoved"},exportAs:["cdkDrag"],features:[Rt([{provide:dx,useExisting:n}]),Me]})}return n})(),rF=new Ct("CdkDropListGroup");var gf=(()=>{class n{element=M(wt);_changeDetectorRef=M(oe);_scrollDispatcher=M(SC);_dir=M(oo,{optional:!0});_group=M(rF,{optional:!0,skipSelf:!0});_latestSortedRefs;_destroyed=new Ge;_scrollableParentsResolved=!1;static _dropLists=[];_dropListRef;connectedTo=[];data;orientation="vertical";id=M(rr).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 pe;entered=new pe;exited=new pe;sorted=new pe;_unsortedItems=new Set;constructor(){let t=M(hF,{optional:!0}),i=M(Wr);this._dropListRef=cF(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(un(this._dir.value),vi(this._destroyed)).subscribe(i=>t.withDirection(i)),t.beforeStarted.subscribe(()=>{let i=cI(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=wC(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=st({type:n,selectors:[["","cdkDropList",""],["cdk-drop-list"]],hostAttrs:[1,"cdk-drop-list"],hostVars:7,hostBindings:function(i,r){i&2&&(lt("id",r.id),yt("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:[Rt([{provide:rF,useValue:void 0},{provide:mF,useExisting:n}])]})}return n})();var ene=new Ct("CdkDragPlaceholder"),fF=(()=>{class n{templateRef=M(Hr);_drag=M(dx,{optional:!0});data;constructor(){this._drag?._setPlaceholderTemplate(this)}ngOnDestroy(){this._drag?._resetPlaceholderTemplate(this)}static \u0275fac=function(i){return new(i||n)};static \u0275dir=st({type:n,selectors:[["ng-template","cdkDragPlaceholder",""]],inputs:{data:"data"},features:[Rt([{provide:ene,useExisting:n}])]})}return n})();var px=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=Mi({type:n});static \u0275inj=Si({providers:[Jie],imports:[$1]})}return n})();var y1=100,tne=200,_F=n=>Number.isFinite(n)?Math.min(tne,Math.max(0,Math.round(n*100))):y1,yF=n=>n/100,hx=class n{brightness=J(y1);contrast=J(y1);dialogRef=M(ui);data=M(pi);initialPosition=this.data.position??{x:0,y:0};ngOnInit(){this.brightness.set(_F(this.data.value?.brightness??1)),this.contrast.set(_F(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(y1),this.contrast.set(y1),this.emitChange()}onDragEnded(e){typeof this.data?.onMoved=="function"&&this.data.onMoved(e.source.getFreeDragPosition())}currentValue(){return{brightness:yF(this.brightness()),contrast:yF(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=W({type:n,selectors:[["ap-image-adjustment-dialog"]],decls:30,vars:12,consts:[["cdkDrag","","cdkDragRootElement",".cdk-overlay-pane",1,"_ap-image-adjustment",2,"overflow","hidden",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","padding-left","8px","font-weight","500"],["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"),p(),u(4,"div",3),_(5),p(),u(6,"button",4),T("click",function(){return i.handleClose(!1)}),u(7,"mat-icon"),_(8,"close"),p()()(),u(9,"mat-dialog-content",5)(10,"div",6)(11,"div",7),_(12,"Brightness"),p(),u(13,"mat-slider",8)(14,"input",9),T("input",function(o){return i.onBrightnessChange(o)}),p()(),u(15,"div",10),_(16),p()(),u(17,"div",6)(18,"div",7),_(19,"Contrast"),p(),u(20,"mat-slider",8)(21,"input",11),T("input",function(o){return i.onContrastChange(o)}),p()(),u(22,"div",10),_(23),p()()(),u(24,"mat-dialog-actions",12)(25,"button",13),T("click",function(){return i.reset()}),_(26,"RESET"),p(),j(27,"span",14),u(28,"button",13),T("click",function(){return i.handleClose(!0)}),_(29,"SAVE"),p()()()),t&2&&(w("cdkDragFreeDragPosition",i.initialPosition),g(5),q(" ",i.data.text," "),g(8),w("min",0)("max",200)("step",1),g(),w("value",i.brightness()),g(2),q(" ",i.brightness(),"% "),g(4),w("min",0)("max",200)("step",1),g(),w("value",i.contrast()),g(2),q(" ",i.contrast(),"% "))},dependencies:[Rs,Ps,ss,ae,le,ue,Ze,Ne,mi,Ni,hi,ve,el,ff],encapsulation:2})};var vF="3.0.0";function bF(n){let e=!0,t=Object.keys(n);return Object.keys(XT()).forEach(i=>{t.includes(i)||(e=!1)}),e}function ZT(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.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}}:(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})),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:sf.otherLayers,depthUnit:n.units.depth??"m"}:(typeof n.map.s57Options.otherLayers>"u"&&(n.map.s57Options.otherLayers=sf.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.lockMoveMap>"u"&&(n.map.lockMoveMap=!1),typeof n.map.popoverMulti>"u"&&(n.map.popoverMulti=!1),typeof n.map.centerOffset>"u"&&(n.map.centerOffset=0),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:"navigation.courseOverGroundTrue",course:"navigation.courseGreatCircle"}),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,trailFromServer:!1,trailDuration:24,trailResolution:{lastHour:"5s",next23:"1m",beyond24:"5m"}}:(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(t=>(t.corner&&!t.anchor&&(t.anchor=t.corner==="tl"?"tr":t.corner,delete t.corner),t)).filter(t=>["tr","ct","cb","bl","br"].includes(t.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:{},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.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),n.selections.notes,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 t=parseInt(e.zoom);isNaN(t)||(n.map.zoomLevel=t>28?28:t<1?1:t)}catch(t){console.warn(`Invalid zoom level parameter (${e.zoom} supplied!`)}}function XT(){return{ui:{mapNorthUp:!0,mapMove:!1,mapConstrainZoom:!1,toolbarButtons:!0,invertColor:!1,showCourseData:!0,showAisTargets:!0,showNotes:!0,autoNightMode:!1},imageAdjustPalettePos: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}},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:"navigation.courseOverGroundTrue",course:"navigation.courseGreatCircle"},useServerPrefs:!1},map:{zoomLevel:2,center:[0,0],rotation:0,lockMoveMap:!0,animate:!1,labelsMinZoom:8,doubleClickZoom:!1,overZoomTiles:!0,centerOffset:0,s57Options:{graphicsStyle:"Paper",boundaries:"Plain",colors:4,shallowDepth:2,safetyDepth:3,deepDepth:6,colorTable:0,otherLayers:sf.otherLayers,depthUnit:"m"},popoverMulti:!1},course:{autoNextPointOnArrival:!1,autoNextPointDelay:5e3,autoNextPointTrigger:"perpendicularPassed",arrivalCircle:100},vessels:{fixedLocationMode:!1,fixedPosition:[0,0],trail:!1,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,trailFromServer:!1,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:{},aisTargets:null,aisTargetTypes:[],aisFilterByShipType:!1,aisState:[],resourceSets:{},infolayers:null,weatherWindEnabled:!1,oceanCurrentsEnabled:!1,tidalCurrentsEnabled:!1}}}function xF(){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 _d,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 mx=(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(We.nauticalMilesToKm(e.resources.notes.getRadius)))*1e3:r==="fetch:radius"?(e.units.distance==="kilometer"?e.resources.notes.getRadius:Math.floor(We.nauticalMilesToKm(e.resources.fetchRadius)))*1e3:r).join("")),n};var CF="symbols";var wF={id:"freeboard",name:"Freeboard-SK",description:"Signal K Chart Plotter.",version:vF,url:"https://github.com/signalk/freeboard-sk",logo:"./assets/img/app_logo.png"},nne="1.0.0",v1={host:"localhost",port:3e3,ssl:!1},re=class n extends m_{skApiVersion=2;hostDef={name:void 0,port:void 0,ssl:!1,url:void 0,params:{}};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"},{name:"groups",description:"Freeboard resource groups.",featureKey:"resourceGroups"}];get IGNORE_RESOURCES(){return this.STANDARD_RESOURCES.concat(this.CUSTOM_RESOURCES.map(e=>e.name),["buddies",$I,CF])}serverConfig={unitPreferences:J(void 0),pathDisplayUnits:J({})};MAP_ZOOM_EXTENT={min:2,max:28};AudioContext=window.AudioContext||window.webkitAudioContext;audio={context:new AudioContext};db;watchingSKLogin;kioskMode=J(!1);hasAuthToken=J(!1);isLoggedIn=J(!1);instrumentPanelAvailable=J(!0);skAuthChange=J(void 0);sIsFetching=J(!1);sTrueMagChoice=J("");instrumentPanel=J({open:!1,activate:!1});uiCtrl=J({alertList:!1,autopilotConsole:!1,radarLayer:!1,routeBuilder:!1,suppressContextMenu:!1,forceNightMode:!1});uiConfig=J({mapNorthUp:!0,mapMove:!1,mapConstrainZoom:!1,toolbarButtons:!1,invertColor:!1,showCourseData:!0,showAisTargets:!0,showNotes:!0,autoNightMode:!1});featureFlags=J({anchorApi:!0,autopilotApi:!1,weatherApi:!1,radarApi:!1,notificationApi:!1,resourceGroups:!1,resourceTracks:!1,infoLayers:!1,buddyList:!1,tidalApi:!1});selfLines=J({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=J([]);selfTrailFromServer=J([]);mapExtent=J([]);mapViewTopCenter=J([0,0]);mapViewRightCenter=J([0,0]);mapViewRotation=J(0);mapMoveRequest=J(null);signalk=M(Ft);worker=M(Hn);dialog=M(bn);snackbar=M(GI);iconReg=M(Q1);dom=M(Md);s57=M(bp);constructor(){super(wF),this.config=XT(),this.data=xF(),this.suppressPersist=!0,this.db=new YT,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(wF.id),this.signalk.setAppVersion(nne),this.initAppIcons(),this.parseLaunchUrl(),this.instrumentPanelAvailable.update(()=>this.isTopWindow()),this.isTopWindow()||window.addEventListener("message",e=>{this.parseMessageFromParent(e)}),this.testForInternet(),this.loadConfig(),this.parseLocalConfig(),Te(()=>{this.uiConfig(),this.debug("AppFacade.effect().uiConfig",this.uiConfig()),this.config.ui=this.uiConfig(),this.saveConfigDebounced()}),Te(()=>{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(os()||e.origin===this.hostDef.url){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(){ZT(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(e=>({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.debug("doPostConfigLoad(): emit config$.ready"),this.emitConfigEvent("ready"),this.suppressPersist=!1}loadUserConfigfromServer(){return ee(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),ZT(i,this.hostDef.params),bF(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=>yi(he({},i),{[e]:t}))}clearPathDisplayUnits(e){this.serverConfig.pathDisplayUnits.update(t=>{if(!(e in t))return t;let i=he({},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,We.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,We.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,We.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,We.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,We.setSymbol(e.categories.length.targetUnit,e.categories.length.symbol))}}initAppIcons(){_4().forEach(e=>{this.iconReg.addSvgIcon(e.id,this.dom.bypassSecurityTrustResourceUrl(e.path))})}parseLaunchUrl(){window.location.search&&window.location.search.slice(1).split("&").forEach(t=>{let i=t.split("=");this.hostDef.params[i[0]]=i.length>1?i[1]:null}),this.hostDef.name=typeof this.hostDef.params?.host<"u"?this.hostDef.params.host:this.devMode&&v1.host?v1.host:window.location.hostname,this.hostDef.ssl=!!(window.location.protocol==="https:"||this.devMode&&v1.ssl),this.hostDef.port=typeof this.hostDef.params.port<"u"?parseInt(this.hostDef.params.port):this.devMode&&v1.port?v1.port:parseInt(window.location.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.persistToken(this.hostDef.params.token),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!
701
701
 
702
702
  Please check your Internet connection or select maps from the local network.
703
703
 
@@ -1070,7 +1070,7 @@ Please login and try again.
1070
1070
  .mat-vertical-content {
1071
1071
  padding: 0 24px 24px 24px;
1072
1072
  }
1073
- `],encapsulation:2,changeDetection:0})}return n})(),DF=(()=>{class n extends SF{static \u0275fac=(()=>{let t;return function(r){return(t||(t=Ur(n)))(r||n)}})();static \u0275dir=st({type:n,selectors:[["button","matStepperNext",""]],hostAttrs:[1,"mat-stepper-next"],hostVars:1,hostBindings:function(i,r){i&2&&Kr("type",r.type)},features:[Qe]})}return n})();var _f=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=Mi({type:n});static \u0275inj=Si({providers:[Op],imports:[Pp,MF,ae,Ss,w1,eE,Nn]})}return n})();var iE=ts(Ml());var dn=class n{symDegree="\xBA";transform(e,t,i){let r=i?e<0?"S":"N":e<0?"W":"E";switch(t){case"SHDd":return this.toHDdSigned(e,r);case"DMdH":return this.toDMdH(e,r);case"HDd":return this.toHDd(e,r);case"HDMS":return this.toHDMS(e,r);case"DHMS":return this.toDHMS(e,r);default:return this.toXY(e)}}toXY(e,t=5){return e.toFixed(t)}toHDdSigned(e,t,i=5){let r=["S","W"].includes(t)?`${t} -`:`${t} +`,o=e.toFixed(i);return o=o.substring(o.indexOf(".")),`${r}${Math.floor(Math.abs(e))}${o}${this.symDegree}`}toDMdH(e,t,i=5){let r=Math.floor(Math.abs(e))??0,a=(Math.abs(r===0?e:e%r)*60).toFixed(i),s=["N","S"].includes(t)?"00":"000";return`${(s+r.toString()).slice(0-s.length)}${this.symDegree} ${a}' ${t}`}toHDd(e,t,i=5){let r=e.toFixed(i);return r=r.substring(r.indexOf(".")),`${t} ${Math.floor(Math.abs(e))}${r}${this.symDegree}`}toHDMS(e,t){return`${t} ${(0,iE.decimalToSexagesimal)(e)}`}toDHMS(e,t){let i=(0,iE.decimalToSexagesimal)(e);return i=i.slice(0,i.indexOf(" ")-1)+t+i.slice(i.indexOf(" ")+1),i}static \u0275fac=function(t){return new(t||n)};static \u0275pipe=Dp({name:"coords",type:n,pure:!0})};function One(n,e){if(n&1&&(u(0,"span",4),_(1),p()),n&2){let t=v().$implicit;g(),X(t[1])}}function Fne(n,e){if(n&1&&(u(0,"div",7),_(1),St(2,"coords"),p()),n&2){let t=v(2).$implicit,i=v();w("matTooltip",t[2]),g(),q(" ",Oi(2,2,t[2],i.app.config.units.positionFormat,!0)," ")}}function Nne(n,e){if(n&1&&(u(0,"div",7),_(1),St(2,"coords"),p()),n&2){let t=v(2).$implicit,i=v();w("matTooltip",t[2]),g(),q(" ",Oi(2,2,t[2],i.app.config.units.positionFormat,!1)," ")}}function Bne(n,e){if(n&1&&(u(0,"div",7),_(1),p()),n&2){let t=v(2).$implicit;w("matTooltip",t[2]),g(),X(t[2])}}function Vne(n,e){if(n&1&&(u(0,"div",5)(1,"div",6),_(2),p(),R(3,Fne,3,6,"div",7)(4,Nne,3,6,"div",7)(5,Bne,2,2,"div",7),p()),n&2){let t=v().$implicit;g(),w("matTooltip",t[1]),g(),X(t[1]),g(),A(t[1]==="latitude"?3:t[1]==="longitude"?4:5)}}function Gne(n,e){if(n&1&&(u(0,"div",3),R(1,One,2,1,"span",4),R(2,Vne,6,3,"div",5),p()),n&2){let t=e.$implicit;g(),A(t[0]===0&&t[2]===null?1:-1),g(),A(t[2]!==null?2:-1)}}var yd=class n{title=Z("");details=Z();items;app=M(re);constructor(){}ngOnChanges(){this.details()?this.parseEntries():this.items=[]}parseEntries(){let e=Object.entries(this.details());e.sort((t,i)=>t[0]<i[0]?-1:1),this.items=this.section(this.flatten(e))}section(e){let t=[];e.forEach(o=>{let a=o[0].split(".");if(a.length===1)t.push([0,"",a[0],typeof o[1]!="object"?o[1]:null]);else{let s=a.slice(0,a.length-1).join(".");t.push([a.length-1,s,a[a.length-1],o[1]])}}),t.sort((o,a)=>o[1]<a[1]?-1:1);let i=null,r=[];return e=[],t.forEach(o=>{o[1]!==i&&(i=o[1],r.indexOf(o[1])===-1&&(r.push(o[1]),e.push([0,o[1],null]))),e.push([o[0],o[2],o[3]])}),e}flatten(e){let t=[];return e.forEach(i=>{typeof i[1]=="object"&&i[1]!==null?t=t.concat(this.processObject(i[0],i[1])):t.push([i[0],i[1]])}),t}processObject(e,t){let i=[],r=Object.entries(t);return r.sort((o,a)=>o[0]<a[0]?-1:1),r.forEach(o=>{typeof o[1]=="object"&&o[1]!==null?i=i.concat(this.processObject(e+"."+o[0],o[1])):i.push([e+"."+o[0],o[1]])}),i}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=W({type:n,selectors:[["signalk-details-list"]],inputs:{title:[1,"title"],details:[1,"details"]},features:[Me],decls:7,vars:1,consts:[[1,"sk-details"],[1,"title"],[1,"content"],[1,"item"],[1,"sectionname"],[1,"pathvalue"],[1,"path",3,"matTooltip"],[1,"value",3,"matTooltip"]],template:function(t,i){t&1&&(u(0,"div",0)(1,"div",1)(2,"div"),_(3),p()(),u(4,"div",2),Oe(5,Gne,3,2,"div",3,ft),p()()),t&2&&(g(3),X(i.title()),g(2),Fe(i.items))},dependencies:[ve,Ie,dn],styles:[".sk-details[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;font-family:Roboto,Arial,Helvetica,sans-serif;font-size:10pt;max-height:100%}.sk-details[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{background:left 1px -webkit-gradient(linear,left top,left bottom,from(rgba(0,0,0,.18)),color-stop(.65,transparent)) #b2bbc2e3;padding:3px 5px 0;font-weight:500;line-height:23px}.sk-details[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{padding:0;line-height:23px;margin:0;flex:1 1 auto;overflow:auto}.sk-details[_ngcontent-%COMP%] .item[_ngcontent-%COMP%]{display:flex;flex-direction:row;line-height:26px;border-width:0 0 0 0;border-style:solid;border-color:gray;padding-left:5px}.sk-details[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .item[_ngcontent-%COMP%]{border-width:0 0 1px 0}.sk-details[_ngcontent-%COMP%] .sectionname[_ngcontent-%COMP%]{text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:100%;font-weight:500}.sk-details[_ngcontent-%COMP%] .pathvalue[_ngcontent-%COMP%]{display:flex;flex-wrap:nowrap;width:100%}.sk-details[_ngcontent-%COMP%] .pathvalue[_ngcontent-%COMP%] .path[_ngcontent-%COMP%]{text-align:left;width:60%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-style:italic}.sk-details[_ngcontent-%COMP%] .pathvalue[_ngcontent-%COMP%] .value[_ngcontent-%COMP%]{text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"],changeDetection:0})};var pE=ts(NF());var gc=class n{isMeasuring=J(!1);isDrawing=J(!1);isModifying=J(!1);isBoxSelecting=J(!1);measurement=J({coords:[],index:-1,center:null,radius:0});selection=J({mode:null});selectionResult;measureGeometryType="LineString";draw={resourceType:null,featureType:"Point",coordinates:null,features:null,forSave:null,properties:{}};app=M(re);constructor(){}initBoxCoord(e){this.selectionResult||(this.selectionResult={mode:null}),this.selectionResult.bbox=[e]}set measurementCoords(e){this.measurement.update(t=>Object.assign({},t,{coords:e}))}set measurementCenter(e){this.measurement.update(t=>Object.assign({},t,{center:e}))}set measurementRadius(e){this.measurement.update(t=>Object.assign({},t,{radius:e}))}addMeasurementCoord(e){let t=di.distanceTo(this.measurement().coords[this.measurement().coords.length-1],e);return this.measurement.update(i=>{let r=[].concat(i.coords);return r.push(e),Object.assign({},i,{coords:r})}),t}distanceFromLastPoint(e){return e&&this.measurement().coords.length>0?di.distanceTo(this.measurement().coords[this.measurement().coords.length-1],e):0}distanceFromCenter(e){return!e||!this.measurement().center?0:di.distanceTo(this.measurement().center,e)}startMeasuring(e,t){this.measureGeometryType=e??"LineString",this.app.debug("startMeasuring()..."),this.isMeasuring.set(!0),this.interactionStarted()}stopMeasuring(){this.app.debug("stopMeasuring()..."),this.isMeasuring.set(!1),this.interactionEnded()}startDrawing(e){this.app.debug("startDrawing()..."),this.isDrawing.set(!0),this.draw.resourceType=e,this.draw.featureType=e==="route"?"LineString":e==="region"?"Polygon":"Point",this.interactionStarted()}stopDrawing(e){if(this.app.debug("stopDrawing()..."),this.isDrawing.set(!1),e)switch(this.draw.featureType){case"Point":this.draw.coordinates=sn(e.getGeometry().getCoordinates());break;case"LineString":let t=e.getGeometry().getCoordinates();this.draw.coordinates=t.map(r=>sn(r));break;case"Polygon":let i=e.getGeometry().getCoordinates();i.length===0&&(this.draw.coordinates=[]),this.draw.coordinates=i[0].map(r=>sn(r));break}this.interactionEnded()}startModifying(e){this.app.debug("startModifying()..."),this.draw.features.getLength()!==0&&(this.isModifying.set(!0),this.draw.resourceType=e.type,this.draw.featureType=null,this.draw.forSave={id:null,coords:null},this.draw.coordinates=null,this.draw.properties={},this.interactionStarted())}stopModifying(){this.app.debug("stopModifying()..."),this.isModifying.set(!1),this.draw.features=null,this.interactionEnded()}startBoxSelection(e,t){this.app.debug("startBoxSelection()..."),this.selectionResult={mode:e,data:t,bbox:[]},this.isBoxSelecting.set(!0),this.interactionStarted()}stopBoxSelection(e){this.app.debug("stopBoxSelection()..."),e&&(this.selectionResult.bbox.push(e),this.formatBbox(),this.selection.update(()=>this.selectionResult)),this.isBoxSelecting.set(!1),this.interactionEnded()}formatBbox(){if(this.selectionResult.bbox.length!==2)return;let e=[].concat(this.selectionResult.bbox);this.selectionResult.bbox=[[e[0][0]<e[1][0]?e[0][0]:e[1][0],e[0][1]<e[1][1]?e[0][1]:e[1][1]],[e[0][0]>e[1][0]?e[0][0]:e[1][0],e[0][1]>e[1][1]?e[0][1]:e[1][1]]]}interactionStarted(){this.app.debug("interactionStarted()..."),this.measurement.set({coords:[],index:-1,center:null,radius:0}),this.app.uiCtrl.update(e=>Object.assign({},e,{suppressContextMenu:!0}))}interactionEnded(){this.app.debug("interactionEnded()..."),this.app.uiCtrl.update(e=>Object.assign({},e,{suppressContextMenu:!1})),this.measurement.set({coords:[],index:-1,center:null,radius:0})}static \u0275fac=function(t){return new(t||n)};static \u0275prov=et({token:n,factory:n.\u0275fac,providedIn:"root"})};var vs=class{name;description;distance=0;feature;constructor(e){this.name=e?.name?e.name:"",this.description=e?.description?e.description:"",this.distance=e?.distance?e.distance:0,this.feature=e?.feature??{type:"Feature",geometry:{type:"LineString",coordinates:[]},properties:{},id:""}}},vd=class{name;description;feature;type;constructor(e){this.name=e?.name?e.name:"",this.description=e?.description?e.description:"",this.type=e?.type?e.type:"",this.feature=e?.feature??{type:"Feature",geometry:{type:"Point",coordinates:[0,0]},properties:{},id:""}}},bd=class{name;description;position;href;mimeType;url;group;authors;properties;constructor(e){this.name=e?.name??"",this.description=e?.description??"",this.position=e?.position,this.href=e?.href,this.mimeType=e?.mimeType??"",this.url=e?.url??"",this.group=e?.group,this.authors=e?.authors&&Array.isArray(e?.authors)?e.authors:[],this.properties=e?.properties&&typeof e?.properties=="object"?e.properties:{}}},xd=class{name;description;feature;constructor(e){this.name=e?.name?e.name:"",this.description=e?.description?e.description:"",this.feature=e?.feature??{type:"Feature",geometry:{type:"Polygon",coordinates:[]},properties:{},id:""}}},tl=class{identifier;name;description;region;scale=25e4;layers;bounds;format;minZoom=0;maxZoom=24;tileSize=256;type;url;source;style;defaultOpacity;imageAdjustment;proxy;constructor(e){this.identifier=e?.identifier?e.identifier:void 0,this.name=e?.name?e.name:void 0,this.description=e?.description?e.description:void 0,this.layers=e?.layers?e.layers:[],this.bounds=e?.bounds?e.bounds:void 0,this.format=e?.format?e.format:void 0,this.minZoom=typeof e?.minzoom<"u"?e.minzoom:this.minZoom,this.maxZoom=typeof e?.maxzoom<"u"?e.maxzoom:this.maxZoom,this.tileSize=typeof e?.tileSize<"u"?e.tileSize:this.tileSize,this.type=e?.type?e.type:void 0,this.url=e?.url?e.url:void 0,this.scale=typeof e?.scale<"u"&&!isNaN(e?.scale)?e.scale:this.scale,this.style=e?.style??void 0,this.source=e?.$source??void 0,this.defaultOpacity=e?.defaultOpacity??1,this.imageAdjustment=e?.imageAdjustment,this.proxy=e?.proxy??!1}},Cf=class{name;description;feature;constructor(e){this.feature=e?.feature??{type:"Feature",geometry:{type:"MultiLineString",coordinates:[]},properties:{},id:""},this.name=this.feature.properties?.name??"",this.description=this.feature.properties?.description??""}},rE=class{id;name;mmsi;position=[0,0];positionReceived=!1;positionTimestamp="";state;type={id:-1,name:""};properties={};lastUpdated=new Date;callsignVhf;callsignHf;orientation=0;virtual},_d=class extends rE{anchor={maxRadius:null,radius:null,position:null};autopilot={state:null,mode:null,target:null,enabled:!1,default:null,availableActions:[]};buddy=!1;closestApproach={distance:null,timeTo:null};cog;cogTrue=null;cogMagnetic=null;courseApi={arrivalCircle:0,activeRoute:{},nextPoint:{},previousPoint:{}};courseCalcs={};distanceToSelf;environment={mode:null,sun:null};heading;headingTrue=null;headingMagnetic=null;performance={beatAngle:null,gybeAngle:null};racing;radars={};registrations={};resourceUpdates=[];sog;track=[];vectors={cog:[]};wind={direction:null,mwd:null,twd:null,tws:null,speedTrue:null,sog:null,awa:null,aws:null};design={airHeight:null,beam:null,draft:{current:null,maximum:null},length:null};destination={name:null,eta:null};flag;port};function $ne(n,e){if(n&1&&(u(0,"div",7)(1,"div",4),j(2,"span",13),St(3,"coords"),j(4,"br")(5,"span",13),St(6,"coords"),p(),u(7,"div"),j(8,"span",13),St(9,"coords"),j(10,"br")(11,"span",13),St(12,"coords"),p()()),n&2){let t=v();g(2),w("innerText",Oi(3,4,t.data.bbox[1][1],"HDd",!0)),g(3),w("innerText",Xn(6,8,t.data.bbox[1][0],"HDd")),g(3),w("innerText",Oi(9,11,t.data.bbox[0][1],"HDd",!0)),g(3),w("innerText",Xn(12,15,t.data.bbox[0][0],"HDd"))}}function qne(n,e){if(n&1&&(u(0,"mat-option",10),_(1),p()),n&2){let t=e.$implicit;w("value",t),g(),X(t)}}var bx=class n{icon;zoomRange=[];selZoom;app=M(re);dialogRef=M(ui);data=M(pi);constructor(){}ngOnInit(){let e=this.data.chart[1].minZoom??1,t=this.data.chart[1].maxZoom??15;this.selZoom=t;for(let i=e;i<=t;i++)this.zoomRange.push(i)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=W({type:n,selectors:[["ap-chartproperties"]],decls:26,vars:3,consts:[[1,"_ap-chartjob"],[2,"background-color","transparent"],[1,"dialog-icon"],[2,"flex","1 1 auto","text-align","center"],[2,"text-align","right"],["mat-icon-button","",3,"click"],[2,"flex","1 1 auto"],[2,"flex","1 1 auto","border","gray 1px solid","font-size","10pt"],[2,"width","100%"],[3,"ngModelChange","ngModel"],[3,"value"],["align","right"],["mat-flat-button","",3,"click"],[2,"flex","1 1 auto",3,"innerText"]],template:function(t,i){t&1&&(u(0,"div",0)(1,"mat-toolbar",1)(2,"span",2)(3,"mat-icon"),_(4,"download"),p()(),u(5,"span",3),_(6,"Chart Seed job"),p(),u(7,"span",4)(8,"button",5),T("click",function(){return i.dialogRef.close(-1)}),u(9,"mat-icon"),_(10,"close"),p()()()(),u(11,"mat-dialog-content")(12,"div")(13,"div",6),_(14),p(),R(15,$ne,13,18,"div",7),u(16,"div",6)(17,"mat-form-field",8)(18,"mat-label"),_(19,"Max. Zoom Level"),p(),u(20,"mat-select",9),xt("ngModelChange",function(o){return bt(i.selZoom,o)||(i.selZoom=o),o}),Oe(21,qne,2,2,"mat-option",10,ft),p()()()()(),u(23,"mat-dialog-actions",11)(24,"button",12),T("click",function(){return i.dialogRef.close(i.selZoom)}),_(25," Submit "),p()()()),t&2&&(g(14),X(i.data.chart[1].name),g(),A(i.data.bbox?15:-1),g(5),vt("ngModel",i.selZoom),g(),Fe(i.zoomRange))},dependencies:[ve,ae,le,qe,ue,Ze,Ne,It,kt,mi,Ni,hi,Ds,Wt,zt,Gl,Vl,Mt,Qi,Ji,dn],styles:["._ap-chartjob[_ngcontent-%COMP%]{font-family:arial;min-width:300px}.ap-confirm-icon[_ngcontent-%COMP%]{min-width:35px;max-width:35px;color:#ff8c00;text-align:left}._ap-chartjob[_ngcontent-%COMP%] .key-label[_ngcontent-%COMP%]{width:150px;font-weight:500}@media only screen and (min-device-width:768px)and (max-device-width:1024px),only screen and (min-width:800px){.ap-confirm-icon[_ngcontent-%COMP%]{min-width:25%;max-width:25%}}"]})};function Zne(n,e){if(n&1&&(pn(0,"span",2),_(1),In()),n&2){let t=v();g(),q("(",t.subTitle(),")")}}function Xne(n,e){if(n&1&&(pn(0,"span",2),_(1),In()),n&2){let t=v();g(),q(" (",t.subTitle(),") ")}}var oE=".dial-text[_ngcontent-%COMP%]{padding:0 10px;height:96px;font-family:roboto;border:transparent 1px solid}.dial-text-title[_ngcontent-%COMP%]{font-size:12pt;font-weight:500}.dial-text-subtitle[_ngcontent-%COMP%]{font-size:8pt;font-weight:500}.dial-text-value[_ngcontent-%COMP%]{font-size:22pt;font-weight:500}.dial-text-units[_ngcontent-%COMP%]{font-size:10pt}";function Yne(n,e){if(n&1&&(pn(0,"span",2),_(1),In()),n&2){let t=v();g(),q(" (",t.subTitle(),") ")}}var BF=class n{title=Z();subTitle=Z();value=Z();units=Z();static \u0275fac=function(t){return new(t||n)};static \u0275cmp=W({type:n,selectors:[["ap-dial-text"]],inputs:{title:[1,"title"],subTitle:[1,"subTitle"],value:[1,"value"],units:[1,"units"]},decls:8,vars:4,consts:[[1,"dial-text","mat-app-background"],[1,"dial-text-title"],[1,"dial-text-subtitle"],[1,"dial-text-value"],[1,"dial-text-units"]],template:function(t,i){t&1&&(pn(0,"div",0)(1,"div",1),_(2),R(3,Zne,2,1,"span",2),In(),pn(4,"div",3),_(5),In(),pn(6,"div",4),_(7),In()()),t&2&&(g(2),q(" ",i.title(),"\xA0 "),g(),A(i.subTitle()?3:-1),g(2),X(i.value()),g(2),X(i.units()))},styles:[oE],changeDetection:0})},VF=class n{value=Z();subTitle=Z();ttg="--";units="min";constructor(){Te(()=>{let e=this.value();if(typeof e!="number")this.ttg="--",this.units="min";else if(e<60)this.ttg=Math.floor(e).toString(),this.units="min";else if(e<1440)this.ttg=`${Math.floor(e/60)}:${("00"+(e%60).toFixed(0)).slice(-2)}`,this.units="hr:min";else{let i=Math.floor(e/1440),r=i*1440,o=e-r,a=Math.floor(o/60),s=`00${Math.floor(o-a*60)}`.slice(-2);this.ttg=`${i}:${("00"+a).slice(-2)}:${s}`,this.units="day:hr:min"}})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=W({type:n,selectors:[["ap-dial-ttg"]],inputs:{value:[1,"value"],subTitle:[1,"subTitle"]},decls:8,vars:3,consts:[[1,"dial-text","mat-app-background"],[1,"dial-text-title"],[1,"dial-text-subtitle"],[1,"dial-text-value"],[1,"dial-text-units"]],template:function(t,i){t&1&&(pn(0,"div",0)(1,"div",1),_(2," TTG\xA0 "),R(3,Xne,2,1,"span",2),In(),pn(4,"div",3),_(5),In(),pn(6,"div",4),_(7),In()()),t&2&&(g(3),A(i.subTitle()?3:-1),g(2),X(i.ttg),g(2),X(i.units))},styles:[oE],changeDetection:0})},GF=class n{value=Z();subTitle=Z();etaTime="--";etaDate="--";constructor(){Te(()=>{this.value()&&(this.etaTime=this.value().toLocaleTimeString().split(":").slice(0,2).join(":"),this.etaDate=this.value().toLocaleDateString())})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=W({type:n,selectors:[["ap-dial-eta"]],inputs:{value:[1,"value"],subTitle:[1,"subTitle"]},decls:8,vars:3,consts:[[1,"dial-text","mat-app-background"],[1,"dial-text-title"],[1,"dial-text-subtitle"],[1,"dial-text-value"],[1,"dial-text-units"]],template:function(t,i){t&1&&(pn(0,"div",0)(1,"div",1),_(2," ETA\xA0 "),R(3,Yne,2,1,"span",2),In(),pn(4,"div",3),_(5),In(),pn(6,"div",4),_(7),In()()),t&2&&(g(3),A(i.subTitle()?3:-1),g(2),X(i.etaTime),g(2),X(i.etaDate))},styles:[oE],changeDetection:0})};var Qne=["*"],Jne=n=>({disabled:n});function ere(n,e){if(n&1&&(u(0,"span")(1,"i",6),_(2,"upload"),p(),_(3," \xA0"),u(4,"span",7),_(5),p()()),n&2){let t=v();g(5),X(t.label())}}function tre(n,e){if(n&1){let t=H();u(0,"button",9),T("click",function(){O(t);let r=v(2);return F(r.clear())}),_(1,"Clear"),p()}}function ire(n,e){if(n&1&&(u(0,"div",5),j(1,"img",8),R(2,tre,2,0,"button"),p()),n&2){let t=v();g(),lt("src",t.avatar,Cc),g(),A(t.avatar?2:-1)}}var jF=class n{disabled=Z(!1);multiple=Z(!1);maxfilesize=Z(void 0);accept=Z("");astext=Z(!1);preview=Z(!1);icon=Z(!1);label=Z("Upload File");chosen=we();invalid=we();cleared=we();avatar=null;changeDetectorRef=M(oe);constructor(){}fileChange(e){this.readFiles(e.files)}dragOver(e){e.preventDefault()}drop(e){e.preventDefault(),e.dataTransfer.files&&e.dataTransfer.files.length>0&&this.readFiles(e.dataTransfer.files)}clear(){this.avatar=null,this.cleared.emit()}readFiles(e,t=0){let i=new FileReader,r={type:"",value:"",message:""};if(t in e){if(this.maxfilesize()&&e[t].size>this.maxfilesize()){r.type="SIZE",r.value=e[t].size,r.message=`File size exceeds the accepted maximum size of ${this.maxfilesize()}`,this.invalid.emit(r);return}if(this.accept().indexOf("/*")!==-1){let o=e[t].type.substring(0,e[t].type.indexOf("/"));if(this.accept().indexOf(o)<0){r.type="TYPE",r.value=e[t].type,r.message=`File type does not match the accepted type (${this.accept()}) specified.`,this.invalid.emit(r);return}}this.readFile(e[t],i,o=>{t===0&&this.preview()&&(this.avatar=o),this.chosen.emit({name:e[t].name,data:o}),this.readFiles(e,t+1)})}else this.changeDetectorRef.detectChanges()}readFile(e,t,i){t.onload=()=>{i(t.result)},e.type.indexOf("text")!==-1||this.astext()?t.readAsText(e):t.readAsDataURL(e)}resize(e,t,i,r){return e.onload=()=>{let o=e.width,a=e.height;o>a?o>t&&(a*=t/o,o=t):a>i&&(o*=i/a,a=i);let s=document.createElement("canvas");s.width=o,s.height=a,s.getContext("2d").drawImage(e,0,0,o,a);let c=s.toDataURL("image/jpeg");r(c,e.src.length,c.length)}}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=W({type:n,selectors:[["ap-file-input"]],inputs:{disabled:[1,"disabled"],multiple:[1,"multiple"],maxfilesize:[1,"maxfilesize"],accept:[1,"accept"],astext:[1,"astext"],preview:[1,"preview"],icon:[1,"icon"],label:[1,"label"]},outputs:{chosen:"chosen",invalid:"invalid",cleared:"cleared"},ngContentSelectors:Qne,decls:8,vars:8,consts:[["input",""],[1,"ap-file-input",3,"dragover","drop"],["id","ctrl",3,"ngClass"],["mat-menu-item",""],["type","file",2,"display","none",3,"change","click","multiple","disabled","accept"],["id","avatar",2,"display","inline-flex"],[1,"material-icons"],[2,"font-size","10pt"],["alt",""],[3,"click"]],template:function(t,i){if(t&1){let r=H();ge(),u(0,"div",1),T("dragover",function(a){return i.dragOver(a)})("drop",function(a){return i.drop(a)}),u(1,"div",2)(2,"label",3),ce(3),R(4,ere,6,1,"span"),u(5,"input",4,0),T("change",function(){O(r);let a=Le(6);return F(i.fileChange(a))})("click",function(){O(r);let a=Le(6);return F(a.value=null)}),p()()(),R(7,ire,3,2,"div",5),p()}t&2&&(g(),w("ngClass",vn(6,Jne,i.disabled())),g(3),A(i.icon()?4:-1),g(),w("multiple",i.multiple())("disabled",i.disabled())("accept",i.accept()),g(2),A(i.preview()&&i.avatar?7:-1))},dependencies:[hn,Fn],styles:[".ap-file-input[_ngcontent-%COMP%]{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:inline-flex;-moz-flex-direction:row;-ms-flex-direction:row;-webkit-flex-direction:row;flex-direction:row;flex-wrap:nowrap;justify-content:flex-start;align-content:stretch;width:100%}#ctrl[_ngcontent-%COMP%], #ctrl[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{cursor:pointer}#apfileinput[_ngcontent-%COMP%]{position:absolute;top:0;left:-9000px;width:.1px;height:.1px;opacity:0;overflow:hidden;z-index:-1}.disabled[_ngcontent-%COMP%]{color:#21212180!important;border-color:#21212180!important;cursor:none!important}#avatar[_ngcontent-%COMP%]{background-color:inherit;border-radius:5px;height:42px}#avatar[_ngcontent-%COMP%] > img[_ngcontent-%COMP%]{width:42px;height:42px}#avatar[_ngcontent-%COMP%] > button[_ngcontent-%COMP%]{background-color:inherit;border:0;color:red}"]})};var nre=["vid"],zF=class n{pipVideo;pipWindow;pipMode=!1;vidUrl;src=Z();muted=Z(!0);_muted=Ea(()=>this.muted());resize=we();change=we();click=we();vid;constructor(){Te(()=>{this.src()&&(this.vidUrl=this.src())})}ngOnInit(){"pictureInPictureEnabled"in document||(this.pipMode=!0),this.pipVideo=this.vid.nativeElement,this.pipVideo.addEventListener("enterpictureinpicture",e=>{this.pipMode=!0,this.pipWindow=e.pictureInPictureWindow,this.pipWindow.addEventListener("resize",this.onPipWindowResize.bind(this)),this.change.emit(this.pipMode)}),this.pipVideo.addEventListener("leavepictureinpicture",()=>{this.pipMode=!1,this.pipVideo.pause(),this.pipWindow.removeEventListener("resize",this.onPipWindowResize),this.change.emit(this.pipMode)})}onPipWindowResize(e){this.resize.emit([e.srcElement.width,e.srcElement.height])}toggleMute(){this._muted.update(e=>!e)}initPiP(){return ee(this,null,function*(){try{yield this.pipVideo.requestPictureInPicture(),this.pipMode=!0,this.vid.nativeElement.play(),this.click.emit(!0)}catch(e){this.pipMode=!1}})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=W({type:n,selectors:[["pip-video"]],viewQuery:function(t,i){if(t&1&&Ht(nre,7),t&2){let r;De(r=ke())&&(i.vid=r.first)}},inputs:{src:[1,"src"],muted:[1,"muted"]},outputs:{resize:"resize",change:"change",click:"click"},decls:7,vars:5,consts:[["vid",""],[2,"border","gray 1px solid","border-radius","5px","display","none"],["autoplay","",3,"src","muted"],[2,"padding-left","5px"],["mat-mini-fab","","matTooltip","Show Video","matTooltipPosition","left",1,"button-toolbar",3,"click","disabled"]],template:function(t,i){t&1&&(u(0,"div",1),j(1,"video",2,0),p(),u(3,"div",3)(4,"button",4),T("click",function(){return i.initPiP()}),u(5,"mat-icon"),_(6,"videocam"),p()()()),t&2&&(g(),w("src",i.vidUrl,Cc)("muted",i._muted()),g(3),Nt("display",i.src()?"block":"none"),w("disabled",i.pipMode))},dependencies:[ue,Ms,ve,Ie,ae,le],encapsulation:2})};var WF=ts(Ml());function rre(n,e){if(n&1&&(u(0,"div",1)(1,"div",1)(2,"div",5)(3,"mat-icon"),_(4,"square_foot"),p(),j(5,"br"),_(6),p(),u(7,"div",3),_(8),j(9,"br"),_(10),p()()()),n&2){let t=v();g(6),q(" ",t.coords().length<2?"-":t._index()===-1?t.coords().length-1:t._index()+1," "),g(2),q(" ",t.legDistance),g(2),q(" ",t.legBearing," ")}}var Cx=class n{coords=Z([]);index=Z(-1);_index=Ea(()=>this.index());totalOnly=Z(!1);cancel=we();totalDistance;legDistance;legBearing;btnDisable={prev:!1,next:!1};app=M(re);constructor(){Te(()=>{if(!this.coords()||!Array.isArray(this.coords())||this.coords().length===0){this.init();return}if(this._index())if(Number.isFinite(this._index())){if(this._index()<-1&&this._index()>=this.coords().length)return}else return;this.calc(),this.setButtonState()}),this.init()}init(e){e||(this.totalDistance="--"),this.legDistance="--",this.legBearing="--",this.btnDisable={prev:!0,next:!0}}close(){this.cancel.emit()}calc(){let e=di.routeLength(this.coords());this.totalDistance=this.app.formatValueForDisplay(e,"m");let t;if(this._index()===-1)t=this.coords().slice(-2);else{let i=this._index()===this.coords().length-2?void 0:this._index()+2;t=this.coords().slice(this._index(),i)}if(t.length<2)this.init(!0);else{let i=di.distanceTo(t[0],t[1]),r=(0,WF.getGreatCircleBearing)(t[0],t[1]);this.legDistance=this.app.formatValueForDisplay(i,"m"),this.legBearing=this.app.formatValueForDisplay(r,"deg")}}select(e){e?this._index()===-1?this.coords().length>2&&this._index.set(this.coords().length-3):this._index()>0&&this._index.update(t=>--t):(this._index()!==-1||this._index()<this.coords().length-2)&&this._index.update(t=>++t),this.setButtonState(),this.calc()}setButtonState(){this._index()>0||this._index()===-1&&this.coords().length>2?this.btnDisable.prev=!1:this.btnDisable.prev=!0,this._index()!==-1&&this._index()<this.coords().length-2?this.btnDisable.next=!1:this.btnDisable.next=!0}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=W({type:n,selectors:[["fb-measurements"]],inputs:{coords:[1,"coords"],index:[1,"index"],totalOnly:[1,"totalOnly"]},outputs:{cancel:"cancel"},decls:15,vars:2,consts:[[1,"_ap_measurements"],[1,"_ap_row"],[1,"icon-label"],[1,"value"],["matTooltip","Cancel","matTooltipPosition","below","mat-icon-button","",3,"click"],[2,"font-size","12pt"]],template:function(t,i){t&1&&(u(0,"div",0)(1,"mat-toolbar")(2,"div",1)(3,"div",1)(4,"div",2)(5,"mat-icon"),_(6,"straighten"),p()(),u(7,"div",3),_(8),j(9,"br"),p()(),R(10,rre,11,3,"div",1),u(11,"div")(12,"button",4),T("click",function(){return i.close()}),u(13,"mat-icon"),_(14,"close"),p()()()()()()),t&2&&(g(8),X(i.totalDistance),g(2),A(i.totalOnly()?-1:10))},dependencies:[ae,le,ue,Ne,Ie,It,kt],styles:["._ap_measurements[_ngcontent-%COMP%]{position:relative;top:0;min-width:200px}._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})};function ore(n,e){if(n&1){let t=H();pn(0,"img",1),G1("error",function(){O(t);let r=v();return F(r.imgError())}),In()}if(n&2){let t=v();Kr("src",t.flagIcon,Cc)}}var wx=class n{flagIcon;showFlag=J(!0);mmsi=Z();host=Z("");constructor(){Te(()=>{this.flagIcon=`${this.host()}/signalk/v2/api/resources/flags/mmsi/${this.mmsi()}`})}imgError(){this.showFlag.set(!1)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=W({type:n,selectors:[["country-flag"]],inputs:{mmsi:[1,"mmsi"],host:[1,"host"]},decls:1,vars:1,consts:[[3,"src"],[3,"error","src"]],template:function(t,i){t&1&&R(0,ore,1,1,"img",0),t&2&&A(i.showFlag()?0:-1)},encapsulation:2})};var Sx=class n{notiMgr=M(il);constructor(){}raiseAlarm(){this.notiMgr.raiseServerAlarm("mob","Person Overboard!")}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=W({type:n,selectors:[["pob-button"]],decls:2,vars:0,consts:[["mat-fab","","matTooltip","Raise POB Alarm","matTooltipPosition","above",1,"button-warn",3,"click"],["svgIcon","alarm-mob",1,"ob"]],template:function(t,i){t&1&&(u(0,"button",0),T("click",function(){return i.raiseAlarm()}),j(1,"mat-icon",1),p())},dependencies:[ae,le,ue,Ed,ve,Ie],encapsulation:2})};var Mx=class n{position=Z([0,0]);active=Z(!1);skres=M(Dt);constructor(){}dropWaypoint(){this.skres.newWaypointAt(this.position())}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=W({type:n,selectors:[["wpt-button"]],inputs:{position:[1,"position"],active:[1,"active"]},decls:3,vars:1,consts:[["mat-fab","","matTooltip","Mark Vessel Position","matTooltipPosition","above",1,"button-toolbar",3,"click","disabled"]],template:function(t,i){t&1&&(u(0,"button",0),T("click",function(){return i.dropWaypoint()}),u(1,"mat-icon"),_(2,"add_location"),p()()),t&2&&w("disabled",!i.active())},dependencies:[ae,le,ue,Ed,ve,Ie],encapsulation:2})};var are=(n,e)=>({"button-primary":n,"button-toolbar":e}),Tx=class n{active=Z(!1);app=M(re);constructor(){}handleClick(){this.app.uiCtrl.update(e=>{let t=!e.autopilotConsole;return Object.assign({},e,{autopilotConsole:t})})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=W({type:n,selectors:[["autopilot-button"]],inputs:{active:[1,"active"]},decls:2,vars:5,consts:[["mat-fab","","matTooltip","Autopilot Console","matTooltipPosition","above",3,"click","ngClass","disabled"],["svgIcon","command-autopilot",1,"ob"]],template:function(t,i){t&1&&(u(0,"button",0),T("click",function(){return i.handleClick()}),j(1,"mat-icon",1),p()),t&2&&w("ngClass",rs(2,are,i.app.data.vessels.self.autopilot.enabled,!i.app.data.vessels.self.autopilot.enabled||!i.app.featureFlags().autopilotApi||!i.app.data.vessels.self.autopilot.default))("disabled",!i.active())},dependencies:[hn,Fn,ae,le,ue,Ed,ve,Ie],encapsulation:2})};var sre=(n,e)=>({"button-primary":n,"button-toolbar":e}),Ex=class n{active=Z(!1);app=M(re);radarApi=M(fc);constructor(){}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=W({type:n,selectors:[["radar-button"]],inputs:{active:[1,"active"]},decls:2,vars:5,consts:[["mat-fab","","matTooltip","Radar Overlay","matTooltipPosition","above",3,"ngClass","disabled"],["svgIcon","radar-iec",1,"ob"]],template:function(t,i){t&1&&(u(0,"button",0),j(1,"mat-icon",1),p()),t&2&&w("ngClass",rs(2,sre,i.radarApi.radarId()&&i.app.uiCtrl().radarLayer,!i.app.featureFlags().radarApi||!i.app.uiCtrl().radarLayer))("disabled",!i.active()||!i.app.data.vessels.showSelf||i.app.instrumentPanel().open)},dependencies:[hn,Fn,ae,le,ue,Ed,ve,Ie],encapsulation:2})};var Vo=[];for(let n=0;n<256;++n)Vo.push((n+256).toString(16).slice(1));function UF(n,e=0){return(Vo[n[e+0]]+Vo[n[e+1]]+Vo[n[e+2]]+Vo[n[e+3]]+"-"+Vo[n[e+4]]+Vo[n[e+5]]+"-"+Vo[n[e+6]]+Vo[n[e+7]]+"-"+Vo[n[e+8]]+Vo[n[e+9]]+"-"+Vo[n[e+10]]+Vo[n[e+11]]+Vo[n[e+12]]+Vo[n[e+13]]+Vo[n[e+14]]+Vo[n[e+15]]).toLowerCase()}var lre=new Uint8Array(16);function aE(){return crypto.getRandomValues(lre)}function cre(n,e,t){return!e&&!n&&crypto.randomUUID?crypto.randomUUID():dre(n,e,t)}function dre(n,e,t){n=n||{};let i=n.random??n.rng?.()??aE();if(i.length<16)throw new Error("Random bytes length must be >= 16");if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,e){if(t=t||0,t<0||t+16>e.length)throw new RangeError(`UUID byte range ${t}:${t+15} is out of buffer bounds`);for(let r=0;r<16;++r)e[t+r]=i[r];return e}return UF(i)}var sE=cre;var lE="plotterExt/1",$i={PARSE_ERROR:-32700,INVALID_REQUEST:-32600,METHOD_NOT_FOUND:-32601,INVALID_PARAMS:-32602,INTERNAL_ERROR:-32603,HOST_ERROR:-32e3,TIMEOUT:-32001,CONNECTION_CLOSED:-32002},ri=class I1 extends Error{code;data;constructor(e,t={}){super(e),this.name="RpcError",this.code=t.code??$i.HOST_ERROR;let i=he({},t.data??{});t.reason!==void 0&&(i.reason=t.reason),this.data=Object.keys(i).length>0?i:void 0}get reason(){return typeof this.data?.reason=="string"?this.data.reason:void 0}toErrorObject(){return he({code:this.code,message:this.message},this.data?{data:this.data}:{})}static fromErrorObject(e){return new I1(e.message,{code:e.code,data:e.data})}static from(e){return e instanceof I1?e:e instanceof Error?new I1(e.message,{code:$i.INTERNAL_ERROR}):new I1(String(e),{code:$i.INTERNAL_ERROR})}},cE="bus.ready",dE="bus.handshake";function HF(n,e){return n===e?!0:KF(n.split("."),0,e.split("."),0)}function KF(n,e,t,i){for(;e<n.length;){let r=n[e];if(r==="**"){if(e===n.length-1)return!0;for(let o=i;o<=t.length;o++)if(KF(n,e+1,t,o))return!0;return!1}if(i>=t.length||r!=="*"&&r!==t[i])return!1;e++,i++}return i===t.length}function Ix(n,e){for(let t of n)if(HF(t,e))return!0;return!1}function pre(n){return{bus:lE,msg:n}}function hre(n){if(typeof n!="object"||n===null)return null;let e=n;return e.bus!==lE?null:mre(e.msg)?e.msg:null}function mre(n){if(typeof n!="object"||n===null)return!1;let e=n;if(e.jsonrpc!=="2.0")return!1;if(typeof e.method=="string")return e.id===void 0||typeof e.id=="string"||typeof e.id=="number";if(!(typeof e.id=="string"||typeof e.id=="number"||e.id===null))return!1;let i="result"in e,r=e.error,o=typeof r=="object"&&r!==null&&typeof r.code=="number"&&typeof r.message=="string";return i?!("error"in e):o}function fre(n){return"method"in n&&"id"in n&&n.id!==void 0}function gre(n){return"method"in n&&(!("id"in n)||n.id===void 0)}function _re(n){return!("method"in n)}function wf(n,e={}){let t=e.listenWindow??globalThis,i=e.origin??t.location?.origin??"*";return{post(r){n.postMessage(r,i)},listen(r){let o=a=>{a.source===n&&(i!=="*"&&a.origin!==i||r(a.data))};return t.addEventListener("message",o),()=>t.removeEventListener("message",o)}}}var yre=1e4,uE=class{callTimeoutMs;port;unlisten;onError;pending=new Map;methods=new Map;eventHandlers=new Set;idPrefix=Math.random().toString(36).slice(2,8);seq=0;closed=!1;constructor(n){this.port=n.port,this.callTimeoutMs=n.callTimeoutMs??yre,this.onError=n.onError??(e=>console.warn("[plotterext-bus]",e)),this.unlisten=this.port.listen(e=>this.onData(e))}registerMethod(n,e){this.methods.set(n,e)}unregisterMethod(n){this.methods.delete(n)}onEvent(n,e){let t={patterns:n,fn:e};return this.eventHandlers.add(t),()=>this.eventHandlers.delete(t)}notify(n,e){this.send(he({jsonrpc:"2.0",method:n},e!==void 0?{params:e}:{}))}call(n,e,t={}){if(this.closed)return Promise.reject(new ri("Bus endpoint is closed",{code:$i.CONNECTION_CLOSED,reason:"CLOSED"}));let i=`${this.idPrefix}-${++this.seq}`,r=t.timeoutMs??this.callTimeoutMs;return new Promise((o,a)=>{let s=r>0?setTimeout(()=>{this.pending.delete(i),a(new ri(`Call timed out after ${r}ms: ${n}`,{code:$i.TIMEOUT,reason:"TIMEOUT"}))},r):null;this.pending.set(i,{resolve:o,reject:a,timer:s}),this.send(he({jsonrpc:"2.0",id:i,method:n},e!==void 0?{params:e}:{}))})}close(){if(!this.closed){this.closed=!0,this.unlisten();for(let[,n]of this.pending)n.timer&&clearTimeout(n.timer),n.reject(new ri("Bus endpoint closed",{code:$i.CONNECTION_CLOSED,reason:"CLOSED"}));this.pending.clear(),this.eventHandlers.clear()}}send(n){this.closed||this.port.post(pre(n))}onData(n){let e=hre(n);e&&(_re(e)?this.onResponse(e):fre(e)?this.onRequest(e):gre(e)&&this.onNotification(e.method,e.params))}onResponse(n){if(n.id===null)return;let e=this.pending.get(n.id);e&&(this.pending.delete(n.id),e.timer&&clearTimeout(e.timer),"error"in n?e.reject(ri.fromErrorObject(n.error)):e.resolve(n.result))}onRequest(n){return ee(this,null,function*(){let e=this.methods.get(n.method);if(!e){this.send({jsonrpc:"2.0",id:n.id,error:{code:$i.METHOD_NOT_FOUND,message:`Method not found: ${n.method}`}});return}try{let t=yield e(n.params,{endpoint:this});this.send({jsonrpc:"2.0",id:n.id,result:t===void 0?null:t})}catch(t){this.send({jsonrpc:"2.0",id:n.id,error:ri.from(t).toErrorObject()})}})}onNotification(n,e){for(let t of[...this.eventHandlers])if(Ix(t.patterns,n))try{t.fn(n,e)}catch(i){this.onError(i)}}};var Sf=class{endpoint;context;hostInfo;subs=new Map;onSubscriptionsChanged;adoptCallerId;subSeq=0;constructor(n){this.hostInfo=n.hostInfo,this.context=n.context,this.onSubscriptionsChanged=n.onSubscriptionsChanged,this.adoptCallerId=n.adoptCallerId??!1,this.endpoint=new uE({port:n.port,callTimeoutMs:n.callTimeoutMs,onError:n.onError});for(let[e,t]of Object.entries(n.methods??{}))this.endpoint.registerMethod(e,t);this.endpoint.registerMethod("events.subscribe",e=>this.handleSubscribe(e)),this.endpoint.registerMethod("events.unsubscribe",e=>this.handleUnsubscribe(e)),this.endpoint.onEvent([cE],(e,t)=>this.sendHandshake(t))}registerMethod(n,e){this.endpoint.registerMethod(n,e)}publish(n,e){return this.hasSubscriber(n)?(this.endpoint.notify(n,e),!0):!1}hasSubscriber(n){for(let[,e]of this.subs)if(Ix(e,n))return!0;return!1}subscribedPatterns(){let n=new Set;for(let[,e]of this.subs)for(let t of e)n.add(t);return[...n]}close(){this.endpoint.close(),this.subs.clear()}sendHandshake(n){let e=this.adoptCallerId&&n?.id?yi(he({},this.context),{id:n.id}):this.context;this.endpoint.notify(dE,yi(he({},this.hostInfo),{context:e}))}handleSubscribe(n){let e=n?.patterns;if(!Array.isArray(e)||e.length===0||!e.every(i=>typeof i=="string"&&i.length>0))throw new ri("events.subscribe requires a non-empty patterns array",{code:$i.INVALID_PARAMS,reason:"INVALID_PATTERNS"});let t=`sub-${++this.subSeq}`;return this.subs.set(t,e),this.onSubscriptionsChanged?.(this.subscribedPatterns()),{subscriptionId:t}}handleUnsubscribe(n){let e=n?.subscriptionId;if(typeof e!="string"||!this.subs.has(e))throw new ri("Unknown subscriptionId",{code:$i.INVALID_PARAMS,reason:"UNKNOWN_SUBSCRIPTION"});return this.subs.delete(e),this.onSubscriptionsChanged?.(this.subscribedPatterns()),{}}};function $F(n,e={}){let t=s=>{let l=s?.routeId;if(typeof l!="string"||l.length===0)throw new ri("route method requires a routeId",{code:$i.INVALID_PARAMS,reason:"routes.badRequest"});return l},i=()=>new ri("Unknown route buffer",{reason:"routes.unknownId"}),r=s=>new ri(s,{code:$i.INVALID_PARAMS,reason:"routes.badRequest"}),o=(s,l)=>{if(s!==void 0&&typeof s!="string")throw r(`${l} must be a string`)},a=s=>{if(!Array.isArray(s)||s.length<2)throw r("a route needs at least two points");for(let l of s){let c=l?.position;if(!Array.isArray(c)||c.length<2||!Number.isFinite(c[0])||!Number.isFinite(c[1]))throw r("each route point needs a numeric [lon, lat] position");o(l.name,"point name"),o(l.description,"point description")}return s};return{"route.list":()=>({routes:n.list()}),"route.create":s=>{let{name:l,description:c,points:d}=s??{};o(l,"name"),o(c,"description");let h=a(d),m=n.create({name:l,description:c,points:h});return{routeId:m.routeId,rev:m.rev}},"route.replace":s=>{let l=t(s),{points:c}=s??{},d=a(c),h=n.replace(l,d);if(!h)throw i();return{rev:h.rev}},"route.save":s=>ee(null,null,function*(){let l=t(s);if(!n.has(l))throw i();if(!e.onSave)throw new ri("This host cannot persist routes",{reason:"routes.notSupported"});let{name:c,description:d,dialog:h}=s??{};if(o(c,"name"),o(d,"description"),h!==void 0&&typeof h!="boolean")throw r("dialog must be a boolean");let m=yield e.onSave(l,{name:c,description:d,dialog:h});if(!m)throw new ri("Route save was cancelled",{reason:"routes.saveCancelled"});return m}),"route.get":s=>{let l=n.get(t(s));if(!l)throw i();return l},"route.hide":s=>ee(null,null,function*(){let l=t(s);if(!n.has(l))throw i();return e.onHide?yield e.onHide(l):n.delete(l),{}}),"route.delete":s=>ee(null,null,function*(){let l=t(s);if(!n.has(l))throw i();return e.onDelete?yield e.onDelete(l):n.delete(l,!1),{}}),"route.show":s=>{let l=s?.ref;if(typeof l!="string"||l.length===0)throw new ri("route.show requires a ref",{code:$i.INVALID_PARAMS,reason:"routes.badRef"});if(!e.onShow)throw new ri("route.show is not supported by this host",{reason:"routes.notSupported"});return e.onShow(l)}}}function vre(n){let[e,t,i]=n,r={id:e,name:t?.name??e,visible:!!i,opacity:typeof t?.defaultOpacity=="number"?t.defaultOpacity:1};return t?.type&&(r.type=t.type),Array.isArray(t?.bounds)&&t.bounds.length===4&&(r.bounds=[t.bounds[0],t.bounds[1],t.bounds[2],t.bounds[3]]),typeof t?.minZoom=="number"&&(r.minZoom=t.minZoom),typeof t?.maxZoom=="number"&&(r.maxZoom=t.maxZoom),r}function qF(n){let e=r=>new ri(r,{code:$i.INVALID_PARAMS,reason:"charts.badRequest"}),t=(r,o)=>{if(!Array.isArray(r)||r.some(a=>typeof a!="string"||a.length===0))throw e(`${o} must be an array of chart ids`);return r},i=(r,o)=>{let a=new Set(o.map(l=>l[0])),s=r.find(l=>!a.has(l));if(s!==void 0)throw new ri(`Unknown chart id: ${s}`,{reason:"charts.unknownId"})};return{"chart.list":()=>ee(null,null,function*(){return{charts:(yield n.listAvailableOrdered()).map(vre)}}),"chart.setVisibility":r=>ee(null,null,function*(){let o=t(r?.ids,"ids"),a=r?.visible;if(typeof a!="boolean")throw e("visible must be a boolean");return o.length>0&&(i(o,yield n.listAvailableOrdered()),yield n.setVisibility(o,a)),{}}),"chart.setOpacity":r=>ee(null,null,function*(){let o=t(r?.ids,"ids"),a=r?.opacity;if(typeof a!="number"||!Number.isFinite(a))throw e("opacity must be a finite number");if(a<0||a>1)throw e("opacity must be between 0 and 1");return o.length>0&&(i(o,yield n.listAvailableOrdered()),yield n.setOpacity(o,a)),{}}),"chart.setOrder":r=>ee(null,null,function*(){let o=t(r?.order,"order");return o.length>0&&(i(o,yield n.listAvailableOrdered()),yield n.setOrder(o)),{}})}}function ZF(n){let e=t=>new ri(t,{code:$i.INVALID_PARAMS,reason:"nightMode.badRequest"});return{"nightMode.get":()=>ee(null,null,function*(){return n.getState()}),"nightMode.set":t=>ee(null,null,function*(){let i=t??{},r=i.enabled!==void 0,o=i.auto!==void 0;if(!r&&!o)throw e("nightMode.set requires enabled and/or auto");if(r&&typeof i.enabled!="boolean")throw e("enabled must be a boolean");if(o&&typeof i.auto!="boolean")throw e("auto must be a boolean");let a={};return o&&(a.auto=i.auto),r&&(a.enabled=i.enabled),yield n.setState(a),{}})}}var _u=class n{buffers=new Map;events=new Ge;events$=this.events.asObservable();liveSignal=J([]);live=this.liveSignal.asReadonly();create(e={}){let t=this.newRouteId(),i={routeId:t,name:e.name??null,description:e.description??null,rev:1,saved:!1,dirty:!0,points:(e.points??[]).map(r=>this.clonePoint(r))};return this.buffers.set(t,i),this.refreshLive(),this.events.next({type:"visible",routeId:t,rev:i.rev,name:i.name,pointCount:i.points.length,saved:i.saved,dirty:i.dirty}),this.snapshot(i)}show(e){let t=this.buffers.get(e.routeId),i={routeId:e.routeId,name:e.name??t?.name??null,description:e.description??t?.description??null,rev:t?t.rev+1:1,saved:!0,dirty:!1,href:e.href,points:(e.points??t?.points??[]).map(r=>this.clonePoint(r))};return this.buffers.set(e.routeId,i),this.refreshLive(),this.events.next({type:"visible",routeId:i.routeId,rev:i.rev,name:i.name,pointCount:i.points.length,saved:!0,dirty:!1}),this.snapshot(i)}get(e){let t=this.buffers.get(e);return t?this.snapshot(t):void 0}has(e){return this.buffers.has(e)}hasHref(e){return this.getByHref(e)!==void 0}getByHref(e){for(let t of this.buffers.values())if(t.href===e)return this.snapshot(t)}all(){return[...this.buffers.values()].map(e=>this.snapshot(e))}list(){return[...this.buffers.values()].map(e=>({routeId:e.routeId,name:e.name,rev:e.rev,pointCount:e.points.length,saved:e.saved,dirty:e.dirty}))}delete(e,t){let i=this.buffers.get(e);if(!i)return!1;i.rev+=1;let r=t??i.saved;return this.buffers.delete(e),this.refreshLive(),this.events.next({type:"hidden",routeId:e,rev:i.rev,saved:r}),!0}markSaved(e,t,i,r){let o=this.buffers.get(e);if(o){if(!o.saved&&t===void 0)throw new Error("markSaved requires an href when saving a draft route");return o.rev+=1,o.saved=!0,o.dirty=!1,t!==void 0&&(o.href=t),i!==void 0&&(o.name=i),r!==void 0&&(o.description=r),this.refreshLive(),o.rev}}replace(e,t){let i=this.buffers.get(e);if(i)return i.points=(t??[]).map(r=>this.clonePoint(r)),i.rev+=1,i.dirty=!0,this.refreshLive(),this.events.next({type:"dirty",routeId:e,rev:i.rev,reason:"replaced"}),this.snapshot(i)}refreshLive(){this.liveSignal.set([...this.buffers.values()].map(e=>this.snapshot(e)))}refresh(){this.refreshLive()}newRouteId(){let e=globalThis.crypto;return e?.randomUUID?e.randomUUID():"rb-"+Date.now().toString(36)+"-"+Math.random().toString(36).slice(2,10)}clonePoint(e){return he(he({position:[...e.position]},e.name!==void 0?{name:e.name}:{}),e.description!==void 0?{description:e.description}:{})}snapshot(e){return yi(he({routeId:e.routeId,name:e.name,description:e.description,rev:e.rev,saved:e.saved,dirty:e.dirty},e.href!==void 0?{href:e.href}:{}),{points:e.points.map(t=>this.clonePoint(t))})}static \u0275fac=function(t){return new(t||n)};static \u0275prov=et({token:n,factory:n.\u0275fac,providedIn:"root"})};var XF="fb-plotterext-state",xre="embedding-host",Cre=1e3,wre=new Set(["eq","ne","lt","lte","gt","gte","in","contains","regex","exists"]),Sre=n=>!!n&&typeof n=="object"&&typeof n.path=="string"&&n.path.length>0&&wre.has(n.op),Mf=class n{constructor(e,t,i,r,o,a,s){this.app=e;this.signalk=t;this.dialog=i;this.skres=r;this.mapService=o;this.routeRegistry=a;this.stream=s;os()&&(window.fbPlotterExt=this),window.addEventListener("resize",()=>this.viewportTick.update(l=>l+1)),this.bridgeRouteEvents(),Te(()=>this.syncVisibleFromSelections()),Te(()=>this.emitChartChanges(this.skres.charts())),Te(()=>this.emitNightModeChange(this.readNightMode()))}manifests=J({});activeWidgets=J([]);initialized=J(!1);viewportTick=J(0);actionButtonLift=Fi(()=>{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*d_()+(t-1)*c_+6});statusBarLift=Fi(()=>{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*d_()+(t-1)*c_+4});toolbarTopOffset=Fi(()=>{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*d_()+(t-1)*c_+4});toolbarButtons=Fi(()=>{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=Fi(()=>{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=J([]);visiblePanel=Fi(()=>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=>yi(he({},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?yi(he({},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 ri("panel is required",{code:$i.INVALID_PARAMS,reason:"UNKNOWN_PANEL"});return r};return{"ui.openPanel":i=>ee(this,null,function*(){let r=t(i);if(!this.openPanel(e,r))throw new ri(`No such panel: ${r}`,{code:$i.INVALID_PARAMS,reason:"UNKNOWN_PANEL"});return{}}),"ui.togglePanel":i=>ee(this,null,function*(){let r=t(i);if(!this.togglePanel(e,r))throw new ri(`No such panel: ${r}`,{code:$i.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=J({});visibleNotes=Fi(()=>{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=Fi(()=>{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=>yi(he({},r),{[t]:yi(he({},r[t]??{}),{[e]:i})})),this.publishToExtension(e,"filters.changed",{type:t,active:!0})}clearResourceFilter(e,t){this.resourceFilters.update(i=>{let r=he({},i[t]??{});delete r[e];let o=he({},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 e.map((i,r)=>he(he({position:i},t?.[r]?.name?{name:t[r].name}:{}),t?.[r]?.description?{description:t[r].description}:{}))}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)})}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",he({routeId:e.routeId,rev:e.rev},e.reason!==void 0?{reason:e.reason}:{}));break}})}routeMethods(){return $F(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 qF({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)})}nightModeMethods(){return ZF({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=>yi(he({},r),{forceNightMode:!1}));else if(typeof e.enabled!="boolean"){let r=this.readNightMode().enabled;this.app.uiCtrl.update(o=>yi(he({},o),{forceNightMode:r}))}this.app.config.display.nightMode=t,this.app.uiConfig.update(r=>yi(he({},r),{autoNightMode:t}))}let i=e.enabled;typeof i=="boolean"&&(this.app.config.display.nightMode=!1,this.app.uiConfig.update(r=>yi(he({},r),{autoNightMode:!1})),this.app.uiCtrl.update(r=>yi(he({},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(c=>c[0]).reverse(),i=new Map(e.map(c=>[c[0],typeof c[1]?.defaultOpacity=="number"?c[1].defaultOpacity:1])),r=this.prevChartSnapshot;if(this.prevChartSnapshot={order:t,opacity:i},!r)return;let o=new Set(r.order),a=new Set(t);for(let c of t)o.has(c)||this.broadcastMessage("chart.visibility",{id:c,visible:!0});for(let c of r.order)a.has(c)||this.broadcastMessage("chart.visibility",{id:c,visible:!1});for(let[c,d]of i){let h=r.opacity.get(c);h!==void 0&&h!==d&&this.broadcastMessage("chart.opacity",{id:c,opacity:d})}let s=r.order.filter(c=>a.has(c)),l=t.filter(c=>o.has(c));s.length===l.length&&s.some((c,d)=>c!==l[d])&&this.broadcastMessage("chart.order",{order:t})}hideRoute(e){let t=this.routeRegistry.get(e);t&&(t.saved&&t.href?(this.skres.selectionRemove("routes",t.href),this.skres.refreshRoutes(),this.routeRegistry.delete(e,!0)):this.routeRegistry.delete(e,!1))}deleteRoute(e){return ee(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 ri("Failed to delete route",{reason:"routes.deleteFailed"})}this.routeRegistry.delete(e,!1)}})}showRoute(e){return ee(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 ri("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 ee(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,h=c?c[1].description??null:null;this.routeRegistry.show({routeId:e,name:d,description:h,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 ee(this,arguments,function*(e,t={}){let r=this.routeRegistry.get(e);if(!r)return null;let[,o]=this.skres.buildRoute(r.points.map(d=>d.position)),a=r.points.map(d=>he(he({},d.name?{name:d.name}:{}),d.description?{description:d.description}:{}));a.some(d=>Object.keys(d).length>0)&&(o.feature.properties.coordinatesMeta=a),o.name=t.name??r.name??"",o.description=t.description??r.description??"";let s;if(r.href)try{yield this.skres.putToServer("routes",r.href,o),s=r.href}catch(d){throw this.app.parseHttpErrorResponse(d),new ri("Failed to save route",{reason:"routes.saveFailed"})}else if(t.dialog)try{s=yield this.skres.saveNewRoute(o)}catch(d){throw new ri("Failed to save route",{reason:"routes.saveFailed"})}else try{s=(yield this.skres.postToServer("routes",o)).id,this.skres.selectionAdd("routes",s)}catch(d){throw this.app.parseHttpErrorResponse(d),new ri("Failed to save route",{reason:"routes.saveFailed"})}if(!s)return null;let l=o.name||null,c=this.routeRegistry.markSaved(e,s,l,o.description||null)??r.rev+1;return this.broadcastMessage("route.saved",{routeId:e,rev:c,href:s,name:l,saved:!0,dirty:!1}),this.app.data.editingId="",{href:s,rev:c}})}init(){return ee(this,null,function*(){try{let e=yield Ep(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=>kC.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}=l_[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=RC(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}=l_[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=PC[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=l_[e].rows,i=Array.from({length:t},(s,l)=>l),r=PC[e]==="bottom"?[...i].reverse():i,o=qI[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=RC(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 ee(this,null,function*(){let i=this.addableWidgets(e,t);if(!i.length)return;let{PlotterAddWidgetDialog:r}=yield import("./chunk-BUZHYJBN.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:sE(),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 Sf({port:wf(e.contentWindow,{origin:this.assetOrigin(r)}),hostInfo:this.hostInfo(),context:{kind:"widget",id:t.widget,instanceId:t.instanceId,targetInstance:null},methods:yi(he(he(he(he(he(he(he(he(he({},this.stateMethods(t.extension,t.instanceId)),this.signalkMethods(i)),this.unitsMethods()),this.resourcesMethods(t.extension)),this.mapMethods()),this.routeMethods()),this.chartMethods()),this.nightModeMethods()),this.uiPanelMethods(t.extension)),{"ui.openConfigPanel":()=>ee(this,null,function*(){return this.openConfigPanel(t),{}}),"ui.toggleConfigPanel":()=>ee(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 Sf({port:wf(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:yi(he(he(he(he(he(he(he(he(he({},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.uiPanelMethods(t.extension)),{"ui.closePanel":()=>ee(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 Sf({port:wf(e.contentWindow,{origin:this.assetOrigin(t.runtime.url)}),hostInfo:this.hostInfo(),context:{kind:"background",id:t.runtime.id,instanceId:null},methods:he(he(he(he(he(he(he(he(he({},this.stateMethods(t.extension,null)),this.signalkMethods(i)),this.unitsMethods()),this.resourcesMethods(t.extension)),this.mapMethods()),this.routeMethods()),this.chartMethods()),this.nightModeMethods()),this.uiPanelMethods(t.extension)),onError:r=>console.warn("plotterext background error",r)}),this.contexts.add(i),()=>this.detach(i)}attachEmbeddingHost(e=wf(window.parent,{origin:window.location.origin})){let t=xre,i={extension:t,conn:null,skSubs:new Map,skSubSeq:0};return i.conn=new Sf({port:e,hostInfo:this.hostInfo(),adoptCallerId:!0,context:{kind:"embedding-host",id:t,instanceId:null},methods:he(he(he(he(he(he(he(he(he({},this.stateMethods(t,null)),this.signalkMethods(i)),this.unitsMethods()),this.resourcesMethods(t)),this.mapMethods()),this.routeMethods()),this.chartMethods()),this.nightModeMethods()),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:kC}}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-FPX76ANK.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(XF)??"{}")}catch(e){return{}}}saveStore(e){localStorage.setItem(XF,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 ri("No widget instance in scope",{code:$i.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=>ee(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=>ee(this,null,function*(){let{scope:o,values:a}=r??{};if(!a||typeof a!="object")throw new ri("state.set requires a values object",{code:$i.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=>ee(this,null,function*(){let{type:i,query:r}=t??{};if(typeof i!="string"||!/^[A-Za-z][A-Za-z0-9_-]*$/.test(i))throw new ri("resources.list requires a resource type",{code:$i.INVALID_PARAMS,reason:"INVALID_TYPE"});let o=this.serializeQuery(r);try{return(yield Ep(this.signalk.api.get(this.app.skApiVersion,`/resources/${i}${o}`)))??{}}catch(a){throw new ri(`resources.list ${i} failed`,{reason:"LIST_FAILED",data:{message:a?.message}})}}),"resources.setFilter":t=>ee(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(Sre)))throw new ri("resources.setFilter requires a type and a filter with mode plus ids and/or match",{code:$i.INVALID_PARAMS,reason:"INVALID_FILTER"});return this.setResourceFilter(e,i,r),{}}),"resources.clearFilter":t=>ee(this,null,function*(){let{type:i}=t??{};if(typeof i!="string")throw new ri("resources.clearFilter requires a type",{code:$i.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("&")}`:""}mapMethods(){return{"map.getView":()=>ee(this,null,function*(){return{center:this.app.config.map.center,zoom:this.app.config.map.zoomLevel,bounds:this.app.mapExtent()}}),"map.center":e=>ee(this,null,function*(){let{position:t,zoom:i}=e??{};if(!Array.isArray(t)||t.length!==2||!t.every(r=>typeof r=="number"))throw new ri("map.center requires position [lon, lat]",{code:$i.INVALID_PARAMS,reason:"INVALID_POSITION"});return this.app.mapMoveRequest.set(he({center:t},typeof i=="number"?{zoom:i}:{})),{}}),"map.fitBounds":e=>ee(this,null,function*(){let{bounds:t}=e??{};if(!Array.isArray(t)||t.length!==4||!t.every(l=>typeof l=="number"))throw new ri("map.fitBounds requires bounds [minLon, minLat, maxLon, maxLat]",{code:$i.INVALID_PARAMS,reason:"INVALID_BOUNDS"});let[i,r,o,a]=t,s=[(i+o)/2,(r+a)/2];return this.app.mapMoveRequest.set({center:s,zoom:this.zoomForBounds(t)}),{}})}}zoomForBounds(e){let t=this.mapService.getMaps()[0],i=t?.getSize();if(!t||!i)return 12;let r=t.getView(),o=zn(e,"EPSG:4326","EPSG:3857"),a=[i[0]*.85,i[1]*.85],s=r.getResolutionForExtent(o,a),l=r.getZoomForResolution(s)??12,c=this.app.MAP_ZOOM_EXTENT?.max??18;return Math.min(l,c)}pulseMapResize(e=320){let t=0,i=()=>{this.mapService.updateSize(),t+=16,t<e&&requestAnimationFrame(i)};requestAnimationFrame(i)}unitsMethods(){return{"units.get":()=>ee(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=>ee(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 ri("signalk.subscribe requires an array of literal Signal K paths",{code:$i.INVALID_PARAMS,reason:"INVALID_PATHS"});let r=`sk-${++e.skSubSeq}`;return e.skSubs.set(r,i),this.acquirePaths(i),{subscriptionId:r}}),"signalk.unsubscribe":t=>ee(this,null,function*(){let{subscriptionId:i}=t??{},r=i?e.skSubs.get(i):null;if(!r)throw new ri("Unknown subscriptionId",{code:$i.INVALID_PARAMS,reason:"UNKNOWN_SUBSCRIPTION"});return e.skSubs.delete(i),this.releasePaths(r),{}}),"signalk.put":t=>ee(this,null,function*(){let{path:i,value:r}=t??{};if(typeof i!="string"||!i.length)throw new ri("signalk.put requires a path",{code:$i.INVALID_PARAMS,reason:"INVALID_PATH"});try{return(yield Ep(this.signalk.api.put(1,`vessels/self/${i.split(".").join("/")}`,r)))??{}}catch(o){throw new ri(`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:Cre,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)(ot(re),ot(Ft),ot(bn),ot(Dt),ot(Sl),ot(_u),ot(Za))};static \u0275prov=et({token:n,factory:n.\u0275fac,providedIn:"root"})};function Mre(n,e){if(n&1&&j(0,"wpt-button",1),n&2){let t=v();w("position",t.app.data.vessels.self.position)("active",t.app.data.vessels.showSelf)}}function Tre(n,e){n&1&&j(0,"pob-button")}function Ere(n,e){if(n&1&&j(0,"autopilot-button",2),n&2){let t=v();w("active",t.app.featureFlags().autopilotApi&&t.app.data.vessels.self.autopilot.default)}}function Ire(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())}),p()}if(n&2){let t=v();w("active",t.app.featureFlags().radarApi&&t.radarApi.radarId().length!==0)}}var YF=class n{action=Z();radarClick=we();app=M(re);radarApi=M(fc);plotterExt=M(Mf);bottomOffset=Fi(()=>{let e=this.plotterExt.actionButtonLift();return e>0?e:23});constructor(){}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=W({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,Mre,1,2,"wpt-button",1),R(2,Tre,1,0,"pob-button"),R(3,Ere,1,1,"autopilot-button",2),R(4,Ire,1,1,"radar-button",2),p()),t&2&&(Nt("bottom",i.bottomOffset(),"px"),g(),A(i.action()==="wpt"?1:-1),g(),A(i.action()==="pob"?2:-1),g(),A(i.action()==="autopilot"?3:-1),g(),A(i.action()==="radar"?4:-1))},dependencies:[Sx,Mx,Tx,Ex],styles:[".mfb-container[_ngcontent-%COMP%]{position:absolute;bottom:23px;right:5px;z-index:5000}"]})};function Dre(n,e){if(n&1&&(u(0,"div",4),_(1),p()),n&2){let t=v(2);g(),q(" ",t.mode.description," ")}}function kre(n,e){if(n&1&&(u(0,"li"),_(1),p()),n&2){let t=e.$implicit;g(),X(t)}}function Pre(n,e){if(n&1&&(u(0,"div",4)(1,"ol",8),Oe(2,kre,2,1,"li",null,ft),p()()),n&2){let t=v(2);g(2),Fe(t.mode.steps)}}function Rre(n,e){if(n&1){let t=H();u(0,"div",1)(1,"div")(2,"span",3)(3,"mat-icon"),_(4),p(),_(5),p(),R(6,Dre,2,1,"div",4),R(7,Pre,4,0,"div",4),p(),u(8,"div",5)(9,"a",6),T("click",function(){O(t);let r=v();return F(r.close())}),u(10,"mat-icon",7),_(11,"close"),p(),_(12),p()()()}if(n&2){let t=v();g(4),X(t.mode.iconName),g(),q(" ",t.mode.iconText," "),g(),A(t.mode.description.length!==0?6:-1),g(),A(t.mode.steps.length!==0?7:-1),g(2),w("matTooltip",t.mapInteract.isModifying()?"Finish Editing":"Cancel Operation"),g(3),q(" ",t.mapInteract.isModifying()?"FINISH":"CANCEL"," ")}}function Lre(n,e){if(n&1){let t=H();u(0,"fb-measurements",9),T("cancel",function(){O(t);let r=v();return F(r.close())}),p()}if(n&2){let t=v();w("coords",t.mapInteract.measurement().coords)("index",t.mapInteract.measurement().index)("totalOnly",t.mapInteract.isDrawing()&&t.mapInteract.draw.resourceType==="route")}}var QF=class n{cancel=we();showHelpPanel;showMeasurePanel;mode={iconName:"",iconText:"",description:"",steps:[]};app=M(re);mapInteract=M(gc);constructor(){this.showHelpPanel=Fi(()=>this.mapInteract.isDrawing()&&this.mapInteract.draw.resourceType!=="route"||this.mapInteract.isModifying()||this.mapInteract.isBoxSelecting()||this.mapInteract.isMeasuring()&&this.mapInteract.measureGeometryType==="Circle"),this.showMeasurePanel=Fi(()=>this.mapInteract.isMeasuring()&&this.mapInteract.measureGeometryType==="LineString"||this.mapInteract.draw.resourceType==="route"&&(this.mapInteract.isDrawing()||this.mapInteract.isModifying())),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 Tap-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()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=W({type:n,selectors:[["fb-interact-help"]],outputs:{cancel:"cancel"},decls:3,vars:2,consts:[[1,"mat-app-background","_ap_interact_help"],[1,"mat-app-background","measurePanel"],["matTooltip","Click on the Map to start. Click cancel or the last point to end.",3,"coords","index","totalOnly"],[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"],[1,"icon-warn"],[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","totalOnly"]],template:function(t,i){t&1&&(u(0,"div",0),R(1,Rre,13,6,"div",1),R(2,Lre,1,3,"fb-measurements",2),p()),t&2&&(g(),A(i.showHelpPanel()?1:-1),g(),A(i.showMeasurePanel()?2:-1))},dependencies:[ae,le,ue,Ze,Ie,It,Cx],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_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 Dt=class n{reOpen;app=M(re);dialog=M(bn);signalk=M(Ft);worker=M(Hn);mapInteract=M(gc);constructor(){this.worker.resource$().subscribe(e=>this.processResourceMessage(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 ee(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];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()}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=J([]);charts=this.chartCacheSignal.asReadonly();appendOSM(e){let t=[["openstreetmap",new tl({name:"World Map",description:"Open Street Map"}),this.app&&this.selectionIsFiltered("charts")?this.app.config.selections.charts.includes("openstreetmap"):!0],["openseamap",new tl({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)}),e.push(t[1]),e.unshift(t[0]),e}refreshCharts(e){return ee(this,null,function*(){e&&e[0]!=="?"&&(e="?"+e),this.app.debug(`** refreshCharts(): ${e}`);try{let t=yield this.listFromServer("charts",e);this.appendOSM(t);let i=t.filter(r=>r[2]);i=this.sortByScaleDesc(i),i=this.arrangeChartLayers(i),this.chartCacheSignal.set(i),this.setMapZoomRange()}catch(t){this.app.debug("** refreshCharts:",t);let i=this.appendOSM([]);this.chartCacheSignal.set(i),this.setMapZoomRange()}})}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),typeof this.app.config.selections.chartOpacity[t]<"u"&&(e.defaultOpacity=this.app.config.selections.chartOpacity[t]);let i=this.app.config.selections.chartImageAdjustment?.[t];return typeof i<"u"&&(e.imageAdjustment=i),new tl(e)}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?
1073
+ `],encapsulation:2,changeDetection:0})}return n})(),DF=(()=>{class n extends SF{static \u0275fac=(()=>{let t;return function(r){return(t||(t=Ur(n)))(r||n)}})();static \u0275dir=st({type:n,selectors:[["button","matStepperNext",""]],hostAttrs:[1,"mat-stepper-next"],hostVars:1,hostBindings:function(i,r){i&2&&Kr("type",r.type)},features:[Qe]})}return n})();var _f=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=Mi({type:n});static \u0275inj=Si({providers:[Op],imports:[Pp,MF,ae,Ss,w1,eE,Nn]})}return n})();var iE=ts(Ml());var dn=class n{symDegree="\xBA";transform(e,t,i){let r=i?e<0?"S":"N":e<0?"W":"E";switch(t){case"SHDd":return this.toHDdSigned(e,r);case"DMdH":return this.toDMdH(e,r);case"HDd":return this.toHDd(e,r);case"HDMS":return this.toHDMS(e,r);case"DHMS":return this.toDHMS(e,r);default:return this.toXY(e)}}toXY(e,t=5){return e.toFixed(t)}toHDdSigned(e,t,i=5){let r=["S","W"].includes(t)?`${t} -`:`${t} +`,o=e.toFixed(i);return o=o.substring(o.indexOf(".")),`${r}${Math.floor(Math.abs(e))}${o}${this.symDegree}`}toDMdH(e,t,i=5){let r=Math.floor(Math.abs(e))??0,a=(Math.abs(r===0?e:e%r)*60).toFixed(i),s=["N","S"].includes(t)?"00":"000";return`${(s+r.toString()).slice(0-s.length)}${this.symDegree} ${a}' ${t}`}toHDd(e,t,i=5){let r=e.toFixed(i);return r=r.substring(r.indexOf(".")),`${t} ${Math.floor(Math.abs(e))}${r}${this.symDegree}`}toHDMS(e,t){return`${t} ${(0,iE.decimalToSexagesimal)(e)}`}toDHMS(e,t){let i=(0,iE.decimalToSexagesimal)(e);return i=i.slice(0,i.indexOf(" ")-1)+t+i.slice(i.indexOf(" ")+1),i}static \u0275fac=function(t){return new(t||n)};static \u0275pipe=Dp({name:"coords",type:n,pure:!0})};function One(n,e){if(n&1&&(u(0,"span",4),_(1),p()),n&2){let t=v().$implicit;g(),X(t[1])}}function Fne(n,e){if(n&1&&(u(0,"div",7),_(1),St(2,"coords"),p()),n&2){let t=v(2).$implicit,i=v();w("matTooltip",t[2]),g(),q(" ",Oi(2,2,t[2],i.app.config.units.positionFormat,!0)," ")}}function Nne(n,e){if(n&1&&(u(0,"div",7),_(1),St(2,"coords"),p()),n&2){let t=v(2).$implicit,i=v();w("matTooltip",t[2]),g(),q(" ",Oi(2,2,t[2],i.app.config.units.positionFormat,!1)," ")}}function Bne(n,e){if(n&1&&(u(0,"div",7),_(1),p()),n&2){let t=v(2).$implicit;w("matTooltip",t[2]),g(),X(t[2])}}function Vne(n,e){if(n&1&&(u(0,"div",5)(1,"div",6),_(2),p(),R(3,Fne,3,6,"div",7)(4,Nne,3,6,"div",7)(5,Bne,2,2,"div",7),p()),n&2){let t=v().$implicit;g(),w("matTooltip",t[1]),g(),X(t[1]),g(),A(t[1]==="latitude"?3:t[1]==="longitude"?4:5)}}function Gne(n,e){if(n&1&&(u(0,"div",3),R(1,One,2,1,"span",4),R(2,Vne,6,3,"div",5),p()),n&2){let t=e.$implicit;g(),A(t[0]===0&&t[2]===null?1:-1),g(),A(t[2]!==null?2:-1)}}var yd=class n{title=Z("");details=Z();items;app=M(re);constructor(){}ngOnChanges(){this.details()?this.parseEntries():this.items=[]}parseEntries(){let e=Object.entries(this.details());e.sort((t,i)=>t[0]<i[0]?-1:1),this.items=this.section(this.flatten(e))}section(e){let t=[];e.forEach(o=>{let a=o[0].split(".");if(a.length===1)t.push([0,"",a[0],typeof o[1]!="object"?o[1]:null]);else{let s=a.slice(0,a.length-1).join(".");t.push([a.length-1,s,a[a.length-1],o[1]])}}),t.sort((o,a)=>o[1]<a[1]?-1:1);let i=null,r=[];return e=[],t.forEach(o=>{o[1]!==i&&(i=o[1],r.indexOf(o[1])===-1&&(r.push(o[1]),e.push([0,o[1],null]))),e.push([o[0],o[2],o[3]])}),e}flatten(e){let t=[];return e.forEach(i=>{typeof i[1]=="object"&&i[1]!==null?t=t.concat(this.processObject(i[0],i[1])):t.push([i[0],i[1]])}),t}processObject(e,t){let i=[],r=Object.entries(t);return r.sort((o,a)=>o[0]<a[0]?-1:1),r.forEach(o=>{typeof o[1]=="object"&&o[1]!==null?i=i.concat(this.processObject(e+"."+o[0],o[1])):i.push([e+"."+o[0],o[1]])}),i}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=W({type:n,selectors:[["signalk-details-list"]],inputs:{title:[1,"title"],details:[1,"details"]},features:[Me],decls:7,vars:1,consts:[[1,"sk-details"],[1,"title"],[1,"content"],[1,"item"],[1,"sectionname"],[1,"pathvalue"],[1,"path",3,"matTooltip"],[1,"value",3,"matTooltip"]],template:function(t,i){t&1&&(u(0,"div",0)(1,"div",1)(2,"div"),_(3),p()(),u(4,"div",2),Oe(5,Gne,3,2,"div",3,ft),p()()),t&2&&(g(3),X(i.title()),g(2),Fe(i.items))},dependencies:[ve,Ie,dn],styles:[".sk-details[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;font-family:Roboto,Arial,Helvetica,sans-serif;font-size:10pt;max-height:100%}.sk-details[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{background:left 1px -webkit-gradient(linear,left top,left bottom,from(rgba(0,0,0,.18)),color-stop(.65,transparent)) #b2bbc2e3;padding:3px 5px 0;font-weight:500;line-height:23px}.sk-details[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{padding:0;line-height:23px;margin:0;flex:1 1 auto;overflow:auto}.sk-details[_ngcontent-%COMP%] .item[_ngcontent-%COMP%]{display:flex;flex-direction:row;line-height:26px;border-width:0 0 0 0;border-style:solid;border-color:gray;padding-left:5px}.sk-details[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .item[_ngcontent-%COMP%]{border-width:0 0 1px 0}.sk-details[_ngcontent-%COMP%] .sectionname[_ngcontent-%COMP%]{text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:100%;font-weight:500}.sk-details[_ngcontent-%COMP%] .pathvalue[_ngcontent-%COMP%]{display:flex;flex-wrap:nowrap;width:100%}.sk-details[_ngcontent-%COMP%] .pathvalue[_ngcontent-%COMP%] .path[_ngcontent-%COMP%]{text-align:left;width:60%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-style:italic}.sk-details[_ngcontent-%COMP%] .pathvalue[_ngcontent-%COMP%] .value[_ngcontent-%COMP%]{text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"],changeDetection:0})};var pE=ts(NF());var gc=class n{isMeasuring=J(!1);isDrawing=J(!1);isModifying=J(!1);isBoxSelecting=J(!1);measurement=J({coords:[],index:-1,center:null,radius:0});selection=J({mode:null});selectionResult;measureGeometryType="LineString";draw={resourceType:null,featureType:"Point",coordinates:null,features:null,forSave:null,properties:{}};app=M(re);constructor(){}initBoxCoord(e){this.selectionResult||(this.selectionResult={mode:null}),this.selectionResult.bbox=[e]}set measurementCoords(e){this.measurement.update(t=>Object.assign({},t,{coords:e}))}set measurementCenter(e){this.measurement.update(t=>Object.assign({},t,{center:e}))}set measurementRadius(e){this.measurement.update(t=>Object.assign({},t,{radius:e}))}addMeasurementCoord(e){let t=di.distanceTo(this.measurement().coords[this.measurement().coords.length-1],e);return this.measurement.update(i=>{let r=[].concat(i.coords);return r.push(e),Object.assign({},i,{coords:r})}),t}distanceFromLastPoint(e){return e&&this.measurement().coords.length>0?di.distanceTo(this.measurement().coords[this.measurement().coords.length-1],e):0}distanceFromCenter(e){return!e||!this.measurement().center?0:di.distanceTo(this.measurement().center,e)}startMeasuring(e,t){this.measureGeometryType=e??"LineString",this.app.debug("startMeasuring()..."),this.isMeasuring.set(!0),this.interactionStarted()}stopMeasuring(){this.app.debug("stopMeasuring()..."),this.isMeasuring.set(!1),this.interactionEnded()}startDrawing(e){this.app.debug("startDrawing()..."),this.isDrawing.set(!0),this.draw.resourceType=e,this.draw.featureType=e==="route"?"LineString":e==="region"?"Polygon":"Point",this.interactionStarted()}stopDrawing(e){if(this.app.debug("stopDrawing()..."),this.isDrawing.set(!1),e)switch(this.draw.featureType){case"Point":this.draw.coordinates=sn(e.getGeometry().getCoordinates());break;case"LineString":let t=e.getGeometry().getCoordinates();this.draw.coordinates=t.map(r=>sn(r));break;case"Polygon":let i=e.getGeometry().getCoordinates();i.length===0&&(this.draw.coordinates=[]),this.draw.coordinates=i[0].map(r=>sn(r));break}this.interactionEnded()}startModifying(e){this.app.debug("startModifying()..."),this.draw.features.getLength()!==0&&(this.isModifying.set(!0),this.draw.resourceType=e.type,this.draw.featureType=null,this.draw.forSave={id:null,coords:null},this.draw.coordinates=null,this.draw.properties={},this.interactionStarted())}stopModifying(){this.app.debug("stopModifying()..."),this.isModifying.set(!1),this.draw.features=null,this.interactionEnded()}startBoxSelection(e,t){this.app.debug("startBoxSelection()..."),this.selectionResult={mode:e,data:t,bbox:[]},this.isBoxSelecting.set(!0),this.interactionStarted()}stopBoxSelection(e){this.app.debug("stopBoxSelection()..."),e&&(this.selectionResult.bbox.push(e),this.formatBbox(),this.selection.update(()=>this.selectionResult)),this.isBoxSelecting.set(!1),this.interactionEnded()}formatBbox(){if(this.selectionResult.bbox.length!==2)return;let e=[].concat(this.selectionResult.bbox);this.selectionResult.bbox=[[e[0][0]<e[1][0]?e[0][0]:e[1][0],e[0][1]<e[1][1]?e[0][1]:e[1][1]],[e[0][0]>e[1][0]?e[0][0]:e[1][0],e[0][1]>e[1][1]?e[0][1]:e[1][1]]]}interactionStarted(){this.app.debug("interactionStarted()..."),this.measurement.set({coords:[],index:-1,center:null,radius:0}),this.app.uiCtrl.update(e=>Object.assign({},e,{suppressContextMenu:!0}))}interactionEnded(){this.app.debug("interactionEnded()..."),this.app.uiCtrl.update(e=>Object.assign({},e,{suppressContextMenu:!1})),this.measurement.set({coords:[],index:-1,center:null,radius:0})}static \u0275fac=function(t){return new(t||n)};static \u0275prov=et({token:n,factory:n.\u0275fac,providedIn:"root"})};var vs=class{name;description;distance=0;feature;constructor(e){this.name=e?.name?e.name:"",this.description=e?.description?e.description:"",this.distance=e?.distance?e.distance:0,this.feature=e?.feature??{type:"Feature",geometry:{type:"LineString",coordinates:[]},properties:{},id:""}}},vd=class{name;description;feature;type;constructor(e){this.name=e?.name?e.name:"",this.description=e?.description?e.description:"",this.type=e?.type?e.type:"",this.feature=e?.feature??{type:"Feature",geometry:{type:"Point",coordinates:[0,0]},properties:{},id:""}}},bd=class{name;description;position;href;mimeType;url;group;authors;properties;constructor(e){this.name=e?.name??"",this.description=e?.description??"",this.position=e?.position,this.href=e?.href,this.mimeType=e?.mimeType??"",this.url=e?.url??"",this.group=e?.group,this.authors=e?.authors&&Array.isArray(e?.authors)?e.authors:[],this.properties=e?.properties&&typeof e?.properties=="object"?e.properties:{}}},xd=class{name;description;feature;constructor(e){this.name=e?.name?e.name:"",this.description=e?.description?e.description:"",this.feature=e?.feature??{type:"Feature",geometry:{type:"Polygon",coordinates:[]},properties:{},id:""}}},tl=class{identifier;name;description;region;scale=25e4;layers;bounds;format;minZoom=0;maxZoom=24;tileSize=256;type;url;source;style;defaultOpacity;imageAdjustment;proxy;constructor(e){this.identifier=e?.identifier?e.identifier:void 0,this.name=e?.name?e.name:void 0,this.description=e?.description?e.description:void 0,this.layers=e?.layers?e.layers:[],this.bounds=e?.bounds?e.bounds:void 0,this.format=e?.format?e.format:void 0,this.minZoom=typeof e?.minzoom<"u"?e.minzoom:this.minZoom,this.maxZoom=typeof e?.maxzoom<"u"?e.maxzoom:this.maxZoom,this.tileSize=typeof e?.tileSize<"u"?e.tileSize:this.tileSize,this.type=e?.type?e.type:void 0,this.url=e?.url?e.url:void 0,this.scale=typeof e?.scale<"u"&&!isNaN(e?.scale)?e.scale:this.scale,this.style=e?.style??void 0,this.source=e?.$source??void 0,this.defaultOpacity=e?.defaultOpacity??1,this.imageAdjustment=e?.imageAdjustment,this.proxy=e?.proxy??!1}},Cf=class{name;description;feature;constructor(e){this.feature=e?.feature??{type:"Feature",geometry:{type:"MultiLineString",coordinates:[]},properties:{},id:""},this.name=this.feature.properties?.name??"",this.description=this.feature.properties?.description??""}},rE=class{id;name;mmsi;position=[0,0];positionReceived=!1;positionTimestamp="";state;type={id:-1,name:""};properties={};lastUpdated=new Date;callsignVhf;callsignHf;orientation=0;virtual},_d=class extends rE{anchor={maxRadius:null,radius:null,position:null};autopilot={state:null,mode:null,target:null,enabled:!1,default:null,availableActions:[]};buddy=!1;closestApproach={distance:null,timeTo:null};cog;cogTrue=null;cogMagnetic=null;courseApi={arrivalCircle:0,activeRoute:{},nextPoint:{},previousPoint:{}};courseCalcs={};distanceToSelf;environment={mode:null,sun:null};heading;headingTrue=null;headingMagnetic=null;performance={beatAngle:null,gybeAngle:null};racing;radars={};registrations={};resourceUpdates=[];sog;track=[];vectors={cog:[]};wind={direction:null,mwd:null,twd:null,tws:null,speedTrue:null,sog:null,awa:null,aws:null};design={airHeight:null,beam:null,draft:{current:null,maximum:null},length:null};destination={name:null,eta:null};flag;port};function $ne(n,e){if(n&1&&(u(0,"div",7)(1,"div",4),j(2,"span",13),St(3,"coords"),j(4,"br")(5,"span",13),St(6,"coords"),p(),u(7,"div"),j(8,"span",13),St(9,"coords"),j(10,"br")(11,"span",13),St(12,"coords"),p()()),n&2){let t=v();g(2),w("innerText",Oi(3,4,t.data.bbox[1][1],"HDd",!0)),g(3),w("innerText",Xn(6,8,t.data.bbox[1][0],"HDd")),g(3),w("innerText",Oi(9,11,t.data.bbox[0][1],"HDd",!0)),g(3),w("innerText",Xn(12,15,t.data.bbox[0][0],"HDd"))}}function qne(n,e){if(n&1&&(u(0,"mat-option",10),_(1),p()),n&2){let t=e.$implicit;w("value",t),g(),X(t)}}var bx=class n{icon;zoomRange=[];selZoom;app=M(re);dialogRef=M(ui);data=M(pi);constructor(){}ngOnInit(){let e=this.data.chart[1].minZoom??1,t=this.data.chart[1].maxZoom??15;this.selZoom=t;for(let i=e;i<=t;i++)this.zoomRange.push(i)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=W({type:n,selectors:[["ap-chartproperties"]],decls:26,vars:3,consts:[[1,"_ap-chartjob"],[2,"background-color","transparent"],[1,"dialog-icon"],[2,"flex","1 1 auto","text-align","center"],[2,"text-align","right"],["mat-icon-button","",3,"click"],[2,"flex","1 1 auto"],[2,"flex","1 1 auto","border","gray 1px solid","font-size","10pt"],[2,"width","100%"],[3,"ngModelChange","ngModel"],[3,"value"],["align","right"],["mat-flat-button","",3,"click"],[2,"flex","1 1 auto",3,"innerText"]],template:function(t,i){t&1&&(u(0,"div",0)(1,"mat-toolbar",1)(2,"span",2)(3,"mat-icon"),_(4,"download"),p()(),u(5,"span",3),_(6,"Chart Seed job"),p(),u(7,"span",4)(8,"button",5),T("click",function(){return i.dialogRef.close(-1)}),u(9,"mat-icon"),_(10,"close"),p()()()(),u(11,"mat-dialog-content")(12,"div")(13,"div",6),_(14),p(),R(15,$ne,13,18,"div",7),u(16,"div",6)(17,"mat-form-field",8)(18,"mat-label"),_(19,"Max. Zoom Level"),p(),u(20,"mat-select",9),xt("ngModelChange",function(o){return bt(i.selZoom,o)||(i.selZoom=o),o}),Oe(21,qne,2,2,"mat-option",10,ft),p()()()()(),u(23,"mat-dialog-actions",11)(24,"button",12),T("click",function(){return i.dialogRef.close(i.selZoom)}),_(25," Submit "),p()()()),t&2&&(g(14),X(i.data.chart[1].name),g(),A(i.data.bbox?15:-1),g(5),vt("ngModel",i.selZoom),g(),Fe(i.zoomRange))},dependencies:[ve,ae,le,qe,ue,Ze,Ne,It,kt,mi,Ni,hi,Ds,Wt,zt,Gl,Vl,Mt,Qi,Ji,dn],styles:["._ap-chartjob[_ngcontent-%COMP%]{font-family:arial;min-width:300px}.ap-confirm-icon[_ngcontent-%COMP%]{min-width:35px;max-width:35px;color:#ff8c00;text-align:left}._ap-chartjob[_ngcontent-%COMP%] .key-label[_ngcontent-%COMP%]{width:150px;font-weight:500}@media only screen and (min-device-width:768px)and (max-device-width:1024px),only screen and (min-width:800px){.ap-confirm-icon[_ngcontent-%COMP%]{min-width:25%;max-width:25%}}"]})};function Zne(n,e){if(n&1&&(pn(0,"span",2),_(1),In()),n&2){let t=v();g(),q("(",t.subTitle(),")")}}function Xne(n,e){if(n&1&&(pn(0,"span",2),_(1),In()),n&2){let t=v();g(),q(" (",t.subTitle(),") ")}}var oE=".dial-text[_ngcontent-%COMP%]{padding:0 10px;height:96px;font-family:roboto;border:transparent 1px solid}.dial-text-title[_ngcontent-%COMP%]{font-size:12pt;font-weight:500}.dial-text-subtitle[_ngcontent-%COMP%]{font-size:8pt;font-weight:500}.dial-text-value[_ngcontent-%COMP%]{font-size:22pt;font-weight:500}.dial-text-units[_ngcontent-%COMP%]{font-size:10pt}";function Yne(n,e){if(n&1&&(pn(0,"span",2),_(1),In()),n&2){let t=v();g(),q(" (",t.subTitle(),") ")}}var BF=class n{title=Z();subTitle=Z();value=Z();units=Z();static \u0275fac=function(t){return new(t||n)};static \u0275cmp=W({type:n,selectors:[["ap-dial-text"]],inputs:{title:[1,"title"],subTitle:[1,"subTitle"],value:[1,"value"],units:[1,"units"]},decls:8,vars:4,consts:[[1,"dial-text","mat-app-background"],[1,"dial-text-title"],[1,"dial-text-subtitle"],[1,"dial-text-value"],[1,"dial-text-units"]],template:function(t,i){t&1&&(pn(0,"div",0)(1,"div",1),_(2),R(3,Zne,2,1,"span",2),In(),pn(4,"div",3),_(5),In(),pn(6,"div",4),_(7),In()()),t&2&&(g(2),q(" ",i.title(),"\xA0 "),g(),A(i.subTitle()?3:-1),g(2),X(i.value()),g(2),X(i.units()))},styles:[oE],changeDetection:0})},VF=class n{value=Z();subTitle=Z();ttg="--";units="min";constructor(){Te(()=>{let e=this.value();if(typeof e!="number")this.ttg="--",this.units="min";else if(e<60)this.ttg=Math.floor(e).toString(),this.units="min";else if(e<1440)this.ttg=`${Math.floor(e/60)}:${("00"+(e%60).toFixed(0)).slice(-2)}`,this.units="hr:min";else{let i=Math.floor(e/1440),r=i*1440,o=e-r,a=Math.floor(o/60),s=`00${Math.floor(o-a*60)}`.slice(-2);this.ttg=`${i}:${("00"+a).slice(-2)}:${s}`,this.units="day:hr:min"}})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=W({type:n,selectors:[["ap-dial-ttg"]],inputs:{value:[1,"value"],subTitle:[1,"subTitle"]},decls:8,vars:3,consts:[[1,"dial-text","mat-app-background"],[1,"dial-text-title"],[1,"dial-text-subtitle"],[1,"dial-text-value"],[1,"dial-text-units"]],template:function(t,i){t&1&&(pn(0,"div",0)(1,"div",1),_(2," TTG\xA0 "),R(3,Xne,2,1,"span",2),In(),pn(4,"div",3),_(5),In(),pn(6,"div",4),_(7),In()()),t&2&&(g(3),A(i.subTitle()?3:-1),g(2),X(i.ttg),g(2),X(i.units))},styles:[oE],changeDetection:0})},GF=class n{value=Z();subTitle=Z();etaTime="--";etaDate="--";constructor(){Te(()=>{this.value()&&(this.etaTime=this.value().toLocaleTimeString().split(":").slice(0,2).join(":"),this.etaDate=this.value().toLocaleDateString())})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=W({type:n,selectors:[["ap-dial-eta"]],inputs:{value:[1,"value"],subTitle:[1,"subTitle"]},decls:8,vars:3,consts:[[1,"dial-text","mat-app-background"],[1,"dial-text-title"],[1,"dial-text-subtitle"],[1,"dial-text-value"],[1,"dial-text-units"]],template:function(t,i){t&1&&(pn(0,"div",0)(1,"div",1),_(2," ETA\xA0 "),R(3,Yne,2,1,"span",2),In(),pn(4,"div",3),_(5),In(),pn(6,"div",4),_(7),In()()),t&2&&(g(3),A(i.subTitle()?3:-1),g(2),X(i.etaTime),g(2),X(i.etaDate))},styles:[oE],changeDetection:0})};var Qne=["*"],Jne=n=>({disabled:n});function ere(n,e){if(n&1&&(u(0,"span")(1,"i",6),_(2,"upload"),p(),_(3," \xA0"),u(4,"span",7),_(5),p()()),n&2){let t=v();g(5),X(t.label())}}function tre(n,e){if(n&1){let t=H();u(0,"button",9),T("click",function(){O(t);let r=v(2);return F(r.clear())}),_(1,"Clear"),p()}}function ire(n,e){if(n&1&&(u(0,"div",5),j(1,"img",8),R(2,tre,2,0,"button"),p()),n&2){let t=v();g(),lt("src",t.avatar,Cc),g(),A(t.avatar?2:-1)}}var jF=class n{disabled=Z(!1);multiple=Z(!1);maxfilesize=Z(void 0);accept=Z("");astext=Z(!1);preview=Z(!1);icon=Z(!1);label=Z("Upload File");chosen=we();invalid=we();cleared=we();avatar=null;changeDetectorRef=M(oe);constructor(){}fileChange(e){this.readFiles(e.files)}dragOver(e){e.preventDefault()}drop(e){e.preventDefault(),e.dataTransfer.files&&e.dataTransfer.files.length>0&&this.readFiles(e.dataTransfer.files)}clear(){this.avatar=null,this.cleared.emit()}readFiles(e,t=0){let i=new FileReader,r={type:"",value:"",message:""};if(t in e){if(this.maxfilesize()&&e[t].size>this.maxfilesize()){r.type="SIZE",r.value=e[t].size,r.message=`File size exceeds the accepted maximum size of ${this.maxfilesize()}`,this.invalid.emit(r);return}if(this.accept().indexOf("/*")!==-1){let o=e[t].type.substring(0,e[t].type.indexOf("/"));if(this.accept().indexOf(o)<0){r.type="TYPE",r.value=e[t].type,r.message=`File type does not match the accepted type (${this.accept()}) specified.`,this.invalid.emit(r);return}}this.readFile(e[t],i,o=>{t===0&&this.preview()&&(this.avatar=o),this.chosen.emit({name:e[t].name,data:o}),this.readFiles(e,t+1)})}else this.changeDetectorRef.detectChanges()}readFile(e,t,i){t.onload=()=>{i(t.result)},e.type.indexOf("text")!==-1||this.astext()?t.readAsText(e):t.readAsDataURL(e)}resize(e,t,i,r){return e.onload=()=>{let o=e.width,a=e.height;o>a?o>t&&(a*=t/o,o=t):a>i&&(o*=i/a,a=i);let s=document.createElement("canvas");s.width=o,s.height=a,s.getContext("2d").drawImage(e,0,0,o,a);let c=s.toDataURL("image/jpeg");r(c,e.src.length,c.length)}}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=W({type:n,selectors:[["ap-file-input"]],inputs:{disabled:[1,"disabled"],multiple:[1,"multiple"],maxfilesize:[1,"maxfilesize"],accept:[1,"accept"],astext:[1,"astext"],preview:[1,"preview"],icon:[1,"icon"],label:[1,"label"]},outputs:{chosen:"chosen",invalid:"invalid",cleared:"cleared"},ngContentSelectors:Qne,decls:8,vars:8,consts:[["input",""],[1,"ap-file-input",3,"dragover","drop"],["id","ctrl",3,"ngClass"],["mat-menu-item",""],["type","file",2,"display","none",3,"change","click","multiple","disabled","accept"],["id","avatar",2,"display","inline-flex"],[1,"material-icons"],[2,"font-size","10pt"],["alt",""],[3,"click"]],template:function(t,i){if(t&1){let r=H();ge(),u(0,"div",1),T("dragover",function(a){return i.dragOver(a)})("drop",function(a){return i.drop(a)}),u(1,"div",2)(2,"label",3),ce(3),R(4,ere,6,1,"span"),u(5,"input",4,0),T("change",function(){O(r);let a=Le(6);return F(i.fileChange(a))})("click",function(){O(r);let a=Le(6);return F(a.value=null)}),p()()(),R(7,ire,3,2,"div",5),p()}t&2&&(g(),w("ngClass",vn(6,Jne,i.disabled())),g(3),A(i.icon()?4:-1),g(),w("multiple",i.multiple())("disabled",i.disabled())("accept",i.accept()),g(2),A(i.preview()&&i.avatar?7:-1))},dependencies:[hn,Fn],styles:[".ap-file-input[_ngcontent-%COMP%]{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:inline-flex;-moz-flex-direction:row;-ms-flex-direction:row;-webkit-flex-direction:row;flex-direction:row;flex-wrap:nowrap;justify-content:flex-start;align-content:stretch;width:100%}#ctrl[_ngcontent-%COMP%], #ctrl[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{cursor:pointer}#apfileinput[_ngcontent-%COMP%]{position:absolute;top:0;left:-9000px;width:.1px;height:.1px;opacity:0;overflow:hidden;z-index:-1}.disabled[_ngcontent-%COMP%]{color:#21212180!important;border-color:#21212180!important;cursor:none!important}#avatar[_ngcontent-%COMP%]{background-color:inherit;border-radius:5px;height:42px}#avatar[_ngcontent-%COMP%] > img[_ngcontent-%COMP%]{width:42px;height:42px}#avatar[_ngcontent-%COMP%] > button[_ngcontent-%COMP%]{background-color:inherit;border:0;color:red}"]})};var nre=["vid"],zF=class n{pipVideo;pipWindow;pipMode=!1;vidUrl;src=Z();muted=Z(!0);_muted=Ea(()=>this.muted());resize=we();change=we();click=we();vid;constructor(){Te(()=>{this.src()&&(this.vidUrl=this.src())})}ngOnInit(){"pictureInPictureEnabled"in document||(this.pipMode=!0),this.pipVideo=this.vid.nativeElement,this.pipVideo.addEventListener("enterpictureinpicture",e=>{this.pipMode=!0,this.pipWindow=e.pictureInPictureWindow,this.pipWindow.addEventListener("resize",this.onPipWindowResize.bind(this)),this.change.emit(this.pipMode)}),this.pipVideo.addEventListener("leavepictureinpicture",()=>{this.pipMode=!1,this.pipVideo.pause(),this.pipWindow.removeEventListener("resize",this.onPipWindowResize),this.change.emit(this.pipMode)})}onPipWindowResize(e){this.resize.emit([e.srcElement.width,e.srcElement.height])}toggleMute(){this._muted.update(e=>!e)}initPiP(){return ee(this,null,function*(){try{yield this.pipVideo.requestPictureInPicture(),this.pipMode=!0,this.vid.nativeElement.play(),this.click.emit(!0)}catch(e){this.pipMode=!1}})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=W({type:n,selectors:[["pip-video"]],viewQuery:function(t,i){if(t&1&&Ht(nre,7),t&2){let r;De(r=ke())&&(i.vid=r.first)}},inputs:{src:[1,"src"],muted:[1,"muted"]},outputs:{resize:"resize",change:"change",click:"click"},decls:7,vars:5,consts:[["vid",""],[2,"border","gray 1px solid","border-radius","5px","display","none"],["autoplay","",3,"src","muted"],[2,"padding-left","5px"],["mat-mini-fab","","matTooltip","Show Video","matTooltipPosition","left",1,"button-toolbar",3,"click","disabled"]],template:function(t,i){t&1&&(u(0,"div",1),j(1,"video",2,0),p(),u(3,"div",3)(4,"button",4),T("click",function(){return i.initPiP()}),u(5,"mat-icon"),_(6,"videocam"),p()()()),t&2&&(g(),w("src",i.vidUrl,Cc)("muted",i._muted()),g(3),Nt("display",i.src()?"block":"none"),w("disabled",i.pipMode))},dependencies:[ue,Ms,ve,Ie,ae,le],encapsulation:2})};var WF=ts(Ml());function rre(n,e){if(n&1&&(u(0,"div",1)(1,"div",1)(2,"div",5)(3,"mat-icon"),_(4,"square_foot"),p(),j(5,"br"),_(6),p(),u(7,"div",3),_(8),j(9,"br"),_(10),p()()()),n&2){let t=v();g(6),q(" ",t.coords().length<2?"-":t._index()===-1?t.coords().length-1:t._index()+1," "),g(2),q(" ",t.legDistance),g(2),q(" ",t.legBearing," ")}}var Cx=class n{coords=Z([]);index=Z(-1);_index=Ea(()=>this.index());totalOnly=Z(!1);cancel=we();totalDistance;legDistance;legBearing;btnDisable={prev:!1,next:!1};app=M(re);constructor(){Te(()=>{if(!this.coords()||!Array.isArray(this.coords())||this.coords().length===0){this.init();return}if(this._index())if(Number.isFinite(this._index())){if(this._index()<-1&&this._index()>=this.coords().length)return}else return;this.calc(),this.setButtonState()}),this.init()}init(e){e||(this.totalDistance="--"),this.legDistance="--",this.legBearing="--",this.btnDisable={prev:!0,next:!0}}close(){this.cancel.emit()}calc(){let e=di.routeLength(this.coords());this.totalDistance=this.app.formatValueForDisplay(e,"m");let t;if(this._index()===-1)t=this.coords().slice(-2);else{let i=this._index()===this.coords().length-2?void 0:this._index()+2;t=this.coords().slice(this._index(),i)}if(t.length<2)this.init(!0);else{let i=di.distanceTo(t[0],t[1]),r=(0,WF.getGreatCircleBearing)(t[0],t[1]);this.legDistance=this.app.formatValueForDisplay(i,"m"),this.legBearing=this.app.formatValueForDisplay(r,"deg")}}select(e){e?this._index()===-1?this.coords().length>2&&this._index.set(this.coords().length-3):this._index()>0&&this._index.update(t=>--t):(this._index()!==-1||this._index()<this.coords().length-2)&&this._index.update(t=>++t),this.setButtonState(),this.calc()}setButtonState(){this._index()>0||this._index()===-1&&this.coords().length>2?this.btnDisable.prev=!1:this.btnDisable.prev=!0,this._index()!==-1&&this._index()<this.coords().length-2?this.btnDisable.next=!1:this.btnDisable.next=!0}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=W({type:n,selectors:[["fb-measurements"]],inputs:{coords:[1,"coords"],index:[1,"index"],totalOnly:[1,"totalOnly"]},outputs:{cancel:"cancel"},decls:15,vars:2,consts:[[1,"_ap_measurements"],[1,"_ap_row"],[1,"icon-label"],[1,"value"],["matTooltip","Cancel","matTooltipPosition","below","mat-icon-button","",3,"click"],[2,"font-size","12pt"]],template:function(t,i){t&1&&(u(0,"div",0)(1,"mat-toolbar")(2,"div",1)(3,"div",1)(4,"div",2)(5,"mat-icon"),_(6,"straighten"),p()(),u(7,"div",3),_(8),j(9,"br"),p()(),R(10,rre,11,3,"div",1),u(11,"div")(12,"button",4),T("click",function(){return i.close()}),u(13,"mat-icon"),_(14,"close"),p()()()()()()),t&2&&(g(8),X(i.totalDistance),g(2),A(i.totalOnly()?-1:10))},dependencies:[ae,le,ue,Ne,Ie,It,kt],styles:["._ap_measurements[_ngcontent-%COMP%]{position:relative;top:0;min-width:200px}._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})};function ore(n,e){if(n&1){let t=H();pn(0,"img",1),G1("error",function(){O(t);let r=v();return F(r.imgError())}),In()}if(n&2){let t=v();Kr("src",t.flagIcon,Cc)}}var wx=class n{flagIcon;showFlag=J(!0);mmsi=Z();host=Z("");constructor(){Te(()=>{this.flagIcon=`${this.host()}/signalk/v2/api/resources/flags/mmsi/${this.mmsi()}`})}imgError(){this.showFlag.set(!1)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=W({type:n,selectors:[["country-flag"]],inputs:{mmsi:[1,"mmsi"],host:[1,"host"]},decls:1,vars:1,consts:[[3,"src"],[3,"error","src"]],template:function(t,i){t&1&&R(0,ore,1,1,"img",0),t&2&&A(i.showFlag()?0:-1)},encapsulation:2})};var Sx=class n{notiMgr=M(il);constructor(){}raiseAlarm(){this.notiMgr.raiseServerAlarm("mob","Person Overboard!")}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=W({type:n,selectors:[["pob-button"]],decls:2,vars:0,consts:[["mat-fab","","matTooltip","Raise POB Alarm","matTooltipPosition","above",1,"button-warn",3,"click"],["svgIcon","alarm-mob",1,"ob"]],template:function(t,i){t&1&&(u(0,"button",0),T("click",function(){return i.raiseAlarm()}),j(1,"mat-icon",1),p())},dependencies:[ae,le,ue,Ed,ve,Ie],encapsulation:2})};var Mx=class n{position=Z([0,0]);active=Z(!1);skres=M(Dt);constructor(){}dropWaypoint(){this.skres.newWaypointAt(this.position())}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=W({type:n,selectors:[["wpt-button"]],inputs:{position:[1,"position"],active:[1,"active"]},decls:3,vars:1,consts:[["mat-fab","","matTooltip","Mark Vessel Position","matTooltipPosition","above",1,"button-toolbar",3,"click","disabled"]],template:function(t,i){t&1&&(u(0,"button",0),T("click",function(){return i.dropWaypoint()}),u(1,"mat-icon"),_(2,"add_location"),p()()),t&2&&w("disabled",!i.active())},dependencies:[ae,le,ue,Ed,ve,Ie],encapsulation:2})};var are=(n,e)=>({"button-primary":n,"button-toolbar":e}),Tx=class n{active=Z(!1);app=M(re);constructor(){}handleClick(){this.app.uiCtrl.update(e=>{let t=!e.autopilotConsole;return Object.assign({},e,{autopilotConsole:t})})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=W({type:n,selectors:[["autopilot-button"]],inputs:{active:[1,"active"]},decls:2,vars:5,consts:[["mat-fab","","matTooltip","Autopilot Console","matTooltipPosition","above",3,"click","ngClass","disabled"],["svgIcon","command-autopilot",1,"ob"]],template:function(t,i){t&1&&(u(0,"button",0),T("click",function(){return i.handleClick()}),j(1,"mat-icon",1),p()),t&2&&w("ngClass",rs(2,are,i.app.data.vessels.self.autopilot.enabled,!i.app.data.vessels.self.autopilot.enabled||!i.app.featureFlags().autopilotApi||!i.app.data.vessels.self.autopilot.default))("disabled",!i.active())},dependencies:[hn,Fn,ae,le,ue,Ed,ve,Ie],encapsulation:2})};var sre=(n,e)=>({"button-primary":n,"button-toolbar":e}),Ex=class n{active=Z(!1);app=M(re);radarApi=M(fc);constructor(){}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=W({type:n,selectors:[["radar-button"]],inputs:{active:[1,"active"]},decls:2,vars:5,consts:[["mat-fab","","matTooltip","Radar Overlay","matTooltipPosition","above",3,"ngClass","disabled"],["svgIcon","radar-iec",1,"ob"]],template:function(t,i){t&1&&(u(0,"button",0),j(1,"mat-icon",1),p()),t&2&&w("ngClass",rs(2,sre,i.radarApi.radarId()&&i.app.uiCtrl().radarLayer,!i.app.featureFlags().radarApi||!i.app.uiCtrl().radarLayer))("disabled",!i.active()||!i.app.data.vessels.showSelf||i.app.instrumentPanel().open)},dependencies:[hn,Fn,ae,le,ue,Ed,ve,Ie],encapsulation:2})};var Vo=[];for(let n=0;n<256;++n)Vo.push((n+256).toString(16).slice(1));function UF(n,e=0){return(Vo[n[e+0]]+Vo[n[e+1]]+Vo[n[e+2]]+Vo[n[e+3]]+"-"+Vo[n[e+4]]+Vo[n[e+5]]+"-"+Vo[n[e+6]]+Vo[n[e+7]]+"-"+Vo[n[e+8]]+Vo[n[e+9]]+"-"+Vo[n[e+10]]+Vo[n[e+11]]+Vo[n[e+12]]+Vo[n[e+13]]+Vo[n[e+14]]+Vo[n[e+15]]).toLowerCase()}var lre=new Uint8Array(16);function aE(){return crypto.getRandomValues(lre)}function cre(n,e,t){return!e&&!n&&crypto.randomUUID?crypto.randomUUID():dre(n,e,t)}function dre(n,e,t){n=n||{};let i=n.random??n.rng?.()??aE();if(i.length<16)throw new Error("Random bytes length must be >= 16");if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,e){if(t=t||0,t<0||t+16>e.length)throw new RangeError(`UUID byte range ${t}:${t+15} is out of buffer bounds`);for(let r=0;r<16;++r)e[t+r]=i[r];return e}return UF(i)}var sE=cre;var lE="plotterExt/1",$i={PARSE_ERROR:-32700,INVALID_REQUEST:-32600,METHOD_NOT_FOUND:-32601,INVALID_PARAMS:-32602,INTERNAL_ERROR:-32603,HOST_ERROR:-32e3,TIMEOUT:-32001,CONNECTION_CLOSED:-32002},ri=class I1 extends Error{code;data;constructor(e,t={}){super(e),this.name="RpcError",this.code=t.code??$i.HOST_ERROR;let i=he({},t.data??{});t.reason!==void 0&&(i.reason=t.reason),this.data=Object.keys(i).length>0?i:void 0}get reason(){return typeof this.data?.reason=="string"?this.data.reason:void 0}toErrorObject(){return he({code:this.code,message:this.message},this.data?{data:this.data}:{})}static fromErrorObject(e){return new I1(e.message,{code:e.code,data:e.data})}static from(e){return e instanceof I1?e:e instanceof Error?new I1(e.message,{code:$i.INTERNAL_ERROR}):new I1(String(e),{code:$i.INTERNAL_ERROR})}},cE="bus.ready",dE="bus.handshake";function HF(n,e){return n===e?!0:KF(n.split("."),0,e.split("."),0)}function KF(n,e,t,i){for(;e<n.length;){let r=n[e];if(r==="**"){if(e===n.length-1)return!0;for(let o=i;o<=t.length;o++)if(KF(n,e+1,t,o))return!0;return!1}if(i>=t.length||r!=="*"&&r!==t[i])return!1;e++,i++}return i===t.length}function Ix(n,e){for(let t of n)if(HF(t,e))return!0;return!1}function pre(n){return{bus:lE,msg:n}}function hre(n){if(typeof n!="object"||n===null)return null;let e=n;return e.bus!==lE?null:mre(e.msg)?e.msg:null}function mre(n){if(typeof n!="object"||n===null)return!1;let e=n;if(e.jsonrpc!=="2.0")return!1;if(typeof e.method=="string")return e.id===void 0||typeof e.id=="string"||typeof e.id=="number";if(!(typeof e.id=="string"||typeof e.id=="number"||e.id===null))return!1;let i="result"in e,r=e.error,o=typeof r=="object"&&r!==null&&typeof r.code=="number"&&typeof r.message=="string";return i?!("error"in e):o}function fre(n){return"method"in n&&"id"in n&&n.id!==void 0}function gre(n){return"method"in n&&(!("id"in n)||n.id===void 0)}function _re(n){return!("method"in n)}function wf(n,e={}){let t=e.listenWindow??globalThis,i=e.origin??t.location?.origin??"*";return{post(r){n.postMessage(r,i)},listen(r){let o=a=>{a.source===n&&(i!=="*"&&a.origin!==i||r(a.data))};return t.addEventListener("message",o),()=>t.removeEventListener("message",o)}}}var yre=1e4,uE=class{callTimeoutMs;port;unlisten;onError;pending=new Map;methods=new Map;eventHandlers=new Set;idPrefix=Math.random().toString(36).slice(2,8);seq=0;closed=!1;constructor(n){this.port=n.port,this.callTimeoutMs=n.callTimeoutMs??yre,this.onError=n.onError??(e=>console.warn("[plotterext-bus]",e)),this.unlisten=this.port.listen(e=>this.onData(e))}registerMethod(n,e){this.methods.set(n,e)}unregisterMethod(n){this.methods.delete(n)}onEvent(n,e){let t={patterns:n,fn:e};return this.eventHandlers.add(t),()=>this.eventHandlers.delete(t)}notify(n,e){this.send(he({jsonrpc:"2.0",method:n},e!==void 0?{params:e}:{}))}call(n,e,t={}){if(this.closed)return Promise.reject(new ri("Bus endpoint is closed",{code:$i.CONNECTION_CLOSED,reason:"CLOSED"}));let i=`${this.idPrefix}-${++this.seq}`,r=t.timeoutMs??this.callTimeoutMs;return new Promise((o,a)=>{let s=r>0?setTimeout(()=>{this.pending.delete(i),a(new ri(`Call timed out after ${r}ms: ${n}`,{code:$i.TIMEOUT,reason:"TIMEOUT"}))},r):null;this.pending.set(i,{resolve:o,reject:a,timer:s}),this.send(he({jsonrpc:"2.0",id:i,method:n},e!==void 0?{params:e}:{}))})}close(){if(!this.closed){this.closed=!0,this.unlisten();for(let[,n]of this.pending)n.timer&&clearTimeout(n.timer),n.reject(new ri("Bus endpoint closed",{code:$i.CONNECTION_CLOSED,reason:"CLOSED"}));this.pending.clear(),this.eventHandlers.clear()}}send(n){this.closed||this.port.post(pre(n))}onData(n){let e=hre(n);e&&(_re(e)?this.onResponse(e):fre(e)?this.onRequest(e):gre(e)&&this.onNotification(e.method,e.params))}onResponse(n){if(n.id===null)return;let e=this.pending.get(n.id);e&&(this.pending.delete(n.id),e.timer&&clearTimeout(e.timer),"error"in n?e.reject(ri.fromErrorObject(n.error)):e.resolve(n.result))}onRequest(n){return ee(this,null,function*(){let e=this.methods.get(n.method);if(!e){this.send({jsonrpc:"2.0",id:n.id,error:{code:$i.METHOD_NOT_FOUND,message:`Method not found: ${n.method}`}});return}try{let t=yield e(n.params,{endpoint:this});this.send({jsonrpc:"2.0",id:n.id,result:t===void 0?null:t})}catch(t){this.send({jsonrpc:"2.0",id:n.id,error:ri.from(t).toErrorObject()})}})}onNotification(n,e){for(let t of[...this.eventHandlers])if(Ix(t.patterns,n))try{t.fn(n,e)}catch(i){this.onError(i)}}};var Sf=class{endpoint;context;hostInfo;subs=new Map;onSubscriptionsChanged;adoptCallerId;subSeq=0;constructor(n){this.hostInfo=n.hostInfo,this.context=n.context,this.onSubscriptionsChanged=n.onSubscriptionsChanged,this.adoptCallerId=n.adoptCallerId??!1,this.endpoint=new uE({port:n.port,callTimeoutMs:n.callTimeoutMs,onError:n.onError});for(let[e,t]of Object.entries(n.methods??{}))this.endpoint.registerMethod(e,t);this.endpoint.registerMethod("events.subscribe",e=>this.handleSubscribe(e)),this.endpoint.registerMethod("events.unsubscribe",e=>this.handleUnsubscribe(e)),this.endpoint.onEvent([cE],(e,t)=>this.sendHandshake(t))}registerMethod(n,e){this.endpoint.registerMethod(n,e)}publish(n,e){return this.hasSubscriber(n)?(this.endpoint.notify(n,e),!0):!1}hasSubscriber(n){for(let[,e]of this.subs)if(Ix(e,n))return!0;return!1}subscribedPatterns(){let n=new Set;for(let[,e]of this.subs)for(let t of e)n.add(t);return[...n]}close(){this.endpoint.close(),this.subs.clear()}sendHandshake(n){let e=this.adoptCallerId&&n?.id?yi(he({},this.context),{id:n.id}):this.context;this.endpoint.notify(dE,yi(he({},this.hostInfo),{context:e}))}handleSubscribe(n){let e=n?.patterns;if(!Array.isArray(e)||e.length===0||!e.every(i=>typeof i=="string"&&i.length>0))throw new ri("events.subscribe requires a non-empty patterns array",{code:$i.INVALID_PARAMS,reason:"INVALID_PATTERNS"});let t=`sub-${++this.subSeq}`;return this.subs.set(t,e),this.onSubscriptionsChanged?.(this.subscribedPatterns()),{subscriptionId:t}}handleUnsubscribe(n){let e=n?.subscriptionId;if(typeof e!="string"||!this.subs.has(e))throw new ri("Unknown subscriptionId",{code:$i.INVALID_PARAMS,reason:"UNKNOWN_SUBSCRIPTION"});return this.subs.delete(e),this.onSubscriptionsChanged?.(this.subscribedPatterns()),{}}};function $F(n,e={}){let t=s=>{let l=s?.routeId;if(typeof l!="string"||l.length===0)throw new ri("route method requires a routeId",{code:$i.INVALID_PARAMS,reason:"routes.badRequest"});return l},i=()=>new ri("Unknown route buffer",{reason:"routes.unknownId"}),r=s=>new ri(s,{code:$i.INVALID_PARAMS,reason:"routes.badRequest"}),o=(s,l)=>{if(s!==void 0&&typeof s!="string")throw r(`${l} must be a string`)},a=s=>{if(!Array.isArray(s)||s.length<2)throw r("a route needs at least two points");for(let l of s){let c=l?.position;if(!Array.isArray(c)||c.length<2||!Number.isFinite(c[0])||!Number.isFinite(c[1]))throw r("each route point needs a numeric [lon, lat] position");o(l.name,"point name"),o(l.description,"point description")}return s};return{"route.list":()=>({routes:n.list()}),"route.create":s=>{let{name:l,description:c,points:d}=s??{};o(l,"name"),o(c,"description");let h=a(d),m=n.create({name:l,description:c,points:h});return{routeId:m.routeId,rev:m.rev}},"route.replace":s=>{let l=t(s),{points:c}=s??{},d=a(c),h=n.replace(l,d);if(!h)throw i();return{rev:h.rev}},"route.save":s=>ee(null,null,function*(){let l=t(s);if(!n.has(l))throw i();if(!e.onSave)throw new ri("This host cannot persist routes",{reason:"routes.notSupported"});let{name:c,description:d,dialog:h}=s??{};if(o(c,"name"),o(d,"description"),h!==void 0&&typeof h!="boolean")throw r("dialog must be a boolean");let m=yield e.onSave(l,{name:c,description:d,dialog:h});if(!m)throw new ri("Route save was cancelled",{reason:"routes.saveCancelled"});return m}),"route.get":s=>{let l=n.get(t(s));if(!l)throw i();return l},"route.hide":s=>ee(null,null,function*(){let l=t(s);if(!n.has(l))throw i();return e.onHide?yield e.onHide(l):n.delete(l),{}}),"route.delete":s=>ee(null,null,function*(){let l=t(s);if(!n.has(l))throw i();return e.onDelete?yield e.onDelete(l):n.delete(l,!1),{}}),"route.show":s=>{let l=s?.ref;if(typeof l!="string"||l.length===0)throw new ri("route.show requires a ref",{code:$i.INVALID_PARAMS,reason:"routes.badRef"});if(!e.onShow)throw new ri("route.show is not supported by this host",{reason:"routes.notSupported"});return e.onShow(l)}}}function vre(n){let[e,t,i]=n,r={id:e,name:t?.name??e,visible:!!i,opacity:typeof t?.defaultOpacity=="number"?t.defaultOpacity:1};return t?.type&&(r.type=t.type),Array.isArray(t?.bounds)&&t.bounds.length===4&&(r.bounds=[t.bounds[0],t.bounds[1],t.bounds[2],t.bounds[3]]),typeof t?.minZoom=="number"&&(r.minZoom=t.minZoom),typeof t?.maxZoom=="number"&&(r.maxZoom=t.maxZoom),r}function qF(n){let e=r=>new ri(r,{code:$i.INVALID_PARAMS,reason:"charts.badRequest"}),t=(r,o)=>{if(!Array.isArray(r)||r.some(a=>typeof a!="string"||a.length===0))throw e(`${o} must be an array of chart ids`);return r},i=(r,o)=>{let a=new Set(o.map(l=>l[0])),s=r.find(l=>!a.has(l));if(s!==void 0)throw new ri(`Unknown chart id: ${s}`,{reason:"charts.unknownId"})};return{"chart.list":()=>ee(null,null,function*(){return{charts:(yield n.listAvailableOrdered()).map(vre)}}),"chart.setVisibility":r=>ee(null,null,function*(){let o=t(r?.ids,"ids"),a=r?.visible;if(typeof a!="boolean")throw e("visible must be a boolean");return o.length>0&&(i(o,yield n.listAvailableOrdered()),yield n.setVisibility(o,a)),{}}),"chart.setOpacity":r=>ee(null,null,function*(){let o=t(r?.ids,"ids"),a=r?.opacity;if(typeof a!="number"||!Number.isFinite(a))throw e("opacity must be a finite number");if(a<0||a>1)throw e("opacity must be between 0 and 1");return o.length>0&&(i(o,yield n.listAvailableOrdered()),yield n.setOpacity(o,a)),{}}),"chart.setOrder":r=>ee(null,null,function*(){let o=t(r?.order,"order");return o.length>0&&(i(o,yield n.listAvailableOrdered()),yield n.setOrder(o)),{}})}}function ZF(n){let e=t=>new ri(t,{code:$i.INVALID_PARAMS,reason:"nightMode.badRequest"});return{"nightMode.get":()=>ee(null,null,function*(){return n.getState()}),"nightMode.set":t=>ee(null,null,function*(){let i=t??{},r=i.enabled!==void 0,o=i.auto!==void 0;if(!r&&!o)throw e("nightMode.set requires enabled and/or auto");if(r&&typeof i.enabled!="boolean")throw e("enabled must be a boolean");if(o&&typeof i.auto!="boolean")throw e("auto must be a boolean");let a={};return o&&(a.auto=i.auto),r&&(a.enabled=i.enabled),yield n.setState(a),{}})}}var _u=class n{buffers=new Map;events=new Ge;events$=this.events.asObservable();liveSignal=J([]);live=this.liveSignal.asReadonly();create(e={}){let t=this.newRouteId(),i={routeId:t,name:e.name??null,description:e.description??null,rev:1,saved:!1,dirty:!0,points:(e.points??[]).map(r=>this.clonePoint(r))};return this.buffers.set(t,i),this.refreshLive(),this.events.next({type:"visible",routeId:t,rev:i.rev,name:i.name,pointCount:i.points.length,saved:i.saved,dirty:i.dirty}),this.snapshot(i)}show(e){let t=this.buffers.get(e.routeId),i={routeId:e.routeId,name:e.name??t?.name??null,description:e.description??t?.description??null,rev:t?t.rev+1:1,saved:!0,dirty:!1,href:e.href,points:(e.points??t?.points??[]).map(r=>this.clonePoint(r))};return this.buffers.set(e.routeId,i),this.refreshLive(),this.events.next({type:"visible",routeId:i.routeId,rev:i.rev,name:i.name,pointCount:i.points.length,saved:!0,dirty:!1}),this.snapshot(i)}get(e){let t=this.buffers.get(e);return t?this.snapshot(t):void 0}has(e){return this.buffers.has(e)}hasHref(e){return this.getByHref(e)!==void 0}getByHref(e){for(let t of this.buffers.values())if(t.href===e)return this.snapshot(t)}all(){return[...this.buffers.values()].map(e=>this.snapshot(e))}list(){return[...this.buffers.values()].map(e=>({routeId:e.routeId,name:e.name,rev:e.rev,pointCount:e.points.length,saved:e.saved,dirty:e.dirty}))}delete(e,t){let i=this.buffers.get(e);if(!i)return!1;i.rev+=1;let r=t??i.saved;return this.buffers.delete(e),this.refreshLive(),this.events.next({type:"hidden",routeId:e,rev:i.rev,saved:r}),!0}markSaved(e,t,i,r){let o=this.buffers.get(e);if(o){if(!o.saved&&t===void 0)throw new Error("markSaved requires an href when saving a draft route");return o.rev+=1,o.saved=!0,o.dirty=!1,t!==void 0&&(o.href=t),i!==void 0&&(o.name=i),r!==void 0&&(o.description=r),this.refreshLive(),o.rev}}replace(e,t){let i=this.buffers.get(e);if(i)return i.points=(t??[]).map(r=>this.clonePoint(r)),i.rev+=1,i.dirty=!0,this.refreshLive(),this.events.next({type:"dirty",routeId:e,rev:i.rev,reason:"replaced"}),this.snapshot(i)}refreshLive(){this.liveSignal.set([...this.buffers.values()].map(e=>this.snapshot(e)))}refresh(){this.refreshLive()}newRouteId(){let e=globalThis.crypto;return e?.randomUUID?e.randomUUID():"rb-"+Date.now().toString(36)+"-"+Math.random().toString(36).slice(2,10)}clonePoint(e){return he(he({position:[...e.position]},e.name!==void 0?{name:e.name}:{}),e.description!==void 0?{description:e.description}:{})}snapshot(e){return yi(he({routeId:e.routeId,name:e.name,description:e.description,rev:e.rev,saved:e.saved,dirty:e.dirty},e.href!==void 0?{href:e.href}:{}),{points:e.points.map(t=>this.clonePoint(t))})}static \u0275fac=function(t){return new(t||n)};static \u0275prov=et({token:n,factory:n.\u0275fac,providedIn:"root"})};var XF="fb-plotterext-state",xre="embedding-host",Cre=1e3,wre=new Set(["eq","ne","lt","lte","gt","gte","in","contains","regex","exists"]),Sre=n=>!!n&&typeof n=="object"&&typeof n.path=="string"&&n.path.length>0&&wre.has(n.op),Mf=class n{constructor(e,t,i,r,o,a,s){this.app=e;this.signalk=t;this.dialog=i;this.skres=r;this.mapService=o;this.routeRegistry=a;this.stream=s;os()&&(window.fbPlotterExt=this),window.addEventListener("resize",()=>this.viewportTick.update(l=>l+1)),this.bridgeRouteEvents(),Te(()=>this.syncVisibleFromSelections()),Te(()=>this.emitChartChanges(this.skres.charts())),Te(()=>this.emitNightModeChange(this.readNightMode()))}manifests=J({});activeWidgets=J([]);initialized=J(!1);viewportTick=J(0);actionButtonLift=Fi(()=>{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*d_()+(t-1)*c_+6});statusBarLift=Fi(()=>{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*d_()+(t-1)*c_+4});toolbarTopOffset=Fi(()=>{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*d_()+(t-1)*c_+4});toolbarButtons=Fi(()=>{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=Fi(()=>{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=J([]);visiblePanel=Fi(()=>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=>yi(he({},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?yi(he({},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 ri("panel is required",{code:$i.INVALID_PARAMS,reason:"UNKNOWN_PANEL"});return r};return{"ui.openPanel":i=>ee(this,null,function*(){let r=t(i);if(!this.openPanel(e,r))throw new ri(`No such panel: ${r}`,{code:$i.INVALID_PARAMS,reason:"UNKNOWN_PANEL"});return{}}),"ui.togglePanel":i=>ee(this,null,function*(){let r=t(i);if(!this.togglePanel(e,r))throw new ri(`No such panel: ${r}`,{code:$i.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=J({});visibleNotes=Fi(()=>{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=Fi(()=>{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=>yi(he({},r),{[t]:yi(he({},r[t]??{}),{[e]:i})})),this.publishToExtension(e,"filters.changed",{type:t,active:!0})}clearResourceFilter(e,t){this.resourceFilters.update(i=>{let r=he({},i[t]??{});delete r[e];let o=he({},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 e.map((i,r)=>he(he({position:i},t?.[r]?.name?{name:t[r].name}:{}),t?.[r]?.description?{description:t[r].description}:{}))}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)})}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",he({routeId:e.routeId,rev:e.rev},e.reason!==void 0?{reason:e.reason}:{}));break}})}routeMethods(){return $F(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 qF({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)})}nightModeMethods(){return ZF({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=>yi(he({},r),{forceNightMode:!1}));else if(typeof e.enabled!="boolean"){let r=this.readNightMode().enabled;this.app.uiCtrl.update(o=>yi(he({},o),{forceNightMode:r}))}this.app.config.display.nightMode=t,this.app.uiConfig.update(r=>yi(he({},r),{autoNightMode:t}))}let i=e.enabled;typeof i=="boolean"&&(this.app.config.display.nightMode=!1,this.app.uiConfig.update(r=>yi(he({},r),{autoNightMode:!1})),this.app.uiCtrl.update(r=>yi(he({},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(c=>c[0]).reverse(),i=new Map(e.map(c=>[c[0],typeof c[1]?.defaultOpacity=="number"?c[1].defaultOpacity:1])),r=this.prevChartSnapshot;if(this.prevChartSnapshot={order:t,opacity:i},!r)return;let o=new Set(r.order),a=new Set(t);for(let c of t)o.has(c)||this.broadcastMessage("chart.visibility",{id:c,visible:!0});for(let c of r.order)a.has(c)||this.broadcastMessage("chart.visibility",{id:c,visible:!1});for(let[c,d]of i){let h=r.opacity.get(c);h!==void 0&&h!==d&&this.broadcastMessage("chart.opacity",{id:c,opacity:d})}let s=r.order.filter(c=>a.has(c)),l=t.filter(c=>o.has(c));s.length===l.length&&s.some((c,d)=>c!==l[d])&&this.broadcastMessage("chart.order",{order:t})}hideRoute(e){let t=this.routeRegistry.get(e);t&&(t.saved&&t.href?(this.skres.selectionRemove("routes",t.href),this.skres.refreshRoutes(),this.routeRegistry.delete(e,!0)):this.routeRegistry.delete(e,!1))}deleteRoute(e){return ee(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 ri("Failed to delete route",{reason:"routes.deleteFailed"})}this.routeRegistry.delete(e,!1)}})}showRoute(e){return ee(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 ri("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 ee(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,h=c?c[1].description??null:null;this.routeRegistry.show({routeId:e,name:d,description:h,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 ee(this,arguments,function*(e,t={}){let r=this.routeRegistry.get(e);if(!r)return null;let[,o]=this.skres.buildRoute(r.points.map(d=>d.position)),a=r.points.map(d=>he(he({},d.name?{name:d.name}:{}),d.description?{description:d.description}:{}));a.some(d=>Object.keys(d).length>0)&&(o.feature.properties.coordinatesMeta=a),o.name=t.name??r.name??"",o.description=t.description??r.description??"";let s;if(r.href)try{yield this.skres.putToServer("routes",r.href,o),s=r.href}catch(d){throw this.app.parseHttpErrorResponse(d),new ri("Failed to save route",{reason:"routes.saveFailed"})}else if(t.dialog)try{s=yield this.skres.saveNewRoute(o)}catch(d){throw new ri("Failed to save route",{reason:"routes.saveFailed"})}else try{s=(yield this.skres.postToServer("routes",o)).id,this.skres.selectionAdd("routes",s)}catch(d){throw this.app.parseHttpErrorResponse(d),new ri("Failed to save route",{reason:"routes.saveFailed"})}if(!s)return null;let l=o.name||null,c=this.routeRegistry.markSaved(e,s,l,o.description||null)??r.rev+1;return this.broadcastMessage("route.saved",{routeId:e,rev:c,href:s,name:l,saved:!0,dirty:!1}),this.app.data.editingId="",{href:s,rev:c}})}init(){return ee(this,null,function*(){try{let e=yield Ep(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=>kC.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}=l_[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=RC(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}=l_[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=PC[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=l_[e].rows,i=Array.from({length:t},(s,l)=>l),r=PC[e]==="bottom"?[...i].reverse():i,o=qI[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=RC(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 ee(this,null,function*(){let i=this.addableWidgets(e,t);if(!i.length)return;let{PlotterAddWidgetDialog:r}=yield import("./chunk-BUZHYJBN.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:sE(),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 Sf({port:wf(e.contentWindow,{origin:this.assetOrigin(r)}),hostInfo:this.hostInfo(),context:{kind:"widget",id:t.widget,instanceId:t.instanceId,targetInstance:null},methods:yi(he(he(he(he(he(he(he(he(he({},this.stateMethods(t.extension,t.instanceId)),this.signalkMethods(i)),this.unitsMethods()),this.resourcesMethods(t.extension)),this.mapMethods()),this.routeMethods()),this.chartMethods()),this.nightModeMethods()),this.uiPanelMethods(t.extension)),{"ui.openConfigPanel":()=>ee(this,null,function*(){return this.openConfigPanel(t),{}}),"ui.toggleConfigPanel":()=>ee(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 Sf({port:wf(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:yi(he(he(he(he(he(he(he(he(he({},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.uiPanelMethods(t.extension)),{"ui.closePanel":()=>ee(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 Sf({port:wf(e.contentWindow,{origin:this.assetOrigin(t.runtime.url)}),hostInfo:this.hostInfo(),context:{kind:"background",id:t.runtime.id,instanceId:null},methods:he(he(he(he(he(he(he(he(he({},this.stateMethods(t.extension,null)),this.signalkMethods(i)),this.unitsMethods()),this.resourcesMethods(t.extension)),this.mapMethods()),this.routeMethods()),this.chartMethods()),this.nightModeMethods()),this.uiPanelMethods(t.extension)),onError:r=>console.warn("plotterext background error",r)}),this.contexts.add(i),()=>this.detach(i)}attachEmbeddingHost(e=wf(window.parent,{origin:window.location.origin})){let t=xre,i={extension:t,conn:null,skSubs:new Map,skSubSeq:0};return i.conn=new Sf({port:e,hostInfo:this.hostInfo(),adoptCallerId:!0,context:{kind:"embedding-host",id:t,instanceId:null},methods:he(he(he(he(he(he(he(he(he({},this.stateMethods(t,null)),this.signalkMethods(i)),this.unitsMethods()),this.resourcesMethods(t)),this.mapMethods()),this.routeMethods()),this.chartMethods()),this.nightModeMethods()),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:kC}}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-4ORQORV3.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(XF)??"{}")}catch(e){return{}}}saveStore(e){localStorage.setItem(XF,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 ri("No widget instance in scope",{code:$i.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=>ee(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=>ee(this,null,function*(){let{scope:o,values:a}=r??{};if(!a||typeof a!="object")throw new ri("state.set requires a values object",{code:$i.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=>ee(this,null,function*(){let{type:i,query:r}=t??{};if(typeof i!="string"||!/^[A-Za-z][A-Za-z0-9_-]*$/.test(i))throw new ri("resources.list requires a resource type",{code:$i.INVALID_PARAMS,reason:"INVALID_TYPE"});let o=this.serializeQuery(r);try{return(yield Ep(this.signalk.api.get(this.app.skApiVersion,`/resources/${i}${o}`)))??{}}catch(a){throw new ri(`resources.list ${i} failed`,{reason:"LIST_FAILED",data:{message:a?.message}})}}),"resources.setFilter":t=>ee(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(Sre)))throw new ri("resources.setFilter requires a type and a filter with mode plus ids and/or match",{code:$i.INVALID_PARAMS,reason:"INVALID_FILTER"});return this.setResourceFilter(e,i,r),{}}),"resources.clearFilter":t=>ee(this,null,function*(){let{type:i}=t??{};if(typeof i!="string")throw new ri("resources.clearFilter requires a type",{code:$i.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("&")}`:""}mapMethods(){return{"map.getView":()=>ee(this,null,function*(){return{center:this.app.config.map.center,zoom:this.app.config.map.zoomLevel,bounds:this.app.mapExtent()}}),"map.center":e=>ee(this,null,function*(){let{position:t,zoom:i}=e??{};if(!Array.isArray(t)||t.length!==2||!t.every(r=>typeof r=="number"))throw new ri("map.center requires position [lon, lat]",{code:$i.INVALID_PARAMS,reason:"INVALID_POSITION"});return this.app.mapMoveRequest.set(he({center:t},typeof i=="number"?{zoom:i}:{})),{}}),"map.fitBounds":e=>ee(this,null,function*(){let{bounds:t}=e??{};if(!Array.isArray(t)||t.length!==4||!t.every(l=>typeof l=="number"))throw new ri("map.fitBounds requires bounds [minLon, minLat, maxLon, maxLat]",{code:$i.INVALID_PARAMS,reason:"INVALID_BOUNDS"});let[i,r,o,a]=t,s=[(i+o)/2,(r+a)/2];return this.app.mapMoveRequest.set({center:s,zoom:this.zoomForBounds(t)}),{}})}}zoomForBounds(e){let t=this.mapService.getMaps()[0],i=t?.getSize();if(!t||!i)return 12;let r=t.getView(),o=zn(e,"EPSG:4326","EPSG:3857"),a=[i[0]*.85,i[1]*.85],s=r.getResolutionForExtent(o,a),l=r.getZoomForResolution(s)??12,c=this.app.MAP_ZOOM_EXTENT?.max??18;return Math.min(l,c)}pulseMapResize(e=320){let t=0,i=()=>{this.mapService.updateSize(),t+=16,t<e&&requestAnimationFrame(i)};requestAnimationFrame(i)}unitsMethods(){return{"units.get":()=>ee(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=>ee(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 ri("signalk.subscribe requires an array of literal Signal K paths",{code:$i.INVALID_PARAMS,reason:"INVALID_PATHS"});let r=`sk-${++e.skSubSeq}`;return e.skSubs.set(r,i),this.acquirePaths(i),{subscriptionId:r}}),"signalk.unsubscribe":t=>ee(this,null,function*(){let{subscriptionId:i}=t??{},r=i?e.skSubs.get(i):null;if(!r)throw new ri("Unknown subscriptionId",{code:$i.INVALID_PARAMS,reason:"UNKNOWN_SUBSCRIPTION"});return e.skSubs.delete(i),this.releasePaths(r),{}}),"signalk.put":t=>ee(this,null,function*(){let{path:i,value:r}=t??{};if(typeof i!="string"||!i.length)throw new ri("signalk.put requires a path",{code:$i.INVALID_PARAMS,reason:"INVALID_PATH"});try{return(yield Ep(this.signalk.api.put(1,`vessels/self/${i.split(".").join("/")}`,r)))??{}}catch(o){throw new ri(`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:Cre,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)(ot(re),ot(Ft),ot(bn),ot(Dt),ot(Sl),ot(_u),ot(Za))};static \u0275prov=et({token:n,factory:n.\u0275fac,providedIn:"root"})};function Mre(n,e){if(n&1&&j(0,"wpt-button",1),n&2){let t=v();w("position",t.app.data.vessels.self.position)("active",t.app.data.vessels.showSelf)}}function Tre(n,e){n&1&&j(0,"pob-button")}function Ere(n,e){if(n&1&&j(0,"autopilot-button",2),n&2){let t=v();w("active",t.app.featureFlags().autopilotApi&&t.app.data.vessels.self.autopilot.default)}}function Ire(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())}),p()}if(n&2){let t=v();w("active",t.app.featureFlags().radarApi&&t.radarApi.radarId().length!==0)}}var YF=class n{action=Z();radarClick=we();app=M(re);radarApi=M(fc);plotterExt=M(Mf);bottomOffset=Fi(()=>{let e=this.plotterExt.actionButtonLift();return e>0?e:23});constructor(){}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=W({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,Mre,1,2,"wpt-button",1),R(2,Tre,1,0,"pob-button"),R(3,Ere,1,1,"autopilot-button",2),R(4,Ire,1,1,"radar-button",2),p()),t&2&&(Nt("bottom",i.bottomOffset(),"px"),g(),A(i.action()==="wpt"?1:-1),g(),A(i.action()==="pob"?2:-1),g(),A(i.action()==="autopilot"?3:-1),g(),A(i.action()==="radar"?4:-1))},dependencies:[Sx,Mx,Tx,Ex],styles:[".mfb-container[_ngcontent-%COMP%]{position:absolute;bottom:23px;right:5px;z-index:5000}"]})};function Dre(n,e){if(n&1&&(u(0,"div",4),_(1),p()),n&2){let t=v(2);g(),q(" ",t.mode.description," ")}}function kre(n,e){if(n&1&&(u(0,"li"),_(1),p()),n&2){let t=e.$implicit;g(),X(t)}}function Pre(n,e){if(n&1&&(u(0,"div",4)(1,"ol",8),Oe(2,kre,2,1,"li",null,ft),p()()),n&2){let t=v(2);g(2),Fe(t.mode.steps)}}function Rre(n,e){if(n&1){let t=H();u(0,"div",1)(1,"div")(2,"span",3)(3,"mat-icon"),_(4),p(),_(5),p(),R(6,Dre,2,1,"div",4),R(7,Pre,4,0,"div",4),p(),u(8,"div",5)(9,"a",6),T("click",function(){O(t);let r=v();return F(r.close())}),u(10,"mat-icon",7),_(11,"close"),p(),_(12),p()()()}if(n&2){let t=v();g(4),X(t.mode.iconName),g(),q(" ",t.mode.iconText," "),g(),A(t.mode.description.length!==0?6:-1),g(),A(t.mode.steps.length!==0?7:-1),g(2),w("matTooltip",t.mapInteract.isModifying()?"Finish Editing":"Cancel Operation"),g(3),q(" ",t.mapInteract.isModifying()?"FINISH":"CANCEL"," ")}}function Lre(n,e){if(n&1){let t=H();u(0,"fb-measurements",9),T("cancel",function(){O(t);let r=v();return F(r.close())}),p()}if(n&2){let t=v();w("coords",t.mapInteract.measurement().coords)("index",t.mapInteract.measurement().index)("totalOnly",t.mapInteract.isDrawing()&&t.mapInteract.draw.resourceType==="route")}}var QF=class n{cancel=we();showHelpPanel;showMeasurePanel;mode={iconName:"",iconText:"",description:"",steps:[]};app=M(re);mapInteract=M(gc);constructor(){this.showHelpPanel=Fi(()=>this.mapInteract.isDrawing()&&this.mapInteract.draw.resourceType!=="route"||this.mapInteract.isModifying()||this.mapInteract.isBoxSelecting()||this.mapInteract.isMeasuring()&&this.mapInteract.measureGeometryType==="Circle"),this.showMeasurePanel=Fi(()=>this.mapInteract.isMeasuring()&&this.mapInteract.measureGeometryType==="LineString"||this.mapInteract.draw.resourceType==="route"&&(this.mapInteract.isDrawing()||this.mapInteract.isModifying())),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 Tap-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()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=W({type:n,selectors:[["fb-interact-help"]],outputs:{cancel:"cancel"},decls:3,vars:2,consts:[[1,"mat-app-background","_ap_interact_help"],[1,"mat-app-background","measurePanel"],["matTooltip","Click on the Map to start. Click cancel or the last point to end.",3,"coords","index","totalOnly"],[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"],[1,"icon-warn"],[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","totalOnly"]],template:function(t,i){t&1&&(u(0,"div",0),R(1,Rre,13,6,"div",1),R(2,Lre,1,3,"fb-measurements",2),p()),t&2&&(g(),A(i.showHelpPanel()?1:-1),g(),A(i.showMeasurePanel()?2:-1))},dependencies:[ae,le,ue,Ze,Ie,It,Cx],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_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 Dt=class n{reOpen;app=M(re);dialog=M(bn);signalk=M(Ft);worker=M(Hn);mapInteract=M(gc);constructor(){this.worker.resource$().subscribe(e=>this.processResourceMessage(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 ee(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];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()}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=J([]);charts=this.chartCacheSignal.asReadonly();appendOSM(e){let t=[["openstreetmap",new tl({name:"World Map",description:"Open Street Map"}),this.app&&this.selectionIsFiltered("charts")?this.app.config.selections.charts.includes("openstreetmap"):!0],["openseamap",new tl({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)}),e.push(t[1]),e.unshift(t[0]),e}refreshCharts(e){return ee(this,null,function*(){e&&e[0]!=="?"&&(e="?"+e),this.app.debug(`** refreshCharts(): ${e}`);try{let t=yield this.listFromServer("charts",e);this.appendOSM(t);let i=t.filter(r=>r[2]);i=this.sortByScaleDesc(i),i=this.arrangeChartLayers(i),this.chartCacheSignal.set(i),this.setMapZoomRange()}catch(t){this.app.debug("** refreshCharts:",t);let i=this.appendOSM([]);this.chartCacheSignal.set(i),this.setMapZoomRange()}})}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),typeof this.app.config.selections.chartOpacity[t]<"u"&&(e.defaultOpacity=this.app.config.selections.chartOpacity[t]);let i=this.app.config.selections.chartImageAdjustment?.[t];return typeof i<"u"&&(e.imageAdjustment=i),new tl(e)}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?
1074
1074
  `,"Delete Chart:","YES","NO").subscribe(t=>{t&&t.ok&&this.deleteFromServer("charts",e,"resources-provider").catch(i=>this.app.parseHttpErrorResponse(i))})}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])});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&&Js(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 tl(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 tl(o[1]);return a.imageAdjustment=t,[o[0],a,o[2]]}))}openImageAdjustment(e){let t=e[0],i=he({brightness:1,contrast:1},this.app.config.selections.chartImageAdjustment[t]??e[1]?.imageAdjustment);this.dialog.open(hx,{hasBackdrop:!1,disableClose:!0,autoFocus:!1,restoreFocus:!1,position:{top:"70px",left:"8px"},width:"290px",data:{text:e[1]?.name??"",value:he({},i),position:this.app.config.imageAdjustPalettePos,onChange:r=>{this.chartSetImageAdjustment(t,r)},onMoved:r=>{this.app.config.imageAdjustPalettePos=r,this.app.saveConfig()}}}).afterClosed().subscribe(r=>{r?.apply?(this.app.config.selections.chartImageAdjustment[t]=r.value,this.chartSetImageAdjustment(t,r.value),this.app.saveConfig()):this.chartSetImageAdjustment(t,i)})}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 ee(this,null,function*(){let e;try{e=this.appendOSM(yield this.listFromServer("charts"))}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 ee(this,null,function*(){if(!Array.isArray(e)||e.length===0)return;let i;try{i=this.appendOSM(yield this.listFromServer("charts"))}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(P1,{disableClose:!0,data:e}).afterClosed().subscribe(t=>ee(this,null,function*(){if(t.save)try{let i=yield this.postToServer("charts",t.chart);this.selectionAdd("charts",i.id)}catch(i){this.app.parseHttpErrorResponse(i)}}))}editChartInfo(e){return ee(this,null,function*(){if(!e)return;let t;if(["openseamap","openstreetmap"].includes(e))t=new tl({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.fromServer("charts",e),this.app.sIsFetching.set(!1)}catch(i){this.app.sIsFetching.set(!1),this.app.parseHttpErrorResponse(i);return}this.dialog.open(P1,{disableClose:!0,data:t}).afterClosed().subscribe(i=>{i.save&&this.putToServer("charts",e,i.chart).catch(r=>this.app.parseHttpErrorResponse(r))})})}seedChartCache(e,t){return ee(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(bx,{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:a=>{this.app.showAlert("Chart Cache","Tile cache seed job created successfully.")},error:a=>{this.app.parseHttpErrorResponse(a)}})}})})}routeCacheSignal=J([]);routes=this.routeCacheSignal.asReadonly();refreshRoutes(e){return ee(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 vs(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"),[]))}buildRoute(e){let t=new vs,i=this.signalk.uuid;return t.feature.geometry.coordinates=di.normaliseCoords(e),t.distance=di.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(Ef,{disableClose:!0,data:{title:"New Route",route:e}}).afterClosed().subscribe(t=>ee(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(Ef,{disableClose:!0,data:{title:"Route Details",route:e}}).afterClosed().subscribe(r=>ee(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 ee(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(Ef,{disableClose:!0,data:{title:"Route Details",addMode:!1,route:t}}).afterClosed().subscribe(i=>{i.save&&this.putToServer("routes",e,i.route).catch(r=>this.app.parseHttpErrorResponse(r))})})}deleteRoute(e){return ee(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?
1075
1075
  `,"Delete Route:","YES","NO",i).subscribe(o=>ee(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=di.normaliseCoords(t),o.distance=di.routeLength(o.feature.geometry.coordinates),i&&(o.feature.properties.coordinatesMeta=i),this.putToServer("routes",e,o).then(()=>!0).catch(a=>(this.app.parseHttpErrorResponse(a),!1))}waypointCacheSignal=J([]);waypoints=this.waypointCacheSignal.asReadonly();refreshWaypoints(e){return ee(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 vd(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 vd,i=this.signalk.uuid;return t.feature.geometry.coordinates=di.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(R1,{disableClose:!0,data:{title:"New Waypoint",waypoint:e}}).afterClosed().subscribe(t=>ee(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 ee(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(R1,{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 ee(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?
1076
1076
  `,"Delete Waypoint:","YES","NO",i).subscribe(r=>ee(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=di.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=J([]);regions=this.regionCacheSignal.asReadonly();refreshRegions(e){return ee(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=pE.default.decode_bbox(e.geohash),r=new xd;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 xd(e)}newRegion(e){e&&this.dialog.open(k1,{disableClose:!0,data:{region:e}}).afterClosed().subscribe(t=>ee(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 ee(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(k1,{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 ee(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?
@@ -3869,7 +3869,7 @@ Do you want to create a new group?`,"Group").pipe(jt(this.destroyRef)).subscribe
3869
3869
  (${s.error.statusCode}: ${s.error.message})`):(this.app.showAlert("Add Overlay","Overlay sources added successfully."),this.initItems())})}})}static \u0275fac=function(i){return new(i||n)(Q(re),Q(Dt),Q(bu),Q(bn),Q(Ft))};static \u0275cmp=W({type:n,selectors:[["infolayer-list"]],outputs:{closed:"closed",paramChanged:"paramChanged"},features:[Qe],decls:41,vars:7,consts:[["addlayermenu","matMenu"],["ftext",""],["selall",""],["timeValue",""],["timeLabel",""],[1,"resourcelist"],["mat-menu-item","",3,"click"],[2,"border-radius","unset"],[1,"title-block"],[2,"width","50px"],["mat-icon-button","","matTooltip","Close InfoLayer 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,"keyup","value"],["matSuffix","","mat-icon-button",""],["mat-icon-button","","matTooltip","Reload Layers","matTooltipPosition","below",3,"click"],["matTooltipPosition","below",3,"change","checked","indeterminate","matTooltip"],["mat-icon-button","","matTooltip","Add Layer","matTooltipPosition","above",3,"matMenuTriggerFor"],[1,"resources","infolayers"],["mode","query"],["itemSize","48",1,"vscroller"],["matSuffix","","mat-icon-button","",3,"click"],["style","border-bottom: silver 1px outset; border-radius: unset",4,"cdkVirtualFor","cdkVirtualForOf"],[2,"border-bottom","silver 1px outset","border-radius","unset"],[2,"flex","1 1 auto","text-align","left","overflow","hidden","text-overflow","ellipsis","display","-webkit-box","-webkit-box-orient","vertical","-webkit-line-clamp","2","line-clamp","2","width","245px"],[2,"text-align","right"],["matTooltip","Show layer","matTooltipPosition","left",3,"change","checked"],[2,"flex","auto"],[2,"flex","1 1 auto"],[2,"width","120px"],["matTooltip","Set refresh interval","matTooltipPosition","above",3,"ngModelChange","selectionChange","ngModel"],[3,"value"],[2,"width","105px"],["matTooltip","Set layer opacity","matTooltipPosition","above",3,"ngModelChange","selectionChange","ngModel"],[2,"flex","2"],["mat-icon-button","","matTooltip","Delete Layer","matTooltipPosition","above",3,"click"],[1,"icon-warn"],[2,"flex","2","text-align","right","padding-right","10px"],["mat-icon-button","","matTooltip","Layer Properties","matTooltipPosition","above",3,"click"],["min","0","matTooltip","Set opacity","matTooltipPosition","below",2,"flex","2",3,"disabled","max"],["matSliderThumb","",3,"valueChange"]],template:function(i,r){if(i&1){let o=H();u(0,"div",5)(1,"mat-menu",null,0)(3,"button",6),T("click",function(){return r.addLayer("wmts")}),_(4,"WMTS"),p(),u(5,"button",6),T("click",function(){return r.addLayer("wms")}),_(6,"WMS"),p()(),u(7,"mat-card",7)(8,"mat-card-title")(9,"div",8)(10,"div",9)(11,"button",10),T("click",function(){return r.close()}),u(12,"mat-icon"),_(13,"arrow_back"),p()()(),u(14,"div",11),_(15,"Overlays"),p()()(),u(16,"mat-card-content")(17,"div",12)(18,"div",13)(19,"mat-form-field",14)(20,"mat-label"),_(21,"Type to filter list"),p(),u(22,"input",15,1),T("keyup",function(){O(o);let s=Le(23);return F(r.filterKeyUp(s.value))}),p(),R(24,nue,3,0,"button",16),p()(),u(25,"div")(26,"button",17),T("click",function(){return r.initItems()}),u(27,"mat-icon"),_(28,"refresh"),p()()(),u(29,"div")(30,"mat-checkbox",18,2),T("change",function(s){return r.toggleAll(s.checked)}),p()()()(),u(32,"mat-card-actions")(33,"button",19)(34,"mat-icon"),_(35,"add"),p()(),u(36,"small"),_(37,"Map layers containing dynamic information to overlay on charts."),p()()(),u(38,"div",20),R(39,rue,1,0,"mat-progress-bar",21)(40,cue,2,1,"cdk-virtual-scroll-viewport",22),p()()}if(i&2){let o=Le(2),a=Le(31);g(22),w("value",r.filterText),g(2),A(r.filterText?24:-1),g(6),w("checked",r.allSel)("indeterminate",r.someSel)("matTooltip",!a.checked||r.someSel?"Select All":"Deselect All"),g(3),w("matMenuTriggerFor",o),g(6),A(r.app.sIsFetching()?39:40)}},dependencies:[ve,Ie,ae,le,qe,Tt,Vn,Ot,Bn,Ci,qi,ue,Ne,Mt,Qi,Ji,Et,Jt,Wt,zt,Is,Gn,co,ao,lo,so,Ds,Gl,Vl,Tn,nl,la,wa,Qa,Rs,Ps,ss],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.infolayers[_ngcontent-%COMP%], .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}"],changeDetection:0})};var Hx=class n{icon;app=M(re);dialogRef=M(ui);data=M(pi);constructor(){}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=W({type:n,selectors:[["ap-infolayerproperties"]],decls:51,vars:7,consts:[[1,"_ap-infolayer"],[2,"background-color","transparent"],[1,"dialog-icon"],[2,"flex","1 1 auto","text-align","center"],[2,"text-align","right"],["mat-icon-button","",3,"click"],[2,"display","flex","flex-direction","column"],[2,"display","flex"],[1,"key-label"],[2,"flex","1 1 auto"],[2,"flex","1 1 auto","overflow-x","auto"]],template:function(t,i){t&1&&(u(0,"div",0)(1,"mat-toolbar",1)(2,"span",2)(3,"mat-icon"),_(4,"layers"),p()(),u(5,"span",3),_(6,"Overlay Properties"),p(),u(7,"span",4)(8,"button",5),T("click",function(){return i.dialogRef.close()}),u(9,"mat-icon"),_(10,"close"),p()()()(),u(11,"mat-dialog-content")(12,"div",6)(13,"div",7)(14,"div",8),_(15,"Name:"),p(),u(16,"div",9),_(17),p()(),u(18,"div",7)(19,"div",8),_(20,"Description:"),p(),u(21,"div",9),_(22),p()(),u(23,"div",7)(24,"div",8),_(25,"Type:"),p(),u(26,"div",9),_(27),p()(),u(28,"div",7)(29,"div",8),_(30,"Zoom:"),p(),u(31,"div",9)(32,"div",9)(33,"u")(34,"i"),_(35,"Min: "),p()(),_(36),u(37,"u")(38,"i"),_(39,"Max: "),p()(),_(40),p()()(),u(41,"div",7)(42,"div",8),_(43,"Layers:"),p(),u(44,"div",9),_(45),p()(),u(46,"div",7)(47,"div",8),_(48,"URL:"),p(),u(49,"div",10),_(50),p()()()()()),t&2&&(g(17),X(i.data.name),g(5),X(i.data.description),g(5),q(" ",i.data.values.sourceType," "),g(9),q(" ",i.data.values.minZoom,", "),g(4),q(" ",i.data.values.maxZoom," "),g(5),X(i.data.values.layers),g(5),q(" ",i.data.values.url," "))},dependencies:[ve,ae,le,qe,ue,Ne,It,kt,mi,hi],styles:["._ap-infolayer[_ngcontent-%COMP%]{font-family:arial;min-width:300px}.ap-confirm-icon[_ngcontent-%COMP%]{min-width:35px;max-width:35px;color:#ff8c00;text-align:left}._ap-infolayer[_ngcontent-%COMP%] .key-label[_ngcontent-%COMP%]{width:150px;font-weight:500}@media only screen and (min-device-width:768px)and (max-device-width:1024px),only screen and (min-width:800px){.ap-confirm-icon[_ngcontent-%COMP%]{min-width:25%;max-width:25%}}"]})};var sB=(n,e)=>e.ms;function due(n,e){if(n&1){let t=H();u(0,"div",8),_(1," WIND (SIGNAL K WEATHER API) "),p(),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 "),p()()}if(n&2){let t=v();g(3),w("checked",t.app.config.selections.weatherWindEnabled)}}function uue(n,e){if(n&1&&j(0,"div",32),n&2){let t=e.$implicit,i=v(3);Nt("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 pue(n,e){if(n&1&&(u(0,"span",35),_(1),p()),n&2){let t=v().$implicit,i=v(3);Nt("color",i.app.uiConfig().invertColor?"#7fa8cf":"#4a6a8a"),g(),X(t.label)}}function hue(n,e){if(n&1&&(u(0,"div",33),R(1,pue,2,3,"span",34),p()),n&2){let t=e.$implicit;Nt("left",t.pct,"%"),g(),A(t.label?1:-1)}}function mue(n,e){if(n&1&&j(0,"div",36),n&2){let t=v(3);Nt("left",t.nowTickPct(),"%")("border-left","1px dashed "+(t.app.uiConfig().invertColor?"rgba(255,255,255,0.45)":"rgba(0,0,0,0.4)"))}}function fue(n,e){if(n&1){let t=H();u(0,"div",13)(1,"div",14,0),T("pointerdown",function(r){O(t);let o=Le(2),a=v(2);return F(a.onBarPointerDown(r,o))}),u(3,"div",15),j(4,"div",16),Oe(5,uue,1,4,"div",17,sB),Oe(7,hue,2,3,"div",18,sB),p(),R(9,mue,1,4,"div",19),j(10,"div",20),u(11,"div",21),_(12),p()(),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"),p()(),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"),p()(),u(20,"button",26),T("click",function(){O(t);let r=v(2);return F(r.currents.togglePlay())}),u(21,"mat-icon",27),_(22),p()(),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"),p()(),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"),p()(),j(29,"span",30),u(30,"button",31),T("click",function(){O(t);let r=v(2);return F(r.currents.resetToNow())}),_(31," Now "),p()()()}if(n&2){let t=v(2);g(3),Nt("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)"),g(),Nt("background",t.currents.barBgGradient()),g(),Fe(t.currents.hourTicks()),g(2),Fe(t.currents.hourLabels()),g(2),A(t.nowTickPct()!=null?9:-1),g(3),q(" ",t.fmtScrubTime()," "),g(8),w("matTooltip",t.currents.isPlaying()?"Pause":"Play"),g(2),X(t.currents.isPlaying()?"pause":"play_arrow")}}function gue(n,e){if(n&1){let t=H();j(0,"div",7),u(1,"div",8),_(2," TIDAL CURRENTS (SIGNALK PLUGIN) "),p(),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 "),p()(),R(6,fue,32,10,"div",13)}if(n&2){let t=v();g(4),w("checked",t.app.config.selections.tidalCurrentsEnabled),g(2),A(t.app.config.selections.tidalCurrentsEnabled?6:-1)}}var lB=class n{closed=we();app=M(re);currents=M(gd);ngZone=M(zi);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=h=>String(h).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=W({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"),p()()(),u(8,"div",6),_(9,"Weather"),p()()(),u(10,"mat-card-content"),R(11,due,5,1),j(12,"div",7),u(13,"div",8),_(14," OCEAN CURRENTS (OPEN-METEO) "),p(),u(15,"div",9)(16,"mat-checkbox",10),T("change",function(o){return i.toggleOceanCurrents(o.checked)}),_(17," Enable ocean currents layer "),p()(),R(18,gue,7,2),p()()()),t&2&&(g(11),A(i.app.featureFlags().weatherApi?11:-1),g(5),w("checked",i.app.config.selections.oceanCurrentsEnabled),g(2),A(i.app.featureFlags().tidalApi?18:-1))},dependencies:[ve,Ie,ae,le,qe,Tt,Ot,Bn,Ci,qi,ue,Ze,Ne,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.infolayers[_ngcontent-%COMP%], .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}"],changeDetection:0})};function _ue(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"),p(),_(5," Acknowledge "),p()()()}}function yue(n,e){if(n&1&&j(0,"signalk-details-list",11),n&2){let t=v(2);w("details",t.properties)}}function vue(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),p(),u(3,"mat-icon"),_(4),p()(),R(5,yue,1,1,"signalk-details-list",11)}if(n&2){let t=v();g(2),q("Show ",t.showProperties?"Less":"More"),g(2),X(t.showProperties?"keyboard_arrow_down":"keyboard_arrow_right"),g(),A(t.showProperties?5:-1)}}var Kx=class n{constructor(e){this.data=e}showProperties=!0;hasProperties=!1;properties;raisedAt;notiMgr=M(il);modalRef=M(fr);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)(Q(qr))};static \u0275cmp=W({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),p()(),u(5,"span",3),_(6," Alert Information "),p(),u(7,"span")(8,"button",4),T("click",function(){return i.modalRef.dismiss()}),u(9,"mat-icon"),_(10,"keyboard_arrow_down"),p()()()(),u(11,"mat-card")(12,"mat-card-content")(13,"div",5),R(14,_ue,6,0,"div",6),u(15,"div",6)(16,"div",7),_(17,"Message:"),p(),u(18,"div",8),_(19),p()(),u(20,"div",6)(21,"div",7),_(22,"Type:"),p(),u(23,"div",8),_(24),p()(),u(25,"div",6)(26,"div",7),_(27,"Priority:"),p(),u(28,"div",8),_(29),p()(),u(30,"div",6)(31,"div",7),_(32,"Raised at:"),p(),u(33,"div",8),_(34),p()(),R(35,vue,6,3),p()()()()),t&2&&(g(3),Pt(i.data.alert.icon.class),w("svgIcon",i.data.alert.icon.svgIcon),g(),q(" ",i.data.alert.icon.name),g(10),A(i.data.alert.canAcknowledge&&!i.data.alert.acknowledged?14:-1),g(5),X(i.data.alert.message),g(5),X(i.data.alert.type),g(5),X(i.data.alert.priority),g(5),X(i.raisedAt),g(),A(i.hasProperties?35:-1))},dependencies:[ve,Ie,ae,le,qe,Tt,Ot,ue,Ze,Ne,It,kt,yd],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 il=class n{alertMap;alertsSignal=J([]);alerts=this.alertsSignal.asReadonly();mobSignal=J([]);mobAlerts=this.mobSignal.asReadonly();app=M(re);worker=M(Hn);signalk=M(Ft);bottomSheet=M(Lu);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).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.alertMap.delete(e.path),this.emitSignals());return}let i;if(this.app.featureFlags().notificationApi){let r=e.value;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=Fv(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(Kx,{data:{alert:this.getAlert(e)}}).afterDismissed().subscribe(t=>{})}acknowledge(e){if(this.alertMap.has(e)&&this.app.featureFlags().notificationApi){let t=this.alertMap.get(e);this.signalk.api.post(this.app.skApiVersion,`notifications/${t.id}/acknowledge`,{}).subscribe(()=>{this.app.debug(`Acknowledged ${t.id}, ${e}`)},i=>{this.app.parseHttpErrorResponse(i)})}}silence(e){if(this.alertMap.has(e)){let t=this.alertMap.get(e);this.app.featureFlags().notificationApi&&this.signalk.api.post(this.app.skApiVersion,`notifications/${t.id}/silence`,{}).subscribe(()=>{this.app.debug(`Silenced ${t.id}, ${e}`)},i=>{this.app.parseHttpErrorResponse(i)})}}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=et({token:n,factory:n.\u0275fac,providedIn:"root"})};var bue=()=>["emergency","alarm"],xue=(n,e,t)=>({"blink-text":n,"red-text":e,"amber-text":t}),Cue=(n,e)=>e[0];function wue(n,e){if(n&1&&(u(0,"div")(1,"button",16)(2,"mat-icon"),_(3,"warning"),p(),_(4," Raise "),p()()),n&2){v();let t=Le(1);g(),w("matMenuTriggerFor",t)}}function Sue(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))}),j(1,"mat-icon",18),p(),_(2," \xA0 ")}if(n&2){let t=v().$implicit;w("matTooltip",t[1].silenced?"Silenced":"Silence")("disabled",t[1].acknowledged||t[1].silenced),g(),Pt(t[1].acknowledged?"":"ob"),w("svgIcon",t[1].silenced?"sound-off-fill":"sound-high-fill")}}function Mue(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"),p()()}if(n&2){let t=v(2).$implicit;w("disabled",t[1].acknowledged)}}function Tue(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"),p()()}if(n&2){let t=v(3).$implicit;w("disabled",!t[1].acknowledged)}}function Eue(n,e){if(n&1&&R(0,Tue,3,1,"button",24),n&2){let t=v(2).$implicit;A(t[1].canCancel?0:-1)}}function Iue(n,e){if(n&1&&R(0,Mue,3,1,"button",22)(1,Eue,1,1),n&2){let t=v().$implicit;A(t[1].acknowledged?1:0)}}function Due(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),p()(),u(4,"div",19),T("click",function(){let r=O(t).$implicit,o=v();return F(o.notiMgr.showAlertInfo(r[1].path))}),_(5),p(),u(6,"div",20),R(7,Sue,3,5),R(8,Iue,2,1),p()()}if(n&2){let t=e.$implicit,i=v();g(2),Pt(t[1].icon.class),w("svgIcon",t[1].icon.svgIcon),g(),X(t[1].icon.name),g(),w("ngClass",W1(9,xue,t[1].canAcknowledge&&!t[1].acknowledged,Eo(8,bue).includes(t[1].priority),t[1].priority==="alert")),g(),q(" ",t[1].message," "),g(2),A(i.app.featureFlags().notificationApi&&t[1].sound&&t[1].canSilence?7:-1),g(),A(i.app.featureFlags().notificationApi&&t[1].canAcknowledge?8:-1)}}var cB=class n{alerts=Z([]);closed=new pe;app=M(re);notiMgr=M(il);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 Fv(e).svgIcon}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=W({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")}),j(3,"mat-icon",2),_(4," \xA0Overboard! "),p()(),u(5,"mat-card",3)(6,"div",4)(7,"div",5),R(8,wue,5,1,"div"),u(9,"div",6),_(10," Alert List "),p(),u(11,"div",7)(12,"button",8),T("click",function(){return i.silenceAll()}),j(13,"mat-icon",9),p(),_(14," \xA0 \xA0 "),u(15,"div")(16,"mat-slide-toggle",10),T("toggleChange",function(){return i.togglePlaySound()}),p()(),_(17," \xA0 "),u(18,"button",11),T("click",function(){return i.handleClose()}),u(19,"mat-icon"),_(20,"close"),p()()()(),u(21,"div",12)(22,"div",13)(23,"div",14),Oe(24,Due,9,13,"div",15,Cue),p()()()()()),t&2&&(g(8),A(i.app.featureFlags().notificationApi?8:-1),g(8),w("checked",!i.app.config.display.muteSound),g(8),Fe(i.alerts()))},dependencies:[ve,Ie,hn,Fn,ue,Ze,Ne,qe,Tt,ae,le,nl,la,wa,Qa,aa,Go,Mt,el],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 kue(n,e){if(n&1&&(u(0,"mat-icon"),_(1),p()),n&2){let t=v(2);g(),X(t.icon)}}function Pue(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,kue,2,1,"mat-icon"),_(3),p()}if(n&2){let t=v();g(2),A(t.icon?2:-1),g(),q(" ",t.cancelledLabel," ")}}function Rue(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),p()}if(n&2){let t=v();w("disabled",t.disabled),g(),Uo(" ",t.label," ",t.timeLeft()," secs ")}}var $x=class n{period=5e3;label;icon;cancelledLabel;disabled;nextPoint=new pe;timer;timeLeft=J(this.period??5);cancelled=J(!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),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=W({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,Pue,4,2)(2,Rue,2,3,"button",0),p()),t&2&&(g(),A(i.cancelled()?1:2))},dependencies:[ue,Ze,ae,le],encapsulation:2,changeDetection:0})};function Lue(n,e){n&1&&j(0,"span")}function Aue(n,e){if(n&1&&j(0,"mat-progress-bar",0),n&2){let t=v(3);w("value",t.progressValue())}}function Oue(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())}),j(2,"mat-icon",10),_(3),p()()}if(n&2){let t=v(3);g(),w("disabled",t.alert().silenced),g(),w("svgIcon",t.alert().silenced?"sound-off-fill":"sound-unavailable-fill"),g(),q(" ",t.alert().silenced?"MUTED":"MUTE"," ")}}function Fue(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"),p(),_(4," ACK "),p()()}}function Nue(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"),p(),_(3," Dismiss "),p()}}function Bue(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())}),p()}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 Vue(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())}),p()}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 Gue(n,e){if(n&1&&(u(0,"div"),R(1,Bue,1,5,"timer-button",13)(2,Vue,1,5,"timer-button",13),p()),n&2){v();let t=Du(0);g(),A(t?1:2)}}function jue(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"),p(),_(3," END ROUTE "),p()}if(n&2){let t=v(5);w("disabled",t.nextPointClicked)}}function zue(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"),p(),_(3," NEXT POINT "),p()}if(n&2){let t=v(5);w("disabled",t.nextPointClicked)}}function Wue(n,e){if(n&1&&R(0,jue,4,1,"button",15)(1,zue,4,1,"button",15),n&2){v();let t=Du(0);A(t?0:1)}}function Uue(n,e){if(n&1&&(j1(0),u(1,"div"),R(2,Gue,3,1,"div")(3,Wue,2,1),p()),n&2){let t=v(3);z1(t.course.courseData().pointIndex===t.course.courseData().pointTotal-1),g(2),A(t.app.config.course.autoNextPointOnArrival&&t.app.config.course.autoNextPointTrigger===t.alert().type?2:t.showStaticNextPoint?3:-1)}}function Hue(n,e){if(n&1&&(u(0,"div"),R(1,Aue,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),p()(),u(8,"div",5),_(9),p()()(),u(10,"mat-card-actions")(11,"div",6),R(12,Oue,4,3,"div",7),R(13,Fue,5,0,"div")(14,Nue,4,0,"button",8),R(15,Uue,4,2,"div"),p()()()()),n&2){let t=v(2);g(),A(t.alert().canAcknowledge?-1:1),g(5),Pt(t.alert().icon.class),w("svgIcon",t.alert().icon.svgIcon),g(),X(t.alert().icon.name),g(2),q(" ",t.alert().message," "),g(3),A(t.alert().sound&&t.alert().canSilence?12:-1),g(),A(t.alert().canAcknowledge?13:14),g(2),A(t.app.data.activeRoute?15:-1)}}function Kue(n,e){if(n&1&&R(0,Hue,16,9,"div"),n&2){let t=v();A(t.alert().visual&&!t.alert().acknowledged?0:-1)}}var dB={emergency:"./assets/sound/woop.mp3",alarm:"./assets/sound/woop.mp3",alert:"./assets/sound/ding.mp3",warn:"./assets/sound/ding.mp3"},uB=class n{alert=Z();acknowledged=Z(!1);silenced=Z(!1);audioStatus=Z();doNotPlaySound=Z(!1);hidden=J(!1);progressValue=J(100);nextPoint=new pe;routeEnd=new pe;showStaticNextPoint=!1;showAutoNextPoint=!1;nextPointClicked=!1;audio;source;soundFile=dB.warn;timerRef;app=M(re);notiMgr=M(il);course=M(Mo);ngZone=M(zi);constructor(){Te(()=>{let e=this.acknowledged(),t=this.silenced(),i=this.alert();this.showStaticNextPoint=["perpendicularPassed","arrivalCircleEntered"].includes(i.type),this.showAutoNextPoint=this.showStaticNextPoint&&this.app.config.course.autoNextPointTrigger===i.type,typeof this.doNotPlaySound()<"u",this.processAudio(),!this.timerRef&&!["emergency","alarm"].includes(this.alert().priority)&&!this.showAutoNextPoint&&this.ngZone.runOutsideAngular(()=>{this.timerRef=setInterval(()=>{this.progressValue()>0?this.progressValue.update(r=>r-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=dB[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=W({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,Lue,1,0,"span")(1,Kue,1,1),t&2&&A(i.app.uiCtrl().alertList||i.hidden()?0:1)},dependencies:[ae,le,ue,Ze,qe,Tt,Vn,Ot,Sr,Tn,$x],encapsulation:2,changeDetection:0})};var qx=class n{disabled;direction=new pe;constructor(){}action(e){this.direction.emit(e)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=W({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),j(2,"div",2),u(3,"div",2)(4,"button",3),T("click",function(){return i.action(0)}),u(5,"mat-icon"),_(6,"arrow_upward"),p()()(),j(7,"div",2),p(),u(8,"div",1)(9,"div",2)(10,"button",3),T("click",function(){return i.action(270)}),u(11,"mat-icon"),_(12,"arrow_back"),p()()(),j(13,"div",2),u(14,"div",2)(15,"button",3),T("click",function(){return i.action(90)}),u(16,"mat-icon"),_(17,"arrow_forward"),p()()()(),u(18,"div",1),j(19,"div",2),u(20,"div",2)(21,"button",3),T("click",function(){return i.action(180)}),u(22,"mat-icon"),_(23,"arrow_downward"),p()()(),j(24,"div",2),p()()),t&2&&(g(4),w("disabled",i.disabled),g(6),w("disabled",i.disabled),g(5),w("disabled",i.disabled),g(6),w("disabled",i.disabled))},dependencies:[ue,Ms,ae,le],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 hB=ts(Ml());var Of=class n{constructor(e,t,i){this.app=e;this.signalk=t;this.stream=i;Te(()=>{this.stream.selfAnchor()&&this.parseAnchorStatus(this.stream.selfAnchor())})}raisedSignal=J(!0);raised=this.raisedSignal.asReadonly();positionSignal=J(null);position=this.positionSignal.asReadonly();radiusSignal=J(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)(ot(re),ot(Ft),ot(Za))};static \u0275prov=et({token:n,factory:n.\u0275fac,providedIn:"root"})};var $ue=["slideCtl"];function que(n,e){n&1&&(u(0,"mat-error"),_(1,"Value must be greater than 0."),p())}function Zue(n,e){n&1&&(u(0,"mat-error"),_(1,"Value must be greater than 0."),p())}function Xue(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"),p(),_(8,"."),p(),u(9,"div")(10,"button",22),T("click",function(){O(t);let r=v();return F(r.stepSetRode())}),_(11," Set "),p()()(),u(12,"mat-step",23)(13,"div")(14,"div"),j(15,"br"),u(16,"b"),_(17,"Adjust Radius:"),p()(),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))}),p()()(),u(22,"div",27),_(23),p()()(),u(24,"div")(25,"div"),j(26,"br"),u(27,"b"),_(28,"Shift Anchor:"),p()(),u(29,"nsew-buttons",28),T("direction",function(r){O(t);let o=v();return F(o.shiftAnchor(r))}),p(),u(30,"div",29),_(31," Click on anchor to enable drag. "),p()()()()()}if(n&2){let t=v();g(),w("linear",!0)("selectedIndex",t.rodeOut?1:0),g(2),w("label",t.rodeOut?"Anchor Set":"Let out rode"),g(17),w("disabled",t.disableRaiseDrop)("displayWith",t.formatSliderLabel)("min",t.min)("max",t.max),g(),w("value",t.sliderValue),g(2),q(" ",t.displayRadius()," ")}}var pB=class n{radius;min=5;max=250;raised=!0;showSelf=!1;closed=new pe;slideCtl;bgImage;sliderValue;rodeOut=!1;convert=We;useDefaultRadius;useSetManual;defaultRodeLength=J(10);defaultAlarmRadius=J(10);disableRaiseDrop;anchor=M(Of);app=M(re);signalk=M(Ft);destroyRef=M(Ai);radiusValue=J(0);formattedRadiusValue=Fi(()=>!Number.isFinite(this.radiusValue())||this.raised?"--":`${Math.round(this.radiusValue())}${We.getSymbol(this.app.config.units.length)}`);displayRadius=J("--");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 We.transform(e,"m",this.app.config.units.length)}formatTransformedValue(e){return`${Math.round(this.transformValue(e))} ${We.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(We.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(jt(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(We.transform(this.defaultRodeLength(),this.app.config.units.length,"m")),this.signalk.post("/plugins/anchoralarm/setManualAnchor",{rodeLength:this.app.config.anchor.rodeLength}).pipe(jt(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(jt(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(jt(this.destroyRef)).subscribe({next:()=>{},error:e=>{this.app.parseHttpErrorResponse(e)}})}shiftAnchor(e){let i=(0,hB.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=W({type:n,selectors:[["anchor-watch"]],viewQuery:function(t,i){if(t&1&&Ht($ue,7),t&2){let r;De(r=ke())&&(i.slideCtl=r.first)}},inputs:{radius:"radius",min:"min",max:"max",raised:"raised",showSelf:"showSelf"},outputs:{closed:"closed"},features:[Me],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"),p()()(),u(8,"div",10),_(9,"Anchor Watch"),p()()(),u(10,"mat-card-content")(11,"div")(12,"b"),_(13,"Status:"),p()(),u(14,"div",11)(15,"b",12),_(16),p()()(),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)}),p(),_(23," DROP "),p(),u(24,"div")(25,"div",15)(26,"mat-checkbox",16,1),T("change",function(a){return i.onDefaultRadiusChecked(a)}),_(28,"Set Radius "),p()(),u(29,"div")(30,"mat-form-field",17)(31,"mat-label"),_(32),p(),u(33,"input",18,2),T("ngModelChange",function(a){return i.onDefaultRadiusChange(a)}),p(),R(35,que,2,0,"mat-error"),p()()(),u(36,"div")(37,"div")(38,"mat-checkbox",16,3),T("change",function(a){return i.onSetManualCheck(a)}),p()(),u(40,"div",15)(41,"button",19),T("click",function(){return i.setManualAnchor()}),_(42," Manual Set "),p()(),u(43,"div")(44,"mat-form-field",17)(45,"mat-label"),_(46),p(),u(47,"input",18,4),xt("ngModelChange",function(a){return O(r),bt(i.defaultRodeLength,a)||(i.defaultRodeLength=a),F(a)}),p(),R(49,Zue,2,0,"mat-error"),p()()()()()(),R(50,Xue,32,9,"div"),p()}if(t&2){let r=Le(34),o=Le(48);g(14),Nt("background-image",i.bgImage),g(2),q(" ",i.formattedRadiusValue()," "),g(5),w("hideIcon",!0)("disabled",i.disableRaiseDrop||r.invalid)("checked",!i.raised),g(3),Nt("display",i.raised?"flex":"none"),g(2),w("checked",i.useDefaultRadius)("disabled",!i.raised||i.useSetManual),g(6),q("Alarm Radius (",i.convert.getSymbol(i.app.config.units.length),")"),g(),w("ngModel",i.defaultAlarmRadius())("disabled",!i.raised||!i.useDefaultRadius||i.useSetManual),g(2),A(r.invalid&&(r.dirty||r.touched)?35:-1),g(),Nt("display",i.raised?"flex":"none"),g(2),w("checked",i.useSetManual)("disabled",!i.raised||i.useDefaultRadius),g(3),w("disabled",!i.raised||i.useDefaultRadius||!i.useSetManual||o.invalid),g(5),q("Rode Length (",i.convert.getSymbol(i.app.config.units.length),")"),g(),vt("ngModel",i.defaultRodeLength),w("disabled",!i.raised||i.useDefaultRadius||!i.useSetManual),g(2),A(o.invalid&&(o.dirty||o.touched)?49:-1),g(),A(i.raised?-1:50)}},dependencies:[ae,le,ue,Ze,Ms,Ne,qe,Tt,Vn,Ot,Bn,Ci,qi,Mt,Qn,t_,Qi,uo,i_,Ji,Et,Jt,Wt,zt,mr,aa,Go,Rs,Ps,ss,ve,Ie,_f,C1,w1,DF,qx],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 Zx=class n{constructor(e,t){this.signalk=e;this.app=t}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)(ot(Ft),ot(re))};static \u0275prov=et({token:n,factory:n.\u0275fac,providedIn:"root"})};var Que=(n,e)=>({"button-warn":n,"button-primary":e}),Jue=(n,e)=>({"button-accent":n,"button-toolbar":e}),epe=(n,e)=>e.name;function tpe(n,e){n&1&&(u(0,"mat-icon"),_(1,"check"),p())}function ipe(n,e){n&1&&(u(0,"mat-icon"),_(1,"ok"),p())}function npe(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),p(),R(3,tpe,2,0,"mat-icon")(4,ipe,2,0,"mat-icon"),p()}if(n&2){let t=e.$implicit,i=v();g(2),X(t),g(),A(t===i.apData().mode?3:4)}}function rpe(n,e){n&1&&(u(0,"mat-icon"),_(1,"check"),p())}function ope(n,e){n&1&&(u(0,"mat-icon"),_(1,"ok"),p())}function ape(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),p(),R(3,rpe,2,0,"mat-icon")(4,ope,2,0,"mat-icon"),p()}if(n&2){let t=e.$implicit,i=v();g(2),X(t.name),g(),A(t.name===i.apData().state?3:4)}}function spe(n,e){n&1&&(u(0,"span"),_(1,"Target"),p())}function lpe(n,e){n&1&&(u(0,"span"),_(1,"No Pilot"),p())}function cpe(n,e){if(n&1&&(u(0,"span"),_(1),p()),n&2){let t=v();g(),X(t.formatTargetValue(t.apData().target))}}function dpe(n,e){n&1&&(u(0,"span"),_(1,"--"),p())}function upe(n,e){if(n&1&&(u(0,"span"),_(1),p()),n&2){let t=v();g(),X(t.apData().state)}}function ppe(n,e){n&1&&(u(0,"span"),_(1,"--"),p())}function hpe(n,e){if(n&1&&(u(0,"span"),_(1),p()),n&2){let t=v();g(),X(t.apData().mode)}}function mpe(n,e){n&1&&(u(0,"span"),_(1,"--"),p())}function fpe(n,e){if(n&1&&(u(0,"button",18),j(1,"div",24),p()),n&2){let t=v(),i=Le(5);w("matMenuTriggerFor",i)("disabled",t.noPilot())("ngClass",rs(4,Que,t.apData().enabled,!t.apData().enabled)),g(),w("innerText",t.formatLabel(t.apData().state))}}function gpe(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())}),p()}if(n&2){let t=v();w("checked",t.apData().enabled)("disabled",t.noPilot())("matTooltip",t.apData().enabled?"Disengage":"Engage")}}function _pe(n,e){if(n&1&&(u(0,"button",20),_(1," Mode "),p()),n&2){let t=v(),i=Le(1);w("matMenuTriggerFor",i)("disabled",t.noPilot()||t.modeOptions().length===0)}}function ype(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," <<"),p(),_(4,"\xA0 "),u(5,"button",27),T("click",function(){O(t);let r=v();return F(r.dodgeAdjust(-1))}),_(6," < "),p()(),u(7,"div")(8,"button",27),T("click",function(){O(t);let r=v();return F(r.dodgeAdjust(1))}),_(9," >"),p(),_(10,"\xA0 "),u(11,"button",26),T("click",function(){O(t);let r=v();return F(r.dodgeAdjust(10))}),_(12," >> "),p()()()}if(n&2){let t=v();g(2),w("disabled",!t.apData().default||t.apData().state==="off-line"),g(3),w("disabled",!t.apData().default||t.apData().state==="off-line"),g(3),w("disabled",!t.apData().default||t.apData().state==="off-line"),g(3),w("disabled",!t.apData().default||t.apData().state==="off-line")}}function vpe(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"),p(),_(4,"\xA0 "),u(5,"button",27),T("click",function(){O(t);let r=v();return F(r.targetAdjust(-1))}),_(6," -1 "),p()(),u(7,"div")(8,"button",27),T("click",function(){O(t);let r=v();return F(r.targetAdjust(1))}),_(9," +1"),p(),_(10,"\xA0 "),u(11,"button",26),T("click",function(){O(t);let r=v();return F(r.targetAdjust(10))}),_(12," +10 "),p()()()}if(n&2){let t=v();g(2),w("disabled",!t.apData().default||t.apData().state==="off-line"),g(3),w("disabled",!t.apData().default||t.apData().state==="off-line"),g(3),w("disabled",!t.apData().default||t.apData().state==="off-line"),g(3),w("disabled",!t.apData().default||t.apData().state==="off-line")}}function bpe(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 "),p()}if(n&2){let t=v();w("ngClass",rs(2,Jue,t.apData().mode==="dodge",t.apData().mode!=="dodge"))("disabled",t.noPilot())}}var mB=class n{constructor(e,t){this.app=e;this.autopilot=t;this.autopilotApiPath="vessels/self/autopilots/_default",Te(()=>{this.apData().default!==this.currentPilot&&(this.app.debug("changed default pilot:",this.currentPilot,this.apData().default),this.currentPilot=this.apData().default,this.fetchAPOptions())})}close=new pe;modeOptions=J([]);stateOptions=J([]);autopilotApiPath;currentPilot;apData=Z({});noPilot=Fi(()=>!this.app.featureFlags().autopilotApi||!this.apData().default||!this.apData().state||this.apData().state==="off-line");dodgeAction=Fi(()=>this.apData().availableActions?.includes("dodge"));handleClose(){this.close.emit()}fetchAPOptions(){return ee(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 ee(this,null,function*(){let e=this.apData().enabled?`${this.autopilotApiPath}/disengage`:`${this.autopilotApiPath}/engage`;try{this.apData().enabled?yield this.autopilot.disengage():yield this.autopilot.engage()}catch(t){let i=`Error setting Autopilot state!
3870
3870
  `;t.status===403?(i+="Unauthorised: Please login.",this.app.showAlert(`Error (${t.status}):`,i)):this.app.showMessage(t.error?.message??"Device returned an error!")}})}targetAdjust(e){return ee(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 ee(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 ee(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 ee(this,null,function*(){try{yield this.autopilot.mode(e)}catch(t){let i=`Error setting Autopilot mode!
3871
3871
  `;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 ee(this,null,function*(){try{yield this.autopilot.state(e)}catch(t){let i=`Error setting Autopilot state!
3872
- `;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"?We.radiansToDegrees(e)?.toFixed(1):"--"}static \u0275fac=function(t){return new(t||n)(Q(re),Q(Zx))};static \u0275cmp=W({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),Oe(2,npe,5,2,"button",2,ft),p(),u(4,"mat-menu",null,1),Oe(6,ape,5,2,"button",2,epe),p(),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"),p()()(),u(14,"mat-card-content")(15,"div",8)(16,"div",9),_(17," Autopilot"),j(18,"br"),_(19),p(),u(20,"div",10)(21,"div",11)(22,"div",12),R(23,spe,2,0,"span")(24,lpe,2,0,"span"),p()(),u(25,"div",13)(26,"div",14),R(27,cpe,2,1,"span")(28,dpe,2,0,"span"),_(29," \xB0 "),p()(),u(30,"div",15)(31,"div",12),R(32,upe,2,1,"span")(33,ppe,2,0,"span"),p(),u(34,"div",12),R(35,hpe,2,1,"span")(36,mpe,2,0,"span"),p()()(),u(37,"div",16)(38,"div",17),R(39,fpe,2,7,"button",18)(40,gpe,1,3,"mat-slide-toggle",19),p(),u(41,"div"),R(42,_pe,2,2,"button",20),p()(),R(43,ype,13,4,"div",21)(44,vpe,13,4,"div",21),u(45,"div",21)(46,"div",6),R(47,bpe,2,5,"button",22),p()()()()()()),t&2&&(g(2),Fe(i.modeOptions()),g(4),Fe(i.stateOptions()),g(13),q(" ",i.apData().default??""," "),g(4),A(i.apData().default?23:24),g(4),A(i.apData().default||i.apData().state==="off-line"?27:28),g(5),A(i.apData().default||i.apData().state==="off-line"?32:33),g(3),A(i.apData().default||i.apData().state==="off-line"?35:36),g(4),A(i.stateOptions().length>2?39:40),g(3),A(i.modeOptions().length!==0?42:-1),g(),A(i.apData().mode==="dodge"?43:44),g(4),A(i.dodgeAction()?47:-1))},dependencies:[ve,Ie,hn,Fn,px,el,ff,ue,Ze,Ms,qe,Tt,Ot,ae,le,nl,la,wa,Qa,aa,Go,Mt],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 Xx="/resources/buddies",Yx=class n{constructor(e,t){this.signalk=e;this.app=t}list(){return this.signalk.api.get(this.app.skApiVersion,`${Xx}`)}add(e,t){return this.signalk.api.post(this.app.skApiVersion,`${Xx}`,{urn:e,name:t})}update(e,t){return this.signalk.api.put(this.app.skApiVersion,`${Xx}/${e}`,{name:t})}remove(e){return this.signalk.api.delete(this.app.skApiVersion,`${Xx}/${e}`)}static \u0275fac=function(t){return new(t||n)(ot(Ft),ot(re))};static \u0275prov=et({token:n,factory:n.\u0275fac,providedIn:"root"})};var xpe=["*"],fB=class n{closed=we();infoPanel=M(wu);close(){this.infoPanel.close(),this.closed.emit()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=W({type:n,selectors:[["info-panel"]],outputs:{closed:"closed"},ngContentSelectors:xpe,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&&(ge(),u(0,"div",0)(1,"mat-nav-list",1)(2,"a",2),T("click",function(){return i.close()}),u(3,"mat-icon"),_(4,"close"),p()(),j(5,"mat-divider"),p()(),u(6,"div",3),ce(7),p())},dependencies:[xn,Es,po,Da,ae,le],encapsulation:2,changeDetection:0})};var Cpe=["*"],wpe=(n,e)=>({measure:n,compact:e}),Spe=n=>({measure:n});function Mpe(n,e){if(n&1&&(u(0,"mat-icon"),j(1,"country-flag",7),p()),n&2){let t=v(2);g(),w("mmsi",t.mmsi)("host",t.app.hostDef.url)}}function Tpe(n,e){if(n&1&&j(0,"mat-icon",8),n&2){let t=v(2);Pt(t.icon==null?null:t.icon.class),w("svgIcon",t.icon.svgIcon)}}function Epe(n,e){if(n&1&&(u(0,"mat-icon"),_(1),p()),n&2){let t=v(2);Pt(t.icon==null?null:t.icon.class),g(),X(t.icon==null?null:t.icon.name)}}function Ipe(n,e){if(n&1&&_(0),n&2){let t=v(2);q(" \xA0",t.title," ")}}function Dpe(n,e){if(n&1){let t=H();u(0,"div")(1,"button",9),T("click",function(){O(t);let r=v(2);return F(r.handleClose())}),u(2,"mat-icon"),_(3,"close"),p()()()}}function kpe(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.handleNavTo())}),u(2,"mat-icon"),_(3,"near_me"),p()()()}}function Ppe(n,e){if(n&1&&(u(0,"div",1)(1,"div",4),R(2,Mpe,2,2,"mat-icon"),R(3,Tpe,1,3,"mat-icon",5)(4,Epe,2,3,"mat-icon",6),R(5,Ipe,1,1),p(),R(6,Dpe,4,0,"div"),R(7,kpe,4,0,"div"),p()),n&2){let t=v();g(),w("ngClass",vn(6,Spe,t.measure)),g(),A(t.mmsi?2:-1),g(),A(t.icon!=null&&t.icon.svgIcon?3:t.icon!=null&&t.icon.name?4:-1),g(2),A(t.title?5:-1),g(),A(t.canClose?6:-1),g(),A(!t.canClose&&t.navTo?7:-1)}}var Lr=class n{title;mmsi;icon;canClose=!0;measure=!1;compact=!1;navTo=!1;closed=new pe;navigateTo=new pe;app=M(re);constructor(){}handleClose(){this.closed.emit()}handleNavTo(){this.navigateTo.emit()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=W({type:n,selectors:[["ap-popover"]],inputs:{title:"title",mmsi:"mmsi",icon:"icon",canClose:"canClose",measure:"measure",compact:"compact",navTo:"navTo"},outputs:{closed:"closed",navigateTo:"navigateTo"},ngContentSelectors:Cpe,decls:5,vars:5,consts:[[1,"popover","top","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&&(ge(),u(0,"div",0),R(1,Ppe,8,8,"div",1),u(2,"div",2),ce(3),p(),j(4,"div",3),p()),t&2&&(w("ngClass",rs(2,wpe,i.measure,i.compact)),g(),A(i.title||i.icon||i.mmsi||i.canClose||i.navTo?1:-1))},dependencies:[hn,Fn,ue,Ne,ve,Ie,ae,le,wx],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-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[_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.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-action-button[_ngcontent-%COMP%]{flex:1 1 45%}.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})};function Rpe(n,e){if(n&1&&j(0,"h1",8),n&2){let t=e.$implicit;w("remarkNode",t)}}function Lpe(n,e){if(n&1&&(u(0,"remark",1),ct(1,Rpe,1,1,"ng-template",7),p()),n&2){let t=v();w("processor",t.mdProcessor)("markdown",t.resource()[1].description??"")}}function Ape(n,e){if(n&1&&j(0,"div",2),n&2){let t=v();w("innerHTML",t.resource()[1].description??"",wd)}}function Ope(n,e){if(n&1&&(u(0,"div",10),_(1),p()),n&2){let t=v().$implicit;g(),q(" ",t[1]," ")}}function Fpe(n,e){if(n&1&&(j(0,"div",11),St(1,"coords")),n&2){let t=v().$implicit,i=v();w("innerText",Oi(1,1,t[1],i.app.config.units.positionFormat,!0))}}function Npe(n,e){if(n&1&&(j(0,"div",11),St(1,"coords")),n&2){let t=v().$implicit,i=v();w("innerText",Xn(1,1,t[1],i.app.config.units.positionFormat))}}function Bpe(n,e){if(n&1&&(u(0,"div",3)(1,"div",9),_(2),p(),R(3,Ope,2,1,"div",10),R(4,Fpe,2,5,"div",11),R(5,Npe,2,4,"div",11),p()),n&2){let t=e.$implicit;g(2),q("",t[0],":"),g(),A(t[0]!=="Latitude"&&t[0]!=="Longitude"?3:-1),g(),A(t[0]==="Latitude"?4:-1),g(),A(t[0]==="Longitude"?5:-1)}}function Vpe(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"),p(),_(4),p()()}if(n&2){let t=v();Nt("order",t.type()==="route"?1:null),g(),w("disabled",t.ctrl.isReadOnly),g(3),q(" ",t.ctrl.modifyLabel," ")}}function Gpe(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"),p(),_(4," ADD "),p()()}}function jpe(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.emitDelete())}),u(2,"mat-icon"),_(3,"delete"),p(),_(4," DELETE "),p()()}if(n&2){let t=v();Nt("order",t.type()==="route"?6:null),g(),w("disabled",t.ctrl.isReadOnly||t.ctrl.isActive)}}function zpe(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.emitActive(!0))}),u(2,"mat-icon"),_(3,"near_me"),p(),_(4),p()()}if(n&2){let t=v();Nt("order",t.type()==="route"?2:null),g(),w("matTooltip",t.type()==="waypoint"?"Navigate to Waypoint":"Navigate to first point"),g(3),q(" ",t.ctrl.activeText," ")}}function Wpe(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(!1))}),u(2,"mat-icon"),_(3,"clear_all"),p(),_(4," CLEAR "),p()()}if(n&2){let t=v();Nt("order",t.type()==="route"?2:null)}}function Upe(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.emitPoints())}),u(2,"mat-icon"),_(3,"location_on"),p(),_(4," POINTS "),p()()}if(n&2){let t=v();Nt("order",t.type()==="route"?3:null)}}function Hpe(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.emitRelated())}),u(2,"mat-icon"),_(3,"style"),p(),_(4," GROUP "),p()()}}function Kpe(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.emitNotes())}),u(2,"mat-icon"),_(3,"local_offer"),p(),_(4," NOTES "),p()()}if(n&2){let t=v();Nt("order",t.type()==="route"?4:null)}}function $pe(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.emitInfo())}),u(2,"mat-icon"),_(3,"info_outline"),p(),_(4," INFO "),p()()}if(n&2){let t=v();Nt("order",t.type()==="route"?5:null)}}function qpe(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.emitSave())}),u(2,"mat-icon"),_(3,"save"),p(),_(4," SAVE "),p()()}if(n&2){let t=v();Nt("order",t.type()==="route"?2:null)}}function Zpe(n,e){if(n&1&&(u(0,"div",5),_(1),p(),u(2,"div",6),_(3),p()),n&2){let t=v().$implicit;g(),q("",t[0],":"),g(2),q(" ",t[1]," ")}}function Xpe(n,e){if(n&1&&(u(0,"div",4)(1,"div",5),_(2),p(),u(3,"div",7),_(4),p()()),n&2){let t=v().$implicit;g(2),q("",t[0],":"),g(2),q(" ",t[1]," ")}}function Ype(n,e){if(n&1&&R(0,Zpe,4,2)(1,Xpe,5,2,"div",4),n&2){let t=e.$implicit;A(t[0]==="Description"?0:1)}}var gB='.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-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[_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.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-action-button[_ngcontent-%COMP%]{flex:1 1 45%}.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}',Qx=class n{mdProcessor=Fr;title=Z();resource=Z();type=Z();active=Z();featureCount=Z(0);units=Z("m");canClose=Z();canSave=Z(!1);modify=we();save=we();delete=we();addNote=we();activated=we();deactivated=we();related=we();info=we();closed=we();points=we();notes=we();_title=Ea(()=>this.title());properties;ctrl={showInfoButton:!1,showModifyButton:!1,showDeleteButton:!1,showAddNoteButton:!1,showRelatedButton:!1,showPointsButton:!1,showNotesButton:!1,showSaveButton:!1,canActivate:!1,isActive:!1,activeText:"ACTIVE",isReadOnly:!1,modifyLabel:"MOVE"};hasMarkdown=J(!1);icon;app=M(re);constructor(){Te(()=>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=!1,this.ctrl.showPointsButton=!1,this.ctrl.showNotesButton=!1,this.ctrl.showInfoButton=!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(){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.showNotesButton=!1,this.ctrl.showAddNoteButton=!1,this.ctrl.showPointsButton=!1,this.ctrl.showRelatedButton=!1,this.properties=[],this.resource()[1].name&&this.properties.push(["Name",this.resource()[1].name]),this.resource()[1].description&&this.properties.push(["Desc.",this.resource()[1].description]),this.properties.push(["Latitude",this.resource()[1].feature.geometry.coordinates[1]]),this.properties.push(["Longitude",this.resource()[1].feature.geometry.coordinates[0]]),this.hasMarkdown.set(!0)}parseWaypoint(){this.ctrl.isReadOnly=this.resource()[1].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.showNotesButton=!this.app.useInfoPanel(),this.ctrl.showAddNoteButton=!1,this.ctrl.showPointsButton=!1,this.ctrl.showRelatedButton=!1,this.properties=[],this.icon=Un("waypoints",this.resource()[1]),this._title.set(this.resource()[1].name??""),this.properties.push(["Latitude",this.resource()[1].feature.geometry.coordinates[1]]),this.properties.push(["Longitude",this.resource()[1].feature.geometry.coordinates[0]]),this.hasMarkdown.set(!0)}parseRoute(){this.ctrl.isReadOnly=this.resource()[1].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.icon=Un("routes",this.resource()[1]),this._title.set(this.resource()[1].name??""),this.properties=[];let e=this.app.formatValueForDisplay(this.resource()[1].distance,"m");this.properties.push(["Distance",e]),this.hasMarkdown.set(!0)}parseNote(){this.ctrl.isReadOnly=this.resource()[1].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.showAddNoteButton=!1,this.ctrl.showNotesButton=!1,this.ctrl.showPointsButton=!1,this.ctrl.showRelatedButton=!!(this.resource()[1].group&&this.app.config.resources.notes.groupNameEdit),this.icon=Un("notes",this.resource()[1]),this._title.set(this.resource()[1].name??""),this.properties=[],this.ctrl.isReadOnly=this.resource()[1].properties?.readOnly,this.hasMarkdown.update(()=>this.resource()[1].mimeType?.includes("markdown"))}parseRegion(){this.ctrl.isReadOnly=this.resource()[1].feature.properties?.readOnly,this.ctrl.isActive=!1,this.ctrl.activeText="",this.ctrl.canActivate=!1,this.ctrl.showInfoButton=!0,this.ctrl.showModifyButton=this.resource()[1].feature.geometry.type==="MultiPolygon"?!1:!this.ctrl.isReadOnly,this.ctrl.showDeleteButton=this.app.useInfoPanel()?!1:!this.ctrl.isReadOnly,this.ctrl.showAddNoteButton=!1,this.ctrl.showNotesButton=!this.app.useInfoPanel(),this.ctrl.showPointsButton=!1,this.ctrl.showRelatedButton=!1,this.properties=[],this.icon=Un("regions",this.resource()[1]),this._title.set(this.resource()[1].name??""),this.hasMarkdown.set(!0)}emitModify(){this.modify.emit()}emitSave(){this.save.emit()}emitAddNote(){this.addNote.emit()}emitDelete(){this.delete.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=W({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"]},outputs:{modify:"modify",save:"save",delete:"delete",addNote:"addNote",activated:"activated",deactivated:"deactivated",related:"related",info:"info",closed:"closed",points:"points",notes:"notes"},decls:16,vars:13,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","Delete","matTooltipPosition","after",3,"click","disabled"],["mat-button","","matTooltipPosition","after",3,"click","matTooltip"],["mat-button","","matTooltip","Clear Destination","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,Lpe,2,2,"remark",1)(2,Ape,1,1,"div",2),Oe(3,Bpe,6,4,"div",3,ft),u(5,"div",4),R(6,Vpe,5,4,"div",5),R(7,Gpe,5,0,"div",6),R(8,jpe,5,3,"div",5),R(9,zpe,5,4,"div",5)(10,Wpe,5,2,"div",5),R(11,Upe,5,2,"div",5),R(12,Hpe,5,0,"div",6),R(13,Kpe,5,2,"div",5),R(14,$pe,5,2,"div",5),R(15,qpe,5,2,"div",5),p()()),t&2&&(w("title",i._title())("icon",i.icon)("canClose",i.canClose()),g(),A(i.hasMarkdown()?1:2),g(2),Fe(i.properties),g(3),A(i.ctrl.showModifyButton?6:-1),g(),A(i.ctrl.showAddNoteButton?7:-1),g(),A(i.ctrl.showDeleteButton?8:-1),g(),A(i.ctrl.canActivate&&!i.ctrl.isActive?9:i.ctrl.canActivate&&i.ctrl.isActive?10:-1),g(2),A(i.ctrl.showPointsButton?11:-1),g(),A(i.ctrl.showRelatedButton?12:-1),g(),A(i.ctrl.showNotesButton?13:-1),g(),A(i.ctrl.showInfoButton?14:-1),g(),A(i.ctrl.showSaveButton?15:-1))},dependencies:[ue,Ze,ve,Ie,ae,le,Lr,Nr,mo,ho,dn],styles:[gB],changeDetection:0})},Jx=class n{title=Z();resource=Z();canClose=Z();info=we();closed=we();properties;icon;app=M(re);constructor(){Te(()=>{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=W({type:n,selectors:[["resourceset-popover"]],inputs:{title:[1,"title"],resource:[1,"resource"],canClose:[1,"canClose"]},outputs:{info:"info",closed:"closed"},features:[Me],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()}),Oe(1,Ype,2,1,null,null,ft),u(3,"div",1)(4,"div",2)(5,"button",3),T("click",function(){return i.emitInfo()}),u(6,"mat-icon"),_(7,"info_outline"),p(),_(8," INFO "),p()()()()),t&2&&(w("title",i.title())("icon",i.icon)("canClose",i.canClose),g(),Fe(i.properties))},dependencies:[ue,Ze,ve,Ie,ae,le,Lr],styles:[gB],changeDetection:0})};var _B=["speedtext"],Qpe=["speedunitstext"],Jpe=["dial"],yB=["headingtext"],vB=["pointer"],bB=["needlehi"],xB=["needlelo"],Ff=n=>({hide:n}),ehe=["labeltext"],eC=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}},tC=class n extends eC{speed;speedunits="knots";heading;needle;windtrue;windapparent;speedtext;speedunitstext;dial;headingtext;pointer;needlehi;needlelo;valueStr="0\xBA";ptrOffset=0;renderer=M(On);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=W({type:n,selectors:[["ap-compass"]],viewQuery:function(t,i){if(t&1&&Ht(_B,7)(Qpe,7)(Jpe,7)(yB,7)(vB,7)(bB,7)(xB,7),t&2){let r;De(r=ke())&&(i.speedtext=r.first),De(r=ke())&&(i.speedunitstext=r.first),De(r=ke())&&(i.dial=r.first),De(r=ke())&&(i.headingtext=r.first),De(r=ke())&&(i.pointer=r.first),De(r=ke())&&(i.needlehi=r.first),De(r=ke())&&(i.needlelo=r.first)}},inputs:{speed:"speed",speedunits:"speedunits",heading:"heading",needle:"needle",windtrue:"windtrue",windapparent:"windapparent"},features:[Qe,Me],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&&(Ta(),u(0,"svg",7)(1,"defs")(2,"filter",8),j(3,"feGaussianBlur",9),p(),u(4,"filter",10),j(5,"feGaussianBlur",11),p()(),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; } } "),p(),j(8,"rect",13),u(9,"g",14),j(10,"circle",15),p(),u(11,"g",14),j(12,"path",16)(13,"path",17),p(),u(14,"g",18,0),j(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),j(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"),p(),u(391,"text",393),_(392,"E"),p(),u(393,"text",394),_(394,"S"),p(),u(395,"text",395),_(396,"W"),p(),u(397,"text",396),_(398,"NE"),p(),u(399,"text",397),_(400,"SE"),p(),u(401,"text",398),_(402,"SW"),p(),u(403,"text",399),_(404,"NW"),p()(),u(405,"g",400)(406,"text",401,1),_(408,"0\xBA"),p(),j(409,"text",402,2)(411,"text",403,3),p(),u(413,"g",404)(414,"g",405,4),j(416,"path",406),p()(),u(417,"g",407)(418,"g",408,5),j(420,"path",409),p()(),u(421,"g",410,6)(423,"g",411),j(424,"path",412),p()(),u(425,"g",14)(426,"g",413),j(427,"path",414),p()()()),t&2&&(g(413),w("ngClass",vn(3,Ff,i.windapparent==null||i.windapparent==null)),g(4),w("ngClass",vn(5,Ff,i.windtrue==null||i.windtrue==null)),g(4),w("ngClass",vn(7,Ff,i.needle==null||i.needle==null)))},dependencies:[hn,Fn],encapsulation:2,changeDetection:0})},iC=class n extends eC{label="";speed;heading;windtrue;windapparent;labeltext;headingtext;speedtext;pointer;needlehi;needlelo;showPointer=!0;showWindTrue=!0;showWindApparent=!0;renderer=M(On);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=W({type:n,selectors:[["ap-compass-northup"]],viewQuery:function(t,i){if(t&1&&Ht(ehe,7)(yB,7)(_B,7)(vB,7)(bB,7)(xB,7),t&2){let r;De(r=ke())&&(i.labeltext=r.first),De(r=ke())&&(i.headingtext=r.first),De(r=ke())&&(i.speedtext=r.first),De(r=ke())&&(i.pointer=r.first),De(r=ke())&&(i.needlehi=r.first),De(r=ke())&&(i.needlelo=r.first)}},inputs:{label:"label",speed:"speed",heading:"heading",windtrue:"windtrue",windapparent:"windapparent"},features:[Qe,Me],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&&(Ta(),u(0,"svg",7)(1,"defs")(2,"filter",8),j(3,"feGaussianBlur",9),p(),u(4,"filter",10),j(5,"feGaussianBlur",11),p()(),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; } } "),p(),j(8,"rect",13),u(9,"g",14),j(10,"circle",15),p(),u(11,"g",16,0),j(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),j(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"),p(),u(388,"text",391),_(389,"E"),p(),u(390,"text",392),_(391,"S"),p(),u(392,"text",393),_(393,"W"),p(),u(394,"text",394),_(395,"NE"),p(),u(396,"text",395),_(397,"SE"),p(),u(398,"text",396),_(399,"SW"),p(),u(400,"text",397),_(401,"NW"),p()(),u(402,"g",398)(403,"text",399,1),_(405,"0\xBA"),p(),u(406,"text",400,2),_(408,"0"),p(),u(409,"text",401,3),_(411,"Heading"),p()(),u(412,"g",402)(413,"g",403,4),j(415,"path",404),p()(),u(416,"g",405)(417,"g",406,5),j(419,"path",407),p()(),u(420,"g",408,6)(422,"g",409),j(423,"path",410),p()()()),t&2&&(g(412),w("ngClass",vn(3,Ff,!i.showWindApparent)),g(4),w("ngClass",vn(5,Ff,!i.showWindTrue)),g(4),w("ngClass",vn(7,Ff,!i.showPointer)))},dependencies:[hn,Fn],encapsulation:2,changeDetection:0})};function the(n,e){if(n&1){let t=H();u(0,"button",17),T("click",function(){O(t);let r=v();return F(r.handleMarkPosition())}),u(1,"mat-icon"),_(2,"add_location"),p()()}}function ihe(n,e){if(n&1){let t=H();u(0,"button",21),T("click",function(){O(t);let r=v(2);return F(r.toggleBuddy())}),u(1,"mat-icon"),_(2),p()()}if(n&2){let t=v(2);g(2),X(t.vessel().buddy?"group_remove":"group_add")}}function nhe(n,e){if(n&1){let t=H();u(0,"button",18),T("click",function(){O(t);let r=v();return F(r.toggleFlag())}),u(1,"mat-icon"),_(2),p()(),R(3,ihe,3,1,"button",19),u(4,"button",20),T("click",function(){O(t);let r=v();return F(r.focusVessel(!0))}),u(5,"mat-icon"),_(6,"center_focus_weak"),p()()}if(n&2){let t=v();w("matTooltip",t.isFlagged?"Un-flag vessel":"Flag vessel"),g(2),X(t.isFlagged?"clear_all":"flag"),g(),A(!t.isSelf()&&t.app.featureFlags().buddyList?3:-1)}}function rhe(n,e){if(n&1){let t=H();u(0,"button",22),T("click",function(){O(t);let r=v();return F(r.focusVessel(!1))}),u(1,"mat-icon"),_(2,"clear_all"),p()()}}function ohe(n,e){if(n&1){let t=H();u(0,"span",5)(1,"button",23),T("click",function(){O(t);let r=v();return F(r.toggleTrack())}),u(2,"mat-icon"),_(3),p()()()}if(n&2){let t=v(),i=t.app.isVesselTrackShown(t.vessel().id);w("matTooltip",t.app.config.vessels.aisShowTrack?'Turn off "Show All" to enable':i?"Hide vessel track":"Show vessel track"),g(),w("disabled",t.app.config.vessels.aisShowTrack),g(2),X(i?"layers_clear":"route")}}function ahe(n,e){if(n&1&&(u(0,"div",1)(1,"div",8),_(2,"Callsign (VHF):"),p(),j(3,"div",9),p()),n&2){let t=v();g(3),w("innerText",t.vessel().callsignVhf)}}function she(n,e){if(n&1&&(u(0,"div",1)(1,"div",8),_(2,"Callsign (HF):"),p(),j(3,"div",9),p()),n&2){let t=v();g(3),w("innerText",t.vessel().callsignHf)}}function lhe(n,e){if(n&1&&(u(0,"div",1)(1,"div",8),_(2,"Range:"),p(),u(3,"div",10),_(4),p()()),n&2){let t=v(2);g(4),q(" ",t.distToSelf," ")}}function che(n,e){if(n&1&&(u(0,"div",1)(1,"div",8),_(2,"CPA:"),p(),u(3,"div",10),_(4),p()(),u(5,"div",1)(6,"div",8),_(7,"TCPA:"),p(),u(8,"div",10),_(9),p()()),n&2){let t=v(2);g(4),q(" ",t.cpa??"--"," "),g(5),q(" ",t.tcpa??"--"," ")}}function dhe(n,e){if(n&1&&(R(0,lhe,5,1,"div",1),R(1,che,10,2)),n&2){let t=v();A(t.vessel().distanceToSelf?0:-1),g(),A(t.vessel().closestApproach?1:-1)}}var nC=class n{title=Z();vessel=Z();useMagnetic=Z();isActive=Z();isSelf=Z();canClose=Z();info=we();closed=we();focused=we();markPosition=we();_title;_icon;convert=We;timeLastUpdate;timeAgo;speedUnits;distToSelf;cpa;tcpa;position=[0,0];positionTimestamp="";isFlagged=!1;app=M(re);buddies=M(Yx);destroyRef=M(Ai);windSpeed(e,t){return Number.isFinite(e)?this.app.formatValueForDisplay(e,"m/s",{path:t}):"--"}constructor(){Te(()=>{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,this._icon=this.vessel().type?.id?ba(this.vessel().type?.id):{name:"directions_boat",svgIcon:void 0},this.position=[this.vessel().position[0],this.vessel().position[1]],this.position=di.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(jt(this.destroyRef)).subscribe(()=>{this.app.showMessage("Buddy successfully removed.",!1,3e3)},t=>{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(jt(this.destroyRef)).subscribe(()=>{this.app.showMessage(`Buddy added (${t})`,!1,3e3)},i=>{this.app.showMessage(`Error adding buddy!(${t})`,!1,5e3)})}}toggleTrack(){this.app.toggleVesselTrack(this.vessel().id)}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=W({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:53,vars:29,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"],[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){t&1&&(u(0,"ap-popover",0),T("closed",function(){return i.handleClose()}),u(1,"div",1)(2,"div",2),R(3,the,3,0,"button",3)(4,nhe,7,3),R(5,rhe,3,0,"button",4),R(6,ohe,4,3,"span",5),p(),u(7,"div",6)(8,"button",7),T("click",function(){return i.handleInfo()}),u(9,"mat-icon"),_(10,"info_outline"),p()()()(),j(11,"mat-divider"),R(12,ahe,4,1,"div",1)(13,she,4,1,"div",1),u(14,"div",1)(15,"div",8),_(16,"Latitude:"),p(),j(17,"div",9),St(18,"coords"),p(),u(19,"div",1)(20,"div",8),_(21,"Longitude:"),p(),j(22,"div",9),St(23,"coords"),p(),u(24,"div",1)(25,"div",8),_(26,"Last Position:"),p(),u(27,"div",10),_(28),p()(),R(29,dhe,2,2),u(30,"div",1)(31,"div",8),_(32,"Last Update:"),p(),u(33,"div",10),_(34),p()(),u(35,"div",11)(36,"div",12),j(37,"ap-compass",13),p(),u(38,"div",14),_(39," \xA0"),j(40,"br"),u(41,"div")(42,"div",15)(43,"span",8),_(44),p()(),u(45,"div",10),_(46),p()(),u(47,"div")(48,"div",16)(49,"span",8),_(50," Wind (A):"),p()(),u(51,"div",10),_(52),p()()()()()),t&2&&(w("title",i._title)("mmsi",i.vessel().mmsi)("icon",i._icon)("canClose",i.canClose()),g(3),A(i.isActive()?3:4),g(2),A(i.isActive()&&!i.isSelf()?5:-1),g(),A(i.isSelf()?-1:6),g(6),A(i.vessel().callsignVhf?12:i.vessel().callsignHf?13:-1),g(5),w("innerText",Oi(18,22,i.position[1],i.app.config.units.positionFormat,!0)),g(5),w("innerText",Xn(23,26,i.position[0],i.app.config.units.positionFormat)),g(6),q(" ",i.positionTimestamp," "),g(),A(i.isSelf()?-1:29),g(5),Uo(" ",i.timeLastUpdate," ",i.timeAgo," "),g(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),g(7),q(" Wind (",i.useMagnetic()?"M":"T","):"),g(2),q(" ",i.windSpeed(i.vessel().wind.tws,i.app.twsDisplayUnitPath())," "),g(6),q(" ",i.windSpeed(i.vessel().wind.aws,"environment.wind.speedApparent")," "))},dependencies:[ue,Ne,ve,Ie,ae,le,Da,Lr,tC,dn],encapsulation:2,changeDetection:0})};var uhe=n=>({"icon-warn":n});function phe(n,e){if(n&1&&j(0,"mat-icon",4),n&2){let t=v().$implicit;Pt(t.icon.class),w("svgIcon",t.icon.svgIcon)}}function hhe(n,e){if(n&1&&(u(0,"mat-icon",5),_(1),p()),n&2){let t=v().$implicit;Pt(t.icon.class),w("ngClass",vn(4,uhe,t.text&&t.text.indexOf("self")!==-1)),g(),q(" ",t.icon.name," ")}}function mhe(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,phe,1,3,"mat-icon",2)(2,hhe,2,6,"mat-icon",3),_(3),p()}if(n&2){let t=e.$implicit;g(),A(t.icon.svgIcon?1:2),g(2),q(" ",t.text," ")}}var rC=class n{title=Z();features=Z([]);canClose=Z();closed=we();selected=we();handleSelect(e){this.selected.emit(e)}handleClose(){this.closed.emit()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=W({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"),Oe(2,mhe,4,2,"mat-list-item",null,ft),p()()),t&2&&(w("title",i.title())("canClose",i.canClose()),g(2),Fe(i.features()))},dependencies:[hn,Fn,xn,Es,po,ue,ve,ae,le,Lr],encapsulation:2,changeDetection:0})};var fhe=()=>({name:"map"});function ghe(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"),p(),_(3),p()}if(n&2){let t=e.$implicit;g(3),q(" ",t.text," ")}}var oC=class n{features=Z([]);canClose=Z();closed=we();selected=we();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=W({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"),Oe(2,ghe,4,1,"mat-list-item",null,ft),p()()),t&2&&(w("title",i.title)("canClose",i.canClose())("icon",Eo(3,fhe)),g(2),Fe(i.features()))},dependencies:[xn,Es,po,ue,ve,ae,le,Lr],encapsulation:2,changeDetection:0})};var aC=class n{title;aircraft;canClose;info=new pe;closed=new pe;_title;timeLastUpdate;timeAgo;app=M(re);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=W({type:n,selectors:[["aircraft-popover"]],inputs:{title:"title",aircraft:"aircraft",canClose:"canClose"},outputs:{info:"info",closed:"closed"},features:[Me],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:"),p(),u(4,"div",3),_(5),p()(),u(6,"div",1)(7,"div",2),_(8,"Call sign VHF:"),p(),u(9,"div",3),_(10),p()(),u(11,"div",1)(12,"div",2),_(13,"Call sign HF:"),p(),u(14,"div",3),_(15),p()(),u(16,"div",1)(17,"div",2),_(18,"Latitude:"),p(),j(19,"div",4),St(20,"coords"),p(),u(21,"div",1)(22,"div",2),_(23,"Longitude:"),p(),j(24,"div",4),St(25,"coords"),p(),u(26,"div",1)(27,"div",2),_(28,"Last Update:"),p(),u(29,"div",3),_(30),p()(),u(31,"div",1)(32,"div",5),_(33,"\xA0"),p(),u(34,"div",6)(35,"button",7),T("click",function(){return i.handleInfo()}),u(36,"mat-icon"),_(37,"info_outline"),p(),_(38," INFO "),p()()()()),t&2&&(w("title",i._title)("canClose",i.canClose),g(5),X(i.aircraft.name),g(5),q(" ",i.aircraft.callsignVhf," "),g(5),q(" ",i.aircraft.callsignHf," "),g(4),w("innerText",Oi(20,9,i.aircraft.position[1],i.app.config.units.positionFormat,!0)),g(5),w("innerText",Xn(25,13,i.aircraft.position[0],i.app.config.units.positionFormat)),g(6),Uo(" ",i.timeLastUpdate," ",i.timeAgo," "))},dependencies:[ue,Ze,ve,Ie,ae,le,Lr,dn],encapsulation:2,changeDetection:0})};var sC=class n{title=Z();id=Z();alarm=Z();canClose=Z();info=we();goto=we();closed=we();_title;app=M(re);constructor(){Te(()=>{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=W({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:"),p(),u(4,"div",3),_(5),p()(),u(6,"div",1)(7,"div",2),_(8,"Type:"),p(),u(9,"div",4),_(10),p()(),u(11,"div",1)(12,"div",2),_(13,"Latitude:"),p(),j(14,"div",5),St(15,"coords"),p(),u(16,"div",1)(17,"div",2),_(18,"Longitude:"),p(),j(19,"div",5),St(20,"coords"),p(),u(21,"div",1)(22,"div",6),_(23,"\xA0"),p(),u(24,"div",7)(25,"button",8),T("click",function(){return i.handleGoto()}),u(26,"mat-icon"),_(27,"near_me"),p(),_(28," GO TO "),p()(),u(29,"div",7)(30,"button",9),T("click",function(){return i.handleInfo()}),u(31,"mat-icon"),_(32,"info_outline"),p(),_(33," INFO "),p()()()()),t&2&&(w("title",i._title)("canClose",i.canClose)("icon",i.alarm().icon),g(5),q(" ",i.alarm().message," "),g(5),X(i.alarm().type),g(4),w("innerText",Oi(15,7,i.alarm().properties.position.latitude,i.app.config.units.positionFormat,!0)),g(5),w("innerText",Oi(20,11,i.alarm().properties.position.longitude,i.app.config.units.positionFormat,!1)))},dependencies:[ue,Ze,ve,Ie,ae,le,Lr,dn],encapsulation:2,changeDetection:0})};function _he(n,e){if(n&1&&(u(0,"div",1)(1,"div",2),_(2,"Temperature:"),p(),u(3,"div",3),_(4),p()()),n&2){let t=v();g(4),q(" ",t.app.formatValueForDisplay(t.aton().temperature,"K")," ")}}function yhe(n,e){if(n&1&&(u(0,"div",5)(1,"div",2),_(2,"Wind:"),p(),u(3,"div",9),j(4,"ap-compass-northup",10),p()()),n&2){let t=v();g(4),w("heading",t.convert.radiansToDegrees(t.aton().twd))("speed",t.app.formatSpeed(t.aton().tws))("label",t.app.formattedSpeedUnits)("windtrue",!0)}}var lC=class n{title=Z();aton=Z();canClose=Z();info=we();closed=we();_title;_icon;timeLastUpdate;timeAgo;convert=We;isMeteo;app=M(re);constructor(){Te(()=>{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=W({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:"),p(),u(4,"div",3),_(5),p()(),u(6,"div",1)(7,"div",2),_(8,"Latitude:"),p(),j(9,"div",4),St(10,"coords"),p(),u(11,"div",1)(12,"div",2),_(13,"Longitude:"),p(),j(14,"div",4),St(15,"coords"),p(),u(16,"div",1)(17,"div",2),_(18,"Last Update:"),p(),u(19,"div",3),_(20),p()(),R(21,_he,5,1,"div",1),R(22,yhe,5,4,"div",5),u(23,"div",1)(24,"div",6),_(25,"\xA0"),p(),u(26,"div",7)(27,"button",8),T("click",function(){return i.handleInfo()}),u(28,"mat-icon"),_(29,"info_outline"),p(),_(30," INFO "),p()()()()),t&2&&(w("title",i._title)("canClose",i.canClose())("icon",i._icon),g(5),q(" ",i.aton().type.name," "),g(4),w("innerText",Oi(10,10,i.aton().position[1],i.app.config.units.positionFormat,!0)),g(5),w("innerText",Xn(15,14,i.aton().position[0],i.app.config.units.positionFormat)),g(6),Uo(" ",i.timeLastUpdate," ",i.timeAgo," "),g(),A(i.isMeteo&&i.aton().temperature!==void 0?21:-1),g(),A(i.isMeteo&&i.aton().tws!==void 0&&i.aton().twd!==void 0?22:-1))},dependencies:[ue,Ze,ve,Ie,ae,le,Lr,iC,dn],encapsulation:2,changeDetection:0})};var vhe=(n,e)=>e.key;function bhe(n,e){if(n&1&&(u(0,"div",1)(1,"div",3),_(2),p(),u(3,"div",4),_(4),p()()),n&2){let t=e.$implicit;g(2),q(" ",t.label,": "),g(2),X(t.value)}}function xhe(n,e){n&1&&(u(0,"div",2),_(1,"No details available"),p())}var FE={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"},CB=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"]),Che={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"},whe={1:"Partly submerged",2:"Always dry",3:"Always under water",4:"Covers and uncovers",5:"Awash",6:"Subject to flooding",7:"Floating"},She={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"},Mhe={1:"Non-dangerous",2:"Dangerous",3:"Distributed remains",4:"Mast showing",5:"Hull showing"},The={1:"Conical (nun)",2:"Can (cylindrical)",3:"Spherical",4:"Pillar",5:"Spar",6:"Barrel",7:"Super-buoy",8:"Ice buoy"},Ehe={1:"Stake/pole",2:"Withy",3:"Tower",4:"Lattice",5:"Pile",6:"Cairn",7:"Buoyant"},Ihe={1:"Port",2:"Starboard",3:"Preferred channel starboard",4:"Preferred channel port"},Dhe={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"},khe={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"},Phe={1:"Under construction",2:"Ruined",3:"Under reclamation",5:"Planned"},Rhe={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"},Lhe={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"},Ahe={1:"Horizontal stripes",2:"Vertical stripes",3:"Diagonal stripes",4:"Squared",5:"Border stripes",6:"Single colour"},Ohe={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"},Fhe={1:"North",2:"East",3:"South",4:"West"},Nhe={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"},Bhe={COLOUR:Che,WATLEV:whe,CATOBS:She,CATWRK:Mhe,BOYSHP:The,BCNSHP:Ehe,CATLAM:Ihe,CATLIT:Dhe,LITCHR:khe,CONDTN:Phe,STATUS:Rhe,RESTRN:Lhe,COLPAT:Ahe,TOPSHP:Ohe,CATCAM:Fhe,CATSPM:Nhe},Vhe=[{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 Ghe(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 jhe(n,e){let t=Ghe(e);if(t.length===0)return"";let i=Bhe[n];return i?t.map(r=>i[r]||r).join(", "):t.join(", ")}var zhe=new Set(["DEPTH","VALSOU","DRVAL1","DRVAL2","VALDCO"]),Whe=new Set(["HEIGHT","VERLEN","HORLEN","HORWID"]),cC=class n{title=Z();properties=Z();canClose=Z();closed=we();app=M(re);_title;displayProps=[];constructor(){Te(()=>{if(!this.properties())return;let e=this.properties().layer||"";this._title=this.title()||FE[e]||e||"Chart Feature",this.displayProps=[];for(let t of Vhe){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(zhe.has(e)){let i=parseFloat(String(t));return isNaN(i)?String(t):this.app.formatValueForDisplay(i,"m",{category:"depth"})}if(Whe.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":jhe(e,t)}handleClose(){this.closed.emit()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=W({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()}),Oe(1,bhe,5,2,"div",1,vhe),R(3,xhe,2,0,"div",2),p()),t&2&&(w("title",i._title)("canClose",i.canClose()),g(),Fe(i.displayProps),g(2),A(i.displayProps.length===0?3:-1))},dependencies:[hn,ue,ae,Lr],encapsulation:2,changeDetection:0})};var Ja=ts(Ml());var wB=ts(Ml());var Uhe=.05;function SB(n,e,t,i){let r=di.distanceTo(n,e)??0,o=(0,wB.getGreatCircleBearing)(n,e)??0,a=typeof t=="number"&&t>Uhe?t:i??0,s=a>0?r/a:null;return{bearing:o,distance:r,timeToGo:s}}var MB=[{name:"scaleline",options:{bar:!0,steps:2,text:!1,minWidth:64,units:"nautical"}}],TB={line:[new fe({stroke:new xe({color:"white",width:5,lineDash:[5,5]})}),new fe({fill:new Be({color:"#3399CC"}),stroke:new xe({color:"#3399CC",width:3,lineDash:[5,5]})})],marker:new fe({image:new Ui({radius:3,stroke:new xe({width:2,color:"white"}),fill:new Be({color:"#3399CC"})})})},EB={startLine:new fe({stroke:new xe({color:"black",width:2,lineDash:[4,4]}),text:new Lt({text:"START",offsetY:10})})},IB={default:new fe({stroke:new xe({color:"green",width:2,lineDash:[20,5,5,5]}),text:new Lt({text:"",offsetY:10})}),active:new fe({stroke:new xe({color:"blue",width:4})})},DB={default:new fe({stroke:new xe({color:"#e8932b",width:3,lineDash:[10,6]}),text:new Lt({text:"",offsetY:10})}),active:new fe({stroke:new xe({color:"#e8932b",width:4})})},kB={line:new fe({fill:new Be({color:"green"}),stroke:new xe({color:"black",width:2,lineDash:[5,5]})}),circle:new fe({fill:new Be({color:"rgba(0, 255, 0, .3)"}),stroke:new xe({color:"red",width:2,lineDash:[5,5]})}),anchor:new fe({image:new en({src:"./assets/img/anchor.png",size:[26,26],scale:.75,anchor:[13,1],anchorXUnits:"pixels",anchorYUnits:"pixels",rotateWithView:!1})})},PB={"notice-to-mariners":new fe({stroke:new xe({color:"rgb(206, 107, 132)",lineDash:[5,5],width:2}),fill:new Be({color:"rgba(206, 107, 132, 0.2)"}),text:new Lt({text:"",offsetY:0})}),hazard:new fe({stroke:new xe({color:"rgba(241, 60, 60, 1)",lineDash:[5,5,2],width:2}),fill:new Be({color:"rgba(241, 60, 60, 0.5)"}),text:new Lt({text:"",offsetY:0,stroke:new xe({color:"silver"}),padding:[2,2,2,2],backgroundFill:new Be({color:"white"}),backgroundStroke:new xe({color:"rgba(241, 60, 60, 1)"})})})},RB={mob:new fe({image:new en({src:"./assets/img/alarms/mob.svg",rotateWithView:!1,rotation:0,scale:1,anchor:[12,12],anchorXUnits:"pixels",anchorYUnits:"pixels"})})},LB={marker:new fe({image:new en({src:"./assets/img/waypoints/marker-green.png",anchor:[10.5,25],anchorXUnits:"pixels",anchorYUnits:"pixels",rotateWithView:!1}),text:new Lt({text:"",offsetY:-30})})},Hhe=new en({src:"./assets/img/aircraft_active.png",rotateWithView:!0,rotation:0}),Khe=new en({src:"./assets/img/aircraft_inactive.png",rotateWithView:!0,rotation:0}),AB={default:new fe({image:Hhe,text:new Lt({text:"",offsetY:-12})}),inactive:new fe({image:Khe,text:new Lt({text:"",offsetY:-12})})},$he=new en({src:"./assets/img/sar_active.png",rotateWithView:!1,rotation:0}),OB={default:new fe({image:$he,text:new Lt({text:"",offsetY:-18})})},FB={port:new fe({fill:new Be({color:"green"}),stroke:new xe({color:"green",width:1,lineDash:[5,5]})}),starboard:new fe({fill:new Be({color:"red"}),stroke:new xe({color:"red",width:1,lineDash:[5,5]})})},NB=new fe({fill:new Be({color:"green"}),stroke:new xe({color:"gray",width:1,lineDash:[15,5,3,5]})}),Sp={default:void 0,measure:[new fe({stroke:new xe({color:"white",width:5,lineDash:[5,5]})}),new fe({image:new Ui({radius:6,stroke:new xe({width:2,color:"white"}),fill:new Be({color:"#3399CC"})}),fill:new Be({color:"#3399CC"}),stroke:new xe({color:"#3399CC",width:3,lineDash:[5,5]})})],route:[new fe({stroke:new xe({color:"white",width:5})}),new fe({image:new Ui({radius:6,stroke:new xe({width:2,color:"white"}),fill:new Be({color:"green"})}),stroke:new xe({color:"green",width:3})})],region:[new fe({stroke:new xe({color:"rgba(255,255,255,0.4)",width:5}),fill:new Be({color:"rgba(255,255,255,0.4)"})}),new fe({stroke:new xe({color:"purple",width:2}),image:new Ui({radius:6,stroke:new xe({width:2,color:"white"}),fill:new Be({color:"purple"})})})],radius:[new fe({image:new Ui({radius:6,stroke:new xe({width:2,color:"white"}),fill:new Be({color:"rgba(25, 183, 211, 0.4)"})})}),new fe({fill:new Be({color:"rgba(25, 183, 211, 0.4)"}),stroke:new xe({color:"white",width:3,lineDash:[5,5]})})]};var Nf=class n{constructor(e,t){this.http=e;this.sk=t}currentCellDeg=.1;currentsCacheTtlMs=1800*1e3;currentsCacheMax=512;currentsCache=new Map;getWindSamples(e){if(e.length===0)return Qt([]);let t=e.map(i=>this.sk.api.get(2,`/weather/observations?lat=${i.latitude}&lon=${i.longitude}`).pipe(al(()=>Qt(null))));return B1(t).pipe(Or(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 Qt([]);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 Qt(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}&current=ocean_current_velocity,ocean_current_direction`;return this.http.get(l).pipe(Or(c=>Array.isArray(c)?c:[c]),ua(c=>{c.length!==o.length||c.some(d=>d?.error)||c.forEach((d,h)=>{let m=d?.current?.ocean_current_velocity,f=d?.current?.ocean_current_direction;this.cacheCurrentCell(o[h][0],typeof m=="number"&&typeof f=="number"?{velocity:m,direction:f}:null)})}),Or(()=>this.buildCurrentSamples(e,i)),al(()=>Qt(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)(ot(Ia),ot(Ft))};static \u0275prov=et({token:n,factory:n.\u0275fac,providedIn:"root"})};var qhe=["*"],dC=class n{constructor(e,t,i,r,o){this.mapComponent=e;this.weather=t;this.mapImages=i;this.app=r;o.detach()}show=!1;opacity=.55;indicator="barb";layer;source;refresh$=new Ge;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 Gt,this.layer=new Ut({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(Ip(400),hr(()=>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 Qt([]);let e=this.getSamplePoints();return e.length===0?Qt([]):this.weather.getWindSamples(e).pipe(ua(t=>this.renderWind(t)),al(t=>(console.warn("SK Weather wind layer unavailable.",t),Qt([]))))}getSamplePoints(){let e=this.mapComponent.getMap(),t=e.getSize();if(!t)return[];let i=zn(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 h=0;h<this.gridColumns;h++){let m=r+(a-r)*(h+.5)/this.gridColumns;l.push({latitude:d,longitude:m})}}return l}renderWind(e){this.source.clear(),this.source.addFeatures(e.map(t=>new ze({geometry:new nt(pt([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 fe({image:i,text:this.speedLabel(t,26)})}createBarbStyle(e,t){let i=this.mapImages.getMeteoIcon(t).clone();return rp(t)&&i.setRotation(e),i.setRotateWithView(!0),new fe({image:i,text:this.speedLabel(t,10)})}speedLabel(e,t){return new Lt({text:this.app.formatValueForDisplay(e,"m/s",{precision:0,path:this.app.twsDisplayUnitPath()}),offsetY:t,font:"11px Roboto, Arial, sans-serif",fill:new Be({color:"rgba(20, 60, 95, 0.95)"}),stroke:new xe({color:"rgba(255, 255, 255, 0.9)",width:3})})}static \u0275fac=function(t){return new(t||n)(Q(Ee),Q(Nf),Q(xr),Q(re),Q(oe))};static \u0275cmp=W({type:n,selectors:[["fb-weather-wind"]],inputs:{show:"show",opacity:"opacity",indicator:"indicator"},features:[Me],ngContentSelectors:qhe,decls:1,vars:0,template:function(t,i){t&1&&(ge(),ce(0))},encapsulation:2,changeDetection:0})};var Zhe=["*"],VB=85;function Xhe(n,e,t,i=sn){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,h=Math.floor(o/c)*c,m=y=>Number(y.toFixed(4)),f=[];for(let y=0;y<t;y++)for(let b=0;b<e;b++){let[S,I]=i([d+(b+.5)*l,h+(y+.5)*c]);if(I<-VB||I>VB)continue;let D=((S+180)%360+360)%360-180;f.push({latitude:m(I),longitude:m(D)})}return f}var uC=class n{constructor(e,t,i,r){this.mapComponent=e;this.weather=t;this.mapImages=i;r.detach()}show=!1;opacity=.55;layer;source;refresh$=new Ge;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 Gt,this.layer=new Ut({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(Ip(600),Or(()=>this.getSamplePoints()),V1((e,t)=>this.pointsKey(e)===this.pointsKey(t)),hr(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?Qt([]):e.length===0?(this.source.clear(),Qt([])):this.weather.getOceanCurrentSamples(e).pipe(ua(t=>this.renderCurrents(t)),al(()=>Qt([])))}getSamplePoints(){let e=this.mapComponent.getMap(),t=e.getSize();return t?Xhe(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 ze({geometry:new nt(pt([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 fe({image:d,text:new Lt({text:`${(t/1.852).toFixed(1)} kn`,offsetY:28,font:"11px Roboto, Arial, sans-serif",fill:new Be({color:"rgba(255, 255, 255, 0.95)"}),stroke:new xe({color:"rgba(20, 60, 95, 0.9)",width:3})})})}getFlowRotation(e){return e*Math.PI/180}static \u0275fac=function(t){return new(t||n)(Q(Ee),Q(Nf),Q(xr),Q(oe))};static \u0275cmp=W({type:n,selectors:[["fb-weather-currents"]],inputs:{show:"show",opacity:"opacity"},features:[Me],ngContentSelectors:Zhe,decls:1,vars:0,template:function(t,i){t&1&&(ge(),ce(0))},encapsulation:2,changeDetection:0})};var Yhe=["olMap"],Qhe=()=>({precision:0}),Jhe=()=>({declutter:!0}),GB=(n,e)=>e[0];function eme(n,e){if(n&1){let t=H();u(0,"ol-dragbox",43),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(r){O(t);let o=v();return F(o.onDragBoxCancel(r))}),p()}}function tme(n,e){if(n&1){let t=H();u(0,"ol-draw",44),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())}),p()}if(n&2){let t=v();xC(t.mapInteract.draw.style),w("type",t.mapInteract.measureGeometryType)("stopClick",!1)}}function ime(n,e){if(n&1){let t=H();u(0,"ol-draw",45),T("drawEnd",function(r){O(t);let o=v();return F(o.onDrawEnd(r))}),p()}if(n&2){let t=v();xC(t.mapInteract.draw.style),w("type",t.mapInteract.draw.featureType)("stopClick",t.mapInteract.draw.resourceType!=="route")}}function nme(n,e){if(n&1){let t=H();u(0,"ol-modify",46),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))}),p()}if(n&2){let t=v();w("features",t.mapInteract.draw.features)}}function rme(n,e){n&1&&(u(0,"span"),_(1,"Lat:\xA0"),p())}function ome(n,e){n&1&&(u(0,"span"),_(1,"Lon:\xA0"),p())}function ame(n,e){if(n&1&&(_(0," \xA0 "),j(1,"span",11)),n&2){let t=v(),i=v();g(),w("innerText","ETA: "+i.app.formatValueForDisplay(t.timeToGo,"s"))}}function sme(n,e){if(n&1&&(_(0," \xA0 "),j(1,"span",11),_(2," \xA0 "),j(3,"span",11),R(4,ame,2,1)),n&2){let t=e,i=v();g(),w("innerText","Brg: "+i.app.formatValueForDisplay(t.bearing,"deg",Eo(3,Qhe))),g(2),w("innerText","Dist: "+i.app.formatValueForDisplay(t.distance,"m")),g(),A(t.timeToGo!==null?4:-1)}}function lme(n,e){if(n&1&&j(0,"fb-s57-chart",47),n&2){let t=v(),i=t.$implicit,r=t.$index;w("zIndex",10+r)("chart",i)}}function cme(n,e){if(n&1&&j(0,"fb-mapstylejson-chart",47),n&2){let t=v(),i=t.$implicit,r=t.$index;w("zIndex",10+r)("chart",i)}}function dme(n,e){if(n&1&&j(0,"fb-tilejson-chart",48),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 ume(n,e){if(n&1&&j(0,"fb-wms-chart",48),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 pme(n,e){if(n&1&&j(0,"fb-wmts-chart",48),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 hme(n,e){if(n&1&&j(0,"fb-tilelayer-vector",48),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 mme(n,e){if(n&1&&j(0,"fb-tilelayer-raster",48),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 fme(n,e){if(n&1&&R(0,lme,1,2,"fb-s57-chart",47)(1,cme,1,2,"fb-mapstylejson-chart",47)(2,dme,1,4,"fb-tilejson-chart",48)(3,ume,1,4,"fb-wms-chart",48)(4,pme,1,4,"fb-wmts-chart",48)(5,hme,1,4,"fb-tilelayer-vector",48)(6,mme,1,4,"fb-tilelayer-raster",48),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 gme(n,e){if(n&1){let t=H();u(0,"fb-radar",49),T("onError",function(r){O(t);let o=v();return F(o.handleRadarError(r))}),p()}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 _me(n,e){if(n&1&&j(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 yme(n,e){if(n&1&&j(0,"ais-targets-track",15),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",10)("updateIds",t.skstream.aisStatus().updated)("removeIds",t.skstream.aisStatus().expired)("mapZoom",t.mapZoomLevel())("zIndex",110)}}function vme(n,e){if(n&1&&(u(0,"div"),j(1,"fb-resource-sets",50),p()),n&2){let t=e.$implicit,i=e.$index,r=v();g(),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 bme(n,e){if(n&1&&j(0,"fb-route-direction",17),n&2){let t=v();w("points",t.course.courseData().activeRoutePoints)("pointIndex",t.course.courseData().pointIndex)("reverse",t.app.data.activeRouteReversed)("zIndex",550)}}function xme(n,e){if(n&1&&j(0,"sk-ais-targets",21),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 Cme(n,e){if(n&1&&j(0,"sk-ais-wind",51),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 wme(n,e){if(n&1&&(u(0,"div"),R(1,Cme,1,15,"sk-ais-wind",51),j(2,"sk-ais-flags",52)(3,"sk-ais-vessels",53),p()),n&2){let t=v();g(),A(t.mapZoomLevel()>=t.app.config.vessels.aisWindMinZoom?1:-1),g(),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),g(),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 Sme(n,e){if(n&1&&j(0,"sk-ais-targets",22),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 Mme(n,e){if(n&1&&j(0,"sk-ais-targets",23),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 Tme(n,e){if(n&1&&j(0,"fb-notes",26),n&2){let t=v();w("notes",t.plotterExt.visibleNotes())("zIndex",450)}}function Eme(n,e){if(n&1){let t=H();u(0,"ol-overlay",27)(1,"ap-popover",54),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())}),p()(),j(2,"fb-bearing-line",55)}if(n&2){let t=v();w("position",t.overlay().position)("positioning","top-center"),g(),w("title",t.overlay().title)("canClose",!1)("measure",!0)("navTo",!0),g(),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 Ime(n,e){if(n&1){let t=H();u(0,"ap-popover",66),T("closed",function(){O(t);let r=v(2);return F(r.popoverClosed())}),p()}if(n&2){let t=v(2);w("title",t.overlay().title)("canClose",!1)("measure",!0)}}function Dme(n,e){if(n&1){let t=H();u(0,"chart-list-popover",67),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())}),p()}if(n&2){let t=v(2);w("canClose",t.app.config.map.popoverMulti)("features",t.overlay().content)}}function kme(n,e){if(n&1){let t=H();u(0,"feature-list-popover",68),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())}),p()}if(n&2){let t=v(2);w("canClose",t.app.config.map.popoverMulti)("title",t.overlay().title)("features",t.overlay().content)}}function Pme(n,e){if(n&1){let t=H();u(0,"s57-popover",69),T("closed",function(){O(t);let r=v(2);return F(r.popoverClosed())}),p()}if(n&2){let t=v(2);w("canClose",t.app.config.map.popoverMulti)("properties",t.overlay().s57Feature)}}function Rme(n,e){if(n&1){let t=H();u(0,"ap-popover",70),T("closed",function(){O(t);let r=v(2);return F(r.popoverClosed())}),u(1,"div",71)(2,"mat-icon",72),_(3,"water"),p(),u(4,"div",73)(5,"div",74)(6,"mat-icon",75),_(7,"air"),p(),u(8,"span"),_(9),p()(),u(10,"div",74)(11,"mat-icon",75),_(12,"explore"),p(),u(13,"span"),_(14),p()()()()()}if(n&2){let t,i,r=v(2);w("canClose",r.app.config.map.popoverMulti)("compact",!0),g(9),X((t=r.overlay().tidal)==null?null:t.speedLabel),g(5),X((i=r.overlay().tidal)==null?null:i.directionLabel)}}function Lme(n,e){if(n&1){let t=H();u(0,"resource-popover",76),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())})("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.itemInfo(r.overlay().id,r.overlay().type),F(r.popoverClosed())})("closed",function(){O(t);let r=v(2);return F(r.popoverClosed())}),p()}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())}}function Ame(n,e){if(n&1){let t=H();u(0,"resourceset-popover",77),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())}),p()}if(n&2){let t=v(2);w("canClose",t.app.config.map.popoverMulti)("title",t.overlay().title)("resource",t.overlay().resource)}}function Ome(n,e){if(n&1){let t=H();u(0,"div")(1,"vessel-popover",78),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())}),p()()}if(n&2){let t=v(2);g(),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 Fme(n,e){if(n&1){let t=H();u(0,"aton-popover",79),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())}),p()}if(n&2){let t=v(2);w("canClose",t.app.config.map.popoverMulti)("aton",t.overlay().aton)}}function Nme(n,e){if(n&1){let t=H();u(0,"aircraft-popover",80),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())}),p()}if(n&2){let t=v(2);w("canClose",t.app.config.map.popoverMulti)("aircraft",t.overlay().aircraft)}}function Bme(n,e){if(n&1){let t=H();u(0,"alarm-popover",81),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())}),p()}if(n&2){let t=v(2);w("canClose",t.app.config.map.popoverMulti)("alarm",t.overlay().alarm)("id",t.overlay().id)}}function Vme(n,e){if(n&1&&(u(0,"ol-overlay",27),R(1,Ime,1,3,"ap-popover",56),R(2,Dme,1,2,"chart-list-popover",57),R(3,kme,1,3,"feature-list-popover",58),R(4,Pme,1,2,"s57-popover",59),R(5,Rme,15,4,"ap-popover",60),R(6,Lme,1,8,"resource-popover",61),R(7,Ame,1,3,"resourceset-popover",62),R(8,Ome,2,5,"div"),R(9,Fme,1,2,"aton-popover",63),R(10,Nme,1,2,"aircraft-popover",64),R(11,Bme,1,3,"alarm-popover",65),p()),n&2){let t=v();w("position",t.overlay().position)("positioning","top-center"),g(),A(t.mapInteract.isMeasuring()?1:-1),g(),A(t.overlay().type==="chartlist"?2:-1),g(),A(t.overlay().type==="list"?3:-1),g(),A(t.overlay().type==="s57"?4:-1),g(),A(t.overlay().type==="tidal"?5:-1),g(),A(t.overlay().type==="destination"||t.overlay().type==="waypoint"||t.overlay().type==="route"||t.overlay().type==="note"||t.overlay().type==="region"?6:-1),g(),A(t.overlay().type==="rset"?7:-1),g(),A(t.overlay().type==="ais"?8:-1),g(),A(t.overlay().type==="aton"||t.overlay().type==="meteo"?9:-1),g(),A(t.overlay().type==="aircraft"?10:-1),g(),A(t.overlay().type==="alarm"?11:-1)}}function Gme(n,e){if(n&1&&j(0,"fb-anchor-alarm",28),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 jme(n,e){if(n&1&&j(0,"fb-cpa-alarms",29),n&2){let t=v();w("cpaLines",t.dfeat.closest)("zIndex",350)}}function zme(n,e){if(n&1&&j(0,"fb-xte-path",82),n&2){let t=v(2);w("startPosition",t.dfeat.navData.startPosition)("destPosition",t.dfeat.navData.position)("zIndex",340)("visible",!0)}}function Wme(n,e){if(n&1&&j(0,"fb-target-angle",84)(1,"fb-layline",85),n&2){let t=v(2);w("line",t.perfTargetAngle())("lineStyle",t.featureStyles.targetAngle)("position",t.app.data.vessels.active.position)("twd",t.app.data.vessels.self.wind.direction)("mapZoom",t.mapZoomLevel())("zIndex",345),g(),w("lines",t.perfLaylines())("laylineStyles",t.featureStyles.layline)("position",t.app.data.vessels.active.position)("twd",t.app.data.vessels.self.wind.direction)("mapZoom",t.mapZoomLevel())("zIndex",330)}}function Ume(n,e){if(n&1&&j(0,"fb-bearing-line",55),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 Hme(n,e){if(n&1&&j(0,"fb-arrival-circle",83),n&2){let t=v(2);w("radius",t.course.courseData().arrivalCircle)("position",t.dfeat.navData.position)("zIndex",335)}}function Kme(n,e){if(n&1&&(R(0,zme,1,4,"fb-xte-path",82),R(1,Wme,2,12),R(2,Ume,1,8,"fb-bearing-line",55),R(3,Hme,1,3,"fb-arrival-circle",83)),n&2){let t=v();A(t.dfeat.navData.startPosition?0:-1),g(),A(t.app.config.vessels.laylines&&t.perfTargetAngle().length!==0?1:-1),g(),A(t.dfeat.navData.position?2:-1),g(),A(t.course.courseData().arrivalCircle?3:-1)}}function $me(n,e){if(n&1&&j(0,"fb-range-circles",31),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 qme(n,e){if(n&1&&j(0,"fb-heading-line",32),n&2){let t=v();w("coords",t.vesselLines().heading)("lineStyle",t.app.selfLines().heading)("mapZoom",t.mapZoomLevel())("zIndex",344)}}function Zme(n,e){if(n&1&&j(0,"fb-cog-line",33),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 Xme(n,e){if(n&1&&j(0,"fb-wind-lines",34),n&2){let t=v();w("twd",t.dfeat.active.wind.direction)("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 Yme(n,e){if(n&1&&j(0,"fb-vessel-trail",36),n&2){let t=v();w("localTrail",t.app.selfTrail())("serverTrail",t.app.selfTrailFromServer())("zIndex",990)}}function Qme(n,e){if(n&1&&j(0,"fb-chart-bounds",39),n&2){let t=v();w("zIndex",250)("charts",t.app.data.chartBounds.charts)("layerProperties",Eo(3,Jhe))}}function Jme(n,e){if(n&1){let t=H();u(0,"button",89),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"),p(),_(3," Navigate to here "),p()}}function efe(n,e){n&1&&(u(0,"span"),_(1,"Clear Active Route"),p())}function tfe(n,e){n&1&&(u(0,"span"),_(1,"Clear Destination"),p())}function ife(n,e){if(n&1){let t=H();u(0,"button",90),T("click",function(){O(t);let r=v().item,o=v();return F(o.onContextMenuAction("cleardestination",r))}),u(1,"mat-icon"),_(2,"clear_all"),p(),R(3,efe,2,0,"span")(4,tfe,2,0,"span"),p()}if(n&2){let t=v(2);g(3),A(t.app.data.activeRoute?3:4)}}function nfe(n,e){n&1&&j(0,"mat-divider")}function rfe(n,e){if(n&1){let t=H();u(0,"button",87),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"),p(),_(3," Add Note here "),p()}}function ofe(n,e){if(n&1){let t=H();u(0,"button",89),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"),p(),_(3," Bearing & Distance "),p()}}function afe(n,e){if(n&1){let t=H();u(0,"button",90),T("click",function(){O(t);let r=v().item,o=v();return F(o.onContextMenuAction("cleartrail",r))}),u(1,"mat-icon"),_(2,"clear_all"),p(),u(3,"span"),_(4),p()()}if(n&2){let t=v(2);g(4),q("",t.app.data.serverTrail?"Refresh":"Clear"," Trail")}}function sfe(n,e){if(n&1){let t=H();u(0,"button",90),T("click",function(){O(t);let r=v().item,o=v();return F(o.onContextMenuAction("weather_forecast",r))}),u(1,"mat-icon"),_(2,"air"),p(),u(3,"span"),_(4,"Weather Forecast"),p()()}}function lfe(n,e){if(n&1){let t=H();u(0,"button",90),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"),p(),u(3,"span"),_(4,"Get Feature Info"),p()()}}function cfe(n,e){if(n&1){let t=H();j(0,"mat-divider"),u(1,"button",87),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"),p(),_(4," Add widget here "),p()}}function dfe(n,e){if(n&1){let t=H();R(0,Jme,4,0,"button",86),R(1,ife,5,1,"button",86),R(2,nfe,1,0,"mat-divider"),u(3,"button",87),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",88),_(5,"add_location"),p(),_(6," Add Waypoint here "),p(),R(7,rfe,4,0,"button",86),j(8,"mat-divider"),R(9,ofe,4,0,"button",86),u(10,"button",87),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"),p(),_(13," Measure "),p(),j(14,"mat-divider"),R(15,afe,5,1,"button",86),u(16,"button",87),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"),p(),_(19," Trail to Route "),p(),j(20,"mat-divider"),u(21,"button",87),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"),p(),_(24," Anchor Watch "),p(),R(25,sfe,5,0,"button",86),R(26,lfe,5,0,"button",86),R(27,cfe,5,0)}if(n&2){let t=v();A(t.app.data.vessels.showSelf?0:-1),g(),A(t.course.courseData().position?1:-1),g(),A(t.app.data.vessels.showSelf||t.course.courseData().position?2:-1),g(5),A(t.mapZoomLevel()>=t.app.config.resources.notes.minZoom?7:-1),g(2),A(t.app.data.vessels.showSelf?9:-1),g(6),A(t.app.config.vessels.trail&&t.app.selfTrail().length!==0?15:-1),g(10),A(t.app.featureFlags().weatherApi?25:-1),g(),A(t.app.config.experiments&&t.mapService.featureUrls().length?26:-1),g(),A(t.addableWidgetCell?27:-1)}}var NE=class n{setFocus;mapCenter=[0,0];mapZoom=1;movingMap=!1;northUp=!0;measureMode;drawMode;modifyMode=!1;activeRoute;vesselTrail=[];dblClickZoom=!1;overZoomTiles=!0;drawEnded=new pe;activate=new pe;deactivate=new pe;info=new pe;exitMovingMap=new pe;focusVessel=new pe;menuItemSelected=new pe;contextMenu;olMap;scaleUnits=Z("");perfLaylines=J({port:[],starboard:[]});perfTargetAngle=J([]);vesselLines=J({cog:[],heading:[]});overlay=J({id:null,type:null,icon:null,position:[0,0],show:!1,title:"",content:null,featureCount:0,readOnly:!1,isSelf:!1});olMapControls=MB;olMapInteractions=J([]);mapZoomLevel=J(1);mapCenterPositon=J([0,0]);mapRotation=J(0);showNoteslayer=J(!1);featureStyles={route:IB,region:PB,anchor:kB,alarm:RB,destination:LB,aircraft:AB,sar:OB,layline:FB,targetAngle:NB,raceCourse:EB,bearingDistance:TB};draftRouteStyles=DB;bufferRoutes=Fi(()=>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 _d,ais:new Map,active:new _d,navData:{position:null,startPosition:null},closest:[]};saveTimer;isDirty=!1;mouse=J({pixel:null,coords:[0,0],xy:null});cursorInfo=J(null);contextMenuPosition={x:"0px",y:"0px"};addableWidgetCell=null;obsList=[];http=M(Ia);app=M(re);skres=M(Dt);skresOther=M(bu);skstream=M(Za);anchor=M(Of);notiMgr=M(il);plotterExt=M(Mf);course=M(Mo);mapInteract=M(gc);mapService=M(Sl);settings=M(uf);bottomSheet=M(Lu);infoPanel=M(wu);routeBuffers=M(_u);tidalCurrents=M(gd);ngZone=M(zi);constructor(){Te(()=>{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("trailFromServer")&&(this.app.config.vessels.trailFromServer||this.app.selfTrailFromServer.update(()=>[]))}))}ngOnDestroy(){this.stopSaveTimer(),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.startSaveTimer():this.stopSaveTimer(),this.centerVessel()),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.app.mapExtent()[0]<180&&this.app.mapExtent()[2]>180&&this.overlay().position[0]<0&&this.overlay().position[0]>-180&&this.overlay.update(i=>Object.assign({},i,{position:[i.position[0]+360,i.position[1]]}))),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:"keyboardzoom"},{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(pC,{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}}onMapMoveEnd(e){this.app.config.map.zoomLevel=e.zoom,this.app.mapExtent.update(()=>e.extent),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.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:di.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,Ja.getGreatCircleBearing)(this.mapInteract.measurement().coords.slice(-1)[0],t);this.overlay.update(o=>Object.assign({},o,{position:t,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,Ja.getGreatCircleBearing)(this.mapInteract.measurement().center??t,t);this.overlay.update(o=>Object.assign({},o,{position:t,title:`${this.app.formatValueForDisplay(i,"m")} ${this.app.formatValueForDisplay(r,"deg")}`}))}}}onMapPointerDrag(){!this.app.config.map.lockMoveMap&&this.app.uiConfig().mapMove&&this.ngZone.run(()=>this.exitMovingMap.emit(!0))}updateCursorInfo(e){let t=this.app.data.vessels.self;if(!this.app.config.display.statusBar?.liveEta||!t?.positionReceived||!t.position){this.cursorInfo.set(null);return}let i=We.transform(1,"m/s",this.app.config.units.speed)??1,r=this.app.config.display.statusBar.referenceSpeed,o=i>0&&typeof r=="number"?r/i:0;this.cursorInfo.set(SB(t.position,e,t.sog,o))}onMapPointerDown(e){this.mouse.update(t=>yi(he({},t),{coords:di.normaliseCoords(e.lonlat)})),this.contextMenuPosition.x=e.clientX+"px",this.contextMenuPosition.y=e.clientY+"px"}onMapSingleClick(e){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.isDrawing()&&!this.mapInteract.isModifying()&&(this.app.config.map.popoverMulti||this.overlay.update(t=>Object.assign({},t,{show:!1})),this.processMapClick(e))}onMapRightClick(e){this.app.data.map.atClick=e,this.app.debug("onRightClick()",this.app.data.map.atClick),this.mapInteract.isMeasuring()&&this.parseClickInMeasureMode(e.lonlat)}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=sn(e.coordinate);this.mapInteract.initBoxCoord(t)}onDragBoxEnd(e){let t=sn(e.coordinate);this.mapInteract.stopBoxSelection(t)}onDragBoxCancel(e){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=>sn(r));i=i.slice(0,i.length-1),this.mapInteract.measurementCoords=i,t=i}else{let i=e.feature.getGeometry(),r=sn(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,Ja.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=>sn(r)),t=t.slice(0,t.length-1))}),this.mapInteract.measurementCoords=t}}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 vs;t.name=e.name??"",t.description=e.description??"",t.feature.geometry.coordinates=e.points.map(r=>r.position);let i=e.points.map(r=>he(he({},r.name?{name:r.name}:{}),r.description?{description:r.description}:{}));return i.some(r=>Object.keys(r).length>0)&&(t.feature.properties.coordinatesMeta=i),t.distance=di.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)}saveRouteFromPopover(){return ee(this,null,function*(){try{yield this.plotterExt.saveBuffer(this.overlay().id,{dialog:!0})}catch(e){}})}modifyFeature(e){if(this.mapInteract.draw.features.getLength()!==0){if(this.mapInteract.startModifying(this.overlay()),this.overlay().type==="route"){let t=this.overlay().id;this.mapInteract.measurementCoords=this.routeBuffers.has(t)?this.routeBuffers.get(t).points.map(i=>i.position):this.skres.fromCache("routes",t)[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();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;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=sn(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)}processMapClick(e){this.s57Features={};let t=new Map,i=new Map,r=[],o=!1;if(e.features.forEach(a=>{let s=a.getId(),l=!1,c,d,h,m,f,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":y={svgIcon:"route",name:void 0,class:"icon-route"},l=!0;let D=this.getUnsavedRouteBuffer(S[1]);D?b=D.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,h=this.app.data.meteo.get(s),b=h?h.name||h.mmsi:"Weather Station";break;case"ais-vessels":y={name:"directions_boat",svgIcon:void 0},l=!0,f=this.dfeat.ais.get(`vessels.${S[1]}`),b=f?f.name||f.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"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&&CB.has(S.layer)&&(s=`s57.${S.LNAM}`,l=!0,y={name:"beenhere",svgIcon:void 0},b=FE[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))}),i.size>0){this.formatPopover("chartlist.",e.lonlat,i);return}if(!o)if(this.mapInteract.draw.features=new Dn(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={};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,readOnly:!1,isSelf:!1},o=null,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=di.distanceTo(this.app.data.vessels.self.position,t)??0,c=(0,Ja.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(h=>r.content.push(h)),r.show=!0;break;case"chartlist":r.type=a[0],r.content=[],i.forEach(h=>r.content.push(h)),r.show=!0;break;case"alarm":s=e.split(".").slice(1).join(".");let d=this.notiMgr.getAlert(s);if(!d)return!1;r.type=a[0],r.alarm=d,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"tidal":{let h=this.tidalFeatures[e];r.id=e,r.type="tidal",r.position=t,r.show=!0,r.readOnly=!0,h&&(r.tidal={speedLabel:this.tidalCurrents.formatSpeed(h.speedKn),directionLabel:`${this.app.formatValueForDisplay(h.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 h=this.getUnsavedRouteBuffer(a[1]);if(h){let m=this.bufferToFBRoute(h)[1];m.name=m.name||"(unsaved)",r.id=a[1],r.type="route",r.title="Route (unsaved)",r.resource=[a[1],m],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"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.resource=this.skresOther.fromResourceSetCache(e,!0),r.title=r.resource?.properties?.name??"Resource Set",r.show=!!r.resource;break;default:return}this.overlay.set(r)}featureListSelection(e){let t=new Dn;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 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}zoomMap(e){e?this.app.config.map.zoomLevel<this.app.MAP_ZOOM_EXTENT.max&&++this.app.config.map.zoomLevel:this.app.config.map.zoomLevel>this.app.MAP_ZOOM_EXTENT.min&&--this.app.config.map.zoomLevel}rotateMap(){this.northUp?this.mapRotation.set(0):this.mapRotation.update(()=>0-this.dfeat.active.orientation)}centerVessel(){let e=this.app.calcMapCenter();this.mapCenterPositon.update(()=>e)}drawVesselLines(e=!1){let t=this.mapZoomLevel(),i=t<29?hv[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=0;this.app.config.vessels.selfLines.heading.length===-1?s=(a>r?r:a)*i:s=We.nauticalMilesToKm(this.app.config.vessels.selfLines.heading.length)*1e3;let l=[this.dfeat.active.position,di.rhumbDestination(this.dfeat.active.position,this.dfeat.active.orientation,s)];return{cog:o,heading:l}})}buildLaylines(){if(this.app.config.vessels.laylines&&Array.isArray(this.dfeat.navData.position)&&typeof this.dfeat.navData.position[0]=="number"&&typeof this.app.data.vessels.active.heading=="number"){let e=We.radiansToDegrees(this.app.data.vessels.self.wind.direction??0),t=No.add(e,180),i=Math.abs(No.difference(this.course.courseData().bearing.value,e))<90,r=We.radiansToDegrees(this.app.data.vessels.self.performance.beatAngle??Math.PI/4),o,a;typeof this.app.data.vessels.self.performance.gybeAngle=="number"&&(o=We.radiansToDegrees(this.app.data.vessels.self.performance.gybeAngle),a=180-Math.abs(o));let s=i?Math.abs(No.difference(this.course.courseData().bearing.value,e))<r:Math.abs(No.difference(this.course.courseData().bearing.value,t))<(a??0),l=this.app.config.units.distance==="kilometer"?this.course.courseData().dtg*1e3:We.nauticalMilesToKm(this.course.courseData().dtg*1e3),c=[];if(i){let d=(0,Ja.computeDestinationPoint)(this.dfeat.navData.position,l,No.add(t,r)),h=(0,Ja.computeDestinationPoint)(this.dfeat.navData.position,l,No.add(t,0-r));c=[[d.longitude,d.latitude],this.dfeat.navData.position,[h.longitude,h.latitude]]}else if(typeof o=="number"){let d=(0,Ja.computeDestinationPoint)(this.dfeat.navData.position,l,No.add(t,o)),h=(0,Ja.computeDestinationPoint)(this.dfeat.navData.position,l,No.add(t,0-o));c=[[d.longitude,d.latitude],this.dfeat.navData.position,[h.longitude,h.latitude]]}if(this.perfTargetAngle.update(()=>c),s){let d=No.difference(e,this.course.courseData().bearing.value),h,m,f,y;if(i){let b=We.degreesToRadians(r-d),S=We.degreesToRadians(r+d),I=Math.PI-(S+b);h=l*Math.sin(S)/Math.sin(I),m=l*Math.sin(b)/Math.sin(I),f=(0,Ja.computeDestinationPoint)(this.app.data.vessels.active.position,h,No.add(e,r)),y=(0,Ja.computeDestinationPoint)(this.app.data.vessels.active.position,m,No.add(e,0-r))}else if(c.length!==0&&typeof a=="number"){let b=We.degreesToRadians(a-d),S=We.degreesToRadians(a+d),I=Math.PI-(S+b);h=l*Math.sin(S)/Math.sin(I),m=l*Math.sin(b)/Math.sin(I),f=(0,Ja.computeDestinationPoint)(this.app.data.vessels.active.position,h,No.add(e,a)),y=(0,Ja.computeDestinationPoint)(this.app.data.vessels.active.position,m,No.add(e,0-a))}this.perfLaylines.update(()=>({port:[[[y.longitude,y.latitude],this.app.data.vessels.active.position],[[f.longitude,f.latitude],this.app.data.vessels.active.position]],starboard:[[[f.longitude,f.latitude],c[1]],[c[1],[y.longitude,y.latitude]]]}))}}}deleteFeature(e,t){return ee(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}})}setActiveFeature(){this.overlay().type==="waypoint"?this.course.navigateToWaypoint(this.overlay().id):this.activate.emit(this.overlay().id)}clearActiveFeature(){this.deactivate.emit(this.overlay().id)}itemInfo(e,t,i=!1){t==="ais"&&i?this.info.emit({id:e,type:"self"}):this.info.emit({id:e,type:t})}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"?Sp.radius:Sp.measure:Sp.default),e===1&&(this.mapInteract.draw.style=this.mapInteract.draw.resourceType==="route"?Sp.route:this.mapInteract.draw.resourceType==="region"?Sp.region:Sp.default)}isCoordsArray(e){return Array.isArray(e)?Array.isArray(e[0])&&typeof e[0][0]=="number":!1}transformCoordsArray(e){return e.map(t=>sn(t))}applyStyle(){return new fe({fill:new Be({color:"#e0d10e"}),stroke:new xe({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=di.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:We.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(){let e=[].concat(this.mapService.featureUrls())}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=W({type:n,selectors:[["fb-map"]],viewQuery:function(t,i){if(t&1&&Ht(Qa,7)(Yhe,5),t&2){let r;De(r=ke())&&(i.contextMenu=r.first),De(r=ke())&&(i.olMap=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",focusVessel:"focusVessel",menuItemSelected:"menuItemSelected"},features:[Me],decls:71,vars:128,consts:[["olMap",""],["contextMenu","matMenu"],["olView","",3,"mapMoveEnd","mapSingleClick","mapRightClick","mapPointerDown","mapPointerMove","mapPointerDrag","mapContextMenu","contextmenu","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,"params","layerDefs","zIndex"],[3,"position","heading","mapZoom","zIndex","opacity"],[3,"darkMode","tracks","labelMinZoom","mapZoom","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","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","zIndex"],[3,"localTrail","serverTrail","trailStyles","zIndex"],[3,"show","opacity","indicator"],[3,"show","opacity"],[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,"canClose","compact"],[3,"canClose","title","type","resource","active","featureCount","units","canSave"],[3,"canClose","title","resource"],[3,"canClose","aton"],[3,"canClose","aircraft"],[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","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","addNote","activated","deactivated","related","notes","info","points","closed","canClose","title","type","resource","active","featureCount","units","canSave"],[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,"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"],["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",2,0),T("mapMoveEnd",function(o){return i.onMapMoveEnd(o)})("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)}),R(2,eme,1,0,"ol-dragbox"),R(3,tme,1,4,"ol-draw",3),R(4,ime,1,4,"ol-draw",4),R(5,nme,1,1,"ol-modify",5),u(6,"ol-control")(7,"ol-content")(8,"div",6)(9,"button",7),T("click",function(){return i.zoomMap(!1)}),u(10,"mat-icon"),_(11,"remove"),p()(),_(12," \xA0 "),u(13,"button",8),T("click",function(){return i.zoomMap(!0)}),u(14,"mat-icon"),_(15,"add"),p()()()()(),u(16,"ol-control")(17,"ol-content")(18,"div",9)(19,"span",10),R(20,rme,2,0,"span"),j(21,"span",11),St(22,"coords"),_(23," \xA0 "),R(24,ome,2,0,"span"),j(25,"span",11),St(26,"coords"),_(27," \xA0 "),j(28,"span",11),R(29,sme,5,4),p()()()(),Oe(30,fme,7,1,null,null,GB),j(32,"fb-livelayer",12),R(33,gme,1,5,"fb-radar",13),R(34,_me,1,5,"fb-tracks",14),R(35,yme,1,8,"ais-targets-track",15),Oe(36,vme,2,6,"div",null,GB),j(38,"fb-routes",16)(39,"fb-routes",16),R(40,bme,1,4,"fb-route-direction",17),j(41,"fb-waypoints",18)(42,"sk-ais-targets",19)(43,"sk-ais-targets",20),R(44,xme,1,10,"sk-ais-targets",21),R(45,wme,4,30,"div"),R(46,Sme,1,10,"sk-ais-targets",22),R(47,Mme,1,10,"sk-ais-targets",23),j(48,"racing-start-line",24)(49,"fb-regions",25),R(50,Tme,1,2,"fb-notes",26),R(51,Eme,3,13),R(52,Vme,12,13,"ol-overlay",27),R(53,Gme,1,5,"fb-anchor-alarm",28),R(54,jme,1,2,"fb-cpa-alarms",29),j(55,"fb-alarms",30),R(56,Kme,4,4),R(57,$me,1,9,"fb-range-circles",31),R(58,qme,1,4,"fb-heading-line",32),R(59,Zme,1,8,"fb-cog-line",33),R(60,Xme,1,6,"fb-wind-lines",34),j(61,"fb-vessel",35),R(62,Yme,1,3,"fb-vessel-trail",36),j(63,"fb-weather-wind",37)(64,"fb-weather-currents",38)(65,"fb-tidal-currents",38),R(66,Qme,1,4,"fb-chart-bounds",39),p(),j(67,"div",40),u(68,"mat-menu",41,1),T("contextmenu",function(o){return o.preventDefault()}),ct(70,dfe,28,9,"ng-template",42),p()),t&2){let r,o=Le(69);Nt("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),g(2),A(i.mapInteract.isBoxSelecting()?2:-1),g(),A(i.mapInteract.isMeasuring()?3:-1),g(),A(i.mapInteract.isDrawing()?4:-1),g(),A(i.mapInteract.isModifying()&&i.mapInteract.draw.features?5:-1),g(4),w("disabled",i.mapZoomLevel()<=i.app.MAP_ZOOM_EXTENT.min),g(4),w("disabled",i.mapZoomLevel()>=i.app.MAP_ZOOM_EXTENT.max),g(5),Nt("bottom",i.plotterExt.statusBarLift()>0?i.plotterExt.statusBarLift()+"px":null),g(2),A(i.app.config.units.positionFormat==="XY"?20:-1),g(),w("innerText",Oi(22,121,i.mouse().coords[1],i.app.config.units.positionFormat,!0)),g(3),A(i.app.config.units.positionFormat==="XY"?24:-1),g(),w("innerText",Xn(26,125,i.mouse().coords[0],i.app.config.units.positionFormat)),g(3),w("innerText","Zm: "+i.mapZoomLevel().toFixed(1)),g(),A((r=i.cursorInfo())?29:-1,r),g(),Fe(i.skres.charts()),g(2),w("params",i.skresOther.infoLayerParams())("layerDefs",i.skresOther.infoLayers())("zIndex",50),g(),A(i.app.uiCtrl().radarLayer?33:-1),g(),A(i.app.featureFlags().resourceTracks?34:-1),g(),A(i.app.config.ui.showAisTargets&&(i.app.config.vessels.aisShowTrack||i.app.data.vessels.showTrack.length>0)?35:-1),g(),Fe(i.skresOther.resourceSets()),g(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),g(),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),g(),A(i.activeRoute&&!i.app.data.activeRouteIsEditing?40:-1),g(),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),g(),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),g(),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),g(),A(i.app.config.ui.showAisTargets?44:-1),g(),A(i.app.config.ui.showAisTargets?45:-1),g(),A(i.app.config.ui.showAisTargets?46:-1),g(),A(i.app.config.ui.showAisTargets?47:-1),g(),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),g(),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),g(),A(i.showNoteslayer()?50:-1),g(),A(i.overlay().show&&i.overlay().type==="bearing_dist"?51:-1),g(),A(i.overlay().show&&!i.mapInteract.isModifying()?52:-1),g(),A(i.anchor.raised()?-1:53),g(),A(i.dfeat.closest.length!==0?54:-1),g(),w("alarms",i.notiMgr.mobAlerts())("alarmStyles",i.featureStyles.alarm)("zIndex",995),g(),A(i.anchor.raised()&&i.dfeat.navData.position?56:-1),g(),A(i.app.config.vessels.rangeCircles?57:-1),g(),A(i.app.config.vessels.selfLines.cog.length!==0?58:-1),g(),A(i.app.config.vessels.selfLines.cog.length!==0?59:-1),g(),A(i.app.config.vessels.windVectors?60:-1),g(),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)("zIndex",999),g(),A(i.app.config.vessels.trail&&i.app.data.vessels.showSelf?62:-1),g(),w("show",i.app.config.selections.weatherWindEnabled)("opacity",.55)("indicator",i.app.config.display.windIndicator),g(),w("show",i.app.config.selections.oceanCurrentsEnabled)("opacity",.55),g(),w("show",i.app.config.selections.tidalCurrentsEnabled)("opacity",.7),g(),A(i.app.data.chartBounds.show?66:-1),g(),Nt("left",i.contextMenuPosition.x)("top",i.contextMenuPosition.y),w("matMenuTriggerFor",o)}},dependencies:[ve,Ie,xn,Da,ae,le,ue,Ms,qe,nl,la,wa,wN,Qa,hf,Wh,tu,eu,Ee,zh,iu,Yh,Qh,Jh,em,am,sm,lu,cm,pm,um,df,hm,mm,fm,gm,_m,ym,vm,bm,xm,Cm,Sm,Mm,wm,Tm,Em,Im,Dm,km,Pm,Rm,Lm,Am,pf,Vm,ef,tf,nf,rf,of,cf,Lr,rC,oC,lC,aC,sC,Qx,Jx,nC,cC,dC,uC,p1,dn],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}.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 ufe=["button"],pfe=["*"];function hfe(n,e){if(n&1&&(u(0,"div",2),j(1,"mat-pseudo-checkbox",6),p()),n&2){let t=v();g(),w("disabled",t.disabled)}}var jB=new Ct("MAT_BUTTON_TOGGLE_DEFAULT_OPTIONS",{providedIn:"root",factory:()=>({hideSingleSelectionIndicator:!1,hideMultipleSelectionIndicator:!1,disabledInteractive:!1})}),zB=new Ct("MatButtonToggleGroup"),mfe={provide:as,useExisting:is(()=>BE),multi:!0},hC=class{source;value;constructor(e,t){this.source=e,this.value=t}},BE=(()=>{class n{_changeDetector=M(oe);_dir=M(oo,{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(rr).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 pe;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 pe;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(jB,{optional:!0});this.appearance=t&&t.appearance?t.appearance:"standard",this._hideSingleSelectionIndicator=t?.hideSingleSelectionIndicator??!1,this._hideMultipleSelectionIndicator=t?.hideMultipleSelectionIndicator??!1}ngOnInit(){this._selectionModel=new J1(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||ws(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 hC(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=st({type:n,selectors:[["mat-button-toggle-group"]],contentQueries:function(i,r,o){if(i&1&&an(o,mC,5),i&2){let a;De(a=ke())&&(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&&(lt("role",r.multiple?"group":"radiogroup")("aria-disabled",r.disabled),yt("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:[Rt([mfe,{provide:zB,useExisting:n}])]})}return n})(),mC=(()=>{class n{_changeDetectorRef=M(oe);_elementRef=M(wt);_focusMonitor=M(Ho);_idGenerator=M(rr);_animationDisabled=Yn();_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 pe;constructor(){M(Ir).load($r);let t=M(zB,{optional:!0}),i=M(new Fl("tabindex"),{optional:!0})||"",r=M(jB,{optional:!0});this._tabIndex=J(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 hC(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=W({type:n,selectors:[["mat-button-toggle"]],viewQuery:function(i,r){if(i&1&&Ht(ufe,5),i&2){let o;De(o=ke())&&(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&&(lt("aria-label",null)("aria-labelledby",null)("id",r.id)("name",null),yt("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:pfe,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&&(ge(),u(0,"button",1,0),T("click",function(){return r._onButtonClick()}),R(2,hfe,2,1,"div",2),u(3,"span",3),ce(4),p()(),j(5,"span",4)(6,"span",5)),i&2){let o=Le(1);w("id",r.buttonId)("disabled",r.disabled&&!r.disabledInteractive||null),lt("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),g(2),A(r.buttonToggleGroup&&(!r.buttonToggleGroup.multiple&&!r.buttonToggleGroup.hideSingleSelectionIndicator||r.buttonToggleGroup.multiple&&!r.buttonToggleGroup.hideMultipleSelectionIndicator)?2:-1),g(4),w("matRippleTrigger",o)("matRippleDisabled",r.disableRipple||r.disabled)}},dependencies:[Ko,AI],styles:[`.mat-button-toggle-standalone,
3872
+ `;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"?We.radiansToDegrees(e)?.toFixed(1):"--"}static \u0275fac=function(t){return new(t||n)(Q(re),Q(Zx))};static \u0275cmp=W({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),Oe(2,npe,5,2,"button",2,ft),p(),u(4,"mat-menu",null,1),Oe(6,ape,5,2,"button",2,epe),p(),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"),p()()(),u(14,"mat-card-content")(15,"div",8)(16,"div",9),_(17," Autopilot"),j(18,"br"),_(19),p(),u(20,"div",10)(21,"div",11)(22,"div",12),R(23,spe,2,0,"span")(24,lpe,2,0,"span"),p()(),u(25,"div",13)(26,"div",14),R(27,cpe,2,1,"span")(28,dpe,2,0,"span"),_(29," \xB0 "),p()(),u(30,"div",15)(31,"div",12),R(32,upe,2,1,"span")(33,ppe,2,0,"span"),p(),u(34,"div",12),R(35,hpe,2,1,"span")(36,mpe,2,0,"span"),p()()(),u(37,"div",16)(38,"div",17),R(39,fpe,2,7,"button",18)(40,gpe,1,3,"mat-slide-toggle",19),p(),u(41,"div"),R(42,_pe,2,2,"button",20),p()(),R(43,ype,13,4,"div",21)(44,vpe,13,4,"div",21),u(45,"div",21)(46,"div",6),R(47,bpe,2,5,"button",22),p()()()()()()),t&2&&(g(2),Fe(i.modeOptions()),g(4),Fe(i.stateOptions()),g(13),q(" ",i.apData().default??""," "),g(4),A(i.apData().default?23:24),g(4),A(i.apData().default||i.apData().state==="off-line"?27:28),g(5),A(i.apData().default||i.apData().state==="off-line"?32:33),g(3),A(i.apData().default||i.apData().state==="off-line"?35:36),g(4),A(i.stateOptions().length>2?39:40),g(3),A(i.modeOptions().length!==0?42:-1),g(),A(i.apData().mode==="dodge"?43:44),g(4),A(i.dodgeAction()?47:-1))},dependencies:[ve,Ie,hn,Fn,px,el,ff,ue,Ze,Ms,qe,Tt,Ot,ae,le,nl,la,wa,Qa,aa,Go,Mt],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 Xx="/resources/buddies",Yx=class n{constructor(e,t){this.signalk=e;this.app=t}list(){return this.signalk.api.get(this.app.skApiVersion,`${Xx}`)}add(e,t){return this.signalk.api.post(this.app.skApiVersion,`${Xx}`,{urn:e,name:t})}update(e,t){return this.signalk.api.put(this.app.skApiVersion,`${Xx}/${e}`,{name:t})}remove(e){return this.signalk.api.delete(this.app.skApiVersion,`${Xx}/${e}`)}static \u0275fac=function(t){return new(t||n)(ot(Ft),ot(re))};static \u0275prov=et({token:n,factory:n.\u0275fac,providedIn:"root"})};var xpe=["*"],fB=class n{closed=we();infoPanel=M(wu);close(){this.infoPanel.close(),this.closed.emit()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=W({type:n,selectors:[["info-panel"]],outputs:{closed:"closed"},ngContentSelectors:xpe,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&&(ge(),u(0,"div",0)(1,"mat-nav-list",1)(2,"a",2),T("click",function(){return i.close()}),u(3,"mat-icon"),_(4,"close"),p()(),j(5,"mat-divider"),p()(),u(6,"div",3),ce(7),p())},dependencies:[xn,Es,po,Da,ae,le],encapsulation:2,changeDetection:0})};var Cpe=["*"],wpe=(n,e)=>({measure:n,compact:e}),Spe=n=>({measure:n});function Mpe(n,e){if(n&1&&(u(0,"mat-icon"),j(1,"country-flag",7),p()),n&2){let t=v(2);g(),w("mmsi",t.mmsi)("host",t.app.hostDef.url)}}function Tpe(n,e){if(n&1&&j(0,"mat-icon",8),n&2){let t=v(2);Pt(t.icon==null?null:t.icon.class),w("svgIcon",t.icon.svgIcon)}}function Epe(n,e){if(n&1&&(u(0,"mat-icon"),_(1),p()),n&2){let t=v(2);Pt(t.icon==null?null:t.icon.class),g(),X(t.icon==null?null:t.icon.name)}}function Ipe(n,e){if(n&1&&_(0),n&2){let t=v(2);q(" \xA0",t.title," ")}}function Dpe(n,e){if(n&1){let t=H();u(0,"div")(1,"button",9),T("click",function(){O(t);let r=v(2);return F(r.handleClose())}),u(2,"mat-icon"),_(3,"close"),p()()()}}function kpe(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.handleNavTo())}),u(2,"mat-icon"),_(3,"near_me"),p()()()}}function Ppe(n,e){if(n&1&&(u(0,"div",1)(1,"div",4),R(2,Mpe,2,2,"mat-icon"),R(3,Tpe,1,3,"mat-icon",5)(4,Epe,2,3,"mat-icon",6),R(5,Ipe,1,1),p(),R(6,Dpe,4,0,"div"),R(7,kpe,4,0,"div"),p()),n&2){let t=v();g(),w("ngClass",vn(6,Spe,t.measure)),g(),A(t.mmsi?2:-1),g(),A(t.icon!=null&&t.icon.svgIcon?3:t.icon!=null&&t.icon.name?4:-1),g(2),A(t.title?5:-1),g(),A(t.canClose?6:-1),g(),A(!t.canClose&&t.navTo?7:-1)}}var Lr=class n{title;mmsi;icon;canClose=!0;measure=!1;compact=!1;navTo=!1;closed=new pe;navigateTo=new pe;app=M(re);constructor(){}handleClose(){this.closed.emit()}handleNavTo(){this.navigateTo.emit()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=W({type:n,selectors:[["ap-popover"]],inputs:{title:"title",mmsi:"mmsi",icon:"icon",canClose:"canClose",measure:"measure",compact:"compact",navTo:"navTo"},outputs:{closed:"closed",navigateTo:"navigateTo"},ngContentSelectors:Cpe,decls:5,vars:5,consts:[[1,"popover","top","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&&(ge(),u(0,"div",0),R(1,Ppe,8,8,"div",1),u(2,"div",2),ce(3),p(),j(4,"div",3),p()),t&2&&(w("ngClass",rs(2,wpe,i.measure,i.compact)),g(),A(i.title||i.icon||i.mmsi||i.canClose||i.navTo?1:-1))},dependencies:[hn,Fn,ue,Ne,ve,Ie,ae,le,wx],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-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[_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.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-action-button[_ngcontent-%COMP%]{flex:1 1 45%}.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})};function Rpe(n,e){if(n&1&&j(0,"h1",8),n&2){let t=e.$implicit;w("remarkNode",t)}}function Lpe(n,e){if(n&1&&(u(0,"remark",1),ct(1,Rpe,1,1,"ng-template",7),p()),n&2){let t=v();w("processor",t.mdProcessor)("markdown",t.resource()[1].description??"")}}function Ape(n,e){if(n&1&&j(0,"div",2),n&2){let t=v();w("innerHTML",t.resource()[1].description??"",wd)}}function Ope(n,e){if(n&1&&(u(0,"div",10),_(1),p()),n&2){let t=v().$implicit;g(),q(" ",t[1]," ")}}function Fpe(n,e){if(n&1&&(j(0,"div",11),St(1,"coords")),n&2){let t=v().$implicit,i=v();w("innerText",Oi(1,1,t[1],i.app.config.units.positionFormat,!0))}}function Npe(n,e){if(n&1&&(j(0,"div",11),St(1,"coords")),n&2){let t=v().$implicit,i=v();w("innerText",Xn(1,1,t[1],i.app.config.units.positionFormat))}}function Bpe(n,e){if(n&1&&(u(0,"div",3)(1,"div",9),_(2),p(),R(3,Ope,2,1,"div",10),R(4,Fpe,2,5,"div",11),R(5,Npe,2,4,"div",11),p()),n&2){let t=e.$implicit;g(2),q("",t[0],":"),g(),A(t[0]!=="Latitude"&&t[0]!=="Longitude"?3:-1),g(),A(t[0]==="Latitude"?4:-1),g(),A(t[0]==="Longitude"?5:-1)}}function Vpe(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"),p(),_(4),p()()}if(n&2){let t=v();Nt("order",t.type()==="route"?1:null),g(),w("disabled",t.ctrl.isReadOnly),g(3),q(" ",t.ctrl.modifyLabel," ")}}function Gpe(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"),p(),_(4," ADD "),p()()}}function jpe(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.emitDelete())}),u(2,"mat-icon"),_(3,"delete"),p(),_(4," DELETE "),p()()}if(n&2){let t=v();Nt("order",t.type()==="route"?6:null),g(),w("disabled",t.ctrl.isReadOnly||t.ctrl.isActive)}}function zpe(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.emitActive(!0))}),u(2,"mat-icon"),_(3,"near_me"),p(),_(4),p()()}if(n&2){let t=v();Nt("order",t.type()==="route"?2:null),g(),w("matTooltip",t.type()==="waypoint"?"Navigate to Waypoint":"Navigate to first point"),g(3),q(" ",t.ctrl.activeText," ")}}function Wpe(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(!1))}),u(2,"mat-icon"),_(3,"clear_all"),p(),_(4," CLEAR "),p()()}if(n&2){let t=v();Nt("order",t.type()==="route"?2:null)}}function Upe(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.emitPoints())}),u(2,"mat-icon"),_(3,"location_on"),p(),_(4," POINTS "),p()()}if(n&2){let t=v();Nt("order",t.type()==="route"?3:null)}}function Hpe(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.emitRelated())}),u(2,"mat-icon"),_(3,"style"),p(),_(4," GROUP "),p()()}}function Kpe(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.emitNotes())}),u(2,"mat-icon"),_(3,"local_offer"),p(),_(4," NOTES "),p()()}if(n&2){let t=v();Nt("order",t.type()==="route"?4:null)}}function $pe(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.emitInfo())}),u(2,"mat-icon"),_(3,"info_outline"),p(),_(4," INFO "),p()()}if(n&2){let t=v();Nt("order",t.type()==="route"?5:null)}}function qpe(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.emitSave())}),u(2,"mat-icon"),_(3,"save"),p(),_(4," SAVE "),p()()}if(n&2){let t=v();Nt("order",t.type()==="route"?2:null)}}function Zpe(n,e){if(n&1&&(u(0,"div",5),_(1),p(),u(2,"div",6),_(3),p()),n&2){let t=v().$implicit;g(),q("",t[0],":"),g(2),q(" ",t[1]," ")}}function Xpe(n,e){if(n&1&&(u(0,"div",4)(1,"div",5),_(2),p(),u(3,"div",7),_(4),p()()),n&2){let t=v().$implicit;g(2),q("",t[0],":"),g(2),q(" ",t[1]," ")}}function Ype(n,e){if(n&1&&R(0,Zpe,4,2)(1,Xpe,5,2,"div",4),n&2){let t=e.$implicit;A(t[0]==="Description"?0:1)}}var gB='.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-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[_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.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-action-button[_ngcontent-%COMP%]{flex:1 1 45%}.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}',Qx=class n{mdProcessor=Fr;title=Z();resource=Z();type=Z();active=Z();featureCount=Z(0);units=Z("m");canClose=Z();canSave=Z(!1);modify=we();save=we();delete=we();addNote=we();activated=we();deactivated=we();related=we();info=we();closed=we();points=we();notes=we();_title=Ea(()=>this.title());properties;ctrl={showInfoButton:!1,showModifyButton:!1,showDeleteButton:!1,showAddNoteButton:!1,showRelatedButton:!1,showPointsButton:!1,showNotesButton:!1,showSaveButton:!1,canActivate:!1,isActive:!1,activeText:"ACTIVE",isReadOnly:!1,modifyLabel:"MOVE"};hasMarkdown=J(!1);icon;app=M(re);constructor(){Te(()=>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=!1,this.ctrl.showPointsButton=!1,this.ctrl.showNotesButton=!1,this.ctrl.showInfoButton=!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(){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.showNotesButton=!1,this.ctrl.showAddNoteButton=!1,this.ctrl.showPointsButton=!1,this.ctrl.showRelatedButton=!1,this.properties=[],this.resource()[1].name&&this.properties.push(["Name",this.resource()[1].name]),this.resource()[1].description&&this.properties.push(["Desc.",this.resource()[1].description]),this.properties.push(["Latitude",this.resource()[1].feature.geometry.coordinates[1]]),this.properties.push(["Longitude",this.resource()[1].feature.geometry.coordinates[0]]),this.hasMarkdown.set(!0)}parseWaypoint(){this.ctrl.isReadOnly=this.resource()[1].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.showNotesButton=!this.app.useInfoPanel(),this.ctrl.showAddNoteButton=!1,this.ctrl.showPointsButton=!1,this.ctrl.showRelatedButton=!1,this.properties=[],this.icon=Un("waypoints",this.resource()[1]),this._title.set(this.resource()[1].name??""),this.properties.push(["Latitude",this.resource()[1].feature.geometry.coordinates[1]]),this.properties.push(["Longitude",this.resource()[1].feature.geometry.coordinates[0]]),this.hasMarkdown.set(!0)}parseRoute(){this.ctrl.isReadOnly=this.resource()[1].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.icon=Un("routes",this.resource()[1]),this._title.set(this.resource()[1].name??""),this.properties=[];let e=this.app.formatValueForDisplay(this.resource()[1].distance,"m");this.properties.push(["Distance",e]),this.hasMarkdown.set(!0)}parseNote(){this.ctrl.isReadOnly=this.resource()[1].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.showAddNoteButton=!1,this.ctrl.showNotesButton=!1,this.ctrl.showPointsButton=!1,this.ctrl.showRelatedButton=!!(this.resource()[1].group&&this.app.config.resources.notes.groupNameEdit),this.icon=Un("notes",this.resource()[1]),this._title.set(this.resource()[1].name??""),this.properties=[],this.ctrl.isReadOnly=this.resource()[1].properties?.readOnly,this.hasMarkdown.update(()=>this.resource()[1].mimeType?.includes("markdown"))}parseRegion(){this.ctrl.isReadOnly=this.resource()[1].feature.properties?.readOnly,this.ctrl.isActive=!1,this.ctrl.activeText="",this.ctrl.canActivate=!1,this.ctrl.showInfoButton=!0,this.ctrl.showModifyButton=this.resource()[1].feature.geometry.type==="MultiPolygon"?!1:!this.ctrl.isReadOnly,this.ctrl.showDeleteButton=this.app.useInfoPanel()?!1:!this.ctrl.isReadOnly,this.ctrl.showAddNoteButton=!1,this.ctrl.showNotesButton=!this.app.useInfoPanel(),this.ctrl.showPointsButton=!1,this.ctrl.showRelatedButton=!1,this.properties=[],this.icon=Un("regions",this.resource()[1]),this._title.set(this.resource()[1].name??""),this.hasMarkdown.set(!0)}emitModify(){this.modify.emit()}emitSave(){this.save.emit()}emitAddNote(){this.addNote.emit()}emitDelete(){this.delete.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=W({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"]},outputs:{modify:"modify",save:"save",delete:"delete",addNote:"addNote",activated:"activated",deactivated:"deactivated",related:"related",info:"info",closed:"closed",points:"points",notes:"notes"},decls:16,vars:13,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","Delete","matTooltipPosition","after",3,"click","disabled"],["mat-button","","matTooltipPosition","after",3,"click","matTooltip"],["mat-button","","matTooltip","Clear Destination","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,Lpe,2,2,"remark",1)(2,Ape,1,1,"div",2),Oe(3,Bpe,6,4,"div",3,ft),u(5,"div",4),R(6,Vpe,5,4,"div",5),R(7,Gpe,5,0,"div",6),R(8,jpe,5,3,"div",5),R(9,zpe,5,4,"div",5)(10,Wpe,5,2,"div",5),R(11,Upe,5,2,"div",5),R(12,Hpe,5,0,"div",6),R(13,Kpe,5,2,"div",5),R(14,$pe,5,2,"div",5),R(15,qpe,5,2,"div",5),p()()),t&2&&(w("title",i._title())("icon",i.icon)("canClose",i.canClose()),g(),A(i.hasMarkdown()?1:2),g(2),Fe(i.properties),g(3),A(i.ctrl.showModifyButton?6:-1),g(),A(i.ctrl.showAddNoteButton?7:-1),g(),A(i.ctrl.showDeleteButton?8:-1),g(),A(i.ctrl.canActivate&&!i.ctrl.isActive?9:i.ctrl.canActivate&&i.ctrl.isActive?10:-1),g(2),A(i.ctrl.showPointsButton?11:-1),g(),A(i.ctrl.showRelatedButton?12:-1),g(),A(i.ctrl.showNotesButton?13:-1),g(),A(i.ctrl.showInfoButton?14:-1),g(),A(i.ctrl.showSaveButton?15:-1))},dependencies:[ue,Ze,ve,Ie,ae,le,Lr,Nr,mo,ho,dn],styles:[gB],changeDetection:0})},Jx=class n{title=Z();resource=Z();canClose=Z();info=we();closed=we();properties;icon;app=M(re);constructor(){Te(()=>{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=W({type:n,selectors:[["resourceset-popover"]],inputs:{title:[1,"title"],resource:[1,"resource"],canClose:[1,"canClose"]},outputs:{info:"info",closed:"closed"},features:[Me],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()}),Oe(1,Ype,2,1,null,null,ft),u(3,"div",1)(4,"div",2)(5,"button",3),T("click",function(){return i.emitInfo()}),u(6,"mat-icon"),_(7,"info_outline"),p(),_(8," INFO "),p()()()()),t&2&&(w("title",i.title())("icon",i.icon)("canClose",i.canClose),g(),Fe(i.properties))},dependencies:[ue,Ze,ve,Ie,ae,le,Lr],styles:[gB],changeDetection:0})};var _B=["speedtext"],Qpe=["speedunitstext"],Jpe=["dial"],yB=["headingtext"],vB=["pointer"],bB=["needlehi"],xB=["needlelo"],Ff=n=>({hide:n}),ehe=["labeltext"],eC=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}},tC=class n extends eC{speed;speedunits="knots";heading;needle;windtrue;windapparent;speedtext;speedunitstext;dial;headingtext;pointer;needlehi;needlelo;valueStr="0\xBA";ptrOffset=0;renderer=M(On);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=W({type:n,selectors:[["ap-compass"]],viewQuery:function(t,i){if(t&1&&Ht(_B,7)(Qpe,7)(Jpe,7)(yB,7)(vB,7)(bB,7)(xB,7),t&2){let r;De(r=ke())&&(i.speedtext=r.first),De(r=ke())&&(i.speedunitstext=r.first),De(r=ke())&&(i.dial=r.first),De(r=ke())&&(i.headingtext=r.first),De(r=ke())&&(i.pointer=r.first),De(r=ke())&&(i.needlehi=r.first),De(r=ke())&&(i.needlelo=r.first)}},inputs:{speed:"speed",speedunits:"speedunits",heading:"heading",needle:"needle",windtrue:"windtrue",windapparent:"windapparent"},features:[Qe,Me],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&&(Ta(),u(0,"svg",7)(1,"defs")(2,"filter",8),j(3,"feGaussianBlur",9),p(),u(4,"filter",10),j(5,"feGaussianBlur",11),p()(),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; } } "),p(),j(8,"rect",13),u(9,"g",14),j(10,"circle",15),p(),u(11,"g",14),j(12,"path",16)(13,"path",17),p(),u(14,"g",18,0),j(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),j(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"),p(),u(391,"text",393),_(392,"E"),p(),u(393,"text",394),_(394,"S"),p(),u(395,"text",395),_(396,"W"),p(),u(397,"text",396),_(398,"NE"),p(),u(399,"text",397),_(400,"SE"),p(),u(401,"text",398),_(402,"SW"),p(),u(403,"text",399),_(404,"NW"),p()(),u(405,"g",400)(406,"text",401,1),_(408,"0\xBA"),p(),j(409,"text",402,2)(411,"text",403,3),p(),u(413,"g",404)(414,"g",405,4),j(416,"path",406),p()(),u(417,"g",407)(418,"g",408,5),j(420,"path",409),p()(),u(421,"g",410,6)(423,"g",411),j(424,"path",412),p()(),u(425,"g",14)(426,"g",413),j(427,"path",414),p()()()),t&2&&(g(413),w("ngClass",vn(3,Ff,i.windapparent==null||i.windapparent==null)),g(4),w("ngClass",vn(5,Ff,i.windtrue==null||i.windtrue==null)),g(4),w("ngClass",vn(7,Ff,i.needle==null||i.needle==null)))},dependencies:[hn,Fn],encapsulation:2,changeDetection:0})},iC=class n extends eC{label="";speed;heading;windtrue;windapparent;labeltext;headingtext;speedtext;pointer;needlehi;needlelo;showPointer=!0;showWindTrue=!0;showWindApparent=!0;renderer=M(On);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=W({type:n,selectors:[["ap-compass-northup"]],viewQuery:function(t,i){if(t&1&&Ht(ehe,7)(yB,7)(_B,7)(vB,7)(bB,7)(xB,7),t&2){let r;De(r=ke())&&(i.labeltext=r.first),De(r=ke())&&(i.headingtext=r.first),De(r=ke())&&(i.speedtext=r.first),De(r=ke())&&(i.pointer=r.first),De(r=ke())&&(i.needlehi=r.first),De(r=ke())&&(i.needlelo=r.first)}},inputs:{label:"label",speed:"speed",heading:"heading",windtrue:"windtrue",windapparent:"windapparent"},features:[Qe,Me],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&&(Ta(),u(0,"svg",7)(1,"defs")(2,"filter",8),j(3,"feGaussianBlur",9),p(),u(4,"filter",10),j(5,"feGaussianBlur",11),p()(),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; } } "),p(),j(8,"rect",13),u(9,"g",14),j(10,"circle",15),p(),u(11,"g",16,0),j(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),j(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"),p(),u(388,"text",391),_(389,"E"),p(),u(390,"text",392),_(391,"S"),p(),u(392,"text",393),_(393,"W"),p(),u(394,"text",394),_(395,"NE"),p(),u(396,"text",395),_(397,"SE"),p(),u(398,"text",396),_(399,"SW"),p(),u(400,"text",397),_(401,"NW"),p()(),u(402,"g",398)(403,"text",399,1),_(405,"0\xBA"),p(),u(406,"text",400,2),_(408,"0"),p(),u(409,"text",401,3),_(411,"Heading"),p()(),u(412,"g",402)(413,"g",403,4),j(415,"path",404),p()(),u(416,"g",405)(417,"g",406,5),j(419,"path",407),p()(),u(420,"g",408,6)(422,"g",409),j(423,"path",410),p()()()),t&2&&(g(412),w("ngClass",vn(3,Ff,!i.showWindApparent)),g(4),w("ngClass",vn(5,Ff,!i.showWindTrue)),g(4),w("ngClass",vn(7,Ff,!i.showPointer)))},dependencies:[hn,Fn],encapsulation:2,changeDetection:0})};function the(n,e){if(n&1){let t=H();u(0,"button",17),T("click",function(){O(t);let r=v();return F(r.handleMarkPosition())}),u(1,"mat-icon"),_(2,"add_location"),p()()}}function ihe(n,e){if(n&1){let t=H();u(0,"button",21),T("click",function(){O(t);let r=v(2);return F(r.toggleBuddy())}),u(1,"mat-icon"),_(2),p()()}if(n&2){let t=v(2);g(2),X(t.vessel().buddy?"group_remove":"group_add")}}function nhe(n,e){if(n&1){let t=H();u(0,"button",18),T("click",function(){O(t);let r=v();return F(r.toggleFlag())}),u(1,"mat-icon"),_(2),p()(),R(3,ihe,3,1,"button",19),u(4,"button",20),T("click",function(){O(t);let r=v();return F(r.focusVessel(!0))}),u(5,"mat-icon"),_(6,"center_focus_weak"),p()()}if(n&2){let t=v();w("matTooltip",t.isFlagged?"Un-flag vessel":"Flag vessel"),g(2),X(t.isFlagged?"clear_all":"flag"),g(),A(!t.isSelf()&&t.app.featureFlags().buddyList?3:-1)}}function rhe(n,e){if(n&1){let t=H();u(0,"button",22),T("click",function(){O(t);let r=v();return F(r.focusVessel(!1))}),u(1,"mat-icon"),_(2,"clear_all"),p()()}}function ohe(n,e){if(n&1){let t=H();u(0,"span",5)(1,"button",23),T("click",function(){O(t);let r=v();return F(r.toggleTrack())}),u(2,"mat-icon"),_(3),p()()()}if(n&2){let t=v(),i=t.app.isVesselTrackShown(t.vessel().id);w("matTooltip",t.app.config.vessels.aisShowTrack?'Turn off "Show All" to enable':i?"Hide vessel track":"Show vessel track"),g(),w("disabled",t.app.config.vessels.aisShowTrack),g(2),X(i?"layers_clear":"route")}}function ahe(n,e){if(n&1&&(u(0,"div",1)(1,"div",8),_(2,"Callsign (VHF):"),p(),j(3,"div",9),p()),n&2){let t=v();g(3),w("innerText",t.vessel().callsignVhf)}}function she(n,e){if(n&1&&(u(0,"div",1)(1,"div",8),_(2,"Callsign (HF):"),p(),j(3,"div",9),p()),n&2){let t=v();g(3),w("innerText",t.vessel().callsignHf)}}function lhe(n,e){if(n&1&&(u(0,"div",1)(1,"div",8),_(2,"Range:"),p(),u(3,"div",10),_(4),p()()),n&2){let t=v(2);g(4),q(" ",t.distToSelf," ")}}function che(n,e){if(n&1&&(u(0,"div",1)(1,"div",8),_(2,"CPA:"),p(),u(3,"div",10),_(4),p()(),u(5,"div",1)(6,"div",8),_(7,"TCPA:"),p(),u(8,"div",10),_(9),p()()),n&2){let t=v(2);g(4),q(" ",t.cpa??"--"," "),g(5),q(" ",t.tcpa??"--"," ")}}function dhe(n,e){if(n&1&&(R(0,lhe,5,1,"div",1),R(1,che,10,2)),n&2){let t=v();A(t.vessel().distanceToSelf?0:-1),g(),A(t.vessel().closestApproach?1:-1)}}var nC=class n{title=Z();vessel=Z();useMagnetic=Z();isActive=Z();isSelf=Z();canClose=Z();info=we();closed=we();focused=we();markPosition=we();_title;_icon;convert=We;timeLastUpdate;timeAgo;speedUnits;distToSelf;cpa;tcpa;position=[0,0];positionTimestamp="";isFlagged=!1;app=M(re);buddies=M(Yx);destroyRef=M(Ai);windSpeed(e,t){return Number.isFinite(e)?this.app.formatValueForDisplay(e,"m/s",{path:t}):"--"}constructor(){Te(()=>{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,this._icon=this.vessel().type?.id?ba(this.vessel().type?.id):{name:"directions_boat",svgIcon:void 0},this.position=[this.vessel().position[0],this.vessel().position[1]],this.position=di.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(jt(this.destroyRef)).subscribe(()=>{this.app.showMessage("Buddy successfully removed.",!1,3e3)},t=>{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(jt(this.destroyRef)).subscribe(()=>{this.app.showMessage(`Buddy added (${t})`,!1,3e3)},i=>{this.app.showMessage(`Error adding buddy!(${t})`,!1,5e3)})}}toggleTrack(){this.app.toggleVesselTrack(this.vessel().id)}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=W({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:53,vars:29,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"],[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){t&1&&(u(0,"ap-popover",0),T("closed",function(){return i.handleClose()}),u(1,"div",1)(2,"div",2),R(3,the,3,0,"button",3)(4,nhe,7,3),R(5,rhe,3,0,"button",4),R(6,ohe,4,3,"span",5),p(),u(7,"div",6)(8,"button",7),T("click",function(){return i.handleInfo()}),u(9,"mat-icon"),_(10,"info_outline"),p()()()(),j(11,"mat-divider"),R(12,ahe,4,1,"div",1)(13,she,4,1,"div",1),u(14,"div",1)(15,"div",8),_(16,"Latitude:"),p(),j(17,"div",9),St(18,"coords"),p(),u(19,"div",1)(20,"div",8),_(21,"Longitude:"),p(),j(22,"div",9),St(23,"coords"),p(),u(24,"div",1)(25,"div",8),_(26,"Last Position:"),p(),u(27,"div",10),_(28),p()(),R(29,dhe,2,2),u(30,"div",1)(31,"div",8),_(32,"Last Update:"),p(),u(33,"div",10),_(34),p()(),u(35,"div",11)(36,"div",12),j(37,"ap-compass",13),p(),u(38,"div",14),_(39," \xA0"),j(40,"br"),u(41,"div")(42,"div",15)(43,"span",8),_(44),p()(),u(45,"div",10),_(46),p()(),u(47,"div")(48,"div",16)(49,"span",8),_(50," Wind (A):"),p()(),u(51,"div",10),_(52),p()()()()()),t&2&&(w("title",i._title)("mmsi",i.vessel().mmsi)("icon",i._icon)("canClose",i.canClose()),g(3),A(i.isActive()?3:4),g(2),A(i.isActive()&&!i.isSelf()?5:-1),g(),A(i.isSelf()?-1:6),g(6),A(i.vessel().callsignVhf?12:i.vessel().callsignHf?13:-1),g(5),w("innerText",Oi(18,22,i.position[1],i.app.config.units.positionFormat,!0)),g(5),w("innerText",Xn(23,26,i.position[0],i.app.config.units.positionFormat)),g(6),q(" ",i.positionTimestamp," "),g(),A(i.isSelf()?-1:29),g(5),Uo(" ",i.timeLastUpdate," ",i.timeAgo," "),g(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),g(7),q(" Wind (",i.useMagnetic()?"M":"T","):"),g(2),q(" ",i.windSpeed(i.vessel().wind.tws,i.app.twsDisplayUnitPath())," "),g(6),q(" ",i.windSpeed(i.vessel().wind.aws,"environment.wind.speedApparent")," "))},dependencies:[ue,Ne,ve,Ie,ae,le,Da,Lr,tC,dn],encapsulation:2,changeDetection:0})};var uhe=n=>({"icon-warn":n});function phe(n,e){if(n&1&&j(0,"mat-icon",4),n&2){let t=v().$implicit;Pt(t.icon.class),w("svgIcon",t.icon.svgIcon)}}function hhe(n,e){if(n&1&&(u(0,"mat-icon",5),_(1),p()),n&2){let t=v().$implicit;Pt(t.icon.class),w("ngClass",vn(4,uhe,t.text&&t.text.indexOf("self")!==-1)),g(),q(" ",t.icon.name," ")}}function mhe(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,phe,1,3,"mat-icon",2)(2,hhe,2,6,"mat-icon",3),_(3),p()}if(n&2){let t=e.$implicit;g(),A(t.icon.svgIcon?1:2),g(2),q(" ",t.text," ")}}var rC=class n{title=Z();features=Z([]);canClose=Z();closed=we();selected=we();handleSelect(e){this.selected.emit(e)}handleClose(){this.closed.emit()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=W({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"),Oe(2,mhe,4,2,"mat-list-item",null,ft),p()()),t&2&&(w("title",i.title())("canClose",i.canClose()),g(2),Fe(i.features()))},dependencies:[hn,Fn,xn,Es,po,ue,ve,ae,le,Lr],encapsulation:2,changeDetection:0})};var fhe=()=>({name:"map"});function ghe(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"),p(),_(3),p()}if(n&2){let t=e.$implicit;g(3),q(" ",t.text," ")}}var oC=class n{features=Z([]);canClose=Z();closed=we();selected=we();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=W({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"),Oe(2,ghe,4,1,"mat-list-item",null,ft),p()()),t&2&&(w("title",i.title)("canClose",i.canClose())("icon",Eo(3,fhe)),g(2),Fe(i.features()))},dependencies:[xn,Es,po,ue,ve,ae,le,Lr],encapsulation:2,changeDetection:0})};var aC=class n{title;aircraft;canClose;info=new pe;closed=new pe;_title;timeLastUpdate;timeAgo;app=M(re);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=W({type:n,selectors:[["aircraft-popover"]],inputs:{title:"title",aircraft:"aircraft",canClose:"canClose"},outputs:{info:"info",closed:"closed"},features:[Me],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:"),p(),u(4,"div",3),_(5),p()(),u(6,"div",1)(7,"div",2),_(8,"Call sign VHF:"),p(),u(9,"div",3),_(10),p()(),u(11,"div",1)(12,"div",2),_(13,"Call sign HF:"),p(),u(14,"div",3),_(15),p()(),u(16,"div",1)(17,"div",2),_(18,"Latitude:"),p(),j(19,"div",4),St(20,"coords"),p(),u(21,"div",1)(22,"div",2),_(23,"Longitude:"),p(),j(24,"div",4),St(25,"coords"),p(),u(26,"div",1)(27,"div",2),_(28,"Last Update:"),p(),u(29,"div",3),_(30),p()(),u(31,"div",1)(32,"div",5),_(33,"\xA0"),p(),u(34,"div",6)(35,"button",7),T("click",function(){return i.handleInfo()}),u(36,"mat-icon"),_(37,"info_outline"),p(),_(38," INFO "),p()()()()),t&2&&(w("title",i._title)("canClose",i.canClose),g(5),X(i.aircraft.name),g(5),q(" ",i.aircraft.callsignVhf," "),g(5),q(" ",i.aircraft.callsignHf," "),g(4),w("innerText",Oi(20,9,i.aircraft.position[1],i.app.config.units.positionFormat,!0)),g(5),w("innerText",Xn(25,13,i.aircraft.position[0],i.app.config.units.positionFormat)),g(6),Uo(" ",i.timeLastUpdate," ",i.timeAgo," "))},dependencies:[ue,Ze,ve,Ie,ae,le,Lr,dn],encapsulation:2,changeDetection:0})};var sC=class n{title=Z();id=Z();alarm=Z();canClose=Z();info=we();goto=we();closed=we();_title;app=M(re);constructor(){Te(()=>{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=W({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:"),p(),u(4,"div",3),_(5),p()(),u(6,"div",1)(7,"div",2),_(8,"Type:"),p(),u(9,"div",4),_(10),p()(),u(11,"div",1)(12,"div",2),_(13,"Latitude:"),p(),j(14,"div",5),St(15,"coords"),p(),u(16,"div",1)(17,"div",2),_(18,"Longitude:"),p(),j(19,"div",5),St(20,"coords"),p(),u(21,"div",1)(22,"div",6),_(23,"\xA0"),p(),u(24,"div",7)(25,"button",8),T("click",function(){return i.handleGoto()}),u(26,"mat-icon"),_(27,"near_me"),p(),_(28," GO TO "),p()(),u(29,"div",7)(30,"button",9),T("click",function(){return i.handleInfo()}),u(31,"mat-icon"),_(32,"info_outline"),p(),_(33," INFO "),p()()()()),t&2&&(w("title",i._title)("canClose",i.canClose)("icon",i.alarm().icon),g(5),q(" ",i.alarm().message," "),g(5),X(i.alarm().type),g(4),w("innerText",Oi(15,7,i.alarm().properties.position.latitude,i.app.config.units.positionFormat,!0)),g(5),w("innerText",Oi(20,11,i.alarm().properties.position.longitude,i.app.config.units.positionFormat,!1)))},dependencies:[ue,Ze,ve,Ie,ae,le,Lr,dn],encapsulation:2,changeDetection:0})};function _he(n,e){if(n&1&&(u(0,"div",1)(1,"div",2),_(2,"Temperature:"),p(),u(3,"div",3),_(4),p()()),n&2){let t=v();g(4),q(" ",t.app.formatValueForDisplay(t.aton().temperature,"K")," ")}}function yhe(n,e){if(n&1&&(u(0,"div",5)(1,"div",2),_(2,"Wind:"),p(),u(3,"div",9),j(4,"ap-compass-northup",10),p()()),n&2){let t=v();g(4),w("heading",t.convert.radiansToDegrees(t.aton().twd))("speed",t.app.formatSpeed(t.aton().tws))("label",t.app.formattedSpeedUnits)("windtrue",!0)}}var lC=class n{title=Z();aton=Z();canClose=Z();info=we();closed=we();_title;_icon;timeLastUpdate;timeAgo;convert=We;isMeteo;app=M(re);constructor(){Te(()=>{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=W({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:"),p(),u(4,"div",3),_(5),p()(),u(6,"div",1)(7,"div",2),_(8,"Latitude:"),p(),j(9,"div",4),St(10,"coords"),p(),u(11,"div",1)(12,"div",2),_(13,"Longitude:"),p(),j(14,"div",4),St(15,"coords"),p(),u(16,"div",1)(17,"div",2),_(18,"Last Update:"),p(),u(19,"div",3),_(20),p()(),R(21,_he,5,1,"div",1),R(22,yhe,5,4,"div",5),u(23,"div",1)(24,"div",6),_(25,"\xA0"),p(),u(26,"div",7)(27,"button",8),T("click",function(){return i.handleInfo()}),u(28,"mat-icon"),_(29,"info_outline"),p(),_(30," INFO "),p()()()()),t&2&&(w("title",i._title)("canClose",i.canClose())("icon",i._icon),g(5),q(" ",i.aton().type.name," "),g(4),w("innerText",Oi(10,10,i.aton().position[1],i.app.config.units.positionFormat,!0)),g(5),w("innerText",Xn(15,14,i.aton().position[0],i.app.config.units.positionFormat)),g(6),Uo(" ",i.timeLastUpdate," ",i.timeAgo," "),g(),A(i.isMeteo&&i.aton().temperature!==void 0?21:-1),g(),A(i.isMeteo&&i.aton().tws!==void 0&&i.aton().twd!==void 0?22:-1))},dependencies:[ue,Ze,ve,Ie,ae,le,Lr,iC,dn],encapsulation:2,changeDetection:0})};var vhe=(n,e)=>e.key;function bhe(n,e){if(n&1&&(u(0,"div",1)(1,"div",3),_(2),p(),u(3,"div",4),_(4),p()()),n&2){let t=e.$implicit;g(2),q(" ",t.label,": "),g(2),X(t.value)}}function xhe(n,e){n&1&&(u(0,"div",2),_(1,"No details available"),p())}var FE={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"},CB=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"]),Che={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"},whe={1:"Partly submerged",2:"Always dry",3:"Always under water",4:"Covers and uncovers",5:"Awash",6:"Subject to flooding",7:"Floating"},She={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"},Mhe={1:"Non-dangerous",2:"Dangerous",3:"Distributed remains",4:"Mast showing",5:"Hull showing"},The={1:"Conical (nun)",2:"Can (cylindrical)",3:"Spherical",4:"Pillar",5:"Spar",6:"Barrel",7:"Super-buoy",8:"Ice buoy"},Ehe={1:"Stake/pole",2:"Withy",3:"Tower",4:"Lattice",5:"Pile",6:"Cairn",7:"Buoyant"},Ihe={1:"Port",2:"Starboard",3:"Preferred channel starboard",4:"Preferred channel port"},Dhe={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"},khe={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"},Phe={1:"Under construction",2:"Ruined",3:"Under reclamation",5:"Planned"},Rhe={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"},Lhe={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"},Ahe={1:"Horizontal stripes",2:"Vertical stripes",3:"Diagonal stripes",4:"Squared",5:"Border stripes",6:"Single colour"},Ohe={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"},Fhe={1:"North",2:"East",3:"South",4:"West"},Nhe={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"},Bhe={COLOUR:Che,WATLEV:whe,CATOBS:She,CATWRK:Mhe,BOYSHP:The,BCNSHP:Ehe,CATLAM:Ihe,CATLIT:Dhe,LITCHR:khe,CONDTN:Phe,STATUS:Rhe,RESTRN:Lhe,COLPAT:Ahe,TOPSHP:Ohe,CATCAM:Fhe,CATSPM:Nhe},Vhe=[{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 Ghe(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 jhe(n,e){let t=Ghe(e);if(t.length===0)return"";let i=Bhe[n];return i?t.map(r=>i[r]||r).join(", "):t.join(", ")}var zhe=new Set(["DEPTH","VALSOU","DRVAL1","DRVAL2","VALDCO"]),Whe=new Set(["HEIGHT","VERLEN","HORLEN","HORWID"]),cC=class n{title=Z();properties=Z();canClose=Z();closed=we();app=M(re);_title;displayProps=[];constructor(){Te(()=>{if(!this.properties())return;let e=this.properties().layer||"";this._title=this.title()||FE[e]||e||"Chart Feature",this.displayProps=[];for(let t of Vhe){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(zhe.has(e)){let i=parseFloat(String(t));return isNaN(i)?String(t):this.app.formatValueForDisplay(i,"m",{category:"depth"})}if(Whe.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":jhe(e,t)}handleClose(){this.closed.emit()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=W({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()}),Oe(1,bhe,5,2,"div",1,vhe),R(3,xhe,2,0,"div",2),p()),t&2&&(w("title",i._title)("canClose",i.canClose()),g(),Fe(i.displayProps),g(2),A(i.displayProps.length===0?3:-1))},dependencies:[hn,ue,ae,Lr],encapsulation:2,changeDetection:0})};var Ja=ts(Ml());var wB=ts(Ml());var Uhe=1/1.94384;function SB(n,e,t,i){let r=di.distanceTo(n,e)??0,o=(0,wB.getGreatCircleBearing)(n,e)??0,a=typeof t=="number"&&t>Uhe?t:i??0,s=a>0?r/a:null;return{bearing:o,distance:r,timeToGo:s}}var MB=[{name:"scaleline",options:{bar:!0,steps:2,text:!1,minWidth:64,units:"nautical"}}],TB={line:[new fe({stroke:new xe({color:"white",width:5,lineDash:[5,5]})}),new fe({fill:new Be({color:"#3399CC"}),stroke:new xe({color:"#3399CC",width:3,lineDash:[5,5]})})],marker:new fe({image:new Ui({radius:3,stroke:new xe({width:2,color:"white"}),fill:new Be({color:"#3399CC"})})})},EB={startLine:new fe({stroke:new xe({color:"black",width:2,lineDash:[4,4]}),text:new Lt({text:"START",offsetY:10})})},IB={default:new fe({stroke:new xe({color:"green",width:2,lineDash:[20,5,5,5]}),text:new Lt({text:"",offsetY:10})}),active:new fe({stroke:new xe({color:"blue",width:4})})},DB={default:new fe({stroke:new xe({color:"#e8932b",width:3,lineDash:[10,6]}),text:new Lt({text:"",offsetY:10})}),active:new fe({stroke:new xe({color:"#e8932b",width:4})})},kB={line:new fe({fill:new Be({color:"green"}),stroke:new xe({color:"black",width:2,lineDash:[5,5]})}),circle:new fe({fill:new Be({color:"rgba(0, 255, 0, .3)"}),stroke:new xe({color:"red",width:2,lineDash:[5,5]})}),anchor:new fe({image:new en({src:"./assets/img/anchor.png",size:[26,26],scale:.75,anchor:[13,1],anchorXUnits:"pixels",anchorYUnits:"pixels",rotateWithView:!1})})},PB={"notice-to-mariners":new fe({stroke:new xe({color:"rgb(206, 107, 132)",lineDash:[5,5],width:2}),fill:new Be({color:"rgba(206, 107, 132, 0.2)"}),text:new Lt({text:"",offsetY:0})}),hazard:new fe({stroke:new xe({color:"rgba(241, 60, 60, 1)",lineDash:[5,5,2],width:2}),fill:new Be({color:"rgba(241, 60, 60, 0.5)"}),text:new Lt({text:"",offsetY:0,stroke:new xe({color:"silver"}),padding:[2,2,2,2],backgroundFill:new Be({color:"white"}),backgroundStroke:new xe({color:"rgba(241, 60, 60, 1)"})})})},RB={mob:new fe({image:new en({src:"./assets/img/alarms/mob.svg",rotateWithView:!1,rotation:0,scale:1,anchor:[12,12],anchorXUnits:"pixels",anchorYUnits:"pixels"})})},LB={marker:new fe({image:new en({src:"./assets/img/waypoints/marker-green.png",anchor:[10.5,25],anchorXUnits:"pixels",anchorYUnits:"pixels",rotateWithView:!1}),text:new Lt({text:"",offsetY:-30})})},Hhe=new en({src:"./assets/img/aircraft_active.png",rotateWithView:!0,rotation:0}),Khe=new en({src:"./assets/img/aircraft_inactive.png",rotateWithView:!0,rotation:0}),AB={default:new fe({image:Hhe,text:new Lt({text:"",offsetY:-12})}),inactive:new fe({image:Khe,text:new Lt({text:"",offsetY:-12})})},$he=new en({src:"./assets/img/sar_active.png",rotateWithView:!1,rotation:0}),OB={default:new fe({image:$he,text:new Lt({text:"",offsetY:-18})})},FB={port:new fe({fill:new Be({color:"green"}),stroke:new xe({color:"green",width:1,lineDash:[5,5]})}),starboard:new fe({fill:new Be({color:"red"}),stroke:new xe({color:"red",width:1,lineDash:[5,5]})})},NB=new fe({fill:new Be({color:"green"}),stroke:new xe({color:"gray",width:1,lineDash:[15,5,3,5]})}),Sp={default:void 0,measure:[new fe({stroke:new xe({color:"white",width:5,lineDash:[5,5]})}),new fe({image:new Ui({radius:6,stroke:new xe({width:2,color:"white"}),fill:new Be({color:"#3399CC"})}),fill:new Be({color:"#3399CC"}),stroke:new xe({color:"#3399CC",width:3,lineDash:[5,5]})})],route:[new fe({stroke:new xe({color:"white",width:5})}),new fe({image:new Ui({radius:6,stroke:new xe({width:2,color:"white"}),fill:new Be({color:"green"})}),stroke:new xe({color:"green",width:3})})],region:[new fe({stroke:new xe({color:"rgba(255,255,255,0.4)",width:5}),fill:new Be({color:"rgba(255,255,255,0.4)"})}),new fe({stroke:new xe({color:"purple",width:2}),image:new Ui({radius:6,stroke:new xe({width:2,color:"white"}),fill:new Be({color:"purple"})})})],radius:[new fe({image:new Ui({radius:6,stroke:new xe({width:2,color:"white"}),fill:new Be({color:"rgba(25, 183, 211, 0.4)"})})}),new fe({fill:new Be({color:"rgba(25, 183, 211, 0.4)"}),stroke:new xe({color:"white",width:3,lineDash:[5,5]})})]};var Nf=class n{constructor(e,t){this.http=e;this.sk=t}currentCellDeg=.1;currentsCacheTtlMs=1800*1e3;currentsCacheMax=512;currentsCache=new Map;getWindSamples(e){if(e.length===0)return Qt([]);let t=e.map(i=>this.sk.api.get(2,`/weather/observations?lat=${i.latitude}&lon=${i.longitude}`).pipe(al(()=>Qt(null))));return B1(t).pipe(Or(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 Qt([]);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 Qt(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}&current=ocean_current_velocity,ocean_current_direction`;return this.http.get(l).pipe(Or(c=>Array.isArray(c)?c:[c]),ua(c=>{c.length!==o.length||c.some(d=>d?.error)||c.forEach((d,h)=>{let m=d?.current?.ocean_current_velocity,f=d?.current?.ocean_current_direction;this.cacheCurrentCell(o[h][0],typeof m=="number"&&typeof f=="number"?{velocity:m,direction:f}:null)})}),Or(()=>this.buildCurrentSamples(e,i)),al(()=>Qt(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)(ot(Ia),ot(Ft))};static \u0275prov=et({token:n,factory:n.\u0275fac,providedIn:"root"})};var qhe=["*"],dC=class n{constructor(e,t,i,r,o){this.mapComponent=e;this.weather=t;this.mapImages=i;this.app=r;o.detach()}show=!1;opacity=.55;indicator="barb";layer;source;refresh$=new Ge;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 Gt,this.layer=new Ut({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(Ip(400),hr(()=>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 Qt([]);let e=this.getSamplePoints();return e.length===0?Qt([]):this.weather.getWindSamples(e).pipe(ua(t=>this.renderWind(t)),al(t=>(console.warn("SK Weather wind layer unavailable.",t),Qt([]))))}getSamplePoints(){let e=this.mapComponent.getMap(),t=e.getSize();if(!t)return[];let i=zn(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 h=0;h<this.gridColumns;h++){let m=r+(a-r)*(h+.5)/this.gridColumns;l.push({latitude:d,longitude:m})}}return l}renderWind(e){this.source.clear(),this.source.addFeatures(e.map(t=>new ze({geometry:new nt(pt([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 fe({image:i,text:this.speedLabel(t,26)})}createBarbStyle(e,t){let i=this.mapImages.getMeteoIcon(t).clone();return rp(t)&&i.setRotation(e),i.setRotateWithView(!0),new fe({image:i,text:this.speedLabel(t,10)})}speedLabel(e,t){return new Lt({text:this.app.formatValueForDisplay(e,"m/s",{precision:0,path:this.app.twsDisplayUnitPath()}),offsetY:t,font:"11px Roboto, Arial, sans-serif",fill:new Be({color:"rgba(20, 60, 95, 0.95)"}),stroke:new xe({color:"rgba(255, 255, 255, 0.9)",width:3})})}static \u0275fac=function(t){return new(t||n)(Q(Ee),Q(Nf),Q(xr),Q(re),Q(oe))};static \u0275cmp=W({type:n,selectors:[["fb-weather-wind"]],inputs:{show:"show",opacity:"opacity",indicator:"indicator"},features:[Me],ngContentSelectors:qhe,decls:1,vars:0,template:function(t,i){t&1&&(ge(),ce(0))},encapsulation:2,changeDetection:0})};var Zhe=["*"],VB=85;function Xhe(n,e,t,i=sn){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,h=Math.floor(o/c)*c,m=y=>Number(y.toFixed(4)),f=[];for(let y=0;y<t;y++)for(let b=0;b<e;b++){let[S,I]=i([d+(b+.5)*l,h+(y+.5)*c]);if(I<-VB||I>VB)continue;let D=((S+180)%360+360)%360-180;f.push({latitude:m(I),longitude:m(D)})}return f}var uC=class n{constructor(e,t,i,r){this.mapComponent=e;this.weather=t;this.mapImages=i;r.detach()}show=!1;opacity=.55;layer;source;refresh$=new Ge;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 Gt,this.layer=new Ut({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(Ip(600),Or(()=>this.getSamplePoints()),V1((e,t)=>this.pointsKey(e)===this.pointsKey(t)),hr(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?Qt([]):e.length===0?(this.source.clear(),Qt([])):this.weather.getOceanCurrentSamples(e).pipe(ua(t=>this.renderCurrents(t)),al(()=>Qt([])))}getSamplePoints(){let e=this.mapComponent.getMap(),t=e.getSize();return t?Xhe(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 ze({geometry:new nt(pt([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 fe({image:d,text:new Lt({text:`${(t/1.852).toFixed(1)} kn`,offsetY:28,font:"11px Roboto, Arial, sans-serif",fill:new Be({color:"rgba(255, 255, 255, 0.95)"}),stroke:new xe({color:"rgba(20, 60, 95, 0.9)",width:3})})})}getFlowRotation(e){return e*Math.PI/180}static \u0275fac=function(t){return new(t||n)(Q(Ee),Q(Nf),Q(xr),Q(oe))};static \u0275cmp=W({type:n,selectors:[["fb-weather-currents"]],inputs:{show:"show",opacity:"opacity"},features:[Me],ngContentSelectors:Zhe,decls:1,vars:0,template:function(t,i){t&1&&(ge(),ce(0))},encapsulation:2,changeDetection:0})};var Yhe=["olMap"],Qhe=()=>({precision:0}),Jhe=()=>({declutter:!0}),GB=(n,e)=>e[0];function eme(n,e){if(n&1){let t=H();u(0,"ol-dragbox",43),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(r){O(t);let o=v();return F(o.onDragBoxCancel(r))}),p()}}function tme(n,e){if(n&1){let t=H();u(0,"ol-draw",44),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())}),p()}if(n&2){let t=v();xC(t.mapInteract.draw.style),w("type",t.mapInteract.measureGeometryType)("stopClick",!1)}}function ime(n,e){if(n&1){let t=H();u(0,"ol-draw",45),T("drawEnd",function(r){O(t);let o=v();return F(o.onDrawEnd(r))}),p()}if(n&2){let t=v();xC(t.mapInteract.draw.style),w("type",t.mapInteract.draw.featureType)("stopClick",t.mapInteract.draw.resourceType!=="route")}}function nme(n,e){if(n&1){let t=H();u(0,"ol-modify",46),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))}),p()}if(n&2){let t=v();w("features",t.mapInteract.draw.features)}}function rme(n,e){n&1&&(u(0,"span"),_(1,"Lat:\xA0"),p())}function ome(n,e){n&1&&(u(0,"span"),_(1,"Lon:\xA0"),p())}function ame(n,e){if(n&1&&(_(0," \xA0 "),j(1,"span",11)),n&2){let t=v(),i=v();g(),w("innerText","ETA: "+i.app.formatValueForDisplay(t.timeToGo,"s"))}}function sme(n,e){if(n&1&&(_(0," \xA0 "),j(1,"span",11),_(2," \xA0 "),j(3,"span",11),R(4,ame,2,1)),n&2){let t=e,i=v();g(),w("innerText","Brg: "+i.app.formatValueForDisplay(t.bearing,"deg",Eo(3,Qhe))),g(2),w("innerText","Dist: "+i.app.formatValueForDisplay(t.distance,"m")),g(),A(t.timeToGo!==null?4:-1)}}function lme(n,e){if(n&1&&j(0,"fb-s57-chart",47),n&2){let t=v(),i=t.$implicit,r=t.$index;w("zIndex",10+r)("chart",i)}}function cme(n,e){if(n&1&&j(0,"fb-mapstylejson-chart",47),n&2){let t=v(),i=t.$implicit,r=t.$index;w("zIndex",10+r)("chart",i)}}function dme(n,e){if(n&1&&j(0,"fb-tilejson-chart",48),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 ume(n,e){if(n&1&&j(0,"fb-wms-chart",48),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 pme(n,e){if(n&1&&j(0,"fb-wmts-chart",48),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 hme(n,e){if(n&1&&j(0,"fb-tilelayer-vector",48),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 mme(n,e){if(n&1&&j(0,"fb-tilelayer-raster",48),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 fme(n,e){if(n&1&&R(0,lme,1,2,"fb-s57-chart",47)(1,cme,1,2,"fb-mapstylejson-chart",47)(2,dme,1,4,"fb-tilejson-chart",48)(3,ume,1,4,"fb-wms-chart",48)(4,pme,1,4,"fb-wmts-chart",48)(5,hme,1,4,"fb-tilelayer-vector",48)(6,mme,1,4,"fb-tilelayer-raster",48),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 gme(n,e){if(n&1){let t=H();u(0,"fb-radar",49),T("onError",function(r){O(t);let o=v();return F(o.handleRadarError(r))}),p()}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 _me(n,e){if(n&1&&j(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 yme(n,e){if(n&1&&j(0,"ais-targets-track",15),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",10)("updateIds",t.skstream.aisStatus().updated)("removeIds",t.skstream.aisStatus().expired)("mapZoom",t.mapZoomLevel())("zIndex",110)}}function vme(n,e){if(n&1&&(u(0,"div"),j(1,"fb-resource-sets",50),p()),n&2){let t=e.$implicit,i=e.$index,r=v();g(),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 bme(n,e){if(n&1&&j(0,"fb-route-direction",17),n&2){let t=v();w("points",t.course.courseData().activeRoutePoints)("pointIndex",t.course.courseData().pointIndex)("reverse",t.app.data.activeRouteReversed)("zIndex",550)}}function xme(n,e){if(n&1&&j(0,"sk-ais-targets",21),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 Cme(n,e){if(n&1&&j(0,"sk-ais-wind",51),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 wme(n,e){if(n&1&&(u(0,"div"),R(1,Cme,1,15,"sk-ais-wind",51),j(2,"sk-ais-flags",52)(3,"sk-ais-vessels",53),p()),n&2){let t=v();g(),A(t.mapZoomLevel()>=t.app.config.vessels.aisWindMinZoom?1:-1),g(),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),g(),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 Sme(n,e){if(n&1&&j(0,"sk-ais-targets",22),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 Mme(n,e){if(n&1&&j(0,"sk-ais-targets",23),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 Tme(n,e){if(n&1&&j(0,"fb-notes",26),n&2){let t=v();w("notes",t.plotterExt.visibleNotes())("zIndex",450)}}function Eme(n,e){if(n&1){let t=H();u(0,"ol-overlay",27)(1,"ap-popover",54),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())}),p()(),j(2,"fb-bearing-line",55)}if(n&2){let t=v();w("position",t.overlay().position)("positioning","top-center"),g(),w("title",t.overlay().title)("canClose",!1)("measure",!0)("navTo",!0),g(),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 Ime(n,e){if(n&1){let t=H();u(0,"ap-popover",66),T("closed",function(){O(t);let r=v(2);return F(r.popoverClosed())}),p()}if(n&2){let t=v(2);w("title",t.overlay().title)("canClose",!1)("measure",!0)}}function Dme(n,e){if(n&1){let t=H();u(0,"chart-list-popover",67),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())}),p()}if(n&2){let t=v(2);w("canClose",t.app.config.map.popoverMulti)("features",t.overlay().content)}}function kme(n,e){if(n&1){let t=H();u(0,"feature-list-popover",68),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())}),p()}if(n&2){let t=v(2);w("canClose",t.app.config.map.popoverMulti)("title",t.overlay().title)("features",t.overlay().content)}}function Pme(n,e){if(n&1){let t=H();u(0,"s57-popover",69),T("closed",function(){O(t);let r=v(2);return F(r.popoverClosed())}),p()}if(n&2){let t=v(2);w("canClose",t.app.config.map.popoverMulti)("properties",t.overlay().s57Feature)}}function Rme(n,e){if(n&1){let t=H();u(0,"ap-popover",70),T("closed",function(){O(t);let r=v(2);return F(r.popoverClosed())}),u(1,"div",71)(2,"mat-icon",72),_(3,"water"),p(),u(4,"div",73)(5,"div",74)(6,"mat-icon",75),_(7,"air"),p(),u(8,"span"),_(9),p()(),u(10,"div",74)(11,"mat-icon",75),_(12,"explore"),p(),u(13,"span"),_(14),p()()()()()}if(n&2){let t,i,r=v(2);w("canClose",r.app.config.map.popoverMulti)("compact",!0),g(9),X((t=r.overlay().tidal)==null?null:t.speedLabel),g(5),X((i=r.overlay().tidal)==null?null:i.directionLabel)}}function Lme(n,e){if(n&1){let t=H();u(0,"resource-popover",76),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())})("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.itemInfo(r.overlay().id,r.overlay().type),F(r.popoverClosed())})("closed",function(){O(t);let r=v(2);return F(r.popoverClosed())}),p()}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())}}function Ame(n,e){if(n&1){let t=H();u(0,"resourceset-popover",77),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())}),p()}if(n&2){let t=v(2);w("canClose",t.app.config.map.popoverMulti)("title",t.overlay().title)("resource",t.overlay().resource)}}function Ome(n,e){if(n&1){let t=H();u(0,"div")(1,"vessel-popover",78),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())}),p()()}if(n&2){let t=v(2);g(),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 Fme(n,e){if(n&1){let t=H();u(0,"aton-popover",79),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())}),p()}if(n&2){let t=v(2);w("canClose",t.app.config.map.popoverMulti)("aton",t.overlay().aton)}}function Nme(n,e){if(n&1){let t=H();u(0,"aircraft-popover",80),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())}),p()}if(n&2){let t=v(2);w("canClose",t.app.config.map.popoverMulti)("aircraft",t.overlay().aircraft)}}function Bme(n,e){if(n&1){let t=H();u(0,"alarm-popover",81),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())}),p()}if(n&2){let t=v(2);w("canClose",t.app.config.map.popoverMulti)("alarm",t.overlay().alarm)("id",t.overlay().id)}}function Vme(n,e){if(n&1&&(u(0,"ol-overlay",27),R(1,Ime,1,3,"ap-popover",56),R(2,Dme,1,2,"chart-list-popover",57),R(3,kme,1,3,"feature-list-popover",58),R(4,Pme,1,2,"s57-popover",59),R(5,Rme,15,4,"ap-popover",60),R(6,Lme,1,8,"resource-popover",61),R(7,Ame,1,3,"resourceset-popover",62),R(8,Ome,2,5,"div"),R(9,Fme,1,2,"aton-popover",63),R(10,Nme,1,2,"aircraft-popover",64),R(11,Bme,1,3,"alarm-popover",65),p()),n&2){let t=v();w("position",t.overlay().position)("positioning","top-center"),g(),A(t.mapInteract.isMeasuring()?1:-1),g(),A(t.overlay().type==="chartlist"?2:-1),g(),A(t.overlay().type==="list"?3:-1),g(),A(t.overlay().type==="s57"?4:-1),g(),A(t.overlay().type==="tidal"?5:-1),g(),A(t.overlay().type==="destination"||t.overlay().type==="waypoint"||t.overlay().type==="route"||t.overlay().type==="note"||t.overlay().type==="region"?6:-1),g(),A(t.overlay().type==="rset"?7:-1),g(),A(t.overlay().type==="ais"?8:-1),g(),A(t.overlay().type==="aton"||t.overlay().type==="meteo"?9:-1),g(),A(t.overlay().type==="aircraft"?10:-1),g(),A(t.overlay().type==="alarm"?11:-1)}}function Gme(n,e){if(n&1&&j(0,"fb-anchor-alarm",28),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 jme(n,e){if(n&1&&j(0,"fb-cpa-alarms",29),n&2){let t=v();w("cpaLines",t.dfeat.closest)("zIndex",350)}}function zme(n,e){if(n&1&&j(0,"fb-xte-path",82),n&2){let t=v(2);w("startPosition",t.dfeat.navData.startPosition)("destPosition",t.dfeat.navData.position)("zIndex",340)("visible",!0)}}function Wme(n,e){if(n&1&&j(0,"fb-target-angle",84)(1,"fb-layline",85),n&2){let t=v(2);w("line",t.perfTargetAngle())("lineStyle",t.featureStyles.targetAngle)("position",t.app.data.vessels.active.position)("twd",t.app.data.vessels.self.wind.direction)("mapZoom",t.mapZoomLevel())("zIndex",345),g(),w("lines",t.perfLaylines())("laylineStyles",t.featureStyles.layline)("position",t.app.data.vessels.active.position)("twd",t.app.data.vessels.self.wind.direction)("mapZoom",t.mapZoomLevel())("zIndex",330)}}function Ume(n,e){if(n&1&&j(0,"fb-bearing-line",55),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 Hme(n,e){if(n&1&&j(0,"fb-arrival-circle",83),n&2){let t=v(2);w("radius",t.course.courseData().arrivalCircle)("position",t.dfeat.navData.position)("zIndex",335)}}function Kme(n,e){if(n&1&&(R(0,zme,1,4,"fb-xte-path",82),R(1,Wme,2,12),R(2,Ume,1,8,"fb-bearing-line",55),R(3,Hme,1,3,"fb-arrival-circle",83)),n&2){let t=v();A(t.dfeat.navData.startPosition?0:-1),g(),A(t.app.config.vessels.laylines&&t.perfTargetAngle().length!==0?1:-1),g(),A(t.dfeat.navData.position?2:-1),g(),A(t.course.courseData().arrivalCircle?3:-1)}}function $me(n,e){if(n&1&&j(0,"fb-range-circles",31),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 qme(n,e){if(n&1&&j(0,"fb-heading-line",32),n&2){let t=v();w("coords",t.vesselLines().heading)("lineStyle",t.app.selfLines().heading)("mapZoom",t.mapZoomLevel())("zIndex",344)}}function Zme(n,e){if(n&1&&j(0,"fb-cog-line",33),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 Xme(n,e){if(n&1&&j(0,"fb-wind-lines",34),n&2){let t=v();w("twd",t.dfeat.active.wind.direction)("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 Yme(n,e){if(n&1&&j(0,"fb-vessel-trail",36),n&2){let t=v();w("localTrail",t.app.selfTrail())("serverTrail",t.app.selfTrailFromServer())("zIndex",990)}}function Qme(n,e){if(n&1&&j(0,"fb-chart-bounds",39),n&2){let t=v();w("zIndex",250)("charts",t.app.data.chartBounds.charts)("layerProperties",Eo(3,Jhe))}}function Jme(n,e){if(n&1){let t=H();u(0,"button",89),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"),p(),_(3," Navigate to here "),p()}}function efe(n,e){n&1&&(u(0,"span"),_(1,"Clear Active Route"),p())}function tfe(n,e){n&1&&(u(0,"span"),_(1,"Clear Destination"),p())}function ife(n,e){if(n&1){let t=H();u(0,"button",90),T("click",function(){O(t);let r=v().item,o=v();return F(o.onContextMenuAction("cleardestination",r))}),u(1,"mat-icon"),_(2,"clear_all"),p(),R(3,efe,2,0,"span")(4,tfe,2,0,"span"),p()}if(n&2){let t=v(2);g(3),A(t.app.data.activeRoute?3:4)}}function nfe(n,e){n&1&&j(0,"mat-divider")}function rfe(n,e){if(n&1){let t=H();u(0,"button",87),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"),p(),_(3," Add Note here "),p()}}function ofe(n,e){if(n&1){let t=H();u(0,"button",89),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"),p(),_(3," Bearing & Distance "),p()}}function afe(n,e){if(n&1){let t=H();u(0,"button",90),T("click",function(){O(t);let r=v().item,o=v();return F(o.onContextMenuAction("cleartrail",r))}),u(1,"mat-icon"),_(2,"clear_all"),p(),u(3,"span"),_(4),p()()}if(n&2){let t=v(2);g(4),q("",t.app.data.serverTrail?"Refresh":"Clear"," Trail")}}function sfe(n,e){if(n&1){let t=H();u(0,"button",90),T("click",function(){O(t);let r=v().item,o=v();return F(o.onContextMenuAction("weather_forecast",r))}),u(1,"mat-icon"),_(2,"air"),p(),u(3,"span"),_(4,"Weather Forecast"),p()()}}function lfe(n,e){if(n&1){let t=H();u(0,"button",90),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"),p(),u(3,"span"),_(4,"Get Feature Info"),p()()}}function cfe(n,e){if(n&1){let t=H();j(0,"mat-divider"),u(1,"button",87),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"),p(),_(4," Add widget here "),p()}}function dfe(n,e){if(n&1){let t=H();R(0,Jme,4,0,"button",86),R(1,ife,5,1,"button",86),R(2,nfe,1,0,"mat-divider"),u(3,"button",87),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",88),_(5,"add_location"),p(),_(6," Add Waypoint here "),p(),R(7,rfe,4,0,"button",86),j(8,"mat-divider"),R(9,ofe,4,0,"button",86),u(10,"button",87),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"),p(),_(13," Measure "),p(),j(14,"mat-divider"),R(15,afe,5,1,"button",86),u(16,"button",87),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"),p(),_(19," Trail to Route "),p(),j(20,"mat-divider"),u(21,"button",87),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"),p(),_(24," Anchor Watch "),p(),R(25,sfe,5,0,"button",86),R(26,lfe,5,0,"button",86),R(27,cfe,5,0)}if(n&2){let t=v();A(t.app.data.vessels.showSelf?0:-1),g(),A(t.course.courseData().position?1:-1),g(),A(t.app.data.vessels.showSelf||t.course.courseData().position?2:-1),g(5),A(t.mapZoomLevel()>=t.app.config.resources.notes.minZoom?7:-1),g(2),A(t.app.data.vessels.showSelf?9:-1),g(6),A(t.app.config.vessels.trail&&t.app.selfTrail().length!==0?15:-1),g(10),A(t.app.featureFlags().weatherApi?25:-1),g(),A(t.app.config.experiments&&t.mapService.featureUrls().length?26:-1),g(),A(t.addableWidgetCell?27:-1)}}var NE=class n{setFocus;mapCenter=[0,0];mapZoom=1;movingMap=!1;northUp=!0;measureMode;drawMode;modifyMode=!1;activeRoute;vesselTrail=[];dblClickZoom=!1;overZoomTiles=!0;drawEnded=new pe;activate=new pe;deactivate=new pe;info=new pe;exitMovingMap=new pe;focusVessel=new pe;menuItemSelected=new pe;contextMenu;olMap;scaleUnits=Z("");perfLaylines=J({port:[],starboard:[]});perfTargetAngle=J([]);vesselLines=J({cog:[],heading:[]});overlay=J({id:null,type:null,icon:null,position:[0,0],show:!1,title:"",content:null,featureCount:0,readOnly:!1,isSelf:!1});olMapControls=MB;olMapInteractions=J([]);mapZoomLevel=J(1);mapCenterPositon=J([0,0]);mapRotation=J(0);showNoteslayer=J(!1);featureStyles={route:IB,region:PB,anchor:kB,alarm:RB,destination:LB,aircraft:AB,sar:OB,layline:FB,targetAngle:NB,raceCourse:EB,bearingDistance:TB};draftRouteStyles=DB;bufferRoutes=Fi(()=>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 _d,ais:new Map,active:new _d,navData:{position:null,startPosition:null},closest:[]};saveTimer;isDirty=!1;mouse=J({pixel:null,coords:[0,0],xy:null});cursorInfo=J(null);contextMenuPosition={x:"0px",y:"0px"};addableWidgetCell=null;obsList=[];http=M(Ia);app=M(re);skres=M(Dt);skresOther=M(bu);skstream=M(Za);anchor=M(Of);notiMgr=M(il);plotterExt=M(Mf);course=M(Mo);mapInteract=M(gc);mapService=M(Sl);settings=M(uf);bottomSheet=M(Lu);infoPanel=M(wu);routeBuffers=M(_u);tidalCurrents=M(gd);ngZone=M(zi);constructor(){Te(()=>{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("trailFromServer")&&(this.app.config.vessels.trailFromServer||this.app.selfTrailFromServer.update(()=>[]))}))}ngOnDestroy(){this.stopSaveTimer(),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.startSaveTimer():this.stopSaveTimer(),this.centerVessel()),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.app.mapExtent()[0]<180&&this.app.mapExtent()[2]>180&&this.overlay().position[0]<0&&this.overlay().position[0]>-180&&this.overlay.update(i=>Object.assign({},i,{position:[i.position[0]+360,i.position[1]]}))),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:"keyboardzoom"},{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(pC,{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}}onMapMoveEnd(e){this.app.config.map.zoomLevel=e.zoom,this.app.mapExtent.update(()=>e.extent),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.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:di.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,Ja.getGreatCircleBearing)(this.mapInteract.measurement().coords.slice(-1)[0],t);this.overlay.update(o=>Object.assign({},o,{position:t,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,Ja.getGreatCircleBearing)(this.mapInteract.measurement().center??t,t);this.overlay.update(o=>Object.assign({},o,{position:t,title:`${this.app.formatValueForDisplay(i,"m")} ${this.app.formatValueForDisplay(r,"deg")}`}))}}}onMapPointerDrag(){!this.app.config.map.lockMoveMap&&this.app.uiConfig().mapMove&&this.ngZone.run(()=>this.exitMovingMap.emit(!0))}updateCursorInfo(e){let t=this.app.data.vessels.self;if(!this.app.config.display.statusBar?.liveEta||!t?.positionReceived||!t.position){this.cursorInfo.set(null);return}let i=We.transform(1,"m/s",this.app.config.units.speed)??1,r=this.app.config.display.statusBar.referenceSpeed,o=i>0&&typeof r=="number"?r/i:0;this.cursorInfo.set(SB(t.position,e,t.sog,o))}onMapPointerDown(e){this.mouse.update(t=>yi(he({},t),{coords:di.normaliseCoords(e.lonlat)})),this.contextMenuPosition.x=e.clientX+"px",this.contextMenuPosition.y=e.clientY+"px"}onMapSingleClick(e){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.isDrawing()&&!this.mapInteract.isModifying()&&(this.app.config.map.popoverMulti||this.overlay.update(t=>Object.assign({},t,{show:!1})),this.processMapClick(e))}onMapRightClick(e){this.app.data.map.atClick=e,this.app.debug("onRightClick()",this.app.data.map.atClick),this.mapInteract.isMeasuring()&&this.parseClickInMeasureMode(e.lonlat)}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=sn(e.coordinate);this.mapInteract.initBoxCoord(t)}onDragBoxEnd(e){let t=sn(e.coordinate);this.mapInteract.stopBoxSelection(t)}onDragBoxCancel(e){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=>sn(r));i=i.slice(0,i.length-1),this.mapInteract.measurementCoords=i,t=i}else{let i=e.feature.getGeometry(),r=sn(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,Ja.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=>sn(r)),t=t.slice(0,t.length-1))}),this.mapInteract.measurementCoords=t}}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 vs;t.name=e.name??"",t.description=e.description??"",t.feature.geometry.coordinates=e.points.map(r=>r.position);let i=e.points.map(r=>he(he({},r.name?{name:r.name}:{}),r.description?{description:r.description}:{}));return i.some(r=>Object.keys(r).length>0)&&(t.feature.properties.coordinatesMeta=i),t.distance=di.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)}saveRouteFromPopover(){return ee(this,null,function*(){try{yield this.plotterExt.saveBuffer(this.overlay().id,{dialog:!0})}catch(e){}})}modifyFeature(e){if(this.mapInteract.draw.features.getLength()!==0){if(this.mapInteract.startModifying(this.overlay()),this.overlay().type==="route"){let t=this.overlay().id;this.mapInteract.measurementCoords=this.routeBuffers.has(t)?this.routeBuffers.get(t).points.map(i=>i.position):this.skres.fromCache("routes",t)[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();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;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=sn(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)}processMapClick(e){this.s57Features={};let t=new Map,i=new Map,r=[],o=!1;if(e.features.forEach(a=>{let s=a.getId(),l=!1,c,d,h,m,f,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":y={svgIcon:"route",name:void 0,class:"icon-route"},l=!0;let D=this.getUnsavedRouteBuffer(S[1]);D?b=D.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,h=this.app.data.meteo.get(s),b=h?h.name||h.mmsi:"Weather Station";break;case"ais-vessels":y={name:"directions_boat",svgIcon:void 0},l=!0,f=this.dfeat.ais.get(`vessels.${S[1]}`),b=f?f.name||f.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"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&&CB.has(S.layer)&&(s=`s57.${S.LNAM}`,l=!0,y={name:"beenhere",svgIcon:void 0},b=FE[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))}),i.size>0){this.formatPopover("chartlist.",e.lonlat,i);return}if(!o)if(this.mapInteract.draw.features=new Dn(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={};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,readOnly:!1,isSelf:!1},o=null,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=di.distanceTo(this.app.data.vessels.self.position,t)??0,c=(0,Ja.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(h=>r.content.push(h)),r.show=!0;break;case"chartlist":r.type=a[0],r.content=[],i.forEach(h=>r.content.push(h)),r.show=!0;break;case"alarm":s=e.split(".").slice(1).join(".");let d=this.notiMgr.getAlert(s);if(!d)return!1;r.type=a[0],r.alarm=d,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"tidal":{let h=this.tidalFeatures[e];r.id=e,r.type="tidal",r.position=t,r.show=!0,r.readOnly=!0,h&&(r.tidal={speedLabel:this.tidalCurrents.formatSpeed(h.speedKn),directionLabel:`${this.app.formatValueForDisplay(h.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 h=this.getUnsavedRouteBuffer(a[1]);if(h){let m=this.bufferToFBRoute(h)[1];m.name=m.name||"(unsaved)",r.id=a[1],r.type="route",r.title="Route (unsaved)",r.resource=[a[1],m],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"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.resource=this.skresOther.fromResourceSetCache(e,!0),r.title=r.resource?.properties?.name??"Resource Set",r.show=!!r.resource;break;default:return}this.overlay.set(r)}featureListSelection(e){let t=new Dn;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 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}zoomMap(e){e?this.app.config.map.zoomLevel<this.app.MAP_ZOOM_EXTENT.max&&++this.app.config.map.zoomLevel:this.app.config.map.zoomLevel>this.app.MAP_ZOOM_EXTENT.min&&--this.app.config.map.zoomLevel}rotateMap(){this.northUp?this.mapRotation.set(0):this.mapRotation.update(()=>0-this.dfeat.active.orientation)}centerVessel(){let e=this.app.calcMapCenter();this.mapCenterPositon.update(()=>e)}drawVesselLines(e=!1){let t=this.mapZoomLevel(),i=t<29?hv[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=0;this.app.config.vessels.selfLines.heading.length===-1?s=(a>r?r:a)*i:s=We.nauticalMilesToKm(this.app.config.vessels.selfLines.heading.length)*1e3;let l=[this.dfeat.active.position,di.rhumbDestination(this.dfeat.active.position,this.dfeat.active.orientation,s)];return{cog:o,heading:l}})}buildLaylines(){if(this.app.config.vessels.laylines&&Array.isArray(this.dfeat.navData.position)&&typeof this.dfeat.navData.position[0]=="number"&&typeof this.app.data.vessels.active.heading=="number"){let e=We.radiansToDegrees(this.app.data.vessels.self.wind.direction??0),t=No.add(e,180),i=Math.abs(No.difference(this.course.courseData().bearing.value,e))<90,r=We.radiansToDegrees(this.app.data.vessels.self.performance.beatAngle??Math.PI/4),o,a;typeof this.app.data.vessels.self.performance.gybeAngle=="number"&&(o=We.radiansToDegrees(this.app.data.vessels.self.performance.gybeAngle),a=180-Math.abs(o));let s=i?Math.abs(No.difference(this.course.courseData().bearing.value,e))<r:Math.abs(No.difference(this.course.courseData().bearing.value,t))<(a??0),l=this.app.config.units.distance==="kilometer"?this.course.courseData().dtg*1e3:We.nauticalMilesToKm(this.course.courseData().dtg*1e3),c=[];if(i){let d=(0,Ja.computeDestinationPoint)(this.dfeat.navData.position,l,No.add(t,r)),h=(0,Ja.computeDestinationPoint)(this.dfeat.navData.position,l,No.add(t,0-r));c=[[d.longitude,d.latitude],this.dfeat.navData.position,[h.longitude,h.latitude]]}else if(typeof o=="number"){let d=(0,Ja.computeDestinationPoint)(this.dfeat.navData.position,l,No.add(t,o)),h=(0,Ja.computeDestinationPoint)(this.dfeat.navData.position,l,No.add(t,0-o));c=[[d.longitude,d.latitude],this.dfeat.navData.position,[h.longitude,h.latitude]]}if(this.perfTargetAngle.update(()=>c),s){let d=No.difference(e,this.course.courseData().bearing.value),h,m,f,y;if(i){let b=We.degreesToRadians(r-d),S=We.degreesToRadians(r+d),I=Math.PI-(S+b);h=l*Math.sin(S)/Math.sin(I),m=l*Math.sin(b)/Math.sin(I),f=(0,Ja.computeDestinationPoint)(this.app.data.vessels.active.position,h,No.add(e,r)),y=(0,Ja.computeDestinationPoint)(this.app.data.vessels.active.position,m,No.add(e,0-r))}else if(c.length!==0&&typeof a=="number"){let b=We.degreesToRadians(a-d),S=We.degreesToRadians(a+d),I=Math.PI-(S+b);h=l*Math.sin(S)/Math.sin(I),m=l*Math.sin(b)/Math.sin(I),f=(0,Ja.computeDestinationPoint)(this.app.data.vessels.active.position,h,No.add(e,a)),y=(0,Ja.computeDestinationPoint)(this.app.data.vessels.active.position,m,No.add(e,0-a))}this.perfLaylines.update(()=>({port:[[[y.longitude,y.latitude],this.app.data.vessels.active.position],[[f.longitude,f.latitude],this.app.data.vessels.active.position]],starboard:[[[f.longitude,f.latitude],c[1]],[c[1],[y.longitude,y.latitude]]]}))}}}deleteFeature(e,t){return ee(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}})}setActiveFeature(){this.overlay().type==="waypoint"?this.course.navigateToWaypoint(this.overlay().id):this.activate.emit(this.overlay().id)}clearActiveFeature(){this.deactivate.emit(this.overlay().id)}itemInfo(e,t,i=!1){t==="ais"&&i?this.info.emit({id:e,type:"self"}):this.info.emit({id:e,type:t})}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"?Sp.radius:Sp.measure:Sp.default),e===1&&(this.mapInteract.draw.style=this.mapInteract.draw.resourceType==="route"?Sp.route:this.mapInteract.draw.resourceType==="region"?Sp.region:Sp.default)}isCoordsArray(e){return Array.isArray(e)?Array.isArray(e[0])&&typeof e[0][0]=="number":!1}transformCoordsArray(e){return e.map(t=>sn(t))}applyStyle(){return new fe({fill:new Be({color:"#e0d10e"}),stroke:new xe({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=di.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:We.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(){let e=[].concat(this.mapService.featureUrls())}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=W({type:n,selectors:[["fb-map"]],viewQuery:function(t,i){if(t&1&&Ht(Qa,7)(Yhe,5),t&2){let r;De(r=ke())&&(i.contextMenu=r.first),De(r=ke())&&(i.olMap=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",focusVessel:"focusVessel",menuItemSelected:"menuItemSelected"},features:[Me],decls:71,vars:128,consts:[["olMap",""],["contextMenu","matMenu"],["olView","",3,"mapMoveEnd","mapSingleClick","mapRightClick","mapPointerDown","mapPointerMove","mapPointerDrag","mapContextMenu","contextmenu","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,"params","layerDefs","zIndex"],[3,"position","heading","mapZoom","zIndex","opacity"],[3,"darkMode","tracks","labelMinZoom","mapZoom","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","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","zIndex"],[3,"localTrail","serverTrail","trailStyles","zIndex"],[3,"show","opacity","indicator"],[3,"show","opacity"],[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,"canClose","compact"],[3,"canClose","title","type","resource","active","featureCount","units","canSave"],[3,"canClose","title","resource"],[3,"canClose","aton"],[3,"canClose","aircraft"],[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","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","addNote","activated","deactivated","related","notes","info","points","closed","canClose","title","type","resource","active","featureCount","units","canSave"],[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,"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"],["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",2,0),T("mapMoveEnd",function(o){return i.onMapMoveEnd(o)})("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)}),R(2,eme,1,0,"ol-dragbox"),R(3,tme,1,4,"ol-draw",3),R(4,ime,1,4,"ol-draw",4),R(5,nme,1,1,"ol-modify",5),u(6,"ol-control")(7,"ol-content")(8,"div",6)(9,"button",7),T("click",function(){return i.zoomMap(!1)}),u(10,"mat-icon"),_(11,"remove"),p()(),_(12," \xA0 "),u(13,"button",8),T("click",function(){return i.zoomMap(!0)}),u(14,"mat-icon"),_(15,"add"),p()()()()(),u(16,"ol-control")(17,"ol-content")(18,"div",9)(19,"span",10),R(20,rme,2,0,"span"),j(21,"span",11),St(22,"coords"),_(23," \xA0 "),R(24,ome,2,0,"span"),j(25,"span",11),St(26,"coords"),_(27," \xA0 "),j(28,"span",11),R(29,sme,5,4),p()()()(),Oe(30,fme,7,1,null,null,GB),j(32,"fb-livelayer",12),R(33,gme,1,5,"fb-radar",13),R(34,_me,1,5,"fb-tracks",14),R(35,yme,1,8,"ais-targets-track",15),Oe(36,vme,2,6,"div",null,GB),j(38,"fb-routes",16)(39,"fb-routes",16),R(40,bme,1,4,"fb-route-direction",17),j(41,"fb-waypoints",18)(42,"sk-ais-targets",19)(43,"sk-ais-targets",20),R(44,xme,1,10,"sk-ais-targets",21),R(45,wme,4,30,"div"),R(46,Sme,1,10,"sk-ais-targets",22),R(47,Mme,1,10,"sk-ais-targets",23),j(48,"racing-start-line",24)(49,"fb-regions",25),R(50,Tme,1,2,"fb-notes",26),R(51,Eme,3,13),R(52,Vme,12,13,"ol-overlay",27),R(53,Gme,1,5,"fb-anchor-alarm",28),R(54,jme,1,2,"fb-cpa-alarms",29),j(55,"fb-alarms",30),R(56,Kme,4,4),R(57,$me,1,9,"fb-range-circles",31),R(58,qme,1,4,"fb-heading-line",32),R(59,Zme,1,8,"fb-cog-line",33),R(60,Xme,1,6,"fb-wind-lines",34),j(61,"fb-vessel",35),R(62,Yme,1,3,"fb-vessel-trail",36),j(63,"fb-weather-wind",37)(64,"fb-weather-currents",38)(65,"fb-tidal-currents",38),R(66,Qme,1,4,"fb-chart-bounds",39),p(),j(67,"div",40),u(68,"mat-menu",41,1),T("contextmenu",function(o){return o.preventDefault()}),ct(70,dfe,28,9,"ng-template",42),p()),t&2){let r,o=Le(69);Nt("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),g(2),A(i.mapInteract.isBoxSelecting()?2:-1),g(),A(i.mapInteract.isMeasuring()?3:-1),g(),A(i.mapInteract.isDrawing()?4:-1),g(),A(i.mapInteract.isModifying()&&i.mapInteract.draw.features?5:-1),g(4),w("disabled",i.mapZoomLevel()<=i.app.MAP_ZOOM_EXTENT.min),g(4),w("disabled",i.mapZoomLevel()>=i.app.MAP_ZOOM_EXTENT.max),g(5),Nt("bottom",i.plotterExt.statusBarLift()>0?i.plotterExt.statusBarLift()+"px":null),g(2),A(i.app.config.units.positionFormat==="XY"?20:-1),g(),w("innerText",Oi(22,121,i.mouse().coords[1],i.app.config.units.positionFormat,!0)),g(3),A(i.app.config.units.positionFormat==="XY"?24:-1),g(),w("innerText",Xn(26,125,i.mouse().coords[0],i.app.config.units.positionFormat)),g(3),w("innerText","Zm: "+i.mapZoomLevel().toFixed(1)),g(),A((r=i.cursorInfo())?29:-1,r),g(),Fe(i.skres.charts()),g(2),w("params",i.skresOther.infoLayerParams())("layerDefs",i.skresOther.infoLayers())("zIndex",50),g(),A(i.app.uiCtrl().radarLayer?33:-1),g(),A(i.app.featureFlags().resourceTracks?34:-1),g(),A(i.app.config.ui.showAisTargets&&(i.app.config.vessels.aisShowTrack||i.app.data.vessels.showTrack.length>0)?35:-1),g(),Fe(i.skresOther.resourceSets()),g(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),g(),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),g(),A(i.activeRoute&&!i.app.data.activeRouteIsEditing?40:-1),g(),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),g(),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),g(),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),g(),A(i.app.config.ui.showAisTargets?44:-1),g(),A(i.app.config.ui.showAisTargets?45:-1),g(),A(i.app.config.ui.showAisTargets?46:-1),g(),A(i.app.config.ui.showAisTargets?47:-1),g(),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),g(),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),g(),A(i.showNoteslayer()?50:-1),g(),A(i.overlay().show&&i.overlay().type==="bearing_dist"?51:-1),g(),A(i.overlay().show&&!i.mapInteract.isModifying()?52:-1),g(),A(i.anchor.raised()?-1:53),g(),A(i.dfeat.closest.length!==0?54:-1),g(),w("alarms",i.notiMgr.mobAlerts())("alarmStyles",i.featureStyles.alarm)("zIndex",995),g(),A(i.anchor.raised()&&i.dfeat.navData.position?56:-1),g(),A(i.app.config.vessels.rangeCircles?57:-1),g(),A(i.app.config.vessels.selfLines.cog.length!==0?58:-1),g(),A(i.app.config.vessels.selfLines.cog.length!==0?59:-1),g(),A(i.app.config.vessels.windVectors?60:-1),g(),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)("zIndex",999),g(),A(i.app.config.vessels.trail&&i.app.data.vessels.showSelf?62:-1),g(),w("show",i.app.config.selections.weatherWindEnabled)("opacity",.55)("indicator",i.app.config.display.windIndicator),g(),w("show",i.app.config.selections.oceanCurrentsEnabled)("opacity",.55),g(),w("show",i.app.config.selections.tidalCurrentsEnabled)("opacity",.7),g(),A(i.app.data.chartBounds.show?66:-1),g(),Nt("left",i.contextMenuPosition.x)("top",i.contextMenuPosition.y),w("matMenuTriggerFor",o)}},dependencies:[ve,Ie,xn,Da,ae,le,ue,Ms,qe,nl,la,wa,wN,Qa,hf,Wh,tu,eu,Ee,zh,iu,Yh,Qh,Jh,em,am,sm,lu,cm,pm,um,df,hm,mm,fm,gm,_m,ym,vm,bm,xm,Cm,Sm,Mm,wm,Tm,Em,Im,Dm,km,Pm,Rm,Lm,Am,pf,Vm,ef,tf,nf,rf,of,cf,Lr,rC,oC,lC,aC,sC,Qx,Jx,nC,cC,dC,uC,p1,dn],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}.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 ufe=["button"],pfe=["*"];function hfe(n,e){if(n&1&&(u(0,"div",2),j(1,"mat-pseudo-checkbox",6),p()),n&2){let t=v();g(),w("disabled",t.disabled)}}var jB=new Ct("MAT_BUTTON_TOGGLE_DEFAULT_OPTIONS",{providedIn:"root",factory:()=>({hideSingleSelectionIndicator:!1,hideMultipleSelectionIndicator:!1,disabledInteractive:!1})}),zB=new Ct("MatButtonToggleGroup"),mfe={provide:as,useExisting:is(()=>BE),multi:!0},hC=class{source;value;constructor(e,t){this.source=e,this.value=t}},BE=(()=>{class n{_changeDetector=M(oe);_dir=M(oo,{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(rr).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 pe;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 pe;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(jB,{optional:!0});this.appearance=t&&t.appearance?t.appearance:"standard",this._hideSingleSelectionIndicator=t?.hideSingleSelectionIndicator??!1,this._hideMultipleSelectionIndicator=t?.hideMultipleSelectionIndicator??!1}ngOnInit(){this._selectionModel=new J1(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||ws(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 hC(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=st({type:n,selectors:[["mat-button-toggle-group"]],contentQueries:function(i,r,o){if(i&1&&an(o,mC,5),i&2){let a;De(a=ke())&&(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&&(lt("role",r.multiple?"group":"radiogroup")("aria-disabled",r.disabled),yt("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:[Rt([mfe,{provide:zB,useExisting:n}])]})}return n})(),mC=(()=>{class n{_changeDetectorRef=M(oe);_elementRef=M(wt);_focusMonitor=M(Ho);_idGenerator=M(rr);_animationDisabled=Yn();_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 pe;constructor(){M(Ir).load($r);let t=M(zB,{optional:!0}),i=M(new Fl("tabindex"),{optional:!0})||"",r=M(jB,{optional:!0});this._tabIndex=J(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 hC(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=W({type:n,selectors:[["mat-button-toggle"]],viewQuery:function(i,r){if(i&1&&Ht(ufe,5),i&2){let o;De(o=ke())&&(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&&(lt("aria-label",null)("aria-labelledby",null)("id",r.id)("name",null),yt("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:pfe,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&&(ge(),u(0,"button",1,0),T("click",function(){return r._onButtonClick()}),R(2,hfe,2,1,"div",2),u(3,"span",3),ce(4),p()(),j(5,"span",4)(6,"span",5)),i&2){let o=Le(1);w("id",r.buttonId)("disabled",r.disabled&&!r.disabledInteractive||null),lt("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),g(2),A(r.buttonToggleGroup&&(!r.buttonToggleGroup.multiple&&!r.buttonToggleGroup.hideSingleSelectionIndicator||r.buttonToggleGroup.multiple&&!r.buttonToggleGroup.hideMultipleSelectionIndicator)?2:-1),g(4),w("matRippleTrigger",o)("matRippleDisabled",r.disableRipple||r.disabled)}},dependencies:[Ko,AI],styles:[`.mat-button-toggle-standalone,
3873
3873
  .mat-button-toggle-group {
3874
3874
  position: relative;
3875
3875
  display: inline-flex;