"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[9187],{937045:(e,t,_)=>{_.r(t),_.d(t,{default:()=>G});var N=_(296540),i=_(469733),s=_(956347),l=_(132196),a=_(459449),o=_(231226),E=_(675359),n=_(532419),I=_(417378),A=_(811569),r=_(778851),O=_(46119),u=_(742920),T=_(928085),C=_(187483),c=_(130851),S=_(198494),R=_(775699),L=_(959341),d=_(727270),m=_(6176),D=_(573363);const W=l.AH`
  width: auto !important;
  padding: 0 8px;
`,p=l.AH`
  button {
    border-radius: 0;
    font-size: 12px;
  }
`,g="LTE_PAYMENT_EXPIRED",P="LTE_SUBSCRIPTION_CANCELLED",M="LTE_SUBSCRIPTION_CHECK",h="HAS_WLAN_OVERRIDES",f="HAS_NETWORKS_LIMIT_REACHED",U="HAS_MDNS_NETWORKS_LIMIT",G=()=>{const{formatMessage:e}=(0,a.tz)(),t=(0,i.useDispatch)(),_=(0,s.W6)(),l=(0,i.useSelector)(S.GP),G=(0,i.useSelector)(S.Pk),k=(0,i.useSelector)(S.tg),y=(0,i.useSelector)(I.S$),w=(0,i.useSelector)(c.p),B=(0,i.useSelector)(C.ub),b=(0,i.useSelector)(n.hp),K=(0,i.useSelector)(n.$x),x=(0,i.useSelector)(D.A),H=(0,i.useSelector)(S.ay),Y=(0,i.useSelector)(n.gj),v=(0,i.useSelector)(o.xj),V=(0,i.useSelector)(o.EF),$=(0,i.useSelector)((0,N.useMemo)(()=>(0,o.wI)(G),[G])),j=(0,i.useSelector)(o.bx),X=(0,i.useSelector)(o.gj),z=(0,i.useSelector)(o.Ji),F=(0,r.Qh)(y),J=(0,T.A)(L._L),Q=(0,T.A)(L.Cs);(0,N.useEffect)(()=>{l&&v.length&&t((0,E.ox)({onClose:()=>t((0,E.uU)(g)),type:u.C.warning,title:e({id:"ON_LOAD_WARNING_PAYMENT_EXPIRED_TITLE"}),message:"ON_LOAD_WARNING_PAYMENT_EXPIRED_BODY",icon:N.createElement(m.C,{className:W,model:Y,imagePath:w,theme:H,deviceModelMap:x}),stateIndicator:u.C.info,primaryButton:{label:e({id:"ON_LOAD_WARNING_PAYMENT_ACTION_UPDATE_PAYMENT"}),onClick:()=>O.A.open(`${d.DU}${F}/payments`)},className:p},g))},[F,t,e,Y,l,v.length,H,w,x]),(0,N.useEffect)(()=>{l&&V.length&&t((0,E.ox)({onClose:()=>t((0,E.uU)(P)),type:u.C.danger,title:e({id:"ON_LOAD_WARNING_SUBSCRIPTION_CANCELLED_TITLE"}),message:"ON_LOAD_WARNING_SUBSCRIPTION_CANCELLED_BODY",icon:N.createElement(m.C,{className:W,model:Y,imagePath:w,theme:H,deviceModelMap:x}),stateIndicator:u.C.info,primaryButton:{label:e({id:"ON_LOAD_WARNING_PAYMENT_ACTION_UPDATE_PAYMENT"}),onClick:()=>O.A.open(`${d.DU}${F}/payments`)},className:p},P))},[F,t,e,l,H,Y,V.length,w,x]);const Z=(0,N.useCallback)(()=>{t((0,E.uU)(M)),t((0,A.ZS)($,e))},[t,e,$]);return(0,N.useEffect)(()=>{l&&$.length&&t((0,E.ox)({duration:0,onClose:()=>t((0,E.uU)(M)),type:u.C.warning,title:e({id:"ON_LOAD_WARNING_VERIFY_ACCOUNT_TITLE"}),message:"LTE_ACTIONS_SUBSCRIPTION_CHECK_TOOLTIP",icon:N.createElement(m.C,{className:W,model:Y,imagePath:w,theme:H,deviceModelMap:x}),stateIndicator:u.C.info,primaryButton:{label:e({id:"LTE_ACTIONS_SUBSCRIPTION_CHECK"}),onClick:Z},className:p},M))},[t,Z,e,Y,l,$.length,w,x,H]),(0,N.useEffect)(()=>{l&&X&&!B&&!k.dismissWlanOverrides&&t((0,E.ox)({duration:0,type:u.C.warning,title:e({id:"ON_LOAD_WARNING_WLAN_OVERRIDES_TITLE"}),message:"ON_LOAD_WARNING_WLAN_OVERRIDES_DESCRIPTION",primaryButton:{label:e({id:"ON_LOAD_WARNING_WLAN_OVERRIDES_CTA"}),onClick:()=>{t((0,E.uU)(h)),t((0,R.i4)({dismissWlanOverrides:!0})).then(()=>_.push(J))}},onClose:()=>{t((0,R.i4)({dismissWlanOverrides:!0}))}},h))},[t,e,l,X,k,B,J,_]),(0,N.useEffect)(()=>{l&&j?.limit_reached&&!B&&t((0,E.ox)({duration:0,onClose:()=>t((0,E.uU)(f)),type:u.C.warning,title:e({id:"ON_LOAD_WARNING_NETWORKS_LIMIT_REACHED_TITLE"}),message:"ON_LOAD_WARNING_NETWORKS_LIMIT_REACHED_DESCRIPTION",values:{networksLimit:j.network_limit},primaryButton:{label:e({id:"ON_LOAD_WARNING_NETWORKS_LIMIT_REVIEW_NETWORKS"}),onClick:()=>{t((0,E.uU)(f)),_.push(Q)}}},f))},[t,e,l,j,k,B,Q,_]),(0,N.useEffect)(()=>{l&&z?.exceeded&&!B&&t((0,E.ox)({duration:0,type:u.C.warning,title:e({id:"ON_LOAD_WARNING_NETWORKS_LIMIT_REACHED_TITLE"}),details:e({id:"ON_LOAD_WARNING_MDNS_NETWORKS_LIMIT"},{gatewayName:b||K,limit:z?.limit}),primaryButton:{label:e({id:"ON_LOAD_WARNING_NETWORKS_LIMIT_REVIEW_NETWORKS"}),onClick:()=>{t((0,E.uU)(U)),_.push(Q)}},onClose:()=>t((0,E.uU)(U))},U))},[l,z,b,B,e,_,Q,t,K]),null}}}]);