1import{t as f,j as t,m as Y,n as _,u as le,S as me,U as de}from"./ThemeProviderV4.BJzwFqdE.js";import{r as c,v as p,x as X,o as L,y as K,a3 as pe,q as ue}from"./vendor.DIHqQuRl.js";import{G as r,S as h,aj as F}from"./util.GzQCO_UI.js";import{f as he}from"./InputFieldWrapper.C_9JfUxC.js";import{A as ge}from"./AutoDestructingStoreProvider.BokMfXlI.js";import{u as fe}from"./useCasinoGameCategoriesQuery.B_beXRSZ.js";import{u as Se}from"./useDebounce.DyL6Pg7p.js";import{a as Z}from"./useMediaQueryV4.BdRFa0h6.js";import{t as N}from"./index.BmuYOVWj.js";import{useModalStore as z}from"./ModalStore.BGz6QLsv.js";import{I as xe}from"./InputFieldV4WithSearch.3nEsMUZq.js";import{S as w}from"./StackV4.fVixnu5O.js";import{T as M}from"./TabsV4.CT9eCxXV.js";import{T as q}from"./TypographyV4.CtNC0Nr7.js";import{S as ye}from"./Store.C9YZ5sdn.js";import{P as Ie,a as ve}from"./PickRandomButtons.C2jEmKPU.js";import{F as Ee}from"./close-remove.icon.CpVY5WO3.js";import{u as Re}from"./index.Ba7GZfAA.js";import{u as Ce}from"./useInfiniteQueryList.jupInPqa.js";import{u as we}from"./useItemsInRowSizes.BSYaCeky.js";import{c as Te}from"./useLikedGames.Bv6VfYWJ.js";import{T as G,a as Ve}from"./siteContentLanguages.CB1TAUaL.js";import{M as _e,N as ke}from"./ProfileStore.DfCZWeMX.js";import{C as J}from"./ContentPlaceholderEmpty.Bm2_lZ2c.js";import{C as ee}from"./ContentPlaceholderError.VXlKTTod.js";import{n as Ae}from"./GamesListV4ItemHeader.Cw1b6rrF.js";import{g as je}from"./e2e.util.DTQoQZoJ.js";import{u as Ge}from"./useGameCheckAndOpenV4.D2QzQCnT.js";import{G as Le}from"./GamesListV4Item.DwfoLKzD.js";import{u as be}from"./useGamesListOriginalGamesSanitizer.DAjY8bkH.js";import{E as te}from"./empty-blog.DJmHd_kT.js";import{F as re}from"./empty-list.icon.CadfAPUY.js";import{S as D}from"./SkeletonV4.DcfA3vUj.js";import{g as Pe}from"./util.BLnzBPYP.js";import{u as Oe}from"./useProvidersBannersQuery.Djbb4IQZ.js";import{P as Ne}from"./ProvidersSectionItem.CDGZ1WxU.js";import{b as qe,a as W}from"./DialogV4.BkFp6o3w.js";import"./Button.81SqSNQ8.js";import"./useStore.D2uWV0r0.js";import"./useIsFeatureEnabled.RtsyWXyD.js";import"./InputFieldV4.BNfLYgwf.js";import"./search.icon.BoWbx5_N.js";import"./useResizeObserver.2Xncx7_c.js";import"./TabsV4.styled.BIsOwqJn.js";import"./errors.DgYkpLMh.js";import"./react-toastify.esm.BcUAK96u.js";import"./GeneralStore.BohrguZ7.js";import"./ResizeSensor.C9zpZ8ah.js";import"./jsonFetch.C_hHwYGZ.js";import"./profile-util.DZ3K6xmc.js";import"./TooltipV4.ByTTuvBp.js";import"./Dialog.C5SorhYV.js";import"./VisuallyHidden.B1HY6dUm.js";import"./usePreventReactAriaInert.B-dge7fw.js";import"./delete.icon.De4VIOlP.js";import"./ButtonV4.BtUnhwWI.js";import"./SwitchV4.DjswcFlH.js";import"./Switch.zuNtfIeg.js";import"./useFormValidation.C-LlOGy0.js";import"./useToggleState.D_HFCIpr.js";import"./MultiSelectV4.dGcGnMYt.js";import"./PopoverV4.ZgFpsEcV.js";import"./useField.pW-lnFva.js";import"./combo.icon.OL1j227y.js";import"./remove-circle.icon.AifzH9AT.js";import"./SelectV4Action.B1jjnXwR.js";import"./SelectV4Popover.J4F5OYma.js";import"./Virtualizer.DMJNAPQR.js";import"./setting.icon.DPC859gD.js";import"./useSliderItemWidthV4.CEal-egi.js";import"./urlParameter.util.OFc5A56j.js";import"./PenguinKingJackpotStore.Cb45Dg70.js";import"./slugify.CQkBG-e2.js";import"./ContentPlaceholder.styles.BVvHim2A.js";import"./Messages.BTTtlMBa.js";import"./constants.3h5VYrdd.js";import"./user.icon.B1TiCqRT.js";import"./gameRoute.AgcSVfkW.js";import"./limboRename.util.Ct1_DtJ9.js";import"./gameDisplayName.CbiCgHyJ.js";import"./games-types.CsyxnsiU.js";import"./limboRename.C5b1KgXI.js";import"./AnimatedNumberV4.DX3NimWf.js";import"./index.DIQuI2rm.js";import"./originalGamesPriority.util.DFZVlbq2.js";import"./external-games.util.C9DPebFa.js";import"./CloseButtonV4.hcO_zxkh.js";import"./IconButtonV4.D0s_OlVn.js";import"./Modal.DrWT2KM1.js";function Be(e,i,d){const o=c.useRef(null),a=c.useCallback(l=>{const n=o.current;!n||n.reported||(n.reported=!0,_e.track(ke.SEARCH_PERFORMED,{results_count:n.count,clicked_result_name:l}))},[]);return c.useEffect(()=>{const l=e.trim();if(!l||!d)return;const n=o.current;n&&n.query!==l&&a(null),!n||n.query!==l?o.current={query:l,count:i,reported:!1}:n.count=i},[e,i,d,a]),c.useEffect(()=>()=>a(null),[a]),{recordResultClick:a}}const Fe={[r.LOBBY]:{key:r.LOBBY,title:f("All",{id:"L95lzUE9"})},[r.FAVORITE]:{key:r.FAVORITE,title:f("Favorites",{id:"x4GHZ0ZY"})},[r.ORIGINALS]:{key:r.ORIGINALS,title:f("Originals",{id:"PtP7FD0q"})},[r.EXCLUSIVE]:{key:r.EXCLUSIVE,title:f("Exclusive",{id:"Ao42WOmE"})},[r.SLOTS]:{key:r.SLOTS,title:f("Slots",{id:"BbGNHlkc"})},[r.TABLE_GAMES]:{key:r.TABLE_GAMES,title:f("Table Games",{id:"7P9j7ryQ"})},[r.BONUS_BUY]:{key:r.BONUS_BUY,title:f("Bonus Buy",{id:"DjqlwTGh"})},[r.PROVIDERS]:{key:r.PROVIDERS,title:f("Providers",{id:"t0w66VEh"})},[r.SLOTS_ARENA]:{key:r.SLOTS_ARENA,title:f("Slots Arena",{id:"ensPzGj3"})},[r.LIVE_GAMES]:{key:r.LIVE_GAMES,title:f("Live Games",{id:"OpBFZxHr"})}},Me=e=>e.map(({key:i}
1)=>Fe[i]).filter(Boolean),ze=e=>{switch(e){case r.LOBBY:return h.ALL;case r.FAVORITE:return h.FAVOURITE;case r.LIVE_GAMES:return h.LIVE;case r.SLOTS:return h.SLOTS;case r.TABLE_GAMES:return h.TABLE_GAMES;case r.ORIGINALS:return h.ORIGINALS;case r.EXCLUSIVE:return h.GAMDOM_EXCLUSIVE;case r.BONUS_BUY:return h.BONUS;case r.PROVIDERS:return h.ALL;default:return h.ALL}},De=p.div.withConfig({displayName:"GamesResultsstyled__VirtualizedContainer",componentId:"sc-1g8vzl3-0"})(["height:100%;width:100%;overflow-y:scroll;overflow-x:hidden;padding-top:",";","{padding-right:",";margin-bottom:",";}"],e=>e.theme.V4.spacing[10],e=>e.theme.V4.breakpoints.up("md"),e=>e.theme.V4.spacing[16],e=>e.theme.V4.spacing[10]),Ue=p(w).withConfig({displayName:"GamesResultsstyled__VirtualizedRow",componentId:"sc-1g8vzl3-1"})(["gap:",";width:100%;height:100%;"],({theme:e})=>e.V4.spacing[10]),Qe=p.div.withConfig({displayName:"GamesResultsstyled__VirtualizedScrollArea",componentId:"sc-1g8vzl3-2"})(["height:","px;width:100%;position:relative;"],e=>e.$height),He=p.div.withConfig({displayName:"GamesResultsstyled__VirtualizedRowContainer",componentId:"sc-1g8vzl3-3"})(["position:absolute;top:0;left:0;width:100%;height:","px;transform:translateY(","px);margin-bottom:10px;"],({$height:e})=>e,({$translateY:e})=>e),$e=p.div.withConfig({displayName:"GamesResultsstyled__VirtualizedItemWrapper",componentId:"sc-1g8vzl3-4"})(["width:","px;height:","px;"],({$width:e})=>e,({$height:e})=>e),Ye=p(D).withConfig({displayName:"SearchResultSkeletonstyled__TitleSkeleton",componentId:"sc-wo8ov6-0"})(["margin:0 ",";border-radius:",";width:219px;height:28px;"],e=>e.theme.V4.spacing[16],e=>e.theme.V4.borderRadius[10]),We=p.div.withConfig({displayName:"SearchResultSkeletonstyled__GridElementSkeletonContainer",componentId:"sc-wo8ov6-1"})(["width:100%;height:100%;position:relative;"]),Xe=p(D).withConfig({displayName:"SearchResultSkeletonstyled__GridElementSkeleton",componentId:"sc-wo8ov6-2"})(["position:absolute;top:0;left:0;border-radius:",";width:100%;",";"],e=>e.theme.V4.borderRadius[12],({$aspectRatio:e})=>e&&X(["padding-top:","%"],e)),Ke=p.div.withConfig({displayName:"SearchResultSkeletonstyled__ResultGrid",componentId:"sc-wo8ov6-3"})(["display:grid;gap:",";grid-template-columns:",";",""],e=>e.theme.V4.spacing[10],({$columns:e})=>e?"repeat(".concat(e,", 1fr)"):"repeat(auto-fill, minmax(130px, 1fr))",({$itemHeight:e})=>e&&X(["grid-auto-rows:","px;"],e)),Ze=({titleSkeleton:e,aspectRatio:i,itemsInRow:d=4,itemHeight:o})=>{const a=Array(d*2).fill("");return t.jsxs(t.Fragment,{children:[e&&t.jsx(Ye,{}),t.jsx(Ke,{$columns:d,$itemHeight:o,children:a.map((l,n)=>t.jsx(We,{children:t.jsx(Xe,{$aspectRatio:i})},n))})]})},Je=10,et=20,tt=L(({isSuccess:e,mutatedGamesResult:i,gameSearchLoading:d,aspectRatio:o,itemWidth:a,itemHeight:l,isError:n,refetch:E,rowVirtualizer:T,itemsInRow:g,onGameClick:s})=>{const u=K(),S=Z("md");return e&&i.length===0?t.jsx(J,{dataTestId:"empty-search-request",imageSrc:te,text:t.jsx(G,{default:"Unfortunately, nothing was found for your request...",id:"zMQPJYU6"}),height:"100%"}):d?t.jsx(Ze,{aspectRatio:Ae(o),itemsInRow:g,itemHeight:l}):n&&i.length===0?t.jsx(ee,{onRefresh:E,error:f("Failed to load the games list. Please try again later.",{id:"mdH2JIeu"}),icon:t.jsx(re,{width:120,height:90}),dataTestId:"games-list-error-response",height:"100%"}):t.jsx(Qe,{$height:T.getTotalSize(),children:T.getVirtualItems().map(R=>{const y=R.index*g,V=i.slice(y,y+g);return t.jsx(He,{$height:l,$translateY:R.start,children:t.jsx(Ue,{children:Array.from({length:g}).map((k,I)=>{const m=V[I],v=y+I;return t.jsx($e,{$width:a,$height:l,children:m&&t.jsx(Le,{isMobile:S,isSearch:!0,data:m,onClick:()=>s(m),dataTestId:je("quick-search-carousel-item",v||0),aspectRatio:u.V4.sizes.gameItemAspectRatio})},m?String(m.staticData.game_code)+String(v)+String(m.staticData.likes):v)})})},R.key)})})}),rt=L(e=>{const{searchText:i,category:d,providerNames:o,onSearchCountUpdate:a}=e,l=K(),[n,E]=l.V4.sizes.gameItemAspectRatio.split(" / "),T=Number(n)/Number(E),g=z(),s=ze(d),u=pe(),{filterOurGameByFeatureFlagAndExtendWithHardcodedImages:S}=be(),R=Te(),y=c.useRef(null),{data:V,isSuccess:k}=ue({queryKey:[_.casino.games_count.name,s],queryFn:()=>_.casino.games_count({config:{sectionType:s}}),staleTime:Y}),I=c.useMemo(()=>({search:i,sectionType:s,limit:et,...o!=null&&o.length?{providerNames:o}:{}}
1),[i,s,o]),{items:m,hasMore:v,isLoading:U,isFetchingNextPage:Q,fetchNextPage:H,isError:se,isSuccess:$,refetch:ie}=Ce({queryKey:[_.casino.games_search.name,I],queryFn:({pageParam:x=0})=>_.casino.games_search({config:{...I,offset:x}}),limit:I.limit,enabled:i.length<=F&&(!!i||!!d),staleTime:Y,getItems:x=>x.games,getHasMore:x=>{var C;return(C=x.hasMore)!=null?C:!1}});c.useLayoutEffect(()=>{s===h.FAVOURITE&&a(R)},[s,a,R]),c.useLayoutEffect(()=>{k&&s!==h.FAVOURITE&&s!==h.ORIGINALS&&a(V)},[k,V,a,s]);const{gameClick:oe}=Ge(),A=S(m||[]),{recordResultClick:ae}=Be(i,A.length,$&&!U),ne=x=>{var C;ae((C=x.staticData.name)!=null?C:x.staticData.game_code),oe(x),g.closeModalNew("games-quick-search")};c.useLayoutEffect(()=>{s===h.ORIGINALS&&m.length&&a(A.length)},[A.length,s,a,m]),c.useLayoutEffect(()=>{s===h.FAVOURITE&&(u.invalidateQueries([_.casino.games_count.name,s]),u.invalidateQueries([_.casino.games_search.name]),u.invalidateQueries({queryKey:[_.profile.getUserLikedGamesV4.name]}))},[s,u]);const{itemsInRow:b,itemWidth:ce,itemHeight:P}=we(y),O=Math.ceil(A.length/b),j=Re({count:O,getScrollElement:()=>y.current,estimateSize:()=>P+Je,overscan:3});return c.useLayoutEffect(()=>{j.measure()},[P,b,j]),c.useEffect(()=>{const x=j.getVirtualItems(),[C]=[...x].reverse();C&&C.index>=O-3&&v&&!Q&&H()},[v,H,O,Q,j]),t.jsx(De,{ref:y,children:t.jsx(tt,{isSuccess:$,mutatedGamesResult:A,gameSearchLoading:U,aspectRatio:T,itemWidth:ce,itemHeight:P,isError:se,refetch:ie,rowVirtualizer:j,itemsInRow:b,onGameClick:ne})})}),st=p.div.withConfig({displayName:"ProvidersResultsstyled__ItemsContainer",componentId:"sc-1ow9rgp-0"})(["row-gap:",";column-gap:",";display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));grid-auto-rows:minmax(min-content,max-content);width:100%;max-height:72vh;overflow:auto;align-content:start;","{max-height:70vh;padding-right:",";}"],e=>e.theme.V4.spacing[16],e=>e.theme.V4.spacing[10],e=>e.theme.V4.breakpoints.up("lg"),e=>e.theme.V4.spacing[16]),it=p(w).withConfig({displayName:"ProvidersResultsstyled__ItemContainer",componentId:"sc-1ow9rgp-1"})(["width:100%;height:100px;"]),ot=p(D).withConfig({displayName:"ProvidersResultsstyled__Skeleton",componentId:"sc-1ow9rgp-2"})(["width:100%;height:100px;border-radius:",";"],e=>e.theme.V4.borderRadius[16]),at=L(({searchText:e,onSearchCountUpdate:i})=>{const d=z(),{providers:o,isSuccess:a,isLoading:l,isError:n,refetch:E}=Oe(),g=le().getIsFeatureEnabled(me.PERABET_CONTENT),s=c.useMemo(()=>{if(!o||!e)return o||[];const u=e.toLowerCase();return o.filter(S=>Pe(S.provider_name,g).toLowerCase().includes(u))},[o,e,g]);return c.useEffect(()=>{i(s.length)},[i,s.length]),l?t.jsx(t.Fragment,{children:Array.from({length:10}).map((u,S)=>t.jsx(ot,{},"provider-item-skeleton-".concat(S)))}):n?t.jsx(ee,{onRefresh:E,error:f("Failed to load the providers list. Please try again later.",{id:"eS1S9IAg"}),icon:t.jsx(re,{width:120,height:90}),dataTestId:"games-list-error-response",height:"100%"}):a&&s.length===0?t.jsx(J,{dataTestId:"empty-search-request",imageSrc:te,text:t.jsx(G,{default:"So far, it's empty...",id:"clapC5Ao"}),height:"100%"}):t.jsx(st,{children:a&&s.map((u,S)=>t.jsx(it,{flex:"1",onClick:()=>d.closeModalNew("games-quick-search"),children:t.jsx(Ne,{provider:u,dataTestId:"providers-page-item-".concat(u.provider_name)})},"".concat(u.provider_name,"-").concat(S)))})}),B=p(W).withConfig({displayName:"GamesQuickSearchV4styled__Dialog",componentId:"sc-1q6vqcb-0"})(["display:flex;flex-flow:column;","{display:flex;flex-flow:column;","{max-height:90vh;};","{height:800px;width:1000px;max-width:90vw;};}","{flex-grow:1;overflow:auto;}"],qe,e=>e.theme.V4.breakpoints.up("md"),e=>e.theme.V4.breakpoints.up("lg"),W.Content),nt=p(Ie).withConfig({displayName:"GamesQuickSearchV4styled__ProvidersSelect",componentId:"sc-1q6vqcb-1"})(["flex:1;min-width:0;","{flex:0 0 auto;width:180px;}"],e=>e.theme.V4.breakpoints.up("lg")),ct=p(M.Tab).withConfig({displayName:"GamesQuickSearchV4styled__NavDesktopTab",componentId:"sc-1q6vqcb-2"})(["width:max-content;white-space:nowrap;"]),lt=p(w).withConfig({displayName:"GamesQuickSearchV4styled__ResultHeader",componentId:"sc-1q6vqcb-3"})(["gap:",";"],e=>e.theme.V4.spacing[4]),mt=p(w).withConfig({displayName:"GamesQuickSearchV4styled__ResultsContainer",componentId:"sc-1q6vqcb-4"})(["height:100%;overflow:hidden;margin-top:-",";"],e=>e.theme.V4.spacing[10]),Hr=L(()=>{const e=z(),[i,d]=c.useState(""),[o,a]=c.useState(r.LOBBY),[l,n]=c.useState([]),[E,T]=c.useState(0),g=Se(i),s=Z("lg"),u=g.length>F,{categories:S}=fe({ignore:[r.SLOTS_ARENA]}),R=m=>{a(m),d("")},y=m=>T(m),V=o===r.PROVIDERS,k=![r.ORIGINALS,r.PROVIDERS].includes(o),I=e.getOpenProps("games-quick-search");return c.useEffect(()=>{I.isOpen&&(d(""),n([]))},[I.isOpen]),t.jsx(ge,{constructor:ye,children:t.jsxs(B,{...I,dataTestId:"games-quick-search-modal",children:[t.jsx(B.Header,{variant:"title-center",dataTestId:"games-search-modal-header",children:t.jsx(q,{variant:"bold14",dataTestId:"quick-search-title",children:t.jsx(G,{default:"Quick Search",id:"IAx2jmFY"})})}),t.jsxs(B.Content,{children:[t.jsxs(w,{direction:s?"column":"row",gap:"8",alignItems:s?"stretch":"center",children:[t.jsx(w,{flex:s?void 0:"1",children:t.jsx(xe,{dataTestId:"search-input",placeholder:V?N("Search {expr} providers",{data:{expr:E||0},id:"qRGSTlcG"}):N("Search {expr} games",{data:{expr:E||0},id:"ovoT6TP2"}),value:i,onChange:d,endAdornment:t.jsx(he,{onClick:()=>d(""),"data-testid":"remove-search-text-btn",children:t.jsx(Ee,{width:20,height:20})}),error:u,errorMessage:N("Search text must not exceed {expr} characters",{data:{expr:F},id:"ozXQbH5K"}),inputProps:{autoFocus:!0}})}),t.jsxs(w,{direction:"row",gap:"8",alignItems:"center",children:[k&&t.jsx(nt,{value:l,onCh
1ange:n,dataTestId:"quick-search-providers-selector",listWidth:280}),t.jsx(ve,{dataTestId:"pick-random-and-filter-quick-search",pickRandomModalName:"pick-random-game-casino",variant:"secondary",tooltipPosition:"bottom"})]})]}),t.jsx(w,{children:t.jsx(M,{value:o,onChange:m=>R(m),dataTestId:"casino-layout-tabs",children:t.jsx(M.List,{children:Me(S).map(({title:m,key:v})=>t.jsx(ct,{value:v,label:t.jsx(Ve,{translatable:m})},v))})})}),t.jsxs(mt,{direction:"column",flex:"1",gap:"16",children:[i.length>0&&!s&&!u&&t.jsxs(lt,{children:[t.jsx(q,{variant:"bold22",dataTestId:"last-search-result",children:t.jsx(G,{default:"Results For",id:"yuQxgnSS"})}),t.jsx(q,{variant:"bold22",dataTestId:"last-search-result",children:t.jsx(de,{text:'"'.concat(i,'"')})})]}),V?t.jsx(at,{searchText:g,onSearchCountUpdate:y}):t.jsx(rt,{searchText:g,category:o,providerNames:k?l:void 0,onSearchCountUpdate:y})]})]})]})})});export{Hr as default}; 2//# sourceMappingURL=GamesQuickSearchV4.CNbNk42-.js.map
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.