"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[84357],{855926(e,t,n){n.d(t,{A:()=>d});var l=n(296540),a=n(64741),o=n(938487),r=n.n(o),i=n(71479),s=n(311785);const c=(0,i.A)("div",(0,s.A)("x","y","displayGrid","hideHorizontalScrollBar"))`
  position: relative;
  overflow: hidden;

  display: ${({displayGrid:e})=>e?"grid":"block"};

  > div {
    overflow-x: ${({x:e})=>e?"auto":"hidden"};
    overflow-y: ${({y:e})=>e?"auto":"hidden"};
    padding-right: ${({hideHorizontalScrollBar:e,x:t})=>e&&t?"10px":"0px"};
  }
`,m=(0,i.A)("div",(0,s.A)("top","right","bottom","left","darker"))`
  position: absolute;
  pointer-events: none;
  width: ${({top:e,bottom:t})=>e||t?"calc(100% - 36px)":"0"};
  height: ${({top:e,bottom:t})=>e||t?"0":"calc(100% - 36px)"};

  ${e=>{const t=["top","right","bottom","left"].find(t=>e[t]),n=["top","bottom"].includes(t)?"left":"top";return t?`\n      ${t}: 0;\n      ${n}: 18px;\n      box-shadow: 0 0 15px 15px ${r()(e.theme.motifPalette.uiBase).darken(e.darker?.1:0).alpha(.4).css()};\n    `:""}};
`,d=({children:e,className:t,darker:n,height:o,horizontal:r,hideHorizontalScrollBar:i=!1,vertical:s,width:d,displayGrid:u})=>{const h=(0,l.useRef)(),[{top:f,right:E,bottom:p,left:g},A]=(0,l.useState)({}),b=(0,a.A)(()=>{if(h?.current){const{scrollLeft:e,scrollTop:t,offsetWidth:n,offsetHeight:l,scrollWidth:a,scrollHeight:o}=h.current;A({top:t>0,right:a>n+e,bottom:o>l+t,left:e>0})}},16);(0,l.useEffect)(()=>{const e=h.current;return e?.addEventListener("scroll",b),window.addEventListener("resize",b),b(),()=>{e?.removeEventListener("scroll",b),window.removeEventListener("resize",b)}},[h.current]);const v=s&&f?l.createElement(m,{top:!0,darker:n}):null,C=r&&E?l.createElement(m,{right:!0,darker:n}):null,y=s&&p?l.createElement(m,{bottom:!0,darker:n}):null,M=r&&g?l.createElement(m,{left:!0,darker:n}):null;return l.createElement(c,{y:s,x:r,displayGrid:u,hideHorizontalScrollBar:i,style:{height:o,width:d},className:t},l.createElement("div",{ref:h,style:{height:o,width:d}},e),v,C,y,M)}},190646(e,t,n){n.d(t,{A:()=>r});var l=n(296540),a=n(592563),o=n(916537);const r=(0,l.forwardRef)(({onRemove:e,...t},n)=>l.createElement(a.A,{...t,name:"table-manage-remove",onPress:e,type:"button",fontSize:"medium",variant:"destructive",ref:n},l.createElement(o.sA,{id:"COMMON_ACTION_REMOVE"})))},281349(e,t,n){n.d(t,{A:()=>c});var l=n(296540),a=n(705145),o=n(294303),r=n(916537),i=n(586371),s=n(147606);const c=({children:e,onRemove:t,names:n,removeMessageId:c,message:m})=>l.createElement(s.A,{trigger:e,message:m??l.createElement(r.sA,{id:c||"COMMON_QUESTION_ARE_YOU_SURE_YOU_WANT_TO_REMOVE",values:{name:n.join('", "'),count:n.length>1?i.Uh.PLURAL:i.Uh.SINGLE}}),onConfirm:t,title:l.createElement(o.A,{maxWidth:300,overflow:"hidden"},l.createElement(a.A,{isTruncated:!0,variant:"inherit"},l.createElement(r.sA,{id:"COMMON_QUESTION_REMOVE",values:{name:n.join('", "')}})))})},153933(e,t,n){n.d(t,{Ay:()=>U,Ix:()=>I,MS:()=>L});var l=n(296540),a=n(822336),o=n(469733),r=n(997859),i=n(963070),s=n(123474),c=n(43627),m=n(758649),d=n(231755),u=n(71479),h=n(382389),f=n(497665),E=n(454195),p=n(566723),g=n(855926),A=n(294303),b=n(126457),v=n(86392),C=n(916537),y=n(586371),M=n(333422),S=n(602021),w=n(383725),N=n(199582),R=n(464417),k=n(281349),O=n(190646);const I=72,_="table-with-manage-narrow-column",T=(0,u.A)(g.A)`
  .${_} {
    padding-left: ${p.YC};
  }
`;var D;!function(e){e.REMOVE="remove",e.PAUSE="pause",e.RESUME="resume",e.DRAG_AND_DROP="dragAndDrop",e.DUPLICATE="duplicate"}(D||(D={}));const P=e=>e?.name||"";function L(e,t){return async(n,l)=>{await t((0,c.be)(e,n,l),e[n])}}const U=function({footerContent:e,managingFooterContent:t,getName:n=P,isRemovable:c,removeItems:u,isPauseable:g,pauseItems:I,pauseMessage:L,removeMessage:U,isResumable:x,resumeItems:B,fetchFunctions:G=[],fetchQueries:z=[],forwardedRef:V,onRowClick:$,maxResumableItems:F,showEmptyTable:H,dragAndDrop:j,onDrop:Q,isTableInDragAndDropMode:W,dragAndDropFetchFunctions:Y=[],showDragAndDropHandles:q,setIsManageMode:K,alwaysShowManage:J,forceManageButtonEnabled:X=!1,renderManageButton:Z,narrowLeftColumn:ee,renderRemoveAction:te,shouldConfirmRemove:ne=!0,renderPauseAction:le,renderResumeAction:ae,hideManageButton:oe,rowReorderVariant:re,duplicateItems:ie,isDuplicable:se,...ce}){const{items:me,idField:de,columns:ue}=ce,{themeName:he}=(0,h.u)(),fe=(0,o.useDispatch)(),[Ee,pe]=(0,l.useState)(!1),[ge,Ae]=(0,l.useState)([]),[be,ve]=(0,l.useState)(null),Ce=(0,f.jE)(),ye=(0,R.R)(),Me=(0,l.useCallback)(()=>{G.forEach(fe),z.forEach(e=>Ce.invalidateQueries(e(ye)))},[fe,G,z,Ce,ye]),Se=(0,l.useMemo)(()=>"function"==typeof ue?ue({isManaging:Ee}):ue,[ue,Ee]),we=(0,o.useSelector)(S.EL),Ne=(0,l.useMemo)(()=>![c,g,x,se].some(e=>e&&me.some(e))&&!X,[c,g,x,se,X,me]),Re=!Ne&&!oe||!!e,ke=(0,l.useMemo)(()=>Ne?me:me.map(e=>{const t=e.children?.map(e=>[c,g,x].some(t=>t?.(e))?e:{...e,disabled:e.disabled||Ee});return[c,g,x].some(t=>t?.(e))?{...e,children:t}:{...e,disabled:e.disabled||Ee,children:t}}),[Ee,me,Ne,c,g,x]),Oe=(0,l.useMemo)(()=>me.filter(e=>ge.includes(e[de||"id"])),[ge,me,de]),[Ie,_e,Te,De]=(0,l.useMemo)(()=>{const e=x&&Oe.filter(e=>e&&x(e))||[];return[Oe.some(e=>e&&c(e)),!!g&&Oe.some(e=>e&&g(e)),!!x&&(void 0!==F?e.length>0&&e.length<=F:e.length>0),!!se&&Oe.every(e=>e&&se(e))]},[Oe,g,x,F,c,se]),Pe=(0,l.useCallback)(()=>{pe(!Ee),K&&K(!Ee),Ee&&Ae([])},[Ee,K]),Le=(0,l.useCallback)(()=>{const e=x?Oe.filter(x):[];ve(D.RESUME),B?.(e).finally(()=>{ve(null),Me()})},[x,Oe,B,Me]),Ue=(0,l.useCallback)(e=>{ve(D.PAUSE),I?.(e).finally(()=>{ve(null),Me()})},[I,Me]),xe=(0,l.useCallback)(()=>{const e=g?Oe.filter(g):[],t=e.map(n).filter(Boolean).join('", "');fe((0,v.E)({title:"SETTINGS_PAUSE_TITLE",titleValues:{name:t||null},message:L,messageValues:{name:t||null,count:Oe.length>1?y.Uh.PLURAL:y.Uh.SINGLE},confirmButtonText:"COMMON_ACTION_PAUSE",onConfirm:()=>{fe((0,b.AS)()),Ue(e)}}))},[g,Oe,n,fe,L,Ue]),Be=(0,l.useCallback)(e=>(fe((0,b.AS)()),ve(D.REMOVE),u(e).then(()=>{K?.(!1),pe(!1),Ae([])}).finally(()=>{ve(null),Me()})),[fe,u,K,Me]),Ge=(0,l.useCallback)(()=>Be(Oe.filter(c)),[Oe,c,Be]),ze=(0,l.useCallback)((e,t)=>{Ee?t?.target?.closest("tr")?.querySelector('input[type="checkbox"]')?.click():$?.(e)},[$,Ee]),Ve=(0,l.useCallback)(e=>{const t=e.active?.data?.current?.index,n=e.over?.data?.current?.index;(0,r.A)(t)||(0,r.A)(n)||(ve(D.DRAG_AND_DROP),Q?.(t+(ce.rowOffset??0),n+(ce.rowOffset??0)).finally(()=>{ve(null),W||((Y||G).forEach(fe),z.forEach(e=>Ce.invalidateQueries(e(ye))))}))},[Q,ce.rowOffset,W,Y,G,fe,z,Ce,ye]),$e=(0,l.useCallback)(e=>(ve(D.DUPLICATE),ie?.(e).then(()=>{K?.(!1),pe(!1),Ae([])}).finally(()=>{ve(null),Me()})),[ie,K,Me]),Fe=(0,l.useMemo)(()=>({name:"table-manage-"+(Ee?"done":"manage"),size:"medium",type:"button",variant:"inline",disabled:(Ne&&!Ee||W)&&!X,onClick:Pe,children:l.createElement(C.sA,{id:Ee?"COMMON_ACTION_DONE":"COMMON_ACTION_MANAGE"})}),[Ne,X,Pe,Ee,W]),He=(0,l.useCallback)((e,t)=>ce.cellClassName?"string"==typeof ce.cellClassName?ce.cellClassName:ce.cellClassName(e,t):ee&&t.id===Se?.[0]?.id?_:"",[Se,ee,ce]),je=!oe&&(!Ne&&me.length>0||J||Ee),Qe=Ee?Te||_e||Ie:!!e;return(0,l.useEffect)(()=>{be||W||ve(null)},[W,be]),l.createElement(A.A,{flexDirection:"column",width:"100%"},0!==me.length||H?l.createElement(T,{horizontal:!0},!Ee&&j?l.createElement(s.A,{...ce,cellClassName:He,columns:Se,disableColumnFilters:!0,disableSelection:!0,onRowClick:$,onDragEnd:Ve,showHandles:q,truncateHeaderCells:!0,rowProps:()=>({...$&&{[N.L]:w.b.SIDE_PANEL_TRIGGER}}),..."dropzone"===re?{rowReorderVariant:re,placeHolderClassName:M.Rm}:{}}):l.createElement(i.A,{...ce,cellClassName:He,columns:Se,items:ke,multiSelectMode:Ee,selectedIds:ge,onChangeSelection:Ae,disableSelection:!Ee,onRowClick:ze,dragAndDrop:!1,truncateHeaderCells:!0,rowProps:()=>({[N.L]:w.b.SIDE_PANEL_TRIGGER})})):null,Re&&!we?l.createElement(A.A,{marginTop:p.YC,alignItems:"center",gap:p.Ln,height:E.b},Qe?l.createElement(A.A,null,Ee?l.createElement(A.A,{gap:p.Ln,alignItems:"center"},Te?l.createElement(A.A,null,ae&&x?ae({pending:!!be,onResume:Le,items:Oe.filter(x)}):l.createElement(m.A,{name:"table-manage-resume",onClick:Le,type:"button",size:"medium",variant:"inline",disabled:!!be},l.createElement(C.sA,{id:"COMMON_ACTION_RESUME"}))):null,_e?l.createElement(A.A,null,le&&g?le({pending:!!be,onPause:()=>Ue(Oe.filter(g)),items:Oe.filter(g)}):l.createElement(m.A,{name:"table-manage-pause",onClick:xe,type:"button",size:"medium",variant:"inline",disabled:!!be},l.createElement(C.sA,{id:"COMMON_ACTION_PAUSE"}))):null,Ie?l.createElement(A.A,null,te?te({pending:!!be,onRemove:()=>Be(Oe.filter(c)),items:Oe.filter(c)}):ne?l.createElement(k.A,{onRemove:Ge,names:Oe.filter(c).map(n).filter(Boolean),removeMessageId:U},l.createElement(O.A,{isPending:!!be})):l.createElement(O.A,{isPending:!!be,onRemove:Ge})):null,De?l.createElement(A.A,null,l.createElement(m.A,{name:"table-manage-duplicate",onClick:()=>$e(Oe.filter(se)),type:"button",size:"medium",variant:"inline",disabled:!!be},l.createElement(C.sA,{id:"SETTINGS_DUPLICATE"}))):null):e):null,je&&Qe?l.createElement(d.A,{orientation:"vertical",style:{height:p.Ln},color:a.Ay[`desktop-color-neutral-03-${he}`]}):null,je?l.createElement(A.A,null,Z?.({...Fe,isManaging:Ee})||l.createElement(m.A,{type:"button",...Fe})):null,je&&Ee&&t?l.createElement(l.Fragment,null,l.createElement(d.A,{orientation:"vertical",style:{height:p.Ln},color:a.Ay[`desktop-color-neutral-03-${he}`]}),t):null):null)}},79786(e,t,n){n.d(t,{m:()=>i});var l=n(296540),a=n(349785),o=n(59116),r=n(870893);function i({schema:e,defaultValues:t,presets:n}){const i=(0,l.useMemo)(()=>n?(0,o.A)(n,e=>e.defaultValues):{},[n]),s=(0,l.useMemo)(()=>({...t,...i}),[i,t]),c=(0,a.mN)({resolver:(0,r.u)(e),shouldFocusError:!0,defaultValues:s,shouldUseNativeValidation:!1,mode:"onTouched"}),m=(0,l.useRef)(s);m.current=s;const d=(0,l.useCallback)((...e)=>{const[t,...n]=e;return c.reset(t?{...t,...i}:m.current,...n)},[i,c]);return{...c,reset:d,formState:{...c.formState,isDirty:!!Object.keys(c.formState.dirtyFields).length,isSubmitting:c.formState.isSubmitting},handleSubmit:(...e)=>c.handleSubmit(e[0],(t,...n)=>{const l=Object.keys(t)[0];if(l)try{const e=document.getElementsByName(l)?.[0];e?.scrollIntoView?.({behavior:"smooth",block:"center"}),e?.focus?.({preventScroll:!0})}catch{}e[1]?.(t,...n)})}}},895424(e,t,n){n.d(t,{A:()=>m});var l=n(296540),a=n(349785),o=n(438628),r=n(705145),i=n(566723),s=n(263963),c=n(284428);const m=function({control:e,name:t,label:n,placeholder:m,tooltip:d,tooltipProps:u,autoFocus:h,motif:f,onChange:E,onBlur:p,onAfterChange:g,onPaste:A,onKeyDown:b,passwordToggle:v,type:C,helperMessage:y,autoComplete:M,contentBefore:S,contentAfter:w,onFocus:N,value:R,invalid:k}){const O=(0,c.mQ)(),I=(0,c.Im)(),_=(0,c.q)(),T=(0,s.L_)();return l.createElement(a.xI,{control:e,name:t,render:({field:e,fieldState:s,formState:c})=>l.createElement(o.A,{type:C||(v?"password":"text"),variant:"secondary",width:"100%",autoFocus:h,...e,onChange:t=>{E?E(t,e,c):e.onChange(t),g?.(t)},onBlur:t=>{p?p(t,e,c):e.onBlur()},onFocus:N,onPaste:A,disabled:O,value:R??e.value?.toString(),invalid:k||(s.invalid?l.createElement(r.A,{variant:"inherit",style:{overflowWrap:"break-word"}},T((0,a.Jt)(c.errors,t)?.message)||!0," "):void 0),label:n,placeholder:m,labelTooltip:d,labelTooltipProps:{style:{opacity:I?i.xN:void 0,pointerEvents:_?"none":void 0,...u?.style},...u},motif:f,passwordToggle:v,helperMessage:y,autoComplete:M,onKeyDown:b,contentBefore:S,contentAfter:w})})}}}]);