1import{h as X,vi as M,vj as I,vk as R,vl as b,a_ as k,c3 as pe,b2 as h,vm as de,vn as Z,m6 as W,n1 as ye,m8 as Le,lY as $,C as j,G as be,m7 as Ie,mj as se,vo as me,vp as K,vq as Q,bE as Ge,vr as ee,a as ae,vs as te,r9 as oe,ra as D,gy as F,gz as x,vt as le,vu as H}from"./commonChunk.Dhe5lqYh.js";import{aL as he,d as Re,r as G,c as P,w as V,n as Ce}from"../vendors/vendor-stable.B8ub4Ug6.js";import{c as re}from"./1_SubGameChunk.C9u0QbWy.js";import"./vendorChunk.BdsO83GQ.js";import"../vendors/vendor-swiper.T_wbf2QY.js";import"./1_SearchGameChunk.l0ciEGcc.js";import"./0_EntryLoginRegisterChunk.CH23XrmN.js";import"./1_MineChunk.DroyDZEx.js";import"./0_GameMoreCategoryChunk.CPz2DCY2.js";import"./0_RechargeCommonChunk.DSN05vBz.js";import"./1_AgentCenterChunk.PiK7sNsJ.js";import"./1_PromoteChunk.DYukjC1-.js";import"./1_ClubRebateChunk.DA9ie7NK.js";import"./0_WithdrawChunk.DK0bpz1Y.js";import"./1_SearchSubGameChunk.Bufcaiz0.js";const{t:v}=X(),Te={[b.Road]:[{type:R.None,title:()=>v("lobby.real_game.all")},{type:R.LongBanker,title:()=>v("lobby.real_game.data.longBanker")},{type:R.LongPlayer,title:()=>v("lobby.real_game.data.longPlayer")},{type:R.BigRoadSingleJump,title:()=>v("lobby.real_game.data.bigRoadSingleJump")},{type:R.OneBankerTwoPlayers,title:()=>v("lobby.real_game.data.oneBankerTwoPlayers")},{type:R.OnePlayerTwoBankers,title:()=>v("lobby.real_game.data.onePlayerTwoBankers")},{type:R.LongRoadSingleJump,title:()=>v("lobby.real_game.data.longRoadSingleJump")},{type:R.BankerContinuous,title:()=>v("lobby.real_game.data.bankerContinuous")}],[b.GameType]:[{type:I.Baccarat,title:()=>v("lobby.real_game.casinoGames.baccarat")},{type:I.DragonTiger,title:()=>v("lobby.real_game.casinoGames.dragonTiger")},{type:I.Blackjack,title:()=>v("lobby.real_game.casinoGames.blackjack")},{type:I.Roulette,title:()=>v("lobby.real_game.casinoGames.roulette")},{type:I.Poker,title:()=>v("lobby.real_game.casinoGames.poker")},{type:I.NiuNiu,title:()=>v("lobby.real_game.casinoGames.niuNiu")},{type:I.ZhaJinHua,title:()=>v("lobby.real_game.casinoGames.zhaJinHua")},{type:I.SanGong,title:()=>v("lobby.real_game.casinoGames.sanGong")},{type:I.SicBo,title:()=>v("lobby.real_game.casinoGames.sicBo")},{type:I.Other,title:()=>v("lobby.real_game.casinoGames.other")}],[b.Time]:[{type:M.REGULAR,title:()=>v("lobby.real_game.time.regular")},{type:M.FAST,title:()=>v("lobby.real_game.time.speedy")},{type:M.LIGHTNING,title:()=>v("lobby.real_game.time.lightning")},{type:M.MIPAI,title:()=>v("lobby.real_game.time.miPai")}],[b.RealCasino]:[]},C=-1,_e=1e3*60,Pe=317,Se=341,ue=311,we=["S","XL","L","M"],ce=(e,l,m)=>{const a=k(),t=new Map;return l||(l=pe().currency),e.reduce((i,n)=>{var g,u,s;if(n.currenyConfig=n.currenyConfigList.find(f=>f.currency===l),!n.currenyConfig||!n.currenyConfig.isOpenGame)return i;let c;return t.has(n.platformId)?c=t.get(n.platformId):(c=a.getPlatformInfoByCategory(h.Real,n.platformId),t.set(n.platformId,c)),n.maintainStatus=(c==null?void 0:c.maintainStatus)||((g=n.currenyConfig)==null?void 0:g.maintainStatus),n.platformLogo=(u=c==null?void 0:c.platformLogo)!=null?u:"",n.platformName=(s=c==null?void 0:c.platformName)!=null?s:"",i.push(n),i},[])},U=(e,l,m=!1)=>{const a=new de;a.gameId=e.gameId,a.platformId=e.platformId,a.platformName=e.platformName,a.platformLogo=e.platformLogo,a.gameType=e.gameType,a.maintainStatus=e.maintainStatus,a.imgBackgroundColor=Z(e);const t=e.hotImgBackgroundColor;t&&(a.hotImgBackgroundColor=Z({imgBackgroundColor:t}));const i=e.isCustomThemeUpload||e.gameType===W.Platform&&m;a.isCustomThemeUpload=i,a.isOriginData=!1;let n="";
1const c=i&&l,g=s=>c?{...s,customAnySize:l}:e.isCustomIcon?{...s,isOriginImg:!0}:s,u=c?{}:{imgCategory:ye.MaterialBackground};if(e.gameType===W.Platform){const s=g({layoutPlatformCode:Le.LeftRight1,...u});if($.isThisType(e))n=j.parsePlatformItem(e,s);else{const f=new $().parseGameItem(e);n=j.parsePlatformItem(f,s)}}else be.isThisType(e)&&(n=j.parseGameItem(e,g({layoutGameCode:Ie.Horizontal,...u})));return a.liveThumbnail={S:n,XL:n,L:n,M:n},a},ie=e=>Object.fromEntries(we.map(l=>[l,e])),J=(e,l)=>l===Se?e.map(m=>({...m,liveThumbnail:ie(`/lobby_asset/common/common/game/live/img_cover_${m.gameId}.png`)})):l===ue?e.map(m=>{var a;return{...m,liveThumbnail:ie(((a=m.liveThumbnail)==null?void 0:a.L)||"")}}):e,ne=async(e,l,m=!1)=>{const a=k();m||await a.fetchGameCategorieAndExtLinkList(),m||a.getCategoriesIsOpen(h.Real)?(e.value=await se.getRealLivePlatform(),l.value=C):e.value=[]},q=async(e,l,m)=>{const a=[],t=k().getCategoriesPlatformList(h.Real);for(const i of e){if(i.isOriginData){const c=await l(i.platformId);a.push(...c);continue}const n=t.find(c=>c.platformId===i.platformId);n&&a.push(U(n,m))}return a},N=async(e,l,m=[],a)=>{const t=k(),i=t.getPlatformInfoByCategory(h.Real,e);if(l){if(e===C)return q(m,u=>N(u,!0,[],a),a);const n=J(ce(await se.getLiveVideo(e)),e);i!=null&&i.isSupportSubPage&&await t.fetchPlatformGameList({gameCategoryId:h.Real,platformId:e});const c=re({gameCategoryId:h.Real,platformId:e,activeSceneTab:0,gameName:""}).map(u=>U(u,a,i==null?void 0:i.isCustomThemeUpload)),g=new Map(c.map(u=>[u.gameId,u]));for(const u of n){const{liveThumbnail:s}=u;if(!s.S&&!s.XL&&!s.L&&!s.M){const f=g.get(u.gameId);f&&(u.liveThumbnail=f.liveThumbnail)}}return n}return i!=null&&i.isSupportSubPage&&await t.fetchPlatformGameList({gameCategoryId:h.Real,platformId:e}),re({gameCategoryId:h.Real,platformId:e,activeSceneTab:0,gameName:""}).map(n=>U(n,a,i==null?void 0:i.isCustomThemeUpload))},B=e=>(l,m)=>{const a=l.currenyConfig,t=m.currenyConfig;return!a||!t?0:e===me.Min?a.minBet-t.minBet:t.maxBet-a.maxBet},Ee=({gameList:e,currentFilterType:l,currentSubFilterType:m,sortType:a})=>l===b.Road?m===R.None?[...e].sort(B(a)):[...e].filter(t=>t.goodRoadType===m).sort(B(a)):l===b.GameType?[...e].filter(t=>t.casinoType===m).sort(B(a)):l===b.Time?[...e].filter(t=>t.cardRevealDuration===m).sort(B(a)):[...e].sort(B(a)),Be=e=>{const{t:l}=X();return[{type:b.Road,name:l("lobby.real_game.type.goodRoadSelection"),show:e},{type:b.GameType,name:l("lobby.real_game.type.gameCategory"),show:!0},{type:b.Time,name:l("lobby.real_game.type.cardOpeningDuration"),show:!0},{type:b.RealCasino,name:l("lobby.real_game.type.realCasino"),show:!1}].filter(m=>m.show)},ke=e=>{const{t:l}=X(),m=k(),a=new K;if(a.platformId=C,a.roadFilterSwitch=!0,a.platformName=l("lobby.real_game.allBrand"),!m.getCategoriesIsOpen(h.Real))return[a];const t=he(m.getCategoriesPlatformList(h.Real),"platformId"),i=new Map,c=t.map(g=>{const u=e.findIndex(f=>f.platformId===g.platformId);if(u!==-1){const f=e[u];return f.platformName=g.platformName,f.platformLogo=g.platformLogo,g.platformId===Pe&&i.set(f.platformId,e.length-u+1),f}const s=new K;return s.gameId=g.gameId,s.platformName=g.platformName,s.platformLogo=g.platformLogo,s.platformId=g.platformId,s.gameCategoryId=g.gameCategoryId,s.isOriginData=!1,s}).sort((g,u)=>{const s=i.get(g.platformId)||0;return(i.get(u.platformId)||0)-s});return[a,...c]},Ke=Re("real-live-game",()=>{const e=G(),l=G([]),m=G(),a=G(),t=G(),i=G(),n=G(),c=G(me.Min),g=G(Q.Novice),u=G(),s=P(()=>e.value===void 0?[]:ke(e.value)),f=P(()=>s.value.some(o=>o.platformId===t.value&&o.isOriginData)),ge=P(()=>s.value.some(o=>o.isOriginData&&o.platformId!==-1)),_=P(()=>{const o=s.value.find(r=>r.platformId===t.value);return o?f.value?Be(o.roadFilterSwitch):[]:[]}),A=P(()=>{var r;if(!i.value||_.value.length===0)return[];const o=(r=Te[i.value])!=null?r:[];return i.value===b.GameType&&t.value!==ue?o.filter(p=>p.type!==I.Other):o}),ve=P(()=>{var o,r;return f.value?Ee({gameList:l.value,currentFilterType:i.value,currentSubFilterType:g.value===Q.Novice?(r=(o=A.value)==null?void 0:o[0])==null?void 0:r.type:n.value,sortType:c.value}):l.value});V(_,()=>{var o,r;_.value.find(p=>p.type===i.value)||(i.value=(r=(o=_.value)==null?void 0:o[0])==null?void 0:r.type)}),V(i,()=>{var o,r;n.value=(r=(o=A.value)==null?void 0:o[0])==null?void 0:r.type}),V(t,()=>{var o,r;S(),i.value=(r=(o=_.value)==null?void 0:o[0])==null?void 0:r.type,Ce(()=>{var p,y;return n.value=(y=(p=A.value)==null?void 0:p[0])==null?void 0:y.type})}),Ge("LOGIN_SUCCESS",()=>{Y().then(()=>S())});const O=async()=>{const o=m.value,r=t.value;if(o===void 0||r===void 0)return;
1const p=ce(o);return r===C?q(s.value,y=>Promise.resolve(J(p.filter(d=>d.platformId===y),y)),u.value):f.value?J(p.filter(y=>y.platformId===r),r):N(r,!1,s.value,u.value)},z=()=>{var o,r;return!!((o=a.value)!=null&&o.length)&&((r=m.value)==null?void 0:r.length)===0},fe=()=>{var o,r;return D("g8","liveGame")&&a.value!==void 0&&!((o=a.value)!=null&&o.length)&&!!((r=e.value)!=null&&r.length)},S=async()=>{var p,y;if(!ee.includes((p=ae().siteInfos)==null?void 0:p.type))return;if(await te("g8"),le().g8&&H("ossGetAllLiveVideoList")){const d=await O();d!==void 0&&(l.value=d);return}await oe("g8");const o=z(),r=fe();if(D("g8","liveVideo")&&m.value!==void 0&&!o&&!r){const d=await O();d!==void 0&&(l.value=d);return}if(t.value!==void 0){if((o||r)&&t.value===C){const d=s.value.filter(L=>L.platformId!==C);l.value=await q(d.length?d:(y=a.value)!=null?y:[],L=>N(L,!0,[],u.value),u.value);return}l.value=await N(t.value,f.value,s.value,u.value)}},Y=async()=>{var d,L,w,E,T;if(!ee.includes((d=ae().siteInfos)==null?void 0:d.type))return;await te("g8");const o=le().g8,r=o&&H("ossGetLiveGame"),p=o&&H("ossGetAllLiveVideoList");if(r&&p){a.value!==void 0&&(e.value=a.value,(L=t.value)!=null||(t.value=C));return}await oe("g8");const y=r&&!p||z();if(y&&((w=a.value)!=null&&w.length)){e.value=a.value,(E=t.value)!=null||(t.value=C);return}if(D("g8","liveGame")&&a.value!==void 0&&!((T=e.value)!=null&&T.length))return ne(e,t,!0);if(!(D("g8","liveGame")&&a.value!==void 0&&!y))return ne(e,t)};return{realLivePlatformList:e,mergedRealPlatformList:s,currentPlatformId:t,filterTypeList:_,currentFilterType:i,currentSubFilterType:n,subFilterTypeList:A,realLiveGameList:l,filterRealLiveGameList:ve,amountSortType:c,filterMode:g,hasOriginRealPlatform:ge,customAnySize:u,setInjectedRealLiveData:async({platforms:o,games:r,categoryOpen:p,isLatest:y=()=>!0})=>{var w,E;if(!y())return;const d=(o==null?void 0:o.length)===0&&r===void 0&&!!((w=a.value)!=null&&w.length);o!==void 0&&!d&&(a.value=o),r!==void 0&&(m.value=r);const L=d?a.value:o;if(!p&&!(L!=null&&L.length)){e.value=[],l.value=[];return}if(L!==void 0&&(e.value=L,(E=t.value)!=null||(t.value=C)),d&&S().catch(T=>{console.warn("[real-live-game] fallback liveVideo request failed:",T)}),r!==void 0){const T=await O();y()&&T!==void 0&&(l.value=T)}},fetchRealLiveGameList:S,fetchAllRealLivePlatform:Y,createPolling:()=>F.create({key:x.REAL_LIVE_GAME,pollingHandler:S,immediate:!0,interval:_e}),pausePolling:()=>F.pause(x.REAL_LIVE_GAME),recoverPolling:()=>F.recover(x.REAL_LIVE_GAME)}},{persist:{paths:["filterMode"]}});export{Ke as useRealLiveGame};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.