@mxtommy/kip 4.0.1 → 4.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -2
- package/package.json +1 -1
- package/public/{chunk-V7PWLOQ2.js → chunk-2DBQEP6W.js} +2 -2
- package/public/{chunk-P3OU5V2Y.js → chunk-34G2VVZF.js} +1 -1
- package/public/{chunk-TCZ5ZAXQ.js → chunk-3O3POI5Z.js} +1 -1
- package/public/{chunk-CVTWABMM.js → chunk-6V3WWWDX.js} +1 -1
- package/public/{chunk-B3P2F52Y.js → chunk-7C7K2XSO.js} +7 -7
- package/public/chunk-D2CYLQZF.js +1 -0
- package/public/chunk-IO5SDLYV.js +1 -0
- package/public/chunk-NDOR4O4J.js +1 -0
- package/public/{chunk-KHL7FGID.js → chunk-PKKBBIJK.js} +1 -1
- package/public/{chunk-SVP7ZRWY.js → chunk-QLTN6G6E.js} +1 -1
- package/public/{chunk-ACTDISHE.js → chunk-QZJKBIMY.js} +1 -1
- package/public/{chunk-CTZYGIOB.js → chunk-SY22WXMI.js} +1 -1
- package/public/chunk-TIWUK3AU.js +1 -0
- package/public/{chunk-75QTGQOO.js → chunk-WL5TH323.js} +1 -1
- package/public/chunk-XDPHEQEO.js +2 -0
- package/public/{chunk-5FWE6Y4K.js → chunk-XZW7P6RL.js} +13 -13
- package/public/index.html +1 -1
- package/public/{main-3LAUI5JW.js → main-PXPGE7J4.js} +1 -1
- package/public/chunk-4HLTLR5F.js +0 -1
- package/public/chunk-AYVYZ27A.js +0 -2
- package/public/chunk-CZJ7AC6N.js +0 -1
- package/public/chunk-IPSRX374.js +0 -1
- package/public/chunk-JCW5H5WP.js +0 -1
package/public/chunk-AYVYZ27A.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{A as Or,G as he,H as kr,Hb as tr,Ia as er,Ic as ve,Ja as f,Nc as $e,O as Pr,Pa as ut,Qa as y,Sa as S,Wa as ee,Xb as I,Z as Fr,Za as Nr,a as k,aa as st,ab as je,b as j,ba as E,ca as D,cc as q,da as lt,dc as me,ea as ce,f as P,ga as F,j as nt,l as v,nc as Rr,p as Er,pc as rr,r as Xt,ra as Q,t as N,tb as Le,ua as ge,uc as ir,v as at,va as G,w as Ir,wa as Qt}from"./chunk-OB3QLUH6.js";var c=(function(t){return t.Disconnected="Disconnected",t.HTTPDiscovering="HTTPDiscovering",t.HTTPConnected="HTTPConnected",t.HTTPError="HTTPError",t.HTTPRetrying="HTTPRetrying",t.WebSocketConnecting="WebSocketConnecting",t.Connected="Connected",t.WebSocketError="WebSocketError",t.WebSocketRetrying="WebSocketRetrying",t.PermanentFailure="PermanentFailure",t})(c||{}),Ur=(()=>{class t{config={httpRetryCount:3,webSocketRetryCount:5,retryIntervals:[2e3,3e3,5e3],notificationDebounceMs:0};_currentState$=new v(c.Disconnected);_status$=new v(this.createStatus(c.Disconnected,"Not connected"));_httpRetryCount=0;_webSocketRetryCount=0;_retryTimeout=null;_notificationTimeout=null;_httpRetryCallback=null;_webSocketRetryCallback=null;_isInitializationMode=!0;constructor(){console.log("[ConnectionStateMachine] Service initialized")}get state$(){return this._currentState$.asObservable()}get status$(){return this._status$.asObservable()}get currentState(){return this._currentState$.getValue()}enableWebSocketMode(){this._isInitializationMode=!1,console.log("[ConnectionStateMachine] WebSocket mode enabled");let e=this._status$.getValue();console.log(`[ConnectionStateMachine] Current status when enabling WebSocket mode: ${e.state} - ${e.message}`),this._status$.next(e)}setHTTPRetryCallback(e){this._httpRetryCallback=e}setWebSocketRetryCallback(e){this._webSocketRetryCallback=e}startHTTPDiscovery(e="Connection request"){console.log(`[ConnectionStateMachine] Starting HTTP discovery: ${e}`),this._httpRetryCount=0,this.setState(c.HTTPDiscovering,"Discovering Signal K server...")}onHTTPDiscoverySuccess(){console.log("[ConnectionStateMachine] HTTP discovery successful"),this._httpRetryCount=0,this.setState(c.HTTPConnected,"Signal K server discovered"),this._isInitializationMode||this.startWebSocketConnection()}onHTTPDiscoveryError(e){console.log(`[ConnectionStateMachine] HTTP discovery failed: ${e}`),this._httpRetryCount<this.config.httpRetryCount?(this._httpRetryCount++,this.setState(c.HTTPRetrying,`HTTP connection failed. Retrying (${this._httpRetryCount}/${this.config.httpRetryCount})...`,this._httpRetryCount,this.config.httpRetryCount),this.scheduleHTTPRetry()):this.setState(c.PermanentFailure,`HTTP connection failed after ${this.config.httpRetryCount} attempts. Check server URL.`,this.config.httpRetryCount,this.config.httpRetryCount)}startWebSocketConnection(){if(!(this.currentState===c.HTTPConnected||this.currentState===c.WebSocketRetrying||this.currentState===c.WebSocketConnecting||this.currentState===c.Connected))return this.currentState===c.HTTPDiscovering,void 0;console.log("[ConnectionStateMachine] Starting WebSocket connection"),this._webSocketRetryCount=0,this.setState(c.WebSocketConnecting,"Connecting to Signal K Websocket...")}onWebSocketConnected(){console.log("[ConnectionStateMachine] WebSocket connected"),this._webSocketRetryCount=0,this.setState(c.Connected,"Connected to Signal K server")}onWebSocketError(e){if(console.log(`[ConnectionStateMachine] WebSocket error: ${e}`),this.currentState!==c.HTTPConnected&&this.currentState!==c.WebSocketConnecting&&this.currentState!==c.Connected&&this.currentState!==c.WebSocketRetrying){console.log("[ConnectionStateMachine] HTTP connection lost, restarting HTTP discovery"),this.startHTTPDiscovery("HTTP connection lost during WebSocket operation");return}this._webSocketRetryCount++,this.setState(c.WebSocketRetrying,`WebSocket connection failed. Retry attempt ${this._webSocketRetryCount}...`,this._webSocketRetryCount,this.config.webSocketRetryCount),this.scheduleWebSocketRetry()}shutdown(e="App shutdown"){console.log(`[ConnectionStateMachine] Shutting down all connections: ${e}`),this.clearRetryTimer(),this.clearNotificationTimeout(),this._httpRetryCount=0,this._webSocketRetryCount=0,this.setState(c.Disconnected,"Application restarting...")}isHTTPConnected(){return this.currentState===c.HTTPConnected||this.currentState===c.WebSocketConnecting||this.currentState===c.Connected||this.currentState===c.WebSocketRetrying}isFullyConnected(){return this.currentState===c.Connected}setState(e,i,o,n){this._currentState$.next(e);let a=this.createStatus(e,i,o,n);e===c.HTTPDiscovering||e===c.WebSocketConnecting?this._status$.next(a):e===c.Connected?(this.clearNotificationTimeout(),this._notificationTimeout=setTimeout(()=>{this._status$.next(a)},this.config.notificationDebounceMs)):(this.clearNotificationTimeout(),this._status$.next(a))}createStatus(e,i,o,n){return{state:e,operation:this.stateToOperationCode(e),message:i,retryCount:o||0,maxRetries:n||0,timestamp:new Date}}stateToOperationCode(e){switch(e){case c.Disconnected:return 0;case c.HTTPDiscovering:case c.WebSocketConnecting:return 1;case c.Connected:return 2;case c.HTTPError:case c.WebSocketError:case c.HTTPRetrying:case c.WebSocketRetrying:return 3;case c.HTTPConnected:return 2;case c.PermanentFailure:return 5;default:return 0}}scheduleHTTPRetry(){this.clearRetryTimer();let e=Math.min(this._httpRetryCount-1,this.config.retryIntervals.length-1),i=this.config.retryIntervals[e];console.log(`[ConnectionStateMachine] Scheduling HTTP retry in ${i}ms`),this._retryTimeout=setTimeout(()=>{this._httpRetryCallback?(console.log(`[ConnectionStateMachine] Executing HTTP retry ${this._httpRetryCount}/${this.config.httpRetryCount}`),this._httpRetryCallback()):(console.error("[ConnectionStateMachine] No HTTP retry callback set!"),this.setState(c.Disconnected,"HTTP retry callback not configured"))},i)}scheduleWebSocketRetry(){this.clearRetryTimer(),console.log(`[ConnectionStateMachine] Scheduling WebSocket retry in ${this.config.retryIntervals[1]}ms`),this._retryTimeout=setTimeout(()=>{this._webSocketRetryCallback?(console.log(`[ConnectionStateMachine] Executing WebSocket retry ${this._webSocketRetryCount}/${this.config.webSocketRetryCount}`),this._webSocketRetryCallback()):(console.log("[ConnectionStateMachine] No WebSocket retry callback - using state change method"),this.setState(c.WebSocketConnecting,`Retrying WebSocket connection (${this._webSocketRetryCount}/${this.config.webSocketRetryCount})...`,this._webSocketRetryCount,this.config.webSocketRetryCount))},this.config.retryIntervals[1])}clearRetryTimer(){this._retryTimeout&&(clearTimeout(this._retryTimeout),this._retryTimeout=null)}clearNotificationTimeout(){this._notificationTimeout&&(clearTimeout(this._notificationTimeout),this._notificationTimeout=null)}ngOnDestroy(){this.clearRetryTimer(),this.clearNotificationTimeout(),this._httpRetryCallback=null,this._webSocketRetryCallback=null,this._currentState$?.complete(),this._status$?.complete()}static \u0275fac=function(i){return new(i||t)};static \u0275prov=D({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var ct=(()=>{class t{TIMEOUT_DURATION=1e4;connectionStateMachine=F(Ur);constructor(){this.connectionStateMachine.setHTTPRetryCallback(()=>{console.log("[SignalKConnectionService] Executing HTTP retry via callback"),this.retryCurrentConnection()})}serverServiceEndpoint$=new v({operation:0,message:"Not connected",serverDescription:null,httpServiceUrl:null,WsServiceUrl:null});signalKURL;serverName;serverVersion$=new v(null);serverRoles=[];http=F(ve);currentProxyEnabled;currentSubscribeAll;validateSignalKUrl(e){return P(this,null,function*(){if(!e)throw new Error("Please enter a server URL");try{let o=new URL(e);if(!["http:","https:"].includes(o.protocol))throw new Error("URL must start with http:// or https://")}catch{throw new Error("Invalid URL format - please check for typos and ensure it starts with http:// or https://")}let i=e;i.endsWith("signalk/")||(i+="/signalk/"),console.log(`[Connection Service] Validating Signal K server at: ${e}`);try{if(!(yield N(this.http.get(i,{observe:"response"}).pipe(at(5e3),he(n=>{throw console.error("[Connection Service] HTTP Error details:",n),n.name==="TimeoutError"?(console.error("[Connection Service] Validation timed out after 5000ms"),new Error("Server is not responding - check if the URL is correct and the server is running")):n.status===0||n.status===void 0?new Error("Cannot connect to server - check the URL format and ensure the server is accessible"):n.status===404?new Error("Server found but no Signal K service detected - verify this is a Signal K server"):n.status===403?new Error("Server refused connection - check if the server allows connections from this browser"):n.status>=500?new Error(`Server error (${n.status}) - the Signal K server may be having issues`):new Error(`Connection failed (${n.status}) - ${n.statusText||"please check the server URL"}`)})))).body?.endpoints?.v1)throw new Error("Server responded but doesn't appear to be a Signal K server - missing required endpoints");console.log(`[Connection Service] Validation successful for: ${e}`)}catch(o){throw console.error(`[Connection Service] Validation failed for ${e}:`,o.message),o}})}initializeConnection(e,i,o){return P(this,null,function*(){if(!e.url){console.log("[Connection Service] Connection initialization called with null or empty URL value");return}this.currentProxyEnabled=i,this.currentSubscribeAll=o;let n={operation:1,message:"Connecting...",serverDescription:null,httpServiceUrl:null,WsServiceUrl:null};this.signalKURL=e,this.serverServiceEndpoint$.next(n),this.connectionStateMachine.startHTTPDiscovery(`Connecting to ${e.url}`);let a=this.signalKURL.url;a.endsWith("signalk/")||(a+="/signalk/");try{console.log("[Connection Service] Connecting to: "+this.signalKURL.url);let s=yield N(this.http.get(a,{observe:"response"}).pipe(at(this.TIMEOUT_DURATION),he(l=>(l.name==="TimeoutError"&&console.error("[Connection Service] Connection request timed out after "+this.TIMEOUT_DURATION+"ms"),Xt(l)))));Object.assign(n,this.processEndpointResponse(s,i,o)),this.connectionStateMachine.onHTTPDiscoverySuccess()}catch(s){n.operation=3,n.message=s.message,this.connectionStateMachine.onHTTPDiscoveryError(s.message),this.handleError(s)}finally{n.subscribeAll=!!o,this.serverServiceEndpoint$.next(n)}})}retryCurrentConnection(){if(!this.signalKURL?.url){console.error("[SignalKConnectionService] Cannot retry - no current URL stored");return}console.log(`[SignalKConnectionService] Retrying connection to ${this.signalKURL.url}`),this.performHTTPDiscovery()}performHTTPDiscovery(){return P(this,null,function*(){if(!this.signalKURL?.url){console.error("[SignalKConnectionService] No URL available for HTTP discovery");return}let e=this.signalKURL.url;e.endsWith("signalk/")||(e+="/signalk/");try{console.log("[Connection Service] Connecting to: "+this.signalKURL.url);let i=yield N(this.http.get(e,{observe:"response"}).pipe(at(this.TIMEOUT_DURATION),he(n=>(n.name==="TimeoutError"&&console.error("[Connection Service] Connection request timed out after "+this.TIMEOUT_DURATION+"ms"),Xt(n))))),o=this.processEndpointResponse(i,this.currentProxyEnabled,this.currentSubscribeAll);this.connectionStateMachine.onHTTPDiscoverySuccess(),this.serverServiceEndpoint$.next(o)}catch(i){let o={operation:3,message:i.message,serverDescription:null,httpServiceUrl:null,WsServiceUrl:null};this.connectionStateMachine.onHTTPDiscoveryError(i.message),this.serverServiceEndpoint$.next(o),this.handleError(i)}})}processEndpointResponse(e,i,o){console.debug("[Connection Service] Signal K HTTP Endpoints retrieved"),this.serverVersion$.next(e.body.server.version);let n=e.body.endpoints.v1["signalk-http"],a=e.body.endpoints.v1["signalk-ws"],s={operation:2,message:e.status?.toString()||"Connected",serverDescription:`${e.body.server.id} ${e.body.server.version}`,httpServiceUrl:null,WsServiceUrl:null};if(i)console.debug("[Connection Service] Proxy Mode Enabled"),s.httpServiceUrl=window.location.origin+new URL(n).pathname,s.WsServiceUrl=window.location.protocol.replace("http","ws")+"//"+window.location.host+new URL(a).pathname;else{s.httpServiceUrl=n;let l=window.location.protocol==="https:";s.WsServiceUrl=l?a.replace("ws://","wss://"):a}return console.debug("[Connection Service] HTTP URI: "+s.httpServiceUrl),console.debug("[Connection Service] WebSocket URI: "+s.WsServiceUrl),s.subscribeAll=!!o,s}handleError(e){let i=e.status===0?`[Connection Service] ${e.name}: ${e.message}`:`[Connection Service] Backend returned code ${e.status}, body was: ${e.error}`;throw console.error(i),e}getServiceEndpointStatusAsO(){return this.serverServiceEndpoint$.asObservable()}setServerInfo(e,i,o){this.serverName=e,this.serverRoles=o,console.log(`[Connection Service] Server Name: ${e}, Version: ${i}, Roles: ${JSON.stringify(o)}`)}get skServerName(){return this.serverName}get skServerVersion(){return this.serverVersion$.getValue()}get skServerRoles(){return this.serverRoles}static \u0275fac=function(i){return new(i||t)};static \u0275prov=D({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var jn="/signalk/v1/",jr="auth/login",Ln="auth/logout",$n="auth/validate",or=60,Wn=2147483647,Lr=(()=>{class t{http=F(ve);conn=F(ct);_IsLoggedIn$=new v(!1);isLoggedIn$=this._IsLoggedIn$.asObservable();_authToken$=new v(null);authToken$=this._authToken$.asObservable();connectionEndpointSubscription=null;authTokenSubscription=null;renewalTimerId=null;isRenewingToken=!1;loginUrl=null;logoutUrl=null;validateTokenUrl=null;constructor(){let e=JSON.parse(localStorage.getItem("authorization_token"));e&&(e.isDeviceAccessToken?e.expiry===null?(console.log("[Authentication Service] Device Access Token found with expiry: NEVER"),this._authToken$.next(e)):this.isTokenExpired(e.expiry)?(console.log("[Authentication Service] Device Access Token expired. Deleting token"),localStorage.removeItem("authorization_token")):(console.log("[Authentication Service] Device Access Token found in Local Storage"),this._authToken$.next(e)):(console.log("[Authentication Service] User session token found in Local Storage"),console.log("[Authentication Service] Deleting user session token"),localStorage.removeItem("authorization_token"))),this.authTokenSubscription=this._authToken$.pipe(Pr((i,o)=>i?.expiry===o?.expiry)).subscribe(i=>{this.renewalTimerId&&(clearTimeout(this.renewalTimerId),this.renewalTimerId=null),!(!i||i.expiry==null)&&this.scheduleRenewalChunk(i)}),this.connectionEndpointSubscription=this.conn.serverServiceEndpoint$.subscribe(i=>{if(i.operation===2){let o=i.httpServiceUrl.substring(0,i.httpServiceUrl.length-4);this.loginUrl=o+jr,this.logoutUrl=o+Ln,this.validateTokenUrl=o+$n}})}scheduleRenewalChunk(e){let i=Date.now(),o=(e.expiry-or)*1e3,n=o-i;if(n<=0){this.handleTokenRenewal();return}let a=Math.min(n,Wn);console.log(a!==n?`[Authentication Service] Large renewal delay (${n} ms). Scheduling first chunk of ${a} ms.`:`[Authentication Service] Scheduling token renewal in ${a} ms (buffered target: ${new Date(o).toISOString()})`),this.renewalTimerId=setTimeout(()=>{this.renewalTimerId=null;let s=this._authToken$.getValue();!s||s.expiry!==e.expiry||this.scheduleRenewalChunk(e)},a)}handleTokenRenewal(){if(this.isRenewingToken){console.warn("[Authentication Service] Token renewal already in progress.");return}this.isRenewingToken=!0;let e=JSON.parse(localStorage.getItem("authorization_token"));if(!e){console.warn("[Authentication Service] No token found in local storage. Cannot renew."),this.isRenewingToken=!1;return}if(e.isDeviceAccessToken)console.warn("[Authentication Service] Device Access Token expired. Manual renewal required."),this.isRenewingToken=!1;else{let i=Math.floor(Date.now()/1e3),o=e.expiry-i;if(this.isTokenExpired(e.expiry))console.log("[Authentication Service] User session Token expired. Cannot renew."),this.isRenewingToken=!1;else if(o>or)console.log(`[Authentication Service] Renewal trigger fired early; ${o}s remaining (> buffer ${or}s). Rescheduling.`),this.isRenewingToken=!1,this.scheduleRenewalChunk(e);else{console.log(`[Authentication Service] User session Token within renewal window (${o}s remaining). Renewing token...`);let n=JSON.parse(localStorage.getItem("connectionConfig"));this.login({usr:n.loginName,pwd:n.loginPassword}).then(()=>{console.log("[Authentication Service] Token successfully renewed.")}).catch(a=>{console.error("[Authentication Service] Token renewal failed. Server returned:",a.error)}).finally(()=>{this.isRenewingToken=!1})}}}login(n){return P(this,arguments,function*({usr:e,pwd:i,newUrl:o}){let a;if(o?a=o.replace(/\/+$/,"")+jn+jr:a=this.loginUrl,this._IsLoggedIn$.getValue()&&(yield this.logout(!0)),!a)throw console.error("[Authentication Service] Login URL is not set. Cannot perform login."),this.deleteToken(),new Error("Login URL is not set.");yield N(this.http.post(a,{username:e,password:i},{observe:"response"})).then(s=>{console.log("[Authentication Service] User "+e+" login successful"),this.setSession(s.body.token)}).catch(s=>{this.deleteToken(),this.handleError(s)})})}handleError(e){throw e.status===0&&this.deleteToken(),e}setSession(e){if(e){let i=JSON.parse(atob(e.split(".")[1])).exp,o={token:null,expiry:null,isDeviceAccessToken:!1};i===void 0?(o.token=e,console.log("[Authentication Service] User Session Token received. Token Expiration: NEVER"),this._IsLoggedIn$.next(!0),this._authToken$.next(o),localStorage.setItem("authorization_token",JSON.stringify(o))):this.isTokenExpired(i)?console.log("[Authentication Service] Received expired Session Token from server"):(o.token=e,o.expiry=i,console.log("[Authentication Service] Session Authorization Token received. Token Expiration: "+this.getTokenExpirationDate(o.expiry)),this._IsLoggedIn$.next(!0),this._authToken$.next(o),localStorage.setItem("authorization_token",JSON.stringify(o)))}}isTokenExpired(e){return Math.floor(new Date().getTime()/1e3)>=e}getTokenExpirationDate(e,i){let o=new Date(0);if(i){let n=new Date(0);n.setUTCSeconds(e-i),o=n}else o.setUTCSeconds(e);return o}renewToken(){return this.http.post(this.validateTokenUrl,null,{observe:"response"})}logout(e){return P(this,null,function*(){localStorage.removeItem("authorization_token"),yield N(this.http.put(this.logoutUrl,null)).then(()=>{this._IsLoggedIn$.next(!1),e||this._authToken$.next(null),console.log("[Authentication Service] User logged out")}).catch(i=>{console.error(i)})})}deleteToken(){this._authToken$&&(console.log("[Authentication Service] Deleting Authorization token"),localStorage.removeItem("authorization_token"),this._IsLoggedIn$.next(!1),this._authToken$.next(null))}setDeviceAccessToken(e){if(e){let i=JSON.parse(atob(e.split(".")[1])).exp,o={token:null,expiry:null,isDeviceAccessToken:!0};i===void 0?(o.token=e,console.log("[Authentication Service] Device Access Token received. Token Expiration: NEVER"),this._IsLoggedIn$.next(!1),this._authToken$.next(o),localStorage.setItem("authorization_token",JSON.stringify(o))):this.isTokenExpired(i)?console.log("[Authentication Service] Received expired Device Access Token from server"):(o.token=e,o.expiry=i,console.log("[Authentication Service] Device Access Token received. Token Expiration: "+this.getTokenExpirationDate(o.expiry)),this._IsLoggedIn$.next(!1),this._authToken$.next(o),localStorage.setItem("authorization_token",JSON.stringify(o)))}}ngOnDestroy(){this.connectionEndpointSubscription?.unsubscribe(),this.authTokenSubscription?.unsubscribe(),this.renewalTimerId&&(clearTimeout(this.renewalTimerId),this.renewalTimerId=null)}static \u0275fac=function(i){return new(i||t)};static \u0275prov=D({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var Bn=typeof global=="object"&&global&&global.Object===Object&&global,ft=Bn;var Hn=typeof self=="object"&&self&&self.Object===Object&&self,Gn=ft||Hn||Function("return this")(),b=Gn;var qn=b.Symbol,R=qn;var $r=Object.prototype,Kn=$r.hasOwnProperty,zn=$r.toString,We=R?R.toStringTag:void 0;function Jn(t){var r=Kn.call(t,We),e=t[We];try{t[We]=void 0;var i=!0}catch{}var o=zn.call(t);return i&&(r?t[We]=e:delete t[We]),o}var Wr=Jn;var Zn=Object.prototype,Yn=Zn.toString;function Xn(t){return Yn.call(t)}var Br=Xn;var Qn="[object Null]",ea="[object Undefined]",Hr=R?R.toStringTag:void 0;function ta(t){return t==null?t===void 0?ea:Qn:Hr&&Hr in Object(t)?Wr(t):Br(t)}var L=ta;function ra(t){return t!=null&&typeof t=="object"}var x=ra;var ia=Array.isArray,U=ia;function oa(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}var T=oa;function na(t){return t}var dt=na;var aa="[object AsyncFunction]",sa="[object Function]",la="[object GeneratorFunction]",ua="[object Proxy]";function ca(t){if(!T(t))return!1;var r=L(t);return r==sa||r==la||r==aa||r==ua}var be=ca;var fa=b["__core-js_shared__"],pt=fa;var Gr=(function(){var t=/[^.]+$/.exec(pt&&pt.keys&&pt.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function da(t){return!!Gr&&Gr in t}var qr=da;var pa=Function.prototype,ha=pa.toString;function ga(t){if(t!=null){try{return ha.call(t)}catch{}try{return t+""}catch{}}return""}var K=ga;var ma=/[\\^$.*+?()[\]{}|]/g,va=/^\[object .+?Constructor\]$/,ya=Function.prototype,ba=Object.prototype,Sa=ya.toString,Ca=ba.hasOwnProperty,_a=RegExp("^"+Sa.call(Ca).replace(ma,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function xa(t){if(!T(t)||qr(t))return!1;var r=be(t)?_a:va;return r.test(K(t))}var Kr=xa;function wa(t,r){return t?.[r]}var zr=wa;function Ta(t,r){var e=zr(t,r);return Kr(e)?e:void 0}var O=Ta;var Aa=O(b,"WeakMap"),ht=Aa;var Jr=Object.create,Da=(function(){function t(){}return function(r){if(!T(r))return{};if(Jr)return Jr(r);t.prototype=r;var e=new t;return t.prototype=void 0,e}})(),Zr=Da;function Va(t,r,e){switch(e.length){case 0:return t.call(r);case 1:return t.call(r,e[0]);case 2:return t.call(r,e[0],e[1]);case 3:return t.call(r,e[0],e[1],e[2])}return t.apply(r,e)}var Yr=Va;function Ma(t,r){var e=-1,i=t.length;for(r||(r=Array(i));++e<i;)r[e]=t[e];return r}var gt=Ma;var Ea=800,Ia=16,Oa=Date.now;function ka(t){var r=0,e=0;return function(){var i=Oa(),o=Ia-(i-e);if(e=i,o>0){if(++r>=Ea)return arguments[0]}else r=0;return t.apply(void 0,arguments)}}var Xr=ka;function Pa(t){return function(){return t}}var Qr=Pa;var Fa=(function(){try{var t=O(Object,"defineProperty");return t({},"",{}),t}catch{}})(),Se=Fa;var Na=Se?function(t,r){return Se(t,"toString",{configurable:!0,enumerable:!1,value:Qr(r),writable:!0})}:dt,ei=Na;var Ra=Xr(ei),ti=Ra;function Ua(t,r){for(var e=-1,i=t==null?0:t.length;++e<i&&r(t[e],e,t)!==!1;);return t}var ri=Ua;var ja=9007199254740991,La=/^(?:0|[1-9]\d*)$/;function $a(t,r){var e=typeof t;return r=r??ja,!!r&&(e=="number"||e!="symbol"&&La.test(t))&&t>-1&&t%1==0&&t<r}var mt=$a;function Wa(t,r,e){r=="__proto__"&&Se?Se(t,r,{configurable:!0,enumerable:!0,value:e,writable:!0}):t[r]=e}var Ce=Wa;function Ba(t,r){return t===r||t!==t&&r!==r}var W=Ba;var Ha=Object.prototype,Ga=Ha.hasOwnProperty;function qa(t,r,e){var i=t[r];(!(Ga.call(t,r)&&W(i,e))||e===void 0&&!(r in t))&&Ce(t,r,e)}var vt=qa;function Ka(t,r,e,i){var o=!e;e||(e={});for(var n=-1,a=r.length;++n<a;){var s=r[n],l=i?i(e[s],t[s],s,e,t):void 0;l===void 0&&(l=t[s]),o?Ce(e,s,l):vt(e,s,l)}return e}var B=Ka;var ii=Math.max;function za(t,r,e){return r=ii(r===void 0?t.length-1:r,0),function(){for(var i=arguments,o=-1,n=ii(i.length-r,0),a=Array(n);++o<n;)a[o]=i[r+o];o=-1;for(var s=Array(r+1);++o<r;)s[o]=i[o];return s[r]=e(a),Yr(t,this,s)}}var oi=za;function Ja(t,r){return ti(oi(t,r,dt),t+"")}var ni=Ja;var Za=9007199254740991;function Ya(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Za}var yt=Ya;function Xa(t){return t!=null&&yt(t.length)&&!be(t)}var te=Xa;function Qa(t,r,e){if(!T(e))return!1;var i=typeof r;return(i=="number"?te(e)&&mt(r,e.length):i=="string"&&r in e)?W(e[r],t):!1}var ai=Qa;function es(t){return ni(function(r,e){var i=-1,o=e.length,n=o>1?e[o-1]:void 0,a=o>2?e[2]:void 0;for(n=t.length>3&&typeof n=="function"?(o--,n):void 0,a&&ai(e[0],e[1],a)&&(n=o<3?void 0:n,o=1),r=Object(r);++i<o;){var s=e[i];s&&t(r,s,i,n)}return r})}var si=es;var ts=Object.prototype;function rs(t){var r=t&&t.constructor,e=typeof r=="function"&&r.prototype||ts;return t===e}var _e=rs;function is(t,r){for(var e=-1,i=Array(t);++e<t;)i[e]=r(e);return i}var li=is;var os="[object Arguments]";function ns(t){return x(t)&&L(t)==os}var nr=ns;var ui=Object.prototype,as=ui.hasOwnProperty,ss=ui.propertyIsEnumerable,ls=nr((function(){return arguments})())?nr:function(t){return x(t)&&as.call(t,"callee")&&!ss.call(t,"callee")},Be=ls;function us(){return!1}var ci=us;var pi=typeof exports=="object"&&exports&&!exports.nodeType&&exports,fi=pi&&typeof module=="object"&&module&&!module.nodeType&&module,cs=fi&&fi.exports===pi,di=cs?b.Buffer:void 0,fs=di?di.isBuffer:void 0,ds=fs||ci,z=ds;var ps="[object Arguments]",hs="[object Array]",gs="[object Boolean]",ms="[object Date]",vs="[object Error]",ys="[object Function]",bs="[object Map]",Ss="[object Number]",Cs="[object Object]",_s="[object RegExp]",xs="[object Set]",ws="[object String]",Ts="[object WeakMap]",As="[object ArrayBuffer]",Ds="[object DataView]",Vs="[object Float32Array]",Ms="[object Float64Array]",Es="[object Int8Array]",Is="[object Int16Array]",Os="[object Int32Array]",ks="[object Uint8Array]",Ps="[object Uint8ClampedArray]",Fs="[object Uint16Array]",Ns="[object Uint32Array]",g={};g[Vs]=g[Ms]=g[Es]=g[Is]=g[Os]=g[ks]=g[Ps]=g[Fs]=g[Ns]=!0;g[ps]=g[hs]=g[As]=g[gs]=g[Ds]=g[ms]=g[vs]=g[ys]=g[bs]=g[Ss]=g[Cs]=g[_s]=g[xs]=g[ws]=g[Ts]=!1;function Rs(t){return x(t)&&yt(t.length)&&!!g[L(t)]}var hi=Rs;function Us(t){return function(r){return t(r)}}var xe=Us;var gi=typeof exports=="object"&&exports&&!exports.nodeType&&exports,He=gi&&typeof module=="object"&&module&&!module.nodeType&&module,js=He&&He.exports===gi,ar=js&&ft.process,Ls=(function(){try{var t=He&&He.require&&He.require("util").types;return t||ar&&ar.binding&&ar.binding("util")}catch{}})(),J=Ls;var mi=J&&J.isTypedArray,$s=mi?xe(mi):hi,we=$s;var Ws=Object.prototype,Bs=Ws.hasOwnProperty;function Hs(t,r){var e=U(t),i=!e&&Be(t),o=!e&&!i&&z(t),n=!e&&!i&&!o&&we(t),a=e||i||o||n,s=a?li(t.length,String):[],l=s.length;for(var u in t)(r||Bs.call(t,u))&&!(a&&(u=="length"||o&&(u=="offset"||u=="parent")||n&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||mt(u,l)))&&s.push(u);return s}var bt=Hs;function Gs(t,r){return function(e){return t(r(e))}}var St=Gs;var qs=St(Object.keys,Object),vi=qs;var Ks=Object.prototype,zs=Ks.hasOwnProperty;function Js(t){if(!_e(t))return vi(t);var r=[];for(var e in Object(t))zs.call(t,e)&&e!="constructor"&&r.push(e);return r}var yi=Js;function Zs(t){return te(t)?bt(t):yi(t)}var Te=Zs;function Ys(t){var r=[];if(t!=null)for(var e in Object(t))r.push(e);return r}var bi=Ys;var Xs=Object.prototype,Qs=Xs.hasOwnProperty;function el(t){if(!T(t))return bi(t);var r=_e(t),e=[];for(var i in t)i=="constructor"&&(r||!Qs.call(t,i))||e.push(i);return e}var Si=el;function tl(t){return te(t)?bt(t,!0):Si(t)}var H=tl;var rl=O(Object,"create"),Z=rl;function il(){this.__data__=Z?Z(null):{},this.size=0}var Ci=il;function ol(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}var _i=ol;var nl="__lodash_hash_undefined__",al=Object.prototype,sl=al.hasOwnProperty;function ll(t){var r=this.__data__;if(Z){var e=r[t];return e===nl?void 0:e}return sl.call(r,t)?r[t]:void 0}var xi=ll;var ul=Object.prototype,cl=ul.hasOwnProperty;function fl(t){var r=this.__data__;return Z?r[t]!==void 0:cl.call(r,t)}var wi=fl;var dl="__lodash_hash_undefined__";function pl(t,r){var e=this.__data__;return this.size+=this.has(t)?0:1,e[t]=Z&&r===void 0?dl:r,this}var Ti=pl;function Ae(t){var r=-1,e=t==null?0:t.length;for(this.clear();++r<e;){var i=t[r];this.set(i[0],i[1])}}Ae.prototype.clear=Ci;Ae.prototype.delete=_i;Ae.prototype.get=xi;Ae.prototype.has=wi;Ae.prototype.set=Ti;var sr=Ae;function hl(){this.__data__=[],this.size=0}var Ai=hl;function gl(t,r){for(var e=t.length;e--;)if(W(t[e][0],r))return e;return-1}var re=gl;var ml=Array.prototype,vl=ml.splice;function yl(t){var r=this.__data__,e=re(r,t);if(e<0)return!1;var i=r.length-1;return e==i?r.pop():vl.call(r,e,1),--this.size,!0}var Di=yl;function bl(t){var r=this.__data__,e=re(r,t);return e<0?void 0:r[e][1]}var Vi=bl;function Sl(t){return re(this.__data__,t)>-1}var Mi=Sl;function Cl(t,r){var e=this.__data__,i=re(e,t);return i<0?(++this.size,e.push([t,r])):e[i][1]=r,this}var Ei=Cl;function De(t){var r=-1,e=t==null?0:t.length;for(this.clear();++r<e;){var i=t[r];this.set(i[0],i[1])}}De.prototype.clear=Ai;De.prototype.delete=Di;De.prototype.get=Vi;De.prototype.has=Mi;De.prototype.set=Ei;var ie=De;var _l=O(b,"Map"),oe=_l;function xl(){this.size=0,this.__data__={hash:new sr,map:new(oe||ie),string:new sr}}var Ii=xl;function wl(t){var r=typeof t;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?t!=="__proto__":t===null}var Oi=wl;function Tl(t,r){var e=t.__data__;return Oi(r)?e[typeof r=="string"?"string":"hash"]:e.map}var ne=Tl;function Al(t){var r=ne(this,t).delete(t);return this.size-=r?1:0,r}var ki=Al;function Dl(t){return ne(this,t).get(t)}var Pi=Dl;function Vl(t){return ne(this,t).has(t)}var Fi=Vl;function Ml(t,r){var e=ne(this,t),i=e.size;return e.set(t,r),this.size+=e.size==i?0:1,this}var Ni=Ml;function Ve(t){var r=-1,e=t==null?0:t.length;for(this.clear();++r<e;){var i=t[r];this.set(i[0],i[1])}}Ve.prototype.clear=Ii;Ve.prototype.delete=ki;Ve.prototype.get=Pi;Ve.prototype.has=Fi;Ve.prototype.set=Ni;var Ct=Ve;function El(t,r){for(var e=-1,i=r.length,o=t.length;++e<i;)t[o+e]=r[e];return t}var _t=El;var Il=St(Object.getPrototypeOf,Object),Me=Il;var Ol="[object Object]",kl=Function.prototype,Pl=Object.prototype,Ri=kl.toString,Fl=Pl.hasOwnProperty,Nl=Ri.call(Object);function Rl(t){if(!x(t)||L(t)!=Ol)return!1;var r=Me(t);if(r===null)return!0;var e=Fl.call(r,"constructor")&&r.constructor;return typeof e=="function"&&e instanceof e&&Ri.call(e)==Nl}var Ui=Rl;function Ul(){this.__data__=new ie,this.size=0}var ji=Ul;function jl(t){var r=this.__data__,e=r.delete(t);return this.size=r.size,e}var Li=jl;function Ll(t){return this.__data__.get(t)}var $i=Ll;function $l(t){return this.__data__.has(t)}var Wi=$l;var Wl=200;function Bl(t,r){var e=this.__data__;if(e instanceof ie){var i=e.__data__;if(!oe||i.length<Wl-1)return i.push([t,r]),this.size=++e.size,this;e=this.__data__=new Ct(i)}return e.set(t,r),this.size=e.size,this}var Bi=Bl;function Ee(t){var r=this.__data__=new ie(t);this.size=r.size}Ee.prototype.clear=ji;Ee.prototype.delete=Li;Ee.prototype.get=$i;Ee.prototype.has=Wi;Ee.prototype.set=Bi;var ae=Ee;function Hl(t,r){return t&&B(r,Te(r),t)}var Hi=Hl;function Gl(t,r){return t&&B(r,H(r),t)}var Gi=Gl;var Ji=typeof exports=="object"&&exports&&!exports.nodeType&&exports,qi=Ji&&typeof module=="object"&&module&&!module.nodeType&&module,ql=qi&&qi.exports===Ji,Ki=ql?b.Buffer:void 0,zi=Ki?Ki.allocUnsafe:void 0;function Kl(t,r){if(r)return t.slice();var e=t.length,i=zi?zi(e):new t.constructor(e);return t.copy(i),i}var xt=Kl;function zl(t,r){for(var e=-1,i=t==null?0:t.length,o=0,n=[];++e<i;){var a=t[e];r(a,e,t)&&(n[o++]=a)}return n}var Zi=zl;function Jl(){return[]}var wt=Jl;var Zl=Object.prototype,Yl=Zl.propertyIsEnumerable,Yi=Object.getOwnPropertySymbols,Xl=Yi?function(t){return t==null?[]:(t=Object(t),Zi(Yi(t),function(r){return Yl.call(t,r)}))}:wt,Ie=Xl;function Ql(t,r){return B(t,Ie(t),r)}var Xi=Ql;var eu=Object.getOwnPropertySymbols,tu=eu?function(t){for(var r=[];t;)_t(r,Ie(t)),t=Me(t);return r}:wt,Tt=tu;function ru(t,r){return B(t,Tt(t),r)}var Qi=ru;function iu(t,r,e){var i=r(t);return U(t)?i:_t(i,e(t))}var At=iu;function ou(t){return At(t,Te,Ie)}var Ge=ou;function nu(t){return At(t,H,Tt)}var eo=nu;var au=O(b,"DataView"),Dt=au;var su=O(b,"Promise"),Vt=su;var lu=O(b,"Set"),Mt=lu;var to="[object Map]",uu="[object Object]",ro="[object Promise]",io="[object Set]",oo="[object WeakMap]",no="[object DataView]",cu=K(Dt),fu=K(oe),du=K(Vt),pu=K(Mt),hu=K(ht),fe=L;(Dt&&fe(new Dt(new ArrayBuffer(1)))!=no||oe&&fe(new oe)!=to||Vt&&fe(Vt.resolve())!=ro||Mt&&fe(new Mt)!=io||ht&&fe(new ht)!=oo)&&(fe=function(t){var r=L(t),e=r==uu?t.constructor:void 0,i=e?K(e):"";if(i)switch(i){case cu:return no;case fu:return to;case du:return ro;case pu:return io;case hu:return oo}return r});var Y=fe;var gu=Object.prototype,mu=gu.hasOwnProperty;function vu(t){var r=t.length,e=new t.constructor(r);return r&&typeof t[0]=="string"&&mu.call(t,"index")&&(e.index=t.index,e.input=t.input),e}var ao=vu;var yu=b.Uint8Array,Oe=yu;function bu(t){var r=new t.constructor(t.byteLength);return new Oe(r).set(new Oe(t)),r}var ke=bu;function Su(t,r){var e=r?ke(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.byteLength)}var so=Su;var Cu=/\w*$/;function _u(t){var r=new t.constructor(t.source,Cu.exec(t));return r.lastIndex=t.lastIndex,r}var lo=_u;var uo=R?R.prototype:void 0,co=uo?uo.valueOf:void 0;function xu(t){return co?Object(co.call(t)):{}}var fo=xu;function wu(t,r){var e=r?ke(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.length)}var Et=wu;var Tu="[object Boolean]",Au="[object Date]",Du="[object Map]",Vu="[object Number]",Mu="[object RegExp]",Eu="[object Set]",Iu="[object String]",Ou="[object Symbol]",ku="[object ArrayBuffer]",Pu="[object DataView]",Fu="[object Float32Array]",Nu="[object Float64Array]",Ru="[object Int8Array]",Uu="[object Int16Array]",ju="[object Int32Array]",Lu="[object Uint8Array]",$u="[object Uint8ClampedArray]",Wu="[object Uint16Array]",Bu="[object Uint32Array]";function Hu(t,r,e){var i=t.constructor;switch(r){case ku:return ke(t);case Tu:case Au:return new i(+t);case Pu:return so(t,e);case Fu:case Nu:case Ru:case Uu:case ju:case Lu:case $u:case Wu:case Bu:return Et(t,e);case Du:return new i;case Vu:case Iu:return new i(t);case Mu:return lo(t);case Eu:return new i;case Ou:return fo(t)}}var po=Hu;function Gu(t){return typeof t.constructor=="function"&&!_e(t)?Zr(Me(t)):{}}var It=Gu;var qu="[object Map]";function Ku(t){return x(t)&&Y(t)==qu}var ho=Ku;var go=J&&J.isMap,zu=go?xe(go):ho,mo=zu;var Ju="[object Set]";function Zu(t){return x(t)&&Y(t)==Ju}var vo=Zu;var yo=J&&J.isSet,Yu=yo?xe(yo):vo,bo=Yu;var Xu=1,Qu=2,ec=4,So="[object Arguments]",tc="[object Array]",rc="[object Boolean]",ic="[object Date]",oc="[object Error]",Co="[object Function]",nc="[object GeneratorFunction]",ac="[object Map]",sc="[object Number]",_o="[object Object]",lc="[object RegExp]",uc="[object Set]",cc="[object String]",fc="[object Symbol]",dc="[object WeakMap]",pc="[object ArrayBuffer]",hc="[object DataView]",gc="[object Float32Array]",mc="[object Float64Array]",vc="[object Int8Array]",yc="[object Int16Array]",bc="[object Int32Array]",Sc="[object Uint8Array]",Cc="[object Uint8ClampedArray]",_c="[object Uint16Array]",xc="[object Uint32Array]",h={};h[So]=h[tc]=h[pc]=h[hc]=h[rc]=h[ic]=h[gc]=h[mc]=h[vc]=h[yc]=h[bc]=h[ac]=h[sc]=h[_o]=h[lc]=h[uc]=h[cc]=h[fc]=h[Sc]=h[Cc]=h[_c]=h[xc]=!0;h[oc]=h[Co]=h[dc]=!1;function Ot(t,r,e,i,o,n){var a,s=r&Xu,l=r&Qu,u=r&ec;if(e&&(a=o?e(t,i,o,n):e(t)),a!==void 0)return a;if(!T(t))return t;var d=U(t);if(d){if(a=ao(t),!s)return gt(t,a)}else{var p=Y(t),m=p==Co||p==nc;if(z(t))return xt(t,s);if(p==_o||p==So||m&&!o){if(a=l||m?{}:It(t),!s)return l?Qi(t,Gi(a,t)):Xi(t,Hi(a,t))}else{if(!h[p])return o?t:{};a=po(t,p,s)}}n||(n=new ae);var w=n.get(t);if(w)return w;n.set(t,a),bo(t)?t.forEach(function(_){a.add(Ot(_,r,e,_,t,n))}):mo(t)&&t.forEach(function(_,A){a.set(A,Ot(_,r,e,A,t,n))});var C=u?l?eo:Ge:l?H:Te,M=d?void 0:C(t);return ri(M||t,function(_,A){M&&(A=_,_=t[A]),vt(a,A,Ot(_,r,e,A,t,n))}),a}var xo=Ot;var wc=1,Tc=4;function Ac(t){return xo(t,wc|Tc)}var lr=Ac;var Dc="__lodash_hash_undefined__";function Vc(t){return this.__data__.set(t,Dc),this}var wo=Vc;function Mc(t){return this.__data__.has(t)}var To=Mc;function kt(t){var r=-1,e=t==null?0:t.length;for(this.__data__=new Ct;++r<e;)this.add(t[r])}kt.prototype.add=kt.prototype.push=wo;kt.prototype.has=To;var Ao=kt;function Ec(t,r){for(var e=-1,i=t==null?0:t.length;++e<i;)if(r(t[e],e,t))return!0;return!1}var Do=Ec;function Ic(t,r){return t.has(r)}var Vo=Ic;var Oc=1,kc=2;function Pc(t,r,e,i,o,n){var a=e&Oc,s=t.length,l=r.length;if(s!=l&&!(a&&l>s))return!1;var u=n.get(t),d=n.get(r);if(u&&d)return u==r&&d==t;var p=-1,m=!0,w=e&kc?new Ao:void 0;for(n.set(t,r),n.set(r,t);++p<s;){var C=t[p],M=r[p];if(i)var _=a?i(M,C,p,r,t,n):i(C,M,p,t,r,n);if(_!==void 0){if(_)continue;m=!1;break}if(w){if(!Do(r,function(A,ue){if(!Vo(w,ue)&&(C===A||o(C,A,e,i,n)))return w.push(ue)})){m=!1;break}}else if(!(C===M||o(C,M,e,i,n))){m=!1;break}}return n.delete(t),n.delete(r),m}var Pt=Pc;function Fc(t){var r=-1,e=Array(t.size);return t.forEach(function(i,o){e[++r]=[o,i]}),e}var Mo=Fc;function Nc(t){var r=-1,e=Array(t.size);return t.forEach(function(i){e[++r]=i}),e}var Eo=Nc;var Rc=1,Uc=2,jc="[object Boolean]",Lc="[object Date]",$c="[object Error]",Wc="[object Map]",Bc="[object Number]",Hc="[object RegExp]",Gc="[object Set]",qc="[object String]",Kc="[object Symbol]",zc="[object ArrayBuffer]",Jc="[object DataView]",Io=R?R.prototype:void 0,ur=Io?Io.valueOf:void 0;function Zc(t,r,e,i,o,n,a){switch(e){case Jc:if(t.byteLength!=r.byteLength||t.byteOffset!=r.byteOffset)return!1;t=t.buffer,r=r.buffer;case zc:return!(t.byteLength!=r.byteLength||!n(new Oe(t),new Oe(r)));case jc:case Lc:case Bc:return W(+t,+r);case $c:return t.name==r.name&&t.message==r.message;case Hc:case qc:return t==r+"";case Wc:var s=Mo;case Gc:var l=i&Rc;if(s||(s=Eo),t.size!=r.size&&!l)return!1;var u=a.get(t);if(u)return u==r;i|=Uc,a.set(t,r);var d=Pt(s(t),s(r),i,o,n,a);return a.delete(t),d;case Kc:if(ur)return ur.call(t)==ur.call(r)}return!1}var Oo=Zc;var Yc=1,Xc=Object.prototype,Qc=Xc.hasOwnProperty;function ef(t,r,e,i,o,n){var a=e&Yc,s=Ge(t),l=s.length,u=Ge(r),d=u.length;if(l!=d&&!a)return!1;for(var p=l;p--;){var m=s[p];if(!(a?m in r:Qc.call(r,m)))return!1}var w=n.get(t),C=n.get(r);if(w&&C)return w==r&&C==t;var M=!0;n.set(t,r),n.set(r,t);for(var _=a;++p<l;){m=s[p];var A=t[m],ue=r[m];if(i)var Mr=a?i(ue,A,m,r,t,n):i(A,ue,m,t,r,n);if(!(Mr===void 0?A===ue||o(A,ue,e,i,n):Mr)){M=!1;break}_||(_=m=="constructor")}if(M&&!_){var it=t.constructor,ot=r.constructor;it!=ot&&"constructor"in t&&"constructor"in r&&!(typeof it=="function"&&it instanceof it&&typeof ot=="function"&&ot instanceof ot)&&(M=!1)}return n.delete(t),n.delete(r),M}var ko=ef;var tf=1,Po="[object Arguments]",Fo="[object Array]",Ft="[object Object]",rf=Object.prototype,No=rf.hasOwnProperty;function of(t,r,e,i,o,n){var a=U(t),s=U(r),l=a?Fo:Y(t),u=s?Fo:Y(r);l=l==Po?Ft:l,u=u==Po?Ft:u;var d=l==Ft,p=u==Ft,m=l==u;if(m&&z(t)){if(!z(r))return!1;a=!0,d=!1}if(m&&!d)return n||(n=new ae),a||we(t)?Pt(t,r,e,i,o,n):Oo(t,r,l,e,i,o,n);if(!(e&tf)){var w=d&&No.call(t,"__wrapped__"),C=p&&No.call(r,"__wrapped__");if(w||C){var M=w?t.value():t,_=C?r.value():r;return n||(n=new ae),o(M,_,e,i,n)}}return m?(n||(n=new ae),ko(t,r,e,i,o,n)):!1}var Ro=of;function Uo(t,r,e,i,o){return t===r?!0:t==null||r==null||!x(t)&&!x(r)?t!==t&&r!==r:Ro(t,r,e,i,Uo,o)}var jo=Uo;function nf(t){return function(r,e,i){for(var o=-1,n=Object(r),a=i(r),s=a.length;s--;){var l=a[t?s:++o];if(e(n[l],l,n)===!1)break}return r}}var Lo=nf;var af=Lo(),$o=af;function sf(t,r,e){(e!==void 0&&!W(t[r],e)||e===void 0&&!(r in t))&&Ce(t,r,e)}var qe=sf;function lf(t){return x(t)&&te(t)}var Wo=lf;function uf(t,r){if(!(r==="constructor"&&typeof t[r]=="function")&&r!="__proto__")return t[r]}var Ke=uf;function cf(t){return B(t,H(t))}var Bo=cf;function ff(t,r,e,i,o,n,a){var s=Ke(t,e),l=Ke(r,e),u=a.get(l);if(u){qe(t,e,u);return}var d=n?n(s,l,e+"",t,r,a):void 0,p=d===void 0;if(p){var m=U(l),w=!m&&z(l),C=!m&&!w&&we(l);d=l,m||w||C?U(s)?d=s:Wo(s)?d=gt(s):w?(p=!1,d=xt(l,!0)):C?(p=!1,d=Et(l,!0)):d=[]:Ui(l)||Be(l)?(d=s,Be(s)?d=Bo(s):(!T(s)||be(s))&&(d=It(l))):p=!1}p&&(a.set(l,d),o(d,l,i,n,a),a.delete(l)),qe(t,e,d)}var Ho=ff;function Go(t,r,e,i,o){t!==r&&$o(r,function(n,a){if(o||(o=new ae),T(n))Ho(t,r,a,e,Go,i,o);else{var s=i?i(Ke(t,a),n,a+"",t,r,o):void 0;s===void 0&&(s=n),qe(t,a,s)}},H)}var qo=Go;function df(t,r){return jo(t,r)}var pf=df;var hf=si(function(t,r,e){qo(t,r,e)}),gf=hf;var mf=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,cr=t=>{if(typeof t!="string")throw new TypeError("Invalid argument expected string");let r=t.match(mf);if(!r)throw new Error(`Invalid argument not valid semver ('${t}' received)`);return r.shift(),r},Ko=t=>t==="*"||t==="x"||t==="X",zo=t=>{let r=parseInt(t,10);return isNaN(r)?t:r},vf=(t,r)=>typeof t!=typeof r?[String(t),String(r)]:[t,r],yf=(t,r)=>{if(Ko(t)||Ko(r))return 0;let[e,i]=vf(zo(t),zo(r));return e>i?1:e<i?-1:0},fr=(t,r)=>{for(let e=0;e<Math.max(t.length,r.length);e++){let i=yf(t[e]||"0",r[e]||"0");if(i!==0)return i}return 0};var Jo=(t,r)=>{let e=cr(t),i=cr(r),o=e.pop(),n=i.pop(),a=fr(e,i);return a!==0?a:o&&n?fr(o.split("."),n.split(".")):o||n?o?-1:1:0};var dr=(t,r,e)=>{bf(e);let i=Jo(t,r);return Yo[e].includes(i)},Yo={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Zo=Object.keys(Yo),bf=t=>{if(typeof t!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof t}`);if(Zo.indexOf(t)===-1)throw new Error(`Invalid operator, expected one of ${Zo.join("|")}`)};var Xo=(()=>{class t{server=F(ct);http=F(ve);_auth=F(Lr);serverEndpoint=null;isAppDataSupported=!1;configFileVersion=null;sharedConfigName;InitConfig=null;storageServiceReady$=new v(!1);_isLoggedIn=!1;_networkStatus=void 0;_logIO=!1;patchQueue$=new nt;patch=function(e){return this.http.post(e.url,e.document).pipe(Fr(()=>console.log("[Storage Service] Remote config patch request completed successfully")),he(i=>this.handleError(i)))};constructor(){let e=this.server;this._auth.isLoggedIn$.pipe($e()).subscribe(i=>{this._isLoggedIn=i,this.isStorageServiceReady()}),e.serverServiceEndpoint$.pipe($e()).subscribe(i=>{this._networkStatus=i,this.isStorageServiceReady()}),e.serverVersion$.pipe($e()).subscribe(i=>{i&&(this.isAppDataSupported=dr(i,"1.27.0",">="))}),this.patchQueue$.pipe(kr(i=>this.patch(i)),$e()).subscribe(()=>{})}isStorageServiceReady(){this._networkStatus?.httpServiceUrl&&(this.serverEndpoint=this._networkStatus.httpServiceUrl.substring(0,this._networkStatus.httpServiceUrl.length-4)+"applicationData/"),this._networkStatus?.operation===2&&this._isLoggedIn&&this.serverEndpoint?(this.storageServiceReady$.next(!0),console.log(`[Remote Storage Service] Authenticated ${this._isLoggedIn} ,AppData API: ${this.serverEndpoint}`)):this.storageServiceReady$.next(!1)}ensureReady(){if(!this.storageServiceReady$.getValue())throw new Error("[StorageService] Not ready: storageServiceReady is false")}listConfigs(e){return P(this,null,function*(){this.ensureReady();let i=[];if(!this.serverEndpoint)return console.warn("[Storage Service] No server endpoint set. Cannot retrieve config list"),null;let o=this.serverEndpoint,n=e??this.configFileVersion,a=`${o}global/kip/${n}/?keys=true`,s=`${o}user/kip/${n}/?keys=true`;try{let l=yield N(this.http.get(a));for(let u of l)i.push({scope:"global",name:u});console.log("[Storage Service] Retrieved Global config list")}catch(l){this.handleError(l)}try{let l=yield N(this.http.get(s));for(let u of l)i.push({scope:"user",name:u});console.log("[Storage Service] Retrieved User config list")}catch(l){this.handleError(l)}return i})}getConfig(e,i,o,n){return P(this,null,function*(){this.ensureReady();let a=this.serverEndpoint+e+"/kip/",s=o??this.configFileVersion,l=a+s+"/"+i;this._logIO&&console.debug("[StorageService.getConfig]",{scope:e,configName:i,ver:s,url:l,isInitLoad:!!n});try{let u=yield N(this.http.get(l));if(this._logIO){let d=u&&typeof u=="object"?u?.app?.configVersion:void 0;console.debug("[StorageService.getConfig Response]",{scope:e,configName:i,ver:s,appConfigVersion:d})}else console.log(`[Storage Service] Retrieved config [${i}] from [${e}] scope`);return n&&(this.InitConfig=u),lr(u)}catch(u){return this.handleError(u),null}})}setConfig(e,i,o,n){return P(this,null,function*(){this.ensureReady();let a=this.serverEndpoint+e+"/kip/",s=n??this.configFileVersion,l=a+s+"/"+i;if(this._logIO){let u=o?.app?.configVersion;console.debug("[StorageService.setConfig]",{scope:e,configName:i,ver:s,url:l,appConfigVersion:u})}try{return yield N(this.http.post(l,o)),this._logIO?console.debug("[StorageService.setConfig Response]",{scope:e,configName:i,ver:s,url:l,status:"ok"}):console.log(`[Storage Service] Saved config [${i}] to [${e}] scope`),null}catch(u){return this.handleError(u),null}})}patchConfig(e,i,o){this.ensureReady();let n=o??this.configFileVersion,a=this.serverEndpoint+"user/kip/"+n,s;if(e==="IAppConfig"){let u=i?.configVersion;typeof u=="number"&&n===11&&u>11&&(this._logIO&&console.warn("[StorageService.patchConfig] Suppressing app.configVersion write into v11 file",{targetFileVersion:n,incomingAppConfigVersion:u}),i.configVersion=11)}switch(e){case"IAppConfig":s=[{op:"replace",path:`/${this.sharedConfigName}/app`,value:i}];break;case"IThemeConfig":s=[{op:"replace",path:`/${this.sharedConfigName}/theme/themeName`,value:i.themeName}];break;case"IWidgetConfig":s=[{op:"replace",path:`/${this.sharedConfigName}/widget`,value:i}];break;case"ILayoutConfig":s=[{op:"replace",path:`/${this.sharedConfigName}/layout`,value:i}];break;case"Dashboards":s=[{op:"replace",path:`/${this.sharedConfigName}/dashboards`,value:i}];break;case"Array<IUnitDefaults>":s=[{op:"replace",path:`/${this.sharedConfigName}/app/unitDefaults`,value:i}];break;case"Array<IDatasetDef>":s=[{op:"replace",path:`/${this.sharedConfigName}/app/dataSets`,value:i}];break;case"INotificationConfig":s=[{op:"replace",path:`/${this.sharedConfigName}/app/notificationConfig`,value:i}];break;default:console.warn("[Storage Service] JSON Patch request type unknown");break}let l={url:a,document:s};if(this._logIO){let u=e==="IAppConfig"?i?.configVersion:void 0;console.debug("[StorageService.patchConfig]",{ObjType:e,ver:n,url:a,appConfigVersionInValue:u,touchesConfigVersion:e==="IAppConfig"&&typeof u<"u"})}this.patchQueue$.next(l)}patchGlobal(e,i,o,n,a){this.ensureReady();let s=a??this.configFileVersion,l=this.serverEndpoint+i+"/kip/"+s,u;switch(n){case"add":u=[{op:"add",path:`/${e}`,value:o}];break;case"replace":u=[{op:"replace",path:`/${e}`,value:o}];break;case"remove":u=[{op:"remove",path:`/${e}`,value:o}];break;default:console.warn("[Storage Service] JSON Patch operation request type unknown");break}let d={url:l,document:u};if(this._logIO){let p=o?.app?.configVersion;console.debug("[StorageService.patchGlobal]",{scope:i,configName:e,operation:n,ver:s,url:l,appConfigVersionInValue:p})}this.patchQueue$.next(d)}removeItem(e,i,o){this.ensureReady();let n=this.serverEndpoint+e+"/kip/"+this.configFileVersion;o&&(n=this.serverEndpoint+e+"/kip/"+o);let a=[{op:"remove",path:`/${i}`}],s={url:n,document:a};this.patchQueue$.next(s)}clear(){this.ensureReady()}set activeConfigFileVersion(e){this.configFileVersion=e}handleError(e){throw e.status===0?console.error("[Storage Service] An error occurred:",e.error):console.error("[Storage Service] Backend returned error: ",e.message),e}get initConfig(){return this.InitConfig}static \u0275fac=function(i){return new(i||t)};static \u0275prov=D({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var se=class{static create(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(r){let e=Math.random()*16|0;return(r=="x"?e:e&3|8).toString(16)})}};var ze={disableNotifications:!1,menuGrouping:!0,security:{disableSecurity:!0},devices:{disableDevices:!1,showNormalState:!1,showNominalState:!1},sound:{disableSound:!1,muteNormal:!0,muteNominal:!0,muteWarn:!0,muteAlert:!1,muteAlarm:!1,muteEmergency:!1}};var Nt={Unitless:"unitless",Speed:"knots",Flow:"l/h",Temperature:"celsius",Length:"m",Volume:"liter",Current:"A",Potential:"V",Charge:"C",Power:"W",Energy:"J",Pressure:"mmHg","Fuel Distance":"nm/l","Energy Distance":"nm/kWh",Density:"kg/m3",Time:"Hours","Angular Velocity":"deg/min",Angle:"deg",Frequency:"Hz",Ratio:"ratio",Resistance:"ohm"};var Qo={configVersion:12,autoNightMode:!0,redNightMode:!1,nightModeBrightness:.27,isRemoteControl:!1,instanceName:"",dataSets:[],unitDefaults:Nt,notificationConfig:ze,splitShellEnabled:!0,splitShellSide:"left",splitShellSwipeDisabled:!1,splitShellWidth:.5},en={themeName:""};var tn={configVersion:12,kipUUID:se.create(),signalKUrl:null,proxyEnabled:!1,signalKSubscribeAll:!1,useDeviceToken:!1,loginName:null,loginPassword:null,useSharedConfig:!1,sharedConfigName:"default"};var pr={configVersion:12,autoNightMode:!1,redNightMode:!1,nightModeBrightness:.27,isRemoteControl:!1,instanceName:"",splitShellEnabled:!0,splitShellSide:"left",splitShellSwipeDisabled:!1,splitShellWidth:.7,dataSets:[{uuid:"339698a7-2cff-4ab9-9b50-d8056f971471",path:"self.environment.depth.belowTransducer",pathSource:"default",baseUnit:"m",timeScaleFormat:"minute",period:.2,label:"simple-chart-339698a7-2cff-4ab9-9b50-d8056f971471",editable:!1}],unitDefaults:{Unitless:"unitless",Speed:"knots",Flow:"l/h",Temperature:"celsius",Length:"m",Volume:"liter",Current:"A",Potential:"V",Charge:"C",Power:"W",Energy:"J",Pressure:"mmHg","Fuel Distance":"nm/l","Energy Distance":"nm/kWh",Density:"kg/m3",Time:"Hours","Angular Velocity":"deg/min",Angle:"deg",Frequency:"Hz",Ratio:"ratio",Resistance:"ohm"},notificationConfig:{disableNotifications:!1,menuGrouping:!0,security:{disableSecurity:!0},devices:{disableDevices:!1,showNormalState:!1,showNominalState:!1},sound:{disableSound:!1,muteNormal:!0,muteNominal:!0,muteWarn:!1,muteAlert:!1,muteAlarm:!1,muteEmergency:!1}}},hr=[{id:"3e0825ee-95fd-4ad4-8802-e0507845b668",name:"Sailing",icon:"dashboard-sailing",configuration:[{w:6,h:8,id:"339698a7-2cff-4ab9-9b50-d8056f971471",selector:"widget-host2",input:{widgetProperties:{type:"widget-numeric",uuid:"339698a7-2cff-4ab9-9b50-d8056f971471",config:{displayName:"Depth",filterSelfPaths:!0,paths:{numericPath:{description:"Numeric Data",path:"self.environment.depth.belowTransducer",source:"default",pathType:"number",isPathConfigurable:!0,convertUnitTo:"m",showPathSkUnitsFilter:!0,pathSkUnitsFilter:null,sampleTime:500}},showMax:!1,showMin:!1,numDecimal:1,showMiniChart:!0,yScaleMin:0,yScaleMax:100,inverseYAxis:!1,verticalChart:!1,color:"blue",enableTimeout:!1,dataTimeout:5,ignoreZones:!1}}},x:0,y:0},{w:10,h:20,id:"a44028e0-dfee-4492-895b-2b03a60f3a69",selector:"widget-host2",input:{widgetProperties:{type:"widget-wind-steer",uuid:"a44028e0-dfee-4492-895b-2b03a60f3a69",config:{filterSelfPaths:!0,paths:{headingPath:{description:"True Heading",path:"self.navigation.headingTrue",source:"default",pathType:"number",isPathConfigurable:!0,pathRequired:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",convertUnitTo:"deg",showConvertUnitTo:!1,sampleTime:500},appWindAngle:{description:"Apparent Wind Angle",path:"self.environment.wind.angleApparent",source:"default",pathType:"number",isPathConfigurable:!0,pathRequired:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",convertUnitTo:"deg",showConvertUnitTo:!1,sampleTime:500},appWindSpeed:{description:"Apparent Wind Speed",path:"self.environment.wind.speedApparent",source:"default",pathType:"number",isPathConfigurable:!0,pathRequired:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"m/s",convertUnitTo:"knots",sampleTime:500},trueWindAngle:{description:"True Wind Angle",path:"self.environment.wind.angleTrueWater",source:"default",pathType:"number",isPathConfigurable:!0,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",convertUnitTo:"deg",showConvertUnitTo:!1,sampleTime:500},trueWindSpeed:{description:"True Wind Speed",path:"self.environment.wind.speedTrue",source:"default",pathType:"number",isPathConfigurable:!0,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"m/s",convertUnitTo:"knots",sampleTime:500},courseOverGround:{description:"True Course Over Ground",path:"self.navigation.courseOverGroundTrue",source:"default",pathType:"number",isPathConfigurable:!0,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",showConvertUnitTo:!1,convertUnitTo:"deg",sampleTime:500},nextWaypointBearing:{description:"Next Waypoint True Bearing",path:"self.navigation.courseGreatCircle.nextPoint.bearingTrue",source:"default",pathType:"number",isPathConfigurable:!1,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",convertUnitTo:"deg",showConvertUnitTo:!1,sampleTime:500},set:{description:"True Drift Set",path:"self.environment.current.setTrue",source:"default",pathType:"number",isPathConfigurable:!0,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",convertUnitTo:"deg",showConvertUnitTo:!1,sampleTime:500},drift:{description:"Drift Speed Impact",path:"self.environment.current.drift",source:"default",pathType:"number",isPathConfigurable:!0,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"m/s",convertUnitTo:"knots",sampleTime:500}},windSectorEnable:!0,windSectorWindowSeconds:5,laylineEnable:!0,laylineAngle:40,waypointEnable:!0,courseOverGroundEnable:!0,driftEnable:!0,awsEnable:!0,twsEnable:!0,twaEnable:!0,sailSetupEnable:!1,enableTimeout:!1,dataTimeout:5}}},x:6,y:0},{w:8,h:12,id:"24406c15-7738-4dc1-a206-7a4862c2931d",selector:"widget-host2",input:{widgetProperties:{type:"widget-gauge-ng-radial",uuid:"24406c15-7738-4dc1-a206-7a4862c2931d",config:{displayName:"SOG",filterSelfPaths:!0,paths:{gaugePath:{description:"Numeric Data",path:"self.navigation.speedOverGround",source:"default",pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!0,pathSkUnitsFilter:null,convertUnitTo:"knots",sampleTime:500}},displayScale:{lower:0,upper:10,type:"linear"},gauge:{type:"ngRadial",subType:"measuring",enableTicks:!0,enableNeedle:!0,enableProgressbar:!0,highlightsWidth:5,scaleStart:180,barStartPosition:"left"},numInt:1,numDecimal:1,enableTimeout:!1,color:"yellow",dataTimeout:5,ignoreZones:!1}}},x:16,y:0},{w:6,h:8,id:"c6bcaa53-afa1-42c7-ad92-d5f7dba14734",selector:"widget-host2",input:{widgetProperties:{type:"widget-numeric",uuid:"c6bcaa53-afa1-42c7-ad92-d5f7dba14734",config:{displayName:"STW",filterSelfPaths:!0,paths:{numericPath:{description:"Numeric Data",path:"self.navigation.speedThroughWater",source:"default",pathType:"number",isPathConfigurable:!0,convertUnitTo:"knots",showPathSkUnitsFilter:!0,pathSkUnitsFilter:null,sampleTime:500}},showMax:!0,showMin:!0,numDecimal:1,showMiniChart:!1,yScaleMin:0,yScaleMax:10,inverseYAxis:!1,verticalChart:!1,color:"contrast",enableTimeout:!1,dataTimeout:5,ignoreZones:!1}}},x:0,y:8},{w:8,h:12,id:"973c8804-be09-4923-bb5d-48c13b65db69",selector:"widget-host2",input:{widgetProperties:{type:"widget-data-chart",uuid:"973c8804-be09-4923-bb5d-48c13b65db69",config:{displayName:"Chart Label",filterSelfPaths:!0,datachartPath:"self.environment.wind.speedApparent",datachartSource:"default",period:1,timeScale:"minute",convertUnitTo:"knots",timeScaleFormat:"minute",inverseYAxis:!1,datasetAverageArray:"sma",showAverageData:!0,trackAgainstAverage:!1,showDatasetMinimumValueLine:!1,showDatasetMaximumValueLine:!1,showDatasetAverageValueLine:!0,showDatasetAngleAverageValueLine:!1,showLabel:!1,showTimeScale:!0,startScaleAtZero:!1,verticalChart:!1,showYScale:!0,yScaleSuggestedMin:null,yScaleSuggestedMax:null,enableMinMaxScaleLimit:!1,yScaleMin:null,yScaleMax:null,numDecimal:1,color:"orange",invertData:!1,verticalGraph:!1}}},x:16,y:12},{x:0,y:16,w:6,h:8,minW:1,minH:1,id:"5289a84d-18fd-4ee7-9724-72249af403f2",selector:"widget-host2",input:{widgetProperties:{type:"widget-position",uuid:"5289a84d-18fd-4ee7-9724-72249af403f2",config:{displayName:"Position",filterSelfPaths:!0,paths:{longPath:{description:"Longitude",path:"self.navigation.position.longitude",source:"default",pathType:"number",isPathConfigurable:!0,convertUnitTo:"longitudeMin",showPathSkUnitsFilter:!0,pathSkUnitsFilter:null,sampleTime:500},latPath:{description:"Latitude",path:"self.navigation.position.latitude",source:"default",pathType:"number",isPathConfigurable:!0,convertUnitTo:"latitudeMin",showPathSkUnitsFilter:!0,pathSkUnitsFilter:null,sampleTime:500}},color:"grey",enableTimeout:!1,dataTimeout:5}}}},{w:10,h:4,id:"1a7a3f79-2eb4-4092-a0c3-9a61db8a8586",selector:"widget-host2",input:{widgetProperties:{type:"widget-simple-linear",uuid:"1a7a3f79-2eb4-4092-a0c3-9a61db8a8586",config:{displayName:"House Bank",filterSelfPaths:!0,paths:{gaugePath:{description:"Numeric Data",path:"self.electrical.batteries.1.voltage",source:"default",pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!0,pathSkUnitsFilter:"V",convertUnitTo:"V",sampleTime:500}},displayScale:{lower:0,upper:15,type:"linear"},gauge:{type:"simpleLinear",unitLabelFormat:"full"},numInt:1,numDecimal:2,ignoreZones:!1,color:"green",enableTimeout:!1,dataTimeout:5}}},x:6,y:20}],collapseSplitShell:!0},{id:"7c67c8c5-dc55-4e1d-9fc5-3dd95fd41bea",name:"Charting",icon:"dashboard-map",configuration:[{x:0,y:0,w:12,h:6,id:"26a2a150-5af8-4f1d-aaab-0cb2a406fc17",selector:"widget-host2",input:{widgetProperties:{type:"widget-gauge-ng-compass",uuid:"26a2a150-5af8-4f1d-aaab-0cb2a406fc17",config:{displayName:"COG (T)",filterSelfPaths:!0,paths:{gaugePath:{description:"Numeric Data",path:"self.navigation.courseOverGroundTrue",source:"default",pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",showConvertUnitTo:!1,convertUnitTo:"deg",sampleTime:500}},gauge:{type:"ngRadial",subType:"marineCompass",enableTicks:!0,compassUseNumbers:!0,showValueBox:!1},enableTimeout:!1,color:"purple",dataTimeout:5}}}},{x:12,y:0,w:12,h:6,id:"caf9ca47-fcf6-4736-a314-2b5210edaf03",selector:"widget-host2",input:{widgetProperties:{type:"widget-datetime",uuid:"caf9ca47-fcf6-4736-a314-2b5210edaf03",config:{displayName:"Next WP Arrival",filterSelfPaths:!0,paths:{gaugePath:{description:"String Data",path:"self.navigation.datetime",source:"default",pathType:"Date",isPathConfigurable:!0,sampleTime:500}},dateFormat:"dd/MM HH:mm",dateTimezone:"America/Toronto",color:"contrast",enableTimeout:!1,dataTimeout:5}}}},{x:0,y:6,w:24,h:18,id:"daa21350-009e-4d99-8209-364f9b99caee",selector:"widget-host2",input:{widgetProperties:{type:"widget-autopilot",uuid:"daa21350-009e-4d99-8209-364f9b99caee",config:{filterSelfPaths:!0,paths:{autopilotState:{description:"Autopilot State",path:"self.steering.autopilot.state",source:"default",pathType:"string",isPathConfigurable:!1,showPathSkUnitsFilter:!1,convertUnitTo:"",sampleTime:500},autopilotMode:{description:"Autopilot Mode",path:"self.steering.autopilot.mode",source:"default",pathType:"string",isPathConfigurable:!1,showPathSkUnitsFilter:!1,convertUnitTo:"",sampleTime:500},autopilotEngaged:{description:"Autopilot Engaged",path:"self.steering.autopilot.engaged",source:"default",pathType:"boolean",isPathConfigurable:!1,showPathSkUnitsFilter:!1,convertUnitTo:"",sampleTime:500},autopilotV2Target:{description:"Autopilot API v2 Target",path:"self.steering.autopilot.target",source:"default",pathType:"number",convertUnitTo:"deg",isPathConfigurable:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",sampleTime:500},autopilotTargetHeading:{description:"Autopilot Target Magnetic Heading",path:"self.steering.autopilot.target.headingMagnetic",source:"default",pathType:"number",convertUnitTo:"deg",isPathConfigurable:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",sampleTime:500},autopilotTargetWindHeading:{description:"Autopilot Target Apparent Wind Angle",path:"self.steering.autopilot.target.windAngleApparent",source:"default",pathType:"number",convertUnitTo:"deg",isPathConfigurable:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",sampleTime:500},rudderAngle:{description:"Rudder Angle",path:"self.steering.rudderAngle",source:"default",pathType:"number",convertUnitTo:"deg",isPathConfigurable:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",sampleTime:500},courseXte:{description:"Cross Track Error",path:"self.navigation.course.calcValues.crossTrackError",source:"default",pathType:"number",isPathConfigurable:!1,convertUnitTo:"m",showPathSkUnitsFilter:!0,pathRequired:!1,pathSkUnitsFilter:"m",sampleTime:500},headingMag:{description:"Magnetic Heading",path:"self.navigation.headingMagnetic",source:"default",pathType:"number",convertUnitTo:"deg",isPathConfigurable:!0,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",showConvertUnitTo:!1,sampleTime:500},headingTrue:{description:"True Heading",path:"self.navigation.headingTrue",source:"default",pathType:"number",convertUnitTo:"deg",isPathConfigurable:!0,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",showConvertUnitTo:!1,sampleTime:500},windAngleApparent:{description:"Apparent Wind Angle",path:"self.environment.wind.angleApparent",source:"default",pathType:"number",convertUnitTo:"deg",isPathConfigurable:!0,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",showConvertUnitTo:!1,sampleTime:500},windAngleTrueWater:{description:"Wind Angle True Water",path:"self.environment.wind.angleTrueWater",source:"default",pathType:"number",convertUnitTo:"deg",isPathConfigurable:!0,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",showConvertUnitTo:!1,sampleTime:500}},autopilot:{invertRudder:!0,headingDirectionTrue:!1,courseDirectionTrue:!1,apiVersion:null,instanceId:null,pluginId:null,modes:null},enableTimeout:!1,dataTimeout:5,invertRudder:!0,headingDirectionTrue:!1,courseDirectionTrue:!1,autopilotInstance:"_default"}}}}]}],gr={themeName:""};var DS={configVersion:12,kipUUID:se.create(),signalKUrl:"https://demo.signalk.org",proxyEnabled:!1,signalKSubscribeAll:!1,useDeviceToken:!1,loginName:null,loginPassword:null,useSharedConfig:!1,sharedConfigName:"default"};var Sf="",Cf=11,Je=12,US=(()=>{class t{storage=F(Xo);unitDefaults=new v({});themeName=new v(Sf);kipKNotificationConfig=new v(ze);autoNightMode=new v(!1);redNightMode=new v(!1);nightModeBrightness=new v(1);isRemoteControl=new v(!1);instanceName=new v("");splitShellEnabled=new v(!1);splitShellSide=new v("left");splitShellSwipeDisabled=new v(!1);splitShellWidth=new v(.5);proxyEnabled=!1;signalKSubscribeAll=!1;useDeviceToken=!1;loginName;loginPassword;useSharedConfig;sharedConfigName;activeConfig={app:null,theme:null,dashboards:null};kipUUID;signalkUrl;widgets;_dashboards=[];dataSets=[];configUpgrade=Q(!1);constructor(){if(console.log("[AppSettings Service] Service startup..."),this.storage.activeConfigFileVersion=Cf,!window.localStorage)console.error(`[AppSettings Service] LocalStorage NOT SUPPORTED by browser
|
|
2
|
-
This is a requirement to run Kip. See browser documentation to enable this feature.`);else if(this.loadConnectionConfig(),this.useSharedConfig)this.storage.initConfig===null&&this.loginName!==null&&this.loginPassword!==null&&this.signalkUrl.url!==null?this.checkConfigFileVersionUpgradeRequired().then(e=>{e?this.configUpgrade.set(!0):this.resetSettings()}):(console.log("[AppSettings Service] Remote configuration storage enabled"),this.checkConfigUpgradeRequired(!1,this.storage.initConfig.app?.configVersion),this.activeConfig=this.storage.initConfig,this.pushSettings());else{console.log("[AppSettings Service] LocalStorage enabled");let e={app:null,theme:null,dashboards:null};e.app=this.loadConfigFromLocalStorage("appConfig"),this.checkConfigUpgradeRequired(!0,e.app?.configVersion),e.dashboards=this.loadConfigFromLocalStorage("dashboardsConfig"),e.theme=this.loadConfigFromLocalStorage("themeConfig"),this.activeConfig=e,this.pushSettings()}}loadConnectionConfig(){let e=this.loadConfigFromLocalStorage("connectionConfig");switch(e.configVersion){case 11:break;case 12:break;default:console.error(`[AppSettings Service] Invalid connectionConfig version ${e.configVersion}. Resetting and loading connection configuration default`),this.resetConnection();break}this.signalkUrl={url:e.signalKUrl,new:!1},this.proxyEnabled=e.proxyEnabled,this.signalKSubscribeAll=e.signalKSubscribeAll,this.useDeviceToken=e.useDeviceToken,this.loginName=e.loginName,this.loginPassword=e.loginPassword,this.useSharedConfig=e.useSharedConfig,this.sharedConfigName=e.sharedConfigName,this.kipUUID=e.kipUUID}resetConnection(){localStorage.setItem("connectionConfig",JSON.stringify(this.getDefaultConnectionConfig())),this.reloadApp()}checkConfigFileVersionUpgradeRequired(){return P(this,null,function*(){let e=yield this.storage.listConfigs(9);try{let i=!1;for(let o of e){let n=yield this.storage.getConfig(o.scope,o.name,9);try{if(n.app?.configVersion===10){i=!0,console.log("[AppSettings Service] Configuration upgrade required for version 10.");break}}catch(a){console.error(`[AppSettings Service] Error fetching configuration for ${o.name}:`,a);break}}return i}catch(i){return console.error("[AppSettings Service] Error fetching configuration data:",i),!1}})}checkConfigUpgradeRequired(e,i){if(i!==Je&&i===11){this.configUpgrade.set(!0);return}}loadConfigFromLocalStorage(e){let i=JSON.parse(localStorage.getItem(e));if(i===null)switch(console.log(`[AppSettings Service] Error loading ${e} config. Force loading ${e} defaults`),e){case"appConfig":i=this.getDefaultAppConfig();break;case"connectionConfig":i=this.getDefaultConnectionConfig();break;case"dashboardsConfig":i=this.getDefaultDashboardsConfig();break;case"themeConfig":i=this.getDefaultThemeConfig();break;default:console.error(`[AppSettings Service] Invalid ${e} default config requested`);break}if(e==="connectionConfig"&&i.configVersion!==Je)switch(console.log(`[AppSettings Service] Invalid ${e} version. Force loading defaults`),e){case"connectionConfig":i=this.getDefaultConnectionConfig();break}return i}pushSettings(){this.themeName.next(this.activeConfig.theme.themeName),this.dataSets=this.activeConfig.app.dataSets,this.unitDefaults.next(this.activeConfig.app.unitDefaults),this.kipKNotificationConfig.next(this.activeConfig.app.notificationConfig),this.activeConfig.app.autoNightMode===void 0?this.setAutoNightMode(!1):this.autoNightMode.next(this.activeConfig.app.autoNightMode),this.activeConfig.app.redNightMode===void 0?this.setRedNightMode(!1):this.redNightMode.next(this.activeConfig.app.redNightMode),this.activeConfig.app.nightModeBrightness===void 0?this.setNightModeBrightness(.2):this.nightModeBrightness.next(this.activeConfig.app.nightModeBrightness),this.activeConfig.dashboards===void 0?this._dashboards=[]:this._dashboards=this.activeConfig.dashboards,this.activeConfig.app.isRemoteControl===void 0?this.setIsRemoteControl(!1):this.isRemoteControl.next(this.activeConfig.app.isRemoteControl),this.activeConfig.app.instanceName===void 0?this.setInstanceName(""):this.instanceName.next(this.activeConfig.app.instanceName),this.activeConfig.app.splitShellEnabled===void 0?this.setSplitShellEnabled(!1):this.splitShellEnabled.next(this.activeConfig.app.splitShellEnabled),this.activeConfig.app.splitShellSide===void 0?this.setSplitShellSide("left"):this.splitShellSide.next(this.activeConfig.app.splitShellSide),this.activeConfig.app.splitShellSwipeDisabled===void 0?this.setSplitShellSwipeDisabled(!1):this.splitShellSwipeDisabled.next(this.activeConfig.app.splitShellSwipeDisabled),this.activeConfig.app.splitShellWidth===void 0?this.setSplitShellWidth(.5):this.splitShellWidth.next(this.activeConfig.app.splitShellWidth)}getDefaultUnitsAsO(){return this.unitDefaults.asObservable()}getDefaultUnits(){return this.unitDefaults.getValue()}setDefaultUnits(e){this.unitDefaults.next(e),this.useSharedConfig?this.storage.patchConfig("Array<IUnitDefaults>",e):this.saveAppConfigToLocalStorage()}getConfigVersion(){return this.activeConfig.app?.configVersion??void 0}getAppConfig(){return this.buildAppStorageObject()}getConnectionConfig(){return this.buildConnectionStorageObject()}setConnectionConfig(e){this.loginName=e.loginName,this.loginPassword=e.loginPassword,this.useSharedConfig=e.useSharedConfig,this.proxyEnabled=e.proxyEnabled,this.signalKSubscribeAll=e.signalKSubscribeAll,this.signalkUrl.url=e.signalKUrl,e.useSharedConfig?this.useDeviceToken=!1:this.useDeviceToken=!0,this.saveConnectionConfigToLocalStorage()}setUseDeviceToken(e){this.useDeviceToken=e,this.saveConnectionConfigToLocalStorage()}getDashboardConfig(){return this.buildDashboardStorageObject()}getThemeConfig(){return this.buildThemeStorageObject()}get KipUUID(){return this.kipUUID}getThemeNameAsO(){return this.themeName.asObservable()}setThemeName(e){if(this.themeName.next(e),this.useSharedConfig){let i={themeName:e};this.storage.patchConfig("IThemeConfig",i)}else this.saveThemeConfigToLocalStorage()}getThemeName(){return this.themeName.getValue()}getAutoNightModeAsO(){return this.autoNightMode.asObservable()}setAutoNightMode(e){this.autoNightMode.next(e);let i=this.buildAppStorageObject();this.useSharedConfig?this.storage.patchConfig("IAppConfig",i):this.saveAppConfigToLocalStorage()}getAutoNightMode(){return this.autoNightMode.getValue()}getRedNightModeAsO(){return this.redNightMode.asObservable()}getRedNightMode(){return this.redNightMode.getValue()}setRedNightMode(e){this.redNightMode.next(e);let i=this.buildAppStorageObject();this.useSharedConfig?this.storage.patchConfig("IAppConfig",i):this.saveAppConfigToLocalStorage()}getIsRemoteControlAsO(){return this.isRemoteControl.asObservable()}getIsRemoteControl(){return this.isRemoteControl.getValue()}setIsRemoteControl(e){this.isRemoteControl.next(e);let i=this.buildAppStorageObject();this.useSharedConfig?this.storage.patchConfig("IAppConfig",i):this.saveAppConfigToLocalStorage()}getInstanceNameAsO(){return this.instanceName.asObservable()}getInstanceName(){return this.instanceName.getValue()}setInstanceName(e){this.instanceName.next(e);let i=this.buildAppStorageObject();this.useSharedConfig?this.storage.patchConfig("IAppConfig",i):this.saveAppConfigToLocalStorage()}getSplitShellEnabledAsO(){return this.splitShellEnabled.asObservable()}getSplitShellEnabled(){return this.splitShellEnabled.getValue()}setSplitShellEnabled(e){this.splitShellEnabled.next(e);let i=this.buildAppStorageObject();this.useSharedConfig?this.storage.patchConfig("IAppConfig",i):this.saveAppConfigToLocalStorage()}getSplitShellSideAsO(){return this.splitShellSide.asObservable()}getSplitShellSide(){return this.splitShellSide.getValue()}setSplitShellSide(e){this.splitShellSide.next(e);let i=this.buildAppStorageObject();this.useSharedConfig?this.storage.patchConfig("IAppConfig",i):this.saveAppConfigToLocalStorage()}getSplitShellSwipeDisabledAsO(){return this.splitShellSwipeDisabled.asObservable()}getSplitShellSwipeDisabled(){return this.splitShellSwipeDisabled.getValue()}setSplitShellSwipeDisabled(e){this.splitShellSwipeDisabled.next(e);let i=this.buildAppStorageObject();this.useSharedConfig?this.storage.patchConfig("IAppConfig",i):this.saveAppConfigToLocalStorage()}getSplitShellWidthAsO(){return this.splitShellWidth.asObservable()}getSplitShellWidth(){return this.splitShellWidth.getValue()}setSplitShellWidth(e){let i=Math.min(.9,Math.max(.1,e));this.splitShellWidth.next(i);let o=this.buildAppStorageObject();this.useSharedConfig?this.storage.patchConfig("IAppConfig",o):this.saveAppConfigToLocalStorage()}getNightModeBrightness(){return this.nightModeBrightness.getValue()}setNightModeBrightness(e){this.nightModeBrightness.next(e);let i=this.buildAppStorageObject();this.useSharedConfig?this.storage.patchConfig("IAppConfig",i):this.saveAppConfigToLocalStorage()}getWidgets(){return this.widgets}saveDashboards(e){this.useSharedConfig?this.storage.storageServiceReady$.getValue()&&this.storage.patchConfig("Dashboards",e):this.saveLDashboardsConfigToLocalStorage(e),this._dashboards=e}saveDataSets(e){this.dataSets=e,this.useSharedConfig?this.storage.patchConfig("Array<IDatasetDef>",e):this.saveAppConfigToLocalStorage()}getDataSets(){return this.dataSets}getNotificationServiceConfigAsO(){return this.kipKNotificationConfig.asObservable()}getNotificationConfig(){return this.kipKNotificationConfig.getValue()}setNotificationConfig(e){this.kipKNotificationConfig.next(e),this.useSharedConfig?this.storage.patchConfig("INotificationConfig",e):this.saveAppConfigToLocalStorage()}resetSettings(){let e={app:null,theme:null,dashboards:null};e.app=this.getDefaultAppConfig(),e.theme=this.getDefaultThemeConfig(),e.dashboards=this.getDefaultDashboardsConfig(),this.useSharedConfig?this.storage.storageServiceReady$.getValue()&&this.storage.setConfig("user",this.sharedConfigName,e).then(()=>{console.log("[AppSettings Service] Replaced server config name: "+this.sharedConfigName+", with default configuration values"),this.reloadApp()}).catch(i=>{console.error("[AppSettings Service] Error replacing server config name: "+this.sharedConfigName+", with default configuration values",i)}):this.reloadApp()}replaceConfig(e,i,o){let n=JSON.stringify(i);localStorage.setItem(e,n),o&&this.reloadApp()}loadDemoConfig(){if(this.useSharedConfig){let e={app:pr,dashboards:hr,theme:gr};console.log("[AppSettings Service] Loading Demo configuration settings as remote config: "+this.useSharedConfig+" and reloading app."),this.storage.setConfig("user",this.sharedConfigName,e),this.reloadApp()}else console.log("[AppSettings Service] Loading Demo configuration settings to LocalStorage"),this.replaceConfig("appConfig",pr),this.replaceConfig("dashboardsConfig",hr),this.replaceConfig("themeConfig",gr,!0)}reloadApp(){console.log("[AppSettings Service] Reload app"),!window.__KIP_TEST__&&location.replace("./")}buildAppStorageObject(){return{configVersion:Je,autoNightMode:this.autoNightMode.getValue(),redNightMode:this.redNightMode.getValue(),nightModeBrightness:this.nightModeBrightness.getValue(),isRemoteControl:this.isRemoteControl.getValue(),instanceName:this.instanceName.getValue(),dataSets:this.dataSets,unitDefaults:this.unitDefaults.getValue(),notificationConfig:this.kipKNotificationConfig.getValue(),splitShellEnabled:this.splitShellEnabled.getValue(),splitShellSide:this.splitShellSide.getValue()??"right",splitShellWidth:this.splitShellWidth.getValue()??.5,splitShellSwipeDisabled:this.splitShellSwipeDisabled.getValue()}}buildConnectionStorageObject(){return{configVersion:Je,kipUUID:this.kipUUID,signalKUrl:this.signalkUrl.url,proxyEnabled:this.proxyEnabled,signalKSubscribeAll:this.signalKSubscribeAll,useDeviceToken:this.useDeviceToken,loginName:this.loginName,loginPassword:this.loginPassword,useSharedConfig:this.useSharedConfig,sharedConfigName:this.sharedConfigName}}buildDashboardStorageObject(){return this._dashboards}buildThemeStorageObject(){return{themeName:this.themeName.getValue()}}saveAppConfigToLocalStorage(){console.log("[AppSettings Service] Saving Application config to LocalStorage"),localStorage.setItem("appConfig",JSON.stringify(this.buildAppStorageObject()))}saveConnectionConfigToLocalStorage(){console.log("[AppSettings Service] Saving Connection config to LocalStorage"),localStorage.setItem("connectionConfig",JSON.stringify(this.buildConnectionStorageObject()))}saveLDashboardsConfigToLocalStorage(e){console.log("[AppSettings Service] Saving Dashboard config to LocalStorage"),localStorage.setItem("dashboardsConfig",JSON.stringify(e))}saveThemeConfigToLocalStorage(){console.log("[AppSettings Service] Saving Theme config to LocalStorage"),localStorage.setItem("themeConfig",JSON.stringify(this.buildThemeStorageObject()))}getDefaultAppConfig(){let e=Qo;return e.notificationConfig=ze,e.unitDefaults=Nt,e.configVersion=Je,localStorage.setItem("appConfig",JSON.stringify(e)),e}getDefaultConnectionConfig(){let e=tn;return e.kipUUID=se.create(),e.signalKUrl=window.location.origin,localStorage.setItem("connectionConfig",JSON.stringify(e)),e}getDefaultDashboardsConfig(){let e=[];return localStorage.setItem("dashboardsConfig",JSON.stringify(e)),e}getDefaultThemeConfig(){let e=en;return localStorage.setItem("themeConfig",JSON.stringify(e)),e}static \u0275fac=function(i){return new(i||t)};static \u0275prov=D({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var fn=(()=>{class t{_renderer;_elementRef;onChange=e=>{};onTouched=()=>{};constructor(e,i){this._renderer=e,this._elementRef=i}setProperty(e,i){this._renderer.setProperty(this._elementRef.nativeElement,e,i)}registerOnTouched(e){this.onTouched=e}registerOnChange(e){this.onChange=e}setDisabledState(e){this.setProperty("disabled",e)}static \u0275fac=function(i){return new(i||t)(f(er),f(Qt))};static \u0275dir=y({type:t})}return t})(),dn=(()=>{class t extends fn{static \u0275fac=(()=>{let e;return function(o){return(e||(e=G(t)))(o||t)}})();static \u0275dir=y({type:t,features:[S]})}return t})(),rt=new ce("");var _f={provide:rt,useExisting:E(()=>pn),multi:!0};function xf(){let t=ir()?ir().getUserAgent():"";return/android (\d+)/.test(t.toLowerCase())}var wf=new ce(""),pn=(()=>{class t extends fn{_compositionMode;_composing=!1;constructor(e,i,o){super(e,i),this._compositionMode=o,this._compositionMode==null&&(this._compositionMode=!xf())}writeValue(e){let i=e??"";this.setProperty("value",i)}_handleInput(e){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(e)}_compositionStart(){this._composing=!0}_compositionEnd(e){this._composing=!1,this._compositionMode&&this.onChange(e)}static \u0275fac=function(i){return new(i||t)(f(er),f(Qt),f(wf,8))};static \u0275dir=y({type:t,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(i,o){i&1&&Le("input",function(a){return o._handleInput(a.target.value)})("blur",function(){return o.onTouched()})("compositionstart",function(){return o._compositionStart()})("compositionend",function(a){return o._compositionEnd(a.target.value)})},standalone:!1,features:[I([_f]),S]})}return t})();function br(t){return t==null||Sr(t)===0}function Sr(t){return t==null?null:Array.isArray(t)||typeof t=="string"?t.length:t instanceof Set?t.size:null}var $=new ce(""),pe=new ce(""),Tf=/^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,rn=class{static min(r){return hn(r)}static max(r){return gn(r)}static required(r){return mn(r)}static requiredTrue(r){return Af(r)}static email(r){return Df(r)}static minLength(r){return Vf(r)}static maxLength(r){return Mf(r)}static pattern(r){return vn(r)}static nullValidator(r){return Ut()}static compose(r){return xn(r)}static composeAsync(r){return wn(r)}};function hn(t){return r=>{if(r.value==null||t==null)return null;let e=parseFloat(r.value);return!isNaN(e)&&e<t?{min:{min:t,actual:r.value}}:null}}function gn(t){return r=>{if(r.value==null||t==null)return null;let e=parseFloat(r.value);return!isNaN(e)&&e>t?{max:{max:t,actual:r.value}}:null}}function mn(t){return br(t.value)?{required:!0}:null}function Af(t){return t.value===!0?null:{required:!0}}function Df(t){return br(t.value)||Tf.test(t.value)?null:{email:!0}}function Vf(t){return r=>{let e=r.value?.length??Sr(r.value);return e===null||e===0?null:e<t?{minlength:{requiredLength:t,actualLength:e}}:null}}function Mf(t){return r=>{let e=r.value?.length??Sr(r.value);return e!==null&&e>t?{maxlength:{requiredLength:t,actualLength:e}}:null}}function vn(t){if(!t)return Ut;let r,e;return typeof t=="string"?(e="",t.charAt(0)!=="^"&&(e+="^"),e+=t,t.charAt(t.length-1)!=="$"&&(e+="$"),r=new RegExp(e)):(e=t.toString(),r=t),i=>{if(br(i.value))return null;let o=i.value;return r.test(o)?null:{pattern:{requiredPattern:e,actualValue:o}}}}function Ut(t){return null}function yn(t){return t!=null}function bn(t){return Nr(t)?Er(t):t}function Sn(t){let r={};return t.forEach(e=>{r=e!=null?k(k({},r),e):r}),Object.keys(r).length===0?null:r}function Cn(t,r){return r.map(e=>e(t))}function Ef(t){return!t.validate}function _n(t){return t.map(r=>Ef(r)?r:e=>r.validate(e))}function xn(t){if(!t)return null;let r=t.filter(yn);return r.length==0?null:function(e){return Sn(Cn(e,r))}}function Cr(t){return t!=null?xn(_n(t)):null}function wn(t){if(!t)return null;let r=t.filter(yn);return r.length==0?null:function(e){let i=Cn(e,r).map(bn);return Or(i).pipe(Ir(Sn))}}function _r(t){return t!=null?wn(_n(t)):null}function on(t,r){return t===null?[r]:Array.isArray(t)?[...t,r]:[t,r]}function Tn(t){return t._rawValidators}function An(t){return t._rawAsyncValidators}function mr(t){return t?Array.isArray(t)?t:[t]:[]}function jt(t,r){return Array.isArray(t)?t.includes(r):t===r}function nn(t,r){let e=mr(r);return mr(t).forEach(o=>{jt(e,o)||e.push(o)}),e}function an(t,r){return mr(r).filter(e=>!jt(t,e))}var Lt=class{get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators=[];_rawAsyncValidators=[];_setValidators(r){this._rawValidators=r||[],this._composedValidatorFn=Cr(this._rawValidators)}_setAsyncValidators(r){this._rawAsyncValidators=r||[],this._composedAsyncValidatorFn=_r(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_onDestroyCallbacks=[];_registerOnDestroy(r){this._onDestroyCallbacks.push(r)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(r=>r()),this._onDestroyCallbacks=[]}reset(r=void 0){this.control&&this.control.reset(r)}hasError(r,e){return this.control?this.control.hasError(r,e):!1}getError(r,e){return this.control?this.control.getError(r,e):null}},V=class extends Lt{name;get formDirective(){return null}get path(){return null}},X=class extends Lt{_parent=null;name=null;valueAccessor=null},$t=class{_cd;constructor(r){this._cd=r}get isTouched(){return this._cd?.control?._touched?.(),!!this._cd?.control?.touched}get isUntouched(){return!!this._cd?.control?.untouched}get isPristine(){return this._cd?.control?._pristine?.(),!!this._cd?.control?.pristine}get isDirty(){return!!this._cd?.control?.dirty}get isValid(){return this._cd?.control?._status?.(),!!this._cd?.control?.valid}get isInvalid(){return!!this._cd?.control?.invalid}get isPending(){return!!this._cd?.control?.pending}get isSubmitted(){return this._cd?._submitted?.(),!!this._cd?.submitted}},If={"[class.ng-untouched]":"isUntouched","[class.ng-touched]":"isTouched","[class.ng-pristine]":"isPristine","[class.ng-dirty]":"isDirty","[class.ng-valid]":"isValid","[class.ng-invalid]":"isInvalid","[class.ng-pending]":"isPending"},sC=j(k({},If),{"[class.ng-submitted]":"isSubmitted"}),lC=(()=>{class t extends $t{constructor(e){super(e)}static \u0275fac=function(i){return new(i||t)(f(X,2))};static \u0275dir=y({type:t,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(i,o){i&2&&tr("ng-untouched",o.isUntouched)("ng-touched",o.isTouched)("ng-pristine",o.isPristine)("ng-dirty",o.isDirty)("ng-valid",o.isValid)("ng-invalid",o.isInvalid)("ng-pending",o.isPending)},standalone:!1,features:[S]})}return t})(),uC=(()=>{class t extends $t{constructor(e){super(e)}static \u0275fac=function(i){return new(i||t)(f(V,10))};static \u0275dir=y({type:t,selectors:[["","formGroupName",""],["","formArrayName",""],["","ngModelGroup",""],["","formGroup",""],["form",3,"ngNoForm",""],["","ngForm",""]],hostVars:16,hostBindings:function(i,o){i&2&&tr("ng-untouched",o.isUntouched)("ng-touched",o.isTouched)("ng-pristine",o.isPristine)("ng-dirty",o.isDirty)("ng-valid",o.isValid)("ng-invalid",o.isInvalid)("ng-pending",o.isPending)("ng-submitted",o.isSubmitted)},standalone:!1,features:[S]})}return t})();var Ze="VALID",Rt="INVALID",Pe="PENDING",Ye="DISABLED",le=class{},Wt=class extends le{value;source;constructor(r,e){super(),this.value=r,this.source=e}},Qe=class extends le{pristine;source;constructor(r,e){super(),this.pristine=r,this.source=e}},et=class extends le{touched;source;constructor(r,e){super(),this.touched=r,this.source=e}},Fe=class extends le{status;source;constructor(r,e){super(),this.status=r,this.source=e}},Bt=class extends le{source;constructor(r){super(),this.source=r}},Ht=class extends le{source;constructor(r){super(),this.source=r}};function xr(t){return(zt(t)?t.validators:t)||null}function Of(t){return Array.isArray(t)?Cr(t):t||null}function wr(t,r){return(zt(r)?r.asyncValidators:t)||null}function kf(t){return Array.isArray(t)?_r(t):t||null}function zt(t){return t!=null&&!Array.isArray(t)&&typeof t=="object"}function Dn(t,r,e){let i=t.controls;if(!(r?Object.keys(i):i).length)throw new st(1e3,"");if(!i[e])throw new st(1001,"")}function Vn(t,r,e){t._forEachChild((i,o)=>{if(e[o]===void 0)throw new st(1002,"")})}var Re=class{_pendingDirty=!1;_hasOwnPendingAsyncValidator=null;_pendingTouched=!1;_onCollectionChange=()=>{};_updateOn;_parent=null;_asyncValidationSubscription;_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators;_rawAsyncValidators;value;constructor(r,e){this._assignValidators(r),this._assignAsyncValidators(e)}get validator(){return this._composedValidatorFn}set validator(r){this._rawValidators=this._composedValidatorFn=r}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(r){this._rawAsyncValidators=this._composedAsyncValidatorFn=r}get parent(){return this._parent}get status(){return q(this.statusReactive)}set status(r){q(()=>this.statusReactive.set(r))}_status=me(()=>this.statusReactive());statusReactive=Q(void 0);get valid(){return this.status===Ze}get invalid(){return this.status===Rt}get pending(){return this.status==Pe}get disabled(){return this.status===Ye}get enabled(){return this.status!==Ye}errors;get pristine(){return q(this.pristineReactive)}set pristine(r){q(()=>this.pristineReactive.set(r))}_pristine=me(()=>this.pristineReactive());pristineReactive=Q(!0);get dirty(){return!this.pristine}get touched(){return q(this.touchedReactive)}set touched(r){q(()=>this.touchedReactive.set(r))}_touched=me(()=>this.touchedReactive());touchedReactive=Q(!1);get untouched(){return!this.touched}_events=new nt;events=this._events.asObservable();valueChanges;statusChanges;get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(r){this._assignValidators(r)}setAsyncValidators(r){this._assignAsyncValidators(r)}addValidators(r){this.setValidators(nn(r,this._rawValidators))}addAsyncValidators(r){this.setAsyncValidators(nn(r,this._rawAsyncValidators))}removeValidators(r){this.setValidators(an(r,this._rawValidators))}removeAsyncValidators(r){this.setAsyncValidators(an(r,this._rawAsyncValidators))}hasValidator(r){return jt(this._rawValidators,r)}hasAsyncValidator(r){return jt(this._rawAsyncValidators,r)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(r={}){let e=this.touched===!1;this.touched=!0;let i=r.sourceControl??this;this._parent&&!r.onlySelf&&this._parent.markAsTouched(j(k({},r),{sourceControl:i})),e&&r.emitEvent!==!1&&this._events.next(new et(!0,i))}markAllAsDirty(r={}){this.markAsDirty({onlySelf:!0,emitEvent:r.emitEvent,sourceControl:this}),this._forEachChild(e=>e.markAllAsDirty(r))}markAllAsTouched(r={}){this.markAsTouched({onlySelf:!0,emitEvent:r.emitEvent,sourceControl:this}),this._forEachChild(e=>e.markAllAsTouched(r))}markAsUntouched(r={}){let e=this.touched===!0;this.touched=!1,this._pendingTouched=!1;let i=r.sourceControl??this;this._forEachChild(o=>{o.markAsUntouched({onlySelf:!0,emitEvent:r.emitEvent,sourceControl:i})}),this._parent&&!r.onlySelf&&this._parent._updateTouched(r,i),e&&r.emitEvent!==!1&&this._events.next(new et(!1,i))}markAsDirty(r={}){let e=this.pristine===!0;this.pristine=!1;let i=r.sourceControl??this;this._parent&&!r.onlySelf&&this._parent.markAsDirty(j(k({},r),{sourceControl:i})),e&&r.emitEvent!==!1&&this._events.next(new Qe(!1,i))}markAsPristine(r={}){let e=this.pristine===!1;this.pristine=!0,this._pendingDirty=!1;let i=r.sourceControl??this;this._forEachChild(o=>{o.markAsPristine({onlySelf:!0,emitEvent:r.emitEvent})}),this._parent&&!r.onlySelf&&this._parent._updatePristine(r,i),e&&r.emitEvent!==!1&&this._events.next(new Qe(!0,i))}markAsPending(r={}){this.status=Pe;let e=r.sourceControl??this;r.emitEvent!==!1&&(this._events.next(new Fe(this.status,e)),this.statusChanges.emit(this.status)),this._parent&&!r.onlySelf&&this._parent.markAsPending(j(k({},r),{sourceControl:e}))}disable(r={}){let e=this._parentMarkedDirty(r.onlySelf);this.status=Ye,this.errors=null,this._forEachChild(o=>{o.disable(j(k({},r),{onlySelf:!0}))}),this._updateValue();let i=r.sourceControl??this;r.emitEvent!==!1&&(this._events.next(new Wt(this.value,i)),this._events.next(new Fe(this.status,i)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(j(k({},r),{skipPristineCheck:e}),this),this._onDisabledChange.forEach(o=>o(!0))}enable(r={}){let e=this._parentMarkedDirty(r.onlySelf);this.status=Ze,this._forEachChild(i=>{i.enable(j(k({},r),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:r.emitEvent}),this._updateAncestors(j(k({},r),{skipPristineCheck:e}),this),this._onDisabledChange.forEach(i=>i(!1))}_updateAncestors(r,e){this._parent&&!r.onlySelf&&(this._parent.updateValueAndValidity(r),r.skipPristineCheck||this._parent._updatePristine({},e),this._parent._updateTouched({},e))}setParent(r){this._parent=r}getRawValue(){return this.value}updateValueAndValidity(r={}){if(this._setInitialStatus(),this._updateValue(),this.enabled){let i=this._cancelExistingSubscription();this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===Ze||this.status===Pe)&&this._runAsyncValidator(i,r.emitEvent)}let e=r.sourceControl??this;r.emitEvent!==!1&&(this._events.next(new Wt(this.value,e)),this._events.next(new Fe(this.status,e)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!r.onlySelf&&this._parent.updateValueAndValidity(j(k({},r),{sourceControl:e}))}_updateTreeValidity(r={emitEvent:!0}){this._forEachChild(e=>e._updateTreeValidity(r)),this.updateValueAndValidity({onlySelf:!0,emitEvent:r.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?Ye:Ze}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(r,e){if(this.asyncValidator){this.status=Pe,this._hasOwnPendingAsyncValidator={emitEvent:e!==!1,shouldHaveEmitted:r!==!1};let i=bn(this.asyncValidator(this));this._asyncValidationSubscription=i.subscribe(o=>{this._hasOwnPendingAsyncValidator=null,this.setErrors(o,{emitEvent:e,shouldHaveEmitted:r})})}}_cancelExistingSubscription(){if(this._asyncValidationSubscription){this._asyncValidationSubscription.unsubscribe();let r=(this._hasOwnPendingAsyncValidator?.emitEvent||this._hasOwnPendingAsyncValidator?.shouldHaveEmitted)??!1;return this._hasOwnPendingAsyncValidator=null,r}return!1}setErrors(r,e={}){this.errors=r,this._updateControlsErrors(e.emitEvent!==!1,this,e.shouldHaveEmitted)}get(r){let e=r;return e==null||(Array.isArray(e)||(e=e.split(".")),e.length===0)?null:e.reduce((i,o)=>i&&i._find(o),this)}getError(r,e){let i=e?this.get(e):this;return i&&i.errors?i.errors[r]:null}hasError(r,e){return!!this.getError(r,e)}get root(){let r=this;for(;r._parent;)r=r._parent;return r}_updateControlsErrors(r,e,i){this.status=this._calculateStatus(),r&&this.statusChanges.emit(this.status),(r||i)&&this._events.next(new Fe(this.status,e)),this._parent&&this._parent._updateControlsErrors(r,e,i)}_initObservables(){this.valueChanges=new ee,this.statusChanges=new ee}_calculateStatus(){return this._allControlsDisabled()?Ye:this.errors?Rt:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(Pe)?Pe:this._anyControlsHaveStatus(Rt)?Rt:Ze}_anyControlsHaveStatus(r){return this._anyControls(e=>e.status===r)}_anyControlsDirty(){return this._anyControls(r=>r.dirty)}_anyControlsTouched(){return this._anyControls(r=>r.touched)}_updatePristine(r,e){let i=!this._anyControlsDirty(),o=this.pristine!==i;this.pristine=i,this._parent&&!r.onlySelf&&this._parent._updatePristine(r,e),o&&this._events.next(new Qe(this.pristine,e))}_updateTouched(r={},e){this.touched=this._anyControlsTouched(),this._events.next(new et(this.touched,e)),this._parent&&!r.onlySelf&&this._parent._updateTouched(r,e)}_onDisabledChange=[];_registerOnCollectionChange(r){this._onCollectionChange=r}_setUpdateStrategy(r){zt(r)&&r.updateOn!=null&&(this._updateOn=r.updateOn)}_parentMarkedDirty(r){let e=this._parent&&this._parent.dirty;return!r&&!!e&&!this._parent._anyControlsDirty()}_find(r){return null}_assignValidators(r){this._rawValidators=Array.isArray(r)?r.slice():r,this._composedValidatorFn=Of(this._rawValidators)}_assignAsyncValidators(r){this._rawAsyncValidators=Array.isArray(r)?r.slice():r,this._composedAsyncValidatorFn=kf(this._rawAsyncValidators)}},de=class extends Re{constructor(r,e,i){super(xr(e),wr(i,e)),this.controls=r,this._initObservables(),this._setUpdateStrategy(e),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}controls;registerControl(r,e){return this.controls[r]?this.controls[r]:(this.controls[r]=e,e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange),e)}addControl(r,e,i={}){this.registerControl(r,e),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}removeControl(r,e={}){this.controls[r]&&this.controls[r]._registerOnCollectionChange(()=>{}),delete this.controls[r],this.updateValueAndValidity({emitEvent:e.emitEvent}),this._onCollectionChange()}setControl(r,e,i={}){this.controls[r]&&this.controls[r]._registerOnCollectionChange(()=>{}),delete this.controls[r],e&&this.registerControl(r,e),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}contains(r){return this.controls.hasOwnProperty(r)&&this.controls[r].enabled}setValue(r,e={}){Vn(this,!0,r),Object.keys(r).forEach(i=>{Dn(this,!0,i),this.controls[i].setValue(r[i],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}patchValue(r,e={}){r!=null&&(Object.keys(r).forEach(i=>{let o=this.controls[i];o&&o.patchValue(r[i],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e))}reset(r={},e={}){this._forEachChild((i,o)=>{i.reset(r?r[o]:null,{onlySelf:!0,emitEvent:e.emitEvent})}),this._updatePristine(e,this),this._updateTouched(e,this),this.updateValueAndValidity(e)}getRawValue(){return this._reduceChildren({},(r,e,i)=>(r[i]=e.getRawValue(),r))}_syncPendingControls(){let r=this._reduceChildren(!1,(e,i)=>i._syncPendingControls()?!0:e);return r&&this.updateValueAndValidity({onlySelf:!0}),r}_forEachChild(r){Object.keys(this.controls).forEach(e=>{let i=this.controls[e];i&&r(i,e)})}_setUpControls(){this._forEachChild(r=>{r.setParent(this),r._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(r){for(let[e,i]of Object.entries(this.controls))if(this.contains(e)&&r(i))return!0;return!1}_reduceValue(){let r={};return this._reduceChildren(r,(e,i,o)=>((i.enabled||this.disabled)&&(e[o]=i.value),e))}_reduceChildren(r,e){let i=r;return this._forEachChild((o,n)=>{i=e(i,o,n)}),i}_allControlsDisabled(){for(let r of Object.keys(this.controls))if(this.controls[r].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_find(r){return this.controls.hasOwnProperty(r)?this.controls[r]:null}};var cC=de;var vr=class extends de{};var Ue=new ce("",{providedIn:"root",factory:()=>Jt}),Jt="always";function Zt(t,r){return[...r.path,t]}function tt(t,r,e=Jt){Tr(t,r),r.valueAccessor.writeValue(t.value),(t.disabled||e==="always")&&r.valueAccessor.setDisabledState?.(t.disabled),Ff(t,r),Rf(t,r),Nf(t,r),Pf(t,r)}function Gt(t,r,e=!0){let i=()=>{};r.valueAccessor&&(r.valueAccessor.registerOnChange(i),r.valueAccessor.registerOnTouched(i)),Kt(t,r),t&&(r._invokeOnDestroyCallbacks(),t._registerOnCollectionChange(()=>{}))}function qt(t,r){t.forEach(e=>{e.registerOnValidatorChange&&e.registerOnValidatorChange(r)})}function Pf(t,r){if(r.valueAccessor.setDisabledState){let e=i=>{r.valueAccessor.setDisabledState(i)};t.registerOnDisabledChange(e),r._registerOnDestroy(()=>{t._unregisterOnDisabledChange(e)})}}function Tr(t,r){let e=Tn(t);r.validator!==null?t.setValidators(on(e,r.validator)):typeof e=="function"&&t.setValidators([e]);let i=An(t);r.asyncValidator!==null?t.setAsyncValidators(on(i,r.asyncValidator)):typeof i=="function"&&t.setAsyncValidators([i]);let o=()=>t.updateValueAndValidity();qt(r._rawValidators,o),qt(r._rawAsyncValidators,o)}function Kt(t,r){let e=!1;if(t!==null){if(r.validator!==null){let o=Tn(t);if(Array.isArray(o)&&o.length>0){let n=o.filter(a=>a!==r.validator);n.length!==o.length&&(e=!0,t.setValidators(n))}}if(r.asyncValidator!==null){let o=An(t);if(Array.isArray(o)&&o.length>0){let n=o.filter(a=>a!==r.asyncValidator);n.length!==o.length&&(e=!0,t.setAsyncValidators(n))}}}let i=()=>{};return qt(r._rawValidators,i),qt(r._rawAsyncValidators,i),e}function Ff(t,r){r.valueAccessor.registerOnChange(e=>{t._pendingValue=e,t._pendingChange=!0,t._pendingDirty=!0,t.updateOn==="change"&&Mn(t,r)})}function Nf(t,r){r.valueAccessor.registerOnTouched(()=>{t._pendingTouched=!0,t.updateOn==="blur"&&t._pendingChange&&Mn(t,r),t.updateOn!=="submit"&&t.markAsTouched()})}function Mn(t,r){t._pendingDirty&&t.markAsDirty(),t.setValue(t._pendingValue,{emitModelToViewChange:!1}),r.viewToModelUpdate(t._pendingValue),t._pendingChange=!1}function Rf(t,r){let e=(i,o)=>{r.valueAccessor.writeValue(i),o&&r.viewToModelUpdate(i)};t.registerOnChange(e),r._registerOnDestroy(()=>{t._unregisterOnChange(e)})}function En(t,r){t==null,Tr(t,r)}function Uf(t,r){return Kt(t,r)}function Ar(t,r){if(!t.hasOwnProperty("model"))return!1;let e=t.model;return e.isFirstChange()?!0:!Object.is(r,e.currentValue)}function jf(t){return Object.getPrototypeOf(t.constructor)===dn}function In(t,r){t._syncPendingControls(),r.forEach(e=>{let i=e.control;i.updateOn==="submit"&&i._pendingChange&&(e.viewToModelUpdate(i._pendingValue),i._pendingChange=!1)})}function Dr(t,r){if(!r)return null;Array.isArray(r);let e,i,o;return r.forEach(n=>{n.constructor===pn?e=n:jf(n)?i=n:o=n}),o||i||e||null}function Lf(t,r){let e=t.indexOf(r);e>-1&&t.splice(e,1)}var $f={provide:V,useExisting:E(()=>Wf)},Xe=Promise.resolve(),Wf=(()=>{class t extends V{callSetDisabledState;get submitted(){return q(this.submittedReactive)}_submitted=me(()=>this.submittedReactive());submittedReactive=Q(!1);_directives=new Set;form;ngSubmit=new ee;options;constructor(e,i,o){super(),this.callSetDisabledState=o,this.form=new de({},Cr(e),_r(i))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(e){Xe.then(()=>{let i=this._findContainer(e.path);e.control=i.registerControl(e.name,e.control),tt(e.control,e,this.callSetDisabledState),e.control.updateValueAndValidity({emitEvent:!1}),this._directives.add(e)})}getControl(e){return this.form.get(e.path)}removeControl(e){Xe.then(()=>{let i=this._findContainer(e.path);i&&i.removeControl(e.name),this._directives.delete(e)})}addFormGroup(e){Xe.then(()=>{let i=this._findContainer(e.path),o=new de({});En(o,e),i.registerControl(e.name,o),o.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(e){Xe.then(()=>{let i=this._findContainer(e.path);i&&i.removeControl(e.name)})}getFormGroup(e){return this.form.get(e.path)}updateModel(e,i){Xe.then(()=>{this.form.get(e.path).setValue(i)})}setValue(e){this.control.setValue(e)}onSubmit(e){return this.submittedReactive.set(!0),In(this.form,this._directives),this.ngSubmit.emit(e),this.form._events.next(new Bt(this.control)),e?.target?.method==="dialog"}onReset(){this.resetForm()}resetForm(e=void 0){this.form.reset(e),this.submittedReactive.set(!1),this.form._events.next(new Ht(this.form))}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.form._updateOn=this.options.updateOn)}_findContainer(e){return e.pop(),e.length?this.form.get(e):this.form}static \u0275fac=function(i){return new(i||t)(f($,10),f(pe,10),f(Ue,8))};static \u0275dir=y({type:t,selectors:[["form",3,"ngNoForm","",3,"formGroup",""],["ng-form"],["","ngForm",""]],hostBindings:function(i,o){i&1&&Le("submit",function(a){return o.onSubmit(a)})("reset",function(){return o.onReset()})},inputs:{options:[0,"ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],standalone:!1,features:[I([$f]),S]})}return t})();function sn(t,r){let e=t.indexOf(r);e>-1&&t.splice(e,1)}function ln(t){return typeof t=="object"&&t!==null&&Object.keys(t).length===2&&"value"in t&&"disabled"in t}var Ne=class extends Re{defaultValue=null;_onChange=[];_pendingValue;_pendingChange=!1;constructor(r=null,e,i){super(xr(e),wr(i,e)),this._applyFormState(r),this._setUpdateStrategy(e),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator}),zt(e)&&(e.nonNullable||e.initialValueIsDefault)&&(ln(r)?this.defaultValue=r.value:this.defaultValue=r)}setValue(r,e={}){this.value=this._pendingValue=r,this._onChange.length&&e.emitModelToViewChange!==!1&&this._onChange.forEach(i=>i(this.value,e.emitViewToModelChange!==!1)),this.updateValueAndValidity(e)}patchValue(r,e={}){this.setValue(r,e)}reset(r=this.defaultValue,e={}){this._applyFormState(r),this.markAsPristine(e),this.markAsUntouched(e),this.setValue(this.value,e),this._pendingChange=!1}_updateValue(){}_anyControls(r){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(r){this._onChange.push(r)}_unregisterOnChange(r){sn(this._onChange,r)}registerOnDisabledChange(r){this._onDisabledChange.push(r)}_unregisterOnDisabledChange(r){sn(this._onDisabledChange,r)}_forEachChild(r){}_syncPendingControls(){return this.updateOn==="submit"&&(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),this._pendingChange)?(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),!0):!1}_applyFormState(r){ln(r)?(this.value=this._pendingValue=r.value,r.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=r}},dC=Ne,Bf=t=>t instanceof Ne,Hf=(()=>{class t extends V{_parent;ngOnInit(){this._checkParentType(),this.formDirective.addFormGroup(this)}ngOnDestroy(){this.formDirective&&this.formDirective.removeFormGroup(this)}get control(){return this.formDirective.getFormGroup(this)}get path(){return Zt(this.name==null?this.name:this.name.toString(),this._parent)}get formDirective(){return this._parent?this._parent.formDirective:null}_checkParentType(){}static \u0275fac=(()=>{let e;return function(o){return(e||(e=G(t)))(o||t)}})();static \u0275dir=y({type:t,standalone:!1,features:[S]})}return t})();var Gf={provide:X,useExisting:E(()=>qf)},un=Promise.resolve(),qf=(()=>{class t extends X{_changeDetectorRef;callSetDisabledState;control=new Ne;static ngAcceptInputType_isDisabled;_registered=!1;viewModel;name="";isDisabled;model;options;update=new ee;constructor(e,i,o,n,a,s){super(),this._changeDetectorRef=a,this.callSetDisabledState=s,this._parent=e,this._setValidators(i),this._setAsyncValidators(o),this.valueAccessor=Dr(this,n)}ngOnChanges(e){if(this._checkForErrors(),!this._registered||"name"in e){if(this._registered&&(this._checkName(),this.formDirective)){let i=e.name.previousValue;this.formDirective.removeControl({name:i,path:this._getPath(i)})}this._setUpControl()}"isDisabled"in e&&this._updateDisabled(e),Ar(e,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._getPath(this.name)}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(e){this.viewModel=e,this.update.emit(e)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!!(this.options&&this.options.standalone)}_setUpStandalone(){tt(this.control,this,this.callSetDisabledState),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._checkName()}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),!this._isStandalone()&&this.name}_updateValue(e){un.then(()=>{this.control.setValue(e,{emitViewToModelChange:!1}),this._changeDetectorRef?.markForCheck()})}_updateDisabled(e){let i=e.isDisabled.currentValue,o=i!==0&&rr(i);un.then(()=>{o&&!this.control.disabled?this.control.disable():!o&&this.control.disabled&&this.control.enable(),this._changeDetectorRef?.markForCheck()})}_getPath(e){return this._parent?Zt(e,this._parent):[e]}static \u0275fac=function(i){return new(i||t)(f(V,9),f($,10),f(pe,10),f(rt,10),f(Rr,8),f(Ue,8))};static \u0275dir=y({type:t,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:[0,"disabled","isDisabled"],model:[0,"ngModel","model"],options:[0,"ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],standalone:!1,features:[I([Gf]),S,ge]})}return t})();var pC=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275dir=y({type:t,selectors:[["form",3,"ngNoForm","",3,"ngNativeValidate",""]],hostAttrs:["novalidate",""],standalone:!1})}return t})(),Kf={provide:rt,useExisting:E(()=>zf),multi:!0},zf=(()=>{class t extends dn{writeValue(e){let i=e??"";this.setProperty("value",i)}registerOnChange(e){this.onChange=i=>{e(i==""?null:parseFloat(i))}}static \u0275fac=(()=>{let e;return function(o){return(e||(e=G(t)))(o||t)}})();static \u0275dir=y({type:t,selectors:[["input","type","number","formControlName",""],["input","type","number","formControl",""],["input","type","number","ngModel",""]],hostBindings:function(i,o){i&1&&Le("input",function(a){return o.onChange(a.target.value)})("blur",function(){return o.onTouched()})},standalone:!1,features:[I([Kf]),S]})}return t})();var Vr=new ce(""),Jf={provide:X,useExisting:E(()=>Zf)},Zf=(()=>{class t extends X{_ngModelWarningConfig;callSetDisabledState;viewModel;form;set isDisabled(e){}model;update=new ee;static _ngModelWarningSentOnce=!1;_ngModelWarningSent=!1;constructor(e,i,o,n,a){super(),this._ngModelWarningConfig=n,this.callSetDisabledState=a,this._setValidators(e),this._setAsyncValidators(i),this.valueAccessor=Dr(this,o)}ngOnChanges(e){if(this._isControlChanged(e)){let i=e.form.previousValue;i&&Gt(i,this,!1),tt(this.form,this,this.callSetDisabledState),this.form.updateValueAndValidity({emitEvent:!1})}Ar(e,this.viewModel)&&(this.form.setValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.form&&Gt(this.form,this,!1)}get path(){return[]}get control(){return this.form}viewToModelUpdate(e){this.viewModel=e,this.update.emit(e)}_isControlChanged(e){return e.hasOwnProperty("form")}static \u0275fac=function(i){return new(i||t)(f($,10),f(pe,10),f(rt,10),f(Vr,8),f(Ue,8))};static \u0275dir=y({type:t,selectors:[["","formControl",""]],inputs:{form:[0,"formControl","form"],isDisabled:[0,"disabled","isDisabled"],model:[0,"ngModel","model"]},outputs:{update:"ngModelChange"},exportAs:["ngForm"],standalone:!1,features:[I([Jf]),S,ge]})}return t})(),Yf={provide:V,useExisting:E(()=>On)},On=(()=>{class t extends V{callSetDisabledState;get submitted(){return q(this._submittedReactive)}set submitted(e){this._submittedReactive.set(e)}_submitted=me(()=>this._submittedReactive());_submittedReactive=Q(!1);_oldForm;_onCollectionChange=()=>this._updateDomValue();directives=[];form=null;ngSubmit=new ee;constructor(e,i,o){super(),this.callSetDisabledState=o,this._setValidators(e),this._setAsyncValidators(i)}ngOnChanges(e){e.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations(),this._oldForm=this.form)}ngOnDestroy(){this.form&&(Kt(this.form,this),this.form._onCollectionChange===this._onCollectionChange&&this.form._registerOnCollectionChange(()=>{}))}get formDirective(){return this}get control(){return this.form}get path(){return[]}addControl(e){let i=this.form.get(e.path);return tt(i,e,this.callSetDisabledState),i.updateValueAndValidity({emitEvent:!1}),this.directives.push(e),i}getControl(e){return this.form.get(e.path)}removeControl(e){Gt(e.control||null,e,!1),Lf(this.directives,e)}addFormGroup(e){this._setUpFormContainer(e)}removeFormGroup(e){this._cleanUpFormContainer(e)}getFormGroup(e){return this.form.get(e.path)}addFormArray(e){this._setUpFormContainer(e)}removeFormArray(e){this._cleanUpFormContainer(e)}getFormArray(e){return this.form.get(e.path)}updateModel(e,i){this.form.get(e.path).setValue(i)}onSubmit(e){return this._submittedReactive.set(!0),In(this.form,this.directives),this.ngSubmit.emit(e),this.form._events.next(new Bt(this.control)),e?.target?.method==="dialog"}onReset(){this.resetForm()}resetForm(e=void 0,i={}){this.form.reset(e,i),this._submittedReactive.set(!1),i?.emitEvent!==!1&&this.form._events.next(new Ht(this.form))}_updateDomValue(){this.directives.forEach(e=>{let i=e.control,o=this.form.get(e.path);i!==o&&(Gt(i||null,e),Bf(o)&&(tt(o,e,this.callSetDisabledState),e.control=o))}),this.form._updateTreeValidity({emitEvent:!1})}_setUpFormContainer(e){let i=this.form.get(e.path);En(i,e),i.updateValueAndValidity({emitEvent:!1})}_cleanUpFormContainer(e){if(this.form){let i=this.form.get(e.path);i&&Uf(i,e)&&i.updateValueAndValidity({emitEvent:!1})}}_updateRegistrations(){this.form._registerOnCollectionChange(this._onCollectionChange),this._oldForm&&this._oldForm._registerOnCollectionChange(()=>{})}_updateValidators(){Tr(this.form,this),this._oldForm&&Kt(this._oldForm,this)}static \u0275fac=function(i){return new(i||t)(f($,10),f(pe,10),f(Ue,8))};static \u0275dir=y({type:t,selectors:[["","formGroup",""]],hostBindings:function(i,o){i&1&&Le("submit",function(a){return o.onSubmit(a)})("reset",function(){return o.onReset()})},inputs:{form:[0,"formGroup","form"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],standalone:!1,features:[I([Yf]),S,ge]})}return t})(),Xf={provide:V,useExisting:E(()=>kn)},kn=(()=>{class t extends Hf{name=null;constructor(e,i,o){super(),this._parent=e,this._setValidators(i),this._setAsyncValidators(o)}_checkParentType(){Fn(this._parent)}static \u0275fac=function(i){return new(i||t)(f(V,13),f($,10),f(pe,10))};static \u0275dir=y({type:t,selectors:[["","formGroupName",""]],inputs:{name:[0,"formGroupName","name"]},standalone:!1,features:[I([Xf]),S]})}return t})(),Qf={provide:V,useExisting:E(()=>Pn)},Pn=(()=>{class t extends V{_parent;name=null;constructor(e,i,o){super(),this._parent=e,this._setValidators(i),this._setAsyncValidators(o)}ngOnInit(){Fn(this._parent),this.formDirective.addFormArray(this)}ngOnDestroy(){this.formDirective?.removeFormArray(this)}get control(){return this.formDirective.getFormArray(this)}get formDirective(){return this._parent?this._parent.formDirective:null}get path(){return Zt(this.name==null?this.name:this.name.toString(),this._parent)}static \u0275fac=function(i){return new(i||t)(f(V,13),f($,10),f(pe,10))};static \u0275dir=y({type:t,selectors:[["","formArrayName",""]],inputs:{name:[0,"formArrayName","name"]},standalone:!1,features:[I([Qf]),S]})}return t})();function Fn(t){return!(t instanceof kn)&&!(t instanceof On)&&!(t instanceof Pn)}var ed={provide:X,useExisting:E(()=>td)},td=(()=>{class t extends X{_ngModelWarningConfig;_added=!1;viewModel;control;name=null;set isDisabled(e){}model;update=new ee;static _ngModelWarningSentOnce=!1;_ngModelWarningSent=!1;constructor(e,i,o,n,a){super(),this._ngModelWarningConfig=a,this._parent=e,this._setValidators(i),this._setAsyncValidators(o),this.valueAccessor=Dr(this,n)}ngOnChanges(e){this._added||this._setUpControl(),Ar(e,this.viewModel)&&(this.viewModel=this.model,this.formDirective.updateModel(this,this.model))}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}viewToModelUpdate(e){this.viewModel=e,this.update.emit(e)}get path(){return Zt(this.name==null?this.name:this.name.toString(),this._parent)}get formDirective(){return this._parent?this._parent.formDirective:null}_setUpControl(){this.control=this.formDirective.addControl(this),this._added=!0}static \u0275fac=function(i){return new(i||t)(f(V,13),f($,10),f(pe,10),f(rt,10),f(Vr,8))};static \u0275dir=y({type:t,selectors:[["","formControlName",""]],inputs:{name:[0,"formControlName","name"],isDisabled:[0,"disabled","isDisabled"],model:[0,"ngModel","model"]},outputs:{update:"ngModelChange"},standalone:!1,features:[I([ed]),S,ge]})}return t})();function Nn(t){return typeof t=="number"?t:parseFloat(t)}var Yt=(()=>{class t{_validator=Ut;_onChange;_enabled;ngOnChanges(e){if(this.inputName in e){let i=this.normalizeInput(e[this.inputName].currentValue);this._enabled=this.enabled(i),this._validator=this._enabled?this.createValidator(i):Ut,this._onChange&&this._onChange()}}validate(e){return this._validator(e)}registerOnValidatorChange(e){this._onChange=e}enabled(e){return e!=null}static \u0275fac=function(i){return new(i||t)};static \u0275dir=y({type:t,features:[ge]})}return t})(),rd={provide:$,useExisting:E(()=>id),multi:!0},id=(()=>{class t extends Yt{max;inputName="max";normalizeInput=e=>Nn(e);createValidator=e=>gn(e);static \u0275fac=(()=>{let e;return function(o){return(e||(e=G(t)))(o||t)}})();static \u0275dir=y({type:t,selectors:[["input","type","number","max","","formControlName",""],["input","type","number","max","","formControl",""],["input","type","number","max","","ngModel",""]],hostVars:1,hostBindings:function(i,o){i&2&&je("max",o._enabled?o.max:null)},inputs:{max:"max"},standalone:!1,features:[I([rd]),S]})}return t})(),od={provide:$,useExisting:E(()=>nd),multi:!0},nd=(()=>{class t extends Yt{min;inputName="min";normalizeInput=e=>Nn(e);createValidator=e=>hn(e);static \u0275fac=(()=>{let e;return function(o){return(e||(e=G(t)))(o||t)}})();static \u0275dir=y({type:t,selectors:[["input","type","number","min","","formControlName",""],["input","type","number","min","","formControl",""],["input","type","number","min","","ngModel",""]],hostVars:1,hostBindings:function(i,o){i&2&&je("min",o._enabled?o.min:null)},inputs:{min:"min"},standalone:!1,features:[I([od]),S]})}return t})(),ad={provide:$,useExisting:E(()=>sd),multi:!0};var sd=(()=>{class t extends Yt{required;inputName="required";normalizeInput=rr;createValidator=e=>mn;enabled(e){return e}static \u0275fac=(()=>{let e;return function(o){return(e||(e=G(t)))(o||t)}})();static \u0275dir=y({type:t,selectors:[["","required","","formControlName","",3,"type","checkbox"],["","required","","formControl","",3,"type","checkbox"],["","required","","ngModel","",3,"type","checkbox"]],hostVars:1,hostBindings:function(i,o){i&2&&je("required",o._enabled?"":null)},inputs:{required:"required"},standalone:!1,features:[I([ad]),S]})}return t})();var ld={provide:$,useExisting:E(()=>ud),multi:!0},ud=(()=>{class t extends Yt{pattern;inputName="pattern";normalizeInput=e=>e;createValidator=e=>vn(e);static \u0275fac=(()=>{let e;return function(o){return(e||(e=G(t)))(o||t)}})();static \u0275dir=y({type:t,selectors:[["","pattern","","formControlName",""],["","pattern","","formControl",""],["","pattern","","ngModel",""]],hostVars:1,hostBindings:function(i,o){i&2&&je("pattern",o._enabled?o.pattern:null)},inputs:{pattern:"pattern"},standalone:!1,features:[I([ld]),S]})}return t})();var Rn=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=ut({type:t});static \u0275inj=lt({})}return t})(),yr=class extends Re{constructor(r,e,i){super(xr(e),wr(i,e)),this.controls=r,this._initObservables(),this._setUpdateStrategy(e),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}controls;at(r){return this.controls[this._adjustIndex(r)]}push(r,e={}){this.controls.push(r),this._registerControl(r),this.updateValueAndValidity({emitEvent:e.emitEvent}),this._onCollectionChange()}insert(r,e,i={}){this.controls.splice(r,0,e),this._registerControl(e),this.updateValueAndValidity({emitEvent:i.emitEvent})}removeAt(r,e={}){let i=this._adjustIndex(r);i<0&&(i=0),this.controls[i]&&this.controls[i]._registerOnCollectionChange(()=>{}),this.controls.splice(i,1),this.updateValueAndValidity({emitEvent:e.emitEvent})}setControl(r,e,i={}){let o=this._adjustIndex(r);o<0&&(o=0),this.controls[o]&&this.controls[o]._registerOnCollectionChange(()=>{}),this.controls.splice(o,1),e&&(this.controls.splice(o,0,e),this._registerControl(e)),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}get length(){return this.controls.length}setValue(r,e={}){Vn(this,!1,r),r.forEach((i,o)=>{Dn(this,!1,o),this.at(o).setValue(i,{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}patchValue(r,e={}){r!=null&&(r.forEach((i,o)=>{this.at(o)&&this.at(o).patchValue(i,{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e))}reset(r=[],e={}){this._forEachChild((i,o)=>{i.reset(r[o],{onlySelf:!0,emitEvent:e.emitEvent})}),this._updatePristine(e,this),this._updateTouched(e,this),this.updateValueAndValidity(e)}getRawValue(){return this.controls.map(r=>r.getRawValue())}clear(r={}){this.controls.length<1||(this._forEachChild(e=>e._registerOnCollectionChange(()=>{})),this.controls.splice(0),this.updateValueAndValidity({emitEvent:r.emitEvent}))}_adjustIndex(r){return r<0?r+this.length:r}_syncPendingControls(){let r=this.controls.reduce((e,i)=>i._syncPendingControls()?!0:e,!1);return r&&this.updateValueAndValidity({onlySelf:!0}),r}_forEachChild(r){this.controls.forEach((e,i)=>{r(e,i)})}_updateValue(){this.value=this.controls.filter(r=>r.enabled||this.disabled).map(r=>r.value)}_anyControls(r){return this.controls.some(e=>e.enabled&&r(e))}_setUpControls(){this._forEachChild(r=>this._registerControl(r))}_allControlsDisabled(){for(let r of this.controls)if(r.enabled)return!1;return this.controls.length>0||this.disabled}_registerControl(r){r.setParent(this),r._registerOnCollectionChange(this._onCollectionChange)}_find(r){return this.at(r)??null}};function cn(t){return!!t&&(t.asyncValidators!==void 0||t.validators!==void 0||t.updateOn!==void 0)}var cd=(()=>{class t{useNonNullable=!1;get nonNullable(){let e=new t;return e.useNonNullable=!0,e}group(e,i=null){let o=this._reduceControls(e),n={};return cn(i)?n=i:i!==null&&(n.validators=i.validator,n.asyncValidators=i.asyncValidator),new de(o,n)}record(e,i=null){let o=this._reduceControls(e);return new vr(o,i)}control(e,i,o){let n={};return this.useNonNullable?(cn(i)?n=i:(n.validators=i,n.asyncValidators=o),new Ne(e,j(k({},n),{nonNullable:!0}))):new Ne(e,i,o)}array(e,i,o){let n=e.map(a=>this._createControl(a));return new yr(n,i,o)}_reduceControls(e){let i={};return Object.keys(e).forEach(o=>{i[o]=this._createControl(e[o])}),i}_createControl(e){if(e instanceof Ne)return e;if(e instanceof Re)return e;if(Array.isArray(e)){let i=e[0],o=e.length>1?e[1]:null,n=e.length>2?e[2]:null;return this.control(i,o,n)}else return this.control(e)}static \u0275fac=function(i){return new(i||t)};static \u0275prov=D({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var hC=(()=>{class t extends cd{group(e,i=null){return super.group(e,i)}control(e,i,o){return super.control(e,i,o)}array(e,i,o){return super.array(e,i,o)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=G(t)))(o||t)}})();static \u0275prov=D({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var gC=(()=>{class t{static withConfig(e){return{ngModule:t,providers:[{provide:Ue,useValue:e.callSetDisabledState??Jt}]}}static \u0275fac=function(i){return new(i||t)};static \u0275mod=ut({type:t});static \u0275inj=lt({imports:[Rn]})}return t})(),mC=(()=>{class t{static withConfig(e){return{ngModule:t,providers:[{provide:Vr,useValue:e.warnOnNgModelWithFormControl??"always"},{provide:Ue,useValue:e.callSetDisabledState??Jt}]}}static \u0275fac=function(i){return new(i||t)};static \u0275mod=ut({type:t});static \u0275inj=lt({imports:[Rn]})}return t})();var bC=(()=>{class t{isErrorState(e,i){return!!(e&&e.invalid&&(e.touched||i&&i.submitted))}static \u0275fac=function(i){return new(i||t)};static \u0275prov=D({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var Un=class{_defaultMatcher;ngControl;_parentFormGroup;_parentForm;_stateChanges;errorState=!1;matcher;constructor(r,e,i,o,n){this._defaultMatcher=r,this.ngControl=e,this._parentFormGroup=i,this._parentForm=o,this._stateChanges=n}updateErrorState(){let r=this.errorState,e=this._parentFormGroup||this._parentForm,i=this.matcher||this._defaultMatcher,o=this.ngControl?this.ngControl.control:null,n=i?.isErrorState(o,e)??!1;n!==r&&(this.errorState=n,this._stateChanges.next())}};export{se as a,ze as b,tn as c,lr as d,pf as e,gf as f,c as g,Ur as h,ct as i,dr as j,Lr as k,Xo as l,US as m,rt as n,pn as o,$ as p,rn as q,X as r,lC as s,uC as t,de as u,cC as v,Wf as w,Ne as x,dC as y,qf as z,pC as A,zf as B,Zf as C,On as D,kn as E,Pn as F,td as G,id as H,nd as I,sd as J,ud as K,hC as L,gC as M,mC as N,bC as O,Un as P};
|
package/public/chunk-CZJ7AC6N.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as I,c as z,d as $,e as j,f as B,g as q}from"./chunk-BMDGKBYM.js";import{a as N,b as R}from"./chunk-OQULS6SV.js";import"./chunk-SZ2GUIT5.js";import{Fa as m,Fb as F,Gd as D,Hd as L,Kb as l,Lb as T,Mb as E,Mc as H,Oa as M,Ua as w,Vd as V,Wc as A,Xd as O,_d as P,bb as g,cb as u,dc as h,ec as S,fb as k,ga as C,gb as y,hb as f,ib as n,ja as p,jb as a,ka as c,kb as x,ra as b,rb as v,tb as _,vb as s}from"./chunk-OB3QLUH6.js";var W=(e,o)=>o.file;function G(e,o){e&1&&l(0," Loading... ")}function J(e,o){e&1&&l(0," Table of Content ")}function K(e,o){e&1&&(n(0,"button",8),l(1,"Error loading menu"),a())}function Q(e,o){e&1&&(n(0,"button",8),l(1,"No help entries"),a())}function X(e,o){if(e&1){let t=v();n(0,"button",10),_("click",function(){let i=p(t).$implicit,d=s(3);return c(d.selectFile(i.file))}),l(1),a()}if(e&2){let t=o.$implicit,r=s(3);f("disabled",r.selectedFile()===t.file),m(),E(" ",t.title," ")}}function Y(e,o){if(e&1&&k(0,X,2,2,"button",9,W),e&2){let t=s(2);y(t.helpFiles())}}function Z(e,o){if(e&1&&g(0,K,2,0,"button",8)(1,Q,2,0,"button",8)(2,Y,2,0),e&2){let t=s();u(t.hasError()?0:!t.isLoading()&&t.helpFiles().length===0?1:2)}}function ee(e,o){e&1&&(n(0,"div",7),l(1,"Unable to load help content."),a())}function te(e,o){e&1&&(n(0,"div",7),l(1,"Loading help..."),a())}function ne(e,o){if(e&1&&(n(0,"div",7),x(1,"markdown",11),a()),e&2){let t=s();m(),f("src",`assets/help-docs/${t.selectedFile()}`)}}var he=(()=>{class e{pageTitle="Help";_router=C(A);_helpMenuRes=H(()=>"assets/help-docs/menu.json");helpFiles=h(()=>this._helpMenuRes.hasValue()?(this._helpMenuRes.value()??[]).filter(t=>t.file.endsWith(".md")):[]);selectedFile=b("");_initSelectionOnce=b(!1);_syncEffect=S(()=>{let t=this.helpFiles();!this._initSelectionOnce()&&t.length>0&&(this.selectedFile.set(t[0].file),this._initSelectionOnce.set(!0))});hasError=h(()=>this._helpMenuRes.error()!=null);isLoading=h(()=>this._helpMenuRes.isLoading());selectFile(t){this.selectedFile.set(t)}backPage(){this._router.navigate(["/settings"])}closePage(){this._router.navigate(["/dashboard"])}static \u0275fac=function(r){return new(r||e)};static \u0275cmp=M({type:e,selectors:[["app-help"]],decls:20,vars:5,consts:[["helpMenu","matMenu"],[1,"fullpage-header"],[1,"fullpage-header-title"],["mat-flat-button","",3,"matMenuTriggerFor","disabled"],["matMenuContent",""],[1,"dialog-close-icon"],["mat-icon-button","",3,"click"],[1,"markdown-content"],["mat-menu-item","","disabled",""],["mat-menu-item","",3,"disabled"],["mat-menu-item","",3,"click","disabled"],["clipboard","",3,"src"]],template:function(r,i){if(r&1){let d=v();n(0,"div",1)(1,"h6",2),l(2),a(),n(3,"button",3),g(4,G,1,0)(5,J,1,0),a(),n(6,"mat-menu",null,0),w(8,Z,3,1,"ng-template",4),a(),n(9,"div",5)(10,"button",6),_("click",function(){return p(d),c(i.backPage())}),n(11,"mat-icon"),l(12,"arrow_back_ios"),a()(),n(13,"button",6),_("click",function(){return p(d),c(i.closePage())}),n(14,"mat-icon"),l(15,"close"),a()()()(),x(16,"mat-divider"),g(17,ee,2,0,"div",7)(18,te,2,0,"div",7)(19,ne,2,1,"div",7)}if(r&2){let d=F(7);m(2),T(i.pageTitle),m(),f("matMenuTriggerFor",d)("disabled",i.isLoading()||i.hasError()||i.helpFiles().length===0),m(),u(i.isLoading()?4:5),m(13),u(i.hasError()?17:i.isLoading()&&i.helpFiles().length===0?18:i.selectedFile()?19:-1)}},dependencies:[I,P,O,V,q,j,z,$,B,R,N,L,D],styles:[".fullpage-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center}.fullpage-header-title[_ngcontent-%COMP%]{margin-block-start:0px;margin-block-end:0px;padding:18px 24px 13px;color:var(--mat-dialog-subhead-color, var(--mat-sys-on-surface, rgba(0, 0, 0, .87)));font-family:var(--mat-dialog-subhead-font, var(--mat-sys-headline-small-font, inherit));line-height:var(--mat-dialog-subhead-line-height, var(--mat-sys-headline-small-line-height, 1.5rem));font-size:var(--mat-dialog-subhead-size, var(--mat-sys-headline-small-size, 1rem));font-weight:var(--mat-dialog-subhead-weight, var(--mat-sys-headline-small-weight, 400));letter-spacing:var(--mat-dialog-subhead-tracking, var(--mat-sys-headline-small-tracking, .03125em))}.mat-mdc-dialog-content[_ngcontent-%COMP%]{max-height:max-content}.dialog-close-icon[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:nowrap;gap:5px;padding-right:15px} .markdown-content{display:block;height:calc(100% - 75px);width:100%;overflow-x:scroll;padding:25px;font-size:1.1rem;line-height:1.7;background:var(--mat-sys-surface-container, #fff);color:var(--mat-sys-on-surface, #222);border-radius:12px;box-shadow:0 2px 8px #00000012;max-width:900px;margin:0 auto} .markdown-content h1, .markdown-content h2, .markdown-content h3, .markdown-content h4{color:var(--mat-sys-primary, #1976d2);margin-top:1.5em;margin-bottom:.5em;font-weight:600} .markdown-content pre{padding:1em;overflow-x:auto} .markdown-content table{border:1px solid var(--mat-sys-on-background);border-collapse:collapse;width:100%;margin:1em 0} .markdown-content table td{border:1px solid var(--mat-sys-on-background);padding:8px;text-align:left} .markdown-content th{color:var(--mat-sys-primary, #1976d2);font-weight:600;padding:.5em 1em;border:2px solid var(--mat-sys-primary, #1976d2);text-align:left} .markdown-content table tr:nth-child(2n){background-color:var(--mat-sys-surface-container-high)} .markdown-content a{color:var(--mat-sys-primary, #1976d2);text-decoration:underline} .markdown-content a:hover{text-decoration:none;color:var(--mat-sys-secondary, #005fa3)} .markdown-content ul, .markdown-content ol{margin-left:2em;margin-bottom:1em} .markdown-content blockquote{border-left:4px solid var(--mat-sys-tertiary);background:var(--mat-sys-on-tertiary-fixed-variant);padding:.5em 1em;color:var(--mat-sys-on-surface-variant, #555);margin:1em 0}"]})}return e})();export{he as AppHelpComponent};
|
package/public/chunk-IPSRX374.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as B,b as U,c as z,d as A,e as N,f as j}from"./chunk-52M2PJJL.js";import{a as F}from"./chunk-IJ22WXFB.js";import{e as L,g as E,h as V}from"./chunk-RYHOAWDD.js";import{a as H}from"./chunk-4HLTLR5F.js";import"./chunk-HIADZ4BV.js";import"./chunk-OQULS6SV.js";import{m as k}from"./chunk-AYVYZ27A.js";import{Fa as d,Gd as O,Hb as T,Hd as P,Ic as $,Kb as s,Lb as R,Mc as S,Oa as M,_d as D,bb as b,cb as I,db as w,fb as v,ga as g,gb as f,hb as h,ib as a,ja as u,jb as r,ka as _,kb as x,ra as c,rb as y,t as p,tb as C,vb as l}from"./chunk-OB3QLUH6.js";var K=(t,o)=>o.id;function q(t,o){if(t&1){let e=y();a(0,"button",8),C("click",function(){let n=u(e).$implicit,m=l();return _(m.displayDashboards(n.displayId))}),s(1),r()}if(t&2){let e=o.$implicit,i=l();T("selected",i.selectedDisplayButtonId()===e.displayId),d(),R(e.displayName)}}function W(t,o){t&1&&(a(0,"div",6),x(1,"mat-progress-spinner",9),r())}function G(t,o){if(t&1){let e=y();a(0,"tile-large-icon",11,0),C("click",function(){let n=u(e).$index,m=l(2);return _(m.setActiveScreen(n))}),r()}if(t&2){let e=o.$implicit,i=o.$index,n=l(2);h("active",n.activeScreen.value()===i)("svgIcon",e.icon)("iconSize",72)("label",e.name)}}function J(t,o){if(t&1&&v(0,G,2,4,"tile-large-icon",10,K),t&2){let e=l();f(e.screens.value())}}function Q(t,o){t&1&&(a(0,"div",7)(1,"mat-icon",12),s(2,"cast"),r(),a(3,"div",13)(4,"p"),s(5,"Select an available KIP instance in the menu."),r(),a(6,"p"),s(7,"To allow remote control of a dashboard, on that KIP device open Options \u2192 Display \u2192 Remote Control and enable it."),r()()())}var ue=(()=>{class t{http=g($);_settings=g(k);HOST_URL=this._settings.signalkUrl.url;pageTitle="Remote Control";displayId=c(null);displays=c(null);screens=S(()=>{if(this.displayId())return`${this.HOST_URL}/plugins/kip/displays/${this.displayId()}`});activeScreen=S(()=>{if(this.displayId())return`${this.HOST_URL}/plugins/kip/displays/${this.displayId()}/activeScreen`});selectedDisplayButtonId=c(null);ngOnInit(){p(this.http.get(`${this.HOST_URL}/plugins/kip/displays`)).then(e=>{this.displays.set(e)})}displayDashboards(e){this.displayId.set(e),this.selectedDisplayButtonId.set(e)}setActiveScreen(e){p(this.http.put(`${this.HOST_URL}/plugins/kip/displays/${this.displayId()}/activeScreen`,{screenIdx:e})).then(i=>{i.statusCode!==200&&console.error(`Failed to set active screen: ${i.message}`)}),this.activeScreen.set(e)}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=M({type:t,selectors:[["remote-control"]],decls:10,vars:2,consts:[["tile",""],[3,"pageTitle"],[1,"sidenav-remote-control-container"],["mode","side","opened",""],["mat-list-item","","tabindex","0",3,"selected"],[1,"sidenav-remote-control-content"],["aria-label","Loading screens",1,"loading-container"],["role","status","aria-live","polite",1,"empty-state-msg"],["mat-list-item","","tabindex","0",3,"click"],["mode","indeterminate","diameter","64","strokeWidth","5"],["tabindex","0",3,"active","svgIcon","iconSize","label"],["tabindex","0",3,"click","active","svgIcon","iconSize","label"],["aria-hidden","true","color","primary",1,"empty-state-icon"],[1,"copy"]],template:function(i,n){i&1&&(x(0,"page-header",1),a(1,"mat-sidenav-container",2)(2,"mat-sidenav",3)(3,"mat-action-list"),v(4,q,2,3,"button",4,w),r()(),a(6,"mat-sidenav-content",5),b(7,W,2,0,"div",6)(8,J,2,0)(9,Q,8,0,"div",7),r()()),i&2&&(h("pageTitle",n.pageTitle),d(4),f(n.displays()),d(3),I(n.screens.isLoading()?7:n.screens.hasValue()?8:9))},dependencies:[H,A,U,z,B,V,L,E,D,j,N,F,P,O],styles:[".sidenav-remote-control-container[_ngcontent-%COMP%]{height:calc(100% - 87px);width:calc(100% - 48px);margin:0 24px 24px;border:1px solid var(--mat-sys-outline-variant)}mat-sidenav[_ngcontent-%COMP%]{width:150px;--mat-sidenav-container-shape: square}.selected[_ngcontent-%COMP%]{background-color:var(--mat-sys-inverse-on-surface)}.loading-container[_ngcontent-%COMP%]{min-height:100%;display:flex;align-items:center;justify-content:center;padding:24px}.sidenav-remote-control-content[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:wrap;align-content:flex-start;height:100%;width:calc(100% - 150px);padding:5px;gap:5px;overflow-y:auto;scrollbar-width:none;overflow-x:hidden;scroll-behavior:smooth;flex:1 1 auto;min-height:0}tile-large-icon[_ngcontent-%COMP%]{width:190px}.empty-state-msg[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex-wrap:nowrap;align-items:center;justify-content:center;height:100%;width:calc(100% - 150px);min-height:70vh;padding:2rem;text-align:center;color:var(--mat-sys-outline-variant);font-style:italic}.empty-state-icon[_ngcontent-%COMP%]{font-size:4rem;width:4rem;height:4rem;color:var(--mat-sys-outline-variant);margin-bottom:1rem}"]})}return t})();export{ue as RemoteControlComponent};
|
package/public/chunk-JCW5H5WP.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as D}from"./chunk-SVP7ZRWY.js";import{a as f,d as I,e as S,m as b}from"./chunk-AYVYZ27A.js";import{$c as E,Ic as A,Nc as P,Oc as m,Sc as M,Wc as j,a as g,b as v,c as C,ca as u,cc as p,ec as h,f as R,ga as a,j as w,l as y,pa as N,ra as l,t as _}from"./chunk-OB3QLUH6.js";var T=[{id:null,name:"Dashboard 1",icon:"dashboard-dashboard",configuration:[{w:24,h:24,id:"d1d58e6f-f8b4-4a72-9597-7f92aa6776fc",selector:"widget-host2",input:{widgetProperties:{type:"widget-tutorial",uuid:"d1d58e6f-f8b4-4a72-9597-7f92aa6776fc"}},x:0,y:0}],collapseSplitShell:!1}];var x=(()=>{class i{_settings=a(b);_router=a(j);dashboards=l([],{equal:S});activeDashboard=l(0);_widgetAction=new y(null);widgetAction$=this._widgetAction.asObservable();isDashboardStatic=l(!0);layoutEditSaved=l(0);layoutEditCanceled=l(0);constructor(){let e=this._settings.getDashboardConfig();if(!e||e.length===0){console.warn("[Dashboard Service] No dashboards found in settings, creating blank dashboard");let t=T.map(r=>v(g({},r),{id:f.create()}));this.dashboards.set([...t])}else this.dashboards.set(this._settings.getDashboardConfig());h(()=>{this._settings.saveDashboards(this.dashboards())})}toggleStaticDashboard(){this.isDashboardStatic.set(!this.isDashboardStatic())}add(e,t,r,s){let n=0;return this.dashboards.update(o=>{let c=[...o,{id:f.create(),name:e,icon:r??"dashboard-dashboard",configuration:t,collapseSplitShell:s??!1}];return n=c.length-1,c}),n}update(e,t,r,s){this.dashboards.update(n=>n.map((o,c)=>c===e?v(g({},o),{name:t,icon:r??"dashboard-dashboard",collapseSplitShell:s??!1}):o))}delete(e){this.dashboards.update(t=>t.filter((r,s)=>s!==e)),this.dashboards().length===0?(this.add("Dashboard "+(this.dashboards().length+1),[]),this.activeDashboard.set(0)):this.activeDashboard()>this.dashboards().length-1&&this.activeDashboard.set(this.dashboards().length-1)}duplicate(e,t,r,s){if(e<0||e>=this.dashboards().length)return console.error(`[Dashboard Service] Invalid itemIndex: ${e}`),-1;let n=this.dashboards()[e],o=I(n);o.id=f.create(),o.name=t,o.icon=r||"dashboard-dashboard",o.collapseSplitShell=s??!1,Array.isArray(o.configuration)?o.configuration.forEach(d=>{d&&d.input?.widgetProperties?(d.id=f.create(),d.input.widgetProperties.uuid=d.id):console.error("Dashboard Service] Widget configuration is missing required properties:",d)}):(console.error("Dashboard Service] Dashboard configuration is not an array:",o.configuration),o.configuration=[]);let c=-1;return this.dashboards.update(d=>{let k=[...d,o];return c=k.length-1,k}),c}updateConfiguration(e,t){this.dashboards.update(r=>r.map((s,n)=>n===e?S(s.configuration,t)?s:v(g({},s),{configuration:t}):s))}previousDashboard(){this.activeDashboard()+1>this.dashboards().length-1?this.activeDashboard.set(0):this.activeDashboard.set(this.activeDashboard()+1)}nextDashboard(){this.activeDashboard()-1<0?this.activeDashboard.set(this.dashboards().length-1):this.activeDashboard.set(this.activeDashboard()-1)}setActiveDashboard(e){e!==this.activeDashboard()&&(e>=0&&e<this.dashboards().length?this.activeDashboard.set(e):console.error(`[Dashboard Service] Invalid dashboard ID: ${e}`))}navigateToActive(){this._router.navigate(["/dashboard",this.activeDashboard()])}navigateTo(e){e>=0&&e<this.dashboards().length?this._router.navigate(["/dashboard",e]):console.error(`[Dashboard Service] Invalid dashboard ID: ${e}`)}navigateToNextDashboard(){let e=null;this.activeDashboard()-1<0?e=this.dashboards().length-1:e=this.activeDashboard()-1,this._router.navigate(["/dashboard",e])}navigateToPreviousDashboard(){let e=null;this.activeDashboard()+1>=this.dashboards().length?e=0:e=this.activeDashboard()+1,this._router.navigate(["/dashboard",e])}deleteWidget(e){this._widgetAction.next({id:e,operation:"delete"})}duplicateWidget(e){this._widgetAction.next({id:e,operation:"duplicate"})}setStaticDashboard(e){this.isDashboardStatic.set(e)}notifyLayoutEditSaved(){this.layoutEditSaved.update(e=>e+1)}notifyLayoutEditCanceled(){this.layoutEditCanceled.update(e=>e+1)}static \u0275fac=function(t){return new(t||i)};static \u0275prov=u({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var $={name:"@mxtommy/kip",version:"4.0.1",description:"An advanced and versatile marine instrumentation package to display Signal K data.",license:"MIT",author:{name:"Thomas St.Pierre, David Godin"},contributors:[{name:"David Godin",email:"godind@hotmail.com"},{name:"Thomas St.Pierre",email:"thomas@samoht.ca"}],homepage:"https://github.com/mxtommy/Kip",bugs:"https://github.com/mxtommy/Kip/issues",repository:{type:"git",url:"git+https://github.com/mxtommy/Kip.git"},keywords:["signalk-webapp","signalk-category-instruments","signalk-category-notifications","signalk-node-server-plugin","signal k","signalk","instruments","dashboard","marine","nmea"],signalk:{appIcon:"assets/icon-72x72.png",displayName:"KIP Instrument MFD"},main:"plugin/index.js","signalk-plugin-enabled-by-default":!0,scripts:{test:"ng test",lint:"ng lint",dev:"ng serve --configuration=dev --serve-path=/@mxtommy/kip/","build:plugin":"tsc -p ./kip-plugin/tsconfig.plugin.json","build:dev":"ng build --configuration=dev","build:prod":"ng build --configuration=production","build:all":"npm run build:plugin && npm run build:prod",e2e:"ng e2e","generate:widget":"npx schematics ./tools/schematics/collection.json:create-host2-widget --dry-run=false"},schematics:"tools/schematics/collection.json",devDependencies:{"@angular-devkit/schematics-cli":"^20.1.6","@angular-devkit/build-angular":"^20.1.6","@angular/animations":"20.1.7","@angular/build":"^20.1.6","@angular/cdk":"20.1.6","@angular/cli":"^20.1.6","@angular/common":"20.1.7","@angular/compiler":"20.1.7","@angular/compiler-cli":"20.1.7","@angular/core":"20.1.7","@angular/forms":"20.1.7","@angular/language-service":"20.1.7","@angular/material":"20.1.6","@angular/platform-browser":"20.1.7","@angular/platform-browser-dynamic":"20.1.7","@angular/router":"20.1.7","@godind/ng-canvas-gauges":"^6.2.1","@robloche/chartjs-plugin-streaming":"^3.1.0","@types/canvas-gauges":"^2.1.8","@types/howler":"^2.2.10","@types/jasmine":"~3.6.0","@types/jasminewd2":"^2.0.9","@types/js-quantities":"^1.6.6","@types/lodash-es":"^4.17.9","@types/node":"^24.1.0","@zakj/no-sleep":"^0.13.5","angular-eslint":"20.1.1","chart.js":"^4.4.9","chartjs-adapter-date-fns":"^3.0.0","chartjs-plugin-annotation":"^3.0.1",codelyzer:"^6.0.0","compare-versions":"^6.1.1","core-js":"^3.13.1","date-fns":"^2.30.0",eslint:"^9.29.0",gridstack:"^12.3.3",howler:"^2.2.4","jasmine-core":"~4.0.1","jasmine-spec-reporter":"~5.0.0","js-quantities":"^1.8.0",karma:"^6.4.4","karma-chrome-launcher":"~3.1.0","karma-cli":"~2.0.0","karma-coverage-istanbul-reporter":"^3.0.3","karma-jasmine":"~4.0.0","karma-jasmine-html-reporter":"^1.6.0","lodash-es":"^4.17.21","ng-packagr":"^20.0.1","ngx-markdown":"^20.0.0",prismjs:"^1.30.0",clipboard:"^2.0.11","ngx-resize-observer":"^3.1.0",protractor:"~7.0.0","pwa-asset-generator":"^8.1.1",rxjs:"^7.8.2",sass:"^1.49.9",screenfull:"^6.0.2",steelseries:"^2.0.9","ts-node":"^10.9.2",tslib:"^2.6.2",typescript:"^5.8.3","zone.js":"^0.15.1"},dependencies:{"@signalk/server-api":"^2.7.2"}};var L=(()=>{class i{_http=a(A);_settings=a(b);_dashboard=a(x);_data=a(D);_destroyRef=a(N);_displayName=m(this._settings.getInstanceNameAsO());_isRemoteControl=m(this._settings.getIsRemoteControlAsO());PLUGIN_URL=this._settings.signalkUrl.url+"/plugins/kip";KIP_UUID=this._settings.KipUUID;ACTIVE_SCREEN_PATH=`self.displays.${this.KIP_UUID}.activeScreen`;previousIsRemoteControl=!1;isRemoteScreenIdxCleared=!0;constructor(){let e=this.setActiveDashboard(this.KIP_UUID,null).then(()=>{console.log("[Remote Dashboards] Startup: cleared stale activeScreen (unconditional)")}).catch(t=>{console.warn("[Remote Dashboards] Startup: failed to clear stale activeScreen",t)});h(()=>{let t=this._isRemoteControl();if(!t&&!this.previousIsRemoteControl)return;let r=this._displayName(),s=this._dashboard.dashboards();p(()=>{this.previousIsRemoteControl=t;let n;if(!t)n=null;else{let o=s.map(k=>{var V=k,{configuration:c}=V,d=C(V,["configuration"]);return d});n={displayName:r,screens:o},this.isRemoteScreenIdxCleared=!1}this.shareScreens(this.KIP_UUID,n).then(()=>{console.log("[Remote Dashboards] Screen configuration shared")}).catch(o=>{console.error("[Remote Dashboards] Error sharing screen configuration:",o)})})}),h(()=>{let t=this._isRemoteControl(),r=this._dashboard.activeDashboard();p(()=>{t?this.setActiveDashboard(this.KIP_UUID,r).then(()=>{}).catch(s=>{console.error("[Remote Dashboards] Error sharing active dashboard:",s)}):this.isRemoteScreenIdxCleared||(this.setActiveDashboard(this.KIP_UUID,null).then(()=>{console.log("[Remote Dashboards] Disabled: Cleared active dashboard on server")}).catch(s=>{console.error("[Remote Dashboards] Error clearing active dashboard on server:",s)}),this.isRemoteScreenIdxCleared=!0)})}),e.finally(()=>this.setupRemoteControlListener())}setupRemoteControlListener(){this._settings.getIsRemoteControlAsO().pipe(P(this._destroyRef)).subscribe(e=>{e?this._data.subscribePath(this.ACTIVE_SCREEN_PATH,"default").pipe(P(this._destroyRef)).subscribe(t=>{if(t.data.value==null)return;let r=Number(t.data.value);!isNaN(r)&&r>=0&&r<this._dashboard.dashboards().length&&this._dashboard.activeDashboard()!==r&&(console.log(`[Remote Dashboards] Setting active dashboard to ${r} from remote update`),this._dashboard.navigateTo(r))}):this._data.unsubscribePath(this.ACTIVE_SCREEN_PATH)})}setActiveDashboard(e,t){return R(this,null,function*(){let r=t===null?null:{screenIdx:t};return _(this._http.put(`${this.PLUGIN_URL}/displays/${e}/activeScreen`,r))})}shareScreens(e,t){let r=t===null?null:g({},t);return _(this._http.put(`${this.PLUGIN_URL}/displays/${e}`,r))}static \u0275fac=function(t){return new(t||i)};static \u0275prov=u({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var De=(()=>{class i{MODE_PATH="self.environment.mode";configurableThemeColors=[{label:"Contrast",value:"contrast"},{label:"Blue",value:"blue"},{label:"Green",value:"green"},{label:"Orange",value:"orange"},{label:"Yellow",value:"yellow"},{label:"Pink",value:"pink"},{label:"Purple",value:"purple"},{label:"Grey",value:"grey"}];snackbarAppNotifications=new w;cssThemeColorRoles$=new y(null);_cssThemeColorRoles=null;_settings=a(b);_data=a(D);_iconRegistry=a(E);_sanitizer=a(M);_remote=a(L);isNightMode=l(!1);_useAutoNightMode=m(this._settings.getAutoNightModeAsO(),{requireSync:!0});_theme=m(this._settings.getThemeNameAsO(),{requireSync:!0});_redNightMode=m(this._settings.getRedNightModeAsO(),{requireSync:!0});_environmentMode=m(this._data.subscribePath(this.MODE_PATH,"default"));previousEnvironmentMode=null;appVersion=l($.version);browserVersion=l("Unknown");osVersion=l("Unknown");constructor(){this._iconRegistry.addSvgIconSet(this._sanitizer.bypassSecurityTrustResourceUrl("assets/svg/icons.svg")),h(()=>{this._theme()==="light-theme"?document.body.classList.toggle("light-theme",this._theme()==="light-theme"):document.body.classList.remove("light-theme")}),h(()=>{let e=this._environmentMode().data.value;p(()=>{this.previousEnvironmentMode!==e&&(this.previousEnvironmentMode=e,this._useAutoNightMode()&&(this.isNightMode.set(e==="night"),this.toggleDayNightMode()))})}),h(()=>{let e=this._redNightMode();p(()=>{e?this.toggleDayNightMode():this.toggleDayNightMode()})}),this.readThemeCssRoleVariables(),this._cssThemeColorRoles=this.cssThemeColorRoles$.getValue(),this.browserVersion.set(this.getBrowserVersion()),this.osVersion.set(this.getOSVersion()),console.log("*********** KIP Version Information ***********"),console.log(`** App Version: ${this.appVersion()}`),console.log(`** Browser Version: ${this.browserVersion()}`),console.log(`** OS Version: ${this.osVersion()}`),console.log("***********************************************")}sendSnackbarNotification(e,t=1e4,r=!1,s="Dismiss"){this.snackbarAppNotifications.next({message:e,duration:t,silent:r,action:s})}getSnackbarAppNotifications(){return this.snackbarAppNotifications.asObservable()}readThemeCssRoleVariables(){let e=document.body,t=getComputedStyle(e),r={background:t.getPropertyValue("--mat-sys-background").trim(),cardColor:t.getPropertyValue("--kip-widget-card-background-color").trim(),blue:t.getPropertyValue("--kip-blue-color").trim(),blueDim:t.getPropertyValue("--kip-blue-dim-color").trim(),blueDimmer:t.getPropertyValue("--kip-blue-dimmer-color").trim(),green:t.getPropertyValue("--kip-green-color").trim(),greenDim:t.getPropertyValue("--kip-green-dim-color").trim(),greenDimmer:t.getPropertyValue("--kip-green-dimmer-color").trim(),grey:t.getPropertyValue("--kip-grey-color").trim(),greyDim:t.getPropertyValue("--kip-grey-dim-color").trim(),greyDimmer:t.getPropertyValue("--kip-grey-dimmer-color").trim(),orange:t.getPropertyValue("--kip-orange-color").trim(),orangeDim:t.getPropertyValue("--kip-orange-dim-color").trim(),orangeDimmer:t.getPropertyValue("--kip-orange-dimmer-color").trim(),pink:t.getPropertyValue("--kip-pink-color").trim(),pinkDim:t.getPropertyValue("--kip-pink-dim-color").trim(),pinkDimmer:t.getPropertyValue("--kip-pink-dimmer-color").trim(),purple:t.getPropertyValue("--kip-purple-color").trim(),purpleDim:t.getPropertyValue("--kip-purple-dim-color").trim(),purpleDimmer:t.getPropertyValue("--kip-purple-dimmer-color").trim(),contrast:t.getPropertyValue("--kip-contrast-color").trim(),contrastDim:t.getPropertyValue("--kip-contrast-dim-color").trim(),contrastDimmer:t.getPropertyValue("--kip-contrast-dimmer-color").trim(),yellow:t.getPropertyValue("--kip-yellow-color").trim(),yellowDim:t.getPropertyValue("--kip-yellow-dim-color").trim(),yellowDimmer:t.getPropertyValue("--kip-yellow-dimmer-color").trim(),port:t.getPropertyValue("--kip-port-color").trim(),starboard:t.getPropertyValue("--kip-starboard-color").trim(),zoneNominal:t.getPropertyValue("--kip-zone-nominal-color").trim(),zoneAlert:t.getPropertyValue("--kip-zone-alert-color").trim(),zoneWarn:t.getPropertyValue("--kip-zone-warn-color").trim(),zoneAlarm:t.getPropertyValue("--kip-zone-alarm-color").trim(),zoneEmergency:t.getPropertyValue("--kip-zone-emergency-color").trim()};this.cssThemeColorRoles$.next(r)}get cssThemeColors(){return this._cssThemeColorRoles}setBrightness(e,t=!1){let r=document.body;r.style.setProperty("--kip-nightModeBrightness",`${e}`);let s=t?" sepia(0.5) hue-rotate(-30deg)":"";r.style.setProperty("--kip-nightModeFilters",s)}toggleDayNightMode(){this.isNightMode()?this._redNightMode()?(document.body.classList.toggle("night-theme",!0),this.setBrightness(1,!1)):(this.setBrightness(this._settings.getNightModeBrightness(),!0),document.body.classList.remove("night-theme"),this._theme()==="light-theme"?document.body.classList.toggle("light-theme",this._theme()==="light-theme"):document.body.classList.remove("light-theme")):(document.body.classList.remove("night-theme"),this._theme()==="light-theme"&&document.body.classList.toggle("light-theme",this._theme()==="light-theme"),this.setBrightness(1,!1)),this.readThemeCssRoleVariables(),this._cssThemeColorRoles=this.cssThemeColorRoles$.getValue()}getBrowserVersion(){let e=navigator.userAgent,t="Unknown";return e.includes("Edg")?t=`Edge ${e.match(/Edg\/(\d+)/)?.[1]}`:e.includes("Chrome")&&!e.includes("Edg")&&!e.includes("Chromium")?t=`Chrome ${e.match(/Chrome\/(\d+)/)?.[1]}`:e.includes("Chromium")?t=`Chromium ${e.match(/Chromium\/(\d+)/)?.[1]}`:e.includes("Firefox")?t=`Firefox ${e.match(/Firefox\/(\d+)/)?.[1]}`:e.includes("Safari")&&!e.includes("Chrome")&&!e.includes("Chromium")?t=`Safari ${e.match(/Version\/(\d+)/)?.[1]}`:(e.includes("Opera")||e.includes("OPR"))&&(t=`Opera ${e.match(/(Opera|OPR)\/(\d+)/)?.[2]}`),t}getOSVersion(){let e=navigator.platform,t=navigator.userAgent;return e.startsWith("Mac")?"macOS":e.startsWith("Win")?"Windows":/Linux/.test(e)?t.includes("ARM")||t.includes("aarch64")||t.includes("Raspberry")||e.includes("armv7l")||e.includes("armv8l")?"Raspberry Pi":"Linux":"Unknown OS"}static \u0275fac=function(t){return new(t||i)};static \u0275prov=u({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();export{x as a,De as b};
|