import{_ as e}from"./public.js?v=1763625242172";import{_ as t}from"./index.vue_vue_type_script_setup_true_lang.js?v=1763625242172";import{c as a}from"./page_layout.js?v=1763625242172";import{aG as l,Y as s}from"./site.js?v=1763625242172";import{au as i,dP as u,_ as r,aC as n}from"./naive.js?v=1763625242172";import{k as d,P as o,t as _,r as p,e as f,R as m,S as c,X as x,a3 as v,U as h,V as b,j as g,a4 as S}from"./vue.js?v=1763625242172";const k={class:"w-300px"},w={class:"w-300px"},$={class:"w-300px"},j={class:"flex flex-col"},C=d({__name:"form",props:{site:{}},emits:["changeHotlink"],setup(d,{expose:C,emit:y}){const{t:R}=o(),U=y,E=_(d,"site"),L=p(null),H=f({fix:"",domains:"",return_rule:"",status:!1,http_status:!1}),P={fix:{trigger:["blur","change"],validator:()=>""!==H.fix.trim()||new Error(R("Site.RulesError.index_330"))},return_rule:{trigger:["blur","change"],validator:()=>""!==H.return_rule.trim()||new Error(R("Site.RulesError.index_330"))}},z=()=>{V()},G=()=>{V()},V=async()=>{var e;await(null==(e=L.value)?void 0:e.validate()),await l({id:E.value.id,name:E.value.name,fix:H.fix,domains:H.domains.trim().split("\n").join(","),return_rule:H.return_rule,status:H.status,http_status:H.http_status}),U("changeHotlink",H.status),X()},X=async()=>{const{message:e}=await s({id:E.value.id,name:E.value.name});a(e)&&(H.fix=e.fix,H.domains=e.domains.split(",").join("\n"),H.return_rule=e.return_rule,H.status=e.status,H.http_status="true"===e.http_status||!0===e.http_status)};return X(),C({init:X}),(a,l)=>{const s=i,d=u,o=r,_=n,p=t,f=e;return m(),c("div",null,[x(p,{ref_key:"formRef",ref:L,class:"px-8px",model:b(H),rules:P},{default:v((()=>[x(d,{label:a.$t("Site.Lable.index_6"),path:"fix"},{default:v((()=>[h("div",k,[x(s,{value:b(H).fix,"onUpdate:value":l[0]||(l[0]=e=>b(H).fix=e),disabled:b(H).status,placeholder:""},null,8,["value","disabled"])])])),_:1},8,["label"]),x(d,{label:a.$t("Site.Lable.index_7")},{default:v((()=>[h("div",w,[x(s,{value:b(H).domains,"onUpdate:value":l[1]||(l[1]=e=>b(H).domains=e),type:"textarea",autosize:{minRows:6,maxRows:6},placeholder:""},null,8,["value"])])])),_:1},8,["label"]),x(d,{label:a.$t("Site.Lable.index_13"),path:"return_rule"},{default:v((()=>[h("div",$,[x(s,{value:b(H).return_rule,"onUpdate:value":l[2]||(l[2]=e=>b(H).return_rule=e),disabled:b(H).status,placeholder:""},null,8,["value","disabled"])])])),_:1},8,["label"]),x(d,{label:" "},{default:v((()=>[h("div",j,[x(o,{checked:b(H).status,"onUpdate:checked":[l[3]||(l[3]=e=>b(H).status=e),z]},{default:v((()=>[g(S(a.$t("Site.Config.index_94")),1)])),_:1},8,["checked"]),x(o,{checked:b(H).http_status,"onUpdate:checked":[l[4]||(l[4]=e=>b(H).http_status=e),G],class:"mt-16px"},{default:v((()=>[g(S(a.$t("Site.Config.index_95")),1)])),_:1},8,["checked"])])])),_:1}),x(d,{label:" ","show-feedback":!1},{default:v((()=>[x(_,{type:"primary",onClick:V},{default:v((()=>[g(S(a.$t("Site.Cert.index_60")),1)])),_:1})])),_:1})])),_:1},8,["model"]),x(f,{class:"mt-20px"},{default:v((()=>[h("li",null,[g(S(a.$t("Site.Config.index_96")),1),l[5]||(l[5]=h("br",null,null,-1)),g(" "+S(a.$t("Site.Config.index_97")),1)]),h("li",null,S(a.$t("Site.Config.index_98")),1),h("li",null,S(a.$t("Site.Config.index_99")),1)])),_:1})])}}});export{C as _};
