@mxtommy/kip 4.5.2 → 4.6.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.
Files changed (35) hide show
  1. package/CHANGELOG.md +12 -3
  2. package/package.json +13 -15
  3. package/plugin/history-series.service.js +14 -24
  4. package/plugin/index.js +139 -95
  5. package/plugin/{duckdb-parquet-storage.service.js → sqlite-history-storage.service.js} +330 -503
  6. package/public/assets/help-docs/widget-historical-series.md +5 -5
  7. package/public/{chunk-TVNXBPFF.js → chunk-356CW47X.js} +1 -1
  8. package/public/{chunk-NFJ4RQSE.js → chunk-3JA4CQ7T.js} +1 -1
  9. package/public/{chunk-VXTTEFRP.js → chunk-5SAXWR6Z.js} +8 -8
  10. package/public/{chunk-67V4XHCY.js → chunk-6A4NRSCL.js} +1 -1
  11. package/public/{chunk-P7JKENHI.js → chunk-AC6VD2FN.js} +1 -1
  12. package/public/{chunk-TBNKOU7M.js → chunk-B4NYOD6L.js} +1 -1
  13. package/public/{chunk-WH5CIUSB.js → chunk-BGGO4PGD.js} +1 -1
  14. package/public/{chunk-KQEEYPK3.js → chunk-BMHMHQFO.js} +1 -1
  15. package/public/{chunk-RCYOZLZB.js → chunk-CSIELI2Z.js} +2 -2
  16. package/public/{chunk-R36UY4Q4.js → chunk-CYTLQDGF.js} +1 -1
  17. package/public/{chunk-YI3MZWRZ.js → chunk-HSKVTFFQ.js} +1 -1
  18. package/public/{chunk-IH4CEW4C.js → chunk-MDNGWQNG.js} +8 -8
  19. package/public/{chunk-VPF5756E.js → chunk-MGLD6QDJ.js} +1 -1
  20. package/public/{chunk-P4CRTB7N.js → chunk-NJISHUGY.js} +1 -1
  21. package/public/{chunk-ISF5E3CX.js → chunk-P3M6SJQT.js} +11 -11
  22. package/public/{chunk-WQSJFJLW.js → chunk-POMIQBAL.js} +2 -2
  23. package/public/{chunk-SJFJEOSG.js → chunk-PPF5S5CV.js} +1 -1
  24. package/public/{chunk-OPTBDYBL.js → chunk-PUPM3HUQ.js} +1 -1
  25. package/public/chunk-PZ6I6W3H.js +16 -0
  26. package/public/{chunk-VXCYPAWR.js → chunk-QU3JR4YV.js} +1 -1
  27. package/public/{chunk-Q2ANAJAD.js → chunk-SUWMN3AE.js} +1 -1
  28. package/public/{chunk-CD5TQSCS.js → chunk-UYHRT3PR.js} +1 -1
  29. package/public/{chunk-FZFDGAQO.js → chunk-WJFXI5PQ.js} +1 -1
  30. package/public/{chunk-I4SJ5UNN.js → chunk-ZXO4VMEH.js} +1 -1
  31. package/public/{chunk-XBSU7OGT.js → chunk-ZY3U4H4Z.js} +1 -1
  32. package/public/index.html +1 -1
  33. package/public/{main-B6TXB3EB.js → main-I33LH3HC.js} +1 -1
  34. package/plugin/plugin-auth.service.js +0 -75
  35. package/public/chunk-BTFZS2TW.js +0 -16
@@ -1,2 +1,2 @@
1
- import{a as et,b as gt,p as ft,q as vt,r as Dt,s as bt,t as wt,u as St}from"./chunk-ISF5E3CX.js";import{c as ut}from"./chunk-VXTTEFRP.js";import{a as Ct}from"./chunk-TBNKOU7M.js";import{e as Pt,f as yt,h as xt,j as Et}from"./chunk-VPF5756E.js";import"./chunk-RCYOZLZB.js";import"./chunk-NFJ4RQSE.js";import"./chunk-SJFJEOSG.js";import{e as _t}from"./chunk-FZFDGAQO.js";import{b as mt}from"./chunk-YI3MZWRZ.js";import"./chunk-67V4XHCY.js";import"./chunk-P7JKENHI.js";import{$b as Je,Ab as Ye,Ac as ge,Bb as Xe,Ca as S,Cb as R,Da as F,Db as p,Eb as g,Fa as re,Fb as j,Gd as rt,Ha as We,I as Be,J as W,Jc as me,Ka as ae,Lc as O,Mb as q,Mc as Qe,Nd as at,Ob as m,Pe as be,Q as ze,Qb as P,Re as M,Se as L,Ua as le,Va as b,Vd as fe,Xa as Ue,Za as de,_a as Ze,ac as he,ae as lt,ba as se,ca as Ve,cb as je,cc as H,ce as dt,da as N,dc as f,de as ve,ea as Ge,ec as pe,fb as I,fe as ct,g as T,gd as tt,hb as ce,hd as it,he as ht,id as K,j as ne,je as Y,k as _,ka as $e,kd as B,m as Ne,md as ue,na as k,od as C,p as Fe,pa as c,rc as _e,rd as nt,td as st,ua as y,ub as Z,va as x,vd as ot,ve as pt,wb as qe,xb as Ke,xe as De,ya as oe,z as He,za as U}from"./chunk-BTFZS2TW.js";function Pe(o){let t=o.cloneNode(!0),e=t.querySelectorAll("[id]"),i=o.nodeName.toLowerCase();t.removeAttribute("id");for(let n=0;n<e.length;n++)e[n].removeAttribute("id");return i==="canvas"?Tt(o,t):(i==="input"||i==="select"||i==="textarea")&&Rt(o,t),It("canvas",o,t,Tt),It("input, textarea, select",o,t,Rt),t}function It(o,t,e,i){let n=t.querySelectorAll(o);if(n.length){let s=e.querySelectorAll(o);for(let r=0;r<n.length;r++)i(n[r],s[r])}}var si=0;function Rt(o,t){t.type!=="file"&&(t.value=o.value),t.type==="radio"&&t.name&&(t.name=`mat-clone-${t.name}-${si++}`)}function Tt(o,t){let e=t.getContext("2d");if(e)try{e.drawImage(o,0,0)}catch(i){}}function Te(o){let t=o.getBoundingClientRect();return{top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height,x:t.x,y:t.y}}function ye(o,t,e){let{top:i,bottom:n,left:s,right:r}=o;return e>=i&&e<=n&&t>=s&&t<=r}function oi(o,t){let e=t.left<o.left,i=t.left+t.width>o.right,n=t.top<o.top,s=t.top+t.height>o.bottom;return e||i||n||s}function G(o,t,e){o.top+=t,o.bottom=o.top+o.height,o.left+=e,o.right=o.left+o.width}function kt(o,t,e,i){let{top:n,right:s,bottom:r,left:a,width:l,height:d}=o,h=l*t,v=d*t;return i>n-v&&i<r+v&&e>a-h&&e<s+h}var X=class{_document;positions=new Map;constructor(t){this._document=t}clear(){this.positions.clear()}cache(t){this.clear(),this.positions.set(this._document,{scrollPosition:this.getViewportScrollPosition()}),t.forEach(e=>{this.positions.set(e,{scrollPosition:{top:e.scrollTop,left:e.scrollLeft},clientRect:Te(e)})})}handleScroll(t){let e=B(t),i=this.positions.get(e);if(!i)return null;let n=i.scrollPosition,s,r;if(e===this._document){let d=this.getViewportScrollPosition();s=d.top,r=d.left}else s=e.scrollTop,r=e.scrollLeft;let a=n.top-s,l=n.left-r;return this.positions.forEach((d,h)=>{d.clientRect&&e!==h&&e.contains(h)&&G(d.clientRect,a,l)}),n.top=s,n.left=r,{top:a,left:l}}getViewportScrollPosition(){return{top:window.scrollY,left:window.scrollX}}};function Wt(o,t){let e=o.rootNodes;if(e.length===1&&e[0].nodeType===t.ELEMENT_NODE)return e[0];let i=t.createElement("div");return e.forEach(n=>i.appendChild(n)),i}function ke(o,t,e){for(let i in t)if(t.hasOwnProperty(i)){let n=t[i];n?o.setProperty(i,n,e?.has(i)?"important":""):o.removeProperty(i)}return o}function A(o,t){let e=t?"":"none";ke(o.style,{"touch-action":t?"":"none","-webkit-user-drag":t?"":"none","-webkit-tap-highlight-color":t?"":"transparent","user-select":e,"-ms-user-select":e,"-webkit-user-select":e,"-moz-user-select":e})}function Ot(o,t,e){ke(o.style,{position:t?"":"fixed",top:t?"":"0",opacity:t?"":"0",left:t?"":"-999em"},e)}function J(o,t){return t&&t!="none"?o+" "+t:o}function Mt(o,t){o.style.width=`${t.width}px`,o.style.height=`${t.height}px`,o.style.transform=$(t.left,t.top)}function $(o,t){return`translate3d(${Math.round(o)}px, ${Math.round(t)}px, 0)`}var z={capture:!0},we={passive:!1,capture:!0},ri=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275cmp=I({type:o,selectors:[["ng-component"]],hostAttrs:["cdk-drag-resets-container",""],decls:0,vars:0,template:function(i,n){},styles:[`@layer cdk-resets{.cdk-drag-preview{background:none;border:none;padding:0;color:inherit;inset:auto}}.cdk-drag-placeholder *,.cdk-drag-preview *{pointer-events:none !important}
1
+ import{a as et,b as gt,p as ft,q as vt,r as Dt,s as bt,t as wt,u as St}from"./chunk-P3M6SJQT.js";import{c as ut}from"./chunk-5SAXWR6Z.js";import{a as Ct}from"./chunk-B4NYOD6L.js";import{e as Pt,f as yt,h as xt,j as Et}from"./chunk-MGLD6QDJ.js";import"./chunk-CSIELI2Z.js";import"./chunk-3JA4CQ7T.js";import"./chunk-PPF5S5CV.js";import{e as _t}from"./chunk-WJFXI5PQ.js";import{b as mt}from"./chunk-HSKVTFFQ.js";import"./chunk-6A4NRSCL.js";import"./chunk-AC6VD2FN.js";import{$b as Je,Ab as Ye,Ac as ge,Bb as Xe,Ca as S,Cb as R,Da as F,Db as p,Eb as g,Fa as re,Fb as j,Gd as rt,Ha as We,I as Be,J as W,Jc as me,Ka as ae,Lc as O,Mb as q,Mc as Qe,Nd as at,Ob as m,Pe as be,Q as ze,Qb as P,Re as M,Se as L,Ua as le,Va as b,Vd as fe,Xa as Ue,Za as de,_a as Ze,ac as he,ae as lt,ba as se,ca as Ve,cb as je,cc as H,ce as dt,da as N,dc as f,de as ve,ea as Ge,ec as pe,fb as I,fe as ct,g as T,gd as tt,hb as ce,hd as it,he as ht,id as K,j as ne,je as Y,k as _,ka as $e,kd as B,m as Ne,md as ue,na as k,od as C,p as Fe,pa as c,rc as _e,rd as nt,td as st,ua as y,ub as Z,va as x,vd as ot,ve as pt,wb as qe,xb as Ke,xe as De,ya as oe,z as He,za as U}from"./chunk-PZ6I6W3H.js";function Pe(o){let t=o.cloneNode(!0),e=t.querySelectorAll("[id]"),i=o.nodeName.toLowerCase();t.removeAttribute("id");for(let n=0;n<e.length;n++)e[n].removeAttribute("id");return i==="canvas"?Tt(o,t):(i==="input"||i==="select"||i==="textarea")&&Rt(o,t),It("canvas",o,t,Tt),It("input, textarea, select",o,t,Rt),t}function It(o,t,e,i){let n=t.querySelectorAll(o);if(n.length){let s=e.querySelectorAll(o);for(let r=0;r<n.length;r++)i(n[r],s[r])}}var si=0;function Rt(o,t){t.type!=="file"&&(t.value=o.value),t.type==="radio"&&t.name&&(t.name=`mat-clone-${t.name}-${si++}`)}function Tt(o,t){let e=t.getContext("2d");if(e)try{e.drawImage(o,0,0)}catch(i){}}function Te(o){let t=o.getBoundingClientRect();return{top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height,x:t.x,y:t.y}}function ye(o,t,e){let{top:i,bottom:n,left:s,right:r}=o;return e>=i&&e<=n&&t>=s&&t<=r}function oi(o,t){let e=t.left<o.left,i=t.left+t.width>o.right,n=t.top<o.top,s=t.top+t.height>o.bottom;return e||i||n||s}function G(o,t,e){o.top+=t,o.bottom=o.top+o.height,o.left+=e,o.right=o.left+o.width}function kt(o,t,e,i){let{top:n,right:s,bottom:r,left:a,width:l,height:d}=o,h=l*t,v=d*t;return i>n-v&&i<r+v&&e>a-h&&e<s+h}var X=class{_document;positions=new Map;constructor(t){this._document=t}clear(){this.positions.clear()}cache(t){this.clear(),this.positions.set(this._document,{scrollPosition:this.getViewportScrollPosition()}),t.forEach(e=>{this.positions.set(e,{scrollPosition:{top:e.scrollTop,left:e.scrollLeft},clientRect:Te(e)})})}handleScroll(t){let e=B(t),i=this.positions.get(e);if(!i)return null;let n=i.scrollPosition,s,r;if(e===this._document){let d=this.getViewportScrollPosition();s=d.top,r=d.left}else s=e.scrollTop,r=e.scrollLeft;let a=n.top-s,l=n.left-r;return this.positions.forEach((d,h)=>{d.clientRect&&e!==h&&e.contains(h)&&G(d.clientRect,a,l)}),n.top=s,n.left=r,{top:a,left:l}}getViewportScrollPosition(){return{top:window.scrollY,left:window.scrollX}}};function Wt(o,t){let e=o.rootNodes;if(e.length===1&&e[0].nodeType===t.ELEMENT_NODE)return e[0];let i=t.createElement("div");return e.forEach(n=>i.appendChild(n)),i}function ke(o,t,e){for(let i in t)if(t.hasOwnProperty(i)){let n=t[i];n?o.setProperty(i,n,e?.has(i)?"important":""):o.removeProperty(i)}return o}function A(o,t){let e=t?"":"none";ke(o.style,{"touch-action":t?"":"none","-webkit-user-drag":t?"":"none","-webkit-tap-highlight-color":t?"":"transparent","user-select":e,"-ms-user-select":e,"-webkit-user-select":e,"-moz-user-select":e})}function Ot(o,t,e){ke(o.style,{position:t?"":"fixed",top:t?"":"0",opacity:t?"":"0",left:t?"":"-999em"},e)}function J(o,t){return t&&t!="none"?o+" "+t:o}function Mt(o,t){o.style.width=`${t.width}px`,o.style.height=`${t.height}px`,o.style.transform=$(t.left,t.top)}function $(o,t){return`translate3d(${Math.round(o)}px, ${Math.round(t)}px, 0)`}var z={capture:!0},we={passive:!1,capture:!0},ri=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275cmp=I({type:o,selectors:[["ng-component"]],hostAttrs:["cdk-drag-resets-container",""],decls:0,vars:0,template:function(i,n){},styles:[`@layer cdk-resets{.cdk-drag-preview{background:none;border:none;padding:0;color:inherit;inset:auto}}.cdk-drag-placeholder *,.cdk-drag-preview *{pointer-events:none !important}
2
2
  `],encapsulation:2,changeDetection:0})}return o})(),Oe=(()=>{class o{_ngZone=c(F);_document=c(U);_styleLoader=c(nt);_renderer=c(de).createRenderer(null,null);_cleanupDocumentTouchmove;_scroll=new _;_dropInstances=new Set;_dragInstances=new Set;_activeDragInstances=re([]);_globalListeners;_draggingPredicate=e=>e.isDragging();_domNodesToDirectives=null;pointerMove=new _;pointerUp=new _;constructor(){}registerDropContainer(e){this._dropInstances.has(e)||this._dropInstances.add(e)}registerDragItem(e){this._dragInstances.add(e),this._dragInstances.size===1&&this._ngZone.runOutsideAngular(()=>{this._cleanupDocumentTouchmove?.(),this._cleanupDocumentTouchmove=this._renderer.listen(this._document,"touchmove",this._persistentTouchmoveListener,we)})}removeDropContainer(e){this._dropInstances.delete(e)}removeDragItem(e){this._dragInstances.delete(e),this.stopDragging(e),this._dragInstances.size===0&&this._cleanupDocumentTouchmove?.()}startDragging(e,i){if(!(this._activeDragInstances().indexOf(e)>-1)&&(this._styleLoader.load(ri),this._activeDragInstances.update(n=>[...n,e]),this._activeDragInstances().length===1)){let n=i.type.startsWith("touch"),s=a=>this.pointerUp.next(a),r=[["scroll",a=>this._scroll.next(a),z],["selectstart",this._preventDefaultWhileDragging,we]];n?r.push(["touchend",s,z],["touchcancel",s,z]):r.push(["mouseup",s,z]),n||r.push(["mousemove",a=>this.pointerMove.next(a),we]),this._ngZone.runOutsideAngular(()=>{this._globalListeners=r.map(([a,l,d])=>this._renderer.listen(this._document,a,l,d))})}}stopDragging(e){this._activeDragInstances.update(i=>{let n=i.indexOf(e);return n>-1?(i.splice(n,1),[...i]):i}),this._activeDragInstances().length===0&&this._clearGlobalListeners()}isDragging(e){return this._activeDragInstances().indexOf(e)>-1}scrolled(e){let i=[this._scroll];return e&&e!==this._document&&i.push(new ne(n=>this._ngZone.runOutsideAngular(()=>{let s=this._renderer.listen(e,"scroll",r=>{this._activeDragInstances().length&&n.next(r)},z);return()=>{s()}}))),W(...i)}registerDirectiveNode(e,i){this._domNodesToDirectives??=new WeakMap,this._domNodesToDirectives.set(e,i)}removeDirectiveNode(e){this._domNodesToDirectives?.delete(e)}getDragDirectiveForNode(e){return this._domNodesToDirectives?.get(e)||null}ngOnDestroy(){this._dragInstances.forEach(e=>this.removeDragItem(e)),this._dropInstances.forEach(e=>this.removeDropContainer(e)),this._domNodesToDirectives=null,this._clearGlobalListeners(),this.pointerMove.complete(),this.pointerUp.complete()}_preventDefaultWhileDragging=e=>{this._activeDragInstances().length>0&&e.preventDefault()};_persistentTouchmoveListener=e=>{this._activeDragInstances().length>0&&(this._activeDragInstances().some(this._draggingPredicate)&&e.preventDefault(),this.pointerMove.next(e))};_clearGlobalListeners(){this._globalListeners?.forEach(e=>e()),this._globalListeners=void 0}static \u0275fac=function(i){return new(i||o)};static \u0275prov=$e({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();function Lt(o){let t=o.toLowerCase().indexOf("ms")>-1?1:1e3;return parseFloat(o)*t}function ai(o){let t=getComputedStyle(o),e=Se(t,"transition-property"),i=e.find(a=>a==="transform"||a==="all");if(!i)return 0;let n=e.indexOf(i),s=Se(t,"transition-duration"),r=Se(t,"transition-delay");return Lt(s[n])+Lt(r[n])}function Se(o,t){return o.getPropertyValue(t).split(",").map(i=>i.trim())}var li=new Set(["position"]),xe=class{_document;_rootElement;_direction;_initialDomRect;_previewTemplate;_previewClass;_pickupPositionOnPage;_initialTransform;_zIndex;_renderer;_previewEmbeddedView=null;_preview;get element(){return this._preview}constructor(t,e,i,n,s,r,a,l,d,h){this._document=t,this._rootElement=e,this._direction=i,this._initialDomRect=n,this._previewTemplate=s,this._previewClass=r,this._pickupPositionOnPage=a,this._initialTransform=l,this._zIndex=d,this._renderer=h}attach(t){this._preview=this._createPreview(),t.appendChild(this._preview),At(this._preview)&&this._preview.showPopover()}destroy(){this._preview.remove(),this._previewEmbeddedView?.destroy(),this._preview=this._previewEmbeddedView=null}setTransform(t){this._preview.style.transform=t}getBoundingClientRect(){return this._preview.getBoundingClientRect()}addClass(t){this._preview.classList.add(t)}getTransitionDuration(){return ai(this._preview)}addEventListener(t,e){return this._renderer.listen(this._preview,t,e)}_createPreview(){let t=this._previewTemplate,e=this._previewClass,i=t?t.template:null,n;if(i&&t){let s=t.matchSize?this._initialDomRect:null,r=t.viewContainer.createEmbeddedView(i,t.context);r.detectChanges(),n=Wt(r,this._document),this._previewEmbeddedView=r,t.matchSize?Mt(n,s):n.style.transform=$(this._pickupPositionOnPage.x,this._pickupPositionOnPage.y)}else n=Pe(this._rootElement),Mt(n,this._initialDomRect),this._initialTransform&&(n.style.transform=this._initialTransform);return ke(n.style,{"pointer-events":"none",margin:At(n)?"0 auto 0 0":"0",position:"fixed",top:"0",left:"0","z-index":this._zIndex+""},li),A(n,!1),n.classList.add("cdk-drag-preview"),n.setAttribute("popover","manual"),n.setAttribute("dir",this._direction),e&&(Array.isArray(e)?e.forEach(s=>n.classList.add(s)):n.classList.add(e)),n}};function At(o){return"showPopover"in o}var di={passive:!0},Nt={passive:!1},ci={passive:!1,capture:!0},hi=800,Ft="cdk-drag-placeholder",Ht=new Set(["position"]);function pi(o,t,e={dragStartThreshold:5,pointerDirectionChangeThreshold:5}){let i=o.get(Ze,null,{optional:!0})||o.get(de).createRenderer(null,null);return new Ee(t,e,o.get(U),o.get(F),o.get(De),o.get(Oe),i)}var Ee=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=re(!1);_hasMoved=!1;_initialContainer;_initialIndex;_parentPositions;_moveEvents=new _;_pointerDirectionDelta;_pointerPositionAtLastDirectionChange;_lastKnownPointerPosition;_rootElement;_ownerSVGElement=null;_rootElementTapHighlight;_pointerMoveSubscription=T.EMPTY;_pointerUpSubscription=T.EMPTY;_scrollSubscription=T.EMPTY;_resizeSubscription=T.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(t){t!==this._disabled&&(this._disabled=t,this._toggleNativeDragInteractions(),this._handles.forEach(e=>A(e,t)))}_disabled=!1;beforeStarted=new _;started=new _;released=new _;ended=new _;entered=new _;exited=new _;dropped=new _;moved=this._moveEvents;data;constrainPosition;constructor(t,e,i,n,s,r,a){this._config=e,this._document=i,this._ngZone=n,this._viewportRuler=s,this._dragDropRegistry=r,this._renderer=a,this.withRootElement(t).withParent(e.parentDragRef||null),this._parentPositions=new X(i),r.registerDragItem(this)}getPlaceholderElement(){return this._placeholder}getRootElement(){return this._rootElement}getVisibleElement(){return this.isDragging()?this.getPlaceholderElement():this.getRootElement()}withHandles(t){this._handles=t.map(i=>C(i)),this._handles.forEach(i=>A(i,this.disabled)),this._toggleNativeDragInteractions();let e=new Set;return this._disabledHandles.forEach(i=>{this._handles.indexOf(i)>-1&&e.add(i)}),this._disabledHandles=e,this}withPreviewTemplate(t){return this._previewTemplate=t,this}withPlaceholderTemplate(t){return this._placeholderTemplate=t,this}withRootElement(t){let e=C(t);if(e!==this._rootElement){this._removeRootElementListeners();let i=this._renderer;this._rootElementCleanups=this._ngZone.runOutsideAngular(()=>[i.listen(e,"mousedown",this._pointerDown,Nt),i.listen(e,"touchstart",this._pointerDown,di),i.listen(e,"dragstart",this._nativeDragStart,Nt)]),this._initialTransform=void 0,this._rootElement=e}return typeof SVGElement<"u"&&this._rootElement instanceof SVGElement&&(this._ownerSVGElement=this._rootElement.ownerSVGElement),this}withBoundaryElement(t){return this._boundaryElement=t?C(t):null,this._resizeSubscription.unsubscribe(),t&&(this._resizeSubscription=this._viewportRuler.change(10).subscribe(()=>this._containInsideBoundaryOnResize())),this}withParent(t){return this._parentDragRef=t,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&&oi(this._boundaryElement.getBoundingClientRect(),this._rootElement.getBoundingClientRect())){let t=this._boundaryElement.getBoundingClientRect(),e=this._rootElement.getBoundingClientRect(),i=0,n=0;e.left<t.left?i=t.left-e.left:e.right>t.right&&(i=t.right-e.right),e.top<t.top?n=t.top-e.top:e.bottom>t.bottom&&(n=t.bottom-e.bottom);let s=this._activeTransform.x,r=this._activeTransform.y,a=s+i,l=r+n;this._rootElement.style.transform=$(a,l),this._activeTransform={x:a,y:l},this._passiveTransform={x:a,y:l}}}disableHandle(t){!this._disabledHandles.has(t)&&this._handles.indexOf(t)>-1&&(this._disabledHandles.add(t),A(t,!0))}enableHandle(t){this._disabledHandles.has(t)&&(this._disabledHandles.delete(t),A(t,this.disabled))}withDirection(t){return this._direction=t,this}_withDropContainer(t){this._dropContainer=t}getFreeDragPosition(){let t=this.isDragging()?this._activeTransform:this._passiveTransform;return{x:t.x,y:t.y}}setFreeDragPosition(t){return this._activeTransform={x:0,y:0},this._passiveTransform.x=t.x,this._passiveTransform.y=t.y,this._dropContainer||this._applyRootElementTransform(t.x,t.y),this}withPreviewContainer(t){return this._previewContainer=t,this}_sortFromLastPointerPosition(){let t=this._lastKnownPointerPosition;t&&this._dropContainer&&this._updateActiveDropContainer(this._getConstrainedPointerPosition(t),t)}_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=t=>{if(this.beforeStarted.next(),this._handles.length){let e=this._getTargetHandle(t);e&&!this._disabledHandles.has(e)&&!this.disabled&&this._initializeDragSequence(e,t)}else this.disabled||this._initializeDragSequence(this._rootElement,t)};_pointerMove=t=>{let e=this._getPointerPositionOnPage(t);if(!this._hasStartedDragging()){let n=Math.abs(e.x-this._pickupPositionOnPage.x),s=Math.abs(e.y-this._pickupPositionOnPage.y);if(n+s>=this._config.dragStartThreshold){let a=Date.now()>=this._dragStartTime+this._getDragStartDelay(t),l=this._dropContainer;if(!a){this._endDragSequence(t);return}(!l||!l.isDragging()&&!l.isReceiving())&&(t.cancelable&&t.preventDefault(),this._hasStartedDragging.set(!0),this._ngZone.run(()=>this._startDragSequence(t)))}return}t.cancelable&&t.preventDefault();let i=this._getConstrainedPointerPosition(e);if(this._hasMoved=!0,this._lastKnownPointerPosition=e,this._updatePointerDirectionDelta(i),this._dropContainer)this._updateActiveDropContainer(i,e);else{let n=this.constrainPosition?this._initialDomRect:this._pickupPositionOnPage,s=this._activeTransform;s.x=i.x-n.x+this._passiveTransform.x,s.y=i.y-n.y+this._passiveTransform.y,this._applyRootElementTransform(s.x,s.y)}this._moveEvents.observers.length&&this._ngZone.run(()=>{this._moveEvents.next({source:this,pointerPosition:i,event:t,distance:this._getDragDistance(i),delta:this._pointerDirectionDelta})})};_pointerUp=t=>{this._endDragSequence(t)};_endDragSequence(t){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:t}),this._dropContainer)this._dropContainer._stopScrolling(),this._animatePreviewToPlaceholder().then(()=>{this._cleanupDragArtifacts(t),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)});else{this._passiveTransform.x=this._activeTransform.x;let e=this._getPointerPositionOnPage(t);this._passiveTransform.y=this._activeTransform.y,this._ngZone.run(()=>{this.ended.next({source:this,distance:this._getDragDistance(e),dropPoint:e,event:t})}),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)}}_startDragSequence(t){V(t)&&(this._lastTouchEventTime=Date.now()),this._toggleNativeDragInteractions();let e=this._getShadowRoot(),i=this._dropContainer;if(e&&this._ngZone.runOutsideAngular(()=>{this._cleanupShadowRootSelectStart=this._renderer.listen(e,"selectstart",_i,ci)}),i){let n=this._rootElement,s=n.parentNode,r=this._placeholder=this._createPlaceholderElement(),a=this._marker=this._marker||this._document.createComment("");s.insertBefore(a,n),this._initialTransform=n.style.transform||"",this._preview=new xe(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(s,e)),Ot(n,!1,Ht),this._document.body.appendChild(s.replaceChild(r,n)),this.started.next({source:this,event:t}),i.start(),this._initialContainer=i,this._initialIndex=i.getItemIndex(this)}else this.started.next({source:this,event:t}),this._initialContainer=this._initialIndex=void 0;this._parentPositions.cache(i?i.getScrollableParents():[])}_initializeDragSequence(t,e){this._parentDragRef&&e.stopPropagation();let i=this.isDragging(),n=V(e),s=!n&&e.button!==0,r=this._rootElement,a=B(e),l=!n&&this._lastTouchEventTime&&this._lastTouchEventTime+hi>Date.now(),d=n?it(e):tt(e);if(a&&a.draggable&&e.type==="mousedown"&&e.preventDefault(),i||s||l||d)return;if(this._handles.length){let E=r.style;this._rootElementTapHighlight=E.webkitTapHighlightColor||"",E.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(E=>this._updateOnScroll(E)),this._boundaryElement&&(this._boundaryRect=Te(this._boundaryElement));let h=this._previewTemplate;this._pickupPositionInElement=h&&h.template&&!h.matchSize?{x:0,y:0}:this._getPointerPositionInElement(this._initialDomRect,t,e);let v=this._pickupPositionOnPage=this._lastKnownPointerPosition=this._getPointerPositionOnPage(e);this._pointerDirectionDelta={x:0,y:0},this._pointerPositionAtLastDirectionChange={x:v.x,y:v.y},this._dragStartTime=Date.now(),this._dragDropRegistry.startDragging(this,e)}_cleanupDragArtifacts(t){Ot(this._rootElement,!0,Ht),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 e=this._dropContainer,i=e.getItemIndex(this),n=this._getPointerPositionOnPage(t),s=this._getDragDistance(n),r=e._isOverContainer(n.x,n.y);this.ended.next({source:this,distance:s,dropPoint:n,event:t}),this.dropped.next({item:this,currentIndex:i,previousIndex:this._initialIndex,container:e,previousContainer:this._initialContainer,isPointerOverContainer:r,distance:s,dropPoint:n,event:t}),e.drop(this,i,this._initialIndex,this._initialContainer,r,s,n,t),this._dropContainer=this._initialContainer})}_updateActiveDropContainer({x:t,y:e},{x:i,y:n}){let s=this._initialContainer._getSiblingContainerFromPosition(this,t,e);!s&&this._dropContainer!==this._initialContainer&&this._initialContainer._isOverContainer(t,e)&&(s=this._initialContainer),s&&s!==this._dropContainer&&this._ngZone.run(()=>{let r=this._dropContainer.getItemIndex(this),a=this._dropContainer.getItemAtIndex(r+1)?.getVisibleElement()||null;this.exited.next({item:this,container:this._dropContainer}),this._dropContainer.exit(this),this._conditionallyInsertAnchor(s,this._dropContainer,a),this._dropContainer=s,this._dropContainer.enter(this,t,e,s===this._initialContainer&&s.sortingDisabled?this._initialIndex:void 0),this.entered.next({item:this,container:s,currentIndex:s.getItemIndex(this)})}),this.isDragging()&&(this._dropContainer._startScrollingIfNecessary(i,n),this._dropContainer._sortItem(this,t,e,this._pointerDirectionDelta),this.constrainPosition?this._applyPreviewTransform(t,e):this._applyPreviewTransform(t-this._pickupPositionInElement.x,e-this._pickupPositionInElement.y))}_animatePreviewToPlaceholder(){if(!this._hasMoved)return Promise.resolve();let t=this._placeholder.getBoundingClientRect();this._preview.addClass("cdk-drag-animating"),this._applyPreviewTransform(t.left,t.top);let e=this._preview.getTransitionDuration();return e===0?Promise.resolve():this._ngZone.runOutsideAngular(()=>new Promise(i=>{let n=a=>{(!a||this._preview&&B(a)===this._preview.element&&a.propertyName==="transform")&&(r(),i(),clearTimeout(s))},s=setTimeout(n,e*1.5),r=this._preview.addEventListener("transitionend",n)}))}_createPlaceholderElement(){let t=this._placeholderTemplate,e=t?t.template:null,i;return e?(this._placeholderRef=t.viewContainer.createEmbeddedView(e,t.context),this._placeholderRef.detectChanges(),i=Wt(this._placeholderRef,this._document)):i=Pe(this._rootElement),i.style.pointerEvents="none",i.classList.add(Ft),i}_getPointerPositionInElement(t,e,i){let n=e===this._rootElement?null:e,s=n?n.getBoundingClientRect():t,r=V(i)?i.targetTouches[0]:i,a=this._getViewportScrollPosition(),l=r.pageX-s.left-a.left,d=r.pageY-s.top-a.top;return{x:s.left-t.left+l,y:s.top-t.top+d}}_getPointerPositionOnPage(t){let e=this._getViewportScrollPosition(),i=V(t)?t.touches[0]||t.changedTouches[0]||{pageX:0,pageY:0}:t,n=i.pageX-e.left,s=i.pageY-e.top;if(this._ownerSVGElement){let r=this._ownerSVGElement.getScreenCTM();if(r){let a=this._ownerSVGElement.createSVGPoint();return a.x=n,a.y=s,a.matrixTransform(r.inverse())}}return{x:n,y:s}}_getConstrainedPointerPosition(t){let e=this._dropContainer?this._dropContainer.lockAxis:null,{x:i,y:n}=this.constrainPosition?this.constrainPosition(t,this,this._initialDomRect,this._pickupPositionInElement):t;if(this.lockAxis==="x"||e==="x"?n=this._pickupPositionOnPage.y-(this.constrainPosition?this._pickupPositionInElement.y:0):(this.lockAxis==="y"||e==="y")&&(i=this._pickupPositionOnPage.x-(this.constrainPosition?this._pickupPositionInElement.x:0)),this._boundaryRect){let{x:s,y:r}=this.constrainPosition?{x:0,y:0}:this._pickupPositionInElement,a=this._boundaryRect,{width:l,height:d}=this._getPreviewRect(),h=a.top+r,v=a.bottom-(d-r),E=a.left+s,te=a.right-(l-s);i=Bt(i,E,te),n=Bt(n,h,v)}return{x:i,y:n}}_updatePointerDirectionDelta(t){let{x:e,y:i}=t,n=this._pointerDirectionDelta,s=this._pointerPositionAtLastDirectionChange,r=Math.abs(e-s.x),a=Math.abs(i-s.y);return r>this._config.pointerDirectionChangeThreshold&&(n.x=e>s.x?1:-1,s.x=e),a>this._config.pointerDirectionChangeThreshold&&(n.y=i>s.y?1:-1,s.y=i),n}_toggleNativeDragInteractions(){if(!this._rootElement||!this._handles)return;let t=this._handles.length>0||!this.isDragging();t!==this._nativeInteractionsEnabled&&(this._nativeInteractionsEnabled=t,A(this._rootElement,t))}_removeRootElementListeners(){this._rootElementCleanups?.forEach(t=>t()),this._rootElementCleanups=void 0}_applyRootElementTransform(t,e){let i=1/this.scale,n=$(t*i,e*i),s=this._rootElement.style;this._initialTransform==null&&(this._initialTransform=s.transform&&s.transform!="none"?s.transform:""),s.transform=J(n,this._initialTransform)}_applyPreviewTransform(t,e){let i=this._previewTemplate?.template?void 0:this._initialTransform,n=$(t,e);this._preview.setTransform(J(n,i))}_getDragDistance(t){let e=this._pickupPositionOnPage;return e?{x:t.x-e.x,y:t.y-e.y}:{x:0,y:0}}_cleanupCachedDimensions(){this._boundaryRect=this._previewRect=void 0,this._parentPositions.clear()}_containInsideBoundaryOnResize(){let{x:t,y:e}=this._passiveTransform;if(t===0&&e===0||this.isDragging()||!this._boundaryElement)return;let i=this._rootElement.getBoundingClientRect(),n=this._boundaryElement.getBoundingClientRect();if(n.width===0&&n.height===0||i.width===0&&i.height===0)return;let s=n.left-i.left,r=i.right-n.right,a=n.top-i.top,l=i.bottom-n.bottom;n.width>i.width?(s>0&&(t+=s),r>0&&(t-=r)):t=0,n.height>i.height?(a>0&&(e+=a),l>0&&(e-=l)):e=0,(t!==this._passiveTransform.x||e!==this._passiveTransform.y)&&this.setFreeDragPosition({y:e,x:t})}_getDragStartDelay(t){let e=this.dragStartDelay;return typeof e=="number"?e:V(t)?e.touch:e?e.mouse:0}_updateOnScroll(t){let e=this._parentPositions.handleScroll(t);if(e){let i=B(t);this._boundaryRect&&i!==this._boundaryElement&&i.contains(this._boundaryElement)&&G(this._boundaryRect,e.top,e.left),this._pickupPositionOnPage.x+=e.left,this._pickupPositionOnPage.y+=e.top,this._dropContainer||(this._activeTransform.x-=e.left,this._activeTransform.y-=e.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=K(this._rootElement)),this._cachedShadowRoot}_getPreviewInsertionPoint(t,e){let i=this._previewContainer||"global";if(i==="parent")return t;if(i==="global"){let n=this._document;return e||n.fullscreenElement||n.webkitFullscreenElement||n.mozFullScreenElement||n.msFullscreenElement||n.body}return C(i)}_getPreviewRect(){return(!this._previewRect||!this._previewRect.width&&!this._previewRect.height)&&(this._previewRect=this._preview?this._preview.getBoundingClientRect():this._initialDomRect),this._previewRect}_nativeDragStart=t=>{if(this._handles.length){let e=this._getTargetHandle(t);e&&!this._disabledHandles.has(e)&&!this.disabled&&t.preventDefault()}else this.disabled||t.preventDefault()};_getTargetHandle(t){return this._handles.find(e=>t.target&&(t.target===e||e.contains(t.target)))}_conditionallyInsertAnchor(t,e,i){if(t===this._initialContainer)this._anchor?.remove(),this._anchor=null;else if(e===this._initialContainer&&e.hasAnchor){let n=this._anchor??=Pe(this._placeholder);n.classList.remove(Ft),n.classList.add("cdk-drag-anchor"),n.style.transform="",i?i.before(n):C(e.element).appendChild(n)}}};function Bt(o,t,e){return Math.max(t,Math.min(e,o))}function V(o){return o.type[0]==="t"}function _i(o){o.preventDefault()}function ee(o,t,e){let i=zt(t,o.length-1),n=zt(e,o.length-1);if(i===n)return;let s=o[i],r=n<i?-1:1;for(let a=i;a!==n;a+=r)o[a]=o[a+r];o[n]=s}function zt(o,t){return Math.max(0,Math.min(t,o))}var Q=class{_dragDropRegistry;_element;_sortPredicate;_itemPositions=[];_activeDraggables;orientation="vertical";direction="ltr";constructor(t){this._dragDropRegistry=t}_previousSwap={drag:null,delta:0,overlaps:!1};start(t){this.withItems(t)}sort(t,e,i,n){let s=this._itemPositions,r=this._getItemIndexFromPointerPosition(t,e,i,n);if(r===-1&&s.length>0)return null;let a=this.orientation==="horizontal",l=s.findIndex(D=>D.drag===t),d=s[r],h=s[l].clientRect,v=d.clientRect,E=l>r?1:-1,te=this._getItemOffsetPx(h,v,E),ti=this._getSiblingOffsetPx(l,s,E),ii=s.slice();return ee(s,l,r),s.forEach((D,ni)=>{if(ii[ni]===D)return;let Me=D.drag===t,ie=Me?te:ti,Le=Me?t.getPlaceholderElement():D.drag.getRootElement();D.offset+=ie;let Ae=Math.round(D.offset*(1/D.drag.scale));a?(Le.style.transform=J(`translate3d(${Ae}px, 0, 0)`,D.initialTransform),G(D.clientRect,0,ie)):(Le.style.transform=J(`translate3d(0, ${Ae}px, 0)`,D.initialTransform),G(D.clientRect,ie,0))}),this._previousSwap.overlaps=ye(v,e,i),this._previousSwap.drag=d.drag,this._previousSwap.delta=a?n.x:n.y,{previousIndex:l,currentIndex:r}}enter(t,e,i,n){let s=n==null||n<0?this._getItemIndexFromPointerPosition(t,e,i):n,r=this._activeDraggables,a=r.indexOf(t),l=t.getPlaceholderElement(),d=r[s];if(d===t&&(d=r[s+1]),!d&&(s==null||s===-1||s<r.length-1)&&this._shouldEnterAsFirstChild(e,i)&&(d=r[0]),a>-1&&r.splice(a,1),d&&!this._dragDropRegistry.isDragging(d)){let h=d.getRootElement();h.parentElement.insertBefore(l,h),r.splice(s,0,t)}else this._element.appendChild(l),r.push(t);l.style.transform="",this._cacheItemPositions()}withItems(t){this._activeDraggables=t.slice(),this._cacheItemPositions()}withSortPredicate(t){this._sortPredicate=t}reset(){this._activeDraggables?.forEach(t=>{let e=t.getRootElement();if(e){let i=this._itemPositions.find(n=>n.drag===t)?.initialTransform;e.style.transform=i||""}}),this._itemPositions=[],this._activeDraggables=[],this._previousSwap.drag=null,this._previousSwap.delta=0,this._previousSwap.overlaps=!1}getActiveItemsSnapshot(){return this._activeDraggables}getItemIndex(t){return this._getVisualItemPositions().findIndex(e=>e.drag===t)}getItemAtIndex(t){return this._getVisualItemPositions()[t]?.drag||null}updateOnScroll(t,e){this._itemPositions.forEach(({clientRect:i})=>{G(i,t,e)}),this._itemPositions.forEach(({drag:i})=>{this._dragDropRegistry.isDragging(i)&&i._sortFromLastPointerPosition()})}withElementContainer(t){this._element=t}_cacheItemPositions(){let t=this.orientation==="horizontal";this._itemPositions=this._activeDraggables.map(e=>{let i=e.getVisibleElement();return{drag:e,offset:0,initialTransform:i.style.transform||"",clientRect:Te(i)}}).sort((e,i)=>t?e.clientRect.left-i.clientRect.left:e.clientRect.top-i.clientRect.top)}_getVisualItemPositions(){return this.orientation==="horizontal"&&this.direction==="rtl"?this._itemPositions.slice().reverse():this._itemPositions}_getItemOffsetPx(t,e,i){let n=this.orientation==="horizontal",s=n?e.left-t.left:e.top-t.top;return i===-1&&(s+=n?e.width-t.width:e.height-t.height),s}_getSiblingOffsetPx(t,e,i){let n=this.orientation==="horizontal",s=e[t].clientRect,r=e[t+i*-1],a=s[n?"width":"height"]*i;if(r){let l=n?"left":"top",d=n?"right":"bottom";i===-1?a-=r.clientRect[l]-s[d]:a+=s[l]-r.clientRect[d]}return a}_shouldEnterAsFirstChild(t,e){if(!this._activeDraggables.length)return!1;let i=this._itemPositions,n=this.orientation==="horizontal";if(i[0].drag!==this._activeDraggables[0]){let r=i[i.length-1].clientRect;return n?t>=r.right:e>=r.bottom}else{let r=i[0].clientRect;return n?t<=r.left:e<=r.top}}_getItemIndexFromPointerPosition(t,e,i,n){let s=this.orientation==="horizontal",r=this._itemPositions.findIndex(({drag:a,clientRect:l})=>{if(a===t)return!1;if(n){let d=s?n.x:n.y;if(a===this._previousSwap.drag&&this._previousSwap.overlaps&&d===this._previousSwap.delta)return!1}return s?e>=Math.floor(l.left)&&e<Math.floor(l.right):i>=Math.floor(l.top)&&i<Math.floor(l.bottom)});return r===-1||!this._sortPredicate(r,t)?-1:r}},Ce=class{_document;_dragDropRegistry;_element;_sortPredicate;_rootNode;_activeItems;_previousSwap={drag:null,deltaX:0,deltaY:0,overlaps:!1};_relatedNodes=[];constructor(t,e){this._document=t,this._dragDropRegistry=e}start(t){let e=this._element.childNodes;this._relatedNodes=[];for(let i=0;i<e.length;i++){let n=e[i];this._relatedNodes.push([n,n.nextSibling])}this.withItems(t)}sort(t,e,i,n){let s=this._getItemIndexFromPointerPosition(t,e,i),r=this._previousSwap;if(s===-1||this._activeItems[s]===t)return null;let a=this._activeItems[s];if(r.drag===a&&r.overlaps&&r.deltaX===n.x&&r.deltaY===n.y)return null;let l=this.getItemIndex(t),d=t.getPlaceholderElement(),h=a.getRootElement();s>l?h.after(d):h.before(d),ee(this._activeItems,l,s);let v=this._getRootNode().elementFromPoint(e,i);return r.deltaX=n.x,r.deltaY=n.y,r.drag=a,r.overlaps=h===v||h.contains(v),{previousIndex:l,currentIndex:s}}enter(t,e,i,n){let s=this._activeItems.indexOf(t);s>-1&&this._activeItems.splice(s,1);let r=n==null||n<0?this._getItemIndexFromPointerPosition(t,e,i):n;r===-1&&(r=this._getClosestItemIndexToPointer(t,e,i));let a=this._activeItems[r];a&&!this._dragDropRegistry.isDragging(a)?(this._activeItems.splice(r,0,t),a.getRootElement().before(t.getPlaceholderElement())):(this._activeItems.push(t),this._element.appendChild(t.getPlaceholderElement()))}withItems(t){this._activeItems=t.slice()}withSortPredicate(t){this._sortPredicate=t}reset(){let t=this._element,e=this._previousSwap;for(let i=this._relatedNodes.length-1;i>-1;i--){let[n,s]=this._relatedNodes[i];n.parentNode===t&&n.nextSibling!==s&&(s===null?t.appendChild(n):s.parentNode===t&&t.insertBefore(n,s))}this._relatedNodes=[],this._activeItems=[],e.drag=null,e.deltaX=e.deltaY=0,e.overlaps=!1}getActiveItemsSnapshot(){return this._activeItems}getItemIndex(t){return this._activeItems.indexOf(t)}getItemAtIndex(t){return this._activeItems[t]||null}updateOnScroll(){this._activeItems.forEach(t=>{this._dragDropRegistry.isDragging(t)&&t._sortFromLastPointerPosition()})}withElementContainer(t){t!==this._element&&(this._element=t,this._rootNode=void 0)}_getItemIndexFromPointerPosition(t,e,i){let n=this._getRootNode().elementFromPoint(Math.floor(e),Math.floor(i)),s=n?this._activeItems.findIndex(r=>{let a=r.getRootElement();return n===a||a.contains(n)}):-1;return s===-1||!this._sortPredicate(s,t)?-1:s}_getRootNode(){return this._rootNode||(this._rootNode=K(this._element)||this._document),this._rootNode}_getClosestItemIndexToPointer(t,e,i){if(this._activeItems.length===0)return-1;if(this._activeItems.length===1)return 0;let n=1/0,s=-1;for(let r=0;r<this._activeItems.length;r++){let a=this._activeItems[r];if(a!==t){let{x:l,y:d}=a.getRootElement().getBoundingClientRect(),h=Math.hypot(e-l,i-d);h<n&&(n=h,s=r)}}return s}},Vt=.05,Ut=.05,w=(function(o){return o[o.NONE=0]="NONE",o[o.UP=1]="UP",o[o.DOWN=2]="DOWN",o})(w||{}),u=(function(o){return o[o.NONE=0]="NONE",o[o.LEFT=1]="LEFT",o[o.RIGHT=2]="RIGHT",o})(u||{});function gi(o,t){return new Ie(t,o.get(Oe),o.get(U),o.get(F),o.get(De))}var Ie=class{_dragDropRegistry;_ngZone;_viewportRuler;element;disabled=!1;sortingDisabled=!1;lockAxis=null;autoScrollDisabled=!1;autoScrollStep=2;hasAnchor=!1;enterPredicate=()=>!0;sortPredicate=()=>!0;beforeStarted=new _;entered=new _;exited=new _;dropped=new _;sorted=new _;receivingStarted=new _;receivingStopped=new _;data;_container;_isDragging=!1;_parentPositions;_sortStrategy;_domRect;_draggables=[];_siblings=[];_activeSiblings=new Set;_viewportScrollSubscription=T.EMPTY;_verticalScrollDirection=w.NONE;_horizontalScrollDirection=u.NONE;_scrollNode;_stopScrollTimers=new _;_cachedShadowRoot=null;_document;_scrollableElements=[];_initialScrollSnap;_direction="ltr";constructor(t,e,i,n,s){this._dragDropRegistry=e,this._ngZone=n,this._viewportRuler=s;let r=this.element=C(t);this._document=i,this.withOrientation("vertical").withElementContainer(r),e.registerDropContainer(this),this._parentPositions=new X(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(t,e,i,n){this._draggingStarted(),n==null&&this.sortingDisabled&&(n=this._draggables.indexOf(t)),this._sortStrategy.enter(t,e,i,n),this._cacheParentPositions(),this._notifyReceivingSiblings(),this.entered.next({item:t,container:this,currentIndex:this.getItemIndex(t)})}exit(t){this._reset(),this.exited.next({item:t,container:this})}drop(t,e,i,n,s,r,a,l={}){this._reset(),this.dropped.next({item:t,currentIndex:e,previousIndex:i,container:this,previousContainer:n,isPointerOverContainer:s,distance:r,dropPoint:a,event:l})}withItems(t){let e=this._draggables;return this._draggables=t,t.forEach(i=>i._withDropContainer(this)),this.isDragging()&&(e.filter(n=>n.isDragging()).every(n=>t.indexOf(n)===-1)?this._reset():this._sortStrategy.withItems(this._draggables)),this}withDirection(t){return this._direction=t,this._sortStrategy instanceof Q&&(this._sortStrategy.direction=t),this}connectedTo(t){return this._siblings=t.slice(),this}withOrientation(t){if(t==="mixed")this._sortStrategy=new Ce(this._document,this._dragDropRegistry);else{let e=new Q(this._dragDropRegistry);e.direction=this._direction,e.orientation=t,this._sortStrategy=e}return this._sortStrategy.withElementContainer(this._container),this._sortStrategy.withSortPredicate((e,i)=>this.sortPredicate(e,i,this)),this}withScrollableParents(t){let e=this._container;return this._scrollableElements=t.indexOf(e)===-1?[e,...t]:t.slice(),this}withElementContainer(t){if(t===this._container)return this;let e=C(this.element),i=this._scrollableElements.indexOf(this._container),n=this._scrollableElements.indexOf(t);return i>-1&&this._scrollableElements.splice(i,1),n>-1&&this._scrollableElements.splice(n,1),this._sortStrategy&&this._sortStrategy.withElementContainer(t),this._cachedShadowRoot=null,this._scrollableElements.unshift(t),this._container=t,this}getScrollableParents(){return this._scrollableElements}getItemIndex(t){return this._isDragging?this._sortStrategy.getItemIndex(t):this._draggables.indexOf(t)}getItemAtIndex(t){return this._isDragging?this._sortStrategy.getItemAtIndex(t):this._draggables[t]||null}isReceiving(){return this._activeSiblings.size>0}_sortItem(t,e,i,n){if(this.sortingDisabled||!this._domRect||!kt(this._domRect,Vt,e,i))return;let s=this._sortStrategy.sort(t,e,i,n);s&&this.sorted.next({previousIndex:s.previousIndex,currentIndex:s.currentIndex,container:this,item:t})}_startScrollingIfNecessary(t,e){if(this.autoScrollDisabled)return;let i,n=w.NONE,s=u.NONE;if(this._parentPositions.positions.forEach((r,a)=>{a===this._document||!r.clientRect||i||kt(r.clientRect,Vt,t,e)&&([n,s]=mi(a,r.clientRect,this._direction,t,e),(n||s)&&(i=a))}),!n&&!s){let{width:r,height:a}=this._viewportRuler.getViewportSize(),l={width:r,height:a,top:0,right:r,bottom:a,left:0};n=Zt(l,e),s=jt(l,t),i=window}i&&(n!==this._verticalScrollDirection||s!==this._horizontalScrollDirection||i!==this._scrollNode)&&(this._verticalScrollDirection=n,this._horizontalScrollDirection=s,this._scrollNode=i,(n||s)&&i?this._ngZone.runOutsideAngular(this._startScrollInterval):this._stopScrolling())}_stopScrolling(){this._stopScrollTimers.next()}_draggingStarted(){let t=this._container.style;this.beforeStarted.next(),this._isDragging=!0,this._initialScrollSnap=t.msScrollSnapType||t.scrollSnapType||"",t.scrollSnapType=t.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 t=this._container.style;t.scrollSnapType=t.msScrollSnapType=this._initialScrollSnap,this._siblings.forEach(e=>e._stopReceiving(this)),this._sortStrategy.reset(),this._stopScrolling(),this._viewportScrollSubscription.unsubscribe(),this._parentPositions.clear()}_startScrollInterval=()=>{this._stopScrolling(),Be(0,Fe).pipe(N(this._stopScrollTimers)).subscribe(()=>{let t=this._scrollNode,e=this.autoScrollStep;this._verticalScrollDirection===w.UP?t.scrollBy(0,-e):this._verticalScrollDirection===w.DOWN&&t.scrollBy(0,e),this._horizontalScrollDirection===u.LEFT?t.scrollBy(-e,0):this._horizontalScrollDirection===u.RIGHT&&t.scrollBy(e,0)})};_isOverContainer(t,e){return this._domRect!=null&&ye(this._domRect,t,e)}_getSiblingContainerFromPosition(t,e,i){return this._siblings.find(n=>n._canReceive(t,e,i))}_canReceive(t,e,i){if(!this._domRect||!ye(this._domRect,e,i)||!this.enterPredicate(t,this))return!1;let n=this._getShadowRoot().elementFromPoint(e,i);return n?n===this._container||this._container.contains(n):!1}_startReceiving(t,e){let i=this._activeSiblings;!i.has(t)&&e.every(n=>this.enterPredicate(n,this)||this._draggables.indexOf(n)>-1)&&(i.add(t),this._cacheParentPositions(),this._listenToScrollEvents(),this.receivingStarted.next({initiator:t,receiver:this,items:e}))}_stopReceiving(t){this._activeSiblings.delete(t),this._viewportScrollSubscription.unsubscribe(),this.receivingStopped.next({initiator:t,receiver:this})}_listenToScrollEvents(){this._viewportScrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(t=>{if(this.isDragging()){let e=this._parentPositions.handleScroll(t);e&&this._sortStrategy.updateOnScroll(e.top,e.left)}else this.isReceiving()&&this._cacheParentPositions()})}_getShadowRoot(){if(!this._cachedShadowRoot){let t=K(this._container);this._cachedShadowRoot=t||this._document}return this._cachedShadowRoot}_notifyReceivingSiblings(){let t=this._sortStrategy.getActiveItemsSnapshot().filter(e=>e.isDragging());this._siblings.forEach(e=>e._startReceiving(this,t))}};function Zt(o,t){let{top:e,bottom:i,height:n}=o,s=n*Ut;return t>=e-s&&t<=e+s?w.UP:t>=i-s&&t<=i+s?w.DOWN:w.NONE}function jt(o,t){let{left:e,right:i,width:n}=o,s=n*Ut;return t>=e-s&&t<=e+s?u.LEFT:t>=i-s&&t<=i+s?u.RIGHT:u.NONE}function mi(o,t,e,i,n){let s=Zt(t,n),r=jt(t,i),a=w.NONE,l=u.NONE;if(s){let d=o.scrollTop;s===w.UP?d>0&&(a=w.UP):o.scrollHeight-d>o.clientHeight&&(a=w.DOWN)}if(r){let d=o.scrollLeft;e==="rtl"?r===u.RIGHT?d<0&&(l=u.RIGHT):o.scrollWidth+d>o.clientWidth&&(l=u.LEFT):r===u.LEFT?d>0&&(l=u.LEFT):o.scrollWidth-d>o.clientWidth&&(l=u.RIGHT)}return[a,l]}var Gt=new k("CDK_DRAG_PARENT");var ui=new k("CdkDragHandle");var qt=new k("CDK_DRAG_CONFIG"),Kt=new k("CdkDropList"),Yt=(()=>{class o{element=c(ae);dropContainer=c(Kt,{optional:!0,skipSelf:!0});_ngZone=c(F);_viewContainerRef=c(je);_dir=c(ve,{optional:!0});_changeDetectorRef=c(me);_selfHandle=c(ui,{optional:!0,self:!0});_parentDrag=c(Gt,{optional:!0,skipSelf:!0});_dragDropRegistry=c(Oe);_destroyed=new _;_handles=new Ne([]);_previewTemplate=null;_placeholderTemplate=null;_dragRef;data;lockAxis=null;rootElementSelector;boundaryElement;dragStartDelay;freeDragPosition;get disabled(){return this._disabled||!!(this.dropContainer&&this.dropContainer.disabled)}set disabled(e){this._disabled=e,this._dragRef.disabled=this._disabled}_disabled=!1;constrainPosition;previewClass;previewContainer;scale=1;started=new S;released=new S;ended=new S;entered=new S;exited=new S;dropped=new S;moved=new ne(e=>{let i=this._dragRef.moved.pipe(He(n=>({source:this,pointerPosition:n.pointerPosition,event:n.event,delta:n.delta,distance:n.distance}))).subscribe(e);return()=>{i.unsubscribe()}});_injector=c(oe);constructor(){let e=this.dropContainer,i=c(qt,{optional:!0});this._dragRef=pi(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),e&&(e.addItem(this),e._dropListRef.beforeStarted.pipe(N(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(e){this._dragRef.setFreeDragPosition(e)}ngAfterViewInit(){Ue(()=>{this._updateRootElement(),this._setupHandlesListener(),this._dragRef.scale=this.scale,this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition)},{injector:this._injector})}ngOnChanges(e){let i=e.rootElementSelector,n=e.freeDragPosition;i&&!i.firstChange&&this._updateRootElement(),this._dragRef.scale=this.scale,n&&!n.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(e){let i=this._handles.getValue();i.push(e),this._handles.next(i)}_removeHandle(e){let i=this._handles.getValue(),n=i.indexOf(e);n>-1&&(i.splice(n,1),this._handles.next(i))}_setPreviewTemplate(e){this._previewTemplate=e}_resetPreviewTemplate(e){e===this._previewTemplate&&(this._previewTemplate=null)}_setPlaceholderTemplate(e){this._placeholderTemplate=e}_resetPlaceholderTemplate(e){e===this._placeholderTemplate&&(this._placeholderTemplate=null)}_updateRootElement(){let e=this.element.nativeElement,i=e;this.rootElementSelector&&(i=e.closest!==void 0?e.closest(this.rootElementSelector):e.parentElement?.closest(this.rootElementSelector)),this._dragRef.withRootElement(i||e)}_getBoundaryElement(){let e=this.boundaryElement;return e?typeof e=="string"?this.element.nativeElement.closest(e):C(e):null}_syncInputs(e){e.beforeStarted.subscribe(()=>{if(!e.isDragging()){let i=this._dir,n=this.dragStartDelay,s=this._placeholderTemplate?{template:this._placeholderTemplate.templateRef,context:this._placeholderTemplate.data,viewContainer:this._viewContainerRef}:null,r=this._previewTemplate?{template:this._previewTemplate.templateRef,context:this._previewTemplate.data,matchSize:this._previewTemplate.matchSize,viewContainer:this._viewContainerRef}:null;e.disabled=this.disabled,e.lockAxis=this.lockAxis,e.scale=this.scale,e.dragStartDelay=typeof n=="object"&&n?n:ue(n),e.constrainPosition=this.constrainPosition,e.previewClass=this.previewClass,e.withBoundaryElement(this._getBoundaryElement()).withPlaceholderTemplate(s).withPreviewTemplate(r).withPreviewContainer(this.previewContainer||"global"),i&&e.withDirection(i.value)}}),e.beforeStarted.pipe(ze(1)).subscribe(()=>{if(this._parentDrag){e.withParent(this._parentDrag._dragRef);return}let i=this.element.nativeElement.parentElement;for(;i;){let n=this._dragDropRegistry.getDragDirectiveForNode(i);if(n){e.withParent(n._dragRef);break}i=i.parentElement}})}_handleEvents(e){e.started.subscribe(i=>{this.started.emit({source:this,event:i.event}),this._changeDetectorRef.markForCheck()}),e.released.subscribe(i=>{this.released.emit({source:this,event:i.event})}),e.ended.subscribe(i=>{this.ended.emit({source:this,distance:i.distance,dropPoint:i.dropPoint,event:i.event}),this._changeDetectorRef.markForCheck()}),e.entered.subscribe(i=>{this.entered.emit({container:i.container.data,item:this,currentIndex:i.currentIndex})}),e.exited.subscribe(i=>{this.exited.emit({container:i.container.data,item:this})}),e.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(e){let{lockAxis:i,dragStartDelay:n,constrainPosition:s,previewClass:r,boundaryElement:a,draggingDisabled:l,rootElementSelector:d,previewContainer:h}=e;this.disabled=l??!1,this.dragStartDelay=n||0,this.lockAxis=i||null,s&&(this.constrainPosition=s),r&&(this.previewClass=r),a&&(this.boundaryElement=a),d&&(this.rootElementSelector=d),h&&(this.previewContainer=h)}_setupHandlesListener(){this._handles.pipe(Ge(e=>{let i=e.map(n=>n.element);this._selfHandle&&this.rootElementSelector&&i.push(this.element),this._dragRef.withHandles(i)}),Ve(e=>W(...e.map(i=>i._stateChanges.pipe(se(i))))),N(this._destroyed)).subscribe(e=>{let i=this._dragRef,n=e.element.nativeElement;e.disabled?i.disableHandle(n):i.enableHandle(n)})}static \u0275fac=function(i){return new(i||o)};static \u0275dir=ce({type:o,selectors:[["","cdkDrag",""]],hostAttrs:[1,"cdk-drag"],hostVars:4,hostBindings:function(i,n){i&2&&he("cdk-drag-disabled",n.disabled)("cdk-drag-dragging",n._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",O],constrainPosition:[0,"cdkDragConstrainPosition","constrainPosition"],previewClass:[0,"cdkDragPreviewClass","previewClass"],previewContainer:[0,"cdkDragPreviewContainer","previewContainer"],scale:[2,"cdkDragScale","scale",Qe]},outputs:{started:"cdkDragStarted",released:"cdkDragReleased",ended:"cdkDragEnded",entered:"cdkDragEntered",exited:"cdkDragExited",dropped:"cdkDragDropped",moved:"cdkDragMoved"},exportAs:["cdkDrag"],features:[_e([{provide:Gt,useExisting:o}]),We]})}return o})(),$t=new k("CdkDropListGroup");var Xt=(()=>{class o{element=c(ae);_changeDetectorRef=c(me);_scrollDispatcher=c(pt);_dir=c(ve,{optional:!0});_group=c($t,{optional:!0,skipSelf:!0});_latestSortedRefs;_destroyed=new _;_scrollableParentsResolved=!1;static _dropLists=[];_dropListRef;connectedTo=[];data;orientation="vertical";id=c(at).getId("cdk-drop-list-");lockAxis=null;get disabled(){return this._disabled||!!this._group&&this._group.disabled}set disabled(e){this._dropListRef.disabled=this._disabled=e}_disabled=!1;sortingDisabled=!1;enterPredicate=()=>!0;sortPredicate=()=>!0;autoScrollDisabled=!1;autoScrollStep;elementContainerSelector=null;hasAnchor=!1;dropped=new S;entered=new S;exited=new S;sorted=new S;_unsortedItems=new Set;constructor(){let e=c(qt,{optional:!0}),i=c(oe);this._dropListRef=gi(i,this.element),this._dropListRef.data=this,e&&this._assignDefaults(e),this._dropListRef.enterPredicate=(n,s)=>this.enterPredicate(n.data,s.data),this._dropListRef.sortPredicate=(n,s,r)=>this.sortPredicate(n,s.data,r.data),this._setupInputSyncSubscription(this._dropListRef),this._handleEvents(this._dropListRef),o._dropLists.push(this),this._group&&this._group._items.add(this)}addItem(e){this._unsortedItems.add(e),e._dragRef._withDropContainer(this._dropListRef),this._dropListRef.isDragging()&&this._syncItemsWithRef(this.getSortedItems().map(i=>i._dragRef))}removeItem(e){if(this._unsortedItems.delete(e),this._latestSortedRefs){let i=this._latestSortedRefs.indexOf(e._dragRef);i>-1&&(this._latestSortedRefs.splice(i,1),this._syncItemsWithRef(this._latestSortedRefs))}}getSortedItems(){return Array.from(this._unsortedItems).sort((e,i)=>e._dragRef.getVisibleElement().compareDocumentPosition(i._dragRef.getVisibleElement())&Node.DOCUMENT_POSITION_FOLLOWING?-1:1)}ngOnDestroy(){let e=o._dropLists.indexOf(this);e>-1&&o._dropLists.splice(e,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(e){this._dir&&this._dir.change.pipe(se(this._dir.value),N(this._destroyed)).subscribe(i=>e.withDirection(i)),e.beforeStarted.subscribe(()=>{let i=st(this.connectedTo).map(n=>{if(typeof n=="string"){let s=o._dropLists.find(r=>r.id===n);return s}return n});if(this._group&&this._group._items.forEach(n=>{i.indexOf(n)===-1&&i.push(n)}),!this._scrollableParentsResolved){let n=this._scrollDispatcher.getAncestorScrollContainers(this.element).map(s=>s.getElementRef().nativeElement);this._dropListRef.withScrollableParents(n),this._scrollableParentsResolved=!0}if(this.elementContainerSelector){let n=this.element.nativeElement.querySelector(this.elementContainerSelector);e.withElementContainer(n)}e.disabled=this.disabled,e.lockAxis=this.lockAxis,e.sortingDisabled=this.sortingDisabled,e.autoScrollDisabled=this.autoScrollDisabled,e.autoScrollStep=ue(this.autoScrollStep,2),e.hasAnchor=this.hasAnchor,e.connectedTo(i.filter(n=>n&&n!==this).map(n=>n._dropListRef)).withOrientation(this.orientation)})}_handleEvents(e){e.beforeStarted.subscribe(()=>{this._syncItemsWithRef(this.getSortedItems().map(i=>i._dragRef)),this._changeDetectorRef.markForCheck()}),e.entered.subscribe(i=>{this.entered.emit({container:this,item:i.item.data,currentIndex:i.currentIndex})}),e.exited.subscribe(i=>{this.exited.emit({container:this,item:i.item.data}),this._changeDetectorRef.markForCheck()}),e.sorted.subscribe(i=>{this.sorted.emit({previousIndex:i.previousIndex,currentIndex:i.currentIndex,container:this,item:i.item.data})}),e.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()}),W(e.receivingStarted,e.receivingStopped).subscribe(()=>this._changeDetectorRef.markForCheck())}_assignDefaults(e){let{lockAxis:i,draggingDisabled:n,sortingDisabled:s,listAutoScrollDisabled:r,listOrientation:a}=e;this.disabled=n??!1,this.sortingDisabled=s??!1,this.autoScrollDisabled=r??!1,this.orientation=a||"vertical",this.lockAxis=i||null}_syncItemsWithRef(e){this._latestSortedRefs=e,this._dropListRef.withItems(e)}static \u0275fac=function(i){return new(i||o)};static \u0275dir=ce({type:o,selectors:[["","cdkDropList",""],["cdk-drop-list"]],hostAttrs:[1,"cdk-drop-list"],hostVars:7,hostBindings:function(i,n){i&2&&(Z("id",n.id),he("cdk-drop-list-disabled",n.disabled)("cdk-drop-list-dragging",n._dropListRef.isDragging())("cdk-drop-list-receiving",n._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",O],sortingDisabled:[2,"cdkDropListSortingDisabled","sortingDisabled",O],enterPredicate:[0,"cdkDropListEnterPredicate","enterPredicate"],sortPredicate:[0,"cdkDropListSortPredicate","sortPredicate"],autoScrollDisabled:[2,"cdkDropListAutoScrollDisabled","autoScrollDisabled",O],autoScrollStep:[0,"cdkDropListAutoScrollStep","autoScrollStep"],elementContainerSelector:[0,"cdkDropListElementContainer","elementContainerSelector"],hasAnchor:[2,"cdkDropListHasAnchor","hasAnchor",O]},outputs:{dropped:"cdkDropListDropped",entered:"cdkDropListEntered",exited:"cdkDropListExited",sorted:"cdkDropListSorted"},exportAs:["cdkDropList"],features:[_e([{provide:$t,useValue:void 0},{provide:Kt,useExisting:o}])]})}return o})();function fi(o,t){if(o&1){let e=q();p(0,"button",0),m("click",function(){y(e);let n=P();return x(n.clickAction("cancel"))}),p(1,"mat-icon",1),f(2,"close"),g(),p(3,"span"),f(4,"Close"),g()()}}var Qt=(()=>{class o{_bottomSheetRef=c(Dt);data=c(vt);showCancel=!!(this.data&&this.data.showCancel);clickAction(e){this._bottomSheetRef.dismiss(e)}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=I({type:o,selectors:[["dashboards-bottom-sheet"]],decls:12,vars:1,consts:[["mat-list-item","",3,"click"],["matListItemIcon",""],["mat-list-item",""]],template:function(i,n){i&1&&(p(0,"mat-action-list")(1,"button",0),m("click",function(){return n.clickAction("duplicate")}),p(2,"mat-icon",1),f(3,"content_copy"),g(),p(4,"span"),f(5,"Duplicate"),g()(),p(6,"button",0),m("click",function(){return n.clickAction("delete")}),p(7,"mat-icon",1),f(8,"delete_forever"),g(),p(9,"span"),f(10,"Delete"),g()(),qe(11,fi,5,0,"button",2),g()),i&2&&(b(11),Ke(n.showCancel?11:-1))},dependencies:[Et,yt,xt,Pt,L,M],encapsulation:2})}return o})();var Di=(o,t)=>t.id;function bi(o,t){if(o&1){let e=q();p(0,"div",5),m("cdkDragStarted",function(){y(e);let n=P();return x(n.dragStart())})("cdkDragMoved",function(n){y(e);let s=P();return x(s.onDragMoved(n))})("cdkDragEnded",function(){y(e);let n=P();return x(n.dragEnd())})("press",function(){let n=y(e).$index,s=P();return x(s.onPress(n))})("doubletap",function(){let n=y(e).$index,s=P();return x(s.editDashboard(n))})("keydown.enter",function(){let n=y(e).$index,s=P();return x(s.editDashboard(n))})("keydown.space",function(){let n=y(e).$index,s=P();return x(s.onPress(n))}),p(1,"div",6),f(2),g(),p(3,"div"),j(4,"mat-icon",7),g(),p(5,"p",8),f(6),g()()}if(o&2){let e=t.$implicit,i=t.$index,n=P();R("mode","editor")("disableGestures",n._sheetOpen||n.suppressDrag)("cdkDragDisabled",n._sheetOpen||n.suppressDrag),Z("aria-label",e.name),b(2),pe(i+1),b(2),Je("width",72,"px")("height",72,"px"),R("svgIcon",e.icon||"dashboard"),b(2),pe(e.name)}}var ei=(()=>{class o{pageTitle="Dashboards";_bottomSheet=c(bt);_dashboard=c(gt);_uiEvent=c(St);_dialog=c(ft);_sanitizer=c(rt);_sheetOpen=!1;suppressDrag=!1;_dragActive=!1;_dragMoved=!1;_dragSuppressThresholdPx=4;addDashboard(){this._dialog.openDashboardPageEditorDialog({title:"New Dashboard",name:`Dashboard ${this._dashboard.dashboards().length+1}`,icon:"dashboard-dashboard",confirmBtnText:"Create",cancelBtnText:"Cancel"}).afterClosed().subscribe(e=>{e&&this._dashboard.add(e.name,[],e.icon,e.collapseSplitShell)})}openBottomSheet(e){if(this._sheetOpen)return;this._sheetOpen=!0;let i=typeof navigator<"u"&&/Linux/.test(navigator.platform)&&/Firefox/.test(navigator.userAgent);this._bottomSheet.open(Qt,i?{disableClose:!0,data:{showCancel:!0}}:{}).afterDismissed().subscribe(s=>{switch(this._sheetOpen=!1,s){case"delete":this.deleteDashboard(e);break;case"duplicate":this.duplicateDashboard(e,`${this._dashboard.dashboards()[e].name}`);break;default:break}})}editDashboard(e){let i=this._dashboard.dashboards()[e];this._dialog.openDashboardPageEditorDialog({title:"Dashboard Options",name:i.name,icon:i.icon||"dashboard-dashboard",confirmBtnText:"Save",cancelBtnText:"Cancel",collapseSplitShell:i.collapseSplitShell??!1}).afterClosed().subscribe(n=>{n&&this._dashboard.update(e,n.name,n.icon,n.collapseSplitShell)})}deleteDashboard(e){this._dashboard.delete(e)}duplicateDashboard(e,i){let n=this._dashboard.dashboards()[e];this._dialog.openDashboardPageEditorDialog({title:"Duplicate Dashboard",name:`${i} copy`,icon:n.icon||"dashboard-dashboard",confirmBtnText:"Save",cancelBtnText:"Cancel",collapseSplitShell:n.collapseSplitShell??!1}).afterClosed().subscribe(s=>{s&&this._dashboard.duplicate(e,s.name,s.icon,s.collapseSplitShell)})}drop(e){this._dashboard.dashboards.update(i=>{let n=[...i];ee(n,e.previousIndex,e.currentIndex);let s=this._dashboard.activeDashboard();return s===e.previousIndex?this._dashboard.activeDashboard.set(e.currentIndex):s>e.previousIndex&&s<=e.currentIndex?this._dashboard.activeDashboard.set(s-1):s<e.previousIndex&&s>=e.currentIndex&&this._dashboard.activeDashboard.set(s+1),n})}dragStart(){this._sheetOpen||this.suppressDrag||(this._uiEvent.isDragging.set(!0),this._dragActive=!0,this._dragMoved=!1)}dragEnd(){this._uiEvent.isDragging.set(!1),this._dragActive=!1,setTimeout(()=>{this._dragMoved=!1},60)}onDragMoved(e){if(!this._dragActive||this._dragMoved)return;Math.hypot(e.distance.x,e.distance.y)>this._dragSuppressThresholdPx&&(this._dragMoved=!0)}onPress(e){this._sheetOpen||this._dragMoved||(this.cancelPointerSequence(),this.openBottomSheet(e))}cancelPointerSequence(){this.suppressDrag=!0,this._dragActive=!1,this._dragMoved=!1,["pointerup","mouseup","touchend"].forEach(e=>{document.dispatchEvent(new Event(e,{bubbles:!0}))})}onPointerRelease(){this._sheetOpen||(this.suppressDrag=!1)}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=I({type:o,selectors:[["dashboards-editor"]],hostBindings:function(i,n){i&1&&m("mouseup",function(){return n.onPointerRelease()},le)("touchend",function(){return n.onPointerRelease()},le)},decls:10,vars:0,consts:[["cdkDropList","","cdkDropListOrientation","mixed",1,"dashboard-manage",3,"cdkDropListDropped"],["kipGestures","","matRipple","","cdkDrag","","cdkDragBoundary",".dashboard-manage","tabindex","0",1,"dashboard-card","dashboard-item",3,"mode","disableGestures","cdkDragDisabled"],["tabindex","0",1,"dashboard-card","dashboard-item-add","dashboard-add-btn",3,"click","keydown"],["mat-fab",""],[2,"margin-top","10px"],["kipGestures","","matRipple","","cdkDrag","","cdkDragBoundary",".dashboard-manage","tabindex","0",1,"dashboard-card","dashboard-item",3,"cdkDragStarted","cdkDragMoved","cdkDragEnded","press","doubletap","keydown.enter","keydown.space","mode","disableGestures","cdkDragDisabled"],[1,"item-index"],["aria-hidden","false",1,"dashboard-icon",3,"svgIcon"],[1,"dashboard-name"]],template:function(i,n){i&1&&(p(0,"div",0),m("cdkDropListDropped",function(r){return n.drop(r)}),Ye(1,bi,7,11,"div",1,Di),p(3,"div",2),m("click",function(){return n.addDashboard()})("keydown",function(){return n.addDashboard()}),p(4,"button",3)(5,"mat-icon"),f(6,"add_box"),g()(),p(7,"p",4)(8,"i"),f(9,"Add Dashboard"),g()()()()),i&2&&(b(),Xe(n._dashboard.dashboards()))},dependencies:[wt,Y,ht,L,M,Xt,Yt,ct,lt,et],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%;overflow-y:auto;scroll-behavior:smooth}.dashboard-manage[_ngcontent-%COMP%]{box-sizing:border-box;padding:0 60px;width:100%;height:100%;display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-around;overflow-y:auto;scroll-behavior:smooth}.dashboard-card[_ngcontent-%COMP%]{position:relative;height:200px;width:300px;margin:10px;border-radius:15px;padding:10px;align-content:center;text-align:center;border:2px solid transparent}@media(max-width:600px)and (orientation:portrait){.dashboard-manage[_ngcontent-%COMP%]{padding:0 70px}.dashboard-card[_ngcontent-%COMP%]{height:175px}}.dashboard-item[_ngcontent-%COMP%]{background-color:var(--mat-sys-surface-container-highest);cursor:pointer}.dashboard-item[_ngcontent-%COMP%]:hover{border:2px solid var(--mat-sys-outline)}.dashboard-item-add[_ngcontent-%COMP%]{background-color:var(--mat-sys-surface-container);cursor:pointer}.dashboard-item-add[_ngcontent-%COMP%]:hover{border:2px solid var(--mat-sys-outline)}.dashboard-add-btn[_ngcontent-%COMP%]{align-content:center;text-align:center;border:dashed 1px var(--mat-sys-outline)}.item-index[_ngcontent-%COMP%]{position:absolute;top:20px;left:20px;display:inline-flex;flex-wrap:wrap;height:42px;width:42px;background-color:var(--kip-contrast-dim-color);color:var(--mat-sys-surface-bright);border-radius:25%;align-content:center;align-items:center;justify-content:center;font-weight:700;font-size:1.25em;z-index:1}.dashboard-icon[_ngcontent-%COMP%]{opacity:.5}.dashboard-name[_ngcontent-%COMP%]{margin-top:10px;margin-bottom:0;font-size:1.1em}.cdk-drag-preview[_ngcontent-%COMP%]{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px var(--mat-sys-on-primary-container),0 8px 10px 1px var(--mat-sys-on-primary-container),0 3px 14px 2px var(--mat-sys-on-primary-container)}.cdk-drag-placeholder[_ngcontent-%COMP%]{opacity:0}.cdk-drag-animating[_ngcontent-%COMP%]{transition:transform .25s cubic-bezier(0,0,.2,1)}"]})}return o})();var xn=(()=>{class o{_router=c(_t);app=c(ut);_responsive=c(ot);_isPhonePortrait=be(this._responsive.observe(fe.HandsetPortrait));_isPhoneLandscape=be(this._responsive.observe(fe.HandsetLandscape));isPhonePortrait=ge(()=>this._isPhonePortrait().matches);isPhoneLandscape=ge(()=>this._isPhoneLandscape().matches);closePage(){this._router.navigate(["/dashboard"])}onActionItem(e){switch(e){case"help":this._router.navigate(["/help"]);break;case"datainspector":this._router.navigate(["/data"]);break;case"remotecontrol":this._router.navigate(["/remote"]);break;case"options":this._router.navigate(["/options"]);break;default:break}}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=I({type:o,selectors:[["settings"]],decls:11,vars:20,consts:[[1,"home-container"],[1,"actions-header-container"],[1,"actions-buttons-container"],["svgIcon","settings","label","Options",3,"click","keydown.enter","keydown.space","iconOnly","compact","iconSize"],["svgIcon","troubleshoot","label","Data Inspector",3,"click","keydown.enter","keydown.space","iconOnly","compact","iconSize"],["svgIcon","remote-control","label","Remote Control",3,"click","keydown.enter","keydown.space","iconOnly","compact","iconSize"],["svgIcon","help-center","label","Help",3,"click","keydown.enter","keydown.space","iconOnly","compact","iconSize"],["mat-icon-button","",1,"dialog-close-icon",3,"click"],[1,"dashboards-editor"]],template:function(i,n){i&1&&(p(0,"div",0)(1,"div",1)(2,"div",2)(3,"tile-large-icon",3),m("click",function(){return n.onActionItem("options")})("keydown.enter",function(){return n.onActionItem("options")})("keydown.space",function(){return n.onActionItem("options")}),g(),p(4,"tile-large-icon",4),m("click",function(){return n.onActionItem("datainspector")})("keydown.enter",function(){return n.onActionItem("datainspector")})("keydown.space",function(){return n.onActionItem("datainspector")}),g(),p(5,"tile-large-icon",5),m("click",function(){return n.onActionItem("remotecontrol")})("keydown.enter",function(){return n.onActionItem("remotecontrol")})("keydown.space",function(){return n.onActionItem("remotecontrol")}),g(),p(6,"tile-large-icon",6),m("click",function(){return n.onActionItem("help")})("keydown.enter",function(){return n.onActionItem("help")})("keydown.space",function(){return n.onActionItem("help ")}),g()(),p(7,"button",7),m("click",function(){return n.closePage()}),p(8,"mat-icon"),f(9,"close"),g()()(),j(10,"dashboards-editor",8),g()),i&2&&(b(3),H(`${n.isPhonePortrait()?"no-label":"with-label"}`),R("iconOnly",n.isPhonePortrait())("compact",!0)("iconSize",48),b(),H(`${n.isPhonePortrait()?"no-label":"with-label"}`),R("iconOnly",n.isPhonePortrait())("compact",!0)("iconSize",48),b(),H(`${n.isPhonePortrait()?"no-label":"with-label"}`),R("iconOnly",n.isPhonePortrait())("compact",!0)("iconSize",48),b(),H(`${n.isPhonePortrait()?"no-label":"with-label"}`),R("iconOnly",n.isPhonePortrait())("compact",!0)("iconSize",48))},dependencies:[L,M,Y,dt,Ct,mt,ei],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%}.home-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%}.actions-header-container[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:flex-start;width:100%;padding:5px 0 5px 10px}.with-label[_ngcontent-%COMP%]{height:80px;width:100px}.no-label[_ngcontent-%COMP%]{height:58px;width:63px}.dashboard-editor[_ngcontent-%COMP%]{flex:1 1 auto;min-height:0;overflow:auto}.actions-buttons-container[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:nowrap;gap:5px}.dialog-close-icon[_ngcontent-%COMP%]{margin-right:15px;margin-top:6px}.mat-mdc-dialog-content[_ngcontent-%COMP%]{max-height:max-content}"]})}return o})();export{xn as SettingsComponent};
@@ -1 +1 @@
1
- import{h as m}from"./chunk-P7JKENHI.js";import{Aa as u,Ac as d,Fa as t,G as n,J as h,Oe as o,f as a,ka as l,pa as c}from"./chunk-BTFZS2TW.js";var w=(()=>{class s{connectionStateMachine=c(m);destroyRef=c(u);probeUrl="https://www.gstatic.com/generate_204";probeTimeoutMs=5e3;healthyRecheckMs=6e4;retryIntervalsMs=[5e3,3e4,6e4];useConnectionStateTriggers=!0;isBrowser=typeof window<"u"&&typeof document<"u";started=!1;retryAttempt=0;checkTimer=null;lastConnectionState=null;isChecking=t(!1);isReachable=t(null);lastSuccessAt=t(null);lastCheckedAt=t(null);lastError=t(null);internetAvailable=d(()=>this.isReachable()===!0);start(){this.started||!this.isBrowser||(this.started=!0,h(n(window,"online"),n(window,"offline")).pipe(o(this.destroyRef)).subscribe(()=>this.recheckNow()),n(document,"visibilitychange").pipe(o(this.destroyRef)).subscribe(()=>{document.visibilityState==="visible"&&this.recheckNow()}),this.useConnectionStateTriggers&&this.connectionStateMachine.status$.pipe(o(this.destroyRef)).subscribe(e=>{e?.state&&e.state!==this.lastConnectionState&&(this.lastConnectionState=e.state,this.recheckNow())}),this.recheckNow())}recheckNow(){this.started&&(this.clearTimer(),this.isChecking()||this.runProbe())}runProbe(){return a(this,null,function*(){this.isChecking.set(!0),this.lastCheckedAt.set(new Date);try{let e=yield this.performProbe();this.isReachable.set(e),e?(this.lastSuccessAt.set(new Date),this.lastError.set(null),this.retryAttempt=0,this.scheduleNext(this.healthyRecheckMs)):(this.lastError.set("Internet reachability probe failed"),this.scheduleRetry())}catch(e){this.isReachable.set(!1),this.lastError.set("Internet reachability probe failed"),this.scheduleRetry()}finally{this.isChecking.set(!1)}})}performProbe(){return a(this,null,function*(){let e=new AbortController,i=setTimeout(()=>e.abort(),this.probeTimeoutMs);try{let r=yield fetch(this.probeUrl,{method:"GET",mode:"no-cors",cache:"no-store",signal:e.signal});return r.type==="opaque"?!0:r.status>=200&&r.status<400}catch(r){return!1}finally{clearTimeout(i)}})}scheduleRetry(){let e=Math.min(this.retryAttempt,this.retryIntervalsMs.length-1),i=this.retryIntervalsMs[e];this.retryAttempt++,this.scheduleNext(i)}scheduleNext(e){this.clearTimer(),this.checkTimer=setTimeout(()=>{this.checkTimer=null,this.runProbe()},e)}clearTimer(){this.checkTimer&&(clearTimeout(this.checkTimer),this.checkTimer=null)}ngOnDestroy(){this.clearTimer()}static \u0275fac=function(i){return new(i||s)};static \u0275prov=l({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})();export{w as a};
1
+ import{h as m}from"./chunk-AC6VD2FN.js";import{Aa as u,Ac as d,Fa as t,G as n,J as h,Oe as o,f as a,ka as l,pa as c}from"./chunk-PZ6I6W3H.js";var w=(()=>{class s{connectionStateMachine=c(m);destroyRef=c(u);probeUrl="https://www.gstatic.com/generate_204";probeTimeoutMs=5e3;healthyRecheckMs=6e4;retryIntervalsMs=[5e3,3e4,6e4];useConnectionStateTriggers=!0;isBrowser=typeof window<"u"&&typeof document<"u";started=!1;retryAttempt=0;checkTimer=null;lastConnectionState=null;isChecking=t(!1);isReachable=t(null);lastSuccessAt=t(null);lastCheckedAt=t(null);lastError=t(null);internetAvailable=d(()=>this.isReachable()===!0);start(){this.started||!this.isBrowser||(this.started=!0,h(n(window,"online"),n(window,"offline")).pipe(o(this.destroyRef)).subscribe(()=>this.recheckNow()),n(document,"visibilitychange").pipe(o(this.destroyRef)).subscribe(()=>{document.visibilityState==="visible"&&this.recheckNow()}),this.useConnectionStateTriggers&&this.connectionStateMachine.status$.pipe(o(this.destroyRef)).subscribe(e=>{e?.state&&e.state!==this.lastConnectionState&&(this.lastConnectionState=e.state,this.recheckNow())}),this.recheckNow())}recheckNow(){this.started&&(this.clearTimer(),this.isChecking()||this.runProbe())}runProbe(){return a(this,null,function*(){this.isChecking.set(!0),this.lastCheckedAt.set(new Date);try{let e=yield this.performProbe();this.isReachable.set(e),e?(this.lastSuccessAt.set(new Date),this.lastError.set(null),this.retryAttempt=0,this.scheduleNext(this.healthyRecheckMs)):(this.lastError.set("Internet reachability probe failed"),this.scheduleRetry())}catch(e){this.isReachable.set(!1),this.lastError.set("Internet reachability probe failed"),this.scheduleRetry()}finally{this.isChecking.set(!1)}})}performProbe(){return a(this,null,function*(){let e=new AbortController,i=setTimeout(()=>e.abort(),this.probeTimeoutMs);try{let r=yield fetch(this.probeUrl,{method:"GET",mode:"no-cors",cache:"no-store",signal:e.signal});return r.type==="opaque"?!0:r.status>=200&&r.status<400}catch(r){return!1}finally{clearTimeout(i)}})}scheduleRetry(){let e=Math.min(this.retryAttempt,this.retryIntervalsMs.length-1),i=this.retryIntervalsMs[e];this.retryAttempt++,this.scheduleNext(i)}scheduleNext(e){this.clearTimer(),this.checkTimer=setTimeout(()=>{this.checkTimer=null,this.runProbe()},e)}clearTimer(){this.checkTimer&&(clearTimeout(this.checkTimer),this.checkTimer=null)}ngOnDestroy(){this.clearTimer()}static \u0275fac=function(i){return new(i||s)};static \u0275prov=l({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})();export{w as a};
package/public/index.html CHANGED
@@ -62,5 +62,5 @@
62
62
  </div>
63
63
  </app-root>
64
64
  </div>
65
- <link rel="modulepreload" href="chunk-KQEEYPK3.js"><link rel="modulepreload" href="chunk-ISF5E3CX.js"><link rel="modulepreload" href="chunk-XBSU7OGT.js"><link rel="modulepreload" href="chunk-VXTTEFRP.js"><link rel="modulepreload" href="chunk-WH5CIUSB.js"><link rel="modulepreload" href="chunk-TBNKOU7M.js"><link rel="modulepreload" href="chunk-VPF5756E.js"><link rel="modulepreload" href="chunk-WQSJFJLW.js"><link rel="modulepreload" href="chunk-RCYOZLZB.js"><link rel="modulepreload" href="chunk-NFJ4RQSE.js"><script src="polyfills-L4FJGPOC.js" type="module"></script><script src="scripts-M6PHZBML.js" defer></script><script src="main-B6TXB3EB.js" type="module"></script></body>
65
+ <link rel="modulepreload" href="chunk-BMHMHQFO.js"><link rel="modulepreload" href="chunk-P3M6SJQT.js"><link rel="modulepreload" href="chunk-ZY3U4H4Z.js"><link rel="modulepreload" href="chunk-5SAXWR6Z.js"><link rel="modulepreload" href="chunk-BGGO4PGD.js"><link rel="modulepreload" href="chunk-B4NYOD6L.js"><link rel="modulepreload" href="chunk-MGLD6QDJ.js"><link rel="modulepreload" href="chunk-POMIQBAL.js"><link rel="modulepreload" href="chunk-CSIELI2Z.js"><link rel="modulepreload" href="chunk-3JA4CQ7T.js"><script src="polyfills-L4FJGPOC.js" type="module"></script><script src="scripts-M6PHZBML.js" defer></script><script src="main-I33LH3HC.js" type="module"></script></body>
66
66
  </html>
@@ -1 +1 @@
1
- import{a as xe,b as vt}from"./chunk-KQEEYPK3.js";import{a as Ft,b as A,c as H,i as he,k as E,l as _e,m as lt,o as ve,p as be,s as Ce,u as dt}from"./chunk-ISF5E3CX.js";import{a as Ie}from"./chunk-XBSU7OGT.js";import{c as le}from"./chunk-VXTTEFRP.js";import{a as Oe,b as Pe,c as Ne,d as De,e as Ae,f as Te}from"./chunk-WH5CIUSB.js";import{a as ke}from"./chunk-TBNKOU7M.js";import{c as pe,d as Se,g as ye,h as we,j as Me}from"./chunk-VPF5756E.js";import{b as Ee}from"./chunk-WQSJFJLW.js";import{e as ge}from"./chunk-RCYOZLZB.js";import{c as de,d as me,e as fe,f as ue}from"./chunk-NFJ4RQSE.js";import{o as st,p as ct,q as B,r as z}from"./chunk-SJFJEOSG.js";import{a as Zt,b as rt,d as te,e as k,g as ee,h as ie,i as oe}from"./chunk-FZFDGAQO.js";import{a as ce}from"./chunk-YI3MZWRZ.js";import{f as ae,g as re,t as se}from"./chunk-67V4XHCY.js";import{c as Lt,e as Xt,g as ot,h as L,i as nt,k as D,l as at,m as x,n as ne}from"./chunk-P7JKENHI.js";import{A as yt,Aa as Y,Ab as F,Ac as Et,Ad as Ht,Bb as K,Cb as M,Cd as $t,Db as a,Dd as qt,Eb as s,Ec as Rt,Ee as it,Fa as kt,Fb as I,Fc as tt,Ga as w,Hc as _t,Ia as It,Ic as Ut,K as U,Ke as Yt,Mb as S,Ne as Jt,Ob as f,Oe as R,Pe as h,Qb as u,Re as V,Se as T,U as wt,Va as p,Vd as jt,Yb as X,Zb as Z,_b as Pt,a as Ct,ac as Nt,ba as Mt,c as St,cd as Kt,ce as Wt,dc as l,ec as q,f as $,fb as P,fc as Dt,ge as et,he as Gt,jc as ut,je as N,ka as C,kc as ht,ke as Qt,lc as gt,m as mt,pa as n,qb as ft,ra as xt,ua as g,ub as Ot,uc as At,va as _,vd as Vt,wb as v,wc as Tt,wd as Bt,xb as b,xd as zt,ya as Q,yb as J,z as G,zc as j}from"./chunk-BTFZS2TW.js";var pt=(i,c)=>{let t=n(x),e=n(k),o=t.getSplitShellEnabled(),r="/"+c.map(y=>y.path).join("/"),d=r.startsWith("/chartplotter"),m=r.startsWith("/dashboard");if(o&&m&&!d){let y=c.length>1?c[1].path:void 0;return e.createUrlTree(["chartplotter",y??""])}if(!o&&d){let y=c.length>1?c[1].path:void 0;return e.createUrlTree(["dashboard",y??""])}return!0};var Re=[{path:"dashboard/:id",component:vt,canMatch:[pt]},{path:"chartplotter/:id",loadComponent:()=>import("./chunk-CD5TQSCS.js").then(i=>i.SplitShellComponent),canMatch:[pt]},{path:"settings",loadComponent:()=>import("./chunk-I4SJ5UNN.js").then(i=>i.SettingsComponent),title:"KIP - Settings"},{path:"options",loadComponent:()=>import("./chunk-IH4CEW4C.js").then(i=>i.TabsComponent),title:"KIP - Options"},{path:"remote",loadComponent:()=>import("./chunk-R36UY4Q4.js").then(i=>i.RemoteControlComponent),title:"KIP - Remote Control"},{path:"help/:page",loadComponent:()=>import("./chunk-Q2ANAJAD.js").then(i=>i.AppHelpComponent),title:"KIP - Help"},{path:"help",loadComponent:()=>import("./chunk-Q2ANAJAD.js").then(i=>i.AppHelpComponent),title:"KIP - Help"},{path:"data",loadComponent:()=>import("./chunk-TVNXBPFF.js").then(i=>i.DataInspectorComponent),title:"KIP - Data Inspector"},{path:"login",loadComponent:()=>import("./chunk-P4CRTB7N.js").then(i=>i.WidgetLoginComponent),title:"Login"},{path:"**",component:vt,canMatch:[pt]}];var Ue={production:!0};var Ye=(i,c)=>c.path;function Je(i,c){i&1&&(a(0,"mat-icon"),l(1,"info"),s())}function Xe(i,c){i&1&&(a(0,"mat-icon"),l(1,"info"),s())}function Ze(i,c){i&1&&(a(0,"mat-icon",3),l(1,"report"),s())}function ti(i,c){i&1&&(a(0,"mat-icon",4),l(1,"warning"),s())}function ei(i,c){i&1&&(a(0,"mat-icon",5),l(1,"error"),s())}function ii(i,c){i&1&&(a(0,"mat-icon",6),l(1,"emergency_home"),s())}function oi(i,c){if(i&1){let t=S();a(0,"div",2),v(1,Je,2,0,"mat-icon")(2,Xe,2,0,"mat-icon")(3,Ze,2,0,"mat-icon",3)(4,ti,2,0,"mat-icon",4)(5,ei,2,0,"mat-icon",5)(6,ii,2,0,"mat-icon",6),a(7,"div",7),l(8),s(),a(9,"div",8),l(10),At(11,"slice"),s(),a(12,"div",9),l(13),s(),a(14,"button",10),f("click",function(){let o=g(t).$implicit,r=u();return _(r.silence(o.path))}),a(15,"mat-icon"),l(16,"music_off"),s()(),a(17,"button",11),f("click",function(){let o=g(t).$implicit,r=u();return _(r.clear(o.path))}),a(18,"mat-icon"),l(19,"published_with_changes"),s()()(),I(20,"mat-divider",12)}if(i&2){let t,e=c.$implicit;p(),b((t=e.value.state)==="nominal"?1:t==="normal"?2:t==="alert"?3:t==="warn"?4:t==="alarm"?5:t==="emergency"?6:-1),p(7),q(e.value.state),p(2),Dt(" ",Tt(11,5,e.path,14)," "),p(3),q(e.value.message),p(),M("disabled",!(e.value.method!=null&&e.value.method.includes("sound")))}}function ni(i,c){i&1&&(a(0,"mat-list-item",13)(1,"span",15),l(2,"Notifications Disabled"),s(),a(3,"span")(4,"i"),l(5,"*Enable notifications in Settings."),s()()())}function ai(i,c){i&1&&(a(0,"mat-list-item",14)(1,"i"),l(2,'"No Notification"'),s()())}function ri(i,c){if(i&1&&v(0,ni,6,0,"mat-list-item",13)(1,ai,3,0,"mat-list-item",14),i&2){let t=u();b(t.notificationConfig().disableNotifications?0:1)}}function si(i,c){if(i&1){let t=S();a(0,"button",17),f("click",function(){g(t);let o=u(2);return _(o.mutePlayer(!o.isMuted))}),a(1,"span",18),l(2,"volume_up"),s(),l(3," Unmute Audio "),s()}}function ci(i,c){if(i&1){let t=S();a(0,"button",17),f("click",function(){g(t);let o=u(2);return _(o.mutePlayer(!o.isMuted))}),a(1,"span",18),l(2,"volume_off"),s(),l(3," Mute Audio "),s()}}function li(i,c){if(i&1&&v(0,si,4,0,"button",16)(1,ci,4,0,"button",16),i&2){let t=u();b(t.isMuted?0:1)}}var Le=(()=>{class i{_notificationsService=n(E);_notifications$=this._notificationsService.observeNotifications();notificationConfig=h(this._notificationsService.observeNotificationConfiguration(),{requireSync:!0});menuNotifications=h(yt([this._notifications$,this._notificationsService.observeNotificationConfiguration()]).pipe(G(([t,e])=>{let o=[];return e.devices.showNormalState||o.push(st.Normal),e.devices.showNominalState||o.push(st.Nominal),t.filter(r=>r.value&&r.value.state&&!o.includes(r.value.state)).filter(r=>{let d=r.value?.method;return d?.length?d.includes(ct.Visual)||d.includes(ct.Sound):!1})})),{requireSync:!0,equal:Xt});isMuted=!1;mutePlayer(t){this.isMuted=t,this._notificationsService.mutePlayer(t)}silence(t){this._notificationsService.setSkMethod(t,[ct.Visual])}clear(t){this._notificationsService.setSkState(t,st.Normal)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=P({type:i,selectors:[["menu-notifications"]],decls:6,vars:2,consts:[[1,"menu-item-container"],[1,"actions-container","actions-bottom-container"],[1,"notification-container"],[1,"icon-alert-color"],[1,"icon-warn-color"],[1,"icon-alarm-color"],[1,"icon-emergency-color"],[1,"notification-title"],[1,"notification-path","scrollable-text"],[1,"notification-text"],["mat-icon-button","",1,"notification-action-btn",3,"click","disabled"],["mat-icon-button","",1,"notification-action-btn",3,"click"],[1,"notification-divider"],["lines","3","disabled","true",2,"text-align","center"],["disabled","true",2,"text-align","center"],["matListItemTitle",""],["mat-flat-button","","matTooltip","Temporally toggle all notification audio. To permanently disable/enable notification audio, use the configuration settings option",1,"action-button"],["mat-flat-button","","matTooltip","Temporally toggle all notification audio. To permanently disable/enable notification audio, use the configuration settings option",1,"action-button",3,"click"],[1,"material-icons"]],template:function(e,o){e&1&&(a(0,"mat-list",0),F(1,oi,21,8,null,null,Ye,!1,ri,2,1),s(),a(4,"div",1),v(5,li,2,1),s()),e&2&&(p(),K(o.menuNotifications()),p(4),b(o.notificationConfig().disableNotifications?-1:5))},dependencies:[Me,ye,we,ce,Se,N,et,Wt,lt,ue,fe,T,V,Kt],styles:[".notification-container[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-evenly;padding:2px 10px 7px;scroll-behavior:smooth}mat-icon[_ngcontent-%COMP%]{margin-right:10px}.scrollable-text[_ngcontent-%COMP%]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.scrollable-text[_ngcontent-%COMP%]:hover{overflow:auto;white-space:normal;word-wrap:break-word}.notification-title[_ngcontent-%COMP%]{text-transform:capitalize;font-size:var(--mat-sys-headline-small-size);width:calc(100% - 34px)}.notification-path[_ngcontent-%COMP%]{font-size:var(--mat-sys-body-small-size);word-break:break-all;width:100%}.notification-text[_ngcontent-%COMP%]{font-size:var(--mat-sys-body-small-line-height);font-style:italic;width:100%;overflow:auto;white-space:normal;word-wrap:break-word}.notification-action-btn[_ngcontent-%COMP%]{background-color:var(--mat-sys-surface-container)}.notification-btn-container[_ngcontent-%COMP%]{display:inline-block;width:50%;height:48px;text-align:center}.menu-item-container[_ngcontent-%COMP%]{width:230px;overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;height:calc(100% - 48px)}.notification-bottom-container[_ngcontent-%COMP%]{position:absolute;bottom:0;width:100%;background-color:var(--mat-sys-surface-container)}.actions-container[_ngcontent-%COMP%]{display:grid;grid-auto-flow:column}.actions-bottom-container[_ngcontent-%COMP%]{position:absolute;bottom:0;width:100%;height:48px}.action-button[_ngcontent-%COMP%]{border-radius:0;height:48px;border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large))}.icon-alert-color[_ngcontent-%COMP%]{color:var(--kip-zone-alert-color)}.icon-warn-color[_ngcontent-%COMP%]{color:var(--kip-zone-warn-color)}.icon-alarm-color[_ngcontent-%COMP%]{color:var(--kip-zone-alarm-color)}.icon-emergency-color[_ngcontent-%COMP%]{color:var(--kip-zone-emergency-color)}.alarm-emergency-blink[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_blinking-emergency 1.5s infinite}@keyframes _ngcontent-%COMP%_blinking-emergency{0%{background-color:var(--kip-zone-alarm-color)}50%{background-color:transparent}to{background-color:var(--kip-zone-alarm-color)}}.warn[_ngcontent-%COMP%]{color:var(--kip-zone-warn-color)}.notification-divider[_ngcontent-%COMP%]{padding-top:10px}"],changeDetection:0})}return i})();var di=["badgeButton"],Ve=(()=>{class i{badgeButton=tt.required("badgeButton");_notifications=n(E);notificationsInfo=h(this._notifications.observerNotificationsInfo());openNotificationMenu(){let t=new Event("openRightSidenav",{bubbles:!0,cancelable:!0});window.document.dispatchEvent(t)}onKeyDown(t){let e=t.key?.toLowerCase();(e==="enter"||e===" "||e==="spacebar")&&(t.preventDefault(),this.openNotificationMenu())}focus(){try{let t=this.badgeButton&&this.badgeButton(),e=t&&t.nativeElement;e&&typeof e.focus=="function"&&e.focus()}catch(t){}}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=P({type:i,selectors:[["notification-badge"]],viewQuery:function(e,o){e&1&&X(o.badgeButton,di,5),e&2&&Z()},decls:5,vars:7,consts:[["badgeButton",""],["mat-fab","","role","button","aria-label","Open notifications",1,"layout-action-btn",3,"click","keydown"],["aria-hidden","false","matBadgeSize","large","matBadgePosition","after","matBadgeOverlap","true",1,"icon-alert-color",3,"matBadgeHidden","matBadge"]],template:function(e,o){e&1&&(a(0,"div")(1,"button",1,0),f("click",function(){return o.openNotificationMenu()})("keydown",function(d){return o.onKeyDown(d)}),a(3,"mat-icon",2),l(4,"notifications "),s()()()),e&2&&(p(),Nt("warn",o.notificationsInfo().isWarn)("alarm-emergency-blink",o.notificationsInfo().isAlarmEmergency),Ot("aria-haspopup",!0),p(2),M("matBadgeHidden",!o.notificationsInfo().alarmCount)("matBadge",o.notificationsInfo().alarmCount))},dependencies:[N,Gt,T,V,lt,_e],styles:["[_nghost-%COMP%]{display:block}.layout-action-btn[_ngcontent-%COMP%]{color:var(--mat-sys-on-primary);background-color:var(--mat-sys-primary)}.icon-alert-color[_ngcontent-%COMP%]{--mat-list-list-item-leading-icon-color: var(--kip-zone-alert-color)}.icon-warn-color[_ngcontent-%COMP%]{--mat-list-list-item-leading-icon-color: var(--kip-zone-warn-color)}.icon-alarm-color[_ngcontent-%COMP%]{--mat-list-list-item-leading-icon-color: var(--kip-zone-alarm-color)}.icon-emergency-color[_ngcontent-%COMP%]{--mat-list-list-item-leading-icon-color: var(--kip-zone-emergency-color)}.alarm-emergency-blink[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_blinking-emergency 1.5s infinite}@keyframes _ngcontent-%COMP%_blinking-emergency{0%{background-color:var(--kip-zone-alarm-color)}50%{background-color:var(--mat-sys-primary)}to{background-color:var(--kip-zone-alarm-color)}}.warn[_ngcontent-%COMP%]{color:var(--kip-zone-warn-color)}"]})}return i})();var Be=(()=>{class i{overlayRef=null;overlay=n(Yt);injector=n(Q);open(){if(this.overlayRef)return;this.overlayRef=this.overlay.create({hasBackdrop:!1,panelClass:"notification-overlay-panel",positionStrategy:this.overlay.position().global().bottom("20px").left("20px"),scrollStrategy:this.overlay.scrollStrategies.reposition()});let t=new Qt(Ve,null,this.injector),e=this.overlayRef.attach(t);try{let o=e&&e.instance;if(o&&typeof o.focus=="function")o.focus();else{let r=this.overlayRef.overlayElement,d=r&&r.querySelector("button[mat-fab], .layout-action-btn");d&&typeof d.focus=="function"&&d.focus()}}catch(o){}}close(){try{this.overlayRef&&this.overlayRef.dispose()}catch(t){console.warn("[NotificationOverlayService] dispose failed",t)}finally{this.overlayRef=null}}toggle(t){t?this.open():this.close()}isOpen(){return!!this.overlayRef}ngOnDestroy(){try{this.overlayRef&&this.overlayRef.dispose()}catch(t){}finally{this.overlayRef=null}}static \u0275fac=function(e){return new(e||i)};static \u0275prov=C({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();function pi(i,c){if(i&1){let t=S();a(0,"button",12),f("click",function(){g(t);let o=u(2);return _(o.onActionItem("toggleFullScreen"))}),a(1,"span",10),l(2,"fullscreen"),s()()}}function mi(i,c){if(i&1){let t=S();a(0,"button",12),f("click",function(){g(t);let o=u(2);return _(o.onActionItem("toggleFullScreen"))}),a(1,"span",10),l(2,"close_fullscreen"),s()()}}function fi(i,c){if(i&1&&v(0,pi,3,0,"button",11)(1,mi,3,0,"button",11),i&2){let t=u();b(t.uiEvent.fullscreenStatus()?1:0)}}function ui(i,c){if(i&1){let t=S();a(0,"button",14),f("click",function(){g(t);let o=u(2);return _(o.onActionItem("nightMode"))}),a(1,"span",10),l(2,"mode_night"),s()()}}function hi(i,c){if(i&1){let t=S();a(0,"button",14),f("click",function(){g(t);let o=u(2);return _(o.onActionItem("nightMode"))}),a(1,"span",10),l(2,"light_mode"),s()()}}function gi(i,c){if(i&1&&v(0,ui,3,0,"button",13)(1,hi,3,0,"button",13),i&2){let t=u();b(t.app.isNightMode()?1:0)}}function _i(i,c){if(i&1){let t=S();a(0,"tile-large-icon",15,1),f("click",function(){let o=g(t).$index,r=u();return _(r.navigateToDashboard(o))}),s()}if(i&2){let t=c.$implicit;M("active",t.active)("svgIcon",t.svgIcon)("iconSize",t.iconSize)("label",t.label)}}var ze=(()=>{class i{actionsSidenav=Rt.required();_router=n(k);uiEvent=n(dt);dashboard=n(A);app=n(le);_settings=n(x);isAutoNightMode=h(this._settings.getAutoNightModeAsO(),{requireSync:!0});_initialDashboardMatch=(()=>{let e=this._router.parseUrl(this._router.url).root.children.primary,o=e?e.segments.map(r=>r.path):[];return o.length===0||o[0]==="dashboard"||o[0]==="chartplotter"})();isDashboardContext=h(this._router.events.pipe(U(t=>t instanceof rt),Mt(null),G(()=>{let e=this._router.parseUrl(this._router.url).root.children.primary,o=e?e.segments.map(r=>r.path):[];return o.length===0||o[0]==="dashboard"||o[0]==="chartplotter"}),wt()),{initialValue:this._initialDashboardMatch});menuItems=Et(()=>{let t=this.dashboard.dashboards(),e=this.dashboard.activeDashboard();return t.map((o,r)=>({id:Number(o.id),active:r===e,pinned:!1,svgIcon:o.icon||"dashboard-dashboard",iconSize:60,label:o.name||`Dashboard ${r+1}`}))});ngAfterViewInit(){this.uiEvent.addHotkeyListener((t,e)=>this.handleKeyDown(t,e),{ctrlKey:!0,shiftKey:!0,keys:["e","f","n"]})}ngOnDestroy(){this.uiEvent.removeHotkeyListener(this.handleKeyDown.bind(this))}handleKeyDown(t,e){switch(t){case"e":this.onActionItem("layout");break;case"f":this.onActionItem("toggleFullScreen");break;case"n":this.onActionItem("nightMode");break;default:break}}onActionItem(t){switch(this.actionsSidenav().close(),t){case"toggleFullScreen":this.uiEvent.toggleFullScreen();break;case"settings":this._router.navigate(["/settings"]);break;case"layout":this.dashboard.setStaticDashboard(!1);break;case"nightMode":this.app.isNightMode.set(!this.app.isNightMode()),this.app.toggleDayNightMode();break;default:break}}navigateToDashboard(t){this.actionsSidenav().close(),this._router.navigate([`dashboard/${t}`])}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=P({type:i,selectors:[["menu-actions"]],inputs:{actionsSidenav:[1,"actionsSidenav"]},decls:14,vars:3,consts:[["tileContainer",""],["tile",""],[1,"actions-container"],[1,"actions-top-container"],["mat-flat-button","","tabindex","0",1,"action-button","home-btn",3,"click"],["height","24px","width","24px","svgIcon","kip","aria-hidden","false",1,"home-icon",2,"height","24px","width","24px"],[1,"menu-item-container"],[3,"active","svgIcon","iconSize","label"],[1,"actions-bottom-container"],["mat-flat-button","",1,"action-button",2,"width","135px",3,"click","disabled"],[1,"material-icons"],["mat-flat-button","","tabindex","0",1,"action-button"],["mat-flat-button","","tabindex","0",1,"action-button",3,"click"],["mat-flat-button","",1,"action-button"],["mat-flat-button","",1,"action-button",3,"click"],[3,"click","active","svgIcon","iconSize","label"]],template:function(e,o){e&1&&(a(0,"div",2)(1,"div",3),v(2,fi,2,1),v(3,gi,2,1),a(4,"button",4),f("click",function(){return o.onActionItem("settings")}),I(5,"mat-icon",5),s()(),a(6,"div",6,0),F(8,_i,2,4,"tile-large-icon",7,J),s(),a(10,"div",8)(11,"button",9),f("click",function(){return o.onActionItem("layout")}),a(12,"span",10),l(13,"lock_open"),s()()()()),e&2&&(p(2),b(o.uiEvent.fullscreenSupported()?2:-1),p(),b(o.isAutoNightMode()?-1:3),p(5),K(o.menuItems()),p(3),M("disabled",!o.isDashboardContext()))},dependencies:[T,V,N,et,ke],styles:[".actions-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;width:135px}.actions-top-container[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:wrap;width:100%}.actions-bottom-container[_ngcontent-%COMP%]{height:48px;width:100%}.action-button[_ngcontent-%COMP%]{border-radius:0;height:48px;flex:1 1 48px;min-height:0;overflow:hidden;border:1px solid var(--mat-sidenav-container-background-color, var(--mat-sys-surface))}.home-btn[_ngcontent-%COMP%]{--mat-icon-button-icon-size: 24px;--mat-button-filled-icon-offset: 0px;--mat-button-filled-icon-spacing: 0px;--mat-button-filled-label-text-size: 0px}.home-icon[_ngcontent-%COMP%] .mat-mdc-unelevated-button[_ngcontent-%COMP%] > .mat-icon[_ngcontent-%COMP%]{font-size:0px}.full-size[_ngcontent-%COMP%]{width:135px}.menu-item-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex-wrap:nowrap;padding:3px 1px;gap:5px;width:135px;overflow-y:auto;scrollbar-width:none;overflow-x:hidden;scroll-behavior:smooth;flex:1 1 auto;min-height:0}"]})}return i})();var He=(()=>{class i{COMMAND_SET_DISPLAY_PATH="self.kip.remote.setDisplay";COMMAND_SET_SCREEN_INDEX_PATH="self.kip.remote.setScreenIndex";COMMAND_REQUEST_ACTIVE_SCREEN_PATH="self.kip.remote.requestActiveScreen";settings=n(x);dashboard=n(A);data=n(z);requests=n(pe);KIP_UUID=this.settings.KipUUID;ACTIVE_SCREEN_PATH=`self.displays.${this.KIP_UUID}.screenIndex`;CHANGE_SCREEN_PATH=`self.displays.${this.KIP_UUID}.activeScreen`;displayName=h(this.settings.getInstanceNameAsO());isRemoteControl=h(this.settings.getIsRemoteControlAsO());remoteScreenPosition=h(this.data.subscribePath(this.ACTIVE_SCREEN_PATH,"default"));changeDashboardTo=h(this.data.subscribePath(this.CHANGE_SCREEN_PATH,"default"));previousIsRemoteControl=!1;constructor(){this.setActiveDashboardOnRemote(this.KIP_UUID,null),this.setScreensOnRemote(this.KIP_UUID,null),this.clearActiveScreenOnRemote(this.KIP_UUID,null),console.log("[Remote Dashboards] Cleaning paths on server"),w(()=>{let t=this.isRemoteControl(),e=this.displayName();j(()=>{if(!t&&!this.previousIsRemoteControl)return;this.previousIsRemoteControl=t;let o;t?(o=this.getScreensPayload(this.dashboard.dashboards()),this.dashboard.activeDashboard()!==null&&this.setActiveDashboardOnRemote(this.KIP_UUID,this.dashboard.activeDashboard())):(o=null,this.clearActiveDashboardOnServer()),this.shareScreens(o)})}),w(()=>{let t=this.dashboard.dashboards();j(()=>{if(!this.isRemoteControl())return;let e=this.getScreensPayload(t);this.shareScreens(e)})}),w(()=>{let t=this.dashboard.activeDashboard();j(()=>{this.isRemoteControl()&&t!==null&&(this.setActiveDashboardOnRemote(this.KIP_UUID,t),console.log(`[Remote Dashboards] Sent new dashboard highlight index ${t} to server.`))})}),w(()=>{let t=this.changeDashboardTo();j(()=>{if(!this.isRemoteControl()||t.data.value==null)return;let e=Number(t.data.value);!isNaN(e)&&e>=0&&e<this.dashboard.dashboards().length&&this.dashboard.activeDashboard()!==e&&(this.dashboard.navigateTo(e),console.log(`[Remote Dashboards] Executed remote request to change active dashboard to: ${e}`))})})}clearActiveDashboardOnServer(){this.setActiveDashboardOnRemote(this.KIP_UUID,null),console.log("[Remote Dashboards] Disabled: Cleared active dashboard on server")}getScreensPayload(t){let e=this.displayName(),o=t.map(m=>{var y=m,{configuration:r}=y,d=St(y,["configuration"]);return d});return{displayName:e,screens:o}}shareScreens(t){this.setScreensOnRemote(this.KIP_UUID,t),console.log("[Remote Dashboards] Sending dashboard configurations to server.")}setActiveDashboardOnRemote(t,e){let o={displayId:t,screenIdx:e};this.requests.putRequest(this.COMMAND_SET_SCREEN_INDEX_PATH,o,this.KIP_UUID)||console.error("[Remote Dashboards] Error sharing active dashboard: request was not accepted")}setScreensOnRemote(t,e){let o={displayId:t,display:e===null?null:Ct({},e)};this.requests.putRequest(this.COMMAND_SET_DISPLAY_PATH,o,this.KIP_UUID)||console.error("[Remote Dashboards] Error sharing screen configuration: request was not accepted")}clearActiveScreenOnRemote(t,e){let o={displayId:t,screenIdx:e};this.requests.putRequest(this.COMMAND_REQUEST_ACTIVE_SCREEN_PATH,o,this.KIP_UUID)||console.error("[Remote Dashboards] Error clearing active screen request path: request was not accepted")}static \u0275fac=function(e){return new(e||i)};static \u0275prov=C({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var $e=11,qe="connectionConfig",W=(()=>{class i{config;isLoggedIn=null;loggedInSubscription=null;connection=n(nt);auth=n(D);connectionStateMachine=n(L);router=n(k);delta=n(B);data=n(z);storage=n(at);internetReachability=n(Ie);injector=n(Q);datasetService=null;_bootstrapStatus$=new mt("starting");_bootstrapIssue$=new mt({reason:"none"});constructor(){this.loggedInSubscription=this.auth.isLoggedIn$.subscribe(t=>{this.isLoggedIn=t})}initNetworkServices(){return $(this,null,function*(){let t=!1;this.loadLocalStorageConfig(),this.preloadFonts(),this.internetReachability.start();try{if(this.config?.signalKUrl!==void 0&&this.config.signalKUrl!==null&&(yield this.connection.initializeConnection({url:this.config.signalKUrl,new:!1},this.config.proxyEnabled,this.config.signalKSubscribeAll)),!this.isLoggedIn&&this.config?.signalKUrl&&this.config?.useSharedConfig&&this.config?.loginName&&this.config?.loginPassword&&(yield this.login()),this.isLoggedIn&&this.config?.useSharedConfig)if(yield this.storage.waitUntilReady()){let o=yield this.storage.getConfig("user",this.config.sharedConfigName,$e),r={sharedConfigName:this.config.sharedConfigName,configFileVersion:$e,initConfig:o};this.storage.bootstrapRemoteContext(r)}else throw new Error("[AppInit Network Service] StorageService did not become ready in time. Cannot bootstrap remote configuration.");this._bootstrapIssue$.next({reason:"none"}),yield this.getDatasetService().waitUntilReady(),!this.isLoggedIn&&this.config?.signalKUrl&&this.config?.useSharedConfig&&this.router.navigate(["/login"])}catch(e){if(t=!0,e?.status===404&&this.config?.useSharedConfig){let o=yield this.probeLegacyUpgradeAvailability(this.config.sharedConfigName);this._bootstrapIssue$.next({reason:"missing-shared-config",statusCode:404,sharedConfigName:this.config.sharedConfigName,legacyUpgradeAvailable:o})}else e?.status===0?this._bootstrapIssue$.next({reason:"network-unreachable",statusCode:0}):e?.status===401?this._bootstrapIssue$.next({reason:"unauthorized",statusCode:401}):this._bootstrapIssue$.next({reason:"unknown",statusCode:e?.status});e.status===0?(yield this.waitForHttpRetryCompletion())===ot.HTTPConnected||this.connectionStateMachine.isHTTPConnected()?console.warn("[AppInit Network Service] Initial connection recovered during retry cycle. Skipping fallback route."):(console.warn("[AppInit Network Service] Initialization failed after HTTP retries. Redirecting to settings page."),yield this.router.navigate(["/options"])):e.status===401?(console.warn("[AppInit Network Service] Initialization failed. Unauthorized access. Redirecting to login page."),yield this.router.navigate(["/login"])):(console.warn("[AppInit Network Service] Initialization failed. Error: ",JSON.stringify(e)),yield this.router.navigate(["/options"])),console.warn("[AppInit Network Service] Startup continuing in degraded mode to allow UI feedback."),this._bootstrapStatus$.next("degraded");return}finally{t||this._bootstrapStatus$.next("ready"),console.log("[AppInit Network Service] Initialization completed"),this.connectionStateMachine.enableWebSocketMode(),this.connectionStateMachine.isHTTPConnected()&&(console.log("[AppInit Network Service] Starting WebSocket connection after initialization"),this.connectionStateMachine.startWebSocketConnection())}})}get bootstrapStatus$(){return this._bootstrapStatus$.asObservable()}get bootstrapIssue$(){return this._bootstrapIssue$.asObservable()}getDatasetService(){return this.datasetService||(this.datasetService=this.injector.get(H)),this.datasetService}waitForHttpRetryCompletion(t){return $(this,null,function*(){let e=t??this.connectionStateMachine.getHttpRetryWindowMs(2e3),o=new Set([ot.HTTPConnected,ot.PermanentFailure]),r=this.connectionStateMachine.currentState;return o.has(r)?r:new Promise(d=>{let m=window.setTimeout(()=>{y.unsubscribe(),d(null)},e),y=this.connectionStateMachine.state$.subscribe(bt=>{o.has(bt)&&(clearTimeout(m),y.unsubscribe(),d(bt))})})})}probeLegacyUpgradeAvailability(t){return $(this,null,function*(){if(!t)return!1;try{return(yield this.storage.getConfig("user",t,9))?.app?.configVersion===10}catch(e){return!1}})}login(){return $(this,null,function*(){if(!this.isLoggedIn&&this.config.useSharedConfig&&this.config.loginName&&this.config.loginPassword)try{yield this.auth.login({usr:this.config.loginName,pwd:this.config.loginPassword})}catch(t){throw t.status===0?this.router.navigate(["/settings"]):t.status===401&&this.router.navigate(["/login"]),t}})}setLocalStorageConfig(){localStorage.setItem(qe,JSON.stringify(this.config))}loadLocalStorageConfig(){this.config=JSON.parse(localStorage.getItem(qe)),this.config?this.config.signalKUrl||(this.config.signalKUrl=window.location.origin,this.setLocalStorageConfig(),console.log(`[AppInit Network Service] Config found with no server URL. Setting Auto-Discovery URL: ${this.config.signalKUrl}`)):(this.config=Lt,this.config.signalKUrl=window.location.origin,console.log(`[AppInit Network Service] Connection Configuration not found. Creating configuration using Auto-Discovery URL: ${this.config.signalKUrl}`),this.setLocalStorageConfig()),this.config.configVersion==9&&(this.config.configVersion=10,this.setLocalStorageConfig(),console.log("[AppInit Network Service] Upgrading Connection version from 9 to 10")),this.config.configVersion==10&&(this.config.configVersion=11,this.setLocalStorageConfig(),console.log("[AppInit Network Service] Upgrading Connection version from 10 to 11")),this.config.configVersion==11&&(this.config.configVersion=12,this.setLocalStorageConfig(),console.log("[AppInit Network Service] Upgrading Connection version from 11 to 12"))}preloadFonts(){let t=[{family:"Roboto",src:"url(./assets/google-fonts/KFOlCnqEu92Fr1MmSU5fChc4AMP6lbBP.woff2)",options:{weight:"300",style:"normal"}},{family:"Roboto",src:"url(./assets/google-fonts/KFOlCnqEu92Fr1MmSU5fBBc4AMP6lQ.woff2)",options:{weight:"300",style:"normal"}},{family:"Roboto",src:"url(./assets/google-fonts/KFOmCnqEu92Fr1Mu7GxKKTU1Kvnz.woff2)",options:{weight:"400",style:"normal"}},{family:"Roboto",src:"url(./assets/google-fonts/KFOmCnqEu92Fr1Mu4mxKKTU1Kg.woff2)",options:{weight:"400",style:"normal"}},{family:"Roboto",src:"url(./assets/google-fonts/KFOlCnqEu92Fr1MmEU9fChc4AMP6lbBP.woff2)",options:{weight:"500",style:"normal"}},{family:"Roboto",src:"url(./assets/google-fonts/KFOlCnqEu92Fr1MmEU9fBBc4AMP6lQ.woff2)",options:{weight:"500",style:"normal"}}];for(let{family:e,src:o,options:r}of t){let d=new FontFace(e,o,r);d.load().then(()=>document.fonts.add(d)).catch(m=>console.log(`[AppInit Network Service] Error loading fonts: ${m}`))}}ngOnDestroy(){this.loggedInSubscription?.unsubscribe()}static \u0275fac=function(e){return new(e||i)};static \u0275prov=C({token:i,factory:i.\u0275fac})}return i})();var vi=["upgradeMessages"];function bi(i,c){if(i&1&&(a(0,"li"),l(1),s()),i&2){let t=c.$implicit;p(),q(t)}}function Ci(i,c){if(i&1&&(a(0,"ul",11,1),F(2,bi,2,1,"li",null,J),s()),i&2){let t=u(2);p(2),K(t.upgrade.messages())}}function Si(i,c){if(i&1&&(a(0,"div",7)(1,"div",8),I(2,"mat-progress-spinner",9),a(3,"div",10)(4,"h3"),l(5,"Upgrading Configuration\u2026"),s(),a(6,"p"),l(7,"Please wait a moment while we migrate your dashboards and widgets."),s(),v(8,Ci,4,0,"ul",11),s()()()),i&2){let t=u();p(8),b(t.upgrade.messages().length?8:-1)}}var je=(()=>{class i{_deltaService=n(B);_connectionStateMachine=n(L);_appNetworkInit=n(W);_historySeriesReconcile=n(xe);authenticationService=n(D);_dataSet=n(H);_dashboard=n(A);_remoteControl=n(He);toast=n(ne);_notifications=n(E);_uiEvent=n(dt);_dialog=n(be);settings=n(x);_responsive=n(Vt);_destroyRef=n(Y);_notificationOverlay=n(Be);_router=n(k);upgrade=n(ve);upgradeMessagesRef=tt("upgradeMessages");_upgradeShown=!1;actionsSidenavOpened=_t(!1);notificationsSidenavOpened=_t(!1);notificationsInfo=h(this._notifications.observerNotificationsInfo());bootstrapStatus=h(this._appNetworkInit.bootstrapStatus$,{initialValue:"starting"});bootstrapIssue=h(this._appNetworkInit.bootstrapIssue$,{initialValue:{reason:"none"}});dashboardVisible=kt(!1);isPhonePortrait;scheduledOpen=null;OPEN_DELAY_MS=300;missingConfigPromptShown=!1;_swipeLeftHandler=()=>this.onSwipeLeft();_swipeRightHandler=()=>this.onSwipeRight();_hotkeyHandler=t=>this.handleKeyDown(t);constructor(){w(()=>{if(this.settings.configUpgrade()){let t=this.settings.getConfigVersion();t===11&&this.upgrade.runUpgrade(t),t||this._upgradeShown||(this._upgradeShown=!0,this._dialog.openFrameDialog({title:"Upgrade Instructions",component:"upgrade-config"},!0).pipe(R(this._destroyRef)).subscribe())}}),w(()=>{let t=this.upgrade.messages();if(this.upgrade.upgrading()&&t.length&&this.upgradeMessagesRef()){let e=this.upgradeMessagesRef().nativeElement;e.scrollTop=e.scrollHeight}});try{this.dashboardVisible.set(this.isUrlDashboard(this._router.url))}catch(t){}this._router.events.pipe(U(t=>t instanceof rt),R(this._destroyRef)).subscribe(t=>{try{this.dashboardVisible.set(this.isUrlDashboard(t.urlAfterRedirects||t.url))}catch(e){}}),w(()=>{let t=this.dashboardVisible()&&this._dashboard.isDashboardStatic()&&this.notificationsInfo().alarmCount>0;if(this.notificationsSidenavOpened()){this.scheduledOpen&&(clearTimeout(this.scheduledOpen),this.scheduledOpen=null);try{this._notificationOverlay.close()}catch(o){}return}if(t){if(this.scheduledOpen)return;this.scheduledOpen=window.setTimeout(()=>{this.scheduledOpen=null;try{this._notificationOverlay.open()}catch(o){}},this.OPEN_DELAY_MS)}else{this.scheduledOpen&&(clearTimeout(this.scheduledOpen),this.scheduledOpen=null);try{this._notificationOverlay.close()}catch(o){}}}),w(()=>{if(this.notificationsSidenavOpened())try{this._notificationOverlay.close()}catch(e){}}),this.isPhonePortrait=h(this._responsive.observe(jt.HandsetPortrait)),this._connectionStateMachine.status$.pipe(R(this._destroyRef)).subscribe(t=>this.displayConnectionsStatusNotification(t)),w(()=>{let t=this.bootstrapIssue();if(t.reason!=="missing-shared-config"||this.missingConfigPromptShown)return;this.missingConfigPromptShown=!0;let e=t.sharedConfigName||"default",o=t.legacyUpgradeAvailable===!0,r=o?"Upgrade":"Create",d=o?`Server is reachable, but no current version shared configuration '${e}' exists for this user. A legacy configuration was found and can be upgraded. Upgrade now?`:`Server is reachable, but no shared configuration '${e}' exists for this user. Create a default configuration now?`;this.toast.show(d,0,!0,"warn",r).onAction().pipe(R(this._destroyRef)).subscribe(()=>{o?this.upgrade.runUpgrade():this.settings.resetSettings()})})}isUrlDashboard(t){if(!t)return!1;let e=t.split("?")[0].replace(/\/+$/,"");return e==="/"||e==="/dashboard"||/^\/dashboard(\/\d+)?$/.test(e)||e==="/chartplotter"||/^\/chartplotter(\/\d+)?$/.test(e)}ngOnInit(){this._uiEvent.addGestureListeners(this._swipeLeftHandler,this._swipeRightHandler)}ngAfterViewInit(){this._uiEvent.addHotkeyListener(this._hotkeyHandler,{ctrlKey:!0,keys:["arrowright","arrowleft"]})}handleKeyDown(t){switch(t){case"arrowright":this.onSwipeRight();break;case"arrowleft":this.onSwipeLeft();break;case"escape":this.backdropClicked();break}}escapeKeyPressed(t){t=t.toLowerCase(),t==="escape"&&this.backdropClicked()}displayConnectionsStatusNotification(t){let e=t.message,o=this.bootstrapStatus()!=="ready";switch(t.operation){case 0:this.toast.show(e,5e3,!0);break;case 1:case 2:break;case 3:this.toast.show(e,3e3,o,"warn");break;case 4:this.toast.show(e,3e3,!0,"info");break;case 5:this.toast.show(e,0,o);break;default:console.error("[AppComponent] Unknown operation code:",t.operation),this.toast.show(`Unknown connection status: ${t.state}`,0,o,"error")}}onSwipeRight(){this._dashboard.isDashboardStatic()&&!this._uiEvent.isDragging()&&(this.isPhonePortrait().matches?(this.actionsSidenavOpened.set(!1),this.notificationsSidenavOpened.set(!0)):(this.actionsSidenavOpened.set(!1),this.notificationsSidenavOpened.update(t=>!t)))}backdropClicked(){this.notificationsSidenavOpened.update(t=>t?!t:!1),this.actionsSidenavOpened.update(t=>t?!t:!1)}onSwipeLeft(){this._dashboard.isDashboardStatic()&&!this._uiEvent.isDragging()&&(this.isPhonePortrait().matches?(this.notificationsSidenavOpened.set(!1),this.actionsSidenavOpened.set(!0)):(this.notificationsSidenavOpened.set(!1),this.actionsSidenavOpened.update(t=>!t)))}ngOnDestroy(){this._uiEvent.removeGestureListeners(this._swipeLeftHandler,this._swipeRightHandler),this._uiEvent.removeHotkeyListener(this._hotkeyHandler),this.scheduledOpen&&(clearTimeout(this.scheduledOpen),this.scheduledOpen=null)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=P({type:i,selectors:[["app-root"]],viewQuery:function(e,o){e&1&&X(o.upgradeMessagesRef,vi,5),e&2&&Z()},inputs:{actionsSidenavOpened:[1,"actionsSidenavOpened"],notificationsSidenavOpened:[1,"notificationsSidenavOpened"]},outputs:{actionsSidenavOpened:"actionsSidenavOpenedChange",notificationsSidenavOpened:"notificationsSidenavOpenedChange"},decls:9,vars:6,consts:[["actionsSidenav",""],["upgradeMessages",""],["kipGestures","",1,"sidenav-container",3,"swipeleft","swiperight","backdropClick","mode","bridgeUiEvents"],["mode","over","position","start","autoFocus","true","disableClose","",1,"sidenav-notifications",3,"openedChange","keydown","opened"],["mode","over","position","end","autoFocus","true","disableClose","",1,"sidenav-actions",3,"openedChange","keydown","opened"],[3,"actionsSidenav"],[1,"router-outlet-container"],["role","alert","aria-live","polite",1,"config-upgrade-overlay"],[1,"config-upgrade-card"],["diameter","46","mode","indeterminate"],[1,"config-upgrade-text"],[1,"config-upgrade-messages"]],template:function(e,o){if(e&1){let r=S();a(0,"mat-sidenav-container",2),f("swipeleft",function(){return o.onSwipeLeft()})("swiperight",function(){return o.onSwipeRight()})("backdropClick",function(){return o.backdropClicked()}),a(1,"mat-sidenav",3),gt("openedChange",function(m){return g(r),ht(o.notificationsSidenavOpened,m)||(o.notificationsSidenavOpened=m),_(m)}),f("keydown",function(m){return o.escapeKeyPressed(m.key)}),I(2,"menu-notifications"),s(),a(3,"mat-sidenav",4,0),gt("openedChange",function(m){return g(r),ht(o.actionsSidenavOpened,m)||(o.actionsSidenavOpened=m),_(m)}),f("keydown",function(m){return o.escapeKeyPressed(m.key)}),I(5,"menu-actions",5),s(),a(6,"mat-sidenav-content"),I(7,"router-outlet",6),s()(),v(8,Si,9,1,"div",7)}if(e&2){let r=Pt(4);M("mode","horizontal")("bridgeUiEvents",!0),p(),ut("opened",o.notificationsSidenavOpened),p(2),ut("opened",o.actionsSidenavOpened),p(2),M("actionsSidenav",r),p(3),b(o.upgrade.upgrading()?8:-1)}},dependencies:[Le,ze,N,ge,T,oe,te,De,Pe,Ne,Oe,Ft,Jt,Te,Ae],styles:[".sidenav-container[_ngcontent-%COMP%]{height:100%;width:100%;--mat-sidenav-scrim-color: color-mix(in srgb, var(--mat-sys-neutral-variant20) 70%, transparent)}mat-sidenav-content[_ngcontent-%COMP%]{overflow-y:hidden;overflow-x:hidden}mat-sidenav[_ngcontent-%COMP%]{box-shadow:0 0 1px 0 var(--kip-contrast-color)}mat-sidenav.sidenav-notifications[_ngcontent-%COMP%]{width:230px;z-index:1200}mat-sidenav.sidenav-actions[_ngcontent-%COMP%]{width:135px;z-index:1200;overflow-x:hidden}.config-upgrade-overlay[_ngcontent-%COMP%]{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:#00000073;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);z-index:2000;pointer-events:all}.config-upgrade-card[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;gap:18px;padding:20px 24px;width:clamp(300px,60vw,640px);background:var(--kip-background, #1f1f1f);border:1px solid rgba(255,255,255,.18);border-radius:14px;color:var(--kip-contrast-color, #fff);box-shadow:0 6px 22px #0000008c}.config-upgrade-text[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 4px;font-size:1.05rem;font-weight:600;letter-spacing:.5px}.config-upgrade-text[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 10px;font-size:.8rem;opacity:.85}.config-upgrade-messages[_ngcontent-%COMP%]{list-style:disc;margin:0;padding-left:18px;max-height:180px;font-size:.68rem;line-height:1.25;scrollbar-width:thin;overflow-y:auto}.config-upgrade-messages[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{margin-bottom:2px}"]})}return i})();var We=(()=>{class i{auth=n(D);authToken=null;authTokenSubscription=null;constructor(){this.authTokenSubscription=this.auth.authToken$.subscribe(t=>{this.authToken=t})}intercept(t,e){let o=t.clone();return this.authToken&&(o=t.clone({headers:t.headers.set("authorization","JWT "+this.authToken.token)})),e.handle(o)}ngOnDestroy(){this.authTokenSubscription?.unsubscribe()}static \u0275fac=function(e){return new(e||i)};static \u0275prov=C({token:i,factory:i.\u0275fac})}return i})();var Ge=(()=>{class i extends it{_createContainer(){let t=document.createElement("div");t.classList.add("cdk-overlay-container"),(document.getElementById("app-filter-wrapper")||document.querySelector("app-root")||document.body).appendChild(t),this._containerElement=t}static \u0275fac=(()=>{let t;return function(o){return(t||(t=It(i)))(o||i)}})();static \u0275prov=C({token:i,factory:i.\u0275fac})}return i})();var Qe=(()=>{class i{_router=n(k);_dialog=n(re);_bottomSheet=n(Ce);_destroyRef=n(Y);constructor(){this._router.events.pipe(U(t=>t instanceof Zt),R(this._destroyRef)).subscribe(()=>{this._dialog.openDialogs.length>0&&this._dialog.closeAll(),this._bottomSheet.dismiss()})}static \u0275fac=function(e){return new(e||i)};static \u0275prov=C({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();Ue.production&&void 0;Bt(je,{providers:[Ut(),xt(zt),{provide:Ht,useClass:We,multi:!0},{provide:ae,useValue:{hasBackdrop:!0,disableClose:!1,autoFocus:"first-tabbable",delayFocusTrap:!0,backdropClass:"dialogBackdrop"}},{provide:se,useValue:{appearance:"outline",floatLabel:"always",subscriptSizing:"dynamic"}},{provide:me,useValue:{showDelay:1500,hideDelay:0}},D,z,nt,B,L,H,A,de,W,x,E,he,at,Ee(),$t(qt()),ee(Re,ie()),{provide:it,useClass:Ge},ft(()=>n(W).initNetworkServices()),ft(()=>{n(Qe)})]});
1
+ import{a as xe,b as vt}from"./chunk-BMHMHQFO.js";import{a as Ft,b as A,c as H,i as he,k as E,l as _e,m as lt,o as ve,p as be,s as Ce,u as dt}from"./chunk-P3M6SJQT.js";import{a as Ie}from"./chunk-ZY3U4H4Z.js";import{c as le}from"./chunk-5SAXWR6Z.js";import{a as Oe,b as Pe,c as Ne,d as De,e as Ae,f as Te}from"./chunk-BGGO4PGD.js";import{a as ke}from"./chunk-B4NYOD6L.js";import{c as pe,d as Se,g as ye,h as we,j as Me}from"./chunk-MGLD6QDJ.js";import{b as Ee}from"./chunk-POMIQBAL.js";import{e as ge}from"./chunk-CSIELI2Z.js";import{c as de,d as me,e as fe,f as ue}from"./chunk-3JA4CQ7T.js";import{o as st,p as ct,q as B,r as z}from"./chunk-PPF5S5CV.js";import{a as Zt,b as rt,d as te,e as k,g as ee,h as ie,i as oe}from"./chunk-WJFXI5PQ.js";import{a as ce}from"./chunk-HSKVTFFQ.js";import{f as ae,g as re,t as se}from"./chunk-6A4NRSCL.js";import{c as Lt,e as Xt,g as ot,h as L,i as nt,k as D,l as at,m as x,n as ne}from"./chunk-AC6VD2FN.js";import{A as yt,Aa as Y,Ab as F,Ac as Et,Ad as Ht,Bb as K,Cb as M,Cd as $t,Db as a,Dd as qt,Eb as s,Ec as Rt,Ee as it,Fa as kt,Fb as I,Fc as tt,Ga as w,Hc as _t,Ia as It,Ic as Ut,K as U,Ke as Yt,Mb as S,Ne as Jt,Ob as f,Oe as R,Pe as h,Qb as u,Re as V,Se as T,U as wt,Va as p,Vd as jt,Yb as X,Zb as Z,_b as Pt,a as Ct,ac as Nt,ba as Mt,c as St,cd as Kt,ce as Wt,dc as l,ec as q,f as $,fb as P,fc as Dt,ge as et,he as Gt,jc as ut,je as N,ka as C,kc as ht,ke as Qt,lc as gt,m as mt,pa as n,qb as ft,ra as xt,ua as g,ub as Ot,uc as At,va as _,vd as Vt,wb as v,wc as Tt,wd as Bt,xb as b,xd as zt,ya as Q,yb as J,z as G,zc as j}from"./chunk-PZ6I6W3H.js";var pt=(i,c)=>{let t=n(x),e=n(k),o=t.getSplitShellEnabled(),r="/"+c.map(y=>y.path).join("/"),d=r.startsWith("/chartplotter"),m=r.startsWith("/dashboard");if(o&&m&&!d){let y=c.length>1?c[1].path:void 0;return e.createUrlTree(["chartplotter",y??""])}if(!o&&d){let y=c.length>1?c[1].path:void 0;return e.createUrlTree(["dashboard",y??""])}return!0};var Re=[{path:"dashboard/:id",component:vt,canMatch:[pt]},{path:"chartplotter/:id",loadComponent:()=>import("./chunk-UYHRT3PR.js").then(i=>i.SplitShellComponent),canMatch:[pt]},{path:"settings",loadComponent:()=>import("./chunk-ZXO4VMEH.js").then(i=>i.SettingsComponent),title:"KIP - Settings"},{path:"options",loadComponent:()=>import("./chunk-MDNGWQNG.js").then(i=>i.TabsComponent),title:"KIP - Options"},{path:"remote",loadComponent:()=>import("./chunk-CYTLQDGF.js").then(i=>i.RemoteControlComponent),title:"KIP - Remote Control"},{path:"help/:page",loadComponent:()=>import("./chunk-SUWMN3AE.js").then(i=>i.AppHelpComponent),title:"KIP - Help"},{path:"help",loadComponent:()=>import("./chunk-SUWMN3AE.js").then(i=>i.AppHelpComponent),title:"KIP - Help"},{path:"data",loadComponent:()=>import("./chunk-356CW47X.js").then(i=>i.DataInspectorComponent),title:"KIP - Data Inspector"},{path:"login",loadComponent:()=>import("./chunk-NJISHUGY.js").then(i=>i.WidgetLoginComponent),title:"Login"},{path:"**",component:vt,canMatch:[pt]}];var Ue={production:!0};var Ye=(i,c)=>c.path;function Je(i,c){i&1&&(a(0,"mat-icon"),l(1,"info"),s())}function Xe(i,c){i&1&&(a(0,"mat-icon"),l(1,"info"),s())}function Ze(i,c){i&1&&(a(0,"mat-icon",3),l(1,"report"),s())}function ti(i,c){i&1&&(a(0,"mat-icon",4),l(1,"warning"),s())}function ei(i,c){i&1&&(a(0,"mat-icon",5),l(1,"error"),s())}function ii(i,c){i&1&&(a(0,"mat-icon",6),l(1,"emergency_home"),s())}function oi(i,c){if(i&1){let t=S();a(0,"div",2),v(1,Je,2,0,"mat-icon")(2,Xe,2,0,"mat-icon")(3,Ze,2,0,"mat-icon",3)(4,ti,2,0,"mat-icon",4)(5,ei,2,0,"mat-icon",5)(6,ii,2,0,"mat-icon",6),a(7,"div",7),l(8),s(),a(9,"div",8),l(10),At(11,"slice"),s(),a(12,"div",9),l(13),s(),a(14,"button",10),f("click",function(){let o=g(t).$implicit,r=u();return _(r.silence(o.path))}),a(15,"mat-icon"),l(16,"music_off"),s()(),a(17,"button",11),f("click",function(){let o=g(t).$implicit,r=u();return _(r.clear(o.path))}),a(18,"mat-icon"),l(19,"published_with_changes"),s()()(),I(20,"mat-divider",12)}if(i&2){let t,e=c.$implicit;p(),b((t=e.value.state)==="nominal"?1:t==="normal"?2:t==="alert"?3:t==="warn"?4:t==="alarm"?5:t==="emergency"?6:-1),p(7),q(e.value.state),p(2),Dt(" ",Tt(11,5,e.path,14)," "),p(3),q(e.value.message),p(),M("disabled",!(e.value.method!=null&&e.value.method.includes("sound")))}}function ni(i,c){i&1&&(a(0,"mat-list-item",13)(1,"span",15),l(2,"Notifications Disabled"),s(),a(3,"span")(4,"i"),l(5,"*Enable notifications in Settings."),s()()())}function ai(i,c){i&1&&(a(0,"mat-list-item",14)(1,"i"),l(2,'"No Notification"'),s()())}function ri(i,c){if(i&1&&v(0,ni,6,0,"mat-list-item",13)(1,ai,3,0,"mat-list-item",14),i&2){let t=u();b(t.notificationConfig().disableNotifications?0:1)}}function si(i,c){if(i&1){let t=S();a(0,"button",17),f("click",function(){g(t);let o=u(2);return _(o.mutePlayer(!o.isMuted))}),a(1,"span",18),l(2,"volume_up"),s(),l(3," Unmute Audio "),s()}}function ci(i,c){if(i&1){let t=S();a(0,"button",17),f("click",function(){g(t);let o=u(2);return _(o.mutePlayer(!o.isMuted))}),a(1,"span",18),l(2,"volume_off"),s(),l(3," Mute Audio "),s()}}function li(i,c){if(i&1&&v(0,si,4,0,"button",16)(1,ci,4,0,"button",16),i&2){let t=u();b(t.isMuted?0:1)}}var Le=(()=>{class i{_notificationsService=n(E);_notifications$=this._notificationsService.observeNotifications();notificationConfig=h(this._notificationsService.observeNotificationConfiguration(),{requireSync:!0});menuNotifications=h(yt([this._notifications$,this._notificationsService.observeNotificationConfiguration()]).pipe(G(([t,e])=>{let o=[];return e.devices.showNormalState||o.push(st.Normal),e.devices.showNominalState||o.push(st.Nominal),t.filter(r=>r.value&&r.value.state&&!o.includes(r.value.state)).filter(r=>{let d=r.value?.method;return d?.length?d.includes(ct.Visual)||d.includes(ct.Sound):!1})})),{requireSync:!0,equal:Xt});isMuted=!1;mutePlayer(t){this.isMuted=t,this._notificationsService.mutePlayer(t)}silence(t){this._notificationsService.setSkMethod(t,[ct.Visual])}clear(t){this._notificationsService.setSkState(t,st.Normal)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=P({type:i,selectors:[["menu-notifications"]],decls:6,vars:2,consts:[[1,"menu-item-container"],[1,"actions-container","actions-bottom-container"],[1,"notification-container"],[1,"icon-alert-color"],[1,"icon-warn-color"],[1,"icon-alarm-color"],[1,"icon-emergency-color"],[1,"notification-title"],[1,"notification-path","scrollable-text"],[1,"notification-text"],["mat-icon-button","",1,"notification-action-btn",3,"click","disabled"],["mat-icon-button","",1,"notification-action-btn",3,"click"],[1,"notification-divider"],["lines","3","disabled","true",2,"text-align","center"],["disabled","true",2,"text-align","center"],["matListItemTitle",""],["mat-flat-button","","matTooltip","Temporally toggle all notification audio. To permanently disable/enable notification audio, use the configuration settings option",1,"action-button"],["mat-flat-button","","matTooltip","Temporally toggle all notification audio. To permanently disable/enable notification audio, use the configuration settings option",1,"action-button",3,"click"],[1,"material-icons"]],template:function(e,o){e&1&&(a(0,"mat-list",0),F(1,oi,21,8,null,null,Ye,!1,ri,2,1),s(),a(4,"div",1),v(5,li,2,1),s()),e&2&&(p(),K(o.menuNotifications()),p(4),b(o.notificationConfig().disableNotifications?-1:5))},dependencies:[Me,ye,we,ce,Se,N,et,Wt,lt,ue,fe,T,V,Kt],styles:[".notification-container[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-evenly;padding:2px 10px 7px;scroll-behavior:smooth}mat-icon[_ngcontent-%COMP%]{margin-right:10px}.scrollable-text[_ngcontent-%COMP%]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.scrollable-text[_ngcontent-%COMP%]:hover{overflow:auto;white-space:normal;word-wrap:break-word}.notification-title[_ngcontent-%COMP%]{text-transform:capitalize;font-size:var(--mat-sys-headline-small-size);width:calc(100% - 34px)}.notification-path[_ngcontent-%COMP%]{font-size:var(--mat-sys-body-small-size);word-break:break-all;width:100%}.notification-text[_ngcontent-%COMP%]{font-size:var(--mat-sys-body-small-line-height);font-style:italic;width:100%;overflow:auto;white-space:normal;word-wrap:break-word}.notification-action-btn[_ngcontent-%COMP%]{background-color:var(--mat-sys-surface-container)}.notification-btn-container[_ngcontent-%COMP%]{display:inline-block;width:50%;height:48px;text-align:center}.menu-item-container[_ngcontent-%COMP%]{width:230px;overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;height:calc(100% - 48px)}.notification-bottom-container[_ngcontent-%COMP%]{position:absolute;bottom:0;width:100%;background-color:var(--mat-sys-surface-container)}.actions-container[_ngcontent-%COMP%]{display:grid;grid-auto-flow:column}.actions-bottom-container[_ngcontent-%COMP%]{position:absolute;bottom:0;width:100%;height:48px}.action-button[_ngcontent-%COMP%]{border-radius:0;height:48px;border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large))}.icon-alert-color[_ngcontent-%COMP%]{color:var(--kip-zone-alert-color)}.icon-warn-color[_ngcontent-%COMP%]{color:var(--kip-zone-warn-color)}.icon-alarm-color[_ngcontent-%COMP%]{color:var(--kip-zone-alarm-color)}.icon-emergency-color[_ngcontent-%COMP%]{color:var(--kip-zone-emergency-color)}.alarm-emergency-blink[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_blinking-emergency 1.5s infinite}@keyframes _ngcontent-%COMP%_blinking-emergency{0%{background-color:var(--kip-zone-alarm-color)}50%{background-color:transparent}to{background-color:var(--kip-zone-alarm-color)}}.warn[_ngcontent-%COMP%]{color:var(--kip-zone-warn-color)}.notification-divider[_ngcontent-%COMP%]{padding-top:10px}"],changeDetection:0})}return i})();var di=["badgeButton"],Ve=(()=>{class i{badgeButton=tt.required("badgeButton");_notifications=n(E);notificationsInfo=h(this._notifications.observerNotificationsInfo());openNotificationMenu(){let t=new Event("openRightSidenav",{bubbles:!0,cancelable:!0});window.document.dispatchEvent(t)}onKeyDown(t){let e=t.key?.toLowerCase();(e==="enter"||e===" "||e==="spacebar")&&(t.preventDefault(),this.openNotificationMenu())}focus(){try{let t=this.badgeButton&&this.badgeButton(),e=t&&t.nativeElement;e&&typeof e.focus=="function"&&e.focus()}catch(t){}}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=P({type:i,selectors:[["notification-badge"]],viewQuery:function(e,o){e&1&&X(o.badgeButton,di,5),e&2&&Z()},decls:5,vars:7,consts:[["badgeButton",""],["mat-fab","","role","button","aria-label","Open notifications",1,"layout-action-btn",3,"click","keydown"],["aria-hidden","false","matBadgeSize","large","matBadgePosition","after","matBadgeOverlap","true",1,"icon-alert-color",3,"matBadgeHidden","matBadge"]],template:function(e,o){e&1&&(a(0,"div")(1,"button",1,0),f("click",function(){return o.openNotificationMenu()})("keydown",function(d){return o.onKeyDown(d)}),a(3,"mat-icon",2),l(4,"notifications "),s()()()),e&2&&(p(),Nt("warn",o.notificationsInfo().isWarn)("alarm-emergency-blink",o.notificationsInfo().isAlarmEmergency),Ot("aria-haspopup",!0),p(2),M("matBadgeHidden",!o.notificationsInfo().alarmCount)("matBadge",o.notificationsInfo().alarmCount))},dependencies:[N,Gt,T,V,lt,_e],styles:["[_nghost-%COMP%]{display:block}.layout-action-btn[_ngcontent-%COMP%]{color:var(--mat-sys-on-primary);background-color:var(--mat-sys-primary)}.icon-alert-color[_ngcontent-%COMP%]{--mat-list-list-item-leading-icon-color: var(--kip-zone-alert-color)}.icon-warn-color[_ngcontent-%COMP%]{--mat-list-list-item-leading-icon-color: var(--kip-zone-warn-color)}.icon-alarm-color[_ngcontent-%COMP%]{--mat-list-list-item-leading-icon-color: var(--kip-zone-alarm-color)}.icon-emergency-color[_ngcontent-%COMP%]{--mat-list-list-item-leading-icon-color: var(--kip-zone-emergency-color)}.alarm-emergency-blink[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_blinking-emergency 1.5s infinite}@keyframes _ngcontent-%COMP%_blinking-emergency{0%{background-color:var(--kip-zone-alarm-color)}50%{background-color:var(--mat-sys-primary)}to{background-color:var(--kip-zone-alarm-color)}}.warn[_ngcontent-%COMP%]{color:var(--kip-zone-warn-color)}"]})}return i})();var Be=(()=>{class i{overlayRef=null;overlay=n(Yt);injector=n(Q);open(){if(this.overlayRef)return;this.overlayRef=this.overlay.create({hasBackdrop:!1,panelClass:"notification-overlay-panel",positionStrategy:this.overlay.position().global().bottom("20px").left("20px"),scrollStrategy:this.overlay.scrollStrategies.reposition()});let t=new Qt(Ve,null,this.injector),e=this.overlayRef.attach(t);try{let o=e&&e.instance;if(o&&typeof o.focus=="function")o.focus();else{let r=this.overlayRef.overlayElement,d=r&&r.querySelector("button[mat-fab], .layout-action-btn");d&&typeof d.focus=="function"&&d.focus()}}catch(o){}}close(){try{this.overlayRef&&this.overlayRef.dispose()}catch(t){console.warn("[NotificationOverlayService] dispose failed",t)}finally{this.overlayRef=null}}toggle(t){t?this.open():this.close()}isOpen(){return!!this.overlayRef}ngOnDestroy(){try{this.overlayRef&&this.overlayRef.dispose()}catch(t){}finally{this.overlayRef=null}}static \u0275fac=function(e){return new(e||i)};static \u0275prov=C({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();function pi(i,c){if(i&1){let t=S();a(0,"button",12),f("click",function(){g(t);let o=u(2);return _(o.onActionItem("toggleFullScreen"))}),a(1,"span",10),l(2,"fullscreen"),s()()}}function mi(i,c){if(i&1){let t=S();a(0,"button",12),f("click",function(){g(t);let o=u(2);return _(o.onActionItem("toggleFullScreen"))}),a(1,"span",10),l(2,"close_fullscreen"),s()()}}function fi(i,c){if(i&1&&v(0,pi,3,0,"button",11)(1,mi,3,0,"button",11),i&2){let t=u();b(t.uiEvent.fullscreenStatus()?1:0)}}function ui(i,c){if(i&1){let t=S();a(0,"button",14),f("click",function(){g(t);let o=u(2);return _(o.onActionItem("nightMode"))}),a(1,"span",10),l(2,"mode_night"),s()()}}function hi(i,c){if(i&1){let t=S();a(0,"button",14),f("click",function(){g(t);let o=u(2);return _(o.onActionItem("nightMode"))}),a(1,"span",10),l(2,"light_mode"),s()()}}function gi(i,c){if(i&1&&v(0,ui,3,0,"button",13)(1,hi,3,0,"button",13),i&2){let t=u();b(t.app.isNightMode()?1:0)}}function _i(i,c){if(i&1){let t=S();a(0,"tile-large-icon",15,1),f("click",function(){let o=g(t).$index,r=u();return _(r.navigateToDashboard(o))}),s()}if(i&2){let t=c.$implicit;M("active",t.active)("svgIcon",t.svgIcon)("iconSize",t.iconSize)("label",t.label)}}var ze=(()=>{class i{actionsSidenav=Rt.required();_router=n(k);uiEvent=n(dt);dashboard=n(A);app=n(le);_settings=n(x);isAutoNightMode=h(this._settings.getAutoNightModeAsO(),{requireSync:!0});_initialDashboardMatch=(()=>{let e=this._router.parseUrl(this._router.url).root.children.primary,o=e?e.segments.map(r=>r.path):[];return o.length===0||o[0]==="dashboard"||o[0]==="chartplotter"})();isDashboardContext=h(this._router.events.pipe(U(t=>t instanceof rt),Mt(null),G(()=>{let e=this._router.parseUrl(this._router.url).root.children.primary,o=e?e.segments.map(r=>r.path):[];return o.length===0||o[0]==="dashboard"||o[0]==="chartplotter"}),wt()),{initialValue:this._initialDashboardMatch});menuItems=Et(()=>{let t=this.dashboard.dashboards(),e=this.dashboard.activeDashboard();return t.map((o,r)=>({id:Number(o.id),active:r===e,pinned:!1,svgIcon:o.icon||"dashboard-dashboard",iconSize:60,label:o.name||`Dashboard ${r+1}`}))});ngAfterViewInit(){this.uiEvent.addHotkeyListener((t,e)=>this.handleKeyDown(t,e),{ctrlKey:!0,shiftKey:!0,keys:["e","f","n"]})}ngOnDestroy(){this.uiEvent.removeHotkeyListener(this.handleKeyDown.bind(this))}handleKeyDown(t,e){switch(t){case"e":this.onActionItem("layout");break;case"f":this.onActionItem("toggleFullScreen");break;case"n":this.onActionItem("nightMode");break;default:break}}onActionItem(t){switch(this.actionsSidenav().close(),t){case"toggleFullScreen":this.uiEvent.toggleFullScreen();break;case"settings":this._router.navigate(["/settings"]);break;case"layout":this.dashboard.setStaticDashboard(!1);break;case"nightMode":this.app.isNightMode.set(!this.app.isNightMode()),this.app.toggleDayNightMode();break;default:break}}navigateToDashboard(t){this.actionsSidenav().close(),this._router.navigate([`dashboard/${t}`])}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=P({type:i,selectors:[["menu-actions"]],inputs:{actionsSidenav:[1,"actionsSidenav"]},decls:14,vars:3,consts:[["tileContainer",""],["tile",""],[1,"actions-container"],[1,"actions-top-container"],["mat-flat-button","","tabindex","0",1,"action-button","home-btn",3,"click"],["height","24px","width","24px","svgIcon","kip","aria-hidden","false",1,"home-icon",2,"height","24px","width","24px"],[1,"menu-item-container"],[3,"active","svgIcon","iconSize","label"],[1,"actions-bottom-container"],["mat-flat-button","",1,"action-button",2,"width","135px",3,"click","disabled"],[1,"material-icons"],["mat-flat-button","","tabindex","0",1,"action-button"],["mat-flat-button","","tabindex","0",1,"action-button",3,"click"],["mat-flat-button","",1,"action-button"],["mat-flat-button","",1,"action-button",3,"click"],[3,"click","active","svgIcon","iconSize","label"]],template:function(e,o){e&1&&(a(0,"div",2)(1,"div",3),v(2,fi,2,1),v(3,gi,2,1),a(4,"button",4),f("click",function(){return o.onActionItem("settings")}),I(5,"mat-icon",5),s()(),a(6,"div",6,0),F(8,_i,2,4,"tile-large-icon",7,J),s(),a(10,"div",8)(11,"button",9),f("click",function(){return o.onActionItem("layout")}),a(12,"span",10),l(13,"lock_open"),s()()()()),e&2&&(p(2),b(o.uiEvent.fullscreenSupported()?2:-1),p(),b(o.isAutoNightMode()?-1:3),p(5),K(o.menuItems()),p(3),M("disabled",!o.isDashboardContext()))},dependencies:[T,V,N,et,ke],styles:[".actions-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;width:135px}.actions-top-container[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:wrap;width:100%}.actions-bottom-container[_ngcontent-%COMP%]{height:48px;width:100%}.action-button[_ngcontent-%COMP%]{border-radius:0;height:48px;flex:1 1 48px;min-height:0;overflow:hidden;border:1px solid var(--mat-sidenav-container-background-color, var(--mat-sys-surface))}.home-btn[_ngcontent-%COMP%]{--mat-icon-button-icon-size: 24px;--mat-button-filled-icon-offset: 0px;--mat-button-filled-icon-spacing: 0px;--mat-button-filled-label-text-size: 0px}.home-icon[_ngcontent-%COMP%] .mat-mdc-unelevated-button[_ngcontent-%COMP%] > .mat-icon[_ngcontent-%COMP%]{font-size:0px}.full-size[_ngcontent-%COMP%]{width:135px}.menu-item-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex-wrap:nowrap;padding:3px 1px;gap:5px;width:135px;overflow-y:auto;scrollbar-width:none;overflow-x:hidden;scroll-behavior:smooth;flex:1 1 auto;min-height:0}"]})}return i})();var He=(()=>{class i{COMMAND_SET_DISPLAY_PATH="self.kip.remote.setDisplay";COMMAND_SET_SCREEN_INDEX_PATH="self.kip.remote.setScreenIndex";COMMAND_REQUEST_ACTIVE_SCREEN_PATH="self.kip.remote.requestActiveScreen";settings=n(x);dashboard=n(A);data=n(z);requests=n(pe);KIP_UUID=this.settings.KipUUID;ACTIVE_SCREEN_PATH=`self.displays.${this.KIP_UUID}.screenIndex`;CHANGE_SCREEN_PATH=`self.displays.${this.KIP_UUID}.activeScreen`;displayName=h(this.settings.getInstanceNameAsO());isRemoteControl=h(this.settings.getIsRemoteControlAsO());remoteScreenPosition=h(this.data.subscribePath(this.ACTIVE_SCREEN_PATH,"default"));changeDashboardTo=h(this.data.subscribePath(this.CHANGE_SCREEN_PATH,"default"));previousIsRemoteControl=!1;constructor(){this.setActiveDashboardOnRemote(this.KIP_UUID,null),this.setScreensOnRemote(this.KIP_UUID,null),this.clearActiveScreenOnRemote(this.KIP_UUID,null),console.log("[Remote Dashboards] Cleaning paths on server"),w(()=>{let t=this.isRemoteControl(),e=this.displayName();j(()=>{if(!t&&!this.previousIsRemoteControl)return;this.previousIsRemoteControl=t;let o;t?(o=this.getScreensPayload(this.dashboard.dashboards()),this.dashboard.activeDashboard()!==null&&this.setActiveDashboardOnRemote(this.KIP_UUID,this.dashboard.activeDashboard())):(o=null,this.clearActiveDashboardOnServer()),this.shareScreens(o)})}),w(()=>{let t=this.dashboard.dashboards();j(()=>{if(!this.isRemoteControl())return;let e=this.getScreensPayload(t);this.shareScreens(e)})}),w(()=>{let t=this.dashboard.activeDashboard();j(()=>{this.isRemoteControl()&&t!==null&&(this.setActiveDashboardOnRemote(this.KIP_UUID,t),console.log(`[Remote Dashboards] Sent new dashboard highlight index ${t} to server.`))})}),w(()=>{let t=this.changeDashboardTo();j(()=>{if(!this.isRemoteControl()||t.data.value==null)return;let e=Number(t.data.value);!isNaN(e)&&e>=0&&e<this.dashboard.dashboards().length&&this.dashboard.activeDashboard()!==e&&(this.dashboard.navigateTo(e),console.log(`[Remote Dashboards] Executed remote request to change active dashboard to: ${e}`))})})}clearActiveDashboardOnServer(){this.setActiveDashboardOnRemote(this.KIP_UUID,null),console.log("[Remote Dashboards] Disabled: Cleared active dashboard on server")}getScreensPayload(t){let e=this.displayName(),o=t.map(m=>{var y=m,{configuration:r}=y,d=St(y,["configuration"]);return d});return{displayName:e,screens:o}}shareScreens(t){this.setScreensOnRemote(this.KIP_UUID,t),console.log("[Remote Dashboards] Sending dashboard configurations to server.")}setActiveDashboardOnRemote(t,e){let o={displayId:t,screenIdx:e};this.requests.putRequest(this.COMMAND_SET_SCREEN_INDEX_PATH,o,this.KIP_UUID)||console.error("[Remote Dashboards] Error sharing active dashboard: request was not accepted")}setScreensOnRemote(t,e){let o={displayId:t,display:e===null?null:Ct({},e)};this.requests.putRequest(this.COMMAND_SET_DISPLAY_PATH,o,this.KIP_UUID)||console.error("[Remote Dashboards] Error sharing screen configuration: request was not accepted")}clearActiveScreenOnRemote(t,e){let o={displayId:t,screenIdx:e};this.requests.putRequest(this.COMMAND_REQUEST_ACTIVE_SCREEN_PATH,o,this.KIP_UUID)||console.error("[Remote Dashboards] Error clearing active screen request path: request was not accepted")}static \u0275fac=function(e){return new(e||i)};static \u0275prov=C({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var $e=11,qe="connectionConfig",W=(()=>{class i{config;isLoggedIn=null;loggedInSubscription=null;connection=n(nt);auth=n(D);connectionStateMachine=n(L);router=n(k);delta=n(B);data=n(z);storage=n(at);internetReachability=n(Ie);injector=n(Q);datasetService=null;_bootstrapStatus$=new mt("starting");_bootstrapIssue$=new mt({reason:"none"});constructor(){this.loggedInSubscription=this.auth.isLoggedIn$.subscribe(t=>{this.isLoggedIn=t})}initNetworkServices(){return $(this,null,function*(){let t=!1;this.loadLocalStorageConfig(),this.preloadFonts(),this.internetReachability.start();try{if(this.config?.signalKUrl!==void 0&&this.config.signalKUrl!==null&&(yield this.connection.initializeConnection({url:this.config.signalKUrl,new:!1},this.config.proxyEnabled,this.config.signalKSubscribeAll)),!this.isLoggedIn&&this.config?.signalKUrl&&this.config?.useSharedConfig&&this.config?.loginName&&this.config?.loginPassword&&(yield this.login()),this.isLoggedIn&&this.config?.useSharedConfig)if(yield this.storage.waitUntilReady()){let o=yield this.storage.getConfig("user",this.config.sharedConfigName,$e),r={sharedConfigName:this.config.sharedConfigName,configFileVersion:$e,initConfig:o};this.storage.bootstrapRemoteContext(r)}else throw new Error("[AppInit Network Service] StorageService did not become ready in time. Cannot bootstrap remote configuration.");this._bootstrapIssue$.next({reason:"none"}),yield this.getDatasetService().waitUntilReady(),!this.isLoggedIn&&this.config?.signalKUrl&&this.config?.useSharedConfig&&this.router.navigate(["/login"])}catch(e){if(t=!0,e?.status===404&&this.config?.useSharedConfig){let o=yield this.probeLegacyUpgradeAvailability(this.config.sharedConfigName);this._bootstrapIssue$.next({reason:"missing-shared-config",statusCode:404,sharedConfigName:this.config.sharedConfigName,legacyUpgradeAvailable:o})}else e?.status===0?this._bootstrapIssue$.next({reason:"network-unreachable",statusCode:0}):e?.status===401?this._bootstrapIssue$.next({reason:"unauthorized",statusCode:401}):this._bootstrapIssue$.next({reason:"unknown",statusCode:e?.status});e.status===0?(yield this.waitForHttpRetryCompletion())===ot.HTTPConnected||this.connectionStateMachine.isHTTPConnected()?console.warn("[AppInit Network Service] Initial connection recovered during retry cycle. Skipping fallback route."):(console.warn("[AppInit Network Service] Initialization failed after HTTP retries. Redirecting to settings page."),yield this.router.navigate(["/options"])):e.status===401?(console.warn("[AppInit Network Service] Initialization failed. Unauthorized access. Redirecting to login page."),yield this.router.navigate(["/login"])):(console.warn("[AppInit Network Service] Initialization failed. Error: ",JSON.stringify(e)),yield this.router.navigate(["/options"])),console.warn("[AppInit Network Service] Startup continuing in degraded mode to allow UI feedback."),this._bootstrapStatus$.next("degraded");return}finally{t||this._bootstrapStatus$.next("ready"),console.log("[AppInit Network Service] Initialization completed"),this.connectionStateMachine.enableWebSocketMode(),this.connectionStateMachine.isHTTPConnected()&&(console.log("[AppInit Network Service] Starting WebSocket connection after initialization"),this.connectionStateMachine.startWebSocketConnection())}})}get bootstrapStatus$(){return this._bootstrapStatus$.asObservable()}get bootstrapIssue$(){return this._bootstrapIssue$.asObservable()}getDatasetService(){return this.datasetService||(this.datasetService=this.injector.get(H)),this.datasetService}waitForHttpRetryCompletion(t){return $(this,null,function*(){let e=t??this.connectionStateMachine.getHttpRetryWindowMs(2e3),o=new Set([ot.HTTPConnected,ot.PermanentFailure]),r=this.connectionStateMachine.currentState;return o.has(r)?r:new Promise(d=>{let m=window.setTimeout(()=>{y.unsubscribe(),d(null)},e),y=this.connectionStateMachine.state$.subscribe(bt=>{o.has(bt)&&(clearTimeout(m),y.unsubscribe(),d(bt))})})})}probeLegacyUpgradeAvailability(t){return $(this,null,function*(){if(!t)return!1;try{return(yield this.storage.getConfig("user",t,9))?.app?.configVersion===10}catch(e){return!1}})}login(){return $(this,null,function*(){if(!this.isLoggedIn&&this.config.useSharedConfig&&this.config.loginName&&this.config.loginPassword)try{yield this.auth.login({usr:this.config.loginName,pwd:this.config.loginPassword})}catch(t){throw t.status===0?this.router.navigate(["/settings"]):t.status===401&&this.router.navigate(["/login"]),t}})}setLocalStorageConfig(){localStorage.setItem(qe,JSON.stringify(this.config))}loadLocalStorageConfig(){this.config=JSON.parse(localStorage.getItem(qe)),this.config?this.config.signalKUrl||(this.config.signalKUrl=window.location.origin,this.setLocalStorageConfig(),console.log(`[AppInit Network Service] Config found with no server URL. Setting Auto-Discovery URL: ${this.config.signalKUrl}`)):(this.config=Lt,this.config.signalKUrl=window.location.origin,console.log(`[AppInit Network Service] Connection Configuration not found. Creating configuration using Auto-Discovery URL: ${this.config.signalKUrl}`),this.setLocalStorageConfig()),this.config.configVersion==9&&(this.config.configVersion=10,this.setLocalStorageConfig(),console.log("[AppInit Network Service] Upgrading Connection version from 9 to 10")),this.config.configVersion==10&&(this.config.configVersion=11,this.setLocalStorageConfig(),console.log("[AppInit Network Service] Upgrading Connection version from 10 to 11")),this.config.configVersion==11&&(this.config.configVersion=12,this.setLocalStorageConfig(),console.log("[AppInit Network Service] Upgrading Connection version from 11 to 12"))}preloadFonts(){let t=[{family:"Roboto",src:"url(./assets/google-fonts/KFOlCnqEu92Fr1MmSU5fChc4AMP6lbBP.woff2)",options:{weight:"300",style:"normal"}},{family:"Roboto",src:"url(./assets/google-fonts/KFOlCnqEu92Fr1MmSU5fBBc4AMP6lQ.woff2)",options:{weight:"300",style:"normal"}},{family:"Roboto",src:"url(./assets/google-fonts/KFOmCnqEu92Fr1Mu7GxKKTU1Kvnz.woff2)",options:{weight:"400",style:"normal"}},{family:"Roboto",src:"url(./assets/google-fonts/KFOmCnqEu92Fr1Mu4mxKKTU1Kg.woff2)",options:{weight:"400",style:"normal"}},{family:"Roboto",src:"url(./assets/google-fonts/KFOlCnqEu92Fr1MmEU9fChc4AMP6lbBP.woff2)",options:{weight:"500",style:"normal"}},{family:"Roboto",src:"url(./assets/google-fonts/KFOlCnqEu92Fr1MmEU9fBBc4AMP6lQ.woff2)",options:{weight:"500",style:"normal"}}];for(let{family:e,src:o,options:r}of t){let d=new FontFace(e,o,r);d.load().then(()=>document.fonts.add(d)).catch(m=>console.log(`[AppInit Network Service] Error loading fonts: ${m}`))}}ngOnDestroy(){this.loggedInSubscription?.unsubscribe()}static \u0275fac=function(e){return new(e||i)};static \u0275prov=C({token:i,factory:i.\u0275fac})}return i})();var vi=["upgradeMessages"];function bi(i,c){if(i&1&&(a(0,"li"),l(1),s()),i&2){let t=c.$implicit;p(),q(t)}}function Ci(i,c){if(i&1&&(a(0,"ul",11,1),F(2,bi,2,1,"li",null,J),s()),i&2){let t=u(2);p(2),K(t.upgrade.messages())}}function Si(i,c){if(i&1&&(a(0,"div",7)(1,"div",8),I(2,"mat-progress-spinner",9),a(3,"div",10)(4,"h3"),l(5,"Upgrading Configuration\u2026"),s(),a(6,"p"),l(7,"Please wait a moment while we migrate your dashboards and widgets."),s(),v(8,Ci,4,0,"ul",11),s()()()),i&2){let t=u();p(8),b(t.upgrade.messages().length?8:-1)}}var je=(()=>{class i{_deltaService=n(B);_connectionStateMachine=n(L);_appNetworkInit=n(W);_historySeriesReconcile=n(xe);authenticationService=n(D);_dataSet=n(H);_dashboard=n(A);_remoteControl=n(He);toast=n(ne);_notifications=n(E);_uiEvent=n(dt);_dialog=n(be);settings=n(x);_responsive=n(Vt);_destroyRef=n(Y);_notificationOverlay=n(Be);_router=n(k);upgrade=n(ve);upgradeMessagesRef=tt("upgradeMessages");_upgradeShown=!1;actionsSidenavOpened=_t(!1);notificationsSidenavOpened=_t(!1);notificationsInfo=h(this._notifications.observerNotificationsInfo());bootstrapStatus=h(this._appNetworkInit.bootstrapStatus$,{initialValue:"starting"});bootstrapIssue=h(this._appNetworkInit.bootstrapIssue$,{initialValue:{reason:"none"}});dashboardVisible=kt(!1);isPhonePortrait;scheduledOpen=null;OPEN_DELAY_MS=300;missingConfigPromptShown=!1;_swipeLeftHandler=()=>this.onSwipeLeft();_swipeRightHandler=()=>this.onSwipeRight();_hotkeyHandler=t=>this.handleKeyDown(t);constructor(){w(()=>{if(this.settings.configUpgrade()){let t=this.settings.getConfigVersion();t===11&&this.upgrade.runUpgrade(t),t||this._upgradeShown||(this._upgradeShown=!0,this._dialog.openFrameDialog({title:"Upgrade Instructions",component:"upgrade-config"},!0).pipe(R(this._destroyRef)).subscribe())}}),w(()=>{let t=this.upgrade.messages();if(this.upgrade.upgrading()&&t.length&&this.upgradeMessagesRef()){let e=this.upgradeMessagesRef().nativeElement;e.scrollTop=e.scrollHeight}});try{this.dashboardVisible.set(this.isUrlDashboard(this._router.url))}catch(t){}this._router.events.pipe(U(t=>t instanceof rt),R(this._destroyRef)).subscribe(t=>{try{this.dashboardVisible.set(this.isUrlDashboard(t.urlAfterRedirects||t.url))}catch(e){}}),w(()=>{let t=this.dashboardVisible()&&this._dashboard.isDashboardStatic()&&this.notificationsInfo().alarmCount>0;if(this.notificationsSidenavOpened()){this.scheduledOpen&&(clearTimeout(this.scheduledOpen),this.scheduledOpen=null);try{this._notificationOverlay.close()}catch(o){}return}if(t){if(this.scheduledOpen)return;this.scheduledOpen=window.setTimeout(()=>{this.scheduledOpen=null;try{this._notificationOverlay.open()}catch(o){}},this.OPEN_DELAY_MS)}else{this.scheduledOpen&&(clearTimeout(this.scheduledOpen),this.scheduledOpen=null);try{this._notificationOverlay.close()}catch(o){}}}),w(()=>{if(this.notificationsSidenavOpened())try{this._notificationOverlay.close()}catch(e){}}),this.isPhonePortrait=h(this._responsive.observe(jt.HandsetPortrait)),this._connectionStateMachine.status$.pipe(R(this._destroyRef)).subscribe(t=>this.displayConnectionsStatusNotification(t)),w(()=>{let t=this.bootstrapIssue();if(t.reason!=="missing-shared-config"||this.missingConfigPromptShown)return;this.missingConfigPromptShown=!0;let e=t.sharedConfigName||"default",o=t.legacyUpgradeAvailable===!0,r=o?"Upgrade":"Create",d=o?`Server is reachable, but no current version shared configuration '${e}' exists for this user. A legacy configuration was found and can be upgraded. Upgrade now?`:`Server is reachable, but no shared configuration '${e}' exists for this user. Create a default configuration now?`;this.toast.show(d,0,!0,"warn",r).onAction().pipe(R(this._destroyRef)).subscribe(()=>{o?this.upgrade.runUpgrade():this.settings.resetSettings()})})}isUrlDashboard(t){if(!t)return!1;let e=t.split("?")[0].replace(/\/+$/,"");return e==="/"||e==="/dashboard"||/^\/dashboard(\/\d+)?$/.test(e)||e==="/chartplotter"||/^\/chartplotter(\/\d+)?$/.test(e)}ngOnInit(){this._uiEvent.addGestureListeners(this._swipeLeftHandler,this._swipeRightHandler)}ngAfterViewInit(){this._uiEvent.addHotkeyListener(this._hotkeyHandler,{ctrlKey:!0,keys:["arrowright","arrowleft"]})}handleKeyDown(t){switch(t){case"arrowright":this.onSwipeRight();break;case"arrowleft":this.onSwipeLeft();break;case"escape":this.backdropClicked();break}}escapeKeyPressed(t){t=t.toLowerCase(),t==="escape"&&this.backdropClicked()}displayConnectionsStatusNotification(t){let e=t.message,o=this.bootstrapStatus()!=="ready";switch(t.operation){case 0:this.toast.show(e,5e3,!0);break;case 1:case 2:break;case 3:this.toast.show(e,3e3,o,"warn");break;case 4:this.toast.show(e,3e3,!0,"info");break;case 5:this.toast.show(e,0,o);break;default:console.error("[AppComponent] Unknown operation code:",t.operation),this.toast.show(`Unknown connection status: ${t.state}`,0,o,"error")}}onSwipeRight(){this._dashboard.isDashboardStatic()&&!this._uiEvent.isDragging()&&(this.isPhonePortrait().matches?(this.actionsSidenavOpened.set(!1),this.notificationsSidenavOpened.set(!0)):(this.actionsSidenavOpened.set(!1),this.notificationsSidenavOpened.update(t=>!t)))}backdropClicked(){this.notificationsSidenavOpened.update(t=>t?!t:!1),this.actionsSidenavOpened.update(t=>t?!t:!1)}onSwipeLeft(){this._dashboard.isDashboardStatic()&&!this._uiEvent.isDragging()&&(this.isPhonePortrait().matches?(this.notificationsSidenavOpened.set(!1),this.actionsSidenavOpened.set(!0)):(this.notificationsSidenavOpened.set(!1),this.actionsSidenavOpened.update(t=>!t)))}ngOnDestroy(){this._uiEvent.removeGestureListeners(this._swipeLeftHandler,this._swipeRightHandler),this._uiEvent.removeHotkeyListener(this._hotkeyHandler),this.scheduledOpen&&(clearTimeout(this.scheduledOpen),this.scheduledOpen=null)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=P({type:i,selectors:[["app-root"]],viewQuery:function(e,o){e&1&&X(o.upgradeMessagesRef,vi,5),e&2&&Z()},inputs:{actionsSidenavOpened:[1,"actionsSidenavOpened"],notificationsSidenavOpened:[1,"notificationsSidenavOpened"]},outputs:{actionsSidenavOpened:"actionsSidenavOpenedChange",notificationsSidenavOpened:"notificationsSidenavOpenedChange"},decls:9,vars:6,consts:[["actionsSidenav",""],["upgradeMessages",""],["kipGestures","",1,"sidenav-container",3,"swipeleft","swiperight","backdropClick","mode","bridgeUiEvents"],["mode","over","position","start","autoFocus","true","disableClose","",1,"sidenav-notifications",3,"openedChange","keydown","opened"],["mode","over","position","end","autoFocus","true","disableClose","",1,"sidenav-actions",3,"openedChange","keydown","opened"],[3,"actionsSidenav"],[1,"router-outlet-container"],["role","alert","aria-live","polite",1,"config-upgrade-overlay"],[1,"config-upgrade-card"],["diameter","46","mode","indeterminate"],[1,"config-upgrade-text"],[1,"config-upgrade-messages"]],template:function(e,o){if(e&1){let r=S();a(0,"mat-sidenav-container",2),f("swipeleft",function(){return o.onSwipeLeft()})("swiperight",function(){return o.onSwipeRight()})("backdropClick",function(){return o.backdropClicked()}),a(1,"mat-sidenav",3),gt("openedChange",function(m){return g(r),ht(o.notificationsSidenavOpened,m)||(o.notificationsSidenavOpened=m),_(m)}),f("keydown",function(m){return o.escapeKeyPressed(m.key)}),I(2,"menu-notifications"),s(),a(3,"mat-sidenav",4,0),gt("openedChange",function(m){return g(r),ht(o.actionsSidenavOpened,m)||(o.actionsSidenavOpened=m),_(m)}),f("keydown",function(m){return o.escapeKeyPressed(m.key)}),I(5,"menu-actions",5),s(),a(6,"mat-sidenav-content"),I(7,"router-outlet",6),s()(),v(8,Si,9,1,"div",7)}if(e&2){let r=Pt(4);M("mode","horizontal")("bridgeUiEvents",!0),p(),ut("opened",o.notificationsSidenavOpened),p(2),ut("opened",o.actionsSidenavOpened),p(2),M("actionsSidenav",r),p(3),b(o.upgrade.upgrading()?8:-1)}},dependencies:[Le,ze,N,ge,T,oe,te,De,Pe,Ne,Oe,Ft,Jt,Te,Ae],styles:[".sidenav-container[_ngcontent-%COMP%]{height:100%;width:100%;--mat-sidenav-scrim-color: color-mix(in srgb, var(--mat-sys-neutral-variant20) 70%, transparent)}mat-sidenav-content[_ngcontent-%COMP%]{overflow-y:hidden;overflow-x:hidden}mat-sidenav[_ngcontent-%COMP%]{box-shadow:0 0 1px 0 var(--kip-contrast-color)}mat-sidenav.sidenav-notifications[_ngcontent-%COMP%]{width:230px;z-index:1200}mat-sidenav.sidenav-actions[_ngcontent-%COMP%]{width:135px;z-index:1200;overflow-x:hidden}.config-upgrade-overlay[_ngcontent-%COMP%]{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:#00000073;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);z-index:2000;pointer-events:all}.config-upgrade-card[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;gap:18px;padding:20px 24px;width:clamp(300px,60vw,640px);background:var(--kip-background, #1f1f1f);border:1px solid rgba(255,255,255,.18);border-radius:14px;color:var(--kip-contrast-color, #fff);box-shadow:0 6px 22px #0000008c}.config-upgrade-text[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 4px;font-size:1.05rem;font-weight:600;letter-spacing:.5px}.config-upgrade-text[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 10px;font-size:.8rem;opacity:.85}.config-upgrade-messages[_ngcontent-%COMP%]{list-style:disc;margin:0;padding-left:18px;max-height:180px;font-size:.68rem;line-height:1.25;scrollbar-width:thin;overflow-y:auto}.config-upgrade-messages[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{margin-bottom:2px}"]})}return i})();var We=(()=>{class i{auth=n(D);authToken=null;authTokenSubscription=null;constructor(){this.authTokenSubscription=this.auth.authToken$.subscribe(t=>{this.authToken=t})}intercept(t,e){let o=t.clone();return this.authToken&&(o=t.clone({headers:t.headers.set("authorization","JWT "+this.authToken.token)})),e.handle(o)}ngOnDestroy(){this.authTokenSubscription?.unsubscribe()}static \u0275fac=function(e){return new(e||i)};static \u0275prov=C({token:i,factory:i.\u0275fac})}return i})();var Ge=(()=>{class i extends it{_createContainer(){let t=document.createElement("div");t.classList.add("cdk-overlay-container"),(document.getElementById("app-filter-wrapper")||document.querySelector("app-root")||document.body).appendChild(t),this._containerElement=t}static \u0275fac=(()=>{let t;return function(o){return(t||(t=It(i)))(o||i)}})();static \u0275prov=C({token:i,factory:i.\u0275fac})}return i})();var Qe=(()=>{class i{_router=n(k);_dialog=n(re);_bottomSheet=n(Ce);_destroyRef=n(Y);constructor(){this._router.events.pipe(U(t=>t instanceof Zt),R(this._destroyRef)).subscribe(()=>{this._dialog.openDialogs.length>0&&this._dialog.closeAll(),this._bottomSheet.dismiss()})}static \u0275fac=function(e){return new(e||i)};static \u0275prov=C({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();Ue.production&&void 0;Bt(je,{providers:[Ut(),xt(zt),{provide:Ht,useClass:We,multi:!0},{provide:ae,useValue:{hasBackdrop:!0,disableClose:!1,autoFocus:"first-tabbable",delayFocusTrap:!0,backdropClass:"dialogBackdrop"}},{provide:se,useValue:{appearance:"outline",floatLabel:"always",subscriptSizing:"dynamic"}},{provide:me,useValue:{showDelay:1500,hideDelay:0}},D,z,nt,B,L,H,A,de,W,x,E,he,at,Ee(),$t(qt()),ee(Re,ie()),{provide:it,useClass:Ge},ft(()=>n(W).initNetworkServices()),ft(()=>{n(Qe)})]});
@@ -1,75 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.normalizeUserScope = normalizeUserScope;
4
- exports.resolveAuthenticatedUserScope = resolveAuthenticatedUserScope;
5
- exports.resolveReadUserScope = resolveReadUserScope;
6
- exports.resolveWriteUserScopeOrReject = resolveWriteUserScopeOrReject;
7
- /**
8
- * Normalizes a candidate user scope value.
9
- *
10
- * @param {unknown} value Candidate scope value.
11
- * @returns {string | null} Trimmed scope or null when empty.
12
- *
13
- * @example
14
- * const scope = normalizeUserScope(' demo-user ');
15
- */
16
- function normalizeUserScope(value) {
17
- const normalized = typeof value === 'string' ? value.trim() : '';
18
- return normalized.length > 0 ? normalized : null;
19
- }
20
- /**
21
- * Resolves authenticated user scope from request identity fields.
22
- *
23
- * @param {Request} req Incoming Express request.
24
- * @returns {string | null} Resolved scope or null when unavailable.
25
- *
26
- * @example
27
- * const scope = resolveAuthenticatedUserScope(req);
28
- */
29
- function resolveAuthenticatedUserScope(req) {
30
- // Check for skPrincipal.identifier as the primary method for authenticated scope resolution
31
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
32
- const skPrincipal = req.skPrincipal;
33
- if (skPrincipal && typeof skPrincipal === 'object') {
34
- const skPrincipalId = normalizeUserScope(skPrincipal.identifier);
35
- if (skPrincipalId) {
36
- return skPrincipalId;
37
- }
38
- }
39
- return null;
40
- }
41
- /**
42
- * Resolves user scope for read operations, returning a fallback when unauthenticated.
43
- *
44
- * @param {Request} req Incoming Express request.
45
- * @param {string} [fallback='anonymous'] Fallback scope value.
46
- * @returns {string} Resolved or fallback scope.
47
- *
48
- * @example
49
- * const scope = resolveReadUserScope(req);
50
- */
51
- function resolveReadUserScope(req, fallback = 'anonymous') {
52
- return resolveAuthenticatedUserScope(req) ?? fallback;
53
- }
54
- /**
55
- * Resolves user scope for write operations and rejects the request when unresolved.
56
- *
57
- * @param {Request} req Incoming Express request.
58
- * @param {Response} res Express response used for rejection.
59
- * @param {string} operation Operation label for diagnostics.
60
- * @param {(message: string) => void} errorLogger Logger callback for refusal messages.
61
- * @param {TAuthFailureResponder} sendFail Response helper callback.
62
- * @returns {string | null} Resolved scope or null when rejected.
63
- *
64
- * @example
65
- * const scope = resolveWriteUserScopeOrReject(req, res, 'PUT /series/:seriesId', console.error, sendFail);
66
- */
67
- function resolveWriteUserScopeOrReject(req, res, operation, errorLogger, sendFail) {
68
- const userScope = resolveAuthenticatedUserScope(req);
69
- if (userScope) {
70
- return userScope;
71
- }
72
- errorLogger(`[SERIES AUTH] Refused ${operation}: unresolved authenticated user scope method=${req.method} path=${req.path} ip=${req.ip}`);
73
- sendFail(res, 403, 'Authenticated user scope is required for series write operations');
74
- return null;
75
- }