diff --git a/404.html b/404.html index 1ce22b6..b0f6a33 100644 --- a/404.html +++ b/404.html @@ -13,6 +13,7 @@ +
Test your gaming music knowledge with VGMQ!

VGMQ is a free, multiplayer game that lets you challenge your friends to a fun and challenging music quiz! @@ -22,6 +23,7 @@

Test your gaming music knowledge w development, but we're always adding new features and games!
Feel free to join the Discord!

+
- + diff --git a/624.0babb0d47d71fd08.js b/624.0a34cf57765237e5.js similarity index 64% rename from 624.0babb0d47d71fd08.js rename to 624.0a34cf57765237e5.js index 5051ee5..ddcffcb 100644 --- a/624.0babb0d47d71fd08.js +++ b/624.0a34cf57765237e5.js @@ -1 +1 @@ -"use strict";(self.webpackChunkvgmq=self.webpackChunkvgmq||[]).push([[624],{5438:(we,M,l)=>{l.d(M,{q:()=>C});var m=l(8504),e=l(553),c=l(6306),u=l(9212),v=l(9862);let C=(()=>{class T{http;apiEndpoint=e.N.apiEndpoint;constructor(_){this.http=_}search(_,p,k){return this.http.get(`${this.apiEndpoint}/games`,{params:{query:_.query,sortBy:_.sortBy,..._.myGames&&{filterByUser:"true"},..._.showDisabled&&{showDisabled:"true"},..._.onlyShowWithoutMusics&&{onlyShowWithoutMusics:"true"},...p&&{skip:p},...k&&{limit:k},..._.nsfw&&{nsfw:"true"}}})}importByUrl(_){return this.http.get(`${this.apiEndpoint}/games/import`,{params:{url:_}}).pipe((0,c.K)(p=>(0,m._)(()=>p.error)))}get(_){return this.http.get(`${this.apiEndpoint}/games/${_}`)}addToList(_){return this.http.get(`${this.apiEndpoint}/games/${_}/add`)}removeFromList(_){return this.http.get(`${this.apiEndpoint}/games/${_}/remove`)}getNames(_){return this.http.get(`${this.apiEndpoint}/games/names`,{params:{query:_}})}static \u0275fac=function(p){return new(p||T)(u.LFG(v.eN))};static \u0275prov=u.Yz7({token:T,factory:T.\u0275fac,providedIn:"root"})}return T})()},1624:(we,M,l)=>{l.r(M),l.d(M,{LobbyModule:()=>ls});var m=l(6814),e=l(9212),c=l(6223),u=l(6201),v=function(s){return s.Host="host",s.Player="player",s.Spectator="spectator",s}(v||{}),C=function(s){return s.Buffering="buffering",s.ReadyToPlayMusic="ready_to_play_music",s}(C||{}),T=l(4716),I=l(1274),_=l(8184),p=l(5619),k=l(304),O=l(2939);let g=(()=>{class s{authService;router;snack;usersBehaviorSubject=new p.X([]);meBehaviorSubject=new p.X(null);lobbyBehaviorSubject=new p.X(null);currentLobbyAudioBufferBehaviorSubject=new p.X(null);currentLobbyMusicAnswerBehaviorSubject=new p.X(null);currentLobbyMusicBehaviorSubject=new p.X(null);canPlayMusicBehaviorSubject=new p.X(!1);resumeMusicBehaviorSubject=new p.X(void 0);messagesBehaviorSubject=new p.X([]);hintModeGamesBehaviorSubject=new p.X([]);lobbyLoadProgressBehaviorSubject=new p.X(0);lobbyErrorBehaviorSubject=new p.X(void 0);lobbyServerBufferBehaviorSubject=new p.X(!1);lobby=this.lobbyBehaviorSubject.asObservable();users=this.usersBehaviorSubject.asObservable();me=this.meBehaviorSubject.asObservable();currentLobbyAudioBuffer=this.currentLobbyAudioBufferBehaviorSubject.asObservable();currentLobbyMusicAnswer=this.currentLobbyMusicAnswerBehaviorSubject.asObservable();currentLobbyMusic=this.currentLobbyMusicBehaviorSubject.asObservable();canPlayMusic=this.canPlayMusicBehaviorSubject.asObservable();resumeMusic=this.resumeMusicBehaviorSubject.asObservable();messages=this.messagesBehaviorSubject.asObservable();hintModeGames=this.hintModeGamesBehaviorSubject.asObservable();lobbyLoadProgress=this.lobbyLoadProgressBehaviorSubject.asObservable();error=this.lobbyErrorBehaviorSubject.asObservable();lobbyServerBuffer=this.lobbyServerBufferBehaviorSubject.asObservable();constructor(t,i,o){this.authService=t,this.router=i,this.snack=o}disconnect(){this.lobbyBehaviorSubject.next(null),this.usersBehaviorSubject.next(null),this.meBehaviorSubject.next(null),this.currentLobbyAudioBufferBehaviorSubject.next(null),this.currentLobbyMusicAnswerBehaviorSubject.next(null)}getLobby(){return this.lobbyBehaviorSubject.getValue()}setLobby(t){this.lobbyBehaviorSubject.next(t)}getUsers(){return this.usersBehaviorSubject.getValue()}getMe(){return this.meBehaviorSubject.getValue()}setUsers(t){const i=t.find(o=>o.user.username===this.authService.decodeJwt().username);void 0===i?(this.snack.open("You have been kicked out from the lobby",void 0,{horizontalPosition:"end",verticalPosition:"bottom",panelClass:"danger",duration:5e3}),this.router.navigate(["/"])):(i.me=!0,this.usersBehaviorSubject.next(t),this.meBehaviorSubject.next(i))}getCurrentLobbyAudioBuffer(){return this.currentLobbyAudioBufferBehaviorSubject.getValue()}setCurrentLobbyAudioBuffer(t){this.currentLobbyAudioBufferBehaviorSubject.next(t)}getCurrentLobbyMusicAnswer(){return this.currentLobbyMusicAnswerBehaviorSubject.getValue()}setCurrentLobbyMusicAnswer(t){this.currentLobbyMusicAnswerBehaviorSubject.next(t)}getCurrentLobbyMusic(){return this.currentLobbyMusicBehaviorSubject.getValue()}setCurrentLobbyMusic(t){this.currentLobbyMusicBehaviorSubject.next(t),this.currentLobbyMusicAnswerBehaviorSubject.next(null)}updateLobbyUser(t){let i=this.getUsers();const o=i.findIndex(n=>n.user.username===t.user.username);-1!==o?i[o]=t:i=[...i,t],this.setUsers(i)}getCanPlayMusic(){return this.canPlayMusicBehaviorSubject.getValue()}setCanPlayMusic(t){this.canPlayMusicBehaviorSubject.next(t)}setResumeMusic(){this.resumeMusicBehaviorSubject.next()}getMessages(){return this.messagesBehaviorSubject.getValue()}addMessage(t){this.messagesBehaviorSubject.next([...this.getMessages(),t])}setHintModeGames(t){this.hintModeGamesBehaviorSubject.next(t);const i=this.getMe();i&&(i.hintMode=!0)}setLobbyLoadProgress(t){this.lobbyLoadProgressBehaviorSubject.next(t)}setLobbyError(t){this.lobbyErrorBehaviorSubject.next(t)}resetLobbyError(){this.lobbyErrorBehaviorSubject.next(void 0)}setLobbyServerBuffer(t){this.lobbyServerBufferBehaviorSubject.next(t)}static \u0275fac=function(i){return new(i||s)(e.LFG(k.e),e.LFG(_.F0),e.LFG(O.ux))};static \u0275prov=e.Yz7({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})();var xe=l(5986),A=l(9157),q=l(2032),ke=l(9388),N=l(2831),y=l(3680),R=l(8645);const Se=["knob"],Ce=["valueIndicatorContainer"];function Ie(s,r){if(1&s&&(e.TgZ(0,"div",4,5)(2,"div",6)(3,"span",7),e._uU(4),e.qZA()()()),2&s){const t=e.oxw();e.xp6(4),e.Oqu(t.valueIndicatorText)}}const Me=["trackActive"];function Ae(s,r){if(1&s&&e._UZ(0,"div"),2&s){const t=r.$implicit,i=r.$index,o=e.oxw(3);e.Tol(0===t?"mdc-slider__tick-mark--active":"mdc-slider__tick-mark--inactive"),e.Udp("transform",o._calcTickMarkTransform(i))}}function Re(s,r){if(1&s&&e.SjG(0,Ae,1,4,"div",9,e.x6l),2&s){const t=e.oxw(2);e.wJu(t._tickMarks)}}function Ee(s,r){if(1&s&&(e.TgZ(0,"div",7,8),e.YNc(2,Re,2,0),e.qZA()),2&s){const t=e.oxw();e.xp6(2),e.um2(2,t._cachedWidth?2:-1)}}function Pe(s,r){if(1&s&&e._UZ(0,"mat-slider-visual-thumb",6),2&s){const t=e.oxw();e.Q6J("discrete",t.discrete)("thumbPosition",1)("valueIndicatorText",t.startValueIndicatorText)}}const De=["*"];var d=function(s){return s[s.START=1]="START",s[s.END=2]="END",s}(d||{}),S=function(s){return s[s.ACTIVE=0]="ACTIVE",s[s.INACTIVE=1]="INACTIVE",s}(S||{});const E=new e.OlP("_MatSlider"),G=new e.OlP("_MatSliderThumb"),X=new e.OlP("_MatSliderRangeThumb"),j=new e.OlP("_MatSliderVisualThumb");let Ze=(()=>{class s{constructor(t,i,o,n){this._cdr=t,this._ngZone=i,this._slider=n,this._isHovered=!1,this._isActive=!1,this._isValueIndicatorVisible=!1,this._platform=(0,e.f3M)(N.t4),this._onPointerMove=a=>{if(this._sliderInput._isFocused)return;const b=this._hostElement.getBoundingClientRect(),f=this._slider._isCursorOnSliderThumb(a,b);this._isHovered=f,f?this._showHoverRipple():this._hideRipple(this._hoverRippleRef)},this._onMouseLeave=()=>{this._isHovered=!1,this._hideRipple(this._hoverRippleRef)},this._onFocus=()=>{this._hideRipple(this._hoverRippleRef),this._showFocusRipple(),this._hostElement.classList.add("mdc-slider__thumb--focused")},this._onBlur=()=>{this._isActive||this._hideRipple(this._focusRippleRef),this._isHovered&&this._showHoverRipple(),this._hostElement.classList.remove("mdc-slider__thumb--focused")},this._onDragStart=a=>{0===a.button&&(this._isActive=!0,this._showActiveRipple())},this._onDragEnd=()=>{this._isActive=!1,this._hideRipple(this._activeRippleRef),this._sliderInput._isFocused||this._hideRipple(this._focusRippleRef),this._platform.SAFARI&&this._showHoverRipple()},this._hostElement=o.nativeElement}ngAfterViewInit(){this._ripple.radius=24,this._sliderInput=this._slider._getInput(this.thumbPosition),this._sliderInputEl=this._sliderInput._hostElement;const t=this._sliderInputEl;this._ngZone.runOutsideAngular(()=>{t.addEventListener("pointermove",this._onPointerMove),t.addEventListener("pointerdown",this._onDragStart),t.addEventListener("pointerup",this._onDragEnd),t.addEventListener("pointerleave",this._onMouseLeave),t.addEventListener("focus",this._onFocus),t.addEventListener("blur",this._onBlur)})}ngOnDestroy(){const t=this._sliderInputEl;t&&(t.removeEventListener("pointermove",this._onPointerMove),t.removeEventListener("pointerdown",this._onDragStart),t.removeEventListener("pointerup",this._onDragEnd),t.removeEventListener("pointerleave",this._onMouseLeave),t.removeEventListener("focus",this._onFocus),t.removeEventListener("blur",this._onBlur))}_showHoverRipple(){this._isShowingRipple(this._hoverRippleRef)||(this._hoverRippleRef=this._showRipple({enterDuration:0,exitDuration:0}),this._hoverRippleRef?.element.classList.add("mat-mdc-slider-hover-ripple"))}_showFocusRipple(){this._isShowingRipple(this._focusRippleRef)||(this._focusRippleRef=this._showRipple({enterDuration:0,exitDuration:0},!0),this._focusRippleRef?.element.classList.add("mat-mdc-slider-focus-ripple"))}_showActiveRipple(){this._isShowingRipple(this._activeRippleRef)||(this._activeRippleRef=this._showRipple({enterDuration:225,exitDuration:400}),this._activeRippleRef?.element.classList.add("mat-mdc-slider-active-ripple"))}_isShowingRipple(t){return t?.state===y.DH.FADING_IN||t?.state===y.DH.VISIBLE}_showRipple(t,i){if(!this._slider.disabled&&(this._showValueIndicator(),this._slider._isRange&&this._slider._getThumb(this.thumbPosition===d.START?d.END:d.START)._showValueIndicator(),!this._slider._globalRippleOptions?.disabled||i))return this._ripple.launch({animation:this._slider._noopAnimations?{enterDuration:0,exitDuration:0}:t,centered:!0,persistent:!0})}_hideRipple(t){if(t?.fadeOut(),this._isShowingAnyRipple())return;this._slider._isRange||this._hideValueIndicator();const i=this._getSibling();i._isShowingAnyRipple()||(this._hideValueIndicator(),i._hideValueIndicator())}_showValueIndicator(){this._hostElement.classList.add("mdc-slider__thumb--with-indicator")}_hideValueIndicator(){this._hostElement.classList.remove("mdc-slider__thumb--with-indicator")}_getSibling(){return this._slider._getThumb(this.thumbPosition===d.START?d.END:d.START)}_getValueIndicatorContainer(){return this._valueIndicatorContainer?.nativeElement}_getKnob(){return this._knob.nativeElement}_isShowingAnyRipple(){return this._isShowingRipple(this._hoverRippleRef)||this._isShowingRipple(this._focusRippleRef)||this._isShowingRipple(this._activeRippleRef)}static#e=this.\u0275fac=function(i){return new(i||s)(e.Y36(e.sBO),e.Y36(e.R0b),e.Y36(e.SBq),e.Y36(E))};static#t=this.\u0275cmp=e.Xpm({type:s,selectors:[["mat-slider-visual-thumb"]],viewQuery:function(i,o){if(1&i&&(e.Gf(y.wG,5),e.Gf(Se,5),e.Gf(Ce,5)),2&i){let n;e.iGM(n=e.CRH())&&(o._ripple=n.first),e.iGM(n=e.CRH())&&(o._knob=n.first),e.iGM(n=e.CRH())&&(o._valueIndicatorContainer=n.first)}},hostAttrs:[1,"mdc-slider__thumb","mat-mdc-slider-visual-thumb"],inputs:{discrete:"discrete",thumbPosition:"thumbPosition",valueIndicatorText:"valueIndicatorText"},standalone:!0,features:[e._Bn([{provide:j,useExisting:s}]),e.jDz],decls:4,vars:2,consts:[["class","mdc-slider__value-indicator-container"],[1,"mdc-slider__thumb-knob"],["knob",""],["matRipple","",1,"mat-mdc-focus-indicator",3,"matRippleDisabled"],[1,"mdc-slider__value-indicator-container"],["valueIndicatorContainer",""],[1,"mdc-slider__value-indicator"],[1,"mdc-slider__value-indicator-text"]],template:function(i,o){1&i&&(e.YNc(0,Ie,5,1,"div",0),e._UZ(1,"div",1,2)(3,"div",3)),2&i&&(e.um2(0,o.discrete?0:-1),e.xp6(3),e.Q6J("matRippleDisabled",!0))},dependencies:[y.wG],styles:[".mat-mdc-slider-visual-thumb .mat-ripple{height:100%;width:100%}.mat-mdc-slider .mdc-slider__tick-marks{justify-content:start}.mat-mdc-slider .mdc-slider__tick-marks .mdc-slider__tick-mark--active,.mat-mdc-slider .mdc-slider__tick-marks .mdc-slider__tick-mark--inactive{position:absolute;left:2px}"],encapsulation:2,changeDetection:0})}return s})(),z=(()=>{class s{get disabled(){return this._disabled}set disabled(t){this._disabled=t;const i=this._getInput(d.END),o=this._getInput(d.START);i&&(i.disabled=this._disabled),o&&(o.disabled=this._disabled)}get discrete(){return this._discrete}set discrete(t){this._discrete=t,this._updateValueIndicatorUIs()}get min(){return this._min}set min(t){const i=isNaN(t)?this._min:t;this._min!==i&&this._updateMin(i)}_updateMin(t){const i=this._min;this._min=t,this._isRange?this._updateMinRange({old:i,new:t}):this._updateMinNonRange(t),this._onMinMaxOrStepChange()}_updateMinRange(t){const i=this._getInput(d.END),o=this._getInput(d.START),n=i.value,a=o.value;o.min=t.new,i.min=Math.max(t.new,o.value),o.max=Math.min(i.max,i.value),o._updateWidthInactive(),i._updateWidthInactive(),t.newt.old?this._onTranslateXChangeBySideEffect(o,i):this._onTranslateXChangeBySideEffect(i,o),n!==i.value&&this._onValueChange(i),a!==o.value&&this._onValueChange(o)}_updateMaxNonRange(t){const i=this._getInput(d.END);if(i){const o=i.value;i.max=t,i._updateThumbUIByValue(),this._updateTrackUI(i),o!==i.value&&this._onValueChange(i)}}get step(){return this._step}set step(t){const i=isNaN(t)?this._step:t;this._step!==i&&this._updateStep(i)}_updateStep(t){this._step=t,this._isRange?this._updateStepRange():this._updateStepNonRange(),this._onMinMaxOrStepChange()}_updateStepRange(){const t=this._getInput(d.END),i=this._getInput(d.START),o=t.value,n=i.value,a=i.value;t.min=this._min,i.max=this._max,t.step=this._step,i.step=this._step,this._platform.SAFARI&&(t.value=t.value,i.value=i.value),t.min=Math.max(this._min,i.value),i.max=Math.min(this._max,t.value),i._updateWidthInactive(),t._updateWidthInactive(),t.value`${f}`,this._rippleRadius=24,this.startValueIndicatorText="",this.endValueIndicatorText="",this._isRange=!1,this._isRtl=!1,this._hasViewInitialized=!1,this._tickMarkTrackWidth=0,this._hasAnimation=!1,this._resizeTimer=null,this._platform=(0,e.f3M)(N.t4),this._knobRadius=8,this._thumbsOverlap=!1,this._noopAnimations="NoopAnimations"===b,this._dirChangeSubscription=this._dir.change.subscribe(()=>this._onDirChange()),this._isRtl="rtl"===this._dir.value}ngAfterViewInit(){this._platform.isBrowser&&this._updateDimensions();const t=this._getInput(d.END),i=this._getInput(d.START);this._isRange=!!t&&!!i,this._cdr.detectChanges();const o=this._getThumb(d.END);this._rippleRadius=o._ripple.radius,this._inputPadding=this._rippleRadius-this._knobRadius,this._isRange?this._initUIRange(t,i):this._initUINonRange(t),this._updateTrackUI(t),this._updateTickMarkUI(),this._updateTickMarkTrackUI(),this._observeHostResize(),this._cdr.detectChanges()}_initUINonRange(t){t.initProps(),t.initUI(),this._updateValueIndicatorUI(t),this._hasViewInitialized=!0,t._updateThumbUIByValue()}_initUIRange(t,i){t.initProps(),t.initUI(),i.initProps(),i.initUI(),t._updateMinMax(),i._updateMinMax(),t._updateStaticStyles(),i._updateStaticStyles(),this._updateValueIndicatorUIs(),this._hasViewInitialized=!0,t._updateThumbUIByValue(),i._updateThumbUIByValue()}ngOnDestroy(){this._dirChangeSubscription.unsubscribe(),this._resizeObserver?.disconnect(),this._resizeObserver=null}_onDirChange(){this._isRtl="rtl"===this._dir.value,this._isRange?this._onDirChangeRange():this._onDirChangeNonRange(),this._updateTickMarkUI()}_onDirChangeRange(){const t=this._getInput(d.END),i=this._getInput(d.START);t._setIsLeftThumb(),i._setIsLeftThumb(),t.translateX=t._calcTranslateXByValue(),i.translateX=i._calcTranslateXByValue(),t._updateStaticStyles(),i._updateStaticStyles(),t._updateWidthInactive(),i._updateWidthInactive(),t._updateThumbUIByValue(),i._updateThumbUIByValue()}_onDirChangeNonRange(){this._getInput(d.END)._updateThumbUIByValue()}_observeHostResize(){typeof ResizeObserver>"u"||!ResizeObserver||this._ngZone.runOutsideAngular(()=>{this._resizeObserver=new ResizeObserver(()=>{this._isActive()||(this._resizeTimer&&clearTimeout(this._resizeTimer),this._onResize())}),this._resizeObserver.observe(this._elementRef.nativeElement)})}_isActive(){return this._getThumb(d.START)._isActive||this._getThumb(d.END)._isActive}_getValue(t=d.END){const i=this._getInput(t);return i?i.value:this.min}_skipUpdate(){return!(!this._getInput(d.START)?._skipUIUpdate&&!this._getInput(d.END)?._skipUIUpdate)}_updateDimensions(){this._cachedWidth=this._elementRef.nativeElement.offsetWidth,this._cachedLeft=this._elementRef.nativeElement.getBoundingClientRect().left}_setTrackActiveStyles(t){const i=this._trackActive.nativeElement.style;i.left=t.left,i.right=t.right,i.transformOrigin=t.transformOrigin,i.transform=t.transform}_calcTickMarkTransform(t){return`translateX(${t*(this._tickMarkTrackWidth/(this._tickMarks.length-1))}px`}_onTranslateXChange(t){this._hasViewInitialized&&(this._updateThumbUI(t),this._updateTrackUI(t),this._updateOverlappingThumbUI(t))}_onTranslateXChangeBySideEffect(t,i){this._hasViewInitialized&&(t._updateThumbUIByValue(),i._updateThumbUIByValue())}_onValueChange(t){this._hasViewInitialized&&(this._updateValueIndicatorUI(t),this._updateTickMarkUI(),this._cdr.detectChanges())}_onMinMaxOrStepChange(){this._hasViewInitialized&&(this._updateTickMarkUI(),this._updateTickMarkTrackUI(),this._cdr.markForCheck())}_onResize(){if(this._hasViewInitialized){if(this._updateDimensions(),this._isRange){const t=this._getInput(d.END),i=this._getInput(d.START);t._updateThumbUIByValue(),i._updateThumbUIByValue(),t._updateStaticStyles(),i._updateStaticStyles(),t._updateMinMax(),i._updateMinMax(),t._updateWidthInactive(),i._updateWidthInactive()}else{const t=this._getInput(d.END);t&&t._updateThumbUIByValue()}this._updateTickMarkUI(),this._updateTickMarkTrackUI(),this._cdr.detectChanges()}}_areThumbsOverlapping(){const t=this._getInput(d.START),i=this._getInput(d.END);return!(!t||!i)&&i.translateX-t.translateX<20}_updateOverlappingThumbClassNames(t){const i=t.getSibling(),o=this._getThumb(t.thumbPosition);this._getThumb(i.thumbPosition)._hostElement.classList.remove("mdc-slider__thumb--top"),o._hostElement.classList.toggle("mdc-slider__thumb--top",this._thumbsOverlap)}_updateOverlappingThumbUI(t){!this._isRange||this._skipUpdate()||this._thumbsOverlap!==this._areThumbsOverlapping()&&(this._thumbsOverlap=!this._thumbsOverlap,this._updateOverlappingThumbClassNames(t))}_updateThumbUI(t){this._skipUpdate()||(this._getThumb(t.thumbPosition===d.END?d.END:d.START)._hostElement.style.transform=`translateX(${t.translateX}px)`)}_updateValueIndicatorUI(t){if(this._skipUpdate())return;const i=this.displayWith(t.value);if(this._hasViewInitialized?t._valuetext=i:t._hostElement.setAttribute("aria-valuetext",i),this.discrete){t.thumbPosition===d.START?this.startValueIndicatorText=i:this.endValueIndicatorText=i;const o=this._getThumb(t.thumbPosition);i.length<3?o._hostElement.classList.add("mdc-slider__thumb--short-value"):o._hostElement.classList.remove("mdc-slider__thumb--short-value")}}_updateValueIndicatorUIs(){const t=this._getInput(d.END),i=this._getInput(d.START);t&&this._updateValueIndicatorUI(t),i&&this._updateValueIndicatorUI(i)}_updateTickMarkTrackUI(){if(!this.showTickMarks||this._skipUpdate())return;const t=this._step&&this._step>0?this._step:1,o=(Math.floor(this.max/t)*t-this.min)/(this.max-this.min);this._tickMarkTrackWidth=this._cachedWidth*o-6}_updateTrackUI(t){this._skipUpdate()||(this._isRange?this._updateTrackUIRange(t):this._updateTrackUINonRange(t))}_updateTrackUIRange(t){const i=t.getSibling();if(!i||!this._cachedWidth)return;const o=Math.abs(i.translateX-t.translateX)/this._cachedWidth;this._setTrackActiveStyles(t._isLeftThumb&&this._cachedWidth?{left:"auto",right:this._cachedWidth-i.translateX+"px",transformOrigin:"right",transform:`scaleX(${o})`}:{left:`${i.translateX}px`,right:"auto",transformOrigin:"left",transform:`scaleX(${o})`})}_updateTrackUINonRange(t){this._setTrackActiveStyles(this._isRtl?{left:"auto",right:"0px",transformOrigin:"right",transform:`scaleX(${1-t.fillPercentage})`}:{left:"0px",right:"auto",transformOrigin:"left",transform:`scaleX(${t.fillPercentage})`})}_updateTickMarkUI(){if(!this.showTickMarks||void 0===this.step||void 0===this.min||void 0===this.max)return;const t=this.step>0?this.step:1;this._isRange?this._updateTickMarkUIRange(t):this._updateTickMarkUINonRange(t),this._isRtl&&this._tickMarks.reverse()}_updateTickMarkUINonRange(t){const i=this._getValue();let o=Math.max(Math.floor((i-this.min)/t),0),n=Math.max(Math.floor((this.max-i)/t),0);this._isRtl?o++:n++,this._tickMarks=Array(o).fill(S.ACTIVE).concat(Array(n).fill(S.INACTIVE))}_updateTickMarkUIRange(t){const i=this._getValue(),o=this._getValue(d.START),n=Math.max(Math.floor((o-this.min)/t),0),a=Math.max(Math.floor((i-o)/t)+1,0),b=Math.max(Math.floor((this.max-i)/t),0);this._tickMarks=Array(n).fill(S.INACTIVE).concat(Array(a).fill(S.ACTIVE),Array(b).fill(S.INACTIVE))}_getInput(t){return t===d.END&&this._input?this._input:this._inputs?.length?t===d.START?this._inputs.first:this._inputs.last:void 0}_getThumb(t){return t===d.END?this._thumbs?.last:this._thumbs?.first}_setTransition(t){this._hasAnimation=!this._platform.IOS&&t&&!this._noopAnimations,this._elementRef.nativeElement.classList.toggle("mat-mdc-slider-with-animation",this._hasAnimation)}_isCursorOnSliderThumb(t,i){const o=i.width/2,f=t.clientY-(i.y+o);return Math.pow(t.clientX-(i.x+o),2)+Math.pow(f,2)P),multi:!0};let P=(()=>{class s{get value(){return(0,e.Cb_)(this._hostElement.value,0)}set value(t){const i=(t=isNaN(t)?0:t)+"";this._hasSetInitialValue?this._isActive||this._setValue(i):this._initialValue=i}_setValue(t){this._hostElement.value=t,this._updateThumbUIByValue(),this._slider._onValueChange(this),this._cdr.detectChanges(),this._slider._cdr.markForCheck()}get translateX(){return this._slider.min>=this._slider.max?(this._translateX=this._tickMarkOffset,this._translateX):(void 0===this._translateX&&(this._translateX=this._calcTranslateXByValue()),this._translateX)}set translateX(t){this._translateX=t}get min(){return(0,e.Cb_)(this._hostElement.min,0)}set min(t){this._hostElement.min=t+"",this._cdr.detectChanges()}get max(){return(0,e.Cb_)(this._hostElement.max,0)}set max(t){this._hostElement.max=t+"",this._cdr.detectChanges()}get step(){return(0,e.Cb_)(this._hostElement.step,0)}set step(t){this._hostElement.step=t+"",this._cdr.detectChanges()}get disabled(){return(0,e.VuI)(this._hostElement.disabled)}set disabled(t){this._hostElement.disabled=t,this._cdr.detectChanges(),this._slider.disabled!==this.disabled&&(this._slider.disabled=this.disabled)}get percentage(){return this._slider.min>=this._slider.max?this._slider._isRtl?1:0:(this.value-this._slider.min)/(this._slider.max-this._slider.min)}get fillPercentage(){return this._slider._cachedWidth?0===this._translateX?0:this.translateX/this._slider._cachedWidth:this._slider._isRtl?1:0}_setIsFocused(t){this._isFocused=t}constructor(t,i,o,n){this._ngZone=t,this._elementRef=i,this._cdr=o,this._slider=n,this.valueChange=new e.vpe,this.dragStart=new e.vpe,this.dragEnd=new e.vpe,this.thumbPosition=d.END,this._knobRadius=8,this._tickMarkOffset=3,this._isActive=!1,this._isFocused=!1,this._hasSetInitialValue=!1,this._destroyed=new R.x,this._skipUIUpdate=!1,this._onTouchedFn=()=>{},this._isControlInitialized=!1,this._platform=(0,e.f3M)(N.t4),this._hostElement=i.nativeElement,this._ngZone.runOutsideAngular(()=>{this._hostElement.addEventListener("pointerdown",this._onPointerDown.bind(this)),this._hostElement.addEventListener("pointermove",this._onPointerMove.bind(this)),this._hostElement.addEventListener("pointerup",this._onPointerUp.bind(this))})}ngOnDestroy(){this._hostElement.removeEventListener("pointerdown",this._onPointerDown),this._hostElement.removeEventListener("pointermove",this._onPointerMove),this._hostElement.removeEventListener("pointerup",this._onPointerUp),this._destroyed.next(),this._destroyed.complete(),this.dragStart.complete(),this.dragEnd.complete()}initProps(){this._updateWidthInactive(),this.disabled!==this._slider.disabled&&(this._slider.disabled=!0),this.step=this._slider.step,this.min=this._slider.min,this.max=this._slider.max,this._initValue()}initUI(){this._updateThumbUIByValue()}_initValue(){this._hasSetInitialValue=!0,void 0===this._initialValue?this.value=this._getDefaultValue():(this._hostElement.value=this._initialValue,this._updateThumbUIByValue(),this._slider._onValueChange(this),this._cdr.detectChanges())}_getDefaultValue(){return this.min}_onBlur(){this._setIsFocused(!1),this._onTouchedFn()}_onFocus(){this._setIsFocused(!0)}_onChange(){this.valueChange.emit(this.value),this._isActive&&this._updateThumbUIByValue({withAnimation:!0})}_onInput(){this._onChangeFn?.(this.value),(this._slider.step||!this._isActive)&&this._updateThumbUIByValue({withAnimation:!0}),this._slider._onValueChange(this)}_onNgControlValueChange(){(!this._isActive||!this._isFocused)&&(this._slider._onValueChange(this),this._updateThumbUIByValue()),this._slider.disabled=this._formControl.disabled}_onPointerDown(t){if(!this.disabled&&0===t.button){if(this._platform.IOS){const i=this._slider._isCursorOnSliderThumb(t,this._slider._getThumb(this.thumbPosition)._hostElement.getBoundingClientRect());return this._isActive=i,this._updateWidthActive(),void this._slider._updateDimensions()}this._isActive=!0,this._setIsFocused(!0),this._updateWidthActive(),this._slider._updateDimensions(),this._slider.step||this._updateThumbUIByPointerEvent(t,{withAnimation:!0}),this.disabled||(this._handleValueCorrection(t),this.dragStart.emit({source:this,parent:this._slider,value:this.value}))}}_handleValueCorrection(t){this._skipUIUpdate=!0,setTimeout(()=>{this._skipUIUpdate=!1,this._fixValue(t)},0)}_fixValue(t){const i=t.clientX-this._slider._cachedLeft,o=this._slider._cachedWidth,n=0===this._slider.step?1:this._slider.step,a=Math.floor((this._slider.max-this._slider.min)/n),x=Math.round((this._slider._isRtl?1-i/o:i/o)*a)/a*(this._slider.max-this._slider.min)+this._slider.min,L=Math.round(x/n)*n;if(L===this.value)return this._slider._onValueChange(this),void(this._slider.step>0?this._updateThumbUIByValue():this._updateThumbUIByPointerEvent(t,{withAnimation:this._slider._hasAnimation}));this.value=L,this.valueChange.emit(this.value),this._onChangeFn?.(this.value),this._slider._onValueChange(this),this._slider.step>0?this._updateThumbUIByValue():this._updateThumbUIByPointerEvent(t,{withAnimation:this._slider._hasAnimation})}_onPointerMove(t){!this._slider.step&&this._isActive&&this._updateThumbUIByPointerEvent(t)}_onPointerUp(){this._isActive&&(this._isActive=!1,this._platform.SAFARI&&this._setIsFocused(!1),this.dragEnd.emit({source:this,parent:this._slider,value:this.value}),setTimeout(()=>this._updateWidthInactive(),this._platform.IOS?10:0))}_clamp(t){const i=this._tickMarkOffset;return Math.max(Math.min(t,this._slider._cachedWidth-this._tickMarkOffset),i)}_calcTranslateXByValue(){return this._slider._isRtl?(1-this.percentage)*(this._slider._cachedWidth-2*this._tickMarkOffset)+this._tickMarkOffset:this.percentage*(this._slider._cachedWidth-2*this._tickMarkOffset)+this._tickMarkOffset}_calcTranslateXByPointerEvent(t){return t.clientX-this._slider._cachedLeft}_updateWidthActive(){}_updateWidthInactive(){this._hostElement.style.padding=`0 ${this._slider._inputPadding}px`,this._hostElement.style.width=`calc(100% + ${this._slider._inputPadding-2*this._tickMarkOffset}px)`,this._hostElement.style.left=`-${this._slider._rippleRadius-this._tickMarkOffset}px`}_updateThumbUIByValue(t){this.translateX=this._clamp(this._calcTranslateXByValue()),this._updateThumbUI(t)}_updateThumbUIByPointerEvent(t,i){this.translateX=this._clamp(this._calcTranslateXByPointerEvent(t)),this._updateThumbUI(i)}_updateThumbUI(t){this._slider._setTransition(!!t?.withAnimation),this._slider._onTranslateXChange(this)}writeValue(t){(this._isControlInitialized||null!==t)&&(this.value=t)}registerOnChange(t){this._onChangeFn=t,this._isControlInitialized=!0}registerOnTouched(t){this._onTouchedFn=t}setDisabledState(t){this.disabled=t}focus(){this._hostElement.focus()}blur(){this._hostElement.blur()}static#e=this.\u0275fac=function(i){return new(i||s)(e.Y36(e.R0b),e.Y36(e.SBq),e.Y36(e.sBO),e.Y36(E))};static#t=this.\u0275dir=e.lG2({type:s,selectors:[["input","matSliderThumb",""]],hostAttrs:["type","range",1,"mdc-slider__input"],hostVars:1,hostBindings:function(i,o){1&i&&e.NdJ("change",function(){return o._onChange()})("input",function(){return o._onInput()})("blur",function(){return o._onBlur()})("focus",function(){return o._onFocus()}),2&i&&e.uIk("aria-valuetext",o._valuetext)},inputs:{value:[e.lbL.HasDecoratorInputTransform,"value","value",e.Cb_]},outputs:{valueChange:"valueChange",dragStart:"dragStart",dragEnd:"dragEnd"},exportAs:["matSliderThumb"],standalone:!0,features:[e._Bn([Be,{provide:G,useExisting:s}]),e.Xq5]})}return s})(),Oe=(()=>{class s{static#e=this.\u0275fac=function(i){return new(i||s)};static#t=this.\u0275mod=e.oAB({type:s});static#i=this.\u0275inj=e.cJS({imports:[y.BQ,y.si]})}return s})();var Ne=l(4300),Fe=l(8337);const He=["input"],Qe=["formField"],Ye=["*"];let W=0;class ${constructor(r,t){this.source=r,this.value=t}}const Je={provide:c.JU,useExisting:(0,e.Gpc)(()=>ee),multi:!0},K=new e.OlP("MatRadioGroup"),qe=new e.OlP("mat-radio-default-options",{providedIn:"root",factory:function Ge(){return{color:"accent"}}});let ee=(()=>{class s{get name(){return this._name}set name(t){this._name=t,this._updateRadioButtonNames()}get labelPosition(){return this._labelPosition}set labelPosition(t){this._labelPosition="before"===t?"before":"after",this._markRadiosForCheck()}get value(){return this._value}set value(t){this._value!==t&&(this._value=t,this._updateSelectedRadioFromValue(),this._checkSelectedRadioButton())}_checkSelectedRadioButton(){this._selected&&!this._selected.checked&&(this._selected.checked=!0)}get selected(){return this._selected}set selected(t){this._selected=t,this.value=t?t.value:null,this._checkSelectedRadioButton()}get disabled(){return this._disabled}set disabled(t){this._disabled=t,this._markRadiosForCheck()}get required(){return this._required}set required(t){this._required=t,this._markRadiosForCheck()}constructor(t){this._changeDetector=t,this._value=null,this._name="mat-radio-group-"+W++,this._selected=null,this._isInitialized=!1,this._labelPosition="after",this._disabled=!1,this._required=!1,this._controlValueAccessorChangeFn=()=>{},this.onTouched=()=>{},this.change=new e.vpe}ngAfterContentInit(){this._isInitialized=!0,this._buttonChanges=this._radios.changes.subscribe(()=>{this.selected&&!this._radios.find(t=>t===this.selected)&&(this._selected=null)})}ngOnDestroy(){this._buttonChanges?.unsubscribe()}_touch(){this.onTouched&&this.onTouched()}_updateRadioButtonNames(){this._radios&&this._radios.forEach(t=>{t.name=this.name,t._markForCheck()})}_updateSelectedRadioFromValue(){this._radios&&(null===this._selected||this._selected.value!==this._value)&&(this._selected=null,this._radios.forEach(i=>{i.checked=this.value===i.value,i.checked&&(this._selected=i)}))}_emitChangeEvent(){this._isInitialized&&this.change.emit(new $(this._selected,this._value))}_markRadiosForCheck(){this._radios&&this._radios.forEach(t=>t._markForCheck())}writeValue(t){this.value=t,this._changeDetector.markForCheck()}registerOnChange(t){this._controlValueAccessorChangeFn=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.disabled=t,this._changeDetector.markForCheck()}static#e=this.\u0275fac=function(i){return new(i||s)(e.Y36(e.sBO))};static#t=this.\u0275dir=e.lG2({type:s,selectors:[["mat-radio-group"]],contentQueries:function(i,o,n){if(1&i&&e.Suo(n,F,5),2&i){let a;e.iGM(a=e.CRH())&&(o._radios=a)}},hostAttrs:["role","radiogroup",1,"mat-mdc-radio-group"],inputs:{color:"color",name:"name",labelPosition:"labelPosition",value:"value",selected:"selected",disabled:[e.lbL.HasDecoratorInputTransform,"disabled","disabled",e.VuI],required:[e.lbL.HasDecoratorInputTransform,"required","required",e.VuI]},outputs:{change:"change"},exportAs:["matRadioGroup"],standalone:!0,features:[e._Bn([Je,{provide:K,useExisting:s}]),e.Xq5]})}return s})(),F=(()=>{class s{get checked(){return this._checked}set checked(t){this._checked!==t&&(this._checked=t,t&&this.radioGroup&&this.radioGroup.value!==this.value?this.radioGroup.selected=this:!t&&this.radioGroup&&this.radioGroup.value===this.value&&(this.radioGroup.selected=null),t&&this._radioDispatcher.notify(this.id,this.name),this._changeDetector.markForCheck())}get value(){return this._value}set value(t){this._value!==t&&(this._value=t,null!==this.radioGroup&&(this.checked||(this.checked=this.radioGroup.value===t),this.checked&&(this.radioGroup.selected=this)))}get labelPosition(){return this._labelPosition||this.radioGroup&&this.radioGroup.labelPosition||"after"}set labelPosition(t){this._labelPosition=t}get disabled(){return this._disabled||null!==this.radioGroup&&this.radioGroup.disabled}set disabled(t){this._setDisabled(t)}get required(){return this._required||this.radioGroup&&this.radioGroup.required}set required(t){this._required=t}get color(){return this._color||this.radioGroup&&this.radioGroup.color||this._providerOverride&&this._providerOverride.color||"accent"}set color(t){this._color=t}get inputId(){return`${this.id||this._uniqueId}-input`}constructor(t,i,o,n,a,b,f,x){this._elementRef=i,this._changeDetector=o,this._focusMonitor=n,this._radioDispatcher=a,this._providerOverride=f,this._uniqueId="mat-radio-"+ ++W,this.id=this._uniqueId,this.disableRipple=!1,this.tabIndex=0,this.change=new e.vpe,this._checked=!1,this._value=null,this._removeUniqueSelectionListener=()=>{},this.radioGroup=t,this._noopAnimations="NoopAnimations"===b,x&&(this.tabIndex=(0,e.Cb_)(x,0))}focus(t,i){i?this._focusMonitor.focusVia(this._inputElement,i,t):this._inputElement.nativeElement.focus(t)}_markForCheck(){this._changeDetector.markForCheck()}ngOnInit(){this.radioGroup&&(this.checked=this.radioGroup.value===this._value,this.checked&&(this.radioGroup.selected=this),this.name=this.radioGroup.name),this._removeUniqueSelectionListener=this._radioDispatcher.listen((t,i)=>{t!==this.id&&i===this.name&&(this.checked=!1)})}ngDoCheck(){this._updateTabIndex()}ngAfterViewInit(){this._updateTabIndex(),this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>{!t&&this.radioGroup&&this.radioGroup._touch()})}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef),this._removeUniqueSelectionListener()}_emitChangeEvent(){this.change.emit(new $(this,this._value))}_isRippleDisabled(){return this.disableRipple||this.disabled}_onInputClick(t){t.stopPropagation()}_onInputInteraction(t){if(t.stopPropagation(),!this.checked&&!this.disabled){const i=this.radioGroup&&this.value!==this.radioGroup.value;this.checked=!0,this._emitChangeEvent(),this.radioGroup&&(this.radioGroup._controlValueAccessorChangeFn(this.value),i&&this.radioGroup._emitChangeEvent())}}_onTouchTargetClick(t){this._onInputInteraction(t),this.disabled||this._inputElement.nativeElement.focus()}_setDisabled(t){this._disabled!==t&&(this._disabled=t,this._changeDetector.markForCheck())}_updateTabIndex(){const t=this.radioGroup;let i;if(i=t&&t.selected&&!this.disabled?t.selected===this?this.tabIndex:-1:this.tabIndex,i!==this._previousTabIndex){const o=this._inputElement?.nativeElement;o&&(o.setAttribute("tabindex",i+""),this._previousTabIndex=i)}}static#e=this.\u0275fac=function(i){return new(i||s)(e.Y36(K,8),e.Y36(e.SBq),e.Y36(e.sBO),e.Y36(Ne.tE),e.Y36(Fe.A8),e.Y36(e.QbO,8),e.Y36(qe,8),e.$8M("tabindex"))};static#t=this.\u0275cmp=e.Xpm({type:s,selectors:[["mat-radio-button"]],viewQuery:function(i,o){if(1&i&&(e.Gf(He,5),e.Gf(Qe,7,e.SBq)),2&i){let n;e.iGM(n=e.CRH())&&(o._inputElement=n.first),e.iGM(n=e.CRH())&&(o._rippleTrigger=n.first)}},hostAttrs:[1,"mat-mdc-radio-button"],hostVars:15,hostBindings:function(i,o){1&i&&e.NdJ("focus",function(){return o._inputElement.nativeElement.focus()}),2&i&&(e.uIk("id",o.id)("tabindex",null)("aria-label",null)("aria-labelledby",null)("aria-describedby",null),e.ekj("mat-primary","primary"===o.color)("mat-accent","accent"===o.color)("mat-warn","warn"===o.color)("mat-mdc-radio-checked",o.checked)("_mat-animation-noopable",o._noopAnimations))},inputs:{id:"id",name:"name",ariaLabel:[e.lbL.None,"aria-label","ariaLabel"],ariaLabelledby:[e.lbL.None,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[e.lbL.None,"aria-describedby","ariaDescribedby"],disableRipple:[e.lbL.HasDecoratorInputTransform,"disableRipple","disableRipple",e.VuI],tabIndex:[e.lbL.HasDecoratorInputTransform,"tabIndex","tabIndex",t=>null==t?0:(0,e.Cb_)(t)],checked:[e.lbL.HasDecoratorInputTransform,"checked","checked",e.VuI],value:"value",labelPosition:"labelPosition",disabled:[e.lbL.HasDecoratorInputTransform,"disabled","disabled",e.VuI],required:[e.lbL.HasDecoratorInputTransform,"required","required",e.VuI],color:"color"},outputs:{change:"change"},exportAs:["matRadioButton"],standalone:!0,features:[e.Xq5,e.jDz],ngContentSelectors:Ye,decls:13,vars:16,consts:[["mat-internal-form-field","",3,"labelPosition"],["formField",""],[1,"mdc-radio"],[1,"mat-mdc-radio-touch-target",3,"click"],["type","radio",1,"mdc-radio__native-control",3,"id","checked","disabled","required","change"],["input",""],[1,"mdc-radio__background"],[1,"mdc-radio__outer-circle"],[1,"mdc-radio__inner-circle"],["mat-ripple","",1,"mat-radio-ripple","mat-mdc-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered"],[1,"mat-ripple-element","mat-radio-persistent-ripple"],[1,"mdc-label",3,"for"]],template:function(i,o){1&i&&(e.F$t(),e.TgZ(0,"div",0,1)(2,"div",2)(3,"div",3),e.NdJ("click",function(a){return o._onTouchTargetClick(a)}),e.qZA(),e.TgZ(4,"input",4,5),e.NdJ("change",function(a){return o._onInputInteraction(a)}),e.qZA(),e.TgZ(6,"div",6),e._UZ(7,"div",7)(8,"div",8),e.qZA(),e.TgZ(9,"div",9),e._UZ(10,"div",10),e.qZA()(),e.TgZ(11,"label",11),e.Hsn(12),e.qZA()()),2&i&&(e.Q6J("labelPosition",o.labelPosition),e.xp6(2),e.ekj("mdc-radio--disabled",o.disabled),e.xp6(2),e.Q6J("id",o.inputId)("checked",o.checked)("disabled",o.disabled)("required",o.required),e.uIk("name",o.name)("value",o.value)("aria-label",o.ariaLabel)("aria-labelledby",o.ariaLabelledby)("aria-describedby",o.ariaDescribedby),e.xp6(5),e.Q6J("matRippleTrigger",o._rippleTrigger.nativeElement)("matRippleDisabled",o._isRippleDisabled())("matRippleCentered",!0),e.xp6(2),e.Q6J("for",o.inputId))},dependencies:[y.wG,y.fq],styles:['.mdc-radio{display:inline-block;position:relative;flex:0 0 auto;box-sizing:content-box;width:20px;height:20px;cursor:pointer;will-change:opacity,transform,border-color,color}.mdc-radio[hidden]{display:none}.mdc-radio__background{display:inline-block;position:relative;box-sizing:border-box;width:20px;height:20px}.mdc-radio__background::before{position:absolute;transform:scale(0, 0);border-radius:50%;opacity:0;pointer-events:none;content:"";transition:opacity 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1),transform 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-radio__outer-circle{position:absolute;top:0;left:0;box-sizing:border-box;width:100%;height:100%;border-width:2px;border-style:solid;border-radius:50%;transition:border-color 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-radio__inner-circle{position:absolute;top:0;left:0;box-sizing:border-box;width:100%;height:100%;transform:scale(0, 0);border-width:10px;border-style:solid;border-radius:50%;transition:transform 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1),border-color 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-radio__native-control{position:absolute;margin:0;padding:0;opacity:0;cursor:inherit;z-index:1}.mdc-radio--touch{margin-top:4px;margin-bottom:4px;margin-right:4px;margin-left:4px}.mdc-radio--touch .mdc-radio__native-control{top:calc((40px - 48px) / 2);right:calc((40px - 48px) / 2);left:calc((40px - 48px) / 2);width:48px;height:48px}.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring{pointer-events:none;border:2px solid rgba(0,0,0,0);border-radius:6px;box-sizing:content-box;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:100%;width:100%}@media screen and (forced-colors: active){.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring{border-color:CanvasText}}.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring::after,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring::after{content:"";border:2px solid rgba(0,0,0,0);border-radius:8px;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:calc(100% + 4px);width:calc(100% + 4px)}@media screen and (forced-colors: active){.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring::after,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring::after{border-color:CanvasText}}.mdc-radio__native-control:checked+.mdc-radio__background,.mdc-radio__native-control:disabled+.mdc-radio__background{transition:opacity 120ms 0ms cubic-bezier(0, 0, 0.2, 1),transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__outer-circle,.mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__outer-circle{transition:border-color 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__inner-circle,.mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__inner-circle{transition:transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1),border-color 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio--disabled{cursor:default;pointer-events:none}.mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__inner-circle{transform:scale(0.5);transition:transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1),border-color 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio__native-control:disabled+.mdc-radio__background,[aria-disabled=true] .mdc-radio__native-control+.mdc-radio__background{cursor:default}.mdc-radio__native-control:focus+.mdc-radio__background::before{transform:scale(1);opacity:.12;transition:opacity 120ms 0ms cubic-bezier(0, 0, 0.2, 1),transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-radio-button{-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-radio-button .mdc-radio{padding:calc((var(--mdc-radio-state-layer-size) - 20px) / 2)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-disabled-selected-icon-color)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control+.mdc-radio__background .mdc-radio__inner-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-disabled-selected-icon-color)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled:checked+.mdc-radio__background .mdc-radio__outer-circle{opacity:var(--mdc-radio-disabled-selected-icon-opacity)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control+.mdc-radio__background .mdc-radio__inner-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__inner-circle{opacity:var(--mdc-radio-disabled-selected-icon-opacity)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-disabled-unselected-icon-color)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{opacity:var(--mdc-radio-disabled-unselected-icon-opacity)}.mat-mdc-radio-button .mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-selected-focus-icon-color)}.mat-mdc-radio-button .mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle,.mat-mdc-radio-button .mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-selected-focus-icon-color)}.mat-mdc-radio-button .mdc-radio:hover .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-selected-hover-icon-color)}.mat-mdc-radio-button .mdc-radio:hover .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-selected-hover-icon-color)}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-selected-icon-color)}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-selected-icon-color)}.mat-mdc-radio-button .mdc-radio:not(:disabled):active .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-selected-pressed-icon-color)}.mat-mdc-radio-button .mdc-radio:not(:disabled):active .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-selected-pressed-icon-color)}.mat-mdc-radio-button .mdc-radio:hover .mdc-radio__native-control:enabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-unselected-hover-icon-color)}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:enabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-unselected-icon-color)}.mat-mdc-radio-button .mdc-radio:not(:disabled):active .mdc-radio__native-control:enabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-unselected-pressed-icon-color)}.mat-mdc-radio-button .mdc-radio .mdc-radio__background::before{top:calc(-1 * (var(--mdc-radio-state-layer-size) - 20px) / 2);left:calc(-1 * (var(--mdc-radio-state-layer-size) - 20px) / 2);width:var(--mdc-radio-state-layer-size);height:var(--mdc-radio-state-layer-size)}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control{top:calc((var(--mdc-radio-state-layer-size) - var(--mdc-radio-state-layer-size)) / 2);right:calc((var(--mdc-radio-state-layer-size) - var(--mdc-radio-state-layer-size)) / 2);left:calc((var(--mdc-radio-state-layer-size) - var(--mdc-radio-state-layer-size)) / 2);width:var(--mdc-radio-state-layer-size);height:var(--mdc-radio-state-layer-size)}.mat-mdc-radio-button .mdc-radio .mdc-radio__background::before{background-color:var(--mat-radio-ripple-color)}.mat-mdc-radio-button .mdc-radio:hover .mdc-radio__native-control:not([disabled]):not(:focus)~.mdc-radio__background::before{opacity:.04;transform:scale(1)}.mat-mdc-radio-button.mat-mdc-radio-checked .mdc-radio__background::before{background-color:var(--mat-radio-checked-ripple-color)}.mat-mdc-radio-button.mat-mdc-radio-checked .mat-ripple-element{background-color:var(--mat-radio-checked-ripple-color)}.mat-mdc-radio-button .mdc-radio--disabled+label{color:var(--mat-radio-disabled-label-color)}.mat-mdc-radio-button .mat-radio-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:50%}.mat-mdc-radio-button .mat-radio-ripple .mat-ripple-element{opacity:.14}.mat-mdc-radio-button .mat-radio-ripple::before{border-radius:50%}.mat-mdc-radio-button._mat-animation-noopable .mdc-radio__background::before,.mat-mdc-radio-button._mat-animation-noopable .mdc-radio__outer-circle,.mat-mdc-radio-button._mat-animation-noopable .mdc-radio__inner-circle{transition:none !important}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:focus:enabled:not(:checked)~.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-unselected-focus-icon-color, black)}.mat-mdc-radio-button.cdk-focused .mat-mdc-focus-indicator::before{content:""}.mat-mdc-radio-touch-target{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%)}[dir=rtl] .mat-mdc-radio-touch-target{left:0;right:50%;transform:translate(50%, -50%)}'],encapsulation:2,changeDetection:0})}return s})(),Xe=(()=>{class s{static#e=this.\u0275fac=function(i){return new(i||s)};static#t=this.\u0275mod=e.oAB({type:s});static#i=this.\u0275inj=e.cJS({imports:[y.BQ,m.ez,y.si,F,y.BQ]})}return s})();var D=l(3651),je=l(8484),h=l(6825),H=l(2438),Z=l(9773),ze=l(1374);function We(s,r){if(1&s){const t=e.EpF();e.TgZ(0,"div",2),e.NdJ("@fade.done",function(o){e.CHM(t);const n=e.oxw();return e.KtG(n.onAnimationEnd(o))}),e.qZA()}if(2&s){const t=e.oxw();e.Q6J("@fade",t.animationState)("@.disabled",!t.animation)("innerHTML",t.title,e.oJD)}}function $e(s,r){if(1&s){const t=e.EpF();e.TgZ(0,"div",3),e.NdJ("@fade.done",function(o){e.CHM(t);const n=e.oxw();return e.KtG(n.onAnimationEnd(o))}),e._uU(1),e.qZA()}if(2&s){const t=e.oxw();e.Q6J("@fade",t.animationState)("@.disabled",!t.animation),e.xp6(),e.hij(" ",t.title,"\n")}}let Ke=(()=>{class s{_cdRef;title;html;animation;tooltip=!0;_hidden=new R.x;animationState="hidden";constructor(t){this._cdRef=t}markForCheck(){this._cdRef.markForCheck()}onAnimationEnd(t){"hidden"===t.toState&&this._hidden.next()}static \u0275fac=function(i){return new(i||s)(e.Y36(e.sBO))};static \u0275cmp=e.Xpm({type:s,selectors:[["mdb-tooltip"]],hostVars:2,hostBindings:function(i,o){2&i&&e.ekj("tooltip",o.tooltip)},inputs:{title:"title",html:"html",animation:"animation"},decls:2,vars:2,consts:[["class","tooltip-inner",3,"innerHTML",4,"ngIf"],["class","tooltip-inner",4,"ngIf"],[1,"tooltip-inner",3,"innerHTML"],[1,"tooltip-inner"]],template:function(i,o){1&i&&e.YNc(0,We,1,3,"div",0)(1,$e,2,3,"div",1),2&i&&(e.Q6J("ngIf",o.html),e.xp6(),e.Q6J("ngIf",!o.html))},dependencies:[m.O5],encapsulation:2,data:{animation:[(0,h.X$)("fade",[(0,h.SB)("visible",(0,h.oB)({opacity:1})),(0,h.SB)("hidden",(0,h.oB)({opacity:0})),(0,h.eR)("visible => hidden",(0,h.jt)("150ms linear")),(0,h.eR)(":enter",(0,h.jt)("150ms linear"))])]},changeDetection:0})}return s})(),U=(()=>{class s{_overlay;_overlayPositionBuilder;_elementRef;mdbTooltip="";tooltipDisabled=!1;placement="top";html=!1;animation=!0;trigger="hover focus";delayShow=0;delayHide=0;offset=0;tooltipShow=new e.vpe;tooltipShown=new e.vpe;tooltipHide=new e.vpe;tooltipHidden=new e.vpe;_overlayRef;_tooltipRef;_open=!1;_showTimeout=0;_hideTimeout=0;_destroy$=new R.x;constructor(t,i,o){this._overlay=t,this._overlayPositionBuilder=i,this._elementRef=o}ngOnInit(){this.tooltipDisabled||""===this.mdbTooltip||this._bindTriggerEvents()}ngOnDestroy(){(this._open||this._showTimeout)&&this.hide(),this._destroy$.next(),this._destroy$.complete()}_bindTriggerEvents(){this.trigger.split(" ").forEach(i=>{if("click"===i)(0,H.R)(this._elementRef.nativeElement,i).pipe((0,Z.R)(this._destroy$)).subscribe(()=>this.toggle());else if("manual"!==i){const n="hover"===i?"mouseleave":"focusout";(0,H.R)(this._elementRef.nativeElement,"hover"===i?"mouseenter":"focusin").pipe((0,Z.R)(this._destroy$)).subscribe(()=>this.show()),(0,H.R)(this._elementRef.nativeElement,n).pipe((0,Z.R)(this._destroy$)).subscribe(()=>this.hide())}})}_createOverlayConfig(){const t=this._overlayPositionBuilder.flexibleConnectedTo(this._elementRef).withPositions(this._getPosition());return new D.X_({hasBackdrop:!1,scrollStrategy:this._overlay.scrollStrategies.reposition(),positionStrategy:t})}_createOverlay(){this._overlayRef=this._overlay.create(this._createOverlayConfig())}_getPosition(){let t;const i={originX:"center",originY:"top",overlayX:"center",overlayY:"bottom",offsetY:-this.offset},o={originX:"center",originY:"bottom",overlayX:"center",overlayY:"top",offsetY:this.offset},n={originX:"end",originY:"center",overlayX:"start",overlayY:"center",offsetX:this.offset},a={originX:"start",originY:"center",overlayX:"end",overlayY:"center",offsetX:-this.offset};switch(this.placement){case"top":t=[i,o];break;case"bottom":t=[o,i];break;case"left":t=[a,n];break;case"right":t=[n,a]}return t}show(){(this._hideTimeout||this._open)&&(this._overlayRef.detach(),clearTimeout(this._hideTimeout),this._hideTimeout=null),this._createOverlay(),this._showTimeout=setTimeout(()=>{if(!this._overlayRef.hasAttached()){const t=new je.C5(Ke);this.tooltipShow.emit(this),this._open=!0,this._tooltipRef=this._overlayRef.attach(t),this._tooltipRef.instance.title=this.mdbTooltip,this._tooltipRef.instance.html=this.html,this._tooltipRef.instance.animation=this.animation,this._tooltipRef.instance.animationState="visible",this._tooltipRef.instance.markForCheck(),this.tooltipShown.emit(this)}},this.delayShow)}hide(){this._showTimeout&&(clearTimeout(this._showTimeout),this._showTimeout=null,this._hideTimeout=setTimeout(()=>{this.tooltipHide.emit(this),this._tooltipRef?(this._tooltipRef.instance._hidden.pipe((0,ze.P)()).subscribe(()=>{this._overlayRef.detach(),this._open=!1,this.tooltipHidden.emit(this)}),this._tooltipRef.instance.animationState="hidden",this._tooltipRef.instance.markForCheck()):(this._overlayRef.detach(),this._open=!1,this.tooltipHidden.emit(this))},this.delayHide))}toggle(){this._open?this.hide():this.show()}static \u0275fac=function(i){return new(i||s)(e.Y36(D.aV),e.Y36(D.wJ),e.Y36(e.SBq))};static \u0275dir=e.lG2({type:s,selectors:[["","mdbTooltip",""]],inputs:{mdbTooltip:"mdbTooltip",tooltipDisabled:"tooltipDisabled",placement:"placement",html:"html",animation:"animation",trigger:"trigger",delayShow:"delayShow",delayHide:"delayHide",offset:"offset"},outputs:{tooltipShow:"tooltipShow",tooltipShown:"tooltipShown",tooltipHide:"tooltipHide",tooltipHidden:"tooltipHidden"},exportAs:["mdbTooltip"]})}return s})(),et=(()=>{class s{static \u0275fac=function(i){return new(i||s)};static \u0275mod=e.oAB({type:s});static \u0275inj=e.cJS({imports:[m.ez,D.U8]})}return s})();const tt=["musicPlayedInput"];function it(s,r){if(1&s&&(e.TgZ(0,"mat-checkbox",43),e._uU(1," Contribute to improving the database "),e._UZ(2,"i",44),e.qZA()),2&s){const t=e.oxw();e.xp6(2),e.Q6J("mdbTooltip",t.accuracyText())("html",!0)}}function st(s,r){1&s&&e._UZ(0,"span",47)}function ot(s,r){if(1&s&&(e.TgZ(0,"button",45),e._uU(1),e.YNc(2,st,1,0,"span",46),e.qZA()),2&s){const t=e.oxw();e.xp6(),e.hij(" ",t.lobby?"Save":"Create"," "),e.xp6(),e.Q6J("ngIf",t.loading)}}let te=(()=>{class s{fb;lobbyHttpService;router;lobbyStore;authService;lobbyForm;lobby;loading=!1;userCanEdit=!0;subscriptions=[];musicAccuracyRatio;lobbyGameModes=u.in;lobbyHintModes=u.BF;songSelectionPercentage=100;musicPlayedInput;constructor(t,i,o,n,a){this.fb=t,this.lobbyHttpService=i,this.router=o,this.lobbyStore=n,this.authService=a}ngOnInit(){this.lobby=this.lobbyStore.getLobby(),this.songSelectionPercentage=this.lobby?this.lobby.playedMusics/this.lobby.musicNumber*100:100,this.lobbyHttpService.info().subscribe(t=>{this.musicAccuracyRatio=t}),this.lobbyForm=this.fb.group({name:[this.lobby?this.lobby.name:`${this.authService.decodeJwt().username}'s lobby`,c.kI.required.bind(this)],password:[this.lobby?.password],musicNumber:[this.lobby?this.lobby.musicNumber:20,[c.kI.max(100),c.kI.min(5)]],playedMusics:[this.lobby?this.lobby.playedMusics:20,[c.kI.max(this.lobby?.musicNumber??20),c.kI.min(0)]],guessTime:[this.lobby?this.lobby.guessTime:20,[c.kI.max(60),c.kI.min(5)]],allowDuplicates:[!!this.lobby&&this.lobby.allowDuplicates],customDifficulty:[!!this.lobby&&this.lobby.customDifficulty],easyDifficulty:[!this.lobby||this.lobby.difficulty.includes(u.PT.Easy)],mediumDifficulty:[!this.lobby||this.lobby.difficulty.includes(u.PT.Medium)],hardDifficulty:[!this.lobby||this.lobby.difficulty.includes(u.PT.Hard)],allowContributeToMissingData:[!this.lobby||this.lobby.allowContributeToMissingData],gameMode:[this.lobby?this.lobby.gameMode:u.in.Standard],playMusicOnAnswerReveal:[!this.lobby||this.lobby.playMusicOnAnswerReveal],showCorrectAnswersDuringGuessTime:[!!this.lobby&&this.lobby.showCorrectAnswersDuringGuessTime],hintMode:[this.lobby?this.lobby.hintMode:u.BF.Allowed,[c.kI.required.bind(this)]]}),this.lobby&&(this.subscriptions=[this.lobbyStore.lobby.subscribe(t=>{this.lobby=t,this.lobbyForm.patchValue({name:this.lobby.name,...this.lobby?.password&&{password:this.lobby?.password},musicNumber:this.lobby.musicNumber,guessTime:this.lobby.guessTime,allowDuplicates:this.lobby.allowDuplicates,easyDifficulty:this.lobby.difficulty.includes(u.PT.Easy),mediumDifficulty:this.lobby.difficulty.includes(u.PT.Medium),hardDifficulty:this.lobby.difficulty.includes(u.PT.Hard)})}),this.lobbyStore.me.subscribe(t=>{null!==t&&(this.userCanEdit=t.role===v.Host,this.userCanEdit?this.lobbyForm.enable():this.lobbyForm.disable())})]),this.lobbyForm.get("musicNumber").valueChanges.subscribe({next:t=>{this.lobbyForm.get("musicNumber").setValue(t,{onlySelf:!0,emitEvent:!1,emitModelToViewChange:!0}),this.musicPlayedInput.nativeElement.max=t;const i=this.lobbyForm.get("playedMusics");i.setValue(Math.round(t*this.songSelectionPercentage/100),{emitEvent:!1}),i.setValidators([c.kI.max(this.lobby?.musicNumber||20),c.kI.min(0)])}}),this.lobbyForm.get("guessTime").valueChanges.subscribe({next:t=>{this.lobbyForm.get("guessTime").setValue(t,{onlySelf:!0,emitEvent:!1,emitModelToViewChange:!0})}}),this.lobbyForm.get("playedMusics").valueChanges.subscribe({next:t=>{this.lobbyForm.get("playedMusics").setValue(t,{onlySelf:!0,emitEvent:!1,emitModelToViewChange:!0}),this.songSelectionPercentage=t/this.lobbyForm.get("musicNumber").value*100}})}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}submit(){this.loading=!0;let t=[];this.lobbyForm.get("easyDifficulty").value&&(t=[...t,u.PT.Easy]),this.lobbyForm.get("mediumDifficulty").value&&(t=[...t,u.PT.Medium]),this.lobbyForm.get("hardDifficulty").value&&(t=[...t,u.PT.Hard]),null===this.lobby?this.lobbyHttpService.create({name:this.lobbyForm.get("name").value,password:this.lobbyForm.get("password").value,musicNumber:this.lobbyForm.get("musicNumber").value,playedMusics:this.lobbyForm.get("playedMusics").value,guessTime:this.lobbyForm.get("guessTime").value,allowDuplicates:this.lobbyForm.get("allowDuplicates").value,difficulty:t,allowContributeToMissingData:this.lobbyForm.get("allowContributeToMissingData").value,gameMode:this.lobbyForm.get("gameMode").value,playMusicOnAnswerReveal:this.lobbyForm.get("playMusicOnAnswerReveal").value,showCorrectAnswersDuringGuessTime:this.lobbyForm.get("showCorrectAnswersDuringGuessTime").value,hintMode:this.lobbyForm.get("hintMode").value}).pipe((0,T.x)(()=>this.loading=!1)).subscribe(i=>{this.router.navigate([`/lobby/${i.code}`])}):this.lobbyHttpService.update(this.lobby.code,{name:this.lobbyForm.get("name").value,password:this.lobbyForm.get("password").value,musicNumber:this.lobbyForm.get("musicNumber").value,playedMusics:this.lobbyForm.get("playedMusics").value,guessTime:this.lobbyForm.get("guessTime").value,allowDuplicates:this.lobbyForm.get("allowDuplicates").value,difficulty:t,allowContributeToMissingData:this.lobbyForm.get("allowContributeToMissingData").value,gameMode:this.lobbyForm.get("gameMode").value,playMusicOnAnswerReveal:this.lobbyForm.get("playMusicOnAnswerReveal").value,showCorrectAnswersDuringGuessTime:this.lobbyForm.get("showCorrectAnswersDuringGuessTime").value,hintMode:this.lobbyForm.get("hintMode").value}).pipe((0,T.x)(()=>this.loading=!1)).subscribe(()=>{})}hideContribution(){return this.lobbyForm.get("easyDifficulty").value&&this.lobbyForm.get("mediumDifficulty").value&&this.lobbyForm.get("hardDifficulty").value}accuracyText(){return`By checking this, each music has ${Math.round(1e4*(this.musicAccuracyRatio+Number.EPSILON))/100}% chance to not reflect the difficulty chosen in order to improve our database.
The more you play, the lower the chance!`}static \u0275fac=function(i){return new(i||s)(e.Y36(c.qu),e.Y36(I.Y),e.Y36(_.F0),e.Y36(g),e.Y36(k.e))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-lobby-config"]],viewQuery:function(i,o){if(1&i&&e.Gf(tt,5),2&i){let n;e.iGM(n=e.CRH())&&(o.musicPlayedInput=n.first)}},decls:96,vars:20,consts:[[1,"bg-dark","p-4","h-100"],[1,"h-100",3,"formGroup","ngSubmit"],[1,"form-container"],["appearance","outline",1,"me-2"],["matInput","","formControlName","name","required","required"],["appearance","outline"],["matInput","","type","text","formControlName","password"],[1,"row"],[1,"col-xxl-4","col-xl-5"],[1,"mt-3"],["color","primary",2,"width","70%",3,"min","max","step"],["matSliderThumb","","formControlName","musicNumber"],[1,"d-inline",2,"width","15%"],["type","number","max","100","min","5","formControlName","musicNumber"],["matSliderThumb","","formControlName","guessTime"],["type","number","max","100","min","5","formControlName","guessTime"],["mdbTooltip","The number of songs from players' list. The rest will be filled with random games.","placement","top",1,"fa-solid","fa-question-circle"],["color","primary",2,"width","70%",3,"min","step","max"],["matSliderThumb","","formControlName","playedMusics"],["type","number","min","0","formControlName","playedMusics",3,"max"],["musicPlayedInput",""],[1,"col-md-4","mb-2"],[1,"mb-3"],["formControlName","easyDifficulty","color","primary",1,"mx-3","checkbox-center"],["formControlName","mediumDifficulty","color","primary",1,"mx-3","checkbox-center"],["formControlName","hardDifficulty","color","primary",1,"mx-3","checkbox-center"],["class","mx-3","color","primary","formControlName","allowContributeToMissingData",4,"ngIf"],["mdbTooltip","Allow players to choose between 4 answers, but they win half the usual points","placement","bottom",1,"fa-solid","fa-question-circle",3,"html"],["aria-label","Select an option","formControlName","hintMode","color","primary",1,"d-flex"],[3,"value"],[1,"col-md-4","mt-2","mt-md-0"],["aria-label","Select an option","formControlName","gameMode","color","primary",1,"d-flex"],["value","2","disabled",""],["value","3","disabled",""],["mdbTooltip","One of you plays the music, the other can turn off their phone.
Don't worry about neither your score nor your accuracy, it's gone","placement","bottom",3,"value","html"],[1,"row","mt-3"],[1,"col-md-4"],["formControlName","allowDuplicates","color","primary",1,"me-2","checkbox-center"],["formControlName","playMusicOnAnswerReveal","color","primary",1,"me-2","checkbox-center"],["formControlName","showCorrectAnswersDuringGuessTime","color","primary",1,"me-2","checkbox-center"],[1,"row","bg-dark","justify-content-end","mt-2"],[1,"col-md-2"],["class","btn btn-primary w-100","type","submit",4,"ngIf"],["color","primary","formControlName","allowContributeToMissingData",1,"mx-3"],["placement","bottom",1,"fa-solid","fa-question-circle",3,"mdbTooltip","html"],["type","submit",1,"btn","btn-primary","w-100"],["class","spinner-border spinner-border-sm","type","button","role","status","aria-hidden","true",4,"ngIf"],["type","button","role","status","aria-hidden","true",1,"spinner-border","spinner-border-sm"]],template:function(i,o){1&i&&(e.TgZ(0,"div",0)(1,"form",1),e.NdJ("ngSubmit",function(){return!o.userCanEdit||o.submit()}),e.TgZ(2,"div",2)(3,"mat-form-field",3)(4,"mat-label"),e._uU(5,"Lobby name"),e.qZA(),e._UZ(6,"input",4),e.qZA(),e.TgZ(7,"mat-form-field",5)(8,"mat-label"),e._uU(9,"Password "),e.qZA(),e._UZ(10,"input",6),e.TgZ(11,"mat-hint"),e._uU(12,"keep it empty if this is public lobby"),e.qZA()(),e.TgZ(13,"h1"),e._uU(14,"Settings"),e.qZA(),e.TgZ(15,"div",7)(16,"div",8)(17,"h3"),e._uU(18,"Lobby"),e.qZA(),e.TgZ(19,"div",7)(20,"div",9)(21,"div")(22,"label"),e._uU(23,"Number of musics "),e.qZA()(),e.TgZ(24,"mat-slider",10),e._UZ(25,"input",11),e.qZA(),e.TgZ(26,"div",12),e._UZ(27,"input",13),e.qZA()(),e.TgZ(28,"div",9)(29,"div")(30,"label"),e._uU(31,"Guessing time "),e.qZA()(),e.TgZ(32,"div")(33,"mat-slider",10),e._UZ(34,"input",14),e.qZA(),e.TgZ(35,"div",12),e._UZ(36,"input",15),e._uU(37,"s "),e.qZA()()(),e.TgZ(38,"div",9)(39,"div")(40,"label"),e._uU(41," Played games "),e._UZ(42,"i",16),e.qZA()(),e.TgZ(43,"div")(44,"mat-slider",17),e._UZ(45,"input",18),e.qZA(),e.TgZ(46,"div",12),e._UZ(47,"input",19,20),e.qZA()()()()(),e.TgZ(49,"div",21)(50,"h3"),e._uU(51,"Difficulty"),e.qZA(),e.TgZ(52,"section",22)(53,"mat-checkbox",23),e._uU(54," Easy "),e.qZA(),e.TgZ(55,"mat-checkbox",24),e._uU(56,"Medium"),e.qZA(),e.TgZ(57,"mat-checkbox",25),e._uU(58,"Hard"),e.qZA()(),e.YNc(59,it,3,2,"mat-checkbox",26),e.TgZ(60,"div")(61,"h3"),e._uU(62," Hint Button "),e._UZ(63,"i",27),e.qZA(),e.TgZ(64,"mat-radio-group",28)(65,"mat-radio-button",29),e._uU(66,"Disabled"),e.qZA(),e.TgZ(67,"mat-radio-button",29),e._uU(68,"Allowed"),e.qZA(),e.TgZ(69,"mat-radio-button",29),e._uU(70,"Always"),e.qZA()()()(),e.TgZ(71,"div",30)(72,"h3"),e._uU(73,"Game mode"),e.qZA(),e.TgZ(74,"mat-radio-group",31)(75,"mat-radio-button",29),e._uU(76,"Standard"),e.qZA(),e.TgZ(77,"mat-radio-button",32),e._uU(78,"Quick-draw"),e.qZA(),e.TgZ(79,"mat-radio-button",33),e._uU(80,"Battle royale"),e.qZA(),e.TgZ(81,"mat-radio-button",34),e._uU(82," Local Couch "),e.qZA()()()(),e.TgZ(83,"div",35)(84,"div",36)(85,"h3"),e._uU(86,"Modifiers"),e.qZA(),e.TgZ(87,"mat-checkbox",37),e._uU(88," Duplicate games "),e.qZA(),e.TgZ(89,"mat-checkbox",38),e._uU(90," Keep Playing Music On Answer Reveal "),e.qZA(),e.TgZ(91,"mat-checkbox",39),e._uU(92," Show correct answers during guess time "),e.qZA()()()(),e.TgZ(93,"div",40)(94,"div",41),e.YNc(95,ot,3,2,"button",42),e.qZA()()()()),2&i&&(e.xp6(),e.Q6J("formGroup",o.lobbyForm),e.xp6(23),e.Q6J("min",5)("max",100)("step",1),e.xp6(9),e.Q6J("min",5)("max",60)("step",1),e.xp6(11),e.Q6J("min",0)("step",1)("max",o.lobbyForm.get("musicNumber").value),e.xp6(3),e.Q6J("max",o.lobby?o.lobby.playedMusics:20),e.xp6(12),e.Q6J("ngIf",!o.hideContribution()),e.xp6(4),e.Q6J("html",!0),e.xp6(2),e.Q6J("value",o.lobbyHintModes.Disabled),e.xp6(2),e.Q6J("value",o.lobbyHintModes.Allowed),e.xp6(2),e.Q6J("value",o.lobbyHintModes.Always),e.xp6(6),e.Q6J("value",o.lobbyGameModes.Standard),e.xp6(6),e.Q6J("value",o.lobbyGameModes.LocalCouch)("html",!0),e.xp6(14),e.Q6J("ngIf",o.userCanEdit))},dependencies:[m.O5,xe.oG,A.KE,A.hX,A.bx,q.Nt,c._Y,c.Fj,c.wV,c.JJ,c.JL,c.Q7,c.qQ,c.Fd,c.sg,c.u,z,P,ee,F,U],encapsulation:2})}return s})(),nt=(()=>{class s{constructor(){}ngOnInit(){}static \u0275fac=function(i){return new(i||s)};static \u0275cmp=e.Xpm({type:s,selectors:[["app-create"]],decls:2,vars:0,consts:[[1,"row"],[1,"col-md-9"]],template:function(i,o){1&i&&(e.TgZ(0,"div",0),e._UZ(1,"app-lobby-config",1),e.qZA())},dependencies:[te],encapsulation:2})}return s})();var rt=l(2132),at=l(4896),lt=l(2075),dt=l(7700),w=l(9678),ct=l(68);function ut(s,r){if(1&s){const t=e.EpF();e.ynx(0),e.TgZ(1,"button",3),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.play())}),e._uU(2,"Play"),e.qZA(),e.BQk()}}const mt=s=>({row:s}),ht=(s,r)=>({"col-md-6":s,"col-md-12":r});let ie=(()=>{class s{lobbyHttpService;lobbyStore;socket;router;lobby;role;lobbyUsersRoles=v;lobbyStatus=u.D;subscriptions=[];constructor(t,i,o,n){this.lobbyHttpService=t,this.lobbyStore=i,this.socket=o,this.router=n}ngOnInit(){this.subscriptions=[this.lobbyStore.lobby.subscribe(t=>{this.lobby=t}),this.lobbyStore.me.subscribe(t=>{null!==t&&(this.role=t.role)})]}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}play(){this.socket.emit("play",this.lobby.code)}leave(){this.socket.emit("leave",this.lobby.code),this.router.navigate(["/"])}showPlayButton(){return this.role===this.lobbyUsersRoles.Host&&this.lobby.status===u.D.Waiting}static \u0275fac=function(i){return new(i||s)(e.Y36(I.Y),e.Y36(g),e.Y36(w.i),e.Y36(_.F0))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-button-play"]],decls:4,vars:8,consts:[[3,"ngClass"],[4,"ngIf"],["type","button",1,"btn","btn-outline-primary",3,"ngClass","click"],["type","button",1,"btn","btn-primary","col-md-6",3,"click"]],template:function(i,o){1&i&&(e.TgZ(0,"div",0),e.YNc(1,ut,3,0,"ng-container",1),e.TgZ(2,"button",2),e.NdJ("click",function(){return o.leave()}),e._uU(3," Leave "),e.qZA()()),2&i&&(e.Q6J("ngClass",e.VKq(3,mt,o.showPlayButton())),e.xp6(),e.Q6J("ngIf",o.showPlayButton()),e.xp6(),e.Q6J("ngClass",e.WLB(5,ht,o.showPlayButton(),!o.showPlayButton())))},dependencies:[m.mk,m.O5],encapsulation:2})}return s})();const _t=["chat"],pt=["messageElement"];function bt(s,r){if(1&s&&(e.TgZ(0,"div",null,8)(2,"span",9),e._uU(3),e.qZA(),e._uU(4),e.qZA()),2&s){const t=r.$implicit;e.xp6(3),e.hij("",t.username,": "),e.xp6(),e.hij(" ",t.message," ")}}const ft=s=>({disabled:s});let se=(()=>{class s{lobbyStore;socket;subscriptions=[];messages=[];message=new c.NI(null,[c.kI.required.bind(this)]);chat;messageElements;constructor(t,i){this.lobbyStore=t,this.socket=i}ngOnInit(){this.subscriptions=[this.lobbyStore.messages.subscribe(t=>{this.messages=t})]}ngAfterViewInit(){this.scrollToBottom(),this.messageElements.changes.subscribe(this.scrollToBottom)}scrollToBottom=()=>{this.chat.nativeElement.scrollTop=this.chat.nativeElement.scrollHeight};ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}submit(){this.socket.emit("chat",this.message.value),this.message.setValue(null)}static \u0275fac=function(i){return new(i||s)(e.Y36(g),e.Y36(w.i))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-lobby-chat"]],viewQuery:function(i,o){if(1&i&&(e.Gf(_t,5),e.Gf(pt,5)),2&i){let n;e.iGM(n=e.CRH())&&(o.chat=n.first),e.iGM(n=e.CRH())&&(o.messageElements=n)}},decls:10,vars:5,consts:[[1,"bg-dark","p-4","chat-container","d-none","d-md-block"],[1,"chat"],["chat",""],[4,"ngFor","ngForOf"],[1,"input-group","align-self-center","w-100","mt-2",3,"ngSubmit"],["type","text","placeholder","Your message","aria-label","Your message","aria-describedby","button-addon2",1,"form-control",3,"formControl"],["type","submit","id","button-addon2",1,"btn","btn-outline-primary",3,"ngClass"],[1,"far","fa-paper-plane"],["messageElement",""],[1,"text-primary"]],template:function(i,o){1&i&&(e.TgZ(0,"div",0)(1,"div",1,2),e.YNc(3,bt,5,2,"div",3),e.qZA(),e.TgZ(4,"div")(5,"form",4),e.NdJ("ngSubmit",function(){return o.message.invalid||o.submit()}),e._UZ(6,"input",5),e.TgZ(7,"button",6),e._uU(8," Send "),e._UZ(9,"i",7),e.qZA()()()()),2&i&&(e.xp6(3),e.Q6J("ngForOf",o.messages),e.xp6(3),e.Q6J("formControl",o.message),e.xp6(),e.Q6J("ngClass",e.VKq(3,ft,o.message.invalid)))},dependencies:[m.mk,m.sg,c._Y,c.Fj,c.JJ,c.JL,c.F,c.oH],encapsulation:2})}return s})(),gt=(()=>{class s{static \u0275fac=function(i){return new(i||s)};static \u0275cmp=e.Xpm({type:s,selectors:[["app-lobby-waiting"]],decls:7,vars:0,consts:[[1,"row"],[1,"col-md-9","lobby-col"],[1,"d-md-none"],[1,"col-md-9"],[1,"col-md-3","lobby-col"],[1,"d-none","d-md-block","mb-md-2"]],template:function(i,o){1&i&&(e.TgZ(0,"div",0)(1,"div",1),e._UZ(2,"app-button-play",2)(3,"app-lobby-config",3),e.qZA(),e.TgZ(4,"div",4),e._UZ(5,"app-button-play",5)(6,"app-lobby-chat"),e.qZA()())},dependencies:[te,ie,se],encapsulation:2})}return s})();function vt(s,r){1&s&&e._UZ(0,"i",10)}function yt(s,r){1&s&&e._UZ(0,"i",11)}function Tt(s,r){1&s&&e._UZ(0,"span",12)}function wt(s,r){1&s&&e._UZ(0,"i",13)}function xt(s,r){1&s&&e._UZ(0,"i",14)}function kt(s,r){if(1&s){const t=e.EpF();e.TgZ(0,"div",15)(1,"div",16)(2,"div",17)(3,"i",18),e.NdJ("click",function(){e.CHM(t);const o=e.oxw().$implicit,n=e.oxw();return e.KtG(n.kick(o))}),e.qZA()()()()}}const St=(s,r)=>({"mx-2":s,"mx-3":r}),Ct=s=>({"text-muted":s});function It(s,r){if(1&s&&(e.ynx(0),e.TgZ(1,"div",2)(2,"div",3)(3,"div"),e.YNc(4,vt,1,0,"i",4)(5,yt,1,0,"i",5),e.TgZ(6,"span"),e._uU(7),e.qZA(),e.YNc(8,Tt,1,0,"span",6),e.qZA(),e.TgZ(9,"div"),e.YNc(10,wt,1,0,"i",7)(11,xt,1,0,"i",8),e.qZA(),e._UZ(12,"div"),e.qZA(),e.YNc(13,kt,4,0,"div",9),e.qZA(),e.BQk()),2&s){const t=r.$implicit,i=e.oxw();e.xp6(),e.Q6J("ngClass",e.WLB(10,St,i.me.role!==i.lobbyUserRoles.Host,i.me.role===i.lobbyUserRoles.Host)),e.xp6(),e.Q6J("@userStatus",i.getStatusClass(t))("ngClass",e.VKq(13,Ct,t.disconnected||t.role===i.lobbyUserRoles.Spectator)),e.xp6(2),e.Q6J("ngIf",t.role===i.lobbyUserRoles.Host),e.xp6(),e.Q6J("ngIf",t.role===i.lobbyUserRoles.Spectator&&!t.disconnected),e.xp6(2),e.Oqu(t.user.username),e.xp6(),e.Q6J("ngIf",t.status===i.lobbyUserStatus.Buffering),e.xp6(2),e.Q6J("ngIf",t.playedTheGame),e.xp6(),e.Q6J("ngIf",(null==i.lobby?null:i.lobby.hintMode)!==i.lobbyHintModes.Always&&t.hintMode),e.xp6(2),e.Q6J("ngIf",i.me.role===i.lobbyUserRoles.Host&&t.role===i.lobbyUserRoles.Player)}}let Mt=(()=>{class s{lobbyStore;socket;showRank=!1;users;me;lobby;lobbyHintModes=u.BF;lobbyUserRoles=v;lobbyUserStatus=C;subscriptions=[];constructor(t,i){this.lobbyStore=t,this.socket=i}ngOnInit(){this.subscriptions=[this.lobbyStore.users.subscribe(t=>{this.users=t}),this.lobbyStore.me.subscribe(t=>{this.me=t}),this.lobbyStore.lobby.subscribe(t=>{this.lobby=t})]}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}getStatusClass(t){return!1===t.correctAnswer?"wrongAnswer":!0===t.correctAnswer?"correctAnswer":"default"}kick(t){this.socket.emit("kick",t.user.username)}static \u0275fac=function(i){return new(i||s)(e.Y36(g),e.Y36(w.i))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-lobby-users"]],inputs:{showRank:"showRank"},decls:2,vars:1,consts:[[1,"row","justify-content-center","mt-2","users-container"],[4,"ngFor","ngForOf"],[1,"user-card","bg-dark","text-center","p-1","position-relative",3,"ngClass"],[1,"row","justify-content-between",3,"ngClass"],["class","fa fa-star",4,"ngIf"],["class","fa fa-ghost",4,"ngIf"],["class","text-white spinner-border spinner-border-sm","role","status","aria-hidden","true",4,"ngIf"],["class","text-info fa fa-gamepad mx-1",4,"ngIf"],["class","text-white far fa-eye mx-1",4,"ngIf"],["class","users-actions d-flex flex-column position-absolute","style","top: 0; right: -15px",4,"ngIf"],[1,"fa","fa-star"],[1,"fa","fa-ghost"],["role","status","aria-hidden","true",1,"text-white","spinner-border","spinner-border-sm"],[1,"text-info","fa","fa-gamepad","mx-1"],[1,"text-white","far","fa-eye","mx-1"],[1,"users-actions","d-flex","flex-column","position-absolute",2,"top","0","right","-15px"],[1,"bg-dark","pt-1"],[1,"col"],[1,"icon-action","text-danger","fa","fa-times",3,"click"]],template:function(i,o){1&i&&(e.TgZ(0,"div",0),e.YNc(1,It,14,15,"ng-container",1),e.qZA()),2&i&&(e.xp6(),e.Q6J("ngForOf",o.users))},dependencies:[m.mk,m.sg,m.O5],encapsulation:2,data:{animation:[(0,h.X$)("userStatus",[(0,h.SB)("wrongAnswer",(0,h.oB)({color:"white"})),(0,h.SB)("correctAnswer",(0,h.oB)({color:"green"})),(0,h.SB)("default",(0,h.oB)({color:"white"})),(0,h.eR)("* => wrongAnswer",[(0,h.jt)("1s",(0,h.F4)([(0,h.oB)({color:"red",offset:0}),(0,h.oB)({color:"white",offset:.75})]))])])]}})}return s})();var oe=l(6007),B=l(5861);const ne="audioPlayerVolume",re="mediaTypeOnReveal";let ae=(()=>{class s{getDefaultVolume(){return parseFloat(localStorage.getItem(ne)??"0.5")}setDefaultVolume(t){localStorage.setItem(ne,t.toString())}getDefaultMediaTypeOnReveal(){return parseInt(localStorage.getItem(re)??"2")}setDefaultMediaTypeOnReveal(t){localStorage.setItem(re,t.toString())}static \u0275fac=function(i){return new(i||s)};static \u0275prov=e.Yz7({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})();var le=l(2296),Q=l(617),V=l(7988);function At(s,r){1&s&&(e.TgZ(0,"mat-icon"),e._uU(1,"block"),e.qZA())}function Rt(s,r){1&s&&(e.TgZ(0,"mat-icon"),e._uU(1,"image"),e.qZA())}function Et(s,r){1&s&&(e.TgZ(0,"mat-icon"),e._uU(1,"movie"),e.qZA())}let Pt=(()=>{class s{lobbyStore;localStorageHelper;audio;lobby;subscriptions=[];gainNode;source;nextAudioBuffer;mediaTypeOnReveal;audioContext=new AudioContext;constructor(t,i){this.lobbyStore=t,this.localStorageHelper=i}ngOnInit(){var t=this;this.gainNode=this.audioContext.createGain(),this.gainNode.gain.value=this.getDefaultVolumeValue(),this.mediaTypeOnReveal=this.localStorageHelper.getDefaultMediaTypeOnReveal(),this.gainNode.connect(this.audioContext.destination),this.subscriptions=[this.lobbyStore.currentLobbyAudioBuffer.subscribe(function(){var i=(0,B.Z)(function*(o){null!==o?t.lobby.status===u.D.AnswerReveal&&t.lobby.playMusicOnAnswerReveal?t.nextAudioBuffer=o:(t.source?.stop(),t.setSourceNull(),yield t.setSource(o)):t.setSourceNull(),t.lobby?.status===u.D.PlayingMusic&&(t.gainNode.gain.value=t.getDefaultVolumeValue(),t.source?.start())});return function(o){return i.apply(this,arguments)}}()),this.lobbyStore.lobby.subscribe(function(){var i=(0,B.Z)(function*(o){t.lobby=o,o&&(o.status===u.D.AnswerReveal&&(o.playMusicOnAnswerReveal?setTimeout(()=>{t.gainNode.gain.setValueAtTime(t.gainNode.gain.value,t.audioContext.currentTime),t.gainNode.gain.exponentialRampToValueAtTime(.01,t.audioContext.currentTime+5)},5e3):t.setSourceNull()),o.status===u.D.PlayingMusic&&(t.nextAudioBuffer&&(t.source?.stop(),t.setSourceNull(),yield t.setSource(t.nextAudioBuffer),t.nextAudioBuffer=void 0),t.gainNode.gain.value=t.getDefaultVolumeValue(),t.source?.start()),!o.playMusicOnAnswerReveal&&o.status!==u.D.PlayingMusic&&t.setSourceNull(),o.status===u.D.Buffering&&t.setSourceNull())});return function(o){return i.apply(this,arguments)}}()),this.lobbyStore.resumeMusic.subscribe((0,B.Z)(function*(){yield t.audioContext.resume(),t.lobbyStore.setCanPlayMusic("running"===t.audioContext.state)}))]}ngOnDestroy(){this.setSourceNull(),this.audioContext.suspend(),this.subscriptions.forEach(t=>t.unsubscribe())}setSource(t){var i=this;return(0,B.Z)(function*(){i.gainNode.gain.value=i.getDefaultVolumeValue();const o=yield i.audioContext.decodeAudioData(t);i.source=i.audioContext.createBufferSource(),i.source.buffer=o,i.source.connect(i.gainNode),i.lobbyStore.setCanPlayMusic("running"===i.audioContext.state)})()}setSourceNull(){this.source&&(this.source.buffer=null)}getDefaultVolumeValue(){return this.localStorageHelper.getDefaultVolume()}updateVolume(t){const i=t.valueAsNumber;this.gainNode.gain.value=i,this.localStorageHelper.setDefaultVolume(i)}getDefaultMediaTypeOnReveal(){return this.localStorageHelper.getDefaultMediaTypeOnReveal()}updateMediaTypeOnReveal(t){this.mediaTypeOnReveal=t,this.localStorageHelper.setDefaultMediaTypeOnReveal(t)}static \u0275fac=function(i){return new(i||s)(e.Y36(g),e.Y36(ae))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-lobby-audio-player"]],decls:13,vars:12,consts:[["aria-label","unit(s)","color","primary",3,"min","max","step","input"],["matSliderThumb","",3,"value"],["mat-icon-button","",1,"mat-icon-button",3,"matMenuTriggerFor"],["color","primary"],["xPosition","before"],["menu","matMenu"],["mat-menu-item","","mdbTooltip","Answer reveal media type"],[4,"ngIf"],["color","primary",3,"min","max","step","click"],["matSliderThumb","",3,"value","valueChange"]],template:function(i,o){if(1&i&&(e.TgZ(0,"mat-slider",0),e.NdJ("input",function(a){return o.updateVolume(a.target)}),e._UZ(1,"input",1),e.qZA(),e.TgZ(2,"button",2)(3,"mat-icon",3),e._uU(4,"more_vert"),e.qZA()(),e.TgZ(5,"mat-menu",4,5)(7,"button",6),e.YNc(8,At,2,0,"mat-icon",7)(9,Rt,2,0,"mat-icon",7)(10,Et,2,0,"mat-icon",7),e.TgZ(11,"mat-slider",8),e.NdJ("click",function(a){return a.stopPropagation()}),e.TgZ(12,"input",9),e.NdJ("valueChange",function(a){return o.updateMediaTypeOnReveal(a)}),e.qZA()()()()),2&i){const n=e.MAs(6);e.Q6J("min",0)("max",1)("step",.001),e.xp6(),e.Q6J("value",o.getDefaultVolumeValue()),e.xp6(),e.Q6J("matMenuTriggerFor",n),e.xp6(6),e.Q6J("ngIf",!o.mediaTypeOnReveal),e.xp6(),e.Q6J("ngIf",1===o.mediaTypeOnReveal),e.xp6(),e.Q6J("ngIf",2===o.mediaTypeOnReveal),e.xp6(),e.Q6J("min",0)("max",2)("step",1),e.xp6(),e.Q6J("value",o.getDefaultMediaTypeOnReveal())}},dependencies:[m.O5,le.RK,z,P,Q.Hw,U,V.VK,V.OP,V.p6],encapsulation:2})}return s})();var de=l(2096),Dt=l(3997),ce=l(4664),ue=l(5438),me=l(4630);const Zt=["answerInput"],Ut=["trigger"];function Bt(s,r){if(1&s&&e._UZ(0,"mat-option",7),2&s){const t=r.$implicit;e.Q6J("value",t.name)("innerHtml",""+t.highlight+"",e.oJD)}}let Vt=(()=>{class s{lobbyHttpService;lobbyStore;gameHttpService;socket;cdf;myControl=new c.NI;gameNames;lobby;me=null;lobbyStatuses=u.D;subscriptions=[];answerInput;matAutocompleteTrigger;constructor(t,i,o,n,a){this.lobbyHttpService=t,this.lobbyStore=i,this.gameHttpService=o,this.socket=n,this.cdf=a}ngOnInit(){this.gameNames=this.myControl.valueChanges.pipe((0,Dt.x)(),(0,ce.w)(t=>t?this.gameHttpService.getNames(t):(0,de.of)(null)))}ngAfterViewInit(){this.subscriptions=[this.lobbyStore.lobby.subscribe(t=>{null!==t&&(this.me?.role===v.Spectator?this.myControl.disable():[u.D.AnswerReveal,u.D.Buffering].includes(t.status)?(this.myControl.disable(),this.matAutocompleteTrigger.closePanel(),this.cdf.detectChanges()):(this.myControl.enable(),this.myControl.setValue(""),this.answerInput.nativeElement.focus(),this.cdf.detectChanges())),this.lobby=t}),this.lobbyStore.me.subscribe(t=>{null!==t&&!0===t.correctAnswer&&this.myControl.disable()})]}submit(){this.socket.emit("answer",this.myControl.value),this.myControl.setValue(null)}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}static \u0275fac=function(i){return new(i||s)(e.Y36(I.Y),e.Y36(g),e.Y36(ue.q),e.Y36(w.i),e.Y36(e.sBO))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-lobby-answer"]],viewQuery:function(i,o){if(1&i&&(e.Gf(Zt,5),e.Gf(Ut,5)),2&i){let n;e.iGM(n=e.CRH())&&(o.answerInput=n.first),e.iGM(n=e.CRH())&&(o.matAutocompleteTrigger=n.first)}},decls:10,vars:9,consts:[[3,"ngSubmit"],["id","lobby-autocomplete",2,"width","100%"],["type","text","placeholder","Type your answer here...","aria-label","Number","matInput","","autocomplete","off","autocapitalize","off","spellcheck","false",3,"formControl","matAutocomplete"],["answerInput","","trigger","matAutocompleteTrigger"],[3,"optionSelected"],["auto","matAutocomplete"],[3,"value","innerHtml",4,"ngFor","ngForOf"],[3,"value","innerHtml"]],template:function(i,o){if(1&i&&(e.TgZ(0,"form",0),e.NdJ("ngSubmit",function(){return o.lobby.status===o.lobbyStatuses.AnswerReveal||!o.myControl.value||o.submit()}),e.TgZ(1,"mat-form-field",1),e._UZ(2,"input",2,3),e.TgZ(5,"mat-autocomplete",4,5),e.NdJ("optionSelected",function(){return o.lobby.status===o.lobbyStatuses.AnswerReveal||o.submit()}),e.YNc(7,Bt,1,2,"mat-option",6),e.ALo(8,"slice"),e.ALo(9,"async"),e.qZA()()()),2&i){const n=e.MAs(6);e.xp6(2),e.Q6J("formControl",o.myControl)("matAutocomplete",n),e.xp6(5),e.Q6J("ngForOf",e.Dn7(8,3,e.lcZ(9,7,o.gameNames),0,30))}},dependencies:[m.sg,A.KE,me.XC,y.ey,me.ZL,q.Nt,c._Y,c.Fj,c.JJ,c.JL,c.F,c.oH,m.Ov,m.OU],encapsulation:2})}return s})();function Lt(s,r){if(1&s&&(e.TgZ(0,"div",1),e._uU(1),e.qZA()),2&s){const t=e.oxw();e.xp6(),e.hij(" ",t.countdown,"\n")}}let Ot=(()=>{class s{lobbyStore;countdown;countdownInterval;subscriptions;constructor(t){this.lobbyStore=t}ngOnInit(){this.subscriptions=[this.lobbyStore.lobby.subscribe(t=>{this.countdownInterval&&clearInterval(this.countdownInterval),t?.status===u.D.PlayingMusic?(this.countdown=t.guessTime-1,this.startCountdown()):t?.status===u.D.AnswerReveal&&(this.countdown=void 0)}),this.lobbyStore.currentLobbyMusic.subscribe(t=>{t?.musicFinishesIn&&(this.countdownInterval&&clearInterval(this.countdownInterval),this.countdown=t.musicFinishesIn-1,this.startCountdown())})]}ngOnDestroy(){clearInterval(this.countdownInterval),this.subscriptions.forEach(t=>t.unsubscribe())}startCountdown(){this.countdownInterval=setInterval(()=>{this.countdown>0?this.countdown--:(this.countdown=void 0,clearInterval(this.countdownInterval))},1e3)}static \u0275fac=function(i){return new(i||s)(e.Y36(g))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-lobby-countdown"]],decls:1,vars:1,consts:[["class","align-self-center countdown",4,"ngIf"],[1,"align-self-center","countdown"]],template:function(i,o){1&i&&e.YNc(0,Lt,2,1,"div",0),2&i&&e.Q6J("ngIf",void 0!==o.countdown)},dependencies:[m.O5],encapsulation:2})}return s})();const he=s=>({timing:s}),_e=(s,r)=>({value:s,params:r});function Nt(s,r){if(1&s&&e._UZ(0,"div",2),2&s){const t=e.oxw();e.Q6J("@countdownProgress",e.WLB(3,_e,t.lobby.status===t.lobbyStatuses.PlayingMusic?"empty":"full",e.VKq(1,he,t.lobby.guessTime)))}}function Ft(s,r){if(1&s&&e._UZ(0,"div",2),2&s){const t=e.oxw();e.Udp("width",t.timeRemaining/t.lobby.guessTime*100+"%"),e.Q6J("@countdownProgress",e.WLB(5,_e,t.lobby.status===t.lobbyStatuses.PlayingMusic?"empty":"full",e.VKq(3,he,t.timeRemaining)))}}let Ht=(()=>{class s{lobbyStore;subscriptions;lobby;lobbyStatuses=u.D;timeRemaining;constructor(t){this.lobbyStore=t}ngOnInit(){this.subscriptions=[this.lobbyStore.lobby.subscribe(t=>{this.lobby=t,this.timeRemaining=void 0}),this.lobbyStore.currentLobbyMusic.subscribe(t=>{this.timeRemaining=t?.musicFinishesIn?t.musicFinishesIn:void 0})]}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}static \u0275fac=function(i){return new(i||s)(e.Y36(g))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-lobby-countdown-progress"]],decls:2,vars:2,consts:[["style","height: 1px",4,"ngIf"],["style","height: 1px",3,"width",4,"ngIf"],[2,"height","1px"]],template:function(i,o){1&i&&e.YNc(0,Nt,1,6,"div",0)(1,Ft,1,8,"div",1),2&i&&(e.Q6J("ngIf",!o.timeRemaining),e.xp6(),e.Q6J("ngIf",o.timeRemaining))},dependencies:[m.O5],encapsulation:2,data:{animation:[(0,h.X$)("countdownProgress",[(0,h.SB)("full",(0,h.oB)({width:"100%"})),(0,h.SB)("empty",(0,h.oB)({width:"0"})),(0,h.SB)("default",(0,h.oB)({width:"25%"})),(0,h.eR)("* => empty",[(0,h.jt)("{{timing}}s")],{params:{timing:"20"}}),(0,h.eR)("* => full",[(0,h.jt)("10s")])])]}})}return s})();var Qt=l(2599);function Yt(s,r){if(1&s){const t=e.EpF();e.TgZ(0,"button",3),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.enableHintMode())}),e._uU(1,"Hint"),e.qZA()}}function Jt(s,r){if(1&s){const t=e.EpF();e.TgZ(0,"mat-slide-toggle",4),e.NdJ("change",function(o){e.CHM(t);const n=e.oxw(2);return e.KtG(n.toggleKeepHintMode(o))}),e._uU(1,"Keep hint mode "),e.qZA()}if(2&s){const t=e.oxw(2);e.Q6J("checked",null==t.me?null:t.me.keepHintMode)}}function qt(s,r){if(1&s&&(e.ynx(0),e.YNc(1,Yt,2,0,"button",1)(2,Jt,2,1,"mat-slide-toggle",2),e.BQk()),2&s){const t=e.oxw();e.xp6(),e.Q6J("ngIf",!(null!=t.me&&t.me.hintMode)),e.xp6(),e.Q6J("ngIf",null==t.me?null:t.me.hintMode)}}let Gt=(()=>{class s{lobbyStore;lobbySocket;subscriptions=[];me;lobby;lobbyHintMode=u.BF;constructor(t,i){this.lobbyStore=t,this.lobbySocket=i}ngOnInit(){this.subscriptions=[this.lobbyStore.me.subscribe(t=>{t&&(this.me=t)}),this.lobbyStore.lobby.subscribe(t=>{t&&(this.lobby=t)})]}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}enableHintMode(){this.lobbySocket.emit("enableHintMode")}toggleKeepHintMode(t){this.lobbySocket.emit("toggleKeepHintMode",t.checked)}static \u0275fac=function(i){return new(i||s)(e.Y36(g),e.Y36(w.i))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-hint-mode-toggle"]],decls:1,vars:1,consts:[[4,"ngIf"],["class","btn btn-primary btn-sm",3,"click",4,"ngIf"],["color","primary",3,"checked","change",4,"ngIf"],[1,"btn","btn-primary","btn-sm",3,"click"],["color","primary",3,"checked","change"]],template:function(i,o){1&i&&e.YNc(0,qt,3,2,"ng-container",0),2&i&&e.Q6J("ngIf",o.lobby.hintMode===o.lobbyHintMode.Allowed)},dependencies:[m.O5,Qt.Rr],encapsulation:2})}return s})();const Xt=["xd"];function jt(s,r){if(1&s&&(e.ynx(0),e._UZ(1,"input",2),e.TgZ(2,"label",3)(3,"span",4,5),e._uU(5),e.qZA()(),e.BQk()),2&s){const t=r.$implicit,i=r.index,o=e.oxw();e.xp6(),e.Q6J("id",i)("formControl",o.formControl)("value",t),e.xp6(),e.Q6J("for",i),e.xp6(3),e.Oqu(t)}}let zt=(()=>{class s{lobbyStore;lobbySocket;subscriptions=[];games=[];formControl=new c.NI("");spans;constructor(t,i){this.lobbyStore=t,this.lobbySocket=i}ngOnInit(){this.subscriptions=[this.lobbyStore.hintModeGames.subscribe(t=>{this.games=t}),this.formControl.valueChanges.subscribe(t=>{this.lobbySocket.emit("answer",t)}),this.lobbyStore.me.subscribe(t=>{t&&(t.role===v.Spectator||t.correctAnswer)&&this.formControl.disable()})]}ngAfterViewInit(){setTimeout(()=>{this.spans.forEach(t=>{let o=2;t.nativeElement.offsetHeight>55&&(o=110/t.nativeElement.offsetHeight),t.nativeElement.style.fontSize=`${o}vh`})},1)}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}static \u0275fac=function(i){return new(i||s)(e.Y36(g),e.Y36(w.i))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-hint-mode"]],viewQuery:function(i,o){if(1&i&&e.Gf(Xt,5),2&i){let n;e.iGM(n=e.CRH())&&(o.spans=n)}},decls:2,vars:1,consts:[[1,"d-flex","flex-wrap","justify-content-between",2,"height","260px"],[4,"ngFor","ngForOf"],["type","radio","name","btnradio","autocomplete","off",1,"btn-check",3,"id","formControl","value"],[1,"btn","btn-outline-primary","col-12","col-md-5","d-flex","justify-content-center",2,"height","60px",3,"for"],[1,"align-self-center","hint-mode-answer"],["xd",""]],template:function(i,o){1&i&&(e.TgZ(0,"div",0),e.YNc(1,jt,6,5,"ng-container",1),e.qZA()),2&i&&(e.xp6(),e.Q6J("ngForOf",o.games))},dependencies:[m.sg,c.Fj,c._,c.JJ,c.oH],encapsulation:2})}return s})();var pe=l(5592),Wt=l(4674),$t=l(7400);function be(s,r,t){return t?be(s,r).pipe((0,$t.Z)(t)):new pe.y(i=>{const o=(...a)=>i.next(1===a.length?a[0]:a),n=s(o);return(0,Wt.m)(r)?()=>r(o,n):void 0})}const Kt=["youtubeContainer"];function ei(s,r){if(1&s){const t=e.EpF();e.TgZ(0,"youtube-player-placeholder",2),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o._load(!0))}),e.qZA()}if(2&s){const t=e.oxw();e.Q6J("videoId",t.videoId)("width",t.width)("height",t.height)("isLoading",t._isLoading)("buttonLabel",t.placeholderButtonLabel)("quality",t.placeholderImageQuality)}}let ti=(()=>{class s{_getBackgroundImage(){let t;return t="low"===this.quality?`https://i.ytimg.com/vi/${this.videoId}/hqdefault.jpg`:"high"===this.quality?`https://i.ytimg.com/vi/${this.videoId}/maxresdefault.jpg`:`https://i.ytimg.com/vi_webp/${this.videoId}/sddefault.webp`,`url(${t})`}static#e=this.\u0275fac=function(i){return new(i||s)};static#t=this.\u0275cmp=e.Xpm({type:s,selectors:[["youtube-player-placeholder"]],hostAttrs:[1,"youtube-player-placeholder"],hostVars:8,hostBindings:function(i,o){2&i&&(e.Udp("background-image",o._getBackgroundImage())("width",o.width,"px")("height",o.height,"px"),e.ekj("youtube-player-placeholder-loading",o.isLoading))},inputs:{videoId:"videoId",width:"width",height:"height",isLoading:"isLoading",buttonLabel:"buttonLabel",quality:"quality"},standalone:!0,features:[e.jDz],decls:4,vars:1,consts:[["type","button",1,"youtube-player-placeholder-button"],["height","100%","version","1.1","viewBox","0 0 68 48","focusable","false","aria-hidden","true"],["d","M66.52,7.74c-0.78-2.93-2.49-5.41-5.42-6.19C55.79,.13,34,0,34,0S12.21,.13,6.9,1.55 C3.97,2.33,2.27,4.81,1.48,7.74C0.06,13.05,0,24,0,24s0.06,10.95,1.48,16.26c0.78,2.93,2.49,5.41,5.42,6.19 C12.21,47.87,34,48,34,48s21.79-0.13,27.1-1.55c2.93-0.78,4.64-3.26,5.42-6.19C67.94,34.95,68,24,68,24S67.94,13.05,66.52,7.74z","fill","#f00"],["d","M 45,24 27,14 27,34","fill","#fff"]],template:function(i,o){1&i&&(e.TgZ(0,"button",0),e.O4$(),e.TgZ(1,"svg",1),e._UZ(2,"path",2)(3,"path",3),e.qZA()()),2&i&&e.uIk("aria-label",o.buttonLabel)},styles:[".youtube-player-placeholder{display:flex;align-items:center;justify-content:center;width:100%;overflow:hidden;cursor:pointer;background-color:#000;background-position:center center;background-size:cover;transition:box-shadow 300ms ease;box-shadow:inset 0 120px 90px -90px rgba(0,0,0,.8)}.youtube-player-placeholder-button{transition:opacity 300ms ease;-moz-appearance:none;-webkit-appearance:none;background:none;border:none;padding:0;display:flex}.youtube-player-placeholder-button svg{width:68px;height:48px}.youtube-player-placeholder-loading{box-shadow:none}.youtube-player-placeholder-loading .youtube-player-placeholder-button{opacity:0}"],encapsulation:2,changeDetection:0})}return s})();const ii=new e.OlP("YOUTUBE_PLAYER_CONFIG");function ve(s){return null==s?s:(0,e.Cb_)(s,0)}let si=(()=>{class s{get height(){return this._height}set height(t){this._height=null==t||isNaN(t)?390:t}get width(){return this._width}set width(t){this._width=null==t||isNaN(t)?640:t}constructor(t,i){this._ngZone=t,this._destroyed=new R.x,this._playerChanges=new p.X(void 0),this._nonce=(0,e.f3M)(e.Ojb,{optional:!0}),this._changeDetectorRef=(0,e.f3M)(e.sBO),this._isLoading=!1,this._hasPlaceholder=!0,this._height=390,this._width=640,this.disableCookies=!1,this.disablePlaceholder=!1,this.showBeforeIframeApiLoads=!1,this.ready=this._getLazyEmitter("onReady"),this.stateChange=this._getLazyEmitter("onStateChange"),this.error=this._getLazyEmitter("onError"),this.apiChange=this._getLazyEmitter("onApiChange"),this.playbackQualityChange=this._getLazyEmitter("onPlaybackQualityChange"),this.playbackRateChange=this._getLazyEmitter("onPlaybackRateChange");const o=(0,e.f3M)(ii,{optional:!0});this.loadApi=o?.loadApi??!0,this.disablePlaceholder=!!o?.disablePlaceholder,this.placeholderButtonLabel=o?.placeholderButtonLabel||"Play video",this.placeholderImageQuality=o?.placeholderImageQuality||"standard",this._isBrowser=(0,m.NF)(i)}ngAfterViewInit(){this._conditionallyLoad()}ngOnChanges(t){this._shouldRecreatePlayer(t)?this._conditionallyLoad():this._player&&((t.width||t.height)&&this._setSize(),t.suggestedQuality&&this._setQuality(),(t.startSeconds||t.endSeconds||t.suggestedQuality)&&this._cuePlayer())}ngOnDestroy(){this._pendingPlayer?.destroy(),this._player&&(this._player.destroy(),window.onYouTubeIframeAPIReady=this._existingApiReadyCallback),this._playerChanges.complete(),this._destroyed.next(),this._destroyed.complete()}playVideo(){this._player?this._player.playVideo():this._getPendingState().playbackState=YT.PlayerState.PLAYING}pauseVideo(){this._player?this._player.pauseVideo():this._getPendingState().playbackState=YT.PlayerState.PAUSED}stopVideo(){this._player?this._player.stopVideo():this._getPendingState().playbackState=YT.PlayerState.CUED}seekTo(t,i){this._player?this._player.seekTo(t,i):this._getPendingState().seek={seconds:t,allowSeekAhead:i}}mute(){this._player?this._player.mute():this._getPendingState().muted=!0}unMute(){this._player?this._player.unMute():this._getPendingState().muted=!1}isMuted(){return this._player?this._player.isMuted():!!this._pendingPlayerState&&!!this._pendingPlayerState.muted}setVolume(t){this._player?this._player.setVolume(t):this._getPendingState().volume=t}getVolume(){return this._player?this._player.getVolume():this._pendingPlayerState&&null!=this._pendingPlayerState.volume?this._pendingPlayerState.volume:0}setPlaybackRate(t){if(this._player)return this._player.setPlaybackRate(t);this._getPendingState().playbackRate=t}getPlaybackRate(){return this._player?this._player.getPlaybackRate():this._pendingPlayerState&&null!=this._pendingPlayerState.playbackRate?this._pendingPlayerState.playbackRate:0}getAvailablePlaybackRates(){return this._player?this._player.getAvailablePlaybackRates():[]}getVideoLoadedFraction(){return this._player?this._player.getVideoLoadedFraction():0}getPlayerState(){if(this._isBrowser&&window.YT)return this._player?this._player.getPlayerState():this._pendingPlayerState&&null!=this._pendingPlayerState.playbackState?this._pendingPlayerState.playbackState:YT.PlayerState.UNSTARTED}getCurrentTime(){return this._player?this._player.getCurrentTime():this._pendingPlayerState&&this._pendingPlayerState.seek?this._pendingPlayerState.seek.seconds:0}getPlaybackQuality(){return this._player?this._player.getPlaybackQuality():"default"}getAvailableQualityLevels(){return this._player?this._player.getAvailableQualityLevels():[]}getDuration(){return this._player?this._player.getDuration():0}getVideoUrl(){return this._player?this._player.getVideoUrl():""}getVideoEmbedCode(){return this._player?this._player.getVideoEmbedCode():""}_load(t){this._isBrowser&&(window.YT&&window.YT.Player?this._createPlayer(t):(this.loadApi&&(this._isLoading=!0,function oi(s){if(Y)return;const t=document.createElement("script"),i=o=>{t.removeEventListener("load",i),t.removeEventListener("error",i),"error"===o.type&&(Y=!1)};t.addEventListener("load",i),t.addEventListener("error",i),t.src="https://www.youtube.com/iframe_api",t.async=!0,s&&(t.nonce=s),Y=!0,document.body.appendChild(t)}(this._nonce)),this._existingApiReadyCallback=window.onYouTubeIframeAPIReady,window.onYouTubeIframeAPIReady=()=>{this._existingApiReadyCallback?.(),this._ngZone.run(()=>this._createPlayer(t))}))}_conditionallyLoad(){this._shouldShowPlaceholder()?1===this.playerVars?.autoplay&&this._load(!0):this._load(!1)}_shouldShowPlaceholder(){return!this.disablePlaceholder&&(!this._isBrowser||this._hasPlaceholder&&!!this.videoId&&!this._player)}_getPendingState(){return this._pendingPlayerState||(this._pendingPlayerState={}),this._pendingPlayerState}_shouldRecreatePlayer(t){const i=t.videoId||t.playerVars||t.disableCookies||t.disablePlaceholder;return!!i&&!i.isFirstChange()}_createPlayer(t){if(this._player?.destroy(),this._pendingPlayer?.destroy(),typeof YT>"u"||!this.videoId&&!this.playerVars?.list)return;const i=this._ngZone.runOutsideAngular(()=>new YT.Player(this.youtubeContainer.nativeElement,{videoId:this.videoId,host:this.disableCookies?"https://www.youtube-nocookie.com":void 0,width:this.width,height:this.height,playerVars:t?{...this.playerVars||{},autoplay:1}:this.playerVars})),o=()=>{this._ngZone.run(()=>{this._isLoading=!1,this._hasPlaceholder=!1,this._player=i,this._pendingPlayer=void 0,i.removeEventListener("onReady",o),this._playerChanges.next(i),this._setSize(),this._setQuality(),this._pendingPlayerState&&(this._applyPendingPlayerState(i,this._pendingPlayerState),this._pendingPlayerState=void 0);const n=i.getPlayerState();(n===YT.PlayerState.UNSTARTED||n===YT.PlayerState.CUED||null==n)&&this._cuePlayer(),this._changeDetectorRef.markForCheck()})};this._pendingPlayer=i,i.addEventListener("onReady",o)}_applyPendingPlayerState(t,i){const{playbackState:o,playbackRate:n,volume:a,muted:b,seek:f}=i;switch(o){case YT.PlayerState.PLAYING:t.playVideo();break;case YT.PlayerState.PAUSED:t.pauseVideo();break;case YT.PlayerState.CUED:t.stopVideo()}null!=n&&t.setPlaybackRate(n),null!=a&&t.setVolume(a),null!=b&&(b?t.mute():t.unMute()),null!=f&&t.seekTo(f.seconds,f.allowSeekAhead)}_cuePlayer(){this._player&&this.videoId&&this._player.cueVideoById({videoId:this.videoId,startSeconds:this.startSeconds,endSeconds:this.endSeconds,suggestedQuality:this.suggestedQuality})}_setSize(){this._player?.setSize(this.width,this.height)}_setQuality(){this._player&&this.suggestedQuality&&this._player.setPlaybackQuality(this.suggestedQuality)}_getLazyEmitter(t){return this._playerChanges.pipe((0,ce.w)(i=>i?be(o=>{i.addEventListener(t,o)},o=>{try{i?.removeEventListener?.(t,o)}catch{}}):(0,de.of)()),i=>new pe.y(o=>i.subscribe({next:n=>this._ngZone.run(()=>o.next(n)),error:n=>o.error(n),complete:()=>o.complete()})),(0,Z.R)(this._destroyed))}static#e=this.\u0275fac=function(i){return new(i||s)(e.Y36(e.R0b),e.Y36(e.Lbi))};static#t=this.\u0275cmp=e.Xpm({type:s,selectors:[["youtube-player"]],viewQuery:function(i,o){if(1&i&&e.Gf(Kt,7),2&i){let n;e.iGM(n=e.CRH())&&(o.youtubeContainer=n.first)}},inputs:{videoId:"videoId",height:[e.lbL.HasDecoratorInputTransform,"height","height",e.Cb_],width:[e.lbL.HasDecoratorInputTransform,"width","width",e.Cb_],startSeconds:[e.lbL.HasDecoratorInputTransform,"startSeconds","startSeconds",ve],endSeconds:[e.lbL.HasDecoratorInputTransform,"endSeconds","endSeconds",ve],suggestedQuality:"suggestedQuality",playerVars:"playerVars",disableCookies:[e.lbL.HasDecoratorInputTransform,"disableCookies","disableCookies",e.VuI],loadApi:[e.lbL.HasDecoratorInputTransform,"loadApi","loadApi",e.VuI],disablePlaceholder:[e.lbL.HasDecoratorInputTransform,"disablePlaceholder","disablePlaceholder",e.VuI],showBeforeIframeApiLoads:[e.lbL.HasDecoratorInputTransform,"showBeforeIframeApiLoads","showBeforeIframeApiLoads",e.VuI],placeholderButtonLabel:"placeholderButtonLabel",placeholderImageQuality:"placeholderImageQuality"},outputs:{ready:"ready",stateChange:"stateChange",error:"error",apiChange:"apiChange",playbackQualityChange:"playbackQualityChange",playbackRateChange:"playbackRateChange"},standalone:!0,features:[e.Xq5,e.TTD,e.jDz],decls:4,vars:3,consts:[[3,"videoId","width","height","isLoading","buttonLabel","quality"],["youtubeContainer",""],[3,"videoId","width","height","isLoading","buttonLabel","quality","click"]],template:function(i,o){1&i&&(e.YNc(0,ei,1,6,"youtube-player-placeholder",0),e.TgZ(1,"div"),e._UZ(2,"div",null,1),e.qZA()),2&i&&(e.um2(0,o._shouldShowPlaceholder()?0:-1),e.xp6(),e.Udp("display",o._shouldShowPlaceholder()?"none":""))},dependencies:[ti],encapsulation:2,changeDetection:0})}return s})(),Y=!1,ni=(()=>{class s{static#e=this.\u0275fac=function(i){return new(i||s)};static#t=this.\u0275mod=e.oAB({type:s});static#i=this.\u0275inj=e.cJS({})}return s})();const ri=["youtubePlayer"];function ai(s,r){if(1&s&&e._UZ(0,"youtube-player",2,3),2&s){const t=e.oxw();e.Q6J("videoId",t.lobbyMusic.video.videoId)("playerVars",t.playerVars)("disablePlaceholder",!0)}}const li=s=>({opacity:s});function di(s,r){if(1&s&&e._UZ(0,"img",6),2&s){const t=r.$implicit,i=r.index,o=e.oxw(2);e.Q6J("ngStyle",e.VKq(2,li,o.currentScreenshotIndex===i?1:0))("src","https://images.igdb.com/igdb/image/upload/t_1080p/"+t.imageId+".jpg",e.LSH)}}function ci(s,r){if(1&s&&(e.TgZ(0,"div",4),e.YNc(1,di,1,4,"img",5),e.qZA()),2&s){const t=e.oxw();e.xp6(),e.Q6J("ngForOf",t.lobbyMusic.screenshots)}}let ui=(()=>{class s{lobbyStore;localStorageHelper;subscriptions=[];playerVars={autoplay:1,controls:0,showinfo:0,rel:0,modestbranding:1};mediaTypeOnReveal;lobbyMusic=null;currentScreenshotIndex=0;youtubePlayer;constructor(t,i){this.lobbyStore=t,this.localStorageHelper=i,this.mediaTypeOnReveal=i.getDefaultMediaTypeOnReveal(),setTimeout(()=>{this.currentScreenshotIndex=1},5e3)}ngOnInit(){this.subscriptions=[this.lobbyStore.currentLobbyMusicAnswer.subscribe(t=>{this.lobbyMusic=t})]}ngAfterViewInit(){this.subscriptions.push(this.youtubePlayer.changes.subscribe({next:t=>{t.first?.seekTo(this.lobbyMusic.startVideoAt,!0),t.first?.mute()}}))}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}static \u0275fac=function(i){return new(i||s)(e.Y36(g),e.Y36(ae))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-answer-reveal-media"]],viewQuery:function(i,o){if(1&i&&e.Gf(ri,5),2&i){let n;e.iGM(n=e.CRH())&&(o.youtubePlayer=n)}},decls:2,vars:2,consts:[["class","game-reveal-video-media","suggestedQuality","default",3,"videoId","playerVars","disablePlaceholder",4,"ngIf"],["class","d-flex",4,"ngIf"],["suggestedQuality","default",1,"game-reveal-video-media",3,"videoId","playerVars","disablePlaceholder"],["youtubePlayer",""],[1,"d-flex"],["class","game-reveal-picture-media","alt","screenshot",3,"ngStyle","src",4,"ngFor","ngForOf"],["alt","screenshot",1,"game-reveal-picture-media",3,"ngStyle","src"]],template:function(i,o){1&i&&e.YNc(0,ai,2,3,"youtube-player",0)(1,ci,2,1,"div",1),2&i&&(e.Q6J("ngIf",2===o.mediaTypeOnReveal&&(null==o.lobbyMusic?null:o.lobbyMusic.video)),e.xp6(),e.Q6J("ngIf",(1===o.mediaTypeOnReveal||2===o.mediaTypeOnReveal&&!(null!=o.lobbyMusic&&o.lobbyMusic.video))&&o.lobbyMusic&&o.lobbyMusic.screenshots.length>0))},dependencies:[m.sg,m.O5,m.PC,si],encapsulation:2})}return s})();function mi(s,r){1&s&&e._UZ(0,"div")}function hi(s,r){if(1&s&&(e.TgZ(0,"div",9),e._uU(1),e._UZ(2,"mat-progress-bar",10),e.qZA()),2&s){const t=e.oxw();e.xp6(),e.hij(" ",t.loadProgress,"% "),e.xp6(),e.Q6J("value",t.loadProgress)}}function _i(s,r){1&s&&e._UZ(0,"app-hint-mode-toggle")}function pi(s,r){if(1&s){const t=e.EpF();e.TgZ(0,"div",11)(1,"p"),e._uU(2,"Press the button to start playing"),e._UZ(3,"br"),e._uU(4,"(Music will play on the next loop)"),e.qZA(),e.TgZ(5,"button",12),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.play())}),e._uU(6,"Play"),e.qZA()()}}const bi=s=>({"text-warning":s});function fi(s,r){if(1&s&&(e.TgZ(0,"div",13),e._UZ(1,"span",14),e.qZA()),2&s){const t=e.oxw();e.Q6J("title",t.serverBuffering?"server loading...":"client loading..."),e.xp6(),e.Q6J("ngClass",e.VKq(2,bi,t.serverBuffering))}}function gi(s,r){if(1&s&&(e.TgZ(0,"div",15)(1,"small",16),e._uU(2),e.qZA()()),2&s){const t=e.oxw();e.xp6(2),e.Oqu(t.error)}}const ye=s=>({"d-none":s});function vi(s,r){if(1&s&&(e.TgZ(0,"div",17),e._uU(1," Buffering... "),e.qZA()),2&s){const t=e.oxw();e.Q6J("ngClass",e.VKq(1,ye,!t.canPlayMusic))}}function yi(s,r){if(1&s&&e._UZ(0,"app-lobby-countdown",18),2&s){const t=e.oxw();e.Q6J("ngClass",e.VKq(1,ye,!t.canPlayMusic))}}function Ti(s,r){1&s&&e._UZ(0,"app-hint-mode")}function wi(s,r){1&s&&e._UZ(0,"app-lobby-answer",9)}function xi(s,r){1&s&&e._UZ(0,"div")}function ki(s,r){1&s&&e._UZ(0,"app-answer-reveal-media")}const Si=s=>({"hint-mode":s});let Ci=(()=>{class s{lobbyStore;answer;subscriptions=[];lobby;canPlayMusic=!1;lobbyStatuses=u.D;lobbyUserStatus=C;lobbyHintModes=u.BF;lobbyUserRoles=v;me;loadProgress=0;error;serverBuffering=!1;constructor(t){this.lobbyStore=t}ngOnInit(){this.subscriptions=[this.lobbyStore.canPlayMusic.subscribe(t=>{this.canPlayMusic=t}),this.lobbyStore.lobby.subscribe(t=>{this.lobby=t}),this.lobbyStore.me.subscribe(t=>{this.me=t}),this.lobbyStore.lobbyLoadProgress.subscribe(t=>{this.loadProgress=t}),this.lobbyStore.error.subscribe(t=>{this.error=t}),this.lobbyStore.lobbyServerBuffer.subscribe(t=>{this.serverBuffering=t})]}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}play(){this.lobbyStore.setResumeMusic()}showAnswerComponent(){return this.me?.role!==v.Spectator&&!this.me?.hintMode&&this.lobby?.status===u.D.PlayingMusic}showEmptyTopDiv(){return this.lobby?.status===u.D.Buffering||this.lobby?.status===u.D.Loading||this.lobby?.hintMode!==u.BF.Allowed}showEmptyBottomDiv(){return this.lobby?.status===u.D.Buffering||this.lobby?.status===u.D.Loading||this.me?.role===v.Spectator}static \u0275fac=function(i){return new(i||s)(e.Y36(g))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-lobby-center-container"]],decls:16,vars:15,consts:[[1,"lobby-center-container","bg-dark","px-4","pt-4","position-relative",3,"ngClass"],[1,"d-flex","text-center","align-items-center","h-100","justify-content-between","position-relative","flex-column"],[4,"ngIf"],["class","w-100",4,"ngIf"],["class","align-self-center position-absolute",4,"ngIf"],["class","position-absolute","style","top: 0; left: 0",3,"title",4,"ngIf"],["class","position-absolute","style","top: 0; left: 24px",4,"ngIf"],["class","align-self-center countdown",3,"ngClass",4,"ngIf"],["class","text-center",3,"ngClass",4,"ngIf"],[1,"w-100"],["mode","determinate",3,"value"],[1,"align-self-center","position-absolute"],[1,"btn","btn-primary",3,"click"],[1,"position-absolute",2,"top","0","left","0",3,"title"],["role","status","aria-hidden","true",1,"spinner-border","spinner-border-sm",3,"ngClass"],[1,"position-absolute",2,"top","0","left","24px"],[1,"text-danger"],[1,"align-self-center","countdown",3,"ngClass"],[1,"text-center",3,"ngClass"]],template:function(i,o){1&i&&(e.TgZ(0,"div",0)(1,"div",1),e.YNc(2,mi,1,0,"div",2)(3,hi,3,2,"div",3)(4,_i,1,0,"app-hint-mode-toggle",2)(5,pi,7,0,"div",4)(6,fi,2,4,"div",5)(7,gi,3,1,"div",6)(8,vi,2,3,"div",7)(9,yi,1,3,"app-lobby-countdown",8)(10,Ti,1,0,"app-hint-mode",2)(11,wi,1,0,"app-lobby-answer",3)(12,xi,1,0,"div",2),e.qZA(),e._UZ(13,"app-lobby-audio-player")(14,"app-lobby-countdown-progress"),e.YNc(15,ki,1,0,"app-answer-reveal-media",2),e.qZA()),2&i&&(e.Q6J("ngClass",e.VKq(13,Si,null==o.me?null:o.me.hintMode)),e.xp6(2),e.Q6J("ngIf",o.showEmptyTopDiv()),e.xp6(),e.Q6J("ngIf",(null==o.lobby?null:o.lobby.status)===o.lobbyStatuses.Loading),e.xp6(),e.Q6J("ngIf",(null==o.lobby?null:o.lobby.hintMode)===o.lobbyHintModes.Allowed&&(null==o.lobby?null:o.lobby.status)===o.lobbyStatuses.PlayingMusic),e.xp6(),e.Q6J("ngIf",!o.canPlayMusic),e.xp6(),e.Q6J("ngIf",(null==o.me?null:o.me.status)===o.lobbyUserStatus.Buffering||o.serverBuffering),e.xp6(),e.Q6J("ngIf",o.error),e.xp6(),e.Q6J("ngIf",(null==o.lobby?null:o.lobby.status)===o.lobbyStatuses.Buffering),e.xp6(),e.Q6J("ngIf",o.canPlayMusic&&(null==o.lobby?null:o.lobby.status)===o.lobbyStatuses.PlayingMusic),e.xp6(),e.Q6J("ngIf",(null==o.lobby?null:o.lobby.status)===o.lobbyStatuses.PlayingMusic&&((null==o.lobby?null:o.lobby.hintMode)===o.lobbyHintModes.Always||(null==o.me?null:o.me.hintMode))),e.xp6(),e.Q6J("ngIf",o.showAnswerComponent()),e.xp6(),e.Q6J("ngIf",o.showEmptyBottomDiv()),e.xp6(3),e.Q6J("ngIf",o.lobby.status===o.lobbyStatuses.AnswerReveal))},dependencies:[m.mk,m.O5,oe.pW,Pt,Vt,Ot,Ht,Gt,zt,ui],encapsulation:2})}return s})();function Ii(s,r){if(1&s){const t=e.EpF();e.TgZ(0,"button",6),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.restart())}),e._UZ(1,"i",7),e.qZA()}}let Mi=(()=>{class s{lobbyStore;socket;subscriptions=[];me;lobbyUserRoles=v;lobby;constructor(t,i){this.lobbyStore=t,this.socket=i}ngOnInit(){this.subscriptions=[this.lobbyStore.lobby.subscribe(t=>{this.lobby=t}),this.lobbyStore.me.subscribe(t=>{this.me=t})]}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}restart(){this.socket.emit("restart")}static \u0275fac=function(i){return new(i||s)(e.Y36(g),e.Y36(w.i))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-lobby-information"]],decls:10,vars:4,consts:[[1,"bg-dark","p-4"],[1,"row"],[1,"col-4"],[1,"fa-solid","fa-hourglass-empty","me-1"],[1,"fa-solid","fa-music","me-1"],["class","btn btn-sm btn-primary","mdbTooltip","Restart lobby",3,"click",4,"ngIf"],["mdbTooltip","Restart lobby",1,"btn","btn-sm","btn-primary",3,"click"],[1,"fa-solid","fa-arrow-rotate-back"]],template:function(i,o){1&i&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2),e._UZ(3,"i",3),e._uU(4),e.qZA(),e.TgZ(5,"div",2),e._UZ(6,"i",4),e._uU(7),e.qZA(),e.TgZ(8,"div",2),e.YNc(9,Ii,2,0,"button",5),e.qZA()()()),2&i&&(e.xp6(4),e.hij("",null==o.lobby?null:o.lobby.guessTime,"s"),e.xp6(3),e.AsE("",null==o.lobby?null:o.lobby.currentLobbyMusicPosition,"/",-1===(null==o.lobby?null:o.lobby.musicNumber)?"\u221e":o.lobby.lobbyMusics," "),e.xp6(2),e.Q6J("ngIf",(null==o.me?null:o.me.role)===o.lobbyUserRoles.Host))},dependencies:[m.O5,U],encapsulation:2})}return s})();function Ai(s,r){if(1&s&&(e.ynx(0),e._uU(1),e.BQk()),2&s){const t=e.oxw(3);e.xp6(),e.Oqu(t.answer.gameToMusic.game.platforms[0].name)}}function Ri(s,r){1&s&&(e.ynx(0),e._uU(1,", "),e.BQk())}function Ei(s,r){if(1&s&&(e.ynx(0),e._uU(1),e.YNc(2,Ri,2,0,"ng-container",13),e.BQk()),2&s){const t=r.$implicit,i=r.last,o=r.last;e.xp6(),e.hij(" ",t.abbreviation,""),e.xp6(),e.Q6J("ngIf",!i&&!o)}}function Pi(s,r){if(1&s&&(e.ynx(0),e.YNc(1,Ei,3,2,"ng-container",18),e.BQk()),2&s){const t=e.oxw(3);e.xp6(),e.Q6J("ngForOf",t.answer.gameToMusic.game.platforms)}}function Di(s,r){if(1&s&&(e.TgZ(0,"small",17),e.YNc(1,Ai,2,1,"ng-container",13)(2,Pi,2,1,"ng-container",13),e.qZA()),2&s){const t=e.oxw(2);e.xp6(),e.Q6J("ngIf",1===(null==t.answer.gameToMusic.game.platforms?null:t.answer.gameToMusic.game.platforms.length)),e.xp6(),e.Q6J("ngIf",(null==t.answer.gameToMusic.game.platforms?null:t.answer.gameToMusic.game.platforms.length)>1&&11===t.answer.gameToMusic.game.category)}}function Zi(s,r){if(1&s&&e._UZ(0,"img",19),2&s){const t=e.oxw(2);e.Q6J("src","https://images.igdb.com/igdb/image/upload/t_720p/"+t.answer.gameToMusic.game.cover.imageId+".jpg",e.LSH)("alt",t.answer.gameToMusic.game.name)}}function Ui(s,r){if(1&s&&(e.TgZ(0,"div",20)(1,"h2",21),e._uU(2),e.qZA()()),2&s){const t=e.oxw(2);e.xp6(2),e.Oqu(t.answer.gameToMusic.game.name)}}const Te=s=>({"background-color":s});function Bi(s,r){if(1&s){const t=e.EpF();e.TgZ(0,"button",23),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(3);return e.KtG(o.addToList())}),e.TgZ(1,"mat-icon"),e._uU(2,"add"),e.qZA()()}if(2&s){const t=e.oxw(3);e.Q6J("ngStyle",e.VKq(1,Te,t.answer.gameToMusic.game.cover?t.answer.gameToMusic.game.cover.colorPalette.backgroundColorHex:"#171717"))}}function Vi(s,r){if(1&s){const t=e.EpF();e.TgZ(0,"button",23),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(3);return e.KtG(o.removeFromList())}),e.TgZ(1,"mat-icon"),e._uU(2,"remove"),e.qZA()()}if(2&s){const t=e.oxw(3);e.Q6J("ngStyle",e.VKq(1,Te,t.answer.gameToMusic.game.cover?null==t.answer.gameToMusic.game.cover.colorPalette?null:t.answer.gameToMusic.game.cover.colorPalette.backgroundColorHex:"black"))}}function Li(s,r){if(1&s&&(e.ynx(0),e.YNc(1,Bi,3,3,"button",22)(2,Vi,3,3,"button",22),e.BQk()),2&s){const t=e.oxw(2);e.xp6(),e.Q6J("ngIf",!1===t.me.playedTheGame),e.xp6(),e.Q6J("ngIf",!0===t.me.playedTheGame)}}function Oi(s,r){if(1&s&&(e.ynx(0),e.TgZ(1,"div",5)(2,"h2",6),e._uU(3),e.YNc(4,Di,3,2,"small",7),e.qZA()(),e.TgZ(5,"div",8)(6,"div",9)(7,"div",10),e.YNc(8,Zi,1,2,"img",11)(9,Ui,3,1,"ng-template",null,12,e.W1O),e.qZA(),e.YNc(11,Li,3,2,"ng-container",13),e.qZA()(),e.TgZ(12,"div",14)(13,"div")(14,"h4",6),e._uU(15,"Music"),e.qZA(),e.TgZ(16,"small",15),e._uU(17),e.qZA()(),e.TgZ(18,"div",16)(19,"h4",6),e._uU(20,"Artist"),e.qZA(),e.TgZ(21,"small",15),e._uU(22),e.qZA()()(),e.BQk()),2&s){const t=e.MAs(10),i=e.oxw();let o,n;e.xp6(3),e.hij(" ",i.answer.gameToMusic.game.name," "),e.xp6(),e.Q6J("ngIf",1===(null==i.answer.gameToMusic.game.platforms?null:i.answer.gameToMusic.game.platforms.length)||(null==i.answer.gameToMusic.game.platforms?null:i.answer.gameToMusic.game.platforms.length)>1&&11===i.answer.gameToMusic.game.category),e.xp6(4),e.Q6J("ngIf",i.answer.gameToMusic.game.cover)("ngIfElse",t),e.xp6(3),e.Q6J("ngIf",i.me),e.xp6(6),e.Oqu(null!==(o=i.answer.gameToMusic.title)&&void 0!==o?o:i.answer.gameToMusic.music.title),e.xp6(5),e.Oqu(null!==(n=i.answer.gameToMusic.artist)&&void 0!==n?n:i.answer.gameToMusic.music.artist)}}function Ni(s,r){1&s&&(e.TgZ(0,"div",5),e._UZ(1,"h2",24),e.qZA(),e.TgZ(2,"div",25),e._UZ(3,"div",26),e.qZA(),e.TgZ(4,"div",25)(5,"div"),e._UZ(6,"h4",27)(7,"small",28)(8,"small",29),e.qZA(),e.TgZ(9,"div",16),e._UZ(10,"h4",27)(11,"small",30)(12,"small",29),e.qZA()())}function Fi(s,r){1&s&&(e.TgZ(0,"p",16)(1,"small",31),e._UZ(2,"i",32),e._uU(3," This music may not reflect the difficulty configured. "),e.qZA()())}const Hi=s=>({"d-none d-md-block":s});let Qi=(()=>{class s{lobbyStore;gameHttpService;answer;me;interactedWithList=!1;subscriptions=[];constructor(t,i){this.lobbyStore=t,this.gameHttpService=i}ngOnInit(){this.subscriptions=[this.lobbyStore.currentLobbyMusicAnswer.subscribe(t=>{this.answer=t,this.interactedWithList=!1}),this.lobbyStore.lobby.subscribe(t=>{t.status!==u.D.AnswerReveal&&(this.answer=null)}),this.lobbyStore.currentLobbyMusic.subscribe(t=>{null!==t&&(this.answer=t)}),this.lobbyStore.me.subscribe(t=>{this.interactedWithList||(this.me={...t})})]}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}addToList(){this.gameHttpService.addToList(this.answer.gameToMusic.game.slug).subscribe(()=>{this.me.playedTheGame=!0,this.interactedWithList=!0})}removeFromList(){this.gameHttpService.removeFromList(this.answer.gameToMusic.game.slug).subscribe(()=>{this.me.playedTheGame=!1,this.interactedWithList=!0})}static \u0275fac=function(i){return new(i||s)(e.Y36(g),e.Y36(ue.q))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-lobby-answer-reveal"]],decls:6,vars:6,consts:[[1,"bg-dark","p-4","mb-2","mb-md-0",3,"ngClass"],[1,"row"],[4,"ngIf","ngIfElse"],["skeleton",""],["class","mt-2",4,"ngIf"],[1,"col-md-12"],[1,"mb-1"],["class","ms-1 text-muted","style","font-size: 11px",4,"ngIf"],[1,"col-sm-4","col-md-6"],[2,"position","relative","aspect-ratio","3/4","display","flex","align-items","center"],[1,"w-100"],["class","card-img-top",3,"src","alt",4,"ngIf","ngIfElse"],["noImage",""],[4,"ngIf"],[1,"col-sm-8","col-md-6"],[2,"font-size","11px"],[1,"mt-2"],[1,"ms-1","text-muted",2,"font-size","11px"],[4,"ngFor","ngForOf"],[1,"card-img-top",3,"src","alt"],[1,"p-2","text-center"],[1,"m-0"],["class","game-item-cta","mat-mini-fab","","aria-label","Example icon button with a heart icon",3,"ngStyle","click",4,"ngIf"],["mat-mini-fab","","aria-label","Example icon button with a heart icon",1,"game-item-cta",3,"ngStyle","click"],[1,"placeholder","col-md-6"],[1,"col-md-6"],[1,"w-auto","h-100","img-placeholder",2,"aspect-ratio","3/4"],[1,"mb-1","placeholder","col-md-4"],[1,"placeholder","col-md-12",2,"font-size","10px"],[1,"placeholder","col-md-6",2,"font-size","10px"],[1,"placeholder","col-md-9",2,"font-size","10px"],[2,"font-size","10px"],[1,"fa-solid","fa-exclamation-triangle","text-primary"]],template:function(i,o){if(1&i&&(e.TgZ(0,"div",0)(1,"div",1),e.YNc(2,Oi,23,7,"ng-container",2)(3,Ni,13,0,"ng-template",null,3,e.W1O)(5,Fi,4,0,"p",4),e.qZA()()),2&i){const n=e.MAs(4);e.Q6J("ngClass",e.VKq(4,Hi,!(null!=o.answer&&o.answer.gameToMusic))),e.xp6(2),e.Q6J("ngIf",null==o.answer?null:o.answer.gameToMusic)("ngIfElse",n),e.xp6(3),e.Q6J("ngIf",o.answer&&o.answer.contributeToMissingData)}},dependencies:[m.mk,m.sg,m.O5,m.PC,le.nh,Q.Hw],encapsulation:2})}return s})();const Yi=s=>({"text-primary":s});let Ji=(()=>{class s{user;static \u0275fac=function(i){return new(i||s)};static \u0275cmp=e.Xpm({type:s,selectors:[["app-lobby-score-row"]],inputs:{user:"user"},decls:10,vars:11,consts:[[1,"row",3,"ngClass"],[1,"col-1"],[1,"col"],[1,"col-3","d-flex","justify-content-end"],[1,"col-1","text-muted","justify-content-end"]],template:function(i,o){1&i&&(e.TgZ(0,"div",0)(1,"div",1),e._uU(2),e.qZA(),e.TgZ(3,"div",2),e._uU(4),e.ALo(5,"slice"),e.qZA(),e.TgZ(6,"div",3),e._uU(7),e.qZA(),e.TgZ(8,"div",4),e._uU(9),e.qZA()()),2&i&&(e.Q6J("ngClass",e.VKq(9,Yi,o.user.me)),e.xp6(2),e.hij("#",o.user.rank,""),e.xp6(2),e.Oqu(e.Dn7(5,5,o.user.user.username,0,50)),e.xp6(3),e.hij("",o.user.points," pts"),e.xp6(2),e.Oqu(o.user.musicGuessedRight))},dependencies:[m.mk,m.OU],encapsulation:2})}return s})();function qi(s,r){if(1&s&&e._UZ(0,"app-lobby-score-row",6),2&s){const t=e.oxw().$implicit;e.Q6J("user",t)}}function Gi(s,r){if(1&s&&e._UZ(0,"app-lobby-score-row",6),2&s){const t=e.oxw().$implicit,i=e.oxw();e.Q6J("user",i.getMeIndex()<=3?t:i.getMe())}}function Xi(s,r){if(1&s&&(e.ynx(0),e.YNc(1,qi,1,1,"app-lobby-score-row",5)(2,Gi,1,1,"app-lobby-score-row",5),e.BQk()),2&s){const t=r.index;e.xp6(),e.Q6J("ngIf",t<=2),e.xp6(),e.Q6J("ngIf",3===t)}}let ji=(()=>{class s{lobbyStore;subscriptions=[];users;me;constructor(t){this.lobbyStore=t}ngOnInit(){this.subscriptions=[this.lobbyStore.users.subscribe(t=>{t&&(this.users=t.filter(i=>[v.Host,v.Player].includes(i.role)).sort((i,o)=>i.points>o.points?-1:1).reduce((i,o,n)=>{let a=0===n?1:i[n-1].rank+1;return 0!==n&&o.points===i[n-1].points&&(a=i[n-1].rank),[...i,{...o,rank:a}]},[]))}),this.lobbyStore.me.subscribe(t=>{this.me=t})]}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}getMeIndex(){return this.users.findIndex(t=>t.me)}getMe(){return this.users.find(t=>t.me)}scoreExplanation(){return'Points distribution:
  • 10 points when using the autocomplete
    • +5 points on the first try
    • +5 points if the game is not in your list
  • 5 points when using hints
'}static \u0275fac=function(i){return new(i||s)(e.Y36(g))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-lobby-score"]],decls:5,vars:3,consts:[[1,"bg-dark"],[1,"d-flex","pt-1","pe-1"],["placement","top",1,"fa-solid","fa-question-circle","ms-auto",3,"mdbTooltip","html"],[1,"pb-4","pt-2","px-4"],[4,"ngFor","ngForOf"],[3,"user",4,"ngIf"],[3,"user"]],template:function(i,o){1&i&&(e.TgZ(0,"div",0)(1,"div",1),e._UZ(2,"i",2),e.qZA(),e.TgZ(3,"div",3),e.YNc(4,Xi,3,2,"ng-container",4),e.qZA()()),2&i&&(e.xp6(2),e.Q6J("mdbTooltip",o.scoreExplanation())("html",!0),e.xp6(2),e.Q6J("ngForOf",o.users))},dependencies:[m.sg,m.O5,U,Ji],encapsulation:2})}return s})(),zi=(()=>{class s{static \u0275fac=function(i){return new(i||s)};static \u0275cmp=e.Xpm({type:s,selectors:[["app-lobby-playing"]],decls:14,vars:0,consts:[[1,"row"],[1,"col-md-3","d-flex","flex-column"],[1,"mt-2","order-1","order-md-0","mb-2","mb-md-0"],[1,"mt-2","order-0","order-md-1"],[1,"col-md-6","lobby-col"],[1,"col-md-3","lobby-col"]],template:function(i,o){1&i&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div"),e._UZ(3,"app-button-play"),e.qZA(),e.TgZ(4,"div"),e._UZ(5,"app-lobby-information"),e.qZA(),e.TgZ(6,"div",2),e._UZ(7,"app-lobby-answer-reveal"),e.qZA(),e.TgZ(8,"div",3),e._UZ(9,"app-lobby-score"),e.qZA()(),e.TgZ(10,"div",4),e._UZ(11,"app-lobby-center-container"),e.qZA(),e.TgZ(12,"div",5),e._UZ(13,"app-lobby-chat"),e.qZA()())},dependencies:[ie,Ci,Mi,Qi,ji,se],encapsulation:2})}return s})();function Wi(s,r){1&s&&(e.ynx(0),e._UZ(1,"app-lobby-waiting"),e.BQk())}function $i(s,r){1&s&&(e.ynx(0),e._UZ(1,"app-lobby-playing"),e.BQk())}function Ki(s,r){if(1&s&&(e.ynx(0),e.YNc(1,Wi,2,0,"ng-container",3)(2,$i,2,0,"ng-container",3),e._UZ(3,"app-lobby-users"),e.BQk()),2&s){const t=e.oxw();e.xp6(),e.Q6J("ngIf",t.lobby.status===t.lobbyStatuses.Waiting),e.xp6(),e.Q6J("ngIf",t.lobbyService.isPLaying(t.lobby))}}function es(s,r){1&s&&e._uU(0,"loading")}let ts=(()=>{class s{lobbyHttpService;lobbyService;router;route;dialog;socket;authService;lobbyStore;snackBar;lobbyFileSocket;lobbyCode;lobby;lobbyStatuses=u.D;subscriptions=[];constructor(t,i,o,n,a,b,f,x,L,J){this.lobbyHttpService=t,this.lobbyService=i,this.router=o,this.route=n,this.dialog=a,this.socket=b,this.authService=f,this.lobbyStore=x,this.snackBar=L,this.lobbyFileSocket=J}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe()),this.lobbyStore.disconnect(),this.socket.disconnect(),this.lobbyFileSocket.disconnect()}ngOnInit(){this.socket.connect(),this.subscriptions=[this.socket.fromEvent("connect_error").subscribe(t=>{"Unauthorized"===t.message&&(this.lobbyFileSocket.disconnect(),this.authService.refreshToken().subscribe(()=>{this.socket.connect(),this.lobbyFileSocket.connect(),this.socket.emit("fake emit")}))}),this.lobbyFileSocket.fromEvent("connect_error").subscribe(t=>{"Unauthorized"===t.message&&this.lobby&&(this.lobbyFileSocket.disconnect(),this.lobbyFileSocket.connect(),this.lobbyFileSocket.emit("fake emit"))}),this.socket.fromEvent("NotFoundException").subscribe(()=>{this.router.navigate(["/"])}),this.socket.fromEvent("MissingPasswordException").subscribe(()=>{this.dialog.open(at.q,{data:this.lobbyCode}).afterClosed().subscribe(()=>{void 0===this.lobby&&this.router.navigate(["/"])})}),this.socket.fromEvent("error").subscribe(t=>{this.lobbyStore.setLobbyError(t)}),this.socket.fromEvent("lobbyJoined").subscribe(t=>{this.lobby=t,this.lobbyStore.setLobby(this.lobby),this.lobbyFileSocket.connect(),this.lobbyFileSocket.emit("join")}),this.socket.fromEvent("lobbyUsers").subscribe(t=>{this.lobbyStore.setUsers(t)}),this.socket.fromEvent("lobby").subscribe(t=>{this.lobby=t,this.lobbyStore.setLobby(this.lobby)}),this.socket.fromEvent("lobbyStartBuffer").subscribe(()=>{this.lobbyStore.setLobbyServerBuffer(!0),this.lobbyStore.resetLobbyError()}),this.socket.fromEvent("lobbyBufferEnd").subscribe(()=>{this.lobbyStore.setLobbyServerBuffer(!1)}),this.lobbyFileSocket.fromEvent("buffer").subscribe(t=>{this.lobbyStore.setCurrentLobbyAudioBuffer(t),this.socket.emit("readyToPlayMusic")}),this.socket.fromEvent("currentLobbyMusic").subscribe(t=>{this.lobbyStore.setCurrentLobbyMusic(t)}),this.socket.fromEvent("lobbyAnswer").subscribe(t=>{this.lobbyStore.setCurrentLobbyMusicAnswer(t)}),this.socket.fromEvent("lobbyUser").subscribe(t=>{this.lobbyStore.updateLobbyUser(t)}),this.socket.fromEvent("lobbyReset").subscribe(t=>{this.lobby=t,this.lobbyStore.setLobby(this.lobby),this.lobbyStore.setCurrentLobbyAudioBuffer(null),this.lobbyStore.setCurrentLobbyMusicAnswer(null)}),this.socket.fromEvent("lobbyToast").subscribe(t=>{this.snackBar.open(t,void 0,{horizontalPosition:"end",verticalPosition:"bottom",panelClass:"danger",duration:5e3})}),this.socket.fromEvent("disconnect").subscribe(()=>{this.router.navigate(["/"])}),this.socket.fromEvent("chat").subscribe(t=>{this.lobbyStore.addMessage(t)}),this.socket.fromEvent("hintModeGames").subscribe(t=>{this.lobbyStore.setHintModeGames(t)}),this.socket.fromEvent("lobbyLoadProgress").subscribe(t=>{this.lobbyStore.setLobbyLoadProgress(t)}),this.route.paramMap.subscribe(t=>{this.lobbyCode=t.get("code")})],this.lobbyService.join(this.lobbyCode)}static \u0275fac=function(i){return new(i||s)(e.Y36(I.Y),e.Y36(lt.V),e.Y36(_.F0),e.Y36(_.gz),e.Y36(dt.uw),e.Y36(w.i),e.Y36(k.e),e.Y36(g),e.Y36(O.ux),e.Y36(ct.Q))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-lobby"]],decls:4,vars:2,consts:[[1,"container-fluid"],[4,"ngIf","ngIfElse"],["loading",""],[4,"ngIf"]],template:function(i,o){if(1&i&&(e.TgZ(0,"div",0),e.YNc(1,Ki,4,2,"ng-container",1)(2,es,1,0,"ng-template",null,2,e.W1O),e.qZA()),2&i){const n=e.MAs(3);e.xp6(),e.Q6J("ngIf",o.lobby)("ngIfElse",n)}},dependencies:[m.O5,gt,Mt,zi],encapsulation:2})}return s})();var is=l(2596),ss=l(8525);let rs=(()=>{class s{static \u0275fac=function(i){return new(i||s)};static \u0275mod=e.oAB({type:s});static \u0275inj=e.cJS({imports:[m.ez]})}return s})();const as=[{path:"create",component:nt},{path:":code",component:ts},{path:"**",redirectTo:"create"}];let ls=(()=>{class s{static \u0275fac=function(i){return new(i||s)};static \u0275mod=e.oAB({type:s});static \u0275inj=e.cJS({providers:[I.Y,g],imports:[m.ez,_.Bz.forChild(as),rt.m,Oe,O.ZX,Xe,is.AV,Q.Ps,et,ss.LD,oe.Cv,ni,V.Tx,rs]})}return s})()}}]); \ No newline at end of file +"use strict";(self.webpackChunkvgmq=self.webpackChunkvgmq||[]).push([[624],{5438:(xe,M,l)=>{l.d(M,{q:()=>C});var m=l(8504),e=l(553),c=l(6306),u=l(9212),v=l(9862);let C=(()=>{class T{http;apiEndpoint=e.N.apiEndpoint;constructor(_){this.http=_}search(_,p,k){return this.http.get(`${this.apiEndpoint}/games`,{params:{query:_.query,sortBy:_.sortBy,..._.myGames&&{filterByUser:"true"},..._.showDisabled&&{showDisabled:"true"},..._.onlyShowWithoutMusics&&{onlyShowWithoutMusics:"true"},...p&&{skip:p},...k&&{limit:k},..._.nsfw&&{nsfw:"true"}}})}importByUrl(_){return this.http.get(`${this.apiEndpoint}/games/import`,{params:{url:_}}).pipe((0,c.K)(p=>(0,m._)(()=>p.error)))}get(_){return this.http.get(`${this.apiEndpoint}/games/${_}`)}addToList(_){return this.http.get(`${this.apiEndpoint}/games/${_}/add`)}removeFromList(_){return this.http.get(`${this.apiEndpoint}/games/${_}/remove`)}getNames(_){return this.http.get(`${this.apiEndpoint}/games/names`,{params:{query:_}})}static \u0275fac=function(p){return new(p||T)(u.LFG(v.eN))};static \u0275prov=u.Yz7({token:T,factory:T.\u0275fac,providedIn:"root"})}return T})()},1624:(xe,M,l)=>{l.r(M),l.d(M,{LobbyModule:()=>ls});var m=l(6814),e=l(9212),c=l(6223),u=l(6201),v=function(s){return s.Host="host",s.Player="player",s.Spectator="spectator",s}(v||{}),C=function(s){return s.Buffering="buffering",s.ReadyToPlayMusic="ready_to_play_music",s}(C||{}),T=l(4716),I=l(1274),_=l(8184),p=l(5619),k=l(304),O=l(2939);let g=(()=>{class s{authService;router;snack;usersBehaviorSubject=new p.X([]);meBehaviorSubject=new p.X(null);lobbyBehaviorSubject=new p.X(null);currentLobbyAudioBufferBehaviorSubject=new p.X(null);currentLobbyMusicAnswerBehaviorSubject=new p.X(null);currentLobbyMusicBehaviorSubject=new p.X(null);canPlayMusicBehaviorSubject=new p.X(!1);resumeMusicBehaviorSubject=new p.X(void 0);messagesBehaviorSubject=new p.X([]);hintModeGamesBehaviorSubject=new p.X([]);lobbyLoadProgressBehaviorSubject=new p.X(0);lobbyErrorBehaviorSubject=new p.X(void 0);lobbyServerBufferBehaviorSubject=new p.X(!1);lobby=this.lobbyBehaviorSubject.asObservable();users=this.usersBehaviorSubject.asObservable();me=this.meBehaviorSubject.asObservable();currentLobbyAudioBuffer=this.currentLobbyAudioBufferBehaviorSubject.asObservable();currentLobbyMusicAnswer=this.currentLobbyMusicAnswerBehaviorSubject.asObservable();currentLobbyMusic=this.currentLobbyMusicBehaviorSubject.asObservable();canPlayMusic=this.canPlayMusicBehaviorSubject.asObservable();resumeMusic=this.resumeMusicBehaviorSubject.asObservable();messages=this.messagesBehaviorSubject.asObservable();hintModeGames=this.hintModeGamesBehaviorSubject.asObservable();lobbyLoadProgress=this.lobbyLoadProgressBehaviorSubject.asObservable();error=this.lobbyErrorBehaviorSubject.asObservable();lobbyServerBuffer=this.lobbyServerBufferBehaviorSubject.asObservable();constructor(t,i,o){this.authService=t,this.router=i,this.snack=o}disconnect(){this.lobbyBehaviorSubject.next(null),this.usersBehaviorSubject.next(null),this.meBehaviorSubject.next(null),this.currentLobbyAudioBufferBehaviorSubject.next(null),this.currentLobbyMusicAnswerBehaviorSubject.next(null)}getLobby(){return this.lobbyBehaviorSubject.getValue()}setLobby(t){this.lobbyBehaviorSubject.next(t)}getUsers(){return this.usersBehaviorSubject.getValue()}getMe(){return this.meBehaviorSubject.getValue()}setUsers(t){const i=t.find(o=>o.user.username===this.authService.decodeJwt().username);void 0===i?(this.snack.open("You have been kicked out from the lobby",void 0,{horizontalPosition:"end",verticalPosition:"bottom",panelClass:"danger",duration:5e3}),this.router.navigate(["/"])):(i.me=!0,this.usersBehaviorSubject.next(t),this.meBehaviorSubject.next(i))}getCurrentLobbyAudioBuffer(){return this.currentLobbyAudioBufferBehaviorSubject.getValue()}setCurrentLobbyAudioBuffer(t){this.currentLobbyAudioBufferBehaviorSubject.next(t)}getCurrentLobbyMusicAnswer(){return this.currentLobbyMusicAnswerBehaviorSubject.getValue()}setCurrentLobbyMusicAnswer(t){this.currentLobbyMusicAnswerBehaviorSubject.next(t)}getCurrentLobbyMusic(){return this.currentLobbyMusicBehaviorSubject.getValue()}setCurrentLobbyMusic(t){this.currentLobbyMusicBehaviorSubject.next(t),this.currentLobbyMusicAnswerBehaviorSubject.next(null)}updateLobbyUser(t){let i=this.getUsers();const o=i.findIndex(n=>n.user.username===t.user.username);-1!==o?i[o]=t:i=[...i,t],this.setUsers(i)}getCanPlayMusic(){return this.canPlayMusicBehaviorSubject.getValue()}setCanPlayMusic(t){this.canPlayMusicBehaviorSubject.next(t)}setResumeMusic(){this.resumeMusicBehaviorSubject.next()}getMessages(){return this.messagesBehaviorSubject.getValue()}addMessage(t){this.messagesBehaviorSubject.next([...this.getMessages(),t])}setHintModeGames(t){this.hintModeGamesBehaviorSubject.next(t);const i=this.getMe();i&&(i.hintMode=!0)}setLobbyLoadProgress(t){this.lobbyLoadProgressBehaviorSubject.next(t)}setLobbyError(t){this.lobbyErrorBehaviorSubject.next(t)}resetLobbyError(){this.lobbyErrorBehaviorSubject.next(void 0)}setLobbyServerBuffer(t){this.lobbyServerBufferBehaviorSubject.next(t)}static \u0275fac=function(i){return new(i||s)(e.LFG(k.e),e.LFG(_.F0),e.LFG(O.ux))};static \u0275prov=e.Yz7({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})();var we=l(5986),A=l(9157),q=l(2032),ke=l(9388),N=l(2831),y=l(3680),R=l(8645);const Se=["knob"],Ce=["valueIndicatorContainer"];function Ie(s,r){if(1&s&&(e.TgZ(0,"div",4,5)(2,"div",6)(3,"span",7),e._uU(4),e.qZA()()()),2&s){const t=e.oxw();e.xp6(4),e.Oqu(t.valueIndicatorText)}}const Me=["trackActive"];function Ae(s,r){if(1&s&&e._UZ(0,"div"),2&s){const t=r.$implicit,i=r.$index,o=e.oxw(3);e.Tol(0===t?"mdc-slider__tick-mark--active":"mdc-slider__tick-mark--inactive"),e.Udp("transform",o._calcTickMarkTransform(i))}}function Re(s,r){if(1&s&&e.SjG(0,Ae,1,4,"div",9,e.x6l),2&s){const t=e.oxw(2);e.wJu(t._tickMarks)}}function Ee(s,r){if(1&s&&(e.TgZ(0,"div",7,8),e.YNc(2,Re,2,0),e.qZA()),2&s){const t=e.oxw();e.xp6(2),e.um2(2,t._cachedWidth?2:-1)}}function Pe(s,r){if(1&s&&e._UZ(0,"mat-slider-visual-thumb",6),2&s){const t=e.oxw();e.Q6J("discrete",t.discrete)("thumbPosition",1)("valueIndicatorText",t.startValueIndicatorText)}}const De=["*"];var d=function(s){return s[s.START=1]="START",s[s.END=2]="END",s}(d||{}),S=function(s){return s[s.ACTIVE=0]="ACTIVE",s[s.INACTIVE=1]="INACTIVE",s}(S||{});const E=new e.OlP("_MatSlider"),G=new e.OlP("_MatSliderThumb"),X=new e.OlP("_MatSliderRangeThumb"),j=new e.OlP("_MatSliderVisualThumb");let Ze=(()=>{class s{constructor(t,i,o,n){this._cdr=t,this._ngZone=i,this._slider=n,this._isHovered=!1,this._isActive=!1,this._isValueIndicatorVisible=!1,this._platform=(0,e.f3M)(N.t4),this._onPointerMove=a=>{if(this._sliderInput._isFocused)return;const b=this._hostElement.getBoundingClientRect(),f=this._slider._isCursorOnSliderThumb(a,b);this._isHovered=f,f?this._showHoverRipple():this._hideRipple(this._hoverRippleRef)},this._onMouseLeave=()=>{this._isHovered=!1,this._hideRipple(this._hoverRippleRef)},this._onFocus=()=>{this._hideRipple(this._hoverRippleRef),this._showFocusRipple(),this._hostElement.classList.add("mdc-slider__thumb--focused")},this._onBlur=()=>{this._isActive||this._hideRipple(this._focusRippleRef),this._isHovered&&this._showHoverRipple(),this._hostElement.classList.remove("mdc-slider__thumb--focused")},this._onDragStart=a=>{0===a.button&&(this._isActive=!0,this._showActiveRipple())},this._onDragEnd=()=>{this._isActive=!1,this._hideRipple(this._activeRippleRef),this._sliderInput._isFocused||this._hideRipple(this._focusRippleRef),this._platform.SAFARI&&this._showHoverRipple()},this._hostElement=o.nativeElement}ngAfterViewInit(){this._ripple.radius=24,this._sliderInput=this._slider._getInput(this.thumbPosition),this._sliderInputEl=this._sliderInput._hostElement;const t=this._sliderInputEl;this._ngZone.runOutsideAngular(()=>{t.addEventListener("pointermove",this._onPointerMove),t.addEventListener("pointerdown",this._onDragStart),t.addEventListener("pointerup",this._onDragEnd),t.addEventListener("pointerleave",this._onMouseLeave),t.addEventListener("focus",this._onFocus),t.addEventListener("blur",this._onBlur)})}ngOnDestroy(){const t=this._sliderInputEl;t&&(t.removeEventListener("pointermove",this._onPointerMove),t.removeEventListener("pointerdown",this._onDragStart),t.removeEventListener("pointerup",this._onDragEnd),t.removeEventListener("pointerleave",this._onMouseLeave),t.removeEventListener("focus",this._onFocus),t.removeEventListener("blur",this._onBlur))}_showHoverRipple(){this._isShowingRipple(this._hoverRippleRef)||(this._hoverRippleRef=this._showRipple({enterDuration:0,exitDuration:0}),this._hoverRippleRef?.element.classList.add("mat-mdc-slider-hover-ripple"))}_showFocusRipple(){this._isShowingRipple(this._focusRippleRef)||(this._focusRippleRef=this._showRipple({enterDuration:0,exitDuration:0},!0),this._focusRippleRef?.element.classList.add("mat-mdc-slider-focus-ripple"))}_showActiveRipple(){this._isShowingRipple(this._activeRippleRef)||(this._activeRippleRef=this._showRipple({enterDuration:225,exitDuration:400}),this._activeRippleRef?.element.classList.add("mat-mdc-slider-active-ripple"))}_isShowingRipple(t){return t?.state===y.DH.FADING_IN||t?.state===y.DH.VISIBLE}_showRipple(t,i){if(!this._slider.disabled&&(this._showValueIndicator(),this._slider._isRange&&this._slider._getThumb(this.thumbPosition===d.START?d.END:d.START)._showValueIndicator(),!this._slider._globalRippleOptions?.disabled||i))return this._ripple.launch({animation:this._slider._noopAnimations?{enterDuration:0,exitDuration:0}:t,centered:!0,persistent:!0})}_hideRipple(t){if(t?.fadeOut(),this._isShowingAnyRipple())return;this._slider._isRange||this._hideValueIndicator();const i=this._getSibling();i._isShowingAnyRipple()||(this._hideValueIndicator(),i._hideValueIndicator())}_showValueIndicator(){this._hostElement.classList.add("mdc-slider__thumb--with-indicator")}_hideValueIndicator(){this._hostElement.classList.remove("mdc-slider__thumb--with-indicator")}_getSibling(){return this._slider._getThumb(this.thumbPosition===d.START?d.END:d.START)}_getValueIndicatorContainer(){return this._valueIndicatorContainer?.nativeElement}_getKnob(){return this._knob.nativeElement}_isShowingAnyRipple(){return this._isShowingRipple(this._hoverRippleRef)||this._isShowingRipple(this._focusRippleRef)||this._isShowingRipple(this._activeRippleRef)}static#e=this.\u0275fac=function(i){return new(i||s)(e.Y36(e.sBO),e.Y36(e.R0b),e.Y36(e.SBq),e.Y36(E))};static#t=this.\u0275cmp=e.Xpm({type:s,selectors:[["mat-slider-visual-thumb"]],viewQuery:function(i,o){if(1&i&&(e.Gf(y.wG,5),e.Gf(Se,5),e.Gf(Ce,5)),2&i){let n;e.iGM(n=e.CRH())&&(o._ripple=n.first),e.iGM(n=e.CRH())&&(o._knob=n.first),e.iGM(n=e.CRH())&&(o._valueIndicatorContainer=n.first)}},hostAttrs:[1,"mdc-slider__thumb","mat-mdc-slider-visual-thumb"],inputs:{discrete:"discrete",thumbPosition:"thumbPosition",valueIndicatorText:"valueIndicatorText"},standalone:!0,features:[e._Bn([{provide:j,useExisting:s}]),e.jDz],decls:4,vars:2,consts:[["class","mdc-slider__value-indicator-container"],[1,"mdc-slider__thumb-knob"],["knob",""],["matRipple","",1,"mat-mdc-focus-indicator",3,"matRippleDisabled"],[1,"mdc-slider__value-indicator-container"],["valueIndicatorContainer",""],[1,"mdc-slider__value-indicator"],[1,"mdc-slider__value-indicator-text"]],template:function(i,o){1&i&&(e.YNc(0,Ie,5,1,"div",0),e._UZ(1,"div",1,2)(3,"div",3)),2&i&&(e.um2(0,o.discrete?0:-1),e.xp6(3),e.Q6J("matRippleDisabled",!0))},dependencies:[y.wG],styles:[".mat-mdc-slider-visual-thumb .mat-ripple{height:100%;width:100%}.mat-mdc-slider .mdc-slider__tick-marks{justify-content:start}.mat-mdc-slider .mdc-slider__tick-marks .mdc-slider__tick-mark--active,.mat-mdc-slider .mdc-slider__tick-marks .mdc-slider__tick-mark--inactive{position:absolute;left:2px}"],encapsulation:2,changeDetection:0})}return s})(),z=(()=>{class s{get disabled(){return this._disabled}set disabled(t){this._disabled=t;const i=this._getInput(d.END),o=this._getInput(d.START);i&&(i.disabled=this._disabled),o&&(o.disabled=this._disabled)}get discrete(){return this._discrete}set discrete(t){this._discrete=t,this._updateValueIndicatorUIs()}get min(){return this._min}set min(t){const i=isNaN(t)?this._min:t;this._min!==i&&this._updateMin(i)}_updateMin(t){const i=this._min;this._min=t,this._isRange?this._updateMinRange({old:i,new:t}):this._updateMinNonRange(t),this._onMinMaxOrStepChange()}_updateMinRange(t){const i=this._getInput(d.END),o=this._getInput(d.START),n=i.value,a=o.value;o.min=t.new,i.min=Math.max(t.new,o.value),o.max=Math.min(i.max,i.value),o._updateWidthInactive(),i._updateWidthInactive(),t.newt.old?this._onTranslateXChangeBySideEffect(o,i):this._onTranslateXChangeBySideEffect(i,o),n!==i.value&&this._onValueChange(i),a!==o.value&&this._onValueChange(o)}_updateMaxNonRange(t){const i=this._getInput(d.END);if(i){const o=i.value;i.max=t,i._updateThumbUIByValue(),this._updateTrackUI(i),o!==i.value&&this._onValueChange(i)}}get step(){return this._step}set step(t){const i=isNaN(t)?this._step:t;this._step!==i&&this._updateStep(i)}_updateStep(t){this._step=t,this._isRange?this._updateStepRange():this._updateStepNonRange(),this._onMinMaxOrStepChange()}_updateStepRange(){const t=this._getInput(d.END),i=this._getInput(d.START),o=t.value,n=i.value,a=i.value;t.min=this._min,i.max=this._max,t.step=this._step,i.step=this._step,this._platform.SAFARI&&(t.value=t.value,i.value=i.value),t.min=Math.max(this._min,i.value),i.max=Math.min(this._max,t.value),i._updateWidthInactive(),t._updateWidthInactive(),t.value`${f}`,this._rippleRadius=24,this.startValueIndicatorText="",this.endValueIndicatorText="",this._isRange=!1,this._isRtl=!1,this._hasViewInitialized=!1,this._tickMarkTrackWidth=0,this._hasAnimation=!1,this._resizeTimer=null,this._platform=(0,e.f3M)(N.t4),this._knobRadius=8,this._thumbsOverlap=!1,this._noopAnimations="NoopAnimations"===b,this._dirChangeSubscription=this._dir.change.subscribe(()=>this._onDirChange()),this._isRtl="rtl"===this._dir.value}ngAfterViewInit(){this._platform.isBrowser&&this._updateDimensions();const t=this._getInput(d.END),i=this._getInput(d.START);this._isRange=!!t&&!!i,this._cdr.detectChanges();const o=this._getThumb(d.END);this._rippleRadius=o._ripple.radius,this._inputPadding=this._rippleRadius-this._knobRadius,this._isRange?this._initUIRange(t,i):this._initUINonRange(t),this._updateTrackUI(t),this._updateTickMarkUI(),this._updateTickMarkTrackUI(),this._observeHostResize(),this._cdr.detectChanges()}_initUINonRange(t){t.initProps(),t.initUI(),this._updateValueIndicatorUI(t),this._hasViewInitialized=!0,t._updateThumbUIByValue()}_initUIRange(t,i){t.initProps(),t.initUI(),i.initProps(),i.initUI(),t._updateMinMax(),i._updateMinMax(),t._updateStaticStyles(),i._updateStaticStyles(),this._updateValueIndicatorUIs(),this._hasViewInitialized=!0,t._updateThumbUIByValue(),i._updateThumbUIByValue()}ngOnDestroy(){this._dirChangeSubscription.unsubscribe(),this._resizeObserver?.disconnect(),this._resizeObserver=null}_onDirChange(){this._isRtl="rtl"===this._dir.value,this._isRange?this._onDirChangeRange():this._onDirChangeNonRange(),this._updateTickMarkUI()}_onDirChangeRange(){const t=this._getInput(d.END),i=this._getInput(d.START);t._setIsLeftThumb(),i._setIsLeftThumb(),t.translateX=t._calcTranslateXByValue(),i.translateX=i._calcTranslateXByValue(),t._updateStaticStyles(),i._updateStaticStyles(),t._updateWidthInactive(),i._updateWidthInactive(),t._updateThumbUIByValue(),i._updateThumbUIByValue()}_onDirChangeNonRange(){this._getInput(d.END)._updateThumbUIByValue()}_observeHostResize(){typeof ResizeObserver>"u"||!ResizeObserver||this._ngZone.runOutsideAngular(()=>{this._resizeObserver=new ResizeObserver(()=>{this._isActive()||(this._resizeTimer&&clearTimeout(this._resizeTimer),this._onResize())}),this._resizeObserver.observe(this._elementRef.nativeElement)})}_isActive(){return this._getThumb(d.START)._isActive||this._getThumb(d.END)._isActive}_getValue(t=d.END){const i=this._getInput(t);return i?i.value:this.min}_skipUpdate(){return!(!this._getInput(d.START)?._skipUIUpdate&&!this._getInput(d.END)?._skipUIUpdate)}_updateDimensions(){this._cachedWidth=this._elementRef.nativeElement.offsetWidth,this._cachedLeft=this._elementRef.nativeElement.getBoundingClientRect().left}_setTrackActiveStyles(t){const i=this._trackActive.nativeElement.style;i.left=t.left,i.right=t.right,i.transformOrigin=t.transformOrigin,i.transform=t.transform}_calcTickMarkTransform(t){return`translateX(${t*(this._tickMarkTrackWidth/(this._tickMarks.length-1))}px`}_onTranslateXChange(t){this._hasViewInitialized&&(this._updateThumbUI(t),this._updateTrackUI(t),this._updateOverlappingThumbUI(t))}_onTranslateXChangeBySideEffect(t,i){this._hasViewInitialized&&(t._updateThumbUIByValue(),i._updateThumbUIByValue())}_onValueChange(t){this._hasViewInitialized&&(this._updateValueIndicatorUI(t),this._updateTickMarkUI(),this._cdr.detectChanges())}_onMinMaxOrStepChange(){this._hasViewInitialized&&(this._updateTickMarkUI(),this._updateTickMarkTrackUI(),this._cdr.markForCheck())}_onResize(){if(this._hasViewInitialized){if(this._updateDimensions(),this._isRange){const t=this._getInput(d.END),i=this._getInput(d.START);t._updateThumbUIByValue(),i._updateThumbUIByValue(),t._updateStaticStyles(),i._updateStaticStyles(),t._updateMinMax(),i._updateMinMax(),t._updateWidthInactive(),i._updateWidthInactive()}else{const t=this._getInput(d.END);t&&t._updateThumbUIByValue()}this._updateTickMarkUI(),this._updateTickMarkTrackUI(),this._cdr.detectChanges()}}_areThumbsOverlapping(){const t=this._getInput(d.START),i=this._getInput(d.END);return!(!t||!i)&&i.translateX-t.translateX<20}_updateOverlappingThumbClassNames(t){const i=t.getSibling(),o=this._getThumb(t.thumbPosition);this._getThumb(i.thumbPosition)._hostElement.classList.remove("mdc-slider__thumb--top"),o._hostElement.classList.toggle("mdc-slider__thumb--top",this._thumbsOverlap)}_updateOverlappingThumbUI(t){!this._isRange||this._skipUpdate()||this._thumbsOverlap!==this._areThumbsOverlapping()&&(this._thumbsOverlap=!this._thumbsOverlap,this._updateOverlappingThumbClassNames(t))}_updateThumbUI(t){this._skipUpdate()||(this._getThumb(t.thumbPosition===d.END?d.END:d.START)._hostElement.style.transform=`translateX(${t.translateX}px)`)}_updateValueIndicatorUI(t){if(this._skipUpdate())return;const i=this.displayWith(t.value);if(this._hasViewInitialized?t._valuetext=i:t._hostElement.setAttribute("aria-valuetext",i),this.discrete){t.thumbPosition===d.START?this.startValueIndicatorText=i:this.endValueIndicatorText=i;const o=this._getThumb(t.thumbPosition);i.length<3?o._hostElement.classList.add("mdc-slider__thumb--short-value"):o._hostElement.classList.remove("mdc-slider__thumb--short-value")}}_updateValueIndicatorUIs(){const t=this._getInput(d.END),i=this._getInput(d.START);t&&this._updateValueIndicatorUI(t),i&&this._updateValueIndicatorUI(i)}_updateTickMarkTrackUI(){if(!this.showTickMarks||this._skipUpdate())return;const t=this._step&&this._step>0?this._step:1,o=(Math.floor(this.max/t)*t-this.min)/(this.max-this.min);this._tickMarkTrackWidth=this._cachedWidth*o-6}_updateTrackUI(t){this._skipUpdate()||(this._isRange?this._updateTrackUIRange(t):this._updateTrackUINonRange(t))}_updateTrackUIRange(t){const i=t.getSibling();if(!i||!this._cachedWidth)return;const o=Math.abs(i.translateX-t.translateX)/this._cachedWidth;this._setTrackActiveStyles(t._isLeftThumb&&this._cachedWidth?{left:"auto",right:this._cachedWidth-i.translateX+"px",transformOrigin:"right",transform:`scaleX(${o})`}:{left:`${i.translateX}px`,right:"auto",transformOrigin:"left",transform:`scaleX(${o})`})}_updateTrackUINonRange(t){this._setTrackActiveStyles(this._isRtl?{left:"auto",right:"0px",transformOrigin:"right",transform:`scaleX(${1-t.fillPercentage})`}:{left:"0px",right:"auto",transformOrigin:"left",transform:`scaleX(${t.fillPercentage})`})}_updateTickMarkUI(){if(!this.showTickMarks||void 0===this.step||void 0===this.min||void 0===this.max)return;const t=this.step>0?this.step:1;this._isRange?this._updateTickMarkUIRange(t):this._updateTickMarkUINonRange(t),this._isRtl&&this._tickMarks.reverse()}_updateTickMarkUINonRange(t){const i=this._getValue();let o=Math.max(Math.floor((i-this.min)/t),0),n=Math.max(Math.floor((this.max-i)/t),0);this._isRtl?o++:n++,this._tickMarks=Array(o).fill(S.ACTIVE).concat(Array(n).fill(S.INACTIVE))}_updateTickMarkUIRange(t){const i=this._getValue(),o=this._getValue(d.START),n=Math.max(Math.floor((o-this.min)/t),0),a=Math.max(Math.floor((i-o)/t)+1,0),b=Math.max(Math.floor((this.max-i)/t),0);this._tickMarks=Array(n).fill(S.INACTIVE).concat(Array(a).fill(S.ACTIVE),Array(b).fill(S.INACTIVE))}_getInput(t){return t===d.END&&this._input?this._input:this._inputs?.length?t===d.START?this._inputs.first:this._inputs.last:void 0}_getThumb(t){return t===d.END?this._thumbs?.last:this._thumbs?.first}_setTransition(t){this._hasAnimation=!this._platform.IOS&&t&&!this._noopAnimations,this._elementRef.nativeElement.classList.toggle("mat-mdc-slider-with-animation",this._hasAnimation)}_isCursorOnSliderThumb(t,i){const o=i.width/2,f=t.clientY-(i.y+o);return Math.pow(t.clientX-(i.x+o),2)+Math.pow(f,2)P),multi:!0};let P=(()=>{class s{get value(){return(0,e.Cb_)(this._hostElement.value,0)}set value(t){const i=(t=isNaN(t)?0:t)+"";this._hasSetInitialValue?this._isActive||this._setValue(i):this._initialValue=i}_setValue(t){this._hostElement.value=t,this._updateThumbUIByValue(),this._slider._onValueChange(this),this._cdr.detectChanges(),this._slider._cdr.markForCheck()}get translateX(){return this._slider.min>=this._slider.max?(this._translateX=this._tickMarkOffset,this._translateX):(void 0===this._translateX&&(this._translateX=this._calcTranslateXByValue()),this._translateX)}set translateX(t){this._translateX=t}get min(){return(0,e.Cb_)(this._hostElement.min,0)}set min(t){this._hostElement.min=t+"",this._cdr.detectChanges()}get max(){return(0,e.Cb_)(this._hostElement.max,0)}set max(t){this._hostElement.max=t+"",this._cdr.detectChanges()}get step(){return(0,e.Cb_)(this._hostElement.step,0)}set step(t){this._hostElement.step=t+"",this._cdr.detectChanges()}get disabled(){return(0,e.VuI)(this._hostElement.disabled)}set disabled(t){this._hostElement.disabled=t,this._cdr.detectChanges(),this._slider.disabled!==this.disabled&&(this._slider.disabled=this.disabled)}get percentage(){return this._slider.min>=this._slider.max?this._slider._isRtl?1:0:(this.value-this._slider.min)/(this._slider.max-this._slider.min)}get fillPercentage(){return this._slider._cachedWidth?0===this._translateX?0:this.translateX/this._slider._cachedWidth:this._slider._isRtl?1:0}_setIsFocused(t){this._isFocused=t}constructor(t,i,o,n){this._ngZone=t,this._elementRef=i,this._cdr=o,this._slider=n,this.valueChange=new e.vpe,this.dragStart=new e.vpe,this.dragEnd=new e.vpe,this.thumbPosition=d.END,this._knobRadius=8,this._tickMarkOffset=3,this._isActive=!1,this._isFocused=!1,this._hasSetInitialValue=!1,this._destroyed=new R.x,this._skipUIUpdate=!1,this._onTouchedFn=()=>{},this._isControlInitialized=!1,this._platform=(0,e.f3M)(N.t4),this._hostElement=i.nativeElement,this._ngZone.runOutsideAngular(()=>{this._hostElement.addEventListener("pointerdown",this._onPointerDown.bind(this)),this._hostElement.addEventListener("pointermove",this._onPointerMove.bind(this)),this._hostElement.addEventListener("pointerup",this._onPointerUp.bind(this))})}ngOnDestroy(){this._hostElement.removeEventListener("pointerdown",this._onPointerDown),this._hostElement.removeEventListener("pointermove",this._onPointerMove),this._hostElement.removeEventListener("pointerup",this._onPointerUp),this._destroyed.next(),this._destroyed.complete(),this.dragStart.complete(),this.dragEnd.complete()}initProps(){this._updateWidthInactive(),this.disabled!==this._slider.disabled&&(this._slider.disabled=!0),this.step=this._slider.step,this.min=this._slider.min,this.max=this._slider.max,this._initValue()}initUI(){this._updateThumbUIByValue()}_initValue(){this._hasSetInitialValue=!0,void 0===this._initialValue?this.value=this._getDefaultValue():(this._hostElement.value=this._initialValue,this._updateThumbUIByValue(),this._slider._onValueChange(this),this._cdr.detectChanges())}_getDefaultValue(){return this.min}_onBlur(){this._setIsFocused(!1),this._onTouchedFn()}_onFocus(){this._setIsFocused(!0)}_onChange(){this.valueChange.emit(this.value),this._isActive&&this._updateThumbUIByValue({withAnimation:!0})}_onInput(){this._onChangeFn?.(this.value),(this._slider.step||!this._isActive)&&this._updateThumbUIByValue({withAnimation:!0}),this._slider._onValueChange(this)}_onNgControlValueChange(){(!this._isActive||!this._isFocused)&&(this._slider._onValueChange(this),this._updateThumbUIByValue()),this._slider.disabled=this._formControl.disabled}_onPointerDown(t){if(!this.disabled&&0===t.button){if(this._platform.IOS){const i=this._slider._isCursorOnSliderThumb(t,this._slider._getThumb(this.thumbPosition)._hostElement.getBoundingClientRect());return this._isActive=i,this._updateWidthActive(),void this._slider._updateDimensions()}this._isActive=!0,this._setIsFocused(!0),this._updateWidthActive(),this._slider._updateDimensions(),this._slider.step||this._updateThumbUIByPointerEvent(t,{withAnimation:!0}),this.disabled||(this._handleValueCorrection(t),this.dragStart.emit({source:this,parent:this._slider,value:this.value}))}}_handleValueCorrection(t){this._skipUIUpdate=!0,setTimeout(()=>{this._skipUIUpdate=!1,this._fixValue(t)},0)}_fixValue(t){const i=t.clientX-this._slider._cachedLeft,o=this._slider._cachedWidth,n=0===this._slider.step?1:this._slider.step,a=Math.floor((this._slider.max-this._slider.min)/n),w=Math.round((this._slider._isRtl?1-i/o:i/o)*a)/a*(this._slider.max-this._slider.min)+this._slider.min,L=Math.round(w/n)*n;if(L===this.value)return this._slider._onValueChange(this),void(this._slider.step>0?this._updateThumbUIByValue():this._updateThumbUIByPointerEvent(t,{withAnimation:this._slider._hasAnimation}));this.value=L,this.valueChange.emit(this.value),this._onChangeFn?.(this.value),this._slider._onValueChange(this),this._slider.step>0?this._updateThumbUIByValue():this._updateThumbUIByPointerEvent(t,{withAnimation:this._slider._hasAnimation})}_onPointerMove(t){!this._slider.step&&this._isActive&&this._updateThumbUIByPointerEvent(t)}_onPointerUp(){this._isActive&&(this._isActive=!1,this._platform.SAFARI&&this._setIsFocused(!1),this.dragEnd.emit({source:this,parent:this._slider,value:this.value}),setTimeout(()=>this._updateWidthInactive(),this._platform.IOS?10:0))}_clamp(t){const i=this._tickMarkOffset;return Math.max(Math.min(t,this._slider._cachedWidth-this._tickMarkOffset),i)}_calcTranslateXByValue(){return this._slider._isRtl?(1-this.percentage)*(this._slider._cachedWidth-2*this._tickMarkOffset)+this._tickMarkOffset:this.percentage*(this._slider._cachedWidth-2*this._tickMarkOffset)+this._tickMarkOffset}_calcTranslateXByPointerEvent(t){return t.clientX-this._slider._cachedLeft}_updateWidthActive(){}_updateWidthInactive(){this._hostElement.style.padding=`0 ${this._slider._inputPadding}px`,this._hostElement.style.width=`calc(100% + ${this._slider._inputPadding-2*this._tickMarkOffset}px)`,this._hostElement.style.left=`-${this._slider._rippleRadius-this._tickMarkOffset}px`}_updateThumbUIByValue(t){this.translateX=this._clamp(this._calcTranslateXByValue()),this._updateThumbUI(t)}_updateThumbUIByPointerEvent(t,i){this.translateX=this._clamp(this._calcTranslateXByPointerEvent(t)),this._updateThumbUI(i)}_updateThumbUI(t){this._slider._setTransition(!!t?.withAnimation),this._slider._onTranslateXChange(this)}writeValue(t){(this._isControlInitialized||null!==t)&&(this.value=t)}registerOnChange(t){this._onChangeFn=t,this._isControlInitialized=!0}registerOnTouched(t){this._onTouchedFn=t}setDisabledState(t){this.disabled=t}focus(){this._hostElement.focus()}blur(){this._hostElement.blur()}static#e=this.\u0275fac=function(i){return new(i||s)(e.Y36(e.R0b),e.Y36(e.SBq),e.Y36(e.sBO),e.Y36(E))};static#t=this.\u0275dir=e.lG2({type:s,selectors:[["input","matSliderThumb",""]],hostAttrs:["type","range",1,"mdc-slider__input"],hostVars:1,hostBindings:function(i,o){1&i&&e.NdJ("change",function(){return o._onChange()})("input",function(){return o._onInput()})("blur",function(){return o._onBlur()})("focus",function(){return o._onFocus()}),2&i&&e.uIk("aria-valuetext",o._valuetext)},inputs:{value:[e.lbL.HasDecoratorInputTransform,"value","value",e.Cb_]},outputs:{valueChange:"valueChange",dragStart:"dragStart",dragEnd:"dragEnd"},exportAs:["matSliderThumb"],standalone:!0,features:[e._Bn([Be,{provide:G,useExisting:s}]),e.Xq5]})}return s})(),Oe=(()=>{class s{static#e=this.\u0275fac=function(i){return new(i||s)};static#t=this.\u0275mod=e.oAB({type:s});static#i=this.\u0275inj=e.cJS({imports:[y.BQ,y.si]})}return s})();var Ne=l(4300),Fe=l(8337);const He=["input"],Qe=["formField"],Ye=["*"];let W=0;class ${constructor(r,t){this.source=r,this.value=t}}const Je={provide:c.JU,useExisting:(0,e.Gpc)(()=>ee),multi:!0},K=new e.OlP("MatRadioGroup"),qe=new e.OlP("mat-radio-default-options",{providedIn:"root",factory:function Ge(){return{color:"accent"}}});let ee=(()=>{class s{get name(){return this._name}set name(t){this._name=t,this._updateRadioButtonNames()}get labelPosition(){return this._labelPosition}set labelPosition(t){this._labelPosition="before"===t?"before":"after",this._markRadiosForCheck()}get value(){return this._value}set value(t){this._value!==t&&(this._value=t,this._updateSelectedRadioFromValue(),this._checkSelectedRadioButton())}_checkSelectedRadioButton(){this._selected&&!this._selected.checked&&(this._selected.checked=!0)}get selected(){return this._selected}set selected(t){this._selected=t,this.value=t?t.value:null,this._checkSelectedRadioButton()}get disabled(){return this._disabled}set disabled(t){this._disabled=t,this._markRadiosForCheck()}get required(){return this._required}set required(t){this._required=t,this._markRadiosForCheck()}constructor(t){this._changeDetector=t,this._value=null,this._name="mat-radio-group-"+W++,this._selected=null,this._isInitialized=!1,this._labelPosition="after",this._disabled=!1,this._required=!1,this._controlValueAccessorChangeFn=()=>{},this.onTouched=()=>{},this.change=new e.vpe}ngAfterContentInit(){this._isInitialized=!0,this._buttonChanges=this._radios.changes.subscribe(()=>{this.selected&&!this._radios.find(t=>t===this.selected)&&(this._selected=null)})}ngOnDestroy(){this._buttonChanges?.unsubscribe()}_touch(){this.onTouched&&this.onTouched()}_updateRadioButtonNames(){this._radios&&this._radios.forEach(t=>{t.name=this.name,t._markForCheck()})}_updateSelectedRadioFromValue(){this._radios&&(null===this._selected||this._selected.value!==this._value)&&(this._selected=null,this._radios.forEach(i=>{i.checked=this.value===i.value,i.checked&&(this._selected=i)}))}_emitChangeEvent(){this._isInitialized&&this.change.emit(new $(this._selected,this._value))}_markRadiosForCheck(){this._radios&&this._radios.forEach(t=>t._markForCheck())}writeValue(t){this.value=t,this._changeDetector.markForCheck()}registerOnChange(t){this._controlValueAccessorChangeFn=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.disabled=t,this._changeDetector.markForCheck()}static#e=this.\u0275fac=function(i){return new(i||s)(e.Y36(e.sBO))};static#t=this.\u0275dir=e.lG2({type:s,selectors:[["mat-radio-group"]],contentQueries:function(i,o,n){if(1&i&&e.Suo(n,F,5),2&i){let a;e.iGM(a=e.CRH())&&(o._radios=a)}},hostAttrs:["role","radiogroup",1,"mat-mdc-radio-group"],inputs:{color:"color",name:"name",labelPosition:"labelPosition",value:"value",selected:"selected",disabled:[e.lbL.HasDecoratorInputTransform,"disabled","disabled",e.VuI],required:[e.lbL.HasDecoratorInputTransform,"required","required",e.VuI]},outputs:{change:"change"},exportAs:["matRadioGroup"],standalone:!0,features:[e._Bn([Je,{provide:K,useExisting:s}]),e.Xq5]})}return s})(),F=(()=>{class s{get checked(){return this._checked}set checked(t){this._checked!==t&&(this._checked=t,t&&this.radioGroup&&this.radioGroup.value!==this.value?this.radioGroup.selected=this:!t&&this.radioGroup&&this.radioGroup.value===this.value&&(this.radioGroup.selected=null),t&&this._radioDispatcher.notify(this.id,this.name),this._changeDetector.markForCheck())}get value(){return this._value}set value(t){this._value!==t&&(this._value=t,null!==this.radioGroup&&(this.checked||(this.checked=this.radioGroup.value===t),this.checked&&(this.radioGroup.selected=this)))}get labelPosition(){return this._labelPosition||this.radioGroup&&this.radioGroup.labelPosition||"after"}set labelPosition(t){this._labelPosition=t}get disabled(){return this._disabled||null!==this.radioGroup&&this.radioGroup.disabled}set disabled(t){this._setDisabled(t)}get required(){return this._required||this.radioGroup&&this.radioGroup.required}set required(t){this._required=t}get color(){return this._color||this.radioGroup&&this.radioGroup.color||this._providerOverride&&this._providerOverride.color||"accent"}set color(t){this._color=t}get inputId(){return`${this.id||this._uniqueId}-input`}constructor(t,i,o,n,a,b,f,w){this._elementRef=i,this._changeDetector=o,this._focusMonitor=n,this._radioDispatcher=a,this._providerOverride=f,this._uniqueId="mat-radio-"+ ++W,this.id=this._uniqueId,this.disableRipple=!1,this.tabIndex=0,this.change=new e.vpe,this._checked=!1,this._value=null,this._removeUniqueSelectionListener=()=>{},this.radioGroup=t,this._noopAnimations="NoopAnimations"===b,w&&(this.tabIndex=(0,e.Cb_)(w,0))}focus(t,i){i?this._focusMonitor.focusVia(this._inputElement,i,t):this._inputElement.nativeElement.focus(t)}_markForCheck(){this._changeDetector.markForCheck()}ngOnInit(){this.radioGroup&&(this.checked=this.radioGroup.value===this._value,this.checked&&(this.radioGroup.selected=this),this.name=this.radioGroup.name),this._removeUniqueSelectionListener=this._radioDispatcher.listen((t,i)=>{t!==this.id&&i===this.name&&(this.checked=!1)})}ngDoCheck(){this._updateTabIndex()}ngAfterViewInit(){this._updateTabIndex(),this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>{!t&&this.radioGroup&&this.radioGroup._touch()})}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef),this._removeUniqueSelectionListener()}_emitChangeEvent(){this.change.emit(new $(this,this._value))}_isRippleDisabled(){return this.disableRipple||this.disabled}_onInputClick(t){t.stopPropagation()}_onInputInteraction(t){if(t.stopPropagation(),!this.checked&&!this.disabled){const i=this.radioGroup&&this.value!==this.radioGroup.value;this.checked=!0,this._emitChangeEvent(),this.radioGroup&&(this.radioGroup._controlValueAccessorChangeFn(this.value),i&&this.radioGroup._emitChangeEvent())}}_onTouchTargetClick(t){this._onInputInteraction(t),this.disabled||this._inputElement.nativeElement.focus()}_setDisabled(t){this._disabled!==t&&(this._disabled=t,this._changeDetector.markForCheck())}_updateTabIndex(){const t=this.radioGroup;let i;if(i=t&&t.selected&&!this.disabled?t.selected===this?this.tabIndex:-1:this.tabIndex,i!==this._previousTabIndex){const o=this._inputElement?.nativeElement;o&&(o.setAttribute("tabindex",i+""),this._previousTabIndex=i)}}static#e=this.\u0275fac=function(i){return new(i||s)(e.Y36(K,8),e.Y36(e.SBq),e.Y36(e.sBO),e.Y36(Ne.tE),e.Y36(Fe.A8),e.Y36(e.QbO,8),e.Y36(qe,8),e.$8M("tabindex"))};static#t=this.\u0275cmp=e.Xpm({type:s,selectors:[["mat-radio-button"]],viewQuery:function(i,o){if(1&i&&(e.Gf(He,5),e.Gf(Qe,7,e.SBq)),2&i){let n;e.iGM(n=e.CRH())&&(o._inputElement=n.first),e.iGM(n=e.CRH())&&(o._rippleTrigger=n.first)}},hostAttrs:[1,"mat-mdc-radio-button"],hostVars:15,hostBindings:function(i,o){1&i&&e.NdJ("focus",function(){return o._inputElement.nativeElement.focus()}),2&i&&(e.uIk("id",o.id)("tabindex",null)("aria-label",null)("aria-labelledby",null)("aria-describedby",null),e.ekj("mat-primary","primary"===o.color)("mat-accent","accent"===o.color)("mat-warn","warn"===o.color)("mat-mdc-radio-checked",o.checked)("_mat-animation-noopable",o._noopAnimations))},inputs:{id:"id",name:"name",ariaLabel:[e.lbL.None,"aria-label","ariaLabel"],ariaLabelledby:[e.lbL.None,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[e.lbL.None,"aria-describedby","ariaDescribedby"],disableRipple:[e.lbL.HasDecoratorInputTransform,"disableRipple","disableRipple",e.VuI],tabIndex:[e.lbL.HasDecoratorInputTransform,"tabIndex","tabIndex",t=>null==t?0:(0,e.Cb_)(t)],checked:[e.lbL.HasDecoratorInputTransform,"checked","checked",e.VuI],value:"value",labelPosition:"labelPosition",disabled:[e.lbL.HasDecoratorInputTransform,"disabled","disabled",e.VuI],required:[e.lbL.HasDecoratorInputTransform,"required","required",e.VuI],color:"color"},outputs:{change:"change"},exportAs:["matRadioButton"],standalone:!0,features:[e.Xq5,e.jDz],ngContentSelectors:Ye,decls:13,vars:16,consts:[["mat-internal-form-field","",3,"labelPosition"],["formField",""],[1,"mdc-radio"],[1,"mat-mdc-radio-touch-target",3,"click"],["type","radio",1,"mdc-radio__native-control",3,"id","checked","disabled","required","change"],["input",""],[1,"mdc-radio__background"],[1,"mdc-radio__outer-circle"],[1,"mdc-radio__inner-circle"],["mat-ripple","",1,"mat-radio-ripple","mat-mdc-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered"],[1,"mat-ripple-element","mat-radio-persistent-ripple"],[1,"mdc-label",3,"for"]],template:function(i,o){1&i&&(e.F$t(),e.TgZ(0,"div",0,1)(2,"div",2)(3,"div",3),e.NdJ("click",function(a){return o._onTouchTargetClick(a)}),e.qZA(),e.TgZ(4,"input",4,5),e.NdJ("change",function(a){return o._onInputInteraction(a)}),e.qZA(),e.TgZ(6,"div",6),e._UZ(7,"div",7)(8,"div",8),e.qZA(),e.TgZ(9,"div",9),e._UZ(10,"div",10),e.qZA()(),e.TgZ(11,"label",11),e.Hsn(12),e.qZA()()),2&i&&(e.Q6J("labelPosition",o.labelPosition),e.xp6(2),e.ekj("mdc-radio--disabled",o.disabled),e.xp6(2),e.Q6J("id",o.inputId)("checked",o.checked)("disabled",o.disabled)("required",o.required),e.uIk("name",o.name)("value",o.value)("aria-label",o.ariaLabel)("aria-labelledby",o.ariaLabelledby)("aria-describedby",o.ariaDescribedby),e.xp6(5),e.Q6J("matRippleTrigger",o._rippleTrigger.nativeElement)("matRippleDisabled",o._isRippleDisabled())("matRippleCentered",!0),e.xp6(2),e.Q6J("for",o.inputId))},dependencies:[y.wG,y.fq],styles:['.mdc-radio{display:inline-block;position:relative;flex:0 0 auto;box-sizing:content-box;width:20px;height:20px;cursor:pointer;will-change:opacity,transform,border-color,color}.mdc-radio[hidden]{display:none}.mdc-radio__background{display:inline-block;position:relative;box-sizing:border-box;width:20px;height:20px}.mdc-radio__background::before{position:absolute;transform:scale(0, 0);border-radius:50%;opacity:0;pointer-events:none;content:"";transition:opacity 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1),transform 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-radio__outer-circle{position:absolute;top:0;left:0;box-sizing:border-box;width:100%;height:100%;border-width:2px;border-style:solid;border-radius:50%;transition:border-color 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-radio__inner-circle{position:absolute;top:0;left:0;box-sizing:border-box;width:100%;height:100%;transform:scale(0, 0);border-width:10px;border-style:solid;border-radius:50%;transition:transform 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1),border-color 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-radio__native-control{position:absolute;margin:0;padding:0;opacity:0;cursor:inherit;z-index:1}.mdc-radio--touch{margin-top:4px;margin-bottom:4px;margin-right:4px;margin-left:4px}.mdc-radio--touch .mdc-radio__native-control{top:calc((40px - 48px) / 2);right:calc((40px - 48px) / 2);left:calc((40px - 48px) / 2);width:48px;height:48px}.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring{pointer-events:none;border:2px solid rgba(0,0,0,0);border-radius:6px;box-sizing:content-box;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:100%;width:100%}@media screen and (forced-colors: active){.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring{border-color:CanvasText}}.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring::after,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring::after{content:"";border:2px solid rgba(0,0,0,0);border-radius:8px;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:calc(100% + 4px);width:calc(100% + 4px)}@media screen and (forced-colors: active){.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring::after,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring::after{border-color:CanvasText}}.mdc-radio__native-control:checked+.mdc-radio__background,.mdc-radio__native-control:disabled+.mdc-radio__background{transition:opacity 120ms 0ms cubic-bezier(0, 0, 0.2, 1),transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__outer-circle,.mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__outer-circle{transition:border-color 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__inner-circle,.mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__inner-circle{transition:transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1),border-color 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio--disabled{cursor:default;pointer-events:none}.mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__inner-circle{transform:scale(0.5);transition:transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1),border-color 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio__native-control:disabled+.mdc-radio__background,[aria-disabled=true] .mdc-radio__native-control+.mdc-radio__background{cursor:default}.mdc-radio__native-control:focus+.mdc-radio__background::before{transform:scale(1);opacity:.12;transition:opacity 120ms 0ms cubic-bezier(0, 0, 0.2, 1),transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-radio-button{-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-radio-button .mdc-radio{padding:calc((var(--mdc-radio-state-layer-size) - 20px) / 2)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-disabled-selected-icon-color)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control+.mdc-radio__background .mdc-radio__inner-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-disabled-selected-icon-color)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled:checked+.mdc-radio__background .mdc-radio__outer-circle{opacity:var(--mdc-radio-disabled-selected-icon-opacity)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control+.mdc-radio__background .mdc-radio__inner-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__inner-circle{opacity:var(--mdc-radio-disabled-selected-icon-opacity)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-disabled-unselected-icon-color)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{opacity:var(--mdc-radio-disabled-unselected-icon-opacity)}.mat-mdc-radio-button .mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-selected-focus-icon-color)}.mat-mdc-radio-button .mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle,.mat-mdc-radio-button .mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-selected-focus-icon-color)}.mat-mdc-radio-button .mdc-radio:hover .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-selected-hover-icon-color)}.mat-mdc-radio-button .mdc-radio:hover .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-selected-hover-icon-color)}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-selected-icon-color)}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-selected-icon-color)}.mat-mdc-radio-button .mdc-radio:not(:disabled):active .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-selected-pressed-icon-color)}.mat-mdc-radio-button .mdc-radio:not(:disabled):active .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-selected-pressed-icon-color)}.mat-mdc-radio-button .mdc-radio:hover .mdc-radio__native-control:enabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-unselected-hover-icon-color)}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:enabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-unselected-icon-color)}.mat-mdc-radio-button .mdc-radio:not(:disabled):active .mdc-radio__native-control:enabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-unselected-pressed-icon-color)}.mat-mdc-radio-button .mdc-radio .mdc-radio__background::before{top:calc(-1 * (var(--mdc-radio-state-layer-size) - 20px) / 2);left:calc(-1 * (var(--mdc-radio-state-layer-size) - 20px) / 2);width:var(--mdc-radio-state-layer-size);height:var(--mdc-radio-state-layer-size)}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control{top:calc((var(--mdc-radio-state-layer-size) - var(--mdc-radio-state-layer-size)) / 2);right:calc((var(--mdc-radio-state-layer-size) - var(--mdc-radio-state-layer-size)) / 2);left:calc((var(--mdc-radio-state-layer-size) - var(--mdc-radio-state-layer-size)) / 2);width:var(--mdc-radio-state-layer-size);height:var(--mdc-radio-state-layer-size)}.mat-mdc-radio-button .mdc-radio .mdc-radio__background::before{background-color:var(--mat-radio-ripple-color)}.mat-mdc-radio-button .mdc-radio:hover .mdc-radio__native-control:not([disabled]):not(:focus)~.mdc-radio__background::before{opacity:.04;transform:scale(1)}.mat-mdc-radio-button.mat-mdc-radio-checked .mdc-radio__background::before{background-color:var(--mat-radio-checked-ripple-color)}.mat-mdc-radio-button.mat-mdc-radio-checked .mat-ripple-element{background-color:var(--mat-radio-checked-ripple-color)}.mat-mdc-radio-button .mdc-radio--disabled+label{color:var(--mat-radio-disabled-label-color)}.mat-mdc-radio-button .mat-radio-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:50%}.mat-mdc-radio-button .mat-radio-ripple .mat-ripple-element{opacity:.14}.mat-mdc-radio-button .mat-radio-ripple::before{border-radius:50%}.mat-mdc-radio-button._mat-animation-noopable .mdc-radio__background::before,.mat-mdc-radio-button._mat-animation-noopable .mdc-radio__outer-circle,.mat-mdc-radio-button._mat-animation-noopable .mdc-radio__inner-circle{transition:none !important}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:focus:enabled:not(:checked)~.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-unselected-focus-icon-color, black)}.mat-mdc-radio-button.cdk-focused .mat-mdc-focus-indicator::before{content:""}.mat-mdc-radio-touch-target{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%)}[dir=rtl] .mat-mdc-radio-touch-target{left:0;right:50%;transform:translate(50%, -50%)}'],encapsulation:2,changeDetection:0})}return s})(),Xe=(()=>{class s{static#e=this.\u0275fac=function(i){return new(i||s)};static#t=this.\u0275mod=e.oAB({type:s});static#i=this.\u0275inj=e.cJS({imports:[y.BQ,m.ez,y.si,F,y.BQ]})}return s})();var D=l(3651),je=l(8484),h=l(6825),H=l(2438),Z=l(9773),ze=l(1374);function We(s,r){if(1&s){const t=e.EpF();e.TgZ(0,"div",2),e.NdJ("@fade.done",function(o){e.CHM(t);const n=e.oxw();return e.KtG(n.onAnimationEnd(o))}),e.qZA()}if(2&s){const t=e.oxw();e.Q6J("@fade",t.animationState)("@.disabled",!t.animation)("innerHTML",t.title,e.oJD)}}function $e(s,r){if(1&s){const t=e.EpF();e.TgZ(0,"div",3),e.NdJ("@fade.done",function(o){e.CHM(t);const n=e.oxw();return e.KtG(n.onAnimationEnd(o))}),e._uU(1),e.qZA()}if(2&s){const t=e.oxw();e.Q6J("@fade",t.animationState)("@.disabled",!t.animation),e.xp6(),e.hij(" ",t.title,"\n")}}let Ke=(()=>{class s{_cdRef;title;html;animation;tooltip=!0;_hidden=new R.x;animationState="hidden";constructor(t){this._cdRef=t}markForCheck(){this._cdRef.markForCheck()}onAnimationEnd(t){"hidden"===t.toState&&this._hidden.next()}static \u0275fac=function(i){return new(i||s)(e.Y36(e.sBO))};static \u0275cmp=e.Xpm({type:s,selectors:[["mdb-tooltip"]],hostVars:2,hostBindings:function(i,o){2&i&&e.ekj("tooltip",o.tooltip)},inputs:{title:"title",html:"html",animation:"animation"},decls:2,vars:2,consts:[["class","tooltip-inner",3,"innerHTML",4,"ngIf"],["class","tooltip-inner",4,"ngIf"],[1,"tooltip-inner",3,"innerHTML"],[1,"tooltip-inner"]],template:function(i,o){1&i&&e.YNc(0,We,1,3,"div",0)(1,$e,2,3,"div",1),2&i&&(e.Q6J("ngIf",o.html),e.xp6(),e.Q6J("ngIf",!o.html))},dependencies:[m.O5],encapsulation:2,data:{animation:[(0,h.X$)("fade",[(0,h.SB)("visible",(0,h.oB)({opacity:1})),(0,h.SB)("hidden",(0,h.oB)({opacity:0})),(0,h.eR)("visible => hidden",(0,h.jt)("150ms linear")),(0,h.eR)(":enter",(0,h.jt)("150ms linear"))])]},changeDetection:0})}return s})(),U=(()=>{class s{_overlay;_overlayPositionBuilder;_elementRef;mdbTooltip="";tooltipDisabled=!1;placement="top";html=!1;animation=!0;trigger="hover focus";delayShow=0;delayHide=0;offset=0;tooltipShow=new e.vpe;tooltipShown=new e.vpe;tooltipHide=new e.vpe;tooltipHidden=new e.vpe;_overlayRef;_tooltipRef;_open=!1;_showTimeout=0;_hideTimeout=0;_destroy$=new R.x;constructor(t,i,o){this._overlay=t,this._overlayPositionBuilder=i,this._elementRef=o}ngOnInit(){this.tooltipDisabled||""===this.mdbTooltip||this._bindTriggerEvents()}ngOnDestroy(){(this._open||this._showTimeout)&&this.hide(),this._destroy$.next(),this._destroy$.complete()}_bindTriggerEvents(){this.trigger.split(" ").forEach(i=>{if("click"===i)(0,H.R)(this._elementRef.nativeElement,i).pipe((0,Z.R)(this._destroy$)).subscribe(()=>this.toggle());else if("manual"!==i){const n="hover"===i?"mouseleave":"focusout";(0,H.R)(this._elementRef.nativeElement,"hover"===i?"mouseenter":"focusin").pipe((0,Z.R)(this._destroy$)).subscribe(()=>this.show()),(0,H.R)(this._elementRef.nativeElement,n).pipe((0,Z.R)(this._destroy$)).subscribe(()=>this.hide())}})}_createOverlayConfig(){const t=this._overlayPositionBuilder.flexibleConnectedTo(this._elementRef).withPositions(this._getPosition());return new D.X_({hasBackdrop:!1,scrollStrategy:this._overlay.scrollStrategies.reposition(),positionStrategy:t})}_createOverlay(){this._overlayRef=this._overlay.create(this._createOverlayConfig())}_getPosition(){let t;const i={originX:"center",originY:"top",overlayX:"center",overlayY:"bottom",offsetY:-this.offset},o={originX:"center",originY:"bottom",overlayX:"center",overlayY:"top",offsetY:this.offset},n={originX:"end",originY:"center",overlayX:"start",overlayY:"center",offsetX:this.offset},a={originX:"start",originY:"center",overlayX:"end",overlayY:"center",offsetX:-this.offset};switch(this.placement){case"top":t=[i,o];break;case"bottom":t=[o,i];break;case"left":t=[a,n];break;case"right":t=[n,a]}return t}show(){(this._hideTimeout||this._open)&&(this._overlayRef.detach(),clearTimeout(this._hideTimeout),this._hideTimeout=null),this._createOverlay(),this._showTimeout=setTimeout(()=>{if(!this._overlayRef.hasAttached()){const t=new je.C5(Ke);this.tooltipShow.emit(this),this._open=!0,this._tooltipRef=this._overlayRef.attach(t),this._tooltipRef.instance.title=this.mdbTooltip,this._tooltipRef.instance.html=this.html,this._tooltipRef.instance.animation=this.animation,this._tooltipRef.instance.animationState="visible",this._tooltipRef.instance.markForCheck(),this.tooltipShown.emit(this)}},this.delayShow)}hide(){this._showTimeout&&(clearTimeout(this._showTimeout),this._showTimeout=null,this._hideTimeout=setTimeout(()=>{this.tooltipHide.emit(this),this._tooltipRef?(this._tooltipRef.instance._hidden.pipe((0,ze.P)()).subscribe(()=>{this._overlayRef.detach(),this._open=!1,this.tooltipHidden.emit(this)}),this._tooltipRef.instance.animationState="hidden",this._tooltipRef.instance.markForCheck()):(this._overlayRef.detach(),this._open=!1,this.tooltipHidden.emit(this))},this.delayHide))}toggle(){this._open?this.hide():this.show()}static \u0275fac=function(i){return new(i||s)(e.Y36(D.aV),e.Y36(D.wJ),e.Y36(e.SBq))};static \u0275dir=e.lG2({type:s,selectors:[["","mdbTooltip",""]],inputs:{mdbTooltip:"mdbTooltip",tooltipDisabled:"tooltipDisabled",placement:"placement",html:"html",animation:"animation",trigger:"trigger",delayShow:"delayShow",delayHide:"delayHide",offset:"offset"},outputs:{tooltipShow:"tooltipShow",tooltipShown:"tooltipShown",tooltipHide:"tooltipHide",tooltipHidden:"tooltipHidden"},exportAs:["mdbTooltip"]})}return s})(),et=(()=>{class s{static \u0275fac=function(i){return new(i||s)};static \u0275mod=e.oAB({type:s});static \u0275inj=e.cJS({imports:[m.ez,D.U8]})}return s})();const tt=["musicPlayedInput"];function it(s,r){if(1&s&&(e.TgZ(0,"mat-checkbox",43),e._uU(1," Contribute to improving the database "),e._UZ(2,"i",44),e.qZA()),2&s){const t=e.oxw();e.xp6(2),e.Q6J("mdbTooltip",t.accuracyText())("html",!0)}}function st(s,r){1&s&&e._UZ(0,"span",47)}function ot(s,r){if(1&s&&(e.TgZ(0,"button",45),e._uU(1),e.YNc(2,st,1,0,"span",46),e.qZA()),2&s){const t=e.oxw();e.xp6(),e.hij(" ",t.lobby?"Save":"Create"," "),e.xp6(),e.Q6J("ngIf",t.loading)}}let te=(()=>{class s{fb;lobbyHttpService;router;lobbyStore;authService;lobbyForm;lobby;loading=!1;userCanEdit=!0;subscriptions=[];musicAccuracyRatio;lobbyGameModes=u.in;lobbyHintModes=u.BF;songSelectionPercentage=100;musicPlayedInput;constructor(t,i,o,n,a){this.fb=t,this.lobbyHttpService=i,this.router=o,this.lobbyStore=n,this.authService=a}ngOnInit(){this.lobby=this.lobbyStore.getLobby(),this.songSelectionPercentage=this.lobby?this.lobby.playedMusics/this.lobby.musicNumber*100:100,this.lobbyHttpService.info().subscribe(t=>{this.musicAccuracyRatio=t}),this.lobbyForm=this.fb.group({name:[this.lobby?this.lobby.name:`${this.authService.decodeJwt().username}'s lobby`,c.kI.required.bind(this)],password:[this.lobby?.password],musicNumber:[this.lobby?this.lobby.musicNumber:20,[c.kI.max(100),c.kI.min(5)]],playedMusics:[this.lobby?this.lobby.playedMusics:20,[c.kI.max(this.lobby?.musicNumber??20),c.kI.min(0)]],guessTime:[this.lobby?this.lobby.guessTime:20,[c.kI.max(60),c.kI.min(5)]],allowDuplicates:[!!this.lobby&&this.lobby.allowDuplicates],customDifficulty:[!!this.lobby&&this.lobby.customDifficulty],easyDifficulty:[!this.lobby||this.lobby.difficulty.includes(u.PT.Easy)],mediumDifficulty:[!this.lobby||this.lobby.difficulty.includes(u.PT.Medium)],hardDifficulty:[!this.lobby||this.lobby.difficulty.includes(u.PT.Hard)],allowContributeToMissingData:[!this.lobby||this.lobby.allowContributeToMissingData],gameMode:[this.lobby?this.lobby.gameMode:u.in.Standard],playMusicOnAnswerReveal:[!this.lobby||this.lobby.playMusicOnAnswerReveal],showCorrectAnswersDuringGuessTime:[!!this.lobby&&this.lobby.showCorrectAnswersDuringGuessTime],hintMode:[this.lobby?this.lobby.hintMode:u.BF.Allowed,[c.kI.required.bind(this)]]}),this.lobby&&(this.subscriptions=[this.lobbyStore.lobby.subscribe(t=>{this.lobby=t,this.lobbyForm.patchValue({name:this.lobby.name,...this.lobby?.password&&{password:this.lobby?.password},musicNumber:this.lobby.musicNumber,guessTime:this.lobby.guessTime,allowDuplicates:this.lobby.allowDuplicates,easyDifficulty:this.lobby.difficulty.includes(u.PT.Easy),mediumDifficulty:this.lobby.difficulty.includes(u.PT.Medium),hardDifficulty:this.lobby.difficulty.includes(u.PT.Hard)})}),this.lobbyStore.me.subscribe(t=>{null!==t&&(this.userCanEdit=t.role===v.Host,this.userCanEdit?this.lobbyForm.enable():this.lobbyForm.disable())})]),this.lobbyForm.get("musicNumber").valueChanges.subscribe({next:t=>{this.lobbyForm.get("musicNumber").setValue(t,{onlySelf:!0,emitEvent:!1,emitModelToViewChange:!0}),this.musicPlayedInput.nativeElement.max=t;const i=this.lobbyForm.get("playedMusics");i.setValue(Math.round(t*this.songSelectionPercentage/100),{emitEvent:!1}),i.setValidators([c.kI.max(this.lobby?.musicNumber||20),c.kI.min(0)])}}),this.lobbyForm.get("guessTime").valueChanges.subscribe({next:t=>{this.lobbyForm.get("guessTime").setValue(t,{onlySelf:!0,emitEvent:!1,emitModelToViewChange:!0})}}),this.lobbyForm.get("playedMusics").valueChanges.subscribe({next:t=>{this.lobbyForm.get("playedMusics").setValue(t,{onlySelf:!0,emitEvent:!1,emitModelToViewChange:!0}),this.songSelectionPercentage=t/this.lobbyForm.get("musicNumber").value*100}})}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}submit(){this.loading=!0;let t=[];this.lobbyForm.get("easyDifficulty").value&&(t=[...t,u.PT.Easy]),this.lobbyForm.get("mediumDifficulty").value&&(t=[...t,u.PT.Medium]),this.lobbyForm.get("hardDifficulty").value&&(t=[...t,u.PT.Hard]),null===this.lobby?this.lobbyHttpService.create({name:this.lobbyForm.get("name").value,password:this.lobbyForm.get("password").value,musicNumber:this.lobbyForm.get("musicNumber").value,playedMusics:this.lobbyForm.get("playedMusics").value,guessTime:this.lobbyForm.get("guessTime").value,allowDuplicates:this.lobbyForm.get("allowDuplicates").value,difficulty:t,allowContributeToMissingData:this.lobbyForm.get("allowContributeToMissingData").value,gameMode:this.lobbyForm.get("gameMode").value,playMusicOnAnswerReveal:this.lobbyForm.get("playMusicOnAnswerReveal").value,showCorrectAnswersDuringGuessTime:this.lobbyForm.get("showCorrectAnswersDuringGuessTime").value,hintMode:this.lobbyForm.get("hintMode").value}).pipe((0,T.x)(()=>this.loading=!1)).subscribe(i=>{this.router.navigate([`/lobby/${i.code}`])}):this.lobbyHttpService.update(this.lobby.code,{name:this.lobbyForm.get("name").value,password:this.lobbyForm.get("password").value,musicNumber:this.lobbyForm.get("musicNumber").value,playedMusics:this.lobbyForm.get("playedMusics").value,guessTime:this.lobbyForm.get("guessTime").value,allowDuplicates:this.lobbyForm.get("allowDuplicates").value,difficulty:t,allowContributeToMissingData:this.lobbyForm.get("allowContributeToMissingData").value,gameMode:this.lobbyForm.get("gameMode").value,playMusicOnAnswerReveal:this.lobbyForm.get("playMusicOnAnswerReveal").value,showCorrectAnswersDuringGuessTime:this.lobbyForm.get("showCorrectAnswersDuringGuessTime").value,hintMode:this.lobbyForm.get("hintMode").value}).pipe((0,T.x)(()=>this.loading=!1)).subscribe(()=>{})}hideContribution(){return this.lobbyForm.get("easyDifficulty").value&&this.lobbyForm.get("mediumDifficulty").value&&this.lobbyForm.get("hardDifficulty").value}accuracyText(){return`By checking this, each music has ${Math.round(1e4*(this.musicAccuracyRatio+Number.EPSILON))/100}% chance to not reflect the difficulty chosen in order to improve our database.
The more you play, the lower the chance!`}static \u0275fac=function(i){return new(i||s)(e.Y36(c.qu),e.Y36(I.Y),e.Y36(_.F0),e.Y36(g),e.Y36(k.e))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-lobby-config"]],viewQuery:function(i,o){if(1&i&&e.Gf(tt,5),2&i){let n;e.iGM(n=e.CRH())&&(o.musicPlayedInput=n.first)}},decls:96,vars:20,consts:[[1,"bg-dark","p-4","h-100"],[1,"h-100",3,"formGroup","ngSubmit"],[1,"form-container"],["appearance","outline",1,"me-2"],["matInput","","formControlName","name","required","required"],["appearance","outline"],["matInput","","type","text","formControlName","password"],[1,"row"],[1,"col-xxl-4","col-xl-5"],[1,"mt-3"],["color","primary",2,"width","70%",3,"min","max","step"],["matSliderThumb","","formControlName","musicNumber"],[1,"d-inline",2,"width","15%"],["type","number","max","100","min","5","formControlName","musicNumber"],["matSliderThumb","","formControlName","guessTime"],["type","number","max","100","min","5","formControlName","guessTime"],["mdbTooltip","The number of songs from players' list. The rest will be filled with random games.","placement","top",1,"fa-solid","fa-question-circle"],["color","primary",2,"width","70%",3,"min","step","max"],["matSliderThumb","","formControlName","playedMusics"],["type","number","min","0","formControlName","playedMusics",3,"max"],["musicPlayedInput",""],[1,"col-md-4","mb-2"],[1,"mb-3"],["formControlName","easyDifficulty","color","primary",1,"mx-3","checkbox-center"],["formControlName","mediumDifficulty","color","primary",1,"mx-3","checkbox-center"],["formControlName","hardDifficulty","color","primary",1,"mx-3","checkbox-center"],["class","mx-3","color","primary","formControlName","allowContributeToMissingData",4,"ngIf"],["mdbTooltip","Allow players to choose between 4 answers, but they win half the usual points","placement","bottom",1,"fa-solid","fa-question-circle",3,"html"],["aria-label","Select an option","formControlName","hintMode","color","primary",1,"d-flex"],[3,"value"],[1,"col-md-4","mt-2","mt-md-0"],["aria-label","Select an option","formControlName","gameMode","color","primary",1,"d-flex"],["value","2","disabled",""],["value","3","disabled",""],["mdbTooltip","One of you plays the music, the other can turn off their phone.
Don't worry about neither your score nor your accuracy, it's gone","placement","bottom",3,"value","html"],[1,"row","mt-3"],[1,"col-md-4"],["formControlName","allowDuplicates","color","primary",1,"me-2","checkbox-center"],["formControlName","playMusicOnAnswerReveal","color","primary",1,"me-2","checkbox-center"],["formControlName","showCorrectAnswersDuringGuessTime","color","primary",1,"me-2","checkbox-center"],[1,"row","bg-dark","justify-content-end","mt-2"],[1,"col-md-2"],["class","btn btn-primary w-100","type","submit",4,"ngIf"],["color","primary","formControlName","allowContributeToMissingData",1,"mx-3"],["placement","bottom",1,"fa-solid","fa-question-circle",3,"mdbTooltip","html"],["type","submit",1,"btn","btn-primary","w-100"],["class","spinner-border spinner-border-sm","type","button","role","status","aria-hidden","true",4,"ngIf"],["type","button","role","status","aria-hidden","true",1,"spinner-border","spinner-border-sm"]],template:function(i,o){1&i&&(e.TgZ(0,"div",0)(1,"form",1),e.NdJ("ngSubmit",function(){return!o.userCanEdit||o.submit()}),e.TgZ(2,"div",2)(3,"mat-form-field",3)(4,"mat-label"),e._uU(5,"Lobby name"),e.qZA(),e._UZ(6,"input",4),e.qZA(),e.TgZ(7,"mat-form-field",5)(8,"mat-label"),e._uU(9,"Password "),e.qZA(),e._UZ(10,"input",6),e.TgZ(11,"mat-hint"),e._uU(12,"keep it empty if this is public lobby"),e.qZA()(),e.TgZ(13,"h1"),e._uU(14,"Settings"),e.qZA(),e.TgZ(15,"div",7)(16,"div",8)(17,"h3"),e._uU(18,"Lobby"),e.qZA(),e.TgZ(19,"div",7)(20,"div",9)(21,"div")(22,"label"),e._uU(23,"Number of musics "),e.qZA()(),e.TgZ(24,"mat-slider",10),e._UZ(25,"input",11),e.qZA(),e.TgZ(26,"div",12),e._UZ(27,"input",13),e.qZA()(),e.TgZ(28,"div",9)(29,"div")(30,"label"),e._uU(31,"Guessing time "),e.qZA()(),e.TgZ(32,"div")(33,"mat-slider",10),e._UZ(34,"input",14),e.qZA(),e.TgZ(35,"div",12),e._UZ(36,"input",15),e._uU(37,"s "),e.qZA()()(),e.TgZ(38,"div",9)(39,"div")(40,"label"),e._uU(41," Played games "),e._UZ(42,"i",16),e.qZA()(),e.TgZ(43,"div")(44,"mat-slider",17),e._UZ(45,"input",18),e.qZA(),e.TgZ(46,"div",12),e._UZ(47,"input",19,20),e.qZA()()()()(),e.TgZ(49,"div",21)(50,"h3"),e._uU(51,"Difficulty"),e.qZA(),e.TgZ(52,"section",22)(53,"mat-checkbox",23),e._uU(54," Easy "),e.qZA(),e.TgZ(55,"mat-checkbox",24),e._uU(56,"Medium"),e.qZA(),e.TgZ(57,"mat-checkbox",25),e._uU(58,"Hard"),e.qZA()(),e.YNc(59,it,3,2,"mat-checkbox",26),e.TgZ(60,"div")(61,"h3"),e._uU(62," Hint Button "),e._UZ(63,"i",27),e.qZA(),e.TgZ(64,"mat-radio-group",28)(65,"mat-radio-button",29),e._uU(66,"Disabled"),e.qZA(),e.TgZ(67,"mat-radio-button",29),e._uU(68,"Allowed"),e.qZA(),e.TgZ(69,"mat-radio-button",29),e._uU(70,"Always"),e.qZA()()()(),e.TgZ(71,"div",30)(72,"h3"),e._uU(73,"Game mode"),e.qZA(),e.TgZ(74,"mat-radio-group",31)(75,"mat-radio-button",29),e._uU(76,"Standard"),e.qZA(),e.TgZ(77,"mat-radio-button",32),e._uU(78,"Quick-draw"),e.qZA(),e.TgZ(79,"mat-radio-button",33),e._uU(80,"Battle royale"),e.qZA(),e.TgZ(81,"mat-radio-button",34),e._uU(82," Local Couch "),e.qZA()()()(),e.TgZ(83,"div",35)(84,"div",36)(85,"h3"),e._uU(86,"Modifiers"),e.qZA(),e.TgZ(87,"mat-checkbox",37),e._uU(88," Duplicate games "),e.qZA(),e.TgZ(89,"mat-checkbox",38),e._uU(90," Keep Playing Music On Answer Reveal "),e.qZA(),e.TgZ(91,"mat-checkbox",39),e._uU(92," Show correct answers during guess time "),e.qZA()()()(),e.TgZ(93,"div",40)(94,"div",41),e.YNc(95,ot,3,2,"button",42),e.qZA()()()()),2&i&&(e.xp6(),e.Q6J("formGroup",o.lobbyForm),e.xp6(23),e.Q6J("min",5)("max",100)("step",1),e.xp6(9),e.Q6J("min",5)("max",60)("step",1),e.xp6(11),e.Q6J("min",0)("step",1)("max",o.lobbyForm.get("musicNumber").value),e.xp6(3),e.Q6J("max",o.lobby?o.lobby.playedMusics:20),e.xp6(12),e.Q6J("ngIf",!o.hideContribution()),e.xp6(4),e.Q6J("html",!0),e.xp6(2),e.Q6J("value",o.lobbyHintModes.Disabled),e.xp6(2),e.Q6J("value",o.lobbyHintModes.Allowed),e.xp6(2),e.Q6J("value",o.lobbyHintModes.Always),e.xp6(6),e.Q6J("value",o.lobbyGameModes.Standard),e.xp6(6),e.Q6J("value",o.lobbyGameModes.LocalCouch)("html",!0),e.xp6(14),e.Q6J("ngIf",o.userCanEdit))},dependencies:[m.O5,we.oG,A.KE,A.hX,A.bx,q.Nt,c._Y,c.Fj,c.wV,c.JJ,c.JL,c.Q7,c.qQ,c.Fd,c.sg,c.u,z,P,ee,F,U],encapsulation:2})}return s})(),nt=(()=>{class s{constructor(){}ngOnInit(){}static \u0275fac=function(i){return new(i||s)};static \u0275cmp=e.Xpm({type:s,selectors:[["app-create"]],decls:2,vars:0,consts:[[1,"row"],[1,"col-md-9"]],template:function(i,o){1&i&&(e.TgZ(0,"div",0),e._UZ(1,"app-lobby-config",1),e.qZA())},dependencies:[te],encapsulation:2})}return s})();var rt=l(2132),at=l(4896),lt=l(2075),dt=l(7700),x=l(9678),ct=l(68);function ut(s,r){if(1&s){const t=e.EpF();e.ynx(0),e.TgZ(1,"button",3),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.play())}),e._uU(2,"Play"),e.qZA(),e.BQk()}}const mt=s=>({row:s}),ht=(s,r)=>({"col-md-6":s,"col-md-12":r});let ie=(()=>{class s{lobbyHttpService;lobbyStore;socket;router;lobby;role;lobbyUsersRoles=v;lobbyStatus=u.D;subscriptions=[];constructor(t,i,o,n){this.lobbyHttpService=t,this.lobbyStore=i,this.socket=o,this.router=n}ngOnInit(){this.subscriptions=[this.lobbyStore.lobby.subscribe(t=>{this.lobby=t}),this.lobbyStore.me.subscribe(t=>{null!==t&&(this.role=t.role)})]}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}play(){this.socket.emit("play",this.lobby.code)}leave(){this.socket.emit("leave",this.lobby.code),this.router.navigate(["/"])}showPlayButton(){return this.role===this.lobbyUsersRoles.Host&&this.lobby.status===u.D.Waiting}static \u0275fac=function(i){return new(i||s)(e.Y36(I.Y),e.Y36(g),e.Y36(x.i),e.Y36(_.F0))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-button-play"]],decls:4,vars:8,consts:[[3,"ngClass"],[4,"ngIf"],["type","button",1,"btn","btn-outline-primary",3,"ngClass","click"],["type","button",1,"btn","btn-primary","col-md-6",3,"click"]],template:function(i,o){1&i&&(e.TgZ(0,"div",0),e.YNc(1,ut,3,0,"ng-container",1),e.TgZ(2,"button",2),e.NdJ("click",function(){return o.leave()}),e._uU(3," Leave "),e.qZA()()),2&i&&(e.Q6J("ngClass",e.VKq(3,mt,o.showPlayButton())),e.xp6(),e.Q6J("ngIf",o.showPlayButton()),e.xp6(),e.Q6J("ngClass",e.WLB(5,ht,o.showPlayButton(),!o.showPlayButton())))},dependencies:[m.mk,m.O5],encapsulation:2})}return s})();const _t=["chat"],pt=["messageElement"];function bt(s,r){if(1&s&&(e.TgZ(0,"div",null,8)(2,"span",9),e._uU(3),e.qZA(),e._uU(4),e.qZA()),2&s){const t=r.$implicit;e.xp6(3),e.hij("",t.username,": "),e.xp6(),e.hij(" ",t.message," ")}}const ft=s=>({disabled:s});let se=(()=>{class s{lobbyStore;socket;subscriptions=[];messages=[];message=new c.NI(null,[c.kI.required.bind(this)]);chat;messageElements;constructor(t,i){this.lobbyStore=t,this.socket=i}ngOnInit(){this.subscriptions=[this.lobbyStore.messages.subscribe(t=>{this.messages=t})]}ngAfterViewInit(){this.scrollToBottom(),this.messageElements.changes.subscribe(this.scrollToBottom)}scrollToBottom=()=>{this.chat.nativeElement.scrollTop=this.chat.nativeElement.scrollHeight};ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}submit(){this.socket.emit("chat",this.message.value),this.message.setValue(null)}static \u0275fac=function(i){return new(i||s)(e.Y36(g),e.Y36(x.i))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-lobby-chat"]],viewQuery:function(i,o){if(1&i&&(e.Gf(_t,5),e.Gf(pt,5)),2&i){let n;e.iGM(n=e.CRH())&&(o.chat=n.first),e.iGM(n=e.CRH())&&(o.messageElements=n)}},decls:10,vars:5,consts:[[1,"bg-dark","p-4","chat-container","d-none","d-md-block"],[1,"chat"],["chat",""],[4,"ngFor","ngForOf"],[1,"input-group","align-self-center","w-100","mt-2",3,"ngSubmit"],["type","text","placeholder","Your message","aria-label","Your message","aria-describedby","button-addon2",1,"form-control",3,"formControl"],["type","submit","id","button-addon2",1,"btn","btn-outline-primary",3,"ngClass"],[1,"far","fa-paper-plane"],["messageElement",""],[1,"text-primary"]],template:function(i,o){1&i&&(e.TgZ(0,"div",0)(1,"div",1,2),e.YNc(3,bt,5,2,"div",3),e.qZA(),e.TgZ(4,"div")(5,"form",4),e.NdJ("ngSubmit",function(){return o.message.invalid||o.submit()}),e._UZ(6,"input",5),e.TgZ(7,"button",6),e._uU(8," Send "),e._UZ(9,"i",7),e.qZA()()()()),2&i&&(e.xp6(3),e.Q6J("ngForOf",o.messages),e.xp6(3),e.Q6J("formControl",o.message),e.xp6(),e.Q6J("ngClass",e.VKq(3,ft,o.message.invalid)))},dependencies:[m.mk,m.sg,c._Y,c.Fj,c.JJ,c.JL,c.F,c.oH],encapsulation:2})}return s})(),gt=(()=>{class s{static \u0275fac=function(i){return new(i||s)};static \u0275cmp=e.Xpm({type:s,selectors:[["app-lobby-waiting"]],decls:7,vars:0,consts:[[1,"row"],[1,"col-md-9","lobby-col"],[1,"d-md-none"],[1,"col-md-9"],[1,"col-md-3","lobby-col"],[1,"d-none","d-md-block","mb-md-2"]],template:function(i,o){1&i&&(e.TgZ(0,"div",0)(1,"div",1),e._UZ(2,"app-button-play",2)(3,"app-lobby-config",3),e.qZA(),e.TgZ(4,"div",4),e._UZ(5,"app-button-play",5)(6,"app-lobby-chat"),e.qZA()())},dependencies:[te,ie,se],encapsulation:2})}return s})();function vt(s,r){1&s&&e._UZ(0,"i",10)}function yt(s,r){1&s&&e._UZ(0,"i",11)}function Tt(s,r){1&s&&e._UZ(0,"span",12)}function xt(s,r){1&s&&e._UZ(0,"i",13)}function wt(s,r){1&s&&e._UZ(0,"i",14)}function kt(s,r){if(1&s){const t=e.EpF();e.TgZ(0,"div",15)(1,"div",16)(2,"div",17)(3,"i",18),e.NdJ("click",function(){e.CHM(t);const o=e.oxw().$implicit,n=e.oxw();return e.KtG(n.kick(o))}),e.qZA()()()()}}const St=(s,r)=>({"mx-2":s,"mx-3":r}),Ct=s=>({"text-muted":s});function It(s,r){if(1&s&&(e.ynx(0),e.TgZ(1,"div",2)(2,"div",3)(3,"div"),e.YNc(4,vt,1,0,"i",4)(5,yt,1,0,"i",5),e.TgZ(6,"span"),e._uU(7),e.qZA(),e.YNc(8,Tt,1,0,"span",6),e.qZA(),e.TgZ(9,"div"),e.YNc(10,xt,1,0,"i",7)(11,wt,1,0,"i",8),e.qZA(),e._UZ(12,"div"),e.qZA(),e.YNc(13,kt,4,0,"div",9),e.qZA(),e.BQk()),2&s){const t=r.$implicit,i=e.oxw();e.xp6(),e.Q6J("ngClass",e.WLB(10,St,i.me.role!==i.lobbyUserRoles.Host,i.me.role===i.lobbyUserRoles.Host)),e.xp6(),e.Q6J("@userStatus",i.getStatusClass(t))("ngClass",e.VKq(13,Ct,t.disconnected||t.role===i.lobbyUserRoles.Spectator)),e.xp6(2),e.Q6J("ngIf",t.role===i.lobbyUserRoles.Host),e.xp6(),e.Q6J("ngIf",t.role===i.lobbyUserRoles.Spectator&&!t.disconnected),e.xp6(2),e.Oqu(t.user.username),e.xp6(),e.Q6J("ngIf",t.status===i.lobbyUserStatus.Buffering),e.xp6(2),e.Q6J("ngIf",t.playedTheGame),e.xp6(),e.Q6J("ngIf",(null==i.lobby?null:i.lobby.hintMode)!==i.lobbyHintModes.Always&&t.hintMode),e.xp6(2),e.Q6J("ngIf",i.me.role===i.lobbyUserRoles.Host&&t.role===i.lobbyUserRoles.Player)}}let Mt=(()=>{class s{lobbyStore;socket;showRank=!1;users;me;lobby;lobbyHintModes=u.BF;lobbyUserRoles=v;lobbyUserStatus=C;subscriptions=[];constructor(t,i){this.lobbyStore=t,this.socket=i}ngOnInit(){this.subscriptions=[this.lobbyStore.users.subscribe(t=>{this.users=t}),this.lobbyStore.me.subscribe(t=>{this.me=t}),this.lobbyStore.lobby.subscribe(t=>{this.lobby=t})]}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}getStatusClass(t){return!1===t.correctAnswer?"wrongAnswer":!0===t.correctAnswer?"correctAnswer":"default"}kick(t){this.socket.emit("kick",t.user.username)}static \u0275fac=function(i){return new(i||s)(e.Y36(g),e.Y36(x.i))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-lobby-users"]],inputs:{showRank:"showRank"},decls:2,vars:1,consts:[[1,"row","justify-content-center","mt-2","users-container"],[4,"ngFor","ngForOf"],[1,"user-card","bg-dark","text-center","p-1","position-relative",3,"ngClass"],[1,"row","justify-content-between",3,"ngClass"],["class","fa fa-star",4,"ngIf"],["class","fa fa-ghost",4,"ngIf"],["class","text-white spinner-border spinner-border-sm","role","status","aria-hidden","true",4,"ngIf"],["class","text-info fa fa-gamepad mx-1",4,"ngIf"],["class","text-white far fa-eye mx-1",4,"ngIf"],["class","users-actions d-flex flex-column position-absolute","style","top: 0; right: -15px",4,"ngIf"],[1,"fa","fa-star"],[1,"fa","fa-ghost"],["role","status","aria-hidden","true",1,"text-white","spinner-border","spinner-border-sm"],[1,"text-info","fa","fa-gamepad","mx-1"],[1,"text-white","far","fa-eye","mx-1"],[1,"users-actions","d-flex","flex-column","position-absolute",2,"top","0","right","-15px"],[1,"bg-dark","pt-1"],[1,"col"],[1,"icon-action","text-danger","fa","fa-times",3,"click"]],template:function(i,o){1&i&&(e.TgZ(0,"div",0),e.YNc(1,It,14,15,"ng-container",1),e.qZA()),2&i&&(e.xp6(),e.Q6J("ngForOf",o.users))},dependencies:[m.mk,m.sg,m.O5],encapsulation:2,data:{animation:[(0,h.X$)("userStatus",[(0,h.SB)("wrongAnswer",(0,h.oB)({color:"white"})),(0,h.SB)("correctAnswer",(0,h.oB)({color:"green"})),(0,h.SB)("default",(0,h.oB)({color:"white"})),(0,h.eR)("* => wrongAnswer",[(0,h.jt)("1s",(0,h.F4)([(0,h.oB)({color:"red",offset:0}),(0,h.oB)({color:"white",offset:.75})]))])])]}})}return s})();var oe=l(6007),B=l(5861);const ne="audioPlayerVolume",re="mediaTypeOnReveal";let ae=(()=>{class s{getDefaultVolume(){return parseFloat(localStorage.getItem(ne)??"0.5")}setDefaultVolume(t){localStorage.setItem(ne,t.toString())}getDefaultMediaTypeOnReveal(){return parseInt(localStorage.getItem(re)??"2")}setDefaultMediaTypeOnReveal(t){localStorage.setItem(re,t.toString())}static \u0275fac=function(i){return new(i||s)};static \u0275prov=e.Yz7({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})();var le=l(2296),Q=l(617),V=l(7988);function At(s,r){1&s&&(e.TgZ(0,"mat-icon"),e._uU(1,"block"),e.qZA())}function Rt(s,r){1&s&&(e.TgZ(0,"mat-icon"),e._uU(1,"image"),e.qZA())}function Et(s,r){1&s&&(e.TgZ(0,"mat-icon"),e._uU(1,"movie"),e.qZA())}let Pt=(()=>{class s{lobbyStore;localStorageHelper;audio;lobby;subscriptions=[];gainNode;source;nextAudioBuffer;mediaTypeOnReveal;audioContext=new AudioContext;constructor(t,i){this.lobbyStore=t,this.localStorageHelper=i}ngOnInit(){var t=this;this.gainNode=this.audioContext.createGain(),this.gainNode.gain.setValueAtTime(this.getDefaultVolumeValue(),this.audioContext.currentTime),this.mediaTypeOnReveal=this.localStorageHelper.getDefaultMediaTypeOnReveal(),this.gainNode.connect(this.audioContext.destination),this.subscriptions=[this.lobbyStore.currentLobbyAudioBuffer.subscribe(function(){var i=(0,B.Z)(function*(o){null!==o?t.lobby.status===u.D.AnswerReveal&&t.lobby.playMusicOnAnswerReveal?t.nextAudioBuffer=o:(t.source?.stop(),t.setSourceNull(),yield t.setSource(o)):t.setSourceNull(),t.lobby?.status===u.D.PlayingMusic&&(t.gainNode.gain.setValueAtTime(t.getDefaultVolumeValue(),t.audioContext.currentTime),t.source?.start())});return function(o){return i.apply(this,arguments)}}()),this.lobbyStore.lobby.subscribe(function(){var i=(0,B.Z)(function*(o){t.lobby=o,o&&(o.status===u.D.AnswerReveal&&(o.playMusicOnAnswerReveal?setTimeout(()=>{t.gainNode.gain.setValueAtTime(t.gainNode.gain.value,t.audioContext.currentTime),t.gainNode.gain.exponentialRampToValueAtTime(.01,t.audioContext.currentTime+5)},5e3):t.setSourceNull()),o.status===u.D.PlayingMusic&&(t.nextAudioBuffer&&(t.source?.stop(),t.setSourceNull(),yield t.setSource(t.nextAudioBuffer),t.nextAudioBuffer=void 0),t.gainNode.gain.setValueAtTime(t.getDefaultVolumeValue(),t.audioContext.currentTime),t.source?.start()),!o.playMusicOnAnswerReveal&&o.status!==u.D.PlayingMusic&&t.setSourceNull(),o.status===u.D.Buffering&&t.setSourceNull())});return function(o){return i.apply(this,arguments)}}()),this.lobbyStore.resumeMusic.subscribe((0,B.Z)(function*(){yield t.audioContext.resume(),t.lobbyStore.setCanPlayMusic("running"===t.audioContext.state)}))]}ngOnDestroy(){this.setSourceNull(),this.audioContext.suspend(),this.subscriptions.forEach(t=>t.unsubscribe())}setSource(t){var i=this;return(0,B.Z)(function*(){i.gainNode.gain.setValueAtTime(i.getDefaultVolumeValue(),i.audioContext.currentTime);const o=yield i.audioContext.decodeAudioData(t);i.source=i.audioContext.createBufferSource(),i.source.buffer=o,i.source.connect(i.gainNode),i.lobbyStore.setCanPlayMusic("running"===i.audioContext.state)})()}setSourceNull(){this.source&&(this.source.buffer=null)}getDefaultVolumeValue(){return this.localStorageHelper.getDefaultVolume()}updateVolume(t){const i=t.valueAsNumber;this.gainNode.gain.setValueAtTime(i,this.audioContext.currentTime),this.localStorageHelper.setDefaultVolume(i)}getDefaultMediaTypeOnReveal(){return this.localStorageHelper.getDefaultMediaTypeOnReveal()}updateMediaTypeOnReveal(t){this.mediaTypeOnReveal=t,this.localStorageHelper.setDefaultMediaTypeOnReveal(t)}static \u0275fac=function(i){return new(i||s)(e.Y36(g),e.Y36(ae))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-lobby-audio-player"]],decls:13,vars:12,consts:[["aria-label","unit(s)","color","primary",3,"min","max","step","input"],["matSliderThumb","",3,"value"],["mat-icon-button","",1,"mat-icon-button",3,"matMenuTriggerFor"],["color","primary"],["xPosition","before"],["menu","matMenu"],["mat-menu-item","","mdbTooltip","Answer reveal media type"],[4,"ngIf"],["color","primary",3,"min","max","step","click"],["matSliderThumb","",3,"value","valueChange"]],template:function(i,o){if(1&i&&(e.TgZ(0,"mat-slider",0),e.NdJ("input",function(a){return o.updateVolume(a.target)}),e._UZ(1,"input",1),e.qZA(),e.TgZ(2,"button",2)(3,"mat-icon",3),e._uU(4,"more_vert"),e.qZA()(),e.TgZ(5,"mat-menu",4,5)(7,"button",6),e.YNc(8,At,2,0,"mat-icon",7)(9,Rt,2,0,"mat-icon",7)(10,Et,2,0,"mat-icon",7),e.TgZ(11,"mat-slider",8),e.NdJ("click",function(a){return a.stopPropagation()}),e.TgZ(12,"input",9),e.NdJ("valueChange",function(a){return o.updateMediaTypeOnReveal(a)}),e.qZA()()()()),2&i){const n=e.MAs(6);e.Q6J("min",0)("max",1)("step",.001),e.xp6(),e.Q6J("value",o.getDefaultVolumeValue()),e.xp6(),e.Q6J("matMenuTriggerFor",n),e.xp6(6),e.Q6J("ngIf",!o.mediaTypeOnReveal),e.xp6(),e.Q6J("ngIf",1===o.mediaTypeOnReveal),e.xp6(),e.Q6J("ngIf",2===o.mediaTypeOnReveal),e.xp6(),e.Q6J("min",0)("max",2)("step",1),e.xp6(),e.Q6J("value",o.getDefaultMediaTypeOnReveal())}},dependencies:[m.O5,le.RK,z,P,Q.Hw,U,V.VK,V.OP,V.p6],encapsulation:2})}return s})();var de=l(2096),Dt=l(3997),ce=l(4664),ue=l(5438),me=l(4630);const Zt=["answerInput"],Ut=["trigger"];function Bt(s,r){if(1&s&&e._UZ(0,"mat-option",7),2&s){const t=r.$implicit;e.Q6J("value",t.name)("innerHtml",""+t.highlight+"",e.oJD)}}let Vt=(()=>{class s{lobbyHttpService;lobbyStore;gameHttpService;socket;cdf;myControl=new c.NI;gameNames;lobby;me=null;lobbyStatuses=u.D;subscriptions=[];answerInput;matAutocompleteTrigger;constructor(t,i,o,n,a){this.lobbyHttpService=t,this.lobbyStore=i,this.gameHttpService=o,this.socket=n,this.cdf=a}ngOnInit(){this.gameNames=this.myControl.valueChanges.pipe((0,Dt.x)(),(0,ce.w)(t=>t?this.gameHttpService.getNames(t):(0,de.of)(null)))}ngAfterViewInit(){this.subscriptions=[this.lobbyStore.lobby.subscribe(t=>{null!==t&&(this.me?.role===v.Spectator?this.myControl.disable():[u.D.AnswerReveal,u.D.Buffering].includes(t.status)?(this.myControl.disable(),this.matAutocompleteTrigger.closePanel(),this.cdf.detectChanges()):(this.myControl.enable(),this.myControl.setValue(""),this.answerInput.nativeElement.focus(),this.cdf.detectChanges())),this.lobby=t}),this.lobbyStore.me.subscribe(t=>{null!==t&&!0===t.correctAnswer&&this.myControl.disable()})]}submit(){this.socket.emit("answer",this.myControl.value),this.myControl.setValue(null)}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}static \u0275fac=function(i){return new(i||s)(e.Y36(I.Y),e.Y36(g),e.Y36(ue.q),e.Y36(x.i),e.Y36(e.sBO))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-lobby-answer"]],viewQuery:function(i,o){if(1&i&&(e.Gf(Zt,5),e.Gf(Ut,5)),2&i){let n;e.iGM(n=e.CRH())&&(o.answerInput=n.first),e.iGM(n=e.CRH())&&(o.matAutocompleteTrigger=n.first)}},decls:10,vars:9,consts:[[3,"ngSubmit"],["id","lobby-autocomplete",2,"width","100%"],["type","text","placeholder","Type your answer here...","aria-label","Number","matInput","","autocomplete","off","autocapitalize","off","spellcheck","false",3,"formControl","matAutocomplete"],["answerInput","","trigger","matAutocompleteTrigger"],[3,"optionSelected"],["auto","matAutocomplete"],[3,"value","innerHtml",4,"ngFor","ngForOf"],[3,"value","innerHtml"]],template:function(i,o){if(1&i&&(e.TgZ(0,"form",0),e.NdJ("ngSubmit",function(){return o.lobby.status===o.lobbyStatuses.AnswerReveal||!o.myControl.value||o.submit()}),e.TgZ(1,"mat-form-field",1),e._UZ(2,"input",2,3),e.TgZ(5,"mat-autocomplete",4,5),e.NdJ("optionSelected",function(){return o.lobby.status===o.lobbyStatuses.AnswerReveal||o.submit()}),e.YNc(7,Bt,1,2,"mat-option",6),e.ALo(8,"slice"),e.ALo(9,"async"),e.qZA()()()),2&i){const n=e.MAs(6);e.xp6(2),e.Q6J("formControl",o.myControl)("matAutocomplete",n),e.xp6(5),e.Q6J("ngForOf",e.Dn7(8,3,e.lcZ(9,7,o.gameNames),0,30))}},dependencies:[m.sg,A.KE,me.XC,y.ey,me.ZL,q.Nt,c._Y,c.Fj,c.JJ,c.JL,c.F,c.oH,m.Ov,m.OU],encapsulation:2})}return s})();function Lt(s,r){if(1&s&&(e.TgZ(0,"div",1),e._uU(1),e.qZA()),2&s){const t=e.oxw();e.xp6(),e.hij(" ",t.countdown,"\n")}}let Ot=(()=>{class s{lobbyStore;countdown;countdownInterval;subscriptions;constructor(t){this.lobbyStore=t}ngOnInit(){this.subscriptions=[this.lobbyStore.lobby.subscribe(t=>{this.countdownInterval&&clearInterval(this.countdownInterval),t?.status===u.D.PlayingMusic?(this.countdown=t.guessTime-1,this.startCountdown()):t?.status===u.D.AnswerReveal&&(this.countdown=void 0)}),this.lobbyStore.currentLobbyMusic.subscribe(t=>{t?.musicFinishesIn&&(this.countdownInterval&&clearInterval(this.countdownInterval),this.countdown=t.musicFinishesIn-1,this.startCountdown())})]}ngOnDestroy(){clearInterval(this.countdownInterval),this.subscriptions.forEach(t=>t.unsubscribe())}startCountdown(){this.countdownInterval=setInterval(()=>{this.countdown>0?this.countdown--:(this.countdown=void 0,clearInterval(this.countdownInterval))},1e3)}static \u0275fac=function(i){return new(i||s)(e.Y36(g))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-lobby-countdown"]],decls:1,vars:1,consts:[["class","align-self-center countdown",4,"ngIf"],[1,"align-self-center","countdown"]],template:function(i,o){1&i&&e.YNc(0,Lt,2,1,"div",0),2&i&&e.Q6J("ngIf",void 0!==o.countdown)},dependencies:[m.O5],encapsulation:2})}return s})();const he=s=>({timing:s}),_e=(s,r)=>({value:s,params:r});function Nt(s,r){if(1&s&&e._UZ(0,"div",2),2&s){const t=e.oxw();e.Q6J("@countdownProgress",e.WLB(3,_e,t.lobby.status===t.lobbyStatuses.PlayingMusic?"empty":"full",e.VKq(1,he,t.lobby.guessTime)))}}function Ft(s,r){if(1&s&&e._UZ(0,"div",2),2&s){const t=e.oxw();e.Udp("width",t.timeRemaining/t.lobby.guessTime*100+"%"),e.Q6J("@countdownProgress",e.WLB(5,_e,t.lobby.status===t.lobbyStatuses.PlayingMusic?"empty":"full",e.VKq(3,he,t.timeRemaining)))}}let Ht=(()=>{class s{lobbyStore;subscriptions;lobby;lobbyStatuses=u.D;timeRemaining;constructor(t){this.lobbyStore=t}ngOnInit(){this.subscriptions=[this.lobbyStore.lobby.subscribe(t=>{this.lobby=t,this.timeRemaining=void 0}),this.lobbyStore.currentLobbyMusic.subscribe(t=>{this.timeRemaining=t?.musicFinishesIn?t.musicFinishesIn:void 0})]}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}static \u0275fac=function(i){return new(i||s)(e.Y36(g))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-lobby-countdown-progress"]],decls:2,vars:2,consts:[["style","height: 1px",4,"ngIf"],["style","height: 1px",3,"width",4,"ngIf"],[2,"height","1px"]],template:function(i,o){1&i&&e.YNc(0,Nt,1,6,"div",0)(1,Ft,1,8,"div",1),2&i&&(e.Q6J("ngIf",!o.timeRemaining),e.xp6(),e.Q6J("ngIf",o.timeRemaining))},dependencies:[m.O5],encapsulation:2,data:{animation:[(0,h.X$)("countdownProgress",[(0,h.SB)("full",(0,h.oB)({width:"100%"})),(0,h.SB)("empty",(0,h.oB)({width:"0"})),(0,h.SB)("default",(0,h.oB)({width:"25%"})),(0,h.eR)("* => empty",[(0,h.jt)("{{timing}}s")],{params:{timing:"20"}}),(0,h.eR)("* => full",[(0,h.jt)("10s")])])]}})}return s})();var Qt=l(2599);function Yt(s,r){if(1&s){const t=e.EpF();e.TgZ(0,"button",3),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.enableHintMode())}),e._uU(1,"Hint"),e.qZA()}}function Jt(s,r){if(1&s){const t=e.EpF();e.TgZ(0,"mat-slide-toggle",4),e.NdJ("change",function(o){e.CHM(t);const n=e.oxw(2);return e.KtG(n.toggleKeepHintMode(o))}),e._uU(1,"Keep hint mode "),e.qZA()}if(2&s){const t=e.oxw(2);e.Q6J("checked",null==t.me?null:t.me.keepHintMode)}}function qt(s,r){if(1&s&&(e.ynx(0),e.YNc(1,Yt,2,0,"button",1)(2,Jt,2,1,"mat-slide-toggle",2),e.BQk()),2&s){const t=e.oxw();e.xp6(),e.Q6J("ngIf",!(null!=t.me&&t.me.hintMode)),e.xp6(),e.Q6J("ngIf",null==t.me?null:t.me.hintMode)}}let Gt=(()=>{class s{lobbyStore;lobbySocket;subscriptions=[];me;lobby;lobbyHintMode=u.BF;constructor(t,i){this.lobbyStore=t,this.lobbySocket=i}ngOnInit(){this.subscriptions=[this.lobbyStore.me.subscribe(t=>{t&&(this.me=t)}),this.lobbyStore.lobby.subscribe(t=>{t&&(this.lobby=t)})]}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}enableHintMode(){this.lobbySocket.emit("enableHintMode")}toggleKeepHintMode(t){this.lobbySocket.emit("toggleKeepHintMode",t.checked)}static \u0275fac=function(i){return new(i||s)(e.Y36(g),e.Y36(x.i))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-hint-mode-toggle"]],decls:1,vars:1,consts:[[4,"ngIf"],["class","btn btn-primary btn-sm",3,"click",4,"ngIf"],["color","primary",3,"checked","change",4,"ngIf"],[1,"btn","btn-primary","btn-sm",3,"click"],["color","primary",3,"checked","change"]],template:function(i,o){1&i&&e.YNc(0,qt,3,2,"ng-container",0),2&i&&e.Q6J("ngIf",o.lobby.hintMode===o.lobbyHintMode.Allowed)},dependencies:[m.O5,Qt.Rr],encapsulation:2})}return s})();const Xt=["xd"];function jt(s,r){if(1&s&&(e.ynx(0),e._UZ(1,"input",2),e.TgZ(2,"label",3)(3,"span",4,5),e._uU(5),e.qZA()(),e.BQk()),2&s){const t=r.$implicit,i=r.index,o=e.oxw();e.xp6(),e.Q6J("id",i)("formControl",o.formControl)("value",t),e.xp6(),e.Q6J("for",i),e.xp6(3),e.Oqu(t)}}let zt=(()=>{class s{lobbyStore;lobbySocket;subscriptions=[];games=[];formControl=new c.NI("");spans;constructor(t,i){this.lobbyStore=t,this.lobbySocket=i}ngOnInit(){this.subscriptions=[this.lobbyStore.hintModeGames.subscribe(t=>{this.games=t}),this.formControl.valueChanges.subscribe(t=>{this.lobbySocket.emit("answer",t)}),this.lobbyStore.me.subscribe(t=>{t&&(t.role===v.Spectator||t.correctAnswer)&&this.formControl.disable()})]}ngAfterViewInit(){setTimeout(()=>{this.spans.forEach(t=>{let o=2;t.nativeElement.offsetHeight>55&&(o=110/t.nativeElement.offsetHeight),t.nativeElement.style.fontSize=`${o}vh`})},1)}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}static \u0275fac=function(i){return new(i||s)(e.Y36(g),e.Y36(x.i))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-hint-mode"]],viewQuery:function(i,o){if(1&i&&e.Gf(Xt,5),2&i){let n;e.iGM(n=e.CRH())&&(o.spans=n)}},decls:2,vars:1,consts:[[1,"d-flex","flex-wrap","justify-content-between",2,"height","260px"],[4,"ngFor","ngForOf"],["type","radio","name","btnradio","autocomplete","off",1,"btn-check",3,"id","formControl","value"],[1,"btn","btn-outline-primary","col-12","col-md-5","d-flex","justify-content-center",2,"height","60px",3,"for"],[1,"align-self-center","hint-mode-answer"],["xd",""]],template:function(i,o){1&i&&(e.TgZ(0,"div",0),e.YNc(1,jt,6,5,"ng-container",1),e.qZA()),2&i&&(e.xp6(),e.Q6J("ngForOf",o.games))},dependencies:[m.sg,c.Fj,c._,c.JJ,c.oH],encapsulation:2})}return s})();var pe=l(5592),Wt=l(4674),$t=l(7400);function be(s,r,t){return t?be(s,r).pipe((0,$t.Z)(t)):new pe.y(i=>{const o=(...a)=>i.next(1===a.length?a[0]:a),n=s(o);return(0,Wt.m)(r)?()=>r(o,n):void 0})}const Kt=["youtubeContainer"];function ei(s,r){if(1&s){const t=e.EpF();e.TgZ(0,"youtube-player-placeholder",2),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o._load(!0))}),e.qZA()}if(2&s){const t=e.oxw();e.Q6J("videoId",t.videoId)("width",t.width)("height",t.height)("isLoading",t._isLoading)("buttonLabel",t.placeholderButtonLabel)("quality",t.placeholderImageQuality)}}let ti=(()=>{class s{_getBackgroundImage(){let t;return t="low"===this.quality?`https://i.ytimg.com/vi/${this.videoId}/hqdefault.jpg`:"high"===this.quality?`https://i.ytimg.com/vi/${this.videoId}/maxresdefault.jpg`:`https://i.ytimg.com/vi_webp/${this.videoId}/sddefault.webp`,`url(${t})`}static#e=this.\u0275fac=function(i){return new(i||s)};static#t=this.\u0275cmp=e.Xpm({type:s,selectors:[["youtube-player-placeholder"]],hostAttrs:[1,"youtube-player-placeholder"],hostVars:8,hostBindings:function(i,o){2&i&&(e.Udp("background-image",o._getBackgroundImage())("width",o.width,"px")("height",o.height,"px"),e.ekj("youtube-player-placeholder-loading",o.isLoading))},inputs:{videoId:"videoId",width:"width",height:"height",isLoading:"isLoading",buttonLabel:"buttonLabel",quality:"quality"},standalone:!0,features:[e.jDz],decls:4,vars:1,consts:[["type","button",1,"youtube-player-placeholder-button"],["height","100%","version","1.1","viewBox","0 0 68 48","focusable","false","aria-hidden","true"],["d","M66.52,7.74c-0.78-2.93-2.49-5.41-5.42-6.19C55.79,.13,34,0,34,0S12.21,.13,6.9,1.55 C3.97,2.33,2.27,4.81,1.48,7.74C0.06,13.05,0,24,0,24s0.06,10.95,1.48,16.26c0.78,2.93,2.49,5.41,5.42,6.19 C12.21,47.87,34,48,34,48s21.79-0.13,27.1-1.55c2.93-0.78,4.64-3.26,5.42-6.19C67.94,34.95,68,24,68,24S67.94,13.05,66.52,7.74z","fill","#f00"],["d","M 45,24 27,14 27,34","fill","#fff"]],template:function(i,o){1&i&&(e.TgZ(0,"button",0),e.O4$(),e.TgZ(1,"svg",1),e._UZ(2,"path",2)(3,"path",3),e.qZA()()),2&i&&e.uIk("aria-label",o.buttonLabel)},styles:[".youtube-player-placeholder{display:flex;align-items:center;justify-content:center;width:100%;overflow:hidden;cursor:pointer;background-color:#000;background-position:center center;background-size:cover;transition:box-shadow 300ms ease;box-shadow:inset 0 120px 90px -90px rgba(0,0,0,.8)}.youtube-player-placeholder-button{transition:opacity 300ms ease;-moz-appearance:none;-webkit-appearance:none;background:none;border:none;padding:0;display:flex}.youtube-player-placeholder-button svg{width:68px;height:48px}.youtube-player-placeholder-loading{box-shadow:none}.youtube-player-placeholder-loading .youtube-player-placeholder-button{opacity:0}"],encapsulation:2,changeDetection:0})}return s})();const ii=new e.OlP("YOUTUBE_PLAYER_CONFIG");function ve(s){return null==s?s:(0,e.Cb_)(s,0)}let si=(()=>{class s{get height(){return this._height}set height(t){this._height=null==t||isNaN(t)?390:t}get width(){return this._width}set width(t){this._width=null==t||isNaN(t)?640:t}constructor(t,i){this._ngZone=t,this._destroyed=new R.x,this._playerChanges=new p.X(void 0),this._nonce=(0,e.f3M)(e.Ojb,{optional:!0}),this._changeDetectorRef=(0,e.f3M)(e.sBO),this._isLoading=!1,this._hasPlaceholder=!0,this._height=390,this._width=640,this.disableCookies=!1,this.disablePlaceholder=!1,this.showBeforeIframeApiLoads=!1,this.ready=this._getLazyEmitter("onReady"),this.stateChange=this._getLazyEmitter("onStateChange"),this.error=this._getLazyEmitter("onError"),this.apiChange=this._getLazyEmitter("onApiChange"),this.playbackQualityChange=this._getLazyEmitter("onPlaybackQualityChange"),this.playbackRateChange=this._getLazyEmitter("onPlaybackRateChange");const o=(0,e.f3M)(ii,{optional:!0});this.loadApi=o?.loadApi??!0,this.disablePlaceholder=!!o?.disablePlaceholder,this.placeholderButtonLabel=o?.placeholderButtonLabel||"Play video",this.placeholderImageQuality=o?.placeholderImageQuality||"standard",this._isBrowser=(0,m.NF)(i)}ngAfterViewInit(){this._conditionallyLoad()}ngOnChanges(t){this._shouldRecreatePlayer(t)?this._conditionallyLoad():this._player&&((t.width||t.height)&&this._setSize(),t.suggestedQuality&&this._setQuality(),(t.startSeconds||t.endSeconds||t.suggestedQuality)&&this._cuePlayer())}ngOnDestroy(){this._pendingPlayer?.destroy(),this._player&&(this._player.destroy(),window.onYouTubeIframeAPIReady=this._existingApiReadyCallback),this._playerChanges.complete(),this._destroyed.next(),this._destroyed.complete()}playVideo(){this._player?this._player.playVideo():this._getPendingState().playbackState=YT.PlayerState.PLAYING}pauseVideo(){this._player?this._player.pauseVideo():this._getPendingState().playbackState=YT.PlayerState.PAUSED}stopVideo(){this._player?this._player.stopVideo():this._getPendingState().playbackState=YT.PlayerState.CUED}seekTo(t,i){this._player?this._player.seekTo(t,i):this._getPendingState().seek={seconds:t,allowSeekAhead:i}}mute(){this._player?this._player.mute():this._getPendingState().muted=!0}unMute(){this._player?this._player.unMute():this._getPendingState().muted=!1}isMuted(){return this._player?this._player.isMuted():!!this._pendingPlayerState&&!!this._pendingPlayerState.muted}setVolume(t){this._player?this._player.setVolume(t):this._getPendingState().volume=t}getVolume(){return this._player?this._player.getVolume():this._pendingPlayerState&&null!=this._pendingPlayerState.volume?this._pendingPlayerState.volume:0}setPlaybackRate(t){if(this._player)return this._player.setPlaybackRate(t);this._getPendingState().playbackRate=t}getPlaybackRate(){return this._player?this._player.getPlaybackRate():this._pendingPlayerState&&null!=this._pendingPlayerState.playbackRate?this._pendingPlayerState.playbackRate:0}getAvailablePlaybackRates(){return this._player?this._player.getAvailablePlaybackRates():[]}getVideoLoadedFraction(){return this._player?this._player.getVideoLoadedFraction():0}getPlayerState(){if(this._isBrowser&&window.YT)return this._player?this._player.getPlayerState():this._pendingPlayerState&&null!=this._pendingPlayerState.playbackState?this._pendingPlayerState.playbackState:YT.PlayerState.UNSTARTED}getCurrentTime(){return this._player?this._player.getCurrentTime():this._pendingPlayerState&&this._pendingPlayerState.seek?this._pendingPlayerState.seek.seconds:0}getPlaybackQuality(){return this._player?this._player.getPlaybackQuality():"default"}getAvailableQualityLevels(){return this._player?this._player.getAvailableQualityLevels():[]}getDuration(){return this._player?this._player.getDuration():0}getVideoUrl(){return this._player?this._player.getVideoUrl():""}getVideoEmbedCode(){return this._player?this._player.getVideoEmbedCode():""}_load(t){this._isBrowser&&(window.YT&&window.YT.Player?this._createPlayer(t):(this.loadApi&&(this._isLoading=!0,function oi(s){if(Y)return;const t=document.createElement("script"),i=o=>{t.removeEventListener("load",i),t.removeEventListener("error",i),"error"===o.type&&(Y=!1)};t.addEventListener("load",i),t.addEventListener("error",i),t.src="https://www.youtube.com/iframe_api",t.async=!0,s&&(t.nonce=s),Y=!0,document.body.appendChild(t)}(this._nonce)),this._existingApiReadyCallback=window.onYouTubeIframeAPIReady,window.onYouTubeIframeAPIReady=()=>{this._existingApiReadyCallback?.(),this._ngZone.run(()=>this._createPlayer(t))}))}_conditionallyLoad(){this._shouldShowPlaceholder()?1===this.playerVars?.autoplay&&this._load(!0):this._load(!1)}_shouldShowPlaceholder(){return!this.disablePlaceholder&&(!this._isBrowser||this._hasPlaceholder&&!!this.videoId&&!this._player)}_getPendingState(){return this._pendingPlayerState||(this._pendingPlayerState={}),this._pendingPlayerState}_shouldRecreatePlayer(t){const i=t.videoId||t.playerVars||t.disableCookies||t.disablePlaceholder;return!!i&&!i.isFirstChange()}_createPlayer(t){if(this._player?.destroy(),this._pendingPlayer?.destroy(),typeof YT>"u"||!this.videoId&&!this.playerVars?.list)return;const i=this._ngZone.runOutsideAngular(()=>new YT.Player(this.youtubeContainer.nativeElement,{videoId:this.videoId,host:this.disableCookies?"https://www.youtube-nocookie.com":void 0,width:this.width,height:this.height,playerVars:t?{...this.playerVars||{},autoplay:1}:this.playerVars})),o=()=>{this._ngZone.run(()=>{this._isLoading=!1,this._hasPlaceholder=!1,this._player=i,this._pendingPlayer=void 0,i.removeEventListener("onReady",o),this._playerChanges.next(i),this._setSize(),this._setQuality(),this._pendingPlayerState&&(this._applyPendingPlayerState(i,this._pendingPlayerState),this._pendingPlayerState=void 0);const n=i.getPlayerState();(n===YT.PlayerState.UNSTARTED||n===YT.PlayerState.CUED||null==n)&&this._cuePlayer(),this._changeDetectorRef.markForCheck()})};this._pendingPlayer=i,i.addEventListener("onReady",o)}_applyPendingPlayerState(t,i){const{playbackState:o,playbackRate:n,volume:a,muted:b,seek:f}=i;switch(o){case YT.PlayerState.PLAYING:t.playVideo();break;case YT.PlayerState.PAUSED:t.pauseVideo();break;case YT.PlayerState.CUED:t.stopVideo()}null!=n&&t.setPlaybackRate(n),null!=a&&t.setVolume(a),null!=b&&(b?t.mute():t.unMute()),null!=f&&t.seekTo(f.seconds,f.allowSeekAhead)}_cuePlayer(){this._player&&this.videoId&&this._player.cueVideoById({videoId:this.videoId,startSeconds:this.startSeconds,endSeconds:this.endSeconds,suggestedQuality:this.suggestedQuality})}_setSize(){this._player?.setSize(this.width,this.height)}_setQuality(){this._player&&this.suggestedQuality&&this._player.setPlaybackQuality(this.suggestedQuality)}_getLazyEmitter(t){return this._playerChanges.pipe((0,ce.w)(i=>i?be(o=>{i.addEventListener(t,o)},o=>{try{i?.removeEventListener?.(t,o)}catch{}}):(0,de.of)()),i=>new pe.y(o=>i.subscribe({next:n=>this._ngZone.run(()=>o.next(n)),error:n=>o.error(n),complete:()=>o.complete()})),(0,Z.R)(this._destroyed))}static#e=this.\u0275fac=function(i){return new(i||s)(e.Y36(e.R0b),e.Y36(e.Lbi))};static#t=this.\u0275cmp=e.Xpm({type:s,selectors:[["youtube-player"]],viewQuery:function(i,o){if(1&i&&e.Gf(Kt,7),2&i){let n;e.iGM(n=e.CRH())&&(o.youtubeContainer=n.first)}},inputs:{videoId:"videoId",height:[e.lbL.HasDecoratorInputTransform,"height","height",e.Cb_],width:[e.lbL.HasDecoratorInputTransform,"width","width",e.Cb_],startSeconds:[e.lbL.HasDecoratorInputTransform,"startSeconds","startSeconds",ve],endSeconds:[e.lbL.HasDecoratorInputTransform,"endSeconds","endSeconds",ve],suggestedQuality:"suggestedQuality",playerVars:"playerVars",disableCookies:[e.lbL.HasDecoratorInputTransform,"disableCookies","disableCookies",e.VuI],loadApi:[e.lbL.HasDecoratorInputTransform,"loadApi","loadApi",e.VuI],disablePlaceholder:[e.lbL.HasDecoratorInputTransform,"disablePlaceholder","disablePlaceholder",e.VuI],showBeforeIframeApiLoads:[e.lbL.HasDecoratorInputTransform,"showBeforeIframeApiLoads","showBeforeIframeApiLoads",e.VuI],placeholderButtonLabel:"placeholderButtonLabel",placeholderImageQuality:"placeholderImageQuality"},outputs:{ready:"ready",stateChange:"stateChange",error:"error",apiChange:"apiChange",playbackQualityChange:"playbackQualityChange",playbackRateChange:"playbackRateChange"},standalone:!0,features:[e.Xq5,e.TTD,e.jDz],decls:4,vars:3,consts:[[3,"videoId","width","height","isLoading","buttonLabel","quality"],["youtubeContainer",""],[3,"videoId","width","height","isLoading","buttonLabel","quality","click"]],template:function(i,o){1&i&&(e.YNc(0,ei,1,6,"youtube-player-placeholder",0),e.TgZ(1,"div"),e._UZ(2,"div",null,1),e.qZA()),2&i&&(e.um2(0,o._shouldShowPlaceholder()?0:-1),e.xp6(),e.Udp("display",o._shouldShowPlaceholder()?"none":""))},dependencies:[ti],encapsulation:2,changeDetection:0})}return s})(),Y=!1,ni=(()=>{class s{static#e=this.\u0275fac=function(i){return new(i||s)};static#t=this.\u0275mod=e.oAB({type:s});static#i=this.\u0275inj=e.cJS({})}return s})();const ri=["youtubePlayer"];function ai(s,r){if(1&s&&e._UZ(0,"youtube-player",2,3),2&s){const t=e.oxw();e.Q6J("videoId",t.lobbyMusic.video.videoId)("playerVars",t.playerVars)("disablePlaceholder",!0)}}const li=s=>({opacity:s});function di(s,r){if(1&s&&e._UZ(0,"img",6),2&s){const t=r.$implicit,i=r.index,o=e.oxw(2);e.Q6J("ngStyle",e.VKq(2,li,o.currentScreenshotIndex===i?1:0))("src","https://images.igdb.com/igdb/image/upload/t_1080p/"+t.imageId+".jpg",e.LSH)}}function ci(s,r){if(1&s&&(e.TgZ(0,"div",4),e.YNc(1,di,1,4,"img",5),e.qZA()),2&s){const t=e.oxw();e.xp6(),e.Q6J("ngForOf",t.lobbyMusic.screenshots)}}let ui=(()=>{class s{lobbyStore;localStorageHelper;subscriptions=[];playerVars={autoplay:1,controls:0,showinfo:0,rel:0,modestbranding:1};mediaTypeOnReveal;lobbyMusic=null;currentScreenshotIndex=0;youtubePlayer;constructor(t,i){this.lobbyStore=t,this.localStorageHelper=i,this.mediaTypeOnReveal=i.getDefaultMediaTypeOnReveal(),setTimeout(()=>{this.currentScreenshotIndex=1},5e3)}ngOnInit(){this.subscriptions=[this.lobbyStore.currentLobbyMusicAnswer.subscribe(t=>{this.lobbyMusic=t})]}ngAfterViewInit(){this.subscriptions.push(this.youtubePlayer.changes.subscribe({next:t=>{t.first?.seekTo(this.lobbyMusic.startVideoAt,!0),t.first?.mute()}}))}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}static \u0275fac=function(i){return new(i||s)(e.Y36(g),e.Y36(ae))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-answer-reveal-media"]],viewQuery:function(i,o){if(1&i&&e.Gf(ri,5),2&i){let n;e.iGM(n=e.CRH())&&(o.youtubePlayer=n)}},decls:2,vars:2,consts:[["class","game-reveal-video-media","suggestedQuality","default",3,"videoId","playerVars","disablePlaceholder",4,"ngIf"],["class","d-flex",4,"ngIf"],["suggestedQuality","default",1,"game-reveal-video-media",3,"videoId","playerVars","disablePlaceholder"],["youtubePlayer",""],[1,"d-flex"],["class","game-reveal-picture-media","alt","screenshot",3,"ngStyle","src",4,"ngFor","ngForOf"],["alt","screenshot",1,"game-reveal-picture-media",3,"ngStyle","src"]],template:function(i,o){1&i&&e.YNc(0,ai,2,3,"youtube-player",0)(1,ci,2,1,"div",1),2&i&&(e.Q6J("ngIf",2===o.mediaTypeOnReveal&&(null==o.lobbyMusic?null:o.lobbyMusic.video)),e.xp6(),e.Q6J("ngIf",(1===o.mediaTypeOnReveal||2===o.mediaTypeOnReveal&&!(null!=o.lobbyMusic&&o.lobbyMusic.video))&&o.lobbyMusic&&o.lobbyMusic.screenshots.length>0))},dependencies:[m.sg,m.O5,m.PC,si],encapsulation:2})}return s})();function mi(s,r){1&s&&e._UZ(0,"div")}function hi(s,r){if(1&s&&(e.TgZ(0,"div",9),e._uU(1),e._UZ(2,"mat-progress-bar",10),e.qZA()),2&s){const t=e.oxw();e.xp6(),e.hij(" ",t.loadProgress,"% "),e.xp6(),e.Q6J("value",t.loadProgress)}}function _i(s,r){1&s&&e._UZ(0,"app-hint-mode-toggle")}function pi(s,r){if(1&s){const t=e.EpF();e.TgZ(0,"div",11)(1,"p"),e._uU(2,"Press the button to start playing"),e._UZ(3,"br"),e._uU(4,"(Music will play on the next loop)"),e.qZA(),e.TgZ(5,"button",12),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.play())}),e._uU(6,"Play"),e.qZA()()}}const bi=s=>({"text-warning":s});function fi(s,r){if(1&s&&(e.TgZ(0,"div",13),e._UZ(1,"span",14),e.qZA()),2&s){const t=e.oxw();e.Q6J("title",t.serverBuffering?"server loading...":"client loading..."),e.xp6(),e.Q6J("ngClass",e.VKq(2,bi,t.serverBuffering))}}function gi(s,r){if(1&s&&(e.TgZ(0,"div",15)(1,"small",16),e._uU(2),e.qZA()()),2&s){const t=e.oxw();e.xp6(2),e.Oqu(t.error)}}const ye=s=>({"d-none":s});function vi(s,r){if(1&s&&(e.TgZ(0,"div",17),e._uU(1," Buffering... "),e.qZA()),2&s){const t=e.oxw();e.Q6J("ngClass",e.VKq(1,ye,!t.canPlayMusic))}}function yi(s,r){if(1&s&&e._UZ(0,"app-lobby-countdown",18),2&s){const t=e.oxw();e.Q6J("ngClass",e.VKq(1,ye,!t.canPlayMusic))}}function Ti(s,r){1&s&&e._UZ(0,"app-hint-mode")}function xi(s,r){1&s&&e._UZ(0,"app-lobby-answer",9)}function wi(s,r){1&s&&e._UZ(0,"div")}function ki(s,r){1&s&&e._UZ(0,"app-answer-reveal-media")}const Si=s=>({"hint-mode":s});let Ci=(()=>{class s{lobbyStore;answer;subscriptions=[];lobby;canPlayMusic=!1;lobbyStatuses=u.D;lobbyUserStatus=C;lobbyHintModes=u.BF;lobbyUserRoles=v;me;loadProgress=0;error;serverBuffering=!1;constructor(t){this.lobbyStore=t}ngOnInit(){this.subscriptions=[this.lobbyStore.canPlayMusic.subscribe(t=>{this.canPlayMusic=t}),this.lobbyStore.lobby.subscribe(t=>{this.lobby=t}),this.lobbyStore.me.subscribe(t=>{this.me=t}),this.lobbyStore.lobbyLoadProgress.subscribe(t=>{this.loadProgress=t}),this.lobbyStore.error.subscribe(t=>{this.error=t}),this.lobbyStore.lobbyServerBuffer.subscribe(t=>{this.serverBuffering=t})]}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}play(){this.lobbyStore.setResumeMusic()}showAnswerComponent(){return this.me?.role!==v.Spectator&&!this.me?.hintMode&&this.lobby?.status===u.D.PlayingMusic}showEmptyTopDiv(){return this.lobby?.status===u.D.Buffering||this.lobby?.status===u.D.Loading||this.lobby?.hintMode!==u.BF.Allowed}showEmptyBottomDiv(){return this.lobby?.status===u.D.Buffering||this.lobby?.status===u.D.Loading||this.me?.role===v.Spectator}static \u0275fac=function(i){return new(i||s)(e.Y36(g))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-lobby-center-container"]],decls:16,vars:15,consts:[[1,"lobby-center-container","bg-dark","px-4","pt-4","position-relative",3,"ngClass"],[1,"d-flex","text-center","align-items-center","h-100","justify-content-between","position-relative","flex-column"],[4,"ngIf"],["class","w-100",4,"ngIf"],["class","align-self-center position-absolute",4,"ngIf"],["class","position-absolute","style","top: 0; left: 0",3,"title",4,"ngIf"],["class","position-absolute","style","top: 0; left: 24px",4,"ngIf"],["class","align-self-center countdown",3,"ngClass",4,"ngIf"],["class","text-center",3,"ngClass",4,"ngIf"],[1,"w-100"],["mode","determinate",3,"value"],[1,"align-self-center","position-absolute"],[1,"btn","btn-primary",3,"click"],[1,"position-absolute",2,"top","0","left","0",3,"title"],["role","status","aria-hidden","true",1,"spinner-border","spinner-border-sm",3,"ngClass"],[1,"position-absolute",2,"top","0","left","24px"],[1,"text-danger"],[1,"align-self-center","countdown",3,"ngClass"],[1,"text-center",3,"ngClass"]],template:function(i,o){1&i&&(e.TgZ(0,"div",0)(1,"div",1),e.YNc(2,mi,1,0,"div",2)(3,hi,3,2,"div",3)(4,_i,1,0,"app-hint-mode-toggle",2)(5,pi,7,0,"div",4)(6,fi,2,4,"div",5)(7,gi,3,1,"div",6)(8,vi,2,3,"div",7)(9,yi,1,3,"app-lobby-countdown",8)(10,Ti,1,0,"app-hint-mode",2)(11,xi,1,0,"app-lobby-answer",3)(12,wi,1,0,"div",2),e.qZA(),e._UZ(13,"app-lobby-audio-player")(14,"app-lobby-countdown-progress"),e.YNc(15,ki,1,0,"app-answer-reveal-media",2),e.qZA()),2&i&&(e.Q6J("ngClass",e.VKq(13,Si,null==o.me?null:o.me.hintMode)),e.xp6(2),e.Q6J("ngIf",o.showEmptyTopDiv()),e.xp6(),e.Q6J("ngIf",(null==o.lobby?null:o.lobby.status)===o.lobbyStatuses.Loading),e.xp6(),e.Q6J("ngIf",(null==o.lobby?null:o.lobby.hintMode)===o.lobbyHintModes.Allowed&&(null==o.lobby?null:o.lobby.status)===o.lobbyStatuses.PlayingMusic),e.xp6(),e.Q6J("ngIf",!o.canPlayMusic),e.xp6(),e.Q6J("ngIf",(null==o.me?null:o.me.status)===o.lobbyUserStatus.Buffering||o.serverBuffering),e.xp6(),e.Q6J("ngIf",o.error),e.xp6(),e.Q6J("ngIf",(null==o.lobby?null:o.lobby.status)===o.lobbyStatuses.Buffering),e.xp6(),e.Q6J("ngIf",o.canPlayMusic&&(null==o.lobby?null:o.lobby.status)===o.lobbyStatuses.PlayingMusic),e.xp6(),e.Q6J("ngIf",(null==o.lobby?null:o.lobby.status)===o.lobbyStatuses.PlayingMusic&&((null==o.lobby?null:o.lobby.hintMode)===o.lobbyHintModes.Always||(null==o.me?null:o.me.hintMode))),e.xp6(),e.Q6J("ngIf",o.showAnswerComponent()),e.xp6(),e.Q6J("ngIf",o.showEmptyBottomDiv()),e.xp6(3),e.Q6J("ngIf",o.lobby.status===o.lobbyStatuses.AnswerReveal))},dependencies:[m.mk,m.O5,oe.pW,Pt,Vt,Ot,Ht,Gt,zt,ui],encapsulation:2})}return s})();function Ii(s,r){if(1&s){const t=e.EpF();e.TgZ(0,"button",6),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.restart())}),e._UZ(1,"i",7),e.qZA()}}let Mi=(()=>{class s{lobbyStore;socket;subscriptions=[];me;lobbyUserRoles=v;lobby;constructor(t,i){this.lobbyStore=t,this.socket=i}ngOnInit(){this.subscriptions=[this.lobbyStore.lobby.subscribe(t=>{this.lobby=t}),this.lobbyStore.me.subscribe(t=>{this.me=t})]}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}restart(){this.socket.emit("restart")}static \u0275fac=function(i){return new(i||s)(e.Y36(g),e.Y36(x.i))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-lobby-information"]],decls:10,vars:4,consts:[[1,"bg-dark","p-4"],[1,"row"],[1,"col-4"],[1,"fa-solid","fa-hourglass-empty","me-1"],[1,"fa-solid","fa-music","me-1"],["class","btn btn-sm btn-primary","mdbTooltip","Restart lobby",3,"click",4,"ngIf"],["mdbTooltip","Restart lobby",1,"btn","btn-sm","btn-primary",3,"click"],[1,"fa-solid","fa-arrow-rotate-back"]],template:function(i,o){1&i&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2),e._UZ(3,"i",3),e._uU(4),e.qZA(),e.TgZ(5,"div",2),e._UZ(6,"i",4),e._uU(7),e.qZA(),e.TgZ(8,"div",2),e.YNc(9,Ii,2,0,"button",5),e.qZA()()()),2&i&&(e.xp6(4),e.hij("",null==o.lobby?null:o.lobby.guessTime,"s"),e.xp6(3),e.AsE("",null==o.lobby?null:o.lobby.currentLobbyMusicPosition,"/",-1===(null==o.lobby?null:o.lobby.musicNumber)?"\u221e":o.lobby.lobbyMusics," "),e.xp6(2),e.Q6J("ngIf",(null==o.me?null:o.me.role)===o.lobbyUserRoles.Host))},dependencies:[m.O5,U],encapsulation:2})}return s})();function Ai(s,r){if(1&s&&(e.ynx(0),e._uU(1),e.BQk()),2&s){const t=e.oxw(3);e.xp6(),e.Oqu(t.answer.gameToMusic.game.platforms[0].name)}}function Ri(s,r){1&s&&(e.ynx(0),e._uU(1,", "),e.BQk())}function Ei(s,r){if(1&s&&(e.ynx(0),e._uU(1),e.YNc(2,Ri,2,0,"ng-container",13),e.BQk()),2&s){const t=r.$implicit,i=r.last,o=r.last;e.xp6(),e.hij(" ",t.abbreviation,""),e.xp6(),e.Q6J("ngIf",!i&&!o)}}function Pi(s,r){if(1&s&&(e.ynx(0),e.YNc(1,Ei,3,2,"ng-container",18),e.BQk()),2&s){const t=e.oxw(3);e.xp6(),e.Q6J("ngForOf",t.answer.gameToMusic.game.platforms)}}function Di(s,r){if(1&s&&(e.TgZ(0,"small",17),e.YNc(1,Ai,2,1,"ng-container",13)(2,Pi,2,1,"ng-container",13),e.qZA()),2&s){const t=e.oxw(2);e.xp6(),e.Q6J("ngIf",1===(null==t.answer.gameToMusic.game.platforms?null:t.answer.gameToMusic.game.platforms.length)),e.xp6(),e.Q6J("ngIf",(null==t.answer.gameToMusic.game.platforms?null:t.answer.gameToMusic.game.platforms.length)>1&&11===t.answer.gameToMusic.game.category)}}function Zi(s,r){if(1&s&&e._UZ(0,"img",19),2&s){const t=e.oxw(2);e.Q6J("src","https://images.igdb.com/igdb/image/upload/t_720p/"+t.answer.gameToMusic.game.cover.imageId+".jpg",e.LSH)("alt",t.answer.gameToMusic.game.name)}}function Ui(s,r){if(1&s&&(e.TgZ(0,"div",20)(1,"h2",21),e._uU(2),e.qZA()()),2&s){const t=e.oxw(2);e.xp6(2),e.Oqu(t.answer.gameToMusic.game.name)}}const Te=s=>({"background-color":s});function Bi(s,r){if(1&s){const t=e.EpF();e.TgZ(0,"button",23),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(3);return e.KtG(o.addToList())}),e.TgZ(1,"mat-icon"),e._uU(2,"add"),e.qZA()()}if(2&s){const t=e.oxw(3);e.Q6J("ngStyle",e.VKq(1,Te,t.answer.gameToMusic.game.cover?t.answer.gameToMusic.game.cover.colorPalette.backgroundColorHex:"#171717"))}}function Vi(s,r){if(1&s){const t=e.EpF();e.TgZ(0,"button",23),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(3);return e.KtG(o.removeFromList())}),e.TgZ(1,"mat-icon"),e._uU(2,"remove"),e.qZA()()}if(2&s){const t=e.oxw(3);e.Q6J("ngStyle",e.VKq(1,Te,t.answer.gameToMusic.game.cover?null==t.answer.gameToMusic.game.cover.colorPalette?null:t.answer.gameToMusic.game.cover.colorPalette.backgroundColorHex:"black"))}}function Li(s,r){if(1&s&&(e.ynx(0),e.YNc(1,Bi,3,3,"button",22)(2,Vi,3,3,"button",22),e.BQk()),2&s){const t=e.oxw(2);e.xp6(),e.Q6J("ngIf",!1===t.me.playedTheGame),e.xp6(),e.Q6J("ngIf",!0===t.me.playedTheGame)}}function Oi(s,r){if(1&s&&(e.ynx(0),e.TgZ(1,"div",5)(2,"h2",6),e._uU(3),e.YNc(4,Di,3,2,"small",7),e.qZA()(),e.TgZ(5,"div",8)(6,"div",9)(7,"div",10),e.YNc(8,Zi,1,2,"img",11)(9,Ui,3,1,"ng-template",null,12,e.W1O),e.qZA(),e.YNc(11,Li,3,2,"ng-container",13),e.qZA()(),e.TgZ(12,"div",14)(13,"div")(14,"h4",6),e._uU(15,"Music"),e.qZA(),e.TgZ(16,"small",15),e._uU(17),e.qZA()(),e.TgZ(18,"div",16)(19,"h4",6),e._uU(20,"Artist"),e.qZA(),e.TgZ(21,"small",15),e._uU(22),e.qZA()()(),e.BQk()),2&s){const t=e.MAs(10),i=e.oxw();let o,n;e.xp6(3),e.hij(" ",i.answer.gameToMusic.game.name," "),e.xp6(),e.Q6J("ngIf",1===(null==i.answer.gameToMusic.game.platforms?null:i.answer.gameToMusic.game.platforms.length)||(null==i.answer.gameToMusic.game.platforms?null:i.answer.gameToMusic.game.platforms.length)>1&&11===i.answer.gameToMusic.game.category),e.xp6(4),e.Q6J("ngIf",i.answer.gameToMusic.game.cover)("ngIfElse",t),e.xp6(3),e.Q6J("ngIf",i.me),e.xp6(6),e.Oqu(null!==(o=i.answer.gameToMusic.title)&&void 0!==o?o:i.answer.gameToMusic.music.title),e.xp6(5),e.Oqu(null!==(n=i.answer.gameToMusic.artist)&&void 0!==n?n:i.answer.gameToMusic.music.artist)}}function Ni(s,r){1&s&&(e.TgZ(0,"div",5),e._UZ(1,"h2",24),e.qZA(),e.TgZ(2,"div",25),e._UZ(3,"div",26),e.qZA(),e.TgZ(4,"div",25)(5,"div"),e._UZ(6,"h4",27)(7,"small",28)(8,"small",29),e.qZA(),e.TgZ(9,"div",16),e._UZ(10,"h4",27)(11,"small",30)(12,"small",29),e.qZA()())}function Fi(s,r){1&s&&(e.TgZ(0,"p",16)(1,"small",31),e._UZ(2,"i",32),e._uU(3," This music may not reflect the difficulty configured. "),e.qZA()())}const Hi=s=>({"d-none d-md-block":s});let Qi=(()=>{class s{lobbyStore;gameHttpService;answer;me;interactedWithList=!1;subscriptions=[];constructor(t,i){this.lobbyStore=t,this.gameHttpService=i}ngOnInit(){this.subscriptions=[this.lobbyStore.currentLobbyMusicAnswer.subscribe(t=>{this.answer=t,this.interactedWithList=!1}),this.lobbyStore.lobby.subscribe(t=>{t.status!==u.D.AnswerReveal&&(this.answer=null)}),this.lobbyStore.currentLobbyMusic.subscribe(t=>{null!==t&&(this.answer=t)}),this.lobbyStore.me.subscribe(t=>{this.interactedWithList||(this.me={...t})})]}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}addToList(){this.gameHttpService.addToList(this.answer.gameToMusic.game.slug).subscribe(()=>{this.me.playedTheGame=!0,this.interactedWithList=!0})}removeFromList(){this.gameHttpService.removeFromList(this.answer.gameToMusic.game.slug).subscribe(()=>{this.me.playedTheGame=!1,this.interactedWithList=!0})}static \u0275fac=function(i){return new(i||s)(e.Y36(g),e.Y36(ue.q))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-lobby-answer-reveal"]],decls:6,vars:6,consts:[[1,"bg-dark","p-4","mb-2","mb-md-0",3,"ngClass"],[1,"row"],[4,"ngIf","ngIfElse"],["skeleton",""],["class","mt-2",4,"ngIf"],[1,"col-md-12"],[1,"mb-1"],["class","ms-1 text-muted","style","font-size: 11px",4,"ngIf"],[1,"col-sm-4","col-md-6"],[2,"position","relative","aspect-ratio","3/4","display","flex","align-items","center"],[1,"w-100"],["class","card-img-top",3,"src","alt",4,"ngIf","ngIfElse"],["noImage",""],[4,"ngIf"],[1,"col-sm-8","col-md-6"],[2,"font-size","11px"],[1,"mt-2"],[1,"ms-1","text-muted",2,"font-size","11px"],[4,"ngFor","ngForOf"],[1,"card-img-top",3,"src","alt"],[1,"p-2","text-center"],[1,"m-0"],["class","game-item-cta","mat-mini-fab","","aria-label","Example icon button with a heart icon",3,"ngStyle","click",4,"ngIf"],["mat-mini-fab","","aria-label","Example icon button with a heart icon",1,"game-item-cta",3,"ngStyle","click"],[1,"placeholder","col-md-6"],[1,"col-md-6"],[1,"w-auto","h-100","img-placeholder",2,"aspect-ratio","3/4"],[1,"mb-1","placeholder","col-md-4"],[1,"placeholder","col-md-12",2,"font-size","10px"],[1,"placeholder","col-md-6",2,"font-size","10px"],[1,"placeholder","col-md-9",2,"font-size","10px"],[2,"font-size","10px"],[1,"fa-solid","fa-exclamation-triangle","text-primary"]],template:function(i,o){if(1&i&&(e.TgZ(0,"div",0)(1,"div",1),e.YNc(2,Oi,23,7,"ng-container",2)(3,Ni,13,0,"ng-template",null,3,e.W1O)(5,Fi,4,0,"p",4),e.qZA()()),2&i){const n=e.MAs(4);e.Q6J("ngClass",e.VKq(4,Hi,!(null!=o.answer&&o.answer.gameToMusic))),e.xp6(2),e.Q6J("ngIf",null==o.answer?null:o.answer.gameToMusic)("ngIfElse",n),e.xp6(3),e.Q6J("ngIf",o.answer&&o.answer.contributeToMissingData)}},dependencies:[m.mk,m.sg,m.O5,m.PC,le.nh,Q.Hw],encapsulation:2})}return s})();const Yi=s=>({"text-primary":s});let Ji=(()=>{class s{user;static \u0275fac=function(i){return new(i||s)};static \u0275cmp=e.Xpm({type:s,selectors:[["app-lobby-score-row"]],inputs:{user:"user"},decls:10,vars:11,consts:[[1,"row",3,"ngClass"],[1,"col-1"],[1,"col"],[1,"col-3","d-flex","justify-content-end"],[1,"col-1","text-muted","justify-content-end"]],template:function(i,o){1&i&&(e.TgZ(0,"div",0)(1,"div",1),e._uU(2),e.qZA(),e.TgZ(3,"div",2),e._uU(4),e.ALo(5,"slice"),e.qZA(),e.TgZ(6,"div",3),e._uU(7),e.qZA(),e.TgZ(8,"div",4),e._uU(9),e.qZA()()),2&i&&(e.Q6J("ngClass",e.VKq(9,Yi,o.user.me)),e.xp6(2),e.hij("#",o.user.rank,""),e.xp6(2),e.Oqu(e.Dn7(5,5,o.user.user.username,0,50)),e.xp6(3),e.hij("",o.user.points," pts"),e.xp6(2),e.Oqu(o.user.musicGuessedRight))},dependencies:[m.mk,m.OU],encapsulation:2})}return s})();function qi(s,r){if(1&s&&e._UZ(0,"app-lobby-score-row",6),2&s){const t=e.oxw().$implicit;e.Q6J("user",t)}}function Gi(s,r){if(1&s&&e._UZ(0,"app-lobby-score-row",6),2&s){const t=e.oxw().$implicit,i=e.oxw();e.Q6J("user",i.getMeIndex()<=3?t:i.getMe())}}function Xi(s,r){if(1&s&&(e.ynx(0),e.YNc(1,qi,1,1,"app-lobby-score-row",5)(2,Gi,1,1,"app-lobby-score-row",5),e.BQk()),2&s){const t=r.index;e.xp6(),e.Q6J("ngIf",t<=2),e.xp6(),e.Q6J("ngIf",3===t)}}let ji=(()=>{class s{lobbyStore;subscriptions=[];users;me;constructor(t){this.lobbyStore=t}ngOnInit(){this.subscriptions=[this.lobbyStore.users.subscribe(t=>{t&&(this.users=t.filter(i=>[v.Host,v.Player].includes(i.role)).sort((i,o)=>i.points>o.points?-1:1).reduce((i,o,n)=>{let a=0===n?1:i[n-1].rank+1;return 0!==n&&o.points===i[n-1].points&&(a=i[n-1].rank),[...i,{...o,rank:a}]},[]))}),this.lobbyStore.me.subscribe(t=>{this.me=t})]}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}getMeIndex(){return this.users.findIndex(t=>t.me)}getMe(){return this.users.find(t=>t.me)}scoreExplanation(){return'Points distribution:
  • 10 points when using the autocomplete
    • +5 points on the first try
    • +5 points if the game is not in your list
  • 5 points when using hints
'}static \u0275fac=function(i){return new(i||s)(e.Y36(g))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-lobby-score"]],decls:5,vars:3,consts:[[1,"bg-dark"],[1,"d-flex","pt-1","pe-1"],["placement","top",1,"fa-solid","fa-question-circle","ms-auto",3,"mdbTooltip","html"],[1,"pb-4","pt-2","px-4"],[4,"ngFor","ngForOf"],[3,"user",4,"ngIf"],[3,"user"]],template:function(i,o){1&i&&(e.TgZ(0,"div",0)(1,"div",1),e._UZ(2,"i",2),e.qZA(),e.TgZ(3,"div",3),e.YNc(4,Xi,3,2,"ng-container",4),e.qZA()()),2&i&&(e.xp6(2),e.Q6J("mdbTooltip",o.scoreExplanation())("html",!0),e.xp6(2),e.Q6J("ngForOf",o.users))},dependencies:[m.sg,m.O5,U,Ji],encapsulation:2})}return s})(),zi=(()=>{class s{static \u0275fac=function(i){return new(i||s)};static \u0275cmp=e.Xpm({type:s,selectors:[["app-lobby-playing"]],decls:14,vars:0,consts:[[1,"row"],[1,"col-md-3","d-flex","flex-column"],[1,"mt-2","order-1","order-md-0","mb-2","mb-md-0"],[1,"mt-2","order-0","order-md-1"],[1,"col-md-6","lobby-col"],[1,"col-md-3","lobby-col"]],template:function(i,o){1&i&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div"),e._UZ(3,"app-button-play"),e.qZA(),e.TgZ(4,"div"),e._UZ(5,"app-lobby-information"),e.qZA(),e.TgZ(6,"div",2),e._UZ(7,"app-lobby-answer-reveal"),e.qZA(),e.TgZ(8,"div",3),e._UZ(9,"app-lobby-score"),e.qZA()(),e.TgZ(10,"div",4),e._UZ(11,"app-lobby-center-container"),e.qZA(),e.TgZ(12,"div",5),e._UZ(13,"app-lobby-chat"),e.qZA()())},dependencies:[ie,Ci,Mi,Qi,ji,se],encapsulation:2})}return s})();function Wi(s,r){1&s&&(e.ynx(0),e._UZ(1,"app-lobby-waiting"),e.BQk())}function $i(s,r){1&s&&(e.ynx(0),e._UZ(1,"app-lobby-playing"),e.BQk())}function Ki(s,r){if(1&s&&(e.ynx(0),e.YNc(1,Wi,2,0,"ng-container",3)(2,$i,2,0,"ng-container",3),e._UZ(3,"app-lobby-users"),e.BQk()),2&s){const t=e.oxw();e.xp6(),e.Q6J("ngIf",t.lobby.status===t.lobbyStatuses.Waiting),e.xp6(),e.Q6J("ngIf",t.lobbyService.isPLaying(t.lobby))}}function es(s,r){1&s&&e._uU(0,"loading")}let ts=(()=>{class s{lobbyHttpService;lobbyService;router;route;dialog;socket;authService;lobbyStore;snackBar;lobbyFileSocket;lobbyCode;lobby;lobbyStatuses=u.D;subscriptions=[];constructor(t,i,o,n,a,b,f,w,L,J){this.lobbyHttpService=t,this.lobbyService=i,this.router=o,this.route=n,this.dialog=a,this.socket=b,this.authService=f,this.lobbyStore=w,this.snackBar=L,this.lobbyFileSocket=J}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe()),this.lobbyStore.disconnect(),this.socket.disconnect(),this.lobbyFileSocket.disconnect()}ngOnInit(){this.socket.connect(),this.subscriptions=[this.socket.fromEvent("connect_error").subscribe(t=>{"Unauthorized"===t.message&&(this.lobbyFileSocket.disconnect(),this.authService.refreshToken().subscribe(()=>{this.socket.connect(),this.lobbyFileSocket.connect(),this.socket.emit("fake emit")}))}),this.lobbyFileSocket.fromEvent("connect_error").subscribe(t=>{"Unauthorized"===t.message&&this.lobby&&(this.lobbyFileSocket.disconnect(),this.lobbyFileSocket.connect(),this.lobbyFileSocket.emit("fake emit"))}),this.socket.fromEvent("NotFoundException").subscribe(()=>{this.router.navigate(["/"])}),this.socket.fromEvent("MissingPasswordException").subscribe(()=>{this.dialog.open(at.q,{data:this.lobbyCode}).afterClosed().subscribe(()=>{void 0===this.lobby&&this.router.navigate(["/"])})}),this.socket.fromEvent("error").subscribe(t=>{this.lobbyStore.setLobbyError(t)}),this.socket.fromEvent("lobbyJoined").subscribe(t=>{this.lobby=t,this.lobbyStore.setLobby(this.lobby),this.lobbyFileSocket.connect(),this.lobbyFileSocket.emit("join")}),this.socket.fromEvent("lobbyUsers").subscribe(t=>{this.lobbyStore.setUsers(t)}),this.socket.fromEvent("lobby").subscribe(t=>{this.lobby=t,this.lobbyStore.setLobby(this.lobby)}),this.socket.fromEvent("lobbyStartBuffer").subscribe(()=>{this.lobbyStore.setLobbyServerBuffer(!0),this.lobbyStore.resetLobbyError()}),this.socket.fromEvent("lobbyBufferEnd").subscribe(()=>{this.lobbyStore.setLobbyServerBuffer(!1)}),this.lobbyFileSocket.fromEvent("buffer").subscribe(t=>{this.lobbyStore.setCurrentLobbyAudioBuffer(t),this.socket.emit("readyToPlayMusic")}),this.socket.fromEvent("currentLobbyMusic").subscribe(t=>{this.lobbyStore.setCurrentLobbyMusic(t)}),this.socket.fromEvent("lobbyAnswer").subscribe(t=>{this.lobbyStore.setCurrentLobbyMusicAnswer(t)}),this.socket.fromEvent("lobbyUser").subscribe(t=>{this.lobbyStore.updateLobbyUser(t)}),this.socket.fromEvent("lobbyReset").subscribe(t=>{this.lobby=t,this.lobbyStore.setLobby(this.lobby),this.lobbyStore.setCurrentLobbyAudioBuffer(null),this.lobbyStore.setCurrentLobbyMusicAnswer(null)}),this.socket.fromEvent("lobbyToast").subscribe(t=>{this.snackBar.open(t,void 0,{horizontalPosition:"end",verticalPosition:"bottom",panelClass:"danger",duration:5e3})}),this.socket.fromEvent("disconnect").subscribe(()=>{this.router.navigate(["/"])}),this.socket.fromEvent("chat").subscribe(t=>{this.lobbyStore.addMessage(t)}),this.socket.fromEvent("hintModeGames").subscribe(t=>{this.lobbyStore.setHintModeGames(t)}),this.socket.fromEvent("lobbyLoadProgress").subscribe(t=>{this.lobbyStore.setLobbyLoadProgress(t)}),this.route.paramMap.subscribe(t=>{this.lobbyCode=t.get("code")})],this.lobbyService.join(this.lobbyCode)}static \u0275fac=function(i){return new(i||s)(e.Y36(I.Y),e.Y36(lt.V),e.Y36(_.F0),e.Y36(_.gz),e.Y36(dt.uw),e.Y36(x.i),e.Y36(k.e),e.Y36(g),e.Y36(O.ux),e.Y36(ct.Q))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-lobby"]],decls:4,vars:2,consts:[[1,"container-fluid"],[4,"ngIf","ngIfElse"],["loading",""],[4,"ngIf"]],template:function(i,o){if(1&i&&(e.TgZ(0,"div",0),e.YNc(1,Ki,4,2,"ng-container",1)(2,es,1,0,"ng-template",null,2,e.W1O),e.qZA()),2&i){const n=e.MAs(3);e.xp6(),e.Q6J("ngIf",o.lobby)("ngIfElse",n)}},dependencies:[m.O5,gt,Mt,zi],encapsulation:2})}return s})();var is=l(2596),ss=l(8525);let rs=(()=>{class s{static \u0275fac=function(i){return new(i||s)};static \u0275mod=e.oAB({type:s});static \u0275inj=e.cJS({imports:[m.ez]})}return s})();const as=[{path:"create",component:nt},{path:":code",component:ts},{path:"**",redirectTo:"create"}];let ls=(()=>{class s{static \u0275fac=function(i){return new(i||s)};static \u0275mod=e.oAB({type:s});static \u0275inj=e.cJS({providers:[I.Y,g],imports:[m.ez,_.Bz.forChild(as),rt.m,Oe,O.ZX,Xe,is.AV,Q.Ps,et,ss.LD,oe.Cv,ni,V.Tx,rs]})}return s})()}}]); \ No newline at end of file diff --git a/index.html b/index.html index 1ce22b6..b0f6a33 100644 --- a/index.html +++ b/index.html @@ -13,6 +13,7 @@ +
Test your gaming music knowledge with VGMQ!

VGMQ is a free, multiplayer game that lets you challenge your friends to a fun and challenging music quiz! @@ -22,6 +23,7 @@

Test your gaming music knowledge w development, but we're always adding new features and games!
Feel free to join the Discord!

+
- + diff --git a/runtime.4d4201e96c68e4c0.js b/runtime.f693861a0512f93d.js similarity index 95% rename from runtime.4d4201e96c68e4c0.js rename to runtime.f693861a0512f93d.js index dd94948..2552309 100644 --- a/runtime.4d4201e96c68e4c0.js +++ b/runtime.f693861a0512f93d.js @@ -1 +1 @@ -(()=>{"use strict";var e,v={},m={};function r(e){var n=m[e];if(void 0!==n)return n.exports;var a=m[e]={exports:{}};return v[e](a,a.exports,r),a.exports}r.m=v,e=[],r.O=(n,a,f,o)=>{if(!a){var t=1/0;for(i=0;i=o)&&Object.keys(r.O).every(p=>r.O[p](a[u]))?a.splice(u--,1):(c=!1,o0&&e[i-1][2]>o;i--)e[i]=e[i-1];e[i]=[a,f,o]},r.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return r.d(n,{a:n}),n},r.d=(e,n)=>{for(var a in n)r.o(n,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:n[a]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((n,a)=>(r.f[a](e,n),n),[])),r.u=e=>e+"."+{76:"c9bb9553e8788bcf",83:"0156455865a7c8e9",219:"fc1009fcf29b7c5f",419:"12b0394af7a2f2ef",434:"ab6d8461db531b02",525:"4715140f38942a7f",624:"0babb0d47d71fd08",683:"471f350225ce839b",813:"a761d05bf3557e26",939:"4b723b07380bb18f"}[e]+".js",r.miniCssF=e=>{},r.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),(()=>{var e={},n="vgmq:";r.l=(a,f,o,i)=>{if(e[a])e[a].push(f);else{var t,c;if(void 0!==o)for(var u=document.getElementsByTagName("script"),l=0;l{t.onerror=t.onload=null,clearTimeout(b);var _=e[a];if(delete e[a],t.parentNode&&t.parentNode.removeChild(t),_&&_.forEach(h=>h(p)),g)return g(p)},b=setTimeout(s.bind(null,void 0,{type:"timeout",target:t}),12e4);t.onerror=s.bind(null,t.onerror),t.onload=s.bind(null,t.onload),c&&document.head.appendChild(t)}}})(),r.r=e=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.tt=()=>(void 0===e&&(e={createScriptURL:n=>n},typeof trustedTypes<"u"&&trustedTypes.createPolicy&&(e=trustedTypes.createPolicy("angular#bundler",e))),e)})(),r.tu=e=>r.tt().createScriptURL(e),r.p="",(()=>{var e={666:0};r.f.j=(f,o)=>{var i=r.o(e,f)?e[f]:void 0;if(0!==i)if(i)o.push(i[2]);else if(666!=f){var t=new Promise((d,s)=>i=e[f]=[d,s]);o.push(i[2]=t);var c=r.p+r.u(f),u=new Error;r.l(c,d=>{if(r.o(e,f)&&(0!==(i=e[f])&&(e[f]=void 0),i)){var s=d&&("load"===d.type?"missing":d.type),b=d&&d.target&&d.target.src;u.message="Loading chunk "+f+" failed.\n("+s+": "+b+")",u.name="ChunkLoadError",u.type=s,u.request=b,i[1](u)}},"chunk-"+f,f)}else e[f]=0},r.O.j=f=>0===e[f];var n=(f,o)=>{var u,l,[i,t,c]=o,d=0;if(i.some(b=>0!==e[b])){for(u in t)r.o(t,u)&&(r.m[u]=t[u]);if(c)var s=c(r)}for(f&&f(o);d{"use strict";var e,v={},m={};function r(e){var n=m[e];if(void 0!==n)return n.exports;var a=m[e]={exports:{}};return v[e](a,a.exports,r),a.exports}r.m=v,e=[],r.O=(n,a,f,o)=>{if(!a){var t=1/0;for(i=0;i=o)&&Object.keys(r.O).every(p=>r.O[p](a[u]))?a.splice(u--,1):(c=!1,o0&&e[i-1][2]>o;i--)e[i]=e[i-1];e[i]=[a,f,o]},r.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return r.d(n,{a:n}),n},r.d=(e,n)=>{for(var a in n)r.o(n,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:n[a]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((n,a)=>(r.f[a](e,n),n),[])),r.u=e=>e+"."+{76:"c9bb9553e8788bcf",83:"0156455865a7c8e9",219:"fc1009fcf29b7c5f",419:"12b0394af7a2f2ef",434:"ab6d8461db531b02",525:"4715140f38942a7f",624:"0a34cf57765237e5",683:"471f350225ce839b",813:"a761d05bf3557e26",939:"4b723b07380bb18f"}[e]+".js",r.miniCssF=e=>{},r.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),(()=>{var e={},n="vgmq:";r.l=(a,f,o,i)=>{if(e[a])e[a].push(f);else{var t,c;if(void 0!==o)for(var u=document.getElementsByTagName("script"),l=0;l{t.onerror=t.onload=null,clearTimeout(b);var _=e[a];if(delete e[a],t.parentNode&&t.parentNode.removeChild(t),_&&_.forEach(h=>h(p)),g)return g(p)},b=setTimeout(s.bind(null,void 0,{type:"timeout",target:t}),12e4);t.onerror=s.bind(null,t.onerror),t.onload=s.bind(null,t.onload),c&&document.head.appendChild(t)}}})(),r.r=e=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.tt=()=>(void 0===e&&(e={createScriptURL:n=>n},typeof trustedTypes<"u"&&trustedTypes.createPolicy&&(e=trustedTypes.createPolicy("angular#bundler",e))),e)})(),r.tu=e=>r.tt().createScriptURL(e),r.p="",(()=>{var e={666:0};r.f.j=(f,o)=>{var i=r.o(e,f)?e[f]:void 0;if(0!==i)if(i)o.push(i[2]);else if(666!=f){var t=new Promise((d,s)=>i=e[f]=[d,s]);o.push(i[2]=t);var c=r.p+r.u(f),u=new Error;r.l(c,d=>{if(r.o(e,f)&&(0!==(i=e[f])&&(e[f]=void 0),i)){var s=d&&("load"===d.type?"missing":d.type),b=d&&d.target&&d.target.src;u.message="Loading chunk "+f+" failed.\n("+s+": "+b+")",u.name="ChunkLoadError",u.type=s,u.request=b,i[1](u)}},"chunk-"+f,f)}else e[f]=0},r.O.j=f=>0===e[f];var n=(f,o)=>{var u,l,[i,t,c]=o,d=0;if(i.some(b=>0!==e[b])){for(u in t)r.o(t,u)&&(r.m[u]=t[u]);if(c)var s=c(r)}for(f&&f(o);d