"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[16460],{583166(e,t,n){n.d(t,{o:()=>u,z:()=>m});var r=n(691189),i=n(742920),o=n(953141),a=n(887831),l=n(771805);const c="teleportToken",s=`${l.w}/teleport/token`,d=(e,{apiMsg:t})=>({icon:i.C.danger,message:o.API_STRING_TRANSLATION[t]}),m=()=>(0,r.Kd)(c,s,"teleport",{},{method:a.A.POST,fetchConfig:{getAllPostData:!0},failureToast:d}),u=e=>(0,r.LK)(c,e,`${s}/${e}`,{},{failureToast:d})},689965(e,t,n){n.d(t,{A:()=>g,I:()=>r});var r,i=n(296540),o=n(822336),a=n(963724),l=n(71479),c=n(825032),s=n(566723),d=n(294303),m=n(311785);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(r||(r={}));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||o.Ay[n===c.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}})=>o.Ay[`desktop-border-divider-${e}`]};\n      &:last-child {\n        border-bottom: none;\n      }\n    }\n  `:""}
`,A=(0,l.A)(a.A,(0,m.A)("marginBottom","margin","flex","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||o.Ay[n===c.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||o.Ay[t===c.S.DARK?"desktop-color-neutral-01-dark":"desktop-color-neutral-00-light"]};
      height: 48px;
      padding: 0 ${s.Ln};
    }
    > div:nth-child(2) {
      margin-bottom: 0;
      padding: 0;
      > div {
        padding: 0 ${s.Ln} ${s.Ln};
      }
    }
  }
`,g=({type:e,marginBottom:t,margin:n,padding:o,flex:a,width:l,nested:c,...s})=>"items"in s?i.createElement(A,{marginBottom:t,margin:n,padding:o,flex:a,nested:c,...s}):i.createElement(u,{nested:c,width:l,marginBottom:t,margin:n,padding:o,flex:a,isButtonList:e===r.BUTTON_LIST,...s},s.children)},242366(e,t,n){n.d(t,{A:()=>a});var r=n(296540),i=n(566723),o=n(294303);const a=(0,r.forwardRef)((e,t)=>r.createElement(o.A,{ref:t,flexDirection:"column",gap:i.kc,width:"100%",...e}))},48925(e,t,n){n.d(t,{A:()=>h});var r=n(822336),i=n(296540),o=n(217439),a=n(71479),l=n(566723),c=n(968906),s=n(199582),d=n(311785),m=n(766624),u=n(294303),A=n(689965),g=n(242366);const p=(0,a.A)(A.A,(0,d.A)("isOutlined"))`
  border: ${({theme:{themeName:e},isOutlined:t})=>`1px solid ${t?r.Ay[`desktop-color-ublue-06-${e}`]:"transparent"}`};
`,h=({children:e,title:t,tooltip:n,tooltipProps:r,[s.L]:a,titleAction:d,isOutlined:A})=>{const h=(e=>i.Children.toArray(e).length>0)(e);return i.createElement(p,{marginBottom:"none",...c.A.addDataTestId(a??""),isOutlined:A},i.createElement(u.A,{flexDirection:"column",...h&&{gap:l.Ln},width:"100%"},t?i.createElement(u.A,{alignItems:"center",gap:l.YC,justifyContent:"space-between",width:"100%"},i.createElement(u.A,{gap:l.YC,alignItems:"center"},i.createElement(o.A,{variant:"heading-medium"},t),n?i.createElement(m.A,{description:n,portal:!0,...r}):null),d?i.createElement(u.A,null,d):null):null,h?i.createElement(g.A,null,e):null))}},647758(e,t,n){n.d(t,{A:()=>c});var r=n(469733),i=n(296540),o=n(282556),a=n(602021),l=n(198494);const c=()=>{const e=(0,r.useSelector)(o.zi),t=(0,r.useSelector)(l.BQ),n=(0,r.useSelector)(a.hq),c=(0,i.useMemo)(()=>new Intl.DateTimeFormat(e,{hourCycle:t,month:"long",day:"numeric",year:"numeric",hour:"numeric",minute:"numeric",timeZone:n}),[e,t,n]);return(0,i.useCallback)(e=>c.format(e),[c])}},353156(e,t,n){n.r(t),n.d(t,{default:()=>_});var r=n(469733),i=n(296540),o=n(822336),a=n(136201),l=n(71479),c=n(217439),s=n(592563),d=n(566723),m=n(294303),u=n(916537),A=n(739905),g=n(686419),p=n(583166),h=n(691294),E=n(984652),f=n(48925),T=n(573531),x=n(647758),I=n(968906),N=n(371715),k=n(147606);const $=(0,l.A)(m.A)`
  flex-direction: column;
  padding: ${d.kc};
  background: ${({theme:{themeName:e}})=>o.Ay[`desktop-color-neutral-01-${e}`]};
  border-radius: ${o.Ay["desktop-radius-global"]};
  gap: ${d.kc};
`,b=(0,l.A)(m.A)`
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
`,_=()=>{const e=(0,r.useDispatch)(),[t,n]=(0,i.useState)({}),o=(0,r.useSelector)(A.J),l=(0,x.A)(),_=(0,i.useMemo)(()=>o.filter(({expiration_timestamp:e})=>!e||1e3*e>=Date.now()).reverse(),[o]),v=(0,i.useCallback)(({token_id:r,client:i})=>{t[r]||(n({...t,[r]:!0}),e(i?(0,E.$L)(i.id,i.status===h.S2.ONLINE):(0,p.o)(r)).then(()=>e((0,g.t)())).catch(()=>{n({...t,[r]:!1})}))},[t,e]);return(0,i.useEffect)(()=>{e((0,N.NM)(g.j))},[e]),i.createElement(f.A,{title:i.createElement(i.Fragment,null,i.createElement(u.sA,{id:"SETTINGS_TP_INV_HIST"})," (",_.length,")")},i.createElement(m.A,{width:"100%",flexDirection:"column",gap:10,...I.A.addDataTestId(I.A.TestId.TELEPORT_TOKEN_TABLE)},_.map(e=>i.createElement($,{key:e.token_id},i.createElement(b,null,i.createElement(c.A,{color:"text-2"},i.createElement(u.sA,{id:"COMMON_CREATED"})),i.createElement(c.A,{color:"text-3"},e.creation_timestamp?l(1e3*e.creation_timestamp):T.L)),i.createElement(b,null,i.createElement(c.A,{color:"text-2"},i.createElement(u.sA,{id:"SETTINGS_TP_LINK"})),i.createElement(c.A,{color:"text-3"},e.invitation_url?`...${e.invitation_url.slice(-8)}`:i.createElement(u.sA,{id:"COMMON_FALLBACK"}))),i.createElement(b,null,i.createElement(c.A,{color:"text-2"},i.createElement(u.sA,{id:"COMMON_STATUS"})),i.createElement(c.A,{color:"text-3",style:{textTransform:"capitalize"}},e.invitation_status)),e.client?i.createElement(i.Fragment,null,i.createElement(b,null,i.createElement(c.A,{color:"text-2"},i.createElement(u.sA,{id:"COMMON_CLIENT"})),i.createElement(m.A,{alignItems:"center",gap:d.YC},i.createElement(a.A,{size:"original",isActive:!0}),i.createElement(c.A,{color:"text-3"},e.client.display_name))),i.createElement(b,null,i.createElement(c.A,{color:"text-2"},i.createElement(u.sA,{id:"COMMON_LAST_CONNECTED"})),i.createElement(c.A,{color:"text-3"},e.client.last_seen?l(1e3*e.client.last_seen):T.L))):null,i.createElement(m.A,{width:"100%",justifyContent:"flex-start"},i.createElement(k.A,{title:i.createElement(u.sA,{id:"SETTINGS_REVOKE_INVITE_QUESTION"}),message:i.createElement(u.sA,{id:"SETTINGS_REVOKE_INVITE_CONFIRMATION"}),onConfirm:()=>v(e),trigger:i.createElement(s.A,{variant:"destructive",fontSize:"medium",isDisabled:t[e.token_id]},i.createElement(u.sA,{id:"COMMON_ACTION_REMOVE"}))}))))))}},766624(e,t,n){n.d(t,{A:()=>c});var r=n(296540),i=n(271856),o=n(709690),a=n(284428),l=n(566723);const c=({description:e,isInteractive:t,portal:n=!0,cursorType:c,title:s,position:d,width:m,iconProps:u,disabled:A=!1})=>{const g=(0,a.Im)()||A,p=(0,a.q)();return r.createElement(i.A,{description:e,portal:n,isInteractive:t,style:{display:"flex",alignItems:"center"},cursorType:c,title:s,position:d,width:m,disableHover:p},r.createElement(o.A,{isActive:!0,size:"original",opacity:g?l.xN:void 0,...u}))}},451449(e,t,n){n.d(t,{I:()=>r});const r=(0,n(296540).createContext)({fields:!1,labels:!1,tooltipPopovers:!1,tooltipIcons:!1})},284428(e,t,n){n.d(t,{Im:()=>c,iL:()=>s,mQ:()=>a,pv:()=>o,q:()=>l});var r=n(296540),i=n(451449);function o(){return(0,r.useContext)(i.I)}function a(){return o().fields}function l(){return o().tooltipPopovers}function c(){return o().tooltipIcons}function s(){return o().labels}},383149(e,t,n){n.d(t,{A:()=>i});var r=n(885205);const i=function(e,t){return!(null==e||!e.length)&&(0,r.A)(e,t,0)>-1}},887809(e,t,n){n.d(t,{A:()=>r});const r=function(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}},458043(e,t,n){n.d(t,{A:()=>s});var r=n(8300),i=n(383149),o=n(887809),a=n(45572),l=n(552789),c=n(764099);const s=function(e,t,n,s){var d=-1,m=i.A,u=!0,A=e.length,g=[],p=t.length;if(!A)return g;n&&(t=(0,a.A)(t,(0,l.A)(n))),s?(m=o.A,u=!1):t.length>=200&&(m=c.A,u=!1,t=new r.A(t));e:for(;++d<A;){var h=e[d],E=null==n?h:n(h);if(h=s||0!==h?h:0,u&&E==E){for(var f=p;f--;)if(t[f]===E)continue e;g.push(h)}else m(t,E,s)||g.push(h)}return g}},144757(e,t,n){n.d(t,{A:()=>l});var r=n(458043),i=n(187671),o=n(224326),a=n(153533);const l=(0,o.A)(function(e,t){return(0,a.A)(e)?(0,r.A)(e,(0,i.A)(t,1,a.A,!0)):[]})}}]);