You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
8.0 KiB
1 lines
8.0 KiB
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[380],{15079:function(e,t,l){var n=l(85893),r=l(97212),a=l(78462),u=l(5616),o=l(48403),s=l.n(o),c=l(55238),i=l(84154);let capEntryLabel=e=>{let t=e.replace(/([a-z\d])([A-Z])/g,"$1 $2"),l=t.toLowerCase();return s()(l)},renderEntryValueWithMono=e=>{let{entry:t}=e;return(0,n.jsx)(i.$_,{whiteSpace:"nowrap",children:String(t)})},renderEntryValueWithPassword=e=>{let{entry:t,key:l}=e;return/passw/i.test(l)?(0,n.jsx)(i.PJ,{revealButtonProps:{sx:{marginRight:0,padding:0}},monospaced:!0,textLineHeight:null,children:String(t)}):renderEntryValueWithMono(e)},buildEntryList=e=>{let{depth:t=0,entries:l,getEntryLabel:u,getListProps:o,getListItemProps:s,listKey:c,maxDepth:i,renderEntry:d,renderEntryValue:h}=e,g=[];Object.entries(l).forEach(e=>{let[l,a]=e,o="form-summary-entry-".concat(l),c=null!==a&&"object"==typeof a,v=c?null:a;g.push((0,n.jsx)(r.ZP,{sx:{paddingLeft:"".concat(t,"em")},...null==s?void 0:s.call(null,{depth:t,entry:v,key:l}),children:d({depth:t,entry:v,getLabel:u,key:l,nest:c,renderValue:h})},o)),c&&t<i&&g.push(buildEntryList({depth:t+1,entries:a,getEntryLabel:u,listKey:l,maxDepth:i,renderEntry:d,renderEntryValue:h}))});let v="form-summary-list-".concat(null!=c?c:"root");return(0,n.jsx)(a.Z,{dense:!0,disablePadding:!0,...null==o?void 0:o.call(null,{depth:t,entries:l,key:c}),children:g},v)};t.Z=e=>{let{entries:t,getEntryLabel:l=e=>{let{cap:t,key:l}=e;return t(l)},getListProps:r,getListItemProps:a,hasPassword:o,maxDepth:s=3,renderEntry:d=e=>{let{depth:t,entry:l,getLabel:r,key:a,nest:o,renderValue:s}=e;return(0,n.jsxs)(c.Z,{fullWidth:!0,growFirst:!0,row:!0,maxWidth:"100%",children:[(0,n.jsx)(i.Ac,{children:r({cap:capEntryLabel,depth:t,entry:l,key:a})}),(0,n.jsx)(u.Z,{sx:{maxWidth:"100%",overflowX:"scroll"},children:!o&&s({depth:t,entry:l,key:a})})]})},renderEntryValue:h=e=>{let{entry:t}=e;return["",null,void 0].some(e=>t===e)?(0,n.jsx)(i.Ac,{children:"none"}):o?renderEntryValueWithPassword(e):renderEntryValueWithMono(e)}}=e;return buildEntryList({entries:t,getEntryLabel:l,getListProps:r,getListItemProps:a,maxDepth:s,renderEntry:d,renderEntryValue:h})}},21642:function(e,t,l){var n=l(85893),r=l(67294),a=l(68917);let u={count:0,defaultMessageType:"info",messages:void 0,onSet:void 0,usePlaceholder:!0},o=(0,r.forwardRef)((e,t)=>{let{count:l=u.count,defaultMessageType:o=u.defaultMessageType,messages:s,onSet:c,usePlaceholder:i=u.usePlaceholder}=e,[d,h]=(0,r.useState)({}),g=(0,r.useMemo)(()=>({...s,...d}),[s,d]),v=(0,r.useCallback)(e=>void 0!==g[e],[g]),f=(0,r.useCallback)((e,t)=>{let l=0;h(n=>{let{[e]:r,...a}=n;return t&&(a[e]=t),l=Object.keys(a).length,a}),null==c||c.call(null,l)},[c]),p=(0,r.useCallback)((e,t)=>{let l=0,n=t?(e,n)=>{e[n]=t,l+=1}:void 0;h(t=>{let r={};return Object.keys(t).forEach(a=>{e.test(a)?null==n||n.call(null,r,a):(r[a]=t[a],l+=1)}),r}),null==c||c.call(null,l)},[c]),b=(0,r.useMemo)(()=>{let e=Object.entries(g),t=l>0,r=t?l:e.length,u=[];if(e.every(e=>{let[t,l]=e,{children:s,type:c=o}=l;return u.push((0,n.jsx)(a.Z,{type:c,children:s},"message-".concat(t))),u.length<r}),i&&t&&0===u.length){let e=l-u.length;for(let t=0;t<e;t+=1)u.push((0,n.jsx)(a.Z,{sx:{visibility:"hidden"},text:"Placeholder"},"message-placeholder-".concat(t)))}return u},[l,o,i,g]);return(0,r.useImperativeHandle)(t,()=>({exists:v,setMessage:f,setMessageRe:p}),[v,f,p]),(0,n.jsx)(n.Fragment,{children:b})});o.defaultProps=u,o.displayName="MessageGroup",t.Z=o},88468:function(e,t,l){var n=l(67294),r=l(94121),a=l(591);let u=(0,n.forwardRef)((e,t)=>{let{input:l,onChange:u=function(e){let{handlers:{base:t,origin:l}}=e;for(var n=arguments.length,r=Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];null==t||t.call(null,...r),null==l||l.call(null,...r)},onMount:o,onUnmount:s}=e,{props:c}=l,{valueKey:i,valueType:d}=(0,n.useMemo)(()=>{let{type:e}=c,t="value",l="string";return e===r.Z.checkbox&&(t="checked",l="boolean"),{valueKey:t,valueType:l}},[c]),{onChange:h,[i]:g,...v}=c,[f,p]=(0,n.useState)(g),b=(0,n.useCallback)(e=>{let{target:{[i]:t}}=e,l=a.Z[d](t);p(l)},[i,d]),y=(0,n.useCallback)(function(){for(var e=arguments.length,t=Array(e),l=0;l<e;l++)t[l]=arguments[l];return null==u?void 0:u.call(null,{handlers:{base:b,origin:h}},...t)},[b,h,u]);return(0,n.useEffect)(()=>(null==o||o.call(null),s),[]),(0,n.useImperativeHandle)(t,()=>({get:()=>f,set:p}),[f]),(0,n.cloneElement)(l,{...v,onChange:y,[i]:f})});u.displayName="UncontrolledInput",t.Z=u},6903:function(e,t,l){var n=l(67294),r=l(67645),a=l(41247);t.Z=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{config:t,onError:l,onData:u,url:o=""}=e,[s,c]=(0,n.useState)(!1),i=(0,n.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0,s="".concat(o).concat(e);s&&(c(!0),r.Z.get(s,{...t,...n}).then(e=>{let{data:t}=e;null==u||u.call(null,t)}).catch(e=>{let t=(0,a.Z)(e);null==l||l.call(null,t)}).finally(()=>{c(!1)}))},[o,t,u,l]);return{fetch:i,loading:s}}},32576:function(e,t,l){var n=l(85893),r=l(67294),a=l(84070),u=l(15079);t.Z=e=>{let{list:t={}}=e,[l,o]=(0,r.useState)({}),s=(0,r.useMemo)(()=>Object.keys(t),[t]),c=(0,r.useMemo)(()=>Object.keys(l),[l]),i=(0,r.useMemo)(()=>c.length===s.length,[c.length,s.length]),d=(0,r.useMemo)(()=>c.length>0,[c.length]),h=(0,r.useMemo)(()=>s.length>1,[s.length]),g=(0,r.useCallback)(e=>{let{confirmDialogProps:t={},formSummaryProps:r={},getConfirmDialogTitle:a,onProceedAppend:o,renderEntry:s}=e;return{actionProceedText:"Delete",content:(0,n.jsx)(u.Z,{entries:l,maxDepth:0,renderEntry:s,...r}),onProceedAppend:o,proceedColour:"red",titleText:a(c.length),...t}},[l,c.length]),v=(0,r.useCallback)(e=>!!l[e],[l]),f=(0,r.useCallback)(()=>o({}),[]),p=(0,r.useCallback)(e=>o(s.reduce((t,l)=>(e&&(t[l]=e),t),{})),[s]),b=(0,r.useCallback)((e,t)=>o((0,a.ZP)(e,t||void 0)),[]);return{buildDeleteDialogProps:g,checklist:l,checks:c,getCheck:v,hasAllChecks:i,hasChecks:d,multipleItems:h,resetChecks:f,setAllChecks:p,setCheck:b}}},67978:function(e,t,l){var n=l(67294),r=l(8100),a=l(98436),u=l(96262);t.Z=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{baseUrl:l=a.Z,fetcher:o=u.Z,mod:s,...c}=t,{data:i,error:d}=(0,r.ZP)("".concat(l).concat(e),o,c),h=(0,n.useMemo)(()=>s&&i&&s(i),[i,s]),g=!d&&!i;return{altData:h,data:i,error:d,loading:g}}},48882:function(e,t,l){l.d(t,{Z:function(){return api_converters_toAnvilOverviewList}});var api_converters_toAnvilOverviewHostList=e=>e.reduce((e,t)=>{let{hostName:l,hostType:n,hostUUID:r}=t;return e[r]={name:l,type:n,uuid:r},e},{}),api_converters_toAnvilOverviewList=e=>e.reduce((e,t)=>{let{anvilDescription:l,anvilName:n,anvilUUID:r,hosts:a}=t;return e[r]={description:l,hosts:api_converters_toAnvilOverviewHostList(a),name:n,uuid:r},e},{})},84070:function(e,t,l){l.d(t,{Um:function(){return buildRegExpObjectStateSetterCallback}});let defaultObjectStatePropSetter=function(){for(var e=arguments.length,t=Array(e),l=0;l<e;l++)t[l]=arguments[l];let[,n,r,a]=t;void 0!==a&&(n[r]=a)},buildRegExpObjectStateSetterCallback=function(e,t){let{set:l=defaultObjectStatePropSetter}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n=>{let r={};return Object.keys(n).forEach(a=>{e.test(a)?l(n,r,a,t):r[a]=n[a]}),r}};t.ZP=function(e,t){let{guard:l=()=>!0,set:n=defaultObjectStatePropSetter}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r=>{let{[e]:a,...u}=r,o={...u};return l(r,e,t)&&n(r,o,e,t),o}}},78438:function(e,t){t.Z=(e,t)=>e&&Object.keys(e).reduce((e,l)=>({...e,[l]:t}),{})},591:function(e,t){t.Z={boolean:e=>!!e,number:e=>parseInt(String(e),10)||0,string:e=>String(e)}},43799:function(e,t,l){var n=l(48403),r=l.n(n);let getFormikErrorMessages=function(e){let{build:t=(e,t)=>{let l=t;return"string"==typeof l&&(l=r()(l.replace(/^[^\s]+\.([^.]+)/,"$1"))),{children:l,type:"warning"}},chain:l="",skip:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.entries(e).reduce((e,r)=>{let[a,u]=r,o=[l,a].filter(e=>!!e).join(".");return null!==u&&"object"==typeof u?{...e,...getFormikErrorMessages(u,{build:t,chain:o,skip:n})}:((null==n?void 0:n.call(null,o))||(e[o]=t(o,u)),e)},{})};t.Z=getFormikErrorMessages}}]); |