@kalamba/sdk 0.9.1 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +11 -2
- package/dist/plugins.cjs +1 -1
- package/dist/plugins.d.ts +165 -7
- package/dist/plugins.js +1339 -1289
- package/dist/wrapper.cjs +1 -1
- package/dist/wrapper.d.ts +11 -2
- package/dist/wrapper.js +2 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -360,6 +360,7 @@ export declare type RgsErrorWithType = {
|
|
|
360
360
|
};
|
|
361
361
|
|
|
362
362
|
export declare type RgsOnlyMessagePayloadMap = {
|
|
363
|
+
error: SdkError;
|
|
363
364
|
openGameError: RgsErrorWithType;
|
|
364
365
|
openGameResponse: OpenGameResponse;
|
|
365
366
|
playError: RgsErrorWithType;
|
|
@@ -498,10 +499,16 @@ export declare type SdkOnlyMessagePayloadMap = {
|
|
|
498
499
|
* ```typescript
|
|
499
500
|
* {
|
|
500
501
|
* en: {
|
|
501
|
-
*
|
|
502
|
+
* my_custom_error: 'Something went wrong',
|
|
503
|
+
* RgsError: {
|
|
504
|
+
* OUT_OF_MONEY: 'You are out of credits',
|
|
505
|
+
* }
|
|
502
506
|
* },
|
|
503
507
|
* pl: {
|
|
504
|
-
*
|
|
508
|
+
* my_custom_error: 'Coś poszło nie tak',
|
|
509
|
+
* RgsError: {
|
|
510
|
+
* OUT_OF_MONEY: 'Nie masz już środków',
|
|
511
|
+
* }
|
|
505
512
|
* }
|
|
506
513
|
* }
|
|
507
514
|
* ```
|
|
@@ -566,6 +573,7 @@ export declare type ToTelemetryPluginsForwardedMessageMap = {
|
|
|
566
573
|
export declare type WrapperConfig = {
|
|
567
574
|
gameName: string;
|
|
568
575
|
gameVersion: string;
|
|
576
|
+
gameHistoryUrl?: string;
|
|
569
577
|
showFreeRounds: boolean;
|
|
570
578
|
showRealityCheck: boolean;
|
|
571
579
|
showErrors: boolean;
|
|
@@ -596,6 +604,7 @@ export declare type WrapperOnlyMessagePayloadMap = {
|
|
|
596
604
|
};
|
|
597
605
|
|
|
598
606
|
export declare type WrapperState = {
|
|
607
|
+
isSdkConfigured: boolean;
|
|
599
608
|
balance: number;
|
|
600
609
|
bet: Bet;
|
|
601
610
|
openGameResponse?: OpenGameResponse;
|
package/dist/plugins.cjs
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* BSD 3-Clause License
|
|
3
3
|
* Copyright (c) 2024, Kalamba Games Limited
|
|
4
4
|
*/
|
|
5
|
-
"use strict";var Vt=Object.defineProperty;var zt=(i,t,e)=>t in i?Vt(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var p=(i,t,e)=>(zt(i,typeof t!="symbol"?t+"":t,e),e),ct=(i,t,e)=>{if(!t.has(i))throw TypeError("Cannot "+e)};var y=(i,t,e)=>(ct(i,t,"read from private field"),e?e.call(i):t.get(i)),M=(i,t,e)=>{if(t.has(i))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(i):t.set(i,e)},k=(i,t,e,s)=>(ct(i,t,"write to private field"),s?s.call(i,e):t.set(i,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const De=require("./errors-358575c3.cjs"),dt=require("./noop-b3c54b76.cjs");function U(i,t){return(e,...s)=>{console.log(`[%c${i}\x1B[m] %s`,t,e,...s)}}function Rt(i,t){return Math.round(i*100/t)}class q{constructor(t,e){p(this,"config");p(this,"sdkConfig");this.config=t,this.sdkConfig=e}on(t,e,s){const n=function(a){a.data.message!==`kalamba:wrapper-casino:${t}`&&a.data.message!==`kalamba:wrapper:${t}`||e(a.data.payload)};window.addEventListener("message",n,s)}send(t,...[e]){window.postMessage({message:`kalamba:casino:${t}`,payload:e})}}const qt=U("BasicPlugin","color:#000000;font-weight:bold;");class Wt extends q{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),qt("configured")}registerToSdkEvents(){window.addEventListener("message",t=>{try{const{type:e,payload:s}=t.data;switch(e){case"doAudioSettings":this.send("settings",{music:s==null?void 0:s.musicEnabled,sounds:s==null?void 0:s.soundEnabled});return;case"doBalanceUpdate":const{currency:n,coinValueInCents:o}=this.sdkConfig.api;s.currency===n&&typeof s.balanceInCurrency=="number"?this.send("balance",{balance:Rt(s.balanceInCurrency,o)}):(s.balanceInCoins,this.send("balance",{balance:s.balanceInCoins}));return;case"doGamePause":this.send("freeze");return;case"doGameResume":this.send("unfreeze");return;case"doGameSuspend":this.send("suspend");return;default:return}}catch{}})}registerFromSdkEvents(){this.on("close",()=>{if(this.sdkConfig.api.homeUrl)try{window.top.location=this.sdkConfig.api.homeUrl}catch{window.location=this.sdkConfig.api.homeUrl}else try{window.top.history.back()}catch{window.history.back()}})}}const v=U("▼ DebuggingPlugin IN ▼","color:#444444;font-weight:bold;"),jt=U("▲ DebuggingPlugin OUT ▲","color:#444444;font-weight:bold;");class $t extends q{constructor(...t){super(...t),this.registerDebugToSdkEvents(),this.registerSdkToDebugEvents()}registerDebugToSdkEvents(){window.DebuggingPlugin={balance:t=>this._send("balance",t),bet:t=>this._send("bet",t),choice:t=>this._send("choice",t),close:t=>this._send("close",t),help:t=>this._send("help",t),history:t=>this._send("history",t),freeze:t=>this._send("freeze",t),paytable:t=>this._send("paytable",t),settings:t=>this._send("settings",t),suspend:t=>this._send("suspend",t),unfreeze:t=>this._send("unfreeze",t)}}registerSdkToDebugEvents(){this.on("autoplay",t=>v("autoplay",t)),this.on("balance",t=>v("balance",t)),this.on("bet",t=>v("bet",t)),this.on("cashier",t=>v("cashier",t)),this.on("choice",t=>v("choice",t)),this.on("close",t=>v("close",t)),this.on("error",t=>v("error",t)),this.on("loadEnd",t=>v("loadEnd",t)),this.on("loadProgress",t=>v("loadProgress",t)),this.on("loadStart",t=>v("loadStart",t)),this.on("playCycleStart",t=>v("playCycleStart",t)),this.on("playCycleEnd",t=>v("playCycleEnd",t)),this.on("playEnd",t=>v("playEnd",t)),this.on("playError",t=>v("playError",t)),this.on("playReady",t=>v("playReady",t)),this.on("playStart",t=>v("playStart",t)),this.on("settings",t=>v("settings",t))}_send(...t){jt(...t),this.send(...t)}}const Kt=U("GigPlugin","color:#000000;font-weight:bold;");class Qt extends q{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),Kt("configured")}postMessage(t){const e={event:t};window.top.postMessage(e,"*")}registerToSdkEvents(){window.addEventListener("message",t=>{try{const{data:e}=t;switch(e){case"STOP_AUTO_PLAY":this.send("suspend");return;case"BLOCK_BETS":this.send("freeze");return;case"UNBLOCK_BETS":this.send("unfreeze");return;default:return}}catch{}})}registerFromSdkEvents(){this.on("close",()=>{if(this.sdkConfig.api.homeUrl)try{window.top.location=this.sdkConfig.api.homeUrl}catch{window.location=this.sdkConfig.api.homeUrl}else try{window.top.history.back()}catch{window.history.back()}}),this.on("playReady",()=>{this.postMessage("GAME_READY")})}}const Xt=U("OryxPlugin","color:#000000;font-weight:bold;");class Jt extends q{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),Xt("configured")}registerToSdkEvents(){window.addEventListener("message",t=>{try{const{type:e,param:s}=t.data;switch(e){case"doBalanceUpdate":this.send("balance",{balance:s});return;case"doGamePause":this.send("freeze");return;case"doGameResume":this.send("unfreeze");return;case"doGameSuspend":this.send("suspend");return;default:return}}catch{}})}registerFromSdkEvents(){let t=0;this.on("close",()=>{window.top.postMessage({wpgaction:"close"},"*"),window.parent.postMessage({wpgaction:"close.parent"},"*")}),this.on("balance",({balance:e})=>{t!==e&&(t=e,window.top.postMessage({param:{},wpgaction:"balance"},"*"),window.parent.postMessage({param:{},wpgaction:"balance.parent"},"*"))}),this.on("loadStart",()=>{window.top.postMessage({wpgaction:"loadStart"},"*"),window.parent.postMessage({wpgaction:"loadStart.parent"},"*")}),this.on("loadEnd",()=>{window.top.postMessage({wpgaction:"loadEnd"},"*"),window.parent.postMessage({wpgaction:"loadEnd.parent"},"*")}),this.on("playStart",()=>{window.top.postMessage({wpgaction:"gameSpinStart"},"*"),window.parent.postMessage({wpgaction:"gameSpinStart.parent"},"*")}),this.on("playEnd",()=>{window.top.postMessage({wpgaction:"gameSpinEnd"},"*"),window.parent.postMessage({wpgaction:"gameSpinEnd.parent"},"*")}),this.on("cashier",({type:e})=>{switch(e){case"BALANCE_LOW":window.top.postMessage({wpgaction:"cashier"},"*"),window.parent.postMessage({wpgaction:"cashier.parent"},"*");break;case"BALANCE_INSUFFICIENT":window.top.postMessage({wpgaction:"errorOutOfMoney"},"*"),window.parent.postMessage({wpgaction:"errorOutOfMoney.parent"},"*");break}})}}const lt=U("PariplayPlugin","color:#000000;font-weight:bold;");function He(i){try{window.top.location=i}catch{window.location=i}}function Ve(i,t){return new Promise(function(s,n){const o=new XMLHttpRequest;o.onload=function(){o.status>=200&&o.status<300?s(o.responseText):n(o.responseText)},o.open(i,t),o.send()})}function ze(){}function Yt(i){return i.filter(function(e){return e.messageType.toUpperCase()==="DATA"})}function qe(i){return i.filter(function(e){return["NOTIFICATION","POPUP"].includes(e.messageType.toUpperCase())})}function _t(i){try{return JSON.parse(i.text)}catch{return{}}}function Zt(i){return i.map(_t).filter(Boolean).find(function(e){return e.betId!=null&&e.winId!=null})||{}}function ei(i){return i.map(_t).filter(Boolean).find(function(e){return e.TotalBet!=null&&e.TotalWin!=null})||{}}class ti extends q{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),lt("configured")}postMessage(t,e){const s={lang:this.sdkConfig.ui.language,sender:this.sdkConfig.api.game,type:t};e!=null&&(s.data=e),lt("postMessage",s),window.parent.postMessage(s,"*")}coinsToCurrency(t){return t*this.sdkConfig.api.coinValueInCents/100}handleContinueButton(t,e){t.link&&Ve("GET",t.link),e()}handleLinkButton(t,e){switch(t.linkType.toUpperCase()){case"AJAX":Ve("GET",t.link),e();return;case"AJAXRESPONSE":Ve("GET",t.link).then(()=>{e()});return;case"REDIRECT":He(t.link),e();return}}handleQuitButton(t,e){this.send("close"),e()}handleCashierButton(t,e){this.send("cashier",{type:"ON_DEMAND"}),e()}handleHistoryButton(t,e){this.send("history",{source:"casino"}),e()}get buttonActions(){return{CASHIER:this.handleCashierButton,CONTINUE:this.handleContinueButton,HISTORY:this.handleHistoryButton,LINK:this.handleLinkButton,QUIT:this.handleQuitButton}}processInfoUiMessages(t){return t.reduce((e,s)=>e.then(()=>new Promise(n=>{Object.assign({},s,{buttons:s.buttons.filter(o=>o.action.toUpperCase()==="CASHIER"?!!this.sdkConfig.api.cashierUrl:!0).map(o=>Object.assign({},o,{onRelease:()=>{const a=s.messageType.toUpperCase()==="POPUP"?ze:n,h=this.buttonActions[o.action.toUpperCase()];h?h(o,a):a()}}))})}).catch(ze)),Promise.resolve()).then(()=>{}).catch(ze)}registerToSdkEvents(){window.addEventListener("message",t=>{try{const{type:e}=t.data;switch(e){case"pause":case"disableSpin":this.send("freeze");return;case"resume":case"enableSpin":this.send("unfreeze");return;case"stopAutobet":this.send("suspend");return;default:return}}catch{}})}registerFromSdkEvents(){let t=0;this.on("openGameResponse",e=>{let s;try{const n=JSON.parse(JSON.parse(atob(this.sdkConfig.api.integrationData.token.split(".")[1])).token),o=JSON.parse(n.integrationSpecificAttributes.sessionData||"{}");s={ClientToken:n.integrationSpecificAttributes.clientToken,CurrencyCode:n.currency,PlayerTokenId:n.user,SessionData:o}}catch{s=void 0}this.postMessage("gameDataLoaded",{LoadGameData:s,success:!0});try{const n=qe(e.contract.uiMessages);this.processInfoUiMessages(n)}catch{}}),this.on("balance",({balance:e})=>{t!==e&&(t=e,this.postMessage("balance",{amount:this.coinsToCurrency(e)}))}),this.on("close",()=>{if(this.sdkConfig.api.homeUrl)if(this.sdkConfig.api.homeUrl==="(back)")try{window.top.history.back()}catch{window.history.back()}else this.sdkConfig.api.homeUrl==="(api)"?this.postMessage("quit"):He(this.sdkConfig.api.homeUrl)}),this.on("playEnd",e=>{this.postMessage("roundEnded",{balanceAfter:this.coinsToCurrency(e.contract.balance.coins),win:this.coinsToCurrency(e.contract.win.round)});try{const s=qe(e.contract.uiMessages);this.processInfoUiMessages(s)}catch{}}),this.on("playError",e=>{var s,n;this.postMessage("ticketReceived",{ErrorCode:(s=e.data)==null?void 0:s.code,ErrorMessage:"ERROR",Status:{ErrCode:(n=e.data)==null?void 0:n.code}})}),this.on("playResponse",e=>{this.postMessage("roundStarted",{balanceBefore:this.coinsToCurrency(e.contract.balance.coins+e.contract.bet.lastPaid.base*e.contract.bet.lastPaid.multiplier)});const s=["BaseGame","PaidSpin"].includes(e.contract.stateType.thisRound),n=Yt(e.contract.uiMessages),o=qe(e.contract.uiMessages),a=Zt(n),h=ei(n);this.postMessage("ticketReceived",{Balance:this.coinsToCurrency(e.contract.balance.coins),BetAmount:s?this.coinsToCurrency(e.contract.bet.lastPaid.base*e.contract.bet.lastPaid.multiplier):0,CreditTransactionId:a.betId,DebitTransactionId:a.winId,Message:o,SessionData:h,Status:{ErrCode:0},WinAmount:this.coinsToCurrency(e.contract.win.round)})}),this.on("playStart",e=>{e.bet&&this.postMessage("roundStart",{totalBet:this.coinsToCurrency(e.bet.base*e.bet.multiplier)})}),this.on("loadEnd",()=>{this.postMessage("gameReady")}),this.on("loadStart",()=>{this.postMessage("onAppFrameReady")}),this.on("cashier",()=>{this.sdkConfig.api.cashierUrl&&(this.sdkConfig.api.cashierUrl==="(api)"?this.postMessage("cashier"):He(this.sdkConfig.api.cashierUrl))})}}const ge=U("RelaxFEIMPlugin","color:#000000;font-weight:bold;");class ii extends q{constructor(...e){super(...e);p(this,"VERSION","1.15.0");const s=document.createElement("script");s.src=`https://d3nsdzdtjbr5ml.cloudfront.net/casino/relaxlibs/feim/${this.VERSION}/rlxfeim.min.js`,s.onload=()=>{ge("loaded"),window.FEIM.configure({p2pConfig:{currency:this.sdkConfig.api.currency,launchParams:{homeurl:"homeUrl"}}}),ge("configured"),this.registerToSdkEvents(),this.registerFromSdkEvents()},document.body.appendChild(s)}registerToSdkEvents(){window.FEIM.on.errorMessageDismissed(()=>this.send("unfreeze")),window.FEIM.on.errorMessageDisplayed(()=>this.send("freeze")),window.FEIM.on.exitingGame(()=>ge("!!! NOT IMPLEMENTED: exitingGame !!!")),window.FEIM.on.freeze(()=>this.send("freeze")),window.FEIM.on.initialized(()=>ge("!!! NOT IMPLEMENTED: initialized !!!")),window.FEIM.on.pauseAutoPlay(()=>this.send("suspend")),window.FEIM.on.refreshBalance(()=>ge("!!! NOT IMPLEMENTED: refreshBalance !!!")),window.FEIM.on.toggleGameHelp(()=>{this.send("help",{})}),window.FEIM.on.togglePaytable(()=>{this.send("paytable",{})}),window.FEIM.on.unfreeze(()=>this.send("unfreeze")),window.FEIM.on.updateSettings(({payload:[e]})=>this.send("settings",{sounds:e.sounds,fastPlay:e.fastPlay}))}registerFromSdkEvents(){this.on("autoplay",({action:e})=>{switch(e){case"start":window.FEIM.send.autoPlayStarted();break;case"stop":window.FEIM.send.autoPlayFinished();break}}),this.on("balance",({balance:e})=>{window.FEIM.send.balanceUpdate(e)}),this.on("bet",({base:e,multiplier:s})=>{window.FEIM.send.betUpdate(e*s)}),this.on("error",({message:e})=>{window.FEIM.send.errorMessage(e)}),this.on("close",()=>{window.FEIM.send.exitGame()}),this.on("loadEnd",()=>{window.FEIM.send.gameLoadCompleted()}),this.on("loadProgress",({progress:e})=>{window.FEIM.send.gameLoadProgress(e)}),this.on("loadStart",()=>{window.FEIM.send.gameLoadStarted()}),this.on("cashier",()=>{window.FEIM.send.openQuickDeposit()}),this.on("playCycleEnd",e=>{const s={balance:e.contract.balance.coins,bet:e.contract.bet.lastPaid.base*e.contract.bet.lastPaid.multiplier,win:{win:e.contract.win.total}};window.FEIM.send.roundFinished(s)}),this.on("playResponse",e=>{const s={balance:e.contract.balance.coins,playResponse:e.data};window.FEIM.send.roundStarted(s)}),this.on("history",()=>{window.FEIM.send.showHistory()}),this.on("settings",e=>{window.FEIM.send.updateSettings(e)})}}const We=U("TukoPlugin","color:#000000;font-weight:bold;");class si extends q{constructor(...e){super(...e);p(this,"PING_INTERVAL",1e4);const n=new URLSearchParams(window.location.search).get("pingCallbackUrl");n&&window.setInterval(()=>{this.ping(n)},this.PING_INTERVAL),this.registerToSdkEvents(),this.registerFromSdkEvents(),We("configured")}ping(e){const s=new XMLHttpRequest;s.onreadystatechange=function(){s.readyState===XMLHttpRequest.DONE&&(s.status===0||s.status>=200&&s.status<400?We("ping ok",s):We("ping error",s))},s.open("GET",e),s.send()}registerToSdkEvents(){window.addEventListener("message",e=>{try{const{type:s,payload:n}=e.data;switch(s){case"doAudioSettings":this.send("settings",{music:n==null?void 0:n.musicEnabled,sounds:n==null?void 0:n.soundEnabled});return;case"doBalanceUpdate":const{currency:o,coinValueInCents:a}=this.sdkConfig.api;n.currency===o&&typeof n.balanceInCurrency=="number"?this.send("balance",{balance:Rt(n.balanceInCurrency,a)}):(n.balanceInCoins,this.send("balance",{balance:n.balanceInCoins}));return;case"doGamePause":this.send("freeze");return;case"doGameResume":this.send("unfreeze");return;case"doGameSuspend":this.send("suspend");return;default:return}}catch{}})}registerFromSdkEvents(){this.on("close",()=>{if(this.sdkConfig.api.homeUrl)try{window.top.location=this.sdkConfig.api.homeUrl}catch{window.location=this.sdkConfig.api.homeUrl}else try{window.top.history.back()}catch{window.history.back()}})}}class Ft{constructor(t,e){p(this,"config");p(this,"sdkConfig");this.config=t,this.sdkConfig=e}on(t,e,s){const n=function(a){a.data.message!==`kalamba:wrapper-rgs:${t}`&&a.data.message!==`kalamba:wrapper:${t}`||e(a.data.payload)};window.addEventListener("message",n,s)}send(t,...[e]){window.postMessage({message:`kalamba:rgs:${t}`,payload:e})}}class ni{constructor(t){p(this,"socket",null);p(this,"webSocketUrl");p(this,"eventListeners",{close:[],error:[],message:[]});p(this,"connect",()=>{const t=new WebSocket(this.webSocketUrl);return t.addEventListener("message",this.handleMessage),new Promise(e=>{t.addEventListener("open",s=>{this.handleOpen(s),e(this.socket)})})});p(this,"send",t=>{if(this.socket==null)throw new Error("Cannot send message, the WebSocket connection is not open");this.socket.send(t)});p(this,"close",()=>{if(this.socket==null)throw new Error("Cannot close the WebSocket connection that is not open");this.socket.close(),this.addEventListener("error",t=>{console.log(t)})});p(this,"handleClose",t=>{this.eventListeners.close.forEach(e=>{e(t)})});p(this,"handleError",t=>{this.eventListeners.error.forEach(e=>{e(t)})});p(this,"handleMessage",t=>{this.eventListeners.message.forEach(e=>{e(t)})});p(this,"handleOpen",t=>{const e=t.target;e.addEventListener("close",this.handleClose),e.addEventListener("error",this.handleError),this.socket=e});this.webSocketUrl=t}addEventListener(t,e){this.eventListeners[t].push(e)}removeEventListener(t,e){const s=this.eventListeners[t].indexOf(e);s!==-1&&this.eventListeners[t].splice(s,1)}}function Me(i){return JSON.parse(i==null?void 0:i.data)}function ai(i){var t;return((t=i==null?void 0:i.header)==null?void 0:t.name)==="Ping"}function ut(i){var t;return((t=i==null?void 0:i.header)==null?void 0:t.name)==="RealityCheck"}function Le(i){return i.header.name==="GameEvent"}function oi(i){return Le(i)&&i.body.event==="OPEN_GAME"}function ht(i){return i.header.code!==1}function ri(i){return Le(i)&&i.body.event.includes("_RESULT")}var ie,ke;class ci extends ni{constructor(e,s){const n=new URL(e.apiUrl);n.searchParams.set("cageCode",e.cageCode),n.searchParams.set("gameCode",e.gameCode),n.searchParams.set("operatorCode",e.operatorCode),n.searchParams.set("playMode",e.playMode),n.searchParams.set("token",e.token),n.searchParams.set("username",e.username);super(n.toString());p(this,"cId",0);p(this,"mId",0);p(this,"seqId",10);p(this,"gameCode");M(this,ie,void 0);M(this,ke,void 0);p(this,"onMessage",e=>{const s=Me(e);(Le(s)||ai(s)||ut(s))&&this.sendAcknowledgement(s),ut(s)&&this.handleRealityCheck(s)});this.eventListeners.realityCheck=[],this.gameCode=e.gameCode,k(this,ie,s.requestTimeoutMs),k(this,ke,s.gameVersion??"unknown"),this.addEventListener("message",this.onMessage)}handleRealityCheck(e){this.eventListeners.realityCheck.forEach(s=>{s(e.body)})}addEventListener(e,s){super.addEventListener(e,s)}removeEventListener(e,s){super.removeEventListener(e,s)}buildHeader(e,s=null){return{cId:s??++this.cId,code:s!==null?1:void 0,mId:++this.mId,name:e}}buildPayload(e,s){return JSON.stringify({body:s,header:e})}getBodyExtras(e){return{action:e,seqId:++this.seqId}}request(e,s){const n=this.buildPayload(e,s);return new Promise((o,a)=>{setTimeout(()=>a({type:"timeout"}),y(this,ie));const h=g=>{const w=Me(g);try{e.cId===w.header.cId&&(this.removeEventListener("message",h),w.header.code===1?o(w):a({message:w,type:"error"}))}catch{a({message:w,type:"error"})}};this.addEventListener("message",h),this.send(n)})}freeRounds(e){const s=this.buildHeader("ActivateFreeRound");return this.request(s,e).then(n=>n.body).catch(n=>{var o;throw{data:(o=n==null?void 0:n.message)==null?void 0:o.body,type:n.type}})}authenticate(e=!1){const s=this.buildHeader("Authenticate"),n={clientType:3,version:y(this,ke),reconnect:e};return this.request(s,n).then(o=>o.body).catch(o=>{var a;throw{data:(a=o==null?void 0:o.message)==null?void 0:a.body,type:o.type}})}openGame(){const e=this.buildHeader("OpenGame"),s={gameCode:this.gameCode};return new Promise((n,o)=>{const a=h=>{const g=Me(h);oi(g)?(this.removeEventListener("message",a),n(g.body)):ht(g)&&o({data:g.body,type:"error"})};this.addEventListener("message",a),this.request(e,s).catch(h=>{var g;return o({data:(g=h==null?void 0:h.message)==null?void 0:g.body,type:h.type})})})}sendAcknowledgement(e){const{name:s,cId:n}=e.header,o=this.buildHeader(s,n),a=this.buildPayload(o,{});this.send(a)}sendAction(e,s){const n=this.buildHeader("GameAction"),o={...this.getBodyExtras(e),data:s};return new Promise((a,h)=>{const g=w=>{const m=Me(w);Le(m)&&o.seqId===m.body.correlationSeqId&&(this.removeEventListener("message",g),ri(m)?a(m.body):ht(m)&&h({data:m.body,type:"error"}))};this.addEventListener("message",g),this.request(n,o).catch(w=>{var m;return h({data:(m=w==null?void 0:w.message)==null?void 0:m.body,type:w.type})})})}setRequestTimeoutMs(e){k(this,ie,e)}}ie=new WeakMap,ke=new WeakMap;function di(i){return i.contract?{contract:{balance:{coins:i.contract.balance,version:i.contract.balanceVersion},coinValueInCents:i.contract.coinValueInCents,country:i.contract.countryCode,currency:i.contract.currencyCode,jurisdiction:i.contract.jurisdictionCode,uiMessages:i.contract.uiMessages,username:i.contract.username}}:{contract:{balance:{coins:i.balance,version:i.balanceVersion},coinValueInCents:i.coinValueInCents,country:i.countryCode,currency:i.currencyCode,jurisdiction:i.jurisdictionCode,uiMessages:i.uiMessages,username:i.username}}}function li(i){var t,e;return{code:((t=i.data)==null?void 0:t.code)??De.RgsErrorCode.UNKNOWN,details:(e=i.data)==null?void 0:e.details}}function ui(i,t){const e=t.contract;if(!e){const s=t.data;return{contract:{bet:{available:s.additionalConfigData.availableMultipliersPerBaseBet,default:{base:s.additionalConfigData.defaultBet.baseBet,multiplier:s.additionalConfigData.defaultBet.betMultiplier},max:s.additionalConfigData.maxAllowedOverallBetInCoins,last:s.gameState.betFromCurrentRound?{base:s.gameState.betFromCurrentRound.baseBet,multiplier:s.gameState.betFromCurrentRound.betMultiplier}:null,lastPaid:s.gameState.lastPlacedMainGameBet?{base:s.gameState.lastPlacedMainGameBet.baseBet,multiplier:s.gameState.lastPlacedMainGameBet.betMultiplier}:null},balance:{coins:t.balance,version:t.balanceVersion},freeRounds:(s.FREE_ROUNDS??[]).map(n=>({conf:{base:n.conf.baseBet,multiplier:n.conf.betMultiplier,numAwarded:n.conf.numAwarded},data:{numPlayed:n.data.numPlayed,win:n.data.winAmount,numLeft:n.data.numLeft},id:n.id,rejectable:n.rejectable,skippable:n.skippable,status:n.status,type:n.type})),gameModel:s.additionalConfigData.gameModelFile,metaData:s.gameConfigData.metaData,roundId:s.gameState.cycleId,serverTime:t.balanceVersion,sessionId:s.gameState.sessionId,stateType:{thisRound:s.gameState.stateTypeThisRound,nextRound:s.gameState.stateTypeNextRound},uiMessages:i.uiMessages,win:{round:s.gameState.totalWinFromCurrentRound,total:s.gameState.totalWinFromCurrentGameCycle}},data:s}}return{contract:{bet:{available:e.availableMultipliersPerBaseBet,default:{base:e.defaultBet.baseBet,multiplier:e.defaultBet.betMultiplier},max:e.maxBetInCoins,last:e.lastBet?{base:e.lastBet.baseBet,multiplier:e.lastBet.betMultiplier}:null,lastPaid:e.lastMainGameBet?{base:e.lastMainGameBet.baseBet,multiplier:e.lastMainGameBet.betMultiplier}:null},balance:{coins:e.balanceInCoins,version:e.balanceVersion},freeRounds:(e.freeRounds??[]).map(s=>({conf:{base:s.conf.baseBet,multiplier:s.conf.betMultiplier,numAwarded:s.conf.numAwarded},data:{numPlayed:s.data.numPlayed,win:s.data.winAmount,numLeft:s.data.numLeft},id:s.id,rejectable:s.rejectable,skippable:s.skippable,status:s.status,type:s.type})),gameModel:e.gameModelFile,metaData:e.metaData,roundId:e.roundId,serverTime:e.serverTime,sessionId:e.sessionId,stateType:{thisRound:e.stateTypeThisRound,nextRound:e.stateTypeNextRound},uiMessages:i.contract.uiMessages.concat(e.uiMessages),win:{round:e.roundWin,total:e.totalWin}},data:t.opaqueGameServerToUi}}function hi(i){var t,e;return{code:((t=i.data)==null?void 0:t.code)??De.RgsErrorCode.UNKNOWN,details:(e=i.data)==null?void 0:e.details}}function gi(i){const t=i.contract;if(!t){const e=i.data;return{contract:{bet:{last:e.gameState.betFromCurrentRound?{base:e.gameState.betFromCurrentRound.baseBet,multiplier:e.gameState.betFromCurrentRound.betMultiplier}:null,lastPaid:{base:e.gameState.lastPlacedMainGameBet.baseBet,multiplier:e.gameState.lastPlacedMainGameBet.betMultiplier}},balance:{coins:i.balance,version:i.balanceVersion},freeRounds:(e.FREE_ROUNDS??[]).map(s=>({conf:{base:s.conf.baseBet,multiplier:s.conf.betMultiplier,numAwarded:s.conf.numAwarded},data:{numPlayed:s.data.numPlayed,win:s.data.winAmount,numLeft:s.data.numLeft},id:s.id,rejectable:s.rejectable,skippable:s.skippable,status:s.status,type:s.type})),serverTime:i.balanceVersion,roundId:e.gameState.cycleId,stateType:{thisRound:e.gameState.stateTypeThisRound,nextRound:e.gameState.stateTypeNextRound},uiMessages:e.uiMessages,win:{round:e.gameState.totalWinFromCurrentRound,total:e.gameState.totalWinFromCurrentGameCycle}},data:e}}return{contract:{bet:{last:i.contract.lastBet?{base:i.contract.lastBet.baseBet,multiplier:i.contract.lastBet.betMultiplier}:null,lastPaid:{base:i.contract.lastMainGameBet.baseBet,multiplier:i.contract.lastMainGameBet.betMultiplier}},balance:{coins:i.contract.balanceInCoins,version:i.contract.balanceVersion},freeRounds:(t.freeRounds??[]).map(e=>({conf:{base:e.conf.baseBet,multiplier:e.conf.betMultiplier,numAwarded:e.conf.numAwarded},data:{numPlayed:e.data.numPlayed,win:e.data.winAmount,numLeft:e.data.numLeft},id:e.id,rejectable:e.rejectable,skippable:e.skippable,status:e.status,type:e.type})),serverTime:i.contract.serverTime,roundId:i.contract.roundId,stateType:{thisRound:i.contract.stateTypeThisRound,nextRound:i.contract.stateTypeNextRound},uiMessages:i.contract.uiMessages,win:{round:i.contract.roundWin,total:i.contract.totalWin}},data:i.opaqueGameServerToUi}}function pi(i){var t,e;return{code:((t=i.data)==null?void 0:t.code)??De.RgsErrorCode.UNKNOWN,details:(e=i.data)==null?void 0:e.details}}const wi={bul:"bg",chi:"zh",zho:"zh",hrv:"hr",cze:"cs",dan:"da",dut:"nl",eng:"en",est:"et",fin:"fi",fra:"fr",ger:"de",gre:"el",hun:"hu",ind:"id",ita:"it",jpn:"ja",kor:"ko",nor:"no",pol:"pl",por:"pt",rum:"ro",rus:"ru",srp:"sr",slo:"sk",spa:"es",swe:"sv",tha:"th",tur:"tr",ukr:"uk",vie:"vi"},mi=U("KalambaBullseyePlugin","color:#000000;font-weight:bold;");class bi extends Ft{constructor(...e){super(...e);p(this,"socket");this.on("openGame",async()=>{try{const s=await this.openGame();this.send("openGameResponse",s)}catch(s){this.send("openGameError",s)}}),this.on("play",async s=>{try{const n=await this.play(s);this.send("playResponse",n)}catch(n){this.send("playError",n)}}),this.on("freeRounds",async s=>{try{await this.socket.freeRounds(s),this.send("freeRoundsResponse",s)}catch(n){this.send("freeRoundsError",n)}}),this.on("configured",s=>{this.socket.setRequestTimeoutMs(s.ui.requestTimeoutMs)}),this.registerFromSdkEvents()}initialize(e){this.socket=new ci(e,{gameVersion:this.config.gameVersion,requestTimeoutMs:this.sdkConfig.ui.requestTimeoutMs}),this.socket.addEventListener("close",s=>{s.code===1006&&this.reconnect(e)}),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&this.socket.socket&&this.socket.socket.readyState!==WebSocket.OPEN&&this.reconnect(e)}),this.socket.addEventListener("error",s=>mi("error",s)),this.socket.addEventListener("realityCheck",s=>{this.send("realityCheck",s)})}async reconnect(e){this.initialize(e),await this.socket.connect(),await this.socket.authenticate(!0),await this.socket.openGame()}async openGame(){const e=new URLSearchParams(window.location.search),s=e.get("apiUrl"),n=e.get("cageCode"),o=e.get("gameCode"),a=e.get("operatorCode"),h=e.get("playMode"),g=e.get("token"),w=e.get("username"),m=e.get("gameHistoryUrl"),C=e.get("homeUrl")??void 0,N=e.get("cashierUrl")??void 0;this.initialize({apiUrl:s,cageCode:n,gameCode:o,operatorCode:a,playMode:h,token:g,username:w});try{await this.socket.connect()}catch{throw{type:"error",data:{code:De.RgsErrorCode.CONNECTION_ERROR}}}let K;try{K=await this.socket.authenticate()}catch(B){throw{type:B.type,data:B.type==="error"?li(B.data):void 0}}let Q;try{Q=await this.socket.openGame()}catch(B){throw{type:B.type,data:B.type==="error"?hi(B.data):void 0}}const L=di(K),he=ui(K,Q);this.sdkConfig.api={brand:n,game:o,integration:a,jurisdiction:L.contract.jurisdiction,playMode:h,user:L.contract.username,integrationData:{token:g},country:L.contract.country,currency:L.contract.currency,coinValueInCents:L.contract.coinValueInCents,gameHistoryUrl:m,homeUrl:C,cashierUrl:N,sessionId:he.contract.sessionId,lastRoundId:he.contract.roundId};const x=e.get("languageCode");return x&&(this.sdkConfig.ui.language=x.length===3?wi[x]??x:x),he}async play(e){const{contract:{bet:s,forcedOutcomes:n,...o},extra:a,payloadToInject:h,actionType:g}=e,w={bet:s?{baseBet:s.base,betMultiplier:s.multiplier}:void 0,forcedOutcomes:n,...o,...h,opaqueUiToGameServer:a};let m;try{m=await this.socket.sendAction(g,w)}catch(C){throw{type:C.type,data:C.type==="error"?pi(C.data):void 0}}return gi(m)}registerFromSdkEvents(){this.on("history",()=>{const{api:{game:e,integration:s,integrationData:n,jurisdiction:o,user:a,gameHistoryUrl:h},ui:{language:g}}=this.sdkConfig,w=a.replace(/^user_/,"").replace(new RegExp(`_${s}$`),""),m=new URL(h);m.searchParams.set("gameCode",e),m.searchParams.set("jurisdiction",o),m.searchParams.set("operatorCode",s),m.searchParams.set("token",n.token),m.searchParams.set("username",w),m.searchParams.set("languageCode",g),window.open(m.toString(),"_blank")})}}var fi="2.0.0-beta.2",de="",gt="?",Ye="function",V="undefined",le="object",Ze="string",fe="major",d="model",r="name",l="type",u="vendor",c="version",S="architecture",Z="console",b="mobile",f="tablet",T="smarttv",Y="wearable",et="embedded",pt="user-agent",tt=500,nt="brands",j="formFactor",at="fullVersionList",ee="platform",ot="platformVersion",Ne="bitness",W="sec-ch-ua",yi=W+"-full-version-list",ki=W+"-arch",vi=W+"-"+Ne,Ei=W+"-form-factor",Ci=W+"-"+b,Mi=W+"-"+d,Dt=W+"-"+ee,Si=Dt+"-version",Nt=[nt,at,b,d,ee,ot,S,j,Ne],P="browser",R="cpu",O="device",_="engine",A="os",te="result",Se="Amazon",pe="Apple",wt="ASUS",mt="BlackBerry",Ie="Google",bt="Huawei",ft="Lenovo",je="LG",Ue="Microsoft",yt="Motorola",Te="Samsung",kt="Sharp",Pe="Sony",$e="Xiaomi",Ke="Zebra",X="Mobile ",J=" Browser",Ae="Chrome",Ii="Edge",we="Firefox",me="Opera",vt="Facebook",Et="Sogou",it="Windows",Ti=typeof window!==V,I=Ti&&window.navigator?window.navigator:void 0,G=I&&I.userAgentData?I.userAgentData:void 0,Pi=function(i,t){var e={};for(var s in i)e[s]=t[s]&&t[s].length%2===0?t[s].concat(i[s]):i[s];return e},Ge=function(i){for(var t={},e=0;e<i.length;e++)t[i[e].toUpperCase()]=i[e];return t},st=function(i,t){if(typeof i===le&&i.length>0){for(var e in i)if(z(i[e])==z(t))return!0;return!1}return ue(i)?z(t).indexOf(z(i))!==-1:!1},Ct=function(i){for(var t in i)return/^(browser|cpu|device|engine|os)$/.test(t)},ue=function(i){return typeof i===Ze},Qe=function(i){if(i){for(var t=[],e=$(/\\?\"/g,i).split(","),s=0;s<e.length;s++)if(e[s].indexOf(";")>-1){var n=ye(e[s]).split(";v=");t[s]={brand:n[0],version:n[1]}}else t[s]=ye(e[s]);return t}},z=function(i){return ue(i)?i.toLowerCase():i},Xe=function(i){return ue(i)?$(/[^\d\.]/g,i).split(".")[0]:void 0},F=function(i){for(var t in i){var e=i[t];typeof e==le&&e.length==2?this[e[0]]=e[1]:this[e]=void 0}return this},$=function(i,t){return ue(t)?t.replace(i,de):t},be=function(i){return $(/\\?\"/g,i)},ye=function(i,t){if(ue(i))return i=$(/^\s\s*/,i),typeof t===V?i:i.substring(0,tt)},Mt=function(i,t){if(!(!i||!t))for(var e=0,s,n,o,a,h,g;e<t.length&&!h;){var w=t[e],m=t[e+1];for(s=n=0;s<w.length&&!h&&w[s];)if(h=w[s++].exec(i),h)for(o=0;o<m.length;o++)g=h[++n],a=m[o],typeof a===le&&a.length>0?a.length===2?typeof a[1]==Ye?this[a[0]]=a[1].call(this,g):this[a[0]]=a[1]:a.length===3?typeof a[1]===Ye&&!(a[1].exec&&a[1].test)?this[a[0]]=g?a[1].call(this,g,a[2]):void 0:this[a[0]]=g?g.replace(a[1],a[2]):void 0:a.length===4&&(this[a[0]]=g?a[3].call(this,g.replace(a[1],a[2])):void 0):this[a]=g||void 0;e+=2}},Be=function(i,t){for(var e in t)if(typeof t[e]===le&&t[e].length>0){for(var s=0;s<t[e].length;s++)if(st(t[e][s],i))return e===gt?void 0:e}else if(st(t[e],i))return e===gt?void 0:e;return t.hasOwnProperty("*")?t["*"]:i},St={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},It={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:["VR","XR","Watch"],"?":["Desktop","Unknown"],"*":void 0},Tt={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[c,[r,X+"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[c,[r,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[r,c],[/opios[\/ ]+([\w\.]+)/i],[c,[r,me+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[c,[r,me+" GX"]],[/\bopr\/([\w\.]+)/i],[c,[r,me]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[c,[r,"Baidu"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[r,c],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[c,[r,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[c,[r,"WeChat"]],[/konqueror\/([\w\.]+)/i],[c,[r,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[c,[r,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[c,[r,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[c,[r,"Smart "+ft+J]],[/(avast|avg)\/([\w\.]+)/i],[[r,/(.+)/,"$1 Secure"+J],c],[/\bfocus\/([\w\.]+)/i],[c,[r,we+" Focus"]],[/\bopt\/([\w\.]+)/i],[c,[r,me+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[c,[r,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[c,[r,"Dolphin"]],[/coast\/([\w\.]+)/i],[c,[r,me+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[c,[r,"MIUI"+J]],[/fxios\/([\w\.-]+)/i],[c,[r,X+we]],[/\bqihu|(qi?ho?o?|360)browser/i],[[r,"360"+J]],[/(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i],[[r,/(.+)/,"$1"+J],c],[/samsungbrowser\/([\w\.]+)/i],[c,[r,Te+" Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[r,/_/g," "],c],[/metasr[\/ ]?([\d\.]+)/i],[c,[r,Et+" Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[r,Et+" Mobile"],c],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[r,c],[/(lbbrowser)/i,/\[(linkedin)app\]/i],[r],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[r,vt],c],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[r,c],[/\bgsa\/([\w\.]+) .*safari\//i],[c,[r,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[c,[r,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[c,[r,Ae+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[r,Ae+" WebView"],c],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[c,[r,"Android"+J]],[/chrome\/([\w\.]+) mobile/i],[c,[r,X+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[r,c],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[c,[r,X+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[r,X+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[c,r],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[r,[c,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[r,c],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[r,X+we],c],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[r,"Netscape"],c],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[c,[r,we+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[r,c],[/(cobalt)\/([\w\.]+)/i],[r,[c,/[^\d\.]+./,de]]],cpu:[[/\b(?:(amd|x|x86[-_]?|wow|win)64)\b/i],[[S,"amd64"]],[/(ia32(?=;))/i,/((?:i[346]|x)86)[;\)]/i],[[S,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[S,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[S,"armhf"]],[/windows (ce|mobile); ppc;/i],[[S,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[S,/ower/,de,z]],[/(sun4\w)[;\)]/i],[[S,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[S,z]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[d,[u,Te],[l,f]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[d,[u,Te],[l,b]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[d,[u,pe],[l,b]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[d,[u,pe],[l,f]],[/(macintosh);/i],[d,[u,pe]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[d,[u,kt],[l,b]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[d,[u,bt],[l,f]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[d,[u,bt],[l,b]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[d,/_/g," "],[u,$e],[l,b]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[d,/_/g," "],[u,$e],[l,f]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[d,[u,"OPPO"],[l,b]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[d,[u,"Vivo"],[l,b]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[d,[u,"Realme"],[l,b]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[d,[u,yt],[l,b]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[d,[u,yt],[l,f]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[d,[u,je],[l,f]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[d,[u,je],[l,b]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[d,[u,ft],[l,f]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[d,/_/g," "],[u,"Nokia"],[l,b]],[/(pixel c)\b/i],[d,[u,Ie],[l,f]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[d,[u,Ie],[l,b]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[d,[u,Pe],[l,b]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[d,"Xperia Tablet"],[u,Pe],[l,f]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[d,[u,"OnePlus"],[l,b]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[d,[u,Se],[l,f]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[d,/(.+)/g,"Fire Phone $1"],[u,Se],[l,b]],[/(playbook);[-\w\),; ]+(rim)/i],[d,u,[l,f]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[d,[u,mt],[l,b]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[d,[u,wt],[l,f]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[d,[u,wt],[l,b]],[/(nexus 9)/i],[d,[u,"HTC"],[l,f]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[u,[d,/_/g," "],[l,b]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[d,[u,"Acer"],[l,f]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[d,[u,"Meizu"],[l,b]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[d,[u,"Ulefone"],[l,b]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[u,d,[l,b]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[u,d,[l,f]],[/(surface duo)/i],[d,[u,Ue],[l,f]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[d,[u,"Fairphone"],[l,b]],[/(shield[\w ]+) b/i],[d,[u,"Nvidia"],[l,f]],[/(sprint) (\w+)/i],[u,d,[l,b]],[/(kin\.[onetw]{3})/i],[[d,/\./g," "],[u,Ue],[l,b]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[d,[u,Ke],[l,f]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[d,[u,Ke],[l,b]],[/smart-tv.+(samsung)/i],[u,[l,T]],[/hbbtv.+maple;(\d+)/i],[[d,/^/,"SmartTV"],[u,Te],[l,T]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[u,je],[l,T]],[/(apple) ?tv/i],[u,[d,pe+" TV"],[l,T]],[/crkey/i],[[d,Ae+"cast"],[u,Ie],[l,T]],[/droid.+aft(\w+)( bui|\))/i],[d,[u,Se],[l,T]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[d,[u,kt],[l,T]],[/(bravia[\w ]+)( bui|\))/i],[d,[u,Pe],[l,T]],[/(mitv-\w{5}) bui/i],[d,[u,$e],[l,T]],[/Hbbtv.*(technisat) (.*);/i],[u,d,[l,T]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[u,ye],[d,ye],[l,T]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[l,T]],[/(ouya)/i,/(nintendo) (\w+)/i],[u,d,[l,Z]],[/droid.+; (shield) bui/i],[d,[u,"Nvidia"],[l,Z]],[/(playstation \w+)/i],[d,[u,Pe],[l,Z]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[d,[u,Ue],[l,Z]],[/((pebble))app/i],[u,d,[l,Y]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[d,[u,pe],[l,Y]],[/droid.+; (glass) \d/i],[d,[u,Ie],[l,Y]],[/droid.+; (wt63?0{2,3})\)/i],[d,[u,Ke],[l,Y]],[/(quest( 2| pro)?)/i],[d,[u,vt],[l,Y]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[u,[l,et]],[/(aeobc)\b/i],[d,[u,Se],[l,et]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[d,[l,b]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[d,[l,f]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[l,f]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[l,b]],[/(android[-\w\. ]{0,9});.+buil/i],[d,[u,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[c,[r,Ii+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[c,[r,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[r,c],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[c,r]],os:[[/microsoft (windows) (vista|xp)/i],[r,c],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[r,[c,Be,St]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[c,Be,St],[r,it]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[c,/_/g,"."],[r,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[r,"macOS"],[c,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[c,r],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[r,c],[/\(bb(10);/i],[c,[r,mt]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[c,[r,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[c,[r,we+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[c,[r,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[c,[r,"watchOS"]],[/crkey\/([\d\.]+)/i],[c,[r,Ae+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[r,"Chrome OS"],c],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[r,c],[/(sunos) ?([\w\.\d]*)/i],[[r,"Solaris"],c],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[r,c]]},xe=function(){var i={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return F.call(i.init,[[P,[r,c,fe]],[R,[S]],[O,[l,d,u]],[_,[r,c]],[A,[r,c]]]),F.call(i.isIgnore,[[P,[c,fe]],[_,[c]],[A,[c]]]),F.call(i.isIgnoreRgx,[[P,/ ?browser$/i],[A,/ ?os$/i]]),F.call(i.toString,[[P,[r,c]],[R,[S]],[O,[u,d]],[_,[r,c]],[A,[r,c]]]),i}(),Ai=function(i,t){var e=xe.init[t],s=xe.isIgnore[t]||0,n=xe.isIgnoreRgx[t]||0,o=xe.toString[t]||0;function a(){F.call(this,e)}return a.prototype.getItem=function(){return i},a.prototype.withClientHints=function(){return G?G.getHighEntropyValues(Nt).then(function(h){return i.setCH(new Gt(h,!1)).parseCH().get()}):i.parseCH().get()},a.prototype.withFeatureCheck=function(){return i.detectFeature().get()},t!=te&&(a.prototype.is=function(h){var g=!1;for(var w in this)if(this.hasOwnProperty(w)&&!st(s,w)&&z(n?$(n,this[w]):this[w])==z(n?$(n,h):h)){if(g=!0,h!=V)break}else if(h==V&&g){g=!g;break}return g},a.prototype.toString=function(){var h=de;for(var g in o)typeof this[o[g]]!==V&&(h+=(h?" ":de)+this[o[g]]);return h||V}),G||(a.prototype.then=function(h){var g=this,w=function(){for(var C in g)g.hasOwnProperty(C)&&(this[C]=g[C])};w.prototype={is:a.prototype.is,toString:a.prototype.toString};var m=new w;return h(m),m}),new a};function Gt(i,t){if(i=i||{},F.call(this,Nt),t)F.call(this,[[nt,Qe(i[W])],[at,Qe(i[yi])],[b,/\?1/.test(i[Ci])],[d,be(i[Mi])],[ee,be(i[Dt])],[ot,be(i[Si])],[S,be(i[ki])],[j,Qe(i[Ei])],[Ne,be(i[vi])]]);else for(var e in i)this.hasOwnProperty(e)&&typeof i[e]!==V&&(this[e]=i[e])}function Pt(i,t,e,s){return this.get=function(n){return n?this.data.hasOwnProperty(n)?this.data[n]:void 0:this.data},this.set=function(n,o){return this.data[n]=o,this},this.setCH=function(n){return this.uaCH=n,this},this.detectFeature=function(){if(I&&I.userAgent==this.ua)switch(this.itemType){case P:I.brave&&typeof I.brave.isBrave==Ye&&this.set(r,"Brave");break;case O:!this.get(l)&&G&&G[b]&&this.set(l,b),this.get(d)=="Macintosh"&&I&&typeof I.standalone!==V&&I.maxTouchPoints&&I.maxTouchPoints>2&&this.set(d,"iPad").set(l,f);break;case A:!this.get(r)&&G&&G[ee]&&this.set(r,G[ee]);break;case te:var n=this.data,o=function(a){return n[a].getItem().detectFeature().get()};this.set(P,o(P)).set(R,o(R)).set(O,o(O)).set(_,o(_)).set(A,o(A))}return this},this.parseUA=function(){return this.itemType!=te&&Mt.call(this.data,this.ua,this.rgxMap),this.itemType==P&&this.set(fe,Xe(this.get(c))),this},this.parseCH=function(){var n=this.uaCH,o=this.rgxMap;switch(this.itemType){case P:var a=n[at]||n[nt],h;if(a)for(var g in a){var w=$(/(Google|Microsoft) /,a[g].brand||a[g]),m=a[g].version;!/not.a.brand/i.test(w)&&(!h||/chrom/i.test(h)&&!/chromi/i.test(w))&&(this.set(r,w).set(c,m).set(fe,Xe(m)),h=w)}break;case R:var C=n[S];C&&(C&&n[Ne]=="64"&&(C+="64"),Mt.call(this.data,C+";",o));break;case O:if(n[b]&&this.set(l,b),n[d]&&this.set(d,n[d]),n[d]=="Xbox"&&this.set(l,Z).set(u,Ue),n[j]){var N;if(typeof n[j]!="string")for(var K=0;!N&&K<n[j].length;)N=Be(n[j][K++],It);else N=Be(n[j],It);this.set(l,N)}break;case A:var Q=n[ee];if(Q){var L=n[ot];Q==it&&(L=parseInt(Xe(L),10)>=13?"11":"10"),this.set(r,Q).set(c,L)}this.get(r)==it&&n[d]=="Xbox"&&this.set(r,"Xbox").set(c,void 0);break;case te:var he=this.data,x=function(B){return he[B].getItem().setCH(n).parseCH().get()};this.set(P,x(P)).set(R,x(R)).set(O,x(O)).set(_,x(_)).set(A,x(A))}return this},F.call(this,[["itemType",i],["ua",t],["uaCH",s],["rgxMap",e],["data",Ai(this,i)]]),this}function D(i,t,e){if(typeof i===le?(Ct(i)?(typeof t===le&&(e=t),t=i):(e=i,t=void 0),i=void 0):typeof i===Ze&&!Ct(t)&&(e=t,t=void 0),!(this instanceof D))return new D(i,t,e).getResult();var s=typeof i===Ze?i:I&&I.userAgent?I.userAgent:e&&e[pt]?e[pt]:de,n=new Gt(e,!0),o=t?Pi(Tt,t):Tt,a=function(h){return h==te?function(){return new Pt(h,s,o,n).set("ua",s).set(P,this.getBrowser()).set(R,this.getCPU()).set(O,this.getDevice()).set(_,this.getEngine()).set(A,this.getOS()).get()}:function(){return new Pt(h,s,o[h],n).parseUA().get()}};return F.call(this,[["getBrowser",a(P)],["getCPU",a(R)],["getDevice",a(O)],["getEngine",a(_)],["getOS",a(A)],["getResult",a(te)],["getUA",function(){return s}],["setUA",function(h){return ue(h)&&(s=h.length>tt?ye(h,tt):h),this}]]).setUA(s),this}D.VERSION=fi;D.BROWSER=Ge([r,c,fe]);D.CPU=Ge([S]);D.DEVICE=Ge([d,u,l,Z,b,T,f,Y,et]);D.ENGINE=D.OS=Ge([r,c]);class Ht{constructor(t,e,s){p(this,"trackers");p(this,"config");p(this,"sdkConfig");this.trackers=t,this.config=e,this.sdkConfig=s}on(t,e,s){const n=function(a){a.data.message!==`kalamba:wrapper-telemetry:${t}`&&a.data.message!==`kalamba:wrapper:${t}`||e(a.data.payload)};window.addEventListener("message",n,s)}track(t,e){this.trackers.forEach(s=>s.track(t,e))}}function At(i){return i.reduce((t,e)=>t+e,0)}function xi(i){const t=i.length,e=At(i)/t,s=i.map(o=>Math.pow(o-e,2)),n=At(s)/t;return Math.sqrt(n)}class xt{constructor(){p(this,"rafId",-1);p(this,"startTime",0);p(this,"stopTime",0);p(this,"frames",[]);p(this,"calculateFPS",()=>{const t=Math.floor((this.stopTime-this.startTime)/1e3);return this.frames.map(e=>Math.floor((e-this.startTime)/1e3)).reduce((e,s,n,o)=>(o[n]!==o[n-1]?e.push(1):e[e.length-1]++,e),[]).slice(0,t)});p(this,"getReport",()=>{const t=this.calculateFPS(),e=Math.floor(this.frames.length/((this.stopTime-this.startTime)/1e3)),s=t.length>0?Math.max(...t):e,n=t.length>0?Math.min(...t):e,o=t.length>0?xi(t):0;return{fpsAvg:e,fpsMax:s,fpsMin:n,fpsStdDev:o}});p(this,"start",()=>{this.startTime=Date.now(),this.frames=[],this.trackFrames()});p(this,"stop",()=>{cancelAnimationFrame(this.rafId),this.stopTime=Date.now()});p(this,"trackFrames",()=>{this.frames.push(Date.now()),this.rafId=requestAnimationFrame(this.trackFrames)})}}const Oi="landscape",Ui="portrait";function Li(){try{const i=document.createElement("canvas");return!!window.WebGLRenderingContext&&(i.getContext("webgl")||i.getContext("experimental-webgl"))instanceof WebGLRenderingContext}catch{return!1}}async function Bi(){if(!window.createImageBitmap)return!1;const e=await(await fetch("data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoCAAEAAQAcJaQAA3AA/v3AgAA=")).blob();try{return await createImageBitmap(e),!0}catch{return!1}}function Je(){return window.innerWidth>=window.innerHeight?Oi:Ui}var Re,se,ne,ae,ve,_e,Ee,Fe;class Ri extends Ht{constructor(...e){super(...e);p(this,"FPS_SAMPLE_INTERVAL",1e4);M(this,Re,0);M(this,se,void 0);M(this,ne,void 0);M(this,ae,void 0);M(this,ve,!1);M(this,_e,!1);M(this,Ee,"");M(this,Fe,[]);k(this,ne,{}),k(this,ae,this.deviceInfo()),k(this,se,this.config.gameVersion),this.on("state",({balance:s})=>{k(this,Re,s)}),this.on("autoplay",({action:s})=>{["start","resume"].includes(s)?k(this,ve,!0):k(this,ve,!1)}),this.on("settings",({fastPlay:s})=>{s!==void 0&&k(this,_e,s)}),this.registerEvents()}async registerEvents(){y(this,ae).then(e=>{this.track("Device Information",e)}),this.on("loadStart",()=>{this.track("Game Loading",{progress:0,step:"initial"})}),this.on("loadProgress",e=>{this.track("Game Loading",{progress:e.progress})}),this.on("loadEnd",()=>{this.track("Game Loading",{progress:100,step:"complete"})}),this.on("error",e=>{this.track("System Message",{systemMessageText:e.messageCode,systemMessageType:e.type})}),this.on("openGameResponse",async e=>{k(this,Ee,e.contract.stateType.nextRound),k(this,ne,{balanceInCoins:e.contract.balance.coins,clientVersion:y(this,se),coinValueInCents:this.sdkConfig.api.coinValueInCents,coinValueInCentsFloat:this.sdkConfig.api.coinValueInCents,currency:this.sdkConfig.api.currency,defaultBaseBet:e.contract.bet.default.base,defaultBetMultiplier:e.contract.bet.default.multiplier,environment:"release",gameCode:this.sdkConfig.api.game,gameCodeServer:this.sdkConfig.api.game,gameModelFile:e.contract.gameModel,jurisdiction:this.sdkConfig.api.jurisdiction,languageCode:this.sdkConfig.ui.language,operatorName:"kalamba",partnerId:this.sdkConfig.api.brand,partnerParentId:this.sdkConfig.api.integration,platform:"WEB",playMode:this.sdkConfig.api.playMode,referrer:window.location.hostname,serverVersion:e.contract.metaData.version}),this.track("Game Open",y(this,ne))}),this.on("playCycleEnd",async e=>{const s=await y(this,ae),{base:n,multiplier:o,specialAction:a}=e.contract.bet.lastPaid??{},h=e.contract.balance.coins,g=e.contract.bet.lastPaid.base*e.contract.bet.lastPaid.multiplier,w=e.contract.win.total,m=w-g,C=a||"spin",N=e.contract.roundId;this.track("Betting Activity",{balance:h-m,balanceAfter:h,baseBet:n,betMultiplier:o,betType:C,gameVersion:y(this,se),coinValueInCents:this.sdkConfig.api.coinValueInCents,coinValueInCentsFloat:this.sdkConfig.api.coinValueInCents,currency:this.sdkConfig.api.currency,environment:"release",gameCode:this.sdkConfig.api.game,gameCodeServer:this.sdkConfig.api.game,isMobile:s.isMobile,netResult:m,operatorName:"kalamba",orientation:Je(),partnerId:this.sdkConfig.api.brand,partnerParentId:this.sdkConfig.api.integration,platform:"WEB",playMode:this.sdkConfig.api.playMode,roundId:N,roundTypes:["BaseGame"],totalBet:g,totalWin:w}),k(this,Fe,[])}),this.on("telemetry.click",e=>{this.track("UI Interaction",{action:"click",...this.getExtraUiInteractionData(),...e})}),this.on("telemetry.orientationChange",()=>{this.track("UI Interaction",{action:"orientationChange",...this.getExtraUiInteractionData()})}),this.reportFpsSample(),this.reportFpsRound()}reportFpsSample(){const e=new xt,s=()=>{e.stop();const o=e.getReport();this.track("FPS Performance",{...o,fpsType:"sample"}),n()},n=async()=>{e.start(),setTimeout(s,this.FPS_SAMPLE_INTERVAL)};n()}reportFpsRound(){const e=new xt;this.on("playCycleStart",()=>{e.start()}),this.on("playCycleEnd",()=>{e.stop();const s=e.getReport();this.track("FPS Performance",{...s,fpsType:"playCycleStart->playCycleEnd"})})}getExtraUiInteractionData(){return{orientation:Je(),stateType:y(this,Ee)}}async deviceInfo(){var g;const e=new D(navigator.userAgent),s=Li(),n=await Bi(),o=e.getBrowser(),a=e.getDevice(),h=e.getOS();return{browserName:o.name,browserVersion:o.version,connection:(g=navigator.connection)==null?void 0:g.effectiveType,deviceName:a.model,deviceType:a.type,isMobile:["mobile","tablet"].includes(a.type??""),isWebGLSupported:s,isWebPSupported:n,manufacturer:a.vendor,operatingSystem:h.name,operatingSystemVersion:h.version,orientation:Je(),pixelRatio:window.devicePixelRatio,screenHeight:window.screen.height,screenSize:`${window.screen.width}x${window.screen.height}`,screenWidth:window.screen.width,timezoneOffsetMinutes:new Date().getTimezoneOffset(),windowHeight:window.innerHeight,windowSize:`${window.innerWidth}x${window.innerHeight}`,windowWidth:window.innerWidth}}}Re=new WeakMap,se=new WeakMap,ne=new WeakMap,ae=new WeakMap,ve=new WeakMap,_e=new WeakMap,Ee=new WeakMap,Fe=new WeakMap;let Oe;const _i=new Uint8Array(16);function Fi(){if(!Oe&&(Oe=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Oe))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Oe(_i)}const E=[];for(let i=0;i<256;++i)E.push((i+256).toString(16).slice(1));function Di(i,t=0){return E[i[t+0]]+E[i[t+1]]+E[i[t+2]]+E[i[t+3]]+"-"+E[i[t+4]]+E[i[t+5]]+"-"+E[i[t+6]]+E[i[t+7]]+"-"+E[i[t+8]]+E[i[t+9]]+"-"+E[i[t+10]]+E[i[t+11]]+E[i[t+12]]+E[i[t+13]]+E[i[t+14]]+E[i[t+15]]}const Ni=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Ot={randomUUID:Ni};function Ut(i,t,e){if(Ot.randomUUID&&!t&&!i)return Ot.randomUUID();i=i||{};const s=i.random||(i.rng||Fi)();if(s[6]=s[6]&15|64,s[8]=s[8]&63|128,t){e=e||0;for(let n=0;n<16;++n)t[e+n]=s[n];return t}return Di(s)}class rt{constructor(t,e){p(this,"config");p(this,"sdkConfig");this.config=t,this.sdkConfig=e}}const Lt=25,Bt=1e4;var oe,re,ce,H,Ce;class Gi extends rt{constructor(...e){super(...e);M(this,oe,"https://europe-west3-stargazer-328808.cloudfunctions.net/collect-events");M(this,re,void 0);M(this,ce,void 0);M(this,H,[]);M(this,Ce,void 0);p(this,"processQueueForced");k(this,re,new Date().getTime()),k(this,H,[]),k(this,Ce,Ut()),this.processQueueForced=this.processQueue.bind(this,!0),this.schedule(),fetch(y(this,oe),{method:"OPTIONS"}).catch(dt.noop),this.subscribe()}subscribe(){window.addEventListener("beforeunload",this.processQueueForced,!1),window.addEventListener("pagehide",this.processQueueForced,!1),window.addEventListener("visibilitychange",this.processQueueForced,!1)}schedule(){y(this,ce)&&clearTimeout(y(this,ce)),k(this,ce,window.setTimeout(()=>this.processQueue(),Bt))}send(e){k(this,re,new Date().getTime());try{navigator.sendBeacon(y(this,oe),JSON.stringify(e))}catch{fetch(y(this,oe),{body:JSON.stringify(e),method:"POST",headers:{"Content-Type":"application/json"},keepalive:!0}).catch(dt.noop)}this.schedule()}addToQueue(e){y(this,H).push(e),this.processQueue()}processQueue(e=!1){if(!(this.sdkConfig==null||!this.sdkConfig.ui.feature.allowTelemetry)&&!(!e&&y(this,H).length<Lt&&new Date().getTime()-y(this,re)<Bt))for(;y(this,H).length;){const s=y(this,H).splice(0,Lt).map(n=>({...n,sessionID:y(this,Ce),userID:this.sdkConfig.api.user}));this.send(s)}}track(e,s){this.addToQueue({eventName:e,eventParams:s,eventTimestamp:new Date().getTime(),eventUUID:Ut()})}}oe=new WeakMap,re=new WeakMap,ce=new WeakMap,H=new WeakMap,Ce=new WeakMap;const Hi=U("LoggingTracker","color:#000000;font-weight:bold;");class Vi extends rt{track(t,e){Hi(`@${this.sdkConfig.api.user}`,`[${t}]`,e)}}exports.BasicPlugin=Wt;exports.CasinoPlugin=q;exports.DebuggingPlugin=$t;exports.GigPlugin=Qt;exports.KalambaBullseyePlugin=bi;exports.KalambaStargazerPlugin=Ri;exports.KalambaStargazerTracker=Gi;exports.LoggingTracker=Vi;exports.OryxPlugin=Jt;exports.PariplayPlugin=ti;exports.RelaxFEIMPlugin=ii;exports.RgsPlygin=Ft;exports.TelemetryPlugin=Ht;exports.Tracker=rt;exports.TukoPlugin=si;
|
|
5
|
+
"use strict";var Qt=Object.defineProperty;var Jt=(s,t,e)=>t in s?Qt(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e;var p=(s,t,e)=>(Jt(s,typeof t!="symbol"?t+"":t,e),e),lt=(s,t,e)=>{if(!t.has(s))throw TypeError("Cannot "+e)};var y=(s,t,e)=>(lt(s,t,"read from private field"),e?e.call(s):t.get(s)),M=(s,t,e)=>{if(t.has(s))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(s):t.set(s,e)},k=(s,t,e,i)=>(lt(s,t,"write to private field"),i?i.call(s,e):t.set(s,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ne=require("./errors-358575c3.cjs"),ut=require("./noop-b3c54b76.cjs");function U(s,t){return(e,...i)=>{console.log(`[%c${s}\x1B[m] %s`,t,e,...i)}}function Dt(s,t){return Math.round(s*100/t)}class q{constructor(t,e){p(this,"config");p(this,"sdkConfig");this.config=t,this.sdkConfig=e}on(t,e,i){const n=function(a){a.data.message!==`kalamba:wrapper-casino:${t}`&&a.data.message!==`kalamba:wrapper:${t}`||e(a.data.payload)};window.addEventListener("message",n,i)}send(t,...[e]){window.postMessage({message:`kalamba:casino:${t}`,payload:e})}}const Yt=U("BasicPlugin","color:#000000;font-weight:bold;");class Zt extends q{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),Yt("configured")}registerToSdkEvents(){window.addEventListener("message",t=>{try{const{type:e,payload:i}=t.data;switch(e){case"doAudioSettings":this.send("settings",{music:i==null?void 0:i.musicEnabled,sounds:i==null?void 0:i.soundEnabled});return;case"doBalanceUpdate":const{currency:n,coinValueInCents:o}=this.sdkConfig.api;i.currency===n&&typeof i.balanceInCurrency=="number"?this.send("balance",{balance:Dt(i.balanceInCurrency,o)}):(i.balanceInCoins,this.send("balance",{balance:i.balanceInCoins}));return;case"doGamePause":this.send("freeze");return;case"doGameResume":this.send("unfreeze");return;case"doGameSuspend":this.send("suspend");return;default:return}}catch{}})}registerFromSdkEvents(){this.on("close",()=>{if(this.sdkConfig.api.homeUrl)try{window.top.location=this.sdkConfig.api.homeUrl}catch{window.location=this.sdkConfig.api.homeUrl}else try{window.top.history.back()}catch{window.history.back()}})}}const E=U("▼ DebuggingPlugin IN ▼","color:#444444;font-weight:bold;"),ei=U("▲ DebuggingPlugin OUT ▲","color:#444444;font-weight:bold;");class ti extends q{constructor(...t){super(...t),this.registerDebugToSdkEvents(),this.registerSdkToDebugEvents()}registerDebugToSdkEvents(){window.DebuggingPlugin={balance:t=>this._send("balance",t),bet:t=>this._send("bet",t),choice:t=>this._send("choice",t),close:t=>this._send("close",t),help:t=>this._send("help",t),history:t=>this._send("history",t),freeze:t=>this._send("freeze",t),paytable:t=>this._send("paytable",t),settings:t=>this._send("settings",t),suspend:t=>this._send("suspend",t),unfreeze:t=>this._send("unfreeze",t)}}registerSdkToDebugEvents(){this.on("autoplay",t=>E("autoplay",t)),this.on("balance",t=>E("balance",t)),this.on("bet",t=>E("bet",t)),this.on("cashier",t=>E("cashier",t)),this.on("choice",t=>E("choice",t)),this.on("close",t=>E("close",t)),this.on("error",t=>E("error",t)),this.on("loadEnd",t=>E("loadEnd",t)),this.on("loadProgress",t=>E("loadProgress",t)),this.on("loadStart",t=>E("loadStart",t)),this.on("playCycleStart",t=>E("playCycleStart",t)),this.on("playCycleEnd",t=>E("playCycleEnd",t)),this.on("playEnd",t=>E("playEnd",t)),this.on("playError",t=>E("playError",t)),this.on("playReady",t=>E("playReady",t)),this.on("playStart",t=>E("playStart",t)),this.on("settings",t=>E("settings",t))}_send(...t){ei(...t),this.send(...t)}}const ii=U("GigPlugin","color:#000000;font-weight:bold;");class si extends q{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),ii("configured")}postMessage(t){const e={event:t};window.top.postMessage(e,"*")}registerToSdkEvents(){window.addEventListener("message",t=>{try{const{data:e}=t;switch(e){case"STOP_AUTO_PLAY":this.send("suspend");return;case"BLOCK_BETS":this.send("freeze");return;case"UNBLOCK_BETS":this.send("unfreeze");return;default:return}}catch{}})}registerFromSdkEvents(){this.on("close",()=>{if(this.sdkConfig.api.homeUrl)try{window.top.location=this.sdkConfig.api.homeUrl}catch{window.location=this.sdkConfig.api.homeUrl}else try{window.top.history.back()}catch{window.history.back()}}),this.on("playReady",()=>{this.postMessage("GAME_READY")})}}const ni=U("OryxPlugin","color:#000000;font-weight:bold;");class ai extends q{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),ni("configured")}registerToSdkEvents(){window.addEventListener("message",t=>{try{const{type:e,param:i}=t.data;switch(e){case"doBalanceUpdate":this.send("balance",{balance:i});return;case"doGamePause":this.send("freeze");return;case"doGameResume":this.send("unfreeze");return;case"doGameSuspend":this.send("suspend");return;default:return}}catch{}})}registerFromSdkEvents(){let t=0;this.on("close",()=>{window.top.postMessage({wpgaction:"close"},"*"),window.parent.postMessage({wpgaction:"close.parent"},"*")}),this.on("balance",({balance:e})=>{t!==e&&(t=e,window.top.postMessage({param:{},wpgaction:"balance"},"*"),window.parent.postMessage({param:{},wpgaction:"balance.parent"},"*"))}),this.on("loadStart",()=>{window.top.postMessage({wpgaction:"loadStart"},"*"),window.parent.postMessage({wpgaction:"loadStart.parent"},"*")}),this.on("loadEnd",()=>{window.top.postMessage({wpgaction:"loadEnd"},"*"),window.parent.postMessage({wpgaction:"loadEnd.parent"},"*")}),this.on("playStart",()=>{window.top.postMessage({wpgaction:"gameSpinStart"},"*"),window.parent.postMessage({wpgaction:"gameSpinStart.parent"},"*")}),this.on("playEnd",()=>{window.top.postMessage({wpgaction:"gameSpinEnd"},"*"),window.parent.postMessage({wpgaction:"gameSpinEnd.parent"},"*")}),this.on("cashier",({type:e})=>{switch(e){case"BALANCE_LOW":window.top.postMessage({wpgaction:"cashier"},"*"),window.parent.postMessage({wpgaction:"cashier.parent"},"*");break;case"BALANCE_INSUFFICIENT":window.top.postMessage({wpgaction:"errorOutOfMoney"},"*"),window.parent.postMessage({wpgaction:"errorOutOfMoney.parent"},"*");break}})}}const ht=U("PariplayPlugin","color:#000000;font-weight:bold;");function Ve(s){try{window.top.location=s}catch{window.location=s}}function ze(s,t){return new Promise(function(i,n){const o=new XMLHttpRequest;o.onload=function(){o.status>=200&&o.status<300?i(o.responseText):n(o.responseText)},o.open(s,t),o.send()})}function qe(){}function oi(s){return s.filter(function(e){return e.messageType.toUpperCase()==="DATA"})}function We(s){return s.filter(function(e){return["NOTIFICATION","POPUP"].includes(e.messageType.toUpperCase())})}function Ft(s){try{return JSON.parse(s.text)}catch{return{}}}function ri(s){return s.map(Ft).filter(Boolean).find(function(e){return e.betId!=null&&e.winId!=null})||{}}function ci(s){return s.map(Ft).filter(Boolean).find(function(e){return e.TotalBet!=null&&e.TotalWin!=null})||{}}class di extends q{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),ht("configured")}postMessage(t,e){const i={lang:this.sdkConfig.ui.language,sender:this.sdkConfig.api.game,type:t};e!=null&&(i.data=e),ht("postMessage",i),window.parent.postMessage(i,"*")}coinsToCurrency(t){return t*this.sdkConfig.api.coinValueInCents/100}handleContinueButton(t,e){t.link&&ze("GET",t.link),e()}handleLinkButton(t,e){switch(t.linkType.toUpperCase()){case"AJAX":ze("GET",t.link),e();return;case"AJAXRESPONSE":ze("GET",t.link).then(()=>{e()});return;case"REDIRECT":Ve(t.link),e();return}}handleQuitButton(t,e){this.send("close"),e()}handleCashierButton(t,e){this.send("cashier",{type:"ON_DEMAND"}),e()}handleHistoryButton(t,e){this.send("history",{source:"casino"}),e()}get buttonActions(){return{CASHIER:this.handleCashierButton,CONTINUE:this.handleContinueButton,HISTORY:this.handleHistoryButton,LINK:this.handleLinkButton,QUIT:this.handleQuitButton}}processInfoUiMessages(t){return t.reduce((e,i)=>e.then(()=>new Promise(n=>{Object.assign({},i,{buttons:i.buttons.filter(o=>o.action.toUpperCase()==="CASHIER"?!!this.sdkConfig.api.cashierUrl:!0).map(o=>Object.assign({},o,{onRelease:()=>{const a=i.messageType.toUpperCase()==="POPUP"?qe:n,h=this.buttonActions[o.action.toUpperCase()];h?h(o,a):a()}}))})}).catch(qe)),Promise.resolve()).then(()=>{}).catch(qe)}registerToSdkEvents(){window.addEventListener("message",t=>{try{const{type:e}=t.data;switch(e){case"pause":case"disableSpin":this.send("freeze");return;case"resume":case"enableSpin":this.send("unfreeze");return;case"stopAutobet":this.send("suspend");return;default:return}}catch{}})}registerFromSdkEvents(){let t=0;this.on("openGameResponse",e=>{let i;try{const n=JSON.parse(JSON.parse(atob(this.sdkConfig.api.integrationData.token.split(".")[1])).token),o=JSON.parse(n.integrationSpecificAttributes.sessionData||"{}");i={ClientToken:n.integrationSpecificAttributes.clientToken,CurrencyCode:n.currency,PlayerTokenId:n.user,SessionData:o}}catch{i=void 0}this.postMessage("gameDataLoaded",{LoadGameData:i,success:!0});try{const n=We(e.contract.uiMessages);this.processInfoUiMessages(n)}catch{}}),this.on("balance",({balance:e})=>{t!==e&&(t=e,this.postMessage("balance",{amount:this.coinsToCurrency(e)}))}),this.on("close",()=>{if(this.sdkConfig.api.homeUrl)if(this.sdkConfig.api.homeUrl==="(back)")try{window.top.history.back()}catch{window.history.back()}else this.sdkConfig.api.homeUrl==="(api)"?this.postMessage("quit"):Ve(this.sdkConfig.api.homeUrl)}),this.on("playEnd",e=>{this.postMessage("roundEnded",{balanceAfter:this.coinsToCurrency(e.contract.balance.coins),win:this.coinsToCurrency(e.contract.win.round)});try{const i=We(e.contract.uiMessages);this.processInfoUiMessages(i)}catch{}}),this.on("playError",e=>{var i,n;this.postMessage("ticketReceived",{ErrorCode:(i=e.data)==null?void 0:i.code,ErrorMessage:"ERROR",Status:{ErrCode:(n=e.data)==null?void 0:n.code}})}),this.on("playResponse",e=>{this.postMessage("roundStarted",{balanceBefore:this.coinsToCurrency(e.contract.balance.coins+e.contract.bet.lastPaid.base*e.contract.bet.lastPaid.multiplier)});const i=["BaseGame","PaidSpin"].includes(e.contract.stateType.thisRound),n=oi(e.contract.uiMessages),o=We(e.contract.uiMessages),a=ri(n),h=ci(n);this.postMessage("ticketReceived",{Balance:this.coinsToCurrency(e.contract.balance.coins),BetAmount:i?this.coinsToCurrency(e.contract.bet.lastPaid.base*e.contract.bet.lastPaid.multiplier):0,CreditTransactionId:a.betId,DebitTransactionId:a.winId,Message:o,SessionData:h,Status:{ErrCode:0},WinAmount:this.coinsToCurrency(e.contract.win.round)})}),this.on("playStart",e=>{e.bet&&this.postMessage("roundStart",{totalBet:this.coinsToCurrency(e.bet.base*e.bet.multiplier)})}),this.on("loadEnd",()=>{this.postMessage("gameReady")}),this.on("loadStart",()=>{this.postMessage("onAppFrameReady")}),this.on("cashier",()=>{this.sdkConfig.api.cashierUrl&&(this.sdkConfig.api.cashierUrl==="(api)"?this.postMessage("cashier"):Ve(this.sdkConfig.api.cashierUrl))})}}const he=U("RelaxFEIMPlugin","color:#000000;font-weight:bold;");class li extends q{constructor(...e){super(...e);p(this,"VERSION","1.15.0");const i=document.createElement("script");i.src=`https://d3nsdzdtjbr5ml.cloudfront.net/casino/relaxlibs/feim/${this.VERSION}/rlxfeim.min.js`,i.onload=()=>{he("loaded"),window.FEIM.configure({p2pConfig:{currency:this.sdkConfig.api.currency,launchParams:{homeurl:"homeUrl"}}}),he("configured"),this.registerToSdkEvents(),this.registerFromSdkEvents()},document.body.appendChild(i)}registerToSdkEvents(){window.FEIM.on.errorMessageDismissed(()=>this.send("unfreeze")),window.FEIM.on.errorMessageDisplayed(()=>this.send("freeze")),window.FEIM.on.exitingGame(()=>he("!!! NOT IMPLEMENTED: exitingGame !!!")),window.FEIM.on.freeze(()=>this.send("freeze")),window.FEIM.on.initialized(()=>he("!!! NOT IMPLEMENTED: initialized !!!")),window.FEIM.on.pauseAutoPlay(()=>this.send("suspend")),window.FEIM.on.refreshBalance(()=>he("!!! NOT IMPLEMENTED: refreshBalance !!!")),window.FEIM.on.toggleGameHelp(()=>{this.send("help",{})}),window.FEIM.on.togglePaytable(()=>{this.send("paytable",{})}),window.FEIM.on.unfreeze(()=>this.send("unfreeze")),window.FEIM.on.updateSettings(({payload:[e]})=>this.send("settings",{sounds:e.sounds,fastPlay:e.fastPlay}))}registerFromSdkEvents(){this.on("autoplay",({action:e})=>{switch(e){case"start":window.FEIM.send.autoPlayStarted();break;case"stop":window.FEIM.send.autoPlayFinished();break}}),this.on("balance",({balance:e})=>{window.FEIM.send.balanceUpdate(e)}),this.on("bet",({base:e,multiplier:i})=>{window.FEIM.send.betUpdate(e*i)}),this.on("error",({message:e})=>{window.FEIM.send.errorMessage(e)}),this.on("close",()=>{window.FEIM.send.exitGame()}),this.on("loadEnd",()=>{window.FEIM.send.gameLoadCompleted()}),this.on("loadProgress",({progress:e})=>{window.FEIM.send.gameLoadProgress(e)}),this.on("loadStart",()=>{window.FEIM.send.gameLoadStarted()}),this.on("cashier",()=>{window.FEIM.send.openQuickDeposit()}),this.on("playCycleEnd",e=>{const i={balance:e.contract.balance.coins,bet:e.contract.bet.lastPaid.base*e.contract.bet.lastPaid.multiplier,win:{win:e.contract.win.total}};window.FEIM.send.roundFinished(i)}),this.on("playResponse",e=>{const i={balance:e.contract.balance.coins,playResponse:e.data};window.FEIM.send.roundStarted(i)}),this.on("history",()=>{window.FEIM.send.showHistory()}),this.on("settings",e=>{window.FEIM.send.updateSettings(e)})}}const $e=U("TukoPlugin","color:#000000;font-weight:bold;");class ui extends q{constructor(...e){super(...e);p(this,"PING_INTERVAL",1e4);const n=new URLSearchParams(window.location.search).get("pingCallbackUrl");n&&window.setInterval(()=>{this.ping(n)},this.PING_INTERVAL),this.registerToSdkEvents(),this.registerFromSdkEvents(),$e("configured")}ping(e){const i=new XMLHttpRequest;i.onreadystatechange=function(){i.readyState===XMLHttpRequest.DONE&&(i.status===0||i.status>=200&&i.status<400?$e("ping ok",i):$e("ping error",i))},i.open("GET",e),i.send()}registerToSdkEvents(){window.addEventListener("message",e=>{try{const{type:i,payload:n}=e.data;switch(i){case"doAudioSettings":this.send("settings",{music:n==null?void 0:n.musicEnabled,sounds:n==null?void 0:n.soundEnabled});return;case"doBalanceUpdate":const{currency:o,coinValueInCents:a}=this.sdkConfig.api;n.currency===o&&typeof n.balanceInCurrency=="number"?this.send("balance",{balance:Dt(n.balanceInCurrency,a)}):(n.balanceInCoins,this.send("balance",{balance:n.balanceInCoins}));return;case"doGamePause":this.send("freeze");return;case"doGameResume":this.send("unfreeze");return;case"doGameSuspend":this.send("suspend");return;default:return}}catch{}})}registerFromSdkEvents(){this.on("close",()=>{if(this.sdkConfig.api.homeUrl)try{window.top.location=this.sdkConfig.api.homeUrl}catch{window.location=this.sdkConfig.api.homeUrl}else try{window.top.history.back()}catch{window.history.back()}})}}var hi="2.0.0-beta.3",ce="",gt="?",et="function",V="undefined",de="object",tt="string",be="major",l="model",r="name",d="type",u="vendor",c="version",S="architecture",Y="console",b="mobile",f="tablet",I="smarttv",Re="wearable",pt="xr",it="embedded",mt="user-agent",st=500,ot="brands",$="formFactors",rt="fullVersionList",Z="platform",ct="platformVersion",Ge="bitness",W="sec-ch-ua",gi=W+"-full-version-list",pi=W+"-arch",mi=W+"-"+Ge,wi=W+"-form-factors",bi=W+"-"+b,fi=W+"-"+l,Nt=W+"-"+Z,yi=Nt+"-version",Gt=[ot,rt,b,l,Z,ct,S,$,Ge],P="browser",B="cpu",R="device",D="engine",A="os",ee="result",Ce="Amazon",ge="Apple",wt="ASUS",bt="BlackBerry",Me="Google",ft="Huawei",yt="Lenovo",je="LG",xe="Microsoft",kt="Motorola",Se="Samsung",vt="Sharp",Te="Sony",Ke="Xiaomi",Xe="Zebra",Q="Mobile ",J=" Browser",Ie="Chrome",ki="Edge",pe="Firefox",me="Opera",Et="Facebook",Ct="Sogou",nt="Windows",vi=typeof window!==V,T=vi&&window.navigator?window.navigator:void 0,G=T&&T.userAgentData?T.userAgentData:void 0,Ei=function(s,t){var e={},i=t;if(!Ue(t)){i={};for(var n in t)for(var o in t[n])i[o]=t[n][o].concat(i[o]?i[o]:[])}for(var a in s)e[a]=i[a]&&i[a].length%2===0?i[a].concat(s[a]):s[a];return e},He=function(s){for(var t={},e=0;e<s.length;e++)t[s[e].toUpperCase()]=s[e];return t},at=function(s,t){if(typeof s===de&&s.length>0){for(var e in s)if(z(s[e])==z(t))return!0;return!1}return le(s)?z(t).indexOf(z(s))!==-1:!1},Ue=function(s,t){for(var e in s)return/^(browser|cpu|device|engine|os)$/.test(e)||(t?Ue(s[e]):!1)},le=function(s){return typeof s===tt},Qe=function(s){if(s){for(var t=[],e=j(/\\?\"/g,s).split(","),i=0;i<e.length;i++)if(e[i].indexOf(";")>-1){var n=fe(e[i]).split(";v=");t[i]={brand:n[0],version:n[1]}}else t[i]=fe(e[i]);return t}},z=function(s){return le(s)?s.toLowerCase():s},Je=function(s){return le(s)?j(/[^\d\.]/g,s).split(".")[0]:void 0},F=function(s){for(var t in s){var e=s[t];typeof e==de&&e.length==2?this[e[0]]=e[1]:this[e]=void 0}return this},j=function(s,t){return le(t)?t.replace(s,ce):t},we=function(s){return j(/\\?\"/g,s)},fe=function(s,t){if(le(s))return s=j(/^\s\s*/,s),typeof t===V?s:s.substring(0,st)},Mt=function(s,t){if(!(!s||!t))for(var e=0,i,n,o,a,h,g;e<t.length&&!h;){var m=t[e],w=t[e+1];for(i=n=0;i<m.length&&!h&&m[i];)if(h=m[i++].exec(s),h)for(o=0;o<w.length;o++)g=h[++n],a=w[o],typeof a===de&&a.length>0?a.length===2?typeof a[1]==et?this[a[0]]=a[1].call(this,g):this[a[0]]=a[1]:a.length===3?typeof a[1]===et&&!(a[1].exec&&a[1].test)?this[a[0]]=g?a[1].call(this,g,a[2]):void 0:this[a[0]]=g?g.replace(a[1],a[2]):void 0:a.length===4&&(this[a[0]]=g?a[3].call(this,g.replace(a[1],a[2])):void 0):this[a]=g||void 0;e+=2}},Le=function(s,t){for(var e in t)if(typeof t[e]===de&&t[e].length>0){for(var i=0;i<t[e].length;i++)if(at(t[e][i],s))return e===gt?void 0:e}else if(at(t[e],s))return e===gt?void 0:e;return t.hasOwnProperty("*")?t["*"]:s},St={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Tt={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:"Watch",xr:["VR","XR"],"?":["Desktop","Unknown"],"*":void 0},It={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[c,[r,Q+"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[c,[r,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[r,c],[/opios[\/ ]+([\w\.]+)/i],[c,[r,me+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[c,[r,me+" GX"]],[/\bopr\/([\w\.]+)/i],[c,[r,me]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[c,[r,"Baidu"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[r,c],[/\bddg\/([\w\.]+)/i],[c,[r,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[c,[r,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[c,[r,"WeChat"]],[/konqueror\/([\w\.]+)/i],[c,[r,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[c,[r,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[c,[r,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[c,[r,"Smart "+yt+J]],[/(avast|avg)\/([\w\.]+)/i],[[r,/(.+)/,"$1 Secure"+J],c],[/\bfocus\/([\w\.]+)/i],[c,[r,pe+" Focus"]],[/\bopt\/([\w\.]+)/i],[c,[r,me+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[c,[r,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[c,[r,"Dolphin"]],[/coast\/([\w\.]+)/i],[c,[r,me+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[c,[r,"MIUI"+J]],[/fxios\/([\w\.-]+)/i],[c,[r,Q+pe]],[/\bqihu|(qi?ho?o?|360)browser/i],[[r,"360"+J]],[/\b(qq)\/([\w\.]+)/i],[[r,/(.+)/,"$1Browser"],c],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[r,/(.+)/,"$1"+J],c],[/samsungbrowser\/([\w\.]+)/i],[c,[r,Se+" Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[r,/_/g," "],c],[/metasr[\/ ]?([\d\.]+)/i],[c,[r,Ct+" Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[r,Ct+" Mobile"],c],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[r,c],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[r],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[r,Et],c],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[r,c],[/\bgsa\/([\w\.]+) .*safari\//i],[c,[r,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[c,[r,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[c,[r,Ie+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[r,Ie+" WebView"],c],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[c,[r,"Android"+J]],[/chrome\/([\w\.]+) mobile/i],[c,[r,Q+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[r,c],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[c,[r,Q+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[r,Q+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[c,r],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[r,[c,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[r,c],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[r,Q+pe],c],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[r,"Netscape"],c],[/(wolvic)\/([\w\.]+)/i],[r,c],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[c,[r,pe+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[r,[c,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[r,[c,/[^\d\.]+./,ce]]],cpu:[[/\b(?:(amd|x|x86[-_]?|wow|win)64)\b/i],[[S,"amd64"]],[/(ia32(?=;))/i,/((?:i[346]|x)86)[;\)]/i],[[S,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[S,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[S,"armhf"]],[/windows (ce|mobile); ppc;/i],[[S,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[S,/ower/,ce,z]],[/(sun4\w)[;\)]/i],[[S,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[S,z]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[l,[u,Se],[d,f]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[l,[u,Se],[d,b]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[l,[u,ge],[d,b]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[l,[u,ge],[d,f]],[/(macintosh);/i],[l,[u,ge]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[l,[u,vt],[d,b]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[l,[u,ft],[d,f]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[l,[u,ft],[d,b]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[l,/_/g," "],[u,Ke],[d,b]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[l,/_/g," "],[u,Ke],[d,f]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[l,[u,"OPPO"],[d,b]],[/\b(opd2\d{3}a?) bui/i],[l,[u,"OPPO"],[d,f]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[l,[u,"Vivo"],[d,b]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[l,[u,"Realme"],[d,b]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[l,[u,kt],[d,b]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[l,[u,kt],[d,f]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[l,[u,je],[d,f]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[l,[u,je],[d,b]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[l,[u,yt],[d,f]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[l,/_/g," "],[u,"Nokia"],[d,b]],[/(pixel c)\b/i],[l,[u,Me],[d,f]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[l,[u,Me],[d,b]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[l,[u,Te],[d,b]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[l,"Xperia Tablet"],[u,Te],[d,f]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[l,[u,"OnePlus"],[d,b]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[l,[u,Ce],[d,f]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[l,/(.+)/g,"Fire Phone $1"],[u,Ce],[d,b]],[/(playbook);[-\w\),; ]+(rim)/i],[l,u,[d,f]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[l,[u,bt],[d,b]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[l,[u,wt],[d,f]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[l,[u,wt],[d,b]],[/(nexus 9)/i],[l,[u,"HTC"],[d,f]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[u,[l,/_/g," "],[d,b]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[l,[u,"Acer"],[d,f]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[l,[u,"Meizu"],[d,b]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[l,[u,"Ulefone"],[d,b]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[u,l,[d,b]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[u,l,[d,f]],[/(surface duo)/i],[l,[u,xe],[d,f]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[l,[u,"Fairphone"],[d,b]],[/(shield[\w ]+) b/i],[l,[u,"Nvidia"],[d,f]],[/(sprint) (\w+)/i],[u,l,[d,b]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[u,xe],[d,b]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[u,Xe],[d,f]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[u,Xe],[d,b]],[/smart-tv.+(samsung)/i],[u,[d,I]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[u,Se],[d,I]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[u,je],[d,I]],[/(apple) ?tv/i],[u,[l,ge+" TV"],[d,I]],[/crkey/i],[[l,Ie+"cast"],[u,Me],[d,I]],[/droid.+aft(\w+)( bui|\))/i],[l,[u,Ce],[d,I]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[l,[u,vt],[d,I]],[/(bravia[\w ]+)( bui|\))/i],[l,[u,Te],[d,I]],[/(mitv-\w{5}) bui/i],[l,[u,Ke],[d,I]],[/Hbbtv.*(technisat) (.*);/i],[u,l,[d,I]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[u,fe],[l,fe],[d,I]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[d,I]],[/(ouya)/i,/(nintendo) (\w+)/i],[u,l,[d,Y]],[/droid.+; (shield) bui/i],[l,[u,"Nvidia"],[d,Y]],[/(playstation \w+)/i],[l,[u,Te],[d,Y]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[l,[u,xe],[d,Y]],[/((pebble))app/i],[u,l,[d,Re]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[l,[u,ge],[d,Re]],[/droid.+; (wt63?0{2,3})\)/i],[l,[u,Xe],[d,Re]],[/droid.+; (glass) \d/i],[l,[u,Me],[d,pt]],[/(quest( \d| pro)?)/i],[l,[u,Et],[d,pt]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[u,[d,it]],[/(aeobc)\b/i],[l,[u,Ce],[d,it]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[l,[d,b]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[l,[d,f]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[d,f]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[d,b]],[/(android[-\w\. ]{0,9});.+buil/i],[l,[u,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[c,[r,ki+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[c,[r,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[r,c],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[c,r]],os:[[/microsoft (windows) (vista|xp)/i],[r,c],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[r,[c,Le,St]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[c,Le,St],[r,nt]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[c,/_/g,"."],[r,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[r,"macOS"],[c,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[c,r],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[r,c],[/\(bb(10);/i],[c,[r,bt]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[c,[r,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[c,[r,pe+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[c,[r,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[c,[r,"watchOS"]],[/crkey\/([\d\.]+)/i],[c,[r,Ie+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[r,"Chrome OS"],c],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[r,c],[/(sunos) ?([\w\.\d]*)/i],[[r,"Solaris"],c],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[r,c]]},Pe=function(){var s={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return F.call(s.init,[[P,[r,c,be,d]],[B,[S]],[R,[d,l,u]],[D,[r,c]],[A,[r,c]]]),F.call(s.isIgnore,[[P,[c,be]],[D,[c]],[A,[c]]]),F.call(s.isIgnoreRgx,[[P,/ ?browser$/i],[A,/ ?os$/i]]),F.call(s.toString,[[P,[r,c]],[B,[S]],[R,[u,l]],[D,[r,c]],[A,[r,c]]]),s}(),Ci=function(s,t){var e=Pe.init[t],i=Pe.isIgnore[t]||0,n=Pe.isIgnoreRgx[t]||0,o=Pe.toString[t]||0;function a(){F.call(this,e)}return a.prototype.getItem=function(){return s},a.prototype.withClientHints=function(){return G?G.getHighEntropyValues(Gt).then(function(h){return s.setCH(new Ht(h,!1)).parseCH().get()}):s.parseCH().get()},a.prototype.withFeatureCheck=function(){return s.detectFeature().get()},t!=ee&&(a.prototype.is=function(h){var g=!1;for(var m in this)if(this.hasOwnProperty(m)&&!at(i,m)&&z(n?j(n,this[m]):this[m])==z(n?j(n,h):h)){if(g=!0,h!=V)break}else if(h==V&&g){g=!g;break}return g},a.prototype.toString=function(){var h=ce;for(var g in o)typeof this[o[g]]!==V&&(h+=(h?" ":ce)+this[o[g]]);return h||V}),G||(a.prototype.then=function(h){var g=this,m=function(){for(var v in g)g.hasOwnProperty(v)&&(this[v]=g[v])};m.prototype={is:a.prototype.is,toString:a.prototype.toString};var w=new m;return h(w),w}),new a};function Ht(s,t){if(s=s||{},F.call(this,Gt),t)F.call(this,[[ot,Qe(s[W])],[rt,Qe(s[gi])],[b,/\?1/.test(s[bi])],[l,we(s[fi])],[Z,we(s[Nt])],[ct,we(s[yi])],[S,we(s[pi])],[$,Qe(s[wi])],[Ge,we(s[mi])]]);else for(var e in s)this.hasOwnProperty(e)&&typeof s[e]!==V&&(this[e]=s[e])}function Pt(s,t,e,i){return this.get=function(n){return n?this.data.hasOwnProperty(n)?this.data[n]:void 0:this.data},this.set=function(n,o){return this.data[n]=o,this},this.setCH=function(n){return this.uaCH=n,this},this.detectFeature=function(){if(T&&T.userAgent==this.ua)switch(this.itemType){case P:T.brave&&typeof T.brave.isBrave==et&&this.set(r,"Brave");break;case R:!this.get(d)&&G&&G[b]&&this.set(d,b),this.get(l)=="Macintosh"&&T&&typeof T.standalone!==V&&T.maxTouchPoints&&T.maxTouchPoints>2&&this.set(l,"iPad").set(d,f);break;case A:!this.get(r)&&G&&G[Z]&&this.set(r,G[Z]);break;case ee:var n=this.data,o=function(a){return n[a].getItem().detectFeature().get()};this.set(P,o(P)).set(B,o(B)).set(R,o(R)).set(D,o(D)).set(A,o(A))}return this},this.parseUA=function(){return this.itemType!=ee&&Mt.call(this.data,this.ua,this.rgxMap),this.itemType==P&&this.set(be,Je(this.get(c))),this},this.parseCH=function(){var n=this.uaCH,o=this.rgxMap;switch(this.itemType){case P:var a=n[rt]||n[ot],h;if(a)for(var g in a){var m=j(/(Google|Microsoft) /,a[g].brand||a[g]),w=a[g].version;!/not.a.brand/i.test(m)&&(!h||/chrom/i.test(h)&&!/chromi/i.test(m))&&(this.set(r,m).set(c,w).set(be,Je(w)),h=m)}break;case B:var v=n[S];v&&(v&&n[Ge]=="64"&&(v+="64"),Mt.call(this.data,v+";",o));break;case R:if(n[b]&&this.set(d,b),n[l]&&this.set(l,n[l]),n[l]=="Xbox"&&this.set(d,Y).set(u,xe),n[$]){var N;if(typeof n[$]!="string")for(var K=0;!N&&K<n[$].length;)N=Le(n[$][K++],Tt);else N=Le(n[$],Tt);this.set(d,N)}break;case A:var X=n[Z];if(X){var L=n[ct];X==nt&&(L=parseInt(Je(L),10)>=13?"11":"10"),this.set(r,X).set(c,L)}this.get(r)==nt&&n[l]=="Xbox"&&this.set(r,"Xbox").set(c,void 0);break;case ee:var ue=this.data,O=function(_){return ue[_].getItem().setCH(n).parseCH().get()};this.set(P,O(P)).set(B,O(B)).set(R,O(R)).set(D,O(D)).set(A,O(A))}return this},F.call(this,[["itemType",s],["ua",t],["uaCH",i],["rgxMap",e],["data",Ci(this,s)]]),this}function x(s,t,e){if(typeof s===de?(Ue(s,!0)?(typeof t===de&&(e=t),t=s):(e=s,t=void 0),s=void 0):typeof s===tt&&!Ue(t,!0)&&(e=t,t=void 0),!(this instanceof x))return new x(s,t,e).getResult();var i=typeof s===tt?s:T&&T.userAgent?T.userAgent:e&&e[mt]?e[mt]:ce,n=new Ht(e,!0),o=t?Ei(It,t):It,a=function(h){return h==ee?function(){return new Pt(h,i,o,n).set("ua",i).set(P,this.getBrowser()).set(B,this.getCPU()).set(R,this.getDevice()).set(D,this.getEngine()).set(A,this.getOS()).get()}:function(){return new Pt(h,i,o[h],n).parseUA().get()}};return F.call(this,[["getBrowser",a(P)],["getCPU",a(B)],["getDevice",a(R)],["getEngine",a(D)],["getOS",a(A)],["getResult",a(ee)],["getUA",function(){return i}],["setUA",function(h){return le(h)&&(i=h.length>st?fe(h,st):h),this}]]).setUA(i),this}x.VERSION=hi;x.BROWSER=He([r,c,be,d]);x.CPU=He([S]);x.DEVICE=He([l,u,d,Y,b,I,f,Re,it]);x.ENGINE=x.OS=He([r,c]);class Vt{constructor(t,e){p(this,"config");p(this,"sdkConfig");this.config=t,this.sdkConfig=e}on(t,e,i){const n=function(a){a.data.message!==`kalamba:wrapper-rgs:${t}`&&a.data.message!==`kalamba:wrapper:${t}`||e(a.data.payload)};window.addEventListener("message",n,i)}send(t,...[e]){window.postMessage({message:`kalamba:rgs:${t}`,payload:e})}}class Mi{constructor(t){p(this,"socket",null);p(this,"webSocketUrl");p(this,"eventListeners",{close:[],error:[],message:[]});p(this,"connect",async()=>{const t=new WebSocket(this.webSocketUrl);return t.addEventListener("message",this.handleMessage),new Promise(e=>{t.addEventListener("open",i=>{this.handleOpen(i),e(this.socket)},{once:!0})})});p(this,"send",t=>{if(this.socket==null)throw new Error("Cannot send message, the WebSocket connection is not open");this.socket.send(t)});p(this,"close",()=>{if(this.socket==null)throw new Error("Cannot close the WebSocket connection that is not open");this.socket.close()});p(this,"handleClose",t=>{this.eventListeners.close.forEach(e=>{e(t)}),this.socket.removeEventListener("message",this.handleMessage),this.socket.removeEventListener("close",this.handleClose),this.socket.removeEventListener("error",this.handleError),this.socket=null});p(this,"handleError",t=>{this.eventListeners.error.forEach(e=>{e(t)})});p(this,"handleMessage",t=>{this.eventListeners.message.forEach(e=>{e(t)})});p(this,"handleOpen",t=>{const e=t.target;e.addEventListener("close",this.handleClose),e.addEventListener("error",this.handleError),this.socket=e});this.webSocketUrl=t}addEventListener(t,e){this.eventListeners[t].push(e)}removeEventListener(t,e){const i=this.eventListeners[t].indexOf(e);i!==-1&&this.eventListeners[t].splice(i,1)}}function Ae(s){return JSON.parse(s==null?void 0:s.data)}function Si(s){var t;return((t=s==null?void 0:s.header)==null?void 0:t.name)==="Ping"}function At(s){var t;return((t=s==null?void 0:s.header)==null?void 0:t.name)==="RealityCheck"}function _e(s){return s.header.name==="GameEvent"}function Ti(s){return _e(s)&&s.body.event==="OPEN_GAME"}function Ot(s){return s.header.code!==1}function Ii(s){return _e(s)&&s.body.event.includes("_RESULT")}var te,ye;class Pi extends Mi{constructor(e,i){const n=new URL(e.apiUrl);n.searchParams.set("cageCode",e.cageCode),n.searchParams.set("gameCode",e.gameCode),n.searchParams.set("operatorCode",e.operatorCode),n.searchParams.set("playMode",e.playMode),n.searchParams.set("token",e.token),n.searchParams.set("username",e.username);super(n.toString());p(this,"cId",0);p(this,"mId",0);p(this,"seqId",0);p(this,"gameCode");M(this,te,void 0);M(this,ye,void 0);p(this,"onMessage",e=>{const i=Ae(e);(_e(i)||Si(i)||At(i))&&this.sendAcknowledgement(i),At(i)&&this.handleRealityCheck(i)});this.eventListeners.realityCheck=[],this.gameCode=e.gameCode,k(this,te,i.requestTimeoutMs),k(this,ye,i.gameVersion??"unknown"),this.addEventListener("message",this.onMessage)}handleRealityCheck(e){this.eventListeners.realityCheck.forEach(i=>{i(e.body)})}addEventListener(e,i){super.addEventListener(e,i)}removeEventListener(e,i){super.removeEventListener(e,i)}buildHeader(e,i=null){return{cId:i??++this.cId,code:i!==null?1:void 0,mId:++this.mId,name:e}}buildPayload(e,i){return JSON.stringify({body:i,header:e})}getBodyExtras(e){return{action:e,seqId:++this.seqId}}request(e,i){const n=this.buildPayload(e,i);return new Promise((o,a)=>{setTimeout(()=>a({type:"timeout"}),y(this,te));const h=g=>{const m=Ae(g);try{e.cId===m.header.cId&&(this.removeEventListener("message",h),m.header.code===1?o(m):a({message:m,type:"error"}))}catch{a({message:m,type:"error"})}};this.addEventListener("message",h),this.send(n)})}freeRounds(e){const i=this.buildHeader("ActivateFreeRound");return this.request(i,e).then(n=>n.body).catch(n=>{var o;throw{data:(o=n==null?void 0:n.message)==null?void 0:o.body,type:n.type}})}async authenticate(e=!1){const i=this.buildHeader("Authenticate"),n={clientType:3,version:y(this,ye),reconnect:e};return this.request(i,n).then(o=>o.body).catch(o=>{var a;throw{data:(a=o==null?void 0:o.message)==null?void 0:a.body,type:o.type}})}async openGame(){const e=this.buildHeader("OpenGame"),i={gameCode:this.gameCode};return new Promise((n,o)=>{const a=h=>{const g=Ae(h);Ti(g)?(this.removeEventListener("message",a),n(g.body)):Ot(g)&&o({data:g.body,type:"error"})};this.addEventListener("message",a),this.request(e,i).catch(h=>{var g;return o({data:(g=h==null?void 0:h.message)==null?void 0:g.body,type:h.type})})})}sendAcknowledgement(e){const{name:i,cId:n}=e.header,o=this.buildHeader(i,n),a=this.buildPayload(o,{});this.send(a)}sendAction(e,i){const n=this.buildHeader("GameAction"),o={...this.getBodyExtras(e),data:i};return new Promise((a,h)=>{const g=m=>{const w=Ae(m);_e(w)&&o.seqId===w.body.correlationSeqId&&(this.removeEventListener("message",g),Ii(w)?a(w.body):Ot(w)&&h({data:w.body,type:"error"}))};this.addEventListener("message",g),this.request(n,o).catch(m=>{var w;return h({data:(w=m==null?void 0:m.message)==null?void 0:w.body,type:m.type})})})}setRequestTimeoutMs(e){k(this,te,e)}}te=new WeakMap,ye=new WeakMap;function zt(s){const t=s.contract;return t?{contract:{balance:{coins:t.balance,version:t.balanceVersion},coinValueInCents:t.coinValueInCents,country:t.countryCode,currency:t.currencyCode,jurisdiction:t.jurisdictionCode,uiMessages:t.uiMessages,username:t.username}}:{contract:{balance:{coins:s.balance,version:s.balanceVersion},coinValueInCents:s.coinValueInCents,country:s.countryCode,currency:s.currencyCode,jurisdiction:s.jurisdictionCode,uiMessages:s.uiMessages,username:s.username}}}function qt(s){var t,e;return{code:((t=s.data)==null?void 0:t.code)??Ne.RgsErrorCode.UNKNOWN,details:(e=s.data)==null?void 0:e.details}}function Wt(s,t){const e=t.contract;if(!e){const i=t.data;return{contract:{bet:{available:i.additionalConfigData.availableMultipliersPerBaseBet,default:{base:i.additionalConfigData.defaultBet.baseBet,multiplier:i.additionalConfigData.defaultBet.betMultiplier},max:i.additionalConfigData.maxAllowedOverallBetInCoins,last:i.gameState.betFromCurrentRound?{base:i.gameState.betFromCurrentRound.baseBet,multiplier:i.gameState.betFromCurrentRound.betMultiplier}:null,lastPaid:i.gameState.lastPlacedMainGameBet?{base:i.gameState.lastPlacedMainGameBet.baseBet,multiplier:i.gameState.lastPlacedMainGameBet.betMultiplier}:null},balance:{coins:t.balance,version:t.balanceVersion},freeRounds:(i.FREE_ROUNDS??[]).map(n=>({conf:{base:n.conf.baseBet,multiplier:n.conf.betMultiplier,numAwarded:n.conf.numAwarded},data:{numPlayed:n.data.numPlayed,win:n.data.winAmount,numLeft:n.data.numLeft},id:n.id,rejectable:n.rejectable,skippable:n.skippable,status:n.status,type:n.type})),gameModel:i.additionalConfigData.gameModelFile,metaData:i.gameConfigData.metaData,roundId:i.gameState.cycleId,serverTime:t.balanceVersion,sessionId:i.gameState.sessionId,stateType:{thisRound:i.gameState.stateTypeThisRound,nextRound:i.gameState.stateTypeNextRound},uiMessages:s.uiMessages,win:{round:i.gameState.totalWinFromCurrentRound,total:i.gameState.totalWinFromCurrentGameCycle}},data:i}}return{contract:{bet:{available:e.availableMultipliersPerBaseBet,default:{base:e.defaultBet.baseBet,multiplier:e.defaultBet.betMultiplier},max:e.maxBetInCoins,last:e.lastBet?{base:e.lastBet.baseBet,multiplier:e.lastBet.betMultiplier}:null,lastPaid:e.lastMainGameBet?{base:e.lastMainGameBet.baseBet,multiplier:e.lastMainGameBet.betMultiplier}:null},balance:{coins:e.balanceInCoins,version:e.balanceVersion},freeRounds:(e.freeRounds??[]).map(i=>({conf:{base:i.conf.baseBet,multiplier:i.conf.betMultiplier,numAwarded:i.conf.numAwarded},data:{numPlayed:i.data.numPlayed,win:i.data.winAmount,numLeft:i.data.numLeft},id:i.id,rejectable:i.rejectable,skippable:i.skippable,status:i.status,type:i.type})),gameModel:e.gameModelFile,metaData:e.metaData,roundId:e.roundId,serverTime:e.serverTime,sessionId:e.sessionId,stateType:{thisRound:e.stateTypeThisRound,nextRound:e.stateTypeNextRound},uiMessages:s.contract.uiMessages.concat(e.uiMessages),win:{round:e.roundWin,total:e.totalWin}},data:t.opaqueGameServerToUi}}function $t(s){var t,e;return{code:((t=s.data)==null?void 0:t.code)??Ne.RgsErrorCode.UNKNOWN,details:(e=s.data)==null?void 0:e.details}}function jt(s){const t=s.contract;if(!t){const e=s.data;return{contract:{bet:{last:e.gameState.betFromCurrentRound?{base:e.gameState.betFromCurrentRound.baseBet,multiplier:e.gameState.betFromCurrentRound.betMultiplier}:null,lastPaid:{base:e.gameState.lastPlacedMainGameBet.baseBet,multiplier:e.gameState.lastPlacedMainGameBet.betMultiplier}},balance:{coins:s.balance,version:s.balanceVersion},freeRounds:(e.FREE_ROUNDS??[]).map(i=>({conf:{base:i.conf.baseBet,multiplier:i.conf.betMultiplier,numAwarded:i.conf.numAwarded},data:{numPlayed:i.data.numPlayed,win:i.data.winAmount,numLeft:i.data.numLeft},id:i.id,rejectable:i.rejectable,skippable:i.skippable,status:i.status,type:i.type})),serverTime:s.balanceVersion,roundId:e.gameState.cycleId,stateType:{thisRound:e.gameState.stateTypeThisRound,nextRound:e.gameState.stateTypeNextRound},uiMessages:e.uiMessages,win:{round:e.gameState.totalWinFromCurrentRound,total:e.gameState.totalWinFromCurrentGameCycle}},data:e}}return{contract:{bet:{last:t.lastBet?{base:t.lastBet.baseBet,multiplier:t.lastBet.betMultiplier}:null,lastPaid:{base:t.lastMainGameBet.baseBet,multiplier:t.lastMainGameBet.betMultiplier}},balance:{coins:t.balanceInCoins,version:t.balanceVersion},freeRounds:(t.freeRounds??[]).map(e=>({conf:{base:e.conf.baseBet,multiplier:e.conf.betMultiplier,numAwarded:e.conf.numAwarded},data:{numPlayed:e.data.numPlayed,win:e.data.winAmount,numLeft:e.data.numLeft},id:e.id,rejectable:e.rejectable,skippable:e.skippable,status:e.status,type:e.type})),serverTime:t.serverTime,roundId:t.roundId,stateType:{thisRound:t.stateTypeThisRound,nextRound:t.stateTypeNextRound},uiMessages:t.uiMessages,win:{round:t.roundWin,total:t.totalWin}},data:s.opaqueGameServerToUi}}function Kt(s){var t,e;return{code:((t=s.data)==null?void 0:t.code)??Ne.RgsErrorCode.UNKNOWN,details:(e=s.data)==null?void 0:e.details}}const Ai={parseAuthenticateResponse:zt,parseAuthenticateError:qt,parseOpenGameResponse:Wt,parseOpenGameError:$t,parsePlayResponse:jt,parsePlayError:Kt},Oi={bul:"bg",chi:"zh",zho:"zh",hrv:"hr",cze:"cs",dan:"da",dut:"nl",eng:"en",est:"et",fin:"fi",fra:"fr",ger:"de",gre:"el",hun:"hu",ind:"id",ita:"it",jpn:"ja",kor:"ko",nor:"no",pol:"pl",por:"pt",rum:"ro",rus:"ru",srp:"sr",slo:"sk",spa:"es",swe:"sv",tha:"th",tur:"tr",ukr:"uk",vie:"vi"},{device:Ri}=x(navigator.userAgent),xi=U("KalambaBullseyePlugin","color:#000000;font-weight:bold;");class Ui extends Vt{constructor(...e){super(...e);p(this,"socket");this.on("openGame",async()=>{try{const i=await this.openGame();this.send("openGameResponse",i)}catch(i){this.send("openGameError",i)}}),this.on("play",async i=>{try{const n=await this.play(i);this.send("playResponse",n)}catch(n){this.send("playError",n)}}),this.on("freeRounds",async i=>{try{await this.socket.freeRounds(i),this.send("freeRoundsResponse",i)}catch(n){this.send("freeRoundsError",n)}}),this.on("configured",i=>{this.socket.setRequestTimeoutMs(i.ui.requestTimeoutMs)}),this.registerFromSdkEvents()}initialize(e){this.socket=new Pi(e,{gameVersion:this.config.gameVersion,requestTimeoutMs:this.sdkConfig.ui.requestTimeoutMs}),["deeprush","sharkstrike","fireboltroulette"].includes(e.gameCode)||(this.socket.addEventListener("close",i=>{i.code===1008?this.send("error",{type:"CLOSE",messageCode:"TOO_MANY_OPEN_GAMES",messageKey:"RgsError.TOO_MANY_OPEN_GAMES"}):i.code===1011||this.reconnect()}),["mobile","tablet"].includes(Ri.type??"")&&document.addEventListener("visibilitychange",async()=>{document.hidden||(this.socket.socket?this.socket.socket&&[WebSocket.CONNECTING,WebSocket.OPEN].includes(this.socket.socket.readyState)&&this.socket.close():this.reconnect())})),this.socket.addEventListener("error",i=>xi("error",i)),this.socket.addEventListener("realityCheck",i=>{this.send("realityCheck",i)})}async reconnect(){try{await this.socket.connect(),await this.socket.authenticate(!0),await this.socket.openGame()}catch{this.send("error",{type:"CLOSE",messageCode:"CONNECTION_ERROR",messageKey:"RgsError.CONNECTION_ERROR"})}}async openGame(){const e=new URLSearchParams(window.location.search),i=e.get("apiUrl"),n=e.get("cageCode"),o=e.get("gameCode"),a=e.get("operatorCode"),h=e.get("playMode"),g=e.get("token"),m=e.get("username"),w=e.get("gameHistoryUrl"),v=e.get("homeUrl")??void 0,N=e.get("cashierUrl")??void 0;this.initialize({apiUrl:i,cageCode:n,gameCode:o,operatorCode:a,playMode:h,token:g,username:m});try{await this.socket.connect()}catch{throw{type:"error",data:{code:Ne.RgsErrorCode.CONNECTION_ERROR}}}let K;try{K=await this.socket.authenticate()}catch(_){throw{type:_.type,data:_.type==="error"?qt(_.data):void 0}}let X;try{X=await this.socket.openGame()}catch(_){throw{type:_.type,data:_.type==="error"?$t(_.data):void 0}}const L=zt(K),ue=Wt(K,X);this.sdkConfig.api={brand:n,game:o,integration:a,jurisdiction:L.contract.jurisdiction,playMode:h,user:L.contract.username,integrationData:{token:g},country:L.contract.country,currency:L.contract.currency,coinValueInCents:L.contract.coinValueInCents,gameHistoryUrl:w,homeUrl:v,cashierUrl:N,sessionId:ue.contract.sessionId,lastRoundId:ue.contract.roundId};const O=e.get("languageCode");return O&&(this.sdkConfig.ui.language=O.length===3?Oi[O]??O:O),ue}async play(e){for(;!this.socket.socket;)await new Promise(v=>setTimeout(()=>v(),500));const{contract:{bet:i,forcedOutcomes:n,...o},extra:a,payloadToInject:h,actionType:g}=e,m={bet:i?{baseBet:i.base,betMultiplier:i.multiplier}:void 0,forcedOutcomes:n,...o,...h,opaqueUiToGameServer:a};let w;try{w=await this.socket.sendAction(g,m)}catch(v){throw{type:v.type,data:v.type==="error"?Kt(v.data):void 0}}return jt(w)}registerFromSdkEvents(){this.on("history",()=>{const{api:{game:e,integration:i,integrationData:n,jurisdiction:o,user:a,gameHistoryUrl:h},ui:{language:g}}=this.sdkConfig,m=a.replace(/^user_/,"").replace(new RegExp(`_${i}$`),""),w=new URL(h);w.searchParams.set("gameCode",e),w.searchParams.set("jurisdiction",o),w.searchParams.set("operatorCode",i),w.searchParams.set("token",n.token),w.searchParams.set("username",m),w.searchParams.set("languageCode",g),this.config.gameHistoryUrl&&w.searchParams.set("gameHistoryUrl",this.config.gameHistoryUrl),window.open(w.toString(),"_blank")})}}class Xt{constructor(t,e,i){p(this,"trackers");p(this,"config");p(this,"sdkConfig");this.trackers=t,this.config=e,this.sdkConfig=i}on(t,e,i){const n=function(a){a.data.message!==`kalamba:wrapper-telemetry:${t}`&&a.data.message!==`kalamba:wrapper:${t}`||e(a.data.payload)};window.addEventListener("message",n,i)}track(t,e){this.trackers.forEach(i=>i.track(t,e))}}function Rt(s){return s.reduce((t,e)=>t+e,0)}function Li(s){const t=s.length,e=Rt(s)/t,i=s.map(o=>Math.pow(o-e,2)),n=Rt(i)/t;return Math.sqrt(n)}class xt{constructor(){p(this,"rafId",-1);p(this,"startTime",0);p(this,"stopTime",0);p(this,"frames",[]);p(this,"calculateFPS",()=>{const t=Math.floor((this.stopTime-this.startTime)/1e3);return this.frames.map(e=>Math.floor((e-this.startTime)/1e3)).reduce((e,i,n,o)=>(o[n]!==o[n-1]?e.push(1):e[e.length-1]++,e),[]).slice(0,t)});p(this,"getReport",()=>{const t=this.calculateFPS(),e=Math.floor(this.frames.length/((this.stopTime-this.startTime)/1e3)),i=t.length>0?Math.max(...t):e,n=t.length>0?Math.min(...t):e,o=t.length>0?Li(t):0;return{fpsAvg:e,fpsMax:i,fpsMin:n,fpsStdDev:o}});p(this,"start",()=>{this.startTime=Date.now(),this.frames=[],this.trackFrames()});p(this,"stop",()=>{cancelAnimationFrame(this.rafId),this.stopTime=Date.now()});p(this,"trackFrames",()=>{this.frames.push(Date.now()),this.rafId=requestAnimationFrame(this.trackFrames)})}}const _i="landscape",Bi="portrait";function Di(){try{const s=document.createElement("canvas");return!!window.WebGLRenderingContext&&(s.getContext("webgl")||s.getContext("experimental-webgl"))instanceof WebGLRenderingContext}catch{return!1}}async function Fi(){if(!window.createImageBitmap)return!1;const e=await(await fetch("data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoCAAEAAQAcJaQAA3AA/v3AgAA=")).blob();try{return await createImageBitmap(e),!0}catch{return!1}}function Ye(){return window.innerWidth>=window.innerHeight?_i:Bi}var Be,ie,se,ne,ke,De,ve,Fe;class Ni extends Xt{constructor(...e){super(...e);p(this,"FPS_SAMPLE_INTERVAL",1e4);M(this,Be,0);M(this,ie,void 0);M(this,se,void 0);M(this,ne,void 0);M(this,ke,!1);M(this,De,!1);M(this,ve,"");M(this,Fe,[]);k(this,se,{}),k(this,ne,this.deviceInfo()),k(this,ie,this.config.gameVersion),this.on("state",({balance:i})=>{k(this,Be,i)}),this.on("autoplay",({action:i})=>{["start","resume"].includes(i)?k(this,ke,!0):k(this,ke,!1)}),this.on("settings",({fastPlay:i})=>{i!==void 0&&k(this,De,i)}),this.registerEvents()}async registerEvents(){y(this,ne).then(e=>{this.track("Device Information",e)}),this.on("loadStart",()=>{this.track("Game Loading",{progress:0,step:"initial"})}),this.on("loadProgress",e=>{this.track("Game Loading",{progress:e.progress})}),this.on("loadEnd",()=>{this.track("Game Loading",{progress:100,step:"complete"})}),this.on("error",e=>{this.track("System Message",{systemMessageText:e.messageCode,systemMessageType:e.type})}),this.on("openGameResponse",async e=>{k(this,ve,e.contract.stateType.nextRound),k(this,se,{balanceInCoins:e.contract.balance.coins,clientVersion:y(this,ie),coinValueInCents:this.sdkConfig.api.coinValueInCents,coinValueInCentsFloat:this.sdkConfig.api.coinValueInCents,currency:this.sdkConfig.api.currency,defaultBaseBet:e.contract.bet.default.base,defaultBetMultiplier:e.contract.bet.default.multiplier,environment:"release",gameCode:this.sdkConfig.api.game,gameCodeServer:this.sdkConfig.api.game,gameModelFile:e.contract.gameModel,jurisdiction:this.sdkConfig.api.jurisdiction,languageCode:this.sdkConfig.ui.language,operatorName:"kalamba",partnerId:this.sdkConfig.api.brand,partnerParentId:this.sdkConfig.api.integration,platform:"WEB",playMode:this.sdkConfig.api.playMode,referrer:window.location.hostname,serverVersion:e.contract.metaData.version}),this.track("Game Open",y(this,se))}),this.on("playCycleEnd",async e=>{const i=await y(this,ne),{base:n,multiplier:o,specialAction:a}=e.contract.bet.lastPaid??{},h=e.contract.balance.coins,g=e.contract.bet.lastPaid.base*e.contract.bet.lastPaid.multiplier,m=e.contract.win.total,w=m-g,v=a||"spin",N=e.contract.roundId;this.track("Betting Activity",{balance:h-w,balanceAfter:h,baseBet:n,betMultiplier:o,betType:v,gameVersion:y(this,ie),coinValueInCents:this.sdkConfig.api.coinValueInCents,coinValueInCentsFloat:this.sdkConfig.api.coinValueInCents,currency:this.sdkConfig.api.currency,environment:"release",gameCode:this.sdkConfig.api.game,gameCodeServer:this.sdkConfig.api.game,isMobile:i.isMobile,netResult:w,operatorName:"kalamba",orientation:Ye(),partnerId:this.sdkConfig.api.brand,partnerParentId:this.sdkConfig.api.integration,platform:"WEB",playMode:this.sdkConfig.api.playMode,roundId:N,roundTypes:["BaseGame"],totalBet:g,totalWin:m}),k(this,Fe,[])}),this.on("telemetry.click",e=>{this.track("UI Interaction",{action:"click",...this.getExtraUiInteractionData(),...e})}),this.on("telemetry.orientationChange",()=>{this.track("UI Interaction",{action:"orientationChange",...this.getExtraUiInteractionData()})}),this.reportFpsSample(),this.reportFpsRound()}reportFpsSample(){const e=new xt,i=()=>{e.stop();const o=e.getReport();this.track("FPS Performance",{...o,fpsType:"sample"}),n()},n=async()=>{e.start(),setTimeout(i,this.FPS_SAMPLE_INTERVAL)};n()}reportFpsRound(){const e=new xt;this.on("playCycleStart",()=>{e.start()}),this.on("playCycleEnd",()=>{e.stop();const i=e.getReport();this.track("FPS Performance",{...i,fpsType:"playCycleStart->playCycleEnd"})})}getExtraUiInteractionData(){return{orientation:Ye(),stateType:y(this,ve)}}async deviceInfo(){var h;const{browser:e,device:i,os:n}=x(navigator.userAgent),o=Di(),a=await Fi();return{browserName:e.name,browserVersion:e.version,connection:(h=navigator.connection)==null?void 0:h.effectiveType,deviceName:i.model,deviceType:i.type,isMobile:["mobile","tablet"].includes(i.type??""),isWebGLSupported:o,isWebPSupported:a,manufacturer:i.vendor,operatingSystem:n.name,operatingSystemVersion:n.version,orientation:Ye(),pixelRatio:window.devicePixelRatio,screenHeight:window.screen.height,screenSize:`${window.screen.width}x${window.screen.height}`,screenWidth:window.screen.width,timezoneOffsetMinutes:new Date().getTimezoneOffset(),windowHeight:window.innerHeight,windowSize:`${window.innerWidth}x${window.innerHeight}`,windowWidth:window.innerWidth}}}Be=new WeakMap,ie=new WeakMap,se=new WeakMap,ne=new WeakMap,ke=new WeakMap,De=new WeakMap,ve=new WeakMap,Fe=new WeakMap;var C=[];for(var Ze=0;Ze<256;++Ze)C.push((Ze+256).toString(16).slice(1));function Gi(s,t=0){return(C[s[t+0]]+C[s[t+1]]+C[s[t+2]]+C[s[t+3]]+"-"+C[s[t+4]]+C[s[t+5]]+"-"+C[s[t+6]]+C[s[t+7]]+"-"+C[s[t+8]]+C[s[t+9]]+"-"+C[s[t+10]]+C[s[t+11]]+C[s[t+12]]+C[s[t+13]]+C[s[t+14]]+C[s[t+15]]).toLowerCase()}var Oe,Hi=new Uint8Array(16);function Vi(){if(!Oe&&(Oe=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Oe))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Oe(Hi)}var zi=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const Ut={randomUUID:zi};function Lt(s,t,e){if(Ut.randomUUID&&!t&&!s)return Ut.randomUUID();s=s||{};var i=s.random||(s.rng||Vi)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,t){e=e||0;for(var n=0;n<16;++n)t[e+n]=i[n];return t}return Gi(i)}class dt{constructor(t,e){p(this,"config");p(this,"sdkConfig");this.config=t,this.sdkConfig=e}}const _t=25,Bt=1e4;var ae,oe,re,H,Ee;class qi extends dt{constructor(...e){super(...e);M(this,ae,"https://europe-west3-stargazer-328808.cloudfunctions.net/collect-events");M(this,oe,void 0);M(this,re,void 0);M(this,H,[]);M(this,Ee,void 0);p(this,"processQueueForced");k(this,oe,new Date().getTime()),k(this,H,[]),k(this,Ee,Lt()),this.processQueueForced=this.processQueue.bind(this,!0),this.schedule(),fetch(y(this,ae),{method:"OPTIONS"}).catch(ut.noop),this.subscribe()}subscribe(){window.addEventListener("beforeunload",this.processQueueForced,!1),window.addEventListener("pagehide",this.processQueueForced,!1),window.addEventListener("visibilitychange",this.processQueueForced,!1)}schedule(){y(this,re)&&clearTimeout(y(this,re)),k(this,re,window.setTimeout(()=>this.processQueue(),Bt))}send(e){k(this,oe,new Date().getTime());try{navigator.sendBeacon(y(this,ae),JSON.stringify(e))}catch{fetch(y(this,ae),{body:JSON.stringify(e),method:"POST",headers:{"Content-Type":"application/json"},keepalive:!0}).catch(ut.noop)}this.schedule()}addToQueue(e){y(this,H).push(e),this.processQueue()}processQueue(e=!1){if(!(this.sdkConfig==null||!this.sdkConfig.ui.feature.allowTelemetry)&&!(!e&&y(this,H).length<_t&&new Date().getTime()-y(this,oe)<Bt))for(;y(this,H).length;){const i=y(this,H).splice(0,_t).map(n=>({...n,sessionID:y(this,Ee),userID:this.sdkConfig.api.user}));this.send(i)}}track(e,i){this.addToQueue({eventName:e,eventParams:i,eventTimestamp:new Date().getTime(),eventUUID:Lt()})}}ae=new WeakMap,oe=new WeakMap,re=new WeakMap,H=new WeakMap,Ee=new WeakMap;const Wi=U("LoggingTracker","color:#000000;font-weight:bold;");class $i extends dt{track(t,e){Wi(`@${this.sdkConfig.api.user}`,`[${t}]`,e)}}exports.BasicPlugin=Zt;exports.CasinoPlugin=q;exports.DebuggingPlugin=ti;exports.GigPlugin=si;exports.KalambaBullseyeParsers=Ai;exports.KalambaBullseyePlugin=Ui;exports.KalambaStargazerPlugin=Ni;exports.KalambaStargazerTracker=qi;exports.LoggingTracker=$i;exports.OryxPlugin=ai;exports.PariplayPlugin=di;exports.RelaxFEIMPlugin=li;exports.RgsPlugin=Vt;exports.TelemetryPlugin=Xt;exports.Tracker=dt;exports.TukoPlugin=ui;
|
package/dist/plugins.d.ts
CHANGED
|
@@ -1,3 +1,41 @@
|
|
|
1
|
+
declare type AuthenticateResponse = WebSocketResponse<'Authenticate', {
|
|
2
|
+
code: (typeof AuthenticateResponseCode)[keyof typeof AuthenticateResponseCode];
|
|
3
|
+
}, Record<string, unknown> & {
|
|
4
|
+
contract: {
|
|
5
|
+
balance: number;
|
|
6
|
+
balanceVersion: number;
|
|
7
|
+
coinValueInCents: number;
|
|
8
|
+
countryCode: string;
|
|
9
|
+
currencyCode: string;
|
|
10
|
+
jurisdictionCode: string;
|
|
11
|
+
uiMessages: UiMessage[];
|
|
12
|
+
username: string;
|
|
13
|
+
};
|
|
14
|
+
}>;
|
|
15
|
+
|
|
16
|
+
declare type AuthenticateResponse_2 = {
|
|
17
|
+
contract: {
|
|
18
|
+
balance: {
|
|
19
|
+
coins: number;
|
|
20
|
+
version: number;
|
|
21
|
+
};
|
|
22
|
+
coinValueInCents: number;
|
|
23
|
+
country: string;
|
|
24
|
+
currency: string;
|
|
25
|
+
jurisdiction: string;
|
|
26
|
+
uiMessages: unknown[];
|
|
27
|
+
username: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
declare const AuthenticateResponseCode: {
|
|
32
|
+
readonly ALREADY_LOGGED_IN: 4;
|
|
33
|
+
readonly DENIED: 2;
|
|
34
|
+
readonly ERROR: 5;
|
|
35
|
+
readonly NOT_FOUND: 3;
|
|
36
|
+
readonly OK: 1;
|
|
37
|
+
};
|
|
38
|
+
|
|
1
39
|
declare type AutoplayLimit = {
|
|
2
40
|
enabled: boolean;
|
|
3
41
|
showNoLimit: boolean;
|
|
@@ -145,8 +183,20 @@ declare type FreeRoundsState = {
|
|
|
145
183
|
|
|
146
184
|
declare type GameAction = string;
|
|
147
185
|
|
|
186
|
+
declare type GameEvent<Body = Record<string, unknown>> = WebSocketResponse<'GameEvent', {
|
|
187
|
+
code: (typeof GameEventResponseCode)[keyof typeof GameEventResponseCode];
|
|
188
|
+
}, Body & {
|
|
189
|
+
correlationSeqId: number;
|
|
190
|
+
event: GameEventName;
|
|
191
|
+
seqId: number;
|
|
192
|
+
}>;
|
|
193
|
+
|
|
148
194
|
declare type GameEventName = 'OPEN_GAME' | 'SPIN_RESULT' | 'BG_RESULT' | 'ERROR';
|
|
149
195
|
|
|
196
|
+
declare const GameEventResponseCode: {
|
|
197
|
+
readonly OK: 1;
|
|
198
|
+
};
|
|
199
|
+
|
|
150
200
|
export declare class GigPlugin extends CasinoPlugin {
|
|
151
201
|
constructor(...args: ConstructorParameters<typeof CasinoPlugin>);
|
|
152
202
|
postMessage(event: unknown): void;
|
|
@@ -158,11 +208,20 @@ declare type History_2 = {
|
|
|
158
208
|
source: 'realityCheck' | 'settings' | 'casino';
|
|
159
209
|
};
|
|
160
210
|
|
|
161
|
-
export declare
|
|
211
|
+
export declare const KalambaBullseyeParsers: {
|
|
212
|
+
parseAuthenticateResponse: typeof parseAuthenticateResponse;
|
|
213
|
+
parseAuthenticateError: typeof parseAuthenticateError;
|
|
214
|
+
parseOpenGameResponse: typeof parseOpenGameResponse;
|
|
215
|
+
parseOpenGameError: typeof parseOpenGameError;
|
|
216
|
+
parsePlayResponse: typeof parsePlayResponse;
|
|
217
|
+
parsePlayError: typeof parsePlayError;
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
export declare class KalambaBullseyePlugin extends RgsPlugin {
|
|
162
221
|
socket: KalambaWebSocketClient;
|
|
163
|
-
constructor(...args: ConstructorParameters<typeof
|
|
222
|
+
constructor(...args: ConstructorParameters<typeof RgsPlugin>);
|
|
164
223
|
initialize(init: KalambaWebSocketClientInit): void;
|
|
165
|
-
reconnect(
|
|
224
|
+
reconnect(): Promise<void>;
|
|
166
225
|
openGame(): Promise<OpenGameResponse>;
|
|
167
226
|
play(payload: PlayRequest & {
|
|
168
227
|
payloadToInject?: Record<string, unknown>;
|
|
@@ -213,7 +272,7 @@ declare class KalambaWebSocketClient extends WebSocketClient {
|
|
|
213
272
|
private getBodyExtras;
|
|
214
273
|
private request;
|
|
215
274
|
freeRounds(body: {
|
|
216
|
-
action: 'ACCEPT' | '
|
|
275
|
+
action: 'ACCEPT' | 'DECLINE' | 'SKIP';
|
|
217
276
|
id: string;
|
|
218
277
|
}): Promise<unknown>;
|
|
219
278
|
authenticate(reconnect?: boolean): Promise<Record<string, unknown> & {
|
|
@@ -349,6 +408,54 @@ declare type NestedRecord<K extends string | number | symbol, V> = {
|
|
|
349
408
|
|
|
350
409
|
declare type OmitFirstParam<T extends (...args: any[]) => any> = T extends (arg: any, ...rest: infer R) => infer Result ? (...args: R) => Result : never;
|
|
351
410
|
|
|
411
|
+
declare type OpenGameGameEvent = GameEvent<Record<string, unknown> & {
|
|
412
|
+
contract: {
|
|
413
|
+
availableMultipliersPerBaseBet: Record<number, number[]>;
|
|
414
|
+
balanceInCoins: number;
|
|
415
|
+
balanceVersion: number;
|
|
416
|
+
defaultBet: {
|
|
417
|
+
baseBet: number;
|
|
418
|
+
betMultiplier: number;
|
|
419
|
+
};
|
|
420
|
+
lastBet?: {
|
|
421
|
+
baseBet: number;
|
|
422
|
+
betMultiplier: number;
|
|
423
|
+
};
|
|
424
|
+
lastMainGameBet?: {
|
|
425
|
+
baseBet: number;
|
|
426
|
+
betMultiplier: number;
|
|
427
|
+
};
|
|
428
|
+
maxBetInCoins: number;
|
|
429
|
+
metaData: {
|
|
430
|
+
rtpValues: {
|
|
431
|
+
key: string;
|
|
432
|
+
rtpValue: string;
|
|
433
|
+
}[];
|
|
434
|
+
maxWin: {
|
|
435
|
+
key: string;
|
|
436
|
+
maxWinValueXBet: number;
|
|
437
|
+
maxWinOdds: number;
|
|
438
|
+
}[];
|
|
439
|
+
version: string;
|
|
440
|
+
};
|
|
441
|
+
uiMessages: UiMessage[];
|
|
442
|
+
gameModelFile: string;
|
|
443
|
+
roundId?: string;
|
|
444
|
+
sessionId: string;
|
|
445
|
+
roundWin: number;
|
|
446
|
+
totalWin: number;
|
|
447
|
+
realityCheck?: RealityCheckState;
|
|
448
|
+
stateTypeThisRound: string;
|
|
449
|
+
stateTypeNextRound: string;
|
|
450
|
+
nextSpinType: string;
|
|
451
|
+
serverTime: number;
|
|
452
|
+
freeRounds?: FreeRoundsState[];
|
|
453
|
+
};
|
|
454
|
+
opaqueGameServerToUi: unknown;
|
|
455
|
+
data: unknown;
|
|
456
|
+
event: 'OPEN_GAME';
|
|
457
|
+
}>;
|
|
458
|
+
|
|
352
459
|
declare type OpenGameResponse = {
|
|
353
460
|
contract: {
|
|
354
461
|
bet: {
|
|
@@ -413,6 +520,18 @@ export declare class PariplayPlugin extends CasinoPlugin {
|
|
|
413
520
|
registerFromSdkEvents(): void;
|
|
414
521
|
}
|
|
415
522
|
|
|
523
|
+
declare function parseAuthenticateError(errorResponse: any): RgsErrorData;
|
|
524
|
+
|
|
525
|
+
declare function parseAuthenticateResponse(authResponse: AuthenticateResponse['body']): AuthenticateResponse_2;
|
|
526
|
+
|
|
527
|
+
declare function parseOpenGameError(errorResponse: any): RgsErrorData;
|
|
528
|
+
|
|
529
|
+
declare function parseOpenGameResponse(authResponse: AuthenticateResponse['body'], openGameResponse: OpenGameGameEvent['body']): OpenGameResponse;
|
|
530
|
+
|
|
531
|
+
declare function parsePlayError(errorResponse: any): RgsErrorData;
|
|
532
|
+
|
|
533
|
+
declare function parsePlayResponse(playResponse: ResultGameEvent['body']): PlayResponse;
|
|
534
|
+
|
|
416
535
|
declare type PlayRequest = {
|
|
417
536
|
contract: ContractPlayPayload;
|
|
418
537
|
extra?: unknown;
|
|
@@ -478,6 +597,34 @@ export declare class RelaxFEIMPlugin extends CasinoPlugin {
|
|
|
478
597
|
|
|
479
598
|
declare type ResponseMessageName = 'Authenticate' | 'GameAction' | 'GameEvent' | 'OpenGame' | 'Ping' | 'RealityCheck';
|
|
480
599
|
|
|
600
|
+
declare type ResultGameEvent = GameEvent<Record<string, unknown> & {
|
|
601
|
+
contract: {
|
|
602
|
+
balanceInCoins: number;
|
|
603
|
+
balanceVersion: number;
|
|
604
|
+
lastBet?: {
|
|
605
|
+
baseBet: number;
|
|
606
|
+
betMultiplier: number;
|
|
607
|
+
};
|
|
608
|
+
lastMainGameBet: {
|
|
609
|
+
baseBet: number;
|
|
610
|
+
betMultiplier: number;
|
|
611
|
+
};
|
|
612
|
+
uiMessages: UiMessage[];
|
|
613
|
+
roundId: string;
|
|
614
|
+
roundWin: number;
|
|
615
|
+
totalWin: number;
|
|
616
|
+
realityCheck?: RealityCheckState;
|
|
617
|
+
stateTypeThisRound: string;
|
|
618
|
+
stateTypeNextRound: string;
|
|
619
|
+
nextSpinType: string;
|
|
620
|
+
serverTime: number;
|
|
621
|
+
freeRounds?: FreeRoundsState[];
|
|
622
|
+
};
|
|
623
|
+
opaqueGameServerToUi: unknown;
|
|
624
|
+
data: unknown;
|
|
625
|
+
event: 'SPIN_RESULT' | 'BG_RESULT';
|
|
626
|
+
}>;
|
|
627
|
+
|
|
481
628
|
declare const RgsErrorCode: {
|
|
482
629
|
readonly CONNECTION_ERROR: "CONNECTION_ERROR";
|
|
483
630
|
readonly INVALID_BET_CURRENCY: "INVALID_BET_CURRENCY";
|
|
@@ -525,6 +672,7 @@ declare type RgsErrorWithType = {
|
|
|
525
672
|
};
|
|
526
673
|
|
|
527
674
|
declare type RgsOnlyMessagePayloadMap = {
|
|
675
|
+
error: SdkError;
|
|
528
676
|
openGameError: RgsErrorWithType;
|
|
529
677
|
openGameResponse: OpenGameResponse;
|
|
530
678
|
playError: RgsErrorWithType;
|
|
@@ -538,7 +686,7 @@ declare type RgsOnlyMessagePayloadMap = {
|
|
|
538
686
|
};
|
|
539
687
|
};
|
|
540
688
|
|
|
541
|
-
export declare abstract class
|
|
689
|
+
export declare abstract class RgsPlugin {
|
|
542
690
|
config: WrapperConfig;
|
|
543
691
|
sdkConfig: SdkConfig;
|
|
544
692
|
constructor(config: WrapperConfig, sdkConfig: SdkConfig);
|
|
@@ -663,10 +811,16 @@ declare type SdkOnlyMessagePayloadMap = {
|
|
|
663
811
|
* ```typescript
|
|
664
812
|
* {
|
|
665
813
|
* en: {
|
|
666
|
-
*
|
|
814
|
+
* my_custom_error: 'Something went wrong',
|
|
815
|
+
* RgsError: {
|
|
816
|
+
* OUT_OF_MONEY: 'You are out of credits',
|
|
817
|
+
* }
|
|
667
818
|
* },
|
|
668
819
|
* pl: {
|
|
669
|
-
*
|
|
820
|
+
* my_custom_error: 'Coś poszło nie tak',
|
|
821
|
+
* RgsError: {
|
|
822
|
+
* OUT_OF_MONEY: 'Nie masz już środków',
|
|
823
|
+
* }
|
|
670
824
|
* }
|
|
671
825
|
* }
|
|
672
826
|
* ```
|
|
@@ -741,6 +895,8 @@ export declare class TukoPlugin extends CasinoPlugin {
|
|
|
741
895
|
registerFromSdkEvents(): void;
|
|
742
896
|
}
|
|
743
897
|
|
|
898
|
+
declare type UiMessage = unknown;
|
|
899
|
+
|
|
744
900
|
declare class WebSocketClient {
|
|
745
901
|
socket: WebSocket | null;
|
|
746
902
|
webSocketUrl: string;
|
|
@@ -777,6 +933,7 @@ declare interface WebSocketResponse<Name extends ResponseMessageName, Header = R
|
|
|
777
933
|
declare type WrapperConfig = {
|
|
778
934
|
gameName: string;
|
|
779
935
|
gameVersion: string;
|
|
936
|
+
gameHistoryUrl?: string;
|
|
780
937
|
showFreeRounds: boolean;
|
|
781
938
|
showRealityCheck: boolean;
|
|
782
939
|
showErrors: boolean;
|
|
@@ -807,6 +964,7 @@ declare type WrapperOnlyMessagePayloadMap = {
|
|
|
807
964
|
};
|
|
808
965
|
|
|
809
966
|
declare type WrapperState = {
|
|
967
|
+
isSdkConfigured: boolean;
|
|
810
968
|
balance: number;
|
|
811
969
|
bet: Bet;
|
|
812
970
|
openGameResponse?: OpenGameResponse;
|