/*! 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.enterpriseSearch_bundle_jsonpfunction=window.enterpriseSearch_bundle_jsonpfunction||[]).push([[2],{52:function(e,n,t){"use strict";t.d(n,"a",(function(){return i})),t.d(n,"b",(function(){return s}));var r=t(34);const i=Object(r.kea)({path:["enterprise_search","licensing_logic"],actions:{setLicense:e=>e,setLicenseSubscription:e=>e},reducers:({props:e})=>({license:[null,{setLicense:(e,n)=>n}],licenseSubscription:[null,{setLicenseSubscription:(e,n)=>n}],canManageLicense:[e.canManageLicense||!1,{}]}),selectors:{hasPlatinumLicense:[e=>[e.license],e=>(null==e?void 0:e.isActive)&&["platinum","enterprise","trial"].includes(null==e?void 0:e.type)],hasGoldLicense:[e=>[e.license],e=>(null==e?void 0:e.isActive)&&["gold","platinum","enterprise","trial"].includes(null==e?void 0:e.type)],isTrial:[e=>[e.license],e=>(null==e?void 0:e.isActive)&&"trial"===(null==e?void 0:e.type)]},events:({props:e,actions:n,values:t})=>({afterMount:()=>{const t=e.license$.subscribe((async e=>{n.setLicense(e)}));n.setLicenseSubscription(t)},beforeUnmount:()=>{t.licenseSubscription&&t.licenseSubscription.unsubscribe()}})}),s=e=>(i(e),i.mount());t(44),t(10),t(12),t(2),t(4),t(41),t(11)},70:function(e,n,t){"use strict";t.d(n,"a",(function(){return r})),t.d(n,"c",(function(){return i})),t.d(n,"b",(function(){return s})),t.d(n,"d",(function(){return c}));const r={_enterpriseSearchUrl:"",get enterpriseSearchUrl(){return this._enterpriseSearchUrl},set enterpriseSearchUrl(e){this._enterpriseSearchUrl||(this._enterpriseSearchUrl=e)}},i=(e="")=>r.enterpriseSearchUrl+e,s=(e="")=>i("/as"+e),c=(e="")=>i("/ws"+e)},85:function(e,n,t){"use strict";var r=t(70);t.d(n,"a",(function(){return r.a})),t.d(n,"c",(function(){return r.c})),t.d(n,"b",(function(){return r.b})),t.d(n,"d",(function(){return r.d}))},985:function(e,n,t){"use strict";t.r(n),t.d(n,"renderApp",(function(){return v})),t.d(n,"renderHeaderActions",(function(){return S}));var r=t(10),i=t.n(r),s=t(21),c=t.n(s),a=t(24),o=t(34),l=t(13),u=t(18),d=t(51),p=t(1),b=t(85),h=t(40),f=t(35),j=t(38),g=t(52),m=t(11);const v=(e,{params:n,core:t,plugins:r,isSidebarEnabled:s=!0},{config:v,data:O})=>{var x,y;const{access:A,appSearch:L,configuredLimits:U,enterpriseSearchVersion:C,errorConnectingMessage:_,features:M,kibanaVersion:P,publicUrl:$,readOnlyMode:k,searchOAuth:w,workplaceSearch:I}=O,{history:T}=n,{application:V,chrome:H,http:D,uiSettings:E}=t,{capabilities:B,navigateToUrl:F}=V,{charts:K,cloud:N,guidedOnboarding:G,lens:W,security:q,share:z,ml:J}=r,Q=function(e){if(e&&e.isCloudEnabled&&e.cloudId&&e.deploymentId&&e.cloudHost)return`https://${e.deploymentId}.ent.${e.cloudHost}${e.cloudDefaultPort&&"443"!==e.cloudDefaultPort?`:${e.cloudDefaultPort}`:""}`}(r.cloud);b.a.enterpriseSearchUrl=$||Q||v.host||"";const R=A||{hasAppSearchAccess:!1,hasWorkplaceSearchAccess:!1},X=null!=M?M:{...p.h},Y=(null==N?void 0:N.CloudContextProvider)||(({children:e})=>Object(m.jsx)(i.a.Fragment,null,e));Object(o.resetContext)({createStore:!0});const Z=Object(o.getContext)().store,ee=Object(j.b)({application:V,capabilities:B,charts:K,cloud:N,config:v,data:r.data,guidedOnboarding:G,history:T,isSidebarEnabled:s,lens:W,navigateToUrl:F,productAccess:R,productFeatures:X,renderHeaderActions:e=>n.setHeaderActionMenu(e?S.bind(null,e,Z):void 0),security:q,setBreadcrumbs:H.setBreadcrumbs,setChromeIsVisible:H.setIsVisible,setDocTitle:H.docTitle.change,share:z,ml:J,uiSettings:E}),ne=Object(g.b)({canManageLicense:null===(x=t.application.capabilities.management)||void 0===x||null===(y=x.stack)||void 0===y?void 0:y.license_management,license$:r.licensing.license$}),te=Object(f.b)({errorConnectingMessage:_,http:D,readOnlyMode:k}),re=Object(h.h)();return c.a.render(Object(m.jsx)(l.I18nProvider,null,Object(m.jsx)(u.KibanaThemeProvider,{theme$:n.theme$},Object(m.jsx)(u.KibanaContextProvider,{services:{...t,...r}},Object(m.jsx)(Y,null,Object(m.jsx)(a.Provider,{store:Z},Object(m.jsx)(d.b,{history:n.history},Object(m.jsx)(e,{access:R,appSearch:L,configuredLimits:U,enterpriseSearchVersion:C,features:M,kibanaVersion:P,readOnlyMode:k,searchOAuth:w,workplaceSearch:I}),Object(m.jsx)(h.c,null))))))),n.element),()=>{c.a.unmountComponentAtNode(n.element),ee(),ne(),te(),re(),r.data.search.session.clear()}},S=(e,n,t)=>(c.a.render(Object(m.jsx)(a.Provider,{store:n},Object(m.jsx)(e,null)),t),()=>c.a.unmountComponentAtNode(t))}}]);