@mxtommy/kip 4.0.2 → 4.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/package.json +1 -1
- package/public/{chunk-OA5PBKO5.js → chunk-2DBQEP6W.js} +1 -1
- package/public/{chunk-KI5CZR7P.js → chunk-34G2VVZF.js} +1 -1
- package/public/{chunk-BEFXDBJY.js → chunk-3O3POI5Z.js} +1 -1
- package/public/{chunk-V2FKRRBL.js → chunk-6V3WWWDX.js} +1 -1
- package/public/{chunk-CA2BN4YV.js → chunk-7C7K2XSO.js} +1 -1
- package/public/chunk-IO5SDLYV.js +1 -0
- package/public/{chunk-B4SMHL7P.js → chunk-NDOR4O4J.js} +1 -1
- package/public/{chunk-NBMGYSW2.js → chunk-PKKBBIJK.js} +1 -1
- package/public/{chunk-H3EFQCTE.js → chunk-QLTN6G6E.js} +1 -1
- package/public/{chunk-UIO7WC72.js → chunk-QZJKBIMY.js} +1 -1
- package/public/{chunk-PPT35KWJ.js → chunk-SY22WXMI.js} +1 -1
- package/public/{chunk-E7MNINLP.js → chunk-WL5TH323.js} +1 -1
- package/public/chunk-XDPHEQEO.js +2 -0
- package/public/{chunk-DKOFT6NI.js → chunk-XZW7P6RL.js} +13 -13
- package/public/index.html +1 -1
- package/public/{main-7RENLC7I.js → main-PXPGE7J4.js} +1 -1
- package/public/chunk-F75BVJPY.js +0 -2
- package/public/chunk-WYPJEP5R.js +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{A as Or,G as he,H as kr,Hb as er,Ia as Qt,Ic as ve,Ja as f,Nc as $e,O as Pr,Pa as lt,Qa as y,Sa as S,Wa as ee,Xb as O,Z as Fr,Za as Nr,a as P,aa as at,ab as je,b as j,ba as I,ca as D,cc as q,da as st,dc as me,ea as ce,f as E,ga as F,j as ot,l as v,nc as Rr,p as Er,pc as tr,r as Yt,ra as Q,t as N,tb as Le,ua as ge,uc as rr,v as nt,va as G,w as Ir,wa as Xt}from"./chunk-OB3QLUH6.js";var c=(function(t){return t.Disconnected="Disconnected",t.HTTPDiscovering="HTTPDiscovering",t.HTTPConnected="HTTPConnected",t.HTTPError="HTTPError",t.HTTPRetrying="HTTPRetrying",t.WebSocketConnecting="WebSocketConnecting",t.Connected="Connected",t.WebSocketError="WebSocketError",t.WebSocketRetrying="WebSocketRetrying",t.PermanentFailure="PermanentFailure",t})(c||{}),Ur=(()=>{class t{config={httpRetryCount:3,webSocketRetryCount:5,retryIntervals:[2e3,3e3,5e3],notificationDebounceMs:0};_currentState$=new v(c.Disconnected);_status$=new v(this.createStatus(c.Disconnected,"Not connected"));_httpRetryCount=0;_webSocketRetryCount=0;_retryTimeout=null;_notificationTimeout=null;_httpRetryCallback=null;_webSocketRetryCallback=null;_isInitializationMode=!0;constructor(){console.log("[ConnectionStateMachine] Service initialized")}get state$(){return this._currentState$.asObservable()}get status$(){return this._status$.asObservable()}get currentState(){return this._currentState$.getValue()}enableWebSocketMode(){this._isInitializationMode=!1,console.log("[ConnectionStateMachine] WebSocket mode enabled");let e=this._status$.getValue();console.log(`[ConnectionStateMachine] Current status when enabling WebSocket mode: ${e.state} - ${e.message}`),this._status$.next(e)}setHTTPRetryCallback(e){this._httpRetryCallback=e}setWebSocketRetryCallback(e){this._webSocketRetryCallback=e}startHTTPDiscovery(e="Connection request"){console.log(`[ConnectionStateMachine] Starting HTTP discovery: ${e}`),this._httpRetryCount=0,this.setState(c.HTTPDiscovering,"Discovering Signal K server...")}onHTTPDiscoverySuccess(){console.log("[ConnectionStateMachine] HTTP discovery successful"),this._httpRetryCount=0,this.setState(c.HTTPConnected,"Signal K server discovered"),this._isInitializationMode||this.startWebSocketConnection()}onHTTPDiscoveryError(e){console.log(`[ConnectionStateMachine] HTTP discovery failed: ${e}`),this._httpRetryCount<this.config.httpRetryCount?(this._httpRetryCount++,this.setState(c.HTTPRetrying,`HTTP connection failed. Retrying (${this._httpRetryCount}/${this.config.httpRetryCount})...`,this._httpRetryCount,this.config.httpRetryCount),this.scheduleHTTPRetry()):this.setState(c.PermanentFailure,`HTTP connection failed after ${this.config.httpRetryCount} attempts. Check server URL.`,this.config.httpRetryCount,this.config.httpRetryCount)}startWebSocketConnection(){if(!(this.currentState===c.HTTPConnected||this.currentState===c.WebSocketRetrying||this.currentState===c.WebSocketConnecting||this.currentState===c.Connected))return this.currentState===c.HTTPDiscovering,void 0;console.log("[ConnectionStateMachine] Starting WebSocket connection"),this._webSocketRetryCount=0,this.setState(c.WebSocketConnecting,"Connecting to Signal K Websocket...")}onWebSocketConnected(){console.log("[ConnectionStateMachine] WebSocket connected"),this._webSocketRetryCount=0,this.setState(c.Connected,"Connected to Signal K server")}onWebSocketError(e){if(console.log(`[ConnectionStateMachine] WebSocket error: ${e}`),this.currentState!==c.HTTPConnected&&this.currentState!==c.WebSocketConnecting&&this.currentState!==c.Connected&&this.currentState!==c.WebSocketRetrying){console.log("[ConnectionStateMachine] HTTP connection lost, restarting HTTP discovery"),this.startHTTPDiscovery("HTTP connection lost during WebSocket operation");return}this._webSocketRetryCount++,this.setState(c.WebSocketRetrying,`WebSocket connection failed. Retry attempt ${this._webSocketRetryCount}...`,this._webSocketRetryCount,this.config.webSocketRetryCount),this.scheduleWebSocketRetry()}shutdown(e="App shutdown"){console.log(`[ConnectionStateMachine] Shutting down all connections: ${e}`),this.clearRetryTimer(),this.clearNotificationTimeout(),this._httpRetryCount=0,this._webSocketRetryCount=0,this.setState(c.Disconnected,"Application restarting...")}isHTTPConnected(){return this.currentState===c.HTTPConnected||this.currentState===c.WebSocketConnecting||this.currentState===c.Connected||this.currentState===c.WebSocketRetrying}isFullyConnected(){return this.currentState===c.Connected}setState(e,i,o,n){this._currentState$.next(e);let a=this.createStatus(e,i,o,n);e===c.HTTPDiscovering||e===c.WebSocketConnecting?this._status$.next(a):e===c.Connected?(this.clearNotificationTimeout(),this._notificationTimeout=setTimeout(()=>{this._status$.next(a)},this.config.notificationDebounceMs)):(this.clearNotificationTimeout(),this._status$.next(a))}createStatus(e,i,o,n){return{state:e,operation:this.stateToOperationCode(e),message:i,retryCount:o||0,maxRetries:n||0,timestamp:new Date}}stateToOperationCode(e){switch(e){case c.Disconnected:return 0;case c.HTTPDiscovering:case c.WebSocketConnecting:return 1;case c.Connected:return 2;case c.HTTPError:case c.WebSocketError:case c.HTTPRetrying:case c.WebSocketRetrying:return 3;case c.HTTPConnected:return 2;case c.PermanentFailure:return 5;default:return 0}}scheduleHTTPRetry(){this.clearRetryTimer();let e=Math.min(this._httpRetryCount-1,this.config.retryIntervals.length-1),i=this.config.retryIntervals[e];console.log(`[ConnectionStateMachine] Scheduling HTTP retry in ${i}ms`),this._retryTimeout=setTimeout(()=>{this._httpRetryCallback?(console.log(`[ConnectionStateMachine] Executing HTTP retry ${this._httpRetryCount}/${this.config.httpRetryCount}`),this._httpRetryCallback()):(console.error("[ConnectionStateMachine] No HTTP retry callback set!"),this.setState(c.Disconnected,"HTTP retry callback not configured"))},i)}scheduleWebSocketRetry(){this.clearRetryTimer(),console.log(`[ConnectionStateMachine] Scheduling WebSocket retry in ${this.config.retryIntervals[1]}ms`),this._retryTimeout=setTimeout(()=>{this._webSocketRetryCallback?(console.log(`[ConnectionStateMachine] Executing WebSocket retry ${this._webSocketRetryCount}/${this.config.webSocketRetryCount}`),this._webSocketRetryCallback()):(console.log("[ConnectionStateMachine] No WebSocket retry callback - using state change method"),this.setState(c.WebSocketConnecting,`Retrying WebSocket connection (${this._webSocketRetryCount}/${this.config.webSocketRetryCount})...`,this._webSocketRetryCount,this.config.webSocketRetryCount))},this.config.retryIntervals[1])}clearRetryTimer(){this._retryTimeout&&(clearTimeout(this._retryTimeout),this._retryTimeout=null)}clearNotificationTimeout(){this._notificationTimeout&&(clearTimeout(this._notificationTimeout),this._notificationTimeout=null)}ngOnDestroy(){this.clearRetryTimer(),this.clearNotificationTimeout(),this._httpRetryCallback=null,this._webSocketRetryCallback=null,this._currentState$?.complete(),this._status$?.complete()}static \u0275fac=function(i){return new(i||t)};static \u0275prov=D({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var ut=(()=>{class t{TIMEOUT_DURATION=1e4;connectionStateMachine=F(Ur);constructor(){this.connectionStateMachine.setHTTPRetryCallback(()=>{console.log("[SignalKConnectionService] Executing HTTP retry via callback"),this.retryCurrentConnection()})}serverServiceEndpoint$=new v({operation:0,message:"Not connected",serverDescription:null,httpServiceUrl:null,WsServiceUrl:null});signalKURL;serverName;serverVersion$=new v(null);serverRoles=[];http=F(ve);currentProxyEnabled;currentSubscribeAll;validateSignalKUrl(e){return E(this,null,function*(){if(!e)throw new Error("Please enter a server URL");try{let o=new URL(e);if(!["http:","https:"].includes(o.protocol))throw new Error("URL must start with http:// or https://")}catch{throw new Error("Invalid URL format - please check for typos and ensure it starts with http:// or https://")}let i=e;i.endsWith("signalk/")||(i+="/signalk/"),console.log(`[Connection Service] Validating Signal K server at: ${e}`);try{if(!(yield N(this.http.get(i,{observe:"response"}).pipe(nt(5e3),he(n=>{throw console.error("[Connection Service] HTTP Error details:",n),n.name==="TimeoutError"?(console.error("[Connection Service] Validation timed out after 5000ms"),new Error("Server is not responding - check if the URL is correct and the server is running")):n.status===0||n.status===void 0?new Error("Cannot connect to server - check the URL format and ensure the server is accessible"):n.status===404?new Error("Server found but no Signal K service detected - verify this is a Signal K server"):n.status===403?new Error("Server refused connection - check if the server allows connections from this browser"):n.status>=500?new Error(`Server error (${n.status}) - the Signal K server may be having issues`):new Error(`Connection failed (${n.status}) - ${n.statusText||"please check the server URL"}`)})))).body?.endpoints?.v1)throw new Error("Server responded but doesn't appear to be a Signal K server - missing required endpoints");console.log(`[Connection Service] Validation successful for: ${e}`)}catch(o){throw console.error(`[Connection Service] Validation failed for ${e}:`,o.message),o}})}initializeConnection(e,i,o){return E(this,null,function*(){if(!e.url){console.log("[Connection Service] Connection initialization called with null or empty URL value");return}this.currentProxyEnabled=i,this.currentSubscribeAll=o;let n={operation:1,message:"Connecting...",serverDescription:null,httpServiceUrl:null,WsServiceUrl:null};this.signalKURL=e,this.serverServiceEndpoint$.next(n),this.connectionStateMachine.startHTTPDiscovery(`Connecting to ${e.url}`);let a=this.signalKURL.url;a.endsWith("signalk/")||(a+="/signalk/");try{console.log("[Connection Service] Connecting to: "+this.signalKURL.url);let s=yield N(this.http.get(a,{observe:"response"}).pipe(nt(this.TIMEOUT_DURATION),he(l=>(l.name==="TimeoutError"&&console.error("[Connection Service] Connection request timed out after "+this.TIMEOUT_DURATION+"ms"),Yt(l)))));Object.assign(n,this.processEndpointResponse(s,i,o)),this.connectionStateMachine.onHTTPDiscoverySuccess()}catch(s){n.operation=3,n.message=s.message,this.connectionStateMachine.onHTTPDiscoveryError(s.message),this.handleError(s)}finally{n.subscribeAll=!!o,this.serverServiceEndpoint$.next(n)}})}retryCurrentConnection(){if(!this.signalKURL?.url){console.error("[SignalKConnectionService] Cannot retry - no current URL stored");return}console.log(`[SignalKConnectionService] Retrying connection to ${this.signalKURL.url}`),this.performHTTPDiscovery()}performHTTPDiscovery(){return E(this,null,function*(){if(!this.signalKURL?.url){console.error("[SignalKConnectionService] No URL available for HTTP discovery");return}let e=this.signalKURL.url;e.endsWith("signalk/")||(e+="/signalk/");try{console.log("[Connection Service] Connecting to: "+this.signalKURL.url);let i=yield N(this.http.get(e,{observe:"response"}).pipe(nt(this.TIMEOUT_DURATION),he(n=>(n.name==="TimeoutError"&&console.error("[Connection Service] Connection request timed out after "+this.TIMEOUT_DURATION+"ms"),Yt(n))))),o=this.processEndpointResponse(i,this.currentProxyEnabled,this.currentSubscribeAll);this.connectionStateMachine.onHTTPDiscoverySuccess(),this.serverServiceEndpoint$.next(o)}catch(i){let o={operation:3,message:i.message,serverDescription:null,httpServiceUrl:null,WsServiceUrl:null};this.connectionStateMachine.onHTTPDiscoveryError(i.message),this.serverServiceEndpoint$.next(o),this.handleError(i)}})}processEndpointResponse(e,i,o){console.debug("[Connection Service] Signal K HTTP Endpoints retrieved"),this.serverVersion$.next(e.body.server.version);let n=e.body.endpoints.v1["signalk-http"],a=e.body.endpoints.v1["signalk-ws"],s={operation:2,message:e.status?.toString()||"Connected",serverDescription:`${e.body.server.id} ${e.body.server.version}`,httpServiceUrl:null,WsServiceUrl:null};if(i)console.debug("[Connection Service] Proxy Mode Enabled"),s.httpServiceUrl=window.location.origin+new URL(n).pathname,s.WsServiceUrl=window.location.protocol.replace("http","ws")+"//"+window.location.host+new URL(a).pathname;else{s.httpServiceUrl=n;let l=window.location.protocol==="https:";s.WsServiceUrl=l?a.replace("ws://","wss://"):a}return console.debug("[Connection Service] HTTP URI: "+s.httpServiceUrl),console.debug("[Connection Service] WebSocket URI: "+s.WsServiceUrl),s.subscribeAll=!!o,s}handleError(e){let i=e.status===0?`[Connection Service] ${e.name}: ${e.message}`:`[Connection Service] Backend returned code ${e.status}, body was: ${e.error}`;throw console.error(i),e}getServiceEndpointStatusAsO(){return this.serverServiceEndpoint$.asObservable()}setServerInfo(e,i,o){this.serverName=e,this.serverRoles=o,console.log(`[Connection Service] Server Name: ${e}, Version: ${i}, Roles: ${JSON.stringify(o)}`)}get skServerName(){return this.serverName}get skServerVersion(){return this.serverVersion$.getValue()}get skServerRoles(){return this.serverRoles}static \u0275fac=function(i){return new(i||t)};static \u0275prov=D({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var jn="/signalk/v1/",jr="auth/login",Ln="auth/logout",$n="auth/validate",ir=60,Wn=2147483647,Lr=(()=>{class t{http=F(ve);conn=F(ut);_IsLoggedIn$=new v(!1);isLoggedIn$=this._IsLoggedIn$.asObservable();_authToken$=new v(null);authToken$=this._authToken$.asObservable();connectionEndpointSubscription=null;authTokenSubscription=null;renewalTimerId=null;isRenewingToken=!1;loginUrl=null;logoutUrl=null;validateTokenUrl=null;constructor(){let e=JSON.parse(localStorage.getItem("authorization_token"));e&&(e.isDeviceAccessToken?e.expiry===null?(console.log("[Authentication Service] Device Access Token found with expiry: NEVER"),this._authToken$.next(e)):this.isTokenExpired(e.expiry)?(console.log("[Authentication Service] Device Access Token expired. Deleting token"),localStorage.removeItem("authorization_token")):(console.log("[Authentication Service] Device Access Token found in Local Storage"),this._authToken$.next(e)):(console.log("[Authentication Service] User session token found in Local Storage"),console.log("[Authentication Service] Deleting user session token"),localStorage.removeItem("authorization_token"))),this.authTokenSubscription=this._authToken$.pipe(Pr((i,o)=>i?.expiry===o?.expiry)).subscribe(i=>{this.renewalTimerId&&(clearTimeout(this.renewalTimerId),this.renewalTimerId=null),!(!i||i.expiry==null)&&this.scheduleRenewalChunk(i)}),this.connectionEndpointSubscription=this.conn.serverServiceEndpoint$.subscribe(i=>{if(i.operation===2){let o=i.httpServiceUrl.substring(0,i.httpServiceUrl.length-4);this.loginUrl=o+jr,this.logoutUrl=o+Ln,this.validateTokenUrl=o+$n}})}scheduleRenewalChunk(e){let i=Date.now(),o=(e.expiry-ir)*1e3,n=o-i;if(n<=0){this.handleTokenRenewal();return}let a=Math.min(n,Wn);console.log(a!==n?`[Authentication Service] Large renewal delay (${n} ms). Scheduling first chunk of ${a} ms.`:`[Authentication Service] Scheduling token renewal in ${a} ms (buffered target: ${new Date(o).toISOString()})`),this.renewalTimerId=setTimeout(()=>{this.renewalTimerId=null;let s=this._authToken$.getValue();!s||s.expiry!==e.expiry||this.scheduleRenewalChunk(e)},a)}handleTokenRenewal(){if(this.isRenewingToken){console.warn("[Authentication Service] Token renewal already in progress.");return}this.isRenewingToken=!0;let e=JSON.parse(localStorage.getItem("authorization_token"));if(!e){console.warn("[Authentication Service] No token found in local storage. Cannot renew."),this.isRenewingToken=!1;return}if(e.isDeviceAccessToken)console.warn("[Authentication Service] Device Access Token expired. Manual renewal required."),this.isRenewingToken=!1;else{let i=Math.floor(Date.now()/1e3),o=e.expiry-i;if(this.isTokenExpired(e.expiry))console.log("[Authentication Service] User session Token expired. Cannot renew."),this.isRenewingToken=!1;else if(o>ir)console.log(`[Authentication Service] Renewal trigger fired early; ${o}s remaining (> buffer ${ir}s). Rescheduling.`),this.isRenewingToken=!1,this.scheduleRenewalChunk(e);else{console.log(`[Authentication Service] User session Token within renewal window (${o}s remaining). Renewing token...`);let n=JSON.parse(localStorage.getItem("connectionConfig"));this.login({usr:n.loginName,pwd:n.loginPassword}).then(()=>{console.log("[Authentication Service] Token successfully renewed.")}).catch(a=>{console.error("[Authentication Service] Token renewal failed. Server returned:",a.error)}).finally(()=>{this.isRenewingToken=!1})}}}login(n){return E(this,arguments,function*({usr:e,pwd:i,newUrl:o}){let a;if(o?a=o.replace(/\/+$/,"")+jn+jr:a=this.loginUrl,this._IsLoggedIn$.getValue()&&(yield this.logout(!0)),!a)throw console.error("[Authentication Service] Login URL is not set. Cannot perform login."),this.deleteToken(),new Error("Login URL is not set.");yield N(this.http.post(a,{username:e,password:i},{observe:"response"})).then(s=>{console.log("[Authentication Service] User "+e+" login successful"),this.setSession(s.body.token)}).catch(s=>{this.deleteToken(),this.handleError(s)})})}handleError(e){throw e.status===0&&this.deleteToken(),e}setSession(e){if(e){let i=JSON.parse(atob(e.split(".")[1])).exp,o={token:null,expiry:null,isDeviceAccessToken:!1};i===void 0?(o.token=e,console.log("[Authentication Service] User Session Token received. Token Expiration: NEVER"),this._IsLoggedIn$.next(!0),this._authToken$.next(o),localStorage.setItem("authorization_token",JSON.stringify(o))):this.isTokenExpired(i)?console.log("[Authentication Service] Received expired Session Token from server"):(o.token=e,o.expiry=i,console.log("[Authentication Service] Session Authorization Token received. Token Expiration: "+this.getTokenExpirationDate(o.expiry)),this._IsLoggedIn$.next(!0),this._authToken$.next(o),localStorage.setItem("authorization_token",JSON.stringify(o)))}}isTokenExpired(e){return Math.floor(new Date().getTime()/1e3)>=e}getTokenExpirationDate(e,i){let o=new Date(0);if(i){let n=new Date(0);n.setUTCSeconds(e-i),o=n}else o.setUTCSeconds(e);return o}renewToken(){return this.http.post(this.validateTokenUrl,null,{observe:"response"})}logout(e){return E(this,null,function*(){localStorage.removeItem("authorization_token"),yield N(this.http.put(this.logoutUrl,null)).then(()=>{this._IsLoggedIn$.next(!1),e||this._authToken$.next(null),console.log("[Authentication Service] User logged out")}).catch(i=>{console.error(i)})})}deleteToken(){this._authToken$&&(console.log("[Authentication Service] Deleting Authorization token"),localStorage.removeItem("authorization_token"),this._IsLoggedIn$.next(!1),this._authToken$.next(null))}setDeviceAccessToken(e){if(e){let i=JSON.parse(atob(e.split(".")[1])).exp,o={token:null,expiry:null,isDeviceAccessToken:!0};i===void 0?(o.token=e,console.log("[Authentication Service] Device Access Token received. Token Expiration: NEVER"),this._IsLoggedIn$.next(!1),this._authToken$.next(o),localStorage.setItem("authorization_token",JSON.stringify(o))):this.isTokenExpired(i)?console.log("[Authentication Service] Received expired Device Access Token from server"):(o.token=e,o.expiry=i,console.log("[Authentication Service] Device Access Token received. Token Expiration: "+this.getTokenExpirationDate(o.expiry)),this._IsLoggedIn$.next(!1),this._authToken$.next(o),localStorage.setItem("authorization_token",JSON.stringify(o)))}}ngOnDestroy(){this.connectionEndpointSubscription?.unsubscribe(),this.authTokenSubscription?.unsubscribe(),this.renewalTimerId&&(clearTimeout(this.renewalTimerId),this.renewalTimerId=null)}static \u0275fac=function(i){return new(i||t)};static \u0275prov=D({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var Bn=typeof global=="object"&&global&&global.Object===Object&&global,ct=Bn;var Hn=typeof self=="object"&&self&&self.Object===Object&&self,Gn=ct||Hn||Function("return this")(),b=Gn;var qn=b.Symbol,R=qn;var $r=Object.prototype,Kn=$r.hasOwnProperty,zn=$r.toString,We=R?R.toStringTag:void 0;function Jn(t){var r=Kn.call(t,We),e=t[We];try{t[We]=void 0;var i=!0}catch{}var o=zn.call(t);return i&&(r?t[We]=e:delete t[We]),o}var Wr=Jn;var Zn=Object.prototype,Yn=Zn.toString;function Xn(t){return Yn.call(t)}var Br=Xn;var Qn="[object Null]",ea="[object Undefined]",Hr=R?R.toStringTag:void 0;function ta(t){return t==null?t===void 0?ea:Qn:Hr&&Hr in Object(t)?Wr(t):Br(t)}var L=ta;function ra(t){return t!=null&&typeof t=="object"}var x=ra;var ia=Array.isArray,U=ia;function oa(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}var T=oa;function na(t){return t}var ft=na;var aa="[object AsyncFunction]",sa="[object Function]",la="[object GeneratorFunction]",ua="[object Proxy]";function ca(t){if(!T(t))return!1;var r=L(t);return r==sa||r==la||r==aa||r==ua}var be=ca;var fa=b["__core-js_shared__"],dt=fa;var Gr=(function(){var t=/[^.]+$/.exec(dt&&dt.keys&&dt.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function da(t){return!!Gr&&Gr in t}var qr=da;var pa=Function.prototype,ha=pa.toString;function ga(t){if(t!=null){try{return ha.call(t)}catch{}try{return t+""}catch{}}return""}var K=ga;var ma=/[\\^$.*+?()[\]{}|]/g,va=/^\[object .+?Constructor\]$/,ya=Function.prototype,ba=Object.prototype,Sa=ya.toString,Ca=ba.hasOwnProperty,_a=RegExp("^"+Sa.call(Ca).replace(ma,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function xa(t){if(!T(t)||qr(t))return!1;var r=be(t)?_a:va;return r.test(K(t))}var Kr=xa;function wa(t,r){return t?.[r]}var zr=wa;function Ta(t,r){var e=zr(t,r);return Kr(e)?e:void 0}var k=Ta;var Aa=k(b,"WeakMap"),pt=Aa;var Jr=Object.create,Da=(function(){function t(){}return function(r){if(!T(r))return{};if(Jr)return Jr(r);t.prototype=r;var e=new t;return t.prototype=void 0,e}})(),Zr=Da;function Va(t,r,e){switch(e.length){case 0:return t.call(r);case 1:return t.call(r,e[0]);case 2:return t.call(r,e[0],e[1]);case 3:return t.call(r,e[0],e[1],e[2])}return t.apply(r,e)}var Yr=Va;function Ma(t,r){var e=-1,i=t.length;for(r||(r=Array(i));++e<i;)r[e]=t[e];return r}var ht=Ma;var Ea=800,Ia=16,Oa=Date.now;function ka(t){var r=0,e=0;return function(){var i=Oa(),o=Ia-(i-e);if(e=i,o>0){if(++r>=Ea)return arguments[0]}else r=0;return t.apply(void 0,arguments)}}var Xr=ka;function Pa(t){return function(){return t}}var Qr=Pa;var Fa=(function(){try{var t=k(Object,"defineProperty");return t({},"",{}),t}catch{}})(),Se=Fa;var Na=Se?function(t,r){return Se(t,"toString",{configurable:!0,enumerable:!1,value:Qr(r),writable:!0})}:ft,ei=Na;var Ra=Xr(ei),ti=Ra;function Ua(t,r){for(var e=-1,i=t==null?0:t.length;++e<i&&r(t[e],e,t)!==!1;);return t}var ri=Ua;var ja=9007199254740991,La=/^(?:0|[1-9]\d*)$/;function $a(t,r){var e=typeof t;return r=r??ja,!!r&&(e=="number"||e!="symbol"&&La.test(t))&&t>-1&&t%1==0&&t<r}var gt=$a;function Wa(t,r,e){r=="__proto__"&&Se?Se(t,r,{configurable:!0,enumerable:!0,value:e,writable:!0}):t[r]=e}var Ce=Wa;function Ba(t,r){return t===r||t!==t&&r!==r}var W=Ba;var Ha=Object.prototype,Ga=Ha.hasOwnProperty;function qa(t,r,e){var i=t[r];(!(Ga.call(t,r)&&W(i,e))||e===void 0&&!(r in t))&&Ce(t,r,e)}var mt=qa;function Ka(t,r,e,i){var o=!e;e||(e={});for(var n=-1,a=r.length;++n<a;){var s=r[n],l=i?i(e[s],t[s],s,e,t):void 0;l===void 0&&(l=t[s]),o?Ce(e,s,l):mt(e,s,l)}return e}var B=Ka;var ii=Math.max;function za(t,r,e){return r=ii(r===void 0?t.length-1:r,0),function(){for(var i=arguments,o=-1,n=ii(i.length-r,0),a=Array(n);++o<n;)a[o]=i[r+o];o=-1;for(var s=Array(r+1);++o<r;)s[o]=i[o];return s[r]=e(a),Yr(t,this,s)}}var oi=za;function Ja(t,r){return ti(oi(t,r,ft),t+"")}var ni=Ja;var Za=9007199254740991;function Ya(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Za}var vt=Ya;function Xa(t){return t!=null&&vt(t.length)&&!be(t)}var te=Xa;function Qa(t,r,e){if(!T(e))return!1;var i=typeof r;return(i=="number"?te(e)&>(r,e.length):i=="string"&&r in e)?W(e[r],t):!1}var ai=Qa;function es(t){return ni(function(r,e){var i=-1,o=e.length,n=o>1?e[o-1]:void 0,a=o>2?e[2]:void 0;for(n=t.length>3&&typeof n=="function"?(o--,n):void 0,a&&ai(e[0],e[1],a)&&(n=o<3?void 0:n,o=1),r=Object(r);++i<o;){var s=e[i];s&&t(r,s,i,n)}return r})}var si=es;var ts=Object.prototype;function rs(t){var r=t&&t.constructor,e=typeof r=="function"&&r.prototype||ts;return t===e}var _e=rs;function is(t,r){for(var e=-1,i=Array(t);++e<t;)i[e]=r(e);return i}var li=is;var os="[object Arguments]";function ns(t){return x(t)&&L(t)==os}var or=ns;var ui=Object.prototype,as=ui.hasOwnProperty,ss=ui.propertyIsEnumerable,ls=or((function(){return arguments})())?or:function(t){return x(t)&&as.call(t,"callee")&&!ss.call(t,"callee")},Be=ls;function us(){return!1}var ci=us;var pi=typeof exports=="object"&&exports&&!exports.nodeType&&exports,fi=pi&&typeof module=="object"&&module&&!module.nodeType&&module,cs=fi&&fi.exports===pi,di=cs?b.Buffer:void 0,fs=di?di.isBuffer:void 0,ds=fs||ci,z=ds;var ps="[object Arguments]",hs="[object Array]",gs="[object Boolean]",ms="[object Date]",vs="[object Error]",ys="[object Function]",bs="[object Map]",Ss="[object Number]",Cs="[object Object]",_s="[object RegExp]",xs="[object Set]",ws="[object String]",Ts="[object WeakMap]",As="[object ArrayBuffer]",Ds="[object DataView]",Vs="[object Float32Array]",Ms="[object Float64Array]",Es="[object Int8Array]",Is="[object Int16Array]",Os="[object Int32Array]",ks="[object Uint8Array]",Ps="[object Uint8ClampedArray]",Fs="[object Uint16Array]",Ns="[object Uint32Array]",g={};g[Vs]=g[Ms]=g[Es]=g[Is]=g[Os]=g[ks]=g[Ps]=g[Fs]=g[Ns]=!0;g[ps]=g[hs]=g[As]=g[gs]=g[Ds]=g[ms]=g[vs]=g[ys]=g[bs]=g[Ss]=g[Cs]=g[_s]=g[xs]=g[ws]=g[Ts]=!1;function Rs(t){return x(t)&&vt(t.length)&&!!g[L(t)]}var hi=Rs;function Us(t){return function(r){return t(r)}}var xe=Us;var gi=typeof exports=="object"&&exports&&!exports.nodeType&&exports,He=gi&&typeof module=="object"&&module&&!module.nodeType&&module,js=He&&He.exports===gi,nr=js&&ct.process,Ls=(function(){try{var t=He&&He.require&&He.require("util").types;return t||nr&&nr.binding&&nr.binding("util")}catch{}})(),J=Ls;var mi=J&&J.isTypedArray,$s=mi?xe(mi):hi,we=$s;var Ws=Object.prototype,Bs=Ws.hasOwnProperty;function Hs(t,r){var e=U(t),i=!e&&Be(t),o=!e&&!i&&z(t),n=!e&&!i&&!o&&we(t),a=e||i||o||n,s=a?li(t.length,String):[],l=s.length;for(var u in t)(r||Bs.call(t,u))&&!(a&&(u=="length"||o&&(u=="offset"||u=="parent")||n&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||gt(u,l)))&&s.push(u);return s}var yt=Hs;function Gs(t,r){return function(e){return t(r(e))}}var bt=Gs;var qs=bt(Object.keys,Object),vi=qs;var Ks=Object.prototype,zs=Ks.hasOwnProperty;function Js(t){if(!_e(t))return vi(t);var r=[];for(var e in Object(t))zs.call(t,e)&&e!="constructor"&&r.push(e);return r}var yi=Js;function Zs(t){return te(t)?yt(t):yi(t)}var Te=Zs;function Ys(t){var r=[];if(t!=null)for(var e in Object(t))r.push(e);return r}var bi=Ys;var Xs=Object.prototype,Qs=Xs.hasOwnProperty;function el(t){if(!T(t))return bi(t);var r=_e(t),e=[];for(var i in t)i=="constructor"&&(r||!Qs.call(t,i))||e.push(i);return e}var Si=el;function tl(t){return te(t)?yt(t,!0):Si(t)}var H=tl;var rl=k(Object,"create"),Z=rl;function il(){this.__data__=Z?Z(null):{},this.size=0}var Ci=il;function ol(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}var _i=ol;var nl="__lodash_hash_undefined__",al=Object.prototype,sl=al.hasOwnProperty;function ll(t){var r=this.__data__;if(Z){var e=r[t];return e===nl?void 0:e}return sl.call(r,t)?r[t]:void 0}var xi=ll;var ul=Object.prototype,cl=ul.hasOwnProperty;function fl(t){var r=this.__data__;return Z?r[t]!==void 0:cl.call(r,t)}var wi=fl;var dl="__lodash_hash_undefined__";function pl(t,r){var e=this.__data__;return this.size+=this.has(t)?0:1,e[t]=Z&&r===void 0?dl:r,this}var Ti=pl;function Ae(t){var r=-1,e=t==null?0:t.length;for(this.clear();++r<e;){var i=t[r];this.set(i[0],i[1])}}Ae.prototype.clear=Ci;Ae.prototype.delete=_i;Ae.prototype.get=xi;Ae.prototype.has=wi;Ae.prototype.set=Ti;var ar=Ae;function hl(){this.__data__=[],this.size=0}var Ai=hl;function gl(t,r){for(var e=t.length;e--;)if(W(t[e][0],r))return e;return-1}var re=gl;var ml=Array.prototype,vl=ml.splice;function yl(t){var r=this.__data__,e=re(r,t);if(e<0)return!1;var i=r.length-1;return e==i?r.pop():vl.call(r,e,1),--this.size,!0}var Di=yl;function bl(t){var r=this.__data__,e=re(r,t);return e<0?void 0:r[e][1]}var Vi=bl;function Sl(t){return re(this.__data__,t)>-1}var Mi=Sl;function Cl(t,r){var e=this.__data__,i=re(e,t);return i<0?(++this.size,e.push([t,r])):e[i][1]=r,this}var Ei=Cl;function De(t){var r=-1,e=t==null?0:t.length;for(this.clear();++r<e;){var i=t[r];this.set(i[0],i[1])}}De.prototype.clear=Ai;De.prototype.delete=Di;De.prototype.get=Vi;De.prototype.has=Mi;De.prototype.set=Ei;var ie=De;var _l=k(b,"Map"),oe=_l;function xl(){this.size=0,this.__data__={hash:new ar,map:new(oe||ie),string:new ar}}var Ii=xl;function wl(t){var r=typeof t;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?t!=="__proto__":t===null}var Oi=wl;function Tl(t,r){var e=t.__data__;return Oi(r)?e[typeof r=="string"?"string":"hash"]:e.map}var ne=Tl;function Al(t){var r=ne(this,t).delete(t);return this.size-=r?1:0,r}var ki=Al;function Dl(t){return ne(this,t).get(t)}var Pi=Dl;function Vl(t){return ne(this,t).has(t)}var Fi=Vl;function Ml(t,r){var e=ne(this,t),i=e.size;return e.set(t,r),this.size+=e.size==i?0:1,this}var Ni=Ml;function Ve(t){var r=-1,e=t==null?0:t.length;for(this.clear();++r<e;){var i=t[r];this.set(i[0],i[1])}}Ve.prototype.clear=Ii;Ve.prototype.delete=ki;Ve.prototype.get=Pi;Ve.prototype.has=Fi;Ve.prototype.set=Ni;var St=Ve;function El(t,r){for(var e=-1,i=r.length,o=t.length;++e<i;)t[o+e]=r[e];return t}var Ct=El;var Il=bt(Object.getPrototypeOf,Object),Me=Il;var Ol="[object Object]",kl=Function.prototype,Pl=Object.prototype,Ri=kl.toString,Fl=Pl.hasOwnProperty,Nl=Ri.call(Object);function Rl(t){if(!x(t)||L(t)!=Ol)return!1;var r=Me(t);if(r===null)return!0;var e=Fl.call(r,"constructor")&&r.constructor;return typeof e=="function"&&e instanceof e&&Ri.call(e)==Nl}var Ui=Rl;function Ul(){this.__data__=new ie,this.size=0}var ji=Ul;function jl(t){var r=this.__data__,e=r.delete(t);return this.size=r.size,e}var Li=jl;function Ll(t){return this.__data__.get(t)}var $i=Ll;function $l(t){return this.__data__.has(t)}var Wi=$l;var Wl=200;function Bl(t,r){var e=this.__data__;if(e instanceof ie){var i=e.__data__;if(!oe||i.length<Wl-1)return i.push([t,r]),this.size=++e.size,this;e=this.__data__=new St(i)}return e.set(t,r),this.size=e.size,this}var Bi=Bl;function Ee(t){var r=this.__data__=new ie(t);this.size=r.size}Ee.prototype.clear=ji;Ee.prototype.delete=Li;Ee.prototype.get=$i;Ee.prototype.has=Wi;Ee.prototype.set=Bi;var ae=Ee;function Hl(t,r){return t&&B(r,Te(r),t)}var Hi=Hl;function Gl(t,r){return t&&B(r,H(r),t)}var Gi=Gl;var Ji=typeof exports=="object"&&exports&&!exports.nodeType&&exports,qi=Ji&&typeof module=="object"&&module&&!module.nodeType&&module,ql=qi&&qi.exports===Ji,Ki=ql?b.Buffer:void 0,zi=Ki?Ki.allocUnsafe:void 0;function Kl(t,r){if(r)return t.slice();var e=t.length,i=zi?zi(e):new t.constructor(e);return t.copy(i),i}var _t=Kl;function zl(t,r){for(var e=-1,i=t==null?0:t.length,o=0,n=[];++e<i;){var a=t[e];r(a,e,t)&&(n[o++]=a)}return n}var Zi=zl;function Jl(){return[]}var xt=Jl;var Zl=Object.prototype,Yl=Zl.propertyIsEnumerable,Yi=Object.getOwnPropertySymbols,Xl=Yi?function(t){return t==null?[]:(t=Object(t),Zi(Yi(t),function(r){return Yl.call(t,r)}))}:xt,Ie=Xl;function Ql(t,r){return B(t,Ie(t),r)}var Xi=Ql;var eu=Object.getOwnPropertySymbols,tu=eu?function(t){for(var r=[];t;)Ct(r,Ie(t)),t=Me(t);return r}:xt,wt=tu;function ru(t,r){return B(t,wt(t),r)}var Qi=ru;function iu(t,r,e){var i=r(t);return U(t)?i:Ct(i,e(t))}var Tt=iu;function ou(t){return Tt(t,Te,Ie)}var Ge=ou;function nu(t){return Tt(t,H,wt)}var eo=nu;var au=k(b,"DataView"),At=au;var su=k(b,"Promise"),Dt=su;var lu=k(b,"Set"),Vt=lu;var to="[object Map]",uu="[object Object]",ro="[object Promise]",io="[object Set]",oo="[object WeakMap]",no="[object DataView]",cu=K(At),fu=K(oe),du=K(Dt),pu=K(Vt),hu=K(pt),fe=L;(At&&fe(new At(new ArrayBuffer(1)))!=no||oe&&fe(new oe)!=to||Dt&&fe(Dt.resolve())!=ro||Vt&&fe(new Vt)!=io||pt&&fe(new pt)!=oo)&&(fe=function(t){var r=L(t),e=r==uu?t.constructor:void 0,i=e?K(e):"";if(i)switch(i){case cu:return no;case fu:return to;case du:return ro;case pu:return io;case hu:return oo}return r});var Y=fe;var gu=Object.prototype,mu=gu.hasOwnProperty;function vu(t){var r=t.length,e=new t.constructor(r);return r&&typeof t[0]=="string"&&mu.call(t,"index")&&(e.index=t.index,e.input=t.input),e}var ao=vu;var yu=b.Uint8Array,Oe=yu;function bu(t){var r=new t.constructor(t.byteLength);return new Oe(r).set(new Oe(t)),r}var ke=bu;function Su(t,r){var e=r?ke(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.byteLength)}var so=Su;var Cu=/\w*$/;function _u(t){var r=new t.constructor(t.source,Cu.exec(t));return r.lastIndex=t.lastIndex,r}var lo=_u;var uo=R?R.prototype:void 0,co=uo?uo.valueOf:void 0;function xu(t){return co?Object(co.call(t)):{}}var fo=xu;function wu(t,r){var e=r?ke(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.length)}var Mt=wu;var Tu="[object Boolean]",Au="[object Date]",Du="[object Map]",Vu="[object Number]",Mu="[object RegExp]",Eu="[object Set]",Iu="[object String]",Ou="[object Symbol]",ku="[object ArrayBuffer]",Pu="[object DataView]",Fu="[object Float32Array]",Nu="[object Float64Array]",Ru="[object Int8Array]",Uu="[object Int16Array]",ju="[object Int32Array]",Lu="[object Uint8Array]",$u="[object Uint8ClampedArray]",Wu="[object Uint16Array]",Bu="[object Uint32Array]";function Hu(t,r,e){var i=t.constructor;switch(r){case ku:return ke(t);case Tu:case Au:return new i(+t);case Pu:return so(t,e);case Fu:case Nu:case Ru:case Uu:case ju:case Lu:case $u:case Wu:case Bu:return Mt(t,e);case Du:return new i;case Vu:case Iu:return new i(t);case Mu:return lo(t);case Eu:return new i;case Ou:return fo(t)}}var po=Hu;function Gu(t){return typeof t.constructor=="function"&&!_e(t)?Zr(Me(t)):{}}var Et=Gu;var qu="[object Map]";function Ku(t){return x(t)&&Y(t)==qu}var ho=Ku;var go=J&&J.isMap,zu=go?xe(go):ho,mo=zu;var Ju="[object Set]";function Zu(t){return x(t)&&Y(t)==Ju}var vo=Zu;var yo=J&&J.isSet,Yu=yo?xe(yo):vo,bo=Yu;var Xu=1,Qu=2,ec=4,So="[object Arguments]",tc="[object Array]",rc="[object Boolean]",ic="[object Date]",oc="[object Error]",Co="[object Function]",nc="[object GeneratorFunction]",ac="[object Map]",sc="[object Number]",_o="[object Object]",lc="[object RegExp]",uc="[object Set]",cc="[object String]",fc="[object Symbol]",dc="[object WeakMap]",pc="[object ArrayBuffer]",hc="[object DataView]",gc="[object Float32Array]",mc="[object Float64Array]",vc="[object Int8Array]",yc="[object Int16Array]",bc="[object Int32Array]",Sc="[object Uint8Array]",Cc="[object Uint8ClampedArray]",_c="[object Uint16Array]",xc="[object Uint32Array]",h={};h[So]=h[tc]=h[pc]=h[hc]=h[rc]=h[ic]=h[gc]=h[mc]=h[vc]=h[yc]=h[bc]=h[ac]=h[sc]=h[_o]=h[lc]=h[uc]=h[cc]=h[fc]=h[Sc]=h[Cc]=h[_c]=h[xc]=!0;h[oc]=h[Co]=h[dc]=!1;function It(t,r,e,i,o,n){var a,s=r&Xu,l=r&Qu,u=r&ec;if(e&&(a=o?e(t,i,o,n):e(t)),a!==void 0)return a;if(!T(t))return t;var d=U(t);if(d){if(a=ao(t),!s)return ht(t,a)}else{var p=Y(t),m=p==Co||p==nc;if(z(t))return _t(t,s);if(p==_o||p==So||m&&!o){if(a=l||m?{}:Et(t),!s)return l?Qi(t,Gi(a,t)):Xi(t,Hi(a,t))}else{if(!h[p])return o?t:{};a=po(t,p,s)}}n||(n=new ae);var w=n.get(t);if(w)return w;n.set(t,a),bo(t)?t.forEach(function(_){a.add(It(_,r,e,_,t,n))}):mo(t)&&t.forEach(function(_,A){a.set(A,It(_,r,e,A,t,n))});var C=u?l?eo:Ge:l?H:Te,M=d?void 0:C(t);return ri(M||t,function(_,A){M&&(A=_,_=t[A]),mt(a,A,It(_,r,e,A,t,n))}),a}var xo=It;var wc=1,Tc=4;function Ac(t){return xo(t,wc|Tc)}var sr=Ac;var Dc="__lodash_hash_undefined__";function Vc(t){return this.__data__.set(t,Dc),this}var wo=Vc;function Mc(t){return this.__data__.has(t)}var To=Mc;function Ot(t){var r=-1,e=t==null?0:t.length;for(this.__data__=new St;++r<e;)this.add(t[r])}Ot.prototype.add=Ot.prototype.push=wo;Ot.prototype.has=To;var Ao=Ot;function Ec(t,r){for(var e=-1,i=t==null?0:t.length;++e<i;)if(r(t[e],e,t))return!0;return!1}var Do=Ec;function Ic(t,r){return t.has(r)}var Vo=Ic;var Oc=1,kc=2;function Pc(t,r,e,i,o,n){var a=e&Oc,s=t.length,l=r.length;if(s!=l&&!(a&&l>s))return!1;var u=n.get(t),d=n.get(r);if(u&&d)return u==r&&d==t;var p=-1,m=!0,w=e&kc?new Ao:void 0;for(n.set(t,r),n.set(r,t);++p<s;){var C=t[p],M=r[p];if(i)var _=a?i(M,C,p,r,t,n):i(C,M,p,t,r,n);if(_!==void 0){if(_)continue;m=!1;break}if(w){if(!Do(r,function(A,ue){if(!Vo(w,ue)&&(C===A||o(C,A,e,i,n)))return w.push(ue)})){m=!1;break}}else if(!(C===M||o(C,M,e,i,n))){m=!1;break}}return n.delete(t),n.delete(r),m}var kt=Pc;function Fc(t){var r=-1,e=Array(t.size);return t.forEach(function(i,o){e[++r]=[o,i]}),e}var Mo=Fc;function Nc(t){var r=-1,e=Array(t.size);return t.forEach(function(i){e[++r]=i}),e}var Eo=Nc;var Rc=1,Uc=2,jc="[object Boolean]",Lc="[object Date]",$c="[object Error]",Wc="[object Map]",Bc="[object Number]",Hc="[object RegExp]",Gc="[object Set]",qc="[object String]",Kc="[object Symbol]",zc="[object ArrayBuffer]",Jc="[object DataView]",Io=R?R.prototype:void 0,lr=Io?Io.valueOf:void 0;function Zc(t,r,e,i,o,n,a){switch(e){case Jc:if(t.byteLength!=r.byteLength||t.byteOffset!=r.byteOffset)return!1;t=t.buffer,r=r.buffer;case zc:return!(t.byteLength!=r.byteLength||!n(new Oe(t),new Oe(r)));case jc:case Lc:case Bc:return W(+t,+r);case $c:return t.name==r.name&&t.message==r.message;case Hc:case qc:return t==r+"";case Wc:var s=Mo;case Gc:var l=i&Rc;if(s||(s=Eo),t.size!=r.size&&!l)return!1;var u=a.get(t);if(u)return u==r;i|=Uc,a.set(t,r);var d=kt(s(t),s(r),i,o,n,a);return a.delete(t),d;case Kc:if(lr)return lr.call(t)==lr.call(r)}return!1}var Oo=Zc;var Yc=1,Xc=Object.prototype,Qc=Xc.hasOwnProperty;function ef(t,r,e,i,o,n){var a=e&Yc,s=Ge(t),l=s.length,u=Ge(r),d=u.length;if(l!=d&&!a)return!1;for(var p=l;p--;){var m=s[p];if(!(a?m in r:Qc.call(r,m)))return!1}var w=n.get(t),C=n.get(r);if(w&&C)return w==r&&C==t;var M=!0;n.set(t,r),n.set(r,t);for(var _=a;++p<l;){m=s[p];var A=t[m],ue=r[m];if(i)var Mr=a?i(ue,A,m,r,t,n):i(A,ue,m,t,r,n);if(!(Mr===void 0?A===ue||o(A,ue,e,i,n):Mr)){M=!1;break}_||(_=m=="constructor")}if(M&&!_){var rt=t.constructor,it=r.constructor;rt!=it&&"constructor"in t&&"constructor"in r&&!(typeof rt=="function"&&rt instanceof rt&&typeof it=="function"&&it instanceof it)&&(M=!1)}return n.delete(t),n.delete(r),M}var ko=ef;var tf=1,Po="[object Arguments]",Fo="[object Array]",Pt="[object Object]",rf=Object.prototype,No=rf.hasOwnProperty;function of(t,r,e,i,o,n){var a=U(t),s=U(r),l=a?Fo:Y(t),u=s?Fo:Y(r);l=l==Po?Pt:l,u=u==Po?Pt:u;var d=l==Pt,p=u==Pt,m=l==u;if(m&&z(t)){if(!z(r))return!1;a=!0,d=!1}if(m&&!d)return n||(n=new ae),a||we(t)?kt(t,r,e,i,o,n):Oo(t,r,l,e,i,o,n);if(!(e&tf)){var w=d&&No.call(t,"__wrapped__"),C=p&&No.call(r,"__wrapped__");if(w||C){var M=w?t.value():t,_=C?r.value():r;return n||(n=new ae),o(M,_,e,i,n)}}return m?(n||(n=new ae),ko(t,r,e,i,o,n)):!1}var Ro=of;function Uo(t,r,e,i,o){return t===r?!0:t==null||r==null||!x(t)&&!x(r)?t!==t&&r!==r:Ro(t,r,e,i,Uo,o)}var jo=Uo;function nf(t){return function(r,e,i){for(var o=-1,n=Object(r),a=i(r),s=a.length;s--;){var l=a[t?s:++o];if(e(n[l],l,n)===!1)break}return r}}var Lo=nf;var af=Lo(),$o=af;function sf(t,r,e){(e!==void 0&&!W(t[r],e)||e===void 0&&!(r in t))&&Ce(t,r,e)}var qe=sf;function lf(t){return x(t)&&te(t)}var Wo=lf;function uf(t,r){if(!(r==="constructor"&&typeof t[r]=="function")&&r!="__proto__")return t[r]}var Ke=uf;function cf(t){return B(t,H(t))}var Bo=cf;function ff(t,r,e,i,o,n,a){var s=Ke(t,e),l=Ke(r,e),u=a.get(l);if(u){qe(t,e,u);return}var d=n?n(s,l,e+"",t,r,a):void 0,p=d===void 0;if(p){var m=U(l),w=!m&&z(l),C=!m&&!w&&we(l);d=l,m||w||C?U(s)?d=s:Wo(s)?d=ht(s):w?(p=!1,d=_t(l,!0)):C?(p=!1,d=Mt(l,!0)):d=[]:Ui(l)||Be(l)?(d=s,Be(s)?d=Bo(s):(!T(s)||be(s))&&(d=Et(l))):p=!1}p&&(a.set(l,d),o(d,l,i,n,a),a.delete(l)),qe(t,e,d)}var Ho=ff;function Go(t,r,e,i,o){t!==r&&$o(r,function(n,a){if(o||(o=new ae),T(n))Ho(t,r,a,e,Go,i,o);else{var s=i?i(Ke(t,a),n,a+"",t,r,o):void 0;s===void 0&&(s=n),qe(t,a,s)}},H)}var qo=Go;function df(t,r){return jo(t,r)}var pf=df;var hf=si(function(t,r,e){qo(t,r,e)}),gf=hf;var mf=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,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},Ko=t=>t==="*"||t==="x"||t==="X",zo=t=>{let r=parseInt(t,10);return isNaN(r)?t:r},vf=(t,r)=>typeof t!=typeof r?[String(t),String(r)]:[t,r],yf=(t,r)=>{if(Ko(t)||Ko(r))return 0;let[e,i]=vf(zo(t),zo(r));return e>i?1:e<i?-1:0},cr=(t,r)=>{for(let e=0;e<Math.max(t.length,r.length);e++){let i=yf(t[e]||"0",r[e]||"0");if(i!==0)return i}return 0};var Jo=(t,r)=>{let e=ur(t),i=ur(r),o=e.pop(),n=i.pop(),a=cr(e,i);return a!==0?a:o&&n?cr(o.split("."),n.split(".")):o||n?o?-1:1:0};var fr=(t,r,e)=>{bf(e);let i=Jo(t,r);return Yo[e].includes(i)},Yo={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Zo=Object.keys(Yo),bf=t=>{if(typeof t!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof t}`);if(Zo.indexOf(t)===-1)throw new Error(`Invalid operator, expected one of ${Zo.join("|")}`)};var Xo=(()=>{class t{server=F(ut);http=F(ve);_auth=F(Lr);serverEndpoint=null;isAppDataSupported=!1;configFileVersion=null;sharedConfigName;InitConfig=null;storageServiceReady$=new v(!1);_isLoggedIn=!1;_networkStatus=void 0;_logIO=!1;patchQueue$=new ot;patch=function(e){return this.http.post(e.url,e.document).pipe(Fr(()=>console.log("[Storage Service] Remote config patch request completed successfully")),he(i=>this.handleError(i)))};constructor(){let e=this.server;this._auth.isLoggedIn$.pipe($e()).subscribe(i=>{this._isLoggedIn=i,this.isStorageServiceReady()}),e.serverServiceEndpoint$.pipe($e()).subscribe(i=>{this._networkStatus=i,this.isStorageServiceReady()}),e.serverVersion$.pipe($e()).subscribe(i=>{i&&(this.isAppDataSupported=fr(i,"1.27.0",">="))}),this.patchQueue$.pipe(kr(i=>this.patch(i)),$e()).subscribe(()=>{})}isStorageServiceReady(){this._networkStatus?.httpServiceUrl&&(this.serverEndpoint=this._networkStatus.httpServiceUrl.substring(0,this._networkStatus.httpServiceUrl.length-4)+"applicationData/"),this._networkStatus?.operation===2&&this._isLoggedIn&&this.serverEndpoint?(this.storageServiceReady$.next(!0),console.log(`[Remote Storage Service] Authenticated ${this._isLoggedIn} ,AppData API: ${this.serverEndpoint}`)):this.storageServiceReady$.next(!1)}ensureReady(){if(!this.storageServiceReady$.getValue())throw new Error("[StorageService] Not ready: storageServiceReady is false")}listConfigs(e){return E(this,null,function*(){this.ensureReady();let i=[];if(!this.serverEndpoint)return console.warn("[Storage Service] No server endpoint set. Cannot retrieve config list"),null;let o=this.serverEndpoint,n=e??this.configFileVersion,a=`${o}global/kip/${n}/?keys=true`,s=`${o}user/kip/${n}/?keys=true`;try{let l=yield N(this.http.get(a));for(let u of l)i.push({scope:"global",name:u});console.log("[Storage Service] Retrieved Global config list")}catch(l){this.handleError(l)}try{let l=yield N(this.http.get(s));for(let u of l)i.push({scope:"user",name:u});console.log("[Storage Service] Retrieved User config list")}catch(l){this.handleError(l)}return i})}getConfig(e,i,o,n){return E(this,null,function*(){this.ensureReady();let a=this.serverEndpoint+e+"/kip/",s=o??this.configFileVersion,l=a+s+"/"+i;this._logIO&&console.debug("[StorageService.getConfig]",{scope:e,configName:i,ver:s,url:l,isInitLoad:!!n});try{let u=yield N(this.http.get(l));if(this._logIO){let d=u&&typeof u=="object"?u?.app?.configVersion:void 0;console.debug("[StorageService.getConfig Response]",{scope:e,configName:i,ver:s,appConfigVersion:d})}else console.log(`[Storage Service] Retrieved config [${i}] from [${e}] scope`);return n&&(this.InitConfig=u),sr(u)}catch(u){return this.handleError(u),null}})}setConfig(e,i,o,n){return E(this,null,function*(){this.ensureReady();let a=this.serverEndpoint+e+"/kip/",s=n??this.configFileVersion,l=a+s+"/"+i;if(this._logIO){let u=o?.app?.configVersion;console.debug("[StorageService.setConfig]",{scope:e,configName:i,ver:s,url:l,appConfigVersion:u})}try{return yield N(this.http.post(l,o)),this._logIO?console.debug("[StorageService.setConfig Response]",{scope:e,configName:i,ver:s,url:l,status:"ok"}):console.log(`[Storage Service] Saved config [${i}] to [${e}] scope`),null}catch(u){return this.handleError(u),null}})}patchConfig(e,i,o){this.ensureReady();let n=o??this.configFileVersion,a=this.serverEndpoint+"user/kip/"+n,s,l=i?.configVersion;switch(this._logIO&&console.warn("[StorageService.patchConfig] Suppressing app.configVersion write into v11 file",{targetFileVersion:n,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 u={url:a,document:s};if(this._logIO){let d=e==="IAppConfig"?i?.configVersion:void 0;console.debug("[StorageService.patchConfig]",{ObjType:e,ver:n,url:a,appConfigVersionInValue:d,touchesConfigVersion:e==="IAppConfig"&&typeof d<"u"})}this.patchQueue$.next(u)}patchGlobal(e,i,o,n,a){this.ensureReady();let s=a??this.configFileVersion,l=this.serverEndpoint+i+"/kip/"+s,u;switch(n){case"add":u=[{op:"add",path:`/${e}`,value:o}];break;case"replace":u=[{op:"replace",path:`/${e}`,value:o}];break;case"remove":u=[{op:"remove",path:`/${e}`,value:o}];break;default:console.warn("[Storage Service] JSON Patch operation request type unknown");break}let d={url:l,document:u};if(this._logIO){let p=o?.app?.configVersion;console.debug("[StorageService.patchGlobal]",{scope:i,configName:e,operation:n,ver:s,url:l,appConfigVersionInValue:p})}this.patchQueue$.next(d)}removeItem(e,i,o){this.ensureReady();let n=this.serverEndpoint+e+"/kip/"+this.configFileVersion;o&&(n=this.serverEndpoint+e+"/kip/"+o);let a=[{op:"remove",path:`/${i}`}],s={url:n,document:a};this.patchQueue$.next(s)}clear(){this.ensureReady()}set activeConfigFileVersion(e){this.configFileVersion=e}handleError(e){throw e.status===0?console.error("[Storage Service] An error occurred:",e.error):console.error("[Storage Service] Backend returned error: ",e.message),e}get initConfig(){return this.InitConfig}static \u0275fac=function(i){return new(i||t)};static \u0275prov=D({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var se=class{static create(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(r){let e=Math.random()*16|0;return(r=="x"?e:e&3|8).toString(16)})}};var ze={disableNotifications:!1,menuGrouping:!0,security:{disableSecurity:!0},devices:{disableDevices:!1,showNormalState:!1,showNominalState:!1},sound:{disableSound:!1,muteNormal:!0,muteNominal:!0,muteWarn:!0,muteAlert:!1,muteAlarm:!1,muteEmergency:!1}};var Ft={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:Ft,notificationConfig:ze,splitShellEnabled:!0,splitShellSide:"left",splitShellSwipeDisabled:!1,splitShellWidth:.5},en={themeName:""};var tn={configVersion:12,kipUUID:se.create(),signalKUrl:null,proxyEnabled:!1,signalKSubscribeAll:!1,useDeviceToken:!1,loginName:null,loginPassword:null,useSharedConfig:!1,sharedConfigName:"default"};var dr={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}}},pr=[{id:"3e0825ee-95fd-4ad4-8802-e0507845b668",name:"Sailing",icon:"dashboard-sailing",configuration:[{w:6,h:8,id:"339698a7-2cff-4ab9-9b50-d8056f971471",selector:"widget-host2",input:{widgetProperties:{type:"widget-numeric",uuid:"339698a7-2cff-4ab9-9b50-d8056f971471",config:{displayName:"Depth",filterSelfPaths:!0,paths:{numericPath:{description:"Numeric Data",path:"self.environment.depth.belowTransducer",source:"default",pathType:"number",isPathConfigurable:!0,convertUnitTo:"m",showPathSkUnitsFilter:!0,pathSkUnitsFilter:null,sampleTime:500}},showMax:!1,showMin:!1,numDecimal:1,showMiniChart:!0,yScaleMin:0,yScaleMax:100,inverseYAxis:!1,verticalChart:!1,color:"blue",enableTimeout:!1,dataTimeout:5,ignoreZones:!1}}},x:0,y:0},{w:10,h:20,id:"a44028e0-dfee-4492-895b-2b03a60f3a69",selector:"widget-host2",input:{widgetProperties:{type:"widget-wind-steer",uuid:"a44028e0-dfee-4492-895b-2b03a60f3a69",config:{filterSelfPaths:!0,paths:{headingPath:{description:"True Heading",path:"self.navigation.headingTrue",source:"default",pathType:"number",isPathConfigurable:!0,pathRequired:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",convertUnitTo:"deg",showConvertUnitTo:!1,sampleTime:500},appWindAngle:{description:"Apparent Wind Angle",path:"self.environment.wind.angleApparent",source:"default",pathType:"number",isPathConfigurable:!0,pathRequired:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",convertUnitTo:"deg",showConvertUnitTo:!1,sampleTime:500},appWindSpeed:{description:"Apparent Wind Speed",path:"self.environment.wind.speedApparent",source:"default",pathType:"number",isPathConfigurable:!0,pathRequired:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"m/s",convertUnitTo:"knots",sampleTime:500},trueWindAngle:{description:"True Wind Angle",path:"self.environment.wind.angleTrueWater",source:"default",pathType:"number",isPathConfigurable:!0,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",convertUnitTo:"deg",showConvertUnitTo:!1,sampleTime:500},trueWindSpeed:{description:"True Wind Speed",path:"self.environment.wind.speedTrue",source:"default",pathType:"number",isPathConfigurable:!0,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"m/s",convertUnitTo:"knots",sampleTime:500},courseOverGround:{description:"True Course Over Ground",path:"self.navigation.courseOverGroundTrue",source:"default",pathType:"number",isPathConfigurable:!0,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",showConvertUnitTo:!1,convertUnitTo:"deg",sampleTime:500},nextWaypointBearing:{description:"Next Waypoint True Bearing",path:"self.navigation.courseGreatCircle.nextPoint.bearingTrue",source:"default",pathType:"number",isPathConfigurable:!1,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",convertUnitTo:"deg",showConvertUnitTo:!1,sampleTime:500},set:{description:"True Drift Set",path:"self.environment.current.setTrue",source:"default",pathType:"number",isPathConfigurable:!0,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",convertUnitTo:"deg",showConvertUnitTo:!1,sampleTime:500},drift:{description:"Drift Speed Impact",path:"self.environment.current.drift",source:"default",pathType:"number",isPathConfigurable:!0,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"m/s",convertUnitTo:"knots",sampleTime:500}},windSectorEnable:!0,windSectorWindowSeconds:5,laylineEnable:!0,laylineAngle:40,waypointEnable:!0,courseOverGroundEnable:!0,driftEnable:!0,awsEnable:!0,twsEnable:!0,twaEnable:!0,sailSetupEnable:!1,enableTimeout:!1,dataTimeout:5}}},x:6,y:0},{w:8,h:12,id:"24406c15-7738-4dc1-a206-7a4862c2931d",selector:"widget-host2",input:{widgetProperties:{type:"widget-gauge-ng-radial",uuid:"24406c15-7738-4dc1-a206-7a4862c2931d",config:{displayName:"SOG",filterSelfPaths:!0,paths:{gaugePath:{description:"Numeric Data",path:"self.navigation.speedOverGround",source:"default",pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!0,pathSkUnitsFilter:null,convertUnitTo:"knots",sampleTime:500}},displayScale:{lower:0,upper:10,type:"linear"},gauge:{type:"ngRadial",subType:"measuring",enableTicks:!0,enableNeedle:!0,enableProgressbar:!0,highlightsWidth:5,scaleStart:180,barStartPosition:"left"},numInt:1,numDecimal:1,enableTimeout:!1,color:"yellow",dataTimeout:5,ignoreZones:!1}}},x:16,y:0},{w:6,h:8,id:"c6bcaa53-afa1-42c7-ad92-d5f7dba14734",selector:"widget-host2",input:{widgetProperties:{type:"widget-numeric",uuid:"c6bcaa53-afa1-42c7-ad92-d5f7dba14734",config:{displayName:"STW",filterSelfPaths:!0,paths:{numericPath:{description:"Numeric Data",path:"self.navigation.speedThroughWater",source:"default",pathType:"number",isPathConfigurable:!0,convertUnitTo:"knots",showPathSkUnitsFilter:!0,pathSkUnitsFilter:null,sampleTime:500}},showMax:!0,showMin:!0,numDecimal:1,showMiniChart:!1,yScaleMin:0,yScaleMax:10,inverseYAxis:!1,verticalChart:!1,color:"contrast",enableTimeout:!1,dataTimeout:5,ignoreZones:!1}}},x:0,y:8},{w:8,h:12,id:"973c8804-be09-4923-bb5d-48c13b65db69",selector:"widget-host2",input:{widgetProperties:{type:"widget-data-chart",uuid:"973c8804-be09-4923-bb5d-48c13b65db69",config:{displayName:"Chart Label",filterSelfPaths:!0,datachartPath:"self.environment.wind.speedApparent",datachartSource:"default",period:1,timeScale:"minute",convertUnitTo:"knots",timeScaleFormat:"minute",inverseYAxis:!1,datasetAverageArray:"sma",showAverageData:!0,trackAgainstAverage:!1,showDatasetMinimumValueLine:!1,showDatasetMaximumValueLine:!1,showDatasetAverageValueLine:!0,showDatasetAngleAverageValueLine:!1,showLabel:!1,showTimeScale:!0,startScaleAtZero:!1,verticalChart:!1,showYScale:!0,yScaleSuggestedMin:null,yScaleSuggestedMax:null,enableMinMaxScaleLimit:!1,yScaleMin:null,yScaleMax:null,numDecimal:1,color:"orange",invertData:!1,verticalGraph:!1}}},x:16,y:12},{x:0,y:16,w:6,h:8,minW:1,minH:1,id:"5289a84d-18fd-4ee7-9724-72249af403f2",selector:"widget-host2",input:{widgetProperties:{type:"widget-position",uuid:"5289a84d-18fd-4ee7-9724-72249af403f2",config:{displayName:"Position",filterSelfPaths:!0,paths:{longPath:{description:"Longitude",path:"self.navigation.position.longitude",source:"default",pathType:"number",isPathConfigurable:!0,convertUnitTo:"longitudeMin",showPathSkUnitsFilter:!0,pathSkUnitsFilter:null,sampleTime:500},latPath:{description:"Latitude",path:"self.navigation.position.latitude",source:"default",pathType:"number",isPathConfigurable:!0,convertUnitTo:"latitudeMin",showPathSkUnitsFilter:!0,pathSkUnitsFilter:null,sampleTime:500}},color:"grey",enableTimeout:!1,dataTimeout:5}}}},{w:10,h:4,id:"1a7a3f79-2eb4-4092-a0c3-9a61db8a8586",selector:"widget-host2",input:{widgetProperties:{type:"widget-simple-linear",uuid:"1a7a3f79-2eb4-4092-a0c3-9a61db8a8586",config:{displayName:"House Bank",filterSelfPaths:!0,paths:{gaugePath:{description:"Numeric Data",path:"self.electrical.batteries.1.voltage",source:"default",pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!0,pathSkUnitsFilter:"V",convertUnitTo:"V",sampleTime:500}},displayScale:{lower:0,upper:15,type:"linear"},gauge:{type:"simpleLinear",unitLabelFormat:"full"},numInt:1,numDecimal:2,ignoreZones:!1,color:"green",enableTimeout:!1,dataTimeout:5}}},x:6,y:20}],collapseSplitShell:!0},{id:"7c67c8c5-dc55-4e1d-9fc5-3dd95fd41bea",name:"Charting",icon:"dashboard-map",configuration:[{x:0,y:0,w:12,h:6,id:"26a2a150-5af8-4f1d-aaab-0cb2a406fc17",selector:"widget-host2",input:{widgetProperties:{type:"widget-gauge-ng-compass",uuid:"26a2a150-5af8-4f1d-aaab-0cb2a406fc17",config:{displayName:"COG (T)",filterSelfPaths:!0,paths:{gaugePath:{description:"Numeric Data",path:"self.navigation.courseOverGroundTrue",source:"default",pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",showConvertUnitTo:!1,convertUnitTo:"deg",sampleTime:500}},gauge:{type:"ngRadial",subType:"marineCompass",enableTicks:!0,compassUseNumbers:!0,showValueBox:!1},enableTimeout:!1,color:"purple",dataTimeout:5}}}},{x:12,y:0,w:12,h:6,id:"caf9ca47-fcf6-4736-a314-2b5210edaf03",selector:"widget-host2",input:{widgetProperties:{type:"widget-datetime",uuid:"caf9ca47-fcf6-4736-a314-2b5210edaf03",config:{displayName:"Next WP Arrival",filterSelfPaths:!0,paths:{gaugePath:{description:"String Data",path:"self.navigation.datetime",source:"default",pathType:"Date",isPathConfigurable:!0,sampleTime:500}},dateFormat:"dd/MM HH:mm",dateTimezone:"America/Toronto",color:"contrast",enableTimeout:!1,dataTimeout:5}}}},{x:0,y:6,w:24,h:18,id:"daa21350-009e-4d99-8209-364f9b99caee",selector:"widget-host2",input:{widgetProperties:{type:"widget-autopilot",uuid:"daa21350-009e-4d99-8209-364f9b99caee",config:{filterSelfPaths:!0,paths:{autopilotState:{description:"Autopilot State",path:"self.steering.autopilot.state",source:"default",pathType:"string",isPathConfigurable:!1,showPathSkUnitsFilter:!1,convertUnitTo:"",sampleTime:500},autopilotMode:{description:"Autopilot Mode",path:"self.steering.autopilot.mode",source:"default",pathType:"string",isPathConfigurable:!1,showPathSkUnitsFilter:!1,convertUnitTo:"",sampleTime:500},autopilotEngaged:{description:"Autopilot Engaged",path:"self.steering.autopilot.engaged",source:"default",pathType:"boolean",isPathConfigurable:!1,showPathSkUnitsFilter:!1,convertUnitTo:"",sampleTime:500},autopilotV2Target:{description:"Autopilot API v2 Target",path:"self.steering.autopilot.target",source:"default",pathType:"number",convertUnitTo:"deg",isPathConfigurable:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",sampleTime:500},autopilotTargetHeading:{description:"Autopilot Target Magnetic Heading",path:"self.steering.autopilot.target.headingMagnetic",source:"default",pathType:"number",convertUnitTo:"deg",isPathConfigurable:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",sampleTime:500},autopilotTargetWindHeading:{description:"Autopilot Target Apparent Wind Angle",path:"self.steering.autopilot.target.windAngleApparent",source:"default",pathType:"number",convertUnitTo:"deg",isPathConfigurable:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",sampleTime:500},rudderAngle:{description:"Rudder Angle",path:"self.steering.rudderAngle",source:"default",pathType:"number",convertUnitTo:"deg",isPathConfigurable:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",sampleTime:500},courseXte:{description:"Cross Track Error",path:"self.navigation.course.calcValues.crossTrackError",source:"default",pathType:"number",isPathConfigurable:!1,convertUnitTo:"m",showPathSkUnitsFilter:!0,pathRequired:!1,pathSkUnitsFilter:"m",sampleTime:500},headingMag:{description:"Magnetic Heading",path:"self.navigation.headingMagnetic",source:"default",pathType:"number",convertUnitTo:"deg",isPathConfigurable:!0,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",showConvertUnitTo:!1,sampleTime:500},headingTrue:{description:"True Heading",path:"self.navigation.headingTrue",source:"default",pathType:"number",convertUnitTo:"deg",isPathConfigurable:!0,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",showConvertUnitTo:!1,sampleTime:500},windAngleApparent:{description:"Apparent Wind Angle",path:"self.environment.wind.angleApparent",source:"default",pathType:"number",convertUnitTo:"deg",isPathConfigurable:!0,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",showConvertUnitTo:!1,sampleTime:500},windAngleTrueWater:{description:"Wind Angle True Water",path:"self.environment.wind.angleTrueWater",source:"default",pathType:"number",convertUnitTo:"deg",isPathConfigurable:!0,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",showConvertUnitTo:!1,sampleTime:500}},autopilot:{invertRudder:!0,headingDirectionTrue:!1,courseDirectionTrue:!1,apiVersion:null,instanceId:null,pluginId:null,modes:null},enableTimeout:!1,dataTimeout:5,invertRudder:!0,headingDirectionTrue:!1,courseDirectionTrue:!1,autopilotInstance:"_default"}}}}]}],hr={themeName:""};var DS={configVersion:12,kipUUID:se.create(),signalKUrl:"https://demo.signalk.org",proxyEnabled:!1,signalKSubscribeAll:!1,useDeviceToken:!1,loginName:null,loginPassword:null,useSharedConfig:!1,sharedConfigName:"default"};var Sf="",Cf=11,gr=12,US=(()=>{class t{storage=F(Xo);unitDefaults=new v({});themeName=new v(Sf);kipKNotificationConfig=new v(ze);autoNightMode=new v(!1);redNightMode=new v(!1);nightModeBrightness=new v(1);isRemoteControl=new v(!1);instanceName=new v("");splitShellEnabled=new v(!1);splitShellSide=new v("left");splitShellSwipeDisabled=new v(!1);splitShellWidth=new v(.5);proxyEnabled=!1;signalKSubscribeAll=!1;useDeviceToken=!1;loginName;loginPassword;useSharedConfig;sharedConfigName;activeConfig={app:null,theme:null,dashboards:null};kipUUID;signalkUrl;widgets;_dashboards=[];dataSets=[];configUpgrade=Q(!1);configVersion=void 0;constructor(){console.log("[AppSettings Service] Service startup..."),this.storage.activeConfigFileVersion=Cf,window.localStorage?(this.loadConnectionConfig(),this.startup()):console.error(`[AppSettings Service] LocalStorage NOT SUPPORTED by browser
|
|
2
|
+
This is a requirement to run Kip. See browser documentation to enable this feature.`)}startup(){return E(this,null,function*(){if(this.useSharedConfig){let e=!!this.loginName&&!!this.loginPassword&&!!this.signalkUrl?.url;if(this.storage.initConfig===null&&e){try{(yield this.checkConfigFileVersionUpgradeRequired())?this.configUpgrade.set(!0):this.resetSettings()}catch(i){console.error("[AppSettings Service] Startup check failed:",i)}return}console.log("[AppSettings Service] Remote configuration storage enabled"),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()}checkConfigFileVersionUpgradeRequired(){return E(this,null,function*(){let e=yield this.storage.listConfigs(9);try{let i=!1;for(let o of e){let n=yield this.storage.getConfig(o.scope,o.name,9);try{if(n.app?.configVersion===10){i=!0,console.log("[AppSettings Service] Configuration upgrade required for version 10.");break}}catch(a){console.error(`[AppSettings Service] Error fetching configuration for ${o.name}:`,a);break}}return i}catch(i){return console.error("[AppSettings Service] Error fetching configuration data:",i),!1}})}checkConfigUpgradeRequired(e,i){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}if(e==="connectionConfig"&&i.configVersion!==gr)switch(console.log(`[AppSettings Service] Invalid ${e} version. Force loading defaults`),e){case"connectionConfig":i=this.getDefaultConnectionConfig();break}return i}pushSettings(){this.themeName.next(this.activeConfig.theme.themeName),this.dataSets=this.activeConfig.app.dataSets,this.unitDefaults.next(this.activeConfig.app.unitDefaults),this.kipKNotificationConfig.next(this.activeConfig.app.notificationConfig),this.activeConfig.app.autoNightMode===void 0?this.setAutoNightMode(!1):this.autoNightMode.next(this.activeConfig.app.autoNightMode),this.activeConfig.app.redNightMode===void 0?this.setRedNightMode(!1):this.redNightMode.next(this.activeConfig.app.redNightMode),this.activeConfig.app.nightModeBrightness===void 0?this.setNightModeBrightness(.2):this.nightModeBrightness.next(this.activeConfig.app.nightModeBrightness),this.activeConfig.dashboards===void 0?this._dashboards=[]:this._dashboards=this.activeConfig.dashboards,this.activeConfig.app.isRemoteControl===void 0?this.setIsRemoteControl(!1):this.isRemoteControl.next(this.activeConfig.app.isRemoteControl),this.activeConfig.app.instanceName===void 0?this.setInstanceName(""):this.instanceName.next(this.activeConfig.app.instanceName),this.activeConfig.app.splitShellEnabled===void 0?this.setSplitShellEnabled(!1):this.splitShellEnabled.next(this.activeConfig.app.splitShellEnabled),this.activeConfig.app.splitShellSide===void 0?this.setSplitShellSide("left"):this.splitShellSide.next(this.activeConfig.app.splitShellSide),this.activeConfig.app.splitShellSwipeDisabled===void 0?this.setSplitShellSwipeDisabled(!1):this.splitShellSwipeDisabled.next(this.activeConfig.app.splitShellSwipeDisabled),this.activeConfig.app.splitShellWidth===void 0?this.setSplitShellWidth(.5):this.splitShellWidth.next(this.activeConfig.app.splitShellWidth)}getDefaultUnitsAsO(){return this.unitDefaults.asObservable()}getDefaultUnits(){return this.unitDefaults.getValue()}setDefaultUnits(e){this.unitDefaults.next(e),this.useSharedConfig?this.storage.patchConfig("Array<IUnitDefaults>",e):this.saveAppConfigToLocalStorage()}getConfigVersion(){return this.activeConfig.app?.configVersion??void 0}getAppConfig(){return this.buildAppStorageObject()}getConnectionConfig(){return this.buildConnectionStorageObject()}setConnectionConfig(e){this.loginName=e.loginName,this.loginPassword=e.loginPassword,this.useSharedConfig=e.useSharedConfig,this.proxyEnabled=e.proxyEnabled,this.signalKSubscribeAll=e.signalKSubscribeAll,this.signalkUrl.url=e.signalKUrl,e.useSharedConfig?this.useDeviceToken=!1:this.useDeviceToken=!0,this.saveConnectionConfigToLocalStorage()}setUseDeviceToken(e){this.useDeviceToken=e,this.saveConnectionConfigToLocalStorage()}getDashboardConfig(){return this.buildDashboardStorageObject()}getThemeConfig(){return this.buildThemeStorageObject()}get KipUUID(){return this.kipUUID}getThemeNameAsO(){return this.themeName.asObservable()}setThemeName(e){if(this.themeName.next(e),this.useSharedConfig){let i={themeName:e};this.storage.patchConfig("IThemeConfig",i)}else this.saveThemeConfigToLocalStorage()}getThemeName(){return this.themeName.getValue()}getAutoNightModeAsO(){return this.autoNightMode.asObservable()}setAutoNightMode(e){this.autoNightMode.next(e);let i=this.buildAppStorageObject();this.useSharedConfig?this.storage.patchConfig("IAppConfig",i):this.saveAppConfigToLocalStorage()}getAutoNightMode(){return this.autoNightMode.getValue()}getRedNightModeAsO(){return this.redNightMode.asObservable()}getRedNightMode(){return this.redNightMode.getValue()}setRedNightMode(e){this.redNightMode.next(e);let i=this.buildAppStorageObject();this.useSharedConfig?this.storage.patchConfig("IAppConfig",i):this.saveAppConfigToLocalStorage()}getIsRemoteControlAsO(){return this.isRemoteControl.asObservable()}getIsRemoteControl(){return this.isRemoteControl.getValue()}setIsRemoteControl(e){this.isRemoteControl.next(e);let i=this.buildAppStorageObject();this.useSharedConfig?this.storage.patchConfig("IAppConfig",i):this.saveAppConfigToLocalStorage()}getInstanceNameAsO(){return this.instanceName.asObservable()}getInstanceName(){return this.instanceName.getValue()}setInstanceName(e){this.instanceName.next(e);let i=this.buildAppStorageObject();this.useSharedConfig?this.storage.patchConfig("IAppConfig",i):this.saveAppConfigToLocalStorage()}getSplitShellEnabledAsO(){return this.splitShellEnabled.asObservable()}getSplitShellEnabled(){return this.splitShellEnabled.getValue()}setSplitShellEnabled(e){this.splitShellEnabled.next(e);let i=this.buildAppStorageObject();this.useSharedConfig?this.storage.patchConfig("IAppConfig",i):this.saveAppConfigToLocalStorage()}getSplitShellSideAsO(){return this.splitShellSide.asObservable()}getSplitShellSide(){return this.splitShellSide.getValue()}setSplitShellSide(e){this.splitShellSide.next(e);let i=this.buildAppStorageObject();this.useSharedConfig?this.storage.patchConfig("IAppConfig",i):this.saveAppConfigToLocalStorage()}getSplitShellSwipeDisabledAsO(){return this.splitShellSwipeDisabled.asObservable()}getSplitShellSwipeDisabled(){return this.splitShellSwipeDisabled.getValue()}setSplitShellSwipeDisabled(e){this.splitShellSwipeDisabled.next(e);let i=this.buildAppStorageObject();this.useSharedConfig?this.storage.patchConfig("IAppConfig",i):this.saveAppConfigToLocalStorage()}getSplitShellWidthAsO(){return this.splitShellWidth.asObservable()}getSplitShellWidth(){return this.splitShellWidth.getValue()}setSplitShellWidth(e){let i=Math.min(.9,Math.max(.1,e));this.splitShellWidth.next(i);let o=this.buildAppStorageObject();this.useSharedConfig?this.storage.patchConfig("IAppConfig",o):this.saveAppConfigToLocalStorage()}getNightModeBrightness(){return this.nightModeBrightness.getValue()}setNightModeBrightness(e){this.nightModeBrightness.next(e);let i=this.buildAppStorageObject();this.useSharedConfig?this.storage.patchConfig("IAppConfig",i):this.saveAppConfigToLocalStorage()}getWidgets(){return this.widgets}saveDashboards(e){this.useSharedConfig?this.storage.storageServiceReady$.getValue()&&this.storage.patchConfig("Dashboards",e):this.saveLDashboardsConfigToLocalStorage(e),this._dashboards=e}saveDataSets(e){this.dataSets=e,this.useSharedConfig?this.storage.patchConfig("Array<IDatasetDef>",e):this.saveAppConfigToLocalStorage()}getDataSets(){return this.dataSets}getNotificationServiceConfigAsO(){return this.kipKNotificationConfig.asObservable()}getNotificationConfig(){return this.kipKNotificationConfig.getValue()}setNotificationConfig(e){this.kipKNotificationConfig.next(e),this.useSharedConfig?this.storage.patchConfig("INotificationConfig",e):this.saveAppConfigToLocalStorage()}resetSettings(){let e={app:null,theme:null,dashboards:null};e.app=this.getDefaultAppConfig(),e.theme=this.getDefaultThemeConfig(),e.dashboards=this.getDefaultDashboardsConfig(),this.useSharedConfig?this.storage.storageServiceReady$.getValue()&&this.storage.setConfig("user",this.sharedConfigName,e).then(()=>{console.log("[AppSettings Service] Replaced server config name: "+this.sharedConfigName+", with default configuration values"),this.reloadApp()}).catch(i=>{console.error("[AppSettings Service] Error replacing server config name: "+this.sharedConfigName+", with default configuration values",i)}):this.reloadApp()}replaceConfig(e,i,o){let n=JSON.stringify(i);localStorage.setItem(e,n),o&&this.reloadApp()}loadDemoConfig(){if(this.useSharedConfig){let e={app:dr,dashboards:pr,theme:hr};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",dr),this.replaceConfig("dashboardsConfig",pr),this.replaceConfig("themeConfig",hr,!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()}}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=ze,e.unitDefaults=Ft,e.configVersion=gr,localStorage.setItem("appConfig",JSON.stringify(e)),e}getDefaultConnectionConfig(){let e=tn;return e.kipUUID=se.create(),e.signalKUrl=window.location.origin,localStorage.setItem("connectionConfig",JSON.stringify(e)),e}getDefaultDashboardsConfig(){let e=[];return localStorage.setItem("dashboardsConfig",JSON.stringify(e)),e}getDefaultThemeConfig(){let e=en;return localStorage.setItem("themeConfig",JSON.stringify(e)),e}static \u0275fac=function(i){return new(i||t)};static \u0275prov=D({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var fn=(()=>{class t{_renderer;_elementRef;onChange=e=>{};onTouched=()=>{};constructor(e,i){this._renderer=e,this._elementRef=i}setProperty(e,i){this._renderer.setProperty(this._elementRef.nativeElement,e,i)}registerOnTouched(e){this.onTouched=e}registerOnChange(e){this.onChange=e}setDisabledState(e){this.setProperty("disabled",e)}static \u0275fac=function(i){return new(i||t)(f(Qt),f(Xt))};static \u0275dir=y({type:t})}return t})(),dn=(()=>{class t extends fn{static \u0275fac=(()=>{let e;return function(o){return(e||(e=G(t)))(o||t)}})();static \u0275dir=y({type:t,features:[S]})}return t})(),tt=new ce("");var _f={provide:tt,useExisting:I(()=>pn),multi:!0};function xf(){let t=rr()?rr().getUserAgent():"";return/android (\d+)/.test(t.toLowerCase())}var wf=new ce(""),pn=(()=>{class t extends fn{_compositionMode;_composing=!1;constructor(e,i,o){super(e,i),this._compositionMode=o,this._compositionMode==null&&(this._compositionMode=!xf())}writeValue(e){let i=e??"";this.setProperty("value",i)}_handleInput(e){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(e)}_compositionStart(){this._composing=!0}_compositionEnd(e){this._composing=!1,this._compositionMode&&this.onChange(e)}static \u0275fac=function(i){return new(i||t)(f(Qt),f(Xt),f(wf,8))};static \u0275dir=y({type:t,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(i,o){i&1&&Le("input",function(a){return o._handleInput(a.target.value)})("blur",function(){return o.onTouched()})("compositionstart",function(){return o._compositionStart()})("compositionend",function(a){return o._compositionEnd(a.target.value)})},standalone:!1,features:[O([_f]),S]})}return t})();function br(t){return t==null||Sr(t)===0}function Sr(t){return t==null?null:Array.isArray(t)||typeof t=="string"?t.length:t instanceof Set?t.size:null}var $=new ce(""),pe=new ce(""),Tf=/^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,rn=class{static min(r){return hn(r)}static max(r){return gn(r)}static required(r){return mn(r)}static requiredTrue(r){return Af(r)}static email(r){return Df(r)}static minLength(r){return Vf(r)}static maxLength(r){return Mf(r)}static pattern(r){return vn(r)}static nullValidator(r){return Rt()}static compose(r){return xn(r)}static composeAsync(r){return wn(r)}};function hn(t){return r=>{if(r.value==null||t==null)return null;let e=parseFloat(r.value);return!isNaN(e)&&e<t?{min:{min:t,actual:r.value}}:null}}function gn(t){return r=>{if(r.value==null||t==null)return null;let e=parseFloat(r.value);return!isNaN(e)&&e>t?{max:{max:t,actual:r.value}}:null}}function mn(t){return br(t.value)?{required:!0}:null}function Af(t){return t.value===!0?null:{required:!0}}function Df(t){return br(t.value)||Tf.test(t.value)?null:{email:!0}}function Vf(t){return r=>{let e=r.value?.length??Sr(r.value);return e===null||e===0?null:e<t?{minlength:{requiredLength:t,actualLength:e}}:null}}function Mf(t){return r=>{let e=r.value?.length??Sr(r.value);return e!==null&&e>t?{maxlength:{requiredLength:t,actualLength:e}}:null}}function vn(t){if(!t)return Rt;let r,e;return typeof t=="string"?(e="",t.charAt(0)!=="^"&&(e+="^"),e+=t,t.charAt(t.length-1)!=="$"&&(e+="$"),r=new RegExp(e)):(e=t.toString(),r=t),i=>{if(br(i.value))return null;let o=i.value;return r.test(o)?null:{pattern:{requiredPattern:e,actualValue:o}}}}function Rt(t){return null}function yn(t){return t!=null}function bn(t){return Nr(t)?Er(t):t}function Sn(t){let r={};return t.forEach(e=>{r=e!=null?P(P({},r),e):r}),Object.keys(r).length===0?null:r}function Cn(t,r){return r.map(e=>e(t))}function Ef(t){return!t.validate}function _n(t){return t.map(r=>Ef(r)?r:e=>r.validate(e))}function xn(t){if(!t)return null;let r=t.filter(yn);return r.length==0?null:function(e){return Sn(Cn(e,r))}}function Cr(t){return t!=null?xn(_n(t)):null}function wn(t){if(!t)return null;let r=t.filter(yn);return r.length==0?null:function(e){let i=Cn(e,r).map(bn);return Or(i).pipe(Ir(Sn))}}function _r(t){return t!=null?wn(_n(t)):null}function on(t,r){return t===null?[r]:Array.isArray(t)?[...t,r]:[t,r]}function Tn(t){return t._rawValidators}function An(t){return t._rawAsyncValidators}function mr(t){return t?Array.isArray(t)?t:[t]:[]}function Ut(t,r){return Array.isArray(t)?t.includes(r):t===r}function nn(t,r){let e=mr(r);return mr(t).forEach(o=>{Ut(e,o)||e.push(o)}),e}function an(t,r){return mr(r).filter(e=>!Ut(t,e))}var jt=class{get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators=[];_rawAsyncValidators=[];_setValidators(r){this._rawValidators=r||[],this._composedValidatorFn=Cr(this._rawValidators)}_setAsyncValidators(r){this._rawAsyncValidators=r||[],this._composedAsyncValidatorFn=_r(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_onDestroyCallbacks=[];_registerOnDestroy(r){this._onDestroyCallbacks.push(r)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(r=>r()),this._onDestroyCallbacks=[]}reset(r=void 0){this.control&&this.control.reset(r)}hasError(r,e){return this.control?this.control.hasError(r,e):!1}getError(r,e){return this.control?this.control.getError(r,e):null}},V=class extends jt{name;get formDirective(){return null}get path(){return null}},X=class extends jt{_parent=null;name=null;valueAccessor=null},Lt=class{_cd;constructor(r){this._cd=r}get isTouched(){return this._cd?.control?._touched?.(),!!this._cd?.control?.touched}get isUntouched(){return!!this._cd?.control?.untouched}get isPristine(){return this._cd?.control?._pristine?.(),!!this._cd?.control?.pristine}get isDirty(){return!!this._cd?.control?.dirty}get isValid(){return this._cd?.control?._status?.(),!!this._cd?.control?.valid}get isInvalid(){return!!this._cd?.control?.invalid}get isPending(){return!!this._cd?.control?.pending}get isSubmitted(){return this._cd?._submitted?.(),!!this._cd?.submitted}},If={"[class.ng-untouched]":"isUntouched","[class.ng-touched]":"isTouched","[class.ng-pristine]":"isPristine","[class.ng-dirty]":"isDirty","[class.ng-valid]":"isValid","[class.ng-invalid]":"isInvalid","[class.ng-pending]":"isPending"},sC=j(P({},If),{"[class.ng-submitted]":"isSubmitted"}),lC=(()=>{class t extends Lt{constructor(e){super(e)}static \u0275fac=function(i){return new(i||t)(f(X,2))};static \u0275dir=y({type:t,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(i,o){i&2&&er("ng-untouched",o.isUntouched)("ng-touched",o.isTouched)("ng-pristine",o.isPristine)("ng-dirty",o.isDirty)("ng-valid",o.isValid)("ng-invalid",o.isInvalid)("ng-pending",o.isPending)},standalone:!1,features:[S]})}return t})(),uC=(()=>{class t extends Lt{constructor(e){super(e)}static \u0275fac=function(i){return new(i||t)(f(V,10))};static \u0275dir=y({type:t,selectors:[["","formGroupName",""],["","formArrayName",""],["","ngModelGroup",""],["","formGroup",""],["form",3,"ngNoForm",""],["","ngForm",""]],hostVars:16,hostBindings:function(i,o){i&2&&er("ng-untouched",o.isUntouched)("ng-touched",o.isTouched)("ng-pristine",o.isPristine)("ng-dirty",o.isDirty)("ng-valid",o.isValid)("ng-invalid",o.isInvalid)("ng-pending",o.isPending)("ng-submitted",o.isSubmitted)},standalone:!1,features:[S]})}return t})();var Je="VALID",Nt="INVALID",Pe="PENDING",Ze="DISABLED",le=class{},$t=class extends le{value;source;constructor(r,e){super(),this.value=r,this.source=e}},Xe=class extends le{pristine;source;constructor(r,e){super(),this.pristine=r,this.source=e}},Qe=class extends le{touched;source;constructor(r,e){super(),this.touched=r,this.source=e}},Fe=class extends le{status;source;constructor(r,e){super(),this.status=r,this.source=e}},Wt=class extends le{source;constructor(r){super(),this.source=r}},Bt=class extends le{source;constructor(r){super(),this.source=r}};function xr(t){return(Kt(t)?t.validators:t)||null}function Of(t){return Array.isArray(t)?Cr(t):t||null}function wr(t,r){return(Kt(r)?r.asyncValidators:t)||null}function kf(t){return Array.isArray(t)?_r(t):t||null}function Kt(t){return t!=null&&!Array.isArray(t)&&typeof t=="object"}function Dn(t,r,e){let i=t.controls;if(!(r?Object.keys(i):i).length)throw new at(1e3,"");if(!i[e])throw new at(1001,"")}function Vn(t,r,e){t._forEachChild((i,o)=>{if(e[o]===void 0)throw new at(1002,"")})}var Re=class{_pendingDirty=!1;_hasOwnPendingAsyncValidator=null;_pendingTouched=!1;_onCollectionChange=()=>{};_updateOn;_parent=null;_asyncValidationSubscription;_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators;_rawAsyncValidators;value;constructor(r,e){this._assignValidators(r),this._assignAsyncValidators(e)}get validator(){return this._composedValidatorFn}set validator(r){this._rawValidators=this._composedValidatorFn=r}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(r){this._rawAsyncValidators=this._composedAsyncValidatorFn=r}get parent(){return this._parent}get status(){return q(this.statusReactive)}set status(r){q(()=>this.statusReactive.set(r))}_status=me(()=>this.statusReactive());statusReactive=Q(void 0);get valid(){return this.status===Je}get invalid(){return this.status===Nt}get pending(){return this.status==Pe}get disabled(){return this.status===Ze}get enabled(){return this.status!==Ze}errors;get pristine(){return q(this.pristineReactive)}set pristine(r){q(()=>this.pristineReactive.set(r))}_pristine=me(()=>this.pristineReactive());pristineReactive=Q(!0);get dirty(){return!this.pristine}get touched(){return q(this.touchedReactive)}set touched(r){q(()=>this.touchedReactive.set(r))}_touched=me(()=>this.touchedReactive());touchedReactive=Q(!1);get untouched(){return!this.touched}_events=new ot;events=this._events.asObservable();valueChanges;statusChanges;get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(r){this._assignValidators(r)}setAsyncValidators(r){this._assignAsyncValidators(r)}addValidators(r){this.setValidators(nn(r,this._rawValidators))}addAsyncValidators(r){this.setAsyncValidators(nn(r,this._rawAsyncValidators))}removeValidators(r){this.setValidators(an(r,this._rawValidators))}removeAsyncValidators(r){this.setAsyncValidators(an(r,this._rawAsyncValidators))}hasValidator(r){return Ut(this._rawValidators,r)}hasAsyncValidator(r){return Ut(this._rawAsyncValidators,r)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(r={}){let e=this.touched===!1;this.touched=!0;let i=r.sourceControl??this;this._parent&&!r.onlySelf&&this._parent.markAsTouched(j(P({},r),{sourceControl:i})),e&&r.emitEvent!==!1&&this._events.next(new Qe(!0,i))}markAllAsDirty(r={}){this.markAsDirty({onlySelf:!0,emitEvent:r.emitEvent,sourceControl:this}),this._forEachChild(e=>e.markAllAsDirty(r))}markAllAsTouched(r={}){this.markAsTouched({onlySelf:!0,emitEvent:r.emitEvent,sourceControl:this}),this._forEachChild(e=>e.markAllAsTouched(r))}markAsUntouched(r={}){let e=this.touched===!0;this.touched=!1,this._pendingTouched=!1;let i=r.sourceControl??this;this._forEachChild(o=>{o.markAsUntouched({onlySelf:!0,emitEvent:r.emitEvent,sourceControl:i})}),this._parent&&!r.onlySelf&&this._parent._updateTouched(r,i),e&&r.emitEvent!==!1&&this._events.next(new Qe(!1,i))}markAsDirty(r={}){let e=this.pristine===!0;this.pristine=!1;let i=r.sourceControl??this;this._parent&&!r.onlySelf&&this._parent.markAsDirty(j(P({},r),{sourceControl:i})),e&&r.emitEvent!==!1&&this._events.next(new Xe(!1,i))}markAsPristine(r={}){let e=this.pristine===!1;this.pristine=!0,this._pendingDirty=!1;let i=r.sourceControl??this;this._forEachChild(o=>{o.markAsPristine({onlySelf:!0,emitEvent:r.emitEvent})}),this._parent&&!r.onlySelf&&this._parent._updatePristine(r,i),e&&r.emitEvent!==!1&&this._events.next(new Xe(!0,i))}markAsPending(r={}){this.status=Pe;let e=r.sourceControl??this;r.emitEvent!==!1&&(this._events.next(new Fe(this.status,e)),this.statusChanges.emit(this.status)),this._parent&&!r.onlySelf&&this._parent.markAsPending(j(P({},r),{sourceControl:e}))}disable(r={}){let e=this._parentMarkedDirty(r.onlySelf);this.status=Ze,this.errors=null,this._forEachChild(o=>{o.disable(j(P({},r),{onlySelf:!0}))}),this._updateValue();let i=r.sourceControl??this;r.emitEvent!==!1&&(this._events.next(new $t(this.value,i)),this._events.next(new Fe(this.status,i)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(j(P({},r),{skipPristineCheck:e}),this),this._onDisabledChange.forEach(o=>o(!0))}enable(r={}){let e=this._parentMarkedDirty(r.onlySelf);this.status=Je,this._forEachChild(i=>{i.enable(j(P({},r),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:r.emitEvent}),this._updateAncestors(j(P({},r),{skipPristineCheck:e}),this),this._onDisabledChange.forEach(i=>i(!1))}_updateAncestors(r,e){this._parent&&!r.onlySelf&&(this._parent.updateValueAndValidity(r),r.skipPristineCheck||this._parent._updatePristine({},e),this._parent._updateTouched({},e))}setParent(r){this._parent=r}getRawValue(){return this.value}updateValueAndValidity(r={}){if(this._setInitialStatus(),this._updateValue(),this.enabled){let i=this._cancelExistingSubscription();this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===Je||this.status===Pe)&&this._runAsyncValidator(i,r.emitEvent)}let e=r.sourceControl??this;r.emitEvent!==!1&&(this._events.next(new $t(this.value,e)),this._events.next(new Fe(this.status,e)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!r.onlySelf&&this._parent.updateValueAndValidity(j(P({},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()?Ze:Je}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(r,e){if(this.asyncValidator){this.status=Pe,this._hasOwnPendingAsyncValidator={emitEvent:e!==!1,shouldHaveEmitted:r!==!1};let i=bn(this.asyncValidator(this));this._asyncValidationSubscription=i.subscribe(o=>{this._hasOwnPendingAsyncValidator=null,this.setErrors(o,{emitEvent:e,shouldHaveEmitted:r})})}}_cancelExistingSubscription(){if(this._asyncValidationSubscription){this._asyncValidationSubscription.unsubscribe();let r=(this._hasOwnPendingAsyncValidator?.emitEvent||this._hasOwnPendingAsyncValidator?.shouldHaveEmitted)??!1;return this._hasOwnPendingAsyncValidator=null,r}return!1}setErrors(r,e={}){this.errors=r,this._updateControlsErrors(e.emitEvent!==!1,this,e.shouldHaveEmitted)}get(r){let e=r;return e==null||(Array.isArray(e)||(e=e.split(".")),e.length===0)?null:e.reduce((i,o)=>i&&i._find(o),this)}getError(r,e){let i=e?this.get(e):this;return i&&i.errors?i.errors[r]:null}hasError(r,e){return!!this.getError(r,e)}get root(){let r=this;for(;r._parent;)r=r._parent;return r}_updateControlsErrors(r,e,i){this.status=this._calculateStatus(),r&&this.statusChanges.emit(this.status),(r||i)&&this._events.next(new Fe(this.status,e)),this._parent&&this._parent._updateControlsErrors(r,e,i)}_initObservables(){this.valueChanges=new ee,this.statusChanges=new ee}_calculateStatus(){return this._allControlsDisabled()?Ze:this.errors?Nt:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(Pe)?Pe:this._anyControlsHaveStatus(Nt)?Nt:Je}_anyControlsHaveStatus(r){return this._anyControls(e=>e.status===r)}_anyControlsDirty(){return this._anyControls(r=>r.dirty)}_anyControlsTouched(){return this._anyControls(r=>r.touched)}_updatePristine(r,e){let i=!this._anyControlsDirty(),o=this.pristine!==i;this.pristine=i,this._parent&&!r.onlySelf&&this._parent._updatePristine(r,e),o&&this._events.next(new Xe(this.pristine,e))}_updateTouched(r={},e){this.touched=this._anyControlsTouched(),this._events.next(new Qe(this.touched,e)),this._parent&&!r.onlySelf&&this._parent._updateTouched(r,e)}_onDisabledChange=[];_registerOnCollectionChange(r){this._onCollectionChange=r}_setUpdateStrategy(r){Kt(r)&&r.updateOn!=null&&(this._updateOn=r.updateOn)}_parentMarkedDirty(r){let e=this._parent&&this._parent.dirty;return!r&&!!e&&!this._parent._anyControlsDirty()}_find(r){return null}_assignValidators(r){this._rawValidators=Array.isArray(r)?r.slice():r,this._composedValidatorFn=Of(this._rawValidators)}_assignAsyncValidators(r){this._rawAsyncValidators=Array.isArray(r)?r.slice():r,this._composedAsyncValidatorFn=kf(this._rawAsyncValidators)}},de=class extends Re{constructor(r,e,i){super(xr(e),wr(i,e)),this.controls=r,this._initObservables(),this._setUpdateStrategy(e),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}controls;registerControl(r,e){return this.controls[r]?this.controls[r]:(this.controls[r]=e,e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange),e)}addControl(r,e,i={}){this.registerControl(r,e),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}removeControl(r,e={}){this.controls[r]&&this.controls[r]._registerOnCollectionChange(()=>{}),delete this.controls[r],this.updateValueAndValidity({emitEvent:e.emitEvent}),this._onCollectionChange()}setControl(r,e,i={}){this.controls[r]&&this.controls[r]._registerOnCollectionChange(()=>{}),delete this.controls[r],e&&this.registerControl(r,e),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}contains(r){return this.controls.hasOwnProperty(r)&&this.controls[r].enabled}setValue(r,e={}){Vn(this,!0,r),Object.keys(r).forEach(i=>{Dn(this,!0,i),this.controls[i].setValue(r[i],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}patchValue(r,e={}){r!=null&&(Object.keys(r).forEach(i=>{let o=this.controls[i];o&&o.patchValue(r[i],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e))}reset(r={},e={}){this._forEachChild((i,o)=>{i.reset(r?r[o]:null,{onlySelf:!0,emitEvent:e.emitEvent})}),this._updatePristine(e,this),this._updateTouched(e,this),this.updateValueAndValidity(e)}getRawValue(){return this._reduceChildren({},(r,e,i)=>(r[i]=e.getRawValue(),r))}_syncPendingControls(){let r=this._reduceChildren(!1,(e,i)=>i._syncPendingControls()?!0:e);return r&&this.updateValueAndValidity({onlySelf:!0}),r}_forEachChild(r){Object.keys(this.controls).forEach(e=>{let i=this.controls[e];i&&r(i,e)})}_setUpControls(){this._forEachChild(r=>{r.setParent(this),r._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(r){for(let[e,i]of Object.entries(this.controls))if(this.contains(e)&&r(i))return!0;return!1}_reduceValue(){let r={};return this._reduceChildren(r,(e,i,o)=>((i.enabled||this.disabled)&&(e[o]=i.value),e))}_reduceChildren(r,e){let i=r;return this._forEachChild((o,n)=>{i=e(i,o,n)}),i}_allControlsDisabled(){for(let r of Object.keys(this.controls))if(this.controls[r].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_find(r){return this.controls.hasOwnProperty(r)?this.controls[r]:null}};var cC=de;var vr=class extends de{};var Ue=new ce("",{providedIn:"root",factory:()=>zt}),zt="always";function Jt(t,r){return[...r.path,t]}function et(t,r,e=zt){Tr(t,r),r.valueAccessor.writeValue(t.value),(t.disabled||e==="always")&&r.valueAccessor.setDisabledState?.(t.disabled),Ff(t,r),Rf(t,r),Nf(t,r),Pf(t,r)}function Ht(t,r,e=!0){let i=()=>{};r.valueAccessor&&(r.valueAccessor.registerOnChange(i),r.valueAccessor.registerOnTouched(i)),qt(t,r),t&&(r._invokeOnDestroyCallbacks(),t._registerOnCollectionChange(()=>{}))}function Gt(t,r){t.forEach(e=>{e.registerOnValidatorChange&&e.registerOnValidatorChange(r)})}function Pf(t,r){if(r.valueAccessor.setDisabledState){let e=i=>{r.valueAccessor.setDisabledState(i)};t.registerOnDisabledChange(e),r._registerOnDestroy(()=>{t._unregisterOnDisabledChange(e)})}}function Tr(t,r){let e=Tn(t);r.validator!==null?t.setValidators(on(e,r.validator)):typeof e=="function"&&t.setValidators([e]);let i=An(t);r.asyncValidator!==null?t.setAsyncValidators(on(i,r.asyncValidator)):typeof i=="function"&&t.setAsyncValidators([i]);let o=()=>t.updateValueAndValidity();Gt(r._rawValidators,o),Gt(r._rawAsyncValidators,o)}function qt(t,r){let e=!1;if(t!==null){if(r.validator!==null){let o=Tn(t);if(Array.isArray(o)&&o.length>0){let n=o.filter(a=>a!==r.validator);n.length!==o.length&&(e=!0,t.setValidators(n))}}if(r.asyncValidator!==null){let o=An(t);if(Array.isArray(o)&&o.length>0){let n=o.filter(a=>a!==r.asyncValidator);n.length!==o.length&&(e=!0,t.setAsyncValidators(n))}}}let i=()=>{};return Gt(r._rawValidators,i),Gt(r._rawAsyncValidators,i),e}function Ff(t,r){r.valueAccessor.registerOnChange(e=>{t._pendingValue=e,t._pendingChange=!0,t._pendingDirty=!0,t.updateOn==="change"&&Mn(t,r)})}function Nf(t,r){r.valueAccessor.registerOnTouched(()=>{t._pendingTouched=!0,t.updateOn==="blur"&&t._pendingChange&&Mn(t,r),t.updateOn!=="submit"&&t.markAsTouched()})}function Mn(t,r){t._pendingDirty&&t.markAsDirty(),t.setValue(t._pendingValue,{emitModelToViewChange:!1}),r.viewToModelUpdate(t._pendingValue),t._pendingChange=!1}function Rf(t,r){let e=(i,o)=>{r.valueAccessor.writeValue(i),o&&r.viewToModelUpdate(i)};t.registerOnChange(e),r._registerOnDestroy(()=>{t._unregisterOnChange(e)})}function En(t,r){t==null,Tr(t,r)}function Uf(t,r){return qt(t,r)}function Ar(t,r){if(!t.hasOwnProperty("model"))return!1;let e=t.model;return e.isFirstChange()?!0:!Object.is(r,e.currentValue)}function jf(t){return Object.getPrototypeOf(t.constructor)===dn}function In(t,r){t._syncPendingControls(),r.forEach(e=>{let i=e.control;i.updateOn==="submit"&&i._pendingChange&&(e.viewToModelUpdate(i._pendingValue),i._pendingChange=!1)})}function Dr(t,r){if(!r)return null;Array.isArray(r);let e,i,o;return r.forEach(n=>{n.constructor===pn?e=n:jf(n)?i=n:o=n}),o||i||e||null}function Lf(t,r){let e=t.indexOf(r);e>-1&&t.splice(e,1)}var $f={provide:V,useExisting:I(()=>Wf)},Ye=Promise.resolve(),Wf=(()=>{class t extends V{callSetDisabledState;get submitted(){return q(this.submittedReactive)}_submitted=me(()=>this.submittedReactive());submittedReactive=Q(!1);_directives=new Set;form;ngSubmit=new ee;options;constructor(e,i,o){super(),this.callSetDisabledState=o,this.form=new de({},Cr(e),_r(i))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(e){Ye.then(()=>{let i=this._findContainer(e.path);e.control=i.registerControl(e.name,e.control),et(e.control,e,this.callSetDisabledState),e.control.updateValueAndValidity({emitEvent:!1}),this._directives.add(e)})}getControl(e){return this.form.get(e.path)}removeControl(e){Ye.then(()=>{let i=this._findContainer(e.path);i&&i.removeControl(e.name),this._directives.delete(e)})}addFormGroup(e){Ye.then(()=>{let i=this._findContainer(e.path),o=new de({});En(o,e),i.registerControl(e.name,o),o.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(e){Ye.then(()=>{let i=this._findContainer(e.path);i&&i.removeControl(e.name)})}getFormGroup(e){return this.form.get(e.path)}updateModel(e,i){Ye.then(()=>{this.form.get(e.path).setValue(i)})}setValue(e){this.control.setValue(e)}onSubmit(e){return this.submittedReactive.set(!0),In(this.form,this._directives),this.ngSubmit.emit(e),this.form._events.next(new Wt(this.control)),e?.target?.method==="dialog"}onReset(){this.resetForm()}resetForm(e=void 0){this.form.reset(e),this.submittedReactive.set(!1),this.form._events.next(new Bt(this.form))}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.form._updateOn=this.options.updateOn)}_findContainer(e){return e.pop(),e.length?this.form.get(e):this.form}static \u0275fac=function(i){return new(i||t)(f($,10),f(pe,10),f(Ue,8))};static \u0275dir=y({type:t,selectors:[["form",3,"ngNoForm","",3,"formGroup",""],["ng-form"],["","ngForm",""]],hostBindings:function(i,o){i&1&&Le("submit",function(a){return o.onSubmit(a)})("reset",function(){return o.onReset()})},inputs:{options:[0,"ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],standalone:!1,features:[O([$f]),S]})}return t})();function sn(t,r){let e=t.indexOf(r);e>-1&&t.splice(e,1)}function ln(t){return typeof t=="object"&&t!==null&&Object.keys(t).length===2&&"value"in t&&"disabled"in t}var Ne=class extends Re{defaultValue=null;_onChange=[];_pendingValue;_pendingChange=!1;constructor(r=null,e,i){super(xr(e),wr(i,e)),this._applyFormState(r),this._setUpdateStrategy(e),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator}),Kt(e)&&(e.nonNullable||e.initialValueIsDefault)&&(ln(r)?this.defaultValue=r.value:this.defaultValue=r)}setValue(r,e={}){this.value=this._pendingValue=r,this._onChange.length&&e.emitModelToViewChange!==!1&&this._onChange.forEach(i=>i(this.value,e.emitViewToModelChange!==!1)),this.updateValueAndValidity(e)}patchValue(r,e={}){this.setValue(r,e)}reset(r=this.defaultValue,e={}){this._applyFormState(r),this.markAsPristine(e),this.markAsUntouched(e),this.setValue(this.value,e),this._pendingChange=!1}_updateValue(){}_anyControls(r){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(r){this._onChange.push(r)}_unregisterOnChange(r){sn(this._onChange,r)}registerOnDisabledChange(r){this._onDisabledChange.push(r)}_unregisterOnDisabledChange(r){sn(this._onDisabledChange,r)}_forEachChild(r){}_syncPendingControls(){return this.updateOn==="submit"&&(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),this._pendingChange)?(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),!0):!1}_applyFormState(r){ln(r)?(this.value=this._pendingValue=r.value,r.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=r}},dC=Ne,Bf=t=>t instanceof Ne,Hf=(()=>{class t extends V{_parent;ngOnInit(){this._checkParentType(),this.formDirective.addFormGroup(this)}ngOnDestroy(){this.formDirective&&this.formDirective.removeFormGroup(this)}get control(){return this.formDirective.getFormGroup(this)}get path(){return Jt(this.name==null?this.name:this.name.toString(),this._parent)}get formDirective(){return this._parent?this._parent.formDirective:null}_checkParentType(){}static \u0275fac=(()=>{let e;return function(o){return(e||(e=G(t)))(o||t)}})();static \u0275dir=y({type:t,standalone:!1,features:[S]})}return t})();var Gf={provide:X,useExisting:I(()=>qf)},un=Promise.resolve(),qf=(()=>{class t extends X{_changeDetectorRef;callSetDisabledState;control=new Ne;static ngAcceptInputType_isDisabled;_registered=!1;viewModel;name="";isDisabled;model;options;update=new ee;constructor(e,i,o,n,a,s){super(),this._changeDetectorRef=a,this.callSetDisabledState=s,this._parent=e,this._setValidators(i),this._setAsyncValidators(o),this.valueAccessor=Dr(this,n)}ngOnChanges(e){if(this._checkForErrors(),!this._registered||"name"in e){if(this._registered&&(this._checkName(),this.formDirective)){let i=e.name.previousValue;this.formDirective.removeControl({name:i,path:this._getPath(i)})}this._setUpControl()}"isDisabled"in e&&this._updateDisabled(e),Ar(e,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._getPath(this.name)}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(e){this.viewModel=e,this.update.emit(e)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!!(this.options&&this.options.standalone)}_setUpStandalone(){et(this.control,this,this.callSetDisabledState),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._checkName()}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),!this._isStandalone()&&this.name}_updateValue(e){un.then(()=>{this.control.setValue(e,{emitViewToModelChange:!1}),this._changeDetectorRef?.markForCheck()})}_updateDisabled(e){let i=e.isDisabled.currentValue,o=i!==0&&tr(i);un.then(()=>{o&&!this.control.disabled?this.control.disable():!o&&this.control.disabled&&this.control.enable(),this._changeDetectorRef?.markForCheck()})}_getPath(e){return this._parent?Jt(e,this._parent):[e]}static \u0275fac=function(i){return new(i||t)(f(V,9),f($,10),f(pe,10),f(tt,10),f(Rr,8),f(Ue,8))};static \u0275dir=y({type:t,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:[0,"disabled","isDisabled"],model:[0,"ngModel","model"],options:[0,"ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],standalone:!1,features:[O([Gf]),S,ge]})}return t})();var pC=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275dir=y({type:t,selectors:[["form",3,"ngNoForm","",3,"ngNativeValidate",""]],hostAttrs:["novalidate",""],standalone:!1})}return t})(),Kf={provide:tt,useExisting:I(()=>zf),multi:!0},zf=(()=>{class t extends dn{writeValue(e){let i=e??"";this.setProperty("value",i)}registerOnChange(e){this.onChange=i=>{e(i==""?null:parseFloat(i))}}static \u0275fac=(()=>{let e;return function(o){return(e||(e=G(t)))(o||t)}})();static \u0275dir=y({type:t,selectors:[["input","type","number","formControlName",""],["input","type","number","formControl",""],["input","type","number","ngModel",""]],hostBindings:function(i,o){i&1&&Le("input",function(a){return o.onChange(a.target.value)})("blur",function(){return o.onTouched()})},standalone:!1,features:[O([Kf]),S]})}return t})();var Vr=new ce(""),Jf={provide:X,useExisting:I(()=>Zf)},Zf=(()=>{class t extends X{_ngModelWarningConfig;callSetDisabledState;viewModel;form;set isDisabled(e){}model;update=new ee;static _ngModelWarningSentOnce=!1;_ngModelWarningSent=!1;constructor(e,i,o,n,a){super(),this._ngModelWarningConfig=n,this.callSetDisabledState=a,this._setValidators(e),this._setAsyncValidators(i),this.valueAccessor=Dr(this,o)}ngOnChanges(e){if(this._isControlChanged(e)){let i=e.form.previousValue;i&&Ht(i,this,!1),et(this.form,this,this.callSetDisabledState),this.form.updateValueAndValidity({emitEvent:!1})}Ar(e,this.viewModel)&&(this.form.setValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.form&&Ht(this.form,this,!1)}get path(){return[]}get control(){return this.form}viewToModelUpdate(e){this.viewModel=e,this.update.emit(e)}_isControlChanged(e){return e.hasOwnProperty("form")}static \u0275fac=function(i){return new(i||t)(f($,10),f(pe,10),f(tt,10),f(Vr,8),f(Ue,8))};static \u0275dir=y({type:t,selectors:[["","formControl",""]],inputs:{form:[0,"formControl","form"],isDisabled:[0,"disabled","isDisabled"],model:[0,"ngModel","model"]},outputs:{update:"ngModelChange"},exportAs:["ngForm"],standalone:!1,features:[O([Jf]),S,ge]})}return t})(),Yf={provide:V,useExisting:I(()=>On)},On=(()=>{class t extends V{callSetDisabledState;get submitted(){return q(this._submittedReactive)}set submitted(e){this._submittedReactive.set(e)}_submitted=me(()=>this._submittedReactive());_submittedReactive=Q(!1);_oldForm;_onCollectionChange=()=>this._updateDomValue();directives=[];form=null;ngSubmit=new ee;constructor(e,i,o){super(),this.callSetDisabledState=o,this._setValidators(e),this._setAsyncValidators(i)}ngOnChanges(e){e.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations(),this._oldForm=this.form)}ngOnDestroy(){this.form&&(qt(this.form,this),this.form._onCollectionChange===this._onCollectionChange&&this.form._registerOnCollectionChange(()=>{}))}get formDirective(){return this}get control(){return this.form}get path(){return[]}addControl(e){let i=this.form.get(e.path);return et(i,e,this.callSetDisabledState),i.updateValueAndValidity({emitEvent:!1}),this.directives.push(e),i}getControl(e){return this.form.get(e.path)}removeControl(e){Ht(e.control||null,e,!1),Lf(this.directives,e)}addFormGroup(e){this._setUpFormContainer(e)}removeFormGroup(e){this._cleanUpFormContainer(e)}getFormGroup(e){return this.form.get(e.path)}addFormArray(e){this._setUpFormContainer(e)}removeFormArray(e){this._cleanUpFormContainer(e)}getFormArray(e){return this.form.get(e.path)}updateModel(e,i){this.form.get(e.path).setValue(i)}onSubmit(e){return this._submittedReactive.set(!0),In(this.form,this.directives),this.ngSubmit.emit(e),this.form._events.next(new Wt(this.control)),e?.target?.method==="dialog"}onReset(){this.resetForm()}resetForm(e=void 0,i={}){this.form.reset(e,i),this._submittedReactive.set(!1),i?.emitEvent!==!1&&this.form._events.next(new Bt(this.form))}_updateDomValue(){this.directives.forEach(e=>{let i=e.control,o=this.form.get(e.path);i!==o&&(Ht(i||null,e),Bf(o)&&(et(o,e,this.callSetDisabledState),e.control=o))}),this.form._updateTreeValidity({emitEvent:!1})}_setUpFormContainer(e){let i=this.form.get(e.path);En(i,e),i.updateValueAndValidity({emitEvent:!1})}_cleanUpFormContainer(e){if(this.form){let i=this.form.get(e.path);i&&Uf(i,e)&&i.updateValueAndValidity({emitEvent:!1})}}_updateRegistrations(){this.form._registerOnCollectionChange(this._onCollectionChange),this._oldForm&&this._oldForm._registerOnCollectionChange(()=>{})}_updateValidators(){Tr(this.form,this),this._oldForm&&qt(this._oldForm,this)}static \u0275fac=function(i){return new(i||t)(f($,10),f(pe,10),f(Ue,8))};static \u0275dir=y({type:t,selectors:[["","formGroup",""]],hostBindings:function(i,o){i&1&&Le("submit",function(a){return o.onSubmit(a)})("reset",function(){return o.onReset()})},inputs:{form:[0,"formGroup","form"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],standalone:!1,features:[O([Yf]),S,ge]})}return t})(),Xf={provide:V,useExisting:I(()=>kn)},kn=(()=>{class t extends Hf{name=null;constructor(e,i,o){super(),this._parent=e,this._setValidators(i),this._setAsyncValidators(o)}_checkParentType(){Fn(this._parent)}static \u0275fac=function(i){return new(i||t)(f(V,13),f($,10),f(pe,10))};static \u0275dir=y({type:t,selectors:[["","formGroupName",""]],inputs:{name:[0,"formGroupName","name"]},standalone:!1,features:[O([Xf]),S]})}return t})(),Qf={provide:V,useExisting:I(()=>Pn)},Pn=(()=>{class t extends V{_parent;name=null;constructor(e,i,o){super(),this._parent=e,this._setValidators(i),this._setAsyncValidators(o)}ngOnInit(){Fn(this._parent),this.formDirective.addFormArray(this)}ngOnDestroy(){this.formDirective?.removeFormArray(this)}get control(){return this.formDirective.getFormArray(this)}get formDirective(){return this._parent?this._parent.formDirective:null}get path(){return Jt(this.name==null?this.name:this.name.toString(),this._parent)}static \u0275fac=function(i){return new(i||t)(f(V,13),f($,10),f(pe,10))};static \u0275dir=y({type:t,selectors:[["","formArrayName",""]],inputs:{name:[0,"formArrayName","name"]},standalone:!1,features:[O([Qf]),S]})}return t})();function Fn(t){return!(t instanceof kn)&&!(t instanceof On)&&!(t instanceof Pn)}var ed={provide:X,useExisting:I(()=>td)},td=(()=>{class t extends X{_ngModelWarningConfig;_added=!1;viewModel;control;name=null;set isDisabled(e){}model;update=new ee;static _ngModelWarningSentOnce=!1;_ngModelWarningSent=!1;constructor(e,i,o,n,a){super(),this._ngModelWarningConfig=a,this._parent=e,this._setValidators(i),this._setAsyncValidators(o),this.valueAccessor=Dr(this,n)}ngOnChanges(e){this._added||this._setUpControl(),Ar(e,this.viewModel)&&(this.viewModel=this.model,this.formDirective.updateModel(this,this.model))}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}viewToModelUpdate(e){this.viewModel=e,this.update.emit(e)}get path(){return Jt(this.name==null?this.name:this.name.toString(),this._parent)}get formDirective(){return this._parent?this._parent.formDirective:null}_setUpControl(){this.control=this.formDirective.addControl(this),this._added=!0}static \u0275fac=function(i){return new(i||t)(f(V,13),f($,10),f(pe,10),f(tt,10),f(Vr,8))};static \u0275dir=y({type:t,selectors:[["","formControlName",""]],inputs:{name:[0,"formControlName","name"],isDisabled:[0,"disabled","isDisabled"],model:[0,"ngModel","model"]},outputs:{update:"ngModelChange"},standalone:!1,features:[O([ed]),S,ge]})}return t})();function Nn(t){return typeof t=="number"?t:parseFloat(t)}var Zt=(()=>{class t{_validator=Rt;_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):Rt,this._onChange&&this._onChange()}}validate(e){return this._validator(e)}registerOnValidatorChange(e){this._onChange=e}enabled(e){return e!=null}static \u0275fac=function(i){return new(i||t)};static \u0275dir=y({type:t,features:[ge]})}return t})(),rd={provide:$,useExisting:I(()=>id),multi:!0},id=(()=>{class t extends Zt{max;inputName="max";normalizeInput=e=>Nn(e);createValidator=e=>gn(e);static \u0275fac=(()=>{let e;return function(o){return(e||(e=G(t)))(o||t)}})();static \u0275dir=y({type:t,selectors:[["input","type","number","max","","formControlName",""],["input","type","number","max","","formControl",""],["input","type","number","max","","ngModel",""]],hostVars:1,hostBindings:function(i,o){i&2&&je("max",o._enabled?o.max:null)},inputs:{max:"max"},standalone:!1,features:[O([rd]),S]})}return t})(),od={provide:$,useExisting:I(()=>nd),multi:!0},nd=(()=>{class t extends Zt{min;inputName="min";normalizeInput=e=>Nn(e);createValidator=e=>hn(e);static \u0275fac=(()=>{let e;return function(o){return(e||(e=G(t)))(o||t)}})();static \u0275dir=y({type:t,selectors:[["input","type","number","min","","formControlName",""],["input","type","number","min","","formControl",""],["input","type","number","min","","ngModel",""]],hostVars:1,hostBindings:function(i,o){i&2&&je("min",o._enabled?o.min:null)},inputs:{min:"min"},standalone:!1,features:[O([od]),S]})}return t})(),ad={provide:$,useExisting:I(()=>sd),multi:!0};var sd=(()=>{class t extends Zt{required;inputName="required";normalizeInput=tr;createValidator=e=>mn;enabled(e){return e}static \u0275fac=(()=>{let e;return function(o){return(e||(e=G(t)))(o||t)}})();static \u0275dir=y({type:t,selectors:[["","required","","formControlName","",3,"type","checkbox"],["","required","","formControl","",3,"type","checkbox"],["","required","","ngModel","",3,"type","checkbox"]],hostVars:1,hostBindings:function(i,o){i&2&&je("required",o._enabled?"":null)},inputs:{required:"required"},standalone:!1,features:[O([ad]),S]})}return t})();var ld={provide:$,useExisting:I(()=>ud),multi:!0},ud=(()=>{class t extends Zt{pattern;inputName="pattern";normalizeInput=e=>e;createValidator=e=>vn(e);static \u0275fac=(()=>{let e;return function(o){return(e||(e=G(t)))(o||t)}})();static \u0275dir=y({type:t,selectors:[["","pattern","","formControlName",""],["","pattern","","formControl",""],["","pattern","","ngModel",""]],hostVars:1,hostBindings:function(i,o){i&2&&je("pattern",o._enabled?o.pattern:null)},inputs:{pattern:"pattern"},standalone:!1,features:[O([ld]),S]})}return t})();var Rn=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=lt({type:t});static \u0275inj=st({})}return t})(),yr=class extends Re{constructor(r,e,i){super(xr(e),wr(i,e)),this.controls=r,this._initObservables(),this._setUpdateStrategy(e),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}controls;at(r){return this.controls[this._adjustIndex(r)]}push(r,e={}){this.controls.push(r),this._registerControl(r),this.updateValueAndValidity({emitEvent:e.emitEvent}),this._onCollectionChange()}insert(r,e,i={}){this.controls.splice(r,0,e),this._registerControl(e),this.updateValueAndValidity({emitEvent:i.emitEvent})}removeAt(r,e={}){let i=this._adjustIndex(r);i<0&&(i=0),this.controls[i]&&this.controls[i]._registerOnCollectionChange(()=>{}),this.controls.splice(i,1),this.updateValueAndValidity({emitEvent:e.emitEvent})}setControl(r,e,i={}){let o=this._adjustIndex(r);o<0&&(o=0),this.controls[o]&&this.controls[o]._registerOnCollectionChange(()=>{}),this.controls.splice(o,1),e&&(this.controls.splice(o,0,e),this._registerControl(e)),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}get length(){return this.controls.length}setValue(r,e={}){Vn(this,!1,r),r.forEach((i,o)=>{Dn(this,!1,o),this.at(o).setValue(i,{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}patchValue(r,e={}){r!=null&&(r.forEach((i,o)=>{this.at(o)&&this.at(o).patchValue(i,{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e))}reset(r=[],e={}){this._forEachChild((i,o)=>{i.reset(r[o],{onlySelf:!0,emitEvent:e.emitEvent})}),this._updatePristine(e,this),this._updateTouched(e,this),this.updateValueAndValidity(e)}getRawValue(){return this.controls.map(r=>r.getRawValue())}clear(r={}){this.controls.length<1||(this._forEachChild(e=>e._registerOnCollectionChange(()=>{})),this.controls.splice(0),this.updateValueAndValidity({emitEvent:r.emitEvent}))}_adjustIndex(r){return r<0?r+this.length:r}_syncPendingControls(){let r=this.controls.reduce((e,i)=>i._syncPendingControls()?!0:e,!1);return r&&this.updateValueAndValidity({onlySelf:!0}),r}_forEachChild(r){this.controls.forEach((e,i)=>{r(e,i)})}_updateValue(){this.value=this.controls.filter(r=>r.enabled||this.disabled).map(r=>r.value)}_anyControls(r){return this.controls.some(e=>e.enabled&&r(e))}_setUpControls(){this._forEachChild(r=>this._registerControl(r))}_allControlsDisabled(){for(let r of this.controls)if(r.enabled)return!1;return this.controls.length>0||this.disabled}_registerControl(r){r.setParent(this),r._registerOnCollectionChange(this._onCollectionChange)}_find(r){return this.at(r)??null}};function cn(t){return!!t&&(t.asyncValidators!==void 0||t.validators!==void 0||t.updateOn!==void 0)}var cd=(()=>{class t{useNonNullable=!1;get nonNullable(){let e=new t;return e.useNonNullable=!0,e}group(e,i=null){let o=this._reduceControls(e),n={};return cn(i)?n=i:i!==null&&(n.validators=i.validator,n.asyncValidators=i.asyncValidator),new de(o,n)}record(e,i=null){let o=this._reduceControls(e);return new vr(o,i)}control(e,i,o){let n={};return this.useNonNullable?(cn(i)?n=i:(n.validators=i,n.asyncValidators=o),new Ne(e,j(P({},n),{nonNullable:!0}))):new Ne(e,i,o)}array(e,i,o){let n=e.map(a=>this._createControl(a));return new yr(n,i,o)}_reduceControls(e){let i={};return Object.keys(e).forEach(o=>{i[o]=this._createControl(e[o])}),i}_createControl(e){if(e instanceof Ne)return e;if(e instanceof Re)return e;if(Array.isArray(e)){let i=e[0],o=e.length>1?e[1]:null,n=e.length>2?e[2]:null;return this.control(i,o,n)}else return this.control(e)}static \u0275fac=function(i){return new(i||t)};static \u0275prov=D({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var hC=(()=>{class t extends cd{group(e,i=null){return super.group(e,i)}control(e,i,o){return super.control(e,i,o)}array(e,i,o){return super.array(e,i,o)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=G(t)))(o||t)}})();static \u0275prov=D({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var gC=(()=>{class t{static withConfig(e){return{ngModule:t,providers:[{provide:Ue,useValue:e.callSetDisabledState??zt}]}}static \u0275fac=function(i){return new(i||t)};static \u0275mod=lt({type:t});static \u0275inj=st({imports:[Rn]})}return t})(),mC=(()=>{class t{static withConfig(e){return{ngModule:t,providers:[{provide:Vr,useValue:e.warnOnNgModelWithFormControl??"always"},{provide:Ue,useValue:e.callSetDisabledState??zt}]}}static \u0275fac=function(i){return new(i||t)};static \u0275mod=lt({type:t});static \u0275inj=st({imports:[Rn]})}return t})();var bC=(()=>{class t{isErrorState(e,i){return!!(e&&e.invalid&&(e.touched||i&&i.submitted))}static \u0275fac=function(i){return new(i||t)};static \u0275prov=D({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var Un=class{_defaultMatcher;ngControl;_parentFormGroup;_parentForm;_stateChanges;errorState=!1;matcher;constructor(r,e,i,o,n){this._defaultMatcher=r,this.ngControl=e,this._parentFormGroup=i,this._parentForm=o,this._stateChanges=n}updateErrorState(){let r=this.errorState,e=this._parentFormGroup||this._parentForm,i=this.matcher||this._defaultMatcher,o=this.ngControl?this.ngControl.control:null,n=i?.isErrorState(o,e)??!1;n!==r&&(this.errorState=n,this._stateChanges.next())}};export{se as a,ze as b,tn as c,sr as d,pf as e,gf as f,c as g,Ur as h,ut as i,fr as j,Lr as k,Xo as l,US as m,tt as n,pn as o,$ as p,rn as q,X as r,lC as s,uC as t,de as u,cC as v,Wf as w,Ne as x,dC as y,qf as z,pC as A,zf as B,Zf as C,On as D,kn as E,Pn as F,td as G,id as H,nd as I,sd as J,ud as K,hC as L,gC as M,mC as N,bC as O,Un as P};
|