import{u as E,r as f,j as e,L as T,ds as K,B as j,fw as x,bJ as y,fx as D,fy as H,b3 as w,bK as L,ar as C,bt as P,as as A,Z as v,b9 as F,aZ as k}from"./index-dP1W1_bd.js";import{a as I,u as M}from"./index-MHdXqM53.js";const m=({name:o,init:s,title:l,tooltip:t,base:a,options:c,isFetching:r,toStringF:i,toObjF:u})=>{const{control:d,setValue:n,getValues:h}=w();return f.useEffect(()=>{setTimeout(()=>{s&&n(o.join("."),a)},0)},[a,s,o,n]),e.jsxs(j,{gap:"10px",flexDirection:"column",flex:"1",width:"100%",children:[e.jsxs(j,{flexDirecton:"row",children:[e.jsx(L,{children:l}),e.jsx(C,{position:P.right,mainText:t,children:e.jsx(A,{ml:"5px",size:"xs",icon:v.info_block})})]}),e.jsx(F,{render:({field:{value:b,onChange:p}})=>e.jsx(k,{isMulti:!0,value:i(b??[]),options:i(c),placeholder:"",onChange:g=>p(u(g)),preventAdding:!0,isLoading:r},`${i(b??[]).join("")}`),name:o.join("."),control:d})]})},N=({name:o,init:s,title:l,tooltip:t,base:a,options:c,isFetching:r,toStringF:i,toObjF:u})=>{const{control:d,setValue:n,getValues:h}=w();return f.useEffect(()=>{setTimeout(()=>{s&&n(o.join("."),a)},0)},[a,s,o,n]),e.jsxs(j,{gap:"10px",flexDirection:"column",flex:"1",width:"100%",children:[e.jsxs(j,{children:[e.jsx(L,{children:l}),e.jsx(C,{position:P.right,mainText:t,children:e.jsx(A,{ml:"5px",size:"xs",icon:v.info_block})})]}),e.jsx(F,{render:({field:{value:b,onChange:p}})=>e.jsx(k,{isMulti:!1,value:i([b]),options:i(c),placeholder:"",onChange:g=>p(u(g)[0]),preventAdding:!0,isLoading:r},`${b}`),name:o.join("."),control:d})]})},S=({prefix:o,init:s})=>{const{id:l}=E(),{data:t,isLoading:a,isFetching:c}=I({id:l}),{data:r,isLoading:i,isFetching:u}=M({id:l}),d=f.useMemo(()=>[...o,"schedulingConfig","kubeNodeSelectorLabels"],[o]),n=f.useMemo(()=>[...o,"schedulingConfig","kubeNodeAntiAffinityLabels"],[o]),h=f.useMemo(()=>[...o,"schedulingConfig","kubePriorityClass"],[o]);return a||i?e.jsx(T,{}):!t||!r?null:e.jsx(K,{title:"Scheduler",children:e.jsxs(j,{width:"100%",gap:"20px",flexDirection:"column",children:[e.jsx(m,{name:d,init:s,title:"Node affinity",tooltip:"Job will run on a node with any of the following labels.  Available Labels are configured by a Hopsworks Admin. If you require the use of a particular Label, not currently available in your project, contact a Hopsworks Admin.",base:t.value.base,options:t.value.allowed,toStringF:x,toObjF:y,isFetching:c}),e.jsx(m,{name:n,init:s,title:"Node anti affinity",tooltip:"Job will run on a node that does not have any of the following labels.  Available Labels are configured by a Hopsworks Admin. If you require the use of a particular Label, not currently available in your project, contact a Hopsworks Admin.",base:[],options:t.value.allowed,toStringF:x,toObjF:y,isFetching:c}),e.jsx(N,{name:h,init:s,title:"Priority class",tooltip:"Job will run with this priority class.  Available Priority Classes are configured by a Hopsworks Admin. If you require the use of a particular Priority Classes, not currently availablein your project, contact a Hopsworks Admin.",base:r.value.base,options:r.value.allowed,toStringF:D,toObjF:H,isFetching:u})]})})};export{S as K};
