"use strict";(self.webpackChunkgrafana_lokiexplore_app=self.webpackChunkgrafana_lokiexplore_app||[]).push([[82,398],{5082:(e,r,t)=>{t.r(r),t.d(r,{default:()=>f});var n=t(85959),a=t.n(n),o=t(82007),l=t(25398),u=t(25953);const i=(0,n.lazy)(()=>Promise.all([t.e(854),t.e(944),t.e(812),t.e(553),t.e(919)]).then(t.bind(t,96919))),c=a().createContext(null),s=(0,l.g)().then(()=>(0,l.ev)()),f=e=>{const[r,t]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{s.then(()=>{t(!0)}).catch(e=>{u.v.error(e,{msg:"Feature flags failed to load"}),t(!0)}),u.v.info("Plugin loaded successfully")},[]),r?a().createElement(c.Provider,{value:e},a().createElement(i,null)):a().createElement(o.LoadingPlaceholder,{text:"Loading..."})}},25398:(e,r,t)=>{t.d(r,{O7:()=>v,jj:()=>b,g:()=>w,ev:()=>h});var n=t(77909),a=t(75561),o=t(18531);const l={experiment_fake_flag:null};class u{after(e,r){v[e.flagKey]&&(l[v[e.flagKey]]=r.value)}constructor(){}}var i=t(25953);function c(e,r,t,n,a,o,l){try{var u=e[o](l),i=u.value}catch(e){return void t(e)}u.done?r(i):Promise.resolve(i).then(n,a)}function s(e){return function(){var r=this,t=arguments;return new Promise(function(n,a){var o=e.apply(r,t);function l(e){c(o,n,a,l,u,"next",e)}function u(e){c(o,n,a,l,u,"throw",e)}l(void 0)})}}function f(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}const g={exploreLogsAggregatedMetrics:{valueType:"boolean",value:!1,reason:"static provider evaluation result",variant:"default"},"drilldown.logs.fake_flag":{valueType:"string",values:["treatment","control","excluded"],defaultValue:"excluded",trackingKey:"experiment_fake_flag"}},d=(p=g,Object.keys(p));var p;const v=Object.fromEntries(d.reduce((e,r)=>{const t=g[r];return"trackingKey"in t&&e.push([r,t.trackingKey]),e},[])),m="logs-drilldown",y=new Map;function b(e){if(y.has(e))return y.get(e);const r=g[e];return"value"in r?r.value:r.defaultValue}function h(){return s(function*(){yield Promise.all(d.map(e=>s(function*(){const r=yield function(e){return s(function*(){try{const r=a.B0.getClient(m);yield function(e){if(e.providerStatus===a.$l.READY)return Promise.resolve();if(e.providerStatus===a.$l.ERROR||e.providerStatus===a.$l.FATAL)return Promise.reject(new Error("OpenFeature provider failed to initialize"));return new Promise((r,t)=>{e.addHandler(a.Nm.Ready,()=>r()),e.addHandler(a.Nm.Error,()=>t(new Error("OpenFeature provider error")))})}(r),r.addHooks(new u);const t=g[e],n=k(t);switch(t.valueType){case"boolean":return r.getBooleanValue(e,n);case"number":return r.getNumberValue(e,n);case"object":return r.getObjectValue(e,n);case"string":return r.getStringValue(e,n);default:throw new Error(`Invalid flag value type for flag ${e}`)}}catch(r){i.v.error(new Error(`Error evaluating ${e} flag.`,{cause:r}));const t=function(e){if("exploreLogsAggregatedMetrics"===e)return o.config.featureToggles.exploreLogsAggregatedMetrics;return}(e);if(void 0!==t)return t;return k(g[e])}})()}(e);y.set(e,r)})()))})()}function w(){return a.B0.setProviderAndWait(m,new n.S({baseUrl:`/apis/features.grafana.app/v0alpha1/namespaces/${o.config.namespace}`,pollInterval:-1,timeoutMs:1e4}),function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){f(e,r,t[r])})}return e}({targetingKey:o.config.namespace,namespace:o.config.namespace},o.config.openFeatureContext)).catch(e=>{i.v.warn("OpenFeature provider initialization failed, using config.featureToggles fallback",{error:e instanceof Error?e.message:String(e)})})}function k(e){return"value"in e?e.value:e.defaultValue}}}]);
//# sourceMappingURL=82.js.map?_cache=a79e1857be8a855b59ec