1import{r as f,j as p,b as Ps,c as xe,a as Ts}from"./clsx-cnhB1bSH.js";import{P as As,I as Ct,G as de,b as fn,g as dn,a as pn}from"./buildContentUrl-_jBIOcz7.js";import{W as _s}from"./bootstrap-BYGrC_mR.js";import"./vite-preload-helper-PPVm8Dsz.js";var lr=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,mn=/^[\\/]{2}/;function js(e,t){return t+e.replace(/\\/g,"/")}var Dr="popstate";function Fr(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function Is(e={}){function t(n,s){let i=s.state?.masked,{pathname:o,search:a,hash:c}=i||n.location;return Kt("",{pathname:o,search:a,hash:c},s.state&&s.state.usr||null,s.state&&s.state.key||"default",i?{pathname:n.location.pathname,search:n.location.search,hash:n.location.hash}:void 0)}function r(n,s){return typeof s=="string"?s:Je(s)}return Ls(t,r,null,e)}function te(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Oe(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Ms(){return Math.random().toString(36).substring(2,10)}function Nr(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Kt(e,t,r=null,n,s){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?He(t):t,state:r,key:t&&t.key||n||Ms(),mask:s}}function Je({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function He(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substring(n),e=e.substring(0,n)),e&&(t.pathname=e)}return t}function Ls(e,t,r,n={}){let{window:s=document.defaultView,v5Compat:i=!1}=n,o=s.history,a="POP",c=null,l=u();l==null&&(l=0,o.replaceState({...o.state,idx:l},""));function u(){return(o.state||{idx:null}).idx}function h(){a="POP";let b=u(),R=b==null?null:b-l;l=b,c&&c({action:a,location:v.location,delta:R})}function d(b,R){a="PUSH";let E=Fr(b)?b:Kt(v.location,b,R);l=u()+1;let P=Nr(E,l),D=v.createHref(E.mask||E);try{o.pushState(P,"",D)}catch(T){if(T instanceof DOMException&&T.name==="DataCloneError")throw T;s.location.assign(D)}i&&c&&c({action:a,location:v.location,delta:1})}function m(b,R){a="REPLACE";let E=Fr(b)?b:Kt(v.location,b,R);l=u();let P=Nr(E,l),D=v.createHref(E.mask||E);o.replaceState(P,"",D),i&&c&&c({action:a,location:v.location,delta:0})}function g(b){return ks(s,b)}let v={get action(){return a},get location(){return e(s,o)},listen(b){if(c)throw new Error("A history only accepts one active listener");return s.addEventListener(Dr,h),c=b,()=>{s.removeEventListener(Dr,h),c=null}},createHref(b){return t(s,b)},createURL:g,encodeLocation(b){let R=g(b);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:d,replace:m,go(b){return o.go(b)}};return v}function ks(e,t,r=!1){let n="http://localhost";e&&(n=e.location.origin!=="null"?e.location.origin:e.location.href),te(n,"No window.location.(origin|href) available to create URL");let s=typeof t=="string"?t:Je(t);return s=s.replace(/ $/,"%20"),!r&&mn.test(s)&&(s=n+s),new URL(s,n)}function yn(e,t,r="/"){return Ds(e,t,r,!1)}function Ds(e,t,r,n,s){let i=typeof t=="string"?He(t):t,o=Ae(i.pathname||"/",r);if(o==null)return null;let a=Fs(e),c=null,l=Vs(o);for(let u=0;c==null&&u<a.length;++u)c=zs(a[u],l,n);return c}function Fs(e){let t=gn(e);return Ns(t),t}function gn(e,t=[],r=[],n="",s=!1){let i=(o,a,c=s,l)=>{let u={relativePath:l===void 0?o.path||"":l,caseSensitive:o.caseSensitive===!0,childrenIndex:a,route:o};if(u.relativePath.startsWith("/")){if(!u.relativePath.startsWith(n)&&c)return;te(u.relativePath.startsWith(n),`Absolute route path "${u.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),u.relativePath=u.relativePath.slice(n.length)}let h=Ee([n,u.relativePath]),d=r.concat(u);o.children&&o.children.length>0&&(te(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),gn(o.children,t,d,h,c)),!(o.path==null&&!o.index)&&t.push({path:h,score:Ks(h,o.index),routesMeta:d.map((m,g)=>{let[v,b]=wn(m.relativePath,m.caseSensitive,g===d.length-1);return{...m,matcher:v,compiledParams:b}})})};return e.forEach((o,a)=>
1{if(o.path===""||!o.path?.includes("?"))i(o,a);else for(let c of bn(o.path))i(o,a,!0,c)}),t}function bn(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,s=r.endsWith("?"),i=r.replace(/\?$/,"");if(n.length===0)return s?[i,""]:[i];let o=bn(n.join("/")),a=[];return a.push(...o.map(c=>c===""?i:[i,c].join("/"))),s&&a.push(...o),a.map(c=>e.startsWith("/")&&c===""?"/":c)}function Ns(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Ws(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}var Bs=/^:[\w-]+$/,$s=3,Us=2,Gs=1,Qs=10,Hs=-2,Br=e=>e==="*";function Ks(e,t){let r=e.split("/"),n=r.length;return r.some(Br)&&(n+=Hs),t&&(n+=Us),r.filter(s=>!Br(s)).reduce((s,i)=>s+(Bs.test(i)?$s:i===""?Gs:Qs),n)}function Ws(e,t){return e.length===t.length&&e.slice(0,-1).every((n,s)=>n===t[s])?e[e.length-1]-t[t.length-1]:0}function zs(e,t,r=!1){let{routesMeta:n}=e,s={},i="/",o=[];for(let a=0;a<n.length;++a){let c=n[a],l=a===n.length-1,u=i==="/"?t:t.slice(i.length)||"/",h={path:c.relativePath,caseSensitive:c.caseSensitive,end:l},d=c.matcher&&c.compiledParams?vn(h,u,c.matcher,c.compiledParams):Et(h,u),m=c.route;if(!d&&l&&r&&!n[n.length-1].route.index&&(d=Et({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},u)),!d)return null;
1Object.assign(s,d.params),o.push({params:s,pathname:Ee([i,d.pathname]),pathnameBase:Js(Ee([i,d.pathnameBase])),route:m}),d.pathnameBase!=="/"&&(i=Ee([i,d.pathnameBase]))}return o}function Et(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=wn(e.path,e.caseSensitive,e.end);return vn(e,t,r,n)}function vn(e,t,r,n){let s=t.match(r);if(!s)return null;let i=s[0],o=i.replace(/(.)\/+$/,"$1"),a=s.slice(1);return{params:n.reduce((l,{paramName:u,isOptional:h},d)=>{if(u==="*"){let g=a[d]||"";o=i.slice(0,i.length-g.length).replace(/(.)\/+$/,"$1")}const m=a[d];return h&&!m?l[u]=void 0:l[u]=(m||"").replace(/%2F/g,"/"),l},{}),pathname:i,pathnameBase:o,pattern:e}}function wn(e,t=!1,r=!0){Oe(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let n=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,c,l,u)=>{if(n.push({paramName:a,isOptional:c!=null}),c){let h=u.charAt(l+o.length);return h&&h!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(n.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),n]}function Vs(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Oe(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Ae(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function qs(e,t="/"){let{pathname:r,search:n="",hash:s=""}=typeof e=="string"?He(e):e,i;return r?(r=Cn(r),r.startsWith("/")?i=$r(r.substring(1),"/"):i=$r(r,t)):i=t,{pathname:i,search:Zs(n),hash:Xs(s)}}function $r(e,t){let r=Rt(t).split("/");return e.split("/").forEach(s=>{s===".."?r.length>1&&r.pop():s!=="."&&r.push(s)}),r.length>1?r.join("/"):"/"}function Bt(e,t,r,n){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(n)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Ys(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Sn(e){let t=Ys(e);return t.map((r,n)=>n===t.length-1?r.pathname:r.pathnameBase)}function hr(e,t,r,n=!1){let s;typeof e=="string"?s=He(e):(s={...e},te(!s.pathname||!s.pathname.includes("?"),Bt("?","pathname","search",s)),te(!s.pathname||!s.pathname.includes("#"),Bt("#","pathname","hash",s)),te(!s.search||!s.search.includes("#"),Bt("#","search","hash",s)));let i=e===""||s.pathname==="",o=i?"/":s.pathname,a;if(o==null)a=r;else{let h=t.length-1;if(!n&&o.startsWith("..")){let d=o.split("/");for(;d[0]==="..";)d.shift(),h-=1;s.pathname=d.join("/")}a=h>=0?t[h]:"/"}let c=qs(s,a),l=o&&o!=="/"&&o.endsWith("/"),u=(i||o===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(l||u)&&(c.pathname+="/"),c}var Cn=e=>e.replace(/[\\/]{2,}/g,"/"),Ee=e=>Cn(e.join("/")),Rt=e=>e.replace(/\/+$/,""),Js=e=>Rt(e).replace(/^\/*/,"/"),Zs=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Xs=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,ei=class{constructor(e,t,r,n=!1){this.status=e,this.statusText=t||"",this.internal=n,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function ti(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function ri(e){let t=e.map(r=>r.route.path).filter(Boolean);return Ee(t)||"/"}var En=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Rn(e,t){let r=e;if(typeof r!="string"||!lr.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let n=r,s=!1;if(En)try{let i=new URL(window.location.href),o=mn.test(r)?new URL(js(r,i.protocol)):new URL(r),a=Ae(o.pathname,t);o.origin===i.origin&&a!=null?r=a+o.search+o.hash:s=!0}catch{Oe(!1,`<Link to="${r}">
1 contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:n,isExternal:s,to:r}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var xn=["POST","PUT","PATCH","DELETE"];new Set(xn);var ni=["GET",...xn];new Set(ni);var si=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function ii(e){try{return si.includes(new URL(e).protocol)}catch{return!1}}var Ke=f.createContext(null);Ke.displayName="DataRouter";var It=f.createContext(null);It.displayName="DataRouterState";var On=f.createContext(!1);function oi(){return f.useContext(On)}var Pn=f.createContext({isTransitioning:!1});Pn.displayName="ViewTransition";var ai=f.createContext(new Map);ai.displayName="Fetchers";var ci=f.createContext(null);ci.displayName="Await";var Ce=f.createContext(null);Ce.displayName="Navigation";var rt=f.createContext(null);rt.displayName="Location";var Pe=f.createContext({outlet:null,matches:[],isDataRoute:!1});Pe.displayName="Route";var fr=f.createContext(null);fr.displayName="RouteError";var Tn="REACT_ROUTER_ERROR",ui="REDIRECT",li="ROUTE_ERROR_RESPONSE";function hi(e){if(e.startsWith(`${Tn}:${ui}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function fi(e){if(e.startsWith(`${Tn}:${li}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new ei(t.status,t.statusText,t.data)}catch{}}function di(e,{relative:t}={}){te(nt(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:n}=f.useContext(Ce),{hash:s,pathname:i,search:o}=st(e,{relative:t}),a=i;return r!=="/"&&(a=i==="/"?r:Ee([r,i])),n.createHref({pathname:a,search:o,hash:s})}function nt(){return f.useContext(rt)!=null}function we(){return te(nt(),"useLocation() may be used only in the context of a <Router> component."),f.useContext(rt).location}var An="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function _n(e){f.useContext(Ce).static||f.useLayoutEffect(e)}function pi(){let{isDataRoute:e}=f.useContext(Pe);return e?Pi():mi()}function mi(){te(nt(),"useNavigate() may be used only in the context of a <Router> component.");let e=f.useContext(Ke),{basename:t,navigator:r}=f.useContext(Ce),{matches:n}=f.useContext(Pe),{pathname:s}=we(),i=JSON.stringify(Sn(n)),o=f.useRef(!1);return _n(()=>{o.current=!0}),f.useCallback((c,l={})=>{if(Oe(o.current,An),!o.current)return;if(typeof c=="number"){r.go(c);return}let u=hr(c,JSON.parse(i),s,l.relative==="path");e==null&&t!=="/"&&(u.pathname=u.pathname==="/"?t:Ee([t,u.pathname])),(l.replace?r.replace:r.push)(u,l.state,l)},[t,r,i,s,e])}f.createContext(null);function Be(){let{matches:e}=f.useContext(Pe);return e[e.length-1]?.params??{}}function st(e,{relative:t}={}){let{matches:r}=f.useContext(Pe),{pathname:n}=we(),s=JSON.stringify(Sn(r));return f.useMemo(()=>hr(e,JSON.parse(s),n,t==="path"),[e,s,n,t])}function yi(e,t){return jn(e,t)}function jn(e,t,r){te(nt(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:n}=f.useContext(Ce),{matches:s}=f.useContext(Pe),i=s[s.length-1],o=i?i.params:{},a=i?i.pathname:"/",c=i?i.pathnameBase:"/",l=i&&i.route;{let b=l&&l.path||"";Mn(a,!l||b.endsWith("*")||b.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${a}" (under <Route path="${b}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. 2 3Please change the parent <Route path="${b}"> to <Route path="${b==="/"?"*":`${b}/*`}">.`)}let u=we(),h;if(t){let b=typeof t=="string"?He(t):t;te(c==="/"||b.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${b.pathname}" was given in the \`location\` prop.`),h=b}else h=u;let d=h.pathname||"/",m=d;if(c!=="/"){let b=c.replace(/^\//,"").split("/");m="/"+d.replace(/^\//,"").split("/").slice(b.length).join("/")}let g=r&&r.state.matches.length?r.state.matches.map(b=>Object.assign(b,{route:r.manifest[b.route.id]||b.route})):yn(e,{pathname:m});Oe(l||g!=null,`No routes matched location "${h.pathname}${h.search}${h.hash}" `),Oe(g==null||g[g.length-1].route.element!==void 0||g[g.length-1].route.Component!==void 0||g[g.length-1].route.lazy!==void 0,`Matched leaf route at location "${h.pathname}${h.search}${h.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let v=Si(g&&g.map(b=>Object.assign({},b,{params:Object.assign({},o,b.params),pathname:Ee([c,n.encodeLocation?n.encodeLocation(b.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?c:Ee([c,n.encodeLocation?n.encodeLocation(b.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:b.pathnameBase])})),s,r);return t&&v?f.createElement(rt.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...h},navigationType:"POP"}},v):v}function gi(){let e=Oi(),t=ti(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:n},i={padding:"2px 4px",backgroundColor:n},o=null;return console.error("Error handled by React Router default ErrorBoundary:",e),o=f.createElement(f.Fragment,null,f.createElement("p",null,"ð¿ Hey developer ð"),f.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",f.createElement("code",{style:i},"ErrorBoundary")," or"," ",f.createElement("code",{style:i},"errorElement")," prop on your route.")),f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application
3Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},t),r?f.createElement("pre",{style:s},r):null,o)}var bi=f.createElement(gi,null),In=class extends f.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const r=fi(e.digest);r&&(e=r)}let t=e!==void 0?f.createElement(Pe.Provider,{value:this.props.routeContext},f.createElement(fr.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?f.createElement(vi,{error:e},t):t}};In.contextType=On;var $t=new WeakMap;function vi({children:e,error:t}){let{basename:r}=f.useContext(Ce);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let n=hi(t.digest);if(n){let s=$t.get(t);if(s)throw s;let i=Rn(n.location,r),o=i.absoluteURL||i.to;if(ii(o))throw new Error("Invalid redirect location");if(En&&!$t.get(t))if(i.isExternal||n.reloadDocument)window.location.href=o;else{const a=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:n.replace}));throw $t.set(t,a),a}return f.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o}`})}}return e}function wi({routeContext:e,match:t,children:r}){let n=f.useContext(Ke);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),f.createElement(Pe.Provider,{value:e},r)}function Si(e,t=[],r){let n=r?.state;if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let s=e,i=n?.errors;if(i!=null){let u=s.findIndex(h=>h.route.id&&i?.[h.route.id]!==void 0);te(u>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),s=s.slice(0,Math.min(s.length,u+1))}let o=!1,a=-1;if(r&&n){o=n.renderFallback;for(let u=0;u<s.length;u++){let h=s[u];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(a=u),h.route.id){let{loaderData:d,errors:m}=n,g=h.route.loader&&!d.hasOwnProperty(h.route.id)&&(!m||m[h.route.id]===void 0);if(h.route.lazy||g){r.isStatic&&(o=!0),a>=0?s=s.slice(0,a+1):s=[s[0]];break}}}}let c=r?.onError,l=n&&c?(u,h)=>{c(u,{location:n.location,params:n.matches?.[0]?.params??{},pattern:ri(n.matches),errorInfo:h})}:void 0;return s.reduceRight((u,h,d)=>{let m,g=!1,v=null,b=null;n&&(m=i&&h.route.id?i[h.route.id]:void 0,v=h.route.errorElement||bi,o&&(a<0&&d===0?(Mn("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),g=!0,b=null):a===d&&(g=!0,b=h.route.hydrateFallbackElement||null)));let R=t.concat(s.slice(0,d+1)),E=()=>{let P;return m?P=v:g?P=b:h.route.Component?P=f.createElement(h.route.Component,null):h.route.element?P=h.route.element:P=u,f.createElement(wi,{match:h,routeContext:{outlet:u,matches:R,isDataRoute:n!=null},children:P})};return n&&(h.route.ErrorBoundary||h.route.errorElement||d===0)?f.createElement(In,{location:n.location,revalidation:n.revalidation,component:v,error:m,children:E(),routeContext:{outlet:null,matches:R,isDataRoute:!0},onError:l}):E()},null)}function dr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ci(e){let t=f.useContext(Ke);return te(t,dr(e)),t}function Ei(e){let t=f.useContext(It);return te(t,dr(e)),t}function Ri(e){let t=f.useContext(Pe);return te(t,dr(e)),t}function pr(e){let t=Ri(e),r=t.matches[t.matches.length-1];return te(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function xi(){return pr("useRouteId")}function Oi(){let e=f.useContext(fr),t=Ei("useRouteError"),r=pr("useRouteError");return e!==void 0?e:t.errors?.[r]}function Pi(){let{router:e}=Ci("useNavigate"),t=pr("useNavigate"),r=f.useRef(!1);return _n(()=>{r.current=!0}),f.useCallback(async(s,i={})=>{Oe(r.current,An),r.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:t,...i}))},[e,t])}var Ur={};function Mn(e,t,r){!t&&!Ur[e]&&(Ur[e]=!0,Oe(!1,r))}f.memo(Ti);function Ti({routes:e,manifest:t,future:r,state:n,isStatic:s,onError:i}){return jn(e,void 0,{manifest:t,state:n,isStatic:s,onError:i})}function Ue(e){te(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function Ai({basename:e="/",children:t=null,location:r,navigationType:n="POP",navigator:s,static:i=!1,useTransitions:o}){te(!nt(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let a=e.replace(/^\/*/,"/"),c=f.useMemo(()=>({basename:a,navigator:s,static:i,useTransitions:o,future:{}}
3),[a,s,i,o]);typeof r=="string"&&(r=He(r));let{pathname:l="/",search:u="",hash:h="",state:d=null,key:m="default",mask:g}=r,v=f.useMemo(()=>{let b=Ae(l,a);return b==null?null:{location:{pathname:b,search:u,hash:h,state:d,key:m,mask:g},navigationType:n}},[a,l,u,h,d,m,n,g]);return Oe(v!=null,`<Router basename="${a}"> is not able to match the URL "${l}${u}${h}" because it does not start with the basename, so the <Router> won't render anything.`),v==null?null:f.createElement(Ce.Provider,{value:c},f.createElement(rt.Provider,{children:t,value:v}))}function _i({children:e,location:t}){return yi(Wt(e),t)}function Wt(e,t=[]){let r=[];return f.Children.forEach(e,(n,s)=>{if(!f.isValidElement(n))return;let i=[...t,s];if(n.type===f.Fragment){r.push.apply(r,Wt(n.props.children,i));return}te(n.type===Ue,`[${typeof n.type=="string"?n.type:n.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),te(!n.props.index||!n.props.children,"An index route cannot have child routes.");let o={id:n.props.id||i.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,middleware:n.props.middleware,loader:n.props.loader,action:n.props.action,hydrateFallbackElement:n.props.hydrateFallbackElement,HydrateFallback:n.props.HydrateFallback,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.hasErrorBoundary===!0||n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=Wt(n.props.children,i)),r.push(o)}),r}var gt="get",bt="application/x-www-form-urlencoded";function Mt(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function ji(e){return Mt(e)&&e.tagName.toLowerCase()==="button"}function Ii(e){return Mt(e)&&e.tagName.toLowerCase()==="form"}function Mi(e){return Mt(e)&&e.tagName.toLowerCase()==="input"}function Li(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ki(e,t){return e.button===0&&(!t||t==="_self")&&!Li(e)}var dt=null;function Di(){if(dt===null)try{new FormData(document.createElement("form"),0),dt=!1}catch{dt=!0}return dt}var Fi=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ut(e){return e!=null&&!Fi.has(e)?(Oe(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${bt}"`),null):e}function Ni(e,t){let r,n,s,i,o;if(Ii(e)){let a=e.getAttribute("action");n=a?Ae(a,t):null,r=e.getAttribute("method")||gt,s=Ut(e.getAttribute("enctype"))||bt,i=new FormData(e)}else if(ji(e)||Mi(e)&&(e.type==="submit"||e.type==="image")){let a=e.form;if(a==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let c=e.getAttribute("formaction")||a.getAttribute("action");if(n=c?Ae(c,t):null,r=e.getAttribute("formmethod")||a.getAttribute("method")||gt,s=Ut(e.getAttribute("formenctype"))||Ut(a.getAttribute("enctype"))||bt,i=new FormData(a,e),!Di()){let{name:l,type:u,value:h}=e;if(u==="image"){let d=l?`${l}.`:"";i.append(`${d}x`,"0"),i.append(`${d}y`,"0")}else l&&i.append(l,h)}}else{if(Mt(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');
3r=gt,n=null,s=bt,o=e}return i&&s==="text/plain"&&(o=i,i=void 0),{action:n,method:r.toLowerCase(),encType:s,formData:i,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function mr(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Ln(e,t,r,n){let s=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?s.pathname.endsWith("/")?s.pathname=`${s.pathname}_.${n}`:s.pathname=`${s.pathname}.${n}`:s.pathname==="/"?s.pathname=`_root.${n}`:t&&Ae(s.pathname,t)==="/"?s.pathname=`${Rt(t)}/_root.${n}`:s.pathname=`${Rt(s.pathname)}.${n}`,s}async function Bi(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function $i(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function Ui(e,t,r){let n=await Promise.all(e.map(async s=>{let i=t.routes[s.route.id];if(i){let o=await Bi(i,r);return o.links?o.links():[]}return[]}));return Ki(n.flat(1).filter($i).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function Gr(e,t,r,n,s,i){let o=(c,l)=>r[l]?c.route.id!==r[l].route.id:!0,a=(c,l)=>r[l].pathname!==c.pathname||r[l].route.path?.endsWith("*")&&r[l].params["*"]!==c.params["*"];return i==="assets"?t.filter((c,l)=>o(c,l)||a(c,l)):i==="data"?t.filter((c,l)=>{let u=n.routes[c.route.id];if(!u||!u.hasLoader)return!1;if(o(c,l)||a(c,l))return!0;if(c.route.shouldRevalidate){let h=c.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:c.params,defaultShouldRevalidate:!0});if(typeof h=="boolean")return h}return!0}):[]}function Gi(e,t,{includeHydrateFallback:r}={}){return Qi(e.map(n=>{let s=t.routes[n.route.id];if(!s)return[];let i=[s.module];return s.clientActionModule&&(i=i.concat(s.clientActionModule)),s.clientLoaderModule&&(i=i.concat(s.clientLoaderModule)),r&&s.hydrateFallbackModule&&(i=i.concat(s.hydrateFallbackModule)),s.imports&&(i=i.concat(s.imports)),i}).flat(1))}function Qi(e){return[...new Set(e)]}function Hi(e){let t={},r=Object.keys(e).sort();for(let n of r)t[n]=e[n];return t}function Ki(e,t){let r=new Set;return new Set(t),e.reduce((n,s)=>{let i=JSON.stringify(Hi(s));return r.has(i)||(r.add(i),n.push({key:i,link:s})),n},[])}function yr(){let e=f.useContext(Ke);return mr(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Wi(){let e=f.useContext(It);return mr(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var gr=f.createContext(void 0);gr.displayName="FrameworkContext";function Lt(){let e=f.useContext(gr);return mr(e,"You must render this element inside a <HydratedRouter> element"),e}function zi(e,t){let r=f.useContext(gr),[n,s]=f.useState(!1),[i,o]=f.useState(!1),{onFocus:a,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:h}=t,d=f.useRef(null);f.useEffect(()=>{if(e==="render"&&o(!0),e==="viewport"){let v=R=>{R.forEach(E=>{o(E.isIntersecting)})},b=new IntersectionObserver(v,{threshold:.5});return d.current&&b.observe(d.current),()=>{b.disconnect()}}},[e]),f.useEffect(()=>{if(n){let v=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(v)}}},[n]);let m=()=>{s(!0)},g=()=>{s(!1),o(!1)};return r?e!=="intent"?[i,d,{}]:[i,d,{onFocus:qe(a,m),onBlur:qe(c,g),onMouseEnter:qe(l,m),onMouseLeave:qe(u,g),onTouchStart:qe(h,m)}]:[!1,d,{}]}function qe(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function Vi({page:e,...t}){let r=oi(),{nonce:n}=Lt(),{router:s}=yr(),i=f.useMemo(()=>yn(s.routes,e,s.basename),[s.routes,e,s.basename]);return i?(t.nonce==null&&n&&(t={...t,nonce:n}),r?f.createElement(Yi,{page:e,matches:i,...t}):f.createElement(Ji,{page:e,matches:i,...t})):null}function qi(e){let{manifest:t,routeModules:r}=Lt(),[n,s]=f.useState([]);return f.useEffect(()=>{let i=!1;return Ui(e,t,r).then(o=>{i||s(o)}),()=>{i=!0}},[e,t,r]),n}function Yi({page:e,matches:t,...r}){let n=we(),{future:s}=Lt(),{basename:i}=yr(),o=f.useMemo(()=>
3{if(e===n.pathname+n.search+n.hash)return[];let a=Ln(e,i,s.v8_trailingSlashAwareDataRequests,"rsc"),c=!1,l=[];for(let u of t)typeof u.route.shouldRevalidate=="function"?c=!0:l.push(u.route.id);return c&&l.length>0&&a.searchParams.set("_routes",l.join(",")),[a.pathname+a.search]},[i,s.v8_trailingSlashAwareDataRequests,e,n,t]);return f.createElement(f.Fragment,null,o.map(a=>f.createElement("link",{key:a,rel:"prefetch",as:"fetch",href:a,...r})))}function Ji({page:e,matches:t,...r}){let n=we(),{future:s,manifest:i,routeModules:o}=Lt(),{basename:a}=yr(),{loaderData:c,matches:l}=Wi(),u=f.useMemo(()=>Gr(e,t,l,i,n,"data"),[e,t,l,i,n]),h=f.useMemo(()=>Gr(e,t,l,i,n,"assets"),[e,t,l,i,n]),d=f.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let v=new Set,b=!1;if(t.forEach(E=>{let P=i.routes[E.route.id];!P||!P.hasLoader||(!u.some(D=>D.route.id===E.route.id)&&E.route.id in c&&o[E.route.id]?.shouldRevalidate||P.hasClientLoader?b=!0:v.add(E.route.id))}),v.size===0)return[];let R=Ln(e,a,s.v8_trailingSlashAwareDataRequests,"data");return b&&v.size>0&&R.searchParams.set("_routes",t.filter(E=>v.has(E.route.id)).map(E=>E.route.id).join(",")),[R.pathname+R.search]},[a,s.v8_trailingSlashAwareDataRequests,c,n,i,u,t,e,o]),m=f.useMemo(()=>Gi(h,i),[h,i]),g=qi(h);return f.createElement(f.Fragment,null,d.map(v=>f.createElement("link",{key:v,rel:"prefetch",as:"fetch",href:v,...r})),m.map(v=>f.createElement("link",{key:v,rel:"modulepreload",href:v,...r})),g.map(({key:v,link:b})=>f.createElement("link",{key:v,nonce:r.nonce,...b,crossOrigin:b.crossOrigin??r.crossOrigin})))}function Zi(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var Xi=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Xi&&(window.__reactRouterVersion="7.18.2")}catch{}function eo({basename:e,children:t,useTransitions:r,window:n}){let s=f.useRef();s.current==null&&(s.current=Is({window:n,v5Compat:!0}));let i=s.current,[o,a]=f.useState({action:i.action,location:i.location}),c=f.useCallback(l=>{r===!1?a(l):f.startTransition(()=>a(l))},[r]);return f.useLayoutEffect(()=>i.listen(c),[i,c]),f.createElement(Ai,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:i,useTransitions:r})}var We=f.forwardRef(function({onClick:t,discover:r="render",prefetch:n="none",relative:s,reloadDocument:i,replace:o,mask:a,state:c,target:l,to:u,preventScrollReset:h,viewTransition:d,defaultShouldRevalidate:m,...g},v){let{basename:b,navigator:R,useTransitions:E}=f.useContext(Ce),P=typeof u=="string"&&lr.test(u),D=Rn(u,b);u=D.to;let T=di(u,{relative:s}),k=we(),U=null;if(a){let Q=hr(a,[],k.mask?k.mask.pathname:"/",!0);b!=="/"&&(Q.pathname=Q.pathname==="/"?b:Ee([b,Q.pathname])),U=R.createHref(Q)}let[A,I,$]=zi(n,g),G=so(u,{replace:o,mask:a,state:c,target:l,preventScrollReset:h,relative:s,viewTransition:d,defaultShouldRevalidate:m,useTransitions:E});function L(Q){t&&t(Q),Q.defaultPrevented||G(Q)}let F=!(D.isExternal||i),N=f.createElement("a",{...g,...$,href:(F?U:void 0)||D.absoluteURL||T,onClick:F?L:t,ref:Zi(v,I),target:l,"data-discover":!P&&r==="render"?"true":void 0});return A&&!P?f.createElement(f.Fragment,null,N,f.createElement(Vi,{page:T})):N});We.displayName="Link";var to=f.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:n="",end:s=!1,style:i,to:o,viewTransition:a,children:c,...l},u){let h=st(o,{relative:l.relative}),d=we(),m=f.useContext(It),{navigator:g,basename:v}=f.useContext(Ce),b=m!=null&&uo(h)&&a===!0,R=g.encodeLocation?g.encodeLocation(h).pathname:h.pathname,E=d.pathname,P=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;r||(E=E.toLowerCase(),P=P?P.toLowerCase():null,R=R.toLowerCase()),P&&v&&(P=Ae(P,v)||P);const D=R!=="/"&&R.endsWith("/")?R.length-1:R.length;let T=E===R||!s&&E.startsWith(R)&&E.charAt(D)==="/",k=P!=null&&(P===R||!s&&P.startsWith(R)&&P.charAt(R.length)==="/"),U={isActive:T,isPending:k,isTransitioning:b},A=T?t:void 0,I;typeof n=="function"?I=n(U):I=[n,T?"active":null,k?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let $=typeof i=="function"?i(U):i;return f.createElement(We,{...l,"aria-current":A,className:I,ref:u,style:$,to:o,viewTransition:a},typeof c=="function"?c(U):c)});to.displayName="NavLink";var ro=f.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:n,replace:s,state:i,method:o=gt,action:a,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:h,defaultShouldRevalidate:d,...m},g)=>{let{useTransitions:v}=f.useContext(Ce),b=ao(),R=co(a,{relative:l}
3),E=o.toLowerCase()==="get"?"get":"post",P=typeof a=="string"&&lr.test(a),D=T=>{if(c&&c(T),T.defaultPrevented)return;T.preventDefault();let k=T.nativeEvent.submitter,U=k?.getAttribute("formmethod")||o,A=()=>b(k||T.currentTarget,{fetcherKey:t,method:U,navigate:r,replace:s,state:i,relative:l,preventScrollReset:u,viewTransition:h,defaultShouldRevalidate:d});v&&r!==!1?f.startTransition(()=>A()):A()};return f.createElement("form",{ref:g,method:E,action:R,onSubmit:n?c:D,...m,"data-discover":!P&&e==="render"?"true":void 0})});ro.displayName="Form";function no(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function kn(e){let t=f.useContext(Ke);return te(t,no(e)),t}function so(e,{target:t,replace:r,mask:n,state:s,preventScrollReset:i,relative:o,viewTransition:a,defaultShouldRevalidate:c,useTransitions:l}={}){let u=pi(),h=we(),d=st(e,{relative:o});return f.useCallback(m=>{if(ki(m,t)){m.preventDefault();let g=r!==void 0?r:Je(h)===Je(d),v=()=>u(e,{replace:g,mask:n,state:s,preventScrollReset:i,relative:o,viewTransition:a,defaultShouldRevalidate:c});l?f.startTransition(()=>v()):v()}},[h,u,d,r,n,s,t,e,i,o,a,c,l])}var io=0,oo=()=>`__${String(++io)}__`;function ao(){let{router:e}=kn("useSubmit"),{basename:t}=f.useContext(Ce),r=xi(),n=e.fetch,s=e.navigate;return f.useCallback(async(i,o={})=>{let{action:a,method:c,encType:l,formData:u,body:h}=Ni(i,t);if(o.navigate===!1){let d=o.fetcherKey||oo();await n(d,r,o.action||a,{defaultShouldRevalidate:o.defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:u,body:h,formMethod:o.method||c,formEncType:o.encType||l,flushSync:o.flushSync})}else await s(o.action||a,{defaultShouldRevalidate:o.defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:u,body:h,formMethod:o.method||c,formEncType:o.encType||l,replace:o.replace,state:o.state,fromRouteId:r,flushSync:o.flushSync,viewTransition:o.viewTransition})},[n,s,t,r])}function co(e,{relative:t}={}){let{basename:r}=f.useContext(Ce),n=f.useContext(Pe);te(n,"useFormAction must be used inside a RouteContext");let[s]=n.matches.slice(-1),i={...st(e||".",{relative:t})},o=we();if(e==null){i.search=o.search;let a=new URLSearchParams(i.search),c=a.getAll("index");if(c.some(u=>u==="")){a.delete("index"),c.filter(h=>h).forEach(h=>a.append("index",h));let u=a.toString();i.search=u?`?${u}
3`:""}}return(!e||e===".")&&s.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(i.pathname=i.pathname==="/"?r:Ee([r,i.pathname])),Je(i)}function uo(e,{relative:t}={}){let r=f.useContext(Pn);te(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=kn("useViewTransitionState"),s=st(e,{relative:t});if(!r.isTransitioning)return!1;let i=Ae(r.currentLocation.pathname,n)||r.currentLocation.pathname,o=Ae(r.nextLocation.pathname,n)||r.nextLocation.pathname;return Et(s.pathname,o)!=null||Et(s.pathname,i)!=null}var it=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},lo=class extends it{#e;#t;#r;constructor(){super(),this.#r=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},br=new lo,ho={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},fo=class{#e=ho;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},De=new fo;function po(e){setTimeout(e,0)}var mo=typeof window>"u"||"Deno"in globalThis;function me(){}function yo(e,t){return typeof e=="function"?e(t):e}function zt(e){return typeof e=="number"&&e>=0&&e!==1/0}function Dn(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ie(e,t){return typeof e=="function"?e(t):e}function be(e,t){return typeof e=="function"?e(t):e}function Qr(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:i,queryKey:o,stale:a}=e;if(o){if(n){if(t.queryHash!==vr(o,t.options))return!1}else if(!Qe(t.queryKey,o))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||s&&s!==t.state.fetchStatus||i&&!i(t))}function Hr(e,t){const{exact:r,status:n,predicate:s,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(r){if(Ze(t.options.mutationKey)!==Ze(i))return!1}else if(!Qe(t.options.mutationKey,i))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function vr(e,t){return(t?.queryKeyHashFn||Ze)(e)}function Ze(e){return JSON.stringify(e,(t,r)=>qt(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function Qe(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n<t.length;n++)if(!Qe(e[n],t[n]))return!1;return!0}const r=Object.keys(t);for(const n of r)if(!Qe(e[n],t[n]))return!1;return!0}return!1}var go=Object.prototype.hasOwnProperty;function Fn(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=Kr(e)&&Kr(t);if(!n&&!(qt(e)&&qt(t)))return t;const i=(n?e:Object.keys(e)).length,o=n?t:Object.keys(t),a=o.length,c=n?new Array(a):{};let l=0;for(let u=0;u<a;u++){const h=n?u:o[u],d=e[h],m=t[h];if(d===m){c[h]=d,(n?u<i:go.call(e,h))&&l++;continue}if(d===null||m===null||typeof d!="object"||typeof m!="object"){c[h]=m;continue}const g=Fn(d,m,r+1);c[h]=g,g===d&&l++}return i===a&&l===i?e:c}function Vt(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function Kr(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function qt(e){if(!Wr(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!Wr(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Wr(e){return Object.prototype.toString.call(e)==="[object Object]"}function bo(e){return new Promise(t=>{De.setTimeout(t,e)})}function Yt(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?Fn(e,t):t}function Nn(e){return e}function vo(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function wo(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var wr=Symbol();function Bn(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===wr?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function $n(e,t){return typeof e=="function"?e(...t):!!e}function So(e,t,r){let n=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??=t(),n||(n=!0,s.aborted?r():s.addEventListener("abort",r,{once:!0})),s)}),e}var Xe=(()=>{let e=()=>mo;return{isServer(){return e()},setIsServer(t){e=t}}})();function Jt(){let e,t;const r=new Promise((s,i)=>{e=s,t=i});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),e(s)},r.reject=s=>{n({status:"rejected",reason:s}),t(s)},r}var Co=po;function Eo(){let e=[],t=0,r=a=>{a()},n=a=>{a()},s=Co;const i=a=>{t?e.push(a):s(()=>{r(a)})},o=()=>{const a=e;e=[],a.length&&s(()=>{n(()=>{a.forEach(c=>{r(c)})})})};return{batch:a=>{let c;t++;try{c=a()}finally{t--,t||o()}return c},batchCalls:a=>(...c)=>{i(()=>{a(...c)})},schedule:i,setNotifyFunction:a=>{r=a},setBatchNotifyFunction:a=>{n=a},setScheduler:a=>{s=a}}}var ae=Eo(),Ro=class extends it{#e=!0;#t;#r;constructor(){super(),this.#r=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}
vendor: 26,272 bytes, line 3
3setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(r=>{r(e)}))}isOnline(){return this.#e}},xt=new Ro;function xo(e){return Math.min(1e3*2**e,3e4)}function Un(e){return(e??"online")==="online"?xt.isOnline():!0}var Zt=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Gn(e){let t=!1,r=0,n;const s=Jt(),i=()=>s.status!=="pending",o=v=>{if(!i()){const b=new Zt(v);d(b),e.onCancel?.(b)}},a=()=>{t=!0},c=()=>{t=!1},l=()=>br.isFocused()&&(e.networkMode==="always"||xt.isOnline())&&e.canRun(),u=()=>Un(e.networkMode)&&e.canRun(),h=v=>{i()||(n?.(),s.resolve(v))},d=v=>{i()||(n?.(),s.reject(v))},m=()=>new Promise(v=>{n=b=>{(i()||l())&&v(b)},e.onPause?.()}).then(()=>{n=void 0,i()||e.onContinue?.()}),g=()=>{if(i())return;let v;const b=r===0?e.initialPromise:void 0;try{v=b??e.fn()}catch(R){v=Promise.reject(R)}Promise.resolve(v).then(h).catch(R=>{if(i())return;const E=e.retry??(Xe.isServer()?0:3),P=e.retryDelay??xo,D=typeof P=="function"?P(r,R):P,T=E===!0||typeof E=="number"&&r<E||typeof E=="function"&&E(r,R);if(t||!T){d(R);return}r++,e.onFail?.(r,R),bo(D).then(()=>l()?void 0:m()).then(()=>{t?d(R):g()})})};return{promise:s,status:()=>s.status,cancel:o,continue:()=>(n?.(),s),cancelRetry:a,continueRetry:c,canStart:u,start:()=>(u()?g():m().then(g),s)}}var Qn=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),zt(this.gcTime)&&(this.#e=De.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Xe.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(De.clearTimeout(this.#e),this.#e=void 0)}};function Oo(e){return{onFetch:(t,r)=>{const n=t.options,s=t.fetchOptions?.meta?.fetchMore?.direction,i=t.state.data?.pages||[],o=t.state.data?.pageParams||[];let a={pages:[],pageParams:[]},c=0;const l=async()=>{let u=!1;const h=g=>{So(g,()=>t.signal,()=>u=!0)},d=Bn(t.options,t.fetchOptions),m=async(g,v,b)=>{if(u)return Promise.reject(t.signal.reason);if(v==null&&g.pages.length)return Promise.resolve(g);const E=(()=>{const k={client:t.client,queryKey:t.queryKey,pageParam:v,direction:b?"backward":"forward",meta:t.options.meta};return h(k),k})(),P=await d(E),{maxPages:D}=t.options,T=b?wo:vo;return{pages:T(g.pages,P,D),pageParams:T(g.pageParams,v,D)}};if(s&&i.length){const g=s==="backward",v=g?Po:zr,b={pages:i,pageParams:o},R=v(n,b);a=await m(b,R,g)}else{const g=e??i.length;do{const v=c===0?o[0]??n.initialPageParam:zr(n,a);if(c>0&&v==null)break;a=await m(a,v),c++}while(c<g)}return a};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=l}}}function zr(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function Po(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}var To=class extends Qn{#e;#t;#r;#n;#i;#s;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#n=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=qr(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#s?.promise}setOptions(e){if(this.options={...this.#a,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=qr(this.options);t.data!==void 0&&(this.setState(Vr(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const r=Yt(this.state.data,e,this.options);return this.#c({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e){this.#c({type:"setState",state:e})}cancel(e){const t=this.#s?.promise;return this.#s?.cancel(e),t?t.then(me).catch(me):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>be(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===wr||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Ie(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Dn(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#s?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#s?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#s&&(this.#o||this.#l()?this.#s.cancel({revert:!0}):this.#s.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#l(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#c({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#s?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#s)return this.#s.continueRetry(),this.#s.promise}if(e&&this.setOptions(e),!this.options.queryFn){const c=this.observers.find(l=>l.options.queryFn);c&&this.setOptions(c.options)}const r=new AbortController,n=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(this.#o=!0,r.signal)})},s=()=>{const c=Bn(this.options,t),u=(()=>{const h={client:this.#i,queryKey:this.queryKey,meta:this.meta};return n(h),h})();return this.#o=!1,this.options.persister?this.options.persister(c,u,this):c(u)},o=(()=>{const c={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:s};return n(c),c})();(this.#e==="infinite"?Oo(this.options.pages):this.options.behavior)?.onFetch(o,this),this.#r=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#c({type:"fetch",meta:o.fetchOptions?.meta}),this.#s=Gn({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:c=>{c instanceof Zt&&c.revert&&this.setState({...this.#r,fetchStatus:"idle"}),r.abort()},onFail:(c,l)=>{this.#c({type:"failed",failureCount:c,error:l})},onPause:()=>{this.#c({type:"pause"})},onContinue:()=>{this.#c({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{const c=await this.#s.start();if(c===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(c),this.#n.config.onSuccess?.(c,this),this.#n.config.onSettled?.(c,this.state.error,this),c}catch(c){if(c instanceof Zt){if(c.silent)return this.#s.promise;if(c.revert){if(this.state.data===void 0)throw c;return this.state.data}}throw this.#c({type:"error",error:c}),this.#n.config.onError?.(c,this),this.#n.config.onSettled?.(this.state.data,c,this),c}finally{this.scheduleGc()}}#c(e){const t=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Hn(r.data,this.options),fetchMeta:e.meta??null};case"success":const n={...r,...Vr(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#r=e.manual?n:void 0,n;case"error":const s=e.error;return{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=t(this.state),ae.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function Hn(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Un(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Vr(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function qr(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Ao=class extends it{constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.#a=Jt(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#r=void 0;#n=void 0;#i;#s;#a;#o;#l;#c;#p;#h;#f;#u;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Yr(this.#t,this.options)?this.#d():this.updateResult(),this.#v())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Xt(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Xt(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#w(),this.#S(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,r=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof be(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#C(),this.#t.setOptions(this.options),t._defaulted&&!Vt(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const n=this.hasListeners();n&&Jr(this.#t,r,this.options,t)&&this.#d(),this.updateResult(),n&&(this.#t!==r||be(this.options.enabled,this.#t)!==be(t.enabled,this.#t)||Ie(this.options.staleTime,this.#t)!==Ie(t.staleTime,this.#t))&&this.#y();const s=this.#g();n&&(this.#t!==r||be(this.options.enabled,this.#t)!==be(t.enabled,this.#t)||s!==this.#u)&&this.#b(s)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),r=this.createResult(t,e);return jo(this,r)&&(this.#n=r,this.#s=this.options,this.#i=this.#t.state),r}getCurrentResult(){return this.#n}trackResult(e,t){return new Proxy(e,{get:(r,n)=>(this.trackProp(n),t?.(n),n==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#a.status==="pending"&&this.#a.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),r=this.#e.getQueryCache().build(this.#e,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#n))}#d(e){this.#C();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(me)),t}#y(){this.#w();const e=Ie(this.options.staleTime,this.#t);if(Xe.isServer()||this.#n.isStale||!zt(e))return;const r=Dn(this.#n.dataUpdatedAt,e)+1;this.#h=De.setTimeout(()=>{this.#n.isStale||this.updateResult()},r)}#g(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#b(e){this.#S(),this.#u=e,!(Xe.isServer()||be(this.options.enabled,this.#t)===!1||!zt(this.#u)||this.#u===0)&&(this.#f=De.setInterval(()=>{(this.options.refetchIntervalInBackground||br.isFocused())&&this.#d()},this.#u))}#v(){this.#y(),this.#b(this.#g())}#w(){this.#h!==void 0&&(De.clearTimeout(this.#h),this.#h=void 0)}#S(){this.#f!==void 0&&(De.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){const r=this.#t,n=this.options,s=this.#n,i=this.#i,o=this.#s,c=e!==r?e.state:this.#r,{state:l}=e;let u={...l},h=!1,d;if(t._optimisticResults){const A=this.hasListeners(),I=!A&&Yr(e,t),$=A&&Jr(e,r,t,n);(I||$)&&(u={...u,...Hn(l.data,e.options)}),t._optimisticResults==="isRestoring"&&(u.fetchStatus="idle")}let{error:m,errorUpdatedAt:g,status:v}=u;d=u.data;let b=!1;if(t.placeholderData!==void 0&&d===void 0&&v==="pending"){let A;s?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(A=s.data,b=!0):A=typeof t.placeholderData=="function"?t.placeholderData(this.#p?.state.data,this.#p):t.placeholderData,A!==void 0&&(v="success",d=Yt(s?.data,A,t),h=!0)}if(t.select&&d!==void 0&&!b)if(s&&d===i?.data&&t.select===this.#l)d=this.#c;else try{this.#l=t.select,d=t.select(d),d=Yt(s?.data,d,t),this.#c=d,this.#o=null}catch(A){this.#o=A}this.#o&&(m=this.#o,d=this.#c,g=Date.now(),v="error");const R=u.fetchStatus==="fetching",E=v==="pending",P=v==="error",D=E&&R,T=d!==void 0,U={status:v,fetchStatus:u.fetchStatus,isPending:E,isSuccess:v==="success",isError:P,isInitialLoading:D,isLoading:D,data:d,dataUpdatedAt:u.dataUpdatedAt,error:m,errorUpdatedAt:g,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:u.dataUpdateCount>c.dataUpdateCount||u.errorUpdateCount>c.errorUpdateCount,isFetching:R,isRefetching:R&&!E,isLoadingError:P&&!T,isPaused:u.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:P&&T,isStale:Sr(e,t),refetch:this.refetch,promise:this.#a,isEnabled:be(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const A=U.data!==void 0,I=U.status==="error"&&!A,$=F=>{I?F.reject(U.error):A&&F.resolve(U.data)},G=()=>{const F=this.#a=U.promise=Jt();$(F)},L=this.#a;switch(L.status){case"pending":e.queryHash===r.queryHash&&$(L);break;case"fulfilled":(I||U.data!==L.value)&&G();break;case"rejected":(!I||U.error!==L.reason)&&G();break}}return U}updateResult(){const e=this.#n,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#s=this.options,this.#i.data!==void 0&&(this.#p=this.#t),Vt(t,e))return;this.#n=t;const r=()=>{if(!e)return!0;const{notifyOnChangeProps:n}=this.options,s=typeof n=="function"?n():n;if(s==="all"||!s&&!this.#m.size)return!0;const i=new Set(s??this.#m);return this.options.throwOnError&&i.add("error"),Object.keys(this.#n).some(o=>{const a=o;return this.#n[a]!==e[a]&&i.has(a)})};this.#E({listeners:r()})}#C(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#r=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#v()}#E(e){ae.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#n)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function _o(e,t){return be(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&be(t.retryOnMount,e)===!1)}function Yr(e,t){return _o(e,t)||e.state.data!==void 0&&Xt(e,t,t.refetchOnMount)}function Xt(e,t,r){if(be(t.enabled,e)!==!1&&Ie(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&Sr(e,t)}return!1}function Jr(e,t,r,n){return(e!==t||be(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Sr(e,r)}function Sr(e,t){return be(t.enabled,e)!==!1&&e.isStaleByTime(Ie(t.staleTime,e))}function jo(e,t){return!Vt(e.getCurrentResult(),t)}var Io=class extends Qn{#e;#t;#r;#n;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#r=e.mutationCache,this.#t=[],this.state=e.state||Mo(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#r.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#r.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#i({type:"continue"})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#n=Gn({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(i,o)=>{this.#i({type:"failed",failureCount:i,error:o})},onPause:()=>{this.#i({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#r.canRun(this)});const n=this.state.status==="pending",s=!this.#n.canStart();try{if(n)t();else{this.#i({type:"pending",variables:e,isPaused:s}),this.#r.config.onMutate&&await this.#r.config.onMutate(e,this,r);const o=await this.options.onMutate?.(e,r);o!==this.state.context&&this.#i({type:"pending",context:o,variables:e,isPaused:s})}const i=await this.#n.start();return await this.#r.config.onSuccess?.(i,e,this.state.context,this,r),await this.options.onSuccess?.(i,e,this.state.context,r),await this.#r.config.onSettled?.(i,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(i,null,e,this.state.context,r),this.#i({type:"success",data:i}),i}catch(i){try{await this.#r.config.onError?.(i,e,this.state.context,this,r)}catch(o){Promise.reject(o)}try{await this.options.onError?.(i,e,this.state.context,r)}catch(o){Promise.reject(o)}try{await this.#r.config.onSettled?.(void 0,i,this.state.variables,this.state.context,this,r)}catch(o){Promise.reject(o)}try{await this.options.onSettled?.(void 0,i,e,this.state.context,r)}catch(o){Promise.reject(o)}throw this.#i({type:"error",error:i}),i}finally{this.#r.runNext(this)}}#i(e){const t=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),ae.batch(()=>{this.#t.forEach(r=>{r.onMutationUpdate(e)}),this.#r.notify({mutation:this,type:"updated",action:e})})}};function Mo(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Lo=class extends it{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#r=0}#e;#t;#r;build(e,t,r){const n=new Io({client:e,mutationCache:this,mutationId:++this.#r,options:e.defaultMutationOptions(t),state:r});return this.add(n),n}add(e){this.#e.add(e);const t=pt(e);if(typeof t=="string"){const r=this.#t.get(t);r?r.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=pt(e);if(typeof t=="string"){const r=this.#t.get(t);if(r)if(r.length>1){const n=r.indexOf(e);n!==-1&&r.splice(n,1)}else r[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=pt(e);if(typeof t=="string"){const n=this.#t.get(t)?.find(s=>s.state.status==="pending");return!n||n===e}else return!0}runNext(e){const t=pt(e);return typeof t=="string"?this.#t.get(t)?.find(n=>n!==e&&n.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){ae.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(r=>Hr(t,r))}findAll(e={}){return this.getAll().filter(t=>Hr(e,t))}notify(e){ae.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return ae.batch(()=>Promise.all(e.map(t=>t.continue().catch(me))))}};function pt(e){return e.options.scope?.id}var ko=class extends it{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,r){const n=t.queryKey,s=t.queryHash??vr(n,t);let i=this.get(s);return i||(i=new To({client:e,queryKey:n,queryHash:s,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(n)}),this.add(i)),i}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){ae.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(r=>Qr(t,r))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(r=>Qr(e,r)):t}notify(e){ae.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){ae.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ae.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Do=class{#e;#t;#r;#n;#i;#s;#a;#o;constructor(e={}){this.#e=e.queryCache||new ko,this.#t=e.mutationCache||new Lo,this.#r=e.defaultOptions||{},this.#n=new Map,this.#i=new Map,this.#s=0}mount(){this.#s++,this.#s===1&&(this.#a=br.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#o=xt.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#s--,this.#s===0&&(this.#a?.(),this.#a=void 0,this.#o?.(),this.#o=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=this.#e.build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Ie(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(n.queryHash)?.state.data,o=yo(t,i);if(o!==void 0)return this.#e.build(this,n).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return ae.batch(()=>this.#e.findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;ae.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=this.#e;return ae.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=ae.batch(()=>this.#e.findAll(e).map(s=>s.cancel(r)));return Promise.all(n).then(me).catch(me)}invalidateQueries(e,t={}){return ae.batch(()=>(this.#e.findAll(e).forEach(r=>{r.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=ae.batch(()=>this.#e.findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,r);return r.throwOnError||(i=i.catch(me)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(n).then(me)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=this.#e.build(this,t);return r.isStaleByTime(Ie(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(me).catch(me)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(me).catch(me)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return xt.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#r}setDefaultOptions(e){this.#r=e}setQueryDefaults(e,t){this.#n.set(Ze(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#n.values()],r={};return t.forEach(n=>{Qe(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){this.#i.set(Ze(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#i.values()],r={};return t.forEach(n=>{Qe(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#r.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=vr(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===wr&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#r.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Kn=f.createContext(void 0),Fo=e=>{const t=f.useContext(Kn);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},No=({client:e,children:t})=>(f.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),p.jsx(Kn.Provider,{value:e,children:t})),Wn=f.createContext(!1),Bo=()=>f.useContext(Wn);Wn.Provider;function $o(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}
3var Uo=f.createContext($o()),Go=()=>f.useContext(Uo),Qo=(e,t,r)=>{const n=r?.state.error&&typeof e.throwOnError=="function"?$n(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},Ho=e=>{f.useEffect(()=>{e.clearReset()},[e])},Ko=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(s&&e.data===void 0||$n(r,[e.error,n])),Wo=e=>{if(e.suspense){const r=s=>s==="static"?s:Math.max(s??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...s)=>r(n(...s)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},zo=(e,t)=>e.isLoading&&e.isFetching&&!t,Vo=(e,t)=>e?.suspense&&t.isPending,Zr=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function qo(e,t,r){const n=Bo(),s=Go(),i=Fo(),o=i.defaultQueryOptions(e);i.getDefaultOptions().queries?._experimental_beforeQuery?.(o);const a=i.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=n?"isRestoring":c?"optimistic":void 0,Wo(o),Qo(o,s,a),Ho(s);const l=!i.getQueryCache().get(o.queryHash),[u]=f.useState(()=>new t(i,o)),h=u.getOptimisticResult(o),d=!n&&c;if(f.useSyncExternalStore(f.useCallback(m=>{const g=d?u.subscribe(ae.batchCalls(m)):me;return u.updateResult(),g},[u,d]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),f.useEffect(()=>{u.setOptions(o)},[o,u]),Vo(o,h))throw Zr(o,u,s);if(Ko({result:h,errorResetBoundary:s,throwOnError:o.throwOnError,query:a,suspense:o.suspense}))throw h.error;return i.getDefaultOptions().queries?._experimental_afterQuery?.(o,h),o.experimental_prefetchInRender&&!Xe.isServer()&&zo(h,n)&&(l?Zr(o,u,s):a?.promise)?.catch(me).finally(()=>{u.updateResult()}),o.notifyOnChangeProps?h:u.trackResult(h)}function ze(e,t){return qo(e,Ao)}const zn=f.createContext(null);function Yo(e){return e.language??e.region.locale.split("-")[0]}function Jo({config:e,children:t}){const r=f.useMemo(()=>({...e,language:Yo(e)}),[e]);return p.jsx(zn.Provider,{value:r,children:t})}function Te(){const e=f.useContext(zn);if(e===null)throw new Error("useBrandConfig must be used within BrandConfigProvider");return e}const Vn={GAMES_CATEGORY:"games_category"},et=new Map;function Zo(e,t){et.set(e,{...et.get(e),...t})}function Xo(e,t,r){const n=et.get(e.type),s=n?.map?n.map(e.data,t,r):e.data;return{type:e.type,data:s??e.data}}function ea(e,t,r){const n=et.get(e.type);return n?n.filter?n.filter(e.data,t,r):!0:!1}function ta(e){return et.get(e)?.component}const ee={STANDARD:"standard",GRID:"grid",SEASONAL:"seasonal",SPOTLIGHT:"spotlight",FEATURED:"featured",FEATURED_V2:"new-featured",PERSONALISED:"personalised",ARROWS:"arrows",TOPGAMES:"top",CIRCULAR:"circular"},qn={[ee.STANDARD]:"slider",[ee.GRID]:"grid",[ee.SEASONAL]:"load-more",[ee.SPOTLIGHT]:"spotlight",[ee.FEATURED]:"featured",[ee.FEATURED_V2]:"new-featured"},Cr=e=>{const t=document.cookie.split(";");for(const r of t){const[n,s]=r.split("=").map(i=>i.trim());if(n===e)return decodeURIComponent(s)}return""},Yn="login",ot=()=>!!Cr(Yn),ra=()=>{const e=Cr(Yn);return e?e.split(";")[0]:""};function na({layout:e,gameTiles:t}){return e?.includes(ee.PERSONALISED)&&ot()||!!t&&t.length>0}const at={SLOTS:"slots",BINGO:"bingo",CASINO:"casino",INSTANTS:"instants",JACKPOTS:"jackpots",TABLE:"table"},er="_alt",kt="join-now-active",sa=String(As),Er=new Set(sa.split(",").map(e=>Number(e.trim())).filter(e=>!Number.isNaN(e))),ia=30,oa=4,Jn=4,aa="search_games",ca=70,ua="bingo",Ot={LOGO:"logo",BG:"background"},Pt=(e,t)=>{const r=window.gpBrandConfig?.config?.lobby?.images,n=e?.replace(/[^a-zA-Z0-9]/g,""),s=n?`n-${n}_${t}`:`n-default_${t}`,i=r?.cache!=null?`&cache=${r.cache}`:"";return`tr=${s}&fm=webp${i}`};function Zn(e={}){const t=new Set(e.types??[]),r=new Set((e.games??[]).map(n=>Number(n)));return(n,s)=>!t.has(s)&&!r.has(Number(n))}const la=(e,t,r={})=>Zn(r)(e,t),Rr=e=>e.replace(/'/g,"'"),ha=(e,t)=>{const{read_more:r,game_type:n,type:s}=e,i=`/${de}/${n||s}`;if(r&&typeof r=="string")return`${i}/${r}`;if(r&&typeof r=="object"&&t){for(const[o,a]of Object.entries(r))if(a.includes(Number(t)))return`${i}/${o}`;return""}return""},Xn=(e,t,r={},n,s)=>{const i=ot(),o=!i&&s!=null&&Er.has(Number(s)),a=Zn(r),c=Pt(n,Ot.LOGO),l=Pt(n,Ot.BG);return e.filter(({game_id:u,id:h,game_type:d,type:m})=>a(Number(u||h),String(d||m))).map((u,h)=>{const{game_id:d,id:m,game_name:g,name:v,game_type:b,type:R,slug:E,ribbon:P}=u,D=Rr(String(g||v)),T=Number(d||m),k=window.gpBrandConfig?.gameInfoPopupEnabled,U=!i||k?ha(u,s):"",A={id:T,name:D,gameType:String(b||R),slug:E,logoUrl:`${Ct}/games/${T}/logo.png?${c}`,bgUrl:`${Ct}/games/${T}/bg${i?"":er}.jpg?${l}`,preloadImage:h<t,ribbon:P,readMoreUrl:U};return o&&(A.className=kt,A.preventNavigation=!0),A})};function es(e,t,r,n,s){const i=Xn(e,t,r,n,s);return{gameTiles:i,excludedCount:e.length-i.length}}const Fe=e=>e.replace(/^\/+|\/+$/g,""),fa=(e,t="-")=>e.toLowerCase().replace(/[^\w\s]/g,"").replace(/\s+/g,t),da=new Set(Object.values(at)),pa=e=>!!e&&da.has(e),ma={GAMES:"games"};function ya({type:e=ma.GAMES}){const t=n=>{window.lobbySlider?.(n.currentTarget,"prev",e)},r=n=>{window.lobbySlider?.(n.currentTarget,"next",e)};
3return p.jsxs("div",{className:"slider-controls",children:[p.jsx("div",{className:"arrow hide prev",role:"button",tabIndex:0,"data-testid":"sliderControls_prev",onClick:t,onKeyDown:n=>{(n.key==="Enter"||n.key===" ")&&t(n)}}),p.jsx("div",{className:"arrow next",role:"button",tabIndex:0,"data-testid":"sliderControls_next",onClick:r,onKeyDown:n=>{(n.key==="Enter"||n.key===" ")&&r(n)}})]})}var Gt={exports:{}},Xr;function ga(){return Xr||(Xr=1,(()=>{var e={296:(s,i,o)=>{var a=/^\s+|\s+$/g,c=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,u=/^0o[0-7]+$/i,h=parseInt,d=typeof o.g=="object"&&o.g&&o.g.Object===Object&&o.g,m=typeof self=="object"&&self&&self.Object===Object&&self,g=d||m||Function("return this")(),v=Object.prototype.toString,b=Math.max,R=Math.min,E=function(){return g.Date.now()};function P(T){var k=typeof T;return!!T&&(k=="object"||k=="function")}function D(T){if(typeof T=="number")return T;if((function(A){return typeof A=="symbol"||(function(I){return!!I&&typeof I=="object"})(A)&&v.call(A)=="[object Symbol]"})(T))return NaN;if(P(T)){var k=typeof T.valueOf=="function"?T.valueOf():T;T=P(k)?k+"":k}if(typeof T!="string")return T===0?T:+T;T=T.replace(a,"");var U=l.test(T);return U||u.test(T)?h(T.slice(2),U?2:8):c.test(T)?NaN:+T}s.exports=function(T,k,U){var A,I,$,G,L,F,N=0,Q=!1,V=!1,ce=!0;if(typeof T!="function")throw new TypeError("Expected a function");function ye(J){var se=A,le=I;return A=I=void 0,N=J,G=T.apply(le,se)}function ge(J){var se=J-F;return F===void 0||se>=k||se<0||V&&J-N>=$}function q(){var J=E();if(ge(J))return ue(J);L=setTimeout(q,(function(se){var le=k-(se-F);return V?R(le,$-(se-N)):le})(J))}function ue(J){return L=void 0,ce&&A?ye(J):(A=I=void 0,G)}function ne(){var J=E(),se=ge(J);if(A=arguments,I=this,F=J,se){if(L===void 0)return(function(le){return N=le,L=setTimeout(q,k),Q?ye(le):G})(F);if(V)return L=setTimeout(q,k),ye(F)}return L===void 0&&(L=setTimeout(q,k)),G}return k=D(k)||0,P(U)&&(Q=!!U.leading,$=(V="maxWait"in U)?b(D(U.maxWait)||0,k):$,ce="trailing"in U?!!U.trailing:ce),ne.cancel=function(){L!==void 0&&clearTimeout(L),N=0,A=F=I=L=void 0},ne.flush=function(){return L===void 0?G:ue(E())},ne}},96:(s,i,o)=>{var a="Expected a function",c=NaN,l="[object Symbol]",u=/^\s+|\s+$/g,h=/^[-+]0x[0-9a-f]+$/i,d=/^0b[01]+$/i,m=/^0o[0-7]+$/i,g=parseInt,v=typeof o.g=="object"&&o.g&&o.g.Object===Object&&o.g,b=typeof self=="object"&&self&&self.Object===Object&&self,R=v||b||Function("return this")(),E=Object.prototype.toString,P=Math.max,D=Math.min,T=function(){return R.Date.now()};function k(A){var I=typeof A;return!!A&&(I=="object"||I=="function")}function U(A){if(typeof A=="number")return A;if((function(G){return typeof G=="symbol"||(function(L){return!!L&&typeof L=="object"})(G)&&E.call(G)==l})(A))return c;if(k(A)){var I=typeof A.valueOf=="function"?A.valueOf():A;A=k(I)?I+"":I}if(typeof A!="string")return A===0?A:+A;A=A.replace(u,"");var $=d.test(A);return $||m.test(A)?g(A.slice(2),$?2:8):h.test(A)?c:+A}s.exports=function(A,I,$){var G=!0,L=!0;if(typeof A!="function")throw new TypeError(a);return k($)&&(G="leading"in $?!!$.leading:G,L="trailing"in $?!!$.trailing:L),(function(F,N,Q){var V,ce,ye,ge,q,ue,ne=0,J=!1,se=!1,le=!0;if(typeof F!="function")throw new TypeError(a);function Re(ie){var Se=V,pe=ce;return V=ce=void 0,ne=ie,ge=F.apply(pe,Se)}function ut(ie){var Se=ie-ue;return ue===void 0||Se>=N||Se<0||se&&ie-ne>=ye}function _e(){var ie=T();if(ut(ie))return Ve(ie);q=setTimeout(_e,(function(Se){var pe=N-(Se-ue);return se?D(pe,ye-(Se-ne)):pe})(ie))}function Ve(ie){return q=void 0,le&&V?Re(ie):(V=ce=void 0,ge)}function je(){var ie=T(),Se=ut(ie);if(V=arguments,ce=this,ue=ie,Se){if(q===void 0)return(function(pe){return ne=pe,q=setTimeout(_e,N),J?Re(pe):ge})(ue);if(se)return q=setTimeout(_e,N),Re(ue)}return q===void 0&&(q=setTimeout(_e,N)),ge}return N=U(N)||0,k(Q)&&(J=!!Q.leading,ye=(se="maxWait"in Q)?P(U(Q.maxWait)||0,N):ye,le="trailing"in Q?!!Q.trailing:le),je.cancel=function(){q!==void 0&&clearTimeout(q),ne=0,V=ue=ce=q=void 0},je.flush=function(){return q===void 0?ge:Ve(T())},je})(A,I,{leading:G,maxWait:I,trailing:L})}},703:(s,i,o)=>{var a=o(414);function c(){}function l(){}l.resetWarningCache=c,s.exports=function(){function u(m,g,v,b,R,E){if
3(E!==a){var P=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw P.name="Invariant Violation",P}}function h(){return u}u.isRequired=u;var d={array:u,bigint:u,bool:u,func:u,number:u,object:u,string:u,symbol:u,any:u,arrayOf:h,element:u,elementType:u,instanceOf:h,node:u,objectOf:h,oneOf:h,oneOfType:h,shape:h,exact:h,checkPropTypes:l,resetWarningCache:c};return d.PropTypes=d,d}},697:(s,i,o)=>{s.exports=o(703)()},414:s=>{s.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}},t={};function r(s){var i=t[s];if(i!==void 0)return i.exports;var o=t[s]={exports:{}};return e[s](o,o.exports,r),o.exports}r.n=s=>{var i=s&&s.__esModule?()=>s.default:()=>s;return r.d(i,{a:i}),i},r.d=(s,i)=>{for(var o in i)r.o(i,o)&&!r.o(s,o)&&Object.defineProperty(s,o,{enumerable:!0,get:i[o]})},r.g=(function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}})(),r.o=(s,i)=>Object.prototype.hasOwnProperty.call(s,i),r.r=s=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})};var n={};(()=>{r.r(n),r.d(n,{LazyLoadComponent:()=>Se,LazyLoadImage:()=>Os,trackWindowScroll:()=>ge});const s=Ps();var i=r.n(s),o=r(697);function a(){return typeof window<"u"&&"IntersectionObserver"in window&&"isIntersecting"in window.IntersectionObserverEntry.prototype}function c(C){return c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(y){return typeof y}:function(y){return y&&typeof Symbol=="function"&&y.constructor===Symbol&&y!==Symbol.prototype?"symbol":typeof y},c(C)}function l(C,y){var x=Object.keys(C);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(C);y&&(O=O.filter((function(H){return Object.getOwnPropertyDescriptor(C,H).enumerable}))),x.push.apply(x,O)}return x}function u(C,y,x){return(y=d(y))in C?Object.defineProperty(C,y,{value:x,enumerable:!0,configurable:!0,writable:!0}):C[y]=x,C}function h(C,y){for(var x=0;x<y.length;x++){var O=y[x];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(C,d(O.key),O)}}function d(C){var y=(function(x,O){if(c(x)!=="object"||x===null)return x;var H=x[Symbol.toPrimitive];if(H!==void 0){var K=H.call(x,"string");if(c(K)!=="object")return K;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(x)})(C);return c(y)==="symbol"?y:String(y)}function m(C,y){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(x,O){return x.__proto__=O,x},m(C,y)}function g(C){return g=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(y){return y.__proto__||Object.getPrototypeOf(y)},g(C)}var v=function(C){C.forEach((function(y){y.isIntersecting&&y.target.onVisible()}))},b={},R=(function(C){(function(w,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function");w.prototype=Object.create(S&&S.prototype,{constructor:{value:w,writable:!0,configurable:!0}}),Object.defineProperty(w,"prototype",{writable:!1}),S&&m(w,S)})(z,C);var y,x,O,H,K=(O=z,H=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})(),function(){var w,S=g(O);if(H){var M=g(this).constructor;w=Reflect.construct(S,arguments,M)}else w=S.apply(this,arguments);return(function(j,_){if(_&&(c(_)==="object"||typeof _=="function"))return _;if(_!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(W){if(W===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return W})(j)})(this,w)});function z(w){var S;if((function(j,_){if(!(j instanceof _))throw new TypeError("Cannot call a class as a function")})(this,z),(S=K.call(this,w)).supportsObserver=!w.scrollPosition&&w.useIntersectionObserver&&a(),S.supportsObserver){var M=w.threshold;S.observer=(function(j){return b[j]=b[j]||new IntersectionObserver(v,{rootMargin:j+"px"}),b[j]})(M)}return S}return y=z,x=[{key:"componentDidMount",value:function(){this.placeholder&&this.observer&&(this.placeholder.onVisible=this.props.onVisible,this.observer.observe(this.placeholder)),this.supportsObserver||this.updateVisibility()}},{key:"componentWillUnmount",value:function(){this.observer&&this.placeholder&&this.observer.unobserve(this.placeholder)}},{key:"componentDidUpdate",value:function(){this.supportsObserver||this.updateVisibility()}},{key:"getPlaceholderBoundingBox",value:function(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props.scrollPosition,S=this.placeholder.getBoundingClientRect(),M=this.placeholder.style,j=parseInt(M.getPropertyValue("margin-left"),10)||0,_=parseInt(M.getPropertyValue("margin-top"),10)||0;return{bottom:w.y+S.bottom+_,left:w.x+S.left+j,right:w.x+S.right+j,top:w.y+S.top+_}}},{key:"isPlaceholderInViewport",value:function(){if(typeof window>"u"||!this.placeholder)return!1;var w=this.props,S=w.scrollPosition,M=w.threshold,j=this.getPlaceholderBoundingBox(S),_=S.y+window.innerHeight,W=S.x,Z=S.x+window.innerWidth,X=S.y;return X-M<=j.bottom&&_+M>=j.top&&W-M<=j.right&&Z+M>=j.left}},{key:"updateVisibility",value:function(){this.isPlaceholderInViewport()&&this.props.onVisible()}},{key:"render",value:function(){var w=this,S=this.props,M=S.className,j=S.height,_=S.placeholder,W=S.style,Z=S.width;if(_&&typeof _.type!="function")return i().cloneElement(_,{ref:function(Y){return w.placeholder=Y}});var X=(function(Y){for(var oe=1;oe<arguments.length;oe++){var re=arguments[oe]!=null?arguments[oe]:{};
3oe%2?l(Object(re),!0).forEach((function(he){u(Y,he,re[he])})):Object.getOwnPropertyDescriptors?Object.defineProperties(Y,Object.getOwnPropertyDescriptors(re)):l(Object(re)).forEach((function(he){Object.defineProperty(Y,he,Object.getOwnPropertyDescriptor(re,he))}))}return Y})({display:"inline-block"},W);return Z!==void 0&&(X.width=Z),j!==void 0&&(X.height=j),i().createElement("span",{className:M,ref:function(Y){return w.placeholder=Y},style:X},_)}}],x&&h(y.prototype,x),Object.defineProperty(y,"prototype",{writable:!1}),z})(i().Component);R.propTypes={onVisible:o.PropTypes.func.isRequired,className:o.PropTypes.string,height:o.PropTypes.oneOfType([o.PropTypes.number,o.PropTypes.string]),placeholder:o.PropTypes.element,threshold:o.PropTypes.number,useIntersectionObserver:o.PropTypes.bool,scrollPosition:o.PropTypes.shape({x:o.PropTypes.number.isRequired,y:o.PropTypes.number.isRequired}),width:o.PropTypes.oneOfType([o.PropTypes.number,o.PropTypes.string])},R.defaultProps={className:"",placeholder:null,threshold:100,useIntersectionObserver:!0};const E=R;var P=r(296),D=r.n(P),T=r(96),k=r.n(T),U=function(C){var y=getComputedStyle(C,null);return y.getPropertyValue("overflow")+y.getPropertyValue("overflow-y")+y.getPropertyValue("overflow-x")};const A=function(C){if(!(C instanceof HTMLElement))return window;for(var y=C;y&&y instanceof HTMLElement;){if(/(scroll|auto)/.test(U(y)))return y;y=y.parentNode}return window};function I(C){return I=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(y){return typeof y}:function(y){return y&&typeof Symbol=="function"&&y.constructor===Symbol&&y!==Symbol.prototype?"symbol":typeof y},I(C)}var $=["delayMethod","delayTime"];function G(){return G=Object.assign?Object.assign.bind():function(C){for(var y=1;y<arguments.length;y++){var x=arguments[y];for(var O in x)Object.prototype.hasOwnProperty.call(x,O)&&(C[O]=x[O])}return C},G.apply(this,arguments)}function L(C,y){for(var x=0;x<y.length;x++){var O=y[x];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(C,(H=(function(K,z){if(I(K)!=="object"||K===null)return K;var w=K[Symbol.toPrimitive];if(w!==void 0){var S=w.call(K,"string");if(I(S)!=="object")return S;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(K)})(O.key),I(H)==="symbol"?H:String(H)),O)}var H}function F(C,y){return F=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(x,O){return x.__proto__=O,x},F(C,y)}function N(C,y){if(y&&(I(y)==="object"||typeof y=="function"))return y;if(y!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Q(C)}function Q(C){if(C===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C}function V(C){return V=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(y){return y.__proto__||Object.getPrototypeOf(y)},V(C)}var ce=function(){return typeof window>"u"?0:window.scrollX||window.pageXOffset},ye=function(){return typeof window>"u"?0:window.scrollY||window.pageYOffset};const ge=function(C){var y=(function(x){(function(M,j){if(typeof j!="function"&&j!==null)throw new TypeError("Super expression must either be null or a function");M.prototype=Object.create(j&&j.prototype,{constructor:{value:M,writable:!0,configurable:!0}}),Object.defineProperty(M,"prototype",{writable:!1}),j&&F(M,j)})(S,x);var O,H,K,z,w=(K=S,z=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})(),function(){var M,j=V(K);if(z){var _=V(this).constructor;M=Reflect.construct(j,arguments,_)}else M=j.apply(this,arguments);return N(this,M)});function S(M){var j;if((function(W,Z){if(!(W instanceof Z))throw new TypeError("Cannot call a class as a function")})(this,S),(j=w.call(this,M)).useIntersectionObserver=M.useIntersectionObserver&&a(),j.useIntersectionObserver)return N(j);var _=j.onChangeScroll.bind(Q(j));return M.delayMethod==="debounce"?j.delayedScroll=D()(_,M.delayTime):M.delayMethod==="throttle"&&(j.delayedScroll=k()(_,M.delayTime)),j.state={scrollPosition:{x:ce(),y:ye()}},j.baseComponentRef=i().createRef(),j}return O=S,(H=[{key:"componentDidMount",value:function(){this.addListeners()}},{key:"componentWillUnmount",value:function(){this.removeListeners()}},{key:"componentDidUpdate",value:function(){typeof window>"u"||this.useIntersectionObserver||A(this.baseComponentRef.current)!==this.scrollElement&&(this.removeListeners(),this.addListeners())}},{key:"addListeners",value:function(){typeof window>"u"||this.useIntersectionObserver||(this.scrollElement=A(this.baseComponentRef.current),this.scrollElement.addEventListener("scroll",this.delayedScroll,{passive:!0}),window.addEventListener("resize",this.delayedScroll,{passive:!0}),this.scrollElement!==window&&window.addEventListener("scroll",this.delayedScroll,{passive:!0}))}},{key:"removeListeners",value:function(){typeof window>"u"||this.useIntersectionObserver||(this.scrollElement.removeEventListener("scroll",this.delayedScroll),window.removeEventListener("resize",this.delayedScroll),this.scrollElement!==window&&window.removeEventListener("scroll",this.delayedScroll))}},{key:"onChangeScroll",value:function(){this.useIntersectionObserver||this.setState({scrollPosition:{x:ce(),y:ye()}})}},{key:"render",value:function(){var M=this.props,j=(M.delayMethod,M.delayTime,(function(W,Z){if(W==null)return{};
3var X,Y,oe=(function(he,$e){if(he==null)return{};var ke,ft,Lr={},kr=Object.keys(he);for(ft=0;ft<kr.length;ft++)ke=kr[ft],$e.indexOf(ke)>=0||(Lr[ke]=he[ke]);return Lr})(W,Z);if(Object.getOwnPropertySymbols){var re=Object.getOwnPropertySymbols(W);for(Y=0;Y<re.length;Y++)X=re[Y],Z.indexOf(X)>=0||Object.prototype.propertyIsEnumerable.call(W,X)&&(oe[X]=W[X])}return oe})(M,$)),_=this.useIntersectionObserver?null:this.state.scrollPosition;return i().createElement(C,G({forwardRef:this.baseComponentRef,scrollPosition:_},j))}}])&&L(O.prototype,H),Object.defineProperty(O,"prototype",{writable:!1}),S})(i().Component);return y.propTypes={delayMethod:o.PropTypes.oneOf(["debounce","throttle"]),delayTime:o.PropTypes.number,useIntersectionObserver:o.PropTypes.bool},y.defaultProps={delayMethod:"throttle",delayTime:300,useIntersectionObserver:!0},y};function q(C){return q=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(y){return typeof y}:function(y){return y&&typeof Symbol=="function"&&y.constructor===Symbol&&y!==Symbol.prototype?"symbol":typeof y},q(C)}function ue(C,y){for(var x=0;x<y.length;x++){var O=y[x];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(C,(H=(function(K,z){if(q(K)!=="object"||K===null)return K;var w=K[Symbol.toPrimitive];if(w!==void 0){var S=w.call(K,"string");if(q(S)!=="object")return S;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(K)})(O.key),q(H)==="symbol"?H:String(H)),O)}var H}function ne(C,y){return ne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(x,O){return x.__proto__=O,x},ne(C,y)}function J(C){return J=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(y){return y.__proto__||Object.getPrototypeOf(y)},J(C)}var se=(function(C){(function(w,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function");w.prototype=Object.create(S&&S.prototype,{constructor:{value:w,writable:!0,configurable:!0}}),Object.defineProperty(w,"prototype",{writable:!1}),S&&ne(w,S)})(z,C);var y,x,O,H,K=(O=z,H=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})(),function(){var w,S=J(O);if(H){var M=J(this).constructor;w=Reflect.construct(S,arguments,M)}else w=S.apply(this,arguments);return(function(j,_){if(_&&(q(_)==="object"||typeof _=="function"))return _;if(_!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(W){if(W===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return W})(j)})(this,w)});function z(w){return(function(S,M){if(!(S instanceof M))throw new TypeError("Cannot call a class as a function")})(this,z),K.call(this,w)}return y=z,(x=[{key:"render",value:function(){return i().createElement(E,this.props)}}])&&ue(y.prototype,x),Object.defineProperty(y,"prototype",{writable:!1}),z})(i().Component);const le=ge(se);function Re(C){return Re=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(y){return typeof y}:function(y){return y&&typeof Symbol=="function"&&y.constructor===Symbol&&y!==Symbol.prototype?"symbol":typeof y},Re(C)}function ut(C,y){for(var x=0;x<y.length;x++){var O=y[x];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(C,(H=(function(K,z){if(Re(K)!=="object"||K===null)return K;var w=K[Symbol.toPrimitive];if(w!==void 0){var S=w.call(K,"string");if(Re(S)!=="object")return S;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(K)})(O.key),Re(H)==="symbol"?H:String(H)),O)}var H}function _e(C,y){return _e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(x,O){return x.__proto__=O,x},_e(C,y)}function Ve(C){if(C===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C}function je(C){return je=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(y){return y.__proto__||Object.getPrototypeOf(y)},je(C)}var ie=(function(C){(function(w,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function");w.prototype=Object.create(S&&S.prototype,{constructor:{value:w,writable:!0,configurable:!0}}),Object.defineProperty(w,"prototype",{writable:!1}),S&&_e(w,S)})(z,C);var y,x,O,H,K=(O=z,H=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})(),function(){var w,S=je(O);if(H){var M=je(this).constructor;w=Reflect.construct(S,arguments,M)}else w=S.apply(this,arguments);return(function(j,_){if(_&&(Re(_)==="object"||typeof _=="function"))return _;if(_!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ve(j)})(this,w)});function z(w){var S;(function(Z,X){if(!(Z instanceof X))throw new TypeError("Cannot call a class as a function")})(this,z),S=K.call(this,w);var M=w.afterLoad,j=w.beforeLoad,_=w.scrollPosition,W=w.visibleByDefault;return S.state={visible:W},W&&(j(),M()),S.onVisible=S.onVisible.bind(Ve(S)),S.isScrollTracked=!!(_&&Number.isFinite(_.x)&&_.x>=0&&Number.isFinite(_.y)&&_.y>=0),S}return y=z,(x=[{key:"componentDidUpdate",value:function(w,S){S.visible!==this.state.visible&&this.props.afterLoad()}},{key:"onVisible",value:function(){this.props.beforeLoad(),this.setState({visible:!0})}},{key:"render",value:function(){if(this.state.visible)return this.props.children;var w=this.props,S=w.className,M=w.delayMethod,j=w.delayTime,_=w.height,W=w.placeholder,Z=w.scrollPosition,X=w.style,Y=w.threshold,oe=w.useIntersectionObserver,re=w.width;return this.isScrollTracked||oe&&a()?i().createElement(E,{className:S,height:_,onVisible:this.onVisible,placeholder:W,scrollPosition:Z,style:X,threshold:Y,useIntersectionObserver:oe,width:re}):i().createElement(le,{className:S,delayMethod:M,delayTime:j,height:_,onVisible:this.onVisible,placeholder:W,style:X,threshold:Y,width:re})}}
3])&&ut(y.prototype,x),Object.defineProperty(y,"prototype",{writable:!1}),z})(i().Component);ie.propTypes={afterLoad:o.PropTypes.func,beforeLoad:o.PropTypes.func,useIntersectionObserver:o.PropTypes.bool,visibleByDefault:o.PropTypes.bool},ie.defaultProps={afterLoad:function(){return{}},beforeLoad:function(){return{}},useIntersectionObserver:!0,visibleByDefault:!1};const Se=ie;function pe(C){return pe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(y){return typeof y}:function(y){return y&&typeof Symbol=="function"&&y.constructor===Symbol&&y!==Symbol.prototype?"symbol":typeof y},pe(C)}var Es=["afterLoad","beforeLoad","delayMethod","delayTime","effect","placeholder","placeholderSrc","scrollPosition","threshold","useIntersectionObserver","visibleByDefault","wrapperClassName","wrapperProps"];function jr(C,y){var x=Object.keys(C);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(C);y&&(O=O.filter((function(H){return Object.getOwnPropertyDescriptor(C,H).enumerable}))),x.push.apply(x,O)}return x}function Ir(C){for(var y=1;y<arguments.length;y++){var x=arguments[y]!=null?arguments[y]:{};y%2?jr(Object(x),!0).forEach((function(O){Rs(C,O,x[O])})):Object.getOwnPropertyDescriptors?Object.defineProperties(C,Object.getOwnPropertyDescriptors(x)):jr(Object(x)).forEach((function(O){Object.defineProperty(C,O,Object.getOwnPropertyDescriptor(x,O))}))}return C}function Rs(C,y,x){return(y=Mr(y))in C?Object.defineProperty(C,y,{value:x,enumerable:!0,configurable:!0,writable:!0}):C[y]=x,C}function lt(){return lt=Object.assign?Object.assign.bind():function(C){for(var y=1;y<arguments.length;y++){var x=arguments[y];for(var O in x)Object.prototype.hasOwnProperty.call(x,O)&&(C[O]=x[O])}return C},lt.apply(this,arguments)}function xs(C,y){for(var x=0;x<y.length;x++){var O=y[x];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(C,Mr(O.key),O)}}function Mr(C){var y=(function(x,O){if(pe(x)!=="object"||x===null)return x;var H=x[Symbol.toPrimitive];if(H!==void 0){var K=H.call(x,"string");if(pe(K)!=="object")return K;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(x)})(C);return pe(y)==="symbol"?y:String(y)}function Ft(C,y){return Ft=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(x,O){return x.__proto__=O,x},Ft(C,y)}function ht(C){return ht=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(y){return y.__proto__||Object.getPrototypeOf(y)},ht(C)}var Nt=(function(C){(function(w,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function");w.prototype=Object.create(S&&S.prototype,{constructor:{value:w,writable:!0,configurable:!0}}),Object.defineProperty(w,"prototype",{writable:!1}),S&&Ft(w,S)})(z,C);var y,x,O,H,K=(O=z,H=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})(),function(){var w,S=ht(O);if(H){var M=ht(this).constructor;w=Reflect.construct(S,arguments,M)}else w=S.apply(this,arguments);return(function(j,_){if(_&&(pe(_)==="object"||typeof _=="function"))return _;if(_!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(W){if(W===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return W})(j)})(this,w)});function z(w){var S;return(function(M,j){if(!(M instanceof j))throw new TypeError("Cannot call a class as a function")})(this,z),(S=K.call(this,w)).state={loaded:!1},S}return y=z,(x=[{key:"onImageLoad",value:function(){var w=this;return this.state.loaded?null:function(S){w.props.onLoad(S),w.props.afterLoad(),w.setState({loaded:!0})}}},{key:"getImg",value:function(){var w=this.props,S=(w.afterLoad,w.beforeLoad,w.delayMethod,w.delayTime,w.effect,w.placeholder,w.placeholderSrc,w.scrollPosition,w.threshold,w.useIntersectionObserver,w.visibleByDefault,w.wrapperClassName,w.wrapperProps,(function(M,j){if(M==null)return{};var _,W,Z=(function(Y,oe){if(Y==null)return{};var re,he,$e={},ke=Object.keys(Y);for(he=0;he<ke.length;he++)re=ke[he],oe.indexOf(re)>=0||($e[re]=Y[re]);return $e})(M,j);if(Object.getOwnPropertySymbols){var X=Object.getOwnPropertySymbols(M);for(W=0;W<X.length;W++)_=X[W],j.indexOf(_)>=0||Object.prototype.propertyIsEnumerable.call(M,_)&&(Z[_]=M[_])}return Z})(w,Es));return i().createElement("img",lt({},S,{onLoad:this.onImageLoad()}))}},{key:"getLazyLoadImage",value:function(){var w=this.props,S=w.beforeLoad,M=w.className,j=w.delayMethod,_=w.delayTime,W=w.height,Z=w.placeholder,X=w.scrollPosition,Y=w.style,oe=w.threshold,re=w.useIntersectionObserver,he=w.visibleByDefault,$e=w.width;return i().createElement(Se,{beforeLoad:S,className:M,delayMethod:j,delayTime:_,he
3ight:W,placeholder:Z,scrollPosition:X,style:Y,threshold:oe,useIntersectionObserver:re,visibleByDefault:he,width:$e},this.getImg())}},{key:"getWrappedLazyLoadImage",value:function(w){var S=this.props,M=S.effect,j=S.height,_=S.placeholderSrc,W=S.width,Z=S.wrapperClassName,X=S.wrapperProps,Y=this.state.loaded,oe=Y?" lazy-load-image-loaded":"",re=Y||!_?{}:{backgroundImage:"url(".concat(_,")"),backgroundSize:"100% 100%"};return i().createElement("span",lt({className:Z+" lazy-load-image-background "+M+oe,style:Ir(Ir({},re),{},{color:"transparent",display:"inline-block",height:j,width:W})},X),w)}},{key:"render",value:function(){var w=this.props,S=w.effect,M=w.placeholderSrc,j=w.visibleByDefault,_=w.wrapperClassName,W=w.wrapperProps,Z=this.getLazyLoadImage();return(S||M)&&!j||_||W?this.getWrappedLazyLoadImage(Z):Z}}])&&xs(y.prototype,x),Object.defineProperty(y,"prototype",{writable:!1}),z})(i().Component);Nt.propTypes={onLoad:o.PropTypes.func,afterLoad:o.PropTypes.func,beforeLoad:o.PropTypes.func,delayMethod:o.PropTypes.string,delayTime:o.PropTypes.number,effect:o.PropTypes.string,placeholderSrc:o.PropTypes.string,threshold:o.PropTypes.number,useIntersectionObserver:o.PropTypes.bool,visibleByDefault:o.PropTypes.bool,wrapperClassName:o.PropTypes.string,wrapperProps:o.PropTypes.object},Nt.defaultProps={onLoad:function(){},afterLoad:function(){return{}},beforeLoad:function(){return{}},delayMethod:"throttle",delayTime:300,effect:"",placeholderSrc:null,threshold:100,useIntersectionObserver:!0,visibleByDefault:!1,wrapperClassName:""};const Os=Nt})(),Gt.exports=n})()),Gt.exports}var ba=ga();const va=100;function en({src:e,alt:t,onLoad:r,onError:n,threshold:s=va,className:i="",lazy:o=!1,...a}){const c=()=>{typeof r=="function"&&r()},l=()=>{typeof n=="function"&&n()};return o?p.jsx(ba.LazyLoadImage,{src:e,alt:t,onLoad:c,onError:l,className:i,threshold:s,...a}):p.jsx("img",{src:e,alt:t,onLoad:c,onError:l,className:i,...a})}function wa(){return p.jsx("div",{className:"global-overlay",role:"status","aria-label":"Loading",children:p.jsx("div",{className:"global-spinner","data-testid":"spinner"})})}function Sa({size:e=24,...t}){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",fill:"none",...t,children:p.jsx("path",{d:"M11 17H13V11H11V17ZM12 9C12.2833 9 12.5208 8.90417 12.7125 8.7125C12.9042 8.52083 13 8.28333 13 8C13 7.71667 12.9042 7.47917 12.7125 7.2875C12.5208 7.09583 12.2833 7 12 7C11.7167 7 11.4792 7.09583 11.2875 7.2875C11.0958 7.47917 11 7.71667 11 8C11 8.28333 11.0958 8.52083 11.2875 8.7125C11.4792 8.90417 11.7167 9 12 9ZM12 22C10.6167 22 9.31667 21.7375 8.1 21.2125C6.88333 20.6875 5.825 19.975 4.925 19.075C4.025 18.175 3.3125 17.1167 2.7875 15.9C2.2625 14.6833 2 13.3833 2 12C2 10.6167 2.2625 9.31667 2.7875 8.1C3.3125 6.88333 4.025 5.825 4.925 4.925C5.825 4.025 6.88333 3.3125 8.1 2.7875C9.31667 2.2625 10.6167 2 12 2C13.3833 2 14.6833 2.2625 15.9 2.7875C17.1167 3.3125 18.175 4.025 19.075 4.925C19.975 5.825 20.6875 6.88333 21.2125 8.1C21.7375 9.31667 22 10.6167 22 12C22 13.3833 21.7375 14.6833 21.2125 15.9C20.6875 17.1167 19.975 18.175 19.075 19.075C18.175 19.975 17.1167 20.6875 15.9 21.2125C14.6833 21.7375 13.3833 22 12 22ZM12 20C14.2333 20 16.125 19.225 17.675 17.675C19.225 16.125 20 14.2333 20 12C20 9.76667 19.225 7.875 17.675 6.325C16.125 4.775 14.2333 4 12 4C9.76667 4 7.875 4.775 6.325 6.325C4.775 7.875 4 9.76667 4 12C4 14.2333 4.775 16.125 6.325 17.675C7.875 19.225 9.76667 20 12 20Z"})})}function Tt(e){const{id:t,name:r,slug:n,logoUrl:s,bgUrl:i,preloadImage:o,children:a,position:c,categoryName:l,categoryPosition:u,ribbon:h,type:d="standard",containerClassName:m,readMoreUrl:g,isSearchTile:v,preventNavigation:b,className:R,displayPosition:E,circularTile:P}=e,[D,T]=f.useState(i),[k,U]=f.useState(!1),[A,I]=f.useState(!1),[$,G]=f.useState(!1),L={"data-n":r,"data-p":c,"data-cn":l,"data-cp":u},F=window.gpBrandConfig?.gameInfoPopupEnabled??!1,N=f.useMemo(()=>h?h.toLowerCase().replace(/\s+/g,"_"):"",[h]),Q=f.useMemo(()=>v?`/slots/${n}?smt=${n}`:`/slots/${n}`,[n,v]),V=()=>{U(!0)},ce=()=>{I(!0)},ye=()=>{D.includes(er)?T(D.replace(er,"")):I(!0)},ge=()=>{b||G(!0)},q=ne=>{ne.preventDefault(),ne.stopPropagation(),window.GameInfoPopup?.show(t)};function ue(ne,J,se){const le=R?`${J} ${R}`:J;return b?p.jsx("div",{...L,className:le,children:ne}):p.jsx("a",{...L,className:le,href:Q,rel:"nofollow","data-testid":se,onClick:ge,children:ne})}return p.jsxs("div",{className:xe("game-tile",P&&"circular"),children:[p.jsxs("div",{className:xe("game",m&&m,P&&"circular",k&&"loaded",A&&"error",E&&"with-position"),children:[a,d==="standard"&&p.jsxs("div",{className:"info",children:[ue("Play now","play-now-button btn btn-primary","gameTile_playNow"),g&&!F&&p.jsx("a",{href:g,className:"read-more-link","data-testid":"gameTile_readMore",children:"Read more"})]}),d==="standard"&&p.jsx(p.Fragment,{children:ue("","play-now","gameTile_playOverlay")}),p.jsxs("div",{className:"image",children:[ue(p.jsx(en,{className:"logo",alt:`${r} Logo`,src:s,onLoad:V,onError:ce,lazy:!o,...L}),"logo-container"),p.jsx(en,{className:"bg",alt:r,src:D,onLoad:V,onError:ye,lazy:!o}),p.jsx("span",{children:r})]})]}),$&&p.jsx(wa,{}),E&&p.jsx("span",{className:"position-badge",children:c}),h&&p.jsx("span",{className:"ribbon","data-ribbon":N,children:h}),F&&g&&d==="standard"&&p.jsx("a",{href:g,className:"game__info-icon",onClick:q,"data-testid":"gameTile_infoIcon",children:p.jsxs("span",{className:"info-icon",children:[p.jsx("span",{className:"info-icon__bg"}),p.jsx(Sa,{})]})})]})}const tr=1e3,Ye=60*tr,vt=60*Ye,ts=24*vt,Ca=e=>e<0?"Ended":e<Ye?`${Math.floor(e/tr)}s`:e<vt?`${Math.floor(e/Ye)}m ${Math.floor(e%Ye/tr)}s`:e<ts?`${Math.floor(e/vt)}h ${Math.floor(e%vt/Ye)}m`:"";function Ea(e){const{timer:t,timerDate:r,players:n,prize:s,...i}=e,[o,a]=f.useState(""),c=f.useCallback(()=>
3{if(!t)return"";const l=t-Date.now();return l>=ts&&r?r:Ca(l)},[t,r]);return f.useEffect(()=>{if(t&&r){const l=setInterval(()=>{a(c())},1e3);return a(c()),()=>clearInterval(l)}},[t,r,c]),p.jsx(Tt,{containerClassName:"bingo",...i,children:p.jsxs("div",{className:"bingo-info",children:[s&&p.jsx("div",{className:"bingo-prize",children:s}),n&&p.jsx("div",{className:"bingo-players",children:n}),o&&p.jsx("div",{className:"bingo-next-game",children:o})]})})}const Ra=(e,t)=>`/${de}${t&&t!==de?`/${t}`:""}${e?`/${e}`:""}`;function ct(e){const{name:t,games:r,totalGames:n,slug:s,primaryCategorySlug:i,position:o,layout:a=[],viewAllText:c="View All"}=e,[l,u]=f.useState(!1),{secondarySlug:h}=Be(),d=n>0&&(a.includes(ee.GRID)&&!i||h),m=!l&&a.includes(ee.SEASONAL),g=!d&&n>(r?.length||0),v=a.includes(ee.CIRCULAR),b=a.includes(ee.TOPGAMES),R=a.includes(ee.STANDARD)||a.includes(ee.FEATURED)||a.includes(ee.ARROWS)||a.includes(ee.CIRCULAR)||a.includes(ee.TOPGAMES);return r.length?p.jsxs("div",{className:xe("game-grid",a.map(E=>qn[E]||E),l&&"open"),"data-theme":fa(t,"_"),children:[p.jsxs("div",{className:"top-bar",children:[p.jsx("h3",{className:"title",children:t}),d&&p.jsx("div",{className:"games-counter",children:n}),g&&p.jsx(We,{className:"link",to:Ra(s,i),"data-testid":"gamesCategory_viewAll","data-a":"view-all-link",children:c})]}),p.jsxs("div",{className:"game-grid-container",children:[R&&p.jsx(ya,{}),p.jsxs("div",{className:"games-container",children:[m&&p.jsx("div",{className:"load-more-button",children:p.jsx("p",{role:"button",tabIndex:0,"data-testid":"gamesCategory_showMore","data-a":"show-more-button",onClick:()=>u(!0),onKeyDown:E=>{(E.key==="Enter"||E.key===" ")&&u(!0)},children:"Show More"})}),r.map((E,P)=>E.gameType===at.BINGO?p.jsx(Ea,{...E,position:P+1,categoryName:t,categoryPosition:o},E.slug+P):p.jsx(Tt,{...E,position:P+1,categoryName:t,categoryPosition:o,displayPosition:b,circularTile:v},E.slug+P))]})]})]}):null}const xa={UK:"United Kingdom"},Oa={GBP:"GBP"},Pa="brands_ui_";function Ta(e,t){window.newrelic?.addPageAction&&window.newrelic.addPageAction(`${Pa}${e}`,t)}function Aa(e){window.newrelic?.noticeError&&window.newrelic.noticeError(e)}const Ne={action:Ta,error:Aa};function rs(e,t){if(!e)throw new Error(`${t}: legacy bridge returned no response`);if(!e.ok)throw new Error(`${t}, status: ${e.status}`)}function tn(e){return(...t)=>{try{return e.apply(null,t)}catch(r){console.error(`Legacy Bridge execution error: ${e?.name} :`,r)}}}function _a(){return window.legacyBridge.fetchBingoFeed()}function ja(e){return window.legacyBridge.fetchRecentlyPlayedGames(JSON.stringify(e))}const ns={fetchBingoFeed:tn(_a),fetchRecentlyPlayedGames:tn(ja)},Ia=1e4;async function Ma(){const e=await ns.fetchBingoFeed();return rs(e,"Bingo fetch error"),e.json()}function La(){return ze({queryKey:["lobby-bingo-feed"],queryFn:Ma,refetchInterval:Ia})}function ss(e){const{category_name:t,layout:r,total_games:n,gameTiles:s,slug:i,primary_category_slug:o,position:a}=e,{region:c}=Te(),{data:l,isFetching:u,error:h}=La(),[d,m]=f.useState(s);return f.useEffect(()=>{!l||u||m(s.map(g=>{const v=l[`key${g.id}`];if(!v?.length)return g;const{prize:b,players:R,timer:E,timerdate:P}=v[0];return{...g,prize:c.currencyCode===Oa.GBP?b:"",players:R,timer:Number(E),timerDate:P}}))},[l,u,s,c.currencyCode]),f.useEffect(()=>{h&&Ne.error(h)},[h]),p.jsx(ct,{name:t,layout:r,totalGames:n,games:d,slug:i,primaryCategorySlug:o,position:a})}function is(e,t=10){const[r,n]=f.useState(1),[s,i]=f.useState(e.length);e.length<s?(r!==1&&n(1),i(e.length)):e.length>s&&i(e.length);const o=f.useMemo(()=>e.slice(0,r*t),[e,r,t]),a=f.useCallback(c=>{c[0].isIntersecting&&o.length<e.length&&n(u=>u+1)},[o.length,e.length]);return{displayedItems:o,handleObserver:a,hasMore:o.length<e.length}}function ka(e,t,r=[]){f.useEffect(()=>{const n=e.current;if(!n)return;const s=n.querySelector(t);s&&s.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})},[e,t,...r])}function os(){const{pathname:e}=we();f.useEffect(()=>{window.scrollTo(0,0)},[e])}class as extends Error{statusCode;constructor(t,r){super(t),this.statusCode=r,this.name="ApiError"}}async function Dt(e){const t=await fetch(e),r=t.status;if(!t.ok)throw new as(`HTTP error! status: ${r}`,r);return{data:await t.json(),statusCode:r}}const Da=new Do({defaultOptions:{queries:{retry:2,staleTime:1e3*60*60,gcTime:1e3*60*60}}});async function Fa(e){const{data:t}=await Dt(e);return{data:(t?.content??[]).find(n=>n.type===Vn.GAMES_CATEGORY)?.data}}function Na({brandConfig:e,primarySlug:t,secondarySlug:r}){const n=`${t??""}/${r??""}`,[s,i]=f.useState(1),[o,a]=f.useState(n);o!==n&&(a(n),i(1));const c=e.region.id,{id:l,directory:u}=e.lobby||{},h=fn({primarySlug:t,secondarySlug:r,page:s,lobbyId:l,directory:u,regionId:c}),{data:d,error:m}=ze({queryKey:["games-category",h],queryFn:()=>Fa(h),placeholderData:Nn,select:v=>v.data,enabled:s>1}),g=f.useCallback(()=>{i(v=>v+1)},[]);return{data:d,loadNextPage:g,error:m??null}}function Ba(e){const{category_name:t,layout:r,total_games:n,gameTiles:s,slug:i,primary_category:o,primary_category_slug:a,position:c}=e,l=Te(),{primarySlug:u,secondarySlug:h}=Be(),d=`${u??""}/${h??""}`,{data:m,loadNextPage:g,error:v}=Na({brandConfig:l,primarySlug:u,secondarySlug:h}),[b,R]=f.useState([]),[E,P]=f.useState(0),[D,T]=f.useState(!1),k=n-E,U=!D&&k>b.length;f.useEffect(()=>{R(s),P(0),T(!1)},[d,s]),f.useEffect(()=>{if(!m)return;const F=m.games??[];if(F.length===0){T(!0);return}const{gameTiles:N,excludedCount:Q}=es(F,0,l.lobby?.exclusions,r[0]??"",l.id);P(V=>V+Q),R(V=>[...V,...N])},[m,l.lobby?.exclusions,r,l.id]);const A=f.useCallback(async()=>{await g()},[g]),{displayedItems:I,handleObserver:$,hasMore:G}=is(b),L=f.useRef(null);return f.useEffect(()=>{const F=new IntersectionObserver(N=>{$(N),N[0]?.isIntersecting&&!G&&U&&A()},{root:null,rootMargin:"200px",threshold:.5});return L.current&&F.observe(L.current),()=>F.disconnect()},[U,b.length,$,G,A]),f.useEffect(()=>{v&&Ne.action("lobby_pagination_failed",{message:String(v)}
3)},[v]),p.jsxs(p.Fragment,{children:[p.jsx(ct,{name:t,layout:r,totalGames:n,games:I,slug:i,primaryCategorySlug:a,primaryCategory:o,position:c}),!v&&U&&p.jsx("div",{ref:L,className:"pagination-loader",children:p.jsx("p",{children:"Loading more..."})})]})}function cs({style:e}){return p.jsx("div",{className:"skeleton",style:e})}function $a(){return p.jsx("div",{className:"game-tile",children:p.jsx("div",{className:"game"})})}const us={GAMES:"game"},Ua={[us.GAMES]:$a};function ls({type:e=us.GAMES,layout:t=[]}){const r=Ua[e];return p.jsxs("div",{className:xe(`${e}-grid`,t.map(n=>qn[n]||n)),children:[p.jsx("div",{className:"top-bar",children:p.jsx(cs,{})}),p.jsx("div",{className:`${e}-grid-container`,children:p.jsxs("div",{className:`${e}s-container`,children:[p.jsx(r,{}),p.jsx(r,{}),p.jsx(r,{}),p.jsx(r,{}),p.jsx(r,{}),p.jsx(r,{})]})})]})}async function Ga({accountId:e,exclusions:t,brandId:r}){const n=await ns.fetchRecentlyPlayedGames({accountId:e});rs(n,"Recently played games fetch error");const s=await n.json(),i=s?.games?.map(({id:o,name:a,slug:c,type:l})=>({id:o,name:a,type:l,slug:c}));return{personal:s?.personal,games:Xn(i??[],Jn,t,ee.PERSONALISED,r)}}function Qa({exclusions:e={}}={}){const t=ra(),r=Te();return ze({queryKey:["games-personalisation",t,e,r.id],queryFn:()=>Ga({accountId:t,exclusions:e,brandId:r.id})})}const Ha="Popular";function Ka(e){const{category_name:t,layout:r,total_games:n,slug:s,primary_category:i,primary_category_slug:o,position:a}=e,{lobby:c}=Te(),{data:l,isLoading:u,error:h}=Qa({exclusions:c?.exclusions});if(f.useEffect(()=>{h&&Ne.action("games_personalisation_error",{message:String(h)})},[h]),u)return p.jsx(ls,{layout:r});const{games:d,personal:m}=l||{};if(!d?.length)return null;const g=m?t:Ha;return d.find(b=>b.gameType===at.BINGO)?p.jsx(ss,{...e,category_name:g,gameTiles:d,position:a}):p.jsx(ct,{name:g,layout:r,totalGames:n,games:d,slug:s,primaryCategorySlug:o,primaryCategory:i,position:a})}function Wa({position:e,data:t}){const r=t,{category_name:n,layout:s,total_games:i,gameTiles:o,slug:a,primary_category:c,primary_category_slug:l}=r,{secondarySlug:u}=Be(),h=o?.find(m=>m.gameType===at.BINGO),d=i>ia&&(u||s.includes(ee.GRID)&&!l);return s.includes(ee.PERSONALISED)?p.jsx(Ka,{...r,position:e}):d?p.jsx(Ba,{...r,position:e}):h?p.jsx(ss,{...r,position:e}):p.jsx(ct,{name:n,layout:s,totalGames:i,games:o,slug:a,primaryCategorySlug:l,primaryCategory:c,position:e})}function za(e,t,r){const{exclusions:n={}}=r.lobby||{},s=e.display_layout?.split(",")||[],{gameTiles:i,excludedCount:o}=es(e.games||[],t<oa?Jn:0,n,s[0]??"",r.id),a=(e.slug||"").split("/").filter(u=>u),c=a.length>1?a[0]:"",l=a.length>1?a[1]:a[0]??e.slug;return{...e,category_name:String(e.category_name||e.name),gameTiles:i,layout:s,total_games:o>0?e.total_games-o:e.total_games,slug:l||"",primary_category_slug:c||""}}function Va(){Zo(Vn.GAMES_CATEGORY,{map:(e,t,r)=>za(e,t,r),filter:e=>na(e),component:Wa})}class qa extends f.Component{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t){Ne.error(t)}handleRefresh=()=>{window.location.reload()};render(){return this.state.hasError?this.props.fallback||p.jsxs("div",{className:"lobby-error",id:"error-react",children:[p.jsx("div",{className:"error-icon"}),p.jsx("h2",{children:"Oops, something went wrong."}),p.jsx("p",{children:"Please check your internet connection, refresh the page or head to the games page."}),p.jsx("div",{className:"button",role:"button",tabIndex:0,"data-testid":"errorBoundary_refresh",onClick:this.handleRefresh,onKeyDown:t=>{(t.key==="Enter"||t.key===" ")&&this.handleRefresh()},children:"Refresh"})]}):this.props.children}}function Ya({gamesButtonLabel:e,gamesButtonUrl:t,showBackToTopButton:r=!0}){const{pathname:n}=we(),s=Fe(n)!==Fe(t),i=o=>{o.preventDefault(),window.scrollTo({top:0,left:0,behavior:"smooth"})};return p.jsxs("div",{className:"lobby-action-buttons",children:[s&&p.jsx(We,{to:t,"data-testid":"bottomBar_gamesLink",children:e}),r&&p.jsx("a",{href:"#","data-testid":"bottomBar_backToTop",onClick:i,children:"Back to the top"})]})}const Ja="online-slots",Za="online-bingo",Xa="jackpot-games",ec="hot-slots",tc={},hs=e=>(e||"").toLowerCase()===ua;async function rc(e,t,r){const{data:n}=await Dt(e);return(n??[]).filter(({name:i})=>!(t?.tabs||[]).includes(i)).map(({name:i,url:o})=>{if(hs(i)&&r)return{label:i,url:r,allowedUrl:r,fullUrl:r,external:!0};const a=o.split("/").filter(c=>c).map(c=>tc[c]||c).join("/");return{label:i,url:o,allowedUrl:`/${a}`,fullUrl:`/${de}/${a}`,external:!1}})}function xr({lobbyId:e,directory:t,regionId:r,exclusions:n={},bingoLobbyUrl:s}){return ze({queryKey:["casino-menu",e,t,r,n,s],queryFn:()=>{const a=`${pn({lobbyId:e,directory:t,regionId:r})}/casino-menu.json?${dn()}`;return rc(a,n,s)},placeholderData:Nn})}function nc({position:e,type:t,data:r}){const n=ta(t);return n?p.jsx(n,{position:e,data:r}):null}function sc(){const{primarySlug:e}=Be();return p.jsx(We,{"data-testid":"backButton_nav",to:`/${e?`${de}/${e}`:de}`,className:"back-button"})}function ic({results:e,title:t,totalGames:r,preventNavigation:n,className:s}){function i(o,a){return n?p.jsxs("div",{className:xe(s,kt,"result","cursor-pointer"),"data-testid":`gameSearchList_result_${o}
3`,"data-n":a.name,"data-p":o+1,"data-cn":t,"data-cp":1,children:[p.jsx(Tt,{...a,position:o+1,categoryName:t,categoryPosition:1,type:"search",isSearchTile:!0,preventNavigation:!0}),p.jsx("span",{children:a.name})]},a.name+o):p.jsxs("a",{href:`/slots/${a.slug}?smt=${a.slug}`,className:xe(s,"result"),"data-testid":`gameSearchList_result_${o}`,"data-n":a.name,"data-p":o+1,"data-cn":t,"data-cp":1,children:[p.jsx(Tt,{...a,position:o+1,categoryName:t,categoryPosition:1,type:"search",isSearchTile:!0,preventNavigation:!0}),p.jsx("span",{children:a.name})]},a.name+o)}return p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"search-top-bar",children:[p.jsx("h3",{className:"title",children:t}),r>0&&p.jsxs("div",{id:"results",children:[p.jsx("span",{children:r})," Game",r>1&&"s"]})]}),p.jsx("div",{className:"results-list",children:!!e.length&&e.map((o,a)=>i(a,o))})]})}function oc({primarySlug:e,secondarySlug:t}){const n=t||[Za,Xa,ec].includes(e||"")?ee.GRID:e===de||!e?ee.SPOTLIGHT:ee.STANDARD;return p.jsx(ls,{layout:[n]})}const ac=(e,t,r,n)=>{const s=Fe(e),i=Fe(t),o=Fe(r);return s===""||s===de?n===0:s===i||s===o},cc=e=>e.trim().toLowerCase().replace(/&/g,"and").replace(/\s+/g,"-");function uc({fullUrl:e,label:t,isActive:r,position:n,external:s}){const i=cc(t);return p.jsx(We,{to:e,className:xe("game-category",r&&"active"),id:i,reloadDocument:s,rel:s?"nofollow":void 0,"data-testid":`navigationBar_tab_${i}`,"data-tab-position":n,children:p.jsx("span",{children:t})})}function lc({elements:e,isLoading:t=!1}){const r=we();return p.jsxs("div",{id:"game-categories",children:[t&&p.jsx(cs,{}),e?.length>0?e.map((n,s)=>p.jsx(uc,{...n,isActive:ac(r.pathname,n.fullUrl,n.url,s),position:s+1},`${n.fullUrl}-${s}`)):null]})}function hc({onInputChange:e,placeholder:t="Search for games",onFocus:r,value:n="",onClear:s}){const[i,o]=f.useState(n),[a,c]=f.useState(n),l=f.useRef(null),[u,h]=f.useState(!1),d=()=>{o(""),e({target:{value:""}}),s?.(),h(!1)},m=b=>{o(b.target.value),e(b)},g=()=>{h(!0),r?.()};n!==a&&(c(n),o(n));const v=!!i||u;return p.jsx("div",{id:"lobby-search","data-testid":"searchBar_form",children:p.jsxs("div",{className:"search-input-wrapper",children:[p.jsx("input",{name:"game-search",id:"game-search",type:"text",autoComplete:"off",ref:l,"data-testid":"searchBar_input",onTouchStart:g,onFocus:g,value:i,onChange:m,placeholder:t}),v&&p.jsxs("div",{className:xe("clear-input",v&&"active"),onClick:d,role:"button",tabIndex:0,"aria-label":"Clear input","data-testid":"searchBar_clear",onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&d()},children:[p.jsx("span",{}),p.jsx("span",{})]})]})})}function Me(e){return Array.isArray?Array.isArray(e):ds(e)==="[object Array]"}function fc(e){if(typeof e=="string")return e;if(typeof e=="bigint")return e.toString();const t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function rr(e){return e==null?"":fc(e)}function fe(e){return typeof e=="string"}function wt(e){return typeof e=="number"}function dc(e){return e===!0||e===!1||pc(e)&&ds(e)=="[object Boolean]"}function fs(e){return typeof e=="object"}function pc(e){return fs(e)&&e!==null}function ve(e){return e!=null}function mt(e){return!e.trim().length}function ds(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const mc="Incorrect 'index' type",nr="Invalid doc index: must be a non-negative integer within the bounds of the docs array",yc=e=>`Invalid value for key ${e}`,gc=e=>`Pattern length exceeds max of ${e}.`,bc=e=>`Missing ${e} property in key`,vc=e=>`Property 'weight' in key '${e}' must be a positive integer`,wc="Fuse.match does not support useTokenSearch: token search requires corpus-level statistics (df, fieldCount) that a one-off string comparison does not have. Use new Fuse(...).search(...) instead.",rn=Object.prototype.hasOwnProperty;var Sc=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(r=>{const n=ps(r);this._keys.push(n),this._keyMap[n.id]=n,t+=n.weight}),this._keys.forEach(r=>{r.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}};
3function ps(e){let t=null,r=null,n=null,s=1,i=null;if(fe(e)||Me(e))n=e,t=nn(e),r=St(e);else{if(!rn.call(e,"name"))throw new Error(bc("name"));const o=e.name;if(n=o,rn.call(e,"weight")&&e.weight!==void 0&&(s=e.weight,s<=0))throw new Error(vc(St(o)));t=nn(o),r=St(o),i=e.getFn??null}return{path:t,id:r,weight:s,src:n,getFn:i}}function nn(e){return Me(e)?e:e.split(".")}function St(e){return Me(e)?e.join("."):e}function Cc(e,t){const r=[];let n=!1;const s=(i,o,a,c)=>{if(ve(i))if(!o[a])r.push(c!==void 0?{v:i,i:c}:i);else{const l=i[o[a]];if(!ve(l))return;if(a===o.length-1&&(fe(l)||wt(l)||dc(l)||typeof l=="bigint"))r.push(c!==void 0?{v:rr(l),i:c}:rr(l));else if(Me(l)){n=!0;for(let u=0,h=l.length;u<h;u+=1)s(l[u],o,a+1,u)}else o.length&&s(l,o,a+1,c)}};return s(e,fe(t)?t.split("."):t,0),n?r:r[0]}const Ec={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},Rc={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},xc={location:0,threshold:.6,distance:100},Oc={useExtendedSearch:!1,useTokenSearch:!1,tokenize:void 0,tokenMatch:"any",getFn:Cc,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},B=Object.freeze({...Rc,...Ec,...xc,...Oc});function Pc(e){return e>=9&&e<=13||e===32||e===160}function Tc(e=1,t=3){const r=new Map,n=Math.pow(10,t);return{get(s){let i=0,o=!1;for(let c=0;c<s.length;c++)Pc(s.charCodeAt(c))?o=!1:o||(i++,o=!0);if(i===0&&(i=1),r.has(i))return r.get(i);const a=Math.round(n/Math.pow(i,.5*e))/n;return r.set(i,a),a},clear(){r.clear()}}}var Or=class{constructor({getFn:e=B.getFn,fieldNormWeight:t=B.fieldNormWeight}={}){this.norm=Tc(t,3),this.getFn=e,this.isCreated=!1,this.docs=[],this.keys=[],this._keysMap={},this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((t,r)=>{this._keysMap[t.id]=r})}create(){if(this.isCreated||!this.docs.length)return;this.isCreated=!0;const e=this.docs.length;this.records=new Array(e);let t=0;if(fe(this.docs[0]))for(let r=0;r<e;r++){const n=this._createStringRecord(this.docs[r],r);n&&(this.records[t++]=n)}else for(let r=0;r<e;r++)this.records[t++]=this._createObjectRecord(this.docs[r],r);this.records.length=t,this.norm.clear()}add(e,t){if(!Number.isInteger(t)||t<0)throw new Error(nr);if(fe(e)){const n=this._createStringRecord(e,t);return n&&this.records.push(n),n}const r=this._createObjectRecord(e,t);return this.records.push(r),r}removeAt(e){if(!Number.isInteger(e)||e<0)throw new Error(nr);for(let t=0,r=this.records.length;t<r;t+=1)if(this.records[t].i===e){this.records.splice(t,1);break}for(let t=0,r=this.records.length;t<r;t+=1)this.records[t].i>e&&(this.records[t].i-=1)}removeAll(e){const t=new Set;for(const n of e)Number.isInteger(n)&&n>=0&&t.add(n);if(t.size===0)return;this.records=this.records.filter(n=>!t.has(n.i));const r=Array.from(t).sort((n,s)=>n-s);for(const n of this.records){let s=0,i=r.length;for(;s<i;){const o=s+i>>>1;r[o]<n.i?s=o+1:i=o}n.i-=s}}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_createStringRecord(e,t){return!ve(e)||mt(e)?null:{v:e,i:t,n:this.norm.get(e)}}_createObjectRecord(e,t){const r={i:t,$:{}};for(let n=0,s=this.keys.length;n<s;n++){const i=this.keys[n],o=i.getFn?i.getFn(e):this.getFn(e,i.path);if(ve(o)){if(Me(o)){const a=[];for(let c=0,l=o.length;c<l;c+=1){const u=o[c];if(ve(u)){if(fe(u)){if(!mt(u)){const h={v:u,i:c,n:this.norm.get(u)};a.push(h)}}else if(ve(u.v)){const h=fe(u.v)?u.v:rr(u.v);if(!mt(h)){const d={v:h,i:u.i,n:this.norm.get(h)};a.push(d)}}}}r.$[n]=a}else if(fe(o)&&!mt(o)){const a={v:o,n:this.norm.get(o)};r.$[n]=a}}}return r}toJSON(){return{keys:this.keys.map(({getFn:e,...t})=>t),records:this.records}}};function ms(e,t,{getFn:r=B.getFn,fieldNormWeight:n=B.fieldNormWeight}={}){const s=new Or({getFn:r,fieldNormWeight:n});return s.setKeys(e.map(ps)),s.setSources(t),s.create(),s}function Ac(e,{getFn:t=B.getFn,fieldNormWeight:r=B.fieldNormWeight}={}){const{keys:n,records:s}=e,i=new Or({getFn:t,fieldNormWeight:r});return i.setKeys(n),i.setIndexRecords(s),i}function _c(e=[],t=B.minMatchCharLength){const r=[];let n=-1,s=-1,i=0;for(let o=e.length;i<o;i+=1){const a=e[i];a&&n===-1?n=i:!a&&n!==-1&&(s=i-1,s-n+1>=t&&r.push([n,s]),n=-1)}return e[i-1]&&i-n>=t&&r.push([n,i-1]),r}function jc(e,t,r,{location:n=B.location,distance:s=B.distance,threshold:i=B.threshold,findAllMatches:o=B.findAllMatches,minMatchCharLength:a=B.minMatchCharLength,includeMatches:c=B.includeMatches,ignoreLocation:l=B.ignoreLocation}={}){if(t.length>32)throw new Error(gc(32));const u=t.length,h=e.length,d=Math.max(0,Math.min(n,h));let m=i,g=d;const v=(I,$)=>{const G=I/u;if(l)return G;const L=Math.abs(d-$);return s?G+L/s:L?1:G},b=a>1||c,R=b?Array(h):[];let E;for(;(E=e.indexOf(t,g))>-1;){const I=v(0,E);if(m=Math.min(I,m),g=E+u,b){let $=0;for(;$<u;)R[E+$]=1,$+=1}}g=-1;let P=[],D=1,T=0,k=u+h;const U=1<<u-1;for(let I=0;I<u;I+=1){let $=0,G=k;for(;$<G;)v(I,d+G)<=m?$=G:k=G,G=Math.floor((k-$)/2+$);k=G;let L=Math.max(1,d-G+1);const F=o?h:Math.min(d+G,h)+u,N=Array(F+2);N[F+1]=(1<<I)-1;for(let Q=F;Q>=L;Q-=1){const V=Q-1,ce=r[e[V]];
3if(N[Q]=(N[Q+1]<<1|1)&ce,I&&(N[Q]|=(P[Q+1]|P[Q])<<1|1|P[Q+1]),N[Q]&U&&(D=v(I,V),D<=m)){if(m=D,g=V,T=I,g<=d)break;L=Math.max(1,2*d-g)}}if(v(I+1,d)>m)break;P=N}if(b&&g>=0){const I=Math.min(h-1,g+u-1+T);for(let $=g;$<=I;$+=1)r[e[$]]&&(R[$]=1)}const A={isMatch:g>=0,score:Math.max(.001,D)};if(b){const I=_c(R,a);I.length?c&&(A.indices=I):A.isMatch=!1}return A}function Ic(e){const t={};for(let r=0,n=e.length;r<n;r+=1){const s=e.charAt(r);t[s]=(t[s]||0)|1<<n-r-1}return t}function Pr(e){if(e.length<=1)return e;e.sort((r,n)=>r[0]-n[0]||r[1]-n[1]);const t=[e[0]];for(let r=1,n=e.length;r<n;r+=1){const s=t[t.length-1],i=e[r];i[0]<=s[1]+1?s[1]=Math.max(s[1],i[1]):t.push(i)}return t}const ys={Å:"l",Å:"L",Ä:"d",Ä:"D",ø:"o",Ã:"O",ħ:"h",Ħ:"H",ŧ:"t",Ŧ:"T",ı:"i",Ã:"ss"},Mc=new RegExp("["+Object.keys(ys).join("")+"]","g"),tt=typeof String.prototype.normalize=="function"?e=>e.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"").replace(Mc,t=>ys[t]):e=>e;var Tr=class{constructor(e,{location:t=B.location,threshold:r=B.threshold,distance:n=B.distance,includeMatches:s=B.includeMatches,findAllMatches:i=B.findAllMatches,minMatchCharLength:o=B.minMatchCharLength,isCaseSensitive:a=B.isCaseSensitive,ignoreDiacritics:c=B.ignoreDiacritics,ignoreLocation:l=B.ignoreLocation}={}){if(this.options={location:t,threshold:r,distance:n,includeMatches:s,findAllMatches:i,minMatchCharLength:o,isCaseSensitive:a,ignoreDiacritics:c,ignoreLocation:l},e=a?e:e.toLowerCase(),e=c?tt(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const u=(d,m)=>{this.chunks.push({pattern:d,alphabet:Ic(d),startIndex:m})},h=this.pattern.length;if(h>32){let d=0;const m=h%32,g=h-m;for(;d<g;)u(this.pattern.substr(d,32),d),d+=32;if(m){const v=h-32;u(this.pattern.substr(v),v)}}else u(this.pattern,0)}searchIn(e){const{isCaseSensitive:t,ignoreDiacritics:r,includeMatches:n}=this.options;if(e=t?e:e.toLowerCase(),e=r?tt(e):e,this.pattern===e){if(e.length<this.options.minMatchCharLength)return{isMatch:!1,score:1};const g={isMatch:!0,score:0};return n&&(g.indices=[[0,e.length-1]]),g}const{location:s,distance:i,threshold:o,findAllMatches:a,minMatchCharLength:c,ignoreLocation:l}=this.options,u=[];let h=0,d=!1;this.chunks.forEach(({pattern:g,alphabet:v,startIndex:b})=>{const{isMatch:R,score:E,indices:P}=jc(e,g,v,{location:s+b,distance:i,threshold:o,findAllMatches:a,minMatchCharLength:c,includeMatches:n,ignoreLocation:l});R&&(d=!0),h+=E,R&&P&&u.push(...P)});const m={isMatch:d,score:d?h/this.chunks.length:1};return d&&n&&(m.indices=Pr(u)),m}};const Lc=new Set(["fuzzy","include"]);function kc(e){return e.startsWith("inverse")}const sr=[{type:"exact",multiRegex:/^="(.*)"$/,singleRegex:/^=(.*)$/,create:e=>({type:"exact",search(t){const r=t===e;return{isMatch:r,score:r?0:1,indices:[0,e.length-1]}}})},{type:"include",multiRegex:/^'"(.*)"$/,singleRegex:/^'(.*)$/,create:e=>({type:"include",search(t){let r=0,n;const s=[],i=e.length;for(;(n=t.indexOf(e,r))>-1;)r=n+i,s.push([n,r-1]);const o=!!s.length;return{isMatch:o,score:o?0:1,indices:s}}})},{type:"prefix-exact",multiRegex:/^\^"(.*)"$/,singleRegex:/^\^(.*)$/,create:e=>({type:"prefix-exact",search(t){const r=t.startsWith(e);return{isMatch:r,score:r?0:1,indices:[0,e.length-1]}}})},{type:"inverse-prefix-exact",multiRegex:/^!\^"(.*)"$/,singleRegex:/^!\^(.*)$/,create:e=>({type:"inverse-prefix-exact",search(t){const r=!t.startsWith(e);return{isMatch:r,score:r?0:1,indices:[0,t.length-1]}}})},{type:"inverse-suffix-exact",multiRegex:/^!"(.*)"\$$/,singleRegex:/^!(.*)\$$/,create:e=>({type:"inverse-suffix-exact",search(t){const r=!t.endsWith(e);return{isMatch:r,score:r?0:1,indices:[0,t.length-1]}}})},{type:"suffix-exact",multiRegex:/^"(.*)"\$$/,singleRegex:/^(.*)\$$/,create:e=>({type:"suffix-exact",search(t){const r=t.endsWith(e);return{isMatch:r,score:r?0:1,indices:[t.length-e.length,t.length-1]}}})},{type:"inverse-exact",multiRegex:/^!"(.*)"$/,singleRegex:/^!(.*)$/,create:e=>({type:"inverse-exact",search(t){const r=t.indexOf(e)===-1;return{isMatch:r,score:r?0:1,indices:[0,t.length-1]}}})},{type:"fuzzy",multiRegex:/^"(.*)"$/,singleRegex:/^(.*)$/,create:(e,t={})=>{const r=new Tr(e,{location:t.location??B.location,threshold:t.threshold??B.threshold,distance:t.distance??B.distance,includeMatches:t.includeMatches??B.includeMatches,findAllMatches:t.findAllMatches??B.findAllMatches,minMatchCharLength:t.minMatchCharLength??B.minMatchCharLength,isCaseSensitive:t.isCaseSensitive??B.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics??B.ignoreDiacritics,ignoreLocation:t.ignoreLocation??B.ignoreLocation});return{type:"fuzzy",search(n){return r.searchIn(n)}}}}],sn=sr.length,Dc="\0",Fc="|";function Nc(e){const t=[],r=e.length;let n=0;for(;n<r;){for(;n<r&&e[n]===" ";)n++;if(n>=r)break;let s=n;for(;s<r&&e[s]!==" "&&e[s]!=='"';)s++;if(s<r&&e[s]==='"'){for(s++;s<r;){if(e[s]==='"'){const i=s+1;if(i>=r||e[i]===" "){s++;break}if(e[i]==="$"&&(i+1>=r||e[i+1]===" ")){s+=2;break}}s++}t.push(e.substring(n,s)),n=s}else{for(;s<r&&e[s]!==" ";)s++;t.push(e.substring(n,s)),n=s}}return t}function on(e,t){const r=e.match(t);return r?r[1]:null}function Bc(e,t={}){return e.replace(/\\\|/g,Dc).split(Fc).map(r=>{const n=Nc(r.replace(/\u0000/g,"|").trim()).filter(i=>i&&!!i.trim()),s=[];for(let i=0,o=n.length;i<o;i+=1){const a=n[i];let c=!1,l=-1;for(;!c&&++l<sn;){const u=sr[l],h=on(a,u.multiRegex);h&&(s.push(u.create(h,t)),c=!0)}if(!c)for(l=-1;++l<sn;){const u=sr[l],h=on(a,u.singleRegex);if(h){s.push(u.create(h,t));break}}}return s})}var $c=class{constructor(e,{isCaseSensitive:t=B.isCaseSensitive,ignoreDiacritics:r=B.ignoreDiacritics,includeMatches:n=B.includeMatches,minMatchCharLength:s=B.minMatchCharLength,ignoreLocation:i=B.ignoreLocation,findAllMatches:o=B.findAllMatches,location:a=B.location,threshold:c=B.threshold,distance:l=B.distance}={}){this.query=null,this.options={isCaseSensitive:t,ignoreDiacritics:r,includeMatches:n,minMatchCharLength:s,findAllMatches:o,ignoreLocation:i,location:a,threshold:c,distance:l},e=t?e:e.toLowerCase(),e=r?tt(e):e,this.pattern=e,this.query=Bc(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){const t=this.query;if(!t)return{isMatch:!1,score:1};const{includeMatches:r,isCaseSensitive:n,ignoreDiacritics:s}=this.options;e=n?e:e.toLowerCase(),e=s?tt(e):e;let i=0;const o=[];let a=0,c=!1;for(let l=0,u=t.length;l<u;l+=1){const h=t[l];o.length=0,i=0,c=!1;for(let d=0,m=h.length;d<m;d+=1){const g=h[d],{isMatch:v,indices:b,score:R}=g.search(e);if(v)i+=1,a+=R,kc(g.type)&&(c=!0),r&&(Lc.has(g.type)?o.push(...b):o.push(b));else{a=0,i=0,o.length=0,c=!1;break}}if(i){const d={isMatch:!0,score:a/i};return c&&(d.hasInverse=!0),r&&(d.indices=Pr(o)),d}}return{isMatch:!1,score:1}}};const ir=[];function Ar(...e){ir.push(...e)}function At(e,t){for(let r=0,n=ir.length;r<n;r+=1){const s=ir[r];if(s.condition(e,t))return new s(e,t)}return new Tr(e,t)}const _t={AND:"$and",OR:"$or"},or={PATH:"$path",PATTERN:"$val"},ar=e=>!!(e[_t.AND]||e[_t.OR]),Uc=e=>!!e[or.PATH],Gc=e=>!Me(e)&&fs(e)&&!ar(e),an=e=>({[_t.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function gs(e,t,{auto:r=!0}={}){const n=s=>{if(fe(s)){const c={keyId:null,pattern:s};return r&&(c.searcher=At(s,t)),c}const i=Object.keys(s),o=Uc(s);if(!o&&i.length>1&&!ar(s))return n(an(s));if(Gc(s)){const c=o?s[or.PATH]:i[0],l=o?s[or.PATTERN]:s[c];if(!fe(l))throw new Error(yc(c));const u={keyId:St(c),pattern:l};return r&&(u.searcher=At(l,t)),u}const a={children:[],operator:i[0]};
3return i.forEach(c=>{const l=s[c];Me(l)&&l.forEach(u=>{a.children.push(n(u))})}),a};return ar(e)||(e=an(e)),n(e)}function cr(e,{ignoreFieldNorm:t=B.ignoreFieldNorm}){let r=1;return e.forEach(({key:n,norm:s,score:i})=>{const o=n?n.weight:null;r*=Math.pow(i===0&&o?Number.EPSILON:i,(o||1)*(t?1:s))}),r}function Qc(e,{ignoreFieldNorm:t=B.ignoreFieldNorm}){e.forEach(r=>{r.score=cr(r.matches,{ignoreFieldNorm:t})})}var Hc=class{constructor(e,t){this.limit=e,this.heap=[],this.comparator=t}get size(){return this.heap.length}insert(e){this.size<this.limit?(this.heap.push(e),this._bubbleUp(this.size-1)):this.comparator(e,this.heap[0])<0&&(this.heap[0]=e,this._sinkDown(0))}extractSorted(){return this.heap.sort(this.comparator)}_bubbleUp(e){const t=this.heap;for(;e>0;){const r=e-1>>1;if(this.comparator(t[e],t[r])<=0)break;const n=t[e];t[e]=t[r],t[r]=n,e=r}}_sinkDown(e){const t=this.heap,r=t.length;let n=e;do{e=n;const s=2*e+1,i=2*e+2;if(s<r&&this.comparator(t[s],t[n])>0&&(n=s),i<r&&this.comparator(t[i],t[n])>0&&(n=i),n!==e){const o=t[e];t[e]=t[n],t[n]=o}}while(n!==e)}};function Kc(e){const t=[];return e.matches.forEach(r=>{if(!ve(r.indices)||!r.indices.length)return;const n={indices:r.indices,value:r.value};r.key&&(n.key=r.key.id),r.idx>-1&&(n.refIndex=r.idx),t.push(n)}),t}function Wc(e,t,{includeMatches:r=B.includeMatches,includeScore:n=B.includeScore}={}){return e.map(s=>{const{idx:i}=s,o={item:t[i],refIndex:i};return r&&(o.matches=Kc(s)),n&&(o.score=s.score),o})}const zc=/[\p{L}\p{M}\p{N}_]+/gu,cn=new WeakSet;function Vc(e){cn.has(e)||(cn.add(e),console.warn(`[Fuse] tokenize regex ${e} lacks the global flag; only the first match per text will be returned. Add the 'g' flag.`))}function qc(e){if(typeof e=="function"){let t=!1;return r=>{const n=e(r);if(!t&&(t=!0,!Array.isArray(n)||n.some(s=>typeof s!="string")))throw new Error(`[Fuse] tokenize function must return string[]; received ${Array.isArray(n)?"array containing non-strings":typeof n}.`);return n}}return e instanceof RegExp?(e.global||Vc(e),t=>t.match(e)||[]):t=>t.match(zc)||[]}function ur({isCaseSensitive:e=!1,ignoreDiacritics:t=!1,tokenize:r}={}){const n=qc(r);return{tokenize(s){return e||(s=s.toLowerCase()),t&&(s=tt(s)),n(s)}}}var Yc=class{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=ur({isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,tokenize:t.tokenize});const r=this.analyzer.tokenize(e),{df:n,fieldCount:s}=t._invertedIndex;this.termSearchers=[],this.idfWeights=[];for(const i of r){this.termSearchers.push(new Tr(i,{location:t.location,threshold:t.threshold,distance:t.distance,includeMatches:t.includeMatches,findAllMatches:t.findAllMatches,minMatchCharLength:t.minMatchCharLength,isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,ignoreLocation:!0}));const o=n.get(i)||0,a=Math.log(1+(s-o+.5)/(o+.5));this.idfWeights.push(a)}this.combineAll=t.tokenMatch==="all",this.numTerms=this.termSearchers.length,this.useMask=this.numTerms<=31}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};const t=[];let r=0,n=0,s=0,i=0;const o=this.combineAll&&!this.useMask?new Set:null;for(let l=0;l<this.termSearchers.length;l++){const u=this.termSearchers[l].searchIn(e),h=this.idfWeights[l];n+=h,u.isMatch&&(s++,r+=h*(1-u.score),u.indices&&t.push(...u.indices),this.combineAll&&(this.useMask?i|=1<<l:o.add(l)))}if(s===0)return{isMatch:!1,score:1};const a=n>0?1-r/n:0,c={isMatch:!0,score:Math.max(.001,a)};return this.options.includeMatches&&t.length&&(c.indices=Pr(t)),this.combineAll&&(this.useMask?c.matchedMask=i:c.matchedTerms=o,c.termCount=this.numTerms),c}};function Qt(e,t,r,n){const s=n.tokenize(t);if(!s.length)return;e.fieldCount++,e.docFieldCount.set(r,(e.docFieldCount.get(r)||0)+1);const i=new Set(s);let o=e.docTermFieldHits.get(r);o||(o=new Map,e.docTermFieldHits.set(r,o));for(const a of i)o.set(a,(o.get(a)||0)+1),e.df.set(a,(e.df.get(a)||0)+1)}function bs(e,t,r,n){const{i:s,v:i,$:o}=t;if(i!==void 0){Qt(e,i,s,n);return}if(o)for(let a=0;a<r;a++){const c=o[a];if(c)if(Array.isArray(c))for(const l of c)Qt(e,l.v,s,n);else Qt(e,c.v,s,n)}}
vendor: 4,729 bytes, line 3
3function Jc(e,t,r){const n={fieldCount:0,df:new Map,docFieldCount:new Map,docTermFieldHits:new Map};for(const s of e)bs(n,s,t,r);return n}function Zc(e,t,r,n){bs(e,t,r,n)}function Xc(e,t){const r=e.docFieldCount.get(t);if(r===void 0)return;e.fieldCount-=r,e.docFieldCount.delete(t);const n=e.docTermFieldHits.get(t);if(n){for(const[s,i]of n){const o=(e.df.get(s)||0)-i;o<=0?e.df.delete(s):e.df.set(s,o)}e.docTermFieldHits.delete(t)}}function un(e,t){if(t.length===0)return;const r=Array.from(new Set(t)).sort((a,c)=>a-c);for(const a of r)Xc(e,a);const n=a=>{let c=0,l=r.length;for(;c<l;){const u=c+l>>>1;r[u]<a?c=u+1:l=u}return a-c},s=r[0],i=new Map;for(const[a,c]of e.docFieldCount)i.set(a>s?n(a):a,c);e.docFieldCount=i;const o=new Map;for(const[a,c]of e.docTermFieldHits)o.set(a>s?n(a):a,c);e.docTermFieldHits=o}var Le=class{constructor(e,t,r){this.options={...B,...t},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new Sc(this.options.keys),this._docs=e,this._myIndex=null,this._invertedIndex=null,this.setCollection(e,r),this._lastQuery=null,this._lastSearcher=null}_getSearcher(e){if(this._lastQuery===e)return this._lastSearcher;const t=At(e,this._invertedIndex?{...this.options,_invertedIndex:this._invertedIndex}:this.options);return this._lastQuery=e,this._lastSearcher=t,t}setCollection(e,t){if(this._docs=e,t&&!(t instanceof Or))throw new Error(mc);if(this._myIndex=t||ms(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){const r=ur({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});this._invertedIndex=Jc(this._myIndex.records,this._myIndex.keys.length,r)}this._invalidateSearcherCache()}add(e){if(!ve(e))return;this._docs.push(e);const t=this._myIndex.add(e,this._docs.length-1);if(this._invertedIndex&&t){const r=ur({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});Zc(this._invertedIndex,t,this._myIndex.keys.length,r)}this._invalidateSearcherCache()}remove(e=()=>!1){const t=[],r=[];for(let n=0,s=this._docs.length;n<s;n+=1)e(this._docs[n],n)&&(t.push(this._docs[n]),r.push(n));if(r.length){this._invertedIndex&&un(this._invertedIndex,r);const n=new Set(r);this._docs=this._docs.filter((s,i)=>!n.has(i)),this._myIndex.removeAll(r),this._invalidateSearcherCache()}return t}removeAt(e){if(!Number.isInteger(e)||e<0||e>=this._docs.length)throw new Error(nr);this._invertedIndex&&un(this._invertedIndex,[e]);const t=this._docs.splice(e,1)[0];return this._myIndex.removeAt(e),this._invalidateSearcherCache(),t}_invalidateSearcherCache(){this._lastQuery=null,this._lastSearcher=null}getIndex(){return this._myIndex}_normalizedKeys(){return this._myIndex.keys.map(e=>this._keyStore.get(e.id)||e)}search(e,t){const{limit:r=-1}=t||{},{includeMatches:n,includeScore:s,shouldSort:i,sortFn:o,ignoreFieldNorm:a}=this.options;if(fe(e)&&!e.trim()){let d=this._docs.map((m,g)=>({item:m,refIndex:g}));return wt(r)&&r>-1&&(d=d.slice(0,r)),d}const c=i&&wt(r)&&r>0&&fe(e),l=o,u=(d,m)=>l(d,m)||d.idx-m.idx;let h;if(c){const d=new Hc(r,u);fe(this._docs[0])?this._searchStringList(e,{heap:d,ignoreFieldNorm:a}):this._searchObjectList(e,{heap:d,ignoreFieldNorm:a}),h=d.extractSorted()}else h=fe(e)?fe(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),Qc(h,{ignoreFieldNorm:a}),i&&h.sort(fe(e)?u:l),wt(r)&&r>-1&&(h=h.slice(0,r));return Wc(h,this._docs,{includeMatches:n,includeScore:s})}_searchStringList(e,{heap:t,ignoreFieldNorm:r}={}){const n=this._getSearcher(e),s=this.options.useTokenSearch&&this.options.tokenMatch==="all",{records:i}=this._myIndex,o=t?null:[];return i.forEach(({v:a,i:c,n:l})=>{if(!ve(a))return;const u=n.searchIn(a);if(u.isMatch){const h={score:u.score,value:a,norm:l,indices:u.indices};s&&(h.matchedMask=u.matchedMask,h.matchedTerms=u.matchedTerms,h.termCount=u.termCount);const d=[h];if(!s||this._coversAllTokens(d)){const m={item:a,idx:c,matches:d};t?(m.score=cr(m.matches,{ignoreFieldNorm:r}),t.insert(m)):o.push(m)}}}),o}_searchLogical(e){const t=gs(e,this.options),r=this._normalizedKeys(),n=(a,c,l)=>{if(!("children"in a)){const{keyId:m,searcher:g}=a;let v;return m===null?(v=[],r.forEach((b,R)=>{v.push(...this._findMatches({key:b,value:c[R],searcher:g}))})):v=this._findMatches({key:this._keyStore.get(m),value:this._myIndex.getValueForItemAtKeyId(c,m),searcher:g}),v&&v.length?[{idx:l,item:c,matches:v}]:[]}const{children:u,operator:h}=a,d=[];for(let m=0,g=u.length;m<g;m+=1){const v=u[m],b=n(v,c,l);if(b.length)d.push(...b);else if(h===_t.AND)return[]}return d},s=this._myIndex.records,i=new Map,o=[];
3return s.forEach(({$:a,i:c})=>{if(ve(a)){const l=n(t,a,c);l.length&&(i.has(c)||(i.set(c,{idx:c,item:a,matches:[]}),o.push(i.get(c))),l.forEach(({matches:u})=>{i.get(c).matches.push(...u)}))}}),o}_searchObjectList(e,{heap:t,ignoreFieldNorm:r}={}){const n=this._getSearcher(e),s=this.options.useTokenSearch&&this.options.tokenMatch==="all",{records:i}=this._myIndex,o=this._normalizedKeys(),a=t?null:[];return i.forEach(({$:c,i:l})=>{if(!ve(c))return;const u=[];let h=!1,d=!1;if(o.forEach((m,g)=>{const v=this._findMatches({key:m,value:c[g],searcher:n});v.length?(u.push(...v),v[0].hasInverse&&(d=!0)):h=!0}),!(d&&h)&&u.length&&(!s||this._coversAllTokens(u))){const m={idx:l,item:c,matches:u};t?(m.score=cr(m.matches,{ignoreFieldNorm:r}),t.insert(m)):a.push(m)}}),a}_findMatches({key:e,value:t,searcher:r}){if(!ve(t))return[];const n=[];if(Me(t))t.forEach(({v:s,i,n:o})=>{if(!ve(s))return;const a=r.searchIn(s);if(a.isMatch){const c={score:a.score,key:e,value:s,idx:i,norm:o,indices:a.indices,hasInverse:a.hasInverse};a.termCount!==void 0&&(c.matchedMask=a.matchedMask,c.matchedTerms=a.matchedTerms,c.termCount=a.termCount),n.push(c)}});else{const{v:s,n:i}=t,o=r.searchIn(s);if(o.isMatch){const a={score:o.score,key:e,value:s,norm:i,indices:o.indices,hasInverse:o.hasInverse};o.termCount!==void 0&&(a.matchedMask=o.matchedMask,a.matchedTerms=o.matchedTerms,a.termCount=o.termCount),n.push(a)}}return n}_coversAllTokens(e){const t=e.length?e[0].termCount:void 0;if(t===void 0)return!0;if(t<=31){let n=0;for(let s=0;s<e.length;s++)n|=e[s].matchedMask||0;return n===2**t-1}const r=new Set;for(let n=0;n<e.length;n++){const s=e[n].matchedTerms;if(s)for(const i of s)r.add(i)}return r.size===t}};Le.version="7.5.0";Le.createIndex=ms;Le.parseIndex=Ac;Le.config=B;Le.match=function(e,t,r){if(r&&r.useTokenSearch)throw new Error(wc);return At(e,{...B,...r}).searchIn(t)};Le.parseQuery=gs;Ar($c);Ar(Yc);Le.use=function(...e){e.forEach(t=>Ar(t))};var eu=Le;async function tu(e,t){const{data:r}=await Dt(e);return(r?.games??[]).filter(n=>{const[s,,i]=n;return la(s,i,t)}).map(n=>{const[s,i,o,a,c,l]=n;return{game_id:s,game_name:Rr(i),game_type:o,slug:a,popularity:c,ribbon:l}})}function ru({enable:e,lobbyId:t,directory:r,regionId:n,exclusions:s={}}){return ze({queryKey:["game-search-list",t,r,n,s],queryFn:()=>{const a=`${pn({lobbyId:t,directory:r,regionId:n})}/games-search.json?${dn()}`;return tu(a,s)},enabled:e})}const vs=300,nu=2,Ge={SEARCH:"search",RECENT:"recent",RECOMMENDED:"recommended"},su={keys:[{name:"game_name",weight:1}],includeScore:!0,threshold:.6,distance:100,useExtendedSearch:!1,shouldSort:!0,findAllMatches:!0},iu=(e,t)=>e.map(r=>{const n=Rr(r.game_name),s={id:r.game_id,name:n,category:"",slug:r.slug,gameType:"",logoUrl:`${Ct}/games/${r.game_id}/logo.png?${Pt("search",Ot.LOGO)}`,bgUrl:`${Ct}/games/${r.game_id}/bg.jpg?${Pt("search",Ot.BG)}`,preloadImage:!0,ribbon:r.ribbon};return t&&(s.preventNavigation=!0,s.className=kt),s}),ou=e=>!!e&&e.length>=nu,au=(e,t)=>e.search(t).sort((n,s)=>n.score===s.score?n.item.popularity-s.item.popularity:(n.score??0)-(s.score??0)).slice(0,ca).map(n=>n.item);function cu(){const{id:e,lobby:t,region:r}=Te(),[n,s]=f.useState(""),[i,o]=f.useState(),[a,c]=f.useState(!1),[l,u]=f.useState(!1),[h,d]=f.useState(!1),[m,g]=f.useState(Ge.SEARCH),b=!ot()&&Er.has(e),R=()=>Cr(aa),{data:E,error:P,isLoading:D}=ru({enable:a,lobbyId:t?.id,directory:t?.directory,regionId:r.id,exclusions:t?.exclusions}),T=f.useCallback((L,F)=>{const N=iu(L,b);if(N.length>0){o(N),u(!0);return}F?.allowEmpty&&(o([]),u(!1))},[b]),k=f.useCallback(L=>{const F=E?new eu(E,su):null;if(!F||!L)return;const N=au(F,L);g(Ge.SEARCH),T(N,{allowEmpty:!0})},[E,T]);f.useEffect(()=>{const L=setTimeout(()=>{n&&ou(n)&&!D&&k(n)},vs);return()=>clearTimeout(L)},[n,D,k]),f.useEffect(()=>{if(!h||D||n)return;const L=R();let F;L&&(F=decodeURIComponent(L).split(",").map(N=>N.trim()).map(N=>
3E?.find(Q=>Q.slug===N)).filter(N=>!!N),g(Ge.RECENT)),F?.length||(F=E?.slice().sort((N,Q)=>Q.popularity-N.popularity).slice(0,3),g(Ge.RECOMMENDED)),F&&T(F)},[E,D,h,n,T]);const U=f.useCallback(()=>{c(!0),d(!0)},[]),A=f.useCallback(()=>{o(void 0),u(!1),d(!1),s("")},[]),I=f.useCallback(L=>{L&&c(!0),s(L)},[]),$=f.useCallback(L=>{const{value:F}=L.target;s(F),F||u(!0)},[]),G=f.useCallback(L=>{L.preventDefault();const N=new FormData(L.currentTarget).get("search");s(N),N||u(!0)},[]);return{onInputChange:$,results:i,onSubmit:G,error:P,searchQuery:n,onFocus:U,onSetQuery:I,isLoading:D,hasMatch:l,clearSearchPreload:A,resultType:m,isSearchFocused:h}}const ln="search_games";function uu(){const{search:e}=we();return f.useMemo(()=>new URLSearchParams(e),[e])}function ws({onSearchStateChange:e,onSearchResultChange:t,onError:r}){const s=uu().get(ln),{onInputChange:i,results:o,onSubmit:a,searchQuery:c,onFocus:l,onSetQuery:u,hasMatch:h,error:d,clearSearchPreload:m,resultType:g,isSearchFocused:v}=cu();f.useEffect(()=>{const R=setTimeout(()=>{e({isSearchEnabled:v||!!c,hasMatch:h})},v?vs:0);return()=>clearTimeout(R)},[h,v,e,c]),f.useEffect(()=>{t(o,g)},[t,o,g]),f.useEffect(()=>{s&&u(s)},[u,s]),f.useEffect(()=>{d&&r?.(d instanceof Error?d:new Error(String(d)))},[d,r]);const b=f.useCallback(()=>{if(m(),s){const R=new URL(window.location.href);R.searchParams.delete(ln),window.history.replaceState({},"",R)}},[m,s]);return p.jsx("div",{className:"lobby-search__wrapper",children:p.jsx(hc,{value:c,onSubmit:a,onInputChange:i,onFocus:l,onClear:b})})}const jt={STANDARD:"standard"};function _r({error:e}){return f.useEffect(()=>{e&&Ne.error(e),Ne.action("error_state",{message:"ErrorState component rendered"})},[e]),p.jsxs("div",{className:"lobby-error",id:"error-search",children:[p.jsx("div",{className:"error-icon"}),p.jsx("h2",{children:"Oops, something went wrong."}),p.jsx("p",{children:"Our game search has returned an error, please try again or check out our Games page."}),p.jsx("a",{className:"btn btn-primary",href:`/${de}`,"data-testid":"errorState_gamesLink",children:"Back to the Games page"})]})}const Ht={RECENT:"Your Recent Searches",RECOMMENDED:"Popular Searches",SEARCH:"Search Results"};function lu(e){return e===Ge.RECENT?Ht.RECENT:e===Ge.RECOMMENDED?Ht.RECOMMENDED:Ht.SEARCH}function Ss({games:e,type:t=jt.STANDARD,noMatch:r,error:n,searchResultType:s}){const i=ot(),o=Te(),a=!i&&Er.has(o.id),{displayedItems:c,handleObserver:l,hasMore:u}=is(e,10),h=f.useRef(null);if(os(),f.useEffect(()=>{const g=new IntersectionObserver(l,{root:null,rootMargin:"20px",threshold:1});return h.current&&g.observe(h.current),()=>g.disconnect()},[l]),n)return p.jsx(_r,{error:n});if(r)return p.jsx("div",{id:"game-results",className:"active",children:p.jsx("div",{className:"search-top-bar",children:p.jsx("h3",{className:"title",children:"Your search returned no results"})})});const d=lu(s),m=a?kt:"";return p.jsxs("div",{id:"game-results",className:"active",children:[t===jt.STANDARD?p.jsx(ic,{results:c,title:d,totalGames:e.length,preventNavigation:a,className:xe(m)}):p.jsx(ct,{name:d,layout:[ee.GRID],totalGames:e.length,games:c,slug:"",position:1}),p.jsx("div",{ref:h,className:"pagination-loader",children:u&&p.jsx("p",{children:"Loading more..."})})]})}function hu({onSearchStateChange:e,onSearchResultChange:t,onError:r}){const[n,s]=f.useState(!1),{id:i,lobby:o,region:a}=Te(),{data:c}=xr({lobbyId:o?.id,directory:o?.directory,regionId:a.id,exclusions:o?.exclusions}),l=({isSearchEnabled:d,hasMatch:m})=>{e({isSearchEnabled:d,hasMatch:m})},{primarySlug:u}=Be(),h=c?.find(d=>d.url===`/${u}`);return p.jsxs("div",{className:xe("search-box-top-bar",n&&"active"),children:[p.jsx(sc,{}),!n&&p.jsx("h3",{className:"title",children:h?.label}),!n&&p.jsx("div",{"data-testid":"toggle-search",id:"toggle-search",onClick:()=>s(!0)}),n&&p.jsx(ws,{onSearchStateChange:l,onSearchResultChange:t,onError:r})]})}function hn(){return f.useEffect(()=>{Ne.action("not_found_state",{message:"NotFoundState component rendered"})},[]),p.jsxs("div",{className:"lobby-error",id:"error-404",children:[p.jsx("div",{className:"error-icon"}),p.jsx("h2",{children:"We can't find this page."}),p.jsx("p",{children:"Please check the URL, or head back to the Homepage or the games page."}),p.jsx("a",{className:"btn btn-primary",href:`/${de}`,"data-testid":"notFoundState_gamesLink",children:"Back to the Games page"})]})}const fu=async(e,t)=>{const{data:r}=await Dt(e);return{content:(r?.content??[]).map((s,i)=>Xo(s,i,t)).filter((s,i)=>ea(s,i,t))}};function du({brandConfig:e,primarySlug:t,secondarySlug:r,enabled:n=!0}){const s=e.region.id,{id:i,directory:o}=e.lobby||{},a=fn({primarySlug:t,secondarySlug:r,lobbyId:i,directory:o,regionId:s});return ze({queryKey:["page-content",t,r,a,e],queryFn:()=>fu(a,e),enabled:n})}function pu({children:e,isLoading:t=!1,isEnabled:r=()=>!0,defaultSlug:n=de}){const s=Te(),{primarySlug:i,secondarySlug:o}=Be(),{data:a,isLoading:c,error:l}=du({brandConfig:s,primarySlug:i||n,secondarySlug:o,enabled:!t});return os(),t||c?p.jsx(oc,{primarySlug:i,secondarySlug:o}):l||!a?l instanceof as&&l.statusCode===404?p.jsx(hn,{}):p.jsx(_r,{error:l instanceof Error?l:void 0}):r()?p.jsxs(p.Fragment,{children:[a.content.map((u,h)=>p.jsx(nc,{position:h+1,type:u.type,data:u.data},`${u.type}-${h}`)),e]}):p.jsx(hn,{})}function Cs(){const{id:e,lobby:t,region:r}=Te(),{primarySlug:n,readMoreGameSlug:s}=Be(),{data:i,isLoading:o,isError:a,error:c}=xr({lobbyId:t?.id,directory:t?.directory,regionId:r.id,exclusions:t?.exclusions,bingoLobbyUrl:t?.bingoLobbyUrl});if(a)return p.jsx(_r,{error:c instanceof Error?c:void 0});const l=()=>!n||!!i?.some(({allowedUrl:u})=>Fe(u)===n)||!!s&&pa(n);return p.jsx(pu,{isEnabled:l,isLoading:o,defaultSlug:Fe(i?.[0]?.allowedUrl||""),children:p.jsx(Ya,{gamesButtonUrl:`/${de}/${t?.bottomLink?.url||Ja}`,gamesButtonLabel:t?.bottomLink?.label||"View Our Slots"})})}const mu=(e,t)=>
3{if(!e||e.length===0)return e;const r=t?.bingoTabPosition;if(typeof r!="number"||!Number.isFinite(r))return e;const n=e.findIndex(a=>hs(a.label));if(n===-1)return e;const s=Math.max(1,Math.min(r,e.length))-1;if(s===n)return e;const i=[...e],[o]=i.splice(n,1);return i.splice(s,0,o),i},yu=p.jsxs("svg",{width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[p.jsx("path",{d:"M19 6.73656C19 6.28959 18.7034 5.89687 18.2734 5.77465L12.2666 4.06761L5.74316 5.79808C5.30518 5.9145 5.00018 6.3107 5 6.7639V13.2952C5 15.2218 6.10711 16.9767 7.8457 17.8069L12.2607 19.9153L16.2773 17.8606C17.9485 17.0056 18.9999 15.2865 19 13.4094V6.73656ZM21 13.4094C20.9999 16.0375 19.5273 18.444 17.1875 19.6409L13.1719 21.6955C12.6171 21.9793 11.9608 21.9885 11.3984 21.72L6.98438 19.6125C4.55019 18.4504 3 15.9925 3 13.2952V6.7639C3.00018 5.40355 3.91563 4.21341 5.23047 3.86449L11.7539 2.13402C12.1015 2.04183 12.4676 2.04549 12.8135 2.14379L18.8203 3.85082C20.1101 4.21748 21 5.39563 21 6.73656V13.4094Z",fill:"white"}),p.jsx("path",{d:"M15.1776 8.4611C15.492 8.00706 16.1151 7.89382 16.5692 8.20817C17.0232 8.52255 17.1365 9.14571 16.8221 9.59977L12.7547 15.4748C12.1411 16.3611 10.8202 16.3303 10.2489 15.4162L8.1522 12.0607L8.1024 11.9709C7.87861 11.5162 8.03078 10.9573 8.46959 10.6828C8.93781 10.3901 9.55472 10.5321 9.84752 11.0002L11.5419 13.7111L15.1776 8.4611Z",fill:"white"})]});function gu(){const[e,t]=f.useState(!1),[r,n]=f.useState([]),[s,i]=f.useState(void 0),[o,a]=f.useState(!1),{id:c,lobby:l,region:u}=Te(),[h,d]=f.useState(),m=ot()&&u.name===xa.UK,{data:g,isLoading:v}=xr({lobbyId:l?.id,directory:l?.directory,regionId:u.id,exclusions:l?.exclusions,bingoLobbyUrl:l?.bingoLobbyUrl}),b=f.useMemo(()=>mu(g,l?.abTests),[g,l?.abTests]),R=({isSearchEnabled:T,hasMatch:k})=>{t(T),a(k)},E=(T,k)=>{n(T),d(k)},P=T=>{i(T)},D=f.useRef(null);return ka(D,".game-category.active",[v]),p.jsxs(p.Fragment,{children:[p.jsxs("section",{className:e?"lobby-navigation":"lobby-navigation search-inactive",ref:D,children:[p.jsx(lc,{elements:b||[],isLoading:v}),p.jsx("div",{className:"lobby-navigation__search-container",children:p.jsx(ws,{onSearchStateChange:R,onSearchResultChange:E,onError:P})}),m&&p.jsx("a",{href:"/myaccount/deposit-limits",className:"lobby-navigation__deposit-limit","aria-label":"Deposit limit","data-a":"deposit-limits-link",children:yu})]}),e&&p.jsx(Ss,{games:r??[],searchResultType:h,noMatch:!o,type:jt.STANDARD,error:s})]})}function yt(){return p.jsxs(p.Fragment,{children:[p.jsx(gu,{}),p.jsx(Cs,{})]})}function bu(){const[e,t]=f.useState(!1),[r,n]=f.useState(!1),[s,i]=f.useState([]),[o,a]=f.useState(void 0),[c,l]=f.useState(),u=({isSearchEnabled:m,hasMatch:g})=>{t(m),n(g)},h=(m,g)=>{i(m),l(g)},d=m=>{a(m)};return p.jsxs(p.Fragment,{children:[p.jsx(hu,{onSearchStateChange:u,onSearchResultChange:h,onError:d}),e&&p.jsx(Ss,{games:s??[],searchResultType:c,noMatch:!r,type:jt.STANDARD,error:o}),!e&&p.jsx(Cs,{})]})}function vu(){const e=window.gpBrandConfig?.gameInfoPopupEnabled;return p.jsxs(_i,{children:[p.jsx(Ue,{path:"/",element:p.jsx(yt,{})}),p.jsx(Ue,{path:`/${de}`,element:p.jsx(yt,{})}),e&&Object.values(at).map(t=>p.jsx(Ue,{path:`/${de}/${t}/:readMoreGameSlug`,element:p.jsx(yt,{})},t)),p.jsx(Ue,{path:`/${de}/:primarySlug`,element:p.jsx(yt,{})}),p.jsx(Ue,{path:`/${de}/:primarySlug/:secondarySlug`,element:p.jsx(bu,{})})]})}function wu(){const e=window.gpBrandConfig?.config;if(!e)throw new Error("window.gpBrandConfig.config is required to mount the casino lobby");const t=window.gpLobbyConfig?{...e.lobby,...window.gpLobbyConfig}:e.lobby;return{...e,lobby:t}}function xu(){const e=document.getElementById(_s.CASINO_LOBBY);if(!e)return;Va();const t=wu();Ts.createRoot(e).render(p.jsx(f.StrictMode,{children:p.jsx(Jo,{config:t,children:p.jsx(No,{client:Da,children:p.jsx(eo,{children:p.jsx(qa,{children:p.jsx(vu,{})})})})})}))}export{xu as bootstrapCasinoLobby};
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.