PageSourceSearch

https://naemo.ai/_next/static/chunks/1658.d2fd3932f147b4db.js

js naemo.ai collected 2026-09-24 14:30:40 UTC 15,926 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1658],{32660:function(e,t,n){n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},21047:function(e,t,n){n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]])},91455:function(e,t,n){n.d(t,{s:function(){return i}});var r=n(57437),s=n(2265),a=n(93448);function i(e){let{options:t,value:n,onChange:i,className:l,itemClassName:c,activeItemClassName:o,inactiveItemClassName:d,indicatorClassName:x,variant:u="pill",underlineThickness:m=2,disabled:h=!1,equalWidth:f=!1,"aria-label":b}=e,p=(0,s.useRef)(null),N=(0,s.useRef)({}),[j,v]=(0,s.useState)(null),[z,g]=(0,s.useState)(!1),k=t.map(e=>e.key).join("\0"),y=(0,s.useCallback)(()=>{let e=p.current,t=N.current[n];if(!e||!t||0===t.offsetWidth){v(e=>null===e?e:null);return}let r={left:t.offsetLeft,top:t.offsetTop,width:t.offsetWidth,height:t.offsetHeight};v(e=>e&&e.left===r.left&&e.top===r.top&&e.width===r.width&&e.height===r.height?e:r)},[n]);(0,s.useLayoutEffect)(()=>{y()},[y,k,u]),(0,s.useEffect)(()=>{if(!j||z)return;let e=requestAnimationFrame(()=>g(!0));return()=>cancelAnimationFrame(e)},[j,z]),(0,s.useEffect)(()=>{let e=p.current;if(!e||"undefined"==typeof ResizeObserver)return;let t=new ResizeObserver(()=>y());return t.observe(e),Object.values(N.current).forEach(e=>{e&&t.observe(e)}),()=>t.disconnect()},[y,k]),(0,s.useEffect)(()=>{let e=document.fonts;if(!(null==e?void 0:e.ready))return;let t=!1;return e.ready.then(()=>{t||y()}).catch(()=>{}),()=>{t=!0}},[y]);let w=!!j&&!h;return(0,r.jsxs)("div",{ref:p,role:"group","aria-label":b,className:(0,a.cn)("relative flex items-center",l),children:[(0,r.jsx)("div",{"aria-hidden":!0,className:(0,a.cn)("absolute left-0 top-0 pointer-events-none","pill"===u?"rounded-lg":"rounded-full",z&&"transition-[transform,width,opacity] duration-300 ease-out motion-reduce:transition-none",w?"opacity-100":"opacity-0",x),style:j?{transform:"translate3d(".concat(j.left,"px, ").concat("underline"===u?j.top+j.height-m:j.top,"px, 0)"),width:j.width,height:"underline"===u?m:j.height}:void 0}),t.map(e=>{let t=e.key===n;return(0,r.jsx)("button",{ref:t=>{N.current[e.key]=t},type:"button","aria-pressed":t,title:e.title,"aria-label":e.ariaLabel,disabled:h,onClick:()=>i(e.key),className:(0,a.cn)("relative z-10 flex items-center justify-center transition-colors duration-200 motion-reduce:transition-none",f&&"flex-1",c,t?o:d,e.className),children:e.label},e.key)})]})}},61658:function(e,t,n){n.r(t),n.d(t,{default:function(){return y}});var r=n(57437),s=n(2265),a=n(27526),i=n(32489),l=n(32660),c=n(21047),o=n(99397),d=n(30401),x=n(82023),u=n(76865),m=n(53834),h=n(93448),f=n(91455),b=n(98319),p=n(48313),N=n(83008),j=n(67920),v=n(93292),z=n(40257);let g="live_ck_4yKeq5bgrpWgyX6jdZjZVGX0lzW6",k=z.env.NEXT_PUBLIC_TOSS_BILLING_CLIENT_KEY||g;function y(){let[e,t]=(0,s.useState)("ONETIME"),[n,z]=(0,s.useState)(1),[y,w]=(0,s.useState)(1),[C,S]=(0,s.useState)(!1),[I,E]=(0,s.useState)(!1),[T,O]=(0,s.useState)(!1),[U,P]=(0,s.useState)(""),{data:R}=(0,a.kP)(),{showToast:M}=(0,b.p)(),Z=(0,j.XC)();(0,s.useEffect)(()=>{y>=2&&"ONETIME"!==e&&t("ONETIME")},[y,e]),(0,s.useEffect)(()=>{(async()=>{let e=await (0,N.X)("getCurrentSchool",{},Z);if(e.success&&e.data){let t=e.data.role;t&&"SCHOOL_ADMIN"!==t&&(O(!0),P(e.data.name||""))}})()},[Z]);let B=v.XU,L="SUBSCRIPTION"===e?1:n,_="SUBSCRIPTION"===e?0:(0,v.d5)(n),A="SUBSCRIPTION"===e?1:(0,v.ES)(n),F=y*B*L,H=y*B*_,W=y*B*A;(0,s.useEffect)(()=>{if(window.TossPayments)S(!0);else{let e=document.createElement("script");e.src="https://js.tosspayments.com/v2/standard",e.async=!0,e.onload=()=>{S(!0)},e.onerror=()=>{console.error("Failed to load Toss Payments SDK"),M("결제 시스템을 불러오는데 실패했습니다.","error")},document.head.appendChild(e)}},[M]);let X=()=>{window.dispatchEvent(new CustomEvent("navigate-view",{detail:"plans"}))},q=(0,s.useCallback)(()=>{let e=Date.now(),t=Math.random().toString(36).substring(2,8).toUpperCase();return"NAEMO-".concat(e,"-").concat(t)},[]),D=async()=>
1{if(!g){M("결제 시스템이 설정되지 않았습니다.","error");return}if(!C||!window.TossPayments){M("결제 시스템을 불러오는 중입니다. 잠시 후 다시 시도해 주세요.","info");return}E(!0);try{var t;let r="SUBSCRIPTION"===e?k:g,s=window.TossPayments(r),a=(null==R?void 0:null===(t=R.user)||void 0===t?void 0:t.id)?"customer-".concat(R.user.id):"customer-".concat(Date.now()),i=s.payment({customerKey:a}),l=window.location.origin;if("SUBSCRIPTION"===e){await i.requestBillingAuth({method:"CARD",successUrl:"".concat(l,"/payment/success?type=billing-auth&userCount=").concat(y,"&customerKey=").concat(a),failUrl:"".concat(l,"/payment/fail")});return}{let t=q(),r="내모 학교 플랜 (".concat(y,"명, ").concat(n,"개월)");await i.requestPayment({method:"CARD",amount:{currency:"KRW",value:W},orderId:t,orderName:r,successUrl:"".concat(l,"/payment/success?userCount=").concat(y,"&durationMonths=").concat(L,"&paymentType=").concat(e),failUrl:"".concat(l,"/payment/fail")})}}catch(e){console.error("Payment request error:",e),(null==e?void 0:e.code)!=="USER_CANCEL"&&M((null==e?void 0:e.message)||"결제 요청 중 오류가 발생했습니다.","error")}finally{E(!1)}};return(0,r.jsx)(p.Z,{children:(0,r.jsxs)("div",{className:"fixed inset-0 z-[99999] bg-white dark:bg-[#09090b] text-zinc-900 dark:text-zinc-100 flex flex-col overflow-hidden",children:[(0,r.jsx)("button",{"aria-label":"닫기",onClick:()=>{window.dispatchEvent(new CustomEvent("navigate-view",{detail:"dashboard"}))},className:"absolute top-6 right-6 z-[100000] p-2 text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-full transition",children:(0,r.jsx)(i.Z,{size:24})}),(0,r.jsxs)("div",{className:"flex-1 flex overflow-hidden",children:[(0,r.jsx)("div",{className:"flex-1 overflow-y-auto px-12 py-16 lg:px-24",children:(0,r.jsxs)("div",{className:"max-w-xl mx-auto",children:[(0,r.jsxs)("button",{onClick:X,className:"flex items-center gap-2 text-zinc-500 hover:text-zinc-800 dark:hover:text-zinc-200 transition-colors mb-12 text-sm font-medium",children:[(0,r.jsx)(l.Z,{size:16}),"돌아가기"]}),(0,r.jsx)("h1",{className:"text-3xl font-bold mb-12",children:"이용 플랜 설정하기"}),(0,r.jsxs)("div",{className:"space-y-12",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-bold mb-4",children:"결제 방식"}),(0,r.jsx)(f.s,{value:e,onChange:t,"aria-label":"결제 방식",equalWidth:!0,className:"p-1 bg-zinc-100 dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-2xl w-full max-w-sm",itemClassName:"py-3 px-4 rounded-xl text-sm font-bold",activeItem
1ClassName:"text-zinc-900 dark:text-blue-400",inactiveItemClassName:"text-zinc-500 hover:text-zinc-700 dark:hover:text-zinc-300",indicatorClassName:"bg-white dark:bg-zinc-800 rounded-xl shadow-sm",options:[{key:"ONETIME",label:"일시불"},...y<2?[{key:"SUBSCRIPTION",label:"정기 구독"}]:[]]}),(0,r.jsx)("p",{className:"text-xs text-zinc-500 mt-4 leading-relaxed",children:y>=2?"단체 구매는 일시불만 지원합니다.":"ONETIME"===e?"원하시는 기간만큼 미리 결제하고 사용합니다.":"매월 자동으로 결제되며 결제한 만큼 사용 기간이 연장됩니다."})]}),"ONETIME"===e&&(0,r.jsxs)("div",{className:"animate-in fade-in slide-in-from-top-2 duration-300",children:[(0,r.jsx)("label",{htmlFor:"checkout-duration-months",className:"block text-sm font-bold mb-4",children:"이용 기간 (개월)"}),(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsxs)("div",{className:"flex-1 relative bg-zinc-50 dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-xl px-4 py-3 flex items-center",children:[(0,r.jsx)("input",{id:"checkout-duration-months",type:"number",min:1,value:n,onChange:e=>{let t=parseInt(e.target.value);!isNaN(t)&&t>=1?z(t):""===e.target.value&&z(1)},onBlur:e=>{let t=parseInt(e.target.value);z(isNaN(t)||t<1?1:t)},className:"w-16 bg-transparent text-lg font-medium outline-none [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none"}),(0,r.jsx)("span",{className:"text-lg font-medium text-zinc-500",children:"개월"})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("button",{"aria-label":"이용 기간 줄이기",onClick:()=>z(e=>Math.max(1,e-1)),className:"w-12 h-12 flex items-center justify-center border border-zinc-200 dark:border-zinc-800 rounded-xl hover:bg-zinc-50 dark:hover:bg-zinc-800 transition-colors",children:(0,r.jsx)(c.Z,{size:20})}),(0,r.jsx)("button",{"aria-label":"이용 기간 늘리기",onClick:()=>z(e=>e+1),className:"w-12 h-12 flex items-center justify-center border border-zinc-200 dark:border-zinc-800 rounded-xl hover:bg-zinc-50 dark:hover:bg-zinc-800 transition-colors",children:(0,r.jsx)(o.Z,{size:20})})]})]}),(0,r.jsx)("p",{className:(0,h.cn)("text-xs mt-4 leading-relaxed flex items-center gap-1",_>0?"text-emerald-600 dark:text-emerald-400 font-medium":"text-zinc-500"),children:_>0?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d.Z,{size:13,className:"shrink-0"}),_,"개월치 요금이 할인됐어요"]}):"12개월을 선택하면 10개월 요금으로 할인됩니다."}),(0,v.Hi)(n)>0?(0,r.jsxs)("div",{className:"mt-3 flex items-start gap-2 rounded-xl bg-zinc-50 dark:bg-zinc-800/50 border border-zinc-200 dark:border-zinc-700/50 px-3 py-2.5",children:[(0,r.jsx)(x.Z,{size:14,className:"text-zinc-400 dark:text-zinc-500 shrink-0 mt-0.5"}),(0,r.jsx)("p",{className:"text-[12.5px] text-zinc-600 dark:text-zinc-300 leading-relaxed",children:y>=2?(0,r.jsxs)(r.Fragment,{children:["코드를 등록하는 선생님마다 AI 크레딧 ",(0,r.jsxs)("span",{className:"font-bold text-zinc-900 dark:text-white",children:[(0,v.Hi)(n),"개"]}),"가 지급됩니다."]}):(0,r.jsxs)(r.Fragment,{children:["AI 작성에 쓰는 크레딧 ",(0,r.jsxs)("span",{className:"font-bold text-zinc-900 dark:text-white",children:[(0,v.Hi)(n),"개"]}),"를 함께 드려요."]})})]}):(0,r.jsx)("p",{className:"text-[12px] mt-2 text-zinc-400 dark:text-zinc-500 leading-relaxed",children:"6개월 이상 결제 시 AI 크레딧 100개, 12개월 이상 200개를 드려요."})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{htmlFor:"checkout-user-count",className:"block text-sm font-bold mb-4",children:"사용자 수"}),(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsxs)("div",{className:"flex-1 relative bg-zinc-50 dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-xl px-4 py-3 flex items-center",children:[(0,r.jsx)("input",{id:"checkout-user-count",type:"number",min:1,value:y,onChange:e=>{let t=parseInt(e.target.value);!isNaN(t)&&t>=1?w(t):""===e.target.value&&w(1)},onBlur:e=>{let t=parseInt(e.target.value);w(isNaN(t)||t<1?1:t)},className:"w-16 bg-transparent text-lg font-medium outline-none [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none"}),(0,r.jsx)("span",{className:"text-lg font-medium text-zinc-500",children:"명"})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("button",{"aria-label":"사용자 수 줄이기",onClick:()=>w(e=>Math.max(1,e-1)),className:"w-12 h-12 flex items-center justify-center border border-zinc-200 dark:border-zinc-800 rounded-xl hover:bg-zinc-50 dark:hover:bg-zinc-800 transition-colors",children:(0,r.jsx)(c.Z,{size:20})}),(0,r.jsx)("button",{"aria-label":"사용자 수 늘리기",onClick:()=>w(e=>e+1),className:"w-12 h-12 flex items-center justify-center border border-zinc-200 dark:border-zinc-800 rounded-xl hover:bg-zinc-50 dark:hover:bg-zinc-800 transition-colors",children:(0,r.jsx)(o.Z,{size:20})})]})]}),(0,r.jsx)("p",{className:"text-xs text-zinc-500 mt-4 leading-relaxed",children:"이용하실 사용자 수를 선택해 주세요."})]})]})]})}),(0,r.jsx)("div",{className:"w-[450px] border-l border-zinc-100 dark:border-zinc-800 px-12 py-16 bg-[#fcfcfc] dark:bg-[#0c0c0e]",children:(0,r.jsxs)("div",{className:"h-full flex flex-col",children:[(0,r.jsx)("h2",{className:"text-xl font-bold mb-10",children:"요약"}),(0,r.jsxs)("div",{className:"space-y-8 flex-1",children:[(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{className:"flex justify-between items-start",children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)("p",{className:"font-semibold text-zinc-900 dark:text-white text-[15px]",children:["내모 프로 플랜 ","SUBSCRIPTION"===e&&"(구독)"]}),(0,r.jsxs)("p",{className:"text-zinc-500 text-[13px] mt-1",children:[y,"명 \xd7 ","SUBSCRIPTION"===e?"매월 결제":"".concat(n,"개월")]})]}),(0,r.jsxs)("p",{className:"font-semibold text-zinc-900 dark:text-white",children:["₩",F.toLocaleStr
1ing()]})]}),(0,r.jsxs)("div",{className:"flex justify-between items-center text-[13px] text-zinc-500",children:[(0,r.jsx)("p",{children:"1인당 월 요금"}),(0,r.jsxs)("p",{children:["₩",B.toLocaleString()]})]}),H>0&&(0,r.jsxs)("div",{className:"flex justify-between items-center text-[13px] text-zinc-500",children:[(0,r.jsxs)("p",{children:["장기 이용 할인 (",_,"개월)"]}),(0,r.jsxs)("p",{children:["−₩",H.toLocaleString()]})]})]}),(0,r.jsxs)("div",{className:"pt-8 border-t border-zinc-200 dark:border-zinc-800",children:[(0,r.jsxs)("div",{className:"flex justify-between items-baseline mb-2",children:[(0,r.jsx)("p",{className:"text-lg font-bold",children:"SUBSCRIPTION"===e?"매월 결제 금액":"총 결제 금액"}),(0,r.jsxs)("p",{className:"text-2xl font-bold text-zinc-900 dark:text-white",children:["₩",W.toLocaleString()]})]}),(0,r.jsx)("p",{className:"text-[12px] text-zinc-500 leading-relaxed",children:"SUBSCRIPTION"===e?"구독 시작 시 첫 달 요금이 즉시 결제되며, 이후 매월 동일한 금액이 자동 결제됩니다.":"선택하신 인원과 기간에 따라 산출된 총 금액입니다."})]})]}),(0,r.jsxs)("div",{className:"space-y-4",children:[y>=2&&(0,r.jsxs)("p",{className:"text-xs text-zinc-500 text-center leading-relaxed",children:["결제 후 이용권 코드 ",y,"개가 발급됩니다."]}),T&&(0,r.jsx)("div",{className:"p-4 bg-amber-50 dark:bg-amber-900/20 border border-amber-200 dark:border-amber-800 rounded-xl",children:(0,r.jsxs)("div",{className:"flex gap-3",children:[(0,r.jsx)(u.Z,{className:"w-5 h-5 text-amber-600 dark:text-amber-400 flex-shrink-0 mt-0.5"}),(0,r.jsxs)("div",{className:"text-sm",children:[(0,r.jsx)("p",{className:"font-medium text-amber-800 dark:text-amber-200 mb-1",children:"이미 다른 학교에 소속되어 있습니다"}),(0,r.jsxs)("p",{className:"text-amber-700 dark:text-amber-300",children:[U?'현재 "'.concat(U,'"에 소속되어 있습니다. '):"","새로운 프로 플랜을 결제하려면 먼저 기존 학교 연동을 해제해 주세요."]})]})]})}),(0,r.jsx)("button",{type:"button",disabled:I||T,onClick:D,className:(0,h.cn)("btn-primary-solid w-full py-4 rounded-xl font-bold transition-colors duration-150 shadow-lg flex items-center justify-center gap-2 select-none outline-none",I||T?"cursor-not-allowed pointer-events-none":"cursor-pointer"),children:I?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(m.W,{size:20}),"처리 중..."]}):"결제하기"}),(0,r.jsx)("button",{onClick:X,className:"w-full py-3.5 text-zinc-500 hover:text-zinc-800 dark:hover:text-zinc-200 font-medium transition-colors text-[14px]",children:"취소"})]})]})})]})]})})}},93292:function(e,t,n){n.d(t,{ES:function(){return a},Hi:function(){return l},NN:function(){return i},XU:function(){return r},d5:function(){return s}});let r=4900;function s(e){return!Number.isFinite(e)||e<1?0:2*Math.floor(e/12)}function a(e){return e-s(e)}function i(e,t){return e*r*a(t)}function l(e){return e>=12?200:e>=6?100:0}}}]);

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.