"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[86],{1939:function(e,n,t){var r=t(5893),o=t(7357),i=t(7169);function u(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function a(e){for(var n=1;n=0||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}var c="Decorator",s={ok:"".concat(c,"-ok"),warning:"".concat(c,"-warning"),error:"".concat(c,"-error"),off:"".concat(c,"-off")};n.Z=function(e){var n,t=e.colour,c=e.sx,f=l(e,["colour","sx"]);return(0,r.jsx)(o.Z,a({},f,{className:s[t],sx:a((n={borderRadius:i.n_,height:"100%",width:"1.4em"},u(n,"&.".concat(s.ok),{backgroundColor:i.Ej}),u(n,"&.".concat(s.warning),{backgroundColor:i.Wd}),u(n,"&.".concat(s.error),{backgroundColor:i.hM}),u(n,"&.".concat(s.off),{backgroundColor:i.s7}),n),c)}))}},5741:function(e,n,t){var r=t(5893),o=t(1714),i=t(122),u=t(7169),a=t(4690);function l(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function c(e){for(var n=1;n=0||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}n.Z=function(e){var n=e.children,t=e.sx,l=s(e,["children","sx"]);return(0,r.jsx)(i.Z,c({underline:"hover",variant:"subtitle1"},l,{sx:c({color:u.lD,textDecorationColor:u.s7},t),children:(0,r.jsxs)(a.Z,{row:!0,children:[n,(0,r.jsx)(o.Z,{sx:{marginLeft:".3em"}})]})}))}},4427:function(e,n,t){var r=t(5893),o=t(2429),i=t(9309),u=t(7169);function a(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function l(e){for(var n=1;n=0||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}var M=function(e){var n=e.isFloating,t=e.networkInterface,i=t.networkInterfaceName,u=t.networkInterfaceState,a=e.onClose,l=e.sx,c=Z(e,["isFloating","networkInterface","onClose","sx"]),f=n?{borderColor:y.s7,borderRadius:y.n_,borderStyle:"solid",borderWidth:"1px",backgroundColor:y.E5,padding:".6em 1.2em"}:{};return(0,r.jsxs)(o.Z,C({sx:C({display:"flex",flexDirection:"row","& > :not(:first-child)":{alignSelf:"center",marginLeft:".5em"}},f,l)},c,{children:[(0,r.jsx)(j.Z,{colour:"up"===u?"ok":"off",sx:{height:"auto"}}),(0,r.jsx)(I.Ac,{text:i}),a&&(0,r.jsx)(x.Z,{onClick:a,size:"small",sx:{color:y.s7},children:(0,r.jsx)(s.Z,{})})]}))};M.defaultProps={isFloating:!1,onClose:void 0};var S=M,P=(0,t(1496).ZP)(o.Z)((function(){return{borderColor:y.s7,borderStyle:"dashed",borderWidth:"4px",display:"flex",flexDirection:"column",padding:".6em","& > :not(:first-child)":{marginTop:".3em"}}})),D=t(4690),U=t(1770),A=t(1706),N=t(4069),R=t(7869),E=t(6284),V=t(3679),T=t(1905),F=t(2519),L=t(2152),q=t(7987);function B(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t=0||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}function G(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i=[],u=!0,a=!1;try{for(t=t.call(e);!(u=(r=t.next()).done)&&(i.push(r.value),!n||i.length!==n);u=!0);}catch(l){a=!0,o=l}finally{try{u||null==t.return||t.return()}finally{if(a)throw o}}return i}}(e,n)||J(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $(e){return function(e){if(Array.isArray(e))return B(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||J(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function J(e,n){if(e){if("string"===typeof e)return B(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(t):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?B(e,n):void 0}}var z={ifaceNotApplied:"".concat("NetworkInitForm","-network-interface-not-applied")},X=[void 0,void 0],K="dns",Y="gateway",Q=function(e){return"".concat(e,"Interface")},ee=function(e){return"".concat(e,"IPAddress")},ne=function(e){return"".concat(e,"Name")},te=function(e){return"".concat(e,"SubnetMask")},re=function(e){return"".concat(e,"NetworkSubnetConflict")},oe=Array.from({length:2},(function(e,n){return n+1})),ie={bcn:{ip:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return"10.20".concat(e,".").concat(n)},mask:"255.255.0.0"},ifn:{ip:function(){return""},mask:""},mn:{ip:function(){return"10.199."},mask:"255.255.0.0"},sn:{ip:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return"10.10".concat(e,".").concat(n)},mask:"255.255.0.0"}},ue=function(e){return"network".concat(e)},ae=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.inputUUID,t=void 0===n?(0,m.Z)():n,r=e.interfaces,o=void 0===r?$(X):r,i=e.ipAddress,u=void 0===i?"":i,a=e.name,l=e.subnetMask,c=void 0===l?"":l,s=e.type,f=void 0===s?"":s,d=e.typeCount,v=void 0===d?0:d,p=W(e,["inputUUID","interfaces","ipAddress","name","subnetMask","type","typeCount"]),b=a;return a||(b=h.Z[f]&&v>0?"".concat(h.Z[f]," ").concat(v):"Unknown Network"),_({inputUUID:t,interfaces:o,ipAddress:u,name:b,subnetMask:c,type:f,typeCount:v},p)},le=function(e,n){return[{align:"center",field:"",renderCell:function(t){var i,u=t.row,a=(null!==(i=n[u.networkInterfaceUUID])&&void 0!==i&&i).isApplied,s="grab",f=function(){for(var n=arguments.length,t=new Array(n),r=0;r :not(:first-child)":{marginLeft:".5em"}},children:[(0,r.jsx)(j.Z,{colour:"up"===t?"ok":"off",sx:{height:"auto"}}),(0,r.jsx)(I.KI,{text:i})]})}},{field:"networkInterfaceMACAddress",flex:1,headerName:"MAC",renderCell:function(e){var n=e.value;return(0,r.jsx)(I.$_,{text:n})}},{field:"networkInterfaceState",flex:1,headerName:"State",renderCell:function(e){var n=e.value,t=String(n);return(0,r.jsx)(I.KI,{text:"".concat(t.charAt(0).toUpperCase()).concat(t.substring(1))})}},{field:"networkInterfaceSpeed",flex:1,headerName:"Speed",renderCell:function(e){var n=e.value;return(0,r.jsx)(I.KI,{text:"".concat(parseFloat(n).toLocaleString()," Mbps")})}},{field:"networkInterfaceOrder",flex:1,headerName:"Order"}]},ce=function(e){var n=e.allowMigrationNetwork,t=e.createDropMouseUpHandler,a=e.getNetworkTypeCount,l=e.hostDetail,c=void 0===l?{}:l,d=c.hostType,v=c.sequence,p=e.networkIndex,m=e.networkInput,g=e.networkInterfaceCount,k=e.networkInterfaceInputMap,w=e.removeNetwork,x=e.setMessageRe,j=e.setNetworkInputs,O=e.setNetworkInterfaceInputMap,C=e.testInput,Z=e.testInputToToggleSubmitDisabled,M=(0,i.Z)(),D=(0,u.Z)(M.breakpoints.up("md")),U=(0,u.Z)(M.breakpoints.up("lg")),R=(0,b.useRef)({}),T=(0,b.useRef)({}),L=m.inputUUID,q=m.interfaces,B=m.ipAddress,W=m.isRequired,J=m.subnetMask,z=m.type,X=m.typeCount,K=(0,b.useMemo)((function(){return ue(L)}),[L]),Y=(0,b.useMemo)((function(){return Q(K)}),[K]),ne=(0,b.useMemo)((function(){return ee(K)}),[K]),ae=(0,b.useMemo)((function(){return te(K)}),[K]),le=(0,b.useMemo)((function(){return re(K)}),[K]),ce=(0,b.useMemo)((function(){return"node"===d}),[d]),se=(0,b.useMemo)((function(){return!ce&&g<=2?[1]:oe}),[ce,g]),fe=(0,b.useMemo)((function(){var e=h.Z.bcn,t=h.Z.ifn,r=h.Z.mn,o=h.Z.sn;return ce&&g>=8&&(n||"mn"===z)?{bcn:e,ifn:t,mn:r,sn:o}:{bcn:e,ifn:t,sn:o}}),[n,ce,g,z]),de=(0,b.useCallback)((function(e,n,t){var r=R.current,o=r.getIsChangedByUser,i=r.setValue,u=T.current,a=u.getIsChangedByUser,l=u.setValue;(null===o||void 0===o?void 0:o.call(null))||(e.ipAddress=n,null===i||void 0===i||i.call(null,n)),(null===a||void 0===a?void 0:a.call(null))||(e.subnetMask=t,null===l||void 0===l||l.call(null,t))}),[]);return(0,b.useEffect)((function(){var e,n;"striker"===d&&"ifn"!==z&&(!(null===(e=R.current.getIsChangedByUser)||void 0===e?void 0:e.call(null))&&Number(v)&&(null===(n=R.current.setValue)||void 0===n||n.call(null,B.replace(/^((?:\d+\.){3})\d*$/,"$1".concat(v)))))}),[d,B,v,z]),(0,b.useEffect)((function(){var e=m.ipAddressInputRef,n=m.subnetMaskInputRef;e===R&&n===T||(m.ipAddressInputRef=R,m.subnetMaskInputRef=T,j((function(e){return $(e)})))}),[m,j]),(0,r.jsxs)(V.Lg,{children:[(0,r.jsxs)(V.CH,{children:[(0,r.jsx)(F.Z,{id:"network-".concat(L,"-name"),isReadOnly:W,inputLabelProps:{isNotifyRequired:!0},label:"Network name",selectItems:Object.entries(fe).map((function(e){var n=G(e,2),t=n[0],r=n[1],o=a(t,{lastIndex:p});return t!==z&&(o+=1),{value:t,displayValue:"".concat(r," ").concat(o)}})),selectProps:{onChange:function(e){var n=e.target.value,t=String(n);m.type=t;var r=a(t,{lastIndex:p});m.typeCount=r,m.name="".concat(h.Z[t]," ").concat(r);var o=ie[t];if(o){var i,u=o.ip,l=o.mask;"striker"===d&&"bcn"===t&&(i="4."),de(m,u(r,i),l)}j((function(e){return $(e)}))},renderValue:U?void 0:function(e){return"".concat(String(e).toUpperCase()," ").concat(X)},value:z}}),!W&&(0,r.jsx)(A.Z,{onClick:function(){w(p)},sx:{padding:".2em",position:"absolute",right:"-9px",top:"-4px"},children:(0,r.jsx)(s.Z,{fontSize:"small"})})]}),(0,r.jsxs)(o.Z,{sx:{display:"flex",flexDirection:"column",margin:".6em","& > :not(:first-child)":{marginTop:"1em"}},children:[se.map((function(e){var n="Link ".concat(e),i=e-1,u=q[i],a=(null!==u&&void 0!==u?u:{}).networkInterfaceUUID,l=void 0===a?"":a,c=D?(0,r.jsx)(I.Ac,{text:"Drop to add interface."}):(0,r.jsx)(f.Z,{sx:{alignSelf:"center",color:y.s7}});return(0,r.jsxs)(o.Z,{sx:{alignItems:"center",display:"flex",flexDirection:"row","& > :not(:first-child)":{marginLeft:"1em"},"& > :last-child":{flexGrow:1}},children:[(0,r.jsx)(I.Ac,{sx:{whiteSpace:"nowrap"},text:n}),(0,r.jsx)(P,{onMouseUp:function(){for(var e=arguments.length,n=new Array(e),r=0;r=xe.length||Object.values(W).every((function(e){return e.isApplied}))||"node"===t&&xe.length<=6}),[t,oe,xe,W]),Oe=(0,b.useMemo)((function(){return u&&!l}),[u,l]),Ce=(0,b.useMemo)((function(){return oe.every((function(e){return"mn"!==e.type}))}),[oe]),Ze=(0,b.useCallback)((function(e,n){var t;return null===(t=he.current.setMessage)||void 0===t?void 0:t.call(null,e,n)}),[]),Me=(0,b.useCallback)((function(e,n){var t;return null===(t=he.current.setMessageRe)||void 0===t?void 0:t.call(null,e,n)}),[]),Se=(0,b.useCallback)((function(e){return Ze(K,e)}),[Ze]),Pe=(0,b.useCallback)((function(e){return Ze(Y,e)}),[Ze]),De=(0,b.useCallback)((function(e){var n,t=e.fn,r=void 0===t?"every":t,o=e.ip,i=void 0===o?"":o,u=e.mask,a=void 0===u?"":u,l=e.isNegateMatch,c=void 0===l?"every"===r:l,s=e.onMatch,f=e.onMiss,d=e.skipUUID,v="every"===r;try{n=new p.Netmask("".concat(i,"/").concat(a))}catch(b){}return oe[r]((function(e){var t,r,o=e.inputUUID,u=e.ipAddressInputRef,a=e.subnetMaskInputRef;if(o===d)return v;var l=null===(t=null===u||void 0===u?void 0:u.current.getValue)||void 0===t?void 0:t.call(null),m=null===(r=null===a||void 0===a?void 0:a.current.getValue)||void 0===r?void 0:r.call(null),g=!1;try{g=function(e,n){var t=n.b,r=n.bIP,o=void 0===r?"":r;return e.contains(null!==t&&void 0!==t?t:o)||void 0!==t&&t.contains(e)}(new p.Netmask("".concat(l,"/").concat(m)),{b:n,bIP:i})}catch(b){}return g?null===s||void 0===s||s.call(null,e):null===f||void 0===f||f.call(null,e),c?!g:g}))}),[oe]),Ue=(0,b.useCallback)((function(e){w.Z.put("/init/set-map-network",{value:e}).catch((function(n){var t=(0,U.Z)(n);t.children=(0,r.jsxs)(r.Fragment,{children:["Failed to ",e?"enable":"disable"," network mapping."," ",t.children]}),Ze("api",t)}))}),[Ze]),Ae=(0,b.useMemo)((function(){var e,n=(H(e={},K,{defaults:{getValue:function(){var e;return null===(e=me.current.getValue)||void 0===e?void 0:e.call(null)},onSuccess:function(){Se()}},tests:[{onFailure:function(){Se({children:"Domain name servers should be a comma-separated list of IPv4 addresses without trailing comma(s)."})},test:function(e){var n=e.value;return k.ah.test(n)}},{test:q.HJ}]}),H(e,Y,{defaults:{getValue:function(){var e;return null===(e=ge.current.getValue)||void 0===e?void 0:e.call(null)},onSuccess:function(){Pe()}},tests:[{onFailure:function(){Pe({children:"Gateway should be a valid IPv4 address."})},test:function(e){var n=e.value;return k.tf.test(n)}},{test:function(e){var n=e.value,t=!0,r=De({fn:"some",ip:n,onMatch:function(e){var r=e.ipAddress,o=e.name,i=e.type,u=e.typeCount;if(n===r)return t=!1,void Pe({children:"Gateway cannot be the same as IP address in ".concat(o,".")});be("".concat(i).concat(u))}});return r||Pe({children:"Gateway must be in one network's subnet."}),r&&t}},{test:q.HJ}]}),e);return oe.forEach((function(e){var t,r,o=e.inputUUID,i=e.interfaces,u=e.ipAddressInputRef,a=e.name,l=e.subnetMaskInputRef,c=ue(o),s=Q(c),f=ee(c),d=te(c),v=function(e){return Ze(s,e)},p=function(e){return Ze(f,e)},b=function(e){return Ze(d,e)},m=function(e,n,t){var r,o="".concat(re(c),"-").concat(n),i="".concat(re(ue(n)),"-").concat(e);Ze((null===(r=he.current.exists)||void 0===r?void 0:r.call(null,i))?i:o,t)},g=function(e){var n=e.ip,i=void 0===n?null===(t=null===u||void 0===u?void 0:u.current.getValue)||void 0===t?void 0:t.call(null):n,c=e.mask,s=void 0===c?null===(r=null===l||void 0===l?void 0:l.current.getValue)||void 0===r?void 0:r.call(null):c;return De({ip:i,mask:s,onMatch:function(e){var n=e.inputUUID,t=e.name;m(o,n,{children:'"'.concat(a,'" and "').concat(t,'" cannot be in the same subnet.')})},onMiss:function(e){var n=e.inputUUID;m(o,n)},skipUUID:o})};n[s]={defaults:{getCompare:function(){return i.map((function(e){return void 0!==e}))},onSuccess:function(){v()}},tests:[{onFailure:function(){v({children:"".concat(a," must have at least 1 interface.")})},test:function(e){return e.compare.some((function(e){return e}))}},{onFailure:function(){v({children:"".concat(a," must have a Link 1 interface.")})},test:function(e){var n=G(e.compare,2),t=n[0];return!(n[1]&&!t)}}]},n[f]={defaults:{getValue:function(){var e;return null===(e=null===u||void 0===u?void 0:u.current.getValue)||void 0===e?void 0:e.call(null)},onSuccess:function(){p()}},tests:[{onFailure:function(){p({children:"IP address in ".concat(a," must be a valid IPv4 address.")})},test:function(e){var n=e.value;return k.tf.test(n)}},{test:function(e){var n=e.value;return g({ip:n})}},{test:q.HJ}]},n[ne(c)]={defaults:{value:a},tests:[{test:q.HJ}]},n[d]={defaults:{getValue:function(){var e;return null===(e=null===l||void 0===l?void 0:l.current.getValue)||void 0===e?void 0:e.call(null)},onSuccess:function(){b()}},tests:[{onFailure:function(){b({children:"Subnet mask in ".concat(a," must be a valid IPv4 address.")})},test:function(e){var n=e.value;return k.tf.test(n)}},{test:function(e){var n=e.value;return g({mask:n})}},{test:q.HJ}]}})),n}),[oe,Se,Pe,Ze,De]),Ne=(0,b.useMemo)((function(){return(0,q.LT)(Ae)}),[Ae]),Re=(0,b.useCallback)((function(e){null===s||void 0===s||s.call(null,Ne(_({isIgnoreOnCallbacks:!0,isTestAll:!0},e)))}),[Ne,s]),Ee=(0,b.useCallback)((function(){de(void 0)}),[]),Ve=(0,b.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};oe.unshift(ae(e)),null===s||void 0===s||s.call(null,!1),ie($(oe))}),[oe,s]),Te=(0,b.useCallback)((function(e){var n=G(oe.splice(e,1),1)[0],t=n.inputUUID;n.interfaces.forEach((function(e){if(void 0!==e){var n=e.networkInterfaceUUID;W[n].isApplied=!1}})),Re({excludeTestIdsRe:RegExp(t)}),ie($(oe)),J((function(e){return _({},e)}))}),[oe,W,Re]),Fe=(0,b.useCallback)((function(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.inputs,r=void 0===t?oe:t,o=n.lastIndex,i=void 0===o?0:o,u=0,a=r.length-1;a>=i;a-=1)r[a].type===e&&(u+=1);return u}),[oe]),Le=(0,b.useMemo)((function(){if(void 0!==fe){var e=fe.networkInterfaceUUID;return function(n,t){return function(){var r,o=(null!==(r=n[t])&&void 0!==r?r:{}).networkInterfaceUUID;o&&o!==e&&(W[o].isApplied=!1),n[t]=fe,W[e].isApplied=!0}}}}),[fe,W]),qe=(0,b.useMemo)((function(){return fe?{cursor:"grabbing",userSelect:"none"}:{}}),[fe]),Be=(0,b.useMemo)((function(){if(void 0===fe)return(0,r.jsx)(r.Fragment,{});var e=V.x,n=V.y;return(0,r.jsx)(S,{isFloating:!0,networkInterface:fe,sx:{left:"calc(".concat(e,"px + .4em)"),position:"absolute",top:"calc(".concat(n,"px - 1.6em)"),zIndex:20}})}),[V,fe]),He=(0,b.useMemo)((function(){return fe?function(){Ee()}:void 0}),[Ee,fe]),_e=(0,b.useMemo)((function(){return fe?function(e){var n=e.currentTarget,t=e.nativeEvent,r=t.clientX,o=t.clientY,i=n.getBoundingClientRect(),u=i.left,a=i.top;F({x:r-u,y:o-a})}:void 0}),[fe]),We=(0,b.useMemo)((function(){return fe?function(){Ee()}:void 0}),[Ee,fe]);(0,b.useEffect)((function(){if([Object.keys(W).length>0,u,l,ye.current,me.current,ge.current].every((function(e){return Boolean(e)}))){var e,n;ye.current=!1;var t=l.dns,r=l.gateway,o=l.gatewayInterface,i=l.networks;if([t,r,o,i].some((function(e){return!e})))return;null===(e=me.current.setValue)||void 0===e||e.call(null,t),null===(n=ge.current.setValue)||void 0===n||n.call(null,r);var a=[],c=Object.values(i).reduce((function(e,n){var t,r,o=n.ip,i=n.link1Uuid,u=n.link2Uuid,l=void 0===u?"":u,c=n.subnetMask,s=n.type,f=Fe(s,{inputs:e})+1,d=M[s]===f,v="".concat(h.Z[s]," ").concat(f);return a.push(i,l),e.push({inputUUID:(0,m.Z)(),interfaces:[null===(t=W[i])||void 0===t?void 0:t.metadata,null===(r=W[l])||void 0===r?void 0:r.metadata],ipAddress:o,isRequired:d,name:v,subnetMask:c,type:s,typeCount:f}),e}),[]);be(o),J((function(e){var n=_({},e);return a.forEach((function(e){n[e]&&(n[e].isApplied=!0)})),n})),ie(c),Re()}}),[u,Fe,l,W,M,Re]),(0,b.useEffect)((function(){return Ue(1),window&&window.addEventListener("beforeunload",(function(){var e=new XMLHttpRequest;e.open("PUT","".concat(g.Z,"/init/set-map-network"),!1),e.send(null)}),{once:!0}),function(){Ue(0)}}),[Ue]),(0,b.useImperativeHandle)(n,(function(){return _({},he.current,{get:function(){var e,n;return{dns:null===(e=me.current.getValue)||void 0===e?void 0:e.call(null),gateway:null===(n=ge.current.getValue)||void 0===n?void 0:n.call(null),gatewayInterface:pe,networks:oe.map((function(e){var n,t,r=e.inputUUID,o=e.interfaces,i=e.ipAddressInputRef,u=e.name,a=e.subnetMaskInputRef,l=e.type,c=e.typeCount;return{inputUUID:r,interfaces:o,ipAddress:null!==(O=null===(n=null===i||void 0===i?void 0:i.current.getValue)||void 0===n?void 0:n.call(null))&&void 0!==O?O:"",name:u,subnetMask:null!==(C=null===(t=null===a||void 0===a?void 0:a.current.getValue)||void 0===t?void 0:t.call(null))&&void 0!==C?C:"",type:l,typeCount:c}}))}}})}),[pe,oe]);var Ge,$e="13em";return je?(0,r.jsx)(L.Z,{}):(0,r.jsxs)(o.Z,{onMouseDown:function(e){var n=e.clientX,t=e.clientY,r=e.currentTarget.getBoundingClientRect(),o=r.left,i=r.top;F({x:n-o,y:t-i})},onMouseLeave:He,onMouseMove:_e,onMouseUp:We,sx:_({position:"relative"},qe),children:[Be,(0,r.jsxs)(o.Z,{sx:{display:"flex",flexDirection:"column","& > :not(:first-child, :nth-child(3))":{marginTop:"1em"}},children:[(0,r.jsx)(d._,{autoHeight:!0,columns:le((function(e){de(e)}),W),componentsProps:{row:{onMouseDown:function(e){var n=e.target,t=(void 0===n?{}:n).parentElement,r=(void 0===t?{}:t).dataset,o=(void 0===r?{}:r).id,i=void 0===o?void 0:o;if(i){var u=W[i],a=u.isApplied,l=u.metadata;a||de(l)}}}},disableColumnMenu:!0,disableSelectionOnClick:!0,getRowClassName:function(e){var n,t=e.row.networkInterfaceUUID,r="";return(null!==(n=W[t])&&void 0!==n&&n).isApplied||(r+=" ".concat(z.ifaceNotApplied)),r},getRowId:function(e){return e.networkInterfaceUUID},hideFooter:!0,initialState:{sorting:{sortModel:[{field:"networkInterfaceName",sort:"asc"}]}},rows:xe,sx:(Ge={color:y.s7},H(Ge,"& .".concat(a.Z.root),{color:"inherit"}),H(Ge,"& .".concat(v._.cell,":focus"),{outline:"none"}),H(Ge,"& .".concat(v._.row,".").concat(z.ifaceNotApplied,":hover"),H({cursor:"grab"},"& .".concat(v._.cell," p"),{cursor:"auto"})),Ge)}),!Oe&&(0,r.jsx)(D.Z,{row:!0,sx:{"& > :first-child":{alignSelf:"start",marginTop:".7em"},"& > :last-child":{flexGrow:1}},children:(0,r.jsx)(o.Z,{sx:{alignItems:"strech",display:"flex",flexDirection:"row",overflowX:"auto",paddingLeft:".3em","& > div":{marginBottom:".8em",marginTop:".4em",minWidth:$e,width:"25%"},"& > :not(:first-child)":{marginLeft:"1em"}},children:oe.map((function(e,n){var o=e.inputUUID;return(0,r.jsx)(ce,{allowMigrationNetwork:Ce,createDropMouseUpHandler:Le,getNetworkTypeCount:Fe,hostDetail:{hostType:t,sequence:j},networkIndex:n,networkInput:e,networkInterfaceCount:xe.length,networkInterfaceInputMap:W,removeNetwork:Te,setMessageRe:Me,setNetworkInputs:ie,setNetworkInterfaceInputMap:J,testInput:Ne,testInputToToggleSubmitDisabled:Re},"network-".concat(o))}))})}),(0,r.jsxs)(D.Z,{sm:"row",sx:{marginTop:".2em","& > :not(button)":{minWidth:$e,width:{sm:"25%"}}},children:[(0,r.jsx)(A.Z,{disabled:Ie,onClick:function(){Ve()},children:(0,r.jsx)(f.Z,{})}),(0,r.jsx)(N.Z,{input:(0,r.jsx)(E.Z,{id:"network-init-gateway",inputProps:{onBlur:function(e){var n=e.target.value;Ne({inputs:H({},Y,{value:n})})}},inputLabelProps:{isNotifyRequired:!0},onChange:function(e){var n=e.target.value;Re({inputs:H({},Y,{value:n})}),Pe()},label:"Gateway"}),ref:ge}),(0,r.jsx)(N.Z,{input:(0,r.jsx)(E.Z,{id:"network-init-dns-csv",inputProps:{onBlur:function(e){var n=e.target.value;Ne({inputs:H({},K,{value:n})})}},inputLabelProps:{isNotifyRequired:!0},onChange:function(e){var n=e.target.value;Re({inputs:H({},K,{value:n})}),Se()},label:"Domain name server(s)"}),ref:me})]}),(0,r.jsx)(R.Z,{count:1,defaultMessageType:"warning",ref:he})]})]})}));se.defaultProps={expectHostDetail:!1,hostDetail:void 0,hostSequence:void 0,toggleSubmitDisabled:void 0},se.displayName="NetworkInitForm";var fe=se},2519:function(e,n,t){t.d(n,{Z:function(){return Z}});var r=t(5893),o=t(5603),i=t(8128),u=t(3640),a=t(7294),l=t(1363),c=t(4427),s=t(9),f=t(192),d=t(5537),v=t(9558),p=t(6239),b=t(7021),m=t(1057),g=t(4799),y=t(3213),h=t(7169);function k(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function w(e){for(var n=1;n=0||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}var j=function(e){var n=e.onClearIndicatorClick,t=x(e,["onClearIndicatorClick"]),i=t.sx,u=t.value,l=x(t,["sx","value"]),c=(0,a.useMemo)((function(){var e;return w((k(e={},"& .".concat(o.Z.icon),{color:h.s7}),k(e,"& .".concat(v.Z.root),{marginRight:".8em"}),k(e,"& .".concat(p.Z.root),{color:h.s7,visibility:"hidden"}),k(e,"&:hover .".concat(v.Z.root," .").concat(p.Z.root,",\n &.").concat(b.Z.focused," .").concat(v.Z.root," .").concat(p.Z.root),{visibility:"visible"}),e),i)}),[i]),s=(0,a.useMemo)((function(){return String(u).length>0&&n&&(0,r.jsx)(m.Z,{position:"end",children:(0,r.jsx)(g.Z,{onClick:n,children:(0,r.jsx)(d.Z,{fontSize:"small"})})})}),[n,u]);return(0,r.jsx)(y.Z,w({endAdornment:s,value:u},l,{sx:c}))};function I(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function O(e){for(var n=1;n=0||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}var Z=function(e){var n=e.id,t=e.label,d=e.selectItems,v=e.checkItem,p=e.disableItem,b=e.formControlProps,m=e.hideItem,g=e.inputLabelProps,y=void 0===g?{}:g,h=e.isReadOnly,k=void 0!==h&&h,w=e.messageBoxProps,x=void 0===w?{}:w,Z=e.name,M=e.onBlur,S=e.onChange,P=e.onFocus,D=e.required,U=e.selectProps,A=void 0===U?{}:U,N=A.multiple,R=A.sx,E=e.value,V=e.isCheckableItems,T=void 0===V?N:V,F=C(e.selectProps,["multiple","sx"]),L=(0,a.useMemo)((function(){return k?O(I({},"& .".concat(o.Z.icon),{visibility:"hidden"}),R):R}),[k,R]),q=(0,a.useCallback)((function(e){return T&&(0,r.jsx)(i.Z,{checked:null===v||void 0===v?void 0:v.call(null,e)})}),[v,T]),B=(0,a.useCallback)((function(e,t){return(0,r.jsxs)(c.Z,{disabled:null===p||void 0===p?void 0:p.call(null,e),sx:{display:(null===m||void 0===m?void 0:m.call(null,e))?"none":void 0},value:e,children:[q(e),t]},"".concat(n,"-").concat(e))}),[q,p,m,n]),H=(0,a.useMemo)((function(){return"".concat(n,"-select-element")}),[n]),_=(0,a.useMemo)((function(){return(0,r.jsx)(s.Z,{id:n,label:t})}),[n,t]),W=(0,a.useMemo)((function(){return t&&(0,r.jsx)(f.Z,O({htmlFor:H,isNotifyRequired:D},y,{children:t}))}),[y,D,t,H]),G=(0,a.useMemo)((function(){return d.map((function(e){var n="string"===typeof e?{value:e}:e,t=n.value,r=n.displayValue;return B(t,void 0===r?t:r)}))}),[B,d]);return(0,r.jsxs)(u.Z,O({fullWidth:!0},b,{children:[W,(0,r.jsx)(j,O({id:H,input:_,multiple:N,name:Z,onBlur:M,onChange:S,onFocus:P,readOnly:k,value:E},F,{sx:L,children:G})),(0,r.jsx)(l.Z,O({},x))]}))}},3106:function(e,n){n.Z={bcn:"Back-Channel Network",ifn:"Internet-Facing Network",mn:"Migration Network",sn:"Storage Network"}}}]);