(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6599],{69330:function(e,t,n){Promise.resolve().then(n.bind(n,89379)),Promise.resolve().then(n.bind(n,24328))},89379:function(e,t,n){"use strict";n.d(t,{default:function(){return g}});var l=n(57437),a=n(2265),r=n(46462),o=n(86855),s=n.n(o),i=n(94619),d=n(76588),c=n(24328),u=n(71201),m=n(95570),h=n(13930),p=n(35927),f=n(83296),x=e=>{let{activeItem:t}=e,{language:n,site:r}=(0,a.useContext)(c.D),o=(0,p.Z)(n),x=(0,h.Z)(r.brandColor),g=(0,u.J)(r.components),[b,v]=(0,a.useState)(g),[k,j]=(0,a.useState)(!t),[w,N]=(0,a.useState)(!1),y=(0,m.Z)(null==r?void 0:r.htmlBelowSubscribeTranslation,n,null==r?void 0:r.htmlBelowSubscribe),C=()=>window!==window.parent,S=async e=>{e.preventDefault(),N(!0);try{let e=r.customDomain?"https://".concat(r.customDomain):"https://".concat(r.subdomain,".instatus.com"),t=globalThis.location;if(t){let n="".concat("https://api.instatus.com","/auth/slack?subdomain=").concat(encodeURIComponent(r.subdomain),"&redirectUrl=").concat(encodeURIComponent(e),"&language=").concat(o("languageCode"),"&all=").concat(k,"&components=").concat(b.join(","));C()?window.open(n,"_blank"):t.href=n}}catch(e){return N(!1),console.log(e),!1}},U=(e,t)=>{t?(j(!0),v(g)):(j(!1),v([]))};return(0,l.jsxs)("div",{className:"max-w-xl relative z-10 mx-auto mt-8 border-gray-100 md:border dark:bg-gray-980 md:dark:bg-gray-950 bg-white md:shadow-md md:p-12 subscribe-by-email-page md:rounded-xl dark:border-gray-900 ".concat(s()({"md:-mt-24":"panda"===r.skin||"stormtrooper"===r.skin})),children:[(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center gap-1 text-black dark:text-white",children:[(0,l.jsx)(d.Z,{className:"text-gray-900 fill-current w-14 h-14 md:w-16 md:h-16 dark:text-gray-300"}),t&&(0,l.jsx)("p",{children:o("getNoticeUpdates")}),(0,l.jsx)("h2",{className:"text-3xl font-bold text-center md:text-4xl",children:t?t.name:o("getStatusUpdates")})]}),(0,l.jsxs)("form",{className:"flex flex-col items-start justify-start max-w-lg mx-auto mt-10 text-sm email-subscribe-form",onSubmit:S,children:[(0,l.jsx)("div",{className:"block w-full my-4 text-black dark:text-white",children:!t&&(0,l.jsxs)("fieldset",{children:[(0,l.jsx)("legend",{className:"sr-only",children:"Select the components you want to receive updates for"}),(0,l.jsxs)("label",{htmlFor:"all",className:"flex items-center my-2",children:[(0,l.jsx)("input",{type:"radio",id:"all",name:"components",value:"all",checked:k,onChange:e=>U(e,!0),className:"w-5 h-5 form-radio focus:outline-none ".concat(s()({"form-radio-brand":"dark"===x,"form-radio-black":"light"===x}))}),(0,l.jsx)("span",{className:"ml-2 cursor-pointer rtl:mr-2",children:o("toAllComponents")})]}),(0,l.jsxs)("label",{htmlFor:"some",className:"inline-flex items-center my-2",children:[(0,l.jsx)("input",{type:"radio",id:"some",className:"block w-5 h-5 form-radio ".concat(s()({"form-radio-brand":"dark"===x,"form-radio-black":"light"===x})),name:"components",value:"some",checked:!k,onChange:e=>U(e,!1)}),(0,l.jsx)("span",{className:"ml-2 cursor-pointer rtl:mr-2",children:o("toCertainComponents")})]}),(0,l.jsx)("div",{className:"mt-2 w-full ".concat(s()({hidden:k,"flex flex-col":!k})),children:(0,l.jsx)(f.Z,{statusPage:!0,components:null==r?void 0:r.components,disabled:!1,setComponents:v,selectedComponents:b})})]})}),(0,l.jsx)("button",{type:"submit","aria-label":"Subscribe",className:"email-subscribe-form__submit text-white p-4 w-full mt-4 font-medium rounded-lg focus:outline-none ".concat(s()({"bg-black":"light"===x,"bg-brand":"dark"===x})),children:w?o("working"):o("getUpdatesSlackShort")}),(0,l.jsx)(i.Z,{className:"pt-10 custom-html-subscribe-page",value:y})]})]})},g=function(){let{language:e,languages:t}=(0,a.useContext)(c.D),n=(0,p.Z)(e);return(0,l.jsx)(r.Z,{languages:t,title:n("getUpdatesSlackShort"),description:n("getUpdatesSlackShort"),type:r.G.SUBSCRIBE,children:(0,l.jsx)(x,{})})}},13246:function(e,t){"use strict";t.Z=(e,t)=>e.order>t.order?1:t.order>e.order?-1:0},71201:function(e,t,n){"use strict";n.d(t,{J:function(){return l}});let l=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=!(arguments.length>2)||void 0===arguments[2]||arguments[2];return null==e||e.forEach(e=>(n&&e.isParent||t.push(null==e?void 0:e.id),(null==e?void 0:e.children)&&l(e.children,t),e.id)),t.flat()}},83296:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var l=n(57437),a=n(2265),r=(e,t)=>{let n,l=0,a=[],r=[];for(;l<e.length;l+=1){var o,s,i,d,c,u,m,h;let p,f,x,g,b,v,k;let j=e[l][t]&&e[l][t].name||"ungrouped",w="ungrouped"===j;if(w?(j=e[l].name,b=e[l].nameTranslation,g=e[l].descriptionTranslation,p=e[l].id,n=a.indexOf(p),f=e[l].order):(p=e[l].group.id,n=a.indexOf(p),f=(null===(s=e[l][t])||void 0===s?void 0:s.order)||0,k=null===(i=e[l][t])||void 0===i?void 0:i.isCollapsed,v=null===(d=e[l][t])||void 0===d?void 0:d.showUptime,x=null===(c=e[l][t])||void 0===c?void 0:c.description,g=null===(u=e[l][t])||void 0===u?void 0:u.descriptionTranslation,b=null===(m=e[l][t])||void 0===m?void 0:m.nameTranslation,j=null===(h=e[l][t])||void 0===h?void 0:h.name),n>-1)null===(o=r[n].components)||void 0===o||o.push(e[l]);else{let t=w?{id:p,isUngrouped:!0,...e[l]}:{id:p,name:j,nameTranslation:b,order:f,description:x,descriptionTranslation:g,components:[e[l]],isUngrouped:!1,isCollapsed:k,showUptime:v};a.push(p),r.push(t)}}return r},o=n(13246),s=n(86855),i=n.n(s);let d=e=>{let{id:t,title:n,children:a,disabled:r,validateChecked:o,onChange:s,statusPage:c=!1,indeterminate:u,parents:m=[],forceChecked:h=!1}=e,p=(null==a?void 0:a.length)>0,f="".concat(p?"group-":"").concat(t),x=h||o(t,a),g=u&&u(a);return(0,l.jsxs)("div",{className:i()("rounded-[10px]",{"bg-black/[5%] dark:bg-white/[7%]":p,"my-1":p&&0===m.length}),children:[(0,l.jsxs)("label",{className:"flex flex-row items-center justify-between w-full border border-transparent rounded-[10px] cursor-pointer group dark:hover:border-gray-900 hover:border-black/10",htmlFor:f,children:[(0,l.jsx)("p",{className:i()("px-2.5 py-2",{"font-medium":x,"form-label":"select-all"===t}),children:n}),(0,l.jsx)("div",{className:"flex flex-row-reverse items-center gap-2 px-1.5",children:(0,l.jsx)("input",{id:f,name:f,className:"".concat(i()({"form-checkbox-ok":c,"form-checkbox":!c,"text-neutral-700":g,"border-transparent":x||g})),type:"checkbox",disabled:r,checked:x,onChange:e=>{s(e,a)},ref:e=>{e&&(e.indeterminate=null!=g&&g)}})})]}),a&&(0,l.jsx)("div",{className:"bg-white/30 dark:bg-black/30",children:null==a?void 0:a.map(e=>(0,l.jsx)(d,{statusPage:c,id:e.id,title:e.name,disabled:r,validateChecked:o,onChange:s,indeterminate:u,parents:[...m,t],children:e.children},e.id))})]},f)};var c=e=>{let{group:t,disabled:n,selectedComponents:a,handleComponentsChange:r,statusPage:o}=e;return(0,l.jsx)(d,{statusPage:o,disabled:n,validateChecked:(e,t)=>{if(!t||0===t.length)return a&&a.includes(e);let n=m(t);return u(a,n)===n.length},onChange:(e,t)=>{(null==t?void 0:t.length)?m(t,[]).forEach(t=>{r({...e,target:{...e.target,name:t}})}):r(e)},id:t.id,title:t.name,indeterminate:e=>{let t=m(e),n=u(a,t);return n!==t.length&&n>0},children:t.children},t.id)};let u=(e,t)=>0!==t.length&&t.filter(t=>e.indexOf(t)>=0).length,m=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return null==e||e.forEach(e=>{if(e.isParent||t.push(e.id),null==e||!e.children)return e.id;m(e.children,t)}),t.flat()};var h=function(e){let{components:t,selectedComponents:n,setComponents:s,disabled:i,statusPage:d=!1}=e,[u,m]=(0,a.useState)([]);(0,a.useEffect)(()=>{t?m(r(t,"group").sort(o.Z)):m([])},[t]);let h=async e=>{var t;(null==e?void 0:null===(t=e.target)||void 0===t?void 0:t.checked)?s(t=>t.includes(e.target.name)?t:[...t,e.target.name]):s(t=>t.filter(t=>t!==e.target.name))};return(0,l.jsx)("div",{className:"flex w-full flex-col gap-1",children:(0,l.jsx)("div",{className:"flex flex-col -mx-2",children:u&&Object.entries(u).map(e=>{let[t,a]=e;return(0,l.jsx)(c,{statusPage:d,group:a,disabled:i,selectedComponents:n,handleComponentsChange:h},a.id)})})})}}},function(e){e.O(0,[8218,9160,885,6462,2971,2117,1744],function(){return e(e.s=69330)}),_N_E=e.O()}]);