import{n as k,t as w,u as o,g as r,e as q,K as C,k as i,A as d,d as t,j as F,F as B,w as S,L as m,E as v,f as g,v as c}from"./vendor-DdcFYYLh.js";import{u as V,_ as A,i as b}from"./Alert.vue_vue_type_script_setup_true_lang-CitRA5Fq.js";const T={class:"card p-6 sm:p-8"},j={key:0,class:"text-center py-12 text-slate-500"},K={key:2},M={class:"grid grid-cols-1 sm:grid-cols-2 gap-4 mt-6"},U={href:"/admin/",class:"group rounded-xl ring-1 ring-slate-200 hover:ring-aqua-500 hover:bg-aqua-50 p-5 transition"},L={class:"text-xs text-slate-600 mt-1"},N={class:"mt-8 rounded-lg ring-1 ring-amber-200 bg-amber-50 p-5"},P={class:"mt-4 grid grid-cols-1 sm:grid-cols-[220px_1fr] gap-5 items-start"},R=["innerHTML"],D={class:"space-y-3"},E={class:"mt-1 flex items-center gap-3"},H={class:"font-mono text-sm select-all bg-white px-2 py-1 rounded ring-1 ring-amber-200"},I={class:"text-xs text-amber-800"},$={class:"block mt-2 break-all bg-white p-2 rounded ring-1 ring-amber-200 select-all"},G={class:"mt-6 rounded-lg ring-1 ring-rose-200 bg-rose-50 p-5"},O={class:"mt-3 grid grid-cols-2 gap-1.5 font-mono text-sm"},Q={class:"mt-6 rounded-lg ring-1 ring-slate-200 p-5"},W={class:"space-y-2 text-sm"},Y={class:"flex items-start gap-2"},z={class:"flex items-start gap-2"},J={class:"flex items-start gap-2"},X={class:"mt-8 flex flex-wrap items-center justify-between gap-3"},Z={class:"flex gap-2"},tt=["href"],lt=k({__name:"Stage5Finish",setup(et){const f=V(),p=c(!0),u=c(null),s=c(null),x=c(!1),n=c({lockBackup:!1,envKey:!1,twoFa:!0});async function _(){p.value=!0,u.value=null;try{const l=await b.stage5Finish();if(!l.ok){u.value=l.error||"완료 처리 실패";return}s.value=l,f.finalResult=l}catch(l){u.value=l?.response?.data?.message||l?.message||"완료 처리 호출 실패"}finally{p.value=!1}}function y(){s.value?.recovery_codes&&navigator.clipboard.writeText(s.value.recovery_codes.join(`
`))}function h(){s.value?.report_token&&window.open(b.reportUrl(s.value.report_token),"_blank")}return w(_),(l,e)=>(o(),r("div",T,[p.value?(o(),r("div",j,"설치 마무리 중...")):u.value?(o(),q(A,{key:1,variant:"error",title:"완료 실패"},{default:C(()=>[i(d(u.value),1)]),_:1})):s.value?(o(),r("div",K,[e[18]||(e[18]=t("div",{class:"text-center py-6"},[t("div",{class:"inline-flex items-center justify-center w-20 h-20 rounded-full bg-emerald-100 text-emerald-700 text-4xl mb-3","aria-hidden":"true"},"✓"),t("h1",{class:"text-3xl font-bold text-slate-900"},"설치가 완료되었습니다"),t("p",{class:"mt-2 text-sm text-slate-600"},"W·Dot CMS v1.0 — 한국형 노코드 플랫폼 사용 준비 완료")],-1)),t("div",M,[t("a",U,[e[4]||(e[4]=t("div",{class:"text-3xl mb-2","aria-hidden":"true"},"🚀",-1)),e[5]||(e[5]=t("div",{class:"text-base font-semibold text-slate-900"},"관리자 진입",-1)),t("p",L,d(s.value.admin_email),1),e[6]||(e[6]=t("p",{class:"text-xs text-aqua-700 mt-2 group-hover:underline"},"/admin/ →",-1))]),e[7]||(e[7]=F('<a href="/" class="group rounded-xl ring-1 ring-slate-200 hover:ring-aqua-500 hover:bg-aqua-50 p-5 transition"><div class="text-3xl mb-2" aria-hidden="true">🌐</div><div class="text-base font-semibold text-slate-900">메인 사이트 보기</div><p class="text-xs text-slate-600 mt-1">마케팅 홈 + 데모 페이지</p><p class="text-xs text-aqua-700 mt-2 group-hover:underline">/ →</p></a><a href="/site/manual/" class="group rounded-xl ring-1 ring-slate-200 hover:ring-aqua-500 hover:bg-aqua-50 p-5 transition"><div class="text-3xl mb-2" aria-hidden="true">📚</div><div class="text-base font-semibold text-slate-900">매뉴얼 읽기</div><p class="text-xs text-slate-600 mt-1">설치 / 관리 / 운영 가이드</p><p class="text-xs text-aqua-700 mt-2 group-hover:underline">/site/manual/ →</p></a><a href="/community/" class="group rounded-xl ring-1 ring-slate-200 hover:ring-aqua-500 hover:bg-aqua-50 p-5 transition"><div class="text-3xl mb-2" aria-hidden="true">💬</div><div class="text-base font-semibold text-slate-900">커뮤니티 시작</div><p class="text-xs text-slate-600 mt-1">게시판 / 토론 / 후원</p><p class="text-xs text-aqua-700 mt-2 group-hover:underline">/community/ →</p></a>',3))]),t("section",N,[e[11]||(e[11]=t("h2",{class:"text-sm font-semibold text-amber-900 uppercase tracking-wide"}," 🔐 2단계 인증 (TOTP) — 지금 등록하세요 ",-1)),t("div",P,[t("div",{innerHTML:s.value.two_factor_qr_svg,class:"rounded bg-white p-3 ring-1 ring-amber-200"},null,8,R),t("div",D,[e[10]||(e[10]=t("p",{class:"text-xs text-amber-900"},[t("strong",null,"Google Authenticator"),i(", "),t("strong",null,"1Password"),i(", "),t("strong",null,"Authy"),i(" 등으로 QR 을 스캔하거나, 아래 secret 을 직접 입력하세요. ")],-1)),t("div",null,[e[8]||(e[8]=t("dt",{class:"text-xs font-semibold text-amber-800 uppercase"},"Secret (한 번만 표시됨)",-1)),t("dd",E,[t("code",H,d(x.value?s.value.two_factor_secret:"••••••••••••••••••••••••••••••••"),1),t("button",{type:"button",class:"text-xs text-aqua-700 underline",onClick:e[0]||(e[0]=a=>x.value=!x.value)},d(x.value?"숨기기":"표시"),1)])]),t("details",I,[e[9]||(e[9]=t("summary",{class:"cursor-pointer underline"},"otpauth:// URI 직접 보기",-1)),t("code",$,d(s.value.two_factor_uri),1)])])])]),t("section",G,[t("div",{class:"flex items-center justify-between"},[e[12]||(e[12]=t("h2",{class:"text-sm font-semibold text-rose-900 uppercase tracking-wide"},"복구 코드 (각 1회 사용)",-1)),t("button",{type:"button",class:"text-xs text-aqua-700 underline",onClick:y},"전체 복사")]),t("div",O,[(o(!0),r(B,null,S(s.value.recovery_codes??[],a=>(o(),r("code",{key:a,class:"text-rose-900 select-all"},d(a),1))),128))])]),t("section",Q,[e[16]||(e[16]=t("h2",{class:"text-sm font-semibold text-slate-800 mb-3"},"✅ 보안 권고",-1)),t("ul",W,[t("li",Y,[m(t("input",{type:"checkbox","onUpdate:modelValue":e[1]||(e[1]=a=>n.value.lockBackup=a),class:"mt-1"},null,512),[[v,n.value.lockBackup]]),e[13]||(e[13]=t("span",null,[t("code",{class:"text-xs bg-slate-100 px-1 py-0.5 rounded"},"install.lock"),i(" 파일을 안전한 위치에 백업했습니다.")],-1))]),t("li",z,[m(t("input",{type:"checkbox","onUpdate:modelValue":e[2]||(e[2]=a=>n.value.envKey=a),class:"mt-1"},null,512),[[v,n.value.envKey]]),e[14]||(e[14]=t("span",null,[t("code",{class:"text-xs bg-slate-100 px-1 py-0.5 rounded"},"APP_KEY"),i(" 환경변수를 안전하게 보관했습니다 (.env 권한 600).")],-1))]),t("li",J,[m(t("input",{type:"checkbox","onUpdate:modelValue":e[3]||(e[3]=a=>n.value.twoFa=a),class:"mt-1"},null,512),[[v,n.value.twoFa]]),e[15]||(e[15]=t("span",null,"super-admin 의 2FA secret + 복구 코드를 password manager 에 저장했습니다.",-1))])])]),t("div",X,[s.value.report_token?(o(),r("button",{key:0,class:"btn-secondary",onClick:h}," 📄 설치 보고서 다운로드 ")):g("",!0),t("div",Z,[e[17]||(e[17]=t("a",{href:"/site/manual/",class:"btn-secondary"},"매뉴얼 보기",-1)),t("a",{href:s.value.next_url||"/admin",class:"btn-primary"},"관리자로 이동 →",8,tt)])])])):g("",!0)]))}});export{lt as default};
