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