"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[43912],{224063(e,t,o){o.d(t,{A:()=>f});var i=o(296540),a=o(469733),r=o(20044),s=o(130851),n=o(977178),c=o(916537),u=o(198494),l=o(573363),d=o(6176);const f=()=>{const{formatMessage:e}=(0,c.tz)(),{createNotification:t,removeNotification:o}=(0,a.useSelector)(n.o),f=(0,a.useSelector)(n.v),m=(0,i.useRef)(new Set(Object.keys(f))),p=(0,a.useSelector)(s.p),v=(0,a.useSelector)(l.A),N=(0,a.useSelector)(u.ay);return(0,i.useEffect)(()=>{Object.keys(f).filter(e=>!m.current.has(e)).forEach(o=>{const{toastProps:{details:a,errorMessage:s,errorValues:n,message:c="COMMON_UNKNOWN_ERROR",primaryButton:u,secondaryButton:l,values:b,title:g,titleValues:h,translateTitle:y,notificationType:k,icon:M,...w},option:T={}}=f[o];t({details:a&&"function"==typeof a?a(e):a??(0,r.L)(e,{message:c,values:b,errorValues:n,errorMessage:s}),id:String(o),primaryButton:u&&u.label?u:(0,r.I)(e,{button:u}),secondaryButton:l&&l.label?l:(0,r.I)(e,{button:l}),title:y?e({id:g},h):g,notificationType:k,icon:T.deviceModel?i.createElement(d.C,{width:53,height:53,model:T.deviceModel,theme:N,imagePath:p,deviceModelMap:v}):M,...w}),m.current.add(o)}),m.current.forEach(e=>{f[e]||(o(e),m.current.delete(e))})},[p,t,e,N,v,f,o]),null}},870606(e,t,o){o.r(t),o.d(t,{default:()=>c});var i=o(296540),a=o(469733),r=o(224063),s=o(675359),n=o(187483);const c=()=>{const{createNotification:e,updateNotification:t,removeNotification:o}=(0,a.useSelector)(n.i9),c=(0,a.useDispatch)(),u=(0,i.useRef)(new Map).current,l=(0,i.useCallback)((e,t)=>{Number.isInteger(e)&&0!==e&&(u.has(t)&&(clearTimeout(u.get(t)),u.delete(t)),u.set(t,setTimeout(()=>{o(t),c((0,s.uU)(t))},e)))},[c,o]),d=(0,i.useCallback)(t=>{const o=e(t);return l(void 0!==t?.duration||"DownloadsToast"===t?.notificationType?t?.duration:5e3,o),o},[e,l]),f=(0,i.useCallback)(e=>{e.id&&(t(e),l(void 0!==e?.duration||"DownloadsToast"===e?.notificationType?e?.duration:5e3,e.id))},[t,l]);return(0,i.useEffect)(()=>{c((0,s.Ez)({createNotification:d,updateNotification:f,removeNotification:o}))},[c,d,f,o]),i.createElement(r.A,null)}},20044(e,t,o){o.d(t,{I:()=>i,L:()=>a});const i=(e,{button:t})=>t?{...t,label:e({id:t.message},t.values)}:void 0,a=(e,{message:t,values:o,errorMessage:i,errorValues:a})=>{const r=i&&e({id:i},a);return`${e({id:t},o)}${r?`. ${r}`:""}`}}}]);