System.register(["./index.vue_vue_type_script_setup_true_lang-legacy.js?v=1764233927359","./vue-legacy.js?v=1764233927359","./page_layout-legacy.js?v=1764233927359","./naive-legacy.js?v=1764233927359","./__commonjsHelpers__-legacy.js?v=1764233927359","./common-legacy.js?v=1764233927359","./public-legacy.js?v=1764233927359"],function(e,l){"use strict";var a,t,r,o,u,s,i,n,p,c,d,y,f,_,v,m,b,w,h,g,x,S,A,F,j;return{setters:[e=>{a=e._},e=>{t=e.k,r=e.P,o=e.r,u=e.e,s=e.R,i=e.V,n=e.W,p=e.a3,c=e.l,d=e.a2,y=e.an,f=e.S,_=e.U,v=e.v},e=>{m=e.gX,b=e.x,w=e.k,h=e.gY,g=e.gZ,x=e.b6},e=>{S=e.dR,A=e.dV,F=e.df,j=e._},null,null,null],execute:function(){const l={class:"px-20px pt-24px pb-8px"},U={class:"w-240px"},$={class:"w-240px"},k={class:"w-240px"},E={class:"w-240px"};e("default",t({__name:"form",props:{row:{},isEdit:{type:Boolean,default:!1}},emits:["refresh"],setup(e,{expose:t,emit:C}){const H=e,P=C,{t:R}=r(),{isEdit:V,row:B}=H,I=o(null),W=u({types:"drop",choose:"all",ports:null,country:["United States"],is_update:!1}),X={country:{trigger:"change",validator:()=>0!==W.country.length||new Error(R("Security.Firewall.Area.form_8"))},ports:{trigger:["blur","input"],validator:()=>{if("point"===W.choose){if(!W.ports)return new Error(R("Security.Firewall.Area.form_9"));if(!x(`${W.ports}`))return new Error(R("Security.Firewall.Area.form_10"))}return!0}}},Y=[{label:R("Security.Firewall.Area.form_11"),value:"all"},{label:R("Security.Firewall.Area.form_3"),value:"point"}],Z=[{label:R("Security.Firewall.Area.form_12"),value:"drop"}],q=o(!1),z=o([]);return(async()=>{try{q.value=!0;const{message:e}=await m();b(e)&&(z.value=e.map(e=>({label:e.CH,value:e.CH,brief:e.brief})))}finally{q.value=!1}})(),V&&B&&(W.types=B.types,W.choose=B.ports?"point":"all",W.ports=B.ports?w(B.ports):null,W.country=B.country),t({onConfirm:async()=>{await(I.value?.validate());const e={types:W.types,choose:W.choose,ports:"point"===W.choose?`${W.ports||""}`:"",country:W.country,brief:"",is_update:W.is_update};V&&B?(e.brief=`${z.value.find(e=>e.label===B.country)?.brief||""}`,await h({...e,id:B.id})):await g(e),P("refresh")}}),(e,t)=>{const r=A,o=S,u=F,m=j,b=a;return i(),s("div",l,[n(b,{ref_key:"formRef",ref:I,model:_(W),rules:X},{default:p(()=>[n(o,{label:e.$t("Security.Firewall.Area.form_1"),path:"types"},{default:p(()=>[f("div",U,[n(r,{value:_(W).types,"onUpdate:value":t[0]||(t[0]=e=>_(W).types=e),options:Z},null,8,["value"])])]),_:1},8,["label"]),n(o,{label:e.$t("Security.Firewall.Area.form_2"),path:"choose"},{default:p(()=>[f("div",$,[n(r,{value:_(W).choose,"onUpdate:value":t[1]||(t[1]=e=>_(W).choose=e),options:Y},null,8,["value"])])]),_:1},8,["label"]),c(n(o,{label:e.$t("Security.Firewall.Area.form_3"),path:"ports"},{default:p(()=>[f("div",k,[n(u,{value:_(W).ports,"onUpdate:value":t[2]||(t[2]=e=>_(W).ports=e),min:1,max:65535,"show-button":!1,placeholder:e.$t("Security.Firewall.Area.form_4")},null,8,["value","placeholder"])])]),_:1},8,["label"]),[[v,"point"===_(W).choose]]),n(o,{label:e.$t("Security.Firewall.Area.form_5"),path:"country"},{default:p(()=>[f("div",E,[n(r,{value:_(W).country,"onUpdate:value":t[3]||(t[3]=e=>_(W).country=e),filterable:"","max-tag-count":"responsive",multiple:!_(V),loading:_(q),options:_(z)},null,8,["value","multiple","loading","options"])])]),_:1},8,["label"]),_(V)?y("",!0):(i(),d(o,{key:0,label:" "},{default:p(()=>[n(m,{checked:_(W).is_update,"onUpdate:checked":t[4]||(t[4]=e=>_(W).is_update=e),label:"Update IP Pool"},null,8,["checked"])]),_:1}))]),_:1},8,["model"])])}}}))}}});
