try{let e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`11d49d50-90a5-4c76-96aa-6ed4bfe2387b`,e._sentryDebugIdIdentifier=`sentry-dbid-11d49d50-90a5-4c76-96aa-6ed4bfe2387b`)}catch{}import{o as e}from"./rolldown-runtime-eb2nym32.js";import{Ag as t,Ig as n,Um as r,Ym as i,do as a,fo as o,mo as s,mr as c,qm as l,sh as u}from"./entry.client-dr7r6s9a.js";import{r as d,t as f}from"./ContextualStoreHost-j7xjb8fo.js";var p=e(n(),1),m=t(),h=i(c(function(){let{productId:e,skuId:t,availabilityId:n}=l(),{search:i}=r(),{logging:c}=u(),h=(0,p.useMemo)(()=>c.getLogger(`ContextualStorePage`),[c]),g=(0,p.useMemo)(()=>new URLSearchParams(i),[i]),_=(0,p.useMemo)(()=>g.get(`skipPurchaseConfirmation`)===`true`,[g]),v=(0,p.useMemo)(()=>g.get(`version`)===`v1`?a.v1:a.v2,[g]),y=(0,p.useMemo)(()=>g.get(`theme`)===`light`?o.Light:o.Dark,[g]),b=(0,p.useMemo)(()=>g.get(`callerApplicationId`)||void 0,[g]),x=(0,p.useMemo)(()=>{switch(g.get(`experience`)){case s.Browse:return s.Browse;case s.Redeem:return s.Redeem;case s.Purchase:return s.Purchase;default:case s.Details:return s.Details}},[g]),S=(0,p.useMemo)(()=>g.get(`campaignId`)||void 0,[g]),C=(0,p.useMemo)(()=>g.get(`itemTypes`)||``,[g]),w=(0,p.useMemo)(()=>g.get(`hideClose`)===`true`,[g]),T=(0,p.useMemo)(()=>g.get(`referringProductId`)||void 0,[g]),E=(0,p.useMemo)(()=>g.get(`xStoreScenario`)||void 0,[g]),D=(0,p.useMemo)(()=>g.get(`clientType`)||void 0,[g]),O=(0,p.useCallback)(()=>{h.info(`Contextual Store closed`)},[h]);if(!e)throw h.error(`Product ID is missing`),Error(`Product ID is required to render Contextual Store`);return(0,m.jsx)(p.Suspense,{fallback:(0,m.jsx)(d,{}),children:(0,m.jsx)(`div`,{className:`relative h-screen w-full`,children:(0,m.jsx)(f,{productId:e,skuId:t,availabilityId:n,skipPurchaseConfirmation:_,version:v,theme:y,callerApplicationId:b,experience:x,campaignId:S,itemTypes:C,referringProductId:T,hideClose:w,xStoreScenario:E,sourceClientName:D,onClose:O})})})},`ContextualStorePage`));export{h as default};