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Q3C,KAAKU,OAAOkC,kBAAmB,eAAgB,YAC/E,CAEA1B,qBAAAA,GACI,MAAM2B,EAAiB7C,KAAK8C,aAAa9C,KAAKc,OAAO,GACrD,GAAI+B,EAAO,CACP,IAAIE,EAAQ,EACZ,IAAK,IAAIC,EAAI,EAAGA,EAAIhD,KAAKc,MAAMK,QAAQC,OAAQ4B,IACvChD,KAAKc,MAAMK,QAAQ6B,GAAGC,QAAQ7B,OAAS,IACvC2B,GAAS/C,KAAKc,MAAMC,OAG5BgC,GAAS/C,KAAKc,MAAMoC,SAEpBlD,KAAKmD,iBAAiBJ,EAC1B,MACI/C,KAAKmD,iBAAiB,GAE1B,OAAON,CACX,EAIJpB,GAAE,WAEEJ,EAAAA,EAAgB+B,QAAQ,IAAIvD,EAAWwD,EAAAA,IACvChC,EAAAA,EAAgBC,OAAOgC,cAAcjC,EAAAA,EAAgBkC,KAAK7C,QAC1DW,EAAAA,EAAgBkC,KAAKxD,OACrByD,EAAAA,EAAOC,MACX,G","sources":["webpack://@sazka/web/./js/app/lotteries/online/games/_extra-renta.ts"],"sourcesContent":["import { Loader } from \"@sazka/design-system/src/loader/loader\";\r\nimport { useSessionStorage } from \"@sazka/utils/use-storage\";\r\nimport { extraRentaConfig } from \"../game-configs/extra-renta-config\";\r\nimport { loadDurationFromQuery } from \"../shared/bet-from-query\";\r\nimport { Cookie } from \"../shared/cookie\";\r\nimport { Game } from \"../shared/game\";\r\nimport { onlineLotteries } from \"../shared/online-lotteries\";\r\nimport { getQuickWager } from \"../shared/quick-wager\";\r\nimport { Wager } from \"../shared/wager\";\r\nimport { useWagerStore } from \"../shared/composables/use-wager-store\";\r\n\r\nconst wagerStore = useWagerStore();\r\n\r\nclass ExtraRenta extends Game {\r\n init() {\r\n this.initInternal();\r\n\r\n const qw = getQuickWager();\r\n if (qw) {\r\n this.selectQuickWager(qw);\r\n this.isQuickWager = true;\r\n } else {\r\n const { durationState, duration, draws } = loadDurationFromQuery(this.config.Name);\r\n if (durationState || duration || draws) {\r\n this.initDuration(durationState, duration, draws);\r\n this.initFromCookie();\r\n }\r\n }\r\n\r\n if (!this.wager.Stake) {\r\n wagerStore.stake = this.config.DefaultStake;\r\n this.recalculateTotalPrice();\r\n }\r\n\r\n if (this.wager.Numbers.length <= 0) {\r\n onlineLotteries.dialog.open();\r\n } else {\r\n this.recalculateTotalPrice();\r\n }\r\n }\r\n\r\n selectQuickWager(quickWager): void {\r\n $(this.config.WrapperAllId).addClass(\"active\");\r\n $(this.config.GameTypeId).removeClass(\"system\").addClass(\"manual\");\r\n\r\n this.wager.reset();\r\n\r\n Cookie.remove();\r\n\r\n const columns = quickWager.columns;\r\n\r\n // Generate columns\r\n const wager = new Wager(this.config.AddonEnabled);\r\n wager.random(columns, false, this.config.PrimaryCount, 0, false, this.config.DefaultStake);\r\n this.wager = wager;\r\n\r\n const { durationState, duration, draws } = loadDurationFromQuery(this.config.Name);\r\n const quickWagerDuration = duration || quickWager.duration;\r\n\r\n this.initDuration(durationState, quickWagerDuration, draws);\r\n this.initWager(quickWager.stake * 100);\r\n\r\n this.updateWagerHtml();\r\n this.initAddButton();\r\n this.recalculateTotalPrice();\r\n\r\n useSessionStorage().setItem(this.config.CookieFillingName, \"randomColumn\", \"analytics\");\r\n }\r\n\r\n recalculateTotalPrice(): boolean {\r\n const valid: boolean = this.wagerIsValid(this.wager, true);\r\n if (valid) {\r\n let price = 0;\r\n for (let i = 0; i < this.wager.Numbers.length; i++) {\r\n if (this.wager.Numbers[i].Primary.length > 0) {\r\n price += this.wager.Stake;\r\n }\r\n }\r\n price *= this.wager.Duration;\r\n\r\n this.changeTotalPrice(price);\r\n } else {\r\n this.changeTotalPrice(0);\r\n }\r\n return valid;\r\n }\r\n}\r\n\r\n// init on DOM ready\r\n$(function () {\r\n // create game\r\n onlineLotteries.setGame(new ExtraRenta(extraRentaConfig));\r\n onlineLotteries.dialog.setGameConfig(onlineLotteries.game.config);\r\n onlineLotteries.game.init();\r\n Loader.hide();\r\n});\r\n"],"names":["wagerStore","useWagerStore","ExtraRenta","Game","init","this","initInternal","qw","getQuickWager","selectQuickWager","isQuickWager","durationState","duration","draws","loadDurationFromQuery","config","Name","initDuration","initFromCookie","wager","Stake","stake","DefaultStake","recalculateTotalPrice","Numbers","length","onlineLotteries","dialog","open","quickWager","$","WrapperAllId","addClass","GameTypeId","removeClass","reset","Cookie","remove","columns","Wager","AddonEnabled","random","PrimaryCount","quickWagerDuration","initWager","updateWagerHtml","initAddButton","useSessionStorage","setItem","CookieFillingName","valid","wagerIsValid","price","i","Primary","Duration","changeTotalPrice","setGame","extraRentaConfig","setGameConfig","game","Loader","hide"],"sourceRoot":""}