import*as a from"./../../core/common/common.js";import*as s from"./../../core/i18n/i18n.js";import*as r from"./../console/console.js";import*as l from"./../../ui/legacy/legacy.js";var i={explainThisError:"Understand this error",explainThisWarning:"Understand this warning",explainThisMessage:"Understand this message",enableConsoleInsights:"Understand console messages with AI",wrongLocale:"To use this feature, set your language preference to English in DevTools settings.",geoRestricted:"This feature is unavailable in your region.",policyRestricted:"This setting is managed by your administrator."},c=s.i18n.registerUIStrings("panels/explain/explain-meta.ts",i),t=s.i18n.getLazilyComputedLocalizedString.bind(void 0,c),o=s.i18n.getLocalizedString.bind(void 0,c),p="console-insights-enabled",f=[{actionId:"explain.console-message.hover",title:t(i.explainThisMessage),configurableBindings:!1,contextTypes(){return[r.ConsoleViewMessage.ConsoleViewMessage]}},{actionId:"explain.console-message.teaser",title:t(i.explainThisMessage),configurableBindings:!1,contextTypes(){return[]}},{actionId:"explain.console-message.context.error",title:t(i.explainThisError),configurableBindings:!1,contextTypes(){return[]}},{actionId:"explain.console-message.context.warning",title:t(i.explainThisWarning),configurableBindings:!1,contextTypes(){return[]}},{actionId:"explain.console-message.context.other",title:t(i.explainThisMessage),configurableBindings:!1,contextTypes(){return[]}}];function h(){return!s.DevToolsLocale.DevToolsLocale.instance().locale.startsWith("en-")}function d(e){return e?.aidaAvailability?.blockedByGeo===!0}function g(e){return e?.aidaAvailability?.blockedByEnterprisePolicy===!0}function u(e){return(e?.aidaAvailability?.enabled&&e?.devToolsConsoleInsights?.enabled)===!0}a.Settings.registerSettingExtension({category:"AI",settingName:p,settingType:"boolean",title:t(i.enableConsoleInsights),defaultValue:!1,reloadRequired:!1,condition:e=>u(e),disabledCondition:e=>{let n=[];return d(e)&&n.push(o(i.geoRestricted)),g(e)&&n.push(o(i.policyRestricted)),h()&&n.push(o(i.wrongLocale)),n.length>0?{disabled:!0,reasons:n}:{disabled:!1}}});for(let e of f)l.ActionRegistration.registerActionExtension({...e,category:"CONSOLE",async loadActionDelegate(){let n=await import("./explain.js");return new n.ActionDelegate},condition:n=>u(n)&&!g(n)&&!d(n)});
//# sourceMappingURL=explain-meta.js.map
