multimodalsim-viewer 0.1.0.0__py3-none-any.whl → 0.1.0.1__py3-none-any.whl
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.
- multimodalsim_viewer/server/data_manager.py +6 -1
- multimodalsim_viewer/ui/static/index.html +1 -1
- multimodalsim_viewer/ui/static/{main-EAYQBWLP.js → main-7DV4COXP.js} +3 -3
- {multimodalsim_viewer-0.1.0.0.dist-info → multimodalsim_viewer-0.1.0.1.dist-info}/METADATA +1 -1
- {multimodalsim_viewer-0.1.0.0.dist-info → multimodalsim_viewer-0.1.0.1.dist-info}/RECORD +8 -8
- {multimodalsim_viewer-0.1.0.0.dist-info → multimodalsim_viewer-0.1.0.1.dist-info}/WHEEL +0 -0
- {multimodalsim_viewer-0.1.0.0.dist-info → multimodalsim_viewer-0.1.0.1.dist-info}/entry_points.txt +0 -0
- {multimodalsim_viewer-0.1.0.0.dist-info → multimodalsim_viewer-0.1.0.1.dist-info}/top_level.txt +0 -0
@@ -1694,8 +1694,8 @@ void main(void)
|
|
1694
1694
|
gl_Position = filterVertexPosition();
|
1695
1695
|
vTextureCoord = filterTextureCoord();
|
1696
1696
|
}
|
1697
|
-
`;var YL=n$,n0=a$;var a0=class{constructor(e){this.renderer=e}contextChange(e){let t;if(this.renderer.context.webGLVersion===1){let r=e.getParameter(e.FRAMEBUFFER_BINDING);e.bindFramebuffer(e.FRAMEBUFFER,null),t=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.FRAMEBUFFER,r)}else{let r=e.getParameter(e.DRAW_FRAMEBUFFER_BINDING);e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),t=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,r)}t>=_r.HIGH?this.multisample=_r.HIGH:t>=_r.MEDIUM?this.multisample=_r.MEDIUM:t>=_r.LOW?this.multisample=_r.LOW:this.multisample=_r.NONE}destroy(){}};a0.extension={type:Xe.RendererSystem,name:"_multisample"};nt.add(a0);var qC=class{constructor(e){this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}};var o0=class{constructor(e){this.renderer=e,this.managedBuffers={},this.boundBufferBases={}}destroy(){this.renderer=null}contextChange(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(e){let{gl:t,CONTEXT_UID:r}=this,n=e._glBuffers[r]||this.createGLBuffer(e);t.bindBuffer(e.type,n.buffer)}unbind(e){let{gl:t}=this;t.bindBuffer(e,null)}bindBufferBase(e,t){let{gl:r,CONTEXT_UID:n}=this;if(this.boundBufferBases[t]!==e){let a=e._glBuffers[n]||this.createGLBuffer(e);this.boundBufferBases[t]=e,r.bindBufferBase(r.UNIFORM_BUFFER,t,a.buffer)}}bindBufferRange(e,t,r){let{gl:n,CONTEXT_UID:a}=this;r=r||0;let o=e._glBuffers[a]||this.createGLBuffer(e);n.bindBufferRange(n.UNIFORM_BUFFER,t||0,o.buffer,r*256,256)}update(e){let{gl:t,CONTEXT_UID:r}=this,n=e._glBuffers[r]||this.createGLBuffer(e);if(e._updateID!==n.updateID)if(n.updateID=e._updateID,t.bindBuffer(e.type,n.buffer),n.byteLength>=e.data.byteLength)t.bufferSubData(e.type,0,e.data);else{let a=e.static?t.STATIC_DRAW:t.DYNAMIC_DRAW;n.byteLength=e.data.byteLength,t.bufferData(e.type,e.data,a)}}dispose(e,t){if(!this.managedBuffers[e.id])return;delete this.managedBuffers[e.id];let r=e._glBuffers[this.CONTEXT_UID],n=this.gl;e.disposeRunner.remove(this),r&&(t||n.deleteBuffer(r.buffer),delete e._glBuffers[this.CONTEXT_UID])}disposeAll(e){let t=Object.keys(this.managedBuffers);for(let r=0;r<t.length;r++)this.dispose(this.managedBuffers[t[r]],e)}createGLBuffer(e){let{CONTEXT_UID:t,gl:r}=this;return e._glBuffers[t]=new qC(r.createBuffer()),this.managedBuffers[e.id]=e,e.disposeRunner.add(this),e._glBuffers[t]}};o0.extension={type:Xe.RendererSystem,name:"buffer"};nt.add(o0);var s0=class{constructor(e){this.renderer=e}render(e,t){let r=this.renderer,n,a,o,s;if(t&&(n=t.renderTexture,a=t.clear,o=t.transform,s=t.skipUpdateTransform),this.renderingToScreen=!n,r.runners.prerender.emit(),r.emit("prerender"),r.projection.transform=o,!r.context.isLost){if(n||(this.lastObjectRendered=e),!s){let l=e.enableTempParent();e.updateTransform(),e.disableTempParent(l)}r.renderTexture.bind(n),r.batch.currentRenderer.start(),(a??r.background.clearBeforeRender)&&r.renderTexture.clear(),e.render(r),r.batch.currentRenderer.flush(),n&&(t.blit&&r.framebuffer.blit(),n.baseTexture.update()),r.runners.postrender.emit(),r.projection.transform=null,r.emit("postrender")}}destroy(){this.renderer=null,this.lastObjectRendered=null}};s0.extension={type:Xe.RendererSystem,name:"objectRenderer"};nt.add(s0);var ZC=class JL extends Kg{constructor(e){super(),this.type=k2.WEBGL,e=Object.assign({},Qe.RENDER_OPTIONS,e),this.gl=null,this.CONTEXT_UID=0,this.globalUniforms=new co({projectionMatrix:new Ni},!0);let t={runners:["init","destroy","contextChange","resolutionChange","reset","update","postrender","prerender","resize"],systems:JL.__systems,priority:["_view","textureGenerator","background","_plugin","startup","context","state","texture","buffer","geometry","framebuffer","transformFeedback","mask","scissor","stencil","projection","textureGC","filter","renderTexture","batch","objectRenderer","_multisample"]};this.setup(t),"useContextAlpha"in e&&(yi("7.0.0","options.useContextAlpha is deprecated, use options.premultipliedAlpha and options.backgroundAlpha instead"),e.premultipliedAlpha=e.useContextAlpha&&e.useContextAlpha!=="notMultiplied",e.backgroundAlpha=e.useContextAlpha===!1?1:e.backgroundAlpha),this._plugin.rendererPlugins=JL.__plugins,this.options=e,this.startup.run(this.options)}static test(e){return e?.forceCanvas?!1:xC()}render(e,t){this.objectRenderer.render(e,t)}resize(e,t){this._view.resizeView(e,t)}reset(){return this.runners.reset.emit(),this}clear(){this.renderTexture.bind(),this.renderTexture.clear()}destroy(e=!1){this.runners.destroy.items.reverse(),this.emitWithCustomOptions(this.runners.destroy,{_view:e}),super.destroy()}get plugins(){return this._plugin.plugins}get multisample(){return this._multisample.multisample}get width(){return this._view.element.width}get height(){return this._view.element.height}get resolution(){return this._view.resolution}set resolution(e){this._view.resolution=e,this.runners.resolutionChange.emit(e)}get autoDensity(){return this._view.autoDensity}get view(){return this._view.element}get screen(){return this._view.screen}get lastObjectRendered(){return this.objectRenderer.lastObjectRendered}get renderingToScreen(){return this.objectRenderer.renderingToScreen}get rendererLogId(){return`WebGL ${this.context.webGLVersion}`}get clearBeforeRender(){return yi("7.0.0","renderer.clearBeforeRender has been deprecated, please use renderer.background.clearBeforeRender instead."),this.background.clearBeforeRender}get useContextAlpha(){return yi("7.0.0","renderer.useContextAlpha has been deprecated, please use renderer.context.premultipliedAlpha instead."),this.context.useContextAlpha}get preserveDrawingBuffer(){return yi("7.0.0","renderer.preserveDrawingBuffer has been deprecated, we cannot truly know this unless pixi created the context"),this.context.preserveDrawingBuffer}get backgroundColor(){return yi("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color}set backgroundColor(e){yi("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color=e}get backgroundAlpha(){return yi("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha}set backgroundAlpha(e){yi("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha=e}get powerPreference(){return yi("7.0.0","renderer.powerPreference has been deprecated, we can only know this if pixi creates the context"),this.context.powerPreference}generateTexture(e,t){return this.textureGenerator.generateTexture(e,t)}};ZC.extension={type:Xe.Renderer,priority:1},ZC.__plugins={},ZC.__systems={};var YC=ZC;nt.handleByMap(Xe.RendererPlugin,YC.__plugins);nt.handleByMap(Xe.RendererSystem,YC.__systems);nt.add(YC);var $h=class extends ss{constructor(e,t){let{width:r,height:n}=t||{};super(r,n),this.items=[],this.itemDirtyIds=[];for(let a=0;a<e;a++){let o=new Jt;this.items.push(o),this.itemDirtyIds.push(-2)}this.length=e,this._load=null,this.baseTexture=null}initFromArray(e,t){for(let r=0;r<this.length;r++)e[r]&&(e[r].castToBaseTexture?this.addBaseTextureAt(e[r].castToBaseTexture(),r):e[r]instanceof ss?this.addResourceAt(e[r],r):this.addResourceAt(wg(e[r],t),r))}dispose(){for(let e=0,t=this.length;e<t;e++)this.items[e].destroy();this.items=null,this.itemDirtyIds=null,this._load=null}addResourceAt(e,t){if(!this.items[t])throw new Error(`Index ${t} is out of bounds`);return e.valid&&!this.valid&&this.resize(e.width,e.height),this.items[t].setResource(e),this}bind(e){if(this.baseTexture!==null)throw new Error("Only one base texture per TextureArray is allowed");super.bind(e);for(let t=0;t<this.length;t++)this.items[t].parentTextureArray=e,this.items[t].on("update",e.update,e)}unbind(e){super.unbind(e);for(let t=0;t<this.length;t++)this.items[t].parentTextureArray=null,this.items[t].off("update",e.update,e)}load(){if(this._load)return this._load;let e=this.items.map(t=>t.resource).filter(t=>t).map(t=>t.load());return this._load=Promise.all(e).then(()=>{let{realWidth:t,realHeight:r}=this.items[0];return this.resize(t,r),this.update(),Promise.resolve(this)}),this._load}};var l0=class extends $h{constructor(e,t){let{width:r,height:n}=t||{},a,o;Array.isArray(e)?(a=e,o=e.length):o=e,super(o,{width:r,height:n}),a&&this.initFromArray(a,t)}addBaseTextureAt(e,t){if(e.resource)this.addResourceAt(e.resource,t);else throw new Error("ArrayResource does not support RenderTexture");return this}bind(e){super.bind(e),e.target=ku.TEXTURE_2D_ARRAY}upload(e,t,r){let{length:n,itemDirtyIds:a,items:o}=this,{gl:s}=e;r.dirtyId<0&&s.texImage3D(s.TEXTURE_2D_ARRAY,0,r.internalFormat,this._width,this._height,n,0,t.format,r.type,null);for(let l=0;l<n;l++){let c=o[l];a[l]<c.dirtyId&&(a[l]=c.dirtyId,c.valid&&s.texSubImage3D(s.TEXTURE_2D_ARRAY,0,0,0,l,c.resource.width,c.resource.height,1,t.format,r.type,c.resource.source))}return!0}};var c0=class extends Gn{constructor(e){super(e)}static test(e){let{OffscreenCanvas:t}=globalThis;return t&&e instanceof t?!0:globalThis.HTMLCanvasElement&&e instanceof HTMLCanvasElement}};var nBe=(()=>{let i=class u0 extends $h{constructor(t,r){let{width:n,height:a,autoLoad:o,linkBaseTexture:s}=r||{};if(t&&t.length!==u0.SIDES)throw new Error(`Invalid length. Got ${t.length}, expected 6`);super(6,{width:n,height:a});for(let l=0;l<u0.SIDES;l++)this.items[l].target=ku.TEXTURE_CUBE_MAP_POSITIVE_X+l;this.linkBaseTexture=s!==!1,t&&this.initFromArray(t,r),o!==!1&&this.load()}bind(t){super.bind(t),t.target=ku.TEXTURE_CUBE_MAP}addBaseTextureAt(t,r,n){if(n===void 0&&(n=this.linkBaseTexture),!this.items[r])throw new Error(`Index ${r} is out of bounds`);if(!this.linkBaseTexture||t.parentTextureArray||Object.keys(t._glTextures).length>0)if(t.resource)this.addResourceAt(t.resource,r);else throw new Error("CubeResource does not support copying of renderTexture.");else t.target=ku.TEXTURE_CUBE_MAP_POSITIVE_X+r,t.parentTextureArray=this.baseTexture,this.items[r]=t;return t.valid&&!this.valid&&this.resize(t.realWidth,t.realHeight),this.items[r]=t,this}upload(t,r,n){let a=this.itemDirtyIds;for(let o=0;o<u0.SIDES;o++){let s=this.items[o];(a[o]<s.dirtyId||n.dirtyId<r.dirtyId)&&(s.valid&&s.resource?(s.resource.upload(t,s,n),a[o]=s.dirtyId):a[o]<-1&&(t.gl.texImage2D(s.target,0,n.internalFormat,r.realWidth,r.realHeight,0,r.format,n.type,null),a[o]=-1))}return!0}static test(t){return Array.isArray(t)&&t.length===u0.SIDES}};return i.SIDES=6,i})(),$L=nBe;var h0=class i extends Gn{constructor(e,t){t=t||{};let r,n,a;typeof e=="string"?(r=i.EMPTY,n=e,a=!0):(r=e,n=null,a=!1),super(r),this.url=n,this.crossOrigin=t.crossOrigin??!0,this.alphaMode=typeof t.alphaMode=="number"?t.alphaMode:null,this.ownsImageBitmap=t.ownsImageBitmap??a,this._load=null,t.autoLoad!==!1&&this.load()}load(){return this._load?this._load:(this._load=new Promise((e,t)=>Ce(this,null,function*(){if(this.url===null){e(this);return}try{let r=yield Qe.ADAPTER.fetch(this.url,{mode:this.crossOrigin?"cors":"no-cors"});if(this.destroyed)return;let n=yield r.blob();if(this.destroyed)return;let a=yield createImageBitmap(n,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===an.UNPACK?"premultiply":"none"});if(this.destroyed){a.close();return}this.source=a,this.update(),e(this)}catch(r){if(this.destroyed)return;t(r),this.onError.emit(r)}})),this._load)}upload(e,t,r){return this.source instanceof ImageBitmap?(typeof this.alphaMode=="number"&&(t.alphaMode=this.alphaMode),super.upload(e,t,r)):(this.load(),!1)}dispose(){this.ownsImageBitmap&&this.source instanceof ImageBitmap&&this.source.close(),super.dispose(),this._load=null}static test(e){return!!globalThis.createImageBitmap&&typeof ImageBitmap<"u"&&(typeof e=="string"||e instanceof ImageBitmap)}static get EMPTY(){return i._EMPTY=i._EMPTY??Qe.ADAPTER.createCanvas(0,0),i._EMPTY}};var XL=class JC extends Gn{constructor(e,t){t=t||{},super(Qe.ADAPTER.createCanvas()),this._width=0,this._height=0,this.svg=e,this.scale=t.scale||1,this._overrideWidth=t.width,this._overrideHeight=t.height,this._resolve=null,this._crossorigin=t.crossorigin,this._load=null,t.autoLoad!==!1&&this.load()}load(){return this._load?this._load:(this._load=new Promise(e=>{if(this._resolve=()=>{this.update(),e(this)},JC.SVG_XML.test(this.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");this.svg=`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(this.svg)))}`}this._loadSvg()}),this._load)}_loadSvg(){let e=new Image;Gn.crossOrigin(e,this.svg,this._crossorigin),e.src=this.svg,e.onerror=t=>{this._resolve&&(e.onerror=null,this.onError.emit(t))},e.onload=()=>{if(!this._resolve)return;let t=e.width,r=e.height;if(!t||!r)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");let n=t*this.scale,a=r*this.scale;(this._overrideWidth||this._overrideHeight)&&(n=this._overrideWidth||this._overrideHeight/r*t,a=this._overrideHeight||this._overrideWidth/t*r),n=Math.round(n),a=Math.round(a);let o=this.source;o.width=n,o.height=a,o._pixiId=`canvas_${_c()}`,o.getContext("2d").drawImage(e,0,0,t,r,0,0,n,a),this._resolve(),this._resolve=null}}static getSize(e){let t=JC.SVG_SIZE.exec(e),r={};return t&&(r[t[1]]=Math.round(parseFloat(t[3])),r[t[5]]=Math.round(parseFloat(t[7]))),r}dispose(){super.dispose(),this._resolve=null,this._crossorigin=null}static test(e,t){return t==="svg"||typeof e=="string"&&e.startsWith("data:image/svg+xml")||typeof e=="string"&&JC.SVG_XML.test(e)}};XL.SVG_XML=/^(<\?xml[^?]+\?>)?\s*(<!--[^(-->)]*-->)?\s*\<svg/m,XL.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;var qg=XL;var $C=class extends Gn{constructor(e){super(e)}static test(e){return!!globalThis.VideoFrame&&e instanceof globalThis.VideoFrame}};var QL=class eI extends Gn{constructor(e,t){if(t=t||{},!(e instanceof HTMLVideoElement)){let r=document.createElement("video");t.autoLoad!==!1&&r.setAttribute("preload","auto"),t.playsinline!==!1&&(r.setAttribute("webkit-playsinline",""),r.setAttribute("playsinline","")),t.muted===!0&&(r.setAttribute("muted",""),r.muted=!0),t.loop===!0&&r.setAttribute("loop",""),t.autoPlay!==!1&&r.setAttribute("autoplay",""),typeof e=="string"&&(e=[e]);let n=e[0].src||e[0];Gn.crossOrigin(r,n,t.crossorigin);for(let a=0;a<e.length;++a){let o=document.createElement("source"),{src:s,mime:l}=e[a];if(s=s||e[a],s.startsWith("data:"))l=s.slice(5,s.indexOf(";"));else if(!s.startsWith("blob:")){let c=s.split("?").shift().toLowerCase(),u=c.slice(c.lastIndexOf(".")+1);l=l||eI.MIME_TYPES[u]||`video/${u}`}o.src=s,l&&(o.type=l),r.appendChild(o)}e=r}super(e),this.noSubImage=!0,this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=t.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=t.autoPlay!==!1,this._videoFrameRequestCallback=this._videoFrameRequestCallback.bind(this),this._videoFrameRequestCallbackHandle=null,this._load=null,this._resolve=null,this._reject=null,this._onCanPlay=this._onCanPlay.bind(this),this._onError=this._onError.bind(this),this._onPlayStart=this._onPlayStart.bind(this),this._onPlayStop=this._onPlayStop.bind(this),this._onSeeked=this._onSeeked.bind(this),t.autoLoad!==!1&&this.load()}update(e=0){if(!this.destroyed){if(this._updateFPS){let t=sn.shared.elapsedMS*this.source.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-t)}(!this._updateFPS||this._msToNextUpdate<=0)&&(super.update(),this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0)}}_videoFrameRequestCallback(){this.update(),this.destroyed?this._videoFrameRequestCallbackHandle=null:this._videoFrameRequestCallbackHandle=this.source.requestVideoFrameCallback(this._videoFrameRequestCallback)}load(){if(this._load)return this._load;let e=this.source;return(e.readyState===e.HAVE_ENOUGH_DATA||e.readyState===e.HAVE_FUTURE_DATA)&&e.width&&e.height&&(e.complete=!0),e.addEventListener("play",this._onPlayStart),e.addEventListener("pause",this._onPlayStop),e.addEventListener("seeked",this._onSeeked),this._isSourceReady()?this._onCanPlay():(e.addEventListener("canplay",this._onCanPlay),e.addEventListener("canplaythrough",this._onCanPlay),e.addEventListener("error",this._onError,!0)),this._load=new Promise((t,r)=>{this.valid?t(this):(this._resolve=t,this._reject=r,e.load())}),this._load}_onError(e){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(e),this._reject&&(this._reject(e),this._reject=null,this._resolve=null)}_isSourcePlaying(){let e=this.source;return!e.paused&&!e.ended}_isSourceReady(){return this.source.readyState>2}_onPlayStart(){this.valid||this._onCanPlay(),this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0)}_onCanPlay(){let e=this.source;e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay);let t=this.valid;this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0,!t&&this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&e.play()}dispose(){this._configureAutoUpdate();let e=this.source;e&&(e.removeEventListener("play",this._onPlayStart),e.removeEventListener("pause",this._onPlayStop),e.removeEventListener("seeked",this._onSeeked),e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay),e.removeEventListener("error",this._onError,!0),e.pause(),e.src="",e.load()),super.dispose()}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e!==this._autoUpdate&&(this._autoUpdate=e,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(e){e!==this._updateFPS&&(this._updateFPS=e,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.source.requestVideoFrameCallback?(this._isConnectedToTicker&&(sn.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),this._videoFrameRequestCallbackHandle===null&&(this._videoFrameRequestCallbackHandle=this.source.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._videoFrameRequestCallbackHandle!==null&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(sn.shared.add(this.update,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(sn.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(e,t){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement||eI.TYPES.includes(t)}};QL.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],QL.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};var d0=QL;Gv.push(h0,Nm,c0,d0,$C,qg,Ml,$L,l0);var o$=["vehicle","stop","passenger","all"],s$=["zoomed-in","zoomed-out","any"],l$=["circle","square","triangle","pentagon","hexagon","octagon","star","cross","diamond"],Zg=class i{VERSION=4;SPRITE_SIZE=40;BACKGROUND_SHAPE_SIZE=60;KEY_TEXTURES="multimodal.textures";DEFAULT_UNDEFINED_TEXTURE_URL="/images/undefined-texture.png";DEFAULT_VEHICLE_TEXTURE_URL="/images/vehicle.png";DEFAULT_PASSENGER_TEXTURE_URL="/images/passenger.png";DEFAULT_STOP_TEXTURE_URL="/images/stop.png";DEFAULT_ZOOMED_OUT_VEHICLE_TEXTURE_URL="/images/zoomed-out-vehicle.png";DEFAULT_ZOOMED_OUT_PASSENGER_TEXTURE_URL="/images/zoomed-out-passenger.png";DEFAULT_ZOOMED_OUT_STOP_TEXTURE_URL="/images/zoomed-out-stop.png";PRESET_LIGHT_COLOR_THEME=["#ccffcc","#ffffb3","#ffffb3","#ffb980","#ffb980","#ff3333","#ff3333"];PRESET_SATURATED_COLOR_THEME=["#00ff00","#ffff00","#ff8000","#ff0000"];VEHICLE_SPRITE_SCALE_FACTOR=1;PASSENGER_SPRITE_SCALE_FACTOR=.75;STOP_SPRITE_SCALE_FACTOR=.25;_useZoomedOutSprites=!1;_globalSpriteScale=1;_vehicleTexture=Ft.from(this.DEFAULT_VEHICLE_TEXTURE_URL);_passengerTexture=Ft.from(this.DEFAULT_PASSENGER_TEXTURE_URL);_stopTexture=Ft.from(this.DEFAULT_STOP_TEXTURE_URL);_zoomedOutVehicleTexture=Ft.from(this.DEFAULT_ZOOMED_OUT_VEHICLE_TEXTURE_URL);_zoomedOutPassengerTexture=Ft.from(this.DEFAULT_ZOOMED_OUT_PASSENGER_TEXTURE_URL);_zoomedOutStopTexture=Ft.from(this.DEFAULT_ZOOMED_OUT_STOP_TEXTURE_URL);_customTextures=[];_backgroundShapes=[];_colorPresetIndex=0;_customColors=["#00ff00","#ff0000"];_currentColorPreset=this.PRESET_LIGHT_COLOR_THEME;_textureMap=new Map;_customizationUpdatedSignal=Bt(0);get useZoomedOutSprites(){return this._useZoomedOutSprites}get vehicleSpriteScale(){return this.VEHICLE_SPRITE_SCALE_FACTOR*this._globalSpriteScale}get passengerSpriteScale(){return this.PASSENGER_SPRITE_SCALE_FACTOR*this._globalSpriteScale}get stopSpriteScale(){return this.STOP_SPRITE_SCALE_FACTOR*this._globalSpriteScale}get vehicleTexture(){return this._vehicleTexture}get passengerTexture(){return this._passengerTexture}get stopTexture(){return this._stopTexture}get zoomedOutVehicleTexture(){return this._zoomedOutVehicleTexture}get zoomedOutPassengerTexture(){return this._zoomedOutPassengerTexture}get zoomedOutStopTexture(){return this._zoomedOutStopTexture}get colorPresetIndex(){return this._colorPresetIndex}get customColors(){return this._customColors}get currentColorPreset(){return this._currentColorPreset}get customTextures(){return structuredClone(this._customTextures)}get backgroundShapes(){return structuredClone(this._backgroundShapes)}get customizationUpdatedSignal(){return this._customizationUpdatedSignal}constructor(){this.loadTexturesData()}calculateSpriteScales(e){let o=e.getMap(),s=15,l=o.getZoom(),c=s-l;this._useZoomedOutSprites=l<14;let u=Math.pow(1.5,-c);u=Math.min(Math.max(u,.2),1),this._globalSpriteScale=u/e.getScale()}saveTextureData(e,t,r,n,a,o,s,l,c,u){let h={version:this.VERSION,vehicleTextureUrl:e,passengerTextureUrl:t,stopTextureUrl:r,zoomedOutVehicleTextureUrl:n,zoomedOutPassengerTextureUrl:a,zoomedOutStopTextureUrl:o,customTextures:s,backgroundShapes:l,colorPresetIndex:c,customColors:u};localStorage.setItem(this.KEY_TEXTURES,JSON.stringify(h)),this.applyTexturesData(h)}getVehicleTexture(e,t){let r=this._useZoomedOutSprites?"zoomed-out":"zoomed-in",n=this._customTextures.find(o=>o.isActive&&["vehicle","all"].includes(o.type)&&[r,"any"].includes(o.zoom)&&o.tags.every(s=>t.includes(s))&&(o.mode===null||o.mode===e)),a=this._useZoomedOutSprites?this._zoomedOutVehicleTexture:this._vehicleTexture;return this._textureMap.get(n?.url??"")??a}getPassengerTexture(e){let t=this._useZoomedOutSprites?"zoomed-out":"zoomed-in",r=this._customTextures.find(a=>a.isActive&&["passenger","all"].includes(a.type)&&[t,"any"].includes(a.zoom)&&a.tags.every(o=>e.includes(o))),n=this._useZoomedOutSprites?this._zoomedOutPassengerTexture:this._passengerTexture;return this._textureMap.get(r?.url??"")??n}getStopTexture(e){let t=this._useZoomedOutSprites?"zoomed-out":"zoomed-in",r=this._customTextures.find(a=>a.isActive&&["stop","all"].includes(a.type)&&[t,"any"].includes(a.zoom)&&a.tags.every(o=>e.includes(o))),n=this._useZoomedOutSprites?this._zoomedOutStopTexture:this._stopTexture;return this._textureMap.get(r?.url??"")??n}drawVehicleBackgroundShape(e,t,r){let n=this._useZoomedOutSprites?"zoomed-out":"zoomed-in",a=this._backgroundShapes.find(o=>o.isActive&&["vehicle","all"].includes(o.type)&&[n,"any"].includes(o.zoom)&&o.tags.every(s=>r.includes(s))&&(o.mode===null||o.mode===t));if(!a){e.clear();return}this.drawShape(e,a.shape,a.color)}drawPassengerBackgroundShape(e,t){let r=this._useZoomedOutSprites?"zoomed-out":"zoomed-in",n=this._backgroundShapes.find(a=>a.isActive&&["passenger","all"].includes(a.type)&&[r,"any"].includes(a.zoom)&&a.tags.every(o=>t.includes(o)));if(!n){e.clear();return}this.drawShape(e,n.shape,n.color)}drawStopBackgroundShape(e,t){let r=this._useZoomedOutSprites?"zoomed-out":"zoomed-in",n=this._backgroundShapes.find(a=>a.isActive&&["stop","all"].includes(a.type)&&[r,"any"].includes(a.zoom)&&a.tags.every(o=>t.includes(o)));if(!n){e.clear();return}this.drawShape(e,n.shape,n.color)}loadTexturesData(){let e=localStorage.getItem(this.KEY_TEXTURES);if(!e)return;let t=JSON.parse(e);t.version===void 0||t.version!==this.VERSION||this.applyTexturesData(t)}applyTexturesData(e){this._vehicleTexture=Ft.from(e.vehicleTextureUrl),this._passengerTexture=Ft.from(e.passengerTextureUrl),this._stopTexture=Ft.from(e.stopTextureUrl),this._zoomedOutVehicleTexture=Ft.from(e.zoomedOutVehicleTextureUrl),this._zoomedOutPassengerTexture=Ft.from(e.zoomedOutPassengerTextureUrl),this._zoomedOutStopTexture=Ft.from(e.zoomedOutStopTextureUrl),this._colorPresetIndex=e.colorPresetIndex,this._customColors=e.customColors,this._colorPresetIndex===0&&(this._currentColorPreset=this.PRESET_LIGHT_COLOR_THEME),this._colorPresetIndex===1&&(this._currentColorPreset=this.PRESET_SATURATED_COLOR_THEME),this._colorPresetIndex===2&&e.customColors.length>=2&&(this._currentColorPreset=e.customColors),this._customTextures=e.customTextures;let t=Array.from(new Set(this._customTextures.map(r=>r.url)));this._textureMap.clear(),t.forEach(r=>{this._textureMap.set(r,Ft.from(r))}),this._backgroundShapes=structuredClone(e.backgroundShapes),this._customizationUpdatedSignal.update(r=>r+1)}drawShape(e,t,r){let n=this.BACKGROUND_SHAPE_SIZE;switch(e.clear(),e.beginFill(r),t){case"circle":e.drawCircle(0,0,n/2),e.scale.set(4/Math.PI);break;case"square":e.drawRect(-n/2,-n/2,n,n);break;case"triangle":e.drawPolygon(this.createPolygonCoordinates(3,n/2)),e.scale.set(1.5);break;case"pentagon":e.drawPolygon(this.createPolygonCoordinates(5,n/2)),e.scale.set(4/Math.PI);break;case"hexagon":e.drawPolygon(this.createPolygonCoordinates(6,n/2,0)),e.scale.set(4/Math.PI);break;case"octagon":e.drawPolygon(this.createPolygonCoordinates(8,n/2,360/16)),e.scale.set(4/Math.PI);break;case"star":{let a=n/2,o=a/2.5,s=this.createPolygonCoordinates(5,a,90),l=this.createPolygonCoordinates(5,o,126),c=[];for(let u=0;u<s.length;u+=2)c.push(l[u],l[u+1]),c.push(s[u],s[u+1]);e.drawPolygon(c),e.scale.set(1.8)}break;case"cross":e.drawRect(-n/2,-n/8,n,n/4),e.drawRect(-n/8,-n/2,n/4,n),e.rotation=Math.PI/4,e.scale.set(1.5);break;case"diamond":e.drawPolygon(this.createPolygonCoordinates(4,n/2)),e.scale.set(Math.SQRT2);break}e.endFill()}createPolygonCoordinates(e,t,r=90){let n=[];for(let a=0;a<e;a++){let o=(a*360/e-r)*(Math.PI/180),s=t*Math.cos(o),l=t*Math.sin(o);n.push(s,l)}return n}static \u0275fac=function(t){return new(t||i)};static \u0275prov=lt({token:i,factory:i.\u0275fac,providedIn:"root"})};var aBe=["mat-menu-item",""],oBe=[[["mat-icon"],["","matMenuItemIcon",""]],"*"],sBe=["mat-icon, [matMenuItemIcon]","*"];function lBe(i,e){i&1&&(Sr(),Z(0,"svg",2),Ge(1,"polygon",3),Q())}var cBe=["*"];function uBe(i,e){if(i&1){let t=vt();Z(0,"div",0),Le("click",function(){Ee(t);let n=Se();return Ae(n.closed.emit("click"))})("animationstart",function(n){Ee(t);let a=Se();return Ae(a._onAnimationStart(n.animationName))})("animationend",function(n){Ee(t);let a=Se();return Ae(a._onAnimationDone(n.animationName))})("animationcancel",function(n){Ee(t);let a=Se();return Ae(a._onAnimationDone(n.animationName))}),Z(1,"div",1),Ot(2),Q()()}if(i&2){let t=Se();dn(t._classList),gt("mat-menu-panel-animations-disabled",t._animationsDisabled)("mat-menu-panel-exit-animation",t._panelAnimationState==="void")("mat-menu-panel-animating",t._isAnimating),Re("id",t.panelId),Mt("aria-label",t.ariaLabel||null)("aria-labelledby",t.ariaLabelledby||null)("aria-describedby",t.ariaDescribedby||null)}}var iI=new et("MAT_MENU_PANEL"),Um=(()=>{class i{_elementRef=te(Et);_document=te(li);_focusMonitor=te(In);_parentMenu=te(iI,{optional:!0});_changeDetectorRef=te(_i);role="menuitem";disabled=!1;disableRipple=!1;_hovered=new ct;_focused=new ct;_highlighted=!1;_triggersSubmenu=!1;constructor(){te(ar).load(kn),this._parentMenu?.addItem?.(this)}focus(t,r){this._focusMonitor&&t?this._focusMonitor.focusVia(this._getHostElement(),t,r):this._getHostElement().focus(r),this._focused.next(this)}ngAfterViewInit(){this._focusMonitor&&this._focusMonitor.monitor(this._elementRef,!1)}ngOnDestroy(){this._focusMonitor&&this._focusMonitor.stopMonitoring(this._elementRef),this._parentMenu&&this._parentMenu.removeItem&&this._parentMenu.removeItem(this),this._hovered.complete(),this._focused.complete()}_getTabIndex(){return this.disabled?"-1":"0"}_getHostElement(){return this._elementRef.nativeElement}_checkDisabled(t){this.disabled&&(t.preventDefault(),t.stopPropagation())}_handleMouseEnter(){this._hovered.next(this)}getLabel(){let t=this._elementRef.nativeElement.cloneNode(!0),r=t.querySelectorAll("mat-icon, .material-icons");for(let n=0;n<r.length;n++)r[n].remove();return t.textContent?.trim()||""}_setHighlighted(t){this._highlighted=t,this._changeDetectorRef.markForCheck()}_setTriggersSubmenu(t){this._triggersSubmenu=t,this._changeDetectorRef.markForCheck()}_hasFocus(){return this._document&&this._document.activeElement===this._getHostElement()}static \u0275fac=function(r){return new(r||i)};static \u0275cmp=tt({type:i,selectors:[["","mat-menu-item",""]],hostAttrs:[1,"mat-mdc-menu-item","mat-focus-indicator"],hostVars:8,hostBindings:function(r,n){r&1&&Le("click",function(o){return n._checkDisabled(o)})("mouseenter",function(){return n._handleMouseEnter()}),r&2&&(Mt("role",n.role)("tabindex",n._getTabIndex())("aria-disabled",n.disabled)("disabled",n.disabled||null),gt("mat-mdc-menu-item-highlighted",n._highlighted)("mat-mdc-menu-item-submenu-trigger",n._triggersSubmenu))},inputs:{role:"role",disabled:[2,"disabled","disabled",st],disableRipple:[2,"disableRipple","disableRipple",st]},exportAs:["matMenuItem"],features:[si],attrs:aBe,ngContentSelectors:sBe,decls:5,vars:3,consts:[[1,"mat-mdc-menu-item-text"],["matRipple","",1,"mat-mdc-menu-ripple",3,"matRippleDisabled","matRippleTrigger"],["viewBox","0 0 5 10","focusable","false","aria-hidden","true",1,"mat-mdc-menu-submenu-icon"],["points","0,0 5,5 0,10"]],template:function(r,n){r&1&&(Pi(oBe),Ot(0),Z(1,"span",0),Ot(2,1),Q(),Ge(3,"div",1),je(4,lBe,2,0,":svg:svg",2)),r&2&&(oe(3),Re("matRippleDisabled",n.disableRipple||n.disabled)("matRippleTrigger",n._getHostElement()),oe(),Je(n._triggersSubmenu?4:-1))},dependencies:[Ya],encapsulation:2,changeDetection:0})}return i})();var hBe=new et("MatMenuContent");var dBe=new et("mat-menu-default-options",{providedIn:"root",factory:mBe});function mBe(){return{overlapTrigger:!1,xPosition:"after",yPosition:"below",backdropClass:"cdk-overlay-transparent-backdrop"}}var tI="_mat-menu-enter",XC="_mat-menu-exit",Xh=(()=>{class i{_elementRef=te(Et);_changeDetectorRef=te(_i);_injector=te(Ii);_keyManager;_xPosition;_yPosition;_firstItemFocusRef;_exitFallbackTimeout;_animationsDisabled;_allItems;_directDescendantItems=new jc;_classList={};_panelAnimationState="void";_animationDone=new ct;_isAnimating=!1;parentMenu;direction;overlayPanelClass;backdropClass;ariaLabel;ariaLabelledby;ariaDescribedby;get xPosition(){return this._xPosition}set xPosition(t){this._xPosition=t,this.setPositionClasses()}get yPosition(){return this._yPosition}set yPosition(t){this._yPosition=t,this.setPositionClasses()}templateRef;items;lazyContent;overlapTrigger;hasBackdrop;set panelClass(t){let r=this._previousPanelClass,n=ye({},this._classList);r&&r.length&&r.split(" ").forEach(a=>{n[a]=!1}),this._previousPanelClass=t,t&&t.length&&(t.split(" ").forEach(a=>{n[a]=!0}),this._elementRef.nativeElement.className=""),this._classList=n}_previousPanelClass;get classList(){return this.panelClass}set classList(t){this.panelClass=t}closed=new ut;close=this.closed;panelId=te(Di).getId("mat-menu-panel-");constructor(){let t=te(dBe);this.overlayPanelClass=t.overlayPanelClass||"",this._xPosition=t.xPosition,this._yPosition=t.yPosition,this.backdropClass=t.backdropClass,this.overlapTrigger=t.overlapTrigger,this.hasBackdrop=t.hasBackdrop,this._animationsDisabled=te(nr,{optional:!0})==="NoopAnimations"}ngOnInit(){this.setPositionClasses()}ngAfterContentInit(){this._updateDirectDescendants(),this._keyManager=new yh(this._directDescendantItems).withWrap().withTypeAhead().withHomeAndEnd(),this._keyManager.tabOut.subscribe(()=>this.closed.emit("tab")),this._directDescendantItems.changes.pipe(ur(this._directDescendantItems),Er(t=>vr(...t.map(r=>r._focused)))).subscribe(t=>this._keyManager.updateActiveItem(t)),this._directDescendantItems.changes.subscribe(t=>{let r=this._keyManager;if(this._panelAnimationState==="enter"&&r.activeItem?._hasFocus()){let n=t.toArray(),a=Math.max(0,Math.min(n.length-1,r.activeItemIndex||0));n[a]&&!n[a].disabled?r.setActiveItem(a):r.setNextItemActive()}})}ngOnDestroy(){this._keyManager?.destroy(),this._directDescendantItems.destroy(),this.closed.complete(),this._firstItemFocusRef?.destroy(),clearTimeout(this._exitFallbackTimeout)}_hovered(){return this._directDescendantItems.changes.pipe(ur(this._directDescendantItems),Er(r=>vr(...r.map(n=>n._hovered))))}addItem(t){}removeItem(t){}_handleKeydown(t){let r=t.keyCode,n=this._keyManager;switch(r){case 27:Hr(t)||(t.preventDefault(),this.closed.emit("keydown"));break;case 37:this.parentMenu&&this.direction==="ltr"&&this.closed.emit("keydown");break;case 39:this.parentMenu&&this.direction==="rtl"&&this.closed.emit("keydown");break;default:(r===38||r===40)&&n.setFocusOrigin("keyboard"),n.onKeydown(t);return}}focusFirstItem(t="program"){this._firstItemFocusRef?.destroy(),this._firstItemFocusRef=vn(()=>{let r=this._resolvePanel();if(!r||!r.contains(document.activeElement)){let n=this._keyManager;n.setFocusOrigin(t).setFirstItemActive(),!n.activeItem&&r&&r.focus()}},{injector:this._injector})}resetActiveItem(){this._keyManager.setActiveItem(-1)}setElevation(t){}setPositionClasses(t=this.xPosition,r=this.yPosition){this._classList=at(ye({},this._classList),{"mat-menu-before":t==="before","mat-menu-after":t==="after","mat-menu-above":r==="above","mat-menu-below":r==="below"}),this._changeDetectorRef.markForCheck()}_onAnimationDone(t){let r=t===XC;(r||t===tI)&&(r&&(clearTimeout(this._exitFallbackTimeout),this._exitFallbackTimeout=void 0),this._animationDone.next(r?"void":"enter"),this._isAnimating=!1)}_onAnimationStart(t){(t===tI||t===XC)&&(this._isAnimating=!0)}_setIsOpen(t){if(this._panelAnimationState=t?"enter":"void",t){if(this._keyManager.activeItemIndex===0){let r=this._resolvePanel();r&&(r.scrollTop=0)}}else this._animationsDisabled||(this._exitFallbackTimeout=setTimeout(()=>this._onAnimationDone(XC),200));this._animationsDisabled&&setTimeout(()=>{this._onAnimationDone(t?tI:XC)}),this._changeDetectorRef.markForCheck()}_updateDirectDescendants(){this._allItems.changes.pipe(ur(this._allItems)).subscribe(t=>{this._directDescendantItems.reset(t.filter(r=>r._parentMenu===this)),this._directDescendantItems.notifyOnChanges()})}_resolvePanel(){let t=null;return this._directDescendantItems.length&&(t=this._directDescendantItems.first._getHostElement().closest('[role="menu"]')),t}static \u0275fac=function(r){return new(r||i)};static \u0275cmp=tt({type:i,selectors:[["mat-menu"]],contentQueries:function(r,n,a){if(r&1&&(Ki(a,hBe,5),Ki(a,Um,5),Ki(a,Um,4)),r&2){let o;St(o=kt())&&(n.lazyContent=o.first),St(o=kt())&&(n._allItems=o),St(o=kt())&&(n.items=o)}},viewQuery:function(r,n){if(r&1&&di(Ta,5),r&2){let a;St(a=kt())&&(n.templateRef=a.first)}},hostVars:3,hostBindings:function(r,n){r&2&&Mt("aria-label",null)("aria-labelledby",null)("aria-describedby",null)},inputs:{backdropClass:"backdropClass",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],xPosition:"xPosition",yPosition:"yPosition",overlapTrigger:[2,"overlapTrigger","overlapTrigger",st],hasBackdrop:[2,"hasBackdrop","hasBackdrop",t=>t==null?null:st(t)],panelClass:[0,"class","panelClass"],classList:"classList"},outputs:{closed:"closed",close:"close"},exportAs:["matMenu"],features:[ei([{provide:iI,useExisting:i}]),si],ngContentSelectors:cBe,decls:1,vars:0,consts:[["tabindex","-1","role","menu",1,"mat-mdc-menu-panel",3,"click","animationstart","animationend","animationcancel","id"],[1,"mat-mdc-menu-content"]],template:function(r,n){r&1&&(Pi(),je(0,uBe,3,12,"ng-template"))},styles:['mat-menu{display:none}.mat-mdc-menu-content{margin:0;padding:8px 0;outline:0}.mat-mdc-menu-content,.mat-mdc-menu-content .mat-mdc-menu-item .mat-mdc-menu-item-text{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;flex:1;white-space:normal;font-family:var(--mat-menu-item-label-text-font, var(--mat-sys-label-large-font));line-height:var(--mat-menu-item-label-text-line-height, var(--mat-sys-label-large-line-height));font-size:var(--mat-menu-item-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mat-menu-item-label-text-tracking, var(--mat-sys-label-large-tracking));font-weight:var(--mat-menu-item-label-text-weight, var(--mat-sys-label-large-weight))}@keyframes _mat-menu-enter{from{opacity:0;transform:scale(0.8)}to{opacity:1;transform:none}}@keyframes _mat-menu-exit{from{opacity:1}to{opacity:0}}.mat-mdc-menu-panel{min-width:112px;max-width:280px;overflow:auto;box-sizing:border-box;outline:0;animation:_mat-menu-enter 120ms cubic-bezier(0, 0, 0.2, 1);border-radius:var(--mat-menu-container-shape, var(--mat-sys-corner-extra-small));background-color:var(--mat-menu-container-color, var(--mat-sys-surface-container));box-shadow:var(--mat-menu-container-elevation-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12));will-change:transform,opacity}.mat-mdc-menu-panel.mat-menu-panel-exit-animation{animation:_mat-menu-exit 100ms 25ms linear forwards}.mat-mdc-menu-panel.mat-menu-panel-animations-disabled{animation:none}.mat-mdc-menu-panel.mat-menu-panel-animating{pointer-events:none}.mat-mdc-menu-panel.mat-menu-panel-animating:has(.mat-mdc-menu-content:empty){display:none}@media(forced-colors: active){.mat-mdc-menu-panel{outline:solid 1px}}.mat-mdc-menu-panel .mat-divider{color:var(--mat-menu-divider-color, var(--mat-sys-surface-variant));margin-bottom:var(--mat-menu-divider-bottom-spacing, 8px);margin-top:var(--mat-menu-divider-top-spacing, 8px)}.mat-mdc-menu-item{display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;padding:0;cursor:pointer;width:100%;text-align:left;box-sizing:border-box;color:inherit;font-size:inherit;background:none;text-decoration:none;margin:0;min-height:48px;padding-left:var(--mat-menu-item-leading-spacing, 12px);padding-right:var(--mat-menu-item-trailing-spacing, 12px);-webkit-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-menu-item::-moz-focus-inner{border:0}[dir=rtl] .mat-mdc-menu-item{padding-left:var(--mat-menu-item-trailing-spacing, 12px);padding-right:var(--mat-menu-item-leading-spacing, 12px)}.mat-mdc-menu-item:has(.material-icons,mat-icon,[matButtonIcon]){padding-left:var(--mat-menu-item-with-icon-leading-spacing, 12px);padding-right:var(--mat-menu-item-with-icon-trailing-spacing, 12px)}[dir=rtl] .mat-mdc-menu-item:has(.material-icons,mat-icon,[matButtonIcon]){padding-left:var(--mat-menu-item-with-icon-trailing-spacing, 12px);padding-right:var(--mat-menu-item-with-icon-leading-spacing, 12px)}.mat-mdc-menu-item,.mat-mdc-menu-item:visited,.mat-mdc-menu-item:link{color:var(--mat-menu-item-label-text-color, var(--mat-sys-on-surface))}.mat-mdc-menu-item .mat-icon-no-color,.mat-mdc-menu-item .mat-mdc-menu-submenu-icon{color:var(--mat-menu-item-icon-color, var(--mat-sys-on-surface-variant))}.mat-mdc-menu-item[disabled]{cursor:default;opacity:.38}.mat-mdc-menu-item[disabled]::after{display:block;position:absolute;content:"";top:0;left:0;bottom:0;right:0}.mat-mdc-menu-item:focus{outline:0}.mat-mdc-menu-item .mat-icon{flex-shrink:0;margin-right:var(--mat-menu-item-spacing, 12px);height:var(--mat-menu-item-icon-size, 24px);width:var(--mat-menu-item-icon-size, 24px)}[dir=rtl] .mat-mdc-menu-item{text-align:right}[dir=rtl] .mat-mdc-menu-item .mat-icon{margin-right:0;margin-left:var(--mat-menu-item-spacing, 12px)}.mat-mdc-menu-item:not([disabled]):hover{background-color:var(--mat-menu-item-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))}.mat-mdc-menu-item:not([disabled]).cdk-program-focused,.mat-mdc-menu-item:not([disabled]).cdk-keyboard-focused,.mat-mdc-menu-item:not([disabled]).mat-mdc-menu-item-highlighted{background-color:var(--mat-menu-item-focus-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-focus-state-layer-opacity) * 100%), transparent))}@media(forced-colors: active){.mat-mdc-menu-item{margin-top:1px}}.mat-mdc-menu-submenu-icon{width:var(--mat-menu-item-icon-size, 24px);height:10px;fill:currentColor;padding-left:var(--mat-menu-item-spacing, 12px)}[dir=rtl] .mat-mdc-menu-submenu-icon{padding-right:var(--mat-menu-item-spacing, 12px);padding-left:0}[dir=rtl] .mat-mdc-menu-submenu-icon polygon{transform:scaleX(-1);transform-origin:center}@media(forced-colors: active){.mat-mdc-menu-submenu-icon{fill:CanvasText}}.mat-mdc-menu-item .mat-mdc-menu-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}'],encapsulation:2,changeDetection:0})}return i})(),h$=new et("mat-menu-scroll-strategy",{providedIn:"root",factory:()=>{let i=te(Rr);return()=>i.scrollStrategies.reposition()}});function pBe(i){return()=>i.scrollStrategies.reposition()}var fBe={provide:h$,deps:[Rr],useFactory:pBe},u$=ca({passive:!0});var m0=new WeakMap,QC=(()=>{class i{_overlay=te(Rr);_element=te(Et);_viewContainerRef=te(sa);_menuItemInstance=te(Um,{optional:!0,self:!0});_dir=te(Pr,{optional:!0});_focusMonitor=te(In);_ngZone=te(Kt);_scrollStrategy=te(h$);_changeDetectorRef=te(_i);_portal;_overlayRef=null;_menuOpen=!1;_closingActionsSubscription=tr.EMPTY;_hoverSubscription=tr.EMPTY;_menuCloseSubscription=tr.EMPTY;_pendingRemoval;_parentMaterialMenu;_parentInnerPadding;_handleTouchStart=t=>{im(t)||(this._openedBy="touch")};_openedBy=void 0;get _deprecatedMatMenuTriggerFor(){return this.menu}set _deprecatedMatMenuTriggerFor(t){this.menu=t}get menu(){return this._menu}set menu(t){t!==this._menu&&(this._menu=t,this._menuCloseSubscription.unsubscribe(),t&&(this._parentMaterialMenu,this._menuCloseSubscription=t.close.subscribe(r=>{this._destroyMenu(r),(r==="click"||r==="tab")&&this._parentMaterialMenu&&this._parentMaterialMenu.closed.emit(r)})),this._menuItemInstance?._setTriggersSubmenu(this.triggersSubmenu()))}_menu;menuData;restoreFocus=!0;menuOpened=new ut;onMenuOpen=this.menuOpened;menuClosed=new ut;onMenuClose=this.menuClosed;constructor(){let t=te(iI,{optional:!0});this._parentMaterialMenu=t instanceof Xh?t:void 0,this._element.nativeElement.addEventListener("touchstart",this._handleTouchStart,u$)}ngAfterContentInit(){this._handleHover()}ngOnDestroy(){this.menu&&this._ownsMenu(this.menu)&&m0.delete(this.menu),this._element.nativeElement.removeEventListener("touchstart",this._handleTouchStart,u$),this._pendingRemoval?.unsubscribe(),this._menuCloseSubscription.unsubscribe(),this._closingActionsSubscription.unsubscribe(),this._hoverSubscription.unsubscribe(),this._overlayRef&&(this._overlayRef.dispose(),this._overlayRef=null)}get menuOpen(){return this._menuOpen}get dir(){return this._dir&&this._dir.value==="rtl"?"rtl":"ltr"}triggersSubmenu(){return!!(this._menuItemInstance&&this._parentMaterialMenu&&this.menu)}toggleMenu(){return this._menuOpen?this.closeMenu():this.openMenu()}openMenu(){let t=this.menu;if(this._menuOpen||!t)return;this._pendingRemoval?.unsubscribe();let r=m0.get(t);m0.set(t,this),r&&r!==this&&r.closeMenu();let n=this._createOverlay(t),a=n.getConfig(),o=a.positionStrategy;this._setPosition(t,o),a.hasBackdrop=t.hasBackdrop==null?!this.triggersSubmenu():t.hasBackdrop,n.hasAttached()||(n.attach(this._getPortal(t)),t.lazyContent?.attach(this.menuData)),this._closingActionsSubscription=this._menuClosingActions().subscribe(()=>this.closeMenu()),t.parentMenu=this.triggersSubmenu()?this._parentMaterialMenu:void 0,t.direction=this.dir,t.focusFirstItem(this._openedBy||"program"),this._setIsMenuOpen(!0),t instanceof Xh&&(t._setIsOpen(!0),t._directDescendantItems.changes.pipe(gi(t.close)).subscribe(()=>{o.withLockedPosition(!1).reapplyLastPosition(),o.withLockedPosition(!0)}))}closeMenu(){this.menu?.close.emit()}focus(t,r){this._focusMonitor&&t?this._focusMonitor.focusVia(this._element,t,r):this._element.nativeElement.focus(r)}updatePosition(){this._overlayRef?.updatePosition()}_destroyMenu(t){let r=this._overlayRef,n=this._menu;!r||!this.menuOpen||(this._closingActionsSubscription.unsubscribe(),this._pendingRemoval?.unsubscribe(),n instanceof Xh&&this._ownsMenu(n)?(this._pendingRemoval=n._animationDone.pipe(Ir(1)).subscribe(()=>{r.detach(),n.lazyContent?.detach()}),n._setIsOpen(!1)):(r.detach(),n?.lazyContent?.detach()),n&&this._ownsMenu(n)&&m0.delete(n),this.restoreFocus&&(t==="keydown"||!this._openedBy||!this.triggersSubmenu())&&this.focus(this._openedBy),this._openedBy=void 0,this._setIsMenuOpen(!1))}_setIsMenuOpen(t){t!==this._menuOpen&&(this._menuOpen=t,this._menuOpen?this.menuOpened.emit():this.menuClosed.emit(),this.triggersSubmenu()&&this._menuItemInstance._setHighlighted(t),this._changeDetectorRef.markForCheck())}_createOverlay(t){if(!this._overlayRef){let r=this._getOverlayConfig(t);this._subscribeToPositions(t,r.positionStrategy),this._overlayRef=this._overlay.create(r),this._overlayRef.keydownEvents().subscribe(n=>{this.menu instanceof Xh&&this.menu._handleKeydown(n)})}return this._overlayRef}_getOverlayConfig(t){return new Ds({positionStrategy:this._overlay.position().flexibleConnectedTo(this._element).withLockedPosition().withGrowAfterOpen().withTransformOriginOn(".mat-menu-panel, .mat-mdc-menu-panel"),backdropClass:t.backdropClass||"cdk-overlay-transparent-backdrop",panelClass:t.overlayPanelClass,scrollStrategy:this._scrollStrategy(),direction:this._dir||"ltr"})}_subscribeToPositions(t,r){t.setPositionClasses&&r.positionChanges.subscribe(n=>{this._ngZone.run(()=>{let a=n.connectionPair.overlayX==="start"?"after":"before",o=n.connectionPair.overlayY==="top"?"below":"above";t.setPositionClasses(a,o)})})}_setPosition(t,r){let[n,a]=t.xPosition==="before"?["end","start"]:["start","end"],[o,s]=t.yPosition==="above"?["bottom","top"]:["top","bottom"],[l,c]=[o,s],[u,h]=[n,a],d=0;if(this.triggersSubmenu()){if(h=n=t.xPosition==="before"?"start":"end",a=u=n==="end"?"start":"end",this._parentMaterialMenu){if(this._parentInnerPadding==null){let p=this._parentMaterialMenu.items.first;this._parentInnerPadding=p?p._getHostElement().offsetTop:0}d=o==="bottom"?this._parentInnerPadding:-this._parentInnerPadding}}else t.overlapTrigger||(l=o==="top"?"bottom":"top",c=s==="top"?"bottom":"top");r.withPositions([{originX:n,originY:l,overlayX:u,overlayY:o,offsetY:d},{originX:a,originY:l,overlayX:h,overlayY:o,offsetY:d},{originX:n,originY:c,overlayX:u,overlayY:s,offsetY:-d},{originX:a,originY:c,overlayX:h,overlayY:s,offsetY:-d}])}_menuClosingActions(){let t=this._overlayRef.backdropClick(),r=this._overlayRef.detachments(),n=this._parentMaterialMenu?this._parentMaterialMenu.closed:Qt(),a=this._parentMaterialMenu?this._parentMaterialMenu._hovered().pipe(Yi(o=>this._menuOpen&&o!==this._menuItemInstance)):Qt();return vr(t,n,a,r)}_handleMousedown(t){tm(t)||(this._openedBy=t.button===0?"mouse":void 0,this.triggersSubmenu()&&t.preventDefault())}_handleKeydown(t){let r=t.keyCode;(r===13||r===32)&&(this._openedBy="keyboard"),this.triggersSubmenu()&&(r===39&&this.dir==="ltr"||r===37&&this.dir==="rtl")&&(this._openedBy="keyboard",this.openMenu())}_handleClick(t){this.triggersSubmenu()?(t.stopPropagation(),this.openMenu()):this.toggleMenu()}_handleHover(){this.triggersSubmenu()&&this._parentMaterialMenu&&(this._hoverSubscription=this._parentMaterialMenu._hovered().subscribe(t=>{t===this._menuItemInstance&&!t.disabled&&(this._openedBy="mouse",this.openMenu())}))}_getPortal(t){return(!this._portal||this._portal.templateRef!==t.templateRef)&&(this._portal=new Xa(t.templateRef,this._viewContainerRef)),this._portal}_ownsMenu(t){return m0.get(t)===this}static \u0275fac=function(r){return new(r||i)};static \u0275dir=ft({type:i,selectors:[["","mat-menu-trigger-for",""],["","matMenuTriggerFor",""]],hostAttrs:[1,"mat-mdc-menu-trigger"],hostVars:3,hostBindings:function(r,n){r&1&&Le("click",function(o){return n._handleClick(o)})("mousedown",function(o){return n._handleMousedown(o)})("keydown",function(o){return n._handleKeydown(o)}),r&2&&Mt("aria-haspopup",n.menu?"menu":null)("aria-expanded",n.menuOpen)("aria-controls",n.menuOpen?n.menu.panelId:null)},inputs:{_deprecatedMatMenuTriggerFor:[0,"mat-menu-trigger-for","_deprecatedMatMenuTriggerFor"],menu:[0,"matMenuTriggerFor","menu"],menuData:[0,"matMenuTriggerData","menuData"],restoreFocus:[0,"matMenuTriggerRestoreFocus","restoreFocus"]},outputs:{menuOpened:"menuOpened",onMenuOpen:"onMenuOpen",menuClosed:"menuClosed",onMenuClose:"onMenuClose"},exportAs:["matMenuTrigger"]})}return i})(),eM=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275mod=Lt({type:i});static \u0275inj=Dt({providers:[fBe],imports:[Ko,ti,Uo,pl,ti]})}return i})(),d$={transformMenu:Cs("transformMenu",[Ms("void",mn({opacity:0,transform:"scale(0.8)"})),Ba("void => enter",Pa("120ms cubic-bezier(0, 0, 0.2, 1)",mn({opacity:1,transform:"scale(1)"}))),Ba("* => void",Pa("100ms 25ms linear",mn({opacity:0})))]),fadeInItems:Cs("fadeInItems",[Ms("showing",mn({opacity:1})),Ba("void => *",[mn({opacity:0}),Pa("400ms 100ms cubic-bezier(0.55, 0, 0.55, 0.2)")])])},N_t=d$.fadeInItems,G_t=d$.transformMenu;var gBe=i=>({shape:i});function yBe(i,e){i&1&&Od(0)}function _Be(i,e){i&1&&Od(0)}function bBe(i,e){if(i&1){let t=vt();Z(0,"button",6),Le("click",function(){let n=Ee(t).$implicit,a=Se();return Ae(a.shapeOutputEmitter.emit(n))}),je(1,_Be,1,0,"ng-container",3),Q()}if(i&2){let t=e.$implicit;Se();let r=Or(8);oe(),Re("ngTemplateOutlet",r)("ngTemplateOutletContext",mP(2,gBe,t))}}function vBe(i,e){i&1&&(Sr(),Ge(0,"circle",8))}function SBe(i,e){i&1&&(Sr(),Ge(0,"rect",9))}function kBe(i,e){i&1&&(Sr(),Ge(0,"polygon",10))}function xBe(i,e){i&1&&(Sr(),Ge(0,"polygon",11))}function wBe(i,e){i&1&&(Sr(),Ge(0,"polygon",12))}function CBe(i,e){i&1&&(Sr(),Ge(0,"polygon",13))}function MBe(i,e){i&1&&(Sr(),Ge(0,"polygon",14))}function TBe(i,e){i&1&&(Sr(),Ge(0,"rect",16)(1,"rect",17))}function EBe(i,e){i&1&&(Sr(),Ge(0,"polygon",15))}function ABe(i,e){if(i&1&&(Sr(),Z(0,"svg",7),je(1,vBe,1,0,":svg:circle",8)(2,SBe,1,0,":svg:rect",9)(3,kBe,1,0,":svg:polygon",10)(4,xBe,1,0,":svg:polygon",11)(5,wBe,1,0,":svg:polygon",12)(6,CBe,1,0,":svg:polygon",13)(7,MBe,1,0,":svg:polygon",14)(8,TBe,2,0)(9,EBe,1,0,":svg:polygon",15),Q()),i&2){let t,r=e.shape;Se();let n=fi(0);Mt("fill",n.color),oe(),Je((t=r)==="circle"?1:t==="square"?2:t==="triangle"?3:t==="pentagon"?4:t==="hexagon"?5:t==="octagon"?6:t==="star"?7:t==="cross"?8:t==="diamond"?9:-1)}}var tM=class i{BACKGROUND_SHAPE_TYPES=l$;backgroundShapeInputSignal=sl.required({alias:"backgroundShape"});shapeOutputEmitter=Uc({alias:"shapeChange"});static \u0275fac=function(t){return new(t||i)};static \u0275cmp=tt({type:i,selectors:[["app-background-shape"]],inputs:{backgroundShapeInputSignal:[1,"backgroundShape","backgroundShapeInputSignal"]},outputs:{shapeOutputEmitter:"shapeChange"},decls:9,vars:4,consts:[["shapeMenu","matMenu"],["shape",""],[1,"select-shape","flex-row","align-cross-center",3,"matMenuTriggerFor"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"shape-menu"],["mat-menu-item",""],["mat-menu-item","",3,"click"],["width","40px","height","40px","viewBox","0 0 40 40"],["cx","20","cy","20","r","20"],["x","0","y","0","width","40","height","40"],["points","19.999999999999996,0 37.32050807568878,29.999999999999986 2.679491924311222,29.999999999999996 "],["points","19.999999999999996,0 39.02113032590307,13.819660112501047 31.755705045849467,36.180339887498945 8.244294954150542,36.18033988749895 0.9788696740969272,13.819660112501058 "],["points","40,20 30,37.32050807568877 10.000000000000004,37.32050807568878 0,20.000000000000004 9.999999999999991,2.6794919243112325 30,2.679491924311229 "],["points","38.477590650225736,27.653668647301796 27.653668647301796,38.477590650225736 12.346331352698206,38.477590650225736 1.5224093497742643,27.6536686473018 1.5224093497742643,12.346331352698208 12.346331352698193,1.5224093497742714 27.6536686473018,1.522409349774268 38.47759065022573,12.346331352698192 "],["points","19.999999999999996,0 24.702282018339783,13.52786404500042 39.02113032590307,13.819660112501047 27.60845213036123,22.472135954999576 31.755705045849467,36.180339887498945 20.000000000000004,28 8.244294954150542,36.18033988749895 12.391547869638773,22.472135954999583 0.9788696740969272,13.819660112501058 15.297717981660213,13.527864045000422 "],["points","20,0 40,20 20,40 0,20"],["x","15","y","0","width","10","height","40",1,"rotate"],["x","0","y","15","width","40","height","10",1,"rotate"]],template:function(t,r){if(t&1&&(Ri(0),Z(1,"div",2),je(2,yBe,1,0,"ng-container",3),Q(),Z(3,"mat-menu",4,0),ui(5,bBe,2,4,"button",5,Ea),Q(),je(7,ABe,10,2,"ng-template",null,1,Gp)),t&2){let n=Or(4),a=Or(8),o=hr(r.backgroundShapeInputSignal());oe(),Re("matMenuTriggerFor",n),oe(),Re("ngTemplateOutlet",a)("ngTemplateOutletContext",o),oe(3),hi(r.BACKGROUND_SHAPE_TYPES)}},dependencies:[Wp,eM,Xh,Um,QC],styles:[".flex-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.flex-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.align-center[_ngcontent-%COMP%], .align-main-center[_ngcontent-%COMP%]{justify-content:center}.align-center[_ngcontent-%COMP%], .align-cross-center[_ngcontent-%COMP%]{align-items:center}.align-main-end[_ngcontent-%COMP%]{justify-content:flex-end}.align-cross-end[_ngcontent-%COMP%]{align-items:flex-end}.align-main-start[_ngcontent-%COMP%]{justify-content:flex-start}.align-cross-start[_ngcontent-%COMP%]{align-items:flex-start}.align-cross-stretch[_ngcontent-%COMP%]{align-items:stretch}.gap-0-5-rem[_ngcontent-%COMP%]{gap:.5rem}.gap-1-rem[_ngcontent-%COMP%]{gap:1rem}.gap-1-5-rem[_ngcontent-%COMP%]{gap:1.5rem}.flex-1[_ngcontent-%COMP%]{flex:1}.select-shape[_ngcontent-%COMP%]{cursor:pointer}.rotate[_ngcontent-%COMP%]{transform:translate(20px,-10px) rotate(45deg)} .shape-menu .mat-mdc-menu-content{--menu-item-width: 40px;--menu-item-height: 40px;--menu-item-padding: 8px;--max-number-of-items: 3;--menu-gap: .5rem;display:flex;flex-direction:row;flex-wrap:wrap;gap:var(--menu-gap);padding:1rem;max-width:calc(var(--max-number-of-items) * (var(--menu-item-width) + 2 * var(--menu-item-padding)) + (var(--max-number-of-items) - 1) * var(--menu-gap))} .shape-menu .mat-mdc-menu-content>button{box-sizing:content-box;min-width:var(--menu-item-width);max-width:var(--menu-item-width);min-height:var(--menu-item-height);max-height:var(--menu-item-height);padding:var(--menu-item-padding)} .shape-menu .mat-mdc-menu-content>button>span{max-width:var(--menu-item-width);max-height:var(--menu-item-height)}"]})};var PBe=["iconFileUpload"];function BBe(i,e){if(i&1&&(Z(0,"mat-error"),ce(1),Q()),i&2){let t=Se();oe(),Ti(t.currentError)}}function RBe(i,e){i&1&&(Z(0,"div",9)(1,"p"),ce(2,"No background shapes added yet."),Q()())}function DBe(i,e){i&1&&Ge(0,"div",43)}function LBe(i,e){if(i&1&&(Z(0,"div",40),Ge(1,"div",41)(2,"div",42),Z(3,"div",30)(4,"div",31),Ge(5,"div",43)(6,"div",43),je(7,DBe,1,0,"div",43),Q(),Z(8,"div",31),Ge(9,"div",43),Q()(),Ge(10,"div",42),Q()),i&2){let t=Se().$implicit;oe(7),Je(t.type==="vehicle"?7:-1)}}function IBe(i,e){if(i&1&&(Z(0,"mat-option",15),ce(1),Vr(2,"titlecase"),Q()),i&2){let t=e.$implicit;Re("value",t),oe(),_t(" ",En(2,2,t.replaceAll("-"," "))," ")}}function FBe(i,e){if(i&1&&(Z(0,"mat-option",15),ce(1),Vr(2,"titlecase"),Q()),i&2){let t=e.$implicit;Re("value",t),oe(),_t(" ",En(2,2,t.replaceAll("-"," "))," ")}}function OBe(i,e){if(i&1){let t=vt();Z(0,"mat-form-field",32)(1,"mat-label"),ce(2,"Vehicle Mode"),Q(),Z(3,"input",44),mh("ngModelChange",function(n){Ee(t);let a=Se().$implicit;return dh(a.mode,n)||(a.mode=n),Ae(n)}),Q()()}if(i&2){let t=Se().$implicit;oe(3),hh("ngModel",t.mode)}}function zBe(i,e){if(i&1){let t=vt();Z(0,"mat-chip-row",45),Le("removed",function(){let n=Ee(t).$implicit,a=Se().$index,o=Se();return Ae(o.removeTagFromBackgroundShape(a,n))})("edited",function(n){let a=Ee(t).$implicit,o=Se().$index,s=Se();return Ae(s.editTagInBackgroundShape(o,a,n))}),ce(1),Z(2,"button",46)(3,"mat-icon"),ce(4,"cancel"),Q()()()}if(i&2){let t=e.$implicit;Re("aria-description","press enter to edit "+t)("editable",!0),oe(),_t(" ",t," "),oe(),Mt("aria-label","remove "+t)}}function HBe(i,e){if(i&1){let t=vt();Z(0,"div",11),je(1,LBe,11,1,"div",26),Z(2,"div",27)(3,"app-background-shape",28),Le("shapeChange",function(n){let a=Ee(t).$index,o=Se();return Ae(o.onBackgroundShapeTypeChange(a,n))}),Q()(),Z(4,"input",29),Le("input",function(n){let a=Ee(t).$index,o=Se();return Ae(o.onBackgroundShapeColorChange(a,n))}),Q(),Z(5,"div",30)(6,"div",31)(7,"mat-form-field",32)(8,"mat-label"),ce(9,"Type"),Q(),Z(10,"mat-select",33),mh("valueChange",function(n){let a=Ee(t).$implicit;return dh(a.type,n)||(a.type=n),Ae(n)}),ui(11,IBe,3,4,"mat-option",15,_o),Q()(),Z(13,"mat-form-field",32)(14,"mat-label"),ce(15,"Zoom"),Q(),Z(16,"mat-select",33),mh("valueChange",function(n){let a=Ee(t).$implicit;return dh(a.zoom,n)||(a.zoom=n),Ae(n)}),ui(17,FBe,3,4,"mat-option",15,_o),Q()(),je(19,OBe,4,1,"mat-form-field",32),Q(),Z(20,"div",31)(21,"mat-form-field",32)(22,"mat-label"),ce(23,"Tags"),Q(),Z(24,"mat-chip-grid",34,2),ui(26,zBe,5,4,"mat-chip-row",35,Ea),Z(28,"input",36),Le("matChipInputTokenEnd",function(n){let a=Ee(t).$index,o=Se();return Ae(o.addTagToBackgroundShape(a,n))}),Q()(),Z(29,"mat-hint"),ce(30," If multiple tags are selected, the shape will be used for entities that have all of them. "),Q()()()(),Z(31,"div",37)(32,"button",38),Le("click",function(){let n=Ee(t).$index,a=Se();return Ae(a.duplicateBackgroundShape(n))}),Z(33,"mat-icon"),ce(34,"content_copy"),Q()(),Z(35,"button",39),Le("click",function(){let n=Ee(t).$index,a=Se();return Ae(a.toggleBackgroundShapeIsActive(n))}),Z(36,"mat-icon"),ce(37),Q()()(),Z(38,"button",39),Le("click",function(){let n=Ee(t).$index,a=Se();return Ae(a.removeBackgroundShape(n))}),Z(39,"mat-icon"),ce(40,"cancel"),Q()()()}if(i&2){let t=e.$implicit,r=Or(25),n=Se();oe(3),Re("backgroundShape",t),oe(),Re("value",t.color.substring(0,7)),oe(6),hh("value",t.type),oe(),hi(n.CUSTOMIZATION_ENTITY_TYPES),oe(5),hh("value",t.zoom),oe(),hi(n.CUSTOMIZATION_ZOOMS),oe(2),Je(t.type==="vehicle"?19:-1),oe(7),hi(t.tags),oe(2),Re("matChipInputAddOnBlur",!0)("matChipInputFor",r),oe(7),ax("matTooltip","",t.isActive?"Deactivate":"Activate"," Background Shape"),oe(2),_t(" ",t.isActive?"visibility":"visibility_off"," "),oe(),Re("matTooltip","Remove background shape")}}function NBe(i,e){i&1&&(Z(0,"div",9)(1,"p"),ce(2,"No custom icons added yet."),Q()())}function GBe(i,e){i&1&&Ge(0,"div",43)}function VBe(i,e){if(i&1&&(Z(0,"div",40),Ge(1,"div",41)(2,"div",42),Z(3,"div",30)(4,"div",31),Ge(5,"div",43)(6,"div",43),je(7,GBe,1,0,"div",43),Q(),Z(8,"div",31),Ge(9,"div",43),Q()(),Ge(10,"div",42),Q()),i&2){let t=Se().$implicit;oe(7),Je(t.type==="vehicle"?7:-1)}}function KBe(i,e){if(i&1&&(Z(0,"mat-option",15),ce(1),Vr(2,"titlecase"),Q()),i&2){let t=e.$implicit;Re("value",t),oe(),_t(" ",En(2,2,t.replaceAll("-"," "))," ")}}function WBe(i,e){if(i&1&&(Z(0,"mat-option",15),ce(1),Vr(2,"titlecase"),Q()),i&2){let t=e.$implicit;Re("value",t),oe(),_t(" ",En(2,2,t.replaceAll("-"," "))," ")}}function UBe(i,e){if(i&1){let t=vt();Z(0,"mat-form-field",32)(1,"mat-label"),ce(2,"Vehicle Mode"),Q(),Z(3,"input",44),mh("ngModelChange",function(n){Ee(t);let a=Se().$implicit;return dh(a.mode,n)||(a.mode=n),Ae(n)}),Q()()}if(i&2){let t=Se().$implicit;oe(3),hh("ngModel",t.mode)}}function jBe(i,e){if(i&1){let t=vt();Z(0,"mat-chip-row",45),Le("removed",function(){let n=Ee(t).$implicit,a=Se().$index,o=Se();return Ae(o.removeTagFromCustomTexture(a,n))})("edited",function(n){let a=Ee(t).$implicit,o=Se().$index,s=Se();return Ae(s.editTagInCustomTexture(o,a,n))}),ce(1),Z(2,"button",46)(3,"mat-icon"),ce(4,"cancel"),Q()()()}if(i&2){let t=e.$implicit;Re("aria-description","press enter to edit "+t)("editable",!0),oe(),_t(" ",t," "),oe(),Mt("aria-label","remove "+t)}}function qBe(i,e){if(i&1){let t=vt();Z(0,"div",11),je(1,VBe,11,1,"div",26),Z(2,"div",27),Ge(3,"img",47),Q(),Z(4,"button",48),Le("click",function(){let n=Ee(t).$index,a=Se();return Ae(a.uploadCustomTexture(n))}),Z(5,"mat-icon"),ce(6,"upload"),Q()(),Z(7,"div",30)(8,"div",31)(9,"mat-form-field",32)(10,"mat-label"),ce(11,"Type"),Q(),Z(12,"mat-select",33),mh("valueChange",function(n){let a=Ee(t).$implicit;return dh(a.type,n)||(a.type=n),Ae(n)}),ui(13,KBe,3,4,"mat-option",15,_o),Q()(),Z(15,"mat-form-field",32)(16,"mat-label"),ce(17,"Zoom"),Q(),Z(18,"mat-select",33),mh("valueChange",function(n){let a=Ee(t).$implicit;return dh(a.zoom,n)||(a.zoom=n),Ae(n)}),ui(19,WBe,3,4,"mat-option",15,_o),Q()(),je(21,UBe,4,1,"mat-form-field",32),Q(),Z(22,"div",31)(23,"mat-form-field",32)(24,"mat-label"),ce(25,"Tags"),Q(),Z(26,"mat-chip-grid",34,2),ui(28,jBe,5,4,"mat-chip-row",35,Ea),Z(30,"input",36),Le("matChipInputTokenEnd",function(n){let a=Ee(t).$index,o=Se();return Ae(o.addTagToCustomTexture(a,n))}),Q()(),Z(31,"mat-hint"),ce(32," If multiple tags are selected, the icon will be used for entities that have all of them. "),Q()()()(),Z(33,"div",37)(34,"button",49),Le("click",function(){let n=Ee(t).$index,a=Se();return Ae(a.duplicateCustomTexture(n))}),Z(35,"mat-icon"),ce(36,"content_copy"),Q()(),Z(37,"button",39),Le("click",function(){let n=Ee(t).$index,a=Se();return Ae(a.toggleCustomTextureIsActive(n))}),Z(38,"mat-icon"),ce(39),Q()()(),Z(40,"button",39),Le("click",function(){let n=Ee(t).$index,a=Se();return Ae(a.removeCustomTexture(n))}),Z(41,"mat-icon"),ce(42,"cancel"),Q()()()}if(i&2){let t=e.$implicit,r=Or(27),n=Se();oe(3),Re("src",t.url,rx),oe(9),hh("value",t.type),oe(),hi(n.CUSTOMIZATION_ENTITY_TYPES),oe(5),hh("value",t.zoom),oe(),hi(n.CUSTOMIZATION_ZOOMS),oe(2),Je(t.type==="vehicle"?21:-1),oe(7),hi(t.tags),oe(2),Re("matChipInputAddOnBlur",!0)("matChipInputFor",r),oe(7),ax("matTooltip","",t.isActive?"Deactivate":"Activate"," Custom Icon"),oe(2),_t(" ",t.isActive?"visibility":"visibility_off"," "),oe(),Re("matTooltip","Remove custom icon")}}function ZBe(i,e){if(i&1){let t=vt();Ri(0),Z(1,"div",13)(2,"div",27),Ge(3,"img",47),Q(),Z(4,"button",48),Le("click",function(){let n=Ee(t).$implicit,a=Se();return Ae(a.uploadDefaultTexture(n))}),Z(5,"mat-icon"),ce(6,"upload"),Q()(),Z(7,"mat-form-field",50),Ge(8,"input",51),Vr(9,"titlecase"),Q(),Z(10,"button",52),Le("click",function(){let n=Ee(t).$implicit,a=Se();return Ae(a.resetDefaultTexture(n))}),Z(11,"mat-icon"),ce(12,"restart_alt"),Q()()()}if(i&2){let t=e.$implicit,r=Se().getTextureUrlSignal(t)();oe(3),Re("src",r,rx),oe(5),ax("value","Default ",En(9,3,t.replaceAll("-"," "))," Icon")}}function YBe(i,e){if(i&1&&Ge(0,"div",54),i&2){let t=e.$implicit;yr("background-color",t)}}function JBe(i,e){if(i&1&&(Z(0,"div",16)(1,"span"),ce(2,"Light Preset:"),Q(),ui(3,YBe,1,2,"div",53,_o),Q()),i&2){let t=Se();oe(3),hi(t.PRESET_LIGHT_COLOR_THEME)}}function $Be(i,e){if(i&1&&Ge(0,"div",54),i&2){let t=e.$implicit;yr("background-color",t)}}function XBe(i,e){if(i&1&&(Z(0,"div",16)(1,"span"),ce(2,"Saturated Preset:"),Q(),ui(3,$Be,1,2,"div",53,_o),Q()),i&2){let t=Se();oe(3),hi(t.PRESET_SATURATED_COLOR_THEME)}}function QBe(i,e){i&1&&Ge(0,"div",60)}function eRe(i,e){if(i&1){let t=vt();Z(0,"div",57),je(1,QBe,1,0,"div",58),Z(2,"input",59),Le("input",function(n){let a=Ee(t).$index,o=Se(2);return Ae(o.onColorChange(a,n))}),Q()()}if(i&2){let t=e.$implicit;oe(2),Re("value",t)}}function tRe(i,e){if(i&1){let t=vt();Z(0,"div",16)(1,"span"),ce(2,"Custom:"),Q(),Z(3,"button",55),Le("click",function(){Ee(t);let n=Se();return Ae(n.removeCustomColor())}),Z(4,"mat-icon"),ce(5,"remove_circle_outline"),Q()(),Z(6,"div",56),Le("cdkDropListDropped",function(n){Ee(t);let a=Se();return Ae(a.dropCustomColor(n))}),ui(7,eRe,3,1,"div",57,_o),Q(),Z(9,"button",55),Le("click",function(){Ee(t);let n=Se();return Ae(n.addCustomColor())}),Z(10,"mat-icon"),ce(11,"add_circle_outline"),Q()()(),Z(12,"span"),ce(13,"*Click to set their color. Drag to change their order."),Q()}if(i&2){let t=Se();oe(3),Re("disabled",!t.canRemoveColor()),oe(4),hi(t.customColors()),oe(2),Re("disabled",!t.canAddColor())}}function iRe(i,e){if(i&1&&(Z(0,"div",18),Ri(1),Ge(2,"img",47)(3,"div",61),Q()),i&2){let t=e.$implicit,r=Se(),n=r.getTextureUrlSignal(t)();oe(2),Re("src",n,rx),oe(),yr("background-color",r.testScaleColor)("mask-image","url("+n+")")("webkit-mask-image","url("+n+")")}}var rRe=["vehicle","passenger","stop","zoomed-out-vehicle","zoomed-out-passenger","zoomed-out-stop"],iM=class i{constructor(e,t){this.dialogRef=e;this.spritesService=t;this.SPRITE_SIZE=this.spritesService.SPRITE_SIZE,this.PRESET_LIGHT_COLOR_THEME=this.spritesService.PRESET_LIGHT_COLOR_THEME,this.PRESET_SATURATED_COLOR_THEME=this.spritesService.PRESET_SATURATED_COLOR_THEME,this.vehicleTextureUrlSignal.set(this.spritesService.vehicleTexture.baseTexture.resource.url),this.passengerTextureUrlSignal.set(this.spritesService.passengerTexture.baseTexture.resource.url),this.stopTextureUrlSignal.set(this.spritesService.stopTexture.baseTexture.resource.url),this.zoomedOutVehicleTextureUrlSignal.set(this.spritesService.zoomedOutVehicleTexture.baseTexture.resource.url),this.zoomedOutPassengerTextureUrlSignal.set(this.spritesService.zoomedOutPassengerTexture.baseTexture.resource.url),this.zoomedOutStopTextureUrlSignal.set(this.spritesService.zoomedOutStopTexture.baseTexture.resource.url),this.customTexturesSignal.set(this.spritesService.customTextures),this.backgroundShapesSignal.set(this.spritesService.backgroundShapes),this.colorPresetIndex=this.spritesService.colorPresetIndex,this.customColors.set(structuredClone(this.spritesService.customColors))}SPRITE_SIZE;PRESET_LIGHT_COLOR_THEME;PRESET_SATURATED_COLOR_THEME;EDITABLE_DEFAULT_ICON_TYPES=rRe;CUSTOMIZATION_ENTITY_TYPES=o$;CUSTOMIZATION_ZOOMS=s$;MIN_COLOR_COUNT=2;MAX_COLOR_COUNT=12;currentError="";colorPresetIndex=0;customColors=Bt(["#00ff00","#ff0000"]);testScaleValue=0;testScaleColor="#ffffff";customTexturesSignal=Bt([]);backgroundShapesSignal=Bt([]);vehicleTextureUrlSignal=Bt("");passengerTextureUrlSignal=Bt("");stopTextureUrlSignal=Bt("");zoomedOutVehicleTextureUrlSignal=Bt("");zoomedOutPassengerTextureUrlSignal=Bt("");zoomedOutStopTextureUrlSignal=Bt("");uploadButton=lh.required("iconFileUpload");selectedTextureIndex=null;selectedDefaultTextureType=null;dropCustomColor(e){this.customColors.update(t=>(Bf(t,e.previousIndex,e.currentIndex),t)),this.applyColorGradientTester()}canRemoveColor=$t(()=>this.customColors().length>this.MIN_COLOR_COUNT);canAddColor=$t(()=>this.customColors().length<this.MAX_COLOR_COUNT);addCustomColor(){this.canAddColor()&&(this.customColors.update(e=>[...e,"#dd0000"]),this.applyColorGradientTester())}removeCustomColor(){this.canRemoveColor()&&(this.customColors.update(e=>(e.pop(),[...e])),this.applyColorGradientTester())}onColorChange(e,t){let r=t.target.value;this.customColors.update(n=>(n[e]=r,n)),this.applyColorGradientTester()}onColorSetIndexChange(e){this.applyColorGradientTester()}onColorScaleChange(e){this.testScaleValue=parseInt(e.target.value)/100,this.applyColorGradientTester()}applyColorGradientTester(){let e=[];if(this.colorPresetIndex==0&&(e=this.spritesService.PRESET_LIGHT_COLOR_THEME),this.colorPresetIndex==1&&(e=this.spritesService.PRESET_SATURATED_COLOR_THEME),this.colorPresetIndex==2&&(e=this.customColors()),this.testScaleValue===0){this.testScaleColor="#ffffff";return}let t=Hf(e),r=sc(t(this.testScaleValue))?.formatHex()??"#ffffff";this.testScaleColor=r}onIconFileUpload(e){let t=e.target;if(!t||!t.files)return;let r=new FileReader;r.onloadend=()=>Ce(this,null,function*(){if(r.result)try{let n=yield hq.read(r.result);n.resize({w:this.SPRITE_SIZE});let a=yield n.getBase64("image/png");if(this.selectedTextureIndex!==null)this.setCustomTexture(this.selectedTextureIndex,a);else if(this.selectedDefaultTextureType!==null)this.getTextureUrlSignal(this.selectedDefaultTextureType).set(a);else{this.currentError="No texture selected for upload.";return}this.currentError=""}catch{this.currentError="Cannot upload this image."}finally{t.value=""}}),r.readAsDataURL(t.files[0])}onConfigurationFileUpload(e){let t=e.target;if(!t||!t.files)return;let r=new FileReader;r.onloadend=()=>{if(r.result)try{let n=JSON.parse(r.result);if(n.version!==this.spritesService.VERSION){this.currentError="Import data format is outdated.";return}if(n.vehicleTextureUrl===void 0){this.currentError="JSON has missing data: vehicleTextureUrl";return}if(n.passengerTextureUrl===void 0){this.currentError="JSON has missing data: passengerTextureUrl";return}if(n.stopTextureUrl===void 0){this.currentError="JSON has missing data: stopTextureUrl";return}if(n.zoomedOutVehicleTextureUrl===void 0){this.currentError="JSON has missing data: zoomedOutVehicleTextureUrl";return}if(n.zoomedOutPassengerTextureUrl===void 0){this.currentError="JSON has missing data: zoomedOutPassengerTextureUrl";return}if(n.zoomedOutStopTextureUrl===void 0){this.currentError="JSON has missing data: zoomedOutStopTextureUrl";return}if(n.customTextures===void 0){this.currentError="JSON has missing data: customTextures";return}if(n.colorPresetIndex===void 0){this.currentError="JSON has missing data: colorPresetIndex";return}if(n.customColors===void 0){this.currentError="JSON has missing data: customColors";return}this.vehicleTextureUrlSignal.set(n.vehicleTextureUrl),this.passengerTextureUrlSignal.set(n.passengerTextureUrl),this.stopTextureUrlSignal.set(n.stopTextureUrl),this.zoomedOutVehicleTextureUrlSignal.set(n.zoomedOutVehicleTextureUrl),this.zoomedOutPassengerTextureUrlSignal.set(n.zoomedOutPassengerTextureUrl),this.zoomedOutStopTextureUrlSignal.set(n.zoomedOutStopTextureUrl),this.customTexturesSignal.set(n.customTextures),this.backgroundShapesSignal.set(n.backgroundShapes),this.colorPresetIndex=n.colorPresetIndex,n.customColors.length>=2&&this.customColors.set(n.customColors),this.currentError=""}catch{this.currentError="Could not parse JSON data."}finally{t.value=""}},r.readAsText(t.files[0])}uploadDefaultTexture(e){this.selectedTextureIndex=null,this.selectedDefaultTextureType=e,this.uploadButton().nativeElement.click()}getTextureUrlSignal(e){switch(e){case"vehicle":return this.vehicleTextureUrlSignal;case"passenger":return this.passengerTextureUrlSignal;case"stop":return this.stopTextureUrlSignal;case"zoomed-out-vehicle":return this.zoomedOutVehicleTextureUrlSignal;case"zoomed-out-passenger":return this.zoomedOutPassengerTextureUrlSignal;case"zoomed-out-stop":return this.zoomedOutStopTextureUrlSignal}}resetDefaultTexture(e){switch(e){case"vehicle":this.vehicleTextureUrlSignal.set(this.spritesService.DEFAULT_VEHICLE_TEXTURE_URL);break;case"passenger":this.passengerTextureUrlSignal.set(this.spritesService.DEFAULT_PASSENGER_TEXTURE_URL);break;case"stop":this.stopTextureUrlSignal.set(this.spritesService.DEFAULT_STOP_TEXTURE_URL);break;case"zoomed-out-vehicle":this.zoomedOutVehicleTextureUrlSignal.set(this.spritesService.DEFAULT_ZOOMED_OUT_VEHICLE_TEXTURE_URL);break;case"zoomed-out-passenger":this.zoomedOutPassengerTextureUrlSignal.set(this.spritesService.DEFAULT_ZOOMED_OUT_PASSENGER_TEXTURE_URL);break;case"zoomed-out-stop":this.zoomedOutStopTextureUrlSignal.set(this.spritesService.DEFAULT_ZOOMED_OUT_STOP_TEXTURE_URL)}}uploadCustomTexture(e){this.selectedTextureIndex=e,this.selectedDefaultTextureType=null,this.uploadButton().nativeElement.click()}addCustomTexture(){this.customTexturesSignal.update(e=>[...e,{mode:null,url:this.spritesService.DEFAULT_UNDEFINED_TEXTURE_URL,tags:[],type:"vehicle",zoom:"any",isActive:!0}])}removeCustomTexture(e){e>=this.customTexturesSignal().length||this.customTexturesSignal.update(t=>(t.splice(e,1),[...t]))}setCustomTexture(e,t){e>=this.customTexturesSignal().length||this.customTexturesSignal.update(r=>(r[e].url=t,[...r]))}dropCustomTexture(e){this.customTexturesSignal.update(t=>(Bf(t,e.previousIndex,e.currentIndex),structuredClone(t)))}addTagToCustomTexture(e,t){e>=this.customTexturesSignal().length||this.customTexturesSignal.update(r=>{let n=structuredClone(r[e]),a=t.value.trim();return a?(n.tags.includes(a)||(n.tags.push(a),n.tags.sort()),t.chipInput.clear(),r[e]=n,[...r]):r})}removeTagFromCustomTexture(e,t){e>=this.customTexturesSignal().length||this.customTexturesSignal.update(r=>{let n=structuredClone(r[e]);return n.tags=n.tags.filter(a=>a!==t),r[e]=n,[...r]})}editTagInCustomTexture(e,t,r){e>=this.customTexturesSignal().length||this.customTexturesSignal.update(n=>{let a=structuredClone(n[e]),o=r.value.trim();return t&&(a.tags=a.tags.filter(s=>s!==t)),o&&!a.tags.includes(o)&&(a.tags.push(o),a.tags.sort()),n[e]=a,[...n]})}addBackgroundShape(){this.backgroundShapesSignal.update(e=>[...e,{color:"#ff000080",shape:"circle",mode:null,tags:[],type:"vehicle",zoom:"any",isActive:!0}])}removeBackgroundShape(e){e>=this.backgroundShapesSignal().length||this.backgroundShapesSignal.update(t=>(t.splice(e,1),[...t]))}dropBackgroundShape(e){this.backgroundShapesSignal.update(t=>(Bf(t,e.previousIndex,e.currentIndex),structuredClone(t)))}addTagToBackgroundShape(e,t){e>=this.backgroundShapesSignal().length||this.backgroundShapesSignal.update(r=>{let n=structuredClone(r[e]),a=t.value.trim();return a?(n.tags.includes(a)||(n.tags.push(a),n.tags.sort()),t.chipInput.clear(),r[e]=n,[...r]):r})}removeTagFromBackgroundShape(e,t){e>=this.backgroundShapesSignal().length||this.backgroundShapesSignal.update(r=>{let n=structuredClone(r[e]);return n.tags=n.tags.filter(a=>a!==t),r[e]=n,[...r]})}editTagInBackgroundShape(e,t,r){e>=this.backgroundShapesSignal().length||this.backgroundShapesSignal.update(n=>{let a=structuredClone(n[e]),o=r.value.trim();return t&&(a.tags=a.tags.filter(s=>s!==t)),o&&!a.tags.includes(o)&&(a.tags.push(o),a.tags.sort()),n[e]=a,[...n]})}onBackgroundShapeTypeChange(e,t){e>=this.backgroundShapesSignal().length||this.backgroundShapesSignal.update(r=>{let n=structuredClone(r[e]);return n.shape=t,r[e]=n,[...r]})}onBackgroundShapeColorChange(e,t){if(e>=this.backgroundShapesSignal().length)return;let r=t.target.value;this.backgroundShapesSignal.update(n=>{let a=structuredClone(n[e]);return a.color=r+"80",n[e]=a,[...n]})}exportTextures(){let e={version:this.spritesService.VERSION,vehicleTextureUrl:this.vehicleTextureUrlSignal(),passengerTextureUrl:this.passengerTextureUrlSignal(),stopTextureUrl:this.stopTextureUrlSignal(),zoomedOutVehicleTextureUrl:this.zoomedOutVehicleTextureUrlSignal(),zoomedOutPassengerTextureUrl:this.zoomedOutPassengerTextureUrlSignal(),zoomedOutStopTextureUrl:this.zoomedOutStopTextureUrlSignal(),customTextures:this.customTexturesSignal(),backgroundShapes:this.backgroundShapesSignal(),colorPresetIndex:this.colorPresetIndex,customColors:this.customColors()},t=new Blob([JSON.stringify(e,null,2)],{type:"application/json"}),r=URL.createObjectURL(t),n=document.createElement("a");n.href=r,n.download="multimodal-icons.json",n.click(),URL.revokeObjectURL(r)}onSave(){this.spritesService.saveTextureData(this.vehicleTextureUrlSignal(),this.passengerTextureUrlSignal(),this.stopTextureUrlSignal(),this.zoomedOutVehicleTextureUrlSignal(),this.zoomedOutPassengerTextureUrlSignal(),this.zoomedOutStopTextureUrlSignal(),this.customTexturesSignal(),this.backgroundShapesSignal(),this.colorPresetIndex,this.customColors()),this.dialogRef.close()}duplicateCustomTexture(e){e>=this.customTexturesSignal().length||this.customTexturesSignal.update(t=>{let r=structuredClone(t[e]);return[...t.slice(0,e+1),r,...t.slice(e+1)]})}duplicateBackgroundShape(e){e>=this.backgroundShapesSignal().length||this.backgroundShapesSignal.update(t=>{let r=structuredClone(t[e]);return[...t.slice(0,e+1),r,...t.slice(e+1)]})}toggleCustomTextureIsActive(e){e>=this.customTexturesSignal().length||this.customTexturesSignal.update(t=>{let r=structuredClone(t[e]);return r.isActive=!r.isActive,t[e]=r,[...t]})}toggleBackgroundShapeIsActive(e){e>=this.backgroundShapesSignal().length||this.backgroundShapesSignal.update(t=>{let r=structuredClone(t[e]);return r.isActive=!r.isActive,t[e]=r,[...t]})}static \u0275fac=function(t){return new(t||i)(rt(jo),rt(Zg))};static \u0275cmp=tt({type:i,selectors:[["app-edit-map-icons-dialog"]],viewQuery:function(t,r){t&1&&ch(r.uploadButton,PBe,5),t&2&&uh()},decls:66,vars:11,consts:[["iconFileUpload",""],["configurationFileUpload",""],["chipGrid",""],["mat-dialog-title",""],["type","file","accept",".png, .jpg, .jpeg, .bmp",1,"file-upload",3,"change"],["type","file","accept",".json",1,"file-upload",3,"change"],[1,"text-content"],[1,"add-container"],["mat-button","",1,"add-button",3,"click"],[1,"no-custom-textures"],["cdkDropList","","cdkDropListOrientation","vertical",1,"icon-list",3,"cdkDropListDropped"],["cdkDrag","",1,"icon-list-item"],[1,"icon-list"],[1,"icon-list-item"],[1,"color-group",3,"ngModelChange","change","ngModel"],[3,"value"],[1,"color-list-container"],[1,"color-tester"],[1,"icon","wrapper-icon"],["min","0","max","100","discrete","","showTickMarks",""],["matSliderThumb","",3,"input"],[1,"file-porters"],["mat-icon-button","","matTooltip","Export JSON",3,"click"],["mat-icon-button","","matTooltip","Import JSON",3,"click"],["mat-button","","mat-dialog-close",""],["mat-button","",3,"click"],["class","icon-placeholder-container icon-list-item",4,"cdkDragPlaceholder"],[1,"icon"],[3,"shapeChange","backgroundShape"],["type","color",1,"shape-color-picker",3,"input","value"],[1,"form-fields"],[1,"form-field-row"],["appearance","outline","subscriptSizing","dynamic",1,"compact-input","custom-icon-form-field"],[3,"valueChange","value"],["aria-label","Enter fruits"],[3,"aria-description","editable"],[3,"matChipInputTokenEnd","matChipInputAddOnBlur","matChipInputFor"],[1,"flex-column","gap-0-5-rem"],["mat-icon-button","","matTooltip","Duplicate Background Shape",3,"click"],["mat-icon-button","",3,"click","matTooltip"],[1,"icon-placeholder-container","icon-list-item"],[1,"icon-placeholder","icon"],[1,"icon-button-placeholder"],[1,"form-field-placeholder","custom-icon-form-field"],["matInput","",3,"ngModelChange","ngModel"],[3,"removed","edited","aria-description","editable"],["matChipRemove",""],["width","40","alt","icon",3,"src"],["mat-icon-button","","matTooltip","Upload image",3,"click"],["mat-icon-button","","matTooltip","Duplicate Custom Icon",3,"click"],["appearance","outline","subscriptSizing","dynamic",1,"compact-input","default-icon-type"],["matInput","","disabled","",3,"value"],["mat-icon-button","","matTooltip","Reset icon",3,"click"],[1,"preset-color",3,"background-color"],[1,"preset-color"],["mat-icon-button","",1,"mini-icon-button",3,"click","disabled"],["cdkDropList","","cdkDropListOrientation","horizontal",1,"custom-color-list",3,"cdkDropListDropped"],["cdkDrag","",1,"custom-color"],["class","color-placeholder",4,"cdkDragPlaceholder"],["type","color",1,"color-picker",3,"input","value"],[1,"color-placeholder"],[1,"color-overlay"]],template:function(t,r){if(t&1){let n=vt();Z(0,"h1",3),ce(1,"Customize Entities"),Q(),Z(2,"mat-dialog-content")(3,"h2"),ce(4,"Edit Icons"),Q(),Z(5,"input",4,0),Le("change",function(o){return Ee(n),Ae(r.onIconFileUpload(o))}),Q(),Z(7,"input",5,1),Le("change",function(o){return Ee(n),Ae(r.onConfigurationFileUpload(o))}),Q(),Z(9,"div")(10,"div",6)(11,"p"),ce(12),Q(),Z(13,"p"),ce(14," The icons are in decreasing order of priority, meaning that if two icons match for an entity, the one that appears first in the list will be used. You can drag and drop the icons lines to change their order. Background shapes are also in decreasing order of priority, but have no effect on the icons. These shapes are displayed behind the icons and are generally used to visually group entities. "),Q(),je(15,BBe,2,1,"mat-error"),Q(),Z(16,"div",7)(17,"button",8),Le("click",function(){return Ee(n),Ae(r.addCustomTexture())}),ce(18," Add Custom Icon "),Q(),Z(19,"button",8),Le("click",function(){return Ee(n),Ae(r.addBackgroundShape())}),ce(20," Add Background Shape "),Q()(),je(21,RBe,3,0,"div",9),Z(22,"section",10),Le("cdkDropListDropped",function(o){return Ee(n),Ae(r.dropBackgroundShape(o))}),ui(23,HBe,41,11,"div",11,_o),Ge(25,"mat-divider"),Q(),je(26,NBe,3,0,"div",9),Z(27,"section",10),Le("cdkDropListDropped",function(o){return Ee(n),Ae(r.dropCustomTexture(o))}),ui(28,qBe,43,10,"div",11,_o),Ge(30,"mat-divider"),Q(),Z(31,"section",12),ui(32,ZBe,13,5,"div",13,Ea),Ge(34,"mat-divider"),Z(35,"h2"),ce(36,"Capacity color gradient"),Q(),Z(37,"mat-radio-group",14),mh("ngModelChange",function(o){return Ee(n),dh(r.colorPresetIndex,o)||(r.colorPresetIndex=o),Ae(o)}),Le("change",function(o){return Ee(n),Ae(r.onColorSetIndexChange(o))}),Z(38,"mat-radio-button",15),ce(39,"Light"),Q(),Z(40,"mat-radio-button",15),ce(41,"Saturated"),Q(),Z(42,"mat-radio-button",15),ce(43,"Custom"),Q()(),je(44,JBe,5,0,"div",16)(45,XBe,5,0,"div",16)(46,tRe,14,2),Z(47,"span"),ce(48,"*Test the color gradient using the slider below."),Q(),Z(49,"div",17),ui(50,iRe,4,7,"div",18,Ea),Z(52,"mat-slider",19)(53,"input",20),Le("input",function(o){return Ee(n),Ae(r.onColorScaleChange(o))}),Q()()()()()(),Z(54,"mat-dialog-actions")(55,"div",21)(56,"button",22),Le("click",function(){return Ee(n),Ae(r.exportTextures())}),Z(57,"mat-icon"),ce(58,"download_for_offline"),Q()(),Z(59,"button",23),Le("click",function(){Ee(n);let o=Or(8);return Ae(o.click())}),Z(60,"mat-icon"),ce(61,"upload_file"),Q()()(),Z(62,"button",24),ce(63,"Cancel"),Q(),Z(64,"button",25),Le("click",function(){return Ee(n),Ae(r.onSave())}),ce(65,"Save"),Q()()}t&2&&(oe(12),_t(" The uploaded icons will be rescaled to ",r.SPRITE_SIZE,"px in width. For a better result, the icons should not be too wide or too thin. "),oe(3),Je(r.currentError!==""?15:-1),oe(6),Je(r.backgroundShapesSignal().length<=0?21:-1),oe(2),hi(r.backgroundShapesSignal()),oe(3),Je(r.customTexturesSignal().length<=0?26:-1),oe(2),hi(r.customTexturesSignal()),oe(4),hi(r.EDITABLE_DEFAULT_ICON_TYPES),oe(5),hh("ngModel",r.colorPresetIndex),oe(),Re("value",0),oe(2),Re("value",1),oe(2),Re("value",2),oe(2),Je(r.colorPresetIndex===0?44:-1),oe(),Je(r.colorPresetIndex===1?45:-1),oe(),Je(r.colorPresetIndex===2?46:-1),oe(4),hi(r.EDITABLE_DEFAULT_ICON_TYPES))},dependencies:[Os,Is,Fs,vo,Br,pn,Xl,Cw,Ps,ec,uR,ha,ac,zs,Ef,Af,Rs,Eh,Dw,$l,tc,So,qo,pr,mr,Ah,Kw,Rn,Da,qw,jw,Ff,Uw,Hb,Lf,u8,c8,l8,cx,qn,_8,b8,Df,UR,tM],styles:[".flex-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.flex-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.align-center[_ngcontent-%COMP%], .align-main-center[_ngcontent-%COMP%]{justify-content:center}.align-center[_ngcontent-%COMP%], .align-cross-center[_ngcontent-%COMP%]{align-items:center}.align-main-end[_ngcontent-%COMP%]{justify-content:flex-end}.align-cross-end[_ngcontent-%COMP%]{align-items:flex-end}.align-main-start[_ngcontent-%COMP%]{justify-content:flex-start}.align-cross-start[_ngcontent-%COMP%]{align-items:flex-start}.align-cross-stretch[_ngcontent-%COMP%]{align-items:stretch}.gap-0-5-rem[_ngcontent-%COMP%]{gap:.5rem}.gap-1-rem[_ngcontent-%COMP%]{gap:1rem}.gap-1-5-rem[_ngcontent-%COMP%]{gap:1.5rem}.flex-1[_ngcontent-%COMP%]{flex:1}p[_ngcontent-%COMP%]{margin-top:0}.add-container[_ngcontent-%COMP%]{display:flex;justify-content:center;margin-bottom:10px}.icon-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:10px}.icon-list-item[_ngcontent-%COMP%]{padding:5px 0;width:100%;display:flex;flex-direction:row;align-items:center;gap:10px;overflow:visible}.icon[_ngcontent-%COMP%]{width:40px;display:flex;align-items:baseline;justify-content:center}.form-fields[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:10px;min-width:0;flex:1}.form-field-row[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;gap:10px}.custom-icon-form-field[_ngcontent-%COMP%]{flex:1}.icon-placeholder-container[_ngcontent-%COMP%]{--placeholder-background-color: #f0f0f0;border:dotted 3px #999}.icon-placeholder[_ngcontent-%COMP%]{background-color:var(--placeholder-background-color);min-height:40px}.icon-button-placeholder[_ngcontent-%COMP%]{background-color:var(--placeholder-background-color);min-width:48px;min-height:48px}.form-field-placeholder[_ngcontent-%COMP%]{background-color:var(--placeholder-background-color);border-radius:4px;min-height:36px}.file-upload[_ngcontent-%COMP%]{display:none}.file-porters[_ngcontent-%COMP%]{margin-right:auto}.file-porters[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{color:var(--mat-sys-primary)}.color-title[_ngcontent-%COMP%]{margin:0}.color-group[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.color-picker[_ngcontent-%COMP%]{border:none;width:15px;height:15px;margin:2px;padding:0;background:none;cursor:pointer}.color-picker[_ngcontent-%COMP%]::-webkit-color-swatch-wrapper{padding:0}.color-picker[_ngcontent-%COMP%]::-webkit-color-swatch{border:1px solid black;border-radius:0}.color-picker[_ngcontent-%COMP%]::-moz-color-swatch{border:1px solid black;border-radius:0}.shape-color-picker[_ngcontent-%COMP%]{border:none;width:24px;height:24px;margin:8px;padding:0;background:none;cursor:pointer}.shape-color-picker[_ngcontent-%COMP%]::-webkit-color-swatch-wrapper{padding:0}.shape-color-picker[_ngcontent-%COMP%]::-webkit-color-swatch{border:1px solid black;border-radius:0}.shape-color-picker[_ngcontent-%COMP%]::-moz-color-swatch{border:1px solid black;border-radius:0}.color-list-container[_ngcontent-%COMP%], .custom-color-list[_ngcontent-%COMP%], .custom-color[_ngcontent-%COMP%], .preset-color[_ngcontent-%COMP%]{display:flex;align-items:center}.color-list-container[_ngcontent-%COMP%]{gap:5px}.preset-color[_ngcontent-%COMP%]{width:15px;height:15px;border:1px solid black}.color-placeholder[_ngcontent-%COMP%]{background:#ccc;border:dotted 3px #999;width:15px;height:15px;transition:transform .25s cubic-bezier(0,0,.2,1)}.mini-icon-button[_ngcontent-%COMP%]{width:32px;height:32px;padding:7px 4px 4px}.mini-icon-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px}.color-tester[_ngcontent-%COMP%]{display:flex;gap:10px}.wrapper-icon[_ngcontent-%COMP%]{position:relative}.color-overlay[_ngcontent-%COMP%]{position:absolute;top:0;left:0;mix-blend-mode:multiply;pointer-events:none;mask-repeat:no-repeat;width:40px;height:100%;mask-size:40px;-webkit-mask-repeat:no-repeat;-webkit-mask-size:contain}.default-icon-type[_ngcontent-%COMP%]{flex:1}mat-divider[_ngcontent-%COMP%]{padding-block-end:1rem}"]})};function nRe(i,e){i&1&&(Z(0,"mat-icon",2),ce(1," error "),Q())}function aRe(i,e){i&1&&(Z(0,"mat-icon",3),ce(1," warning "),Q())}function oRe(i,e){i&1&&(Z(0,"mat-icon"),ce(1," info "),Q())}function sRe(i,e){}function lRe(i,e){if(i&1&&(Z(0,"button",4),ce(1),Q()),i&2){let t,r=Se();Re("mat-dialog-close",!1),oe(),_t(" ",(t=r.data.cancelButtonOverride)!==null&&t!==void 0?t:"Close"," ")}}var rM=class i{constructor(e){this.data=e}static \u0275fac=function(t){return new(t||i)(rt(sm))};static \u0275cmp=tt({type:i,selectors:[["app-information-dialog"]],decls:14,vars:6,consts:[["mat-dialog-title",""],[1,"flex-row","align-main-start","align-cross-center","gap-1-rem"],[1,"text-red"],[1,"text-yellow"],["mat-button","",3,"mat-dialog-close"]],template:function(t,r){if(t&1&&(Z(0,"h2",0),ce(1),Q(),Z(2,"mat-dialog-content")(3,"div",1),je(4,nRe,2,0,"mat-icon",2)(5,aRe,2,0,"mat-icon",3)(6,oRe,2,0,"mat-icon")(7,sRe,0,0),Z(8,"p"),ce(9),Q()()(),Z(10,"mat-dialog-actions"),je(11,lRe,2,2,"button",4),Z(12,"button",4),ce(13),Q()()),t&2){let n,a;oe(),Ti(r.data.title),oe(3),Je((n=r.data.type)==="error"?4:n==="warning"?5:n==="info"?6:7),oe(5),_t(" ",r.data.message," "),oe(2),Je(r.data.canCancel?11:-1),oe(),Re("mat-dialog-close",!0),oe(),_t(" ",(a=r.data.confirmButtonOverride)!==null&&a!==void 0?a:r.data.canCancel?"Confirm":"Close"," ")}},dependencies:[Is,Os,vo,Fs,Br,pn,mr],styles:[".flex-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.flex-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.align-center[_ngcontent-%COMP%], .align-main-center[_ngcontent-%COMP%]{justify-content:center}.align-center[_ngcontent-%COMP%], .align-cross-center[_ngcontent-%COMP%]{align-items:center}.align-main-end[_ngcontent-%COMP%]{justify-content:flex-end}.align-cross-end[_ngcontent-%COMP%]{align-items:flex-end}.align-main-start[_ngcontent-%COMP%]{justify-content:flex-start}.align-cross-start[_ngcontent-%COMP%]{align-items:flex-start}.align-cross-stretch[_ngcontent-%COMP%]{align-items:stretch}.gap-0-5-rem[_ngcontent-%COMP%]{gap:.5rem}.gap-1-rem[_ngcontent-%COMP%]{gap:1rem}.gap-1-5-rem[_ngcontent-%COMP%]{gap:1.5rem}.flex-1[_ngcontent-%COMP%]{flex:1}*[_ngcontent-%COMP%]{--red-text-color: #ff0000;--red-background-color: #ffdddd;--yellow-text-color: #ffc21b;--yellow-background-color: #ffe6a4;--green-text-color: #00aa00;--green-background-color: #ccffcc;--gray-text-color: #666666;--gray-background-color: #f0f0f0;--blue-text-color: #4488ff;--blue-background-color: #cce5ff;--loaded-slider-color: #005cbb88;--active-button-color: #cce6ff}.text-red[_ngcontent-%COMP%]{color:var(--red-text-color)}.background-red[_ngcontent-%COMP%]{background-color:var(--red-background-color)}.text-yellow[_ngcontent-%COMP%]{color:var(--yellow-text-color)}.background-yellow[_ngcontent-%COMP%]{background-color:var(--yellow-background-color)}.text-green[_ngcontent-%COMP%]{color:var(--green-text-color)}.background-green[_ngcontent-%COMP%]{background-color:var(--green-background-color)}.text-gray[_ngcontent-%COMP%]{color:var(--gray-text-color)}.background-gray[_ngcontent-%COMP%]{background-color:var(--gray-background-color)!important}.text-blue[_ngcontent-%COMP%]{color:var(--blue-text-color)}.background-blue[_ngcontent-%COMP%]{background-color:var(--blue-background-color)}mat-icon[_ngcontent-%COMP%]{min-width:24px}"]})};var v$=go(nI());var cRe=["starting","paused","running","stopping","completed","lost","corrupted","outdated","future"];function uRe(i){return cRe.includes(i)}var Bu=["starting","running","paused","stopping","lost"],f$={starting:0,running:1,paused:1,stopping:2,lost:3,completed:4,corrupted:5,outdated:5,future:5};function g$(i){if(typeof i!="string")return console.error("Invalid data type for start time",i),null;if(!/^\d{8}-\d{9}$/.test(i))return console.error("Invalid format for start time",i),null;let e=parseInt(i.slice(0,4)),t=parseInt(i.slice(4,6))-1,r=parseInt(i.slice(6,8)),n=parseInt(i.slice(9,11)),a=parseInt(i.slice(11,13)),o=parseInt(i.slice(13,15)),s=parseInt(i.slice(16,19));return new Date(e,t,r,n,a,o,s)}function hRe(i){if(typeof i!="object"||i===null)return console.error("Invalid data type for simulation",i),null;if(!("id"in i)||typeof i.id!="string")return console.error("Invalid simulation ID in simulation",i),null;let e=i.id;if(!("status"in i)||!uRe(i.status))return console.error("Invalid simulation status in simulation",i),null;let t=i.status;if(i.status==="corrupted"){let g=i.id.split(lf)[1]??"unknown",_=g$(i.id.split(lf)[0])??new Date(0);return{id:e,name:g,data:"unknown",status:t,startTime:_,simulationStartTime:null,simulationEndTime:null,simulationTime:null,simulationEstimatedEndTime:null,lastUpdateIndex:null,completion:-1,configuration:{maxDuration:null},polylinesVersion:-1,size:null}}if(!("name"in i)||typeof i.name!="string")return console.error("Invalid simulation name in simulation",i),null;let r=i.name;if(!("data"in i)||typeof i.data!="string")return console.error("Invalid simulation data in simulation",i),null;let n=i.data;if(!("startTime"in i))return console.error("Invalid simulation start time in simulation",i),null;let a=g$(i.startTime);if(a===null)return console.error("Invalid simulation start time",i.startTime,"in simulation",i),null;let o=null;if("simulationStartTime"in i){if(typeof i.simulationStartTime!="number")return console.error("Invalid simulation start time",i.simulationStartTime,"in simulation",i),null;o=i.simulationStartTime}let s=null;if("simulationEndTime"in i){if(typeof i.simulationEndTime!="number")return console.error("Invalid simulation end time",i.simulationEndTime,"in simulation",i),null;s=i.simulationEndTime}let l=null;if("simulationTime"in i){if(typeof i.simulationTime!="number")return console.error("Invalid simulation time",i.simulationTime,"in simulation",i),null;l=i.simulationTime}let c=null;if("simulationEstimatedEndTime"in i){if(typeof i.simulationEstimatedEndTime!="number")return console.error("Invalid simulation estimated end time",i.simulationEstimatedEndTime,"in simulation",i),null;c=i.simulationEstimatedEndTime}let u=null;if("lastUpdateIndex"in i){if(typeof i.lastUpdateIndex!="number")return console.error("Invalid last update index",i.lastUpdateIndex,"in simulation",i),null;u=i.lastUpdateIndex}let h=1;Bu.includes(t)&&(o!==null&&l!==null&&c!==null?h=(l-o)/(c-o):(console.warn("Incomplete simulation data for completion calculation",i),h=0));let d=null;if("configuration"in i){if(typeof i.configuration!="object"||i.configuration===null)return console.error("Invalid configuration",i.configuration,"in simulation",i),null;if("maxDuration"in i.configuration){if(i.configuration.maxDuration!==null&&typeof i.configuration.maxDuration!="number")return console.error("Invalid max duration",i.configuration.maxDuration,"in simulation",i),null;d=i.configuration.maxDuration}}let p=-1;if("polylinesVersion"in i){if(typeof i.polylinesVersion!="number")return console.error("Invalid polylines version",i.polylinesVersion,"in simulation",i),null;p=i.polylinesVersion}let f=null;if("size"in i){if(i.size!==null&&typeof i.size!="number")return console.error("Invalid size",i.size,"in simulation",i),null;f=i.size}return{id:e,name:r,data:n,status:t,startTime:a,simulationStartTime:o,simulationEndTime:s,simulationTime:l,simulationEstimatedEndTime:c,lastUpdateIndex:u,completion:h,configuration:{maxDuration:d},polylinesVersion:p,size:f}}function y$(i){if(!Array.isArray(i))return console.error("Invalid data type for simulations",i),[];let e=[];for(let t of i){let r=hRe(t);if(r!==null)e.push(r);else return console.error("Invalid simulation data",t),null}return e}function _$(i,e){let t=f$[i.status],r=f$[e.status];return t<r?-1:t>r||i.startTime<e.startTime?1:-1}var To=class i{constructor(e,t){this.socket=e;this.dialogService=t;Ji(()=>{this._communicationStatusSignal()==="disconnected"?this.disconnectedDialogRef===null&&(this.disconnectedDialogRef=this.dialogService.openInformationDialog({title:"Disconnected",message:"The connection to the server has been lost. Please verify that the server is running and try again. The application will attempt to reconnect automatically.",type:"error",confirmButtonOverride:"Continue Anyway",cancelButtonOverride:null,canCancel:!1})):this.disconnectedDialogRef!==null&&(this.disconnectedDialogRef.close(),this.disconnectedDialogRef=null)}),this.onConnect(()=>{this._communicationStatusSignal.set("connected")}),this.onDisconnect(()=>{this._communicationStatusSignal.set("disconnected"),console.error("Disconnected from the server")}),this.on("error",r=>{console.error("Socket error:",r)}),setTimeout(()=>{this._communicationStatusSignal.update(r=>r==="connecting"?"disconnected":r)},1e3)}_communicationStatusSignal=Bt("connecting");disconnectedDialogRef=null;get isConnectedSignal(){return $t(()=>this._communicationStatusSignal()==="connected")}get communicationStatusSignal(){return this._communicationStatusSignal}emit(e,...t){this.socket.emit(e,...t)}on(e,t){this.socket.on(e,t)}onDisconnect(e){this.socket.on("disconnect",e)}onConnect(e){this.socket.on("connect",e)}removeAllListeners(e){this.socket.removeAllListeners(e)}static \u0275fac=function(t){return new(t||i)(Zt(sf),Zt(Js))};static \u0275prov=lt({token:i,factory:i.\u0275fac,providedIn:"root"})};var Qh=class i{constructor(e){this.communicationService=e;this.listen(),this.query(),this.communicationService.onConnect(()=>{this.query()})}_simulationsSignal=Bt([]);_availableSimulationDataSignal=Bt([]);get simulationsSignal(){return $t(()=>this._simulationsSignal().sort(_$))}get availableSimulationDataSignal(){return this._availableSimulationDataSignal}queryAvailableData(){this.communicationService.emit("get-available-data")}listen(){this.communicationService.on("simulations",e=>{let t=y$(e);if(t===null){console.error("Invalid simulations data",e);return}this._simulationsSignal.set(t)}),this.communicationService.on("available-data",e=>{if(!Array.isArray(e)||!e.every(t=>typeof t=="string")){console.error("Invalid available data",e);return}this._availableSimulationDataSignal.set(e)})}query(){this.querySimulations(),this.queryAvailableData()}querySimulations(){this.communicationService.emit("get-simulations")}static \u0275fac=function(t){return new(t||i)(Zt(To))};static \u0275prov=lt({token:i,factory:i.\u0275fac,providedIn:"root"})};var Jg=class i{constructor(e){this.http=e}apiUrl=Ux.apiUrl;exportFolder(e,t){return this.http.get(this.apiUrl+`${e}/${t}`,{responseType:"blob"})}importFolder(e,t,r){return this.http.post(this.apiUrl+`${e}/${t}`,r)}deleteFolder(e,t){return this.http.delete(this.apiUrl+`${e}/${t}`)}static \u0275fac=function(t){return new(t||i)(Zt(F_))};static \u0275prov=lt({token:i,factory:i.\u0275fac,providedIn:"root"})};function dRe(i,e){i&1&&(Z(0,"mat-error"),ce(1,"Name is required"),Q())}function mRe(i,e){i&1&&(Z(0,"mat-error"),ce(1,"Name must be at least 3 characters long"),Q())}function pRe(i,e){i&1&&(Z(0,"mat-error"),ce(1,"Name must be at most 50 characters long"),Q())}function fRe(i,e){if(i&1&&(Z(0,"mat-error"),ce(1),Q()),i&2){let t=Se(2);oe(),_t(" The name must not contain the simulation save file separator (",t.SIMULATION_SAVE_FILE_SEPARATOR,") ")}}function gRe(i,e){i&1&&(Z(0,"mat-error"),ce(1,' The name muse not contain characters that might affect the file system (e.g. /, \\, :, *, ?, ", <, >, |) '),Q())}function yRe(i,e){if(i&1&&(Z(0,"mat-option",14),ce(1),Q()),i&2){let t=e.$implicit;Re("value",t),oe(),Ti(t)}}function _Re(i,e){i&1&&(Z(0,"mat-error"),ce(1,"Data is required"),Q())}function bRe(i,e){if(i&1){let t=vt();Z(0,"h3"),ce(1,"General"),Q(),Z(2,"div",8)(3,"section",9)(4,"mat-form-field",10),Ge(5,"input",11),Z(6,"mat-label"),ce(7,"Name"),Q(),Z(8,"mat-hint"),ce(9,"Spaces will be replaced by underscores"),Q(),je(10,dRe,2,0,"mat-error")(11,mRe,2,0,"mat-error")(12,pRe,2,0,"mat-error")(13,fRe,2,1,"mat-error")(14,gRe,2,0,"mat-error"),Q(),Z(15,"mat-form-field",10)(16,"mat-select",12),Le("openedChange",function(){Ee(t);let n=Se();return Ae(n.refreshAvailableData())}),Z(17,"mat-option",13),Le("click",function(){Ee(t);let n=Se();return Ae(n.importInputData())}),ce(18,"\u2795 Import New Folder"),Q(),ui(19,yRe,2,2,"mat-option",14,Ea),Q(),Z(21,"mat-label"),ce(22,"Data"),Q(),je(23,_Re,2,0,"mat-error"),Q()(),Z(24,"mat-checkbox",15),ce(25," Run in background "),Q()()}if(i&2){let t=Se();oe(4),Re("subscriptSizing","dynamic"),oe(6),Je(t.nameFormControl.hasError("required")?10:t.nameFormControl.hasError("minlength")?11:t.nameFormControl.hasError("maxlength")?12:t.nameFormControl.hasError("invalidPattern")?13:t.nameFormControl.hasError("invalidCharacter")?14:-1),oe(5),Re("subscriptSizing","dynamic"),oe(4),hi(t.availableSimulationDataSignal()),oe(4),Je(t.dataFormControl.hasError("required")?23:-1)}}function vRe(i,e){i&1&&(Z(0,"span",3)(1,"mat-icon",16),ce(2,"error"),Q(),Z(3,"span"),ce(4,"Select a valid data source before changing the configuration the simulation"),Q()())}function SRe(i,e){i&1&&(Z(0,"mat-error"),ce(1,"Max duration must be greater than 0"),Q())}function kRe(i,e){i&1&&ce(0," Start ")}function xRe(i,e){i&1&&ce(0," Save ")}var nM=class i{constructor(e,t,r,n,a){this.data=e;this.dataService=t;this.dialogRef=r;this.formBuilder=n;this.httpService=a;this.nameFormControl=this.formBuilder.control(null,[Fn.minLength(3),Fn.maxLength(50),this.validateName()]),this.data.mode==="start"&&this.nameFormControl.addValidators(Fn.required),this.dataFormControl=this.formBuilder.control(null),this.data.mode==="start"&&this.dataFormControl.addValidators(Fn.required),this.shouldRunInBackgroundFormControl=this.formBuilder.control(!1),this.maxDurationFormControl=this.formBuilder.control(null,[Fn.min(0)]),this.generalFormGroup=this.formBuilder.group({name:this.nameFormControl,data:this.dataFormControl,shouldRunInBackground:this.shouldRunInBackgroundFormControl}),this.configurationFormGroup=this.formBuilder.group({maxDuration:this.maxDurationFormControl}),this.formGroup=this.formBuilder.group({general:this.generalFormGroup,configuration:this.configurationFormGroup}),this.data.mode==="edit"&&this.data.currentConfiguration&&this.maxDurationFormControl.setValue(this.data.currentConfiguration.maxDuration===null?null:this.data.currentConfiguration.maxDuration/3600),this.data.mode==="start"&&(this.dataFormControl.valueChanges.pipe(gi(this.unsubscribe$)).subscribe(o=>{o?this.enableConfigurationFields():this.disableConfigurationFields()}),this.dataFormControl.value||this.disableConfigurationFields())}SIMULATION_SAVE_FILE_SEPARATOR=lf;formGroup;generalFormGroup;configurationFormGroup;nameFormControl;dataFormControl;maxDurationFormControl;shouldRunInBackgroundFormControl;unsubscribe$=new ct;ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}onSave(){this.formGroup.valid?this.dialogRef.close(this.buildResult()):console.error("Invalid form",this.formGroup)}get availableSimulationDataSignal(){return this.dataService.availableSimulationDataSignal}refreshAvailableData(){this.dataService.queryAvailableData()}buildResult(){let e=this.nameFormControl.value;return typeof e=="string"&&(e=e.trim().replace(/\s/g,"_")),{general:{name:e,data:this.dataFormControl.value,shouldRunInBackground:!!this.shouldRunInBackgroundFormControl.value},configuration:{maxDuration:this.maxDurationFormControl.value===null?null:Math.ceil(this.maxDurationFormControl.value*3600)}}}disableConfigurationFields(){this.maxDurationFormControl.disable()}enableConfigurationFields(){this.maxDurationFormControl.enable()}validateName(){return e=>{if(typeof e.value=="string"){if(e.value.match(lf))return{invalidPattern:!0};if(e.value.match(/[<>:"/\\|?*]/))return{invalidCharacter:!0}}return null}}importInputData(){let e=document.createElement("input");e.type="file",e.webkitdirectory=!0,e.multiple=!0;let t=r=>Ce(this,null,function*(){let n=r.target.files;if(!n||n.length===0)return;let a=new v$.default,o=n[0].webkitRelativePath.split("/")[0];for(let u of Array.from(n)){let h=u.webkitRelativePath.replace(o+"/","");a.file(h,u)}let s=yield a.generateAsync({type:"blob"}),l="input_data",c=new FormData;c.append("file",s,"folder.zip"),this.httpService.importFolder(l,o,c).subscribe({next:u=>{this.refreshAvailableData();let h="actual_folder_name"in u?u.actual_folder_name:o;setTimeout(()=>{this.dataFormControl.setValue(h)},100)},error:u=>{console.error("Upload failed:",u)}})});e.addEventListener("change",r=>{t(r).catch(n=>{console.error("Error handling file change:",n)})}),e.click()}exportInputData(e){this.httpService.exportFolder("input_data",e).subscribe(r=>{let n=new Blob([r],{type:"application/zip"}),a=window.URL.createObjectURL(n),o=document.createElement("a");o.href=a,o.download=e+".zip",document.body.appendChild(o),o.click(),document.body.removeChild(o),window.URL.revokeObjectURL(a)})}deleteInputData(e){this.httpService.deleteFolder("input_data",e).subscribe({next:r=>{r.message||r.error&&console.error("Failed to delete the data folder:",r.error)},error:r=>{console.error("HTTP error during deletion:",r)}})}static \u0275fac=function(t){return new(t||i)(rt(sm),rt(Qh),rt(jo),rt(wf),rt(Jg))};static \u0275cmp=tt({type:i,selectors:[["app-simulation-configuration-dialog"]],decls:24,vars:5,consts:[["mat-dialog-title",""],[3,"formGroup"],["formGroupName","configuration",1,"flex-column","gap-1-rem"],[1,"error-message","flex-row","align-cross-center","gap-0-5-rem"],["type","number","matInput","","formControlName","maxDuration"],["matTextSuffix",""],["mat-button","","mat-dialog-close",""],["mat-button","",3,"click"],["formGroupName","general"],[1,"flex-row","gap-1-rem","no-stretch"],[3,"subscriptSizing"],["matInput","","formControlName","name"],["formControlName","data",3,"openedChange"],[3,"click"],[3,"value"],["formControlName","shouldRunInBackground"],[1,"error-icon"]],template:function(t,r){if(t&1&&(Z(0,"h2",0),ce(1,"Configure Simulation"),Q(),Z(2,"mat-dialog-content")(3,"form",1),je(4,bRe,26,4),Z(5,"h3"),ce(6,"Simulation"),Q(),Z(7,"div",2),je(8,vRe,5,0,"span",3),Z(9,"mat-form-field"),Ge(10,"input",4),Z(11,"mat-label"),ce(12,"Simulation Duration (optional)"),Q(),je(13,SRe,2,0,"mat-error"),Z(14,"span",5),ce(15,"h"),Q(),Z(16,"mat-hint"),ce(17," The simulation will stop after this in-simulation duration, even if not finished (0.5 = 30min) "),Q()()()()(),Z(18,"mat-dialog-actions")(19,"button",6),ce(20,"Cancel"),Q(),Z(21,"button",7),Le("click",function(){return r.onSave()}),je(22,kRe,1,0)(23,xRe,1,0),Q()()),t&2){let n;oe(3),Re("formGroup",r.formGroup),oe(),Je(r.data.mode==="start"?4:-1),oe(4),Je(r.data.mode==="start"&&!r.dataFormControl.valid?8:-1),oe(5),Je(r.maxDurationFormControl.hasError("min")?13:-1),oe(9),Je((n=r.data.mode)==="start"?22:n==="edit"?23:-1)}},dependencies:[Os,Is,Fs,vo,Br,pn,ha,ac,zs,Ef,Af,Rw,Rs,wh,Ps,Cb,ec,xh,Bs,Tb,ww,Eh,Dw,$l,tc,Mw,So,qo,pr,mr],styles:[".flex-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.flex-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.align-center[_ngcontent-%COMP%], .align-main-center[_ngcontent-%COMP%]{justify-content:center}.align-center[_ngcontent-%COMP%], .align-cross-center[_ngcontent-%COMP%]{align-items:center}.align-main-end[_ngcontent-%COMP%]{justify-content:flex-end}.align-cross-end[_ngcontent-%COMP%]{align-items:flex-end}.align-main-start[_ngcontent-%COMP%]{justify-content:flex-start}.align-cross-start[_ngcontent-%COMP%]{align-items:flex-start}.align-cross-stretch[_ngcontent-%COMP%]{align-items:stretch}.gap-0-5-rem[_ngcontent-%COMP%]{gap:.5rem}.gap-1-rem[_ngcontent-%COMP%]{gap:1rem}.gap-1-5-rem[_ngcontent-%COMP%]{gap:1.5rem}.flex-1[_ngcontent-%COMP%]{flex:1}.error-icon[_ngcontent-%COMP%]{min-width:24px}.error-message[_ngcontent-%COMP%]{max-width:calc(424px + 1rem)}.no-stretch[_ngcontent-%COMP%]{align-items:flex-start}.no-stretch[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1}"]})};var Y$=go(nI());function aM(i){return new Date(i*1e3).toISOString().slice(11,19)}var ed=class i{transform(e){return aM(e)}static \u0275fac=function(t){return new(t||i)};static \u0275pipe=W4({name:"simulationTime",type:i,pure:!0})};var A$=go(sI());function hs(i){return typeof i=="object"&&i!==null&&"tags"in i&&Array.isArray(i.tags)&&i.tags.every(e=>typeof e=="string")}var MRe=["previous","current","next"];function lI(i){return MRe.includes(i)}function $g(i){if(typeof i!="object"||i===null)return console.error("Invalid data type for leg",i),null;let e=[];if("tags"in i){if(!hs(i))return console.error("Invalid tags in leg",i),null;e=i.tags.sort((u,h)=>u.localeCompare(h))}if(!("legType"in i)||!lI(i.legType))return console.error("Invalid leg type",i),null;let t=i.legType,r=null;if("assignedVehicleId"in i){if(i.assignedVehicleId!==null&&typeof i.assignedVehicleId!="string")return console.error("Invalid assigned vehicle ID",i.assignedVehicleId,"for leg",i),null;r=i.assignedVehicleId}let n=null;if("boardingStopId"in i){if(i.boardingStopId!==null&&typeof i.boardingStopId!="string")return console.error("Invalid boarding stop index",i.boardingStopId,"for leg",i),null;n=i.boardingStopId}let a=null;if("alightingStopId"in i){if(i.alightingStopId!==null&&typeof i.alightingStopId!="string")return console.error("Invalid alighting stop index",i.alightingStopId,"for leg",i),null;a=i.alightingStopId}let o=null;if("boardingStopIndex"in i){if(i.boardingStopIndex!==null&&typeof i.boardingStopIndex!="number")return console.error("Invalid boarding stop index",i.boardingStopIndex,"for leg",i),null;o=i.boardingStopIndex}let s=null;if("alightingStopIndex"in i){if(i.alightingStopIndex!==null&&typeof i.alightingStopIndex!="number")return console.error("Invalid alighting stop index",i.alightingStopIndex,"for leg",i),null;s=i.alightingStopIndex}let l=null;if("boardingTime"in i){if(i.boardingTime!==null&&typeof i.boardingTime!="number")return console.error("Invalid boarding time",i.boardingTime,"for leg",i),null;l=i.boardingTime}let c=null;if("alightingTime"in i){if(i.alightingTime!==null&&typeof i.alightingTime!="number")return console.error("Invalid alighting time",i.alightingTime,"for leg",i),null;c=i.alightingTime}return{tags:e,legType:t,assignedVehicleId:r,boardingStopId:n,alightingStopId:a,boardingStopIndex:o,alightingStopIndex:s,boardingTime:l,alightingTime:c}}var TRe=["release","assigned","ready","onboard","complete"];function cI(i){return TRe.includes(i)}function P$(i){if(typeof i!="object"||i===null)return console.error("Invalid data type for passenger",i),null;if(!("id"in i)||typeof i.id!="string")return console.error("Invalid ID for passenger",i),null;let e=i.id,t=(0,A$.default)({seed:e});if(!("status"in i)||!cI(i.status))return console.error("Invalid status for passenger",i),null;let r=i.status;if(!("numberOfPassengers"in i)||typeof i.numberOfPassengers!="number")return console.error("Invalid number of passengers for passenger",i),null;let n=i.numberOfPassengers;if(!("previousLegs"in i)||!Array.isArray(i.previousLegs))return console.error("Invalid previous legs in passenger",i),null;let a=i.previousLegs.map($g);if(!a.every(c=>c!==null)){let c=a.find(u=>u===null);return console.error("Invalid previous legs, including",c,"in passenger",i),null}let o=null;if("currentLeg"in i&&(o=$g(i.currentLeg),o===null))return console.error("Invalid current leg in passenger",i),null;if(!("nextLegs"in i)||!Array.isArray(i.nextLegs))return console.error("Invalid next legs in passenger",i),null;let s=i.nextLegs.map($g);if(!s.every(c=>c!==null)){let c=s.find(u=>u===null);return console.error("Invalid next legs, including",c,"in passenger",i),null}let l=[];if("tags"in i){if(!hs(i))return console.error("Invalid tags",i.tags,"in passenger",i),null;l=i.tags.sort((c,u)=>c.localeCompare(u))}return{id:e,name:t,entityType:"passenger",status:r,previousLegs:a,currentLeg:o,nextLegs:s,numberOfPassengers:n,tags:l,error:null}}function td(i){return i.previousLegs.forEach(e=>e.legType="previous"),i.currentLeg!==null&&(i.currentLeg.legType="current"),i.nextLegs.forEach(e=>e.legType="next"),i.previousLegs.concat(i.currentLeg===null?[]:[i.currentLeg],i.nextLegs)}function B$(i,e){let t=i.currentLeg??i.nextLegs[0]??null;return t===null||t.assignedVehicleId===null?null:t.boardingTime===null||t.boardingTime>e?t.boardingStopId===null?null:{stopId:t.boardingStopId,vehicleId:t.assignedVehicleId}:t.alightingTime===null||t.alightingTime>e||t.alightingStopId===null?null:{stopId:t.alightingStopId,vehicleId:t.assignedVehicleId}}function R$(i,e){let t=i.currentLeg??i.nextLegs[0]??null;return t===null||t.boardingTime===null||t.boardingTime>e?null:t.alightingTime===null||t.alightingTime>e?t.assignedVehicleId:null}function D$(i,e,t){let r=i.currentLeg??i.nextLegs[0]??null;return r===null?!1:r.boardingTime===null||r.boardingTime>t?e===r.boardingStopId:r.alightingTime===null||r.alightingTime>t?!1:e===r.alightingStopId}function L$(i,e,t){let r=i.currentLeg??i.nextLegs[0]??null;return r===null||r.boardingTime===null||r.boardingTime>t?!1:r.alightingTime===null||r.alightingTime>t?r.assignedVehicleId===e:!1}var Xg=class{constructor(e){this.compare=e}_items=[];add(e){let t=this.findInsertionIndex(e);this._items.splice(t,0,e)}shift(){return this._items.shift()}get length(){return this._items.length}get items(){return this._items}get editableItems(){return this._items}findInsertionIndex(e){let t=0,r=this._items.length-1;for(;t<=r;){let n=Math.floor((t+r)/2),a=this.compare(this._items[n],e);if(a<0)t=n+1;else if(a>0)r=n-1;else return n}return t}};var Ru=1,I$=2;function uI(){return new Xg((i,e)=>e.priority-i.priority)}var id=class{constructor(e,t){this.priority=e;this.queue=t}addToQueue(){this.queue.add(this)}get numberOfTasks(){return 1}},jm=class extends id{constructor(t,r,n){super(t,r);this.taskFunction=n}process(){this.taskFunction()}},Pl=class extends id{hasCalledBeforeAll=!1;subtasks=uI();constructor(e,t){super(e,t)}process(){if(!this.hasCalledBeforeAll)this.beforeAll(),this.hasCalledBeforeAll=!0;else{let e=this.subtasks.shift();if(!e){this.afterAll();return}e.process()}this.addToQueue()}get numberOfTasks(){return this.subtasks.items.reduce((e,t)=>e+t.numberOfTasks,1)}};function hI(i){return!(typeof i!="object"||i===null||!("latitude"in i)||typeof i.latitude!="number"||!("longitude"in i)||typeof i.longitude!="number")}var ERe=["previous","current","next"];function dI(i){return ERe.includes(i)}var ARe=10;function PRe(i){let e=hI(i)?i:i.position;return""+e.latitude+","+e.longitude}function Qg(i,e){if(typeof i!="object"||i===null)return console.error("Invalid data type for stop",i),null;let t=[];if("tags"in i){if(!hs(i))return console.error("Invalid tags",i.tags,"in stop",i),null;t=i.tags.sort((u,h)=>u.localeCompare(h))}if(!("stopType"in i)||!dI(i.stopType))return console.error("Invalid stop type in stop",i),null;let r=i.stopType;if(!("arrivalTime"in i)||typeof i.arrivalTime!="number")return console.error("Invalid arrival time in stop",i),null;let n=i.arrivalTime,a=null;if("departureTime"in i){if(i.departureTime!==null&&typeof i.departureTime!="number")return console.error("Invalid departure time",i.departureTime,"in stop",i),null;a=i.departureTime}if(!("position"in i)||!hI(i.position))return console.error("Invalid position in stop",i),null;let o=i.position,s=ARe;if("capacity"in i){if(typeof i.capacity!="number")return console.error("Invalid capacity",i.capacity,"in stop",i),null;s=i.capacity}if(!("label"in i)||typeof i.label!="string")return console.error("Invalid label in stop",i),null;let l=i.label;return{id:PRe(o),name:l,entityType:"stop",tags:t,stopType:r,arrivalTime:n,departureTime:a,position:o,capacity:s,label:l,vehicleId:e,error:null}}var BRe=["release","idle","boarding","enroute","alighting","complete"];function mI(i){return BRe.includes(i)}function F$(i){if(typeof i!="object"||i===null)return console.error("Invalid data type for vehicle",i),null;if(!("id"in i)||typeof i.id!="string")return console.error("Invalid ID for vehicle",i),null;let e=i.id;if(!("name"in i)||typeof i.name!="string")return console.error("Invalid name for vehicle",i),null;let t=i.name,r=null;if("mode"in i){if(typeof i.mode!="string")return console.error("Invalid mode for vehicle",i.mode,"in vehicle",i),null;r=i.mode}if(!("status"in i)||!mI(i.status))return console.error("Invalid status for vehicle",i),null;let n=i.status;if(!("previousStops"in i)||!Array.isArray(i.previousStops))return console.error("Invalid previous stops for vehicle",i),null;let a=i.previousStops.map(u=>Qg(u,e));if(!a.every(u=>u!==null)){let u=a.find(h=>h===null);return console.error("Invalid previous stops, including",u,"in vehicle",i),null}let o=null;if("currentStop"in i&&(o=Qg(i.currentStop,e),o===null))return console.error("Invalid current stop for vehicle",i),null;if(!("nextStops"in i)||!Array.isArray(i.nextStops))return console.error("Invalid next stops for vehicle",i),null;let s=i.nextStops.map(u=>Qg(u,e));if(!s.every(u=>u!==null)){let u=s.find(h=>h===null);return console.error("Invalid next stops, including",u,"in vehicle",i),null}if(!("capacity"in i)||typeof i.capacity!="number")return console.error("Invalid capacity for vehicle",i),null;let l=i.capacity,c=[];if("tags"in i){if(!hs(i))return console.error("Invalid tags",i.tags,"for vehicle",i),null;c=i.tags.sort((u,h)=>u.localeCompare(h))}return{id:e,name:t,entityType:"vehicle",mode:r,status:n,previousStops:a,currentStop:o,nextStops:s,capacity:l,tags:c,error:null}}function Bl(i){return i.previousStops.forEach(e=>e.stopType="previous"),i.currentStop!==null&&(i.currentStop.stopType="current"),i.nextStops.forEach(e=>e.stopType="next"),i.previousStops.concat(i.currentStop===null?[]:[i.currentStop],i.nextStops)}function _I(){return{passengerTags:[],vehicleTags:[],stopTags:[],legTags:[],passengerLegs:{},vehicleStops:{}}}var sM=class extends Pl{constructor(t,r,n,a){super(I$,t);this.states=r;this.references=n;this.callback=a}continuousEnvironments=[];beforeAll(){for(let t of this.states)new gI(this.subtasks,t,this.references,this.continuousEnvironments).addToQueue()}afterAll(){this.callback(this.continuousEnvironments)}},gI=class extends Pl{constructor(t,r,n,a){super(0,t);this.state=r;this.references=n;this.continuousEnvironments=a;this.continuousEnvironment=this.buildEmptyContinuousEnvironment()}continuousEnvironment;beforeAll(){for(let r of Object.values(this.state.passengers))new jm(0,this.subtasks,()=>O$(this.continuousEnvironment.passengers,this.continuousEnvironment.allPassengers,r,this.continuousEnvironment.startTimestamp,this.continuousEnvironment.endTimestamp,this.state.updateIndex,this.references)).addToQueue();for(let r of Object.values(this.state.vehicles))new jm(0,this.subtasks,()=>z$(this.continuousEnvironment.vehicles,this.continuousEnvironment.allVehicles,r,this.continuousEnvironment.startTimestamp,this.continuousEnvironment.endTimestamp,this.state.updateIndex,this.references)).addToQueue();new jm(0,this.subtasks,()=>H$(this.continuousEnvironment.statistics,this.state.statistics,this.continuousEnvironment.startTimestamp,this.continuousEnvironment.endTimestamp,this.state.updateIndex)).addToQueue();let t=new yI(this.state,this.continuousEnvironment,this.references);for(let r of this.state.updates)new jm(-r.updateIndex-1,this.subtasks,()=>{t.visitUpdate(r)}).addToQueue()}afterAll(){this.continuousEnvironments.push(this.continuousEnvironment)}buildEmptyContinuousEnvironment(){let t=this.state.timestamp,r=this.state.updateIndex,n=this.state.updates,a=n[n.length-1],o=a.timestamp,s=a.updateIndex+1,l=this.state.isComplete;return{passengers:{},allPassengers:[],vehicles:{},allVehicles:[],statistics:[],startTimestamp:t,startUpdateIndex:r,endTimestamp:o,endUpdateIndex:s,isComplete:l}}},yI=class{constructor(e,t,r){this.environment=e;this.continuousEnvironment=t;this.references=r}visitUpdate(e){e.apply(this.environment),e.accept(this)}visitPassengerUpdate(e){let t=this.environment.passengers[e.passengerId];O$(this.continuousEnvironment.passengers,this.continuousEnvironment.allPassengers,t,e.timestamp,this.continuousEnvironment.endTimestamp,e.updateIndex,this.references)}visitVehicleUpdate(e){let t=this.environment.vehicles[e.vehicleId];z$(this.continuousEnvironment.vehicles,this.continuousEnvironment.allVehicles,t,e.timestamp,this.continuousEnvironment.endTimestamp,e.updateIndex,this.references)}visitStatisticsUpdate(e){H$(this.continuousEnvironment.statistics,e.statistics,e.timestamp,this.continuousEnvironment.endTimestamp,e.updateIndex)}};function O$(i,e,t,r,n,a,o){let s=i[t.id];s||(s=[],i[t.id]=s,e.push(s));let l=s[s.length-1];l!==void 0&&(l.startTimestamp===r?s.pop():l.endTimestamp=r);let c=at(ye({},t),{startTimestamp:r,endTimestamp:a,updateIndex:n});LRe(c,o),s.push(c)}function z$(i,e,t,r,n,a,o){let s=i[t.id];s||(s=[],i[t.id]=s,e.push(s));let l=s[s.length-1];l!==void 0&&(l.startTimestamp===r?s.pop():l.endTimestamp=r);let c=at(ye({},t),{startTimestamp:r,endTimestamp:n,updateIndex:a});IRe(c,o),s.push(c)}function H$(i,e,t,r,n){let a=i[i.length-1];a!==void 0&&(a.startTimestamp===t?i.pop():a.endTimestamp=t);let o={statistics:e,startTimestamp:t,endTimestamp:r,updateIndex:n};i.push(o)}function lM(i,e){let t=e.tags,r=i.find(n=>bI(n,t));if(!r){let n=[...t];i.push(n),r=n}e.tags=r}function pI(i,e){let t=i.find(n=>FRe(n,e));if(t)return t;let r=ye({},e);return i.push(r),r}function RRe(i,e){let t=e.previousLegs.map(a=>pI(i,a)),r=e.currentLeg?pI(i,e.currentLeg):null,n=e.nextLegs.map(a=>pI(i,a));e.previousLegs=t,e.currentLeg=r,e.nextLegs=n}function fI(i,e){let t=zRe(i,e);if(t!==null)return i[t];let r=ye({},e);return HRe(i,r),r}function DRe(i,e){let t=e.previousStops.map(a=>fI(i,a)),r=e.currentStop?fI(i,e.currentStop):null,n=e.nextStops.map(a=>fI(i,a));e.previousStops=t,e.currentStop=r,e.nextStops=n}function LRe(i,e){lM(e.passengerTags,i);let t=e.passengerLegs[i.id];t||(t=[],e.passengerLegs[i.id]=t),RRe(t,i);let r=td(i);for(let n of r)lM(e.legTags,n)}function IRe(i,e){lM(e.vehicleTags,i);let t=e.vehicleStops[i.id];t||(t=[],e.vehicleStops[i.id]=t),DRe(t,i);let r=Bl(i);for(let n of r)lM(e.stopTags,n)}function bI(i,e){if(i.length!==e.length)return!1;for(let t=0;t<i.length;t++)if(i[t]!==e[t])return!1;return!0}function FRe(i,e){return i.assignedVehicleId===e.assignedVehicleId&&i.boardingStopId===e.boardingStopId&&i.alightingStopId===e.alightingStopId&&i.boardingStopIndex===e.boardingStopIndex&&i.alightingStopIndex===e.alightingStopIndex&&i.boardingTime===e.boardingTime&&i.alightingTime===e.alightingTime&&bI(i.tags,e.tags)}function ORe(i,e){return i.id===e.id&&i.name===e.name&&i.arrivalTime===e.arrivalTime&&i.departureTime===e.departureTime&&i.position.latitude===e.position.latitude&&i.position.longitude===e.position.longitude&&i.capacity===e.capacity&&i.label===e.label&&bI(i.tags,e.tags)}function zRe(i,e){let t=Du(i,n=>n.id.localeCompare(e.id));if(t===null)return null;let r=t;for(;r<i.length&&i[r].id===e.id;){if(ORe(i[r],e))return r;r++}return null}function HRe(i,e){let t=NRe(i,r=>r.id.localeCompare(e.id));i.splice(t,0,e)}function Du(i,e){let t=0,r=i.length-1;for(;t<=r;){let n=Math.floor((t+r)/2),a=e(i[n]);if(a===0){let o=n-1;if(o<0||e(i[o])!==0)return n;r=o}else a<0?t=n+1:r=n-1}return null}function NRe(i,e){let t=0,r=i.length-1;for(;t<=r;){let n=Math.floor((t+r)/2);e(i[n])<0?t=n+1:r=n-1}return t}function N$(i,e){for(let t=0;t<i.length-1;t++){let r=i[t];if(e.includes(r.endUpdateIndex))continue;let n=i[t+1];if(r.endUpdateIndex===n.startUpdateIndex){r.endTimestamp=n.startTimestamp;for(let o=0;o<r.allPassengers.length;o++){let s=r.allPassengers[o],l=s[s.length-1];l&&(l.endTimestamp=n.startTimestamp)}for(let o=0;o<r.allVehicles.length;o++){let s=r.allVehicles[o],l=s[s.length-1];l&&(l.endTimestamp=n.startTimestamp)}let a=r.statistics[r.statistics.length-1];a&&(a.endTimestamp=n.startTimestamp),e.push(r.endUpdateIndex)}}}function cM(i,e){if(e===null||i.length===0)return null;let t=Du(i,r=>r.startTimestamp>e?1:r.endTimestamp<=e?-1:0);return t!==null||(t=Du(i,r=>r.startTimestamp>e?1:r.endTimestamp<e?-1:0),t!==null)?i[t]:null}function uM(i,e){if(e<i.startTimestamp||e>i.endTimestamp)throw console.error(i),new Error(`Timestamp ${e} is out of bounds for the continuous environment with start ${i.startTimestamp} and end ${i.endTimestamp}`);let t=i.startUpdateIndex,r={},n=[];for(let h=0;h<i.allPassengers.length;h++){let d=i.allPassengers[h],p=Du(d,g=>g.startTimestamp>e?1:g.endTimestamp<=e?-1:0);if(p===null&&(p=Du(d,g=>g.startTimestamp>e?1:g.endTimestamp<e?-1:0),p===null))continue;let f=d[p];f.updateIndex>t&&(t=f.updateIndex),r[f.id]=f,n.push(f)}let a={},o=[],s={};for(let h=0;h<i.allVehicles.length;h++){let d=i.allVehicles[h],p=Du(d,_=>_.startTimestamp>e?1:_.endTimestamp<=e?-1:0);if(p===null&&(p=Du(d,_=>_.startTimestamp>e?1:_.endTimestamp<e?-1:0),p===null))continue;let f=d[p];f.updateIndex>t&&(t=f.updateIndex);let g=Bl(f);for(let _=0;_<g.length;_++){let b=g[_];s[b.id]=b}a[f.id]=f,o.push(f)}let l=Du(i.statistics,h=>h.startTimestamp>e?1:h.endTimestamp<=e?-1:0);if(l===null&&(l=Du(i.statistics,h=>h.startTimestamp>e?1:h.endTimestamp<e?-1:0),l===null))throw console.error(i),new Error(`No statistics found for timestamp ${e} in the continuous environment`);let c=i.statistics[l];c.updateIndex>t&&(t=c.updateIndex);let u=c.statistics;return{passengers:r,vehicles:a,stops:s,statistics:u,timestamp:e,updateIndex:t,allVehicles:o,allPassengers:n,allStops:Object.values(s)}}function vI(i){if(i.length===0)return[];let e=null,t=[];for(let r of i){if(e===null){e={start:r.startTimestamp,end:r.endTimestamp};continue}r.startTimestamp===e.end?e.end=r.endTimestamp:(t.push(e),e={start:r.startTimestamp,end:r.endTimestamp})}return e!==null&&t.push(e),t}function G$(i,e,t){if(i.length===0)return!1;let r=vI(i);for(let n of r)if(n.start<=e&&n.end>=t)return!0;return!1}var V$=function(i,e){e===void 0&&(e=5);for(var t=Math.pow(10,e),r=i.length,n=new Array(Math.floor(i.length/2)),a=0,o=0,s=0,l=0;a<r;++l){var c=1,u=0,h=void 0;do h=i.charCodeAt(a++)-63-1,c+=h<<u,u+=5;while(h>=31);o+=c&1?~(c>>1):c>>1,c=1,u=0;do h=i.charCodeAt(a++)-63-1,c+=h<<u,u+=5;while(h>=31);s+=c&1?~(c>>1):c>>1,n[l]=[o/t,s/t]}return n.length=l,n};function K$(i,e){if(!Array.isArray(i)||!i.every(r=>typeof r=="string"))return console.error("Invalid serialized polylines by coordinates",i),null;if(typeof e!="number")return console.error("Invalid polylines version",e),null;let t={};for(let r of i){let n=JSON.parse(r);if(typeof n!="object"||n===null)return console.error("Invalid data type for polyline",n),null;if(!("coordinatesString"in n)||typeof n.coordinatesString!="string")return console.error("Invalid coordinates string in polyline",n),null;let a=n.coordinatesString;if(!("coefficients"in n)||!Array.isArray(n.coefficients)||!n.coefficients.every(c=>typeof c=="number"))return console.error("Invalid coefficients in polyline",n),null;let o=n.coefficients;if(!("encodedPolyline"in n)||typeof n.encodedPolyline!="string")return console.error("Invalid encoded polyline in polyline",n),null;let s=n.encodedPolyline,l=V$(s).map(c=>({latitude:c[0],longitude:c[1]}));if(l.length>1&&o.length!==l.length-1)if(o.length===1&&o[0]===1){let c=[];for(let h=0;h<l.length-1;h++){let d=l[h],p=l[h+1],f=Math.sqrt((p.latitude-d.latitude)**2+(p.longitude-d.longitude)**2);c.push(f)}let u=c.reduce((h,d)=>h+d,0);if(u===0)return console.error("Total distance is zero, cannot calculate coefficients of decoded polyline",l,"in polyline",n),null;o.splice(0,o.length,...c.map(h=>h/u))}else return console.error("Polyline coefficients length mismatch in decoded polyline",l,"in polyline",n),null;t[a]={polyline:l,coefficients:o}}return{version:e,polylinesByCoordinates:t}}function f0(i){if(typeof i!="object"||i===null)return!1;for(let e of Object.values(i))if(typeof e!="string"&&typeof e!="number"&&!f0(e))return!1;return!0}var W$=go(sI());var GRe=["passenger","vehicle","statistics"];function U$(i){return GRe.includes(i)}var rd=class i{constructor(e,t,r,n,a){this.updateType=e;this.updateIndex=t;this.eventIndex=r;this.eventName=n;this.timestamp=a}apply(e){e.updateIndex=this.updateIndex,e.timestamp=this.timestamp}accept(e){}static deserialize(e){return typeof e!="object"||!e?(console.error("Invalid data type for update",e),null):!("updateType"in e)||!U$(e.updateType)?(console.error("Invalid update type in serialized update",e),null):!("updateIndex"in e)||typeof e.updateIndex!="number"?(console.error("Invalid update index in serialized update",e),null):!("eventIndex"in e)||typeof e.eventIndex!="number"?(console.error("Invalid event index in serialized update",e),null):!("eventName"in e)||typeof e.eventName!="string"?(console.error("Invalid event name in serialized update",e),null):!("timestamp"in e)||typeof e.timestamp!="number"?(console.error("Invalid timestamp in serialized update",e),null):new i(e.updateType,e.updateIndex,e.eventIndex,e.eventName,e.timestamp)}},SI=class i extends rd{constructor(t,r,n,a,o,s,l,c,u){super("passenger",t,r,n,a);this.passengerId=o;this.differences=s;this.numberOfLegsToRemove=l;this.legsToAdd=c;this.legsDifferences=u}static DEFAULT_DIFFERENCES={};static DEFAULT_LEGS_TO_ADD=[];static DEFAULT_LEGS_DIFFERENCES=[];static DEFAULT_NUMBER_OF_LEGS_TO_REMOVE=0;apply(t){super.apply(t);let r=this.differences.status,n=this.differences.numberOfPassengers,a=this.differences.tags,o=t.passengers[this.passengerId];if(o===void 0){if(r===void 0){console.error(`Passenger with ID ${this.passengerId} does not exist and no status provided.`);return}if(n===void 0){console.error(`Passenger with ID ${this.passengerId} does not exist and no numberOfPassengers provided.`);return}if(a===void 0){console.error(`Passenger with ID ${this.passengerId} does not exist and no tags provided.`);return}o={id:this.passengerId,entityType:"passenger",name:(0,W$.default)({seed:this.passengerId}),status:r,numberOfPassengers:n,tags:a,previousLegs:[],currentLeg:null,nextLegs:[],error:null}}else o=ye(ye({},o),this.differences);let s=td(o);this.numberOfLegsToRemove>0&&s.splice(s.length-this.numberOfLegsToRemove,this.numberOfLegsToRemove),s.push(...this.legsToAdd);for(let c of this.legsDifferences){let l=c,{index:u}=l,h=oa(l,["index"]);if(u<0||u>=s.length){console.error(`Invalid leg index ${u} for passenger ${this.passengerId}.`,this,t);continue}s[u]=ye(ye({},s[u]),h)}o.previousLegs=[],o.currentLeg=null,o.nextLegs=[];for(let c of s)c.legType==="previous"?o.previousLegs.push(c):c.legType==="current"?o.currentLeg=c:c.legType==="next"&&o.nextLegs.push(c);t.passengers[this.passengerId]=o}accept(t){t.visitPassengerUpdate(this)}static deserialize(t){if(typeof t!="object"||t===null)return console.error("Invalid data type for passenger update",t),null;let r=rd.deserialize(t);if(r===null)return console.error("Invalid base update in serialized passenger update",t),null;if(!("passengerId"in t)||typeof t.passengerId!="string")return console.error("Invalid passenger ID in serialized update",t),null;let n=t.passengerId,a=this.DEFAULT_DIFFERENCES;if("differences"in t){if(!this.isPassengerDifferences(t.differences))return console.error("Invalid differences",t.differences,"in serialized passenger update",t),null;a=t.differences}let o=this.DEFAULT_NUMBER_OF_LEGS_TO_REMOVE;if("numberOfLegsToRemove"in t){if(typeof t.numberOfLegsToRemove!="number")return console.error("Invalid number of legs to remove",t.numberOfLegsToRemove,"in serialized passenger update",t),null;o=t.numberOfLegsToRemove}let s=this.DEFAULT_LEGS_TO_ADD;if("legsToAdd"in t){if(!Array.isArray(t.legsToAdd))return console.error("Invalid legs to add",t.legsToAdd,"in serialized passenger update",t),null;let c=t.legsToAdd.map($g);if(!c.every(u=>u!==null)){let u=c.find(h=>h===null);return console.error("Invalid legs to add, including",u,"in serialized passenger update",t),null}s=c}let l=this.DEFAULT_LEGS_DIFFERENCES;if("legsDifferences"in t){if(!this.isLegDifferencesArray(t.legsDifferences))return console.error("Invalid legs differences",t.legsDifferences,"in serialized passenger update",t),null;l=t.legsDifferences}return new i(r.updateIndex,r.eventIndex,r.eventName,r.timestamp,n,a,o,s,l)}static isPassengerDifferences(t){if(typeof t!="object"||t===null||"status"in t&&!cI(t.status)||"numberOfPassengers"in t&&typeof t.numberOfPassengers!="number")return!1;if("tags"in t){if(!hs(t))return!1;t.tags=t.tags.sort((r,n)=>r.localeCompare(n))}return!0}static isLegDifferencesArray(t){return Array.isArray(t)&&t.every(this.isLegDifferences)}static isLegDifferences(t){if(typeof t!="object"||t===null||"index"in t&&typeof t.index!="number")return!1;if("tags"in t){if(!hs(t))return!1;t.tags=t.tags.sort((r,n)=>r.localeCompare(n))}return!("legType"in t&&!lI(t.legType)||"assignedVehicleId"in t&&t.assignedVehicleId!==null&&typeof t.assignedVehicleId!="string"||"boardingStopId"in t&&t.boardingStopId!==null&&typeof t.boardingStopId!="string"||"alightingStopId"in t&&t.alightingStopId!==null&&typeof t.alightingStopId!="string"||"boardingStopIndex"in t&&t.boardingStopIndex!==null&&typeof t.boardingStopIndex!="number"||"alightingStopIndex"in t&&t.alightingStopIndex!==null&&typeof t.alightingStopIndex!="number"||"boardingTime"in t&&t.boardingTime!==null&&typeof t.boardingTime!="number"||"alightingTime"in t&&t.alightingTime!==null&&typeof t.alightingTime!="number")}},kI=class i extends rd{constructor(t,r,n,a,o,s,l,c,u){super("vehicle",t,r,n,a);this.vehicleId=o;this.differences=s;this.numberOfStopsToRemove=l;this.stopsToAdd=c;this.stopsDifferences=u}static DEFAULT_DIFFERENCES={};static DEFAULT_STOPS_TO_ADD=[];static DEFAULT_STOPS_DIFFERENCES=[];static DEFAULT_NUMBER_OF_STOPS_TO_REMOVE=0;apply(t){super.apply(t);let r=this.differences.name,n=this.differences.mode,a=this.differences.status,o=this.differences.capacity,s=this.differences.tags,l=t.vehicles[this.vehicleId];if(l===void 0){if(r===void 0){console.error(`Vehicle with ID ${this.vehicleId} does not exist and no name provided.`);return}if(n===void 0){console.error(`Vehicle with ID ${this.vehicleId} does not exist and no mode provided.`);return}if(a===void 0){console.error(`Vehicle with ID ${this.vehicleId} does not exist and no status provided.`);return}if(o===void 0){console.error(`Vehicle with ID ${this.vehicleId} does not exist and no capacity provided.`);return}if(s===void 0){console.error(`Vehicle with ID ${this.vehicleId} does not exist and no tags provided.`);return}l={id:this.vehicleId,entityType:"vehicle",name:r,mode:n,status:a,capacity:o,tags:s,previousStops:[],currentStop:null,nextStops:[],error:null}}else l=ye(ye({},l),this.differences);let c=Bl(l);this.numberOfStopsToRemove>0&&c.splice(c.length-this.numberOfStopsToRemove,this.numberOfStopsToRemove),c.push(...this.stopsToAdd);for(let h of this.stopsDifferences){let u=h,{index:d}=u,p=oa(u,["index"]);if(d<0||d>=c.length){console.error(`Invalid stop index ${d} for vehicle ${this.vehicleId}.`,this,t);continue}c[d]=ye(ye({},c[d]),p)}l.previousStops=[],l.currentStop=null,l.nextStops=[];for(let h of c)h.stopType==="previous"?l.previousStops.push(h):h.stopType==="current"?l.currentStop=h:h.stopType==="next"&&l.nextStops.push(h);t.vehicles[this.vehicleId]=l}accept(t){t.visitVehicleUpdate(this)}static deserialize(t){if(typeof t!="object"||t===null)return console.error("Invalid data type for vehicle update",t),null;let r=rd.deserialize(t);if(r===null)return null;if(!("vehicleId"in t)||typeof t.vehicleId!="string")return console.error("Invalid vehicle ID in serialized update",t),null;let n=t.vehicleId,a=this.DEFAULT_DIFFERENCES;if("differences"in t){if(!this.isVehicleDifferences(t.differences))return console.error("Invalid differences",t.differences,"in serialized vehicle update",t),null;a=t.differences}let o=this.DEFAULT_NUMBER_OF_STOPS_TO_REMOVE;if("numberOfStopsToRemove"in t){if(typeof t.numberOfStopsToRemove!="number")return console.error("Invalid number of stops to remove",t.numberOfStopsToRemove,"in serialized vehicle update",t),null;o=t.numberOfStopsToRemove}let s=this.DEFAULT_STOPS_TO_ADD;if("stopsToAdd"in t){if(!Array.isArray(t.stopsToAdd))return console.error("Invalid stops to add",t.stopsToAdd,"in serialized vehicle update",t),null;let c=t.stopsToAdd.map(u=>Qg(u,n));if(!c.every(u=>u!==null)){let u=c.find(h=>h===null);return console.error("Invalid stops to add, including",u,"in serialized vehicle update",t),null}s=c}let l=this.DEFAULT_STOPS_DIFFERENCES;if("stopsDifferences"in t){if(!this.isStopDifferencesArray(t.stopsDifferences))return console.error("Invalid stops differences",t.stopsDifferences,"in serialized vehicle update",t),null;l=t.stopsDifferences}return new i(r.updateIndex,r.eventIndex,r.eventName,r.timestamp,n,a,o,s,l)}static isVehicleDifferences(t){if(typeof t!="object"||t===null||"name"in t&&typeof t.name!="string"||"mode"in t&&typeof t.mode!="string"&&t.mode!==null||"status"in t&&!mI(t.status)||"capacity"in t&&typeof t.capacity!="number")return!1;if("tags"in t){if(!hs(t))return!1;t.tags=t.tags.sort((r,n)=>r.localeCompare(n))}return!0}static isStopDifferencesArray(t){return Array.isArray(t)&&t.every(this.isStopDifferences)}static isStopDifferences(t){if(typeof t!="object"||t===null||"index"in t&&typeof t.index!="number")return!1;if("tags"in t){if(!hs(t))return!1;t.tags=t.tags.sort((r,n)=>r.localeCompare(n))}return!("stopType"in t&&!dI(t.stopType)||"arrivalTime"in t&&typeof t.arrivalTime!="number"||"departureTime"in t&&t.departureTime!==null&&typeof t.departureTime!="number"||"latitude"in t&&typeof t.latitude!="number"||"longitude"in t&&typeof t.longitude!="number"||"capacity"in t&&typeof t.capacity!="number"||"label"in t&&typeof t.label!="string")}},xI=class i extends rd{statistics;constructor(e,t,r,n,a){super("statistics",e,t,r,n),this.statistics=Object.freeze(a)}apply(e){super.apply(e),e.statistics=this.statistics}accept(e){e.visitStatisticsUpdate(this)}static deserialize(e){if(typeof e!="object"||e===null)return console.error("Invalid data type for statistics update",e),null;let t=rd.deserialize(e);if(t===null)return null;if(!("statistics"in e)||!f0(e.statistics))return console.error("Invalid statistics in serialized update",e),null;let r=e.statistics;return new i(t.updateIndex,t.eventIndex,t.eventName,t.timestamp,r)}};function j$(i){if(typeof i!="object"||i===null)return console.error("Invalid data type for update",i),null;if(!("updateType"in i)||!U$(i.updateType))return console.error("Invalid update type in data",i),null;switch(i.updateType){case"passenger":return SI.deserialize(i);case"vehicle":return kI.deserialize(i);case"statistics":return xI.deserialize(i)}}var hM=class extends Pl{constructor(t,r,n,a){super(Ru,t);this.serializedEnvironments=r;this.serializedUpdates=n;this.callback=a}environments=[];updatesByFirstUpdateIndex={};beforeAll(){new wI(this.subtasks,this.serializedEnvironments,this.environments).addToQueue(),new EI(this.subtasks,this.serializedUpdates,this.updatesByFirstUpdateIndex).addToQueue()}afterAll(){let t=[];for(let r of this.environments){let n=this.updatesByFirstUpdateIndex[r.updateIndex];if(n===void 0){console.error("No updates found for environment",r,"in updates",this.updatesByFirstUpdateIndex,"from serialized updates",this.serializedUpdates,"and serialized environments",this.serializedEnvironments),this.callback(null);continue}t.push(at(ye({},r),{updates:n}))}this.callback(t)}},wI=class extends Pl{constructor(t,r,n){super(Ru,t);this.serializedEnvironments=r;this.environments=n}beforeAll(){if(!Array.isArray(this.serializedEnvironments)){console.error("Invalid data type for serialized environments",this.serializedEnvironments);return}for(let t of this.serializedEnvironments)new CI(this.subtasks,t,this.environments).addToQueue()}afterAll(){}},CI=class extends Pl{constructor(t,r,n){super(Ru,t);this.serializedEnvironment=r;this.environments=n}environment={timestamp:-1,updateIndex:-1,statistics:{},passengers:{},vehicles:{},isComplete:!1};beforeAll(){if(typeof this.serializedEnvironment!="object"||this.serializedEnvironment===null){console.error("Invalid data type for serialized environment",this.serializedEnvironment);return}if(!("timestamp"in this.serializedEnvironment)||typeof this.serializedEnvironment.timestamp!="number"){console.error("Invalid timestamp in serialized environment",this.serializedEnvironment);return}if(this.environment.timestamp=this.serializedEnvironment.timestamp,!("updateIndex"in this.serializedEnvironment)||typeof this.serializedEnvironment.updateIndex!="number"){console.error("Invalid update index in serialized environment",this.serializedEnvironment);return}if(this.environment.updateIndex=this.serializedEnvironment.updateIndex,!("isComplete"in this.serializedEnvironment)||typeof this.serializedEnvironment.isComplete!="boolean"){console.error("Invalid isComplete in serialized environment",this.serializedEnvironment);return}if(this.environment.isComplete=this.serializedEnvironment.isComplete,!("statistics"in this.serializedEnvironment)||typeof this.serializedEnvironment.statistics!="string"){console.error("Invalid statistics in serialized environment",this.serializedEnvironment);return}let t=JSON.parse(this.serializedEnvironment.statistics);if(!f0(t)){console.error("Invalid statistics object in serialized environment",this.serializedEnvironment);return}if(this.environment.statistics=t,!("passengers"in this.serializedEnvironment)||!Array.isArray(this.serializedEnvironment.passengers)){console.error("Invalid passengers in serialized environment",this.serializedEnvironment);return}for(let r of this.serializedEnvironment.passengers)new MI(this.subtasks,r,this.environment.passengers).addToQueue();if(!("vehicles"in this.serializedEnvironment)||!Array.isArray(this.serializedEnvironment.vehicles)){console.error("Invalid vehicles in serialized environment",this.serializedEnvironment);return}for(let r of this.serializedEnvironment.vehicles)new TI(this.subtasks,r,this.environment.vehicles).addToQueue()}afterAll(){this.environments.push(this.environment)}},MI=class extends id{constructor(t,r,n){super(Ru,t);this.serializedPassenger=r;this.passengers=n}process(){if(typeof this.serializedPassenger!="string"){console.error("Invalid data type for serialized passenger",this.serializedPassenger);return}let t=JSON.parse(this.serializedPassenger),r=P$(t);if(r===null){console.error("Invalid passenger",this.serializedPassenger);return}this.passengers[r.id]=r}},TI=class extends id{constructor(t,r,n){super(Ru,t);this.serializedVehicle=r;this.vehicles=n}process(){if(typeof this.serializedVehicle!="string"){console.error("Invalid data type for serialized vehicle",this.serializedVehicle);return}let t=JSON.parse(this.serializedVehicle),r=F$(t);if(r===null){console.error("Invalid vehicle",this.serializedVehicle);return}this.vehicles[r.id]=r}},EI=class extends Pl{constructor(t,r,n){super(Ru,t);this.serializedUpdates=r;this.updatesByFirstUpdateIndex=n}beforeAll(){if(typeof this.serializedUpdates!="object"||this.serializedUpdates===null){console.error("Invalid data type for serialized updates",this.serializedUpdates);return}for(let[t,r]of Object.entries(this.serializedUpdates))new AI(this.subtasks,t,r,this.updatesByFirstUpdateIndex).addToQueue()}afterAll(){}},AI=class extends Pl{constructor(t,r,n,a){super(Ru,t);this.serializedUpdatesKey=r;this.serializedUpdates=n;this.updatesByFirstUpdateIndex=a}updates=new Xg((t,r)=>t.updateIndex-r.updateIndex);beforeAll(){if(typeof this.serializedUpdatesKey!="string"){console.error("Invalid data type for key",this.serializedUpdatesKey,"with serialized updates",this.serializedUpdates);return}let t=parseInt(this.serializedUpdatesKey);if(isNaN(t)){console.error("Key is not a valid number",this.serializedUpdatesKey,"with serialized updates",this.serializedUpdates);return}if(!Array.isArray(this.serializedUpdates)){console.error("Invalid data type for serialized updates",this.serializedUpdates,"with key",this.serializedUpdatesKey);return}this.updatesByFirstUpdateIndex[t]=this.updates.editableItems;for(let r of this.serializedUpdates)new PI(this.subtasks,r,this.updates).addToQueue()}afterAll(){}},PI=class extends id{constructor(t,r,n){super(Ru,t);this.serializedUpdate=r;this.updates=n}process(){if(typeof this.serializedUpdate!="string"){console.error("Invalid data type for serialized update",this.serializedUpdate);return}let t=j$(JSON.parse(this.serializedUpdate));if(t===null){console.error("Invalid update",this.serializedUpdate);return}this.updates.add(t)}};var nd=class i{queue=uI();processTasks(e){for(this.processTask();this.queue.length>0&&performance.now()<e;)this.processTask()}processTask(){let e=this.queue.shift();e&&e.process()}extractStateTask(e,t,r){new hM(this.queue,e,t,r).addToQueue()}buildContinuousEnvironmentsTask(e,t,r){new sM(this.queue,e,t,r).addToQueue()}get numberOfTasks(){return this.queue.items.reduce((e,t)=>e+t.numberOfTasks,0)}static \u0275fac=function(t){return new(t||i)};static \u0275prov=lt({token:i,factory:i.\u0275fac,providedIn:"root"})};var Ha=class i{constructor(e,t,r){this.dataService=e;this.communicationService=t;this.taskService=r}_activeSimulationIdSignal=Bt(null);_simulationPolylinesSignal=Bt(null);_isFetchingStatesSignal=Bt(!1);_isFetchingPolylinesSignal=Bt(!1);_continuousEnvironmentsSignal=Bt([]);alreadyUpdatedEnvironmentUpdateIndexes=[];references=_I();_hasAllStatesSignal=Bt(!1);setActiveSimulationId(e){this.unsetActiveSimulationId(),this._activeSimulationIdSignal.set(e),this.communicationService.on("missing-simulation-states",(t,r,n)=>{this.onMissingSimulationStates(t,r,n)}),this.communicationService.on(`polylines-${e}`,(t,r)=>{this._isFetchingPolylinesSignal.set(!1),this._simulationPolylinesSignal.set(K$(t,r))})}unsetActiveSimulationId(){let e=this._activeSimulationIdSignal();this._activeSimulationIdSignal.set(null),this._simulationPolylinesSignal.set(null),this._isFetchingStatesSignal.set(!1),this._isFetchingPolylinesSignal.set(!1),this.communicationService.removeAllListeners("missing-simulation-states"),e&&this.communicationService.removeAllListeners(`polylines-${e}`),this._continuousEnvironmentsSignal.set([]),this.alreadyUpdatedEnvironmentUpdateIndexes=[],this.references=_I(),this._hasAllStatesSignal.set(!1)}get activeSimulationSignal(){return $t(()=>{let e=this._activeSimulationIdSignal();return e?this.dataService.simulationsSignal().find(n=>n.id===e)??null:null})}pauseSimulation(e){this.communicationService.emit("pause-simulation",e)}resumeSimulation(e){this.communicationService.emit("resume-simulation",e)}stopSimulation(e){this.communicationService.emit("stop-simulation",e)}editSimulationConfiguration(e,t){this.communicationService.emit("edit-simulation-configuration",e,t)}getMissingSimulationStates(e,t,r){this._isFetchingStatesSignal.set(!0),this.communicationService.emit("get-missing-simulation-states",e,t,r)}getPolylines(e){this._isFetchingPolylinesSignal.set(!0),this.communicationService.emit("get-polylines",e)}get simulationPolylinesSignal(){return this._simulationPolylinesSignal}get isFetchingStatesSignal(){return this._isFetchingStatesSignal}get isFetchingPolylinesSignal(){return this._isFetchingPolylinesSignal}get continuousEnvironmentsSignal(){return this._continuousEnvironmentsSignal}get hasAllStatesSignal(){return this._hasAllStatesSignal}onMissingSimulationStates(e,t,r){this.taskService.extractStateTask(e,t,n=>this.afterExtractStateTask(n,r))}afterExtractStateTask(e,t){if(e===null){console.error("Failed to extract missing simulation states from the server response."),this._isFetchingStatesSignal.set(!1);return}this.taskService.buildContinuousEnvironmentsTask(e,this.references,r=>this.afterBuildContinuousEnvironmentsTask(r,t))}afterBuildContinuousEnvironmentsTask(e,t){this._continuousEnvironmentsSignal.update(r=>{let n=[...r];for(let a of e){let o=n.findIndex(s=>s.startUpdateIndex===a.startUpdateIndex);o===-1?n.push(a):n[o]=a}return n.sort((a,o)=>a.startUpdateIndex-o.startUpdateIndex),N$(n,this.alreadyUpdatedEnvironmentUpdateIndexes),n}),typeof t!="boolean"?(console.error("Received invalid hasAllStates value from the server."),t=!1):this._hasAllStatesSignal.set(t),this._isFetchingStatesSignal.set(!1)}static \u0275fac=function(t){return new(t||i)(Zt(Qh),Zt(To),Zt(nd))};static \u0275prov=lt({token:i,factory:i.\u0275fac,providedIn:"root"})};function VRe(i,e){if(i&1){let t=vt();Z(0,"div",1)(1,"button",2),Le("click",function(){Ee(t);let n=Se();return Ae(n.action())}),ce(2),Q()()}if(i&2){let t=Se();oe(2),_t(" ",t.data.action," ")}}var KRe=["label"];function WRe(i,e){}var URe=Math.pow(2,31)-1,y0=class{_overlayRef;instance;containerInstance;_afterDismissed=new ct;_afterOpened=new ct;_onAction=new ct;_durationTimeoutId;_dismissedByAction=!1;constructor(e,t){this._overlayRef=t,this.containerInstance=e,e._onExit.subscribe(()=>this._finishDismiss())}dismiss(){this._afterDismissed.closed||this.containerInstance.exit(),clearTimeout(this._durationTimeoutId)}dismissWithAction(){this._onAction.closed||(this._dismissedByAction=!0,this._onAction.next(),this._onAction.complete(),this.dismiss()),clearTimeout(this._durationTimeoutId)}closeWithAction(){this.dismissWithAction()}_dismissAfter(e){this._durationTimeoutId=setTimeout(()=>this.dismiss(),Math.min(e,URe))}_open(){this._afterOpened.closed||(this._afterOpened.next(),this._afterOpened.complete())}_finishDismiss(){this._overlayRef.dispose(),this._onAction.closed||this._onAction.complete(),this._afterDismissed.next({dismissedByAction:this._dismissedByAction}),this._afterDismissed.complete(),this._dismissedByAction=!1}afterDismissed(){return this._afterDismissed}afterOpened(){return this.containerInstance._onEnter}onAction(){return this._onAction}},q$=new et("MatSnackBarData"),ey=class{politeness="assertive";announcementMessage="";viewContainerRef;duration=0;panelClass;direction;data=null;horizontalPosition="center";verticalPosition="bottom"},jRe=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275dir=ft({type:i,selectors:[["","matSnackBarLabel",""]],hostAttrs:[1,"mat-mdc-snack-bar-label","mdc-snackbar__label"]})}return i})(),qRe=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275dir=ft({type:i,selectors:[["","matSnackBarActions",""]],hostAttrs:[1,"mat-mdc-snack-bar-actions","mdc-snackbar__actions"]})}return i})(),ZRe=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275dir=ft({type:i,selectors:[["","matSnackBarAction",""]],hostAttrs:[1,"mat-mdc-snack-bar-action","mdc-snackbar__action"]})}return i})(),YRe=(()=>{class i{snackBarRef=te(y0);data=te(q$);constructor(){}action(){this.snackBarRef.dismissWithAction()}get hasAction(){return!!this.data.action}static \u0275fac=function(r){return new(r||i)};static \u0275cmp=tt({type:i,selectors:[["simple-snack-bar"]],hostAttrs:[1,"mat-mdc-simple-snack-bar"],exportAs:["matSnackBar"],decls:3,vars:2,consts:[["matSnackBarLabel",""],["matSnackBarActions",""],["mat-button","","matSnackBarAction","",3,"click"]],template:function(r,n){r&1&&(Z(0,"div",0),ce(1),Q(),je(2,VRe,3,1,"div",1)),r&2&&(oe(),_t(" ",n.data.message,`
|
1698
|
-
`),oe(),Je(n.hasAction?2:-1))},dependencies:[pn,jRe,qRe,ZRe],styles:[".mat-mdc-simple-snack-bar{display:flex}"],encapsulation:2,changeDetection:0})}return i})(),JRe={snackBarState:Cs("state",[Ms("void, hidden",mn({transform:"scale(0.8)",opacity:0})),Ms("visible",mn({transform:"scale(1)",opacity:1})),Ba("* => visible",Pa("150ms cubic-bezier(0, 0, 0.2, 1)")),Ba("* => void, * => hidden",Pa("75ms cubic-bezier(0.4, 0.0, 1, 1)",mn({opacity:0})))])},$Re=(()=>{class i extends Mh{_ngZone=te(Kt);_elementRef=te(Et);_changeDetectorRef=te(_i);_platform=te($i);snackBarConfig=te(ey);_document=te(li);_trackedModals=new Set;_announceDelay=150;_announceTimeoutId;_destroyed=!1;_portalOutlet;_onAnnounce=new ct;_onExit=new ct;_onEnter=new ct;_animationState="void";_live;_label;_role;_liveElementId=te(Di).getId("mat-snack-bar-container-live-");constructor(){super();let t=this.snackBarConfig;t.politeness==="assertive"&&!t.announcementMessage?this._live="assertive":t.politeness==="off"?this._live="off":this._live="polite",this._platform.FIREFOX&&(this._live==="polite"&&(this._role="status"),this._live==="assertive"&&(this._role="alert"))}attachComponentPortal(t){this._assertNotAttached();let r=this._portalOutlet.attachComponentPortal(t);return this._afterPortalAttached(),r}attachTemplatePortal(t){this._assertNotAttached();let r=this._portalOutlet.attachTemplatePortal(t);return this._afterPortalAttached(),r}attachDomPortal=t=>{this._assertNotAttached();let r=this._portalOutlet.attachDomPortal(t);return this._afterPortalAttached(),r};onAnimationEnd(t){let{fromState:r,toState:n}=t;if((n==="void"&&r!=="void"||n==="hidden")&&this._completeExit(),n==="visible"){let a=this._onEnter;this._ngZone.run(()=>{a.next(),a.complete()})}}enter(){this._destroyed||(this._animationState="visible",this._changeDetectorRef.markForCheck(),this._changeDetectorRef.detectChanges(),this._screenReaderAnnounce())}exit(){return this._ngZone.run(()=>{this._animationState="hidden",this._changeDetectorRef.markForCheck(),this._elementRef.nativeElement.setAttribute("mat-exit",""),clearTimeout(this._announceTimeoutId)}),this._onExit}ngOnDestroy(){this._destroyed=!0,this._clearFromModals(),this._completeExit()}_completeExit(){queueMicrotask(()=>{this._onExit.next(),this._onExit.complete()})}_afterPortalAttached(){let t=this._elementRef.nativeElement,r=this.snackBarConfig.panelClass;r&&(Array.isArray(r)?r.forEach(o=>t.classList.add(o)):t.classList.add(r)),this._exposeToModals();let n=this._label.nativeElement,a="mdc-snackbar__label";n.classList.toggle(a,!n.querySelector(`.${a}`))}_exposeToModals(){let t=this._liveElementId,r=this._document.querySelectorAll('body > .cdk-overlay-container [aria-modal="true"]');for(let n=0;n<r.length;n++){let a=r[n],o=a.getAttribute("aria-owns");this._trackedModals.add(a),o?o.indexOf(t)===-1&&a.setAttribute("aria-owns",o+" "+t):a.setAttribute("aria-owns",t)}}_clearFromModals(){this._trackedModals.forEach(t=>{let r=t.getAttribute("aria-owns");if(r){let n=r.replace(this._liveElementId,"").trim();n.length>0?t.setAttribute("aria-owns",n):t.removeAttribute("aria-owns")}}),this._trackedModals.clear()}_assertNotAttached(){this._portalOutlet.hasAttached()}_screenReaderAnnounce(){this._announceTimeoutId||this._ngZone.runOutsideAngular(()=>{this._announceTimeoutId=setTimeout(()=>{let t=this._elementRef.nativeElement.querySelector("[aria-hidden]"),r=this._elementRef.nativeElement.querySelector("[aria-live]");if(t&&r){let n=null;this._platform.isBrowser&&document.activeElement instanceof HTMLElement&&t.contains(document.activeElement)&&(n=document.activeElement),t.removeAttribute("aria-hidden"),r.appendChild(t),n?.focus(),this._onAnnounce.next(),this._onAnnounce.complete()}},this._announceDelay)})}static \u0275fac=function(r){return new(r||i)};static \u0275cmp=tt({type:i,selectors:[["mat-snack-bar-container"]],viewQuery:function(r,n){if(r&1&&(di(rc,7),di(KRe,7)),r&2){let a;St(a=kt())&&(n._portalOutlet=a.first),St(a=kt())&&(n._label=a.first)}},hostAttrs:[1,"mdc-snackbar","mat-mdc-snack-bar-container"],hostVars:1,hostBindings:function(r,n){r&1&&Z4("@state.done",function(o){return n.onAnimationEnd(o)}),r&2&&q4("@state",n._animationState)},features:[Ai],decls:6,vars:3,consts:[["label",""],[1,"mdc-snackbar__surface","mat-mdc-snackbar-surface"],[1,"mat-mdc-snack-bar-label"],["aria-hidden","true"],["cdkPortalOutlet",""]],template:function(r,n){r&1&&(Z(0,"div",1)(1,"div",2,0)(3,"div",3),je(4,WRe,0,0,"ng-template",4),Q(),Ge(5,"div"),Q()()),r&2&&(oe(5),Mt("aria-live",n._live)("role",n._role)("id",n._liveElementId))},dependencies:[rc],styles:[".mat-mdc-snack-bar-container{display:flex;align-items:center;justify-content:center;box-sizing:border-box;-webkit-tap-highlight-color:rgba(0,0,0,0);margin:8px}.mat-mdc-snack-bar-handset .mat-mdc-snack-bar-container{width:100vw}.mat-mdc-snackbar-surface{box-shadow:0px 3px 5px -1px rgba(0, 0, 0, 0.2), 0px 6px 10px 0px rgba(0, 0, 0, 0.14), 0px 1px 18px 0px rgba(0, 0, 0, 0.12);display:flex;align-items:center;justify-content:flex-start;box-sizing:border-box;padding-left:0;padding-right:8px}[dir=rtl] .mat-mdc-snackbar-surface{padding-right:0;padding-left:8px}.mat-mdc-snack-bar-container .mat-mdc-snackbar-surface{min-width:344px;max-width:672px}.mat-mdc-snack-bar-handset .mat-mdc-snackbar-surface{width:100%;min-width:0}@media(forced-colors: active){.mat-mdc-snackbar-surface{outline:solid 1px}}.mat-mdc-snack-bar-container .mat-mdc-snackbar-surface{color:var(--mdc-snackbar-supporting-text-color, var(--mat-sys-inverse-on-surface));border-radius:var(--mdc-snackbar-container-shape, var(--mat-sys-corner-extra-small));background-color:var(--mdc-snackbar-container-color, var(--mat-sys-inverse-surface))}.mdc-snackbar__label{width:100%;flex-grow:1;box-sizing:border-box;margin:0;padding:14px 8px 14px 16px}[dir=rtl] .mdc-snackbar__label{padding-left:8px;padding-right:16px}.mat-mdc-snack-bar-container .mdc-snackbar__label{font-family:var(--mdc-snackbar-supporting-text-font, var(--mat-sys-body-medium-font));font-size:var(--mdc-snackbar-supporting-text-size, var(--mat-sys-body-medium-size));font-weight:var(--mdc-snackbar-supporting-text-weight, var(--mat-sys-body-medium-weight));line-height:var(--mdc-snackbar-supporting-text-line-height, var(--mat-sys-body-medium-line-height))}.mat-mdc-snack-bar-actions{display:flex;flex-shrink:0;align-items:center;box-sizing:border-box}.mat-mdc-snack-bar-handset,.mat-mdc-snack-bar-container,.mat-mdc-snack-bar-label{flex:1 1 auto}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled).mat-unthemed{color:var(--mat-snack-bar-button-color, var(--mat-sys-inverse-primary))}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled){--mat-text-button-state-layer-color:currentColor;--mat-text-button-ripple-color:currentColor}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled) .mat-ripple-element{opacity:.1}"],encapsulation:2,data:{animation:[JRe.snackBarState]}})}return i})();function XRe(){return new ey}var QRe=new et("mat-snack-bar-default-options",{providedIn:"root",factory:XRe}),dM=(()=>{class i{_overlay=te(Rr);_live=te(iw);_injector=te(Ii);_breakpointObserver=te(df);_parentSnackBar=te(i,{optional:!0,skipSelf:!0});_defaultConfig=te(QRe);_snackBarRefAtThisLevel=null;simpleSnackBarComponent=YRe;snackBarContainerComponent=$Re;handsetCssClass="mat-mdc-snack-bar-handset";get _openedSnackBarRef(){let t=this._parentSnackBar;return t?t._openedSnackBarRef:this._snackBarRefAtThisLevel}set _openedSnackBarRef(t){this._parentSnackBar?this._parentSnackBar._openedSnackBarRef=t:this._snackBarRefAtThisLevel=t}constructor(){}openFromComponent(t,r){return this._attach(t,r)}openFromTemplate(t,r){return this._attach(t,r)}open(t,r="",n){let a=ye(ye({},this._defaultConfig),n);return a.data={message:t,action:r},a.announcementMessage===t&&(a.announcementMessage=void 0),this.openFromComponent(this.simpleSnackBarComponent,a)}dismiss(){this._openedSnackBarRef&&this._openedSnackBarRef.dismiss()}ngOnDestroy(){this._snackBarRefAtThisLevel&&this._snackBarRefAtThisLevel.dismiss()}_attachSnackBarContainer(t,r){let n=r&&r.viewContainerRef&&r.viewContainerRef.injector,a=Ii.create({parent:n||this._injector,providers:[{provide:ey,useValue:r}]}),o=new fl(this.snackBarContainerComponent,r.viewContainerRef,a),s=t.attach(o);return s.instance.snackBarConfig=r,s.instance}_attach(t,r){let n=ye(ye(ye({},new ey),this._defaultConfig),r),a=this._createOverlay(n),o=this._attachSnackBarContainer(a,n),s=new y0(o,a);if(t instanceof Ta){let l=new Xa(t,null,{$implicit:n.data,snackBarRef:s});s.instance=o.attachTemplatePortal(l)}else{let l=this._createInjector(n,s),c=new fl(t,void 0,l),u=o.attachComponentPortal(c);s.instance=u.instance}return this._breakpointObserver.observe(Jx.HandsetPortrait).pipe(gi(a.detachments())).subscribe(l=>{a.overlayElement.classList.toggle(this.handsetCssClass,l.matches)}),n.announcementMessage&&o._onAnnounce.subscribe(()=>{this._live.announce(n.announcementMessage,n.politeness)}),this._animateSnackBar(s,n),this._openedSnackBarRef=s,this._openedSnackBarRef}_animateSnackBar(t,r){t.afterDismissed().subscribe(()=>{this._openedSnackBarRef==t&&(this._openedSnackBarRef=null),r.announcementMessage&&this._live.clear()}),this._openedSnackBarRef?(this._openedSnackBarRef.afterDismissed().subscribe(()=>{t.containerInstance.enter()}),this._openedSnackBarRef.dismiss()):t.containerInstance.enter(),r.duration&&r.duration>0&&t.afterOpened().subscribe(()=>t._dismissAfter(r.duration))}_createOverlay(t){let r=new Ds;r.direction=t.direction;let n=this._overlay.position().global(),a=t.direction==="rtl",o=t.horizontalPosition==="left"||t.horizontalPosition==="start"&&!a||t.horizontalPosition==="end"&&a,s=!o&&t.horizontalPosition!=="center";return o?n.left("0"):s?n.right("0"):n.centerHorizontally(),t.verticalPosition==="top"?n.top("0"):n.bottom("0"),r.positionStrategy=n,this._overlay.create(r)}_createInjector(t,r){let n=t&&t.viewContainerRef&&t.viewContainerRef.injector;return Ii.create({parent:n||this._injector,providers:[{provide:y0,useValue:r},{provide:q$,useValue:t.data}]})}static \u0275fac=function(r){return new(r||i)};static \u0275prov=lt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var eDe=(i,e)=>e.group,tDe=(i,e)=>e.id;function iDe(i,e){if(i&1&&(Z(0,"span",12),ce(1),Vr(2,"percent"),Q()),i&2){let t=Se().$implicit;oe(),_t(" ",zd(2,1,t.completion,"1.2-2")," ")}}function rDe(i,e){if(i&1){let t=vt();Ri(0),Z(1,"button",16),Le("click",function(n){Ee(t);let a=Se().$implicit,o=Se(3);return Ae(o.editSimulationConfiguration(a,n))}),Z(2,"mat-icon"),ce(3,"settings"),Q()(),Ri(4)(5),Z(6,"button",16),Le("click",function(n){Ee(t);let a=fi(5),o=Se().$implicit,s=Se(3);return Ae(s.pauseResumeHandler(o.id,a,n))}),Z(7,"mat-icon"),ce(8),Q()(),Ri(9),Z(10,"button",16),Le("click",function(n){Ee(t);let a=Se().$implicit,o=Se(3);return Ae(o.stopSimulation(a.id,n))}),Z(11,"mat-icon"),ce(12,"stop"),Q()()}if(i&2){let t=Se().$implicit,r=t.status==="starting"||t.status==="stopping"||t.status==="lost";oe(),Re("disabled",r)("matTooltip","Configure");let n=t.status==="starting"||t.status==="stopping"||t.status==="lost";oe(4);let a=hr(t.status!=="paused");oe(),Re("disabled",n)("matTooltip",a?"Pause":"Resume"),oe(2),Ti(a?"pause":"play_arrow");let o=t.status==="starting"||t.status==="stopping"||t.status==="lost";oe(2),Re("disabled",o)("matTooltip","Stop")}}function nDe(i,e){if(i&1){let t=vt();Z(0,"button",26),Le("click",function(n){Ee(t);let a=Se().$implicit,o=Se(3);return Ae(o.exportSimulation(a.id,n))}),Z(1,"mat-icon"),ce(2,"cloud_download"),Q()(),Z(3,"button",26),Le("click",function(n){Ee(t);let a=Se().$implicit,o=Se(3);return Ae(o.deleteSimulation(a.id,a.name,n))}),Z(4,"mat-icon"),ce(5,"delete"),Q()()}i&2&&(Re("matTooltip","Export"),oe(3),Re("matTooltip","Delete"))}function aDe(i,e){if(i&1&&(Z(0,"span",27)(1,"span",19),ce(2,"Simulation Time:"),Q(),Z(3,"span",5),ce(4),Vr(5,"simulationTime"),Q()(),Z(6,"span",28)(7,"span",19),ce(8,"Simulation Estimated End Time:"),Q(),Z(9,"span",5),ce(10),Vr(11,"simulationTime"),Q()(),Z(12,"span",14)(13,"span",19),ce(14,"Completion:"),Q(),Z(15,"span",5),ce(16),Vr(17,"percent"),Q()(),Z(18,"span",29)(19,"span",19),ce(20,"Max Duration:"),Q(),Z(21,"span",5),ce(22),Q()()),i&2){let t=Se().$implicit;oe(4),_t(" ",t.simulationTime!==null?En(5,4,t.simulationTime):"N/A"," "),oe(6),_t(" ",t.simulationEstimatedEndTime!==null?En(11,6,t.simulationEstimatedEndTime):"N/A"," "),oe(6),_t(" ",zd(17,8,t.completion,"1.2-2")," "),oe(6),_t(" ",t.configuration.maxDuration!==null?(t.configuration.maxDuration/3600).toString()+"h":"N/A"," ")}}function oDe(i,e){if(i&1){let t=vt();Ri(0),Z(1,"div",7),Le("click",function(){let n=Ee(t).$implicit,a=Se(3);return Ae(a.toggleSelection(n.id))})("keydown.enter",function(){let n=Ee(t).$implicit,a=Se(3);return Ae(a.toggleSelection(n.id))}),Z(2,"div",8)(3,"mat-icon",9),ce(4,"circle "),Q(),Z(5,"div",10)(6,"div",1)(7,"span",11),ce(8),Q(),je(9,iDe,3,4,"span",12),Q(),Z(10,"div",13)(11,"span"),ce(12),Q(),Z(13,"div",14)(14,"span"),ce(15,"-"),Q(),Ri(16),Z(17,"span"),ce(18),Vr(19,"simulationTime"),Q(),Z(20,"span"),ce(21,"-"),Q(),Z(22,"span"),ce(23),Q(),Z(24,"span"),ce(25,"-"),Q(),Z(26,"span"),ce(27),Q(),Z(28,"span"),ce(29,"-"),Q(),Z(30,"span"),ce(31),Vr(32,"date"),Q()()()(),Z(33,"div",15),je(34,rDe,13,8)(35,nDe,6,2),Ri(36),Z(37,"button",16),Le("click",function(n){let a=Ee(t).$implicit,o=Se(3);return Ae(o.visualizeSimulation(a,n))}),Z(38,"mat-icon"),ce(39,"visibility"),Q()()()(),Z(40,"div",17)(41,"div",18)(42,"span",14)(43,"span",19),ce(44,"Id:"),Q(),Z(45,"span",20),Le("click",function(n){let a=Ee(t).$implicit,o=Se(3);return Ae(o.copyToClipboard(a.id,n))})("keydown.enter",function(n){let a=Ee(t).$implicit,o=Se(3);return Ae(o.copyToClipboard(a.id,n))}),ce(46),Q()(),Z(47,"span",21)(48,"span",19),ce(49,"Name:"),Q(),Z(50,"span",5),ce(51),Q()(),Z(52,"span",21)(53,"span",19),ce(54,"Input Data:"),Q(),Z(55,"span",5),ce(56),Q()(),Z(57,"span",14)(58,"span",19),ce(59,"Status:"),Q(),Z(60,"span",5),ce(61),Q()(),Z(62,"span",22)(63,"span",19),ce(64,"Start Time:"),Q(),Z(65,"span",5),ce(66),Vr(67,"date"),Q()(),Z(68,"span",23)(69,"span",19),ce(70,"Duration:"),Q(),Z(71,"span",5),ce(72),Vr(73,"simulationTime"),Q()(),Z(74,"span",14)(75,"span",19),ce(76,"Size:"),Q(),Z(77,"span",5),ce(78),Q()(),Z(79,"span",24)(80,"span",19),ce(81,"Simulation Start Time :"),Q(),Z(82,"span",5),ce(83),Vr(84,"simulationTime"),Q()(),Z(85,"span",25)(86,"span",19),ce(87,"Simulation End Time :"),Q(),Z(88,"span",5),ce(89),Vr(90,"simulationTime"),Q()()(),Z(91,"div",18),je(92,aDe,23,11),Q()()()}if(i&2){let t=e.$implicit,r=Se(2).$implicit,n=Se(),a=n.selectedSimulationIdSignal()===t.id;oe(),gt("selected",a),oe(2),yr("color","var(--"+n.getColorFromStatus(t.status)+"-text-color)"),oe(4),Re("matTooltip",t.name),oe(),Ti(t.name),oe(),Je(t.status==="running"||t.status==="paused"?9:-1),oe(2),yr("color","var(--"+n.getColorFromStatus(t.status)+"-text-color)"),oe(),_t(" ",t.status," ");let o=n.getDuration(t);oe(6),Ti(En(19,34,o)),oe(5),_t(" ",t.data," "),oe(4),_t(" ",n.megabytes(t.size)," "),oe(4),_t(" ",zd(32,36,t.startTime,"short")," "),oe(3),Je(r.group==="running"?34:-1),oe(),Je(r.group==="completed"?35:-1);let s=t.status==="corrupted"||t.status==="outdated"||t.status==="future";oe(2),Re("disabled",s)("matTooltip","Visualize"),oe(8),Re("matTooltip",t.id+" (Click to copy)")("matTooltipPosition","after"),oe(),Ti(t.id),oe(),Re("matTooltip",t.name),oe(4),Ti(t.name),oe(),Re("matTooltip",t.data),oe(4),Ti(t.data),oe(4),yr("color","var(--"+n.getColorFromStatus(t.status)+"-text-color)"),oe(),_t(" ",t.status," "),oe(5),_t(" ",zd(67,39,t.startTime,"short")," "),oe(6),Ti(En(73,42,n.getDuration(t))),oe(6),Ti(n.megabytes(t.size)),oe(5),_t(" ",t.simulationStartTime!==null?En(84,44,t.simulationStartTime):"N/A"," "),oe(6),_t(" ",t.simulationEndTime!==null?En(90,46,t.simulationEndTime):"N/A"," "),oe(3),Je(n.isSimulationRunning(t)?92:-1)}}function sDe(i,e){if(i&1&&(Z(0,"section",4),ui(1,oDe,93,48,"div",6,tDe),Q()),i&2){let t=Se().$implicit;oe(),hi(t.simulations)}}function lDe(i,e){i&1&&(Z(0,"span",5),ce(1,"No simulations"),Q())}function cDe(i,e){if(i&1&&(Z(0,"h3"),ce(1),Vr(2,"titlecase"),Q(),je(3,sDe,3,0,"section",4)(4,lDe,2,0,"span",5)),i&2){let t=e.$implicit;oe(),Ti(En(2,2,t.group)),oe(2),Je(t.simulations.length>0?3:4)}}var mM=class i{constructor(e,t,r,n,a,o,s){this.dataService=e;this.simulationService=t;this.dialogService=r;this.matDialogRef=n;this.httpService=a;this.communicationService=o;this.snackBar=s}groupedSimulationsSignal=$t(()=>{let e=this.simulationsSignal(),t=e.filter(n=>Bu.includes(n.status)),r=e.filter(n=>!Bu.includes(n.status));return[{group:"running",simulations:t},{group:"completed",simulations:r}]});_selectedSimulationIdSignal=Bt(null);get selectedSimulationIdSignal(){return this._selectedSimulationIdSignal}getColorFromStatus(e){switch(e){case"running":return"green";case"paused":return"yellow";case"starting":case"stopping":case"outdated":case"future":return"gray";case"completed":return"blue";case"lost":case"corrupted":return"red"}}editSimulationConfiguration(e,t){return Ce(this,null,function*(){t.stopPropagation();let r=yield hn(this.dialogService.openSimulationConfigurationDialog({mode:"edit",currentConfiguration:e.configuration}).afterClosed());r&&this.simulationService.editSimulationConfiguration(e.id,r.configuration.maxDuration)})}stopSimulation(e,t){return Ce(this,null,function*(){t.stopPropagation(),(yield hn(this.dialogService.openInformationDialog({title:"Stopping Simulation",message:"Are you sure you want to stop the simulation? This action cannot be undone.",type:"warning",confirmButtonOverride:null,cancelButtonOverride:null,canCancel:!0}).afterClosed()))&&this.simulationService.stopSimulation(e)})}visualizeSimulation(e,t){t.stopPropagation(),this.matDialogRef.close({simulationToVisualize:e})}get simulationsSignal(){return this.dataService.simulationsSignal}pauseResumeHandler(e,t,r){r.stopPropagation(),t?this.simulationService.pauseSimulation(e):this.simulationService.resumeSimulation(e)}importSimulation(){let e=document.createElement("input");e.type="file",e.webkitdirectory=!0,e.multiple=!0;let t=r=>Ce(this,null,function*(){let n=r.target.files;if(!n||n.length===0)return;let a=new Y$.default,o=n[0].webkitRelativePath.split("/")[0];for(let c of Array.from(n)){let u=c.webkitRelativePath.replace(o+"/","");a.file(u,c)}let s=yield a.generateAsync({type:"blob"}),l=new FormData;l.append("file",s,"folder.zip"),this.httpService.importFolder("simulation",o,l).subscribe({next:c=>{c.message?this.communicationService.emit("get-simulations"):c.error&&console.error("Upload failed:",c.error)},error:c=>{console.error("HTTP error during upload:",c)}})});e.addEventListener("change",r=>{t(r).catch(n=>{console.error("Error handling file change:",n)})}),e.click()}exportSimulation(e,t){t.stopPropagation(),this.httpService.exportFolder("simulation",e).subscribe(n=>{let a=new Blob([n],{type:"application/zip"}),o=window.URL.createObjectURL(a),s=document.createElement("a");s.href=o,s.download=e+".zip",document.body.appendChild(s),s.click(),document.body.removeChild(s),window.URL.revokeObjectURL(o)})}deleteSimulation(e,t,r){return Ce(this,null,function*(){if(r.stopPropagation(),!(yield this.confirmDeletion(t)))return;this.httpService.deleteFolder("simulation",e).subscribe({next:o=>{o.error&&console.error("Failed to delete simulation:",o.error),this.communicationService.emit("get-simulations")},error:o=>{console.error("HTTP error during deletion:",o)}})})}confirmDeletion(e){return Ce(this,null,function*(){return yield hn(this.dialogService.openInformationDialog({title:"Deleting Saved Simulation",message:`Are you sure you want to delete the simulation "${e}"? This action cannot be undone.`,type:"warning",confirmButtonOverride:null,cancelButtonOverride:null,canCancel:!0}).afterClosed())})}getDuration(e){return e.simulationStartTime===null?0:e.simulationEndTime!==null?e.simulationEndTime-e.simulationStartTime:e.simulationTime!==null?e.simulationTime-e.simulationStartTime:0}megabytes(e){return e===null||e<0?"unknown":`${(e/(1024*1024)).toFixed(2)} MB`}toggleSelection(e){this._selectedSimulationIdSignal()===e?this._selectedSimulationIdSignal.set(null):this._selectedSimulationIdSignal.set(e)}copyToClipboard(e,t){return Ce(this,null,function*(){t.stopPropagation(),yield navigator.clipboard.writeText(e).then(()=>{this.snackBar.open("Copied to clipboard!","Close",{duration:2e3})}).catch(r=>{console.error("Failed to copy text: ",r),this.snackBar.open("Failed to copy!","Close",{duration:2e3})})})}isSimulationRunning(e){return Bu.includes(e.status)}static \u0275fac=function(t){return new(t||i)(rt(Qh),rt(Ha),rt(Js),rt(jo),rt(Jg),rt(To),rt(dM))};static \u0275cmp=tt({type:i,selectors:[["app-simulation-list-dialog"]],decls:17,vars:1,consts:[["mat-dialog-title",""],[1,"flex-row","gap-1-rem"],["mat-raised-button","",3,"click","matTooltip"],["mat-button","","mat-dialog-close",""],[1,"flex-column","simulation-list"],[1,"light"],["tabindex","0",1,"list-item","flex-column","gap-0-5-rem","align-main-start","align-cross-stretch",3,"selected"],["tabindex","0",1,"list-item","flex-column","gap-0-5-rem","align-main-start","align-cross-stretch",3,"click","keydown.enter"],[1,"flex-row","align-main-start","align-cross-center","gap-1-rem"],[1,"status-icon"],[1,"flex-column","text-container"],[1,"bold","simulation-name",3,"matTooltip"],[1,"completion"],[1,"light","flex-row","gap-0-5-rem"],[1,"flex-row","gap-0-5-rem"],[1,"actions","align-self-end","flex-row","gap-0-5-rem"],["mat-icon-button","",3,"click","disabled","matTooltip"],[1,"flex-row","gap-0-5-rem","detailed-information"],[1,"flex-column","gap-0-5-rem"],[1,"bold","field"],["tabindex","0",1,"light","copy",3,"click","keydown.enter","matTooltip","matTooltipPosition"],[1,"flex-row","gap-0-5-rem",3,"matTooltip"],["matTooltip","Time when the user started the simulation",1,"flex-row","gap-0-5-rem"],["matTooltip","Time between the first and last events of the simulation. The real time of the processing could be different.",1,"flex-row","gap-0-5-rem"],["matTooltip","Time of the first event in the simulation",1,"flex-row","gap-0-5-rem"],["matTooltip","Time of the last event in the simulation",1,"flex-row","gap-0-5-rem"],["mat-icon-button","",3,"click","matTooltip"],["matTooltip","Time of the current event in the simulation",1,"flex-row","gap-0-5-rem"],["matTooltip","Estimated time of the last event of the simulation",1,"flex-row","gap-0-5-rem"],["matTooltip","User-defined maximum duration of the simulation",1,"flex-row","gap-0-5-rem"]],template:function(t,r){if(t&1){let n=vt();Z(0,"h2",0),ce(1,"Available Simulations"),Q(),Z(2,"mat-dialog-content")(3,"h3"),ce(4,"Actions"),Q(),Z(5,"section",1)(6,"button",2),Le("click",function(){return Ee(n),Ae(r.importSimulation())}),Z(7,"mat-icon"),ce(8,"cloud_upload"),Q(),Z(9,"span"),ce(10,"Import"),Q()()(),Ri(11),ui(12,cDe,5,4,null,null,eDe),Q(),Z(14,"mat-dialog-actions")(15,"button",3),ce(16,"Close"),Q()()}if(t&2){oe(6),Re("matTooltip","Import a simulation");let n=r.groupedSimulationsSignal();oe(6),hi(n)}},dependencies:[Os,Is,Fs,vo,Br,pn,Xl,ha,Rs,Eh,tc,So,pr,mr,Rn,Da,Ah,cx,rV,ed,tV],styles:[".flex-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.flex-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.align-center[_ngcontent-%COMP%], .align-main-center[_ngcontent-%COMP%]{justify-content:center}.align-center[_ngcontent-%COMP%], .align-cross-center[_ngcontent-%COMP%]{align-items:center}.align-main-end[_ngcontent-%COMP%]{justify-content:flex-end}.align-cross-end[_ngcontent-%COMP%]{align-items:flex-end}.align-main-start[_ngcontent-%COMP%]{justify-content:flex-start}.align-cross-start[_ngcontent-%COMP%]{align-items:flex-start}.align-cross-stretch[_ngcontent-%COMP%]{align-items:stretch}.gap-0-5-rem[_ngcontent-%COMP%]{gap:.5rem}.gap-1-rem[_ngcontent-%COMP%]{gap:1rem}.gap-1-5-rem[_ngcontent-%COMP%]{gap:1.5rem}.flex-1[_ngcontent-%COMP%]{flex:1}*[_ngcontent-%COMP%]{--red-text-color: #ff0000;--red-background-color: #ffdddd;--yellow-text-color: #ffc21b;--yellow-background-color: #ffe6a4;--green-text-color: #00aa00;--green-background-color: #ccffcc;--gray-text-color: #666666;--gray-background-color: #f0f0f0;--blue-text-color: #4488ff;--blue-background-color: #cce5ff;--loaded-slider-color: #005cbb88;--active-button-color: #cce6ff}.text-red[_ngcontent-%COMP%]{color:var(--red-text-color)}.background-red[_ngcontent-%COMP%]{background-color:var(--red-background-color)}.text-yellow[_ngcontent-%COMP%]{color:var(--yellow-text-color)}.background-yellow[_ngcontent-%COMP%]{background-color:var(--yellow-background-color)}.text-green[_ngcontent-%COMP%]{color:var(--green-text-color)}.background-green[_ngcontent-%COMP%]{background-color:var(--green-background-color)}.text-gray[_ngcontent-%COMP%]{color:var(--gray-text-color)}.background-gray[_ngcontent-%COMP%]{background-color:var(--gray-background-color)!important}.text-blue[_ngcontent-%COMP%]{color:var(--blue-text-color)}.background-blue[_ngcontent-%COMP%]{background-color:var(--blue-background-color)}.align-self-end[_ngcontent-%COMP%]{margin-inline-start:auto}.list-item[_ngcontent-%COMP%]{border-radius:.5rem;padding-inline:1rem;padding-block:.25rem;cursor:pointer}.list-item[_ngcontent-%COMP%]:is(:hover,.selected){background-color:#f0f0f0}.list-item[_ngcontent-%COMP%]:is(:hover,.selected) .actions[_ngcontent-%COMP%]{display:flex}.list-item.selected[_ngcontent-%COMP%] .detailed-information[_ngcontent-%COMP%]{display:flex}.list-item[_ngcontent-%COMP%] :is(.actions[_ngcontent-%COMP%], .detailed-information[_ngcontent-%COMP%]){display:none}.detailed-information[_ngcontent-%COMP%]{padding-inline-start:calc(24px + 1rem)}.detailed-information[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1}.detailed-information[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{overflow:hidden;word-wrap:break-word;white-space:nowrap}.detailed-information[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > span[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]:nth-child(2){overflow:hidden;text-overflow:ellipsis}.completion[_ngcontent-%COMP%]{flex-shrink:0}.simulation-name[_ngcontent-%COMP%]{word-wrap:break-word;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.light[_ngcontent-%COMP%]{font-weight:300}.bold[_ngcontent-%COMP%]{font-weight:500}.status-icon[_ngcontent-%COMP%]{flex-shrink:0}.text-container[_ngcontent-%COMP%]{flex:1;min-width:0;overflow:hidden}.text-container[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{white-space:nowrap}.copy[_ngcontent-%COMP%]{cursor:pointer}.copy[_ngcontent-%COMP%]:hover{text-decoration:underline;font-weight:700}"]})};var pM=class i{static \u0275fac=function(t){return new(t||i)};static \u0275cmp=tt({type:i,selectors:[["app-user-guide-dialog"]],decls:156,vars:0,consts:[[1,"dialog-header"],["mat-dialog-title",""],["mat-button","","mat-dialog-close",""],[1,"flex-column"],["src","/images/control-bar.png","alt","control-bar.png"],[2,"display","flex","align-items","flex-start","gap","20px"],["src","/images/simulation-control-bar.png","alt","Simulation Control Bar",2,"max-width","300px","height","auto"]],template:function(t,r){t&1&&(Z(0,"div",0)(1,"h2",1),ce(2,"Multimodal Simulation Visualization"),Q(),Z(3,"mat-dialog-actions")(4,"button",2),ce(5,"Close"),Q()()(),Z(6,"mat-dialog-content")(7,"section",3)(8,"h1"),ce(9,"Getting Started"),Q(),Z(10,"p"),ce(11," Welcome to the Multimodal Simulation Visualization. This guide will help you understand how to use all the features. "),Q()(),Z(12,"section",3)(13,"h3"),ce(14,"Starting a simulation"),Q(),Z(15,"p"),ce(16," To start a new simulation, click the "),Z(17,"strong"),ce(18,"Start Simulation"),Q(),ce(19," button from the main menu. You will be presented with the simulation configuration window where you will have to input a few parameters. "),Q(),Z(20,"p"),ce(21," First, you need to name your simulation. We suggest choosing a unique name. It is not necessary, but might lead to confusion later if you want to replay a simulation and it has the same name as an already existing one. "),Q(),Z(22,"p"),ce(23," Next, you need to choose the input data. You can choose one of the existing presets or use the import option to add your own. The import option is the first one in the dropdown menu when selecting the data source. Your import folder does not have to be zipped. We will do that for you. We will also add an index to your imported folder if one by the same name exists already. "),Q(),Z(24,"p"),ce(25," If you wish to run a simulation to get the output logs but do not care about seeing it, you can check the "),Z(26,"strong"),ce(27,"Run in the background"),Q(),ce(28,' option. That will launch the simulation and redirect you to the main menu. You can always visualize any running simulation at any moment by finding it in the "Available Simulations" window. '),Q(),Z(29,"p"),ce(30," Optionally, define a simulation duration. This defines the maximum amount of in-simulation hours for which the events will be calculated. By default, the simulation will continue until it runs out of events. "),Q()(),Z(31,"section",3)(32,"h3"),ce(33,"Viewing Existing Simulations"),Q(),Z(34,"p"),ce(35," To access saved or background simulations, you can click the "),Z(36,"strong"),ce(37,"Browse Simulations"),Q(),ce(38," button in the main menu. This will show you a list of available simulations as well as their state. "),Q(),Z(39,"p"),ce(40," Here you can stop running simulations as well as delete, import, and export finished ones. The rules for importing simulations are the same as for the starting data. No need to zip the folders\u2014we'll do it for you. Again, try avoiding importing simulations with the same name. It will make it hard to understand which one you are trying to run. "),Q()(),Z(41,"section",3)(42,"h1"),ce(43,"Interacting with a simulation"),Q(),Z(44,"p"),ce(45," Now that you have launched a simulation, let's learn how to control it. "),Q()(),Z(46,"section",3)(47,"h3"),ce(48,"Main Control Bar"),Q(),Z(49,"p"),ce(50," This bar allows you to control the current simulation visualization. No matter what you do within this bar, it will not affect the calculation and processing of the simulation events. "),Q(),Ge(51,"img",4),Z(52,"p"),ce(53," Most of the buttons here are self-explanatory. Still, here is a quick rundown: "),Q(),Z(54,"p"),ce(55," 1. The classic pause/play button. It does not affect the simulation processing, only the visualization. "),Q(),Z(56,"p"),ce(57," 2. Visualization speed setting. This defines how fast things are happening. Adjust it to speed up or slow down your visualization. Note that entity movements might become janky if you go above x32 speed. "),Q(),Z(58,"p"),ce(59," 3. These are the time skip buttons. They will move you a number of seconds forwards or backwards in the simulation. The number of seconds is the same as the speed multiplier. "),Q(),Z(60,"p"),ce(61," 4. This button allows you to toggle the visualization direction. You can play it forwards or backwards. "),Q(),Z(62,"p"),ce(63," 5. The map center button allows you to center the map on the entities in case you wander off on the map. "),Q(),Z(64,"p"),ce(65," 6. The entity follow button allows you to follow the selected entity on the map without losing focus. "),Q(),Z(66,"p"),ce(67," 7. The progress bar allows you to instantly skip to a time within the simulation. However, if you are actively running a simulation, you can only jump to a timestamp before the grey circle, as anything past that is yet to be calculated. If you are replaying a saved simulation, you can jump to any timestamp at any time. "),Q(),Z(68,"p"),ce(69," 8. The main menu button will send you back to ... the main menu. If you are running a simulation, it will continue to run in the background. If you are replaying a saved simulation, it will stop running. "),Q()(),Z(70,"section",3)(71,"h3"),ce(72,"The Simulation Status Control"),Q(),Z(73,"div",5),Ge(74,"img",6),Z(75,"div")(76,"p"),ce(77," This is the control bar for the actual simulation happening on the backend. This little window allows you to pause the simulation processing, adjust the maximum simulation duration, or stop the simulation completely. "),Q(),Z(78,"p"),ce(79," Note that a stop and a pause are not the same. A stopped simulation is effectively completed and cannot be resumed, only replayed. "),Q(),Z(80,"p"),ce(81," The "),Z(82,"strong"),ce(83,"Estimated end"),Q(),ce(84," is the in-simulation time at which the simulation is expected to end. It has nothing to do with the time in real life. "),Q()()()(),Z(85,"section",3)(86,"h3"),ce(87,"The Information Panel"),Q(),Z(88,"p"),ce(89," This panel displays useful information about your current simulation. You can access it by clicking any of the icons in the top left corner of your screen. Here you can check the simulation name and source files, see the statistics, access entities that are not displayed on the map, and check detailed information about the entity you have selected. "),Q()(),Z(90,"section",3)(91,"h3"),ce(92,"Searching and Entity Selection"),Q(),Z(93,"p"),ce(94," There are a few ways you can select an entity such as a passenger or a vehicle The easiest way would be by simply clicking it on the map. If multiple entities are clumped together, a small dialog will pop up, allowing you to make a more precise choice. Your selected entity will be highlighted in yellow, and you will see its past and future legs if they exist. "),Q(),Z(95,"p"),ce(96," You can also select an entity by using the search bar. To open the bar, click on the "),Z(97,"mat-icon"),ce(98,"search"),Q(),ce(99," in the top right corner of your screen. You can search for any entity by typing its ID and selecting it among the autocomplete suggestions. For passengers, you can also find them using their names. "),Q(),Z(100,"p")(101,"strong"),ce(102,"Pro Tip:"),Q(),ce(103,' If you are looking for a vehicle with a specific mode, you can start a search with "mode:". This will prompt you to make a selection, and only vehicles matching your selected mode will be shown in the autocomplete suggestions. '),Q(),Z(104,"p"),ce(105," A history of your selected entities can be accessed by clicking on the "),Z(106,"mat-icon"),ce(107,"history"),Q(),ce(108," icon in the top right corner. "),Q(),Z(109,"p"),ce(110," Once you have selected an entity you can navigate to the selected entity section of the information panel by clicking the "),Z(111,"mat-icon"),ce(112,"touch_app"),Q(),ce(113," icon, and view details such as the entity's ID, name, status, route, etc. In this very section, you can also set the entity as a favorite by clicking the "),Z(114,"mat-icon"),ce(115,"favorite"),Q(),ce(116,". To see the full list of your favorites, click on the "),Z(117,"mat-icon"),ce(118,"star"),Q(),ce(119," in the top right corner. "),Q()(),Z(120,"section",3)(121,"h3"),ce(122,"Display Options"),Q(),Z(123,"p"),ce(124," You have access to a few filters and themes in the top right corner of your simulation. You can decide which entities to display, select a theme for your map, and even change the icons. "),Q(),Z(125,"p"),ce(126," To filter out what is displayed on the map, click the "),Z(127,"mat-icon"),ce(128,"filter_list"),Q(),ce(129," next to the search section. This will allow you to only show certain categories of entities, as well as allow you to see the ones that are completed and no longer shown by default. "),Q(),Z(130,"p"),ce(131," You can change the map theme under the "),Z(132,"mat-icon"),ce(133,"layers"),Q(),ce(134," section. We supply a few themes by default including a dark one, but you are free to add your own. We suggest using OpenStreetMap to avoid compatibility issues. "),Q(),Z(135,"p"),ce(136," In the same section, you can change the icons. The icon editor window is pretty self-explanatory when it comes to changing the base icons. However, adding custom ones might be a bit confusing. When you add a custom icon, you will be prompted to type in a vehicle mode. Make sure you type it in correctly, as the field is case-sensitive. If a certain vehicle mode does not have its own icon, the default vehicle type (e.g., Bus) icon will be used. "),Q(),Z(137,"p"),ce(138," When adding new icons, we strongly recommend using transparent or white images with a black outline. Otherwise, the tinting showing the occupancy of a vehicle or stop might not work as expected. "),Q(),Z(139,"p"),ce(140," You can export and import icons in bulk. The export button will generate a JSON file with images encoded in base64. You can modify it directly and then import it to change a few icons at a time. "),Q()(),Z(141,"section",3)(142,"h1"),ce(143,"Folder Structure"),Q(),Z(144,"p"),ce(145," While we do allow imports and exports of important folders, you might still want to access the raw data without having to deal with creating a copy on your machine. "),Q(),Z(146,"p"),ce(147," All the input data used to launch a simulation is located in the "),Z(148,"strong"),ce(149,"/data"),Q(),ce(150," folder within the root directory of your project. "),Q(),Z(151,"p"),ce(152," The completed and saved simulations are located in the "),Z(153,"strong"),ce(154,"/multimodal-server/saved-simulations"),Q(),ce(155," folder within the root directory of your project. "),Q()()())},dependencies:[SU,Is,Fs,Os,vo,Br,pn,pr,mr],styles:[".flex-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.flex-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.align-center[_ngcontent-%COMP%], .align-main-center[_ngcontent-%COMP%]{justify-content:center}.align-center[_ngcontent-%COMP%], .align-cross-center[_ngcontent-%COMP%]{align-items:center}.align-main-end[_ngcontent-%COMP%]{justify-content:flex-end}.align-cross-end[_ngcontent-%COMP%]{align-items:flex-end}.align-main-start[_ngcontent-%COMP%]{justify-content:flex-start}.align-cross-start[_ngcontent-%COMP%]{align-items:flex-start}.align-cross-stretch[_ngcontent-%COMP%]{align-items:stretch}.gap-0-5-rem[_ngcontent-%COMP%]{gap:.5rem}.gap-1-rem[_ngcontent-%COMP%]{gap:1rem}.gap-1-5-rem[_ngcontent-%COMP%]{gap:1.5rem}.flex-1[_ngcontent-%COMP%]{flex:1}*[_ngcontent-%COMP%]{--red-text-color: #ff0000;--red-background-color: #ffdddd;--yellow-text-color: #ffc21b;--yellow-background-color: #ffe6a4;--green-text-color: #00aa00;--green-background-color: #ccffcc;--gray-text-color: #666666;--gray-background-color: #f0f0f0;--blue-text-color: #4488ff;--blue-background-color: #cce5ff;--loaded-slider-color: #005cbb88;--active-button-color: #cce6ff}.text-red[_ngcontent-%COMP%]{color:var(--red-text-color)}.background-red[_ngcontent-%COMP%]{background-color:var(--red-background-color)}.text-yellow[_ngcontent-%COMP%]{color:var(--yellow-text-color)}.background-yellow[_ngcontent-%COMP%]{background-color:var(--yellow-background-color)}.text-green[_ngcontent-%COMP%]{color:var(--green-text-color)}.background-green[_ngcontent-%COMP%]{background-color:var(--green-background-color)}.text-gray[_ngcontent-%COMP%]{color:var(--gray-text-color)}.background-gray[_ngcontent-%COMP%]{background-color:var(--gray-background-color)!important}.text-blue[_ngcontent-%COMP%]{color:var(--blue-text-color)}.background-blue[_ngcontent-%COMP%]{background-color:var(--blue-background-color)}mat-dialog-content[_ngcontent-%COMP%]{max-height:80vh;height:80vh;overflow-y:auto;padding:16px}mat-icon[_ngcontent-%COMP%]{font-size:1.2em;height:auto;width:auto;vertical-align:middle;margin:0 2px}.flex-column[_ngcontent-%COMP%]{margin-bottom:.5rem}.guide-image[_ngcontent-%COMP%]{max-width:100%;margin:1rem 0;border:1px solid #ddd;border-radius:4px}h1[_ngcontent-%COMP%]{font-size:1.5rem;margin-bottom:1rem;color:var(--primary-color)}h3[_ngcontent-%COMP%]{font-size:1.2rem;margin-bottom:.8rem;color:var(--secondary-color)}p[_ngcontent-%COMP%]{margin:.5rem 0}.align-self-end[_ngcontent-%COMP%]{margin-inline-start:auto}.light[_ngcontent-%COMP%]{font-weight:300}.bold[_ngcontent-%COMP%]{font-weight:500}.list-item[_ngcontent-%COMP%], .actions[_ngcontent-%COMP%]{display:none}.dialog-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin:0}.dialog-header[_ngcontent-%COMP%] mat-dialog-title[_ngcontent-%COMP%]{margin:0}.dialog-header[_ngcontent-%COMP%] mat-dialog-actions[_ngcontent-%COMP%]{margin:0;padding:10px}"]})};var Js=class i{constructor(e){this.matDialog=e}openSimulationConfigurationDialog(e){return this.matDialog.open(nM,{data:e,disableClose:!0,autoFocus:!1,maxHeight:"80vh",width:"600px"})}openSimulationListDialog(){return this.matDialog.open(mM,{data:null,disableClose:!0,autoFocus:!1,maxWidth:"80vw",maxHeight:"80vh",width:"840px"})}openInformationDialog(e){return this.matDialog.open(rM,{data:e,disableClose:!0,autoFocus:!1,maxWidth:"80vw",maxHeight:"80vh",width:"600px"})}openAddMapTileDialog(){return this.matDialog.open(Lw,{data:null,disableClose:!0,autoFocus:!1,maxWidth:"80vw",maxHeight:"80vh",minWidth:"600px"})}openUserGuide(){let e=window.innerHeight*.9,t=window.innerWidth*.8,r=4/3*e,n=Math.min(t,r);return this.matDialog.open(pM,{width:`${n}px`,height:`${e}px`,maxHeight:"90vh",maxWidth:"80vw",panelClass:"user-guide-dialog"})}openEditMapIconsDialog(){return this.matDialog.open(iM,{data:null,disableClose:!0,autoFocus:!1,maxWidth:"80vw",maxHeight:"80vh",width:"800px"})}static \u0275fac=function(t){return new(t||i)(Zt(lm))};static \u0275prov=lt({token:i,factory:i.\u0275fac,providedIn:"root"})};var uDe=["determinateSpinner"];function hDe(i,e){if(i&1&&(Sr(),Z(0,"svg",11),Ge(1,"circle",12),Q()),i&2){let t=Se();Mt("viewBox",t._viewBox()),oe(),yr("stroke-dasharray",t._strokeCircumference(),"px")("stroke-dashoffset",t._strokeCircumference()/2,"px")("stroke-width",t._circleStrokeWidth(),"%"),Mt("r",t._circleRadius())}}var dDe=new et("mat-progress-spinner-default-options",{providedIn:"root",factory:mDe});function mDe(){return{diameter:J$}}var J$=100,pDe=10,$$=(()=>{class i{_elementRef=te(Et);_noopAnimations;get color(){return this._color||this._defaultColor}set color(t){this._color=t}_color;_defaultColor="primary";_determinateCircle;constructor(){let t=te(nr,{optional:!0}),r=te(dDe);this._noopAnimations=t==="NoopAnimations"&&!!r&&!r._forceAnimations,this.mode=this._elementRef.nativeElement.nodeName.toLowerCase()==="mat-spinner"?"indeterminate":"determinate",r&&(r.color&&(this.color=this._defaultColor=r.color),r.diameter&&(this.diameter=r.diameter),r.strokeWidth&&(this.strokeWidth=r.strokeWidth))}mode;get value(){return this.mode==="determinate"?this._value:0}set value(t){this._value=Math.max(0,Math.min(100,t||0))}_value=0;get diameter(){return this._diameter}set diameter(t){this._diameter=t||0}_diameter=J$;get strokeWidth(){return this._strokeWidth??this.diameter/10}set strokeWidth(t){this._strokeWidth=t||0}_strokeWidth;_circleRadius(){return(this.diameter-pDe)/2}_viewBox(){let t=this._circleRadius()*2+this.strokeWidth;return`0 0 ${t} ${t}`}_strokeCircumference(){return 2*Math.PI*this._circleRadius()}_strokeDashOffset(){return this.mode==="determinate"?this._strokeCircumference()*(100-this._value)/100:null}_circleStrokeWidth(){return this.strokeWidth/this.diameter*100}static \u0275fac=function(r){return new(r||i)};static \u0275cmp=tt({type:i,selectors:[["mat-progress-spinner"],["mat-spinner"]],viewQuery:function(r,n){if(r&1&&di(uDe,5),r&2){let a;St(a=kt())&&(n._determinateCircle=a.first)}},hostAttrs:["role","progressbar","tabindex","-1",1,"mat-mdc-progress-spinner","mdc-circular-progress"],hostVars:18,hostBindings:function(r,n){r&2&&(Mt("aria-valuemin",0)("aria-valuemax",100)("aria-valuenow",n.mode==="determinate"?n.value:null)("mode",n.mode),dn("mat-"+n.color),yr("width",n.diameter,"px")("height",n.diameter,"px")("--mdc-circular-progress-size",n.diameter+"px")("--mdc-circular-progress-active-indicator-width",n.diameter+"px"),gt("_mat-animation-noopable",n._noopAnimations)("mdc-circular-progress--indeterminate",n.mode==="indeterminate"))},inputs:{color:"color",mode:"mode",value:[2,"value","value",lr],diameter:[2,"diameter","diameter",lr],strokeWidth:[2,"strokeWidth","strokeWidth",lr]},exportAs:["matProgressSpinner"],features:[si],decls:14,vars:11,consts:[["circle",""],["determinateSpinner",""],["aria-hidden","true",1,"mdc-circular-progress__determinate-container"],["xmlns","http://www.w3.org/2000/svg","focusable","false",1,"mdc-circular-progress__determinate-circle-graphic"],["cx","50%","cy","50%",1,"mdc-circular-progress__determinate-circle"],["aria-hidden","true",1,"mdc-circular-progress__indeterminate-container"],[1,"mdc-circular-progress__spinner-layer"],[1,"mdc-circular-progress__circle-clipper","mdc-circular-progress__circle-left"],[3,"ngTemplateOutlet"],[1,"mdc-circular-progress__gap-patch"],[1,"mdc-circular-progress__circle-clipper","mdc-circular-progress__circle-right"],["xmlns","http://www.w3.org/2000/svg","focusable","false",1,"mdc-circular-progress__indeterminate-circle-graphic"],["cx","50%","cy","50%"]],template:function(r,n){if(r&1&&(je(0,hDe,2,8,"ng-template",null,0,Gp),Z(2,"div",2,1),Sr(),Z(4,"svg",3),Ge(5,"circle",4),Q()(),ex(),Z(6,"div",5)(7,"div",6)(8,"div",7),Od(9,8),Q(),Z(10,"div",9),Od(11,8),Q(),Z(12,"div",10),Od(13,8),Q()()()),r&2){let a=Or(1);oe(4),Mt("viewBox",n._viewBox()),oe(),yr("stroke-dasharray",n._strokeCircumference(),"px")("stroke-dashoffset",n._strokeDashOffset(),"px")("stroke-width",n._circleStrokeWidth(),"%"),Mt("r",n._circleRadius()),oe(4),Re("ngTemplateOutlet",a),oe(2),Re("ngTemplateOutlet",a),oe(2),Re("ngTemplateOutlet",a)}},dependencies:[Wp],styles:[".mat-mdc-progress-spinner{display:block;overflow:hidden;line-height:0;position:relative;direction:ltr;transition:opacity 250ms cubic-bezier(0.4, 0, 0.6, 1)}.mat-mdc-progress-spinner circle{stroke-width:var(--mdc-circular-progress-active-indicator-width, 4px)}.mat-mdc-progress-spinner._mat-animation-noopable,.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__determinate-circle{transition:none !important}.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__indeterminate-circle-graphic,.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__spinner-layer,.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__indeterminate-container{animation:none !important}.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__indeterminate-container circle{stroke-dasharray:0 !important}@media(forced-colors: active){.mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic,.mat-mdc-progress-spinner .mdc-circular-progress__determinate-circle{stroke:currentColor;stroke:CanvasText}}.mdc-circular-progress__determinate-container,.mdc-circular-progress__indeterminate-circle-graphic,.mdc-circular-progress__indeterminate-container,.mdc-circular-progress__spinner-layer{position:absolute;width:100%;height:100%}.mdc-circular-progress__determinate-container{transform:rotate(-90deg)}.mdc-circular-progress--indeterminate .mdc-circular-progress__determinate-container{opacity:0}.mdc-circular-progress__indeterminate-container{font-size:0;letter-spacing:0;white-space:nowrap;opacity:0}.mdc-circular-progress--indeterminate .mdc-circular-progress__indeterminate-container{opacity:1;animation:mdc-circular-progress-container-rotate 1568.2352941176ms linear infinite}.mdc-circular-progress__determinate-circle-graphic,.mdc-circular-progress__indeterminate-circle-graphic{fill:rgba(0,0,0,0)}.mat-mdc-progress-spinner .mdc-circular-progress__determinate-circle,.mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic{stroke:var(--mdc-circular-progress-active-indicator-color, var(--mat-sys-primary))}@media(forced-colors: active){.mat-mdc-progress-spinner .mdc-circular-progress__determinate-circle,.mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic{stroke:CanvasText}}.mdc-circular-progress__determinate-circle{transition:stroke-dashoffset 500ms cubic-bezier(0, 0, 0.2, 1)}.mdc-circular-progress__gap-patch{position:absolute;top:0;left:47.5%;box-sizing:border-box;width:5%;height:100%;overflow:hidden}.mdc-circular-progress__gap-patch .mdc-circular-progress__indeterminate-circle-graphic{left:-900%;width:2000%;transform:rotate(180deg)}.mdc-circular-progress__circle-clipper .mdc-circular-progress__indeterminate-circle-graphic{width:200%}.mdc-circular-progress__circle-right .mdc-circular-progress__indeterminate-circle-graphic{left:-100%}.mdc-circular-progress--indeterminate .mdc-circular-progress__circle-left .mdc-circular-progress__indeterminate-circle-graphic{animation:mdc-circular-progress-left-spin 1333ms cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress--indeterminate .mdc-circular-progress__circle-right .mdc-circular-progress__indeterminate-circle-graphic{animation:mdc-circular-progress-right-spin 1333ms cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress__circle-clipper{display:inline-flex;position:relative;width:50%;height:100%;overflow:hidden}.mdc-circular-progress--indeterminate .mdc-circular-progress__spinner-layer{animation:mdc-circular-progress-spinner-layer-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both}@keyframes mdc-circular-progress-container-rotate{to{transform:rotate(360deg)}}@keyframes mdc-circular-progress-spinner-layer-rotate{12.5%{transform:rotate(135deg)}25%{transform:rotate(270deg)}37.5%{transform:rotate(405deg)}50%{transform:rotate(540deg)}62.5%{transform:rotate(675deg)}75%{transform:rotate(810deg)}87.5%{transform:rotate(945deg)}100%{transform:rotate(1080deg)}}@keyframes mdc-circular-progress-left-spin{from{transform:rotate(265deg)}50%{transform:rotate(130deg)}to{transform:rotate(265deg)}}@keyframes mdc-circular-progress-right-spin{from{transform:rotate(-265deg)}50%{transform:rotate(-130deg)}to{transform:rotate(-265deg)}}"],encapsulation:2,changeDetection:0})}return i})();var X$=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275mod=Lt({type:i});static \u0275inj=Dt({imports:[ti]})}return i})();function gDe(i,e){if(i&1&&(Z(0,"p",2),ce(1),Q()),i&2){let t=Se();oe(),Ti(t.data.message)}}var fM=class i{constructor(e){this.data=e}static \u0275fac=function(t){return new(t||i)(rt(sm))};static \u0275cmp=tt({type:i,selectors:[["app-loading-dialog"]],decls:3,vars:2,consts:[[1,"flex-row","content"],[3,"diameter"],[1,"message"]],template:function(t,r){t&1&&(Z(0,"mat-dialog-content",0),Ge(1,"mat-spinner",1),je(2,gDe,2,1,"p",2),Q()),t&2&&(oe(),Re("diameter",30),oe(),Je(r.data.message?2:-1))},dependencies:[vo,X$,$$],styles:[".flex-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.flex-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.align-center[_ngcontent-%COMP%], .align-main-center[_ngcontent-%COMP%]{justify-content:center}.align-center[_ngcontent-%COMP%], .align-cross-center[_ngcontent-%COMP%]{align-items:center}.align-main-end[_ngcontent-%COMP%]{justify-content:flex-end}.align-cross-end[_ngcontent-%COMP%]{align-items:flex-end}.align-main-start[_ngcontent-%COMP%]{justify-content:flex-start}.align-cross-start[_ngcontent-%COMP%]{align-items:flex-start}.align-cross-stretch[_ngcontent-%COMP%]{align-items:stretch}.gap-0-5-rem[_ngcontent-%COMP%]{gap:.5rem}.gap-1-rem[_ngcontent-%COMP%]{gap:1rem}.gap-1-5-rem[_ngcontent-%COMP%]{gap:1.5rem}.flex-1[_ngcontent-%COMP%]{flex:1}.content[_ngcontent-%COMP%]{justify-content:center;align-items:center;gap:20px}.message[_ngcontent-%COMP%]{margin:0}"]})};var ty=class i{constructor(e){this.matDialog=e}loadingDialogRef=null;start(e){this.loadingDialogRef=this.matDialog.open(fM,{data:{message:e},disableClose:!0,autoFocus:!1,maxHeight:"80vh",maxWidth:"80vw",width:"200px"})}stop(){this.loadingDialogRef&&(this.loadingDialogRef.close(),this.loadingDialogRef=null)}static \u0275fac=function(t){return new(t||i)(Zt(lm))};static \u0275prov=lt({token:i,factory:i.\u0275fac,providedIn:"root"})};function yDe(i,e){if(i&1){let t=vt();Z(0,"div",0)(1,"h1",1),ce(2," Multimodal Simulation Visualization "),Q(),Z(3,"button",2),Le("click",function(){Ee(t);let n=Se();return Ae(n.onStartSimulation())}),Z(4,"mat-icon"),ce(5,"add_circle_outline"),Q(),Z(6,"span"),ce(7,"Start a simulation"),Q()(),Z(8,"button",2),Le("click",function(){Ee(t);let n=Se();return Ae(n.onBrowseSimulations())}),Z(9,"mat-icon"),ce(10,"folder_open"),Q(),Z(11,"span"),ce(12,"Browse simulations"),Q()(),Z(13,"div",3)(14,"button",4),Le("click",function(){Ee(t);let n=Se();return Ae(n.onUserGuide())}),Z(15,"mat-icon"),ce(16,"info"),Q(),Z(17,"span"),ce(18,"User guide"),Q()(),Ge(19,"app-github-button",5),Q()()}}var gM=class i{constructor(e,t,r,n){this.dialogService=e;this.loadingService=t;this.communicationService=r;this.router=n}shouldShowMainMenuSignal=Bt(!0);onStartSimulation(){return Ce(this,null,function*(){this.shouldShowMainMenuSignal.set(!1);let e=yield hn(this.dialogService.openSimulationConfigurationDialog({mode:"start",currentConfiguration:null}).afterClosed());if(!e){this.shouldShowMainMenuSignal.set(!0);return}if(!this.communicationService.isConnectedSignal()){yield hn(this.dialogService.openInformationDialog({title:"Disconnected",message:"A connection to the server is needed to create a simulation.",type:"error",confirmButtonOverride:null,cancelButtonOverride:null,canCancel:!1}).afterClosed()),this.shouldShowMainMenuSignal.set(!0);return}this.loadingService.start("Starting simulation");let t=Math.random().toString(36).substring(7)+Date.now();try{yield new Promise((r,n)=>{let a=setTimeout(()=>{n(new Error("Timeout"))},3e4);this.communicationService.on(t,o=>Ce(this,null,function*(){if(clearTimeout(a),this.loadingService.stop(),!e.general.shouldRunInBackground)yield this.router.navigate([`visualize/${o}`]);else{yield hn(this.dialogService.openInformationDialog({title:"Simulation started",message:"The simulation is starting in the background. You can check its status in the simulations list.",type:"info",confirmButtonOverride:null,cancelButtonOverride:null,canCancel:!1}).afterClosed()),this.shouldShowMainMenuSignal.set(!0);return}r()})),this.communicationService.emit("start-simulation",e.general.name,e.general.data,t,e.configuration.maxDuration)}),this.communicationService.removeAllListeners(t)}catch{this.communicationService.removeAllListeners(t),this.loadingService.stop(),yield hn(this.dialogService.openInformationDialog({title:"Timeout",message:"The simulation took too long to start. Please verify the status of the server.",type:"error",confirmButtonOverride:null,cancelButtonOverride:null,canCancel:!1}).afterClosed()),this.shouldShowMainMenuSignal.set(!0);return}})}onBrowseSimulations(){return Ce(this,null,function*(){this.shouldShowMainMenuSignal.set(!1);let e=yield hn(this.dialogService.openSimulationListDialog().afterClosed());if(!e||!e.simulationToVisualize){this.shouldShowMainMenuSignal.set(!0);return}yield this.router.navigate([`visualize/${e.simulationToVisualize.id}`])})}onUserGuide(){return Ce(this,null,function*(){this.shouldShowMainMenuSignal.set(!1),yield hn(this.dialogService.openUserGuide().afterClosed()),this.shouldShowMainMenuSignal.set(!0)})}static \u0275fac=function(t){return new(t||i)(rt(Js),rt(ty),rt(To),rt(rf))};static \u0275cmp=tt({type:i,selectors:[["app-home"]],decls:1,vars:1,consts:[[1,"main-menu","flex-column","align-main-center","gap-1-rem"],[1,"enable-pointer-events","main-menu-title"],["mat-raised-button","",1,"enable-pointer-events",3,"click"],[1,"flex-row","gap-1-rem"],["mat-raised-button","",1,"enable-pointer-events","flex-1",3,"click"],[1,"enable-pointer-events"]],template:function(t,r){t&1&&je(0,yDe,20,0,"div",0),t&2&&Je(r.shouldShowMainMenuSignal()?0:-1)},dependencies:[Br,pn,pr,mr,dw],styles:[".flex-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.flex-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.align-center[_ngcontent-%COMP%], .align-main-center[_ngcontent-%COMP%]{justify-content:center}.align-center[_ngcontent-%COMP%], .align-cross-center[_ngcontent-%COMP%]{align-items:center}.align-main-end[_ngcontent-%COMP%]{justify-content:flex-end}.align-cross-end[_ngcontent-%COMP%]{align-items:flex-end}.align-main-start[_ngcontent-%COMP%]{justify-content:flex-start}.align-cross-start[_ngcontent-%COMP%]{align-items:flex-start}.align-cross-stretch[_ngcontent-%COMP%]{align-items:stretch}.gap-0-5-rem[_ngcontent-%COMP%]{gap:.5rem}.gap-1-rem[_ngcontent-%COMP%]{gap:1rem}.gap-1-5-rem[_ngcontent-%COMP%]{gap:1.5rem}.flex-1[_ngcontent-%COMP%]{flex:1}[_nghost-%COMP%]{display:block;width:100%;height:100%;position:absolute;top:0;left:0;z-index:500;background-color:#00000052}.disable-pointer-events[_ngcontent-%COMP%], [_nghost-%COMP%]{pointer-events:none}.enable-pointer-events[_ngcontent-%COMP%]{pointer-events:auto}.main-menu[_ngcontent-%COMP%]{position:absolute;top:50%;left:25%;transform:translate(-50%,-50%);max-width:20rem}.main-menu-title[_ngcontent-%COMP%]{font-size:3.5rem;font-weight:700;text-align:center;color:#fff}"]})};var _De=["panel"],bDe=["*"];function vDe(i,e){if(i&1){let t=vt();Z(0,"div",1,0),Le("@panelAnimation.done",function(n){Ee(t);let a=Se();return Ae(a._animationDone.next(n))}),Ot(2),Q()}if(i&2){let t=e.id,r=Se();dn(r._classList),gt("mat-mdc-autocomplete-visible",r.showPanel)("mat-mdc-autocomplete-hidden",!r.showPanel)("mat-primary",r._color==="primary")("mat-accent",r._color==="accent")("mat-warn",r._color==="warn"),Re("id",r.id)("@panelAnimation",r.isOpen?"visible":"hidden"),Mt("aria-label",r.ariaLabel||null)("aria-labelledby",r._getPanelAriaLabelledby(t))}}var SDe=Cs("panelAnimation",[Ms("void, hidden",mn({opacity:0,transform:"scaleY(0.8)"})),Ba(":enter, hidden => visible",[oV([Pa("0.03s linear",mn({opacity:1})),Pa("0.12s cubic-bezier(0, 0, 0.2, 1)",mn({transform:"scaleY(1)"}))])]),Ba(":leave, visible => hidden",[Pa("0.075s linear",mn({opacity:0}))])]),RI=class{source;option;constructor(e,t){this.source=e,this.option=t}},eX=new et("mat-autocomplete-default-options",{providedIn:"root",factory:kDe});function kDe(){return{autoActiveFirstOption:!1,autoSelectActiveOption:!1,hideSingleSelectionIndicator:!1,requireSelection:!1}}var tX=(()=>{class i{_changeDetectorRef=te(_i);_elementRef=te(Et);_defaults=te(eX);_activeOptionChanges=tr.EMPTY;_animationDone=new ut;_keyManager;showPanel=!1;get isOpen(){return this._isOpen&&this.showPanel}_isOpen=!1;_latestOpeningTrigger;_setColor(t){this._color=t,this._changeDetectorRef.markForCheck()}_color;template;panel;options;optionGroups;ariaLabel;ariaLabelledby;displayWith=null;autoActiveFirstOption;autoSelectActiveOption;requireSelection;panelWidth;disableRipple;optionSelected=new ut;opened=new ut;closed=new ut;optionActivated=new ut;set classList(t){this._classList=t,this._elementRef.nativeElement.className=""}_classList;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(t){this._hideSingleSelectionIndicator=t,this._syncParentProperties()}_hideSingleSelectionIndicator;_syncParentProperties(){if(this.options)for(let t of this.options)t._changeDetectorRef.markForCheck()}id=te(Di).getId("mat-autocomplete-");inertGroups;constructor(){let t=te($i);this.inertGroups=t?.SAFARI||!1,this.autoActiveFirstOption=!!this._defaults.autoActiveFirstOption,this.autoSelectActiveOption=!!this._defaults.autoSelectActiveOption,this.requireSelection=!!this._defaults.requireSelection,this._hideSingleSelectionIndicator=this._defaults.hideSingleSelectionIndicator??!1}ngAfterContentInit(){this._keyManager=new pf(this.options).withWrap().skipPredicate(this._skipPredicate),this._activeOptionChanges=this._keyManager.change.subscribe(t=>{this.isOpen&&this.optionActivated.emit({source:this,option:this.options.toArray()[t]||null})}),this._setVisibility()}ngOnDestroy(){this._keyManager?.destroy(),this._activeOptionChanges.unsubscribe(),this._animationDone.complete()}_setScrollTop(t){this.panel&&(this.panel.nativeElement.scrollTop=t)}_getScrollTop(){return this.panel?this.panel.nativeElement.scrollTop:0}_setVisibility(){this.showPanel=!!this.options.length,this._changeDetectorRef.markForCheck()}_emitSelectEvent(t){let r=new RI(this,t);this.optionSelected.emit(r)}_getPanelAriaLabelledby(t){if(this.ariaLabel)return null;let r=t?t+" ":"";return this.ariaLabelledby?r+this.ariaLabelledby:t}_skipPredicate(){return!1}static \u0275fac=function(r){return new(r||i)};static \u0275cmp=tt({type:i,selectors:[["mat-autocomplete"]],contentQueries:function(r,n,a){if(r&1&&(Ki(a,$l,5),Ki(a,yb,5)),r&2){let o;St(o=kt())&&(n.options=o),St(o=kt())&&(n.optionGroups=o)}},viewQuery:function(r,n){if(r&1&&(di(Ta,7),di(_De,5)),r&2){let a;St(a=kt())&&(n.template=a.first),St(a=kt())&&(n.panel=a.first)}},hostAttrs:[1,"mat-mdc-autocomplete"],inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],displayWith:"displayWith",autoActiveFirstOption:[2,"autoActiveFirstOption","autoActiveFirstOption",st],autoSelectActiveOption:[2,"autoSelectActiveOption","autoSelectActiveOption",st],requireSelection:[2,"requireSelection","requireSelection",st],panelWidth:"panelWidth",disableRipple:[2,"disableRipple","disableRipple",st],classList:[0,"class","classList"],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",st]},outputs:{optionSelected:"optionSelected",opened:"opened",closed:"closed",optionActivated:"optionActivated"},exportAs:["matAutocomplete"],features:[ei([{provide:gb,useExisting:i}]),si],ngContentSelectors:bDe,decls:1,vars:0,consts:[["panel",""],["role","listbox",1,"mat-mdc-autocomplete-panel","mdc-menu-surface","mdc-menu-surface--open",3,"id"]],template:function(r,n){r&1&&(Pi(),je(0,vDe,3,16,"ng-template"))},styles:["div.mat-mdc-autocomplete-panel{width:100%;max-height:256px;visibility:hidden;transform-origin:center top;overflow:auto;padding:8px 0;box-sizing:border-box;position:static;border-radius:var(--mat-autocomplete-container-shape, var(--mat-sys-corner-extra-small));box-shadow:var(--mat-autocomplete-container-elevation-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12));background-color:var(--mat-autocomplete-background-color, var(--mat-sys-surface-container))}@media(forced-colors: active){div.mat-mdc-autocomplete-panel{outline:solid 1px}}.cdk-overlay-pane:not(.mat-mdc-autocomplete-panel-above) div.mat-mdc-autocomplete-panel{border-top-left-radius:0;border-top-right-radius:0}.mat-mdc-autocomplete-panel-above div.mat-mdc-autocomplete-panel{border-bottom-left-radius:0;border-bottom-right-radius:0;transform-origin:center bottom}div.mat-mdc-autocomplete-panel.mat-mdc-autocomplete-visible{visibility:visible}div.mat-mdc-autocomplete-panel.mat-mdc-autocomplete-hidden{visibility:hidden;pointer-events:none}mat-autocomplete{display:none}"],encapsulation:2,data:{animation:[SDe]},changeDetection:0})}return i})();var xDe={provide:Bn,useExisting:Fr(()=>DI),multi:!0};var iX=new et("mat-autocomplete-scroll-strategy",{providedIn:"root",factory:()=>{let i=te(Rr);return()=>i.scrollStrategies.reposition()}});function wDe(i){return()=>i.scrollStrategies.reposition()}var CDe={provide:iX,deps:[Rr],useFactory:wDe},DI=(()=>{class i{_environmentInjector=te(xs);_element=te(Et);_overlay=te(Rr);_viewContainerRef=te(sa);_zone=te(Kt);_changeDetectorRef=te(_i);_dir=te(Pr,{optional:!0});_formField=te(nu,{optional:!0,host:!0});_document=te(li);_viewportRuler=te(ic);_scrollStrategy=te(iX);_renderer=te(Wr);_defaults=te(eX,{optional:!0});_overlayRef;_portal;_componentDestroyed=!1;_initialized=new ct;_keydownSubscription;_outsideClickSubscription;_cleanupWindowBlur;_previousValue;_valueOnAttach;_valueOnLastKeydown;_positionStrategy;_manuallyFloatingLabel=!1;_closingActionsSubscription;_viewportSubscription=tr.EMPTY;_breakpointObserver=te(df);_handsetLandscapeSubscription=tr.EMPTY;_canOpenOnNextFocus=!0;_valueBeforeAutoSelection;_pendingAutoselectedOption;_closeKeyEventStream=new ct;_windowBlurHandler=()=>{this._canOpenOnNextFocus=this._document.activeElement!==this._element.nativeElement||this.panelOpen};_onChange=()=>{};_onTouched=()=>{};autocomplete;position="auto";connectedTo;autocompleteAttribute="off";autocompleteDisabled;constructor(){}_aboveClass="mat-mdc-autocomplete-panel-above";ngAfterViewInit(){this._initialized.next(),this._initialized.complete(),this._cleanupWindowBlur=this._renderer.listen("window","blur",this._windowBlurHandler)}ngOnChanges(t){t.position&&this._positionStrategy&&(this._setStrategyPositions(this._positionStrategy),this.panelOpen&&this._overlayRef.updatePosition())}ngOnDestroy(){this._cleanupWindowBlur?.(),this._handsetLandscapeSubscription.unsubscribe(),this._viewportSubscription.unsubscribe(),this._componentDestroyed=!0,this._destroyPanel(),this._closeKeyEventStream.complete(),this._clearFromModal()}get panelOpen(){return this._overlayAttached&&this.autocomplete.showPanel}_overlayAttached=!1;openPanel(){this._openPanelInternal()}closePanel(){this._resetLabel(),this._overlayAttached&&(this.panelOpen&&this._zone.run(()=>{this.autocomplete.closed.emit()}),this.autocomplete._latestOpeningTrigger===this&&(this.autocomplete._isOpen=!1,this.autocomplete._latestOpeningTrigger=null),this._overlayAttached=!1,this._pendingAutoselectedOption=null,this._overlayRef&&this._overlayRef.hasAttached()&&(this._overlayRef.detach(),this._closingActionsSubscription.unsubscribe()),this._updatePanelState(),this._componentDestroyed||this._changeDetectorRef.detectChanges(),this._trackedModal&&_h(this._trackedModal,"aria-owns",this.autocomplete.id))}updatePosition(){this._overlayAttached&&this._overlayRef.updatePosition()}get panelClosingActions(){return vr(this.optionSelections,this.autocomplete._keyManager.tabOut.pipe(Yi(()=>this._overlayAttached)),this._closeKeyEventStream,this._getOutsideClickStream(),this._overlayRef?this._overlayRef.detachments().pipe(Yi(()=>this._overlayAttached)):Qt()).pipe(mi(t=>t instanceof fb?t:null))}optionSelections=ol(()=>{let t=this.autocomplete?this.autocomplete.options:null;return t?t.changes.pipe(ur(t),Er(()=>vr(...t.map(r=>r.onSelectionChange)))):this._initialized.pipe(Er(()=>this.optionSelections))});get activeOption(){return this.autocomplete&&this.autocomplete._keyManager?this.autocomplete._keyManager.activeItem:null}_getOutsideClickStream(){return new wa(t=>{let r=a=>{let o=An(a),s=this._formField?this._formField.getConnectedOverlayOrigin().nativeElement:null,l=this.connectedTo?this.connectedTo.elementRef.nativeElement:null;this._overlayAttached&&o!==this._element.nativeElement&&this._document.activeElement!==this._element.nativeElement&&(!s||!s.contains(o))&&(!l||!l.contains(o))&&this._overlayRef&&!this._overlayRef.overlayElement.contains(o)&&t.next(a)},n=[this._renderer.listen("document","click",r),this._renderer.listen("document","auxclick",r),this._renderer.listen("document","touchend",r)];return()=>{n.forEach(a=>a())}})}writeValue(t){Promise.resolve(null).then(()=>this._assignOptionValue(t))}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this._element.nativeElement.disabled=t}_handleKeydown(t){let r=t.keyCode,n=Hr(t);if(r===27&&!n&&t.preventDefault(),this._valueOnLastKeydown=this._element.nativeElement.value,this.activeOption&&r===13&&this.panelOpen&&!n)this.activeOption._selectViaInteraction(),this._resetActiveItem(),t.preventDefault();else if(this.autocomplete){let a=this.autocomplete._keyManager.activeItem,o=r===38||r===40;r===9||o&&!n&&this.panelOpen?this.autocomplete._keyManager.onKeydown(t):o&&this._canOpen()&&this._openPanelInternal(this._valueOnLastKeydown),(o||this.autocomplete._keyManager.activeItem!==a)&&(this._scrollToOption(this.autocomplete._keyManager.activeItemIndex||0),this.autocomplete.autoSelectActiveOption&&this.activeOption&&(this._pendingAutoselectedOption||(this._valueBeforeAutoSelection=this._valueOnLastKeydown),this._pendingAutoselectedOption=this.activeOption,this._assignOptionValue(this.activeOption.value)))}}_handleInput(t){let r=t.target,n=r.value;if(r.type==="number"&&(n=n==""?null:parseFloat(n)),this._previousValue!==n){if(this._previousValue=n,this._pendingAutoselectedOption=null,(!this.autocomplete||!this.autocomplete.requireSelection)&&this._onChange(n),!n)this._clearPreviousSelectedOption(null,!1);else if(this.panelOpen&&!this.autocomplete.requireSelection){let a=this.autocomplete.options?.find(o=>o.selected);if(a){let o=this._getDisplayValue(a.value);n!==o&&a.deselect(!1)}}if(this._canOpen()&&this._document.activeElement===t.target){let a=this._valueOnLastKeydown??this._element.nativeElement.value;this._valueOnLastKeydown=null,this._openPanelInternal(a)}}}_handleFocus(){this._canOpenOnNextFocus?this._canOpen()&&(this._previousValue=this._element.nativeElement.value,this._attachOverlay(this._previousValue),this._floatLabel(!0)):this._canOpenOnNextFocus=!0}_handleClick(){this._canOpen()&&!this.panelOpen&&this._openPanelInternal()}_floatLabel(t=!1){this._formField&&this._formField.floatLabel==="auto"&&(t?this._formField._animateAndLockLabel():this._formField.floatLabel="always",this._manuallyFloatingLabel=!0)}_resetLabel(){this._manuallyFloatingLabel&&(this._formField&&(this._formField.floatLabel="auto"),this._manuallyFloatingLabel=!1)}_subscribeToClosingActions(){let t=new wa(n=>{vn(()=>{n.next()},{injector:this._environmentInjector})}),r=this.autocomplete.options.changes.pipe(Ar(()=>this._positionStrategy.reapplyLastPosition()),S4(0));return vr(t,r).pipe(Er(()=>this._zone.run(()=>{let n=this.panelOpen;return this._resetActiveItem(),this._updatePanelState(),this._changeDetectorRef.detectChanges(),this.panelOpen&&this._overlayRef.updatePosition(),n!==this.panelOpen&&(this.panelOpen?this._emitOpened():this.autocomplete.closed.emit()),this.panelClosingActions})),Ir(1)).subscribe(n=>this._setValueAndClose(n))}_emitOpened(){this.autocomplete.opened.emit()}_destroyPanel(){this._overlayRef&&(this.closePanel(),this._overlayRef.dispose(),this._overlayRef=null)}_getDisplayValue(t){let r=this.autocomplete;return r&&r.displayWith?r.displayWith(t):t}_assignOptionValue(t){let r=this._getDisplayValue(t);t==null&&this._clearPreviousSelectedOption(null,!1),this._updateNativeInputValue(r??"")}_updateNativeInputValue(t){this._formField?this._formField._control.value=t:this._element.nativeElement.value=t,this._previousValue=t}_setValueAndClose(t){let r=this.autocomplete,n=t?t.source:this._pendingAutoselectedOption;n?(this._clearPreviousSelectedOption(n),this._assignOptionValue(n.value),this._onChange(n.value),r._emitSelectEvent(n),this._element.nativeElement.focus()):r.requireSelection&&this._element.nativeElement.value!==this._valueOnAttach&&(this._clearPreviousSelectedOption(null),this._assignOptionValue(null),r._animationDone?r._animationDone.pipe(Ir(1)).subscribe(()=>this._onChange(null)):this._onChange(null)),this.closePanel()}_clearPreviousSelectedOption(t,r){this.autocomplete?.options?.forEach(n=>{n!==t&&n.selected&&n.deselect(r)})}_openPanelInternal(t=this._element.nativeElement.value){if(this._attachOverlay(t),this._floatLabel(),this._trackedModal){let r=this.autocomplete.id;gf(this._trackedModal,"aria-owns",r)}}_attachOverlay(t){this.autocomplete;let r=this._overlayRef;r?(this._positionStrategy.setOrigin(this._getConnectedElement()),r.updateSize({width:this._getPanelWidth()})):(this._portal=new Xa(this.autocomplete.template,this._viewContainerRef,{id:this._formField?.getLabelId()}),r=this._overlay.create(this._getOverlayConfig()),this._overlayRef=r,this._viewportSubscription=this._viewportRuler.change().subscribe(()=>{this.panelOpen&&r&&r.updateSize({width:this._getPanelWidth()})}),this._handsetLandscapeSubscription=this._breakpointObserver.observe(Jx.HandsetLandscape).subscribe(a=>{a.matches?this._positionStrategy.withFlexibleDimensions(!0).withGrowAfterOpen(!0).withViewportMargin(8):this._positionStrategy.withFlexibleDimensions(!1).withGrowAfterOpen(!1).withViewportMargin(0)})),r&&!r.hasAttached()&&(r.attach(this._portal),this._valueOnAttach=t,this._valueOnLastKeydown=null,this._closingActionsSubscription=this._subscribeToClosingActions());let n=this.panelOpen;this.autocomplete._isOpen=this._overlayAttached=!0,this.autocomplete._latestOpeningTrigger=this,this.autocomplete._setColor(this._formField?.color),this._updatePanelState(),this._applyModalPanelOwnership(),this.panelOpen&&n!==this.panelOpen&&this._emitOpened()}_handlePanelKeydown=t=>{(t.keyCode===27&&!Hr(t)||t.keyCode===38&&Hr(t,"altKey"))&&(this._pendingAutoselectedOption&&(this._updateNativeInputValue(this._valueBeforeAutoSelection??""),this._pendingAutoselectedOption=null),this._closeKeyEventStream.next(),this._resetActiveItem(),t.stopPropagation(),t.preventDefault())};_updatePanelState(){if(this.autocomplete._setVisibility(),this.panelOpen){let t=this._overlayRef;this._keydownSubscription||(this._keydownSubscription=t.keydownEvents().subscribe(this._handlePanelKeydown)),this._outsideClickSubscription||(this._outsideClickSubscription=t.outsidePointerEvents().subscribe())}else this._keydownSubscription?.unsubscribe(),this._outsideClickSubscription?.unsubscribe(),this._keydownSubscription=this._outsideClickSubscription=null}_getOverlayConfig(){return new Ds({positionStrategy:this._getOverlayPosition(),scrollStrategy:this._scrollStrategy(),width:this._getPanelWidth(),direction:this._dir??void 0,panelClass:this._defaults?.overlayPanelClass})}_getOverlayPosition(){let t=this._overlay.position().flexibleConnectedTo(this._getConnectedElement()).withFlexibleDimensions(!1).withPush(!1);return this._setStrategyPositions(t),this._positionStrategy=t,t}_setStrategyPositions(t){let r=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],n=this._aboveClass,a=[{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:n},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:n}],o;this.position==="above"?o=a:this.position==="below"?o=r:o=[...r,...a],t.withPositions(o)}_getConnectedElement(){return this.connectedTo?this.connectedTo.elementRef:this._formField?this._formField.getConnectedOverlayOrigin():this._element}_getPanelWidth(){return this.autocomplete.panelWidth||this._getHostWidth()}_getHostWidth(){return this._getConnectedElement().nativeElement.getBoundingClientRect().width}_resetActiveItem(){let t=this.autocomplete;if(t.autoActiveFirstOption){let r=-1;for(let n=0;n<t.options.length;n++)if(!t.options.get(n).disabled){r=n;break}t._keyManager.setActiveItem(r)}else t._keyManager.setActiveItem(-1)}_canOpen(){let t=this._element.nativeElement;return!t.readOnly&&!t.disabled&&!this.autocompleteDisabled}_scrollToOption(t){let r=this.autocomplete,n=sw(t,r.options,r.optionGroups);if(t===0&&n===1)r._setScrollTop(0);else if(r.panel){let a=r.options.toArray()[t];if(a){let o=a._getHostElement(),s=lw(o.offsetTop,o.offsetHeight,r._getScrollTop(),r.panel.nativeElement.offsetHeight);r._setScrollTop(s)}}}_trackedModal=null;_applyModalPanelOwnership(){let t=this._element.nativeElement.closest('body > .cdk-overlay-container [aria-modal="true"]');if(!t)return;let r=this.autocomplete.id;this._trackedModal&&_h(this._trackedModal,"aria-owns",r),gf(t,"aria-owns",r),this._trackedModal=t}_clearFromModal(){if(this._trackedModal){let t=this.autocomplete.id;_h(this._trackedModal,"aria-owns",t),this._trackedModal=null}}static \u0275fac=function(r){return new(r||i)};static \u0275dir=ft({type:i,selectors:[["input","matAutocomplete",""],["textarea","matAutocomplete",""]],hostAttrs:[1,"mat-mdc-autocomplete-trigger"],hostVars:7,hostBindings:function(r,n){r&1&&Le("focusin",function(){return n._handleFocus()})("blur",function(){return n._onTouched()})("input",function(o){return n._handleInput(o)})("keydown",function(o){return n._handleKeydown(o)})("click",function(){return n._handleClick()}),r&2&&Mt("autocomplete",n.autocompleteAttribute)("role",n.autocompleteDisabled?null:"combobox")("aria-autocomplete",n.autocompleteDisabled?null:"list")("aria-activedescendant",n.panelOpen&&n.activeOption?n.activeOption.id:null)("aria-expanded",n.autocompleteDisabled?null:n.panelOpen.toString())("aria-controls",n.autocompleteDisabled||!n.panelOpen||n.autocomplete==null?null:n.autocomplete.id)("aria-haspopup",n.autocompleteDisabled?null:"listbox")},inputs:{autocomplete:[0,"matAutocomplete","autocomplete"],position:[0,"matAutocompletePosition","position"],connectedTo:[0,"matAutocompleteConnectedTo","connectedTo"],autocompleteAttribute:[0,"autocomplete","autocompleteAttribute"],autocompleteDisabled:[2,"matAutocompleteDisabled","autocompleteDisabled",st]},exportAs:["matAutocompleteTrigger"],features:[ei([xDe]),si,rr]})}return i})(),rX=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275mod=Lt({type:i});static \u0275inj=Dt({providers:[CDe],imports:[Uo,yf,ti,pl,yf,ti]})}return i})();var TDe=["button"],EDe=["*"];function ADe(i,e){if(i&1&&(Z(0,"div",2),Ge(1,"mat-pseudo-checkbox",6),Q()),i&2){let t=Se();oe(),Re("disabled",t.disabled)}}var nX=new et("MAT_BUTTON_TOGGLE_DEFAULT_OPTIONS",{providedIn:"root",factory:PDe});function PDe(){return{hideSingleSelectionIndicator:!1,hideMultipleSelectionIndicator:!1,disabledInteractive:!1}}var aX=new et("MatButtonToggleGroup"),BDe={provide:Bn,useExisting:Fr(()=>LI),multi:!0},yM=class{source;value;constructor(e,t){this.source=e,this.value=t}},LI=(()=>{class i{_changeDetector=te(_i);_dir=te(Pr,{optional:!0});_multiple=!1;_disabled=!1;_disabledInteractive=!1;_selectionModel;_rawValue;_controlValueAccessorChangeFn=()=>{};_onTouched=()=>{};_buttonToggles;appearance;get name(){return this._name}set name(t){this._name=t,this._markButtonsForCheck()}_name=te(Di).getId("mat-button-toggle-group-");vertical;get value(){let t=this._selectionModel?this._selectionModel.selected:[];return this.multiple?t.map(r=>r.value):t[0]?t[0].value:void 0}set value(t){this._setSelectionByValue(t),this.valueChange.emit(this.value)}valueChange=new ut;get selected(){let t=this._selectionModel?this._selectionModel.selected:[];return this.multiple?t:t[0]||null}get multiple(){return this._multiple}set multiple(t){this._multiple=t,this._markButtonsForCheck()}get disabled(){return this._disabled}set disabled(t){this._disabled=t,this._markButtonsForCheck()}get disabledInteractive(){return this._disabledInteractive}set disabledInteractive(t){this._disabledInteractive=t,this._markButtonsForCheck()}get dir(){return this._dir&&this._dir.value==="rtl"?"rtl":"ltr"}change=new ut;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(t){this._hideSingleSelectionIndicator=t,this._markButtonsForCheck()}_hideSingleSelectionIndicator;get hideMultipleSelectionIndicator(){return this._hideMultipleSelectionIndicator}set hideMultipleSelectionIndicator(t){this._hideMultipleSelectionIndicator=t,this._markButtonsForCheck()}_hideMultipleSelectionIndicator;constructor(){let t=te(nX,{optional:!0});this.appearance=t&&t.appearance?t.appearance:"standard",this.hideSingleSelectionIndicator=t?.hideSingleSelectionIndicator??!1,this.hideMultipleSelectionIndicator=t?.hideMultipleSelectionIndicator??!1}ngOnInit(){this._selectionModel=new Cf(this.multiple,void 0,!1)}ngAfterContentInit(){this._selectionModel.select(...this._buttonToggles.filter(t=>t.checked)),this.multiple||this._initializeTabIndex()}writeValue(t){this.value=t,this._changeDetector.markForCheck()}registerOnChange(t){this._controlValueAccessorChangeFn=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t}_keydown(t){if(this.multiple||this.disabled)return;let n=t.target.id,a=this._buttonToggles.toArray().findIndex(s=>s.buttonId===n),o=null;switch(t.keyCode){case 32:case 13:o=this._buttonToggles.get(a)||null;break;case 38:o=this._getNextButton(a,-1);break;case 37:o=this._getNextButton(a,this.dir==="ltr"?-1:1);break;case 40:o=this._getNextButton(a,1);break;case 39:o=this._getNextButton(a,this.dir==="ltr"?1:-1);break;default:return}o&&(t.preventDefault(),o._onButtonClick(),o.focus())}_emitChangeEvent(t){let r=new yM(t,this.value);this._rawValue=r.value,this._controlValueAccessorChangeFn(r.value),this.change.emit(r)}_syncButtonToggle(t,r,n=!1,a=!1){!this.multiple&&this.selected&&!t.checked&&(this.selected.checked=!1),this._selectionModel?r?this._selectionModel.select(t):this._selectionModel.deselect(t):a=!0,a?Promise.resolve().then(()=>this._updateModelValue(t,n)):this._updateModelValue(t,n)}_isSelected(t){return this._selectionModel&&this._selectionModel.isSelected(t)}_isPrechecked(t){return typeof this._rawValue>"u"?!1:this.multiple&&Array.isArray(this._rawValue)?this._rawValue.some(r=>t.value!=null&&r===t.value):t.value===this._rawValue}_initializeTabIndex(){if(this._buttonToggles.forEach(t=>{t.tabIndex=-1}),this.selected)this.selected.tabIndex=0;else for(let t=0;t<this._buttonToggles.length;t++){let r=this._buttonToggles.get(t);if(!r.disabled){r.tabIndex=0;break}}this._markButtonsForCheck()}_getNextButton(t,r){let n=this._buttonToggles;for(let a=1;a<=n.length;a++){let o=(t+r*a+n.length)%n.length,s=n.get(o);if(s&&!s.disabled)return s}return null}_setSelectionByValue(t){if(this._rawValue=t,!this._buttonToggles)return;let r=this._buttonToggles.toArray();if(this.multiple&&t?(Array.isArray(t),this._clearSelection(),t.forEach(n=>this._selectValue(n,r))):(this._clearSelection(),this._selectValue(t,r)),!this.multiple&&r.every(n=>n.tabIndex===-1)){for(let n of r)if(!n.disabled){n.tabIndex=0;break}}}_clearSelection(){this._selectionModel.clear(),this._buttonToggles.forEach(t=>{t.checked=!1,this.multiple||(t.tabIndex=-1)})}_selectValue(t,r){for(let n of r)if(n.value!=null&&n.value===t){n.checked=!0,this._selectionModel.select(n),this.multiple||(n.tabIndex=0);break}}_updateModelValue(t,r){r&&this._emitChangeEvent(t),this.valueChange.emit(this.value)}_markButtonsForCheck(){this._buttonToggles?.forEach(t=>t._markForCheck())}static \u0275fac=function(r){return new(r||i)};static \u0275dir=ft({type:i,selectors:[["mat-button-toggle-group"]],contentQueries:function(r,n,a){if(r&1&&Ki(a,_M,5),r&2){let o;St(o=kt())&&(n._buttonToggles=o)}},hostAttrs:[1,"mat-button-toggle-group"],hostVars:6,hostBindings:function(r,n){r&1&&Le("keydown",function(o){return n._keydown(o)}),r&2&&(Mt("role",n.multiple?"group":"radiogroup")("aria-disabled",n.disabled),gt("mat-button-toggle-vertical",n.vertical)("mat-button-toggle-group-appearance-standard",n.appearance==="standard"))},inputs:{appearance:"appearance",name:"name",vertical:[2,"vertical","vertical",st],value:"value",multiple:[2,"multiple","multiple",st],disabled:[2,"disabled","disabled",st],disabledInteractive:[2,"disabledInteractive","disabledInteractive",st],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",st],hideMultipleSelectionIndicator:[2,"hideMultipleSelectionIndicator","hideMultipleSelectionIndicator",st]},outputs:{valueChange:"valueChange",change:"change"},exportAs:["matButtonToggleGroup"],features:[ei([BDe,{provide:aX,useExisting:i}]),si]})}return i})(),_M=(()=>{class i{_changeDetectorRef=te(_i);_elementRef=te(Et);_focusMonitor=te(In);_idGenerator=te(Di);_animationMode=te(nr,{optional:!0});_checked=!1;ariaLabel;ariaLabelledby=null;_buttonElement;buttonToggleGroup;get buttonId(){return`${this.id}-button`}id;name;value;get tabIndex(){return this._tabIndex}set tabIndex(t){t!==this._tabIndex&&(this._tabIndex=t,this._markForCheck())}_tabIndex;disableRipple;get appearance(){return this.buttonToggleGroup?this.buttonToggleGroup.appearance:this._appearance}set appearance(t){this._appearance=t}_appearance;get checked(){return this.buttonToggleGroup?this.buttonToggleGroup._isSelected(this):this._checked}set checked(t){t!==this._checked&&(this._checked=t,this.buttonToggleGroup&&this.buttonToggleGroup._syncButtonToggle(this,this._checked),this._changeDetectorRef.markForCheck())}get disabled(){return this._disabled||this.buttonToggleGroup&&this.buttonToggleGroup.disabled}set disabled(t){this._disabled=t}_disabled=!1;get disabledInteractive(){return this._disabledInteractive||this.buttonToggleGroup!==null&&this.buttonToggleGroup.disabledInteractive}set disabledInteractive(t){this._disabledInteractive=t}_disabledInteractive;change=new ut;constructor(){te(ar).load(kn);let t=te(aX,{optional:!0}),r=te(new Ma("tabindex"),{optional:!0})||"",n=te(nX,{optional:!0});this._tabIndex=parseInt(r)||0,this.buttonToggleGroup=t,this.appearance=n&&n.appearance?n.appearance:"standard",this.disabledInteractive=n?.disabledInteractive??!1}ngOnInit(){let t=this.buttonToggleGroup;this.id=this.id||this._idGenerator.getId("mat-button-toggle-"),t&&(t._isPrechecked(this)?this.checked=!0:t._isSelected(this)!==this._checked&&t._syncButtonToggle(this,this._checked))}ngAfterViewInit(){this._animationMode!=="NoopAnimations"&&this._elementRef.nativeElement.classList.add("mat-button-toggle-animations-enabled"),this._focusMonitor.monitor(this._elementRef,!0)}ngOnDestroy(){let t=this.buttonToggleGroup;this._focusMonitor.stopMonitoring(this._elementRef),t&&t._isSelected(this)&&t._syncButtonToggle(this,!1,!1,!0)}focus(t){this._buttonElement.nativeElement.focus(t)}_onButtonClick(){if(this.disabled)return;let t=this.isSingleSelector()?!0:!this._checked;if(t!==this._checked&&(this._checked=t,this.buttonToggleGroup&&(this.buttonToggleGroup._syncButtonToggle(this,this._checked,!0),this.buttonToggleGroup._onTouched())),this.isSingleSelector()){let r=this.buttonToggleGroup._buttonToggles.find(n=>n.tabIndex===0);r&&(r.tabIndex=-1),this.tabIndex=0}this.change.emit(new yM(this,this.value))}_markForCheck(){this._changeDetectorRef.markForCheck()}_getButtonName(){return this.isSingleSelector()?this.buttonToggleGroup.name:this.name||null}isSingleSelector(){return this.buttonToggleGroup&&!this.buttonToggleGroup.multiple}static \u0275fac=function(r){return new(r||i)};static \u0275cmp=tt({type:i,selectors:[["mat-button-toggle"]],viewQuery:function(r,n){if(r&1&&di(TDe,5),r&2){let a;St(a=kt())&&(n._buttonElement=a.first)}},hostAttrs:["role","presentation",1,"mat-button-toggle"],hostVars:14,hostBindings:function(r,n){r&1&&Le("focus",function(){return n.focus()}),r&2&&(Mt("aria-label",null)("aria-labelledby",null)("id",n.id)("name",null),gt("mat-button-toggle-standalone",!n.buttonToggleGroup)("mat-button-toggle-checked",n.checked)("mat-button-toggle-disabled",n.disabled)("mat-button-toggle-disabled-interactive",n.disabledInteractive)("mat-button-toggle-appearance-standard",n.appearance==="standard"))},inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],id:"id",name:"name",value:"value",tabIndex:"tabIndex",disableRipple:[2,"disableRipple","disableRipple",st],appearance:"appearance",checked:[2,"checked","checked",st],disabled:[2,"disabled","disabled",st],disabledInteractive:[2,"disabledInteractive","disabledInteractive",st]},outputs:{change:"change"},exportAs:["matButtonToggle"],features:[si],ngContentSelectors:EDe,decls:7,vars:13,consts:[["button",""],["type","button",1,"mat-button-toggle-button","mat-focus-indicator",3,"click","id","disabled"],[1,"mat-button-toggle-checkbox-wrapper"],[1,"mat-button-toggle-label-content"],[1,"mat-button-toggle-focus-overlay"],["matRipple","",1,"mat-button-toggle-ripple",3,"matRippleTrigger","matRippleDisabled"],["state","checked","aria-hidden","true","appearance","minimal",3,"disabled"]],template:function(r,n){if(r&1){let a=vt();Pi(),Z(0,"button",1,0),Le("click",function(){return Ee(a),Ae(n._onButtonClick())}),je(2,ADe,2,1,"div",2),Z(3,"span",3),Ot(4),Q()(),Ge(5,"span",4)(6,"span",5)}if(r&2){let a=Or(1);Re("id",n.buttonId)("disabled",n.disabled&&!n.disabledInteractive||null),Mt("role",n.isSingleSelector()?"radio":"button")("tabindex",n.disabled&&!n.disabledInteractive?-1:n.tabIndex)("aria-pressed",n.isSingleSelector()?null:n.checked)("aria-checked",n.isSingleSelector()?n.checked:null)("name",n._getButtonName())("aria-label",n.ariaLabel)("aria-labelledby",n.ariaLabelledby)("aria-disabled",n.disabled&&n.disabledInteractive?"true":null),oe(2),Je(n.buttonToggleGroup&&(!n.buttonToggleGroup.multiple&&!n.buttonToggleGroup.hideSingleSelectionIndicator||n.buttonToggleGroup.multiple&&!n.buttonToggleGroup.hideMultipleSelectionIndicator)?2:-1),oe(4),Re("matRippleTrigger",a)("matRippleDisabled",n.disableRipple||n.disabled)}},dependencies:[Ya,YB],styles:[".mat-button-toggle-standalone,.mat-button-toggle-group{position:relative;display:inline-flex;flex-direction:row;white-space:nowrap;overflow:hidden;-webkit-tap-highlight-color:rgba(0,0,0,0);transform:translateZ(0);border-radius:var(--mat-legacy-button-toggle-shape)}.mat-button-toggle-standalone:not([class*=mat-elevation-z]),.mat-button-toggle-group:not([class*=mat-elevation-z]){box-shadow:0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12)}@media(forced-colors: active){.mat-button-toggle-standalone,.mat-button-toggle-group{outline:solid 1px}}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard,.mat-button-toggle-group-appearance-standard{border-radius:var(--mat-standard-button-toggle-shape, var(--mat-sys-corner-full));border:solid 1px var(--mat-standard-button-toggle-divider-color, var(--mat-sys-outline))}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard .mat-pseudo-checkbox,.mat-button-toggle-group-appearance-standard .mat-pseudo-checkbox{--mat-minimal-pseudo-checkbox-selected-checkmark-color: var(--mat-standard-button-toggle-selected-state-text-color, var(--mat-sys-on-secondary-container))}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard:not([class*=mat-elevation-z]),.mat-button-toggle-group-appearance-standard:not([class*=mat-elevation-z]){box-shadow:none}@media(forced-colors: active){.mat-button-toggle-standalone.mat-button-toggle-appearance-standard,.mat-button-toggle-group-appearance-standard{outline:0}}.mat-button-toggle-vertical{flex-direction:column}.mat-button-toggle-vertical .mat-button-toggle-label-content{display:block}.mat-button-toggle{white-space:nowrap;position:relative;color:var(--mat-legacy-button-toggle-text-color);font-family:var(--mat-legacy-button-toggle-label-text-font);font-size:var(--mat-legacy-button-toggle-label-text-size);line-height:var(--mat-legacy-button-toggle-label-text-line-height);font-weight:var(--mat-legacy-button-toggle-label-text-weight);letter-spacing:var(--mat-legacy-button-toggle-label-text-tracking);--mat-minimal-pseudo-checkbox-selected-checkmark-color: var(--mat-legacy-button-toggle-selected-state-text-color)}.mat-button-toggle.cdk-keyboard-focused .mat-button-toggle-focus-overlay{opacity:var(--mat-legacy-button-toggle-focus-state-layer-opacity)}.mat-button-toggle .mat-icon svg{vertical-align:top}.mat-button-toggle-checkbox-wrapper{display:inline-block;justify-content:flex-start;align-items:center;width:0;height:18px;line-height:18px;overflow:hidden;box-sizing:border-box;position:absolute;top:50%;left:16px;transform:translate3d(0, -50%, 0)}[dir=rtl] .mat-button-toggle-checkbox-wrapper{left:auto;right:16px}.mat-button-toggle-appearance-standard .mat-button-toggle-checkbox-wrapper{left:12px}[dir=rtl] .mat-button-toggle-appearance-standard .mat-button-toggle-checkbox-wrapper{left:auto;right:12px}.mat-button-toggle-checked .mat-button-toggle-checkbox-wrapper{width:18px}.mat-button-toggle-animations-enabled .mat-button-toggle-checkbox-wrapper{transition:width 150ms 45ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-button-toggle-vertical .mat-button-toggle-checkbox-wrapper{transition:none}.mat-button-toggle-checked{color:var(--mat-legacy-button-toggle-selected-state-text-color);background-color:var(--mat-legacy-button-toggle-selected-state-background-color)}.mat-button-toggle-disabled{pointer-events:none;color:var(--mat-legacy-button-toggle-disabled-state-text-color);background-color:var(--mat-legacy-button-toggle-disabled-state-background-color);--mat-minimal-pseudo-checkbox-disabled-selected-checkmark-color: var(--mat-legacy-button-toggle-disabled-state-text-color)}.mat-button-toggle-disabled.mat-button-toggle-checked{background-color:var(--mat-legacy-button-toggle-disabled-selected-state-background-color)}.mat-button-toggle-disabled-interactive{pointer-events:auto}.mat-button-toggle-appearance-standard{color:var(--mat-standard-button-toggle-text-color, var(--mat-sys-on-surface));background-color:var(--mat-standard-button-toggle-background-color, transparent);font-family:var(--mat-standard-button-toggle-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mat-standard-button-toggle-label-text-size, var(--mat-sys-label-large-size));line-height:var(--mat-standard-button-toggle-label-text-line-height, var(--mat-sys-label-large-line-height));font-weight:var(--mat-standard-button-toggle-label-text-weight, var(--mat-sys-label-large-weight));letter-spacing:var(--mat-standard-button-toggle-label-text-tracking, var(--mat-sys-label-large-tracking))}.mat-button-toggle-group-appearance-standard .mat-button-toggle-appearance-standard+.mat-button-toggle-appearance-standard{border-left:solid 1px var(--mat-standard-button-toggle-divider-color, var(--mat-sys-outline))}[dir=rtl] .mat-button-toggle-group-appearance-standard .mat-button-toggle-appearance-standard+.mat-button-toggle-appearance-standard{border-left:none;border-right:solid 1px var(--mat-standard-button-toggle-divider-color, var(--mat-sys-outline))}.mat-button-toggle-group-appearance-standard.mat-button-toggle-vertical .mat-button-toggle-appearance-standard+.mat-button-toggle-appearance-standard{border-left:none;border-right:none;border-top:solid 1px var(--mat-standard-button-toggle-divider-color, var(--mat-sys-outline))}.mat-button-toggle-appearance-standard.mat-button-toggle-checked{color:var(--mat-standard-button-toggle-selected-state-text-color, var(--mat-sys-on-secondary-container));background-color:var(--mat-standard-button-toggle-selected-state-background-color, var(--mat-sys-secondary-container))}.mat-button-toggle-appearance-standard.mat-button-toggle-disabled{color:var(--mat-standard-button-toggle-disabled-state-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mat-standard-button-toggle-disabled-state-background-color, transparent)}.mat-button-toggle-appearance-standard.mat-button-toggle-disabled .mat-pseudo-checkbox{--mat-minimal-pseudo-checkbox-disabled-selected-checkmark-color: var(--mat-standard-button-toggle-disabled-selected-state-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-button-toggle-appearance-standard.mat-button-toggle-disabled.mat-button-toggle-checked{color:var(--mat-standard-button-toggle-disabled-selected-state-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mat-standard-button-toggle-disabled-selected-state-background-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-button-toggle-appearance-standard .mat-button-toggle-focus-overlay{background-color:var(--mat-standard-button-toggle-state-layer-color, var(--mat-sys-on-surface))}.mat-button-toggle-appearance-standard:hover .mat-button-toggle-focus-overlay{opacity:var(--mat-standard-button-toggle-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-button-toggle-appearance-standard.cdk-keyboard-focused .mat-button-toggle-focus-overlay{opacity:var(--mat-standard-button-toggle-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}@media(hover: none){.mat-button-toggle-appearance-standard:hover .mat-button-toggle-focus-overlay{display:none}}.mat-button-toggle-label-content{-webkit-user-select:none;user-select:none;display:inline-block;padding:0 16px;line-height:var(--mat-legacy-button-toggle-height);position:relative}.mat-button-toggle-appearance-standard .mat-button-toggle-label-content{padding:0 12px;line-height:var(--mat-standard-button-toggle-height, 40px)}.mat-button-toggle-label-content>*{vertical-align:middle}.mat-button-toggle-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:inherit;pointer-events:none;opacity:0;background-color:var(--mat-legacy-button-toggle-state-layer-color)}@media(forced-colors: active){.mat-button-toggle-checked .mat-button-toggle-focus-overlay{border-bottom:solid 500px;opacity:.5;height:0}.mat-button-toggle-checked:hover .mat-button-toggle-focus-overlay{opacity:.6}.mat-button-toggle-checked.mat-button-toggle-appearance-standard .mat-button-toggle-focus-overlay{border-bottom:solid 500px}}.mat-button-toggle .mat-button-toggle-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-button-toggle-button{border:0;background:none;color:inherit;padding:0;margin:0;font:inherit;outline:none;width:100%;cursor:pointer}.mat-button-toggle-animations-enabled .mat-button-toggle-button{transition:padding 150ms 45ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-button-toggle-vertical .mat-button-toggle-button{transition:none}.mat-button-toggle-disabled .mat-button-toggle-button{cursor:default}.mat-button-toggle-button::-moz-focus-inner{border:0}.mat-button-toggle-checked .mat-button-toggle-button:has(.mat-button-toggle-checkbox-wrapper){padding-left:30px}[dir=rtl] .mat-button-toggle-checked .mat-button-toggle-button:has(.mat-button-toggle-checkbox-wrapper){padding-left:0;padding-right:30px}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard{--mat-focus-indicator-border-radius:var(--mat-standard-button-toggle-shape, var(--mat-sys-corner-full))}.mat-button-toggle-group-appearance-standard:not(.mat-button-toggle-vertical) .mat-button-toggle:last-of-type .mat-button-toggle-button::before{border-top-right-radius:var(--mat-standard-button-toggle-shape, var(--mat-sys-corner-full));border-bottom-right-radius:var(--mat-standard-button-toggle-shape, var(--mat-sys-corner-full))}.mat-button-toggle-group-appearance-standard:not(.mat-button-toggle-vertical) .mat-button-toggle:first-of-type .mat-button-toggle-button::before{border-top-left-radius:var(--mat-standard-button-toggle-shape, var(--mat-sys-corner-full));border-bottom-left-radius:var(--mat-standard-button-toggle-shape, var(--mat-sys-corner-full))}.mat-button-toggle-group-appearance-standard.mat-button-toggle-vertical .mat-button-toggle:last-of-type .mat-button-toggle-button::before{border-bottom-right-radius:var(--mat-standard-button-toggle-shape, var(--mat-sys-corner-full));border-bottom-left-radius:var(--mat-standard-button-toggle-shape, var(--mat-sys-corner-full))}.mat-button-toggle-group-appearance-standard.mat-button-toggle-vertical .mat-button-toggle:first-of-type .mat-button-toggle-button::before{border-top-right-radius:var(--mat-standard-button-toggle-shape, var(--mat-sys-corner-full));border-top-left-radius:var(--mat-standard-button-toggle-shape, var(--mat-sys-corner-full))}"],encapsulation:2,changeDetection:0})}return i})(),oX=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275mod=Lt({type:i});static \u0275inj=Dt({imports:[ti,Ko,_M,ti]})}return i})();var DDe=["*"];var LDe=[[["","mat-card-avatar",""],["","matCardAvatar",""]],[["mat-card-title"],["mat-card-subtitle"],["","mat-card-title",""],["","mat-card-subtitle",""],["","matCardTitle",""],["","matCardSubtitle",""]],"*"],IDe=["[mat-card-avatar], [matCardAvatar]",`mat-card-title, mat-card-subtitle,
|
1697
|
+
`;var YL=n$,n0=a$;var a0=class{constructor(e){this.renderer=e}contextChange(e){let t;if(this.renderer.context.webGLVersion===1){let r=e.getParameter(e.FRAMEBUFFER_BINDING);e.bindFramebuffer(e.FRAMEBUFFER,null),t=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.FRAMEBUFFER,r)}else{let r=e.getParameter(e.DRAW_FRAMEBUFFER_BINDING);e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),t=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,r)}t>=_r.HIGH?this.multisample=_r.HIGH:t>=_r.MEDIUM?this.multisample=_r.MEDIUM:t>=_r.LOW?this.multisample=_r.LOW:this.multisample=_r.NONE}destroy(){}};a0.extension={type:Xe.RendererSystem,name:"_multisample"};nt.add(a0);var qC=class{constructor(e){this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}};var o0=class{constructor(e){this.renderer=e,this.managedBuffers={},this.boundBufferBases={}}destroy(){this.renderer=null}contextChange(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(e){let{gl:t,CONTEXT_UID:r}=this,n=e._glBuffers[r]||this.createGLBuffer(e);t.bindBuffer(e.type,n.buffer)}unbind(e){let{gl:t}=this;t.bindBuffer(e,null)}bindBufferBase(e,t){let{gl:r,CONTEXT_UID:n}=this;if(this.boundBufferBases[t]!==e){let a=e._glBuffers[n]||this.createGLBuffer(e);this.boundBufferBases[t]=e,r.bindBufferBase(r.UNIFORM_BUFFER,t,a.buffer)}}bindBufferRange(e,t,r){let{gl:n,CONTEXT_UID:a}=this;r=r||0;let o=e._glBuffers[a]||this.createGLBuffer(e);n.bindBufferRange(n.UNIFORM_BUFFER,t||0,o.buffer,r*256,256)}update(e){let{gl:t,CONTEXT_UID:r}=this,n=e._glBuffers[r]||this.createGLBuffer(e);if(e._updateID!==n.updateID)if(n.updateID=e._updateID,t.bindBuffer(e.type,n.buffer),n.byteLength>=e.data.byteLength)t.bufferSubData(e.type,0,e.data);else{let a=e.static?t.STATIC_DRAW:t.DYNAMIC_DRAW;n.byteLength=e.data.byteLength,t.bufferData(e.type,e.data,a)}}dispose(e,t){if(!this.managedBuffers[e.id])return;delete this.managedBuffers[e.id];let r=e._glBuffers[this.CONTEXT_UID],n=this.gl;e.disposeRunner.remove(this),r&&(t||n.deleteBuffer(r.buffer),delete e._glBuffers[this.CONTEXT_UID])}disposeAll(e){let t=Object.keys(this.managedBuffers);for(let r=0;r<t.length;r++)this.dispose(this.managedBuffers[t[r]],e)}createGLBuffer(e){let{CONTEXT_UID:t,gl:r}=this;return e._glBuffers[t]=new qC(r.createBuffer()),this.managedBuffers[e.id]=e,e.disposeRunner.add(this),e._glBuffers[t]}};o0.extension={type:Xe.RendererSystem,name:"buffer"};nt.add(o0);var s0=class{constructor(e){this.renderer=e}render(e,t){let r=this.renderer,n,a,o,s;if(t&&(n=t.renderTexture,a=t.clear,o=t.transform,s=t.skipUpdateTransform),this.renderingToScreen=!n,r.runners.prerender.emit(),r.emit("prerender"),r.projection.transform=o,!r.context.isLost){if(n||(this.lastObjectRendered=e),!s){let l=e.enableTempParent();e.updateTransform(),e.disableTempParent(l)}r.renderTexture.bind(n),r.batch.currentRenderer.start(),(a??r.background.clearBeforeRender)&&r.renderTexture.clear(),e.render(r),r.batch.currentRenderer.flush(),n&&(t.blit&&r.framebuffer.blit(),n.baseTexture.update()),r.runners.postrender.emit(),r.projection.transform=null,r.emit("postrender")}}destroy(){this.renderer=null,this.lastObjectRendered=null}};s0.extension={type:Xe.RendererSystem,name:"objectRenderer"};nt.add(s0);var ZC=class JL extends Kg{constructor(e){super(),this.type=k2.WEBGL,e=Object.assign({},Qe.RENDER_OPTIONS,e),this.gl=null,this.CONTEXT_UID=0,this.globalUniforms=new co({projectionMatrix:new Ni},!0);let t={runners:["init","destroy","contextChange","resolutionChange","reset","update","postrender","prerender","resize"],systems:JL.__systems,priority:["_view","textureGenerator","background","_plugin","startup","context","state","texture","buffer","geometry","framebuffer","transformFeedback","mask","scissor","stencil","projection","textureGC","filter","renderTexture","batch","objectRenderer","_multisample"]};this.setup(t),"useContextAlpha"in e&&(yi("7.0.0","options.useContextAlpha is deprecated, use options.premultipliedAlpha and options.backgroundAlpha instead"),e.premultipliedAlpha=e.useContextAlpha&&e.useContextAlpha!=="notMultiplied",e.backgroundAlpha=e.useContextAlpha===!1?1:e.backgroundAlpha),this._plugin.rendererPlugins=JL.__plugins,this.options=e,this.startup.run(this.options)}static test(e){return e?.forceCanvas?!1:xC()}render(e,t){this.objectRenderer.render(e,t)}resize(e,t){this._view.resizeView(e,t)}reset(){return this.runners.reset.emit(),this}clear(){this.renderTexture.bind(),this.renderTexture.clear()}destroy(e=!1){this.runners.destroy.items.reverse(),this.emitWithCustomOptions(this.runners.destroy,{_view:e}),super.destroy()}get plugins(){return this._plugin.plugins}get multisample(){return this._multisample.multisample}get width(){return this._view.element.width}get height(){return this._view.element.height}get resolution(){return this._view.resolution}set resolution(e){this._view.resolution=e,this.runners.resolutionChange.emit(e)}get autoDensity(){return this._view.autoDensity}get view(){return this._view.element}get screen(){return this._view.screen}get lastObjectRendered(){return this.objectRenderer.lastObjectRendered}get renderingToScreen(){return this.objectRenderer.renderingToScreen}get rendererLogId(){return`WebGL ${this.context.webGLVersion}`}get clearBeforeRender(){return yi("7.0.0","renderer.clearBeforeRender has been deprecated, please use renderer.background.clearBeforeRender instead."),this.background.clearBeforeRender}get useContextAlpha(){return yi("7.0.0","renderer.useContextAlpha has been deprecated, please use renderer.context.premultipliedAlpha instead."),this.context.useContextAlpha}get preserveDrawingBuffer(){return yi("7.0.0","renderer.preserveDrawingBuffer has been deprecated, we cannot truly know this unless pixi created the context"),this.context.preserveDrawingBuffer}get backgroundColor(){return yi("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color}set backgroundColor(e){yi("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color=e}get backgroundAlpha(){return yi("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha}set backgroundAlpha(e){yi("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha=e}get powerPreference(){return yi("7.0.0","renderer.powerPreference has been deprecated, we can only know this if pixi creates the context"),this.context.powerPreference}generateTexture(e,t){return this.textureGenerator.generateTexture(e,t)}};ZC.extension={type:Xe.Renderer,priority:1},ZC.__plugins={},ZC.__systems={};var YC=ZC;nt.handleByMap(Xe.RendererPlugin,YC.__plugins);nt.handleByMap(Xe.RendererSystem,YC.__systems);nt.add(YC);var $h=class extends ss{constructor(e,t){let{width:r,height:n}=t||{};super(r,n),this.items=[],this.itemDirtyIds=[];for(let a=0;a<e;a++){let o=new Jt;this.items.push(o),this.itemDirtyIds.push(-2)}this.length=e,this._load=null,this.baseTexture=null}initFromArray(e,t){for(let r=0;r<this.length;r++)e[r]&&(e[r].castToBaseTexture?this.addBaseTextureAt(e[r].castToBaseTexture(),r):e[r]instanceof ss?this.addResourceAt(e[r],r):this.addResourceAt(wg(e[r],t),r))}dispose(){for(let e=0,t=this.length;e<t;e++)this.items[e].destroy();this.items=null,this.itemDirtyIds=null,this._load=null}addResourceAt(e,t){if(!this.items[t])throw new Error(`Index ${t} is out of bounds`);return e.valid&&!this.valid&&this.resize(e.width,e.height),this.items[t].setResource(e),this}bind(e){if(this.baseTexture!==null)throw new Error("Only one base texture per TextureArray is allowed");super.bind(e);for(let t=0;t<this.length;t++)this.items[t].parentTextureArray=e,this.items[t].on("update",e.update,e)}unbind(e){super.unbind(e);for(let t=0;t<this.length;t++)this.items[t].parentTextureArray=null,this.items[t].off("update",e.update,e)}load(){if(this._load)return this._load;let e=this.items.map(t=>t.resource).filter(t=>t).map(t=>t.load());return this._load=Promise.all(e).then(()=>{let{realWidth:t,realHeight:r}=this.items[0];return this.resize(t,r),this.update(),Promise.resolve(this)}),this._load}};var l0=class extends $h{constructor(e,t){let{width:r,height:n}=t||{},a,o;Array.isArray(e)?(a=e,o=e.length):o=e,super(o,{width:r,height:n}),a&&this.initFromArray(a,t)}addBaseTextureAt(e,t){if(e.resource)this.addResourceAt(e.resource,t);else throw new Error("ArrayResource does not support RenderTexture");return this}bind(e){super.bind(e),e.target=ku.TEXTURE_2D_ARRAY}upload(e,t,r){let{length:n,itemDirtyIds:a,items:o}=this,{gl:s}=e;r.dirtyId<0&&s.texImage3D(s.TEXTURE_2D_ARRAY,0,r.internalFormat,this._width,this._height,n,0,t.format,r.type,null);for(let l=0;l<n;l++){let c=o[l];a[l]<c.dirtyId&&(a[l]=c.dirtyId,c.valid&&s.texSubImage3D(s.TEXTURE_2D_ARRAY,0,0,0,l,c.resource.width,c.resource.height,1,t.format,r.type,c.resource.source))}return!0}};var c0=class extends Gn{constructor(e){super(e)}static test(e){let{OffscreenCanvas:t}=globalThis;return t&&e instanceof t?!0:globalThis.HTMLCanvasElement&&e instanceof HTMLCanvasElement}};var nBe=(()=>{let i=class u0 extends $h{constructor(t,r){let{width:n,height:a,autoLoad:o,linkBaseTexture:s}=r||{};if(t&&t.length!==u0.SIDES)throw new Error(`Invalid length. Got ${t.length}, expected 6`);super(6,{width:n,height:a});for(let l=0;l<u0.SIDES;l++)this.items[l].target=ku.TEXTURE_CUBE_MAP_POSITIVE_X+l;this.linkBaseTexture=s!==!1,t&&this.initFromArray(t,r),o!==!1&&this.load()}bind(t){super.bind(t),t.target=ku.TEXTURE_CUBE_MAP}addBaseTextureAt(t,r,n){if(n===void 0&&(n=this.linkBaseTexture),!this.items[r])throw new Error(`Index ${r} is out of bounds`);if(!this.linkBaseTexture||t.parentTextureArray||Object.keys(t._glTextures).length>0)if(t.resource)this.addResourceAt(t.resource,r);else throw new Error("CubeResource does not support copying of renderTexture.");else t.target=ku.TEXTURE_CUBE_MAP_POSITIVE_X+r,t.parentTextureArray=this.baseTexture,this.items[r]=t;return t.valid&&!this.valid&&this.resize(t.realWidth,t.realHeight),this.items[r]=t,this}upload(t,r,n){let a=this.itemDirtyIds;for(let o=0;o<u0.SIDES;o++){let s=this.items[o];(a[o]<s.dirtyId||n.dirtyId<r.dirtyId)&&(s.valid&&s.resource?(s.resource.upload(t,s,n),a[o]=s.dirtyId):a[o]<-1&&(t.gl.texImage2D(s.target,0,n.internalFormat,r.realWidth,r.realHeight,0,r.format,n.type,null),a[o]=-1))}return!0}static test(t){return Array.isArray(t)&&t.length===u0.SIDES}};return i.SIDES=6,i})(),$L=nBe;var h0=class i extends Gn{constructor(e,t){t=t||{};let r,n,a;typeof e=="string"?(r=i.EMPTY,n=e,a=!0):(r=e,n=null,a=!1),super(r),this.url=n,this.crossOrigin=t.crossOrigin??!0,this.alphaMode=typeof t.alphaMode=="number"?t.alphaMode:null,this.ownsImageBitmap=t.ownsImageBitmap??a,this._load=null,t.autoLoad!==!1&&this.load()}load(){return this._load?this._load:(this._load=new Promise((e,t)=>Ce(this,null,function*(){if(this.url===null){e(this);return}try{let r=yield Qe.ADAPTER.fetch(this.url,{mode:this.crossOrigin?"cors":"no-cors"});if(this.destroyed)return;let n=yield r.blob();if(this.destroyed)return;let a=yield createImageBitmap(n,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===an.UNPACK?"premultiply":"none"});if(this.destroyed){a.close();return}this.source=a,this.update(),e(this)}catch(r){if(this.destroyed)return;t(r),this.onError.emit(r)}})),this._load)}upload(e,t,r){return this.source instanceof ImageBitmap?(typeof this.alphaMode=="number"&&(t.alphaMode=this.alphaMode),super.upload(e,t,r)):(this.load(),!1)}dispose(){this.ownsImageBitmap&&this.source instanceof ImageBitmap&&this.source.close(),super.dispose(),this._load=null}static test(e){return!!globalThis.createImageBitmap&&typeof ImageBitmap<"u"&&(typeof e=="string"||e instanceof ImageBitmap)}static get EMPTY(){return i._EMPTY=i._EMPTY??Qe.ADAPTER.createCanvas(0,0),i._EMPTY}};var XL=class JC extends Gn{constructor(e,t){t=t||{},super(Qe.ADAPTER.createCanvas()),this._width=0,this._height=0,this.svg=e,this.scale=t.scale||1,this._overrideWidth=t.width,this._overrideHeight=t.height,this._resolve=null,this._crossorigin=t.crossorigin,this._load=null,t.autoLoad!==!1&&this.load()}load(){return this._load?this._load:(this._load=new Promise(e=>{if(this._resolve=()=>{this.update(),e(this)},JC.SVG_XML.test(this.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");this.svg=`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(this.svg)))}`}this._loadSvg()}),this._load)}_loadSvg(){let e=new Image;Gn.crossOrigin(e,this.svg,this._crossorigin),e.src=this.svg,e.onerror=t=>{this._resolve&&(e.onerror=null,this.onError.emit(t))},e.onload=()=>{if(!this._resolve)return;let t=e.width,r=e.height;if(!t||!r)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");let n=t*this.scale,a=r*this.scale;(this._overrideWidth||this._overrideHeight)&&(n=this._overrideWidth||this._overrideHeight/r*t,a=this._overrideHeight||this._overrideWidth/t*r),n=Math.round(n),a=Math.round(a);let o=this.source;o.width=n,o.height=a,o._pixiId=`canvas_${_c()}`,o.getContext("2d").drawImage(e,0,0,t,r,0,0,n,a),this._resolve(),this._resolve=null}}static getSize(e){let t=JC.SVG_SIZE.exec(e),r={};return t&&(r[t[1]]=Math.round(parseFloat(t[3])),r[t[5]]=Math.round(parseFloat(t[7]))),r}dispose(){super.dispose(),this._resolve=null,this._crossorigin=null}static test(e,t){return t==="svg"||typeof e=="string"&&e.startsWith("data:image/svg+xml")||typeof e=="string"&&JC.SVG_XML.test(e)}};XL.SVG_XML=/^(<\?xml[^?]+\?>)?\s*(<!--[^(-->)]*-->)?\s*\<svg/m,XL.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;var qg=XL;var $C=class extends Gn{constructor(e){super(e)}static test(e){return!!globalThis.VideoFrame&&e instanceof globalThis.VideoFrame}};var QL=class eI extends Gn{constructor(e,t){if(t=t||{},!(e instanceof HTMLVideoElement)){let r=document.createElement("video");t.autoLoad!==!1&&r.setAttribute("preload","auto"),t.playsinline!==!1&&(r.setAttribute("webkit-playsinline",""),r.setAttribute("playsinline","")),t.muted===!0&&(r.setAttribute("muted",""),r.muted=!0),t.loop===!0&&r.setAttribute("loop",""),t.autoPlay!==!1&&r.setAttribute("autoplay",""),typeof e=="string"&&(e=[e]);let n=e[0].src||e[0];Gn.crossOrigin(r,n,t.crossorigin);for(let a=0;a<e.length;++a){let o=document.createElement("source"),{src:s,mime:l}=e[a];if(s=s||e[a],s.startsWith("data:"))l=s.slice(5,s.indexOf(";"));else if(!s.startsWith("blob:")){let c=s.split("?").shift().toLowerCase(),u=c.slice(c.lastIndexOf(".")+1);l=l||eI.MIME_TYPES[u]||`video/${u}`}o.src=s,l&&(o.type=l),r.appendChild(o)}e=r}super(e),this.noSubImage=!0,this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=t.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=t.autoPlay!==!1,this._videoFrameRequestCallback=this._videoFrameRequestCallback.bind(this),this._videoFrameRequestCallbackHandle=null,this._load=null,this._resolve=null,this._reject=null,this._onCanPlay=this._onCanPlay.bind(this),this._onError=this._onError.bind(this),this._onPlayStart=this._onPlayStart.bind(this),this._onPlayStop=this._onPlayStop.bind(this),this._onSeeked=this._onSeeked.bind(this),t.autoLoad!==!1&&this.load()}update(e=0){if(!this.destroyed){if(this._updateFPS){let t=sn.shared.elapsedMS*this.source.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-t)}(!this._updateFPS||this._msToNextUpdate<=0)&&(super.update(),this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0)}}_videoFrameRequestCallback(){this.update(),this.destroyed?this._videoFrameRequestCallbackHandle=null:this._videoFrameRequestCallbackHandle=this.source.requestVideoFrameCallback(this._videoFrameRequestCallback)}load(){if(this._load)return this._load;let e=this.source;return(e.readyState===e.HAVE_ENOUGH_DATA||e.readyState===e.HAVE_FUTURE_DATA)&&e.width&&e.height&&(e.complete=!0),e.addEventListener("play",this._onPlayStart),e.addEventListener("pause",this._onPlayStop),e.addEventListener("seeked",this._onSeeked),this._isSourceReady()?this._onCanPlay():(e.addEventListener("canplay",this._onCanPlay),e.addEventListener("canplaythrough",this._onCanPlay),e.addEventListener("error",this._onError,!0)),this._load=new Promise((t,r)=>{this.valid?t(this):(this._resolve=t,this._reject=r,e.load())}),this._load}_onError(e){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(e),this._reject&&(this._reject(e),this._reject=null,this._resolve=null)}_isSourcePlaying(){let e=this.source;return!e.paused&&!e.ended}_isSourceReady(){return this.source.readyState>2}_onPlayStart(){this.valid||this._onCanPlay(),this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0)}_onCanPlay(){let e=this.source;e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay);let t=this.valid;this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0,!t&&this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&e.play()}dispose(){this._configureAutoUpdate();let e=this.source;e&&(e.removeEventListener("play",this._onPlayStart),e.removeEventListener("pause",this._onPlayStop),e.removeEventListener("seeked",this._onSeeked),e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay),e.removeEventListener("error",this._onError,!0),e.pause(),e.src="",e.load()),super.dispose()}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e!==this._autoUpdate&&(this._autoUpdate=e,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(e){e!==this._updateFPS&&(this._updateFPS=e,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.source.requestVideoFrameCallback?(this._isConnectedToTicker&&(sn.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),this._videoFrameRequestCallbackHandle===null&&(this._videoFrameRequestCallbackHandle=this.source.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._videoFrameRequestCallbackHandle!==null&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(sn.shared.add(this.update,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(sn.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(e,t){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement||eI.TYPES.includes(t)}};QL.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],QL.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};var d0=QL;Gv.push(h0,Nm,c0,d0,$C,qg,Ml,$L,l0);var o$=["vehicle","stop","passenger","all"],s$=["zoomed-in","zoomed-out","any"],l$=["circle","square","triangle","pentagon","hexagon","octagon","star","cross","diamond"],Zg=class i{VERSION=4;SPRITE_SIZE=40;BACKGROUND_SHAPE_SIZE=60;KEY_TEXTURES="multimodal.textures";DEFAULT_UNDEFINED_TEXTURE_URL="/images/undefined-texture.png";DEFAULT_VEHICLE_TEXTURE_URL="/images/vehicle.png";DEFAULT_PASSENGER_TEXTURE_URL="/images/passenger.png";DEFAULT_STOP_TEXTURE_URL="/images/stop.png";DEFAULT_ZOOMED_OUT_VEHICLE_TEXTURE_URL="/images/zoomed-out-vehicle.png";DEFAULT_ZOOMED_OUT_PASSENGER_TEXTURE_URL="/images/zoomed-out-passenger.png";DEFAULT_ZOOMED_OUT_STOP_TEXTURE_URL="/images/zoomed-out-stop.png";PRESET_LIGHT_COLOR_THEME=["#ccffcc","#ffffb3","#ffffb3","#ffb980","#ffb980","#ff3333","#ff3333"];PRESET_SATURATED_COLOR_THEME=["#00ff00","#ffff00","#ff8000","#ff0000"];VEHICLE_SPRITE_SCALE_FACTOR=1;PASSENGER_SPRITE_SCALE_FACTOR=.75;STOP_SPRITE_SCALE_FACTOR=.25;_useZoomedOutSprites=!1;_globalSpriteScale=1;_vehicleTexture=Ft.from(this.DEFAULT_VEHICLE_TEXTURE_URL);_passengerTexture=Ft.from(this.DEFAULT_PASSENGER_TEXTURE_URL);_stopTexture=Ft.from(this.DEFAULT_STOP_TEXTURE_URL);_zoomedOutVehicleTexture=Ft.from(this.DEFAULT_ZOOMED_OUT_VEHICLE_TEXTURE_URL);_zoomedOutPassengerTexture=Ft.from(this.DEFAULT_ZOOMED_OUT_PASSENGER_TEXTURE_URL);_zoomedOutStopTexture=Ft.from(this.DEFAULT_ZOOMED_OUT_STOP_TEXTURE_URL);_customTextures=[];_backgroundShapes=[];_colorPresetIndex=0;_customColors=["#00ff00","#ff0000"];_currentColorPreset=this.PRESET_LIGHT_COLOR_THEME;_textureMap=new Map;_customizationUpdatedSignal=Bt(0);get useZoomedOutSprites(){return this._useZoomedOutSprites}get vehicleSpriteScale(){return this.VEHICLE_SPRITE_SCALE_FACTOR*this._globalSpriteScale}get passengerSpriteScale(){return this.PASSENGER_SPRITE_SCALE_FACTOR*this._globalSpriteScale}get stopSpriteScale(){return this.STOP_SPRITE_SCALE_FACTOR*this._globalSpriteScale}get vehicleTexture(){return this._vehicleTexture}get passengerTexture(){return this._passengerTexture}get stopTexture(){return this._stopTexture}get zoomedOutVehicleTexture(){return this._zoomedOutVehicleTexture}get zoomedOutPassengerTexture(){return this._zoomedOutPassengerTexture}get zoomedOutStopTexture(){return this._zoomedOutStopTexture}get colorPresetIndex(){return this._colorPresetIndex}get customColors(){return this._customColors}get currentColorPreset(){return this._currentColorPreset}get customTextures(){return structuredClone(this._customTextures)}get backgroundShapes(){return structuredClone(this._backgroundShapes)}get customizationUpdatedSignal(){return this._customizationUpdatedSignal}constructor(){this.loadTexturesData()}calculateSpriteScales(e){let o=e.getMap(),s=15,l=o.getZoom(),c=s-l;this._useZoomedOutSprites=l<14;let u=Math.pow(1.5,-c);u=Math.min(Math.max(u,.2),1),this._globalSpriteScale=u/e.getScale()}saveTextureData(e,t,r,n,a,o,s,l,c,u){let h={version:this.VERSION,vehicleTextureUrl:e,passengerTextureUrl:t,stopTextureUrl:r,zoomedOutVehicleTextureUrl:n,zoomedOutPassengerTextureUrl:a,zoomedOutStopTextureUrl:o,customTextures:s,backgroundShapes:l,colorPresetIndex:c,customColors:u};localStorage.setItem(this.KEY_TEXTURES,JSON.stringify(h)),this.applyTexturesData(h)}getVehicleTexture(e,t){let r=this._useZoomedOutSprites?"zoomed-out":"zoomed-in",n=this._customTextures.find(o=>o.isActive&&["vehicle","all"].includes(o.type)&&[r,"any"].includes(o.zoom)&&o.tags.every(s=>t.includes(s))&&(o.mode===null||o.mode===e)),a=this._useZoomedOutSprites?this._zoomedOutVehicleTexture:this._vehicleTexture;return this._textureMap.get(n?.url??"")??a}getPassengerTexture(e){let t=this._useZoomedOutSprites?"zoomed-out":"zoomed-in",r=this._customTextures.find(a=>a.isActive&&["passenger","all"].includes(a.type)&&[t,"any"].includes(a.zoom)&&a.tags.every(o=>e.includes(o))),n=this._useZoomedOutSprites?this._zoomedOutPassengerTexture:this._passengerTexture;return this._textureMap.get(r?.url??"")??n}getStopTexture(e){let t=this._useZoomedOutSprites?"zoomed-out":"zoomed-in",r=this._customTextures.find(a=>a.isActive&&["stop","all"].includes(a.type)&&[t,"any"].includes(a.zoom)&&a.tags.every(o=>e.includes(o))),n=this._useZoomedOutSprites?this._zoomedOutStopTexture:this._stopTexture;return this._textureMap.get(r?.url??"")??n}drawVehicleBackgroundShape(e,t,r){let n=this._useZoomedOutSprites?"zoomed-out":"zoomed-in",a=this._backgroundShapes.find(o=>o.isActive&&["vehicle","all"].includes(o.type)&&[n,"any"].includes(o.zoom)&&o.tags.every(s=>r.includes(s))&&(o.mode===null||o.mode===t));if(!a){e.clear();return}this.drawShape(e,a.shape,a.color)}drawPassengerBackgroundShape(e,t){let r=this._useZoomedOutSprites?"zoomed-out":"zoomed-in",n=this._backgroundShapes.find(a=>a.isActive&&["passenger","all"].includes(a.type)&&[r,"any"].includes(a.zoom)&&a.tags.every(o=>t.includes(o)));if(!n){e.clear();return}this.drawShape(e,n.shape,n.color)}drawStopBackgroundShape(e,t){let r=this._useZoomedOutSprites?"zoomed-out":"zoomed-in",n=this._backgroundShapes.find(a=>a.isActive&&["stop","all"].includes(a.type)&&[r,"any"].includes(a.zoom)&&a.tags.every(o=>t.includes(o)));if(!n){e.clear();return}this.drawShape(e,n.shape,n.color)}loadTexturesData(){let e=localStorage.getItem(this.KEY_TEXTURES);if(!e)return;let t=JSON.parse(e);t.version===void 0||t.version!==this.VERSION||this.applyTexturesData(t)}applyTexturesData(e){this._vehicleTexture=Ft.from(e.vehicleTextureUrl),this._passengerTexture=Ft.from(e.passengerTextureUrl),this._stopTexture=Ft.from(e.stopTextureUrl),this._zoomedOutVehicleTexture=Ft.from(e.zoomedOutVehicleTextureUrl),this._zoomedOutPassengerTexture=Ft.from(e.zoomedOutPassengerTextureUrl),this._zoomedOutStopTexture=Ft.from(e.zoomedOutStopTextureUrl),this._colorPresetIndex=e.colorPresetIndex,this._customColors=e.customColors,this._colorPresetIndex===0&&(this._currentColorPreset=this.PRESET_LIGHT_COLOR_THEME),this._colorPresetIndex===1&&(this._currentColorPreset=this.PRESET_SATURATED_COLOR_THEME),this._colorPresetIndex===2&&e.customColors.length>=2&&(this._currentColorPreset=e.customColors),this._customTextures=e.customTextures;let t=Array.from(new Set(this._customTextures.map(r=>r.url)));this._textureMap.clear(),t.forEach(r=>{this._textureMap.set(r,Ft.from(r))}),this._backgroundShapes=structuredClone(e.backgroundShapes),this._customizationUpdatedSignal.update(r=>r+1)}drawShape(e,t,r){let n=this.BACKGROUND_SHAPE_SIZE;switch(e.clear(),e.beginFill(r),t){case"circle":e.drawCircle(0,0,n/2),e.scale.set(4/Math.PI);break;case"square":e.drawRect(-n/2,-n/2,n,n);break;case"triangle":e.drawPolygon(this.createPolygonCoordinates(3,n/2)),e.scale.set(1.5);break;case"pentagon":e.drawPolygon(this.createPolygonCoordinates(5,n/2)),e.scale.set(4/Math.PI);break;case"hexagon":e.drawPolygon(this.createPolygonCoordinates(6,n/2,0)),e.scale.set(4/Math.PI);break;case"octagon":e.drawPolygon(this.createPolygonCoordinates(8,n/2,360/16)),e.scale.set(4/Math.PI);break;case"star":{let a=n/2,o=a/2.5,s=this.createPolygonCoordinates(5,a,90),l=this.createPolygonCoordinates(5,o,126),c=[];for(let u=0;u<s.length;u+=2)c.push(l[u],l[u+1]),c.push(s[u],s[u+1]);e.drawPolygon(c),e.scale.set(1.8)}break;case"cross":e.drawRect(-n/2,-n/8,n,n/4),e.drawRect(-n/8,-n/2,n/4,n),e.rotation=Math.PI/4,e.scale.set(1.5);break;case"diamond":e.drawPolygon(this.createPolygonCoordinates(4,n/2)),e.scale.set(Math.SQRT2);break}e.endFill()}createPolygonCoordinates(e,t,r=90){let n=[];for(let a=0;a<e;a++){let o=(a*360/e-r)*(Math.PI/180),s=t*Math.cos(o),l=t*Math.sin(o);n.push(s,l)}return n}static \u0275fac=function(t){return new(t||i)};static \u0275prov=lt({token:i,factory:i.\u0275fac,providedIn:"root"})};var aBe=["mat-menu-item",""],oBe=[[["mat-icon"],["","matMenuItemIcon",""]],"*"],sBe=["mat-icon, [matMenuItemIcon]","*"];function lBe(i,e){i&1&&(Sr(),Z(0,"svg",2),Ge(1,"polygon",3),Q())}var cBe=["*"];function uBe(i,e){if(i&1){let t=vt();Z(0,"div",0),Le("click",function(){Ee(t);let n=Se();return Ae(n.closed.emit("click"))})("animationstart",function(n){Ee(t);let a=Se();return Ae(a._onAnimationStart(n.animationName))})("animationend",function(n){Ee(t);let a=Se();return Ae(a._onAnimationDone(n.animationName))})("animationcancel",function(n){Ee(t);let a=Se();return Ae(a._onAnimationDone(n.animationName))}),Z(1,"div",1),Ot(2),Q()()}if(i&2){let t=Se();dn(t._classList),gt("mat-menu-panel-animations-disabled",t._animationsDisabled)("mat-menu-panel-exit-animation",t._panelAnimationState==="void")("mat-menu-panel-animating",t._isAnimating),Re("id",t.panelId),Mt("aria-label",t.ariaLabel||null)("aria-labelledby",t.ariaLabelledby||null)("aria-describedby",t.ariaDescribedby||null)}}var iI=new et("MAT_MENU_PANEL"),Um=(()=>{class i{_elementRef=te(Et);_document=te(li);_focusMonitor=te(In);_parentMenu=te(iI,{optional:!0});_changeDetectorRef=te(_i);role="menuitem";disabled=!1;disableRipple=!1;_hovered=new ct;_focused=new ct;_highlighted=!1;_triggersSubmenu=!1;constructor(){te(ar).load(kn),this._parentMenu?.addItem?.(this)}focus(t,r){this._focusMonitor&&t?this._focusMonitor.focusVia(this._getHostElement(),t,r):this._getHostElement().focus(r),this._focused.next(this)}ngAfterViewInit(){this._focusMonitor&&this._focusMonitor.monitor(this._elementRef,!1)}ngOnDestroy(){this._focusMonitor&&this._focusMonitor.stopMonitoring(this._elementRef),this._parentMenu&&this._parentMenu.removeItem&&this._parentMenu.removeItem(this),this._hovered.complete(),this._focused.complete()}_getTabIndex(){return this.disabled?"-1":"0"}_getHostElement(){return this._elementRef.nativeElement}_checkDisabled(t){this.disabled&&(t.preventDefault(),t.stopPropagation())}_handleMouseEnter(){this._hovered.next(this)}getLabel(){let t=this._elementRef.nativeElement.cloneNode(!0),r=t.querySelectorAll("mat-icon, .material-icons");for(let n=0;n<r.length;n++)r[n].remove();return t.textContent?.trim()||""}_setHighlighted(t){this._highlighted=t,this._changeDetectorRef.markForCheck()}_setTriggersSubmenu(t){this._triggersSubmenu=t,this._changeDetectorRef.markForCheck()}_hasFocus(){return this._document&&this._document.activeElement===this._getHostElement()}static \u0275fac=function(r){return new(r||i)};static \u0275cmp=tt({type:i,selectors:[["","mat-menu-item",""]],hostAttrs:[1,"mat-mdc-menu-item","mat-focus-indicator"],hostVars:8,hostBindings:function(r,n){r&1&&Le("click",function(o){return n._checkDisabled(o)})("mouseenter",function(){return n._handleMouseEnter()}),r&2&&(Mt("role",n.role)("tabindex",n._getTabIndex())("aria-disabled",n.disabled)("disabled",n.disabled||null),gt("mat-mdc-menu-item-highlighted",n._highlighted)("mat-mdc-menu-item-submenu-trigger",n._triggersSubmenu))},inputs:{role:"role",disabled:[2,"disabled","disabled",st],disableRipple:[2,"disableRipple","disableRipple",st]},exportAs:["matMenuItem"],features:[si],attrs:aBe,ngContentSelectors:sBe,decls:5,vars:3,consts:[[1,"mat-mdc-menu-item-text"],["matRipple","",1,"mat-mdc-menu-ripple",3,"matRippleDisabled","matRippleTrigger"],["viewBox","0 0 5 10","focusable","false","aria-hidden","true",1,"mat-mdc-menu-submenu-icon"],["points","0,0 5,5 0,10"]],template:function(r,n){r&1&&(Pi(oBe),Ot(0),Z(1,"span",0),Ot(2,1),Q(),Ge(3,"div",1),je(4,lBe,2,0,":svg:svg",2)),r&2&&(oe(3),Re("matRippleDisabled",n.disableRipple||n.disabled)("matRippleTrigger",n._getHostElement()),oe(),Je(n._triggersSubmenu?4:-1))},dependencies:[Ya],encapsulation:2,changeDetection:0})}return i})();var hBe=new et("MatMenuContent");var dBe=new et("mat-menu-default-options",{providedIn:"root",factory:mBe});function mBe(){return{overlapTrigger:!1,xPosition:"after",yPosition:"below",backdropClass:"cdk-overlay-transparent-backdrop"}}var tI="_mat-menu-enter",XC="_mat-menu-exit",Xh=(()=>{class i{_elementRef=te(Et);_changeDetectorRef=te(_i);_injector=te(Ii);_keyManager;_xPosition;_yPosition;_firstItemFocusRef;_exitFallbackTimeout;_animationsDisabled;_allItems;_directDescendantItems=new jc;_classList={};_panelAnimationState="void";_animationDone=new ct;_isAnimating=!1;parentMenu;direction;overlayPanelClass;backdropClass;ariaLabel;ariaLabelledby;ariaDescribedby;get xPosition(){return this._xPosition}set xPosition(t){this._xPosition=t,this.setPositionClasses()}get yPosition(){return this._yPosition}set yPosition(t){this._yPosition=t,this.setPositionClasses()}templateRef;items;lazyContent;overlapTrigger;hasBackdrop;set panelClass(t){let r=this._previousPanelClass,n=ye({},this._classList);r&&r.length&&r.split(" ").forEach(a=>{n[a]=!1}),this._previousPanelClass=t,t&&t.length&&(t.split(" ").forEach(a=>{n[a]=!0}),this._elementRef.nativeElement.className=""),this._classList=n}_previousPanelClass;get classList(){return this.panelClass}set classList(t){this.panelClass=t}closed=new ut;close=this.closed;panelId=te(Di).getId("mat-menu-panel-");constructor(){let t=te(dBe);this.overlayPanelClass=t.overlayPanelClass||"",this._xPosition=t.xPosition,this._yPosition=t.yPosition,this.backdropClass=t.backdropClass,this.overlapTrigger=t.overlapTrigger,this.hasBackdrop=t.hasBackdrop,this._animationsDisabled=te(nr,{optional:!0})==="NoopAnimations"}ngOnInit(){this.setPositionClasses()}ngAfterContentInit(){this._updateDirectDescendants(),this._keyManager=new yh(this._directDescendantItems).withWrap().withTypeAhead().withHomeAndEnd(),this._keyManager.tabOut.subscribe(()=>this.closed.emit("tab")),this._directDescendantItems.changes.pipe(ur(this._directDescendantItems),Er(t=>vr(...t.map(r=>r._focused)))).subscribe(t=>this._keyManager.updateActiveItem(t)),this._directDescendantItems.changes.subscribe(t=>{let r=this._keyManager;if(this._panelAnimationState==="enter"&&r.activeItem?._hasFocus()){let n=t.toArray(),a=Math.max(0,Math.min(n.length-1,r.activeItemIndex||0));n[a]&&!n[a].disabled?r.setActiveItem(a):r.setNextItemActive()}})}ngOnDestroy(){this._keyManager?.destroy(),this._directDescendantItems.destroy(),this.closed.complete(),this._firstItemFocusRef?.destroy(),clearTimeout(this._exitFallbackTimeout)}_hovered(){return this._directDescendantItems.changes.pipe(ur(this._directDescendantItems),Er(r=>vr(...r.map(n=>n._hovered))))}addItem(t){}removeItem(t){}_handleKeydown(t){let r=t.keyCode,n=this._keyManager;switch(r){case 27:Hr(t)||(t.preventDefault(),this.closed.emit("keydown"));break;case 37:this.parentMenu&&this.direction==="ltr"&&this.closed.emit("keydown");break;case 39:this.parentMenu&&this.direction==="rtl"&&this.closed.emit("keydown");break;default:(r===38||r===40)&&n.setFocusOrigin("keyboard"),n.onKeydown(t);return}}focusFirstItem(t="program"){this._firstItemFocusRef?.destroy(),this._firstItemFocusRef=vn(()=>{let r=this._resolvePanel();if(!r||!r.contains(document.activeElement)){let n=this._keyManager;n.setFocusOrigin(t).setFirstItemActive(),!n.activeItem&&r&&r.focus()}},{injector:this._injector})}resetActiveItem(){this._keyManager.setActiveItem(-1)}setElevation(t){}setPositionClasses(t=this.xPosition,r=this.yPosition){this._classList=at(ye({},this._classList),{"mat-menu-before":t==="before","mat-menu-after":t==="after","mat-menu-above":r==="above","mat-menu-below":r==="below"}),this._changeDetectorRef.markForCheck()}_onAnimationDone(t){let r=t===XC;(r||t===tI)&&(r&&(clearTimeout(this._exitFallbackTimeout),this._exitFallbackTimeout=void 0),this._animationDone.next(r?"void":"enter"),this._isAnimating=!1)}_onAnimationStart(t){(t===tI||t===XC)&&(this._isAnimating=!0)}_setIsOpen(t){if(this._panelAnimationState=t?"enter":"void",t){if(this._keyManager.activeItemIndex===0){let r=this._resolvePanel();r&&(r.scrollTop=0)}}else this._animationsDisabled||(this._exitFallbackTimeout=setTimeout(()=>this._onAnimationDone(XC),200));this._animationsDisabled&&setTimeout(()=>{this._onAnimationDone(t?tI:XC)}),this._changeDetectorRef.markForCheck()}_updateDirectDescendants(){this._allItems.changes.pipe(ur(this._allItems)).subscribe(t=>{this._directDescendantItems.reset(t.filter(r=>r._parentMenu===this)),this._directDescendantItems.notifyOnChanges()})}_resolvePanel(){let t=null;return this._directDescendantItems.length&&(t=this._directDescendantItems.first._getHostElement().closest('[role="menu"]')),t}static \u0275fac=function(r){return new(r||i)};static \u0275cmp=tt({type:i,selectors:[["mat-menu"]],contentQueries:function(r,n,a){if(r&1&&(Ki(a,hBe,5),Ki(a,Um,5),Ki(a,Um,4)),r&2){let o;St(o=kt())&&(n.lazyContent=o.first),St(o=kt())&&(n._allItems=o),St(o=kt())&&(n.items=o)}},viewQuery:function(r,n){if(r&1&&di(Ta,5),r&2){let a;St(a=kt())&&(n.templateRef=a.first)}},hostVars:3,hostBindings:function(r,n){r&2&&Mt("aria-label",null)("aria-labelledby",null)("aria-describedby",null)},inputs:{backdropClass:"backdropClass",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],xPosition:"xPosition",yPosition:"yPosition",overlapTrigger:[2,"overlapTrigger","overlapTrigger",st],hasBackdrop:[2,"hasBackdrop","hasBackdrop",t=>t==null?null:st(t)],panelClass:[0,"class","panelClass"],classList:"classList"},outputs:{closed:"closed",close:"close"},exportAs:["matMenu"],features:[ei([{provide:iI,useExisting:i}]),si],ngContentSelectors:cBe,decls:1,vars:0,consts:[["tabindex","-1","role","menu",1,"mat-mdc-menu-panel",3,"click","animationstart","animationend","animationcancel","id"],[1,"mat-mdc-menu-content"]],template:function(r,n){r&1&&(Pi(),je(0,uBe,3,12,"ng-template"))},styles:['mat-menu{display:none}.mat-mdc-menu-content{margin:0;padding:8px 0;outline:0}.mat-mdc-menu-content,.mat-mdc-menu-content .mat-mdc-menu-item .mat-mdc-menu-item-text{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;flex:1;white-space:normal;font-family:var(--mat-menu-item-label-text-font, var(--mat-sys-label-large-font));line-height:var(--mat-menu-item-label-text-line-height, var(--mat-sys-label-large-line-height));font-size:var(--mat-menu-item-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mat-menu-item-label-text-tracking, var(--mat-sys-label-large-tracking));font-weight:var(--mat-menu-item-label-text-weight, var(--mat-sys-label-large-weight))}@keyframes _mat-menu-enter{from{opacity:0;transform:scale(0.8)}to{opacity:1;transform:none}}@keyframes _mat-menu-exit{from{opacity:1}to{opacity:0}}.mat-mdc-menu-panel{min-width:112px;max-width:280px;overflow:auto;box-sizing:border-box;outline:0;animation:_mat-menu-enter 120ms cubic-bezier(0, 0, 0.2, 1);border-radius:var(--mat-menu-container-shape, var(--mat-sys-corner-extra-small));background-color:var(--mat-menu-container-color, var(--mat-sys-surface-container));box-shadow:var(--mat-menu-container-elevation-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12));will-change:transform,opacity}.mat-mdc-menu-panel.mat-menu-panel-exit-animation{animation:_mat-menu-exit 100ms 25ms linear forwards}.mat-mdc-menu-panel.mat-menu-panel-animations-disabled{animation:none}.mat-mdc-menu-panel.mat-menu-panel-animating{pointer-events:none}.mat-mdc-menu-panel.mat-menu-panel-animating:has(.mat-mdc-menu-content:empty){display:none}@media(forced-colors: active){.mat-mdc-menu-panel{outline:solid 1px}}.mat-mdc-menu-panel .mat-divider{color:var(--mat-menu-divider-color, var(--mat-sys-surface-variant));margin-bottom:var(--mat-menu-divider-bottom-spacing, 8px);margin-top:var(--mat-menu-divider-top-spacing, 8px)}.mat-mdc-menu-item{display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;padding:0;cursor:pointer;width:100%;text-align:left;box-sizing:border-box;color:inherit;font-size:inherit;background:none;text-decoration:none;margin:0;min-height:48px;padding-left:var(--mat-menu-item-leading-spacing, 12px);padding-right:var(--mat-menu-item-trailing-spacing, 12px);-webkit-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-menu-item::-moz-focus-inner{border:0}[dir=rtl] .mat-mdc-menu-item{padding-left:var(--mat-menu-item-trailing-spacing, 12px);padding-right:var(--mat-menu-item-leading-spacing, 12px)}.mat-mdc-menu-item:has(.material-icons,mat-icon,[matButtonIcon]){padding-left:var(--mat-menu-item-with-icon-leading-spacing, 12px);padding-right:var(--mat-menu-item-with-icon-trailing-spacing, 12px)}[dir=rtl] .mat-mdc-menu-item:has(.material-icons,mat-icon,[matButtonIcon]){padding-left:var(--mat-menu-item-with-icon-trailing-spacing, 12px);padding-right:var(--mat-menu-item-with-icon-leading-spacing, 12px)}.mat-mdc-menu-item,.mat-mdc-menu-item:visited,.mat-mdc-menu-item:link{color:var(--mat-menu-item-label-text-color, var(--mat-sys-on-surface))}.mat-mdc-menu-item .mat-icon-no-color,.mat-mdc-menu-item .mat-mdc-menu-submenu-icon{color:var(--mat-menu-item-icon-color, var(--mat-sys-on-surface-variant))}.mat-mdc-menu-item[disabled]{cursor:default;opacity:.38}.mat-mdc-menu-item[disabled]::after{display:block;position:absolute;content:"";top:0;left:0;bottom:0;right:0}.mat-mdc-menu-item:focus{outline:0}.mat-mdc-menu-item .mat-icon{flex-shrink:0;margin-right:var(--mat-menu-item-spacing, 12px);height:var(--mat-menu-item-icon-size, 24px);width:var(--mat-menu-item-icon-size, 24px)}[dir=rtl] .mat-mdc-menu-item{text-align:right}[dir=rtl] .mat-mdc-menu-item .mat-icon{margin-right:0;margin-left:var(--mat-menu-item-spacing, 12px)}.mat-mdc-menu-item:not([disabled]):hover{background-color:var(--mat-menu-item-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))}.mat-mdc-menu-item:not([disabled]).cdk-program-focused,.mat-mdc-menu-item:not([disabled]).cdk-keyboard-focused,.mat-mdc-menu-item:not([disabled]).mat-mdc-menu-item-highlighted{background-color:var(--mat-menu-item-focus-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-focus-state-layer-opacity) * 100%), transparent))}@media(forced-colors: active){.mat-mdc-menu-item{margin-top:1px}}.mat-mdc-menu-submenu-icon{width:var(--mat-menu-item-icon-size, 24px);height:10px;fill:currentColor;padding-left:var(--mat-menu-item-spacing, 12px)}[dir=rtl] .mat-mdc-menu-submenu-icon{padding-right:var(--mat-menu-item-spacing, 12px);padding-left:0}[dir=rtl] .mat-mdc-menu-submenu-icon polygon{transform:scaleX(-1);transform-origin:center}@media(forced-colors: active){.mat-mdc-menu-submenu-icon{fill:CanvasText}}.mat-mdc-menu-item .mat-mdc-menu-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}'],encapsulation:2,changeDetection:0})}return i})(),h$=new et("mat-menu-scroll-strategy",{providedIn:"root",factory:()=>{let i=te(Rr);return()=>i.scrollStrategies.reposition()}});function pBe(i){return()=>i.scrollStrategies.reposition()}var fBe={provide:h$,deps:[Rr],useFactory:pBe},u$=ca({passive:!0});var m0=new WeakMap,QC=(()=>{class i{_overlay=te(Rr);_element=te(Et);_viewContainerRef=te(sa);_menuItemInstance=te(Um,{optional:!0,self:!0});_dir=te(Pr,{optional:!0});_focusMonitor=te(In);_ngZone=te(Kt);_scrollStrategy=te(h$);_changeDetectorRef=te(_i);_portal;_overlayRef=null;_menuOpen=!1;_closingActionsSubscription=tr.EMPTY;_hoverSubscription=tr.EMPTY;_menuCloseSubscription=tr.EMPTY;_pendingRemoval;_parentMaterialMenu;_parentInnerPadding;_handleTouchStart=t=>{im(t)||(this._openedBy="touch")};_openedBy=void 0;get _deprecatedMatMenuTriggerFor(){return this.menu}set _deprecatedMatMenuTriggerFor(t){this.menu=t}get menu(){return this._menu}set menu(t){t!==this._menu&&(this._menu=t,this._menuCloseSubscription.unsubscribe(),t&&(this._parentMaterialMenu,this._menuCloseSubscription=t.close.subscribe(r=>{this._destroyMenu(r),(r==="click"||r==="tab")&&this._parentMaterialMenu&&this._parentMaterialMenu.closed.emit(r)})),this._menuItemInstance?._setTriggersSubmenu(this.triggersSubmenu()))}_menu;menuData;restoreFocus=!0;menuOpened=new ut;onMenuOpen=this.menuOpened;menuClosed=new ut;onMenuClose=this.menuClosed;constructor(){let t=te(iI,{optional:!0});this._parentMaterialMenu=t instanceof Xh?t:void 0,this._element.nativeElement.addEventListener("touchstart",this._handleTouchStart,u$)}ngAfterContentInit(){this._handleHover()}ngOnDestroy(){this.menu&&this._ownsMenu(this.menu)&&m0.delete(this.menu),this._element.nativeElement.removeEventListener("touchstart",this._handleTouchStart,u$),this._pendingRemoval?.unsubscribe(),this._menuCloseSubscription.unsubscribe(),this._closingActionsSubscription.unsubscribe(),this._hoverSubscription.unsubscribe(),this._overlayRef&&(this._overlayRef.dispose(),this._overlayRef=null)}get menuOpen(){return this._menuOpen}get dir(){return this._dir&&this._dir.value==="rtl"?"rtl":"ltr"}triggersSubmenu(){return!!(this._menuItemInstance&&this._parentMaterialMenu&&this.menu)}toggleMenu(){return this._menuOpen?this.closeMenu():this.openMenu()}openMenu(){let t=this.menu;if(this._menuOpen||!t)return;this._pendingRemoval?.unsubscribe();let r=m0.get(t);m0.set(t,this),r&&r!==this&&r.closeMenu();let n=this._createOverlay(t),a=n.getConfig(),o=a.positionStrategy;this._setPosition(t,o),a.hasBackdrop=t.hasBackdrop==null?!this.triggersSubmenu():t.hasBackdrop,n.hasAttached()||(n.attach(this._getPortal(t)),t.lazyContent?.attach(this.menuData)),this._closingActionsSubscription=this._menuClosingActions().subscribe(()=>this.closeMenu()),t.parentMenu=this.triggersSubmenu()?this._parentMaterialMenu:void 0,t.direction=this.dir,t.focusFirstItem(this._openedBy||"program"),this._setIsMenuOpen(!0),t instanceof Xh&&(t._setIsOpen(!0),t._directDescendantItems.changes.pipe(gi(t.close)).subscribe(()=>{o.withLockedPosition(!1).reapplyLastPosition(),o.withLockedPosition(!0)}))}closeMenu(){this.menu?.close.emit()}focus(t,r){this._focusMonitor&&t?this._focusMonitor.focusVia(this._element,t,r):this._element.nativeElement.focus(r)}updatePosition(){this._overlayRef?.updatePosition()}_destroyMenu(t){let r=this._overlayRef,n=this._menu;!r||!this.menuOpen||(this._closingActionsSubscription.unsubscribe(),this._pendingRemoval?.unsubscribe(),n instanceof Xh&&this._ownsMenu(n)?(this._pendingRemoval=n._animationDone.pipe(Ir(1)).subscribe(()=>{r.detach(),n.lazyContent?.detach()}),n._setIsOpen(!1)):(r.detach(),n?.lazyContent?.detach()),n&&this._ownsMenu(n)&&m0.delete(n),this.restoreFocus&&(t==="keydown"||!this._openedBy||!this.triggersSubmenu())&&this.focus(this._openedBy),this._openedBy=void 0,this._setIsMenuOpen(!1))}_setIsMenuOpen(t){t!==this._menuOpen&&(this._menuOpen=t,this._menuOpen?this.menuOpened.emit():this.menuClosed.emit(),this.triggersSubmenu()&&this._menuItemInstance._setHighlighted(t),this._changeDetectorRef.markForCheck())}_createOverlay(t){if(!this._overlayRef){let r=this._getOverlayConfig(t);this._subscribeToPositions(t,r.positionStrategy),this._overlayRef=this._overlay.create(r),this._overlayRef.keydownEvents().subscribe(n=>{this.menu instanceof Xh&&this.menu._handleKeydown(n)})}return this._overlayRef}_getOverlayConfig(t){return new Ds({positionStrategy:this._overlay.position().flexibleConnectedTo(this._element).withLockedPosition().withGrowAfterOpen().withTransformOriginOn(".mat-menu-panel, .mat-mdc-menu-panel"),backdropClass:t.backdropClass||"cdk-overlay-transparent-backdrop",panelClass:t.overlayPanelClass,scrollStrategy:this._scrollStrategy(),direction:this._dir||"ltr"})}_subscribeToPositions(t,r){t.setPositionClasses&&r.positionChanges.subscribe(n=>{this._ngZone.run(()=>{let a=n.connectionPair.overlayX==="start"?"after":"before",o=n.connectionPair.overlayY==="top"?"below":"above";t.setPositionClasses(a,o)})})}_setPosition(t,r){let[n,a]=t.xPosition==="before"?["end","start"]:["start","end"],[o,s]=t.yPosition==="above"?["bottom","top"]:["top","bottom"],[l,c]=[o,s],[u,h]=[n,a],d=0;if(this.triggersSubmenu()){if(h=n=t.xPosition==="before"?"start":"end",a=u=n==="end"?"start":"end",this._parentMaterialMenu){if(this._parentInnerPadding==null){let p=this._parentMaterialMenu.items.first;this._parentInnerPadding=p?p._getHostElement().offsetTop:0}d=o==="bottom"?this._parentInnerPadding:-this._parentInnerPadding}}else t.overlapTrigger||(l=o==="top"?"bottom":"top",c=s==="top"?"bottom":"top");r.withPositions([{originX:n,originY:l,overlayX:u,overlayY:o,offsetY:d},{originX:a,originY:l,overlayX:h,overlayY:o,offsetY:d},{originX:n,originY:c,overlayX:u,overlayY:s,offsetY:-d},{originX:a,originY:c,overlayX:h,overlayY:s,offsetY:-d}])}_menuClosingActions(){let t=this._overlayRef.backdropClick(),r=this._overlayRef.detachments(),n=this._parentMaterialMenu?this._parentMaterialMenu.closed:Qt(),a=this._parentMaterialMenu?this._parentMaterialMenu._hovered().pipe(Yi(o=>this._menuOpen&&o!==this._menuItemInstance)):Qt();return vr(t,n,a,r)}_handleMousedown(t){tm(t)||(this._openedBy=t.button===0?"mouse":void 0,this.triggersSubmenu()&&t.preventDefault())}_handleKeydown(t){let r=t.keyCode;(r===13||r===32)&&(this._openedBy="keyboard"),this.triggersSubmenu()&&(r===39&&this.dir==="ltr"||r===37&&this.dir==="rtl")&&(this._openedBy="keyboard",this.openMenu())}_handleClick(t){this.triggersSubmenu()?(t.stopPropagation(),this.openMenu()):this.toggleMenu()}_handleHover(){this.triggersSubmenu()&&this._parentMaterialMenu&&(this._hoverSubscription=this._parentMaterialMenu._hovered().subscribe(t=>{t===this._menuItemInstance&&!t.disabled&&(this._openedBy="mouse",this.openMenu())}))}_getPortal(t){return(!this._portal||this._portal.templateRef!==t.templateRef)&&(this._portal=new Xa(t.templateRef,this._viewContainerRef)),this._portal}_ownsMenu(t){return m0.get(t)===this}static \u0275fac=function(r){return new(r||i)};static \u0275dir=ft({type:i,selectors:[["","mat-menu-trigger-for",""],["","matMenuTriggerFor",""]],hostAttrs:[1,"mat-mdc-menu-trigger"],hostVars:3,hostBindings:function(r,n){r&1&&Le("click",function(o){return n._handleClick(o)})("mousedown",function(o){return n._handleMousedown(o)})("keydown",function(o){return n._handleKeydown(o)}),r&2&&Mt("aria-haspopup",n.menu?"menu":null)("aria-expanded",n.menuOpen)("aria-controls",n.menuOpen?n.menu.panelId:null)},inputs:{_deprecatedMatMenuTriggerFor:[0,"mat-menu-trigger-for","_deprecatedMatMenuTriggerFor"],menu:[0,"matMenuTriggerFor","menu"],menuData:[0,"matMenuTriggerData","menuData"],restoreFocus:[0,"matMenuTriggerRestoreFocus","restoreFocus"]},outputs:{menuOpened:"menuOpened",onMenuOpen:"onMenuOpen",menuClosed:"menuClosed",onMenuClose:"onMenuClose"},exportAs:["matMenuTrigger"]})}return i})(),eM=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275mod=Lt({type:i});static \u0275inj=Dt({providers:[fBe],imports:[Ko,ti,Uo,pl,ti]})}return i})(),d$={transformMenu:Cs("transformMenu",[Ms("void",mn({opacity:0,transform:"scale(0.8)"})),Ba("void => enter",Pa("120ms cubic-bezier(0, 0, 0.2, 1)",mn({opacity:1,transform:"scale(1)"}))),Ba("* => void",Pa("100ms 25ms linear",mn({opacity:0})))]),fadeInItems:Cs("fadeInItems",[Ms("showing",mn({opacity:1})),Ba("void => *",[mn({opacity:0}),Pa("400ms 100ms cubic-bezier(0.55, 0, 0.55, 0.2)")])])},N_t=d$.fadeInItems,G_t=d$.transformMenu;var gBe=i=>({shape:i});function yBe(i,e){i&1&&Od(0)}function _Be(i,e){i&1&&Od(0)}function bBe(i,e){if(i&1){let t=vt();Z(0,"button",6),Le("click",function(){let n=Ee(t).$implicit,a=Se();return Ae(a.shapeOutputEmitter.emit(n))}),je(1,_Be,1,0,"ng-container",3),Q()}if(i&2){let t=e.$implicit;Se();let r=Or(8);oe(),Re("ngTemplateOutlet",r)("ngTemplateOutletContext",mP(2,gBe,t))}}function vBe(i,e){i&1&&(Sr(),Ge(0,"circle",8))}function SBe(i,e){i&1&&(Sr(),Ge(0,"rect",9))}function kBe(i,e){i&1&&(Sr(),Ge(0,"polygon",10))}function xBe(i,e){i&1&&(Sr(),Ge(0,"polygon",11))}function wBe(i,e){i&1&&(Sr(),Ge(0,"polygon",12))}function CBe(i,e){i&1&&(Sr(),Ge(0,"polygon",13))}function MBe(i,e){i&1&&(Sr(),Ge(0,"polygon",14))}function TBe(i,e){i&1&&(Sr(),Ge(0,"rect",16)(1,"rect",17))}function EBe(i,e){i&1&&(Sr(),Ge(0,"polygon",15))}function ABe(i,e){if(i&1&&(Sr(),Z(0,"svg",7),je(1,vBe,1,0,":svg:circle",8)(2,SBe,1,0,":svg:rect",9)(3,kBe,1,0,":svg:polygon",10)(4,xBe,1,0,":svg:polygon",11)(5,wBe,1,0,":svg:polygon",12)(6,CBe,1,0,":svg:polygon",13)(7,MBe,1,0,":svg:polygon",14)(8,TBe,2,0)(9,EBe,1,0,":svg:polygon",15),Q()),i&2){let t,r=e.shape;Se();let n=fi(0);Mt("fill",n.color),oe(),Je((t=r)==="circle"?1:t==="square"?2:t==="triangle"?3:t==="pentagon"?4:t==="hexagon"?5:t==="octagon"?6:t==="star"?7:t==="cross"?8:t==="diamond"?9:-1)}}var tM=class i{BACKGROUND_SHAPE_TYPES=l$;backgroundShapeInputSignal=sl.required({alias:"backgroundShape"});shapeOutputEmitter=Uc({alias:"shapeChange"});static \u0275fac=function(t){return new(t||i)};static \u0275cmp=tt({type:i,selectors:[["app-background-shape"]],inputs:{backgroundShapeInputSignal:[1,"backgroundShape","backgroundShapeInputSignal"]},outputs:{shapeOutputEmitter:"shapeChange"},decls:9,vars:4,consts:[["shapeMenu","matMenu"],["shape",""],[1,"select-shape","flex-row","align-cross-center",3,"matMenuTriggerFor"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"shape-menu"],["mat-menu-item",""],["mat-menu-item","",3,"click"],["width","40px","height","40px","viewBox","0 0 40 40"],["cx","20","cy","20","r","20"],["x","0","y","0","width","40","height","40"],["points","19.999999999999996,0 37.32050807568878,29.999999999999986 2.679491924311222,29.999999999999996 "],["points","19.999999999999996,0 39.02113032590307,13.819660112501047 31.755705045849467,36.180339887498945 8.244294954150542,36.18033988749895 0.9788696740969272,13.819660112501058 "],["points","40,20 30,37.32050807568877 10.000000000000004,37.32050807568878 0,20.000000000000004 9.999999999999991,2.6794919243112325 30,2.679491924311229 "],["points","38.477590650225736,27.653668647301796 27.653668647301796,38.477590650225736 12.346331352698206,38.477590650225736 1.5224093497742643,27.6536686473018 1.5224093497742643,12.346331352698208 12.346331352698193,1.5224093497742714 27.6536686473018,1.522409349774268 38.47759065022573,12.346331352698192 "],["points","19.999999999999996,0 24.702282018339783,13.52786404500042 39.02113032590307,13.819660112501047 27.60845213036123,22.472135954999576 31.755705045849467,36.180339887498945 20.000000000000004,28 8.244294954150542,36.18033988749895 12.391547869638773,22.472135954999583 0.9788696740969272,13.819660112501058 15.297717981660213,13.527864045000422 "],["points","20,0 40,20 20,40 0,20"],["x","15","y","0","width","10","height","40",1,"rotate"],["x","0","y","15","width","40","height","10",1,"rotate"]],template:function(t,r){if(t&1&&(Ri(0),Z(1,"div",2),je(2,yBe,1,0,"ng-container",3),Q(),Z(3,"mat-menu",4,0),ui(5,bBe,2,4,"button",5,Ea),Q(),je(7,ABe,10,2,"ng-template",null,1,Gp)),t&2){let n=Or(4),a=Or(8),o=hr(r.backgroundShapeInputSignal());oe(),Re("matMenuTriggerFor",n),oe(),Re("ngTemplateOutlet",a)("ngTemplateOutletContext",o),oe(3),hi(r.BACKGROUND_SHAPE_TYPES)}},dependencies:[Wp,eM,Xh,Um,QC],styles:[".flex-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.flex-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.align-center[_ngcontent-%COMP%], .align-main-center[_ngcontent-%COMP%]{justify-content:center}.align-center[_ngcontent-%COMP%], .align-cross-center[_ngcontent-%COMP%]{align-items:center}.align-main-end[_ngcontent-%COMP%]{justify-content:flex-end}.align-cross-end[_ngcontent-%COMP%]{align-items:flex-end}.align-main-start[_ngcontent-%COMP%]{justify-content:flex-start}.align-cross-start[_ngcontent-%COMP%]{align-items:flex-start}.align-cross-stretch[_ngcontent-%COMP%]{align-items:stretch}.gap-0-5-rem[_ngcontent-%COMP%]{gap:.5rem}.gap-1-rem[_ngcontent-%COMP%]{gap:1rem}.gap-1-5-rem[_ngcontent-%COMP%]{gap:1.5rem}.flex-1[_ngcontent-%COMP%]{flex:1}.select-shape[_ngcontent-%COMP%]{cursor:pointer}.rotate[_ngcontent-%COMP%]{transform:translate(20px,-10px) rotate(45deg)} .shape-menu .mat-mdc-menu-content{--menu-item-width: 40px;--menu-item-height: 40px;--menu-item-padding: 8px;--max-number-of-items: 3;--menu-gap: .5rem;display:flex;flex-direction:row;flex-wrap:wrap;gap:var(--menu-gap);padding:1rem;max-width:calc(var(--max-number-of-items) * (var(--menu-item-width) + 2 * var(--menu-item-padding)) + (var(--max-number-of-items) - 1) * var(--menu-gap))} .shape-menu .mat-mdc-menu-content>button{box-sizing:content-box;min-width:var(--menu-item-width);max-width:var(--menu-item-width);min-height:var(--menu-item-height);max-height:var(--menu-item-height);padding:var(--menu-item-padding)} .shape-menu .mat-mdc-menu-content>button>span{max-width:var(--menu-item-width);max-height:var(--menu-item-height)}"]})};var PBe=["iconFileUpload"];function BBe(i,e){if(i&1&&(Z(0,"mat-error"),ce(1),Q()),i&2){let t=Se();oe(),Ti(t.currentError)}}function RBe(i,e){i&1&&(Z(0,"div",9)(1,"p"),ce(2,"No background shapes added yet."),Q()())}function DBe(i,e){i&1&&Ge(0,"div",43)}function LBe(i,e){if(i&1&&(Z(0,"div",40),Ge(1,"div",41)(2,"div",42),Z(3,"div",30)(4,"div",31),Ge(5,"div",43)(6,"div",43),je(7,DBe,1,0,"div",43),Q(),Z(8,"div",31),Ge(9,"div",43),Q()(),Ge(10,"div",42),Q()),i&2){let t=Se().$implicit;oe(7),Je(t.type==="vehicle"?7:-1)}}function IBe(i,e){if(i&1&&(Z(0,"mat-option",15),ce(1),Vr(2,"titlecase"),Q()),i&2){let t=e.$implicit;Re("value",t),oe(),_t(" ",En(2,2,t.replaceAll("-"," "))," ")}}function FBe(i,e){if(i&1&&(Z(0,"mat-option",15),ce(1),Vr(2,"titlecase"),Q()),i&2){let t=e.$implicit;Re("value",t),oe(),_t(" ",En(2,2,t.replaceAll("-"," "))," ")}}function OBe(i,e){if(i&1){let t=vt();Z(0,"mat-form-field",32)(1,"mat-label"),ce(2,"Vehicle Mode"),Q(),Z(3,"input",44),mh("ngModelChange",function(n){Ee(t);let a=Se().$implicit;return dh(a.mode,n)||(a.mode=n),Ae(n)}),Q()()}if(i&2){let t=Se().$implicit;oe(3),hh("ngModel",t.mode)}}function zBe(i,e){if(i&1){let t=vt();Z(0,"mat-chip-row",45),Le("removed",function(){let n=Ee(t).$implicit,a=Se().$index,o=Se();return Ae(o.removeTagFromBackgroundShape(a,n))})("edited",function(n){let a=Ee(t).$implicit,o=Se().$index,s=Se();return Ae(s.editTagInBackgroundShape(o,a,n))}),ce(1),Z(2,"button",46)(3,"mat-icon"),ce(4,"cancel"),Q()()()}if(i&2){let t=e.$implicit;Re("aria-description","press enter to edit "+t)("editable",!0),oe(),_t(" ",t," "),oe(),Mt("aria-label","remove "+t)}}function HBe(i,e){if(i&1){let t=vt();Z(0,"div",11),je(1,LBe,11,1,"div",26),Z(2,"div",27)(3,"app-background-shape",28),Le("shapeChange",function(n){let a=Ee(t).$index,o=Se();return Ae(o.onBackgroundShapeTypeChange(a,n))}),Q()(),Z(4,"input",29),Le("input",function(n){let a=Ee(t).$index,o=Se();return Ae(o.onBackgroundShapeColorChange(a,n))}),Q(),Z(5,"div",30)(6,"div",31)(7,"mat-form-field",32)(8,"mat-label"),ce(9,"Type"),Q(),Z(10,"mat-select",33),mh("valueChange",function(n){let a=Ee(t).$implicit;return dh(a.type,n)||(a.type=n),Ae(n)}),ui(11,IBe,3,4,"mat-option",15,_o),Q()(),Z(13,"mat-form-field",32)(14,"mat-label"),ce(15,"Zoom"),Q(),Z(16,"mat-select",33),mh("valueChange",function(n){let a=Ee(t).$implicit;return dh(a.zoom,n)||(a.zoom=n),Ae(n)}),ui(17,FBe,3,4,"mat-option",15,_o),Q()(),je(19,OBe,4,1,"mat-form-field",32),Q(),Z(20,"div",31)(21,"mat-form-field",32)(22,"mat-label"),ce(23,"Tags"),Q(),Z(24,"mat-chip-grid",34,2),ui(26,zBe,5,4,"mat-chip-row",35,Ea),Z(28,"input",36),Le("matChipInputTokenEnd",function(n){let a=Ee(t).$index,o=Se();return Ae(o.addTagToBackgroundShape(a,n))}),Q()(),Z(29,"mat-hint"),ce(30," If multiple tags are selected, the shape will be used for entities that have all of them. "),Q()()()(),Z(31,"div",37)(32,"button",38),Le("click",function(){let n=Ee(t).$index,a=Se();return Ae(a.duplicateBackgroundShape(n))}),Z(33,"mat-icon"),ce(34,"content_copy"),Q()(),Z(35,"button",39),Le("click",function(){let n=Ee(t).$index,a=Se();return Ae(a.toggleBackgroundShapeIsActive(n))}),Z(36,"mat-icon"),ce(37),Q()()(),Z(38,"button",39),Le("click",function(){let n=Ee(t).$index,a=Se();return Ae(a.removeBackgroundShape(n))}),Z(39,"mat-icon"),ce(40,"cancel"),Q()()()}if(i&2){let t=e.$implicit,r=Or(25),n=Se();oe(3),Re("backgroundShape",t),oe(),Re("value",t.color.substring(0,7)),oe(6),hh("value",t.type),oe(),hi(n.CUSTOMIZATION_ENTITY_TYPES),oe(5),hh("value",t.zoom),oe(),hi(n.CUSTOMIZATION_ZOOMS),oe(2),Je(t.type==="vehicle"?19:-1),oe(7),hi(t.tags),oe(2),Re("matChipInputAddOnBlur",!0)("matChipInputFor",r),oe(7),ax("matTooltip","",t.isActive?"Deactivate":"Activate"," Background Shape"),oe(2),_t(" ",t.isActive?"visibility":"visibility_off"," "),oe(),Re("matTooltip","Remove background shape")}}function NBe(i,e){i&1&&(Z(0,"div",9)(1,"p"),ce(2,"No custom icons added yet."),Q()())}function GBe(i,e){i&1&&Ge(0,"div",43)}function VBe(i,e){if(i&1&&(Z(0,"div",40),Ge(1,"div",41)(2,"div",42),Z(3,"div",30)(4,"div",31),Ge(5,"div",43)(6,"div",43),je(7,GBe,1,0,"div",43),Q(),Z(8,"div",31),Ge(9,"div",43),Q()(),Ge(10,"div",42),Q()),i&2){let t=Se().$implicit;oe(7),Je(t.type==="vehicle"?7:-1)}}function KBe(i,e){if(i&1&&(Z(0,"mat-option",15),ce(1),Vr(2,"titlecase"),Q()),i&2){let t=e.$implicit;Re("value",t),oe(),_t(" ",En(2,2,t.replaceAll("-"," "))," ")}}function WBe(i,e){if(i&1&&(Z(0,"mat-option",15),ce(1),Vr(2,"titlecase"),Q()),i&2){let t=e.$implicit;Re("value",t),oe(),_t(" ",En(2,2,t.replaceAll("-"," "))," ")}}function UBe(i,e){if(i&1){let t=vt();Z(0,"mat-form-field",32)(1,"mat-label"),ce(2,"Vehicle Mode"),Q(),Z(3,"input",44),mh("ngModelChange",function(n){Ee(t);let a=Se().$implicit;return dh(a.mode,n)||(a.mode=n),Ae(n)}),Q()()}if(i&2){let t=Se().$implicit;oe(3),hh("ngModel",t.mode)}}function jBe(i,e){if(i&1){let t=vt();Z(0,"mat-chip-row",45),Le("removed",function(){let n=Ee(t).$implicit,a=Se().$index,o=Se();return Ae(o.removeTagFromCustomTexture(a,n))})("edited",function(n){let a=Ee(t).$implicit,o=Se().$index,s=Se();return Ae(s.editTagInCustomTexture(o,a,n))}),ce(1),Z(2,"button",46)(3,"mat-icon"),ce(4,"cancel"),Q()()()}if(i&2){let t=e.$implicit;Re("aria-description","press enter to edit "+t)("editable",!0),oe(),_t(" ",t," "),oe(),Mt("aria-label","remove "+t)}}function qBe(i,e){if(i&1){let t=vt();Z(0,"div",11),je(1,VBe,11,1,"div",26),Z(2,"div",27),Ge(3,"img",47),Q(),Z(4,"button",48),Le("click",function(){let n=Ee(t).$index,a=Se();return Ae(a.uploadCustomTexture(n))}),Z(5,"mat-icon"),ce(6,"upload"),Q()(),Z(7,"div",30)(8,"div",31)(9,"mat-form-field",32)(10,"mat-label"),ce(11,"Type"),Q(),Z(12,"mat-select",33),mh("valueChange",function(n){let a=Ee(t).$implicit;return dh(a.type,n)||(a.type=n),Ae(n)}),ui(13,KBe,3,4,"mat-option",15,_o),Q()(),Z(15,"mat-form-field",32)(16,"mat-label"),ce(17,"Zoom"),Q(),Z(18,"mat-select",33),mh("valueChange",function(n){let a=Ee(t).$implicit;return dh(a.zoom,n)||(a.zoom=n),Ae(n)}),ui(19,WBe,3,4,"mat-option",15,_o),Q()(),je(21,UBe,4,1,"mat-form-field",32),Q(),Z(22,"div",31)(23,"mat-form-field",32)(24,"mat-label"),ce(25,"Tags"),Q(),Z(26,"mat-chip-grid",34,2),ui(28,jBe,5,4,"mat-chip-row",35,Ea),Z(30,"input",36),Le("matChipInputTokenEnd",function(n){let a=Ee(t).$index,o=Se();return Ae(o.addTagToCustomTexture(a,n))}),Q()(),Z(31,"mat-hint"),ce(32," If multiple tags are selected, the icon will be used for entities that have all of them. "),Q()()()(),Z(33,"div",37)(34,"button",49),Le("click",function(){let n=Ee(t).$index,a=Se();return Ae(a.duplicateCustomTexture(n))}),Z(35,"mat-icon"),ce(36,"content_copy"),Q()(),Z(37,"button",39),Le("click",function(){let n=Ee(t).$index,a=Se();return Ae(a.toggleCustomTextureIsActive(n))}),Z(38,"mat-icon"),ce(39),Q()()(),Z(40,"button",39),Le("click",function(){let n=Ee(t).$index,a=Se();return Ae(a.removeCustomTexture(n))}),Z(41,"mat-icon"),ce(42,"cancel"),Q()()()}if(i&2){let t=e.$implicit,r=Or(27),n=Se();oe(3),Re("src",t.url,rx),oe(9),hh("value",t.type),oe(),hi(n.CUSTOMIZATION_ENTITY_TYPES),oe(5),hh("value",t.zoom),oe(),hi(n.CUSTOMIZATION_ZOOMS),oe(2),Je(t.type==="vehicle"?21:-1),oe(7),hi(t.tags),oe(2),Re("matChipInputAddOnBlur",!0)("matChipInputFor",r),oe(7),ax("matTooltip","",t.isActive?"Deactivate":"Activate"," Custom Icon"),oe(2),_t(" ",t.isActive?"visibility":"visibility_off"," "),oe(),Re("matTooltip","Remove custom icon")}}function ZBe(i,e){if(i&1){let t=vt();Ri(0),Z(1,"div",13)(2,"div",27),Ge(3,"img",47),Q(),Z(4,"button",48),Le("click",function(){let n=Ee(t).$implicit,a=Se();return Ae(a.uploadDefaultTexture(n))}),Z(5,"mat-icon"),ce(6,"upload"),Q()(),Z(7,"mat-form-field",50),Ge(8,"input",51),Vr(9,"titlecase"),Q(),Z(10,"button",52),Le("click",function(){let n=Ee(t).$implicit,a=Se();return Ae(a.resetDefaultTexture(n))}),Z(11,"mat-icon"),ce(12,"restart_alt"),Q()()()}if(i&2){let t=e.$implicit,r=Se().getTextureUrlSignal(t)();oe(3),Re("src",r,rx),oe(5),ax("value","Default ",En(9,3,t.replaceAll("-"," "))," Icon")}}function YBe(i,e){if(i&1&&Ge(0,"div",54),i&2){let t=e.$implicit;yr("background-color",t)}}function JBe(i,e){if(i&1&&(Z(0,"div",16)(1,"span"),ce(2,"Light Preset:"),Q(),ui(3,YBe,1,2,"div",53,_o),Q()),i&2){let t=Se();oe(3),hi(t.PRESET_LIGHT_COLOR_THEME)}}function $Be(i,e){if(i&1&&Ge(0,"div",54),i&2){let t=e.$implicit;yr("background-color",t)}}function XBe(i,e){if(i&1&&(Z(0,"div",16)(1,"span"),ce(2,"Saturated Preset:"),Q(),ui(3,$Be,1,2,"div",53,_o),Q()),i&2){let t=Se();oe(3),hi(t.PRESET_SATURATED_COLOR_THEME)}}function QBe(i,e){i&1&&Ge(0,"div",60)}function eRe(i,e){if(i&1){let t=vt();Z(0,"div",57),je(1,QBe,1,0,"div",58),Z(2,"input",59),Le("input",function(n){let a=Ee(t).$index,o=Se(2);return Ae(o.onColorChange(a,n))}),Q()()}if(i&2){let t=e.$implicit;oe(2),Re("value",t)}}function tRe(i,e){if(i&1){let t=vt();Z(0,"div",16)(1,"span"),ce(2,"Custom:"),Q(),Z(3,"button",55),Le("click",function(){Ee(t);let n=Se();return Ae(n.removeCustomColor())}),Z(4,"mat-icon"),ce(5,"remove_circle_outline"),Q()(),Z(6,"div",56),Le("cdkDropListDropped",function(n){Ee(t);let a=Se();return Ae(a.dropCustomColor(n))}),ui(7,eRe,3,1,"div",57,_o),Q(),Z(9,"button",55),Le("click",function(){Ee(t);let n=Se();return Ae(n.addCustomColor())}),Z(10,"mat-icon"),ce(11,"add_circle_outline"),Q()()(),Z(12,"span"),ce(13,"*Click to set their color. Drag to change their order."),Q()}if(i&2){let t=Se();oe(3),Re("disabled",!t.canRemoveColor()),oe(4),hi(t.customColors()),oe(2),Re("disabled",!t.canAddColor())}}function iRe(i,e){if(i&1&&(Z(0,"div",18),Ri(1),Ge(2,"img",47)(3,"div",61),Q()),i&2){let t=e.$implicit,r=Se(),n=r.getTextureUrlSignal(t)();oe(2),Re("src",n,rx),oe(),yr("background-color",r.testScaleColor)("mask-image","url("+n+")")("webkit-mask-image","url("+n+")")}}var rRe=["vehicle","passenger","stop","zoomed-out-vehicle","zoomed-out-passenger","zoomed-out-stop"],iM=class i{constructor(e,t){this.dialogRef=e;this.spritesService=t;this.SPRITE_SIZE=this.spritesService.SPRITE_SIZE,this.PRESET_LIGHT_COLOR_THEME=this.spritesService.PRESET_LIGHT_COLOR_THEME,this.PRESET_SATURATED_COLOR_THEME=this.spritesService.PRESET_SATURATED_COLOR_THEME,this.vehicleTextureUrlSignal.set(this.spritesService.vehicleTexture.baseTexture.resource.url),this.passengerTextureUrlSignal.set(this.spritesService.passengerTexture.baseTexture.resource.url),this.stopTextureUrlSignal.set(this.spritesService.stopTexture.baseTexture.resource.url),this.zoomedOutVehicleTextureUrlSignal.set(this.spritesService.zoomedOutVehicleTexture.baseTexture.resource.url),this.zoomedOutPassengerTextureUrlSignal.set(this.spritesService.zoomedOutPassengerTexture.baseTexture.resource.url),this.zoomedOutStopTextureUrlSignal.set(this.spritesService.zoomedOutStopTexture.baseTexture.resource.url),this.customTexturesSignal.set(this.spritesService.customTextures),this.backgroundShapesSignal.set(this.spritesService.backgroundShapes),this.colorPresetIndex=this.spritesService.colorPresetIndex,this.customColors.set(structuredClone(this.spritesService.customColors))}SPRITE_SIZE;PRESET_LIGHT_COLOR_THEME;PRESET_SATURATED_COLOR_THEME;EDITABLE_DEFAULT_ICON_TYPES=rRe;CUSTOMIZATION_ENTITY_TYPES=o$;CUSTOMIZATION_ZOOMS=s$;MIN_COLOR_COUNT=2;MAX_COLOR_COUNT=12;currentError="";colorPresetIndex=0;customColors=Bt(["#00ff00","#ff0000"]);testScaleValue=0;testScaleColor="#ffffff";customTexturesSignal=Bt([]);backgroundShapesSignal=Bt([]);vehicleTextureUrlSignal=Bt("");passengerTextureUrlSignal=Bt("");stopTextureUrlSignal=Bt("");zoomedOutVehicleTextureUrlSignal=Bt("");zoomedOutPassengerTextureUrlSignal=Bt("");zoomedOutStopTextureUrlSignal=Bt("");uploadButton=lh.required("iconFileUpload");selectedTextureIndex=null;selectedDefaultTextureType=null;dropCustomColor(e){this.customColors.update(t=>(Bf(t,e.previousIndex,e.currentIndex),t)),this.applyColorGradientTester()}canRemoveColor=$t(()=>this.customColors().length>this.MIN_COLOR_COUNT);canAddColor=$t(()=>this.customColors().length<this.MAX_COLOR_COUNT);addCustomColor(){this.canAddColor()&&(this.customColors.update(e=>[...e,"#dd0000"]),this.applyColorGradientTester())}removeCustomColor(){this.canRemoveColor()&&(this.customColors.update(e=>(e.pop(),[...e])),this.applyColorGradientTester())}onColorChange(e,t){let r=t.target.value;this.customColors.update(n=>(n[e]=r,n)),this.applyColorGradientTester()}onColorSetIndexChange(e){this.applyColorGradientTester()}onColorScaleChange(e){this.testScaleValue=parseInt(e.target.value)/100,this.applyColorGradientTester()}applyColorGradientTester(){let e=[];if(this.colorPresetIndex==0&&(e=this.spritesService.PRESET_LIGHT_COLOR_THEME),this.colorPresetIndex==1&&(e=this.spritesService.PRESET_SATURATED_COLOR_THEME),this.colorPresetIndex==2&&(e=this.customColors()),this.testScaleValue===0){this.testScaleColor="#ffffff";return}let t=Hf(e),r=sc(t(this.testScaleValue))?.formatHex()??"#ffffff";this.testScaleColor=r}onIconFileUpload(e){let t=e.target;if(!t||!t.files)return;let r=new FileReader;r.onloadend=()=>Ce(this,null,function*(){if(r.result)try{let n=yield hq.read(r.result);n.resize({w:this.SPRITE_SIZE});let a=yield n.getBase64("image/png");if(this.selectedTextureIndex!==null)this.setCustomTexture(this.selectedTextureIndex,a);else if(this.selectedDefaultTextureType!==null)this.getTextureUrlSignal(this.selectedDefaultTextureType).set(a);else{this.currentError="No texture selected for upload.";return}this.currentError=""}catch{this.currentError="Cannot upload this image."}finally{t.value=""}}),r.readAsDataURL(t.files[0])}onConfigurationFileUpload(e){let t=e.target;if(!t||!t.files)return;let r=new FileReader;r.onloadend=()=>{if(r.result)try{let n=JSON.parse(r.result);if(n.version!==this.spritesService.VERSION){this.currentError="Import data format is outdated.";return}if(n.vehicleTextureUrl===void 0){this.currentError="JSON has missing data: vehicleTextureUrl";return}if(n.passengerTextureUrl===void 0){this.currentError="JSON has missing data: passengerTextureUrl";return}if(n.stopTextureUrl===void 0){this.currentError="JSON has missing data: stopTextureUrl";return}if(n.zoomedOutVehicleTextureUrl===void 0){this.currentError="JSON has missing data: zoomedOutVehicleTextureUrl";return}if(n.zoomedOutPassengerTextureUrl===void 0){this.currentError="JSON has missing data: zoomedOutPassengerTextureUrl";return}if(n.zoomedOutStopTextureUrl===void 0){this.currentError="JSON has missing data: zoomedOutStopTextureUrl";return}if(n.customTextures===void 0){this.currentError="JSON has missing data: customTextures";return}if(n.colorPresetIndex===void 0){this.currentError="JSON has missing data: colorPresetIndex";return}if(n.customColors===void 0){this.currentError="JSON has missing data: customColors";return}this.vehicleTextureUrlSignal.set(n.vehicleTextureUrl),this.passengerTextureUrlSignal.set(n.passengerTextureUrl),this.stopTextureUrlSignal.set(n.stopTextureUrl),this.zoomedOutVehicleTextureUrlSignal.set(n.zoomedOutVehicleTextureUrl),this.zoomedOutPassengerTextureUrlSignal.set(n.zoomedOutPassengerTextureUrl),this.zoomedOutStopTextureUrlSignal.set(n.zoomedOutStopTextureUrl),this.customTexturesSignal.set(n.customTextures),this.backgroundShapesSignal.set(n.backgroundShapes),this.colorPresetIndex=n.colorPresetIndex,n.customColors.length>=2&&this.customColors.set(n.customColors),this.currentError=""}catch{this.currentError="Could not parse JSON data."}finally{t.value=""}},r.readAsText(t.files[0])}uploadDefaultTexture(e){this.selectedTextureIndex=null,this.selectedDefaultTextureType=e,this.uploadButton().nativeElement.click()}getTextureUrlSignal(e){switch(e){case"vehicle":return this.vehicleTextureUrlSignal;case"passenger":return this.passengerTextureUrlSignal;case"stop":return this.stopTextureUrlSignal;case"zoomed-out-vehicle":return this.zoomedOutVehicleTextureUrlSignal;case"zoomed-out-passenger":return this.zoomedOutPassengerTextureUrlSignal;case"zoomed-out-stop":return this.zoomedOutStopTextureUrlSignal}}resetDefaultTexture(e){switch(e){case"vehicle":this.vehicleTextureUrlSignal.set(this.spritesService.DEFAULT_VEHICLE_TEXTURE_URL);break;case"passenger":this.passengerTextureUrlSignal.set(this.spritesService.DEFAULT_PASSENGER_TEXTURE_URL);break;case"stop":this.stopTextureUrlSignal.set(this.spritesService.DEFAULT_STOP_TEXTURE_URL);break;case"zoomed-out-vehicle":this.zoomedOutVehicleTextureUrlSignal.set(this.spritesService.DEFAULT_ZOOMED_OUT_VEHICLE_TEXTURE_URL);break;case"zoomed-out-passenger":this.zoomedOutPassengerTextureUrlSignal.set(this.spritesService.DEFAULT_ZOOMED_OUT_PASSENGER_TEXTURE_URL);break;case"zoomed-out-stop":this.zoomedOutStopTextureUrlSignal.set(this.spritesService.DEFAULT_ZOOMED_OUT_STOP_TEXTURE_URL)}}uploadCustomTexture(e){this.selectedTextureIndex=e,this.selectedDefaultTextureType=null,this.uploadButton().nativeElement.click()}addCustomTexture(){this.customTexturesSignal.update(e=>[...e,{mode:null,url:this.spritesService.DEFAULT_UNDEFINED_TEXTURE_URL,tags:[],type:"vehicle",zoom:"any",isActive:!0}])}removeCustomTexture(e){e>=this.customTexturesSignal().length||this.customTexturesSignal.update(t=>(t.splice(e,1),[...t]))}setCustomTexture(e,t){e>=this.customTexturesSignal().length||this.customTexturesSignal.update(r=>(r[e].url=t,[...r]))}dropCustomTexture(e){this.customTexturesSignal.update(t=>(Bf(t,e.previousIndex,e.currentIndex),structuredClone(t)))}addTagToCustomTexture(e,t){e>=this.customTexturesSignal().length||this.customTexturesSignal.update(r=>{let n=structuredClone(r[e]),a=t.value.trim();return a?(n.tags.includes(a)||(n.tags.push(a),n.tags.sort()),t.chipInput.clear(),r[e]=n,[...r]):r})}removeTagFromCustomTexture(e,t){e>=this.customTexturesSignal().length||this.customTexturesSignal.update(r=>{let n=structuredClone(r[e]);return n.tags=n.tags.filter(a=>a!==t),r[e]=n,[...r]})}editTagInCustomTexture(e,t,r){e>=this.customTexturesSignal().length||this.customTexturesSignal.update(n=>{let a=structuredClone(n[e]),o=r.value.trim();return t&&(a.tags=a.tags.filter(s=>s!==t)),o&&!a.tags.includes(o)&&(a.tags.push(o),a.tags.sort()),n[e]=a,[...n]})}addBackgroundShape(){this.backgroundShapesSignal.update(e=>[...e,{color:"#ff000080",shape:"circle",mode:null,tags:[],type:"vehicle",zoom:"any",isActive:!0}])}removeBackgroundShape(e){e>=this.backgroundShapesSignal().length||this.backgroundShapesSignal.update(t=>(t.splice(e,1),[...t]))}dropBackgroundShape(e){this.backgroundShapesSignal.update(t=>(Bf(t,e.previousIndex,e.currentIndex),structuredClone(t)))}addTagToBackgroundShape(e,t){e>=this.backgroundShapesSignal().length||this.backgroundShapesSignal.update(r=>{let n=structuredClone(r[e]),a=t.value.trim();return a?(n.tags.includes(a)||(n.tags.push(a),n.tags.sort()),t.chipInput.clear(),r[e]=n,[...r]):r})}removeTagFromBackgroundShape(e,t){e>=this.backgroundShapesSignal().length||this.backgroundShapesSignal.update(r=>{let n=structuredClone(r[e]);return n.tags=n.tags.filter(a=>a!==t),r[e]=n,[...r]})}editTagInBackgroundShape(e,t,r){e>=this.backgroundShapesSignal().length||this.backgroundShapesSignal.update(n=>{let a=structuredClone(n[e]),o=r.value.trim();return t&&(a.tags=a.tags.filter(s=>s!==t)),o&&!a.tags.includes(o)&&(a.tags.push(o),a.tags.sort()),n[e]=a,[...n]})}onBackgroundShapeTypeChange(e,t){e>=this.backgroundShapesSignal().length||this.backgroundShapesSignal.update(r=>{let n=structuredClone(r[e]);return n.shape=t,r[e]=n,[...r]})}onBackgroundShapeColorChange(e,t){if(e>=this.backgroundShapesSignal().length)return;let r=t.target.value;this.backgroundShapesSignal.update(n=>{let a=structuredClone(n[e]);return a.color=r+"80",n[e]=a,[...n]})}exportTextures(){let e={version:this.spritesService.VERSION,vehicleTextureUrl:this.vehicleTextureUrlSignal(),passengerTextureUrl:this.passengerTextureUrlSignal(),stopTextureUrl:this.stopTextureUrlSignal(),zoomedOutVehicleTextureUrl:this.zoomedOutVehicleTextureUrlSignal(),zoomedOutPassengerTextureUrl:this.zoomedOutPassengerTextureUrlSignal(),zoomedOutStopTextureUrl:this.zoomedOutStopTextureUrlSignal(),customTextures:this.customTexturesSignal(),backgroundShapes:this.backgroundShapesSignal(),colorPresetIndex:this.colorPresetIndex,customColors:this.customColors()},t=new Blob([JSON.stringify(e,null,2)],{type:"application/json"}),r=URL.createObjectURL(t),n=document.createElement("a");n.href=r,n.download="multimodal-icons.json",n.click(),URL.revokeObjectURL(r)}onSave(){this.spritesService.saveTextureData(this.vehicleTextureUrlSignal(),this.passengerTextureUrlSignal(),this.stopTextureUrlSignal(),this.zoomedOutVehicleTextureUrlSignal(),this.zoomedOutPassengerTextureUrlSignal(),this.zoomedOutStopTextureUrlSignal(),this.customTexturesSignal(),this.backgroundShapesSignal(),this.colorPresetIndex,this.customColors()),this.dialogRef.close()}duplicateCustomTexture(e){e>=this.customTexturesSignal().length||this.customTexturesSignal.update(t=>{let r=structuredClone(t[e]);return[...t.slice(0,e+1),r,...t.slice(e+1)]})}duplicateBackgroundShape(e){e>=this.backgroundShapesSignal().length||this.backgroundShapesSignal.update(t=>{let r=structuredClone(t[e]);return[...t.slice(0,e+1),r,...t.slice(e+1)]})}toggleCustomTextureIsActive(e){e>=this.customTexturesSignal().length||this.customTexturesSignal.update(t=>{let r=structuredClone(t[e]);return r.isActive=!r.isActive,t[e]=r,[...t]})}toggleBackgroundShapeIsActive(e){e>=this.backgroundShapesSignal().length||this.backgroundShapesSignal.update(t=>{let r=structuredClone(t[e]);return r.isActive=!r.isActive,t[e]=r,[...t]})}static \u0275fac=function(t){return new(t||i)(rt(jo),rt(Zg))};static \u0275cmp=tt({type:i,selectors:[["app-edit-map-icons-dialog"]],viewQuery:function(t,r){t&1&&ch(r.uploadButton,PBe,5),t&2&&uh()},decls:66,vars:11,consts:[["iconFileUpload",""],["configurationFileUpload",""],["chipGrid",""],["mat-dialog-title",""],["type","file","accept",".png, .jpg, .jpeg, .bmp",1,"file-upload",3,"change"],["type","file","accept",".json",1,"file-upload",3,"change"],[1,"text-content"],[1,"add-container"],["mat-button","",1,"add-button",3,"click"],[1,"no-custom-textures"],["cdkDropList","","cdkDropListOrientation","vertical",1,"icon-list",3,"cdkDropListDropped"],["cdkDrag","",1,"icon-list-item"],[1,"icon-list"],[1,"icon-list-item"],[1,"color-group",3,"ngModelChange","change","ngModel"],[3,"value"],[1,"color-list-container"],[1,"color-tester"],[1,"icon","wrapper-icon"],["min","0","max","100","discrete","","showTickMarks",""],["matSliderThumb","",3,"input"],[1,"file-porters"],["mat-icon-button","","matTooltip","Export JSON",3,"click"],["mat-icon-button","","matTooltip","Import JSON",3,"click"],["mat-button","","mat-dialog-close",""],["mat-button","",3,"click"],["class","icon-placeholder-container icon-list-item",4,"cdkDragPlaceholder"],[1,"icon"],[3,"shapeChange","backgroundShape"],["type","color",1,"shape-color-picker",3,"input","value"],[1,"form-fields"],[1,"form-field-row"],["appearance","outline","subscriptSizing","dynamic",1,"compact-input","custom-icon-form-field"],[3,"valueChange","value"],["aria-label","Enter fruits"],[3,"aria-description","editable"],[3,"matChipInputTokenEnd","matChipInputAddOnBlur","matChipInputFor"],[1,"flex-column","gap-0-5-rem"],["mat-icon-button","","matTooltip","Duplicate Background Shape",3,"click"],["mat-icon-button","",3,"click","matTooltip"],[1,"icon-placeholder-container","icon-list-item"],[1,"icon-placeholder","icon"],[1,"icon-button-placeholder"],[1,"form-field-placeholder","custom-icon-form-field"],["matInput","",3,"ngModelChange","ngModel"],[3,"removed","edited","aria-description","editable"],["matChipRemove",""],["width","40","alt","icon",3,"src"],["mat-icon-button","","matTooltip","Upload image",3,"click"],["mat-icon-button","","matTooltip","Duplicate Custom Icon",3,"click"],["appearance","outline","subscriptSizing","dynamic",1,"compact-input","default-icon-type"],["matInput","","disabled","",3,"value"],["mat-icon-button","","matTooltip","Reset icon",3,"click"],[1,"preset-color",3,"background-color"],[1,"preset-color"],["mat-icon-button","",1,"mini-icon-button",3,"click","disabled"],["cdkDropList","","cdkDropListOrientation","horizontal",1,"custom-color-list",3,"cdkDropListDropped"],["cdkDrag","",1,"custom-color"],["class","color-placeholder",4,"cdkDragPlaceholder"],["type","color",1,"color-picker",3,"input","value"],[1,"color-placeholder"],[1,"color-overlay"]],template:function(t,r){if(t&1){let n=vt();Z(0,"h1",3),ce(1,"Customize Entities"),Q(),Z(2,"mat-dialog-content")(3,"h2"),ce(4,"Edit Icons"),Q(),Z(5,"input",4,0),Le("change",function(o){return Ee(n),Ae(r.onIconFileUpload(o))}),Q(),Z(7,"input",5,1),Le("change",function(o){return Ee(n),Ae(r.onConfigurationFileUpload(o))}),Q(),Z(9,"div")(10,"div",6)(11,"p"),ce(12),Q(),Z(13,"p"),ce(14," The icons are in decreasing order of priority, meaning that if two icons match for an entity, the one that appears first in the list will be used. You can drag and drop the icons lines to change their order. Background shapes are also in decreasing order of priority, but have no effect on the icons. These shapes are displayed behind the icons and are generally used to visually group entities. "),Q(),je(15,BBe,2,1,"mat-error"),Q(),Z(16,"div",7)(17,"button",8),Le("click",function(){return Ee(n),Ae(r.addCustomTexture())}),ce(18," Add Custom Icon "),Q(),Z(19,"button",8),Le("click",function(){return Ee(n),Ae(r.addBackgroundShape())}),ce(20," Add Background Shape "),Q()(),je(21,RBe,3,0,"div",9),Z(22,"section",10),Le("cdkDropListDropped",function(o){return Ee(n),Ae(r.dropBackgroundShape(o))}),ui(23,HBe,41,11,"div",11,_o),Ge(25,"mat-divider"),Q(),je(26,NBe,3,0,"div",9),Z(27,"section",10),Le("cdkDropListDropped",function(o){return Ee(n),Ae(r.dropCustomTexture(o))}),ui(28,qBe,43,10,"div",11,_o),Ge(30,"mat-divider"),Q(),Z(31,"section",12),ui(32,ZBe,13,5,"div",13,Ea),Ge(34,"mat-divider"),Z(35,"h2"),ce(36,"Capacity color gradient"),Q(),Z(37,"mat-radio-group",14),mh("ngModelChange",function(o){return Ee(n),dh(r.colorPresetIndex,o)||(r.colorPresetIndex=o),Ae(o)}),Le("change",function(o){return Ee(n),Ae(r.onColorSetIndexChange(o))}),Z(38,"mat-radio-button",15),ce(39,"Light"),Q(),Z(40,"mat-radio-button",15),ce(41,"Saturated"),Q(),Z(42,"mat-radio-button",15),ce(43,"Custom"),Q()(),je(44,JBe,5,0,"div",16)(45,XBe,5,0,"div",16)(46,tRe,14,2),Z(47,"span"),ce(48,"*Test the color gradient using the slider below."),Q(),Z(49,"div",17),ui(50,iRe,4,7,"div",18,Ea),Z(52,"mat-slider",19)(53,"input",20),Le("input",function(o){return Ee(n),Ae(r.onColorScaleChange(o))}),Q()()()()()(),Z(54,"mat-dialog-actions")(55,"div",21)(56,"button",22),Le("click",function(){return Ee(n),Ae(r.exportTextures())}),Z(57,"mat-icon"),ce(58,"download_for_offline"),Q()(),Z(59,"button",23),Le("click",function(){Ee(n);let o=Or(8);return Ae(o.click())}),Z(60,"mat-icon"),ce(61,"upload_file"),Q()()(),Z(62,"button",24),ce(63,"Cancel"),Q(),Z(64,"button",25),Le("click",function(){return Ee(n),Ae(r.onSave())}),ce(65,"Save"),Q()()}t&2&&(oe(12),_t(" The uploaded icons will be rescaled to ",r.SPRITE_SIZE,"px in width. For a better result, the icons should not be too wide or too thin. "),oe(3),Je(r.currentError!==""?15:-1),oe(6),Je(r.backgroundShapesSignal().length<=0?21:-1),oe(2),hi(r.backgroundShapesSignal()),oe(3),Je(r.customTexturesSignal().length<=0?26:-1),oe(2),hi(r.customTexturesSignal()),oe(4),hi(r.EDITABLE_DEFAULT_ICON_TYPES),oe(5),hh("ngModel",r.colorPresetIndex),oe(),Re("value",0),oe(2),Re("value",1),oe(2),Re("value",2),oe(2),Je(r.colorPresetIndex===0?44:-1),oe(),Je(r.colorPresetIndex===1?45:-1),oe(),Je(r.colorPresetIndex===2?46:-1),oe(4),hi(r.EDITABLE_DEFAULT_ICON_TYPES))},dependencies:[Os,Is,Fs,vo,Br,pn,Xl,Cw,Ps,ec,uR,ha,ac,zs,Ef,Af,Rs,Eh,Dw,$l,tc,So,qo,pr,mr,Ah,Kw,Rn,Da,qw,jw,Ff,Uw,Hb,Lf,u8,c8,l8,cx,qn,_8,b8,Df,UR,tM],styles:[".flex-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.flex-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.align-center[_ngcontent-%COMP%], .align-main-center[_ngcontent-%COMP%]{justify-content:center}.align-center[_ngcontent-%COMP%], .align-cross-center[_ngcontent-%COMP%]{align-items:center}.align-main-end[_ngcontent-%COMP%]{justify-content:flex-end}.align-cross-end[_ngcontent-%COMP%]{align-items:flex-end}.align-main-start[_ngcontent-%COMP%]{justify-content:flex-start}.align-cross-start[_ngcontent-%COMP%]{align-items:flex-start}.align-cross-stretch[_ngcontent-%COMP%]{align-items:stretch}.gap-0-5-rem[_ngcontent-%COMP%]{gap:.5rem}.gap-1-rem[_ngcontent-%COMP%]{gap:1rem}.gap-1-5-rem[_ngcontent-%COMP%]{gap:1.5rem}.flex-1[_ngcontent-%COMP%]{flex:1}p[_ngcontent-%COMP%]{margin-top:0}.add-container[_ngcontent-%COMP%]{display:flex;justify-content:center;margin-bottom:10px}.icon-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:10px}.icon-list-item[_ngcontent-%COMP%]{padding:5px 0;width:100%;display:flex;flex-direction:row;align-items:center;gap:10px;overflow:visible}.icon[_ngcontent-%COMP%]{width:40px;display:flex;align-items:baseline;justify-content:center}.form-fields[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:10px;min-width:0;flex:1}.form-field-row[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;gap:10px}.custom-icon-form-field[_ngcontent-%COMP%]{flex:1}.icon-placeholder-container[_ngcontent-%COMP%]{--placeholder-background-color: #f0f0f0;border:dotted 3px #999}.icon-placeholder[_ngcontent-%COMP%]{background-color:var(--placeholder-background-color);min-height:40px}.icon-button-placeholder[_ngcontent-%COMP%]{background-color:var(--placeholder-background-color);min-width:48px;min-height:48px}.form-field-placeholder[_ngcontent-%COMP%]{background-color:var(--placeholder-background-color);border-radius:4px;min-height:36px}.file-upload[_ngcontent-%COMP%]{display:none}.file-porters[_ngcontent-%COMP%]{margin-right:auto}.file-porters[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{color:var(--mat-sys-primary)}.color-title[_ngcontent-%COMP%]{margin:0}.color-group[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.color-picker[_ngcontent-%COMP%]{border:none;width:15px;height:15px;margin:2px;padding:0;background:none;cursor:pointer}.color-picker[_ngcontent-%COMP%]::-webkit-color-swatch-wrapper{padding:0}.color-picker[_ngcontent-%COMP%]::-webkit-color-swatch{border:1px solid black;border-radius:0}.color-picker[_ngcontent-%COMP%]::-moz-color-swatch{border:1px solid black;border-radius:0}.shape-color-picker[_ngcontent-%COMP%]{border:none;width:24px;height:24px;margin:8px;padding:0;background:none;cursor:pointer}.shape-color-picker[_ngcontent-%COMP%]::-webkit-color-swatch-wrapper{padding:0}.shape-color-picker[_ngcontent-%COMP%]::-webkit-color-swatch{border:1px solid black;border-radius:0}.shape-color-picker[_ngcontent-%COMP%]::-moz-color-swatch{border:1px solid black;border-radius:0}.color-list-container[_ngcontent-%COMP%], .custom-color-list[_ngcontent-%COMP%], .custom-color[_ngcontent-%COMP%], .preset-color[_ngcontent-%COMP%]{display:flex;align-items:center}.color-list-container[_ngcontent-%COMP%]{gap:5px}.preset-color[_ngcontent-%COMP%]{width:15px;height:15px;border:1px solid black}.color-placeholder[_ngcontent-%COMP%]{background:#ccc;border:dotted 3px #999;width:15px;height:15px;transition:transform .25s cubic-bezier(0,0,.2,1)}.mini-icon-button[_ngcontent-%COMP%]{width:32px;height:32px;padding:7px 4px 4px}.mini-icon-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px}.color-tester[_ngcontent-%COMP%]{display:flex;gap:10px}.wrapper-icon[_ngcontent-%COMP%]{position:relative}.color-overlay[_ngcontent-%COMP%]{position:absolute;top:0;left:0;mix-blend-mode:multiply;pointer-events:none;mask-repeat:no-repeat;width:40px;height:100%;mask-size:40px;-webkit-mask-repeat:no-repeat;-webkit-mask-size:contain}.default-icon-type[_ngcontent-%COMP%]{flex:1}mat-divider[_ngcontent-%COMP%]{padding-block-end:1rem}"]})};function nRe(i,e){i&1&&(Z(0,"mat-icon",2),ce(1," error "),Q())}function aRe(i,e){i&1&&(Z(0,"mat-icon",3),ce(1," warning "),Q())}function oRe(i,e){i&1&&(Z(0,"mat-icon"),ce(1," info "),Q())}function sRe(i,e){}function lRe(i,e){if(i&1&&(Z(0,"button",4),ce(1),Q()),i&2){let t,r=Se();Re("mat-dialog-close",!1),oe(),_t(" ",(t=r.data.cancelButtonOverride)!==null&&t!==void 0?t:"Close"," ")}}var rM=class i{constructor(e){this.data=e}static \u0275fac=function(t){return new(t||i)(rt(sm))};static \u0275cmp=tt({type:i,selectors:[["app-information-dialog"]],decls:14,vars:6,consts:[["mat-dialog-title",""],[1,"flex-row","align-main-start","align-cross-center","gap-1-rem"],[1,"text-red"],[1,"text-yellow"],["mat-button","",3,"mat-dialog-close"]],template:function(t,r){if(t&1&&(Z(0,"h2",0),ce(1),Q(),Z(2,"mat-dialog-content")(3,"div",1),je(4,nRe,2,0,"mat-icon",2)(5,aRe,2,0,"mat-icon",3)(6,oRe,2,0,"mat-icon")(7,sRe,0,0),Z(8,"p"),ce(9),Q()()(),Z(10,"mat-dialog-actions"),je(11,lRe,2,2,"button",4),Z(12,"button",4),ce(13),Q()()),t&2){let n,a;oe(),Ti(r.data.title),oe(3),Je((n=r.data.type)==="error"?4:n==="warning"?5:n==="info"?6:7),oe(5),_t(" ",r.data.message," "),oe(2),Je(r.data.canCancel?11:-1),oe(),Re("mat-dialog-close",!0),oe(),_t(" ",(a=r.data.confirmButtonOverride)!==null&&a!==void 0?a:r.data.canCancel?"Confirm":"Close"," ")}},dependencies:[Is,Os,vo,Fs,Br,pn,mr],styles:[".flex-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.flex-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.align-center[_ngcontent-%COMP%], .align-main-center[_ngcontent-%COMP%]{justify-content:center}.align-center[_ngcontent-%COMP%], .align-cross-center[_ngcontent-%COMP%]{align-items:center}.align-main-end[_ngcontent-%COMP%]{justify-content:flex-end}.align-cross-end[_ngcontent-%COMP%]{align-items:flex-end}.align-main-start[_ngcontent-%COMP%]{justify-content:flex-start}.align-cross-start[_ngcontent-%COMP%]{align-items:flex-start}.align-cross-stretch[_ngcontent-%COMP%]{align-items:stretch}.gap-0-5-rem[_ngcontent-%COMP%]{gap:.5rem}.gap-1-rem[_ngcontent-%COMP%]{gap:1rem}.gap-1-5-rem[_ngcontent-%COMP%]{gap:1.5rem}.flex-1[_ngcontent-%COMP%]{flex:1}*[_ngcontent-%COMP%]{--red-text-color: #ff0000;--red-background-color: #ffdddd;--yellow-text-color: #ffc21b;--yellow-background-color: #ffe6a4;--green-text-color: #00aa00;--green-background-color: #ccffcc;--gray-text-color: #666666;--gray-background-color: #f0f0f0;--blue-text-color: #4488ff;--blue-background-color: #cce5ff;--loaded-slider-color: #005cbb88;--active-button-color: #cce6ff}.text-red[_ngcontent-%COMP%]{color:var(--red-text-color)}.background-red[_ngcontent-%COMP%]{background-color:var(--red-background-color)}.text-yellow[_ngcontent-%COMP%]{color:var(--yellow-text-color)}.background-yellow[_ngcontent-%COMP%]{background-color:var(--yellow-background-color)}.text-green[_ngcontent-%COMP%]{color:var(--green-text-color)}.background-green[_ngcontent-%COMP%]{background-color:var(--green-background-color)}.text-gray[_ngcontent-%COMP%]{color:var(--gray-text-color)}.background-gray[_ngcontent-%COMP%]{background-color:var(--gray-background-color)!important}.text-blue[_ngcontent-%COMP%]{color:var(--blue-text-color)}.background-blue[_ngcontent-%COMP%]{background-color:var(--blue-background-color)}mat-icon[_ngcontent-%COMP%]{min-width:24px}"]})};var v$=go(nI());var cRe=["starting","paused","running","stopping","completed","lost","corrupted","outdated","future"];function uRe(i){return cRe.includes(i)}var Bu=["starting","running","paused","stopping","lost"],f$={starting:0,running:1,paused:1,stopping:2,lost:3,completed:4,corrupted:5,outdated:5,future:5};function g$(i){if(typeof i!="string")return console.error("Invalid data type for start time",i),null;if(!/^\d{8}-\d{9}$/.test(i))return console.error("Invalid format for start time",i),null;let e=parseInt(i.slice(0,4)),t=parseInt(i.slice(4,6))-1,r=parseInt(i.slice(6,8)),n=parseInt(i.slice(9,11)),a=parseInt(i.slice(11,13)),o=parseInt(i.slice(13,15)),s=parseInt(i.slice(16,19));return new Date(e,t,r,n,a,o,s)}function hRe(i){if(typeof i!="object"||i===null)return console.error("Invalid data type for simulation",i),null;if(!("id"in i)||typeof i.id!="string")return console.error("Invalid simulation ID in simulation",i),null;let e=i.id;if(!("status"in i)||!uRe(i.status))return console.error("Invalid simulation status in simulation",i),null;let t=i.status;if(i.status==="corrupted"){let g=i.id.split(lf)[1]??"unknown",_=g$(i.id.split(lf)[0])??new Date(0);return{id:e,name:g,data:"unknown",status:t,startTime:_,simulationStartTime:null,simulationEndTime:null,simulationTime:null,simulationEstimatedEndTime:null,lastUpdateIndex:null,completion:-1,configuration:{maxDuration:null},polylinesVersion:-1,size:null}}if(!("name"in i)||typeof i.name!="string")return console.error("Invalid simulation name in simulation",i),null;let r=i.name;if(!("data"in i)||typeof i.data!="string")return console.error("Invalid simulation data in simulation",i),null;let n=i.data;if(!("startTime"in i))return console.error("Invalid simulation start time in simulation",i),null;let a=g$(i.startTime);if(a===null)return console.error("Invalid simulation start time",i.startTime,"in simulation",i),null;let o=null;if("simulationStartTime"in i){if(typeof i.simulationStartTime!="number")return console.error("Invalid simulation start time",i.simulationStartTime,"in simulation",i),null;o=i.simulationStartTime}let s=null;if("simulationEndTime"in i){if(typeof i.simulationEndTime!="number")return console.error("Invalid simulation end time",i.simulationEndTime,"in simulation",i),null;s=i.simulationEndTime}let l=null;if("simulationTime"in i){if(typeof i.simulationTime!="number")return console.error("Invalid simulation time",i.simulationTime,"in simulation",i),null;l=i.simulationTime}let c=null;if("simulationEstimatedEndTime"in i){if(typeof i.simulationEstimatedEndTime!="number")return console.error("Invalid simulation estimated end time",i.simulationEstimatedEndTime,"in simulation",i),null;c=i.simulationEstimatedEndTime}let u=null;if("lastUpdateIndex"in i){if(typeof i.lastUpdateIndex!="number")return console.error("Invalid last update index",i.lastUpdateIndex,"in simulation",i),null;u=i.lastUpdateIndex}let h=1;Bu.includes(t)&&(o!==null&&l!==null&&c!==null?h=(l-o)/(c-o):(console.warn("Incomplete simulation data for completion calculation",i),h=0));let d=null;if("configuration"in i){if(typeof i.configuration!="object"||i.configuration===null)return console.error("Invalid configuration",i.configuration,"in simulation",i),null;if("maxDuration"in i.configuration){if(i.configuration.maxDuration!==null&&typeof i.configuration.maxDuration!="number")return console.error("Invalid max duration",i.configuration.maxDuration,"in simulation",i),null;d=i.configuration.maxDuration}}let p=-1;if("polylinesVersion"in i){if(typeof i.polylinesVersion!="number")return console.error("Invalid polylines version",i.polylinesVersion,"in simulation",i),null;p=i.polylinesVersion}let f=null;if("size"in i){if(i.size!==null&&typeof i.size!="number")return console.error("Invalid size",i.size,"in simulation",i),null;f=i.size}return{id:e,name:r,data:n,status:t,startTime:a,simulationStartTime:o,simulationEndTime:s,simulationTime:l,simulationEstimatedEndTime:c,lastUpdateIndex:u,completion:h,configuration:{maxDuration:d},polylinesVersion:p,size:f}}function y$(i){if(!Array.isArray(i))return console.error("Invalid data type for simulations",i),[];let e=[];for(let t of i){let r=hRe(t);if(r!==null)e.push(r);else return console.error("Invalid simulation data",t),null}return e}function _$(i,e){let t=f$[i.status],r=f$[e.status];return t<r?-1:t>r||i.startTime<e.startTime?1:-1}var To=class i{constructor(e,t){this.socket=e;this.dialogService=t;Ji(()=>{this._communicationStatusSignal()==="disconnected"?this.disconnectedDialogRef===null&&(this.disconnectedDialogRef=this.dialogService.openInformationDialog({title:"Disconnected",message:"The connection to the server has been lost. Please verify that the server is running and try again. The application will attempt to reconnect automatically.",type:"error",confirmButtonOverride:"Continue Anyway",cancelButtonOverride:null,canCancel:!1})):this.disconnectedDialogRef!==null&&(this.disconnectedDialogRef.close(),this.disconnectedDialogRef=null)}),this.onConnect(()=>{this._communicationStatusSignal.set("connected")}),this.onDisconnect(()=>{this._communicationStatusSignal.set("disconnected"),console.error("Disconnected from the server")}),this.on("error",r=>{console.error("Socket error:",r)}),setTimeout(()=>{this._communicationStatusSignal.update(r=>r==="connecting"?"disconnected":r)},1e3)}_communicationStatusSignal=Bt("connecting");disconnectedDialogRef=null;get isConnectedSignal(){return $t(()=>this._communicationStatusSignal()==="connected")}get communicationStatusSignal(){return this._communicationStatusSignal}emit(e,...t){this.socket.emit(e,...t)}on(e,t){this.socket.on(e,t)}onDisconnect(e){this.socket.on("disconnect",e)}onConnect(e){this.socket.on("connect",e)}removeAllListeners(e){this.socket.removeAllListeners(e)}static \u0275fac=function(t){return new(t||i)(Zt(sf),Zt(Js))};static \u0275prov=lt({token:i,factory:i.\u0275fac,providedIn:"root"})};var Qh=class i{constructor(e){this.communicationService=e;this.listen(),this.query(),this.communicationService.onConnect(()=>{this.query()})}_simulationsSignal=Bt([]);_availableSimulationDataSignal=Bt([]);get simulationsSignal(){return $t(()=>this._simulationsSignal().sort(_$))}get availableSimulationDataSignal(){return this._availableSimulationDataSignal}queryAvailableData(){this.communicationService.emit("get-available-data")}listen(){this.communicationService.on("simulations",e=>{let t=y$(e);if(t===null){console.error("Invalid simulations data",e);return}this._simulationsSignal.set(t)}),this.communicationService.on("available-data",e=>{if(!Array.isArray(e)||!e.every(t=>typeof t=="string")){console.error("Invalid available data",e);return}this._availableSimulationDataSignal.set(e)})}query(){this.querySimulations(),this.queryAvailableData()}querySimulations(){this.communicationService.emit("get-simulations")}static \u0275fac=function(t){return new(t||i)(Zt(To))};static \u0275prov=lt({token:i,factory:i.\u0275fac,providedIn:"root"})};var Jg=class i{constructor(e){this.http=e}apiUrl=Ux.apiUrl;exportFolder(e,t){return this.http.get(this.apiUrl+`${e}/${t}`,{responseType:"blob"})}importFolder(e,t,r){return this.http.post(this.apiUrl+`${e}/${t}`,r)}deleteFolder(e,t){return this.http.delete(this.apiUrl+`${e}/${t}`)}static \u0275fac=function(t){return new(t||i)(Zt(F_))};static \u0275prov=lt({token:i,factory:i.\u0275fac,providedIn:"root"})};function dRe(i,e){i&1&&(Z(0,"mat-error"),ce(1,"Name is required"),Q())}function mRe(i,e){i&1&&(Z(0,"mat-error"),ce(1,"Name must be at least 3 characters long"),Q())}function pRe(i,e){i&1&&(Z(0,"mat-error"),ce(1,"Name must be at most 50 characters long"),Q())}function fRe(i,e){if(i&1&&(Z(0,"mat-error"),ce(1),Q()),i&2){let t=Se(2);oe(),_t(" The name must not contain the simulation save file separator (",t.SIMULATION_SAVE_FILE_SEPARATOR,") ")}}function gRe(i,e){i&1&&(Z(0,"mat-error"),ce(1,' The name muse not contain characters that might affect the file system (e.g. /, \\, :, *, ?, ", <, >, |) '),Q())}function yRe(i,e){if(i&1&&(Z(0,"mat-option",14),ce(1),Q()),i&2){let t=e.$implicit;Re("value",t),oe(),Ti(t)}}function _Re(i,e){i&1&&(Z(0,"mat-error"),ce(1,"Data is required"),Q())}function bRe(i,e){if(i&1){let t=vt();Z(0,"h3"),ce(1,"General"),Q(),Z(2,"div",8)(3,"section",9)(4,"mat-form-field",10),Ge(5,"input",11),Z(6,"mat-label"),ce(7,"Name"),Q(),Z(8,"mat-hint"),ce(9,"Spaces will be replaced by underscores"),Q(),je(10,dRe,2,0,"mat-error")(11,mRe,2,0,"mat-error")(12,pRe,2,0,"mat-error")(13,fRe,2,1,"mat-error")(14,gRe,2,0,"mat-error"),Q(),Z(15,"mat-form-field",10)(16,"mat-select",12),Le("openedChange",function(){Ee(t);let n=Se();return Ae(n.refreshAvailableData())}),Z(17,"mat-option",13),Le("click",function(){Ee(t);let n=Se();return Ae(n.importInputData())}),ce(18,"\u2795 Import New Folder"),Q(),ui(19,yRe,2,2,"mat-option",14,Ea),Q(),Z(21,"mat-label"),ce(22,"Data"),Q(),je(23,_Re,2,0,"mat-error"),Q()(),Z(24,"mat-checkbox",15),ce(25," Run in background "),Q()()}if(i&2){let t=Se();oe(4),Re("subscriptSizing","dynamic"),oe(6),Je(t.nameFormControl.hasError("required")?10:t.nameFormControl.hasError("minlength")?11:t.nameFormControl.hasError("maxlength")?12:t.nameFormControl.hasError("invalidPattern")?13:t.nameFormControl.hasError("invalidCharacter")?14:-1),oe(5),Re("subscriptSizing","dynamic"),oe(4),hi(t.availableSimulationDataSignal()),oe(4),Je(t.dataFormControl.hasError("required")?23:-1)}}function vRe(i,e){i&1&&(Z(0,"span",3)(1,"mat-icon",16),ce(2,"error"),Q(),Z(3,"span"),ce(4,"Select a valid data source before changing the configuration the simulation"),Q()())}function SRe(i,e){i&1&&(Z(0,"mat-error"),ce(1,"Max duration must be greater than 0"),Q())}function kRe(i,e){i&1&&ce(0," Start ")}function xRe(i,e){i&1&&ce(0," Save ")}var nM=class i{constructor(e,t,r,n,a){this.data=e;this.dataService=t;this.dialogRef=r;this.formBuilder=n;this.httpService=a;this.nameFormControl=this.formBuilder.control(null,[Fn.minLength(3),Fn.maxLength(50),this.validateName()]),this.data.mode==="start"&&this.nameFormControl.addValidators(Fn.required),this.dataFormControl=this.formBuilder.control(null),this.data.mode==="start"&&this.dataFormControl.addValidators(Fn.required),this.shouldRunInBackgroundFormControl=this.formBuilder.control(!1),this.maxDurationFormControl=this.formBuilder.control(null,[Fn.min(0)]),this.generalFormGroup=this.formBuilder.group({name:this.nameFormControl,data:this.dataFormControl,shouldRunInBackground:this.shouldRunInBackgroundFormControl}),this.configurationFormGroup=this.formBuilder.group({maxDuration:this.maxDurationFormControl}),this.formGroup=this.formBuilder.group({general:this.generalFormGroup,configuration:this.configurationFormGroup}),this.data.mode==="edit"&&this.data.currentConfiguration&&this.maxDurationFormControl.setValue(this.data.currentConfiguration.maxDuration===null?null:this.data.currentConfiguration.maxDuration/3600),this.data.mode==="start"&&(this.dataFormControl.valueChanges.pipe(gi(this.unsubscribe$)).subscribe(o=>{o?this.enableConfigurationFields():this.disableConfigurationFields()}),this.dataFormControl.value||this.disableConfigurationFields())}SIMULATION_SAVE_FILE_SEPARATOR=lf;formGroup;generalFormGroup;configurationFormGroup;nameFormControl;dataFormControl;maxDurationFormControl;shouldRunInBackgroundFormControl;unsubscribe$=new ct;ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}onSave(){this.formGroup.valid?this.dialogRef.close(this.buildResult()):console.error("Invalid form",this.formGroup)}get availableSimulationDataSignal(){return this.dataService.availableSimulationDataSignal}refreshAvailableData(){this.dataService.queryAvailableData()}buildResult(){let e=this.nameFormControl.value;return typeof e=="string"&&(e=e.trim().replace(/\s/g,"_")),{general:{name:e,data:this.dataFormControl.value,shouldRunInBackground:!!this.shouldRunInBackgroundFormControl.value},configuration:{maxDuration:this.maxDurationFormControl.value===null?null:Math.ceil(this.maxDurationFormControl.value*3600)}}}disableConfigurationFields(){this.maxDurationFormControl.disable()}enableConfigurationFields(){this.maxDurationFormControl.enable()}validateName(){return e=>{if(typeof e.value=="string"){if(e.value.match(lf))return{invalidPattern:!0};if(e.value.match(/[<>:"/\\|?*]/))return{invalidCharacter:!0}}return null}}importInputData(){let e=document.createElement("input");e.type="file",e.webkitdirectory=!0,e.multiple=!0;let t=r=>Ce(this,null,function*(){let n=r.target.files;if(!n||n.length===0)return;let a=new v$.default,o=n[0].webkitRelativePath.split("/")[0];for(let u of Array.from(n)){let h=u.webkitRelativePath.replace(o+"/","");a.file(h,u)}let s=yield a.generateAsync({type:"blob"}),l="input_data",c=new FormData;c.append("file",s,"folder.zip"),this.httpService.importFolder(l,o,c).subscribe({next:u=>{this.refreshAvailableData();let h="actual_folder_name"in u?u.actual_folder_name:o;setTimeout(()=>{this.dataFormControl.setValue(h)},100)},error:u=>{console.error("Upload failed:",u)}})});e.addEventListener("change",r=>{t(r).catch(n=>{console.error("Error handling file change:",n)})}),e.click()}exportInputData(e){this.httpService.exportFolder("input_data",e).subscribe(r=>{let n=new Blob([r],{type:"application/zip"}),a=window.URL.createObjectURL(n),o=document.createElement("a");o.href=a,o.download=e+".zip",document.body.appendChild(o),o.click(),document.body.removeChild(o),window.URL.revokeObjectURL(a)})}deleteInputData(e){this.httpService.deleteFolder("input_data",e).subscribe({next:r=>{r.message||r.error&&console.error("Failed to delete the data folder:",r.error)},error:r=>{console.error("HTTP error during deletion:",r)}})}static \u0275fac=function(t){return new(t||i)(rt(sm),rt(Qh),rt(jo),rt(wf),rt(Jg))};static \u0275cmp=tt({type:i,selectors:[["app-simulation-configuration-dialog"]],decls:24,vars:5,consts:[["mat-dialog-title",""],[3,"formGroup"],["formGroupName","configuration",1,"flex-column","gap-1-rem"],[1,"error-message","flex-row","align-cross-center","gap-0-5-rem"],["type","number","matInput","","formControlName","maxDuration"],["matTextSuffix",""],["mat-button","","mat-dialog-close",""],["mat-button","",3,"click"],["formGroupName","general"],[1,"flex-row","gap-1-rem","no-stretch"],[3,"subscriptSizing"],["matInput","","formControlName","name"],["formControlName","data",3,"openedChange"],[3,"click"],[3,"value"],["formControlName","shouldRunInBackground"],[1,"error-icon"]],template:function(t,r){if(t&1&&(Z(0,"h2",0),ce(1,"Configure Simulation"),Q(),Z(2,"mat-dialog-content")(3,"form",1),je(4,bRe,26,4),Z(5,"h3"),ce(6,"Simulation"),Q(),Z(7,"div",2),je(8,vRe,5,0,"span",3),Z(9,"mat-form-field"),Ge(10,"input",4),Z(11,"mat-label"),ce(12,"Simulation Duration (optional)"),Q(),je(13,SRe,2,0,"mat-error"),Z(14,"span",5),ce(15,"h"),Q(),Z(16,"mat-hint"),ce(17," The simulation will stop after this in-simulation duration, even if not finished (0.5 = 30min) "),Q()()()()(),Z(18,"mat-dialog-actions")(19,"button",6),ce(20,"Cancel"),Q(),Z(21,"button",7),Le("click",function(){return r.onSave()}),je(22,kRe,1,0)(23,xRe,1,0),Q()()),t&2){let n;oe(3),Re("formGroup",r.formGroup),oe(),Je(r.data.mode==="start"?4:-1),oe(4),Je(r.data.mode==="start"&&!r.dataFormControl.valid?8:-1),oe(5),Je(r.maxDurationFormControl.hasError("min")?13:-1),oe(9),Je((n=r.data.mode)==="start"?22:n==="edit"?23:-1)}},dependencies:[Os,Is,Fs,vo,Br,pn,ha,ac,zs,Ef,Af,Rw,Rs,wh,Ps,Cb,ec,xh,Bs,Tb,ww,Eh,Dw,$l,tc,Mw,So,qo,pr,mr],styles:[".flex-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.flex-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.align-center[_ngcontent-%COMP%], .align-main-center[_ngcontent-%COMP%]{justify-content:center}.align-center[_ngcontent-%COMP%], .align-cross-center[_ngcontent-%COMP%]{align-items:center}.align-main-end[_ngcontent-%COMP%]{justify-content:flex-end}.align-cross-end[_ngcontent-%COMP%]{align-items:flex-end}.align-main-start[_ngcontent-%COMP%]{justify-content:flex-start}.align-cross-start[_ngcontent-%COMP%]{align-items:flex-start}.align-cross-stretch[_ngcontent-%COMP%]{align-items:stretch}.gap-0-5-rem[_ngcontent-%COMP%]{gap:.5rem}.gap-1-rem[_ngcontent-%COMP%]{gap:1rem}.gap-1-5-rem[_ngcontent-%COMP%]{gap:1.5rem}.flex-1[_ngcontent-%COMP%]{flex:1}.error-icon[_ngcontent-%COMP%]{min-width:24px}.error-message[_ngcontent-%COMP%]{max-width:calc(424px + 1rem)}.no-stretch[_ngcontent-%COMP%]{align-items:flex-start}.no-stretch[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1}"]})};var Y$=go(nI());function aM(i){return new Date(i*1e3).toISOString().slice(11,19)}var ed=class i{transform(e){return aM(e)}static \u0275fac=function(t){return new(t||i)};static \u0275pipe=W4({name:"simulationTime",type:i,pure:!0})};var A$=go(sI());function hs(i){return typeof i=="object"&&i!==null&&"tags"in i&&Array.isArray(i.tags)&&i.tags.every(e=>typeof e=="string")}var MRe=["previous","current","next"];function lI(i){return MRe.includes(i)}function $g(i){if(typeof i!="object"||i===null)return console.error("Invalid data type for leg",i),null;let e=[];if("tags"in i){if(!hs(i))return console.error("Invalid tags in leg",i),null;e=i.tags.sort((u,h)=>u.localeCompare(h))}if(!("legType"in i)||!lI(i.legType))return console.error("Invalid leg type",i),null;let t=i.legType,r=null;if("assignedVehicleId"in i){if(i.assignedVehicleId!==null&&typeof i.assignedVehicleId!="string")return console.error("Invalid assigned vehicle ID",i.assignedVehicleId,"for leg",i),null;r=i.assignedVehicleId}let n=null;if("boardingStopId"in i){if(i.boardingStopId!==null&&typeof i.boardingStopId!="string")return console.error("Invalid boarding stop index",i.boardingStopId,"for leg",i),null;n=i.boardingStopId}let a=null;if("alightingStopId"in i){if(i.alightingStopId!==null&&typeof i.alightingStopId!="string")return console.error("Invalid alighting stop index",i.alightingStopId,"for leg",i),null;a=i.alightingStopId}let o=null;if("boardingStopIndex"in i){if(i.boardingStopIndex!==null&&typeof i.boardingStopIndex!="number")return console.error("Invalid boarding stop index",i.boardingStopIndex,"for leg",i),null;o=i.boardingStopIndex}let s=null;if("alightingStopIndex"in i){if(i.alightingStopIndex!==null&&typeof i.alightingStopIndex!="number")return console.error("Invalid alighting stop index",i.alightingStopIndex,"for leg",i),null;s=i.alightingStopIndex}let l=null;if("boardingTime"in i){if(i.boardingTime!==null&&typeof i.boardingTime!="number")return console.error("Invalid boarding time",i.boardingTime,"for leg",i),null;l=i.boardingTime}let c=null;if("alightingTime"in i){if(i.alightingTime!==null&&typeof i.alightingTime!="number")return console.error("Invalid alighting time",i.alightingTime,"for leg",i),null;c=i.alightingTime}return{tags:e,legType:t,assignedVehicleId:r,boardingStopId:n,alightingStopId:a,boardingStopIndex:o,alightingStopIndex:s,boardingTime:l,alightingTime:c}}var TRe=["release","assigned","ready","onboard","complete"];function cI(i){return TRe.includes(i)}function P$(i){if(typeof i!="object"||i===null)return console.error("Invalid data type for passenger",i),null;if(!("id"in i)||typeof i.id!="string")return console.error("Invalid ID for passenger",i),null;let e=i.id,t=(0,A$.default)({seed:e});if(!("status"in i)||!cI(i.status))return console.error("Invalid status for passenger",i),null;let r=i.status;if(!("numberOfPassengers"in i)||typeof i.numberOfPassengers!="number")return console.error("Invalid number of passengers for passenger",i),null;let n=i.numberOfPassengers;if(!("previousLegs"in i)||!Array.isArray(i.previousLegs))return console.error("Invalid previous legs in passenger",i),null;let a=i.previousLegs.map($g);if(!a.every(c=>c!==null)){let c=a.find(u=>u===null);return console.error("Invalid previous legs, including",c,"in passenger",i),null}let o=null;if("currentLeg"in i&&(o=$g(i.currentLeg),o===null))return console.error("Invalid current leg in passenger",i),null;if(!("nextLegs"in i)||!Array.isArray(i.nextLegs))return console.error("Invalid next legs in passenger",i),null;let s=i.nextLegs.map($g);if(!s.every(c=>c!==null)){let c=s.find(u=>u===null);return console.error("Invalid next legs, including",c,"in passenger",i),null}let l=[];if("tags"in i){if(!hs(i))return console.error("Invalid tags",i.tags,"in passenger",i),null;l=i.tags.sort((c,u)=>c.localeCompare(u))}return{id:e,name:t,entityType:"passenger",status:r,previousLegs:a,currentLeg:o,nextLegs:s,numberOfPassengers:n,tags:l,error:null}}function td(i){return i.previousLegs.forEach(e=>e.legType="previous"),i.currentLeg!==null&&(i.currentLeg.legType="current"),i.nextLegs.forEach(e=>e.legType="next"),i.previousLegs.concat(i.currentLeg===null?[]:[i.currentLeg],i.nextLegs)}function B$(i,e){let t=i.currentLeg??i.nextLegs[0]??null;return t===null||t.assignedVehicleId===null?null:t.boardingTime===null||t.boardingTime>e?t.boardingStopId===null?null:{stopId:t.boardingStopId,vehicleId:t.assignedVehicleId}:t.alightingTime===null||t.alightingTime>e||t.alightingStopId===null?null:{stopId:t.alightingStopId,vehicleId:t.assignedVehicleId}}function R$(i,e){let t=i.currentLeg??i.nextLegs[0]??null;return t===null||t.boardingTime===null||t.boardingTime>e?null:t.alightingTime===null||t.alightingTime>e?t.assignedVehicleId:null}function D$(i,e,t){let r=i.currentLeg??i.nextLegs[0]??null;return r===null?!1:r.boardingTime===null||r.boardingTime>t?e===r.boardingStopId:r.alightingTime===null||r.alightingTime>t?!1:e===r.alightingStopId}function L$(i,e,t){let r=i.currentLeg??i.nextLegs[0]??null;return r===null||r.boardingTime===null||r.boardingTime>t?!1:r.alightingTime===null||r.alightingTime>t?r.assignedVehicleId===e:!1}var Xg=class{constructor(e){this.compare=e}_items=[];add(e){let t=this.findInsertionIndex(e);this._items.splice(t,0,e)}shift(){return this._items.shift()}get length(){return this._items.length}get items(){return this._items}get editableItems(){return this._items}findInsertionIndex(e){let t=0,r=this._items.length-1;for(;t<=r;){let n=Math.floor((t+r)/2),a=this.compare(this._items[n],e);if(a<0)t=n+1;else if(a>0)r=n-1;else return n}return t}};var Ru=1,I$=2;function uI(){return new Xg((i,e)=>e.priority-i.priority)}var id=class{constructor(e,t){this.priority=e;this.queue=t}addToQueue(){this.queue.add(this)}get numberOfTasks(){return 1}},jm=class extends id{constructor(t,r,n){super(t,r);this.taskFunction=n}process(){this.taskFunction()}},Pl=class extends id{hasCalledBeforeAll=!1;subtasks=uI();constructor(e,t){super(e,t)}process(){if(!this.hasCalledBeforeAll)this.beforeAll(),this.hasCalledBeforeAll=!0;else{let e=this.subtasks.shift();if(!e){this.afterAll();return}e.process()}this.addToQueue()}get numberOfTasks(){return this.subtasks.items.reduce((e,t)=>e+t.numberOfTasks,1)}};function hI(i){return!(typeof i!="object"||i===null||!("latitude"in i)||typeof i.latitude!="number"||!("longitude"in i)||typeof i.longitude!="number")}var ERe=["previous","current","next"];function dI(i){return ERe.includes(i)}var ARe=10;function PRe(i){let e=hI(i)?i:i.position;return""+e.latitude+","+e.longitude}function Qg(i,e){if(typeof i!="object"||i===null)return console.error("Invalid data type for stop",i),null;let t=[];if("tags"in i){if(!hs(i))return console.error("Invalid tags",i.tags,"in stop",i),null;t=i.tags.sort((u,h)=>u.localeCompare(h))}if(!("stopType"in i)||!dI(i.stopType))return console.error("Invalid stop type in stop",i),null;let r=i.stopType;if(!("arrivalTime"in i)||typeof i.arrivalTime!="number")return console.error("Invalid arrival time in stop",i),null;let n=i.arrivalTime,a=null;if("departureTime"in i){if(i.departureTime!==null&&typeof i.departureTime!="number")return console.error("Invalid departure time",i.departureTime,"in stop",i),null;a=i.departureTime}if(!("position"in i)||!hI(i.position))return console.error("Invalid position in stop",i),null;let o=i.position,s=ARe;if("capacity"in i){if(typeof i.capacity!="number")return console.error("Invalid capacity",i.capacity,"in stop",i),null;s=i.capacity}if(!("label"in i)||typeof i.label!="string")return console.error("Invalid label in stop",i),null;let l=i.label;return{id:PRe(o),name:l,entityType:"stop",tags:t,stopType:r,arrivalTime:n,departureTime:a,position:o,capacity:s,label:l,vehicleId:e,error:null}}var BRe=["release","idle","boarding","enroute","alighting","complete"];function mI(i){return BRe.includes(i)}function F$(i){if(typeof i!="object"||i===null)return console.error("Invalid data type for vehicle",i),null;if(!("id"in i)||typeof i.id!="string")return console.error("Invalid ID for vehicle",i),null;let e=i.id;if(!("name"in i)||typeof i.name!="string")return console.error("Invalid name for vehicle",i),null;let t=i.name,r=null;if("mode"in i){if(typeof i.mode!="string")return console.error("Invalid mode for vehicle",i.mode,"in vehicle",i),null;r=i.mode}if(!("status"in i)||!mI(i.status))return console.error("Invalid status for vehicle",i),null;let n=i.status;if(!("previousStops"in i)||!Array.isArray(i.previousStops))return console.error("Invalid previous stops for vehicle",i),null;let a=i.previousStops.map(u=>Qg(u,e));if(!a.every(u=>u!==null)){let u=a.find(h=>h===null);return console.error("Invalid previous stops, including",u,"in vehicle",i),null}let o=null;if("currentStop"in i&&(o=Qg(i.currentStop,e),o===null))return console.error("Invalid current stop for vehicle",i),null;if(!("nextStops"in i)||!Array.isArray(i.nextStops))return console.error("Invalid next stops for vehicle",i),null;let s=i.nextStops.map(u=>Qg(u,e));if(!s.every(u=>u!==null)){let u=s.find(h=>h===null);return console.error("Invalid next stops, including",u,"in vehicle",i),null}if(!("capacity"in i)||typeof i.capacity!="number")return console.error("Invalid capacity for vehicle",i),null;let l=i.capacity,c=[];if("tags"in i){if(!hs(i))return console.error("Invalid tags",i.tags,"for vehicle",i),null;c=i.tags.sort((u,h)=>u.localeCompare(h))}return{id:e,name:t,entityType:"vehicle",mode:r,status:n,previousStops:a,currentStop:o,nextStops:s,capacity:l,tags:c,error:null}}function Bl(i){return i.previousStops.forEach(e=>e.stopType="previous"),i.currentStop!==null&&(i.currentStop.stopType="current"),i.nextStops.forEach(e=>e.stopType="next"),i.previousStops.concat(i.currentStop===null?[]:[i.currentStop],i.nextStops)}function _I(){return{passengerTags:[],vehicleTags:[],stopTags:[],legTags:[],passengerLegs:{},vehicleStops:{}}}var sM=class extends Pl{constructor(t,r,n,a){super(I$,t);this.states=r;this.references=n;this.callback=a}continuousEnvironments=[];beforeAll(){for(let t of this.states)new gI(this.subtasks,t,this.references,this.continuousEnvironments).addToQueue()}afterAll(){this.callback(this.continuousEnvironments)}},gI=class extends Pl{constructor(t,r,n,a){super(0,t);this.state=r;this.references=n;this.continuousEnvironments=a;this.continuousEnvironment=this.buildEmptyContinuousEnvironment()}continuousEnvironment;beforeAll(){for(let r of Object.values(this.state.passengers))new jm(0,this.subtasks,()=>O$(this.continuousEnvironment.passengers,this.continuousEnvironment.allPassengers,r,this.continuousEnvironment.startTimestamp,this.continuousEnvironment.endTimestamp,this.state.updateIndex,this.references)).addToQueue();for(let r of Object.values(this.state.vehicles))new jm(0,this.subtasks,()=>z$(this.continuousEnvironment.vehicles,this.continuousEnvironment.allVehicles,r,this.continuousEnvironment.startTimestamp,this.continuousEnvironment.endTimestamp,this.state.updateIndex,this.references)).addToQueue();new jm(0,this.subtasks,()=>H$(this.continuousEnvironment.statistics,this.state.statistics,this.continuousEnvironment.startTimestamp,this.continuousEnvironment.endTimestamp,this.state.updateIndex)).addToQueue();let t=new yI(this.state,this.continuousEnvironment,this.references);for(let r of this.state.updates)new jm(-r.updateIndex-1,this.subtasks,()=>{t.visitUpdate(r)}).addToQueue()}afterAll(){this.continuousEnvironments.push(this.continuousEnvironment)}buildEmptyContinuousEnvironment(){let t=this.state.timestamp,r=this.state.updateIndex,n=this.state.updates,a=n[n.length-1],o=a.timestamp,s=a.updateIndex+1,l=this.state.isComplete;return{passengers:{},allPassengers:[],vehicles:{},allVehicles:[],statistics:[],startTimestamp:t,startUpdateIndex:r,endTimestamp:o,endUpdateIndex:s,isComplete:l}}},yI=class{constructor(e,t,r){this.environment=e;this.continuousEnvironment=t;this.references=r}visitUpdate(e){e.apply(this.environment),e.accept(this)}visitPassengerUpdate(e){let t=this.environment.passengers[e.passengerId];O$(this.continuousEnvironment.passengers,this.continuousEnvironment.allPassengers,t,e.timestamp,this.continuousEnvironment.endTimestamp,e.updateIndex,this.references)}visitVehicleUpdate(e){let t=this.environment.vehicles[e.vehicleId];z$(this.continuousEnvironment.vehicles,this.continuousEnvironment.allVehicles,t,e.timestamp,this.continuousEnvironment.endTimestamp,e.updateIndex,this.references)}visitStatisticsUpdate(e){H$(this.continuousEnvironment.statistics,e.statistics,e.timestamp,this.continuousEnvironment.endTimestamp,e.updateIndex)}};function O$(i,e,t,r,n,a,o){let s=i[t.id];s||(s=[],i[t.id]=s,e.push(s));let l=s[s.length-1];l!==void 0&&(l.startTimestamp===r?s.pop():l.endTimestamp=r);let c=at(ye({},t),{startTimestamp:r,endTimestamp:a,updateIndex:n});LRe(c,o),s.push(c)}function z$(i,e,t,r,n,a,o){let s=i[t.id];s||(s=[],i[t.id]=s,e.push(s));let l=s[s.length-1];l!==void 0&&(l.startTimestamp===r?s.pop():l.endTimestamp=r);let c=at(ye({},t),{startTimestamp:r,endTimestamp:n,updateIndex:a});IRe(c,o),s.push(c)}function H$(i,e,t,r,n){let a=i[i.length-1];a!==void 0&&(a.startTimestamp===t?i.pop():a.endTimestamp=t);let o={statistics:e,startTimestamp:t,endTimestamp:r,updateIndex:n};i.push(o)}function lM(i,e){let t=e.tags,r=i.find(n=>bI(n,t));if(!r){let n=[...t];i.push(n),r=n}e.tags=r}function pI(i,e){let t=i.find(n=>FRe(n,e));if(t)return t;let r=ye({},e);return i.push(r),r}function RRe(i,e){let t=e.previousLegs.map(a=>pI(i,a)),r=e.currentLeg?pI(i,e.currentLeg):null,n=e.nextLegs.map(a=>pI(i,a));e.previousLegs=t,e.currentLeg=r,e.nextLegs=n}function fI(i,e){let t=zRe(i,e);if(t!==null)return i[t];let r=ye({},e);return HRe(i,r),r}function DRe(i,e){let t=e.previousStops.map(a=>fI(i,a)),r=e.currentStop?fI(i,e.currentStop):null,n=e.nextStops.map(a=>fI(i,a));e.previousStops=t,e.currentStop=r,e.nextStops=n}function LRe(i,e){lM(e.passengerTags,i);let t=e.passengerLegs[i.id];t||(t=[],e.passengerLegs[i.id]=t),RRe(t,i);let r=td(i);for(let n of r)lM(e.legTags,n)}function IRe(i,e){lM(e.vehicleTags,i);let t=e.vehicleStops[i.id];t||(t=[],e.vehicleStops[i.id]=t),DRe(t,i);let r=Bl(i);for(let n of r)lM(e.stopTags,n)}function bI(i,e){if(i.length!==e.length)return!1;for(let t=0;t<i.length;t++)if(i[t]!==e[t])return!1;return!0}function FRe(i,e){return i.assignedVehicleId===e.assignedVehicleId&&i.boardingStopId===e.boardingStopId&&i.alightingStopId===e.alightingStopId&&i.boardingStopIndex===e.boardingStopIndex&&i.alightingStopIndex===e.alightingStopIndex&&i.boardingTime===e.boardingTime&&i.alightingTime===e.alightingTime&&bI(i.tags,e.tags)}function ORe(i,e){return i.id===e.id&&i.name===e.name&&i.arrivalTime===e.arrivalTime&&i.departureTime===e.departureTime&&i.position.latitude===e.position.latitude&&i.position.longitude===e.position.longitude&&i.capacity===e.capacity&&i.label===e.label&&bI(i.tags,e.tags)}function zRe(i,e){let t=Du(i,n=>n.id.localeCompare(e.id));if(t===null)return null;let r=t;for(;r<i.length&&i[r].id===e.id;){if(ORe(i[r],e))return r;r++}return null}function HRe(i,e){let t=NRe(i,r=>r.id.localeCompare(e.id));i.splice(t,0,e)}function Du(i,e){let t=0,r=i.length-1;for(;t<=r;){let n=Math.floor((t+r)/2),a=e(i[n]);if(a===0){let o=n-1;if(o<0||e(i[o])!==0)return n;r=o}else a<0?t=n+1:r=n-1}return null}function NRe(i,e){let t=0,r=i.length-1;for(;t<=r;){let n=Math.floor((t+r)/2);e(i[n])<0?t=n+1:r=n-1}return t}function N$(i,e){for(let t=0;t<i.length-1;t++){let r=i[t];if(e.includes(r.endUpdateIndex))continue;let n=i[t+1];if(r.endUpdateIndex===n.startUpdateIndex){r.endTimestamp=n.startTimestamp;for(let o=0;o<r.allPassengers.length;o++){let s=r.allPassengers[o],l=s[s.length-1];l&&(l.endTimestamp=n.startTimestamp)}for(let o=0;o<r.allVehicles.length;o++){let s=r.allVehicles[o],l=s[s.length-1];l&&(l.endTimestamp=n.startTimestamp)}let a=r.statistics[r.statistics.length-1];a&&(a.endTimestamp=n.startTimestamp),e.push(r.endUpdateIndex)}}}function cM(i,e){if(e===null||i.length===0)return null;let t=Du(i,r=>r.startTimestamp>e?1:r.endTimestamp<=e?-1:0);return t!==null||(t=Du(i,r=>r.startTimestamp>e?1:r.endTimestamp<e?-1:0),t!==null)?i[t]:null}function uM(i,e){if(e<i.startTimestamp||e>i.endTimestamp)throw console.error(i),new Error(`Timestamp ${e} is out of bounds for the continuous environment with start ${i.startTimestamp} and end ${i.endTimestamp}`);let t=i.startUpdateIndex,r={},n=[];for(let h=0;h<i.allPassengers.length;h++){let d=i.allPassengers[h],p=Du(d,g=>g.startTimestamp>e?1:g.endTimestamp<=e?-1:0);if(p===null&&(p=Du(d,g=>g.startTimestamp>e?1:g.endTimestamp<e?-1:0),p===null))continue;let f=d[p];f.updateIndex>t&&(t=f.updateIndex),r[f.id]=f,n.push(f)}let a={},o=[],s={};for(let h=0;h<i.allVehicles.length;h++){let d=i.allVehicles[h],p=Du(d,_=>_.startTimestamp>e?1:_.endTimestamp<=e?-1:0);if(p===null&&(p=Du(d,_=>_.startTimestamp>e?1:_.endTimestamp<e?-1:0),p===null))continue;let f=d[p];f.updateIndex>t&&(t=f.updateIndex);let g=Bl(f);for(let _=0;_<g.length;_++){let b=g[_];s[b.id]=b}a[f.id]=f,o.push(f)}let l=Du(i.statistics,h=>h.startTimestamp>e?1:h.endTimestamp<=e?-1:0);if(l===null&&(l=Du(i.statistics,h=>h.startTimestamp>e?1:h.endTimestamp<e?-1:0),l===null))throw console.error(i),new Error(`No statistics found for timestamp ${e} in the continuous environment`);let c=i.statistics[l];c.updateIndex>t&&(t=c.updateIndex);let u=c.statistics;return{passengers:r,vehicles:a,stops:s,statistics:u,timestamp:e,updateIndex:t,allVehicles:o,allPassengers:n,allStops:Object.values(s)}}function vI(i){if(i.length===0)return[];let e=null,t=[];for(let r of i){if(e===null){e={start:r.startTimestamp,end:r.endTimestamp};continue}r.startTimestamp===e.end?e.end=r.endTimestamp:(t.push(e),e={start:r.startTimestamp,end:r.endTimestamp})}return e!==null&&t.push(e),t}function G$(i,e,t){if(i.length===0)return!1;let r=vI(i);for(let n of r)if(n.start<=e&&n.end>=t)return!0;return!1}var V$=function(i,e){e===void 0&&(e=5);for(var t=Math.pow(10,e),r=i.length,n=new Array(Math.floor(i.length/2)),a=0,o=0,s=0,l=0;a<r;++l){var c=1,u=0,h=void 0;do h=i.charCodeAt(a++)-63-1,c+=h<<u,u+=5;while(h>=31);o+=c&1?~(c>>1):c>>1,c=1,u=0;do h=i.charCodeAt(a++)-63-1,c+=h<<u,u+=5;while(h>=31);s+=c&1?~(c>>1):c>>1,n[l]=[o/t,s/t]}return n.length=l,n};function K$(i,e){if(!Array.isArray(i)||!i.every(r=>typeof r=="string"))return console.error("Invalid serialized polylines by coordinates",i),null;if(typeof e!="number")return console.error("Invalid polylines version",e),null;let t={};for(let r of i){let n=JSON.parse(r);if(typeof n!="object"||n===null)return console.error("Invalid data type for polyline",n),null;if(!("coordinatesString"in n)||typeof n.coordinatesString!="string")return console.error("Invalid coordinates string in polyline",n),null;let a=n.coordinatesString;if(!("coefficients"in n)||!Array.isArray(n.coefficients)||!n.coefficients.every(c=>typeof c=="number"))return console.error("Invalid coefficients in polyline",n),null;let o=n.coefficients;if(!("encodedPolyline"in n)||typeof n.encodedPolyline!="string")return console.error("Invalid encoded polyline in polyline",n),null;let s=n.encodedPolyline,l=V$(s).map(c=>({latitude:c[0],longitude:c[1]}));if(l.length>1&&o.length!==l.length-1)if(o.length===1&&o[0]===1){let c=[];for(let h=0;h<l.length-1;h++){let d=l[h],p=l[h+1],f=Math.sqrt((p.latitude-d.latitude)**2+(p.longitude-d.longitude)**2);c.push(f)}let u=c.reduce((h,d)=>h+d,0);if(u===0)return console.error("Total distance is zero, cannot calculate coefficients of decoded polyline",l,"in polyline",n),null;o.splice(0,o.length,...c.map(h=>h/u))}else return console.error("Polyline coefficients length mismatch in decoded polyline",l,"in polyline",n),null;t[a]={polyline:l,coefficients:o}}return{version:e,polylinesByCoordinates:t}}function f0(i){if(typeof i!="object"||i===null)return!1;for(let e of Object.values(i))if(typeof e!="string"&&typeof e!="number"&&!f0(e))return!1;return!0}var W$=go(sI());var GRe=["passenger","vehicle","statistics"];function U$(i){return GRe.includes(i)}var rd=class i{constructor(e,t,r,n,a){this.updateType=e;this.updateIndex=t;this.eventIndex=r;this.eventName=n;this.timestamp=a}apply(e){e.updateIndex=this.updateIndex,e.timestamp=this.timestamp}accept(e){}static deserialize(e){return typeof e!="object"||!e?(console.error("Invalid data type for update",e),null):!("updateType"in e)||!U$(e.updateType)?(console.error("Invalid update type in serialized update",e),null):!("updateIndex"in e)||typeof e.updateIndex!="number"?(console.error("Invalid update index in serialized update",e),null):!("eventIndex"in e)||typeof e.eventIndex!="number"?(console.error("Invalid event index in serialized update",e),null):!("eventName"in e)||typeof e.eventName!="string"?(console.error("Invalid event name in serialized update",e),null):!("timestamp"in e)||typeof e.timestamp!="number"?(console.error("Invalid timestamp in serialized update",e),null):new i(e.updateType,e.updateIndex,e.eventIndex,e.eventName,e.timestamp)}},SI=class i extends rd{constructor(t,r,n,a,o,s,l,c,u){super("passenger",t,r,n,a);this.passengerId=o;this.differences=s;this.numberOfLegsToRemove=l;this.legsToAdd=c;this.legsDifferences=u}static DEFAULT_DIFFERENCES={};static DEFAULT_LEGS_TO_ADD=[];static DEFAULT_LEGS_DIFFERENCES=[];static DEFAULT_NUMBER_OF_LEGS_TO_REMOVE=0;apply(t){super.apply(t);let r=this.differences.status,n=this.differences.numberOfPassengers,a=this.differences.tags,o=t.passengers[this.passengerId];if(o===void 0){if(r===void 0){console.error(`Passenger with ID ${this.passengerId} does not exist and no status provided.`);return}if(n===void 0){console.error(`Passenger with ID ${this.passengerId} does not exist and no numberOfPassengers provided.`);return}if(a===void 0){console.error(`Passenger with ID ${this.passengerId} does not exist and no tags provided.`);return}o={id:this.passengerId,entityType:"passenger",name:(0,W$.default)({seed:this.passengerId}),status:r,numberOfPassengers:n,tags:a,previousLegs:[],currentLeg:null,nextLegs:[],error:null}}else o=ye(ye({},o),this.differences);let s=td(o);this.numberOfLegsToRemove>0&&s.splice(s.length-this.numberOfLegsToRemove,this.numberOfLegsToRemove),s.push(...this.legsToAdd);for(let c of this.legsDifferences){let l=c,{index:u}=l,h=oa(l,["index"]);if(u<0||u>=s.length){console.error(`Invalid leg index ${u} for passenger ${this.passengerId}.`,this,t);continue}s[u]=ye(ye({},s[u]),h)}o.previousLegs=[],o.currentLeg=null,o.nextLegs=[];for(let c of s)c.legType==="previous"?o.previousLegs.push(c):c.legType==="current"?o.currentLeg=c:c.legType==="next"&&o.nextLegs.push(c);t.passengers[this.passengerId]=o}accept(t){t.visitPassengerUpdate(this)}static deserialize(t){if(typeof t!="object"||t===null)return console.error("Invalid data type for passenger update",t),null;let r=rd.deserialize(t);if(r===null)return console.error("Invalid base update in serialized passenger update",t),null;if(!("passengerId"in t)||typeof t.passengerId!="string")return console.error("Invalid passenger ID in serialized update",t),null;let n=t.passengerId,a=this.DEFAULT_DIFFERENCES;if("differences"in t){if(!this.isPassengerDifferences(t.differences))return console.error("Invalid differences",t.differences,"in serialized passenger update",t),null;a=t.differences}let o=this.DEFAULT_NUMBER_OF_LEGS_TO_REMOVE;if("numberOfLegsToRemove"in t){if(typeof t.numberOfLegsToRemove!="number")return console.error("Invalid number of legs to remove",t.numberOfLegsToRemove,"in serialized passenger update",t),null;o=t.numberOfLegsToRemove}let s=this.DEFAULT_LEGS_TO_ADD;if("legsToAdd"in t){if(!Array.isArray(t.legsToAdd))return console.error("Invalid legs to add",t.legsToAdd,"in serialized passenger update",t),null;let c=t.legsToAdd.map($g);if(!c.every(u=>u!==null)){let u=c.find(h=>h===null);return console.error("Invalid legs to add, including",u,"in serialized passenger update",t),null}s=c}let l=this.DEFAULT_LEGS_DIFFERENCES;if("legsDifferences"in t){if(!this.isLegDifferencesArray(t.legsDifferences))return console.error("Invalid legs differences",t.legsDifferences,"in serialized passenger update",t),null;l=t.legsDifferences}return new i(r.updateIndex,r.eventIndex,r.eventName,r.timestamp,n,a,o,s,l)}static isPassengerDifferences(t){if(typeof t!="object"||t===null||"status"in t&&!cI(t.status)||"numberOfPassengers"in t&&typeof t.numberOfPassengers!="number")return!1;if("tags"in t){if(!hs(t))return!1;t.tags=t.tags.sort((r,n)=>r.localeCompare(n))}return!0}static isLegDifferencesArray(t){return Array.isArray(t)&&t.every(this.isLegDifferences)}static isLegDifferences(t){if(typeof t!="object"||t===null||"index"in t&&typeof t.index!="number")return!1;if("tags"in t){if(!hs(t))return!1;t.tags=t.tags.sort((r,n)=>r.localeCompare(n))}return!("legType"in t&&!lI(t.legType)||"assignedVehicleId"in t&&t.assignedVehicleId!==null&&typeof t.assignedVehicleId!="string"||"boardingStopId"in t&&t.boardingStopId!==null&&typeof t.boardingStopId!="string"||"alightingStopId"in t&&t.alightingStopId!==null&&typeof t.alightingStopId!="string"||"boardingStopIndex"in t&&t.boardingStopIndex!==null&&typeof t.boardingStopIndex!="number"||"alightingStopIndex"in t&&t.alightingStopIndex!==null&&typeof t.alightingStopIndex!="number"||"boardingTime"in t&&t.boardingTime!==null&&typeof t.boardingTime!="number"||"alightingTime"in t&&t.alightingTime!==null&&typeof t.alightingTime!="number")}},kI=class i extends rd{constructor(t,r,n,a,o,s,l,c,u){super("vehicle",t,r,n,a);this.vehicleId=o;this.differences=s;this.numberOfStopsToRemove=l;this.stopsToAdd=c;this.stopsDifferences=u}static DEFAULT_DIFFERENCES={};static DEFAULT_STOPS_TO_ADD=[];static DEFAULT_STOPS_DIFFERENCES=[];static DEFAULT_NUMBER_OF_STOPS_TO_REMOVE=0;apply(t){super.apply(t);let r=this.differences.name,n=this.differences.mode,a=this.differences.status,o=this.differences.capacity,s=this.differences.tags,l=t.vehicles[this.vehicleId];if(l===void 0){if(r===void 0){console.error(`Vehicle with ID ${this.vehicleId} does not exist and no name provided.`);return}if(n===void 0){console.error(`Vehicle with ID ${this.vehicleId} does not exist and no mode provided.`);return}if(a===void 0){console.error(`Vehicle with ID ${this.vehicleId} does not exist and no status provided.`);return}if(o===void 0){console.error(`Vehicle with ID ${this.vehicleId} does not exist and no capacity provided.`);return}if(s===void 0){console.error(`Vehicle with ID ${this.vehicleId} does not exist and no tags provided.`);return}l={id:this.vehicleId,entityType:"vehicle",name:r,mode:n,status:a,capacity:o,tags:s,previousStops:[],currentStop:null,nextStops:[],error:null}}else l=ye(ye({},l),this.differences);let c=Bl(l);this.numberOfStopsToRemove>0&&c.splice(c.length-this.numberOfStopsToRemove,this.numberOfStopsToRemove),c.push(...this.stopsToAdd);for(let h of this.stopsDifferences){let u=h,{index:d}=u,p=oa(u,["index"]);if(d<0||d>=c.length){console.error(`Invalid stop index ${d} for vehicle ${this.vehicleId}.`,this,t);continue}c[d]=ye(ye({},c[d]),p)}l.previousStops=[],l.currentStop=null,l.nextStops=[];for(let h of c)h.stopType==="previous"?l.previousStops.push(h):h.stopType==="current"?l.currentStop=h:h.stopType==="next"&&l.nextStops.push(h);t.vehicles[this.vehicleId]=l}accept(t){t.visitVehicleUpdate(this)}static deserialize(t){if(typeof t!="object"||t===null)return console.error("Invalid data type for vehicle update",t),null;let r=rd.deserialize(t);if(r===null)return null;if(!("vehicleId"in t)||typeof t.vehicleId!="string")return console.error("Invalid vehicle ID in serialized update",t),null;let n=t.vehicleId,a=this.DEFAULT_DIFFERENCES;if("differences"in t){if(!this.isVehicleDifferences(t.differences))return console.error("Invalid differences",t.differences,"in serialized vehicle update",t),null;a=t.differences}let o=this.DEFAULT_NUMBER_OF_STOPS_TO_REMOVE;if("numberOfStopsToRemove"in t){if(typeof t.numberOfStopsToRemove!="number")return console.error("Invalid number of stops to remove",t.numberOfStopsToRemove,"in serialized vehicle update",t),null;o=t.numberOfStopsToRemove}let s=this.DEFAULT_STOPS_TO_ADD;if("stopsToAdd"in t){if(!Array.isArray(t.stopsToAdd))return console.error("Invalid stops to add",t.stopsToAdd,"in serialized vehicle update",t),null;let c=t.stopsToAdd.map(u=>Qg(u,n));if(!c.every(u=>u!==null)){let u=c.find(h=>h===null);return console.error("Invalid stops to add, including",u,"in serialized vehicle update",t),null}s=c}let l=this.DEFAULT_STOPS_DIFFERENCES;if("stopsDifferences"in t){if(!this.isStopDifferencesArray(t.stopsDifferences))return console.error("Invalid stops differences",t.stopsDifferences,"in serialized vehicle update",t),null;l=t.stopsDifferences}return new i(r.updateIndex,r.eventIndex,r.eventName,r.timestamp,n,a,o,s,l)}static isVehicleDifferences(t){if(typeof t!="object"||t===null||"name"in t&&typeof t.name!="string"||"mode"in t&&typeof t.mode!="string"&&t.mode!==null||"status"in t&&!mI(t.status)||"capacity"in t&&typeof t.capacity!="number")return!1;if("tags"in t){if(!hs(t))return!1;t.tags=t.tags.sort((r,n)=>r.localeCompare(n))}return!0}static isStopDifferencesArray(t){return Array.isArray(t)&&t.every(this.isStopDifferences)}static isStopDifferences(t){if(typeof t!="object"||t===null||"index"in t&&typeof t.index!="number")return!1;if("tags"in t){if(!hs(t))return!1;t.tags=t.tags.sort((r,n)=>r.localeCompare(n))}return!("stopType"in t&&!dI(t.stopType)||"arrivalTime"in t&&typeof t.arrivalTime!="number"||"departureTime"in t&&t.departureTime!==null&&typeof t.departureTime!="number"||"latitude"in t&&typeof t.latitude!="number"||"longitude"in t&&typeof t.longitude!="number"||"capacity"in t&&typeof t.capacity!="number"||"label"in t&&typeof t.label!="string")}},xI=class i extends rd{statistics;constructor(e,t,r,n,a){super("statistics",e,t,r,n),this.statistics=Object.freeze(a)}apply(e){super.apply(e),e.statistics=this.statistics}accept(e){e.visitStatisticsUpdate(this)}static deserialize(e){if(typeof e!="object"||e===null)return console.error("Invalid data type for statistics update",e),null;let t=rd.deserialize(e);if(t===null)return null;if(!("statistics"in e)||!f0(e.statistics))return console.error("Invalid statistics in serialized update",e),null;let r=e.statistics;return new i(t.updateIndex,t.eventIndex,t.eventName,t.timestamp,r)}};function j$(i){if(typeof i!="object"||i===null)return console.error("Invalid data type for update",i),null;if(!("updateType"in i)||!U$(i.updateType))return console.error("Invalid update type in data",i),null;switch(i.updateType){case"passenger":return SI.deserialize(i);case"vehicle":return kI.deserialize(i);case"statistics":return xI.deserialize(i)}}var hM=class extends Pl{constructor(t,r,n,a){super(Ru,t);this.serializedEnvironments=r;this.serializedUpdates=n;this.callback=a}environments=[];updatesByFirstUpdateIndex={};beforeAll(){new wI(this.subtasks,this.serializedEnvironments,this.environments).addToQueue(),new EI(this.subtasks,this.serializedUpdates,this.updatesByFirstUpdateIndex).addToQueue()}afterAll(){let t=[];for(let r of this.environments){let n=this.updatesByFirstUpdateIndex[r.updateIndex];if(n===void 0){console.error("No updates found for environment",r,"in updates",this.updatesByFirstUpdateIndex,"from serialized updates",this.serializedUpdates,"and serialized environments",this.serializedEnvironments),this.callback(null);continue}t.push(at(ye({},r),{updates:n}))}this.callback(t)}},wI=class extends Pl{constructor(t,r,n){super(Ru,t);this.serializedEnvironments=r;this.environments=n}beforeAll(){if(!Array.isArray(this.serializedEnvironments)){console.error("Invalid data type for serialized environments",this.serializedEnvironments);return}for(let t of this.serializedEnvironments)new CI(this.subtasks,t,this.environments).addToQueue()}afterAll(){}},CI=class extends Pl{constructor(t,r,n){super(Ru,t);this.serializedEnvironment=r;this.environments=n}environment={timestamp:-1,updateIndex:-1,statistics:{},passengers:{},vehicles:{},isComplete:!1};beforeAll(){if(typeof this.serializedEnvironment!="object"||this.serializedEnvironment===null){console.error("Invalid data type for serialized environment",this.serializedEnvironment);return}if(!("timestamp"in this.serializedEnvironment)||typeof this.serializedEnvironment.timestamp!="number"){console.error("Invalid timestamp in serialized environment",this.serializedEnvironment);return}if(this.environment.timestamp=this.serializedEnvironment.timestamp,!("updateIndex"in this.serializedEnvironment)||typeof this.serializedEnvironment.updateIndex!="number"){console.error("Invalid update index in serialized environment",this.serializedEnvironment);return}if(this.environment.updateIndex=this.serializedEnvironment.updateIndex,!("isComplete"in this.serializedEnvironment)||typeof this.serializedEnvironment.isComplete!="boolean"){console.error("Invalid isComplete in serialized environment",this.serializedEnvironment);return}if(this.environment.isComplete=this.serializedEnvironment.isComplete,!("statistics"in this.serializedEnvironment)||typeof this.serializedEnvironment.statistics!="string"){console.error("Invalid statistics in serialized environment",this.serializedEnvironment);return}let t=JSON.parse(this.serializedEnvironment.statistics);if(!f0(t)){console.error("Invalid statistics object in serialized environment",this.serializedEnvironment);return}if(this.environment.statistics=t,!("passengers"in this.serializedEnvironment)||!Array.isArray(this.serializedEnvironment.passengers)){console.error("Invalid passengers in serialized environment",this.serializedEnvironment);return}for(let r of this.serializedEnvironment.passengers)new MI(this.subtasks,r,this.environment.passengers).addToQueue();if(!("vehicles"in this.serializedEnvironment)||!Array.isArray(this.serializedEnvironment.vehicles)){console.error("Invalid vehicles in serialized environment",this.serializedEnvironment);return}for(let r of this.serializedEnvironment.vehicles)new TI(this.subtasks,r,this.environment.vehicles).addToQueue()}afterAll(){this.environments.push(this.environment)}},MI=class extends id{constructor(t,r,n){super(Ru,t);this.serializedPassenger=r;this.passengers=n}process(){if(typeof this.serializedPassenger!="string"){console.error("Invalid data type for serialized passenger",this.serializedPassenger);return}let t=JSON.parse(this.serializedPassenger),r=P$(t);if(r===null){console.error("Invalid passenger",this.serializedPassenger);return}this.passengers[r.id]=r}},TI=class extends id{constructor(t,r,n){super(Ru,t);this.serializedVehicle=r;this.vehicles=n}process(){if(typeof this.serializedVehicle!="string"){console.error("Invalid data type for serialized vehicle",this.serializedVehicle);return}let t=JSON.parse(this.serializedVehicle),r=F$(t);if(r===null){console.error("Invalid vehicle",this.serializedVehicle);return}this.vehicles[r.id]=r}},EI=class extends Pl{constructor(t,r,n){super(Ru,t);this.serializedUpdates=r;this.updatesByFirstUpdateIndex=n}beforeAll(){if(typeof this.serializedUpdates!="object"||this.serializedUpdates===null){console.error("Invalid data type for serialized updates",this.serializedUpdates);return}for(let[t,r]of Object.entries(this.serializedUpdates))new AI(this.subtasks,t,r,this.updatesByFirstUpdateIndex).addToQueue()}afterAll(){}},AI=class extends Pl{constructor(t,r,n,a){super(Ru,t);this.serializedUpdatesKey=r;this.serializedUpdates=n;this.updatesByFirstUpdateIndex=a}updates=new Xg((t,r)=>t.updateIndex-r.updateIndex);beforeAll(){if(typeof this.serializedUpdatesKey!="string"){console.error("Invalid data type for key",this.serializedUpdatesKey,"with serialized updates",this.serializedUpdates);return}let t=parseInt(this.serializedUpdatesKey);if(isNaN(t)){console.error("Key is not a valid number",this.serializedUpdatesKey,"with serialized updates",this.serializedUpdates);return}if(!Array.isArray(this.serializedUpdates)){console.error("Invalid data type for serialized updates",this.serializedUpdates,"with key",this.serializedUpdatesKey);return}this.updatesByFirstUpdateIndex[t]=this.updates.editableItems;for(let r of this.serializedUpdates)new PI(this.subtasks,r,this.updates).addToQueue()}afterAll(){}},PI=class extends id{constructor(t,r,n){super(Ru,t);this.serializedUpdate=r;this.updates=n}process(){if(typeof this.serializedUpdate!="string"){console.error("Invalid data type for serialized update",this.serializedUpdate);return}let t=j$(JSON.parse(this.serializedUpdate));if(t===null){console.error("Invalid update",this.serializedUpdate);return}this.updates.add(t)}};var nd=class i{queue=uI();processTasks(e){for(this.processTask();this.queue.length>0&&performance.now()<e;)this.processTask()}processTask(){let e=this.queue.shift();e&&e.process()}extractStateTask(e,t,r){new hM(this.queue,e,t,r).addToQueue()}buildContinuousEnvironmentsTask(e,t,r){new sM(this.queue,e,t,r).addToQueue()}get numberOfTasks(){return this.queue.items.reduce((e,t)=>e+t.numberOfTasks,0)}static \u0275fac=function(t){return new(t||i)};static \u0275prov=lt({token:i,factory:i.\u0275fac,providedIn:"root"})};var Ha=class i{constructor(e,t,r){this.dataService=e;this.communicationService=t;this.taskService=r}_activeSimulationIdSignal=Bt(null);_simulationPolylinesSignal=Bt(null);_isFetchingStatesSignal=Bt(!1);_isFetchingPolylinesSignal=Bt(!1);_continuousEnvironmentsSignal=Bt([]);alreadyUpdatedEnvironmentUpdateIndexes=[];references=_I();_hasAllStatesSignal=Bt(!1);getPolylinesDebounceSettings={debounceTime:500,lastExecutionTime:null,timeoutId:null};getMissingSimulationStatesDebounceSettings={debounceTime:500,lastExecutionTime:null,timeoutId:null};setActiveSimulationId(e){this.unsetActiveSimulationId(),this._activeSimulationIdSignal.set(e),this.communicationService.on("missing-simulation-states",(t,r,n)=>{this.onMissingSimulationStates(t,r,n)}),this.communicationService.on(`polylines-${e}`,(t,r)=>{this._isFetchingPolylinesSignal.set(!1),this._simulationPolylinesSignal.set(K$(t,r))})}unsetActiveSimulationId(){let e=this._activeSimulationIdSignal();this._activeSimulationIdSignal.set(null),this._simulationPolylinesSignal.set(null),this._isFetchingStatesSignal.set(!1),this._isFetchingPolylinesSignal.set(!1),this.communicationService.removeAllListeners("missing-simulation-states"),e&&this.communicationService.removeAllListeners(`polylines-${e}`),this._continuousEnvironmentsSignal.set([]),this.alreadyUpdatedEnvironmentUpdateIndexes=[],this.references=_I(),this._hasAllStatesSignal.set(!1)}get activeSimulationSignal(){return $t(()=>{let e=this._activeSimulationIdSignal();return e?this.dataService.simulationsSignal().find(n=>n.id===e)??null:null})}pauseSimulation(e){this.communicationService.emit("pause-simulation",e)}resumeSimulation(e){this.communicationService.emit("resume-simulation",e)}stopSimulation(e){this.communicationService.emit("stop-simulation",e)}editSimulationConfiguration(e,t){this.communicationService.emit("edit-simulation-configuration",e,t)}getMissingSimulationStates(e,t,r){return this.runWithDebounce(()=>{this.getMissingSimulationStatesWithDebounce(e,t,r)},this.getMissingSimulationStatesDebounceSettings)}getMissingSimulationStatesWithDebounce(e,t,r){this._isFetchingStatesSignal.set(!0),this.communicationService.emit("get-missing-simulation-states",e,t,r)}getPolylines(e){this.runWithDebounce(()=>{this.getPolylinesWithoutDebounce(e)},this.getPolylinesDebounceSettings)}getPolylinesWithoutDebounce(e){this._isFetchingPolylinesSignal.set(!0),this.communicationService.emit("get-polylines",e)}get simulationPolylinesSignal(){return this._simulationPolylinesSignal}get isFetchingStatesSignal(){return this._isFetchingStatesSignal}get isFetchingPolylinesSignal(){return this._isFetchingPolylinesSignal}get continuousEnvironmentsSignal(){return this._continuousEnvironmentsSignal}get hasAllStatesSignal(){return this._hasAllStatesSignal}onMissingSimulationStates(e,t,r){this.taskService.extractStateTask(e,t,n=>this.afterExtractStateTask(n,r))}afterExtractStateTask(e,t){if(e===null){console.error("Failed to extract missing simulation states from the server response."),this._isFetchingStatesSignal.set(!1);return}this.taskService.buildContinuousEnvironmentsTask(e,this.references,r=>this.afterBuildContinuousEnvironmentsTask(r,t))}afterBuildContinuousEnvironmentsTask(e,t){this._continuousEnvironmentsSignal.update(r=>{let n=[...r];for(let a of e){let o=n.findIndex(s=>s.startUpdateIndex===a.startUpdateIndex);o===-1?n.push(a):n[o]=a}return n.sort((a,o)=>a.startUpdateIndex-o.startUpdateIndex),N$(n,this.alreadyUpdatedEnvironmentUpdateIndexes),n}),typeof t!="boolean"?(console.error("Received invalid hasAllStates value from the server."),t=!1):this._hasAllStatesSignal.set(t),this._isFetchingStatesSignal.set(!1)}runWithDebounce(e,t){t.timeoutId!==null&&(clearTimeout(t.timeoutId),t.timeoutId=null);let r=Date.now(),n=r-(t.lastExecutionTime??0);if(n<t.debounceTime){t.timeoutId=setTimeout(()=>{t.timeoutId=null,t.lastExecutionTime=Date.now(),e()},t.debounceTime-n);return}t.lastExecutionTime=r,e()}static \u0275fac=function(t){return new(t||i)(Zt(Qh),Zt(To),Zt(nd))};static \u0275prov=lt({token:i,factory:i.\u0275fac,providedIn:"root"})};function VRe(i,e){if(i&1){let t=vt();Z(0,"div",1)(1,"button",2),Le("click",function(){Ee(t);let n=Se();return Ae(n.action())}),ce(2),Q()()}if(i&2){let t=Se();oe(2),_t(" ",t.data.action," ")}}var KRe=["label"];function WRe(i,e){}var URe=Math.pow(2,31)-1,y0=class{_overlayRef;instance;containerInstance;_afterDismissed=new ct;_afterOpened=new ct;_onAction=new ct;_durationTimeoutId;_dismissedByAction=!1;constructor(e,t){this._overlayRef=t,this.containerInstance=e,e._onExit.subscribe(()=>this._finishDismiss())}dismiss(){this._afterDismissed.closed||this.containerInstance.exit(),clearTimeout(this._durationTimeoutId)}dismissWithAction(){this._onAction.closed||(this._dismissedByAction=!0,this._onAction.next(),this._onAction.complete(),this.dismiss()),clearTimeout(this._durationTimeoutId)}closeWithAction(){this.dismissWithAction()}_dismissAfter(e){this._durationTimeoutId=setTimeout(()=>this.dismiss(),Math.min(e,URe))}_open(){this._afterOpened.closed||(this._afterOpened.next(),this._afterOpened.complete())}_finishDismiss(){this._overlayRef.dispose(),this._onAction.closed||this._onAction.complete(),this._afterDismissed.next({dismissedByAction:this._dismissedByAction}),this._afterDismissed.complete(),this._dismissedByAction=!1}afterDismissed(){return this._afterDismissed}afterOpened(){return this.containerInstance._onEnter}onAction(){return this._onAction}},q$=new et("MatSnackBarData"),ey=class{politeness="assertive";announcementMessage="";viewContainerRef;duration=0;panelClass;direction;data=null;horizontalPosition="center";verticalPosition="bottom"},jRe=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275dir=ft({type:i,selectors:[["","matSnackBarLabel",""]],hostAttrs:[1,"mat-mdc-snack-bar-label","mdc-snackbar__label"]})}return i})(),qRe=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275dir=ft({type:i,selectors:[["","matSnackBarActions",""]],hostAttrs:[1,"mat-mdc-snack-bar-actions","mdc-snackbar__actions"]})}return i})(),ZRe=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275dir=ft({type:i,selectors:[["","matSnackBarAction",""]],hostAttrs:[1,"mat-mdc-snack-bar-action","mdc-snackbar__action"]})}return i})(),YRe=(()=>{class i{snackBarRef=te(y0);data=te(q$);constructor(){}action(){this.snackBarRef.dismissWithAction()}get hasAction(){return!!this.data.action}static \u0275fac=function(r){return new(r||i)};static \u0275cmp=tt({type:i,selectors:[["simple-snack-bar"]],hostAttrs:[1,"mat-mdc-simple-snack-bar"],exportAs:["matSnackBar"],decls:3,vars:2,consts:[["matSnackBarLabel",""],["matSnackBarActions",""],["mat-button","","matSnackBarAction","",3,"click"]],template:function(r,n){r&1&&(Z(0,"div",0),ce(1),Q(),je(2,VRe,3,1,"div",1)),r&2&&(oe(),_t(" ",n.data.message,`
|
1698
|
+
`),oe(),Je(n.hasAction?2:-1))},dependencies:[pn,jRe,qRe,ZRe],styles:[".mat-mdc-simple-snack-bar{display:flex}"],encapsulation:2,changeDetection:0})}return i})(),JRe={snackBarState:Cs("state",[Ms("void, hidden",mn({transform:"scale(0.8)",opacity:0})),Ms("visible",mn({transform:"scale(1)",opacity:1})),Ba("* => visible",Pa("150ms cubic-bezier(0, 0, 0.2, 1)")),Ba("* => void, * => hidden",Pa("75ms cubic-bezier(0.4, 0.0, 1, 1)",mn({opacity:0})))])},$Re=(()=>{class i extends Mh{_ngZone=te(Kt);_elementRef=te(Et);_changeDetectorRef=te(_i);_platform=te($i);snackBarConfig=te(ey);_document=te(li);_trackedModals=new Set;_announceDelay=150;_announceTimeoutId;_destroyed=!1;_portalOutlet;_onAnnounce=new ct;_onExit=new ct;_onEnter=new ct;_animationState="void";_live;_label;_role;_liveElementId=te(Di).getId("mat-snack-bar-container-live-");constructor(){super();let t=this.snackBarConfig;t.politeness==="assertive"&&!t.announcementMessage?this._live="assertive":t.politeness==="off"?this._live="off":this._live="polite",this._platform.FIREFOX&&(this._live==="polite"&&(this._role="status"),this._live==="assertive"&&(this._role="alert"))}attachComponentPortal(t){this._assertNotAttached();let r=this._portalOutlet.attachComponentPortal(t);return this._afterPortalAttached(),r}attachTemplatePortal(t){this._assertNotAttached();let r=this._portalOutlet.attachTemplatePortal(t);return this._afterPortalAttached(),r}attachDomPortal=t=>{this._assertNotAttached();let r=this._portalOutlet.attachDomPortal(t);return this._afterPortalAttached(),r};onAnimationEnd(t){let{fromState:r,toState:n}=t;if((n==="void"&&r!=="void"||n==="hidden")&&this._completeExit(),n==="visible"){let a=this._onEnter;this._ngZone.run(()=>{a.next(),a.complete()})}}enter(){this._destroyed||(this._animationState="visible",this._changeDetectorRef.markForCheck(),this._changeDetectorRef.detectChanges(),this._screenReaderAnnounce())}exit(){return this._ngZone.run(()=>{this._animationState="hidden",this._changeDetectorRef.markForCheck(),this._elementRef.nativeElement.setAttribute("mat-exit",""),clearTimeout(this._announceTimeoutId)}),this._onExit}ngOnDestroy(){this._destroyed=!0,this._clearFromModals(),this._completeExit()}_completeExit(){queueMicrotask(()=>{this._onExit.next(),this._onExit.complete()})}_afterPortalAttached(){let t=this._elementRef.nativeElement,r=this.snackBarConfig.panelClass;r&&(Array.isArray(r)?r.forEach(o=>t.classList.add(o)):t.classList.add(r)),this._exposeToModals();let n=this._label.nativeElement,a="mdc-snackbar__label";n.classList.toggle(a,!n.querySelector(`.${a}`))}_exposeToModals(){let t=this._liveElementId,r=this._document.querySelectorAll('body > .cdk-overlay-container [aria-modal="true"]');for(let n=0;n<r.length;n++){let a=r[n],o=a.getAttribute("aria-owns");this._trackedModals.add(a),o?o.indexOf(t)===-1&&a.setAttribute("aria-owns",o+" "+t):a.setAttribute("aria-owns",t)}}_clearFromModals(){this._trackedModals.forEach(t=>{let r=t.getAttribute("aria-owns");if(r){let n=r.replace(this._liveElementId,"").trim();n.length>0?t.setAttribute("aria-owns",n):t.removeAttribute("aria-owns")}}),this._trackedModals.clear()}_assertNotAttached(){this._portalOutlet.hasAttached()}_screenReaderAnnounce(){this._announceTimeoutId||this._ngZone.runOutsideAngular(()=>{this._announceTimeoutId=setTimeout(()=>{let t=this._elementRef.nativeElement.querySelector("[aria-hidden]"),r=this._elementRef.nativeElement.querySelector("[aria-live]");if(t&&r){let n=null;this._platform.isBrowser&&document.activeElement instanceof HTMLElement&&t.contains(document.activeElement)&&(n=document.activeElement),t.removeAttribute("aria-hidden"),r.appendChild(t),n?.focus(),this._onAnnounce.next(),this._onAnnounce.complete()}},this._announceDelay)})}static \u0275fac=function(r){return new(r||i)};static \u0275cmp=tt({type:i,selectors:[["mat-snack-bar-container"]],viewQuery:function(r,n){if(r&1&&(di(rc,7),di(KRe,7)),r&2){let a;St(a=kt())&&(n._portalOutlet=a.first),St(a=kt())&&(n._label=a.first)}},hostAttrs:[1,"mdc-snackbar","mat-mdc-snack-bar-container"],hostVars:1,hostBindings:function(r,n){r&1&&Z4("@state.done",function(o){return n.onAnimationEnd(o)}),r&2&&q4("@state",n._animationState)},features:[Ai],decls:6,vars:3,consts:[["label",""],[1,"mdc-snackbar__surface","mat-mdc-snackbar-surface"],[1,"mat-mdc-snack-bar-label"],["aria-hidden","true"],["cdkPortalOutlet",""]],template:function(r,n){r&1&&(Z(0,"div",1)(1,"div",2,0)(3,"div",3),je(4,WRe,0,0,"ng-template",4),Q(),Ge(5,"div"),Q()()),r&2&&(oe(5),Mt("aria-live",n._live)("role",n._role)("id",n._liveElementId))},dependencies:[rc],styles:[".mat-mdc-snack-bar-container{display:flex;align-items:center;justify-content:center;box-sizing:border-box;-webkit-tap-highlight-color:rgba(0,0,0,0);margin:8px}.mat-mdc-snack-bar-handset .mat-mdc-snack-bar-container{width:100vw}.mat-mdc-snackbar-surface{box-shadow:0px 3px 5px -1px rgba(0, 0, 0, 0.2), 0px 6px 10px 0px rgba(0, 0, 0, 0.14), 0px 1px 18px 0px rgba(0, 0, 0, 0.12);display:flex;align-items:center;justify-content:flex-start;box-sizing:border-box;padding-left:0;padding-right:8px}[dir=rtl] .mat-mdc-snackbar-surface{padding-right:0;padding-left:8px}.mat-mdc-snack-bar-container .mat-mdc-snackbar-surface{min-width:344px;max-width:672px}.mat-mdc-snack-bar-handset .mat-mdc-snackbar-surface{width:100%;min-width:0}@media(forced-colors: active){.mat-mdc-snackbar-surface{outline:solid 1px}}.mat-mdc-snack-bar-container .mat-mdc-snackbar-surface{color:var(--mdc-snackbar-supporting-text-color, var(--mat-sys-inverse-on-surface));border-radius:var(--mdc-snackbar-container-shape, var(--mat-sys-corner-extra-small));background-color:var(--mdc-snackbar-container-color, var(--mat-sys-inverse-surface))}.mdc-snackbar__label{width:100%;flex-grow:1;box-sizing:border-box;margin:0;padding:14px 8px 14px 16px}[dir=rtl] .mdc-snackbar__label{padding-left:8px;padding-right:16px}.mat-mdc-snack-bar-container .mdc-snackbar__label{font-family:var(--mdc-snackbar-supporting-text-font, var(--mat-sys-body-medium-font));font-size:var(--mdc-snackbar-supporting-text-size, var(--mat-sys-body-medium-size));font-weight:var(--mdc-snackbar-supporting-text-weight, var(--mat-sys-body-medium-weight));line-height:var(--mdc-snackbar-supporting-text-line-height, var(--mat-sys-body-medium-line-height))}.mat-mdc-snack-bar-actions{display:flex;flex-shrink:0;align-items:center;box-sizing:border-box}.mat-mdc-snack-bar-handset,.mat-mdc-snack-bar-container,.mat-mdc-snack-bar-label{flex:1 1 auto}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled).mat-unthemed{color:var(--mat-snack-bar-button-color, var(--mat-sys-inverse-primary))}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled){--mat-text-button-state-layer-color:currentColor;--mat-text-button-ripple-color:currentColor}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled) .mat-ripple-element{opacity:.1}"],encapsulation:2,data:{animation:[JRe.snackBarState]}})}return i})();function XRe(){return new ey}var QRe=new et("mat-snack-bar-default-options",{providedIn:"root",factory:XRe}),dM=(()=>{class i{_overlay=te(Rr);_live=te(iw);_injector=te(Ii);_breakpointObserver=te(df);_parentSnackBar=te(i,{optional:!0,skipSelf:!0});_defaultConfig=te(QRe);_snackBarRefAtThisLevel=null;simpleSnackBarComponent=YRe;snackBarContainerComponent=$Re;handsetCssClass="mat-mdc-snack-bar-handset";get _openedSnackBarRef(){let t=this._parentSnackBar;return t?t._openedSnackBarRef:this._snackBarRefAtThisLevel}set _openedSnackBarRef(t){this._parentSnackBar?this._parentSnackBar._openedSnackBarRef=t:this._snackBarRefAtThisLevel=t}constructor(){}openFromComponent(t,r){return this._attach(t,r)}openFromTemplate(t,r){return this._attach(t,r)}open(t,r="",n){let a=ye(ye({},this._defaultConfig),n);return a.data={message:t,action:r},a.announcementMessage===t&&(a.announcementMessage=void 0),this.openFromComponent(this.simpleSnackBarComponent,a)}dismiss(){this._openedSnackBarRef&&this._openedSnackBarRef.dismiss()}ngOnDestroy(){this._snackBarRefAtThisLevel&&this._snackBarRefAtThisLevel.dismiss()}_attachSnackBarContainer(t,r){let n=r&&r.viewContainerRef&&r.viewContainerRef.injector,a=Ii.create({parent:n||this._injector,providers:[{provide:ey,useValue:r}]}),o=new fl(this.snackBarContainerComponent,r.viewContainerRef,a),s=t.attach(o);return s.instance.snackBarConfig=r,s.instance}_attach(t,r){let n=ye(ye(ye({},new ey),this._defaultConfig),r),a=this._createOverlay(n),o=this._attachSnackBarContainer(a,n),s=new y0(o,a);if(t instanceof Ta){let l=new Xa(t,null,{$implicit:n.data,snackBarRef:s});s.instance=o.attachTemplatePortal(l)}else{let l=this._createInjector(n,s),c=new fl(t,void 0,l),u=o.attachComponentPortal(c);s.instance=u.instance}return this._breakpointObserver.observe(Jx.HandsetPortrait).pipe(gi(a.detachments())).subscribe(l=>{a.overlayElement.classList.toggle(this.handsetCssClass,l.matches)}),n.announcementMessage&&o._onAnnounce.subscribe(()=>{this._live.announce(n.announcementMessage,n.politeness)}),this._animateSnackBar(s,n),this._openedSnackBarRef=s,this._openedSnackBarRef}_animateSnackBar(t,r){t.afterDismissed().subscribe(()=>{this._openedSnackBarRef==t&&(this._openedSnackBarRef=null),r.announcementMessage&&this._live.clear()}),this._openedSnackBarRef?(this._openedSnackBarRef.afterDismissed().subscribe(()=>{t.containerInstance.enter()}),this._openedSnackBarRef.dismiss()):t.containerInstance.enter(),r.duration&&r.duration>0&&t.afterOpened().subscribe(()=>t._dismissAfter(r.duration))}_createOverlay(t){let r=new Ds;r.direction=t.direction;let n=this._overlay.position().global(),a=t.direction==="rtl",o=t.horizontalPosition==="left"||t.horizontalPosition==="start"&&!a||t.horizontalPosition==="end"&&a,s=!o&&t.horizontalPosition!=="center";return o?n.left("0"):s?n.right("0"):n.centerHorizontally(),t.verticalPosition==="top"?n.top("0"):n.bottom("0"),r.positionStrategy=n,this._overlay.create(r)}_createInjector(t,r){let n=t&&t.viewContainerRef&&t.viewContainerRef.injector;return Ii.create({parent:n||this._injector,providers:[{provide:y0,useValue:r},{provide:q$,useValue:t.data}]})}static \u0275fac=function(r){return new(r||i)};static \u0275prov=lt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var eDe=(i,e)=>e.group,tDe=(i,e)=>e.id;function iDe(i,e){if(i&1&&(Z(0,"span",12),ce(1),Vr(2,"percent"),Q()),i&2){let t=Se().$implicit;oe(),_t(" ",zd(2,1,t.completion,"1.2-2")," ")}}function rDe(i,e){if(i&1){let t=vt();Ri(0),Z(1,"button",16),Le("click",function(n){Ee(t);let a=Se().$implicit,o=Se(3);return Ae(o.editSimulationConfiguration(a,n))}),Z(2,"mat-icon"),ce(3,"settings"),Q()(),Ri(4)(5),Z(6,"button",16),Le("click",function(n){Ee(t);let a=fi(5),o=Se().$implicit,s=Se(3);return Ae(s.pauseResumeHandler(o.id,a,n))}),Z(7,"mat-icon"),ce(8),Q()(),Ri(9),Z(10,"button",16),Le("click",function(n){Ee(t);let a=Se().$implicit,o=Se(3);return Ae(o.stopSimulation(a.id,n))}),Z(11,"mat-icon"),ce(12,"stop"),Q()()}if(i&2){let t=Se().$implicit,r=t.status==="starting"||t.status==="stopping"||t.status==="lost";oe(),Re("disabled",r)("matTooltip","Configure");let n=t.status==="starting"||t.status==="stopping"||t.status==="lost";oe(4);let a=hr(t.status!=="paused");oe(),Re("disabled",n)("matTooltip",a?"Pause":"Resume"),oe(2),Ti(a?"pause":"play_arrow");let o=t.status==="starting"||t.status==="stopping"||t.status==="lost";oe(2),Re("disabled",o)("matTooltip","Stop")}}function nDe(i,e){if(i&1){let t=vt();Z(0,"button",26),Le("click",function(n){Ee(t);let a=Se().$implicit,o=Se(3);return Ae(o.exportSimulation(a.id,n))}),Z(1,"mat-icon"),ce(2,"cloud_download"),Q()(),Z(3,"button",26),Le("click",function(n){Ee(t);let a=Se().$implicit,o=Se(3);return Ae(o.deleteSimulation(a.id,a.name,n))}),Z(4,"mat-icon"),ce(5,"delete"),Q()()}i&2&&(Re("matTooltip","Export"),oe(3),Re("matTooltip","Delete"))}function aDe(i,e){if(i&1&&(Z(0,"span",27)(1,"span",19),ce(2,"Simulation Time:"),Q(),Z(3,"span",5),ce(4),Vr(5,"simulationTime"),Q()(),Z(6,"span",28)(7,"span",19),ce(8,"Simulation Estimated End Time:"),Q(),Z(9,"span",5),ce(10),Vr(11,"simulationTime"),Q()(),Z(12,"span",14)(13,"span",19),ce(14,"Completion:"),Q(),Z(15,"span",5),ce(16),Vr(17,"percent"),Q()(),Z(18,"span",29)(19,"span",19),ce(20,"Max Duration:"),Q(),Z(21,"span",5),ce(22),Q()()),i&2){let t=Se().$implicit;oe(4),_t(" ",t.simulationTime!==null?En(5,4,t.simulationTime):"N/A"," "),oe(6),_t(" ",t.simulationEstimatedEndTime!==null?En(11,6,t.simulationEstimatedEndTime):"N/A"," "),oe(6),_t(" ",zd(17,8,t.completion,"1.2-2")," "),oe(6),_t(" ",t.configuration.maxDuration!==null?(t.configuration.maxDuration/3600).toString()+"h":"N/A"," ")}}function oDe(i,e){if(i&1){let t=vt();Ri(0),Z(1,"div",7),Le("click",function(){let n=Ee(t).$implicit,a=Se(3);return Ae(a.toggleSelection(n.id))})("keydown.enter",function(){let n=Ee(t).$implicit,a=Se(3);return Ae(a.toggleSelection(n.id))}),Z(2,"div",8)(3,"mat-icon",9),ce(4,"circle "),Q(),Z(5,"div",10)(6,"div",1)(7,"span",11),ce(8),Q(),je(9,iDe,3,4,"span",12),Q(),Z(10,"div",13)(11,"span"),ce(12),Q(),Z(13,"div",14)(14,"span"),ce(15,"-"),Q(),Ri(16),Z(17,"span"),ce(18),Vr(19,"simulationTime"),Q(),Z(20,"span"),ce(21,"-"),Q(),Z(22,"span"),ce(23),Q(),Z(24,"span"),ce(25,"-"),Q(),Z(26,"span"),ce(27),Q(),Z(28,"span"),ce(29,"-"),Q(),Z(30,"span"),ce(31),Vr(32,"date"),Q()()()(),Z(33,"div",15),je(34,rDe,13,8)(35,nDe,6,2),Ri(36),Z(37,"button",16),Le("click",function(n){let a=Ee(t).$implicit,o=Se(3);return Ae(o.visualizeSimulation(a,n))}),Z(38,"mat-icon"),ce(39,"visibility"),Q()()()(),Z(40,"div",17)(41,"div",18)(42,"span",14)(43,"span",19),ce(44,"Id:"),Q(),Z(45,"span",20),Le("click",function(n){let a=Ee(t).$implicit,o=Se(3);return Ae(o.copyToClipboard(a.id,n))})("keydown.enter",function(n){let a=Ee(t).$implicit,o=Se(3);return Ae(o.copyToClipboard(a.id,n))}),ce(46),Q()(),Z(47,"span",21)(48,"span",19),ce(49,"Name:"),Q(),Z(50,"span",5),ce(51),Q()(),Z(52,"span",21)(53,"span",19),ce(54,"Input Data:"),Q(),Z(55,"span",5),ce(56),Q()(),Z(57,"span",14)(58,"span",19),ce(59,"Status:"),Q(),Z(60,"span",5),ce(61),Q()(),Z(62,"span",22)(63,"span",19),ce(64,"Start Time:"),Q(),Z(65,"span",5),ce(66),Vr(67,"date"),Q()(),Z(68,"span",23)(69,"span",19),ce(70,"Duration:"),Q(),Z(71,"span",5),ce(72),Vr(73,"simulationTime"),Q()(),Z(74,"span",14)(75,"span",19),ce(76,"Size:"),Q(),Z(77,"span",5),ce(78),Q()(),Z(79,"span",24)(80,"span",19),ce(81,"Simulation Start Time :"),Q(),Z(82,"span",5),ce(83),Vr(84,"simulationTime"),Q()(),Z(85,"span",25)(86,"span",19),ce(87,"Simulation End Time :"),Q(),Z(88,"span",5),ce(89),Vr(90,"simulationTime"),Q()()(),Z(91,"div",18),je(92,aDe,23,11),Q()()()}if(i&2){let t=e.$implicit,r=Se(2).$implicit,n=Se(),a=n.selectedSimulationIdSignal()===t.id;oe(),gt("selected",a),oe(2),yr("color","var(--"+n.getColorFromStatus(t.status)+"-text-color)"),oe(4),Re("matTooltip",t.name),oe(),Ti(t.name),oe(),Je(t.status==="running"||t.status==="paused"?9:-1),oe(2),yr("color","var(--"+n.getColorFromStatus(t.status)+"-text-color)"),oe(),_t(" ",t.status," ");let o=n.getDuration(t);oe(6),Ti(En(19,34,o)),oe(5),_t(" ",t.data," "),oe(4),_t(" ",n.megabytes(t.size)," "),oe(4),_t(" ",zd(32,36,t.startTime,"short")," "),oe(3),Je(r.group==="running"?34:-1),oe(),Je(r.group==="completed"?35:-1);let s=t.status==="corrupted"||t.status==="outdated"||t.status==="future";oe(2),Re("disabled",s)("matTooltip","Visualize"),oe(8),Re("matTooltip",t.id+" (Click to copy)")("matTooltipPosition","after"),oe(),Ti(t.id),oe(),Re("matTooltip",t.name),oe(4),Ti(t.name),oe(),Re("matTooltip",t.data),oe(4),Ti(t.data),oe(4),yr("color","var(--"+n.getColorFromStatus(t.status)+"-text-color)"),oe(),_t(" ",t.status," "),oe(5),_t(" ",zd(67,39,t.startTime,"short")," "),oe(6),Ti(En(73,42,n.getDuration(t))),oe(6),Ti(n.megabytes(t.size)),oe(5),_t(" ",t.simulationStartTime!==null?En(84,44,t.simulationStartTime):"N/A"," "),oe(6),_t(" ",t.simulationEndTime!==null?En(90,46,t.simulationEndTime):"N/A"," "),oe(3),Je(n.isSimulationRunning(t)?92:-1)}}function sDe(i,e){if(i&1&&(Z(0,"section",4),ui(1,oDe,93,48,"div",6,tDe),Q()),i&2){let t=Se().$implicit;oe(),hi(t.simulations)}}function lDe(i,e){i&1&&(Z(0,"span",5),ce(1,"No simulations"),Q())}function cDe(i,e){if(i&1&&(Z(0,"h3"),ce(1),Vr(2,"titlecase"),Q(),je(3,sDe,3,0,"section",4)(4,lDe,2,0,"span",5)),i&2){let t=e.$implicit;oe(),Ti(En(2,2,t.group)),oe(2),Je(t.simulations.length>0?3:4)}}var mM=class i{constructor(e,t,r,n,a,o,s){this.dataService=e;this.simulationService=t;this.dialogService=r;this.matDialogRef=n;this.httpService=a;this.communicationService=o;this.snackBar=s}groupedSimulationsSignal=$t(()=>{let e=this.simulationsSignal(),t=e.filter(n=>Bu.includes(n.status)),r=e.filter(n=>!Bu.includes(n.status));return[{group:"running",simulations:t},{group:"completed",simulations:r}]});_selectedSimulationIdSignal=Bt(null);get selectedSimulationIdSignal(){return this._selectedSimulationIdSignal}getColorFromStatus(e){switch(e){case"running":return"green";case"paused":return"yellow";case"starting":case"stopping":case"outdated":case"future":return"gray";case"completed":return"blue";case"lost":case"corrupted":return"red"}}editSimulationConfiguration(e,t){return Ce(this,null,function*(){t.stopPropagation();let r=yield hn(this.dialogService.openSimulationConfigurationDialog({mode:"edit",currentConfiguration:e.configuration}).afterClosed());r&&this.simulationService.editSimulationConfiguration(e.id,r.configuration.maxDuration)})}stopSimulation(e,t){return Ce(this,null,function*(){t.stopPropagation(),(yield hn(this.dialogService.openInformationDialog({title:"Stopping Simulation",message:"Are you sure you want to stop the simulation? This action cannot be undone.",type:"warning",confirmButtonOverride:null,cancelButtonOverride:null,canCancel:!0}).afterClosed()))&&this.simulationService.stopSimulation(e)})}visualizeSimulation(e,t){t.stopPropagation(),this.matDialogRef.close({simulationToVisualize:e})}get simulationsSignal(){return this.dataService.simulationsSignal}pauseResumeHandler(e,t,r){r.stopPropagation(),t?this.simulationService.pauseSimulation(e):this.simulationService.resumeSimulation(e)}importSimulation(){let e=document.createElement("input");e.type="file",e.webkitdirectory=!0,e.multiple=!0;let t=r=>Ce(this,null,function*(){let n=r.target.files;if(!n||n.length===0)return;let a=new Y$.default,o=n[0].webkitRelativePath.split("/")[0];for(let c of Array.from(n)){let u=c.webkitRelativePath.replace(o+"/","");a.file(u,c)}let s=yield a.generateAsync({type:"blob"}),l=new FormData;l.append("file",s,"folder.zip"),this.httpService.importFolder("simulation",o,l).subscribe({next:c=>{c.message?this.communicationService.emit("get-simulations"):c.error&&console.error("Upload failed:",c.error)},error:c=>{console.error("HTTP error during upload:",c)}})});e.addEventListener("change",r=>{t(r).catch(n=>{console.error("Error handling file change:",n)})}),e.click()}exportSimulation(e,t){t.stopPropagation(),this.httpService.exportFolder("simulation",e).subscribe(n=>{let a=new Blob([n],{type:"application/zip"}),o=window.URL.createObjectURL(a),s=document.createElement("a");s.href=o,s.download=e+".zip",document.body.appendChild(s),s.click(),document.body.removeChild(s),window.URL.revokeObjectURL(o)})}deleteSimulation(e,t,r){return Ce(this,null,function*(){if(r.stopPropagation(),!(yield this.confirmDeletion(t)))return;this.httpService.deleteFolder("simulation",e).subscribe({next:o=>{o.error&&console.error("Failed to delete simulation:",o.error),this.communicationService.emit("get-simulations")},error:o=>{console.error("HTTP error during deletion:",o)}})})}confirmDeletion(e){return Ce(this,null,function*(){return yield hn(this.dialogService.openInformationDialog({title:"Deleting Saved Simulation",message:`Are you sure you want to delete the simulation "${e}"? This action cannot be undone.`,type:"warning",confirmButtonOverride:null,cancelButtonOverride:null,canCancel:!0}).afterClosed())})}getDuration(e){return e.simulationStartTime===null?0:e.simulationEndTime!==null?e.simulationEndTime-e.simulationStartTime:e.simulationTime!==null?e.simulationTime-e.simulationStartTime:0}megabytes(e){return e===null||e<0?"unknown":`${(e/(1024*1024)).toFixed(2)} MB`}toggleSelection(e){this._selectedSimulationIdSignal()===e?this._selectedSimulationIdSignal.set(null):this._selectedSimulationIdSignal.set(e)}copyToClipboard(e,t){return Ce(this,null,function*(){t.stopPropagation(),yield navigator.clipboard.writeText(e).then(()=>{this.snackBar.open("Copied to clipboard!","Close",{duration:2e3})}).catch(r=>{console.error("Failed to copy text: ",r),this.snackBar.open("Failed to copy!","Close",{duration:2e3})})})}isSimulationRunning(e){return Bu.includes(e.status)}static \u0275fac=function(t){return new(t||i)(rt(Qh),rt(Ha),rt(Js),rt(jo),rt(Jg),rt(To),rt(dM))};static \u0275cmp=tt({type:i,selectors:[["app-simulation-list-dialog"]],decls:17,vars:1,consts:[["mat-dialog-title",""],[1,"flex-row","gap-1-rem"],["mat-raised-button","",3,"click","matTooltip"],["mat-button","","mat-dialog-close",""],[1,"flex-column","simulation-list"],[1,"light"],["tabindex","0",1,"list-item","flex-column","gap-0-5-rem","align-main-start","align-cross-stretch",3,"selected"],["tabindex","0",1,"list-item","flex-column","gap-0-5-rem","align-main-start","align-cross-stretch",3,"click","keydown.enter"],[1,"flex-row","align-main-start","align-cross-center","gap-1-rem"],[1,"status-icon"],[1,"flex-column","text-container"],[1,"bold","simulation-name",3,"matTooltip"],[1,"completion"],[1,"light","flex-row","gap-0-5-rem"],[1,"flex-row","gap-0-5-rem"],[1,"actions","align-self-end","flex-row","gap-0-5-rem"],["mat-icon-button","",3,"click","disabled","matTooltip"],[1,"flex-row","gap-0-5-rem","detailed-information"],[1,"flex-column","gap-0-5-rem"],[1,"bold","field"],["tabindex","0",1,"light","copy",3,"click","keydown.enter","matTooltip","matTooltipPosition"],[1,"flex-row","gap-0-5-rem",3,"matTooltip"],["matTooltip","Time when the user started the simulation",1,"flex-row","gap-0-5-rem"],["matTooltip","Time between the first and last events of the simulation. The real time of the processing could be different.",1,"flex-row","gap-0-5-rem"],["matTooltip","Time of the first event in the simulation",1,"flex-row","gap-0-5-rem"],["matTooltip","Time of the last event in the simulation",1,"flex-row","gap-0-5-rem"],["mat-icon-button","",3,"click","matTooltip"],["matTooltip","Time of the current event in the simulation",1,"flex-row","gap-0-5-rem"],["matTooltip","Estimated time of the last event of the simulation",1,"flex-row","gap-0-5-rem"],["matTooltip","User-defined maximum duration of the simulation",1,"flex-row","gap-0-5-rem"]],template:function(t,r){if(t&1){let n=vt();Z(0,"h2",0),ce(1,"Available Simulations"),Q(),Z(2,"mat-dialog-content")(3,"h3"),ce(4,"Actions"),Q(),Z(5,"section",1)(6,"button",2),Le("click",function(){return Ee(n),Ae(r.importSimulation())}),Z(7,"mat-icon"),ce(8,"cloud_upload"),Q(),Z(9,"span"),ce(10,"Import"),Q()()(),Ri(11),ui(12,cDe,5,4,null,null,eDe),Q(),Z(14,"mat-dialog-actions")(15,"button",3),ce(16,"Close"),Q()()}if(t&2){oe(6),Re("matTooltip","Import a simulation");let n=r.groupedSimulationsSignal();oe(6),hi(n)}},dependencies:[Os,Is,Fs,vo,Br,pn,Xl,ha,Rs,Eh,tc,So,pr,mr,Rn,Da,Ah,cx,rV,ed,tV],styles:[".flex-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.flex-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.align-center[_ngcontent-%COMP%], .align-main-center[_ngcontent-%COMP%]{justify-content:center}.align-center[_ngcontent-%COMP%], .align-cross-center[_ngcontent-%COMP%]{align-items:center}.align-main-end[_ngcontent-%COMP%]{justify-content:flex-end}.align-cross-end[_ngcontent-%COMP%]{align-items:flex-end}.align-main-start[_ngcontent-%COMP%]{justify-content:flex-start}.align-cross-start[_ngcontent-%COMP%]{align-items:flex-start}.align-cross-stretch[_ngcontent-%COMP%]{align-items:stretch}.gap-0-5-rem[_ngcontent-%COMP%]{gap:.5rem}.gap-1-rem[_ngcontent-%COMP%]{gap:1rem}.gap-1-5-rem[_ngcontent-%COMP%]{gap:1.5rem}.flex-1[_ngcontent-%COMP%]{flex:1}*[_ngcontent-%COMP%]{--red-text-color: #ff0000;--red-background-color: #ffdddd;--yellow-text-color: #ffc21b;--yellow-background-color: #ffe6a4;--green-text-color: #00aa00;--green-background-color: #ccffcc;--gray-text-color: #666666;--gray-background-color: #f0f0f0;--blue-text-color: #4488ff;--blue-background-color: #cce5ff;--loaded-slider-color: #005cbb88;--active-button-color: #cce6ff}.text-red[_ngcontent-%COMP%]{color:var(--red-text-color)}.background-red[_ngcontent-%COMP%]{background-color:var(--red-background-color)}.text-yellow[_ngcontent-%COMP%]{color:var(--yellow-text-color)}.background-yellow[_ngcontent-%COMP%]{background-color:var(--yellow-background-color)}.text-green[_ngcontent-%COMP%]{color:var(--green-text-color)}.background-green[_ngcontent-%COMP%]{background-color:var(--green-background-color)}.text-gray[_ngcontent-%COMP%]{color:var(--gray-text-color)}.background-gray[_ngcontent-%COMP%]{background-color:var(--gray-background-color)!important}.text-blue[_ngcontent-%COMP%]{color:var(--blue-text-color)}.background-blue[_ngcontent-%COMP%]{background-color:var(--blue-background-color)}.align-self-end[_ngcontent-%COMP%]{margin-inline-start:auto}.list-item[_ngcontent-%COMP%]{border-radius:.5rem;padding-inline:1rem;padding-block:.25rem;cursor:pointer}.list-item[_ngcontent-%COMP%]:is(:hover,.selected){background-color:#f0f0f0}.list-item[_ngcontent-%COMP%]:is(:hover,.selected) .actions[_ngcontent-%COMP%]{display:flex}.list-item.selected[_ngcontent-%COMP%] .detailed-information[_ngcontent-%COMP%]{display:flex}.list-item[_ngcontent-%COMP%] :is(.actions[_ngcontent-%COMP%], .detailed-information[_ngcontent-%COMP%]){display:none}.detailed-information[_ngcontent-%COMP%]{padding-inline-start:calc(24px + 1rem)}.detailed-information[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1}.detailed-information[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{overflow:hidden;word-wrap:break-word;white-space:nowrap}.detailed-information[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > span[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]:nth-child(2){overflow:hidden;text-overflow:ellipsis}.completion[_ngcontent-%COMP%]{flex-shrink:0}.simulation-name[_ngcontent-%COMP%]{word-wrap:break-word;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.light[_ngcontent-%COMP%]{font-weight:300}.bold[_ngcontent-%COMP%]{font-weight:500}.status-icon[_ngcontent-%COMP%]{flex-shrink:0}.text-container[_ngcontent-%COMP%]{flex:1;min-width:0;overflow:hidden}.text-container[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{white-space:nowrap}.copy[_ngcontent-%COMP%]{cursor:pointer}.copy[_ngcontent-%COMP%]:hover{text-decoration:underline;font-weight:700}"]})};var pM=class i{static \u0275fac=function(t){return new(t||i)};static \u0275cmp=tt({type:i,selectors:[["app-user-guide-dialog"]],decls:162,vars:0,consts:[[1,"dialog-header"],["mat-dialog-title",""],["mat-button","","mat-dialog-close",""],[1,"flex-column"],["src","/images/control-bar.png","alt","control-bar.png"],[2,"display","flex","align-items","flex-start","gap","20px"],["src","/images/simulation-control-bar.png","alt","Simulation Control Bar",2,"max-width","300px","height","auto"]],template:function(t,r){t&1&&(Z(0,"div",0)(1,"h2",1),ce(2,"Multimodal Simulation Visualization"),Q(),Z(3,"mat-dialog-actions")(4,"button",2),ce(5,"Close"),Q()()(),Z(6,"mat-dialog-content")(7,"section",3)(8,"h1"),ce(9,"Getting Started"),Q(),Z(10,"p"),ce(11," Welcome to the Multimodal Simulation Visualization. This guide will help you understand how to use all the features. "),Q()(),Z(12,"section",3)(13,"h3"),ce(14,"Starting a simulation"),Q(),Z(15,"p"),ce(16," To start a new simulation, click the "),Z(17,"strong"),ce(18,"Start Simulation"),Q(),ce(19," button from the main menu. You will be presented with the simulation configuration window where you will have to input a few parameters. "),Q(),Z(20,"p"),ce(21," First, you need to name your simulation. We suggest choosing a unique name. It is not necessary, but might lead to confusion later if you want to replay a simulation and it has the same name as an already existing one. "),Q(),Z(22,"p"),ce(23," Next, you need to choose the input data. You can choose one of the existing presets or use the import option to add your own. The import option is the first one in the dropdown menu when selecting the data source. Your import folder does not have to be zipped. We will do that for you. We will also add an index to your imported folder if one by the same name exists already. "),Q(),Z(24,"p"),ce(25," If you wish to run a simulation to get the output logs but do not care about seeing it, you can check the "),Z(26,"strong"),ce(27,"Run in the background"),Q(),ce(28,' option. That will launch the simulation and redirect you to the main menu. You can always visualize any running simulation at any moment by finding it in the "Browse Simulations" window. '),Q(),Z(29,"p"),ce(30," Optionally, define a simulation duration. This defines the maximum amount of in-simulation hours for which the events will be calculated. By default, the simulation will continue until it runs out of events. "),Q()(),Z(31,"section",3)(32,"h3"),ce(33,"Viewing Existing Simulations"),Q(),Z(34,"p"),ce(35," To access saved or background simulations, you can click the "),Z(36,"strong"),ce(37,"Browse Simulations"),Q(),ce(38," button in the main menu. This will show you a list of available simulations as well as their state. "),Q(),Z(39,"p"),ce(40," Here you can stop running simulations as well as delete, import, and export finished ones. The rules for importing simulations are the same as for the starting data. No need to zip the folders, we'll do it for you. Again, try avoiding importing simulations with the same name. It will make it hard to understand which one you are trying to run. "),Q()(),Z(41,"section",3)(42,"h1"),ce(43,"Interacting with a simulation"),Q(),Z(44,"p"),ce(45," Now that you have launched a simulation, let's learn how to control it. "),Q()(),Z(46,"section",3)(47,"h3"),ce(48,"Main Control Bar"),Q(),Z(49,"p"),ce(50," This bar allows you to control the current simulation visualization. No matter what you do within this bar, it will not affect the calculation and processing of the simulation events. "),Q(),Ge(51,"img",4),Z(52,"p"),ce(53," Most of the buttons here are self-explanatory. Still, here is a quick rundown: "),Q(),Z(54,"p"),ce(55," 1. The classic pause/play button. It does not affect the simulation processing, only the visualization. "),Q(),Z(56,"p"),ce(57," 2. Visualization speed setting. This defines how fast things are happening. Adjust it to speed up or slow down your visualization. "),Q(),Z(58,"p"),ce(59," 3. These are the time skip buttons. They will move you a number of seconds forwards or backwards in the simulation. The number of seconds is the same as the speed multiplier. "),Q(),Z(60,"p"),ce(61," 4. This button allows you to toggle the visualization direction. You can play it forwards or backwards. "),Q(),Z(62,"p"),ce(63," 5. The map center button allows you to center the map on the entities in case you wander off on the map. "),Q(),Z(64,"p"),ce(65," 6. The entity follow button allows you to follow the selected entity on the map without losing focus. "),Q(),Z(66,"p"),ce(67," 7. The progress bar allows you to instantly skip to a time within the simulation. However, if you are actively running a simulation, you can only jump to a timestamp before the grey circle, as anything past that is yet to be calculated. If you are replaying a saved simulation, you can jump to any timestamp at any time. "),Q(),Z(68,"p"),ce(69," 8. This button will send you back to the main menu. If you are running a simulation, it will continue to run in the background. "),Q()(),Z(70,"section",3)(71,"h3"),ce(72,"The Simulation Status Control"),Q(),Z(73,"div",5),Ge(74,"img",6),Z(75,"div")(76,"p"),ce(77," This is the control bar for the actual simulation running on the server. This little window allows you to pause the simulation processing, adjust the maximum simulation duration, or stop the simulation completely. "),Q(),Z(78,"p"),ce(79," Note that a stop and a pause are not the same. A stopped simulation is effectively completed and cannot be resumed, only replayed. "),Q(),Z(80,"p"),ce(81," The "),Z(82,"strong"),ce(83,"Estimated end"),Q(),ce(84," is the in-simulation approximated time at which the simulation is expected to end. It has nothing to do with the time in real life. "),Q()()()(),Z(85,"section",3)(86,"h3"),ce(87,"The Information Panel"),Q(),Z(88,"p"),ce(89," This panel displays useful information about your current simulation. You can access it by clicking any of the icons in the top left corner of your screen. Here you can check the simulation name and source files, see the statistics, access entities that are not displayed on the map, and check detailed information about the entity you have selected. "),Q()(),Z(90,"section",3)(91,"h3"),ce(92,"Searching and Entity Selection"),Q(),Z(93,"p"),ce(94," There are a few ways you can select an entity such as a passenger or a vehicle The easiest way would be by simply clicking it on the map. If multiple entities are clumped together, a small dialog will pop up, allowing you to make a more precise choice. Your selected entity will be highlighted in yellow, and you will see its path if it has one. "),Q(),Z(95,"p"),ce(96," You can also select an entity by using the search bar. To open the bar, click on the "),Z(97,"mat-icon"),ce(98,"search"),Q(),ce(99," in the top right corner of your screen. You can search for any entity by typing its ID and selecting it among the autocomplete suggestions. For passengers, you can also find them using their names. "),Q(),Z(100,"p")(101,"strong"),ce(102,"Pro Tip:"),Q(),ce(103,' If you are looking for a vehicle with a specific mode, you can start a search with "mode:". This will prompt you to make a selection, and only vehicles matching your selected mode will be shown in the autocomplete suggestions. '),Q(),Z(104,"p"),ce(105," A history of your selected entities can be accessed by clicking on the "),Z(106,"mat-icon"),ce(107,"history"),Q(),ce(108," icon in the top right corner. "),Q(),Z(109,"p"),ce(110," Once you have selected an entity you can navigate to the selected entity section of the information panel by clicking the "),Z(111,"mat-icon"),ce(112,"touch_app"),Q(),ce(113," icon, and view details such as the entity's ID, name, status, route, etc. In this very section, you can also set the entity as a favorite by clicking the "),Z(114,"mat-icon"),ce(115,"favorite"),Q(),ce(116,". To see the full list of your favorites, click on the "),Z(117,"mat-icon"),ce(118,"star"),Q(),ce(119," in the top right corner. "),Q()(),Z(120,"section",3)(121,"h3"),ce(122,"Display Options"),Q(),Z(123,"p"),ce(124," You have access to a few filters and themes in the top right corner of your simulation. You can decide which entities to display, select a theme for your map, and even change the icons. "),Q(),Z(125,"p"),ce(126," To filter out what is displayed on the map, click the "),Z(127,"mat-icon"),ce(128,"filter_list"),Q(),ce(129," next to the search section. This will allow you to only show certain categories of entities, as well as allow you to see the ones that are completed and no longer shown by default. "),Q(),Z(130,"p"),ce(131," You can change the map theme under the "),Z(132,"mat-icon"),ce(133,"layers"),Q(),ce(134," section. We supply a few themes by default including a dark one, but you are free to add your own. We suggest using OpenStreetMap to avoid compatibility issues. "),Q(),Z(135,"p"),ce(136,' In the same section, you have a "Customize entities" button. This will open a window where you can change the colors, icons and add other effects to the visualization. You have a list of all the default icons for each entity type, which you can edit directly by importing your own images. You also have the option to change the colors used for tinting vehicles and stops according to their occupancy. '),Q(),Z(137,"p"),ce(138," You will see two buttons that allow you to add custom icons and background shapes. Background shapes are colored shapes displayed behind the icons that can be used to group or highlight certain entities. For each shape or icon, you can specify the entity type, the mode (only for vehicles), and the tags. The icon or shape will only be applied to entities matching these criteria. They are displayed in decreasing order of priority, meaning that if two or more rules match an entity, the first one of the list will be applied. Lastly, you can also choose to limit an icon or shape depending on the map zoom level. "),Q(),Z(139,"p"),ce(140," When adding new icons, we strongly recommend using transparent or white images with a black outline. Otherwise, the tinting showing the occupancy of a vehicle or stop might not work as expected. "),Q(),Z(141,"p"),ce(142," You can export and import customization configurations using the buttons on the bottom right. The configuration file is a JSON file with images encoded in base64. You can modify it directly and share it with others. "),Q()(),Z(143,"section",3)(144,"h1"),ce(145,"Folder Structure"),Q(),Z(146,"p"),ce(147," While we do allow imports and exports of important folders, you might still want to access the raw data without having to deal with creating a copy on your machine. "),Q(),Z(148,"p"),ce(149," By default, the input data used to launch a simulation is located in the "),Z(150,"strong"),ce(151,"/data"),Q(),ce(152," folder while the visualizations files are located in the "),Z(153,"strong"),ce(154,"/output"),Q(),ce(155," folder. These folders are relative to the folder you ran the simulation from. You can change these paths by setting the "),Z(156,"strong"),ce(157,"INPUT_DATA_DIRECTORY_PATH"),Q(),ce(158," and "),Z(159,"strong"),ce(160,"OUTPUT_DATA_DIRECTORY_PATH"),Q(),ce(161," environment variables. More on that in the README file. "),Q()()())},dependencies:[SU,Is,Fs,Os,vo,Br,pn,pr,mr],styles:[".flex-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.flex-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.align-center[_ngcontent-%COMP%], .align-main-center[_ngcontent-%COMP%]{justify-content:center}.align-center[_ngcontent-%COMP%], .align-cross-center[_ngcontent-%COMP%]{align-items:center}.align-main-end[_ngcontent-%COMP%]{justify-content:flex-end}.align-cross-end[_ngcontent-%COMP%]{align-items:flex-end}.align-main-start[_ngcontent-%COMP%]{justify-content:flex-start}.align-cross-start[_ngcontent-%COMP%]{align-items:flex-start}.align-cross-stretch[_ngcontent-%COMP%]{align-items:stretch}.gap-0-5-rem[_ngcontent-%COMP%]{gap:.5rem}.gap-1-rem[_ngcontent-%COMP%]{gap:1rem}.gap-1-5-rem[_ngcontent-%COMP%]{gap:1.5rem}.flex-1[_ngcontent-%COMP%]{flex:1}*[_ngcontent-%COMP%]{--red-text-color: #ff0000;--red-background-color: #ffdddd;--yellow-text-color: #ffc21b;--yellow-background-color: #ffe6a4;--green-text-color: #00aa00;--green-background-color: #ccffcc;--gray-text-color: #666666;--gray-background-color: #f0f0f0;--blue-text-color: #4488ff;--blue-background-color: #cce5ff;--loaded-slider-color: #005cbb88;--active-button-color: #cce6ff}.text-red[_ngcontent-%COMP%]{color:var(--red-text-color)}.background-red[_ngcontent-%COMP%]{background-color:var(--red-background-color)}.text-yellow[_ngcontent-%COMP%]{color:var(--yellow-text-color)}.background-yellow[_ngcontent-%COMP%]{background-color:var(--yellow-background-color)}.text-green[_ngcontent-%COMP%]{color:var(--green-text-color)}.background-green[_ngcontent-%COMP%]{background-color:var(--green-background-color)}.text-gray[_ngcontent-%COMP%]{color:var(--gray-text-color)}.background-gray[_ngcontent-%COMP%]{background-color:var(--gray-background-color)!important}.text-blue[_ngcontent-%COMP%]{color:var(--blue-text-color)}.background-blue[_ngcontent-%COMP%]{background-color:var(--blue-background-color)}mat-dialog-content[_ngcontent-%COMP%]{max-height:80vh;height:80vh;overflow-y:auto;padding:16px}mat-icon[_ngcontent-%COMP%]{font-size:1.2em;height:auto;width:auto;vertical-align:middle;margin:0 2px}.flex-column[_ngcontent-%COMP%]{margin-bottom:.5rem}.guide-image[_ngcontent-%COMP%]{max-width:100%;margin:1rem 0;border:1px solid #ddd;border-radius:4px}h1[_ngcontent-%COMP%]{font-size:1.5rem;margin-bottom:1rem;color:var(--primary-color)}h3[_ngcontent-%COMP%]{font-size:1.2rem;margin-bottom:.8rem;color:var(--secondary-color)}p[_ngcontent-%COMP%]{margin:.5rem 0}.align-self-end[_ngcontent-%COMP%]{margin-inline-start:auto}.light[_ngcontent-%COMP%]{font-weight:300}.bold[_ngcontent-%COMP%]{font-weight:500}.list-item[_ngcontent-%COMP%], .actions[_ngcontent-%COMP%]{display:none}.dialog-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin:0}.dialog-header[_ngcontent-%COMP%] mat-dialog-title[_ngcontent-%COMP%]{margin:0}.dialog-header[_ngcontent-%COMP%] mat-dialog-actions[_ngcontent-%COMP%]{margin:0;padding:10px}"]})};var Js=class i{constructor(e){this.matDialog=e}openSimulationConfigurationDialog(e){return this.matDialog.open(nM,{data:e,disableClose:!0,autoFocus:!1,maxHeight:"80vh",width:"600px"})}openSimulationListDialog(){return this.matDialog.open(mM,{data:null,disableClose:!0,autoFocus:!1,maxWidth:"80vw",maxHeight:"80vh",width:"840px"})}openInformationDialog(e){return this.matDialog.open(rM,{data:e,disableClose:!0,autoFocus:!1,maxWidth:"80vw",maxHeight:"80vh",width:"600px"})}openAddMapTileDialog(){return this.matDialog.open(Lw,{data:null,disableClose:!0,autoFocus:!1,maxWidth:"80vw",maxHeight:"80vh",minWidth:"600px"})}openUserGuide(){let e=window.innerHeight*.9,t=window.innerWidth*.8,r=4/3*e,n=Math.min(t,r);return this.matDialog.open(pM,{width:`${n}px`,height:`${e}px`,maxHeight:"90vh",maxWidth:"80vw",panelClass:"user-guide-dialog"})}openEditMapIconsDialog(){return this.matDialog.open(iM,{data:null,disableClose:!0,autoFocus:!1,maxWidth:"80vw",maxHeight:"80vh",width:"800px"})}static \u0275fac=function(t){return new(t||i)(Zt(lm))};static \u0275prov=lt({token:i,factory:i.\u0275fac,providedIn:"root"})};var uDe=["determinateSpinner"];function hDe(i,e){if(i&1&&(Sr(),Z(0,"svg",11),Ge(1,"circle",12),Q()),i&2){let t=Se();Mt("viewBox",t._viewBox()),oe(),yr("stroke-dasharray",t._strokeCircumference(),"px")("stroke-dashoffset",t._strokeCircumference()/2,"px")("stroke-width",t._circleStrokeWidth(),"%"),Mt("r",t._circleRadius())}}var dDe=new et("mat-progress-spinner-default-options",{providedIn:"root",factory:mDe});function mDe(){return{diameter:J$}}var J$=100,pDe=10,$$=(()=>{class i{_elementRef=te(Et);_noopAnimations;get color(){return this._color||this._defaultColor}set color(t){this._color=t}_color;_defaultColor="primary";_determinateCircle;constructor(){let t=te(nr,{optional:!0}),r=te(dDe);this._noopAnimations=t==="NoopAnimations"&&!!r&&!r._forceAnimations,this.mode=this._elementRef.nativeElement.nodeName.toLowerCase()==="mat-spinner"?"indeterminate":"determinate",r&&(r.color&&(this.color=this._defaultColor=r.color),r.diameter&&(this.diameter=r.diameter),r.strokeWidth&&(this.strokeWidth=r.strokeWidth))}mode;get value(){return this.mode==="determinate"?this._value:0}set value(t){this._value=Math.max(0,Math.min(100,t||0))}_value=0;get diameter(){return this._diameter}set diameter(t){this._diameter=t||0}_diameter=J$;get strokeWidth(){return this._strokeWidth??this.diameter/10}set strokeWidth(t){this._strokeWidth=t||0}_strokeWidth;_circleRadius(){return(this.diameter-pDe)/2}_viewBox(){let t=this._circleRadius()*2+this.strokeWidth;return`0 0 ${t} ${t}`}_strokeCircumference(){return 2*Math.PI*this._circleRadius()}_strokeDashOffset(){return this.mode==="determinate"?this._strokeCircumference()*(100-this._value)/100:null}_circleStrokeWidth(){return this.strokeWidth/this.diameter*100}static \u0275fac=function(r){return new(r||i)};static \u0275cmp=tt({type:i,selectors:[["mat-progress-spinner"],["mat-spinner"]],viewQuery:function(r,n){if(r&1&&di(uDe,5),r&2){let a;St(a=kt())&&(n._determinateCircle=a.first)}},hostAttrs:["role","progressbar","tabindex","-1",1,"mat-mdc-progress-spinner","mdc-circular-progress"],hostVars:18,hostBindings:function(r,n){r&2&&(Mt("aria-valuemin",0)("aria-valuemax",100)("aria-valuenow",n.mode==="determinate"?n.value:null)("mode",n.mode),dn("mat-"+n.color),yr("width",n.diameter,"px")("height",n.diameter,"px")("--mdc-circular-progress-size",n.diameter+"px")("--mdc-circular-progress-active-indicator-width",n.diameter+"px"),gt("_mat-animation-noopable",n._noopAnimations)("mdc-circular-progress--indeterminate",n.mode==="indeterminate"))},inputs:{color:"color",mode:"mode",value:[2,"value","value",lr],diameter:[2,"diameter","diameter",lr],strokeWidth:[2,"strokeWidth","strokeWidth",lr]},exportAs:["matProgressSpinner"],features:[si],decls:14,vars:11,consts:[["circle",""],["determinateSpinner",""],["aria-hidden","true",1,"mdc-circular-progress__determinate-container"],["xmlns","http://www.w3.org/2000/svg","focusable","false",1,"mdc-circular-progress__determinate-circle-graphic"],["cx","50%","cy","50%",1,"mdc-circular-progress__determinate-circle"],["aria-hidden","true",1,"mdc-circular-progress__indeterminate-container"],[1,"mdc-circular-progress__spinner-layer"],[1,"mdc-circular-progress__circle-clipper","mdc-circular-progress__circle-left"],[3,"ngTemplateOutlet"],[1,"mdc-circular-progress__gap-patch"],[1,"mdc-circular-progress__circle-clipper","mdc-circular-progress__circle-right"],["xmlns","http://www.w3.org/2000/svg","focusable","false",1,"mdc-circular-progress__indeterminate-circle-graphic"],["cx","50%","cy","50%"]],template:function(r,n){if(r&1&&(je(0,hDe,2,8,"ng-template",null,0,Gp),Z(2,"div",2,1),Sr(),Z(4,"svg",3),Ge(5,"circle",4),Q()(),ex(),Z(6,"div",5)(7,"div",6)(8,"div",7),Od(9,8),Q(),Z(10,"div",9),Od(11,8),Q(),Z(12,"div",10),Od(13,8),Q()()()),r&2){let a=Or(1);oe(4),Mt("viewBox",n._viewBox()),oe(),yr("stroke-dasharray",n._strokeCircumference(),"px")("stroke-dashoffset",n._strokeDashOffset(),"px")("stroke-width",n._circleStrokeWidth(),"%"),Mt("r",n._circleRadius()),oe(4),Re("ngTemplateOutlet",a),oe(2),Re("ngTemplateOutlet",a),oe(2),Re("ngTemplateOutlet",a)}},dependencies:[Wp],styles:[".mat-mdc-progress-spinner{display:block;overflow:hidden;line-height:0;position:relative;direction:ltr;transition:opacity 250ms cubic-bezier(0.4, 0, 0.6, 1)}.mat-mdc-progress-spinner circle{stroke-width:var(--mdc-circular-progress-active-indicator-width, 4px)}.mat-mdc-progress-spinner._mat-animation-noopable,.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__determinate-circle{transition:none !important}.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__indeterminate-circle-graphic,.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__spinner-layer,.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__indeterminate-container{animation:none !important}.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__indeterminate-container circle{stroke-dasharray:0 !important}@media(forced-colors: active){.mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic,.mat-mdc-progress-spinner .mdc-circular-progress__determinate-circle{stroke:currentColor;stroke:CanvasText}}.mdc-circular-progress__determinate-container,.mdc-circular-progress__indeterminate-circle-graphic,.mdc-circular-progress__indeterminate-container,.mdc-circular-progress__spinner-layer{position:absolute;width:100%;height:100%}.mdc-circular-progress__determinate-container{transform:rotate(-90deg)}.mdc-circular-progress--indeterminate .mdc-circular-progress__determinate-container{opacity:0}.mdc-circular-progress__indeterminate-container{font-size:0;letter-spacing:0;white-space:nowrap;opacity:0}.mdc-circular-progress--indeterminate .mdc-circular-progress__indeterminate-container{opacity:1;animation:mdc-circular-progress-container-rotate 1568.2352941176ms linear infinite}.mdc-circular-progress__determinate-circle-graphic,.mdc-circular-progress__indeterminate-circle-graphic{fill:rgba(0,0,0,0)}.mat-mdc-progress-spinner .mdc-circular-progress__determinate-circle,.mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic{stroke:var(--mdc-circular-progress-active-indicator-color, var(--mat-sys-primary))}@media(forced-colors: active){.mat-mdc-progress-spinner .mdc-circular-progress__determinate-circle,.mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic{stroke:CanvasText}}.mdc-circular-progress__determinate-circle{transition:stroke-dashoffset 500ms cubic-bezier(0, 0, 0.2, 1)}.mdc-circular-progress__gap-patch{position:absolute;top:0;left:47.5%;box-sizing:border-box;width:5%;height:100%;overflow:hidden}.mdc-circular-progress__gap-patch .mdc-circular-progress__indeterminate-circle-graphic{left:-900%;width:2000%;transform:rotate(180deg)}.mdc-circular-progress__circle-clipper .mdc-circular-progress__indeterminate-circle-graphic{width:200%}.mdc-circular-progress__circle-right .mdc-circular-progress__indeterminate-circle-graphic{left:-100%}.mdc-circular-progress--indeterminate .mdc-circular-progress__circle-left .mdc-circular-progress__indeterminate-circle-graphic{animation:mdc-circular-progress-left-spin 1333ms cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress--indeterminate .mdc-circular-progress__circle-right .mdc-circular-progress__indeterminate-circle-graphic{animation:mdc-circular-progress-right-spin 1333ms cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress__circle-clipper{display:inline-flex;position:relative;width:50%;height:100%;overflow:hidden}.mdc-circular-progress--indeterminate .mdc-circular-progress__spinner-layer{animation:mdc-circular-progress-spinner-layer-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both}@keyframes mdc-circular-progress-container-rotate{to{transform:rotate(360deg)}}@keyframes mdc-circular-progress-spinner-layer-rotate{12.5%{transform:rotate(135deg)}25%{transform:rotate(270deg)}37.5%{transform:rotate(405deg)}50%{transform:rotate(540deg)}62.5%{transform:rotate(675deg)}75%{transform:rotate(810deg)}87.5%{transform:rotate(945deg)}100%{transform:rotate(1080deg)}}@keyframes mdc-circular-progress-left-spin{from{transform:rotate(265deg)}50%{transform:rotate(130deg)}to{transform:rotate(265deg)}}@keyframes mdc-circular-progress-right-spin{from{transform:rotate(-265deg)}50%{transform:rotate(-130deg)}to{transform:rotate(-265deg)}}"],encapsulation:2,changeDetection:0})}return i})();var X$=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275mod=Lt({type:i});static \u0275inj=Dt({imports:[ti]})}return i})();function gDe(i,e){if(i&1&&(Z(0,"p",2),ce(1),Q()),i&2){let t=Se();oe(),Ti(t.data.message)}}var fM=class i{constructor(e){this.data=e}static \u0275fac=function(t){return new(t||i)(rt(sm))};static \u0275cmp=tt({type:i,selectors:[["app-loading-dialog"]],decls:3,vars:2,consts:[[1,"flex-row","content"],[3,"diameter"],[1,"message"]],template:function(t,r){t&1&&(Z(0,"mat-dialog-content",0),Ge(1,"mat-spinner",1),je(2,gDe,2,1,"p",2),Q()),t&2&&(oe(),Re("diameter",30),oe(),Je(r.data.message?2:-1))},dependencies:[vo,X$,$$],styles:[".flex-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.flex-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.align-center[_ngcontent-%COMP%], .align-main-center[_ngcontent-%COMP%]{justify-content:center}.align-center[_ngcontent-%COMP%], .align-cross-center[_ngcontent-%COMP%]{align-items:center}.align-main-end[_ngcontent-%COMP%]{justify-content:flex-end}.align-cross-end[_ngcontent-%COMP%]{align-items:flex-end}.align-main-start[_ngcontent-%COMP%]{justify-content:flex-start}.align-cross-start[_ngcontent-%COMP%]{align-items:flex-start}.align-cross-stretch[_ngcontent-%COMP%]{align-items:stretch}.gap-0-5-rem[_ngcontent-%COMP%]{gap:.5rem}.gap-1-rem[_ngcontent-%COMP%]{gap:1rem}.gap-1-5-rem[_ngcontent-%COMP%]{gap:1.5rem}.flex-1[_ngcontent-%COMP%]{flex:1}.content[_ngcontent-%COMP%]{justify-content:center;align-items:center;gap:20px}.message[_ngcontent-%COMP%]{margin:0}"]})};var ty=class i{constructor(e){this.matDialog=e}loadingDialogRef=null;start(e){this.loadingDialogRef=this.matDialog.open(fM,{data:{message:e},disableClose:!0,autoFocus:!1,maxHeight:"80vh",maxWidth:"80vw",width:"200px"})}stop(){this.loadingDialogRef&&(this.loadingDialogRef.close(),this.loadingDialogRef=null)}static \u0275fac=function(t){return new(t||i)(Zt(lm))};static \u0275prov=lt({token:i,factory:i.\u0275fac,providedIn:"root"})};function yDe(i,e){if(i&1){let t=vt();Z(0,"div",0)(1,"h1",1),ce(2," Multimodal Simulation Visualization "),Q(),Z(3,"button",2),Le("click",function(){Ee(t);let n=Se();return Ae(n.onStartSimulation())}),Z(4,"mat-icon"),ce(5,"add_circle_outline"),Q(),Z(6,"span"),ce(7,"Start a simulation"),Q()(),Z(8,"button",2),Le("click",function(){Ee(t);let n=Se();return Ae(n.onBrowseSimulations())}),Z(9,"mat-icon"),ce(10,"folder_open"),Q(),Z(11,"span"),ce(12,"Browse simulations"),Q()(),Z(13,"div",3)(14,"button",4),Le("click",function(){Ee(t);let n=Se();return Ae(n.onUserGuide())}),Z(15,"mat-icon"),ce(16,"info"),Q(),Z(17,"span"),ce(18,"User guide"),Q()(),Ge(19,"app-github-button",5),Q()()}}var gM=class i{constructor(e,t,r,n){this.dialogService=e;this.loadingService=t;this.communicationService=r;this.router=n}shouldShowMainMenuSignal=Bt(!0);onStartSimulation(){return Ce(this,null,function*(){this.shouldShowMainMenuSignal.set(!1);let e=yield hn(this.dialogService.openSimulationConfigurationDialog({mode:"start",currentConfiguration:null}).afterClosed());if(!e){this.shouldShowMainMenuSignal.set(!0);return}if(!this.communicationService.isConnectedSignal()){yield hn(this.dialogService.openInformationDialog({title:"Disconnected",message:"A connection to the server is needed to create a simulation.",type:"error",confirmButtonOverride:null,cancelButtonOverride:null,canCancel:!1}).afterClosed()),this.shouldShowMainMenuSignal.set(!0);return}this.loadingService.start("Starting simulation");let t=Math.random().toString(36).substring(7)+Date.now();try{yield new Promise((r,n)=>{let a=setTimeout(()=>{n(new Error("Timeout"))},3e4);this.communicationService.on(t,o=>Ce(this,null,function*(){if(clearTimeout(a),this.loadingService.stop(),!e.general.shouldRunInBackground)yield this.router.navigate([`visualize/${o}`]);else{yield hn(this.dialogService.openInformationDialog({title:"Simulation started",message:"The simulation is starting in the background. You can check its status in the simulations list.",type:"info",confirmButtonOverride:null,cancelButtonOverride:null,canCancel:!1}).afterClosed()),this.shouldShowMainMenuSignal.set(!0);return}r()})),this.communicationService.emit("start-simulation",e.general.name,e.general.data,t,e.configuration.maxDuration)}),this.communicationService.removeAllListeners(t)}catch{this.communicationService.removeAllListeners(t),this.loadingService.stop(),yield hn(this.dialogService.openInformationDialog({title:"Timeout",message:"The simulation took too long to start. Please verify the status of the server.",type:"error",confirmButtonOverride:null,cancelButtonOverride:null,canCancel:!1}).afterClosed()),this.shouldShowMainMenuSignal.set(!0);return}})}onBrowseSimulations(){return Ce(this,null,function*(){this.shouldShowMainMenuSignal.set(!1);let e=yield hn(this.dialogService.openSimulationListDialog().afterClosed());if(!e||!e.simulationToVisualize){this.shouldShowMainMenuSignal.set(!0);return}yield this.router.navigate([`visualize/${e.simulationToVisualize.id}`])})}onUserGuide(){return Ce(this,null,function*(){this.shouldShowMainMenuSignal.set(!1),yield hn(this.dialogService.openUserGuide().afterClosed()),this.shouldShowMainMenuSignal.set(!0)})}static \u0275fac=function(t){return new(t||i)(rt(Js),rt(ty),rt(To),rt(rf))};static \u0275cmp=tt({type:i,selectors:[["app-home"]],decls:1,vars:1,consts:[[1,"main-menu","flex-column","align-main-center","gap-1-rem"],[1,"enable-pointer-events","main-menu-title"],["mat-raised-button","",1,"enable-pointer-events",3,"click"],[1,"flex-row","gap-1-rem"],["mat-raised-button","",1,"enable-pointer-events","flex-1",3,"click"],[1,"enable-pointer-events"]],template:function(t,r){t&1&&je(0,yDe,20,0,"div",0),t&2&&Je(r.shouldShowMainMenuSignal()?0:-1)},dependencies:[Br,pn,pr,mr,dw],styles:[".flex-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.flex-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.align-center[_ngcontent-%COMP%], .align-main-center[_ngcontent-%COMP%]{justify-content:center}.align-center[_ngcontent-%COMP%], .align-cross-center[_ngcontent-%COMP%]{align-items:center}.align-main-end[_ngcontent-%COMP%]{justify-content:flex-end}.align-cross-end[_ngcontent-%COMP%]{align-items:flex-end}.align-main-start[_ngcontent-%COMP%]{justify-content:flex-start}.align-cross-start[_ngcontent-%COMP%]{align-items:flex-start}.align-cross-stretch[_ngcontent-%COMP%]{align-items:stretch}.gap-0-5-rem[_ngcontent-%COMP%]{gap:.5rem}.gap-1-rem[_ngcontent-%COMP%]{gap:1rem}.gap-1-5-rem[_ngcontent-%COMP%]{gap:1.5rem}.flex-1[_ngcontent-%COMP%]{flex:1}[_nghost-%COMP%]{display:block;width:100%;height:100%;position:absolute;top:0;left:0;z-index:500;background-color:#00000052}.disable-pointer-events[_ngcontent-%COMP%], [_nghost-%COMP%]{pointer-events:none}.enable-pointer-events[_ngcontent-%COMP%]{pointer-events:auto}.main-menu[_ngcontent-%COMP%]{position:absolute;top:50%;left:25%;transform:translate(-50%,-50%);max-width:20rem}.main-menu-title[_ngcontent-%COMP%]{font-size:3.5rem;font-weight:700;text-align:center;color:#fff}"]})};var _De=["panel"],bDe=["*"];function vDe(i,e){if(i&1){let t=vt();Z(0,"div",1,0),Le("@panelAnimation.done",function(n){Ee(t);let a=Se();return Ae(a._animationDone.next(n))}),Ot(2),Q()}if(i&2){let t=e.id,r=Se();dn(r._classList),gt("mat-mdc-autocomplete-visible",r.showPanel)("mat-mdc-autocomplete-hidden",!r.showPanel)("mat-primary",r._color==="primary")("mat-accent",r._color==="accent")("mat-warn",r._color==="warn"),Re("id",r.id)("@panelAnimation",r.isOpen?"visible":"hidden"),Mt("aria-label",r.ariaLabel||null)("aria-labelledby",r._getPanelAriaLabelledby(t))}}var SDe=Cs("panelAnimation",[Ms("void, hidden",mn({opacity:0,transform:"scaleY(0.8)"})),Ba(":enter, hidden => visible",[oV([Pa("0.03s linear",mn({opacity:1})),Pa("0.12s cubic-bezier(0, 0, 0.2, 1)",mn({transform:"scaleY(1)"}))])]),Ba(":leave, visible => hidden",[Pa("0.075s linear",mn({opacity:0}))])]),RI=class{source;option;constructor(e,t){this.source=e,this.option=t}},eX=new et("mat-autocomplete-default-options",{providedIn:"root",factory:kDe});function kDe(){return{autoActiveFirstOption:!1,autoSelectActiveOption:!1,hideSingleSelectionIndicator:!1,requireSelection:!1}}var tX=(()=>{class i{_changeDetectorRef=te(_i);_elementRef=te(Et);_defaults=te(eX);_activeOptionChanges=tr.EMPTY;_animationDone=new ut;_keyManager;showPanel=!1;get isOpen(){return this._isOpen&&this.showPanel}_isOpen=!1;_latestOpeningTrigger;_setColor(t){this._color=t,this._changeDetectorRef.markForCheck()}_color;template;panel;options;optionGroups;ariaLabel;ariaLabelledby;displayWith=null;autoActiveFirstOption;autoSelectActiveOption;requireSelection;panelWidth;disableRipple;optionSelected=new ut;opened=new ut;closed=new ut;optionActivated=new ut;set classList(t){this._classList=t,this._elementRef.nativeElement.className=""}_classList;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(t){this._hideSingleSelectionIndicator=t,this._syncParentProperties()}_hideSingleSelectionIndicator;_syncParentProperties(){if(this.options)for(let t of this.options)t._changeDetectorRef.markForCheck()}id=te(Di).getId("mat-autocomplete-");inertGroups;constructor(){let t=te($i);this.inertGroups=t?.SAFARI||!1,this.autoActiveFirstOption=!!this._defaults.autoActiveFirstOption,this.autoSelectActiveOption=!!this._defaults.autoSelectActiveOption,this.requireSelection=!!this._defaults.requireSelection,this._hideSingleSelectionIndicator=this._defaults.hideSingleSelectionIndicator??!1}ngAfterContentInit(){this._keyManager=new pf(this.options).withWrap().skipPredicate(this._skipPredicate),this._activeOptionChanges=this._keyManager.change.subscribe(t=>{this.isOpen&&this.optionActivated.emit({source:this,option:this.options.toArray()[t]||null})}),this._setVisibility()}ngOnDestroy(){this._keyManager?.destroy(),this._activeOptionChanges.unsubscribe(),this._animationDone.complete()}_setScrollTop(t){this.panel&&(this.panel.nativeElement.scrollTop=t)}_getScrollTop(){return this.panel?this.panel.nativeElement.scrollTop:0}_setVisibility(){this.showPanel=!!this.options.length,this._changeDetectorRef.markForCheck()}_emitSelectEvent(t){let r=new RI(this,t);this.optionSelected.emit(r)}_getPanelAriaLabelledby(t){if(this.ariaLabel)return null;let r=t?t+" ":"";return this.ariaLabelledby?r+this.ariaLabelledby:t}_skipPredicate(){return!1}static \u0275fac=function(r){return new(r||i)};static \u0275cmp=tt({type:i,selectors:[["mat-autocomplete"]],contentQueries:function(r,n,a){if(r&1&&(Ki(a,$l,5),Ki(a,yb,5)),r&2){let o;St(o=kt())&&(n.options=o),St(o=kt())&&(n.optionGroups=o)}},viewQuery:function(r,n){if(r&1&&(di(Ta,7),di(_De,5)),r&2){let a;St(a=kt())&&(n.template=a.first),St(a=kt())&&(n.panel=a.first)}},hostAttrs:[1,"mat-mdc-autocomplete"],inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],displayWith:"displayWith",autoActiveFirstOption:[2,"autoActiveFirstOption","autoActiveFirstOption",st],autoSelectActiveOption:[2,"autoSelectActiveOption","autoSelectActiveOption",st],requireSelection:[2,"requireSelection","requireSelection",st],panelWidth:"panelWidth",disableRipple:[2,"disableRipple","disableRipple",st],classList:[0,"class","classList"],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",st]},outputs:{optionSelected:"optionSelected",opened:"opened",closed:"closed",optionActivated:"optionActivated"},exportAs:["matAutocomplete"],features:[ei([{provide:gb,useExisting:i}]),si],ngContentSelectors:bDe,decls:1,vars:0,consts:[["panel",""],["role","listbox",1,"mat-mdc-autocomplete-panel","mdc-menu-surface","mdc-menu-surface--open",3,"id"]],template:function(r,n){r&1&&(Pi(),je(0,vDe,3,16,"ng-template"))},styles:["div.mat-mdc-autocomplete-panel{width:100%;max-height:256px;visibility:hidden;transform-origin:center top;overflow:auto;padding:8px 0;box-sizing:border-box;position:static;border-radius:var(--mat-autocomplete-container-shape, var(--mat-sys-corner-extra-small));box-shadow:var(--mat-autocomplete-container-elevation-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12));background-color:var(--mat-autocomplete-background-color, var(--mat-sys-surface-container))}@media(forced-colors: active){div.mat-mdc-autocomplete-panel{outline:solid 1px}}.cdk-overlay-pane:not(.mat-mdc-autocomplete-panel-above) div.mat-mdc-autocomplete-panel{border-top-left-radius:0;border-top-right-radius:0}.mat-mdc-autocomplete-panel-above div.mat-mdc-autocomplete-panel{border-bottom-left-radius:0;border-bottom-right-radius:0;transform-origin:center bottom}div.mat-mdc-autocomplete-panel.mat-mdc-autocomplete-visible{visibility:visible}div.mat-mdc-autocomplete-panel.mat-mdc-autocomplete-hidden{visibility:hidden;pointer-events:none}mat-autocomplete{display:none}"],encapsulation:2,data:{animation:[SDe]},changeDetection:0})}return i})();var xDe={provide:Bn,useExisting:Fr(()=>DI),multi:!0};var iX=new et("mat-autocomplete-scroll-strategy",{providedIn:"root",factory:()=>{let i=te(Rr);return()=>i.scrollStrategies.reposition()}});function wDe(i){return()=>i.scrollStrategies.reposition()}var CDe={provide:iX,deps:[Rr],useFactory:wDe},DI=(()=>{class i{_environmentInjector=te(xs);_element=te(Et);_overlay=te(Rr);_viewContainerRef=te(sa);_zone=te(Kt);_changeDetectorRef=te(_i);_dir=te(Pr,{optional:!0});_formField=te(nu,{optional:!0,host:!0});_document=te(li);_viewportRuler=te(ic);_scrollStrategy=te(iX);_renderer=te(Wr);_defaults=te(eX,{optional:!0});_overlayRef;_portal;_componentDestroyed=!1;_initialized=new ct;_keydownSubscription;_outsideClickSubscription;_cleanupWindowBlur;_previousValue;_valueOnAttach;_valueOnLastKeydown;_positionStrategy;_manuallyFloatingLabel=!1;_closingActionsSubscription;_viewportSubscription=tr.EMPTY;_breakpointObserver=te(df);_handsetLandscapeSubscription=tr.EMPTY;_canOpenOnNextFocus=!0;_valueBeforeAutoSelection;_pendingAutoselectedOption;_closeKeyEventStream=new ct;_windowBlurHandler=()=>{this._canOpenOnNextFocus=this._document.activeElement!==this._element.nativeElement||this.panelOpen};_onChange=()=>{};_onTouched=()=>{};autocomplete;position="auto";connectedTo;autocompleteAttribute="off";autocompleteDisabled;constructor(){}_aboveClass="mat-mdc-autocomplete-panel-above";ngAfterViewInit(){this._initialized.next(),this._initialized.complete(),this._cleanupWindowBlur=this._renderer.listen("window","blur",this._windowBlurHandler)}ngOnChanges(t){t.position&&this._positionStrategy&&(this._setStrategyPositions(this._positionStrategy),this.panelOpen&&this._overlayRef.updatePosition())}ngOnDestroy(){this._cleanupWindowBlur?.(),this._handsetLandscapeSubscription.unsubscribe(),this._viewportSubscription.unsubscribe(),this._componentDestroyed=!0,this._destroyPanel(),this._closeKeyEventStream.complete(),this._clearFromModal()}get panelOpen(){return this._overlayAttached&&this.autocomplete.showPanel}_overlayAttached=!1;openPanel(){this._openPanelInternal()}closePanel(){this._resetLabel(),this._overlayAttached&&(this.panelOpen&&this._zone.run(()=>{this.autocomplete.closed.emit()}),this.autocomplete._latestOpeningTrigger===this&&(this.autocomplete._isOpen=!1,this.autocomplete._latestOpeningTrigger=null),this._overlayAttached=!1,this._pendingAutoselectedOption=null,this._overlayRef&&this._overlayRef.hasAttached()&&(this._overlayRef.detach(),this._closingActionsSubscription.unsubscribe()),this._updatePanelState(),this._componentDestroyed||this._changeDetectorRef.detectChanges(),this._trackedModal&&_h(this._trackedModal,"aria-owns",this.autocomplete.id))}updatePosition(){this._overlayAttached&&this._overlayRef.updatePosition()}get panelClosingActions(){return vr(this.optionSelections,this.autocomplete._keyManager.tabOut.pipe(Yi(()=>this._overlayAttached)),this._closeKeyEventStream,this._getOutsideClickStream(),this._overlayRef?this._overlayRef.detachments().pipe(Yi(()=>this._overlayAttached)):Qt()).pipe(mi(t=>t instanceof fb?t:null))}optionSelections=ol(()=>{let t=this.autocomplete?this.autocomplete.options:null;return t?t.changes.pipe(ur(t),Er(()=>vr(...t.map(r=>r.onSelectionChange)))):this._initialized.pipe(Er(()=>this.optionSelections))});get activeOption(){return this.autocomplete&&this.autocomplete._keyManager?this.autocomplete._keyManager.activeItem:null}_getOutsideClickStream(){return new wa(t=>{let r=a=>{let o=An(a),s=this._formField?this._formField.getConnectedOverlayOrigin().nativeElement:null,l=this.connectedTo?this.connectedTo.elementRef.nativeElement:null;this._overlayAttached&&o!==this._element.nativeElement&&this._document.activeElement!==this._element.nativeElement&&(!s||!s.contains(o))&&(!l||!l.contains(o))&&this._overlayRef&&!this._overlayRef.overlayElement.contains(o)&&t.next(a)},n=[this._renderer.listen("document","click",r),this._renderer.listen("document","auxclick",r),this._renderer.listen("document","touchend",r)];return()=>{n.forEach(a=>a())}})}writeValue(t){Promise.resolve(null).then(()=>this._assignOptionValue(t))}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this._element.nativeElement.disabled=t}_handleKeydown(t){let r=t.keyCode,n=Hr(t);if(r===27&&!n&&t.preventDefault(),this._valueOnLastKeydown=this._element.nativeElement.value,this.activeOption&&r===13&&this.panelOpen&&!n)this.activeOption._selectViaInteraction(),this._resetActiveItem(),t.preventDefault();else if(this.autocomplete){let a=this.autocomplete._keyManager.activeItem,o=r===38||r===40;r===9||o&&!n&&this.panelOpen?this.autocomplete._keyManager.onKeydown(t):o&&this._canOpen()&&this._openPanelInternal(this._valueOnLastKeydown),(o||this.autocomplete._keyManager.activeItem!==a)&&(this._scrollToOption(this.autocomplete._keyManager.activeItemIndex||0),this.autocomplete.autoSelectActiveOption&&this.activeOption&&(this._pendingAutoselectedOption||(this._valueBeforeAutoSelection=this._valueOnLastKeydown),this._pendingAutoselectedOption=this.activeOption,this._assignOptionValue(this.activeOption.value)))}}_handleInput(t){let r=t.target,n=r.value;if(r.type==="number"&&(n=n==""?null:parseFloat(n)),this._previousValue!==n){if(this._previousValue=n,this._pendingAutoselectedOption=null,(!this.autocomplete||!this.autocomplete.requireSelection)&&this._onChange(n),!n)this._clearPreviousSelectedOption(null,!1);else if(this.panelOpen&&!this.autocomplete.requireSelection){let a=this.autocomplete.options?.find(o=>o.selected);if(a){let o=this._getDisplayValue(a.value);n!==o&&a.deselect(!1)}}if(this._canOpen()&&this._document.activeElement===t.target){let a=this._valueOnLastKeydown??this._element.nativeElement.value;this._valueOnLastKeydown=null,this._openPanelInternal(a)}}}_handleFocus(){this._canOpenOnNextFocus?this._canOpen()&&(this._previousValue=this._element.nativeElement.value,this._attachOverlay(this._previousValue),this._floatLabel(!0)):this._canOpenOnNextFocus=!0}_handleClick(){this._canOpen()&&!this.panelOpen&&this._openPanelInternal()}_floatLabel(t=!1){this._formField&&this._formField.floatLabel==="auto"&&(t?this._formField._animateAndLockLabel():this._formField.floatLabel="always",this._manuallyFloatingLabel=!0)}_resetLabel(){this._manuallyFloatingLabel&&(this._formField&&(this._formField.floatLabel="auto"),this._manuallyFloatingLabel=!1)}_subscribeToClosingActions(){let t=new wa(n=>{vn(()=>{n.next()},{injector:this._environmentInjector})}),r=this.autocomplete.options.changes.pipe(Ar(()=>this._positionStrategy.reapplyLastPosition()),S4(0));return vr(t,r).pipe(Er(()=>this._zone.run(()=>{let n=this.panelOpen;return this._resetActiveItem(),this._updatePanelState(),this._changeDetectorRef.detectChanges(),this.panelOpen&&this._overlayRef.updatePosition(),n!==this.panelOpen&&(this.panelOpen?this._emitOpened():this.autocomplete.closed.emit()),this.panelClosingActions})),Ir(1)).subscribe(n=>this._setValueAndClose(n))}_emitOpened(){this.autocomplete.opened.emit()}_destroyPanel(){this._overlayRef&&(this.closePanel(),this._overlayRef.dispose(),this._overlayRef=null)}_getDisplayValue(t){let r=this.autocomplete;return r&&r.displayWith?r.displayWith(t):t}_assignOptionValue(t){let r=this._getDisplayValue(t);t==null&&this._clearPreviousSelectedOption(null,!1),this._updateNativeInputValue(r??"")}_updateNativeInputValue(t){this._formField?this._formField._control.value=t:this._element.nativeElement.value=t,this._previousValue=t}_setValueAndClose(t){let r=this.autocomplete,n=t?t.source:this._pendingAutoselectedOption;n?(this._clearPreviousSelectedOption(n),this._assignOptionValue(n.value),this._onChange(n.value),r._emitSelectEvent(n),this._element.nativeElement.focus()):r.requireSelection&&this._element.nativeElement.value!==this._valueOnAttach&&(this._clearPreviousSelectedOption(null),this._assignOptionValue(null),r._animationDone?r._animationDone.pipe(Ir(1)).subscribe(()=>this._onChange(null)):this._onChange(null)),this.closePanel()}_clearPreviousSelectedOption(t,r){this.autocomplete?.options?.forEach(n=>{n!==t&&n.selected&&n.deselect(r)})}_openPanelInternal(t=this._element.nativeElement.value){if(this._attachOverlay(t),this._floatLabel(),this._trackedModal){let r=this.autocomplete.id;gf(this._trackedModal,"aria-owns",r)}}_attachOverlay(t){this.autocomplete;let r=this._overlayRef;r?(this._positionStrategy.setOrigin(this._getConnectedElement()),r.updateSize({width:this._getPanelWidth()})):(this._portal=new Xa(this.autocomplete.template,this._viewContainerRef,{id:this._formField?.getLabelId()}),r=this._overlay.create(this._getOverlayConfig()),this._overlayRef=r,this._viewportSubscription=this._viewportRuler.change().subscribe(()=>{this.panelOpen&&r&&r.updateSize({width:this._getPanelWidth()})}),this._handsetLandscapeSubscription=this._breakpointObserver.observe(Jx.HandsetLandscape).subscribe(a=>{a.matches?this._positionStrategy.withFlexibleDimensions(!0).withGrowAfterOpen(!0).withViewportMargin(8):this._positionStrategy.withFlexibleDimensions(!1).withGrowAfterOpen(!1).withViewportMargin(0)})),r&&!r.hasAttached()&&(r.attach(this._portal),this._valueOnAttach=t,this._valueOnLastKeydown=null,this._closingActionsSubscription=this._subscribeToClosingActions());let n=this.panelOpen;this.autocomplete._isOpen=this._overlayAttached=!0,this.autocomplete._latestOpeningTrigger=this,this.autocomplete._setColor(this._formField?.color),this._updatePanelState(),this._applyModalPanelOwnership(),this.panelOpen&&n!==this.panelOpen&&this._emitOpened()}_handlePanelKeydown=t=>{(t.keyCode===27&&!Hr(t)||t.keyCode===38&&Hr(t,"altKey"))&&(this._pendingAutoselectedOption&&(this._updateNativeInputValue(this._valueBeforeAutoSelection??""),this._pendingAutoselectedOption=null),this._closeKeyEventStream.next(),this._resetActiveItem(),t.stopPropagation(),t.preventDefault())};_updatePanelState(){if(this.autocomplete._setVisibility(),this.panelOpen){let t=this._overlayRef;this._keydownSubscription||(this._keydownSubscription=t.keydownEvents().subscribe(this._handlePanelKeydown)),this._outsideClickSubscription||(this._outsideClickSubscription=t.outsidePointerEvents().subscribe())}else this._keydownSubscription?.unsubscribe(),this._outsideClickSubscription?.unsubscribe(),this._keydownSubscription=this._outsideClickSubscription=null}_getOverlayConfig(){return new Ds({positionStrategy:this._getOverlayPosition(),scrollStrategy:this._scrollStrategy(),width:this._getPanelWidth(),direction:this._dir??void 0,panelClass:this._defaults?.overlayPanelClass})}_getOverlayPosition(){let t=this._overlay.position().flexibleConnectedTo(this._getConnectedElement()).withFlexibleDimensions(!1).withPush(!1);return this._setStrategyPositions(t),this._positionStrategy=t,t}_setStrategyPositions(t){let r=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],n=this._aboveClass,a=[{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:n},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:n}],o;this.position==="above"?o=a:this.position==="below"?o=r:o=[...r,...a],t.withPositions(o)}_getConnectedElement(){return this.connectedTo?this.connectedTo.elementRef:this._formField?this._formField.getConnectedOverlayOrigin():this._element}_getPanelWidth(){return this.autocomplete.panelWidth||this._getHostWidth()}_getHostWidth(){return this._getConnectedElement().nativeElement.getBoundingClientRect().width}_resetActiveItem(){let t=this.autocomplete;if(t.autoActiveFirstOption){let r=-1;for(let n=0;n<t.options.length;n++)if(!t.options.get(n).disabled){r=n;break}t._keyManager.setActiveItem(r)}else t._keyManager.setActiveItem(-1)}_canOpen(){let t=this._element.nativeElement;return!t.readOnly&&!t.disabled&&!this.autocompleteDisabled}_scrollToOption(t){let r=this.autocomplete,n=sw(t,r.options,r.optionGroups);if(t===0&&n===1)r._setScrollTop(0);else if(r.panel){let a=r.options.toArray()[t];if(a){let o=a._getHostElement(),s=lw(o.offsetTop,o.offsetHeight,r._getScrollTop(),r.panel.nativeElement.offsetHeight);r._setScrollTop(s)}}}_trackedModal=null;_applyModalPanelOwnership(){let t=this._element.nativeElement.closest('body > .cdk-overlay-container [aria-modal="true"]');if(!t)return;let r=this.autocomplete.id;this._trackedModal&&_h(this._trackedModal,"aria-owns",r),gf(t,"aria-owns",r),this._trackedModal=t}_clearFromModal(){if(this._trackedModal){let t=this.autocomplete.id;_h(this._trackedModal,"aria-owns",t),this._trackedModal=null}}static \u0275fac=function(r){return new(r||i)};static \u0275dir=ft({type:i,selectors:[["input","matAutocomplete",""],["textarea","matAutocomplete",""]],hostAttrs:[1,"mat-mdc-autocomplete-trigger"],hostVars:7,hostBindings:function(r,n){r&1&&Le("focusin",function(){return n._handleFocus()})("blur",function(){return n._onTouched()})("input",function(o){return n._handleInput(o)})("keydown",function(o){return n._handleKeydown(o)})("click",function(){return n._handleClick()}),r&2&&Mt("autocomplete",n.autocompleteAttribute)("role",n.autocompleteDisabled?null:"combobox")("aria-autocomplete",n.autocompleteDisabled?null:"list")("aria-activedescendant",n.panelOpen&&n.activeOption?n.activeOption.id:null)("aria-expanded",n.autocompleteDisabled?null:n.panelOpen.toString())("aria-controls",n.autocompleteDisabled||!n.panelOpen||n.autocomplete==null?null:n.autocomplete.id)("aria-haspopup",n.autocompleteDisabled?null:"listbox")},inputs:{autocomplete:[0,"matAutocomplete","autocomplete"],position:[0,"matAutocompletePosition","position"],connectedTo:[0,"matAutocompleteConnectedTo","connectedTo"],autocompleteAttribute:[0,"autocomplete","autocompleteAttribute"],autocompleteDisabled:[2,"matAutocompleteDisabled","autocompleteDisabled",st]},exportAs:["matAutocompleteTrigger"],features:[ei([xDe]),si,rr]})}return i})(),rX=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275mod=Lt({type:i});static \u0275inj=Dt({providers:[CDe],imports:[Uo,yf,ti,pl,yf,ti]})}return i})();var TDe=["button"],EDe=["*"];function ADe(i,e){if(i&1&&(Z(0,"div",2),Ge(1,"mat-pseudo-checkbox",6),Q()),i&2){let t=Se();oe(),Re("disabled",t.disabled)}}var nX=new et("MAT_BUTTON_TOGGLE_DEFAULT_OPTIONS",{providedIn:"root",factory:PDe});function PDe(){return{hideSingleSelectionIndicator:!1,hideMultipleSelectionIndicator:!1,disabledInteractive:!1}}var aX=new et("MatButtonToggleGroup"),BDe={provide:Bn,useExisting:Fr(()=>LI),multi:!0},yM=class{source;value;constructor(e,t){this.source=e,this.value=t}},LI=(()=>{class i{_changeDetector=te(_i);_dir=te(Pr,{optional:!0});_multiple=!1;_disabled=!1;_disabledInteractive=!1;_selectionModel;_rawValue;_controlValueAccessorChangeFn=()=>{};_onTouched=()=>{};_buttonToggles;appearance;get name(){return this._name}set name(t){this._name=t,this._markButtonsForCheck()}_name=te(Di).getId("mat-button-toggle-group-");vertical;get value(){let t=this._selectionModel?this._selectionModel.selected:[];return this.multiple?t.map(r=>r.value):t[0]?t[0].value:void 0}set value(t){this._setSelectionByValue(t),this.valueChange.emit(this.value)}valueChange=new ut;get selected(){let t=this._selectionModel?this._selectionModel.selected:[];return this.multiple?t:t[0]||null}get multiple(){return this._multiple}set multiple(t){this._multiple=t,this._markButtonsForCheck()}get disabled(){return this._disabled}set disabled(t){this._disabled=t,this._markButtonsForCheck()}get disabledInteractive(){return this._disabledInteractive}set disabledInteractive(t){this._disabledInteractive=t,this._markButtonsForCheck()}get dir(){return this._dir&&this._dir.value==="rtl"?"rtl":"ltr"}change=new ut;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(t){this._hideSingleSelectionIndicator=t,this._markButtonsForCheck()}_hideSingleSelectionIndicator;get hideMultipleSelectionIndicator(){return this._hideMultipleSelectionIndicator}set hideMultipleSelectionIndicator(t){this._hideMultipleSelectionIndicator=t,this._markButtonsForCheck()}_hideMultipleSelectionIndicator;constructor(){let t=te(nX,{optional:!0});this.appearance=t&&t.appearance?t.appearance:"standard",this.hideSingleSelectionIndicator=t?.hideSingleSelectionIndicator??!1,this.hideMultipleSelectionIndicator=t?.hideMultipleSelectionIndicator??!1}ngOnInit(){this._selectionModel=new Cf(this.multiple,void 0,!1)}ngAfterContentInit(){this._selectionModel.select(...this._buttonToggles.filter(t=>t.checked)),this.multiple||this._initializeTabIndex()}writeValue(t){this.value=t,this._changeDetector.markForCheck()}registerOnChange(t){this._controlValueAccessorChangeFn=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t}_keydown(t){if(this.multiple||this.disabled)return;let n=t.target.id,a=this._buttonToggles.toArray().findIndex(s=>s.buttonId===n),o=null;switch(t.keyCode){case 32:case 13:o=this._buttonToggles.get(a)||null;break;case 38:o=this._getNextButton(a,-1);break;case 37:o=this._getNextButton(a,this.dir==="ltr"?-1:1);break;case 40:o=this._getNextButton(a,1);break;case 39:o=this._getNextButton(a,this.dir==="ltr"?1:-1);break;default:return}o&&(t.preventDefault(),o._onButtonClick(),o.focus())}_emitChangeEvent(t){let r=new yM(t,this.value);this._rawValue=r.value,this._controlValueAccessorChangeFn(r.value),this.change.emit(r)}_syncButtonToggle(t,r,n=!1,a=!1){!this.multiple&&this.selected&&!t.checked&&(this.selected.checked=!1),this._selectionModel?r?this._selectionModel.select(t):this._selectionModel.deselect(t):a=!0,a?Promise.resolve().then(()=>this._updateModelValue(t,n)):this._updateModelValue(t,n)}_isSelected(t){return this._selectionModel&&this._selectionModel.isSelected(t)}_isPrechecked(t){return typeof this._rawValue>"u"?!1:this.multiple&&Array.isArray(this._rawValue)?this._rawValue.some(r=>t.value!=null&&r===t.value):t.value===this._rawValue}_initializeTabIndex(){if(this._buttonToggles.forEach(t=>{t.tabIndex=-1}),this.selected)this.selected.tabIndex=0;else for(let t=0;t<this._buttonToggles.length;t++){let r=this._buttonToggles.get(t);if(!r.disabled){r.tabIndex=0;break}}this._markButtonsForCheck()}_getNextButton(t,r){let n=this._buttonToggles;for(let a=1;a<=n.length;a++){let o=(t+r*a+n.length)%n.length,s=n.get(o);if(s&&!s.disabled)return s}return null}_setSelectionByValue(t){if(this._rawValue=t,!this._buttonToggles)return;let r=this._buttonToggles.toArray();if(this.multiple&&t?(Array.isArray(t),this._clearSelection(),t.forEach(n=>this._selectValue(n,r))):(this._clearSelection(),this._selectValue(t,r)),!this.multiple&&r.every(n=>n.tabIndex===-1)){for(let n of r)if(!n.disabled){n.tabIndex=0;break}}}_clearSelection(){this._selectionModel.clear(),this._buttonToggles.forEach(t=>{t.checked=!1,this.multiple||(t.tabIndex=-1)})}_selectValue(t,r){for(let n of r)if(n.value!=null&&n.value===t){n.checked=!0,this._selectionModel.select(n),this.multiple||(n.tabIndex=0);break}}_updateModelValue(t,r){r&&this._emitChangeEvent(t),this.valueChange.emit(this.value)}_markButtonsForCheck(){this._buttonToggles?.forEach(t=>t._markForCheck())}static \u0275fac=function(r){return new(r||i)};static \u0275dir=ft({type:i,selectors:[["mat-button-toggle-group"]],contentQueries:function(r,n,a){if(r&1&&Ki(a,_M,5),r&2){let o;St(o=kt())&&(n._buttonToggles=o)}},hostAttrs:[1,"mat-button-toggle-group"],hostVars:6,hostBindings:function(r,n){r&1&&Le("keydown",function(o){return n._keydown(o)}),r&2&&(Mt("role",n.multiple?"group":"radiogroup")("aria-disabled",n.disabled),gt("mat-button-toggle-vertical",n.vertical)("mat-button-toggle-group-appearance-standard",n.appearance==="standard"))},inputs:{appearance:"appearance",name:"name",vertical:[2,"vertical","vertical",st],value:"value",multiple:[2,"multiple","multiple",st],disabled:[2,"disabled","disabled",st],disabledInteractive:[2,"disabledInteractive","disabledInteractive",st],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",st],hideMultipleSelectionIndicator:[2,"hideMultipleSelectionIndicator","hideMultipleSelectionIndicator",st]},outputs:{valueChange:"valueChange",change:"change"},exportAs:["matButtonToggleGroup"],features:[ei([BDe,{provide:aX,useExisting:i}]),si]})}return i})(),_M=(()=>{class i{_changeDetectorRef=te(_i);_elementRef=te(Et);_focusMonitor=te(In);_idGenerator=te(Di);_animationMode=te(nr,{optional:!0});_checked=!1;ariaLabel;ariaLabelledby=null;_buttonElement;buttonToggleGroup;get buttonId(){return`${this.id}-button`}id;name;value;get tabIndex(){return this._tabIndex}set tabIndex(t){t!==this._tabIndex&&(this._tabIndex=t,this._markForCheck())}_tabIndex;disableRipple;get appearance(){return this.buttonToggleGroup?this.buttonToggleGroup.appearance:this._appearance}set appearance(t){this._appearance=t}_appearance;get checked(){return this.buttonToggleGroup?this.buttonToggleGroup._isSelected(this):this._checked}set checked(t){t!==this._checked&&(this._checked=t,this.buttonToggleGroup&&this.buttonToggleGroup._syncButtonToggle(this,this._checked),this._changeDetectorRef.markForCheck())}get disabled(){return this._disabled||this.buttonToggleGroup&&this.buttonToggleGroup.disabled}set disabled(t){this._disabled=t}_disabled=!1;get disabledInteractive(){return this._disabledInteractive||this.buttonToggleGroup!==null&&this.buttonToggleGroup.disabledInteractive}set disabledInteractive(t){this._disabledInteractive=t}_disabledInteractive;change=new ut;constructor(){te(ar).load(kn);let t=te(aX,{optional:!0}),r=te(new Ma("tabindex"),{optional:!0})||"",n=te(nX,{optional:!0});this._tabIndex=parseInt(r)||0,this.buttonToggleGroup=t,this.appearance=n&&n.appearance?n.appearance:"standard",this.disabledInteractive=n?.disabledInteractive??!1}ngOnInit(){let t=this.buttonToggleGroup;this.id=this.id||this._idGenerator.getId("mat-button-toggle-"),t&&(t._isPrechecked(this)?this.checked=!0:t._isSelected(this)!==this._checked&&t._syncButtonToggle(this,this._checked))}ngAfterViewInit(){this._animationMode!=="NoopAnimations"&&this._elementRef.nativeElement.classList.add("mat-button-toggle-animations-enabled"),this._focusMonitor.monitor(this._elementRef,!0)}ngOnDestroy(){let t=this.buttonToggleGroup;this._focusMonitor.stopMonitoring(this._elementRef),t&&t._isSelected(this)&&t._syncButtonToggle(this,!1,!1,!0)}focus(t){this._buttonElement.nativeElement.focus(t)}_onButtonClick(){if(this.disabled)return;let t=this.isSingleSelector()?!0:!this._checked;if(t!==this._checked&&(this._checked=t,this.buttonToggleGroup&&(this.buttonToggleGroup._syncButtonToggle(this,this._checked,!0),this.buttonToggleGroup._onTouched())),this.isSingleSelector()){let r=this.buttonToggleGroup._buttonToggles.find(n=>n.tabIndex===0);r&&(r.tabIndex=-1),this.tabIndex=0}this.change.emit(new yM(this,this.value))}_markForCheck(){this._changeDetectorRef.markForCheck()}_getButtonName(){return this.isSingleSelector()?this.buttonToggleGroup.name:this.name||null}isSingleSelector(){return this.buttonToggleGroup&&!this.buttonToggleGroup.multiple}static \u0275fac=function(r){return new(r||i)};static \u0275cmp=tt({type:i,selectors:[["mat-button-toggle"]],viewQuery:function(r,n){if(r&1&&di(TDe,5),r&2){let a;St(a=kt())&&(n._buttonElement=a.first)}},hostAttrs:["role","presentation",1,"mat-button-toggle"],hostVars:14,hostBindings:function(r,n){r&1&&Le("focus",function(){return n.focus()}),r&2&&(Mt("aria-label",null)("aria-labelledby",null)("id",n.id)("name",null),gt("mat-button-toggle-standalone",!n.buttonToggleGroup)("mat-button-toggle-checked",n.checked)("mat-button-toggle-disabled",n.disabled)("mat-button-toggle-disabled-interactive",n.disabledInteractive)("mat-button-toggle-appearance-standard",n.appearance==="standard"))},inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],id:"id",name:"name",value:"value",tabIndex:"tabIndex",disableRipple:[2,"disableRipple","disableRipple",st],appearance:"appearance",checked:[2,"checked","checked",st],disabled:[2,"disabled","disabled",st],disabledInteractive:[2,"disabledInteractive","disabledInteractive",st]},outputs:{change:"change"},exportAs:["matButtonToggle"],features:[si],ngContentSelectors:EDe,decls:7,vars:13,consts:[["button",""],["type","button",1,"mat-button-toggle-button","mat-focus-indicator",3,"click","id","disabled"],[1,"mat-button-toggle-checkbox-wrapper"],[1,"mat-button-toggle-label-content"],[1,"mat-button-toggle-focus-overlay"],["matRipple","",1,"mat-button-toggle-ripple",3,"matRippleTrigger","matRippleDisabled"],["state","checked","aria-hidden","true","appearance","minimal",3,"disabled"]],template:function(r,n){if(r&1){let a=vt();Pi(),Z(0,"button",1,0),Le("click",function(){return Ee(a),Ae(n._onButtonClick())}),je(2,ADe,2,1,"div",2),Z(3,"span",3),Ot(4),Q()(),Ge(5,"span",4)(6,"span",5)}if(r&2){let a=Or(1);Re("id",n.buttonId)("disabled",n.disabled&&!n.disabledInteractive||null),Mt("role",n.isSingleSelector()?"radio":"button")("tabindex",n.disabled&&!n.disabledInteractive?-1:n.tabIndex)("aria-pressed",n.isSingleSelector()?null:n.checked)("aria-checked",n.isSingleSelector()?n.checked:null)("name",n._getButtonName())("aria-label",n.ariaLabel)("aria-labelledby",n.ariaLabelledby)("aria-disabled",n.disabled&&n.disabledInteractive?"true":null),oe(2),Je(n.buttonToggleGroup&&(!n.buttonToggleGroup.multiple&&!n.buttonToggleGroup.hideSingleSelectionIndicator||n.buttonToggleGroup.multiple&&!n.buttonToggleGroup.hideMultipleSelectionIndicator)?2:-1),oe(4),Re("matRippleTrigger",a)("matRippleDisabled",n.disableRipple||n.disabled)}},dependencies:[Ya,YB],styles:[".mat-button-toggle-standalone,.mat-button-toggle-group{position:relative;display:inline-flex;flex-direction:row;white-space:nowrap;overflow:hidden;-webkit-tap-highlight-color:rgba(0,0,0,0);transform:translateZ(0);border-radius:var(--mat-legacy-button-toggle-shape)}.mat-button-toggle-standalone:not([class*=mat-elevation-z]),.mat-button-toggle-group:not([class*=mat-elevation-z]){box-shadow:0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12)}@media(forced-colors: active){.mat-button-toggle-standalone,.mat-button-toggle-group{outline:solid 1px}}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard,.mat-button-toggle-group-appearance-standard{border-radius:var(--mat-standard-button-toggle-shape, var(--mat-sys-corner-full));border:solid 1px var(--mat-standard-button-toggle-divider-color, var(--mat-sys-outline))}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard .mat-pseudo-checkbox,.mat-button-toggle-group-appearance-standard .mat-pseudo-checkbox{--mat-minimal-pseudo-checkbox-selected-checkmark-color: var(--mat-standard-button-toggle-selected-state-text-color, var(--mat-sys-on-secondary-container))}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard:not([class*=mat-elevation-z]),.mat-button-toggle-group-appearance-standard:not([class*=mat-elevation-z]){box-shadow:none}@media(forced-colors: active){.mat-button-toggle-standalone.mat-button-toggle-appearance-standard,.mat-button-toggle-group-appearance-standard{outline:0}}.mat-button-toggle-vertical{flex-direction:column}.mat-button-toggle-vertical .mat-button-toggle-label-content{display:block}.mat-button-toggle{white-space:nowrap;position:relative;color:var(--mat-legacy-button-toggle-text-color);font-family:var(--mat-legacy-button-toggle-label-text-font);font-size:var(--mat-legacy-button-toggle-label-text-size);line-height:var(--mat-legacy-button-toggle-label-text-line-height);font-weight:var(--mat-legacy-button-toggle-label-text-weight);letter-spacing:var(--mat-legacy-button-toggle-label-text-tracking);--mat-minimal-pseudo-checkbox-selected-checkmark-color: var(--mat-legacy-button-toggle-selected-state-text-color)}.mat-button-toggle.cdk-keyboard-focused .mat-button-toggle-focus-overlay{opacity:var(--mat-legacy-button-toggle-focus-state-layer-opacity)}.mat-button-toggle .mat-icon svg{vertical-align:top}.mat-button-toggle-checkbox-wrapper{display:inline-block;justify-content:flex-start;align-items:center;width:0;height:18px;line-height:18px;overflow:hidden;box-sizing:border-box;position:absolute;top:50%;left:16px;transform:translate3d(0, -50%, 0)}[dir=rtl] .mat-button-toggle-checkbox-wrapper{left:auto;right:16px}.mat-button-toggle-appearance-standard .mat-button-toggle-checkbox-wrapper{left:12px}[dir=rtl] .mat-button-toggle-appearance-standard .mat-button-toggle-checkbox-wrapper{left:auto;right:12px}.mat-button-toggle-checked .mat-button-toggle-checkbox-wrapper{width:18px}.mat-button-toggle-animations-enabled .mat-button-toggle-checkbox-wrapper{transition:width 150ms 45ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-button-toggle-vertical .mat-button-toggle-checkbox-wrapper{transition:none}.mat-button-toggle-checked{color:var(--mat-legacy-button-toggle-selected-state-text-color);background-color:var(--mat-legacy-button-toggle-selected-state-background-color)}.mat-button-toggle-disabled{pointer-events:none;color:var(--mat-legacy-button-toggle-disabled-state-text-color);background-color:var(--mat-legacy-button-toggle-disabled-state-background-color);--mat-minimal-pseudo-checkbox-disabled-selected-checkmark-color: var(--mat-legacy-button-toggle-disabled-state-text-color)}.mat-button-toggle-disabled.mat-button-toggle-checked{background-color:var(--mat-legacy-button-toggle-disabled-selected-state-background-color)}.mat-button-toggle-disabled-interactive{pointer-events:auto}.mat-button-toggle-appearance-standard{color:var(--mat-standard-button-toggle-text-color, var(--mat-sys-on-surface));background-color:var(--mat-standard-button-toggle-background-color, transparent);font-family:var(--mat-standard-button-toggle-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mat-standard-button-toggle-label-text-size, var(--mat-sys-label-large-size));line-height:var(--mat-standard-button-toggle-label-text-line-height, var(--mat-sys-label-large-line-height));font-weight:var(--mat-standard-button-toggle-label-text-weight, var(--mat-sys-label-large-weight));letter-spacing:var(--mat-standard-button-toggle-label-text-tracking, var(--mat-sys-label-large-tracking))}.mat-button-toggle-group-appearance-standard .mat-button-toggle-appearance-standard+.mat-button-toggle-appearance-standard{border-left:solid 1px var(--mat-standard-button-toggle-divider-color, var(--mat-sys-outline))}[dir=rtl] .mat-button-toggle-group-appearance-standard .mat-button-toggle-appearance-standard+.mat-button-toggle-appearance-standard{border-left:none;border-right:solid 1px var(--mat-standard-button-toggle-divider-color, var(--mat-sys-outline))}.mat-button-toggle-group-appearance-standard.mat-button-toggle-vertical .mat-button-toggle-appearance-standard+.mat-button-toggle-appearance-standard{border-left:none;border-right:none;border-top:solid 1px var(--mat-standard-button-toggle-divider-color, var(--mat-sys-outline))}.mat-button-toggle-appearance-standard.mat-button-toggle-checked{color:var(--mat-standard-button-toggle-selected-state-text-color, var(--mat-sys-on-secondary-container));background-color:var(--mat-standard-button-toggle-selected-state-background-color, var(--mat-sys-secondary-container))}.mat-button-toggle-appearance-standard.mat-button-toggle-disabled{color:var(--mat-standard-button-toggle-disabled-state-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mat-standard-button-toggle-disabled-state-background-color, transparent)}.mat-button-toggle-appearance-standard.mat-button-toggle-disabled .mat-pseudo-checkbox{--mat-minimal-pseudo-checkbox-disabled-selected-checkmark-color: var(--mat-standard-button-toggle-disabled-selected-state-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-button-toggle-appearance-standard.mat-button-toggle-disabled.mat-button-toggle-checked{color:var(--mat-standard-button-toggle-disabled-selected-state-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mat-standard-button-toggle-disabled-selected-state-background-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-button-toggle-appearance-standard .mat-button-toggle-focus-overlay{background-color:var(--mat-standard-button-toggle-state-layer-color, var(--mat-sys-on-surface))}.mat-button-toggle-appearance-standard:hover .mat-button-toggle-focus-overlay{opacity:var(--mat-standard-button-toggle-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-button-toggle-appearance-standard.cdk-keyboard-focused .mat-button-toggle-focus-overlay{opacity:var(--mat-standard-button-toggle-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}@media(hover: none){.mat-button-toggle-appearance-standard:hover .mat-button-toggle-focus-overlay{display:none}}.mat-button-toggle-label-content{-webkit-user-select:none;user-select:none;display:inline-block;padding:0 16px;line-height:var(--mat-legacy-button-toggle-height);position:relative}.mat-button-toggle-appearance-standard .mat-button-toggle-label-content{padding:0 12px;line-height:var(--mat-standard-button-toggle-height, 40px)}.mat-button-toggle-label-content>*{vertical-align:middle}.mat-button-toggle-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:inherit;pointer-events:none;opacity:0;background-color:var(--mat-legacy-button-toggle-state-layer-color)}@media(forced-colors: active){.mat-button-toggle-checked .mat-button-toggle-focus-overlay{border-bottom:solid 500px;opacity:.5;height:0}.mat-button-toggle-checked:hover .mat-button-toggle-focus-overlay{opacity:.6}.mat-button-toggle-checked.mat-button-toggle-appearance-standard .mat-button-toggle-focus-overlay{border-bottom:solid 500px}}.mat-button-toggle .mat-button-toggle-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-button-toggle-button{border:0;background:none;color:inherit;padding:0;margin:0;font:inherit;outline:none;width:100%;cursor:pointer}.mat-button-toggle-animations-enabled .mat-button-toggle-button{transition:padding 150ms 45ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-button-toggle-vertical .mat-button-toggle-button{transition:none}.mat-button-toggle-disabled .mat-button-toggle-button{cursor:default}.mat-button-toggle-button::-moz-focus-inner{border:0}.mat-button-toggle-checked .mat-button-toggle-button:has(.mat-button-toggle-checkbox-wrapper){padding-left:30px}[dir=rtl] .mat-button-toggle-checked .mat-button-toggle-button:has(.mat-button-toggle-checkbox-wrapper){padding-left:0;padding-right:30px}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard{--mat-focus-indicator-border-radius:var(--mat-standard-button-toggle-shape, var(--mat-sys-corner-full))}.mat-button-toggle-group-appearance-standard:not(.mat-button-toggle-vertical) .mat-button-toggle:last-of-type .mat-button-toggle-button::before{border-top-right-radius:var(--mat-standard-button-toggle-shape, var(--mat-sys-corner-full));border-bottom-right-radius:var(--mat-standard-button-toggle-shape, var(--mat-sys-corner-full))}.mat-button-toggle-group-appearance-standard:not(.mat-button-toggle-vertical) .mat-button-toggle:first-of-type .mat-button-toggle-button::before{border-top-left-radius:var(--mat-standard-button-toggle-shape, var(--mat-sys-corner-full));border-bottom-left-radius:var(--mat-standard-button-toggle-shape, var(--mat-sys-corner-full))}.mat-button-toggle-group-appearance-standard.mat-button-toggle-vertical .mat-button-toggle:last-of-type .mat-button-toggle-button::before{border-bottom-right-radius:var(--mat-standard-button-toggle-shape, var(--mat-sys-corner-full));border-bottom-left-radius:var(--mat-standard-button-toggle-shape, var(--mat-sys-corner-full))}.mat-button-toggle-group-appearance-standard.mat-button-toggle-vertical .mat-button-toggle:first-of-type .mat-button-toggle-button::before{border-top-right-radius:var(--mat-standard-button-toggle-shape, var(--mat-sys-corner-full));border-top-left-radius:var(--mat-standard-button-toggle-shape, var(--mat-sys-corner-full))}"],encapsulation:2,changeDetection:0})}return i})(),oX=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275mod=Lt({type:i});static \u0275inj=Dt({imports:[ti,Ko,_M,ti]})}return i})();var DDe=["*"];var LDe=[[["","mat-card-avatar",""],["","matCardAvatar",""]],[["mat-card-title"],["mat-card-subtitle"],["","mat-card-title",""],["","mat-card-subtitle",""],["","matCardTitle",""],["","matCardSubtitle",""]],"*"],IDe=["[mat-card-avatar], [matCardAvatar]",`mat-card-title, mat-card-subtitle,
|
1699
1699
|
[mat-card-title], [mat-card-subtitle],
|
1700
1700
|
[matCardTitle], [matCardSubtitle]`,"*"],FDe=new et("MAT_CARD_CONFIG"),ea=(()=>{class i{appearance;constructor(){let t=te(FDe,{optional:!0});this.appearance=t?.appearance||"raised"}static \u0275fac=function(r){return new(r||i)};static \u0275cmp=tt({type:i,selectors:[["mat-card"]],hostAttrs:[1,"mat-mdc-card","mdc-card"],hostVars:4,hostBindings:function(r,n){r&2&>("mat-mdc-card-outlined",n.appearance==="outlined")("mdc-card--outlined",n.appearance==="outlined")},inputs:{appearance:"appearance"},exportAs:["matCard"],ngContentSelectors:DDe,decls:1,vars:0,template:function(r,n){r&1&&(Pi(),Ot(0))},styles:['.mat-mdc-card{display:flex;flex-direction:column;box-sizing:border-box;position:relative;border-style:solid;border-width:0;background-color:var(--mdc-elevated-card-container-color, var(--mat-sys-surface-container-low));border-color:var(--mdc-elevated-card-container-color, var(--mat-sys-surface-container-low));border-radius:var(--mdc-elevated-card-container-shape, var(--mat-sys-corner-medium));box-shadow:var(--mdc-elevated-card-container-elevation, var(--mat-sys-level1))}.mat-mdc-card::after{position:absolute;top:0;left:0;width:100%;height:100%;border:solid 1px rgba(0,0,0,0);content:"";display:block;pointer-events:none;box-sizing:border-box;border-radius:var(--mdc-elevated-card-container-shape, var(--mat-sys-corner-medium))}.mat-mdc-card-outlined{background-color:var(--mdc-outlined-card-container-color, var(--mat-sys-surface));border-radius:var(--mdc-outlined-card-container-shape, var(--mat-sys-corner-medium));border-width:var(--mdc-outlined-card-outline-width, 1px);border-color:var(--mdc-outlined-card-outline-color, var(--mat-sys-outline-variant));box-shadow:var(--mdc-outlined-card-container-elevation, var(--mat-sys-level0))}.mat-mdc-card-outlined::after{border:none}.mdc-card__media{position:relative;box-sizing:border-box;background-repeat:no-repeat;background-position:center;background-size:cover}.mdc-card__media::before{display:block;content:""}.mdc-card__media:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}.mdc-card__media:last-child{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.mat-mdc-card-actions{display:flex;flex-direction:row;align-items:center;box-sizing:border-box;min-height:52px;padding:8px}.mat-mdc-card-title{font-family:var(--mat-card-title-text-font, var(--mat-sys-title-large-font));line-height:var(--mat-card-title-text-line-height, var(--mat-sys-title-large-line-height));font-size:var(--mat-card-title-text-size, var(--mat-sys-title-large-size));letter-spacing:var(--mat-card-title-text-tracking, var(--mat-sys-title-large-tracking));font-weight:var(--mat-card-title-text-weight, var(--mat-sys-title-large-weight))}.mat-mdc-card-subtitle{color:var(--mat-card-subtitle-text-color, var(--mat-sys-on-surface));font-family:var(--mat-card-subtitle-text-font, var(--mat-sys-title-medium-font));line-height:var(--mat-card-subtitle-text-line-height, var(--mat-sys-title-medium-line-height));font-size:var(--mat-card-subtitle-text-size, var(--mat-sys-title-medium-size));letter-spacing:var(--mat-card-subtitle-text-tracking, var(--mat-sys-title-medium-tracking));font-weight:var(--mat-card-subtitle-text-weight, var(--mat-sys-title-medium-weight))}.mat-mdc-card-title,.mat-mdc-card-subtitle{display:block;margin:0}.mat-mdc-card-avatar~.mat-mdc-card-header-text .mat-mdc-card-title,.mat-mdc-card-avatar~.mat-mdc-card-header-text .mat-mdc-card-subtitle{padding:16px 16px 0}.mat-mdc-card-header{display:flex;padding:16px 16px 0}.mat-mdc-card-content{display:block;padding:0 16px}.mat-mdc-card-content:first-child{padding-top:16px}.mat-mdc-card-content:last-child{padding-bottom:16px}.mat-mdc-card-title-group{display:flex;justify-content:space-between;width:100%}.mat-mdc-card-avatar{height:40px;width:40px;border-radius:50%;flex-shrink:0;margin-bottom:16px;object-fit:cover}.mat-mdc-card-avatar~.mat-mdc-card-header-text .mat-mdc-card-subtitle,.mat-mdc-card-avatar~.mat-mdc-card-header-text .mat-mdc-card-title{line-height:normal}.mat-mdc-card-sm-image{width:80px;height:80px}.mat-mdc-card-md-image{width:112px;height:112px}.mat-mdc-card-lg-image{width:152px;height:152px}.mat-mdc-card-xl-image{width:240px;height:240px}.mat-mdc-card-subtitle~.mat-mdc-card-title,.mat-mdc-card-title~.mat-mdc-card-subtitle,.mat-mdc-card-header .mat-mdc-card-header-text .mat-mdc-card-title,.mat-mdc-card-header .mat-mdc-card-header-text .mat-mdc-card-subtitle,.mat-mdc-card-title-group .mat-mdc-card-title,.mat-mdc-card-title-group .mat-mdc-card-subtitle{padding-top:0}.mat-mdc-card-content>:last-child:not(.mat-mdc-card-footer){margin-bottom:0}.mat-mdc-card-actions-align-end{justify-content:flex-end}'],encapsulation:2,changeDetection:0})}return i})(),bM=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275dir=ft({type:i,selectors:[["mat-card-title"],["","mat-card-title",""],["","matCardTitle",""]],hostAttrs:[1,"mat-mdc-card-title"]})}return i})();var ta=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275dir=ft({type:i,selectors:[["mat-card-content"]],hostAttrs:[1,"mat-mdc-card-content"]})}return i})(),sX=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275dir=ft({type:i,selectors:[["mat-card-subtitle"],["","mat-card-subtitle",""],["","matCardSubtitle",""]],hostAttrs:[1,"mat-mdc-card-subtitle"]})}return i})();var lX=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275cmp=tt({type:i,selectors:[["mat-card-header"]],hostAttrs:[1,"mat-mdc-card-header"],ngContentSelectors:IDe,decls:4,vars:0,consts:[[1,"mat-mdc-card-header-text"]],template:function(r,n){r&1&&(Pi(LDe),Ot(0),Z(1,"div",0),Ot(2,1),Q(),Ot(3,2))},encapsulation:2,changeDetection:0})}return i})();var ia=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275mod=Lt({type:i});static \u0275inj=Dt({imports:[ti,ti]})}return i})();var II=new et("CdkAccordion"),cX=(()=>{class i{_stateChanges=new ct;_openCloseAllActions=new ct;id=te(Di).getId("cdk-accordion-");multi=!1;openAll(){this.multi&&this._openCloseAllActions.next(!0)}closeAll(){this._openCloseAllActions.next(!1)}ngOnChanges(t){this._stateChanges.next(t)}ngOnDestroy(){this._stateChanges.complete(),this._openCloseAllActions.complete()}static \u0275fac=function(r){return new(r||i)};static \u0275dir=ft({type:i,selectors:[["cdk-accordion"],["","cdkAccordion",""]],inputs:{multi:[2,"multi","multi",st]},exportAs:["cdkAccordion"],features:[ei([{provide:II,useExisting:i}]),si,rr]})}return i})(),uX=(()=>{class i{accordion=te(II,{optional:!0,skipSelf:!0});_changeDetectorRef=te(_i);_expansionDispatcher=te(Mf);_openCloseAllSubscription=tr.EMPTY;closed=new ut;opened=new ut;destroyed=new ut;expandedChange=new ut;id=te(Di).getId("cdk-accordion-child-");get expanded(){return this._expanded}set expanded(t){if(this._expanded!==t){if(this._expanded=t,this.expandedChange.emit(t),t){this.opened.emit();let r=this.accordion?this.accordion.id:this.id;this._expansionDispatcher.notify(this.id,r)}else this.closed.emit();this._changeDetectorRef.markForCheck()}}_expanded=!1;disabled=!1;_removeUniqueSelectionListener=()=>{};constructor(){}ngOnInit(){this._removeUniqueSelectionListener=this._expansionDispatcher.listen((t,r)=>{this.accordion&&!this.accordion.multi&&this.accordion.id===r&&this.id!==t&&(this.expanded=!1)}),this.accordion&&(this._openCloseAllSubscription=this._subscribeToOpenCloseAllActions())}ngOnDestroy(){this.opened.complete(),this.closed.complete(),this.destroyed.emit(),this.destroyed.complete(),this._removeUniqueSelectionListener(),this._openCloseAllSubscription.unsubscribe()}toggle(){this.disabled||(this.expanded=!this.expanded)}close(){this.disabled||(this.expanded=!1)}open(){this.disabled||(this.expanded=!0)}_subscribeToOpenCloseAllActions(){return this.accordion._openCloseAllActions.subscribe(t=>{this.disabled||(this.expanded=t)})}static \u0275fac=function(r){return new(r||i)};static \u0275dir=ft({type:i,selectors:[["cdk-accordion-item"],["","cdkAccordionItem",""]],inputs:{expanded:[2,"expanded","expanded",st],disabled:[2,"disabled","disabled",st]},outputs:{closed:"closed",opened:"opened",destroyed:"destroyed",expandedChange:"expandedChange"},exportAs:["cdkAccordionItem"],features:[ei([{provide:II,useValue:void 0}]),si]})}return i})(),hX=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275mod=Lt({type:i});static \u0275inj=Dt({})}return i})();var ODe=["body"],zDe=["bodyWrapper"],HDe=[[["mat-expansion-panel-header"]],"*",[["mat-action-row"]]],NDe=["mat-expansion-panel-header","*","mat-action-row"];function GDe(i,e){}var VDe=[[["mat-panel-title"]],[["mat-panel-description"]],"*"],KDe=["mat-panel-title","mat-panel-description","*"];function WDe(i,e){i&1&&(Z(0,"span",1),Sr(),Z(1,"svg",2),Ge(2,"path",3),Q()())}var FI=new et("MAT_ACCORDION"),dX=new et("MAT_EXPANSION_PANEL"),UDe=(()=>{class i{_template=te(Ta);_expansionPanel=te(dX,{optional:!0});constructor(){}static \u0275fac=function(r){return new(r||i)};static \u0275dir=ft({type:i,selectors:[["ng-template","matExpansionPanelContent",""]]})}return i})(),mX=new et("MAT_EXPANSION_PANEL_DEFAULT_OPTIONS"),qm=(()=>{class i extends uX{_viewContainerRef=te(sa);_animationsDisabled=te(nr,{optional:!0})==="NoopAnimations";_document=te(li);_ngZone=te(Kt);_elementRef=te(Et);_renderer=te(Wr);_cleanupTransitionEnd;get hideToggle(){return this._hideToggle||this.accordion&&this.accordion.hideToggle}set hideToggle(t){this._hideToggle=t}_hideToggle=!1;get togglePosition(){return this._togglePosition||this.accordion&&this.accordion.togglePosition}set togglePosition(t){this._togglePosition=t}_togglePosition;afterExpand=new ut;afterCollapse=new ut;_inputChanges=new ct;accordion=te(FI,{optional:!0,skipSelf:!0});_lazyContent;_body;_bodyWrapper;_portal;_headerId=te(Di).getId("mat-expansion-panel-header-");constructor(){super();let t=te(mX,{optional:!0});this._expansionDispatcher=te(Mf),t&&(this.hideToggle=t.hideToggle)}_hasSpacing(){return this.accordion?this.expanded&&this.accordion.displayMode==="default":!1}_getExpandedState(){return this.expanded?"expanded":"collapsed"}toggle(){this.expanded=!this.expanded}close(){this.expanded=!1}open(){this.expanded=!0}ngAfterContentInit(){this._lazyContent&&this._lazyContent._expansionPanel===this&&this.opened.pipe(ur(null),Yi(()=>this.expanded&&!this._portal),Ir(1)).subscribe(()=>{this._portal=new Xa(this._lazyContent._template,this._viewContainerRef)}),this._setupAnimationEvents()}ngOnChanges(t){this._inputChanges.next(t)}ngOnDestroy(){super.ngOnDestroy(),this._cleanupTransitionEnd?.(),this._inputChanges.complete()}_containsFocus(){if(this._body){let t=this._document.activeElement,r=this._body.nativeElement;return t===r||r.contains(t)}return!1}_transitionEndListener=({target:t,propertyName:r})=>{t===this._bodyWrapper?.nativeElement&&r==="grid-template-rows"&&this._ngZone.run(()=>{this.expanded?this.afterExpand.emit():this.afterCollapse.emit()})};_setupAnimationEvents(){this._ngZone.runOutsideAngular(()=>{this._animationsDisabled?(this.opened.subscribe(()=>this._ngZone.run(()=>this.afterExpand.emit())),this.closed.subscribe(()=>this._ngZone.run(()=>this.afterCollapse.emit()))):setTimeout(()=>{let t=this._elementRef.nativeElement;this._cleanupTransitionEnd=this._renderer.listen(t,"transitionend",this._transitionEndListener),t.classList.add("mat-expansion-panel-animations-enabled")},200)})}static \u0275fac=function(r){return new(r||i)};static \u0275cmp=tt({type:i,selectors:[["mat-expansion-panel"]],contentQueries:function(r,n,a){if(r&1&&Ki(a,UDe,5),r&2){let o;St(o=kt())&&(n._lazyContent=o.first)}},viewQuery:function(r,n){if(r&1&&(di(ODe,5),di(zDe,5)),r&2){let a;St(a=kt())&&(n._body=a.first),St(a=kt())&&(n._bodyWrapper=a.first)}},hostAttrs:[1,"mat-expansion-panel"],hostVars:4,hostBindings:function(r,n){r&2&>("mat-expanded",n.expanded)("mat-expansion-panel-spacing",n._hasSpacing())},inputs:{hideToggle:[2,"hideToggle","hideToggle",st],togglePosition:"togglePosition"},outputs:{afterExpand:"afterExpand",afterCollapse:"afterCollapse"},exportAs:["matExpansionPanel"],features:[ei([{provide:FI,useValue:void 0},{provide:dX,useExisting:i}]),si,Ai,rr],ngContentSelectors:NDe,decls:9,vars:4,consts:[["bodyWrapper",""],["body",""],[1,"mat-expansion-panel-content-wrapper"],["role","region",1,"mat-expansion-panel-content",3,"id"],[1,"mat-expansion-panel-body"],[3,"cdkPortalOutlet"]],template:function(r,n){r&1&&(Pi(HDe),Ot(0),Z(1,"div",2,0)(3,"div",3,1)(5,"div",4),Ot(6,1),je(7,GDe,0,0,"ng-template",5),Q(),Ot(8,2),Q()()),r&2&&(oe(),Mt("inert",n.expanded?null:""),oe(2),Re("id",n.id),Mt("aria-labelledby",n._headerId),oe(4),Re("cdkPortalOutlet",n._portal))},dependencies:[rc],styles:[".mat-expansion-panel{box-sizing:content-box;display:block;margin:0;overflow:hidden;position:relative;background:var(--mat-expansion-container-background-color, var(--mat-sys-surface));color:var(--mat-expansion-container-text-color, var(--mat-sys-on-surface));border-radius:var(--mat-expansion-container-shape, 12px)}.mat-expansion-panel.mat-expansion-panel-animations-enabled{transition:margin 225ms cubic-bezier(0.4, 0, 0.2, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel:not([class*=mat-elevation-z]){box-shadow:0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12)}.mat-accordion .mat-expansion-panel:not(.mat-expanded),.mat-accordion .mat-expansion-panel:not(.mat-expansion-panel-spacing){border-radius:0}.mat-accordion .mat-expansion-panel:first-of-type{border-top-right-radius:var(--mat-expansion-container-shape, 12px);border-top-left-radius:var(--mat-expansion-container-shape, 12px)}.mat-accordion .mat-expansion-panel:last-of-type{border-bottom-right-radius:var(--mat-expansion-container-shape, 12px);border-bottom-left-radius:var(--mat-expansion-container-shape, 12px)}@media(forced-colors: active){.mat-expansion-panel{outline:solid 1px}}.mat-expansion-panel-content-wrapper{display:grid;grid-template-rows:0fr;grid-template-columns:100%}.mat-expansion-panel-animations-enabled .mat-expansion-panel-content-wrapper{transition:grid-template-rows 225ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel.mat-expanded>.mat-expansion-panel-content-wrapper{grid-template-rows:1fr}@supports not (grid-template-rows: 0fr){.mat-expansion-panel-content-wrapper{height:0}.mat-expansion-panel.mat-expanded>.mat-expansion-panel-content-wrapper{height:auto}}.mat-expansion-panel-content{display:flex;flex-direction:column;overflow:visible;min-height:0;visibility:hidden;font-family:var(--mat-expansion-container-text-font, var(--mat-sys-body-large-font));font-size:var(--mat-expansion-container-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-expansion-container-text-weight, var(--mat-sys-body-large-weight));line-height:var(--mat-expansion-container-text-line-height, var(--mat-sys-body-large-line-height));letter-spacing:var(--mat-expansion-container-text-tracking, var(--mat-sys-body-large-tracking))}.mat-expansion-panel-animations-enabled .mat-expansion-panel-content{transition:visibility 190ms linear}.mat-expansion-panel.mat-expanded>.mat-expansion-panel-content-wrapper>.mat-expansion-panel-content{visibility:visible}.mat-expansion-panel-body{padding:0 24px 16px}.mat-expansion-panel-spacing{margin:16px 0}.mat-accordion>.mat-expansion-panel-spacing:first-child,.mat-accordion>*:first-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-top:0}.mat-accordion>.mat-expansion-panel-spacing:last-child,.mat-accordion>*:last-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-bottom:0}.mat-action-row{border-top-style:solid;border-top-width:1px;display:flex;flex-direction:row;justify-content:flex-end;padding:16px 8px 16px 24px;border-top-color:var(--mat-expansion-actions-divider-color, var(--mat-sys-outline))}.mat-action-row .mat-button-base,.mat-action-row .mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-action-row .mat-button-base,[dir=rtl] .mat-action-row .mat-mdc-button-base{margin-left:0;margin-right:8px}"],encapsulation:2,changeDetection:0})}return i})();var Zm=(()=>{class i{panel=te(qm,{host:!0});_element=te(Et);_focusMonitor=te(In);_changeDetectorRef=te(_i);_parentChangeSubscription=tr.EMPTY;constructor(){te(ar).load(kn);let t=this.panel,r=te(mX,{optional:!0}),n=te(new Ma("tabindex"),{optional:!0}),a=t.accordion?t.accordion._stateChanges.pipe(Yi(o=>!!(o.hideToggle||o.togglePosition))):Oo;this.tabIndex=parseInt(n||"")||0,this._parentChangeSubscription=vr(t.opened,t.closed,a,t._inputChanges.pipe(Yi(o=>!!(o.hideToggle||o.disabled||o.togglePosition)))).subscribe(()=>this._changeDetectorRef.markForCheck()),t.closed.pipe(Yi(()=>t._containsFocus())).subscribe(()=>this._focusMonitor.focusVia(this._element,"program")),r&&(this.expandedHeight=r.expandedHeight,this.collapsedHeight=r.collapsedHeight)}expandedHeight;collapsedHeight;tabIndex=0;get disabled(){return this.panel.disabled}_toggle(){this.disabled||this.panel.toggle()}_isExpanded(){return this.panel.expanded}_getExpandedState(){return this.panel._getExpandedState()}_getPanelId(){return this.panel.id}_getTogglePosition(){return this.panel.togglePosition}_showToggle(){return!this.panel.hideToggle&&!this.panel.disabled}_getHeaderHeight(){let t=this._isExpanded();return t&&this.expandedHeight?this.expandedHeight:!t&&this.collapsedHeight?this.collapsedHeight:null}_keydown(t){switch(t.keyCode){case 32:case 13:Hr(t)||(t.preventDefault(),this._toggle());break;default:this.panel.accordion&&this.panel.accordion._handleHeaderKeydown(t);return}}focus(t,r){t?this._focusMonitor.focusVia(this._element,t,r):this._element.nativeElement.focus(r)}ngAfterViewInit(){this._focusMonitor.monitor(this._element).subscribe(t=>{t&&this.panel.accordion&&this.panel.accordion._handleHeaderFocus(this)})}ngOnDestroy(){this._parentChangeSubscription.unsubscribe(),this._focusMonitor.stopMonitoring(this._element)}static \u0275fac=function(r){return new(r||i)};static \u0275cmp=tt({type:i,selectors:[["mat-expansion-panel-header"]],hostAttrs:["role","button",1,"mat-expansion-panel-header","mat-focus-indicator"],hostVars:13,hostBindings:function(r,n){r&1&&Le("click",function(){return n._toggle()})("keydown",function(o){return n._keydown(o)}),r&2&&(Mt("id",n.panel._headerId)("tabindex",n.disabled?-1:n.tabIndex)("aria-controls",n._getPanelId())("aria-expanded",n._isExpanded())("aria-disabled",n.panel.disabled),yr("height",n._getHeaderHeight()),gt("mat-expanded",n._isExpanded())("mat-expansion-toggle-indicator-after",n._getTogglePosition()==="after")("mat-expansion-toggle-indicator-before",n._getTogglePosition()==="before"))},inputs:{expandedHeight:"expandedHeight",collapsedHeight:"collapsedHeight",tabIndex:[2,"tabIndex","tabIndex",t=>t==null?0:lr(t)]},features:[si],ngContentSelectors:KDe,decls:5,vars:3,consts:[[1,"mat-content"],[1,"mat-expansion-indicator"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 -960 960 960","aria-hidden","true","focusable","false"],["d","M480-345 240-585l56-56 184 184 184-184 56 56-240 240Z"]],template:function(r,n){r&1&&(Pi(VDe),Z(0,"span",0),Ot(1),Ot(2,1),Ot(3,2),Q(),je(4,WDe,3,0,"span",1)),r&2&&(gt("mat-content-hide-toggle",!n._showToggle()),oe(4),Je(n._showToggle()?4:-1))},styles:['.mat-expansion-panel-header{display:flex;flex-direction:row;align-items:center;padding:0 24px;border-radius:inherit;height:var(--mat-expansion-header-collapsed-state-height, 48px);font-family:var(--mat-expansion-header-text-font, var(--mat-sys-title-medium-font));font-size:var(--mat-expansion-header-text-size, var(--mat-sys-title-medium-size));font-weight:var(--mat-expansion-header-text-weight, var(--mat-sys-title-medium-weight));line-height:var(--mat-expansion-header-text-line-height, var(--mat-sys-title-medium-line-height));letter-spacing:var(--mat-expansion-header-text-tracking, var(--mat-sys-title-medium-tracking))}.mat-expansion-panel-animations-enabled .mat-expansion-panel-header{transition:height 225ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel-header::before{border-radius:inherit}.mat-expansion-panel-header.mat-expanded{height:var(--mat-expansion-header-expanded-state-height, 64px)}.mat-expansion-panel-header[aria-disabled=true]{color:var(--mat-expansion-header-disabled-state-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-expansion-panel-header:not([aria-disabled=true]){cursor:pointer}.mat-expansion-panel:not(.mat-expanded) .mat-expansion-panel-header:not([aria-disabled=true]):hover{background:var(--mat-expansion-header-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))}@media(hover: none){.mat-expansion-panel:not(.mat-expanded) .mat-expansion-panel-header:not([aria-disabled=true]):hover{background:var(--mat-expansion-container-background-color, var(--mat-sys-surface))}}.mat-expansion-panel .mat-expansion-panel-header:not([aria-disabled=true]).cdk-keyboard-focused,.mat-expansion-panel .mat-expansion-panel-header:not([aria-disabled=true]).cdk-program-focused{background:var(--mat-expansion-header-focus-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-focus-state-layer-opacity) * 100%), transparent))}.mat-expansion-panel-header._mat-animation-noopable{transition:none}.mat-expansion-panel-header:focus,.mat-expansion-panel-header:hover{outline:none}.mat-expansion-panel-header.mat-expanded:focus,.mat-expansion-panel-header.mat-expanded:hover{background:inherit}.mat-expansion-panel-header.mat-expansion-toggle-indicator-before{flex-direction:row-reverse}.mat-expansion-panel-header.mat-expansion-toggle-indicator-before .mat-expansion-indicator{margin:0 16px 0 0}[dir=rtl] .mat-expansion-panel-header.mat-expansion-toggle-indicator-before .mat-expansion-indicator{margin:0 0 0 16px}.mat-content{display:flex;flex:1;flex-direction:row;overflow:hidden}.mat-content.mat-content-hide-toggle{margin-right:8px}[dir=rtl] .mat-content.mat-content-hide-toggle{margin-right:0;margin-left:8px}.mat-expansion-toggle-indicator-before .mat-content.mat-content-hide-toggle{margin-left:24px;margin-right:0}[dir=rtl] .mat-expansion-toggle-indicator-before .mat-content.mat-content-hide-toggle{margin-right:24px;margin-left:0}.mat-expansion-panel-header-title{color:var(--mat-expansion-header-text-color, var(--mat-sys-on-surface))}.mat-expansion-panel-header-title,.mat-expansion-panel-header-description{display:flex;flex-grow:1;flex-basis:0;margin-right:16px;align-items:center}[dir=rtl] .mat-expansion-panel-header-title,[dir=rtl] .mat-expansion-panel-header-description{margin-right:0;margin-left:16px}.mat-expansion-panel-header[aria-disabled=true] .mat-expansion-panel-header-title,.mat-expansion-panel-header[aria-disabled=true] .mat-expansion-panel-header-description{color:inherit}.mat-expansion-panel-header-description{flex-grow:2;color:var(--mat-expansion-header-description-color, var(--mat-sys-on-surface-variant))}.mat-expansion-panel-animations-enabled .mat-expansion-indicator{transition:transform 225ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel-header.mat-expanded .mat-expansion-indicator{transform:rotate(180deg)}.mat-expansion-indicator::after{border-style:solid;border-width:0 2px 2px 0;content:"";display:inline-block;padding:3px;transform:rotate(45deg);vertical-align:middle;color:var(--mat-expansion-header-indicator-color, var(--mat-sys-on-surface-variant));display:var(--mat-expansion-legacy-header-indicator-display, none)}.mat-expansion-indicator svg{width:24px;height:24px;margin:0 -8px;vertical-align:middle;fill:var(--mat-expansion-header-indicator-color, var(--mat-sys-on-surface-variant));display:var(--mat-expansion-header-indicator-display, inline-block)}@media(forced-colors: active){.mat-expansion-panel-content{border-top:1px solid;border-top-left-radius:0;border-top-right-radius:0}}'],encapsulation:2,changeDetection:0})}return i})();var iy=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275dir=ft({type:i,selectors:[["mat-panel-title"]],hostAttrs:[1,"mat-expansion-panel-header-title"]})}return i})(),ry=(()=>{class i extends cX{_keyManager;_ownHeaders=new jc;_headers;hideToggle=!1;displayMode="default";togglePosition="after";ngAfterContentInit(){this._headers.changes.pipe(ur(this._headers)).subscribe(t=>{this._ownHeaders.reset(t.filter(r=>r.panel.accordion===this)),this._ownHeaders.notifyOnChanges()}),this._keyManager=new yh(this._ownHeaders).withWrap().withHomeAndEnd()}_handleHeaderKeydown(t){this._keyManager.onKeydown(t)}_handleHeaderFocus(t){this._keyManager.updateActiveItem(t)}ngOnDestroy(){super.ngOnDestroy(),this._keyManager?.destroy(),this._ownHeaders.destroy()}static \u0275fac=(()=>{let t;return function(n){return(t||(t=kr(i)))(n||i)}})();static \u0275dir=ft({type:i,selectors:[["mat-accordion"]],contentQueries:function(r,n,a){if(r&1&&Ki(a,Zm,5),r&2){let o;St(o=kt())&&(n._headers=o)}},hostAttrs:[1,"mat-accordion"],hostVars:2,hostBindings:function(r,n){r&2&>("mat-accordion-multi",n.multi)},inputs:{hideToggle:[2,"hideToggle","hideToggle",st],displayMode:"displayMode",togglePosition:"togglePosition"},exportAs:["matAccordion"],features:[ei([{provide:FI,useExisting:i}]),si,Ai]})}return i})(),kc=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275mod=Lt({type:i});static \u0275inj=Dt({imports:[ti,hX,nc]})}return i})();var pX=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275mod=Lt({type:i});static \u0275inj=Dt({imports:[ti,ti]})}return i})();var yVt=go(mG());var eh=go(ny());var OUe=`attribute vec2 aVertexPosition;
|
1701
1701
|
attribute vec2 aTextureCoord;
|
@@ -3645,4 +3645,4 @@ void main(void)\r
|
|
3645
3645
|
font-weight: ${t.weight};
|
3646
3646
|
font-style: ${t.style};
|
3647
3647
|
font-display: ${t.display};
|
3648
|
-
}`,this._stylesheet)}get stylesheet(){return this._stylesheet}set stylesheet(e){this._stylesheet!==e&&(this._stylesheet=e,this.styleID++)}normalizeColor(e){return Array.isArray(e)&&(e=ot.rgb2hex(e)),typeof e=="number"?ot.hex2string(e):e}dropShadowToCSS(){let e=this.normalizeColor(this.dropShadowColor),t=this.dropShadowAlpha,r=Math.round(Math.cos(this.dropShadowAngle)*this.dropShadowDistance),n=Math.round(Math.sin(this.dropShadowAngle)*this.dropShadowDistance);e.startsWith("#")&&t<1&&(e+=(t*255|0).toString(16).padStart(2,"0"));let a=`${r}px ${n}px`;return this.dropShadowBlur>0?`text-shadow: ${a} ${this.dropShadowBlur}px ${e}`:`text-shadow: ${a} ${e}`}reset(){Object.assign(this,l_.defaultOptions)}onBeforeDraw(){let{fontsDirty:e}=this;return this.fontsDirty=!1,this.isSafari&&this._fonts.length>0&&e?new Promise(t=>setTimeout(t,100)):Promise.resolve()}get isSafari(){let{userAgent:e}=Qe.ADAPTER.getNavigator();return/^((?!chrome|android).)*safari/i.test(e)}set fillGradientStops(e){console.warn("[HTMLTextStyle] fillGradientStops is not supported by HTMLText")}get fillGradientStops(){return super.fillGradientStops}set fillGradientType(e){console.warn("[HTMLTextStyle] fillGradientType is not supported by HTMLText")}get fillGradientType(){return super.fillGradientType}set miterLimit(e){console.warn("[HTMLTextStyle] miterLimit is not supported by HTMLText")}get miterLimit(){return super.miterLimit}set trim(e){console.warn("[HTMLTextStyle] trim is not supported by HTMLText")}get trim(){return super.trim}set textBaseline(e){console.warn("[HTMLTextStyle] textBaseline is not supported by HTMLText")}get textBaseline(){return super.textBaseline}set leading(e){console.warn("[HTMLTextStyle] leading is not supported by HTMLText")}get leading(){return super.leading}set lineJoin(e){console.warn("[HTMLTextStyle] lineJoin is not supported by HTMLText")}get lineJoin(){return super.lineJoin}};v5.availableFonts={},v5.defaultOptions={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,padding:0,stroke:"black",strokeThickness:0,whiteSpace:"normal",wordWrap:!1,wordWrapWidth:100};var bk=v5;var aA=class c_ extends _a{constructor(e="",t={}){super(Ft.EMPTY),this._text=null,this._style=null,this._autoResolution=!0,this.localStyleID=-1,this.dirty=!1,this._updateID=0,this.ownsStyle=!1;let r=new Image,n=Ft.from(r,{scaleMode:Qe.SCALE_MODE,resourceOptions:{autoLoad:!1}});n.orig=new Xt,n.trim=new Xt,this.texture=n;let a="http://www.w3.org/2000/svg",o="http://www.w3.org/1999/xhtml",s=document.createElementNS(a,"svg"),l=document.createElementNS(a,"foreignObject"),c=document.createElementNS(o,"div"),u=document.createElementNS(o,"style");l.setAttribute("width","10000"),l.setAttribute("height","10000"),l.style.overflow="hidden",s.appendChild(l),this.maxWidth=c_.defaultMaxWidth,this.maxHeight=c_.defaultMaxHeight,this._domElement=c,this._styleElement=u,this._svgRoot=s,this._foreignObject=l,this._foreignObject.appendChild(u),this._foreignObject.appendChild(c),this._image=r,this._loadImage=new Image,this._autoResolution=c_.defaultAutoResolution,this._resolution=c_.defaultResolution??Qe.RESOLUTION,this.text=e,this.style=t}measureText(e){let{text:t,style:r,resolution:n}=Object.assign({text:this._text,style:this._style,resolution:this._resolution},e);Object.assign(this._domElement,{innerHTML:t,style:r.toCSS(n)}),this._styleElement.textContent=r.toGlobalCSS(),document.body.appendChild(this._svgRoot);let a=this._domElement.getBoundingClientRect();this._svgRoot.remove();let{width:o,height:s}=a;(o>this.maxWidth||s>this.maxHeight)&&console.warn("[HTMLText] Large expanse of text, increase HTMLText.maxWidth or HTMLText.maxHeight property.");let l=Math.min(this.maxWidth,Math.ceil(o)),c=Math.min(this.maxHeight,Math.ceil(s));return this._svgRoot.setAttribute("width",l.toString()),this._svgRoot.setAttribute("height",c.toString()),t!==this._text&&(this._domElement.innerHTML=this._text),r!==this._style&&(Object.assign(this._domElement,{style:this._style?.toCSS(n)}),this._styleElement.textContent=this._style?.toGlobalCSS()),{width:l+r.padding*2,height:c+r.padding*2}}updateText(e=!0){return Ce(this,null,function*(){let{style:t,_image:r,_loadImage:n}=this;if(this.localStyleID!==t.styleID&&(this.dirty=!0,this.localStyleID=t.styleID),!this.dirty&&e)return;let{width:a,height:o}=this.measureText();r.width=n.width=Math.ceil(Math.max(1,a)),r.height=n.height=Math.ceil(Math.max(1,o)),this._updateID++;let s=this._updateID;yield new Promise(l=>{n.onload=()=>Ce(this,null,function*(){if(s<this._updateID){l();return}yield t.onBeforeDraw(),r.src=n.src,n.onload=null,n.src="",this.updateTexture(),l()});let c=new XMLSerializer().serializeToString(this._svgRoot);n.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(c)}`})})}get source(){return this._image}updateTexture(){let{style:e,texture:t,_image:r,resolution:n}=this,{padding:a}=e,{baseTexture:o}=t;t.trim.width=t._frame.width=r.width/n,t.trim.height=t._frame.height=r.height/n,t.trim.x=-a,t.trim.y=-a,t.orig.width=t._frame.width-a*2,t.orig.height=t._frame.height-a*2,this._onTextureUpdate(),o.setRealSize(r.width,r.height,n),this.dirty=!1}_render(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),super._render(e)}_renderCanvas(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),super._renderCanvas(e)}getLocalBounds(e){return this.updateText(!0),super.getLocalBounds(e)}_calculateBounds(){this.updateText(!0),this.calculateVertices(),this._bounds.addQuad(this.vertexData)}_onStyleChange(){this.dirty=!0}destroy(e){typeof e=="boolean"&&(e={children:e}),e=Object.assign({},c_.defaultDestroyOptions,e),super.destroy(e);let t=null;this.ownsStyle&&this._style?.cleanFonts(),this._style=t,this._svgRoot?.remove(),this._svgRoot=t,this._domElement?.remove(),this._domElement=t,this._foreignObject?.remove(),this._foreignObject=t,this._styleElement?.remove(),this._styleElement=t,this._loadImage.src="",this._loadImage.onload=null,this._loadImage=t,this._image.src="",this._image=t}get width(){return this.updateText(!0),Math.abs(this.scale.x)*this._image.width/this.resolution}set width(e){this.updateText(!0);let t=ot.sign(this.scale.x)||1;this.scale.x=t*e/this._image.width/this.resolution,this._width=e}get height(){return this.updateText(!0),Math.abs(this.scale.y)*this._image.height/this.resolution}set height(e){this.updateText(!0);let t=ot.sign(this.scale.y)||1;this.scale.y=t*e/this._image.height/this.resolution,this._height=e}get style(){return this._style}set style(e){this._style!==e&&(e=e||{},e instanceof bk?(this.ownsStyle=!1,this._style=e):e instanceof Fo?(console.warn("[HTMLText] Cloning TextStyle, if this is not what you want, use HTMLTextStyle"),this.ownsStyle=!0,this._style=bk.from(e)):(this.ownsStyle=!0,this._style=new bk(e)),this.localStyleID=-1,this.dirty=!0)}get text(){return this._text}set text(e){e=String(e===""||e===null||e===void 0?" ":e),e=this.sanitiseText(e),this._text!==e&&(this._text=e,this.dirty=!0)}get resolution(){return this._resolution}set resolution(e){this._autoResolution=!1,this._resolution!==e&&(this._resolution=e,this.dirty=!0)}sanitiseText(e){return e.replace(/<br>/gi,"<br/>").replace(/<hr>/gi,"<hr/>").replace(/ /gi," ")}};aA.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},aA.defaultMaxWidth=2024,aA.defaultMaxHeight=2024,aA.defaultAutoResolution=!0;function S5(i){return i.entity.entityType==="passenger"}function $de(i){return i.entity.entityType==="vehicle"}var xd=class i{constructor(e){this.simulationService=e;Ji(()=>{this.loadFavoritesFromLocalStorage()}),Ji(()=>{this.saveFavoritesToLocalStorage()})}VERSION=2;KEY_FAVORITES_PREFIX="multimodal.favorites.";_favoriteEntitiesSignal=Bt([]);_simulationFavKey=$t(()=>{let e=this.simulationService.activeSimulationSignal();return e?`${this.KEY_FAVORITES_PREFIX}${e.id}`:null});get favoriteEntitiesSignal(){return this._favoriteEntitiesSignal}toggleFavoriteEntity(e){this._favoriteEntitiesSignal.update(t=>(t.find(r=>r.id===e.id&&r.entityType===e.entityType)?t=t.filter(r=>r.id!==e.id||r.entityType!==e.entityType):t.push(e),[...this.sortFavorites(t)]))}isFavoriteEntity(e){return this._favoriteEntitiesSignal().some(t=>t.id===e.id&&t.entityType===e.entityType)}loadFavoritesFromLocalStorage(){let e=this._simulationFavKey();if(e===null)return;let t=localStorage.getItem(e);if(!t)return;let r=JSON.parse(t);!r.version||r.version!==this.VERSION||Array.isArray(r.favoriteEntities)&&this._favoriteEntitiesSignal.set(this.sortFavorites(r.favoriteEntities))}saveFavoritesToLocalStorage(){let e=this._simulationFavKey();if(e===null)return;let t={version:this.VERSION,favoriteEntities:this._favoriteEntitiesSignal()};localStorage.setItem(e,JSON.stringify(t))}sortFavorites(e){return e.sort((t,r)=>t.entityType!==r.entityType?t.entityType.localeCompare(r.entityType):t.name.localeCompare(r.name))}static \u0275fac=function(t){return new(t||i)(Zt(Ha))};static \u0275prov=lt({token:i,factory:i.\u0275fac,providedIn:"root"})};var Mr=class i{constructor(e,t,r){this.favoriteEntitiesService=e;this.spritesService=t;this.taskService=r;xp.load(this.BITMAP_TEXT_URL).then(()=>{this.fontsLoaded=!0}),this.mainContainer.addChild(this.backgroundContainer),this.mainContainer.addChild(this.polylinesContainer),this.mainContainer.addChild(this.entitiesContainer)}MAXIMUM_ALLOWED_DESYNCHRONIZATION_DIFFERENCE=1.5;WHITE=16777215;BITMAP_TEXT_URL="bitmap-fonts/custom-sans-serif.xml";BITMAP_TEXT_STYLE={fontName:"custom-sans-serif",fontSize:18};POLYLINE_WIDTH=4;POLYLINE_MIN_WIDTH=.04;POLYLINE_ALPHA=.9;POLYLINE_COMPLETE_COLOR=6710886;POLYLINE_REMAINING_COLOR=166415;SAFETY_RATIO=.95;MIN_FRAME_RATE=60;MIN_TASK_ALLOCATION=5;MIN_TIME_PER_FRAME=1e3/this.MIN_FRAME_RATE*this.SAFETY_RATIO;nextContinuousEnvironments=[];nextWantedVisualizationTime=null;nextPolylines=null;nextIsPaused=!1;nextSpeed=1;nextFilters=new Set;nextFilterMode="all";nextShouldShowComplete=!1;nextShouldCenterMap=!1;nextShouldFollowEntity=!1;nextClickEvent=null;nextHighlightedLegIndex=null;nextShouldFindCloseEntities=!1;continuousEnvironments=[];wantedVisualizationTime=null;animationVisualizationTime=0;polylines=null;hasCenteredInitially=!1;isPaused=!1;speed=1;vehicleEntities=[];vehicleEntitiesByVehicleId={};passengersEntities=[];passengerEntitiesByPassengerId={};stopEntities=[];stopEntitiesByPosition={};presentVehicleEntities=[];presentPassengerEntities=[];presentStopEntities=[];entitiesContainer=new cr;polylinesContainer=new cr;backgroundContainer=new cr;mainContainer=new cr;selectedEntityPolylines=[];filters=new Set;filterMode="all";shouldShowComplete=!1;shouldCenterMap=!1;shouldFindCloseEntities=!1;highlightedLegIndex=null;clickEvent=null;fontsLoaded=!1;_selectedEntitySignal=Bt(null);_preselectedEntitySignal=Bt(null);_clickPositionSignal=Bt(null);_closeEntitiesSignal=Bt([]);_shouldFollowEntitySignal=Bt(!1);get closeEntitiesSignal(){return this._closeEntitiesSignal}get preselectedEntitySignal(){return this._preselectedEntitySignal}get selectedEntitySignal(){return this._selectedEntitySignal}get clickPositionSignal(){return this._clickPositionSignal}get shouldFollowEntitySignal(){return this._shouldFollowEntitySignal}setPause(e){this.nextIsPaused=e}setFilters(e){this.nextFilters=e}setFilterMode(e){this.nextFilterMode=e}setShouldShowComplete(e){this.nextShouldShowComplete=e}setSpeed(e){this.nextSpeed=e}toggleShouldFollowEntity(){this.nextShouldFollowEntity=!this.nextShouldFollowEntity}centerMap(){this.nextShouldFollowEntity=!1,this.nextShouldCenterMap=!0}highlightLeg(e){this.nextHighlightedLegIndex=e}unhighlightLeg(){this.nextHighlightedLegIndex=null}preselectEntity(e,t){this._preselectedEntitySignal.set(at(ye({},e),{shouldShowSelectedEntityTab:t}))}unpreselectEntity(){this._preselectedEntitySignal.set(null)}selectEntity(e){this._preselectedEntitySignal.set(null),this._selectedEntitySignal.set(e)}unselectEntity(){this._selectedEntitySignal.set(null),this.nextHighlightedLegIndex=null}clickHandled(){this.nextClickEvent=null,this.nextShouldFindCloseEntities=!1}updateEnvironment(e){this.nextContinuousEnvironments=e}updateWantedVisualizationTime(e){this.nextWantedVisualizationTime=e}updatePolylines(e){this.nextPolylines=e}clearAnimations(){this.nextContinuousEnvironments=[],this.nextWantedVisualizationTime=null,this.nextPolylines=null,this.nextIsPaused=!1,this.nextSpeed=1,this.nextFilters.clear(),this.nextFilterMode="all",this.nextShouldShowComplete=!1,this.nextShouldCenterMap=!1,this.nextShouldFollowEntity=!1,this.nextClickEvent=null,this.nextHighlightedLegIndex=null,this.continuousEnvironments=[],this.wantedVisualizationTime=null,this.animationVisualizationTime=0,this.polylines=null,this.hasCenteredInitially=!1,this.isPaused=!1,this.speed=1,this.vehicleEntities=[],this.vehicleEntitiesByVehicleId={},this.passengersEntities=[],this.passengerEntitiesByPassengerId={},this.stopEntities=[],this.stopEntitiesByPosition={},this.entitiesContainer.removeChildren(),this.backgroundContainer.removeChildren(),this.selectedEntityPolylines.forEach(e=>e.clear()),this.filters.clear(),this.filterMode="all",this.shouldShowComplete=!1,this.shouldCenterMap=!1,this.nextShouldFindCloseEntities=!1,this.clickEvent=null,this.highlightedLegIndex=null,this._selectedEntitySignal.set(null),this._preselectedEntitySignal.set(null),this._clickPositionSignal.set(null),this._closeEntitiesSignal.set([]),this._shouldFollowEntitySignal.set(!1)}addPixiOverlay(e){e.on("click",a=>{this.onClick(a)});let t=(0,eh.pixiOverlay)((a,o)=>{o.type==="redraw"&&this.onRedraw(a),a.getRenderer().render(this.mainContainer)},this.mainContainer,{doubleBuffering:!0});t.addTo(e);let r=new sn,n=Number.POSITIVE_INFINITY;r.add(a=>{t.redraw({type:"redraw",delta:a});let o=performance.now();this.taskService.processTasks(Math.max(n+this.MIN_TIME_PER_FRAME,o+this.MIN_TASK_ALLOCATION)),n=performance.now()}),r.start()}onRedraw(e){if(!this.fontsLoaded||(this.continuousEnvironments=this.nextContinuousEnvironments,this.wantedVisualizationTime=this.nextWantedVisualizationTime,this.polylines=this.nextPolylines,this.isPaused=this.nextIsPaused,this.speed=this.nextSpeed,this.filters=this.nextFilters,this.filterMode=this.nextFilterMode,this.shouldShowComplete=this.nextShouldShowComplete,this.shouldCenterMap=this.nextShouldCenterMap,this.nextShouldCenterMap=!1,this.clickEvent=this.nextClickEvent,this.highlightedLegIndex=this.nextHighlightedLegIndex,this.shouldFindCloseEntities=this.nextShouldFindCloseEntities,this._shouldFollowEntitySignal.set(this.nextShouldFollowEntity),this.wantedVisualizationTime===null)||this.continuousEnvironments.length===0||this.polylines===null)return;this.updateAnimationTime();let t=cM(this.continuousEnvironments,this.animationVisualizationTime);if(t===null)return;let r=uM(t,this.animationVisualizationTime);this.spritesService.calculateSpriteScales(e),this.resetEntities(),this.createEntities(r,e),this.filterEntities(r);let n=this.updateSelectedEntity(),o=this.updatePreselectedEntity()??n;this.updateEntities(),this.setEntityPositions(e),this.updateCounters(),this.highlightSelectedEntity(o),this.updateTextures(),this.drawSelectedEntityPolylines(o,e),this.setMapPosition(o,e),this.findCloseEntities(e)}updateAnimationTime(){if(this.wantedVisualizationTime===null)return;let e=Math.min(this.wantedVisualizationTime,this.animationVisualizationTime),t=Math.max(this.wantedVisualizationTime,this.animationVisualizationTime);if(!G$(this.continuousEnvironments,e,t)){this.animationVisualizationTime=this.wantedVisualizationTime;return}let r=sn.shared.deltaMS/1e3;this.isPaused?this.animationVisualizationTime=this.wantedVisualizationTime:this.animationVisualizationTime+=r*this.speed;let n=this.wantedVisualizationTime-this.animationVisualizationTime;Math.abs(n)>this.MAXIMUM_ALLOWED_DESYNCHRONIZATION_DIFFERENCE*this.speed&&(this.animationVisualizationTime+=n*(1-Math.exp(-5*Math.abs(r))))}onClick(e){this.nextClickEvent=e,this.nextShouldFindCloseEntities=!0}resetEntities(){for(let e of this.vehicleEntities)e.isPresent=!1,e.isPreselected=!1,e.isSelected=!1,e.isVisible=!1,e.isFiltered=!1,e.entity.error=null,e.additionalInformation.passengerIds=[],e.additionalInformation.numberOfPassengers=0,e.additionalInformation.numberOfNotVisiblePassengers=0,e.additionalInformation.stop=null,e.additionalInformation.polylines=[],e.additionalInformation.polylineIndex=null,e.additionalInformation.polylineSegmentIndex=null,e.additionalInformation.polylineSegmentProgress=null;for(let e of this.passengersEntities)e.isPresent=!1,e.isPreselected=!1,e.isSelected=!1,e.isVisible=!1,e.isFiltered=!1,e.entity.error=null,e.additionalInformation.stop=null,e.additionalInformation.vehicle=null;for(let e of this.stopEntities)e.isPresent=!1,e.isPreselected=!1,e.isSelected=!1,e.isVisible=!1,e.isFiltered=!1,e.entity.error=null,e.additionalInformation.passengerIds=[],e.additionalInformation.numberOfPassengers=0,e.additionalInformation.numberOfCompletePassengers=0,e.additionalInformation.numberOfNotVisiblePassengers=0,e.additionalInformation.numberOfNotVisibleCompletePassengers=0}createEntities(e,t){this.presentVehicleEntities=[],this.presentPassengerEntities=[],this.presentStopEntities=[];for(let r of e.allVehicles){let n=this.vehicleEntitiesByVehicleId[r.id];n===void 0?this.addVehicle(r):(n.entity=r,n.isPresent=!0,this.presentVehicleEntities.push(n))}for(let r of e.allPassengers){let n=this.passengerEntitiesByPassengerId[r.id];n===void 0?this.addPassenger(r):(n.entity=r,n.isPresent=!0,this.presentPassengerEntities.push(n))}for(let r of e.allStops){let n=this.stopEntitiesByPosition[r.id];n===void 0?this.addStop(r,t):(n.entity=r,n.isPresent=!0,this.presentStopEntities.push(n))}}addVehicle(e){let t=new cr,r=new cr,n=new $u;r.addChild(n);let a=new _a;a.anchor.set(.5,.5),t.addChild(a);let o=new _k("",this.BITMAP_TEXT_STYLE);t.addChild(o);let s=new _a;s.anchor.set(.5,.5),t.addChild(s);let l={entity:e,additionalInformation:{passengerIds:[],numberOfPassengers:0,numberOfNotVisiblePassengers:0,stop:null,polylines:[],polylineIndex:null,polylineSegmentIndex:null,polylineSegmentProgress:null},sprites:[a,s],texts:[o],graphics:[n],container:t,backgroundContainer:r,isPresent:!0,isFiltered:!1,isPreselected:!1,isSelected:!1,isVisible:!1};this.entitiesContainer.addChild(t),this.backgroundContainer.addChild(r),this.vehicleEntities.push(l),this.presentVehicleEntities.push(l),this.vehicleEntitiesByVehicleId[e.id]=l}addPassenger(e){let t=new cr,r=new cr,n=new $u;r.addChild(n);let a={entity:e,additionalInformation:{stop:null,vehicle:null},sprites:[],texts:[],graphics:[n],container:t,backgroundContainer:r,isPresent:!0,isFiltered:!1,isPreselected:!1,isSelected:!1,isVisible:!1};this.entitiesContainer.addChild(t),this.backgroundContainer.addChild(r),this.passengersEntities.push(a),this.presentPassengerEntities.push(a),this.passengerEntitiesByPassengerId[e.id]=a}addStop(e,t){let r=new cr,n=new cr,a=new $u;n.addChild(a);let o=new _a;o.anchor.set(.5,.5),r.addChild(o);let s=new _k("",this.BITMAP_TEXT_STYLE);r.addChild(s);let l=new _k("",this.BITMAP_TEXT_STYLE);r.addChild(l);let c=new _a;c.anchor.set(.5,.5),r.addChild(c);let u={entity:e,additionalInformation:{passengerIds:[],numberOfPassengers:0,numberOfCompletePassengers:0,numberOfNotVisiblePassengers:0,numberOfNotVisibleCompletePassengers:0},sprites:[o,c],texts:[s,l],graphics:[a],container:r,backgroundContainer:n,isPresent:!0,isFiltered:!1,isPreselected:!1,isSelected:!1,isVisible:!1},h=t.latLngToLayerPoint([e.position.latitude,e.position.longitude]);r.x=h.x,r.y=h.y,this.entitiesContainer.addChild(r),this.backgroundContainer.addChild(n),this.stopEntities.push(u),this.presentStopEntities.push(u),this.stopEntitiesByPosition[e.id]=u}filterEntities(e){let t=this.filters,r=!t.has("vehicle"),n=!t.has("passenger"),a=!t.has("stops"),o=this.filterMode==="favorites",s=this.shouldShowComplete;for(let l of this.presentVehicleEntities)l.isVisible=e.vehicles[l.entity.id]!==void 0&&r&&!t.has(l.entity.mode??"unknown")&&(!o||this.favoriteEntitiesService.isFavoriteEntity(l.entity))&&(s||l.entity.status!=="complete"),l.isFiltered=!l.isVisible;for(let l of this.presentPassengerEntities)l.isVisible=e.passengers[l.entity.id]!==void 0&&n&&(!o||this.favoriteEntitiesService.isFavoriteEntity(l.entity))&&(s||l.entity.status!=="complete"),l.isFiltered=!l.isVisible;for(let l of this.presentStopEntities)l.isVisible=e.stops[l.entity.id]!==void 0&&a&&(!o||this.favoriteEntitiesService.isFavoriteEntity(l.entity)),l.isFiltered=!l.isVisible}updatePreselectedEntity(){let e=this._preselectedEntitySignal();if(e!==null)switch(e.entityType){case"vehicle":{let t=this.vehicleEntitiesByVehicleId[e.id];if(t&&t.isPresent)return t.isPreselected=!0,t.isVisible=!0,t;this._preselectedEntitySignal.set(null);break}case"passenger":{let t=this.passengerEntitiesByPassengerId[e.id];if(t&&t.isPresent)return t.isPreselected=!0,t.isVisible=!0,t;this._preselectedEntitySignal.set(null);break}case"stop":{let t=this.stopEntitiesByPosition[e.id];if(t&&t.isPresent)return t.isPreselected=!0,t.isVisible=!0,t;this._preselectedEntitySignal.set(null);break}}return null}hadSelectedEntity=!1;updateSelectedEntity(){if(this._preselectedEntitySignal()!==null)return this.hadSelectedEntity=!1,null;let t=this._selectedEntitySignal();if(t===null)return this.hadSelectedEntity=!1,null;switch(t.entityType){case"vehicle":{let r=this.vehicleEntitiesByVehicleId[t.id];if(r&&r.isPresent)return r.isSelected=!0,r.isVisible=!0,this.hadSelectedEntity||(this.hadSelectedEntity=!0),r;this._selectedEntitySignal.set(null);break}case"passenger":{let r=this.passengerEntitiesByPassengerId[t.id];if(r&&r.isPresent)return r.isSelected=!0,r.isVisible=!0,this.hadSelectedEntity||(this.hadSelectedEntity=!0),r;this._selectedEntitySignal.set(null);break}case"stop":{let r=this.stopEntitiesByPosition[t.id];if(r&&r.isPresent)return r.isSelected=!0,r.isVisible=!0,this.hadSelectedEntity||(this.hadSelectedEntity=!0),r;this._selectedEntitySignal.set(null);break}}return null}updateEntities(){this.updateOnPassengerLegs(),this.updateOnVehicleStops()}updateOnPassengerLegs(){for(let e of this.presentPassengerEntities){let t=e.entity.currentLeg??e.entity.nextLegs[0]??e.entity.previousLegs[e.entity.previousLegs.length-1]??null;if(t===null){e.isVisible=!1,e.entity.error="No leg";continue}if(t.boardingTime===null||t.boardingTime>this.animationVisualizationTime){if(t.boardingStopId===null){e.isVisible=!1,e.entity.error="No boarding stop";continue}let n=this.stopEntitiesByPosition[t.boardingStopId];if(n===void 0){e.isVisible=!1,e.entity.error="Boarding stop not found";continue}if(!n.isPresent){e.isVisible=!1,e.entity.error="Boarding stop not present";continue}if(!e.isVisible){e.entity.status==="complete"?n.additionalInformation.numberOfNotVisibleCompletePassengers+=e.entity.numberOfPassengers:n.additionalInformation.numberOfNotVisiblePassengers+=e.entity.numberOfPassengers;continue}n.isVisible=!0,n.additionalInformation.passengerIds.push(e.entity.id),e.entity.status==="complete"?n.additionalInformation.numberOfCompletePassengers+=e.entity.numberOfPassengers:n.additionalInformation.numberOfPassengers+=e.entity.numberOfPassengers,e.additionalInformation.stop=n;continue}if(t.alightingTime===null||t.alightingTime>this.animationVisualizationTime){if(t.assignedVehicleId===null){e.isVisible=!1,e.entity.error="No vehicle";continue}let n=this.vehicleEntitiesByVehicleId[t.assignedVehicleId];if(n===void 0){e.isVisible=!1,e.entity.error="Vehicle not found";continue}if(!n.isPresent){e.isVisible=!1,e.entity.error="Vehicle not present";continue}if(!e.isVisible){n.additionalInformation.numberOfNotVisiblePassengers+=e.entity.numberOfPassengers;continue}n.isVisible=!0,n.additionalInformation.passengerIds.push(e.entity.id),n.additionalInformation.numberOfPassengers+=e.entity.numberOfPassengers,e.additionalInformation.vehicle=n;continue}if(t.alightingStopId===null){e.isVisible=!1,e.entity.error="No alighting stop";continue}let r=this.stopEntitiesByPosition[t.alightingStopId];if(r===void 0){e.isVisible=!1,e.entity.error="Alighting stop not found";continue}if(!r.isPresent){e.isVisible=!1,e.entity.error="Alighting stop not present";continue}if(!e.isVisible){e.entity.status==="complete"?r.additionalInformation.numberOfNotVisibleCompletePassengers+=e.entity.numberOfPassengers:r.additionalInformation.numberOfNotVisiblePassengers+=e.entity.numberOfPassengers;continue}r.isVisible=!0,r.additionalInformation.passengerIds.push(e.entity.id),e.entity.status==="complete"?r.additionalInformation.numberOfCompletePassengers+=e.entity.numberOfPassengers:r.additionalInformation.numberOfPassengers+=e.entity.numberOfPassengers,e.additionalInformation.stop=r}}updateOnVehicleStops(){for(let e of this.presentVehicleEntities){let t=Bl(e.entity);for(let r=0;r<t.length-1;r++){let n=t[r],a=t[r+1],o=n.id+","+a.id,s=this.polylines.polylinesByCoordinates[o];e.additionalInformation.polylines.push(s)}if(e.entity.currentStop!==null){let r=this.stopEntitiesByPosition[e.entity.currentStop.id];if(r===void 0){e.isVisible=!1,e.entity.error="Current stop not found";continue}if(!r.isPresent){e.isVisible=!1,e.entity.error="Current stop not present";continue}e.additionalInformation.stop=r,e.additionalInformation.polylineIndex=e.entity.previousStops.length-1;let n=e.additionalInformation.polylines[e.additionalInformation.polylineIndex];n!==void 0?(e.additionalInformation.polylineSegmentIndex=n.coefficients.length-1,e.additionalInformation.polylineSegmentProgress=1):(e.additionalInformation.polylineSegmentIndex=0,e.additionalInformation.polylineSegmentProgress=0)}else{if(e.entity.previousStops.length===0){e.isVisible=!1,e.entity.error="No previous stops";continue}let r=e.entity.previousStops[e.entity.previousStops.length-1],n=this.stopEntitiesByPosition[r.id];if(n===null){e.isVisible=!1,e.entity.error="Previous stop not found";continue}if(!n.isPresent){e.isVisible=!1,e.entity.error="Previous stop not present";continue}if(e.entity.nextStops.length===0){e.isVisible=!1,e.entity.error="No next stops";continue}let a=e.entity.nextStops[0],o=this.stopEntitiesByPosition[a.id];if(o===null){e.isVisible=!1,e.entity.error="Next stop not found";continue}if(!o.isPresent){e.isVisible=!1,e.entity.error="Next stop not present";continue}if(r.departureTime===null){e.isVisible=!1,e.entity.error="No departure time";continue}let s=r.departureTime,l=a.arrivalTime,c=(this.animationVisualizationTime-s)/(l-s);if(c<0||c>1){e.isVisible=!1,e.entity.error="Progress out of bounds";continue}e.additionalInformation.polylineIndex=e.entity.previousStops.length-1;let[u,h]=this.getSegmentIndexAndProgress(e.additionalInformation.polylines[e.additionalInformation.polylineIndex],c);e.additionalInformation.polylineSegmentIndex=u,e.additionalInformation.polylineSegmentProgress=h}}}setEntityPositions(e){this.setVehiclePositions(e),this.setPassengerPositions()}setVehiclePositions(e){for(let t of this.presentVehicleEntities)if(t.additionalInformation.stop!==null)t.container.x=t.additionalInformation.stop.container.x,t.container.y=t.additionalInformation.stop.container.y;else{let r=t.additionalInformation;if(r.polylineIndex===null){t.container.visible=!1,t.entity.error="No polyline index";continue}if(r.polylineSegmentIndex===null){t.container.visible=!1,t.entity.error="No polyline segment index";continue}if(r.polylineSegmentProgress===null){t.container.visible=!1,t.entity.error="No polyline segment progress";continue}let n=r.polylineIndex,a=r.polylines[n];if(a===void 0){t.container.visible=!1,t.entity.error="Polyline not found";continue}let o=a.polyline[r.polylineSegmentIndex],s=a.polyline[r.polylineSegmentIndex+1];if(o===void 0||s===void 0){t.container.visible=!1,t.entity.error="Segment not found";continue}let l=e.latLngToLayerPoint([o.latitude,o.longitude]),c=e.latLngToLayerPoint([s.latitude,s.longitude]),u=l.multiplyBy(1-r.polylineSegmentProgress).add(c.multiplyBy(r.polylineSegmentProgress));t.container.x=u.x,t.container.y=u.y;let h=c.subtract(l),d=-Math.atan2(h.x,h.y)+Math.PI/2;t.sprites[0].rotation=d}}setPassengerPositions(){for(let e of this.presentPassengerEntities)e.additionalInformation.stop!==null?(e.container.x=e.additionalInformation.stop.container.x,e.container.y=e.additionalInformation.stop.container.y):e.additionalInformation.vehicle!==null?(e.container.x=e.additionalInformation.vehicle.container.x,e.container.y=e.additionalInformation.vehicle.container.y):(e.container.visible=!1,e.entity.error="No stop or vehicle")}updateCounters(){this.updateVehicleCounters(),this.updateStopCounters()}updateVehicleCounters(){let e=Hf(this.spritesService.currentColorPreset);for(let t=0;t<this.presentVehicleEntities.length;++t){let r=this.vehicleEntities[t],n=r.additionalInformation.numberOfPassengers,a=r.additionalInformation.numberOfNotVisiblePassengers,o=n+a;if(n===0){r.texts[0].text="",r.texts[0].tint=16777215,r.sprites[0].tint=16777215,r.sprites[1].tint=16777215;continue}else a===0?r.texts[0].text=n.toString():r.texts[0].text=`${n} (${o})`;let s=Math.min(1,(a+n)/r.entity.capacity),l=sc(e(s))?.rgb();if(l){let c=256*(l.r*256+l.g)+l.b;r.texts[0].tint=c,r.sprites[0].tint=c,r.sprites[1].tint=c}else console.warn("Color interpolation failed")}}updateStopCounters(){for(let e of this.presentStopEntities){let t=e.additionalInformation.numberOfPassengers,r=e.additionalInformation.numberOfCompletePassengers,n=e.additionalInformation.numberOfNotVisiblePassengers,a=e.additionalInformation.numberOfNotVisibleCompletePassengers,o=t+n,s=r+a;if(t===0?e.texts[0].text="":n===0?e.texts[0].text=t.toString():e.texts[0].text=`${t} (${o})`,r===0?e.texts[1].text="":a===0?e.texts[1].text=r.toString():e.texts[1].text=`${r} (${s})`,t===0&&r===0){e.texts[0].tint=16777215,e.texts[1].tint=16777215,e.sprites[0].tint=16777215,e.sprites[1].tint=16777215;continue}let l=Hf(this.spritesService.currentColorPreset),c=Math.min(1,(n+t)/e.entity.capacity),u=sc(l(c))?.rgb();if(u){let h=256*(u.r*256+u.g)+u.b;e.texts[0].tint=h,e.texts[1].tint=h,e.sprites[0].tint=h,e.sprites[1].tint=h}else console.warn("Color interpolation failed")}}highlightSelectedEntity(e){for(let t of this.presentVehicleEntities)t.container.filters=[];for(let t of this.presentPassengerEntities)t.container.filters=[];for(let t of this.presentStopEntities)t.container.filters=[];e!==null&&(e.container.filters=[new Hl(1,16777215),new Hl(2,16776960)],S5(e)&&(e.additionalInformation.vehicle!==null&&(e.additionalInformation.vehicle.container.filters=[new Hl(1,16777215),new Hl(2,16776960)]),e.additionalInformation.stop!==null&&(e.additionalInformation.stop.container.filters=[new Hl(1,16777215),new Hl(2,16776960)])))}updateTextures(){let e=!this.spritesService.useZoomedOutSprites;this.vehicleEntities.forEach(t=>{t.container.visible=t.isVisible,t.container.scale.set(this.spritesService.vehicleSpriteScale),this.synchronizeBackgroundWithEntity(t),t.isVisible&&(t.texts[0].visible=e,t.texts[0].x=t.sprites[0].width/2,t.texts[0].y=-t.sprites[0].height/2,this.spritesService.drawVehicleBackgroundShape(t.graphics[0],t.entity.mode,t.entity.tags),t.sprites[0].texture=this.spritesService.getVehicleTexture(t.entity.mode,t.entity.tags),t.sprites[1].texture=this.spritesService.getPassengerTexture(t.additionalInformation.passengerIds.map(r=>this.passengerEntitiesByPassengerId[r].entity.tags).flat()),t.sprites[1].visible=t.additionalInformation.passengerIds.length>0,t.sprites[1].scale.set(this.spritesService.passengerSpriteScale/this.spritesService.vehicleSpriteScale))}),this.passengersEntities.forEach(t=>{t.container.visible=t.isVisible,t.container.scale.set(this.spritesService.passengerSpriteScale),this.synchronizeBackgroundWithEntity(t),t.isVisible&&this.spritesService.drawPassengerBackgroundShape(t.graphics[0],t.entity.tags)}),this.stopEntities.forEach(t=>{t.container.visible=t.isVisible,t.container.scale.set(this.spritesService.passengerSpriteScale),this.synchronizeBackgroundWithEntity(t),t.isVisible&&(t.sprites[0].texture=this.spritesService.getStopTexture(t.entity.tags),t.sprites[0].scale.set(this.spritesService.stopSpriteScale/this.spritesService.passengerSpriteScale),this.spritesService.drawStopBackgroundShape(t.graphics[0],t.entity.tags),t.sprites[1].texture=this.spritesService.getPassengerTexture(t.additionalInformation.passengerIds.map(r=>this.passengerEntitiesByPassengerId[r].entity.tags).flat()),t.sprites[1].visible=t.additionalInformation.passengerIds.length>0,t.texts[0].visible=e,t.texts[0].x=t.sprites[1].width/2,t.texts[0].y=-t.sprites[1].height/2,t.texts[1].visible=e,t.texts[1].x=t.sprites[1].width/2,t.texts[1].y=t.sprites[1].height/2)})}synchronizeBackgroundWithEntity(e){e.backgroundContainer.visible=e.container.visible,e.backgroundContainer.x=e.container.x,e.backgroundContainer.y=e.container.y,e.backgroundContainer.scale.x=e.container.scale.x,e.backgroundContainer.scale.y=e.container.scale.y}drawSelectedEntityPolylines(e,t){this.selectedEntityPolylines.forEach(r=>r.clear()),e!==null&&(S5(e)?this.drawPassengerPolylines(e,t):$de(e)&&this.drawVehiclePolylines(e,t))}drawVehiclePolylines(e,t){let r=e.additionalInformation.polylineIndex;if(r===null){e.entity.error="No polyline index for vehicle "+e.entity.id+" while drawing polylines",e.isVisible=!1;return}let n=e.additionalInformation.polylineSegmentIndex;if(n===null){e.entity.error="No polyline segment index for vehicle "+e.entity.id+" while drawing polylines",e.isVisible=!1;return}let a=e.additionalInformation.polylineSegmentProgress;if(a===null){e.entity.error="No polyline segment progress for vehicle "+e.entity.id+" while drawing polylines",e.isVisible=!1;return}this.selectedEntityPolylines.length===0&&this.addPolylineGraphics();let o=e.additionalInformation.polylines;this.drawPolylines(r,n,a,o,this.selectedEntityPolylines[0],t)}drawPassengerPolylines(e,t){let r=td(e.entity);for(;this.selectedEntityPolylines.length<r.length;)this.addPolylineGraphics();for(let n=0;n<r.length;++n){let a=r[n];if(a.assignedVehicleId===null||a.boardingStopIndex===null||a.alightingStopIndex===null)continue;let o=this.vehicleEntitiesByVehicleId[a.assignedVehicleId];if(o===void 0){e.isVisible=!1,e.entity.error="Vehicle not found for passenger "+e.entity.id;continue}let s=o.additionalInformation.polylines.slice(a.boardingStopIndex,a.alightingStopIndex),l=this.selectedEntityPolylines[n];if(l==null)return;n===this.highlightedLegIndex?l.filters=[new Hl(1,16777215),new Hl(2,16776960)]:l.filters=[];let u=null,h=null,d=null;switch(a.legType){case"previous":u=s.length-1,s[u]!==void 0?(h=s[u].coefficients.length-1,d=1):(h=0,d=0);break;case"current":if(o.additionalInformation.polylineIndex===null||o.additionalInformation.polylineSegmentIndex===null||o.additionalInformation.polylineSegmentProgress===null){e.entity.error="No polyline index or segment index or progress for passenger",e.isVisible=!1;return}u=o.additionalInformation.polylineIndex-a.boardingStopIndex,h=o.additionalInformation.polylineSegmentIndex,d=o.additionalInformation.polylineSegmentProgress;break;case"next":u=0,h=0,d=0;break}if(u===null||h===null||d===null){e.entity.error="Invalid polyline index or segment index or progress for passenger",e.isVisible=!1;return}this.drawPolylines(u,h,d,s,l,t)}}drawPolylines(e,t,r,n,a,o){if(a.clear(),n.length===0)return;let s=Math.max(this.POLYLINE_WIDTH/o.getScale(),this.POLYLINE_MIN_WIDTH);a.lineStyle(s,this.POLYLINE_COMPLETE_COLOR,this.POLYLINE_ALPHA);for(let c=0;c<n.length;++c){let u=n[c];if(u.polyline.length===0){console.warn(`Polyline at index ${c} is empty.`);continue}c>e&&a.lineStyle(s,this.POLYLINE_REMAINING_COLOR,this.POLYLINE_ALPHA);let h=o.latLngToLayerPoint([u.polyline[0].latitude,u.polyline[0].longitude]);a.moveTo(h.x,h.y);for(let d=1;d<u.polyline.length;++d)if(c===e&&d===t+1){let p=o.latLngToLayerPoint([u.polyline[d].latitude,u.polyline[d].longitude]).multiplyBy(r).add(o.latLngToLayerPoint([u.polyline[d-1].latitude,u.polyline[d-1].longitude]).multiplyBy(1-r));a.lineTo(p.x,p.y),a.lineStyle(s,this.POLYLINE_REMAINING_COLOR,this.POLYLINE_ALPHA),a.moveTo(p.x,p.y),a.lineTo(p.x,p.y)}else{(c>e||c===e&&d>t)&&a.lineStyle(s,this.POLYLINE_REMAINING_COLOR,this.POLYLINE_ALPHA);let p=o.latLngToLayerPoint([u.polyline[d].latitude,u.polyline[d].longitude]);a.lineTo(p.x,p.y)}}a.lineStyle(s,this.POLYLINE_COMPLETE_COLOR,this.POLYLINE_ALPHA);for(let c=0;c<n.length;++c){let u=n[c];if(u.polyline.length===0){console.warn(`Polyline at index ${c} is empty.`);continue}(c>e||c===e&&t===0&&r===0)&&a.lineStyle(s,this.POLYLINE_REMAINING_COLOR,this.POLYLINE_ALPHA);let h=o.latLngToLayerPoint([u.polyline[0].latitude,u.polyline[0].longitude]);a.beginFill(this.WHITE,1),a.drawCircle(h.x,h.y,s*1.2),a.endFill()}e<n.length?a.lineStyle(s,this.POLYLINE_REMAINING_COLOR,this.POLYLINE_ALPHA):a.lineStyle(s,this.POLYLINE_COMPLETE_COLOR,this.POLYLINE_ALPHA);let l=n[n.length-1];if(l.polyline.length>0){let c=o.latLngToLayerPoint([l.polyline[l.polyline.length-1].latitude,l.polyline[l.polyline.length-1].longitude]);a.beginFill(this.WHITE,1),a.drawCircle(c.x,c.y,s*1.2),a.endFill()}else console.warn("Last polyline is empty, not drawing last stop.")}getSegmentIndexAndProgress(e,t){let r=0,n=null,a=null;for(let o=0;o<e.coefficients.length;++o){let s=e.coefficients[o];if(r+s>=t){n=o,a=(t-r)/s;break}r+=s}return n===null||a===null?[e.coefficients.length-1,1]:[n,a]}addPolylineGraphics(){let e=new $u;this.selectedEntityPolylines.push(e),this.polylinesContainer.addChild(e)}setMapPosition(e,t){if(this._shouldFollowEntitySignal()&&e!==null&&e.isVisible){t.getMap().setView(t.layerPointToLatLng(new eh.Point(e.container.x,e.container.y)));return}if(this.shouldCenterMap||!this.hasCenteredInitially){this.shouldCenterMap=!1;let r=this.presentVehicleEntities.filter(T=>T.isVisible),n=r.map(T=>T.container.y),a=r.map(T=>T.container.x),o=this.presentPassengerEntities.filter(T=>T.isVisible),s=o.map(T=>T.container.y),l=o.map(T=>T.container.x),c=this.presentStopEntities.filter(T=>T.isVisible),u=c.map(T=>T.container.y),h=c.map(T=>T.container.x),d=n.concat(s,u),p=a.concat(l,h);if(d.length==0||p.length==0)return;let f=Math.min(...d),g=Math.max(...d),_=Math.min(...p),b=Math.max(...p),S=.1,v=b-_,k=g-f,M=t.layerPointToLatLng(new eh.Point(_-S*v,f-S*k)),D=t.layerPointToLatLng(new eh.Point(b+S*v,g+S*k));t.getMap().flyToBounds(new eh.LatLngBounds(M,D)),this.hasCenteredInitially=!0}}findCloseEntities(e){if(!this.shouldFindCloseEntities)return;if(this.nextShouldFindCloseEntities=!1,!this.clickEvent){console.warn("No click event to find close entities. Make sure to call findCloseEntities after a click event.");return}let t=e.latLngToLayerPoint(this.clickEvent.latlng),r=20/e.getScale(),n=[],a=[];for(let s of this.presentVehicleEntities){if(!s.isVisible)continue;this.distanceBetweenPoints(t,s.container.position)<=r&&n.push(s.entity)}for(let s of this.presentStopEntities){if(!s.isVisible)continue;this.distanceBetweenPoints(t,s.container.position)<=r&&a.push(s.entity)}let o=[...n,...a];o.length===0?(this.unselectEntity(),this._closeEntitiesSignal.set([])):o.length===1?(this.selectEntity(o[0]),this._closeEntitiesSignal.set([])):(this.unselectEntity(),this._clickPositionSignal.set(new eh.Point(this.clickEvent.containerPoint.x,this.clickEvent.containerPoint.y)),this._closeEntitiesSignal.set(o))}distanceBetweenPoints(e,t){let r=e.x-t.x,n=e.y-t.y;return Math.sqrt(r*r+n*n)}static \u0275fac=function(t){return new(t||i)(Zt(xd),Zt(Zg),Zt(nd))};static \u0275prov=lt({token:i,factory:i.\u0275fac,providedIn:"root"})};var Ln=class i{constructor(e,t,r){this.injector=e;this.simulationService=t;this.animationService=r;Ji(()=>{let n=this._wantedVisualizationTimeSignal();this.wantedVisualizationTime=n}),Ji(()=>{let n=this.environmentSignal();this.environmentSlice=n}),Ji(()=>{if(this.simulationService.hasAllStatesSignal()){this._isLoadingSignal.set(!1);return}let a=this.simulationService.activeSimulationSignal();if(a===null){this._isLoadingSignal.set(!0);return}let o=this._wantedVisualizationTimeSignal();if(o===null){this._isLoadingSignal.set(!0);return}if(!this.simulationService.isFetchingStatesSignal()){let u=this.simulationService.continuousEnvironmentsSignal().filter(h=>h.isComplete).map(h=>h.startUpdateIndex);this.simulationService.getMissingSimulationStates(a.id,o,u)}let l=this.environmentSignal();this._isLoadingSignal.set(l===null)}),Ji(()=>{let n=this.simulationService.activeSimulationSignal();if(n===null)return;let a=this.simulationService.simulationPolylinesSignal(),o=this.simulationService.isFetchingPolylinesSignal();(a===null||a.version!==n.polylinesVersion)&&!o&&this.getPolylines(n.id)}),this.initializeAutoSave(),this.initializeAutoLoad(),Ji(()=>{let n=this.simulationService.continuousEnvironmentsSignal();this.animationService.updateEnvironment(n)}),Ji(()=>{let n=this._wantedVisualizationTimeSignal();this.animationService.updateWantedVisualizationTime(n)}),Ji(()=>{let n=this.simulationService.simulationPolylinesSignal(),a=this.simulationService.activeSimulationSignal();(n===null||a===null||n.version!==a.polylinesVersion)&&this.animationService.updatePolylines(null),this.animationService.updatePolylines(n)})}MIN_POLYLINES_DEBOUNCE_TIME=800;fetchPolylinesTimeout=null;lastFetchPolylinesTime=0;speed=1;tick=-1;tickSignal=Bt(0);updateTickTimeout=null;lastUpdateTickTime=performance.now();ENVIRONMENT_TICK_INTERVAL=1e3;environmentTickSignal=Bt(0);updateEnvironmentTickTimeout=null;_simulationStartTimeSignal=Bt(null);_simulationEndTimeSignal=Bt(null);_visualizationMaxTimeSignal=Bt(null);_isVisualizationPausedSignal=Bt(!1);visualizationTimeOverride=null;visualizationTimeOverrideSignal=Bt(null);wantedVisualizationTime=null;_wantedVisualizationTimeSignal=$t(()=>this.computeWantedVisualizationTime());environmentSlice=null;environmentSignal=$t(()=>this.sliceEnvironment());hasEnvironmentChanged=!1;controlledWantedVisualizationTimeSignal=$t(()=>(this.hasEnvironmentChanged=!0,this._wantedVisualizationTimeSignal()));controlledContinuousEnvironmentsSignal=$t(()=>(this.hasEnvironmentChanged=!0,this.simulationService.continuousEnvironmentsSignal()));_isLoadingSignal=Bt(!0);initializeAutoSave(){window.addEventListener("beforeunload",()=>{this.saveLocalStorageData()})}saveLocalStorageData(){let e=this._wantedVisualizationTimeSignal(),t=this._isVisualizationPausedSignal();e!==null&&localStorage.setItem("wantedVisualizationTime",e.toString()),localStorage.setItem("isVisualizationPaused",JSON.stringify(t))}initializeAutoLoad(){window.addEventListener("load",()=>{this.loadWantedVisualizationTime()})}loadWantedVisualizationTime(){let e=localStorage.getItem("wantedVisualizationTime"),t=localStorage.getItem("isVisualizationPaused");if(e){let r=parseFloat(e);isNaN(r)||(this.wantedVisualizationTime=r,this.visualizationTimeOverrideSignal.set(r))}if(t!==null){let r=JSON.parse(t);this._isVisualizationPausedSignal.set(r)}}clearLocalStorage(){localStorage.removeItem("wantedVisualizationTime"),localStorage.removeItem("isVisualizationPaused")}init(e){if(this._simulationStartTimeSignal.set(e.simulationStartTime??null),this._simulationEndTimeSignal.set(e.simulationEndTime??e.simulationEstimatedEndTime??null),this._visualizationMaxTimeSignal.set((Bu.includes(e.status)?e.simulationTime??e.simulationStartTime:e.simulationEndTime)??null),!this.isInitializedSignal()){this._simulationStartTimeSignal.set(null),this._simulationEndTimeSignal.set(null),this._visualizationMaxTimeSignal.set(null);return}this.updateTickTimeout===null&&this.updateTick(),this.updateEnvironmentTickTimeout===null&&this.updateEnvironmentTick()}destroy(){this.isInitializedSignal()&&(this._simulationStartTimeSignal.set(null),this._simulationEndTimeSignal.set(null),this._visualizationMaxTimeSignal.set(null),this.clearLocalStorage(),this.updateTickTimeout!==null&&(clearTimeout(this.updateTickTimeout),this.updateTickTimeout=null),this.updateEnvironmentTickTimeout!==null&&(clearTimeout(this.updateEnvironmentTickTimeout),this.updateEnvironmentTickTimeout=null))}get isInitializedSignal(){return $t(()=>this._simulationStartTimeSignal()!==null&&this._simulationEndTimeSignal()!==null&&this._visualizationMaxTimeSignal()!==null)}get simulationStartTimeSignal(){return this._simulationStartTimeSignal}get simulationEndTimeSignal(){return this._simulationEndTimeSignal}get visualizationMaxTimeSignal(){return this._visualizationMaxTimeSignal}get isVisualizationPausedSignal(){return this._isVisualizationPausedSignal}get wantedVisualizationTimeSignal(){return this._wantedVisualizationTimeSignal}get isLoadingSignal(){return this._isLoadingSignal}pauseVisualization(){this._isVisualizationPausedSignal.set(!0)}resumeVisualization(){this._isVisualizationPausedSignal.set(!1)}setVisualizationTime(e){this.visualizationTimeOverrideSignal.set(e)}setVisualizationSpeed(e){this.speed=e}updateTick(){yo(this.injector,()=>{this.tickSignal.update(e=>e+1)}),this.updateTickTimeout=setTimeout(()=>{this.updateTick()},250)}updateEnvironmentTick(){yo(this.injector,()=>{this.environmentTickSignal.update(e=>e+1)}),this.updateEnvironmentTickTimeout=setTimeout(()=>{this.updateEnvironmentTick()},this.ENVIRONMENT_TICK_INTERVAL)}getPolylines(e){this.fetchPolylinesTimeout!==null&&(clearTimeout(this.fetchPolylinesTimeout),this.fetchPolylinesTimeout=null);let t=Date.now(),r=t-this.lastFetchPolylinesTime;if(r<this.MIN_POLYLINES_DEBOUNCE_TIME){this.fetchPolylinesTimeout=setTimeout(()=>{this.fetchPolylinesTimeout=null,this.lastFetchPolylinesTime=t,this.simulationService.getPolylines(e)},this.MIN_POLYLINES_DEBOUNCE_TIME-r);return}this.lastFetchPolylinesTime=t,this.simulationService.getPolylines(e)}computeWantedVisualizationTime(){let e=this.simulationStartTimeSignal(),t=this.visualizationMaxTimeSignal();if(e===null||t===null)return null;let r=this._isLoadingSignal(),n=this.tickSignal(),a=this.visualizationTimeOverrideSignal(),o=this.isVisualizationPausedSignal(),s=performance.now(),l=this.lastUpdateTickTime;return this.lastUpdateTickTime=s,this.wantedVisualizationTime===null?e:a!==this.visualizationTimeOverride&&a!==null?(this.visualizationTimeOverride=a,Math.max(Math.min(t,a),e)):r?this.wantedVisualizationTime:n===this.tick?this.wantedVisualizationTime:(this.tick=n,o?this.wantedVisualizationTime:Math.min(t,Math.max(this.wantedVisualizationTime+(s-l)/1e3*this.speed,e)))}sliceEnvironment(){this.environmentTickSignal();let e=Aa(this.controlledWantedVisualizationTimeSignal);if(e===null)return null;let t=Aa(this.controlledContinuousEnvironmentsSignal),r=cM(t,e);if(r===null)return null;if(!this.hasEnvironmentChanged)return this.environmentSlice;let n=uM(r,e);return this.hasEnvironmentChanged=!1,n}static \u0275fac=function(t){return new(t||i)(Zt(Ii),Zt(Ha),Zt(Mr))};static \u0275prov=lt({token:i,factory:i.\u0275fac})};var Cd=class i{constructor(e,t){this.visualizationService=e;this.animationService=t;Ji(()=>{this.effectUpdateVehicleModeFilters()}),Ji(()=>{this.effectOnFilterChanged()})}_filters=Bt(new Set(["stops"]));_vehicleModes=Bt([]);get filters(){return this._filters}get vehicleModes(){return this._vehicleModes}effectOnFilterChanged(){this.animationService.setFilters(this._filters())}effectUpdateVehicleModeFilters(){let e=this.visualizationService.environmentSignal(),t=Aa(this._vehicleModes);if(e===null)return;let n=[...Object.values(e.vehicles).map(a=>a.mode??"unknown"),...t].filter((a,o,s)=>s.indexOf(a)===o);n.sort(),this._vehicleModes.set(n)}toggleFilter(e){let t=this._filters();t.has(e)?t.delete(e):t.add(e),this._filters.set(new Set(t))}static \u0275fac=function(t){return new(t||i)(Zt(Ln),Zt(Mr))};static \u0275prov=lt({token:i,factory:i.\u0275fac})};var Bje=()=>[];function Rje(i,e){if(i&1&&(Z(0,"span",0),ce(1),Q()),i&2){Se();let t=fi(1);oe(),Ti(t.join(", "))}}var rl=class i{nameInputSignal=sl.required({alias:"name"});tagsInputSignal=sl.required({alias:"tags"});static \u0275fac=function(t){return new(t||i)};static \u0275cmp=tt({type:i,selectors:[["app-entity-name"]],inputs:{nameInputSignal:[1,"name","nameInputSignal"],tagsInputSignal:[1,"tags","tagsInputSignal"]},decls:5,vars:4,consts:[[1,"tags"]],template:function(t,r){if(t&1&&(Ri(0)(1),Z(2,"span"),ce(3),je(4,Rje,2,1,"span",0),Q()),t&2){let n,a,o=(n=r.nameInputSignal())!==null&&n!==void 0?n:"Unknown entity";oe();let s=hr((a=r.tagsInputSignal())!==null&&a!==void 0?a:J4(3,Bje));oe(2),_t("",o," "),oe(),Je(s.length>0?4:-1)}},styles:[".tags[_ngcontent-%COMP%]{font-weight:lighter;font-style:italic;padding-inline-end:.5rem}"]})};var Dje=(i,e)=>e.id;function Lje(i,e){i&1&&ce(0," directions_car ")}function Ije(i,e){i&1&&ce(0," accessibility ")}function Fje(i,e){i&1&&ce(0," place ")}function Oje(i,e){if(i&1){let t=vt();Z(0,"mat-chip",5),Le("click",function(){let n=Ee(t).$implicit,a=Se();return Ae(a.selectEntity(n))})("mouseenter",function(){let n=Ee(t).$implicit,a=Se();return Ae(a.preselectEntity(n))})("mouseleave",function(){Ee(t);let n=Se();return Ae(n.unpreselectEntity())}),Z(1,"mat-icon",6),je(2,Lje,1,0)(3,Ije,1,0)(4,Fje,1,0),Q(),Ge(5,"app-entity-name",7),Q()}if(i&2){let t,r=e.$implicit;oe(2),Je((t=r.entityType)==="vehicle"?2:t==="passenger"?3:t==="stop"?4:-1),oe(3),Re("name",r.name)("tags",r.tags)}}function zje(i,e){if(i&1){let t=vt();Z(0,"button",8),Le("click",function(){Ee(t);let n=Se();return Ae(n.clearHistory())}),ce(1," Clear "),Q()}}function Hje(i,e){i&1&&(Z(0,"p"),ce(1,"Your history is empty."),Q())}var oA=class i{constructor(e,t){this.visualizationService=e;this.animationService=t;Ji(()=>{this.effectOnEntitySelected()})}history=Bt([]);_ignoreNextSelect=!1;clearHistory(){this.history.set([])}unpreselectEntity(){this.animationService.unpreselectEntity()}preselectEntity(e){this.animationService.preselectEntity(e,!0)}selectEntity(e){this._ignoreNextSelect=!0,this.animationService.selectEntity(e)}effectOnEntitySelected(){let e=this.animationService.selectedEntitySignal();if(e!==null){if(this._ignoreNextSelect){this._ignoreNextSelect=!1;return}this.addHistory(e)}}addHistory(e){this.history.update(t=>{let r=t.findIndex(n=>n.id===e.id&&n.entityType===e.entityType);return r!==-1&&t.splice(r,1),[e,...t]})}static \u0275fac=function(t){return new(t||i)(rt(Ln),rt(Mr))};static \u0275cmp=tt({type:i,selectors:[["app-click-history"]],decls:10,vars:1,consts:[["appearance","outlined"],[1,"title"],[1,"container"],[1,"content"],["mat-button","",1,"clear-btn"],[3,"click","mouseenter","mouseleave"],["matChipAvatar",""],[3,"name","tags"],["mat-button","",1,"clear-btn",3,"click"]],template:function(t,r){t&1&&(Z(0,"mat-card",0)(1,"mat-card-content")(2,"p",1),ce(3,"History"),Q(),Z(4,"div",2)(5,"div",3),ui(6,Oje,6,3,"mat-chip",null,Dje),Q()(),je(8,zje,2,0,"button",4)(9,Hje,2,0,"p"),Q()()),t&2&&(oe(6),hi(r.history()),oe(2),Je(r.history().length>0?8:9))},dependencies:[Br,pn,ia,ea,ta,qn,da,Rf,pr,mr,Rn,rl],styles:["p[_ngcontent-%COMP%]{margin:0}.title[_ngcontent-%COMP%]{font:var(--mat-sys-body-medium);margin-top:0;margin-bottom:10px}.container[_ngcontent-%COMP%]{width:100%;max-height:400px;overflow-x:hidden;overflow-y:auto;padding-bottom:10px;display:flex;flex-direction:column;gap:20px;padding-right:5px}.content[_ngcontent-%COMP%]{width:100%;display:flex;flex-direction:column;gap:5px;max-width:200px;margin-right:10px}mat-chip-option[_ngcontent-%COMP%]{max-width:50px}[_nghost-%COMP%] .mat-mdc-standard-chip .mdc-evolution-chip__cell--primary, [_nghost-%COMP%] .mat-mdc-standard-chip .mdc-evolution-chip__action--primary, [_nghost-%COMP%] .mat-mdc-standard-chip .mat-mdc-chip-action-label{overflow:hidden}.clear-btn[_ngcontent-%COMP%]{width:100%}.disabled[_ngcontent-%COMP%]{pointer-events:none;opacity:.4}.disabled[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{pointer-events:all}"]})};var Qde=(i,e)=>e.status,eme=(i,e)=>e.id;function Nje(i,e){if(i&1){let t=vt();Z(0,"div",3),Le("click",function(){let n=Ee(t).$implicit,a=Se(2);return Ae(a.selectEntity(n))})("mouseenter",function(){let n=Ee(t).$implicit,a=Se(2);return Ae(a.preselectEntity(n))})("mouseleave",function(){Ee(t);let n=Se(2);return Ae(n.unpreselectEntity())})("keydown.enter",function(){let n=Ee(t).$implicit,a=Se(2);return Ae(a.selectEntity(n))}),Ge(1,"app-entity-name",4),Q()}if(i&2){let t=e.$implicit;Re("matTooltip","Select passenger")("matTooltipPosition","after"),oe(),Re("name",t.name)("tags",t.tags)}}function Gje(i,e){if(i&1&&(Z(0,"mat-expansion-panel")(1,"mat-expansion-panel-header")(2,"mat-panel-title"),ce(3),Q()(),Z(4,"div",1),ui(5,Nje,2,4,"div",2,eme),Q()()),i&2){let t=e.$implicit;oe(3),R_(" ",t.status," (",t.count,") "),oe(2),hi(t.passengers)}}function Vje(i,e){if(i&1){let t=vt();Z(0,"div",3),Le("click",function(){let n=Ee(t).$implicit,a=Se(2);return Ae(a.selectEntity(n))})("mouseenter",function(){let n=Ee(t).$implicit,a=Se(2);return Ae(a.preselectEntity(n))})("mouseleave",function(){Ee(t);let n=Se(2);return Ae(n.unpreselectEntity())})("keydown.enter",function(){let n=Ee(t).$implicit,a=Se(2);return Ae(a.selectEntity(n))}),Ge(1,"app-entity-name",4),Q()}if(i&2){let t=e.$implicit;Re("matTooltip","Select vehicle")("matTooltipPosition","after"),oe(),Re("name",t.name)("tags",t.tags)}}function Kje(i,e){if(i&1&&(Z(0,"mat-expansion-panel")(1,"mat-expansion-panel-header")(2,"mat-panel-title"),ce(3),Q()(),Z(4,"div",1),ui(5,Vje,2,4,"div",2,eme),Q()()),i&2){let t=e.$implicit;oe(3),R_(" ",t.status," (",t.count,") "),oe(2),hi(t.vehicles)}}var sA=class i{constructor(e,t){this.animationService=e;this.visualizationService=t}getPassengers=$t(()=>{let e=this.visualizationService.environmentSignal();return e===null?[]:Object.values(e.passengers)});numberOfPassengersByStatusSignal=$t(()=>{let e=this.visualizationService.environmentSignal();if(e===null)return[];let t=Object.values(e.passengers);t.sort((n,a)=>a.nextLegs.length+a.previousLegs.length+(a.currentLeg!=null?1:0)-(n.nextLegs.length+n.previousLegs.length+(n.currentLeg!=null?1:0)));let r={};for(let n of t){let a=n.status;r[a]=r[a]??[],r[a].push(n)}return Object.entries(r).map(([n,a])=>({status:n,count:a.length,passengers:a}))});getVehicles=$t(()=>{let e=this.visualizationService.environmentSignal();return e===null?[]:Object.values(e.vehicles)});numberOfVehiclesByStatusSignal=$t(()=>{let e=this.visualizationService.environmentSignal();if(e===null)return[];let t=Object.values(e.vehicles),r={};for(let n of t){let a=n.status;r[a]=r[a]??[],r[a].push(n)}return Object.entries(r).map(([n,a])=>({status:n,count:a.length,vehicles:a}))});preselectEntity(e){this.animationService.preselectEntity(e,!1)}unpreselectEntity(){this.animationService.unpreselectEntity()}selectEntity(e){this.animationService.selectEntity(e)}static \u0275fac=function(t){return new(t||i)(rt(Mr),rt(Ln))};static \u0275cmp=tt({type:i,selectors:[["app-entities-tab"]],decls:21,vars:2,consts:[["multi","true"],[1,"flex-column","gap-0-5-rem"],["tabindex","0",1,"clickable","indent",3,"matTooltip","matTooltipPosition"],["tabindex","0",1,"clickable","indent",3,"click","mouseenter","mouseleave","keydown.enter","matTooltip","matTooltipPosition"],[3,"name","tags"]],template:function(t,r){if(t&1&&(Z(0,"mat-accordion",0)(1,"mat-expansion-panel"),Ri(2)(3),Z(4,"mat-expansion-panel-header")(5,"mat-panel-title"),ce(6),Q()(),Z(7,"div",1)(8,"mat-accordion",0),ui(9,Gje,7,2,"mat-expansion-panel",null,Qde),Q()()(),Z(11,"mat-expansion-panel"),Ri(12)(13),Z(14,"mat-expansion-panel-header")(15,"mat-panel-title"),ce(16),Q()(),Z(17,"div",1)(18,"mat-accordion",0),ui(19,Kje,7,2,"mat-expansion-panel",null,Qde),Q()()()()),t&2){let n=r.getPassengers(),a=r.numberOfPassengersByStatusSignal();oe(6),_t(" Passengers (",n.length,") "),oe(3),hi(a);let o=r.getVehicles(),s=r.numberOfVehiclesByStatusSignal();oe(7),_t(" Vehicles (",o.length,") "),oe(3),hi(s)}},dependencies:[kc,ry,qm,Zm,iy,Rn,Da,rl],styles:[".clickable[_ngcontent-%COMP%]{cursor:pointer;padding:.5rem 0;border-radius:.5rem}.clickable[_ngcontent-%COMP%]:hover{background-color:#1a1b1f14} .mat-expansion-panel-body{padding:0 5px 5px!important}.indent[_ngcontent-%COMP%]{padding-left:24px}"]})};var Wje=(i,e)=>e.id;function Uje(i,e){i&1&&ce(0," directions_car ")}function jje(i,e){i&1&&ce(0," accessibility ")}function qje(i,e){i&1&&ce(0," place ")}function Zje(i,e){if(i&1){let t=vt();Z(0,"mat-chip",5),Le("removed",function(){let n=Ee(t).$implicit,a=Se();return Ae(a.toggleFavoriteEntity(n))})("click",function(){let n=Ee(t).$implicit,a=Se();return Ae(a.selectEntity(n))})("mouseenter",function(){let n=Ee(t).$implicit,a=Se();return Ae(a.preselectEntity(n))})("mouseleave",function(){Ee(t);let n=Se();return Ae(n.unpreselectEntity())}),Z(1,"mat-icon",6),je(2,Uje,1,0)(3,jje,1,0)(4,qje,1,0),Q(),Ge(5,"app-entity-name",7),Z(6,"button",8)(7,"mat-icon"),ce(8,"favorite"),Q()()()}if(i&2){let t,r=e.$implicit,n=Se();gt("disabled",!n.isEntityInEnvironment(r)),oe(2),Je((t=r.entityType)==="vehicle"?2:t==="passenger"?3:t==="stop"?4:-1),oe(3),Re("name",r.name)("tags",r.tags)}}function Yje(i,e){i&1&&(Z(0,"p"),ce(1,"You have no favorites in this simulation."),Q())}var lA=class i{constructor(e,t,r){this.favoriteEntitiesService=e;this.visualizationService=t;this.animationService=r}get favoriteEntitiesSignal(){return this.favoriteEntitiesService.favoriteEntitiesSignal}unpreselectEntity(){this.animationService.unpreselectEntity()}preselectEntity(e){this.animationService.preselectEntity(e,!0)}selectEntity(e){this.animationService.selectEntity(e)}toggleFavoriteEntity(e){this.favoriteEntitiesService.toggleFavoriteEntity(e)}isEntityInEnvironment(e){let t=this.visualizationService.environmentSignal();if(!t)return!1;switch(e.entityType){case"vehicle":return t.vehicles[e.id]!==void 0;case"passenger":return t.passengers[e.id]!==void 0;case"stop":return t.stops[e.id]!==void 0;default:return!1}}static \u0275fac=function(t){return new(t||i)(rt(xd),rt(Ln),rt(Mr))};static \u0275cmp=tt({type:i,selectors:[["app-favorite-entities"]],decls:10,vars:1,consts:[["appearance","outlined"],[1,"title"],[1,"container"],[1,"content"],[3,"disabled"],[3,"removed","click","mouseenter","mouseleave"],["matChipAvatar",""],[3,"name","tags"],["matChipRemove","",1,"remove-btn"]],template:function(t,r){if(t&1&&(Z(0,"mat-card",0)(1,"mat-card-content"),Ri(2),Z(3,"p",1),ce(4,"Favorites"),Q(),Z(5,"div",2)(6,"div",3),ui(7,Zje,9,5,"mat-chip",4,Wje),Q(),je(9,Yje,2,0,"p"),Q()()()),t&2){let n=r.favoriteEntitiesSignal();oe(7),hi(n),oe(2),Je(n.length===0?9:-1)}},dependencies:[ia,ea,ta,qn,da,Rf,Df,pr,mr,Rn,rl],styles:["p[_ngcontent-%COMP%]{margin:0}.title[_ngcontent-%COMP%]{font:var(--mat-sys-body-medium);margin-top:0;margin-bottom:10px}.container[_ngcontent-%COMP%]{width:100%;max-height:400px;overflow-x:hidden;overflow-y:auto;padding-bottom:10px;display:flex;flex-direction:column;gap:20px}.content[_ngcontent-%COMP%]{width:100%;display:flex;flex-direction:column;gap:5px;max-width:200px;margin-right:10px}mat-chip-option[_ngcontent-%COMP%]{max-width:50px}[_nghost-%COMP%] .mat-mdc-standard-chip .mdc-evolution-chip__cell--primary, [_nghost-%COMP%] .mat-mdc-standard-chip .mdc-evolution-chip__action--primary, [_nghost-%COMP%] .mat-mdc-standard-chip .mat-mdc-chip-action-label{overflow:hidden}.remove-btn[_ngcontent-%COMP%]{opacity:.3}.remove-btn[_ngcontent-%COMP%]:hover{opacity:1}.disabled[_ngcontent-%COMP%]{pointer-events:none;opacity:.4}.disabled[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{pointer-events:all}"]})};var tme=go(ny());var u_=class i{KEY_ADDED_TILES="multimodal.added-tiles";KEY_SELECTED_TILE_INDEX="multimodal.selected-tile-index";noWrap=!0;minZoom=8;maxZoom=18;map=null;_selectedMapTile;_mapTiles=Bt([]);get selectedMapTile(){return this._selectedMapTile}get mapTiles(){return this._mapTiles}constructor(){this.loadMapTilesData(),Ji(()=>{this.effectSaveMapTiles()}),Ji(()=>{this.effectUpdateIndex()})}selectMapTile(e){if(this.map==null)return;let t=this._selectedMapTile();t!==void 0&&t!==e&&this.map.removeLayer(t.tile),this._selectedMapTile.set(e),e.tile.addTo(this.map)}addMapTile(e,t,r){this._mapTiles.update(n=>{let a=this.createMapTile(e,t,r,!0);return[...n,a]})}removeMapTile(e){this._mapTiles.update(t=>t.filter(r=>r!==e))}getDefaultTilesData(){return[this.createMapTile("OpenStreetMap Standard","https://tile.openstreetmap.org/{z}/{x}/{y}.png",'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',!1),this.createMapTile("Stadia Alidade Smooth Light","https://tiles.stadiamaps.com/tiles/alidade_smooth/{z}/{x}/{y}.png",'© <a href="https://stadiamaps.com/" target="_blank">\xA9 Stadia Maps</a> <a href="https://openmaptiles.org/" target="_blank" rel="nofollow noopener noreferrer">\xA9 OpenMapTiles</a> <a href="https://www.openstreetmap.org/copyright" target="_blank">\xA9 OpenStreetMap</a>',!0),this.createMapTile("Stadia Alidade Smooth Dark","https://tiles.stadiamaps.com/tiles/alidade_smooth_dark/{z}/{x}/{y}.png",'© <a href="https://stadiamaps.com/" target="_blank">\xA9 Stadia Maps</a> <a href="https://openmaptiles.org/" target="_blank" rel="nofollow noopener noreferrer">\xA9 OpenMapTiles</a> <a href="https://www.openstreetmap.org/copyright" target="_blank">\xA9 OpenStreetMap</a>',!0)]}loadMapTilesData(){let e=this.loadSavedMapTiles();e.length===0&&(e=this.getDefaultTilesData());let t=parseInt(localStorage.getItem(this.KEY_SELECTED_TILE_INDEX));!isNaN(t)&&t<e.length?this._selectedMapTile=Bt(e[t]):this._selectedMapTile=Bt(e[0]),this._mapTiles.set(e)}loadSavedMapTiles(){let e=localStorage.getItem(this.KEY_ADDED_TILES);if(e==null)return[];let t=JSON.parse(e),r=[];for(let n of t)r.push(this.createMapTile(n.name,n.url,n.attribution,n.custom));return r}effectSaveMapTiles(){let t=this._mapTiles().map(r=>({name:r.name,url:r.url,attribution:r.attribution,custom:r.custom}));localStorage.setItem(this.KEY_ADDED_TILES,JSON.stringify(t))}effectUpdateIndex(){let e=this._selectedMapTile();if(e==null)return;let t=this.mapTiles(),r=t.findIndex(n=>n===e);if(r===-1){this.selectMapTile(t[0]);return}localStorage.setItem(this.KEY_SELECTED_TILE_INDEX,r.toString())}createTileLayer(e,t){return(0,tme.tileLayer)(e,{noWrap:this.noWrap,minZoom:this.minZoom,maxZoom:this.maxZoom,attribution:t??void 0})}createMapTile(e,t,r,n){return{name:e,url:t,attribution:r,tile:this.createTileLayer(t,r),custom:n}}static \u0275fac=function(t){return new(t||i)};static \u0275prov=lt({token:i,factory:i.\u0275fac,providedIn:"root"})};function Jje(i,e){i&1&&(Z(0,"button",7)(1,"mat-icon"),ce(2,"cancel"),Q()())}function $je(i,e){if(i&1){let t=vt();Z(0,"mat-chip-option",6),Le("removed",function(){let n=Ee(t).$implicit,a=Se();return Ae(a.removeMapTile(n))})("click",function(){let n=Ee(t).$implicit,a=Se();return Ae(a.setMapTile(n))}),ce(1),je(2,Jje,3,0,"button",7),Q()}if(i&2){let t=e.$implicit,r=Se();Re("selected",r.selectedMapTile()===t)("selectable",r.selectedMapTile()!==t),oe(),_t(" ",t.name," "),oe(),Je(t.custom?2:-1)}}var cA=class i{constructor(e,t){this.mapService=e;this.dialogService=t;this.mapTiles=e.mapTiles,this.selectedMapTile=e.selectedMapTile}mapTiles;selectedMapTile;setMapTile(e){this.mapService.selectMapTile(e)}removeMapTile(e){this.mapService.removeMapTile(e)}addMapTile(){return Ce(this,null,function*(){let e=yield hn(this.dialogService.openAddMapTileDialog().afterClosed());e&&this.mapService.addMapTile(e.name,e.url,e.attribution)})}editMapIcons(){return Ce(this,null,function*(){yield hn(this.dialogService.openEditMapIconsDialog().afterClosed())})}static \u0275fac=function(t){return new(t||i)(rt(u_),rt(Js))};static \u0275cmp=tt({type:i,selectors:[["app-map-tiles"]],decls:12,vars:0,consts:[["appearance","outlined"],[1,"title"],["aria-label","Map Layers",1,"chip-list"],[3,"selected","selectable"],[1,"btn-container"],["mat-button","",3,"click"],[3,"removed","click","selected","selectable"],["matChipRemove","","aria-label","'remove template form' + keyword"]],template:function(t,r){t&1&&(Z(0,"mat-card",0)(1,"mat-card-content")(2,"p",1),ce(3,"Map Tile Providers"),Q(),Z(4,"mat-chip-listbox",2),ui(5,$je,3,4,"mat-chip-option",3,Ea),Q(),Z(7,"div",4)(8,"button",5),Le("click",function(){return r.addMapTile()}),ce(9,"Add Map Tile"),Q(),Z(10,"button",5),Le("click",function(){return r.editMapIcons()}),ce(11,"Customize entities"),Q()()()()),t&2&&(oe(5),hi(r.mapTiles()))},dependencies:[ia,ea,ta,Br,pn,pr,mr,So,kc,qn,jR,zb,Df],styles:[".title[_ngcontent-%COMP%]{font:var(--mat-sys-body-medium);margin-top:0;margin-bottom:10px}.chip-list[_ngcontent-%COMP%]{max-width:100%;width:250px;margin-bottom:10px}.chip-list[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{max-width:100%;overflow:hidden}.mat-mdc-chip-set[_ngcontent-%COMP%] .mdc-evolution-chip[_ngcontent-%COMP%]{width:100%}[_nghost-%COMP%] .mat-mdc-standard-chip .mdc-evolution-chip__cell--primary, [_nghost-%COMP%] .mat-mdc-standard-chip .mdc-evolution-chip__action--primary, [_nghost-%COMP%] .mat-mdc-standard-chip .mat-mdc-chip-action-label{overflow:hidden}.btn-container[_ngcontent-%COMP%]{display:flex;flex-direction:row;justify-content:center}"]})};function Xje(i,e){if(i&1&&(Z(0,"mat-expansion-panel")(1,"mat-expansion-panel-header")(2,"mat-panel-title"),ce(3),Q()(),Z(4,"div",2),Ge(5,"app-recursive-statistics",3),Q()()),i&2){let t=Se().$implicit,r=Se();oe(3),_t(" ",r.capitalize(t)," "),oe(2),Re("recursiveDict",r.recursiveDict[t])}}function Qje(i,e){if(i&1&&(Z(0,"div",1)(1,"span",4),ce(2),Z(3,"span",5),ce(4),Q()()()),i&2){let t=Se().$implicit,r=Se();oe(2),_t(" ",r.capitalize(t),": "),oe(2),_t(" ",r.formatEntry(r.recursiveDict[t])," ")}}function e7e(i,e){if(i&1&&je(0,Xje,6,2,"mat-expansion-panel")(1,Qje,5,2,"div",1),i&2){let t=e.$implicit,r=Se();Je(r.isStatistics(r.recursiveDict[t])?0:1)}}var uA=class i{recursiveDict;constructor(){this.recursiveDict={}}capitalize(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}keys(){for(let e of Object.keys(this.recursiveDict))this.recursiveDict[e]instanceof Array&&delete this.recursiveDict[e];return Object.keys(this.recursiveDict).sort((e,t)=>{let r=typeof this.recursiveDict[e]=="object",n=typeof this.recursiveDict[t]=="object";return r&&!n?1:!r&&n?-1:0})}formatEntry(e){return typeof e=="number"?new Intl.NumberFormat("en-US",{minimumFractionDigits:0,maximumFractionDigits:2,useGrouping:!0}).format(e).replace(/,/g," "):typeof e=="string"?this.capitalize(e):""}isStatistics(e){return typeof e=="object"}isGeneric(e){return typeof e=="string"||typeof e=="number"}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=tt({type:i,selectors:[["app-recursive-statistics"]],inputs:{recursiveDict:"recursiveDict"},decls:3,vars:0,consts:[["multi","true"],[1,"flex-column","gap-0-5-rem","indent"],[1,"flex-column","gap-0-5-rem"],[3,"recursiveDict"],[2,"white-space","normal"],[2,"white-space","nowrap"]],template:function(t,r){t&1&&(Z(0,"mat-accordion",0),ui(1,e7e,2,1,null,null,Ea),Q()),t&2&&(oe(),hi(r.keys()))},dependencies:[i,kc,ry,qm,Zm,iy],styles:[".mat-expansion-panel-body{padding:0 5px 5px!important}.indent[_ngcontent-%COMP%]{padding-left:24px}"]})};var hA=(i,e)=>e.label;function t7e(i,e){i&1&&Ge(0,"span",5)}function i7e(i,e){if(i&1&&(Ge(0,"span",4),je(1,t7e,1,0,"span",5)),i&2){let t=e.$index,r=Se();oe(),Je(r.previousStops.length-1!==t?1:-1)}}function r7e(i,e){i&1&&Ge(0,"span",5)}function n7e(i,e){if(i&1&&(je(0,r7e,1,0,"span",5),Ge(1,"span",4)),i&2){let t=Se();Je(t.previousStops.length>0?0:-1)}}function a7e(i,e){i&1&&Ge(0,"span",6)}function o7e(i,e){if(i&1&&(je(0,a7e,1,0,"span",6),Ge(1,"span",7)),i&2){let t=e.$index,r=Se();Je(t!==0||r.previousStops.length>0||r.currentStop!==null?0:-1)}}function s7e(i,e){if(i&1){let t=vt();Z(0,"span",8),Le("click",function(){let n=Ee(t).$implicit,a=Se();return Ae(a.selectStop(n))})("keydown.enter",function(){let n=Ee(t).$implicit,a=Se();return Ae(a.selectStop(n))})("mouseenter",function(){let n=Ee(t).$implicit,a=Se();return Ae(a.preselectStop(n))})("mouseleave",function(){Ee(t);let n=Se();return Ae(n.unpreselectStop())}),ce(1),Q()}if(i&2){let t=e.$implicit;Re("matTooltip","Select stop")("matTooltipPosition","after"),oe(),Ti(t.label)}}function l7e(i,e){if(i&1){let t=vt();Z(0,"span",8),Le("click",function(){Ee(t);let n=Se();return Ae(n.selectStop(n.currentStop))})("keydown.enter",function(){Ee(t);let n=Se();return Ae(n.selectStop(n.currentStop))})("mouseenter",function(){Ee(t);let n=Se();return Ae(n.preselectStop(n.currentStop))})("mouseleave",function(){Ee(t);let n=Se();return Ae(n.unpreselectStop())}),ce(1),Q()}if(i&2){let t=Se();Re("matTooltip","Select stop")("matTooltipPosition","after"),oe(),Ti(t.currentStop.label)}}function c7e(i,e){if(i&1){let t=vt();Z(0,"span",8),Le("click",function(){let n=Ee(t).$implicit,a=Se();return Ae(a.selectStop(n))})("keydown.enter",function(){let n=Ee(t).$implicit,a=Se();return Ae(a.selectStop(n))})("mouseenter",function(){let n=Ee(t).$implicit,a=Se();return Ae(a.preselectStop(n))})("mouseleave",function(){Ee(t);let n=Se();return Ae(n.unpreselectStop())}),ce(1),Q()}if(i&2){let t=e.$implicit;Re("matTooltip","Select stop")("matTooltipPosition","after"),oe(),Ti(t.label)}}var dA=class i{constructor(e){this.animationService=e;this.previousStops=[],this.currentStop=null,this.nextStops=[]}previousStops;currentStop;nextStops;unpreselectStop(){this.animationService.unpreselectEntity()}preselectStop(e){this.animationService.preselectEntity(e,!1)}selectStop(e){this.animationService.selectEntity(e)}static \u0275fac=function(t){return new(t||i)(rt(Mr))};static \u0275cmp=tt({type:i,selectors:[["app-selected-entity-route"]],inputs:{previousStops:"previousStops",currentStop:"currentStop",nextStops:"nextStops"},decls:13,vars:2,consts:[[1,"flex-row"],[1,"flex-column","center",2,"padding","5px 0px"],[1,"flex-column","space-between"],["tabindex","0",1,"clickable-no-padding",3,"matTooltip","matTooltipPosition"],[1,"dot","route-done"],[1,"line","route-done"],[1,"line","route-left"],[1,"dot","route-left"],["tabindex","0",1,"clickable-no-padding",3,"click","keydown.enter","mouseenter","mouseleave","matTooltip","matTooltipPosition"]],template:function(t,r){t&1&&(Z(0,"div",0)(1,"div",1),ui(2,i7e,2,1,null,null,hA),je(4,n7e,2,1),ui(5,o7e,2,1,null,null,hA),Q(),Z(7,"div",2),ui(8,s7e,2,3,"span",3,hA),je(10,l7e,2,3,"span",3),ui(11,c7e,2,3,"span",3,hA),Q()()),t&2&&(oe(2),hi(r.previousStops),oe(2),Je(r.currentStop!==null?4:-1),oe(),hi(r.nextStops),oe(3),hi(r.previousStops),oe(2),Je(r.currentStop!==null?10:-1),oe(),hi(r.nextStops))},dependencies:[Rn,Da],styles:[".dot[_ngcontent-%COMP%]{height:1rem;width:1rem;border-radius:50%;display:inline-block}.line[_ngcontent-%COMP%]{height:.75rem;width:2px;display:inline-block}.flex-row[_ngcontent-%COMP%]{display:flex;flex-direction:row;height:100%;gap:5px;justify-content:start;align-items:center}.flex-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.center[_ngcontent-%COMP%]{justify-content:center;align-items:center}.space-between[_ngcontent-%COMP%]{justify-content:space-between;align-self:stretch}.route-done[_ngcontent-%COMP%]{background-color:#666}.route-left[_ngcontent-%COMP%]{background-color:#028a0f}.clickable-no-padding[_ngcontent-%COMP%]{cursor:pointer;border-radius:.5rem}.clickable-no-padding[_ngcontent-%COMP%]:hover{background-color:#1a1b1f14}"]})};var pA=(i,e)=>e.id;function u7e(i,e){if(i&1){let t=vt();Z(0,"mat-card")(1,"mat-card-content",7),Le("click",function(){Ee(t);let n=Se(2);return Ae(n.selectEntity(n.selectedPassengerStop))})("keydown.enter",function(){Ee(t);let n=Se(2);return Ae(n.selectEntity(n.selectedPassengerStop))})("mouseenter",function(){Ee(t);let n=Se(2);return Ae(n.preselectEntity(n.selectedPassengerStop))})("mouseleave",function(){Ee(t);let n=Se(2);return Ae(n.unpreselectEntity())}),Z(2,"b"),ce(3,"Stop: "),Q(),Ge(4,"app-entity-name",8),Q()()}if(i&2){let t=Se(2);oe(),Re("matTooltip","Select stop")("matTooltipPosition","after"),oe(3),Re("name",t.selectedPassengerStop.name)("tags",t.selectedPassengerStop.tags)}}function h7e(i,e){if(i&1){let t=vt();Z(0,"mat-card")(1,"mat-card-content",7),Le("click",function(){Ee(t);let n=Se(2);return Ae(n.selectEntity(n.selectedPassengerVehicle))})("keydown.enter",function(){Ee(t);let n=Se(2);return Ae(n.selectEntity(n.selectedPassengerVehicle))})("mouseenter",function(){Ee(t);let n=Se(2);return Ae(n.preselectEntity(n.selectedPassengerVehicle))})("mouseleave",function(){Ee(t);let n=Se(2);return Ae(n.unpreselectEntity())}),Z(2,"b"),ce(3,"Vehicle: "),Q(),Ge(4,"app-entity-name",8),Q()()}if(i&2){let t=Se(2);oe(),Re("matTooltip","Select vehicle")("matTooltipPosition","after"),oe(3),Re("name",t.selectedPassengerVehicle.name)("tags",t.selectedPassengerVehicle.tags)}}function d7e(i,e){if(i&1&&(Z(0,"mat-card")(1,"mat-card-content",9)(2,"b"),ce(3,"Error:"),Q(),ce(4),Q()()),i&2){let t=Se(2);oe(4),_t(" ",t.selectedPassenger.error," ")}}function m7e(i,e){if(i&1){let t=vt();Ri(0),Z(1,"div",14),Le("click",function(){Ee(t);let n=fi(0),a=Se(3);return Ae(a.selectEntity(n))})("keydown.enter",function(){Ee(t);let n=fi(0),a=Se(3);return Ae(a.selectEntity(n))}),ce(2),Q()}if(i&2){let t=Se().$implicit;Se(2);let r=fi(0),n=hr(r.vehicles[t.assignedVehicleId]);oe(),Re("matTooltip","Select vehicle")("matTooltipPosition","after"),oe(),_t(" Vehicle: ",n.name," ")}}function p7e(i,e){if(i&1&&(Z(0,"b"),ce(1),Q()),i&2){let t=Se().$implicit;oe(),Ti(t.assignedVehicleId)}}function f7e(i,e){if(i&1){let t=vt();Z(0,"div",10),Le("mouseenter",function(){let n=Ee(t).$index,a=Se(2);return Ae(a.highlightLeg(n))})("mouseleave",function(){Ee(t);let n=Se(2);return Ae(n.unhighlightLeg())}),Z(1,"div",11),je(2,m7e,3,4,"div",12)(3,p7e,2,1,"b"),Q(),Ge(4,"app-selected-entity-route",13),Q()}if(i&2){let t=e.$implicit,r=Se(2),n=fi(0);oe(2),Je(n!==null&&t.assignedVehicleId!==null?2:3),oe(2),Re("previousStops",r.selectedPassengerLegPreviousStops)("currentStop",r.selectedPassengerLegCurrentStop)("nextStops",r.selectedPassengerLegNextStops)}}function g7e(i,e){if(i&1){let t=vt();Ri(0),Z(1,"mat-card-title",1),ce(2,"Selected Passenger "),Z(3,"button",2),Le("click",function(){Ee(t);let n=Se();return Ae(n.toggleFavoriteEntity(n.selectedPassenger))}),Z(4,"mat-icon"),ce(5),Q()()(),Z(6,"div",3)(7,"div",4)(8,"mat-card")(9,"mat-card-content",5,0),Le("click",function(){Ee(t);let n=Se();return Ae(n.copyToClipboard(n.selectedPassenger.id))})("keydown.enter",function(){Ee(t);let n=Se();return Ae(n.copyToClipboard(n.selectedPassenger.id))}),Z(11,"b"),ce(12,"Id:"),Q(),ce(13),Q()(),Z(14,"mat-card")(15,"mat-card-content",5),Le("click",function(){Ee(t);let n=Se();return Ae(n.copyToClipboard(n.selectedPassenger.name))})("keydown.enter",function(){Ee(t);let n=Se();return Ae(n.copyToClipboard(n.selectedPassenger.name))}),Z(16,"b"),ce(17,"Name:"),Q(),ce(18),Q()(),Z(19,"mat-card")(20,"mat-card-content")(21,"b"),ce(22,"Status:"),Q(),ce(23),Q()(),Z(24,"mat-card")(25,"mat-card-content")(26,"b"),ce(27,"Number of passenger:"),Q(),ce(28),Q()(),Z(29,"mat-card")(30,"mat-card-content")(31,"b"),ce(32,"Tags:"),Q(),ce(33),Q()(),je(34,u7e,5,4,"mat-card")(35,h7e,5,4,"mat-card")(36,d7e,5,1,"mat-card"),Q(),Z(37,"mat-accordion")(38,"mat-expansion-panel")(39,"mat-expansion-panel-header")(40,"mat-panel-title"),ce(41,"Passenger route"),Q()(),Z(42,"div",6),ui(43,f7e,5,4,"div",3,_o),Q()()()()}if(i&2){let t=Se(),r=t.isFavoriteEntity(t.selectedPassenger);oe(3),Re("matTooltip",r?"Remove from favorite":"Add to favorite")("matTooltipPosition","after"),oe(2),Ti(r?"favorite":"favorite_outline"),oe(4),Re("matTooltip","Click to copy")("matTooltipPosition","after"),oe(4),_t(" ",t.truncateId(t.selectedPassenger.id)," "),oe(2),Re("matTooltip","Click to copy")("matTooltipPosition","after"),oe(3),_t(" ",t.selectedPassenger.name," "),oe(5),_t(" ",t.selectedPassenger.status," "),oe(5),_t(" ",t.selectedPassenger.numberOfPassengers," "),oe(5),_t(" ",t.selectedPassenger.tags.length>0?t.selectedPassenger.tags.join(", "):"None"," "),oe(),Je(t.selectedPassengerStop!==null?34:-1),oe(),Je(t.selectedPassengerVehicle!==null?35:-1),oe(),Je(t.selectedPassenger.error!==null?36:-1),oe(7),hi(t.selectedPassengerLegs)}}function y7e(i,e){if(i&1){let t=vt();Z(0,"mat-card")(1,"mat-card-content",5),Le("click",function(){Ee(t);let n=Se(2);return Ae(n.copyToClipboard(n.selectedVehicle.mode))})("keydown.enter",function(){Ee(t);let n=Se(2);return Ae(n.copyToClipboard(n.selectedVehicle.mode))}),Z(2,"b"),ce(3,"Mode:"),Q(),ce(4),Q()()}if(i&2){let t=Se(2);oe(),Re("matTooltip","Click to copy")("matTooltipPosition","after"),oe(3),_t(" ",t.selectedVehicle.mode," ")}}function _7e(i,e){if(i&1){let t=vt();Z(0,"mat-card")(1,"mat-card-content",5),Le("click",function(){Ee(t);let n=Se(2);return Ae(n.selectEntity(n.selectedVehicleStop))})("keydown.enter",function(){Ee(t);let n=Se(2);return Ae(n.selectEntity(n.selectedVehicleStop))}),Z(2,"b"),ce(3,"Stop:"),Q(),Ge(4,"app-entity-name",8),Q()()}if(i&2){let t=Se(2);oe(),Re("matTooltip","Select stop")("matTooltipPosition","after"),oe(3),Re("name",t.selectedVehicleStop.name)("tags",t.selectedVehicleStop.tags)}}function b7e(i,e){if(i&1&&(Z(0,"mat-card")(1,"mat-card-content",15)(2,"b"),ce(3,"Error:"),Q(),ce(4),Q()()),i&2){let t=Se(2);oe(4),_t(" ",t.selectedVehicle.error," ")}}function v7e(i,e){if(i&1){let t=vt();Z(0,"div",17),Le("click",function(){let n=Ee(t).$implicit,a=Se(3);return Ae(a.selectEntity(n))})("keydown.enter",function(){let n=Ee(t).$implicit,a=Se(3);return Ae(a.selectEntity(n))})("mouseenter",function(){let n=Ee(t).$implicit,a=Se(3);return Ae(a.preselectEntity(n))})("mouseleave",function(){Ee(t);let n=Se(3);return Ae(n.unpreselectEntity())}),Ge(1,"app-entity-name",8),Q()}if(i&2){let t=e.$implicit;Re("matTooltip","Select passenger")("matTooltipPosition","after"),oe(),Re("name",t.name)("tags",t.tags)}}function S7e(i,e){if(i&1&&(Z(0,"mat-accordion")(1,"mat-expansion-panel")(2,"mat-expansion-panel-header")(3,"mat-panel-title"),ce(4),Q()(),Z(5,"div",3),ui(6,v7e,2,4,"div",16,pA),Q()()()),i&2){let t=Se(2);oe(4),_t(" Passengers on board (",t.selectedVehiclePassengers.length,")"),oe(2),hi(t.selectedVehiclePassengers)}}function k7e(i,e){if(i&1){let t=vt();Ri(0),Z(1,"mat-card-title",1),ce(2,"Selected Vehicle "),Z(3,"button",2),Le("click",function(){Ee(t);let n=Se();return Ae(n.toggleFavoriteEntity(n.selectedVehicle))}),Z(4,"mat-icon"),ce(5),Q()()(),Z(6,"div",3)(7,"div",4)(8,"mat-card")(9,"mat-card-content",5),Le("click",function(){Ee(t);let n=Se();return Ae(n.copyToClipboard(n.selectedVehicle.id))})("keydown.enter",function(){Ee(t);let n=Se();return Ae(n.copyToClipboard(n.selectedVehicle.id))}),Z(10,"b"),ce(11,"Id:"),Q(),ce(12),Q()(),Z(13,"mat-card")(14,"mat-card-content",5),Le("click",function(){Ee(t);let n=Se();return Ae(n.copyToClipboard(n.selectedVehicle.name))})("keydown.enter",function(){Ee(t);let n=Se();return Ae(n.copyToClipboard(n.selectedVehicle.name))}),Z(15,"b"),ce(16,"Name:"),Q(),ce(17),Q()(),je(18,y7e,5,3,"mat-card"),Z(19,"mat-card")(20,"mat-card-content")(21,"b"),ce(22,"Status:"),Q(),ce(23),Q()(),Z(24,"mat-card")(25,"mat-card-content")(26,"b"),ce(27,"Capacity:"),Q(),ce(28),Q()(),Z(29,"mat-card")(30,"mat-card-content")(31,"b"),ce(32,"Tags:"),Q(),ce(33),Q()(),Z(34,"mat-card")(35,"mat-card-content")(36,"b"),ce(37,"Passenger Tags:"),Q(),ce(38),Q()(),je(39,_7e,5,4,"mat-card")(40,b7e,5,1,"mat-card"),Q(),je(41,S7e,8,1,"mat-accordion"),Z(42,"mat-accordion")(43,"mat-expansion-panel")(44,"mat-expansion-panel-header")(45,"mat-panel-title"),ce(46,"Vehicle route"),Q()(),Z(47,"div",3),Ge(48,"app-selected-entity-route",13),Q()()()()}if(i&2){let t=Se(),r=t.isFavoriteEntity(t.selectedVehicle);oe(3),Re("matTooltip",r?"Remove from favorite":"Add to favorite")("matTooltipPosition","after"),oe(2),Ti(r?"favorite":"favorite_outline"),oe(4),Re("matTooltip","Click to copy")("matTooltipPosition","after"),oe(3),_t(" ",t.truncateId(t.selectedVehicle.id)," "),oe(2),Re("matTooltip","Click to copy")("matTooltipPosition","after"),oe(3),_t(" ",t.selectedVehicle.name," "),oe(),Je(t.selectedVehicle.mode!==null?18:-1),oe(5),_t(" ",t.selectedVehicle.status," "),oe(5),_t(" ",t.selectedVehicle.capacity," "),oe(5),_t(" ",t.selectedVehicle.tags.length>0?t.selectedVehicle.tags.join(", "):"None"," "),oe(5),_t(" ",t.selectedVehiclePassengerTags.length>0?t.selectedVehiclePassengerTags.join(", "):"None"," "),oe(),Je(t.selectedVehicleStop!==null?39:-1),oe(),Je(t.selectedVehicle.error!==null?40:-1),oe(),Je(t.selectedVehiclePassengers.length>0?41:-1),oe(7),Re("previousStops",t.selectedVehicle.previousStops)("currentStop",t.selectedVehicle.currentStop)("nextStops",t.selectedVehicle.nextStops)}}function x7e(i,e){if(i&1&&(Z(0,"mat-card")(1,"mat-card-content",18)(2,"b"),ce(3,"Error:"),Q(),ce(4),Q()()),i&2){let t=Se(2);oe(4),_t(" ",t.selectedStop.error," ")}}function w7e(i,e){if(i&1){let t=vt();Z(0,"div",17),Le("click",function(){let n=Ee(t).$implicit,a=Se(3);return Ae(a.selectEntity(n))})("keydown.enter",function(){let n=Ee(t).$implicit,a=Se(3);return Ae(a.selectEntity(n))})("mouseenter",function(){let n=Ee(t).$implicit,a=Se(3);return Ae(a.preselectEntity(n))})("mouseleave",function(){Ee(t);let n=Se(3);return Ae(n.unpreselectEntity())}),Ge(1,"app-entity-name",8),Q()}if(i&2){let t=e.$implicit;Re("matTooltip","Select passenger")("matTooltipPosition","after"),oe(),Re("name",t.name)("tags",t.tags)}}function C7e(i,e){if(i&1&&(Z(0,"mat-accordion")(1,"mat-expansion-panel")(2,"mat-expansion-panel-header")(3,"mat-panel-title"),ce(4),Q()(),Z(5,"div",3),ui(6,w7e,2,4,"div",16,pA),Q()()()),i&2){let t=Se(2);oe(4),_t(" Passengers at stop (",t.selectedStopWaitingPassengers.length,")"),oe(2),hi(t.selectedStopWaitingPassengers)}}function M7e(i,e){if(i&1){let t=vt();Z(0,"div",17),Le("click",function(){let n=Ee(t).$implicit,a=Se(3);return Ae(a.selectEntity(n))})("keydown.enter",function(){let n=Ee(t).$implicit,a=Se(3);return Ae(a.selectEntity(n))})("mouseenter",function(){let n=Ee(t).$implicit,a=Se(3);return Ae(a.preselectEntity(n))})("mouseleave",function(){Ee(t);let n=Se(3);return Ae(n.unpreselectEntity())}),Ge(1,"app-entity-name",8),Q()}if(i&2){let t=e.$implicit;Re("matTooltip","Select passenger")("matTooltipPosition","after"),oe(),Re("name",t.name)("tags",t.tags)}}function T7e(i,e){if(i&1&&(Z(0,"mat-accordion")(1,"mat-expansion-panel")(2,"mat-expansion-panel-header")(3,"mat-panel-title"),ce(4),Q()(),Z(5,"div",3),ui(6,M7e,2,4,"div",16,pA),Q()()()),i&2){let t=Se(2);oe(4),_t(" Trips completed (",t.selectedStopCompletedPassengers.length,")"),oe(2),hi(t.selectedStopCompletedPassengers)}}function E7e(i,e){if(i&1){let t=vt();Z(0,"div",17),Le("click",function(){let n=Ee(t).$implicit,a=Se(3);return Ae(a.selectEntity(n))})("keydown.enter",function(){let n=Ee(t).$implicit,a=Se(3);return Ae(a.selectEntity(n))})("mouseenter",function(){let n=Ee(t).$implicit,a=Se(3);return Ae(a.preselectEntity(n))})("mouseleave",function(){Ee(t);let n=Se(3);return Ae(n.unpreselectEntity())}),Ge(1,"app-entity-name",8),Q()}if(i&2){let t=e.$implicit;Re("matTooltip","Select vehicle")("matTooltipPosition","after"),oe(),Re("name",t.name)("tags",t.tags)}}function A7e(i,e){if(i&1&&(Z(0,"mat-accordion")(1,"mat-expansion-panel")(2,"mat-expansion-panel-header")(3,"mat-panel-title"),ce(4),Q()(),Z(5,"div",3),ui(6,E7e,2,4,"div",16,pA),Q()()()),i&2){let t=Se(2);oe(4),_t(" Vehicles at stop (",t.selectedStopVehicles.length,")"),oe(2),hi(t.selectedStopVehicles)}}function P7e(i,e){if(i&1){let t=vt();Ri(0),Z(1,"mat-card-title",1),ce(2,"Selected Stop "),Z(3,"button",2),Le("click",function(){Ee(t);let n=Se();return Ae(n.toggleFavoriteEntity(n.selectedStop))}),Z(4,"mat-icon"),ce(5),Q()()(),Z(6,"div",3)(7,"div",4)(8,"mat-card")(9,"mat-card-content")(10,"b"),ce(11,"Label:"),Q(),ce(12),Q()(),Z(13,"mat-card")(14,"mat-card-content")(15,"b"),ce(16,"Capacity:"),Q(),ce(17),Q()(),Z(18,"mat-card")(19,"mat-card-content")(20,"b"),ce(21,"Tags:"),Q(),ce(22),Q()(),Z(23,"mat-card")(24,"mat-card-content")(25,"b"),ce(26,"Passenger Tags:"),Q(),ce(27),Q()(),Z(28,"mat-card")(29,"mat-card-content")(30,"b"),ce(31,"Position:"),Q(),ce(32),Q()(),je(33,x7e,5,1,"mat-card"),Q(),je(34,C7e,8,1,"mat-accordion")(35,T7e,8,1,"mat-accordion")(36,A7e,8,1,"mat-accordion"),Q()}if(i&2){let t=Se(),r=t.isFavoriteEntity(t.selectedStop);oe(3),Re("matTooltip",r?"Remove from favorite":"Add to favorite")("matTooltipPosition","after"),oe(2),Ti(r?"favorite":"favorite_outline"),oe(7),_t(" ",t.selectedStop.label," "),oe(5),_t(" ",t.selectedStop.capacity," "),oe(5),_t(" ",t.selectedStop.tags.length>0?t.selectedStop.tags.join(", "):"None"," "),oe(5),_t(" ",t.selectedStopPassengerTags.length>0?t.selectedStopPassengerTags.join(", "):"None"," "),oe(5),R_(" ",t.selectedStop.position.latitude,", ",t.selectedStop.position.longitude," "),oe(),Je(t.selectedStop.error!==null?33:-1),oe(),Je(t.selectedStopWaitingPassengers.length>0?34:-1),oe(),Je(t.selectedStopCompletedPassengers.length>0?35:-1),oe(),Je(t.selectedStopVehicles.length>0?36:-1)}}var mA=class i{constructor(e,t,r,n){this.animationService=e;this.favoriteEntitiesService=t;this.snackBar=r;this.visualizationService=n}selectedPassenger=null;selectedPassengerStop=null;selectedPassengerVehicle=null;selectedVehicle=null;selectedVehicleStop=null;selectedVehiclePassengers=[];selectedStop=null;selectedStopWaitingPassengers=[];selectedStopCompletedPassengers=[];selectedStopVehicles=[];get selectedPassengerLegs(){let e=this.selectedPassenger;return e===null?[]:td(e)}get environmentSignal(){return this.visualizationService.environmentSignal}get selectedVehiclePassengerTags(){return this.selectedVehiclePassengers.flatMap(t=>t.tags).filter((t,r,n)=>n.indexOf(t)===r).sort((t,r)=>t.localeCompare(r))}get selectedStopPassengerTags(){return this.selectedStopWaitingPassengers.flatMap(t=>t.tags).filter((t,r,n)=>n.indexOf(t)===r).sort((t,r)=>t.localeCompare(r))}get selectedPassengerLegStops(){if(this.selectedPassenger===null)return[];if(this.selectedPassenger.currentLeg===null)return[];if(this.selectedPassengerVehicle===null)return[];if(this.selectedPassenger.currentLeg.boardingStopIndex===null||this.selectedPassenger.currentLeg.alightingStopIndex===null)return[];let e=Bl(this.selectedPassengerVehicle);return this.selectedPassenger.currentLeg.boardingStopIndex<0||this.selectedPassenger.currentLeg.boardingStopIndex>=e.length||this.selectedPassenger.currentLeg.alightingStopIndex<0||this.selectedPassenger.currentLeg.alightingStopIndex>=e.length?[]:e.slice(this.selectedPassenger.currentLeg.boardingStopIndex,this.selectedPassenger.currentLeg.alightingStopIndex+1)}get selectedPassengerLegPreviousStops(){return this.selectedPassengerLegStops.filter(e=>e.stopType==="previous")}get selectedPassengerLegCurrentStop(){return this.selectedPassengerLegStops.find(e=>e.stopType==="current")??null}get selectedPassengerLegNextStops(){return this.selectedPassengerLegStops.filter(e=>e.stopType==="next")}copyToClipboard(e){navigator.clipboard.writeText(e).then(()=>{this.snackBar.open("Copied to clipboard!","Close",{duration:2e3})}).catch(t=>{console.error("Failed to copy text: ",t),this.snackBar.open("Failed to copy!","Close",{duration:2e3})})}truncateId(e){return e.length>20?`${e.slice(0,20)}...`:e}isFavoriteEntity(e){return this.favoriteEntitiesService.isFavoriteEntity(e)}toggleFavoriteEntity(e){this.favoriteEntitiesService.toggleFavoriteEntity(e)}preselectEntity(e){this.animationService.preselectEntity(e,!1)}unpreselectEntity(){this.animationService.unpreselectEntity()}selectEntity(e){this.animationService.selectEntity(e)}highlightLeg(e){this.selectedPassenger&&this.animationService.highlightLeg(e)}unhighlightLeg(){this.animationService.unhighlightLeg()}static \u0275fac=function(t){return new(t||i)(rt(Mr),rt(xd),rt(dM),rt(Ln))};static \u0275cmp=tt({type:i,selectors:[["app-selected-entity-tab"]],inputs:{selectedPassenger:"selectedPassenger",selectedPassengerStop:"selectedPassengerStop",selectedPassengerVehicle:"selectedPassengerVehicle",selectedVehicle:"selectedVehicle",selectedVehicleStop:"selectedVehicleStop",selectedVehiclePassengers:"selectedVehiclePassengers",selectedStop:"selectedStop",selectedStopWaitingPassengers:"selectedStopWaitingPassengers",selectedStopCompletedPassengers:"selectedStopCompletedPassengers",selectedStopVehicles:"selectedStopVehicles"},decls:4,vars:4,consts:[["idElement",""],[2,"display","flex","align-items","center","gap","8px"],["mat-icon-button","","disableRipple","",2,"padding","0","border","none",3,"click","matTooltip","matTooltipPosition"],[1,"flex-column","gap-0-5-rem"],[1,"mat-card-group"],[1,"clickable-no-padding",3,"click","keydown.enter","matTooltip","matTooltipPosition"],[1,"flex-column","gap-1-5-rem"],[1,"clickable-no-padding",3,"click","keydown.enter","mouseenter","mouseleave","matTooltip","matTooltipPosition"],[3,"name","tags"],["matTooltip","The passenger is not displayed"],[1,"flex-column","gap-0-5-rem",3,"mouseenter","mouseleave"],[1,"indent"],["tabindex","0",1,"clickable-no-padding",3,"matTooltip","matTooltipPosition"],[1,"indent",3,"previousStops","currentStop","nextStops"],["tabindex","0",1,"clickable-no-padding",3,"click","keydown.enter","matTooltip","matTooltipPosition"],["matTooltip","The vehicle is not displayed"],["tabindex","0",1,"clickable","indent",3,"matTooltip","matTooltipPosition"],["tabindex","0",1,"clickable","indent",3,"click","keydown.enter","mouseenter","mouseleave","matTooltip","matTooltipPosition"],["matTooltip","The stop is not displayed."]],template:function(t,r){t&1&&(Ri(0),je(1,g7e,45,15)(2,k7e,49,20)(3,P7e,37,13)),t&2&&(hr(r.environmentSignal()),oe(),Je(r.selectedPassenger!==null?1:-1),oe(),Je(r.selectedVehicle!==null?2:-1),oe(),Je(r.selectedStop!==null?3:-1))},dependencies:[ia,ea,ta,bM,Rn,Da,pr,mr,kc,ry,qm,Zm,iy,dA,Ah,rl],styles:[".flex-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.flex-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.align-center[_ngcontent-%COMP%], .align-main-center[_ngcontent-%COMP%]{justify-content:center}.align-center[_ngcontent-%COMP%], .align-cross-center[_ngcontent-%COMP%]{align-items:center}.align-main-end[_ngcontent-%COMP%]{justify-content:flex-end}.align-cross-end[_ngcontent-%COMP%]{align-items:flex-end}.align-main-start[_ngcontent-%COMP%]{justify-content:flex-start}.align-cross-start[_ngcontent-%COMP%]{align-items:flex-start}.align-cross-stretch[_ngcontent-%COMP%]{align-items:stretch}.gap-0-5-rem[_ngcontent-%COMP%]{gap:.5rem}.gap-1-rem[_ngcontent-%COMP%]{gap:1rem}.gap-1-5-rem[_ngcontent-%COMP%]{gap:1.5rem}.flex-1[_ngcontent-%COMP%]{flex:1}.clickable[_ngcontent-%COMP%]{cursor:pointer;padding:.5rem 0;border-radius:.5rem}.clickable[_ngcontent-%COMP%]:hover{background-color:#1a1b1f14}.clickable-no-padding[_ngcontent-%COMP%]{cursor:pointer;border-radius:.5rem}.clickable-no-padding[_ngcontent-%COMP%]:hover{background-color:#1a1b1f14}.indent[_ngcontent-%COMP%]{padding-left:24px} .mat-expansion-panel-body{padding:0 5px 5px!important}.mat-card-group[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]:first-child{border-bottom-left-radius:0;border-bottom-right-radius:0}.mat-card-group[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]:last-child{border-top-left-radius:0;border-top-right-radius:0}.mat-card-group[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]:not(:first-child):not(:last-child){border-radius:0}"]})};var x5=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function w5(i,e,t,r){i.addEventListener?i.addEventListener(e,t,r):i.attachEvent&&i.attachEvent("on".concat(e),t)}function vk(i,e,t,r){i.removeEventListener?i.removeEventListener(e,t,r):i.detachEvent&&i.detachEvent("on".concat(e),t)}function ame(i,e){let t=e.slice(0,e.length-1);for(let r=0;r<t.length;r++)t[r]=i[t[r].toLowerCase()];return t}function ome(i){typeof i!="string"&&(i=""),i=i.replace(/\s/g,"");let e=i.split(","),t=e.lastIndexOf("");for(;t>=0;)e[t-1]+=",",e.splice(t,1),t=e.lastIndexOf("");return e}function B7e(i,e){let t=i.length>=e.length?i:e,r=i.length>=e.length?e:i,n=!0;for(let a=0;a<t.length;a++)r.indexOf(t[a])===-1&&(n=!1);return n}var kk={backspace:8,"\u232B":8,tab:9,clear:12,enter:13,"\u21A9":13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"\u21EA":20,",":188,".":190,"/":191,"`":192,"-":x5?173:189,"=":x5?61:187,";":x5?59:186,"'":222,"[":219,"]":221,"\\":220},Nc={"\u21E7":16,shift:16,"\u2325":18,alt:18,option:18,"\u2303":17,ctrl:17,control:17,"\u2318":91,cmd:91,command:91},gA={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},va={16:!1,18:!1,17:!1,91:!1},un={};for(let i=1;i<20;i++)kk["f".concat(i)]=111+i;var Yr=[],Sk=null,sme="all",th=new Map,wk=i=>kk[i.toLowerCase()]||Nc[i.toLowerCase()]||i.toUpperCase().charCodeAt(0),R7e=i=>Object.keys(kk).find(e=>kk[e]===i),D7e=i=>Object.keys(Nc).find(e=>Nc[e]===i);function lme(i){sme=i||"all"}function xk(){return sme||"all"}function L7e(){return Yr.slice(0)}function I7e(){return Yr.map(i=>R7e(i)||D7e(i)||String.fromCharCode(i))}function F7e(){let i=[];return Object.keys(un).forEach(e=>{un[e].forEach(t=>{let{key:r,scope:n,mods:a,shortcut:o}=t;i.push({scope:n,shortcut:o,mods:a,keys:r.split("+").map(s=>wk(s))})})}),i}function O7e(i){let e=i.target||i.srcElement,{tagName:t}=e,r=!0,n=t==="INPUT"&&!["checkbox","radio","range","button","file","reset","submit","color"].includes(e.type);return(e.isContentEditable||(n||t==="TEXTAREA"||t==="SELECT")&&!e.readOnly)&&(r=!1),r}function z7e(i){return typeof i=="string"&&(i=wk(i)),Yr.indexOf(i)!==-1}function H7e(i,e){let t,r;i||(i=xk());for(let n in un)if(Object.prototype.hasOwnProperty.call(un,n))for(t=un[n],r=0;r<t.length;)t[r].scope===i?t.splice(r,1).forEach(o=>{let{element:s}=o;return M5(s)}):r++;xk()===i&&lme(e||"all")}function N7e(i){let e=i.keyCode||i.which||i.charCode,t=Yr.indexOf(e);if(t>=0&&Yr.splice(t,1),i.key&&i.key.toLowerCase()==="meta"&&Yr.splice(0,Yr.length),(e===93||e===224)&&(e=91),e in va){va[e]=!1;for(let r in Nc)Nc[r]===e&&(Sa[r]=!1)}}function cme(i){if(typeof i>"u")Object.keys(un).forEach(n=>{Array.isArray(un[n])&&un[n].forEach(a=>fA(a)),delete un[n]}),M5(null);else if(Array.isArray(i))i.forEach(n=>{n.key&&fA(n)});else if(typeof i=="object")i.key&&fA(i);else if(typeof i=="string"){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];let[n,a]=t;typeof n=="function"&&(a=n,n=""),fA({key:i,scope:n,method:a,splitKey:"+"})}}var fA=i=>{let{key:e,scope:t,method:r,splitKey:n="+"}=i;ome(e).forEach(o=>{let s=o.split(n),l=s.length,c=s[l-1],u=c==="*"?"*":wk(c);if(!un[u])return;t||(t=xk());let h=l>1?ame(Nc,s):[],d=[];un[u]=un[u].filter(p=>{let g=(r?p.method===r:!0)&&p.scope===t&&B7e(p.mods,h);return g&&d.push(p.element),!g}),d.forEach(p=>M5(p))})};function rme(i,e,t,r){if(e.element!==r)return;let n;if(e.scope===t||e.scope==="all"){n=e.mods.length>0;for(let a in va)Object.prototype.hasOwnProperty.call(va,a)&&(!va[a]&&e.mods.indexOf(+a)>-1||va[a]&&e.mods.indexOf(+a)===-1)&&(n=!1);(e.mods.length===0&&!va[16]&&!va[18]&&!va[17]&&!va[91]||n||e.shortcut==="*")&&(e.keys=[],e.keys=e.keys.concat(Yr),e.method(i,e)===!1&&(i.preventDefault?i.preventDefault():i.returnValue=!1,i.stopPropagation&&i.stopPropagation(),i.cancelBubble&&(i.cancelBubble=!0)))}}function nme(i,e){let t=un["*"],r=i.keyCode||i.which||i.charCode;if(!Sa.filter.call(this,i))return;if((r===93||r===224)&&(r=91),Yr.indexOf(r)===-1&&r!==229&&Yr.push(r),["metaKey","ctrlKey","altKey","shiftKey"].forEach(s=>{let l=gA[s];i[s]&&Yr.indexOf(l)===-1?Yr.push(l):!i[s]&&Yr.indexOf(l)>-1?Yr.splice(Yr.indexOf(l),1):s==="metaKey"&&i[s]&&(Yr=Yr.filter(c=>c in gA||c===r))}),r in va){va[r]=!0;for(let s in Nc)Nc[s]===r&&(Sa[s]=!0);if(!t)return}for(let s in va)Object.prototype.hasOwnProperty.call(va,s)&&(va[s]=i[gA[s]]);i.getModifierState&&!(i.altKey&&!i.ctrlKey)&&i.getModifierState("AltGraph")&&(Yr.indexOf(17)===-1&&Yr.push(17),Yr.indexOf(18)===-1&&Yr.push(18),va[17]=!0,va[18]=!0);let n=xk();if(t)for(let s=0;s<t.length;s++)t[s].scope===n&&(i.type==="keydown"&&t[s].keydown||i.type==="keyup"&&t[s].keyup)&&rme(i,t[s],n,e);if(!(r in un))return;let a=un[r],o=a.length;for(let s=0;s<o;s++)if((i.type==="keydown"&&a[s].keydown||i.type==="keyup"&&a[s].keyup)&&a[s].key){let l=a[s],{splitKey:c}=l,u=l.key.split(c),h=[];for(let d=0;d<u.length;d++)h.push(wk(u[d]));h.sort().join("")===Yr.sort().join("")&&rme(i,l,n,e)}}function Sa(i,e,t){Yr=[];let r=ome(i),n=[],a="all",o=document,s=0,l=!1,c=!0,u="+",h=!1,d=!1;for(t===void 0&&typeof e=="function"&&(t=e),Object.prototype.toString.call(e)==="[object Object]"&&(e.scope&&(a=e.scope),e.element&&(o=e.element),e.keyup&&(l=e.keyup),e.keydown!==void 0&&(c=e.keydown),e.capture!==void 0&&(h=e.capture),typeof e.splitKey=="string"&&(u=e.splitKey),e.single===!0&&(d=!0)),typeof e=="string"&&(a=e),d&&cme(i,a);s<r.length;s++)i=r[s].split(u),n=[],i.length>1&&(n=ame(Nc,i)),i=i[i.length-1],i=i==="*"?"*":wk(i),i in un||(un[i]=[]),un[i].push({keyup:l,keydown:c,scope:a,mods:n,shortcut:r[s],method:t,key:r[s],splitKey:u,element:o});if(typeof o<"u"&&window){if(!th.has(o)){let p=function(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;return nme(g,o)},f=function(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;nme(g,o),N7e(g)};th.set(o,{keydownListener:p,keyupListenr:f,capture:h}),w5(o,"keydown",p,h),w5(o,"keyup",f,h)}if(!Sk){let p=()=>{Yr=[]};Sk={listener:p,capture:h},w5(window,"focus",p,h)}}}function G7e(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(un).forEach(t=>{un[t].filter(n=>n.scope===e&&n.shortcut===i).forEach(n=>{n&&n.method&&n.method()})})}function M5(i){let e=Object.values(un).flat();if(e.findIndex(r=>{let{element:n}=r;return n===i})<0){let{keydownListener:r,keyupListenr:n,capture:a}=th.get(i)||{};r&&n&&(vk(i,"keyup",n,a),vk(i,"keydown",r,a),th.delete(i))}if((e.length<=0||th.size<=0)&&(Object.keys(th).forEach(n=>{let{keydownListener:a,keyupListenr:o,capture:s}=th.get(n)||{};a&&o&&(vk(n,"keyup",o,s),vk(n,"keydown",a,s),th.delete(n))}),th.clear(),Object.keys(un).forEach(n=>delete un[n]),Sk)){let{listener:n,capture:a}=Sk;vk(window,"focus",n,a),Sk=null}}var C5={getPressedKeyString:I7e,setScope:lme,getScope:xk,deleteScope:H7e,getPressedKeyCodes:L7e,getAllKeyCodes:F7e,isPressed:z7e,filter:O7e,trigger:G7e,unbind:cme,keyMap:kk,modifier:Nc,modifierMap:gA};for(let i in C5)Object.prototype.hasOwnProperty.call(C5,i)&&(Sa[i]=C5[i]);if(typeof window<"u"){let i=window.hotkeys;Sa.noConflict=e=>(e&&window.hotkeys===Sa&&(window.hotkeys=i),Sa),window.hotkeys=Sa}var V7e=["sliderWrapper"],K7e=(i,e)=>e.start;function W7e(i,e){i&1&&ce(0," -- : -- : -- ")}function U7e(i,e){if(i&1&&(ce(0),Vr(1,"simulationTime")),i&2){let t=Se(3);_t(" ",En(1,1,t.editorVisualisationTimeValueSignal())," ")}}function j7e(i,e){if(i&1&&je(0,W7e,1,0)(1,U7e,2,3),i&2){let t=Se(2);Je(t.editorVisualisationTimeForm.hasError("invalidNumber")?0:1)}}function q7e(i,e){if(i&1&&(ce(0),Vr(1,"simulationTime")),i&2){Se(2);let t=fi(5);_t(" ",En(1,1,t)," ")}}function Z7e(i,e){if(i&1&&(Z(0,"div",18),ce(1),Q()),i&2){let t=Se(2);yr("left",t.sliderTooltipX,"px"),oe(),_t(" ",t.sliderHoverSimulationTime," ")}}function Y7e(i,e){if(i&1&&(Z(0,"mat-slider",16),Ge(1,"input",19)(2,"input",20),Q()),i&2){let t=e.$implicit;Se(2);let r=fi(2),n=fi(3);Re("min",r)("max",n),oe(),Re("value",t.start),oe(),Re("value",t.end)}}function J7e(i,e){if(i&1&&(Z(0,"mat-slider",17),Ge(1,"input",21),Q()),i&2){Se(2);let t=fi(1),r=fi(2),n=fi(3);Re("min",r)("max",n),oe(),Re("value",t.simulationTime)}}function $7e(i,e){if(i&1){let t=vt();Z(0,"mat-card")(1,"mat-card-content",2)(2,"button",3),Le("click",function(){Ee(t);let n=Se(),a=fi(0);return Ae(n.toggleVisualizationPause(a))}),Z(3,"mat-icon"),ce(4),Q()(),Ri(5)(6),Z(7,"button",3),Le("click",function(){Ee(t);let n=Se();return Ae(n.rewindTime())}),Z(8,"mat-icon"),ce(9,"skip_previous"),Q()(),Z(10,"button",4),ce(11),Q(),Z(12,"mat-menu",5,0)(14,"button",6),Le("click",function(){Ee(t);let n=Se();return Ae(n.setSpeed(0))}),ce(15,"x1"),Q(),Z(16,"button",6),Le("click",function(){Ee(t);let n=Se();return Ae(n.setSpeed(1))}),ce(17,"x2"),Q(),Z(18,"button",6),Le("click",function(){Ee(t);let n=Se();return Ae(n.setSpeed(2))}),ce(19,"x4"),Q(),Z(20,"button",6),Le("click",function(){Ee(t);let n=Se();return Ae(n.setSpeed(3))}),ce(21,"x8"),Q(),Z(22,"button",6),Le("click",function(){Ee(t);let n=Se();return Ae(n.setSpeed(4))}),ce(23,"x16"),Q(),Z(24,"button",6),Le("click",function(){Ee(t);let n=Se();return Ae(n.setSpeed(5))}),ce(25,"x32"),Q(),Z(26,"button",6),Le("click",function(){Ee(t);let n=Se();return Ae(n.setSpeed(6))}),ce(27,"x64"),Q(),Z(28,"button",6),Le("click",function(){Ee(t);let n=Se();return Ae(n.setSpeed(7))}),ce(29,"x128"),Q()(),Z(30,"button",3),Le("click",function(){Ee(t);let n=Se();return Ae(n.fastForwardTime())}),Z(31,"mat-icon"),ce(32,"skip_next"),Q()(),Z(33,"button",7),Le("click",function(){Ee(t);let n=Se();return Ae(n.toggleSimulationDirection())}),Z(34,"mat-icon"),ce(35),Q()(),Z(36,"button",3),Le("click",function(){Ee(t);let n=Se();return Ae(n.centerMap())}),Z(37,"mat-icon"),ce(38,"my_location"),Q()(),Z(39,"button",3),Le("click",function(){Ee(t);let n=Se();return Ae(n.toggleShouldFollowEntity())}),Z(40,"mat-icon"),ce(41,"moving"),Q()(),Ri(42),Z(43,"div")(44,"div")(45,"button",8),Vr(46,"number"),Le("click",function(){Ee(t);let n=Se();return Ae(n.openVisualisationTimeEditor())}),je(47,j7e,2,1)(48,q7e,2,3),Q()(),Z(49,"form",9)(50,"mat-form-field",10)(51,"mat-label"),ce(52,"Set Visualisation Time"),Q(),Z(53,"input",11),Le("keyup.enter",function(){Ee(t);let n=Se();return Ae(n.applyVisualisationTime())})("blur",function(){Ee(t);let n=Se();return Ae(n.hideVisualisationTimeEditor())}),Q()()()(),Z(54,"div",12,1),Le("mousemove",function(n){Ee(t);let a=Se();return Ae(a.onSliderMouseMove(n))})("mouseleave",function(){Ee(t);let n=Se();return Ae(n.sliderHoverSimulationTime=null)}),Z(56,"mat-slider",13)(57,"input",14),Le("valueChange",function(n){Ee(t);let a=Se();return Ae(a.onSliderChange(n))}),Q(),je(58,Z7e,2,3,"div",15),Q(),ui(59,Y7e,3,4,"mat-slider",16,K7e),je(61,J7e,2,3,"mat-slider",17),Q(),Z(62,"button",3),Le("click",function(){Ee(t);let n=Se();return Ae(n.leaveVisualization())}),Z(63,"mat-icon"),ce(64,"exit_to_app"),Q()()()()}if(i&2){let t,r=Or(13),n=Se(),a=fi(0),o=fi(1),s=fi(2),l=fi(3),c=fi(5),u=fi(7);oe(2),Re("matTooltip",a?"Resume the visualization (space)":"Pause the visualization (space)"),oe(2),Ti(a?"play_arrow":"pause");let h=n.speedSignal(),d=n.fastForwardStepSignal();oe(3),Re("matTooltip","Rewind the simulation "+d+" seconds ago (ctrl + \u2190)"),oe(3),Re("matMenuTriggerFor",r),oe(),_t(" x",h," "),oe(19),Re("matTooltip","Fast-forward the simulation "+d+" seconds later (ctrl + \u2192)"),oe(3),Re("matTooltip",h>0?"Reverse the simulation (r)":"Forward the simulation (r)")("disabled",h===0),oe(2),Ti(h>0?"restore":"update"),oe(),Re("matTooltip","Center the map (c)"),oe(3),gt("active",u),Re("matTooltip","Toggle entity follow mode (f)");let p=n.showVisualisationTimeEditorSignal();oe(6),Re("matTooltip",((t=zd(46,27,c,"1.0-0"))!==null&&t!==void 0?t:"0").toString()+" (Click to modify)")("disabled",p),oe(2),Je(p?47:48),oe(2),gt("fade-show",p)("disable-pointer-events",!p),oe(4),Re("formControl",n.editorVisualisationTimeForm),oe(3),Re("min",s)("max",l),oe(),Re("value",c),oe(),Je(n.sliderHoverSimulationTime!==null?58:-1),oe(),hi(n.coveredTimeIntervalsSignal()),oe(2),Je(o.simulationTime!==null?61:-1),oe(),Re("matTooltip","Leave the visualization")}}var yA=class i{constructor(e,t,r){this.visualizationService=e;this.animationService=t;this.simulationService=r;Ji(()=>{let n=this.speedSignal();this.visualizationService.setVisualizationSpeed(n),this.animationService.setSpeed(n)}),this.editorVisualisationTimeForm.valueChanges.subscribe(n=>{this.editorVisualisationTimeValueSignal.set(n?parseInt(n):NaN)}),Sa("space",()=>{this.toggleVisualizationPause(this.isVisualizationPausedSignal())}),Sa("ctrl+left,command+left,cmd+left",()=>{this.rewindTime()}),Sa("ctrl+right,command+right,cmd+right ",()=>{this.fastForwardTime()}),Sa("ctrl+up,command+up,cmd+up",()=>{this.increaseSpeed()}),Sa("ctrl+down,command+down,cmd+down",()=>{this.decreaseSpeed()}),Sa("r",()=>{this.toggleSimulationDirection()}),Sa("c",()=>{this.centerMap()}),Sa("f",()=>{this.toggleShouldFollowEntity()})}sliderWrapper=lh("sliderWrapper");sliderHoverSimulationTime=null;sliderHoverTimestamp=0;sliderTooltipX=0;isSimulationPausedSignal=$t(()=>this.simulationInputSignal().status==="paused");MIN_SPEED_POWER=0;MAX_SPEED_POWER=7;FAST_FORWARD_STEP=1;speedPowerSignal=Bt(0);speedDirectionSignal=Bt(1);speedSignal=$t(()=>Math.pow(2,this.speedPowerSignal())*this.speedDirectionSignal());fastForwardStepSignal=$t(()=>Math.abs(this.speedSignal())*this.FAST_FORWARD_STEP);simulationInputSignal=sl.required({alias:"simulation"});leaveVisualizationOutput=Uc({alias:"leaveVisualization"});showVisualisationTimeEditorSignal=Bt(!1);editorVisualisationTimeForm=new Ql("",this.validateVisualisationTimeInput());editorvisualisationTimeInput=lh(qo);editorVisualisationTimeValueSignal=Bt(NaN);sliderUpdateSignal=Bt(0);SLIDER_UPDATE_INTERVAL=1e3/5;interval=null;wantedVisualizationTime=null;hasBeenAltered=!1;SMALL_OFFSET=1e-4;wantedVisualizationTimeSignal=$t(()=>{this.sliderUpdateSignal();let e=this.visualizationService.wantedVisualizationTimeSignal();return e===null?null:e!==this.wantedVisualizationTime?(this.wantedVisualizationTime=e,e):this.hasBeenAltered?(this.hasBeenAltered=!1,e):(this.hasBeenAltered=!0,e+this.SMALL_OFFSET)});coveredTimeIntervalsSignal=$t(()=>{let e=this.simulationService.continuousEnvironmentsSignal();return vI(e)});ngOnInit(){this.interval=setInterval(()=>{this.sliderUpdateSignal.update(e=>e+1)},this.SLIDER_UPDATE_INTERVAL)}ngOnDestroy(){this.interval!==null&&clearInterval(this.interval)}get isInitializedSignal(){return this.visualizationService.isInitializedSignal}get simulationStartTimeSignal(){return this.visualizationService.simulationStartTimeSignal}get simulationEndTimeSignal(){return this.visualizationService.simulationEndTimeSignal}get visualizationMaxTimeSignal(){return this.visualizationService.visualizationMaxTimeSignal}get isVisualizationPausedSignal(){return this.visualizationService.isVisualizationPausedSignal}get shouldFollowEntitySignal(){return this.animationService.shouldFollowEntitySignal}toggleVisualizationPause(e){e?this.visualizationService.resumeVisualization():this.visualizationService.pauseVisualization()}setSpeed(e){this.speedPowerSignal.set(e)}decreaseSpeed(){this.speedPowerSignal.update(e=>Math.max(e-1,this.MIN_SPEED_POWER))}increaseSpeed(){this.speedPowerSignal.update(e=>Math.min(e+1,this.MAX_SPEED_POWER))}onSliderMouseMove(e){let t=this.sliderWrapper()?.nativeElement;if(!t)return;let r=t.querySelector(".mdc-slider__track");if(r==null)return;let n=r.getBoundingClientRect(),a=e.clientX-n.left,o=Math.max(0,Math.min(1,a/n.width)),s=this.simulationStartTimeSignal(),l=this.simulationEndTimeSignal();if(s===null||l===null)return;this.sliderHoverTimestamp=s+o*(l-s);let c=aM(this.sliderHoverTimestamp);this.sliderHoverSimulationTime=c,this.sliderTooltipX=a}fastForwardTime(){this.translateTime(this.fastForwardStepSignal())}rewindTime(){this.translateTime(-this.fastForwardStepSignal())}translateTime(e){let t=this.visualizationService.wantedVisualizationTimeSignal();t&&this.visualizationService.setVisualizationTime(t+e)}toggleSimulationDirection(){this.speedDirectionSignal.update(e=>-e)}centerMap(){this.animationService.centerMap()}toggleShouldFollowEntity(){this.animationService.toggleShouldFollowEntity()}leaveVisualization(){this.leaveVisualizationOutput.emit()}openVisualisationTimeEditor(){let e=this.editorvisualisationTimeInput();e!==void 0&&(this.editorVisualisationTimeForm.setValue(this.wantedVisualizationTimeSignal()?.toFixed(0)??null),this.showVisualisationTimeEditorSignal.set(!0),e.focus())}applyVisualisationTime(){let e=this.editorVisualisationTimeValueSignal();e===null||isNaN(e)||(this.visualizationService.setVisualizationTime(e),this.showVisualisationTimeEditorSignal.set(!1))}hideVisualisationTimeEditor(){this.showVisualisationTimeEditorSignal.set(!1)}onSliderChange(e){this.visualizationService.setVisualizationTime(this.sliderHoverTimestamp)}sliderLabelFormatter(e,t){return r=>Math.floor(100*(r-e)/(t-e))+"%"}validateVisualisationTimeInput(){return e=>{let t=parseInt(e.value);return isNaN(t)||t<=0?{invalidNumber:!0}:null}}static \u0275fac=function(t){return new(t||i)(rt(Ln),rt(Mr),rt(Ha))};static \u0275cmp=tt({type:i,selectors:[["app-simulation-control-bar"]],viewQuery:function(t,r){t&1&&(ch(r.sliderWrapper,V7e,5),ch(r.editorvisualisationTimeInput,qo,5)),t&2&&uh(2)},inputs:{simulationInputSignal:[1,"simulation","simulationInputSignal"]},outputs:{leaveVisualizationOutput:"leaveVisualization"},decls:9,vars:7,consts:[["speedMenu","matMenu"],["sliderWrapper",""],[1,"flex-row","align-center","gap-0-5-rem"],["mat-icon-button","",3,"click","matTooltip"],["mat-button","",1,"speed-button",3,"matMenuTriggerFor"],[1,"speed-menu"],["mat-menu-item","",3,"click"],["mat-icon-button","",3,"click","matTooltip","disabled"],["mat-button","",3,"click","matTooltip","disabled"],[1,"fade"],[1,"timestamp-input"],["matInput","","type","number",3,"keyup.enter","blur","formControl"],[1,"flex-1","sliders",3,"mousemove","mouseleave"],[3,"min","max"],["matSliderThumb","",3,"valueChange","value"],[1,"hover-tooltip",3,"left"],["disabled","",1,"loaded",3,"min","max"],["disabled","",1,"simulation","disable-pointer-events",3,"min","max"],[1,"hover-tooltip"],["matSliderStartThumb","",3,"value"],["matSliderEndThumb","",3,"value"],["matSliderThumb","",3,"value"]],template:function(t,r){if(t&1&&(Ri(0)(1)(2)(3)(4)(5)(6)(7),je(8,$7e,65,30,"mat-card")),t&2){hr(r.isVisualizationPausedSignal()),oe();let n=hr(r.simulationInputSignal());oe();let a=hr(r.simulationStartTimeSignal());oe();let o=hr(r.simulationEndTimeSignal()),s=r.visualizationMaxTimeSignal();oe(2);let l=hr(r.wantedVisualizationTimeSignal()),c=r.isInitializedSignal();oe(2),hr(r.shouldFollowEntitySignal()),oe(),Je(c&&n!==null&&a!==null&&o!==null&&s!==null&&l!==null?8:-1)}},dependencies:[ia,ea,ta,Br,pn,Xl,pr,mr,Rn,Da,qw,jw,Ff,ZR,Cw,wh,Ps,Cb,ec,xh,ru,So,qo,ac,zs,ha,Rs,Mb,eM,Xh,Um,QC,ed,iV],styles:[".flex-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.flex-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.align-center[_ngcontent-%COMP%], .align-main-center[_ngcontent-%COMP%]{justify-content:center}.align-center[_ngcontent-%COMP%], .align-cross-center[_ngcontent-%COMP%]{align-items:center}.align-main-end[_ngcontent-%COMP%]{justify-content:flex-end}.align-cross-end[_ngcontent-%COMP%]{align-items:flex-end}.align-main-start[_ngcontent-%COMP%]{justify-content:flex-start}.align-cross-start[_ngcontent-%COMP%]{align-items:flex-start}.align-cross-stretch[_ngcontent-%COMP%]{align-items:stretch}.gap-0-5-rem[_ngcontent-%COMP%]{gap:.5rem}.gap-1-rem[_ngcontent-%COMP%]{gap:1rem}.gap-1-5-rem[_ngcontent-%COMP%]{gap:1.5rem}.flex-1[_ngcontent-%COMP%]{flex:1}*[_ngcontent-%COMP%]{--red-text-color: #ff0000;--red-background-color: #ffdddd;--yellow-text-color: #ffc21b;--yellow-background-color: #ffe6a4;--green-text-color: #00aa00;--green-background-color: #ccffcc;--gray-text-color: #666666;--gray-background-color: #f0f0f0;--blue-text-color: #4488ff;--blue-background-color: #cce5ff;--loaded-slider-color: #005cbb88;--active-button-color: #cce6ff}.text-red[_ngcontent-%COMP%]{color:var(--red-text-color)}.background-red[_ngcontent-%COMP%]{background-color:var(--red-background-color)}.text-yellow[_ngcontent-%COMP%]{color:var(--yellow-text-color)}.background-yellow[_ngcontent-%COMP%]{background-color:var(--yellow-background-color)}.text-green[_ngcontent-%COMP%]{color:var(--green-text-color)}.background-green[_ngcontent-%COMP%]{background-color:var(--green-background-color)}.text-gray[_ngcontent-%COMP%]{color:var(--gray-text-color)}.background-gray[_ngcontent-%COMP%]{background-color:var(--gray-background-color)!important}.text-blue[_ngcontent-%COMP%]{color:var(--blue-text-color)}.background-blue[_ngcontent-%COMP%]{background-color:var(--blue-background-color)}[_nghost-%COMP%]{position:absolute;bottom:10px;left:50%;transform:translate(-50%);width:calc(100% - (2*(44px + 1rem)));max-width:1200px}[_nghost-%COMP%] .mat-mdc-card-content{padding:.5rem!important}.sliders[_ngcontent-%COMP%]{margin-inline:1rem;position:relative}.sliders[_ngcontent-%COMP%] mat-slider[_ngcontent-%COMP%]{width:100%}.sliders[_ngcontent-%COMP%] :is(.loaded[_ngcontent-%COMP%], .simulation[_ngcontent-%COMP%]){position:absolute;top:0;left:0;pointer-events:none}.sliders[_ngcontent-%COMP%] .loaded[_ngcontent-%COMP%]{opacity:unset}.sliders[_ngcontent-%COMP%] .loaded mat-slider-visual-thumb, .sliders[_ngcontent-%COMP%] .loaded .mdc-slider__track--inactive, .sliders[_ngcontent-%COMP%] .simulation .mdc-slider__track{display:none}.sliders[_ngcontent-%COMP%] .loaded .mdc-slider__track--active_fill{border-color:var(--loaded-slider-color)}:is() .loaded[_ngcontent-%COMP%]{display:none}.active[_ngcontent-%COMP%]{background-color:var(--active-button-color)}.speed-button[_ngcontent-%COMP%]{min-width:fit-content}.timestamp-input[_ngcontent-%COMP%]{position:absolute;bottom:50px;transform:scale(.9);transform-origin:bottom left} .mat-mdc-menu-panel{min-width:fit-content!important}.mat-mdc-menu-item[_ngcontent-%COMP%]{min-height:30px}.disable-pointer-events[_ngcontent-%COMP%]{pointer-events:none}.fade[_ngcontent-%COMP%]{opacity:0;transition:opacity .1s ease-in-out}.fade-show[_ngcontent-%COMP%]{opacity:1}.hover-tooltip[_ngcontent-%COMP%]{position:absolute;top:-5px;background-color:#424242;color:#fff;padding:4px 8px;font-size:12px;border-radius:4px;transform:translate(-50%);pointer-events:none;white-space:nowrap}"]})};function X7e(i,e){if(i&1){let t=vt();Z(0,"mat-card")(1,"mat-card-header")(2,"mat-card-subtitle"),ce(3,"Simulation Status"),Q()(),Z(4,"mat-card-content",0)(5,"section",1)(6,"div")(7,"span"),ce(8,"Current :\xA0"),Q(),Z(9,"span",2),ce(10),Vr(11,"simulationTime"),Q()(),Z(12,"div")(13,"span"),ce(14,"Estimated end :\xA0"),Q(),Z(15,"span",2),ce(16),Vr(17,"simulationTime"),Q()()(),Z(18,"section")(19,"mat-chip"),ce(20),Q()(),Z(21,"section",3)(22,"button",4),Le("click",function(){Ee(t);let n=Se(),a=fi(0),o=fi(1);return Ae(n.toggleSimulationPause(a,o.id))}),Z(23,"mat-icon"),ce(24),Q()(),Z(25,"button",4),Le("click",function(){Ee(t);let n=Se(),a=fi(1);return Ae(n.stopSimulation(a.id))}),Z(26,"mat-icon"),ce(27,"stop"),Q()(),Z(28,"button",5),Le("click",function(){Ee(t);let n=Se(),a=fi(1);return Ae(n.editSimulationConfiguration(a))}),Z(29,"mat-icon"),ce(30,"settings"),Q()()()()()}if(i&2){let t,r,n=Se(),a=fi(0),o=fi(1);oe(9),Re("matTooltip",(t=o.simulationTime==null?null:o.simulationTime.toString())!==null&&t!==void 0?t:"unknown"),oe(),_t(" ",o.simulationTime!==null?En(11,15,o.simulationTime):"unknown",""),oe(5),Re("matTooltip",(r=o.simulationEstimatedEndTime==null?null:o.simulationEstimatedEndTime.toString())!==null&&r!==void 0?r:"unknown"),oe(),_t(" ",o.simulationEstimatedEndTime!==null?En(17,17,o.simulationEstimatedEndTime):"unknown"," "),oe(3),yr("color","var(--"+n.getSimulationStatusColor(o.status)+"-text-color)")("background-color","var(--"+n.getSimulationStatusColor(o.status)+"-background-color)"),oe(),_t(" ",o.status," "),oe(2),Re("matTooltip",a?"Resume the simulation":"Pause the simulation")("disabled",o.status!=="running"&&o.status!=="paused"),oe(2),Ti(a?"play_arrow":"pause"),oe(),Re("matTooltip","Stop the simulation")("disabled",o.status!=="running"&&o.status!=="paused"),oe(3),Re("matTooltip","Configure the simulation")}}var _A=class i{constructor(e){this.visualizationService=e}isSimulationPausedSignal=$t(()=>this.simulationInputSignal().status==="paused");simulationInputSignal=sl.required({alias:"simulation"});pauseSimulationOutput=Uc({alias:"pauseSimulation"});resumeSimulationOutput=Uc({alias:"resumeSimulation"});stopSimulationOutput=Uc({alias:"stopSimulation"});editSimulationConfigurationOutput=Uc({alias:"editSimulationConfiguration"});get isInitializedSignal(){return this.visualizationService.isInitializedSignal}get isVisualizationPausedSignal(){return this.visualizationService.isVisualizationPausedSignal}toggleSimulationPause(e,t){e?this.resumeSimulationOutput.emit(t):this.pauseSimulationOutput.emit(t)}stopSimulation(e){this.stopSimulationOutput.emit(e)}editSimulationConfiguration(e){this.editSimulationConfigurationOutput.emit(e)}getSimulationStatusColor(e){switch(e){case"running":return"green";case"paused":return"yellow";case"stopping":case"starting":case"completed":return"gray";default:return"red"}}static \u0275fac=function(t){return new(t||i)(rt(Ln))};static \u0275cmp=tt({type:i,selectors:[["app-simulation-control-panel"]],inputs:{simulationInputSignal:[1,"simulation","simulationInputSignal"]},outputs:{pauseSimulationOutput:"pauseSimulation",resumeSimulationOutput:"resumeSimulation",stopSimulationOutput:"stopSimulation",editSimulationConfigurationOutput:"editSimulationConfiguration"},decls:4,vars:3,consts:[[1,"flex-column","align-center","gap-1-rem"],[1,"flex-column","align-cross-start","gap-0-5-rem"],[3,"matTooltip"],[1,"flex-row","align-cross-start","gap-0-5-rem"],["mat-icon-button","",3,"click","matTooltip","disabled"],["mat-icon-button","",3,"click","matTooltip"]],template:function(t,r){if(t&1&&(Ri(0)(1)(2),je(3,X7e,31,19,"mat-card")),t&2){hr(r.isSimulationPausedSignal()),oe();let n=hr(r.simulationInputSignal()),a=r.isInitializedSignal();oe(2),Je(a&&n!==null?3:-1)}},dependencies:[ia,ea,ta,lX,sX,Br,Xl,pr,mr,Rn,Da,ed,qn,da],styles:[".flex-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.flex-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.align-center[_ngcontent-%COMP%], .align-main-center[_ngcontent-%COMP%]{justify-content:center}.align-center[_ngcontent-%COMP%], .align-cross-center[_ngcontent-%COMP%]{align-items:center}.align-main-end[_ngcontent-%COMP%]{justify-content:flex-end}.align-cross-end[_ngcontent-%COMP%]{align-items:flex-end}.align-main-start[_ngcontent-%COMP%]{justify-content:flex-start}.align-cross-start[_ngcontent-%COMP%]{align-items:flex-start}.align-cross-stretch[_ngcontent-%COMP%]{align-items:stretch}.gap-0-5-rem[_ngcontent-%COMP%]{gap:.5rem}.gap-1-rem[_ngcontent-%COMP%]{gap:1rem}.gap-1-5-rem[_ngcontent-%COMP%]{gap:1.5rem}.flex-1[_ngcontent-%COMP%]{flex:1}*[_ngcontent-%COMP%]{--red-text-color: #ff0000;--red-background-color: #ffdddd;--yellow-text-color: #ffc21b;--yellow-background-color: #ffe6a4;--green-text-color: #00aa00;--green-background-color: #ccffcc;--gray-text-color: #666666;--gray-background-color: #f0f0f0;--blue-text-color: #4488ff;--blue-background-color: #cce5ff;--loaded-slider-color: #005cbb88;--active-button-color: #cce6ff}.text-red[_ngcontent-%COMP%]{color:var(--red-text-color)}.background-red[_ngcontent-%COMP%]{background-color:var(--red-background-color)}.text-yellow[_ngcontent-%COMP%]{color:var(--yellow-text-color)}.background-yellow[_ngcontent-%COMP%]{background-color:var(--yellow-background-color)}.text-green[_ngcontent-%COMP%]{color:var(--green-text-color)}.background-green[_ngcontent-%COMP%]{background-color:var(--green-background-color)}.text-gray[_ngcontent-%COMP%]{color:var(--gray-text-color)}.background-gray[_ngcontent-%COMP%]{background-color:var(--gray-background-color)!important}.text-blue[_ngcontent-%COMP%]{color:var(--blue-text-color)}.background-blue[_ngcontent-%COMP%]{background-color:var(--blue-background-color)}[_nghost-%COMP%]{position:absolute;bottom:calc(75px + 1rem);right:1rem}"]})};var Q7e=["switch"],e9e=["*"];function t9e(i,e){i&1&&(Z(0,"span",10),Sr(),Z(1,"svg",12),Ge(2,"path",13),Q(),Z(3,"svg",14),Ge(4,"path",15),Q()())}var i9e=new et("mat-slide-toggle-default-options",{providedIn:"root",factory:()=>({disableToggleValue:!1,hideIcon:!1,disabledInteractive:!1})}),r9e={provide:Bn,useExisting:Fr(()=>vA),multi:!0},bA=class{source;checked;constructor(e,t){this.source=e,this.checked=t}},vA=(()=>{class i{_elementRef=te(Et);_focusMonitor=te(In);_changeDetectorRef=te(_i);defaults=te(i9e);_onChange=t=>{};_onTouched=()=>{};_validatorOnChange=()=>{};_uniqueId;_checked=!1;_createChangeEvent(t){return new bA(this,t)}_labelId;get buttonId(){return`${this.id||this._uniqueId}-button`}_switchElement;focus(){this._switchElement.nativeElement.focus()}_noopAnimations;_focused;name=null;id;labelPosition="after";ariaLabel=null;ariaLabelledby=null;ariaDescribedby;required;color;disabled=!1;disableRipple=!1;tabIndex=0;get checked(){return this._checked}set checked(t){this._checked=t,this._changeDetectorRef.markForCheck()}hideIcon;disabledInteractive;change=new ut;toggleChange=new ut;get inputId(){return`${this.id||this._uniqueId}-input`}constructor(){te(ar).load(kn);let t=te(new Ma("tabindex"),{optional:!0}),r=this.defaults,n=te(nr,{optional:!0});this.tabIndex=t==null?0:parseInt(t)||0,this.color=r.color||"accent",this._noopAnimations=n==="NoopAnimations",this.id=this._uniqueId=te(Di).getId("mat-mdc-slide-toggle-"),this.hideIcon=r.hideIcon??!1,this.disabledInteractive=r.disabledInteractive??!1,this._labelId=this._uniqueId+"-label"}ngAfterContentInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>{t==="keyboard"||t==="program"?(this._focused=!0,this._changeDetectorRef.markForCheck()):t||Promise.resolve().then(()=>{this._focused=!1,this._onTouched(),this._changeDetectorRef.markForCheck()})})}ngOnChanges(t){t.required&&this._validatorOnChange()}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef)}writeValue(t){this.checked=!!t}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}validate(t){return this.required&&t.value!==!0?{required:!0}:null}registerOnValidatorChange(t){this._validatorOnChange=t}setDisabledState(t){this.disabled=t,this._changeDetectorRef.markForCheck()}toggle(){this.checked=!this.checked,this._onChange(this.checked)}_emitChangeEvent(){this._onChange(this.checked),this.change.emit(this._createChangeEvent(this.checked))}_handleClick(){this.disabled||(this.toggleChange.emit(),this.defaults.disableToggleValue||(this.checked=!this.checked,this._onChange(this.checked),this.change.emit(new bA(this,this.checked))))}_getAriaLabelledBy(){return this.ariaLabelledby?this.ariaLabelledby:this.ariaLabel?null:this._labelId}static \u0275fac=function(r){return new(r||i)};static \u0275cmp=tt({type:i,selectors:[["mat-slide-toggle"]],viewQuery:function(r,n){if(r&1&&di(Q7e,5),r&2){let a;St(a=kt())&&(n._switchElement=a.first)}},hostAttrs:[1,"mat-mdc-slide-toggle"],hostVars:13,hostBindings:function(r,n){r&2&&(Tn("id",n.id),Mt("tabindex",null)("aria-label",null)("name",null)("aria-labelledby",null),dn(n.color?"mat-"+n.color:""),gt("mat-mdc-slide-toggle-focused",n._focused)("mat-mdc-slide-toggle-checked",n.checked)("_mat-animation-noopable",n._noopAnimations))},inputs:{name:"name",id:"id",labelPosition:"labelPosition",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],required:[2,"required","required",st],color:"color",disabled:[2,"disabled","disabled",st],disableRipple:[2,"disableRipple","disableRipple",st],tabIndex:[2,"tabIndex","tabIndex",t=>t==null?0:lr(t)],checked:[2,"checked","checked",st],hideIcon:[2,"hideIcon","hideIcon",st],disabledInteractive:[2,"disabledInteractive","disabledInteractive",st]},outputs:{change:"change",toggleChange:"toggleChange"},exportAs:["matSlideToggle"],features:[ei([r9e,{provide:ml,useExisting:i,multi:!0}]),si,rr],ngContentSelectors:e9e,decls:13,vars:27,consts:[["switch",""],["mat-internal-form-field","",3,"labelPosition"],["role","switch","type","button",1,"mdc-switch",3,"click","tabIndex","disabled"],[1,"mdc-switch__track"],[1,"mdc-switch__handle-track"],[1,"mdc-switch__handle"],[1,"mdc-switch__shadow"],[1,"mdc-elevation-overlay"],[1,"mdc-switch__ripple"],["mat-ripple","",1,"mat-mdc-slide-toggle-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered"],[1,"mdc-switch__icons"],[1,"mdc-label",3,"click","for"],["viewBox","0 0 24 24","aria-hidden","true",1,"mdc-switch__icon","mdc-switch__icon--on"],["d","M19.69,5.23L8.96,15.96l-4.23-4.23L2.96,13.5l6,6L21.46,7L19.69,5.23z"],["viewBox","0 0 24 24","aria-hidden","true",1,"mdc-switch__icon","mdc-switch__icon--off"],["d","M20 13H4v-2h16v2z"]],template:function(r,n){if(r&1){let a=vt();Pi(),Z(0,"div",1)(1,"button",2,0),Le("click",function(){return Ee(a),Ae(n._handleClick())}),Ge(3,"span",3),Z(4,"span",4)(5,"span",5)(6,"span",6),Ge(7,"span",7),Q(),Z(8,"span",8),Ge(9,"span",9),Q(),je(10,t9e,5,0,"span",10),Q()()(),Z(11,"label",11),Le("click",function(s){return Ee(a),Ae(s.stopPropagation())}),Ot(12),Q()()}if(r&2){let a=Or(2);Re("labelPosition",n.labelPosition),oe(),gt("mdc-switch--selected",n.checked)("mdc-switch--unselected",!n.checked)("mdc-switch--checked",n.checked)("mdc-switch--disabled",n.disabled)("mat-mdc-slide-toggle-disabled-interactive",n.disabledInteractive),Re("tabIndex",n.disabled&&!n.disabledInteractive?-1:n.tabIndex)("disabled",n.disabled&&!n.disabledInteractive),Mt("id",n.buttonId)("name",n.name)("aria-label",n.ariaLabel)("aria-labelledby",n._getAriaLabelledBy())("aria-describedby",n.ariaDescribedby)("aria-required",n.required||null)("aria-checked",n.checked)("aria-disabled",n.disabled&&n.disabledInteractive?"true":null),oe(8),Re("matRippleTrigger",a)("matRippleDisabled",n.disableRipple||n.disabled)("matRippleCentered",!0),oe(),Je(n.hideIcon?-1:10),oe(),Re("for",n.buttonId),Mt("id",n._labelId)}},dependencies:[Ya,_f],styles:['.mdc-switch{align-items:center;background:none;border:none;cursor:pointer;display:inline-flex;flex-shrink:0;margin:0;outline:none;overflow:visible;padding:0;position:relative;width:var(--mdc-switch-track-width, 52px)}.mdc-switch.mdc-switch--disabled{cursor:default;pointer-events:none}.mdc-switch.mat-mdc-slide-toggle-disabled-interactive{pointer-events:auto}.mdc-switch__track{overflow:hidden;position:relative;width:100%;height:var(--mdc-switch-track-height, 32px);border-radius:var(--mdc-switch-track-shape, var(--mat-sys-corner-full))}.mdc-switch--disabled.mdc-switch .mdc-switch__track{opacity:var(--mdc-switch-disabled-track-opacity, 0.12)}.mdc-switch__track::before,.mdc-switch__track::after{border:1px solid rgba(0,0,0,0);border-radius:inherit;box-sizing:border-box;content:"";height:100%;left:0;position:absolute;width:100%;border-width:var(--mat-switch-track-outline-width, 2px);border-color:var(--mat-switch-track-outline-color, var(--mat-sys-outline))}.mdc-switch--selected .mdc-switch__track::before,.mdc-switch--selected .mdc-switch__track::after{border-width:var(--mat-switch-selected-track-outline-width, 2px);border-color:var(--mat-switch-selected-track-outline-color, transparent)}.mdc-switch--disabled .mdc-switch__track::before,.mdc-switch--disabled .mdc-switch__track::after{border-width:var(--mat-switch-disabled-unselected-track-outline-width, 2px);border-color:var(--mat-switch-disabled-unselected-track-outline-color, var(--mat-sys-on-surface))}@media(forced-colors: active){.mdc-switch__track{border-color:currentColor}}.mdc-switch__track::before{transition:transform 75ms 0ms cubic-bezier(0, 0, 0.2, 1);transform:translateX(0);background:var(--mdc-switch-unselected-track-color, var(--mat-sys-surface-variant))}.mdc-switch--selected .mdc-switch__track::before{transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.6, 1);transform:translateX(100%)}[dir=rtl] .mdc-switch--selected .mdc-switch--selected .mdc-switch__track::before{transform:translateX(-100%)}.mdc-switch--selected .mdc-switch__track::before{opacity:var(--mat-switch-hidden-track-opacity, 0);transition:var(--mat-switch-hidden-track-transition, opacity 75ms)}.mdc-switch--unselected .mdc-switch__track::before{opacity:var(--mat-switch-visible-track-opacity, 1);transition:var(--mat-switch-visible-track-transition, opacity 75ms)}.mdc-switch:enabled:hover:not(:focus):not(:active) .mdc-switch__track::before{background:var(--mdc-switch-unselected-hover-track-color, var(--mat-sys-surface-variant))}.mdc-switch:enabled:focus:not(:active) .mdc-switch__track::before{background:var(--mdc-switch-unselected-focus-track-color, var(--mat-sys-surface-variant))}.mdc-switch:enabled:active .mdc-switch__track::before{background:var(--mdc-switch-unselected-pressed-track-color, var(--mat-sys-surface-variant))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__track::before,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__track::before,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__track::before,.mdc-switch.mdc-switch--disabled .mdc-switch__track::before{background:var(--mdc-switch-disabled-unselected-track-color, var(--mat-sys-surface-variant))}.mdc-switch__track::after{transform:translateX(-100%);background:var(--mdc-switch-selected-track-color, var(--mat-sys-primary))}[dir=rtl] .mdc-switch__track::after{transform:translateX(100%)}.mdc-switch--selected .mdc-switch__track::after{transform:translateX(0)}.mdc-switch--selected .mdc-switch__track::after{opacity:var(--mat-switch-visible-track-opacity, 1);transition:var(--mat-switch-visible-track-transition, opacity 75ms)}.mdc-switch--unselected .mdc-switch__track::after{opacity:var(--mat-switch-hidden-track-opacity, 0);transition:var(--mat-switch-hidden-track-transition, opacity 75ms)}.mdc-switch:enabled:hover:not(:focus):not(:active) .mdc-switch__track::after{background:var(--mdc-switch-selected-hover-track-color, var(--mat-sys-primary))}.mdc-switch:enabled:focus:not(:active) .mdc-switch__track::after{background:var(--mdc-switch-selected-focus-track-color, var(--mat-sys-primary))}.mdc-switch:enabled:active .mdc-switch__track::after{background:var(--mdc-switch-selected-pressed-track-color, var(--mat-sys-primary))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__track::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__track::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__track::after,.mdc-switch.mdc-switch--disabled .mdc-switch__track::after{background:var(--mdc-switch-disabled-selected-track-color, var(--mat-sys-on-surface))}.mdc-switch__handle-track{height:100%;pointer-events:none;position:absolute;top:0;transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1);left:0;right:auto;transform:translateX(0);width:calc(100% - var(--mdc-switch-handle-width))}[dir=rtl] .mdc-switch__handle-track{left:auto;right:0}.mdc-switch--selected .mdc-switch__handle-track{transform:translateX(100%)}[dir=rtl] .mdc-switch--selected .mdc-switch__handle-track{transform:translateX(-100%)}.mdc-switch__handle{display:flex;pointer-events:auto;position:absolute;top:50%;transform:translateY(-50%);left:0;right:auto;transition:width 75ms cubic-bezier(0.4, 0, 0.2, 1),height 75ms cubic-bezier(0.4, 0, 0.2, 1),margin 75ms cubic-bezier(0.4, 0, 0.2, 1);width:var(--mdc-switch-handle-width);height:var(--mdc-switch-handle-height);border-radius:var(--mdc-switch-handle-shape, var(--mat-sys-corner-full))}[dir=rtl] .mdc-switch__handle{left:auto;right:0}.mat-mdc-slide-toggle .mdc-switch--unselected .mdc-switch__handle{width:var(--mat-switch-unselected-handle-size, 16px);height:var(--mat-switch-unselected-handle-size, 16px);margin:var(--mat-switch-unselected-handle-horizontal-margin, 0 8px)}.mat-mdc-slide-toggle .mdc-switch--unselected .mdc-switch__handle:has(.mdc-switch__icons){margin:var(--mat-switch-unselected-with-icon-handle-horizontal-margin, 0 4px)}.mat-mdc-slide-toggle .mdc-switch--selected .mdc-switch__handle{width:var(--mat-switch-selected-handle-size, 24px);height:var(--mat-switch-selected-handle-size, 24px);margin:var(--mat-switch-selected-handle-horizontal-margin, 0 24px)}.mat-mdc-slide-toggle .mdc-switch--selected .mdc-switch__handle:has(.mdc-switch__icons){margin:var(--mat-switch-selected-with-icon-handle-horizontal-margin, 0 24px)}.mat-mdc-slide-toggle .mdc-switch__handle:has(.mdc-switch__icons){width:var(--mat-switch-with-icon-handle-size, 24px);height:var(--mat-switch-with-icon-handle-size, 24px)}.mat-mdc-slide-toggle .mdc-switch:active:not(.mdc-switch--disabled) .mdc-switch__handle{width:var(--mat-switch-pressed-handle-size, 28px);height:var(--mat-switch-pressed-handle-size, 28px)}.mat-mdc-slide-toggle .mdc-switch--selected:active:not(.mdc-switch--disabled) .mdc-switch__handle{margin:var(--mat-switch-selected-pressed-handle-horizontal-margin, 0 22px)}.mat-mdc-slide-toggle .mdc-switch--unselected:active:not(.mdc-switch--disabled) .mdc-switch__handle{margin:var(--mat-switch-unselected-pressed-handle-horizontal-margin, 0 2px)}.mdc-switch--disabled.mdc-switch--selected .mdc-switch__handle::after{opacity:var(--mat-switch-disabled-selected-handle-opacity, 1)}.mdc-switch--disabled.mdc-switch--unselected .mdc-switch__handle::after{opacity:var(--mat-switch-disabled-unselected-handle-opacity, 0.38)}.mdc-switch__handle::before,.mdc-switch__handle::after{border:1px solid rgba(0,0,0,0);border-radius:inherit;box-sizing:border-box;content:"";width:100%;height:100%;left:0;position:absolute;top:0;transition:background-color 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1),border-color 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1);z-index:-1}@media(forced-colors: active){.mdc-switch__handle::before,.mdc-switch__handle::after{border-color:currentColor}}.mdc-switch--selected:enabled .mdc-switch__handle::after{background:var(--mdc-switch-selected-handle-color, var(--mat-sys-on-primary))}.mdc-switch--selected:enabled:hover:not(:focus):not(:active) .mdc-switch__handle::after{background:var(--mdc-switch-selected-hover-handle-color, var(--mat-sys-primary-container))}.mdc-switch--selected:enabled:focus:not(:active) .mdc-switch__handle::after{background:var(--mdc-switch-selected-focus-handle-color, var(--mat-sys-primary-container))}.mdc-switch--selected:enabled:active .mdc-switch__handle::after{background:var(--mdc-switch-selected-pressed-handle-color, var(--mat-sys-primary-container))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:hover:not(:focus):not(:active) .mdc-switch__handle::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:focus:not(:active) .mdc-switch__handle::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:active .mdc-switch__handle::after,.mdc-switch--selected.mdc-switch--disabled .mdc-switch__handle::after{background:var(--mdc-switch-disabled-selected-handle-color, var(--mat-sys-surface))}.mdc-switch--unselected:enabled .mdc-switch__handle::after{background:var(--mdc-switch-unselected-handle-color, var(--mat-sys-outline))}.mdc-switch--unselected:enabled:hover:not(:focus):not(:active) .mdc-switch__handle::after{background:var(--mdc-switch-unselected-hover-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected:enabled:focus:not(:active) .mdc-switch__handle::after{background:var(--mdc-switch-unselected-focus-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected:enabled:active .mdc-switch__handle::after{background:var(--mdc-switch-unselected-pressed-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected.mdc-switch--disabled .mdc-switch__handle::after{background:var(--mdc-switch-disabled-unselected-handle-color, var(--mat-sys-on-surface))}.mdc-switch__handle::before{background:var(--mdc-switch-handle-surface-color)}.mdc-switch__shadow{border-radius:inherit;bottom:0;left:0;position:absolute;right:0;top:0}.mdc-switch:enabled .mdc-switch__shadow{box-shadow:var(--mdc-switch-handle-elevation-shadow)}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__shadow,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__shadow,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__shadow,.mdc-switch.mdc-switch--disabled .mdc-switch__shadow{box-shadow:var(--mdc-switch-disabled-handle-elevation-shadow)}.mdc-switch__ripple{left:50%;position:absolute;top:50%;transform:translate(-50%, -50%);z-index:-1;width:var(--mdc-switch-state-layer-size, 40px);height:var(--mdc-switch-state-layer-size, 40px)}.mdc-switch__ripple::after{content:"";opacity:0}.mdc-switch--disabled .mdc-switch__ripple::after{display:none}.mat-mdc-slide-toggle-disabled-interactive .mdc-switch__ripple::after{display:block}.mdc-switch:hover .mdc-switch__ripple::after{opacity:.04;transition:75ms opacity cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-slide-toggle.mat-mdc-slide-toggle-focused .mdc-switch .mdc-switch__ripple::after{opacity:.12}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:focus .mdc-switch__ripple::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:active .mdc-switch__ripple::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:hover:not(:focus) .mdc-switch__ripple::after,.mdc-switch--unselected:enabled:hover:not(:focus) .mdc-switch__ripple::after{background:var(--mdc-switch-unselected-hover-state-layer-color, var(--mat-sys-on-surface))}.mdc-switch--unselected:enabled:focus .mdc-switch__ripple::after{background:var(--mdc-switch-unselected-focus-state-layer-color, var(--mat-sys-on-surface))}.mdc-switch--unselected:enabled:active .mdc-switch__ripple::after{background:var(--mdc-switch-unselected-pressed-state-layer-color, var(--mat-sys-on-surface));opacity:var(--mdc-switch-unselected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));transition:opacity 75ms linear}.mdc-switch--selected:enabled:hover:not(:focus) .mdc-switch__ripple::after{background:var(--mdc-switch-selected-hover-state-layer-color, var(--mat-sys-primary))}.mdc-switch--selected:enabled:focus .mdc-switch__ripple::after{background:var(--mdc-switch-selected-focus-state-layer-color, var(--mat-sys-primary))}.mdc-switch--selected:enabled:active .mdc-switch__ripple::after{background:var(--mdc-switch-selected-pressed-state-layer-color, var(--mat-sys-primary));opacity:var(--mdc-switch-selected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));transition:opacity 75ms linear}.mdc-switch__icons{position:relative;height:100%;width:100%;z-index:1}.mdc-switch--disabled.mdc-switch--unselected .mdc-switch__icons{opacity:var(--mdc-switch-disabled-unselected-icon-opacity, 0.38)}.mdc-switch--disabled.mdc-switch--selected .mdc-switch__icons{opacity:var(--mdc-switch-disabled-selected-icon-opacity, 0.38)}.mdc-switch__icon{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0;opacity:0;transition:opacity 30ms 0ms cubic-bezier(0.4, 0, 1, 1)}.mdc-switch--unselected .mdc-switch__icon{width:var(--mdc-switch-unselected-icon-size, 16px);height:var(--mdc-switch-unselected-icon-size, 16px);fill:var(--mdc-switch-unselected-icon-color, var(--mat-sys-surface-variant))}.mdc-switch--unselected.mdc-switch--disabled .mdc-switch__icon{fill:var(--mdc-switch-disabled-unselected-icon-color, var(--mat-sys-surface-variant))}.mdc-switch--selected .mdc-switch__icon{width:var(--mdc-switch-selected-icon-size, 16px);height:var(--mdc-switch-selected-icon-size, 16px);fill:var(--mdc-switch-selected-icon-color, var(--mat-sys-on-primary-container))}.mdc-switch--selected.mdc-switch--disabled .mdc-switch__icon{fill:var(--mdc-switch-disabled-selected-icon-color, var(--mat-sys-on-surface))}.mdc-switch--selected .mdc-switch__icon--on,.mdc-switch--unselected .mdc-switch__icon--off{opacity:1;transition:opacity 45ms 30ms cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-slide-toggle{-webkit-user-select:none;user-select:none;display:inline-block;-webkit-tap-highlight-color:rgba(0,0,0,0);outline:0}.mat-mdc-slide-toggle .mat-mdc-slide-toggle-ripple,.mat-mdc-slide-toggle .mdc-switch__ripple::after{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:50%;pointer-events:none}.mat-mdc-slide-toggle .mat-mdc-slide-toggle-ripple:not(:empty),.mat-mdc-slide-toggle .mdc-switch__ripple::after:not(:empty){transform:translateZ(0)}.mat-mdc-slide-toggle.mat-mdc-slide-toggle-focused .mat-focus-indicator::before{content:""}.mat-mdc-slide-toggle .mat-internal-form-field{color:var(--mat-switch-label-text-color, var(--mat-sys-on-surface));font-family:var(--mat-switch-label-text-font, var(--mat-sys-body-medium-font));line-height:var(--mat-switch-label-text-line-height, var(--mat-sys-body-medium-line-height));font-size:var(--mat-switch-label-text-size, var(--mat-sys-body-medium-size));letter-spacing:var(--mat-switch-label-text-tracking, var(--mat-sys-body-medium-tracking));font-weight:var(--mat-switch-label-text-weight, var(--mat-sys-body-medium-weight))}.mat-mdc-slide-toggle .mat-ripple-element{opacity:.12}.mat-mdc-slide-toggle .mat-focus-indicator::before{border-radius:50%}.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle-track,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__icon,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle::before,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle::after,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__track::before,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__track::after{transition:none}.mat-mdc-slide-toggle .mdc-switch:enabled+.mdc-label{cursor:pointer}.mat-mdc-slide-toggle .mdc-switch--disabled+label{color:var(--mdc-switch-disabled-label-text-color)}'],encapsulation:2,changeDetection:0})}return i})();var ume=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275mod=Lt({type:i});static \u0275inj=Dt({imports:[vA,ti,ti]})}return i})();function a9e(i,e){if(i&1){let t=vt();Z(0,"li")(1,"mat-chip-option",10),Le("click",function(){let n=Ee(t).$implicit;Se();let a=fi(9);return Ae(a.toggleFilter(n))}),ce(2),Q()()}if(i&2){let t=e.$implicit,r=Se(),n=fi(6);oe(),Re("selected",!r.filters().has(t))("disabled",r.filters().has(n)),oe(),_t(" ",t," ")}}var SA=class i{constructor(e,t){this.visualizationFilterService=e;this.animationService=t;this.filters=e.filters,this.vehicleModes=e.vehicleModes,this.animationService.setFilterMode("all")}filters;vehicleModes;onRadioChange(e){this.animationService.setFilterMode(e.value)}onShouldShowCompleteChange(e){this.animationService.setShouldShowComplete(e.checked)}static \u0275fac=function(t){return new(t||i)(rt(Cd),rt(Mr))};static \u0275cmp=tt({type:i,selectors:[["app-visualizer-filter"]],decls:28,vars:7,consts:[["appearance","outlined"],[1,"title"],[1,"content"],[1,"entity-filters"],[3,"click","selected"],["vertical",""],["aria-label","Select a global filter",1,"radio-group",3,"change"],["checked","","value","all"],["value","favorites"],[3,"change"],[3,"click","selected","disabled"]],template:function(t,r){if(t&1){let n=vt();Z(0,"mat-card",0)(1,"mat-card-content")(2,"p",1),ce(3,"Entity Filters"),Q(),Z(4,"div",2)(5,"section",3),Ri(6)(7)(8)(9),Z(10,"mat-chip-option",4),Le("click",function(){Ee(n);let o=fi(7),s=fi(9);return Ae(s.toggleFilter(o))}),ce(11,"Passengers"),Q(),Z(12,"mat-chip-option",4),Le("click",function(){Ee(n);let o=fi(8),s=fi(9);return Ae(s.toggleFilter(o))}),ce(13,"Stops"),Q(),Z(14,"mat-chip-option",4),Le("click",function(){Ee(n);let o=fi(6),s=fi(9);return Ae(s.toggleFilter(o))}),ce(15,"Vehicles"),Q(),Z(16,"ul"),ui(17,a9e,3,3,"li",null,Ea),Q()(),Ge(19,"mat-divider",5),Z(20,"section")(21,"mat-radio-group",6),Le("change",function(o){return Ee(n),Ae(r.onRadioChange(o))}),Z(22,"mat-radio-button",7),ce(23,"All"),Q(),Z(24,"mat-radio-button",8),ce(25,"Favorites"),Q()(),Z(26,"mat-slide-toggle",9),Le("change",function(o){return Ee(n),Ae(r.onShouldShowCompleteChange(o))}),ce(27,"Show complete"),Q()()()()()}if(t&2){oe(6);let n=hr("vehicle");oe();let a=hr("passenger");oe();let o=hr("stops");oe(),hr(r.visualizationFilterService),oe(),Re("selected",!r.filters().has(a)),oe(2),Re("selected",!r.filters().has(o)),oe(2),Re("selected",!r.filters().has(n)),oe(3),hi(r.vehicleModes())}},dependencies:[ia,ea,ta,tc,Uw,Hb,Lf,qn,zb,Ah,Kw,ume,vA],styles:["p[_ngcontent-%COMP%]{margin:0}.title[_ngcontent-%COMP%]{font:var(--mat-sys-body-medium);margin-top:0;margin-bottom:10px}.content[_ngcontent-%COMP%]{display:flex;gap:10px}.entity-filters[_ngcontent-%COMP%]{display:flex;flex-direction:column}mat-chip-option[_ngcontent-%COMP%]{margin-bottom:10px}ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:last-child mat-chip-option[_ngcontent-%COMP%]{margin-bottom:0}ul[_ngcontent-%COMP%]{width:fit-content;margin-left:auto;list-style-type:none;padding-left:20px;margin-top:0;margin-bottom:0}.radio-group[_ngcontent-%COMP%]{display:flex;flex-direction:column}[_nghost-%COMP%] .mat-mdc-radio-button .mdc-radio{scale:.8;padding:5px}"]})};var kA=class i{_shouldShowInformationPanelSignal=Bt(!1);get shouldShowInformationPanelSignal(){return this._shouldShowInformationPanelSignal}showInformationPanel(){this._shouldShowInformationPanelSignal.set(!0)}hideInformationPanel(){this._shouldShowInformationPanelSignal.set(!1)}static \u0275fac=function(t){return new(t||i)};static \u0275prov=lt({token:i,factory:i.\u0275fac,providedIn:"root"})};var s9e=["searchInput"],l9e=(i,e)=>e.displayedValue;function c9e(i,e){i&1&&ce(0),i&2&&_t(" Filtering vehicles of mode: ",e," ")}function u9e(i,e){i&1&&ce(0," Search in the simulation ")}function h9e(i,e){if(i&1){let t=vt();Z(0,"button",29),Le("click",function(){Ee(t);let n=Se(3);return Ae(n.clearSearch())}),Z(1,"mat-icon"),ce(2,"close"),Q()()}}function d9e(i,e){i&1&&(Z(0,"mat-icon",26),ce(1,"search"),Q())}function m9e(i,e){if(i&1&&(Z(0,"mat-option",28),ce(1),Q()),i&2){let t=e.$implicit;Re("value",t),oe(),_t(" ",t.displayedValue," ")}}function p9e(i,e){if(i&1){let t=vt();Z(0,"form",22),Ri(1)(2),Z(3,"mat-form-field",23)(4,"input",24,0),Le("click",function(){Ee(t);let n=Se(2);return Ae(n.onSearchInputClick())}),Q(),Z(6,"mat-label"),je(7,c9e,1,1)(8,u9e,1,0),Q(),je(9,h9e,3,0,"button",25)(10,d9e,2,0,"mat-icon",26),Z(11,"mat-autocomplete",27,1),ui(13,m9e,2,2,"mat-option",28,l9e),Q()()()}if(i&2){let t,r=Or(12),n=Se(2);gt("fade-show",n.showSearch)("enable-pointer-events",n.showSearch);let a=n.filteredEntitySearchDataSignal(),o=n.searchValueSignal();oe(4),Re("matAutocomplete",r)("formControl",n.searchControl),oe(3),Je((t=n.selectedModeSignal())?7:8,t),oe(2),Je(o!==null&&o!==""?9:10),oe(2),Re("displayWith",n.entitySearchDisplayFunction),oe(2),hi(a)}}function f9e(i,e){if(i&1&&Ge(0,"app-favorite-entities",10),i&2){let t=Se(2);gt("fade-show",t.showFavorites)("enable-pointer-events",t.showFavorites)}}function g9e(i,e){if(i&1&&(Z(0,"mat-card",30)(1,"mat-card-content",31)(2,"mat-card-title"),ce(3,"Simulation information"),Q(),Z(4,"div",32)(5,"mat-card")(6,"mat-card-content")(7,"b"),ce(8,"Visualization name:"),Q(),ce(9),Q()(),Z(10,"mat-card")(11,"mat-card-content")(12,"b"),ce(13,"Source:"),Q(),ce(14),Q()(),Z(15,"mat-card")(16,"mat-card-content")(17,"b"),ce(18,"Id:"),Q(),ce(19),Q()()()()()),i&2){let t=Se(2),r=fi(0);gt("fade-show",t.showSimulationInformation)("enable-pointer-events",t.showSimulationInformation),oe(9),_t(" ",r.name," "),oe(5),_t(" ",r.data," "),oe(5),_t(" ",r.id," ")}}function y9e(i,e){if(i&1&&(Z(0,"mat-card",30)(1,"mat-card-content",31)(2,"mat-card-title"),ce(3," Statistics "),Q(),Ge(4,"app-recursive-statistics",33),Q()()),i&2){let t=Se(2),r=fi(1);gt("fade-show",t.showStatistics)("enable-pointer-events",t.showStatistics),oe(4),Re("recursiveDict",r)}}function _9e(i,e){if(i&1&&(Z(0,"mat-card",30)(1,"mat-card-content",31)(2,"mat-card-title"),ce(3," Entities "),Q(),Ge(4,"app-entities-tab"),Q()()),i&2){let t=Se(2);gt("fade-show",t.showEntitiesTab)("enable-pointer-events",t.showEntitiesTab)}}function b9e(i,e){if(i&1&&(Z(0,"mat-card",30)(1,"mat-card-content",31),Ge(2,"app-selected-entity-tab",34),Q()()),i&2){let t=Se(2),r=fi(2),n=fi(3),a=fi(4);gt("fade-show",t.showSelectedEntityTab)("enable-pointer-events",t.showSelectedEntityTab),oe(2),Re("selectedPassenger",r)("selectedPassengerStop",t.selectedPassengerStopSignal())("selectedPassengerVehicle",t.selectedPassengerVehicleSignal())("selectedVehicle",n)("selectedVehicleStop",t.selectedVehicleStopSignal())("selectedVehiclePassengers",t.selectedVehiclePassengersSignal())("selectedStop",a)("selectedStopWaitingPassengers",t.selectedStopWaitingPassengersSignal())("selectedStopCompletedPassengers",t.selectedStopCompletedPassengersSignal())("selectedStopVehicles",t.selectedStopVehiclesSignal())}}function v9e(i,e){if(i&1){let t=vt();Z(0,"app-simulation-control-panel",35),Le("pauseSimulation",function(n){Ee(t);let a=Se(2);return Ae(a.pauseSimulation(n))})("resumeSimulation",function(n){Ee(t);let a=Se(2);return Ae(a.resumeSimulation(n))})("stopSimulation",function(n){Ee(t);let a=Se(2);return Ae(a.stopSimulation(n))})("editSimulationConfiguration",function(n){Ee(t);let a=Se(2);return Ae(a.editSimulationConfiguration(n))}),Q()}if(i&2){Se(2);let t=fi(0);Re("simulation",t)}}function S9e(i,e){i&1&&(Z(0,"mat-chip",21)(1,"div",36)(2,"mat-icon",37),ce(3,"autorenew"),Q(),ce(4," Loading visualization data... "),Q()())}function k9e(i,e){if(i&1){let t=vt();Z(0,"div",2)(1,"section")(2,"mat-button-toggle-group",3)(3,"mat-button-toggle",4)(4,"mat-icon"),ce(5,"search"),Q()(),Z(6,"mat-button-toggle",5)(7,"mat-icon"),ce(8,"filter_list"),Q()(),Z(9,"mat-button-toggle",6)(10,"mat-icon"),ce(11,"star"),Q()(),Z(12,"mat-button-toggle",7)(13,"mat-icon"),ce(14,"history"),Q()(),Z(15,"mat-button-toggle",8)(16,"mat-icon"),ce(17,"layers"),Q()()()()(),je(18,p9e,15,9,"form",9),Ge(19,"app-visualizer-filter",10),je(20,f9e,1,4,"app-favorite-entities",11),Ge(21,"app-click-history",10)(22,"app-map-tiles",10),Z(23,"div",12)(24,"section")(25,"mat-button-toggle-group",13)(26,"mat-button-toggle",14)(27,"mat-icon"),ce(28,"info"),Q()(),Z(29,"mat-button-toggle",15)(30,"mat-icon"),ce(31,"bar_chart"),Q()(),Z(32,"mat-button-toggle",16)(33,"mat-icon"),ce(34,"groups"),Q()(),Z(35,"mat-button-toggle",17)(36,"mat-icon"),ce(37,"touch_app"),Q()()()()(),je(38,g9e,20,7,"mat-card",18)(39,y9e,5,5,"mat-card",18)(40,_9e,5,4,"mat-card",18)(41,b9e,3,14,"mat-card",18),Z(42,"app-simulation-control-bar",19),Le("leaveVisualization",function(){Ee(t);let n=Se();return Ae(n.leaveVisualization())}),Q(),Ri(43),je(44,v9e,1,1,"app-simulation-control-panel",20),Ri(45),je(46,S9e,5,0,"mat-chip",21)}if(i&2){let t=Se(),r=fi(0),n=fi(2),a=fi(3),o=fi(4);oe(2),Re("formControl",t.tabControl),oe(16),Je(t.showSearch?18:-1),oe(),gt("fade-show",t.showFilter)("enable-pointer-events",t.showFilter),oe(),Je(t.showFavorites?20:-1),oe(),gt("fade-show",t.showClickHistory)("enable-pointer-events",t.showClickHistory),oe(),gt("fade-show",t.showLayers)("enable-pointer-events",t.showLayers),oe(3),Re("formControl",t.informationTabControl),oe(),Re("matTooltip","Information panel"),oe(3),Re("matTooltip","Statistics panel"),oe(3),Re("matTooltip","Entities panel"),oe(3),Re("disabled",n===null&&a===null&&o===null)("matTooltip","Selected entity panel"),oe(3),Je(t.showSimulationInformation?38:-1),oe(),Je(t.showStatistics?39:-1),oe(),Je(t.showEntitiesTab?40:-1),oe(),Je(t.showSelectedEntityTab?41:-1),oe(),Re("simulation",r);let s=t.isSimulationRunningSignal();oe(2),Je(s?44:-1);let l=t.isLoadingSignal();oe(2),Je(l?46:-1)}}var xA=class i{constructor(e,t,r,n,a,o,s,l,c,u,h){this.simulationService=e;this.userInterfaceService=t;this.router=r;this.communicationService=n;this.dialogService=a;this.animationService=o;this.loadingService=s;this.visualizationService=l;this.formBuilder=c;this.visualizationFilterService=u;this.taskService=h;this.tabControl=new Ql(""),this.tabControl.valueChanges.subscribe(d=>{let p=d;if(p.length>1){let g=p[p.length-1];this.tabControl.setValue([g]);return}let f=p[0];this.showSearch=!1,this.showFilter=!1,this.showFavorites=!1,this.showClickHistory=!1,this.showLayers=!1,f==="search"?this.showSearch=!0:f==="filter"?this.showFilter=!0:f==="favorites"?this.showFavorites=!0:f==="history"?this.showClickHistory=!0:f==="layers"&&(this.showLayers=!0)}),this.informationTabControl=new Ql([""]),this.informationTabControl.valueChanges.subscribe(d=>{if(this.informationTabControl.value!==null){if(this.informationTabControl.value.length>1){this.informationTabControl.setValue([this.informationTabControl.value[this.informationTabControl.value.length-1]]);return}this.showSimulationInformation=this.informationTabControl.value[0]==="information",this.showStatistics=this.informationTabControl.value[0]==="statistics",this.showEntitiesTab=this.informationTabControl.value[0]==="entities",this.showSelectedEntityTab=this.informationTabControl.value[0]==="selectedEntity"}}),this.searchControl=this.formBuilder.control(""),this.searchControl.valueChanges.subscribe(d=>{this.searchValueSignal.set(d??"")}),Ji(()=>{let d=this.animationService.preselectedEntitySignal(),p=this.selectedPassengerSignal(),f=this.selectedVehicleSignal(),g=this.selectedStopSignal();this.showSelectedEntityTab&&p===null&&f===null&&g===null?this.informationTabControl.setValue([""]):!this.showSelectedEntityTab&&(p!==null||f!==null||g!==null)&&(d===null||d.shouldShowSelectedEntityTab)&&this.informationTabControl.setValue(["selectedEntity"])}),Ji(()=>{let d=this.searchValueSignal();JSON.stringify(d)!==JSON.stringify(this.previousSearchValue)&&(this.previousSearchValue=d,!(d===null||typeof d=="string")&&(d.type==="passenger"?(this.animationService.selectEntity(d.entity),this.selectedModeSignal.set(null)):d.type==="vehicle"?(this.animationService.selectEntity(d.entity),this.selectedModeSignal.set(null)):d.type==="mode"&&(this.selectedModeSignal.set(d.entity.mode),this.searchControl.setValue(d,{emitEvent:!1}),setTimeout(()=>{this.searchInput.nativeElement.click()}))))}),Ji(()=>{let d=this.visualizationService.isVisualizationPausedSignal();this.animationService.setPause(d)}),Ji(()=>{let d=this.selectedPassengerSignal(),p=this.selectedVehicleSignal(),f=this.entitySearchDataSignal(),g=d||p;if(g){let _=d?"passenger":"vehicle",b=f.find(S=>S.type===_&&S.id===g.id);if(b){this.searchControl.value!==b&&this.searchControl.setValue(b,{emitEvent:!1});return}}this.searchControl.value&&typeof this.searchControl.value!="string"&&this.searchControl.setValue("",{emitEvent:!1})}),Ji(()=>{let d=this.visualizerStatusSignal();if(this.matDialogRef){let p=this.matDialogRef;this.matDialogRef=null,p.close(null)}switch(this.loadingService.stop(),d){case"disconnected":case"running":case"paused":case"completed":case"stopping":return;case"starting":this.loadingService.start("Starting simulation...");return;case"not-found":this.matDialogRef=this.dialogService.openInformationDialog({title:"Simulation not found",message:"The simulation you are trying to visualize is not available for now. Please verify the URL.",type:"error",confirmButtonOverride:"Back to home",cancelButtonOverride:null,canCancel:!1}),hn(this.matDialogRef.afterClosed()).then(p=>Ce(this,null,function*(){p!==null&&(yield this.router.navigate(["home"]))})).catch(console.error);return;case"lost":this.matDialogRef=this.dialogService.openInformationDialog({title:"Simulation lost",message:"The simulation you are trying to visualize has been disconnected from the server. You can continue the visualization or go back to the home page.",type:"error",confirmButtonOverride:"Back to home",cancelButtonOverride:"Stay here",canCancel:!0}),hn(this.matDialogRef.afterClosed()).then(p=>Ce(this,null,function*(){p&&(yield this.router.navigate(["home"]))})).catch(console.error);return;case"corrupted":this.matDialogRef=this.dialogService.openInformationDialog({title:"Simulation corrupted",message:"The file containing the simulation data is corrupted.",type:"error",confirmButtonOverride:"Back to home",cancelButtonOverride:null,canCancel:!1}),hn(this.matDialogRef.afterClosed()).then(p=>Ce(this,null,function*(){p!==null&&(yield this.router.navigate(["home"]))})).catch(console.error);return;case"outdated":this.matDialogRef=this.dialogService.openInformationDialog({title:"Unsupported simulation version",message:"The version of the file containing the simulation data is too old for this version of the application.",type:"error",confirmButtonOverride:"Back to home",cancelButtonOverride:null,canCancel:!1}),hn(this.matDialogRef.afterClosed()).then(p=>Ce(this,null,function*(){p!==null&&(yield this.router.navigate(["home"]))})).catch(console.error);return;case"future":this.matDialogRef=this.dialogService.openInformationDialog({title:"Unsupported simulation version",message:"The version of the file containing the simulation data is too recent for this version of the application.",type:"error",confirmButtonOverride:"Back to home",cancelButtonOverride:null,canCancel:!1}),hn(this.matDialogRef.afterClosed()).then(p=>Ce(this,null,function*(){p!==null&&(yield this.router.navigate(["home"]))})).catch(console.error)}}),Ji(()=>{let d=this.visualizerStatusSignal(),p=this.simulationSignal();if(p)switch(d){case"running":case"paused":case"completed":case"starting":case"stopping":case"lost":this.visualizationService.init(p);return;default:this.visualizationService.destroy()}})}searchInput;matDialogRef=null;selectedModeSignal=Bt(null);visualizerStatusSignal=$t(()=>{if(!this.communicationService.isConnectedSignal())return"disconnected";let t=this.simulationSignal();return t?t.status:"not-found"});selectedPassengerSignal=$t(()=>{let e=this.visualizationService.environmentSignal();if(e===null)return null;let t=this.animationService.preselectedEntitySignal();if(t!==null&&t.shouldShowSelectedEntityTab&&t.entityType!=="passenger")return null;let r=null;if(t!==null&&t.shouldShowSelectedEntityTab)r=t.id;else{let n=this.animationService.selectedEntitySignal();n!==null&&n.entityType==="passenger"&&(r=n.id)}return r==null?null:e.passengers[r]??null});selectedVehicleSignal=$t(()=>{let e=this.visualizationService.environmentSignal();if(e===null)return null;let t=this.animationService.preselectedEntitySignal();if(t!==null&&t.shouldShowSelectedEntityTab&&t.entityType!=="vehicle")return null;let r=null;if(t!==null&&t.shouldShowSelectedEntityTab)r=t.id;else{let n=this.animationService.selectedEntitySignal();n!==null&&n.entityType==="vehicle"&&(r=n.id)}return r==null?null:e.vehicles[r]??null});selectedStopSignal=$t(()=>{let e=this.visualizationService.environmentSignal();if(e===null)return null;let t=this.animationService.preselectedEntitySignal();if(t!==null&&t.shouldShowSelectedEntityTab&&t.entityType!=="stop")return null;let r=null;if(t!==null&&t.shouldShowSelectedEntityTab)r=t.id;else{let n=this.animationService.selectedEntitySignal();n!==null&&n.entityType==="stop"&&(r=n.id)}return r==null?null:e.stops[r]??null});selectedPassengerVehicleSignal=$t(()=>{let e=this.visualizationService.environmentSignal();if(e===null)return null;let t=this.selectedPassengerSignal();if(t===null)return null;let r=R$(t,e.timestamp);return r===null?null:e.vehicles[r]??null});selectedPassengerStopSignal=$t(()=>{let e=this.visualizationService.environmentSignal();if(e===null)return null;let t=this.selectedPassengerSignal();if(t===null)return null;let r=B$(t,e.timestamp);if(r===null)return null;let{stopId:n,vehicleId:a}=r,o=e.vehicles[a];if(o===void 0)return null;let l=Bl(o).find(c=>c.id===n);return l===void 0?null:l});selectedVehiclePassengersSignal=$t(()=>{let e=this.visualizationService.environmentSignal();if(e===null)return[];let t=this.selectedVehicleSignal();return t===null?[]:Object.values(e.passengers).filter(n=>L$(n,t.id,e.timestamp))});selectedVehicleStopSignal=$t(()=>{if(this.visualizationService.environmentSignal()===null)return null;let t=this.selectedVehicleSignal();return t===null||t.currentStop===null?null:t.currentStop});selectedStopPassengersSignal=$t(()=>{let e=this.visualizationService.environmentSignal();if(e===null)return[];let t=this.selectedStopSignal();return t===null?[]:Object.values(e.passengers).filter(n=>D$(n,t.id,e.timestamp))});selectedStopWaitingPassengersSignal=$t(()=>this.selectedStopPassengersSignal().filter(t=>t.status!=="complete"));selectedStopCompletedPassengersSignal=$t(()=>this.selectedStopPassengersSignal().filter(t=>t.status==="complete"));selectedStopVehiclesSignal=$t(()=>{let e=this.visualizationService.environmentSignal();if(e===null)return[];let t=this.selectedStopSignal();return t===null?[]:Object.values(e.vehicles).filter(n=>n.currentStop!==null&&n.currentStop.id===t.id)});entitySearchDataSignal=$t(()=>{let e=this.visualizationService.environmentSignal();if(e===null)return[];let t=Object.values(e.passengers).map(n=>({id:n.id,displayedValue:`[PASSENGER] ${n.name+" ("+n.id+")"}`,type:"passenger",entity:n})),r=Object.values(e.vehicles).map(n=>({id:n.id,displayedValue:`[VEHICLE] ${n.id}`,type:"vehicle",entity:n}));return[...t,...r]});tabControl;showSearch=!1;showFilter=!1;showFavorites=!1;showClickHistory=!1;showLayers=!1;informationTabControl;showSimulationInformation=!1;showStatistics=!1;showEntitiesTab=!1;showSelectedEntityTab=!1;previousSearchValue=null;searchValueSignal=Bt("",{equal:(e,t)=>JSON.stringify(e)===JSON.stringify(t)});searchControl;filteredEntitySearchDataSignal=$t(()=>{let e=this.searchValueSignal(),t=this.entitySearchDataSignal(),r=this.visualizationFilterService.vehicleModes(),n=this.selectedModeSignal(),a=n!==null?t.filter(o=>o.type==="vehicle"&&o.entity.mode===n):t;if(e===""||typeof e=="object"&&e.type==="mode")return a;if(typeof e=="string"){if(e.toLowerCase().startsWith("mode:")){let s=e.substring(5).trim().toLowerCase();return r.filter(l=>l.toLowerCase().includes(s)).map(l=>({id:`mode:${l}`,displayedValue:`[MODE] ${l}`,type:"mode",entity:{mode:l}}))}let o=e.toLowerCase();return a.filter(s=>{if(s.type==="passenger"){let l=s.entity;return s.displayedValue.toLowerCase().includes(o)||l.name.toLowerCase().includes(o)}return s.displayedValue.toLowerCase().includes(o)})}return[e]});isSimulationRunningSignal=$t(()=>{let e=this.simulationSignal();return e!==null&&Bu.includes(e.status)});entitySearchDisplayFunction=e=>e?.displayedValue??"";ngOnDestroy(){this.visualizationService.destroy()}get statisticsSignal(){return $t(()=>{let e=this.visualizationService.environmentSignal();return e?e.statistics:{}})}get shouldShowInformationPanelSignal(){return this.userInterfaceService.shouldShowInformationPanelSignal}get isInitializedSignal(){return this.visualizationService.isInitializedSignal}get simulationSignal(){return this.simulationService.activeSimulationSignal}get isLoadingSignal(){return this.visualizationService.isLoadingSignal}clearSearch(){this.selectedModeSignal.set(null),this.searchControl.setValue(null)}pauseSimulation(e){this.simulationService.pauseSimulation(e)}resumeSimulation(e){this.simulationService.resumeSimulation(e)}stopSimulation(e){return Ce(this,null,function*(){(yield hn(this.dialogService.openInformationDialog({title:"Stopping Simulation",message:"Are you sure you want to stop the simulation? This action cannot be undone.",type:"warning",confirmButtonOverride:null,cancelButtonOverride:null,canCancel:!0}).afterClosed()))&&this.simulationService.stopSimulation(e)})}editSimulationConfiguration(e){return Ce(this,null,function*(){let t=yield hn(this.dialogService.openSimulationConfigurationDialog({mode:"edit",currentConfiguration:e.configuration}).afterClosed());t&&this.simulationService.editSimulationConfiguration(e.id,t.configuration.maxDuration)})}leaveVisualization(){return Ce(this,null,function*(){yield this.router.navigate(["home"])})}onSearchInputClick(){let e=this.searchValueSignal();typeof e=="object"&&e.type==="mode"||(this.searchControl.setValue(null),this.animationService.unselectEntity())}static \u0275fac=function(t){return new(t||i)(rt(Ha),rt(kA),rt(rf),rt(To),rt(Js),rt(Mr),rt(ty),rt(Ln),rt(wf),rt(Cd),rt(nd))};static \u0275cmp=tt({type:i,selectors:[["app-visualizer"]],viewQuery:function(t,r){if(t&1&&di(s9e,5),t&2){let n;St(n=kt())&&(r.searchInput=n.first)}},features:[ei([Ln,Cd])],decls:6,vars:6,consts:[["searchInput",""],["auto","matAutocomplete"],[1,"tabs","enable-pointer-events"],["mat-fab","","multiple","","hideMultipleSelectionIndicator","","name","tools","aria-label","tools",3,"formControl"],["value","search"],["value","filter"],["value","favorites"],["value","history"],["value","layers"],[1,"tab-content","fade","search-bar",3,"fade-show","enable-pointer-events"],[1,"tab-content","fade"],[1,"tab-content","fade",3,"fade-show","enable-pointer-events"],[1,"enable-pointer-events","information-panel-header"],["mat-fab","","multiple","","hideMultipleSelectionIndicator","","name","tools","aria-label","tools",1,".information-group",3,"formControl"],["value","information",3,"matTooltip"],["value","statistics",3,"matTooltip"],["value","entities",3,"matTooltip"],["value","selectedEntity",3,"disabled","matTooltip"],[1,"information-panel-content","fade",3,"fade-show","enable-pointer-events"],[1,"enable-pointer-events",3,"leaveVisualization","simulation"],[1,"enable-pointer-events",3,"simulation"],[1,"loading","background-gray","text-gray","enable-pointer-events"],[1,"tab-content","fade","search-bar"],[1,"search-form"],["matInput","",3,"click","matAutocomplete","formControl"],["mat-icon-button","","matSuffix","","type","button"],["matSuffix",""],[3,"displayWith"],[3,"value"],["mat-icon-button","","matSuffix","","type","button",3,"click"],[1,"information-panel-content","fade"],[1,"flex-1"],[1,"mat-card-group"],[3,"recursiveDict"],[3,"selectedPassenger","selectedPassengerStop","selectedPassengerVehicle","selectedVehicle","selectedVehicleStop","selectedVehiclePassengers","selectedStop","selectedStopWaitingPassengers","selectedStopCompletedPassengers","selectedStopVehicles"],[1,"enable-pointer-events",3,"pauseSimulation","resumeSimulation","stopSimulation","editSimulationConfiguration","simulation"],[1,"flex-row","align-center","gap-0-5-rem"],[1,"spin"]],template:function(t,r){if(t&1&&(Ri(0)(1)(2)(3)(4),je(5,k9e,47,28)),t&2){let n=hr(r.simulationSignal());oe(),hr(r.statisticsSignal()),oe(),hr(r.selectedPassengerSignal()),oe(),hr(r.selectedVehicleSignal()),oe(),hr(r.selectedStopSignal()),oe(),Je(r.isInitializedSignal()&&n!==null?5:-1)}},dependencies:[yA,SA,lA,oA,cA,ia,ea,ta,bM,Br,Xl,ha,ac,zs,Rw,pr,mr,So,qo,qn,da,Rn,Da,rX,tX,$l,DI,Rs,wh,Ps,ec,xh,Mb,_A,kc,oX,LI,_M,pX,uA,sA,mA],styles:[".flex-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.flex-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.align-center[_ngcontent-%COMP%], .align-main-center[_ngcontent-%COMP%]{justify-content:center}.align-center[_ngcontent-%COMP%], .align-cross-center[_ngcontent-%COMP%]{align-items:center}.align-main-end[_ngcontent-%COMP%]{justify-content:flex-end}.align-cross-end[_ngcontent-%COMP%]{align-items:flex-end}.align-main-start[_ngcontent-%COMP%]{justify-content:flex-start}.align-cross-start[_ngcontent-%COMP%]{align-items:flex-start}.align-cross-stretch[_ngcontent-%COMP%]{align-items:stretch}.gap-0-5-rem[_ngcontent-%COMP%]{gap:.5rem}.gap-1-rem[_ngcontent-%COMP%]{gap:1rem}.gap-1-5-rem[_ngcontent-%COMP%]{gap:1.5rem}.flex-1[_ngcontent-%COMP%]{flex:1}*[_ngcontent-%COMP%]{--red-text-color: #ff0000;--red-background-color: #ffdddd;--yellow-text-color: #ffc21b;--yellow-background-color: #ffe6a4;--green-text-color: #00aa00;--green-background-color: #ccffcc;--gray-text-color: #666666;--gray-background-color: #f0f0f0;--blue-text-color: #4488ff;--blue-background-color: #cce5ff;--loaded-slider-color: #005cbb88;--active-button-color: #cce6ff}.text-red[_ngcontent-%COMP%]{color:var(--red-text-color)}.background-red[_ngcontent-%COMP%]{background-color:var(--red-background-color)}.text-yellow[_ngcontent-%COMP%]{color:var(--yellow-text-color)}.background-yellow[_ngcontent-%COMP%]{background-color:var(--yellow-background-color)}.text-green[_ngcontent-%COMP%]{color:var(--green-text-color)}.background-green[_ngcontent-%COMP%]{background-color:var(--green-background-color)}.text-gray[_ngcontent-%COMP%]{color:var(--gray-text-color)}.background-gray[_ngcontent-%COMP%]{background-color:var(--gray-background-color)!important}.text-blue[_ngcontent-%COMP%]{color:var(--blue-text-color)}.background-blue[_ngcontent-%COMP%]{background-color:var(--blue-background-color)}[_nghost-%COMP%], .no-simulation[_ngcontent-%COMP%]{display:block;width:100%;height:100%;position:absolute;top:0;left:0;z-index:500}.no-simulation[_ngcontent-%COMP%]{background-color:#00000052}.no-simulation[_ngcontent-%COMP%] mat-card[_ngcontent-%COMP%]{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:500px;max-width:80vw}.no-simulation[_ngcontent-%COMP%] mat-card[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{min-width:24px}.disable-pointer-events[_ngcontent-%COMP%], [_nghost-%COMP%]{pointer-events:none}.enable-pointer-events[_ngcontent-%COMP%]{pointer-events:auto}.fade[_ngcontent-%COMP%]{opacity:0;transition:opacity .1s ease-in-out}.fade-show[_ngcontent-%COMP%]{opacity:1}.tabs[_ngcontent-%COMP%]{position:absolute;top:1rem;right:1rem}.tab-content[_ngcontent-%COMP%]{position:absolute;top:4rem;right:1rem}.mat-button-toggle-group-appearance-standard[_ngcontent-%COMP%]{box-shadow:var(--mat-sys-level3)!important;background-color:var(--mat-sys-surface-container-low);border-radius:var(--mat-sys-corner-large);border:0px}.search-bar[_ngcontent-%COMP%]{max-width:30rem;width:calc(100% - 23rem)}.search-form[_ngcontent-%COMP%]{width:100%}.light[_ngcontent-%COMP%]{font-weight:300}mat-card-title[_ngcontent-%COMP%]:not(:first-child){margin-block-start:1rem}.spin[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_spin 2s linear infinite}@keyframes _ngcontent-%COMP%_spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.loading[_ngcontent-%COMP%]{position:absolute;bottom:84px;left:50%;transform:translate(-50%)}.favorite-content[_ngcontent-%COMP%]{display:flex;align-items:center;height:20px}.favorite-content[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{scale:.8}[_nghost-%COMP%] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding:0}[_nghost-%COMP%] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic{padding:4px}.information-panel-header[_ngcontent-%COMP%]{position:absolute;top:1rem;left:1rem;box-shadow:none!important}.information-panel-content[_ngcontent-%COMP%]{position:absolute;top:4rem;left:1rem;box-shadow:none!important;max-height:calc(100vh - 10rem);overflow-y:auto;max-width:45rem;min-width:20rem;resize:horizontal}.clickable[_ngcontent-%COMP%]{cursor:pointer;padding:.5rem 0;border-radius:.5rem}.clickable[_ngcontent-%COMP%]:hover{background-color:#1a1b1f14}.clickable-no-padding[_ngcontent-%COMP%]{cursor:pointer;border-radius:.5rem}.clickable-no-padding[_ngcontent-%COMP%]:hover{background-color:#1a1b1f14}.indent[_ngcontent-%COMP%]{padding-left:24px}.mat-card-group[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]:first-child{border-bottom-left-radius:0;border-bottom-right-radius:0}.mat-card-group[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]:last-child{border-top-left-radius:0;border-top-right-radius:0}.mat-card-group[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]:not(:first-child):not(:last-child){border-radius:0}"]})};var hme=(i,e,t,r)=>(te(Mr).clearAnimations(),!0);var dme=(i,e)=>{let t=i.params.simulationId;return te(Ha).setActiveSimulationId(t),!0};var mme=(i,e,t,r)=>(te(Ha).unsetActiveSimulationId(),!0);var pme=[{path:"",redirectTo:"home",pathMatch:"full"},{path:"home",component:gM},{path:"visualize/:simulationId",component:xA,canActivate:[dme],canDeactivate:[mme,hme]},{path:"**",redirectTo:"home"}];var x9e={url:Ux.socketUrl,options:{auth:{type:"client"}}},fme={providers:[M4(YK.forRoot(x9e)),$4({eventCoalescing:!0}),_K(pme),FV(),kV()]};var a6t=go(mG());function w9e(i,e){i&1&&(Z(0,"mat-chip",1)(1,"div",2)(2,"mat-icon",3),ce(3,"autorenew"),Q()()()),i&2&&yr("background-color","var(--gray-background-color)")}function C9e(i,e){i&1&&(Z(0,"mat-chip",1)(1,"div",4)(2,"mat-icon"),ce(3,"wifi"),Q()()()),i&2&&yr("background-color","var(--green-background-color)")}function M9e(i,e){i&1&&(Z(0,"mat-chip",1)(1,"div",5)(2,"mat-icon"),ce(3,"wifi_off"),Q()()()),i&2&&yr("background-color","var(--red-background-color)")}var wA=class i{constructor(e){this.communicationService=e}get communicationStatusSignal(){return this.communicationService.communicationStatusSignal}static \u0275fac=function(t){return new(t||i)(rt(To))};static \u0275cmp=tt({type:i,selectors:[["app-connection-status"]],decls:4,vars:1,consts:[[1,"square-chip",3,"background-color"],[1,"square-chip"],[1,"flex-row","align-center","justify-center","gap-0-5-rem","text-gray","full-size"],[1,"spin"],[1,"flex-row","align-center","justify-center","gap-0-5-rem","text-green","full-size"],[1,"flex-row","align-center","justify-center","gap-0-5-rem","text-red","full-size"]],template:function(t,r){if(t&1&&(Ri(0),je(1,w9e,4,2,"mat-chip",0)(2,C9e,4,2,"mat-chip",0)(3,M9e,4,2,"mat-chip",0)),t&2){let n,a=r.communicationStatusSignal();oe(),Je((n=a)==="connecting"?1:n==="connected"?2:n==="disconnected"?3:-1)}},dependencies:[qn,da,pr,mr],styles:[".flex-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.flex-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.align-center[_ngcontent-%COMP%], .align-main-center[_ngcontent-%COMP%]{justify-content:center}.align-center[_ngcontent-%COMP%], .align-cross-center[_ngcontent-%COMP%]{align-items:center}.align-main-end[_ngcontent-%COMP%]{justify-content:flex-end}.align-cross-end[_ngcontent-%COMP%]{align-items:flex-end}.align-main-start[_ngcontent-%COMP%]{justify-content:flex-start}.align-cross-start[_ngcontent-%COMP%]{align-items:flex-start}.align-cross-stretch[_ngcontent-%COMP%]{align-items:stretch}.gap-0-5-rem[_ngcontent-%COMP%]{gap:.5rem}.gap-1-rem[_ngcontent-%COMP%]{gap:1rem}.gap-1-5-rem[_ngcontent-%COMP%]{gap:1.5rem}.flex-1[_ngcontent-%COMP%]{flex:1}*[_ngcontent-%COMP%]{--red-text-color: #ff0000;--red-background-color: #ffdddd;--yellow-text-color: #ffc21b;--yellow-background-color: #ffe6a4;--green-text-color: #00aa00;--green-background-color: #ccffcc;--gray-text-color: #666666;--gray-background-color: #f0f0f0;--blue-text-color: #4488ff;--blue-background-color: #cce5ff;--loaded-slider-color: #005cbb88;--active-button-color: #cce6ff}.text-red[_ngcontent-%COMP%]{color:var(--red-text-color)}.background-red[_ngcontent-%COMP%]{background-color:var(--red-background-color)}.text-yellow[_ngcontent-%COMP%]{color:var(--yellow-text-color)}.background-yellow[_ngcontent-%COMP%]{background-color:var(--yellow-background-color)}.text-green[_ngcontent-%COMP%]{color:var(--green-text-color)}.background-green[_ngcontent-%COMP%]{background-color:var(--green-background-color)}.text-gray[_ngcontent-%COMP%]{color:var(--gray-text-color)}.background-gray[_ngcontent-%COMP%]{background-color:var(--gray-background-color)!important}.text-blue[_ngcontent-%COMP%]{color:var(--blue-text-color)}.background-blue[_ngcontent-%COMP%]{background-color:var(--blue-background-color)}.square-chip[_ngcontent-%COMP%]{width:2.1rem;height:2.1rem;padding:0;display:flex;align-items:center;justify-content:center}.full-size[_ngcontent-%COMP%]{width:100%;height:100%}.spin[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_spin 2s linear infinite}@keyframes _ngcontent-%COMP%_spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}"]})};var h_=go(ny(),1),ka=class{static mapToArray(e){let t=[];for(let r in e)e.hasOwnProperty(r)&&t.push(e[r]);return t}static handleEvent(e,t,r){0<t.observers.length&&e.run(()=>{t.emit(r)})}},gme=(()=>{class i{constructor(t,r){this.element=t,this.zone=r,this.DEFAULT_ZOOM=1,this.DEFAULT_CENTER=(0,h_.latLng)(38.907192,-77.036871),this.DEFAULT_FPZ_OPTIONS={},this.fitBoundsOptions=this.DEFAULT_FPZ_OPTIONS,this.panOptions=this.DEFAULT_FPZ_OPTIONS,this.zoomOptions=this.DEFAULT_FPZ_OPTIONS,this.zoomPanOptions=this.DEFAULT_FPZ_OPTIONS,this.options={},this.mapReady=new ut,this.zoomChange=new ut,this.centerChange=new ut,this.onClick=new ut,this.onDoubleClick=new ut,this.onMouseDown=new ut,this.onMouseUp=new ut,this.onMouseMove=new ut,this.onMouseOver=new ut,this.onMouseOut=new ut,this.onMapMove=new ut,this.onMapMoveStart=new ut,this.onMapMoveEnd=new ut,this.onMapZoom=new ut,this.onMapZoomStart=new ut,this.onMapZoomEnd=new ut}ngOnInit(){this.zone.runOutsideAngular(()=>{this.map=(0,h_.map)(this.element.nativeElement,this.options),this.addMapEventListeners()}),this.center!=null&&this.zoom!=null&&this.setView(this.center,this.zoom),this.fitBounds!=null&&this.setFitBounds(this.fitBounds),this.maxBounds!=null&&this.setMaxBounds(this.maxBounds),this.minZoom!=null&&this.setMinZoom(this.minZoom),this.maxZoom!=null&&this.setMaxZoom(this.maxZoom),this.doResize(),this.mapReady.emit(this.map)}ngOnChanges(t){t.zoom&&t.center&&this.zoom!=null&&this.center!=null?this.setView(t.center.currentValue,t.zoom.currentValue):t.zoom?this.setZoom(t.zoom.currentValue):t.center&&this.setCenter(t.center.currentValue),t.fitBounds&&this.setFitBounds(t.fitBounds.currentValue),t.maxBounds&&this.setMaxBounds(t.maxBounds.currentValue),t.minZoom&&this.setMinZoom(t.minZoom.currentValue),t.maxZoom&&this.setMaxZoom(t.maxZoom.currentValue)}ngOnDestroy(){this.map!=null&&this.map.remove()}getMap(){return this.map}onResize(){this.delayResize()}addMapEventListeners(){let t=(n,a)=>{this.map.on(n,a)};t("click",n=>ka.handleEvent(this.zone,this.onClick,n)),t("dblclick",n=>ka.handleEvent(this.zone,this.onDoubleClick,n)),t("mousedown",n=>ka.handleEvent(this.zone,this.onMouseDown,n)),t("mouseup",n=>ka.handleEvent(this.zone,this.onMouseUp,n)),t("mouseover",n=>ka.handleEvent(this.zone,this.onMouseOver,n)),t("mouseout",n=>ka.handleEvent(this.zone,this.onMouseOut,n)),t("mousemove",n=>ka.handleEvent(this.zone,this.onMouseMove,n)),t("zoomstart",n=>ka.handleEvent(this.zone,this.onMapZoomStart,n)),t("zoom",n=>ka.handleEvent(this.zone,this.onMapZoom,n)),t("zoomend",n=>ka.handleEvent(this.zone,this.onMapZoomEnd,n)),t("movestart",n=>ka.handleEvent(this.zone,this.onMapMoveStart,n)),t("move",n=>ka.handleEvent(this.zone,this.onMapMove,n)),t("moveend",n=>ka.handleEvent(this.zone,this.onMapMoveEnd,n));let r=()=>{let n=this.map.getZoom();n!==this.zoom&&(this.zoom=n,ka.handleEvent(this.zone,this.zoomChange,n));let a=this.map.getCenter();(a!=null||this.center!=null)&&((a==null||this.center==null)&&a!==this.center||a.lat!==this.center.lat||a.lng!==this.center.lng)&&(this.center=a,ka.handleEvent(this.zone,this.centerChange,a))};t("moveend",r),t("zoomend",r)}doResize(){this.zone.runOutsideAngular(()=>{this.map!=null&&this.map.invalidateSize({})})}delayResize(){this.resizeTimer!=null&&clearTimeout(this.resizeTimer),this.resizeTimer=setTimeout(this.doResize.bind(this),200)}setView(t,r){this.map!=null&&t!=null&&r!=null&&this.map.setView(t,r,this.zoomPanOptions)}setZoom(t){this.map!=null&&t!=null&&this.map.setZoom(t,this.zoomOptions)}setCenter(t){this.map!=null&&t!=null&&this.map.panTo(t,this.panOptions)}setFitBounds(t){this.map!=null&&t!=null&&this.map.fitBounds(t,this.fitBoundsOptions)}setMaxBounds(t){this.map!=null&&t!=null&&this.map.setMaxBounds(t)}setMinZoom(t){this.map!=null&&t!=null&&this.map.setMinZoom(t)}setMaxZoom(t){this.map!=null&&t!=null&&this.map.setMaxZoom(t)}static{this.\u0275fac=function(r){return new(r||i)(rt(Et),rt(Kt))}}static{this.\u0275dir=ft({type:i,selectors:[["","leaflet",""]],hostBindings:function(r,n){r&1&&Le("resize",function(){return n.onResize()},!1,N4)},inputs:{fitBoundsOptions:[0,"leafletFitBoundsOptions","fitBoundsOptions"],panOptions:[0,"leafletPanOptions","panOptions"],zoomOptions:[0,"leafletZoomOptions","zoomOptions"],zoomPanOptions:[0,"leafletZoomPanOptions","zoomPanOptions"],options:[0,"leafletOptions","options"],zoom:[0,"leafletZoom","zoom"],center:[0,"leafletCenter","center"],fitBounds:[0,"leafletFitBounds","fitBounds"],maxBounds:[0,"leafletMaxBounds","maxBounds"],minZoom:[0,"leafletMinZoom","minZoom"],maxZoom:[0,"leafletMaxZoom","maxZoom"]},outputs:{mapReady:"leafletMapReady",zoomChange:"leafletZoomChange",centerChange:"leafletCenterChange",onClick:"leafletClick",onDoubleClick:"leafletDoubleClick",onMouseDown:"leafletMouseDown",onMouseUp:"leafletMouseUp",onMouseMove:"leafletMouseMove",onMouseOver:"leafletMouseOver",onMouseOut:"leafletMouseOut",onMapMove:"leafletMapMove",onMapMoveStart:"leafletMapMoveStart",onMapMoveEnd:"leafletMapMoveEnd",onMapZoom:"leafletMapZoom",onMapZoomStart:"leafletMapZoomStart",onMapZoomEnd:"leafletMapZoomEnd"},standalone:!1,features:[rr]})}}return i})();var yme=(()=>{class i{static{this.\u0275fac=function(r){return new(r||i)}}static{this.\u0275mod=Lt({type:i})}static{this.\u0275inj=Dt({})}}return i})();var _me=go(ny());var E9e=["container"],A9e=["cardContent"],P9e=(i,e)=>e.id;function B9e(i,e){i&1&&ce(0," directions_car ")}function R9e(i,e){i&1&&ce(0," accessibility ")}function D9e(i,e){i&1&&ce(0," place ")}function L9e(i,e){if(i&1){let t=vt();Z(0,"mat-chip",7),Le("click",function(){let n=Ee(t).$implicit,a=Se();return Ae(a.selectEntity(n))})("mouseenter",function(){let n=Ee(t).$implicit,a=Se();return Ae(a.preselectEntity(n))})("mouseleave",function(){Ee(t);let n=Se();return Ae(n.unpreselectEntity())}),Z(1,"mat-icon",8),je(2,B9e,1,0)(3,R9e,1,0)(4,D9e,1,0),Q(),Ge(5,"app-entity-name",9),Q()}if(i&2){let t,r=e.$implicit;oe(2),Je((t=r.entityType)==="vehicle"?2:t==="passenger"?3:t==="stop"?4:-1),oe(3),Re("name",r.name)("tags",r.tags)}}var CA=class i{constructor(e){this.animationService=e;Ji(()=>{this.animationService.clickPositionSignal()===null?this.show.set(!1):(this.show.set(!0),this.cardContent()?.nativeElement.scroll(0,0),this.container()?.nativeElement.focus())})}offset=30;maxHeightPadding=150;width=250;container=lh.required("container");cardContent=lh.required("cardContent");show=Bt(!1);top=$t(()=>{let e=this.animationService.clickPositionSignal();if(e===null)return"";let t=e.y;return t<window.innerHeight/2?t+"px":""});bottom=$t(()=>{let e=this.animationService.clickPositionSignal();if(e===null)return"";let t=e.y;return t>=window.innerHeight/2?window.innerHeight-t+"px":""});left=$t(()=>{let e=this.animationService.clickPositionSignal();if(e===null)return"";let t=e.x;return t+2*this.offset+this.width>window.innerWidth?t-this.offset-this.width+"px":t+this.offset+"px"});maxHeight=$t(()=>{let e=this.animationService.clickPositionSignal();if(e===null)return"";let t=e.y;return t<window.innerHeight/2?window.innerHeight-t-this.maxHeightPadding+"px":t-this.maxHeightPadding+"px"});get closeEntitiesSignal(){return this.animationService.closeEntitiesSignal}unpreselectEntity(){this.animationService.unpreselectEntity()}preselectEntity(e){this.animationService.preselectEntity(e,!0)}selectEntity(e){this.show.set(!1),this.animationService.clickHandled(),this.animationService.selectEntity(e)}onBlur(){this.unpreselectEntity(),this.show.set(!1)}static \u0275fac=function(t){return new(t||i)(rt(Mr))};static \u0275cmp=tt({type:i,selectors:[["app-close-entities-menu"]],viewQuery:function(t,r){t&1&&(ch(r.container,E9e,5),ch(r.cardContent,A9e,5)),t&2&&uh(2)},decls:11,vars:13,consts:[["container",""],["cardContent",""],["tabindex","0",3,"blur"],[1,"fade"],[1,"info"],[1,"card-content"],[1,"content"],[3,"click","mouseenter","mouseleave"],["matChipAvatar",""],[3,"name","tags"]],template:function(t,r){if(t&1){let n=vt();Z(0,"div",2,0),Le("blur",function(){return Ee(n),Ae(r.onBlur())}),Ri(2),Z(3,"mat-card",3)(4,"span",4),ce(5),Q(),Z(6,"mat-card-content",5,1)(8,"div",6),ui(9,L9e,6,3,"mat-chip",null,P9e),Q()()()()}if(t&2){let n=r.closeEntitiesSignal();oe(3),yr("top",r.top())("bottom",r.bottom())("left",r.left()),gt("fade-show",r.show())("disable-pointer-events",!r.show()),oe(2),_t("",n.length," entities close"),oe(),yr("max-height",r.maxHeight()),oe(3),hi(n)}},dependencies:[ia,ea,ta,qn,da,Rf,pr,mr,rl],styles:["mat-card[_ngcontent-%COMP%]{position:absolute;z-index:400}.content[_ngcontent-%COMP%]{width:100%;display:flex;flex-direction:column;gap:5px;max-width:200px;margin-right:10px}.disable-pointer-events[_ngcontent-%COMP%]{pointer-events:none}mat-card[_ngcontent-%COMP%]{padding:10px}mat-card-content[_ngcontent-%COMP%]{overflow-x:hidden;overflow-y:auto}.info[_ngcontent-%COMP%]{margin-bottom:5px}.mat-mdc-card-content[_ngcontent-%COMP%]{padding:0!important}[_nghost-%COMP%] .mat-mdc-standard-chip .mdc-evolution-chip__cell--primary, [_nghost-%COMP%] .mat-mdc-standard-chip .mdc-evolution-chip__action--primary, [_nghost-%COMP%] .mat-mdc-standard-chip .mat-mdc-chip-action-label{overflow:hidden}.fade[_ngcontent-%COMP%]{opacity:0;transition:opacity .1s ease-in-out}.fade-show[_ngcontent-%COMP%]{opacity:1}"]})};var MA=class i{constructor(e){this.mapService=e;window.addEventListener("beforeunload",this.saveMapState.bind(this))}animationService=te(Mr);savedZoom=localStorage.getItem("mapZoom")?parseInt(localStorage.getItem("mapZoom"),10):12;savedCenter=localStorage.getItem("mapCenter")?JSON.parse(localStorage.getItem("mapCenter")):(0,_me.latLng)(45.523066,-73.652687);options={layers:[],zoom:this.savedZoom,center:this.savedCenter};map;ngOnDestroy(){window.removeEventListener("beforeunload",this.saveMapState.bind(this)),this.saveMapState()}onMapReady(e){this.map=e,this.mapService.map=e,this.mapService.selectMapTile(this.mapService.selectedMapTile()),e.attributionControl.setPosition("bottomleft"),e.zoomControl.setPosition("bottomright"),this.animationService.addPixiOverlay(e),this.savedZoom&&e.setZoom(this.savedZoom),this.savedCenter&&e.setView(this.savedCenter,this.savedZoom)}saveMapState(){if(this.map){let e=this.map.getZoom(),t=this.map.getCenter();localStorage.setItem("mapZoom",e.toString()),localStorage.setItem("mapCenter",JSON.stringify([t.lat,t.lng]))}}static \u0275fac=function(t){return new(t||i)(rt(u_))};static \u0275cmp=tt({type:i,selectors:[["app-map"]],decls:2,vars:1,consts:[["leaflet","",1,"map",3,"leafletMapReady","leafletOptions"]],template:function(t,r){t&1&&(Z(0,"div",0),Le("leafletMapReady",function(a){return r.onMapReady(a)}),Q(),Ge(1,"app-close-entities-menu")),t&2&&Re("leafletOptions",r.options)},dependencies:[yme,gme,CA],styles:["[_nghost-%COMP%]{width:100%;height:100%;display:block}[_nghost-%COMP%] .map[_ngcontent-%COMP%]{width:100%;height:100%}"]})};var vme=go(bme());var TA=class i{constructor(e){this.el=e}mode="";stats;ngOnInit(){this.stats=new vme.default,this.mode==="fps"?this.stats.showPanel(0):this.mode==="ms"&&this.stats.showPanel(1),this.stats.dom.removeAttribute("style"),this.el.nativeElement.appendChild(this.stats.dom),this.update()}update(){this.stats.begin(),requestAnimationFrame(()=>{this.stats.end(),this.update()})}ngOnDestroy(){this.el.nativeElement.removeChild(this.stats.dom)}static \u0275fac=function(t){return new(t||i)(rt(Et))};static \u0275cmp=tt({type:i,selectors:[["app-metrics"]],inputs:{mode:"mode"},decls:0,vars:0,template:function(t,r){},encapsulation:2})};var EA=class i{static \u0275fac=function(t){return new(t||i)};static \u0275cmp=tt({type:i,selectors:[["app-root"]],decls:6,vars:2,consts:[[1,"metrics"],[3,"mode"]],template:function(t,r){t&1&&(Ge(0,"app-map")(1,"router-outlet"),Z(2,"div",0),Ge(3,"app-metrics",1)(4,"app-metrics",1),Q(),Ge(5,"app-connection-status")),t&2&&(oe(3),Re("mode","fps"),oe(),Re("mode","ms"))},dependencies:[MA,cB,wA,TA],styles:[".main[_ngcontent-%COMP%]{height:calc(100% - 40px);padding:20px}.map[_ngcontent-%COMP%]{height:100%}#button-overlay[_ngcontent-%COMP%]{position:absolute;left:0;bottom:0;margin:20px}#button-content[_ngcontent-%COMP%]{display:flex;flex-direction:column-reverse;align-items:flex-start;gap:10px;margin:20px 20px 40px;height:calc(100% - 40px);position:relative;z-index:500}#info-overlay[_ngcontent-%COMP%]{position:absolute;left:0;bottom:0;top:0;margin:20px;z-index:500}#info-content[_ngcontent-%COMP%]{position:relative;margin:20px}app-connection-status[_ngcontent-%COMP%]{position:absolute;right:49px;bottom:10px;z-index:500}.metrics[_ngcontent-%COMP%]{position:absolute;bottom:1.5rem;z-index:500}"]})};DV(EA,fme).catch(i=>console.error(i));
|
3648
|
+
}`,this._stylesheet)}get stylesheet(){return this._stylesheet}set stylesheet(e){this._stylesheet!==e&&(this._stylesheet=e,this.styleID++)}normalizeColor(e){return Array.isArray(e)&&(e=ot.rgb2hex(e)),typeof e=="number"?ot.hex2string(e):e}dropShadowToCSS(){let e=this.normalizeColor(this.dropShadowColor),t=this.dropShadowAlpha,r=Math.round(Math.cos(this.dropShadowAngle)*this.dropShadowDistance),n=Math.round(Math.sin(this.dropShadowAngle)*this.dropShadowDistance);e.startsWith("#")&&t<1&&(e+=(t*255|0).toString(16).padStart(2,"0"));let a=`${r}px ${n}px`;return this.dropShadowBlur>0?`text-shadow: ${a} ${this.dropShadowBlur}px ${e}`:`text-shadow: ${a} ${e}`}reset(){Object.assign(this,l_.defaultOptions)}onBeforeDraw(){let{fontsDirty:e}=this;return this.fontsDirty=!1,this.isSafari&&this._fonts.length>0&&e?new Promise(t=>setTimeout(t,100)):Promise.resolve()}get isSafari(){let{userAgent:e}=Qe.ADAPTER.getNavigator();return/^((?!chrome|android).)*safari/i.test(e)}set fillGradientStops(e){console.warn("[HTMLTextStyle] fillGradientStops is not supported by HTMLText")}get fillGradientStops(){return super.fillGradientStops}set fillGradientType(e){console.warn("[HTMLTextStyle] fillGradientType is not supported by HTMLText")}get fillGradientType(){return super.fillGradientType}set miterLimit(e){console.warn("[HTMLTextStyle] miterLimit is not supported by HTMLText")}get miterLimit(){return super.miterLimit}set trim(e){console.warn("[HTMLTextStyle] trim is not supported by HTMLText")}get trim(){return super.trim}set textBaseline(e){console.warn("[HTMLTextStyle] textBaseline is not supported by HTMLText")}get textBaseline(){return super.textBaseline}set leading(e){console.warn("[HTMLTextStyle] leading is not supported by HTMLText")}get leading(){return super.leading}set lineJoin(e){console.warn("[HTMLTextStyle] lineJoin is not supported by HTMLText")}get lineJoin(){return super.lineJoin}};v5.availableFonts={},v5.defaultOptions={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,padding:0,stroke:"black",strokeThickness:0,whiteSpace:"normal",wordWrap:!1,wordWrapWidth:100};var bk=v5;var aA=class c_ extends _a{constructor(e="",t={}){super(Ft.EMPTY),this._text=null,this._style=null,this._autoResolution=!0,this.localStyleID=-1,this.dirty=!1,this._updateID=0,this.ownsStyle=!1;let r=new Image,n=Ft.from(r,{scaleMode:Qe.SCALE_MODE,resourceOptions:{autoLoad:!1}});n.orig=new Xt,n.trim=new Xt,this.texture=n;let a="http://www.w3.org/2000/svg",o="http://www.w3.org/1999/xhtml",s=document.createElementNS(a,"svg"),l=document.createElementNS(a,"foreignObject"),c=document.createElementNS(o,"div"),u=document.createElementNS(o,"style");l.setAttribute("width","10000"),l.setAttribute("height","10000"),l.style.overflow="hidden",s.appendChild(l),this.maxWidth=c_.defaultMaxWidth,this.maxHeight=c_.defaultMaxHeight,this._domElement=c,this._styleElement=u,this._svgRoot=s,this._foreignObject=l,this._foreignObject.appendChild(u),this._foreignObject.appendChild(c),this._image=r,this._loadImage=new Image,this._autoResolution=c_.defaultAutoResolution,this._resolution=c_.defaultResolution??Qe.RESOLUTION,this.text=e,this.style=t}measureText(e){let{text:t,style:r,resolution:n}=Object.assign({text:this._text,style:this._style,resolution:this._resolution},e);Object.assign(this._domElement,{innerHTML:t,style:r.toCSS(n)}),this._styleElement.textContent=r.toGlobalCSS(),document.body.appendChild(this._svgRoot);let a=this._domElement.getBoundingClientRect();this._svgRoot.remove();let{width:o,height:s}=a;(o>this.maxWidth||s>this.maxHeight)&&console.warn("[HTMLText] Large expanse of text, increase HTMLText.maxWidth or HTMLText.maxHeight property.");let l=Math.min(this.maxWidth,Math.ceil(o)),c=Math.min(this.maxHeight,Math.ceil(s));return this._svgRoot.setAttribute("width",l.toString()),this._svgRoot.setAttribute("height",c.toString()),t!==this._text&&(this._domElement.innerHTML=this._text),r!==this._style&&(Object.assign(this._domElement,{style:this._style?.toCSS(n)}),this._styleElement.textContent=this._style?.toGlobalCSS()),{width:l+r.padding*2,height:c+r.padding*2}}updateText(e=!0){return Ce(this,null,function*(){let{style:t,_image:r,_loadImage:n}=this;if(this.localStyleID!==t.styleID&&(this.dirty=!0,this.localStyleID=t.styleID),!this.dirty&&e)return;let{width:a,height:o}=this.measureText();r.width=n.width=Math.ceil(Math.max(1,a)),r.height=n.height=Math.ceil(Math.max(1,o)),this._updateID++;let s=this._updateID;yield new Promise(l=>{n.onload=()=>Ce(this,null,function*(){if(s<this._updateID){l();return}yield t.onBeforeDraw(),r.src=n.src,n.onload=null,n.src="",this.updateTexture(),l()});let c=new XMLSerializer().serializeToString(this._svgRoot);n.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(c)}`})})}get source(){return this._image}updateTexture(){let{style:e,texture:t,_image:r,resolution:n}=this,{padding:a}=e,{baseTexture:o}=t;t.trim.width=t._frame.width=r.width/n,t.trim.height=t._frame.height=r.height/n,t.trim.x=-a,t.trim.y=-a,t.orig.width=t._frame.width-a*2,t.orig.height=t._frame.height-a*2,this._onTextureUpdate(),o.setRealSize(r.width,r.height,n),this.dirty=!1}_render(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),super._render(e)}_renderCanvas(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),super._renderCanvas(e)}getLocalBounds(e){return this.updateText(!0),super.getLocalBounds(e)}_calculateBounds(){this.updateText(!0),this.calculateVertices(),this._bounds.addQuad(this.vertexData)}_onStyleChange(){this.dirty=!0}destroy(e){typeof e=="boolean"&&(e={children:e}),e=Object.assign({},c_.defaultDestroyOptions,e),super.destroy(e);let t=null;this.ownsStyle&&this._style?.cleanFonts(),this._style=t,this._svgRoot?.remove(),this._svgRoot=t,this._domElement?.remove(),this._domElement=t,this._foreignObject?.remove(),this._foreignObject=t,this._styleElement?.remove(),this._styleElement=t,this._loadImage.src="",this._loadImage.onload=null,this._loadImage=t,this._image.src="",this._image=t}get width(){return this.updateText(!0),Math.abs(this.scale.x)*this._image.width/this.resolution}set width(e){this.updateText(!0);let t=ot.sign(this.scale.x)||1;this.scale.x=t*e/this._image.width/this.resolution,this._width=e}get height(){return this.updateText(!0),Math.abs(this.scale.y)*this._image.height/this.resolution}set height(e){this.updateText(!0);let t=ot.sign(this.scale.y)||1;this.scale.y=t*e/this._image.height/this.resolution,this._height=e}get style(){return this._style}set style(e){this._style!==e&&(e=e||{},e instanceof bk?(this.ownsStyle=!1,this._style=e):e instanceof Fo?(console.warn("[HTMLText] Cloning TextStyle, if this is not what you want, use HTMLTextStyle"),this.ownsStyle=!0,this._style=bk.from(e)):(this.ownsStyle=!0,this._style=new bk(e)),this.localStyleID=-1,this.dirty=!0)}get text(){return this._text}set text(e){e=String(e===""||e===null||e===void 0?" ":e),e=this.sanitiseText(e),this._text!==e&&(this._text=e,this.dirty=!0)}get resolution(){return this._resolution}set resolution(e){this._autoResolution=!1,this._resolution!==e&&(this._resolution=e,this.dirty=!0)}sanitiseText(e){return e.replace(/<br>/gi,"<br/>").replace(/<hr>/gi,"<hr/>").replace(/ /gi," ")}};aA.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},aA.defaultMaxWidth=2024,aA.defaultMaxHeight=2024,aA.defaultAutoResolution=!0;function S5(i){return i.entity.entityType==="passenger"}function $de(i){return i.entity.entityType==="vehicle"}var xd=class i{constructor(e){this.simulationService=e;Ji(()=>{this.loadFavoritesFromLocalStorage()}),Ji(()=>{this.saveFavoritesToLocalStorage()})}VERSION=2;KEY_FAVORITES_PREFIX="multimodal.favorites.";_favoriteEntitiesSignal=Bt([]);_simulationFavKey=$t(()=>{let e=this.simulationService.activeSimulationSignal();return e?`${this.KEY_FAVORITES_PREFIX}${e.id}`:null});get favoriteEntitiesSignal(){return this._favoriteEntitiesSignal}toggleFavoriteEntity(e){this._favoriteEntitiesSignal.update(t=>(t.find(r=>r.id===e.id&&r.entityType===e.entityType)?t=t.filter(r=>r.id!==e.id||r.entityType!==e.entityType):t.push(e),[...this.sortFavorites(t)]))}isFavoriteEntity(e){return this._favoriteEntitiesSignal().some(t=>t.id===e.id&&t.entityType===e.entityType)}loadFavoritesFromLocalStorage(){let e=this._simulationFavKey();if(e===null)return;let t=localStorage.getItem(e);if(!t)return;let r=JSON.parse(t);!r.version||r.version!==this.VERSION||Array.isArray(r.favoriteEntities)&&this._favoriteEntitiesSignal.set(this.sortFavorites(r.favoriteEntities))}saveFavoritesToLocalStorage(){let e=this._simulationFavKey();if(e===null)return;let t={version:this.VERSION,favoriteEntities:this._favoriteEntitiesSignal()};localStorage.setItem(e,JSON.stringify(t))}sortFavorites(e){return e.sort((t,r)=>t.entityType!==r.entityType?t.entityType.localeCompare(r.entityType):t.name.localeCompare(r.name))}static \u0275fac=function(t){return new(t||i)(Zt(Ha))};static \u0275prov=lt({token:i,factory:i.\u0275fac,providedIn:"root"})};var Mr=class i{constructor(e,t,r){this.favoriteEntitiesService=e;this.spritesService=t;this.taskService=r;xp.load(this.BITMAP_TEXT_URL).then(()=>{this.fontsLoaded=!0}),this.mainContainer.addChild(this.backgroundContainer),this.mainContainer.addChild(this.polylinesContainer),this.mainContainer.addChild(this.entitiesContainer)}MAXIMUM_ALLOWED_DESYNCHRONIZATION_DIFFERENCE=1.5;WHITE=16777215;BITMAP_TEXT_URL="bitmap-fonts/custom-sans-serif.xml";BITMAP_TEXT_STYLE={fontName:"custom-sans-serif",fontSize:18};POLYLINE_WIDTH=4;POLYLINE_MIN_WIDTH=.04;POLYLINE_ALPHA=.9;POLYLINE_COMPLETE_COLOR=6710886;POLYLINE_REMAINING_COLOR=166415;SAFETY_RATIO=.95;MIN_FRAME_RATE=60;MIN_TASK_ALLOCATION=5;MIN_TIME_PER_FRAME=1e3/this.MIN_FRAME_RATE*this.SAFETY_RATIO;nextContinuousEnvironments=[];nextWantedVisualizationTime=null;nextPolylines=null;nextIsPaused=!1;nextSpeed=1;nextFilters=new Set;nextFilterMode="all";nextShouldShowComplete=!1;nextShouldCenterMap=!1;nextShouldFollowEntity=!1;nextClickEvent=null;nextHighlightedLegIndex=null;nextShouldFindCloseEntities=!1;continuousEnvironments=[];wantedVisualizationTime=null;animationVisualizationTime=0;polylines=null;hasCenteredInitially=!1;isPaused=!1;speed=1;vehicleEntities=[];vehicleEntitiesByVehicleId={};passengersEntities=[];passengerEntitiesByPassengerId={};stopEntities=[];stopEntitiesByPosition={};presentVehicleEntities=[];presentPassengerEntities=[];presentStopEntities=[];entitiesContainer=new cr;polylinesContainer=new cr;backgroundContainer=new cr;mainContainer=new cr;selectedEntityPolylines=[];filters=new Set;filterMode="all";shouldShowComplete=!1;shouldCenterMap=!1;shouldFindCloseEntities=!1;highlightedLegIndex=null;clickEvent=null;fontsLoaded=!1;_selectedEntitySignal=Bt(null);_preselectedEntitySignal=Bt(null);_clickPositionSignal=Bt(null);_closeEntitiesSignal=Bt([]);_shouldFollowEntitySignal=Bt(!1);get closeEntitiesSignal(){return this._closeEntitiesSignal}get preselectedEntitySignal(){return this._preselectedEntitySignal}get selectedEntitySignal(){return this._selectedEntitySignal}get clickPositionSignal(){return this._clickPositionSignal}get shouldFollowEntitySignal(){return this._shouldFollowEntitySignal}setPause(e){this.nextIsPaused=e}setFilters(e){this.nextFilters=e}setFilterMode(e){this.nextFilterMode=e}setShouldShowComplete(e){this.nextShouldShowComplete=e}setSpeed(e){this.nextSpeed=e}toggleShouldFollowEntity(){this.nextShouldFollowEntity=!this.nextShouldFollowEntity}centerMap(){this.nextShouldFollowEntity=!1,this.nextShouldCenterMap=!0}highlightLeg(e){this.nextHighlightedLegIndex=e}unhighlightLeg(){this.nextHighlightedLegIndex=null}preselectEntity(e,t){this._preselectedEntitySignal.set(at(ye({},e),{shouldShowSelectedEntityTab:t}))}unpreselectEntity(){this._preselectedEntitySignal.set(null)}selectEntity(e){this._preselectedEntitySignal.set(null),this._selectedEntitySignal.set(e)}unselectEntity(){this._selectedEntitySignal.set(null),this.nextHighlightedLegIndex=null}clickHandled(){this.nextClickEvent=null,this.nextShouldFindCloseEntities=!1}updateEnvironment(e){this.nextContinuousEnvironments=e}updateWantedVisualizationTime(e){this.nextWantedVisualizationTime=e}updatePolylines(e){this.nextPolylines=e}clearAnimations(){this.nextContinuousEnvironments=[],this.nextWantedVisualizationTime=null,this.nextPolylines=null,this.nextIsPaused=!1,this.nextSpeed=1,this.nextFilters.clear(),this.nextFilterMode="all",this.nextShouldShowComplete=!1,this.nextShouldCenterMap=!1,this.nextShouldFollowEntity=!1,this.nextClickEvent=null,this.nextHighlightedLegIndex=null,this.continuousEnvironments=[],this.wantedVisualizationTime=null,this.animationVisualizationTime=0,this.polylines=null,this.hasCenteredInitially=!1,this.isPaused=!1,this.speed=1,this.vehicleEntities=[],this.vehicleEntitiesByVehicleId={},this.passengersEntities=[],this.passengerEntitiesByPassengerId={},this.stopEntities=[],this.stopEntitiesByPosition={},this.entitiesContainer.removeChildren(),this.backgroundContainer.removeChildren(),this.selectedEntityPolylines.forEach(e=>e.clear()),this.filters.clear(),this.filterMode="all",this.shouldShowComplete=!1,this.shouldCenterMap=!1,this.nextShouldFindCloseEntities=!1,this.clickEvent=null,this.highlightedLegIndex=null,this._selectedEntitySignal.set(null),this._preselectedEntitySignal.set(null),this._clickPositionSignal.set(null),this._closeEntitiesSignal.set([]),this._shouldFollowEntitySignal.set(!1)}addPixiOverlay(e){e.on("click",a=>{this.onClick(a)});let t=(0,eh.pixiOverlay)((a,o)=>{o.type==="redraw"&&this.onRedraw(a),a.getRenderer().render(this.mainContainer)},this.mainContainer,{doubleBuffering:!0});t.addTo(e);let r=new sn,n=Number.POSITIVE_INFINITY;r.add(a=>{t.redraw({type:"redraw",delta:a});let o=performance.now();this.taskService.processTasks(Math.max(n+this.MIN_TIME_PER_FRAME,o+this.MIN_TASK_ALLOCATION)),n=performance.now()}),r.start()}onRedraw(e){if(!this.fontsLoaded||(this.continuousEnvironments=this.nextContinuousEnvironments,this.wantedVisualizationTime=this.nextWantedVisualizationTime,this.polylines=this.nextPolylines,this.isPaused=this.nextIsPaused,this.speed=this.nextSpeed,this.filters=this.nextFilters,this.filterMode=this.nextFilterMode,this.shouldShowComplete=this.nextShouldShowComplete,this.shouldCenterMap=this.nextShouldCenterMap,this.nextShouldCenterMap=!1,this.clickEvent=this.nextClickEvent,this.highlightedLegIndex=this.nextHighlightedLegIndex,this.shouldFindCloseEntities=this.nextShouldFindCloseEntities,this._shouldFollowEntitySignal.set(this.nextShouldFollowEntity),this.wantedVisualizationTime===null)||this.continuousEnvironments.length===0||this.polylines===null)return;this.updateAnimationTime();let t=cM(this.continuousEnvironments,this.animationVisualizationTime);if(t===null)return;let r=uM(t,this.animationVisualizationTime);this.spritesService.calculateSpriteScales(e),this.resetEntities(),this.createEntities(r,e),this.filterEntities(r);let n=this.updateSelectedEntity(),o=this.updatePreselectedEntity()??n;this.updateEntities(),this.setEntityPositions(e),this.updateCounters(),this.highlightSelectedEntity(o),this.updateTextures(),this.drawSelectedEntityPolylines(o,e),this.setMapPosition(o,e),this.findCloseEntities(e)}updateAnimationTime(){if(this.wantedVisualizationTime===null)return;let e=Math.min(this.wantedVisualizationTime,this.animationVisualizationTime),t=Math.max(this.wantedVisualizationTime,this.animationVisualizationTime);if(!G$(this.continuousEnvironments,e,t)){this.animationVisualizationTime=this.wantedVisualizationTime;return}let r=sn.shared.deltaMS/1e3;this.isPaused?this.animationVisualizationTime=this.wantedVisualizationTime:this.animationVisualizationTime+=r*this.speed;let n=this.wantedVisualizationTime-this.animationVisualizationTime;Math.abs(n)>this.MAXIMUM_ALLOWED_DESYNCHRONIZATION_DIFFERENCE*this.speed&&(this.animationVisualizationTime+=n*(1-Math.exp(-5*Math.abs(r))))}onClick(e){this.nextClickEvent=e,this.nextShouldFindCloseEntities=!0}resetEntities(){for(let e of this.vehicleEntities)e.isPresent=!1,e.isPreselected=!1,e.isSelected=!1,e.isVisible=!1,e.isFiltered=!1,e.entity.error=null,e.additionalInformation.passengerIds=[],e.additionalInformation.numberOfPassengers=0,e.additionalInformation.numberOfNotVisiblePassengers=0,e.additionalInformation.stop=null,e.additionalInformation.polylines=[],e.additionalInformation.polylineIndex=null,e.additionalInformation.polylineSegmentIndex=null,e.additionalInformation.polylineSegmentProgress=null;for(let e of this.passengersEntities)e.isPresent=!1,e.isPreselected=!1,e.isSelected=!1,e.isVisible=!1,e.isFiltered=!1,e.entity.error=null,e.additionalInformation.stop=null,e.additionalInformation.vehicle=null;for(let e of this.stopEntities)e.isPresent=!1,e.isPreselected=!1,e.isSelected=!1,e.isVisible=!1,e.isFiltered=!1,e.entity.error=null,e.additionalInformation.passengerIds=[],e.additionalInformation.numberOfPassengers=0,e.additionalInformation.numberOfCompletePassengers=0,e.additionalInformation.numberOfNotVisiblePassengers=0,e.additionalInformation.numberOfNotVisibleCompletePassengers=0}createEntities(e,t){this.presentVehicleEntities=[],this.presentPassengerEntities=[],this.presentStopEntities=[];for(let r of e.allVehicles){let n=this.vehicleEntitiesByVehicleId[r.id];n===void 0?this.addVehicle(r):(n.entity=r,n.isPresent=!0,this.presentVehicleEntities.push(n))}for(let r of e.allPassengers){let n=this.passengerEntitiesByPassengerId[r.id];n===void 0?this.addPassenger(r):(n.entity=r,n.isPresent=!0,this.presentPassengerEntities.push(n))}for(let r of e.allStops){let n=this.stopEntitiesByPosition[r.id];n===void 0?this.addStop(r,t):(n.entity=r,n.isPresent=!0,this.presentStopEntities.push(n))}}addVehicle(e){let t=new cr,r=new cr,n=new $u;r.addChild(n);let a=new _a;a.anchor.set(.5,.5),t.addChild(a);let o=new _k("",this.BITMAP_TEXT_STYLE);t.addChild(o);let s=new _a;s.anchor.set(.5,.5),t.addChild(s);let l={entity:e,additionalInformation:{passengerIds:[],numberOfPassengers:0,numberOfNotVisiblePassengers:0,stop:null,polylines:[],polylineIndex:null,polylineSegmentIndex:null,polylineSegmentProgress:null},sprites:[a,s],texts:[o],graphics:[n],container:t,backgroundContainer:r,isPresent:!0,isFiltered:!1,isPreselected:!1,isSelected:!1,isVisible:!1};this.entitiesContainer.addChild(t),this.backgroundContainer.addChild(r),this.vehicleEntities.push(l),this.presentVehicleEntities.push(l),this.vehicleEntitiesByVehicleId[e.id]=l}addPassenger(e){let t=new cr,r=new cr,n=new $u;r.addChild(n);let a={entity:e,additionalInformation:{stop:null,vehicle:null},sprites:[],texts:[],graphics:[n],container:t,backgroundContainer:r,isPresent:!0,isFiltered:!1,isPreselected:!1,isSelected:!1,isVisible:!1};this.entitiesContainer.addChild(t),this.backgroundContainer.addChild(r),this.passengersEntities.push(a),this.presentPassengerEntities.push(a),this.passengerEntitiesByPassengerId[e.id]=a}addStop(e,t){let r=new cr,n=new cr,a=new $u;n.addChild(a);let o=new _a;o.anchor.set(.5,.5),r.addChild(o);let s=new _k("",this.BITMAP_TEXT_STYLE);r.addChild(s);let l=new _k("",this.BITMAP_TEXT_STYLE);r.addChild(l);let c=new _a;c.anchor.set(.5,.5),r.addChild(c);let u={entity:e,additionalInformation:{passengerIds:[],numberOfPassengers:0,numberOfCompletePassengers:0,numberOfNotVisiblePassengers:0,numberOfNotVisibleCompletePassengers:0},sprites:[o,c],texts:[s,l],graphics:[a],container:r,backgroundContainer:n,isPresent:!0,isFiltered:!1,isPreselected:!1,isSelected:!1,isVisible:!1},h=t.latLngToLayerPoint([e.position.latitude,e.position.longitude]);r.x=h.x,r.y=h.y,this.entitiesContainer.addChild(r),this.backgroundContainer.addChild(n),this.stopEntities.push(u),this.presentStopEntities.push(u),this.stopEntitiesByPosition[e.id]=u}filterEntities(e){let t=this.filters,r=!t.has("vehicle"),n=!t.has("passenger"),a=!t.has("stops"),o=this.filterMode==="favorites",s=this.shouldShowComplete;for(let l of this.presentVehicleEntities)l.isVisible=e.vehicles[l.entity.id]!==void 0&&r&&!t.has(l.entity.mode??"unknown")&&(!o||this.favoriteEntitiesService.isFavoriteEntity(l.entity))&&(s||l.entity.status!=="complete"),l.isFiltered=!l.isVisible;for(let l of this.presentPassengerEntities)l.isVisible=e.passengers[l.entity.id]!==void 0&&n&&(!o||this.favoriteEntitiesService.isFavoriteEntity(l.entity))&&(s||l.entity.status!=="complete"),l.isFiltered=!l.isVisible;for(let l of this.presentStopEntities)l.isVisible=e.stops[l.entity.id]!==void 0&&a&&(!o||this.favoriteEntitiesService.isFavoriteEntity(l.entity)),l.isFiltered=!l.isVisible}updatePreselectedEntity(){let e=this._preselectedEntitySignal();if(e!==null)switch(e.entityType){case"vehicle":{let t=this.vehicleEntitiesByVehicleId[e.id];if(t&&t.isPresent)return t.isPreselected=!0,t.isVisible=!0,t;this._preselectedEntitySignal.set(null);break}case"passenger":{let t=this.passengerEntitiesByPassengerId[e.id];if(t&&t.isPresent)return t.isPreselected=!0,t.isVisible=!0,t;this._preselectedEntitySignal.set(null);break}case"stop":{let t=this.stopEntitiesByPosition[e.id];if(t&&t.isPresent)return t.isPreselected=!0,t.isVisible=!0,t;this._preselectedEntitySignal.set(null);break}}return null}hadSelectedEntity=!1;updateSelectedEntity(){if(this._preselectedEntitySignal()!==null)return this.hadSelectedEntity=!1,null;let t=this._selectedEntitySignal();if(t===null)return this.hadSelectedEntity=!1,null;switch(t.entityType){case"vehicle":{let r=this.vehicleEntitiesByVehicleId[t.id];if(r&&r.isPresent)return r.isSelected=!0,r.isVisible=!0,this.hadSelectedEntity||(this.hadSelectedEntity=!0),r;this._selectedEntitySignal.set(null);break}case"passenger":{let r=this.passengerEntitiesByPassengerId[t.id];if(r&&r.isPresent)return r.isSelected=!0,r.isVisible=!0,this.hadSelectedEntity||(this.hadSelectedEntity=!0),r;this._selectedEntitySignal.set(null);break}case"stop":{let r=this.stopEntitiesByPosition[t.id];if(r&&r.isPresent)return r.isSelected=!0,r.isVisible=!0,this.hadSelectedEntity||(this.hadSelectedEntity=!0),r;this._selectedEntitySignal.set(null);break}}return null}updateEntities(){this.updateOnPassengerLegs(),this.updateOnVehicleStops()}updateOnPassengerLegs(){for(let e of this.presentPassengerEntities){let t=e.entity.currentLeg??e.entity.nextLegs[0]??e.entity.previousLegs[e.entity.previousLegs.length-1]??null;if(t===null){e.isVisible=!1,e.entity.error="No leg";continue}if(t.boardingTime===null||t.boardingTime>this.animationVisualizationTime){if(t.boardingStopId===null){e.isVisible=!1,e.entity.error="No boarding stop";continue}let n=this.stopEntitiesByPosition[t.boardingStopId];if(n===void 0){e.isVisible=!1,e.entity.error="Boarding stop not found";continue}if(!n.isPresent){e.isVisible=!1,e.entity.error="Boarding stop not present";continue}if(!e.isVisible){e.entity.status==="complete"?n.additionalInformation.numberOfNotVisibleCompletePassengers+=e.entity.numberOfPassengers:n.additionalInformation.numberOfNotVisiblePassengers+=e.entity.numberOfPassengers;continue}n.isVisible=!0,n.additionalInformation.passengerIds.push(e.entity.id),e.entity.status==="complete"?n.additionalInformation.numberOfCompletePassengers+=e.entity.numberOfPassengers:n.additionalInformation.numberOfPassengers+=e.entity.numberOfPassengers,e.additionalInformation.stop=n;continue}if(t.alightingTime===null||t.alightingTime>this.animationVisualizationTime){if(t.assignedVehicleId===null){e.isVisible=!1,e.entity.error="No vehicle";continue}let n=this.vehicleEntitiesByVehicleId[t.assignedVehicleId];if(n===void 0){e.isVisible=!1,e.entity.error="Vehicle not found";continue}if(!n.isPresent){e.isVisible=!1,e.entity.error="Vehicle not present";continue}if(!e.isVisible){n.additionalInformation.numberOfNotVisiblePassengers+=e.entity.numberOfPassengers;continue}n.isVisible=!0,n.additionalInformation.passengerIds.push(e.entity.id),n.additionalInformation.numberOfPassengers+=e.entity.numberOfPassengers,e.additionalInformation.vehicle=n;continue}if(t.alightingStopId===null){e.isVisible=!1,e.entity.error="No alighting stop";continue}let r=this.stopEntitiesByPosition[t.alightingStopId];if(r===void 0){e.isVisible=!1,e.entity.error="Alighting stop not found";continue}if(!r.isPresent){e.isVisible=!1,e.entity.error="Alighting stop not present";continue}if(!e.isVisible){e.entity.status==="complete"?r.additionalInformation.numberOfNotVisibleCompletePassengers+=e.entity.numberOfPassengers:r.additionalInformation.numberOfNotVisiblePassengers+=e.entity.numberOfPassengers;continue}r.isVisible=!0,r.additionalInformation.passengerIds.push(e.entity.id),e.entity.status==="complete"?r.additionalInformation.numberOfCompletePassengers+=e.entity.numberOfPassengers:r.additionalInformation.numberOfPassengers+=e.entity.numberOfPassengers,e.additionalInformation.stop=r}}updateOnVehicleStops(){for(let e of this.presentVehicleEntities){let t=Bl(e.entity);for(let r=0;r<t.length-1;r++){let n=t[r],a=t[r+1],o=n.id+","+a.id,s=this.polylines.polylinesByCoordinates[o];e.additionalInformation.polylines.push(s)}if(e.entity.currentStop!==null){let r=this.stopEntitiesByPosition[e.entity.currentStop.id];if(r===void 0){e.isVisible=!1,e.entity.error="Current stop not found";continue}if(!r.isPresent){e.isVisible=!1,e.entity.error="Current stop not present";continue}e.additionalInformation.stop=r,e.additionalInformation.polylineIndex=e.entity.previousStops.length-1;let n=e.additionalInformation.polylines[e.additionalInformation.polylineIndex];n!==void 0?(e.additionalInformation.polylineSegmentIndex=n.coefficients.length-1,e.additionalInformation.polylineSegmentProgress=1):(e.additionalInformation.polylineSegmentIndex=0,e.additionalInformation.polylineSegmentProgress=0)}else{if(e.entity.previousStops.length===0){e.isVisible=!1,e.entity.error="No previous stops";continue}let r=e.entity.previousStops[e.entity.previousStops.length-1],n=this.stopEntitiesByPosition[r.id];if(n===null){e.isVisible=!1,e.entity.error="Previous stop not found";continue}if(!n.isPresent){e.isVisible=!1,e.entity.error="Previous stop not present";continue}if(e.entity.nextStops.length===0){e.isVisible=!1,e.entity.error="No next stops";continue}let a=e.entity.nextStops[0],o=this.stopEntitiesByPosition[a.id];if(o===null){e.isVisible=!1,e.entity.error="Next stop not found";continue}if(!o.isPresent){e.isVisible=!1,e.entity.error="Next stop not present";continue}if(r.departureTime===null){e.isVisible=!1,e.entity.error="No departure time";continue}let s=r.departureTime,l=a.arrivalTime,c=(this.animationVisualizationTime-s)/(l-s);if(c<0||c>1){e.isVisible=!1,e.entity.error="Progress out of bounds";continue}e.additionalInformation.polylineIndex=e.entity.previousStops.length-1;let[u,h]=this.getSegmentIndexAndProgress(e.additionalInformation.polylines[e.additionalInformation.polylineIndex],c);e.additionalInformation.polylineSegmentIndex=u,e.additionalInformation.polylineSegmentProgress=h}}}setEntityPositions(e){this.setVehiclePositions(e),this.setPassengerPositions()}setVehiclePositions(e){for(let t of this.presentVehicleEntities)if(t.additionalInformation.stop!==null)t.container.x=t.additionalInformation.stop.container.x,t.container.y=t.additionalInformation.stop.container.y;else{let r=t.additionalInformation;if(r.polylineIndex===null){t.container.visible=!1,t.entity.error="No polyline index";continue}if(r.polylineSegmentIndex===null){t.container.visible=!1,t.entity.error="No polyline segment index";continue}if(r.polylineSegmentProgress===null){t.container.visible=!1,t.entity.error="No polyline segment progress";continue}let n=r.polylineIndex,a=r.polylines[n];if(a===void 0){t.container.visible=!1,t.entity.error="Polyline not found";continue}let o=a.polyline[r.polylineSegmentIndex],s=a.polyline[r.polylineSegmentIndex+1];if(o===void 0||s===void 0){t.container.visible=!1,t.entity.error="Segment not found";continue}let l=e.latLngToLayerPoint([o.latitude,o.longitude]),c=e.latLngToLayerPoint([s.latitude,s.longitude]),u=l.multiplyBy(1-r.polylineSegmentProgress).add(c.multiplyBy(r.polylineSegmentProgress));t.container.x=u.x,t.container.y=u.y;let h=c.subtract(l),d=-Math.atan2(h.x,h.y)+Math.PI/2;t.sprites[0].rotation=d}}setPassengerPositions(){for(let e of this.presentPassengerEntities)e.additionalInformation.stop!==null?(e.container.x=e.additionalInformation.stop.container.x,e.container.y=e.additionalInformation.stop.container.y):e.additionalInformation.vehicle!==null?(e.container.x=e.additionalInformation.vehicle.container.x,e.container.y=e.additionalInformation.vehicle.container.y):(e.container.visible=!1,e.entity.error="No stop or vehicle")}updateCounters(){this.updateVehicleCounters(),this.updateStopCounters()}updateVehicleCounters(){let e=Hf(this.spritesService.currentColorPreset);for(let t=0;t<this.presentVehicleEntities.length;++t){let r=this.vehicleEntities[t],n=r.additionalInformation.numberOfPassengers,a=r.additionalInformation.numberOfNotVisiblePassengers,o=n+a;if(n===0){r.texts[0].text="",r.texts[0].tint=16777215,r.sprites[0].tint=16777215,r.sprites[1].tint=16777215;continue}else a===0?r.texts[0].text=n.toString():r.texts[0].text=`${n} (${o})`;let s=Math.min(1,(a+n)/r.entity.capacity),l=sc(e(s))?.rgb();if(l){let c=256*(l.r*256+l.g)+l.b;r.texts[0].tint=c,r.sprites[0].tint=c,r.sprites[1].tint=c}else console.warn("Color interpolation failed")}}updateStopCounters(){for(let e of this.presentStopEntities){let t=e.additionalInformation.numberOfPassengers,r=e.additionalInformation.numberOfCompletePassengers,n=e.additionalInformation.numberOfNotVisiblePassengers,a=e.additionalInformation.numberOfNotVisibleCompletePassengers,o=t+n,s=r+a;if(t===0?e.texts[0].text="":n===0?e.texts[0].text=t.toString():e.texts[0].text=`${t} (${o})`,r===0?e.texts[1].text="":a===0?e.texts[1].text=r.toString():e.texts[1].text=`${r} (${s})`,t===0&&r===0){e.texts[0].tint=16777215,e.texts[1].tint=16777215,e.sprites[0].tint=16777215,e.sprites[1].tint=16777215;continue}let l=Hf(this.spritesService.currentColorPreset),c=Math.min(1,(n+t)/e.entity.capacity),u=sc(l(c))?.rgb();if(u){let h=256*(u.r*256+u.g)+u.b;e.texts[0].tint=h,e.texts[1].tint=h,e.sprites[0].tint=h,e.sprites[1].tint=h}else console.warn("Color interpolation failed")}}highlightSelectedEntity(e){for(let t of this.presentVehicleEntities)t.container.filters=[];for(let t of this.presentPassengerEntities)t.container.filters=[];for(let t of this.presentStopEntities)t.container.filters=[];e!==null&&(e.container.filters=[new Hl(1,16777215),new Hl(2,16776960)],S5(e)&&(e.additionalInformation.vehicle!==null&&(e.additionalInformation.vehicle.container.filters=[new Hl(1,16777215),new Hl(2,16776960)]),e.additionalInformation.stop!==null&&(e.additionalInformation.stop.container.filters=[new Hl(1,16777215),new Hl(2,16776960)])))}updateTextures(){let e=!this.spritesService.useZoomedOutSprites;this.vehicleEntities.forEach(t=>{t.container.visible=t.isVisible,t.container.scale.set(this.spritesService.vehicleSpriteScale),this.synchronizeBackgroundWithEntity(t),t.isVisible&&(t.texts[0].visible=e,t.texts[0].x=t.sprites[0].width/2,t.texts[0].y=-t.sprites[0].height/2,this.spritesService.drawVehicleBackgroundShape(t.graphics[0],t.entity.mode,t.entity.tags),t.sprites[0].texture=this.spritesService.getVehicleTexture(t.entity.mode,t.entity.tags),t.sprites[1].texture=this.spritesService.getPassengerTexture(t.additionalInformation.passengerIds.map(r=>this.passengerEntitiesByPassengerId[r].entity.tags).flat()),t.sprites[1].visible=t.additionalInformation.passengerIds.length>0,t.sprites[1].scale.set(this.spritesService.passengerSpriteScale/this.spritesService.vehicleSpriteScale))}),this.passengersEntities.forEach(t=>{t.container.visible=t.isVisible,t.container.scale.set(this.spritesService.passengerSpriteScale),this.synchronizeBackgroundWithEntity(t),t.isVisible&&this.spritesService.drawPassengerBackgroundShape(t.graphics[0],t.entity.tags)}),this.stopEntities.forEach(t=>{t.container.visible=t.isVisible,t.container.scale.set(this.spritesService.passengerSpriteScale),this.synchronizeBackgroundWithEntity(t),t.isVisible&&(t.sprites[0].texture=this.spritesService.getStopTexture(t.entity.tags),t.sprites[0].scale.set(this.spritesService.stopSpriteScale/this.spritesService.passengerSpriteScale),this.spritesService.drawStopBackgroundShape(t.graphics[0],t.entity.tags),t.sprites[1].texture=this.spritesService.getPassengerTexture(t.additionalInformation.passengerIds.map(r=>this.passengerEntitiesByPassengerId[r].entity.tags).flat()),t.sprites[1].visible=t.additionalInformation.passengerIds.length>0,t.texts[0].visible=e,t.texts[0].x=t.sprites[1].width/2,t.texts[0].y=-t.sprites[1].height/2,t.texts[1].visible=e,t.texts[1].x=t.sprites[1].width/2,t.texts[1].y=t.sprites[1].height/2)})}synchronizeBackgroundWithEntity(e){e.backgroundContainer.visible=e.container.visible,e.backgroundContainer.x=e.container.x,e.backgroundContainer.y=e.container.y,e.backgroundContainer.scale.x=e.container.scale.x,e.backgroundContainer.scale.y=e.container.scale.y}drawSelectedEntityPolylines(e,t){this.selectedEntityPolylines.forEach(r=>r.clear()),e!==null&&(S5(e)?this.drawPassengerPolylines(e,t):$de(e)&&this.drawVehiclePolylines(e,t))}drawVehiclePolylines(e,t){let r=e.additionalInformation.polylineIndex;if(r===null){e.entity.error="No polyline index for vehicle "+e.entity.id+" while drawing polylines",e.isVisible=!1;return}let n=e.additionalInformation.polylineSegmentIndex;if(n===null){e.entity.error="No polyline segment index for vehicle "+e.entity.id+" while drawing polylines",e.isVisible=!1;return}let a=e.additionalInformation.polylineSegmentProgress;if(a===null){e.entity.error="No polyline segment progress for vehicle "+e.entity.id+" while drawing polylines",e.isVisible=!1;return}this.selectedEntityPolylines.length===0&&this.addPolylineGraphics();let o=e.additionalInformation.polylines;this.drawPolylines(r,n,a,o,this.selectedEntityPolylines[0],t)}drawPassengerPolylines(e,t){let r=td(e.entity);for(;this.selectedEntityPolylines.length<r.length;)this.addPolylineGraphics();for(let n=0;n<r.length;++n){let a=r[n];if(a.assignedVehicleId===null||a.boardingStopIndex===null||a.alightingStopIndex===null)continue;let o=this.vehicleEntitiesByVehicleId[a.assignedVehicleId];if(o===void 0){e.isVisible=!1,e.entity.error="Vehicle not found for passenger "+e.entity.id;continue}let s=o.additionalInformation.polylines.slice(a.boardingStopIndex,a.alightingStopIndex),l=this.selectedEntityPolylines[n];if(l==null)return;n===this.highlightedLegIndex?l.filters=[new Hl(1,16777215),new Hl(2,16776960)]:l.filters=[];let u=null,h=null,d=null;switch(a.legType){case"previous":u=s.length-1,s[u]!==void 0?(h=s[u].coefficients.length-1,d=1):(h=0,d=0);break;case"current":if(o.additionalInformation.polylineIndex===null||o.additionalInformation.polylineSegmentIndex===null||o.additionalInformation.polylineSegmentProgress===null){e.entity.error="No polyline index or segment index or progress for passenger",e.isVisible=!1;return}u=o.additionalInformation.polylineIndex-a.boardingStopIndex,h=o.additionalInformation.polylineSegmentIndex,d=o.additionalInformation.polylineSegmentProgress;break;case"next":u=0,h=0,d=0;break}if(u===null||h===null||d===null){e.entity.error="Invalid polyline index or segment index or progress for passenger",e.isVisible=!1;return}this.drawPolylines(u,h,d,s,l,t)}}drawPolylines(e,t,r,n,a,o){if(a.clear(),n.length===0)return;let s=Math.max(this.POLYLINE_WIDTH/o.getScale(),this.POLYLINE_MIN_WIDTH);a.lineStyle(s,this.POLYLINE_COMPLETE_COLOR,this.POLYLINE_ALPHA);for(let c=0;c<n.length;++c){let u=n[c];if(u.polyline.length===0){console.warn(`Polyline at index ${c} is empty.`);continue}c>e&&a.lineStyle(s,this.POLYLINE_REMAINING_COLOR,this.POLYLINE_ALPHA);let h=o.latLngToLayerPoint([u.polyline[0].latitude,u.polyline[0].longitude]);a.moveTo(h.x,h.y);for(let d=1;d<u.polyline.length;++d)if(c===e&&d===t+1){let p=o.latLngToLayerPoint([u.polyline[d].latitude,u.polyline[d].longitude]).multiplyBy(r).add(o.latLngToLayerPoint([u.polyline[d-1].latitude,u.polyline[d-1].longitude]).multiplyBy(1-r));a.lineTo(p.x,p.y),a.lineStyle(s,this.POLYLINE_REMAINING_COLOR,this.POLYLINE_ALPHA),a.moveTo(p.x,p.y),a.lineTo(p.x,p.y)}else{(c>e||c===e&&d>t)&&a.lineStyle(s,this.POLYLINE_REMAINING_COLOR,this.POLYLINE_ALPHA);let p=o.latLngToLayerPoint([u.polyline[d].latitude,u.polyline[d].longitude]);a.lineTo(p.x,p.y)}}a.lineStyle(s,this.POLYLINE_COMPLETE_COLOR,this.POLYLINE_ALPHA);for(let c=0;c<n.length;++c){let u=n[c];if(u.polyline.length===0){console.warn(`Polyline at index ${c} is empty.`);continue}(c>e||c===e&&t===0&&r===0)&&a.lineStyle(s,this.POLYLINE_REMAINING_COLOR,this.POLYLINE_ALPHA);let h=o.latLngToLayerPoint([u.polyline[0].latitude,u.polyline[0].longitude]);a.beginFill(this.WHITE,1),a.drawCircle(h.x,h.y,s*1.2),a.endFill()}e<n.length?a.lineStyle(s,this.POLYLINE_REMAINING_COLOR,this.POLYLINE_ALPHA):a.lineStyle(s,this.POLYLINE_COMPLETE_COLOR,this.POLYLINE_ALPHA);let l=n[n.length-1];if(l.polyline.length>0){let c=o.latLngToLayerPoint([l.polyline[l.polyline.length-1].latitude,l.polyline[l.polyline.length-1].longitude]);a.beginFill(this.WHITE,1),a.drawCircle(c.x,c.y,s*1.2),a.endFill()}else console.warn("Last polyline is empty, not drawing last stop.")}getSegmentIndexAndProgress(e,t){let r=0,n=null,a=null;for(let o=0;o<e.coefficients.length;++o){let s=e.coefficients[o];if(r+s>=t){n=o,a=(t-r)/s;break}r+=s}return n===null||a===null?[e.coefficients.length-1,1]:[n,a]}addPolylineGraphics(){let e=new $u;this.selectedEntityPolylines.push(e),this.polylinesContainer.addChild(e)}setMapPosition(e,t){if(this._shouldFollowEntitySignal()&&e!==null&&e.isVisible){t.getMap().setView(t.layerPointToLatLng(new eh.Point(e.container.x,e.container.y)));return}if(this.shouldCenterMap||!this.hasCenteredInitially){this.shouldCenterMap=!1;let r=this.presentVehicleEntities.filter(T=>T.isVisible),n=r.map(T=>T.container.y),a=r.map(T=>T.container.x),o=this.presentPassengerEntities.filter(T=>T.isVisible),s=o.map(T=>T.container.y),l=o.map(T=>T.container.x),c=this.presentStopEntities.filter(T=>T.isVisible),u=c.map(T=>T.container.y),h=c.map(T=>T.container.x),d=n.concat(s,u),p=a.concat(l,h);if(d.length==0||p.length==0)return;let f=Math.min(...d),g=Math.max(...d),_=Math.min(...p),b=Math.max(...p),S=.1,v=b-_,k=g-f,M=t.layerPointToLatLng(new eh.Point(_-S*v,f-S*k)),D=t.layerPointToLatLng(new eh.Point(b+S*v,g+S*k));t.getMap().flyToBounds(new eh.LatLngBounds(M,D)),this.hasCenteredInitially=!0}}findCloseEntities(e){if(!this.shouldFindCloseEntities)return;if(this.nextShouldFindCloseEntities=!1,!this.clickEvent){console.warn("No click event to find close entities. Make sure to call findCloseEntities after a click event.");return}let t=e.latLngToLayerPoint(this.clickEvent.latlng),r=20/e.getScale(),n=[],a=[];for(let s of this.presentVehicleEntities){if(!s.isVisible)continue;this.distanceBetweenPoints(t,s.container.position)<=r&&n.push(s.entity)}for(let s of this.presentStopEntities){if(!s.isVisible)continue;this.distanceBetweenPoints(t,s.container.position)<=r&&a.push(s.entity)}let o=[...n,...a];o.length===0?(this.unselectEntity(),this._closeEntitiesSignal.set([])):o.length===1?(this.selectEntity(o[0]),this._closeEntitiesSignal.set([])):(this.unselectEntity(),this._clickPositionSignal.set(new eh.Point(this.clickEvent.containerPoint.x,this.clickEvent.containerPoint.y)),this._closeEntitiesSignal.set(o))}distanceBetweenPoints(e,t){let r=e.x-t.x,n=e.y-t.y;return Math.sqrt(r*r+n*n)}static \u0275fac=function(t){return new(t||i)(Zt(xd),Zt(Zg),Zt(nd))};static \u0275prov=lt({token:i,factory:i.\u0275fac,providedIn:"root"})};var Ln=class i{constructor(e,t,r){this.injector=e;this.simulationService=t;this.animationService=r;Ji(()=>{let n=this._wantedVisualizationTimeSignal();this.wantedVisualizationTime=n}),Ji(()=>{let n=this.environmentSignal();this.environmentSlice=n}),Ji(()=>{if(this.simulationService.hasAllStatesSignal()){this._isLoadingSignal.set(!1);return}let a=this.simulationService.activeSimulationSignal();if(a===null){this._isLoadingSignal.set(!0);return}let o=this._wantedVisualizationTimeSignal();if(o===null){this._isLoadingSignal.set(!0);return}if(!this.simulationService.isFetchingStatesSignal()){let u=this.simulationService.continuousEnvironmentsSignal().filter(h=>h.isComplete).map(h=>h.startUpdateIndex);this.simulationService.getMissingSimulationStates(a.id,o,u)}let l=this.environmentSignal();this._isLoadingSignal.set(l===null)}),Ji(()=>{let n=this.simulationService.activeSimulationSignal();if(n===null)return;let a=this.simulationService.simulationPolylinesSignal(),o=this.simulationService.isFetchingPolylinesSignal();(a===null||a.version!==n.polylinesVersion)&&!o&&this.simulationService.getPolylines(n.id)}),this.initializeAutoSave(),this.initializeAutoLoad(),Ji(()=>{let n=this.simulationService.continuousEnvironmentsSignal();this.animationService.updateEnvironment(n)}),Ji(()=>{let n=this._wantedVisualizationTimeSignal();this.animationService.updateWantedVisualizationTime(n)}),Ji(()=>{let n=this.simulationService.simulationPolylinesSignal(),a=this.simulationService.activeSimulationSignal();(n===null||a===null||n.version!==a.polylinesVersion)&&this.animationService.updatePolylines(null),this.animationService.updatePolylines(n)})}speed=1;tick=-1;tickSignal=Bt(0);updateTickTimeout=null;lastUpdateTickTime=performance.now();ENVIRONMENT_TICK_INTERVAL=1e3;environmentTickSignal=Bt(0);updateEnvironmentTickTimeout=null;_simulationStartTimeSignal=Bt(null);_simulationEndTimeSignal=Bt(null);_visualizationMaxTimeSignal=Bt(null);_isVisualizationPausedSignal=Bt(!1);visualizationTimeOverride=null;visualizationTimeOverrideSignal=Bt(null);wantedVisualizationTime=null;_wantedVisualizationTimeSignal=$t(()=>this.computeWantedVisualizationTime());environmentSlice=null;environmentSignal=$t(()=>this.sliceEnvironment());hasEnvironmentChanged=!1;controlledWantedVisualizationTimeSignal=$t(()=>(this.hasEnvironmentChanged=!0,this._wantedVisualizationTimeSignal()));controlledContinuousEnvironmentsSignal=$t(()=>(this.hasEnvironmentChanged=!0,this.simulationService.continuousEnvironmentsSignal()));_isLoadingSignal=Bt(!0);initializeAutoSave(){window.addEventListener("beforeunload",()=>{this.saveLocalStorageData()})}saveLocalStorageData(){let e=this._wantedVisualizationTimeSignal(),t=this._isVisualizationPausedSignal();e!==null&&localStorage.setItem("wantedVisualizationTime",e.toString()),localStorage.setItem("isVisualizationPaused",JSON.stringify(t))}initializeAutoLoad(){window.addEventListener("load",()=>{this.loadWantedVisualizationTime()})}loadWantedVisualizationTime(){let e=localStorage.getItem("wantedVisualizationTime"),t=localStorage.getItem("isVisualizationPaused");if(e){let r=parseFloat(e);isNaN(r)||(this.wantedVisualizationTime=r,this.visualizationTimeOverrideSignal.set(r))}if(t!==null){let r=JSON.parse(t);this._isVisualizationPausedSignal.set(r)}}clearLocalStorage(){localStorage.removeItem("wantedVisualizationTime"),localStorage.removeItem("isVisualizationPaused")}init(e){if(this._simulationStartTimeSignal.set(e.simulationStartTime??null),this._simulationEndTimeSignal.set(e.simulationEndTime??e.simulationEstimatedEndTime??null),this._visualizationMaxTimeSignal.set((Bu.includes(e.status)?e.simulationTime??e.simulationStartTime:e.simulationEndTime)??null),!this.isInitializedSignal()){this._simulationStartTimeSignal.set(null),this._simulationEndTimeSignal.set(null),this._visualizationMaxTimeSignal.set(null);return}this.updateTickTimeout===null&&this.updateTick(),this.updateEnvironmentTickTimeout===null&&this.updateEnvironmentTick()}destroy(){this.isInitializedSignal()&&(this._simulationStartTimeSignal.set(null),this._simulationEndTimeSignal.set(null),this._visualizationMaxTimeSignal.set(null),this.clearLocalStorage(),this.updateTickTimeout!==null&&(clearTimeout(this.updateTickTimeout),this.updateTickTimeout=null),this.updateEnvironmentTickTimeout!==null&&(clearTimeout(this.updateEnvironmentTickTimeout),this.updateEnvironmentTickTimeout=null))}get isInitializedSignal(){return $t(()=>this._simulationStartTimeSignal()!==null&&this._simulationEndTimeSignal()!==null&&this._visualizationMaxTimeSignal()!==null)}get simulationStartTimeSignal(){return this._simulationStartTimeSignal}get simulationEndTimeSignal(){return this._simulationEndTimeSignal}get visualizationMaxTimeSignal(){return this._visualizationMaxTimeSignal}get isVisualizationPausedSignal(){return this._isVisualizationPausedSignal}get wantedVisualizationTimeSignal(){return this._wantedVisualizationTimeSignal}get isLoadingSignal(){return this._isLoadingSignal}pauseVisualization(){this._isVisualizationPausedSignal.set(!0)}resumeVisualization(){this._isVisualizationPausedSignal.set(!1)}setVisualizationTime(e){this.visualizationTimeOverrideSignal.set(e)}setVisualizationSpeed(e){this.speed=e}updateTick(){yo(this.injector,()=>{this.tickSignal.update(e=>e+1)}),this.updateTickTimeout=setTimeout(()=>{this.updateTick()},250)}updateEnvironmentTick(){yo(this.injector,()=>{this.environmentTickSignal.update(e=>e+1)}),this.updateEnvironmentTickTimeout=setTimeout(()=>{this.updateEnvironmentTick()},this.ENVIRONMENT_TICK_INTERVAL)}computeWantedVisualizationTime(){let e=this.simulationStartTimeSignal(),t=this.visualizationMaxTimeSignal();if(e===null||t===null)return null;let r=this._isLoadingSignal(),n=this.tickSignal(),a=this.visualizationTimeOverrideSignal(),o=this.isVisualizationPausedSignal(),s=performance.now(),l=this.lastUpdateTickTime;return this.lastUpdateTickTime=s,this.wantedVisualizationTime===null?e:a!==this.visualizationTimeOverride&&a!==null?(this.visualizationTimeOverride=a,Math.max(Math.min(t,a),e)):r?this.wantedVisualizationTime:n===this.tick?this.wantedVisualizationTime:(this.tick=n,o?this.wantedVisualizationTime:Math.min(t,Math.max(this.wantedVisualizationTime+(s-l)/1e3*this.speed,e)))}sliceEnvironment(){this.environmentTickSignal();let e=Aa(this.controlledWantedVisualizationTimeSignal);if(e===null)return null;let t=Aa(this.controlledContinuousEnvironmentsSignal),r=cM(t,e);if(r===null)return null;if(!this.hasEnvironmentChanged)return this.environmentSlice;let n=uM(r,e);return this.hasEnvironmentChanged=!1,n}static \u0275fac=function(t){return new(t||i)(Zt(Ii),Zt(Ha),Zt(Mr))};static \u0275prov=lt({token:i,factory:i.\u0275fac})};var Cd=class i{constructor(e,t){this.visualizationService=e;this.animationService=t;Ji(()=>{this.effectUpdateVehicleModeFilters()}),Ji(()=>{this.effectOnFilterChanged()})}_filters=Bt(new Set(["stops"]));_vehicleModes=Bt([]);get filters(){return this._filters}get vehicleModes(){return this._vehicleModes}effectOnFilterChanged(){this.animationService.setFilters(this._filters())}effectUpdateVehicleModeFilters(){let e=this.visualizationService.environmentSignal(),t=Aa(this._vehicleModes);if(e===null)return;let n=[...Object.values(e.vehicles).map(a=>a.mode??"unknown"),...t].filter((a,o,s)=>s.indexOf(a)===o);n.sort(),this._vehicleModes.set(n)}toggleFilter(e){let t=this._filters();t.has(e)?t.delete(e):t.add(e),this._filters.set(new Set(t))}static \u0275fac=function(t){return new(t||i)(Zt(Ln),Zt(Mr))};static \u0275prov=lt({token:i,factory:i.\u0275fac})};var Bje=()=>[];function Rje(i,e){if(i&1&&(Z(0,"span",0),ce(1),Q()),i&2){Se();let t=fi(1);oe(),Ti(t.join(", "))}}var rl=class i{nameInputSignal=sl.required({alias:"name"});tagsInputSignal=sl.required({alias:"tags"});static \u0275fac=function(t){return new(t||i)};static \u0275cmp=tt({type:i,selectors:[["app-entity-name"]],inputs:{nameInputSignal:[1,"name","nameInputSignal"],tagsInputSignal:[1,"tags","tagsInputSignal"]},decls:5,vars:4,consts:[[1,"tags"]],template:function(t,r){if(t&1&&(Ri(0)(1),Z(2,"span"),ce(3),je(4,Rje,2,1,"span",0),Q()),t&2){let n,a,o=(n=r.nameInputSignal())!==null&&n!==void 0?n:"Unknown entity";oe();let s=hr((a=r.tagsInputSignal())!==null&&a!==void 0?a:J4(3,Bje));oe(2),_t("",o," "),oe(),Je(s.length>0?4:-1)}},styles:[".tags[_ngcontent-%COMP%]{font-weight:lighter;font-style:italic;padding-inline-end:.5rem}"]})};var Dje=(i,e)=>e.id;function Lje(i,e){i&1&&ce(0," directions_car ")}function Ije(i,e){i&1&&ce(0," accessibility ")}function Fje(i,e){i&1&&ce(0," place ")}function Oje(i,e){if(i&1){let t=vt();Z(0,"mat-chip",5),Le("click",function(){let n=Ee(t).$implicit,a=Se();return Ae(a.selectEntity(n))})("mouseenter",function(){let n=Ee(t).$implicit,a=Se();return Ae(a.preselectEntity(n))})("mouseleave",function(){Ee(t);let n=Se();return Ae(n.unpreselectEntity())}),Z(1,"mat-icon",6),je(2,Lje,1,0)(3,Ije,1,0)(4,Fje,1,0),Q(),Ge(5,"app-entity-name",7),Q()}if(i&2){let t,r=e.$implicit;oe(2),Je((t=r.entityType)==="vehicle"?2:t==="passenger"?3:t==="stop"?4:-1),oe(3),Re("name",r.name)("tags",r.tags)}}function zje(i,e){if(i&1){let t=vt();Z(0,"button",8),Le("click",function(){Ee(t);let n=Se();return Ae(n.clearHistory())}),ce(1," Clear "),Q()}}function Hje(i,e){i&1&&(Z(0,"p"),ce(1,"Your history is empty."),Q())}var oA=class i{constructor(e,t){this.visualizationService=e;this.animationService=t;Ji(()=>{this.effectOnEntitySelected()})}history=Bt([]);_ignoreNextSelect=!1;clearHistory(){this.history.set([])}unpreselectEntity(){this.animationService.unpreselectEntity()}preselectEntity(e){this.animationService.preselectEntity(e,!0)}selectEntity(e){this._ignoreNextSelect=!0,this.animationService.selectEntity(e)}effectOnEntitySelected(){let e=this.animationService.selectedEntitySignal();if(e!==null){if(this._ignoreNextSelect){this._ignoreNextSelect=!1;return}this.addHistory(e)}}addHistory(e){this.history.update(t=>{let r=t.findIndex(n=>n.id===e.id&&n.entityType===e.entityType);return r!==-1&&t.splice(r,1),[e,...t]})}static \u0275fac=function(t){return new(t||i)(rt(Ln),rt(Mr))};static \u0275cmp=tt({type:i,selectors:[["app-click-history"]],decls:10,vars:1,consts:[["appearance","outlined"],[1,"title"],[1,"container"],[1,"content"],["mat-button","",1,"clear-btn"],[3,"click","mouseenter","mouseleave"],["matChipAvatar",""],[3,"name","tags"],["mat-button","",1,"clear-btn",3,"click"]],template:function(t,r){t&1&&(Z(0,"mat-card",0)(1,"mat-card-content")(2,"p",1),ce(3,"History"),Q(),Z(4,"div",2)(5,"div",3),ui(6,Oje,6,3,"mat-chip",null,Dje),Q()(),je(8,zje,2,0,"button",4)(9,Hje,2,0,"p"),Q()()),t&2&&(oe(6),hi(r.history()),oe(2),Je(r.history().length>0?8:9))},dependencies:[Br,pn,ia,ea,ta,qn,da,Rf,pr,mr,Rn,rl],styles:["p[_ngcontent-%COMP%]{margin:0}.title[_ngcontent-%COMP%]{font:var(--mat-sys-body-medium);margin-top:0;margin-bottom:10px}.container[_ngcontent-%COMP%]{width:100%;max-height:400px;overflow-x:hidden;overflow-y:auto;padding-bottom:10px;display:flex;flex-direction:column;gap:20px;padding-right:5px}.content[_ngcontent-%COMP%]{width:100%;display:flex;flex-direction:column;gap:5px;max-width:200px;margin-right:10px}mat-chip-option[_ngcontent-%COMP%]{max-width:50px}[_nghost-%COMP%] .mat-mdc-standard-chip .mdc-evolution-chip__cell--primary, [_nghost-%COMP%] .mat-mdc-standard-chip .mdc-evolution-chip__action--primary, [_nghost-%COMP%] .mat-mdc-standard-chip .mat-mdc-chip-action-label{overflow:hidden}.clear-btn[_ngcontent-%COMP%]{width:100%}.disabled[_ngcontent-%COMP%]{pointer-events:none;opacity:.4}.disabled[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{pointer-events:all}"]})};var Qde=(i,e)=>e.status,eme=(i,e)=>e.id;function Nje(i,e){if(i&1){let t=vt();Z(0,"div",3),Le("click",function(){let n=Ee(t).$implicit,a=Se(2);return Ae(a.selectEntity(n))})("mouseenter",function(){let n=Ee(t).$implicit,a=Se(2);return Ae(a.preselectEntity(n))})("mouseleave",function(){Ee(t);let n=Se(2);return Ae(n.unpreselectEntity())})("keydown.enter",function(){let n=Ee(t).$implicit,a=Se(2);return Ae(a.selectEntity(n))}),Ge(1,"app-entity-name",4),Q()}if(i&2){let t=e.$implicit;Re("matTooltip","Select passenger")("matTooltipPosition","after"),oe(),Re("name",t.name)("tags",t.tags)}}function Gje(i,e){if(i&1&&(Z(0,"mat-expansion-panel")(1,"mat-expansion-panel-header")(2,"mat-panel-title"),ce(3),Q()(),Z(4,"div",1),ui(5,Nje,2,4,"div",2,eme),Q()()),i&2){let t=e.$implicit;oe(3),R_(" ",t.status," (",t.count,") "),oe(2),hi(t.passengers)}}function Vje(i,e){if(i&1){let t=vt();Z(0,"div",3),Le("click",function(){let n=Ee(t).$implicit,a=Se(2);return Ae(a.selectEntity(n))})("mouseenter",function(){let n=Ee(t).$implicit,a=Se(2);return Ae(a.preselectEntity(n))})("mouseleave",function(){Ee(t);let n=Se(2);return Ae(n.unpreselectEntity())})("keydown.enter",function(){let n=Ee(t).$implicit,a=Se(2);return Ae(a.selectEntity(n))}),Ge(1,"app-entity-name",4),Q()}if(i&2){let t=e.$implicit;Re("matTooltip","Select vehicle")("matTooltipPosition","after"),oe(),Re("name",t.name)("tags",t.tags)}}function Kje(i,e){if(i&1&&(Z(0,"mat-expansion-panel")(1,"mat-expansion-panel-header")(2,"mat-panel-title"),ce(3),Q()(),Z(4,"div",1),ui(5,Vje,2,4,"div",2,eme),Q()()),i&2){let t=e.$implicit;oe(3),R_(" ",t.status," (",t.count,") "),oe(2),hi(t.vehicles)}}var sA=class i{constructor(e,t){this.animationService=e;this.visualizationService=t}getPassengers=$t(()=>{let e=this.visualizationService.environmentSignal();return e===null?[]:Object.values(e.passengers)});numberOfPassengersByStatusSignal=$t(()=>{let e=this.visualizationService.environmentSignal();if(e===null)return[];let t=Object.values(e.passengers);t.sort((n,a)=>a.nextLegs.length+a.previousLegs.length+(a.currentLeg!=null?1:0)-(n.nextLegs.length+n.previousLegs.length+(n.currentLeg!=null?1:0)));let r={};for(let n of t){let a=n.status;r[a]=r[a]??[],r[a].push(n)}return Object.entries(r).map(([n,a])=>({status:n,count:a.length,passengers:a}))});getVehicles=$t(()=>{let e=this.visualizationService.environmentSignal();return e===null?[]:Object.values(e.vehicles)});numberOfVehiclesByStatusSignal=$t(()=>{let e=this.visualizationService.environmentSignal();if(e===null)return[];let t=Object.values(e.vehicles),r={};for(let n of t){let a=n.status;r[a]=r[a]??[],r[a].push(n)}return Object.entries(r).map(([n,a])=>({status:n,count:a.length,vehicles:a}))});preselectEntity(e){this.animationService.preselectEntity(e,!1)}unpreselectEntity(){this.animationService.unpreselectEntity()}selectEntity(e){this.animationService.selectEntity(e)}static \u0275fac=function(t){return new(t||i)(rt(Mr),rt(Ln))};static \u0275cmp=tt({type:i,selectors:[["app-entities-tab"]],decls:21,vars:2,consts:[["multi","true"],[1,"flex-column","gap-0-5-rem"],["tabindex","0",1,"clickable","indent",3,"matTooltip","matTooltipPosition"],["tabindex","0",1,"clickable","indent",3,"click","mouseenter","mouseleave","keydown.enter","matTooltip","matTooltipPosition"],[3,"name","tags"]],template:function(t,r){if(t&1&&(Z(0,"mat-accordion",0)(1,"mat-expansion-panel"),Ri(2)(3),Z(4,"mat-expansion-panel-header")(5,"mat-panel-title"),ce(6),Q()(),Z(7,"div",1)(8,"mat-accordion",0),ui(9,Gje,7,2,"mat-expansion-panel",null,Qde),Q()()(),Z(11,"mat-expansion-panel"),Ri(12)(13),Z(14,"mat-expansion-panel-header")(15,"mat-panel-title"),ce(16),Q()(),Z(17,"div",1)(18,"mat-accordion",0),ui(19,Kje,7,2,"mat-expansion-panel",null,Qde),Q()()()()),t&2){let n=r.getPassengers(),a=r.numberOfPassengersByStatusSignal();oe(6),_t(" Passengers (",n.length,") "),oe(3),hi(a);let o=r.getVehicles(),s=r.numberOfVehiclesByStatusSignal();oe(7),_t(" Vehicles (",o.length,") "),oe(3),hi(s)}},dependencies:[kc,ry,qm,Zm,iy,Rn,Da,rl],styles:[".clickable[_ngcontent-%COMP%]{cursor:pointer;padding:.5rem 0;border-radius:.5rem}.clickable[_ngcontent-%COMP%]:hover{background-color:#1a1b1f14} .mat-expansion-panel-body{padding:0 5px 5px!important}.indent[_ngcontent-%COMP%]{padding-left:24px}"]})};var Wje=(i,e)=>e.id;function Uje(i,e){i&1&&ce(0," directions_car ")}function jje(i,e){i&1&&ce(0," accessibility ")}function qje(i,e){i&1&&ce(0," place ")}function Zje(i,e){if(i&1){let t=vt();Z(0,"mat-chip",5),Le("removed",function(){let n=Ee(t).$implicit,a=Se();return Ae(a.toggleFavoriteEntity(n))})("click",function(){let n=Ee(t).$implicit,a=Se();return Ae(a.selectEntity(n))})("mouseenter",function(){let n=Ee(t).$implicit,a=Se();return Ae(a.preselectEntity(n))})("mouseleave",function(){Ee(t);let n=Se();return Ae(n.unpreselectEntity())}),Z(1,"mat-icon",6),je(2,Uje,1,0)(3,jje,1,0)(4,qje,1,0),Q(),Ge(5,"app-entity-name",7),Z(6,"button",8)(7,"mat-icon"),ce(8,"favorite"),Q()()()}if(i&2){let t,r=e.$implicit,n=Se();gt("disabled",!n.isEntityInEnvironment(r)),oe(2),Je((t=r.entityType)==="vehicle"?2:t==="passenger"?3:t==="stop"?4:-1),oe(3),Re("name",r.name)("tags",r.tags)}}function Yje(i,e){i&1&&(Z(0,"p"),ce(1,"You have no favorites in this simulation."),Q())}var lA=class i{constructor(e,t,r){this.favoriteEntitiesService=e;this.visualizationService=t;this.animationService=r}get favoriteEntitiesSignal(){return this.favoriteEntitiesService.favoriteEntitiesSignal}unpreselectEntity(){this.animationService.unpreselectEntity()}preselectEntity(e){this.animationService.preselectEntity(e,!0)}selectEntity(e){this.animationService.selectEntity(e)}toggleFavoriteEntity(e){this.favoriteEntitiesService.toggleFavoriteEntity(e)}isEntityInEnvironment(e){let t=this.visualizationService.environmentSignal();if(!t)return!1;switch(e.entityType){case"vehicle":return t.vehicles[e.id]!==void 0;case"passenger":return t.passengers[e.id]!==void 0;case"stop":return t.stops[e.id]!==void 0;default:return!1}}static \u0275fac=function(t){return new(t||i)(rt(xd),rt(Ln),rt(Mr))};static \u0275cmp=tt({type:i,selectors:[["app-favorite-entities"]],decls:10,vars:1,consts:[["appearance","outlined"],[1,"title"],[1,"container"],[1,"content"],[3,"disabled"],[3,"removed","click","mouseenter","mouseleave"],["matChipAvatar",""],[3,"name","tags"],["matChipRemove","",1,"remove-btn"]],template:function(t,r){if(t&1&&(Z(0,"mat-card",0)(1,"mat-card-content"),Ri(2),Z(3,"p",1),ce(4,"Favorites"),Q(),Z(5,"div",2)(6,"div",3),ui(7,Zje,9,5,"mat-chip",4,Wje),Q(),je(9,Yje,2,0,"p"),Q()()()),t&2){let n=r.favoriteEntitiesSignal();oe(7),hi(n),oe(2),Je(n.length===0?9:-1)}},dependencies:[ia,ea,ta,qn,da,Rf,Df,pr,mr,Rn,rl],styles:["p[_ngcontent-%COMP%]{margin:0}.title[_ngcontent-%COMP%]{font:var(--mat-sys-body-medium);margin-top:0;margin-bottom:10px}.container[_ngcontent-%COMP%]{width:100%;max-height:400px;overflow-x:hidden;overflow-y:auto;padding-bottom:10px;display:flex;flex-direction:column;gap:20px}.content[_ngcontent-%COMP%]{width:100%;display:flex;flex-direction:column;gap:5px;max-width:200px;margin-right:10px}mat-chip-option[_ngcontent-%COMP%]{max-width:50px}[_nghost-%COMP%] .mat-mdc-standard-chip .mdc-evolution-chip__cell--primary, [_nghost-%COMP%] .mat-mdc-standard-chip .mdc-evolution-chip__action--primary, [_nghost-%COMP%] .mat-mdc-standard-chip .mat-mdc-chip-action-label{overflow:hidden}.remove-btn[_ngcontent-%COMP%]{opacity:.3}.remove-btn[_ngcontent-%COMP%]:hover{opacity:1}.disabled[_ngcontent-%COMP%]{pointer-events:none;opacity:.4}.disabled[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{pointer-events:all}"]})};var tme=go(ny());var u_=class i{KEY_ADDED_TILES="multimodal.added-tiles";KEY_SELECTED_TILE_INDEX="multimodal.selected-tile-index";noWrap=!0;minZoom=8;maxZoom=18;map=null;_selectedMapTile;_mapTiles=Bt([]);get selectedMapTile(){return this._selectedMapTile}get mapTiles(){return this._mapTiles}constructor(){this.loadMapTilesData(),Ji(()=>{this.effectSaveMapTiles()}),Ji(()=>{this.effectUpdateIndex()})}selectMapTile(e){if(this.map==null)return;let t=this._selectedMapTile();t!==void 0&&t!==e&&this.map.removeLayer(t.tile),this._selectedMapTile.set(e),e.tile.addTo(this.map)}addMapTile(e,t,r){this._mapTiles.update(n=>{let a=this.createMapTile(e,t,r,!0);return[...n,a]})}removeMapTile(e){this._mapTiles.update(t=>t.filter(r=>r!==e))}getDefaultTilesData(){return[this.createMapTile("OpenStreetMap Standard","https://tile.openstreetmap.org/{z}/{x}/{y}.png",'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',!1),this.createMapTile("Stadia Alidade Smooth Light","https://tiles.stadiamaps.com/tiles/alidade_smooth/{z}/{x}/{y}.png",'© <a href="https://stadiamaps.com/" target="_blank">\xA9 Stadia Maps</a> <a href="https://openmaptiles.org/" target="_blank" rel="nofollow noopener noreferrer">\xA9 OpenMapTiles</a> <a href="https://www.openstreetmap.org/copyright" target="_blank">\xA9 OpenStreetMap</a>',!0),this.createMapTile("Stadia Alidade Smooth Dark","https://tiles.stadiamaps.com/tiles/alidade_smooth_dark/{z}/{x}/{y}.png",'© <a href="https://stadiamaps.com/" target="_blank">\xA9 Stadia Maps</a> <a href="https://openmaptiles.org/" target="_blank" rel="nofollow noopener noreferrer">\xA9 OpenMapTiles</a> <a href="https://www.openstreetmap.org/copyright" target="_blank">\xA9 OpenStreetMap</a>',!0)]}loadMapTilesData(){let e=this.loadSavedMapTiles();e.length===0&&(e=this.getDefaultTilesData());let t=parseInt(localStorage.getItem(this.KEY_SELECTED_TILE_INDEX));!isNaN(t)&&t<e.length?this._selectedMapTile=Bt(e[t]):this._selectedMapTile=Bt(e[0]),this._mapTiles.set(e)}loadSavedMapTiles(){let e=localStorage.getItem(this.KEY_ADDED_TILES);if(e==null)return[];let t=JSON.parse(e),r=[];for(let n of t)r.push(this.createMapTile(n.name,n.url,n.attribution,n.custom));return r}effectSaveMapTiles(){let t=this._mapTiles().map(r=>({name:r.name,url:r.url,attribution:r.attribution,custom:r.custom}));localStorage.setItem(this.KEY_ADDED_TILES,JSON.stringify(t))}effectUpdateIndex(){let e=this._selectedMapTile();if(e==null)return;let t=this.mapTiles(),r=t.findIndex(n=>n===e);if(r===-1){this.selectMapTile(t[0]);return}localStorage.setItem(this.KEY_SELECTED_TILE_INDEX,r.toString())}createTileLayer(e,t){return(0,tme.tileLayer)(e,{noWrap:this.noWrap,minZoom:this.minZoom,maxZoom:this.maxZoom,attribution:t??void 0})}createMapTile(e,t,r,n){return{name:e,url:t,attribution:r,tile:this.createTileLayer(t,r),custom:n}}static \u0275fac=function(t){return new(t||i)};static \u0275prov=lt({token:i,factory:i.\u0275fac,providedIn:"root"})};function Jje(i,e){i&1&&(Z(0,"button",7)(1,"mat-icon"),ce(2,"cancel"),Q()())}function $je(i,e){if(i&1){let t=vt();Z(0,"mat-chip-option",6),Le("removed",function(){let n=Ee(t).$implicit,a=Se();return Ae(a.removeMapTile(n))})("click",function(){let n=Ee(t).$implicit,a=Se();return Ae(a.setMapTile(n))}),ce(1),je(2,Jje,3,0,"button",7),Q()}if(i&2){let t=e.$implicit,r=Se();Re("selected",r.selectedMapTile()===t)("selectable",r.selectedMapTile()!==t),oe(),_t(" ",t.name," "),oe(),Je(t.custom?2:-1)}}var cA=class i{constructor(e,t){this.mapService=e;this.dialogService=t;this.mapTiles=e.mapTiles,this.selectedMapTile=e.selectedMapTile}mapTiles;selectedMapTile;setMapTile(e){this.mapService.selectMapTile(e)}removeMapTile(e){this.mapService.removeMapTile(e)}addMapTile(){return Ce(this,null,function*(){let e=yield hn(this.dialogService.openAddMapTileDialog().afterClosed());e&&this.mapService.addMapTile(e.name,e.url,e.attribution)})}editMapIcons(){return Ce(this,null,function*(){yield hn(this.dialogService.openEditMapIconsDialog().afterClosed())})}static \u0275fac=function(t){return new(t||i)(rt(u_),rt(Js))};static \u0275cmp=tt({type:i,selectors:[["app-map-tiles"]],decls:12,vars:0,consts:[["appearance","outlined"],[1,"title"],["aria-label","Map Layers",1,"chip-list"],[3,"selected","selectable"],[1,"btn-container"],["mat-button","",3,"click"],[3,"removed","click","selected","selectable"],["matChipRemove","","aria-label","'remove template form' + keyword"]],template:function(t,r){t&1&&(Z(0,"mat-card",0)(1,"mat-card-content")(2,"p",1),ce(3,"Map Tile Providers"),Q(),Z(4,"mat-chip-listbox",2),ui(5,$je,3,4,"mat-chip-option",3,Ea),Q(),Z(7,"div",4)(8,"button",5),Le("click",function(){return r.addMapTile()}),ce(9,"Add Map Tile"),Q(),Z(10,"button",5),Le("click",function(){return r.editMapIcons()}),ce(11,"Customize entities"),Q()()()()),t&2&&(oe(5),hi(r.mapTiles()))},dependencies:[ia,ea,ta,Br,pn,pr,mr,So,kc,qn,jR,zb,Df],styles:[".title[_ngcontent-%COMP%]{font:var(--mat-sys-body-medium);margin-top:0;margin-bottom:10px}.chip-list[_ngcontent-%COMP%]{max-width:100%;width:250px;margin-bottom:10px}.chip-list[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{max-width:100%;overflow:hidden}.mat-mdc-chip-set[_ngcontent-%COMP%] .mdc-evolution-chip[_ngcontent-%COMP%]{width:100%}[_nghost-%COMP%] .mat-mdc-standard-chip .mdc-evolution-chip__cell--primary, [_nghost-%COMP%] .mat-mdc-standard-chip .mdc-evolution-chip__action--primary, [_nghost-%COMP%] .mat-mdc-standard-chip .mat-mdc-chip-action-label{overflow:hidden}.btn-container[_ngcontent-%COMP%]{display:flex;flex-direction:row;justify-content:center}"]})};function Xje(i,e){if(i&1&&(Z(0,"mat-expansion-panel")(1,"mat-expansion-panel-header")(2,"mat-panel-title"),ce(3),Q()(),Z(4,"div",2),Ge(5,"app-recursive-statistics",3),Q()()),i&2){let t=Se().$implicit,r=Se();oe(3),_t(" ",r.capitalize(t)," "),oe(2),Re("recursiveDict",r.recursiveDict[t])}}function Qje(i,e){if(i&1&&(Z(0,"div",1)(1,"span",4),ce(2),Z(3,"span",5),ce(4),Q()()()),i&2){let t=Se().$implicit,r=Se();oe(2),_t(" ",r.capitalize(t),": "),oe(2),_t(" ",r.formatEntry(r.recursiveDict[t])," ")}}function e7e(i,e){if(i&1&&je(0,Xje,6,2,"mat-expansion-panel")(1,Qje,5,2,"div",1),i&2){let t=e.$implicit,r=Se();Je(r.isStatistics(r.recursiveDict[t])?0:1)}}var uA=class i{recursiveDict;constructor(){this.recursiveDict={}}capitalize(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}keys(){for(let e of Object.keys(this.recursiveDict))this.recursiveDict[e]instanceof Array&&delete this.recursiveDict[e];return Object.keys(this.recursiveDict).sort((e,t)=>{let r=typeof this.recursiveDict[e]=="object",n=typeof this.recursiveDict[t]=="object";return r&&!n?1:!r&&n?-1:0})}formatEntry(e){return typeof e=="number"?new Intl.NumberFormat("en-US",{minimumFractionDigits:0,maximumFractionDigits:2,useGrouping:!0}).format(e).replace(/,/g," "):typeof e=="string"?this.capitalize(e):""}isStatistics(e){return typeof e=="object"}isGeneric(e){return typeof e=="string"||typeof e=="number"}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=tt({type:i,selectors:[["app-recursive-statistics"]],inputs:{recursiveDict:"recursiveDict"},decls:3,vars:0,consts:[["multi","true"],[1,"flex-column","gap-0-5-rem","indent"],[1,"flex-column","gap-0-5-rem"],[3,"recursiveDict"],[2,"white-space","normal"],[2,"white-space","nowrap"]],template:function(t,r){t&1&&(Z(0,"mat-accordion",0),ui(1,e7e,2,1,null,null,Ea),Q()),t&2&&(oe(),hi(r.keys()))},dependencies:[i,kc,ry,qm,Zm,iy],styles:[".mat-expansion-panel-body{padding:0 5px 5px!important}.indent[_ngcontent-%COMP%]{padding-left:24px}"]})};var hA=(i,e)=>e.label;function t7e(i,e){i&1&&Ge(0,"span",5)}function i7e(i,e){if(i&1&&(Ge(0,"span",4),je(1,t7e,1,0,"span",5)),i&2){let t=e.$index,r=Se();oe(),Je(r.previousStops.length-1!==t?1:-1)}}function r7e(i,e){i&1&&Ge(0,"span",5)}function n7e(i,e){if(i&1&&(je(0,r7e,1,0,"span",5),Ge(1,"span",4)),i&2){let t=Se();Je(t.previousStops.length>0?0:-1)}}function a7e(i,e){i&1&&Ge(0,"span",6)}function o7e(i,e){if(i&1&&(je(0,a7e,1,0,"span",6),Ge(1,"span",7)),i&2){let t=e.$index,r=Se();Je(t!==0||r.previousStops.length>0||r.currentStop!==null?0:-1)}}function s7e(i,e){if(i&1){let t=vt();Z(0,"span",8),Le("click",function(){let n=Ee(t).$implicit,a=Se();return Ae(a.selectStop(n))})("keydown.enter",function(){let n=Ee(t).$implicit,a=Se();return Ae(a.selectStop(n))})("mouseenter",function(){let n=Ee(t).$implicit,a=Se();return Ae(a.preselectStop(n))})("mouseleave",function(){Ee(t);let n=Se();return Ae(n.unpreselectStop())}),ce(1),Q()}if(i&2){let t=e.$implicit;Re("matTooltip","Select stop")("matTooltipPosition","after"),oe(),Ti(t.label)}}function l7e(i,e){if(i&1){let t=vt();Z(0,"span",8),Le("click",function(){Ee(t);let n=Se();return Ae(n.selectStop(n.currentStop))})("keydown.enter",function(){Ee(t);let n=Se();return Ae(n.selectStop(n.currentStop))})("mouseenter",function(){Ee(t);let n=Se();return Ae(n.preselectStop(n.currentStop))})("mouseleave",function(){Ee(t);let n=Se();return Ae(n.unpreselectStop())}),ce(1),Q()}if(i&2){let t=Se();Re("matTooltip","Select stop")("matTooltipPosition","after"),oe(),Ti(t.currentStop.label)}}function c7e(i,e){if(i&1){let t=vt();Z(0,"span",8),Le("click",function(){let n=Ee(t).$implicit,a=Se();return Ae(a.selectStop(n))})("keydown.enter",function(){let n=Ee(t).$implicit,a=Se();return Ae(a.selectStop(n))})("mouseenter",function(){let n=Ee(t).$implicit,a=Se();return Ae(a.preselectStop(n))})("mouseleave",function(){Ee(t);let n=Se();return Ae(n.unpreselectStop())}),ce(1),Q()}if(i&2){let t=e.$implicit;Re("matTooltip","Select stop")("matTooltipPosition","after"),oe(),Ti(t.label)}}var dA=class i{constructor(e){this.animationService=e;this.previousStops=[],this.currentStop=null,this.nextStops=[]}previousStops;currentStop;nextStops;unpreselectStop(){this.animationService.unpreselectEntity()}preselectStop(e){this.animationService.preselectEntity(e,!1)}selectStop(e){this.animationService.selectEntity(e)}static \u0275fac=function(t){return new(t||i)(rt(Mr))};static \u0275cmp=tt({type:i,selectors:[["app-selected-entity-route"]],inputs:{previousStops:"previousStops",currentStop:"currentStop",nextStops:"nextStops"},decls:13,vars:2,consts:[[1,"flex-row"],[1,"flex-column","center",2,"padding","5px 0px"],[1,"flex-column","space-between"],["tabindex","0",1,"clickable-no-padding",3,"matTooltip","matTooltipPosition"],[1,"dot","route-done"],[1,"line","route-done"],[1,"line","route-left"],[1,"dot","route-left"],["tabindex","0",1,"clickable-no-padding",3,"click","keydown.enter","mouseenter","mouseleave","matTooltip","matTooltipPosition"]],template:function(t,r){t&1&&(Z(0,"div",0)(1,"div",1),ui(2,i7e,2,1,null,null,hA),je(4,n7e,2,1),ui(5,o7e,2,1,null,null,hA),Q(),Z(7,"div",2),ui(8,s7e,2,3,"span",3,hA),je(10,l7e,2,3,"span",3),ui(11,c7e,2,3,"span",3,hA),Q()()),t&2&&(oe(2),hi(r.previousStops),oe(2),Je(r.currentStop!==null?4:-1),oe(),hi(r.nextStops),oe(3),hi(r.previousStops),oe(2),Je(r.currentStop!==null?10:-1),oe(),hi(r.nextStops))},dependencies:[Rn,Da],styles:[".dot[_ngcontent-%COMP%]{height:1rem;width:1rem;border-radius:50%;display:inline-block}.line[_ngcontent-%COMP%]{height:.75rem;width:2px;display:inline-block}.flex-row[_ngcontent-%COMP%]{display:flex;flex-direction:row;height:100%;gap:5px;justify-content:start;align-items:center}.flex-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.center[_ngcontent-%COMP%]{justify-content:center;align-items:center}.space-between[_ngcontent-%COMP%]{justify-content:space-between;align-self:stretch}.route-done[_ngcontent-%COMP%]{background-color:#666}.route-left[_ngcontent-%COMP%]{background-color:#028a0f}.clickable-no-padding[_ngcontent-%COMP%]{cursor:pointer;border-radius:.5rem}.clickable-no-padding[_ngcontent-%COMP%]:hover{background-color:#1a1b1f14}"]})};var pA=(i,e)=>e.id;function u7e(i,e){if(i&1){let t=vt();Z(0,"mat-card")(1,"mat-card-content",7),Le("click",function(){Ee(t);let n=Se(2);return Ae(n.selectEntity(n.selectedPassengerStop))})("keydown.enter",function(){Ee(t);let n=Se(2);return Ae(n.selectEntity(n.selectedPassengerStop))})("mouseenter",function(){Ee(t);let n=Se(2);return Ae(n.preselectEntity(n.selectedPassengerStop))})("mouseleave",function(){Ee(t);let n=Se(2);return Ae(n.unpreselectEntity())}),Z(2,"b"),ce(3,"Stop: "),Q(),Ge(4,"app-entity-name",8),Q()()}if(i&2){let t=Se(2);oe(),Re("matTooltip","Select stop")("matTooltipPosition","after"),oe(3),Re("name",t.selectedPassengerStop.name)("tags",t.selectedPassengerStop.tags)}}function h7e(i,e){if(i&1){let t=vt();Z(0,"mat-card")(1,"mat-card-content",7),Le("click",function(){Ee(t);let n=Se(2);return Ae(n.selectEntity(n.selectedPassengerVehicle))})("keydown.enter",function(){Ee(t);let n=Se(2);return Ae(n.selectEntity(n.selectedPassengerVehicle))})("mouseenter",function(){Ee(t);let n=Se(2);return Ae(n.preselectEntity(n.selectedPassengerVehicle))})("mouseleave",function(){Ee(t);let n=Se(2);return Ae(n.unpreselectEntity())}),Z(2,"b"),ce(3,"Vehicle: "),Q(),Ge(4,"app-entity-name",8),Q()()}if(i&2){let t=Se(2);oe(),Re("matTooltip","Select vehicle")("matTooltipPosition","after"),oe(3),Re("name",t.selectedPassengerVehicle.name)("tags",t.selectedPassengerVehicle.tags)}}function d7e(i,e){if(i&1&&(Z(0,"mat-card")(1,"mat-card-content",9)(2,"b"),ce(3,"Error:"),Q(),ce(4),Q()()),i&2){let t=Se(2);oe(4),_t(" ",t.selectedPassenger.error," ")}}function m7e(i,e){if(i&1){let t=vt();Ri(0),Z(1,"div",14),Le("click",function(){Ee(t);let n=fi(0),a=Se(3);return Ae(a.selectEntity(n))})("keydown.enter",function(){Ee(t);let n=fi(0),a=Se(3);return Ae(a.selectEntity(n))}),ce(2),Q()}if(i&2){let t=Se().$implicit;Se(2);let r=fi(0),n=hr(r.vehicles[t.assignedVehicleId]);oe(),Re("matTooltip","Select vehicle")("matTooltipPosition","after"),oe(),_t(" Vehicle: ",n.name," ")}}function p7e(i,e){if(i&1&&(Z(0,"b"),ce(1),Q()),i&2){let t=Se().$implicit;oe(),Ti(t.assignedVehicleId)}}function f7e(i,e){if(i&1){let t=vt();Z(0,"div",10),Le("mouseenter",function(){let n=Ee(t).$index,a=Se(2);return Ae(a.highlightLeg(n))})("mouseleave",function(){Ee(t);let n=Se(2);return Ae(n.unhighlightLeg())}),Z(1,"div",11),je(2,m7e,3,4,"div",12)(3,p7e,2,1,"b"),Q(),Ge(4,"app-selected-entity-route",13),Q()}if(i&2){let t=e.$implicit,r=Se(2),n=fi(0);oe(2),Je(n!==null&&t.assignedVehicleId!==null?2:3),oe(2),Re("previousStops",r.selectedPassengerLegPreviousStops)("currentStop",r.selectedPassengerLegCurrentStop)("nextStops",r.selectedPassengerLegNextStops)}}function g7e(i,e){if(i&1){let t=vt();Ri(0),Z(1,"mat-card-title",1),ce(2,"Selected Passenger "),Z(3,"button",2),Le("click",function(){Ee(t);let n=Se();return Ae(n.toggleFavoriteEntity(n.selectedPassenger))}),Z(4,"mat-icon"),ce(5),Q()()(),Z(6,"div",3)(7,"div",4)(8,"mat-card")(9,"mat-card-content",5,0),Le("click",function(){Ee(t);let n=Se();return Ae(n.copyToClipboard(n.selectedPassenger.id))})("keydown.enter",function(){Ee(t);let n=Se();return Ae(n.copyToClipboard(n.selectedPassenger.id))}),Z(11,"b"),ce(12,"Id:"),Q(),ce(13),Q()(),Z(14,"mat-card")(15,"mat-card-content",5),Le("click",function(){Ee(t);let n=Se();return Ae(n.copyToClipboard(n.selectedPassenger.name))})("keydown.enter",function(){Ee(t);let n=Se();return Ae(n.copyToClipboard(n.selectedPassenger.name))}),Z(16,"b"),ce(17,"Name:"),Q(),ce(18),Q()(),Z(19,"mat-card")(20,"mat-card-content")(21,"b"),ce(22,"Status:"),Q(),ce(23),Q()(),Z(24,"mat-card")(25,"mat-card-content")(26,"b"),ce(27,"Number of passenger:"),Q(),ce(28),Q()(),Z(29,"mat-card")(30,"mat-card-content")(31,"b"),ce(32,"Tags:"),Q(),ce(33),Q()(),je(34,u7e,5,4,"mat-card")(35,h7e,5,4,"mat-card")(36,d7e,5,1,"mat-card"),Q(),Z(37,"mat-accordion")(38,"mat-expansion-panel")(39,"mat-expansion-panel-header")(40,"mat-panel-title"),ce(41,"Passenger route"),Q()(),Z(42,"div",6),ui(43,f7e,5,4,"div",3,_o),Q()()()()}if(i&2){let t=Se(),r=t.isFavoriteEntity(t.selectedPassenger);oe(3),Re("matTooltip",r?"Remove from favorite":"Add to favorite")("matTooltipPosition","after"),oe(2),Ti(r?"favorite":"favorite_outline"),oe(4),Re("matTooltip","Click to copy")("matTooltipPosition","after"),oe(4),_t(" ",t.truncateId(t.selectedPassenger.id)," "),oe(2),Re("matTooltip","Click to copy")("matTooltipPosition","after"),oe(3),_t(" ",t.selectedPassenger.name," "),oe(5),_t(" ",t.selectedPassenger.status," "),oe(5),_t(" ",t.selectedPassenger.numberOfPassengers," "),oe(5),_t(" ",t.selectedPassenger.tags.length>0?t.selectedPassenger.tags.join(", "):"None"," "),oe(),Je(t.selectedPassengerStop!==null?34:-1),oe(),Je(t.selectedPassengerVehicle!==null?35:-1),oe(),Je(t.selectedPassenger.error!==null?36:-1),oe(7),hi(t.selectedPassengerLegs)}}function y7e(i,e){if(i&1){let t=vt();Z(0,"mat-card")(1,"mat-card-content",5),Le("click",function(){Ee(t);let n=Se(2);return Ae(n.copyToClipboard(n.selectedVehicle.mode))})("keydown.enter",function(){Ee(t);let n=Se(2);return Ae(n.copyToClipboard(n.selectedVehicle.mode))}),Z(2,"b"),ce(3,"Mode:"),Q(),ce(4),Q()()}if(i&2){let t=Se(2);oe(),Re("matTooltip","Click to copy")("matTooltipPosition","after"),oe(3),_t(" ",t.selectedVehicle.mode," ")}}function _7e(i,e){if(i&1){let t=vt();Z(0,"mat-card")(1,"mat-card-content",5),Le("click",function(){Ee(t);let n=Se(2);return Ae(n.selectEntity(n.selectedVehicleStop))})("keydown.enter",function(){Ee(t);let n=Se(2);return Ae(n.selectEntity(n.selectedVehicleStop))}),Z(2,"b"),ce(3,"Stop:"),Q(),Ge(4,"app-entity-name",8),Q()()}if(i&2){let t=Se(2);oe(),Re("matTooltip","Select stop")("matTooltipPosition","after"),oe(3),Re("name",t.selectedVehicleStop.name)("tags",t.selectedVehicleStop.tags)}}function b7e(i,e){if(i&1&&(Z(0,"mat-card")(1,"mat-card-content",15)(2,"b"),ce(3,"Error:"),Q(),ce(4),Q()()),i&2){let t=Se(2);oe(4),_t(" ",t.selectedVehicle.error," ")}}function v7e(i,e){if(i&1){let t=vt();Z(0,"div",17),Le("click",function(){let n=Ee(t).$implicit,a=Se(3);return Ae(a.selectEntity(n))})("keydown.enter",function(){let n=Ee(t).$implicit,a=Se(3);return Ae(a.selectEntity(n))})("mouseenter",function(){let n=Ee(t).$implicit,a=Se(3);return Ae(a.preselectEntity(n))})("mouseleave",function(){Ee(t);let n=Se(3);return Ae(n.unpreselectEntity())}),Ge(1,"app-entity-name",8),Q()}if(i&2){let t=e.$implicit;Re("matTooltip","Select passenger")("matTooltipPosition","after"),oe(),Re("name",t.name)("tags",t.tags)}}function S7e(i,e){if(i&1&&(Z(0,"mat-accordion")(1,"mat-expansion-panel")(2,"mat-expansion-panel-header")(3,"mat-panel-title"),ce(4),Q()(),Z(5,"div",3),ui(6,v7e,2,4,"div",16,pA),Q()()()),i&2){let t=Se(2);oe(4),_t(" Passengers on board (",t.selectedVehiclePassengers.length,")"),oe(2),hi(t.selectedVehiclePassengers)}}function k7e(i,e){if(i&1){let t=vt();Ri(0),Z(1,"mat-card-title",1),ce(2,"Selected Vehicle "),Z(3,"button",2),Le("click",function(){Ee(t);let n=Se();return Ae(n.toggleFavoriteEntity(n.selectedVehicle))}),Z(4,"mat-icon"),ce(5),Q()()(),Z(6,"div",3)(7,"div",4)(8,"mat-card")(9,"mat-card-content",5),Le("click",function(){Ee(t);let n=Se();return Ae(n.copyToClipboard(n.selectedVehicle.id))})("keydown.enter",function(){Ee(t);let n=Se();return Ae(n.copyToClipboard(n.selectedVehicle.id))}),Z(10,"b"),ce(11,"Id:"),Q(),ce(12),Q()(),Z(13,"mat-card")(14,"mat-card-content",5),Le("click",function(){Ee(t);let n=Se();return Ae(n.copyToClipboard(n.selectedVehicle.name))})("keydown.enter",function(){Ee(t);let n=Se();return Ae(n.copyToClipboard(n.selectedVehicle.name))}),Z(15,"b"),ce(16,"Name:"),Q(),ce(17),Q()(),je(18,y7e,5,3,"mat-card"),Z(19,"mat-card")(20,"mat-card-content")(21,"b"),ce(22,"Status:"),Q(),ce(23),Q()(),Z(24,"mat-card")(25,"mat-card-content")(26,"b"),ce(27,"Capacity:"),Q(),ce(28),Q()(),Z(29,"mat-card")(30,"mat-card-content")(31,"b"),ce(32,"Tags:"),Q(),ce(33),Q()(),Z(34,"mat-card")(35,"mat-card-content")(36,"b"),ce(37,"Passenger Tags:"),Q(),ce(38),Q()(),je(39,_7e,5,4,"mat-card")(40,b7e,5,1,"mat-card"),Q(),je(41,S7e,8,1,"mat-accordion"),Z(42,"mat-accordion")(43,"mat-expansion-panel")(44,"mat-expansion-panel-header")(45,"mat-panel-title"),ce(46,"Vehicle route"),Q()(),Z(47,"div",3),Ge(48,"app-selected-entity-route",13),Q()()()()}if(i&2){let t=Se(),r=t.isFavoriteEntity(t.selectedVehicle);oe(3),Re("matTooltip",r?"Remove from favorite":"Add to favorite")("matTooltipPosition","after"),oe(2),Ti(r?"favorite":"favorite_outline"),oe(4),Re("matTooltip","Click to copy")("matTooltipPosition","after"),oe(3),_t(" ",t.truncateId(t.selectedVehicle.id)," "),oe(2),Re("matTooltip","Click to copy")("matTooltipPosition","after"),oe(3),_t(" ",t.selectedVehicle.name," "),oe(),Je(t.selectedVehicle.mode!==null?18:-1),oe(5),_t(" ",t.selectedVehicle.status," "),oe(5),_t(" ",t.selectedVehicle.capacity," "),oe(5),_t(" ",t.selectedVehicle.tags.length>0?t.selectedVehicle.tags.join(", "):"None"," "),oe(5),_t(" ",t.selectedVehiclePassengerTags.length>0?t.selectedVehiclePassengerTags.join(", "):"None"," "),oe(),Je(t.selectedVehicleStop!==null?39:-1),oe(),Je(t.selectedVehicle.error!==null?40:-1),oe(),Je(t.selectedVehiclePassengers.length>0?41:-1),oe(7),Re("previousStops",t.selectedVehicle.previousStops)("currentStop",t.selectedVehicle.currentStop)("nextStops",t.selectedVehicle.nextStops)}}function x7e(i,e){if(i&1&&(Z(0,"mat-card")(1,"mat-card-content",18)(2,"b"),ce(3,"Error:"),Q(),ce(4),Q()()),i&2){let t=Se(2);oe(4),_t(" ",t.selectedStop.error," ")}}function w7e(i,e){if(i&1){let t=vt();Z(0,"div",17),Le("click",function(){let n=Ee(t).$implicit,a=Se(3);return Ae(a.selectEntity(n))})("keydown.enter",function(){let n=Ee(t).$implicit,a=Se(3);return Ae(a.selectEntity(n))})("mouseenter",function(){let n=Ee(t).$implicit,a=Se(3);return Ae(a.preselectEntity(n))})("mouseleave",function(){Ee(t);let n=Se(3);return Ae(n.unpreselectEntity())}),Ge(1,"app-entity-name",8),Q()}if(i&2){let t=e.$implicit;Re("matTooltip","Select passenger")("matTooltipPosition","after"),oe(),Re("name",t.name)("tags",t.tags)}}function C7e(i,e){if(i&1&&(Z(0,"mat-accordion")(1,"mat-expansion-panel")(2,"mat-expansion-panel-header")(3,"mat-panel-title"),ce(4),Q()(),Z(5,"div",3),ui(6,w7e,2,4,"div",16,pA),Q()()()),i&2){let t=Se(2);oe(4),_t(" Passengers at stop (",t.selectedStopWaitingPassengers.length,")"),oe(2),hi(t.selectedStopWaitingPassengers)}}function M7e(i,e){if(i&1){let t=vt();Z(0,"div",17),Le("click",function(){let n=Ee(t).$implicit,a=Se(3);return Ae(a.selectEntity(n))})("keydown.enter",function(){let n=Ee(t).$implicit,a=Se(3);return Ae(a.selectEntity(n))})("mouseenter",function(){let n=Ee(t).$implicit,a=Se(3);return Ae(a.preselectEntity(n))})("mouseleave",function(){Ee(t);let n=Se(3);return Ae(n.unpreselectEntity())}),Ge(1,"app-entity-name",8),Q()}if(i&2){let t=e.$implicit;Re("matTooltip","Select passenger")("matTooltipPosition","after"),oe(),Re("name",t.name)("tags",t.tags)}}function T7e(i,e){if(i&1&&(Z(0,"mat-accordion")(1,"mat-expansion-panel")(2,"mat-expansion-panel-header")(3,"mat-panel-title"),ce(4),Q()(),Z(5,"div",3),ui(6,M7e,2,4,"div",16,pA),Q()()()),i&2){let t=Se(2);oe(4),_t(" Trips completed (",t.selectedStopCompletedPassengers.length,")"),oe(2),hi(t.selectedStopCompletedPassengers)}}function E7e(i,e){if(i&1){let t=vt();Z(0,"div",17),Le("click",function(){let n=Ee(t).$implicit,a=Se(3);return Ae(a.selectEntity(n))})("keydown.enter",function(){let n=Ee(t).$implicit,a=Se(3);return Ae(a.selectEntity(n))})("mouseenter",function(){let n=Ee(t).$implicit,a=Se(3);return Ae(a.preselectEntity(n))})("mouseleave",function(){Ee(t);let n=Se(3);return Ae(n.unpreselectEntity())}),Ge(1,"app-entity-name",8),Q()}if(i&2){let t=e.$implicit;Re("matTooltip","Select vehicle")("matTooltipPosition","after"),oe(),Re("name",t.name)("tags",t.tags)}}function A7e(i,e){if(i&1&&(Z(0,"mat-accordion")(1,"mat-expansion-panel")(2,"mat-expansion-panel-header")(3,"mat-panel-title"),ce(4),Q()(),Z(5,"div",3),ui(6,E7e,2,4,"div",16,pA),Q()()()),i&2){let t=Se(2);oe(4),_t(" Vehicles at stop (",t.selectedStopVehicles.length,")"),oe(2),hi(t.selectedStopVehicles)}}function P7e(i,e){if(i&1){let t=vt();Ri(0),Z(1,"mat-card-title",1),ce(2,"Selected Stop "),Z(3,"button",2),Le("click",function(){Ee(t);let n=Se();return Ae(n.toggleFavoriteEntity(n.selectedStop))}),Z(4,"mat-icon"),ce(5),Q()()(),Z(6,"div",3)(7,"div",4)(8,"mat-card")(9,"mat-card-content")(10,"b"),ce(11,"Label:"),Q(),ce(12),Q()(),Z(13,"mat-card")(14,"mat-card-content")(15,"b"),ce(16,"Capacity:"),Q(),ce(17),Q()(),Z(18,"mat-card")(19,"mat-card-content")(20,"b"),ce(21,"Tags:"),Q(),ce(22),Q()(),Z(23,"mat-card")(24,"mat-card-content")(25,"b"),ce(26,"Passenger Tags:"),Q(),ce(27),Q()(),Z(28,"mat-card")(29,"mat-card-content")(30,"b"),ce(31,"Position:"),Q(),ce(32),Q()(),je(33,x7e,5,1,"mat-card"),Q(),je(34,C7e,8,1,"mat-accordion")(35,T7e,8,1,"mat-accordion")(36,A7e,8,1,"mat-accordion"),Q()}if(i&2){let t=Se(),r=t.isFavoriteEntity(t.selectedStop);oe(3),Re("matTooltip",r?"Remove from favorite":"Add to favorite")("matTooltipPosition","after"),oe(2),Ti(r?"favorite":"favorite_outline"),oe(7),_t(" ",t.selectedStop.label," "),oe(5),_t(" ",t.selectedStop.capacity," "),oe(5),_t(" ",t.selectedStop.tags.length>0?t.selectedStop.tags.join(", "):"None"," "),oe(5),_t(" ",t.selectedStopPassengerTags.length>0?t.selectedStopPassengerTags.join(", "):"None"," "),oe(5),R_(" ",t.selectedStop.position.latitude,", ",t.selectedStop.position.longitude," "),oe(),Je(t.selectedStop.error!==null?33:-1),oe(),Je(t.selectedStopWaitingPassengers.length>0?34:-1),oe(),Je(t.selectedStopCompletedPassengers.length>0?35:-1),oe(),Je(t.selectedStopVehicles.length>0?36:-1)}}var mA=class i{constructor(e,t,r,n){this.animationService=e;this.favoriteEntitiesService=t;this.snackBar=r;this.visualizationService=n}selectedPassenger=null;selectedPassengerStop=null;selectedPassengerVehicle=null;selectedVehicle=null;selectedVehicleStop=null;selectedVehiclePassengers=[];selectedStop=null;selectedStopWaitingPassengers=[];selectedStopCompletedPassengers=[];selectedStopVehicles=[];get selectedPassengerLegs(){let e=this.selectedPassenger;return e===null?[]:td(e)}get environmentSignal(){return this.visualizationService.environmentSignal}get selectedVehiclePassengerTags(){return this.selectedVehiclePassengers.flatMap(t=>t.tags).filter((t,r,n)=>n.indexOf(t)===r).sort((t,r)=>t.localeCompare(r))}get selectedStopPassengerTags(){return this.selectedStopWaitingPassengers.flatMap(t=>t.tags).filter((t,r,n)=>n.indexOf(t)===r).sort((t,r)=>t.localeCompare(r))}get selectedPassengerLegStops(){if(this.selectedPassenger===null)return[];if(this.selectedPassenger.currentLeg===null)return[];if(this.selectedPassengerVehicle===null)return[];if(this.selectedPassenger.currentLeg.boardingStopIndex===null||this.selectedPassenger.currentLeg.alightingStopIndex===null)return[];let e=Bl(this.selectedPassengerVehicle);return this.selectedPassenger.currentLeg.boardingStopIndex<0||this.selectedPassenger.currentLeg.boardingStopIndex>=e.length||this.selectedPassenger.currentLeg.alightingStopIndex<0||this.selectedPassenger.currentLeg.alightingStopIndex>=e.length?[]:e.slice(this.selectedPassenger.currentLeg.boardingStopIndex,this.selectedPassenger.currentLeg.alightingStopIndex+1)}get selectedPassengerLegPreviousStops(){return this.selectedPassengerLegStops.filter(e=>e.stopType==="previous")}get selectedPassengerLegCurrentStop(){return this.selectedPassengerLegStops.find(e=>e.stopType==="current")??null}get selectedPassengerLegNextStops(){return this.selectedPassengerLegStops.filter(e=>e.stopType==="next")}copyToClipboard(e){navigator.clipboard.writeText(e).then(()=>{this.snackBar.open("Copied to clipboard!","Close",{duration:2e3})}).catch(t=>{console.error("Failed to copy text: ",t),this.snackBar.open("Failed to copy!","Close",{duration:2e3})})}truncateId(e){return e.length>20?`${e.slice(0,20)}...`:e}isFavoriteEntity(e){return this.favoriteEntitiesService.isFavoriteEntity(e)}toggleFavoriteEntity(e){this.favoriteEntitiesService.toggleFavoriteEntity(e)}preselectEntity(e){this.animationService.preselectEntity(e,!1)}unpreselectEntity(){this.animationService.unpreselectEntity()}selectEntity(e){this.animationService.selectEntity(e)}highlightLeg(e){this.selectedPassenger&&this.animationService.highlightLeg(e)}unhighlightLeg(){this.animationService.unhighlightLeg()}static \u0275fac=function(t){return new(t||i)(rt(Mr),rt(xd),rt(dM),rt(Ln))};static \u0275cmp=tt({type:i,selectors:[["app-selected-entity-tab"]],inputs:{selectedPassenger:"selectedPassenger",selectedPassengerStop:"selectedPassengerStop",selectedPassengerVehicle:"selectedPassengerVehicle",selectedVehicle:"selectedVehicle",selectedVehicleStop:"selectedVehicleStop",selectedVehiclePassengers:"selectedVehiclePassengers",selectedStop:"selectedStop",selectedStopWaitingPassengers:"selectedStopWaitingPassengers",selectedStopCompletedPassengers:"selectedStopCompletedPassengers",selectedStopVehicles:"selectedStopVehicles"},decls:4,vars:4,consts:[["idElement",""],[2,"display","flex","align-items","center","gap","8px"],["mat-icon-button","","disableRipple","",2,"padding","0","border","none",3,"click","matTooltip","matTooltipPosition"],[1,"flex-column","gap-0-5-rem"],[1,"mat-card-group"],[1,"clickable-no-padding",3,"click","keydown.enter","matTooltip","matTooltipPosition"],[1,"flex-column","gap-1-5-rem"],[1,"clickable-no-padding",3,"click","keydown.enter","mouseenter","mouseleave","matTooltip","matTooltipPosition"],[3,"name","tags"],["matTooltip","The passenger is not displayed"],[1,"flex-column","gap-0-5-rem",3,"mouseenter","mouseleave"],[1,"indent"],["tabindex","0",1,"clickable-no-padding",3,"matTooltip","matTooltipPosition"],[1,"indent",3,"previousStops","currentStop","nextStops"],["tabindex","0",1,"clickable-no-padding",3,"click","keydown.enter","matTooltip","matTooltipPosition"],["matTooltip","The vehicle is not displayed"],["tabindex","0",1,"clickable","indent",3,"matTooltip","matTooltipPosition"],["tabindex","0",1,"clickable","indent",3,"click","keydown.enter","mouseenter","mouseleave","matTooltip","matTooltipPosition"],["matTooltip","The stop is not displayed."]],template:function(t,r){t&1&&(Ri(0),je(1,g7e,45,15)(2,k7e,49,20)(3,P7e,37,13)),t&2&&(hr(r.environmentSignal()),oe(),Je(r.selectedPassenger!==null?1:-1),oe(),Je(r.selectedVehicle!==null?2:-1),oe(),Je(r.selectedStop!==null?3:-1))},dependencies:[ia,ea,ta,bM,Rn,Da,pr,mr,kc,ry,qm,Zm,iy,dA,Ah,rl],styles:[".flex-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.flex-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.align-center[_ngcontent-%COMP%], .align-main-center[_ngcontent-%COMP%]{justify-content:center}.align-center[_ngcontent-%COMP%], .align-cross-center[_ngcontent-%COMP%]{align-items:center}.align-main-end[_ngcontent-%COMP%]{justify-content:flex-end}.align-cross-end[_ngcontent-%COMP%]{align-items:flex-end}.align-main-start[_ngcontent-%COMP%]{justify-content:flex-start}.align-cross-start[_ngcontent-%COMP%]{align-items:flex-start}.align-cross-stretch[_ngcontent-%COMP%]{align-items:stretch}.gap-0-5-rem[_ngcontent-%COMP%]{gap:.5rem}.gap-1-rem[_ngcontent-%COMP%]{gap:1rem}.gap-1-5-rem[_ngcontent-%COMP%]{gap:1.5rem}.flex-1[_ngcontent-%COMP%]{flex:1}.clickable[_ngcontent-%COMP%]{cursor:pointer;padding:.5rem 0;border-radius:.5rem}.clickable[_ngcontent-%COMP%]:hover{background-color:#1a1b1f14}.clickable-no-padding[_ngcontent-%COMP%]{cursor:pointer;border-radius:.5rem}.clickable-no-padding[_ngcontent-%COMP%]:hover{background-color:#1a1b1f14}.indent[_ngcontent-%COMP%]{padding-left:24px} .mat-expansion-panel-body{padding:0 5px 5px!important}.mat-card-group[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]:first-child{border-bottom-left-radius:0;border-bottom-right-radius:0}.mat-card-group[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]:last-child{border-top-left-radius:0;border-top-right-radius:0}.mat-card-group[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]:not(:first-child):not(:last-child){border-radius:0}"]})};var x5=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function w5(i,e,t,r){i.addEventListener?i.addEventListener(e,t,r):i.attachEvent&&i.attachEvent("on".concat(e),t)}function vk(i,e,t,r){i.removeEventListener?i.removeEventListener(e,t,r):i.detachEvent&&i.detachEvent("on".concat(e),t)}function ame(i,e){let t=e.slice(0,e.length-1);for(let r=0;r<t.length;r++)t[r]=i[t[r].toLowerCase()];return t}function ome(i){typeof i!="string"&&(i=""),i=i.replace(/\s/g,"");let e=i.split(","),t=e.lastIndexOf("");for(;t>=0;)e[t-1]+=",",e.splice(t,1),t=e.lastIndexOf("");return e}function B7e(i,e){let t=i.length>=e.length?i:e,r=i.length>=e.length?e:i,n=!0;for(let a=0;a<t.length;a++)r.indexOf(t[a])===-1&&(n=!1);return n}var kk={backspace:8,"\u232B":8,tab:9,clear:12,enter:13,"\u21A9":13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"\u21EA":20,",":188,".":190,"/":191,"`":192,"-":x5?173:189,"=":x5?61:187,";":x5?59:186,"'":222,"[":219,"]":221,"\\":220},Nc={"\u21E7":16,shift:16,"\u2325":18,alt:18,option:18,"\u2303":17,ctrl:17,control:17,"\u2318":91,cmd:91,command:91},gA={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},va={16:!1,18:!1,17:!1,91:!1},un={};for(let i=1;i<20;i++)kk["f".concat(i)]=111+i;var Yr=[],Sk=null,sme="all",th=new Map,wk=i=>kk[i.toLowerCase()]||Nc[i.toLowerCase()]||i.toUpperCase().charCodeAt(0),R7e=i=>Object.keys(kk).find(e=>kk[e]===i),D7e=i=>Object.keys(Nc).find(e=>Nc[e]===i);function lme(i){sme=i||"all"}function xk(){return sme||"all"}function L7e(){return Yr.slice(0)}function I7e(){return Yr.map(i=>R7e(i)||D7e(i)||String.fromCharCode(i))}function F7e(){let i=[];return Object.keys(un).forEach(e=>{un[e].forEach(t=>{let{key:r,scope:n,mods:a,shortcut:o}=t;i.push({scope:n,shortcut:o,mods:a,keys:r.split("+").map(s=>wk(s))})})}),i}function O7e(i){let e=i.target||i.srcElement,{tagName:t}=e,r=!0,n=t==="INPUT"&&!["checkbox","radio","range","button","file","reset","submit","color"].includes(e.type);return(e.isContentEditable||(n||t==="TEXTAREA"||t==="SELECT")&&!e.readOnly)&&(r=!1),r}function z7e(i){return typeof i=="string"&&(i=wk(i)),Yr.indexOf(i)!==-1}function H7e(i,e){let t,r;i||(i=xk());for(let n in un)if(Object.prototype.hasOwnProperty.call(un,n))for(t=un[n],r=0;r<t.length;)t[r].scope===i?t.splice(r,1).forEach(o=>{let{element:s}=o;return M5(s)}):r++;xk()===i&&lme(e||"all")}function N7e(i){let e=i.keyCode||i.which||i.charCode,t=Yr.indexOf(e);if(t>=0&&Yr.splice(t,1),i.key&&i.key.toLowerCase()==="meta"&&Yr.splice(0,Yr.length),(e===93||e===224)&&(e=91),e in va){va[e]=!1;for(let r in Nc)Nc[r]===e&&(Sa[r]=!1)}}function cme(i){if(typeof i>"u")Object.keys(un).forEach(n=>{Array.isArray(un[n])&&un[n].forEach(a=>fA(a)),delete un[n]}),M5(null);else if(Array.isArray(i))i.forEach(n=>{n.key&&fA(n)});else if(typeof i=="object")i.key&&fA(i);else if(typeof i=="string"){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];let[n,a]=t;typeof n=="function"&&(a=n,n=""),fA({key:i,scope:n,method:a,splitKey:"+"})}}var fA=i=>{let{key:e,scope:t,method:r,splitKey:n="+"}=i;ome(e).forEach(o=>{let s=o.split(n),l=s.length,c=s[l-1],u=c==="*"?"*":wk(c);if(!un[u])return;t||(t=xk());let h=l>1?ame(Nc,s):[],d=[];un[u]=un[u].filter(p=>{let g=(r?p.method===r:!0)&&p.scope===t&&B7e(p.mods,h);return g&&d.push(p.element),!g}),d.forEach(p=>M5(p))})};function rme(i,e,t,r){if(e.element!==r)return;let n;if(e.scope===t||e.scope==="all"){n=e.mods.length>0;for(let a in va)Object.prototype.hasOwnProperty.call(va,a)&&(!va[a]&&e.mods.indexOf(+a)>-1||va[a]&&e.mods.indexOf(+a)===-1)&&(n=!1);(e.mods.length===0&&!va[16]&&!va[18]&&!va[17]&&!va[91]||n||e.shortcut==="*")&&(e.keys=[],e.keys=e.keys.concat(Yr),e.method(i,e)===!1&&(i.preventDefault?i.preventDefault():i.returnValue=!1,i.stopPropagation&&i.stopPropagation(),i.cancelBubble&&(i.cancelBubble=!0)))}}function nme(i,e){let t=un["*"],r=i.keyCode||i.which||i.charCode;if(!Sa.filter.call(this,i))return;if((r===93||r===224)&&(r=91),Yr.indexOf(r)===-1&&r!==229&&Yr.push(r),["metaKey","ctrlKey","altKey","shiftKey"].forEach(s=>{let l=gA[s];i[s]&&Yr.indexOf(l)===-1?Yr.push(l):!i[s]&&Yr.indexOf(l)>-1?Yr.splice(Yr.indexOf(l),1):s==="metaKey"&&i[s]&&(Yr=Yr.filter(c=>c in gA||c===r))}),r in va){va[r]=!0;for(let s in Nc)Nc[s]===r&&(Sa[s]=!0);if(!t)return}for(let s in va)Object.prototype.hasOwnProperty.call(va,s)&&(va[s]=i[gA[s]]);i.getModifierState&&!(i.altKey&&!i.ctrlKey)&&i.getModifierState("AltGraph")&&(Yr.indexOf(17)===-1&&Yr.push(17),Yr.indexOf(18)===-1&&Yr.push(18),va[17]=!0,va[18]=!0);let n=xk();if(t)for(let s=0;s<t.length;s++)t[s].scope===n&&(i.type==="keydown"&&t[s].keydown||i.type==="keyup"&&t[s].keyup)&&rme(i,t[s],n,e);if(!(r in un))return;let a=un[r],o=a.length;for(let s=0;s<o;s++)if((i.type==="keydown"&&a[s].keydown||i.type==="keyup"&&a[s].keyup)&&a[s].key){let l=a[s],{splitKey:c}=l,u=l.key.split(c),h=[];for(let d=0;d<u.length;d++)h.push(wk(u[d]));h.sort().join("")===Yr.sort().join("")&&rme(i,l,n,e)}}function Sa(i,e,t){Yr=[];let r=ome(i),n=[],a="all",o=document,s=0,l=!1,c=!0,u="+",h=!1,d=!1;for(t===void 0&&typeof e=="function"&&(t=e),Object.prototype.toString.call(e)==="[object Object]"&&(e.scope&&(a=e.scope),e.element&&(o=e.element),e.keyup&&(l=e.keyup),e.keydown!==void 0&&(c=e.keydown),e.capture!==void 0&&(h=e.capture),typeof e.splitKey=="string"&&(u=e.splitKey),e.single===!0&&(d=!0)),typeof e=="string"&&(a=e),d&&cme(i,a);s<r.length;s++)i=r[s].split(u),n=[],i.length>1&&(n=ame(Nc,i)),i=i[i.length-1],i=i==="*"?"*":wk(i),i in un||(un[i]=[]),un[i].push({keyup:l,keydown:c,scope:a,mods:n,shortcut:r[s],method:t,key:r[s],splitKey:u,element:o});if(typeof o<"u"&&window){if(!th.has(o)){let p=function(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;return nme(g,o)},f=function(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;nme(g,o),N7e(g)};th.set(o,{keydownListener:p,keyupListenr:f,capture:h}),w5(o,"keydown",p,h),w5(o,"keyup",f,h)}if(!Sk){let p=()=>{Yr=[]};Sk={listener:p,capture:h},w5(window,"focus",p,h)}}}function G7e(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(un).forEach(t=>{un[t].filter(n=>n.scope===e&&n.shortcut===i).forEach(n=>{n&&n.method&&n.method()})})}function M5(i){let e=Object.values(un).flat();if(e.findIndex(r=>{let{element:n}=r;return n===i})<0){let{keydownListener:r,keyupListenr:n,capture:a}=th.get(i)||{};r&&n&&(vk(i,"keyup",n,a),vk(i,"keydown",r,a),th.delete(i))}if((e.length<=0||th.size<=0)&&(Object.keys(th).forEach(n=>{let{keydownListener:a,keyupListenr:o,capture:s}=th.get(n)||{};a&&o&&(vk(n,"keyup",o,s),vk(n,"keydown",a,s),th.delete(n))}),th.clear(),Object.keys(un).forEach(n=>delete un[n]),Sk)){let{listener:n,capture:a}=Sk;vk(window,"focus",n,a),Sk=null}}var C5={getPressedKeyString:I7e,setScope:lme,getScope:xk,deleteScope:H7e,getPressedKeyCodes:L7e,getAllKeyCodes:F7e,isPressed:z7e,filter:O7e,trigger:G7e,unbind:cme,keyMap:kk,modifier:Nc,modifierMap:gA};for(let i in C5)Object.prototype.hasOwnProperty.call(C5,i)&&(Sa[i]=C5[i]);if(typeof window<"u"){let i=window.hotkeys;Sa.noConflict=e=>(e&&window.hotkeys===Sa&&(window.hotkeys=i),Sa),window.hotkeys=Sa}var V7e=["sliderWrapper"],K7e=(i,e)=>e.start;function W7e(i,e){i&1&&ce(0," -- : -- : -- ")}function U7e(i,e){if(i&1&&(ce(0),Vr(1,"simulationTime")),i&2){let t=Se(3);_t(" ",En(1,1,t.editorVisualisationTimeValueSignal())," ")}}function j7e(i,e){if(i&1&&je(0,W7e,1,0)(1,U7e,2,3),i&2){let t=Se(2);Je(t.editorVisualisationTimeForm.hasError("invalidNumber")?0:1)}}function q7e(i,e){if(i&1&&(ce(0),Vr(1,"simulationTime")),i&2){Se(2);let t=fi(5);_t(" ",En(1,1,t)," ")}}function Z7e(i,e){if(i&1&&(Z(0,"div",18),ce(1),Q()),i&2){let t=Se(2);yr("left",t.sliderTooltipX,"px"),oe(),_t(" ",t.sliderHoverSimulationTime," ")}}function Y7e(i,e){if(i&1&&(Z(0,"mat-slider",16),Ge(1,"input",19)(2,"input",20),Q()),i&2){let t=e.$implicit;Se(2);let r=fi(2),n=fi(3);Re("min",r)("max",n),oe(),Re("value",t.start),oe(),Re("value",t.end)}}function J7e(i,e){if(i&1&&(Z(0,"mat-slider",17),Ge(1,"input",21),Q()),i&2){Se(2);let t=fi(1),r=fi(2),n=fi(3);Re("min",r)("max",n),oe(),Re("value",t.simulationTime)}}function $7e(i,e){if(i&1){let t=vt();Z(0,"mat-card")(1,"mat-card-content",2)(2,"button",3),Le("click",function(){Ee(t);let n=Se(),a=fi(0);return Ae(n.toggleVisualizationPause(a))}),Z(3,"mat-icon"),ce(4),Q()(),Ri(5)(6),Z(7,"button",3),Le("click",function(){Ee(t);let n=Se();return Ae(n.rewindTime())}),Z(8,"mat-icon"),ce(9,"skip_previous"),Q()(),Z(10,"button",4),ce(11),Q(),Z(12,"mat-menu",5,0)(14,"button",6),Le("click",function(){Ee(t);let n=Se();return Ae(n.setSpeed(0))}),ce(15,"x1"),Q(),Z(16,"button",6),Le("click",function(){Ee(t);let n=Se();return Ae(n.setSpeed(1))}),ce(17,"x2"),Q(),Z(18,"button",6),Le("click",function(){Ee(t);let n=Se();return Ae(n.setSpeed(2))}),ce(19,"x4"),Q(),Z(20,"button",6),Le("click",function(){Ee(t);let n=Se();return Ae(n.setSpeed(3))}),ce(21,"x8"),Q(),Z(22,"button",6),Le("click",function(){Ee(t);let n=Se();return Ae(n.setSpeed(4))}),ce(23,"x16"),Q(),Z(24,"button",6),Le("click",function(){Ee(t);let n=Se();return Ae(n.setSpeed(5))}),ce(25,"x32"),Q(),Z(26,"button",6),Le("click",function(){Ee(t);let n=Se();return Ae(n.setSpeed(6))}),ce(27,"x64"),Q(),Z(28,"button",6),Le("click",function(){Ee(t);let n=Se();return Ae(n.setSpeed(7))}),ce(29,"x128"),Q()(),Z(30,"button",3),Le("click",function(){Ee(t);let n=Se();return Ae(n.fastForwardTime())}),Z(31,"mat-icon"),ce(32,"skip_next"),Q()(),Z(33,"button",7),Le("click",function(){Ee(t);let n=Se();return Ae(n.toggleSimulationDirection())}),Z(34,"mat-icon"),ce(35),Q()(),Z(36,"button",3),Le("click",function(){Ee(t);let n=Se();return Ae(n.centerMap())}),Z(37,"mat-icon"),ce(38,"my_location"),Q()(),Z(39,"button",3),Le("click",function(){Ee(t);let n=Se();return Ae(n.toggleShouldFollowEntity())}),Z(40,"mat-icon"),ce(41,"moving"),Q()(),Ri(42),Z(43,"div")(44,"div")(45,"button",8),Vr(46,"number"),Le("click",function(){Ee(t);let n=Se();return Ae(n.openVisualisationTimeEditor())}),je(47,j7e,2,1)(48,q7e,2,3),Q()(),Z(49,"form",9)(50,"mat-form-field",10)(51,"mat-label"),ce(52,"Set Visualisation Time"),Q(),Z(53,"input",11),Le("keyup.enter",function(){Ee(t);let n=Se();return Ae(n.applyVisualisationTime())})("blur",function(){Ee(t);let n=Se();return Ae(n.hideVisualisationTimeEditor())}),Q()()()(),Z(54,"div",12,1),Le("mousemove",function(n){Ee(t);let a=Se();return Ae(a.onSliderMouseMove(n))})("mouseleave",function(){Ee(t);let n=Se();return Ae(n.sliderHoverSimulationTime=null)}),Z(56,"mat-slider",13)(57,"input",14),Le("valueChange",function(n){Ee(t);let a=Se();return Ae(a.onSliderChange(n))}),Q(),je(58,Z7e,2,3,"div",15),Q(),ui(59,Y7e,3,4,"mat-slider",16,K7e),je(61,J7e,2,3,"mat-slider",17),Q(),Z(62,"button",3),Le("click",function(){Ee(t);let n=Se();return Ae(n.leaveVisualization())}),Z(63,"mat-icon"),ce(64,"exit_to_app"),Q()()()()}if(i&2){let t,r=Or(13),n=Se(),a=fi(0),o=fi(1),s=fi(2),l=fi(3),c=fi(5),u=fi(7);oe(2),Re("matTooltip",a?"Resume the visualization (space)":"Pause the visualization (space)"),oe(2),Ti(a?"play_arrow":"pause");let h=n.speedSignal(),d=n.fastForwardStepSignal();oe(3),Re("matTooltip","Rewind the simulation "+d+" seconds ago (ctrl + \u2190)"),oe(3),Re("matMenuTriggerFor",r),oe(),_t(" x",h," "),oe(19),Re("matTooltip","Fast-forward the simulation "+d+" seconds later (ctrl + \u2192)"),oe(3),Re("matTooltip",h>0?"Reverse the simulation (r)":"Forward the simulation (r)")("disabled",h===0),oe(2),Ti(h>0?"restore":"update"),oe(),Re("matTooltip","Center the map (c)"),oe(3),gt("active",u),Re("matTooltip","Toggle entity follow mode (f)");let p=n.showVisualisationTimeEditorSignal();oe(6),Re("matTooltip",((t=zd(46,27,c,"1.0-0"))!==null&&t!==void 0?t:"0").toString()+" (Click to modify)")("disabled",p),oe(2),Je(p?47:48),oe(2),gt("fade-show",p)("disable-pointer-events",!p),oe(4),Re("formControl",n.editorVisualisationTimeForm),oe(3),Re("min",s)("max",l),oe(),Re("value",c),oe(),Je(n.sliderHoverSimulationTime!==null?58:-1),oe(),hi(n.coveredTimeIntervalsSignal()),oe(2),Je(o.simulationTime!==null?61:-1),oe(),Re("matTooltip","Leave the visualization")}}var yA=class i{constructor(e,t,r){this.visualizationService=e;this.animationService=t;this.simulationService=r;Ji(()=>{let n=this.speedSignal();this.visualizationService.setVisualizationSpeed(n),this.animationService.setSpeed(n)}),this.editorVisualisationTimeForm.valueChanges.subscribe(n=>{this.editorVisualisationTimeValueSignal.set(n?parseInt(n):NaN)}),Sa("space",()=>{this.toggleVisualizationPause(this.isVisualizationPausedSignal())}),Sa("ctrl+left,command+left,cmd+left",()=>{this.rewindTime()}),Sa("ctrl+right,command+right,cmd+right ",()=>{this.fastForwardTime()}),Sa("ctrl+up,command+up,cmd+up",()=>{this.increaseSpeed()}),Sa("ctrl+down,command+down,cmd+down",()=>{this.decreaseSpeed()}),Sa("r",()=>{this.toggleSimulationDirection()}),Sa("c",()=>{this.centerMap()}),Sa("f",()=>{this.toggleShouldFollowEntity()})}sliderWrapper=lh("sliderWrapper");sliderHoverSimulationTime=null;sliderHoverTimestamp=0;sliderTooltipX=0;isSimulationPausedSignal=$t(()=>this.simulationInputSignal().status==="paused");MIN_SPEED_POWER=0;MAX_SPEED_POWER=7;FAST_FORWARD_STEP=1;speedPowerSignal=Bt(0);speedDirectionSignal=Bt(1);speedSignal=$t(()=>Math.pow(2,this.speedPowerSignal())*this.speedDirectionSignal());fastForwardStepSignal=$t(()=>Math.abs(this.speedSignal())*this.FAST_FORWARD_STEP);simulationInputSignal=sl.required({alias:"simulation"});leaveVisualizationOutput=Uc({alias:"leaveVisualization"});showVisualisationTimeEditorSignal=Bt(!1);editorVisualisationTimeForm=new Ql("",this.validateVisualisationTimeInput());editorvisualisationTimeInput=lh(qo);editorVisualisationTimeValueSignal=Bt(NaN);sliderUpdateSignal=Bt(0);SLIDER_UPDATE_INTERVAL=1e3/5;interval=null;wantedVisualizationTime=null;hasBeenAltered=!1;SMALL_OFFSET=1e-4;wantedVisualizationTimeSignal=$t(()=>{this.sliderUpdateSignal();let e=this.visualizationService.wantedVisualizationTimeSignal();return e===null?null:e!==this.wantedVisualizationTime?(this.wantedVisualizationTime=e,e):this.hasBeenAltered?(this.hasBeenAltered=!1,e):(this.hasBeenAltered=!0,e+this.SMALL_OFFSET)});coveredTimeIntervalsSignal=$t(()=>{let e=this.simulationService.continuousEnvironmentsSignal();return vI(e)});ngOnInit(){this.interval=setInterval(()=>{this.sliderUpdateSignal.update(e=>e+1)},this.SLIDER_UPDATE_INTERVAL)}ngOnDestroy(){this.interval!==null&&clearInterval(this.interval)}get isInitializedSignal(){return this.visualizationService.isInitializedSignal}get simulationStartTimeSignal(){return this.visualizationService.simulationStartTimeSignal}get simulationEndTimeSignal(){return this.visualizationService.simulationEndTimeSignal}get visualizationMaxTimeSignal(){return this.visualizationService.visualizationMaxTimeSignal}get isVisualizationPausedSignal(){return this.visualizationService.isVisualizationPausedSignal}get shouldFollowEntitySignal(){return this.animationService.shouldFollowEntitySignal}toggleVisualizationPause(e){e?this.visualizationService.resumeVisualization():this.visualizationService.pauseVisualization()}setSpeed(e){this.speedPowerSignal.set(e)}decreaseSpeed(){this.speedPowerSignal.update(e=>Math.max(e-1,this.MIN_SPEED_POWER))}increaseSpeed(){this.speedPowerSignal.update(e=>Math.min(e+1,this.MAX_SPEED_POWER))}onSliderMouseMove(e){let t=this.sliderWrapper()?.nativeElement;if(!t)return;let r=t.querySelector(".mdc-slider__track");if(r==null)return;let n=r.getBoundingClientRect(),a=e.clientX-n.left,o=Math.max(0,Math.min(1,a/n.width)),s=this.simulationStartTimeSignal(),l=this.simulationEndTimeSignal();if(s===null||l===null)return;this.sliderHoverTimestamp=s+o*(l-s);let c=aM(this.sliderHoverTimestamp);this.sliderHoverSimulationTime=c,this.sliderTooltipX=a}fastForwardTime(){this.translateTime(this.fastForwardStepSignal())}rewindTime(){this.translateTime(-this.fastForwardStepSignal())}translateTime(e){let t=this.visualizationService.wantedVisualizationTimeSignal();t&&this.visualizationService.setVisualizationTime(t+e)}toggleSimulationDirection(){this.speedDirectionSignal.update(e=>-e)}centerMap(){this.animationService.centerMap()}toggleShouldFollowEntity(){this.animationService.toggleShouldFollowEntity()}leaveVisualization(){this.leaveVisualizationOutput.emit()}openVisualisationTimeEditor(){let e=this.editorvisualisationTimeInput();e!==void 0&&(this.editorVisualisationTimeForm.setValue(this.wantedVisualizationTimeSignal()?.toFixed(0)??null),this.showVisualisationTimeEditorSignal.set(!0),e.focus())}applyVisualisationTime(){let e=this.editorVisualisationTimeValueSignal();e===null||isNaN(e)||(this.visualizationService.setVisualizationTime(e),this.showVisualisationTimeEditorSignal.set(!1))}hideVisualisationTimeEditor(){this.showVisualisationTimeEditorSignal.set(!1)}onSliderChange(e){this.visualizationService.setVisualizationTime(this.sliderHoverTimestamp)}sliderLabelFormatter(e,t){return r=>Math.floor(100*(r-e)/(t-e))+"%"}validateVisualisationTimeInput(){return e=>{let t=parseInt(e.value);return isNaN(t)||t<=0?{invalidNumber:!0}:null}}static \u0275fac=function(t){return new(t||i)(rt(Ln),rt(Mr),rt(Ha))};static \u0275cmp=tt({type:i,selectors:[["app-simulation-control-bar"]],viewQuery:function(t,r){t&1&&(ch(r.sliderWrapper,V7e,5),ch(r.editorvisualisationTimeInput,qo,5)),t&2&&uh(2)},inputs:{simulationInputSignal:[1,"simulation","simulationInputSignal"]},outputs:{leaveVisualizationOutput:"leaveVisualization"},decls:9,vars:7,consts:[["speedMenu","matMenu"],["sliderWrapper",""],[1,"flex-row","align-center","gap-0-5-rem"],["mat-icon-button","",3,"click","matTooltip"],["mat-button","",1,"speed-button",3,"matMenuTriggerFor"],[1,"speed-menu"],["mat-menu-item","",3,"click"],["mat-icon-button","",3,"click","matTooltip","disabled"],["mat-button","",3,"click","matTooltip","disabled"],[1,"fade"],[1,"timestamp-input"],["matInput","","type","number",3,"keyup.enter","blur","formControl"],[1,"flex-1","sliders",3,"mousemove","mouseleave"],[3,"min","max"],["matSliderThumb","",3,"valueChange","value"],[1,"hover-tooltip",3,"left"],["disabled","",1,"loaded",3,"min","max"],["disabled","",1,"simulation","disable-pointer-events",3,"min","max"],[1,"hover-tooltip"],["matSliderStartThumb","",3,"value"],["matSliderEndThumb","",3,"value"],["matSliderThumb","",3,"value"]],template:function(t,r){if(t&1&&(Ri(0)(1)(2)(3)(4)(5)(6)(7),je(8,$7e,65,30,"mat-card")),t&2){hr(r.isVisualizationPausedSignal()),oe();let n=hr(r.simulationInputSignal());oe();let a=hr(r.simulationStartTimeSignal());oe();let o=hr(r.simulationEndTimeSignal()),s=r.visualizationMaxTimeSignal();oe(2);let l=hr(r.wantedVisualizationTimeSignal()),c=r.isInitializedSignal();oe(2),hr(r.shouldFollowEntitySignal()),oe(),Je(c&&n!==null&&a!==null&&o!==null&&s!==null&&l!==null?8:-1)}},dependencies:[ia,ea,ta,Br,pn,Xl,pr,mr,Rn,Da,qw,jw,Ff,ZR,Cw,wh,Ps,Cb,ec,xh,ru,So,qo,ac,zs,ha,Rs,Mb,eM,Xh,Um,QC,ed,iV],styles:[".flex-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.flex-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.align-center[_ngcontent-%COMP%], .align-main-center[_ngcontent-%COMP%]{justify-content:center}.align-center[_ngcontent-%COMP%], .align-cross-center[_ngcontent-%COMP%]{align-items:center}.align-main-end[_ngcontent-%COMP%]{justify-content:flex-end}.align-cross-end[_ngcontent-%COMP%]{align-items:flex-end}.align-main-start[_ngcontent-%COMP%]{justify-content:flex-start}.align-cross-start[_ngcontent-%COMP%]{align-items:flex-start}.align-cross-stretch[_ngcontent-%COMP%]{align-items:stretch}.gap-0-5-rem[_ngcontent-%COMP%]{gap:.5rem}.gap-1-rem[_ngcontent-%COMP%]{gap:1rem}.gap-1-5-rem[_ngcontent-%COMP%]{gap:1.5rem}.flex-1[_ngcontent-%COMP%]{flex:1}*[_ngcontent-%COMP%]{--red-text-color: #ff0000;--red-background-color: #ffdddd;--yellow-text-color: #ffc21b;--yellow-background-color: #ffe6a4;--green-text-color: #00aa00;--green-background-color: #ccffcc;--gray-text-color: #666666;--gray-background-color: #f0f0f0;--blue-text-color: #4488ff;--blue-background-color: #cce5ff;--loaded-slider-color: #005cbb88;--active-button-color: #cce6ff}.text-red[_ngcontent-%COMP%]{color:var(--red-text-color)}.background-red[_ngcontent-%COMP%]{background-color:var(--red-background-color)}.text-yellow[_ngcontent-%COMP%]{color:var(--yellow-text-color)}.background-yellow[_ngcontent-%COMP%]{background-color:var(--yellow-background-color)}.text-green[_ngcontent-%COMP%]{color:var(--green-text-color)}.background-green[_ngcontent-%COMP%]{background-color:var(--green-background-color)}.text-gray[_ngcontent-%COMP%]{color:var(--gray-text-color)}.background-gray[_ngcontent-%COMP%]{background-color:var(--gray-background-color)!important}.text-blue[_ngcontent-%COMP%]{color:var(--blue-text-color)}.background-blue[_ngcontent-%COMP%]{background-color:var(--blue-background-color)}[_nghost-%COMP%]{position:absolute;bottom:10px;left:50%;transform:translate(-50%);width:calc(100% - (2*(44px + 1rem)));max-width:1200px}[_nghost-%COMP%] .mat-mdc-card-content{padding:.5rem!important}.sliders[_ngcontent-%COMP%]{margin-inline:1rem;position:relative}.sliders[_ngcontent-%COMP%] mat-slider[_ngcontent-%COMP%]{width:100%}.sliders[_ngcontent-%COMP%] :is(.loaded[_ngcontent-%COMP%], .simulation[_ngcontent-%COMP%]){position:absolute;top:0;left:0;pointer-events:none}.sliders[_ngcontent-%COMP%] .loaded[_ngcontent-%COMP%]{opacity:unset}.sliders[_ngcontent-%COMP%] .loaded mat-slider-visual-thumb, .sliders[_ngcontent-%COMP%] .loaded .mdc-slider__track--inactive, .sliders[_ngcontent-%COMP%] .simulation .mdc-slider__track{display:none}.sliders[_ngcontent-%COMP%] .loaded .mdc-slider__track--active_fill{border-color:var(--loaded-slider-color)}:is() .loaded[_ngcontent-%COMP%]{display:none}.active[_ngcontent-%COMP%]{background-color:var(--active-button-color)}.speed-button[_ngcontent-%COMP%]{min-width:fit-content}.timestamp-input[_ngcontent-%COMP%]{position:absolute;bottom:50px;transform:scale(.9);transform-origin:bottom left} .mat-mdc-menu-panel{min-width:fit-content!important}.mat-mdc-menu-item[_ngcontent-%COMP%]{min-height:30px}.disable-pointer-events[_ngcontent-%COMP%]{pointer-events:none}.fade[_ngcontent-%COMP%]{opacity:0;transition:opacity .1s ease-in-out}.fade-show[_ngcontent-%COMP%]{opacity:1}.hover-tooltip[_ngcontent-%COMP%]{position:absolute;top:-5px;background-color:#424242;color:#fff;padding:4px 8px;font-size:12px;border-radius:4px;transform:translate(-50%);pointer-events:none;white-space:nowrap}"]})};function X7e(i,e){if(i&1){let t=vt();Z(0,"mat-card")(1,"mat-card-header")(2,"mat-card-subtitle"),ce(3,"Simulation Status"),Q()(),Z(4,"mat-card-content",0)(5,"section",1)(6,"div")(7,"span"),ce(8,"Current :\xA0"),Q(),Z(9,"span",2),ce(10),Vr(11,"simulationTime"),Q()(),Z(12,"div")(13,"span"),ce(14,"Estimated end :\xA0"),Q(),Z(15,"span",2),ce(16),Vr(17,"simulationTime"),Q()()(),Z(18,"section")(19,"mat-chip"),ce(20),Q()(),Z(21,"section",3)(22,"button",4),Le("click",function(){Ee(t);let n=Se(),a=fi(0),o=fi(1);return Ae(n.toggleSimulationPause(a,o.id))}),Z(23,"mat-icon"),ce(24),Q()(),Z(25,"button",4),Le("click",function(){Ee(t);let n=Se(),a=fi(1);return Ae(n.stopSimulation(a.id))}),Z(26,"mat-icon"),ce(27,"stop"),Q()(),Z(28,"button",5),Le("click",function(){Ee(t);let n=Se(),a=fi(1);return Ae(n.editSimulationConfiguration(a))}),Z(29,"mat-icon"),ce(30,"settings"),Q()()()()()}if(i&2){let t,r,n=Se(),a=fi(0),o=fi(1);oe(9),Re("matTooltip",(t=o.simulationTime==null?null:o.simulationTime.toString())!==null&&t!==void 0?t:"unknown"),oe(),_t(" ",o.simulationTime!==null?En(11,15,o.simulationTime):"unknown",""),oe(5),Re("matTooltip",(r=o.simulationEstimatedEndTime==null?null:o.simulationEstimatedEndTime.toString())!==null&&r!==void 0?r:"unknown"),oe(),_t(" ",o.simulationEstimatedEndTime!==null?En(17,17,o.simulationEstimatedEndTime):"unknown"," "),oe(3),yr("color","var(--"+n.getSimulationStatusColor(o.status)+"-text-color)")("background-color","var(--"+n.getSimulationStatusColor(o.status)+"-background-color)"),oe(),_t(" ",o.status," "),oe(2),Re("matTooltip",a?"Resume the simulation":"Pause the simulation")("disabled",o.status!=="running"&&o.status!=="paused"),oe(2),Ti(a?"play_arrow":"pause"),oe(),Re("matTooltip","Stop the simulation")("disabled",o.status!=="running"&&o.status!=="paused"),oe(3),Re("matTooltip","Configure the simulation")}}var _A=class i{constructor(e){this.visualizationService=e}isSimulationPausedSignal=$t(()=>this.simulationInputSignal().status==="paused");simulationInputSignal=sl.required({alias:"simulation"});pauseSimulationOutput=Uc({alias:"pauseSimulation"});resumeSimulationOutput=Uc({alias:"resumeSimulation"});stopSimulationOutput=Uc({alias:"stopSimulation"});editSimulationConfigurationOutput=Uc({alias:"editSimulationConfiguration"});get isInitializedSignal(){return this.visualizationService.isInitializedSignal}get isVisualizationPausedSignal(){return this.visualizationService.isVisualizationPausedSignal}toggleSimulationPause(e,t){e?this.resumeSimulationOutput.emit(t):this.pauseSimulationOutput.emit(t)}stopSimulation(e){this.stopSimulationOutput.emit(e)}editSimulationConfiguration(e){this.editSimulationConfigurationOutput.emit(e)}getSimulationStatusColor(e){switch(e){case"running":return"green";case"paused":return"yellow";case"stopping":case"starting":case"completed":return"gray";default:return"red"}}static \u0275fac=function(t){return new(t||i)(rt(Ln))};static \u0275cmp=tt({type:i,selectors:[["app-simulation-control-panel"]],inputs:{simulationInputSignal:[1,"simulation","simulationInputSignal"]},outputs:{pauseSimulationOutput:"pauseSimulation",resumeSimulationOutput:"resumeSimulation",stopSimulationOutput:"stopSimulation",editSimulationConfigurationOutput:"editSimulationConfiguration"},decls:4,vars:3,consts:[[1,"flex-column","align-center","gap-1-rem"],[1,"flex-column","align-cross-start","gap-0-5-rem"],[3,"matTooltip"],[1,"flex-row","align-cross-start","gap-0-5-rem"],["mat-icon-button","",3,"click","matTooltip","disabled"],["mat-icon-button","",3,"click","matTooltip"]],template:function(t,r){if(t&1&&(Ri(0)(1)(2),je(3,X7e,31,19,"mat-card")),t&2){hr(r.isSimulationPausedSignal()),oe();let n=hr(r.simulationInputSignal()),a=r.isInitializedSignal();oe(2),Je(a&&n!==null?3:-1)}},dependencies:[ia,ea,ta,lX,sX,Br,Xl,pr,mr,Rn,Da,ed,qn,da],styles:[".flex-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.flex-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.align-center[_ngcontent-%COMP%], .align-main-center[_ngcontent-%COMP%]{justify-content:center}.align-center[_ngcontent-%COMP%], .align-cross-center[_ngcontent-%COMP%]{align-items:center}.align-main-end[_ngcontent-%COMP%]{justify-content:flex-end}.align-cross-end[_ngcontent-%COMP%]{align-items:flex-end}.align-main-start[_ngcontent-%COMP%]{justify-content:flex-start}.align-cross-start[_ngcontent-%COMP%]{align-items:flex-start}.align-cross-stretch[_ngcontent-%COMP%]{align-items:stretch}.gap-0-5-rem[_ngcontent-%COMP%]{gap:.5rem}.gap-1-rem[_ngcontent-%COMP%]{gap:1rem}.gap-1-5-rem[_ngcontent-%COMP%]{gap:1.5rem}.flex-1[_ngcontent-%COMP%]{flex:1}*[_ngcontent-%COMP%]{--red-text-color: #ff0000;--red-background-color: #ffdddd;--yellow-text-color: #ffc21b;--yellow-background-color: #ffe6a4;--green-text-color: #00aa00;--green-background-color: #ccffcc;--gray-text-color: #666666;--gray-background-color: #f0f0f0;--blue-text-color: #4488ff;--blue-background-color: #cce5ff;--loaded-slider-color: #005cbb88;--active-button-color: #cce6ff}.text-red[_ngcontent-%COMP%]{color:var(--red-text-color)}.background-red[_ngcontent-%COMP%]{background-color:var(--red-background-color)}.text-yellow[_ngcontent-%COMP%]{color:var(--yellow-text-color)}.background-yellow[_ngcontent-%COMP%]{background-color:var(--yellow-background-color)}.text-green[_ngcontent-%COMP%]{color:var(--green-text-color)}.background-green[_ngcontent-%COMP%]{background-color:var(--green-background-color)}.text-gray[_ngcontent-%COMP%]{color:var(--gray-text-color)}.background-gray[_ngcontent-%COMP%]{background-color:var(--gray-background-color)!important}.text-blue[_ngcontent-%COMP%]{color:var(--blue-text-color)}.background-blue[_ngcontent-%COMP%]{background-color:var(--blue-background-color)}[_nghost-%COMP%]{position:absolute;bottom:calc(75px + 1rem);right:1rem}"]})};var Q7e=["switch"],e9e=["*"];function t9e(i,e){i&1&&(Z(0,"span",10),Sr(),Z(1,"svg",12),Ge(2,"path",13),Q(),Z(3,"svg",14),Ge(4,"path",15),Q()())}var i9e=new et("mat-slide-toggle-default-options",{providedIn:"root",factory:()=>({disableToggleValue:!1,hideIcon:!1,disabledInteractive:!1})}),r9e={provide:Bn,useExisting:Fr(()=>vA),multi:!0},bA=class{source;checked;constructor(e,t){this.source=e,this.checked=t}},vA=(()=>{class i{_elementRef=te(Et);_focusMonitor=te(In);_changeDetectorRef=te(_i);defaults=te(i9e);_onChange=t=>{};_onTouched=()=>{};_validatorOnChange=()=>{};_uniqueId;_checked=!1;_createChangeEvent(t){return new bA(this,t)}_labelId;get buttonId(){return`${this.id||this._uniqueId}-button`}_switchElement;focus(){this._switchElement.nativeElement.focus()}_noopAnimations;_focused;name=null;id;labelPosition="after";ariaLabel=null;ariaLabelledby=null;ariaDescribedby;required;color;disabled=!1;disableRipple=!1;tabIndex=0;get checked(){return this._checked}set checked(t){this._checked=t,this._changeDetectorRef.markForCheck()}hideIcon;disabledInteractive;change=new ut;toggleChange=new ut;get inputId(){return`${this.id||this._uniqueId}-input`}constructor(){te(ar).load(kn);let t=te(new Ma("tabindex"),{optional:!0}),r=this.defaults,n=te(nr,{optional:!0});this.tabIndex=t==null?0:parseInt(t)||0,this.color=r.color||"accent",this._noopAnimations=n==="NoopAnimations",this.id=this._uniqueId=te(Di).getId("mat-mdc-slide-toggle-"),this.hideIcon=r.hideIcon??!1,this.disabledInteractive=r.disabledInteractive??!1,this._labelId=this._uniqueId+"-label"}ngAfterContentInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>{t==="keyboard"||t==="program"?(this._focused=!0,this._changeDetectorRef.markForCheck()):t||Promise.resolve().then(()=>{this._focused=!1,this._onTouched(),this._changeDetectorRef.markForCheck()})})}ngOnChanges(t){t.required&&this._validatorOnChange()}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef)}writeValue(t){this.checked=!!t}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}validate(t){return this.required&&t.value!==!0?{required:!0}:null}registerOnValidatorChange(t){this._validatorOnChange=t}setDisabledState(t){this.disabled=t,this._changeDetectorRef.markForCheck()}toggle(){this.checked=!this.checked,this._onChange(this.checked)}_emitChangeEvent(){this._onChange(this.checked),this.change.emit(this._createChangeEvent(this.checked))}_handleClick(){this.disabled||(this.toggleChange.emit(),this.defaults.disableToggleValue||(this.checked=!this.checked,this._onChange(this.checked),this.change.emit(new bA(this,this.checked))))}_getAriaLabelledBy(){return this.ariaLabelledby?this.ariaLabelledby:this.ariaLabel?null:this._labelId}static \u0275fac=function(r){return new(r||i)};static \u0275cmp=tt({type:i,selectors:[["mat-slide-toggle"]],viewQuery:function(r,n){if(r&1&&di(Q7e,5),r&2){let a;St(a=kt())&&(n._switchElement=a.first)}},hostAttrs:[1,"mat-mdc-slide-toggle"],hostVars:13,hostBindings:function(r,n){r&2&&(Tn("id",n.id),Mt("tabindex",null)("aria-label",null)("name",null)("aria-labelledby",null),dn(n.color?"mat-"+n.color:""),gt("mat-mdc-slide-toggle-focused",n._focused)("mat-mdc-slide-toggle-checked",n.checked)("_mat-animation-noopable",n._noopAnimations))},inputs:{name:"name",id:"id",labelPosition:"labelPosition",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],required:[2,"required","required",st],color:"color",disabled:[2,"disabled","disabled",st],disableRipple:[2,"disableRipple","disableRipple",st],tabIndex:[2,"tabIndex","tabIndex",t=>t==null?0:lr(t)],checked:[2,"checked","checked",st],hideIcon:[2,"hideIcon","hideIcon",st],disabledInteractive:[2,"disabledInteractive","disabledInteractive",st]},outputs:{change:"change",toggleChange:"toggleChange"},exportAs:["matSlideToggle"],features:[ei([r9e,{provide:ml,useExisting:i,multi:!0}]),si,rr],ngContentSelectors:e9e,decls:13,vars:27,consts:[["switch",""],["mat-internal-form-field","",3,"labelPosition"],["role","switch","type","button",1,"mdc-switch",3,"click","tabIndex","disabled"],[1,"mdc-switch__track"],[1,"mdc-switch__handle-track"],[1,"mdc-switch__handle"],[1,"mdc-switch__shadow"],[1,"mdc-elevation-overlay"],[1,"mdc-switch__ripple"],["mat-ripple","",1,"mat-mdc-slide-toggle-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered"],[1,"mdc-switch__icons"],[1,"mdc-label",3,"click","for"],["viewBox","0 0 24 24","aria-hidden","true",1,"mdc-switch__icon","mdc-switch__icon--on"],["d","M19.69,5.23L8.96,15.96l-4.23-4.23L2.96,13.5l6,6L21.46,7L19.69,5.23z"],["viewBox","0 0 24 24","aria-hidden","true",1,"mdc-switch__icon","mdc-switch__icon--off"],["d","M20 13H4v-2h16v2z"]],template:function(r,n){if(r&1){let a=vt();Pi(),Z(0,"div",1)(1,"button",2,0),Le("click",function(){return Ee(a),Ae(n._handleClick())}),Ge(3,"span",3),Z(4,"span",4)(5,"span",5)(6,"span",6),Ge(7,"span",7),Q(),Z(8,"span",8),Ge(9,"span",9),Q(),je(10,t9e,5,0,"span",10),Q()()(),Z(11,"label",11),Le("click",function(s){return Ee(a),Ae(s.stopPropagation())}),Ot(12),Q()()}if(r&2){let a=Or(2);Re("labelPosition",n.labelPosition),oe(),gt("mdc-switch--selected",n.checked)("mdc-switch--unselected",!n.checked)("mdc-switch--checked",n.checked)("mdc-switch--disabled",n.disabled)("mat-mdc-slide-toggle-disabled-interactive",n.disabledInteractive),Re("tabIndex",n.disabled&&!n.disabledInteractive?-1:n.tabIndex)("disabled",n.disabled&&!n.disabledInteractive),Mt("id",n.buttonId)("name",n.name)("aria-label",n.ariaLabel)("aria-labelledby",n._getAriaLabelledBy())("aria-describedby",n.ariaDescribedby)("aria-required",n.required||null)("aria-checked",n.checked)("aria-disabled",n.disabled&&n.disabledInteractive?"true":null),oe(8),Re("matRippleTrigger",a)("matRippleDisabled",n.disableRipple||n.disabled)("matRippleCentered",!0),oe(),Je(n.hideIcon?-1:10),oe(),Re("for",n.buttonId),Mt("id",n._labelId)}},dependencies:[Ya,_f],styles:['.mdc-switch{align-items:center;background:none;border:none;cursor:pointer;display:inline-flex;flex-shrink:0;margin:0;outline:none;overflow:visible;padding:0;position:relative;width:var(--mdc-switch-track-width, 52px)}.mdc-switch.mdc-switch--disabled{cursor:default;pointer-events:none}.mdc-switch.mat-mdc-slide-toggle-disabled-interactive{pointer-events:auto}.mdc-switch__track{overflow:hidden;position:relative;width:100%;height:var(--mdc-switch-track-height, 32px);border-radius:var(--mdc-switch-track-shape, var(--mat-sys-corner-full))}.mdc-switch--disabled.mdc-switch .mdc-switch__track{opacity:var(--mdc-switch-disabled-track-opacity, 0.12)}.mdc-switch__track::before,.mdc-switch__track::after{border:1px solid rgba(0,0,0,0);border-radius:inherit;box-sizing:border-box;content:"";height:100%;left:0;position:absolute;width:100%;border-width:var(--mat-switch-track-outline-width, 2px);border-color:var(--mat-switch-track-outline-color, var(--mat-sys-outline))}.mdc-switch--selected .mdc-switch__track::before,.mdc-switch--selected .mdc-switch__track::after{border-width:var(--mat-switch-selected-track-outline-width, 2px);border-color:var(--mat-switch-selected-track-outline-color, transparent)}.mdc-switch--disabled .mdc-switch__track::before,.mdc-switch--disabled .mdc-switch__track::after{border-width:var(--mat-switch-disabled-unselected-track-outline-width, 2px);border-color:var(--mat-switch-disabled-unselected-track-outline-color, var(--mat-sys-on-surface))}@media(forced-colors: active){.mdc-switch__track{border-color:currentColor}}.mdc-switch__track::before{transition:transform 75ms 0ms cubic-bezier(0, 0, 0.2, 1);transform:translateX(0);background:var(--mdc-switch-unselected-track-color, var(--mat-sys-surface-variant))}.mdc-switch--selected .mdc-switch__track::before{transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.6, 1);transform:translateX(100%)}[dir=rtl] .mdc-switch--selected .mdc-switch--selected .mdc-switch__track::before{transform:translateX(-100%)}.mdc-switch--selected .mdc-switch__track::before{opacity:var(--mat-switch-hidden-track-opacity, 0);transition:var(--mat-switch-hidden-track-transition, opacity 75ms)}.mdc-switch--unselected .mdc-switch__track::before{opacity:var(--mat-switch-visible-track-opacity, 1);transition:var(--mat-switch-visible-track-transition, opacity 75ms)}.mdc-switch:enabled:hover:not(:focus):not(:active) .mdc-switch__track::before{background:var(--mdc-switch-unselected-hover-track-color, var(--mat-sys-surface-variant))}.mdc-switch:enabled:focus:not(:active) .mdc-switch__track::before{background:var(--mdc-switch-unselected-focus-track-color, var(--mat-sys-surface-variant))}.mdc-switch:enabled:active .mdc-switch__track::before{background:var(--mdc-switch-unselected-pressed-track-color, var(--mat-sys-surface-variant))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__track::before,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__track::before,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__track::before,.mdc-switch.mdc-switch--disabled .mdc-switch__track::before{background:var(--mdc-switch-disabled-unselected-track-color, var(--mat-sys-surface-variant))}.mdc-switch__track::after{transform:translateX(-100%);background:var(--mdc-switch-selected-track-color, var(--mat-sys-primary))}[dir=rtl] .mdc-switch__track::after{transform:translateX(100%)}.mdc-switch--selected .mdc-switch__track::after{transform:translateX(0)}.mdc-switch--selected .mdc-switch__track::after{opacity:var(--mat-switch-visible-track-opacity, 1);transition:var(--mat-switch-visible-track-transition, opacity 75ms)}.mdc-switch--unselected .mdc-switch__track::after{opacity:var(--mat-switch-hidden-track-opacity, 0);transition:var(--mat-switch-hidden-track-transition, opacity 75ms)}.mdc-switch:enabled:hover:not(:focus):not(:active) .mdc-switch__track::after{background:var(--mdc-switch-selected-hover-track-color, var(--mat-sys-primary))}.mdc-switch:enabled:focus:not(:active) .mdc-switch__track::after{background:var(--mdc-switch-selected-focus-track-color, var(--mat-sys-primary))}.mdc-switch:enabled:active .mdc-switch__track::after{background:var(--mdc-switch-selected-pressed-track-color, var(--mat-sys-primary))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__track::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__track::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__track::after,.mdc-switch.mdc-switch--disabled .mdc-switch__track::after{background:var(--mdc-switch-disabled-selected-track-color, var(--mat-sys-on-surface))}.mdc-switch__handle-track{height:100%;pointer-events:none;position:absolute;top:0;transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1);left:0;right:auto;transform:translateX(0);width:calc(100% - var(--mdc-switch-handle-width))}[dir=rtl] .mdc-switch__handle-track{left:auto;right:0}.mdc-switch--selected .mdc-switch__handle-track{transform:translateX(100%)}[dir=rtl] .mdc-switch--selected .mdc-switch__handle-track{transform:translateX(-100%)}.mdc-switch__handle{display:flex;pointer-events:auto;position:absolute;top:50%;transform:translateY(-50%);left:0;right:auto;transition:width 75ms cubic-bezier(0.4, 0, 0.2, 1),height 75ms cubic-bezier(0.4, 0, 0.2, 1),margin 75ms cubic-bezier(0.4, 0, 0.2, 1);width:var(--mdc-switch-handle-width);height:var(--mdc-switch-handle-height);border-radius:var(--mdc-switch-handle-shape, var(--mat-sys-corner-full))}[dir=rtl] .mdc-switch__handle{left:auto;right:0}.mat-mdc-slide-toggle .mdc-switch--unselected .mdc-switch__handle{width:var(--mat-switch-unselected-handle-size, 16px);height:var(--mat-switch-unselected-handle-size, 16px);margin:var(--mat-switch-unselected-handle-horizontal-margin, 0 8px)}.mat-mdc-slide-toggle .mdc-switch--unselected .mdc-switch__handle:has(.mdc-switch__icons){margin:var(--mat-switch-unselected-with-icon-handle-horizontal-margin, 0 4px)}.mat-mdc-slide-toggle .mdc-switch--selected .mdc-switch__handle{width:var(--mat-switch-selected-handle-size, 24px);height:var(--mat-switch-selected-handle-size, 24px);margin:var(--mat-switch-selected-handle-horizontal-margin, 0 24px)}.mat-mdc-slide-toggle .mdc-switch--selected .mdc-switch__handle:has(.mdc-switch__icons){margin:var(--mat-switch-selected-with-icon-handle-horizontal-margin, 0 24px)}.mat-mdc-slide-toggle .mdc-switch__handle:has(.mdc-switch__icons){width:var(--mat-switch-with-icon-handle-size, 24px);height:var(--mat-switch-with-icon-handle-size, 24px)}.mat-mdc-slide-toggle .mdc-switch:active:not(.mdc-switch--disabled) .mdc-switch__handle{width:var(--mat-switch-pressed-handle-size, 28px);height:var(--mat-switch-pressed-handle-size, 28px)}.mat-mdc-slide-toggle .mdc-switch--selected:active:not(.mdc-switch--disabled) .mdc-switch__handle{margin:var(--mat-switch-selected-pressed-handle-horizontal-margin, 0 22px)}.mat-mdc-slide-toggle .mdc-switch--unselected:active:not(.mdc-switch--disabled) .mdc-switch__handle{margin:var(--mat-switch-unselected-pressed-handle-horizontal-margin, 0 2px)}.mdc-switch--disabled.mdc-switch--selected .mdc-switch__handle::after{opacity:var(--mat-switch-disabled-selected-handle-opacity, 1)}.mdc-switch--disabled.mdc-switch--unselected .mdc-switch__handle::after{opacity:var(--mat-switch-disabled-unselected-handle-opacity, 0.38)}.mdc-switch__handle::before,.mdc-switch__handle::after{border:1px solid rgba(0,0,0,0);border-radius:inherit;box-sizing:border-box;content:"";width:100%;height:100%;left:0;position:absolute;top:0;transition:background-color 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1),border-color 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1);z-index:-1}@media(forced-colors: active){.mdc-switch__handle::before,.mdc-switch__handle::after{border-color:currentColor}}.mdc-switch--selected:enabled .mdc-switch__handle::after{background:var(--mdc-switch-selected-handle-color, var(--mat-sys-on-primary))}.mdc-switch--selected:enabled:hover:not(:focus):not(:active) .mdc-switch__handle::after{background:var(--mdc-switch-selected-hover-handle-color, var(--mat-sys-primary-container))}.mdc-switch--selected:enabled:focus:not(:active) .mdc-switch__handle::after{background:var(--mdc-switch-selected-focus-handle-color, var(--mat-sys-primary-container))}.mdc-switch--selected:enabled:active .mdc-switch__handle::after{background:var(--mdc-switch-selected-pressed-handle-color, var(--mat-sys-primary-container))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:hover:not(:focus):not(:active) .mdc-switch__handle::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:focus:not(:active) .mdc-switch__handle::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:active .mdc-switch__handle::after,.mdc-switch--selected.mdc-switch--disabled .mdc-switch__handle::after{background:var(--mdc-switch-disabled-selected-handle-color, var(--mat-sys-surface))}.mdc-switch--unselected:enabled .mdc-switch__handle::after{background:var(--mdc-switch-unselected-handle-color, var(--mat-sys-outline))}.mdc-switch--unselected:enabled:hover:not(:focus):not(:active) .mdc-switch__handle::after{background:var(--mdc-switch-unselected-hover-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected:enabled:focus:not(:active) .mdc-switch__handle::after{background:var(--mdc-switch-unselected-focus-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected:enabled:active .mdc-switch__handle::after{background:var(--mdc-switch-unselected-pressed-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected.mdc-switch--disabled .mdc-switch__handle::after{background:var(--mdc-switch-disabled-unselected-handle-color, var(--mat-sys-on-surface))}.mdc-switch__handle::before{background:var(--mdc-switch-handle-surface-color)}.mdc-switch__shadow{border-radius:inherit;bottom:0;left:0;position:absolute;right:0;top:0}.mdc-switch:enabled .mdc-switch__shadow{box-shadow:var(--mdc-switch-handle-elevation-shadow)}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__shadow,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__shadow,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__shadow,.mdc-switch.mdc-switch--disabled .mdc-switch__shadow{box-shadow:var(--mdc-switch-disabled-handle-elevation-shadow)}.mdc-switch__ripple{left:50%;position:absolute;top:50%;transform:translate(-50%, -50%);z-index:-1;width:var(--mdc-switch-state-layer-size, 40px);height:var(--mdc-switch-state-layer-size, 40px)}.mdc-switch__ripple::after{content:"";opacity:0}.mdc-switch--disabled .mdc-switch__ripple::after{display:none}.mat-mdc-slide-toggle-disabled-interactive .mdc-switch__ripple::after{display:block}.mdc-switch:hover .mdc-switch__ripple::after{opacity:.04;transition:75ms opacity cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-slide-toggle.mat-mdc-slide-toggle-focused .mdc-switch .mdc-switch__ripple::after{opacity:.12}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:focus .mdc-switch__ripple::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:active .mdc-switch__ripple::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:hover:not(:focus) .mdc-switch__ripple::after,.mdc-switch--unselected:enabled:hover:not(:focus) .mdc-switch__ripple::after{background:var(--mdc-switch-unselected-hover-state-layer-color, var(--mat-sys-on-surface))}.mdc-switch--unselected:enabled:focus .mdc-switch__ripple::after{background:var(--mdc-switch-unselected-focus-state-layer-color, var(--mat-sys-on-surface))}.mdc-switch--unselected:enabled:active .mdc-switch__ripple::after{background:var(--mdc-switch-unselected-pressed-state-layer-color, var(--mat-sys-on-surface));opacity:var(--mdc-switch-unselected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));transition:opacity 75ms linear}.mdc-switch--selected:enabled:hover:not(:focus) .mdc-switch__ripple::after{background:var(--mdc-switch-selected-hover-state-layer-color, var(--mat-sys-primary))}.mdc-switch--selected:enabled:focus .mdc-switch__ripple::after{background:var(--mdc-switch-selected-focus-state-layer-color, var(--mat-sys-primary))}.mdc-switch--selected:enabled:active .mdc-switch__ripple::after{background:var(--mdc-switch-selected-pressed-state-layer-color, var(--mat-sys-primary));opacity:var(--mdc-switch-selected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));transition:opacity 75ms linear}.mdc-switch__icons{position:relative;height:100%;width:100%;z-index:1}.mdc-switch--disabled.mdc-switch--unselected .mdc-switch__icons{opacity:var(--mdc-switch-disabled-unselected-icon-opacity, 0.38)}.mdc-switch--disabled.mdc-switch--selected .mdc-switch__icons{opacity:var(--mdc-switch-disabled-selected-icon-opacity, 0.38)}.mdc-switch__icon{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0;opacity:0;transition:opacity 30ms 0ms cubic-bezier(0.4, 0, 1, 1)}.mdc-switch--unselected .mdc-switch__icon{width:var(--mdc-switch-unselected-icon-size, 16px);height:var(--mdc-switch-unselected-icon-size, 16px);fill:var(--mdc-switch-unselected-icon-color, var(--mat-sys-surface-variant))}.mdc-switch--unselected.mdc-switch--disabled .mdc-switch__icon{fill:var(--mdc-switch-disabled-unselected-icon-color, var(--mat-sys-surface-variant))}.mdc-switch--selected .mdc-switch__icon{width:var(--mdc-switch-selected-icon-size, 16px);height:var(--mdc-switch-selected-icon-size, 16px);fill:var(--mdc-switch-selected-icon-color, var(--mat-sys-on-primary-container))}.mdc-switch--selected.mdc-switch--disabled .mdc-switch__icon{fill:var(--mdc-switch-disabled-selected-icon-color, var(--mat-sys-on-surface))}.mdc-switch--selected .mdc-switch__icon--on,.mdc-switch--unselected .mdc-switch__icon--off{opacity:1;transition:opacity 45ms 30ms cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-slide-toggle{-webkit-user-select:none;user-select:none;display:inline-block;-webkit-tap-highlight-color:rgba(0,0,0,0);outline:0}.mat-mdc-slide-toggle .mat-mdc-slide-toggle-ripple,.mat-mdc-slide-toggle .mdc-switch__ripple::after{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:50%;pointer-events:none}.mat-mdc-slide-toggle .mat-mdc-slide-toggle-ripple:not(:empty),.mat-mdc-slide-toggle .mdc-switch__ripple::after:not(:empty){transform:translateZ(0)}.mat-mdc-slide-toggle.mat-mdc-slide-toggle-focused .mat-focus-indicator::before{content:""}.mat-mdc-slide-toggle .mat-internal-form-field{color:var(--mat-switch-label-text-color, var(--mat-sys-on-surface));font-family:var(--mat-switch-label-text-font, var(--mat-sys-body-medium-font));line-height:var(--mat-switch-label-text-line-height, var(--mat-sys-body-medium-line-height));font-size:var(--mat-switch-label-text-size, var(--mat-sys-body-medium-size));letter-spacing:var(--mat-switch-label-text-tracking, var(--mat-sys-body-medium-tracking));font-weight:var(--mat-switch-label-text-weight, var(--mat-sys-body-medium-weight))}.mat-mdc-slide-toggle .mat-ripple-element{opacity:.12}.mat-mdc-slide-toggle .mat-focus-indicator::before{border-radius:50%}.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle-track,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__icon,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle::before,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle::after,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__track::before,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__track::after{transition:none}.mat-mdc-slide-toggle .mdc-switch:enabled+.mdc-label{cursor:pointer}.mat-mdc-slide-toggle .mdc-switch--disabled+label{color:var(--mdc-switch-disabled-label-text-color)}'],encapsulation:2,changeDetection:0})}return i})();var ume=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275mod=Lt({type:i});static \u0275inj=Dt({imports:[vA,ti,ti]})}return i})();function a9e(i,e){if(i&1){let t=vt();Z(0,"li")(1,"mat-chip-option",10),Le("click",function(){let n=Ee(t).$implicit;Se();let a=fi(9);return Ae(a.toggleFilter(n))}),ce(2),Q()()}if(i&2){let t=e.$implicit,r=Se(),n=fi(6);oe(),Re("selected",!r.filters().has(t))("disabled",r.filters().has(n)),oe(),_t(" ",t," ")}}var SA=class i{constructor(e,t){this.visualizationFilterService=e;this.animationService=t;this.filters=e.filters,this.vehicleModes=e.vehicleModes,this.animationService.setFilterMode("all")}filters;vehicleModes;onRadioChange(e){this.animationService.setFilterMode(e.value)}onShouldShowCompleteChange(e){this.animationService.setShouldShowComplete(e.checked)}static \u0275fac=function(t){return new(t||i)(rt(Cd),rt(Mr))};static \u0275cmp=tt({type:i,selectors:[["app-visualizer-filter"]],decls:28,vars:7,consts:[["appearance","outlined"],[1,"title"],[1,"content"],[1,"entity-filters"],[3,"click","selected"],["vertical",""],["aria-label","Select a global filter",1,"radio-group",3,"change"],["checked","","value","all"],["value","favorites"],[3,"change"],[3,"click","selected","disabled"]],template:function(t,r){if(t&1){let n=vt();Z(0,"mat-card",0)(1,"mat-card-content")(2,"p",1),ce(3,"Entity Filters"),Q(),Z(4,"div",2)(5,"section",3),Ri(6)(7)(8)(9),Z(10,"mat-chip-option",4),Le("click",function(){Ee(n);let o=fi(7),s=fi(9);return Ae(s.toggleFilter(o))}),ce(11,"Passengers"),Q(),Z(12,"mat-chip-option",4),Le("click",function(){Ee(n);let o=fi(8),s=fi(9);return Ae(s.toggleFilter(o))}),ce(13,"Stops"),Q(),Z(14,"mat-chip-option",4),Le("click",function(){Ee(n);let o=fi(6),s=fi(9);return Ae(s.toggleFilter(o))}),ce(15,"Vehicles"),Q(),Z(16,"ul"),ui(17,a9e,3,3,"li",null,Ea),Q()(),Ge(19,"mat-divider",5),Z(20,"section")(21,"mat-radio-group",6),Le("change",function(o){return Ee(n),Ae(r.onRadioChange(o))}),Z(22,"mat-radio-button",7),ce(23,"All"),Q(),Z(24,"mat-radio-button",8),ce(25,"Favorites"),Q()(),Z(26,"mat-slide-toggle",9),Le("change",function(o){return Ee(n),Ae(r.onShouldShowCompleteChange(o))}),ce(27,"Show complete"),Q()()()()()}if(t&2){oe(6);let n=hr("vehicle");oe();let a=hr("passenger");oe();let o=hr("stops");oe(),hr(r.visualizationFilterService),oe(),Re("selected",!r.filters().has(a)),oe(2),Re("selected",!r.filters().has(o)),oe(2),Re("selected",!r.filters().has(n)),oe(3),hi(r.vehicleModes())}},dependencies:[ia,ea,ta,tc,Uw,Hb,Lf,qn,zb,Ah,Kw,ume,vA],styles:["p[_ngcontent-%COMP%]{margin:0}.title[_ngcontent-%COMP%]{font:var(--mat-sys-body-medium);margin-top:0;margin-bottom:10px}.content[_ngcontent-%COMP%]{display:flex;gap:10px}.entity-filters[_ngcontent-%COMP%]{display:flex;flex-direction:column}mat-chip-option[_ngcontent-%COMP%]{margin-bottom:10px}ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:last-child mat-chip-option[_ngcontent-%COMP%]{margin-bottom:0}ul[_ngcontent-%COMP%]{width:fit-content;margin-left:auto;list-style-type:none;padding-left:20px;margin-top:0;margin-bottom:0}.radio-group[_ngcontent-%COMP%]{display:flex;flex-direction:column}[_nghost-%COMP%] .mat-mdc-radio-button .mdc-radio{scale:.8;padding:5px}"]})};var kA=class i{_shouldShowInformationPanelSignal=Bt(!1);get shouldShowInformationPanelSignal(){return this._shouldShowInformationPanelSignal}showInformationPanel(){this._shouldShowInformationPanelSignal.set(!0)}hideInformationPanel(){this._shouldShowInformationPanelSignal.set(!1)}static \u0275fac=function(t){return new(t||i)};static \u0275prov=lt({token:i,factory:i.\u0275fac,providedIn:"root"})};var s9e=["searchInput"],l9e=(i,e)=>e.displayedValue;function c9e(i,e){i&1&&ce(0),i&2&&_t(" Filtering vehicles of mode: ",e," ")}function u9e(i,e){i&1&&ce(0," Search in the simulation ")}function h9e(i,e){if(i&1){let t=vt();Z(0,"button",29),Le("click",function(){Ee(t);let n=Se(3);return Ae(n.clearSearch())}),Z(1,"mat-icon"),ce(2,"close"),Q()()}}function d9e(i,e){i&1&&(Z(0,"mat-icon",26),ce(1,"search"),Q())}function m9e(i,e){if(i&1&&(Z(0,"mat-option",28),ce(1),Q()),i&2){let t=e.$implicit;Re("value",t),oe(),_t(" ",t.displayedValue," ")}}function p9e(i,e){if(i&1){let t=vt();Z(0,"form",22),Ri(1)(2),Z(3,"mat-form-field",23)(4,"input",24,0),Le("click",function(){Ee(t);let n=Se(2);return Ae(n.onSearchInputClick())}),Q(),Z(6,"mat-label"),je(7,c9e,1,1)(8,u9e,1,0),Q(),je(9,h9e,3,0,"button",25)(10,d9e,2,0,"mat-icon",26),Z(11,"mat-autocomplete",27,1),ui(13,m9e,2,2,"mat-option",28,l9e),Q()()()}if(i&2){let t,r=Or(12),n=Se(2);gt("fade-show",n.showSearch)("enable-pointer-events",n.showSearch);let a=n.filteredEntitySearchDataSignal(),o=n.searchValueSignal();oe(4),Re("matAutocomplete",r)("formControl",n.searchControl),oe(3),Je((t=n.selectedModeSignal())?7:8,t),oe(2),Je(o!==null&&o!==""?9:10),oe(2),Re("displayWith",n.entitySearchDisplayFunction),oe(2),hi(a)}}function f9e(i,e){if(i&1&&Ge(0,"app-favorite-entities",10),i&2){let t=Se(2);gt("fade-show",t.showFavorites)("enable-pointer-events",t.showFavorites)}}function g9e(i,e){if(i&1&&(Z(0,"mat-card",30)(1,"mat-card-content",31)(2,"mat-card-title"),ce(3,"Simulation information"),Q(),Z(4,"div",32)(5,"mat-card")(6,"mat-card-content")(7,"b"),ce(8,"Visualization name:"),Q(),ce(9),Q()(),Z(10,"mat-card")(11,"mat-card-content")(12,"b"),ce(13,"Source:"),Q(),ce(14),Q()(),Z(15,"mat-card")(16,"mat-card-content")(17,"b"),ce(18,"Id:"),Q(),ce(19),Q()()()()()),i&2){let t=Se(2),r=fi(0);gt("fade-show",t.showSimulationInformation)("enable-pointer-events",t.showSimulationInformation),oe(9),_t(" ",r.name," "),oe(5),_t(" ",r.data," "),oe(5),_t(" ",r.id," ")}}function y9e(i,e){if(i&1&&(Z(0,"mat-card",30)(1,"mat-card-content",31)(2,"mat-card-title"),ce(3," Statistics "),Q(),Ge(4,"app-recursive-statistics",33),Q()()),i&2){let t=Se(2),r=fi(1);gt("fade-show",t.showStatistics)("enable-pointer-events",t.showStatistics),oe(4),Re("recursiveDict",r)}}function _9e(i,e){if(i&1&&(Z(0,"mat-card",30)(1,"mat-card-content",31)(2,"mat-card-title"),ce(3," Entities "),Q(),Ge(4,"app-entities-tab"),Q()()),i&2){let t=Se(2);gt("fade-show",t.showEntitiesTab)("enable-pointer-events",t.showEntitiesTab)}}function b9e(i,e){if(i&1&&(Z(0,"mat-card",30)(1,"mat-card-content",31),Ge(2,"app-selected-entity-tab",34),Q()()),i&2){let t=Se(2),r=fi(2),n=fi(3),a=fi(4);gt("fade-show",t.showSelectedEntityTab)("enable-pointer-events",t.showSelectedEntityTab),oe(2),Re("selectedPassenger",r)("selectedPassengerStop",t.selectedPassengerStopSignal())("selectedPassengerVehicle",t.selectedPassengerVehicleSignal())("selectedVehicle",n)("selectedVehicleStop",t.selectedVehicleStopSignal())("selectedVehiclePassengers",t.selectedVehiclePassengersSignal())("selectedStop",a)("selectedStopWaitingPassengers",t.selectedStopWaitingPassengersSignal())("selectedStopCompletedPassengers",t.selectedStopCompletedPassengersSignal())("selectedStopVehicles",t.selectedStopVehiclesSignal())}}function v9e(i,e){if(i&1){let t=vt();Z(0,"app-simulation-control-panel",35),Le("pauseSimulation",function(n){Ee(t);let a=Se(2);return Ae(a.pauseSimulation(n))})("resumeSimulation",function(n){Ee(t);let a=Se(2);return Ae(a.resumeSimulation(n))})("stopSimulation",function(n){Ee(t);let a=Se(2);return Ae(a.stopSimulation(n))})("editSimulationConfiguration",function(n){Ee(t);let a=Se(2);return Ae(a.editSimulationConfiguration(n))}),Q()}if(i&2){Se(2);let t=fi(0);Re("simulation",t)}}function S9e(i,e){i&1&&(Z(0,"mat-chip",21)(1,"div",36)(2,"mat-icon",37),ce(3,"autorenew"),Q(),ce(4," Loading visualization data... "),Q()())}function k9e(i,e){if(i&1){let t=vt();Z(0,"div",2)(1,"section")(2,"mat-button-toggle-group",3)(3,"mat-button-toggle",4)(4,"mat-icon"),ce(5,"search"),Q()(),Z(6,"mat-button-toggle",5)(7,"mat-icon"),ce(8,"filter_list"),Q()(),Z(9,"mat-button-toggle",6)(10,"mat-icon"),ce(11,"star"),Q()(),Z(12,"mat-button-toggle",7)(13,"mat-icon"),ce(14,"history"),Q()(),Z(15,"mat-button-toggle",8)(16,"mat-icon"),ce(17,"layers"),Q()()()()(),je(18,p9e,15,9,"form",9),Ge(19,"app-visualizer-filter",10),je(20,f9e,1,4,"app-favorite-entities",11),Ge(21,"app-click-history",10)(22,"app-map-tiles",10),Z(23,"div",12)(24,"section")(25,"mat-button-toggle-group",13)(26,"mat-button-toggle",14)(27,"mat-icon"),ce(28,"info"),Q()(),Z(29,"mat-button-toggle",15)(30,"mat-icon"),ce(31,"bar_chart"),Q()(),Z(32,"mat-button-toggle",16)(33,"mat-icon"),ce(34,"groups"),Q()(),Z(35,"mat-button-toggle",17)(36,"mat-icon"),ce(37,"touch_app"),Q()()()()(),je(38,g9e,20,7,"mat-card",18)(39,y9e,5,5,"mat-card",18)(40,_9e,5,4,"mat-card",18)(41,b9e,3,14,"mat-card",18),Z(42,"app-simulation-control-bar",19),Le("leaveVisualization",function(){Ee(t);let n=Se();return Ae(n.leaveVisualization())}),Q(),Ri(43),je(44,v9e,1,1,"app-simulation-control-panel",20),Ri(45),je(46,S9e,5,0,"mat-chip",21)}if(i&2){let t=Se(),r=fi(0),n=fi(2),a=fi(3),o=fi(4);oe(2),Re("formControl",t.tabControl),oe(16),Je(t.showSearch?18:-1),oe(),gt("fade-show",t.showFilter)("enable-pointer-events",t.showFilter),oe(),Je(t.showFavorites?20:-1),oe(),gt("fade-show",t.showClickHistory)("enable-pointer-events",t.showClickHistory),oe(),gt("fade-show",t.showLayers)("enable-pointer-events",t.showLayers),oe(3),Re("formControl",t.informationTabControl),oe(),Re("matTooltip","Information panel"),oe(3),Re("matTooltip","Statistics panel"),oe(3),Re("matTooltip","Entities panel"),oe(3),Re("disabled",n===null&&a===null&&o===null)("matTooltip","Selected entity panel"),oe(3),Je(t.showSimulationInformation?38:-1),oe(),Je(t.showStatistics?39:-1),oe(),Je(t.showEntitiesTab?40:-1),oe(),Je(t.showSelectedEntityTab?41:-1),oe(),Re("simulation",r);let s=t.isSimulationRunningSignal();oe(2),Je(s?44:-1);let l=t.isLoadingSignal();oe(2),Je(l?46:-1)}}var xA=class i{constructor(e,t,r,n,a,o,s,l,c,u,h){this.simulationService=e;this.userInterfaceService=t;this.router=r;this.communicationService=n;this.dialogService=a;this.animationService=o;this.loadingService=s;this.visualizationService=l;this.formBuilder=c;this.visualizationFilterService=u;this.taskService=h;this.tabControl=new Ql(""),this.tabControl.valueChanges.subscribe(d=>{let p=d;if(p.length>1){let g=p[p.length-1];this.tabControl.setValue([g]);return}let f=p[0];this.showSearch=!1,this.showFilter=!1,this.showFavorites=!1,this.showClickHistory=!1,this.showLayers=!1,f==="search"?this.showSearch=!0:f==="filter"?this.showFilter=!0:f==="favorites"?this.showFavorites=!0:f==="history"?this.showClickHistory=!0:f==="layers"&&(this.showLayers=!0)}),this.informationTabControl=new Ql([""]),this.informationTabControl.valueChanges.subscribe(d=>{if(this.informationTabControl.value!==null){if(this.informationTabControl.value.length>1){this.informationTabControl.setValue([this.informationTabControl.value[this.informationTabControl.value.length-1]]);return}this.showSimulationInformation=this.informationTabControl.value[0]==="information",this.showStatistics=this.informationTabControl.value[0]==="statistics",this.showEntitiesTab=this.informationTabControl.value[0]==="entities",this.showSelectedEntityTab=this.informationTabControl.value[0]==="selectedEntity"}}),this.searchControl=this.formBuilder.control(""),this.searchControl.valueChanges.subscribe(d=>{this.searchValueSignal.set(d??"")}),Ji(()=>{let d=this.animationService.preselectedEntitySignal(),p=this.selectedPassengerSignal(),f=this.selectedVehicleSignal(),g=this.selectedStopSignal();this.showSelectedEntityTab&&p===null&&f===null&&g===null?this.informationTabControl.setValue([""]):!this.showSelectedEntityTab&&(p!==null||f!==null||g!==null)&&(d===null||d.shouldShowSelectedEntityTab)&&this.informationTabControl.setValue(["selectedEntity"])}),Ji(()=>{let d=this.searchValueSignal();JSON.stringify(d)!==JSON.stringify(this.previousSearchValue)&&(this.previousSearchValue=d,!(d===null||typeof d=="string")&&(d.type==="passenger"?(this.animationService.selectEntity(d.entity),this.selectedModeSignal.set(null)):d.type==="vehicle"?(this.animationService.selectEntity(d.entity),this.selectedModeSignal.set(null)):d.type==="mode"&&(this.selectedModeSignal.set(d.entity.mode),this.searchControl.setValue(d,{emitEvent:!1}),setTimeout(()=>{this.searchInput.nativeElement.click()}))))}),Ji(()=>{let d=this.visualizationService.isVisualizationPausedSignal();this.animationService.setPause(d)}),Ji(()=>{let d=this.selectedPassengerSignal(),p=this.selectedVehicleSignal(),f=this.entitySearchDataSignal(),g=d||p;if(g){let _=d?"passenger":"vehicle",b=f.find(S=>S.type===_&&S.id===g.id);if(b){this.searchControl.value!==b&&this.searchControl.setValue(b,{emitEvent:!1});return}}this.searchControl.value&&typeof this.searchControl.value!="string"&&this.searchControl.setValue("",{emitEvent:!1})}),Ji(()=>{let d=this.visualizerStatusSignal();if(this.matDialogRef){let p=this.matDialogRef;this.matDialogRef=null,p.close(null)}switch(this.loadingService.stop(),d){case"disconnected":case"running":case"paused":case"completed":case"stopping":return;case"starting":this.loadingService.start("Starting simulation...");return;case"not-found":this.matDialogRef=this.dialogService.openInformationDialog({title:"Simulation not found",message:"The simulation you are trying to visualize is not available for now. Please verify the URL.",type:"error",confirmButtonOverride:"Back to home",cancelButtonOverride:null,canCancel:!1}),hn(this.matDialogRef.afterClosed()).then(p=>Ce(this,null,function*(){p!==null&&(yield this.router.navigate(["home"]))})).catch(console.error);return;case"lost":this.matDialogRef=this.dialogService.openInformationDialog({title:"Simulation lost",message:"The simulation you are trying to visualize has been disconnected from the server. You can continue the visualization or go back to the home page.",type:"error",confirmButtonOverride:"Back to home",cancelButtonOverride:"Stay here",canCancel:!0}),hn(this.matDialogRef.afterClosed()).then(p=>Ce(this,null,function*(){p&&(yield this.router.navigate(["home"]))})).catch(console.error);return;case"corrupted":this.matDialogRef=this.dialogService.openInformationDialog({title:"Simulation corrupted",message:"The file containing the simulation data is corrupted.",type:"error",confirmButtonOverride:"Back to home",cancelButtonOverride:null,canCancel:!1}),hn(this.matDialogRef.afterClosed()).then(p=>Ce(this,null,function*(){p!==null&&(yield this.router.navigate(["home"]))})).catch(console.error);return;case"outdated":this.matDialogRef=this.dialogService.openInformationDialog({title:"Unsupported simulation version",message:"The version of the file containing the simulation data is too old for this version of the application.",type:"error",confirmButtonOverride:"Back to home",cancelButtonOverride:null,canCancel:!1}),hn(this.matDialogRef.afterClosed()).then(p=>Ce(this,null,function*(){p!==null&&(yield this.router.navigate(["home"]))})).catch(console.error);return;case"future":this.matDialogRef=this.dialogService.openInformationDialog({title:"Unsupported simulation version",message:"The version of the file containing the simulation data is too recent for this version of the application.",type:"error",confirmButtonOverride:"Back to home",cancelButtonOverride:null,canCancel:!1}),hn(this.matDialogRef.afterClosed()).then(p=>Ce(this,null,function*(){p!==null&&(yield this.router.navigate(["home"]))})).catch(console.error)}}),Ji(()=>{let d=this.visualizerStatusSignal(),p=this.simulationSignal();if(p)switch(d){case"running":case"paused":case"completed":case"starting":case"stopping":case"lost":this.visualizationService.init(p);return;default:this.visualizationService.destroy()}})}searchInput;matDialogRef=null;selectedModeSignal=Bt(null);visualizerStatusSignal=$t(()=>{if(!this.communicationService.isConnectedSignal())return"disconnected";let t=this.simulationSignal();return t?t.status:"not-found"});selectedPassengerSignal=$t(()=>{let e=this.visualizationService.environmentSignal();if(e===null)return null;let t=this.animationService.preselectedEntitySignal();if(t!==null&&t.shouldShowSelectedEntityTab&&t.entityType!=="passenger")return null;let r=null;if(t!==null&&t.shouldShowSelectedEntityTab)r=t.id;else{let n=this.animationService.selectedEntitySignal();n!==null&&n.entityType==="passenger"&&(r=n.id)}return r==null?null:e.passengers[r]??null});selectedVehicleSignal=$t(()=>{let e=this.visualizationService.environmentSignal();if(e===null)return null;let t=this.animationService.preselectedEntitySignal();if(t!==null&&t.shouldShowSelectedEntityTab&&t.entityType!=="vehicle")return null;let r=null;if(t!==null&&t.shouldShowSelectedEntityTab)r=t.id;else{let n=this.animationService.selectedEntitySignal();n!==null&&n.entityType==="vehicle"&&(r=n.id)}return r==null?null:e.vehicles[r]??null});selectedStopSignal=$t(()=>{let e=this.visualizationService.environmentSignal();if(e===null)return null;let t=this.animationService.preselectedEntitySignal();if(t!==null&&t.shouldShowSelectedEntityTab&&t.entityType!=="stop")return null;let r=null;if(t!==null&&t.shouldShowSelectedEntityTab)r=t.id;else{let n=this.animationService.selectedEntitySignal();n!==null&&n.entityType==="stop"&&(r=n.id)}return r==null?null:e.stops[r]??null});selectedPassengerVehicleSignal=$t(()=>{let e=this.visualizationService.environmentSignal();if(e===null)return null;let t=this.selectedPassengerSignal();if(t===null)return null;let r=R$(t,e.timestamp);return r===null?null:e.vehicles[r]??null});selectedPassengerStopSignal=$t(()=>{let e=this.visualizationService.environmentSignal();if(e===null)return null;let t=this.selectedPassengerSignal();if(t===null)return null;let r=B$(t,e.timestamp);if(r===null)return null;let{stopId:n,vehicleId:a}=r,o=e.vehicles[a];if(o===void 0)return null;let l=Bl(o).find(c=>c.id===n);return l===void 0?null:l});selectedVehiclePassengersSignal=$t(()=>{let e=this.visualizationService.environmentSignal();if(e===null)return[];let t=this.selectedVehicleSignal();return t===null?[]:Object.values(e.passengers).filter(n=>L$(n,t.id,e.timestamp))});selectedVehicleStopSignal=$t(()=>{if(this.visualizationService.environmentSignal()===null)return null;let t=this.selectedVehicleSignal();return t===null||t.currentStop===null?null:t.currentStop});selectedStopPassengersSignal=$t(()=>{let e=this.visualizationService.environmentSignal();if(e===null)return[];let t=this.selectedStopSignal();return t===null?[]:Object.values(e.passengers).filter(n=>D$(n,t.id,e.timestamp))});selectedStopWaitingPassengersSignal=$t(()=>this.selectedStopPassengersSignal().filter(t=>t.status!=="complete"));selectedStopCompletedPassengersSignal=$t(()=>this.selectedStopPassengersSignal().filter(t=>t.status==="complete"));selectedStopVehiclesSignal=$t(()=>{let e=this.visualizationService.environmentSignal();if(e===null)return[];let t=this.selectedStopSignal();return t===null?[]:Object.values(e.vehicles).filter(n=>n.currentStop!==null&&n.currentStop.id===t.id)});entitySearchDataSignal=$t(()=>{let e=this.visualizationService.environmentSignal();if(e===null)return[];let t=Object.values(e.passengers).map(n=>({id:n.id,displayedValue:`[PASSENGER] ${n.name+" ("+n.id+")"}`,type:"passenger",entity:n})),r=Object.values(e.vehicles).map(n=>({id:n.id,displayedValue:`[VEHICLE] ${n.id}`,type:"vehicle",entity:n}));return[...t,...r]});tabControl;showSearch=!1;showFilter=!1;showFavorites=!1;showClickHistory=!1;showLayers=!1;informationTabControl;showSimulationInformation=!1;showStatistics=!1;showEntitiesTab=!1;showSelectedEntityTab=!1;previousSearchValue=null;searchValueSignal=Bt("",{equal:(e,t)=>JSON.stringify(e)===JSON.stringify(t)});searchControl;filteredEntitySearchDataSignal=$t(()=>{let e=this.searchValueSignal(),t=this.entitySearchDataSignal(),r=this.visualizationFilterService.vehicleModes(),n=this.selectedModeSignal(),a=n!==null?t.filter(o=>o.type==="vehicle"&&o.entity.mode===n):t;if(e===""||typeof e=="object"&&e.type==="mode")return a;if(typeof e=="string"){if(e.toLowerCase().startsWith("mode:")){let s=e.substring(5).trim().toLowerCase();return r.filter(l=>l.toLowerCase().includes(s)).map(l=>({id:`mode:${l}`,displayedValue:`[MODE] ${l}`,type:"mode",entity:{mode:l}}))}let o=e.toLowerCase();return a.filter(s=>{if(s.type==="passenger"){let l=s.entity;return s.displayedValue.toLowerCase().includes(o)||l.name.toLowerCase().includes(o)}return s.displayedValue.toLowerCase().includes(o)})}return[e]});isSimulationRunningSignal=$t(()=>{let e=this.simulationSignal();return e!==null&&Bu.includes(e.status)});entitySearchDisplayFunction=e=>e?.displayedValue??"";ngOnDestroy(){this.visualizationService.destroy()}get statisticsSignal(){return $t(()=>{let e=this.visualizationService.environmentSignal();return e?e.statistics:{}})}get shouldShowInformationPanelSignal(){return this.userInterfaceService.shouldShowInformationPanelSignal}get isInitializedSignal(){return this.visualizationService.isInitializedSignal}get simulationSignal(){return this.simulationService.activeSimulationSignal}get isLoadingSignal(){return this.visualizationService.isLoadingSignal}clearSearch(){this.selectedModeSignal.set(null),this.searchControl.setValue(null)}pauseSimulation(e){this.simulationService.pauseSimulation(e)}resumeSimulation(e){this.simulationService.resumeSimulation(e)}stopSimulation(e){return Ce(this,null,function*(){(yield hn(this.dialogService.openInformationDialog({title:"Stopping Simulation",message:"Are you sure you want to stop the simulation? This action cannot be undone.",type:"warning",confirmButtonOverride:null,cancelButtonOverride:null,canCancel:!0}).afterClosed()))&&this.simulationService.stopSimulation(e)})}editSimulationConfiguration(e){return Ce(this,null,function*(){let t=yield hn(this.dialogService.openSimulationConfigurationDialog({mode:"edit",currentConfiguration:e.configuration}).afterClosed());t&&this.simulationService.editSimulationConfiguration(e.id,t.configuration.maxDuration)})}leaveVisualization(){return Ce(this,null,function*(){yield this.router.navigate(["home"])})}onSearchInputClick(){let e=this.searchValueSignal();typeof e=="object"&&e.type==="mode"||(this.searchControl.setValue(null),this.animationService.unselectEntity())}static \u0275fac=function(t){return new(t||i)(rt(Ha),rt(kA),rt(rf),rt(To),rt(Js),rt(Mr),rt(ty),rt(Ln),rt(wf),rt(Cd),rt(nd))};static \u0275cmp=tt({type:i,selectors:[["app-visualizer"]],viewQuery:function(t,r){if(t&1&&di(s9e,5),t&2){let n;St(n=kt())&&(r.searchInput=n.first)}},features:[ei([Ln,Cd])],decls:6,vars:6,consts:[["searchInput",""],["auto","matAutocomplete"],[1,"tabs","enable-pointer-events"],["mat-fab","","multiple","","hideMultipleSelectionIndicator","","name","tools","aria-label","tools",3,"formControl"],["value","search"],["value","filter"],["value","favorites"],["value","history"],["value","layers"],[1,"tab-content","fade","search-bar",3,"fade-show","enable-pointer-events"],[1,"tab-content","fade"],[1,"tab-content","fade",3,"fade-show","enable-pointer-events"],[1,"enable-pointer-events","information-panel-header"],["mat-fab","","multiple","","hideMultipleSelectionIndicator","","name","tools","aria-label","tools",1,".information-group",3,"formControl"],["value","information",3,"matTooltip"],["value","statistics",3,"matTooltip"],["value","entities",3,"matTooltip"],["value","selectedEntity",3,"disabled","matTooltip"],[1,"information-panel-content","fade",3,"fade-show","enable-pointer-events"],[1,"enable-pointer-events",3,"leaveVisualization","simulation"],[1,"enable-pointer-events",3,"simulation"],[1,"loading","background-gray","text-gray","enable-pointer-events"],[1,"tab-content","fade","search-bar"],[1,"search-form"],["matInput","",3,"click","matAutocomplete","formControl"],["mat-icon-button","","matSuffix","","type","button"],["matSuffix",""],[3,"displayWith"],[3,"value"],["mat-icon-button","","matSuffix","","type","button",3,"click"],[1,"information-panel-content","fade"],[1,"flex-1"],[1,"mat-card-group"],[3,"recursiveDict"],[3,"selectedPassenger","selectedPassengerStop","selectedPassengerVehicle","selectedVehicle","selectedVehicleStop","selectedVehiclePassengers","selectedStop","selectedStopWaitingPassengers","selectedStopCompletedPassengers","selectedStopVehicles"],[1,"enable-pointer-events",3,"pauseSimulation","resumeSimulation","stopSimulation","editSimulationConfiguration","simulation"],[1,"flex-row","align-center","gap-0-5-rem"],[1,"spin"]],template:function(t,r){if(t&1&&(Ri(0)(1)(2)(3)(4),je(5,k9e,47,28)),t&2){let n=hr(r.simulationSignal());oe(),hr(r.statisticsSignal()),oe(),hr(r.selectedPassengerSignal()),oe(),hr(r.selectedVehicleSignal()),oe(),hr(r.selectedStopSignal()),oe(),Je(r.isInitializedSignal()&&n!==null?5:-1)}},dependencies:[yA,SA,lA,oA,cA,ia,ea,ta,bM,Br,Xl,ha,ac,zs,Rw,pr,mr,So,qo,qn,da,Rn,Da,rX,tX,$l,DI,Rs,wh,Ps,ec,xh,Mb,_A,kc,oX,LI,_M,pX,uA,sA,mA],styles:[".flex-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.flex-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.align-center[_ngcontent-%COMP%], .align-main-center[_ngcontent-%COMP%]{justify-content:center}.align-center[_ngcontent-%COMP%], .align-cross-center[_ngcontent-%COMP%]{align-items:center}.align-main-end[_ngcontent-%COMP%]{justify-content:flex-end}.align-cross-end[_ngcontent-%COMP%]{align-items:flex-end}.align-main-start[_ngcontent-%COMP%]{justify-content:flex-start}.align-cross-start[_ngcontent-%COMP%]{align-items:flex-start}.align-cross-stretch[_ngcontent-%COMP%]{align-items:stretch}.gap-0-5-rem[_ngcontent-%COMP%]{gap:.5rem}.gap-1-rem[_ngcontent-%COMP%]{gap:1rem}.gap-1-5-rem[_ngcontent-%COMP%]{gap:1.5rem}.flex-1[_ngcontent-%COMP%]{flex:1}*[_ngcontent-%COMP%]{--red-text-color: #ff0000;--red-background-color: #ffdddd;--yellow-text-color: #ffc21b;--yellow-background-color: #ffe6a4;--green-text-color: #00aa00;--green-background-color: #ccffcc;--gray-text-color: #666666;--gray-background-color: #f0f0f0;--blue-text-color: #4488ff;--blue-background-color: #cce5ff;--loaded-slider-color: #005cbb88;--active-button-color: #cce6ff}.text-red[_ngcontent-%COMP%]{color:var(--red-text-color)}.background-red[_ngcontent-%COMP%]{background-color:var(--red-background-color)}.text-yellow[_ngcontent-%COMP%]{color:var(--yellow-text-color)}.background-yellow[_ngcontent-%COMP%]{background-color:var(--yellow-background-color)}.text-green[_ngcontent-%COMP%]{color:var(--green-text-color)}.background-green[_ngcontent-%COMP%]{background-color:var(--green-background-color)}.text-gray[_ngcontent-%COMP%]{color:var(--gray-text-color)}.background-gray[_ngcontent-%COMP%]{background-color:var(--gray-background-color)!important}.text-blue[_ngcontent-%COMP%]{color:var(--blue-text-color)}.background-blue[_ngcontent-%COMP%]{background-color:var(--blue-background-color)}[_nghost-%COMP%], .no-simulation[_ngcontent-%COMP%]{display:block;width:100%;height:100%;position:absolute;top:0;left:0;z-index:500}.no-simulation[_ngcontent-%COMP%]{background-color:#00000052}.no-simulation[_ngcontent-%COMP%] mat-card[_ngcontent-%COMP%]{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:500px;max-width:80vw}.no-simulation[_ngcontent-%COMP%] mat-card[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{min-width:24px}.disable-pointer-events[_ngcontent-%COMP%], [_nghost-%COMP%]{pointer-events:none}.enable-pointer-events[_ngcontent-%COMP%]{pointer-events:auto}.fade[_ngcontent-%COMP%]{opacity:0;transition:opacity .1s ease-in-out}.fade-show[_ngcontent-%COMP%]{opacity:1}.tabs[_ngcontent-%COMP%]{position:absolute;top:1rem;right:1rem}.tab-content[_ngcontent-%COMP%]{position:absolute;top:4rem;right:1rem}.mat-button-toggle-group-appearance-standard[_ngcontent-%COMP%]{box-shadow:var(--mat-sys-level3)!important;background-color:var(--mat-sys-surface-container-low);border-radius:var(--mat-sys-corner-large);border:0px}.search-bar[_ngcontent-%COMP%]{max-width:30rem;width:calc(100% - 23rem)}.search-form[_ngcontent-%COMP%]{width:100%}.light[_ngcontent-%COMP%]{font-weight:300}mat-card-title[_ngcontent-%COMP%]:not(:first-child){margin-block-start:1rem}.spin[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_spin 2s linear infinite}@keyframes _ngcontent-%COMP%_spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.loading[_ngcontent-%COMP%]{position:absolute;bottom:84px;left:50%;transform:translate(-50%)}.favorite-content[_ngcontent-%COMP%]{display:flex;align-items:center;height:20px}.favorite-content[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{scale:.8}[_nghost-%COMP%] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding:0}[_nghost-%COMP%] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic{padding:4px}.information-panel-header[_ngcontent-%COMP%]{position:absolute;top:1rem;left:1rem;box-shadow:none!important}.information-panel-content[_ngcontent-%COMP%]{position:absolute;top:4rem;left:1rem;box-shadow:none!important;max-height:calc(100vh - 10rem);overflow-y:auto;max-width:45rem;min-width:20rem;resize:horizontal}.clickable[_ngcontent-%COMP%]{cursor:pointer;padding:.5rem 0;border-radius:.5rem}.clickable[_ngcontent-%COMP%]:hover{background-color:#1a1b1f14}.clickable-no-padding[_ngcontent-%COMP%]{cursor:pointer;border-radius:.5rem}.clickable-no-padding[_ngcontent-%COMP%]:hover{background-color:#1a1b1f14}.indent[_ngcontent-%COMP%]{padding-left:24px}.mat-card-group[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]:first-child{border-bottom-left-radius:0;border-bottom-right-radius:0}.mat-card-group[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]:last-child{border-top-left-radius:0;border-top-right-radius:0}.mat-card-group[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]:not(:first-child):not(:last-child){border-radius:0}"]})};var hme=(i,e,t,r)=>(te(Mr).clearAnimations(),!0);var dme=(i,e)=>{let t=i.params.simulationId;return te(Ha).setActiveSimulationId(t),!0};var mme=(i,e,t,r)=>(te(Ha).unsetActiveSimulationId(),!0);var pme=[{path:"",redirectTo:"home",pathMatch:"full"},{path:"home",component:gM},{path:"visualize/:simulationId",component:xA,canActivate:[dme],canDeactivate:[mme,hme]},{path:"**",redirectTo:"home"}];var x9e={url:Ux.socketUrl,options:{auth:{type:"client"}}},fme={providers:[M4(YK.forRoot(x9e)),$4({eventCoalescing:!0}),_K(pme),FV(),kV()]};var a6t=go(mG());function w9e(i,e){i&1&&(Z(0,"mat-chip",1)(1,"div",2)(2,"mat-icon",3),ce(3,"autorenew"),Q()()()),i&2&&yr("background-color","var(--gray-background-color)")}function C9e(i,e){i&1&&(Z(0,"mat-chip",1)(1,"div",4)(2,"mat-icon"),ce(3,"wifi"),Q()()()),i&2&&yr("background-color","var(--green-background-color)")}function M9e(i,e){i&1&&(Z(0,"mat-chip",1)(1,"div",5)(2,"mat-icon"),ce(3,"wifi_off"),Q()()()),i&2&&yr("background-color","var(--red-background-color)")}var wA=class i{constructor(e){this.communicationService=e}get communicationStatusSignal(){return this.communicationService.communicationStatusSignal}static \u0275fac=function(t){return new(t||i)(rt(To))};static \u0275cmp=tt({type:i,selectors:[["app-connection-status"]],decls:4,vars:1,consts:[[1,"square-chip",3,"background-color"],[1,"square-chip"],[1,"flex-row","align-center","justify-center","gap-0-5-rem","text-gray","full-size"],[1,"spin"],[1,"flex-row","align-center","justify-center","gap-0-5-rem","text-green","full-size"],[1,"flex-row","align-center","justify-center","gap-0-5-rem","text-red","full-size"]],template:function(t,r){if(t&1&&(Ri(0),je(1,w9e,4,2,"mat-chip",0)(2,C9e,4,2,"mat-chip",0)(3,M9e,4,2,"mat-chip",0)),t&2){let n,a=r.communicationStatusSignal();oe(),Je((n=a)==="connecting"?1:n==="connected"?2:n==="disconnected"?3:-1)}},dependencies:[qn,da,pr,mr],styles:[".flex-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.flex-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.align-center[_ngcontent-%COMP%], .align-main-center[_ngcontent-%COMP%]{justify-content:center}.align-center[_ngcontent-%COMP%], .align-cross-center[_ngcontent-%COMP%]{align-items:center}.align-main-end[_ngcontent-%COMP%]{justify-content:flex-end}.align-cross-end[_ngcontent-%COMP%]{align-items:flex-end}.align-main-start[_ngcontent-%COMP%]{justify-content:flex-start}.align-cross-start[_ngcontent-%COMP%]{align-items:flex-start}.align-cross-stretch[_ngcontent-%COMP%]{align-items:stretch}.gap-0-5-rem[_ngcontent-%COMP%]{gap:.5rem}.gap-1-rem[_ngcontent-%COMP%]{gap:1rem}.gap-1-5-rem[_ngcontent-%COMP%]{gap:1.5rem}.flex-1[_ngcontent-%COMP%]{flex:1}*[_ngcontent-%COMP%]{--red-text-color: #ff0000;--red-background-color: #ffdddd;--yellow-text-color: #ffc21b;--yellow-background-color: #ffe6a4;--green-text-color: #00aa00;--green-background-color: #ccffcc;--gray-text-color: #666666;--gray-background-color: #f0f0f0;--blue-text-color: #4488ff;--blue-background-color: #cce5ff;--loaded-slider-color: #005cbb88;--active-button-color: #cce6ff}.text-red[_ngcontent-%COMP%]{color:var(--red-text-color)}.background-red[_ngcontent-%COMP%]{background-color:var(--red-background-color)}.text-yellow[_ngcontent-%COMP%]{color:var(--yellow-text-color)}.background-yellow[_ngcontent-%COMP%]{background-color:var(--yellow-background-color)}.text-green[_ngcontent-%COMP%]{color:var(--green-text-color)}.background-green[_ngcontent-%COMP%]{background-color:var(--green-background-color)}.text-gray[_ngcontent-%COMP%]{color:var(--gray-text-color)}.background-gray[_ngcontent-%COMP%]{background-color:var(--gray-background-color)!important}.text-blue[_ngcontent-%COMP%]{color:var(--blue-text-color)}.background-blue[_ngcontent-%COMP%]{background-color:var(--blue-background-color)}.square-chip[_ngcontent-%COMP%]{width:2.1rem;height:2.1rem;padding:0;display:flex;align-items:center;justify-content:center}.full-size[_ngcontent-%COMP%]{width:100%;height:100%}.spin[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_spin 2s linear infinite}@keyframes _ngcontent-%COMP%_spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}"]})};var h_=go(ny(),1),ka=class{static mapToArray(e){let t=[];for(let r in e)e.hasOwnProperty(r)&&t.push(e[r]);return t}static handleEvent(e,t,r){0<t.observers.length&&e.run(()=>{t.emit(r)})}},gme=(()=>{class i{constructor(t,r){this.element=t,this.zone=r,this.DEFAULT_ZOOM=1,this.DEFAULT_CENTER=(0,h_.latLng)(38.907192,-77.036871),this.DEFAULT_FPZ_OPTIONS={},this.fitBoundsOptions=this.DEFAULT_FPZ_OPTIONS,this.panOptions=this.DEFAULT_FPZ_OPTIONS,this.zoomOptions=this.DEFAULT_FPZ_OPTIONS,this.zoomPanOptions=this.DEFAULT_FPZ_OPTIONS,this.options={},this.mapReady=new ut,this.zoomChange=new ut,this.centerChange=new ut,this.onClick=new ut,this.onDoubleClick=new ut,this.onMouseDown=new ut,this.onMouseUp=new ut,this.onMouseMove=new ut,this.onMouseOver=new ut,this.onMouseOut=new ut,this.onMapMove=new ut,this.onMapMoveStart=new ut,this.onMapMoveEnd=new ut,this.onMapZoom=new ut,this.onMapZoomStart=new ut,this.onMapZoomEnd=new ut}ngOnInit(){this.zone.runOutsideAngular(()=>{this.map=(0,h_.map)(this.element.nativeElement,this.options),this.addMapEventListeners()}),this.center!=null&&this.zoom!=null&&this.setView(this.center,this.zoom),this.fitBounds!=null&&this.setFitBounds(this.fitBounds),this.maxBounds!=null&&this.setMaxBounds(this.maxBounds),this.minZoom!=null&&this.setMinZoom(this.minZoom),this.maxZoom!=null&&this.setMaxZoom(this.maxZoom),this.doResize(),this.mapReady.emit(this.map)}ngOnChanges(t){t.zoom&&t.center&&this.zoom!=null&&this.center!=null?this.setView(t.center.currentValue,t.zoom.currentValue):t.zoom?this.setZoom(t.zoom.currentValue):t.center&&this.setCenter(t.center.currentValue),t.fitBounds&&this.setFitBounds(t.fitBounds.currentValue),t.maxBounds&&this.setMaxBounds(t.maxBounds.currentValue),t.minZoom&&this.setMinZoom(t.minZoom.currentValue),t.maxZoom&&this.setMaxZoom(t.maxZoom.currentValue)}ngOnDestroy(){this.map!=null&&this.map.remove()}getMap(){return this.map}onResize(){this.delayResize()}addMapEventListeners(){let t=(n,a)=>{this.map.on(n,a)};t("click",n=>ka.handleEvent(this.zone,this.onClick,n)),t("dblclick",n=>ka.handleEvent(this.zone,this.onDoubleClick,n)),t("mousedown",n=>ka.handleEvent(this.zone,this.onMouseDown,n)),t("mouseup",n=>ka.handleEvent(this.zone,this.onMouseUp,n)),t("mouseover",n=>ka.handleEvent(this.zone,this.onMouseOver,n)),t("mouseout",n=>ka.handleEvent(this.zone,this.onMouseOut,n)),t("mousemove",n=>ka.handleEvent(this.zone,this.onMouseMove,n)),t("zoomstart",n=>ka.handleEvent(this.zone,this.onMapZoomStart,n)),t("zoom",n=>ka.handleEvent(this.zone,this.onMapZoom,n)),t("zoomend",n=>ka.handleEvent(this.zone,this.onMapZoomEnd,n)),t("movestart",n=>ka.handleEvent(this.zone,this.onMapMoveStart,n)),t("move",n=>ka.handleEvent(this.zone,this.onMapMove,n)),t("moveend",n=>ka.handleEvent(this.zone,this.onMapMoveEnd,n));let r=()=>{let n=this.map.getZoom();n!==this.zoom&&(this.zoom=n,ka.handleEvent(this.zone,this.zoomChange,n));let a=this.map.getCenter();(a!=null||this.center!=null)&&((a==null||this.center==null)&&a!==this.center||a.lat!==this.center.lat||a.lng!==this.center.lng)&&(this.center=a,ka.handleEvent(this.zone,this.centerChange,a))};t("moveend",r),t("zoomend",r)}doResize(){this.zone.runOutsideAngular(()=>{this.map!=null&&this.map.invalidateSize({})})}delayResize(){this.resizeTimer!=null&&clearTimeout(this.resizeTimer),this.resizeTimer=setTimeout(this.doResize.bind(this),200)}setView(t,r){this.map!=null&&t!=null&&r!=null&&this.map.setView(t,r,this.zoomPanOptions)}setZoom(t){this.map!=null&&t!=null&&this.map.setZoom(t,this.zoomOptions)}setCenter(t){this.map!=null&&t!=null&&this.map.panTo(t,this.panOptions)}setFitBounds(t){this.map!=null&&t!=null&&this.map.fitBounds(t,this.fitBoundsOptions)}setMaxBounds(t){this.map!=null&&t!=null&&this.map.setMaxBounds(t)}setMinZoom(t){this.map!=null&&t!=null&&this.map.setMinZoom(t)}setMaxZoom(t){this.map!=null&&t!=null&&this.map.setMaxZoom(t)}static{this.\u0275fac=function(r){return new(r||i)(rt(Et),rt(Kt))}}static{this.\u0275dir=ft({type:i,selectors:[["","leaflet",""]],hostBindings:function(r,n){r&1&&Le("resize",function(){return n.onResize()},!1,N4)},inputs:{fitBoundsOptions:[0,"leafletFitBoundsOptions","fitBoundsOptions"],panOptions:[0,"leafletPanOptions","panOptions"],zoomOptions:[0,"leafletZoomOptions","zoomOptions"],zoomPanOptions:[0,"leafletZoomPanOptions","zoomPanOptions"],options:[0,"leafletOptions","options"],zoom:[0,"leafletZoom","zoom"],center:[0,"leafletCenter","center"],fitBounds:[0,"leafletFitBounds","fitBounds"],maxBounds:[0,"leafletMaxBounds","maxBounds"],minZoom:[0,"leafletMinZoom","minZoom"],maxZoom:[0,"leafletMaxZoom","maxZoom"]},outputs:{mapReady:"leafletMapReady",zoomChange:"leafletZoomChange",centerChange:"leafletCenterChange",onClick:"leafletClick",onDoubleClick:"leafletDoubleClick",onMouseDown:"leafletMouseDown",onMouseUp:"leafletMouseUp",onMouseMove:"leafletMouseMove",onMouseOver:"leafletMouseOver",onMouseOut:"leafletMouseOut",onMapMove:"leafletMapMove",onMapMoveStart:"leafletMapMoveStart",onMapMoveEnd:"leafletMapMoveEnd",onMapZoom:"leafletMapZoom",onMapZoomStart:"leafletMapZoomStart",onMapZoomEnd:"leafletMapZoomEnd"},standalone:!1,features:[rr]})}}return i})();var yme=(()=>{class i{static{this.\u0275fac=function(r){return new(r||i)}}static{this.\u0275mod=Lt({type:i})}static{this.\u0275inj=Dt({})}}return i})();var _me=go(ny());var E9e=["container"],A9e=["cardContent"],P9e=(i,e)=>e.id;function B9e(i,e){i&1&&ce(0," directions_car ")}function R9e(i,e){i&1&&ce(0," accessibility ")}function D9e(i,e){i&1&&ce(0," place ")}function L9e(i,e){if(i&1){let t=vt();Z(0,"mat-chip",7),Le("click",function(){let n=Ee(t).$implicit,a=Se();return Ae(a.selectEntity(n))})("mouseenter",function(){let n=Ee(t).$implicit,a=Se();return Ae(a.preselectEntity(n))})("mouseleave",function(){Ee(t);let n=Se();return Ae(n.unpreselectEntity())}),Z(1,"mat-icon",8),je(2,B9e,1,0)(3,R9e,1,0)(4,D9e,1,0),Q(),Ge(5,"app-entity-name",9),Q()}if(i&2){let t,r=e.$implicit;oe(2),Je((t=r.entityType)==="vehicle"?2:t==="passenger"?3:t==="stop"?4:-1),oe(3),Re("name",r.name)("tags",r.tags)}}var CA=class i{constructor(e){this.animationService=e;Ji(()=>{this.animationService.clickPositionSignal()===null?this.show.set(!1):(this.show.set(!0),this.cardContent()?.nativeElement.scroll(0,0),this.container()?.nativeElement.focus())})}offset=30;maxHeightPadding=150;width=250;container=lh.required("container");cardContent=lh.required("cardContent");show=Bt(!1);top=$t(()=>{let e=this.animationService.clickPositionSignal();if(e===null)return"";let t=e.y;return t<window.innerHeight/2?t+"px":""});bottom=$t(()=>{let e=this.animationService.clickPositionSignal();if(e===null)return"";let t=e.y;return t>=window.innerHeight/2?window.innerHeight-t+"px":""});left=$t(()=>{let e=this.animationService.clickPositionSignal();if(e===null)return"";let t=e.x;return t+2*this.offset+this.width>window.innerWidth?t-this.offset-this.width+"px":t+this.offset+"px"});maxHeight=$t(()=>{let e=this.animationService.clickPositionSignal();if(e===null)return"";let t=e.y;return t<window.innerHeight/2?window.innerHeight-t-this.maxHeightPadding+"px":t-this.maxHeightPadding+"px"});get closeEntitiesSignal(){return this.animationService.closeEntitiesSignal}unpreselectEntity(){this.animationService.unpreselectEntity()}preselectEntity(e){this.animationService.preselectEntity(e,!0)}selectEntity(e){this.show.set(!1),this.animationService.clickHandled(),this.animationService.selectEntity(e)}onBlur(){this.unpreselectEntity(),this.show.set(!1)}static \u0275fac=function(t){return new(t||i)(rt(Mr))};static \u0275cmp=tt({type:i,selectors:[["app-close-entities-menu"]],viewQuery:function(t,r){t&1&&(ch(r.container,E9e,5),ch(r.cardContent,A9e,5)),t&2&&uh(2)},decls:11,vars:13,consts:[["container",""],["cardContent",""],["tabindex","0",3,"blur"],[1,"fade"],[1,"info"],[1,"card-content"],[1,"content"],[3,"click","mouseenter","mouseleave"],["matChipAvatar",""],[3,"name","tags"]],template:function(t,r){if(t&1){let n=vt();Z(0,"div",2,0),Le("blur",function(){return Ee(n),Ae(r.onBlur())}),Ri(2),Z(3,"mat-card",3)(4,"span",4),ce(5),Q(),Z(6,"mat-card-content",5,1)(8,"div",6),ui(9,L9e,6,3,"mat-chip",null,P9e),Q()()()()}if(t&2){let n=r.closeEntitiesSignal();oe(3),yr("top",r.top())("bottom",r.bottom())("left",r.left()),gt("fade-show",r.show())("disable-pointer-events",!r.show()),oe(2),_t("",n.length," entities close"),oe(),yr("max-height",r.maxHeight()),oe(3),hi(n)}},dependencies:[ia,ea,ta,qn,da,Rf,pr,mr,rl],styles:["mat-card[_ngcontent-%COMP%]{position:absolute;z-index:400}.content[_ngcontent-%COMP%]{width:100%;display:flex;flex-direction:column;gap:5px;max-width:200px;margin-right:10px}.disable-pointer-events[_ngcontent-%COMP%]{pointer-events:none}mat-card[_ngcontent-%COMP%]{padding:10px}mat-card-content[_ngcontent-%COMP%]{overflow-x:hidden;overflow-y:auto}.info[_ngcontent-%COMP%]{margin-bottom:5px}.mat-mdc-card-content[_ngcontent-%COMP%]{padding:0!important}[_nghost-%COMP%] .mat-mdc-standard-chip .mdc-evolution-chip__cell--primary, [_nghost-%COMP%] .mat-mdc-standard-chip .mdc-evolution-chip__action--primary, [_nghost-%COMP%] .mat-mdc-standard-chip .mat-mdc-chip-action-label{overflow:hidden}.fade[_ngcontent-%COMP%]{opacity:0;transition:opacity .1s ease-in-out}.fade-show[_ngcontent-%COMP%]{opacity:1}"]})};var MA=class i{constructor(e){this.mapService=e;window.addEventListener("beforeunload",this.saveMapState.bind(this))}animationService=te(Mr);savedZoom=localStorage.getItem("mapZoom")?parseInt(localStorage.getItem("mapZoom"),10):12;savedCenter=localStorage.getItem("mapCenter")?JSON.parse(localStorage.getItem("mapCenter")):(0,_me.latLng)(45.523066,-73.652687);options={layers:[],zoom:this.savedZoom,center:this.savedCenter};map;ngOnDestroy(){window.removeEventListener("beforeunload",this.saveMapState.bind(this)),this.saveMapState()}onMapReady(e){this.map=e,this.mapService.map=e,this.mapService.selectMapTile(this.mapService.selectedMapTile()),e.attributionControl.setPosition("bottomleft"),e.zoomControl.setPosition("bottomright"),this.animationService.addPixiOverlay(e),this.savedZoom&&e.setZoom(this.savedZoom),this.savedCenter&&e.setView(this.savedCenter,this.savedZoom)}saveMapState(){if(this.map){let e=this.map.getZoom(),t=this.map.getCenter();localStorage.setItem("mapZoom",e.toString()),localStorage.setItem("mapCenter",JSON.stringify([t.lat,t.lng]))}}static \u0275fac=function(t){return new(t||i)(rt(u_))};static \u0275cmp=tt({type:i,selectors:[["app-map"]],decls:2,vars:1,consts:[["leaflet","",1,"map",3,"leafletMapReady","leafletOptions"]],template:function(t,r){t&1&&(Z(0,"div",0),Le("leafletMapReady",function(a){return r.onMapReady(a)}),Q(),Ge(1,"app-close-entities-menu")),t&2&&Re("leafletOptions",r.options)},dependencies:[yme,gme,CA],styles:["[_nghost-%COMP%]{width:100%;height:100%;display:block}[_nghost-%COMP%] .map[_ngcontent-%COMP%]{width:100%;height:100%}"]})};var vme=go(bme());var TA=class i{constructor(e){this.el=e}mode="";stats;ngOnInit(){this.stats=new vme.default,this.mode==="fps"?this.stats.showPanel(0):this.mode==="ms"&&this.stats.showPanel(1),this.stats.dom.removeAttribute("style"),this.el.nativeElement.appendChild(this.stats.dom),this.update()}update(){this.stats.begin(),requestAnimationFrame(()=>{this.stats.end(),this.update()})}ngOnDestroy(){this.el.nativeElement.removeChild(this.stats.dom)}static \u0275fac=function(t){return new(t||i)(rt(Et))};static \u0275cmp=tt({type:i,selectors:[["app-metrics"]],inputs:{mode:"mode"},decls:0,vars:0,template:function(t,r){},encapsulation:2})};var EA=class i{static \u0275fac=function(t){return new(t||i)};static \u0275cmp=tt({type:i,selectors:[["app-root"]],decls:6,vars:2,consts:[[1,"metrics"],[3,"mode"]],template:function(t,r){t&1&&(Ge(0,"app-map")(1,"router-outlet"),Z(2,"div",0),Ge(3,"app-metrics",1)(4,"app-metrics",1),Q(),Ge(5,"app-connection-status")),t&2&&(oe(3),Re("mode","fps"),oe(),Re("mode","ms"))},dependencies:[MA,cB,wA,TA],styles:[".main[_ngcontent-%COMP%]{height:calc(100% - 40px);padding:20px}.map[_ngcontent-%COMP%]{height:100%}#button-overlay[_ngcontent-%COMP%]{position:absolute;left:0;bottom:0;margin:20px}#button-content[_ngcontent-%COMP%]{display:flex;flex-direction:column-reverse;align-items:flex-start;gap:10px;margin:20px 20px 40px;height:calc(100% - 40px);position:relative;z-index:500}#info-overlay[_ngcontent-%COMP%]{position:absolute;left:0;bottom:0;top:0;margin:20px;z-index:500}#info-content[_ngcontent-%COMP%]{position:relative;margin:20px}app-connection-status[_ngcontent-%COMP%]{position:absolute;right:49px;bottom:10px;z-index:500}.metrics[_ngcontent-%COMP%]{position:absolute;bottom:1.5rem;z-index:500}"]})};DV(EA,fme).catch(i=>console.error(i));
|