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]=`04b089fa-24f7-4103-bca1-13dcfc4bcf83`,e._sentryDebugIdIdentifier=`sentry-dbid-04b089fa-24f7-4103-bca1-13dcfc4bcf83`)}catch{}import"./rolldown-runtime-nx40z1zs.js";import{$m as e,Ag as t,Hm as n,Mc as r,ng as i,xr as a}from"./entry.client-mpghtlrl.js";import{pt as o}from"./xds-react-components-ihgca01z.js";import{n as s}from"./dist-jv0txkve.js";import{i as c}from"./purchasePageReadyUtils-h1z511qr.js";import{l}from"./PurchaseDialog-fpui7yuh.js";var u=t(),d=i(),f=t=>{let i=(0,u.c)(29),{error:a,exit:c,cV:f}=t,{locSomethingWentWrong:m,locGenericErrorSubheading:h}=n(),{t:g}=e(`PurchaseError`),_;i[0]===m?_=i[1]:(_=m(),i[0]=m,i[1]=_);let v=_,y;i[2]===h?y=i[3]:(y=h(),i[2]=h,i[3]=y);let b=y;if(a instanceof r)v=a.title||v,b=a.description||b;else if(a.name===s.UserFailedChallenge){let e;i[4]===g?e=i[5]:(e=g(`An incorrect payment challenge response was provided.`,{shortKey:`failed_challenge_error`}),i[4]=g,i[5]=e),b=e}else if(a.name===`ErrorDuringPaymentComplete`){let e;i[6]===g?e=i[7]:(e=g(`Payment unsuccessful`,{shortKey:`failed_async_purchase_error_title`}),i[6]=g,i[7]=e),v=e;let t;i[8]===g?t=i[9]:(t=g(`Something went wrong when we tried to complete your payment. Please try again.`,{shortKey:`failed_async_purchase_error`}),i[8]=g,i[9]=t),b=t}let x;i[10]===v?x=i[11]:(x=(0,d.jsx)(`h1`,{className:`text-noninteractive-content-primary-content type-display2`,children:v}),i[10]=v,i[11]=x);let S;i[12]===a.tags.code?S=i[13]:(S=(0,d.jsx)(`p`,{className:`text-noninteractive-content-primary-content type-subtitle2`,children:a.tags.code}),i[12]=a.tags.code,i[13]=S);let C;i[14]===f?C=i[15]:(C=f&&(0,d.jsx)(`p`,{className:`text-noninteractive-content-primary-content type-subtitle2`,children:f}),i[14]=f,i[15]=C);let w;i[16]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,d.jsx)(o,{variant:`subtle`,className:`self-stretch`}),i[16]=w):w=i[16];let T;i[17]===b?T=i[18]:(T=(0,d.jsx)(`p`,{className:`text-noninteractive-content-primary-content type-subtitle2`,children:b}),i[17]=b,i[18]=T);let E;i[19]!==x||i[20]!==S||i[21]!==C||i[22]!==T?(E=(0,d.jsx)(`div`,{className:`flex grow flex-row items-center justify-center`,children:(0,d.jsxs)(`div`,{className:`flex w-full flex-col items-start justify-center gap-4`,children:[x,S,C,w,T]})}),i[19]=x,i[20]=S,i[21]=C,i[22]=T,i[23]=E):E=i[23];let D;i[24]===c?D=i[25]:(D=(0,d.jsx)(p,{exit:c}),i[24]=c,i[25]=D);let O;return i[26]!==E||i[27]!==D?(O=(0,d.jsx)(l,{children:(0,d.jsx)(`div`,{className:`relative flex h-full flex-col justify-center lg-10:flex-row`,children:(0,d.jsxs)(`div`,{className:`flex w-full grow flex-col p-[24px] sm-10:p-[32px] lg-10:p-[48px] xl-10:p-[80px] density-high:xl-10:p-[48px]`,children:[E,D]})})}),i[26]=E,i[27]=D,i[28]=O):O=i[28],O},p=e=>{let t=(0,u.c)(7),{exit:r}=e,{locClose:i}=n(),o;t[0]===r?o=t[1]:(o=()=>r?.(),t[0]=r,t[1]=o),c(o);let s;t[2]===i?s=t[3]:(s=i(),t[2]=i,t[3]=s);let l;return t[4]!==r||t[5]!==s?(l=(0,d.jsx)(`div`,{className:`flex gap-[16px]`,children:(0,d.jsx)(a,{as:`button`,kind:`standard`,onPress:r,size:`large`,children:s})}),t[4]=r,t[5]=s,t[6]=l):l=t[6],l};export{f as default};