"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[2958],{53182(e,t,n){n.d(t,{A:()=>d});var o=n(296540),r=n(271856),a=n(515289),i=n(217439),l=n(566723),s=n(294303),c=n(916537);const d=({tableBridges:e,selectedRowIds:t,onSetSelectedRowIds:n})=>{const d=(0,o.useCallback)(e=>{const o=t.includes(e)?t.filter(t=>t!==e):[...t,e];n(o)},[t,n]);if(t.length<2)return null;const m=t.slice(0,2),u=t.slice(2),p=m.map(t=>{const n=e.find(e=>e.mac===t);return n?o.createElement(a.A,{onClose:()=>{d(n.mac)},key:n.mac,maxWidth:192},n.name):null}).filter(Boolean);return o.createElement(s.A,{flexWrap:"wrap",gap:l.kc},p,u.length>0?o.createElement(s.A,{alignItems:"center",flexGrow:0,flexShrink:0},o.createElement(r.A,{portal:!0,isInteractive:!0,description:o.createElement(s.A,{gap:l.YC,flexDirection:"column"},u.map(t=>{const n=e.find(e=>e.mac===t);return n?o.createElement(a.A,{onClose:()=>{d(n.mac)},key:n.mac,maxWidth:192,width:"fit-content"},n.name):null}))},o.createElement(i.A,null,"+",o.createElement(c.sA,{id:"DEVICE_PLUS_N_SELECTED",values:{n:u.length}})))):null)}},705228(e,t,n){n.d(t,{VT:()=>i,i9:()=>r,ng:()=>l,nt:()=>a});var o=n(888170);const r=n(132196).AH`
  font-size: ${o.Ay["font-size-m"]};
  font-weight: normal;
  border-radius: 0;
`,a=112,i=20,l=345},263130(e,t,n){n.d(t,{A:()=>m});var o=n(822336),r=n(296540),a=n(217439),i=n(71479),l=n(382389),s=n(566723),c=n(294303);const d=(0,i.A)(a.A)`
  line-height: 20px;
`,m=({icon:e,description:t,action:n,footer:a,background:i,...m})=>{const{themeName:u}=(0,l.u)();return r.createElement(c.A,{flexGrow:1,borderRadius:s.YC,padding:s.kc,background:i||o.Ay[`desktop-color-neutral-01-${u}`],gap:s.kc,flexDirection:"column",...m},r.createElement(c.A,{flexGrow:1,gap:s.kc},e,t?r.createElement(d,{size:"medium"},t):null,n?r.createElement(c.A,{marginLeft:"auto"},r.createElement(d,{size:"medium"},n)):null),a)}},689965(e,t,n){n.d(t,{A:()=>g,I:()=>o});var o,r=n(296540),a=n(822336),i=n(963724),l=n(71479),s=n(825032),c=n(566723),d=n(294303),m=n(311785);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(o||(o={}));const u=(0,l.A)(d.A,(0,m.A)("marginBottom","isButtonList","margin","flex","width","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||a.Ay[n===s.S.DARK?`desktop-color-neutral-${t?"00":"01"}-dark`:`desktop-color-neutral-${t?"01":"00"}-light`]};
  padding: ${({theme:e,isButtonList:t,padding:n})=>n||(t?`0 ${e.spacing["spacing-l"]}`:e.spacing["spacing-l"])};
  margin-bottom: ${({theme:e,marginBottom:t})=>t||e.spacing["spacing-l"]};
  ${({margin:e})=>e?`margin: ${e};`:""}
  border-radius: 8px;
  flex-direction: column;
  width: ${({width:e="100%"})=>e};
  flex: ${({flex:e=0})=>e};
  > :last-child {
    margin-bottom: 0;
  }
  thead {
    tr {
      height: 32px !important;
    }
    th {
      text-transform: none;
    }
  }
  ${({isButtonList:e})=>e?`\n    > div {\n      display: flex;\n      height: 48px;\n      border-bottom: ${({theme:{themeName:e}})=>a.Ay[`desktop-border-divider-${e}`]};\n      &:last-child {\n        border-bottom: none;\n      }\n    }\n  `:""}
`,p=(0,l.A)(i.A,(0,m.A)("marginBottom","margin","flex","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||a.Ay[n===s.S.DARK?`desktop-color-neutral-${t?"00":"01"}-dark`:`desktop-color-neutral-${t?"01":"00"}-light`]};
  margin-bottom: ${({theme:e,marginBottom:t})=>t||e.spacing["spacing-l"]};
  ${({margin:e})=>e?`margin: ${e};`:""}
  ${({padding:e})=>e?`padding: ${e};`:""}
  border-radius: 8px;
  flex-direction: column;
  flex: ${({flex:e=0})=>e};
  > :last-child {
    margin-bottom: 0;
  }
  thead {
    tr {
      height: 32px !important;
    }
    th {
      text-transform: none;
    }
  }
  > li {
    > div:first-child {
      background: ${({background:e,theme:{themeName:t}})=>e||a.Ay[t===s.S.DARK?"desktop-color-neutral-01-dark":"desktop-color-neutral-00-light"]};
      height: 48px;
      padding: 0 ${c.Ln};
    }
    > div:nth-child(2) {
      margin-bottom: 0;
      padding: 0;
      > div {
        padding: 0 ${c.Ln} ${c.Ln};
      }
    }
  }
`,g=({type:e,marginBottom:t,margin:n,padding:a,flex:i,width:l,nested:s,...c})=>"items"in c?r.createElement(p,{marginBottom:t,margin:n,padding:a,flex:i,nested:s,...c}):r.createElement(u,{nested:s,width:l,marginBottom:t,margin:n,padding:a,flex:i,isButtonList:e===o.BUTTON_LIST,...c},c.children)},349665(e,t,n){n.d(t,{A:()=>i});var o=n(296540),r=n(705228),a=n(294303);const i=({maxWidth:e,label:t,children:n,...i})=>o.createElement(a.A,{flexDirection:"column",width:"100%",maxWidth:"settingsGridContent"===e?r.ng:e,...i},t,n)},317672(e,t,n){n.d(t,{A:()=>c});var o=n(296540),r=n(498577),a=n(284428),i=n(566723),l=n(766624),s=n(294303);const c=({tooltip:e,htmlFor:t,children:n,labelProps:c,wrapperProps:d,tooltipProps:m})=>{const u=(0,a.iL)();return o.createElement(s.A,{alignItems:"center",gap:i.YC,...d},o.createElement(r.A,{htmlFor:t,color:"tertiary",...c,style:{opacity:u?i.xN:void 0,...c?.style}},n),e?o.createElement(l.A,{description:e,...m}):null)}},242366(e,t,n){n.d(t,{A:()=>i});var o=n(296540),r=n(566723),a=n(294303);const i=(0,o.forwardRef)((e,t)=>o.createElement(a.A,{ref:t,flexDirection:"column",gap:r.kc,width:"100%",...e}))},553432(e,t,n){n.d(t,{A:()=>l});var o=n(296540),r=n(454195),a=n(566723),i=n(294303);const l=e=>o.createElement(i.A,{paddingTop:a.YC,paddingBottom:a.YC,gap:a.Ln,rowGap:a.YC,flexWrap:"wrap",minHeight:r.b,alignItems:"center",...e})},373229(e,t,n){n.d(t,{A:()=>d});var o=n(296540),r=n(758649),a=n(71479),i=n(566723),l=n(916537),s=n(311785);const c=(0,a.A)("footer",(0,s.A)("hasFormResetButton"))`
  display: flex;
  justify-content: ${({hasFormResetButton:e})=>e?"space-between":"flex-end"};
  padding: ${i.S2} ${i.fS};
  gap: ${i.kc};
`,d=({allowCancel:e,isDirty:t,isInvalid:n,isSubmitting:a,onFormSubmit:i,onFormReset:s,onFormCancel:d,className:m,submitButtonText:u,customButton:p,applyButton:g,applyButtonFirst:f,hideCancelButton:h,form:A})=>{const b=(0,o.useMemo)(()=>g||o.createElement(r.A,{name:"submit",variant:"primary",type:"submit",onClick:i,disabled:!t||n||a,form:A},o.createElement(l.sA,{id:u||"COMMON_ACTION_APPLY_CHANGES"})),[g,A,t,n,a,i,u]);return o.createElement(c,{className:m,hasFormResetButton:!!s},f?b:p,h?null:o.createElement(r.A,{name:"cancel",variant:"default",type:"button",onClick:d,disabled:!e&&!t},o.createElement(l.sA,{id:"COMMON_ACTION_CANCEL"})),s?o.createElement(r.A,{name:"reset",variant:"default",type:"button",onClick:s,disabled:!t},o.createElement(l.sA,{id:"COMMON_ACTION_RESET_TO_DEFAULT"})):null,f?p:b)}},329109(e,t,n){n.d(t,{A:()=>d});var o=n(296540),r=n(691441),a=n(71479),i=n(132196),l=n(373229);const s=(0,a.A)("div")`
  height: 66px;
`,c=i.AH`
  padding: 0px !important;
`,d=({isDirty:e,onFormSubmit:t,onFormCancel:n,isInvalid:a,...i})=>e?o.createElement(r.A,null,o.createElement(l.A,{isDirty:e,onFormCancel:n,onFormSubmit:t,isInvalid:a,className:c,...i})):o.createElement(s,null)},766624(e,t,n){n.d(t,{A:()=>s});var o=n(296540),r=n(271856),a=n(709690),i=n(284428),l=n(566723);const s=({description:e,isInteractive:t,portal:n=!0,cursorType:s,title:c,position:d,width:m,iconProps:u,disabled:p=!1})=>{const g=(0,i.Im)()||p,f=(0,i.q)();return o.createElement(r.A,{description:e,portal:n,isInteractive:t,style:{display:"flex",alignItems:"center"},cursorType:s,title:c,position:d,width:m,disableHover:f},o.createElement(a.A,{isActive:!0,size:"original",opacity:g?l.xN:void 0,...u}))}},454195(e,t,n){n.d(t,{b:()=>o});const o=32},79786(e,t,n){n.d(t,{m:()=>l});var o=n(296540),r=n(349785),a=n(59116),i=n(870893);function l({schema:e,defaultValues:t,presets:n}){const l=(0,o.useMemo)(()=>n?(0,a.A)(n,e=>e.defaultValues):{},[n]),s=(0,o.useMemo)(()=>({...t,...l}),[l,t]),c=(0,r.mN)({resolver:(0,i.u)(e),shouldFocusError:!0,defaultValues:s,shouldUseNativeValidation:!1,mode:"onTouched"}),d=(0,o.useRef)(s);d.current=s;const m=(0,o.useCallback)((...e)=>{const[t,...n]=e;return c.reset(t?{...t,...l}:d.current,...n)},[l,c]);return{...c,reset:m,formState:{...c.formState,isDirty:!!Object.keys(c.formState.dirtyFields).length,isSubmitting:c.formState.isSubmitting},handleSubmit:(...e)=>c.handleSubmit(e[0],(t,...n)=>{const o=Object.keys(t)[0];if(o)try{const e=document.getElementsByName(o)?.[0];e?.scrollIntoView?.({behavior:"smooth",block:"center"}),e?.focus?.({preventScroll:!0})}catch{}e[1]?.(t,...n)})}}},451449(e,t,n){n.d(t,{I:()=>o});const o=(0,n(296540).createContext)({fields:!1,labels:!1,tooltipPopovers:!1,tooltipIcons:!1})},641777(e,t,n){n.d(t,{A:()=>i});var o=n(296540),r=n(284428),a=n(451449);const i=({isDisabled:e,isAdditive:t=!0,children:n})=>{const i=(0,r.pv)(),l=(0,o.useMemo)(()=>"boolean"==typeof e?{fields:e,labels:e,tooltipIcons:e,tooltipPopovers:!1}:e,[e]),s=(0,o.useMemo)(()=>({fields:t?l.fields||i.fields:l.fields,labels:t?l.labels||i.labels:l.labels,tooltipIcons:t?l.tooltipIcons||i.tooltipIcons:l.tooltipIcons,tooltipPopovers:t?l.tooltipPopovers||i.tooltipPopovers:l.tooltipPopovers}),[t,l.fields,l.labels,l.tooltipIcons,l.tooltipPopovers,i.fields,i.labels,i.tooltipIcons,i.tooltipPopovers]);return o.createElement(a.I.Provider,{value:s},n)}},284428(e,t,n){n.d(t,{Im:()=>s,iL:()=>c,mQ:()=>i,pv:()=>a,q:()=>l});var o=n(296540),r=n(451449);function a(){return(0,o.useContext)(r.I)}function i(){return a().fields}function l(){return a().tooltipPopovers}function s(){return a().tooltipIcons}function c(){return a().labels}},263963(e,t,n){n.d(t,{L_:()=>c,MS:()=>s,rn:()=>l});var o=n(296540),r=n(614476),a=n(916537);const i="{::}",l=(e,t)=>`${e}${i}${JSON.stringify(t??{})}`,s=(e,t)=>{if("string"!=typeof t)return;const[n,...o]=t.split(i);if(!n||!o.length)return t;let r={};try{r=Object.fromEntries(Object.entries(JSON.parse(o.join(i))).map(([t,n])=>[t,"string"==typeof n?s(e,n):n]))}catch{}return e.formatMessage({id:n},r)};function c(){const{formatMessage:e}=(0,a.tz)();return(0,o.useCallback)(t=>s({formatMessage:e},t),[e])}r.z.setErrorMap((e,t)=>e.message?{message:e.message}:e.code===r.z.ZodIssueCode.too_small&&"string"===e.type?{message:l("COMMON_MIN_CHARS",{min:Number(e.minimum)})}:e.code===r.z.ZodIssueCode.too_big&&"string"===e.type?{message:l("COMMON_MAX_CHARS",{name:l("COMMON_VALUE"),max:Number(e.maximum)})}:e.code===r.z.ZodIssueCode.invalid_type&&"array"===e.expected&&"undefined"===e.received?{message:l("COMMON_SELECT_AT_LEAST_ONE_ITEM")}:e.code===r.z.ZodIssueCode.too_small&&"array"===e.type?{message:l("COMMON_ADD_AT_LEAST_X_ITEMS",{min:Number(e.minimum)})}:e.code===r.z.ZodIssueCode.invalid_type&&"undefined"===e.received?{message:l("COMMON_VALIDATION_VALUE_REQUIRED")}:e.code===r.z.ZodIssueCode.invalid_type&&"number"===e.expected?{message:l("COMMON_VALIDATION_PLEASE_ENTER_A_NUMBER")}:{message:t.defaultError})},897502(e,t,n){n.d(t,{A:()=>d});var o=n(296540),r=n(349785),a=n(314714),i=n(566723),l=n(766624),s=n(294303),c=n(284428);const d=function({control:e,name:t,children:n,tooltip:d,tooltipProps:m,onToggle:u,renderCheckbox:p,inputClassName:g}){const f=(0,c.mQ)();return o.createElement(r.xI,{control:e,name:t,render:({field:e})=>{const t=o.createElement(a.A,{id:e.name,onChange:({target:{checked:t}})=>{e.onChange(t),u?.(t)},checked:!!e.value,disabled:f,inputClassName:g},n);return o.createElement(s.A,{gap:i.YC,alignItems:"center"},p?p(t,e):t,d?o.createElement(l.A,{description:d,...m}):null)}})}},610356(e,t,n){n.d(t,{A:()=>d});var o=n(296540),r=n(349785),a=n(54227),i=n(566723),l=n(766624),s=n(294303),c=n(284428);const d=(0,o.forwardRef)(function({control:e,name:t,children:n,tooltip:d,tooltipProps:m,value:u,onCheck:p,...g},f){const h=(0,c.mQ)();return o.createElement(r.xI,{control:e,name:t,render:({field:e})=>o.createElement(s.A,{gap:i.YC,alignItems:"center",ref:f,...g},o.createElement(a.A,{id:e.name,onChange:({target:{checked:t}})=>{t&&(e.onChange(u),p?.())},checked:e.value===u,disabled:h,value:e.value},n),d?o.createElement(l.A,{description:d,...m}):null)})})},895424(e,t,n){n.d(t,{A:()=>d});var o=n(296540),r=n(349785),a=n(438628),i=n(705145),l=n(566723),s=n(263963),c=n(284428);const d=function({control:e,name:t,label:n,placeholder:d,tooltip:m,tooltipProps:u,autoFocus:p,motif:g,onChange:f,onBlur:h,onAfterChange:A,onPaste:b,onKeyDown:v,passwordToggle:E,type:C,helperMessage:y,autoComplete:x,contentBefore:I,contentAfter:k,onFocus:N,value:_,invalid:S}){const w=(0,c.mQ)(),M=(0,c.Im)(),O=(0,c.q)(),$=(0,s.L_)();return o.createElement(r.xI,{control:e,name:t,render:({field:e,fieldState:s,formState:c})=>o.createElement(a.A,{type:C||(E?"password":"text"),variant:"secondary",width:"100%",autoFocus:p,...e,onChange:t=>{f?f(t,e,c):e.onChange(t),A?.(t)},onBlur:t=>{h?h(t,e,c):e.onBlur()},onFocus:N,onPaste:b,disabled:w,value:_??e.value?.toString(),invalid:S||(s.invalid?o.createElement(i.A,{variant:"inherit",style:{overflowWrap:"break-word"}},$((0,r.Jt)(c.errors,t)?.message)||!0," "):void 0),label:n,placeholder:d,labelTooltip:m,labelTooltipProps:{style:{opacity:M?l.xN:void 0,pointerEvents:O?"none":void 0,...u?.style},...u},motif:g,passwordToggle:E,helperMessage:y,autoComplete:x,onKeyDown:v,contentBefore:I,contentAfter:k})})}}}]);