"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[25677],{431682(e,s,t){t.d(s,{A:()=>A});var l=t(274934),n=t(247816),i=t(814557),o=t(309130),a=t(419284),r=t(100978),c=t(291508);const d=(0,n.A)(r.A,(0,c.A)("color"))`
  border-radius: ${i.Ay["desktop-radius-infinity"]};
  background: ${({color:e,theme:{themeName:s}})=>(0,a.b_)(e||i.Ay[`desktop-color-ublue-06-${s}`],.1)};
  padding: 2px ${o.kc};
`,A=({children:e,color:s})=>(0,l.jsx)(d,{color:s,children:e})},530110(e,s,t){t.d(s,{A:()=>x});var l=t(274934),n=t(602086),i=t(977872),o=t(396489),a=t.n(o),r=t(938984),c=t(954702),d=t(215202),A=t(722837),u=t(147328),m=t(486529),E=t(7476),C=t(252445),_=t(470070),O=t(570801),h=t(94411),b=t(332530),f=t(158402),M=t(39279),p=t(696766);const x=({leftFilterPageId:e,...s})=>{const t=(0,i.wA)(),o=(0,n.useRef)(null),x=(0,u.A)(o),T=m.l[s.tableType],g=Boolean(T),N=(0,h.A)(s.tableType),y=(0,i.d4)(O.Bm),j=(0,n.useCallback)(()=>{const e=b.W2.tables?.[s.tableType],l=[...e?.initialColumns||[]],n=e?.columnOrder,i={[s.tableType]:{initialColumns:l,...n?{columnOrder:n}:{},initialColumnSnapshot:l.reduce((e,s)=>(e[String(s)]=!0,e),{...e?.initialColumnSnapshot||{}})}};g&&(i[s.tableType].columnSize=T,s.tableType===A.l.UNIFI_DEVICE&&m.t.forEach(e=>{i[e]={columnSize:T}})),t((0,f.zF)(i))},[t,s.tableType,g,T]),I=(0,n.useCallback)(()=>{t((0,C.Zi)(e))},[t,e]),S=(0,n.useMemo)(()=>{const e=a()([...b.W2.tables?.[s.tableType]?.initialColumns||[]].sort(),[...N?.initialColumns||[]].sort()),t=a()(b.W2.tables?.[s.tableType]?.columnOrder,N?.columnOrder);if(g){let l=!N?.columnSize||a()(T,N?.columnSize);if(s.tableType===A.l.UNIFI_DEVICE){const e=m.t.every(e=>!y[e]?.columnSize||a()(T,y[e]?.columnSize));l=l&&e}return e&&t&&l}return e&&t},[s.tableType,N,g,y,T]);return(0,l.jsx)(p.CW,{hasOverflow:x,children:(0,l.jsxs)(p.kp,{ref:o,children:[(0,l.jsx)(d.D,{variant:"small",children:(0,l.jsx)(_.sA,{id:"COMMON_CUSTOMIZE_COLUMNS"})}),(0,l.jsx)(E.A,{...s}),(0,l.jsxs)(p.Ot,{children:[(0,l.jsx)(M.d$,{}),(0,l.jsx)(c.A,{type:"button",onPress:j,isDisabled:S,children:(0,l.jsx)(r.A,{size:"medium",color:"inherit",children:(0,l.jsx)(_.sA,{id:"COMMON_ACTION_RESTORE"})})}),(0,l.jsx)(c.A,{type:"button",onPress:I,children:(0,l.jsx)(r.A,{size:"medium",color:"inherit",children:(0,l.jsx)(_.sA,{id:"COMMON_ACTION_DONE"})})})]})]})})}},373616(e,s,t){t.d(s,{A:()=>o});var l=t(274934),n=t(558844),i=t(479086);const o=({children:e})=>(0,l.jsx)(i.A,{children:(0,l.jsx)(n.y,{children:e})})},558844(e,s,t){t.d(s,{y:()=>o});var l=t(247816),n=t(309130),i=t(100978);const o=(0,l.A)(i.A)`
  flex-direction: column;
  gap: ${n.kc};
  margin: 0 0 ${n.Ln} ${n.kc};
`},479086(e,s,t){t.d(s,{A:()=>r});var l=t(274934),n=t(602086),i=t(757614),o=t(961231),a=t(614209);const r=({children:e})=>{const{[o.A.IS_MAXIMIZED]:s}=(0,n.useContext)(a.A);return(0,l.jsx)(i.A,{isHidden:s,children:e})}},436417(e,s,t){t.d(s,{m:()=>a});var l=t(602086),n=t(42220),i=t(369289),o=t(721533);function a({schema:e,defaultValues:s,presets:t}){const a=(0,l.useMemo)(()=>t?(0,i.A)(t,e=>e.defaultValues):{},[t]),r=(0,l.useMemo)(()=>({...s,...a}),[a,s]),c=(0,n.mN)({resolver:(0,o.u)(e),shouldFocusError:!0,defaultValues:r,shouldUseNativeValidation:!1,mode:"onTouched"}),d=(0,l.useRef)(r);d.current=r;const A=(0,l.useCallback)((...e)=>{const[s,...t]=e;return c.reset(s?{...s,...a}:d.current,...t)},[a,c]);return{...c,reset:A,formState:{...c.formState,isDirty:!!Object.keys(c.formState.dirtyFields).length,isSubmitting:c.formState.isSubmitting},handleSubmit:(...e)=>c.handleSubmit(e[0],(s,...t)=>{const l=Object.keys(s)[0];if(l)try{const e=document.getElementsByName(l)?.[0];e?.scrollIntoView?.({behavior:"smooth",block:"center"}),e?.focus?.({preventScroll:!0})}catch{}e[1]?.(s,...t)})}}},260334(e,s,t){t.d(s,{L_:()=>d,MS:()=>c,rn:()=>r});var l=t(602086),n=t(949812),i=t(765282),o=t(470070);const a="{::}",r=(e,s)=>`${e}${a}${JSON.stringify(s??{})}`,c=(e,s)=>{if("string"!=typeof s)return;const[t,...l]=s.split(a);if(!t||!l.length)return s;let n={};try{n=Object.fromEntries(Object.entries(JSON.parse(l.join(a))).map(([s,t])=>[s,"string"==typeof t?c(e,t):t]))}catch{}return e.formatMessage({id:t},n)};function d(){const{formatMessage:e}=(0,o.tz)();return(0,l.useCallback)(s=>c({formatMessage:e},s),[e])}n.pJ((e,s)=>e.message?{message:e.message}:e.code===i.eq.too_small&&"string"===e.type?{message:r("COMMON_MIN_CHARS",{min:Number(e.minimum)})}:e.code===i.eq.too_big&&"string"===e.type?{message:r("COMMON_MAX_CHARS",{name:r("COMMON_VALUE"),max:Number(e.maximum)})}:e.code===i.eq.invalid_type&&"array"===e.expected&&"undefined"===e.received?{message:r("COMMON_SELECT_AT_LEAST_ONE_ITEM")}:e.code===i.eq.too_small&&"array"===e.type?{message:r("COMMON_ADD_AT_LEAST_X_ITEMS",{min:Number(e.minimum)})}:e.code===i.eq.invalid_type&&"undefined"===e.received?{message:r("COMMON_VALIDATION_VALUE_REQUIRED")}:e.code===i.eq.invalid_type&&"number"===e.expected?{message:r("COMMON_VALIDATION_PLEASE_ENTER_A_NUMBER")}:{message:s.defaultError})},635891(e,s,t){t.d(s,{A:()=>d});var l=t(274934),n=t(42220),i=t(843615),o=t(95032),a=t(309130),r=t(260334),c=t(184931);const d=function({control:e,name:s,label:t,placeholder:d,tooltip:A,tooltipProps:u,autoFocus:m,motif:E,onChange:C,onBlur:_,onAfterChange:O,onPaste:h,onKeyDown:b,passwordToggle:f,type:M,helperMessage:p,autoComplete:x,contentBefore:T,contentAfter:g,onFocus:N,value:y,invalid:j}){const I=(0,c.mQ)(),S=(0,c.Im)(),R=(0,c.q)(),D=(0,r.L_)();return(0,l.jsx)(n.xI,{control:e,name:s,render:({field:e,fieldState:r,formState:c})=>(0,l.jsx)(i.A,{type:M||(f?"password":"text"),variant:"secondary",width:"100%",autoFocus:m,...e,onChange:s=>{C?C(s,e,c):e.onChange(s),O?.(s)},onBlur:s=>{_?_(s,e,c):e.onBlur()},onFocus:N,onPaste:h,disabled:I,value:y??e.value?.toString(),invalid:j||(r.invalid?(0,l.jsxs)(o.A,{variant:"inherit",style:{overflowWrap:"break-word"},children:[D((0,n.Jt)(c.errors,s)?.message)||!0," "]}):void 0),label:t,placeholder:d,labelTooltip:A,labelTooltipProps:{style:{opacity:S?a.xN:void 0,pointerEvents:R?"none":void 0,...u?.style},...u},motif:E,passwordToggle:f,helperMessage:p,autoComplete:x,onKeyDown:b,contentBefore:T,contentAfter:g})})}},967873(e,s,t){t.d(s,{A:()=>F});var l=t(274934),n=t(724081),i=t(602086),o=t(977872),a=t(470070),r=t(915442),c=t(954702),d=t(247816),A=t(309130),u=t(100978);const m=(0,d.A)(u.A)`
  margin: ${A.YC} 0 0 ${A.kc};
  gap: ${A.kc};
  > button {
    width: fit-content;
  }
`,E=({isEditorAvailable:e,footerActions:s})=>e?(0,l.jsx)(m,{children:s.map(({label:e,onPress:s})=>(0,l.jsx)(c.A,{type:"button",fontSize:"medium",onPress:s,children:e},e.toString()))}):null;var C=t(724514),_=t(128379),O=t(938984),h=t(161004),b=t(300842),f=t(431682);const M="TAGS_CREATOR_CONFIGURE_BUTTON_CLASSNAME",p=(0,d.A)("div")`
  .${M} {
    display: none;
  }
  [data-uic-component='Tree.Item']:hover {
    .${M} {
      display: block;
    }
  }
`,x=(0,d.A)(u.A)`
  align-items: center;
  gap: ${A.YC};
`,T=({leftFilterPanelId:e,items:s,selectedKeys:t,disabledKeys:n,onSelectionChange:i,onSelectAll:o,onDeselectAll:r,labelId:c,labelBubbleId:d,initialExpanded:A,children:u})=>(0,l.jsx)(p,{children:(0,l.jsxs)(b.A,{id:e,initialExpanded:A,label:(0,l.jsxs)(x,{children:[(0,l.jsx)(a.sA,{id:c}),d?(0,l.jsx)(f.A,{children:(0,l.jsx)(O.A,{size:"small",color:"ublue-06",children:(0,l.jsx)(a.sA,{id:d})})}):null]}),children:[(0,l.jsx)(h.A,{id:e,items:s,selectedKeys:t,disabledKeys:n,onSelectionChange:i,onSelectAll:o,onDeselectAll:r}),u]})});var g=t(831721),N=t(642687),y=t(42220),j=t(436417),I=t(635891),S=t(814557);const R=(0,d.A)(u.A)`
  background: ${({theme:{themeName:e}})=>S.Ay[`desktop-color-neutral-01-${e}`]};
  flex-direction: column;
  gap: ${A.kc};
  padding: ${A.kc};
`,D=(0,d.A)(u.A)`
  align-items: center;
  gap: ${A.YC};
  white-space: nowrap;
`;var v;!function(e){e.NAME="name",e.TAGS="tags"}(v||(v={}));var P=t(241792),k=t(260334),L=t(764478),w=t(667086);const $=({tagId:e,items:s})=>{const{[w.fP.CREATOR_MODE_HEADER_NEW_ID]:t,[w.fP.CREATOR_MODE_HEADER_EDIT_ID]:n,[w.fP.CREATOR_MODE_NOTICE_ID]:r,[w.fP.CREATOR_MODE_CREATE_ID]:c,[w.fP.CREATOR_MODE_REMOVE_ID]:d,[w.fP.CREATOR_MODE_CAN_DELETE]:A,[w.fP.CREATOR_MODE_CREATE_CALLBACK]:u,[w.fP.CREATOR_MODE_UPDATE_CALLBACK]:m,[w.fP.CREATOR_MODE_DELETE_CALLBACK]:E,[w.fP.CREATOR_MODE_CANCEL_CALLBACK]:C}=(0,L.A)(e),h=(0,o.d4)(_.B8),b=(0,o.d4)(_.Gq),f=(0,o.d4)(_.bn),M=(0,i.useMemo)(()=>({[v.NAME]:b||"",[v.TAGS]:h}),[b,h]),p=(0,i.useMemo)(()=>{return e=b,t=s.map(({title:e})=>e),P.Ik({[v.NAME]:P.Yj().refine(e=>e===e.trim(),{message:(0,k.rn)("COMMON_VALIDATION_NO_LEADING_TRAILING_SPACES")}).transform(e=>e.trim()).pipe(P.Yj().min(1).max(32)).refine(s=>!(e?t.filter(s=>s.toLowerCase()!==e.toLowerCase()):t).some(e=>e.toLowerCase()===s.toLowerCase()),{message:(0,k.rn)("COMMON_PLEASE_ENTER_UNIQUE_NAME")}),[v.TAGS]:P.YO(P.Yj())});var e,t},[b,s]),{setValue:x,control:T,formState:S}=(0,j.m)({schema:p,defaultValues:M}),$=(0,y.FH)({control:T,name:v.NAME});(0,i.useEffect)(()=>{x(v.TAGS,h,{shouldDirty:!0,shouldValidate:!0})},[x,h]);const{isValid:z}=(0,y.lN)({control:T}),B=(0,i.useCallback)(()=>{u($,h)},[u,$,h]),V=(0,i.useCallback)(()=>{m(f,$,h)},[m,f,$,h]),F=(0,i.useCallback)(e=>{E(e)},[E]),U=(0,i.useCallback)(()=>{(f?V:B)()},[f,B,V]),K=(0,i.useCallback)(()=>{F(f)},[F,f]),G=(0,i.useCallback)((e,s,t)=>(0,l.jsx)(N.A,{type:"button",width:t,size:"medium",onPress:U,variant:s,isDisabled:!S.isDirty||S.isSubmitting||!z,children:(0,l.jsx)(a.sA,{id:e})}),[U,S.isDirty,S.isSubmitting,z]),q=(0,i.useCallback)((e,s)=>(0,l.jsx)(N.A,{type:"button",width:s,size:"medium",onPress:C,variant:"secondary-emphasis",children:(0,l.jsx)(a.sA,{id:e})}),[C]),Y=(0,i.useCallback)(()=>(0,l.jsx)(N.A,{type:"button",width:"full",size:"medium",onPress:C,variant:"tertiary-neutral",children:(0,l.jsx)(a.sA,{id:"COMMON_ACTION_CANCEL"})}),[C]),H=(0,i.useCallback)(()=>A?(0,l.jsx)(N.A,{type:"button",width:"full",size:"medium",onPress:K,variant:"tertiary-destructive",children:(0,l.jsx)(a.sA,{id:d})}):null,[K,d,A]);return(0,l.jsxs)(R,{children:[(0,l.jsx)(O.A,{size:"small",color:"text-1",weight:"bold",children:(0,l.jsx)(a.sA,{id:f?n:t})}),(0,l.jsx)(I.A,{control:T,name:v.NAME,label:(0,l.jsx)(a.sA,{id:"COMMON_NAME"})}),(0,l.jsxs)(D,{children:[(0,l.jsx)(g.A,{isActive:!0,size:"original"}),(0,l.jsx)(O.A,{size:"small",color:"text-3",children:(0,l.jsx)(a.sA,{id:r,values:{count:h.length}})})]}),(0,l.jsx)(D,{children:(0,l.jsxs)(l.Fragment,f?S.isDirty?{children:[G("COMMON_ACTION_SAVE","emphasis",void 0),q("COMMON_CLOSE_EDITOR",void 0)]}:{children:[q("COMMON_CLOSE_EDITOR","full"),H()]}:{children:[G(c,"secondary-emphasis","full"),Y()]})})]})},z=({onPress:e})=>(0,l.jsx)(c.A,{className:M,fontSize:"medium",type:"button",onPress:e,children:(0,l.jsx)(a.sA,{id:"COMMON_CONFIGURE"})}),B=({leftFilterPanelId:e,items:s,selectedKeys:t,disabledKeys:n,onSelectionChange:c,onSelectAll:d,onDeselectAll:A,labelId:u,labelBubbleId:m,tagId:O})=>{const h=(0,o.wA)(),{formatMessage:b}=(0,a.tz)(),{[w.fP.CREATOR_MODE_CAN_CREATE]:f,[w.fP.CREATOR_MODE_CAN_DELETE]:M,[w.fP.CREATOR_MODE_CAN_EDIT]:p,[w.fP.CREATOR_MODE_TAG_META_CALLBACK]:x}=(0,L.A)(O),g=(0,o.d4)(_.MQ),N=(0,i.useMemo)(()=>f||M||p,[f,M,p]),y=(0,i.useCallback)(()=>{h((0,C.cF)(O))},[h,O]),j=(0,i.useMemo)(()=>f?[{label:b({id:"COMMON_CREATE_NEW"}),onPress:y}]:[],[b,y,f]),I=(0,i.useMemo)(()=>g===O,[g,O]),S=(0,i.useCallback)(e=>()=>{const{tagId:s,name:t,tags:l}=x(e);h((0,C.cF)(O)),h((0,C.nS)(l)),h((0,C.UO)(t)),h((0,C.h7)(s))},[h,O,x]),R=(0,i.useMemo)(()=>N?s.map(e=>({...e,..."checkboxProps"in e?{checkboxProps:{...e.checkboxProps,data:(0,l.jsx)(z,{onPress:S(e.id)})}}:{}})):s,[s,S,N]);return I?(0,l.jsx)($,{tagId:O,items:s}):j.length||R.length?(0,l.jsx)(T,{leftFilterPanelId:e,items:R,selectedKeys:t,disabledKeys:n,onSelectionChange:c,onSelectAll:d,onDeselectAll:A,footerActions:j,labelId:u,labelBubbleId:m,children:(0,r.H)(s)?null:(0,l.jsx)(E,{footerActions:j,isEditorAvailable:f})}):null},V=e=>{const{[w.fP.TAGS_GENERAL_AVAILABILITY]:s,[w.fP.CREATOR_MODE]:t,[w.fP.CREATOR_MODE_DEPENDENCIES]:i,[w.fP.CREATOR_MODE_AVAILABLE]:o}=(0,L.A)(e.tagId);return(0,n.A)(i,s?t&&o?(0,l.jsx)(B,{...e}):e.items.length?(0,l.jsx)(T,{...e}):null:null)},F=e=>e.tagId?(0,l.jsx)(V,{...e}):e.items.length?(0,l.jsx)(T,{...e}):null}}]);