import{_ as e}from"./index.js?v=1753954525509";import{_ as t}from"./index.vue_vue_type_script_setup_true_lang.js?v=1753954525509";import{_ as a}from"./public.js?v=1753954525509";import{dc as s,c as i,m as r,w as n,o as l}from"./page_layout.js?v=1753954525509";import{bd as p,be as o}from"./site.js?v=1753954525509";import{Q as u}from"./index86.js?v=1753954525509";import{_}from"./index.vue_vue_type_script_setup_true_lang14.js?v=1753954525509";import{s as m}from"./file2.js?v=1753954525509";import{d6 as d,cG as c,bY as v,ay as f,aq as j,cA as x}from"./naive.js?v=1753954525509";import{k as g,P as h,r as w,e as y,o as C,U as b,V as S,Q as $,a2 as k,W as U,X as R,ah as q,a3 as N,j as P,N as Q}from"./vue.js?v=1753954525509";import"./common.js?v=1753954525509";import"./__commonjsHelpers__.js?v=1753954525509";import"./index127.js?v=1753954525509";import"./index.vue_vue_type_script_setup_true_lang4.js?v=1753954525509";import"./index.vue_vue_type_script_setup_true_lang7.js?v=1753954525509";import"./index.vue_vue_type_script_setup_true_lang5.js?v=1753954525509";import"./index.vue_vue_type_script_setup_true_lang11.js?v=1753954525509";import"./index.vue_vue_type_script_setup_true_lang6.js?v=1753954525509";import"./site4.js?v=1753954525509";import"./soft.js?v=1753954525509";import"./index237.js?v=1753954525509";import"./index100.js?v=1753954525509";import"./index102.js?v=1753954525509";import"./index.vue_vue_type_script_setup_true_lang9.js?v=1753954525509";import"./index96.js?v=1753954525509";import"./refersh.js?v=1753954525509";import"./php.js?v=1753954525509";import"./index.vue_vue_type_script_setup_true_lang17.js?v=1753954525509";import"./index101.js?v=1753954525509";import"./ssl.js?v=1753954525509";import"./cert.js?v=1753954525509";import"./utils3.js?v=1753954525509";import"./index209.js?v=1753954525509";import"./paypal-js.js?v=1753954525509";import"./ssl-lets-progress.js?v=1753954525509";import"./Ssl.vue_vue_type_script_setup_true_lang.js?v=1753954525509";import"./theme-chrome.js?v=1753954525509";const T={class:"w-160px"},A={class:"w-380px px-20px pt-24px pb-8px"},E={class:"w-180px"},G=g({__name:"index",setup(g,{expose:G}){const{t:H}=h(),{data:V}=u(),W=s(),X=w(null),Y=w(null),z=w([]),B=w("");let D="";const F=e=>{var t;B.value=I(e),null==(t=X.value)||t.getContent()},I=e=>{const{webserver:t}=W;if("0.Current"===e)return"apache"===t||"openlitespeed"===t?"".concat(D,"/.htaccess"):"/www/server/panel/vhost/rewrite/".concat(V.name,".conf");return"/www/server/panel/rewrite/".concat("openlitespeed"===t?"apache":t,"/").concat(Y.value,".conf")},J=async()=>{const e=I("0.Current"),{message:t}=await m({path:e,data:O.data,encoding:"utf-8"});i(t)&&r.success(t.msg);const a=z.value[0].value;Y.value=a,F(a)},K=w(!1),L=()=>{K.value=!0},M=w(null),O=y({name:"",data:""}),Z={name:{required:!0,trigger:["blur","change"],message:H("Site.RulesError.index_21")}},ee=async({hide:e})=>{var t;await(null==(t=M.value)?void 0:t.validate()),await p(Q(O)),O.name="",te(),e()},te=async()=>{var e;const{message:t}=await o({siteName:V.name});if(i(t)){D=t.sitePath;const e=n(t.rewrite)?t.rewrite:[];z.value=d(e).map((e=>({label:e,value:e}))),e.length&&(Y.value=e[0],B.value=I(e[0]))}null==(e=X.value)||e.getContent()},ae=async()=>{te()};return C((()=>{ae()})),G({init:ae}),(s,i)=>{const r=c,n=l,p=v,o=f,u=a,m=j,d=x,g=t,h=e;return b(),S("div",null,[$(p,{class:"items-center mb-12px"},{default:k((()=>[U("div",T,[$(r,{value:R(Y),"onUpdate:value":[i[0]||(i[0]=e=>q(Y)?Y.value=e:null),F],options:R(z)},null,8,["value","options"])]),U("div",null,[U("span",null,N(s.$t("Site.Config.index_50"))+": ",1),$(n,{href:"https://winginx.com/en/htaccess",target:"_blank"},{default:k((()=>[P(N(s.$t("Site.Cert.index_42")),1)])),_:1})])])),_:1}),$(_,{ref_key:"configRef",ref:X,path:R(B),"onUpdate:path":i[1]||(i[1]=e=>q(B)?B.value=e:null),value:R(O).data,"onUpdate:value":i[2]||(i[2]=e=>R(O).data=e),height:400,"show-tips":!1},null,8,["path","value"]),$(p,{class:"items-center mt-12px"},{default:k((()=>[$(o,{type:"primary",onClick:J},{default:k((()=>[P(N(s.$t("Site.Cert.index_60")),1)])),_:1}),$(o,{onClick:L},{default:k((()=>[P(N(s.$t("Site.Cert.index_39")),1)])),_:1})])),_:1}),$(u,{class:"mt-24px"},{default:k((()=>[U("li",null,N(s.$t("Site.Config.index_51")),1),U("li",null,N(s.$t("Site.Config.index_52")),1),U("li",null,N(s.$t("Site.Config.index_53")),1)])),_:1}),$(h,{show:R(K),"onUpdate:show":i[4]||(i[4]=e=>q(K)?K.value=e:null),title:"Save as rewrite template",footer:!0,onConfirm:ee},{default:k((()=>[U("div",A,[$(g,{ref_key:"formRef",ref:M,model:R(O),rules:Z},{default:k((()=>[$(d,{label:"Template name",path:"name"},{default:k((()=>[U("div",E,[$(m,{value:R(O).name,"onUpdate:value":i[3]||(i[3]=e=>R(O).name=e),placeholder:"Template name"},null,8,["value"])])])),_:1})])),_:1},8,["model"])])])),_:1},8,["show"])])}}});export{G as default};
