"use strict";(self.webpackChunkbongacams=self.webpackChunkbongacams||[]).push([[679,698,730,560],{73645:function(e,t,n){n.r(t),n.d(t,{addAutoDJTrack:function(){return X},autoDJHitAction:function(){return H},blockHitButtons:function(){return E},closeGame:function(){return ee},closePopup:function(){return W},default:function(){return b},disableAllGames:function(){return Q},hideHelp:function(){return ie},openGame:function(){return $},openPopup:function(){return G},resetGamesState:function(){return B},rollDiceHitAction:function(){return D},setAutoDJPlaying:function(){return x},setAutoDJSettings:function(){return J},setAutoDJShowForm:function(){return U},setAutoDJShowFullPlaylist:function(){return V},setAutoDJTracks:function(){return j},setGameSettings:function(){return A},setGameTab:function(){return T},setHitResult:function(){return Z},setIsImageGameLoaded:function(){return se},setIsLandscape:function(){return ne},setIsTablet:function(){return oe},setLastTipMenuOrder:function(){return F},setPerformerStatus:function(){return re},setRollTheDiceType:function(){return L},setShowHelp:function(){return te},setSlotMachineRate:function(){return M},setSlotMachineShowPrizes:function(){return R},setSpinWheelShowPrizes:function(){return z},setTipMenuPopupOpenSource:function(){return q},setTokenKenoPrizeAmount:function(){return O},setTokenKenoSelectedAmount:function(){return N},setTokenKenoShowPrizes:function(){return K},setTokenKenoSuggestingAmount:function(){return I},showHelp:function(){return ae},skipAutoDJTrack:function(){return Y},slotMachineHitAction:function(){return k},spinWheelHitAction:function(){return y},tokenKenoHitAction:function(){return w},unblockHitButtons:function(){return P}});var o=n(15215),i=n(98614),a=n(96998),r=n(13907),s=n(62340),u=n(4645),l=n(19826),c=n(41669);function m(e,t){var n,i=t.extraData,a=void 0===i?{}:i,r=t.onSuccess,s=void 0===r?function(e){}:r,m=t.onError,f=void 0===m?function(e){}:m;(null===(n=l.A.getState().chatSocket)||void 0===n?void 0:n.connected)&&c.ajax({type:"post",url:e.route,data:(0,u.Z)((0,o.Cl)({username:chat.performerData.username},a)),success:function(e){"Success"!==e.status?f(__(e.msg)):s(e.data)},error:function(e,t){f(__("Network error")+": "+t)}})}var f,p=n(79476),d=n(37828),h=n(28975),g=n(26616),v=n(41669),_=[],C=function(e){return{setGameTab:function(e,t){if(e.currentTab!==t)return{currentTab:t,hitResult:null}},setGameSettings:function(e,t,n){var i,a=s.Xq[t];if(!a)return e;var r=a.storeKey;return(0,o.Cl)((0,o.Cl)({},e),{gamesSettings:(0,o.Cl)((0,o.Cl)({},e.gamesSettings),(i={},i[r]=(0,o.Cl)((0,o.Cl)({},e.gamesSettings[r]),n),i))})},rollDiceHitAction:function(e,t,n,o){void 0===o&&(o=g.noop),m(t,{extraData:{type:e.gamesData[t.storeKey].type},onError:o})},spinWheelHitAction:function(e,t,n,o){void 0===o&&(o=g.noop),m(t,{onError:o})},tokenKenoHitAction:function(e,t,n,o){void 0===o&&(o=g.noop);var i=e.gamesData[t.storeKey],a=i.selectedAmount,r=i.suggestingAmount;m(t,{extraData:{amount:a||r},onError:o})},slotMachineHitAction:function(e,t,n,o){void 0===o&&(o=g.noop),m(t,{extraData:{rate:e.gamesData[t.storeKey].rate},onError:o})},setSlotMachineRate:function(e,t){var n=s.Xq["slot-machine"].storeKey,i=(0,h.A)(e.gamesData);if(t||(t=e.gamesData[n].rate),e.gamesSettings[n].no_lose&&t>2&&(t=2),i[n].rate!==t)return i[n].rate=+t,(0,o.Cl)((0,o.Cl)({},e),{gamesData:i})},autoDJHitAction:function(e,t,n,o){void 0===o&&(o=g.noop),v.ajax({data:(0,u.Z)(n),dataType:"json",error:function(){o(a.Rb)},success:function(t){if("success"!==t.status){var n=t.msg;switch(t.msg){case"bot disabled":n=__("Game disabled");break;case"incorrect track":n=__("Only videos that fall under the Music category can be added to the playlist.");break;case"Invalid url, track not found":n=__("Video not found.");break;case"too large":n="".concat(__("The video you would like to add doesn't fit the criteria set by the model.")," ").concat(__("Maximum video length: %minutes% min",{minutes:Math.round(e.gamesSettings[s.Xq["auto-dj"].storeKey].max_length/60)}));break;case"track is unavailable":n="".concat(__("The video you would like to add doesn't fit the criteria set by the model.")," ").concat(__("Video must have more likes than dislikes on YouTube."));break;case"track locked":n="".concat(__("The video you would like to add doesn't fit the criteria set by the model.")," ").concat(__("This video is on the model’s blacklist."));break;case"Video not embeddable":n=__("The video owner has blocked embedding on third party websites.");break;default:n=t.msg}o(n)}},type:"post",url:(0,r.ip)("@chat_bot_auto_dj_add_track?username=".concat(chat.currentChathost))})},blockHitButtons:function(e){return f=setTimeout((function(){return P()}),1e3*s._6),(0,o.Cl)((0,o.Cl)({},e),{pendingHitResult:!0})},unblockHitButtons:function(e){return clearInterval(f),(0,o.Cl)((0,o.Cl)({},e),{pendingHitResult:!1})},setTokenKenoSelectedAmount:function(e,t){var n=(0,h.A)(e.gamesData);return n[s.Xq["token-keno"].storeKey].selectedAmount=t,(0,o.Cl)((0,o.Cl)({},e),{gamesData:n})},setTokenKenoSuggestingAmount:function(e){for(var t,n=s.Xq["token-keno"].storeKey,i=e.gamesSettings[n],a=e.gamesData[n].selectedAmount||null,r=null,u=!1,l=function(e){if(!i.prizes.some((function(t){return t.amount&&t.amount===e})))return r=e,"break"},c=i.min_amount;c<=i.max_amount;c++){if("break"===l(c))break}return null===r&&(r=i.min_amount,u=!0),null!==a&&(ai.max_amount)&&(a=null),v('button.js-game-control[data-id="'.concat("token-keno",'"][data-action="confirm"]')).attr("data-value",r),(0,o.Cl)((0,o.Cl)({},e),{gamesData:(0,o.Cl)((0,o.Cl)({},e.gamesData),(t={},t[n]=(0,o.Cl)((0,o.Cl)({},e.gamesData[n]),{selectedAmount:a,suggestingAmount:r,waitingSettings:u}),t))})},setTokenKenoPrizeAmount:function(e,t){var n,i,a=t.game,r=a.amount,u=a.result,l=a.sv,c=s.Xq["token-keno"].storeKey,m=(0,h.A)(e.gamesSettings[c]),f=(0,h.A)(e.gamesData[c]);return m.sv===l&&(m.prizes.some((function(e){return e.hash}))?m.prizes.find((function(e){return Number(e.hash)===Number(u.info.value)})).amount=r:m.prizes[Number(u.info.value)].amount=r,f.selectedAmount===r&&(f.selectedAmount=null)),(0,o.Cl)((0,o.Cl)({},e),{gamesData:(0,o.Cl)((0,o.Cl)({},e.gamesData),(n={},n[c]=f,n)),gamesSettings:(0,o.Cl)((0,o.Cl)({},e.gamesSettings),(i={},i[c]=m,i))})},setTokenKenoShowPrizes:function(e,t){var n,i=s.Xq["token-keno"].storeKey;return(0,o.Cl)((0,o.Cl)({},e),{gamesData:(0,o.Cl)((0,o.Cl)({},e.gamesData),(n={},n[i]=(0,o.Cl)((0,o.Cl)({},e.gamesData[i]),{showPrizes:t}),n))})},setSpinWheelShowPrizes:function(e,t){var n,i=s.Xq["spin-wheel"].storeKey;return(0,o.Cl)((0,o.Cl)({},e),{gamesData:(0,o.Cl)((0,o.Cl)({},e.gamesData),(n={},n[i]=(0,o.Cl)((0,o.Cl)({},e.gamesData[i]),{showPrizes:t}),n))})},setSlotMachineShowPrizes:function(e,t){var n,i=s.Xq["slot-machine"].storeKey;return(0,o.Cl)((0,o.Cl)({},e),{gamesData:(0,o.Cl)((0,o.Cl)({},e.gamesData),(n={},n[i]=(0,o.Cl)((0,o.Cl)({},e.gamesData[i]),{showPrizes:t}),n))})},setRollTheDiceType:function(e,t){var n=(0,h.A)(e.gamesData);return n[s.Xq["roll-dice"].storeKey].type=t,(0,o.Cl)((0,o.Cl)({},e),{gamesData:n})},openPopup:function(e,t,n,i){return void 0===n&&(n={}),void 0===i&&(i=null),e.popup.opened&&_.push(e.popup),(0,o.Cl)((0,o.Cl)({},e),{popup:{component:t,componentProps:i,opened:!0,options:n}})},closePopup:function(e){if(e.popup.opened)return(0,o.Cl)((0,o.Cl)({},e),{popup:_.length?_.pop():{component:null,componentProps:null,opened:!1,options:{}}})},resetGamesState:function(e){return(0,o.Cl)((0,o.Cl)({},p.A),{gamesData:(0,o.Cl)((0,o.Cl)({},p.A.gamesData),{tipMenu:(0,o.Cl)({},e.gamesData.tipMenu)})})},setGameEnabled:function(e,t,n){var i,a=s.Xq[t].storeKey;return(0,o.Cl)((0,o.Cl)({},e),{gamesSettings:(0,o.Cl)((0,o.Cl)({},e.gamesSettings),(i={},i[a]=(0,o.Cl)((0,o.Cl)({},e.gamesSettings[a]),{enabled:n}),i))})},setAutoDJTracks:function(e,t){var n,i,a=s.Xq["auto-dj"].storeKey;return(0,o.Cl)((0,o.Cl)({},e),{gamesData:(0,o.Cl)((0,o.Cl)({},e.gamesData),(n={},n[a]=(0,o.Cl)((0,o.Cl)({},e.gamesData[a]),{lastActionTS:Date.now(),lastOffsetMs:t.length&&1e3*t[0].offset||0}),n)),gamesSettings:(0,o.Cl)((0,o.Cl)({},e.gamesSettings),(i={},i[a]=(0,o.Cl)((0,o.Cl)({},e.gamesSettings[a]),{playlist:t}),i))})},setLastTipMenuOrder:function(e,t){var n,i=s.Xq["tip-menu"].storeKey;return(0,o.Cl)((0,o.Cl)({},e),{gamesData:(0,o.Cl)((0,o.Cl)({},e.gamesData),(n={},n[i]=(0,o.Cl)((0,o.Cl)({},e.gamesData[i]),{lastOrderHash:t}),n))})},setTipMenuPopupOpenSource:function(e,t){var n,i=s.Xq["tip-menu"].storeKey;return(0,o.Cl)((0,o.Cl)({},e),{gamesData:(0,o.Cl)((0,o.Cl)({},e.gamesData),(n={},n[i]=(0,o.Cl)((0,o.Cl)({},e.gamesData[i]),{popupOpenSource:t}),n))})},addAutoDJTrack:function(e,t,n){var i,a,r=s.Xq["auto-dj"].storeKey,u=e.gamesSettings[r],l=(0,o.fX)([],u.playlist,!0);return l.splice(t,0,n),(0,o.Cl)((0,o.Cl)({},e),{gamesData:(0,o.Cl)((0,o.Cl)({},e.gamesData),(i={},i[r]=(0,o.Cl)((0,o.Cl)({},e.gamesData[r]),0===t?{lastActionTS:Date.now(),lastOffsetMs:1e3*n.offset}:{}),i)),gamesSettings:(0,o.Cl)((0,o.Cl)({},e.gamesSettings),(a={},a[r]=(0,o.Cl)((0,o.Cl)({},e.gamesSettings[r]),{playlist:l}),a))})},setAutoDJPlaying:function(e,t){var n,i,a=s.Xq["auto-dj"].storeKey,r=e.gamesSettings[a],u=e.gamesData[a];return(0,o.Cl)((0,o.Cl)({},e),{gamesData:(0,o.Cl)((0,o.Cl)({},e.gamesData),(n={},n[a]=(0,o.Cl)((0,o.Cl)({},u),{lastActionTS:Date.now(),lastOffsetMs:u.lastOffsetMs+(r.playing?Date.now()-u.lastActionTS:0)}),n)),gamesSettings:(0,o.Cl)((0,o.Cl)({},e.gamesSettings),(i={},i[a]=(0,o.Cl)((0,o.Cl)({},r),{playing:t}),i))})},skipAutoDJTrack:function(e,t){var n=(0,h.A)(e),o=s.Xq["auto-dj"].storeKey,i=!1,a=e.gamesSettings[o].playlist;return a&&a[0]&&a[0].id===t&&(i=!0),a=a.filter((function(e){return e.id!==t})),n.gamesSettings[o].playlist=a,i&&(n.gamesSettings[o].playing=!1,n.gamesData[o]={lastActionTS:Date.now(),lastOffsetMs:0}),n},setAutoDJSettings:function(e,t){var n,i=s.Xq["auto-dj"].storeKey;return(0,o.Cl)((0,o.Cl)({},e),{gamesSettings:(0,o.Cl)((0,o.Cl)({},e.gamesSettings),(n={},n[i]=(0,o.Cl)((0,o.Cl)({},e.gamesSettings[i]),t),n))})},setAutoDJShowForm:function(e,t){var n;void 0===t&&(t=!0);var i=s.Xq["auto-dj"].storeKey;return(0,o.Cl)((0,o.Cl)({},e),{gamesData:(0,o.Cl)((0,o.Cl)({},e.gamesData),(n={},n[i]=(0,o.Cl)((0,o.Cl)({},e.gamesData[i]),{showForm:t}),n))})},setAutoDJShowFullPlaylist:function(e,t){var n;void 0===t&&(t=!0);var i=s.Xq["auto-dj"].storeKey;return(0,o.Cl)((0,o.Cl)({},e),{gamesData:(0,o.Cl)((0,o.Cl)({},e.gamesData),(n={},n[i]=(0,o.Cl)((0,o.Cl)({},e.gamesData[i]),{showFullPlaylist:t}),n))})},disableAllGames:function(e){return(0,o.Cl)((0,o.Cl)({},e),{gamesSettings:Object.keys(e.gamesSettings).reduce((function(t,n){var i;return(0,o.Cl)((0,o.Cl)({},t),((i={})[n]=(0,o.Cl)((0,o.Cl)({},e.gamesSettings[n]),{enabled:!1}),i))}),{}),hitResult:null,opened:!1})},setHitResult:function(e,t){return{hitResult:t}},openGame:function(e,t){return void 0===t&&(t=null),{currentTab:t,opened:!0,showHelp:!1}},closeGame:function(e){return{currentTab:null,hitResult:null,opened:!1,showHelp:!1}},setShowHelp:function(e,t){if(e.showHelp!==t)return{hitResult:null,showHelp:t}},hideHelp:function(){return{showHelp:!1}},showHelpFn:function(){return{showHelp:!0}},setIsLandscape:function(e,t){if(e.isLandscape!==t)return{isLandscape:t}},setIsTablet:function(e,t){if(e.isTablet!==t)return{isTablet:t}},setPerformerStatus:function(e,t){return{performerStatus:t}},setIsImageGameLoaded:function(){return{isImageGameLoaded:!0}}}},b=C,S=(0,i.i0)(C,d.A),T=S.setGameTab,A=S.setGameSettings,D=S.rollDiceHitAction,y=S.spinWheelHitAction,w=S.tokenKenoHitAction,k=S.slotMachineHitAction,H=S.autoDJHitAction,M=S.setSlotMachineRate,E=S.blockHitButtons,P=S.unblockHitButtons,N=S.setTokenKenoSelectedAmount,I=S.setTokenKenoSuggestingAmount,O=S.setTokenKenoPrizeAmount,K=S.setTokenKenoShowPrizes,z=S.setSpinWheelShowPrizes,R=S.setSlotMachineShowPrizes,L=S.setRollTheDiceType,G=S.openPopup,W=S.closePopup,B=S.resetGamesState,J=S.setAutoDJSettings,j=S.setAutoDJTracks,F=S.setLastTipMenuOrder,q=S.setTipMenuPopupOpenSource,X=S.addAutoDJTrack,x=S.setAutoDJPlaying,Y=S.skipAutoDJTrack,U=S.setAutoDJShowForm,V=S.setAutoDJShowFullPlaylist,Q=S.disableAllGames,Z=S.setHitResult,$=S.openGame,ee=S.closeGame,te=S.setShowHelp,ne=S.setIsLandscape,oe=S.setIsTablet,ie=S.hideHelp,ae=S.showHelpFn,re=S.setPerformerStatus,se=S.setIsImageGameLoaded},46926:function(e,t,n){n.d(t,{K:function(){return i},j:function(){return a}});var o=n(39344),i=(0,o.object)({price:(0,o.number)(),service:(0,o.string)(),hash:(0,o.string)()}),a=100},83910:function(e,t,n){n.d(t,{DO:function(){return u},KZ:function(){return l},Sf:function(){return s},vQ:function(){return c}});var o=n(37828),i=n(64054),a=n(46926),r=n(90286),s=function(e){var t,n,o,i=(null===(t=window.chat.userData)||void 0===t?void 0:t.isRu)?["ru","en"]:["en","ru"],a=i[0],r=i[1];return null===(o=null===(n=e.items)||void 0===n?void 0:n.map((function(e){var t;return{price:e.price,service:null!==(t=e[a])&&void 0!==t?t:e[r],hash:e.hash}})))||void 0===o?void 0:o.filter((function(e){return Boolean(e.service)}))},u=function(){var e=o.A.getState(),t=e.gamesSettings.tipMenu;return t.enabled&&"public"===e.performerStatus?s(t):[]},l=function(e,t){var n=r.S.instance.selectTipMenuItem(e),o=t.scrollHeight-t.offsetHeight>0;if(n&&o){var s={duration:a.j,element:t,top:0},u=n.offsetHeight,l=n.offsetTop-t.scrollTop;if(l0)return s.top=t.scrollTop-(u-l),void(0,i.B)(s);var c=Math.ceil(t.offsetHeight+t.scrollTop)>=t.scrollHeight,m=t.offsetHeight-l-n.offsetHeight;m