@kalamba/sdk 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/plugins.cjs +1 -1
- package/dist/plugins.d.ts +1 -0
- package/dist/plugins.js +96 -93
- package/dist/wrapper.d.ts +1 -0
- package/package.json +2 -3
package/dist/index.d.ts
CHANGED
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 Ut(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:c}=this.config.api;s.currency===n&&typeof s.balanceInCurrency=="number"?this.send("balance",{balance:Ut(s.balanceInCurrency,c)}):(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 c=new XMLHttpRequest;c.onload=function(){c.status>=200&&c.status<300?s(c.responseText):n(c.responseText)},c.open(i,t),c.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(c=>c.action.toUpperCase()==="CASHIER"?!!this.config.api.cashierUrl:!0).map(c=>Object.assign({},c,{onRelease:()=>{const a=s.messageType.toUpperCase()==="POPUP"?He:n,h=this.buttonActions[c.action.toUpperCase()];h?h(c,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),c=JSON.parse(n.integrationSpecificAttributes.sessionData||"{}");s={ClientToken:n.integrationSpecificAttributes.clientToken,CurrencyCode:n.currency,PlayerTokenId:n.user,SessionData:c}}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),c=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:c,SessionData:h,Status:{ErrCode:0},WinAmount:this.coinsToCurrency(e.data.gameRoundResult.win)})}),this.on("playStart",e=>{e.bet&&this.postMessage("roundStart",{totalBet:this.coinsToCurrency(e.bet.base*e.bet.multiplier)})}),this.on("loadEnd",()=>{this.postMessage("gameReady")}),this.on("loadStart",()=>{this.postMessage("onAppFrameReady")}),this.on("cashier",()=>{this.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:c,coinValueInCents:a}=this.config.api;n.currency===c&&typeof n.balanceInCurrency=="number"?this.send("balance",{balance:Ut(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((c,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?c(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(c=>c.body)}openGame(){const e=this.buildHeader("OpenGame"),s={gameCode:this.gameCode};return new Promise((n,c)=>{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)&&c(h),c(h)})})}sendAcknowledgement(e){const{name:s,cId:n}=e.header,c=this.buildHeader(s,n),a=this.buildPayload(c,{});this.send(a)}sendAction(e,s){const n=this.buildHeader("GameAction"),c={...this.getBodyExtras(e),data:s};return new Promise((a,h)=>{const g=p=>{const f=Me(p);oe(f)&&c.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,c).catch(p=>{h(p)})})}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"),c=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:c,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:c,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 U=e.get("languageCode");return U&&(this.config.ui.language=U.length===3?ui[U]??U:U),le}play(e){const{contract:{bet:s,...n},extra:c,actionType:a}=e;return this.socket.sendAction(a,{bet:s?{baseBet:s.base,betMultiplier:s.multiplier}:void 0,...n,...c})}registerFromSdkEvents(){this.on("history",()=>{const{api:{game:e,integration:s,integrationData:n,jurisdiction:c,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",c),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",d="model",o="name",l="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+"-"+d,_t=q+"-"+J,vi=_t+"-version",Ft=[it,st,m,d,J,nt,M,W,De],T="browser",O="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",Ue="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,c,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(c=0;c<f.length;c++)g=h[++n],a=f[c],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}},Oe=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],[d,[u,Te],[l,b]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[d,[u,Te],[l,m]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[d,[u,ge],[l,m]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[d,[u,ge],[l,b]],[/(macintosh);/i],[d,[u,ge]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[d,[u,ft],[l,m]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[d,[u,pt],[l,b]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[d,[u,pt],[l,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],[[d,/_/g," "],[u,We],[l,m]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[d,/_/g," "],[u,We],[l,b]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[d,[u,"OPPO"],[l,m]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[d,[u,"Vivo"],[l,m]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[d,[u,"Realme"],[l,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],[d,[u,mt],[l,m]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[d,[u,mt],[l,b]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[d,[u,qe],[l,b]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[d,[u,qe],[l,m]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[d,[u,wt],[l,b]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[d,/_/g," "],[u,"Nokia"],[l,m]],[/(pixel c)\b/i],[d,[u,Ie],[l,b]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[d,[u,Ie],[l,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],[d,[u,Ae],[l,m]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[d,"Xperia Tablet"],[u,Ae],[l,b]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[d,[u,"OnePlus"],[l,m]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[d,[u,Ce],[l,b]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[d,/(.+)/g,"Fire Phone $1"],[u,Ce],[l,m]],[/(playbook);[-\w\),; ]+(rim)/i],[d,u,[l,b]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[d,[u,gt],[l,m]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[d,[u,ht],[l,b]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[d,[u,ht],[l,m]],[/(nexus 9)/i],[d,[u,"HTC"],[l,b]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[u,[d,/_/g," "],[l,m]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[d,[u,"Acer"],[l,b]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[d,[u,"Meizu"],[l,m]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[d,[u,"Ulefone"],[l,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,d,[l,m]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[u,d,[l,b]],[/(surface duo)/i],[d,[u,Ue],[l,b]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[d,[u,"Fairphone"],[l,m]],[/(shield[\w ]+) b/i],[d,[u,"Nvidia"],[l,b]],[/(sprint) (\w+)/i],[u,d,[l,m]],[/(kin\.[onetw]{3})/i],[[d,/\./g," "],[u,Ue],[l,m]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[d,[u,$e],[l,b]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[d,[u,$e],[l,m]],[/smart-tv.+(samsung)/i],[u,[l,I]],[/hbbtv.+maple;(\d+)/i],[[d,/^/,"SmartTV"],[u,Te],[l,I]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[u,qe],[l,I]],[/(apple) ?tv/i],[u,[d,ge+" TV"],[l,I]],[/crkey/i],[[d,Pe+"cast"],[u,Ie],[l,I]],[/droid.+aft(\w+)( bui|\))/i],[d,[u,Ce],[l,I]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[d,[u,ft],[l,I]],[/(bravia[\w ]+)( bui|\))/i],[d,[u,Ae],[l,I]],[/(mitv-\w{5}) bui/i],[d,[u,We],[l,I]],[/Hbbtv.*(technisat) (.*);/i],[u,d,[l,I]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[u,be],[d,be],[l,I]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[l,I]],[/(ouya)/i,/(nintendo) (\w+)/i],[u,d,[l,K]],[/droid.+; (shield) bui/i],[d,[u,"Nvidia"],[l,K]],[/(playstation \w+)/i],[d,[u,Ae],[l,K]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[d,[u,Ue],[l,K]],[/((pebble))app/i],[u,d,[l,X]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[d,[u,ge],[l,X]],[/droid.+; (glass) \d/i],[d,[u,Ie],[l,X]],[/droid.+; (wt63?0{2,3})\)/i],[d,[u,$e],[l,X]],[/(quest( 2| pro)?)/i],[d,[u,bt],[l,X]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[u,[l,Ye]],[/(aeobc)\b/i],[d,[u,Ce],[l,Ye]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[d,[l,m]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[d,[l,b]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[l,b]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[l,m]],[/(android[-\w\. ]{0,9});.+buil/i],[d,[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,Oe,kt]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[r,Oe,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]],[O,[M]],[R,[l,d,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]],[O,[M]],[R,[u,d]],[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,c=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 c)typeof this[c[g]]!==H&&(h+=(h?" ":re)+this[c[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])],[d,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,c){return this.data[n]=c,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(l)&&G&&G[m]&&this.set(l,m),this.get(d)=="Macintosh"&&C&&typeof C.standalone!==H&&C.maxTouchPoints&&C.maxTouchPoints>2&&this.set(d,"iPad").set(l,b);break;case P:!this.get(o)&&G&&G[J]&&this.set(o,G[J]);break;case Y:var n=this.data,c=function(a){return n[a].getItem().detectFeature().get()};this.set(T,c(T)).set(O,c(O)).set(R,c(R)).set(L,c(L)).set(P,c(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,c=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 O:var A=n[M];A&&(A&&n[De]=="64"&&(A+="64"),vt.call(this.data,A+";",c));break;case R:if(n[m]&&this.set(l,m),n[d]&&this.set(d,n[d]),n[d]=="Xbox"&&this.set(l,K).set(u,Ue),n[W]){var D;if(typeof n[W]!="string")for(var B=0;!D&&B<n[W].length;)D=Oe(n[W][B++],St);else D=Oe(n[W],St);this.set(l,D)}break;case P:var le=n[J];if(le){var U=n[nt];le==et&&(U=parseInt(Qe(U),10)>=13?"11":"10"),this.set(o,le).set(r,U)}this.get(o)==et&&n[d]=="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(O,ue(O)).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),c=t?Mi(Mt,t):Mt,a=function(h){return h==Y?function(){return new Ct(h,s,c,n).set("ua",s).set(T,this.getBrowser()).set(O,this.getCPU()).set(R,this.getDevice()).set(L,this.getEngine()).set(P,this.getOS()).get()}:function(){return new Ct(h,s,c[h],n).parseUA().get()}};return _.call(this,[["getBrowser",a(T)],["getCPU",a(O)],["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([d,u,l,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(c=>Math.pow(c-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,c)=>(c[n]!==c[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,c=t.length>0?Ii(t):0;return{fpsAvg:e,fpsMax:s,fpsMin:n,fpsStdDev:c}});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:c,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:c,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 c=e.getReport();this.track("FPS Performance",{...c,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(),c=e.getBrowser(),a=e.getDevice(),h=e.getOS();return{browserName:c.name,browserVersion:c.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 Oi(){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 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||Oi)();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})}}function zt(i,t){return Math.round(i*100/t)}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:c}=this.config.api;s.currency===n&&typeof s.balanceInCurrency=="number"?this.send("balance",{balance:zt(s.balanceInCurrency,c)}):(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 c=new XMLHttpRequest;c.onload=function(){c.status>=200&&c.status<300?s(c.responseText):n(c.responseText)},c.open(i,t),c.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(c=>c.action.toUpperCase()==="CASHIER"?!!this.config.api.cashierUrl:!0).map(c=>Object.assign({},c,{onRelease:()=>{const a=s.messageType.toUpperCase()==="POPUP"?He:n,h=this.buttonActions[c.action.toUpperCase()];h?h(c,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),c=JSON.parse(n.integrationSpecificAttributes.sessionData||"{}");s={ClientToken:n.integrationSpecificAttributes.clientToken,CurrencyCode:n.currency,PlayerTokenId:n.user,SessionData:c}}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),c=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:c,SessionData:h,Status:{ErrCode:0},WinAmount:this.coinsToCurrency(e.data.gameRoundResult.win)})}),this.on("playStart",e=>{e.bet&&this.postMessage("roundStart",{totalBet:this.coinsToCurrency(e.bet.base*e.bet.multiplier)})}),this.on("loadEnd",()=>{this.postMessage("gameReady")}),this.on("loadStart",()=>{this.postMessage("onAppFrameReady")}),this.on("cashier",()=>{this.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)})}}function ii(i,t){return Math.round(i*100/t)}const Ve=x("TukoPlugin","color:#000000;font-weight:bold;");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:c,coinValueInCents:a}=this.config.api;n.currency===c&&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((c,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?c(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(c=>c.body)}openGame(){const e=this.buildHeader("OpenGame"),s={gameCode:this.gameCode};return new Promise((n,c)=>{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)&&c(h),c(h)})})}sendAcknowledgement(e){const{name:s,cId:n}=e.header,c=this.buildHeader(s,n),a=this.buildPayload(c,{});this.send(a)}sendAction(e,s){const n=this.buildHeader("GameAction"),c={...this.getBodyExtras(e),data:s};return new Promise((a,h)=>{const g=p=>{const f=Me(p);oe(f)&&c.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,c).catch(p=>{h(p)})})}setRequestTimeoutMs(e){E(this,Z,e)}}Z=new WeakMap,ye=new WeakMap;class Ot{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 Ot{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"),c=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:c,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:c,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 U=e.get("languageCode");return U&&(this.config.ui.language=U.length===3?hi[U]??U:U),le}play(e){const{contract:{bet:s,...n},extra:c,actionType:a}=e;return this.socket.sendAction(a,{bet:s?{baseBet:s.base,betMultiplier:s.multiplier}:void 0,...n,...c})}registerFromSdkEvents(){this.on("history",()=>{const{api:{game:e,integration:s,integrationData:n,jurisdiction:c,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",c),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",d="model",o="name",l="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+"-"+d,Lt=q+"-"+J,ki=Lt+"-version",_t=[it,st,m,d,J,nt,M,W,De],T="browser",O="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",Ue="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,c,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(c=0;c<f.length;c++)g=h[++n],a=f[c],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}},Oe=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],[d,[u,Te],[l,b]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[d,[u,Te],[l,m]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[d,[u,ge],[l,m]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[d,[u,ge],[l,b]],[/(macintosh);/i],[d,[u,ge]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[d,[u,ft],[l,m]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[d,[u,pt],[l,b]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[d,[u,pt],[l,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],[[d,/_/g," "],[u,We],[l,m]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[d,/_/g," "],[u,We],[l,b]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[d,[u,"OPPO"],[l,m]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[d,[u,"Vivo"],[l,m]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[d,[u,"Realme"],[l,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],[d,[u,mt],[l,m]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[d,[u,mt],[l,b]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[d,[u,qe],[l,b]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[d,[u,qe],[l,m]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[d,[u,wt],[l,b]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[d,/_/g," "],[u,"Nokia"],[l,m]],[/(pixel c)\b/i],[d,[u,Ie],[l,b]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[d,[u,Ie],[l,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],[d,[u,Ae],[l,m]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[d,"Xperia Tablet"],[u,Ae],[l,b]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[d,[u,"OnePlus"],[l,m]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[d,[u,Ce],[l,b]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[d,/(.+)/g,"Fire Phone $1"],[u,Ce],[l,m]],[/(playbook);[-\w\),; ]+(rim)/i],[d,u,[l,b]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[d,[u,gt],[l,m]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[d,[u,ht],[l,b]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[d,[u,ht],[l,m]],[/(nexus 9)/i],[d,[u,"HTC"],[l,b]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[u,[d,/_/g," "],[l,m]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[d,[u,"Acer"],[l,b]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[d,[u,"Meizu"],[l,m]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[d,[u,"Ulefone"],[l,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,d,[l,m]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[u,d,[l,b]],[/(surface duo)/i],[d,[u,Ue],[l,b]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[d,[u,"Fairphone"],[l,m]],[/(shield[\w ]+) b/i],[d,[u,"Nvidia"],[l,b]],[/(sprint) (\w+)/i],[u,d,[l,m]],[/(kin\.[onetw]{3})/i],[[d,/\./g," "],[u,Ue],[l,m]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[d,[u,$e],[l,b]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[d,[u,$e],[l,m]],[/smart-tv.+(samsung)/i],[u,[l,I]],[/hbbtv.+maple;(\d+)/i],[[d,/^/,"SmartTV"],[u,Te],[l,I]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[u,qe],[l,I]],[/(apple) ?tv/i],[u,[d,ge+" TV"],[l,I]],[/crkey/i],[[d,Pe+"cast"],[u,Ie],[l,I]],[/droid.+aft(\w+)( bui|\))/i],[d,[u,Ce],[l,I]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[d,[u,ft],[l,I]],[/(bravia[\w ]+)( bui|\))/i],[d,[u,Ae],[l,I]],[/(mitv-\w{5}) bui/i],[d,[u,We],[l,I]],[/Hbbtv.*(technisat) (.*);/i],[u,d,[l,I]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[u,be],[d,be],[l,I]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[l,I]],[/(ouya)/i,/(nintendo) (\w+)/i],[u,d,[l,K]],[/droid.+; (shield) bui/i],[d,[u,"Nvidia"],[l,K]],[/(playstation \w+)/i],[d,[u,Ae],[l,K]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[d,[u,Ue],[l,K]],[/((pebble))app/i],[u,d,[l,X]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[d,[u,ge],[l,X]],[/droid.+; (glass) \d/i],[d,[u,Ie],[l,X]],[/droid.+; (wt63?0{2,3})\)/i],[d,[u,$e],[l,X]],[/(quest( 2| pro)?)/i],[d,[u,bt],[l,X]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[u,[l,Ye]],[/(aeobc)\b/i],[d,[u,Ce],[l,Ye]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[d,[l,m]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[d,[l,b]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[l,b]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[l,m]],[/(android[-\w\. ]{0,9});.+buil/i],[d,[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,Oe,kt]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[r,Oe,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]],[O,[M]],[R,[l,d,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]],[O,[M]],[R,[u,d]],[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,c=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 c)typeof this[c[g]]!==H&&(h+=(h?" ":re)+this[c[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])],[d,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,c){return this.data[n]=c,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(l)&&G&&G[m]&&this.set(l,m),this.get(d)=="Macintosh"&&C&&typeof C.standalone!==H&&C.maxTouchPoints&&C.maxTouchPoints>2&&this.set(d,"iPad").set(l,b);break;case P:!this.get(o)&&G&&G[J]&&this.set(o,G[J]);break;case Y:var n=this.data,c=function(a){return n[a].getItem().detectFeature().get()};this.set(T,c(T)).set(O,c(O)).set(R,c(R)).set(L,c(L)).set(P,c(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,c=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 O:var A=n[M];A&&(A&&n[De]=="64"&&(A+="64"),vt.call(this.data,A+";",c));break;case R:if(n[m]&&this.set(l,m),n[d]&&this.set(d,n[d]),n[d]=="Xbox"&&this.set(l,K).set(u,Ue),n[W]){var D;if(typeof n[W]!="string")for(var B=0;!D&&B<n[W].length;)D=Oe(n[W][B++],St);else D=Oe(n[W],St);this.set(l,D)}break;case P:var le=n[J];if(le){var U=n[nt];le==et&&(U=parseInt(Qe(U),10)>=13?"11":"10"),this.set(o,le).set(r,U)}this.get(o)==et&&n[d]=="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(O,ue(O)).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),c=t?Ci(Mt,t):Mt,a=function(h){return h==Y?function(){return new Ct(h,s,c,n).set("ua",s).set(T,this.getBrowser()).set(O,this.getCPU()).set(R,this.getDevice()).set(L,this.getEngine()).set(P,this.getOS()).get()}:function(){return new Ct(h,s,c[h],n).parseUA().get()}};return _.call(this,[["getBrowser",a(T)],["getCPU",a(O)],["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([d,u,l,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(c=>Math.pow(c-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,c)=>(c[n]!==c[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,c=t.length>0?Ti(t):0;return{fpsAvg:e,fpsMax:s,fpsMin:n,fpsStdDev:c}});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 Ui 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:c,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:c,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 c=e.getReport();this.track("FPS Performance",{...c,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(),c=e.getBrowser(),a=e.getDevice(),h=e.getOS();return{browserName:c.name,browserVersion:c.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 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(Oi)}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=Ui;exports.KalambaStargazerTracker=Di;exports.LoggingTracker=Gi;exports.OryxPlugin=Kt;exports.PariplayPlugin=ei;exports.RelaxFEIMPlugin=ti;exports.RgsPlygin=Ot;exports.TelemetryPlugin=Dt;exports.Tracker=at;exports.TukoPlugin=si;
|
package/dist/plugins.d.ts
CHANGED
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 x(i, t) {
|
|
|
19
19
|
console.log(`[%c${i}\x1B[m] %s`, t, e, ...s);
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
function xt(i, t) {
|
|
23
|
-
return Math.round(i * 100 / t);
|
|
24
|
-
}
|
|
25
22
|
class $ {
|
|
26
23
|
constructor(t) {
|
|
27
24
|
w(this, "config");
|
|
@@ -40,8 +37,11 @@ class $ {
|
|
|
40
37
|
});
|
|
41
38
|
}
|
|
42
39
|
}
|
|
40
|
+
function Nt(i, t) {
|
|
41
|
+
return Math.round(i * 100 / t);
|
|
42
|
+
}
|
|
43
43
|
const Ht = x("BasicPlugin", "color:#000000;font-weight:bold;");
|
|
44
|
-
class
|
|
44
|
+
class xi extends $ {
|
|
45
45
|
constructor(...t) {
|
|
46
46
|
super(...t), this.registerToSdkEvents(), this.registerFromSdkEvents(), Ht("configured");
|
|
47
47
|
}
|
|
@@ -55,7 +55,7 @@ class Pi extends $ {
|
|
|
55
55
|
return;
|
|
56
56
|
case "doBalanceUpdate":
|
|
57
57
|
const { currency: n, coinValueInCents: c } = 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: Nt(s.balanceInCurrency, c) }) : (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 = x("▼ DebuggingPlugin IN ▼", "color:#444444;font-weight:bold;"), zt = x("▲ DebuggingPlugin OUT ▲", "color:#444444;font-weight:bold;");
|
|
94
|
-
class
|
|
94
|
+
class Ui extends $ {
|
|
95
95
|
constructor(...t) {
|
|
96
96
|
super(...t), this.registerDebugToSdkEvents(), this.registerSdkToDebugEvents();
|
|
97
97
|
}
|
|
@@ -119,7 +119,7 @@ class xi extends $ {
|
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
const Vt = x("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 Ui extends $ {
|
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
172
|
const qt = x("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 xt(i) {
|
|
256
256
|
try {
|
|
257
257
|
return JSON.parse(i.text);
|
|
258
258
|
} catch {
|
|
@@ -260,16 +260,16 @@ function Ut(i) {
|
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
262
|
function $t(i) {
|
|
263
|
-
return i.map(
|
|
263
|
+
return i.map(xt).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(xt).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 = x("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");
|
|
@@ -521,8 +521,11 @@ class _i extends $ {
|
|
|
521
521
|
});
|
|
522
522
|
}
|
|
523
523
|
}
|
|
524
|
+
function Qt(i, t) {
|
|
525
|
+
return Math.round(i * 100 / t);
|
|
526
|
+
}
|
|
524
527
|
const Ve = x("TukoPlugin", "color:#000000;font-weight:bold;");
|
|
525
|
-
class
|
|
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: c, coinValueInCents: a } = this.config.api;
|
|
550
|
-
n.currency === c && typeof n.balanceInCurrency == "number" ? this.send("balance", { balance:
|
|
553
|
+
n.currency === c && 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, c) => {
|
|
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) && c(h), c(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) && c.seqId === f.body.correlationSeqId && (this.removeEventListener("message", p),
|
|
816
|
+
oe(f) && c.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, c).catch(
|
|
816
819
|
(g) => {
|
|
@@ -824,7 +827,7 @@ class ti extends Qt {
|
|
|
824
827
|
}
|
|
825
828
|
}
|
|
826
829
|
Z = new WeakMap(), ye = new WeakMap();
|
|
827
|
-
class
|
|
830
|
+
class si {
|
|
828
831
|
constructor(t) {
|
|
829
832
|
w(this, "config");
|
|
830
833
|
this.config = t;
|
|
@@ -842,7 +845,7 @@ class ii {
|
|
|
842
845
|
});
|
|
843
846
|
}
|
|
844
847
|
}
|
|
845
|
-
const
|
|
848
|
+
const ni = {
|
|
846
849
|
bul: "bg",
|
|
847
850
|
chi: "zh",
|
|
848
851
|
zho: "zh",
|
|
@@ -874,9 +877,9 @@ const si = {
|
|
|
874
877
|
tur: "tr",
|
|
875
878
|
ukr: "uk",
|
|
876
879
|
vie: "vi"
|
|
877
|
-
},
|
|
880
|
+
}, ai = x("KalambaBullseyePlugin", "color:#000000;font-weight:bold;");
|
|
878
881
|
var Ee;
|
|
879
|
-
class
|
|
882
|
+
class Bi extends si {
|
|
880
883
|
constructor(...e) {
|
|
881
884
|
super(...e);
|
|
882
885
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -904,14 +907,14 @@ class Di extends ii {
|
|
|
904
907
|
}), this.registerFromSdkEvents();
|
|
905
908
|
}
|
|
906
909
|
initialize(e) {
|
|
907
|
-
this.socket = new
|
|
910
|
+
this.socket = new ii(e, {
|
|
908
911
|
gameVersion: y(this, Ee),
|
|
909
912
|
requestTimeoutMs: this.config.ui.requestTimeoutMs
|
|
910
913
|
}), this.socket.addEventListener("close", (s) => {
|
|
911
914
|
s.code === 1006 && this.reconnect(e);
|
|
912
915
|
}), document.addEventListener("visibilitychange", () => {
|
|
913
916
|
document.visibilityState === "visible" && this.socket.socket && this.socket.socket.readyState !== WebSocket.OPEN && this.reconnect(e);
|
|
914
|
-
}), this.socket.addEventListener("error", (s) =>
|
|
917
|
+
}), this.socket.addEventListener("error", (s) => ai("error", s)), this.socket.addEventListener("realityCheck", (s) => {
|
|
915
918
|
this.send("realityCheck", s);
|
|
916
919
|
});
|
|
917
920
|
}
|
|
@@ -940,7 +943,7 @@ class Di extends ii {
|
|
|
940
943
|
cashierUrl: D
|
|
941
944
|
};
|
|
942
945
|
const U = e.get("languageCode");
|
|
943
|
-
return U && (this.config.ui.language = U.length === 3 ?
|
|
946
|
+
return U && (this.config.ui.language = U.length === 3 ? ni[U] ?? U : U), le;
|
|
944
947
|
}
|
|
945
948
|
// TODO: redefine PlayResponse type
|
|
946
949
|
play(e) {
|
|
@@ -966,7 +969,7 @@ class Di extends ii {
|
|
|
966
969
|
}
|
|
967
970
|
}
|
|
968
971
|
Ee = new WeakMap();
|
|
969
|
-
var
|
|
972
|
+
var oi = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce = "object", Je = "string", fe = "major", d = "model", o = "name", l = "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 + "-" + d, Ut = V + "-" + J, pi = Ut + "-version", Ot = [it, st, m, d, 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", Ue = "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) {
|
|
970
973
|
var e = {};
|
|
971
974
|
for (var s in i)
|
|
972
975
|
e[s] = t[s] && t[s].length % 2 === 0 ? t[s].concat(i[s]) : i[s];
|
|
@@ -1846,7 +1849,7 @@ var ai = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
|
|
|
1846
1849
|
/windows.+ edge\/([\w\.]+)/i
|
|
1847
1850
|
// EdgeHTML
|
|
1848
1851
|
],
|
|
1849
|
-
[r, [o,
|
|
1852
|
+
[r, [o, gi + "HTML"]],
|
|
1850
1853
|
[
|
|
1851
1854
|
/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i
|
|
1852
1855
|
// Blink
|
|
@@ -2030,7 +2033,7 @@ var ai = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
|
|
|
2030
2033
|
[L, [o, r]],
|
|
2031
2034
|
[R, [o, r]]
|
|
2032
2035
|
]), i;
|
|
2033
|
-
}(),
|
|
2036
|
+
}(), fi = function(i, t) {
|
|
2034
2037
|
var e = Pe.init[t], s = Pe.isIgnore[t] || 0, n = Pe.isIgnoreRgx[t] || 0, c = Pe.toString[t] || 0;
|
|
2035
2038
|
function a() {
|
|
2036
2039
|
_.call(this, e);
|
|
@@ -2038,8 +2041,8 @@ var ai = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
|
|
|
2038
2041
|
return a.prototype.getItem = function() {
|
|
2039
2042
|
return i;
|
|
2040
2043
|
}, a.prototype.withClientHints = function() {
|
|
2041
|
-
return G ? G.getHighEntropyValues(
|
|
2042
|
-
return i.setCH(new
|
|
2044
|
+
return G ? G.getHighEntropyValues(Ot).then(function(h) {
|
|
2045
|
+
return i.setCH(new Lt(h, !1)).parseCH().get();
|
|
2043
2046
|
}) : i.parseCH().get();
|
|
2044
2047
|
}, a.prototype.withFeatureCheck = function() {
|
|
2045
2048
|
return i.detectFeature().get();
|
|
@@ -2072,18 +2075,18 @@ var ai = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
|
|
|
2072
2075
|
return h(f), f;
|
|
2073
2076
|
}), new a();
|
|
2074
2077
|
};
|
|
2075
|
-
function
|
|
2076
|
-
if (i = i || {}, _.call(this,
|
|
2078
|
+
function Lt(i, t) {
|
|
2079
|
+
if (i = i || {}, _.call(this, Ot), t)
|
|
2077
2080
|
_.call(this, [
|
|
2078
2081
|
[it, je(i[V])],
|
|
2079
|
-
[st, je(i[
|
|
2080
|
-
[m, /\?1/.test(i[
|
|
2081
|
-
[d, me(i[
|
|
2082
|
-
[J, me(i[
|
|
2083
|
-
[nt, me(i[
|
|
2084
|
-
[M, me(i[
|
|
2085
|
-
[q, je(i[
|
|
2086
|
-
[De, me(i[
|
|
2082
|
+
[st, je(i[ri])],
|
|
2083
|
+
[m, /\?1/.test(i[ui])],
|
|
2084
|
+
[d, me(i[hi])],
|
|
2085
|
+
[J, me(i[Ut])],
|
|
2086
|
+
[nt, me(i[pi])],
|
|
2087
|
+
[M, me(i[ci])],
|
|
2088
|
+
[q, je(i[li])],
|
|
2089
|
+
[De, me(i[di])]
|
|
2087
2090
|
]);
|
|
2088
2091
|
else
|
|
2089
2092
|
for (var e in i)
|
|
@@ -2152,8 +2155,8 @@ function Mt(i, t, e, s) {
|
|
|
2152
2155
|
this.get(o) == et && n[d] == "Xbox" && this.set(o, "Xbox").set(r, void 0);
|
|
2153
2156
|
break;
|
|
2154
2157
|
case Y:
|
|
2155
|
-
var
|
|
2156
|
-
return Dt
|
|
2158
|
+
var Ft = this.data, ue = function(Dt) {
|
|
2159
|
+
return Ft[Dt].getItem().setCH(n).parseCH().get();
|
|
2157
2160
|
};
|
|
2158
2161
|
this.set(T, ue(T)).set(O, ue(O)).set(P, ue(P)).set(L, ue(L)).set(R, ue(R));
|
|
2159
2162
|
}
|
|
@@ -2163,7 +2166,7 @@ function Mt(i, t, e, s) {
|
|
|
2163
2166
|
["ua", t],
|
|
2164
2167
|
["uaCH", s],
|
|
2165
2168
|
["rgxMap", e],
|
|
2166
|
-
["data",
|
|
2169
|
+
["data", fi(this, i)]
|
|
2167
2170
|
]), this;
|
|
2168
2171
|
}
|
|
2169
2172
|
function F(i, t, e) {
|
|
@@ -2178,7 +2181,7 @@ function F(i, t, e) {
|
|
|
2178
2181
|
re
|
|
2179
2182
|
)
|
|
2180
2183
|
)
|
|
2181
|
-
), n = new
|
|
2184
|
+
), n = new Lt(e, !0), c = t ? mi(St, t) : St, a = function(h) {
|
|
2182
2185
|
return h == Y ? function() {
|
|
2183
2186
|
return new Mt(h, s, c, 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();
|
|
2184
2187
|
} : function() {
|
|
@@ -2200,12 +2203,12 @@ function F(i, t, e) {
|
|
|
2200
2203
|
}]
|
|
2201
2204
|
]).setUA(s), this;
|
|
2202
2205
|
}
|
|
2203
|
-
F.VERSION =
|
|
2206
|
+
F.VERSION = oi;
|
|
2204
2207
|
F.BROWSER = Be([o, r, fe]);
|
|
2205
2208
|
F.CPU = Be([M]);
|
|
2206
2209
|
F.DEVICE = Be([d, u, l, K, m, I, b, X, Ye]);
|
|
2207
2210
|
F.ENGINE = F.OS = Be([o, r]);
|
|
2208
|
-
class
|
|
2211
|
+
class bi {
|
|
2209
2212
|
constructor(t, e) {
|
|
2210
2213
|
w(this, "trackers");
|
|
2211
2214
|
w(this, "config");
|
|
@@ -2224,7 +2227,7 @@ class fi {
|
|
|
2224
2227
|
function Ct(i) {
|
|
2225
2228
|
return i.reduce((t, e) => t + e, 0);
|
|
2226
2229
|
}
|
|
2227
|
-
function
|
|
2230
|
+
function yi(i) {
|
|
2228
2231
|
const t = i.length, e = Ct(i) / t, s = i.map((c) => Math.pow(c - e, 2)), n = Ct(s) / t;
|
|
2229
2232
|
return Math.sqrt(n);
|
|
2230
2233
|
}
|
|
@@ -2239,7 +2242,7 @@ class It {
|
|
|
2239
2242
|
return this.frames.map((e) => Math.floor((e - this.startTime) / 1e3)).reduce((e, s, n, c) => (c[n] !== c[n - 1] ? e.push(1) : e[e.length - 1]++, e), []).slice(0, t);
|
|
2240
2243
|
});
|
|
2241
2244
|
w(this, "getReport", () => {
|
|
2242
|
-
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, c = t.length > 0 ?
|
|
2245
|
+
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, c = t.length > 0 ? yi(t) : 0;
|
|
2243
2246
|
return { fpsAvg: e, fpsMax: s, fpsMin: n, fpsStdDev: c };
|
|
2244
2247
|
});
|
|
2245
2248
|
w(this, "start", () => {
|
|
@@ -2253,8 +2256,8 @@ class It {
|
|
|
2253
2256
|
});
|
|
2254
2257
|
}
|
|
2255
2258
|
}
|
|
2256
|
-
const
|
|
2257
|
-
function
|
|
2259
|
+
const Ei = "landscape", vi = "portrait";
|
|
2260
|
+
function ki() {
|
|
2258
2261
|
try {
|
|
2259
2262
|
const i = document.createElement("canvas");
|
|
2260
2263
|
return !!window.WebGLRenderingContext && (i.getContext("webgl") || i.getContext("experimental-webgl")) instanceof WebGLRenderingContext;
|
|
@@ -2262,7 +2265,7 @@ function vi() {
|
|
|
2262
2265
|
return !1;
|
|
2263
2266
|
}
|
|
2264
2267
|
}
|
|
2265
|
-
async function
|
|
2268
|
+
async function Si() {
|
|
2266
2269
|
if (!window.createImageBitmap)
|
|
2267
2270
|
return !1;
|
|
2268
2271
|
const e = await (await fetch("data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoCAAEAAQAcJaQAA3AA/v3AgAA=")).blob();
|
|
@@ -2273,10 +2276,10 @@ async function ki() {
|
|
|
2273
2276
|
}
|
|
2274
2277
|
}
|
|
2275
2278
|
function Xe() {
|
|
2276
|
-
return window.innerWidth >= window.innerHeight ?
|
|
2279
|
+
return window.innerWidth >= window.innerHeight ? Ei : vi;
|
|
2277
2280
|
}
|
|
2278
2281
|
var Le, ee, te, ie, ve, _e, ke, Fe;
|
|
2279
|
-
class
|
|
2282
|
+
class Gi extends bi {
|
|
2280
2283
|
constructor(...e) {
|
|
2281
2284
|
super(...e);
|
|
2282
2285
|
w(this, "FPS_SAMPLE_INTERVAL", 1e4);
|
|
@@ -2409,7 +2412,7 @@ class Bi extends fi {
|
|
|
2409
2412
|
}
|
|
2410
2413
|
async deviceInfo() {
|
|
2411
2414
|
var p;
|
|
2412
|
-
const e = new F(navigator.userAgent), s =
|
|
2415
|
+
const e = new F(navigator.userAgent), s = ki(), n = await Si(), c = e.getBrowser(), a = e.getDevice(), h = e.getOS();
|
|
2413
2416
|
return {
|
|
2414
2417
|
browserName: c.name,
|
|
2415
2418
|
browserVersion: c.version,
|
|
@@ -2436,35 +2439,35 @@ class Bi extends fi {
|
|
|
2436
2439
|
}
|
|
2437
2440
|
Le = new WeakMap(), ee = new WeakMap(), te = new WeakMap(), ie = new WeakMap(), ve = new WeakMap(), _e = new WeakMap(), ke = new WeakMap(), Fe = new WeakMap();
|
|
2438
2441
|
let xe;
|
|
2439
|
-
const
|
|
2440
|
-
function
|
|
2442
|
+
const Mi = new Uint8Array(16);
|
|
2443
|
+
function Ci() {
|
|
2441
2444
|
if (!xe && (xe = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !xe))
|
|
2442
2445
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
2443
|
-
return xe(
|
|
2446
|
+
return xe(Mi);
|
|
2444
2447
|
}
|
|
2445
2448
|
const S = [];
|
|
2446
2449
|
for (let i = 0; i < 256; ++i)
|
|
2447
2450
|
S.push((i + 256).toString(16).slice(1));
|
|
2448
|
-
function
|
|
2451
|
+
function Ii(i, t = 0) {
|
|
2449
2452
|
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]];
|
|
2450
2453
|
}
|
|
2451
|
-
const
|
|
2452
|
-
randomUUID:
|
|
2454
|
+
const Ti = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Tt = {
|
|
2455
|
+
randomUUID: Ti
|
|
2453
2456
|
};
|
|
2454
2457
|
function At(i, t, e) {
|
|
2455
2458
|
if (Tt.randomUUID && !t && !i)
|
|
2456
2459
|
return Tt.randomUUID();
|
|
2457
2460
|
i = i || {};
|
|
2458
|
-
const s = i.random || (i.rng ||
|
|
2461
|
+
const s = i.random || (i.rng || Ci)();
|
|
2459
2462
|
if (s[6] = s[6] & 15 | 64, s[8] = s[8] & 63 | 128, t) {
|
|
2460
2463
|
e = e || 0;
|
|
2461
2464
|
for (let n = 0; n < 16; ++n)
|
|
2462
2465
|
t[e + n] = s[n];
|
|
2463
2466
|
return t;
|
|
2464
2467
|
}
|
|
2465
|
-
return
|
|
2468
|
+
return Ii(s);
|
|
2466
2469
|
}
|
|
2467
|
-
class
|
|
2470
|
+
class _t {
|
|
2468
2471
|
constructor(t) {
|
|
2469
2472
|
w(this, "config");
|
|
2470
2473
|
this.config = t;
|
|
@@ -2472,7 +2475,7 @@ class Ft {
|
|
|
2472
2475
|
}
|
|
2473
2476
|
const Rt = 25, Pt = 1e4;
|
|
2474
2477
|
var se, ne, ae, N, Se;
|
|
2475
|
-
class
|
|
2478
|
+
class Ni extends _t {
|
|
2476
2479
|
constructor(...e) {
|
|
2477
2480
|
super(...e);
|
|
2478
2481
|
v(this, se, "https://europe-west3-stargazer-328808.cloudfunctions.net/collect-events");
|
|
@@ -2531,26 +2534,26 @@ class Gi extends Ft {
|
|
|
2531
2534
|
}
|
|
2532
2535
|
}
|
|
2533
2536
|
se = new WeakMap(), ne = new WeakMap(), ae = new WeakMap(), N = new WeakMap(), Se = new WeakMap();
|
|
2534
|
-
const
|
|
2535
|
-
class
|
|
2537
|
+
const Ai = x("LoggingTracker", "color:#000000;font-weight:bold;");
|
|
2538
|
+
class Hi extends _t {
|
|
2536
2539
|
track(t, e) {
|
|
2537
|
-
|
|
2540
|
+
Ai(`@${this.config.api.user}`, `[${t}]`, e);
|
|
2538
2541
|
}
|
|
2539
2542
|
}
|
|
2540
2543
|
export {
|
|
2541
|
-
|
|
2544
|
+
xi as BasicPlugin,
|
|
2542
2545
|
$ as CasinoPlugin,
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2546
|
+
Ui as DebuggingPlugin,
|
|
2547
|
+
Oi as GigPlugin,
|
|
2548
|
+
Bi as KalambaBullseyePlugin,
|
|
2549
|
+
Gi as KalambaStargazerPlugin,
|
|
2550
|
+
Ni as KalambaStargazerTracker,
|
|
2551
|
+
Hi as LoggingTracker,
|
|
2552
|
+
Li as OryxPlugin,
|
|
2553
|
+
_i as PariplayPlugin,
|
|
2554
|
+
Fi as RelaxFEIMPlugin,
|
|
2555
|
+
si as RgsPlygin,
|
|
2556
|
+
bi as TelemetryPlugin,
|
|
2557
|
+
_t as Tracker,
|
|
2558
|
+
Di as TukoPlugin
|
|
2556
2559
|
};
|
package/dist/wrapper.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kalamba/sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
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",
|