System.register(["./index.vue_vue_type_script_setup_true_lang-legacy.js?v=1764830988434","./vue-legacy.js?v=1764830988434","./page_layout-legacy.js?v=1764830988434","./naive-legacy.js?v=1764830988434","./__commonjsHelpers__-legacy.js?v=1764830988434","./common-legacy.js?v=1764830988434","./public-legacy.js?v=1764830988434"],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.gP,b=e.x,w=e.k,h=e.gQ,g=e.gR,x=e.bf},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:P}){const R=e,C=P,{t:H}=r(),{isEdit:V,row:B}=R,I=o(null),Q=u({types:"drop",choose:"all",ports:null,country:["United States"],is_update:!1}),W={country:{trigger:"change",validator:()=>0!==Q.country.length||new Error(H("Security.Firewall.Area.form_8"))},ports:{trigger:["blur","input"],validator:()=>{if("point"===Q.choose){if(!Q.ports)return new Error(H("Security.Firewall.Area.form_9"));if(!x(`${Q.ports}`))return new Error(H("Security.Firewall.Area.form_10"))}return!0}}},q=[{label:H("Security.Firewall.Area.form_11"),value:"all"},{label:H("Security.Firewall.Area.form_3"),value:"point"}],z=[{label:H("Security.Firewall.Area.form_12"),value:"drop"}],D=o(!1),G=o([]);return(async()=>{try{D.value=!0;const{message:e}=await m();b(e)&&(G.value=e.map(e=>({label:e.CH,value:e.CH,brief:e.brief})))}finally{D.value=!1}})(),V&&B&&(Q.types=B.types,Q.choose=B.ports?"point":"all",Q.ports=B.ports?w(B.ports):null,Q.country=B.country),t({onConfirm:async()=>{await(I.value?.validate());const e={types:Q.types,choose:Q.choose,ports:"point"===Q.choose?`${Q.ports||""}`:"",country:Q.country,brief:"",is_update:Q.is_update};V&&B?(e.brief=`${G.value.find(e=>e.label===B.country)?.brief||""}`,await h({...e,id:B.id})):await g(e),C("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:_(Q),rules:W},{default:p(()=>[n(o,{label:e.$t("Security.Firewall.Area.form_1"),path:"types"},{default:p(()=>[f("div",U,[n(r,{value:_(Q).types,"onUpdate:value":t[0]||(t[0]=e=>_(Q).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:_(Q).choose,"onUpdate:value":t[1]||(t[1]=e=>_(Q).choose=e),options:q},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:_(Q).ports,"onUpdate:value":t[2]||(t[2]=e=>_(Q).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"===_(Q).choose]]),n(o,{label:e.$t("Security.Firewall.Area.form_5"),path:"country"},{default:p(()=>[f("div",E,[n(r,{value:_(Q).country,"onUpdate:value":t[3]||(t[3]=e=>_(Q).country=e),filterable:"","max-tag-count":"responsive",multiple:!_(V),loading:_(D),options:_(G)},null,8,["value","multiple","loading","options"])])]),_:1},8,["label"]),_(V)?y("",!0):(i(),d(o,{key:0,label:" "},{default:p(()=>[n(m,{checked:_(Q).is_update,"onUpdate:checked":t[4]||(t[4]=e=>_(Q).is_update=e),label:"Update IP Pool"},null,8,["checked"])]),_:1}))]),_:1},8,["model"])])}}}))}}});
