!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9440161d-8b19-4214-95e6-dd5bf3832b7e",e._sentryDebugIdIdentifier="sentry-dbid-9440161d-8b19-4214-95e6-dd5bf3832b7e")}catch(e){}}();var _global="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};_global.SENTRY_RELEASE={id:"08864407160b3973b9b88c5ae92687282b21e2f4"},(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[9843],{19843:(e,t,l)=>{l.r(t),l.d(t,{default:()=>C});var n=l(58168),a=(l(62953),l(96540)),o=l(10058),r=l(22292),i=l(8711);i.default.ul.withConfig({displayName:"styled__StyledList",componentId:"sc-z791f1-0"})(["list-style:disc outside none;margin-left:16px;"]);const d=(0,i.default)(o.ModalContent).attrs((e=>{let{isMobile:t}=e;return{width:t?{base:"95vw"}:{}}})).withConfig({displayName:"styled__TrialWelcomeModalContent",componentId:"sc-z791f1-1"})([""]);var s=l(34641),c=l(66732);const u=e=>{let{onOptOutClick:t,isFailure:l}=e;return a.createElement(o.Flex,{column:!0,gap:4,width:{max:120},padding:[0,0,4,0]},l?a.createElement(a.Fragment,null,a.createElement(o.TextBigger,null,"Enrolment to 30-day free Business trial failed."),a.createElement(o.TextBigger,{lineHeight:1.5},"Something unexpected happened when trying to enrol you to the free Business trial.")):a.createElement(a.Fragment,null,a.createElement(o.TextBigger,{lineHeight:1.5},"We are happy to upgrade your account to Netdata Business, for free, for"," ",a.createElement(o.TextBigger,{strong:!0},"30 days"),"."),a.createElement(o.TextBigger,null,"Enjoy the best of Netdata!"),"function"===typeof t&&a.createElement(c.A,{onOptOutClick:t})))};var m=l(87659),f=l(92155),g=l(63314),p=l(47731),b=l(25624),E=l(35454),y=l(50503),h=l(19673),w=l(5668);const _=(0,f.A)(o.Button),C=(0,a.memo)((()=>{const{trialWelcomeVisible:e}=(0,b.A)(),t=(0,p.J)(),l=(0,r.uW)("email"),[i,,,c]=(0,m.A)(!0),[f,,C]=(0,m.A)(),{isFailure:x,reset:A}=(0,y.A)(),[B,,T,k]=(0,m.A)(),{refreshPlan:v}=(0,b.A)(),[,I]=(0,w.ng)("trialModalDismissed"),M=(0,h.i5)(),F=(0,a.useCallback)((()=>{T(),M({email:l}).then((()=>{setTimeout((()=>{v(),A(),k()}),2e3)})).catch((()=>{k()}))}),[l]),P=(0,a.useMemo)((()=>x?{feature:"CloseTrialEnrolmentErrorModal",label:"Close",flavour:"hollow"}:{feature:"TrialAccept",label:"OK",textTransform:"uppercase",flavour:"hollow",icon:"thumb_up"}),[x]);return e?f?a.createElement(s.A,{onDecline:C,onCancellingEnd:()=>{localStorage.setItem(E.$B,!0),C(),c()}}):i?a.createElement(o.Modal,{backdropProps:{backdropBlur:!0}},a.createElement(g.Ay,{feature:"TrialWelcome"},a.createElement(d,{isMobile:t},a.createElement(o.ModalHeader,null,a.createElement(o.Flex,{gap:2,alignItems:"center"},a.createElement(o.Icon,{name:"netdataPress",color:"text"}),a.createElement(o.H4,null,"Welcome to Netdata!"))),a.createElement(o.ModalBody,null,a.createElement(u,{isFailure:x})),a.createElement(o.ModalFooter,null,a.createElement(o.Flex,{gap:4,justifyContent:"end",padding:[1,2]},x&&a.createElement(_,{feature:"RetryTrialEnrolment",label:"Retry",onClick:F,disabled:B,isLoading:B}),a.createElement(_,(0,n.A)({onClick:()=>{var e,t;(c(),A(),localStorage.setItem(E.$B,!0),!x&&null!==(e=window.posthog)&&void 0!==e&&e.setPersonProperties)&&(null===(t=window.posthog)||void 0===t||t.setPersonProperties({netdata_cloud_trial_modal_seen:!0}));I(!0)},disabled:B},P))))))):null:null}))}}]);