1import{C as R,j as a,k as L,T as F,l as V,m as _,D as W}from"./chunk-C0n4RF7v.js";/* empty css */import{r as u,u as q}from"./chunk-CiGsJxmw.js";import{c as z,S as J,O as D}from"./chunk-DEc8PPa8.js";import{m as Y}from"./chunk-DMpuwt1P.js";import{t as H,G as Q}from"./chunk-1DtZhVb8.js";var X=z(function(n){return function(){n(this),this.name="EmptyError",this.message="no elements in sequence"}});function Z(n,t){return new Promise(function(e,r){var s=new J({next:function(o){e(o),s.unsubscribe()},error:r,complete:function(){r(new X)}});n.subscribe(s)})}const N=class N{static getBaseUrl(t){return t==="staging"?"https://cdnroute.qa.bpsgameserver.com":"https://cdnroute.bpsgameserver.com"}static async getContentSectionGroup(t,e){const r=typeof window<"u"?window.location.origin:this.getBaseUrl(e.environment),s=await fetch(`${r}/api/v2/content/documentgroups/${t}`,{headers:{...e,contentType:"application/json",brandId:e.brandId,correlationId:e.correlationId,marketCode:e.marketCode,"x-obg-channel":e.channel,"x-obg-country-code":e.countryCode,"x-obg-device":e.device}});if(!s.ok)throw new Error("Failed to fetch content section group");return await s.json()}static async showTranslationKeys(){if(!(typeof window<"u"&&typeof document<"u"&&!!document.obgEventBus))return!1;if(!this._showTranslationKeysCache){const e=new D(document.obgEventBus.retrieve(R.Experiments)).pipe(Y(r=>r.includes("show-translation-keys")),H(1));this._showTranslationKeysCache=Z(e).catch(r=>(this._showTranslationKeysCache=null,Promise.reject(r)))}return this._showTranslationKeysCache}static async getImagesByGroup(t,e){const r=typeof window<"u"?window.location.origin:this.getBaseUrl(e.environment),s=await fetch(`${r}/api/v1/content/groups/${t}`,{headers:{contentType:"application/json",brandId:e.brandId,correlationId:e.correlationId,marketCode:e.marketCode,"x-obg-channel":e.channel,"x-obg-country-code":e.countryCode,"x-obg-device":e.device}});if(!s.ok)throw new Error("Failed to fetch images");const o=await s.json();return await this.showTranslationKeys()?Object.fromEntries(Object.entries(o).map(([i,d])=>[i,{...d,altText:i}])):o}static async getTranslations(t,e){const r=typeof window<"u"?window.location.origin:this.getBaseUrl(e.environment),s=await fetch(`${r}/api/v1/content/groups/${t}`,{headers:{contentType:"application/json",brandId:e.brandId,correlationId:e.correlationId,marketCode:e.marketCode,"x-obg-channel":e.channel,"x-obg-country-code":e.countryCode,"x-obg-device":e.device}});if(!s.ok)throw new Error("Failed to fetch translations");const o=await s.json();return await this.showTranslationKeys()?Object.fromEntries(Object.entries(o).map(([i])=>[i,i])):o}};N._showTranslationKeysCache=null;let h=N;const K=u.createContext(void 0);function ee({value:n,children:t}){return a.jsx(K.Provider,{value:n,children:t})}function te(){const n=u.useContext(K);if(!n)throw new Error("usePaymentLogosContext must be used within a PaymentLogosProvider");return n}function B(){const{logos:n}=te(),t=u.useRef(null);return a.jsx("div",{"data-test-id":"logo-container",className:"logo-container",ref:t,children:n.slice(0,8).map(e=>a.jsx("img",{className:"logo",src:e.url,alt:e.altText??""},e.url))})}const ne="ratio_24to5_xl",ae="ratio_451to202_l";function re(n){return n?ne:ae}function k(n,t){if(!n)return;const e=re(t);return`${n}?profile=${e}`}function se({generalImages:n,translations:t,config:e,commonTranslations:r,isDesktop:s,navigate:o,trackGtmEvent:c,isLoading:l=!1}){const i=s?n.generalDesktop:n.generalMobile,d=k(i?.url,s);return a.jsxs("section",{className:`banner ${l?"is-loading":""}`,"aria-busy":l,children:[a.jsx("img",{fetchPriority:"high","data-test-id":"banner-image",className:"banner-image",src:`${d}_1x`,srcSet:` 2 ${d}_1x 1x, 3 ${d}_2x 2x, 4 ${d}_3x 3x 5 `,alt:i?.altText||"Promotional banner",loading:"eager",decoding:"async"}),a.jsx("div",{className:"banner-overlay","aria-hidden":"true"}),a.jsxs("div",{className:"banner-content",children:[a.jsx("p",{"data-test-id":"header",className:"header",children:t?.["general.registration-start-header"]}),a.jsx("h2",{"data-test-id":"title",className:"title",children:t?.["general.registration-start-title"]}),a.jsx("p",{"data-test-id":"description",className:"description",children:t?.["general.registration-start-description"]}),a.jsx("div",{className:"banner-button-container",children:a.jsx("button",{"data-test-id":"banner-register-button",className:"banner-button",disabled:l,onClick:()=>{e?.navigationLocations?.registration&&(o(e.navigationLocations.registration),c(e.navigationLocations.registration,t["general.registration-start-title"],t["register.create-account"]))},children:t?.["general.registration-start-cta-button"]||r?.["register.create-account"]})}),a.jsx(B,{})]})]},"registration")}function oe({generalImages:n,translations:t,isDesktop:e,navigate:r,trackGtmEvent:s,isLoading:o=!1}){const c=e?n.mainDesktop:n.mainMobile,l=k(c?.url,e);return a.jsxs("section",{"data-test-id":"banner",className:`banner ${o?"is-loading":""}`,"aria-busy":o,children:[a.jsx("img",{fetchPriority:"high","data-test-id":"banner-image",className:"banner-image",src:`${l}_1x`,srcSet:` 6 ${l}_1x 1x, 7 ${l}_2x 2x, 8 ${l}_3x 3x 9 `,alt:c?.altText||"Promotional banner",loading:"eager",decoding:"async"}),a.jsx("div",{className:"banner-overlay","aria-hidden":"true"}),a.jsxs("div",{className:"banner-content",children:[a.jsx("h2",{className:"title","data-test-id":"title",children:t?.["banner.main.title"]}),a.jsx("p",{className:"description","data-test-id":"description",children:t?.["banner.main.info"]}),a.jsx("div",{className:"banner-button-container",children:a.jsx("button",{"data-test-id":"banner-main-button",className:"banner-button",disabled:o,onClick:()=>{const i=t?.["banner.main.button.link"];i&&(r(i),s(i,t?.["banner.main.title"],t?.["banner.main.button.text"]))},children:t?.["banner.main.button.text"]})})]})]},"main-banner")}function S({generalImages:n,translations:t,isDesktop:e,isAuthenticated:r,user:s,commonTranslations:o,handleDepositClick:c,isLoading:l=!1}){const i=e?n.generalDesktop:n.generalMobile,d=k(i?.url,e);return a.jsxs("section",{"data-test-id":"deposit",className:`banner ${l?"is-loading":""}`,"aria-busy":l,children:[a.jsx("img",{fetchPriority:"high","data-test-id":"banner-image",className:"banner-image",src:`${d}_1x`,srcSet:` 10 ${d}_1x 1x, 11 ${d}_2x 2x, 12 ${d}_3x 3x 13 `,alt:i?.altText||"Promotional banner",loading:"eager",decoding:"async"}),a.jsx("div",{className:"banner-overlay","aria-hidden":"true"}),a.jsxs("div",{className:"banner-content",children:[r&&a.jsx("p",{className:"header","data-test-id":"header","data-hj-suppress":!0,"data-cs-mask":!0,children:t?.["general.welcome"]?.replaceAll("{{name}}",s.firstName)}),a.jsx("h2",{"data-test-id":"title",className:"title",children:t?.["general.deposit-start-title"]}),a.jsx("p",{"data-test-id":"description",className:"description",children:t?.["general.deposit-start-description"]}),a.jsx("div",{className:"banner-button-container",children:a.jsx("button",{"data-test-id":"banner-deposit-button",className:"banner-button",onClick:()=>c(),disabled:l,children:o?.["general.deposit"]})}),a.jsx(B,{})]})]},"deposit")}function ie(n=!1){const[t,e]=u.useState(n);return u.useEffect(()=>{const r=new D(document.obgEventBus.retrieve(L.FeatureFlags)).subscribe(s=>{e(!!s?.theme_alternate?.enabled)});return()=>r.unsubscribe?.()},[]),t}function w(n){return`${n.environment}|${n.brandId}|${n.marketCode}|${n.channel}|${n.countryCode}|${n.device}`}const y={generalMobile:"general.action-banner-mobile",generalDesktop:"general.action-banner-desktop",mainDesktop:"banner.main-background-desktop",mainMobile:"banner.main-background-mobile"};let x={},T={},E={},C={};const ce=n=>{const t=w(n);return t in x||(x[t]=h.getImagesByGroup("general-image",n).then(e=>({generalDesktop:e[y.generalDesktop],generalMobile:e[y.generalMobile],mainDesktop:e[y.mainDesktop],mainMobile:e[y.mainMobile]})).catch(e=>(console.error("Failed to fetch general images",n,e),{generalDesktop:void 0,generalMobile:void 0,mainDesktop:void 0,mainMobile:void 0}))),x[t]},le=n=>{const t=w(n);return t in T||(T[t]=h.getTranslations("general",n).catch(e=>(console.error("Failed to fetch translations",n,e),{}))),T[t]},de=n=>{const t=w(n);return t in E||(E[t]=h.getContentSectionGroup("desktop-common-icons",n).then(e=>e.documents.footerpaymenticons.map(s=>s.content?.logo).flat()).catch(e=>(console.error("Failed to fetch logos",n,e),[]))),E[t]},ue=n=>{const t=w(n);return t in C||(C[t]=h.getTranslations("common",n).catch(e=>(console.error("Failed to fetch common translations",n,e),{}))),C[t]};function me(n,t,e,r){if(n===void 0)return"LOADING";if(n){if(t===void 0)return"LOADING";const o=e?.currencyThreshold??5;return t.total>o?"MAIN":"DEPOSIT"}
13return!!e?.showDepositToUnauthenticated||r?"DEPOSIT":"REGISTER"}function ge({isDesktop:n=!0,context:t,allowLoadingState:e=!1,isAlternateThemeEnabled:r=!1,isAuthenticated:s}){const o=u.use(ce(t)),c=u.use(le(t)),l=u.use(de(t)),i=u.use(ue(t)),[d,O]=u.useState(!1),{isAuthenticated:A,user:I,balance:j,config:m}=q(),g=A??s,M=ie(r)?"action-banner-alternate-ui":"action-banner";u.useEffect(()=>{globalThis.isDOMSSR||O(localStorage.getItem("lastActiveUsername")!==null)},[]);const p=u.useCallback((v,U,G)=>{document.obgEventBus.dispatch(F.Track,{event:Q.PromotionBannerClick,PromotionName:U||G,CampaignClicked:v?.split("?")[1],ClickUrl:v?.split("?")[0]})},[]),P=u.useCallback(v=>{document.obgEventBus.dispatch(V.RouterNavigate,{route:{name:v,params:{}}})},[]),$=u.useCallback(()=>{p(m?.navigationLocations?.deposit??"",c?.["general.deposit-start-title"],c?.["general.deposit"]),g?document.obgEventBus.dispatch(_.StartDepositJourney):document.obgEventBus.dispatch(_.StartLoginDepositOnFinish)},[p,m,c,g]),f=me(g,j,m,d)==="LOADING"&&e;let b;return g?j&&j.total>(m?.currencyThreshold??5)?b=a.jsx(oe,{isLoading:f,generalImages:o,translations:c,isDesktop:n,navigate:P,trackGtmEvent:p}):b=a.jsx(S,{isLoading:f,generalImages:o,translations:c,isDesktop:n,isAuthenticated:g,user:I,commonTranslations:i,handleDepositClick:$}):m?.showDepositToUnauthenticated||d?b=a.jsx(S,{isLoading:f,generalImages:o,translations:c,isDesktop:n,isAuthenticated:g??!1,user:I,commonTranslations:i,handleDepositClick:$}):b=a.jsx(se,{isLoading:f,generalImages:o,translations:c,config:m,commonTranslations:i,isDesktop:n,navigate:P,trackGtmEvent:p}),a.jsx("div",{className:"action-banner-wrapper",children:a.jsx("div",{className:M,children:a.jsx(ee,{value:{logos:l},children:b})})})}function he({userContext:n,appContext:t}){const{requestId:e,...r}=n;return a.jsx(ge,{isDesktop:n.device===W.DESKTOP,context:{...r,marketCode:t.locale,brandId:t.brandId,environment:t.environment}})}const Te=Object.freeze(Object.defineProperty({__proto__:null,default:he},Symbol.toStringTag,{value:"Module"}));export{he as R,Te as i};
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.