1import{v,r as n,j as e,L as i}from"./index-f3Er14TH.js";import{l as b}from"./checkoutSession-DAN9IAlp.js";import{g as N}from"./errorMessages-C7Va5L4Q.js";import{a as k}from"./ordersApi-hpjVEbGJ.js";import{g as w}from"./programSchedule-B-Kyj00n.js";const _=new Intl.NumberFormat("ko-KR");function y(s){return`${_.format(s)}ì`}function W(s){return s.get("orderId")??s.get("checkoutOrderId")}function C(s){const r=s.get("amount");if(!r)return null;const a=Number(r);return Number.isFinite(a)?a:null}function $(){const[s]=v(),r=W(s),a=s.get("paymentKey"),c=C(s),[t,d]=n.useState(null),[l,g]=n.useState(null),[x,p]=n.useState(null),[j,u]=n.useState(!1),m=n.useRef(null);if(n.useEffect(()=>{if(!r){d(null);return}d(b(r))},[r]),n.useEffect(()=>{if(!r||!t||!a||c===null)return;const f=`${a}:${c}:${r}`;m.current!==f&&(m.current=f,u(!0),p(null),k({order_id:r,checkout_token:t.checkout_token,payment_key:a,amount:c}).then(o=>{g(o)}).catch(o=>{p(N(o,"ê²°ì 를 ì¹ì¸íì§ ëª»íìµëë¤."))}).finally(()=>{u(!1)}))},[c,t,r,a]),!r||!t)return e.jsx("div",{className:"min-h-screen px-6 py-16",style:{background:"var(--paper)"},children:e.jsxs("div",{className:"mx-auto flex w-full max-w-[780px] flex-col gap-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-[13px] uppercase tracking-[0.14em]",style:{color:"var(--text-tertiary)"},children:"Payment Result"}),e.jsx("h1",{className:"text-[32px] leading-[1.1] tracking-tight",style:{color:"var(--brand-ink)",fontFamily:"var(--font-serif)"},children:"ê²°ì ê²°ê³¼ ì 보를 ì°¾ì ì ììµëë¤."}),e.jsx("p",{className:"text-[15px] leading-7",style:{color:"var(--text-soft)"},children:"ìê° ì ì² íë©´ìì 주문ì ë¤ì ì¤ë¹í ë¤ ê²°ì 를 ì§íí´ ì£¼ì¸ì."})]}),e.jsx(i,{to:"/program",className:"inline-flex w-fit items-center justify-center rounded-lg px-4 py-3 text-[14px] text-white",style:{background:"var(--brand-blue)",fontWeight:600},children:"íë¡ê·¸ë¨ íì´ì§ë¡ ëìê°ê¸°"})]})});const h=`/program/${w(t.program_type)}/enroll?scheduleId=${t.schedule_id}`;return!a||c===null?e.jsx("div",{className:"min-h-screen px-6 py-16",style:{background:"var(--paper)"},children:e.jsxs("div",{className:"mx-auto flex w-full max-w-[840px] flex-col gap-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-[13px] uppercase tracking-[0.14em]",style:{color:"var(--text-tertiary)"},children:"Payment Result"}),e.jsx("h1",{className:"text-[32px] leading-[1.1] tracking-tight",style:{color:"var(--brand-ink)",fontFamily:"var(--font-serif)"},children:"ê²°ì ì¹ì¸ ì 보를 íì¸í ì ììµëë¤."}),e.jsx("p",{className:"text-[15px] leading-7",style:{color:"var(--text-soft)"},children:"ê²°ì ìë£ ì½ë°± ì ë³´ê° ëë½ëì´ ì£¼ë¬¸ì íì íì§ ëª»íìµëë¤. ìê° ì ì² íë©´ìì ë¤ì ìëí´ ì£¼ì¸ì."})]}),e.jsx(i,{to:h,className:"inline-flex w-fit items-center justify-center rounded-lg px-4 py-3 text-[14px] text-white",style:{background:"var(--brand-blue)",fontWeight:600},children:"ë¤ì ìë"})]})}):e.jsx("div",{className:"min-h-screen px-6 py-16",style:{background:"var(--paper)"},children:e.jsxs("div",{className:"mx-auto flex w-full max-w-[1080px] flex-col gap-8",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-[13px] uppercase tracking-[0.14em]",style:{color:"var(--text-tertiary)"},children:"Payment Result"}),e.jsx("h1",{className:"text-[32px] leading-[1.1] tracking-tight",style:{color:"var(--brand-ink)",fontFamily:"var(--font-serif)"},children:l?"ê²°ì ê° ìë£ëììµëë¤.":"ê²°ì 를 íì¸íê³ ììµëë¤."}),e.jsx("p",{className:"max-w-3xl text-[15px] leading-7",style:{color:"var(--text-soft)"},children:l?"주문과 ìê° ë±ë¡ì´ íì ëììµëë¤. ìë¡ê³ 침í´ë ê°ì 주문 결과를 ìì ì ì¼ë¡ ë¤ì íì¸í ì ììµëë¤.":"Toss ì¹ì¸ ê²°ê³¼ì ìë² í¸ëìì
ì ë¤ì ëì¡°í´ ì£¼ë¬¸ì íì íê³ ììµëë¤."})]}),x?e.jsxs("section",{className:"rounded-[28px] border px-6 py-6 sm:px-7 sm:py-7",style:{background:"rgba(196,91,91,0.12)",borderColor:"rgba(196,91,91,0.18)"},children:[e.jsx("p",{className:"text-[16px]",style:{color:"#9f2d2d",fontWeight:700},children:"ê²°ì 를 ìë£ ì²ë¦¬íì§ ëª»íìµëë¤."}),e.jsx("p",{className:"mt-3 text-[14px] leading-7",style:{color:"#9f2d2d"},children:x}),e.jsxs("div",{className:"mt-5 flex flex-wrap gap-3",children:[e.jsx(i,{to:h,className:"inline-flex items-center justify-center rounded-[18px] px-4 py-3 text-[14px] text-white",style:{background:"var(--brand-blue)",fontWeight:700},children:"ìê° ì ì² íë©´ì¼ë¡ ëìê°ê¸°"}),e.jsx(i,{to:`/checkout/${r}`,className:"inline-flex items-center justify-center rounded-[18px] border px-4 py-3 text-[14px]",style:{borderColor:"var(--line-faint)",color:"var(--text-secondary)"},children:"ì²´í¬ììì¼ë¡ ëìê°ê¸°"})]})]}):null,e.jsxs("div",{className:"grid gap-6 lg:grid-cols-[1.02fr_0.98fr]",children:[e.jsx("section",{className:"rounded-[32px] border px-6 py-7 sm:px-8",style:{background:"radial-gradient(circle at top, rgba(111,137,
1132,0.24), rgba(255,255,255,0.96) 62%)",borderColor:"rgba(111,137,132,0.2)"},children:e.jsxs("div",{className:"flex flex-col items-start gap-5",children:[e.jsxs("div",{className:"relative flex h-24 w-24 items-center justify-center",children:[e.jsx("div",{className:"absolute inset-0 rounded-full animate-pulse",style:{background:"rgba(111,137,132,0.18)"}}),e.jsx("div",{className:"relative flex h-16 w-16 items-center justify-center rounded-full text-[34px]",style:{background:"var(--accent-teal)",color:"white",fontWeight:700},children:"â"})]}),j&&!l?e.jsx("p",{className:"text-[15px] leading-7",style:{color:"var(--text-soft)"},children:"ê²°ì ì¹ì¸ê³¼ 주문 íì ì íì¸íë ì¤ì
ëë¤."}):null,l?e.jsxs("div",{className:"w-full space-y-4",children:[e.jsx("p",{className:"text-[16px]",style:{color:"var(--accent-teal)",fontWeight:700},children:"주문과 ìê° ë±ë¡ì´ ìë£ëììµëë¤."}),e.jsxs("div",{className:"space-y-2 text-[14px] leading-7",style:{color:"var(--text-secondary)"},children:[e.jsxs("p",{children:["주문ë²í¸ ",e.jsx("span",{style:{fontWeight:700},children:l.order_id})]}),e.jsxs("p",{children:["íë¡ê·¸ë¨"," ",e.jsx("span",{style:{fontWeight:700},children:t.program_name})]}),e.jsxs("p",{children:["ì¼ì ",e.jsx("span",{style:{fontWeight:700},children:l.schedule_date})]}),e.jsxs("p",{children:["ê²°ì ê¸ì¡"," ",e.jsx("span",{style:{fontWeight:700},children:y(l.final_amount)})]}),e.jsxs("p",{children:["ê²°ì ìí ",e.jsx("span",{style:{fontWeight:700},children:l.status})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-3 pt-2",children:[l.receipt_url?e.jsx("a",{href:l.receipt_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center justify-center rounded-[18px] border px-4 py-3 text-[14px]",style:{borderColor:"var(--line-faint)",color:"var(--brand-blue)",fontWeight:700},children:"ììì¦ ë³´ê¸°"}):null,e.jsx(i,{to:"/mypage",className:"inline-flex items-center justify-center rounded-[18px] px-4 py-3 text-[14px] text-white",style:{background:"var(--brand-blue)",fontWeight:700},children:"My Pageìì íì¸í기"})]})]}):null]})}),e.jsxs("section",{className:"rounded-[28px] border px-6 py-6 sm:px-7 sm:py-7",style:{background:"rgba(255,255,255,0.94)",borderColor:"var(--line-faint)"},children:[e.jsx("p",{className:"text-[12px] uppercase tracking-[0.14em]",style:{color:"var(--text-tertiary)"},children:"Order Summary"}),e.jsx("h2",{className:"mt-2 text-[24px] leading-[1.15] tracking-tight",style:{color:"var(--brand-ink)",fontFamily:"var(--font-serif)"},children:t.program_name}),e.jsxs("div",{className:"mt-6 space-y-4 text-[14px] leading-7",style:{color:"var(--text-soft)"},children:[e.jsxs("div",{children:[e.jsx("p",{style:{color:"var(--text-tertiary)"},children:"ì¼ì "}),e.jsx("p",{style:{color:"var(--text-primary)",fontWeight:700},children:t.schedule_title}),e.jsx("p",{children:t.schedule_date})]}),e.jsxs("div",{children:[e.jsx("p",{style:{color:"var(--text-tertiary)"},children:"ê²°ì ê¸ì¡"}),e.jsx("p",{style:{color:"var(--text-primary)",fontWeight:700},children:y(t.final_amount)})]}),t.coupon_code?e.jsxs("div",{children:[e.jsx("p",{style:{color:"var(--text-tertiary)"},children:"ì ì© ì¿ í°"}),e.jsx("p",{style:{color:"var(--brand-blue)",fontWeight:700},children:t.coupon_code})]}):null]})]})]})]})})}export{$ as default};
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.