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C1B,KAAQ,CAACA,EAAWA,GACpB,SAAY,CAACA,EAAWA,EAAWA,GACnC,WAAa,CAACA,EAAWA,EAAWA,GACpC,kBAAmB,CAACA,EAAWA,EAAWA,EAAeA,GACzD,MAAS,CAACA,EAAWA,GACrB,cAAe,CAACA,EAAWA,GAC3B,eAAgB,CAACA,EAAWA,IAC7B,EAiBA,OAjBA,0CAED,SAAmB5B,GAAuD,IAAD,SACnE6B,EAAkC3C,KAAKyC,2BAA2B3B,EAAS8B,WAC/E,IAAID,EAEF,OADA3C,KAAKP,SAASoD,OAAOC,QAAQ,sCAAD,OAAuChC,EAASf,SAAQ,cAAMe,EAASC,MAAK,0BAAkBD,EAAS8B,YAC5H,GAGT,IAAIG,EAAqD,CAAC,EAK1D,QAJoE,QAAnE,EAAA/C,KAAKP,SAASuD,cAAcC,KAAKC,gBAAgBC,0BAAkB,aAAnE,EAAqEJ,mBAAoB,IAAIK,SAC5F,SAAAC,GAAO,OAAIN,EAAiBM,IAAW,CAAI,IAGtCV,EAASW,QAAO,SAAAD,GAAO,OAAKN,EAAiBM,EAAQE,KAAK,IAChDC,KAAI,SAAAH,GAAO,OAAIA,EAAQI,SAAS,EAAKhE,SAAUqB,EAAS,IACvDwC,QAAO,SAAAD,GAAO,OAAK7B,EAAAA,MAAAA,kBAAwB6B,EAAQ,GACvE,KAAC,EA9B4C,CAAS5C,EAAAA,E","sources":["app-react/services/lobby-game-info-preview/lobby-game-info-preview.service.ts","app-react/services/game-preview-features-selector/preview-features/boolean-game-preview-feature.ts","app-react/services/game-preview-features-selector/preview-features/money-game-preview-feature.ts","app-react/services/game-preview-features-selector/preview-features/numeric-game-preview-feature.ts","app-react/services/game-preview-features-selector/preview-features/all-features.ts","app-react/services/game-preview-features-selector/game-preview-features-selector.service.ts"],"sourcesContent":["import {ILobbyGameInfoPreviewService} from './lobby-game-info-preview.service.interface';\nimport { action, observable, makeObservable } from 'mobx';\nimport {ServiceBase} from '../ServiceBase';\nimport {IServiceFactoryExtended} from '../service-factory-extended.interface';\nimport {GameInfo} from '../games/game-info';\n\nconst TIME_TO_HANDLE_SET_GAME_PREVIEW = 800;\nconst TIME_TO_HANDLE_CLEAR_GAME_PREVIEW = 5000;\n\n\nexport class LobbyGameInfoPreviewService extends ServiceBase implements ILobbyGameInfoPreviewService {\n\n constructor(serviceFactory: IServiceFactoryExtended) {\n super(serviceFactory);\n\n makeObservable(this);\n\n this.reaction(() => this.services.device.isMobile,\n () => this._resetGamePreview());\n\n this.reaction(() => this.services.routing.currentRoute,\n () => this._resetGamePreview());\n }\n\n @observable.ref\n currentPreviewedGame: GameInfo = null;\n\n @action.bound\n private _setCurrentPreviewedGame(gameType: number | null): void {\n if (gameType) {\n this.currentPreviewedGame = this.services.games.gamesMap[gameType];\n } else {\n this.currentPreviewedGame = null;\n }\n\n }\n\n\n private _setGamePreviewTimeout;\n private _clearGamePreviewTimeout;\n\n\n enableGamePreview(): void {\n this._allowPreview = true;\n }\n\n disableGamePreview(): void {\n this._allowPreview = false;\n }\n\n private _allowPreview = false;\n get allowGamePreview(): boolean {\n return this._allowPreview && !this.services.device.isMobile;\n }\n\n private _currentGamePreviewPinned = false;\n\n pinCurrentGamePreview() {\n this._currentGamePreviewPinned = true;\n clearTimeout(this._clearGamePreviewTimeout);\n }\n\n unPinCurrentGamePreview() {\n this._currentGamePreviewPinned = false;\n // basically when unPinCurrentGamePreview is called it means user mouse leave from the game preview\n this.clearGamePreview();\n }\n\n\n public setGamePreview(gameType: number): void {\n if(!this.allowGamePreview) {\n return;\n }\n clearTimeout(this._clearGamePreviewTimeout);\n clearTimeout(this._setGamePreviewTimeout);\n this._setGamePreviewTimeout = setTimeout(() => {\n this._setCurrentPreviewedGame(gameType);\n }, TIME_TO_HANDLE_SET_GAME_PREVIEW);\n }\n\n public clearGamePreview(): void {\n if(!this.allowGamePreview) {\n return;\n }\n\n clearTimeout(this._setGamePreviewTimeout);\n clearTimeout(this._clearGamePreviewTimeout);\n this._clearGamePreviewTimeout = setTimeout(() => {\n !this._currentGamePreviewPinned && this._setCurrentPreviewedGame(null);\n }, TIME_TO_HANDLE_CLEAR_GAME_PREVIEW);\n }\n\n private _resetGamePreview() {\n clearTimeout(this._setGamePreviewTimeout);\n clearTimeout(this._clearGamePreviewTimeout);\n this._setCurrentPreviewedGame(null);\n }\n\n\n}\n","import {\n IGamePreviewFeature,\n PreviewFeatureEvaluationResult,\n PreviewFeatureType\n} from './game-preview-feature.interface';\nimport {IServiceFactory} from '../../service-factory.interface';\nimport {GameInfo} from '../../games/game-info';\n\nexport class BooleanGamePreviewFeature implements IGamePreviewFeature {\n constructor(private _name: string, private _title: string, private _valueEvaluator: (gameInfo: GameInfo) => boolean) {\n }\n\n get name(): string {\n return this._name;\n }\n\n evaluate(services: IServiceFactory, gameInfo: GameInfo): PreviewFeatureEvaluationResult {\n return {\n title: services.translation.translate(this._title),\n value: this._valueEvaluator(gameInfo),\n type: PreviewFeatureType.check\n }\n }\n}\n","import {\n IGamePreviewFeature,\n PreviewFeatureEvaluationResult,\n PreviewFeatureType\n} from './game-preview-feature.interface';\nimport {GameInfo} from '../../games/game-info';\nimport {IServiceFactory} from '../../service-factory.interface';\nimport {Check} from '@sparkware/app-utils';\n\nexport class MoneyGamePreviewFeature implements IGamePreviewFeature {\n constructor(private _name: string, private _title: string, private _valueEvaluator: (gameInfo: GameInfo) => any, private _shouldRenderWhenEmpty=true) {\n }\n\n get name(): string {\n return this._name;\n }\n\n private _extractValue(services: IServiceFactory, gameInfo: GameInfo) {\n let value = parseInt(this._valueEvaluator(gameInfo));\n if(Check.isNumber(value)) {\n return services.currency.formatMoney(value, true)\n } else {\n return null;\n }\n }\n\n evaluate(services: IServiceFactory, gameInfo: GameInfo): PreviewFeatureEvaluationResult {\n const value = this._extractValue(services, gameInfo);\n if(Check.isEmpty(value) && !this._shouldRenderWhenEmpty){\n return null;\n }\n\n return {\n title: services.translation.translate(this._title),\n value: this._extractValue(services, gameInfo),\n type: PreviewFeatureType.description\n }\n }\n}\n\n\n\n","import {\n IGamePreviewFeature,\n PreviewFeatureEvaluationResult,\n PreviewFeatureType\n} from './game-preview-feature.interface';\nimport {IServiceFactory} from '../../service-factory.interface';\nimport {GameInfo} from '../../games/game-info';\n\nexport class NumericGamePreviewFeature implements IGamePreviewFeature {\n constructor(private _name: string, private _title: string, private _valueEvaluator: (gameInfo: GameInfo) => any) {\n }\n\n get name(): string {\n return this._name;\n }\n\n evaluate(services: IServiceFactory, gameInfo: GameInfo): PreviewFeatureEvaluationResult {\n return {\n title: services.translation.translate(this._title),\n value: this._valueEvaluator(gameInfo),\n type: PreviewFeatureType.description\n }\n }\n}\n","import {BooleanGamePreviewFeature} from './boolean-game-preview-feature';\nimport {MoneyGamePreviewFeature} from './money-game-preview-feature';\nimport {NumericGamePreviewFeature} from './numeric-game-preview-feature';\n\nexport const minBet = new MoneyGamePreviewFeature('minBet', 'MINIMUM_BET', (gameInfo) => gameInfo.minBet, false);\nexport const maxBet = new MoneyGamePreviewFeature('maxBet', 'MAXIMUM_BET', (gameInfo) => gameInfo.maxBet, false);\nexport const hasJackpot = new BooleanGamePreviewFeature('hasJackpot', 'JACKPOT', (gameInfo) => gameInfo.hasJackpot);\nexport const numberOfLines = new NumericGamePreviewFeature('numberOfLines', 'PAYLINES', (gameInfo) => gameInfo.numberOfLines);\nexport const hasBonusGames = new BooleanGamePreviewFeature('hasBonusGames', 'BONUS_GAME', (gameInfo) => gameInfo.hasBonusGames);\nexport const hasFreeSpins = new BooleanGamePreviewFeature('hasFreeSpins', 'FREE_SPINS', (gameInfo) => gameInfo.hasFreeSpins);\nexport const maxBetPerSpot = new MoneyGamePreviewFeature('maxBetPerSpot', 'MAX_PER_SPOT', (gameInfo) => gameInfo.maxBetPerSpot);\nexport const multiplayer = new NumericGamePreviewFeature('multiplayer', 'MULTIPLAYER', (gameInfo) => gameInfo.multiplayer);\nexport const isMultiHand = new BooleanGamePreviewFeature('isMultiHand', 'MULTIHAND', (gameInfo) => gameInfo.isMultiHand);\nexport const numberOfDecks = new NumericGamePreviewFeature('numberOfDecks', 'DECKS', (gameInfo) => gameInfo.numberOfDecks);\nexport const hasSideBets = new BooleanGamePreviewFeature('hasSideBets', 'SIDE_BETS', (gameInfo) => gameInfo.hasSideBets);\n\n\n","import {ServiceBase} from '../ServiceBase';\nimport {IGamePreviewFeaturesSelectorService} from './game-preview-features-selector.service.interface';\nimport * as PF from './preview-features/all-features';\nimport {GameInfo} from '../games/game-info';\nimport {PreviewFeatureEvaluationResult, IGamePreviewFeature} from './preview-features/game-preview-feature.interface';\nimport { Check } from '@sparkware/app-utils';\n\nexport class GamePreviewFeaturesSelectorService extends ServiceBase implements IGamePreviewFeaturesSelectorService {\n private _gameGroupToFeatureMapping = {\n 'VideoSlot': [PF.minBet, PF.maxBet, PF.hasJackpot, PF.numberOfLines, PF.hasBonusGames, PF.hasFreeSpins],\n 'Roulette': [PF.minBet, PF.maxBet],\n 'Blackjack': [PF.minBet, PF.maxBet, PF.numberOfDecks, PF.isMultiHand, PF.hasSideBets],\n 'VideoPoker': [PF.minBet, PF.maxBet],\n 'Keno': [PF.minBet, PF.maxBet],\n 'Baccarat': [PF.minBet, PF.maxBet, PF.numberOfDecks],\n 'PuntoBanco':[PF.minBet, PF.maxBet, PF.hasBonusGames],\n 'Caribbean Poker': [PF.minBet, PF.maxBet, PF.hasJackpot, PF.isMultiHand],\n 'Craps': [PF.minBet, PF.maxBet],\n 'Live Casino': [PF.minBet, PF.maxBet],\n 'Scratch Card': [PF.minBet, PF.maxBet]\n };\n\n getPreviewFeatures(gameInfo: GameInfo): PreviewFeatureEvaluationResult[] {\n let features: IGamePreviewFeature[] = this._gameGroupToFeatureMapping[gameInfo.gameGroup];\n if(!features) {\n this.services.logger.warning(`No preview features found for game ${gameInfo.gameType} - ${gameInfo.title} in game group ${gameInfo.gameGroup}`);\n return [];\n }\n\n let disabledFeatures: {[featureName: string]: boolean} = {};\n (this.services.configuration.data.generalSettings.gamesPreviewConfig?.disabledFeatures || []).forEach(\n feature => disabledFeatures[feature] = true\n );\n \n return features.filter(feature => !disabledFeatures[feature.name])\n .map(feature => feature.evaluate(this.services, gameInfo))\n .filter(feature => !Check.isNullOrUndefined(feature));\n }\n}\n\n\n"],"names":["LobbyGameInfoPreviewService","observable","action","serviceFactory","_setGamePreviewTimeout","_clearGamePreviewTimeout","_allowPreview","_currentGamePreviewPinned","makeObservable","reaction","services","device","isMobile","_resetGamePreview","routing","currentRoute","gameType","this","currentPreviewedGame","games","gamesMap","clearTimeout","clearGamePreview","allowGamePreview","setTimeout","_setCurrentPreviewedGame","ServiceBase","BooleanGamePreviewFeature","_name","_title","_valueEvaluator","gameInfo","title","translation","translate","value","type","PreviewFeatureType","MoneyGamePreviewFeature","_shouldRenderWhenEmpty","parseInt","Check","currency","formatMoney","_extractValue","NumericGamePreviewFeature","minBet","maxBet","hasJackpot","numberOfLines","hasBonusGames","hasFreeSpins","isMultiHand","maxBetPerSpot","multiplayer","numberOfDecks","hasSideBets","GamePreviewFeaturesSelectorService","_gameGroupToFeatureMapping","PF","features","gameGroup","logger","warning","disabledFeatures","configuration","data","generalSettings","gamesPreviewConfig","forEach","feature","filter","name","map","evaluate"],"sourceRoot":""}