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]=`b05775b8-bf2b-4eee-8ab5-bb11d885573e`,e._sentryDebugIdIdentifier=`sentry-dbid-b05775b8-bf2b-4eee-8ab5-bb11d885573e`)}catch{}import{o as e}from"./rolldown-runtime-nx40z1zs.js";import{$m as t,Ag as n,Hm as r,Qm as i,ei as a,jg as o,ng as s,xr as c}from"./entry.client-mpghtlrl.js";import{dr as l,mt as u}from"./xds-icons-m106f2fc.js";import{n as d}from"./purchasePageReadyUtils-h1z511qr.js";import{c as f,o as p}from"./PurchaseDialog-fpui7yuh.js";var m=n(),h=e(o(),1),g=s(),_=e=>{let n=(0,m.c)(41),{trackAppAction:o}=i(),{t:s}=t(`PurchaseAskAParent`),{locCancel:_}=r();d(e.onPurchasePageReady);let v,y;n[0]===e.timeToInteractiveSpan?(v=n[1],y=n[2]):(v=()=>{e.timeToInteractiveSpan?.end()},y=[e.timeToInteractiveSpan],n[0]=e.timeToInteractiveSpan,n[1]=v,n[2]=y),(0,h.useEffect)(v,y);let b,x;if(n[3]!==o||n[4]!==e.productId||n[5]!==e.canAskParent||n[6]!==e.canRedeemGiftCard?(b=()=>{o(`ShowPurchaseAskAParent`,{productId:e.productId,canAskAParent:e.canAskParent,canRedeemGiftCard:e.canRedeemGiftCard},{location:`AskAParent`})},x=[o,e.productId,e.canAskParent,e.canRedeemGiftCard],n[3]=o,n[4]=e.productId,n[5]=e.canAskParent,n[6]=e.canRedeemGiftCard,n[7]=b,n[8]=x):(b=n[7],x=n[8]),(0,h.useEffect)(b,x),(e.canAskParent||e.canRedeemGiftCard)&&e.status!==`Ready`){let e;return n[9]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,g.jsx)(f,{children:(0,g.jsx)(p,{})}),n[9]=e):e=n[9],e}let S;n[10]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,g.jsx)(`div`,{className:`pointer-events-none absolute end-0 start-0 top-0 z-10 h-24 bg-gradient-to-b from-white/20 to-transparent`}),n[10]=S):S=n[10];let C;n[11]===e.header?C=n[12]:(C=(0,g.jsx)(`h1`,{className:`mb-layout-vertical-title-and-row-regular text-noninteractive-content-primary-content type-section3`,children:e.header}),n[11]=e.header,n[12]=C);let w;n[13]===e.message?w=n[14]:(w=(0,g.jsx)(`p`,{className:`text-noninteractive-content-primary-content type-subtitle2`,children:e.message}),n[13]=e.message,n[14]=w);let T;n[15]===e.extraMessage?T=n[16]:(T=!!e.extraMessage&&(0,g.jsx)(`p`,{className:`text-noninteractive-content-primary-content type-subtitle2`,children:e.extraMessage}),n[15]=e.extraMessage,n[16]=T);let E;n[17]!==C||n[18]!==w||n[19]!==T?(E=(0,g.jsxs)(`div`,{className:`m-layout-vertical-related-content-in-a-section-tight`,children:[C,w,T]}),n[17]=C,n[18]=w,n[19]=T,n[20]=E):E=n[20];let D;n[21]!==e||n[22]!==s?(D=e.canAskParent&&(0,g.jsx)(c,{className:`mb-layout-vertical-related-content-in-a-section-tight w-full`,as:`button`,onPress:()=>e.status===`Ready`&&e.ask(),children:(0,g.jsxs)(`div`,{className:`inline-flex w-full items-center justify-start p-[2px]`,children:[(0,g.jsx)(`div`,{className:`inline-flex`,children:(0,g.jsx)(`p`,{className:`mx-internal-gap-tight type-subtitle2`,children:s(`Send a request`,{shortKey:`send_a_request`})})}),(0,g.jsx)(`div`,{className:`inline-flex w-full justify-end`,children:(0,g.jsx)(a,{size:`title1`,icon:(0,g.jsx)(l,{})})})]})}),n[21]=e,n[22]=s,n[23]=D):D=n[23];let O;n[24]!==e||n[25]!==s?(O=e.canRedeemGiftCard&&(0,g.jsx)(c,{className:`mb-layout-vertical-related-content-in-a-section-tight w-full`,as:`button`,onPress:()=>e.status===`Ready`&&e.redeem(),children:(0,g.jsxs)(`div`,{className:`inline-flex w-full items-center justify-start p-[2px]`,children:[(0,g.jsx)(a,{size:`title1`,icon:(0,g.jsx)(u,{})}),(0,g.jsx)(`div`,{className:`inline-flex`,children:(0,g.jsx)(`p`,{className:`mx-internal-gap-tight type-subtitle2`,children:s(`Redeem gift card`,{shortKey:`redeem_gift_card`})})}),(0,g.jsx)(`div`,{className:`inline-flex w-full justify-end`,children:(0,g.jsx)(a,{size:`title1`,icon:(0,g.jsx)(l,{})})})]})}),n[24]=e,n[25]=s,n[26]=O):O=n[26];let k;n[27]!==D||n[28]!==O?(k=(0,g.jsxs)(`div`,{className:`grow`,children:[D,O]}),n[27]=D,n[28]=O,n[29]=k):k=n[29];let A=e.exit,j;n[30]===_?j=n[31]:(j=_(),n[30]=_,n[31]=j);let M;n[32]!==e.exit||n[33]!==j?(M=(0,g.jsx)(c,{as:`button`,kind:`standard`,onPress:A,size:`standard`,className:`w-full px-6 py-4`,children:j}),n[32]=e.exit,n[33]=j,n[34]=M):M=n[34];let N;n[35]!==k||n[36]!==M?(N=(0,g.jsxs)(`div`,{className:`m-layout-vertical-related-content-in-a-section-tight flex grow flex-col`,children:[k,M]}),n[35]=k,n[36]=M,n[37]=N):N=n[37];let P;return n[38]!==E||n[39]!==N?(P=(0,g.jsx)(f,{children:(0,g.jsxs)(`div`,{className:`backdrop-blur-4xl relative flex h-full flex-col bg-container-backgrounds-overlay-scrim-extra-thin`,children:[S,E,N]})}),n[38]=E,n[39]=N,n[40]=P):P=n[40],P};export{_ as default};