import{d as m,bA as p,i as u,t as o,v as r,z as t,A as s,B as d,y as l,x as c,C as S,D as w}from"./D8zG9Ut8.js";import{u as f}from"./B_NqmWCc.js";import{_ as h}from"./F47YBxX3.js";import{_ as V}from"./DlAUqK2U.js";import{V as _,a as C}from"./Dbpq9kDR.js";import{V as N,b,a as F}from"./CThvs1cs.js";const v=m({name:"ScannerSelect",components:{ScannerForm:h},props:{selectedScanner:{type:Object,default:null}},emits:["update:selectedScanner"],data(){return{scanner:this.selectedScanner,scanners:[],showNewScannerForm:!1}},computed:{...p(f)},watch:{selectedScanner(e){this.scanner=e},scanner(e){this.$emit("update:selectedScanner",e)}},mounted(){var e;this.scanners=((e=this.scannersStore)==null?void 0:e.scanners)||[]},methods:{getScannerDetails(e){const n=(e.name||"").trim()!=="";return{title:n?e.name:e.endpoint,subtitle:n?e.endpoint:""}}}}),$=e=>(S("data-v-93550484"),e=e(),w(),e),y={key:0,class:"mb-0"},k={key:1,class:"mb-0"},D=$(()=>c("span",{class:"headline"},"Create New Scanner",-1));function g(e,n,B,I,T,j){const i=u("ScannerForm");return o(),r("div",null,[t(_,{modelValue:e.scanner,"onUpdate:modelValue":n[1]||(n[1]=a=>e.scanner=a),items:e.scanners,"item-props":e.getScannerDetails,"hide-details":"",variant:"outlined","item-title":"endpoint",density:"compact",clearable:"","return-object":"",label:"Select a scanner",placeholder:"Select or create a scanner to run the scan on","prepend-icon":"mdi-shield-search"},{selection:s(({item:a})=>[(a.raw.name||"").trim()!==""?(o(),r("p",y,[d(l(a.raw.name)+" (",1),c("code",null,l(a.raw.endpoint),1),d(") ")])):(o(),r("code",k,l(a.raw.endpoint),1))]),"no-data":s(()=>[c("p",{class:"create-scanner mb-0 pl-4 py-0",onClick:n[0]||(n[0]=a=>e.showNewScannerForm=!0)}," Create New Scanner ")]),_:1},8,["modelValue","items","item-props"]),t(C,{modelValue:e.showNewScannerForm,"onUpdate:modelValue":n[3]||(n[3]=a=>e.showNewScannerForm=a),persistent:"","max-width":"600px"},{default:s(()=>[t(N,null,{default:s(()=>[t(b,null,{default:s(()=>[D]),_:1}),t(F,null,{default:s(()=>[t(i,{onCloseForm:n[2]||(n[2]=a=>e.showNewScannerForm=!1)})]),_:1})]),_:1})]),_:1},8,["modelValue"])])}const O=V(v,[["render",g],["__scopeId","data-v-93550484"]]);export{O as S};
