const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["js/ssl-log.js?v=1753954525509","js/index101.js?v=1753954525509","js/vue.js?v=1753954525509","js/__commonjsHelpers__.js?v=1753954525509","js/page_layout.js?v=1753954525509","js/naive.js?v=1753954525509","js/common.js?v=1753954525509","js/public.js?v=1753954525509","css/public.css?v=1753954525509","css/page_layout.css?v=1753954525509","css/index18.css?v=1753954525509"])))=>i.map(i=>d[i]);
import{v as s,a,c as t,m as e,_ as o,O as i,e as n}from"./page_layout.js?v=1753954525509";import{_ as l}from"./index.js?v=1753954525509";import{e as r,A as c,B as p}from"./public.js?v=1753954525509";import{k as u,P as m,r as d,o as _,b as w,U as f,V as g,Q as h,a2 as v,W as k,X as y,a3 as S,_ as x}from"./vue.js?v=1753954525509";import{bA as T}from"./naive.js?v=1753954525509";const b=()=>s.post("/ssl_domain?action=get_panel_domain"),j=a=>s.post("/ssl_domain?action=set_panel_domain_ssl",{domain:JSON.stringify(a.domain)},{requestOptions:{loading:"Installing certificate, please wait...",successMessage:!1}}),D={class:"panel-ssl-progress"},J={class:"progress-label"},L={class:"w-120px"},O=n(u({__name:"ssl-lets-progress",props:{task_id:{type:Number,default:0},isJump:{type:Boolean,default:!0},onFinish:{type:Function,default:()=>{}}},emits:["close"],setup(n,{emit:u}){const b=x((()=>a((()=>import("./ssl-log.js?v=1753954525509")),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])))),{t:j}=m(),O=u,A=d({});let E=null;const F=d(!1),I=r(j("SSL.Domain.index_5")),B=async(a=!1)=>{var o,i;try{a&&(F.value=!0);const{message:r}=await(i={task_id:n.task_id},s.post("/ssl_domain?action=ssl_tasks_status",i));if(t(r)&&(A.value=r,-1===r.task_code)){O("close");const s=r.task_result.match(/Error:\s*(\[[\s\S]+\])$/);if(s&&s[1]){const a=s[1];try{const s=c.parse(a);p(s)}catch(l){e.error(j("SSL.index_31"))}}else e.error(j("SSL.index_31"));return}100===A.value.task_status?(E&&clearTimeout(E),O("close"),null==(o=n.onFinish)||o.call(n),e.success(j("Config.Safe.Ssl.index_11")),n.isJump&&setTimeout((()=>{window.location.href=window.location.href.split("?")[0]+"?_t="+Date.now()}),1e3)):C()}catch(l){n.isJump&&setTimeout((()=>{window.location.href=window.location.href.split("?")[0]+"?_t="+Date.now()}),1e3)}finally{a&&(F.value=!1)}},C=()=>{E&&clearTimeout(E),E=window.setTimeout((()=>{B()}),3e3)};return _((()=>{B(!0)})),w((()=>{E&&(clearTimeout(E),E=null)})),(s,a)=>{const t=T,e=o,n=i,r=l;return f(),g("div",D,[h(n,{show:y(F)},{default:v((()=>[k("div",{class:"progress-item",onClick:a[0]||(a[0]=s=>{return a=y(A),I.data.path=a.task_log,void(I.show=!0);var a})},[k("span",J,S(y(A).task_name),1),k("div",L,[h(t,{percentage:y(A).task_status,type:"line",status:"success",processing:100!==y(A).task_status,"indicator-placement":"inside"},null,8,["percentage","processing"])]),h(e,{name:"base-left-logs",size:"18"})])])),_:1},8,["show"]),h(r,{show:y(I).show,"onUpdate:show":a[1]||(a[1]=s=>y(I).show=s),title:y(I).title,data:y(I).data,width:700,height:450,footer:!1,component:y(b)},null,8,["show","title","data","component"])])}}}),[["__scopeId","data-v-82c005c3"]]);export{O as a,b as g,j as s};
