PageSourceSearch

https://univai.co.kr/assets/BillingPage-vYbUzCEc.js

js univai.co.kr collected 2026-09-24 11:04:15 UTC 7,914 bytes, 16 lines download raw bytes

1import{f as P,j as e,r as m}from"./vendor-react-CjsGTd1d.js";import{aQ as g,u as j,a6 as k,ak as A,dM as E,d as T,b as C,dR as S,dS as I,an as _,J as w,dT as B,b$ as D,B as L}from"./index-D3GCX3Go.js";import{A as R}from"./config-CuUoe0fj.js";import{f as v,a as H}from"./languageUtils-D4ZAxV3_.js";import{u as $,v as U,w as O,x as z,y as F,z as Y}from"./refundClasses-Cy3aZona.js";import{u as G}from"./usePaymentAmountFormatter-BCqSo_Ol.js";import"./vendor-ui-OidOF7LN.js";import"./vendor-firebase-BCL95voI.js";import"./vendor-markdown-DN_GZLpa.js";/**
2 * @license lucide-react v0.484.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const K=[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Z=g("badge-check",K);/**
7 * @license lucide-react v0.484.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const W=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]],M=g("calendar-days",W);/**
12 * @license lucide-react v0.484.0 - ISC
13 *
14 * This source code is licensed under the ISC license.
15 * See the LICENSE file in the root directory of this source tree.
16 */const J=[["path",{d:"M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z",key:"q3az6g"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 17.5v-11",key:"1jc1ny"}]],V=g("receipt",J),q={active:"subInfoStatusActive",canceled:"subInfoStatusCanceled",inactive:"subInfoStatusInactive",payment_failed:"subInfoStatusPaymentFailed"},Q=({info:n,hidePaymentsLink:i})=>{const{t:a,language:d}=j(),r=P(),s=n.subscription;if(!(s.planId===k.PREMIUM||!!n.firstSubscribedAt||!!s.planType||!!s.paymentMethod))return null;const o=(s.platform||"web").toLowerCase(),h=l=>{if(!l)return"-";try{return v(new Date(l),d,{timeZone:"Asia/Seoul"})}catch{return l}},p=l=>{if(!l)return"-";try{return new Intl.DateTimeFormat(H(d),{timeZone:"Asia/Seoul",year:"numeric",month:"long",day:"numeric"}).format(new Date(l))}catch{return l}},f=()=>{if(o==="ios")return a("subInfoPlatformIos");if(o==="android")return a("subInfoPlatformAndroid");if(o==="polar"||s.paymentMethod==="polar")return a("paymentMethodPolarLabel");const l=(s.paymentMethod||"").toLowerCase();return l==="card"?`${a("subInfoPlatformWeb")} · ${a("paymentMethodCardLabel")}`:l==="kakaopay"?`${a("subInfoPlatformWeb")} · ${a("paymentMethodKakaopayLabel")}`:a("subInfoPlatformWeb")},c=q[(s.status||"").toLowerCase()],y=o==="web"&&!!s.nextBillingAt&&s.status==="active";return e.jsxs("div",{className:"mb-6 rounded-2xl bg-surface px-4 py-4",children:[e.jsxs("div",{className:"mb-3.5 flex items-center justify-between",children:[e.jsx("h3",{className:"text-label-14 text-fg",children:a("subInfoTitle")}),!i&&e.jsxs("button",{type:"button",className:"inline-flex cursor-pointer items-center gap-1 border-0 bg-transparent p-0 text-copy-13 text-fg-muted transition-colors hover:text-fg",onClick:()=>r("/billing"),children:[e.jsx(V,{size:14}),a("subInfoViewPayments")]})]}),e.jsxs("dl",{className:"m-0 grid grid-cols-[repeat(auto-fit,minmax(180px,1fr))] gap-x-5 gap-y-3.5 [&_dd]:m-0 [&_dd]:flex [&_dd]:flex-wrap [&_dd]:items-center [&_dd]:gap-2 [&_dd]:text-label-14 [&_dd]:text-fg [&_dt]:mb-1 [&_dt]:flex [&_dt]:items-center [&_dt]:gap-[5px] [&_dt]:text-copy-13 [&_dt]:text-fg-subtle",children:[e.jsxs("div",{children:[e.jsxs("dt",{children:[e.jsx(Z,{size:14})," ",a("subInfoPlanType")]}),e.jsxs("dd",{children:[s.planType==="yearly"?a("subInfoPlanYearly"):a("subInfoPlanMonthly"),c&&e.jsx("span",{className:`rounded-full px-2 py-0.5 text-label-11 ${(s.status||"").toLowerCase()==="active"?"bg-primary text-primary-fg":(s.status||"").toLowerCase()==="payment_failed"?"bg-surface-hover text-danger":"bg-surface-hover text-fg-muted"}`,children:a(c)})]})]}),e.jsxs("div",{children:[e.jsxs("dt",{children:[e.jsx(M,{size:14})," ",a("subInfoStartDate")]}),e.jsx("dd",{children:h(n.firstSubscribedAt)})]}),e.jsxs("div",{children:[e.jsxs("dt",{children:[e.jsx(A,{size:14})," ",a("subInfoMethod")]}),e.jsx("dd",{children:f()})]}),y&&e.jsxs("div",{children:[e.jsxs("dt",{children:[e.jsx(M,{size:14})," ",a("subInfoNextBilling")]}),e.jsx("dd",{children:p(s.nextBillingAt)}
16)]})]})]})},X={card:"paymentMethodCardLabel",kakaopay:"paymentMethodKakaopayLabel",polar:"paymentMethodPolarLabel",stripe:"paymentMethodStripeLabel",google_play:"paymentMethodGooglePlayLabel",apple:"paymentMethodAppleLabel",portone:"paymentMethodPortoneLabel"},ee=({payments:n})=>{const{t:i,language:a}=j(),d=G(),r=t=>{if(!t)return"-";try{return v(new Date(t),a,{timeZone:"Asia/Seoul"})}catch{return t}},s=t=>{const o=X[(t||"portone").toLowerCase()];return o?i(o):t||"-"};return n.length===0?e.jsxs("div",{className:$,children:[e.jsx(E,{size:20}),e.jsx("p",{children:i("refundHistoryEmpty")})]}):e.jsx("ul",{className:U,children:n.map((t,o)=>e.jsxs("li",{className:O(!!t.refunded,!!t.isLatest),children:[e.jsxs("div",{className:z,children:[e.jsx("span",{className:"text-label-14 text-fg",children:r(t.createdAt)}),e.jsx("span",{className:"text-label-14 text-fg",children:d(t.paymentAmount,t.currency,t.paymentMethod)}),e.jsx("span",{className:"text-copy-13 text-fg-muted",children:s(t.paymentMethod)}),t.isLatest&&!t.refunded&&e.jsx("span",{className:F,children:i("refundLatestBadge")}),t.refunded&&e.jsx("span",{className:Y,children:i("refundRefundedBadge")})]}),e.jsxs("div",{className:"mt-1 text-copy-13 text-fg-subtle",children:[i("refundPeriodLabel"),": ",r(t.periodStart)," ~ ",r(t.periodEnd)]})]},`${t.paymentId??"payment"}-${o}`))})},ue=()=>{const{currentUser:n,loading:i,setShowLoginModal:a}=T(),{theme:d}=C(),{t:r}=j(),s=P(),[t,o]=m.useState(null),[h,p]=m.useState(null),[f,c]=m.useState(!1),[y,l]=m.useState(0);return m.useEffect(()=>{!i&&!n&&a(!0)},[i,n,a]),m.useEffect(()=>{let u=!1;return(async()=>{if(!(i||!n)){o(null),c(!1);try{const x=await n.getIdToken(),N=await fetch(R.MY_SUBSCRIPTION_INFO,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${x}`},body:JSON.stringify({userId:n.uid})}),b=await N.json();!u&&N.ok&&b.success?(o(b.payments??[]),p(b),c(!1)):u||(o([]),c(!0))}catch(x){console.error("[BillingPage] 조회 오류:",x),u||(o([]),c(!0))}}})(),()=>{u=!0}},[n,i,y]),i||n&&t===null?e.jsx("div",{className:`${S} ${d}`,children:e.jsxs("main",{className:I,children:[e.jsx(_,{title:r("billingPageTitle"),desc:r("billingPageDesc")}),e.jsxs("div",{className:"flex flex-col items-center gap-3 py-20 text-copy-14 text-fg-muted",children:[e.jsx(w,{}),e.jsx("p",{children:r("subscriptionLoading")})]})]})}):e.jsx("div",{className:`${S} ${d}`,children:e.jsxs("main",{className:I,children:[e.jsx(_,{title:r("billingPageTitle"),desc:r("billingPageDesc")}),n&&h&&e.jsx(Q,{info:h,hidePaymentsLink:!0}),e.jsxs("section",{children:[e.jsx("h2",{className:B,children:r("refundHistoryTitle")}),f?e.jsxs(D,{variant:"danger",className:"mb-2",children:[e.jsx("p",{children:r("billingHistoryLoadError")}),e.jsx(L,{variant:"secondary",size:"sm",onClick:()=>l(u=>u+1),children:r("retry")})]}):e.jsx(ee,{payments:t??[]})]}),e.jsx("div",{className:"mt-8 flex justify-end max-md:justify-stretch",children:e.jsx(L,{variant:"secondary",className:"max-md:w-full",onClick:()=>s("/refund",{state:{scrollTo:"refund-action"}}),children:r("billingGoRefund")})})]})})};export{ue 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.