@kalamba/sdk 0.1.1 → 0.1.2
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/plugins.cjs +1 -1
- package/dist/plugins.js +98 -95
- package/package.json +2 -3
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 Ht=Object.defineProperty;var zt=(i,t,e)=>t in i?Ht(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var w=(i,t,e)=>(zt(i,typeof t!="symbol"?t+"":t,e),e),ot=(i,t,e)=>{if(!t.has(i))throw TypeError("Cannot "+e)};var y=(i,t,e)=>(ot(i,t,"read from private field"),e?e.call(i):t.get(i)),v=(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)},E=(i,t,e,s)=>(ot(i,t,"write to private field"),s?s.call(i,e):t.set(i,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const rt=require("./noop-b3c54b76.cjs");function x(i,t){return(e,...s)=>{console.log(`[%c${i}\x1B[m] %s`,t,e,...s)}}function Ot(i,t){return Math.round(i*100/t)}class V{constructor(t){w(this,"config");this.config=t}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 Vt=x("BasicPlugin","color:#000000;font-weight:bold;");class qt extends V{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),Vt("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:l}=this.config.api;s.currency===n&&typeof s.balanceInCurrency=="number"?this.send("balance",{balance:Ot(s.balanceInCurrency,l)}):(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.config.api.homeUrl)try{window.top.location=this.config.api.homeUrl}catch{window.location=this.config.api.homeUrl}else try{window.top.history.back()}catch{window.history.back()}})}}const k=x("▼ DebuggingPlugin IN ▼","color:#444444;font-weight:bold;"),Wt=x("▲ DebuggingPlugin OUT ▲","color:#444444;font-weight:bold;");class $t extends V{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=>k("autoplay",t)),this.on("balance",t=>k("balance",t)),this.on("bet",t=>k("bet",t)),this.on("cashier",t=>k("cashier",t)),this.on("choice",t=>k("choice",t)),this.on("close",t=>k("close",t)),this.on("error",t=>k("error",t)),this.on("loadEnd",t=>k("loadEnd",t)),this.on("loadProgress",t=>k("loadProgress",t)),this.on("loadStart",t=>k("loadStart",t)),this.on("playCycleStart",t=>k("playCycleStart",t)),this.on("playCycleEnd",t=>k("playCycleEnd",t)),this.on("playEnd",t=>k("playEnd",t)),this.on("playError",t=>k("playError",t)),this.on("playReady",t=>k("playReady",t)),this.on("playStart",t=>k("playStart",t)),this.on("settings",t=>k("settings",t))}_send(...t){Wt(...t),this.send(...t)}}const jt=x("GigPlugin","color:#000000;font-weight:bold;");class Qt extends V{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),jt("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.config.api.homeUrl)try{window.top.location=this.config.api.homeUrl}catch{window.location=this.config.api.homeUrl}else try{window.top.history.back()}catch{window.history.back()}}),this.on("playReady",()=>{this.postMessage("GAME_READY")})}}const Xt=x("OryxPlugin","color:#000000;font-weight:bold;");class Kt extends V{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 ct=x("PariplayPlugin","color:#000000;font-weight:bold;");function Ge(i){try{window.top.location=i}catch{window.location=i}}function Ne(i,t){return new Promise(function(s,n){const l=new XMLHttpRequest;l.onload=function(){l.status>=200&&l.status<300?s(l.responseText):n(l.responseText)},l.open(i,t),l.send()})}function He(){}function Jt(i){return i.filter(function(e){return e.messageType.toUpperCase()==="DATA"})}function ze(i){return i.filter(function(e){return["NOTIFICATION","POPUP"].includes(e.messageType.toUpperCase())})}function Ut(i){try{return JSON.parse(i.text)}catch{return{}}}function Yt(i){return i.map(Ut).filter(Boolean).find(function(e){return e.betId!=null&&e.winId!=null})||{}}function Zt(i){return i.map(Ut).filter(Boolean).find(function(e){return e.TotalBet!=null&&e.TotalWin!=null})||{}}class ei extends V{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),ct("configured")}postMessage(t,e){const s={lang:this.config.ui.language,sender:this.config.api.game,type:t};e!=null&&(s.data=e),ct("postMessage",s),window.parent.postMessage(s,"*")}coinsToCurrency(t){return t*this.config.api.coinValueInCents/100}handleContinueButton(t,e){t.link&&Ne("GET",t.link),e()}handleLinkButton(t,e){switch(t.linkType.toUpperCase()){case"AJAX":Ne("GET",t.link),e();return;case"AJAXRESPONSE":Ne("GET",t.link).then(()=>{e()});return;case"REDIRECT":Ge(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(l=>l.action.toUpperCase()==="CASHIER"?!!this.config.api.cashierUrl:!0).map(l=>Object.assign({},l,{onRelease:()=>{const a=s.messageType.toUpperCase()==="POPUP"?He:n,h=this.buttonActions[l.action.toUpperCase()];h?h(l,a):a()}}))})}).catch(He)),Promise.resolve()).then(()=>{}).catch(He)}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.config.api.integrationData.token.split(".")[1])).token),l=JSON.parse(n.integrationSpecificAttributes.sessionData||"{}");s={ClientToken:n.integrationSpecificAttributes.clientToken,CurrencyCode:n.currency,PlayerTokenId:n.user,SessionData:l}}catch{s=void 0}this.postMessage("gameDataLoaded",{LoadGameData:s,success:!0});try{const n=ze(e.data.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.config.api.homeUrl)if(this.config.api.homeUrl==="(back)")try{window.top.history.back()}catch{window.history.back()}else this.config.api.homeUrl==="(api)"?this.postMessage("quit"):Ge(this.config.api.homeUrl)}),this.on("playEnd",e=>{this.postMessage("roundEnded",{balanceAfter:this.coinsToCurrency(e.balance),win:this.coinsToCurrency(e.data.gameRoundResult.win)});try{const s=ze(e.data.uiMessages);this.processInfoUiMessages(s)}catch{}}),this.on("playError",e=>{this.postMessage("ticketReceived",{ErrorCode:e.data.data.data.operatorSpecificErrorCode,ErrorMessage:e.data.data.data.operatorSpecificErrorMessage,Status:{ErrCode:e.data.data.data.operatorSpecificErrorCode}})}),this.on("playResponse",e=>{this.postMessage("roundStarted",{balanceBefore:this.coinsToCurrency(e.balance+e.data.gameState.totalBetFromCurrentGameCycle)});const s=e.data.gameState.stateTypeThisRound==="BaseGame",n=Jt(e.data.uiMessages),l=ze(e.data.uiMessages),a=Yt(n),h=Zt(n);this.postMessage("ticketReceived",{Balance:this.coinsToCurrency(e.balance),BetAmount:s?this.coinsToCurrency(e.data.gameState.totalBetFromCurrentGameCycle):0,CreditTransactionId:a.betId,DebitTransactionId:a.winId,Message:l,SessionData:h,Status:{ErrCode:0},WinAmount:this.coinsToCurrency(e.data.gameRoundResult.win)})}),this.on("playStart",e=>{"bet"in e&&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.config.api.cashierUrl&&(this.config.api.cashierUrl==="(api)"?this.postMessage("cashier"):Ge(this.config.api.cashierUrl))})}}const he=x("RelaxFEIMPlugin","color:#000000;font-weight:bold;");class ti extends V{constructor(...e){super(...e);w(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=()=>{he("loaded"),window.FEIM.configure({p2pConfig:{currency:this.config.api.currency,launchParams:{homeurl:"homeUrl"}}}),he("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(()=>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: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.balance,bet:e.data.gameState.totalBetFromCurrentGameCycle,win:{win:e.data.gameState.totalWinFromCurrentGameCycle}};window.FEIM.send.roundFinished(s)}),this.on("playResponse",e=>{const s={balance:e.balance,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 Ve=x("TukoPlugin","color:#000000;font-weight:bold;");class ii extends V{constructor(...e){super(...e);w(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(),Ve("configured")}ping(e){const s=new XMLHttpRequest;s.onreadystatechange=function(){s.readyState===XMLHttpRequest.DONE&&(s.status===0||s.status>=200&&s.status<400?Ve("ping ok",s):Ve("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:l,coinValueInCents:a}=this.config.api;n.currency===l&&typeof n.balanceInCurrency=="number"?this.send("balance",{balance:Ot(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.config.api.homeUrl)try{window.top.location=this.config.api.homeUrl}catch{window.location=this.config.api.homeUrl}else try{window.top.history.back()}catch{window.history.back()}})}}class si{constructor(t){w(this,"socket",null);w(this,"webSocketUrl");w(this,"eventListeners",{close:[],error:[],message:[]});w(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)})})});w(this,"send",t=>{if(this.socket==null)throw new Error("Cannot send message, the WebSocket connection is not open");this.socket.send(t)});w(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)})});w(this,"handleClose",t=>{this.eventListeners.close.forEach(e=>{e(t)})});w(this,"handleError",t=>{this.eventListeners.error.forEach(e=>{e(t)})});w(this,"handleMessage",t=>{this.eventListeners.message.forEach(e=>{e(t)})});w(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){try{return JSON.parse(i==null?void 0:i.data)}catch(t){return console.error("fakap",t),null}}function oe(i){var t;return((t=i==null?void 0:i.header)==null?void 0:t.name)==="GameEvent"}function ni(i){return oe(i)&&i.body.event==="OPEN_GAME"}function ai(i){return oe(i)&&i.body.event==="SPIN_ERROR"}function oi(i){return oe(i)&&i.body.event==="SPIN_RESULT"}function ri(i){return oe(i)&&i.body.event==="BG_RESULT"}function ci(i){var t;return((t=i==null?void 0:i.header)==null?void 0:t.name)==="OpenGame"}function di(i){var t;return((t=i==null?void 0:i.header)==null?void 0:t.name)==="Ping"}function dt(i){var t;return((t=i==null?void 0:i.header)==null?void 0:t.name)==="RealityCheck"}var Z,ye;class li extends si{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());w(this,"cId",0);w(this,"mId",0);w(this,"seqId",10);w(this,"gameCode");v(this,Z,void 0);v(this,ye,void 0);w(this,"onMessage",e=>{const s=Me(e);(oe(s)||di(s)||dt(s))&&this.sendAcknowledgement(s),dt(s)&&this.handleRealityCheck(s)});this.eventListeners.realityCheck=[],this.gameCode=e.gameCode,E(this,Z,s.requestTimeoutMs),E(this,ye,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((l,a)=>{setTimeout(()=>a({request:{body:s,header:e},type:"timeout"}),y(this,Z));const h=g=>{const p=Me(g);try{e.cId===(p==null?void 0:p.header.cId)&&(this.removeEventListener("message",h),p.header.code===1?l(p):a({response:p,type:"response"}))}catch{a({response:p,type:"error"})}};this.addEventListener("message",h),this.send(n)})}activateFreeRound(e){const s=this.buildHeader("ActivateFreeRound");return this.request(s,e)}authenticate(e=!1){const s=this.buildHeader("Authenticate"),n={clientType:3,version:y(this,ye),reconnect:e};return this.request(s,n).then(l=>l.body)}openGame(){const e=this.buildHeader("OpenGame"),s={gameCode:this.gameCode};return new Promise((n,l)=>{const a=h=>{const g=Me(h);ni(g)&&(this.removeEventListener("message",a),n(g.body))};this.addEventListener("message",a),this.request(e,s).catch(h=>{ci(h.response)&&l(h),l(h)})})}sendAcknowledgement(e){const{name:s,cId:n}=e.header,l=this.buildHeader(s,n),a=this.buildPayload(l,{});this.send(a)}sendAction(e,s){const n=this.buildHeader("GameAction"),l={...this.getBodyExtras(e),data:s};return new Promise((a,h)=>{const g=p=>{const f=Me(p);oe(f)&&l.seqId===f.body.correlationSeqId&&(this.removeEventListener("message",g),oi(f)||ri(f)?a(f.body):ai(f)&&h(f.body))};this.addEventListener("message",g),this.request(n,l).catch(p=>{h(p)})})}spin(e){return this.sendAction("SPIN",e)}bgAction(e){return this.sendAction("BG_ACTION",e)}setRequestTimeoutMs(e){E(this,Z,e)}}Z=new WeakMap,ye=new WeakMap;class Lt{constructor(t){w(this,"config");this.config=t}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})}}const ui={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"},hi=x("KalambaBullseyePlugin","color:#000000;font-weight:bold;");var Ee;class gi extends Lt{constructor(...e){super(...e);w(this,"socket");v(this,Ee,"");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("state",({version:s})=>{E(this,Ee,s)}),this.on("configured",s=>{this.socket.setRequestTimeoutMs(s.ui.requestTimeoutMs)}),this.registerFromSdkEvents()}initialize(e){this.socket=new li(e,{gameVersion:y(this,Ee),requestTimeoutMs:this.config.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=>hi("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"),l=e.get("gameCode"),a=e.get("operatorCode"),h=e.get("playMode"),g=e.get("token"),p=e.get("username"),f=e.get("gameHistoryUrl"),A=e.get("homeUrl")??void 0,D=e.get("cashierUrl")??void 0;this.initialize({apiUrl:s,cageCode:n,gameCode:l,operatorCode:a,playMode:h,token:g,username:p}),await this.socket.connect();const B=await this.socket.authenticate(),le=await this.socket.openGame();this.config.api={brand:n,game:l,integration:a,jurisdiction:B.jurisdictionCode,playMode:h,user:B.username,integrationData:{token:g},country:B.countryCode,currency:B.currencyCode,coinValueInCents:B.coinValueInCents,gameHistoryUrl:f,homeUrl:A,cashierUrl:D};const O=e.get("languageCode");return O&&(this.config.ui.language=O.length===3?ui[O]??O:O),le}play(e){if("userInput"in e&&e.userInput!=null)return this.socket.bgAction(e);if("opaqueGameAttributes"in e&&e.opaqueGameAttributes)return this.socket.spin(e);if("bet"in e&&e.bet){const{bet:s,...n}=e;return this.socket.spin({bet:{baseBet:s.base,betMultiplier:s.multiplier},...n})}}registerFromSdkEvents(){this.on("history",()=>{const{api:{game:e,integration:s,integrationData:n,jurisdiction:l,user:a,gameHistoryUrl:h},ui:{language:g}}=this.config,p=a.replace(/^user_/,"").replace(new RegExp(`_${s}$`),""),f=new URL(h);f.searchParams.set("gameCode",e),f.searchParams.set("jurisdiction",l),f.searchParams.set("operatorCode",s),f.searchParams.set("token",n.token),f.searchParams.set("username",p),f.searchParams.set("languageCode",g),window.open(f.toString(),"_blank")})}}Ee=new WeakMap;var pi="2.0.0-beta.2",re="",lt="?",Ke="function",H="undefined",ce="object",Je="string",fe="major",c="model",o="name",d="type",u="vendor",r="version",M="architecture",K="console",m="mobile",b="tablet",I="smarttv",X="wearable",Ye="embedded",ut="user-agent",Ze=500,it="brands",W="formFactor",st="fullVersionList",J="platform",nt="platformVersion",De="bitness",q="sec-ch-ua",wi=q+"-full-version-list",mi=q+"-arch",fi=q+"-"+De,bi=q+"-form-factor",yi=q+"-"+m,Ei=q+"-"+c,_t=q+"-"+J,vi=_t+"-version",Ft=[it,st,m,c,J,nt,M,W,De],T="browser",U="cpu",R="device",L="engine",P="os",Y="result",Ce="Amazon",ge="Apple",ht="ASUS",gt="BlackBerry",Ie="Google",pt="Huawei",wt="Lenovo",qe="LG",Oe="Microsoft",mt="Motorola",Te="Samsung",ft="Sharp",Ae="Sony",We="Xiaomi",$e="Zebra",j="Mobile ",Q=" Browser",Pe="Chrome",ki="Edge",pe="Firefox",we="Opera",bt="Facebook",yt="Sogou",et="Windows",Si=typeof window!==H,C=Si&&window.navigator?window.navigator:void 0,G=C&&C.userAgentData?C.userAgentData:void 0,Mi=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},Be=function(i){for(var t={},e=0;e<i.length;e++)t[i[e].toUpperCase()]=i[e];return t},tt=function(i,t){if(typeof i===ce&&i.length>0){for(var e in i)if(z(i[e])==z(t))return!0;return!1}return de(i)?z(t).indexOf(z(i))!==-1:!1},Et=function(i){for(var t in i)return/^(browser|cpu|device|engine|os)$/.test(t)},de=function(i){return typeof i===Je},je=function(i){if(i){for(var t=[],e=$(/\\?\"/g,i).split(","),s=0;s<e.length;s++)if(e[s].indexOf(";")>-1){var n=be(e[s]).split(";v=");t[s]={brand:n[0],version:n[1]}}else t[s]=be(e[s]);return t}},z=function(i){return de(i)?i.toLowerCase():i},Qe=function(i){return de(i)?$(/[^\d\.]/g,i).split(".")[0]:void 0},_=function(i){for(var t in i){var e=i[t];typeof e==ce&&e.length==2?this[e[0]]=e[1]:this[e]=void 0}return this},$=function(i,t){return de(t)?t.replace(i,re):t},me=function(i){return $(/\\?\"/g,i)},be=function(i,t){if(de(i))return i=$(/^\s\s*/,i),typeof t===H?i:i.substring(0,Ze)},vt=function(i,t){if(!(!i||!t))for(var e=0,s,n,l,a,h,g;e<t.length&&!h;){var p=t[e],f=t[e+1];for(s=n=0;s<p.length&&!h&&p[s];)if(h=p[s++].exec(i),h)for(l=0;l<f.length;l++)g=h[++n],a=f[l],typeof a===ce&&a.length>0?a.length===2?typeof a[1]==Ke?this[a[0]]=a[1].call(this,g):this[a[0]]=a[1]:a.length===3?typeof a[1]===Ke&&!(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}},Ue=function(i,t){for(var e in t)if(typeof t[e]===ce&&t[e].length>0){for(var s=0;s<t[e].length;s++)if(tt(t[e][s],i))return e===lt?void 0:e}else if(tt(t[e],i))return e===lt?void 0:e;return t.hasOwnProperty("*")?t["*"]:i},kt={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"},St={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:["VR","XR","Watch"],"?":["Desktop","Unknown"],"*":void 0},Mt={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[r,[o,j+"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[r,[o,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[o,r],[/opios[\/ ]+([\w\.]+)/i],[r,[o,we+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[r,[o,we+" GX"]],[/\bopr\/([\w\.]+)/i],[r,[o,we]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[r,[o,"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],[o,r],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[r,[o,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[r,[o,"WeChat"]],[/konqueror\/([\w\.]+)/i],[r,[o,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[r,[o,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[r,[o,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[r,[o,"Smart "+wt+Q]],[/(avast|avg)\/([\w\.]+)/i],[[o,/(.+)/,"$1 Secure"+Q],r],[/\bfocus\/([\w\.]+)/i],[r,[o,pe+" Focus"]],[/\bopt\/([\w\.]+)/i],[r,[o,we+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[r,[o,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[r,[o,"Dolphin"]],[/coast\/([\w\.]+)/i],[r,[o,we+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[r,[o,"MIUI"+Q]],[/fxios\/([\w\.-]+)/i],[r,[o,j+pe]],[/\bqihu|(qi?ho?o?|360)browser/i],[[o,"360"+Q]],[/(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i],[[o,/(.+)/,"$1"+Q],r],[/samsungbrowser\/([\w\.]+)/i],[r,[o,Te+" Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[o,/_/g," "],r],[/metasr[\/ ]?([\d\.]+)/i],[r,[o,yt+" Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[o,yt+" Mobile"],r],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[o,r],[/(lbbrowser)/i,/\[(linkedin)app\]/i],[o],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[o,bt],r],[/(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],[o,r],[/\bgsa\/([\w\.]+) .*safari\//i],[r,[o,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[r,[o,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[r,[o,Pe+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[o,Pe+" WebView"],r],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[r,[o,"Android"+Q]],[/chrome\/([\w\.]+) mobile/i],[r,[o,j+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[o,r],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[r,[o,j+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[o,j+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[r,o],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[o,[r,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[o,r],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[o,j+pe],r],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[o,"Netscape"],r],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[r,[o,pe+" 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],[o,r],[/(cobalt)\/([\w\.]+)/i],[o,[r,/[^\d\.]+./,re]]],cpu:[[/\b(?:(amd|x|x86[-_]?|wow|win)64)\b/i],[[M,"amd64"]],[/(ia32(?=;))/i,/((?:i[346]|x)86)[;\)]/i],[[M,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[M,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[M,"armhf"]],[/windows (ce|mobile); ppc;/i],[[M,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[M,/ower/,re,z]],[/(sun4\w)[;\)]/i],[[M,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[M,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],[c,[u,Te],[d,b]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[c,[u,Te],[d,m]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[c,[u,ge],[d,m]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[c,[u,ge],[d,b]],[/(macintosh);/i],[c,[u,ge]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[c,[u,ft],[d,m]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[c,[u,pt],[d,b]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[c,[u,pt],[d,m]],[/\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],[[c,/_/g," "],[u,We],[d,m]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[c,/_/g," "],[u,We],[d,b]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[c,[u,"OPPO"],[d,m]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[c,[u,"Vivo"],[d,m]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[c,[u,"Realme"],[d,m]],[/\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],[c,[u,mt],[d,m]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[c,[u,mt],[d,b]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[c,[u,qe],[d,b]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[c,[u,qe],[d,m]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[c,[u,wt],[d,b]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[c,/_/g," "],[u,"Nokia"],[d,m]],[/(pixel c)\b/i],[c,[u,Ie],[d,b]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[c,[u,Ie],[d,m]],[/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],[c,[u,Ae],[d,m]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[c,"Xperia Tablet"],[u,Ae],[d,b]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[c,[u,"OnePlus"],[d,m]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[c,[u,Ce],[d,b]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[c,/(.+)/g,"Fire Phone $1"],[u,Ce],[d,m]],[/(playbook);[-\w\),; ]+(rim)/i],[c,u,[d,b]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[c,[u,gt],[d,m]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[c,[u,ht],[d,b]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[c,[u,ht],[d,m]],[/(nexus 9)/i],[c,[u,"HTC"],[d,b]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[u,[c,/_/g," "],[d,m]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[c,[u,"Acer"],[d,b]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[c,[u,"Meizu"],[d,m]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[c,[u,"Ulefone"],[d,m]],[/(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,c,[d,m]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[u,c,[d,b]],[/(surface duo)/i],[c,[u,Oe],[d,b]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[c,[u,"Fairphone"],[d,m]],[/(shield[\w ]+) b/i],[c,[u,"Nvidia"],[d,b]],[/(sprint) (\w+)/i],[u,c,[d,m]],[/(kin\.[onetw]{3})/i],[[c,/\./g," "],[u,Oe],[d,m]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[c,[u,$e],[d,b]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[c,[u,$e],[d,m]],[/smart-tv.+(samsung)/i],[u,[d,I]],[/hbbtv.+maple;(\d+)/i],[[c,/^/,"SmartTV"],[u,Te],[d,I]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[u,qe],[d,I]],[/(apple) ?tv/i],[u,[c,ge+" TV"],[d,I]],[/crkey/i],[[c,Pe+"cast"],[u,Ie],[d,I]],[/droid.+aft(\w+)( bui|\))/i],[c,[u,Ce],[d,I]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[c,[u,ft],[d,I]],[/(bravia[\w ]+)( bui|\))/i],[c,[u,Ae],[d,I]],[/(mitv-\w{5}) bui/i],[c,[u,We],[d,I]],[/Hbbtv.*(technisat) (.*);/i],[u,c,[d,I]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[u,be],[c,be],[d,I]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[d,I]],[/(ouya)/i,/(nintendo) (\w+)/i],[u,c,[d,K]],[/droid.+; (shield) bui/i],[c,[u,"Nvidia"],[d,K]],[/(playstation \w+)/i],[c,[u,Ae],[d,K]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[c,[u,Oe],[d,K]],[/((pebble))app/i],[u,c,[d,X]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[c,[u,ge],[d,X]],[/droid.+; (glass) \d/i],[c,[u,Ie],[d,X]],[/droid.+; (wt63?0{2,3})\)/i],[c,[u,$e],[d,X]],[/(quest( 2| pro)?)/i],[c,[u,bt],[d,X]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[u,[d,Ye]],[/(aeobc)\b/i],[c,[u,Ce],[d,Ye]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[c,[d,m]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[c,[d,b]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[d,b]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[d,m]],[/(android[-\w\. ]{0,9});.+buil/i],[c,[u,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[r,[o,ki+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[r,[o,"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],[o,r],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[r,o]],os:[[/microsoft (windows) (vista|xp)/i],[o,r],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[o,[r,Ue,kt]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[r,Ue,kt],[o,et]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[r,/_/g,"."],[o,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[o,"macOS"],[r,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[r,o],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[o,r],[/\(bb(10);/i],[r,[o,gt]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[r,[o,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[r,[o,pe+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[r,[o,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[r,[o,"watchOS"]],[/crkey\/([\d\.]+)/i],[r,[o,Pe+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[o,"Chrome OS"],r],[/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],[o,r],[/(sunos) ?([\w\.\d]*)/i],[[o,"Solaris"],r],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[o,r]]},Re=function(){var i={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return _.call(i.init,[[T,[o,r,fe]],[U,[M]],[R,[d,c,u]],[L,[o,r]],[P,[o,r]]]),_.call(i.isIgnore,[[T,[r,fe]],[L,[r]],[P,[r]]]),_.call(i.isIgnoreRgx,[[T,/ ?browser$/i],[P,/ ?os$/i]]),_.call(i.toString,[[T,[o,r]],[U,[M]],[R,[u,c]],[L,[o,r]],[P,[o,r]]]),i}(),Ci=function(i,t){var e=Re.init[t],s=Re.isIgnore[t]||0,n=Re.isIgnoreRgx[t]||0,l=Re.toString[t]||0;function a(){_.call(this,e)}return a.prototype.getItem=function(){return i},a.prototype.withClientHints=function(){return G?G.getHighEntropyValues(Ft).then(function(h){return i.setCH(new Dt(h,!1)).parseCH().get()}):i.parseCH().get()},a.prototype.withFeatureCheck=function(){return i.detectFeature().get()},t!=Y&&(a.prototype.is=function(h){var g=!1;for(var p in this)if(this.hasOwnProperty(p)&&!tt(s,p)&&z(n?$(n,this[p]):this[p])==z(n?$(n,h):h)){if(g=!0,h!=H)break}else if(h==H&&g){g=!g;break}return g},a.prototype.toString=function(){var h=re;for(var g in l)typeof this[l[g]]!==H&&(h+=(h?" ":re)+this[l[g]]);return h||H}),G||(a.prototype.then=function(h){var g=this,p=function(){for(var A in g)g.hasOwnProperty(A)&&(this[A]=g[A])};p.prototype={is:a.prototype.is,toString:a.prototype.toString};var f=new p;return h(f),f}),new a};function Dt(i,t){if(i=i||{},_.call(this,Ft),t)_.call(this,[[it,je(i[q])],[st,je(i[wi])],[m,/\?1/.test(i[yi])],[c,me(i[Ei])],[J,me(i[_t])],[nt,me(i[vi])],[M,me(i[mi])],[W,je(i[bi])],[De,me(i[fi])]]);else for(var e in i)this.hasOwnProperty(e)&&typeof i[e]!==H&&(this[e]=i[e])}function Ct(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,l){return this.data[n]=l,this},this.setCH=function(n){return this.uaCH=n,this},this.detectFeature=function(){if(C&&C.userAgent==this.ua)switch(this.itemType){case T:C.brave&&typeof C.brave.isBrave==Ke&&this.set(o,"Brave");break;case R:!this.get(d)&&G&&G[m]&&this.set(d,m),this.get(c)=="Macintosh"&&C&&typeof C.standalone!==H&&C.maxTouchPoints&&C.maxTouchPoints>2&&this.set(c,"iPad").set(d,b);break;case P:!this.get(o)&&G&&G[J]&&this.set(o,G[J]);break;case Y:var n=this.data,l=function(a){return n[a].getItem().detectFeature().get()};this.set(T,l(T)).set(U,l(U)).set(R,l(R)).set(L,l(L)).set(P,l(P))}return this},this.parseUA=function(){return this.itemType!=Y&&vt.call(this.data,this.ua,this.rgxMap),this.itemType==T&&this.set(fe,Qe(this.get(r))),this},this.parseCH=function(){var n=this.uaCH,l=this.rgxMap;switch(this.itemType){case T:var a=n[st]||n[it],h;if(a)for(var g in a){var p=$(/(Google|Microsoft) /,a[g].brand||a[g]),f=a[g].version;!/not.a.brand/i.test(p)&&(!h||/chrom/i.test(h)&&!/chromi/i.test(p))&&(this.set(o,p).set(r,f).set(fe,Qe(f)),h=p)}break;case U:var A=n[M];A&&(A&&n[De]=="64"&&(A+="64"),vt.call(this.data,A+";",l));break;case R:if(n[m]&&this.set(d,m),n[c]&&this.set(c,n[c]),n[c]=="Xbox"&&this.set(d,K).set(u,Oe),n[W]){var D;if(typeof n[W]!="string")for(var B=0;!D&&B<n[W].length;)D=Ue(n[W][B++],St);else D=Ue(n[W],St);this.set(d,D)}break;case P:var le=n[J];if(le){var O=n[nt];le==et&&(O=parseInt(Qe(O),10)>=13?"11":"10"),this.set(o,le).set(r,O)}this.get(o)==et&&n[c]=="Xbox"&&this.set(o,"Xbox").set(r,void 0);break;case Y:var Gt=this.data,ue=function(Nt){return Gt[Nt].getItem().setCH(n).parseCH().get()};this.set(T,ue(T)).set(U,ue(U)).set(R,ue(R)).set(L,ue(L)).set(P,ue(P))}return this},_.call(this,[["itemType",i],["ua",t],["uaCH",s],["rgxMap",e],["data",Ci(this,i)]]),this}function F(i,t,e){if(typeof i===ce?(Et(i)?(typeof t===ce&&(e=t),t=i):(e=i,t=void 0),i=void 0):typeof i===Je&&!Et(t)&&(e=t,t=void 0),!(this instanceof F))return new F(i,t,e).getResult();var s=typeof i===Je?i:C&&C.userAgent?C.userAgent:e&&e[ut]?e[ut]:re,n=new Dt(e,!0),l=t?Mi(Mt,t):Mt,a=function(h){return h==Y?function(){return new Ct(h,s,l,n).set("ua",s).set(T,this.getBrowser()).set(U,this.getCPU()).set(R,this.getDevice()).set(L,this.getEngine()).set(P,this.getOS()).get()}:function(){return new Ct(h,s,l[h],n).parseUA().get()}};return _.call(this,[["getBrowser",a(T)],["getCPU",a(U)],["getDevice",a(R)],["getEngine",a(L)],["getOS",a(P)],["getResult",a(Y)],["getUA",function(){return s}],["setUA",function(h){return de(h)&&(s=h.length>Ze?be(h,Ze):h),this}]]).setUA(s),this}F.VERSION=pi;F.BROWSER=Be([o,r,fe]);F.CPU=Be([M]);F.DEVICE=Be([c,u,d,K,m,I,b,X,Ye]);F.ENGINE=F.OS=Be([o,r]);class Bt{constructor(t,e){w(this,"trackers");w(this,"config");this.trackers=t,this.config=e}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 It(i){return i.reduce((t,e)=>t+e,0)}function Ii(i){const t=i.length,e=It(i)/t,s=i.map(l=>Math.pow(l-e,2)),n=It(s)/t;return Math.sqrt(n)}class Tt{constructor(){w(this,"rafId",-1);w(this,"startTime",0);w(this,"stopTime",0);w(this,"frames",[]);w(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,l)=>(l[n]!==l[n-1]?e.push(1):e[e.length-1]++,e),[]).slice(0,t)});w(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,l=t.length>0?Ii(t):0;return{fpsAvg:e,fpsMax:s,fpsMin:n,fpsStdDev:l}});w(this,"start",()=>{this.startTime=Date.now(),this.trackFrames()});w(this,"stop",()=>{cancelAnimationFrame(this.rafId),this.stopTime=Date.now()});w(this,"trackFrames",()=>{this.frames.push(Date.now()),this.rafId=requestAnimationFrame(this.trackFrames)})}}const Ti="landscape",Ai="portrait";function Pi(){try{const i=document.createElement("canvas");return!!window.WebGLRenderingContext&&(i.getContext("webgl")||i.getContext("experimental-webgl"))instanceof WebGLRenderingContext}catch{return!1}}async function Ri(){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 Xe(){return window.innerWidth>=window.innerHeight?Ti:Ai}var Le,ee,te,ie,ve,_e,ke,Fe;class xi extends Bt{constructor(...e){super(...e);w(this,"FPS_SAMPLE_INTERVAL",1e4);v(this,Le,0);v(this,ee,"");v(this,te,void 0);v(this,ie,void 0);v(this,ve,!1);v(this,_e,!1);v(this,ke,"");v(this,Fe,[]);E(this,te,{}),E(this,ie,this.deviceInfo()),this.on("state",({balance:s,version:n})=>{E(this,ee,n),E(this,Le,s)}),this.on("autoplay",({action:s})=>{["start","resume"].includes(s)?E(this,ve,!0):E(this,ve,!1)}),this.on("settings",({fastPlay:s})=>{s!==void 0&&E(this,_e,s)}),this.registerEvents()}async registerEvents(){y(this,ie).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.messageKey,systemMessageType:e.type})}),this.on("openGameResponse",async e=>{E(this,ke,e.data.gameState.stateTypeNextRound),E(this,te,{balanceInCoins:e.balance,clientVersion:y(this,ee),coinValueInCents:this.config.api.coinValueInCents,coinValueInCentsFloat:this.config.api.coinValueInCents,currency:this.config.api.currency,defaultBaseBet:e.data.additionalConfigData.defaultBet.baseBet,defaultBetMultiplier:e.data.additionalConfigData.defaultBet.betMultiplier,environment:"release",gameCode:this.config.api.game,gameCodeServer:this.config.api.game,gameModelFile:e.data.additionalConfigData.gameModelFile,jurisdiction:this.config.api.jurisdiction,languageCode:this.config.ui.language,operatorName:"kalamba",partnerId:this.config.api.brand,partnerParentId:this.config.api.integration,platform:"WEB",playMode:this.config.api.playMode,referrer:window.location.hostname,serverVersion:e.data.gameConfigData.metaData.version}),this.track("Game Open",y(this,te))}),this.on("playCycleEnd",async e=>{const s=await y(this,ie),{baseBet:n,betMultiplier:l,specialAction:a}=e.data.gameState.lastPlacedMainGameBet??{},h=e.balance,g=e.data.gameState.totalBetFromCurrentGameCycle,p=e.data.gameState.totalWinFromCurrentGameCycle,f=p-g,A=a||"spin",D=e.data.gameState.cycleId;this.track("Betting Activity",{balance:h-f,balanceAfter:h,baseBet:n,betMultiplier:l,betType:A,gameVersion:y(this,ee),coinValueInCents:this.config.api.coinValueInCents,coinValueInCentsFloat:this.config.api.coinValueInCents,currency:this.config.api.currency,environment:"release",gameCode:this.config.api.game,gameCodeServer:this.config.api.game,isMobile:s.isMobile,netResult:f,operatorName:"kalamba",orientation:Xe(),partnerId:this.config.api.brand,partnerParentId:this.config.api.integration,platform:"WEB",playMode:this.config.api.playMode,roundId:D,roundTypes:["BaseGame"],totalBet:g,totalWin:p}),E(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 Tt,s=()=>{e.stop();const l=e.getReport();this.track("FPS Performance",{...l,fpsType:"sample"}),n()},n=async()=>{e.start(),setTimeout(s,this.FPS_SAMPLE_INTERVAL)};n()}reportFpsRound(){const e=new Tt;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:Xe(),stateType:y(this,ke)}}async deviceInfo(){var g;const e=new F(navigator.userAgent),s=Pi(),n=await Ri(),l=e.getBrowser(),a=e.getDevice(),h=e.getOS();return{browserName:l.name,browserVersion:l.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:Xe(),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}}}Le=new WeakMap,ee=new WeakMap,te=new WeakMap,ie=new WeakMap,ve=new WeakMap,_e=new WeakMap,ke=new WeakMap,Fe=new WeakMap;let xe;const Oi=new Uint8Array(16);function Ui(){if(!xe&&(xe=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!xe))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return xe(Oi)}const S=[];for(let i=0;i<256;++i)S.push((i+256).toString(16).slice(1));function Li(i,t=0){return S[i[t+0]]+S[i[t+1]]+S[i[t+2]]+S[i[t+3]]+"-"+S[i[t+4]]+S[i[t+5]]+"-"+S[i[t+6]]+S[i[t+7]]+"-"+S[i[t+8]]+S[i[t+9]]+"-"+S[i[t+10]]+S[i[t+11]]+S[i[t+12]]+S[i[t+13]]+S[i[t+14]]+S[i[t+15]]}const _i=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),At={randomUUID:_i};function Pt(i,t,e){if(At.randomUUID&&!t&&!i)return At.randomUUID();i=i||{};const s=i.random||(i.rng||Ui)();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 Li(s)}class at{constructor(t){w(this,"config");this.config=t}}const Rt=25,xt=1e4;var se,ne,ae,N,Se;class Fi extends at{constructor(...e){super(...e);v(this,se,"https://europe-west3-stargazer-328808.cloudfunctions.net/collect-events");v(this,ne,void 0);v(this,ae,void 0);v(this,N,[]);v(this,Se,void 0);w(this,"processQueueForced");E(this,ne,new Date().getTime()),E(this,N,[]),E(this,Se,Pt()),this.processQueueForced=this.processQueue.bind(this,!0),this.schedule(),fetch(y(this,se),{method:"OPTIONS"}).catch(rt.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,ae)&&clearTimeout(y(this,ae)),E(this,ae,window.setTimeout(()=>this.processQueue(),xt))}send(e){E(this,ne,new Date().getTime());try{navigator.sendBeacon(y(this,se),JSON.stringify(e))}catch{fetch(y(this,se),{body:JSON.stringify(e),method:"POST",headers:{"Content-Type":"application/json"},keepalive:!0}).catch(rt.noop)}this.schedule()}addToQueue(e){y(this,N).push(e),this.processQueue()}processQueue(e=!1){if(!(this.config==null||!this.config.ui.feature.allowTelemetry)&&!(!e&&y(this,N).length<Rt&&new Date().getTime()-y(this,ne)<xt))for(;y(this,N).length;){const s=y(this,N).splice(0,Rt).map(n=>({...n,sessionID:y(this,Se),userID:this.config.api.user}));this.send(s)}}track(e,s){this.addToQueue({eventName:e,eventParams:s,eventTimestamp:new Date().getTime(),eventUUID:Pt()})}}se=new WeakMap,ne=new WeakMap,ae=new WeakMap,N=new WeakMap,Se=new WeakMap;const Di=x("LoggingTracker","color:#000000;font-weight:bold;");class Bi extends at{track(t,e){Di(`@${this.config.api.user}`,`[${t}]`,e)}}exports.BasicPlugin=qt;exports.CasinoPlugin=V;exports.DebuggingPlugin=$t;exports.GigPlugin=Qt;exports.KalambaBullseyePlugin=gi;exports.KalambaStargazerPlugin=xi;exports.KalambaStargazerTracker=Fi;exports.LoggingTracker=Bi;exports.OryxPlugin=Kt;exports.PariplayPlugin=ei;exports.RelaxFEIMPlugin=ti;exports.RgsPlygin=Lt;exports.TelemetryPlugin=Bt;exports.Tracker=at;exports.TukoPlugin=ii;
|
|
5
|
+
"use strict";var Nt=Object.defineProperty;var Ht=(i,t,e)=>t in i?Nt(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var w=(i,t,e)=>(Ht(i,typeof t!="symbol"?t+"":t,e),e),ot=(i,t,e)=>{if(!t.has(i))throw TypeError("Cannot "+e)};var y=(i,t,e)=>(ot(i,t,"read from private field"),e?e.call(i):t.get(i)),v=(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)},E=(i,t,e,s)=>(ot(i,t,"write to private field"),s?s.call(i,e):t.set(i,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const rt=require("./noop-b3c54b76.cjs");function x(i,t){return(e,...s)=>{console.log(`[%c${i}\x1B[m] %s`,t,e,...s)}}class V{constructor(t){w(this,"config");this.config=t}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 zt=x("BasicPlugin","color:#000000;font-weight:bold;");function Vt(i,t){return Math.round(i*100/t)}class qt extends V{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),zt("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:l}=this.config.api;s.currency===n&&typeof s.balanceInCurrency=="number"?this.send("balance",{balance:Vt(s.balanceInCurrency,l)}):(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.config.api.homeUrl)try{window.top.location=this.config.api.homeUrl}catch{window.location=this.config.api.homeUrl}else try{window.top.history.back()}catch{window.history.back()}})}}const k=x("▼ DebuggingPlugin IN ▼","color:#444444;font-weight:bold;"),Wt=x("▲ DebuggingPlugin OUT ▲","color:#444444;font-weight:bold;");class $t extends V{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=>k("autoplay",t)),this.on("balance",t=>k("balance",t)),this.on("bet",t=>k("bet",t)),this.on("cashier",t=>k("cashier",t)),this.on("choice",t=>k("choice",t)),this.on("close",t=>k("close",t)),this.on("error",t=>k("error",t)),this.on("loadEnd",t=>k("loadEnd",t)),this.on("loadProgress",t=>k("loadProgress",t)),this.on("loadStart",t=>k("loadStart",t)),this.on("playCycleStart",t=>k("playCycleStart",t)),this.on("playCycleEnd",t=>k("playCycleEnd",t)),this.on("playEnd",t=>k("playEnd",t)),this.on("playError",t=>k("playError",t)),this.on("playReady",t=>k("playReady",t)),this.on("playStart",t=>k("playStart",t)),this.on("settings",t=>k("settings",t))}_send(...t){Wt(...t),this.send(...t)}}const jt=x("GigPlugin","color:#000000;font-weight:bold;");class Qt extends V{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),jt("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.config.api.homeUrl)try{window.top.location=this.config.api.homeUrl}catch{window.location=this.config.api.homeUrl}else try{window.top.history.back()}catch{window.history.back()}}),this.on("playReady",()=>{this.postMessage("GAME_READY")})}}const Xt=x("OryxPlugin","color:#000000;font-weight:bold;");class Kt extends V{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 ct=x("PariplayPlugin","color:#000000;font-weight:bold;");function Ge(i){try{window.top.location=i}catch{window.location=i}}function Ne(i,t){return new Promise(function(s,n){const l=new XMLHttpRequest;l.onload=function(){l.status>=200&&l.status<300?s(l.responseText):n(l.responseText)},l.open(i,t),l.send()})}function He(){}function Jt(i){return i.filter(function(e){return e.messageType.toUpperCase()==="DATA"})}function ze(i){return i.filter(function(e){return["NOTIFICATION","POPUP"].includes(e.messageType.toUpperCase())})}function Ot(i){try{return JSON.parse(i.text)}catch{return{}}}function Yt(i){return i.map(Ot).filter(Boolean).find(function(e){return e.betId!=null&&e.winId!=null})||{}}function Zt(i){return i.map(Ot).filter(Boolean).find(function(e){return e.TotalBet!=null&&e.TotalWin!=null})||{}}class ei extends V{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),ct("configured")}postMessage(t,e){const s={lang:this.config.ui.language,sender:this.config.api.game,type:t};e!=null&&(s.data=e),ct("postMessage",s),window.parent.postMessage(s,"*")}coinsToCurrency(t){return t*this.config.api.coinValueInCents/100}handleContinueButton(t,e){t.link&&Ne("GET",t.link),e()}handleLinkButton(t,e){switch(t.linkType.toUpperCase()){case"AJAX":Ne("GET",t.link),e();return;case"AJAXRESPONSE":Ne("GET",t.link).then(()=>{e()});return;case"REDIRECT":Ge(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(l=>l.action.toUpperCase()==="CASHIER"?!!this.config.api.cashierUrl:!0).map(l=>Object.assign({},l,{onRelease:()=>{const a=s.messageType.toUpperCase()==="POPUP"?He:n,h=this.buttonActions[l.action.toUpperCase()];h?h(l,a):a()}}))})}).catch(He)),Promise.resolve()).then(()=>{}).catch(He)}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.config.api.integrationData.token.split(".")[1])).token),l=JSON.parse(n.integrationSpecificAttributes.sessionData||"{}");s={ClientToken:n.integrationSpecificAttributes.clientToken,CurrencyCode:n.currency,PlayerTokenId:n.user,SessionData:l}}catch{s=void 0}this.postMessage("gameDataLoaded",{LoadGameData:s,success:!0});try{const n=ze(e.data.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.config.api.homeUrl)if(this.config.api.homeUrl==="(back)")try{window.top.history.back()}catch{window.history.back()}else this.config.api.homeUrl==="(api)"?this.postMessage("quit"):Ge(this.config.api.homeUrl)}),this.on("playEnd",e=>{this.postMessage("roundEnded",{balanceAfter:this.coinsToCurrency(e.balance),win:this.coinsToCurrency(e.data.gameRoundResult.win)});try{const s=ze(e.data.uiMessages);this.processInfoUiMessages(s)}catch{}}),this.on("playError",e=>{this.postMessage("ticketReceived",{ErrorCode:e.data.data.data.operatorSpecificErrorCode,ErrorMessage:e.data.data.data.operatorSpecificErrorMessage,Status:{ErrCode:e.data.data.data.operatorSpecificErrorCode}})}),this.on("playResponse",e=>{this.postMessage("roundStarted",{balanceBefore:this.coinsToCurrency(e.balance+e.data.gameState.totalBetFromCurrentGameCycle)});const s=e.data.gameState.stateTypeThisRound==="BaseGame",n=Jt(e.data.uiMessages),l=ze(e.data.uiMessages),a=Yt(n),h=Zt(n);this.postMessage("ticketReceived",{Balance:this.coinsToCurrency(e.balance),BetAmount:s?this.coinsToCurrency(e.data.gameState.totalBetFromCurrentGameCycle):0,CreditTransactionId:a.betId,DebitTransactionId:a.winId,Message:l,SessionData:h,Status:{ErrCode:0},WinAmount:this.coinsToCurrency(e.data.gameRoundResult.win)})}),this.on("playStart",e=>{"bet"in e&&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.config.api.cashierUrl&&(this.config.api.cashierUrl==="(api)"?this.postMessage("cashier"):Ge(this.config.api.cashierUrl))})}}const he=x("RelaxFEIMPlugin","color:#000000;font-weight:bold;");class ti extends V{constructor(...e){super(...e);w(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=()=>{he("loaded"),window.FEIM.configure({p2pConfig:{currency:this.config.api.currency,launchParams:{homeurl:"homeUrl"}}}),he("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(()=>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: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.balance,bet:e.data.gameState.totalBetFromCurrentGameCycle,win:{win:e.data.gameState.totalWinFromCurrentGameCycle}};window.FEIM.send.roundFinished(s)}),this.on("playResponse",e=>{const s={balance:e.balance,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 Ve=x("TukoPlugin","color:#000000;font-weight:bold;");function ii(i,t){return Math.round(i*100/t)}class si extends V{constructor(...e){super(...e);w(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(),Ve("configured")}ping(e){const s=new XMLHttpRequest;s.onreadystatechange=function(){s.readyState===XMLHttpRequest.DONE&&(s.status===0||s.status>=200&&s.status<400?Ve("ping ok",s):Ve("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:l,coinValueInCents:a}=this.config.api;n.currency===l&&typeof n.balanceInCurrency=="number"?this.send("balance",{balance:ii(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.config.api.homeUrl)try{window.top.location=this.config.api.homeUrl}catch{window.location=this.config.api.homeUrl}else try{window.top.history.back()}catch{window.history.back()}})}}class ni{constructor(t){w(this,"socket",null);w(this,"webSocketUrl");w(this,"eventListeners",{close:[],error:[],message:[]});w(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)})})});w(this,"send",t=>{if(this.socket==null)throw new Error("Cannot send message, the WebSocket connection is not open");this.socket.send(t)});w(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)})});w(this,"handleClose",t=>{this.eventListeners.close.forEach(e=>{e(t)})});w(this,"handleError",t=>{this.eventListeners.error.forEach(e=>{e(t)})});w(this,"handleMessage",t=>{this.eventListeners.message.forEach(e=>{e(t)})});w(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){try{return JSON.parse(i==null?void 0:i.data)}catch(t){return console.error("fakap",t),null}}function oe(i){var t;return((t=i==null?void 0:i.header)==null?void 0:t.name)==="GameEvent"}function ai(i){return oe(i)&&i.body.event==="OPEN_GAME"}function oi(i){return oe(i)&&i.body.event==="SPIN_ERROR"}function ri(i){return oe(i)&&i.body.event==="SPIN_RESULT"}function ci(i){return oe(i)&&i.body.event==="BG_RESULT"}function di(i){var t;return((t=i==null?void 0:i.header)==null?void 0:t.name)==="OpenGame"}function li(i){var t;return((t=i==null?void 0:i.header)==null?void 0:t.name)==="Ping"}function dt(i){var t;return((t=i==null?void 0:i.header)==null?void 0:t.name)==="RealityCheck"}var Z,ye;class ui 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());w(this,"cId",0);w(this,"mId",0);w(this,"seqId",10);w(this,"gameCode");v(this,Z,void 0);v(this,ye,void 0);w(this,"onMessage",e=>{const s=Me(e);(oe(s)||li(s)||dt(s))&&this.sendAcknowledgement(s),dt(s)&&this.handleRealityCheck(s)});this.eventListeners.realityCheck=[],this.gameCode=e.gameCode,E(this,Z,s.requestTimeoutMs),E(this,ye,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((l,a)=>{setTimeout(()=>a({request:{body:s,header:e},type:"timeout"}),y(this,Z));const h=g=>{const p=Me(g);try{e.cId===(p==null?void 0:p.header.cId)&&(this.removeEventListener("message",h),p.header.code===1?l(p):a({response:p,type:"response"}))}catch{a({response:p,type:"error"})}};this.addEventListener("message",h),this.send(n)})}activateFreeRound(e){const s=this.buildHeader("ActivateFreeRound");return this.request(s,e)}authenticate(e=!1){const s=this.buildHeader("Authenticate"),n={clientType:3,version:y(this,ye),reconnect:e};return this.request(s,n).then(l=>l.body)}openGame(){const e=this.buildHeader("OpenGame"),s={gameCode:this.gameCode};return new Promise((n,l)=>{const a=h=>{const g=Me(h);ai(g)&&(this.removeEventListener("message",a),n(g.body))};this.addEventListener("message",a),this.request(e,s).catch(h=>{di(h.response)&&l(h),l(h)})})}sendAcknowledgement(e){const{name:s,cId:n}=e.header,l=this.buildHeader(s,n),a=this.buildPayload(l,{});this.send(a)}sendAction(e,s){const n=this.buildHeader("GameAction"),l={...this.getBodyExtras(e),data:s};return new Promise((a,h)=>{const g=p=>{const f=Me(p);oe(f)&&l.seqId===f.body.correlationSeqId&&(this.removeEventListener("message",g),ri(f)||ci(f)?a(f.body):oi(f)&&h(f.body))};this.addEventListener("message",g),this.request(n,l).catch(p=>{h(p)})})}spin(e){return this.sendAction("SPIN",e)}bgAction(e){return this.sendAction("BG_ACTION",e)}setRequestTimeoutMs(e){E(this,Z,e)}}Z=new WeakMap,ye=new WeakMap;class Ut{constructor(t){w(this,"config");this.config=t}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})}}const hi={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"},gi=x("KalambaBullseyePlugin","color:#000000;font-weight:bold;");var Ee;class pi extends Ut{constructor(...e){super(...e);w(this,"socket");v(this,Ee,"");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("state",({version:s})=>{E(this,Ee,s)}),this.on("configured",s=>{this.socket.setRequestTimeoutMs(s.ui.requestTimeoutMs)}),this.registerFromSdkEvents()}initialize(e){this.socket=new ui(e,{gameVersion:y(this,Ee),requestTimeoutMs:this.config.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=>gi("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"),l=e.get("gameCode"),a=e.get("operatorCode"),h=e.get("playMode"),g=e.get("token"),p=e.get("username"),f=e.get("gameHistoryUrl"),A=e.get("homeUrl")??void 0,D=e.get("cashierUrl")??void 0;this.initialize({apiUrl:s,cageCode:n,gameCode:l,operatorCode:a,playMode:h,token:g,username:p}),await this.socket.connect();const B=await this.socket.authenticate(),le=await this.socket.openGame();this.config.api={brand:n,game:l,integration:a,jurisdiction:B.jurisdictionCode,playMode:h,user:B.username,integrationData:{token:g},country:B.countryCode,currency:B.currencyCode,coinValueInCents:B.coinValueInCents,gameHistoryUrl:f,homeUrl:A,cashierUrl:D};const O=e.get("languageCode");return O&&(this.config.ui.language=O.length===3?hi[O]??O:O),le}play(e){if("userInput"in e&&e.userInput!=null)return this.socket.bgAction(e);if("opaqueGameAttributes"in e&&e.opaqueGameAttributes)return this.socket.spin(e);if("bet"in e&&e.bet){const{bet:s,...n}=e;return this.socket.spin({bet:{baseBet:s.base,betMultiplier:s.multiplier},...n})}}registerFromSdkEvents(){this.on("history",()=>{const{api:{game:e,integration:s,integrationData:n,jurisdiction:l,user:a,gameHistoryUrl:h},ui:{language:g}}=this.config,p=a.replace(/^user_/,"").replace(new RegExp(`_${s}$`),""),f=new URL(h);f.searchParams.set("gameCode",e),f.searchParams.set("jurisdiction",l),f.searchParams.set("operatorCode",s),f.searchParams.set("token",n.token),f.searchParams.set("username",p),f.searchParams.set("languageCode",g),window.open(f.toString(),"_blank")})}}Ee=new WeakMap;var wi="2.0.0-beta.2",re="",lt="?",Ke="function",H="undefined",ce="object",Je="string",fe="major",c="model",o="name",d="type",u="vendor",r="version",M="architecture",K="console",m="mobile",b="tablet",I="smarttv",X="wearable",Ye="embedded",ut="user-agent",Ze=500,it="brands",W="formFactor",st="fullVersionList",J="platform",nt="platformVersion",De="bitness",q="sec-ch-ua",mi=q+"-full-version-list",fi=q+"-arch",bi=q+"-"+De,yi=q+"-form-factor",Ei=q+"-"+m,vi=q+"-"+c,Lt=q+"-"+J,ki=Lt+"-version",_t=[it,st,m,c,J,nt,M,W,De],T="browser",U="cpu",R="device",L="engine",P="os",Y="result",Ce="Amazon",ge="Apple",ht="ASUS",gt="BlackBerry",Ie="Google",pt="Huawei",wt="Lenovo",qe="LG",Oe="Microsoft",mt="Motorola",Te="Samsung",ft="Sharp",Ae="Sony",We="Xiaomi",$e="Zebra",j="Mobile ",Q=" Browser",Pe="Chrome",Si="Edge",pe="Firefox",we="Opera",bt="Facebook",yt="Sogou",et="Windows",Mi=typeof window!==H,C=Mi&&window.navigator?window.navigator:void 0,G=C&&C.userAgentData?C.userAgentData:void 0,Ci=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},Be=function(i){for(var t={},e=0;e<i.length;e++)t[i[e].toUpperCase()]=i[e];return t},tt=function(i,t){if(typeof i===ce&&i.length>0){for(var e in i)if(z(i[e])==z(t))return!0;return!1}return de(i)?z(t).indexOf(z(i))!==-1:!1},Et=function(i){for(var t in i)return/^(browser|cpu|device|engine|os)$/.test(t)},de=function(i){return typeof i===Je},je=function(i){if(i){for(var t=[],e=$(/\\?\"/g,i).split(","),s=0;s<e.length;s++)if(e[s].indexOf(";")>-1){var n=be(e[s]).split(";v=");t[s]={brand:n[0],version:n[1]}}else t[s]=be(e[s]);return t}},z=function(i){return de(i)?i.toLowerCase():i},Qe=function(i){return de(i)?$(/[^\d\.]/g,i).split(".")[0]:void 0},_=function(i){for(var t in i){var e=i[t];typeof e==ce&&e.length==2?this[e[0]]=e[1]:this[e]=void 0}return this},$=function(i,t){return de(t)?t.replace(i,re):t},me=function(i){return $(/\\?\"/g,i)},be=function(i,t){if(de(i))return i=$(/^\s\s*/,i),typeof t===H?i:i.substring(0,Ze)},vt=function(i,t){if(!(!i||!t))for(var e=0,s,n,l,a,h,g;e<t.length&&!h;){var p=t[e],f=t[e+1];for(s=n=0;s<p.length&&!h&&p[s];)if(h=p[s++].exec(i),h)for(l=0;l<f.length;l++)g=h[++n],a=f[l],typeof a===ce&&a.length>0?a.length===2?typeof a[1]==Ke?this[a[0]]=a[1].call(this,g):this[a[0]]=a[1]:a.length===3?typeof a[1]===Ke&&!(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}},Ue=function(i,t){for(var e in t)if(typeof t[e]===ce&&t[e].length>0){for(var s=0;s<t[e].length;s++)if(tt(t[e][s],i))return e===lt?void 0:e}else if(tt(t[e],i))return e===lt?void 0:e;return t.hasOwnProperty("*")?t["*"]:i},kt={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"},St={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:["VR","XR","Watch"],"?":["Desktop","Unknown"],"*":void 0},Mt={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[r,[o,j+"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[r,[o,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[o,r],[/opios[\/ ]+([\w\.]+)/i],[r,[o,we+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[r,[o,we+" GX"]],[/\bopr\/([\w\.]+)/i],[r,[o,we]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[r,[o,"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],[o,r],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[r,[o,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[r,[o,"WeChat"]],[/konqueror\/([\w\.]+)/i],[r,[o,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[r,[o,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[r,[o,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[r,[o,"Smart "+wt+Q]],[/(avast|avg)\/([\w\.]+)/i],[[o,/(.+)/,"$1 Secure"+Q],r],[/\bfocus\/([\w\.]+)/i],[r,[o,pe+" Focus"]],[/\bopt\/([\w\.]+)/i],[r,[o,we+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[r,[o,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[r,[o,"Dolphin"]],[/coast\/([\w\.]+)/i],[r,[o,we+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[r,[o,"MIUI"+Q]],[/fxios\/([\w\.-]+)/i],[r,[o,j+pe]],[/\bqihu|(qi?ho?o?|360)browser/i],[[o,"360"+Q]],[/(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i],[[o,/(.+)/,"$1"+Q],r],[/samsungbrowser\/([\w\.]+)/i],[r,[o,Te+" Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[o,/_/g," "],r],[/metasr[\/ ]?([\d\.]+)/i],[r,[o,yt+" Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[o,yt+" Mobile"],r],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[o,r],[/(lbbrowser)/i,/\[(linkedin)app\]/i],[o],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[o,bt],r],[/(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],[o,r],[/\bgsa\/([\w\.]+) .*safari\//i],[r,[o,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[r,[o,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[r,[o,Pe+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[o,Pe+" WebView"],r],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[r,[o,"Android"+Q]],[/chrome\/([\w\.]+) mobile/i],[r,[o,j+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[o,r],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[r,[o,j+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[o,j+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[r,o],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[o,[r,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[o,r],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[o,j+pe],r],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[o,"Netscape"],r],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[r,[o,pe+" 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],[o,r],[/(cobalt)\/([\w\.]+)/i],[o,[r,/[^\d\.]+./,re]]],cpu:[[/\b(?:(amd|x|x86[-_]?|wow|win)64)\b/i],[[M,"amd64"]],[/(ia32(?=;))/i,/((?:i[346]|x)86)[;\)]/i],[[M,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[M,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[M,"armhf"]],[/windows (ce|mobile); ppc;/i],[[M,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[M,/ower/,re,z]],[/(sun4\w)[;\)]/i],[[M,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[M,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],[c,[u,Te],[d,b]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[c,[u,Te],[d,m]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[c,[u,ge],[d,m]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[c,[u,ge],[d,b]],[/(macintosh);/i],[c,[u,ge]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[c,[u,ft],[d,m]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[c,[u,pt],[d,b]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[c,[u,pt],[d,m]],[/\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],[[c,/_/g," "],[u,We],[d,m]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[c,/_/g," "],[u,We],[d,b]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[c,[u,"OPPO"],[d,m]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[c,[u,"Vivo"],[d,m]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[c,[u,"Realme"],[d,m]],[/\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],[c,[u,mt],[d,m]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[c,[u,mt],[d,b]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[c,[u,qe],[d,b]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[c,[u,qe],[d,m]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[c,[u,wt],[d,b]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[c,/_/g," "],[u,"Nokia"],[d,m]],[/(pixel c)\b/i],[c,[u,Ie],[d,b]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[c,[u,Ie],[d,m]],[/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],[c,[u,Ae],[d,m]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[c,"Xperia Tablet"],[u,Ae],[d,b]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[c,[u,"OnePlus"],[d,m]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[c,[u,Ce],[d,b]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[c,/(.+)/g,"Fire Phone $1"],[u,Ce],[d,m]],[/(playbook);[-\w\),; ]+(rim)/i],[c,u,[d,b]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[c,[u,gt],[d,m]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[c,[u,ht],[d,b]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[c,[u,ht],[d,m]],[/(nexus 9)/i],[c,[u,"HTC"],[d,b]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[u,[c,/_/g," "],[d,m]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[c,[u,"Acer"],[d,b]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[c,[u,"Meizu"],[d,m]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[c,[u,"Ulefone"],[d,m]],[/(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,c,[d,m]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[u,c,[d,b]],[/(surface duo)/i],[c,[u,Oe],[d,b]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[c,[u,"Fairphone"],[d,m]],[/(shield[\w ]+) b/i],[c,[u,"Nvidia"],[d,b]],[/(sprint) (\w+)/i],[u,c,[d,m]],[/(kin\.[onetw]{3})/i],[[c,/\./g," "],[u,Oe],[d,m]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[c,[u,$e],[d,b]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[c,[u,$e],[d,m]],[/smart-tv.+(samsung)/i],[u,[d,I]],[/hbbtv.+maple;(\d+)/i],[[c,/^/,"SmartTV"],[u,Te],[d,I]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[u,qe],[d,I]],[/(apple) ?tv/i],[u,[c,ge+" TV"],[d,I]],[/crkey/i],[[c,Pe+"cast"],[u,Ie],[d,I]],[/droid.+aft(\w+)( bui|\))/i],[c,[u,Ce],[d,I]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[c,[u,ft],[d,I]],[/(bravia[\w ]+)( bui|\))/i],[c,[u,Ae],[d,I]],[/(mitv-\w{5}) bui/i],[c,[u,We],[d,I]],[/Hbbtv.*(technisat) (.*);/i],[u,c,[d,I]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[u,be],[c,be],[d,I]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[d,I]],[/(ouya)/i,/(nintendo) (\w+)/i],[u,c,[d,K]],[/droid.+; (shield) bui/i],[c,[u,"Nvidia"],[d,K]],[/(playstation \w+)/i],[c,[u,Ae],[d,K]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[c,[u,Oe],[d,K]],[/((pebble))app/i],[u,c,[d,X]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[c,[u,ge],[d,X]],[/droid.+; (glass) \d/i],[c,[u,Ie],[d,X]],[/droid.+; (wt63?0{2,3})\)/i],[c,[u,$e],[d,X]],[/(quest( 2| pro)?)/i],[c,[u,bt],[d,X]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[u,[d,Ye]],[/(aeobc)\b/i],[c,[u,Ce],[d,Ye]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[c,[d,m]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[c,[d,b]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[d,b]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[d,m]],[/(android[-\w\. ]{0,9});.+buil/i],[c,[u,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[r,[o,Si+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[r,[o,"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],[o,r],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[r,o]],os:[[/microsoft (windows) (vista|xp)/i],[o,r],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[o,[r,Ue,kt]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[r,Ue,kt],[o,et]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[r,/_/g,"."],[o,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[o,"macOS"],[r,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[r,o],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[o,r],[/\(bb(10);/i],[r,[o,gt]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[r,[o,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[r,[o,pe+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[r,[o,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[r,[o,"watchOS"]],[/crkey\/([\d\.]+)/i],[r,[o,Pe+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[o,"Chrome OS"],r],[/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],[o,r],[/(sunos) ?([\w\.\d]*)/i],[[o,"Solaris"],r],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[o,r]]},Re=function(){var i={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return _.call(i.init,[[T,[o,r,fe]],[U,[M]],[R,[d,c,u]],[L,[o,r]],[P,[o,r]]]),_.call(i.isIgnore,[[T,[r,fe]],[L,[r]],[P,[r]]]),_.call(i.isIgnoreRgx,[[T,/ ?browser$/i],[P,/ ?os$/i]]),_.call(i.toString,[[T,[o,r]],[U,[M]],[R,[u,c]],[L,[o,r]],[P,[o,r]]]),i}(),Ii=function(i,t){var e=Re.init[t],s=Re.isIgnore[t]||0,n=Re.isIgnoreRgx[t]||0,l=Re.toString[t]||0;function a(){_.call(this,e)}return a.prototype.getItem=function(){return i},a.prototype.withClientHints=function(){return G?G.getHighEntropyValues(_t).then(function(h){return i.setCH(new Ft(h,!1)).parseCH().get()}):i.parseCH().get()},a.prototype.withFeatureCheck=function(){return i.detectFeature().get()},t!=Y&&(a.prototype.is=function(h){var g=!1;for(var p in this)if(this.hasOwnProperty(p)&&!tt(s,p)&&z(n?$(n,this[p]):this[p])==z(n?$(n,h):h)){if(g=!0,h!=H)break}else if(h==H&&g){g=!g;break}return g},a.prototype.toString=function(){var h=re;for(var g in l)typeof this[l[g]]!==H&&(h+=(h?" ":re)+this[l[g]]);return h||H}),G||(a.prototype.then=function(h){var g=this,p=function(){for(var A in g)g.hasOwnProperty(A)&&(this[A]=g[A])};p.prototype={is:a.prototype.is,toString:a.prototype.toString};var f=new p;return h(f),f}),new a};function Ft(i,t){if(i=i||{},_.call(this,_t),t)_.call(this,[[it,je(i[q])],[st,je(i[mi])],[m,/\?1/.test(i[Ei])],[c,me(i[vi])],[J,me(i[Lt])],[nt,me(i[ki])],[M,me(i[fi])],[W,je(i[yi])],[De,me(i[bi])]]);else for(var e in i)this.hasOwnProperty(e)&&typeof i[e]!==H&&(this[e]=i[e])}function Ct(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,l){return this.data[n]=l,this},this.setCH=function(n){return this.uaCH=n,this},this.detectFeature=function(){if(C&&C.userAgent==this.ua)switch(this.itemType){case T:C.brave&&typeof C.brave.isBrave==Ke&&this.set(o,"Brave");break;case R:!this.get(d)&&G&&G[m]&&this.set(d,m),this.get(c)=="Macintosh"&&C&&typeof C.standalone!==H&&C.maxTouchPoints&&C.maxTouchPoints>2&&this.set(c,"iPad").set(d,b);break;case P:!this.get(o)&&G&&G[J]&&this.set(o,G[J]);break;case Y:var n=this.data,l=function(a){return n[a].getItem().detectFeature().get()};this.set(T,l(T)).set(U,l(U)).set(R,l(R)).set(L,l(L)).set(P,l(P))}return this},this.parseUA=function(){return this.itemType!=Y&&vt.call(this.data,this.ua,this.rgxMap),this.itemType==T&&this.set(fe,Qe(this.get(r))),this},this.parseCH=function(){var n=this.uaCH,l=this.rgxMap;switch(this.itemType){case T:var a=n[st]||n[it],h;if(a)for(var g in a){var p=$(/(Google|Microsoft) /,a[g].brand||a[g]),f=a[g].version;!/not.a.brand/i.test(p)&&(!h||/chrom/i.test(h)&&!/chromi/i.test(p))&&(this.set(o,p).set(r,f).set(fe,Qe(f)),h=p)}break;case U:var A=n[M];A&&(A&&n[De]=="64"&&(A+="64"),vt.call(this.data,A+";",l));break;case R:if(n[m]&&this.set(d,m),n[c]&&this.set(c,n[c]),n[c]=="Xbox"&&this.set(d,K).set(u,Oe),n[W]){var D;if(typeof n[W]!="string")for(var B=0;!D&&B<n[W].length;)D=Ue(n[W][B++],St);else D=Ue(n[W],St);this.set(d,D)}break;case P:var le=n[J];if(le){var O=n[nt];le==et&&(O=parseInt(Qe(O),10)>=13?"11":"10"),this.set(o,le).set(r,O)}this.get(o)==et&&n[c]=="Xbox"&&this.set(o,"Xbox").set(r,void 0);break;case Y:var Bt=this.data,ue=function(Gt){return Bt[Gt].getItem().setCH(n).parseCH().get()};this.set(T,ue(T)).set(U,ue(U)).set(R,ue(R)).set(L,ue(L)).set(P,ue(P))}return this},_.call(this,[["itemType",i],["ua",t],["uaCH",s],["rgxMap",e],["data",Ii(this,i)]]),this}function F(i,t,e){if(typeof i===ce?(Et(i)?(typeof t===ce&&(e=t),t=i):(e=i,t=void 0),i=void 0):typeof i===Je&&!Et(t)&&(e=t,t=void 0),!(this instanceof F))return new F(i,t,e).getResult();var s=typeof i===Je?i:C&&C.userAgent?C.userAgent:e&&e[ut]?e[ut]:re,n=new Ft(e,!0),l=t?Ci(Mt,t):Mt,a=function(h){return h==Y?function(){return new Ct(h,s,l,n).set("ua",s).set(T,this.getBrowser()).set(U,this.getCPU()).set(R,this.getDevice()).set(L,this.getEngine()).set(P,this.getOS()).get()}:function(){return new Ct(h,s,l[h],n).parseUA().get()}};return _.call(this,[["getBrowser",a(T)],["getCPU",a(U)],["getDevice",a(R)],["getEngine",a(L)],["getOS",a(P)],["getResult",a(Y)],["getUA",function(){return s}],["setUA",function(h){return de(h)&&(s=h.length>Ze?be(h,Ze):h),this}]]).setUA(s),this}F.VERSION=wi;F.BROWSER=Be([o,r,fe]);F.CPU=Be([M]);F.DEVICE=Be([c,u,d,K,m,I,b,X,Ye]);F.ENGINE=F.OS=Be([o,r]);class Dt{constructor(t,e){w(this,"trackers");w(this,"config");this.trackers=t,this.config=e}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 It(i){return i.reduce((t,e)=>t+e,0)}function Ti(i){const t=i.length,e=It(i)/t,s=i.map(l=>Math.pow(l-e,2)),n=It(s)/t;return Math.sqrt(n)}class Tt{constructor(){w(this,"rafId",-1);w(this,"startTime",0);w(this,"stopTime",0);w(this,"frames",[]);w(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,l)=>(l[n]!==l[n-1]?e.push(1):e[e.length-1]++,e),[]).slice(0,t)});w(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,l=t.length>0?Ti(t):0;return{fpsAvg:e,fpsMax:s,fpsMin:n,fpsStdDev:l}});w(this,"start",()=>{this.startTime=Date.now(),this.trackFrames()});w(this,"stop",()=>{cancelAnimationFrame(this.rafId),this.stopTime=Date.now()});w(this,"trackFrames",()=>{this.frames.push(Date.now()),this.rafId=requestAnimationFrame(this.trackFrames)})}}const Ai="landscape",Pi="portrait";function Ri(){try{const i=document.createElement("canvas");return!!window.WebGLRenderingContext&&(i.getContext("webgl")||i.getContext("experimental-webgl"))instanceof WebGLRenderingContext}catch{return!1}}async function xi(){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 Xe(){return window.innerWidth>=window.innerHeight?Ai:Pi}var Le,ee,te,ie,ve,_e,ke,Fe;class Oi extends Dt{constructor(...e){super(...e);w(this,"FPS_SAMPLE_INTERVAL",1e4);v(this,Le,0);v(this,ee,"");v(this,te,void 0);v(this,ie,void 0);v(this,ve,!1);v(this,_e,!1);v(this,ke,"");v(this,Fe,[]);E(this,te,{}),E(this,ie,this.deviceInfo()),this.on("state",({balance:s,version:n})=>{E(this,ee,n),E(this,Le,s)}),this.on("autoplay",({action:s})=>{["start","resume"].includes(s)?E(this,ve,!0):E(this,ve,!1)}),this.on("settings",({fastPlay:s})=>{s!==void 0&&E(this,_e,s)}),this.registerEvents()}async registerEvents(){y(this,ie).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.messageKey,systemMessageType:e.type})}),this.on("openGameResponse",async e=>{E(this,ke,e.data.gameState.stateTypeNextRound),E(this,te,{balanceInCoins:e.balance,clientVersion:y(this,ee),coinValueInCents:this.config.api.coinValueInCents,coinValueInCentsFloat:this.config.api.coinValueInCents,currency:this.config.api.currency,defaultBaseBet:e.data.additionalConfigData.defaultBet.baseBet,defaultBetMultiplier:e.data.additionalConfigData.defaultBet.betMultiplier,environment:"release",gameCode:this.config.api.game,gameCodeServer:this.config.api.game,gameModelFile:e.data.additionalConfigData.gameModelFile,jurisdiction:this.config.api.jurisdiction,languageCode:this.config.ui.language,operatorName:"kalamba",partnerId:this.config.api.brand,partnerParentId:this.config.api.integration,platform:"WEB",playMode:this.config.api.playMode,referrer:window.location.hostname,serverVersion:e.data.gameConfigData.metaData.version}),this.track("Game Open",y(this,te))}),this.on("playCycleEnd",async e=>{const s=await y(this,ie),{baseBet:n,betMultiplier:l,specialAction:a}=e.data.gameState.lastPlacedMainGameBet??{},h=e.balance,g=e.data.gameState.totalBetFromCurrentGameCycle,p=e.data.gameState.totalWinFromCurrentGameCycle,f=p-g,A=a||"spin",D=e.data.gameState.cycleId;this.track("Betting Activity",{balance:h-f,balanceAfter:h,baseBet:n,betMultiplier:l,betType:A,gameVersion:y(this,ee),coinValueInCents:this.config.api.coinValueInCents,coinValueInCentsFloat:this.config.api.coinValueInCents,currency:this.config.api.currency,environment:"release",gameCode:this.config.api.game,gameCodeServer:this.config.api.game,isMobile:s.isMobile,netResult:f,operatorName:"kalamba",orientation:Xe(),partnerId:this.config.api.brand,partnerParentId:this.config.api.integration,platform:"WEB",playMode:this.config.api.playMode,roundId:D,roundTypes:["BaseGame"],totalBet:g,totalWin:p}),E(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 Tt,s=()=>{e.stop();const l=e.getReport();this.track("FPS Performance",{...l,fpsType:"sample"}),n()},n=async()=>{e.start(),setTimeout(s,this.FPS_SAMPLE_INTERVAL)};n()}reportFpsRound(){const e=new Tt;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:Xe(),stateType:y(this,ke)}}async deviceInfo(){var g;const e=new F(navigator.userAgent),s=Ri(),n=await xi(),l=e.getBrowser(),a=e.getDevice(),h=e.getOS();return{browserName:l.name,browserVersion:l.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:Xe(),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}}}Le=new WeakMap,ee=new WeakMap,te=new WeakMap,ie=new WeakMap,ve=new WeakMap,_e=new WeakMap,ke=new WeakMap,Fe=new WeakMap;let xe;const Ui=new Uint8Array(16);function Li(){if(!xe&&(xe=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!xe))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return xe(Ui)}const S=[];for(let i=0;i<256;++i)S.push((i+256).toString(16).slice(1));function _i(i,t=0){return S[i[t+0]]+S[i[t+1]]+S[i[t+2]]+S[i[t+3]]+"-"+S[i[t+4]]+S[i[t+5]]+"-"+S[i[t+6]]+S[i[t+7]]+"-"+S[i[t+8]]+S[i[t+9]]+"-"+S[i[t+10]]+S[i[t+11]]+S[i[t+12]]+S[i[t+13]]+S[i[t+14]]+S[i[t+15]]}const Fi=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),At={randomUUID:Fi};function Pt(i,t,e){if(At.randomUUID&&!t&&!i)return At.randomUUID();i=i||{};const s=i.random||(i.rng||Li)();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 _i(s)}class at{constructor(t){w(this,"config");this.config=t}}const Rt=25,xt=1e4;var se,ne,ae,N,Se;class Di extends at{constructor(...e){super(...e);v(this,se,"https://europe-west3-stargazer-328808.cloudfunctions.net/collect-events");v(this,ne,void 0);v(this,ae,void 0);v(this,N,[]);v(this,Se,void 0);w(this,"processQueueForced");E(this,ne,new Date().getTime()),E(this,N,[]),E(this,Se,Pt()),this.processQueueForced=this.processQueue.bind(this,!0),this.schedule(),fetch(y(this,se),{method:"OPTIONS"}).catch(rt.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,ae)&&clearTimeout(y(this,ae)),E(this,ae,window.setTimeout(()=>this.processQueue(),xt))}send(e){E(this,ne,new Date().getTime());try{navigator.sendBeacon(y(this,se),JSON.stringify(e))}catch{fetch(y(this,se),{body:JSON.stringify(e),method:"POST",headers:{"Content-Type":"application/json"},keepalive:!0}).catch(rt.noop)}this.schedule()}addToQueue(e){y(this,N).push(e),this.processQueue()}processQueue(e=!1){if(!(this.config==null||!this.config.ui.feature.allowTelemetry)&&!(!e&&y(this,N).length<Rt&&new Date().getTime()-y(this,ne)<xt))for(;y(this,N).length;){const s=y(this,N).splice(0,Rt).map(n=>({...n,sessionID:y(this,Se),userID:this.config.api.user}));this.send(s)}}track(e,s){this.addToQueue({eventName:e,eventParams:s,eventTimestamp:new Date().getTime(),eventUUID:Pt()})}}se=new WeakMap,ne=new WeakMap,ae=new WeakMap,N=new WeakMap,Se=new WeakMap;const Bi=x("LoggingTracker","color:#000000;font-weight:bold;");class Gi extends at{track(t,e){Bi(`@${this.config.api.user}`,`[${t}]`,e)}}exports.BasicPlugin=qt;exports.CasinoPlugin=V;exports.DebuggingPlugin=$t;exports.GigPlugin=Qt;exports.KalambaBullseyePlugin=pi;exports.KalambaStargazerPlugin=Oi;exports.KalambaStargazerTracker=Di;exports.LoggingTracker=Gi;exports.OryxPlugin=Kt;exports.PariplayPlugin=ei;exports.RelaxFEIMPlugin=ti;exports.RgsPlygin=Ut;exports.TelemetryPlugin=Dt;exports.Tracker=at;exports.TukoPlugin=si;
|
package/dist/plugins.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* BSD 3-Clause License
|
|
3
3
|
* Copyright (c) 2024, Kalamba Games Limited
|
|
4
4
|
*/
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var w = (i, t, e) => (
|
|
5
|
+
var Bt = Object.defineProperty;
|
|
6
|
+
var Gt = (i, t, e) => t in i ? Bt(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
7
|
+
var w = (i, t, e) => (Gt(i, typeof t != "symbol" ? t + "" : t, e), e), at = (i, t, e) => {
|
|
8
8
|
if (!t.has(i))
|
|
9
9
|
throw TypeError("Cannot " + e);
|
|
10
10
|
};
|
|
@@ -19,9 +19,6 @@ function U(i, t) {
|
|
|
19
19
|
console.log(`[%c${i}\x1B[m] %s`, t, e, ...s);
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
function Ut(i, t) {
|
|
23
|
-
return Math.round(i * 100 / t);
|
|
24
|
-
}
|
|
25
22
|
class $ {
|
|
26
23
|
constructor(t) {
|
|
27
24
|
w(this, "config");
|
|
@@ -40,10 +37,13 @@ class $ {
|
|
|
40
37
|
});
|
|
41
38
|
}
|
|
42
39
|
}
|
|
43
|
-
const
|
|
44
|
-
|
|
40
|
+
const Nt = U("BasicPlugin", "color:#000000;font-weight:bold;");
|
|
41
|
+
function Ht(i, t) {
|
|
42
|
+
return Math.round(i * 100 / t);
|
|
43
|
+
}
|
|
44
|
+
class Ui extends $ {
|
|
45
45
|
constructor(...t) {
|
|
46
|
-
super(...t), this.registerToSdkEvents(), this.registerFromSdkEvents(),
|
|
46
|
+
super(...t), this.registerToSdkEvents(), this.registerFromSdkEvents(), Nt("configured");
|
|
47
47
|
}
|
|
48
48
|
registerToSdkEvents() {
|
|
49
49
|
window.addEventListener("message", (t) => {
|
|
@@ -55,7 +55,7 @@ class Pi extends $ {
|
|
|
55
55
|
return;
|
|
56
56
|
case "doBalanceUpdate":
|
|
57
57
|
const { currency: n, coinValueInCents: l } = this.config.api;
|
|
58
|
-
s.currency === n && typeof s.balanceInCurrency == "number" ? this.send("balance", { balance:
|
|
58
|
+
s.currency === n && typeof s.balanceInCurrency == "number" ? this.send("balance", { balance: Ht(s.balanceInCurrency, l) }) : (s.balanceInCoins, this.send("balance", { balance: s.balanceInCoins }));
|
|
59
59
|
return;
|
|
60
60
|
case "doGamePause":
|
|
61
61
|
this.send("freeze");
|
|
@@ -91,7 +91,7 @@ class Pi extends $ {
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
const k = U("▼ DebuggingPlugin IN ▼", "color:#444444;font-weight:bold;"), zt = U("▲ DebuggingPlugin OUT ▲", "color:#444444;font-weight:bold;");
|
|
94
|
-
class
|
|
94
|
+
class xi extends $ {
|
|
95
95
|
constructor(...t) {
|
|
96
96
|
super(...t), this.registerDebugToSdkEvents(), this.registerSdkToDebugEvents();
|
|
97
97
|
}
|
|
@@ -119,7 +119,7 @@ class Ui extends $ {
|
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
const Vt = U("GigPlugin", "color:#000000;font-weight:bold;");
|
|
122
|
-
class
|
|
122
|
+
class Oi extends $ {
|
|
123
123
|
constructor(...t) {
|
|
124
124
|
super(...t), this.registerToSdkEvents(), this.registerFromSdkEvents(), Vt("configured");
|
|
125
125
|
}
|
|
@@ -170,7 +170,7 @@ class xi extends $ {
|
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
172
|
const qt = U("OryxPlugin", "color:#000000;font-weight:bold;");
|
|
173
|
-
class
|
|
173
|
+
class Li extends $ {
|
|
174
174
|
constructor(...t) {
|
|
175
175
|
super(...t), this.registerToSdkEvents(), this.registerFromSdkEvents(), qt("configured");
|
|
176
176
|
}
|
|
@@ -252,7 +252,7 @@ function ze(i) {
|
|
|
252
252
|
return ["NOTIFICATION", "POPUP"].includes(e.messageType.toUpperCase());
|
|
253
253
|
});
|
|
254
254
|
}
|
|
255
|
-
function
|
|
255
|
+
function Ut(i) {
|
|
256
256
|
try {
|
|
257
257
|
return JSON.parse(i.text);
|
|
258
258
|
} catch {
|
|
@@ -260,16 +260,16 @@ function xt(i) {
|
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
262
|
function $t(i) {
|
|
263
|
-
return i.map(
|
|
263
|
+
return i.map(Ut).filter(Boolean).find(function(e) {
|
|
264
264
|
return e.betId != null && e.winId != null;
|
|
265
265
|
}) || {};
|
|
266
266
|
}
|
|
267
267
|
function jt(i) {
|
|
268
|
-
return i.map(
|
|
268
|
+
return i.map(Ut).filter(Boolean).find(function(e) {
|
|
269
269
|
return e.TotalBet != null && e.TotalWin != null;
|
|
270
270
|
}) || {};
|
|
271
271
|
}
|
|
272
|
-
class
|
|
272
|
+
class _i extends $ {
|
|
273
273
|
constructor(...t) {
|
|
274
274
|
super(...t), this.registerToSdkEvents(), this.registerFromSdkEvents(), rt("configured");
|
|
275
275
|
}
|
|
@@ -445,7 +445,7 @@ class Li extends $ {
|
|
|
445
445
|
}
|
|
446
446
|
}
|
|
447
447
|
const he = U("RelaxFEIMPlugin", "color:#000000;font-weight:bold;");
|
|
448
|
-
class
|
|
448
|
+
class Fi extends $ {
|
|
449
449
|
constructor(...e) {
|
|
450
450
|
super(...e);
|
|
451
451
|
w(this, "VERSION", "1.15.0");
|
|
@@ -522,7 +522,10 @@ class _i extends $ {
|
|
|
522
522
|
}
|
|
523
523
|
}
|
|
524
524
|
const Ve = U("TukoPlugin", "color:#000000;font-weight:bold;");
|
|
525
|
-
|
|
525
|
+
function Qt(i, t) {
|
|
526
|
+
return Math.round(i * 100 / t);
|
|
527
|
+
}
|
|
528
|
+
class Di extends $ {
|
|
526
529
|
constructor(...e) {
|
|
527
530
|
super(...e);
|
|
528
531
|
w(this, "PING_INTERVAL", 1e4);
|
|
@@ -547,7 +550,7 @@ class Fi extends $ {
|
|
|
547
550
|
return;
|
|
548
551
|
case "doBalanceUpdate":
|
|
549
552
|
const { currency: l, coinValueInCents: a } = this.config.api;
|
|
550
|
-
n.currency === l && typeof n.balanceInCurrency == "number" ? this.send("balance", { balance:
|
|
553
|
+
n.currency === l && typeof n.balanceInCurrency == "number" ? this.send("balance", { balance: Qt(n.balanceInCurrency, a) }) : (n.balanceInCoins, this.send("balance", { balance: n.balanceInCoins }));
|
|
551
554
|
return;
|
|
552
555
|
case "doGamePause":
|
|
553
556
|
this.send("freeze");
|
|
@@ -582,7 +585,7 @@ class Fi extends $ {
|
|
|
582
585
|
});
|
|
583
586
|
}
|
|
584
587
|
}
|
|
585
|
-
class
|
|
588
|
+
class Xt {
|
|
586
589
|
constructor(t) {
|
|
587
590
|
w(this, "socket", null);
|
|
588
591
|
w(this, "webSocketUrl");
|
|
@@ -651,23 +654,23 @@ function oe(i) {
|
|
|
651
654
|
var t;
|
|
652
655
|
return ((t = i == null ? void 0 : i.header) == null ? void 0 : t.name) === "GameEvent";
|
|
653
656
|
}
|
|
654
|
-
function
|
|
657
|
+
function Kt(i) {
|
|
655
658
|
return oe(i) && i.body.event === "OPEN_GAME";
|
|
656
659
|
}
|
|
657
|
-
function
|
|
660
|
+
function Jt(i) {
|
|
658
661
|
return oe(i) && i.body.event === "SPIN_ERROR";
|
|
659
662
|
}
|
|
660
|
-
function
|
|
663
|
+
function Yt(i) {
|
|
661
664
|
return oe(i) && i.body.event === "SPIN_RESULT";
|
|
662
665
|
}
|
|
663
|
-
function
|
|
666
|
+
function Zt(i) {
|
|
664
667
|
return oe(i) && i.body.event === "BG_RESULT";
|
|
665
668
|
}
|
|
666
|
-
function
|
|
669
|
+
function ei(i) {
|
|
667
670
|
var t;
|
|
668
671
|
return ((t = i == null ? void 0 : i.header) == null ? void 0 : t.name) === "OpenGame";
|
|
669
672
|
}
|
|
670
|
-
function
|
|
673
|
+
function ti(i) {
|
|
671
674
|
var t;
|
|
672
675
|
return ((t = i == null ? void 0 : i.header) == null ? void 0 : t.name) === "Ping";
|
|
673
676
|
}
|
|
@@ -676,7 +679,7 @@ function ct(i) {
|
|
|
676
679
|
return ((t = i == null ? void 0 : i.header) == null ? void 0 : t.name) === "RealityCheck";
|
|
677
680
|
}
|
|
678
681
|
var Z, ye;
|
|
679
|
-
class
|
|
682
|
+
class ii extends Xt {
|
|
680
683
|
constructor(e, s) {
|
|
681
684
|
const n = new URL(e.apiUrl);
|
|
682
685
|
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);
|
|
@@ -714,7 +717,7 @@ class ti extends Qt {
|
|
|
714
717
|
v(this, ye, void 0);
|
|
715
718
|
w(this, "onMessage", (e) => {
|
|
716
719
|
const s = Me(e);
|
|
717
|
-
(oe(s) ||
|
|
720
|
+
(oe(s) || ti(s) || ct(s)) && this.sendAcknowledgement(s), ct(s) && this.handleRealityCheck(s);
|
|
718
721
|
});
|
|
719
722
|
this.eventListeners.realityCheck = [], this.gameCode = e.gameCode, E(this, Z, s.requestTimeoutMs), E(this, ye, s.gameVersion ?? "unknown"), this.addEventListener("message", this.onMessage);
|
|
720
723
|
}
|
|
@@ -791,10 +794,10 @@ class ti extends Qt {
|
|
|
791
794
|
return new Promise((n, l) => {
|
|
792
795
|
const a = (h) => {
|
|
793
796
|
const p = Me(h);
|
|
794
|
-
|
|
797
|
+
Kt(p) && (this.removeEventListener("message", a), n(p.body));
|
|
795
798
|
};
|
|
796
799
|
this.addEventListener("message", a), this.request(e, s).catch((h) => {
|
|
797
|
-
|
|
800
|
+
ei(h.response) && l(h), l(h);
|
|
798
801
|
});
|
|
799
802
|
});
|
|
800
803
|
}
|
|
@@ -810,7 +813,7 @@ class ti extends Qt {
|
|
|
810
813
|
return new Promise((a, h) => {
|
|
811
814
|
const p = (g) => {
|
|
812
815
|
const f = Me(g);
|
|
813
|
-
oe(f) && l.seqId === f.body.correlationSeqId && (this.removeEventListener("message", p),
|
|
816
|
+
oe(f) && l.seqId === f.body.correlationSeqId && (this.removeEventListener("message", p), Yt(f) || Zt(f) ? a(f.body) : Jt(f) && h(f.body));
|
|
814
817
|
};
|
|
815
818
|
this.addEventListener("message", p), this.request(n, l).catch(
|
|
816
819
|
(g) => {
|
|
@@ -830,7 +833,7 @@ class ti extends Qt {
|
|
|
830
833
|
}
|
|
831
834
|
}
|
|
832
835
|
Z = new WeakMap(), ye = new WeakMap();
|
|
833
|
-
class
|
|
836
|
+
class si {
|
|
834
837
|
constructor(t) {
|
|
835
838
|
w(this, "config");
|
|
836
839
|
this.config = t;
|
|
@@ -848,7 +851,7 @@ class ii {
|
|
|
848
851
|
});
|
|
849
852
|
}
|
|
850
853
|
}
|
|
851
|
-
const
|
|
854
|
+
const ni = {
|
|
852
855
|
bul: "bg",
|
|
853
856
|
chi: "zh",
|
|
854
857
|
zho: "zh",
|
|
@@ -880,9 +883,9 @@ const si = {
|
|
|
880
883
|
tur: "tr",
|
|
881
884
|
ukr: "uk",
|
|
882
885
|
vie: "vi"
|
|
883
|
-
},
|
|
886
|
+
}, ai = U("KalambaBullseyePlugin", "color:#000000;font-weight:bold;");
|
|
884
887
|
var Ee;
|
|
885
|
-
class
|
|
888
|
+
class Bi extends si {
|
|
886
889
|
constructor(...e) {
|
|
887
890
|
super(...e);
|
|
888
891
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -910,14 +913,14 @@ class Di extends ii {
|
|
|
910
913
|
}), this.registerFromSdkEvents();
|
|
911
914
|
}
|
|
912
915
|
initialize(e) {
|
|
913
|
-
this.socket = new
|
|
916
|
+
this.socket = new ii(e, {
|
|
914
917
|
gameVersion: y(this, Ee),
|
|
915
918
|
requestTimeoutMs: this.config.ui.requestTimeoutMs
|
|
916
919
|
}), this.socket.addEventListener("close", (s) => {
|
|
917
920
|
s.code === 1006 && this.reconnect(e);
|
|
918
921
|
}), document.addEventListener("visibilitychange", () => {
|
|
919
922
|
document.visibilityState === "visible" && this.socket.socket && this.socket.socket.readyState !== WebSocket.OPEN && this.reconnect(e);
|
|
920
|
-
}), this.socket.addEventListener("error", (s) =>
|
|
923
|
+
}), this.socket.addEventListener("error", (s) => ai("error", s)), this.socket.addEventListener("realityCheck", (s) => {
|
|
921
924
|
this.send("realityCheck", s);
|
|
922
925
|
});
|
|
923
926
|
}
|
|
@@ -946,7 +949,7 @@ class Di extends ii {
|
|
|
946
949
|
cashierUrl: D
|
|
947
950
|
};
|
|
948
951
|
const x = e.get("languageCode");
|
|
949
|
-
return x && (this.config.ui.language = x.length === 3 ?
|
|
952
|
+
return x && (this.config.ui.language = x.length === 3 ? ni[x] ?? x : x), le;
|
|
950
953
|
}
|
|
951
954
|
// TODO: redefine PlayResponse type
|
|
952
955
|
play(e) {
|
|
@@ -973,7 +976,7 @@ class Di extends ii {
|
|
|
973
976
|
}
|
|
974
977
|
}
|
|
975
978
|
Ee = new WeakMap();
|
|
976
|
-
var
|
|
979
|
+
var oi = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce = "object", Je = "string", fe = "major", c = "model", o = "name", d = "type", u = "vendor", r = "version", M = "architecture", K = "console", m = "mobile", b = "tablet", I = "smarttv", X = "wearable", Ye = "embedded", lt = "user-agent", Ze = 500, it = "brands", q = "formFactor", st = "fullVersionList", J = "platform", nt = "platformVersion", De = "bitness", V = "sec-ch-ua", ri = V + "-full-version-list", ci = V + "-arch", di = V + "-" + De, li = V + "-form-factor", ui = V + "-" + m, hi = V + "-" + c, xt = V + "-" + J, pi = xt + "-version", Ot = [it, st, m, c, J, nt, M, q, De], T = "browser", O = "cpu", P = "device", L = "engine", R = "os", Y = "result", Ce = "Amazon", pe = "Apple", ut = "ASUS", ht = "BlackBerry", Ie = "Google", pt = "Huawei", gt = "Lenovo", qe = "LG", xe = "Microsoft", wt = "Motorola", Te = "Samsung", mt = "Sharp", Ae = "Sony", We = "Xiaomi", $e = "Zebra", j = "Mobile ", Q = " Browser", Re = "Chrome", gi = "Edge", ge = "Firefox", we = "Opera", ft = "Facebook", bt = "Sogou", et = "Windows", wi = typeof window !== H, C = wi && window.navigator ? window.navigator : void 0, G = C && C.userAgentData ? C.userAgentData : void 0, mi = function(i, t) {
|
|
977
980
|
var e = {};
|
|
978
981
|
for (var s in i)
|
|
979
982
|
e[s] = t[s] && t[s].length % 2 === 0 ? t[s].concat(i[s]) : i[s];
|
|
@@ -1853,7 +1856,7 @@ var ai = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
|
|
|
1853
1856
|
/windows.+ edge\/([\w\.]+)/i
|
|
1854
1857
|
// EdgeHTML
|
|
1855
1858
|
],
|
|
1856
|
-
[r, [o,
|
|
1859
|
+
[r, [o, gi + "HTML"]],
|
|
1857
1860
|
[
|
|
1858
1861
|
/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i
|
|
1859
1862
|
// Blink
|
|
@@ -2037,7 +2040,7 @@ var ai = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
|
|
|
2037
2040
|
[L, [o, r]],
|
|
2038
2041
|
[R, [o, r]]
|
|
2039
2042
|
]), i;
|
|
2040
|
-
}(),
|
|
2043
|
+
}(), fi = function(i, t) {
|
|
2041
2044
|
var e = Pe.init[t], s = Pe.isIgnore[t] || 0, n = Pe.isIgnoreRgx[t] || 0, l = Pe.toString[t] || 0;
|
|
2042
2045
|
function a() {
|
|
2043
2046
|
_.call(this, e);
|
|
@@ -2045,8 +2048,8 @@ var ai = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
|
|
|
2045
2048
|
return a.prototype.getItem = function() {
|
|
2046
2049
|
return i;
|
|
2047
2050
|
}, a.prototype.withClientHints = function() {
|
|
2048
|
-
return G ? G.getHighEntropyValues(
|
|
2049
|
-
return i.setCH(new
|
|
2051
|
+
return G ? G.getHighEntropyValues(Ot).then(function(h) {
|
|
2052
|
+
return i.setCH(new Lt(h, !1)).parseCH().get();
|
|
2050
2053
|
}) : i.parseCH().get();
|
|
2051
2054
|
}, a.prototype.withFeatureCheck = function() {
|
|
2052
2055
|
return i.detectFeature().get();
|
|
@@ -2079,18 +2082,18 @@ var ai = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
|
|
|
2079
2082
|
return h(f), f;
|
|
2080
2083
|
}), new a();
|
|
2081
2084
|
};
|
|
2082
|
-
function
|
|
2083
|
-
if (i = i || {}, _.call(this,
|
|
2085
|
+
function Lt(i, t) {
|
|
2086
|
+
if (i = i || {}, _.call(this, Ot), t)
|
|
2084
2087
|
_.call(this, [
|
|
2085
2088
|
[it, je(i[V])],
|
|
2086
|
-
[st, je(i[
|
|
2087
|
-
[m, /\?1/.test(i[
|
|
2088
|
-
[c, me(i[
|
|
2089
|
-
[J, me(i[
|
|
2090
|
-
[nt, me(i[
|
|
2091
|
-
[M, me(i[
|
|
2092
|
-
[q, je(i[
|
|
2093
|
-
[De, me(i[
|
|
2089
|
+
[st, je(i[ri])],
|
|
2090
|
+
[m, /\?1/.test(i[ui])],
|
|
2091
|
+
[c, me(i[hi])],
|
|
2092
|
+
[J, me(i[xt])],
|
|
2093
|
+
[nt, me(i[pi])],
|
|
2094
|
+
[M, me(i[ci])],
|
|
2095
|
+
[q, je(i[li])],
|
|
2096
|
+
[De, me(i[di])]
|
|
2094
2097
|
]);
|
|
2095
2098
|
else
|
|
2096
2099
|
for (var e in i)
|
|
@@ -2159,8 +2162,8 @@ function Mt(i, t, e, s) {
|
|
|
2159
2162
|
this.get(o) == et && n[c] == "Xbox" && this.set(o, "Xbox").set(r, void 0);
|
|
2160
2163
|
break;
|
|
2161
2164
|
case Y:
|
|
2162
|
-
var
|
|
2163
|
-
return Dt
|
|
2165
|
+
var Ft = this.data, ue = function(Dt) {
|
|
2166
|
+
return Ft[Dt].getItem().setCH(n).parseCH().get();
|
|
2164
2167
|
};
|
|
2165
2168
|
this.set(T, ue(T)).set(O, ue(O)).set(P, ue(P)).set(L, ue(L)).set(R, ue(R));
|
|
2166
2169
|
}
|
|
@@ -2170,7 +2173,7 @@ function Mt(i, t, e, s) {
|
|
|
2170
2173
|
["ua", t],
|
|
2171
2174
|
["uaCH", s],
|
|
2172
2175
|
["rgxMap", e],
|
|
2173
|
-
["data",
|
|
2176
|
+
["data", fi(this, i)]
|
|
2174
2177
|
]), this;
|
|
2175
2178
|
}
|
|
2176
2179
|
function F(i, t, e) {
|
|
@@ -2185,7 +2188,7 @@ function F(i, t, e) {
|
|
|
2185
2188
|
re
|
|
2186
2189
|
)
|
|
2187
2190
|
)
|
|
2188
|
-
), n = new
|
|
2191
|
+
), n = new Lt(e, !0), l = t ? mi(St, t) : St, a = function(h) {
|
|
2189
2192
|
return h == Y ? function() {
|
|
2190
2193
|
return new Mt(h, s, l, n).set("ua", s).set(T, this.getBrowser()).set(O, this.getCPU()).set(P, this.getDevice()).set(L, this.getEngine()).set(R, this.getOS()).get();
|
|
2191
2194
|
} : function() {
|
|
@@ -2207,12 +2210,12 @@ function F(i, t, e) {
|
|
|
2207
2210
|
}]
|
|
2208
2211
|
]).setUA(s), this;
|
|
2209
2212
|
}
|
|
2210
|
-
F.VERSION =
|
|
2213
|
+
F.VERSION = oi;
|
|
2211
2214
|
F.BROWSER = Be([o, r, fe]);
|
|
2212
2215
|
F.CPU = Be([M]);
|
|
2213
2216
|
F.DEVICE = Be([c, u, d, K, m, I, b, X, Ye]);
|
|
2214
2217
|
F.ENGINE = F.OS = Be([o, r]);
|
|
2215
|
-
class
|
|
2218
|
+
class bi {
|
|
2216
2219
|
constructor(t, e) {
|
|
2217
2220
|
w(this, "trackers");
|
|
2218
2221
|
w(this, "config");
|
|
@@ -2231,7 +2234,7 @@ class fi {
|
|
|
2231
2234
|
function Ct(i) {
|
|
2232
2235
|
return i.reduce((t, e) => t + e, 0);
|
|
2233
2236
|
}
|
|
2234
|
-
function
|
|
2237
|
+
function yi(i) {
|
|
2235
2238
|
const t = i.length, e = Ct(i) / t, s = i.map((l) => Math.pow(l - e, 2)), n = Ct(s) / t;
|
|
2236
2239
|
return Math.sqrt(n);
|
|
2237
2240
|
}
|
|
@@ -2246,7 +2249,7 @@ class It {
|
|
|
2246
2249
|
return this.frames.map((e) => Math.floor((e - this.startTime) / 1e3)).reduce((e, s, n, l) => (l[n] !== l[n - 1] ? e.push(1) : e[e.length - 1]++, e), []).slice(0, t);
|
|
2247
2250
|
});
|
|
2248
2251
|
w(this, "getReport", () => {
|
|
2249
|
-
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, l = t.length > 0 ?
|
|
2252
|
+
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, l = t.length > 0 ? yi(t) : 0;
|
|
2250
2253
|
return { fpsAvg: e, fpsMax: s, fpsMin: n, fpsStdDev: l };
|
|
2251
2254
|
});
|
|
2252
2255
|
w(this, "start", () => {
|
|
@@ -2260,8 +2263,8 @@ class It {
|
|
|
2260
2263
|
});
|
|
2261
2264
|
}
|
|
2262
2265
|
}
|
|
2263
|
-
const
|
|
2264
|
-
function
|
|
2266
|
+
const Ei = "landscape", vi = "portrait";
|
|
2267
|
+
function ki() {
|
|
2265
2268
|
try {
|
|
2266
2269
|
const i = document.createElement("canvas");
|
|
2267
2270
|
return !!window.WebGLRenderingContext && (i.getContext("webgl") || i.getContext("experimental-webgl")) instanceof WebGLRenderingContext;
|
|
@@ -2269,7 +2272,7 @@ function vi() {
|
|
|
2269
2272
|
return !1;
|
|
2270
2273
|
}
|
|
2271
2274
|
}
|
|
2272
|
-
async function
|
|
2275
|
+
async function Si() {
|
|
2273
2276
|
if (!window.createImageBitmap)
|
|
2274
2277
|
return !1;
|
|
2275
2278
|
const e = await (await fetch("data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoCAAEAAQAcJaQAA3AA/v3AgAA=")).blob();
|
|
@@ -2280,10 +2283,10 @@ async function ki() {
|
|
|
2280
2283
|
}
|
|
2281
2284
|
}
|
|
2282
2285
|
function Xe() {
|
|
2283
|
-
return window.innerWidth >= window.innerHeight ?
|
|
2286
|
+
return window.innerWidth >= window.innerHeight ? Ei : vi;
|
|
2284
2287
|
}
|
|
2285
2288
|
var Le, ee, te, ie, ve, _e, ke, Fe;
|
|
2286
|
-
class
|
|
2289
|
+
class Gi extends bi {
|
|
2287
2290
|
constructor(...e) {
|
|
2288
2291
|
super(...e);
|
|
2289
2292
|
w(this, "FPS_SAMPLE_INTERVAL", 1e4);
|
|
@@ -2416,7 +2419,7 @@ class Bi extends fi {
|
|
|
2416
2419
|
}
|
|
2417
2420
|
async deviceInfo() {
|
|
2418
2421
|
var p;
|
|
2419
|
-
const e = new F(navigator.userAgent), s =
|
|
2422
|
+
const e = new F(navigator.userAgent), s = ki(), n = await Si(), l = e.getBrowser(), a = e.getDevice(), h = e.getOS();
|
|
2420
2423
|
return {
|
|
2421
2424
|
browserName: l.name,
|
|
2422
2425
|
browserVersion: l.version,
|
|
@@ -2443,35 +2446,35 @@ class Bi extends fi {
|
|
|
2443
2446
|
}
|
|
2444
2447
|
Le = new WeakMap(), ee = new WeakMap(), te = new WeakMap(), ie = new WeakMap(), ve = new WeakMap(), _e = new WeakMap(), ke = new WeakMap(), Fe = new WeakMap();
|
|
2445
2448
|
let Ue;
|
|
2446
|
-
const
|
|
2447
|
-
function
|
|
2449
|
+
const Mi = new Uint8Array(16);
|
|
2450
|
+
function Ci() {
|
|
2448
2451
|
if (!Ue && (Ue = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !Ue))
|
|
2449
2452
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
2450
|
-
return Ue(
|
|
2453
|
+
return Ue(Mi);
|
|
2451
2454
|
}
|
|
2452
2455
|
const S = [];
|
|
2453
2456
|
for (let i = 0; i < 256; ++i)
|
|
2454
2457
|
S.push((i + 256).toString(16).slice(1));
|
|
2455
|
-
function
|
|
2458
|
+
function Ii(i, t = 0) {
|
|
2456
2459
|
return S[i[t + 0]] + S[i[t + 1]] + S[i[t + 2]] + S[i[t + 3]] + "-" + S[i[t + 4]] + S[i[t + 5]] + "-" + S[i[t + 6]] + S[i[t + 7]] + "-" + S[i[t + 8]] + S[i[t + 9]] + "-" + S[i[t + 10]] + S[i[t + 11]] + S[i[t + 12]] + S[i[t + 13]] + S[i[t + 14]] + S[i[t + 15]];
|
|
2457
2460
|
}
|
|
2458
|
-
const
|
|
2459
|
-
randomUUID:
|
|
2461
|
+
const Ti = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Tt = {
|
|
2462
|
+
randomUUID: Ti
|
|
2460
2463
|
};
|
|
2461
2464
|
function At(i, t, e) {
|
|
2462
2465
|
if (Tt.randomUUID && !t && !i)
|
|
2463
2466
|
return Tt.randomUUID();
|
|
2464
2467
|
i = i || {};
|
|
2465
|
-
const s = i.random || (i.rng ||
|
|
2468
|
+
const s = i.random || (i.rng || Ci)();
|
|
2466
2469
|
if (s[6] = s[6] & 15 | 64, s[8] = s[8] & 63 | 128, t) {
|
|
2467
2470
|
e = e || 0;
|
|
2468
2471
|
for (let n = 0; n < 16; ++n)
|
|
2469
2472
|
t[e + n] = s[n];
|
|
2470
2473
|
return t;
|
|
2471
2474
|
}
|
|
2472
|
-
return
|
|
2475
|
+
return Ii(s);
|
|
2473
2476
|
}
|
|
2474
|
-
class
|
|
2477
|
+
class _t {
|
|
2475
2478
|
constructor(t) {
|
|
2476
2479
|
w(this, "config");
|
|
2477
2480
|
this.config = t;
|
|
@@ -2479,7 +2482,7 @@ class Ft {
|
|
|
2479
2482
|
}
|
|
2480
2483
|
const Rt = 25, Pt = 1e4;
|
|
2481
2484
|
var se, ne, ae, N, Se;
|
|
2482
|
-
class
|
|
2485
|
+
class Ni extends _t {
|
|
2483
2486
|
constructor(...e) {
|
|
2484
2487
|
super(...e);
|
|
2485
2488
|
v(this, se, "https://europe-west3-stargazer-328808.cloudfunctions.net/collect-events");
|
|
@@ -2538,26 +2541,26 @@ class Gi extends Ft {
|
|
|
2538
2541
|
}
|
|
2539
2542
|
}
|
|
2540
2543
|
se = new WeakMap(), ne = new WeakMap(), ae = new WeakMap(), N = new WeakMap(), Se = new WeakMap();
|
|
2541
|
-
const
|
|
2542
|
-
class
|
|
2544
|
+
const Ai = U("LoggingTracker", "color:#000000;font-weight:bold;");
|
|
2545
|
+
class Hi extends _t {
|
|
2543
2546
|
track(t, e) {
|
|
2544
|
-
|
|
2547
|
+
Ai(`@${this.config.api.user}`, `[${t}]`, e);
|
|
2545
2548
|
}
|
|
2546
2549
|
}
|
|
2547
2550
|
export {
|
|
2548
|
-
|
|
2551
|
+
Ui as BasicPlugin,
|
|
2549
2552
|
$ as CasinoPlugin,
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2553
|
+
xi as DebuggingPlugin,
|
|
2554
|
+
Oi as GigPlugin,
|
|
2555
|
+
Bi as KalambaBullseyePlugin,
|
|
2556
|
+
Gi as KalambaStargazerPlugin,
|
|
2557
|
+
Ni as KalambaStargazerTracker,
|
|
2558
|
+
Hi as LoggingTracker,
|
|
2559
|
+
Li as OryxPlugin,
|
|
2560
|
+
_i as PariplayPlugin,
|
|
2561
|
+
Fi as RelaxFEIMPlugin,
|
|
2562
|
+
si as RgsPlygin,
|
|
2563
|
+
bi as TelemetryPlugin,
|
|
2564
|
+
_t as Tracker,
|
|
2565
|
+
Di as TukoPlugin
|
|
2563
2566
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kalamba/sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"license": "BSD-3-Clause",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -39,8 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"ua-parser-js": "2.0.0-beta.2",
|
|
42
|
-
"uuid": "9.0.1"
|
|
43
|
-
"@kalamba/common": "0.1.0"
|
|
42
|
+
"uuid": "9.0.1"
|
|
44
43
|
},
|
|
45
44
|
"devDependencies": {
|
|
46
45
|
"@types/react": "18.2.48",
|