@mxtommy/kip 4.4.0 → 4.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/copilot-instructions.md +21 -5
- package/.github/instructions/best-practices.instructions.md +4 -0
- package/.github/instructions/project.instructions.md +47 -10
- package/CHANGELOG.md +13 -0
- package/README.md +11 -7
- package/package.json +8 -5
- package/plugin/duckdb-parquet-storage.service.js +1206 -0
- package/plugin/history-series.service.js +439 -0
- package/plugin/index.js +796 -81
- package/plugin/openApi.json +258 -20
- package/plugin/plugin-auth.service.js +75 -0
- package/plugin-config-data/kip/historicalData/kip-history.duckdb +0 -0
- package/plugin-config-data/kip/historicalData/parquet/chart-1/1772344583976-1772344583976.parquet +0 -0
- package/plugin-config-data/kip/historicalData/parquet/live-1/1771408800000-1771408890000.parquet +0 -0
- package/plugin-config-data/kip/historicalData/parquet/live-1/1771412400000-1771412490000.parquet +0 -0
- package/plugin-config-data/kip/historicalData/parquet/live-1/1771419600000-1771419650000.parquet +0 -0
- package/plugin-config-data/kip/historicalData/parquet/live-1/1772344584154-1772344584154.parquet +0 -0
- package/plugin-config-data/kip/historicalData/parquet/live-1/1772344584191-1772344584191.parquet +0 -0
- package/plugin-config-data/kip/historicalData/parquet/live-1/1772344584268-1772344584268.parquet +0 -0
- package/plugin-config-data/kip/historicalData/parquet/live-2/1771502400000-1771502400000.parquet +0 -0
- package/plugin-config-data/kip/historicalData/parquet/live-3/1771408800000-1771408890000.parquet +0 -0
- package/plugin-config-data/kip/historicalData/parquet/live-3/1771412400000-1771412490000.parquet +0 -0
- package/plugin-config-data/kip/historicalData/parquet/live-3/1771419600000-1771419650000.parquet +0 -0
- package/plugin-config-data/kip/historicalData/parquet/live-3/1772344584268-1772344584268.parquet +0 -0
- package/plugin-config-data/kip/historicalData/parquet/live-4/1771408800000-1771408890000.parquet +0 -0
- package/plugin-config-data/kip/historicalData/parquet/live-4/1771412400000-1771412490000.parquet +0 -0
- package/plugin-config-data/kip/historicalData/parquet/live-4/1771419600000-1771419650000.parquet +0 -0
- package/plugin-config-data/kip/historicalData/parquet/live-5/1771412400000-1771412490000.parquet +0 -0
- package/plugin-config-data/kip/historicalData/parquet/live-5/1771419600000-1771419650000.parquet +0 -0
- package/plugin-config-data/kip/historicalData/parquet/live-6/1771419600000-1771419650000.parquet +0 -0
- package/plugin-config-data/kip/historicalData/parquet/live-prefixed-1/1771408800000-1771408890000.parquet +0 -0
- package/plugin-config-data/kip/historicalData/parquet/live-prefixed-1/1771412400000-1771412490000.parquet +0 -0
- package/plugin-config-data/kip/historicalData/parquet/live-prefixed-1/1771419600000-1771419650000.parquet +0 -0
- package/plugin-config-data/kip/historicalData/parquet/live-prefixed-1/1772344584191-1772344584191.parquet +0 -0
- package/plugin-config-data/kip/historicalData/parquet/live-prefixed-1/1772344584268-1772344584268.parquet +0 -0
- package/public/assets/help-docs/chartplotter.md +5 -18
- package/public/assets/help-docs/community.md +0 -3
- package/public/assets/help-docs/configuration.md +1 -1
- package/public/assets/help-docs/contact-us.md +0 -4
- package/public/assets/help-docs/dashboards.md +20 -18
- package/public/assets/help-docs/datainspector.md +7 -5
- package/public/assets/help-docs/history-api.md +116 -0
- package/public/assets/help-docs/menu.json +18 -6
- package/public/assets/help-docs/nodered-control-flows.md +125 -0
- package/public/assets/help-docs/putcontrols.md +101 -60
- package/public/assets/help-docs/welcome.md +6 -7
- package/public/assets/help-docs/widget-historical-series.md +66 -0
- package/public/assets/help-docs/zones.md +5 -10
- package/public/chunk-2ICAVOT2.js +10 -0
- package/public/chunk-6XFWUUDD.js +3 -0
- package/public/chunk-A6DQJFP4.js +16 -0
- package/public/chunk-B75MT7ND.js +1 -0
- package/public/{chunk-HJQQWPGC.js → chunk-CEB42O2C.js} +1 -1
- package/public/chunk-CHGXAEKT.js +2 -0
- package/public/chunk-D7VDX7ZF.js +5 -0
- package/public/chunk-DD4F6F4S.js +9 -0
- package/public/{chunk-KIR67PZ2.js → chunk-DEGYRCMI.js} +1 -1
- package/public/{chunk-UVAQADRE.js → chunk-DEM56G4S.js} +1 -1
- package/public/chunk-DYTBBUMI.js +4 -0
- package/public/{chunk-PGELIHBX.js → chunk-EDNYYQIZ.js} +2 -2
- package/public/chunk-FNF7M3AE.js +1 -0
- package/public/chunk-IHURI4IH.js +5 -0
- package/public/chunk-J3LDKVIS.js +50 -0
- package/public/{chunk-PSF2OKKT.js → chunk-JB4YVVNW.js} +1 -1
- package/public/chunk-KPHICV76.js +5 -0
- package/public/chunk-KZ5DUKAX.js +1 -0
- package/public/{chunk-BNIQFWQ6.js → chunk-LQDSU4WS.js} +3 -3
- package/public/{chunk-PDYVZHOK.js → chunk-MGPPVLZ7.js} +1 -1
- package/public/{chunk-TKC7ROZ7.js → chunk-R7RQHWKJ.js} +1 -1
- package/public/chunk-S72JTJPN.js +6 -0
- package/public/chunk-UYIJND2R.js +1 -0
- package/public/chunk-YCEXTKGG.js +1 -0
- package/public/chunk-YKJKIWXO.js +6 -0
- package/public/index.html +1 -1
- package/public/main-EG2WF4EO.js +1 -0
- package/tools/schematics/create-host2-widget/files/readme/README.md.template +1 -1
- package/public/assets/help-docs/datasets.md +0 -95
- package/public/chunk-2KMYPGX4.js +0 -2
- package/public/chunk-2MWBAYPJ.js +0 -8
- package/public/chunk-3BGR52TW.js +0 -53
- package/public/chunk-4IHRH3BQ.js +0 -9
- package/public/chunk-557F3J5T.js +0 -1
- package/public/chunk-5DLSQ773.js +0 -4
- package/public/chunk-7HLFWAA7.js +0 -1
- package/public/chunk-IWK4FHBL.js +0 -5
- package/public/chunk-J4IGUIZA.js +0 -6
- package/public/chunk-JP7ZAJ6C.js +0 -3
- package/public/chunk-KKJXPB75.js +0 -8
- package/public/chunk-MMIOUKLI.js +0 -1
- package/public/chunk-PESXPDBT.js +0 -2
- package/public/chunk-PKATAZA2.js +0 -1
- package/public/chunk-TGGJAGV7.js +0 -15
- package/public/chunk-VH4ZIU4T.js +0 -4
- package/public/chunk-XEJJOWK6.js +0 -2
- package/public/main-I7M3MAJT.js +0 -1
- package/rm-npmjs-beta.sh +0 -50
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{$a as xr,Ac as $,Bd as Ie,Ca as de,Da as mi,De as Vi,Eb as F,F as ci,Fa as J,Fb as R,Gb as bi,Ha as re,He as Ei,Ia as Ee,Ja as Z,Jc as Et,Je as Ii,La as rt,Lc as Dr,Ld as wi,M as De,N as ui,Nb as ot,Nd as Ai,Oe as lt,Pb as L,Pc as kr,Pe as Oi,Rb as X,Re as Pi,Se as Fi,U as di,Vb as _i,Vd as Ti,Wa as P,Wb as wr,Xb as Ar,Xd as Mr,Ya as Vt,Za as gi,a as C,ab as p,b as j,bc as at,ce as Di,da as fi,dc as Ci,ea as pi,ec as Q,f as I,fc as st,gb as it,gc as Tr,ge as It,ha as Mt,hb as nt,ib as m,ja as O,je as Vr,k as G,ka as x,ke as Er,la as tt,lb as _,ld as Si,le as ki,m as v,mb as vi,me as Mi,na as z,pa as f,pe as Ir,qb as yi,r as si,s as li,sc as N,t as Sr,ua as ke,va as Me,vb as ie,vd as xi,w as B,xb as Ce,y as Dt,ya as Ve,yb as Se,z as kt,za as hi}from"./chunk-A6DQJFP4.js";var d=(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})(d||{}),Ri=(()=>{class t{config={httpRetryCount:3,webSocketRetryCount:5,retryIntervals:[2e3,3e3,5e3],notificationDebounceMs:0};_currentState$=new v(d.Disconnected);_status$=new v(this.createStatus(d.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();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(d.HTTPDiscovering,"Discovering Signal K server...")}onHTTPDiscoverySuccess(){console.log("[ConnectionStateMachine] HTTP discovery successful"),this._httpRetryCount=0,this.setState(d.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(d.HTTPRetrying,`HTTP connection failed. Retrying (${this._httpRetryCount}/${this.config.httpRetryCount})...`,this._httpRetryCount,this.config.httpRetryCount),this.scheduleHTTPRetry()):this.setState(d.PermanentFailure,`HTTP connection failed after ${this.config.httpRetryCount} attempts. Check server URL.`,this.config.httpRetryCount,this.config.httpRetryCount)}startWebSocketConnection(){if(!(this.currentState===d.HTTPConnected||this.currentState===d.WebSocketRetrying||this.currentState===d.WebSocketConnecting||this.currentState===d.Connected))return this.currentState===d.HTTPDiscovering,void 0;console.log("[ConnectionStateMachine] Starting WebSocket connection"),this._webSocketRetryCount=0,this.setState(d.WebSocketConnecting,"Connecting to Signal K Websocket...")}onWebSocketConnected(){console.log("[ConnectionStateMachine] WebSocket connected"),this._webSocketRetryCount=0,this.setState(d.Connected,"Connected to Signal K server")}onWebSocketError(e){if(console.log(`[ConnectionStateMachine] WebSocket error: ${e}`),this.currentState!==d.HTTPConnected&&this.currentState!==d.WebSocketConnecting&&this.currentState!==d.Connected&&this.currentState!==d.WebSocketRetrying){console.log("[ConnectionStateMachine] HTTP connection lost, restarting HTTP discovery"),this.startHTTPDiscovery("HTTP connection lost during WebSocket operation");return}this._webSocketRetryCount++,this.setState(d.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(d.Disconnected,"Application restarting...")}isHTTPConnected(){return this.currentState===d.HTTPConnected||this.currentState===d.WebSocketConnecting||this.currentState===d.Connected||this.currentState===d.WebSocketRetrying}isFullyConnected(){return this.currentState===d.Connected}getHttpRetryWindowMs(e=0){return Array.from({length:this.config.httpRetryCount},(n,o)=>{let a=Math.min(o,this.config.retryIntervals.length-1);return this.config.retryIntervals[a]}).reduce((n,o)=>n+o,0)+e}setState(e,i,n,o){this._currentState$.next(e);let a=this.createStatus(e,i,n,o);e===d.HTTPDiscovering||e===d.WebSocketConnecting?this._status$.next(a):e===d.Connected?(this.clearNotificationTimeout(),this._notificationTimeout=setTimeout(()=>{this._status$.next(a)},this.config.notificationDebounceMs)):(this.clearNotificationTimeout(),this._status$.next(a))}createStatus(e,i,n,o){return{state:e,operation:this.stateToOperationCode(e),message:i,retryCount:n||0,maxRetries:o||0,timestamp:new Date}}stateToOperationCode(e){switch(e){case d.Disconnected:return 0;case d.HTTPDiscovering:case d.WebSocketConnecting:return 1;case d.Connected:return 2;case d.HTTPError:case d.WebSocketError:case d.HTTPRetrying:case d.WebSocketRetrying:return 3;case d.HTTPConnected:return 2;case d.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(d.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(d.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=x({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var Oe=(()=>{class t{TIMEOUT_DURATION=1e4;connectionStateMachine=f(Ri);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(Ie);currentProxyEnabled;currentSubscribeAll;validateSignalKUrl(e){return I(this,null,function*(){if(!e)throw new Error("Please enter a server URL");try{let n=new URL(e);if(!["http:","https:"].includes(n.protocol))throw new Error("URL must start with http:// or https://")}catch(n){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 B(this.http.get(i,{observe:"response"}).pipe(Dt(5e3),De(o=>{throw console.error("[Connection Service] HTTP Error details:",o),o.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")):o.status===0||o.status===void 0?new Error("Cannot connect to server - check the URL format and ensure the server is accessible"):o.status===404?new Error("Server found but no Signal K service detected - verify this is a Signal K server"):o.status===403?new Error("Server refused connection - check if the server allows connections from this browser"):o.status>=500?new Error(`Server error (${o.status}) - the Signal K server may be having issues`):new Error(`Connection failed (${o.status}) - ${o.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(n){throw console.error(`[Connection Service] Validation failed for ${e}:`,n.message),n}})}initializeConnection(e,i,n){return I(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=n;let o={operation:1,message:"Connecting...",serverDescription:null,httpServiceUrl:null,WsServiceUrl:null};this.signalKURL=e,this.serverServiceEndpoint$.next(o),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 B(this.http.get(a,{observe:"response"}).pipe(Dt(this.TIMEOUT_DURATION),De(l=>(l.name==="TimeoutError"&&console.error("[Connection Service] Connection request timed out after "+this.TIMEOUT_DURATION+"ms"),Sr(l)))));Object.assign(o,this.processEndpointResponse(s,i,n)),this.connectionStateMachine.onHTTPDiscoverySuccess()}catch(s){o.operation=3,o.message=s.message,this.connectionStateMachine.onHTTPDiscoveryError(s.message),this.handleError(s)}finally{o.subscribeAll=!!n,this.serverServiceEndpoint$.next(o)}})}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 I(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 B(this.http.get(e,{observe:"response"}).pipe(Dt(this.TIMEOUT_DURATION),De(o=>(o.name==="TimeoutError"&&console.error("[Connection Service] Connection request timed out after "+this.TIMEOUT_DURATION+"ms"),Sr(o))))),n=this.processEndpointResponse(i,this.currentProxyEnabled,this.currentSubscribeAll);this.connectionStateMachine.onHTTPDiscoverySuccess(),this.serverServiceEndpoint$.next(n)}catch(i){let n={operation:3,message:i.message,serverDescription:null,httpServiceUrl:null,WsServiceUrl:null};this.connectionStateMachine.onHTTPDiscoveryError(i.message),this.serverServiceEndpoint$.next(n),this.handleError(i)}})}processEndpointResponse(e,i,n){console.debug("[Connection Service] Signal K HTTP Endpoints retrieved"),this.serverVersion$.next(e.body.server.version);let o=e.body.endpoints.v1["signalk-http"],a=e.body.endpoints.v1["signalk-ws"],s=e.body.endpoints.v2?.["signalk-http"],l=e.body.endpoints.v2?.["signalk-ws"],c={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"),c.httpServiceUrl=window.location.origin+new URL(o).pathname,c.WsServiceUrl=window.location.protocol.replace("http","ws")+"//"+window.location.host+new URL(a).pathname,s&&(c.httpServiceUrlV2=window.location.origin+new URL(s).pathname),l&&(c.WsServiceUrlV2=window.location.protocol.replace("http","ws")+"//"+window.location.host+new URL(l).pathname);else{c.httpServiceUrl=o;let u=window.location.protocol==="https:";c.WsServiceUrl=u?a.replace("ws://","wss://"):a,s&&(c.httpServiceUrlV2=s),l&&(c.WsServiceUrlV2=u?l.replace("ws://","wss://"):l)}return console.debug("[Connection Service] HTTP URI: "+c.httpServiceUrl),c.httpServiceUrlV2&&console.debug("[Connection Service] HTTP V2 URI: "+c.httpServiceUrlV2),console.debug("[Connection Service] WebSocket URI: "+c.WsServiceUrl),c.WsServiceUrlV2&&console.debug("[Connection Service] WebSocket V2 URI: "+c.WsServiceUrlV2),c.subscribeAll=!!n,c}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,n){this.serverName=e,this.serverRoles=n,console.log(`[Connection Service] Server Name: ${e}, Version: ${i}, Roles: ${JSON.stringify(n)}`)}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=x({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var Ua="/signalk/v1/",Ni="auth/login",ja="auth/logout",Ba="auth/validate",Or=60,La=2147483647,Ui=(()=>{class t{http=f(Ie);conn=f(Oe);_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(di((i,n)=>i?.expiry===n?.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 n=i.httpServiceUrl.substring(0,i.httpServiceUrl.length-4);this.loginUrl=n+Ni,this.logoutUrl=n+ja,this.validateTokenUrl=n+Ba}})}scheduleRenewalChunk(e){let i=Date.now(),n=(e.expiry-Or)*1e3,o=n-i;if(o<=0){this.handleTokenRenewal();return}let a=Math.min(o,La);console.log(a!==o?`[Authentication Service] Large renewal delay (${o} ms). Scheduling first chunk of ${a} ms.`:`[Authentication Service] Scheduling token renewal in ${a} ms (buffered target: ${new Date(n).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),n=e.expiry-i;if(this.isTokenExpired(e.expiry))console.log("[Authentication Service] User session Token expired. Cannot renew."),this.isRenewingToken=!1;else if(n>Or)console.log(`[Authentication Service] Renewal trigger fired early; ${n}s remaining (> buffer ${Or}s). Rescheduling.`),this.isRenewingToken=!1,this.scheduleRenewalChunk(e);else{console.log(`[Authentication Service] User session Token within renewal window (${n}s remaining). Renewing token...`);let o=JSON.parse(localStorage.getItem("connectionConfig"));this.login({usr:o.loginName,pwd:o.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(o){return I(this,arguments,function*({usr:e,pwd:i,newUrl:n}){let a;if(n?a=n.replace(/\/+$/,"")+Ua+Ni: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 B(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,n={token:null,expiry:null,isDeviceAccessToken:!1};i===void 0?(n.token=e,console.log("[Authentication Service] User Session Token received. Token Expiration: NEVER"),this._IsLoggedIn$.next(!0),this._authToken$.next(n),localStorage.setItem("authorization_token",JSON.stringify(n))):this.isTokenExpired(i)?console.log("[Authentication Service] Received expired Session Token from server"):(n.token=e,n.expiry=i,console.log("[Authentication Service] Session Authorization Token received. Token Expiration: "+this.getTokenExpirationDate(n.expiry)),this._IsLoggedIn$.next(!0),this._authToken$.next(n),localStorage.setItem("authorization_token",JSON.stringify(n)))}}isTokenExpired(e){return Math.floor(new Date().getTime()/1e3)>=e}getTokenExpirationDate(e,i){let n=new Date(0);if(i){let o=new Date(0);o.setUTCSeconds(e-i),n=o}else n.setUTCSeconds(e);return n}renewToken(){return this.http.post(this.validateTokenUrl,null,{observe:"response"})}logout(e){return I(this,null,function*(){localStorage.removeItem("authorization_token"),yield B(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,n={token:null,expiry:null,isDeviceAccessToken:!0};i===void 0?(n.token=e,console.log("[Authentication Service] Device Access Token received. Token Expiration: NEVER"),this._IsLoggedIn$.next(!1),this._authToken$.next(n),localStorage.setItem("authorization_token",JSON.stringify(n))):this.isTokenExpired(i)?console.log("[Authentication Service] Received expired Device Access Token from server"):(n.token=e,n.expiry=i,console.log("[Authentication Service] Device Access Token received. Token Expiration: "+this.getTokenExpirationDate(n.expiry)),this._IsLoggedIn$.next(!1),this._authToken$.next(n),localStorage.setItem("authorization_token",JSON.stringify(n)))}}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=x({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var $a=typeof global=="object"&&global&&global.Object===Object&&global,Ot=$a;var Ha=typeof self=="object"&&self&&self.Object===Object&&self,Wa=Ot||Ha||Function("return this")(),S=Wa;var Ga=S.Symbol,H=Ga;var ji=Object.prototype,qa=ji.hasOwnProperty,Ka=ji.toString,ct=H?H.toStringTag:void 0;function za(t){var r=qa.call(t,ct),e=t[ct];try{t[ct]=void 0;var i=!0}catch(o){}var n=Ka.call(t);return i&&(r?t[ct]=e:delete t[ct]),n}var Bi=za;var Ja=Object.prototype,Za=Ja.toString;function Xa(t){return Za.call(t)}var Li=Xa;var Qa="[object Null]",Ya="[object Undefined]",$i=H?H.toStringTag:void 0;function es(t){return t==null?t===void 0?Ya:Qa:$i&&$i in Object(t)?Bi(t):Li(t)}var q=es;function ts(t){return t!=null&&typeof t=="object"}var T=ts;var rs=Array.isArray,W=rs;function is(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}var k=is;function ns(t){return t}var Pt=ns;var os="[object AsyncFunction]",as="[object Function]",ss="[object GeneratorFunction]",ls="[object Proxy]";function cs(t){if(!k(t))return!1;var r=q(t);return r==as||r==ss||r==os||r==ls}var Pe=cs;var us=S["__core-js_shared__"],Ft=us;var Hi=(function(){var t=/[^.]+$/.exec(Ft&&Ft.keys&&Ft.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function ds(t){return!!Hi&&Hi in t}var Wi=ds;var fs=Function.prototype,ps=fs.toString;function hs(t){if(t!=null){try{return ps.call(t)}catch(r){}try{return t+""}catch(r){}}return""}var oe=hs;var ms=/[\\^$.*+?()[\]{}|]/g,gs=/^\[object .+?Constructor\]$/,vs=Function.prototype,ys=Object.prototype,bs=vs.toString,_s=ys.hasOwnProperty,Cs=RegExp("^"+bs.call(_s).replace(ms,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ss(t){if(!k(t)||Wi(t))return!1;var r=Pe(t)?Cs:gs;return r.test(oe(t))}var Gi=Ss;function xs(t,r){return t?.[r]}var qi=xs;function ws(t,r){var e=qi(t,r);return Gi(e)?e:void 0}var U=ws;var As=U(S,"WeakMap"),Rt=As;var Ki=Object.create,Ts=(function(){function t(){}return function(r){if(!k(r))return{};if(Ki)return Ki(r);t.prototype=r;var e=new t;return t.prototype=void 0,e}})(),zi=Ts;function Ds(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 Ji=Ds;function ks(t,r){var e=-1,i=t.length;for(r||(r=Array(i));++e<i;)r[e]=t[e];return r}var Nt=ks;var Ms=800,Vs=16,Es=Date.now;function Is(t){var r=0,e=0;return function(){var i=Es(),n=Vs-(i-e);if(e=i,n>0){if(++r>=Ms)return arguments[0]}else r=0;return t.apply(void 0,arguments)}}var Zi=Is;function Os(t){return function(){return t}}var Xi=Os;var Ps=(function(){try{var t=U(Object,"defineProperty");return t({},"",{}),t}catch(r){}})(),Fe=Ps;var Fs=Fe?function(t,r){return Fe(t,"toString",{configurable:!0,enumerable:!1,value:Xi(r),writable:!0})}:Pt,Qi=Fs;var Rs=Zi(Qi),Yi=Rs;function Ns(t,r){for(var e=-1,i=t==null?0:t.length;++e<i&&r(t[e],e,t)!==!1;);return t}var en=Ns;var Us=9007199254740991,js=/^(?:0|[1-9]\d*)$/;function Bs(t,r){var e=typeof t;return r=r??Us,!!r&&(e=="number"||e!="symbol"&&js.test(t))&&t>-1&&t%1==0&&t<r}var Ut=Bs;function Ls(t,r,e){r=="__proto__"&&Fe?Fe(t,r,{configurable:!0,enumerable:!0,value:e,writable:!0}):t[r]=e}var Re=Ls;function $s(t,r){return t===r||t!==t&&r!==r}var Y=$s;var Hs=Object.prototype,Ws=Hs.hasOwnProperty;function Gs(t,r,e){var i=t[r];(!(Ws.call(t,r)&&Y(i,e))||e===void 0&&!(r in t))&&Re(t,r,e)}var jt=Gs;function qs(t,r,e,i){var n=!e;e||(e={});for(var o=-1,a=r.length;++o<a;){var s=r[o],l=i?i(e[s],t[s],s,e,t):void 0;l===void 0&&(l=t[s]),n?Re(e,s,l):jt(e,s,l)}return e}var ee=qs;var tn=Math.max;function Ks(t,r,e){return r=tn(r===void 0?t.length-1:r,0),function(){for(var i=arguments,n=-1,o=tn(i.length-r,0),a=Array(o);++n<o;)a[n]=i[r+n];n=-1;for(var s=Array(r+1);++n<r;)s[n]=i[n];return s[r]=e(a),Ji(t,this,s)}}var rn=Ks;function zs(t,r){return Yi(rn(t,r,Pt),t+"")}var nn=zs;var Js=9007199254740991;function Zs(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Js}var Bt=Zs;function Xs(t){return t!=null&&Bt(t.length)&&!Pe(t)}var fe=Xs;function Qs(t,r,e){if(!k(e))return!1;var i=typeof r;return(i=="number"?fe(e)&&Ut(r,e.length):i=="string"&&r in e)?Y(e[r],t):!1}var on=Qs;function Ys(t){return nn(function(r,e){var i=-1,n=e.length,o=n>1?e[n-1]:void 0,a=n>2?e[2]:void 0;for(o=t.length>3&&typeof o=="function"?(n--,o):void 0,a&&on(e[0],e[1],a)&&(o=n<3?void 0:o,n=1),r=Object(r);++i<n;){var s=e[i];s&&t(r,s,i,o)}return r})}var an=Ys;var el=Object.prototype;function tl(t){var r=t&&t.constructor,e=typeof r=="function"&&r.prototype||el;return t===e}var Ne=tl;function rl(t,r){for(var e=-1,i=Array(t);++e<t;)i[e]=r(e);return i}var sn=rl;var il="[object Arguments]";function nl(t){return T(t)&&q(t)==il}var Pr=nl;var ln=Object.prototype,ol=ln.hasOwnProperty,al=ln.propertyIsEnumerable,sl=Pr((function(){return arguments})())?Pr:function(t){return T(t)&&ol.call(t,"callee")&&!al.call(t,"callee")},ut=sl;function ll(){return!1}var cn=ll;var fn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,un=fn&&typeof module=="object"&&module&&!module.nodeType&&module,cl=un&&un.exports===fn,dn=cl?S.Buffer:void 0,ul=dn?dn.isBuffer:void 0,dl=ul||cn,ae=dl;var fl="[object Arguments]",pl="[object Array]",hl="[object Boolean]",ml="[object Date]",gl="[object Error]",vl="[object Function]",yl="[object Map]",bl="[object Number]",_l="[object Object]",Cl="[object RegExp]",Sl="[object Set]",xl="[object String]",wl="[object WeakMap]",Al="[object ArrayBuffer]",Tl="[object DataView]",Dl="[object Float32Array]",kl="[object Float64Array]",Ml="[object Int8Array]",Vl="[object Int16Array]",El="[object Int32Array]",Il="[object Uint8Array]",Ol="[object Uint8ClampedArray]",Pl="[object Uint16Array]",Fl="[object Uint32Array]",y={};y[Dl]=y[kl]=y[Ml]=y[Vl]=y[El]=y[Il]=y[Ol]=y[Pl]=y[Fl]=!0;y[fl]=y[pl]=y[Al]=y[hl]=y[Tl]=y[ml]=y[gl]=y[vl]=y[yl]=y[bl]=y[_l]=y[Cl]=y[Sl]=y[xl]=y[wl]=!1;function Rl(t){return T(t)&&Bt(t.length)&&!!y[q(t)]}var pn=Rl;function Nl(t){return function(r){return t(r)}}var Ue=Nl;var hn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,dt=hn&&typeof module=="object"&&module&&!module.nodeType&&module,Ul=dt&&dt.exports===hn,Fr=Ul&&Ot.process,jl=(function(){try{var t=dt&&dt.require&&dt.require("util").types;return t||Fr&&Fr.binding&&Fr.binding("util")}catch(r){}})(),se=jl;var mn=se&&se.isTypedArray,Bl=mn?Ue(mn):pn,je=Bl;var Ll=Object.prototype,$l=Ll.hasOwnProperty;function Hl(t,r){var e=W(t),i=!e&&ut(t),n=!e&&!i&&ae(t),o=!e&&!i&&!n&&je(t),a=e||i||n||o,s=a?sn(t.length,String):[],l=s.length;for(var c in t)(r||$l.call(t,c))&&!(a&&(c=="length"||n&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Ut(c,l)))&&s.push(c);return s}var Lt=Hl;function Wl(t,r){return function(e){return t(r(e))}}var $t=Wl;var Gl=$t(Object.keys,Object),gn=Gl;var ql=Object.prototype,Kl=ql.hasOwnProperty;function zl(t){if(!Ne(t))return gn(t);var r=[];for(var e in Object(t))Kl.call(t,e)&&e!="constructor"&&r.push(e);return r}var vn=zl;function Jl(t){return fe(t)?Lt(t):vn(t)}var Be=Jl;function Zl(t){var r=[];if(t!=null)for(var e in Object(t))r.push(e);return r}var yn=Zl;var Xl=Object.prototype,Ql=Xl.hasOwnProperty;function Yl(t){if(!k(t))return yn(t);var r=Ne(t),e=[];for(var i in t)i=="constructor"&&(r||!Ql.call(t,i))||e.push(i);return e}var bn=Yl;function ec(t){return fe(t)?Lt(t,!0):bn(t)}var te=ec;var tc=U(Object,"create"),le=tc;function rc(){this.__data__=le?le(null):{},this.size=0}var _n=rc;function ic(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}var Cn=ic;var nc="__lodash_hash_undefined__",oc=Object.prototype,ac=oc.hasOwnProperty;function sc(t){var r=this.__data__;if(le){var e=r[t];return e===nc?void 0:e}return ac.call(r,t)?r[t]:void 0}var Sn=sc;var lc=Object.prototype,cc=lc.hasOwnProperty;function uc(t){var r=this.__data__;return le?r[t]!==void 0:cc.call(r,t)}var xn=uc;var dc="__lodash_hash_undefined__";function fc(t,r){var e=this.__data__;return this.size+=this.has(t)?0:1,e[t]=le&&r===void 0?dc:r,this}var wn=fc;function Le(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])}}Le.prototype.clear=_n;Le.prototype.delete=Cn;Le.prototype.get=Sn;Le.prototype.has=xn;Le.prototype.set=wn;var Rr=Le;function pc(){this.__data__=[],this.size=0}var An=pc;function hc(t,r){for(var e=t.length;e--;)if(Y(t[e][0],r))return e;return-1}var pe=hc;var mc=Array.prototype,gc=mc.splice;function vc(t){var r=this.__data__,e=pe(r,t);if(e<0)return!1;var i=r.length-1;return e==i?r.pop():gc.call(r,e,1),--this.size,!0}var Tn=vc;function yc(t){var r=this.__data__,e=pe(r,t);return e<0?void 0:r[e][1]}var Dn=yc;function bc(t){return pe(this.__data__,t)>-1}var kn=bc;function _c(t,r){var e=this.__data__,i=pe(e,t);return i<0?(++this.size,e.push([t,r])):e[i][1]=r,this}var Mn=_c;function $e(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])}}$e.prototype.clear=An;$e.prototype.delete=Tn;$e.prototype.get=Dn;$e.prototype.has=kn;$e.prototype.set=Mn;var he=$e;var Cc=U(S,"Map"),me=Cc;function Sc(){this.size=0,this.__data__={hash:new Rr,map:new(me||he),string:new Rr}}var Vn=Sc;function xc(t){var r=typeof t;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?t!=="__proto__":t===null}var En=xc;function wc(t,r){var e=t.__data__;return En(r)?e[typeof r=="string"?"string":"hash"]:e.map}var ge=wc;function Ac(t){var r=ge(this,t).delete(t);return this.size-=r?1:0,r}var In=Ac;function Tc(t){return ge(this,t).get(t)}var On=Tc;function Dc(t){return ge(this,t).has(t)}var Pn=Dc;function kc(t,r){var e=ge(this,t),i=e.size;return e.set(t,r),this.size+=e.size==i?0:1,this}var Fn=kc;function He(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])}}He.prototype.clear=Vn;He.prototype.delete=In;He.prototype.get=On;He.prototype.has=Pn;He.prototype.set=Fn;var Ht=He;function Mc(t,r){for(var e=-1,i=r.length,n=t.length;++e<i;)t[n+e]=r[e];return t}var Wt=Mc;var Vc=$t(Object.getPrototypeOf,Object),We=Vc;var Ec="[object Object]",Ic=Function.prototype,Oc=Object.prototype,Rn=Ic.toString,Pc=Oc.hasOwnProperty,Fc=Rn.call(Object);function Rc(t){if(!T(t)||q(t)!=Ec)return!1;var r=We(t);if(r===null)return!0;var e=Pc.call(r,"constructor")&&r.constructor;return typeof e=="function"&&e instanceof e&&Rn.call(e)==Fc}var Nn=Rc;function Nc(){this.__data__=new he,this.size=0}var Un=Nc;function Uc(t){var r=this.__data__,e=r.delete(t);return this.size=r.size,e}var jn=Uc;function jc(t){return this.__data__.get(t)}var Bn=jc;function Bc(t){return this.__data__.has(t)}var Ln=Bc;var Lc=200;function $c(t,r){var e=this.__data__;if(e instanceof he){var i=e.__data__;if(!me||i.length<Lc-1)return i.push([t,r]),this.size=++e.size,this;e=this.__data__=new Ht(i)}return e.set(t,r),this.size=e.size,this}var $n=$c;function Ge(t){var r=this.__data__=new he(t);this.size=r.size}Ge.prototype.clear=Un;Ge.prototype.delete=jn;Ge.prototype.get=Bn;Ge.prototype.has=Ln;Ge.prototype.set=$n;var ve=Ge;function Hc(t,r){return t&&ee(r,Be(r),t)}var Hn=Hc;function Wc(t,r){return t&&ee(r,te(r),t)}var Wn=Wc;var zn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Gn=zn&&typeof module=="object"&&module&&!module.nodeType&&module,Gc=Gn&&Gn.exports===zn,qn=Gc?S.Buffer:void 0,Kn=qn?qn.allocUnsafe:void 0;function qc(t,r){if(r)return t.slice();var e=t.length,i=Kn?Kn(e):new t.constructor(e);return t.copy(i),i}var Gt=qc;function Kc(t,r){for(var e=-1,i=t==null?0:t.length,n=0,o=[];++e<i;){var a=t[e];r(a,e,t)&&(o[n++]=a)}return o}var Jn=Kc;function zc(){return[]}var qt=zc;var Jc=Object.prototype,Zc=Jc.propertyIsEnumerable,Zn=Object.getOwnPropertySymbols,Xc=Zn?function(t){return t==null?[]:(t=Object(t),Jn(Zn(t),function(r){return Zc.call(t,r)}))}:qt,qe=Xc;function Qc(t,r){return ee(t,qe(t),r)}var Xn=Qc;var Yc=Object.getOwnPropertySymbols,eu=Yc?function(t){for(var r=[];t;)Wt(r,qe(t)),t=We(t);return r}:qt,Kt=eu;function tu(t,r){return ee(t,Kt(t),r)}var Qn=tu;function ru(t,r,e){var i=r(t);return W(t)?i:Wt(i,e(t))}var zt=ru;function iu(t){return zt(t,Be,qe)}var ft=iu;function nu(t){return zt(t,te,Kt)}var Yn=nu;var ou=U(S,"DataView"),Jt=ou;var au=U(S,"Promise"),Zt=au;var su=U(S,"Set"),Xt=su;var eo="[object Map]",lu="[object Object]",to="[object Promise]",ro="[object Set]",io="[object WeakMap]",no="[object DataView]",cu=oe(Jt),uu=oe(me),du=oe(Zt),fu=oe(Xt),pu=oe(Rt),xe=q;(Jt&&xe(new Jt(new ArrayBuffer(1)))!=no||me&&xe(new me)!=eo||Zt&&xe(Zt.resolve())!=to||Xt&&xe(new Xt)!=ro||Rt&&xe(new Rt)!=io)&&(xe=function(t){var r=q(t),e=r==lu?t.constructor:void 0,i=e?oe(e):"";if(i)switch(i){case cu:return no;case uu:return eo;case du:return to;case fu:return ro;case pu:return io}return r});var ce=xe;var hu=Object.prototype,mu=hu.hasOwnProperty;function gu(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 oo=gu;var vu=S.Uint8Array,Ke=vu;function yu(t){var r=new t.constructor(t.byteLength);return new Ke(r).set(new Ke(t)),r}var ze=yu;function bu(t,r){var e=r?ze(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.byteLength)}var ao=bu;var _u=/\w*$/;function Cu(t){var r=new t.constructor(t.source,_u.exec(t));return r.lastIndex=t.lastIndex,r}var so=Cu;var lo=H?H.prototype:void 0,co=lo?lo.valueOf:void 0;function Su(t){return co?Object(co.call(t)):{}}var uo=Su;function xu(t,r){var e=r?ze(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.length)}var Qt=xu;var wu="[object Boolean]",Au="[object Date]",Tu="[object Map]",Du="[object Number]",ku="[object RegExp]",Mu="[object Set]",Vu="[object String]",Eu="[object Symbol]",Iu="[object ArrayBuffer]",Ou="[object DataView]",Pu="[object Float32Array]",Fu="[object Float64Array]",Ru="[object Int8Array]",Nu="[object Int16Array]",Uu="[object Int32Array]",ju="[object Uint8Array]",Bu="[object Uint8ClampedArray]",Lu="[object Uint16Array]",$u="[object Uint32Array]";function Hu(t,r,e){var i=t.constructor;switch(r){case Iu:return ze(t);case wu:case Au:return new i(+t);case Ou:return ao(t,e);case Pu:case Fu:case Ru:case Nu:case Uu:case ju:case Bu:case Lu:case $u:return Qt(t,e);case Tu:return new i;case Du:case Vu:return new i(t);case ku:return so(t);case Mu:return new i;case Eu:return uo(t)}}var fo=Hu;function Wu(t){return typeof t.constructor=="function"&&!Ne(t)?zi(We(t)):{}}var Yt=Wu;var Gu="[object Map]";function qu(t){return T(t)&&ce(t)==Gu}var po=qu;var ho=se&&se.isMap,Ku=ho?Ue(ho):po,mo=Ku;var zu="[object Set]";function Ju(t){return T(t)&&ce(t)==zu}var go=Ju;var vo=se&&se.isSet,Zu=vo?Ue(vo):go,yo=Zu;var Xu=1,Qu=2,Yu=4,bo="[object Arguments]",ed="[object Array]",td="[object Boolean]",rd="[object Date]",id="[object Error]",_o="[object Function]",nd="[object GeneratorFunction]",od="[object Map]",ad="[object Number]",Co="[object Object]",sd="[object RegExp]",ld="[object Set]",cd="[object String]",ud="[object Symbol]",dd="[object WeakMap]",fd="[object ArrayBuffer]",pd="[object DataView]",hd="[object Float32Array]",md="[object Float64Array]",gd="[object Int8Array]",vd="[object Int16Array]",yd="[object Int32Array]",bd="[object Uint8Array]",_d="[object Uint8ClampedArray]",Cd="[object Uint16Array]",Sd="[object Uint32Array]",g={};g[bo]=g[ed]=g[fd]=g[pd]=g[td]=g[rd]=g[hd]=g[md]=g[gd]=g[vd]=g[yd]=g[od]=g[ad]=g[Co]=g[sd]=g[ld]=g[cd]=g[ud]=g[bd]=g[_d]=g[Cd]=g[Sd]=!0;g[id]=g[_o]=g[dd]=!1;function er(t,r,e,i,n,o){var a,s=r&Xu,l=r&Qu,c=r&Yu;if(e&&(a=n?e(t,i,n,o):e(t)),a!==void 0)return a;if(!k(t))return t;var u=W(t);if(u){if(a=oo(t),!s)return Nt(t,a)}else{var h=ce(t),b=h==_o||h==nd;if(ae(t))return Gt(t,s);if(h==Co||h==bo||b&&!n){if(a=l||b?{}:Yt(t),!s)return l?Qn(t,Wn(a,t)):Xn(t,Hn(a,t))}else{if(!g[h])return n?t:{};a=fo(t,h,s)}}o||(o=new ve);var D=o.get(t);if(D)return D;o.set(t,a),yo(t)?t.forEach(function(A){a.add(er(A,r,e,A,t,o))}):mo(t)&&t.forEach(function(A,M){a.set(M,er(A,r,e,M,t,o))});var w=c?l?Yn:ft:l?te:Be,E=u?void 0:w(t);return en(E||t,function(A,M){E&&(M=A,A=t[M]),jt(a,M,er(A,r,e,M,t,o))}),a}var So=er;var xd=1,wd=4;function Ad(t){return So(t,xd|wd)}var tr=Ad;var Td="__lodash_hash_undefined__";function Dd(t){return this.__data__.set(t,Td),this}var xo=Dd;function kd(t){return this.__data__.has(t)}var wo=kd;function rr(t){var r=-1,e=t==null?0:t.length;for(this.__data__=new Ht;++r<e;)this.add(t[r])}rr.prototype.add=rr.prototype.push=xo;rr.prototype.has=wo;var Ao=rr;function Md(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 To=Md;function Vd(t,r){return t.has(r)}var Do=Vd;var Ed=1,Id=2;function Od(t,r,e,i,n,o){var a=e&Ed,s=t.length,l=r.length;if(s!=l&&!(a&&l>s))return!1;var c=o.get(t),u=o.get(r);if(c&&u)return c==r&&u==t;var h=-1,b=!0,D=e&Id?new Ao:void 0;for(o.set(t,r),o.set(r,t);++h<s;){var w=t[h],E=r[h];if(i)var A=a?i(E,w,h,r,t,o):i(w,E,h,t,r,o);if(A!==void 0){if(A)continue;b=!1;break}if(D){if(!To(r,function(M,_e){if(!Do(D,_e)&&(w===M||n(w,M,e,i,o)))return D.push(_e)})){b=!1;break}}else if(!(w===E||n(w,E,e,i,o))){b=!1;break}}return o.delete(t),o.delete(r),b}var ir=Od;function Pd(t){var r=-1,e=Array(t.size);return t.forEach(function(i,n){e[++r]=[n,i]}),e}var ko=Pd;function Fd(t){var r=-1,e=Array(t.size);return t.forEach(function(i){e[++r]=i}),e}var Mo=Fd;var Rd=1,Nd=2,Ud="[object Boolean]",jd="[object Date]",Bd="[object Error]",Ld="[object Map]",$d="[object Number]",Hd="[object RegExp]",Wd="[object Set]",Gd="[object String]",qd="[object Symbol]",Kd="[object ArrayBuffer]",zd="[object DataView]",Vo=H?H.prototype:void 0,Nr=Vo?Vo.valueOf:void 0;function Jd(t,r,e,i,n,o,a){switch(e){case zd:if(t.byteLength!=r.byteLength||t.byteOffset!=r.byteOffset)return!1;t=t.buffer,r=r.buffer;case Kd:return!(t.byteLength!=r.byteLength||!o(new Ke(t),new Ke(r)));case Ud:case jd:case $d:return Y(+t,+r);case Bd:return t.name==r.name&&t.message==r.message;case Hd:case Gd:return t==r+"";case Ld:var s=ko;case Wd:var l=i&Rd;if(s||(s=Mo),t.size!=r.size&&!l)return!1;var c=a.get(t);if(c)return c==r;i|=Nd,a.set(t,r);var u=ir(s(t),s(r),i,n,o,a);return a.delete(t),u;case qd:if(Nr)return Nr.call(t)==Nr.call(r)}return!1}var Eo=Jd;var Zd=1,Xd=Object.prototype,Qd=Xd.hasOwnProperty;function Yd(t,r,e,i,n,o){var a=e&Zd,s=ft(t),l=s.length,c=ft(r),u=c.length;if(l!=u&&!a)return!1;for(var h=l;h--;){var b=s[h];if(!(a?b in r:Qd.call(r,b)))return!1}var D=o.get(t),w=o.get(r);if(D&&w)return D==r&&w==t;var E=!0;o.set(t,r),o.set(r,t);for(var A=a;++h<l;){b=s[h];var M=t[b],_e=r[b];if(i)var ai=a?i(_e,M,b,r,t,o):i(M,_e,b,t,r,o);if(!(ai===void 0?M===_e||n(M,_e,e,i,o):ai)){E=!1;break}A||(A=b=="constructor")}if(E&&!A){var At=t.constructor,Tt=r.constructor;At!=Tt&&"constructor"in t&&"constructor"in r&&!(typeof At=="function"&&At instanceof At&&typeof Tt=="function"&&Tt instanceof Tt)&&(E=!1)}return o.delete(t),o.delete(r),E}var Io=Yd;var ef=1,Oo="[object Arguments]",Po="[object Array]",nr="[object Object]",tf=Object.prototype,Fo=tf.hasOwnProperty;function rf(t,r,e,i,n,o){var a=W(t),s=W(r),l=a?Po:ce(t),c=s?Po:ce(r);l=l==Oo?nr:l,c=c==Oo?nr:c;var u=l==nr,h=c==nr,b=l==c;if(b&&ae(t)){if(!ae(r))return!1;a=!0,u=!1}if(b&&!u)return o||(o=new ve),a||je(t)?ir(t,r,e,i,n,o):Eo(t,r,l,e,i,n,o);if(!(e&ef)){var D=u&&Fo.call(t,"__wrapped__"),w=h&&Fo.call(r,"__wrapped__");if(D||w){var E=D?t.value():t,A=w?r.value():r;return o||(o=new ve),n(E,A,e,i,o)}}return b?(o||(o=new ve),Io(t,r,e,i,n,o)):!1}var Ro=rf;function No(t,r,e,i,n){return t===r?!0:t==null||r==null||!T(t)&&!T(r)?t!==t&&r!==r:Ro(t,r,e,i,No,n)}var Uo=No;function nf(t){return function(r,e,i){for(var n=-1,o=Object(r),a=i(r),s=a.length;s--;){var l=a[t?s:++n];if(e(o[l],l,o)===!1)break}return r}}var jo=nf;var of=jo(),Bo=of;function af(t,r,e){(e!==void 0&&!Y(t[r],e)||e===void 0&&!(r in t))&&Re(t,r,e)}var pt=af;function sf(t){return T(t)&&fe(t)}var Lo=sf;function lf(t,r){if(!(r==="constructor"&&typeof t[r]=="function")&&r!="__proto__")return t[r]}var ht=lf;function cf(t){return ee(t,te(t))}var $o=cf;function uf(t,r,e,i,n,o,a){var s=ht(t,e),l=ht(r,e),c=a.get(l);if(c){pt(t,e,c);return}var u=o?o(s,l,e+"",t,r,a):void 0,h=u===void 0;if(h){var b=W(l),D=!b&&ae(l),w=!b&&!D&&je(l);u=l,b||D||w?W(s)?u=s:Lo(s)?u=Nt(s):D?(h=!1,u=Gt(l,!0)):w?(h=!1,u=Qt(l,!0)):u=[]:Nn(l)||ut(l)?(u=s,ut(s)?u=$o(s):(!k(s)||Pe(s))&&(u=Yt(l))):h=!1}h&&(a.set(l,u),n(u,l,i,o,a),a.delete(l)),pt(t,e,u)}var Ho=uf;function Wo(t,r,e,i,n){t!==r&&Bo(r,function(o,a){if(n||(n=new ve),k(o))Ho(t,r,a,e,Wo,i,n);else{var s=i?i(ht(t,a),o,a+"",t,r,n):void 0;s===void 0&&(s=o),pt(t,a,s)}},te)}var Go=Wo;function df(t,r){return Uo(t,r)}var ff=df;var pf=an(function(t,r,e){Go(t,r,e)}),hf=pf;var mf=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Ur=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},qo=t=>t==="*"||t==="x"||t==="X",Ko=t=>{let r=parseInt(t,10);return isNaN(r)?t:r},gf=(t,r)=>typeof t!=typeof r?[String(t),String(r)]:[t,r],vf=(t,r)=>{if(qo(t)||qo(r))return 0;let[e,i]=gf(Ko(t),Ko(r));return e>i?1:e<i?-1:0},jr=(t,r)=>{for(let e=0;e<Math.max(t.length,r.length);e++){let i=vf(t[e]||"0",r[e]||"0");if(i!==0)return i}return 0};var zo=(t,r)=>{let e=Ur(t),i=Ur(r),n=e.pop(),o=i.pop(),a=jr(e,i);return a!==0?a:n&&o?jr(n.split("."),o.split(".")):n||o?n?-1:1:0};var mt=(t,r,e)=>{yf(e);let i=zo(t,r);return Zo[e].includes(i)},Zo={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Jo=Object.keys(Zo),yf=t=>{if(typeof t!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof t}`);if(Jo.indexOf(t)===-1)throw new Error(`Invalid operator, expected one of ${Jo.join("|")}`)};var Xo=(()=>{class t{server=f(Oe);http=f(Ie);_auth=f(Ui);serverEndpoint=null;isAppDataSupported=!1;configFileVersion=null;sharedConfigName;InitConfig=null;_isRemoteContextBootstrapped=!1;storageServiceReady$=new v(!1);_isLoggedIn=!1;_networkStatus=void 0;_logIO=!1;patchQueue$=new G;patch=function(e){return this.http.post(e.url,e.document).pipe(pi(()=>console.log("[Storage Service] Remote config patch request completed successfully")),De(i=>this.handleError(i)))};constructor(){let e=this.server;this._auth.isLoggedIn$.pipe(lt()).subscribe(i=>{this._isLoggedIn=i,this.isStorageServiceReady()}),e.serverServiceEndpoint$.pipe(lt()).subscribe(i=>{this._networkStatus=i,this.isStorageServiceReady()}),e.serverVersion$.pipe(lt()).subscribe(i=>{i&&(this.isAppDataSupported=mt(i,"1.27.0",">="))}),this.patchQueue$.pipe(ui(i=>this.patch(i)),lt()).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)}waitUntilReady(e=1e4){return I(this,null,function*(){return this.storageServiceReady$.getValue()?!0:new Promise(i=>{let n=!1,o=this.storageServiceReady$.subscribe(s=>{n||!s||(n=!0,clearTimeout(a),o.unsubscribe(),i(!0))}),a=window.setTimeout(()=>{n||(n=!0,o.unsubscribe(),i(!1))},e)})})}ensureReady(){if(!this.storageServiceReady$.getValue())throw new Error("[StorageService] Not ready: storageServiceReady is false")}listConfigs(e){return I(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 n=this.serverEndpoint,o=e??this.configFileVersion,a=`${n}global/kip/${o}/?keys=true`,s=`${n}user/kip/${o}/?keys=true`;try{let l=yield B(this.http.get(a));for(let c of l)i.push({scope:"global",name:c});console.log("[Storage Service] Retrieved Global config list")}catch(l){this.handleError(l)}try{let l=yield B(this.http.get(s));for(let c of l)i.push({scope:"user",name:c});console.log("[Storage Service] Retrieved User config list")}catch(l){this.handleError(l)}return i})}getConfig(e,i,n,o){return I(this,null,function*(){this.ensureReady();let a=this.serverEndpoint+e+"/kip/",s=n??this.configFileVersion,l=a+s+"/"+i;this._logIO&&console.debug("[StorageService.getConfig]",{scope:e,configName:i,ver:s,url:l,isInitLoad:!!o});try{let c=yield B(this.http.get(l));if(this._logIO){let u=c&&typeof c=="object"?c?.app?.configVersion:void 0;console.debug("[StorageService.getConfig Response]",{scope:e,configName:i,ver:s,appConfigVersion:u})}else console.log(`[Storage Service] Retrieved config [${i}] from [${e}] scope`);return o&&(this.InitConfig=c),tr(c)}catch(c){return this.handleError(c),null}})}setConfig(e,i,n,o){return I(this,null,function*(){this.ensureReady();let a=this.serverEndpoint+e+"/kip/",s=o??this.configFileVersion,l=a+s+"/"+i;if(this._logIO){let c=n?.app?.configVersion;console.debug("[StorageService.setConfig]",{scope:e,configName:i,ver:s,url:l,appConfigVersion:c})}try{return yield B(this.http.post(l,n)),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(c){return this.handleError(c),null}})}patchConfig(e,i,n){this.ensureReady();let o=n??this.configFileVersion,a=this.serverEndpoint+"user/kip/"+o,s,l=i?.configVersion;switch(this._logIO&&console.warn("[StorageService.patchConfig] Suppressing app.configVersion write into v11 file",{targetFileVersion:o,incomingAppConfigVersion:l}),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 c={url:a,document:s};if(this._logIO){let u=e==="IAppConfig"?i?.configVersion:void 0;console.debug("[StorageService.patchConfig]",{ObjType:e,ver:o,url:a,appConfigVersionInValue:u,touchesConfigVersion:e==="IAppConfig"&&typeof u<"u"})}this.patchQueue$.next(c)}patchGlobal(e,i,n,o,a){this.ensureReady();let s=a??this.configFileVersion,l=this.serverEndpoint+i+"/kip/"+s,c;switch(o){case"add":c=[{op:"add",path:`/${e}`,value:n}];break;case"replace":c=[{op:"replace",path:`/${e}`,value:n}];break;case"remove":c=[{op:"remove",path:`/${e}`,value:n}];break;default:console.warn("[Storage Service] JSON Patch operation request type unknown");break}let u={url:l,document:c};if(this._logIO){let h=n?.app?.configVersion;console.debug("[StorageService.patchGlobal]",{scope:i,configName:e,operation:o,ver:s,url:l,appConfigVersionInValue:h})}this.patchQueue$.next(u)}removeItem(e,i,n){this.ensureReady();let o=this.serverEndpoint+e+"/kip/"+this.configFileVersion;n&&(o=this.serverEndpoint+e+"/kip/"+n);let a=[{op:"remove",path:`/${i}`}],s={url:o,document:a};this.patchQueue$.next(s)}clear(){this.ensureReady()}set activeConfigFileVersion(e){this.configFileVersion=e}bootstrapRemoteContext(e){if(!e?.sharedConfigName||e.configFileVersion==null||!e.initConfig)throw new Error("[StorageService] Invalid remote bootstrap context");this.sharedConfigName=e.sharedConfigName,this.configFileVersion=e.configFileVersion,this.InitConfig=tr(e.initConfig),this._isRemoteContextBootstrapped=!0,console.log(`[Storage Service] Bootstrap handoff applied (sharedConfig=${this.sharedConfigName}, fileVersion=${this.configFileVersion})`)}isRemoteContextBootstrapped(){return this._isRemoteContextBootstrapped}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=x({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var ye=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 gt={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 or={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:or,notificationConfig:gt,splitShellEnabled:!1,splitShellSide:"left",splitShellSwipeDisabled:!1,splitShellWidth:.5},Yo={themeName:""};var ea={configVersion:12,kipUUID:ye.create(),signalKUrl:null,proxyEnabled:!1,signalKSubscribeAll:!1,useDeviceToken:!1,loginName:null,loginPassword:null,useSharedConfig:!1,sharedConfigName:"default"};var Br={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}}},Lr=[{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.course.calcValues.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"}}}}]}],$r={themeName:""};var BC={configVersion:12,kipUUID:ye.create(),signalKUrl:"https://demo.signalk.org",proxyEnabled:!1,signalKSubscribeAll:!1,useDeviceToken:!1,loginName:null,loginPassword:null,useSharedConfig:!1,sharedConfigName:"default"};function bf(t,r){if(t&1){let e=ot();F(0,"div",1)(1,"button",2),L("click",function(){ke(e);let n=X();return Me(n.action())}),Q(2),R()()}if(t&2){let e=X();P(2),Tr(" ",e.data.action," ")}}var _f=["label"];function Cf(t,r){}var Sf=Math.pow(2,31)-1,we=class{_overlayRef;instance;containerInstance;_afterDismissed=new G;_afterOpened=new G;_onAction=new G;_durationTimeoutId;_dismissedByAction=!1;constructor(r,e){this._overlayRef=e,this.containerInstance=r,r._onExit.subscribe(()=>this._finishDismiss())}dismiss(){this._afterDismissed.closed||this.containerInstance.exit(),clearTimeout(this._durationTimeoutId)}dismissWithAction(){this._onAction.closed||(this._dismissedByAction=!0,this._onAction.next(),this._onAction.complete(),this.dismiss()),clearTimeout(this._durationTimeoutId)}closeWithAction(){this.dismissWithAction()}_dismissAfter(r){this._durationTimeoutId=setTimeout(()=>this.dismiss(),Math.min(r,Sf))}_open(){this._afterOpened.closed||(this._afterOpened.next(),this._afterOpened.complete())}_finishDismiss(){this._overlayRef.dispose(),this._onAction.closed||this._onAction.complete(),this._afterDismissed.next({dismissedByAction:this._dismissedByAction}),this._afterDismissed.complete(),this._dismissedByAction=!1}afterDismissed(){return this._afterDismissed}afterOpened(){return this.containerInstance._onEnter}onAction(){return this._onAction}},ar=new z("MatSnackBarData"),Je=class{politeness="polite";announcementMessage="";viewContainerRef;duration=0;panelClass;direction;data=null;horizontalPosition="center";verticalPosition="bottom"},xf=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275dir=m({type:t,selectors:[["","matSnackBarLabel",""]],hostAttrs:[1,"mat-mdc-snack-bar-label","mdc-snackbar__label"]})}return t})(),wf=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275dir=m({type:t,selectors:[["","matSnackBarActions",""]],hostAttrs:[1,"mat-mdc-snack-bar-actions","mdc-snackbar__actions"]})}return t})(),Af=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275dir=m({type:t,selectors:[["","matSnackBarAction",""]],hostAttrs:[1,"mat-mdc-snack-bar-action","mdc-snackbar__action"]})}return t})(),Tf=(()=>{class t{snackBarRef=f(we);data=f(ar);constructor(){}action(){this.snackBarRef.dismissWithAction()}get hasAction(){return!!this.data.action}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=it({type:t,selectors:[["simple-snack-bar"]],hostAttrs:[1,"mat-mdc-simple-snack-bar"],exportAs:["matSnackBar"],decls:3,vars:2,consts:[["matSnackBarLabel",""],["matSnackBarActions",""],["matButton","","matSnackBarAction","",3,"click"]],template:function(i,n){i&1&&(F(0,"div",0),Q(1),R(),Ce(2,bf,3,1,"div",1)),i&2&&(P(),Tr(" ",n.data.message,`
|
|
2
|
+
`),P(),Se(n.hasAction?2:-1))},dependencies:[It,xf,wf,Af],styles:[`.mat-mdc-simple-snack-bar{display:flex}.mat-mdc-simple-snack-bar .mat-mdc-snack-bar-label{max-height:50vh;overflow:auto}
|
|
3
|
+
`],encapsulation:2,changeDetection:0})}return t})(),Hr="_mat-snack-bar-enter",Wr="_mat-snack-bar-exit",Df=(()=>{class t extends Mi{_ngZone=f(mi);_elementRef=f(rt);_changeDetectorRef=f(Et);_platform=f(Si);_animationsDisabled=Mr();snackBarConfig=f(Je);_document=f(hi);_trackedModals=new Set;_enterFallback;_exitFallback;_injector=f(Ve);_announceDelay=150;_announceTimeoutId;_destroyed=!1;_portalOutlet;_onAnnounce=new G;_onExit=new G;_onEnter=new G;_animationState="void";_live;_label;_role;_liveElementId=f(Ai).getId("mat-snack-bar-container-live-");constructor(){super();let e=this.snackBarConfig;e.politeness==="assertive"&&!e.announcementMessage?this._live="assertive":e.politeness==="off"?this._live="off":this._live="polite",this._platform.FIREFOX&&(this._live==="polite"&&(this._role="status"),this._live==="assertive"&&(this._role="alert"))}attachComponentPortal(e){this._assertNotAttached();let i=this._portalOutlet.attachComponentPortal(e);return this._afterPortalAttached(),i}attachTemplatePortal(e){this._assertNotAttached();let i=this._portalOutlet.attachTemplatePortal(e);return this._afterPortalAttached(),i}attachDomPortal=e=>{this._assertNotAttached();let i=this._portalOutlet.attachDomPortal(e);return this._afterPortalAttached(),i};onAnimationEnd(e){e===Wr?this._completeExit():e===Hr&&(clearTimeout(this._enterFallback),this._ngZone.run(()=>{this._onEnter.next(),this._onEnter.complete()}))}enter(){this._destroyed||(this._animationState="visible",this._changeDetectorRef.markForCheck(),this._changeDetectorRef.detectChanges(),this._screenReaderAnnounce(),this._animationsDisabled?Vt(()=>{this._ngZone.run(()=>queueMicrotask(()=>this.onAnimationEnd(Hr)))},{injector:this._injector}):(clearTimeout(this._enterFallback),this._enterFallback=setTimeout(()=>{this._elementRef.nativeElement.classList.add("mat-snack-bar-fallback-visible"),this.onAnimationEnd(Hr)},200)))}exit(){return this._destroyed?li(void 0):(this._ngZone.run(()=>{this._animationState="hidden",this._changeDetectorRef.markForCheck(),this._elementRef.nativeElement.setAttribute("mat-exit",""),clearTimeout(this._announceTimeoutId),this._animationsDisabled?Vt(()=>{this._ngZone.run(()=>queueMicrotask(()=>this.onAnimationEnd(Wr)))},{injector:this._injector}):(clearTimeout(this._exitFallback),this._exitFallback=setTimeout(()=>this.onAnimationEnd(Wr),200))}),this._onExit)}ngOnDestroy(){this._destroyed=!0,this._clearFromModals(),this._completeExit()}_completeExit(){clearTimeout(this._exitFallback),queueMicrotask(()=>{this._onExit.next(),this._onExit.complete()})}_afterPortalAttached(){let e=this._elementRef.nativeElement,i=this.snackBarConfig.panelClass;i&&(Array.isArray(i)?i.forEach(a=>e.classList.add(a)):e.classList.add(i)),this._exposeToModals();let n=this._label.nativeElement,o="mdc-snackbar__label";n.classList.toggle(o,!n.querySelector(`.${o}`))}_exposeToModals(){let e=this._liveElementId,i=this._document.querySelectorAll('body > .cdk-overlay-container [aria-modal="true"]');for(let n=0;n<i.length;n++){let o=i[n],a=o.getAttribute("aria-owns");this._trackedModals.add(o),a?a.indexOf(e)===-1&&o.setAttribute("aria-owns",a+" "+e):o.setAttribute("aria-owns",e)}}_clearFromModals(){this._trackedModals.forEach(e=>{let i=e.getAttribute("aria-owns");if(i){let n=i.replace(this._liveElementId,"").trim();n.length>0?e.setAttribute("aria-owns",n):e.removeAttribute("aria-owns")}}),this._trackedModals.clear()}_assertNotAttached(){this._portalOutlet.hasAttached()}_screenReaderAnnounce(){this._announceTimeoutId||this._ngZone.runOutsideAngular(()=>{this._announceTimeoutId=setTimeout(()=>{if(this._destroyed)return;let e=this._elementRef.nativeElement,i=e.querySelector("[aria-hidden]"),n=e.querySelector("[aria-live]");if(i&&n){let o=null;this._platform.isBrowser&&document.activeElement instanceof HTMLElement&&i.contains(document.activeElement)&&(o=document.activeElement),i.removeAttribute("aria-hidden"),n.appendChild(i),o?.focus(),this._onAnnounce.next(),this._onAnnounce.complete()}},this._announceDelay)})}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=it({type:t,selectors:[["mat-snack-bar-container"]],viewQuery:function(i,n){if(i&1&&_i(Ir,7)(_f,7),i&2){let o;wr(o=Ar())&&(n._portalOutlet=o.first),wr(o=Ar())&&(n._label=o.first)}},hostAttrs:[1,"mdc-snackbar","mat-mdc-snack-bar-container"],hostVars:6,hostBindings:function(i,n){i&1&&L("animationend",function(a){return n.onAnimationEnd(a.animationName)})("animationcancel",function(a){return n.onAnimationEnd(a.animationName)}),i&2&&at("mat-snack-bar-container-enter",n._animationState==="visible")("mat-snack-bar-container-exit",n._animationState==="hidden")("mat-snack-bar-container-animations-enabled",!n._animationsDisabled)},features:[_],decls:6,vars:3,consts:[["label",""],[1,"mdc-snackbar__surface","mat-mdc-snackbar-surface"],[1,"mat-mdc-snack-bar-label"],["aria-hidden","true"],["cdkPortalOutlet",""]],template:function(i,n){i&1&&(F(0,"div",1)(1,"div",2,0)(3,"div",3),vi(4,Cf,0,0,"ng-template",4),R(),bi(5,"div"),R()()),i&2&&(P(5),ie("aria-live",n._live)("role",n._role)("id",n._liveElementId))},dependencies:[Ir],styles:[`@keyframes _mat-snack-bar-enter{from{transform:scale(0.8);opacity:0}to{transform:scale(1);opacity:1}}@keyframes _mat-snack-bar-exit{from{opacity:1}to{opacity:0}}.mat-mdc-snack-bar-container{display:flex;align-items:center;justify-content:center;box-sizing:border-box;-webkit-tap-highlight-color:rgba(0,0,0,0);margin:8px}.mat-mdc-snack-bar-handset .mat-mdc-snack-bar-container{width:100vw}.mat-snack-bar-container-animations-enabled{opacity:0}.mat-snack-bar-container-animations-enabled.mat-snack-bar-fallback-visible{opacity:1}.mat-snack-bar-container-animations-enabled.mat-snack-bar-container-enter{animation:_mat-snack-bar-enter 150ms cubic-bezier(0, 0, 0.2, 1) forwards}.mat-snack-bar-container-animations-enabled.mat-snack-bar-container-exit{animation:_mat-snack-bar-exit 75ms cubic-bezier(0.4, 0, 1, 1) forwards}.mat-mdc-snackbar-surface{box-shadow:0px 3px 5px -1px rgba(0, 0, 0, 0.2), 0px 6px 10px 0px rgba(0, 0, 0, 0.14), 0px 1px 18px 0px rgba(0, 0, 0, 0.12);display:flex;align-items:center;justify-content:flex-start;box-sizing:border-box;padding-left:0;padding-right:8px}[dir=rtl] .mat-mdc-snackbar-surface{padding-right:0;padding-left:8px}.mat-mdc-snack-bar-container .mat-mdc-snackbar-surface{min-width:344px;max-width:672px}.mat-mdc-snack-bar-handset .mat-mdc-snackbar-surface{width:100%;min-width:0}@media(forced-colors: active){.mat-mdc-snackbar-surface{outline:solid 1px}}.mat-mdc-snack-bar-container .mat-mdc-snackbar-surface{color:var(--mat-snack-bar-supporting-text-color, var(--mat-sys-inverse-on-surface));border-radius:var(--mat-snack-bar-container-shape, var(--mat-sys-corner-extra-small));background-color:var(--mat-snack-bar-container-color, var(--mat-sys-inverse-surface))}.mdc-snackbar__label{width:100%;flex-grow:1;box-sizing:border-box;margin:0;padding:14px 8px 14px 16px}[dir=rtl] .mdc-snackbar__label{padding-left:8px;padding-right:16px}.mat-mdc-snack-bar-container .mdc-snackbar__label{font-family:var(--mat-snack-bar-supporting-text-font, var(--mat-sys-body-medium-font));font-size:var(--mat-snack-bar-supporting-text-size, var(--mat-sys-body-medium-size));font-weight:var(--mat-snack-bar-supporting-text-weight, var(--mat-sys-body-medium-weight));line-height:var(--mat-snack-bar-supporting-text-line-height, var(--mat-sys-body-medium-line-height))}.mat-mdc-snack-bar-actions{display:flex;flex-shrink:0;align-items:center;box-sizing:border-box}.mat-mdc-snack-bar-handset,.mat-mdc-snack-bar-container,.mat-mdc-snack-bar-label{flex:1 1 auto}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled){--mat-button-text-state-layer-color: currentColor;--mat-button-text-ripple-color: currentColor}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled).mat-unthemed{color:var(--mat-snack-bar-button-color, var(--mat-sys-inverse-primary))}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled) .mat-ripple-element{opacity:.1}
|
|
4
|
+
`],encapsulation:2})}return t})(),kf=new z("mat-snack-bar-default-options",{providedIn:"root",factory:()=>new Je}),sr=(()=>{class t{_live=f(wi);_injector=f(Ve);_breakpointObserver=f(xi);_parentSnackBar=f(t,{optional:!0,skipSelf:!0});_defaultConfig=f(kf);_animationsDisabled=Mr();_snackBarRefAtThisLevel=null;simpleSnackBarComponent=Tf;snackBarContainerComponent=Df;handsetCssClass="mat-mdc-snack-bar-handset";get _openedSnackBarRef(){let e=this._parentSnackBar;return e?e._openedSnackBarRef:this._snackBarRefAtThisLevel}set _openedSnackBarRef(e){this._parentSnackBar?this._parentSnackBar._openedSnackBarRef=e:this._snackBarRefAtThisLevel=e}constructor(){}openFromComponent(e,i){return this._attach(e,i)}openFromTemplate(e,i){return this._attach(e,i)}open(e,i="",n){let o=C(C({},this._defaultConfig),n);return o.data={message:e,action:i},o.announcementMessage===e&&(o.announcementMessage=void 0),this.openFromComponent(this.simpleSnackBarComponent,o)}dismiss(){this._openedSnackBarRef&&this._openedSnackBarRef.dismiss()}ngOnDestroy(){this._snackBarRefAtThisLevel&&this._snackBarRefAtThisLevel.dismiss()}_attachSnackBarContainer(e,i){let n=i&&i.viewContainerRef&&i.viewContainerRef.injector,o=Ve.create({parent:n||this._injector,providers:[{provide:Je,useValue:i}]}),a=new Er(this.snackBarContainerComponent,i.viewContainerRef,o),s=e.attach(a);return s.instance.snackBarConfig=i,s.instance}_attach(e,i){let n=C(C(C({},new Je),this._defaultConfig),i),o=this._createOverlay(n),a=this._attachSnackBarContainer(o,n),s=new we(a,o);if(e instanceof gi){let l=new ki(e,null,{$implicit:n.data,snackBarRef:s});s.instance=a.attachTemplatePortal(l)}else{let l=this._createInjector(n,s),c=new Er(e,void 0,l),u=a.attachComponentPortal(c);s.instance=u.instance}return this._breakpointObserver.observe(Ti.HandsetPortrait).pipe(fi(o.detachments())).subscribe(l=>{o.overlayElement.classList.toggle(this.handsetCssClass,l.matches)}),n.announcementMessage&&a._onAnnounce.subscribe(()=>{this._live.announce(n.announcementMessage,n.politeness)}),this._animateSnackBar(s,n),this._openedSnackBarRef=s,this._openedSnackBarRef}_animateSnackBar(e,i){e.afterDismissed().subscribe(()=>{this._openedSnackBarRef==e&&(this._openedSnackBarRef=null),i.announcementMessage&&this._live.clear()}),i.duration&&i.duration>0&&e.afterOpened().subscribe(()=>e._dismissAfter(i.duration)),this._openedSnackBarRef?(this._openedSnackBarRef.afterDismissed().subscribe(()=>{e.containerInstance.enter()}),this._openedSnackBarRef.dismiss()):e.containerInstance.enter()}_createOverlay(e){let i=new Vi;i.direction=e.direction;let n=Ei(this._injector),o=e.direction==="rtl",a=e.horizontalPosition==="left"||e.horizontalPosition==="start"&&!o||e.horizontalPosition==="end"&&o,s=!a&&e.horizontalPosition!=="center";return a?n.left("0"):s?n.right("0"):n.centerHorizontally(),e.verticalPosition==="top"?n.top("0"):n.bottom("0"),i.positionStrategy=n,i.disableAnimations=this._animationsDisabled,Ii(this._injector,i)}_createInjector(e,i){let n=e&&e.viewContainerRef&&e.viewContainerRef.injector;return Ve.create({parent:n||this._injector,providers:[{provide:we,useValue:i},{provide:ar,useValue:e.data}]})}static \u0275fac=function(i){return new(i||t)};static \u0275prov=x({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var Mf="",Vf=11,Gr=12,ta=(()=>{class t{storage=f(Xo);snackBar=f(sr);server=f(Oe);unitDefaults=new v({});themeName=new v(Mf);kipKNotificationConfig=new v(gt);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);widgetHistoryDisabled=new v(!1);proxyEnabled=!1;signalKSubscribeAll=!1;useDeviceToken=!1;loginName;loginPassword;useSharedConfig;sharedConfigName;activeConfig={app:null,theme:null,dashboards:null};kipUUID;signalkUrl;widgets;_dashboards=[];dataSets=[];configUpgrade=J(!1);configVersion=void 0;constructor(){console.log("[AppSettings Service] Service startup..."),this.storage.activeConfigFileVersion=Vf,window.localStorage?(this.loadConnectionConfig(),this.startup()):console.error(`[AppSettings Service] LocalStorage NOT SUPPORTED by browser
|
|
5
|
+
This is a requirement to run Kip. See browser documentation to enable this feature.`)}startup(){return I(this,null,function*(){if(this.useSharedConfig){if(!this.storage.isRemoteContextBootstrapped()||this.storage.initConfig===null){console.warn("[AppSettings Service] Shared configuration enabled but remote bootstrap handoff is missing. Waiting for explicit recovery action.");return}this.configVersion=this.storage.initConfig?.app?.configVersion,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.configVersion=e.app?.configVersion,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()}checkConfigUpgradeRequired(e,i){i!==Gr&&this.configUpgrade.set(!0)}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}return e==="connectionConfig"&&i.configVersion!==Gr&&(console.log(`[AppSettings Service] Invalid ${e} version. Force loading defaults`),e==="connectionConfig"&&(i=this.getDefaultConnectionConfig())),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);let e=this.server.serverVersion$.getValue(),i=typeof e=="string"&&e.trim().length>0?mt(e,"2.22.1",">="):!1;this.activeConfig.app.widgetHistoryDisabled===void 0?this.setWidgetHistoryDisabled(!i):this.widgetHistoryDisabled.next(i?this.activeConfig.app.widgetHistoryDisabled:!0)}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()}getWidgetHistoryDisabledAsO(){return this.widgetHistoryDisabled.asObservable()}getWidgetHistoryDisabled(){return this.widgetHistoryDisabled.getValue()}setWidgetHistoryDisabled(e){this.widgetHistoryDisabled.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 n=this.buildAppStorageObject();this.useSharedConfig?this.storage.patchConfig("IAppConfig",n):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.snackBar.open("Problem saving configuration to the server. Resolve this issue before KIP can be used reliably.","Close",{duration:0,verticalPosition:"top"})}):this.reloadApp()}replaceConfig(e,i,n){let o=JSON.stringify(i);localStorage.setItem(e,o),n&&this.reloadApp()}loadDemoConfig(){if(this.useSharedConfig){let e={app:Br,dashboards:Lr,theme:$r};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",Br),this.replaceConfig("dashboardsConfig",Lr),this.replaceConfig("themeConfig",$r,!0)}reloadApp(){console.log("[AppSettings Service] Reload app"),!window.__KIP_TEST__&&location.replace("./")}buildAppStorageObject(){return{configVersion:this.configVersion,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(),widgetHistoryDisabled:this.widgetHistoryDisabled.getValue()}}buildConnectionStorageObject(){return{configVersion:this.configVersion,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=gt,e.unitDefaults=or,e.configVersion=Gr,localStorage.setItem("appConfig",JSON.stringify(e)),e}getDefaultConnectionConfig(){let e=ea;return e.kipUUID=ye.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=Yo;return localStorage.setItem("themeConfig",JSON.stringify(e)),e}static \u0275fac=function(i){return new(i||t)};static \u0275prov=x({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function Ef(t,r){if(t&1&&(F(0,"mat-icon",1),Q(1),R()),t&2){let e=X();P(),st(e.icon())}}function If(t,r){if(t&1&&(F(0,"div",3),Q(1),R()),t&2){let e=X();P(),st(e.title())}}function Of(t,r){if(t&1){let e=ot();F(0,"div",5)(1,"button",7),L("click",function(){ke(e);let n=X();return Me(n.onActionClick())}),Q(2),R(),F(3,"button",7),L("click",function(){ke(e);let n=X();return Me(n.dismiss())}),Q(4,"Cancel"),R()()}if(t&2){let e=X();P(2),st(e.data.action)}}function Pf(t,r){if(t&1){let e=ot();F(0,"div",6)(1,"button",8),L("click",function(){ke(e);let n=X();return Me(n.dismiss())}),F(2,"mat-icon"),Q(3,"close"),R()()()}}var qr=(()=>{class t{ref=f(we);data=f(ar);severity=$(()=>this.data.severity??"message");hasAction=$(()=>!!this.data.action);title=$(()=>this.data.title??this.titleForSeverity(this.severity()));icon=$(()=>this.iconForSeverity(this.severity()));hostClass=$(()=>`toast-${this.severity()}`);onActionClick(){this.ref.dismissWithAction()}dismiss(){this.ref.dismiss()}titleForSeverity(e){switch(e){case"success":return"Success";case"warn":return"Warning";case"error":return"Error";case"info":return"Info";default:return"Message"}}iconForSeverity(e){switch(e){case"success":return"check";case"warn":return"warning";case"error":return"error";case"info":return"info";default:return"message"}}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=it({type:t,selectors:[["toast-snackbar"]],hostVars:2,hostBindings:function(i,n){i&2&&Ci(n.hostClass())},decls:8,vars:6,consts:[[1,"toast"],[1,"icon"],[1,"toast-body"],[1,"toast-title"],["matSnackBarLabel",""],[1,"button-group"],["matSnackBarActions","",1,"toast-body"],["matButton","tonal","matSnackBarAction","",3,"click"],["matIconButton","","matSnackBarAction","","aria-label","Dismiss notification",1,"toast-close",3,"click"]],template:function(i,n){i&1&&(F(0,"section",0),Ce(1,Ef,2,1,"mat-icon",1),F(2,"div",2),Ce(3,If,2,1,"div",3),F(4,"div",4),Q(5),R(),Ce(6,Of,5,1,"div",5),R(),Ce(7,Pf,4,0,"div",6),R()),i&2&&(ie("data-severity",n.severity()),P(),Se(n.severity()!=="message"?1:-1),P(2),Se(n.severity()!=="message"?3:-1),P(2),st(n.data.message),P(),Se(n.hasAction()?6:-1),P(),Se(n.hasAction()?-1:7))},dependencies:[Vr,It,Di,Fi,Pi],styles:["[_nghost-%COMP%]{display:block;width:100%}.toast[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:flex-start;gap:10px}.toast[data-severity=message][_ngcontent-%COMP%]{align-items:center}.toast[data-severity=info][_ngcontent-%COMP%]{--toast-color: var(--mat-sys-inverse-primary)}.toast[data-severity=warn][_ngcontent-%COMP%]{--toast-color: var(--mat-sys-tertiary)}.toast[data-severity=error][_ngcontent-%COMP%]{--toast-color: var(--mat-sys-error-container)}.toast[data-severity=success][_ngcontent-%COMP%]{--toast-color: var(--kip-starboard-color)}.toast[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{display:inline-flex;width:36px;height:36px;font-size:36px;flex:0 0 auto;align-items:center;justify-content:center;--mat-icon-color: var(--toast-color)}.toast-body[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex-wrap:nowrap;gap:2px;flex:1 1 auto;min-width:0}.toast-title[_ngcontent-%COMP%]{font-weight:600;font-size:15px}.button-group[_ngcontent-%COMP%]{margin-top:10px;display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:flex-end;gap:8px}.toast-action[_ngcontent-%COMP%]{--mat-button-text-label-text-color: var(--mat-sys-primary)}.toast-close[_ngcontent-%COMP%]{align-self:flex-end;--mat-icon-button-icon-color: var(--mat-sys-inverse-on-surface);--mat-icon-button-icon-size: 32px}.toast-close[_ngcontent-%COMP%] icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px}"],changeDetection:0})}return t})();var jS=(()=>{class t{snackBar=f(sr);app=f(ta);soundDisabled=Oi(this.app.getNotificationServiceConfigAsO().pipe(kt(e=>e.sound.disableSound)),{initialValue:this.app.getNotificationConfig().sound.disableSound});toastAudio=null;audioBlockedNotificationShown=!1;lastSnack=J(null);show(e,i=1500,n=!0,o="message",a){let s={message:e,duration:i,silent:n,action:a,severity:o},l={message:e,action:a,severity:o},c=this.snackBar.openFromComponent(qr,{duration:i,verticalPosition:"top",data:l});return this.lastSnack.set(s),n||this.soundDisabled()||(this.toastAudio||(this.toastAudio=new Audio("assets/notification.mp3"),this.toastAudio.preload="auto",this.toastAudio.volume=.3),this.toastAudio.currentTime=0,this.toastAudio.play().catch(u=>{console.debug("Toast audio playback blocked:",u.message),this.audioBlockedNotificationShown||(this.audioBlockedNotificationShown=!0,this.snackBar.openFromComponent(qr,{duration:0,verticalPosition:"top",data:{message:"Sound notifications blocked by browser. Closing this message will enable audio.",severity:"warn"}}).afterDismissed().subscribe(()=>{this.audioBlockedNotificationShown=!1}))})),c}static \u0275fac=function(i){return new(i||t)};static \u0275prov=x({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var ua=(()=>{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)(p(xr),p(rt))};static \u0275dir=m({type:t})}return t})(),da=(()=>{class t extends ua{static \u0275fac=(()=>{let e;return function(n){return(e||(e=Z(t)))(n||t)}})();static \u0275dir=m({type:t,features:[_]})}return t})(),wt=new z("");var Ff={provide:wt,useExisting:O(()=>fa),multi:!0};function Rf(){let t=kr()?kr().getUserAgent():"";return/android (\d+)/.test(t.toLowerCase())}var Nf=new z(""),fa=(()=>{class t extends ua{_compositionMode;_composing=!1;constructor(e,i,n){super(e,i),this._compositionMode=n,this._compositionMode==null&&(this._compositionMode=!Rf())}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)(p(xr),p(rt),p(Nf,8))};static \u0275dir=m({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,n){i&1&&L("input",function(a){return n._handleInput(a.target.value)})("blur",function(){return n.onTouched()})("compositionstart",function(){return n._compositionStart()})("compositionend",function(a){return n._compositionEnd(a.target.value)})},standalone:!1,features:[N([Ff]),_]})}return t})();function Zr(t){return t==null||Xr(t)===0}function Xr(t){return t==null?null:Array.isArray(t)||typeof t=="string"?t.length:t instanceof Set?t.size:null}var K=new z(""),Te=new z(""),Uf=/^(?=.{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])?)*$/,ra=class{static min(r){return pa(r)}static max(r){return ha(r)}static required(r){return ma(r)}static requiredTrue(r){return jf(r)}static email(r){return Bf(r)}static minLength(r){return Lf(r)}static maxLength(r){return $f(r)}static pattern(r){return ga(r)}static nullValidator(r){return cr()}static compose(r){return Sa(r)}static composeAsync(r){return xa(r)}};function pa(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 ha(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 ma(t){return Zr(t.value)?{required:!0}:null}function jf(t){return t.value===!0?null:{required:!0}}function Bf(t){return Zr(t.value)||Uf.test(t.value)?null:{email:!0}}function Lf(t){return r=>{let e=r.value?.length??Xr(r.value);return e===null||e===0?null:e<t?{minlength:{requiredLength:t,actualLength:e}}:null}}function $f(t){return r=>{let e=r.value?.length??Xr(r.value);return e!==null&&e>t?{maxlength:{requiredLength:t,actualLength:e}}:null}}function ga(t){if(!t)return cr;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(Zr(i.value))return null;let n=i.value;return r.test(n)?null:{pattern:{requiredPattern:e,actualValue:n}}}}function cr(t){return null}function va(t){return t!=null}function ya(t){return yi(t)?si(t):t}function ba(t){let r={};return t.forEach(e=>{r=e!=null?C(C({},r),e):r}),Object.keys(r).length===0?null:r}function _a(t,r){return r.map(e=>e(t))}function Hf(t){return!t.validate}function Ca(t){return t.map(r=>Hf(r)?r:e=>r.validate(e))}function Sa(t){if(!t)return null;let r=t.filter(va);return r.length==0?null:function(e){return ba(_a(e,r))}}function Qr(t){return t!=null?Sa(Ca(t)):null}function xa(t){if(!t)return null;let r=t.filter(va);return r.length==0?null:function(e){let i=_a(e,r).map(ya);return ci(i).pipe(kt(ba))}}function Yr(t){return t!=null?xa(Ca(t)):null}function ia(t,r){return t===null?[r]:Array.isArray(t)?[...t,r]:[t,r]}function wa(t){return t._rawValidators}function Aa(t){return t._rawAsyncValidators}function Kr(t){return t?Array.isArray(t)?t:[t]:[]}function ur(t,r){return Array.isArray(t)?t.includes(r):t===r}function na(t,r){let e=Kr(r);return Kr(t).forEach(n=>{ur(e,n)||e.push(n)}),e}function oa(t,r){return Kr(r).filter(e=>!ur(t,e))}var dr=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=Qr(this._rawValidators)}_setAsyncValidators(r){this._rawAsyncValidators=r||[],this._composedAsyncValidatorFn=Yr(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?.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 dr{name;get formDirective(){return null}get path(){return null}},ue=class extends dr{_parent=null;name=null;valueAccessor=null},fr=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}};var ox=(()=>{class t extends fr{constructor(e){super(e)}static \u0275fac=function(i){return new(i||t)(p(ue,2))};static \u0275dir=m({type:t,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(i,n){i&2&&at("ng-untouched",n.isUntouched)("ng-touched",n.isTouched)("ng-pristine",n.isPristine)("ng-dirty",n.isDirty)("ng-valid",n.isValid)("ng-invalid",n.isInvalid)("ng-pending",n.isPending)},standalone:!1,features:[_]})}return t})(),ax=(()=>{class t extends fr{constructor(e){super(e)}static \u0275fac=function(i){return new(i||t)(p(V,10))};static \u0275dir=m({type:t,selectors:[["","formGroupName",""],["","formArrayName",""],["","ngModelGroup",""],["","formGroup",""],["","formArray",""],["form",3,"ngNoForm",""],["","ngForm",""]],hostVars:16,hostBindings:function(i,n){i&2&&at("ng-untouched",n.isUntouched)("ng-touched",n.isTouched)("ng-pristine",n.isPristine)("ng-dirty",n.isDirty)("ng-valid",n.isValid)("ng-invalid",n.isInvalid)("ng-pending",n.isPending)("ng-submitted",n.isSubmitted)},standalone:!1,features:[_]})}return t})();var vt="VALID",lr="INVALID",Ze="PENDING",yt="DISABLED",be=class{},pr=class extends be{value;source;constructor(r,e){super(),this.value=r,this.source=e}},_t=class extends be{pristine;source;constructor(r,e){super(),this.pristine=r,this.source=e}},Ct=class extends be{touched;source;constructor(r,e){super(),this.touched=r,this.source=e}},Xe=class extends be{status;source;constructor(r,e){super(),this.status=r,this.source=e}},hr=class extends be{source;constructor(r){super(),this.source=r}},St=class extends be{source;constructor(r){super(),this.source=r}};function ei(t){return(yr(t)?t.validators:t)||null}function Wf(t){return Array.isArray(t)?Qr(t):t||null}function ti(t,r){return(yr(r)?r.asyncValidators:t)||null}function Gf(t){return Array.isArray(t)?Yr(t):t||null}function yr(t){return t!=null&&!Array.isArray(t)&&typeof t=="object"}function Ta(t,r,e){let i=t.controls;if(!(r?Object.keys(i):i).length)throw new Mt(1e3,"");if(!i[e])throw new Mt(1001,"")}function Da(t,r,e){t._forEachChild((i,n)=>{if(e[n]===void 0)throw new Mt(1002,"")})}var Ye=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 re(this.statusReactive)}set status(r){re(()=>this.statusReactive.set(r))}_status=$(()=>this.statusReactive());statusReactive=J(void 0);get valid(){return this.status===vt}get invalid(){return this.status===lr}get pending(){return this.status==Ze}get disabled(){return this.status===yt}get enabled(){return this.status!==yt}errors;get pristine(){return re(this.pristineReactive)}set pristine(r){re(()=>this.pristineReactive.set(r))}_pristine=$(()=>this.pristineReactive());pristineReactive=J(!0);get dirty(){return!this.pristine}get touched(){return re(this.touchedReactive)}set touched(r){re(()=>this.touchedReactive.set(r))}_touched=$(()=>this.touchedReactive());touchedReactive=J(!1);get untouched(){return!this.touched}_events=new G;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(na(r,this._rawValidators))}addAsyncValidators(r){this.setAsyncValidators(na(r,this._rawAsyncValidators))}removeValidators(r){this.setValidators(oa(r,this._rawValidators))}removeAsyncValidators(r){this.setAsyncValidators(oa(r,this._rawAsyncValidators))}hasValidator(r){return ur(this._rawValidators,r)}hasAsyncValidator(r){return ur(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;r.onlySelf||this._parent?.markAsTouched(j(C({},r),{sourceControl:i})),e&&r.emitEvent!==!1&&this._events.next(new Ct(!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(n=>{n.markAsUntouched({onlySelf:!0,emitEvent:r.emitEvent,sourceControl:i})}),r.onlySelf||this._parent?._updateTouched(r,i),e&&r.emitEvent!==!1&&this._events.next(new Ct(!1,i))}markAsDirty(r={}){let e=this.pristine===!0;this.pristine=!1;let i=r.sourceControl??this;r.onlySelf||this._parent?.markAsDirty(j(C({},r),{sourceControl:i})),e&&r.emitEvent!==!1&&this._events.next(new _t(!1,i))}markAsPristine(r={}){let e=this.pristine===!1;this.pristine=!0,this._pendingDirty=!1;let i=r.sourceControl??this;this._forEachChild(n=>{n.markAsPristine({onlySelf:!0,emitEvent:r.emitEvent})}),r.onlySelf||this._parent?._updatePristine(r,i),e&&r.emitEvent!==!1&&this._events.next(new _t(!0,i))}markAsPending(r={}){this.status=Ze;let e=r.sourceControl??this;r.emitEvent!==!1&&(this._events.next(new Xe(this.status,e)),this.statusChanges.emit(this.status)),r.onlySelf||this._parent?.markAsPending(j(C({},r),{sourceControl:e}))}disable(r={}){let e=this._parentMarkedDirty(r.onlySelf);this.status=yt,this.errors=null,this._forEachChild(n=>{n.disable(j(C({},r),{onlySelf:!0}))}),this._updateValue();let i=r.sourceControl??this;r.emitEvent!==!1&&(this._events.next(new pr(this.value,i)),this._events.next(new Xe(this.status,i)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(j(C({},r),{skipPristineCheck:e}),this),this._onDisabledChange.forEach(n=>n(!0))}enable(r={}){let e=this._parentMarkedDirty(r.onlySelf);this.status=vt,this._forEachChild(i=>{i.enable(j(C({},r),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:r.emitEvent}),this._updateAncestors(j(C({},r),{skipPristineCheck:e}),this),this._onDisabledChange.forEach(i=>i(!1))}_updateAncestors(r,e){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===vt||this.status===Ze)&&this._runAsyncValidator(i,r.emitEvent)}let e=r.sourceControl??this;r.emitEvent!==!1&&(this._events.next(new pr(this.value,e)),this._events.next(new Xe(this.status,e)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),r.onlySelf||this._parent?.updateValueAndValidity(j(C({},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()?yt:vt}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(r,e){if(this.asyncValidator){this.status=Ze,this._hasOwnPendingAsyncValidator={emitEvent:e!==!1,shouldHaveEmitted:r!==!1};let i=ya(this.asyncValidator(this));this._asyncValidationSubscription=i.subscribe(n=>{this._hasOwnPendingAsyncValidator=null,this.setErrors(n,{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,n)=>i&&i._find(n),this)}getError(r,e){let i=e?this.get(e):this;return 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 Xe(this.status,e)),this._parent&&this._parent._updateControlsErrors(r,e,i)}_initObservables(){this.valueChanges=new de,this.statusChanges=new de}_calculateStatus(){return this._allControlsDisabled()?yt:this.errors?lr:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(Ze)?Ze:this._anyControlsHaveStatus(lr)?lr:vt}_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(),n=this.pristine!==i;this.pristine=i,r.onlySelf||this._parent?._updatePristine(r,e),n&&this._events.next(new _t(this.pristine,e))}_updateTouched(r={},e){this.touched=this._anyControlsTouched(),this._events.next(new Ct(this.touched,e)),r.onlySelf||this._parent?._updateTouched(r,e)}_onDisabledChange=[];_registerOnCollectionChange(r){this._onCollectionChange=r}_setUpdateStrategy(r){yr(r)&&r.updateOn!=null&&(this._updateOn=r.updateOn)}_parentMarkedDirty(r){return!r&&!!this._parent?.dirty&&!this._parent._anyControlsDirty()}_find(r){return null}_assignValidators(r){this._rawValidators=Array.isArray(r)?r.slice():r,this._composedValidatorFn=Wf(this._rawValidators)}_assignAsyncValidators(r){this._rawAsyncValidators=Array.isArray(r)?r.slice():r,this._composedAsyncValidatorFn=Gf(this._rawAsyncValidators)}},Ae=class extends Ye{constructor(r,e,i){super(ei(e),ti(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={}){Da(this,!0,r),Object.keys(r).forEach(i=>{Ta(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 n=this.controls[i];n&&n.patchValue(r[i],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e))}reset(r={},e={}){this._forEachChild((i,n)=>{i.reset(r?r[n]:null,j(C({},e),{onlySelf:!0}))}),this._updatePristine(e,this),this._updateTouched(e,this),this.updateValueAndValidity(e),e?.emitEvent!==!1&&this._events.next(new St(this))}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,n)=>((i.enabled||this.disabled)&&(e[n]=i.value),e))}_reduceChildren(r,e){let i=r;return this._forEachChild((n,o)=>{i=e(i,n,o)}),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 sx=Ae;var zr=class extends Ae{};var et=new z("",{factory:()=>br}),br="always";function _r(t,r){return[...r.path,t]}function xt(t,r,e=br){ri(t,r),r.valueAccessor.writeValue(t.value),(t.disabled||e==="always")&&r.valueAccessor.setDisabledState?.(t.disabled),Kf(t,r),Jf(t,r),zf(t,r),qf(t,r)}function mr(t,r,e=!0){let i=()=>{};r?.valueAccessor?.registerOnChange(i),r?.valueAccessor?.registerOnTouched(i),vr(t,r),t&&(r._invokeOnDestroyCallbacks(),t._registerOnCollectionChange(()=>{}))}function gr(t,r){t.forEach(e=>{e.registerOnValidatorChange&&e.registerOnValidatorChange(r)})}function qf(t,r){if(r.valueAccessor.setDisabledState){let e=i=>{r.valueAccessor.setDisabledState(i)};t.registerOnDisabledChange(e),r._registerOnDestroy(()=>{t._unregisterOnDisabledChange(e)})}}function ri(t,r){let e=wa(t);r.validator!==null?t.setValidators(ia(e,r.validator)):typeof e=="function"&&t.setValidators([e]);let i=Aa(t);r.asyncValidator!==null?t.setAsyncValidators(ia(i,r.asyncValidator)):typeof i=="function"&&t.setAsyncValidators([i]);let n=()=>t.updateValueAndValidity();gr(r._rawValidators,n),gr(r._rawAsyncValidators,n)}function vr(t,r){let e=!1;if(t!==null){if(r.validator!==null){let n=wa(t);if(Array.isArray(n)&&n.length>0){let o=n.filter(a=>a!==r.validator);o.length!==n.length&&(e=!0,t.setValidators(o))}}if(r.asyncValidator!==null){let n=Aa(t);if(Array.isArray(n)&&n.length>0){let o=n.filter(a=>a!==r.asyncValidator);o.length!==n.length&&(e=!0,t.setAsyncValidators(o))}}}let i=()=>{};return gr(r._rawValidators,i),gr(r._rawAsyncValidators,i),e}function Kf(t,r){r.valueAccessor.registerOnChange(e=>{t._pendingValue=e,t._pendingChange=!0,t._pendingDirty=!0,t.updateOn==="change"&&ka(t,r)})}function zf(t,r){r.valueAccessor.registerOnTouched(()=>{t._pendingTouched=!0,t.updateOn==="blur"&&t._pendingChange&&ka(t,r),t.updateOn!=="submit"&&t.markAsTouched()})}function ka(t,r){t._pendingDirty&&t.markAsDirty(),t.setValue(t._pendingValue,{emitModelToViewChange:!1}),r.viewToModelUpdate(t._pendingValue),t._pendingChange=!1}function Jf(t,r){let e=(i,n)=>{r.valueAccessor.writeValue(i),n&&r.viewToModelUpdate(i)};t.registerOnChange(e),r._registerOnDestroy(()=>{t._unregisterOnChange(e)})}function Ma(t,r){t==null,ri(t,r)}function Zf(t,r){return vr(t,r)}function ii(t,r){if(!t.hasOwnProperty("model"))return!1;let e=t.model;return e.isFirstChange()?!0:!Object.is(r,e.currentValue)}function Xf(t){return Object.getPrototypeOf(t.constructor)===da}function Va(t,r){t._syncPendingControls(),r.forEach(e=>{let i=e.control;i.updateOn==="submit"&&i._pendingChange&&(e.viewToModelUpdate(i._pendingValue),i._pendingChange=!1)})}function ni(t,r){if(!r)return null;Array.isArray(r);let e,i,n;return r.forEach(o=>{o.constructor===fa?e=o:Xf(o)?i=o:n=o}),n||i||e||null}function Qf(t,r){let e=t.indexOf(r);e>-1&&t.splice(e,1)}var Yf={provide:V,useExisting:O(()=>ep)},bt=Promise.resolve(),ep=(()=>{class t extends V{callSetDisabledState;get submitted(){return re(this.submittedReactive)}_submitted=$(()=>this.submittedReactive());submittedReactive=J(!1);_directives=new Set;form;ngSubmit=new de;options;constructor(e,i,n){super(),this.callSetDisabledState=n,this.form=new Ae({},Qr(e),Yr(i))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(e){bt.then(()=>{let i=this._findContainer(e.path);e.control=i.registerControl(e.name,e.control),xt(e.control,e,this.callSetDisabledState),e.control.updateValueAndValidity({emitEvent:!1}),this._directives.add(e)})}getControl(e){return this.form.get(e.path)}removeControl(e){bt.then(()=>{this._findContainer(e.path)?.removeControl(e.name),this._directives.delete(e)})}addFormGroup(e){bt.then(()=>{let i=this._findContainer(e.path),n=new Ae({});Ma(n,e),i.registerControl(e.name,n),n.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(e){bt.then(()=>{this._findContainer(e.path)?.removeControl?.(e.name)})}getFormGroup(e){return this.form.get(e.path)}updateModel(e,i){bt.then(()=>{this.form.get(e.path).setValue(i)})}setValue(e){this.control.setValue(e)}onSubmit(e){return this.submittedReactive.set(!0),Va(this.form,this._directives),this.ngSubmit.emit(e),this.form._events.next(new hr(this.control)),e?.target?.method==="dialog"}onReset(){this.resetForm()}resetForm(e=void 0){this.form.reset(e),this.submittedReactive.set(!1)}_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)(p(K,10),p(Te,10),p(et,8))};static \u0275dir=m({type:t,selectors:[["form",3,"ngNoForm","",3,"formGroup","",3,"formArray",""],["ng-form"],["","ngForm",""]],hostBindings:function(i,n){i&1&&L("submit",function(a){return n.onSubmit(a)})("reset",function(){return n.onReset()})},inputs:{options:[0,"ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],standalone:!1,features:[N([Yf]),_]})}return t})();function aa(t,r){let e=t.indexOf(r);e>-1&&t.splice(e,1)}function sa(t){return typeof t=="object"&&t!==null&&Object.keys(t).length===2&&"value"in t&&"disabled"in t}var Qe=class extends Ye{defaultValue=null;_onChange=[];_pendingValue;_pendingChange=!1;constructor(r=null,e,i){super(ei(e),ti(i,e)),this._applyFormState(r),this._setUpdateStrategy(e),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator}),yr(e)&&(e.nonNullable||e.initialValueIsDefault)&&(sa(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),e.overwriteDefaultValue&&(this.defaultValue=this.value),this._pendingChange=!1,e?.emitEvent!==!1&&this._events.next(new St(this))}_updateValue(){}_anyControls(r){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(r){this._onChange.push(r)}_unregisterOnChange(r){aa(this._onChange,r)}registerOnDisabledChange(r){this._onDisabledChange.push(r)}_unregisterOnDisabledChange(r){aa(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){sa(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}},cx=Qe,tp=t=>t instanceof Qe,rp=(()=>{class t extends V{_parent;ngOnInit(){this._checkParentType(),this.formDirective.addFormGroup(this)}ngOnDestroy(){this.formDirective?.removeFormGroup(this)}get control(){return this.formDirective.getFormGroup(this)}get path(){return _r(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(n){return(e||(e=Z(t)))(n||t)}})();static \u0275dir=m({type:t,standalone:!1,features:[_]})}return t})();var ip={provide:ue,useExisting:O(()=>np)},la=Promise.resolve(),np=(()=>{class t extends ue{_changeDetectorRef;callSetDisabledState;control=new Qe;static ngAcceptInputType_isDisabled;_registered=!1;viewModel;name="";isDisabled;model;options;update=new de;constructor(e,i,n,o,a,s){super(),this._changeDetectorRef=a,this.callSetDisabledState=s,this._parent=e,this._setValidators(i),this._setAsyncValidators(n),this.valueAccessor=ni(this,o)}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),ii(e,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){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(){xt(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){la.then(()=>{this.control.setValue(e,{emitViewToModelChange:!1}),this._changeDetectorRef?.markForCheck()})}_updateDisabled(e){let i=e.isDisabled.currentValue,n=i!==0&&Dr(i);la.then(()=>{n&&!this.control.disabled?this.control.disable():!n&&this.control.disabled&&this.control.enable(),this._changeDetectorRef?.markForCheck()})}_getPath(e){return this._parent?_r(e,this._parent):[e]}static \u0275fac=function(i){return new(i||t)(p(V,9),p(K,10),p(Te,10),p(wt,10),p(Et,8),p(et,8))};static \u0275dir=m({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:[N([ip]),_,Ee]})}return t})();var ux=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275dir=m({type:t,selectors:[["form",3,"ngNoForm","",3,"ngNativeValidate",""]],hostAttrs:["novalidate",""],standalone:!1})}return t})(),op={provide:wt,useExisting:O(()=>ap),multi:!0},ap=(()=>{class t extends da{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(n){return(e||(e=Z(t)))(n||t)}})();static \u0275dir=m({type:t,selectors:[["input","type","number","formControlName",""],["input","type","number","formControl",""],["input","type","number","ngModel",""]],hostBindings:function(i,n){i&1&&L("input",function(a){return n.onChange(a.target.value)})("blur",function(){return n.onTouched()})},standalone:!1,features:[N([op]),_]})}return t})();var Jr=class extends Ye{constructor(r,e,i){super(ei(e),ti(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={}){Array.isArray(r)?r.forEach(i=>{this.controls.push(i),this._registerControl(i)}):(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 n=this._adjustIndex(r);n<0&&(n=0),this.controls[n]&&this.controls[n]._registerOnCollectionChange(()=>{}),this.controls.splice(n,1),e&&(this.controls.splice(n,0,e),this._registerControl(e)),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}get length(){return this.controls.length}setValue(r,e={}){Da(this,!1,r),r.forEach((i,n)=>{Ta(this,!1,n),this.at(n).setValue(i,{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}patchValue(r,e={}){r!=null&&(r.forEach((i,n)=>{this.at(n)&&this.at(n).patchValue(i,{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e))}reset(r=[],e={}){this._forEachChild((i,n)=>{i.reset(r[n],j(C({},e),{onlySelf:!0}))}),this._updatePristine(e,this),this._updateTouched(e,this),this.updateValueAndValidity(e),e?.emitEvent!==!1&&this._events.next(new St(this))}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}};var Ea=(()=>{class t extends V{callSetDisabledState;get submitted(){return re(this._submittedReactive)}set submitted(e){this._submittedReactive.set(e)}_submitted=$(()=>this._submittedReactive());_submittedReactive=J(!1);_oldForm;_onCollectionChange=()=>this._updateDomValue();directives=[];constructor(e,i,n){super(),this.callSetDisabledState=n,this._setValidators(e),this._setAsyncValidators(i)}ngOnChanges(e){this.onChanges(e)}ngOnDestroy(){this.onDestroy()}onChanges(e){this._checkFormPresent(),e.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations(),this._oldForm=this.form)}onDestroy(){this.form&&(vr(this.form,this),this.form._onCollectionChange===this._onCollectionChange&&this.form._registerOnCollectionChange(()=>{}))}get formDirective(){return this}get path(){return[]}addControl(e){let i=this.form.get(e.path);return xt(i,e,this.callSetDisabledState),i.updateValueAndValidity({emitEvent:!1}),this.directives.push(e),i}getControl(e){return this.form.get(e.path)}removeControl(e){mr(e.control||null,e,!1),Qf(this.directives,e)}addFormGroup(e){this._setUpFormContainer(e)}removeFormGroup(e){this._cleanUpFormContainer(e)}getFormGroup(e){return this.form.get(e.path)}getFormArray(e){return this.form.get(e.path)}addFormArray(e){this._setUpFormContainer(e)}removeFormArray(e){this._cleanUpFormContainer(e)}updateModel(e,i){this.form.get(e.path).setValue(i)}onReset(){this.resetForm()}resetForm(e=void 0,i={}){this.form.reset(e,i),this._submittedReactive.set(!1)}onSubmit(e){return this.submitted=!0,Va(this.form,this.directives),this.ngSubmit.emit(e),this.form._events.next(new hr(this.control)),e?.target?.method==="dialog"}_updateDomValue(){this.directives.forEach(e=>{let i=e.control,n=this.form.get(e.path);i!==n&&(mr(i||null,e),tp(n)&&(xt(n,e,this.callSetDisabledState),e.control=n))}),this.form._updateTreeValidity({emitEvent:!1})}_setUpFormContainer(e){let i=this.form.get(e.path);Ma(i,e),i.updateValueAndValidity({emitEvent:!1})}_cleanUpFormContainer(e){let i=this.form?.get(e.path);i&&Zf(i,e)&&i.updateValueAndValidity({emitEvent:!1})}_updateRegistrations(){this.form._registerOnCollectionChange(this._onCollectionChange),this._oldForm?._registerOnCollectionChange(()=>{})}_updateValidators(){ri(this.form,this),this._oldForm&&vr(this._oldForm,this)}_checkFormPresent(){this.form}static \u0275fac=function(i){return new(i||t)(p(K,10),p(Te,10),p(et,8))};static \u0275dir=m({type:t,features:[_,Ee]})}return t})();var oi=new z(""),sp={provide:ue,useExisting:O(()=>lp)},lp=(()=>{class t extends ue{_ngModelWarningConfig;callSetDisabledState;viewModel;form;set isDisabled(e){}model;update=new de;static _ngModelWarningSentOnce=!1;_ngModelWarningSent=!1;constructor(e,i,n,o,a){super(),this._ngModelWarningConfig=o,this.callSetDisabledState=a,this._setValidators(e),this._setAsyncValidators(i),this.valueAccessor=ni(this,n)}ngOnChanges(e){if(this._isControlChanged(e)){let i=e.form.previousValue;i&&mr(i,this,!1),xt(this.form,this,this.callSetDisabledState),this.form.updateValueAndValidity({emitEvent:!1})}ii(e,this.viewModel)&&(this.form.setValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.form&&mr(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)(p(K,10),p(Te,10),p(wt,10),p(oi,8),p(et,8))};static \u0275dir=m({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:[N([sp]),_,Ee]})}return t})(),cp={provide:V,useExisting:O(()=>Ia)},Ia=(()=>{class t extends rp{name=null;constructor(e,i,n){super(),this._parent=e,this._setValidators(i),this._setAsyncValidators(n)}_checkParentType(){Pa(this._parent)}static \u0275fac=function(i){return new(i||t)(p(V,13),p(K,10),p(Te,10))};static \u0275dir=m({type:t,selectors:[["","formGroupName",""]],inputs:{name:[0,"formGroupName","name"]},standalone:!1,features:[N([cp]),_]})}return t})(),up={provide:V,useExisting:O(()=>Oa)},Oa=(()=>{class t extends V{_parent;name=null;constructor(e,i,n){super(),this._parent=e,this._setValidators(i),this._setAsyncValidators(n)}ngOnInit(){Pa(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 _r(this.name==null?this.name:this.name.toString(),this._parent)}static \u0275fac=function(i){return new(i||t)(p(V,13),p(K,10),p(Te,10))};static \u0275dir=m({type:t,selectors:[["","formArrayName",""]],inputs:{name:[0,"formArrayName","name"]},standalone:!1,features:[N([up]),_]})}return t})();function Pa(t){return!(t instanceof Ia)&&!(t instanceof Ea)&&!(t instanceof Oa)}var dp={provide:ue,useExisting:O(()=>fp)},fp=(()=>{class t extends ue{_ngModelWarningConfig;_added=!1;viewModel;control;name=null;set isDisabled(e){}model;update=new de;static _ngModelWarningSentOnce=!1;_ngModelWarningSent=!1;constructor(e,i,n,o,a){super(),this._ngModelWarningConfig=a,this._parent=e,this._setValidators(i),this._setAsyncValidators(n),this.valueAccessor=ni(this,o)}ngOnChanges(e){this._added||this._setUpControl(),ii(e,this.viewModel)&&(this.viewModel=this.model,this.formDirective.updateModel(this,this.model))}ngOnDestroy(){this.formDirective?.removeControl(this)}viewToModelUpdate(e){this.viewModel=e,this.update.emit(e)}get path(){return _r(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)(p(V,13),p(K,10),p(Te,10),p(wt,10),p(oi,8))};static \u0275dir=m({type:t,selectors:[["","formControlName",""]],inputs:{name:[0,"formControlName","name"],isDisabled:[0,"disabled","isDisabled"],model:[0,"ngModel","model"]},outputs:{update:"ngModelChange"},standalone:!1,features:[N([dp]),_,Ee]})}return t})();var pp={provide:V,useExisting:O(()=>hp)},hp=(()=>{class t extends Ea{form=null;ngSubmit=new de;get control(){return this.form}static \u0275fac=(()=>{let e;return function(n){return(e||(e=Z(t)))(n||t)}})();static \u0275dir=m({type:t,selectors:[["","formGroup",""]],hostBindings:function(i,n){i&1&&L("submit",function(a){return n.onSubmit(a)})("reset",function(){return n.onReset()})},inputs:{form:[0,"formGroup","form"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],standalone:!1,features:[N([pp]),_]})}return t})();function Fa(t){return typeof t=="number"?t:parseFloat(t)}var Cr=(()=>{class t{_validator=cr;_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):cr,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=m({type:t,features:[Ee]})}return t})(),mp={provide:K,useExisting:O(()=>gp),multi:!0},gp=(()=>{class t extends Cr{max;inputName="max";normalizeInput=e=>Fa(e);createValidator=e=>ha(e);static \u0275fac=(()=>{let e;return function(n){return(e||(e=Z(t)))(n||t)}})();static \u0275dir=m({type:t,selectors:[["input","type","number","max","","formControlName",""],["input","type","number","max","","formControl",""],["input","type","number","max","","ngModel",""]],hostVars:1,hostBindings:function(i,n){i&2&&ie("max",n._enabled?n.max:null)},inputs:{max:"max"},standalone:!1,features:[N([mp]),_]})}return t})(),vp={provide:K,useExisting:O(()=>yp),multi:!0},yp=(()=>{class t extends Cr{min;inputName="min";normalizeInput=e=>Fa(e);createValidator=e=>pa(e);static \u0275fac=(()=>{let e;return function(n){return(e||(e=Z(t)))(n||t)}})();static \u0275dir=m({type:t,selectors:[["input","type","number","min","","formControlName",""],["input","type","number","min","","formControl",""],["input","type","number","min","","ngModel",""]],hostVars:1,hostBindings:function(i,n){i&2&&ie("min",n._enabled?n.min:null)},inputs:{min:"min"},standalone:!1,features:[N([vp]),_]})}return t})(),bp={provide:K,useExisting:O(()=>_p),multi:!0};var _p=(()=>{class t extends Cr{required;inputName="required";normalizeInput=Dr;createValidator=e=>ma;enabled(e){return e}static \u0275fac=(()=>{let e;return function(n){return(e||(e=Z(t)))(n||t)}})();static \u0275dir=m({type:t,selectors:[["","required","","formControlName","",3,"type","checkbox"],["","required","","formControl","",3,"type","checkbox"],["","required","","ngModel","",3,"type","checkbox"]],hostVars:1,hostBindings:function(i,n){i&2&&ie("required",n._enabled?"":null)},inputs:{required:"required"},standalone:!1,features:[N([bp]),_]})}return t})();var Cp={provide:K,useExisting:O(()=>Sp),multi:!0},Sp=(()=>{class t extends Cr{pattern;inputName="pattern";normalizeInput=e=>e;createValidator=e=>ga(e);static \u0275fac=(()=>{let e;return function(n){return(e||(e=Z(t)))(n||t)}})();static \u0275dir=m({type:t,selectors:[["","pattern","","formControlName",""],["","pattern","","formControl",""],["","pattern","","ngModel",""]],hostVars:1,hostBindings:function(i,n){i&2&&ie("pattern",n._enabled?n.pattern:null)},inputs:{pattern:"pattern"},standalone:!1,features:[N([Cp]),_]})}return t})();var Ra=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=nt({type:t});static \u0275inj=tt({})}return t})();function ca(t){return!!t&&(t.asyncValidators!==void 0||t.validators!==void 0||t.updateOn!==void 0)}var xp=(()=>{class t{useNonNullable=!1;get nonNullable(){let e=new t;return e.useNonNullable=!0,e}group(e,i=null){let n=this._reduceControls(e),o={};return ca(i)?o=i:i!==null&&(o.validators=i.validator,o.asyncValidators=i.asyncValidator),new Ae(n,o)}record(e,i=null){let n=this._reduceControls(e);return new zr(n,i)}control(e,i,n){let o={};return this.useNonNullable?(ca(i)?o=i:(o.validators=i,o.asyncValidators=n),new Qe(e,j(C({},o),{nonNullable:!0}))):new Qe(e,i,n)}array(e,i,n){let o=e.map(a=>this._createControl(a));return new Jr(o,i,n)}_reduceControls(e){let i={};return Object.keys(e).forEach(n=>{i[n]=this._createControl(e[n])}),i}_createControl(e){if(e instanceof Qe)return e;if(e instanceof Ye)return e;if(Array.isArray(e)){let i=e[0],n=e.length>1?e[1]:null,o=e.length>2?e[2]:null;return this.control(i,n,o)}else return this.control(e)}static \u0275fac=function(i){return new(i||t)};static \u0275prov=x({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var dx=(()=>{class t extends xp{group(e,i=null){return super.group(e,i)}control(e,i,n){return super.control(e,i,n)}array(e,i,n){return super.array(e,i,n)}static \u0275fac=(()=>{let e;return function(n){return(e||(e=Z(t)))(n||t)}})();static \u0275prov=x({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),fx=(()=>{class t{static withConfig(e){return{ngModule:t,providers:[{provide:et,useValue:e.callSetDisabledState??br}]}}static \u0275fac=function(i){return new(i||t)};static \u0275mod=nt({type:t});static \u0275inj=tt({imports:[Ra]})}return t})(),px=(()=>{class t{static withConfig(e){return{ngModule:t,providers:[{provide:oi,useValue:e.warnOnNgModelWithFormControl??"always"},{provide:et,useValue:e.callSetDisabledState??br}]}}static \u0275fac=function(i){return new(i||t)};static \u0275mod=nt({type:t});static \u0275inj=tt({imports:[Ra]})}return t})();var gx=(()=>{class t{isErrorState(e,i){return!!(e&&e.invalid&&(e.touched||i&&i.submitted))}static \u0275fac=function(i){return new(i||t)};static \u0275prov=x({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var Na=class{_defaultMatcher;ngControl;_parentFormGroup;_parentForm;_stateChanges;errorState=!1;matcher;constructor(r,e,i,n,o){this._defaultMatcher=r,this.ngControl=e,this._parentFormGroup=i,this._parentForm=n,this._stateChanges=o}updateErrorState(){let r=this.errorState,e=this._parentFormGroup||this._parentForm,i=this.matcher||this._defaultMatcher,n=this.ngControl?this.ngControl.control:null,o=i?.isErrorState(n,e)??!1;o!==r&&(this.errorState=o,this._stateChanges.next())}};export{ye as a,gt as b,ea as c,tr as d,ff as e,hf as f,d as g,Ri as h,Oe as i,mt as j,Ui as k,Xo as l,ta as m,jS as n,wt as o,fa as p,K as q,ra as r,ue as s,ox as t,ax as u,Ae as v,sx as w,ep as x,Qe as y,cx as z,np as A,ux as B,ap as C,lp as D,Ia as E,Oa as F,fp as G,hp as H,gp as I,yp as J,_p as K,Sp as L,dx as M,fx as N,px as O,gx as P,Na as Q};
|