/*! Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one or more contributor license agreements. * Licensed under the Elastic License 2.0; you may not use this file except in compliance with the Elastic License 2.0. */ (window.security_bundle_jsonpfunction=window.security_bundle_jsonpfunction||[]).push([[11],{137:function(e,t,c){switch(window.__kbnThemeTag__){case"v8dark":return c(138);case"v8light":return c(140)}},138:function(e,t,c){var s=c(58),a=c(139);"string"==typeof(a=a.__esModule?a.default:a)&&(a=[[e.i,a,""]]);s(a,{insert:"head",singleton:!1}),e.exports=a.locals||{}},139:function(e,t,c){(t=c(59)(!1)).push([e.i,'.secAccessAgreementPage .secAuthenticationStatePage__content{max-width:600px}.secAccessAgreementPage__textWrapper{overflow-y:hidden}.secAccessAgreementPage__text{height:100%;-webkit-mask-image:linear-gradient(180deg,#ff00001a 0,red 7.5px,red calc(100% - 7.5px),#ff00001a);mask-image:linear-gradient(180deg,#ff00001a 0,red 7.5px,red calc(100% - 7.5px),#ff00001a);max-height:400px;overflow-x:hidden;overflow-y:auto;padding:16px 24px 0;scrollbar-color:#98a2b380 #0000;scrollbar-width:thin}.secAccessAgreementPage__text::-webkit-scrollbar{height:16px;width:16px}.secAccessAgreementPage__text::-webkit-scrollbar-thumb{background-clip:content-box;background-color:#98a2b380;border:6px solid #0000;border-radius:16px}.secAccessAgreementPage__text::-webkit-scrollbar-corner,.secAccessAgreementPage__text::-webkit-scrollbar-track{background-color:#0000}.secAccessAgreementPage__text:focus{outline:none}.secAccessAgreementPage__text[tabindex="0"]:focus:focus-visible{outline-style:auto}.secAccessAgreementPage__footer{padding:16px 24px 24px}.secAccessAgreementPage__footerInner{text-align:left}',""]),e.exports=t},140:function(e,t,c){var s=c(58),a=c(141);"string"==typeof(a=a.__esModule?a.default:a)&&(a=[[e.i,a,""]]);s(a,{insert:"head",singleton:!1}),e.exports=a.locals||{}},141:function(e,t,c){(t=c(59)(!1)).push([e.i,'.secAccessAgreementPage .secAuthenticationStatePage__content{max-width:600px}.secAccessAgreementPage__textWrapper{overflow-y:hidden}.secAccessAgreementPage__text{height:100%;-webkit-mask-image:linear-gradient(180deg,#ff00001a 0,red 7.5px,red calc(100% - 7.5px),#ff00001a);mask-image:linear-gradient(180deg,#ff00001a 0,red 7.5px,red calc(100% - 7.5px),#ff00001a);max-height:400px;overflow-x:hidden;overflow-y:auto;padding:16px 24px 0;scrollbar-color:#69707d80 #0000;scrollbar-width:thin}.secAccessAgreementPage__text::-webkit-scrollbar{height:16px;width:16px}.secAccessAgreementPage__text::-webkit-scrollbar-thumb{background-clip:content-box;background-color:#69707d80;border:6px solid #0000;border-radius:16px}.secAccessAgreementPage__text::-webkit-scrollbar-corner,.secAccessAgreementPage__text::-webkit-scrollbar-track{background-color:#0000}.secAccessAgreementPage__text:focus{outline:none}.secAccessAgreementPage__text[tabindex="0"]:focus:focus-visible{outline-style:auto}.secAccessAgreementPage__footer{padding:16px 24px 24px}.secAccessAgreementPage__footerInner{text-align:left}',""]),e.exports=t},290:function(e,t,c){"use strict";c.r(t),c.d(t,"AccessAgreementPage",(function(){return m})),c.d(t,"renderAccessAgreementPage",(function(){return A})),c(137);var s=c(3),a=c(2),n=c(8),r=c.n(n),o=c(101),i=c.n(o),l=c(4),g=c(6),d=c(5),x=c(95),u=c(94),b=c(0);function m({http:e,fatalErrors:t,notifications:c}){const[n,r]=Object(a.useState)(!1),[o,d]=Object(a.useState)(null);Object(a.useEffect)((()=>{e.get("/internal/security/access_agreement/state").then((e=>d(e.accessAgreement))).catch((e=>t.add(e)))}),[e,t]);const m=Object(a.useCallback)((async t=>{t.preventDefault();try{r(!0),await e.post("/internal/security/access_agreement/acknowledge"),window.location.href=Object(x.parseNext)(window.location.href,e.basePath.serverBasePath)}catch(e){c.toasts.addError(e,{title:l.i18n.translate("xpack.security.accessAgreement.acknowledgeErrorMessage",{defaultMessage:"Could not acknowledge access agreement."})}),r(!1)}}),[e,c]),A=o?Object(b.jsx)("form",{onSubmit:m},Object(b.jsx)(s.EuiPanel,{paddingSize:"none"},Object(b.jsx)(s.EuiFlexGroup,{gutterSize:"none",direction:"column"},Object(b.jsx)(s.EuiFlexItem,{className:"secAccessAgreementPage__textWrapper"},Object(b.jsx)("div",{className:"secAccessAgreementPage__text"},Object(b.jsx)(s.EuiText,{textAlign:"left"},Object(b.jsx)(i.a,null,o)))),Object(b.jsx)(s.EuiFlexItem,{className:"secAccessAgreementPage__footer"},Object(b.jsx)("div",{className:"secAccessAgreementPage__footerInner"},Object(b.jsx)(s.EuiButton,{fill:!0,type:"submit",color:"primary",onClick:m,isDisabled:n,isLoading:n,"data-test-subj":"accessAgreementAcknowledge"},Object(b.jsx)(g.FormattedMessage,{id:"xpack.security.accessAgreement.acknowledgeButtonText",defaultMessage:"Acknowledge and continue"}))))))):Object(b.jsx)(s.EuiPanel,{paddingSize:"l"},Object(b.jsx)(s.EuiSkeletonText,{lines:10}));return Object(b.jsx)(u.a,{className:"secAccessAgreementPage",title:Object(b.jsx)(g.FormattedMessage,{id:"xpack.security.accessAgreement.title",defaultMessage:"Access Agreement"})},A,Object(b.jsx)(s.EuiSpacer,{size:"xxl"}))}function A(e,{element:t,theme$:c},s){return r.a.render(Object(b.jsx)(e.Context,null,Object(b.jsx)(d.KibanaThemeProvider,{theme$:c},Object(b.jsx)(m,s))),t),()=>r.a.unmountComponentAtNode(t)}}}]);