@aquera/data-visualizer-sdk 0.0.43 → 0.0.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,22 +1,22 @@
1
- import{$ as Ne,A as Jt,Aa as $e,B as Zt,C as en,D as tn,E as nn,Ea as We,F as on,H as an,J as ae,K as rn,Ka as Be,La as Ue,M as ue,Ma as Ge,Na as je,Oa as He,P as ln,Pa as Ye,Qa as Ke,R as sn,Ra as Qe,S as dn,Sa as En,T as cn,Ta as pt,Ua as In,V as ze,Va as Vn,Wa as Rn,X as pn,Xa as zn,Ya as Nn,Z as _n,_ as gn,a as qt,aa as un,ab as Ln,b as Dt,ba as Ae,bb as $n,c as Wt,ca as dt,cb as Wn,da as ct,db as Bn,ea as mn,eb as me,f as Bt,fa as hn,ga as Cn,gb as Un,h as Ut,ha as fn,ia as xn,ja as yn,k as Gt,ka as bn,l as oe,la as vn,m as ge,ma as wn,mb as _t,n as jt,na as kn,o as Ht,ob as Gn,pa as Pn,q as Yt,qa as An,r as st,ra as Le,s as Kt,sa as Mn,sb as jn,t as Qt,ta as Sn,tb as gt,ua as Tn,ub as Hn,va as qn,w as Xt,wa as Dn,xa as Fn,ya as On,z as ee}from"./chunk-4OVUIGVK.js";import{Db as fe,Eb as k,Ib as u,Kb as r,La as ot,Ma as Ve,Na as l,Nb as Vt,O as ie,Ob as xe,Pb as ye,Sb as ce,T as N,Tb as Z,Ub as W,Vb as at,Wb as c,Xb as y,Y as _,Yb as q,Z as g,Zb as Y,_b as Rt,ca as Ft,eb as ke,ec as zt,fa as Ot,fc as _e,gc as rt,hc as Nt,ia as Et,ja as f,jb as Pe,jc as Lt,kc as Re,ma as Ce,ob as It,oc as $t,p as E,pb as M,pc as D,qb as m,ra as Ie,rb as h,sb as G,sc as Te,tc as lt,ub as F,vb as O,wb as b,xb as s,yb as d,zb as C}from"./chunk-BTA57TVR.js";import{a as w,b as T,d as Ee}from"./chunk-ZW5NV4UO.js";function Ri(){return{filters:!0,undoRedo:!0,widgetSelection:!0,publishAsDashboard:!0,addToDashboard:!0}}function zi(){return{enabled:!0,dataset:!0,pipeline:!0}}function Ni(){return{enabled:!0,ask:!0,changeChartType:!0,manageFilters:!0,customizeColors:!0,chartData:!0,setAlert:!0,forecast:!0,addToStory:!1,exportPng:!0,exportCsv:!0,print:!0,tweak:!0,edit:!0,delete:!0}}function Yn(){return{baseUrl:ee.baseUrl??"",mcpUrl:ee.MCP_URL??"",adminApiUrl:ee.ADMIN_API_URL??"",utilitiesUrl:ee.UTILITIES_ENGINE_URL??"",proxyUrl:ee.PROXY_BASEAPI_URL??"",tokenizedOrigins:[ee.baseUrl,ee.ADMIN_API_URL,ee.MCP_URL,ee.UTILITIES_ENGINE_URL,ee.PROXY_BASEAPI_URL].filter(i=>!!i),headers:{},customerId:null,productId:null,productName:null,authMode:"inherit",authToken:null,getToken:null,onUnauthorized:null,ssoEnabled:ee.SSO_ENABLED??!1,features:{mcpGateway:ee.MCP_GATEWAY_ENABLED??!1,forecast:!0,connections:!0,attachments:!0,stories:!1,promptGallery:!0,xray:!0,welcomePrompts:!0,dashboardsMenu:!0,executiveSummary:!0,alerts:!0,library:!0,tools:!0,chat:!0,widgetMenu:Ni(),scopePicker:zi(),canvas:Ri()},ui:{theme:"light",density:"comfortable",header:!0,locale:"en"},copy:Li(),routing:"none",initial:{dashboardId:null,conversationId:null,summary:!1},chatDefaults:{indexName:null,planningMode:!0}}}function Li(){return{composerPlaceholder:"Ask anything about your workforce data\u2026",welcomeTitle:"What would you like to ask?",welcomeSubtitle:"Ask anything about your workforce data.",dropFilesOverlay:"Drop images or Excel files to attach",replyButton:"Reply",defineItButton:"Define it",submitAnswersButton:"Submit answers",givePlanButton:"Give me the plan \u2192",somethingElseButton:"Something else? Tell me what to do \u2192",chatDraftPlaceholderWidget:"Tell me what to check instead\u2026",chatDraftPlaceholderClarification:"Tell me more\u2026",chatDraftPlaceholderPlan:"Tell me what to change about this widget\u2026",chatDraftPlaceholderIntake:"Type your own answer\u2026",filterValuePlaceholder:"Value\u2026",promptGallerySearchPlaceholder:"Search prompts\u2026",promptGalleryLabel:"Prompt gallery",xrayLabel:"X-ray a dataset",xrayDrawerTitle:"X-ray a dataset",xrayDatasetLabel:"Dataset",xrayEntitySearchPlaceholder:"Search tables and indexes\u2026",xrayTopicPlaceholder:"Optional \u2014 what should this dashboard show?",xrayRunLabel:"X-ray this",xrayNoSources:"No data sources are configured yet.",xrayNoEntities:"Nothing to x-ray on this data source.",xrayNoEntitiesMatch:"No tables or indexes match",xrayLoadingSources:"Loading data sources\u2026",xrayLoadingEntities:"Loading tables\u2026",xrayAnalyzing:"Analyzing this data\u2026",xrayBuilding:"Building your dashboard\u2026",xrayFailed:"The x-ray could not be completed.",xrayPickHint:"Pick one to build a dashboard",xrayFieldsLabel:"fields",xrayTablesNoun:"tables",xrayIndexesNoun:"indexes",xrayFocusToggle:"Add a focus (optional)",noPromptsMatch:"No prompts match",noPromptsYet:"No prompts yet.",noChoiceOptions:"No options available to choose from.",noChartTypesFit:"No other chart types fit this widget's data.",noFilterableFields:"No filterable fields found for this chart's data.",dashboardNamePlaceholder:"Enter a name\u2026",saveDashboardDialogLabel:"Save as dashboard",saveDashboardButton:"Save dashboard",cancelButton:"Cancel",applyButton:"Apply",forecastSettingsLabel:"Forecast settings",forecastButton:"Forecast",removeForecastButton:"Remove forecast",newConversationLabel:"New conversation",newDashboardLabel:"New dashboard",noConversationsYet:"No conversations yet",noDashboardsYet:"No dashboards yet",searchConversationsPlaceholder:"Search conversations\u2026",searchDashboardsPlaceholder:"Search dashboards\u2026",noResultsMatchFilters:"No results match your filters",renameLabel:"Rename",deleteLabel:"Delete",groupToday:"Today",groupYesterday:"Yesterday",groupPrevious7Days:"Previous 7 days",groupOlder:"Older",noDatasetsFound:"No datasets found",noPipelinesFound:"No pipelines found",createAlertButton:"Create alert",addToLibraryButton:"Add to library",addToDashboardButton:"Add to dashboard",addToCurrentDashboardButton:"Add to current dashboard",addToStoryButton:"Add to Story",publishAsDashboardButton:"Publish as a new dashboard",viewButton:"View",recomputeButton:"Recompute",chatTabLabel:"Conversation",libraryTabLabel:"Library",toolsTabLabel:"Tools",cohortBuilderTitle:"Build a cohort",cohortBuilderSubtitle:"Two steps \u2014 pick a criterion, then review who matches.",cohortStep1Label:"Choose a criterion",cohortStep2Label:"Review matches",cohortMatchSummary:"{matchCount} people match, of {totalCount} in the log",cohortViewAllLink:"View all {matchCount} \u2192",cohortShowFewerLink:"Show fewer",cohortMatchesTruncatedNote:"Showing the first {shown} of {matchCount}.",cohortPreviewWidgetButton:"Preview widget",cohortAddToCanvasDisclaimer:"Adds this cohort directly to the canvas \u2014 it is not saved to the widget library.",cohortAddToCanvasButton:"Add to canvas",cohortDetailCaption:"1 criterion \xB7 live membership \xB7 derived from the Aquera log",cohortDetailCoverage:"scanned {events} events across {systems} systems",cohortExportRowsButton:"Export rows (CSV)",cohortCopyDefinitionButton:"Copy definition",cohortEmptyMatchesMessage:"No identities in the log currently match this criterion.",cohortPreviewErrorMessage:"Couldn't load matches for this criterion.",cohortPreviewRetryButton:"Retry",cohortCriteriaErrorMessage:"Couldn't load the criteria list.",cohortLogUnavailableMessage:"This tenant has no identity log yet, so cohorts cannot be built here. Connect a source system to start recording identity events.",cohortNamesWithheldMessage:"Names are not available for this cohort.",cohortMembersForbiddenMessage:"You do not have access to the names in this cohort.",cohortMembersErrorMessage:"Couldn't load the full list.",cohortCopyDefinitionConfirmation:"Cohort definition copied to clipboard",detailCanvasCrumbLabel:"Canvas",detailDashboardCrumbLabel:"Dashboard",detailCrumbLabel:"Detail",libraryIntroTitle:"Start from a pre-canned widget or dashboard",libraryIntro:"\u2014 pick what you need, then refine it on the canvas.",libraryWidgetsTabLabel:"Widgets",libraryDashboardsTabLabel:"Dashboards",librarySearchWidgetsPlaceholder:"Search widgets\u2026",librarySearchDashboardsPlaceholder:"Search dashboards\u2026",libraryAllCategoryLabel:"All",librarySelectAllButton:"Select all",libraryClearSelectionButton:"Clear",librarySelectedCount:"{n} selected",libraryAddToCanvasButton:"Add {n} to canvas",libraryWidgetCountChip:"{n} widgets",noWidgetsMatch:"No widgets match your search.",noWidgetsInCategory:"No widgets in this category yet.",noDashboardsMatch:"No dashboards match your search.",noDashboardsInCategory:"No dashboards in this category yet.",emptyCanvasTitle:"Your canvas is empty",emptyCanvasSubtitle:"Add widgets or a whole dashboard from the Library \u2014 or ask a question in Chat.",connectionsTitle:"Connections",connectionsBreadcrumbHome:"Ask Aquera",registerConnectionTitle:"Register connection",registerConnectionButton:"Register connection",registerAndTestButton:"Register & test",registeringButton:"Registering\u2026",testConnectionButton:"Test",loadingConnections:"Loading connections\u2026",noConnectionsTitle:"No connections yet",noConnectionsSub:"Register a connection to start using Ask Aquera with your data source.",connectionNamePlaceholder:"Primary",displayNamePlaceholder:"My workforce data",errors:{assistantErrorFallback:"Failed to generate a response. Please try again.",connectionTestFailedFallback:"Connection failed",couldntForecastWidget:"Couldn't forecast this widget.",couldntLoadDatasetsOrPipelines:"Failed to load datasets / pipelines",couldntOpenConversation:"Couldn't open that conversation. Please try again.",couldntDeleteConversation:"Couldn't delete that conversation. Please try again.",couldntCreateDashboard:"Couldn't create the dashboard. Please try again.",couldntRenameConversation:"Couldn't rename that conversation. Please try again.",tooManyExcelAttachments:"You can attach up to 10 Excel files.",tooManyNonExcelAttachments:"You can attach only one non-Excel file.",unsupportedFileType:"isn't a supported file type.",fileTooLarge:"is larger than 10 MB.",couldntUpdateForecast:"Couldn't update that forecast. Please try again.",couldntSaveToLibrary:"Couldn't save that to your widget library. Please try again.",couldntApplyFilter:"Couldn't apply that filter. Please try again.",couldntAddToDashboard:"Couldn't add this to the dashboard. Please try again.",couldntPublishDashboard:"Couldn't publish the dashboard. Please try again.",couldntRenameDashboard:"Couldn't rename the dashboard. Please try again.",couldntDeleteDashboard:"Couldn't delete that dashboard. Please try again.",couldntGenerateSummary:"Failed to generate summary.",couldntSaveDashboard:"Couldn't save the dashboard. Please try again.",chartTypeChangeFailed:"Chart type change failed"}}}var Kn=Qt("dvz-ask",Yn);function I(){return Kn.read()}function ut(i){let t=Yn(),e=T(w(w({},t),re(i)),{features:T(w(w({},t.features),re(i.features??{})),{widgetMenu:w(w({},t.features.widgetMenu),re(i.features?.widgetMenu??{})),scopePicker:w(w({},t.features.scopePicker),re(i.features?.scopePicker??{})),canvas:w(w({},t.features.canvas),re(i.features?.canvas??{}))}),ui:w(w({},t.ui),re(i.ui??{})),copy:T(w(w({},t.copy),re(i.copy??{})),{errors:w(w({},t.copy.errors),re(i.copy?.errors??{}))}),initial:w(w({},t.initial),re(i.initial??{})),chatDefaults:w(w({},t.chatDefaults),re(i.chatDefaults??{})),headers:w(w({},t.headers),i.headers??{})});return i.tokenizedOrigins||(e.tokenizedOrigins=[e.baseUrl,e.adminApiUrl,e.mcpUrl,e.utilitiesUrl,e.proxyUrl].filter(n=>!!n)),Kn.write(e)}async function le(){return Xt(I())}function Qn(i,t){return i.replace("{n}",String(t))}function re(i){let t={};for(let[e,n]of Object.entries(i))n!==void 0&&(t[e]=n);return t}var be=class i{http=N(ge);tokenStore=N(ae);get customerId(){return I().customerId??this.tokenStore.tenantId()??""}async fetchGridPage(t,e,n,o,a,p,x,v){let A=`${I().baseUrl}/api/customers/${this.customerId}/products/${ue()}/workforce/data-grid/${t}?pageIndex=${e}&pageSize=${n}`,S=(o??[]).filter(P=>P&&P.value!=null&&String(P.value).trim()!=="");return S.length&&(A+=`&filters=${encodeURIComponent(JSON.stringify(S))}`),a&&Object.keys(a).length&&(A+=`&dashboardFilters=${encodeURIComponent(JSON.stringify(a))}`),x&&x.length&&(A+=`&resolvedFilters=${encodeURIComponent(JSON.stringify(x))}`),p&&(A+=`&dashboardId=${encodeURIComponent(p)}`),v&&(A+=`&conversationId=${encodeURIComponent(v)}`),E(this.http.get(A))}static \u0275fac=function(e){return new(e||i)};static \u0275prov=ie({token:i,factory:i.\u0275fac,providedIn:"root"})};var mt=["image/png","image/jpeg","image/webp","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-excel"],Xn=10*1024*1024,ht=1,Ct=10,$i=["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-excel"];function ft(i,t){return $i.includes(t)||/\.(xls|xlsx)$/i.test(i)}var he=class i{http=N(ge);tokenStore=N(ae);lastSentCustomerId=null;lastSentProductId=null;get customerId(){return I().customerId??this.tokenStore.tenantId()??""}get productId(){return I().productId??ue()}get baseUrl(){return`${I().baseUrl}/api/customers/${this.customerId}/products/${this.productId}/workforce`}mcpGatewayUrl(){return`${I().baseUrl}/dviz-mcp`}async callMcpTool(t,e={},n){let o=this.customerId,a=this.productId,p=w({},n);o!==this.lastSentCustomerId&&(p.customerId=o),a!==this.lastSentProductId&&(p.productId=a);let x;try{x=await E(this.http.post(this.mcpGatewayUrl(),{jsonrpc:"2.0",id:Date.now(),method:"tools/call",params:{name:t,arguments:e}},{headers:{Accept:"application/json, text/event-stream"},params:p})),this.lastSentCustomerId=o,this.lastSentProductId=a}catch(A){throw A instanceof oe?new Error(A.error?.error?.message||A.error?.message||A.message):A}if(x.error)throw new Error(x.error.message);let v=x.result;if(v?.isError)throw new Error(v.structuredContent?.error?.message??v.content?.[0]?.text??`${t} failed`);return v?.structuredContent??{}}async listConversations(t=30){return!this.customerId||!this.productId?[]:I().features.mcpGateway?(await this.callMcpTool("listConversations",{limit:t,status:"active"}))?.conversations??[]:(await E(this.http.get(`${this.baseUrl}/conversations?limit=${t}&status=active`)))?.data??[]}async getConversation(t){if(!t)return null;if(!I().features.mcpGateway){let x=await E(this.http.get(`${this.baseUrl}/conversations/${t}`));if(!x?.data)return null;let a=x.data,{messages:v}=a;return{conversation:Ee(a,["messages"]),messages:v??[]}}let e=await this.callMcpTool("getConversation",{conversationId:t});if(!e?.conversation)return null;let p=e.conversation,{messages:n}=p;return{conversation:Ee(p,["messages"]),messages:n??[]}}async updateConversation(t,e){await E(this.http.patch(`${this.baseUrl}/conversations/${t}`,e))}async deleteConversation(t){if(!I().features.mcpGateway){await E(this.http.delete(`${this.baseUrl}/conversations/${t}`));return}await this.callMcpTool("deleteConversation",{conversationId:t})}async streamChat(t,e,n,o,a,p,x,v){return p?.length||!I().features.mcpGateway?this.streamChatViaSse(t,e,n,o,a,p,x,v):this.sendChatViaGateway(t,e,n,o,a)}async sendChatViaGateway(t,e,n,o,a){let p={message:e};t&&(p.conversationId=t),o&&(p.connectionId=o);let x=Date.now(),v=new URL(this.mcpGatewayUrl());v.searchParams.set("customerId",this.customerId),v.searchParams.set("productId",this.productId);let A=await le()??this.tokenStore.accessToken()??"",S=!1,P=!1,z=R=>{switch(S=!0,R?.kind){case"text":n.onText(R.text??"");break;case"toolCall":n.onToolStart(R.toolId,R.uiLabel??"");break;case"toolResult":n.onToolResult(R.toolId,R.uiDetail??"",!!R.error);break;case"data":{let V=R.payload;V?.data_type==="adhoc_viz"?n.onDataPart(V):V?.data_type==="dashboard_title"?n.onDashboardTitle?.(V.data?.title??""):V?.data_type==="choice"?n.onChoice?.(V.data):V?.data_type==="layout_patch"&&n.onLayoutPatch?.(V.data);break}case"error":n.onError(R.message??"Unknown error");break}},Q=R=>{if(R?.isError){let $=R.structuredContent?.error?.message??R.content?.[0]?.text??"askAquera failed";n.onError($),n.onFinish("error",t??""),P=!0;return}let V=R?.structuredContent??{};if(!S){n.onText(V.responseText??V.text??""),V.dashboardTitle&&n.onDashboardTitle?.(V.dashboardTitle);let $=V.widget?[V.widget]:V.widgets??[];for(let j of $)n.onDataPart({type:"data",data_type:"adhoc_viz",version:1,data:j})}n.onFinish("stop",V.conversationId??t??""),P=!0},U=R=>{if(R.method==="notifications/gateway/stream"){z(R.params??{});return}if(R.id===x){if(R.error){n.onError(R.error.message??"askAquera failed"),n.onFinish("error",t??""),P=!0;return}Q(R.result)}},K;try{K=await fetch(v.toString(),{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json, text/event-stream",Authorization:`Bearer ${A}`},body:JSON.stringify({jsonrpc:"2.0",id:x,method:"tools/call",params:{name:"askAquera",arguments:p}}),signal:a})}catch(R){if(R instanceof DOMException&&R.name==="AbortError")throw R;n.onError(R instanceof Error?R.message:String(R)),n.onFinish("error",t??"");return}if(!K.ok){let R=await K.text().catch(()=>K.statusText);n.onError(`Request failed (${K.status}): ${R}`),n.onFinish("error",t??"");return}if(!(K.headers.get("content-type")??"").includes("text/event-stream")||!K.body){let R=await K.json().catch(()=>null);if(!R){n.onError("Invalid response from server"),n.onFinish("error",t??"");return}U(R);return}let ne=K.body.getReader(),L=new TextDecoder,J="";for(;;){let{done:R,value:V}=await ne.read();if(R)break;J+=L.decode(V,{stream:!0});let $=J.split(`
1
+ import{$ as un,A as Jt,B as Zt,Ba as $e,C as en,D as tn,E as nn,F as on,Fa as We,H as an,J as rn,K as ae,L as ln,La as Be,Ma as Ue,N as ge,Na as Ge,Oa as je,Pa as He,Q as sn,Qa as Ye,Ra as Ke,S as dn,Sa as Qe,T as cn,Ta as In,U as pn,Ua as pt,W as ze,Wa as Vn,Xa as Rn,Y as _n,Ya as zn,Za as Nn,_ as gn,_a as Ln,a as qt,aa as Ne,b as Dt,ba as mn,c as Wt,ca as Pe,cb as $n,da as dt,db as Wn,ea as ct,eb as Bn,f as Bt,fa as hn,fb as Un,ga as Cn,gb as ue,h as Ut,ha as fn,ia as xn,ib as Gn,ja as yn,k as Gt,ka as bn,l as oe,la as vn,m as _e,ma as wn,n as jt,na as kn,o as Ht,oa as Pn,ob as _t,q as Yt,qa as An,qb as jn,r as st,ra as Mn,s as Kt,sa as Le,t as Qt,ta as Sn,ua as Tn,ub as Hn,va as qn,vb as gt,w as Xt,wa as Dn,wb as Yn,xa as Fn,ya as On,z as ee,za as En}from"./chunk-ZFW6PP7T.js";import{Db as Ce,Eb as k,Ib as u,Kb as r,La as ot,Ma as Ve,Na as l,Nb as Vt,O as ie,Ob as fe,Pb as xe,Sb as de,T as N,Tb as Z,Ub as W,Vb as at,Wb as c,Xb as y,Y as _,Yb as q,Z as g,Zb as Y,_b as Rt,ca as Ft,eb as we,ec as zt,fa as Ot,fc as pe,gc as rt,hc as Nt,ia as Et,ja as f,jb as ke,jc as Lt,kc as Re,ma as he,ob as It,oc as $t,p as E,pb as M,pc as D,qb as m,ra as Ie,rb as h,sb as G,sc as Te,tc as lt,ub as F,vb as O,wb as b,xb as s,yb as d,zb as C}from"./chunk-BTA57TVR.js";import{a as w,b as T,d as Ee}from"./chunk-ZW5NV4UO.js";function zi(){return{filters:!0,undoRedo:!0,widgetSelection:!0,publishAsDashboard:!0,addToDashboard:!0}}function Ni(){return{enabled:!0,dataset:!0,pipeline:!0}}function Li(){return{enabled:!0,ask:!0,changeChartType:!0,manageFilters:!0,customizeColors:!0,chartData:!0,setAlert:!0,forecast:!0,addToStory:!1,exportPng:!0,exportCsv:!0,print:!0,tweak:!0,edit:!0,delete:!0}}function Kn(){return{baseUrl:ee.baseUrl??"",mcpUrl:ee.MCP_URL??"",adminApiUrl:ee.ADMIN_API_URL??"",utilitiesUrl:ee.UTILITIES_ENGINE_URL??"",proxyUrl:ee.PROXY_BASEAPI_URL??"",tokenizedOrigins:[ee.baseUrl,ee.ADMIN_API_URL,ee.MCP_URL,ee.UTILITIES_ENGINE_URL,ee.PROXY_BASEAPI_URL].filter(i=>!!i),headers:{},customerId:null,productId:null,productName:null,authMode:"inherit",authToken:null,getToken:null,onUnauthorized:null,ssoEnabled:ee.SSO_ENABLED??!1,features:{mcpGateway:ee.MCP_GATEWAY_ENABLED??!1,forecast:!0,connections:!0,attachments:!0,stories:!1,promptGallery:!0,xray:!0,welcomePrompts:!0,dashboardsMenu:!0,executiveSummary:!0,alerts:!0,library:!0,tools:!0,chat:!0,widgetMenu:Li(),scopePicker:Ni(),canvas:zi()},ui:{theme:"light",density:"comfortable",header:!0,locale:"en"},copy:$i(),routing:"none",initial:{dashboardId:null,conversationId:null,summary:!1},chatDefaults:{indexName:null,planningMode:!0}}}function $i(){return{composerPlaceholder:"Ask anything about your workforce data\u2026",welcomeTitle:"What would you like to ask?",welcomeSubtitle:"Ask anything about your workforce data.",dropFilesOverlay:"Drop images or Excel files to attach",replyButton:"Reply",defineItButton:"Define it",submitAnswersButton:"Submit answers",givePlanButton:"Give me the plan \u2192",somethingElseButton:"Something else? Tell me what to do \u2192",chatDraftPlaceholderWidget:"Tell me what to check instead\u2026",chatDraftPlaceholderClarification:"Tell me more\u2026",chatDraftPlaceholderPlan:"Tell me what to change about this widget\u2026",chatDraftPlaceholderIntake:"Type your own answer\u2026",filterValuePlaceholder:"Value\u2026",promptGallerySearchPlaceholder:"Search prompts\u2026",promptGalleryLabel:"Prompt gallery",xrayLabel:"X-ray a dataset",xrayDrawerTitle:"X-ray a dataset",xrayDatasetLabel:"Dataset",xrayEntitySearchPlaceholder:"Search tables and indexes\u2026",xrayTopicPlaceholder:"Optional \u2014 what should this dashboard show?",xrayRunLabel:"X-ray this",xrayNoSources:"No data sources are configured yet.",xrayNoEntities:"Nothing to x-ray on this data source.",xrayNoEntitiesMatch:"No tables or indexes match",xrayLoadingSources:"Loading data sources\u2026",xrayLoadingEntities:"Loading tables\u2026",xrayAnalyzing:"Analyzing this data\u2026",xrayBuilding:"Building your dashboard\u2026",xrayFailed:"The x-ray could not be completed.",xrayPickHint:"Pick one to build a dashboard",xrayFieldsLabel:"fields",xrayTablesNoun:"tables",xrayIndexesNoun:"indexes",xrayFocusToggle:"Add a focus (optional)",noPromptsMatch:"No prompts match",noPromptsYet:"No prompts yet.",noChoiceOptions:"No options available to choose from.",noChartTypesFit:"No other chart types fit this widget's data.",noFilterableFields:"No filterable fields found for this chart's data.",dashboardNamePlaceholder:"Enter a name\u2026",saveDashboardDialogLabel:"Save as dashboard",saveDashboardButton:"Save dashboard",cancelButton:"Cancel",applyButton:"Apply",forecastSettingsLabel:"Forecast settings",forecastButton:"Forecast",removeForecastButton:"Remove forecast",newConversationLabel:"New conversation",newDashboardLabel:"New dashboard",noConversationsYet:"No conversations yet",noDashboardsYet:"No dashboards yet",searchConversationsPlaceholder:"Search conversations\u2026",searchDashboardsPlaceholder:"Search dashboards\u2026",noResultsMatchFilters:"No results match your filters",renameLabel:"Rename",deleteLabel:"Delete",groupToday:"Today",groupYesterday:"Yesterday",groupPrevious7Days:"Previous 7 days",groupOlder:"Older",noDatasetsFound:"No datasets found",noPipelinesFound:"No pipelines found",createAlertButton:"Create alert",addToLibraryButton:"Add to library",addToDashboardButton:"Add to dashboard",addToCurrentDashboardButton:"Add to current dashboard",addToStoryButton:"Add to Story",publishAsDashboardButton:"Publish as a new dashboard",viewButton:"View",recomputeButton:"Recompute",chatTabLabel:"Conversation",libraryTabLabel:"Library",toolsTabLabel:"Tools",cohortBuilderTitle:"Build a cohort",cohortBuilderSubtitle:"Two steps \u2014 pick a criterion, then review who matches.",cohortStep1Label:"Choose a criterion",cohortStep2Label:"Review matches",cohortMatchSummary:"{matchCount} people match, of {totalCount} in the log",cohortViewAllLink:"View all {matchCount} \u2192",cohortShowFewerLink:"Show fewer",cohortMatchesTruncatedNote:"Showing the first {shown} of {matchCount}.",cohortPreviewWidgetButton:"Preview widget",cohortAddToCanvasDisclaimer:"Adds this cohort directly to the canvas \u2014 it is not saved to the widget library.",cohortAddToCanvasButton:"Add to canvas",cohortDetailCaption:"1 criterion \xB7 live membership \xB7 derived from the Aquera log",cohortDetailCoverage:"scanned {events} events across {systems} systems",cohortExportRowsButton:"Export rows (CSV)",cohortCopyDefinitionButton:"Copy definition",cohortEmptyMatchesMessage:"No identities in the log currently match this criterion.",cohortPreviewErrorMessage:"Couldn't load matches for this criterion.",cohortPreviewRetryButton:"Retry",cohortCriteriaErrorMessage:"Couldn't load the criteria list.",cohortLogUnavailableMessage:"This tenant has no identity log yet, so cohorts cannot be built here. Connect a source system to start recording identity events.",cohortNamesWithheldMessage:"Names are not available for this cohort.",cohortMembersForbiddenMessage:"You do not have access to the names in this cohort.",cohortMembersErrorMessage:"Couldn't load the full list.",cohortCopyDefinitionConfirmation:"Cohort definition copied to clipboard",detailCanvasCrumbLabel:"Canvas",detailDashboardCrumbLabel:"Dashboard",detailCrumbLabel:"Detail",libraryIntroTitle:"Start from a pre-canned widget or dashboard",libraryIntro:"\u2014 pick what you need, then refine it on the canvas.",libraryWidgetsTabLabel:"Widgets",libraryDashboardsTabLabel:"Dashboards",librarySearchWidgetsPlaceholder:"Search widgets\u2026",librarySearchDashboardsPlaceholder:"Search dashboards\u2026",libraryAllCategoryLabel:"All",librarySelectAllButton:"Select all",libraryClearSelectionButton:"Clear",librarySelectedCount:"{n} selected",libraryAddToCanvasButton:"Add {n} to canvas",libraryWidgetCountChip:"{n} widgets",noWidgetsMatch:"No widgets match your search.",noWidgetsInCategory:"No widgets in this category yet.",noDashboardsMatch:"No dashboards match your search.",noDashboardsInCategory:"No dashboards in this category yet.",emptyCanvasTitle:"Your canvas is empty",emptyCanvasSubtitle:"Add widgets or a whole dashboard from the Library \u2014 or ask a question in Chat.",connectionsTitle:"Connections",connectionsBreadcrumbHome:"Ask Aquera",registerConnectionTitle:"Register connection",registerConnectionButton:"Register connection",registerAndTestButton:"Register & test",registeringButton:"Registering\u2026",testConnectionButton:"Test",loadingConnections:"Loading connections\u2026",noConnectionsTitle:"No connections yet",noConnectionsSub:"Register a connection to start using Ask Aquera with your data source.",connectionNamePlaceholder:"Primary",displayNamePlaceholder:"My workforce data",errors:{assistantErrorFallback:"Failed to generate a response. Please try again.",connectionTestFailedFallback:"Connection failed",couldntForecastWidget:"Couldn't forecast this widget.",couldntLoadDatasetsOrPipelines:"Failed to load datasets / pipelines",couldntOpenConversation:"Couldn't open that conversation. Please try again.",couldntDeleteConversation:"Couldn't delete that conversation. Please try again.",couldntCreateDashboard:"Couldn't create the dashboard. Please try again.",couldntRenameConversation:"Couldn't rename that conversation. Please try again.",tooManyExcelAttachments:"You can attach up to 10 Excel files.",tooManyNonExcelAttachments:"You can attach only one non-Excel file.",unsupportedFileType:"isn't a supported file type.",fileTooLarge:"is larger than 10 MB.",couldntUpdateForecast:"Couldn't update that forecast. Please try again.",couldntSaveToLibrary:"Couldn't save that to your widget library. Please try again.",couldntApplyFilter:"Couldn't apply that filter. Please try again.",couldntAddToDashboard:"Couldn't add this to the dashboard. Please try again.",couldntPublishDashboard:"Couldn't publish the dashboard. Please try again.",couldntRenameDashboard:"Couldn't rename the dashboard. Please try again.",couldntDeleteDashboard:"Couldn't delete that dashboard. Please try again.",couldntGenerateSummary:"Failed to generate summary.",couldntSaveDashboard:"Couldn't save the dashboard. Please try again.",chartTypeChangeFailed:"Chart type change failed"}}}var Qn=Qt("dvz-ask",Kn);function I(){return Qn.read()}function ut(i){let t=Kn(),e=T(w(w({},t),re(i)),{features:T(w(w({},t.features),re(i.features??{})),{widgetMenu:w(w({},t.features.widgetMenu),re(i.features?.widgetMenu??{})),scopePicker:w(w({},t.features.scopePicker),re(i.features?.scopePicker??{})),canvas:w(w({},t.features.canvas),re(i.features?.canvas??{}))}),ui:w(w({},t.ui),re(i.ui??{})),copy:T(w(w({},t.copy),re(i.copy??{})),{errors:w(w({},t.copy.errors),re(i.copy?.errors??{}))}),initial:w(w({},t.initial),re(i.initial??{})),chatDefaults:w(w({},t.chatDefaults),re(i.chatDefaults??{})),headers:w(w({},t.headers),i.headers??{})});return i.tokenizedOrigins||(e.tokenizedOrigins=[e.baseUrl,e.adminApiUrl,e.mcpUrl,e.utilitiesUrl,e.proxyUrl].filter(n=>!!n)),Qn.write(e)}async function Ae(){return Xt(I())}function Xn(i,t){return i.replace("{n}",String(t))}function re(i){let t={};for(let[e,n]of Object.entries(i))n!==void 0&&(t[e]=n);return t}var ye=class i{http=N(_e);tokenStore=N(ae);get customerId(){return I().customerId??this.tokenStore.tenantId()??""}async fetchGridPage(t,e,n,o,a,p,x,v){let A=`${I().baseUrl}/api/customers/${this.customerId}/products/${ge()}/workforce/data-grid/${t}?pageIndex=${e}&pageSize=${n}`,S=(o??[]).filter(P=>P&&P.value!=null&&String(P.value).trim()!=="");return S.length&&(A+=`&filters=${encodeURIComponent(JSON.stringify(S))}`),a&&Object.keys(a).length&&(A+=`&dashboardFilters=${encodeURIComponent(JSON.stringify(a))}`),x&&x.length&&(A+=`&resolvedFilters=${encodeURIComponent(JSON.stringify(x))}`),p&&(A+=`&dashboardId=${encodeURIComponent(p)}`),v&&(A+=`&conversationId=${encodeURIComponent(v)}`),E(this.http.get(A))}static \u0275fac=function(e){return new(e||i)};static \u0275prov=ie({token:i,factory:i.\u0275fac,providedIn:"root"})};var mt=["image/png","image/jpeg","image/webp","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-excel"],Jn=10*1024*1024,ht=1,Ct=10,Wi=["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-excel"];function ft(i,t){return Wi.includes(t)||/\.(xls|xlsx)$/i.test(i)}var me=class i{http=N(_e);tokenStore=N(ae);async bearer(){return await Ae()??await rn()??this.tokenStore.accessToken()??""}lastSentCustomerId=null;lastSentProductId=null;get customerId(){return I().customerId??this.tokenStore.tenantId()??""}get productId(){return I().productId??ge()}get baseUrl(){return`${I().baseUrl}/api/customers/${this.customerId}/products/${this.productId}/workforce`}mcpGatewayUrl(){return`${I().baseUrl}/dviz-mcp`}async callMcpTool(t,e={},n){let o=this.customerId,a=this.productId,p=w({},n);o!==this.lastSentCustomerId&&(p.customerId=o),a!==this.lastSentProductId&&(p.productId=a);let x;try{x=await E(this.http.post(this.mcpGatewayUrl(),{jsonrpc:"2.0",id:Date.now(),method:"tools/call",params:{name:t,arguments:e}},{headers:{Accept:"application/json, text/event-stream"},params:p})),this.lastSentCustomerId=o,this.lastSentProductId=a}catch(A){throw A instanceof oe?new Error(A.error?.error?.message||A.error?.message||A.message):A}if(x.error)throw new Error(x.error.message);let v=x.result;if(v?.isError)throw new Error(v.structuredContent?.error?.message??v.content?.[0]?.text??`${t} failed`);return v?.structuredContent??{}}async listConversations(t=30){return!this.customerId||!this.productId?[]:I().features.mcpGateway?(await this.callMcpTool("listConversations",{limit:t,status:"active"}))?.conversations??[]:(await E(this.http.get(`${this.baseUrl}/conversations?limit=${t}&status=active`)))?.data??[]}async getConversation(t){if(!t)return null;if(!I().features.mcpGateway){let x=await E(this.http.get(`${this.baseUrl}/conversations/${t}`));if(!x?.data)return null;let a=x.data,{messages:v}=a;return{conversation:Ee(a,["messages"]),messages:v??[]}}let e=await this.callMcpTool("getConversation",{conversationId:t});if(!e?.conversation)return null;let p=e.conversation,{messages:n}=p;return{conversation:Ee(p,["messages"]),messages:n??[]}}async updateConversation(t,e){await E(this.http.patch(`${this.baseUrl}/conversations/${t}`,e))}async deleteConversation(t){if(!I().features.mcpGateway){await E(this.http.delete(`${this.baseUrl}/conversations/${t}`));return}await this.callMcpTool("deleteConversation",{conversationId:t})}async streamChat(t,e,n,o,a,p,x,v){return p?.length||!I().features.mcpGateway?this.streamChatViaSse(t,e,n,o,a,p,x,v):this.sendChatViaGateway(t,e,n,o,a)}async sendChatViaGateway(t,e,n,o,a){let p={message:e};t&&(p.conversationId=t),o&&(p.connectionId=o);let x=Date.now(),v=new URL(this.mcpGatewayUrl());v.searchParams.set("customerId",this.customerId),v.searchParams.set("productId",this.productId);let A=await this.bearer(),S=!1,P=!1,z=R=>{switch(S=!0,R?.kind){case"text":n.onText(R.text??"");break;case"toolCall":n.onToolStart(R.toolId,R.uiLabel??"");break;case"toolResult":n.onToolResult(R.toolId,R.uiDetail??"",!!R.error);break;case"data":{let V=R.payload;V?.data_type==="adhoc_viz"?n.onDataPart(V):V?.data_type==="dashboard_title"?n.onDashboardTitle?.(V.data?.title??""):V?.data_type==="choice"?n.onChoice?.(V.data):V?.data_type==="layout_patch"&&n.onLayoutPatch?.(V.data);break}case"error":n.onError(R.message??"Unknown error");break}},Q=R=>{if(R?.isError){let $=R.structuredContent?.error?.message??R.content?.[0]?.text??"askAquera failed";n.onError($),n.onFinish("error",t??""),P=!0;return}let V=R?.structuredContent??{};if(!S){n.onText(V.responseText??V.text??""),V.dashboardTitle&&n.onDashboardTitle?.(V.dashboardTitle);let $=V.widget?[V.widget]:V.widgets??[];for(let j of $)n.onDataPart({type:"data",data_type:"adhoc_viz",version:1,data:j})}n.onFinish("stop",V.conversationId??t??""),P=!0},U=R=>{if(R.method==="notifications/gateway/stream"){z(R.params??{});return}if(R.id===x){if(R.error){n.onError(R.error.message??"askAquera failed"),n.onFinish("error",t??""),P=!0;return}Q(R.result)}},K;try{K=await fetch(v.toString(),{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json, text/event-stream",Authorization:`Bearer ${A}`},body:JSON.stringify({jsonrpc:"2.0",id:x,method:"tools/call",params:{name:"askAquera",arguments:p}}),signal:a})}catch(R){if(R instanceof DOMException&&R.name==="AbortError")throw R;n.onError(R instanceof Error?R.message:String(R)),n.onFinish("error",t??"");return}if(!K.ok){let R=await K.text().catch(()=>K.statusText);n.onError(`Request failed (${K.status}): ${R}`),n.onFinish("error",t??"");return}if(!(K.headers.get("content-type")??"").includes("text/event-stream")||!K.body){let R=await K.json().catch(()=>null);if(!R){n.onError("Invalid response from server"),n.onFinish("error",t??"");return}U(R);return}let ne=K.body.getReader(),L=new TextDecoder,J="";for(;;){let{done:R,value:V}=await ne.read();if(R)break;J+=L.decode(V,{stream:!0});let $=J.split(`
2
2
 
3
3
  `);J=$.pop()??"";for(let j of $){let H=j.split(`
4
- `).find(B=>B.startsWith("data:"));if(H){try{U(JSON.parse(H.slice(5).trim()))}catch{}if(P)return}}}P||(n.onError("Stream ended unexpectedly"),n.onFinish("error",t??""))}async streamChatViaSse(t,e,n,o,a,p,x,v){let A=await le()??this.tokenStore.accessToken()??"",S=`${this.baseUrl}/v1/conversations/chat`,P={message:e};t&&(P.conversationId=t),o&&(P.connectionId=o),p?.length&&(P.attachments=p),x&&(P.isPipeline=!0),v&&(P.dashboardId=v);let{indexName:z,planningMode:Q}=I().chatDefaults;z&&(P.indexName=z),Q===!1&&(P.planningMode=!1);let U=await fetch(S,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${A}`},body:JSON.stringify(P),signal:a});if(!U.ok){let L=await U.text().catch(()=>U.statusText);n.onError(`Request failed (${U.status}): ${L}`);return}if(!U.body){n.onError("No response body received");return}let K=U.body.getReader(),X=new TextDecoder,ne="";for(;;){let{done:L,value:J}=await K.read();if(L)break;ne+=X.decode(J,{stream:!0});let R=ne.split(`
5
- `);ne=R.pop()??"";for(let V of R){let $=V.trim();$&&this.parseLine($,n)}}ne.trim()&&this.parseLine(ne.trim(),n)}async getSuggestedPrompts(t,e){if(!this.customerId||!this.productId)return{widgetSuggestions:[],conversationStarters:[]};let n={};return t&&(n.connectionId=t),e&&(n.isPipeline="true"),I().features.mcpGateway?await this.callMcpTool("getSuggestedPrompts",{},n)??{widgetSuggestions:[],conversationStarters:[]}:(await E(this.http.get(`${this.baseUrl}/conversations/suggested-prompts`,{params:n})))?.data??{widgetSuggestions:[],conversationStarters:[]}}async listDashboards(t=20){return!this.customerId||!this.productId?[]:I().features.mcpGateway?(await this.callMcpTool("listDashboards",{limit:t,published:"all"}))?.dashboards??[]:(await E(this.http.get(`${this.baseUrl}/dashboards?limit=${t}`)))?.data??[]}async getDashboard(t){if(!t)return null;if(!I().features.mcpGateway){let n=await E(this.http.get(`${this.baseUrl}/dashboards/${t}`));return n?.data??n??null}return(await this.callMcpTool("getDashboard",{dashboardId:t}))?.dashboard??null}async listDashboardsForConversation(t){if(!t||!this.customerId||!this.productId)return[];if(!I().features.mcpGateway){let n=await E(this.http.get(`${this.baseUrl}/dashboards?conversationId=${encodeURIComponent(t)}`)),o=n?.data??n;return Array.isArray(o)?o:[]}return(await this.callMcpTool("listDashboards",{conversationId:t,published:"all"}))?.dashboards??[]}async changeAdhocChartType(t,e){let n;try{n=await E(this.http.post(`${this.baseUrl}/conversations/change-type`,{widgetConfig:t,newChartType:e}))}catch(o){throw o instanceof oe?new Error(o.error?.error||o.message):o}if(n?.success===!1||!n?.chart)throw new Error(n?.error||"Chart type change failed");return n.chart}async listAdhocFilterFields(t){let e;try{e=await E(this.http.post(`${this.baseUrl}/conversations/filter-fields`,{widgets:t}))}catch(n){throw n instanceof oe?new Error(n.error?.error||n.message):n}if(e?.success===!1)throw new Error(e?.error||"Could not load filter fields");return e?.fields??[]}async fetchDashboardSummary(t){let e;try{e=await E(this.http.post(`${this.baseUrl}/dashboards/${t}/summary`,{}))}catch(o){throw o instanceof oe?new Error(o.error?.error||o.message):o}if(e?.success===!1)throw new Error(e?.error||"Could not generate summary");let n=e?.data;return typeof n=="string"?n:n?.summary??""}async chatWithAdhocWidget(t,e,n){let o;try{o=await E(this.http.post(`${this.baseUrl}/conversations/widget-chat`,{widget:t,message:e,sessionId:n}))}catch(a){throw a instanceof oe?new Error(a.error?.error||a.message):a}if(o?.success===!1||!o?.reply?.content)throw new Error(o?.error||"Could not process the request");return{sessionId:o.sessionId??n,content:o.reply.content}}async fetchAdhocFilterValues(t,e,n=""){let o;try{o=await E(this.http.post(`${this.baseUrl}/conversations/filter-values`,{widgets:t,field:e,prefix:n}))}catch(a){throw a instanceof oe?new Error(a.error?.error||a.message):a}if(o?.success===!1)throw new Error(o?.error||"Could not load filter values");return{field:e,values:o?.values??[],complete:o?.complete??!0}}async applyAdhocFilter(t,e){let n;try{n=await E(this.http.post(`${this.baseUrl}/conversations/filter-apply`,{widgetConfig:t,filters:e}))}catch(o){throw o instanceof oe?new Error(o.error?.error||o.message):o}if(n?.success===!1||!n?.chart)throw new Error(n?.error||"Filter could not be applied");return n.chart}async filterSuggest(t,e,n,o="draft"){let a=n.filter(v=>!!v.id).map(v=>({widgetId:v.id})),p;try{p=await E(this.http.post(`${this.baseUrl}/dashboards/${t}/filter/suggest?status=${o}`,{query:e,refreshCache:!1,widgets:a}))}catch(v){throw v instanceof oe?new Error(v.error?.error||v.message):v}if(p?.success===!1)throw new Error(p.error||"Request failed");let x=p?.data??{completions:[],suggestions:[]};return{nextToken:x.nextToken,completions:Array.isArray(x.completions)?x.completions:[],suggestions:Array.isArray(x.suggestions)?x.suggestions:[]}}async applyFilters(t,e,n,o="draft",a,p){let x=await new Promise((Q,U)=>{let K=this.http.post(`${this.baseUrl}/dashboards/${n}/filter/apply?status=${o}`,$n(t,e,p)).subscribe({next:X=>Q(X),error:X=>{U(X instanceof oe?new Error(X.error?.error||X.message):X)}});if(a){if(a.aborted){K.unsubscribe();let X=new Error("Aborted");X.name="AbortError",U(X);return}a.addEventListener("abort",()=>{K.unsubscribe();let X=new Error("Aborted");X.name="AbortError",U(X)},{once:!0})}});if(x?.success===!1)throw new Error(x.error||"Request failed");let v=x?.data??x,A=Array.isArray(v)?v:v?.widgets;if(!Array.isArray(A))throw new Error("Invalid response from apply-filters API");let S=!Array.isArray(v)&&Array.isArray(v?.resolvedFilters)?v.resolvedFilters:[],P=!Array.isArray(v)&&typeof v?.filterExplanation=="string"?v.filterExplanation:typeof x?.filterExplanation=="string"?x.filterExplanation:null,z=P&&P.trim()?P.trim():null;return{widgets:A,resolvedFilters:S,filterExplanation:z}}async uploadAttachment(t,e){let n=await le()??this.tokenStore.accessToken()??"",o=new FormData;o.append("file",t,t.name);let a=await fetch(`${this.baseUrl}/uploads`,{method:"POST",headers:{Authorization:`Bearer ${n}`},body:o,signal:e?.signal});if(!a.ok){let v=await a.text().catch(()=>a.statusText);throw new Error(`Upload failed (${a.status}): ${v}`)}let p=await a.json().catch(()=>null),x=p?.data?.key??p?.key;if(!x)throw new Error("Upload failed: malformed response");return{key:x}}async listDashboardCategories(){return(await E(this.http.get(`${this.baseUrl}/category-templates/categories`))).data}async listAllCategoryTemplates(){return(await E(this.http.get(`${this.baseUrl}/category-templates/templates`))).data}async previewCategoryTemplateStream(t,e){let n=await le()??this.tokenStore.accessToken()??"",o=`${this.baseUrl}/category-templates/${t}/preview`,a;try{a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify({})})}catch(S){e.onError(S instanceof Error?S.message:"Network error");return}if(!a.ok){let S=await a.json().catch(()=>null);e.onError(S?.error??`Request failed (${a.status})`);return}if(!a.body){e.onError("No response body received");return}let p=a.body.getReader(),x=new TextDecoder,v="",A=S=>{let P=S.trim();if(!P)return;let z;try{z=JSON.parse(P)}catch{return}switch(z.type){case"template":e.onTemplate?.(z.template);break;case"widget":e.onWidget(z.widget);break;case"skipped":e.onSkipped?.(z.title,z.reason);break;case"error":e.onError(z.message);break;case"done":e.onDone?.();break;default:break}};for(;;){let{done:S,value:P}=await p.read();if(S)break;v+=x.decode(P,{stream:!0});let z=v.split(`
6
- `);v=z.pop()??"";for(let Q of z)A(Q)}v.trim()&&A(v)}async listXraySources(){return!this.customerId||!this.productId?[]:(await E(this.http.get(`${this.baseUrl}/xray/sources`)))?.data?.connections??[]}async listXrayEntities(t,e,n){if(!this.customerId||!this.productId)return{adapterType:"",entities:[]};let o=new Gt;return e&&(o=o.set("datasetId",e)),n&&(o=o.set("search",n)),(await E(this.http.get(`${this.baseUrl}/xray/sources/${t}/entities`,{params:o})))?.data??{adapterType:"",entities:[]}}async xrayPreviewStream(t,e,n){await this.readNdjsonStream(`${this.baseUrl}/xray/sources/${t}/preview`,e,o=>{switch(o.type){case"profile":n.onProfile?.(o.profile);break;case"semantic":n.onSemantic?.(o.semanticRead);break;case"widget":n.onWidget(o.widget);break;case"layout":n.onLayout?.(o.layouts);break;case"conversation":n.onConversation?.(o.conversationId);break;case"summary":n.onSummary?.(o.summary);break;case"empty":n.onEmpty?.(o.message);break;case"error":n.onError(o.message);break;case"done":n.onDone?.(o.widgetCount,o.title,o.conversationId??null);break;default:break}},n.onError)}async readNdjsonStream(t,e,n,o){let a=await le()??this.tokenStore.accessToken()??"",p;try{p=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:JSON.stringify(e??{})})}catch(P){o(P instanceof Error?P.message:"Network error");return}if(!p.ok){let P=await p.json().catch(()=>null);o(P?.error??`Request failed (${p.status})`);return}if(!p.body){o("No response body received");return}let x=p.body.getReader(),v=new TextDecoder,A="",S=P=>{let z=P.trim();if(z)try{n(JSON.parse(z))}catch{}};for(;;){let{done:P,value:z}=await x.read();if(P)break;A+=v.decode(z,{stream:!0});let Q=A.split(`
7
- `);A=Q.pop()??"";for(let U of Q)S(U)}A.trim()&&S(A)}async createDashboardFromTemplate(t){return(await E(this.http.post(`${this.baseUrl}/category-templates/${t}/dashboard`,{}))).data}async listWidgetTemplates(){return(await E(this.http.get(`${this.baseUrl}/widget-templates`))).data}async previewWidgetTemplate(t){return(await E(this.http.post(`${this.baseUrl}/widget-templates/${t}/preview`,{}))).data}async loadAllWidgetTemplatePreviews(){return(await E(this.http.post(`${this.baseUrl}/widget-templates/preview-all`,{}))).data}async previewWidgetTemplateDetailPanel(t){return(await E(this.http.post(`${this.baseUrl}/widget-templates/${t}/detail-panel`,{}))).data}async previewWidgetDetailPanelDefinition(t){return(await E(this.http.post(`${this.baseUrl}/widget-templates/preview-detail-panel`,{detailPanel:t}))).data}async createDashboard(t){let a=t,{published:e}=a,n=Ee(a,["published"]);return I().features.mcpGateway?(await this.callMcpTool("createDashboard",w(w({},n),e?{published:!0}:{}))).dashboard:(await E(this.http.post(`${this.baseUrl}/dashboards${e?"?published=true":""}`,n))).data}async publishDashboard(t){return I().features.mcpGateway?(await this.callMcpTool("publishDashboard",{dashboardId:t}))?.publishedDashboardId??t:(await E(this.http.post(`${this.baseUrl}/dashboards/${t}/publish`,{})))?.data?.publishedDashboardId??t}async updateDashboard(t,e){await E(this.http.put(`${this.baseUrl}/dashboards/${t}?published=false`,e))}async deleteDashboard(t){if(!I().features.mcpGateway){await E(this.http.delete(`${this.baseUrl}/dashboards/${t}`));return}await this.callMcpTool("deleteDashboard",{dashboardId:t})}async register(t){return(await E(this.http.post(`${I().baseUrl}/api/customers/${this.customerId}/workforce/register`,t))).data}async listConnections(){return!this.customerId||!this.productId?[]:(await E(this.http.get(`${this.baseUrl}/connections`)))?.data??[]}async listDatasets(){return!this.customerId||!this.productId?[]:((await E(this.http.get(`${this.baseUrl}/connections/datasets`)))?.data??[]).map(e=>({id:e.id,name:e.name}))}async listPipelines(){if(!this.customerId||!this.productId)return[];let t=`${I().baseUrl}/api/customers/${this.customerId}/products/${this.productId}/applications/orchestrations/v2?startIndex=0&limit=100`;return((await E(this.http.get(t)))?.data??[]).map(n=>({id:n.publicOrchestrationGuid??n.guid??n.id??"",name:n.name})).filter(n=>n.id)}async createConnection(t,e){return(await E(this.http.post(`${this.baseUrl}/connections`,{name:t,config:e}))).data}async updateConnection(t,e){return(await E(this.http.put(`${this.baseUrl}/connections/${t}`,e))).data}async testConnection(t){return(await E(this.http.post(`${this.baseUrl}/connections/${t}/test`,{}))).data}async deleteConnection(t){await E(this.http.delete(`${this.baseUrl}/connections/${t}`))}parseLine(t,e){let n=t.indexOf(":");if(n===-1)return;let o=t.slice(0,n),a;try{a=JSON.parse(t.slice(n+1))}catch{return}switch(o){case"f":break;case"0":e.onText(a.text??"");break;case"9":{let p=a;e.onToolStart(p.toolCallId,p.uiLabel??p.toolName??"");break}case"a":{let p=a;e.onToolResult(p.toolCallId,p.result?.uiDetail??"",p.result?.error??!1);break}case"2":{let p=a;p.data_type==="adhoc_viz"?e.onDataPart(p):p.data_type==="dashboard_title"?e.onDashboardTitle?.(p.data?.title??""):p.data_type==="choice"?e.onChoice?.(p.data):p.data_type==="layout_patch"&&e.onLayoutPatch?.(p.data);break}case"3":e.onError(a.error??"Unknown error");break;case"d":{let p=a;e.onFinish(p.finishReason??"stop",p.conversationId??"");break}}}static \u0275fac=function(e){return new(e||i)};static \u0275prov=ie({token:i,factory:i.\u0275fac,providedIn:"root"})};function Jn({hasMessages:i,artifactOpen:t,builderOpen:e}){return t?"split":e?"builder":i?"conversation":"idle"}function Zn(i,t){return i==="chat"?t.chat:i==="library"?t.library:i==="tools"?t.tools:!0}function ei(i){return[i.chat,i.library,i.tools].filter(Boolean).length>1}var Me=class i{http=N(ge);tokenStore=N(ae);get customerId(){return I().customerId??this.tokenStore.tenantId()??""}get productId(){return I().productId??ue()}get baseUrl(){return`${I().baseUrl}/api/customers/${this.customerId}/products/${this.productId}/workforce`}async listCriteria(){return(await E(this.http.get(`${this.baseUrl}/cohort-criteria?category=cohort`)))?.criteria??[]}async previewCriterion(t){return E(this.http.get(`${this.baseUrl}/cohorts/preview?criterion=${encodeURIComponent(t)}`))}async getDetail(t){return E(this.http.get(`${this.baseUrl}/cohorts/detail?criterion=${encodeURIComponent(t)}`))}async listMembers(t,e){return(await E(this.http.get(`${this.baseUrl}/cohorts/members?criterion=${encodeURIComponent(t)}&limit=${e}`)))?.members??[]}static \u0275fac=function(e){return new(e||i)};static \u0275prov=ie({token:i,factory:i.\u0275fac,providedIn:"root"})};function ni(i,t,e){return{chart:w({type:"kpi",variant:"card",value:t},e?{description:e}:{}),aq:{chartTitle:i,ai:{enabled:!1}}}}function ti(i,t,e,n){return{title:t,componentName:i,widgetType:"chart",config:e,layout:n}}function ii(i){let t=i.kpis.map((x,v)=>ti("nile-kpi-chart",x.label,ni(x.label,x.value),{x:v*3,y:0,w:3,h:2})),e=i.systemRows.length,n=e<i.systemCount?`Underlying rows \xB7 top ${e} of ${i.systemCount} systems`:`Underlying rows \xB7 ${e} ${e===1?"system":"systems"}`,o=x=>i.systemRows.some(v=>v[x]>0),a=[{accessorKey:"system",header:"System"},{accessorKey:"events",header:"Events"},...o("errors")?[{accessorKey:"errors",header:"Errors"}]:[],...o("orphans")?[{accessorKey:"orphans",header:"Orphans"}]:[]],p=ti("nile-data-grid",n,{chart:{type:"grid",columns:a,data:i.systemRows},aq:{chartTitle:n,ai:{enabled:!1}}},{x:0,y:2,w:12,h:6});return[...t,p]}var Wi={kpis:[{label:"Matches",value:""},{label:"% of population",value:""},{label:"Events from these people",value:""},{label:"Orphan events among them",value:""}],systemRows:[],systemCount:0,eventTotal:0,scan:{events:0,systems:0}};function oi(i,t=1){return{title:i.cohortTitle,componentName:"nile-kpi-chart",config:{title:i.cohortTitle,componentName:"nile-kpi-chart",widgetType:"chart",category:"cohort",config:T(w({},ni(i.cohortTitle,i.matchCount,`${t} ${t===1?"criterion":"criteria"} \xB7 live membership`)),{_meta:{cohortId:i.criterionId,detailPanel:{title:i.cohortTitle,cohortId:i.criterionId,widgets:ii(Wi)}}}),layout:{x:0,y:0,w:3,h:3}}}}function Xe(i,t){return{title:i.cohortTitle,widgets:ii(t),skipped:[]}}var Bi="__evidence-curated";function Ui(i,t){return`${i}${Bi}-${t}`}function Gi(i){let t=i?.config?._meta;if(!t||typeof t!="object")return null;let e=t,n=typeof e.templateId=="string"&&e.templateId?e.templateId:null,o=typeof e.cohortId=="string"&&e.cohortId?e.cohortId:null,a=e.detailPanel&&typeof e.detailPanel=="object"?e.detailPanel:null;return!n&&!o&&!a?null:{templateId:n,cohortId:o,detailPanel:a}}var ji=2;function Hi(i){if(!i||typeof i!="object")return;let t=i;if(![t.x,t.y,t.w,t.h].every(x=>typeof x=="number"&&Number.isFinite(x)))return;let{x:n,y:o,w:a,h:p}=t;if(!(a<=0||p<=0))return{x:n,y:o,w:a,h:Math.max(ji,Math.ceil(p))}}function Yi(i,t){return i==="kpi"?"nile-kpi-chart":i==="grid"?"nile-data-grid":typeof t=="string"&&t?t:void 0}function xt(i,t){let e=Array.isArray(i?.widgets)?i.widgets:[],n=[];for(let o of e){if(!o||typeof o!="object")continue;let a=o,p=a.config??a??{},x=p.chart??{},v=T(w({},p),{chart:x,aq:p.aq??{}}),A={id:Ui(t,n.length),title:typeof a.title=="string"?a.title:"",widgetType:a.widgetType==="kpi"?"kpi":"chart",config:v,drilldownBy:Array.isArray(a.drilldownBy)?a.drilldownBy:[],category:a.category??null},S=Yi(x.type,a.componentName);S&&(A.componentName=S);let P=Hi(a.layout);P&&(A.layout=P),typeof a.summary=="string"&&(A.summary=a.summary),a.queryMeta&&typeof a.queryMeta=="object"&&(A.queryMeta=a.queryMeta),typeof a.dataSourceId=="string"&&(A.dataSourceId=a.dataSourceId),n.push(A)}return n}var Je=class i{svc=N(he);cohort=N(Me);async resolveEvidence(t){let e=Gi(t);if(!e)return[];if(e.cohortId){let[n,o]=await Promise.all([this.cohort.previewCriterion(e.cohortId),this.cohort.getDetail(e.cohortId)]);return xt(Xe(n,o),t.id)}return e.detailPanel?e.detailPanel.widgets?.length?xt(await this.svc.previewWidgetDetailPanelDefinition(e.detailPanel),t.id):[]:e.templateId?xt(await this.svc.previewWidgetTemplateDetailPanel(e.templateId),t.id):[]}static \u0275fac=function(e){return new(e||i)};static \u0275prov=ie({token:i,factory:i.\u0275fac,providedIn:"root"})};function yt(i){return!!i&&i.matchCount>0&&!i.sampleMatches?.length}function ai(i){return!i||yt(i)?!1:i.matchCount>Math.min(i.sampleMatches?.length??0,3)}function ri(i,t,e){return e&&t?t:i?.sampleMatches?.slice(0,3)??[]}function li(i,t){return!!i&&!!t&&t.length<i.matchCount}function bt(i){let t=i?.status;return t===503?"unavailable":t===403?"forbidden":"failed"}function si(i,t,e){let n=e||"Working",o=i.map(p=>p.id==="thinking"&&p.status==="running"?T(w({},p),{status:"done"}):p),a=o.findIndex(p=>p.status==="running"&&p.baseLabel===n);if(a>=0){let p=o[a],x=[...o];return x[a]=T(w({},p),{callIds:[...p.callIds,t],pending:p.pending+1}),x}return[...o,{id:t,callIds:[t],pending:1,baseLabel:n,label:n,status:"running"}]}function di(i,t,e,n){return i.map(o=>{if(!o.callIds.includes(t))return o;let a=Math.max(0,o.pending-1);return T(w({},o),{pending:a,detail:n?o.detail:e||o.detail,status:a===0?"done":o.status})})}function vt(i){let{finishReason:t,sawError:e,producedContent:n}=i;return t==="error"?!0:t==null?e:e&&!n}var ci=i=>T(w({},i),{isStreaming:!1,thinking:void 0,hasError:!0});function pi(i,t,e){return i.some(n=>n.id===t)?i.map(n=>n.id===t?ci(n):n):[...i,ci(e(t))]}var Ze=class i{http=N(ge);tokenStore=N(ae);get customerId(){return I().customerId??this.tokenStore.tenantId()??""}get productId(){return I().productId??ue()}get apiUrl(){return`${I().baseUrl}/api/customers/${this.customerId}/products/${this.productId}/workforcebot/forecast`}cachedContext=null;context(){return this.cachedContext?this.cachedContext:(this.cachedContext=E(this.http.get(`${this.apiUrl}/context`)).catch(t=>(console.info('[ask-aquera] forecast context unavailable \u2014 "forecast this" will not be claimed.',t),null)),this.cachedContext)}async compute(t){try{return await E(this.http.post(`${this.apiUrl}/compute`,t))}catch(e){let n=e,o=n?.error?.error;throw Object.assign(new Error(o||`Forecast failed (HTTP ${n?.status??"?"})`),{status:n?.status,code:n?.error?.code,isRefusal:n?.status===422})}}static \u0275fac=function(e){return new(e||i)};static \u0275prov=ie({token:i,factory:i.\u0275fac,providedIn:"root"})};var Qi=[/\bforecast(?:ing|s|ed)?\b/i,/\bpredict(?:ion|ions|ive|s|ed)?\b/i,/\bproject(?:ion|ions|ed)\b/i,/\bproject\s+(?:our|the|this|that|my|its|their|his|her|forward)\b/i,/\bproject\s+\w+(?:\s+\w+)?\s+forward\b/i,/\bextrapolat\w*/i,/\bnext\s+(?:week|month|quarter|year|\d+\s+(?:weeks?|months?|quarters?|years?))\b/i,/\bby\s+(?:year[-\s]?end|end\s+of\s+(?:the\s+)?year|EOY)\b/i,/\bby\s+Q[1-4]\b/i,/\bthrough\s+(?:year[-\s]?end|end\s+of\s+(?:the\s+)?year)\b/i,/\bhow\s+many\s+\w+\s+will\s+we\b/i,/\bwhat\s+will\s+\w+\s+(?:be|look\s+like)\b/i,/\btrend\s+(?:this\s+)?forward\b/i,/\brun[-\s]?rate\s+to\b/i],Xi=[/\bforecast\s+(?:this|that|it)\b/i,/\bextend\s+(?:this|that|it)\b/i,/\bproject\s+(?:this|that|it)\s+forward\b/i,/\btrend\s+(?:this|that|it)\s+forward\b/i,/\b(?:this|that)\s+chart\b/i,/\bsame\s+chart\b/i],Ji={Weekly:{week:1,month:4,quarter:13,year:52},Monthly:{week:1,month:1,quarter:3,year:12},Quarterly:{week:1,month:1,quarter:1,year:4},Yearly:{week:1,month:1,quarter:1,year:1}},Zi=[[/\b(?:weekly|by\s+week|per\s+week|week\s+over\s+week)\b/i,"Weekly"],[/\b(?:monthly|by\s+month|per\s+month|month\s+over\s+month)\b/i,"Monthly"],[/\b(?:quarterly|by\s+quarter|per\s+quarter)\b/i,"Quarterly"],[/\b(?:yearly|annually|annual|per\s+year)\b|\bby\s+year\b(?!\s*-?\s*end)/i,"Yearly"]];function wt(i,t,e=new Date){let n=(i??"").trim();if(!n)return null;let o=Xi.some(x=>x.test(n)),a=eo(n,Qi);if(!a&&!o)return null;let p=to(n);return{extendsExisting:o,metric:no(n,t),horizon:io(n,p??t.defaults.granularity,e),granularity:p,trigger:a||"refers to an existing chart"}}function eo(i,t){for(let e of t){let n=e.exec(i);if(n)return n[0]}return""}function to(i){for(let[t,e]of Zi)if(t.test(i))return e}function no(i,t){let e=i.toLowerCase();return t.metrics.flatMap(o=>[o.label,...o.aliases].map(a=>({id:o.id,alias:a.toLowerCase()}))).sort((o,a)=>a.alias.length-o.alias.length).find(o=>e.includes(o.alias))?.id}function io(i,t,e){let n=Ji[t],o=/\bnext\s+(\d+)\s+(weeks?|months?|quarters?|years?)\b/i.exec(i);if(o){let x=Number(o[1]),v=o[2].toLowerCase().replace(/s$/,"");return Math.max(1,Math.round(x*n[v]))}let a=/\bnext\s+(week|month|quarter|year)\b/i.exec(i);if(a){let x=a[1].toLowerCase();return Math.max(1,n[x])}if(/\b(?:by|through)\s+(?:year[-\s]?end|end\s+of\s+(?:the\s+)?year|EOY)\b/i.test(i))return oo(t,e);let p=/\bby\s+Q([1-4])\b/i.exec(i);if(p)return ao(t,Number(p[1]),e)}function oo(i,t){let e=12-(t.getMonth()+1);return Math.max(1,_i(e,i))}function ao(i,t,e){let n=Math.floor(e.getMonth()/3)+1,o=t>=n?t-n:4-n+t,a=Math.max(1,o*3);return Math.max(1,_i(a,i))}function _i(i,t){switch(t){case"Weekly":return Math.round(i*4.345);case"Quarterly":return Math.max(1,Math.round(i/3));case"Yearly":return Math.max(1,Math.round(i/12));default:return i}}var ro=new Set(["line","area","spline","areaspline"]),kt="(?:jan|feb|mar|apr|may|jun|jul|aug|sep|sept|oct|nov|dec)[a-z]*",se="(?:19|20)\\d{2}",gi="(?:0?[1-9]|[12]\\d|3[01])",Pt="(?:0?[1-9]|1[0-2])",lo=[new RegExp(`^${se}[-/.]${Pt}(?:[-/.]${gi})?$`,"i"),new RegExp(`^${gi}[-/.]${Pt}[-/.]${se}$`,"i"),new RegExp(`^${Pt}[-/.]${se}$`,"i"),new RegExp(`^${se}-?w\\d{1,2}$`,"i"),new RegExp(`^w(?:ee)?k\\s*\\d{1,2}[,\\s]+${se}$`,"i"),new RegExp(`^${kt}[\\s-]*'?\\d{2}$`,"i"),new RegExp(`^${kt}[\\s-]*${se}$`,"i"),new RegExp(`^${se}[\\s-]*${kt}$`,"i"),new RegExp(`^q[1-4][\\s-]*${se}$`,"i"),new RegExp(`^${se}[\\s-]*q[1-4]$`,"i"),new RegExp("^fy\\s*'?\\d{2,4}$","i"),new RegExp(`^${se}$`)];function so(i){let t=(i??[]).map(n=>String(n??"").trim()).filter(Boolean);return t.length<3?!1:t.filter(n=>lo.some(o=>o.test(n))).length/t.length>=.8}var co=[/forecast/i,/confidence/i,/project/i,/upper|lower/i,/band/i,/target/i],mi=3;function et(i){return i?.config?.chart??i?.chart??{}}function hi(i){let t=et(i);return t?.enableForecasting===!0?!0:(Array.isArray(t?.data)?t.data:[]).some(n=>Array.isArray(n?.projected)&&n.projected.length>0)}function tt(i){let t=et(i),e=String(t?.type??"").toLowerCase();if(!ro.has(e))return!1;let n=po(i);if(!n||n.values.length<mi)return!1;let o=yi(t);return o.length?so(o):!!n.times?.length}function po(i){let t=et(i),e=xi(t);if(!e.length)return null;let n=e.find(o=>!bi(o.name))??e[0];return fi(t,n)}function Ci(i){let t=et(i),e=xi(t).filter(o=>!bi(o.name)),n=[];return e.forEach((o,a)=>{let p=fi(t,o);p&&n.push(T(w({},p),{name:o.name||(e.length>1?`Series ${a+1}`:"")}))}),n}function fi(i,t){let e=go(t.data),n=e.map(p=>p.value);if(n.length<mi)return null;let o=e.every(p=>p.time!==void 0)?e.map(p=>p.time):void 0,a=yi(i).slice(0,n.length);return w({labels:a.length===n.length?a:o?o.map(p=>_o(p)):n.map((p,x)=>String(x+1)),values:n},o?{times:o}:{})}function _o(i){return new Date(i).toLocaleDateString("en-US",{month:"short",year:"numeric"})}function xi(i){let t=i?.options?.series;if(Array.isArray(t)&&t.length)return t.filter(n=>Array.isArray(n?.data)).map(n=>({name:String(n.name??""),data:n.data}));let e=i?.data;return Array.isArray(e)&&e.length?e.every(n=>typeof n=="number"||n===null)?[{name:"",data:e}]:e.filter(n=>Array.isArray(n?.data)||Array.isArray(n?.actual)).map(n=>({name:String(n.name??""),data:Array.isArray(n.actual)?n.actual:n.data})):[]}function yi(i){let t=i?.categories;if(Array.isArray(t)&&t.length)return t.map(String);let e=i?.options?.xAxis?.categories;return Array.isArray(e)&&e.length?e.map(String):[]}function bi(i){return co.some(t=>t.test(i))}function go(i){let t=[];for(let e of i){let n=uo(e);if(n===null)break;t.push(n)}return t}function uo(i){if(typeof i=="number"&&Number.isFinite(i))return{value:i};if(Array.isArray(i)&&i.length===2&&typeof i[1]=="number")return w({value:i[1]},typeof i[0]=="number"?{time:i[0]}:{});if(i&&typeof i=="object"&&typeof i.y=="number"){let t=i;return w({value:t.y},typeof t.x=="number"?{time:t.x}:{})}return null}var Mt={Weekly:{Weekly:1,Monthly:4,Quarterly:13,Yearly:52},Monthly:{Monthly:1,Quarterly:3,Yearly:12},Quarterly:{Quarterly:1,Yearly:4},Yearly:{Yearly:1}},At={Weekly:{plural:"weeks",singular:"week",adjective:"weekly"},Monthly:{plural:"months",singular:"month",adjective:"monthly"},Quarterly:{plural:"quarters",singular:"quarter",adjective:"quarterly"},Yearly:{plural:"years",singular:"year",adjective:"yearly"}},ui=4;function mo(i,t,e){let n=Mt[t]?.[e];return n?Math.max(1,Math.floor(i/n)):null}function vi(i,t,e){return e.map(n=>{let o=At[n]??At.Monthly,a=mo(t,i,n);return a===null?{value:n,enabled:!1,fittedPeriods:0,maxHorizon:0,label:o,reason:`needs ${o.adjective} data, but this series is ${At[i]?.adjective??i.toLowerCase()}`}:a<ui?{value:n,enabled:!1,fittedPeriods:a,maxHorizon:0,label:o,reason:`only ${a} ${a===1?o.singular:o.plural} of history, needs at least ${ui}`}:{value:n,enabled:!0,fittedPeriods:a,maxHorizon:Math.max(1,Math.floor(a/2)),label:o}})}function wi(i,t,e,n){if(t===e)return Math.max(1,Math.min(i,n));let o=Mt[t]?.[e],a=Mt[e]?.[t],p=o?i/o:a?i*a:i;return Math.max(1,Math.min(Math.round(p),n))}var ho="#2970FF",ki="#7A5AF8";var Pi={Weekly:6048e5,Monthly:26298e5,Quarterly:78894e5,Yearly:315576e5},Ai={Weekly:"Week",Monthly:"Month",Quarterly:"Quarter",Yearly:"Year"};function Co(i,t){if(i.times?.length===i.values.length)return i.times;let e=Date.now(),n=i.values.length;return i.values.map((o,a)=>Math.round(e-(n-1-a)*t))}function Mi(i,t){let e=new Date(i);switch(t){case"Weekly":return e.toLocaleDateString("en-US",{day:"numeric",month:"short",year:"numeric"});case"Quarterly":return`Q${Math.floor(e.getMonth()/3)+1} ${e.getFullYear()}`;case"Yearly":return String(e.getFullYear());default:return e.toLocaleDateString("en-US",{month:"short",year:"numeric"})}}function Si(i,t){let e=Pi[i.granularity]??Pi.Monthly,n=Co(i.history,e),o=n[n.length-1]??Date.now(),a=i.forecastTimes?.length===t.length?i.forecastTimes:t.map((P,z)=>Math.round(o+(z+1)*e)),p=t.length>0,x=[...n.map(P=>Mi(P,i.granularity)),...p?a.map(P=>Mi(P,i.granularity)):[]],v=(i.series?.length??0)>1,A=v?i.series.map(P=>w({name:P.note?`${P.name} \xB7 ${P.note}`:P.name,actual:P.values},P.points?.length?{projected:P.points.map(z=>z.value),interval:P.points.map(z=>[z.low,z.high])}:{})):[w({name:"Actuals",color:ho,actual:i.history.values},p?{projected:t.map(P=>P.value),interval:t.map(P=>[P.low,P.high])}:{})],S={type:"line",enableForecasting:!0,categories:x,data:A,lineWidth:2,showMarkers:!1,valueSuffix:i.valueSuffix??"",xAxisTitle:Ai[i.granularity]??Ai.Monthly,projection:T(w({start:null},v?{}:{color:ki}),{dashStyle:"Dash",showNowLine:!0,nowLabel:"",bandLabel:"Projected",interval:T(w({name:`${i.confidence}% confidence`},v?{}:{color:ki}),{opacity:.16,level:i.confidence})}),legend:{show:!0},height:"400px",loading:!1,options:{}};return{title:i.chartTitle,componentName:"nile-line-chart",widgetType:"chart",config:{aq:{chartTitle:i.chartTitle,chartSubtitle:i.chartSubtitle},chart:S},queryMeta:{sql:`-- forecast:${i.metric}`}}}function St(i,t=[]){let e=i.guardrails?.passed?i.points??[]:[],n=e[e.length-1],o=w({horizon:i.horizon,confidence:i.confidence,granularity:i.granularity},n?{value:n.value,low:n.low,high:n.high}:{}),a=e.length?qe(i.narrative,o):i.guardrails?.body?`I can't forecast this reliably. ${i.guardrails.body}`:"I can't forecast this series.",p=fo(i,t),x=i.skipped??[],v=(i.meta??[]).map(A=>({label:A.label,value:qe(A.value,o)}));return x.length&&p.length>1&&v.push({label:"Series",value:`${p.length-x.length} of ${p.length} forecast \u2014 ${x.map(A=>A.name).join(", ")} left as history`}),{chart:xo(i,e,p),answer:a,meta:v,points:e,horizon:i.horizon,granularity:i.granularity,confidence:i.confidence,maxHorizon:i.maxHorizon}}function fo(i,t){let e=i.forecasts??[];if(e.length<2&&!(i.skipped?.length&&e.length))return[];let n=p=>String(p??"").toLowerCase().replace(/[^a-z0-9]/g,""),o=new Map(t.map(p=>[n(p.name??""),p])),a=e.map(p=>({name:p.name,values:p.history?.values??o.get(n(p.name))?.values??[],points:i.guardrails?.passed?p.points??[]:[]}));for(let p of i.skipped??[]){let x=o.get(n(p.name));x?.values?.length&&a.push({name:p.name,values:x.values,note:"not forecast"})}return a}function xo(i,t,e=[]){return Si(e.length?T(w({},i),{series:e}):i,t)}function qe(i,t){return String(i??"").replace(/\{\{(\w+)\}\}/g,(e,n)=>n in t?String(t[n]):e)}function Tt(i){if(i.forecast||i.isStreaming||i.charts?.length!==1)return!1;let t=i.charts[0]?.config;return hi(t)?!1:tt(t)}var bo=["aqChat"],vo=["artifactGrid"],wo=["composerEl"],ko=["aiExecutiveSummary"],Po=()=>[1,2,3,4],Se=()=>[],Di=i=>({$implicit:i}),te=(i,t)=>t.id,de=(i,t)=>t.key,Ao=(i,t)=>t.templateId,Mo=(i,t)=>t.identityKey,Fi=(i,t)=>t.label,Oi=(i,t)=>t.component,So=(i,t)=>t.name,nt=(i,t)=>t.value,To=(i,t)=>t.action,qo=(i,t)=>t.datasetId,Do=(i,t)=>t.schema+"."+t.name;function Fo(i,t){if(i&1){let e=k();s(0,"button",32),u("click",function(){_(e);let o=r();return g(o.addReplyQuote())}),C(1,"nile-glyph",33),c(2),d()}if(i&2){let e=t,n=r();Z("top",e.top,"px")("left",e.left,"px"),W("reply-badge--below",!e.above),l(2),q(" ",n.copy().replyButton," ")}}function Oo(i,t){if(i&1&&(s(0,"nile-nav-tab",50),c(1),d()),i&2){let e=r(3);l(),y(e.copy().chatTabLabel)}}function Eo(i,t){if(i&1&&(s(0,"nile-nav-tab",51),c(1),d()),i&2){let e=r(3);l(),y(e.copy().libraryTabLabel)}}function Io(i,t){if(i&1&&(s(0,"nile-nav-tab",52),c(1),d()),i&2){let e=r(3);l(),y(e.copy().toolsTabLabel)}}function Vo(i,t){if(i&1){let e=k();s(0,"nile-nav-tab-group",49),u("nile-tab-change",function(o){_(e);let a=r(2);return g(a.setChatPaneTab(o.detail.value))}),m(1,Oo,2,1,"nile-nav-tab",50),m(2,Eo,2,1,"nile-nav-tab",51),m(3,Io,2,1,"nile-nav-tab",52),d()}if(i&2){let e=r(2);M("value",e.chatPaneTab()),l(),h(e.features().chat?1:-1),l(),h(e.features().library?2:-1),l(),h(e.features().tools?3:-1)}}function Ro(i,t){if(i&1){let e=k();s(0,"span",37),C(1,"nile-glyph",53),s(2,"span",54),c(3),d(),s(4,"button",55),u("click",function(){_(e);let o=r(2);return g(o.clearScope())}),C(5,"nile-glyph",56),d()()}if(i&2){let e=t;l(),b("name",e.kind==="dataset"?"ng-database":"ng-dataflow-04"),l(2),Y("",e.kind==="dataset"?"Dataset":"Pipeline",": ",e.name)}}function zo(i,t){i&1&&(s(0,"div",66),C(1,"nile-skeleton-loader",67)(2,"nile-skeleton-loader",68),d())}function No(i,t){i&1&&C(0,"nile-glyph",72)}function Lo(i,t){if(i&1){let e=k();s(0,"nile-menu-item",70),u("click",function(){let o=_(e).$implicit,a=r(5);return g(a.selectScope("dataset",o))}),s(1,"span",71),c(2),d(),m(3,No,1,0,"nile-glyph",72),d()}if(i&2){let e,n=t.$implicit,o=r(5);l(2),y(n.name),l(),h(((e=o.selectedScope())==null?null:e.id)===n.id?3:-1)}}function $o(i,t){if(i&1&&(s(0,"div",69),c(1),d()),i&2){let e=r(5);l(),y(e.copy().noDatasetsFound)}}function Wo(i,t){if(i&1&&F(0,Lo,4,2,"nile-menu-item",null,te,!1,$o,2,1,"div",69),i&2){let e=r(4);O(e.datasets())}}function Bo(i,t){if(i&1&&(s(0,"nile-menu-item")(1,"nile-dropdown",61)(2,"span",62),C(3,"nile-glyph",63),s(4,"span",64),c(5,"Dataset"),d(),C(6,"nile-glyph",65),d(),s(7,"nile-menu"),m(8,zo,3,0,"div",66)(9,Wo,3,1),d()()()),i&2){let e=r(3);l(8),h(e.scopeLoading()?8:9)}}function Uo(i,t){i&1&&(s(0,"div",66),C(1,"nile-skeleton-loader",67)(2,"nile-skeleton-loader",68),d())}function Go(i,t){i&1&&C(0,"nile-glyph",72)}function jo(i,t){if(i&1){let e=k();s(0,"nile-menu-item",70),u("click",function(){let o=_(e).$implicit,a=r(5);return g(a.selectScope("pipeline",o))}),s(1,"span",71),c(2),d(),m(3,Go,1,0,"nile-glyph",72),d()}if(i&2){let e,n=t.$implicit,o=r(5);l(2),y(n.name),l(),h(((e=o.selectedScope())==null?null:e.id)===n.id?3:-1)}}function Ho(i,t){if(i&1&&(s(0,"div",69),c(1),d()),i&2){let e=r(5);l(),y(e.copy().noPipelinesFound)}}function Yo(i,t){if(i&1&&F(0,jo,4,2,"nile-menu-item",null,te,!1,Ho,2,1,"div",69),i&2){let e=r(4);O(e.pipelines())}}function Ko(i,t){if(i&1&&(s(0,"nile-menu-item")(1,"nile-dropdown",61)(2,"span",62),C(3,"nile-glyph",73),s(4,"span",64),c(5,"Pipeline"),d(),C(6,"nile-glyph",65),d(),s(7,"nile-menu"),m(8,Uo,3,0,"div",66)(9,Yo,3,1),d()()()),i&2){let e=r(3);l(8),h(e.scopeLoading()?8:9)}}function Qo(i,t){if(i&1){let e=k();s(0,"nile-dropdown",57),u("nile-hide",function(){_(e);let o=r(2);return g(o.closeScopeMenu())}),s(1,"nile-lite-tooltip",58)(2,"button",59),u("click",function(){_(e);let o=r(2);return g(o.openScopeMenu())}),C(3,"nile-glyph",60),d()(),s(4,"nile-menu"),m(5,Bo,10,1,"nile-menu-item"),m(6,Ko,10,1,"nile-menu-item"),d()()}if(i&2){let e=r(2);b("open",e.showScopePicker()),l(5),h(e.features().scopePicker.dataset?5:-1),l(),h(e.features().scopePicker.pipeline?6:-1)}}function Xo(i,t){if(i&1&&(s(0,"nile-menu-item",74)(1,"div",75),C(2,"nile-skeleton-loader",76),s(3,"div",77),C(4,"nile-skeleton-loader",78)(5,"nile-skeleton-loader",79),d()()()),i&2){let e=t.$implicit;l(3),Z("max-width",e,"px")}}function Jo(i,t){if(i&1&&F(0,Xo,6,2,"nile-menu-item",74,G),i&2){let e=r(2);O(e.menuSkeletonRows)}}function Zo(i,t){if(i&1&&(s(0,"div",46),c(1),d()),i&2){let e=r(2);l(),y(e.copy().noResultsMatchFilters)}}function ea(i,t){if(i&1){let e=k();s(0,"input",88),u("ngModelChange",function(o){_(e);let a=r(5);return g(a.renameDraft.set(o))})("click",function(o){return o.stopPropagation()})("keydown.enter",function(o){_(e);let a=r().$implicit,p=r(4);return g(p.commitRenameConversation(o,a))})("keydown.escape",function(o){_(e);let a=r(5);return g(a.cancelRename(o))})("blur",function(o){_(e);let a=r().$implicit,p=r(4);return g(p.commitRenameConversation(o,a))}),d()}if(i&2){let e=r(5);b("ngModel",e.renameDraft())}}function ta(i,t){if(i&1&&(s(0,"span",89),c(1),d(),s(2,"span",90),c(3),d()),i&2){let e=r().$implicit,n=r(4);b("title",e.title||"Untitled"),l(),y(e.title||"Untitled"),l(2),y(n.conversationMeta(e))}}function na(i,t){if(i&1){let e=k();s(0,"nile-menu-item",70),u("click",function(){let o=_(e).$implicit,a=r(4);return g(a.selectConversation(o.id))}),s(1,"div",75),C(2,"nile-glyph",81),s(3,"div",77),m(4,ea,1,1,"input",82)(5,ta,4,3),d(),s(6,"div",83)(7,"button",84),u("click",function(o){let a=_(e).$implicit,p=r(4);return g(p.startRename(o,a.id,a.title))}),C(8,"nile-glyph",85),d(),s(9,"button",86),u("click",function(o){let a=_(e).$implicit,p=r(4);return g(p.deleteConversation(o,a.id))}),C(10,"nile-glyph",87),d()()()()}if(i&2){let e=t.$implicit,n=r(4);M("active",e.id===n.activeConversationId()?"":null),l(4),h(n.renamingId()===e.id?4:5),l(3),M("aria-label",n.copy().renameLabel),l(2),M("aria-label",n.copy().deleteLabel)}}function ia(i,t){if(i&1&&(s(0,"div",80),c(1),d(),F(2,na,11,4,"nile-menu-item",null,te)),i&2){let e=t.$implicit;l(),y(e.label),l(),O(e.items)}}function oa(i,t){if(i&1&&(s(0,"div",46),c(1),d()),i&2){let e=r(3);l(),y(e.copy().noConversationsYet)}}function aa(i,t){if(i&1&&F(0,ia,4,1,null,null,de,!1,oa,2,1,"div",46),i&2){let e=r(2);O(e.groupedConversations())}}function ra(i,t){if(i&1&&(s(0,"nile-menu-item",74)(1,"div",75),C(2,"nile-skeleton-loader",76),s(3,"div",77),C(4,"nile-skeleton-loader",78)(5,"nile-skeleton-loader",95),d()()()),i&2){let e=t.$implicit;l(3),Z("max-width",e,"px")}}function la(i,t){if(i&1&&F(0,ra,6,2,"nile-menu-item",74,G),i&2){let e=r(3);O(e.menuSkeletonRows)}}function sa(i,t){if(i&1&&(s(0,"div",46),c(1),d()),i&2){let e=r(3);l(),y(e.copy().noResultsMatchFilters)}}function da(i,t){if(i&1){let e=k();s(0,"input",88),u("ngModelChange",function(o){_(e);let a=r(6);return g(a.renameDraft.set(o))})("click",function(o){return o.stopPropagation()})("keydown.enter",function(o){_(e);let a=r().$implicit,p=r(5);return g(p.commitRenameDashboard(o,a))})("keydown.escape",function(o){_(e);let a=r(6);return g(a.cancelRename(o))})("blur",function(o){_(e);let a=r().$implicit,p=r(5);return g(p.commitRenameDashboard(o,a))}),d()}if(i&2){let e=r(6);b("ngModel",e.renameDraft())}}function ca(i,t){if(i&1&&(s(0,"span",89),c(1),d(),s(2,"span",90),c(3),d()),i&2){let e=r().$implicit,n=r(5);b("title",e.name||"Untitled"),l(),y(e.name||"Untitled"),l(2),y(n.dashboardMeta(e))}}function pa(i,t){if(i&1){let e=k();s(0,"nile-menu-item",70),u("click",function(){let o=_(e).$implicit,a=r(5);return g(a.openRelatedDashboard(o.id))}),s(1,"div",75),C(2,"nile-glyph",96),s(3,"div",77),m(4,da,1,1,"input",82)(5,ca,4,3),d(),s(6,"div",83)(7,"button",84),u("click",function(o){let a=_(e).$implicit,p=r(5);return g(p.startRename(o,a.id,a.name))}),C(8,"nile-glyph",85),d(),s(9,"button",86),u("click",function(o){let a=_(e).$implicit,p=r(5);return g(p.deleteDashboardFromMenu(o,a.id))}),C(10,"nile-glyph",87),d()()()()}if(i&2){let e=t.$implicit,n=r(5);M("active",n.builderOpen()&&e.id===n.builderDashboardId()?"":null),l(4),h(n.renamingId()===e.id?4:5),l(3),M("aria-label",n.copy().renameLabel),l(2),M("aria-label",n.copy().deleteLabel)}}function _a(i,t){if(i&1&&(s(0,"div",80),c(1),d(),F(2,pa,11,4,"nile-menu-item",null,te)),i&2){let e=t.$implicit;l(),y(e.label),l(),O(e.items)}}function ga(i,t){if(i&1&&(s(0,"div",46),c(1),d()),i&2){let e=r(4);l(),y(e.copy().noDashboardsYet)}}function ua(i,t){if(i&1&&F(0,_a,4,1,null,null,de,!1,ga,2,1,"div",46),i&2){let e=r(3);O(e.groupedDashboards())}}function ma(i,t){if(i&1){let e=k();s(0,"nile-dropdown",91),u("nile-hide",function(){_(e);let o=r(2);return g(o.showRelatedDashboards.set(!1))}),s(1,"nile-lite-tooltip",92)(2,"button",93),u("click",function(){_(e);let o=r(2);return g(o.showRelatedDashboards.set(!o.showRelatedDashboards()))}),C(3,"nile-glyph",94),d()(),s(4,"nile-menu",43),u("nile-search-value",function(o){_(e);let a=r(2);return g(a.dashSearch.set((o.detail==null?null:o.detail.value)??""))}),s(5,"nile-menu-item",44),u("click",function(){_(e);let o=r(2);return g(o.openNewDashboard())}),C(6,"nile-glyph",45),c(7),d(),m(8,la,2,0)(9,sa,2,1,"div",46)(10,ua,3,1),d()()}if(i&2){let e=r(2);b("open",e.showRelatedDashboards()),l(4),M("noResultsMessage",e.copy().noResultsMatchFilters),l(3),q(" ",e.copy().newDashboardLabel," "),l(),h(e.dashboardsLoading()?8:e.dashSearchEmpty()?9:10)}}function ha(i,t){if(i&1){let e=k();s(0,"nile-lite-tooltip",48)(1,"button",97),u("click",function(){_(e);let o=r(2);return g(o.openGallery())}),C(2,"nile-glyph",98),d()()}}function Ca(i,t){if(i&1){let e=k();s(0,"header",12)(1,"div",34),m(2,Vo,4,4,"nile-nav-tab-group",35),d(),s(3,"div",36),m(4,Ro,6,3,"span",37),m(5,Qo,7,3,"nile-dropdown",38),s(6,"nile-dropdown",39),u("nile-hide",function(){_(e);let o=r();return g(o.showConversationPicker.set(!1))}),s(7,"nile-lite-tooltip",40)(8,"button",41),u("click",function(){_(e);let o=r();return g(o.showConversationPicker.set(!o.showConversationPicker()))}),C(9,"nile-glyph",42),d()(),s(10,"nile-menu",43),u("nile-search-value",function(o){_(e);let a=r();return g(a.convSearch.set((o.detail==null?null:o.detail.value)??""))}),s(11,"nile-menu-item",44),u("click",function(){_(e);let o=r();return g(o.newConversation())}),C(12,"nile-glyph",45),c(13),d(),m(14,Jo,2,0)(15,Zo,2,1,"div",46)(16,aa,3,1),d()(),m(17,ma,11,4,"nile-dropdown",47),m(18,ha,3,0,"nile-lite-tooltip",48),d()()}if(i&2){let e,n=r();l(2),h(n.tabsVisible()?2:-1),l(2),h((e=n.features().connections&&n.selectedScope())?4:-1,e),l(),h(n.features().scopePicker.enabled?5:-1),l(),b("open",n.showConversationPicker()),l(2),b("disabled",n.isStreaming()),l(2),M("noResultsMessage",n.copy().noResultsMatchFilters),l(3),q(" ",n.copy().newConversationLabel," "),l(),h(n.conversationsLoading()?14:n.convSearchEmpty()?15:16),l(3),h(n.features().dashboardsMenu?17:-1),l(),h(n.features().promptGallery?18:-1)}}function fa(i,t){if(i&1){let e=k();s(0,"button",112),u("click",function(){let o=_(e).$implicit,a=r(4);return g(a.selectWidgetTemplateCategory(o.key))}),c(1),s(2,"span",113),c(3),d()()}if(i&2){let e=t.$implicit,n=r(4);W("aq-picker-chip--active",n.widgetTemplateActiveCategory()===e.key),l(),q("",e.label," "),l(2),y(n.widgetTemplateCountForCategory(e.key))}}function xa(i,t){if(i&1){let e=k();s(0,"div",110)(1,"button",112),u("click",function(){_(e);let o=r(3);return g(o.selectWidgetTemplateCategory("all"))}),c(2),s(3,"span",113),c(4),d()(),F(5,fa,4,4,"button",114,de),d()}if(i&2){let e=r(3);l(),W("aq-picker-chip--active",e.widgetTemplateActiveCategory()==="all"),l(),q("",e.copy().libraryAllCategoryLabel," "),l(2),y(e.widgetTemplateAllTemplates().length),l(),O(e.templateCategories())}}function ya(i,t){if(i&1&&C(0,"nile-skeleton-loader",116),i&2){let e=t.$implicit;Z("width",e,"px")}}function ba(i,t){if(i&1&&(s(0,"div",111),F(1,ya,1,2,"nile-skeleton-loader",115,G),d()),i&2){let e=r(3);l(),O(e.libraryChipSkeletonWidths)}}function va(i,t){if(i&1){let e=k();s(0,"nile-input",108),u("nile-input",function(o){_(e);let a=r(2);return g(a.librarySearch.set((o.detail==null?null:o.detail.value)??""))})("nile-change",function(o){_(e);let a=r(2);return g(a.librarySearch.set((o.detail==null?null:o.detail.value)??""))}),C(1,"nile-glyph",109),d(),m(2,xa,7,4,"div",110)(3,ba,3,0,"div",111)}if(i&2){let e=r(2);b("placeholder",e.copy().librarySearchWidgetsPlaceholder)("value",e.librarySearch()),l(2),h(!e.templateCategoriesLoading()&&!e.widgetTemplateTemplatesLoading()?2:3)}}function wa(i,t){if(i&1){let e=k();s(0,"button",112),u("click",function(){let o=_(e).$implicit,a=r(4);return g(a.selectTemplateCategory(o.key))}),c(1),s(2,"span",113),c(3),d()()}if(i&2){let e=t.$implicit,n=r(4);W("aq-picker-chip--active",n.templateActiveCategory()===e.key),l(),q("",e.label," "),l(2),y(n.templateCountForCategory(e.key))}}function ka(i,t){if(i&1){let e=k();s(0,"div",110)(1,"button",112),u("click",function(){_(e);let o=r(3);return g(o.selectTemplateCategory("all"))}),c(2),s(3,"span",113),c(4),d()(),F(5,wa,4,4,"button",114,de),d()}if(i&2){let e=r(3);l(),W("aq-picker-chip--active",e.templateActiveCategory()==="all"),l(),q("",e.copy().libraryAllCategoryLabel," "),l(2),y(e.templateAllTemplates().length),l(),O(e.templateCategories())}}function Pa(i,t){if(i&1&&C(0,"nile-skeleton-loader",116),i&2){let e=t.$implicit;Z("width",e,"px")}}function Aa(i,t){if(i&1&&(s(0,"div",111),F(1,Pa,1,2,"nile-skeleton-loader",115,G),d()),i&2){let e=r(3);l(),O(e.libraryChipSkeletonWidths)}}function Ma(i,t){if(i&1){let e=k();s(0,"nile-input",108),u("nile-input",function(o){_(e);let a=r(2);return g(a.librarySearch.set((o.detail==null?null:o.detail.value)??""))})("nile-change",function(o){_(e);let a=r(2);return g(a.librarySearch.set((o.detail==null?null:o.detail.value)??""))}),C(1,"nile-glyph",109),d(),m(2,ka,7,4,"div",110)(3,Aa,3,0,"div",111)}if(i&2){let e=r(2);b("placeholder",e.copy().librarySearchDashboardsPlaceholder)("value",e.librarySearch()),l(2),h(e.templateCategoriesLoading()?3:2)}}function Sa(i,t){if(i&1&&(s(0,"div",123),C(1,"nile-skeleton-loader",124)(2,"nile-skeleton-loader",125)(3,"nile-skeleton-loader",126)(4,"nile-skeleton-loader",127),d()),i&2){let e=t.$implicit;l(),M("width",e)}}function Ta(i,t){if(i&1&&(s(0,"div",118)(1,"div",119),C(2,"nile-skeleton-loader",120)(3,"nile-skeleton-loader",121),d(),s(4,"div",122),F(5,Sa,5,1,"div",123,G),d()()),i&2){let e=t.$implicit;l(5),O(e)}}function qa(i,t){if(i&1&&(s(0,"div",117),F(1,Ta,7,0,"div",118,G),d()),i&2){let e=r(3);l(),O(e.librarySkeletonGroups)}}function Da(i,t){if(i&1){let e=k();s(0,"div",132),u("click",function(){let o=_(e).$implicit,a=r(6);return g(a.openWidgetDetailFromCard(o.templateId))}),C(1,"nile-kpi-chart",133),s(2,"button",134),u("click",function(o){let a=_(e).$implicit,p=r(6);return o.stopPropagation(),g(p.toggleWidgetTemplateSelection(a.templateId))}),C(3,"nile-glyph",135),d()()}if(i&2){let e=t.$implicit,n=r(6);W("aq-lib-card-wrap--selected",n.widgetTemplatePickerSelectedIds().includes(e.templateId)),l(),b("label",e.title)("description",e.desc??"")("value",e.value)("loading",e.loading)("sparkline",e.sparkline)("options",n.libraryKpiChartOptions)("sparklineColor",n.brandSparklineColor()),l(),W("aq-lib-card__check--on",n.widgetTemplatePickerSelectedIds().includes(e.templateId))}}function Fa(i,t){if(i&1){let e=k();s(0,"div",118)(1,"div",119)(2,"span",129),c(3),d(),s(4,"button",130),u("click",function(){let o=_(e).$implicit,a=r(5);return g(a.toggleLibraryGroupSelection(o.cards))}),c(5),d()(),s(6,"div",122),F(7,Da,4,11,"div",131,Ao),d()()}if(i&2){let e=t.$implicit,n=r(5);l(3),Y("",e.label," \xB7 ",e.cards.length),l(2),q(" ",n.isGroupFullySelected(e.cards)?n.copy().libraryClearSelectionButton:n.copy().librarySelectAllButton," "),l(2),O(e.cards)}}function Oa(i,t){if(i&1&&F(0,Fa,9,3,"div",118,de),i&2){let e=r(4);O(e.libraryWidgetGroups())}}function Ea(i,t){if(i&1&&(s(0,"div",128),c(1),d()),i&2){let e=r(4);l(),y(e.librarySearch()?e.copy().noWidgetsMatch:e.copy().noWidgetsInCategory)}}function Ia(i,t){if(i&1&&m(0,Oa,2,0)(1,Ea,2,1,"div",128),i&2){let e=r(3);h(e.libraryWidgetGroups().length?0:1)}}function Va(i,t){if(i&1&&m(0,qa,3,0,"div",117)(1,Ia,2,1),i&2){let e=r(2);h(e.templateCategoriesLoading()||e.widgetTemplateTemplatesLoading()?0:1)}}function Ra(i,t){if(i&1&&(s(0,"div",137),C(1,"nile-skeleton-loader",138),s(2,"div",139),C(3,"nile-skeleton-loader",124)(4,"nile-skeleton-loader",126)(5,"nile-skeleton-loader",140),d()()),i&2){let e=t.$implicit;l(3),M("width",e)}}function za(i,t){if(i&1&&(s(0,"div",118)(1,"div",119),C(2,"nile-skeleton-loader",120),d(),s(3,"div",136),F(4,Ra,6,1,"div",137,G),d()()),i&2){let e=t.$implicit;l(4),O(e)}}function Na(i,t){if(i&1&&(s(0,"div",117),F(1,za,6,0,"div",118,G),d()),i&2){let e=r(3);l(),O(e.librarySkeletonGroups)}}function La(i,t){if(i&1&&(s(0,"div",144),C(1,"db-dash-card-chart",152),d()),i&2){let e=r().$implicit;l(),b("config",e.preview)}}function $a(i,t){i&1&&(s(0,"div",145),C(1,"span",153)(2,"span",154)(3,"span",155)(4,"span",156)(5,"span",157),d())}function Wa(i,t){if(i&1&&(s(0,"span",146),C(1,"nile-glyph",158),c(2),d()),i&2){let e=r().$implicit,n=r(5);l(2),q(" ",n.withCount(n.copy().libraryWidgetCountChip,(e.widgets==null?null:e.widgets.length)??0)," ")}}function Ba(i,t){if(i&1&&(s(0,"div",150),c(1),d()),i&2){let e=r().$implicit;l(),y(e.description)}}function Ua(i,t){if(i&1){let e=k();s(0,"button",142),u("click",function(){let o=_(e).$implicit,a=r(5);return g(a.openWidgetDetailPanelForTemplate(o))}),s(1,"div",143),m(2,La,2,1,"div",144)(3,$a,6,0,"div",145),m(4,Wa,3,1,"span",146),d(),s(5,"div",147)(6,"div",148)(7,"span",149),c(8),d(),m(9,Ba,2,1,"div",150),d(),C(10,"nile-glyph",151),d()()}if(i&2){let e=t.$implicit;l(2),h(e.preview!=null&&e.preview.chart?2:3),l(2),h(e.widgets!=null&&e.widgets.length?4:-1),l(4),y(e.name),l(),h(e.description?9:-1)}}function Ga(i,t){if(i&1&&(s(0,"div",118)(1,"div",119)(2,"span",129),c(3),d()(),s(4,"div",136),F(5,Ua,11,4,"button",141,te),d()()),i&2){let e=t.$implicit;l(3),Y("",e.label," \xB7 ",e.templates.length),l(2),O(e.templates)}}function ja(i,t){if(i&1&&F(0,Ga,7,2,"div",118,de),i&2){let e=r(3);O(e.libraryDashboardGroups())}}function Ha(i,t){if(i&1&&(s(0,"div",128),c(1),d()),i&2){let e=r(3);l(),y(e.librarySearch()?e.copy().noDashboardsMatch:e.copy().noDashboardsInCategory)}}function Ya(i,t){if(i&1&&m(0,Na,3,0,"div",117)(1,ja,2,0)(2,Ha,2,1,"div",128),i&2){let e=r(2);h(e.templateTemplatesLoading()?0:e.libraryDashboardGroups().length?1:2)}}function Ka(i,t){if(i&1){let e=k();s(0,"div",107)(1,"span",159),c(2),d(),s(3,"nile-button",22),u("click",function(){_(e);let o=r(2);return g(o.addSelectedWidgetTemplates())}),C(4,"nile-glyph",160),c(5),d()()}if(i&2){let e=r(2);l(2),q(" ",e.withCount(e.copy().librarySelectedCount,e.widgetTemplatePickerSelectedIds().length)," "),l(3),q(" ",e.withCount(e.copy().libraryAddToCanvasButton,e.widgetTemplatePickerSelectedIds().length)," ")}}function Qa(i,t){if(i&1){let e=k();s(0,"div",13)(1,"div",99)(2,"p",100)(3,"strong",101),c(4),d(),c(5),d(),s(6,"nile-nav-tab-group",102),u("nile-tab-change",function(o){_(e);let a=r();return a.artifactPickerTab.set(o.detail.value),a.widgetTemplatePickerSelectedIds.set([]),g(a.librarySearch.set(""))}),s(7,"nile-nav-tab",103),c(8),s(9,"span",104),c(10),d()(),s(11,"nile-nav-tab",105),c(12),s(13,"span",104),c(14),d()()(),m(15,va,4,3)(16,Ma,4,3),d(),s(17,"div",106),m(18,Va,2,1)(19,Ya,3,1),d(),m(20,Ka,6,2,"div",107),d()}if(i&2){let e=r();l(4),y(e.copy().libraryIntroTitle),l(),q(" ",e.copy().libraryIntro," "),l(),M("value",e.artifactPickerTab()),l(2),y(e.copy().libraryWidgetsTabLabel),l(2),y(e.widgetTemplateAllTemplates().length),l(2),y(e.copy().libraryDashboardsTabLabel),l(2),y(e.templateAllTemplates().length),l(),h(e.artifactPickerTab()==="kpis"?15:16),l(3),h(e.artifactPickerTab()==="kpis"?18:19),l(2),h(e.artifactPickerTab()==="kpis"&&e.widgetTemplatePickerSelectedIds().length?20:-1)}}function Xa(i,t){i&1&&(s(0,"div",182),C(1,"nile-skeleton-loader",183)(2,"nile-skeleton-loader",184),d())}function Ja(i,t){if(i&1&&F(0,Xa,3,0,"div",182,G),i&2){let e=r(2);O(e.cohortCriteriaSkeletonRows)}}function Za(i,t){if(i&1&&(s(0,"p",185),c(1),d()),i&2){let e=r(3);l(),y(e.copy().cohortLogUnavailableMessage)}}function er(i,t){if(i&1){let e=k();s(0,"p",185),c(1),d(),s(2,"nile-button",21),u("click",function(){_(e);let o=r(3);return g(o.retryCohortCriteria())}),c(3),d()}if(i&2){let e=r(3);l(),y(e.copy().cohortCriteriaErrorMessage),l(2),q(" ",e.copy().cohortPreviewRetryButton," ")}}function tr(i,t){i&1&&(s(0,"div",170),m(1,Za,2,1,"p",185)(2,er,4,2),d()),i&2&&(l(),h(t==="unavailable"?1:2))}function nr(i,t){if(i&1){let e=k();s(0,"button",187),u("click",function(){let o=_(e).$implicit,a=r(3);return g(a.selectCohortCriterion(o.id))}),C(1,"span",188),s(2,"span",189),c(3),d()()}if(i&2){let e=t.$implicit,n=r(3);W("is-selected",n.selectedCriterionId()===e.id),M("aria-checked",n.selectedCriterionId()===e.id),l(3),y(e.label)}}function ir(i,t){if(i&1&&F(0,nr,4,4,"button",186,te),i&2){let e=r(2);O(e.cohortCriteria())}}function or(i,t){i&1&&(s(0,"div",191)(1,"span",192),C(2,"nile-skeleton-loader",76),d(),C(3,"nile-skeleton-loader",193)(4,"nile-skeleton-loader",194),d())}function ar(i,t){if(i&1&&(s(0,"div",171),C(1,"nile-skeleton-loader",190),F(2,or,5,0,"div",191,G),d()),i&2){let e=r(2);l(2),O(e.cohortMatchSkeletonRows)}}function rr(i,t){if(i&1&&(s(0,"p",196),c(1),d()),i&2){let e=r(3);l(),y(e.copy().cohortEmptyMatchesMessage)}}function lr(i,t){if(i&1&&(s(0,"p",196),c(1),d()),i&2){let e=r(3);l(),y(e.copy().cohortNamesWithheldMessage)}}function sr(i,t){if(i&1&&(s(0,"span",201),c(1),d()),i&2){let e=r().$implicit;l(),q("",e.daysInState,"d")}}function dr(i,t){if(i&1&&(s(0,"div",198)(1,"span",200),c(2),d(),m(3,sr,2,1,"span",201),d()),i&2){let e=t.$implicit;l(2),y(e.name??"\u2014"),l(),h(e.daysInState!==null&&e.daysInState!==void 0?3:-1)}}function cr(i,t){i&1&&(s(0,"div",202)(1,"span",192),C(2,"nile-skeleton-loader",76),d(),C(3,"nile-skeleton-loader",193)(4,"nile-skeleton-loader",194),d())}function pr(i,t){if(i&1&&F(0,cr,5,0,"div",202,G),i&2){let e=r(4);O(e.cohortMatchSkeletonRows)}}function _r(i,t){if(i&1&&(s(0,"p",199),c(1),d()),i&2){let e=r(4);l(),y(e.cohortMatchesTruncatedNote())}}function gr(i,t){if(i&1&&(s(0,"p",199),c(1),d()),i&2){let e=r(4);l(),y(e.copy().cohortMembersForbiddenMessage)}}function ur(i,t){if(i&1&&(s(0,"p",199),c(1),d()),i&2){let e=r(5);l(),y(e.copy().cohortMembersErrorMessage)}}function mr(i,t){if(i&1){let e=k();s(0,"button",204),u("click",function(){_(e);let o=r(5);return g(o.toggleAllCohortMatches())}),c(1),d()}if(i&2){let e=r(5);b("disabled",e.cohortMembersLoading()),M("aria-expanded",e.cohortMatchesExpanded())("aria-busy",e.cohortMembersLoading()?"true":null),l(),y(e.cohortViewAllLabel())}}function hr(i,t){if(i&1&&(m(0,ur,2,1,"p",199),m(1,mr,2,4,"button",203)),i&2){let e=r(4);h(e.cohortMembersError()==="failed"?0:-1),l(),h(e.cohortHasMoreMatches()?1:-1)}}function Cr(i,t){if(i&1&&(s(0,"div",197),F(1,dr,4,2,"div",198,Mo),m(3,pr,2,0),d(),m(4,_r,2,1,"p",199),m(5,gr,2,1,"p",199)(6,hr,2,2)),i&2){let e=r(3);W("is-expanded",e.cohortMatchesExpanded()),l(),O(e.visibleCohortMatches()),l(2),h(e.cohortMembersLoading()?3:-1),l(),h(e.cohortMatchesExpanded()&&e.cohortMatchesTruncated()?4:-1),l(),h(e.cohortMembersError()==="forbidden"?5:6)}}function fr(i,t){if(i&1&&(s(0,"div",172)(1,"p",195),c(2),d(),m(3,rr,2,1,"p",196)(4,lr,2,1,"p",196)(5,Cr,7,5),d()),i&2){let e=r(2);l(2),y(e.cohortMatchSummary()),l(),h(t.matchCount===0?3:e.cohortNamesWithheld()?4:5)}}function xr(i,t){if(i&1&&(s(0,"p",185),c(1),d()),i&2){let e=r(3);l(),y(e.copy().cohortLogUnavailableMessage)}}function yr(i,t){if(i&1){let e=k();s(0,"nile-button",21),u("click",function(){let o=_(e),a=r(4);return g(a.selectCohortCriterion(o))}),c(1),d()}if(i&2){let e=r(4);l(),q(" ",e.copy().cohortPreviewRetryButton," ")}}function br(i,t){if(i&1&&(s(0,"p",185),c(1),d(),m(2,yr,2,1,"nile-button",205)),i&2){let e,n=r(3);l(),y(n.copy().cohortPreviewErrorMessage),l(),h((e=n.selectedCriterionId())?2:-1,e)}}function vr(i,t){i&1&&(s(0,"div",173),m(1,xr,2,1,"p",185)(2,br,3,2),d()),i&2&&(l(),h(t==="unavailable"?1:2))}function wr(i,t){if(i&1){let e=k();s(0,"div",14)(1,"div",161)(2,"span",162),C(3,"nile-glyph",163),d(),s(4,"span",164),c(5),d()(),s(6,"p",165),c(7),d(),s(8,"div",166)(9,"span",167),c(10,"1"),d(),s(11,"span",168),c(12),d()(),s(13,"div",169),m(14,Ja,2,0)(15,tr,3,1,"div",170)(16,ir,2,0),d(),s(17,"div",166)(18,"span",167),c(19,"2"),d(),s(20,"span",168),c(21),d()(),m(22,ar,4,0,"div",171)(23,fr,6,2,"div",172)(24,vr,3,1,"div",173),C(25,"div",174),s(26,"div",175)(27,"p",176),c(28),d(),s(29,"div",177)(30,"nile-button",178),u("click",function(){_(e);let o=r();return g(o.addCohortToCanvas())}),C(31,"nile-glyph",179),c(32),d(),s(33,"nile-button",180),u("click",function(){_(e);let o=r();return g(o.addCohortToCanvas())}),C(34,"nile-glyph",181),c(35),d()()()()}if(i&2){let e,n,o=r();l(5),y(o.copy().cohortBuilderTitle),l(2),y(o.copy().cohortBuilderSubtitle),l(5),y(o.copy().cohortStep1Label),l(),M("aria-label",o.copy().cohortStep1Label),l(),h(o.cohortCriteriaLoading()&&!o.cohortCriteria().length?14:(e=o.cohortCriteriaError())?15:16,e),l(7),y(o.copy().cohortStep2Label),l(),h(o.cohortPreviewLoading()?22:(n=o.cohortPreview())?23:(n=o.cohortPreviewError())?24:-1,n),l(6),y(o.copy().cohortAddToCanvasDisclaimer),l(2),M("disabled",o.cohortPreview()?null:""),l(2),q(" ",o.copy().cohortPreviewWidgetButton," "),l(),M("disabled",o.cohortPreview()?null:""),l(2),q(" ",o.copy().cohortAddToCanvasButton," ")}}function kr(i,t){i&1&&(s(0,"div",216),C(1,"nile-skeleton-loader",217),s(2,"div",218),C(3,"nile-skeleton-loader",78),d()())}function Pr(i,t){i&1&&(s(0,"div",215),F(1,kr,4,0,"div",216,G),d()),i&2&&(l(),O(_e(0,Po)))}function Ar(i,t){if(i&1&&(s(0,"span",225),c(1),d()),i&2){let e=r().$implicit;l(),y(e.badge)}}function Mr(i,t){if(i&1){let e=k();s(0,"button",222),u("click",function(){let o=_(e).$implicit,a=r(5);return g(a.onWelcomePromptPick(o))}),C(1,"nile-glyph",223),s(2,"span",224),c(3),d(),m(4,Ar,2,1,"span",225),d()}if(i&2){let e=t.$implicit;W("prompt-card--ai",e.tone==="ai"),l(),M("name",e.icon)("color",e.tone==="ai"?"#7a5af8":"var(--ng-colors-text-quaternary-500)"),l(2),y(e.label),l(),h(e.badge?4:-1)}}function Sr(i,t){if(i&1&&(s(0,"div",219),F(1,Mr,5,6,"button",221,Fi),d()),i&2){let e=r(4);l(),O(e.welcomePromptCards())}}function Tr(i,t){if(i&1){let e=k();s(0,"button",227),u("click",function(){_(e);let o=r(5);return g(o.openGallery())}),C(1,"nile-glyph",228),s(2,"span"),c(3),d()()}if(i&2){let e=r(5);l(3),y(e.copy().promptGalleryLabel)}}function qr(i,t){if(i&1){let e=k();s(0,"button",227),u("click",function(){_(e);let o=r(5);return g(o.openXray())}),C(1,"nile-glyph",229),s(2,"span"),c(3),d()()}if(i&2){let e=r(5);l(3),y(e.copy().xrayLabel)}}function Dr(i,t){if(i&1&&(s(0,"div",220),m(1,Tr,4,1,"button",226),m(2,qr,4,1,"button",226),d()),i&2){let e=r(4);l(),h(e.features().promptGallery?1:-1),l(),h(e.features().xray?2:-1)}}function Fr(i,t){if(i&1&&(m(0,Sr,3,0,"div",219),m(1,Dr,3,2,"div",220)),i&2){let e=r(3);h(e.features().welcomePrompts?0:-1),l(),h(e.features().promptGallery||e.features().xray?1:-1)}}function Or(i,t){if(i&1&&(s(0,"div",206)(1,"div",208)(2,"div",209),C(3,"nile-glyph",210),d(),s(4,"h2",211),c(5),d(),s(6,"p",212),c(7),d(),s(8,"div",213),fe(9,214),d(),m(10,Pr,3,1,"div",215)(11,Fr,2,2),d()()),i&2){let e=r(2),n=ce(8);l(5),y(e.copy().welcomeTitle),l(2),y(e.copy().welcomeSubtitle),l(2),b("ngTemplateOutlet",n),l(),h(e.features().welcomePrompts&&!e.welcomePromptCards().length?10:11)}}function Er(i,t){i&1&&(s(0,"div",232),C(1,"nile-skeleton-loader",233),d(),s(2,"div",234),C(3,"nile-skeleton-loader",235)(4,"nile-skeleton-loader",236)(5,"nile-skeleton-loader",237),d(),s(6,"div",232),C(7,"nile-skeleton-loader",238),d(),s(8,"div",234),C(9,"nile-skeleton-loader",239)(10,"nile-skeleton-loader",240),d())}function Ir(i,t){if(i&1&&(s(0,"div",242),C(1,"nile-glyph",246),s(2,"span",247),c(3),d()()),i&2){let e=r(2).$implicit;l(3),y(e.quotedText)}}function Vr(i,t){if(i&1&&(s(0,"span",252),c(1),d()),i&2){let e=r().$implicit;l(),y(e.answer)}}function Rr(i,t){if(i&1&&(s(0,"div",248),C(1,"nile-glyph",249),s(2,"div",250)(3,"span",251),c(4),d(),m(5,Vr,2,1,"span",252),d()()),i&2){let e=t.$implicit;l(4),y(e.title),l(),h(e.answer&&e.answer!=="Use this"?5:-1)}}function zr(i,t){if(i&1&&(s(0,"div",243),F(1,Rr,6,2,"div",248,G),d()),i&2){let e=r(2).$implicit,n=r(4);l(),O(n.answerSummaryRows(e))}}function Nr(i,t){if(i&1&&(s(0,"span",244),c(1),d()),i&2){let e=r(2).$implicit;l(),y(e.text)}}function Lr(i,t){if(i&1&&(s(0,"div",253),C(1,"nile-glyph",254),s(2,"span",255),c(3),d()()),i&2){let e=t.$implicit;l(),M("name",e.contentType.startsWith("image/")?"ng-image-03":"ng-file-06"),l(),M("title",e.name),l(),y(e.name)}}function $r(i,t){if(i&1&&(s(0,"div",245),F(1,Lr,4,3,"div",253,de),d()),i&2){let e=r(2).$implicit;l(),O(e.attachments??_e(0,Se))}}function Wr(i,t){if(i&1&&(s(0,"nile-ai-chat-bubble",241),m(1,Ir,4,1,"div",242),m(2,zr,3,0,"div",243)(3,Nr,2,1,"span",244),m(4,$r,3,1,"div",245),d()),i&2){let e=r().$implicit;b("role","user"),l(),h(e.quotedText?1:-1),l(),h(e.answerSummary?2:3),l(2),h(e.attachments!=null&&e.attachments.length?4:-1)}}function Br(i,t){if(i&1&&C(0,"nile-ai-steps",256),i&2){let e=r(2).$implicit;b("steps",e.tools)}}function Ur(i,t){if(i&1&&C(0,"nile-ai-token-stream",265),i&2){let e=r(4).$implicit,n=r(4);b("text",n.cleanText(e.text))("speedMs",n.streamSpeed)}}function Gr(i,t){if(i&1&&C(0,"nile-markdown",266),i&2){let e=r(4).$implicit,n=r(4);b("value",n.cleanMarkdown(e.text))}}function jr(i,t){if(i&1&&m(0,Ur,1,2,"nile-ai-token-stream",265)(1,Gr,1,1,"nile-markdown",266),i&2){let e=r(3).$implicit;h(e.isStreaming?0:1)}}function Hr(i,t){if(i&1&&(s(0,"span",267),c(1),d()),i&2){let e=r().$implicit;l(),Y("Setup ",e.step.current," of ",e.step.total)}}function Yr(i,t){i&1&&(s(0,"span",276),c(1),d()),i&2&&(l(),y(t))}function Kr(i,t){if(i&1&&(s(0,"span",278),c(1),d()),i&2){let e=r().$implicit;l(),y(e.hint)}}function Qr(i,t){if(i&1&&(s(0,"span"),c(1),d()),i&2){let e=r().$implicit;at("choice-card__chip"+(e.tone?" choice-card__chip--"+e.tone:"")),l(),y(e.text)}}function Xr(i,t){if(i&1&&m(0,Qr,2,3,"span",280),i&2){let e=t.$implicit;h(e.tone!=="green"&&e.tone!=="yellow"&&e.tone!=="red"?0:-1)}}function Jr(i,t){if(i&1&&(s(0,"span",279),F(1,Xr,1,1,null,null,G),d()),i&2){let e=r().$implicit;l(),O(e.meta)}}function Zr(i,t){if(i&1&&(s(0,"nile-radio",272)(1,"span",273)(2,"span",274),c(3),d(),s(4,"span",275),m(5,Yr,2,1,"span",276),s(6,"span",277),c(7),d(),m(8,Kr,2,1,"span",278),m(9,Jr,3,0,"span",279),d()()()),i&2){let e,n=t.$implicit,o=t.$index,a=t.$index,p=r(2).$implicit,x=r(3).$implicit,v=r(4);W("choice-card--chosen",(p.selected||p.draftSelection)===n.id)("choice-card--locked",!!p.selected||v.isStreaming()),M("name","choice-"+x.id+"-"+o)("value",n.id)("checked",(p.selected||p.draftSelection)===n.id?"":null)("disabled",p.selected||v.isStreaming()?"":null),l(3),y(a+1),l(2),h((e=v.optionBadgeText(n))?5:-1,e),l(2),y(v.optionPrimaryText(n)),l(),h(!v.optionBadgeText(n)&&n.hint?8:-1),l(),h(n.meta!=null&&n.meta.length?9:-1)}}function el(i,t){if(i&1){let e=k();s(0,"nile-radio-group",270),u("nile-change",function(o){_(e);let a=r().$implicit,p=r(3).$implicit,x=r(4);return g(x.onChoiceChange(p,a,o.detail.value))}),F(1,Zr,10,13,"nile-radio",271,te),d()}if(i&2){let e=r(),n=e.$implicit,o=e.$index,a=r(3).$implicit,p=r(4);M("label",n.prompt||"Choose an index")("name","choice-"+a.id+"-"+o)("value",n.selected||n.draftSelection||null)("disabled",n.selected||p.isStreaming()?"":null),l(),O(n.options)}}function tl(i,t){if(i&1&&(s(0,"p",269),c(1),d()),i&2){let e=r(8);l(),y(e.copy().noChoiceOptions)}}function nl(i,t){if(i&1&&c(0),i&2){let e=r(3).$implicit;q(" \u2713 Something else: ",e.chatDraftText," (edit) ")}}function il(i,t){if(i&1&&(C(0,"nile-glyph",286),c(1)),i&2){let e=r(10);l(),q(" ",e.copy().somethingElseButton," ")}}function ol(i,t){if(i&1){let e=k();s(0,"button",283),u("click",function(){_(e);let o=r(3).$implicit,a=r(3).$implicit,p=r(4);return g(p.requestPlan(a,o))}),c(1),d()}if(i&2){let e=r(10);b("disabled",e.isStreaming()),l(),q(" ",e.copy().givePlanButton," ")}}function al(i,t){if(i&1){let e=k();s(0,"button",287),u("click",function(){_(e);let o=r(3).$implicit,a=r(3).$implicit,p=r(4);return g(p.previewWidget(a,o))}),C(1,"nile-glyph",288),c(2),d()}if(i&2){let e=r(3).$implicit,n=r(7);b("disabled",n.isStreaming()),l(2),q(' Preview "',n.choiceTitle(e),'" ')}}function rl(i,t){if(i&1){let e=k();s(0,"div",281)(1,"button",283),u("click",function(){_(e);let o=r(2).$implicit,a=r(3).$implicit,p=r(4);return g(p.openChatDraft(a,o))}),m(2,nl,1,1)(3,il,2,1),d(),m(4,ol,2,2,"button",284),m(5,al,3,2,"button",285),d()}if(i&2){let e=r(2).$implicit,n=r(7);l(),b("disabled",n.isStreaming()),l(),h(e.chatDraftText!=null&&e.chatDraftText.trim()?2:3),l(2),h(e.kind==="clarification"?4:-1),l(),h(e.kind==="widget_plan"?5:-1)}}function ll(i,t){if(i&1){let e=k();s(0,"div",282)(1,"span",289),c(2,"Something else"),d(),s(3,"div",290)(4,"nile-input",291),u("nile-input",function(o){_(e);let a=r(2).$implicit,p=r(3).$implicit,x=r(4);return g(x.onChatDraftTextChange(p,a,o.detail.value))})("keydown.enter",function(){_(e);let o=r(2).$implicit,a=r(3).$implicit,p=r(4);return g(p.defineChatDraft(a,o))}),d(),s(5,"nile-button",22),u("click",function(){_(e);let o=r(2).$implicit,a=r(3).$implicit,p=r(4);return g(p.defineChatDraft(a,o))}),c(6),d()()()}if(i&2){let e=r(2).$implicit,n=r(7);l(4),b("value",e.chatDraftText??""),M("placeholder",e.kind==="widget_clarification"?n.copy().chatDraftPlaceholderWidget:e.kind==="widget_plan"?n.copy().chatDraftPlaceholderPlan:e.kind==="plan_intake"?n.copy().chatDraftPlaceholderIntake:n.copy().chatDraftPlaceholderClarification)("disabled",n.isStreaming()?"":null),l(),M("disabled",!(e.chatDraftText!=null&&e.chatDraftText.trim())||n.isStreaming()?"":null),l(),q(" ",n.copy().defineItButton," ")}}function sl(i,t){if(i&1&&m(0,rl,6,4,"div",281)(1,ll,7,5,"div",282),i&2){let e=r().$implicit;h(e.chatOpen?1:0)}}function dl(i,t){if(i&1&&(s(0,"div",259),m(1,Hr,2,2,"span",267),m(2,el,3,4,"nile-radio-group",268)(3,tl,2,1,"p",269),m(4,sl,2,1),d()),i&2){let e=t.$implicit;l(),h(e.step?1:-1),l(),h(e.options.length?2:3),l(2),h((e.kind==="widget_clarification"||e.kind==="clarification"||e.kind==="widget_plan"||e.kind==="plan_intake")&&!e.selected&&e.options.length?4:-1)}}function cl(i,t){if(i&1){let e=k();s(0,"button",292),u("click",function(){_(e);let o=r(3).$implicit,a=r(4);return g(a.resumeChoicePanel(o))}),c(1),d()}if(i&2){let e=r(3).$implicit,n=r(4);l(),Y(" ",n.panelAnsweredCount(e.choices??_e(2,Se))," of ",(e.choices??_e(3,Se)).length," answered \u2014 Resume ")}}function pl(i,t){i&1&&(s(0,"span",294),C(1,"span",300),c(2,"Live "),d())}function _l(i,t){i&1&&(s(0,"span",295),c(1,"Preview"),d())}function gl(i,t){i&1&&C(0,"div",303)}function ul(i,t){if(i&1&&C(0,"nile-glyph",307),i&2){let e=r().$implicit;Z("color",e.color),b("name",e.glyph)("method",e.method||"stroke")}}function ml(i,t){if(i&1){let e=k();m(0,gl,1,0,"div",303),s(1,"nile-menu-item",304),u("click",function(){let o=_(e).$implicit;r();let a=ce(1),p=r(4).$implicit;return r(4).onInlineWidgetMenuItem(p,o),g(a.hide())}),s(2,"span",305),m(3,ul,1,4,"nile-glyph",306),c(4),d()()}if(i&2){let e=t.$implicit;h(e.divider?0:-1),l(3),h(e.glyph?3:-1),l(),q(" ",e.label," ")}}function hl(i,t){if(i&1&&(s(0,"nile-dropdown",296,4)(2,"button",301),C(3,"nile-glyph",302),d(),s(4,"nile-menu"),F(5,ml,5,3,null,null,de),d()()),i&2){let e=r(4).$implicit,n=r(4);l(5),O(n.inlineWidgetMenuItems(e))}}function Cl(i,t){i&1&&(s(0,"div",311),C(1,"nile-spinner",314),s(2,"span"),c(3,"Loading chart types\u2026"),d()())}function fl(i,t){if(i&1&&(s(0,"p",312),c(1),d()),i&2){let e=r(9);l(),y(e.copy().noChartTypesFit)}}function xl(i,t){i&1&&C(0,"nile-spinner",314)}function yl(i,t){if(i&1&&C(0,"nile-glyph",319),i&2){let e=r().$implicit,n=r(11);b("name",n.chartTypeIcon(e.type))}}function bl(i,t){if(i&1){let e=k();s(0,"button",318),u("click",function(){let o=_(e).$implicit,a=r(11);return g(a.selectInlineChartType(o.component))}),m(1,xl,1,0,"nile-spinner",314)(2,yl,1,1,"nile-glyph",319),s(3,"span"),c(4),d()()}if(i&2){let e=t.$implicit,n=r(11);M("disabled",n.inlineChartTypeApplying()?"":null),l(),h(n.inlineChartTypeApplyingComponent()===e.component?1:2),l(3),y(e.label)}}function vl(i,t){if(i&1&&(s(0,"p",315),c(1,"Recommended"),d(),s(2,"div",316),F(3,bl,5,3,"button",317,Oi),d()),i&2){let e=r(10);l(3),O(e.inlineSensibleChartTypes())}}function wl(i,t){i&1&&C(0,"nile-spinner",314)}function kl(i,t){if(i&1&&C(0,"nile-glyph",319),i&2){let e=r().$implicit,n=r(11);b("name",n.chartTypeIcon(e.type))}}function Pl(i,t){if(i&1){let e=k();s(0,"button",321),u("click",function(){let o=_(e).$implicit,a=r(11);return g(a.selectInlineChartType(o.component))}),m(1,wl,1,0,"nile-spinner",314)(2,kl,1,1,"nile-glyph",319),s(3,"span"),c(4),d()()}if(i&2){let e=t.$implicit,n=r(11);M("disabled",n.inlineChartTypeApplying()?"":null),l(),h(n.inlineChartTypeApplyingComponent()===e.component?1:2),l(3),y(e.label)}}function Al(i,t){if(i&1&&(s(0,"p",315),c(1,"Other types"),d(),s(2,"div",316),F(3,Pl,5,3,"button",320,Oi),d()),i&2){let e=r(10);l(3),O(e.inlineOtherChartTypes())}}function Ml(i,t){if(i&1&&(m(0,vl,5,0),m(1,Al,5,0)),i&2){let e=r(9);h(e.inlineSensibleChartTypes().length>0?0:-1),l(),h(e.inlineOtherChartTypes().length>0?1:-1)}}function Sl(i,t){if(i&1&&(s(0,"p",313),c(1),d()),i&2){let e=r(9);l(),y(e.inlineChartTypeError())}}function Tl(i,t){if(i&1){let e=k();s(0,"nile-dropdown",308),u("nile-hide",function(){_(e);let o=r(8);return g(o.closeInlineChartTypePicker())}),C(1,"span",309),s(2,"div",310),m(3,Cl,4,0,"div",311)(4,fl,2,1,"p",312)(5,Ml,2,2),m(6,Sl,2,1,"p",313),d()()}if(i&2){let e=r(4).$implicit,n=r(4);b("open",n.inlineChartTypePickerFor()===e.charts[0]),l(3),h(n.inlineChartTypeLoading()?3:n.inlineChartTypeOptions().length===0?4:5),l(3),h(n.inlineChartTypeError()?6:-1)}}function ql(i,t){if(i&1){let e=k();s(0,"span",324),c(1),s(2,"button",325),u("click",function(){let o=_(e).$implicit,a=r(6).$implicit,p=r(4);return g(p.removeInlineFilter(a.charts[0],o.id))}),C(3,"nile-glyph",326),d()()}if(i&2){let e=t.$implicit,n=r(6).$implicit,o=r(4);l(),q(" ",o.inlineFilterChipLabel(n.charts[0],e)," "),l(),M("disabled",o.inlineFilterApplying()?"":null)}}function Dl(i,t){if(i&1&&(s(0,"div",323),F(1,ql,4,2,"span",324,te),d()),i&2){let e=r(5).$implicit,n=r(4);l(),O(n.inlineActiveFilters(e.charts[0]))}}function Fl(i,t){i&1&&(s(0,"div",311),C(1,"nile-spinner",314),s(2,"span"),c(3,"Loading filterable fields\u2026"),d()())}function Ol(i,t){if(i&1&&(s(0,"p",313),c(1),d()),i&2){let e=r(9);l(),y(e.inlineFilterFieldsError())}}function El(i,t){if(i&1&&(s(0,"p",312),c(1),d()),i&2){let e=r(9);l(),y(e.copy().noFilterableFields)}}function Il(i,t){if(i&1&&(s(0,"option",329),c(1),d()),i&2){let e=t.$implicit;b("value",e.name),l(),y(e.label)}}function Vl(i,t){if(i&1&&(s(0,"option",329),c(1),d()),i&2){let e=t.$implicit;b("value",e.value),l(),y(e.label)}}function Rl(i,t){i&1&&(s(0,"div",311),C(1,"nile-spinner",330),s(2,"span"),c(3,"Loading values\u2026"),d()())}function zl(i,t){if(i&1){let e=k();s(0,"input",334),u("ngModelChange",function(o){_(e);let a=r(11);return g(a.inlineFilterBuilderValue.set(o))})("keydown.enter",function(){_(e);let o=r(7).$implicit,a=r(4);return g(a.addInlineFilter(o.charts[0]))}),d()}if(i&2){let e=r(11);b("placeholder",e.copy().filterValuePlaceholder)("ngModel",e.inlineFilterBuilderValue())}}function Nl(i,t){if(i&1){let e=k();s(0,"span",336),c(1,"and"),d(),s(2,"input",335),u("ngModelChange",function(o){_(e);let a=r(12);return g(a.inlineFilterBuilderValue2.set(o))}),d()}if(i&2){let e=r(12);l(2),b("ngModel",e.inlineFilterBuilderValue2())}}function Ll(i,t){if(i&1){let e=k();s(0,"input",335),u("ngModelChange",function(o){_(e);let a=r(11);return g(a.inlineFilterBuilderValue.set(o))}),d(),m(1,Nl,3,1)}if(i&2){let e,n=r(7).$implicit,o=r(4);b("ngModel",o.inlineFilterBuilderValue()),l(),h((e=o.inlineFilterSelectedOperator(n.charts[0]))!=null&&e.needsSecondValue?1:-1)}}function $l(i,t){if(i&1){let e=k();s(0,"span",336),c(1,"and"),d(),s(2,"input",338),u("ngModelChange",function(o){_(e);let a=r(12);return g(a.inlineFilterBuilderValue2.set(o))}),d()}if(i&2){let e=r(12);l(2),b("placeholder",e.copy().filterValuePlaceholder)("ngModel",e.inlineFilterBuilderValue2())}}function Wl(i,t){if(i&1){let e=k();s(0,"input",337),u("ngModelChange",function(o){_(e);let a=r(11);return g(a.inlineFilterBuilderValue.set(o))})("keydown.enter",function(){_(e);let o=r(7).$implicit,a=r(4);return g(a.addInlineFilter(o.charts[0]))}),d(),m(1,$l,3,2)}if(i&2){let e,n=r(7).$implicit,o=r(4);b("placeholder",o.copy().filterValuePlaceholder)("ngModel",o.inlineFilterBuilderValue()),l(),h((e=o.inlineFilterSelectedOperator(n.charts[0]))!=null&&e.needsSecondValue?1:-1)}}function Bl(i,t){if(i&1){let e=k();s(0,"label",339)(1,"input",340),u("change",function(){let o=_(e).$implicit,a=r(12);return g(a.toggleInlineFilterMultiValue(o.value))}),d(),s(2,"span"),c(3),d()()}if(i&2){let e=t.$implicit,n=r(12);l(),b("checked",n.inlineFilterBuilderValues().includes(e.value)),l(2),Y("",e.label,"",e.count!=null?" ("+e.count+")":"")}}function Ul(i,t){if(i&1&&(s(0,"div",332),F(1,Bl,4,3,"label",339,nt),d()),i&2){let e=r(11);l(),O(e.inlineFilterValuesFor(e.inlineFilterBuilderFieldId()))}}function Gl(i,t){if(i&1&&(s(0,"option",329),c(1),d()),i&2){let e=t.$implicit;b("value",e.value),l(),Y("",e.label,"",e.count!=null?" ("+e.count+")":"")}}function jl(i,t){if(i&1){let e=k();s(0,"select",328),u("ngModelChange",function(o){_(e);let a=r(11);return g(a.inlineFilterBuilderValue.set(o))}),s(1,"option",341),c(2,"Select\u2026"),d(),F(3,Gl,2,3,"option",329,nt),d()}if(i&2){let e=r(11);b("ngModel",e.inlineFilterBuilderValue()),l(3),O(e.inlineFilterValuesFor(e.inlineFilterBuilderFieldId()))}}function Hl(i,t){if(i&1&&m(0,zl,1,2,"input",331)(1,Ll,2,2)(2,Wl,2,3)(3,Ul,3,0,"div",332)(4,jl,5,1,"select",333),i&2){let e,n=r(6).$implicit,o=r(4);h((e=(e=o.inlineFilterSelectedOperator(n.charts[0]))==null?null:e.valueKind)==="text"?0:e==="date"?1:e==="number"?2:e==="multi-select"?3:e==="select"?4:-1)}}function Yl(i,t){if(i&1&&(s(0,"p",313),c(1),d()),i&2){let e=r(10);l(),y(e.inlineFilterApplyError())}}function Kl(i,t){if(i&1){let e=k();s(0,"div",327)(1,"select",328),u("ngModelChange",function(o){_(e);let a=r(5).$implicit,p=r(4);return g(p.onInlineFilterFieldChange(a.charts[0],o))}),F(2,Il,2,2,"option",329,So),d(),s(4,"select",328),u("ngModelChange",function(o){_(e);let a=r(9);return g(a.onInlineFilterOperatorChange(o))}),F(5,Vl,2,2,"option",329,nt),d(),m(7,Rl,4,0,"div",311)(8,Hl,5,1),s(9,"nile-button",21),u("click",function(){_(e);let o=r(5).$implicit,a=r(4);return g(a.addInlineFilter(o.charts[0]))}),c(10," Add filter "),d()(),m(11,Yl,2,1,"p",313)}if(i&2){let e=r(5).$implicit,n=r(4);l(),b("ngModel",n.inlineFilterBuilderFieldId()),l(),O(n.inlineFilterFields(e.charts[0])),l(2),b("ngModel",n.inlineFilterBuilderOperator()),l(),O(n.inlineFilterOperators(e.charts[0])),l(2),h(n.inlineFilterValuesLoading()?7:8),l(2),M("loading",n.inlineFilterApplying()?"":null)("disabled",n.inlineFilterApplying()?"":null),l(2),h(n.inlineFilterApplyError()?11:-1)}}function Ql(i,t){if(i&1){let e=k();s(0,"nile-dropdown",308),u("nile-hide",function(){_(e);let o=r(8);return g(o.closeInlineFilterBuilder())}),C(1,"span",309),s(2,"div",322)(3,"p",312),c(4,"Filters this preview only \u2014 nothing is saved."),d(),m(5,Dl,3,0,"div",323),m(6,Fl,4,0,"div",311)(7,Ol,2,1,"p",313)(8,El,2,1,"p",312)(9,Kl,12,6),d()()}if(i&2){let e=r(4).$implicit,n=r(4);b("open",n.inlineFilterPickerFor()===e.charts[0]),l(5),h(n.inlineActiveFilters(e.charts[0]).length>0?5:-1),l(),h(n.inlineFilterFieldsLoading()?6:n.inlineFilterFieldsError()?7:n.inlineFilterFields(e.charts[0]).length===0?8:9)}}function Xl(i,t){if(i&1&&(s(0,"span",342)(1,"span",343),c(2),d(),s(3,"span",344),c(4),d()()),i&2){let e=t.$implicit;l(2),q("",e.label,":"),l(2),y(e.value)}}function Jl(i,t){if(i&1&&(s(0,"div",298),F(1,Xl,5,2,"span",342,Fi),d()),i&2){let e=r(4).$implicit;l(),O(e.forecastMeta??_e(0,Se))}}function Zl(i,t){if(i&1){let e=k();s(0,"nile-button",345),u("click",function(){_(e);let o=r(5).$implicit,a=r(4);return g(a.tryAlternatePreview(o.charts[0]))}),c(1),d()}if(i&2){let e=r(5).$implicit,n=r(4);b("disabled",n.isStreaming()),l(),q(' Try "',n.previewAltLabel(e.charts[0]),'" instead ')}}function es(i,t){if(i&1){let e=k();s(0,"nile-button",345),u("click",function(){_(e);let o=r(4).$implicit,a=r(4);return g(a.skipPreview(o.charts[0]))}),c(1," Skip this widget "),d(),m(2,Zl,2,2,"nile-button",346),s(3,"nile-button",347),u("click",function(){_(e);let o=r(4).$implicit,a=r(4);return g(a.acceptPreview(o.charts[0]))}),C(4,"nile-glyph",160),c(5," Add to dashboard "),d()}if(i&2){let e=r(4).$implicit,n=r(4);b("disabled",n.isStreaming()),l(2),h(n.previewAltLabel(e.charts[0])?2:-1),l(),b("disabled",n.isStreaming())}}function ts(i,t){if(i&1&&(s(0,"div",46),c(1),d()),i&2){let e=r(10);l(),y(e.copy().noResultsMatchFilters)}}function ns(i,t){i&1&&fe(0)}function is(i,t){if(i&1){let e=k();s(0,"nile-menu-item",70),u("click",function(){let o=_(e).$implicit,a=r(8).$implicit,p=r(4);return g(p.addInlineToExisting(a.charts,o.id))}),Pe(1,ns,1,0,"ng-container",353),d()}if(i&2){let e=t.$implicit;r(12);let n=ce(40);l(),b("ngTemplateOutlet",n)("ngTemplateOutletContext",rt(2,Di,e))}}function os(i,t){if(i&1&&(s(0,"div",80),c(1),d(),F(2,is,2,4,"nile-menu-item",null,te)),i&2){let e=t.$implicit;l(),y(e.label),l(),O(e.items)}}function as(i,t){if(i&1&&(s(0,"div",46),c(1),d()),i&2){let e=r(11);l(),y(e.copy().noDashboardsYet)}}function rs(i,t){if(i&1&&F(0,os,4,1,null,null,de,!1,as,2,1,"div",46),i&2){let e=r(10);O(e.groupedPickerDashboards())}}function ls(i,t){if(i&1){let e=k();s(0,"nile-dropdown",351),u("nile-hide",function(){_(e);let o=r(9);return g(o.inlinePickerFor.set(null))}),s(1,"nile-button",352),u("click",function(){_(e);let o=r(5).$implicit,a=r(4);return g(a.inlinePickerFor.set(a.inlinePickerFor()===o.id?null:o.id))}),C(2,"nile-glyph",160),c(3),d(),s(4,"nile-menu",43),u("nile-search-value",function(o){_(e);let a=r(9);return g(a.pickerSearch.set((o.detail==null?null:o.detail.value)??""))}),s(5,"nile-menu-item",44),u("click",function(){_(e);let o=r(5).$implicit,a=r(4);return g(a.addInlineWidget(o.charts))}),C(6,"nile-glyph",45),c(7),d(),m(8,ts,2,1,"div",46)(9,rs,3,1),d()()}if(i&2){let e=r(5).$implicit,n=r(4);b("open",n.inlinePickerFor()===e.id),l(),M("loading",n.committingAction()==="add"?"":null)("disabled",n.committingAction()?"":null),l(2),q(" ",n.copy().addToDashboardButton," "),l(),M("noResultsMessage",n.copy().noResultsMatchFilters),l(3),q(" ",n.copy().newDashboardLabel," "),l(),h(n.pickerSearchEmpty()?8:9)}}function ss(i,t){if(i&1){let e=k();s(0,"nile-button",22),u("click",function(){_(e);let o=r(5).$implicit,a=r(4);return g(a.addInlineDefault(o.charts))}),C(1,"nile-glyph",160),c(2),d()}if(i&2){let e=r(9);M("loading",e.committingAction()==="add"?"":null)("disabled",e.committingAction()?"":null),l(2),q(" ",e.builderOpen()?e.copy().addToCurrentDashboardButton:e.copy().addToDashboardButton," ")}}function ds(i,t){if(i&1){let e=k();s(0,"nile-button",21),u("click",function(){_(e);let o=r(4).$implicit,a=r(4);return g(a.addToLibrary(o.charts[0]))}),C(1,"nile-glyph",348),c(2),d(),m(3,ls,10,7,"nile-dropdown",349)(4,ss,3,3,"nile-button",350)}if(i&2){let e=r(8);l(2),q(" ",e.copy().addToLibraryButton," "),l(),h(!e.builderOpen()&&e.conversationDashboards().length>1?3:4)}}function cs(i,t){if(i&1){let e=k();s(0,"div",261)(1,"div")(2,"shared-nile-chart-widget",293),u("aiSend",function(o){_(e);let a=r(7);return g(a.onInlineAiSend(o))}),m(3,pl,3,0,"span",294),m(4,_l,2,0,"span",295),m(5,hl,7,0,"nile-dropdown",296),m(6,Tl,7,3,"nile-dropdown",297),m(7,Ql,10,3,"nile-dropdown",297),d()(),m(8,Jl,3,1,"div",298),s(9,"div",299),m(10,es,6,3)(11,ds,5,2),d()()}if(i&2){let e=r(3).$implicit,n=r(4);l(),at(n.inlineChartClass(e.charts[0])),l(),b("config",n.inlineDisplayConfig(e.charts[0]))("loading",!!e.forecastRecomputing||n.isInlineRecordsLoading(e.charts[0]))("widgetId",e.id)("conversationId",n.activeConversationId()),l(),h(e.forecast?3:-1),l(),h(n.isPreviewChart(e.charts[0])?4:-1),l(),h(n.inlineWidgetMenuItems(e).length?5:-1),l(),h(n.isFilterChart(e.charts[0])?-1:6),l(),h(n.isFilterChart(e.charts[0])?-1:7),l(),h(e.forecastMeta!=null&&e.forecastMeta.length?8:-1),l(2),h(n.isPreviewChart(e.charts[0])?10:11)}}function ps(i,t){i&1&&(s(0,"span",295),c(1,"Preview"),d(),c(2," \xB7 "))}function _s(i,t){if(i&1){let e=k();s(0,"nile-button",345),u("click",function(){_(e);let o=r(5).$implicit,a=r(4);return g(a.tryAlternatePreview(o.charts[0]))}),c(1),d()}if(i&2){let e=r(5).$implicit,n=r(4);b("disabled",n.isStreaming()),l(),q(' Try "',n.previewAltLabel(e.charts[0]),'" instead ')}}function gs(i,t){if(i&1){let e=k();s(0,"div",299)(1,"nile-button",345),u("click",function(){_(e);let o=r(4).$implicit,a=r(4);return g(a.skipPreview(o.charts[0]))}),c(2," Skip this widget "),d(),m(3,_s,2,2,"nile-button",346),s(4,"nile-button",347),u("click",function(){_(e);let o=r(4).$implicit,a=r(4);return g(a.acceptPreview(o.charts[0]))}),C(5,"nile-glyph",160),c(6," Add to dashboard "),d()()}if(i&2){let e=r(4).$implicit,n=r(4);l(),b("disabled",n.isStreaming()),l(2),h(n.previewAltLabel(e.charts[0])?3:-1),l(),b("disabled",n.isStreaming())}}function us(i,t){if(i&1){let e=k();s(0,"div",354),u("click",function(){_(e);let o=r(3).$implicit,a=r(4);return g(a.openArtifact(o.charts,o.id))}),s(1,"div",355),C(2,"nile-glyph",356),d(),s(3,"div",357)(4,"span",358),c(5),d(),s(6,"span",359),m(7,ps,3,0),c(8),d()(),s(9,"nile-button",22),u("click",function(o){_(e);let a=r(3).$implicit,p=r(4);return o.stopPropagation(),g(p.openArtifact(a.charts,a.id))}),c(10),C(11,"nile-glyph",360),d()(),m(12,gs,7,3,"div",299)}if(i&2){let e=r(3).$implicit,n=r(4);l(5),y(e.dashboardTitle||e.charts[0].title),l(2),h(n.isPreviewChart(e.charts[0])?7:-1),l(),Y(" Dashboard \xB7 ",e.charts.length," widget",e.charts.length!==1?"s":""," "),l(2),q(" ",n.copy().viewButton," "),l(2),h(e.charts.length===1&&n.isPreviewChart(e.charts[0])?12:-1)}}function ms(i,t){if(i&1){let e=k();s(0,"div",262),C(1,"nile-glyph",361),s(2,"span",362),c(3),d(),s(4,"button",363),u("click",function(){_(e);let o=r(3).$implicit,a=r(4);return g(a.recomputeStoredForecast(o))}),c(5),d()()}if(i&2){let e=r(3).$implicit,n=r(4);l(3),y(n.restoredForecastLabel(e)),l(),b("disabled",n.isStreaming()),l(),q(" ",n.copy().recomputeButton," ")}}function hs(i,t){if(i&1&&C(0,"nile-glyph",366),i&2){let e=r().$implicit;M("name",e.icon)("color",e.tone==="ai"?"#7a5af8":"var(--ng-colors-text-quaternary-500)")}}function Cs(i,t){if(i&1&&(s(0,"span",368),c(1),d()),i&2){let e=r().$implicit;l(),y(e.badge)}}function fs(i,t){if(i&1){let e=k();s(0,"button",365),u("click",function(){let o=_(e).$implicit,a=r(4).$implicit,p=r(4);return g(p.onFollowUp(o,a))}),m(1,hs,1,2,"nile-glyph",366),s(2,"span",367),c(3),d(),m(4,Cs,2,1,"span",368),d()}if(i&2){let e=t.$implicit,n=r(8);W("follow-up--ai",e.tone==="ai"),b("disabled",n.isStreaming()),l(),h(e.icon?1:-1),l(2),y(e.label),l(),h(e.badge?4:-1)}}function xs(i,t){if(i&1&&(s(0,"div",263),F(1,fs,5,6,"button",364,To),d()),i&2){let e=r(3).$implicit;l(),O(e.followUps??_e(0,Se))}}function ys(i,t){if(i&1&&(s(0,"div",264),C(1,"nile-glyph",369),s(2,"span",370),c(3),d()()),i&2){let e=r(7);l(3),y(e.copy().errors.assistantErrorFallback)}}function bs(i,t){if(i&1&&(s(0,"nile-ai-chat-bubble",257)(1,"div",258),m(2,jr,2,1),F(3,dl,5,3,"div",259,G),m(5,cl,2,4,"button",260),m(6,cs,12,13,"div",261)(7,us,13,6),m(8,ms,6,3,"div",262),m(9,xs,3,1,"div",263),m(10,ys,4,1,"div",264),d()()),i&2){let e=r(2).$implicit,n=r(4);b("role","ai")("hideIcon",!0),l(2),h(e.text&&!n.suppressTextFor(e)?2:-1),l(),O(n.nonPanelChoices(e)),l(2),h(n.isMultiChoice(e)&&n.isChoicePanelDismissed(e)&&!n.isChoicePanelComplete(e.choices??_e(8,Se))?5:-1),l(),h(e.charts.length===1&&!n.isDataGrid(e.charts[0])?6:e.charts.length?7:-1),l(2),h(n.isRestoredForecast(e)?8:-1),l(),h(e.followUps!=null&&e.followUps.length?9:-1),l(),h(e.hasError?10:-1)}}function vs(i,t){if(i&1&&(m(0,Br,1,1,"nile-ai-steps",256),m(1,bs,11,9,"nile-ai-chat-bubble",257)),i&2){let e=r().$implicit;h(e.isStreaming&&(e.tools!=null&&e.tools.length)?0:-1),l(),h(e.text||e.charts.length||e.choices!=null&&e.choices.length||e.hasError?1:-1)}}function ws(i,t){if(i&1&&(m(0,Wr,5,4,"nile-ai-chat-bubble",241),m(1,vs,2,2)),i&2){let e=t.$implicit;h(e.role==="user"?0:-1),l(),h(e.role==="assistant"?1:-1)}}function ks(i,t){if(i&1&&F(0,ws,2,2,null,null,te),i&2){let e=r(3);O(e.messages())}}function Ps(i,t){if(i&1&&(s(0,"span",373),c(1),d()),i&2){let e=r(2);l(),Rt("",t," ",e.index+1," OF ",e.choices.length)}}function As(i,t){if(i&1&&(s(0,"span",373),c(1),d()),i&2){let e=r(2);l(),Y("",e.index+1," OF ",e.choices.length)}}function Ms(i,t){i&1&&(s(0,"span",387),c(1),d()),i&2&&(l(),y(t))}function Ss(i,t){if(i&1&&(s(0,"span",389),c(1),d()),i&2){let e=r().$implicit;l(),y(e.hint)}}function Ts(i,t){if(i&1){let e=k();s(0,"nile-radio",383),u("click",function(){_(e);let o=r(2),a=r(4);return g(a.onPanelSkip(o.msg))}),s(1,"span",384)(2,"span",385),c(3),d(),s(4,"span",386),m(5,Ms,2,1,"span",387),s(6,"span",388),c(7),d(),m(8,Ss,2,1,"span",389),d()()()}if(i&2){let e,n=t.$implicit,o=t.$index,a=r(2),p=r(4);M("name","choice-panel-"+a.msg.id+"-"+a.index)("value",n.id)("checked",(a.choices[a.index].draftSelection||a.choices[a.index].selected)===n.id?"":null)("disabled",p.isStreaming()?"":null),l(3),y(o+1),l(2),h((e=p.optionBadgeText(n))?5:-1,e),l(2),y(p.optionPrimaryText(n)),l(),h(!p.optionBadgeText(n)&&n.hint?8:-1)}}function qs(i,t){if(i&1){let e=k();s(0,"button",287),u("click",function(){_(e);let o=r(3),a=r(4);return g(a.previewWidget(o.msg,o.choices[o.index]))}),C(1,"nile-glyph",288),c(2),d()}if(i&2){let e=r(3),n=r(4);b("disabled",n.isStreaming()),l(2),q(' Preview "',n.choiceTitle(e.choices[e.index]),'" ')}}function Ds(i,t){if(i&1){let e=k();s(0,"button",283),u("click",function(){_(e);let o=r(3),a=r(4);return g(a.requestPlan(o.msg,o.choices[o.index]))}),c(1),d()}if(i&2){let e=r(7);b("disabled",e.isStreaming()),l(),q(" ",e.copy().givePlanButton," ")}}function Fs(i,t){if(i&1){let e=k();s(0,"div",281)(1,"button",283),u("click",function(){_(e);let o=r(2),a=r(4);return g(a.openChatDraft(o.msg,o.choices[o.index]))}),C(2,"nile-glyph",286),c(3),d(),m(4,qs,3,2,"button",285),m(5,Ds,2,2,"button",284),s(6,"button",390),u("click",function(){_(e);let o=r(2),a=r(4);return g(a.onPanelSkip(o.msg))}),c(7," Skip "),d()()}if(i&2){let e=r(2),n=r(4);l(),b("disabled",n.isStreaming()),l(2),q(" ",n.copy().somethingElseButton," "),l(),h(e.choices[e.index].kind==="widget_plan"?4:-1),l(),h(e.choices[e.index].kind==="clarification"?5:-1),l(),M("disabled",n.isStreaming()?"":null)}}function Os(i,t){if(i&1){let e=k();s(0,"div",282)(1,"div",290)(2,"nile-input",291),u("nile-input",function(o){_(e);let a=r(2),p=r(4);return g(p.onChatDraftTextChange(a.msg,a.choices[a.index],o.detail.value))})("keydown.enter",function(){_(e);let o=r(2),a=r(4);return g(a.onPanelChatDraftConfirm(o.msg,o.choices[o.index]))}),d(),s(3,"nile-button",22),u("click",function(){_(e);let o=r(2),a=r(4);return g(a.onPanelChatDraftConfirm(o.msg,o.choices[o.index]))}),c(4),d()()()}if(i&2){let e=r(2),n=r(4);l(2),b("value",e.choices[e.index].chatDraftText??""),M("placeholder",n.chatDraftPlaceholderFor(e.choices[e.index]))("disabled",n.isStreaming()?"":null),l(),M("disabled",!(e.choices[e.index].chatDraftText!=null&&e.choices[e.index].chatDraftText.trim())||n.isStreaming()?"":null),l(),q(" ",n.copy().defineItButton," ")}}function Es(i,t){if(i&1){let e=k();s(0,"div",372),m(1,Ps,2,3,"span",373)(2,As,2,2,"span",373),s(3,"div",374)(4,"button",375),u("click",function(){_(e);let o=r(),a=r(4);return g(a.onPanelPrev(o.msg))}),C(5,"nile-glyph",376),d(),s(6,"button",375),u("click",function(){_(e);let o=r(),a=r(4);return g(a.onPanelSkip(o.msg))}),C(7,"nile-glyph",377),d(),s(8,"button",378),u("click",function(){_(e);let o=r(),a=r(4);return g(a.dismissChoicePanel(o.msg))}),C(9,"nile-glyph",379),d()()(),s(10,"nile-radio-group",380),u("nile-change",function(o){_(e);let a=r(),p=r(4);return g(p.onChoiceChange(a.msg,a.choices[a.index],o.detail.value))}),F(11,Ts,9,8,"nile-radio",381,te),d(),m(13,Fs,8,5,"div",281)(14,Os,5,5,"div",282),s(15,"p",382),c(16,"\u2191\u2193 to navigate \xB7 \u21B5 to select \xB7 or type below"),d()}if(i&2){let e,n=r(),o=r(4);l(),h((e=o.panelBadgeLabel(n.choices[n.index]))?1:2,e),l(3),M("disabled",n.index===0?"":null),l(2),M("disabled",o.isStreaming()?"":null),l(4),M("label",n.choices[n.index].prompt||"Choose an option")("name","choice-panel-"+n.msg.id+"-"+n.index)("value",n.choices[n.index].draftSelection||n.choices[n.index].selected||null)("disabled",o.isStreaming()?"":null),l(),O(n.choices[n.index].options),l(2),h(n.choices[n.index].chatOpen?14:13)}}function Is(i,t){if(i&1&&(s(0,"li",392)(1,"span",394),c(2),d(),s(3,"span",395),c(4),d()()),i&2){let e=t.$implicit,n=r(6);l(2),y(n.choiceTitle(e)),l(2),y(n.panelAnswerLabel(e))}}function Vs(i,t){if(i&1){let e=k();s(0,"div",372)(1,"span",373),c(2,"READY TO SUBMIT"),d(),s(3,"button",378),u("click",function(){_(e);let o=r(),a=r(4);return g(a.dismissChoicePanel(o.msg))}),C(4,"nile-glyph",379),d()(),s(5,"ul",391),F(6,Is,5,2,"li",392,G),d(),s(8,"div",393)(9,"button",375),u("click",function(){_(e);let o=r(),a=r(4);return g(a.onPanelPrev(o.msg))}),C(10,"nile-glyph",376),c(11," Back "),d(),s(12,"nile-button",22),u("click",function(){_(e);let o=r(),a=r(4);return g(a.submitChoices(o.msg))}),c(13),d()()}if(i&2){let e=r(),n=r(4);l(6),O(e.choices),l(6),M("disabled",!n.hasPendingDraft(e.msg)||n.isStreaming()?"":null),l(),q(" ",n.copy().submitAnswersButton," ")}}function Rs(i,t){if(i&1&&(s(0,"div",371),m(1,Es,17,8)(2,Vs,14,2),d()),i&2){let e=t;l(),h(e.index<e.choices.length?1:2)}}function zs(i,t){if(i&1&&(s(0,"div",231),m(1,Rs,3,1,"div",371),fe(2,214),d()),i&2){let e,n=r(3),o=ce(8);l(),h((e=n.activeChoicePanel())?1:-1,e),l(),b("ngTemplateOutlet",o)}}function Ns(i,t){if(i&1){let e=k();s(0,"nile-ai-chat",230,3),u("mouseup",function(o){_(e);let a=r(2);return g(a.onThreadMouseUp(o))}),m(2,Er,11,0)(3,ks,2,0),m(4,zs,3,2,"div",231),d()}if(i&2){let e=r(2);l(2),h(e.loadingConversation()?2:3),l(2),h(e.messages().length?4:-1)}}function Ls(i,t){if(i&1&&m(0,Or,12,4,"div",206)(1,Ns,5,2,"nile-ai-chat",207),i&2){let e=r();h(!e.loadingConversation()&&!e.messages().length?0:1)}}function $s(i,t){if(i&1&&(s(0,"div",397),C(1,"nile-glyph",404),s(2,"span"),c(3),d()()),i&2){let e=r(2);l(3),y(e.copy().dropFilesOverlay)}}function Ws(i,t){if(i&1){let e=k();s(0,"div",398),C(1,"nile-glyph",33),s(2,"span",405),c(3),d(),s(4,"button",406),u("click",function(){_(e);let o=r(2);return g(o.clearReplyQuote())}),C(5,"nile-glyph",407),d()()}i&2&&(l(3),y(t))}function Bs(i,t){i&1&&C(0,"nile-spinner",410)}function Us(i,t){if(i&1){let e=k();s(0,"button",413),u("click",function(){_(e);let o=r().$implicit,a=r(3);return g(a.retryAttachment(o.id))}),c(1,"Retry"),d()}}function Gs(i,t){if(i&1){let e=k();s(0,"div",409),C(1,"nile-glyph",254),s(2,"span",255),c(3),d(),m(4,Bs,1,0,"nile-spinner",410)(5,Us,2,0,"button",411),s(6,"button",412),u("click",function(){let o=_(e).$implicit,a=r(3);return g(a.removeAttachment(o.id))}),C(7,"nile-glyph",407),d()()}if(i&2){let e=t.$implicit;W("aq-chip--error",e.status==="error"),l(),M("name",e.contentType.startsWith("image/")?"ng-image-03":"ng-file-06"),l(),M("title",e.name),l(),y(e.name),l(),h(e.status==="uploading"?4:e.status==="error"?5:-1)}}function js(i,t){if(i&1&&(s(0,"div",399),F(1,Gs,8,6,"div",408,te),d()),i&2){let e=r(2);l(),O(e.attachments())}}function Hs(i,t){if(i&1){let e=k();s(0,"nile-button",414),u("click",function(){_(e),r();let o=ce(5);return g(o.click())}),C(1,"nile-glyph",415),d()}if(i&2){let e=r(2);M("disabled",e.isStreaming()||e.attachAtCapacity()?"":null)}}function Ys(i,t){if(i&1){let e=k();s(0,"div",396),u("dragenter",function(o){_(e);let a=r();return g(a.onComposerDragEnter(o))})("dragover",function(o){_(e);let a=r();return g(a.onComposerDragOver(o))})("dragleave",function(o){_(e);let a=r();return g(a.onComposerDragLeave(o))})("drop",function(o){_(e);let a=r();return g(a.onComposerDrop(o))}),m(1,$s,4,1,"div",397),m(2,Ws,6,1,"div",398),m(3,js,3,0,"div",399),s(4,"input",400,5),u("change",function(o){_(e);let a=r();return g(a.onFilesPicked(o))}),d(),s(6,"nile-ai-prompt",401,6),u("keydown",function(o){_(e);let a=r();return g(a.onComposerKeydown(o))})("nile-change",function(o){_(e);let a=r();return g(a.inputText.set((o.detail==null?null:o.detail.value)??""))})("nile-submit",function(o){_(e);let a=r();return g(a.onComposerSubmit(o.detail==null?null:o.detail.value))})("nile-stop",function(){_(e);let o=r();return g(o.stopStream())}),s(8,"div",402),u("click",function(o){return o.stopPropagation()}),m(9,Hs,2,1,"nile-button",403),d()()()}if(i&2){let e,n=r();W("aq-composer-wrap--dragover",n.isDraggingFile()),l(),h(n.features().attachments&&n.isDraggingFile()?1:-1),l(),h((e=n.replyQuote())?2:-1,e),l(),h(n.features().attachments&&n.attachments().length?3:-1),l(),M("accept",n.acceptUploadTypes),l(2),W("aq-attach-full",n.attachAtCapacity()),b("placeholder",n.copy().composerPlaceholder)("hideModel",!0)("hideAddContext",!0)("rows",1)("speechLang","en-US")("value",n.inputText())("loading",n.isStreaming()),l(3),h(n.features().attachments?9:-1)}}function Ks(i,t){if(i&1){let e=k();s(0,"div",416),u("pointerdown",function(o){_(e);let a=r();return g(a.startChatResize(o))}),d()}if(i&2){let e=r();W("is-active",e.isResizing())}}function Qs(i,t){if(i&1){let e=k();s(0,"div",432),C(1,"nile-glyph",433),s(2,"nile-slide-toggle",434),u("nile-change",function(o){_(e);let a=r(3);return g(a.onFiltersToggle(o.detail.checked))}),d()()}if(i&2){let e=r(3);W("aq-filters-pill--active",e.artifactHasFilter()),l(2),b("isChecked",e.artifactHasFilter())}}function Xs(i,t){if(i&1){let e=k();s(0,"div",428)(1,"nile-button",435),u("click",function(){_(e);let o=r(3);return g(o.undoCanvas())}),C(2,"nile-glyph",436),c(3," Undo "),d(),s(4,"nile-button",437),u("click",function(){_(e);let o=r(3);return g(o.redoCanvas())}),C(5,"nile-glyph",438),d()()}if(i&2){let e=r(3);l(),M("disabled",e.canUndoCanvas()?null:""),l(3),M("disabled",e.canRedoCanvas()?null:""),l(),M("color",e.canRedoCanvas()?"var(--ng-colors-text-secondary-700)":"var(--ng-colors-text-placeholder-subtle)")}}function Js(i,t){if(i&1){let e=k();s(0,"div",418)(1,"div",423)(2,"span",424),c(3,"Preview"),d(),s(4,"span",425),c(5),d()(),s(6,"div",426),m(7,Qs,3,3,"div",427),m(8,Xs,6,3,"div",428),C(9,"span",429),s(10,"nile-button",430),u("click",function(){_(e);let o=r(2);return g(o.closeArtifact())}),C(11,"nile-glyph",431),d()()()}if(i&2){let e=r(2);l(5),y(e.artifactSubtitle()),l(2),h(e.features().canvas.filters?7:-1),l(),h(e.features().canvas.undoRedo?8:-1)}}function Zs(i,t){if(i&1&&(s(0,"div",420),C(1,"nile-glyph",439),s(2,"p",440),c(3),d(),s(4,"p",441),c(5),d()()),i&2){let e=r(2);l(3),y(e.copy().emptyCanvasTitle),l(2),y(e.copy().emptyCanvasSubtitle)}}function ed(i,t){if(i&1){let e=k();s(0,"shared-dashboard-grid",442,7),u("selectionChange",function(o){_(e);let a=r(2);return g(a.onSelectionChange(o))})("forecast",function(o){_(e);let a=r(2);return g(a.onArtifactForecast(o))})("setAlert",function(o){_(e);let a=r(2);return g(a.onSetAlert(o))})("filterSubmit",function(o){_(e);let a=r(2);return g(a.onArtifactFilterSubmit(o))})("filterChange",function(o){_(e);let a=r(2);return g(a.onArtifactFilterChange(o))})("dslWidgetUpdated",function(o){_(e);let a=r(2);return g(a.onDslWidgetUpdated(o))})("dslEditorClosed",function(){_(e);let o=r(2);return g(o.onArtifactDslEditorClosed())})("widgetClick",function(o){_(e);let a=r(2);return g(a.onKpiWidgetClicked(o))})("aiSend",function(o){_(e);let a=r(2);return g(a.onArtifactAiSend(o))}),d()}if(i&2){let e=r(2);b("widgets",e.artifactWidgets())("filtersEnabled",!!e.builderDashboardId())("conversationId",e.activeConversationId())("editMode",!1)("selectable",e.features().canvas.widgetSelection)("canSetAlert",!0)("canAddToStory",e.widgetMenu().addToStory)("canForecast",!0)("showWidgetMenu",e.widgetMenu().enabled)("canAsk",e.widgetMenu().ask)("canChangeChartType",e.widgetMenu().changeChartType)("canManageFilters",e.widgetMenu().manageFilters)("canCustomizeColors",e.widgetMenu().customizeColors)("canViewChartData",e.widgetMenu().chartData)("canExportPng",e.widgetMenu().exportPng)("canExportCsv",e.widgetMenu().exportCsv)("canPrint",e.widgetMenu().print)("forecastable",e.artifactForecastable())("forecastingWidgetId",e.artifactForecastingId())("showEditDslInViewMode",!0)("widgetsLoading",e.applyingFilters())("dashboardFilters",e.activeDashboardFilters())("resolvedFilters",e.activeResolvedFilters())("applySummary",e.applySummary())("filterExplanation",e.filterExplanation())("detailPanel",!0)("detailRootLabel","Canvas")}}function td(i,t){if(i&1){let e=k();s(0,"nile-button",21),u("click",function(){let o=_(e),a=r(3);return g(a.forecastFromChart(o))}),C(1,"nile-glyph",444),c(2),d()}if(i&2){let e=r(3);l(2),q(" ",e.copy().forecastButton," ")}}function nd(i,t){if(i&1){let e=k();s(0,"nile-button",21),u("click",function(){_(e);let o=r(3);return g(o.openStoryPicker())}),C(1,"nile-glyph",445),c(2),d()}if(i&2){let e=r(3);M("disabled",e.committingAction()||!e.hasSelection()?"":null),l(2),q(" ",e.copy().addToStoryButton," ")}}function id(i,t){if(i&1){let e=k();s(0,"nile-button",21),u("click",function(){_(e);let o=r(3);return g(o.publishAsNewDashboard())}),c(1),d()}if(i&2){let e=r(3);M("loading",e.committingAction()==="publish"?"":null)("disabled",e.committingAction()||!e.hasSelection()?"":null),l(),q(" ",e.copy().publishAsDashboardButton," ")}}function od(i,t){}function ad(i,t){if(i&1&&(s(0,"div",46),c(1),d()),i&2){let e=r(4);l(),y(e.copy().noResultsMatchFilters)}}function rd(i,t){i&1&&fe(0)}function ld(i,t){if(i&1){let e=k();s(0,"nile-menu-item",70),u("click",function(){let o=_(e).$implicit,a=r(6);return a.showAddPicker.set(!1),g(a.addToExistingDashboard(o.id))}),Pe(1,rd,1,0,"ng-container",353),d()}if(i&2){let e=t.$implicit;r(6);let n=ce(40);l(),b("ngTemplateOutlet",n)("ngTemplateOutletContext",rt(2,Di,e))}}function sd(i,t){if(i&1&&(s(0,"div",80),c(1),d(),F(2,ld,2,4,"nile-menu-item",null,te)),i&2){let e=t.$implicit;l(),y(e.label),l(),O(e.items)}}function dd(i,t){if(i&1&&(s(0,"div",46),c(1),d()),i&2){let e=r(5);l(),y(e.copy().noDashboardsYet)}}function cd(i,t){if(i&1&&F(0,sd,4,1,null,null,de,!1,dd,2,1,"div",46),i&2){let e=r(4);O(e.groupedPickerDashboards())}}function pd(i,t){if(i&1){let e=k();s(0,"nile-dropdown",446),u("nile-hide",function(){_(e);let o=r(3);return g(o.showAddPicker.set(!1))}),s(1,"nile-button",352),u("click",function(){_(e);let o=r(3);return g(o.showAddPicker.set(!o.showAddPicker()))}),C(2,"nile-glyph",160),c(3),d(),s(4,"nile-menu",43),u("nile-search-value",function(o){_(e);let a=r(3);return g(a.pickerSearch.set((o.detail==null?null:o.detail.value)??""))}),s(5,"nile-menu-item",44),u("click",function(){_(e);let o=r(3);return o.showAddPicker.set(!1),g(o.addArtifactToDashboard())}),C(6,"nile-glyph",45),c(7),d(),m(8,ad,2,1,"div",46)(9,cd,3,1),d()()}if(i&2){let e=r(3);b("open",e.showAddPicker()),l(),M("loading",e.committingAction()==="add"?"":null)("disabled",e.committingAction()||!e.hasSelection()?"":null),l(2),q(" ",e.copy().addToDashboardButton," "),l(),M("noResultsMessage",e.copy().noResultsMatchFilters),l(3),q(" ",e.copy().newDashboardLabel," "),l(),h(e.pickerSearchEmpty()?8:9)}}function _d(i,t){if(i&1){let e=k();s(0,"nile-button",22),u("click",function(){_(e);let o=r(3);return g(o.addArtifactToDashboard())}),C(1,"nile-glyph",160),c(2),d()}if(i&2){let e=r(3);M("loading",e.committingAction()==="add"?"":null)("disabled",e.committingAction()||!e.hasSelection()?"":null),l(2),q(" ",e.builderOpen()?e.copy().addToCurrentDashboardButton:e.copy().addToDashboardButton," ")}}function gd(i,t){if(i&1&&(s(0,"div",422),m(1,td,3,1,"nile-button",205),m(2,nd,3,2,"nile-button",205),m(3,id,2,3,"nile-button",205),m(4,od,0,0)(5,pd,10,7,"nile-dropdown",443)(6,_d,3,3,"nile-button",350),d()),i&2){let e,n=r(2);l(),h((e=n.artifactForecastMsg())?1:-1,e),l(),h(-1),l(),h(n.features().canvas.publishAsDashboard?3:-1),l(),h(n.features().canvas.addToDashboard?!n.builderOpen()&&n.conversationDashboards().length>1?5:6:4)}}function ud(i,t){if(i&1&&(s(0,"aside",417),m(1,Js,12,3,"div",418),s(2,"div",419),m(3,Zs,6,2,"div",420)(4,ed,2,27,"shared-dashboard-grid",421),d(),m(5,gd,7,4,"div",422),fe(6,214),d()),i&2){let e=r(),n=ce(35);W("aq-artifact-pane--dsl-only",e.dslOnlyArtifact()),l(),h(e.dslOnlyArtifact()?-1:1),l(2),h(e.artifactWidgets().length===0?3:4),l(2),h(!e.dslOnlyArtifact()&&e.artifactFooterHasActions()?5:-1),l(),b("ngTemplateOutlet",n)}}function md(i,t){i&1&&C(0,"nile-spinner",458)}function hd(i,t){i&1&&C(0,"nile-glyph",459)}function Cd(i,t){if(i&1){let e=k();s(0,"input",455),u("input",function(o){_(e);let a=r(2);return g(a.dashboardTitleDraft.set(o.target.value))})("keydown.enter",function(){_(e);let o=r(2);return g(o.commitDashboardTitle())})("keydown.escape",function(){_(e);let o=r(2);return g(o.cancelEditDashboardTitle())}),d(),s(1,"nile-lite-tooltip",456)(2,"button",457),u("click",function(){_(e);let o=r(2);return g(o.commitDashboardTitle())}),m(3,md,1,0,"nile-spinner",458)(4,hd,1,0,"nile-glyph",459),d()()}if(i&2){let e=r(2);b("value",e.dashboardTitleDraft()),l(2),b("disabled",e.renamingDashboard()),l(),h(e.renamingDashboard()?3:4)}}function fd(i,t){i&1&&C(0,"nile-skeleton-loader",449)}function xd(i,t){if(i&1){let e=k();s(0,"nile-lite-tooltip",461)(1,"button",462),u("click",function(){_(e);let o=r(3);return g(o.startEditDashboardTitle())}),C(2,"nile-glyph",463),d()()}}function yd(i,t){if(i&1&&(s(0,"span",460),c(1),d(),m(2,xd,3,0,"nile-lite-tooltip",461)),i&2){let e=r(2);l(),y((e.builderRef==null?null:e.builderRef.dashboardName())||"Dashboard"),l(),h(e.builderDashboardId()?2:-1)}}function bd(i,t){if(i&1){let e=k();s(0,"section",17)(1,"header",447)(2,"div",34)(3,"nile-button",430),u("click",function(){_(e);let o=r();return g(o.closeBuilder())}),C(4,"nile-glyph",448),d(),m(5,Cd,5,3)(6,fd,1,0,"nile-skeleton-loader",449)(7,yd,3,2),d(),s(8,"div",36)(9,"nile-lite-tooltip",450)(10,"button",451),u("click",function(){_(e);let o=r();return g(o.toggleBuilderFullscreen())}),C(11,"nile-glyph",452),d()(),s(12,"shared-builder-toolbar",453),u("action",function(o){_(e);let a=r();return g(a.onBuilderMenuAction(o))}),d()()(),s(13,"shared-builder-host",454),u("exitBuilder",function(){_(e);let o=r();return g(o.closeBuilder())})("executiveSummary",function(o){_(e);let a=r();return g(a.onExecutiveSummary(o))})("galleryPrompt",function(o){_(e);let a=r();return g(a.inputText.set(o))})("published",function(o){_(e);let a=r();return g(a.onBuilderPublished(o))})("widgetClick",function(o){_(e);let a=r();return g(a.onKpiWidgetClicked(o))}),d(),fe(14,214),d()}if(i&2){let e=r(),n=ce(35);l(5),h(e.editingDashboardTitle()?5:e.builderRef!=null&&e.builderRef.loading()?6:7),l(4),b("content",e.builderFullscreen()?"Exit full screen":"Full screen"),l(),M("aria-label",e.builderFullscreen()?"Exit full screen":"Full screen"),l(),M("name",e.builderFullscreen()?"ng-minimize":"ng-maximize"),l(),b("canToggleFilter",!0)("hasFilter",(e.builderRef==null?null:e.builderRef.hasFilter())??!1)("canForecast",!0)("anyForecastOn",(e.builderRef==null?null:e.builderRef.anyForecastOn())??!1)("editMode",(e.builderRef==null?null:e.builderRef.editMode())??!0)("showFullscreen",!1)("fullscreen",e.builderFullscreen())("busy",(e.builderRef==null?null:e.builderRef.isPublishing())??!1)("exporting",(e.builderRef==null?null:e.builderRef.isExporting())??!1)("showPromptGallery",!1)("canPublish",(e.builderRef==null?null:e.builderRef.canPublish())??!0),l(),b("dashboardId",e.builderDashboardId())("preseeded",e.builderPreseeded())("galleryPrompts",e.suggestions())("canAddToStory",e.widgetMenu().addToStory)("showWidgetMenu",e.widgetMenu().enabled)("canAsk",e.widgetMenu().ask)("canChangeChartType",e.widgetMenu().changeChartType)("canManageFilters",e.widgetMenu().manageFilters)("canCustomizeColors",e.widgetMenu().customizeColors)("canViewChartData",e.widgetMenu().chartData)("canExportPng",e.widgetMenu().exportPng)("canExportCsv",e.widgetMenu().exportCsv)("canPrint",e.widgetMenu().print)("canTweak",e.widgetMenu().tweak)("canEdit",e.widgetMenu().edit)("canDelete",e.widgetMenu().delete),l(),b("ngTemplateOutlet",n)}}function vd(i,t){if(i&1){let e=k();s(0,"label",474)(1,"input",475),u("change",function(){let o=_(e).$implicit,a=r(3);return g(a.onGranularityPick(o))}),d(),s(2,"span"),c(3),d()()}if(i&2){let e=t.$implicit,n=r(2);W("fs-segment--on",n.granularity===e.value)("fs-segment--off",!e.enabled),M("title",e.reason||null),l(),b("value",e.value)("checked",n.granularity===e.value)("disabled",!e.enabled),l(2),y(e.value)}}function wd(i,t){i&1&&(s(0,"p",468),c(1),d()),i&2&&(l(),y(t))}function kd(i,t){if(i&1&&(s(0,"p",468),c(1),d()),i&2){let e=r();l(),y(e.granularityNote)}}function Pd(i,t){if(i&1&&(s(0,"div",464)(1,"span",476),c(2,"Model"),d(),s(3,"div",477)(4,"p",478),c(5),d(),s(6,"p",479),c(7),d()()()),i&2){let e=t;l(5),y(e.title),l(2),y(e.body)}}function Ad(i,t){if(i&1&&(s(0,"div",464)(1,"span",476),c(2,"Guardrails"),d(),s(3,"div",480)(4,"p",478),C(5,"nile-glyph",481),c(6),d(),s(7,"p",479),c(8),d()()()),i&2){let e=t;l(3),W("fs-card--pass",e.passed)("fs-card--warn",!e.passed),l(2),M("name",e.passed?"ng-check":"ng-alert-circle")("color",e.passed?"var(--ng-colors-fg-success-primary)":"var(--ng-colors-fg-warning-primary)"),l(),q(" ",e.title," "),l(2),y(e.body)}}function Md(i,t){if(i&1){let e=k();s(0,"div",464)(1,"label",465),c(2," Horizon \u2014 "),s(3,"span",466),c(4),d()(),s(5,"input",467),u("input",function(o){_(e);let a=r(2);return g(a.onHorizonInput(o.target.value))}),d(),s(6,"p",468),c(7),d()(),s(8,"div",464)(9,"span",469),c(10,"Granularity"),d(),s(11,"div",470),F(12,vd,4,9,"label",471,nt),d(),m(14,wd,2,1,"p",468)(15,kd,2,1,"p",468),d(),s(16,"div",464)(17,"label",472),c(18," Confidence interval \u2014 "),s(19,"span",466),c(20),d()(),s(21,"input",473),u("input",function(o){_(e);let a=r(2);return g(a.onConfidenceIndexInput(o.target.value))}),d(),s(22,"p",468),c(23),d()(),m(24,Pd,8,2,"div",464),m(25,Ad,9,8,"div",464)}if(i&2){let e,n,o,a=t,p=r(),x=r();l(4),Y("",p.horizon," ",x.horizonUnit()),l(),Z("--fs-fill",x.horizonFill()),b("value",p.horizon),M("max",x.horizonMax())("aria-valuetext",p.horizon+" "+x.horizonUnit()),l(2),y(x.horizonNote()),l(5),O(x.granularityChoices()),l(2),h((e=x.unavailableGranularityNote())?14:15,e),l(6),q("",p.confidence,"%"),l(),Z("--fs-fill",x.confidenceFill()),b("value",x.confidenceIndex()),M("max",a.confidenceLevels.length-1)("aria-valuetext",p.confidence+"%"),l(2),y(a.confidenceNote),l(),h((n=a.modelCard)?24:-1,n),l(),h((o=a.guardrails)?25:-1,o)}}function Sd(i,t){if(i&1&&m(0,Md,26,18),i&2){let e,n=r();h((e=n.forecastCopy())?0:-1,e)}}function Td(i,t){if(i&1&&(s(0,"div",485),C(1,"nile-skeleton-loader",486),s(2,"div",487),C(3,"nile-skeleton-loader",78),d()()),i&2){let e=t.$implicit;l(2),Z("width",e,"px")}}function qd(i,t){if(i&1&&(s(0,"div",483),F(1,Td,4,2,"div",485,G),d()),i&2){let e=r(2);l(),O(e.gallerySkeletonRows)}}function Dd(i,t){if(i&1){let e=k();s(0,"nile-ai-prompts",488),u("nile-item-click",function(o){_(e);let a=r(2);return g(a.onGalleryPromptPick(o.detail==null?null:o.detail.data))}),d()}if(i&2){let e=r(2);b("items",e.galleryPromptItems())("vertical",!0)("wrap",!0)}}function Fd(i,t){if(i&1&&(s(0,"div",128),c(1),d()),i&2){let e=r(2);l(),Y("",e.copy().noPromptsMatch,' "',e.gallerySearch(),'".')}}function Od(i,t){if(i&1&&(s(0,"div",128),c(1),d()),i&2){let e=r(2);l(),y(e.copy().noPromptsYet)}}function Ed(i,t){if(i&1){let e=k();s(0,"nile-input",482),u("nile-input",function(o){_(e);let a=r();return g(a.gallerySearch.set((o.detail==null?null:o.detail.value)??""))})("nile-change",function(o){_(e);let a=r();return g(a.gallerySearch.set((o.detail==null?null:o.detail.value)??""))}),C(1,"nile-glyph",109),d(),m(2,qd,3,0,"div",483)(3,Dd,1,3,"nile-ai-prompts",484)(4,Fd,2,2,"div",128)(5,Od,2,1,"div",128)}if(i&2){let e=r();b("placeholder",e.copy().promptGallerySearchPlaceholder)("value",e.gallerySearch()),l(2),h(e.suggestionsLoading()?2:e.filteredGalleryPrompts().length?3:e.gallerySearch().trim()?4:5)}}function Id(i,t){if(i&1&&(s(0,"div",489),c(1),d()),i&2){let e=r(2);l(),y(e.copy().xrayLoadingSources)}}function Vd(i,t){if(i&1&&(s(0,"div",128),c(1),d()),i&2){let e=r(2);l(),y(e.copy().xrayNoSources)}}function Rd(i,t){i&1&&C(0,"nile-glyph",72)}function zd(i,t){if(i&1){let e=k();s(0,"nile-menu-item",70),u("click",function(){let o=_(e).$implicit,a=r(4);return g(a.onXrayDatasetPick(o.datasetId))}),s(1,"span",504),c(2),d(),m(3,Rd,1,0,"nile-glyph",72),d()}if(i&2){let e=t.$implicit,n=r(4);l(2),y(e.label),l(),h(n.xraySelectedDatasetId()===e.datasetId?3:-1)}}function Nd(i,t){if(i&1){let e=k();s(0,"nile-dropdown",499),u("nile-hide",function(){_(e);let o=r(3);return g(o.xrayDatasetMenuOpen.set(!1))}),s(1,"button",500),u("click",function(){_(e);let o=r(3);return g(o.xrayDatasetMenuOpen.set(!o.xrayDatasetMenuOpen()))}),C(2,"nile-glyph",501),s(3,"span",502),c(4),d(),C(5,"nile-glyph",503),d(),s(6,"nile-menu"),F(7,zd,4,2,"nile-menu-item",null,qo),d()()}if(i&2){let e=r(3);b("open",e.xrayDatasetMenuOpen()),l(4),y(e.xraySelectedDatasetLabel()),l(3),O(e.xrayDatasets())}}function Ld(i,t){if(i&1&&(s(0,"div",496),C(1,"nile-glyph",505),s(2,"span"),c(3),d()()),i&2){let e=r(3);l(3),y(e.xrayError())}}function $d(i,t){if(i&1&&(s(0,"div",497),C(1,"nile-spinner",506),s(2,"p",507),c(3),d(),s(4,"p",508),c(5),d()()),i&2){let e=r(3);l(3),y(e.xrayStatus()==="analyzing"?e.copy().xrayAnalyzing:e.copy().xrayBuilding),l(2),y(e.xrayRunningEntityLabel())}}function Wd(i,t){if(i&1&&(s(0,"div",509),C(1,"nile-skeleton-loader",486)(2,"nile-skeleton-loader",510),d()),i&2){let e=t.$implicit;l(2),b("width",e)}}function Bd(i,t){if(i&1&&(s(0,"div",498),F(1,Wd,3,1,"div",509,G),d()),i&2){let e=r(3);l(),O(e.xraySkeletonRows)}}function Ud(i,t){if(i&1&&(s(0,"span",518),c(1),d()),i&2){let e=r().$implicit;l(),q("",e.schema,".")}}function Gd(i,t){if(i&1&&(s(0,"span",519),c(1),d()),i&2){let e=r().$implicit,n=r(4);l(),Y("",e.fieldCount," ",n.copy().xrayFieldsLabel)}}function jd(i,t){if(i&1){let e=k();s(0,"button",515),u("click",function(){let o=_(e).$implicit,a=r(4);return g(a.runXray(o))}),C(1,"nile-glyph",516),s(2,"span",517),m(3,Ud,2,1,"span",518),c(4),d(),m(5,Gd,2,2,"span",519),s(6,"span",520),C(7,"nile-glyph",229),s(8,"span"),c(9),d()()()}if(i&2){let e=t.$implicit,n=r(4);b("disabled",n.xrayRunning())("title",n.xrayEntityLabel(e)),l(),b("name",e.kind==="index"?"ng-layers-three-01":"ng-table"),l(2),h(e.schema?3:-1),l(),q("",e.name," "),l(),h(e.fieldCount?5:-1),l(4),y(n.copy().xrayRunLabel)}}function Hd(i,t){if(i&1&&(s(0,"div",511)(1,"span",512),c(2),d(),s(3,"span",513),c(4),d()(),s(5,"div",498),F(6,jd,10,7,"button",514,Do),d()),i&2){let e=r(3);l(2),Y("",e.xrayFilteredEntities().length," ",e.xrayEntityNoun()),l(2),y(e.copy().xrayPickHint),l(2),O(e.xrayFilteredEntities())}}function Yd(i,t){if(i&1&&(s(0,"div",128),c(1),d()),i&2){let e=r(3);l(),Y("",e.copy().xrayNoEntitiesMatch,' "',e.xrayEntitySearch(),'".')}}function Kd(i,t){if(i&1&&(s(0,"div",128),c(1),d()),i&2){let e=r(3);l(),y(e.copy().xrayNoEntities)}}function Qd(i,t){if(i&1){let e=k();m(0,Nd,9,2,"nile-dropdown",490),s(1,"nile-input",491),u("nile-input",function(o){_(e);let a=r(2);return g(a.xrayEntitySearch.set((o.detail==null?null:o.detail.value)??""))})("nile-change",function(o){_(e);let a=r(2);return g(a.xrayEntitySearch.set((o.detail==null?null:o.detail.value)??""))}),C(2,"nile-glyph",109),d(),s(3,"details",492)(4,"summary",493),C(5,"nile-glyph",494),s(6,"span"),c(7),d()(),s(8,"nile-input",495),u("nile-input",function(o){_(e);let a=r(2);return g(a.xrayTopic.set((o.detail==null?null:o.detail.value)??""))})("nile-change",function(o){_(e);let a=r(2);return g(a.xrayTopic.set((o.detail==null?null:o.detail.value)??""))}),d()(),m(9,Ld,4,1,"div",496),m(10,$d,6,2,"div",497)(11,Bd,3,0,"div",498)(12,Hd,8,3)(13,Yd,2,2,"div",128)(14,Kd,2,1,"div",128)}if(i&2){let e=r(2);h(e.xrayDatasets().length>1?0:-1),l(),b("placeholder",e.copy().xrayEntitySearchPlaceholder)("value",e.xrayEntitySearch()),l(2),b("open",!!e.xrayTopic()),l(4),y(e.copy().xrayFocusToggle),l(),b("placeholder",e.copy().xrayTopicPlaceholder)("value",e.xrayTopic()),l(),h(e.xrayError()?9:-1),l(),h(e.xrayRunning()?10:e.xrayEntitiesLoading()?11:e.xrayFilteredEntities().length?12:e.xrayEntitySearch().trim()?13:14)}}function Xd(i,t){if(i&1&&m(0,Id,2,1,"div",489)(1,Vd,2,1,"div",128)(2,Qd,15,9),i&2){let e=r();h(e.xraySourcesLoading()?0:e.xraySources().length?2:1)}}function Jd(i,t){i&1&&(s(0,"nile-breadcrumb-item"),c(1),d()),i&2&&(l(),q(" ",t," "))}function Zd(i,t){i&1&&c(0),i&2&&q(" ",t," ")}function ec(i,t){i&1&&C(0,"nile-skeleton-loader",524)}function tc(i,t){if(i&1&&(s(0,"p",526),c(1),d()),i&2){let e=r(3);l(),y(e.cohortDetailCaption())}}function nc(i,t){if(i&1&&C(0,"nile-skeleton-loader",533),i&2){let e=t.$implicit;Z("left",e.x/12*100,"%")("top",e.y*72,"px")("width","calc("+e.w/12*100+"% - 12px)")("height",e.h*72-12,"px")}}function ic(i,t){if(i&1&&(s(0,"div",531),F(1,nc,1,8,"nile-skeleton-loader",532,G),d()),i&2){let e=r(4);Z("height",e.widgetDetailPanelSkeletonHeight(),"px"),l(),O(e.widgetDetailPanelSkeletonSlots())}}function oc(i,t){i&1&&(s(0,"div",530)(1,"div",534),C(2,"nile-skeleton-loader",535)(3,"nile-skeleton-loader",535)(4,"nile-skeleton-loader",535),d(),C(5,"nile-skeleton-loader",536),d())}function ac(i,t){if(i&1&&m(0,ic,3,2,"div",529)(1,oc,6,0,"div",530),i&2){let e=r(3);h(e.widgetDetailPanelSkeletonSlots().length?0:1)}}function rc(i,t){if(i&1){let e=k();s(0,"shared-dashboard-grid",537),u("selectionChange",function(o){_(e);let a=r(3);return g(a.widgetDetailPanelSelectedIds.set(o))}),d()}if(i&2){let e=r(3);b("widgets",e.widgetDetailPanelWidgets())("editMode",!1)("selectable",e.widgetDetailPanelKind()==="dashboard")("selectedWidgetIds",e.widgetDetailPanelSelectedIds())("canSetAlert",!1)("canAddToStory",!1)("canForecast",!1)("showWidgetMenu",!1)}}function lc(i,t){if(i&1){let e=k();s(0,"div",528)(1,"span",538),c(2),d(),s(3,"nile-button",21),u("click",function(){_(e);let o=r(3);return g(o.toggleSelectAllDetailPanelWidgets())}),c(4),d(),s(5,"nile-button",21),u("click",function(){_(e);let o=r(3);return g(o.addSelectedDetailPanelWidgetsToCanvas())}),C(6,"nile-glyph",539),c(7),d(),s(8,"nile-button",22),u("click",function(){_(e);let o=r(3);return g(o.replaceCanvasWithDetailPanel())}),C(9,"nile-glyph",540),c(10," Replace canvas "),d()()}if(i&2){let e=r(3);l(2),Y(" ",e.widgetDetailPanelSelectedIds().length," of ",e.widgetDetailPanelWidgets().length," selected "),l(2),q(" ",e.isDetailPanelFullySelected()?"Deselect all":"Select all"," "),l(),M("disabled",e.widgetDetailPanelSelectedIds().length?null:""),l(2),q(" Add ",e.widgetDetailPanelSelectedIds().length," to canvas "),l(),M("disabled",e.widgetDetailPanelWidgets().length?null:"")}}function sc(i,t){if(i&1){let e=k();s(0,"div",528)(1,"nile-button",22),u("click",function(){_(e);let o=r(3);return g(o.exportCohortRowsCsv())}),C(2,"nile-glyph",541),c(3),d(),s(4,"nile-button",21),u("click",function(){_(e);let o=r(3);return g(o.copyCohortDefinition())}),C(5,"nile-glyph",542),c(6),d()()}if(i&2){let e=r(3);l(),M("disabled",e.detailPanelCohortData()?null:""),l(2),q(" ",e.copy().cohortExportRowsButton," "),l(),M("disabled",e.detailPanelCohortData()?null:""),l(2),q(" ",e.copy().cohortCopyDefinitionButton," ")}}function dc(i,t){if(i&1){let e=k();s(0,"div",528)(1,"nile-button",22),u("click",function(){_(e);let o=r(3);return g(o.addWidgetTemplateFromDetailPanel())}),C(2,"nile-glyph",160),c(3," Add to dashboard "),d()()}}function cc(i,t){if(i&1){let e=k();s(0,"div",521)(1,"div",522)(2,"nile-breadcrumb",523),u("nile-click",function(){_(e);let o=r(2);return g(o.closeWidgetDetailPanel())}),s(3,"nile-breadcrumb-item"),c(4),d(),m(5,Jd,2,1,"nile-breadcrumb-item"),s(6,"nile-breadcrumb-item"),m(7,Zd,1,1)(8,ec,1,0,"nile-skeleton-loader",524),d()()(),s(9,"div",525),m(10,tc,2,1,"p",526),m(11,ac,2,1)(12,rc,1,8,"shared-dashboard-grid",527),d(),m(13,lc,11,6,"div",528)(14,sc,7,4,"div",528)(15,dc,4,0,"div",528),d()}if(i&2){let e,n,o=r(2);l(4),q(" ",o.detailRootCrumb()," "),l(),h((e=o.detailPanelWidgetCrumb())?5:-1,e),l(2),h((n=o.detailPanelLastCrumb())?7:8,n),l(3),h(o.detailPanelCohortId()?10:-1),l(),h(o.widgetDetailPanelLoading()?11:12),l(2),h(o.widgetDetailPanelKind()==="dashboard"?13:o.detailPanelCohortId()?14:o.widgetDetailPanelCanAdd()?15:-1)}}function pc(i,t){if(i&1&&m(0,cc,16,6,"div",521),i&2){let e=r();h(e.widgetDetailPanelOpen()?0:-1)}}function _c(i,t){if(i&1){let e=k();s(0,"app-alert-drawer",543),u("closed",function(){_(e);let o=r();return g(o.onAlertClosed())})("saved",function(){_(e);let o=r();return g(o.onAlertClosed())}),d()}if(i&2){let e,n=r();b("open",n.alertDrawerOpen())("widget",n.alertWidget())("dashboardId",null)("source",n.alertSource())("sourceName",((e=n.selectedScope())==null?null:e.name)??"")("authoringMode","chat")}}function gc(i,t){i&1&&C(0,"nile-executive-summary",30,8)}function uc(i,t){if(i&1){let e=k();s(0,"app-story-picker-drawer",544),u("closed",function(){_(e);let o=r();return g(o.closeStoryPicker())})("added",function(){_(e);let o=r();return g(o.onAddedToStory())}),d()}if(i&2){let e=r();b("open",e.storyPickerOpen())("widget",e.storyPickerWidget())}}function mc(i,t){if(i&1&&(s(0,"div",75),C(1,"nile-glyph",96),s(2,"div",77)(3,"span",89),c(4),d(),s(5,"span",90),c(6),d()()()),i&2){let e=t.$implicit,n=r();l(3),b("title",e.name||"Untitled"),l(),y(e.name||"Untitled"),l(2),y(n.dashboardMeta(e))}}function we(){return Math.random().toString(36).slice(2)}function hc(i){if(!i.length)return i;let t=new Map;for(let a of i){let p=t.get(a.y)??[];p.push(a),t.set(a.y,p)}let e=[...t.keys()].sort((a,p)=>a-p),n=[],o=0;for(let a of e){let p=t.get(a);for(let x of p)n.push(T(w({},x),{y:o}));o+=Math.max(...p.map(x=>x.h))}return n}var Cc=4,fc="forecast-settings",xc="forecast-this";function Ei(i){return i.split(`
4
+ `).find(B=>B.startsWith("data:"));if(H){try{U(JSON.parse(H.slice(5).trim()))}catch{}if(P)return}}}P||(n.onError("Stream ended unexpectedly"),n.onFinish("error",t??""))}async streamChatViaSse(t,e,n,o,a,p,x,v){let A=await this.bearer(),S=`${this.baseUrl}/v1/conversations/chat`,P={message:e};t&&(P.conversationId=t),o&&(P.connectionId=o),p?.length&&(P.attachments=p),x&&(P.isPipeline=!0),v&&(P.dashboardId=v);let{indexName:z,planningMode:Q}=I().chatDefaults;z&&(P.indexName=z),Q===!1&&(P.planningMode=!1);let U=await fetch(S,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${A}`},body:JSON.stringify(P),signal:a});if(!U.ok){let L=await U.text().catch(()=>U.statusText);n.onError(`Request failed (${U.status}): ${L}`);return}if(!U.body){n.onError("No response body received");return}let K=U.body.getReader(),X=new TextDecoder,ne="";for(;;){let{done:L,value:J}=await K.read();if(L)break;ne+=X.decode(J,{stream:!0});let R=ne.split(`
5
+ `);ne=R.pop()??"";for(let V of R){let $=V.trim();$&&this.parseLine($,n)}}ne.trim()&&this.parseLine(ne.trim(),n)}async getSuggestedPrompts(t,e){if(!this.customerId||!this.productId)return{widgetSuggestions:[],conversationStarters:[]};let n={};return t&&(n.connectionId=t),e&&(n.isPipeline="true"),I().features.mcpGateway?await this.callMcpTool("getSuggestedPrompts",{},n)??{widgetSuggestions:[],conversationStarters:[]}:(await E(this.http.get(`${this.baseUrl}/conversations/suggested-prompts`,{params:n})))?.data??{widgetSuggestions:[],conversationStarters:[]}}async listDashboards(t=20){return!this.customerId||!this.productId?[]:I().features.mcpGateway?(await this.callMcpTool("listDashboards",{limit:t,published:"all"}))?.dashboards??[]:(await E(this.http.get(`${this.baseUrl}/dashboards?limit=${t}`)))?.data??[]}async getDashboard(t){if(!t)return null;if(!I().features.mcpGateway){let n=await E(this.http.get(`${this.baseUrl}/dashboards/${t}`));return n?.data??n??null}return(await this.callMcpTool("getDashboard",{dashboardId:t}))?.dashboard??null}async listDashboardsForConversation(t){if(!t||!this.customerId||!this.productId)return[];if(!I().features.mcpGateway){let n=await E(this.http.get(`${this.baseUrl}/dashboards?conversationId=${encodeURIComponent(t)}`)),o=n?.data??n;return Array.isArray(o)?o:[]}return(await this.callMcpTool("listDashboards",{conversationId:t,published:"all"}))?.dashboards??[]}async changeAdhocChartType(t,e){let n;try{n=await E(this.http.post(`${this.baseUrl}/conversations/change-type`,{widgetConfig:t,newChartType:e}))}catch(o){throw o instanceof oe?new Error(o.error?.error||o.message):o}if(n?.success===!1||!n?.chart)throw new Error(n?.error||"Chart type change failed");return n.chart}async listAdhocFilterFields(t){let e;try{e=await E(this.http.post(`${this.baseUrl}/conversations/filter-fields`,{widgets:t}))}catch(n){throw n instanceof oe?new Error(n.error?.error||n.message):n}if(e?.success===!1)throw new Error(e?.error||"Could not load filter fields");return e?.fields??[]}async fetchDashboardSummary(t){let e;try{e=await E(this.http.post(`${this.baseUrl}/dashboards/${t}/summary`,{}))}catch(o){throw o instanceof oe?new Error(o.error?.error||o.message):o}if(e?.success===!1)throw new Error(e?.error||"Could not generate summary");let n=e?.data;return typeof n=="string"?n:n?.summary??""}async chatWithAdhocWidget(t,e,n){let o;try{o=await E(this.http.post(`${this.baseUrl}/conversations/widget-chat`,{widget:t,message:e,sessionId:n}))}catch(a){throw a instanceof oe?new Error(a.error?.error||a.message):a}if(o?.success===!1||!o?.reply?.content)throw new Error(o?.error||"Could not process the request");return{sessionId:o.sessionId??n,content:o.reply.content}}async fetchAdhocFilterValues(t,e,n=""){let o;try{o=await E(this.http.post(`${this.baseUrl}/conversations/filter-values`,{widgets:t,field:e,prefix:n}))}catch(a){throw a instanceof oe?new Error(a.error?.error||a.message):a}if(o?.success===!1)throw new Error(o?.error||"Could not load filter values");return{field:e,values:o?.values??[],complete:o?.complete??!0}}async applyAdhocFilter(t,e){let n;try{n=await E(this.http.post(`${this.baseUrl}/conversations/filter-apply`,{widgetConfig:t,filters:e}))}catch(o){throw o instanceof oe?new Error(o.error?.error||o.message):o}if(n?.success===!1||!n?.chart)throw new Error(n?.error||"Filter could not be applied");return n.chart}async filterSuggest(t,e,n,o="draft"){let a=n.filter(v=>!!v.id).map(v=>({widgetId:v.id})),p;try{p=await E(this.http.post(`${this.baseUrl}/dashboards/${t}/filter/suggest?status=${o}`,{query:e,refreshCache:!1,widgets:a}))}catch(v){throw v instanceof oe?new Error(v.error?.error||v.message):v}if(p?.success===!1)throw new Error(p.error||"Request failed");let x=p?.data??{completions:[],suggestions:[]};return{nextToken:x.nextToken,completions:Array.isArray(x.completions)?x.completions:[],suggestions:Array.isArray(x.suggestions)?x.suggestions:[]}}async applyFilters(t,e,n,o="draft",a,p){let x=await new Promise((Q,U)=>{let K=this.http.post(`${this.baseUrl}/dashboards/${n}/filter/apply?status=${o}`,Wn(t,e,p)).subscribe({next:X=>Q(X),error:X=>{U(X instanceof oe?new Error(X.error?.error||X.message):X)}});if(a){if(a.aborted){K.unsubscribe();let X=new Error("Aborted");X.name="AbortError",U(X);return}a.addEventListener("abort",()=>{K.unsubscribe();let X=new Error("Aborted");X.name="AbortError",U(X)},{once:!0})}});if(x?.success===!1)throw new Error(x.error||"Request failed");let v=x?.data??x,A=Array.isArray(v)?v:v?.widgets;if(!Array.isArray(A))throw new Error("Invalid response from apply-filters API");let S=!Array.isArray(v)&&Array.isArray(v?.resolvedFilters)?v.resolvedFilters:[],P=!Array.isArray(v)&&typeof v?.filterExplanation=="string"?v.filterExplanation:typeof x?.filterExplanation=="string"?x.filterExplanation:null,z=P&&P.trim()?P.trim():null;return{widgets:A,resolvedFilters:S,filterExplanation:z}}async uploadAttachment(t,e){let n=await this.bearer(),o=new FormData;o.append("file",t,t.name);let a=await fetch(`${this.baseUrl}/uploads`,{method:"POST",headers:{Authorization:`Bearer ${n}`},body:o,signal:e?.signal});if(!a.ok){let v=await a.text().catch(()=>a.statusText);throw new Error(`Upload failed (${a.status}): ${v}`)}let p=await a.json().catch(()=>null),x=p?.data?.key??p?.key;if(!x)throw new Error("Upload failed: malformed response");return{key:x}}async listDashboardCategories(){return(await E(this.http.get(`${this.baseUrl}/category-templates/categories`))).data}async listAllCategoryTemplates(){return(await E(this.http.get(`${this.baseUrl}/category-templates/templates`))).data}async previewCategoryTemplateStream(t,e){let n=await this.bearer(),o=`${this.baseUrl}/category-templates/${t}/preview`,a;try{a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify({})})}catch(S){e.onError(S instanceof Error?S.message:"Network error");return}if(!a.ok){let S=await a.json().catch(()=>null);e.onError(S?.error??`Request failed (${a.status})`);return}if(!a.body){e.onError("No response body received");return}let p=a.body.getReader(),x=new TextDecoder,v="",A=S=>{let P=S.trim();if(!P)return;let z;try{z=JSON.parse(P)}catch{return}switch(z.type){case"template":e.onTemplate?.(z.template);break;case"widget":e.onWidget(z.widget);break;case"skipped":e.onSkipped?.(z.title,z.reason);break;case"error":e.onError(z.message);break;case"done":e.onDone?.();break;default:break}};for(;;){let{done:S,value:P}=await p.read();if(S)break;v+=x.decode(P,{stream:!0});let z=v.split(`
6
+ `);v=z.pop()??"";for(let Q of z)A(Q)}v.trim()&&A(v)}async listXraySources(){return!this.customerId||!this.productId?[]:(await E(this.http.get(`${this.baseUrl}/xray/sources`)))?.data?.connections??[]}async listXrayEntities(t,e,n){if(!this.customerId||!this.productId)return{adapterType:"",entities:[]};let o=new Gt;return e&&(o=o.set("datasetId",e)),n&&(o=o.set("search",n)),(await E(this.http.get(`${this.baseUrl}/xray/sources/${t}/entities`,{params:o})))?.data??{adapterType:"",entities:[]}}async xrayPreviewStream(t,e,n){await this.readNdjsonStream(`${this.baseUrl}/xray/sources/${t}/preview`,e,o=>{switch(o.type){case"profile":n.onProfile?.(o.profile);break;case"semantic":n.onSemantic?.(o.semanticRead);break;case"widget":n.onWidget(o.widget);break;case"layout":n.onLayout?.(o.layouts);break;case"conversation":n.onConversation?.(o.conversationId);break;case"summary":n.onSummary?.(o.summary);break;case"empty":n.onEmpty?.(o.message);break;case"error":n.onError(o.message);break;case"done":n.onDone?.(o.widgetCount,o.title,o.conversationId??null);break;default:break}},n.onError)}async readNdjsonStream(t,e,n,o){let a=await this.bearer(),p;try{p=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:JSON.stringify(e??{})})}catch(P){o(P instanceof Error?P.message:"Network error");return}if(!p.ok){let P=await p.json().catch(()=>null);o(P?.error??`Request failed (${p.status})`);return}if(!p.body){o("No response body received");return}let x=p.body.getReader(),v=new TextDecoder,A="",S=P=>{let z=P.trim();if(z)try{n(JSON.parse(z))}catch{}};for(;;){let{done:P,value:z}=await x.read();if(P)break;A+=v.decode(z,{stream:!0});let Q=A.split(`
7
+ `);A=Q.pop()??"";for(let U of Q)S(U)}A.trim()&&S(A)}async createDashboardFromTemplate(t){return(await E(this.http.post(`${this.baseUrl}/category-templates/${t}/dashboard`,{}))).data}async listWidgetTemplates(){return(await E(this.http.get(`${this.baseUrl}/widget-templates`))).data}async previewWidgetTemplate(t){return(await E(this.http.post(`${this.baseUrl}/widget-templates/${t}/preview`,{}))).data}async loadAllWidgetTemplatePreviews(){return(await E(this.http.post(`${this.baseUrl}/widget-templates/preview-all`,{}))).data}async previewWidgetTemplateDetailPanel(t){return(await E(this.http.post(`${this.baseUrl}/widget-templates/${t}/detail-panel`,{}))).data}async previewWidgetDetailPanelDefinition(t){return(await E(this.http.post(`${this.baseUrl}/widget-templates/preview-detail-panel`,{detailPanel:t}))).data}async createDashboard(t){let a=t,{published:e}=a,n=Ee(a,["published"]);return I().features.mcpGateway?(await this.callMcpTool("createDashboard",w(w({},n),e?{published:!0}:{}))).dashboard:(await E(this.http.post(`${this.baseUrl}/dashboards${e?"?published=true":""}`,n))).data}async publishDashboard(t){return I().features.mcpGateway?(await this.callMcpTool("publishDashboard",{dashboardId:t}))?.publishedDashboardId??t:(await E(this.http.post(`${this.baseUrl}/dashboards/${t}/publish`,{})))?.data?.publishedDashboardId??t}async updateDashboard(t,e){await E(this.http.put(`${this.baseUrl}/dashboards/${t}?published=false`,e))}async deleteDashboard(t){if(!I().features.mcpGateway){await E(this.http.delete(`${this.baseUrl}/dashboards/${t}`));return}await this.callMcpTool("deleteDashboard",{dashboardId:t})}async register(t){return(await E(this.http.post(`${I().baseUrl}/api/customers/${this.customerId}/workforce/register`,t))).data}async listConnections(){return!this.customerId||!this.productId?[]:(await E(this.http.get(`${this.baseUrl}/connections`)))?.data??[]}async listDatasets(){return!this.customerId||!this.productId?[]:((await E(this.http.get(`${this.baseUrl}/connections/datasets`)))?.data??[]).map(e=>({id:e.id,name:e.name}))}async listPipelines(){if(!this.customerId||!this.productId)return[];let t=`${I().baseUrl}/api/customers/${this.customerId}/products/${this.productId}/applications/orchestrations/v2?startIndex=0&limit=100`;return((await E(this.http.get(t)))?.data??[]).map(n=>({id:n.publicOrchestrationGuid??n.guid??n.id??"",name:n.name})).filter(n=>n.id)}async createConnection(t,e){return(await E(this.http.post(`${this.baseUrl}/connections`,{name:t,config:e}))).data}async updateConnection(t,e){return(await E(this.http.put(`${this.baseUrl}/connections/${t}`,e))).data}async testConnection(t){return(await E(this.http.post(`${this.baseUrl}/connections/${t}/test`,{}))).data}async deleteConnection(t){await E(this.http.delete(`${this.baseUrl}/connections/${t}`))}parseLine(t,e){let n=t.indexOf(":");if(n===-1)return;let o=t.slice(0,n),a;try{a=JSON.parse(t.slice(n+1))}catch{return}switch(o){case"f":break;case"0":e.onText(a.text??"");break;case"9":{let p=a;e.onToolStart(p.toolCallId,p.uiLabel??p.toolName??"");break}case"a":{let p=a;e.onToolResult(p.toolCallId,p.result?.uiDetail??"",p.result?.error??!1);break}case"2":{let p=a;p.data_type==="adhoc_viz"?e.onDataPart(p):p.data_type==="dashboard_title"?e.onDashboardTitle?.(p.data?.title??""):p.data_type==="choice"?e.onChoice?.(p.data):p.data_type==="layout_patch"&&e.onLayoutPatch?.(p.data);break}case"3":e.onError(a.error??"Unknown error");break;case"d":{let p=a;e.onFinish(p.finishReason??"stop",p.conversationId??"");break}}}static \u0275fac=function(e){return new(e||i)};static \u0275prov=ie({token:i,factory:i.\u0275fac,providedIn:"root"})};function Zn({hasMessages:i,artifactOpen:t,builderOpen:e}){return t?"split":e?"builder":i?"conversation":"idle"}function ei(i,t){return i==="chat"?t.chat:i==="library"?t.library:i==="tools"?t.tools:!0}function ti(i){return[i.chat,i.library,i.tools].filter(Boolean).length>1}var Me=class i{http=N(_e);tokenStore=N(ae);get customerId(){return I().customerId??this.tokenStore.tenantId()??""}get productId(){return I().productId??ge()}get baseUrl(){return`${I().baseUrl}/api/customers/${this.customerId}/products/${this.productId}/workforce`}async listCriteria(){return(await E(this.http.get(`${this.baseUrl}/cohort-criteria?category=cohort`)))?.criteria??[]}async previewCriterion(t){return E(this.http.get(`${this.baseUrl}/cohorts/preview?criterion=${encodeURIComponent(t)}`))}async getDetail(t){return E(this.http.get(`${this.baseUrl}/cohorts/detail?criterion=${encodeURIComponent(t)}`))}async listMembers(t,e){return(await E(this.http.get(`${this.baseUrl}/cohorts/members?criterion=${encodeURIComponent(t)}&limit=${e}`)))?.members??[]}static \u0275fac=function(e){return new(e||i)};static \u0275prov=ie({token:i,factory:i.\u0275fac,providedIn:"root"})};function ii(i,t,e){return{chart:w({type:"kpi",variant:"card",value:t},e?{description:e}:{}),aq:{chartTitle:i,ai:{enabled:!1}}}}function ni(i,t,e,n){return{title:t,componentName:i,widgetType:"chart",config:e,layout:n}}function oi(i){let t=i.kpis.map((x,v)=>ni("nile-kpi-chart",x.label,ii(x.label,x.value),{x:v*3,y:0,w:3,h:2})),e=i.systemRows.length,n=e<i.systemCount?`Underlying rows \xB7 top ${e} of ${i.systemCount} systems`:`Underlying rows \xB7 ${e} ${e===1?"system":"systems"}`,o=x=>i.systemRows.some(v=>v[x]>0),a=[{accessorKey:"system",header:"System"},{accessorKey:"events",header:"Events"},...o("errors")?[{accessorKey:"errors",header:"Errors"}]:[],...o("orphans")?[{accessorKey:"orphans",header:"Orphans"}]:[]],p=ni("nile-data-grid",n,{chart:{type:"grid",columns:a,data:i.systemRows},aq:{chartTitle:n,ai:{enabled:!1}}},{x:0,y:2,w:12,h:6});return[...t,p]}var Bi={kpis:[{label:"Matches",value:""},{label:"% of population",value:""},{label:"Events from these people",value:""},{label:"Orphan events among them",value:""}],systemRows:[],systemCount:0,eventTotal:0,scan:{events:0,systems:0}};function ai(i,t=1){return{title:i.cohortTitle,componentName:"nile-kpi-chart",config:{title:i.cohortTitle,componentName:"nile-kpi-chart",widgetType:"chart",category:"cohort",config:T(w({},ii(i.cohortTitle,i.matchCount,`${t} ${t===1?"criterion":"criteria"} \xB7 live membership`)),{_meta:{cohortId:i.criterionId,detailPanel:{title:i.cohortTitle,cohortId:i.criterionId,widgets:oi(Bi)}}}),layout:{x:0,y:0,w:3,h:3}}}}function Xe(i,t){return{title:i.cohortTitle,widgets:oi(t),skipped:[]}}var Ui="__evidence-curated";function Gi(i,t){return`${i}${Ui}-${t}`}function ji(i){let t=i?.config?._meta;if(!t||typeof t!="object")return null;let e=t,n=typeof e.templateId=="string"&&e.templateId?e.templateId:null,o=typeof e.cohortId=="string"&&e.cohortId?e.cohortId:null,a=e.detailPanel&&typeof e.detailPanel=="object"?e.detailPanel:null;return!n&&!o&&!a?null:{templateId:n,cohortId:o,detailPanel:a}}var Hi=2;function Yi(i){if(!i||typeof i!="object")return;let t=i;if(![t.x,t.y,t.w,t.h].every(x=>typeof x=="number"&&Number.isFinite(x)))return;let{x:n,y:o,w:a,h:p}=t;if(!(a<=0||p<=0))return{x:n,y:o,w:a,h:Math.max(Hi,Math.ceil(p))}}function Ki(i,t){return i==="kpi"?"nile-kpi-chart":i==="grid"?"nile-data-grid":typeof t=="string"&&t?t:void 0}function xt(i,t){let e=Array.isArray(i?.widgets)?i.widgets:[],n=[];for(let o of e){if(!o||typeof o!="object")continue;let a=o,p=a.config??a??{},x=p.chart??{},v=T(w({},p),{chart:x,aq:p.aq??{}}),A={id:Gi(t,n.length),title:typeof a.title=="string"?a.title:"",widgetType:a.widgetType==="kpi"?"kpi":"chart",config:v,drilldownBy:Array.isArray(a.drilldownBy)?a.drilldownBy:[],category:a.category??null},S=Ki(x.type,a.componentName);S&&(A.componentName=S);let P=Yi(a.layout);P&&(A.layout=P),typeof a.summary=="string"&&(A.summary=a.summary),a.queryMeta&&typeof a.queryMeta=="object"&&(A.queryMeta=a.queryMeta),typeof a.dataSourceId=="string"&&(A.dataSourceId=a.dataSourceId),n.push(A)}return n}var Je=class i{svc=N(me);cohort=N(Me);async resolveEvidence(t){let e=ji(t);if(!e)return[];if(e.cohortId){let[n,o]=await Promise.all([this.cohort.previewCriterion(e.cohortId),this.cohort.getDetail(e.cohortId)]);return xt(Xe(n,o),t.id)}return e.detailPanel?e.detailPanel.widgets?.length?xt(await this.svc.previewWidgetDetailPanelDefinition(e.detailPanel),t.id):[]:e.templateId?xt(await this.svc.previewWidgetTemplateDetailPanel(e.templateId),t.id):[]}static \u0275fac=function(e){return new(e||i)};static \u0275prov=ie({token:i,factory:i.\u0275fac,providedIn:"root"})};function yt(i){return!!i&&i.matchCount>0&&!i.sampleMatches?.length}function ri(i){return!i||yt(i)?!1:i.matchCount>Math.min(i.sampleMatches?.length??0,3)}function li(i,t,e){return e&&t?t:i?.sampleMatches?.slice(0,3)??[]}function si(i,t){return!!i&&!!t&&t.length<i.matchCount}function bt(i){let t=i?.status;return t===503?"unavailable":t===403?"forbidden":"failed"}function di(i,t,e){let n=e||"Working",o=i.map(p=>p.id==="thinking"&&p.status==="running"?T(w({},p),{status:"done"}):p),a=o.findIndex(p=>p.status==="running"&&p.baseLabel===n);if(a>=0){let p=o[a],x=[...o];return x[a]=T(w({},p),{callIds:[...p.callIds,t],pending:p.pending+1}),x}return[...o,{id:t,callIds:[t],pending:1,baseLabel:n,label:n,status:"running"}]}function ci(i,t,e,n){return i.map(o=>{if(!o.callIds.includes(t))return o;let a=Math.max(0,o.pending-1);return T(w({},o),{pending:a,detail:n?o.detail:e||o.detail,status:a===0?"done":o.status})})}function vt(i){let{finishReason:t,sawError:e,producedContent:n}=i;return t==="error"?!0:t==null?e:e&&!n}var pi=i=>T(w({},i),{isStreaming:!1,thinking:void 0,hasError:!0});function _i(i,t,e){return i.some(n=>n.id===t)?i.map(n=>n.id===t?pi(n):n):[...i,pi(e(t))]}var Ze=class i{http=N(_e);tokenStore=N(ae);get customerId(){return I().customerId??this.tokenStore.tenantId()??""}get productId(){return I().productId??ge()}get apiUrl(){return`${I().baseUrl}/api/customers/${this.customerId}/products/${this.productId}/workforcebot/forecast`}cachedContext=null;context(){return this.cachedContext?this.cachedContext:(this.cachedContext=E(this.http.get(`${this.apiUrl}/context`)).catch(t=>(console.info('[ask-aquera] forecast context unavailable \u2014 "forecast this" will not be claimed.',t),null)),this.cachedContext)}async compute(t){try{return await E(this.http.post(`${this.apiUrl}/compute`,t))}catch(e){let n=e,o=n?.error?.error;throw Object.assign(new Error(o||`Forecast failed (HTTP ${n?.status??"?"})`),{status:n?.status,code:n?.error?.code,isRefusal:n?.status===422})}}static \u0275fac=function(e){return new(e||i)};static \u0275prov=ie({token:i,factory:i.\u0275fac,providedIn:"root"})};var Xi=[/\bforecast(?:ing|s|ed)?\b/i,/\bpredict(?:ion|ions|ive|s|ed)?\b/i,/\bproject(?:ion|ions|ed)\b/i,/\bproject\s+(?:our|the|this|that|my|its|their|his|her|forward)\b/i,/\bproject\s+\w+(?:\s+\w+)?\s+forward\b/i,/\bextrapolat\w*/i,/\bnext\s+(?:week|month|quarter|year|\d+\s+(?:weeks?|months?|quarters?|years?))\b/i,/\bby\s+(?:year[-\s]?end|end\s+of\s+(?:the\s+)?year|EOY)\b/i,/\bby\s+Q[1-4]\b/i,/\bthrough\s+(?:year[-\s]?end|end\s+of\s+(?:the\s+)?year)\b/i,/\bhow\s+many\s+\w+\s+will\s+we\b/i,/\bwhat\s+will\s+\w+\s+(?:be|look\s+like)\b/i,/\btrend\s+(?:this\s+)?forward\b/i,/\brun[-\s]?rate\s+to\b/i],Ji=[/\bforecast\s+(?:this|that|it)\b/i,/\bextend\s+(?:this|that|it)\b/i,/\bproject\s+(?:this|that|it)\s+forward\b/i,/\btrend\s+(?:this|that|it)\s+forward\b/i,/\b(?:this|that)\s+chart\b/i,/\bsame\s+chart\b/i],Zi={Weekly:{week:1,month:4,quarter:13,year:52},Monthly:{week:1,month:1,quarter:3,year:12},Quarterly:{week:1,month:1,quarter:1,year:4},Yearly:{week:1,month:1,quarter:1,year:1}},eo=[[/\b(?:weekly|by\s+week|per\s+week|week\s+over\s+week)\b/i,"Weekly"],[/\b(?:monthly|by\s+month|per\s+month|month\s+over\s+month)\b/i,"Monthly"],[/\b(?:quarterly|by\s+quarter|per\s+quarter)\b/i,"Quarterly"],[/\b(?:yearly|annually|annual|per\s+year)\b|\bby\s+year\b(?!\s*-?\s*end)/i,"Yearly"]];function wt(i,t,e=new Date){let n=(i??"").trim();if(!n)return null;let o=Ji.some(x=>x.test(n)),a=to(n,Xi);if(!a&&!o)return null;let p=no(n);return{extendsExisting:o,metric:io(n,t),horizon:oo(n,p??t.defaults.granularity,e),granularity:p,trigger:a||"refers to an existing chart"}}function to(i,t){for(let e of t){let n=e.exec(i);if(n)return n[0]}return""}function no(i){for(let[t,e]of eo)if(t.test(i))return e}function io(i,t){let e=i.toLowerCase();return t.metrics.flatMap(o=>[o.label,...o.aliases].map(a=>({id:o.id,alias:a.toLowerCase()}))).sort((o,a)=>a.alias.length-o.alias.length).find(o=>e.includes(o.alias))?.id}function oo(i,t,e){let n=Zi[t],o=/\bnext\s+(\d+)\s+(weeks?|months?|quarters?|years?)\b/i.exec(i);if(o){let x=Number(o[1]),v=o[2].toLowerCase().replace(/s$/,"");return Math.max(1,Math.round(x*n[v]))}let a=/\bnext\s+(week|month|quarter|year)\b/i.exec(i);if(a){let x=a[1].toLowerCase();return Math.max(1,n[x])}if(/\b(?:by|through)\s+(?:year[-\s]?end|end\s+of\s+(?:the\s+)?year|EOY)\b/i.test(i))return ao(t,e);let p=/\bby\s+Q([1-4])\b/i.exec(i);if(p)return ro(t,Number(p[1]),e)}function ao(i,t){let e=12-(t.getMonth()+1);return Math.max(1,gi(e,i))}function ro(i,t,e){let n=Math.floor(e.getMonth()/3)+1,o=t>=n?t-n:4-n+t,a=Math.max(1,o*3);return Math.max(1,gi(a,i))}function gi(i,t){switch(t){case"Weekly":return Math.round(i*4.345);case"Quarterly":return Math.max(1,Math.round(i/3));case"Yearly":return Math.max(1,Math.round(i/12));default:return i}}var lo=new Set(["line","area","spline","areaspline"]),kt="(?:jan|feb|mar|apr|may|jun|jul|aug|sep|sept|oct|nov|dec)[a-z]*",le="(?:19|20)\\d{2}",ui="(?:0?[1-9]|[12]\\d|3[01])",Pt="(?:0?[1-9]|1[0-2])",so=[new RegExp(`^${le}[-/.]${Pt}(?:[-/.]${ui})?$`,"i"),new RegExp(`^${ui}[-/.]${Pt}[-/.]${le}$`,"i"),new RegExp(`^${Pt}[-/.]${le}$`,"i"),new RegExp(`^${le}-?w\\d{1,2}$`,"i"),new RegExp(`^w(?:ee)?k\\s*\\d{1,2}[,\\s]+${le}$`,"i"),new RegExp(`^${kt}[\\s-]*'?\\d{2}$`,"i"),new RegExp(`^${kt}[\\s-]*${le}$`,"i"),new RegExp(`^${le}[\\s-]*${kt}$`,"i"),new RegExp(`^q[1-4][\\s-]*${le}$`,"i"),new RegExp(`^${le}[\\s-]*q[1-4]$`,"i"),new RegExp("^fy\\s*'?\\d{2,4}$","i"),new RegExp(`^${le}$`)];function co(i){let t=(i??[]).map(n=>String(n??"").trim()).filter(Boolean);return t.length<3?!1:t.filter(n=>so.some(o=>o.test(n))).length/t.length>=.8}var po=[/forecast/i,/confidence/i,/project/i,/upper|lower/i,/band/i,/target/i],hi=3;function et(i){return i?.config?.chart??i?.chart??{}}function Ci(i){let t=et(i);return t?.enableForecasting===!0?!0:(Array.isArray(t?.data)?t.data:[]).some(n=>Array.isArray(n?.projected)&&n.projected.length>0)}function tt(i){let t=et(i),e=String(t?.type??"").toLowerCase();if(!lo.has(e))return!1;let n=_o(i);if(!n||n.values.length<hi)return!1;let o=bi(t);return o.length?co(o):!!n.times?.length}function _o(i){let t=et(i),e=yi(t);if(!e.length)return null;let n=e.find(o=>!vi(o.name))??e[0];return xi(t,n)}function fi(i){let t=et(i),e=yi(t).filter(o=>!vi(o.name)),n=[];return e.forEach((o,a)=>{let p=xi(t,o);p&&n.push(T(w({},p),{name:o.name||(e.length>1?`Series ${a+1}`:"")}))}),n}function xi(i,t){let e=uo(t.data),n=e.map(p=>p.value);if(n.length<hi)return null;let o=e.every(p=>p.time!==void 0)?e.map(p=>p.time):void 0,a=bi(i).slice(0,n.length);return w({labels:a.length===n.length?a:o?o.map(p=>go(p)):n.map((p,x)=>String(x+1)),values:n},o?{times:o}:{})}function go(i){return new Date(i).toLocaleDateString("en-US",{month:"short",year:"numeric"})}function yi(i){let t=i?.options?.series;if(Array.isArray(t)&&t.length)return t.filter(n=>Array.isArray(n?.data)).map(n=>({name:String(n.name??""),data:n.data}));let e=i?.data;return Array.isArray(e)&&e.length?e.every(n=>typeof n=="number"||n===null)?[{name:"",data:e}]:e.filter(n=>Array.isArray(n?.data)||Array.isArray(n?.actual)).map(n=>({name:String(n.name??""),data:Array.isArray(n.actual)?n.actual:n.data})):[]}function bi(i){let t=i?.categories;if(Array.isArray(t)&&t.length)return t.map(String);let e=i?.options?.xAxis?.categories;return Array.isArray(e)&&e.length?e.map(String):[]}function vi(i){return po.some(t=>t.test(i))}function uo(i){let t=[];for(let e of i){let n=mo(e);if(n===null)break;t.push(n)}return t}function mo(i){if(typeof i=="number"&&Number.isFinite(i))return{value:i};if(Array.isArray(i)&&i.length===2&&typeof i[1]=="number")return w({value:i[1]},typeof i[0]=="number"?{time:i[0]}:{});if(i&&typeof i=="object"&&typeof i.y=="number"){let t=i;return w({value:t.y},typeof t.x=="number"?{time:t.x}:{})}return null}var Mt={Weekly:{Weekly:1,Monthly:4,Quarterly:13,Yearly:52},Monthly:{Monthly:1,Quarterly:3,Yearly:12},Quarterly:{Quarterly:1,Yearly:4},Yearly:{Yearly:1}},At={Weekly:{plural:"weeks",singular:"week",adjective:"weekly"},Monthly:{plural:"months",singular:"month",adjective:"monthly"},Quarterly:{plural:"quarters",singular:"quarter",adjective:"quarterly"},Yearly:{plural:"years",singular:"year",adjective:"yearly"}},mi=4;function ho(i,t,e){let n=Mt[t]?.[e];return n?Math.max(1,Math.floor(i/n)):null}function wi(i,t,e){return e.map(n=>{let o=At[n]??At.Monthly,a=ho(t,i,n);return a===null?{value:n,enabled:!1,fittedPeriods:0,maxHorizon:0,label:o,reason:`needs ${o.adjective} data, but this series is ${At[i]?.adjective??i.toLowerCase()}`}:a<mi?{value:n,enabled:!1,fittedPeriods:a,maxHorizon:0,label:o,reason:`only ${a} ${a===1?o.singular:o.plural} of history, needs at least ${mi}`}:{value:n,enabled:!0,fittedPeriods:a,maxHorizon:Math.max(1,Math.floor(a/2)),label:o}})}function ki(i,t,e,n){if(t===e)return Math.max(1,Math.min(i,n));let o=Mt[t]?.[e],a=Mt[e]?.[t],p=o?i/o:a?i*a:i;return Math.max(1,Math.min(Math.round(p),n))}var Co="#2970FF",Pi="#7A5AF8";var Ai={Weekly:6048e5,Monthly:26298e5,Quarterly:78894e5,Yearly:315576e5},Mi={Weekly:"Week",Monthly:"Month",Quarterly:"Quarter",Yearly:"Year"};function fo(i,t){if(i.times?.length===i.values.length)return i.times;let e=Date.now(),n=i.values.length;return i.values.map((o,a)=>Math.round(e-(n-1-a)*t))}function Si(i,t){let e=new Date(i);switch(t){case"Weekly":return e.toLocaleDateString("en-US",{day:"numeric",month:"short",year:"numeric"});case"Quarterly":return`Q${Math.floor(e.getMonth()/3)+1} ${e.getFullYear()}`;case"Yearly":return String(e.getFullYear());default:return e.toLocaleDateString("en-US",{month:"short",year:"numeric"})}}function Ti(i,t){let e=Ai[i.granularity]??Ai.Monthly,n=fo(i.history,e),o=n[n.length-1]??Date.now(),a=i.forecastTimes?.length===t.length?i.forecastTimes:t.map((P,z)=>Math.round(o+(z+1)*e)),p=t.length>0,x=[...n.map(P=>Si(P,i.granularity)),...p?a.map(P=>Si(P,i.granularity)):[]],v=(i.series?.length??0)>1,A=v?i.series.map(P=>w({name:P.note?`${P.name} \xB7 ${P.note}`:P.name,actual:P.values},P.points?.length?{projected:P.points.map(z=>z.value),interval:P.points.map(z=>[z.low,z.high])}:{})):[w({name:"Actuals",color:Co,actual:i.history.values},p?{projected:t.map(P=>P.value),interval:t.map(P=>[P.low,P.high])}:{})],S={type:"line",enableForecasting:!0,categories:x,data:A,lineWidth:2,showMarkers:!1,valueSuffix:i.valueSuffix??"",xAxisTitle:Mi[i.granularity]??Mi.Monthly,projection:T(w({start:null},v?{}:{color:Pi}),{dashStyle:"Dash",showNowLine:!0,nowLabel:"",bandLabel:"Projected",interval:T(w({name:`${i.confidence}% confidence`},v?{}:{color:Pi}),{opacity:.16,level:i.confidence})}),legend:{show:!0},height:"400px",loading:!1,options:{}};return{title:i.chartTitle,componentName:"nile-line-chart",widgetType:"chart",config:{aq:{chartTitle:i.chartTitle,chartSubtitle:i.chartSubtitle},chart:S},queryMeta:{sql:`-- forecast:${i.metric}`}}}function St(i,t=[]){let e=i.guardrails?.passed?i.points??[]:[],n=e[e.length-1],o=w({horizon:i.horizon,confidence:i.confidence,granularity:i.granularity},n?{value:n.value,low:n.low,high:n.high}:{}),a=e.length?qe(i.narrative,o):i.guardrails?.body?`I can't forecast this reliably. ${i.guardrails.body}`:"I can't forecast this series.",p=xo(i,t),x=i.skipped??[],v=(i.meta??[]).map(A=>({label:A.label,value:qe(A.value,o)}));return x.length&&p.length>1&&v.push({label:"Series",value:`${p.length-x.length} of ${p.length} forecast \u2014 ${x.map(A=>A.name).join(", ")} left as history`}),{chart:yo(i,e,p),answer:a,meta:v,points:e,horizon:i.horizon,granularity:i.granularity,confidence:i.confidence,maxHorizon:i.maxHorizon}}function xo(i,t){let e=i.forecasts??[];if(e.length<2&&!(i.skipped?.length&&e.length))return[];let n=p=>String(p??"").toLowerCase().replace(/[^a-z0-9]/g,""),o=new Map(t.map(p=>[n(p.name??""),p])),a=e.map(p=>({name:p.name,values:p.history?.values??o.get(n(p.name))?.values??[],points:i.guardrails?.passed?p.points??[]:[]}));for(let p of i.skipped??[]){let x=o.get(n(p.name));x?.values?.length&&a.push({name:p.name,values:x.values,note:"not forecast"})}return a}function yo(i,t,e=[]){return Ti(e.length?T(w({},i),{series:e}):i,t)}function qe(i,t){return String(i??"").replace(/\{\{(\w+)\}\}/g,(e,n)=>n in t?String(t[n]):e)}function Tt(i){if(i.forecast||i.isStreaming||i.charts?.length!==1)return!1;let t=i.charts[0]?.config;return Ci(t)?!1:tt(t)}var vo=["aqChat"],wo=["artifactGrid"],ko=["composerEl"],Po=["aiExecutiveSummary"],Ao=()=>[1,2,3,4],Se=()=>[],Fi=i=>({$implicit:i}),te=(i,t)=>t.id,se=(i,t)=>t.key,Mo=(i,t)=>t.templateId,So=(i,t)=>t.identityKey,Oi=(i,t)=>t.label,Ei=(i,t)=>t.component,To=(i,t)=>t.name,nt=(i,t)=>t.value,qo=(i,t)=>t.action,Do=(i,t)=>t.datasetId,Fo=(i,t)=>t.schema+"."+t.name;function Oo(i,t){if(i&1){let e=k();s(0,"button",32),u("click",function(){_(e);let o=r();return g(o.addReplyQuote())}),C(1,"nile-glyph",33),c(2),d()}if(i&2){let e=t,n=r();Z("top",e.top,"px")("left",e.left,"px"),W("reply-badge--below",!e.above),l(2),q(" ",n.copy().replyButton," ")}}function Eo(i,t){if(i&1&&(s(0,"nile-nav-tab",50),c(1),d()),i&2){let e=r(3);l(),y(e.copy().chatTabLabel)}}function Io(i,t){if(i&1&&(s(0,"nile-nav-tab",51),c(1),d()),i&2){let e=r(3);l(),y(e.copy().libraryTabLabel)}}function Vo(i,t){if(i&1&&(s(0,"nile-nav-tab",52),c(1),d()),i&2){let e=r(3);l(),y(e.copy().toolsTabLabel)}}function Ro(i,t){if(i&1){let e=k();s(0,"nile-nav-tab-group",49),u("nile-tab-change",function(o){_(e);let a=r(2);return g(a.setChatPaneTab(o.detail.value))}),m(1,Eo,2,1,"nile-nav-tab",50),m(2,Io,2,1,"nile-nav-tab",51),m(3,Vo,2,1,"nile-nav-tab",52),d()}if(i&2){let e=r(2);M("value",e.chatPaneTab()),l(),h(e.features().chat?1:-1),l(),h(e.features().library?2:-1),l(),h(e.features().tools?3:-1)}}function zo(i,t){if(i&1){let e=k();s(0,"span",37),C(1,"nile-glyph",53),s(2,"span",54),c(3),d(),s(4,"button",55),u("click",function(){_(e);let o=r(2);return g(o.clearScope())}),C(5,"nile-glyph",56),d()()}if(i&2){let e=t;l(),b("name",e.kind==="dataset"?"ng-database":"ng-dataflow-04"),l(2),Y("",e.kind==="dataset"?"Dataset":"Pipeline",": ",e.name)}}function No(i,t){i&1&&(s(0,"div",66),C(1,"nile-skeleton-loader",67)(2,"nile-skeleton-loader",68),d())}function Lo(i,t){i&1&&C(0,"nile-glyph",72)}function $o(i,t){if(i&1){let e=k();s(0,"nile-menu-item",70),u("click",function(){let o=_(e).$implicit,a=r(5);return g(a.selectScope("dataset",o))}),s(1,"span",71),c(2),d(),m(3,Lo,1,0,"nile-glyph",72),d()}if(i&2){let e,n=t.$implicit,o=r(5);l(2),y(n.name),l(),h(((e=o.selectedScope())==null?null:e.id)===n.id?3:-1)}}function Wo(i,t){if(i&1&&(s(0,"div",69),c(1),d()),i&2){let e=r(5);l(),y(e.copy().noDatasetsFound)}}function Bo(i,t){if(i&1&&F(0,$o,4,2,"nile-menu-item",null,te,!1,Wo,2,1,"div",69),i&2){let e=r(4);O(e.datasets())}}function Uo(i,t){if(i&1&&(s(0,"nile-menu-item")(1,"nile-dropdown",61)(2,"span",62),C(3,"nile-glyph",63),s(4,"span",64),c(5,"Dataset"),d(),C(6,"nile-glyph",65),d(),s(7,"nile-menu"),m(8,No,3,0,"div",66)(9,Bo,3,1),d()()()),i&2){let e=r(3);l(8),h(e.scopeLoading()?8:9)}}function Go(i,t){i&1&&(s(0,"div",66),C(1,"nile-skeleton-loader",67)(2,"nile-skeleton-loader",68),d())}function jo(i,t){i&1&&C(0,"nile-glyph",72)}function Ho(i,t){if(i&1){let e=k();s(0,"nile-menu-item",70),u("click",function(){let o=_(e).$implicit,a=r(5);return g(a.selectScope("pipeline",o))}),s(1,"span",71),c(2),d(),m(3,jo,1,0,"nile-glyph",72),d()}if(i&2){let e,n=t.$implicit,o=r(5);l(2),y(n.name),l(),h(((e=o.selectedScope())==null?null:e.id)===n.id?3:-1)}}function Yo(i,t){if(i&1&&(s(0,"div",69),c(1),d()),i&2){let e=r(5);l(),y(e.copy().noPipelinesFound)}}function Ko(i,t){if(i&1&&F(0,Ho,4,2,"nile-menu-item",null,te,!1,Yo,2,1,"div",69),i&2){let e=r(4);O(e.pipelines())}}function Qo(i,t){if(i&1&&(s(0,"nile-menu-item")(1,"nile-dropdown",61)(2,"span",62),C(3,"nile-glyph",73),s(4,"span",64),c(5,"Pipeline"),d(),C(6,"nile-glyph",65),d(),s(7,"nile-menu"),m(8,Go,3,0,"div",66)(9,Ko,3,1),d()()()),i&2){let e=r(3);l(8),h(e.scopeLoading()?8:9)}}function Xo(i,t){if(i&1){let e=k();s(0,"nile-dropdown",57),u("nile-hide",function(){_(e);let o=r(2);return g(o.closeScopeMenu())}),s(1,"nile-lite-tooltip",58)(2,"button",59),u("click",function(){_(e);let o=r(2);return g(o.openScopeMenu())}),C(3,"nile-glyph",60),d()(),s(4,"nile-menu"),m(5,Uo,10,1,"nile-menu-item"),m(6,Qo,10,1,"nile-menu-item"),d()()}if(i&2){let e=r(2);b("open",e.showScopePicker()),l(5),h(e.features().scopePicker.dataset?5:-1),l(),h(e.features().scopePicker.pipeline?6:-1)}}function Jo(i,t){if(i&1&&(s(0,"nile-menu-item",74)(1,"div",75),C(2,"nile-skeleton-loader",76),s(3,"div",77),C(4,"nile-skeleton-loader",78)(5,"nile-skeleton-loader",79),d()()()),i&2){let e=t.$implicit;l(3),Z("max-width",e,"px")}}function Zo(i,t){if(i&1&&F(0,Jo,6,2,"nile-menu-item",74,G),i&2){let e=r(2);O(e.menuSkeletonRows)}}function ea(i,t){if(i&1&&(s(0,"div",46),c(1),d()),i&2){let e=r(2);l(),y(e.copy().noResultsMatchFilters)}}function ta(i,t){if(i&1){let e=k();s(0,"input",88),u("ngModelChange",function(o){_(e);let a=r(5);return g(a.renameDraft.set(o))})("click",function(o){return o.stopPropagation()})("keydown.enter",function(o){_(e);let a=r().$implicit,p=r(4);return g(p.commitRenameConversation(o,a))})("keydown.escape",function(o){_(e);let a=r(5);return g(a.cancelRename(o))})("blur",function(o){_(e);let a=r().$implicit,p=r(4);return g(p.commitRenameConversation(o,a))}),d()}if(i&2){let e=r(5);b("ngModel",e.renameDraft())}}function na(i,t){if(i&1&&(s(0,"span",89),c(1),d(),s(2,"span",90),c(3),d()),i&2){let e=r().$implicit,n=r(4);b("title",e.title||"Untitled"),l(),y(e.title||"Untitled"),l(2),y(n.conversationMeta(e))}}function ia(i,t){if(i&1){let e=k();s(0,"nile-menu-item",70),u("click",function(){let o=_(e).$implicit,a=r(4);return g(a.selectConversation(o.id))}),s(1,"div",75),C(2,"nile-glyph",81),s(3,"div",77),m(4,ta,1,1,"input",82)(5,na,4,3),d(),s(6,"div",83)(7,"button",84),u("click",function(o){let a=_(e).$implicit,p=r(4);return g(p.startRename(o,a.id,a.title))}),C(8,"nile-glyph",85),d(),s(9,"button",86),u("click",function(o){let a=_(e).$implicit,p=r(4);return g(p.deleteConversation(o,a.id))}),C(10,"nile-glyph",87),d()()()()}if(i&2){let e=t.$implicit,n=r(4);M("active",e.id===n.activeConversationId()?"":null),l(4),h(n.renamingId()===e.id?4:5),l(3),M("aria-label",n.copy().renameLabel),l(2),M("aria-label",n.copy().deleteLabel)}}function oa(i,t){if(i&1&&(s(0,"div",80),c(1),d(),F(2,ia,11,4,"nile-menu-item",null,te)),i&2){let e=t.$implicit;l(),y(e.label),l(),O(e.items)}}function aa(i,t){if(i&1&&(s(0,"div",46),c(1),d()),i&2){let e=r(3);l(),y(e.copy().noConversationsYet)}}function ra(i,t){if(i&1&&F(0,oa,4,1,null,null,se,!1,aa,2,1,"div",46),i&2){let e=r(2);O(e.groupedConversations())}}function la(i,t){if(i&1&&(s(0,"nile-menu-item",74)(1,"div",75),C(2,"nile-skeleton-loader",76),s(3,"div",77),C(4,"nile-skeleton-loader",78)(5,"nile-skeleton-loader",95),d()()()),i&2){let e=t.$implicit;l(3),Z("max-width",e,"px")}}function sa(i,t){if(i&1&&F(0,la,6,2,"nile-menu-item",74,G),i&2){let e=r(3);O(e.menuSkeletonRows)}}function da(i,t){if(i&1&&(s(0,"div",46),c(1),d()),i&2){let e=r(3);l(),y(e.copy().noResultsMatchFilters)}}function ca(i,t){if(i&1){let e=k();s(0,"input",88),u("ngModelChange",function(o){_(e);let a=r(6);return g(a.renameDraft.set(o))})("click",function(o){return o.stopPropagation()})("keydown.enter",function(o){_(e);let a=r().$implicit,p=r(5);return g(p.commitRenameDashboard(o,a))})("keydown.escape",function(o){_(e);let a=r(6);return g(a.cancelRename(o))})("blur",function(o){_(e);let a=r().$implicit,p=r(5);return g(p.commitRenameDashboard(o,a))}),d()}if(i&2){let e=r(6);b("ngModel",e.renameDraft())}}function pa(i,t){if(i&1&&(s(0,"span",89),c(1),d(),s(2,"span",90),c(3),d()),i&2){let e=r().$implicit,n=r(5);b("title",e.name||"Untitled"),l(),y(e.name||"Untitled"),l(2),y(n.dashboardMeta(e))}}function _a(i,t){if(i&1){let e=k();s(0,"nile-menu-item",70),u("click",function(){let o=_(e).$implicit,a=r(5);return g(a.openRelatedDashboard(o.id))}),s(1,"div",75),C(2,"nile-glyph",96),s(3,"div",77),m(4,ca,1,1,"input",82)(5,pa,4,3),d(),s(6,"div",83)(7,"button",84),u("click",function(o){let a=_(e).$implicit,p=r(5);return g(p.startRename(o,a.id,a.name))}),C(8,"nile-glyph",85),d(),s(9,"button",86),u("click",function(o){let a=_(e).$implicit,p=r(5);return g(p.deleteDashboardFromMenu(o,a.id))}),C(10,"nile-glyph",87),d()()()()}if(i&2){let e=t.$implicit,n=r(5);M("active",n.builderOpen()&&e.id===n.builderDashboardId()?"":null),l(4),h(n.renamingId()===e.id?4:5),l(3),M("aria-label",n.copy().renameLabel),l(2),M("aria-label",n.copy().deleteLabel)}}function ga(i,t){if(i&1&&(s(0,"div",80),c(1),d(),F(2,_a,11,4,"nile-menu-item",null,te)),i&2){let e=t.$implicit;l(),y(e.label),l(),O(e.items)}}function ua(i,t){if(i&1&&(s(0,"div",46),c(1),d()),i&2){let e=r(4);l(),y(e.copy().noDashboardsYet)}}function ma(i,t){if(i&1&&F(0,ga,4,1,null,null,se,!1,ua,2,1,"div",46),i&2){let e=r(3);O(e.groupedDashboards())}}function ha(i,t){if(i&1){let e=k();s(0,"nile-dropdown",91),u("nile-hide",function(){_(e);let o=r(2);return g(o.showRelatedDashboards.set(!1))}),s(1,"nile-lite-tooltip",92)(2,"button",93),u("click",function(){_(e);let o=r(2);return g(o.showRelatedDashboards.set(!o.showRelatedDashboards()))}),C(3,"nile-glyph",94),d()(),s(4,"nile-menu",43),u("nile-search-value",function(o){_(e);let a=r(2);return g(a.dashSearch.set((o.detail==null?null:o.detail.value)??""))}),s(5,"nile-menu-item",44),u("click",function(){_(e);let o=r(2);return g(o.openNewDashboard())}),C(6,"nile-glyph",45),c(7),d(),m(8,sa,2,0)(9,da,2,1,"div",46)(10,ma,3,1),d()()}if(i&2){let e=r(2);b("open",e.showRelatedDashboards()),l(4),M("noResultsMessage",e.copy().noResultsMatchFilters),l(3),q(" ",e.copy().newDashboardLabel," "),l(),h(e.dashboardsLoading()?8:e.dashSearchEmpty()?9:10)}}function Ca(i,t){if(i&1){let e=k();s(0,"nile-lite-tooltip",48)(1,"button",97),u("click",function(){_(e);let o=r(2);return g(o.openGallery())}),C(2,"nile-glyph",98),d()()}}function fa(i,t){if(i&1){let e=k();s(0,"header",12)(1,"div",34),m(2,Ro,4,4,"nile-nav-tab-group",35),d(),s(3,"div",36),m(4,zo,6,3,"span",37),m(5,Xo,7,3,"nile-dropdown",38),s(6,"nile-dropdown",39),u("nile-hide",function(){_(e);let o=r();return g(o.showConversationPicker.set(!1))}),s(7,"nile-lite-tooltip",40)(8,"button",41),u("click",function(){_(e);let o=r();return g(o.showConversationPicker.set(!o.showConversationPicker()))}),C(9,"nile-glyph",42),d()(),s(10,"nile-menu",43),u("nile-search-value",function(o){_(e);let a=r();return g(a.convSearch.set((o.detail==null?null:o.detail.value)??""))}),s(11,"nile-menu-item",44),u("click",function(){_(e);let o=r();return g(o.newConversation())}),C(12,"nile-glyph",45),c(13),d(),m(14,Zo,2,0)(15,ea,2,1,"div",46)(16,ra,3,1),d()(),m(17,ha,11,4,"nile-dropdown",47),m(18,Ca,3,0,"nile-lite-tooltip",48),d()()}if(i&2){let e,n=r();l(2),h(n.tabsVisible()?2:-1),l(2),h((e=n.features().connections&&n.selectedScope())?4:-1,e),l(),h(n.features().scopePicker.enabled?5:-1),l(),b("open",n.showConversationPicker()),l(2),b("disabled",n.isStreaming()),l(2),M("noResultsMessage",n.copy().noResultsMatchFilters),l(3),q(" ",n.copy().newConversationLabel," "),l(),h(n.conversationsLoading()?14:n.convSearchEmpty()?15:16),l(3),h(n.features().dashboardsMenu?17:-1),l(),h(n.features().promptGallery?18:-1)}}function xa(i,t){if(i&1){let e=k();s(0,"button",112),u("click",function(){let o=_(e).$implicit,a=r(4);return g(a.selectWidgetTemplateCategory(o.key))}),c(1),s(2,"span",113),c(3),d()()}if(i&2){let e=t.$implicit,n=r(4);W("aq-picker-chip--active",n.widgetTemplateActiveCategory()===e.key),l(),q("",e.label," "),l(2),y(n.widgetTemplateCountForCategory(e.key))}}function ya(i,t){if(i&1){let e=k();s(0,"div",110)(1,"button",112),u("click",function(){_(e);let o=r(3);return g(o.selectWidgetTemplateCategory("all"))}),c(2),s(3,"span",113),c(4),d()(),F(5,xa,4,4,"button",114,se),d()}if(i&2){let e=r(3);l(),W("aq-picker-chip--active",e.widgetTemplateActiveCategory()==="all"),l(),q("",e.copy().libraryAllCategoryLabel," "),l(2),y(e.widgetTemplateAllTemplates().length),l(),O(e.templateCategories())}}function ba(i,t){if(i&1&&C(0,"nile-skeleton-loader",116),i&2){let e=t.$implicit;Z("width",e,"px")}}function va(i,t){if(i&1&&(s(0,"div",111),F(1,ba,1,2,"nile-skeleton-loader",115,G),d()),i&2){let e=r(3);l(),O(e.libraryChipSkeletonWidths)}}function wa(i,t){if(i&1){let e=k();s(0,"nile-input",108),u("nile-input",function(o){_(e);let a=r(2);return g(a.librarySearch.set((o.detail==null?null:o.detail.value)??""))})("nile-change",function(o){_(e);let a=r(2);return g(a.librarySearch.set((o.detail==null?null:o.detail.value)??""))}),C(1,"nile-glyph",109),d(),m(2,ya,7,4,"div",110)(3,va,3,0,"div",111)}if(i&2){let e=r(2);b("placeholder",e.copy().librarySearchWidgetsPlaceholder)("value",e.librarySearch()),l(2),h(!e.templateCategoriesLoading()&&!e.widgetTemplateTemplatesLoading()?2:3)}}function ka(i,t){if(i&1){let e=k();s(0,"button",112),u("click",function(){let o=_(e).$implicit,a=r(4);return g(a.selectTemplateCategory(o.key))}),c(1),s(2,"span",113),c(3),d()()}if(i&2){let e=t.$implicit,n=r(4);W("aq-picker-chip--active",n.templateActiveCategory()===e.key),l(),q("",e.label," "),l(2),y(n.templateCountForCategory(e.key))}}function Pa(i,t){if(i&1){let e=k();s(0,"div",110)(1,"button",112),u("click",function(){_(e);let o=r(3);return g(o.selectTemplateCategory("all"))}),c(2),s(3,"span",113),c(4),d()(),F(5,ka,4,4,"button",114,se),d()}if(i&2){let e=r(3);l(),W("aq-picker-chip--active",e.templateActiveCategory()==="all"),l(),q("",e.copy().libraryAllCategoryLabel," "),l(2),y(e.templateAllTemplates().length),l(),O(e.templateCategories())}}function Aa(i,t){if(i&1&&C(0,"nile-skeleton-loader",116),i&2){let e=t.$implicit;Z("width",e,"px")}}function Ma(i,t){if(i&1&&(s(0,"div",111),F(1,Aa,1,2,"nile-skeleton-loader",115,G),d()),i&2){let e=r(3);l(),O(e.libraryChipSkeletonWidths)}}function Sa(i,t){if(i&1){let e=k();s(0,"nile-input",108),u("nile-input",function(o){_(e);let a=r(2);return g(a.librarySearch.set((o.detail==null?null:o.detail.value)??""))})("nile-change",function(o){_(e);let a=r(2);return g(a.librarySearch.set((o.detail==null?null:o.detail.value)??""))}),C(1,"nile-glyph",109),d(),m(2,Pa,7,4,"div",110)(3,Ma,3,0,"div",111)}if(i&2){let e=r(2);b("placeholder",e.copy().librarySearchDashboardsPlaceholder)("value",e.librarySearch()),l(2),h(e.templateCategoriesLoading()?3:2)}}function Ta(i,t){if(i&1&&(s(0,"div",123),C(1,"nile-skeleton-loader",124)(2,"nile-skeleton-loader",125)(3,"nile-skeleton-loader",126)(4,"nile-skeleton-loader",127),d()),i&2){let e=t.$implicit;l(),M("width",e)}}function qa(i,t){if(i&1&&(s(0,"div",118)(1,"div",119),C(2,"nile-skeleton-loader",120)(3,"nile-skeleton-loader",121),d(),s(4,"div",122),F(5,Ta,5,1,"div",123,G),d()()),i&2){let e=t.$implicit;l(5),O(e)}}function Da(i,t){if(i&1&&(s(0,"div",117),F(1,qa,7,0,"div",118,G),d()),i&2){let e=r(3);l(),O(e.librarySkeletonGroups)}}function Fa(i,t){if(i&1){let e=k();s(0,"div",132),u("click",function(){let o=_(e).$implicit,a=r(6);return g(a.openWidgetDetailFromCard(o.templateId))}),C(1,"nile-kpi-chart",133),s(2,"button",134),u("click",function(o){let a=_(e).$implicit,p=r(6);return o.stopPropagation(),g(p.toggleWidgetTemplateSelection(a.templateId))}),C(3,"nile-glyph",135),d()()}if(i&2){let e=t.$implicit,n=r(6);W("aq-lib-card-wrap--selected",n.widgetTemplatePickerSelectedIds().includes(e.templateId)),l(),b("label",e.title)("description",e.desc??"")("value",e.value)("loading",e.loading)("sparkline",e.sparkline)("options",n.libraryKpiChartOptions)("sparklineColor",n.brandSparklineColor()),l(),W("aq-lib-card__check--on",n.widgetTemplatePickerSelectedIds().includes(e.templateId))}}function Oa(i,t){if(i&1){let e=k();s(0,"div",118)(1,"div",119)(2,"span",129),c(3),d(),s(4,"button",130),u("click",function(){let o=_(e).$implicit,a=r(5);return g(a.toggleLibraryGroupSelection(o.cards))}),c(5),d()(),s(6,"div",122),F(7,Fa,4,11,"div",131,Mo),d()()}if(i&2){let e=t.$implicit,n=r(5);l(3),Y("",e.label," \xB7 ",e.cards.length),l(2),q(" ",n.isGroupFullySelected(e.cards)?n.copy().libraryClearSelectionButton:n.copy().librarySelectAllButton," "),l(2),O(e.cards)}}function Ea(i,t){if(i&1&&F(0,Oa,9,3,"div",118,se),i&2){let e=r(4);O(e.libraryWidgetGroups())}}function Ia(i,t){if(i&1&&(s(0,"div",128),c(1),d()),i&2){let e=r(4);l(),y(e.librarySearch()?e.copy().noWidgetsMatch:e.copy().noWidgetsInCategory)}}function Va(i,t){if(i&1&&m(0,Ea,2,0)(1,Ia,2,1,"div",128),i&2){let e=r(3);h(e.libraryWidgetGroups().length?0:1)}}function Ra(i,t){if(i&1&&m(0,Da,3,0,"div",117)(1,Va,2,1),i&2){let e=r(2);h(e.templateCategoriesLoading()||e.widgetTemplateTemplatesLoading()?0:1)}}function za(i,t){if(i&1&&(s(0,"div",137),C(1,"nile-skeleton-loader",138),s(2,"div",139),C(3,"nile-skeleton-loader",124)(4,"nile-skeleton-loader",126)(5,"nile-skeleton-loader",140),d()()),i&2){let e=t.$implicit;l(3),M("width",e)}}function Na(i,t){if(i&1&&(s(0,"div",118)(1,"div",119),C(2,"nile-skeleton-loader",120),d(),s(3,"div",136),F(4,za,6,1,"div",137,G),d()()),i&2){let e=t.$implicit;l(4),O(e)}}function La(i,t){if(i&1&&(s(0,"div",117),F(1,Na,6,0,"div",118,G),d()),i&2){let e=r(3);l(),O(e.librarySkeletonGroups)}}function $a(i,t){if(i&1&&(s(0,"div",144),C(1,"db-dash-card-chart",152),d()),i&2){let e=r().$implicit;l(),b("config",e.preview)}}function Wa(i,t){i&1&&(s(0,"div",145),C(1,"span",153)(2,"span",154)(3,"span",155)(4,"span",156)(5,"span",157),d())}function Ba(i,t){if(i&1&&(s(0,"span",146),C(1,"nile-glyph",158),c(2),d()),i&2){let e=r().$implicit,n=r(5);l(2),q(" ",n.withCount(n.copy().libraryWidgetCountChip,(e.widgets==null?null:e.widgets.length)??0)," ")}}function Ua(i,t){if(i&1&&(s(0,"div",150),c(1),d()),i&2){let e=r().$implicit;l(),y(e.description)}}function Ga(i,t){if(i&1){let e=k();s(0,"button",142),u("click",function(){let o=_(e).$implicit,a=r(5);return g(a.openWidgetDetailPanelForTemplate(o))}),s(1,"div",143),m(2,$a,2,1,"div",144)(3,Wa,6,0,"div",145),m(4,Ba,3,1,"span",146),d(),s(5,"div",147)(6,"div",148)(7,"span",149),c(8),d(),m(9,Ua,2,1,"div",150),d(),C(10,"nile-glyph",151),d()()}if(i&2){let e=t.$implicit;l(2),h(e.preview!=null&&e.preview.chart?2:3),l(2),h(e.widgets!=null&&e.widgets.length?4:-1),l(4),y(e.name),l(),h(e.description?9:-1)}}function ja(i,t){if(i&1&&(s(0,"div",118)(1,"div",119)(2,"span",129),c(3),d()(),s(4,"div",136),F(5,Ga,11,4,"button",141,te),d()()),i&2){let e=t.$implicit;l(3),Y("",e.label," \xB7 ",e.templates.length),l(2),O(e.templates)}}function Ha(i,t){if(i&1&&F(0,ja,7,2,"div",118,se),i&2){let e=r(3);O(e.libraryDashboardGroups())}}function Ya(i,t){if(i&1&&(s(0,"div",128),c(1),d()),i&2){let e=r(3);l(),y(e.librarySearch()?e.copy().noDashboardsMatch:e.copy().noDashboardsInCategory)}}function Ka(i,t){if(i&1&&m(0,La,3,0,"div",117)(1,Ha,2,0)(2,Ya,2,1,"div",128),i&2){let e=r(2);h(e.templateTemplatesLoading()?0:e.libraryDashboardGroups().length?1:2)}}function Qa(i,t){if(i&1){let e=k();s(0,"div",107)(1,"span",159),c(2),d(),s(3,"nile-button",22),u("click",function(){_(e);let o=r(2);return g(o.addSelectedWidgetTemplates())}),C(4,"nile-glyph",160),c(5),d()()}if(i&2){let e=r(2);l(2),q(" ",e.withCount(e.copy().librarySelectedCount,e.widgetTemplatePickerSelectedIds().length)," "),l(3),q(" ",e.withCount(e.copy().libraryAddToCanvasButton,e.widgetTemplatePickerSelectedIds().length)," ")}}function Xa(i,t){if(i&1){let e=k();s(0,"div",13)(1,"div",99)(2,"p",100)(3,"strong",101),c(4),d(),c(5),d(),s(6,"nile-nav-tab-group",102),u("nile-tab-change",function(o){_(e);let a=r();return a.artifactPickerTab.set(o.detail.value),a.widgetTemplatePickerSelectedIds.set([]),g(a.librarySearch.set(""))}),s(7,"nile-nav-tab",103),c(8),s(9,"span",104),c(10),d()(),s(11,"nile-nav-tab",105),c(12),s(13,"span",104),c(14),d()()(),m(15,wa,4,3)(16,Sa,4,3),d(),s(17,"div",106),m(18,Ra,2,1)(19,Ka,3,1),d(),m(20,Qa,6,2,"div",107),d()}if(i&2){let e=r();l(4),y(e.copy().libraryIntroTitle),l(),q(" ",e.copy().libraryIntro," "),l(),M("value",e.artifactPickerTab()),l(2),y(e.copy().libraryWidgetsTabLabel),l(2),y(e.widgetTemplateAllTemplates().length),l(2),y(e.copy().libraryDashboardsTabLabel),l(2),y(e.templateAllTemplates().length),l(),h(e.artifactPickerTab()==="kpis"?15:16),l(3),h(e.artifactPickerTab()==="kpis"?18:19),l(2),h(e.artifactPickerTab()==="kpis"&&e.widgetTemplatePickerSelectedIds().length?20:-1)}}function Ja(i,t){i&1&&(s(0,"div",182),C(1,"nile-skeleton-loader",183)(2,"nile-skeleton-loader",184),d())}function Za(i,t){if(i&1&&F(0,Ja,3,0,"div",182,G),i&2){let e=r(2);O(e.cohortCriteriaSkeletonRows)}}function er(i,t){if(i&1&&(s(0,"p",185),c(1),d()),i&2){let e=r(3);l(),y(e.copy().cohortLogUnavailableMessage)}}function tr(i,t){if(i&1){let e=k();s(0,"p",185),c(1),d(),s(2,"nile-button",21),u("click",function(){_(e);let o=r(3);return g(o.retryCohortCriteria())}),c(3),d()}if(i&2){let e=r(3);l(),y(e.copy().cohortCriteriaErrorMessage),l(2),q(" ",e.copy().cohortPreviewRetryButton," ")}}function nr(i,t){i&1&&(s(0,"div",170),m(1,er,2,1,"p",185)(2,tr,4,2),d()),i&2&&(l(),h(t==="unavailable"?1:2))}function ir(i,t){if(i&1){let e=k();s(0,"button",187),u("click",function(){let o=_(e).$implicit,a=r(3);return g(a.selectCohortCriterion(o.id))}),C(1,"span",188),s(2,"span",189),c(3),d()()}if(i&2){let e=t.$implicit,n=r(3);W("is-selected",n.selectedCriterionId()===e.id),M("aria-checked",n.selectedCriterionId()===e.id),l(3),y(e.label)}}function or(i,t){if(i&1&&F(0,ir,4,4,"button",186,te),i&2){let e=r(2);O(e.cohortCriteria())}}function ar(i,t){i&1&&(s(0,"div",191)(1,"span",192),C(2,"nile-skeleton-loader",76),d(),C(3,"nile-skeleton-loader",193)(4,"nile-skeleton-loader",194),d())}function rr(i,t){if(i&1&&(s(0,"div",171),C(1,"nile-skeleton-loader",190),F(2,ar,5,0,"div",191,G),d()),i&2){let e=r(2);l(2),O(e.cohortMatchSkeletonRows)}}function lr(i,t){if(i&1&&(s(0,"p",196),c(1),d()),i&2){let e=r(3);l(),y(e.copy().cohortEmptyMatchesMessage)}}function sr(i,t){if(i&1&&(s(0,"p",196),c(1),d()),i&2){let e=r(3);l(),y(e.copy().cohortNamesWithheldMessage)}}function dr(i,t){if(i&1&&(s(0,"span",201),c(1),d()),i&2){let e=r().$implicit;l(),q("",e.daysInState,"d")}}function cr(i,t){if(i&1&&(s(0,"div",198)(1,"span",200),c(2),d(),m(3,dr,2,1,"span",201),d()),i&2){let e=t.$implicit;l(2),y(e.name??"\u2014"),l(),h(e.daysInState!==null&&e.daysInState!==void 0?3:-1)}}function pr(i,t){i&1&&(s(0,"div",202)(1,"span",192),C(2,"nile-skeleton-loader",76),d(),C(3,"nile-skeleton-loader",193)(4,"nile-skeleton-loader",194),d())}function _r(i,t){if(i&1&&F(0,pr,5,0,"div",202,G),i&2){let e=r(4);O(e.cohortMatchSkeletonRows)}}function gr(i,t){if(i&1&&(s(0,"p",199),c(1),d()),i&2){let e=r(4);l(),y(e.cohortMatchesTruncatedNote())}}function ur(i,t){if(i&1&&(s(0,"p",199),c(1),d()),i&2){let e=r(4);l(),y(e.copy().cohortMembersForbiddenMessage)}}function mr(i,t){if(i&1&&(s(0,"p",199),c(1),d()),i&2){let e=r(5);l(),y(e.copy().cohortMembersErrorMessage)}}function hr(i,t){if(i&1){let e=k();s(0,"button",204),u("click",function(){_(e);let o=r(5);return g(o.toggleAllCohortMatches())}),c(1),d()}if(i&2){let e=r(5);b("disabled",e.cohortMembersLoading()),M("aria-expanded",e.cohortMatchesExpanded())("aria-busy",e.cohortMembersLoading()?"true":null),l(),y(e.cohortViewAllLabel())}}function Cr(i,t){if(i&1&&(m(0,mr,2,1,"p",199),m(1,hr,2,4,"button",203)),i&2){let e=r(4);h(e.cohortMembersError()==="failed"?0:-1),l(),h(e.cohortHasMoreMatches()?1:-1)}}function fr(i,t){if(i&1&&(s(0,"div",197),F(1,cr,4,2,"div",198,So),m(3,_r,2,0),d(),m(4,gr,2,1,"p",199),m(5,ur,2,1,"p",199)(6,Cr,2,2)),i&2){let e=r(3);W("is-expanded",e.cohortMatchesExpanded()),l(),O(e.visibleCohortMatches()),l(2),h(e.cohortMembersLoading()?3:-1),l(),h(e.cohortMatchesExpanded()&&e.cohortMatchesTruncated()?4:-1),l(),h(e.cohortMembersError()==="forbidden"?5:6)}}function xr(i,t){if(i&1&&(s(0,"div",172)(1,"p",195),c(2),d(),m(3,lr,2,1,"p",196)(4,sr,2,1,"p",196)(5,fr,7,5),d()),i&2){let e=r(2);l(2),y(e.cohortMatchSummary()),l(),h(t.matchCount===0?3:e.cohortNamesWithheld()?4:5)}}function yr(i,t){if(i&1&&(s(0,"p",185),c(1),d()),i&2){let e=r(3);l(),y(e.copy().cohortLogUnavailableMessage)}}function br(i,t){if(i&1){let e=k();s(0,"nile-button",21),u("click",function(){let o=_(e),a=r(4);return g(a.selectCohortCriterion(o))}),c(1),d()}if(i&2){let e=r(4);l(),q(" ",e.copy().cohortPreviewRetryButton," ")}}function vr(i,t){if(i&1&&(s(0,"p",185),c(1),d(),m(2,br,2,1,"nile-button",205)),i&2){let e,n=r(3);l(),y(n.copy().cohortPreviewErrorMessage),l(),h((e=n.selectedCriterionId())?2:-1,e)}}function wr(i,t){i&1&&(s(0,"div",173),m(1,yr,2,1,"p",185)(2,vr,3,2),d()),i&2&&(l(),h(t==="unavailable"?1:2))}function kr(i,t){if(i&1){let e=k();s(0,"div",14)(1,"div",161)(2,"span",162),C(3,"nile-glyph",163),d(),s(4,"span",164),c(5),d()(),s(6,"p",165),c(7),d(),s(8,"div",166)(9,"span",167),c(10,"1"),d(),s(11,"span",168),c(12),d()(),s(13,"div",169),m(14,Za,2,0)(15,nr,3,1,"div",170)(16,or,2,0),d(),s(17,"div",166)(18,"span",167),c(19,"2"),d(),s(20,"span",168),c(21),d()(),m(22,rr,4,0,"div",171)(23,xr,6,2,"div",172)(24,wr,3,1,"div",173),C(25,"div",174),s(26,"div",175)(27,"p",176),c(28),d(),s(29,"div",177)(30,"nile-button",178),u("click",function(){_(e);let o=r();return g(o.addCohortToCanvas())}),C(31,"nile-glyph",179),c(32),d(),s(33,"nile-button",180),u("click",function(){_(e);let o=r();return g(o.addCohortToCanvas())}),C(34,"nile-glyph",181),c(35),d()()()()}if(i&2){let e,n,o=r();l(5),y(o.copy().cohortBuilderTitle),l(2),y(o.copy().cohortBuilderSubtitle),l(5),y(o.copy().cohortStep1Label),l(),M("aria-label",o.copy().cohortStep1Label),l(),h(o.cohortCriteriaLoading()&&!o.cohortCriteria().length?14:(e=o.cohortCriteriaError())?15:16,e),l(7),y(o.copy().cohortStep2Label),l(),h(o.cohortPreviewLoading()?22:(n=o.cohortPreview())?23:(n=o.cohortPreviewError())?24:-1,n),l(6),y(o.copy().cohortAddToCanvasDisclaimer),l(2),M("disabled",o.cohortPreview()?null:""),l(2),q(" ",o.copy().cohortPreviewWidgetButton," "),l(),M("disabled",o.cohortPreview()?null:""),l(2),q(" ",o.copy().cohortAddToCanvasButton," ")}}function Pr(i,t){i&1&&(s(0,"div",216),C(1,"nile-skeleton-loader",217),s(2,"div",218),C(3,"nile-skeleton-loader",78),d()())}function Ar(i,t){i&1&&(s(0,"div",215),F(1,Pr,4,0,"div",216,G),d()),i&2&&(l(),O(pe(0,Ao)))}function Mr(i,t){if(i&1&&(s(0,"span",225),c(1),d()),i&2){let e=r().$implicit;l(),y(e.badge)}}function Sr(i,t){if(i&1){let e=k();s(0,"button",222),u("click",function(){let o=_(e).$implicit,a=r(5);return g(a.onWelcomePromptPick(o))}),C(1,"nile-glyph",223),s(2,"span",224),c(3),d(),m(4,Mr,2,1,"span",225),d()}if(i&2){let e=t.$implicit;W("prompt-card--ai",e.tone==="ai"),l(),M("name",e.icon)("color",e.tone==="ai"?"#7a5af8":"var(--ng-colors-text-quaternary-500)"),l(2),y(e.label),l(),h(e.badge?4:-1)}}function Tr(i,t){if(i&1&&(s(0,"div",219),F(1,Sr,5,6,"button",221,Oi),d()),i&2){let e=r(4);l(),O(e.welcomePromptCards())}}function qr(i,t){if(i&1){let e=k();s(0,"button",227),u("click",function(){_(e);let o=r(5);return g(o.openGallery())}),C(1,"nile-glyph",228),s(2,"span"),c(3),d()()}if(i&2){let e=r(5);l(3),y(e.copy().promptGalleryLabel)}}function Dr(i,t){if(i&1){let e=k();s(0,"button",227),u("click",function(){_(e);let o=r(5);return g(o.openXray())}),C(1,"nile-glyph",229),s(2,"span"),c(3),d()()}if(i&2){let e=r(5);l(3),y(e.copy().xrayLabel)}}function Fr(i,t){if(i&1&&(s(0,"div",220),m(1,qr,4,1,"button",226),m(2,Dr,4,1,"button",226),d()),i&2){let e=r(4);l(),h(e.features().promptGallery?1:-1),l(),h(e.features().xray?2:-1)}}function Or(i,t){if(i&1&&(m(0,Tr,3,0,"div",219),m(1,Fr,3,2,"div",220)),i&2){let e=r(3);h(e.features().welcomePrompts?0:-1),l(),h(e.features().promptGallery||e.features().xray?1:-1)}}function Er(i,t){if(i&1&&(s(0,"div",206)(1,"div",208)(2,"div",209),C(3,"nile-glyph",210),d(),s(4,"h2",211),c(5),d(),s(6,"p",212),c(7),d(),s(8,"div",213),Ce(9,214),d(),m(10,Ar,3,1,"div",215)(11,Or,2,2),d()()),i&2){let e=r(2),n=de(8);l(5),y(e.copy().welcomeTitle),l(2),y(e.copy().welcomeSubtitle),l(2),b("ngTemplateOutlet",n),l(),h(e.features().welcomePrompts&&!e.welcomePromptCards().length?10:11)}}function Ir(i,t){i&1&&(s(0,"div",232),C(1,"nile-skeleton-loader",233),d(),s(2,"div",234),C(3,"nile-skeleton-loader",235)(4,"nile-skeleton-loader",236)(5,"nile-skeleton-loader",237),d(),s(6,"div",232),C(7,"nile-skeleton-loader",238),d(),s(8,"div",234),C(9,"nile-skeleton-loader",239)(10,"nile-skeleton-loader",240),d())}function Vr(i,t){if(i&1&&(s(0,"div",242),C(1,"nile-glyph",246),s(2,"span",247),c(3),d()()),i&2){let e=r(2).$implicit;l(3),y(e.quotedText)}}function Rr(i,t){if(i&1&&(s(0,"span",252),c(1),d()),i&2){let e=r().$implicit;l(),y(e.answer)}}function zr(i,t){if(i&1&&(s(0,"div",248),C(1,"nile-glyph",249),s(2,"div",250)(3,"span",251),c(4),d(),m(5,Rr,2,1,"span",252),d()()),i&2){let e=t.$implicit;l(4),y(e.title),l(),h(e.answer&&e.answer!=="Use this"?5:-1)}}function Nr(i,t){if(i&1&&(s(0,"div",243),F(1,zr,6,2,"div",248,G),d()),i&2){let e=r(2).$implicit,n=r(4);l(),O(n.answerSummaryRows(e))}}function Lr(i,t){if(i&1&&(s(0,"span",244),c(1),d()),i&2){let e=r(2).$implicit;l(),y(e.text)}}function $r(i,t){if(i&1&&(s(0,"div",253),C(1,"nile-glyph",254),s(2,"span",255),c(3),d()()),i&2){let e=t.$implicit;l(),M("name",e.contentType.startsWith("image/")?"ng-image-03":"ng-file-06"),l(),M("title",e.name),l(),y(e.name)}}function Wr(i,t){if(i&1&&(s(0,"div",245),F(1,$r,4,3,"div",253,se),d()),i&2){let e=r(2).$implicit;l(),O(e.attachments??pe(0,Se))}}function Br(i,t){if(i&1&&(s(0,"nile-ai-chat-bubble",241),m(1,Vr,4,1,"div",242),m(2,Nr,3,0,"div",243)(3,Lr,2,1,"span",244),m(4,Wr,3,1,"div",245),d()),i&2){let e=r().$implicit;b("role","user"),l(),h(e.quotedText?1:-1),l(),h(e.answerSummary?2:3),l(2),h(e.attachments!=null&&e.attachments.length?4:-1)}}function Ur(i,t){if(i&1&&C(0,"nile-ai-steps",256),i&2){let e=r(2).$implicit;b("steps",e.tools)}}function Gr(i,t){if(i&1&&C(0,"nile-ai-token-stream",265),i&2){let e=r(4).$implicit,n=r(4);b("text",n.cleanText(e.text))("speedMs",n.streamSpeed)}}function jr(i,t){if(i&1&&C(0,"nile-markdown",266),i&2){let e=r(4).$implicit,n=r(4);b("value",n.cleanMarkdown(e.text))}}function Hr(i,t){if(i&1&&m(0,Gr,1,2,"nile-ai-token-stream",265)(1,jr,1,1,"nile-markdown",266),i&2){let e=r(3).$implicit;h(e.isStreaming?0:1)}}function Yr(i,t){if(i&1&&(s(0,"span",267),c(1),d()),i&2){let e=r().$implicit;l(),Y("Setup ",e.step.current," of ",e.step.total)}}function Kr(i,t){i&1&&(s(0,"span",276),c(1),d()),i&2&&(l(),y(t))}function Qr(i,t){if(i&1&&(s(0,"span",278),c(1),d()),i&2){let e=r().$implicit;l(),y(e.hint)}}function Xr(i,t){if(i&1&&(s(0,"span"),c(1),d()),i&2){let e=r().$implicit;at("choice-card__chip"+(e.tone?" choice-card__chip--"+e.tone:"")),l(),y(e.text)}}function Jr(i,t){if(i&1&&m(0,Xr,2,3,"span",280),i&2){let e=t.$implicit;h(e.tone!=="green"&&e.tone!=="yellow"&&e.tone!=="red"?0:-1)}}function Zr(i,t){if(i&1&&(s(0,"span",279),F(1,Jr,1,1,null,null,G),d()),i&2){let e=r().$implicit;l(),O(e.meta)}}function el(i,t){if(i&1&&(s(0,"nile-radio",272)(1,"span",273)(2,"span",274),c(3),d(),s(4,"span",275),m(5,Kr,2,1,"span",276),s(6,"span",277),c(7),d(),m(8,Qr,2,1,"span",278),m(9,Zr,3,0,"span",279),d()()()),i&2){let e,n=t.$implicit,o=t.$index,a=t.$index,p=r(2).$implicit,x=r(3).$implicit,v=r(4);W("choice-card--chosen",(p.selected||p.draftSelection)===n.id)("choice-card--locked",!!p.selected||v.isStreaming()),M("name","choice-"+x.id+"-"+o)("value",n.id)("checked",(p.selected||p.draftSelection)===n.id?"":null)("disabled",p.selected||v.isStreaming()?"":null),l(3),y(a+1),l(2),h((e=v.optionBadgeText(n))?5:-1,e),l(2),y(v.optionPrimaryText(n)),l(),h(!v.optionBadgeText(n)&&n.hint?8:-1),l(),h(n.meta!=null&&n.meta.length?9:-1)}}function tl(i,t){if(i&1){let e=k();s(0,"nile-radio-group",270),u("nile-change",function(o){_(e);let a=r().$implicit,p=r(3).$implicit,x=r(4);return g(x.onChoiceChange(p,a,o.detail.value))}),F(1,el,10,13,"nile-radio",271,te),d()}if(i&2){let e=r(),n=e.$implicit,o=e.$index,a=r(3).$implicit,p=r(4);M("label",n.prompt||"Choose an index")("name","choice-"+a.id+"-"+o)("value",n.selected||n.draftSelection||null)("disabled",n.selected||p.isStreaming()?"":null),l(),O(n.options)}}function nl(i,t){if(i&1&&(s(0,"p",269),c(1),d()),i&2){let e=r(8);l(),y(e.copy().noChoiceOptions)}}function il(i,t){if(i&1&&c(0),i&2){let e=r(3).$implicit;q(" \u2713 Something else: ",e.chatDraftText," (edit) ")}}function ol(i,t){if(i&1&&(C(0,"nile-glyph",286),c(1)),i&2){let e=r(10);l(),q(" ",e.copy().somethingElseButton," ")}}function al(i,t){if(i&1){let e=k();s(0,"button",283),u("click",function(){_(e);let o=r(3).$implicit,a=r(3).$implicit,p=r(4);return g(p.requestPlan(a,o))}),c(1),d()}if(i&2){let e=r(10);b("disabled",e.isStreaming()),l(),q(" ",e.copy().givePlanButton," ")}}function rl(i,t){if(i&1){let e=k();s(0,"button",287),u("click",function(){_(e);let o=r(3).$implicit,a=r(3).$implicit,p=r(4);return g(p.previewWidget(a,o))}),C(1,"nile-glyph",288),c(2),d()}if(i&2){let e=r(3).$implicit,n=r(7);b("disabled",n.isStreaming()),l(2),q(' Preview "',n.choiceTitle(e),'" ')}}function ll(i,t){if(i&1){let e=k();s(0,"div",281)(1,"button",283),u("click",function(){_(e);let o=r(2).$implicit,a=r(3).$implicit,p=r(4);return g(p.openChatDraft(a,o))}),m(2,il,1,1)(3,ol,2,1),d(),m(4,al,2,2,"button",284),m(5,rl,3,2,"button",285),d()}if(i&2){let e=r(2).$implicit,n=r(7);l(),b("disabled",n.isStreaming()),l(),h(e.chatDraftText!=null&&e.chatDraftText.trim()?2:3),l(2),h(e.kind==="clarification"?4:-1),l(),h(e.kind==="widget_plan"?5:-1)}}function sl(i,t){if(i&1){let e=k();s(0,"div",282)(1,"span",289),c(2,"Something else"),d(),s(3,"div",290)(4,"nile-input",291),u("nile-input",function(o){_(e);let a=r(2).$implicit,p=r(3).$implicit,x=r(4);return g(x.onChatDraftTextChange(p,a,o.detail.value))})("keydown.enter",function(){_(e);let o=r(2).$implicit,a=r(3).$implicit,p=r(4);return g(p.defineChatDraft(a,o))}),d(),s(5,"nile-button",22),u("click",function(){_(e);let o=r(2).$implicit,a=r(3).$implicit,p=r(4);return g(p.defineChatDraft(a,o))}),c(6),d()()()}if(i&2){let e=r(2).$implicit,n=r(7);l(4),b("value",e.chatDraftText??""),M("placeholder",e.kind==="widget_clarification"?n.copy().chatDraftPlaceholderWidget:e.kind==="widget_plan"?n.copy().chatDraftPlaceholderPlan:e.kind==="plan_intake"?n.copy().chatDraftPlaceholderIntake:n.copy().chatDraftPlaceholderClarification)("disabled",n.isStreaming()?"":null),l(),M("disabled",!(e.chatDraftText!=null&&e.chatDraftText.trim())||n.isStreaming()?"":null),l(),q(" ",n.copy().defineItButton," ")}}function dl(i,t){if(i&1&&m(0,ll,6,4,"div",281)(1,sl,7,5,"div",282),i&2){let e=r().$implicit;h(e.chatOpen?1:0)}}function cl(i,t){if(i&1&&(s(0,"div",259),m(1,Yr,2,2,"span",267),m(2,tl,3,4,"nile-radio-group",268)(3,nl,2,1,"p",269),m(4,dl,2,1),d()),i&2){let e=t.$implicit;l(),h(e.step?1:-1),l(),h(e.options.length?2:3),l(2),h((e.kind==="widget_clarification"||e.kind==="clarification"||e.kind==="widget_plan"||e.kind==="plan_intake")&&!e.selected&&e.options.length?4:-1)}}function pl(i,t){if(i&1){let e=k();s(0,"button",292),u("click",function(){_(e);let o=r(3).$implicit,a=r(4);return g(a.resumeChoicePanel(o))}),c(1),d()}if(i&2){let e=r(3).$implicit,n=r(4);l(),Y(" ",n.panelAnsweredCount(e.choices??pe(2,Se))," of ",(e.choices??pe(3,Se)).length," answered \u2014 Resume ")}}function _l(i,t){i&1&&(s(0,"span",294),C(1,"span",300),c(2,"Live "),d())}function gl(i,t){i&1&&(s(0,"span",295),c(1,"Preview"),d())}function ul(i,t){i&1&&C(0,"div",303)}function ml(i,t){if(i&1&&C(0,"nile-glyph",307),i&2){let e=r().$implicit;Z("color",e.color),b("name",e.glyph)("method",e.method||"stroke")}}function hl(i,t){if(i&1){let e=k();m(0,ul,1,0,"div",303),s(1,"nile-menu-item",304),u("click",function(){let o=_(e).$implicit;r();let a=de(1),p=r(4).$implicit;return r(4).onInlineWidgetMenuItem(p,o),g(a.hide())}),s(2,"span",305),m(3,ml,1,4,"nile-glyph",306),c(4),d()()}if(i&2){let e=t.$implicit;h(e.divider?0:-1),l(3),h(e.glyph?3:-1),l(),q(" ",e.label," ")}}function Cl(i,t){if(i&1&&(s(0,"nile-dropdown",296,4)(2,"button",301),C(3,"nile-glyph",302),d(),s(4,"nile-menu"),F(5,hl,5,3,null,null,se),d()()),i&2){let e=r(4).$implicit,n=r(4);l(5),O(n.inlineWidgetMenuItems(e))}}function fl(i,t){i&1&&(s(0,"div",311),C(1,"nile-spinner",314),s(2,"span"),c(3,"Loading chart types\u2026"),d()())}function xl(i,t){if(i&1&&(s(0,"p",312),c(1),d()),i&2){let e=r(9);l(),y(e.copy().noChartTypesFit)}}function yl(i,t){i&1&&C(0,"nile-spinner",314)}function bl(i,t){if(i&1&&C(0,"nile-glyph",319),i&2){let e=r().$implicit,n=r(11);b("name",n.chartTypeIcon(e.type))}}function vl(i,t){if(i&1){let e=k();s(0,"button",318),u("click",function(){let o=_(e).$implicit,a=r(11);return g(a.selectInlineChartType(o.component))}),m(1,yl,1,0,"nile-spinner",314)(2,bl,1,1,"nile-glyph",319),s(3,"span"),c(4),d()()}if(i&2){let e=t.$implicit,n=r(11);M("disabled",n.inlineChartTypeApplying()?"":null),l(),h(n.inlineChartTypeApplyingComponent()===e.component?1:2),l(3),y(e.label)}}function wl(i,t){if(i&1&&(s(0,"p",315),c(1,"Recommended"),d(),s(2,"div",316),F(3,vl,5,3,"button",317,Ei),d()),i&2){let e=r(10);l(3),O(e.inlineSensibleChartTypes())}}function kl(i,t){i&1&&C(0,"nile-spinner",314)}function Pl(i,t){if(i&1&&C(0,"nile-glyph",319),i&2){let e=r().$implicit,n=r(11);b("name",n.chartTypeIcon(e.type))}}function Al(i,t){if(i&1){let e=k();s(0,"button",321),u("click",function(){let o=_(e).$implicit,a=r(11);return g(a.selectInlineChartType(o.component))}),m(1,kl,1,0,"nile-spinner",314)(2,Pl,1,1,"nile-glyph",319),s(3,"span"),c(4),d()()}if(i&2){let e=t.$implicit,n=r(11);M("disabled",n.inlineChartTypeApplying()?"":null),l(),h(n.inlineChartTypeApplyingComponent()===e.component?1:2),l(3),y(e.label)}}function Ml(i,t){if(i&1&&(s(0,"p",315),c(1,"Other types"),d(),s(2,"div",316),F(3,Al,5,3,"button",320,Ei),d()),i&2){let e=r(10);l(3),O(e.inlineOtherChartTypes())}}function Sl(i,t){if(i&1&&(m(0,wl,5,0),m(1,Ml,5,0)),i&2){let e=r(9);h(e.inlineSensibleChartTypes().length>0?0:-1),l(),h(e.inlineOtherChartTypes().length>0?1:-1)}}function Tl(i,t){if(i&1&&(s(0,"p",313),c(1),d()),i&2){let e=r(9);l(),y(e.inlineChartTypeError())}}function ql(i,t){if(i&1){let e=k();s(0,"nile-dropdown",308),u("nile-hide",function(){_(e);let o=r(8);return g(o.closeInlineChartTypePicker())}),C(1,"span",309),s(2,"div",310),m(3,fl,4,0,"div",311)(4,xl,2,1,"p",312)(5,Sl,2,2),m(6,Tl,2,1,"p",313),d()()}if(i&2){let e=r(4).$implicit,n=r(4);b("open",n.inlineChartTypePickerFor()===e.charts[0]),l(3),h(n.inlineChartTypeLoading()?3:n.inlineChartTypeOptions().length===0?4:5),l(3),h(n.inlineChartTypeError()?6:-1)}}function Dl(i,t){if(i&1){let e=k();s(0,"span",324),c(1),s(2,"button",325),u("click",function(){let o=_(e).$implicit,a=r(6).$implicit,p=r(4);return g(p.removeInlineFilter(a.charts[0],o.id))}),C(3,"nile-glyph",326),d()()}if(i&2){let e=t.$implicit,n=r(6).$implicit,o=r(4);l(),q(" ",o.inlineFilterChipLabel(n.charts[0],e)," "),l(),M("disabled",o.inlineFilterApplying()?"":null)}}function Fl(i,t){if(i&1&&(s(0,"div",323),F(1,Dl,4,2,"span",324,te),d()),i&2){let e=r(5).$implicit,n=r(4);l(),O(n.inlineActiveFilters(e.charts[0]))}}function Ol(i,t){i&1&&(s(0,"div",311),C(1,"nile-spinner",314),s(2,"span"),c(3,"Loading filterable fields\u2026"),d()())}function El(i,t){if(i&1&&(s(0,"p",313),c(1),d()),i&2){let e=r(9);l(),y(e.inlineFilterFieldsError())}}function Il(i,t){if(i&1&&(s(0,"p",312),c(1),d()),i&2){let e=r(9);l(),y(e.copy().noFilterableFields)}}function Vl(i,t){if(i&1&&(s(0,"option",329),c(1),d()),i&2){let e=t.$implicit;b("value",e.name),l(),y(e.label)}}function Rl(i,t){if(i&1&&(s(0,"option",329),c(1),d()),i&2){let e=t.$implicit;b("value",e.value),l(),y(e.label)}}function zl(i,t){i&1&&(s(0,"div",311),C(1,"nile-spinner",330),s(2,"span"),c(3,"Loading values\u2026"),d()())}function Nl(i,t){if(i&1){let e=k();s(0,"input",334),u("ngModelChange",function(o){_(e);let a=r(11);return g(a.inlineFilterBuilderValue.set(o))})("keydown.enter",function(){_(e);let o=r(7).$implicit,a=r(4);return g(a.addInlineFilter(o.charts[0]))}),d()}if(i&2){let e=r(11);b("placeholder",e.copy().filterValuePlaceholder)("ngModel",e.inlineFilterBuilderValue())}}function Ll(i,t){if(i&1){let e=k();s(0,"span",336),c(1,"and"),d(),s(2,"input",335),u("ngModelChange",function(o){_(e);let a=r(12);return g(a.inlineFilterBuilderValue2.set(o))}),d()}if(i&2){let e=r(12);l(2),b("ngModel",e.inlineFilterBuilderValue2())}}function $l(i,t){if(i&1){let e=k();s(0,"input",335),u("ngModelChange",function(o){_(e);let a=r(11);return g(a.inlineFilterBuilderValue.set(o))}),d(),m(1,Ll,3,1)}if(i&2){let e,n=r(7).$implicit,o=r(4);b("ngModel",o.inlineFilterBuilderValue()),l(),h((e=o.inlineFilterSelectedOperator(n.charts[0]))!=null&&e.needsSecondValue?1:-1)}}function Wl(i,t){if(i&1){let e=k();s(0,"span",336),c(1,"and"),d(),s(2,"input",338),u("ngModelChange",function(o){_(e);let a=r(12);return g(a.inlineFilterBuilderValue2.set(o))}),d()}if(i&2){let e=r(12);l(2),b("placeholder",e.copy().filterValuePlaceholder)("ngModel",e.inlineFilterBuilderValue2())}}function Bl(i,t){if(i&1){let e=k();s(0,"input",337),u("ngModelChange",function(o){_(e);let a=r(11);return g(a.inlineFilterBuilderValue.set(o))})("keydown.enter",function(){_(e);let o=r(7).$implicit,a=r(4);return g(a.addInlineFilter(o.charts[0]))}),d(),m(1,Wl,3,2)}if(i&2){let e,n=r(7).$implicit,o=r(4);b("placeholder",o.copy().filterValuePlaceholder)("ngModel",o.inlineFilterBuilderValue()),l(),h((e=o.inlineFilterSelectedOperator(n.charts[0]))!=null&&e.needsSecondValue?1:-1)}}function Ul(i,t){if(i&1){let e=k();s(0,"label",339)(1,"input",340),u("change",function(){let o=_(e).$implicit,a=r(12);return g(a.toggleInlineFilterMultiValue(o.value))}),d(),s(2,"span"),c(3),d()()}if(i&2){let e=t.$implicit,n=r(12);l(),b("checked",n.inlineFilterBuilderValues().includes(e.value)),l(2),Y("",e.label,"",e.count!=null?" ("+e.count+")":"")}}function Gl(i,t){if(i&1&&(s(0,"div",332),F(1,Ul,4,3,"label",339,nt),d()),i&2){let e=r(11);l(),O(e.inlineFilterValuesFor(e.inlineFilterBuilderFieldId()))}}function jl(i,t){if(i&1&&(s(0,"option",329),c(1),d()),i&2){let e=t.$implicit;b("value",e.value),l(),Y("",e.label,"",e.count!=null?" ("+e.count+")":"")}}function Hl(i,t){if(i&1){let e=k();s(0,"select",328),u("ngModelChange",function(o){_(e);let a=r(11);return g(a.inlineFilterBuilderValue.set(o))}),s(1,"option",341),c(2,"Select\u2026"),d(),F(3,jl,2,3,"option",329,nt),d()}if(i&2){let e=r(11);b("ngModel",e.inlineFilterBuilderValue()),l(3),O(e.inlineFilterValuesFor(e.inlineFilterBuilderFieldId()))}}function Yl(i,t){if(i&1&&m(0,Nl,1,2,"input",331)(1,$l,2,2)(2,Bl,2,3)(3,Gl,3,0,"div",332)(4,Hl,5,1,"select",333),i&2){let e,n=r(6).$implicit,o=r(4);h((e=(e=o.inlineFilterSelectedOperator(n.charts[0]))==null?null:e.valueKind)==="text"?0:e==="date"?1:e==="number"?2:e==="multi-select"?3:e==="select"?4:-1)}}function Kl(i,t){if(i&1&&(s(0,"p",313),c(1),d()),i&2){let e=r(10);l(),y(e.inlineFilterApplyError())}}function Ql(i,t){if(i&1){let e=k();s(0,"div",327)(1,"select",328),u("ngModelChange",function(o){_(e);let a=r(5).$implicit,p=r(4);return g(p.onInlineFilterFieldChange(a.charts[0],o))}),F(2,Vl,2,2,"option",329,To),d(),s(4,"select",328),u("ngModelChange",function(o){_(e);let a=r(9);return g(a.onInlineFilterOperatorChange(o))}),F(5,Rl,2,2,"option",329,nt),d(),m(7,zl,4,0,"div",311)(8,Yl,5,1),s(9,"nile-button",21),u("click",function(){_(e);let o=r(5).$implicit,a=r(4);return g(a.addInlineFilter(o.charts[0]))}),c(10," Add filter "),d()(),m(11,Kl,2,1,"p",313)}if(i&2){let e=r(5).$implicit,n=r(4);l(),b("ngModel",n.inlineFilterBuilderFieldId()),l(),O(n.inlineFilterFields(e.charts[0])),l(2),b("ngModel",n.inlineFilterBuilderOperator()),l(),O(n.inlineFilterOperators(e.charts[0])),l(2),h(n.inlineFilterValuesLoading()?7:8),l(2),M("loading",n.inlineFilterApplying()?"":null)("disabled",n.inlineFilterApplying()?"":null),l(2),h(n.inlineFilterApplyError()?11:-1)}}function Xl(i,t){if(i&1){let e=k();s(0,"nile-dropdown",308),u("nile-hide",function(){_(e);let o=r(8);return g(o.closeInlineFilterBuilder())}),C(1,"span",309),s(2,"div",322)(3,"p",312),c(4,"Filters this preview only \u2014 nothing is saved."),d(),m(5,Fl,3,0,"div",323),m(6,Ol,4,0,"div",311)(7,El,2,1,"p",313)(8,Il,2,1,"p",312)(9,Ql,12,6),d()()}if(i&2){let e=r(4).$implicit,n=r(4);b("open",n.inlineFilterPickerFor()===e.charts[0]),l(5),h(n.inlineActiveFilters(e.charts[0]).length>0?5:-1),l(),h(n.inlineFilterFieldsLoading()?6:n.inlineFilterFieldsError()?7:n.inlineFilterFields(e.charts[0]).length===0?8:9)}}function Jl(i,t){if(i&1&&(s(0,"span",342)(1,"span",343),c(2),d(),s(3,"span",344),c(4),d()()),i&2){let e=t.$implicit;l(2),q("",e.label,":"),l(2),y(e.value)}}function Zl(i,t){if(i&1&&(s(0,"div",298),F(1,Jl,5,2,"span",342,Oi),d()),i&2){let e=r(4).$implicit;l(),O(e.forecastMeta??pe(0,Se))}}function es(i,t){if(i&1){let e=k();s(0,"nile-button",345),u("click",function(){_(e);let o=r(5).$implicit,a=r(4);return g(a.tryAlternatePreview(o.charts[0]))}),c(1),d()}if(i&2){let e=r(5).$implicit,n=r(4);b("disabled",n.isStreaming()),l(),q(' Try "',n.previewAltLabel(e.charts[0]),'" instead ')}}function ts(i,t){if(i&1){let e=k();s(0,"nile-button",345),u("click",function(){_(e);let o=r(4).$implicit,a=r(4);return g(a.skipPreview(o.charts[0]))}),c(1," Skip this widget "),d(),m(2,es,2,2,"nile-button",346),s(3,"nile-button",347),u("click",function(){_(e);let o=r(4).$implicit,a=r(4);return g(a.acceptPreview(o.charts[0]))}),C(4,"nile-glyph",160),c(5," Add to dashboard "),d()}if(i&2){let e=r(4).$implicit,n=r(4);b("disabled",n.isStreaming()),l(2),h(n.previewAltLabel(e.charts[0])?2:-1),l(),b("disabled",n.isStreaming())}}function ns(i,t){if(i&1&&(s(0,"div",46),c(1),d()),i&2){let e=r(10);l(),y(e.copy().noResultsMatchFilters)}}function is(i,t){i&1&&Ce(0)}function os(i,t){if(i&1){let e=k();s(0,"nile-menu-item",70),u("click",function(){let o=_(e).$implicit,a=r(8).$implicit,p=r(4);return g(p.addInlineToExisting(a.charts,o.id))}),ke(1,is,1,0,"ng-container",353),d()}if(i&2){let e=t.$implicit;r(12);let n=de(40);l(),b("ngTemplateOutlet",n)("ngTemplateOutletContext",rt(2,Fi,e))}}function as(i,t){if(i&1&&(s(0,"div",80),c(1),d(),F(2,os,2,4,"nile-menu-item",null,te)),i&2){let e=t.$implicit;l(),y(e.label),l(),O(e.items)}}function rs(i,t){if(i&1&&(s(0,"div",46),c(1),d()),i&2){let e=r(11);l(),y(e.copy().noDashboardsYet)}}function ls(i,t){if(i&1&&F(0,as,4,1,null,null,se,!1,rs,2,1,"div",46),i&2){let e=r(10);O(e.groupedPickerDashboards())}}function ss(i,t){if(i&1){let e=k();s(0,"nile-dropdown",351),u("nile-hide",function(){_(e);let o=r(9);return g(o.inlinePickerFor.set(null))}),s(1,"nile-button",352),u("click",function(){_(e);let o=r(5).$implicit,a=r(4);return g(a.inlinePickerFor.set(a.inlinePickerFor()===o.id?null:o.id))}),C(2,"nile-glyph",160),c(3),d(),s(4,"nile-menu",43),u("nile-search-value",function(o){_(e);let a=r(9);return g(a.pickerSearch.set((o.detail==null?null:o.detail.value)??""))}),s(5,"nile-menu-item",44),u("click",function(){_(e);let o=r(5).$implicit,a=r(4);return g(a.addInlineWidget(o.charts))}),C(6,"nile-glyph",45),c(7),d(),m(8,ns,2,1,"div",46)(9,ls,3,1),d()()}if(i&2){let e=r(5).$implicit,n=r(4);b("open",n.inlinePickerFor()===e.id),l(),M("loading",n.committingAction()==="add"?"":null)("disabled",n.committingAction()?"":null),l(2),q(" ",n.copy().addToDashboardButton," "),l(),M("noResultsMessage",n.copy().noResultsMatchFilters),l(3),q(" ",n.copy().newDashboardLabel," "),l(),h(n.pickerSearchEmpty()?8:9)}}function ds(i,t){if(i&1){let e=k();s(0,"nile-button",22),u("click",function(){_(e);let o=r(5).$implicit,a=r(4);return g(a.addInlineDefault(o.charts))}),C(1,"nile-glyph",160),c(2),d()}if(i&2){let e=r(9);M("loading",e.committingAction()==="add"?"":null)("disabled",e.committingAction()?"":null),l(2),q(" ",e.builderOpen()?e.copy().addToCurrentDashboardButton:e.copy().addToDashboardButton," ")}}function cs(i,t){if(i&1){let e=k();s(0,"nile-button",21),u("click",function(){_(e);let o=r(4).$implicit,a=r(4);return g(a.addToLibrary(o.charts[0]))}),C(1,"nile-glyph",348),c(2),d(),m(3,ss,10,7,"nile-dropdown",349)(4,ds,3,3,"nile-button",350)}if(i&2){let e=r(8);l(2),q(" ",e.copy().addToLibraryButton," "),l(),h(!e.builderOpen()&&e.conversationDashboards().length>1?3:4)}}function ps(i,t){if(i&1){let e=k();s(0,"div",261)(1,"div")(2,"shared-nile-chart-widget",293),u("aiSend",function(o){_(e);let a=r(7);return g(a.onInlineAiSend(o))}),m(3,_l,3,0,"span",294),m(4,gl,2,0,"span",295),m(5,Cl,7,0,"nile-dropdown",296),m(6,ql,7,3,"nile-dropdown",297),m(7,Xl,10,3,"nile-dropdown",297),d()(),m(8,Zl,3,1,"div",298),s(9,"div",299),m(10,ts,6,3)(11,cs,5,2),d()()}if(i&2){let e=r(3).$implicit,n=r(4);l(),at(n.inlineChartClass(e.charts[0])),l(),b("config",n.inlineDisplayConfig(e.charts[0]))("loading",!!e.forecastRecomputing||n.isInlineRecordsLoading(e.charts[0]))("widgetId",e.id)("conversationId",n.activeConversationId()),l(),h(e.forecast?3:-1),l(),h(n.isPreviewChart(e.charts[0])?4:-1),l(),h(n.inlineWidgetMenuItems(e).length?5:-1),l(),h(n.isFilterChart(e.charts[0])?-1:6),l(),h(n.isFilterChart(e.charts[0])?-1:7),l(),h(e.forecastMeta!=null&&e.forecastMeta.length?8:-1),l(2),h(n.isPreviewChart(e.charts[0])?10:11)}}function _s(i,t){i&1&&(s(0,"span",295),c(1,"Preview"),d(),c(2," \xB7 "))}function gs(i,t){if(i&1){let e=k();s(0,"nile-button",345),u("click",function(){_(e);let o=r(5).$implicit,a=r(4);return g(a.tryAlternatePreview(o.charts[0]))}),c(1),d()}if(i&2){let e=r(5).$implicit,n=r(4);b("disabled",n.isStreaming()),l(),q(' Try "',n.previewAltLabel(e.charts[0]),'" instead ')}}function us(i,t){if(i&1){let e=k();s(0,"div",299)(1,"nile-button",345),u("click",function(){_(e);let o=r(4).$implicit,a=r(4);return g(a.skipPreview(o.charts[0]))}),c(2," Skip this widget "),d(),m(3,gs,2,2,"nile-button",346),s(4,"nile-button",347),u("click",function(){_(e);let o=r(4).$implicit,a=r(4);return g(a.acceptPreview(o.charts[0]))}),C(5,"nile-glyph",160),c(6," Add to dashboard "),d()()}if(i&2){let e=r(4).$implicit,n=r(4);l(),b("disabled",n.isStreaming()),l(2),h(n.previewAltLabel(e.charts[0])?3:-1),l(),b("disabled",n.isStreaming())}}function ms(i,t){if(i&1){let e=k();s(0,"div",354),u("click",function(){_(e);let o=r(3).$implicit,a=r(4);return g(a.openArtifact(o.charts,o.id))}),s(1,"div",355),C(2,"nile-glyph",356),d(),s(3,"div",357)(4,"span",358),c(5),d(),s(6,"span",359),m(7,_s,3,0),c(8),d()(),s(9,"nile-button",22),u("click",function(o){_(e);let a=r(3).$implicit,p=r(4);return o.stopPropagation(),g(p.openArtifact(a.charts,a.id))}),c(10),C(11,"nile-glyph",360),d()(),m(12,us,7,3,"div",299)}if(i&2){let e=r(3).$implicit,n=r(4);l(5),y(e.dashboardTitle||e.charts[0].title),l(2),h(n.isPreviewChart(e.charts[0])?7:-1),l(),Y(" Dashboard \xB7 ",e.charts.length," widget",e.charts.length!==1?"s":""," "),l(2),q(" ",n.copy().viewButton," "),l(2),h(e.charts.length===1&&n.isPreviewChart(e.charts[0])?12:-1)}}function hs(i,t){if(i&1){let e=k();s(0,"div",262),C(1,"nile-glyph",361),s(2,"span",362),c(3),d(),s(4,"button",363),u("click",function(){_(e);let o=r(3).$implicit,a=r(4);return g(a.recomputeStoredForecast(o))}),c(5),d()()}if(i&2){let e=r(3).$implicit,n=r(4);l(3),y(n.restoredForecastLabel(e)),l(),b("disabled",n.isStreaming()),l(),q(" ",n.copy().recomputeButton," ")}}function Cs(i,t){if(i&1&&C(0,"nile-glyph",366),i&2){let e=r().$implicit;M("name",e.icon)("color",e.tone==="ai"?"#7a5af8":"var(--ng-colors-text-quaternary-500)")}}function fs(i,t){if(i&1&&(s(0,"span",368),c(1),d()),i&2){let e=r().$implicit;l(),y(e.badge)}}function xs(i,t){if(i&1){let e=k();s(0,"button",365),u("click",function(){let o=_(e).$implicit,a=r(4).$implicit,p=r(4);return g(p.onFollowUp(o,a))}),m(1,Cs,1,2,"nile-glyph",366),s(2,"span",367),c(3),d(),m(4,fs,2,1,"span",368),d()}if(i&2){let e=t.$implicit,n=r(8);W("follow-up--ai",e.tone==="ai"),b("disabled",n.isStreaming()),l(),h(e.icon?1:-1),l(2),y(e.label),l(),h(e.badge?4:-1)}}function ys(i,t){if(i&1&&(s(0,"div",263),F(1,xs,5,6,"button",364,qo),d()),i&2){let e=r(3).$implicit;l(),O(e.followUps??pe(0,Se))}}function bs(i,t){if(i&1&&(s(0,"div",264),C(1,"nile-glyph",369),s(2,"span",370),c(3),d()()),i&2){let e=r(7);l(3),y(e.copy().errors.assistantErrorFallback)}}function vs(i,t){if(i&1&&(s(0,"nile-ai-chat-bubble",257)(1,"div",258),m(2,Hr,2,1),F(3,cl,5,3,"div",259,G),m(5,pl,2,4,"button",260),m(6,ps,12,13,"div",261)(7,ms,13,6),m(8,hs,6,3,"div",262),m(9,ys,3,1,"div",263),m(10,bs,4,1,"div",264),d()()),i&2){let e=r(2).$implicit,n=r(4);b("role","ai")("hideIcon",!0),l(2),h(e.text&&!n.suppressTextFor(e)?2:-1),l(),O(n.nonPanelChoices(e)),l(2),h(n.isMultiChoice(e)&&n.isChoicePanelDismissed(e)&&!n.isChoicePanelComplete(e.choices??pe(8,Se))?5:-1),l(),h(e.charts.length===1&&!n.isDataGrid(e.charts[0])?6:e.charts.length?7:-1),l(2),h(n.isRestoredForecast(e)?8:-1),l(),h(e.followUps!=null&&e.followUps.length?9:-1),l(),h(e.hasError?10:-1)}}function ws(i,t){if(i&1&&(m(0,Ur,1,1,"nile-ai-steps",256),m(1,vs,11,9,"nile-ai-chat-bubble",257)),i&2){let e=r().$implicit;h(e.isStreaming&&(e.tools!=null&&e.tools.length)?0:-1),l(),h(e.text||e.charts.length||e.choices!=null&&e.choices.length||e.hasError?1:-1)}}function ks(i,t){if(i&1&&(m(0,Br,5,4,"nile-ai-chat-bubble",241),m(1,ws,2,2)),i&2){let e=t.$implicit;h(e.role==="user"?0:-1),l(),h(e.role==="assistant"?1:-1)}}function Ps(i,t){if(i&1&&F(0,ks,2,2,null,null,te),i&2){let e=r(3);O(e.messages())}}function As(i,t){if(i&1&&(s(0,"span",373),c(1),d()),i&2){let e=r(2);l(),Rt("",t," ",e.index+1," OF ",e.choices.length)}}function Ms(i,t){if(i&1&&(s(0,"span",373),c(1),d()),i&2){let e=r(2);l(),Y("",e.index+1," OF ",e.choices.length)}}function Ss(i,t){i&1&&(s(0,"span",387),c(1),d()),i&2&&(l(),y(t))}function Ts(i,t){if(i&1&&(s(0,"span",389),c(1),d()),i&2){let e=r().$implicit;l(),y(e.hint)}}function qs(i,t){if(i&1){let e=k();s(0,"nile-radio",383),u("click",function(){_(e);let o=r(2),a=r(4);return g(a.onPanelSkip(o.msg))}),s(1,"span",384)(2,"span",385),c(3),d(),s(4,"span",386),m(5,Ss,2,1,"span",387),s(6,"span",388),c(7),d(),m(8,Ts,2,1,"span",389),d()()()}if(i&2){let e,n=t.$implicit,o=t.$index,a=r(2),p=r(4);M("name","choice-panel-"+a.msg.id+"-"+a.index)("value",n.id)("checked",(a.choices[a.index].draftSelection||a.choices[a.index].selected)===n.id?"":null)("disabled",p.isStreaming()?"":null),l(3),y(o+1),l(2),h((e=p.optionBadgeText(n))?5:-1,e),l(2),y(p.optionPrimaryText(n)),l(),h(!p.optionBadgeText(n)&&n.hint?8:-1)}}function Ds(i,t){if(i&1){let e=k();s(0,"button",287),u("click",function(){_(e);let o=r(3),a=r(4);return g(a.previewWidget(o.msg,o.choices[o.index]))}),C(1,"nile-glyph",288),c(2),d()}if(i&2){let e=r(3),n=r(4);b("disabled",n.isStreaming()),l(2),q(' Preview "',n.choiceTitle(e.choices[e.index]),'" ')}}function Fs(i,t){if(i&1){let e=k();s(0,"button",283),u("click",function(){_(e);let o=r(3),a=r(4);return g(a.requestPlan(o.msg,o.choices[o.index]))}),c(1),d()}if(i&2){let e=r(7);b("disabled",e.isStreaming()),l(),q(" ",e.copy().givePlanButton," ")}}function Os(i,t){if(i&1){let e=k();s(0,"div",281)(1,"button",283),u("click",function(){_(e);let o=r(2),a=r(4);return g(a.openChatDraft(o.msg,o.choices[o.index]))}),C(2,"nile-glyph",286),c(3),d(),m(4,Ds,3,2,"button",285),m(5,Fs,2,2,"button",284),s(6,"button",390),u("click",function(){_(e);let o=r(2),a=r(4);return g(a.onPanelSkip(o.msg))}),c(7," Skip "),d()()}if(i&2){let e=r(2),n=r(4);l(),b("disabled",n.isStreaming()),l(2),q(" ",n.copy().somethingElseButton," "),l(),h(e.choices[e.index].kind==="widget_plan"?4:-1),l(),h(e.choices[e.index].kind==="clarification"?5:-1),l(),M("disabled",n.isStreaming()?"":null)}}function Es(i,t){if(i&1){let e=k();s(0,"div",282)(1,"div",290)(2,"nile-input",291),u("nile-input",function(o){_(e);let a=r(2),p=r(4);return g(p.onChatDraftTextChange(a.msg,a.choices[a.index],o.detail.value))})("keydown.enter",function(){_(e);let o=r(2),a=r(4);return g(a.onPanelChatDraftConfirm(o.msg,o.choices[o.index]))}),d(),s(3,"nile-button",22),u("click",function(){_(e);let o=r(2),a=r(4);return g(a.onPanelChatDraftConfirm(o.msg,o.choices[o.index]))}),c(4),d()()()}if(i&2){let e=r(2),n=r(4);l(2),b("value",e.choices[e.index].chatDraftText??""),M("placeholder",n.chatDraftPlaceholderFor(e.choices[e.index]))("disabled",n.isStreaming()?"":null),l(),M("disabled",!(e.choices[e.index].chatDraftText!=null&&e.choices[e.index].chatDraftText.trim())||n.isStreaming()?"":null),l(),q(" ",n.copy().defineItButton," ")}}function Is(i,t){if(i&1){let e=k();s(0,"div",372),m(1,As,2,3,"span",373)(2,Ms,2,2,"span",373),s(3,"div",374)(4,"button",375),u("click",function(){_(e);let o=r(),a=r(4);return g(a.onPanelPrev(o.msg))}),C(5,"nile-glyph",376),d(),s(6,"button",375),u("click",function(){_(e);let o=r(),a=r(4);return g(a.onPanelSkip(o.msg))}),C(7,"nile-glyph",377),d(),s(8,"button",378),u("click",function(){_(e);let o=r(),a=r(4);return g(a.dismissChoicePanel(o.msg))}),C(9,"nile-glyph",379),d()()(),s(10,"nile-radio-group",380),u("nile-change",function(o){_(e);let a=r(),p=r(4);return g(p.onChoiceChange(a.msg,a.choices[a.index],o.detail.value))}),F(11,qs,9,8,"nile-radio",381,te),d(),m(13,Os,8,5,"div",281)(14,Es,5,5,"div",282),s(15,"p",382),c(16,"\u2191\u2193 to navigate \xB7 \u21B5 to select \xB7 or type below"),d()}if(i&2){let e,n=r(),o=r(4);l(),h((e=o.panelBadgeLabel(n.choices[n.index]))?1:2,e),l(3),M("disabled",n.index===0?"":null),l(2),M("disabled",o.isStreaming()?"":null),l(4),M("label",n.choices[n.index].prompt||"Choose an option")("name","choice-panel-"+n.msg.id+"-"+n.index)("value",n.choices[n.index].draftSelection||n.choices[n.index].selected||null)("disabled",o.isStreaming()?"":null),l(),O(n.choices[n.index].options),l(2),h(n.choices[n.index].chatOpen?14:13)}}function Vs(i,t){if(i&1&&(s(0,"li",392)(1,"span",394),c(2),d(),s(3,"span",395),c(4),d()()),i&2){let e=t.$implicit,n=r(6);l(2),y(n.choiceTitle(e)),l(2),y(n.panelAnswerLabel(e))}}function Rs(i,t){if(i&1){let e=k();s(0,"div",372)(1,"span",373),c(2,"READY TO SUBMIT"),d(),s(3,"button",378),u("click",function(){_(e);let o=r(),a=r(4);return g(a.dismissChoicePanel(o.msg))}),C(4,"nile-glyph",379),d()(),s(5,"ul",391),F(6,Vs,5,2,"li",392,G),d(),s(8,"div",393)(9,"button",375),u("click",function(){_(e);let o=r(),a=r(4);return g(a.onPanelPrev(o.msg))}),C(10,"nile-glyph",376),c(11," Back "),d(),s(12,"nile-button",22),u("click",function(){_(e);let o=r(),a=r(4);return g(a.submitChoices(o.msg))}),c(13),d()()}if(i&2){let e=r(),n=r(4);l(6),O(e.choices),l(6),M("disabled",!n.hasPendingDraft(e.msg)||n.isStreaming()?"":null),l(),q(" ",n.copy().submitAnswersButton," ")}}function zs(i,t){if(i&1&&(s(0,"div",371),m(1,Is,17,8)(2,Rs,14,2),d()),i&2){let e=t;l(),h(e.index<e.choices.length?1:2)}}function Ns(i,t){if(i&1&&(s(0,"div",231),m(1,zs,3,1,"div",371),Ce(2,214),d()),i&2){let e,n=r(3),o=de(8);l(),h((e=n.activeChoicePanel())?1:-1,e),l(),b("ngTemplateOutlet",o)}}function Ls(i,t){if(i&1){let e=k();s(0,"nile-ai-chat",230,3),u("mouseup",function(o){_(e);let a=r(2);return g(a.onThreadMouseUp(o))}),m(2,Ir,11,0)(3,Ps,2,0),m(4,Ns,3,2,"div",231),d()}if(i&2){let e=r(2);l(2),h(e.loadingConversation()?2:3),l(2),h(e.messages().length?4:-1)}}function $s(i,t){if(i&1&&m(0,Er,12,4,"div",206)(1,Ls,5,2,"nile-ai-chat",207),i&2){let e=r();h(!e.loadingConversation()&&!e.messages().length?0:1)}}function Ws(i,t){if(i&1&&(s(0,"div",397),C(1,"nile-glyph",404),s(2,"span"),c(3),d()()),i&2){let e=r(2);l(3),y(e.copy().dropFilesOverlay)}}function Bs(i,t){if(i&1){let e=k();s(0,"div",398),C(1,"nile-glyph",33),s(2,"span",405),c(3),d(),s(4,"button",406),u("click",function(){_(e);let o=r(2);return g(o.clearReplyQuote())}),C(5,"nile-glyph",407),d()()}i&2&&(l(3),y(t))}function Us(i,t){i&1&&C(0,"nile-spinner",410)}function Gs(i,t){if(i&1){let e=k();s(0,"button",413),u("click",function(){_(e);let o=r().$implicit,a=r(3);return g(a.retryAttachment(o.id))}),c(1,"Retry"),d()}}function js(i,t){if(i&1){let e=k();s(0,"div",409),C(1,"nile-glyph",254),s(2,"span",255),c(3),d(),m(4,Us,1,0,"nile-spinner",410)(5,Gs,2,0,"button",411),s(6,"button",412),u("click",function(){let o=_(e).$implicit,a=r(3);return g(a.removeAttachment(o.id))}),C(7,"nile-glyph",407),d()()}if(i&2){let e=t.$implicit;W("aq-chip--error",e.status==="error"),l(),M("name",e.contentType.startsWith("image/")?"ng-image-03":"ng-file-06"),l(),M("title",e.name),l(),y(e.name),l(),h(e.status==="uploading"?4:e.status==="error"?5:-1)}}function Hs(i,t){if(i&1&&(s(0,"div",399),F(1,js,8,6,"div",408,te),d()),i&2){let e=r(2);l(),O(e.attachments())}}function Ys(i,t){if(i&1){let e=k();s(0,"nile-button",414),u("click",function(){_(e),r();let o=de(5);return g(o.click())}),C(1,"nile-glyph",415),d()}if(i&2){let e=r(2);M("disabled",e.isStreaming()||e.attachAtCapacity()?"":null)}}function Ks(i,t){if(i&1){let e=k();s(0,"div",396),u("dragenter",function(o){_(e);let a=r();return g(a.onComposerDragEnter(o))})("dragover",function(o){_(e);let a=r();return g(a.onComposerDragOver(o))})("dragleave",function(o){_(e);let a=r();return g(a.onComposerDragLeave(o))})("drop",function(o){_(e);let a=r();return g(a.onComposerDrop(o))}),m(1,Ws,4,1,"div",397),m(2,Bs,6,1,"div",398),m(3,Hs,3,0,"div",399),s(4,"input",400,5),u("change",function(o){_(e);let a=r();return g(a.onFilesPicked(o))}),d(),s(6,"nile-ai-prompt",401,6),u("keydown",function(o){_(e);let a=r();return g(a.onComposerKeydown(o))})("nile-change",function(o){_(e);let a=r();return g(a.inputText.set((o.detail==null?null:o.detail.value)??""))})("nile-submit",function(o){_(e);let a=r();return g(a.onComposerSubmit(o.detail==null?null:o.detail.value))})("nile-stop",function(){_(e);let o=r();return g(o.stopStream())}),s(8,"div",402),u("click",function(o){return o.stopPropagation()}),m(9,Ys,2,1,"nile-button",403),d()()()}if(i&2){let e,n=r();W("aq-composer-wrap--dragover",n.isDraggingFile()),l(),h(n.features().attachments&&n.isDraggingFile()?1:-1),l(),h((e=n.replyQuote())?2:-1,e),l(),h(n.features().attachments&&n.attachments().length?3:-1),l(),M("accept",n.acceptUploadTypes),l(2),W("aq-attach-full",n.attachAtCapacity()),b("placeholder",n.copy().composerPlaceholder)("hideModel",!0)("hideAddContext",!0)("rows",1)("speechLang","en-US")("value",n.inputText())("loading",n.isStreaming()),l(3),h(n.features().attachments?9:-1)}}function Qs(i,t){if(i&1){let e=k();s(0,"div",416),u("pointerdown",function(o){_(e);let a=r();return g(a.startChatResize(o))}),d()}if(i&2){let e=r();W("is-active",e.isResizing())}}function Xs(i,t){if(i&1){let e=k();s(0,"div",432),C(1,"nile-glyph",433),s(2,"nile-slide-toggle",434),u("nile-change",function(o){_(e);let a=r(3);return g(a.onFiltersToggle(o.detail.checked))}),d()()}if(i&2){let e=r(3);W("aq-filters-pill--active",e.artifactHasFilter()),l(2),b("isChecked",e.artifactHasFilter())}}function Js(i,t){if(i&1){let e=k();s(0,"div",428)(1,"nile-button",435),u("click",function(){_(e);let o=r(3);return g(o.undoCanvas())}),C(2,"nile-glyph",436),c(3," Undo "),d(),s(4,"nile-button",437),u("click",function(){_(e);let o=r(3);return g(o.redoCanvas())}),C(5,"nile-glyph",438),d()()}if(i&2){let e=r(3);l(),M("disabled",e.canUndoCanvas()?null:""),l(3),M("disabled",e.canRedoCanvas()?null:""),l(),M("color",e.canRedoCanvas()?"var(--ng-colors-text-secondary-700)":"var(--ng-colors-text-placeholder-subtle)")}}function Zs(i,t){if(i&1){let e=k();s(0,"div",418)(1,"div",423)(2,"span",424),c(3,"Preview"),d(),s(4,"span",425),c(5),d()(),s(6,"div",426),m(7,Xs,3,3,"div",427),m(8,Js,6,3,"div",428),C(9,"span",429),s(10,"nile-button",430),u("click",function(){_(e);let o=r(2);return g(o.closeArtifact())}),C(11,"nile-glyph",431),d()()()}if(i&2){let e=r(2);l(5),y(e.artifactSubtitle()),l(2),h(e.features().canvas.filters?7:-1),l(),h(e.features().canvas.undoRedo?8:-1)}}function ed(i,t){if(i&1&&(s(0,"div",420),C(1,"nile-glyph",439),s(2,"p",440),c(3),d(),s(4,"p",441),c(5),d()()),i&2){let e=r(2);l(3),y(e.copy().emptyCanvasTitle),l(2),y(e.copy().emptyCanvasSubtitle)}}function td(i,t){if(i&1){let e=k();s(0,"shared-dashboard-grid",442,7),u("selectionChange",function(o){_(e);let a=r(2);return g(a.onSelectionChange(o))})("forecast",function(o){_(e);let a=r(2);return g(a.onArtifactForecast(o))})("setAlert",function(o){_(e);let a=r(2);return g(a.onSetAlert(o))})("filterSubmit",function(o){_(e);let a=r(2);return g(a.onArtifactFilterSubmit(o))})("filterChange",function(o){_(e);let a=r(2);return g(a.onArtifactFilterChange(o))})("dslWidgetUpdated",function(o){_(e);let a=r(2);return g(a.onDslWidgetUpdated(o))})("dslEditorClosed",function(){_(e);let o=r(2);return g(o.onArtifactDslEditorClosed())})("widgetClick",function(o){_(e);let a=r(2);return g(a.onKpiWidgetClicked(o))})("aiSend",function(o){_(e);let a=r(2);return g(a.onArtifactAiSend(o))}),d()}if(i&2){let e=r(2);b("widgets",e.artifactWidgets())("filtersEnabled",!!e.builderDashboardId())("conversationId",e.activeConversationId())("editMode",!1)("selectable",e.features().canvas.widgetSelection)("canSetAlert",!0)("canAddToStory",e.widgetMenu().addToStory)("canForecast",!0)("showWidgetMenu",e.widgetMenu().enabled)("canAsk",e.widgetMenu().ask)("canChangeChartType",e.widgetMenu().changeChartType)("canManageFilters",e.widgetMenu().manageFilters)("canCustomizeColors",e.widgetMenu().customizeColors)("canViewChartData",e.widgetMenu().chartData)("canExportPng",e.widgetMenu().exportPng)("canExportCsv",e.widgetMenu().exportCsv)("canPrint",e.widgetMenu().print)("forecastable",e.artifactForecastable())("forecastingWidgetId",e.artifactForecastingId())("showEditDslInViewMode",!0)("widgetsLoading",e.applyingFilters())("dashboardFilters",e.activeDashboardFilters())("resolvedFilters",e.activeResolvedFilters())("applySummary",e.applySummary())("filterExplanation",e.filterExplanation())("detailPanel",!0)("detailRootLabel","Canvas")}}function nd(i,t){if(i&1){let e=k();s(0,"nile-button",21),u("click",function(){let o=_(e),a=r(3);return g(a.forecastFromChart(o))}),C(1,"nile-glyph",444),c(2),d()}if(i&2){let e=r(3);l(2),q(" ",e.copy().forecastButton," ")}}function id(i,t){if(i&1){let e=k();s(0,"nile-button",21),u("click",function(){_(e);let o=r(3);return g(o.openStoryPicker())}),C(1,"nile-glyph",445),c(2),d()}if(i&2){let e=r(3);M("disabled",e.committingAction()||!e.hasSelection()?"":null),l(2),q(" ",e.copy().addToStoryButton," ")}}function od(i,t){if(i&1){let e=k();s(0,"nile-button",21),u("click",function(){_(e);let o=r(3);return g(o.publishAsNewDashboard())}),c(1),d()}if(i&2){let e=r(3);M("loading",e.committingAction()==="publish"?"":null)("disabled",e.committingAction()||!e.hasSelection()?"":null),l(),q(" ",e.copy().publishAsDashboardButton," ")}}function ad(i,t){}function rd(i,t){if(i&1&&(s(0,"div",46),c(1),d()),i&2){let e=r(4);l(),y(e.copy().noResultsMatchFilters)}}function ld(i,t){i&1&&Ce(0)}function sd(i,t){if(i&1){let e=k();s(0,"nile-menu-item",70),u("click",function(){let o=_(e).$implicit,a=r(6);return a.showAddPicker.set(!1),g(a.addToExistingDashboard(o.id))}),ke(1,ld,1,0,"ng-container",353),d()}if(i&2){let e=t.$implicit;r(6);let n=de(40);l(),b("ngTemplateOutlet",n)("ngTemplateOutletContext",rt(2,Fi,e))}}function dd(i,t){if(i&1&&(s(0,"div",80),c(1),d(),F(2,sd,2,4,"nile-menu-item",null,te)),i&2){let e=t.$implicit;l(),y(e.label),l(),O(e.items)}}function cd(i,t){if(i&1&&(s(0,"div",46),c(1),d()),i&2){let e=r(5);l(),y(e.copy().noDashboardsYet)}}function pd(i,t){if(i&1&&F(0,dd,4,1,null,null,se,!1,cd,2,1,"div",46),i&2){let e=r(4);O(e.groupedPickerDashboards())}}function _d(i,t){if(i&1){let e=k();s(0,"nile-dropdown",446),u("nile-hide",function(){_(e);let o=r(3);return g(o.showAddPicker.set(!1))}),s(1,"nile-button",352),u("click",function(){_(e);let o=r(3);return g(o.showAddPicker.set(!o.showAddPicker()))}),C(2,"nile-glyph",160),c(3),d(),s(4,"nile-menu",43),u("nile-search-value",function(o){_(e);let a=r(3);return g(a.pickerSearch.set((o.detail==null?null:o.detail.value)??""))}),s(5,"nile-menu-item",44),u("click",function(){_(e);let o=r(3);return o.showAddPicker.set(!1),g(o.addArtifactToDashboard())}),C(6,"nile-glyph",45),c(7),d(),m(8,rd,2,1,"div",46)(9,pd,3,1),d()()}if(i&2){let e=r(3);b("open",e.showAddPicker()),l(),M("loading",e.committingAction()==="add"?"":null)("disabled",e.committingAction()||!e.hasSelection()?"":null),l(2),q(" ",e.copy().addToDashboardButton," "),l(),M("noResultsMessage",e.copy().noResultsMatchFilters),l(3),q(" ",e.copy().newDashboardLabel," "),l(),h(e.pickerSearchEmpty()?8:9)}}function gd(i,t){if(i&1){let e=k();s(0,"nile-button",22),u("click",function(){_(e);let o=r(3);return g(o.addArtifactToDashboard())}),C(1,"nile-glyph",160),c(2),d()}if(i&2){let e=r(3);M("loading",e.committingAction()==="add"?"":null)("disabled",e.committingAction()||!e.hasSelection()?"":null),l(2),q(" ",e.builderOpen()?e.copy().addToCurrentDashboardButton:e.copy().addToDashboardButton," ")}}function ud(i,t){if(i&1&&(s(0,"div",422),m(1,nd,3,1,"nile-button",205),m(2,id,3,2,"nile-button",205),m(3,od,2,3,"nile-button",205),m(4,ad,0,0)(5,_d,10,7,"nile-dropdown",443)(6,gd,3,3,"nile-button",350),d()),i&2){let e,n=r(2);l(),h((e=n.artifactForecastMsg())?1:-1,e),l(),h(-1),l(),h(n.features().canvas.publishAsDashboard?3:-1),l(),h(n.features().canvas.addToDashboard?!n.builderOpen()&&n.conversationDashboards().length>1?5:6:4)}}function md(i,t){if(i&1&&(s(0,"aside",417),m(1,Zs,12,3,"div",418),s(2,"div",419),m(3,ed,6,2,"div",420)(4,td,2,27,"shared-dashboard-grid",421),d(),m(5,ud,7,4,"div",422),Ce(6,214),d()),i&2){let e=r(),n=de(35);W("aq-artifact-pane--dsl-only",e.dslOnlyArtifact()),l(),h(e.dslOnlyArtifact()?-1:1),l(2),h(e.artifactWidgets().length===0?3:4),l(2),h(!e.dslOnlyArtifact()&&e.artifactFooterHasActions()?5:-1),l(),b("ngTemplateOutlet",n)}}function hd(i,t){i&1&&C(0,"nile-spinner",458)}function Cd(i,t){i&1&&C(0,"nile-glyph",459)}function fd(i,t){if(i&1){let e=k();s(0,"input",455),u("input",function(o){_(e);let a=r(2);return g(a.dashboardTitleDraft.set(o.target.value))})("keydown.enter",function(){_(e);let o=r(2);return g(o.commitDashboardTitle())})("keydown.escape",function(){_(e);let o=r(2);return g(o.cancelEditDashboardTitle())}),d(),s(1,"nile-lite-tooltip",456)(2,"button",457),u("click",function(){_(e);let o=r(2);return g(o.commitDashboardTitle())}),m(3,hd,1,0,"nile-spinner",458)(4,Cd,1,0,"nile-glyph",459),d()()}if(i&2){let e=r(2);b("value",e.dashboardTitleDraft()),l(2),b("disabled",e.renamingDashboard()),l(),h(e.renamingDashboard()?3:4)}}function xd(i,t){i&1&&C(0,"nile-skeleton-loader",449)}function yd(i,t){if(i&1){let e=k();s(0,"nile-lite-tooltip",461)(1,"button",462),u("click",function(){_(e);let o=r(3);return g(o.startEditDashboardTitle())}),C(2,"nile-glyph",463),d()()}}function bd(i,t){if(i&1&&(s(0,"span",460),c(1),d(),m(2,yd,3,0,"nile-lite-tooltip",461)),i&2){let e=r(2);l(),y((e.builderRef==null?null:e.builderRef.dashboardName())||"Dashboard"),l(),h(e.builderDashboardId()?2:-1)}}function vd(i,t){if(i&1){let e=k();s(0,"section",17)(1,"header",447)(2,"div",34)(3,"nile-button",430),u("click",function(){_(e);let o=r();return g(o.closeBuilder())}),C(4,"nile-glyph",448),d(),m(5,fd,5,3)(6,xd,1,0,"nile-skeleton-loader",449)(7,bd,3,2),d(),s(8,"div",36)(9,"nile-lite-tooltip",450)(10,"button",451),u("click",function(){_(e);let o=r();return g(o.toggleBuilderFullscreen())}),C(11,"nile-glyph",452),d()(),s(12,"shared-builder-toolbar",453),u("action",function(o){_(e);let a=r();return g(a.onBuilderMenuAction(o))}),d()()(),s(13,"shared-builder-host",454),u("exitBuilder",function(){_(e);let o=r();return g(o.closeBuilder())})("executiveSummary",function(o){_(e);let a=r();return g(a.onExecutiveSummary(o))})("galleryPrompt",function(o){_(e);let a=r();return g(a.inputText.set(o))})("published",function(o){_(e);let a=r();return g(a.onBuilderPublished(o))})("widgetClick",function(o){_(e);let a=r();return g(a.onKpiWidgetClicked(o))}),d(),Ce(14,214),d()}if(i&2){let e=r(),n=de(35);l(5),h(e.editingDashboardTitle()?5:e.builderRef!=null&&e.builderRef.loading()?6:7),l(4),b("content",e.builderFullscreen()?"Exit full screen":"Full screen"),l(),M("aria-label",e.builderFullscreen()?"Exit full screen":"Full screen"),l(),M("name",e.builderFullscreen()?"ng-minimize":"ng-maximize"),l(),b("canToggleFilter",!0)("hasFilter",(e.builderRef==null?null:e.builderRef.hasFilter())??!1)("canForecast",!0)("anyForecastOn",(e.builderRef==null?null:e.builderRef.anyForecastOn())??!1)("editMode",(e.builderRef==null?null:e.builderRef.editMode())??!0)("showFullscreen",!1)("fullscreen",e.builderFullscreen())("busy",(e.builderRef==null?null:e.builderRef.isPublishing())??!1)("exporting",(e.builderRef==null?null:e.builderRef.isExporting())??!1)("showPromptGallery",!1)("canPublish",(e.builderRef==null?null:e.builderRef.canPublish())??!0),l(),b("dashboardId",e.builderDashboardId())("preseeded",e.builderPreseeded())("galleryPrompts",e.suggestions())("canAddToStory",e.widgetMenu().addToStory)("showWidgetMenu",e.widgetMenu().enabled)("canAsk",e.widgetMenu().ask)("canChangeChartType",e.widgetMenu().changeChartType)("canManageFilters",e.widgetMenu().manageFilters)("canCustomizeColors",e.widgetMenu().customizeColors)("canViewChartData",e.widgetMenu().chartData)("canExportPng",e.widgetMenu().exportPng)("canExportCsv",e.widgetMenu().exportCsv)("canPrint",e.widgetMenu().print)("canTweak",e.widgetMenu().tweak)("canEdit",e.widgetMenu().edit)("canDelete",e.widgetMenu().delete),l(),b("ngTemplateOutlet",n)}}function wd(i,t){if(i&1){let e=k();s(0,"label",474)(1,"input",475),u("change",function(){let o=_(e).$implicit,a=r(3);return g(a.onGranularityPick(o))}),d(),s(2,"span"),c(3),d()()}if(i&2){let e=t.$implicit,n=r(2);W("fs-segment--on",n.granularity===e.value)("fs-segment--off",!e.enabled),M("title",e.reason||null),l(),b("value",e.value)("checked",n.granularity===e.value)("disabled",!e.enabled),l(2),y(e.value)}}function kd(i,t){i&1&&(s(0,"p",468),c(1),d()),i&2&&(l(),y(t))}function Pd(i,t){if(i&1&&(s(0,"p",468),c(1),d()),i&2){let e=r();l(),y(e.granularityNote)}}function Ad(i,t){if(i&1&&(s(0,"div",464)(1,"span",476),c(2,"Model"),d(),s(3,"div",477)(4,"p",478),c(5),d(),s(6,"p",479),c(7),d()()()),i&2){let e=t;l(5),y(e.title),l(2),y(e.body)}}function Md(i,t){if(i&1&&(s(0,"div",464)(1,"span",476),c(2,"Guardrails"),d(),s(3,"div",480)(4,"p",478),C(5,"nile-glyph",481),c(6),d(),s(7,"p",479),c(8),d()()()),i&2){let e=t;l(3),W("fs-card--pass",e.passed)("fs-card--warn",!e.passed),l(2),M("name",e.passed?"ng-check":"ng-alert-circle")("color",e.passed?"var(--ng-colors-fg-success-primary)":"var(--ng-colors-fg-warning-primary)"),l(),q(" ",e.title," "),l(2),y(e.body)}}function Sd(i,t){if(i&1){let e=k();s(0,"div",464)(1,"label",465),c(2," Horizon \u2014 "),s(3,"span",466),c(4),d()(),s(5,"input",467),u("input",function(o){_(e);let a=r(2);return g(a.onHorizonInput(o.target.value))}),d(),s(6,"p",468),c(7),d()(),s(8,"div",464)(9,"span",469),c(10,"Granularity"),d(),s(11,"div",470),F(12,wd,4,9,"label",471,nt),d(),m(14,kd,2,1,"p",468)(15,Pd,2,1,"p",468),d(),s(16,"div",464)(17,"label",472),c(18," Confidence interval \u2014 "),s(19,"span",466),c(20),d()(),s(21,"input",473),u("input",function(o){_(e);let a=r(2);return g(a.onConfidenceIndexInput(o.target.value))}),d(),s(22,"p",468),c(23),d()(),m(24,Ad,8,2,"div",464),m(25,Md,9,8,"div",464)}if(i&2){let e,n,o,a=t,p=r(),x=r();l(4),Y("",p.horizon," ",x.horizonUnit()),l(),Z("--fs-fill",x.horizonFill()),b("value",p.horizon),M("max",x.horizonMax())("aria-valuetext",p.horizon+" "+x.horizonUnit()),l(2),y(x.horizonNote()),l(5),O(x.granularityChoices()),l(2),h((e=x.unavailableGranularityNote())?14:15,e),l(6),q("",p.confidence,"%"),l(),Z("--fs-fill",x.confidenceFill()),b("value",x.confidenceIndex()),M("max",a.confidenceLevels.length-1)("aria-valuetext",p.confidence+"%"),l(2),y(a.confidenceNote),l(),h((n=a.modelCard)?24:-1,n),l(),h((o=a.guardrails)?25:-1,o)}}function Td(i,t){if(i&1&&m(0,Sd,26,18),i&2){let e,n=r();h((e=n.forecastCopy())?0:-1,e)}}function qd(i,t){if(i&1&&(s(0,"div",485),C(1,"nile-skeleton-loader",486),s(2,"div",487),C(3,"nile-skeleton-loader",78),d()()),i&2){let e=t.$implicit;l(2),Z("width",e,"px")}}function Dd(i,t){if(i&1&&(s(0,"div",483),F(1,qd,4,2,"div",485,G),d()),i&2){let e=r(2);l(),O(e.gallerySkeletonRows)}}function Fd(i,t){if(i&1){let e=k();s(0,"nile-ai-prompts",488),u("nile-item-click",function(o){_(e);let a=r(2);return g(a.onGalleryPromptPick(o.detail==null?null:o.detail.data))}),d()}if(i&2){let e=r(2);b("items",e.galleryPromptItems())("vertical",!0)("wrap",!0)}}function Od(i,t){if(i&1&&(s(0,"div",128),c(1),d()),i&2){let e=r(2);l(),Y("",e.copy().noPromptsMatch,' "',e.gallerySearch(),'".')}}function Ed(i,t){if(i&1&&(s(0,"div",128),c(1),d()),i&2){let e=r(2);l(),y(e.copy().noPromptsYet)}}function Id(i,t){if(i&1){let e=k();s(0,"nile-input",482),u("nile-input",function(o){_(e);let a=r();return g(a.gallerySearch.set((o.detail==null?null:o.detail.value)??""))})("nile-change",function(o){_(e);let a=r();return g(a.gallerySearch.set((o.detail==null?null:o.detail.value)??""))}),C(1,"nile-glyph",109),d(),m(2,Dd,3,0,"div",483)(3,Fd,1,3,"nile-ai-prompts",484)(4,Od,2,2,"div",128)(5,Ed,2,1,"div",128)}if(i&2){let e=r();b("placeholder",e.copy().promptGallerySearchPlaceholder)("value",e.gallerySearch()),l(2),h(e.suggestionsLoading()?2:e.filteredGalleryPrompts().length?3:e.gallerySearch().trim()?4:5)}}function Vd(i,t){if(i&1&&(s(0,"div",489),c(1),d()),i&2){let e=r(2);l(),y(e.copy().xrayLoadingSources)}}function Rd(i,t){if(i&1&&(s(0,"div",128),c(1),d()),i&2){let e=r(2);l(),y(e.copy().xrayNoSources)}}function zd(i,t){i&1&&C(0,"nile-glyph",72)}function Nd(i,t){if(i&1){let e=k();s(0,"nile-menu-item",70),u("click",function(){let o=_(e).$implicit,a=r(4);return g(a.onXrayDatasetPick(o.datasetId))}),s(1,"span",504),c(2),d(),m(3,zd,1,0,"nile-glyph",72),d()}if(i&2){let e=t.$implicit,n=r(4);l(2),y(e.label),l(),h(n.xraySelectedDatasetId()===e.datasetId?3:-1)}}function Ld(i,t){if(i&1){let e=k();s(0,"nile-dropdown",499),u("nile-hide",function(){_(e);let o=r(3);return g(o.xrayDatasetMenuOpen.set(!1))}),s(1,"button",500),u("click",function(){_(e);let o=r(3);return g(o.xrayDatasetMenuOpen.set(!o.xrayDatasetMenuOpen()))}),C(2,"nile-glyph",501),s(3,"span",502),c(4),d(),C(5,"nile-glyph",503),d(),s(6,"nile-menu"),F(7,Nd,4,2,"nile-menu-item",null,Do),d()()}if(i&2){let e=r(3);b("open",e.xrayDatasetMenuOpen()),l(4),y(e.xraySelectedDatasetLabel()),l(3),O(e.xrayDatasets())}}function $d(i,t){if(i&1&&(s(0,"div",496),C(1,"nile-glyph",505),s(2,"span"),c(3),d()()),i&2){let e=r(3);l(3),y(e.xrayError())}}function Wd(i,t){if(i&1&&(s(0,"div",497),C(1,"nile-spinner",506),s(2,"p",507),c(3),d(),s(4,"p",508),c(5),d()()),i&2){let e=r(3);l(3),y(e.xrayStatus()==="analyzing"?e.copy().xrayAnalyzing:e.copy().xrayBuilding),l(2),y(e.xrayRunningEntityLabel())}}function Bd(i,t){if(i&1&&(s(0,"div",509),C(1,"nile-skeleton-loader",486)(2,"nile-skeleton-loader",510),d()),i&2){let e=t.$implicit;l(2),b("width",e)}}function Ud(i,t){if(i&1&&(s(0,"div",498),F(1,Bd,3,1,"div",509,G),d()),i&2){let e=r(3);l(),O(e.xraySkeletonRows)}}function Gd(i,t){if(i&1&&(s(0,"span",518),c(1),d()),i&2){let e=r().$implicit;l(),q("",e.schema,".")}}function jd(i,t){if(i&1&&(s(0,"span",519),c(1),d()),i&2){let e=r().$implicit,n=r(4);l(),Y("",e.fieldCount," ",n.copy().xrayFieldsLabel)}}function Hd(i,t){if(i&1){let e=k();s(0,"button",515),u("click",function(){let o=_(e).$implicit,a=r(4);return g(a.runXray(o))}),C(1,"nile-glyph",516),s(2,"span",517),m(3,Gd,2,1,"span",518),c(4),d(),m(5,jd,2,2,"span",519),s(6,"span",520),C(7,"nile-glyph",229),s(8,"span"),c(9),d()()()}if(i&2){let e=t.$implicit,n=r(4);b("disabled",n.xrayRunning())("title",n.xrayEntityLabel(e)),l(),b("name",e.kind==="index"?"ng-layers-three-01":"ng-table"),l(2),h(e.schema?3:-1),l(),q("",e.name," "),l(),h(e.fieldCount?5:-1),l(4),y(n.copy().xrayRunLabel)}}function Yd(i,t){if(i&1&&(s(0,"div",511)(1,"span",512),c(2),d(),s(3,"span",513),c(4),d()(),s(5,"div",498),F(6,Hd,10,7,"button",514,Fo),d()),i&2){let e=r(3);l(2),Y("",e.xrayFilteredEntities().length," ",e.xrayEntityNoun()),l(2),y(e.copy().xrayPickHint),l(2),O(e.xrayFilteredEntities())}}function Kd(i,t){if(i&1&&(s(0,"div",128),c(1),d()),i&2){let e=r(3);l(),Y("",e.copy().xrayNoEntitiesMatch,' "',e.xrayEntitySearch(),'".')}}function Qd(i,t){if(i&1&&(s(0,"div",128),c(1),d()),i&2){let e=r(3);l(),y(e.copy().xrayNoEntities)}}function Xd(i,t){if(i&1){let e=k();m(0,Ld,9,2,"nile-dropdown",490),s(1,"nile-input",491),u("nile-input",function(o){_(e);let a=r(2);return g(a.xrayEntitySearch.set((o.detail==null?null:o.detail.value)??""))})("nile-change",function(o){_(e);let a=r(2);return g(a.xrayEntitySearch.set((o.detail==null?null:o.detail.value)??""))}),C(2,"nile-glyph",109),d(),s(3,"details",492)(4,"summary",493),C(5,"nile-glyph",494),s(6,"span"),c(7),d()(),s(8,"nile-input",495),u("nile-input",function(o){_(e);let a=r(2);return g(a.xrayTopic.set((o.detail==null?null:o.detail.value)??""))})("nile-change",function(o){_(e);let a=r(2);return g(a.xrayTopic.set((o.detail==null?null:o.detail.value)??""))}),d()(),m(9,$d,4,1,"div",496),m(10,Wd,6,2,"div",497)(11,Ud,3,0,"div",498)(12,Yd,8,3)(13,Kd,2,2,"div",128)(14,Qd,2,1,"div",128)}if(i&2){let e=r(2);h(e.xrayDatasets().length>1?0:-1),l(),b("placeholder",e.copy().xrayEntitySearchPlaceholder)("value",e.xrayEntitySearch()),l(2),b("open",!!e.xrayTopic()),l(4),y(e.copy().xrayFocusToggle),l(),b("placeholder",e.copy().xrayTopicPlaceholder)("value",e.xrayTopic()),l(),h(e.xrayError()?9:-1),l(),h(e.xrayRunning()?10:e.xrayEntitiesLoading()?11:e.xrayFilteredEntities().length?12:e.xrayEntitySearch().trim()?13:14)}}function Jd(i,t){if(i&1&&m(0,Vd,2,1,"div",489)(1,Rd,2,1,"div",128)(2,Xd,15,9),i&2){let e=r();h(e.xraySourcesLoading()?0:e.xraySources().length?2:1)}}function Zd(i,t){i&1&&(s(0,"nile-breadcrumb-item"),c(1),d()),i&2&&(l(),q(" ",t," "))}function ec(i,t){i&1&&c(0),i&2&&q(" ",t," ")}function tc(i,t){i&1&&C(0,"nile-skeleton-loader",524)}function nc(i,t){if(i&1&&(s(0,"p",526),c(1),d()),i&2){let e=r(3);l(),y(e.cohortDetailCaption())}}function ic(i,t){if(i&1&&C(0,"nile-skeleton-loader",533),i&2){let e=t.$implicit;Z("left",e.x/12*100,"%")("top",e.y*72,"px")("width","calc("+e.w/12*100+"% - 12px)")("height",e.h*72-12,"px")}}function oc(i,t){if(i&1&&(s(0,"div",531),F(1,ic,1,8,"nile-skeleton-loader",532,G),d()),i&2){let e=r(4);Z("height",e.widgetDetailPanelSkeletonHeight(),"px"),l(),O(e.widgetDetailPanelSkeletonSlots())}}function ac(i,t){i&1&&(s(0,"div",530)(1,"div",534),C(2,"nile-skeleton-loader",535)(3,"nile-skeleton-loader",535)(4,"nile-skeleton-loader",535),d(),C(5,"nile-skeleton-loader",536),d())}function rc(i,t){if(i&1&&m(0,oc,3,2,"div",529)(1,ac,6,0,"div",530),i&2){let e=r(3);h(e.widgetDetailPanelSkeletonSlots().length?0:1)}}function lc(i,t){if(i&1){let e=k();s(0,"shared-dashboard-grid",537),u("selectionChange",function(o){_(e);let a=r(3);return g(a.widgetDetailPanelSelectedIds.set(o))}),d()}if(i&2){let e=r(3);b("widgets",e.widgetDetailPanelWidgets())("editMode",!1)("selectable",e.widgetDetailPanelKind()==="dashboard")("selectedWidgetIds",e.widgetDetailPanelSelectedIds())("canSetAlert",!1)("canAddToStory",!1)("canForecast",!1)("showWidgetMenu",!1)}}function sc(i,t){if(i&1){let e=k();s(0,"div",528)(1,"span",538),c(2),d(),s(3,"nile-button",21),u("click",function(){_(e);let o=r(3);return g(o.toggleSelectAllDetailPanelWidgets())}),c(4),d(),s(5,"nile-button",21),u("click",function(){_(e);let o=r(3);return g(o.addSelectedDetailPanelWidgetsToCanvas())}),C(6,"nile-glyph",539),c(7),d(),s(8,"nile-button",22),u("click",function(){_(e);let o=r(3);return g(o.replaceCanvasWithDetailPanel())}),C(9,"nile-glyph",540),c(10," Replace canvas "),d()()}if(i&2){let e=r(3);l(2),Y(" ",e.widgetDetailPanelSelectedIds().length," of ",e.widgetDetailPanelWidgets().length," selected "),l(2),q(" ",e.isDetailPanelFullySelected()?"Deselect all":"Select all"," "),l(),M("disabled",e.widgetDetailPanelSelectedIds().length?null:""),l(2),q(" Add ",e.widgetDetailPanelSelectedIds().length," to canvas "),l(),M("disabled",e.widgetDetailPanelWidgets().length?null:"")}}function dc(i,t){if(i&1){let e=k();s(0,"div",528)(1,"nile-button",22),u("click",function(){_(e);let o=r(3);return g(o.exportCohortRowsCsv())}),C(2,"nile-glyph",541),c(3),d(),s(4,"nile-button",21),u("click",function(){_(e);let o=r(3);return g(o.copyCohortDefinition())}),C(5,"nile-glyph",542),c(6),d()()}if(i&2){let e=r(3);l(),M("disabled",e.detailPanelCohortData()?null:""),l(2),q(" ",e.copy().cohortExportRowsButton," "),l(),M("disabled",e.detailPanelCohortData()?null:""),l(2),q(" ",e.copy().cohortCopyDefinitionButton," ")}}function cc(i,t){if(i&1){let e=k();s(0,"div",528)(1,"nile-button",22),u("click",function(){_(e);let o=r(3);return g(o.addWidgetTemplateFromDetailPanel())}),C(2,"nile-glyph",160),c(3," Add to dashboard "),d()()}}function pc(i,t){if(i&1){let e=k();s(0,"div",521)(1,"div",522)(2,"nile-breadcrumb",523),u("nile-click",function(){_(e);let o=r(2);return g(o.closeWidgetDetailPanel())}),s(3,"nile-breadcrumb-item"),c(4),d(),m(5,Zd,2,1,"nile-breadcrumb-item"),s(6,"nile-breadcrumb-item"),m(7,ec,1,1)(8,tc,1,0,"nile-skeleton-loader",524),d()()(),s(9,"div",525),m(10,nc,2,1,"p",526),m(11,rc,2,1)(12,lc,1,8,"shared-dashboard-grid",527),d(),m(13,sc,11,6,"div",528)(14,dc,7,4,"div",528)(15,cc,4,0,"div",528),d()}if(i&2){let e,n,o=r(2);l(4),q(" ",o.detailRootCrumb()," "),l(),h((e=o.detailPanelWidgetCrumb())?5:-1,e),l(2),h((n=o.detailPanelLastCrumb())?7:8,n),l(3),h(o.detailPanelCohortId()?10:-1),l(),h(o.widgetDetailPanelLoading()?11:12),l(2),h(o.widgetDetailPanelKind()==="dashboard"?13:o.detailPanelCohortId()?14:o.widgetDetailPanelCanAdd()?15:-1)}}function _c(i,t){if(i&1&&m(0,pc,16,6,"div",521),i&2){let e=r();h(e.widgetDetailPanelOpen()?0:-1)}}function gc(i,t){if(i&1){let e=k();s(0,"app-alert-drawer",543),u("closed",function(){_(e);let o=r();return g(o.onAlertClosed())})("saved",function(){_(e);let o=r();return g(o.onAlertClosed())}),d()}if(i&2){let e,n=r();b("open",n.alertDrawerOpen())("widget",n.alertWidget())("dashboardId",null)("source",n.alertSource())("sourceName",((e=n.selectedScope())==null?null:e.name)??"")("authoringMode","chat")}}function uc(i,t){i&1&&C(0,"nile-executive-summary",30,8)}function mc(i,t){if(i&1){let e=k();s(0,"app-story-picker-drawer",544),u("closed",function(){_(e);let o=r();return g(o.closeStoryPicker())})("added",function(){_(e);let o=r();return g(o.onAddedToStory())}),d()}if(i&2){let e=r();b("open",e.storyPickerOpen())("widget",e.storyPickerWidget())}}function hc(i,t){if(i&1&&(s(0,"div",75),C(1,"nile-glyph",96),s(2,"div",77)(3,"span",89),c(4),d(),s(5,"span",90),c(6),d()()()),i&2){let e=t.$implicit,n=r();l(3),b("title",e.name||"Untitled"),l(),y(e.name||"Untitled"),l(2),y(n.dashboardMeta(e))}}function ve(){return Math.random().toString(36).slice(2)}function Cc(i){if(!i.length)return i;let t=new Map;for(let a of i){let p=t.get(a.y)??[];p.push(a),t.set(a.y,p)}let e=[...t.keys()].sort((a,p)=>a-p),n=[],o=0;for(let a of e){let p=t.get(a);for(let x of p)n.push(T(w({},x),{y:o}));o+=Math.max(...p.map(x=>x.h))}return n}var fc=4,xc="forecast-settings",yc="forecast-this";function Ii(i){return i.split(`
8
8
  `).map(t=>{let e=/^For "[^"]+":\s*(.*)$/.exec(t);return e?e[1]:t}).join(`
9
- `)}function Ti(i){return{id:i.id,role:i.role,text:i.role==="user"?Ei(i.content):i.content,charts:(i.charts??[]).map(t=>{let e=t;return{title:e.title??"Chart",componentName:e.componentName??"",config:t}}),dashboardTitle:i.dashboardTitle??void 0,forecastSpec:i.forecastSpec??void 0,choices:i.choices??void 0,isStreaming:!1,hasError:!1}}var De=class i{alertDrawerOpen=f(!1);alertWidget=f(null);onSetAlert(t){this.alertWidget.set(t),this.alertDrawerOpen.set(!0)}onAlertClosed(){this.alertDrawerOpen.set(!1)}alertSource=D(()=>{let t=gt(this.selectedScope());if(t)return t;let e=this.conversationConnectionId();return e?{connectionId:e}:null});chartDataSourceId(t){return(t?.config??{}).dataSourceId??null}canCreateAlert(t){return!!this.alertSource()||!!this.chartDataSourceId(t)}createAlertFromChart(t){this.canCreateAlert(t)&&(this.isFilterChart(t)||this.onSetAlert(T(w({},this.artifactToWidget(t)),{id:"chat-alert"})))}aqChatEl;builderRef;artifactGridRef;composerRef;aiExecutiveSummaryEl;svc=N(he);tokenStore=N(ae);destroyRef=N(Ft);hostEl=N(Ie);features(){return I().features}widgetMenu(){return I().features.widgetMenu}copy(){return I().copy}showHeader(){return I().ui.header}withCount(t,e){return Qn(t,e)}zone=N(Ot);appRef=N(It);route=N(Zt);router=N(en);dashboardState=N(mn);publishRepo=N(me);globalWidget=N(Un);forecastApi=N(Ze);cohort=N(Me);forecastService=N(Cn);loading=f(!0);conversations=f([]);activeConversationId=f(null);conversationCustomerId=f(null);conversationConnectionId=f(null);messages=f([]);inputText=f("");isStreaming=f(!1);streamAbort=null;suggestions=f([]);suggestionsLoading=f(!0);suggestionsSeq=0;showConversationPicker=f(!1);showRelatedDashboards=f(!1);loadingConversation=f(!1);editingTitle=f(!1);titleDraft=f("");editingDashboardTitle=f(!1);dashboardTitleDraft=f("");renamingDashboard=f(!1);conversationsLoading=f(!0);dashboardsLoading=f(!0);menuSkeletonRows=[188,142,205];gallerySkeletonRows=[420,300,480,360,260,400];librarySkeletonGroups=[["62%","48%"],["55%","70%"]];libraryChipSkeletonWidths=[58,96,84,78,86,88,100,104,76,88];savingDashboard=f(!1);committingAction=f(null);conversationDashboards=f([]);showAddPicker=f(!1);inlinePickerFor=f(null);inlineChartTypePickerFor=f(null);inlineChartTypeOptions=f([]);inlineChartTypeLoading=f(!1);inlineChartTypePickerSeq=0;inlineChartTypeApplying=f(!1);inlineChartTypeError=f(null);inlineFilterPickerFor=f(null);showScopePicker=f(!1);datasets=f([]);pipelines=f([]);scopeLoading=f(!1);selectedScope=f(null);scopeListsLoaded=!1;saveDialogOpen=f(!1);saveDashboardName=f("");chatPaneTab=f("chat");tabsVisible=D(()=>ei(this.features()));cohortCriteria=f([]);selectedCriterionId=f(null);cohortPreview=f(null);cohortCriteriaLoaded=!1;cohortCriteriaLoading=f(!1);cohortCriteriaError=f(null);cohortPreviewLoading=f(!1);cohortPreviewError=f(null);cohortCriteriaSkeletonRows=[0,1,2,3];cohortMatchSkeletonRows=[0,1,2];cohortMatchesExpanded=f(!1);cohortAllMatches=f(null);cohortMembersLoading=f(!1);cohortMembersError=f(null);static COHORT_MEMBER_LIMIT=100;visibleCohortMatches=D(()=>ri(this.cohortPreview(),this.cohortAllMatches(),this.cohortMatchesExpanded()));cohortNamesWithheld=D(()=>yt(this.cohortPreview()));cohortHasMoreMatches=D(()=>ai(this.cohortPreview()));cohortMatchesTruncated=D(()=>li(this.cohortPreview(),this.cohortAllMatches()));cohortMatchesTruncatedNote=D(()=>{let t=this.cohortPreview(),e=this.cohortAllMatches();return!t||!e?"":this.copy().cohortMatchesTruncatedNote.replace("{shown}",String(e.length)).replace("{matchCount}",String(t.matchCount))});cohortMatchSummary=D(()=>{let t=this.cohortPreview();return t?this.copy().cohortMatchSummary.replace("{matchCount}",String(t.matchCount)).replace("{totalCount}",String(t.totalCount)):""});cohortViewAllLabel=D(()=>{let t=this.cohortPreview();return t?this.cohortMatchesExpanded()?this.copy().cohortShowFewerLink:this.copy().cohortViewAllLink.replace("{matchCount}",String(t.matchCount)):""});async loadCohortCriteria(){if(!this.cohortCriteriaLoaded){this.cohortCriteriaLoading.set(!0),this.cohortCriteriaError.set(null);try{this.cohortCriteria.set(await this.cohort.listCriteria()),this.cohortCriteriaLoaded=!0}catch(t){this.cohortCriteriaError.set(bt(t))}finally{this.cohortCriteriaLoading.set(!1)}}}async retryCohortCriteria(){this.cohortCriteriaLoaded=!1,await this.loadCohortCriteria()}async selectCohortCriterion(t){this.selectedCriterionId.set(t),this.cohortPreview.set(null),this.cohortPreviewError.set(null),this.resetCohortMatchExpansion(),this.cohortPreviewLoading.set(!0);try{let e=await this.cohort.previewCriterion(t);if(this.selectedCriterionId()!==t)return;this.cohortPreview.set(e)}catch(e){if(this.selectedCriterionId()!==t)return;this.cohortPreview.set(null),this.cohortPreviewError.set(bt(e))}finally{this.selectedCriterionId()===t&&this.cohortPreviewLoading.set(!1)}}resetCohortMatchExpansion(){this.cohortMatchesExpanded.set(!1),this.cohortAllMatches.set(null),this.cohortMembersError.set(null),this.cohortMembersLoading.set(!1)}async toggleAllCohortMatches(){if(this.cohortMatchesExpanded()){this.cohortMatchesExpanded.set(!1);return}let t=this.selectedCriterionId();if(!(!t||this.cohortMembersLoading())){if(this.cohortAllMatches()){this.cohortMatchesExpanded.set(!0);return}this.cohortMembersError.set(null),this.cohortMembersLoading.set(!0);try{let e=await this.cohort.listMembers(t,i.COHORT_MEMBER_LIMIT);if(this.selectedCriterionId()!==t)return;this.cohortAllMatches.set(e),this.cohortMatchesExpanded.set(!0)}catch(e){if(this.selectedCriterionId()!==t)return;this.cohortMembersError.set(e?.status===403?"forbidden":"failed")}finally{this.selectedCriterionId()===t&&this.cohortMembersLoading.set(!1)}}}addCohortToCanvas(){let t=this.cohortPreview();if(!t||this.activeArtifact().some(o=>{let a=o.config;return(a?.config?._meta?.cohortId??a?._meta?.cohortId)===t.criterionId}))return;this.pushCanvasHistory();let n=oi(t);this.bucketExtraCharts.update(o=>[...o,n]),this.ensureArtifactPaneOpen()}setChatPaneTab(t){Zn(t,this.features())&&(this.chatPaneTab.set(t),(t==="library"||t==="tools")&&this.ensureArtifactPaneOpen(),t==="library"&&this.prefetchWidgetTemplateCatalog(),t==="tools"&&this.loadCohortCriteria())}galleryOpen=f(!1);gallerySearch=f("");templateCategories=f([]);templateAllTemplates=f([]);templateCategoriesLoading=f(!1);templateTemplatesLoading=f(!1);templateActiveCategory=f("all");widgetTemplateAllTemplates=f([]);widgetTemplateTemplatesLoading=f(!1);widgetTemplateActiveCategory=f("all");selectWidgetTemplateCategory(t){this.widgetTemplateActiveCategory.set(t)}widgetTemplatePickerSelectedIds=f([]);toggleWidgetTemplateSelection(t){this.widgetTemplatePickerSelectedIds.update(e=>e.includes(t)?e.filter(n=>n!==t):[...e,t])}addSelectedWidgetTemplates(){let t=this.widgetTemplatePickerSelectedIds();t.length&&(this.asOneCanvasStep(()=>{for(let e of t)this.selectWidgetTemplate(e)}),this.widgetTemplatePickerSelectedIds.set([]))}widgetTemplateCountForCategory(t){return this.widgetTemplateAllTemplates().filter(e=>e.category===t).length}librarySearch=f("");libraryKpiChartOptions={exporting:{enabled:!1},credits:{enabled:!1}};brandSparklineColor=f(Dn);readBrandSparklineColor(){this.brandSparklineColor.set(Fn(this.hostEl.nativeElement))}widgetTemplateCard(t){let e=this.widgetTemplatePreviews(),a=e.get(t.id)?.config?.config?.chart;return{templateId:t.id,title:t.widgetName,desc:t.description,value:a?.value??"\u2014",loading:!e.has(t.id),sparkline:a?.sparkline??[]}}libraryWidgetGroups=D(()=>{let t=this.widgetTemplateActiveCategory(),e=this.librarySearch().trim().toLowerCase();return(t==="all"?this.templateCategories():this.templateCategories().filter(o=>o.key===t)).map(o=>({key:o.key,label:o.label,cards:this.widgetTemplateAllTemplates().filter(a=>a.category===o.key).filter(a=>!e||a.widgetName.toLowerCase().includes(e)||(a.description??"").toLowerCase().includes(e)).map(a=>this.widgetTemplateCard(a))})).filter(o=>o.cards.length>0)});isGroupFullySelected(t){let e=this.widgetTemplatePickerSelectedIds();return t.length>0&&t.every(n=>e.includes(n.templateId))}toggleLibraryGroupSelection(t){let e=t.map(o=>o.templateId),n=this.isGroupFullySelected(t);this.widgetTemplatePickerSelectedIds.update(o=>{let a=new Set(o);return n?e.forEach(p=>a.delete(p)):e.forEach(p=>a.add(p)),[...a]})}openWidgetDetailFromCard(t){let e=this.widgetTemplatePreviews().get(t);if(!e)return;let n=T(w({},this.artifactToWidget(e)),{id:`kpi-gallery-${t}`});this.openWidgetDetailPanelForWidget(n,!0)}runViewTransition(t,e="forward"){let n=document,o=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;if(typeof n.startViewTransition!="function"||o){t();return}let a=document.documentElement;e==="back"&&(a.dataset.vtDirection="back");let p=()=>delete a.dataset.vtDirection;n.startViewTransition(()=>{t(),this.appRef.tick()})?.finished?.then(p,p)??p()}artifactPickerTab=f("kpis");templateCountForCategory(t){return this.templateAllTemplates().filter(e=>e.category===t).length}libraryDashboardGroups=D(()=>{let t=this.templateActiveCategory(),e=this.librarySearch().trim().toLowerCase();return(t==="all"?this.templateCategories():this.templateCategories().filter(o=>o.key===t)).map(o=>({key:o.key,label:o.label,templates:this.templateAllTemplates().filter(a=>a.category===o.key).filter(a=>!e||a.name.toLowerCase().includes(e)||(a.description??"").toLowerCase().includes(e))})).filter(o=>o.templates.length>0)});widgetTemplatePreviews=f(new Map);widgetTemplateSourceId=f(null);widgetDetailPanelOpen=f(!1);widgetDetailPanelLoading=f(!1);widgetDetailPanelTitle=f(null);widgetDetailPanelRaw=f([]);widgetDetailPanelTemplateId=f(null);widgetDetailPanelCanAdd=f(!1);widgetDetailPanelKind=f("widget");widgetDetailPanelSourceWidgetTitle=f(null);detailPanelWidgetCrumb=D(()=>this.widgetDetailPanelKind()==="widget"?this.widgetDetailPanelSourceWidgetTitle():null);detailPanelLastCrumb=D(()=>{let t=this.widgetDetailPanelTitle();return t?t===this.detailPanelWidgetCrumb()?this.copy().detailCrumbLabel:t:null});widgetDetailPanelSelectedIds=f([]);widgetDetailPanelSourceTemplateId=f(null);detailPanelCohortId=f(null);detailPanelCohortData=f(null);cohortDetailCaption=D(()=>{let t=this.copy().cohortDetailCaption,e=this.detailPanelCohortData()?.detail?.scan;if(!e)return t;let n=this.copy().cohortDetailCoverage.replace("{events}",String(e.events)).replace("{systems}",String(e.systems));return`${t} \xB7 ${n}`});widgetDetailPanelSkeletonSlots=f([]);widgetDetailPanelSkeletonHeight=D(()=>{let t=this.widgetDetailPanelSkeletonSlots();return t.length?Math.max(...t.map(e=>(e.y+e.h)*72)):0});widgetDetailPanelWidgets=D(()=>{let t=this.widgetDetailPanelRaw().map((e,n)=>T(w({},this.artifactToWidget(e)),{id:`detail-panel-${n}`}));return dt(t)});filteredGalleryPrompts=D(()=>{let t=this.gallerySearch().trim().toLowerCase(),e=this.suggestions();return t?e.filter(n=>n.toLowerCase().includes(t)):e});welcomePromptCards=D(()=>{let t=this.forecastContext();return this.suggestions().slice(0,Cc).map(e=>(I().features.forecast&&t?!!wt(e,t):!1)?{label:e,icon:"ng-stars-02",badge:"FORECAST",tone:"ai"}:{label:e,icon:"ng-lightbulb-05",tone:"plain"})});galleryPromptItems=D(()=>this.filteredGalleryPrompts().map(t=>({key:t,label:t,icon:"ng-lightbulb-05"})));artifactSourceMsgId=f(null);activeArtifactRaw=f([]);artifactForcedOpen=f(!1);templateSourceId=f(null);bucketExtraCharts=f([]);activeArtifact=D(()=>{let t=this.artifactSourceMsgId(),e=t?this.messages().find(o=>o.id===t)?.charts??this.activeArtifactRaw():this.activeArtifactRaw(),n=this.bucketExtraCharts();return n.length?[...e,...n]:e});artifactOpen=D(()=>this.artifactForcedOpen()||this.activeArtifact().length>0);dslOnlyArtifact=f(!1);CANVAS_HISTORY_LIMIT=25;canvasUndoStack=f([]);canvasRedoStack=f([]);canUndoCanvas=D(()=>this.canvasUndoStack().length>0);canRedoCanvas=D(()=>this.canvasRedoStack().length>0);canvasHistorySuspended=!1;snapshotCanvas(){return{base:[...this.activeArtifactRaw()],extras:[...this.bucketExtraCharts()],sourceMsgId:this.artifactSourceMsgId(),templateSourceId:this.templateSourceId(),widgetTemplateSourceId:this.widgetTemplateSourceId(),saveName:this.saveDashboardName()}}restoreCanvas(t){this.artifactSourceMsgId.set(t.sourceMsgId),this.activeArtifactRaw.set(t.base),this.bucketExtraCharts.set(t.extras),this.templateSourceId.set(t.templateSourceId),this.widgetTemplateSourceId.set(t.widgetTemplateSourceId),this.saveDashboardName.set(t.saveName),this.selectedWidgetIds.set([]),this.ensureArtifactPaneOpen()}pushCanvasHistory(){this.canvasHistorySuspended||(this.canvasUndoStack.update(t=>[...t,this.snapshotCanvas()].slice(-this.CANVAS_HISTORY_LIMIT)),this.canvasRedoStack.set([]))}asOneCanvasStep(t){this.pushCanvasHistory(),this.canvasHistorySuspended=!0;try{t()}finally{this.canvasHistorySuspended=!1}}undoCanvas(){let t=this.canvasUndoStack();t.length&&(this.canvasRedoStack.update(e=>[...e,this.snapshotCanvas()].slice(-this.CANVAS_HISTORY_LIMIT)),this.canvasUndoStack.set(t.slice(0,-1)),this.restoreCanvas(t[t.length-1]))}redoCanvas(){let t=this.canvasRedoStack();t.length&&(this.canvasUndoStack.update(e=>[...e,this.snapshotCanvas()].slice(-this.CANVAS_HISTORY_LIMIT)),this.canvasRedoStack.set(t.slice(0,-1)),this.restoreCanvas(t[t.length-1]))}ensureArtifactPaneOpen(){this.artifactForcedOpen()||this.artifactForcedOpen.set(!0)}artifactTitle=D(()=>{let t=this.mostRecentDashboardTitle();return t||(this.activeArtifact().find(n=>!this.isFilterChart(n))?.title??this.activeArtifact()[0]?.title??"Untitled canvas")});artifactSubtitle=D(()=>{let t=this.activeArtifact().filter(e=>!this.isFilterChart(e)).length;return`${this.artifactTitle()} \xB7 ${t} widget${t===1?"":"s"}`});isFilterChart(t){if(!t)return!1;let e=t.config??{};return Ne({componentName:(e.componentName??t.componentName??"").toLowerCase(),config:e.config??e})}mostRecentDashboardTitle(){let t=this.artifactSourceMsgId();if(!t)return;let e=this.messages(),n=e.findIndex(o=>o.id===t);for(let o=n;o>=0;o--)if(e[o]?.dashboardTitle)return e[o].dashboardTitle}baseArtifactWidgets=D(()=>{let t=this.artifactSourceMsgId()??"artifact",e=this.activeArtifact().map((o,a)=>T(w({},this.artifactToWidget(o)),{id:`${t}-${a}`})),n=dt(e);return un(n)});filterOverlay=f(new Map);forecastOverlay=f(new Map);artifactForecastable=f({});artifactForecastingId=f(null);artifactWidgets=D(()=>{let t=this.baseArtifactWidgets(),e=this.filterOverlay(),n=this.forecastOverlay();return!e.size&&!n.size?t:t.map(o=>{let a=e.get(o.id),p=a?T(w({},o),{config:a.config,edited:a.edited}):o,x=n.get(o.id);return x?T(w({},p),{config:x}):p})});async onArtifactForecast(t){let e=String(t.widget.id);if(!this.artifactForecastingId()){if(!t.enable){this.forecastOverlay.update(n=>{let o=new Map(n);return o.delete(e),o});return}this.artifactForecastingId.set(e);try{let n=await this.forecastService.forecastWidget(t.widget);if(n?.guardrails&&n.guardrails.passed===!1)return;n?.widget?.config&&this.forecastOverlay.update(o=>new Map(o).set(e,n.widget.config))}catch{}finally{this.artifactForecastingId.set(null)}}}async loadArtifactForecastable(){let t=this.baseArtifactWidgets();if(!t.length){this.artifactForecastable.set({});return}this.artifactForecastable.set(await this.forecastService.probeWidgets(t))}applyingFilters=f(!1);activeDashboardFilters=f(null);activeResolvedFilters=f(null);applySummary=f(null);filterExplanation=f(null);applyFiltersSeq=0;applyFiltersAbort=null;filterSuggestCache=new Map;filterSuggestInflight=new Set;selectedWidgetIds=f([]);hasSelection=D(()=>this.features().canvas.widgetSelection?this.selectedWidgetIds().length>0:this.artifactWidgets().length>0);selectedArtifactCharts=D(()=>{if(!this.features().canvas.widgetSelection)return this.activeArtifact();let t=new Set(this.selectedWidgetIds()),e=this.artifactWidgets();return this.activeArtifact().filter((n,o)=>t.has(e[o]?.id))});artifactFooterHasActions=D(()=>{let t=this.features().canvas;return t.publishAsDashboard||t.addToDashboard||!!this.artifactForecastMsg()});builderOpen=f(!1);detailRootCrumb=D(()=>this.builderOpen()?this.builderRef?.dashboardName?.()?.trim()||this.copy().detailDashboardCrumbLabel:this.copy().detailCanvasCrumbLabel);builderDashboardId=f(null);builderPreseeded=f(!1);builderFullscreen=f(!1);chatPaneWidth=f(null);isResizing=f(!1);layoutMode=D(()=>Jn({hasMessages:this.messages().length>0,artifactOpen:this.artifactOpen()&&!this.dslOnlyArtifact(),builderOpen:this.builderOpen()}));chatPaneStyleWidth=D(()=>{if(this.builderFullscreen())return null;let t=this.layoutMode();return t==="split"||t==="builder"?this.chatPaneWidth():null});customerId=()=>{let t=this.tokenStore.tenantId();return I().customerId??t??""};attachments=f([]);uploadsInFlight=D(()=>this.attachments().some(t=>t.status==="uploading"));excelCount=D(()=>this.attachments().filter(t=>ft(t.name,t.contentType)).length);nonExcelCount=D(()=>this.attachments().length-this.excelCount());attachAtCapacity=D(()=>this.nonExcelCount()>=ht&&this.excelCount()>=Ct);acceptUploadTypes=[...mt,".xls",".xlsx"].join(",");dragDepth=0;isDraggingFile=f(!1);canSend=D(()=>{let t=this.inputText().trim().length>0,e=this.attachments().some(n=>n.status==="ready");return(t||e)&&!this.isStreaming()&&!this.uploadsInFlight()});quoteBadge=f(null);replyQuote=f(null);activeConversation=D(()=>this.conversations().find(t=>t.id===this.activeConversationId())??null);forecastTitle=f(null);activeConversationTitle=D(()=>this.activeConversation()?.title??this.forecastTitle()??"New conversation");static FALLBACK_PROMPTS=["Give me a dashboard overview of my workforce","Show headcount breakdown by department","What are the top metrics I should be tracking?","Analyze trends over the last quarter","Show me employee distribution by location"];constructor(){Ce(()=>{let t=this.customerId(),e=this.selectedScope();if(!t)return;let n=e?e.id:null,o=e?.kind==="pipeline",a=++this.suggestionsSeq;this.suggestionsLoading.set(!0),this.svc.getSuggestedPrompts(n,o).then(p=>{if(a!==this.suggestionsSeq)return;let x=[...p.widgetSuggestions??[],...p.conversationStarters??[]];this.suggestions.set(x.length?x:i.FALLBACK_PROMPTS)}).catch(()=>{a===this.suggestionsSeq&&this.suggestions.set(i.FALLBACK_PROMPTS)}).finally(()=>{a===this.suggestionsSeq&&this.suggestionsLoading.set(!1)})}),this.forecastApi.context().then(t=>this.forecastContext.set(t)),Ce(()=>{let t=this.customerId();t&&$t(()=>{let e=this.conversationCustomerId();!e||e===t||this.resetForTenantChange()})})}resetForTenantChange(){this.activeConversationId.set(null),this.conversationCustomerId.set(null),this.conversationConnectionId.set(null),this.messages.set([]),this.conversations.set([]),this.closeArtifact(),this.builderOpen.set(!1),this.builderPreseeded.set(!1),this.builderDashboardId.set(null),this.conversationsLoading.set(!0),this.svc.listConversations().then(t=>this.conversations.set(t)).catch(()=>this.conversations.set([])).finally(()=>this.conversationsLoading.set(!1)),this.loadConversationDashboards()}async ngOnInit(){this.destroyRef.onDestroy(dn(()=>this.readBrandSparklineColor())),this.readBrandSparklineColor();try{this.conversationsLoading.set(!0);let o=await this.svc.listConversations().catch(()=>[]);this.conversations.set(o)}finally{this.conversationsLoading.set(!1),this.loading.set(!1)}this.loadConversationDashboards(),this.prefetchTemplateCatalog();let t=I().initial,e=this.route.snapshot.queryParamMap.get("summary")==="1",n=t.dashboardId??this.route.snapshot.paramMap.get("id");n&&(this.builderPreseeded.set(!1),this.builderDashboardId.set(n),this.builderOpen.set(!0),t.summary||e?this.onExecutiveSummary(n).then(()=>{e&&this.router.navigate([],{relativeTo:this.route,queryParams:{},replaceUrl:!0})}):this.restoreThreadForDashboard(n))}async restoreThreadForDashboard(t){try{let e=null;if(e=(await this.svc.getDashboard(t).catch(()=>null))?.conversationId??null,e||(e=(await this.svc.listDashboards(100).catch(()=>[])).find(p=>p.id===t)?.conversationId??null),!e)return;let o=await this.svc.getConversation(e);if(!o)return;this.activeConversationId.set(e),this.conversationCustomerId.set(this.customerId()),this.conversationConnectionId.set(o.conversation.connectionId??null),this.messages.set(o.messages.map(Ti)),this.loadConversationDashboards(),this.scrollToBottom()}catch{}}streamSpeed=[6,18];openScopeMenu(){let t=!this.showScopePicker();this.showScopePicker.set(t),t&&this.loadScopeLists()}async loadScopeLists(){if(!this.scopeListsLoaded){this.scopeListsLoaded=!0,this.scopeLoading.set(!0);try{let[t,e]=await Promise.allSettled([this.svc.listDatasets(),this.svc.listPipelines()]);t.status==="fulfilled"&&this.datasets.set(t.value),e.status==="fulfilled"&&this.pipelines.set(e.value),[t,e].filter(o=>o.status==="rejected").length>0&&(this.scopeListsLoaded=!1)}finally{this.scopeLoading.set(!1)}}}selectScope(t,e){this.selectedScope.set({kind:t,id:e.id,name:e.name}),this.showScopePicker.set(!1)}clearScope(){this.selectedScope.set(null)}dashboardSource(){return gt(this.selectedScope())??{}}closeScopeMenu(){this.showScopePicker.set(!1)}async selectConversation(t,e=!1){if(this.showConversationPicker.set(!1),!(t===this.activeConversationId()&&!e)){this.loading.set(!0),this.loadingConversation.set(!0);try{let n=await this.svc.getConversation(t);if(!n)return;this.activeConversationId.set(t),this.conversationCustomerId.set(this.customerId()),this.conversationConnectionId.set(n.conversation.connectionId??null),this.messages.set(n.messages.map(Ti)),this.loadConversationDashboards(),this.scrollToBottom()}catch{}finally{this.loading.set(!1),this.loadingConversation.set(!1)}}}async deleteConversation(t,e){t.stopPropagation();try{await this.svc.deleteConversation(e),this.conversations.update(n=>n.filter(o=>o.id!==e)),this.activeConversationId()===e&&(this.activeConversationId.set(null),this.conversationCustomerId.set(null),this.conversationConnectionId.set(null),this.messages.set([]))}catch{}}newConversation(){this.forecastTitle.set(null),this.closeForecastSettings(),this.appliedForecastSettings.set(null),this.activeConversationId.set(null),this.conversationCustomerId.set(null),this.conversationConnectionId.set(null),this.messages.set([]),this.showConversationPicker.set(!1)}openRelatedDashboard(t){this.showRelatedDashboards.set(!1),this.closeArtifact(),this.builderPreseeded.set(!1),this.builderDashboardId.set(t),this.builderOpen.set(!0)}async openNewDashboard(){if(!this.savingDashboard()){this.showRelatedDashboards.set(!1),this.savingDashboard.set(!0);try{let t="Untitled Dashboard";this.closeArtifact(),this.dashboardState.resetDashboard(),this.dashboardState.setDashboardName(t);let e=await this.svc.createDashboard(T(w({name:t,conversationId:this.activeConversationId()??void 0},this.dashboardSource()),{widgets:[]}));this.dashboardState.setDashboardId(e.id),this.builderPreseeded.set(!0),this.builderDashboardId.set(e.id),this.builderOpen.set(!0)}catch{}finally{this.savingDashboard.set(!1)}}}convSearch=f("");dashSearch=f("");renamingId=f(null);renameDraft=f("");static BUCKETS=[{key:"today",maxDays:0},{key:"yesterday",maxDays:1},{key:"week",maxDays:7},{key:"older",maxDays:1/0}];daysAgo(t){if(!t)return 1/0;let e=new Date(t);if(Number.isNaN(e.getTime()))return 1/0;let n=new Date;n.setHours(0,0,0,0);let o=new Date(e);return o.setHours(0,0,0,0),Math.round((n.getTime()-o.getTime())/864e5)}relativeStamp(t){if(!t)return"";let e=new Date(t);return Number.isNaN(e.getTime())?"":this.daysAgo(t)===0?e.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}):e.toLocaleDateString(void 0,{month:"short",day:"numeric"})}bucketLabel(t){let e=this.copy();return t==="today"?e.groupToday:t==="yesterday"?e.groupYesterday:t==="week"?e.groupPrevious7Days:e.groupOlder}groupByRecency(t,e){let n=[],o=[...t].sort((a,p)=>new Date(e(p)??0).getTime()-new Date(e(a)??0).getTime());for(let a of i.BUCKETS){let p=o.filter(x=>this.daysAgo(e(x))<=a.maxDays);if(p.length&&n.push({key:a.key,label:this.bucketLabel(a.key),items:p}),o=o.filter(x=>this.daysAgo(e(x))>a.maxDays),!o.length)break}return n}matches(t,e){return e?(t??"").toLowerCase().includes(e.toLowerCase()):!0}groupedConversations=D(()=>this.groupByRecency(this.conversations().filter(t=>this.matches(t.title,this.convSearch())),t=>t.updatedAt));groupedDashboards=D(()=>this.groupByRecency(this.conversationDashboards().filter(t=>this.matches(t.name,this.dashSearch())),t=>t.updatedAt));pickerSearch=f("");groupedPickerDashboards=D(()=>this.groupByRecency(this.conversationDashboards().filter(t=>this.matches(t.name,this.pickerSearch())),t=>t.updatedAt));pickerSearchEmpty=D(()=>!!this.pickerSearch()&&this.groupedPickerDashboards().length===0);convSearchEmpty=D(()=>!!this.convSearch()&&this.groupedConversations().length===0);dashSearchEmpty=D(()=>!!this.dashSearch()&&this.groupedDashboards().length===0);countClause(t,e){return typeof t!="number"||!Number.isFinite(t)?"":`${t} ${e}${t===1?"":"s"}`}conversationMeta(t){let e=this.relativeStamp(t.lastMessageAt??t.updatedAt);return[this.countClause(t.messageCount,"message"),e].filter(Boolean).join(" \xB7 ")}dashboardMeta(t){let e=this.relativeStamp(t.updatedAt);return[this.countClause(t.widgetCount,"widget"),e].filter(Boolean).join(" \xB7 ")}startRename(t,e,n){t.stopPropagation(),this.renamingId.set(e),this.renameDraft.set(n??"")}cancelRename(t){t?.stopPropagation(),this.renamingId.set(null)}async commitRenameConversation(t,e){t.stopPropagation();let n=this.renameDraft().trim();if(this.renamingId.set(null),!(!n||n===e.title))try{await this.svc.updateConversation(e.id,{title:n}),this.conversations.update(o=>o.map(a=>a.id===e.id?T(w({},a),{title:n}):a))}catch{}}async commitRenameDashboard(t,e){t.stopPropagation();let n=this.renameDraft().trim();if(this.renamingId.set(null),!(!n||n===e.name))try{await this.svc.updateDashboard(e.id,{name:n}),this.conversationDashboards.update(o=>o.map(a=>a.id===e.id?T(w({},a),{name:n}):a))}catch{}}async deleteDashboardFromMenu(t,e){t.stopPropagation();try{await this.svc.deleteDashboard(e),this.conversationDashboards.update(n=>n.filter(o=>o.id!==e)),this.builderDashboardId()===e&&this.builderOpen.set(!1)}catch{}}startEditTitle(){this.activeConversationId()&&(this.titleDraft.set(this.activeConversationTitle()),this.editingTitle.set(!0))}cancelEditTitle(){this.editingTitle.set(!1)}async commitTitle(){if(!this.editingTitle())return;this.editingTitle.set(!1);let t=this.activeConversationId(),e=this.titleDraft().trim();if(!(!t||!e||e===this.activeConversationTitle()))try{await this.svc.updateConversation(t,{title:e}),this.conversations.update(n=>n.map(o=>o.id===t?T(w({},o),{title:e}):o))}catch{}}onFilesPicked(t){let e=t.target,n=Array.from(e.files??[]);e.value="";for(let o of n)this.startUpload(o)}onComposerDragOver(t){this.attachAtCapacity()||this.isStreaming()||(t.preventDefault(),t.dataTransfer&&(t.dataTransfer.dropEffect="copy"))}onComposerDragEnter(t){this.attachAtCapacity()||this.isStreaming()||t.dataTransfer?.types.includes("Files")&&(t.preventDefault(),this.dragDepth++,this.isDraggingFile.set(!0))}onComposerDragLeave(t){t.preventDefault(),this.dragDepth=Math.max(0,this.dragDepth-1),this.dragDepth===0&&this.isDraggingFile.set(!1)}onComposerDrop(t){if(t.preventDefault(),this.dragDepth=0,this.isDraggingFile.set(!1),this.attachAtCapacity()||this.isStreaming())return;let e=Array.from(t.dataTransfer?.files??[]);for(let n of e)this.startUpload(n)}startUpload(t){let e=ft(t.name,t.type);if(e&&this.excelCount()>=Ct||!e&&this.nonExcelCount()>=ht||!e&&!mt.includes(t.type)||t.size>Xn||this.attachments().some(x=>x.name===t.name&&x.size===t.size&&x.file?.lastModified===t.lastModified))return;let o=we(),a=new AbortController,p={id:o,name:t.name,contentType:t.type,size:t.size,status:"uploading",progress:0,file:t,abort:a};this.attachments.update(x=>[...x,p]),this.runUpload(o,t,a)}async runUpload(t,e,n){try{let{key:o}=await this.svc.uploadAttachment(e,{signal:n.signal});this.patchAttachment(t,{status:"ready",key:o,progress:100})}catch(o){if(n.signal.aborted)return;console.error("[ask-aquera] attachment upload failed",o),this.patchAttachment(t,{status:"error"})}}patchAttachment(t,e){this.attachments.update(n=>n.map(o=>o.id===t?w(w({},o),e):o))}removeAttachment(t){this.attachments().find(e=>e.id===t)?.abort?.abort(),this.attachments.update(e=>e.filter(n=>n.id!==t))}retryAttachment(t){let e=this.attachments().find(o=>o.id===t);if(!e?.file)return;let n=new AbortController;this.patchAttachment(t,{status:"uploading",progress:0,abort:n}),this.runUpload(t,e.file,n)}isMultiChoice(t){return(t.choices?.length??0)>1}onChoiceChange(t,e,n){if(!n||e.selected||this.isStreaming())return;let o=e.options.find(a=>a.id===n);o&&(this.isMultiChoice(t)?this.updateAssistantMsg(t.id,a=>({choices:(a.choices??[]).map(p=>p===e?T(w({},p),{draftSelection:o.id,chatOpen:!1,chatDraftText:void 0}):p)})):this.selectChoice(t,e,o))}selectChoice(t,e,n){e.selected||this.isStreaming()||(this.updateAssistantMsg(t.id,o=>({choices:(o.choices??[]).map(a=>a===e?T(w({},a),{selected:n.id,draftSelection:void 0,chatOpen:!1,chatDraftText:void 0}):a)})),this.pendingDisplayOverride=`${this.choiceTitle(e)}: ${n.label}`,this.inputText.set(n.reply??n.label),this.sendMessage())}hasPendingDraft(t){return!!t.choices?.some(e=>!e.selected&&(e.draftSelection||e.chatDraftText?.trim()))}submitChoices(t){if(this.isStreaming())return;let e=[],n=[];this.updateAssistantMsg(t.id,o=>({choices:(o.choices??[]).map(a=>{if(a.selected)return a;let p=a.chatDraftText?.trim();if(p)return e.push(this.chatDraftReply(a,p)),n.push(`${this.choiceTitle(a)}: ${p}`),T(w({},a),{selected:"__chat__",draftSelection:void 0,chatOpen:!1});if(!a.draftSelection)return a;let x=a.options.find(v=>v.id===a.draftSelection);return x&&(e.push(x.reply??x.label),n.push(`${this.choiceTitle(a)}: ${x.label}`)),T(w({},a),{selected:a.draftSelection,draftSelection:void 0})})})),e.length&&(this.inputText.set(e.join(`
9
+ `)}function qi(i){return{id:i.id,role:i.role,text:i.role==="user"?Ii(i.content):i.content,charts:(i.charts??[]).map(t=>{let e=t;return{title:e.title??"Chart",componentName:e.componentName??"",config:t}}),dashboardTitle:i.dashboardTitle??void 0,forecastSpec:i.forecastSpec??void 0,choices:i.choices??void 0,isStreaming:!1,hasError:!1}}var De=class i{alertDrawerOpen=f(!1);alertWidget=f(null);onSetAlert(t){this.alertWidget.set(t),this.alertDrawerOpen.set(!0)}onAlertClosed(){this.alertDrawerOpen.set(!1)}alertSource=D(()=>{let t=gt(this.selectedScope());if(t)return t;let e=this.conversationConnectionId();return e?{connectionId:e}:null});chartDataSourceId(t){return(t?.config??{}).dataSourceId??null}canCreateAlert(t){return!!this.alertSource()||!!this.chartDataSourceId(t)}createAlertFromChart(t){this.canCreateAlert(t)&&(this.isFilterChart(t)||this.onSetAlert(T(w({},this.artifactToWidget(t)),{id:"chat-alert"})))}aqChatEl;builderRef;artifactGridRef;composerRef;aiExecutiveSummaryEl;svc=N(me);tokenStore=N(ae);destroyRef=N(Ft);hostEl=N(Ie);features(){return I().features}widgetMenu(){return I().features.widgetMenu}copy(){return I().copy}showHeader(){return I().ui.header}withCount(t,e){return Xn(t,e)}zone=N(Ot);appRef=N(It);route=N(Zt);router=N(en);dashboardState=N(hn);publishRepo=N(ue);globalWidget=N(Gn);forecastApi=N(Ze);cohort=N(Me);forecastService=N(fn);loading=f(!0);conversations=f([]);activeConversationId=f(null);conversationCustomerId=f(null);conversationConnectionId=f(null);messages=f([]);inputText=f("");isStreaming=f(!1);streamAbort=null;suggestions=f([]);suggestionsLoading=f(!0);suggestionsSeq=0;showConversationPicker=f(!1);showRelatedDashboards=f(!1);loadingConversation=f(!1);editingTitle=f(!1);titleDraft=f("");editingDashboardTitle=f(!1);dashboardTitleDraft=f("");renamingDashboard=f(!1);conversationsLoading=f(!0);dashboardsLoading=f(!0);menuSkeletonRows=[188,142,205];gallerySkeletonRows=[420,300,480,360,260,400];librarySkeletonGroups=[["62%","48%"],["55%","70%"]];libraryChipSkeletonWidths=[58,96,84,78,86,88,100,104,76,88];savingDashboard=f(!1);committingAction=f(null);conversationDashboards=f([]);showAddPicker=f(!1);inlinePickerFor=f(null);inlineChartTypePickerFor=f(null);inlineChartTypeOptions=f([]);inlineChartTypeLoading=f(!1);inlineChartTypePickerSeq=0;inlineChartTypeApplying=f(!1);inlineChartTypeError=f(null);inlineFilterPickerFor=f(null);showScopePicker=f(!1);datasets=f([]);pipelines=f([]);scopeLoading=f(!1);selectedScope=f(null);scopeListsLoaded=!1;saveDialogOpen=f(!1);saveDashboardName=f("");chatPaneTab=f("chat");tabsVisible=D(()=>ti(this.features()));cohortCriteria=f([]);selectedCriterionId=f(null);cohortPreview=f(null);cohortCriteriaLoaded=!1;cohortCriteriaLoading=f(!1);cohortCriteriaError=f(null);cohortPreviewLoading=f(!1);cohortPreviewError=f(null);cohortCriteriaSkeletonRows=[0,1,2,3];cohortMatchSkeletonRows=[0,1,2];cohortMatchesExpanded=f(!1);cohortAllMatches=f(null);cohortMembersLoading=f(!1);cohortMembersError=f(null);static COHORT_MEMBER_LIMIT=100;visibleCohortMatches=D(()=>li(this.cohortPreview(),this.cohortAllMatches(),this.cohortMatchesExpanded()));cohortNamesWithheld=D(()=>yt(this.cohortPreview()));cohortHasMoreMatches=D(()=>ri(this.cohortPreview()));cohortMatchesTruncated=D(()=>si(this.cohortPreview(),this.cohortAllMatches()));cohortMatchesTruncatedNote=D(()=>{let t=this.cohortPreview(),e=this.cohortAllMatches();return!t||!e?"":this.copy().cohortMatchesTruncatedNote.replace("{shown}",String(e.length)).replace("{matchCount}",String(t.matchCount))});cohortMatchSummary=D(()=>{let t=this.cohortPreview();return t?this.copy().cohortMatchSummary.replace("{matchCount}",String(t.matchCount)).replace("{totalCount}",String(t.totalCount)):""});cohortViewAllLabel=D(()=>{let t=this.cohortPreview();return t?this.cohortMatchesExpanded()?this.copy().cohortShowFewerLink:this.copy().cohortViewAllLink.replace("{matchCount}",String(t.matchCount)):""});async loadCohortCriteria(){if(!this.cohortCriteriaLoaded){this.cohortCriteriaLoading.set(!0),this.cohortCriteriaError.set(null);try{this.cohortCriteria.set(await this.cohort.listCriteria()),this.cohortCriteriaLoaded=!0}catch(t){this.cohortCriteriaError.set(bt(t))}finally{this.cohortCriteriaLoading.set(!1)}}}async retryCohortCriteria(){this.cohortCriteriaLoaded=!1,await this.loadCohortCriteria()}async selectCohortCriterion(t){this.selectedCriterionId.set(t),this.cohortPreview.set(null),this.cohortPreviewError.set(null),this.resetCohortMatchExpansion(),this.cohortPreviewLoading.set(!0);try{let e=await this.cohort.previewCriterion(t);if(this.selectedCriterionId()!==t)return;this.cohortPreview.set(e)}catch(e){if(this.selectedCriterionId()!==t)return;this.cohortPreview.set(null),this.cohortPreviewError.set(bt(e))}finally{this.selectedCriterionId()===t&&this.cohortPreviewLoading.set(!1)}}resetCohortMatchExpansion(){this.cohortMatchesExpanded.set(!1),this.cohortAllMatches.set(null),this.cohortMembersError.set(null),this.cohortMembersLoading.set(!1)}async toggleAllCohortMatches(){if(this.cohortMatchesExpanded()){this.cohortMatchesExpanded.set(!1);return}let t=this.selectedCriterionId();if(!(!t||this.cohortMembersLoading())){if(this.cohortAllMatches()){this.cohortMatchesExpanded.set(!0);return}this.cohortMembersError.set(null),this.cohortMembersLoading.set(!0);try{let e=await this.cohort.listMembers(t,i.COHORT_MEMBER_LIMIT);if(this.selectedCriterionId()!==t)return;this.cohortAllMatches.set(e),this.cohortMatchesExpanded.set(!0)}catch(e){if(this.selectedCriterionId()!==t)return;this.cohortMembersError.set(e?.status===403?"forbidden":"failed")}finally{this.selectedCriterionId()===t&&this.cohortMembersLoading.set(!1)}}}addCohortToCanvas(){let t=this.cohortPreview();if(!t||this.activeArtifact().some(o=>{let a=o.config;return(a?.config?._meta?.cohortId??a?._meta?.cohortId)===t.criterionId}))return;this.pushCanvasHistory();let n=ai(t);this.bucketExtraCharts.update(o=>[...o,n]),this.ensureArtifactPaneOpen()}setChatPaneTab(t){ei(t,this.features())&&(this.chatPaneTab.set(t),(t==="library"||t==="tools")&&this.ensureArtifactPaneOpen(),t==="library"&&this.prefetchWidgetTemplateCatalog(),t==="tools"&&this.loadCohortCriteria())}galleryOpen=f(!1);gallerySearch=f("");templateCategories=f([]);templateAllTemplates=f([]);templateCategoriesLoading=f(!1);templateTemplatesLoading=f(!1);templateActiveCategory=f("all");widgetTemplateAllTemplates=f([]);widgetTemplateTemplatesLoading=f(!1);widgetTemplateActiveCategory=f("all");selectWidgetTemplateCategory(t){this.widgetTemplateActiveCategory.set(t)}widgetTemplatePickerSelectedIds=f([]);toggleWidgetTemplateSelection(t){this.widgetTemplatePickerSelectedIds.update(e=>e.includes(t)?e.filter(n=>n!==t):[...e,t])}addSelectedWidgetTemplates(){let t=this.widgetTemplatePickerSelectedIds();t.length&&(this.asOneCanvasStep(()=>{for(let e of t)this.selectWidgetTemplate(e)}),this.widgetTemplatePickerSelectedIds.set([]))}widgetTemplateCountForCategory(t){return this.widgetTemplateAllTemplates().filter(e=>e.category===t).length}librarySearch=f("");libraryKpiChartOptions={exporting:{enabled:!1},credits:{enabled:!1}};brandSparklineColor=f(Fn);readBrandSparklineColor(){this.brandSparklineColor.set(On(this.hostEl.nativeElement))}widgetTemplateCard(t){let e=this.widgetTemplatePreviews(),a=e.get(t.id)?.config?.config?.chart;return{templateId:t.id,title:t.widgetName,desc:t.description,value:a?.value??"\u2014",loading:!e.has(t.id),sparkline:a?.sparkline??[]}}libraryWidgetGroups=D(()=>{let t=this.widgetTemplateActiveCategory(),e=this.librarySearch().trim().toLowerCase();return(t==="all"?this.templateCategories():this.templateCategories().filter(o=>o.key===t)).map(o=>({key:o.key,label:o.label,cards:this.widgetTemplateAllTemplates().filter(a=>a.category===o.key).filter(a=>!e||a.widgetName.toLowerCase().includes(e)||(a.description??"").toLowerCase().includes(e)).map(a=>this.widgetTemplateCard(a))})).filter(o=>o.cards.length>0)});isGroupFullySelected(t){let e=this.widgetTemplatePickerSelectedIds();return t.length>0&&t.every(n=>e.includes(n.templateId))}toggleLibraryGroupSelection(t){let e=t.map(o=>o.templateId),n=this.isGroupFullySelected(t);this.widgetTemplatePickerSelectedIds.update(o=>{let a=new Set(o);return n?e.forEach(p=>a.delete(p)):e.forEach(p=>a.add(p)),[...a]})}openWidgetDetailFromCard(t){let e=this.widgetTemplatePreviews().get(t);if(!e)return;let n=T(w({},this.artifactToWidget(e)),{id:`kpi-gallery-${t}`});this.openWidgetDetailPanelForWidget(n,!0)}runViewTransition(t,e="forward"){let n=document,o=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;if(typeof n.startViewTransition!="function"||o){t();return}let a=document.documentElement;e==="back"&&(a.dataset.vtDirection="back");let p=()=>delete a.dataset.vtDirection;n.startViewTransition(()=>{t(),this.appRef.tick()})?.finished?.then(p,p)??p()}artifactPickerTab=f("kpis");templateCountForCategory(t){return this.templateAllTemplates().filter(e=>e.category===t).length}libraryDashboardGroups=D(()=>{let t=this.templateActiveCategory(),e=this.librarySearch().trim().toLowerCase();return(t==="all"?this.templateCategories():this.templateCategories().filter(o=>o.key===t)).map(o=>({key:o.key,label:o.label,templates:this.templateAllTemplates().filter(a=>a.category===o.key).filter(a=>!e||a.name.toLowerCase().includes(e)||(a.description??"").toLowerCase().includes(e))})).filter(o=>o.templates.length>0)});widgetTemplatePreviews=f(new Map);widgetTemplateSourceId=f(null);widgetDetailPanelOpen=f(!1);widgetDetailPanelLoading=f(!1);widgetDetailPanelTitle=f(null);widgetDetailPanelRaw=f([]);widgetDetailPanelTemplateId=f(null);widgetDetailPanelCanAdd=f(!1);widgetDetailPanelKind=f("widget");widgetDetailPanelSourceWidgetTitle=f(null);detailPanelWidgetCrumb=D(()=>this.widgetDetailPanelKind()==="widget"?this.widgetDetailPanelSourceWidgetTitle():null);detailPanelLastCrumb=D(()=>{let t=this.widgetDetailPanelTitle();return t?t===this.detailPanelWidgetCrumb()?this.copy().detailCrumbLabel:t:null});widgetDetailPanelSelectedIds=f([]);widgetDetailPanelSourceTemplateId=f(null);detailPanelCohortId=f(null);detailPanelCohortData=f(null);cohortDetailCaption=D(()=>{let t=this.copy().cohortDetailCaption,e=this.detailPanelCohortData()?.detail?.scan;if(!e)return t;let n=this.copy().cohortDetailCoverage.replace("{events}",String(e.events)).replace("{systems}",String(e.systems));return`${t} \xB7 ${n}`});widgetDetailPanelSkeletonSlots=f([]);widgetDetailPanelSkeletonHeight=D(()=>{let t=this.widgetDetailPanelSkeletonSlots();return t.length?Math.max(...t.map(e=>(e.y+e.h)*72)):0});widgetDetailPanelWidgets=D(()=>{let t=this.widgetDetailPanelRaw().map((e,n)=>T(w({},this.artifactToWidget(e)),{id:`detail-panel-${n}`}));return dt(t)});filteredGalleryPrompts=D(()=>{let t=this.gallerySearch().trim().toLowerCase(),e=this.suggestions();return t?e.filter(n=>n.toLowerCase().includes(t)):e});welcomePromptCards=D(()=>{let t=this.forecastContext();return this.suggestions().slice(0,fc).map(e=>(I().features.forecast&&t?!!wt(e,t):!1)?{label:e,icon:"ng-stars-02",badge:"FORECAST",tone:"ai"}:{label:e,icon:"ng-lightbulb-05",tone:"plain"})});galleryPromptItems=D(()=>this.filteredGalleryPrompts().map(t=>({key:t,label:t,icon:"ng-lightbulb-05"})));artifactSourceMsgId=f(null);activeArtifactRaw=f([]);artifactForcedOpen=f(!1);templateSourceId=f(null);bucketExtraCharts=f([]);activeArtifact=D(()=>{let t=this.artifactSourceMsgId(),e=t?this.messages().find(o=>o.id===t)?.charts??this.activeArtifactRaw():this.activeArtifactRaw(),n=this.bucketExtraCharts();return n.length?[...e,...n]:e});artifactOpen=D(()=>this.artifactForcedOpen()||this.activeArtifact().length>0);dslOnlyArtifact=f(!1);CANVAS_HISTORY_LIMIT=25;canvasUndoStack=f([]);canvasRedoStack=f([]);canUndoCanvas=D(()=>this.canvasUndoStack().length>0);canRedoCanvas=D(()=>this.canvasRedoStack().length>0);canvasHistorySuspended=!1;snapshotCanvas(){return{base:[...this.activeArtifactRaw()],extras:[...this.bucketExtraCharts()],sourceMsgId:this.artifactSourceMsgId(),templateSourceId:this.templateSourceId(),widgetTemplateSourceId:this.widgetTemplateSourceId(),saveName:this.saveDashboardName()}}restoreCanvas(t){this.artifactSourceMsgId.set(t.sourceMsgId),this.activeArtifactRaw.set(t.base),this.bucketExtraCharts.set(t.extras),this.templateSourceId.set(t.templateSourceId),this.widgetTemplateSourceId.set(t.widgetTemplateSourceId),this.saveDashboardName.set(t.saveName),this.selectedWidgetIds.set([]),this.ensureArtifactPaneOpen()}pushCanvasHistory(){this.canvasHistorySuspended||(this.canvasUndoStack.update(t=>[...t,this.snapshotCanvas()].slice(-this.CANVAS_HISTORY_LIMIT)),this.canvasRedoStack.set([]))}asOneCanvasStep(t){this.pushCanvasHistory(),this.canvasHistorySuspended=!0;try{t()}finally{this.canvasHistorySuspended=!1}}undoCanvas(){let t=this.canvasUndoStack();t.length&&(this.canvasRedoStack.update(e=>[...e,this.snapshotCanvas()].slice(-this.CANVAS_HISTORY_LIMIT)),this.canvasUndoStack.set(t.slice(0,-1)),this.restoreCanvas(t[t.length-1]))}redoCanvas(){let t=this.canvasRedoStack();t.length&&(this.canvasUndoStack.update(e=>[...e,this.snapshotCanvas()].slice(-this.CANVAS_HISTORY_LIMIT)),this.canvasRedoStack.set(t.slice(0,-1)),this.restoreCanvas(t[t.length-1]))}ensureArtifactPaneOpen(){this.artifactForcedOpen()||this.artifactForcedOpen.set(!0)}artifactTitle=D(()=>{let t=this.mostRecentDashboardTitle();return t||(this.activeArtifact().find(n=>!this.isFilterChart(n))?.title??this.activeArtifact()[0]?.title??"Untitled canvas")});artifactSubtitle=D(()=>{let t=this.activeArtifact().filter(e=>!this.isFilterChart(e)).length;return`${this.artifactTitle()} \xB7 ${t} widget${t===1?"":"s"}`});isFilterChart(t){if(!t)return!1;let e=t.config??{};return Ne({componentName:(e.componentName??t.componentName??"").toLowerCase(),config:e.config??e})}mostRecentDashboardTitle(){let t=this.artifactSourceMsgId();if(!t)return;let e=this.messages(),n=e.findIndex(o=>o.id===t);for(let o=n;o>=0;o--)if(e[o]?.dashboardTitle)return e[o].dashboardTitle}baseArtifactWidgets=D(()=>{let t=this.artifactSourceMsgId()??"artifact",e=this.activeArtifact().map((o,a)=>T(w({},this.artifactToWidget(o)),{id:`${t}-${a}`})),n=dt(e);return mn(n)});filterOverlay=f(new Map);forecastOverlay=f(new Map);artifactForecastable=f({});artifactForecastingId=f(null);artifactWidgets=D(()=>{let t=this.baseArtifactWidgets(),e=this.filterOverlay(),n=this.forecastOverlay();return!e.size&&!n.size?t:t.map(o=>{let a=e.get(o.id),p=a?T(w({},o),{config:a.config,edited:a.edited}):o,x=n.get(o.id);return x?T(w({},p),{config:x}):p})});async onArtifactForecast(t){let e=String(t.widget.id);if(!this.artifactForecastingId()){if(!t.enable){this.forecastOverlay.update(n=>{let o=new Map(n);return o.delete(e),o});return}this.artifactForecastingId.set(e);try{let n=await this.forecastService.forecastWidget(t.widget);if(n?.guardrails&&n.guardrails.passed===!1)return;n?.widget?.config&&this.forecastOverlay.update(o=>new Map(o).set(e,n.widget.config))}catch{}finally{this.artifactForecastingId.set(null)}}}async loadArtifactForecastable(){let t=this.baseArtifactWidgets();if(!t.length){this.artifactForecastable.set({});return}this.artifactForecastable.set(await this.forecastService.probeWidgets(t))}applyingFilters=f(!1);activeDashboardFilters=f(null);activeResolvedFilters=f(null);applySummary=f(null);filterExplanation=f(null);applyFiltersSeq=0;applyFiltersAbort=null;filterSuggestCache=new Map;filterSuggestInflight=new Set;selectedWidgetIds=f([]);hasSelection=D(()=>this.features().canvas.widgetSelection?this.selectedWidgetIds().length>0:this.artifactWidgets().length>0);selectedArtifactCharts=D(()=>{if(!this.features().canvas.widgetSelection)return this.activeArtifact();let t=new Set(this.selectedWidgetIds()),e=this.artifactWidgets();return this.activeArtifact().filter((n,o)=>t.has(e[o]?.id))});artifactFooterHasActions=D(()=>{let t=this.features().canvas;return t.publishAsDashboard||t.addToDashboard||!!this.artifactForecastMsg()});builderOpen=f(!1);detailRootCrumb=D(()=>this.builderOpen()?this.builderRef?.dashboardName?.()?.trim()||this.copy().detailDashboardCrumbLabel:this.copy().detailCanvasCrumbLabel);builderDashboardId=f(null);builderPreseeded=f(!1);builderFullscreen=f(!1);chatPaneWidth=f(null);isResizing=f(!1);layoutMode=D(()=>Zn({hasMessages:this.messages().length>0,artifactOpen:this.artifactOpen()&&!this.dslOnlyArtifact(),builderOpen:this.builderOpen()}));chatPaneStyleWidth=D(()=>{if(this.builderFullscreen())return null;let t=this.layoutMode();return t==="split"||t==="builder"?this.chatPaneWidth():null});customerId=()=>{let t=this.tokenStore.tenantId();return I().customerId??t??""};attachments=f([]);uploadsInFlight=D(()=>this.attachments().some(t=>t.status==="uploading"));excelCount=D(()=>this.attachments().filter(t=>ft(t.name,t.contentType)).length);nonExcelCount=D(()=>this.attachments().length-this.excelCount());attachAtCapacity=D(()=>this.nonExcelCount()>=ht&&this.excelCount()>=Ct);acceptUploadTypes=[...mt,".xls",".xlsx"].join(",");dragDepth=0;isDraggingFile=f(!1);canSend=D(()=>{let t=this.inputText().trim().length>0,e=this.attachments().some(n=>n.status==="ready");return(t||e)&&!this.isStreaming()&&!this.uploadsInFlight()});quoteBadge=f(null);replyQuote=f(null);activeConversation=D(()=>this.conversations().find(t=>t.id===this.activeConversationId())??null);forecastTitle=f(null);activeConversationTitle=D(()=>this.activeConversation()?.title??this.forecastTitle()??"New conversation");static FALLBACK_PROMPTS=["Give me a dashboard overview of my workforce","Show headcount breakdown by department","What are the top metrics I should be tracking?","Analyze trends over the last quarter","Show me employee distribution by location"];constructor(){he(()=>{let t=this.customerId(),e=this.selectedScope();if(!t)return;let n=e?e.id:null,o=e?.kind==="pipeline",a=++this.suggestionsSeq;this.suggestionsLoading.set(!0),this.svc.getSuggestedPrompts(n,o).then(p=>{if(a!==this.suggestionsSeq)return;let x=[...p.widgetSuggestions??[],...p.conversationStarters??[]];this.suggestions.set(x.length?x:i.FALLBACK_PROMPTS)}).catch(()=>{a===this.suggestionsSeq&&this.suggestions.set(i.FALLBACK_PROMPTS)}).finally(()=>{a===this.suggestionsSeq&&this.suggestionsLoading.set(!1)})}),this.forecastApi.context().then(t=>this.forecastContext.set(t)),he(()=>{let t=this.customerId();t&&$t(()=>{let e=this.conversationCustomerId();!e||e===t||this.resetForTenantChange()})})}resetForTenantChange(){this.activeConversationId.set(null),this.conversationCustomerId.set(null),this.conversationConnectionId.set(null),this.messages.set([]),this.conversations.set([]),this.closeArtifact(),this.builderOpen.set(!1),this.builderPreseeded.set(!1),this.builderDashboardId.set(null),this.conversationsLoading.set(!0),this.svc.listConversations().then(t=>this.conversations.set(t)).catch(()=>this.conversations.set([])).finally(()=>this.conversationsLoading.set(!1)),this.loadConversationDashboards()}async ngOnInit(){this.destroyRef.onDestroy(cn(()=>this.readBrandSparklineColor())),this.readBrandSparklineColor();try{this.conversationsLoading.set(!0);let o=await this.svc.listConversations().catch(()=>[]);this.conversations.set(o)}finally{this.conversationsLoading.set(!1),this.loading.set(!1)}this.loadConversationDashboards(),this.prefetchTemplateCatalog();let t=I().initial,e=this.route.snapshot.queryParamMap.get("summary")==="1",n=t.dashboardId??this.route.snapshot.paramMap.get("id");n&&(this.builderPreseeded.set(!1),this.builderDashboardId.set(n),this.builderOpen.set(!0),t.summary||e?this.onExecutiveSummary(n).then(()=>{e&&this.router.navigate([],{relativeTo:this.route,queryParams:{},replaceUrl:!0})}):this.restoreThreadForDashboard(n))}async restoreThreadForDashboard(t){try{let e=null;if(e=(await this.svc.getDashboard(t).catch(()=>null))?.conversationId??null,e||(e=(await this.svc.listDashboards(100).catch(()=>[])).find(p=>p.id===t)?.conversationId??null),!e)return;let o=await this.svc.getConversation(e);if(!o)return;this.activeConversationId.set(e),this.conversationCustomerId.set(this.customerId()),this.conversationConnectionId.set(o.conversation.connectionId??null),this.messages.set(o.messages.map(qi)),this.loadConversationDashboards(),this.scrollToBottom()}catch{}}streamSpeed=[6,18];openScopeMenu(){let t=!this.showScopePicker();this.showScopePicker.set(t),t&&this.loadScopeLists()}async loadScopeLists(){if(!this.scopeListsLoaded){this.scopeListsLoaded=!0,this.scopeLoading.set(!0);try{let[t,e]=await Promise.allSettled([this.svc.listDatasets(),this.svc.listPipelines()]);t.status==="fulfilled"&&this.datasets.set(t.value),e.status==="fulfilled"&&this.pipelines.set(e.value),[t,e].filter(o=>o.status==="rejected").length>0&&(this.scopeListsLoaded=!1)}finally{this.scopeLoading.set(!1)}}}selectScope(t,e){this.selectedScope.set({kind:t,id:e.id,name:e.name}),this.showScopePicker.set(!1)}clearScope(){this.selectedScope.set(null)}dashboardSource(){return gt(this.selectedScope())??{}}closeScopeMenu(){this.showScopePicker.set(!1)}async selectConversation(t,e=!1){if(this.showConversationPicker.set(!1),!(t===this.activeConversationId()&&!e)){this.loading.set(!0),this.loadingConversation.set(!0);try{let n=await this.svc.getConversation(t);if(!n)return;this.activeConversationId.set(t),this.conversationCustomerId.set(this.customerId()),this.conversationConnectionId.set(n.conversation.connectionId??null),this.messages.set(n.messages.map(qi)),this.loadConversationDashboards(),this.scrollToBottom()}catch{}finally{this.loading.set(!1),this.loadingConversation.set(!1)}}}async deleteConversation(t,e){t.stopPropagation();try{await this.svc.deleteConversation(e),this.conversations.update(n=>n.filter(o=>o.id!==e)),this.activeConversationId()===e&&(this.activeConversationId.set(null),this.conversationCustomerId.set(null),this.conversationConnectionId.set(null),this.messages.set([]))}catch{}}newConversation(){this.forecastTitle.set(null),this.closeForecastSettings(),this.appliedForecastSettings.set(null),this.activeConversationId.set(null),this.conversationCustomerId.set(null),this.conversationConnectionId.set(null),this.messages.set([]),this.showConversationPicker.set(!1)}openRelatedDashboard(t){this.showRelatedDashboards.set(!1),this.closeArtifact(),this.builderPreseeded.set(!1),this.builderDashboardId.set(t),this.builderOpen.set(!0)}async openNewDashboard(){if(!this.savingDashboard()){this.showRelatedDashboards.set(!1),this.savingDashboard.set(!0);try{let t="Untitled Dashboard";this.closeArtifact(),this.dashboardState.resetDashboard(),this.dashboardState.setDashboardName(t);let e=await this.svc.createDashboard(T(w({name:t,conversationId:this.activeConversationId()??void 0},this.dashboardSource()),{widgets:[]}));this.dashboardState.setDashboardId(e.id),this.builderPreseeded.set(!0),this.builderDashboardId.set(e.id),this.builderOpen.set(!0)}catch{}finally{this.savingDashboard.set(!1)}}}convSearch=f("");dashSearch=f("");renamingId=f(null);renameDraft=f("");static BUCKETS=[{key:"today",maxDays:0},{key:"yesterday",maxDays:1},{key:"week",maxDays:7},{key:"older",maxDays:1/0}];daysAgo(t){if(!t)return 1/0;let e=new Date(t);if(Number.isNaN(e.getTime()))return 1/0;let n=new Date;n.setHours(0,0,0,0);let o=new Date(e);return o.setHours(0,0,0,0),Math.round((n.getTime()-o.getTime())/864e5)}relativeStamp(t){if(!t)return"";let e=new Date(t);return Number.isNaN(e.getTime())?"":this.daysAgo(t)===0?e.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}):e.toLocaleDateString(void 0,{month:"short",day:"numeric"})}bucketLabel(t){let e=this.copy();return t==="today"?e.groupToday:t==="yesterday"?e.groupYesterday:t==="week"?e.groupPrevious7Days:e.groupOlder}groupByRecency(t,e){let n=[],o=[...t].sort((a,p)=>new Date(e(p)??0).getTime()-new Date(e(a)??0).getTime());for(let a of i.BUCKETS){let p=o.filter(x=>this.daysAgo(e(x))<=a.maxDays);if(p.length&&n.push({key:a.key,label:this.bucketLabel(a.key),items:p}),o=o.filter(x=>this.daysAgo(e(x))>a.maxDays),!o.length)break}return n}matches(t,e){return e?(t??"").toLowerCase().includes(e.toLowerCase()):!0}groupedConversations=D(()=>this.groupByRecency(this.conversations().filter(t=>this.matches(t.title,this.convSearch())),t=>t.updatedAt));groupedDashboards=D(()=>this.groupByRecency(this.conversationDashboards().filter(t=>this.matches(t.name,this.dashSearch())),t=>t.updatedAt));pickerSearch=f("");groupedPickerDashboards=D(()=>this.groupByRecency(this.conversationDashboards().filter(t=>this.matches(t.name,this.pickerSearch())),t=>t.updatedAt));pickerSearchEmpty=D(()=>!!this.pickerSearch()&&this.groupedPickerDashboards().length===0);convSearchEmpty=D(()=>!!this.convSearch()&&this.groupedConversations().length===0);dashSearchEmpty=D(()=>!!this.dashSearch()&&this.groupedDashboards().length===0);countClause(t,e){return typeof t!="number"||!Number.isFinite(t)?"":`${t} ${e}${t===1?"":"s"}`}conversationMeta(t){let e=this.relativeStamp(t.lastMessageAt??t.updatedAt);return[this.countClause(t.messageCount,"message"),e].filter(Boolean).join(" \xB7 ")}dashboardMeta(t){let e=this.relativeStamp(t.updatedAt);return[this.countClause(t.widgetCount,"widget"),e].filter(Boolean).join(" \xB7 ")}startRename(t,e,n){t.stopPropagation(),this.renamingId.set(e),this.renameDraft.set(n??"")}cancelRename(t){t?.stopPropagation(),this.renamingId.set(null)}async commitRenameConversation(t,e){t.stopPropagation();let n=this.renameDraft().trim();if(this.renamingId.set(null),!(!n||n===e.title))try{await this.svc.updateConversation(e.id,{title:n}),this.conversations.update(o=>o.map(a=>a.id===e.id?T(w({},a),{title:n}):a))}catch{}}async commitRenameDashboard(t,e){t.stopPropagation();let n=this.renameDraft().trim();if(this.renamingId.set(null),!(!n||n===e.name))try{await this.svc.updateDashboard(e.id,{name:n}),this.conversationDashboards.update(o=>o.map(a=>a.id===e.id?T(w({},a),{name:n}):a))}catch{}}async deleteDashboardFromMenu(t,e){t.stopPropagation();try{await this.svc.deleteDashboard(e),this.conversationDashboards.update(n=>n.filter(o=>o.id!==e)),this.builderDashboardId()===e&&this.builderOpen.set(!1)}catch{}}startEditTitle(){this.activeConversationId()&&(this.titleDraft.set(this.activeConversationTitle()),this.editingTitle.set(!0))}cancelEditTitle(){this.editingTitle.set(!1)}async commitTitle(){if(!this.editingTitle())return;this.editingTitle.set(!1);let t=this.activeConversationId(),e=this.titleDraft().trim();if(!(!t||!e||e===this.activeConversationTitle()))try{await this.svc.updateConversation(t,{title:e}),this.conversations.update(n=>n.map(o=>o.id===t?T(w({},o),{title:e}):o))}catch{}}onFilesPicked(t){let e=t.target,n=Array.from(e.files??[]);e.value="";for(let o of n)this.startUpload(o)}onComposerDragOver(t){this.attachAtCapacity()||this.isStreaming()||(t.preventDefault(),t.dataTransfer&&(t.dataTransfer.dropEffect="copy"))}onComposerDragEnter(t){this.attachAtCapacity()||this.isStreaming()||t.dataTransfer?.types.includes("Files")&&(t.preventDefault(),this.dragDepth++,this.isDraggingFile.set(!0))}onComposerDragLeave(t){t.preventDefault(),this.dragDepth=Math.max(0,this.dragDepth-1),this.dragDepth===0&&this.isDraggingFile.set(!1)}onComposerDrop(t){if(t.preventDefault(),this.dragDepth=0,this.isDraggingFile.set(!1),this.attachAtCapacity()||this.isStreaming())return;let e=Array.from(t.dataTransfer?.files??[]);for(let n of e)this.startUpload(n)}startUpload(t){let e=ft(t.name,t.type);if(e&&this.excelCount()>=Ct||!e&&this.nonExcelCount()>=ht||!e&&!mt.includes(t.type)||t.size>Jn||this.attachments().some(x=>x.name===t.name&&x.size===t.size&&x.file?.lastModified===t.lastModified))return;let o=ve(),a=new AbortController,p={id:o,name:t.name,contentType:t.type,size:t.size,status:"uploading",progress:0,file:t,abort:a};this.attachments.update(x=>[...x,p]),this.runUpload(o,t,a)}async runUpload(t,e,n){try{let{key:o}=await this.svc.uploadAttachment(e,{signal:n.signal});this.patchAttachment(t,{status:"ready",key:o,progress:100})}catch(o){if(n.signal.aborted)return;console.error("[ask-aquera] attachment upload failed",o),this.patchAttachment(t,{status:"error"})}}patchAttachment(t,e){this.attachments.update(n=>n.map(o=>o.id===t?w(w({},o),e):o))}removeAttachment(t){this.attachments().find(e=>e.id===t)?.abort?.abort(),this.attachments.update(e=>e.filter(n=>n.id!==t))}retryAttachment(t){let e=this.attachments().find(o=>o.id===t);if(!e?.file)return;let n=new AbortController;this.patchAttachment(t,{status:"uploading",progress:0,abort:n}),this.runUpload(t,e.file,n)}isMultiChoice(t){return(t.choices?.length??0)>1}onChoiceChange(t,e,n){if(!n||e.selected||this.isStreaming())return;let o=e.options.find(a=>a.id===n);o&&(this.isMultiChoice(t)?this.updateAssistantMsg(t.id,a=>({choices:(a.choices??[]).map(p=>p===e?T(w({},p),{draftSelection:o.id,chatOpen:!1,chatDraftText:void 0}):p)})):this.selectChoice(t,e,o))}selectChoice(t,e,n){e.selected||this.isStreaming()||(this.updateAssistantMsg(t.id,o=>({choices:(o.choices??[]).map(a=>a===e?T(w({},a),{selected:n.id,draftSelection:void 0,chatOpen:!1,chatDraftText:void 0}):a)})),this.pendingDisplayOverride=`${this.choiceTitle(e)}: ${n.label}`,this.inputText.set(n.reply??n.label),this.sendMessage())}hasPendingDraft(t){return!!t.choices?.some(e=>!e.selected&&(e.draftSelection||e.chatDraftText?.trim()))}submitChoices(t){if(this.isStreaming())return;let e=[],n=[];this.updateAssistantMsg(t.id,o=>({choices:(o.choices??[]).map(a=>{if(a.selected)return a;let p=a.chatDraftText?.trim();if(p)return e.push(this.chatDraftReply(a,p)),n.push(`${this.choiceTitle(a)}: ${p}`),T(w({},a),{selected:"__chat__",draftSelection:void 0,chatOpen:!1});if(!a.draftSelection)return a;let x=a.options.find(v=>v.id===a.draftSelection);return x&&(e.push(x.reply??x.label),n.push(`${this.choiceTitle(a)}: ${x.label}`)),T(w({},a),{selected:a.draftSelection,draftSelection:void 0})})})),e.length&&(this.inputText.set(e.join(`
10
10
  `)),this.pendingDisplayOverride=n.join(`
11
11
  `),this.sendMessage())}answerSummaryRows(t){return(t.text??"").split(`
12
- `).map(e=>{let n=e.indexOf(": ");return n===-1?{title:e,answer:""}:{title:e.slice(0,n),answer:e.slice(n+2)}})}choiceTitle(t){let e=t.prompt??"",n=/—\s*(.+)$/.exec(e);return(n?n[1].trim():e)||"Answer"}subjectIdOf(t){let e=t.options[0]?.id??"";return e.includes("::")?e.slice(0,e.lastIndexOf("::")):e}chatDraftReply(t,e){return t.kind==="widget_clarification"||t.kind==="widget_plan"||t.kind==="plan_intake"?`For "${this.subjectIdOf(t)}": ${e}`:e}requestPlan(t,e){e.selected||this.isStreaming()||(this.updateAssistantMsg(t.id,n=>({choices:(n.choices??[]).map(o=>o===e?T(w({},o),{selected:"__plan__"}):o)})),this.inputText.set("Give me the plan"),this.sendMessage())}previewWidget(t,e){e.selected||this.isStreaming()||(this.pendingDisplayOverride=`Preview "${this.choiceTitle(e)}"`,this.inputText.set(`For "${this.subjectIdOf(e)}": Preview this widget`),this.sendMessage())}isPreviewChart(t){return!!t?.config?.preview&&!!t?.config?.previewOf}previewAltLabel(t){return t?.config?.previewAltLabel??null}replyForPreview(t,e){if(this.isStreaming())return;let n=t?.config?.previewOf;n&&(this.inputText.set(`For "${n}": ${e}`),this.sendMessage())}acceptPreview(t){this.replyForPreview(t,"Use this")}tryAlternatePreview(t){let e=this.previewAltLabel(t);e&&this.replyForPreview(t,e)}skipPreview(t){this.replyForPreview(t,"Skip this widget")}openChatDraft(t,e){this.isStreaming()||e.selected||this.updateAssistantMsg(t.id,n=>({choices:(n.choices??[]).map(o=>o===e?T(w({},o),{chatOpen:!0,draftSelection:void 0}):o)}))}onChatDraftTextChange(t,e,n){this.updateAssistantMsg(t.id,o=>({choices:(o.choices??[]).map(a=>a===e?T(w({},a),{chatDraftText:n}):a)}))}defineChatDraft(t,e){let n=e.chatDraftText?.trim();if(!(!n||this.isStreaming())){if(this.isMultiChoice(t)){this.updateAssistantMsg(t.id,o=>({choices:(o.choices??[]).map(a=>a===e?T(w({},a),{chatOpen:!1}):a)}));return}this.updateAssistantMsg(t.id,o=>({choices:(o.choices??[]).map(a=>a===e?T(w({},a),{selected:"__chat__",chatOpen:!1}):a)})),this.inputText.set(this.chatDraftReply(e,n)),this.sendMessage()}}choicePanelIndex=new Map;dismissedChoicePanels=new Set;nonPanelChoices(t){return this.isMultiChoice(t)?[]:t.choices??[]}panelAnsweredCount(t){return t.filter(e=>!!e.selected||!!e.draftSelection||!!e.chatDraftText?.trim()).length}isChoicePanelComplete(t){return t.every(e=>!!e.selected)}choicePanelIndexFor(t,e){return this.choicePanelIndex.has(t.id)||this.choicePanelIndex.set(t.id,this.panelAnsweredCount(e)),Math.min(this.choicePanelIndex.get(t.id),e.length)}activeChoicePanel(){let t=this.messages();for(let e=t.length-1;e>=0;e--){let n=t[e];if(!this.isMultiChoice(n))continue;let o=n.choices;if(!this.isChoicePanelComplete(o)&&!this.dismissedChoicePanels.has(n.id))return{msg:n,choices:o,index:this.choicePanelIndexFor(n,o)}}return null}panelBadgeLabel(t){switch(t.kind){case"plan_intake":return"SETUP";case"widget_clarification":case"clarification":return"CLARIFY";default:return null}}chatDraftPlaceholderFor(t){switch(t.kind){case"widget_clarification":return this.copy().chatDraftPlaceholderWidget;case"widget_plan":return this.copy().chatDraftPlaceholderPlan;case"plan_intake":return this.copy().chatDraftPlaceholderIntake;default:return this.copy().chatDraftPlaceholderClarification}}panelAnswerLabel(t){let e=t.chatDraftText?.trim();if(e)return e;let n=t.draftSelection??t.selected,o=t.options.find(a=>a.id===n);return o?o.label==="Use this"?"Recommended":o.label:"Skipped"}optionPrimaryText(t){return t.label==="Use this"&&t.hint?t.hint:t.label}optionBadgeText(t){return t.label==="Use this"&&t.hint?"Recommended":null}advanceChoicePanel(t){let e=this.choicePanelIndex.get(t.id)??0;this.choicePanelIndex.set(t.id,e+1)}onPanelChatDraftConfirm(t,e){!e.chatDraftText?.trim()||this.isStreaming()||(this.defineChatDraft(t,e),this.advanceChoicePanel(t))}onPanelSkip(t){this.isStreaming()||this.advanceChoicePanel(t)}onPanelPrev(t){let e=this.choicePanelIndex.get(t.id)??0;e>0&&this.choicePanelIndex.set(t.id,e-1)}dismissChoicePanel(t){this.dismissedChoicePanels.add(t.id)}resumeChoicePanel(t){this.dismissedChoicePanels.delete(t.id)}isChoicePanelDismissed(t){return this.dismissedChoicePanels.has(t.id)}static TEXT_REDUNDANT_CHOICE_KINDS=new Set(["index","clarification","widget_clarification"]);suppressTextFor(t){let e=t.choices;return!!e?.length&&e.every(n=>!!n.kind&&i.TEXT_REDUNDANT_CHOICE_KINDS.has(n.kind))}onThreadMouseUp(t){let e=t.composedPath();if(e.some(S=>S instanceof HTMLElement&&S.classList.contains("reply-badge")))return;let n=document.getSelection(),o=n?.toString().trim()??"",a=e.some(S=>S instanceof HTMLElement&&S.classList.contains("assistant-text"));if(!n||!o||!a){this.quoteBadge.set(null);return}let p=46,x=Math.min(Math.max(t.clientX,p+8),window.innerWidth-p-8),A=t.clientY>=34;this.quoteBadge.set({text:o,top:t.clientY,left:x,above:A})}onTextSelectionChange(){if(!this.quoteBadge())return;let t=document.getSelection();(!t||!t.toString().trim())&&this.quoteBadge.set(null)}hideQuoteBadge(){this.quoteBadge.set(null)}addReplyQuote(){let t=this.quoteBadge();t&&(this.replyQuote.set(t.text),this.quoteBadge.set(null),document.getSelection()?.removeAllRanges(),this.composerRef?.nativeElement?.focus?.())}clearReplyQuote(){this.replyQuote.set(null)}forecastContext=f(null);lastForecastRequest=null;forecastChartMsgId=null;forecastTurnMsgId=null;routeForecastIntent(t){let e=this.forecastContext();if(!e)return!1;let n=I().features.forecast?wt(t,e):null;if(!n)return!1;let o=n.extendsExisting?this.findForecastTarget():null;return n.extendsExisting&&!o||!o?!1:this.forecastChartMessage(o,t,{metric:n.metric,horizon:n.horizon,granularity:n.granularity})}forecastChartMessage(t,e,n={}){let o=this.forecastContext();if(!o)return!1;let a=Ci(t.charts[0]?.config);if(!a.length)return!1;let p={metric:n.metric??o.metrics[0]?.id??"headcount",horizon:n.horizon??o.defaults.horizon,granularity:n.granularity??o.defaults.granularity,confidence:o.defaults.confidence,series:a,sourceGranularity:o.defaults.granularity},x=t.charts[0]?.config??{};return this.runForecast(e,p,{queryMeta:x.queryMeta,dataSourceId:x.dataSourceId},{chartMsgId:t.id}),!0}forecastableMsgs=new Map;canForecastChart(t){if(!this.forecastContext())return!1;let e=this.forecastableMsgs.get(t.id);if(e!==void 0)return e;let n=Tt(t);return t.isStreaming||this.forecastableMsgs.set(t.id,n),n}artifactForecastMsg=D(()=>{let t=this.artifactSourceMsgId();if(!t||!this.forecastContext())return null;let e=this.messages().find(n=>n.id===t);return e&&Tt(e)?e:null});isRestoredForecast(t){return!!t.forecastSpec&&!t.charts.length&&!t.forecastRecomputing}restoredForecastLabel(t){let e=t.forecastSpec;if(!e)return"";let o={Weekly:"weeks",Monthly:"months",Quarterly:"quarters",Yearly:"years"}[e.granularity]??"periods",a=e.computedAt?new Date(e.computedAt).toLocaleDateString(void 0,{day:"numeric",month:"short",year:"numeric"}):null;return`${e.horizon} ${o} ahead at ${e.confidence}% confidence`+(a?` \xB7 computed ${a}`:"")}recomputeStoredForecast(t){let e=t.forecastSpec;if(!e||this.isStreaming())return;let n=this.findForecastTarget();n&&this.forecastChartMessage(n,`Forecast ${e.horizon} ${e.granularity.toLowerCase()} periods ahead`,{metric:e.metric,horizon:e.horizon,granularity:e.granularity})}canRemoveForecast(t){return!!t.forecast&&!!t.preForecastCharts?.length&&!t.forecastRecomputing}removeForecastFromChart(t){this.canRemoveForecast(t)&&(this.updateAssistantMsg(t.id,{charts:t.preForecastCharts??[],preForecastCharts:void 0,forecast:!1,forecastMeta:void 0}),this.forecastChartMsgId===t.id&&(this.forecastTurnMsgId&&this.updateAssistantMsg(this.forecastTurnMsgId,{followUps:[]}),this.forecastChartMsgId=null,this.forecastTurnMsgId=null,this.lastForecastRequest=null,this.forecastSettingsOpen.set(!1),this.appliedForecastSettings.set(null)))}forecastFromChart(t){this.isStreaming()||this.forecastChartMessage(t,"Forecast this chart")}findForecastTarget(){let t=this.messages();for(let e=t.length-1;e>=0;e--){let n=t[e];if(!(n.role!=="assistant"||n.charts.length!==1)&&tt(n.charts[0].config))return n}return null}async recomputeForecastInPlace(t,e,n){this.isStreaming.set(!0),this.updateAssistantMsg(t,{forecastRecomputing:!0,hasError:!1});try{let o=await this.forecastApi.compute(e),a=St(o,e.series??[]);this.lastForecastRequest=T(w({},e),{horizon:a.horizon,granularity:a.granularity,confidence:a.confidence}),this.appliedForecastSettings.set({horizon:a.horizon,granularity:a.granularity,confidence:a.confidence}),this.forecastMaxHorizon.set(a.maxHorizon),this.forecastFitted.set({periods:o.fittedPeriods,granularity:o.sourceGranularity}),this.forecastGuardrails.set(o.guardrails),this.forecastModelCard.set(o.modelCard),n.queryMeta&&(a.chart.queryMeta=n.queryMeta),n.dataSourceId&&(a.chart.dataSourceId=n.dataSourceId),a.chart.config&&(a.chart.config.forecast={enabled:!0,horizon:a.horizon,granularity:a.granularity,confidence:a.confidence}),this.updateAssistantMsg(t,{forecastRecomputing:!1,charts:[{title:a.chart.title,componentName:a.chart.componentName,config:a.chart}],forecastMeta:a.meta}),this.forecastTurnMsgId&&this.forecastTurnMsgId!==t?this.updateAssistantMsg(this.forecastTurnMsgId,{text:a.answer,followUps:o.followUps}):this.updateAssistantMsg(t,{text:a.answer,followUps:o.followUps})}catch(o){let a=o;a?.isRefusal&&a.message?(this.updateAssistantMsg(t,{forecastRecomputing:!1}),this.updateAssistantMsg(this.forecastTurnMsgId??t,{text:a.message})):(console.error("[ask-aquera] forecast recompute failed",o),this.updateAssistantMsg(t,{forecastRecomputing:!1}))}finally{this.isStreaming.set(!1)}}async runForecast(t,e,n={},o={}){if(this.isStreaming())return;let a=S=>!!S&&this.messages().some(P=>P.id===S);if(o.inPlace&&a(this.forecastChartMsgId)){let S=this.messages().find(P=>P.id===this.forecastChartMsgId)?.charts[0]?.config??{};return this.recomputeForecastInPlace(this.forecastChartMsgId,e,{queryMeta:n.queryMeta??S.queryMeta,dataSourceId:n.dataSourceId??S.dataSourceId})}let p=a(o.chartMsgId??null)?o.chartMsgId:null;this.inputText.set("");let x={id:we(),role:"user",text:t,charts:[],isStreaming:!1,hasError:!1},v=we(),A={id:"forecast",callIds:["forecast"],pending:1,baseLabel:"Forecasting",label:"Forecasting",status:"running"};this.messages.update(S=>[...S,x,{id:v,role:"assistant",text:"",thinking:"Forecasting",charts:[],isStreaming:!0,hasError:!1,animate:!0,forecast:!0,tools:[A]}]),this.isStreaming.set(!0),this.scrollToBottom();try{let S=await this.forecastApi.compute(w(w({},e),this.activeConversationId()?{conversationId:this.activeConversationId(),prompt:t}:{})),P=St(S,e.series??[]);this.lastForecastRequest=w(w(T(w({},e),{horizon:P.horizon,granularity:P.granularity,confidence:P.confidence}),S.historyQuery?.sql?{historySql:S.historyQuery.sql}:{}),S.cohortQuery?.sql?{cohortSql:S.cohortQuery.sql}:{}),this.appliedForecastSettings.set({horizon:P.horizon,granularity:P.granularity,confidence:P.confidence}),this.forecastMaxHorizon.set(P.maxHorizon),this.forecastFitted.set({periods:S.fittedPeriods,granularity:S.sourceGranularity}),this.forecastGuardrails.set(S.guardrails),this.forecastModelCard.set(S.modelCard),S.conversationTitle&&this.forecastTitle.set(S.conversationTitle),n.queryMeta&&(P.chart.queryMeta=n.queryMeta),n.dataSourceId&&(P.chart.dataSourceId=n.dataSourceId),P.chart.config&&(P.chart.config.forecast={enabled:!0,horizon:P.horizon,granularity:P.granularity,confidence:P.confidence});let z={title:P.chart.title,componentName:P.chart.componentName,config:P.chart},Q=p??v;if(this.forecastChartMsgId=Q,this.forecastTurnMsgId=v,p){let U=this.messages().find(K=>K.id===p);this.updateAssistantMsg(p,w({charts:[z],forecastMeta:P.meta,forecast:!0},U?.preForecastCharts?.length?{}:{preForecastCharts:U?.charts??[]})),this.updateAssistantMsg(v,{isStreaming:!1,thinking:void 0,tools:[],text:P.answer,followUps:S.followUps})}else this.updateAssistantMsg(v,{isStreaming:!1,thinking:void 0,tools:[],text:P.answer,charts:[z],forecastMeta:P.meta,followUps:S.followUps});this.isStreaming.set(!1),this.scrollToBottom()}catch(S){let P=S;P?.isRefusal&&P.message?this.updateAssistantMsg(v,{isStreaming:!1,thinking:void 0,tools:[],text:P.message}):(console.error("[ask-aquera] forecast failed",S),this.updateAssistantMsg(v,{isStreaming:!1,thinking:void 0,tools:[],hasError:!0})),this.isStreaming.set(!1)}}refineForecast(t,e){let n=this.lastForecastRequest;if(!n)return;let o=T(w(w({},n),t),{filters:w(w({},n.filters),t.filters)});(t.metric!==void 0&&t.metric!==n.metric||t.granularity!==void 0&&t.granularity!==n.granularity||t.filters!==void 0&&JSON.stringify(o.filters??{})!==JSON.stringify(n.filters??{}))&&(o.historySql=void 0),t.filters!==void 0&&JSON.stringify(o.filters??{})!==JSON.stringify(n.filters??{})&&(o.cohortSql=void 0),this.runForecast(e,o,{},{inPlace:!0})}onFollowUp(t,e){if(!t.action||this.isStreaming())return;if(t.action===xc){let a=e?.charts?.length?e:this.findForecastTarget();a&&this.forecastChartMessage(a,t.label);return}let[n,o]=t.action.split(":");if(o&&this.lastForecastRequest){if(n==="horizon"){this.refineForecast({horizon:Number(o)},t.label);return}if(n==="granularity"){this.refineForecast({granularity:o},t.label);return}if(n==="metric"){this.refineForecast({metric:o,series:void 0},t.label);return}if(n==="org"||n==="location"||n==="jobFamily"){this.refineForecast({filters:{[n]:o},series:void 0},t.label);return}}if(t.action===fc){this.openForecastSettings();return}}forecastSettingsOpen=f(!1);forecastDraft=f(null);appliedForecastSettings=f(null);forecastMaxHorizon=f(null);forecastGuardrails=f(null);forecastModelCard=f(null);forecastFitted=f(null);granularityChoices=D(()=>{let t=this.forecastCopy(),e=this.forecastContext();if(!e)return[];let n=this.forecastFitted(),o=n?.granularity??e.defaults.granularity,a=n?.periods??0;return vi(o,a,e.granularityOptions)});draftGranularity=D(()=>{let t=this.forecastDraft()?.granularity,e=this.granularityChoices();return e.find(n=>n.value===t)??e.find(n=>n.enabled)??null});horizonUnit=D(()=>{let t=this.draftGranularity(),e=this.forecastDraft()?.horizon??1;return t?e===1?t.label.singular:t.label.plural:"periods"});horizonMax=D(()=>this.draftGranularity()?.maxHorizon||1);unavailableGranularityNote=D(()=>{let t=this.granularityChoices().filter(n=>!n.enabled&&n.reason);return t.length?`Unavailable: ${t.map(n=>`${n.value} (${n.reason})`).join("; ")}.`:""});horizonNote=D(()=>{let t=this.draftGranularity();if(!t)return"";let e=t.maxHorizon===1?t.label.singular:t.label.plural;return`Capped at ${t.maxHorizon} ${e} for this series (\xBD of ${t.fittedPeriods} ${t.label.plural} of history).`});forecastCopy=D(()=>{let t=this.forecastContext();if(!t)return null;let e=this.forecastFitted(),n={maxHorizon:this.forecastMaxHorizon()??"",sourceGranularity:(e?.granularity??t.defaults.granularity).toLowerCase(),historyPeriods:e?.periods??""};return{granularityNote:qe(t.copy?.granularityNote??"",n),confidenceNote:qe(t.copy?.confidenceNote??"",n),guardrails:this.forecastGuardrails(),modelCard:this.forecastModelCard(),confidenceLevels:t.confidenceLevels,granularityOptions:t.granularityOptions,maxHorizon:this.forecastMaxHorizon()??0}});openForecastSettings(){let t=this.appliedForecastSettings(),e=this.forecastContext(),n=t??(e?{horizon:e.defaults.horizon,granularity:e.defaults.granularity,confidence:e.defaults.confidence}:null);n&&(this.forecastDraft.set(n),this.forecastSettingsOpen.set(!0))}closeForecastSettings(){this.forecastSettingsOpen.set(!1),this.forecastDraft.set(null)}patchForecastDraft(t){this.forecastDraft.update(e=>e&&w(w({},e),t))}onHorizonInput(t){let e=Number(t);Number.isFinite(e)&&this.patchForecastDraft({horizon:Math.max(1,Math.min(e,this.horizonMax()))})}onGranularityPick(t){let e=this.forecastDraft();!e||!t.enabled||e.granularity===t.value||this.patchForecastDraft({granularity:t.value,horizon:wi(e.horizon,e.granularity,t.value,t.maxHorizon)})}onConfidenceIndexInput(t){let e=this.forecastCopy()?.confidenceLevels??[],n=Number(t);!e.length||!Number.isFinite(n)||this.patchForecastDraft({confidence:e[Math.max(0,Math.min(n,e.length-1))]})}confidenceIndex=D(()=>{let t=this.forecastCopy()?.confidenceLevels??[],e=this.forecastDraft()?.confidence,n=t.indexOf(e??-1);return n>=0?n:0});horizonFill=D(()=>{let t=this.forecastCopy()?.maxHorizon??1,e=this.forecastDraft()?.horizon??1;return`${t>1?(e-1)/(t-1)*100:100}%`});confidenceFill=D(()=>{let t=this.forecastCopy()?.confidenceLevels.length??1;return`${t>1?this.confidenceIndex()/(t-1)*100:100}%`});applyForecastSettings(){let t=this.forecastDraft();if(!t||(this.appliedForecastSettings.set(t),this.forecastSettingsOpen.set(!1),this.forecastDraft.set(null),!this.lastForecastRequest))return;let e=t.granularity!==this.lastForecastRequest.granularity;this.refineForecast(w({horizon:t.horizon,granularity:t.granularity,confidence:t.confidence},e?{series:void 0}:{}),`Recompute at ${t.horizon} ${t.granularity.toLowerCase()} periods, ${t.confidence}% confidence`)}pendingDisplayOverride=null;async sendMessage(){if(!this.canSend())return;let t=this.replyQuote()??void 0;this.replyQuote.set(null);let e=this.inputText().trim();if(!this.attachments().length&&!t&&this.routeForecastIntent(e))return;this.inputText.set("");let n=t?`> ${t.replace(/\n/g,`
12
+ `).map(e=>{let n=e.indexOf(": ");return n===-1?{title:e,answer:""}:{title:e.slice(0,n),answer:e.slice(n+2)}})}choiceTitle(t){let e=t.prompt??"",n=/—\s*(.+)$/.exec(e);return(n?n[1].trim():e)||"Answer"}subjectIdOf(t){let e=t.options[0]?.id??"";return e.includes("::")?e.slice(0,e.lastIndexOf("::")):e}chatDraftReply(t,e){return t.kind==="widget_clarification"||t.kind==="widget_plan"||t.kind==="plan_intake"?`For "${this.subjectIdOf(t)}": ${e}`:e}requestPlan(t,e){e.selected||this.isStreaming()||(this.updateAssistantMsg(t.id,n=>({choices:(n.choices??[]).map(o=>o===e?T(w({},o),{selected:"__plan__"}):o)})),this.inputText.set("Give me the plan"),this.sendMessage())}previewWidget(t,e){e.selected||this.isStreaming()||(this.pendingDisplayOverride=`Preview "${this.choiceTitle(e)}"`,this.inputText.set(`For "${this.subjectIdOf(e)}": Preview this widget`),this.sendMessage())}isPreviewChart(t){return!!t?.config?.preview&&!!t?.config?.previewOf}previewAltLabel(t){return t?.config?.previewAltLabel??null}replyForPreview(t,e){if(this.isStreaming())return;let n=t?.config?.previewOf;n&&(this.inputText.set(`For "${n}": ${e}`),this.sendMessage())}acceptPreview(t){this.replyForPreview(t,"Use this")}tryAlternatePreview(t){let e=this.previewAltLabel(t);e&&this.replyForPreview(t,e)}skipPreview(t){this.replyForPreview(t,"Skip this widget")}openChatDraft(t,e){this.isStreaming()||e.selected||this.updateAssistantMsg(t.id,n=>({choices:(n.choices??[]).map(o=>o===e?T(w({},o),{chatOpen:!0,draftSelection:void 0}):o)}))}onChatDraftTextChange(t,e,n){this.updateAssistantMsg(t.id,o=>({choices:(o.choices??[]).map(a=>a===e?T(w({},a),{chatDraftText:n}):a)}))}defineChatDraft(t,e){let n=e.chatDraftText?.trim();if(!(!n||this.isStreaming())){if(this.isMultiChoice(t)){this.updateAssistantMsg(t.id,o=>({choices:(o.choices??[]).map(a=>a===e?T(w({},a),{chatOpen:!1}):a)}));return}this.updateAssistantMsg(t.id,o=>({choices:(o.choices??[]).map(a=>a===e?T(w({},a),{selected:"__chat__",chatOpen:!1}):a)})),this.inputText.set(this.chatDraftReply(e,n)),this.sendMessage()}}choicePanelIndex=new Map;dismissedChoicePanels=new Set;nonPanelChoices(t){return this.isMultiChoice(t)?[]:t.choices??[]}panelAnsweredCount(t){return t.filter(e=>!!e.selected||!!e.draftSelection||!!e.chatDraftText?.trim()).length}isChoicePanelComplete(t){return t.every(e=>!!e.selected)}choicePanelIndexFor(t,e){return this.choicePanelIndex.has(t.id)||this.choicePanelIndex.set(t.id,this.panelAnsweredCount(e)),Math.min(this.choicePanelIndex.get(t.id),e.length)}activeChoicePanel(){let t=this.messages();for(let e=t.length-1;e>=0;e--){let n=t[e];if(!this.isMultiChoice(n))continue;let o=n.choices;if(!this.isChoicePanelComplete(o)&&!this.dismissedChoicePanels.has(n.id))return{msg:n,choices:o,index:this.choicePanelIndexFor(n,o)}}return null}panelBadgeLabel(t){switch(t.kind){case"plan_intake":return"SETUP";case"widget_clarification":case"clarification":return"CLARIFY";default:return null}}chatDraftPlaceholderFor(t){switch(t.kind){case"widget_clarification":return this.copy().chatDraftPlaceholderWidget;case"widget_plan":return this.copy().chatDraftPlaceholderPlan;case"plan_intake":return this.copy().chatDraftPlaceholderIntake;default:return this.copy().chatDraftPlaceholderClarification}}panelAnswerLabel(t){let e=t.chatDraftText?.trim();if(e)return e;let n=t.draftSelection??t.selected,o=t.options.find(a=>a.id===n);return o?o.label==="Use this"?"Recommended":o.label:"Skipped"}optionPrimaryText(t){return t.label==="Use this"&&t.hint?t.hint:t.label}optionBadgeText(t){return t.label==="Use this"&&t.hint?"Recommended":null}advanceChoicePanel(t){let e=this.choicePanelIndex.get(t.id)??0;this.choicePanelIndex.set(t.id,e+1)}onPanelChatDraftConfirm(t,e){!e.chatDraftText?.trim()||this.isStreaming()||(this.defineChatDraft(t,e),this.advanceChoicePanel(t))}onPanelSkip(t){this.isStreaming()||this.advanceChoicePanel(t)}onPanelPrev(t){let e=this.choicePanelIndex.get(t.id)??0;e>0&&this.choicePanelIndex.set(t.id,e-1)}dismissChoicePanel(t){this.dismissedChoicePanels.add(t.id)}resumeChoicePanel(t){this.dismissedChoicePanels.delete(t.id)}isChoicePanelDismissed(t){return this.dismissedChoicePanels.has(t.id)}static TEXT_REDUNDANT_CHOICE_KINDS=new Set(["index","clarification","widget_clarification"]);suppressTextFor(t){let e=t.choices;return!!e?.length&&e.every(n=>!!n.kind&&i.TEXT_REDUNDANT_CHOICE_KINDS.has(n.kind))}onThreadMouseUp(t){let e=t.composedPath();if(e.some(S=>S instanceof HTMLElement&&S.classList.contains("reply-badge")))return;let n=document.getSelection(),o=n?.toString().trim()??"",a=e.some(S=>S instanceof HTMLElement&&S.classList.contains("assistant-text"));if(!n||!o||!a){this.quoteBadge.set(null);return}let p=46,x=Math.min(Math.max(t.clientX,p+8),window.innerWidth-p-8),A=t.clientY>=34;this.quoteBadge.set({text:o,top:t.clientY,left:x,above:A})}onTextSelectionChange(){if(!this.quoteBadge())return;let t=document.getSelection();(!t||!t.toString().trim())&&this.quoteBadge.set(null)}hideQuoteBadge(){this.quoteBadge.set(null)}addReplyQuote(){let t=this.quoteBadge();t&&(this.replyQuote.set(t.text),this.quoteBadge.set(null),document.getSelection()?.removeAllRanges(),this.composerRef?.nativeElement?.focus?.())}clearReplyQuote(){this.replyQuote.set(null)}forecastContext=f(null);lastForecastRequest=null;forecastChartMsgId=null;forecastTurnMsgId=null;routeForecastIntent(t){let e=this.forecastContext();if(!e)return!1;let n=I().features.forecast?wt(t,e):null;if(!n)return!1;let o=n.extendsExisting?this.findForecastTarget():null;return n.extendsExisting&&!o||!o?!1:this.forecastChartMessage(o,t,{metric:n.metric,horizon:n.horizon,granularity:n.granularity})}forecastChartMessage(t,e,n={}){let o=this.forecastContext();if(!o)return!1;let a=fi(t.charts[0]?.config);if(!a.length)return!1;let p={metric:n.metric??o.metrics[0]?.id??"headcount",horizon:n.horizon??o.defaults.horizon,granularity:n.granularity??o.defaults.granularity,confidence:o.defaults.confidence,series:a,sourceGranularity:o.defaults.granularity},x=t.charts[0]?.config??{};return this.runForecast(e,p,{queryMeta:x.queryMeta,dataSourceId:x.dataSourceId},{chartMsgId:t.id}),!0}forecastableMsgs=new Map;canForecastChart(t){if(!this.forecastContext())return!1;let e=this.forecastableMsgs.get(t.id);if(e!==void 0)return e;let n=Tt(t);return t.isStreaming||this.forecastableMsgs.set(t.id,n),n}artifactForecastMsg=D(()=>{let t=this.artifactSourceMsgId();if(!t||!this.forecastContext())return null;let e=this.messages().find(n=>n.id===t);return e&&Tt(e)?e:null});isRestoredForecast(t){return!!t.forecastSpec&&!t.charts.length&&!t.forecastRecomputing}restoredForecastLabel(t){let e=t.forecastSpec;if(!e)return"";let o={Weekly:"weeks",Monthly:"months",Quarterly:"quarters",Yearly:"years"}[e.granularity]??"periods",a=e.computedAt?new Date(e.computedAt).toLocaleDateString(void 0,{day:"numeric",month:"short",year:"numeric"}):null;return`${e.horizon} ${o} ahead at ${e.confidence}% confidence`+(a?` \xB7 computed ${a}`:"")}recomputeStoredForecast(t){let e=t.forecastSpec;if(!e||this.isStreaming())return;let n=this.findForecastTarget();n&&this.forecastChartMessage(n,`Forecast ${e.horizon} ${e.granularity.toLowerCase()} periods ahead`,{metric:e.metric,horizon:e.horizon,granularity:e.granularity})}canRemoveForecast(t){return!!t.forecast&&!!t.preForecastCharts?.length&&!t.forecastRecomputing}removeForecastFromChart(t){this.canRemoveForecast(t)&&(this.updateAssistantMsg(t.id,{charts:t.preForecastCharts??[],preForecastCharts:void 0,forecast:!1,forecastMeta:void 0}),this.forecastChartMsgId===t.id&&(this.forecastTurnMsgId&&this.updateAssistantMsg(this.forecastTurnMsgId,{followUps:[]}),this.forecastChartMsgId=null,this.forecastTurnMsgId=null,this.lastForecastRequest=null,this.forecastSettingsOpen.set(!1),this.appliedForecastSettings.set(null)))}forecastFromChart(t){this.isStreaming()||this.forecastChartMessage(t,"Forecast this chart")}findForecastTarget(){let t=this.messages();for(let e=t.length-1;e>=0;e--){let n=t[e];if(!(n.role!=="assistant"||n.charts.length!==1)&&tt(n.charts[0].config))return n}return null}async recomputeForecastInPlace(t,e,n){this.isStreaming.set(!0),this.updateAssistantMsg(t,{forecastRecomputing:!0,hasError:!1});try{let o=await this.forecastApi.compute(e),a=St(o,e.series??[]);this.lastForecastRequest=T(w({},e),{horizon:a.horizon,granularity:a.granularity,confidence:a.confidence}),this.appliedForecastSettings.set({horizon:a.horizon,granularity:a.granularity,confidence:a.confidence}),this.forecastMaxHorizon.set(a.maxHorizon),this.forecastFitted.set({periods:o.fittedPeriods,granularity:o.sourceGranularity}),this.forecastGuardrails.set(o.guardrails),this.forecastModelCard.set(o.modelCard),n.queryMeta&&(a.chart.queryMeta=n.queryMeta),n.dataSourceId&&(a.chart.dataSourceId=n.dataSourceId),a.chart.config&&(a.chart.config.forecast={enabled:!0,horizon:a.horizon,granularity:a.granularity,confidence:a.confidence}),this.updateAssistantMsg(t,{forecastRecomputing:!1,charts:[{title:a.chart.title,componentName:a.chart.componentName,config:a.chart}],forecastMeta:a.meta}),this.forecastTurnMsgId&&this.forecastTurnMsgId!==t?this.updateAssistantMsg(this.forecastTurnMsgId,{text:a.answer,followUps:o.followUps}):this.updateAssistantMsg(t,{text:a.answer,followUps:o.followUps})}catch(o){let a=o;a?.isRefusal&&a.message?(this.updateAssistantMsg(t,{forecastRecomputing:!1}),this.updateAssistantMsg(this.forecastTurnMsgId??t,{text:a.message})):(console.error("[ask-aquera] forecast recompute failed",o),this.updateAssistantMsg(t,{forecastRecomputing:!1}))}finally{this.isStreaming.set(!1)}}async runForecast(t,e,n={},o={}){if(this.isStreaming())return;let a=S=>!!S&&this.messages().some(P=>P.id===S);if(o.inPlace&&a(this.forecastChartMsgId)){let S=this.messages().find(P=>P.id===this.forecastChartMsgId)?.charts[0]?.config??{};return this.recomputeForecastInPlace(this.forecastChartMsgId,e,{queryMeta:n.queryMeta??S.queryMeta,dataSourceId:n.dataSourceId??S.dataSourceId})}let p=a(o.chartMsgId??null)?o.chartMsgId:null;this.inputText.set("");let x={id:ve(),role:"user",text:t,charts:[],isStreaming:!1,hasError:!1},v=ve(),A={id:"forecast",callIds:["forecast"],pending:1,baseLabel:"Forecasting",label:"Forecasting",status:"running"};this.messages.update(S=>[...S,x,{id:v,role:"assistant",text:"",thinking:"Forecasting",charts:[],isStreaming:!0,hasError:!1,animate:!0,forecast:!0,tools:[A]}]),this.isStreaming.set(!0),this.scrollToBottom();try{let S=await this.forecastApi.compute(w(w({},e),this.activeConversationId()?{conversationId:this.activeConversationId(),prompt:t}:{})),P=St(S,e.series??[]);this.lastForecastRequest=w(w(T(w({},e),{horizon:P.horizon,granularity:P.granularity,confidence:P.confidence}),S.historyQuery?.sql?{historySql:S.historyQuery.sql}:{}),S.cohortQuery?.sql?{cohortSql:S.cohortQuery.sql}:{}),this.appliedForecastSettings.set({horizon:P.horizon,granularity:P.granularity,confidence:P.confidence}),this.forecastMaxHorizon.set(P.maxHorizon),this.forecastFitted.set({periods:S.fittedPeriods,granularity:S.sourceGranularity}),this.forecastGuardrails.set(S.guardrails),this.forecastModelCard.set(S.modelCard),S.conversationTitle&&this.forecastTitle.set(S.conversationTitle),n.queryMeta&&(P.chart.queryMeta=n.queryMeta),n.dataSourceId&&(P.chart.dataSourceId=n.dataSourceId),P.chart.config&&(P.chart.config.forecast={enabled:!0,horizon:P.horizon,granularity:P.granularity,confidence:P.confidence});let z={title:P.chart.title,componentName:P.chart.componentName,config:P.chart},Q=p??v;if(this.forecastChartMsgId=Q,this.forecastTurnMsgId=v,p){let U=this.messages().find(K=>K.id===p);this.updateAssistantMsg(p,w({charts:[z],forecastMeta:P.meta,forecast:!0},U?.preForecastCharts?.length?{}:{preForecastCharts:U?.charts??[]})),this.updateAssistantMsg(v,{isStreaming:!1,thinking:void 0,tools:[],text:P.answer,followUps:S.followUps})}else this.updateAssistantMsg(v,{isStreaming:!1,thinking:void 0,tools:[],text:P.answer,charts:[z],forecastMeta:P.meta,followUps:S.followUps});this.isStreaming.set(!1),this.scrollToBottom()}catch(S){let P=S;P?.isRefusal&&P.message?this.updateAssistantMsg(v,{isStreaming:!1,thinking:void 0,tools:[],text:P.message}):(console.error("[ask-aquera] forecast failed",S),this.updateAssistantMsg(v,{isStreaming:!1,thinking:void 0,tools:[],hasError:!0})),this.isStreaming.set(!1)}}refineForecast(t,e){let n=this.lastForecastRequest;if(!n)return;let o=T(w(w({},n),t),{filters:w(w({},n.filters),t.filters)});(t.metric!==void 0&&t.metric!==n.metric||t.granularity!==void 0&&t.granularity!==n.granularity||t.filters!==void 0&&JSON.stringify(o.filters??{})!==JSON.stringify(n.filters??{}))&&(o.historySql=void 0),t.filters!==void 0&&JSON.stringify(o.filters??{})!==JSON.stringify(n.filters??{})&&(o.cohortSql=void 0),this.runForecast(e,o,{},{inPlace:!0})}onFollowUp(t,e){if(!t.action||this.isStreaming())return;if(t.action===yc){let a=e?.charts?.length?e:this.findForecastTarget();a&&this.forecastChartMessage(a,t.label);return}let[n,o]=t.action.split(":");if(o&&this.lastForecastRequest){if(n==="horizon"){this.refineForecast({horizon:Number(o)},t.label);return}if(n==="granularity"){this.refineForecast({granularity:o},t.label);return}if(n==="metric"){this.refineForecast({metric:o,series:void 0},t.label);return}if(n==="org"||n==="location"||n==="jobFamily"){this.refineForecast({filters:{[n]:o},series:void 0},t.label);return}}if(t.action===xc){this.openForecastSettings();return}}forecastSettingsOpen=f(!1);forecastDraft=f(null);appliedForecastSettings=f(null);forecastMaxHorizon=f(null);forecastGuardrails=f(null);forecastModelCard=f(null);forecastFitted=f(null);granularityChoices=D(()=>{let t=this.forecastCopy(),e=this.forecastContext();if(!e)return[];let n=this.forecastFitted(),o=n?.granularity??e.defaults.granularity,a=n?.periods??0;return wi(o,a,e.granularityOptions)});draftGranularity=D(()=>{let t=this.forecastDraft()?.granularity,e=this.granularityChoices();return e.find(n=>n.value===t)??e.find(n=>n.enabled)??null});horizonUnit=D(()=>{let t=this.draftGranularity(),e=this.forecastDraft()?.horizon??1;return t?e===1?t.label.singular:t.label.plural:"periods"});horizonMax=D(()=>this.draftGranularity()?.maxHorizon||1);unavailableGranularityNote=D(()=>{let t=this.granularityChoices().filter(n=>!n.enabled&&n.reason);return t.length?`Unavailable: ${t.map(n=>`${n.value} (${n.reason})`).join("; ")}.`:""});horizonNote=D(()=>{let t=this.draftGranularity();if(!t)return"";let e=t.maxHorizon===1?t.label.singular:t.label.plural;return`Capped at ${t.maxHorizon} ${e} for this series (\xBD of ${t.fittedPeriods} ${t.label.plural} of history).`});forecastCopy=D(()=>{let t=this.forecastContext();if(!t)return null;let e=this.forecastFitted(),n={maxHorizon:this.forecastMaxHorizon()??"",sourceGranularity:(e?.granularity??t.defaults.granularity).toLowerCase(),historyPeriods:e?.periods??""};return{granularityNote:qe(t.copy?.granularityNote??"",n),confidenceNote:qe(t.copy?.confidenceNote??"",n),guardrails:this.forecastGuardrails(),modelCard:this.forecastModelCard(),confidenceLevels:t.confidenceLevels,granularityOptions:t.granularityOptions,maxHorizon:this.forecastMaxHorizon()??0}});openForecastSettings(){let t=this.appliedForecastSettings(),e=this.forecastContext(),n=t??(e?{horizon:e.defaults.horizon,granularity:e.defaults.granularity,confidence:e.defaults.confidence}:null);n&&(this.forecastDraft.set(n),this.forecastSettingsOpen.set(!0))}closeForecastSettings(){this.forecastSettingsOpen.set(!1),this.forecastDraft.set(null)}patchForecastDraft(t){this.forecastDraft.update(e=>e&&w(w({},e),t))}onHorizonInput(t){let e=Number(t);Number.isFinite(e)&&this.patchForecastDraft({horizon:Math.max(1,Math.min(e,this.horizonMax()))})}onGranularityPick(t){let e=this.forecastDraft();!e||!t.enabled||e.granularity===t.value||this.patchForecastDraft({granularity:t.value,horizon:ki(e.horizon,e.granularity,t.value,t.maxHorizon)})}onConfidenceIndexInput(t){let e=this.forecastCopy()?.confidenceLevels??[],n=Number(t);!e.length||!Number.isFinite(n)||this.patchForecastDraft({confidence:e[Math.max(0,Math.min(n,e.length-1))]})}confidenceIndex=D(()=>{let t=this.forecastCopy()?.confidenceLevels??[],e=this.forecastDraft()?.confidence,n=t.indexOf(e??-1);return n>=0?n:0});horizonFill=D(()=>{let t=this.forecastCopy()?.maxHorizon??1,e=this.forecastDraft()?.horizon??1;return`${t>1?(e-1)/(t-1)*100:100}%`});confidenceFill=D(()=>{let t=this.forecastCopy()?.confidenceLevels.length??1;return`${t>1?this.confidenceIndex()/(t-1)*100:100}%`});applyForecastSettings(){let t=this.forecastDraft();if(!t||(this.appliedForecastSettings.set(t),this.forecastSettingsOpen.set(!1),this.forecastDraft.set(null),!this.lastForecastRequest))return;let e=t.granularity!==this.lastForecastRequest.granularity;this.refineForecast(w({horizon:t.horizon,granularity:t.granularity,confidence:t.confidence},e?{series:void 0}:{}),`Recompute at ${t.horizon} ${t.granularity.toLowerCase()} periods, ${t.confidence}% confidence`)}pendingDisplayOverride=null;async sendMessage(){if(!this.canSend())return;let t=this.replyQuote()??void 0;this.replyQuote.set(null);let e=this.inputText().trim();if(!this.attachments().length&&!t&&this.routeForecastIntent(e))return;this.inputText.set("");let n=t?`> ${t.replace(/\n/g,`
13
13
  > `)}
14
14
 
15
- ${e}`:e,a=this.attachments().filter(L=>L.status==="ready").map(L=>({key:L.key,name:L.name,contentType:L.contentType,size:L.size}));this.attachments.set([]);let p={id:we(),role:"user",text:this.pendingDisplayOverride??Ei(e),answerSummary:!!this.pendingDisplayOverride,quotedText:t,charts:[],attachments:a,isStreaming:!1,hasError:!1};this.pendingDisplayOverride=null,this.messages.update(L=>[...L,p]);let x=we();this.messages.update(L=>[...L,{id:x,role:"assistant",text:"",thinking:"Thinking",charts:[],isStreaming:!0,hasError:!1,animate:!0,tools:[{id:"thinking",callIds:["thinking"],pending:1,baseLabel:"Thinking",label:"Thinking",status:"running"}]}]),this.isStreaming.set(!0);let v=new AbortController;this.streamAbort=v,this.scrollToBottom();let A="",S="Thinking",P=[],z=!1,Q=!1,U=!1,K=new Set,X=L=>{let J=L?.queryMeta,R=J?.sql??(J?.dsl?JSON.stringify(J.dsl):L?.title??"");return`${L?.componentName??""}|${R}`},ne=()=>{if(z||P.length===0)return;z=!0;let L=P.splice(0);this.updateAssistantMsg(x,J=>({charts:[...J.charts,...L]})),this.scrollToBottom()};try{let L=this.selectedScope(),J=L?L.id:null,R=L?.kind==="pipeline";await this.svc.streamChat(this.activeConversationId(),n,{onText:V=>{A+=V,!z&&P.length>=1&&this.zone.run(()=>ne())},onToolStart:(V,$)=>{A="",S=$||"Working",this.zone.run(()=>{this.updateAssistantMsg(x,j=>({thinking:S,tools:si(j.tools??[],V,S)}))})},onToolResult:(V,$,j)=>{this.zone.run(()=>{this.updateAssistantMsg(x,H=>({tools:di(H.tools??[],V,$,j)}))})},onDataPart:async V=>{if(V.data_type==="adhoc_viz"&&V.data){await Nn(V.data.config);let $={title:V.data.title??"Chart",componentName:V.data.componentName??"",config:V.data},j=V.data?.id,H=B=>j&&B.config?.id===j;this.zone.run(()=>{if(z){this.updateAssistantMsg(x,pe=>{let Oe=j?pe.charts.findIndex(H):-1;return{charts:Oe===-1?[...pe.charts,$]:pe.charts.map((Ii,Vi)=>Vi===Oe?$:Ii)}}),this.scrollToBottom();return}let B=j?P.findIndex(H):-1;B===-1?P.push($):P[B]=$,P.length>=2&&ne()})}},onDashboardTitle:V=>{V&&this.zone.run(()=>this.updateAssistantMsg(x,{dashboardTitle:V}))},onChoice:V=>{V?.options?.length&&this.zone.run(()=>this.updateAssistantMsg(x,$=>({choices:[...$.choices??[],V]})))},onLayoutPatch:V=>{let $=new Map((V?.layouts??[]).map(H=>[H.id,H.layout]));if(!$.size)return;let j=H=>{let B=H?.id;return B?$.get(B):void 0};for(let H of P){let B=j(H.config);B&&(H.config=T(w({},H.config),{layout:B}))}this.zone.run(()=>this.updateAssistantMsg(x,H=>({charts:H.charts.map(B=>{let pe=j(B.config);return pe?T(w({},B),{config:T(w({},B.config),{layout:pe})}):B})})))},onError:()=>{Q=!0},onFinish:(V,$)=>{U=!0,this.zone.run(()=>{ne(),this.updateAssistantMsg(x,{isStreaming:!1,thinking:void 0,text:A}),this.isStreaming.set(!1);let j=this.messages().find(B=>B.id===x);vt({finishReason:V,sawError:Q,producedContent:!!(j?.text||j?.charts.length||j?.choices?.length)})&&this.showStreamError(x),$&&!this.activeConversationId()&&(this.activeConversationId.set($),this.conversationCustomerId.set(this.customerId()),this.conversationsLoading.set(!0),this.svc.listConversations().then(B=>{this.conversations.set(B);let pe=B.find(Oe=>Oe.id===$);this.conversationConnectionId.set(pe?.connectionId??null)}).finally(()=>this.conversationsLoading.set(!1))),this.loadConversationDashboards(),this.messages().find(B=>B.id===x)?.charts.length||this.scrollToBottom()})}},J,v.signal,a,R,this.builderDashboardId())}catch(L){v.signal.aborted||L instanceof DOMException&&L.name==="AbortError"||this.zone.run(()=>this.showStreamError(x))}finally{this.zone.run(()=>{!U&&vt({sawError:Q,producedContent:!1})&&this.showStreamError(x),this.updateAssistantMsg(x,{isStreaming:!1,thinking:void 0}),this.streamAbort===v&&(this.isStreaming.set(!1),this.streamAbort=null)})}}showStreamError(t){this.messages.update(e=>pi(e,t,n=>({id:n,role:"assistant",text:"",charts:[],isStreaming:!1,hasError:!1}))),this.isStreaming.set(!1)}stopStream(){this.messages.update(t=>t.map(e=>e.isStreaming?T(w({},e),{isStreaming:!1,thinking:void 0,tools:[]}):e)),this.streamAbort?.abort(),this.isStreaming.set(!1)}openArtifact(t,e){this.artifactSourceMsgId.set(e??null),this.activeArtifactRaw.set(e?[]:t),this.bucketExtraCharts.set([]),this.forecastOverlay.set(new Map),this.loadArtifactForecastable(),this.prefetchWidgetTemplateCatalog();let n=this.mostRecentDashboardTitle(),o=t.find(a=>!this.isFilterChart(a));this.saveDashboardName.set(n||o?.title||t[0]?.title||"My Dashboard"),this.resetArtifactFilterState()}addInlineWidget(t){this.inlinePickerFor.set(null),this.addArtifactToDashboard(t)}addInlineToExisting(t,e){this.inlinePickerFor.set(null),this.addToExistingDashboard(e,t)}addInlineDefault(t){let e=this.conversationDashboards();if(!this.builderOpen()&&e.length===1){this.addInlineToExisting(t,e[0].id);return}this.addInlineWidget(t)}async addToLibrary(t){try{await this.globalWidget.add(this.artifactToWidget(t)),this.showToast("success","Saved to your widget library.")}catch{}}onSelectionChange(t){this.selectedWidgetIds.set(t)}pickGalleryPrompt(t){this.inputText.set(t),this.closeGallery()}onWelcomePromptPick(t){this.isStreaming()||(this.inputText.set(t.label),this.sendMessage())}onGalleryPromptPick(t){t?.key&&this.pickGalleryPrompt(t.key)}openGallery(){this.gallerySearch.set(""),this.galleryOpen.set(!0)}closeGallery(){this.galleryOpen.set(!1),this.gallerySearch.set("")}xrayOpen=f(!1);xraySources=f([]);xraySourcesLoading=f(!1);xraySelectedConnectionId=f(null);xraySelectedDatasetId=f(null);xrayEntities=f([]);xrayEntitiesLoading=f(!1);xrayEntitySearch=f("");xrayTopic=f("");xrayRunning=f(!1);xrayStatus=f("idle");xrayError=f(null);xrayConversationId=f(null);xrayDatasetMenuOpen=f(!1);xrayRunningEntity=f(null);xraySkeletonRows=[180,140,200,120,165,150];xraySelectedDatasetLabel=D(()=>{let t=this.xraySelectedDatasetId();return this.xrayDatasets().find(e=>e.datasetId===t)?.label??this.copy().xrayDatasetLabel});xrayEntityNoun=D(()=>{let t=this.xrayFilteredEntities(),e=t.some(o=>o.kind==="table");return t.some(o=>o.kind==="index")&&!e?this.copy().xrayIndexesNoun:this.copy().xrayTablesNoun});xrayEntityLabel(t){return t.schema?`${t.schema}.${t.name}`:t.name}xrayRunningEntityLabel=D(()=>{let t=this.xrayRunningEntity();return t?this.xrayEntityLabel(t):""});xrayDatasets=D(()=>{let t=this.xraySources(),e=new Map;for(let n of t)for(let o of n.datasets)e.set(o.name,(e.get(o.name)??0)+1);return t.flatMap(n=>n.datasets.map(o=>({datasetId:o.id,label:(e.get(o.name)??0)>1?`${o.name} \u2014 ${n.name}`:o.name,connectionId:n.id,isDefault:n.isDefault})))});xrayFilteredEntities=D(()=>{let t=this.xrayEntitySearch().trim().toLowerCase(),e=this.xrayEntities();return t?e.filter(n=>n.name.toLowerCase().includes(t)||(n.schema??"").toLowerCase().includes(t)):e});async openXray(){if(this.xrayOpen.set(!0),this.xrayError.set(null),this.xrayStatus.set("idle"),!this.xraySources().length){this.xraySourcesLoading.set(!0);try{let t=await this.svc.listXraySources();this.xraySources.set(t);let e=this.xrayDatasets(),n=e.find(o=>o.isDefault)??e[0]??null;n&&await this.selectXrayDataset(n.datasetId)}catch(t){this.xrayError.set(t instanceof Error?t.message:String(t))}finally{this.xraySourcesLoading.set(!1)}}}closeXray(){this.xrayOpen.set(!1),this.xrayEntitySearch.set(""),this.xrayError.set(null)}async selectXrayDataset(t){let e=this.xrayDatasets().find(n=>n.datasetId===t)??null;this.xraySelectedDatasetId.set(e?e.datasetId:null),this.xraySelectedConnectionId.set(e?e.connectionId:null),await this.loadXrayEntities()}async loadXrayEntities(){let t=this.xraySelectedConnectionId();if(t){this.xrayEntitiesLoading.set(!0),this.xrayEntities.set([]),this.xrayError.set(null);try{let e=await this.svc.listXrayEntities(t,this.xraySelectedDatasetId()??void 0);this.xrayEntities.set(e.entities??[])}catch(e){this.xrayError.set(e instanceof Error?e.message:String(e))}finally{this.xrayEntitiesLoading.set(!1)}}}onXrayDatasetPick(t){this.xrayDatasetMenuOpen.set(!1),this.selectXrayDataset(t)}async runXray(t){let e=this.xraySelectedConnectionId();if(!e||this.xrayRunning())return;this.xrayRunning.set(!0),this.xrayRunningEntity.set(t),this.xrayStatus.set("analyzing"),this.xrayError.set(null),this.xrayConversationId.set(null);let n=[],o=null;try{await this.svc.xrayPreviewStream(e,{entity:{kind:t.kind,schema:t.schema,name:t.name},datasetId:this.xraySelectedDatasetId()??void 0,topic:this.xrayTopic().trim()||void 0},{onProfile:()=>this.xrayStatus.set("building"),onWidget:a=>{n.push({title:a.title,componentName:a.componentName,config:a}),this.openArtifact([...n])},onConversation:a=>{this.xrayConversationId.set(a),this.selectConversation(a)},onEmpty:a=>{o=a},onError:a=>{o=a},onDone:(a,p,x)=>{x&&this.xrayConversationId.set(x)}})}catch(a){o=a instanceof Error?a.message:String(a)}finally{this.xrayRunning.set(!1),this.xrayRunningEntity.set(null)}if(n.length){this.xrayStatus.set("idle"),this.saveDashboardName.set(this.xrayDashboardName(t)),this.closeXray();let a=this.xrayConversationId();a&&await this.selectConversation(a,!0)}else this.xrayStatus.set("failed"),this.xrayError.set(o??this.copy().xrayFailed)}xrayDashboardName(t){return`A look at ${t.schema?`${t.schema}.${t.name}`:t.name}`}templateCatalogPrefetch=null;prefetchTemplateCatalog(){return this.templateCatalogPrefetch?this.templateCatalogPrefetch:(this.templateCatalogPrefetch=(async()=>{if(!this.templateCategories().length){this.templateCategoriesLoading.set(!0);try{this.templateCategories.set(await this.svc.listDashboardCategories())}catch{}finally{this.templateCategoriesLoading.set(!1)}}if(!this.templateAllTemplates().length){this.templateTemplatesLoading.set(!0);try{this.templateAllTemplates.set(await this.svc.listAllCategoryTemplates())}catch{}finally{this.templateTemplatesLoading.set(!1)}}})(),this.templateCatalogPrefetch)}selectTemplateCategory(t){this.templateActiveCategory.set(t)}widgetTemplateCatalogPrefetch=null;prefetchWidgetTemplateCatalog(){return this.widgetTemplateCatalogPrefetch?this.widgetTemplateCatalogPrefetch:(this.widgetTemplateCatalogPrefetch=(async()=>{if(!this.templateCategories().length){this.templateCategoriesLoading.set(!0);try{this.templateCategories.set(await this.svc.listDashboardCategories())}catch{}finally{this.templateCategoriesLoading.set(!1)}}if(!this.widgetTemplateAllTemplates().length){this.widgetTemplateTemplatesLoading.set(!0);try{let t=await this.svc.loadAllWidgetTemplatePreviews();this.widgetTemplateAllTemplates.set(t.map(n=>n.template));let e=new Map;for(let n of t)e.set(n.template.id,n.widget?{title:n.widget.title,componentName:n.widget.componentName,config:n.widget}:null);this.widgetTemplatePreviews.set(e)}catch{}finally{this.widgetTemplateTemplatesLoading.set(!1)}}})(),this.widgetTemplateCatalogPrefetch)}selectWidgetTemplate(t){let e=this.widgetTemplatePreviews().get(t);if(e){this.addKpiToBucket(e,t);return}this.pickWidgetTemplate(t)}addKpiToBucket(t,e){this.activeArtifact().some(o=>o.config?._meta?.templateId===e)||(this.pushCanvasHistory(),this.bucketExtraCharts.update(o=>[...o,t]),this.ensureArtifactPaneOpen(),this.closeWidgetDetailPanel())}artifactHasFilter=D(()=>this.activeArtifact().some(t=>this.isFilterChart(t)));onFiltersToggle(t){t?this.addFilterToBucket():this.removeFilterFromArtifact()}addFilterToBucket(){this.artifactHasFilter()||(this.pushCanvasHistory(),this.bucketExtraCharts.update(t=>[...t,this.buildEmptyFilterChart()]),this.ensureArtifactPaneOpen())}removeFilterFromArtifact(){let t=this.activeArtifact().find(n=>this.isFilterChart(n));if(!t)return;if(this.pushCanvasHistory(),this.bucketExtraCharts().includes(t)){this.bucketExtraCharts.update(n=>n.filter(o=>o!==t));return}let e=this.artifactSourceMsgId();e?this.updateAssistantMsg(e,n=>({charts:n.charts.filter(o=>o!==t)})):this.activeArtifactRaw.update(n=>n.filter(o=>o!==t))}buildEmptyFilterChart(){let t=gn();return{title:t.title,componentName:t.componentName,config:t}}onGalleryWidgetClicked(t){this.openWidgetDetailPanelForWidget(t,!0)}async pickWidgetTemplate(t){try{let e=await this.svc.previewWidgetTemplate(t);if(e.error||!e.widget)return;let n={title:e.widget.title,componentName:e.widget.componentName,config:e.widget};this.addKpiToBucket(n,t)}catch{}}async openWidgetDetailPanelForWidget(t,e=!1){if(this.widgetDetailPanelLoading())return;let n=t.config?._meta,o=n?.templateId??null,a=n?.cohortId??null,p=n?.detailPanel??null;if(!(!o&&!p)){if(p&&!p.widgets?.length){e&&o&&this.selectWidgetTemplate(o);return}this.ensureArtifactPaneOpen(),this.widgetDetailPanelTemplateId.set(o),this.detailPanelCohortId.set(a),this.widgetDetailPanelCanAdd.set(e),this.widgetDetailPanelSourceWidgetTitle.set(t.title??null),this.widgetDetailPanelTitle.set(p?.title??null),this.widgetDetailPanelSkeletonSlots.set(hc((p?.widgets??[]).map(x=>x.layout).filter(x=>!!x))),this.widgetDetailPanelLoading.set(!0),this.widgetDetailPanelOpen.set(!0),this.runViewTransition(()=>{});try{let x=a?await this.resolveCohortDetailPanel(a):p?await this.svc.previewWidgetDetailPanelDefinition(p):await this.svc.previewWidgetTemplateDetailPanel(o);if(!x.widgets.length){this.widgetDetailPanelOpen.set(!1);return}this.widgetDetailPanelTitle.set(x.title),this.widgetDetailPanelRaw.set(x.widgets.map(v=>({title:v.title,componentName:v.componentName,config:v})))}catch{this.widgetDetailPanelOpen.set(!1)}finally{this.widgetDetailPanelLoading.set(!1)}}}async resolveCohortDetailPanel(t){try{let[e,n]=await Promise.all([this.cohort.previewCriterion(t),this.cohort.getDetail(t)]);return this.detailPanelCohortData.set({preview:e,detail:n}),Xe(e,n)}catch{return this.detailPanelCohortData.set(null),{title:null,widgets:[],skipped:[]}}}csvField(t){return`"${String(t).replace(/"/g,'""')}"`}csvRow(t){return t.map(e=>this.csvField(e)).join(",")}exportCohortRowsCsv(){let t=this.detailPanelCohortData();if(!t)return;let{preview:e,detail:n}=t,o=[this.csvRow(["System","Events","Errors","Orphans"]),...n.systemRows.map(A=>this.csvRow([A.system,A.events,A.errors,A.orphans])),this.csvRow([n.systemRows.length<n.systemCount?`Showing top ${n.systemRows.length} of ${n.systemCount} systems`:`Showing all ${n.systemCount} systems`,`${n.eventTotal} events in total from these ${e.matchCount} people, across ALL their systems (not just the rows above)`,"",""])],a=new Blob([o.join(`\r
16
- `)],{type:"text/csv;charset=utf-8;"}),p=URL.createObjectURL(a),x=A=>A.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"cohort",v=document.createElement("a");v.href=p,v.download=`${x(e.cohortTitle)}-${e.criterionId}-top${n.systemRows.length}-of-${n.systemCount}-systems.csv`,document.body.appendChild(v),v.click(),v.remove(),setTimeout(()=>URL.revokeObjectURL(p),0)}async copyCohortDefinition(){let t=this.detailPanelCohortData();if(!t)return;let{preview:e,detail:n}=t,o={criterionId:e.criterionId,criterionLabel:this.cohortCriteria().find(a=>a.id===e.criterionId)?.label??null,cohortTitle:e.cohortTitle,matchCount:e.matchCount,totalCount:e.totalCount,systemCount:n.systemCount,eventTotal:n.eventTotal};try{await navigator.clipboard.writeText(JSON.stringify(o,null,2)),this.showToast("success",this.copy().cohortCopyDefinitionConfirmation)}catch{}}addWidgetTemplateFromDetailPanel(){let t=this.widgetDetailPanelTemplateId();t&&(this.selectWidgetTemplate(t),this.closeWidgetDetailPanel())}replaceCanvasWithDetailPanel(){let t=this.widgetDetailPanelRaw();if(!t.length)return;let e=this.widgetDetailPanelSourceTemplateId(),n=this.widgetDetailPanelTitle();this.asOneCanvasStep(()=>{this.artifactSourceMsgId.set(null),this.activeArtifactRaw.set([...t]),this.bucketExtraCharts.set([]),this.selectedWidgetIds.set([]),e&&this.templateSourceId.set(e),n&&this.saveDashboardName.set(n),this.ensureArtifactPaneOpen()}),this.closeWidgetDetailPanel()}async openWidgetDetailPanelForTemplate(t){if(this.widgetDetailPanelLoading())return;this.ensureArtifactPaneOpen(),this.widgetDetailPanelKind.set("dashboard"),this.widgetDetailPanelTemplateId.set(null),this.widgetDetailPanelSourceWidgetTitle.set(null),this.widgetDetailPanelSourceTemplateId.set(t.id),this.widgetDetailPanelCanAdd.set(!1),this.widgetDetailPanelSelectedIds.set([]),this.widgetDetailPanelTitle.set(t.name),this.widgetDetailPanelSkeletonSlots.set([]),this.widgetDetailPanelLoading.set(!0),this.widgetDetailPanelOpen.set(!0);let e=[];try{if(await this.svc.previewCategoryTemplateStream(t.id,{onWidget:n=>{e.push({title:n.title,componentName:n.componentName,config:n})},onSkipped:()=>{},onDone:()=>{},onError:()=>{}}),!e.length){this.widgetDetailPanelOpen.set(!1);return}this.widgetDetailPanelRaw.set(e)}catch{this.widgetDetailPanelOpen.set(!1)}finally{this.widgetDetailPanelLoading.set(!1)}}isDetailPanelFullySelected(){let t=this.widgetDetailPanelWidgets(),e=this.widgetDetailPanelSelectedIds();return t.length>0&&t.every(n=>e.includes(n.id))}toggleSelectAllDetailPanelWidgets(){this.widgetDetailPanelSelectedIds.set(this.isDetailPanelFullySelected()?[]:this.widgetDetailPanelWidgets().map(t=>t.id))}addSelectedDetailPanelWidgetsToCanvas(){let t=new Set(this.widgetDetailPanelSelectedIds()),e=this.widgetDetailPanelRaw().filter((o,a)=>t.has(`detail-panel-${a}`));if(!e.length)return;let n=this.activeArtifact().length===0;this.asOneCanvasStep(()=>{if(this.ensureArtifactPaneOpen(),n){this.activeArtifactRaw.update(a=>[...a,...e]);let o=this.widgetDetailPanelSourceTemplateId();o&&this.templateSourceId.set(o)}else this.bucketExtraCharts.update(o=>[...o,...e])}),this.closeWidgetDetailPanel()}onKpiWidgetClicked(t){this.openWidgetDetailPanelForWidget(t)}closeWidgetDetailPanel(){this.widgetDetailPanelOpen()&&this.runViewTransition(()=>{this.widgetDetailPanelOpen.set(!1),this.widgetDetailPanelRaw.set([]),this.widgetDetailPanelTitle.set(null),this.widgetDetailPanelTemplateId.set(null),this.widgetDetailPanelCanAdd.set(!1),this.widgetDetailPanelSkeletonSlots.set([]),this.widgetDetailPanelKind.set("widget"),this.widgetDetailPanelSourceWidgetTitle.set(null),this.widgetDetailPanelSelectedIds.set([]),this.widgetDetailPanelSourceTemplateId.set(null),this.detailPanelCohortId.set(null),this.detailPanelCohortData.set(null)},"back")}closeArtifact(){this.artifactSourceMsgId.set(null),this.activeArtifactRaw.set([]),this.dslOnlyArtifact.set(!1),this.bucketExtraCharts.set([]),this.artifactForcedOpen.set(!1),this.templateSourceId.set(null),this.widgetTemplateSourceId.set(null),this.closeWidgetDetailPanel(),this.saveDialogOpen.set(!1),this.showAddPicker.set(!1),this.selectedWidgetIds.set([]),this.resetArtifactFilterState()}resetArtifactFilterState(){this.applyFiltersAbort?.abort(),this.applyFiltersAbort=null,this.applyFiltersSeq++,this.applyingFilters.set(!1),this.activeDashboardFilters.set(null),this.activeResolvedFilters.set(null),this.applySummary.set(null),this.filterExplanation.set(null),this.filterOverlay.set(new Map),this.filterSuggestCache.clear(),this.filterSuggestInflight.clear()}buildActiveFilters(t){return En(t,e=>this.filterFieldLabel(e))}filterFieldLabel(t){for(let e of this.filterSuggestCache.values()){let n=e.find(o=>o.type==="attribute"&&o.id===t);if(n)return n.label}return t}isEmptyFilters(t){if(!t)return!0;for(let e of Object.values(t))if(e!=null&&!(typeof e=="string"&&e.trim()==="")&&!(typeof e=="object"&&Object.keys(e).length===0))return!1;return!0}onArtifactFilterChange(t){let e=this.builderDashboardId();!e||!t.widgetId||!t.controlId||this.fetchFilterSuggestionsOnce(e,t.widgetId,t.controlId)}fetchFilterSuggestionsOnce(t,e,n){let o=this.filterSuggestCache.get(e);if(o){this.artifactGridRef?.patchFilterSuggestions(e,n,o);return}this.filterSuggestInflight.has(e)||(this.filterSuggestInflight.add(e),(async()=>{try{let a=await this.svc.filterSuggest(t,"",this.artifactWidgets(),"draft"),p=this.normalizeFilterSuggestions(a);if(!p.length)return;this.filterSuggestCache.set(e,p),this.artifactGridRef?.patchFilterSuggestions(e,n,p)}catch(a){console.warn("[ask-aquera] filter suggest failed",a)}finally{this.filterSuggestInflight.delete(e)}})())}normalizeFilterSuggestions(t){let e=Array.isArray(t.suggestions)?[...t.suggestions]:[];if(!e.length){t.nextToken&&e.push({id:t.nextToken.value,label:t.nextToken.label,type:"attribute"});for(let n of t.completions??[])e.push({label:n,type:"suggestion"})}return e}async onArtifactFilterSubmit(t){let e=this.builderDashboardId();if(!e)return;if(this.isEmptyFilters(t.filters)){this.applyFiltersAbort?.abort(),this.applyFiltersAbort=null,this.applyFiltersSeq++,this.applyingFilters.set(!1),this.activeDashboardFilters.set(null),this.activeResolvedFilters.set(null),this.applySummary.set(null),this.filterExplanation.set(null),this.filterOverlay.set(new Map);return}let n=this.artifactWidgets().filter(p=>!Ne(p));if(!n.length)return;this.applyFiltersAbort?.abort();let o=new AbortController;this.applyFiltersAbort=o;let a=++this.applyFiltersSeq;this.applyingFilters.set(!0);try{let{widgets:p,resolvedFilters:x,filterExplanation:v}=await this.svc.applyFilters(n,t.filters,e,"draft",o.signal,{mode:t.mode,prompt:t.prompt});if(a!==this.applyFiltersSeq)return;this.applyFilterResultsToOverlay(p),this.activeDashboardFilters.set(t.filters),this.activeResolvedFilters.set(x),this.applySummary.set(Ln(p,this.buildActiveFilters(t.filters))),this.filterExplanation.set(v)}catch(p){if(p?.name==="AbortError"||a!==this.applyFiltersSeq)return;console.error("[ask-aquera] apply filters failed",p)}finally{a===this.applyFiltersSeq&&this.applyingFilters.set(!1)}}onDslWidgetUpdated(t){t?.id&&this.filterOverlay.update(e=>{let n=new Map(e);return n.set(t.id,{config:t.config,edited:n.get(t.id)?.edited}),n})}applyFilterResultsToOverlay(t){let e=_n(this.baseArtifactWidgets(),t,o=>Ne(o)),n=new Map;for(let[o,a]of e)n.set(o,{config:a.config,edited:a.edited});this.filterOverlay.set(n)}artifactToWidget(t){let e=t.config??{};return{title:e.title??t.title,componentName:e.componentName??t.componentName,widgetType:e.widgetType??"chart",config:e.config??e,summary:e.summary,queryMeta:e.queryMeta,dataSourceId:e.dataSourceId??void 0,drilldownBy:Array.isArray(e.drilldownBy)?e.drilldownBy:[],category:e.category??null,layout:e.layout}}loadConversationDashboards(){this.dashboardsLoading.set(!0),this.svc.listDashboards(100).then(t=>this.conversationDashboards.set(t)).catch(()=>this.conversationDashboards.set([])).finally(()=>this.dashboardsLoading.set(!1))}storyPickerOpen=f(!1);storyPickerWidget=f(null);openStoryPicker(t=this.selectedArtifactCharts()){let e=t.find(n=>!this.isFilterChart(n))??t[0];e&&(this.storyPickerWidget.set(w({id:"artifact"},this.artifactToWidget(e))),this.storyPickerOpen.set(!0))}closeStoryPicker(){this.storyPickerOpen.set(!1),this.storyPickerWidget.set(null)}onAddedToStory(){this.closeStoryPicker()}async addToExistingDashboard(t,e=this.selectedArtifactCharts()){if(!(!e.length||this.committingAction())){this.savingDashboard.set(!0),this.committingAction.set("add");try{let n=await this.publishRepo.fetchDashboard(t);this.dashboardState.replaceDashboard(n);let o=Ae(e.map(a=>this.artifactToWidget(a)));this.dashboardState.addWidgets(o),this.publishRepo.saveDraft(t,this.dashboardState.snapshot).catch(()=>{}),this.builderPreseeded.set(!0),this.builderDashboardId.set(t),this.builderOpen.set(!0),this.closeArtifact()}catch{}finally{this.savingDashboard.set(!1),this.committingAction.set(null)}}}openSaveDialog(){this.saveDialogOpen.set(!0)}newDashboardName(t){let e=this.artifactSourceMsgId(),n=e?this.messages().find(a=>a.id===e)?.dashboardTitle:void 0,o=t.find(a=>!this.isFilterChart(a));return n?.trim()||o?.title?.trim()||"Untitled Dashboard"}async addArtifactToDashboard(t=this.selectedArtifactCharts()){if(!(!t.length||this.savingDashboard())){if(this.builderOpen()&&this.builderDashboardId()){let e=Ae(t.map(n=>this.artifactToWidget(n)));this.dashboardState.addWidgets(e),this.closeArtifact(),this.showToast("success","Added to your dashboard.");return}this.savingDashboard.set(!0),this.committingAction.set("add");try{let e=this.newDashboardName(t);this.dashboardState.resetDashboard(),this.dashboardState.setDashboardName(e);let n=Ae(t.map(a=>this.artifactToWidget(a)));this.dashboardState.addWidgets(n);let o=await this.svc.createDashboard(T(w({name:e,conversationId:this.activeConversationId()??void 0},this.dashboardSource()),{widgets:this.dashboardState.snapshot.widgets}));this.dashboardState.setDashboardId(o.id),this.builderPreseeded.set(!0),this.builderDashboardId.set(o.id),this.builderOpen.set(!0),this.closeArtifact()}catch{}finally{this.savingDashboard.set(!1),this.committingAction.set(null)}}}async publishAsNewDashboard(t=this.selectedArtifactCharts()){if(!(!t.length||this.savingDashboard())){this.savingDashboard.set(!0),this.committingAction.set("publish");try{let e=this.newDashboardName(t),n=Ae(t.map(o=>{let a=we();return w({id:a},ct(this.artifactToWidget(o),a))}));await this.svc.createDashboard(T(w({name:e,conversationId:this.activeConversationId()??void 0},this.dashboardSource()),{widgets:n,published:!0})),this.showToast("success",`Published "${e}" as a new dashboard`),this.closeArtifact()}catch{}finally{this.savingDashboard.set(!1),this.committingAction.set(null)}}}closeBuilder(){this.builderOpen.set(!1),this.builderDashboardId.set(null),this.builderFullscreen.set(!1),this.dashboardState.resetDashboard()}toggleBuilderFullscreen(){this.builderFullscreen.update(t=>!t)}static MIN_CHAT_WIDTH=320;static MIN_BUILDER_WIDTH=360;resizeShell=null;startChatResize(t){t.preventDefault();let e=t.target.closest(".aq-shell");if(!e)return;let n=e.getBoundingClientRect();this.resizeShell={left:n.left,width:n.width},this.isResizing.set(!0),window.addEventListener("pointermove",this.onChatResizeMove),window.addEventListener("pointerup",this.onChatResizeEnd,{once:!0})}onChatResizeMove=t=>{let e=this.resizeShell;if(!e)return;let n=Math.max(i.MIN_CHAT_WIDTH,e.width-i.MIN_BUILDER_WIDTH),o=Math.min(i.MIN_CHAT_WIDTH,n),a=Math.max(o,Math.min(t.clientX-e.left,n));this.chatPaneWidth.set(a)};onChatResizeEnd=()=>{this.resizeShell=null,this.isResizing.set(!1),window.removeEventListener("pointermove",this.onChatResizeMove),window.removeEventListener("pointerup",this.onChatResizeEnd)};startEditDashboardTitle(){this.builderDashboardId()&&(this.dashboardTitleDraft.set(this.builderRef?.dashboardName()??""),this.editingDashboardTitle.set(!0))}cancelEditDashboardTitle(){this.editingDashboardTitle.set(!1)}async commitDashboardTitle(){if(!this.editingDashboardTitle()||this.renamingDashboard())return;let t=this.dashboardTitleDraft().trim();if(!t){this.editingDashboardTitle.set(!1);return}this.renamingDashboard.set(!0);try{await this.builderRef?.renameTo(t),this.editingDashboardTitle.set(!1)}catch{}finally{this.renamingDashboard.set(!1)}}onBuilderMenuAction(t){if(t==="fullscreen"){this.toggleBuilderFullscreen();return}if(t==="promptGallery"){this.openGallery();return}this.builderRef?.onMenuAction(t)}onBuilderPublished(t){this.showToast("success",`Dashboard "${t}" published`)}async onExecutiveSummary(t){if(this.isStreaming())return;t&&await this.restoreThreadForDashboard(t).catch(()=>{});let e=this.builderRef?.dashboardName?.(),n=this.aiExecutiveSummaryEl?.nativeElement;n&&(n.config={summary:"",buttonLabel:"Executive Summary",buttonVariant:"secondary",drawerLabel:e?`${e} Summary`:"Dashboard Summary",typingSpeed:5,closeOnEscape:!0},n.loading=!0,n.show?.()),this.isStreaming.set(!0);try{let o=await this.svc.fetchDashboardSummary(t),a=this.aiExecutiveSummaryEl?.nativeElement;a&&(a.config=T(w({},a.config??{}),{summary:o}),a.loading=!1,a.open&&a.startTyping?.())}catch(o){let a=this.aiExecutiveSummaryEl?.nativeElement,p=o instanceof Error?o.message:"Failed to generate summary.";a&&(a.config=T(w({},a.config??{}),{summary:`<p>${p}</p>`}),a.loading=!1)}finally{this.isStreaming.set(!1)}}async confirmSaveDashboard(){let t=this.saveDashboardName().trim();if(!t||this.savingDashboard())return;let e=Ae(this.activeArtifact().map(n=>{let o=we();return w({id:o},ct(this.artifactToWidget(n),o))}));this.savingDashboard.set(!0);try{let n=await this.svc.createDashboard(T(w({name:t,conversationId:this.activeConversationId()??void 0},this.dashboardSource()),{widgets:e,sourceTemplateId:this.templateSourceId()??void 0}));await this.svc.publishDashboard(n.id),this.showToast("success",`Dashboard "${n.name}" published`),this.closeArtifact()}catch{}finally{this.savingDashboard.set(!1)}}ngOnDestroy(){this.streamAbort?.abort(),this.onChatResizeEnd()}onComposerSubmit(t){typeof t=="string"&&this.inputText.set(t),this.sendMessage()}onComposerKeydown(t){if(t.key==="Escape"){if(!this.isStreaming())return;t.preventDefault(),t.stopPropagation(),this.stopStream();return}t.key!=="Enter"||t.shiftKey||t.metaKey||t.ctrlKey||t.isComposing||(t.preventDefault(),t.stopPropagation(),this.onComposerSubmit(this.inputText()))}isDataGrid(t){let e=(t.componentName??"").toLowerCase();return e.includes("data-grid")||e.includes("datagrid")}isKpiChart(t){return(t.componentName??"").toLowerCase().includes("kpi")||t.config?.config?.chart?.type==="kpi"}inlineChartClass(t){if(this.inlineViewModeFor(t)!=="chart")return"inline-widget__chart inline-widget__chart--grid";if(!this.isKpiChart(t))return"inline-widget__chart";let e=t.config?.config?.chart?.sparkline;return`inline-widget__chart inline-widget__chart--kpi${Array.isArray(e)&&e.length>=2?" inline-widget__chart--kpi-spark":""}`}inlineFilters=new Map;inlineFilterSeq=0;inlineChartFallbackIds=new WeakMap;inlineChartFallbackIdSeq=0;inlineChartKey(t){let e=t.config?.id;if(e!=null)return String(e);let n=this.inlineChartFallbackIds.get(t);return n||(n=`chart-${++this.inlineChartFallbackIdSeq}`,this.inlineChartFallbackIds.set(t,n)),n}inlineChartRawConfig(t){return t.config?.config?.chart}inlineWidgetMenuItems(t){let e=t.charts[0];if(!e||this.isFilterChart(e))return[];let n={canChangeChartType:!0,canManageFilters:!0,canCustomizeColors:!1,canForecast:this.canForecastChart(t),hasForecast:this.canRemoveForecast(t),canSetAlert:this.canCreateAlert(e),isKpi:this.isKpiChart(e)},o=this.inlineActiveFilters(e).length,a=In(n).map(v=>{if(v.type==="custom"){let S=v.id==="manageFilters"&&o>0?`${v.label} (${o})`:v.label;return{key:v.id,label:S,glyph:v.glyph,divider:v.divider,method:v.method,color:v.color,kind:"custom"}}let A=v.downloadPng?"exportPng":v.downloadCsv?"exportCsv":"print";return{key:A,label:v.label??A,glyph:v.glyph,divider:v.divider,kind:A}});this.widgetMenu().ask&&a.unshift({key:"ask",label:"Ask",glyph:"smart-code",method:"fill",color:"var(--ng-colors-border-brand)",kind:"custom"}),this.isDslEditableChart(e)&&a.push({key:"editDsl",label:"Edit query",glyph:"ng-code",divider:!0,kind:"custom"});let p=this.inlineViewModeFor(e),x=this.inlineHasQueryableData(e);return p==="chart"?(a.push({key:"viewData",label:"Chart Data",glyph:"ng-table",divider:!this.isDslEditableChart(e),kind:"custom"}),x&&a.push({key:"viewRecords",label:"View Records",glyph:"ng-database",kind:"custom"})):(a.push({key:"viewChart",label:"View Chart",glyph:"ng-chart-bar",divider:!this.isDslEditableChart(e),kind:"custom"}),x&&p!=="records"&&a.push({key:"viewRecords",label:"View Records",glyph:"ng-database",kind:"custom"})),p!=="chart"?Vn(a,v=>v.key==="viewChart"||v.key==="viewRecords",v=>v.key==="setAlert"||v.kind==="exportCsv"):a}onInlineWidgetMenuItem(t,e){let n=t.charts[0];if(e.kind!=="custom"){this.runInlineChartAction(t,e.kind);return}switch(e.key){case"ask":this.inlineChartWidgets?.find(o=>o.widgetId===t.id)?.openAiChat();break;case"changeChartType":n&&this.toggleInlineChartTypePicker(n);break;case"manageFilters":n&&this.toggleInlineFilterPicker(n);break;case"setAlert":n&&this.createAlertFromChart(n);break;case"forecast":this.canRemoveForecast(t)?this.removeForecastFromChart(t):this.forecastFromChart(t);break;case"editDsl":n&&this.openArtifactForInlineDsl(t,n);break;case"viewData":n&&this.setInlineViewMode(n,"data");break;case"viewChart":n&&this.setInlineViewMode(n,"chart");break;case"viewRecords":n&&this.viewInlineRecords(t,n);break}}async onInlineAiSend(t){let n=this.messages().find(a=>a.id===t.widgetId)?.charts?.[0],o=t.chartEl;if(!n){o?.addAiResponse?.("Sorry, I couldn't process your request. Please try again.");return}try{let{content:a}=await this.svc.chatWithAdhocWidget(n,t.message,t.sessionId);o?.addAiResponse?.(a)}catch{o?.addAiResponse?.("Sorry, I couldn't process your request. Please try again.")}}async onArtifactAiSend(t){let e=this.artifactWidgets().find(o=>o.id===t.widgetId),n=t.chartEl;if(!e){n?.addAiResponse?.("Sorry, I couldn't process your request. Please try again.");return}try{let{content:o}=await this.svc.chatWithAdhocWidget(e,t.message,t.sessionId);n?.addAiResponse?.(o)}catch{n?.addAiResponse?.("Sorry, I couldn't process your request. Please try again.")}}inlineChartWidgets;async runInlineChartAction(t,e){let n=this.inlineChartWidgets?.find(o=>o.widgetId===t.id)?.chartRef?.nativeElement;try{e==="exportPng"?await n?.exportChart?.("image/png"):e==="exportCsv"?await n?.downloadCsv?.():await n?.printChart?.()}catch{}}toggleInlineChartTypePicker(t){if(this.inlineChartTypePickerFor()===t){this.closeInlineChartTypePicker();return}this.openInlineChartTypePicker(t)}toggleInlineFilterPicker(t){if(this.inlineFilterPickerFor()===t){this.closeInlineFilterBuilder();return}this.openInlineFilterBuilder(t)}inlineDataViewCache=new WeakMap;inlineDisplayConfig(t){let e=this.inlineViewModeFor(t);if(e==="data"){let o=this.inlineDataViewCache.get(t);if(o)return o;let a=T(w({},t.config?.config),{chart:this.buildInlineDataViewChart(t)});return this.inlineDataViewCache.set(t,a),a}if(e==="records"){let o=this.inlineRecordsChartFor(t);if(o)return o.config}let n=this.inlineFilterResult.get(this.inlineChartKey(t));return n?n?.config:t.config?.config}inlineViewMode=new Map;inlineRecords=new Map;inlineRecordsLoading=f(new Set);recordsFetcher=N(vn,{optional:!0});inlineViewModeFor(t){return this.inlineViewMode.get(t)??"chart"}setInlineViewMode(t,e){e==="chart"?this.inlineViewMode.delete(t):this.inlineViewMode.set(t,e)}inlineHasQueryableData(t){if(!this.recordsFetcher)return!1;let e=t.config?.config,n=!!this.chartQueryMeta(t)?.sql,o=e?.chart?.type==="grid";return n&&!o}isDslEditableChart(t){let e=this.chartQueryMeta(t);return!e?.adapterType||!["opensearch","postgres","mssql"].includes(e.adapterType)?!1:!!(e.sql||e.dsl)}openArtifactForInlineDsl(t,e){this.isDslEditableChart(e)&&(this.dslOnlyArtifact.set(!0),this.openArtifact(t.charts,t.id),setTimeout(()=>{this.artifactGridRef?.openDslEditor(`${t.id}-0`)}))}onArtifactDslEditorClosed(){this.dslOnlyArtifact()&&this.closeArtifact()}buildInlineDataViewChart(t){let e=t.config?.config?.chart??{},{columns:n,rows:o}=bn(e);if(!this.isKpiChart(t))return{type:"grid",data:o,columns:n.map(A=>({id:A,header:A,accessorKey:A,enableSorting:!0}))};let p=o[0]?.[n[0]]??null,x=yn({config:t.config?.config,queryMeta:this.chartQueryMeta(t)});return{type:"grid",data:[{field:"Value",text:p,emphasize:!0},...x.map(A=>({field:A.label,text:A.text}))],columns:[{id:"field",header:"Field",accessorKey:"field",enableSorting:!1,width:"140px",cell:A=>st`<strong>${A.value}</strong>`},{id:"text",header:"Value",accessorKey:"text",enableSorting:!1,cell:A=>{let P=A.row.emphasize?"display:block;overflow-x:auto;white-space:nowrap;font-size:22px;font-weight:700;":"display:block;overflow-x:auto;white-space:nowrap;";return st`<span style=${P}>${A.value}</span>`}}]}}chartQueryMeta(t){let e=t.config??{};return e.queryMeta??e.config?.aq?.queryMeta}inlineRecordsChartFor(t){return this.inlineRecords.get(t)??null}isInlineRecordsLoading(t){return this.inlineRecordsLoading().has(t)}async viewInlineRecords(t,e){if(this.setInlineViewMode(e,"records"),!this.recordsFetcher||this.inlineRecords.has(e))return;let n=new Set(this.inlineRecordsLoading());n.add(e),this.inlineRecordsLoading.set(n);try{let o=T(w({},this.artifactToWidget(e)),{id:t.id}),a=await this.recordsFetcher.fetch(o,void 0);this.inlineRecords.set(e,a.empty?null:a.chart)}catch{this.inlineRecords.set(e,null)}finally{let o=new Set(this.inlineRecordsLoading());o.delete(e),this.inlineRecordsLoading.set(o)}}inlineChartTypeApplyingComponent=f(null);chartTypeIcon(t){return qn(t)}inlineSensibleChartTypes(){return this.inlineChartTypeOptions().filter(t=>t.sensible)}inlineOtherChartTypes(){return this.inlineChartTypeOptions().filter(t=>!t.sensible)}async openInlineChartTypePicker(t){let e=++this.inlineChartTypePickerSeq;this.inlineChartTypePickerFor.set(t),this.inlineChartTypeError.set(null),this.inlineChartTypeOptions.set([]),this.inlineChartTypeLoading.set(!0);try{let n=t.config,o=await this.publishRepo.listChartTypes({id:n?.id??t.title,componentName:t.componentName,queryMeta:n?.queryMeta,config:n?.config});if(e!==this.inlineChartTypePickerSeq)return;this.inlineChartTypeOptions.set(o.filter(a=>a.component!==t.componentName))}catch(n){if(e!==this.inlineChartTypePickerSeq)return;this.inlineChartTypeError.set(n instanceof Error?n.message:"Could not load chart types")}finally{e===this.inlineChartTypePickerSeq&&this.inlineChartTypeLoading.set(!1)}}closeInlineChartTypePicker(){this.inlineChartTypePickerFor.set(null),this.inlineChartTypeOptions.set([]),this.inlineChartTypeError.set(null)}async selectInlineChartType(t){let e=this.inlineChartTypePickerFor();if(!(!e||this.inlineChartTypeApplying())){this.inlineChartTypeApplying.set(!0),this.inlineChartTypeApplyingComponent.set(t),this.inlineChartTypeError.set(null);try{let n=await this.svc.changeAdhocChartType(e.config,t);this.replaceInlineChart(e,n),this.closeInlineChartTypePicker()}catch(n){this.inlineChartTypeError.set(n instanceof Error?n.message:this.copy().errors.chartTypeChangeFailed)}finally{this.inlineChartTypeApplying.set(!1),this.inlineChartTypeApplyingComponent.set(null)}}}replaceInlineChart(t,e){let n=this.inlineChartKey(t);this.inlineFilters.delete(n),this.inlineFilterFieldsCache.delete(n),this.inlineFilterBaseConfig.delete(n),this.inlineFilterResult.delete(n);let o={title:e.title??t.title,componentName:e.componentName??"",config:e};this.messages.update(a=>a.map(p=>T(w({},p),{charts:p.charts.map(x=>x===t?o:x)})))}inlineFilterBuilderFieldId=f(null);inlineFilterBuilderOperator=f(null);inlineFilterBuilderValue=f("");inlineFilterBuilderValue2=f("");inlineFilterBuilderValues=f([]);inlineFilterFieldsLoading=f(!1);inlineFilterFieldsError=f(null);inlineFilterValuesLoading=f(!1);inlineFilterApplying=f(!1);inlineFilterApplyError=f(null);inlineFilterFieldsCache=new Map;inlineFilterValuesCache=new Map;inlineFilterBaseConfig=new Map;inlineFilterResult=new Map;toggleInlineFilterMultiValue(t){this.inlineFilterBuilderValues.update(e=>e.includes(t)?e.filter(n=>n!==t):[...e,t])}resetInlineFilterBuilderValues(){this.inlineFilterBuilderValue.set(""),this.inlineFilterBuilderValue2.set(""),this.inlineFilterBuilderValues.set([])}async openInlineFilterBuilder(t){this.inlineFilterPickerFor.set(t),this.inlineFilterApplyError.set(null);let e=this.inlineChartKey(t);if(!this.inlineFilterFieldsCache.has(e)){this.inlineFilterFieldsLoading.set(!0),this.inlineFilterFieldsError.set(null);try{let o=await this.svc.listAdhocFilterFields([t.config]);this.inlineFilterFieldsCache.set(e,o)}catch(o){this.inlineFilterFieldsError.set(o instanceof Error?o.message:"Could not load filter fields")}finally{this.inlineFilterFieldsLoading.set(!1)}}let n=this.inlineFilterFields(t)[0];this.inlineFilterBuilderFieldId.set(n?.name??null),this.inlineFilterBuilderOperator.set(n?Le(n.type)[0].value:null),this.resetInlineFilterBuilderValues(),n&&this.ensureInlineFilterValuesLoaded(t,n)}closeInlineFilterBuilder(){this.inlineFilterPickerFor.set(null)}inlineFilterFields(t){return this.inlineFilterFieldsCache.get(this.inlineChartKey(t))??[]}inlineFilterSelectedField(t){return this.inlineFilterFields(t).find(e=>e.name===this.inlineFilterBuilderFieldId())}async ensureInlineFilterValuesLoaded(t,e){let n=`${this.inlineChartKey(t)}::${e.name}`;if(!(!Mn(e.type)||this.inlineFilterValuesCache.has(n))){this.inlineFilterValuesLoading.set(!0);try{let o=await this.svc.fetchAdhocFilterValues([t.config],e.name);this.inlineFilterValuesCache.set(n,o.values)}catch{this.inlineFilterValuesCache.set(n,[])}finally{this.inlineFilterValuesLoading.set(!1)}}}inlineFilterValuesFor(t){let e=this.inlineFilterPickerFor();return!t||!e?[]:this.inlineFilterValuesCache.get(`${this.inlineChartKey(e)}::${t}`)??[]}onInlineFilterFieldChange(t,e){this.inlineFilterBuilderFieldId.set(e);let n=this.inlineFilterFields(t).find(o=>o.name===e);this.inlineFilterBuilderOperator.set(n?Le(n.type)[0].value:null),this.resetInlineFilterBuilderValues(),n&&this.ensureInlineFilterValuesLoaded(t,n)}onInlineFilterOperatorChange(t){this.inlineFilterBuilderOperator.set(t),this.resetInlineFilterBuilderValues()}inlineFilterOperators(t){let e=this.inlineFilterSelectedField(t);return e?Le(e.type):[]}inlineFilterSelectedOperator(t){return this.inlineFilterOperators(t).find(e=>e.value===this.inlineFilterBuilderOperator())}inlineActiveFilters(t){return this.inlineFilters.get(this.inlineChartKey(t))??[]}inlineFilterChipLabel(t,e){let n=this.inlineFilterFields(t).find(o=>o.name===e.fieldId);return Tn(e,n?.label??e.fieldId,n?.type??"string")}async reapplyInlineFilters(t,e,n){if(!n.length)return this.inlineFilterResult.delete(e),this.inlineFilterBaseConfig.delete(e),!0;let o=this.inlineFilterBaseConfig.get(e)??t.config;this.inlineFilterApplying.set(!0),this.inlineFilterApplyError.set(null);try{let a=n.map(Sn),p=await this.svc.applyAdhocFilter(o,a);return this.inlineFilterBaseConfig.set(e,o),this.inlineFilterResult.set(e,p),!0}catch(a){return this.inlineFilterApplyError.set(a instanceof Error?a.message:"Filter could not be applied"),!1}finally{this.inlineFilterApplying.set(!1)}}async addInlineFilter(t){let e=this.inlineFilterBuilderFieldId(),n=this.inlineFilterBuilderOperator();if(!e||!n||this.inlineFilterApplying())return;let o=this.inlineFilterOperators(t).find(A=>A.value===n);if(!o)return;let a;if(o.valueKind==="none")a={id:`f${++this.inlineFilterSeq}`,fieldId:e,operator:n};else if(o.valueKind==="multi-select"){let A=this.inlineFilterBuilderValues();if(A.length===0)return;a={id:`f${++this.inlineFilterSeq}`,fieldId:e,operator:n,values:[...A]}}else{let A=this.inlineFilterBuilderValue().trim();if(!A)return;let S=o.needsSecondValue?this.inlineFilterBuilderValue2().trim():void 0;if(o.needsSecondValue&&!S)return;a={id:`f${++this.inlineFilterSeq}`,fieldId:e,operator:n,value:A,value2:S}}let p=this.inlineChartKey(t),x=[...this.inlineFilters.get(p)??[],a];await this.reapplyInlineFilters(t,p,x)&&(this.inlineFilters.set(p,x),this.resetInlineFilterBuilderValues())}async removeInlineFilter(t,e){if(this.inlineFilterApplying())return;let n=this.inlineChartKey(t),o=(this.inlineFilters.get(n)??[]).filter(p=>p.id!==e);await this.reapplyInlineFilters(t,n,o)&&(o.length?this.inlineFilters.set(n,o):this.inlineFilters.delete(n))}async clearInlineFilters(t){if(this.inlineFilterApplying())return;let e=this.inlineChartKey(t);await this.reapplyInlineFilters(t,e,[]),this.inlineFilters.delete(e)}stripLeaks(t){return t.replace(/\[[\w\s]+\]\.\[[\w\s]+\]/g,"").replace(/\b(gold|dbo|public|silver|bronze)\.\w+/gi,"").replace(/\b(the\s+)?(gold|dbo|public|silver|bronze)\s+(schema|database)\b/gi,"the database").replace(/\b(found|analyzed|using|from|in)\s+\d+\s+tables?\b/gi,"").replace(/\b\d+\s+tables?\s+(found|available|returned|in the schema)\b/gi,"").replace(/\b(the\s+)?[\w]+\s+table\b/gi,e=>/[A-Z_]/.test(e)?"":e).replace(/\b(table|view)\s+(named|called)\s+[\w[\]."'`]+/gi,"").replace(/\(\s*\)/g,"").replace(/,\s*,/g,",")}cleanText(t){return this.stripLeaks(t.replace(/^#{1,6}\s+/gm,"").replace(/\*\*(.+?)\*\*/g,"$1").replace(/\*(.+?)\*/g,"$1").replace(/^\s*[-*]\s+/gm,"\u2022 ")).replace(/\n{3,}/g,`
15
+ ${e}`:e,a=this.attachments().filter(L=>L.status==="ready").map(L=>({key:L.key,name:L.name,contentType:L.contentType,size:L.size}));this.attachments.set([]);let p={id:ve(),role:"user",text:this.pendingDisplayOverride??Ii(e),answerSummary:!!this.pendingDisplayOverride,quotedText:t,charts:[],attachments:a,isStreaming:!1,hasError:!1};this.pendingDisplayOverride=null,this.messages.update(L=>[...L,p]);let x=ve();this.messages.update(L=>[...L,{id:x,role:"assistant",text:"",thinking:"Thinking",charts:[],isStreaming:!0,hasError:!1,animate:!0,tools:[{id:"thinking",callIds:["thinking"],pending:1,baseLabel:"Thinking",label:"Thinking",status:"running"}]}]),this.isStreaming.set(!0);let v=new AbortController;this.streamAbort=v,this.scrollToBottom();let A="",S="Thinking",P=[],z=!1,Q=!1,U=!1,K=new Set,X=L=>{let J=L?.queryMeta,R=J?.sql??(J?.dsl?JSON.stringify(J.dsl):L?.title??"");return`${L?.componentName??""}|${R}`},ne=()=>{if(z||P.length===0)return;z=!0;let L=P.splice(0);this.updateAssistantMsg(x,J=>({charts:[...J.charts,...L]})),this.scrollToBottom()};try{let L=this.selectedScope(),J=L?L.id:null,R=L?.kind==="pipeline";await this.svc.streamChat(this.activeConversationId(),n,{onText:V=>{A+=V,!z&&P.length>=1&&this.zone.run(()=>ne())},onToolStart:(V,$)=>{A="",S=$||"Working",this.zone.run(()=>{this.updateAssistantMsg(x,j=>({thinking:S,tools:di(j.tools??[],V,S)}))})},onToolResult:(V,$,j)=>{this.zone.run(()=>{this.updateAssistantMsg(x,H=>({tools:ci(H.tools??[],V,$,j)}))})},onDataPart:async V=>{if(V.data_type==="adhoc_viz"&&V.data){await Ln(V.data.config);let $={title:V.data.title??"Chart",componentName:V.data.componentName??"",config:V.data},j=V.data?.id,H=B=>j&&B.config?.id===j;this.zone.run(()=>{if(z){this.updateAssistantMsg(x,ce=>{let Oe=j?ce.charts.findIndex(H):-1;return{charts:Oe===-1?[...ce.charts,$]:ce.charts.map((Vi,Ri)=>Ri===Oe?$:Vi)}}),this.scrollToBottom();return}let B=j?P.findIndex(H):-1;B===-1?P.push($):P[B]=$,P.length>=2&&ne()})}},onDashboardTitle:V=>{V&&this.zone.run(()=>this.updateAssistantMsg(x,{dashboardTitle:V}))},onChoice:V=>{V?.options?.length&&this.zone.run(()=>this.updateAssistantMsg(x,$=>({choices:[...$.choices??[],V]})))},onLayoutPatch:V=>{let $=new Map((V?.layouts??[]).map(H=>[H.id,H.layout]));if(!$.size)return;let j=H=>{let B=H?.id;return B?$.get(B):void 0};for(let H of P){let B=j(H.config);B&&(H.config=T(w({},H.config),{layout:B}))}this.zone.run(()=>this.updateAssistantMsg(x,H=>({charts:H.charts.map(B=>{let ce=j(B.config);return ce?T(w({},B),{config:T(w({},B.config),{layout:ce})}):B})})))},onError:()=>{Q=!0},onFinish:(V,$)=>{U=!0,this.zone.run(()=>{ne(),this.updateAssistantMsg(x,{isStreaming:!1,thinking:void 0,text:A}),this.isStreaming.set(!1);let j=this.messages().find(B=>B.id===x);vt({finishReason:V,sawError:Q,producedContent:!!(j?.text||j?.charts.length||j?.choices?.length)})&&this.showStreamError(x),$&&!this.activeConversationId()&&(this.activeConversationId.set($),this.conversationCustomerId.set(this.customerId()),this.conversationsLoading.set(!0),this.svc.listConversations().then(B=>{this.conversations.set(B);let ce=B.find(Oe=>Oe.id===$);this.conversationConnectionId.set(ce?.connectionId??null)}).finally(()=>this.conversationsLoading.set(!1))),this.loadConversationDashboards(),this.messages().find(B=>B.id===x)?.charts.length||this.scrollToBottom()})}},J,v.signal,a,R,this.builderDashboardId())}catch(L){v.signal.aborted||L instanceof DOMException&&L.name==="AbortError"||this.zone.run(()=>this.showStreamError(x))}finally{this.zone.run(()=>{!U&&vt({sawError:Q,producedContent:!1})&&this.showStreamError(x),this.updateAssistantMsg(x,{isStreaming:!1,thinking:void 0}),this.streamAbort===v&&(this.isStreaming.set(!1),this.streamAbort=null)})}}showStreamError(t){this.messages.update(e=>_i(e,t,n=>({id:n,role:"assistant",text:"",charts:[],isStreaming:!1,hasError:!1}))),this.isStreaming.set(!1)}stopStream(){this.messages.update(t=>t.map(e=>e.isStreaming?T(w({},e),{isStreaming:!1,thinking:void 0,tools:[]}):e)),this.streamAbort?.abort(),this.isStreaming.set(!1)}openArtifact(t,e){this.artifactSourceMsgId.set(e??null),this.activeArtifactRaw.set(e?[]:t),this.bucketExtraCharts.set([]),this.forecastOverlay.set(new Map),this.loadArtifactForecastable(),this.prefetchWidgetTemplateCatalog();let n=this.mostRecentDashboardTitle(),o=t.find(a=>!this.isFilterChart(a));this.saveDashboardName.set(n||o?.title||t[0]?.title||"My Dashboard"),this.resetArtifactFilterState()}addInlineWidget(t){this.inlinePickerFor.set(null),this.addArtifactToDashboard(t)}addInlineToExisting(t,e){this.inlinePickerFor.set(null),this.addToExistingDashboard(e,t)}addInlineDefault(t){let e=this.conversationDashboards();if(!this.builderOpen()&&e.length===1){this.addInlineToExisting(t,e[0].id);return}this.addInlineWidget(t)}async addToLibrary(t){try{await this.globalWidget.add(this.artifactToWidget(t)),this.showToast("success","Saved to your widget library.")}catch{}}onSelectionChange(t){this.selectedWidgetIds.set(t)}pickGalleryPrompt(t){this.inputText.set(t),this.closeGallery()}onWelcomePromptPick(t){this.isStreaming()||(this.inputText.set(t.label),this.sendMessage())}onGalleryPromptPick(t){t?.key&&this.pickGalleryPrompt(t.key)}openGallery(){this.gallerySearch.set(""),this.galleryOpen.set(!0)}closeGallery(){this.galleryOpen.set(!1),this.gallerySearch.set("")}xrayOpen=f(!1);xraySources=f([]);xraySourcesLoading=f(!1);xraySelectedConnectionId=f(null);xraySelectedDatasetId=f(null);xrayEntities=f([]);xrayEntitiesLoading=f(!1);xrayEntitySearch=f("");xrayTopic=f("");xrayRunning=f(!1);xrayStatus=f("idle");xrayError=f(null);xrayConversationId=f(null);xrayDatasetMenuOpen=f(!1);xrayRunningEntity=f(null);xraySkeletonRows=[180,140,200,120,165,150];xraySelectedDatasetLabel=D(()=>{let t=this.xraySelectedDatasetId();return this.xrayDatasets().find(e=>e.datasetId===t)?.label??this.copy().xrayDatasetLabel});xrayEntityNoun=D(()=>{let t=this.xrayFilteredEntities(),e=t.some(o=>o.kind==="table");return t.some(o=>o.kind==="index")&&!e?this.copy().xrayIndexesNoun:this.copy().xrayTablesNoun});xrayEntityLabel(t){return t.schema?`${t.schema}.${t.name}`:t.name}xrayRunningEntityLabel=D(()=>{let t=this.xrayRunningEntity();return t?this.xrayEntityLabel(t):""});xrayDatasets=D(()=>{let t=this.xraySources(),e=new Map;for(let n of t)for(let o of n.datasets)e.set(o.name,(e.get(o.name)??0)+1);return t.flatMap(n=>n.datasets.map(o=>({datasetId:o.id,label:(e.get(o.name)??0)>1?`${o.name} \u2014 ${n.name}`:o.name,connectionId:n.id,isDefault:n.isDefault})))});xrayFilteredEntities=D(()=>{let t=this.xrayEntitySearch().trim().toLowerCase(),e=this.xrayEntities();return t?e.filter(n=>n.name.toLowerCase().includes(t)||(n.schema??"").toLowerCase().includes(t)):e});async openXray(){if(this.xrayOpen.set(!0),this.xrayError.set(null),this.xrayStatus.set("idle"),!this.xraySources().length){this.xraySourcesLoading.set(!0);try{let t=await this.svc.listXraySources();this.xraySources.set(t);let e=this.xrayDatasets(),n=e.find(o=>o.isDefault)??e[0]??null;n&&await this.selectXrayDataset(n.datasetId)}catch(t){this.xrayError.set(t instanceof Error?t.message:String(t))}finally{this.xraySourcesLoading.set(!1)}}}closeXray(){this.xrayOpen.set(!1),this.xrayEntitySearch.set(""),this.xrayError.set(null)}async selectXrayDataset(t){let e=this.xrayDatasets().find(n=>n.datasetId===t)??null;this.xraySelectedDatasetId.set(e?e.datasetId:null),this.xraySelectedConnectionId.set(e?e.connectionId:null),await this.loadXrayEntities()}async loadXrayEntities(){let t=this.xraySelectedConnectionId();if(t){this.xrayEntitiesLoading.set(!0),this.xrayEntities.set([]),this.xrayError.set(null);try{let e=await this.svc.listXrayEntities(t,this.xraySelectedDatasetId()??void 0);this.xrayEntities.set(e.entities??[])}catch(e){this.xrayError.set(e instanceof Error?e.message:String(e))}finally{this.xrayEntitiesLoading.set(!1)}}}onXrayDatasetPick(t){this.xrayDatasetMenuOpen.set(!1),this.selectXrayDataset(t)}async runXray(t){let e=this.xraySelectedConnectionId();if(!e||this.xrayRunning())return;this.xrayRunning.set(!0),this.xrayRunningEntity.set(t),this.xrayStatus.set("analyzing"),this.xrayError.set(null),this.xrayConversationId.set(null);let n=[],o=null;try{await this.svc.xrayPreviewStream(e,{entity:{kind:t.kind,schema:t.schema,name:t.name},datasetId:this.xraySelectedDatasetId()??void 0,topic:this.xrayTopic().trim()||void 0},{onProfile:()=>this.xrayStatus.set("building"),onWidget:a=>{n.push({title:a.title,componentName:a.componentName,config:a}),this.openArtifact([...n])},onConversation:a=>{this.xrayConversationId.set(a),this.selectConversation(a)},onEmpty:a=>{o=a},onError:a=>{o=a},onDone:(a,p,x)=>{x&&this.xrayConversationId.set(x)}})}catch(a){o=a instanceof Error?a.message:String(a)}finally{this.xrayRunning.set(!1),this.xrayRunningEntity.set(null)}if(n.length){this.xrayStatus.set("idle"),this.saveDashboardName.set(this.xrayDashboardName(t)),this.closeXray();let a=this.xrayConversationId();a&&await this.selectConversation(a,!0)}else this.xrayStatus.set("failed"),this.xrayError.set(o??this.copy().xrayFailed)}xrayDashboardName(t){return`A look at ${t.schema?`${t.schema}.${t.name}`:t.name}`}templateCatalogPrefetch=null;prefetchTemplateCatalog(){return this.templateCatalogPrefetch?this.templateCatalogPrefetch:(this.templateCatalogPrefetch=(async()=>{if(!this.templateCategories().length){this.templateCategoriesLoading.set(!0);try{this.templateCategories.set(await this.svc.listDashboardCategories())}catch{}finally{this.templateCategoriesLoading.set(!1)}}if(!this.templateAllTemplates().length){this.templateTemplatesLoading.set(!0);try{this.templateAllTemplates.set(await this.svc.listAllCategoryTemplates())}catch{}finally{this.templateTemplatesLoading.set(!1)}}})(),this.templateCatalogPrefetch)}selectTemplateCategory(t){this.templateActiveCategory.set(t)}widgetTemplateCatalogPrefetch=null;prefetchWidgetTemplateCatalog(){return this.widgetTemplateCatalogPrefetch?this.widgetTemplateCatalogPrefetch:(this.widgetTemplateCatalogPrefetch=(async()=>{if(!this.templateCategories().length){this.templateCategoriesLoading.set(!0);try{this.templateCategories.set(await this.svc.listDashboardCategories())}catch{}finally{this.templateCategoriesLoading.set(!1)}}if(!this.widgetTemplateAllTemplates().length){this.widgetTemplateTemplatesLoading.set(!0);try{let t=await this.svc.loadAllWidgetTemplatePreviews();this.widgetTemplateAllTemplates.set(t.map(n=>n.template));let e=new Map;for(let n of t)e.set(n.template.id,n.widget?{title:n.widget.title,componentName:n.widget.componentName,config:n.widget}:null);this.widgetTemplatePreviews.set(e)}catch{}finally{this.widgetTemplateTemplatesLoading.set(!1)}}})(),this.widgetTemplateCatalogPrefetch)}selectWidgetTemplate(t){let e=this.widgetTemplatePreviews().get(t);if(e){this.addKpiToBucket(e,t);return}this.pickWidgetTemplate(t)}addKpiToBucket(t,e){this.activeArtifact().some(o=>o.config?._meta?.templateId===e)||(this.pushCanvasHistory(),this.bucketExtraCharts.update(o=>[...o,t]),this.ensureArtifactPaneOpen(),this.closeWidgetDetailPanel())}artifactHasFilter=D(()=>this.activeArtifact().some(t=>this.isFilterChart(t)));onFiltersToggle(t){t?this.addFilterToBucket():this.removeFilterFromArtifact()}addFilterToBucket(){this.artifactHasFilter()||(this.pushCanvasHistory(),this.bucketExtraCharts.update(t=>[...t,this.buildEmptyFilterChart()]),this.ensureArtifactPaneOpen())}removeFilterFromArtifact(){let t=this.activeArtifact().find(n=>this.isFilterChart(n));if(!t)return;if(this.pushCanvasHistory(),this.bucketExtraCharts().includes(t)){this.bucketExtraCharts.update(n=>n.filter(o=>o!==t));return}let e=this.artifactSourceMsgId();e?this.updateAssistantMsg(e,n=>({charts:n.charts.filter(o=>o!==t)})):this.activeArtifactRaw.update(n=>n.filter(o=>o!==t))}buildEmptyFilterChart(){let t=un();return{title:t.title,componentName:t.componentName,config:t}}onGalleryWidgetClicked(t){this.openWidgetDetailPanelForWidget(t,!0)}async pickWidgetTemplate(t){try{let e=await this.svc.previewWidgetTemplate(t);if(e.error||!e.widget)return;let n={title:e.widget.title,componentName:e.widget.componentName,config:e.widget};this.addKpiToBucket(n,t)}catch{}}async openWidgetDetailPanelForWidget(t,e=!1){if(this.widgetDetailPanelLoading())return;let n=t.config?._meta,o=n?.templateId??null,a=n?.cohortId??null,p=n?.detailPanel??null;if(!(!o&&!p)){if(p&&!p.widgets?.length){e&&o&&this.selectWidgetTemplate(o);return}this.ensureArtifactPaneOpen(),this.widgetDetailPanelTemplateId.set(o),this.detailPanelCohortId.set(a),this.widgetDetailPanelCanAdd.set(e),this.widgetDetailPanelSourceWidgetTitle.set(t.title??null),this.widgetDetailPanelTitle.set(p?.title??null),this.widgetDetailPanelSkeletonSlots.set(Cc((p?.widgets??[]).map(x=>x.layout).filter(x=>!!x))),this.widgetDetailPanelLoading.set(!0),this.widgetDetailPanelOpen.set(!0),this.runViewTransition(()=>{});try{let x=a?await this.resolveCohortDetailPanel(a):p?await this.svc.previewWidgetDetailPanelDefinition(p):await this.svc.previewWidgetTemplateDetailPanel(o);if(!x.widgets.length){this.widgetDetailPanelOpen.set(!1);return}this.widgetDetailPanelTitle.set(x.title),this.widgetDetailPanelRaw.set(x.widgets.map(v=>({title:v.title,componentName:v.componentName,config:v})))}catch{this.widgetDetailPanelOpen.set(!1)}finally{this.widgetDetailPanelLoading.set(!1)}}}async resolveCohortDetailPanel(t){try{let[e,n]=await Promise.all([this.cohort.previewCriterion(t),this.cohort.getDetail(t)]);return this.detailPanelCohortData.set({preview:e,detail:n}),Xe(e,n)}catch{return this.detailPanelCohortData.set(null),{title:null,widgets:[],skipped:[]}}}csvField(t){return`"${String(t).replace(/"/g,'""')}"`}csvRow(t){return t.map(e=>this.csvField(e)).join(",")}exportCohortRowsCsv(){let t=this.detailPanelCohortData();if(!t)return;let{preview:e,detail:n}=t,o=[this.csvRow(["System","Events","Errors","Orphans"]),...n.systemRows.map(A=>this.csvRow([A.system,A.events,A.errors,A.orphans])),this.csvRow([n.systemRows.length<n.systemCount?`Showing top ${n.systemRows.length} of ${n.systemCount} systems`:`Showing all ${n.systemCount} systems`,`${n.eventTotal} events in total from these ${e.matchCount} people, across ALL their systems (not just the rows above)`,"",""])],a=new Blob([o.join(`\r
16
+ `)],{type:"text/csv;charset=utf-8;"}),p=URL.createObjectURL(a),x=A=>A.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"cohort",v=document.createElement("a");v.href=p,v.download=`${x(e.cohortTitle)}-${e.criterionId}-top${n.systemRows.length}-of-${n.systemCount}-systems.csv`,document.body.appendChild(v),v.click(),v.remove(),setTimeout(()=>URL.revokeObjectURL(p),0)}async copyCohortDefinition(){let t=this.detailPanelCohortData();if(!t)return;let{preview:e,detail:n}=t,o={criterionId:e.criterionId,criterionLabel:this.cohortCriteria().find(a=>a.id===e.criterionId)?.label??null,cohortTitle:e.cohortTitle,matchCount:e.matchCount,totalCount:e.totalCount,systemCount:n.systemCount,eventTotal:n.eventTotal};try{await navigator.clipboard.writeText(JSON.stringify(o,null,2)),this.showToast("success",this.copy().cohortCopyDefinitionConfirmation)}catch{}}addWidgetTemplateFromDetailPanel(){let t=this.widgetDetailPanelTemplateId();t&&(this.selectWidgetTemplate(t),this.closeWidgetDetailPanel())}replaceCanvasWithDetailPanel(){let t=this.widgetDetailPanelRaw();if(!t.length)return;let e=this.widgetDetailPanelSourceTemplateId(),n=this.widgetDetailPanelTitle();this.asOneCanvasStep(()=>{this.artifactSourceMsgId.set(null),this.activeArtifactRaw.set([...t]),this.bucketExtraCharts.set([]),this.selectedWidgetIds.set([]),e&&this.templateSourceId.set(e),n&&this.saveDashboardName.set(n),this.ensureArtifactPaneOpen()}),this.closeWidgetDetailPanel()}async openWidgetDetailPanelForTemplate(t){if(this.widgetDetailPanelLoading())return;this.ensureArtifactPaneOpen(),this.widgetDetailPanelKind.set("dashboard"),this.widgetDetailPanelTemplateId.set(null),this.widgetDetailPanelSourceWidgetTitle.set(null),this.widgetDetailPanelSourceTemplateId.set(t.id),this.widgetDetailPanelCanAdd.set(!1),this.widgetDetailPanelSelectedIds.set([]),this.widgetDetailPanelTitle.set(t.name),this.widgetDetailPanelSkeletonSlots.set([]),this.widgetDetailPanelLoading.set(!0),this.widgetDetailPanelOpen.set(!0);let e=[];try{if(await this.svc.previewCategoryTemplateStream(t.id,{onWidget:n=>{e.push({title:n.title,componentName:n.componentName,config:n})},onSkipped:()=>{},onDone:()=>{},onError:()=>{}}),!e.length){this.widgetDetailPanelOpen.set(!1);return}this.widgetDetailPanelRaw.set(e)}catch{this.widgetDetailPanelOpen.set(!1)}finally{this.widgetDetailPanelLoading.set(!1)}}isDetailPanelFullySelected(){let t=this.widgetDetailPanelWidgets(),e=this.widgetDetailPanelSelectedIds();return t.length>0&&t.every(n=>e.includes(n.id))}toggleSelectAllDetailPanelWidgets(){this.widgetDetailPanelSelectedIds.set(this.isDetailPanelFullySelected()?[]:this.widgetDetailPanelWidgets().map(t=>t.id))}addSelectedDetailPanelWidgetsToCanvas(){let t=new Set(this.widgetDetailPanelSelectedIds()),e=this.widgetDetailPanelRaw().filter((o,a)=>t.has(`detail-panel-${a}`));if(!e.length)return;let n=this.activeArtifact().length===0;this.asOneCanvasStep(()=>{if(this.ensureArtifactPaneOpen(),n){this.activeArtifactRaw.update(a=>[...a,...e]);let o=this.widgetDetailPanelSourceTemplateId();o&&this.templateSourceId.set(o)}else this.bucketExtraCharts.update(o=>[...o,...e])}),this.closeWidgetDetailPanel()}onKpiWidgetClicked(t){this.openWidgetDetailPanelForWidget(t)}closeWidgetDetailPanel(){this.widgetDetailPanelOpen()&&this.runViewTransition(()=>{this.widgetDetailPanelOpen.set(!1),this.widgetDetailPanelRaw.set([]),this.widgetDetailPanelTitle.set(null),this.widgetDetailPanelTemplateId.set(null),this.widgetDetailPanelCanAdd.set(!1),this.widgetDetailPanelSkeletonSlots.set([]),this.widgetDetailPanelKind.set("widget"),this.widgetDetailPanelSourceWidgetTitle.set(null),this.widgetDetailPanelSelectedIds.set([]),this.widgetDetailPanelSourceTemplateId.set(null),this.detailPanelCohortId.set(null),this.detailPanelCohortData.set(null)},"back")}closeArtifact(){this.artifactSourceMsgId.set(null),this.activeArtifactRaw.set([]),this.dslOnlyArtifact.set(!1),this.bucketExtraCharts.set([]),this.artifactForcedOpen.set(!1),this.templateSourceId.set(null),this.widgetTemplateSourceId.set(null),this.closeWidgetDetailPanel(),this.saveDialogOpen.set(!1),this.showAddPicker.set(!1),this.selectedWidgetIds.set([]),this.resetArtifactFilterState()}resetArtifactFilterState(){this.applyFiltersAbort?.abort(),this.applyFiltersAbort=null,this.applyFiltersSeq++,this.applyingFilters.set(!1),this.activeDashboardFilters.set(null),this.activeResolvedFilters.set(null),this.applySummary.set(null),this.filterExplanation.set(null),this.filterOverlay.set(new Map),this.filterSuggestCache.clear(),this.filterSuggestInflight.clear()}buildActiveFilters(t){return In(t,e=>this.filterFieldLabel(e))}filterFieldLabel(t){for(let e of this.filterSuggestCache.values()){let n=e.find(o=>o.type==="attribute"&&o.id===t);if(n)return n.label}return t}isEmptyFilters(t){if(!t)return!0;for(let e of Object.values(t))if(e!=null&&!(typeof e=="string"&&e.trim()==="")&&!(typeof e=="object"&&Object.keys(e).length===0))return!1;return!0}onArtifactFilterChange(t){let e=this.builderDashboardId();!e||!t.widgetId||!t.controlId||this.fetchFilterSuggestionsOnce(e,t.widgetId,t.controlId)}fetchFilterSuggestionsOnce(t,e,n){let o=this.filterSuggestCache.get(e);if(o){this.artifactGridRef?.patchFilterSuggestions(e,n,o);return}this.filterSuggestInflight.has(e)||(this.filterSuggestInflight.add(e),(async()=>{try{let a=await this.svc.filterSuggest(t,"",this.artifactWidgets(),"draft"),p=this.normalizeFilterSuggestions(a);if(!p.length)return;this.filterSuggestCache.set(e,p),this.artifactGridRef?.patchFilterSuggestions(e,n,p)}catch(a){console.warn("[ask-aquera] filter suggest failed",a)}finally{this.filterSuggestInflight.delete(e)}})())}normalizeFilterSuggestions(t){let e=Array.isArray(t.suggestions)?[...t.suggestions]:[];if(!e.length){t.nextToken&&e.push({id:t.nextToken.value,label:t.nextToken.label,type:"attribute"});for(let n of t.completions??[])e.push({label:n,type:"suggestion"})}return e}async onArtifactFilterSubmit(t){let e=this.builderDashboardId();if(!e)return;if(this.isEmptyFilters(t.filters)){this.applyFiltersAbort?.abort(),this.applyFiltersAbort=null,this.applyFiltersSeq++,this.applyingFilters.set(!1),this.activeDashboardFilters.set(null),this.activeResolvedFilters.set(null),this.applySummary.set(null),this.filterExplanation.set(null),this.filterOverlay.set(new Map);return}let n=this.artifactWidgets().filter(p=>!Ne(p));if(!n.length)return;this.applyFiltersAbort?.abort();let o=new AbortController;this.applyFiltersAbort=o;let a=++this.applyFiltersSeq;this.applyingFilters.set(!0);try{let{widgets:p,resolvedFilters:x,filterExplanation:v}=await this.svc.applyFilters(n,t.filters,e,"draft",o.signal,{mode:t.mode,prompt:t.prompt});if(a!==this.applyFiltersSeq)return;this.applyFilterResultsToOverlay(p),this.activeDashboardFilters.set(t.filters),this.activeResolvedFilters.set(x),this.applySummary.set($n(p,this.buildActiveFilters(t.filters))),this.filterExplanation.set(v)}catch(p){if(p?.name==="AbortError"||a!==this.applyFiltersSeq)return;console.error("[ask-aquera] apply filters failed",p)}finally{a===this.applyFiltersSeq&&this.applyingFilters.set(!1)}}onDslWidgetUpdated(t){t?.id&&this.filterOverlay.update(e=>{let n=new Map(e);return n.set(t.id,{config:t.config,edited:n.get(t.id)?.edited}),n})}applyFilterResultsToOverlay(t){let e=gn(this.baseArtifactWidgets(),t,o=>Ne(o)),n=new Map;for(let[o,a]of e)n.set(o,{config:a.config,edited:a.edited});this.filterOverlay.set(n)}artifactToWidget(t){let e=t.config??{};return{title:e.title??t.title,componentName:e.componentName??t.componentName,widgetType:e.widgetType??"chart",config:e.config??e,summary:e.summary,queryMeta:e.queryMeta,dataSourceId:e.dataSourceId??void 0,drilldownBy:Array.isArray(e.drilldownBy)?e.drilldownBy:[],category:e.category??null,layout:e.layout}}loadConversationDashboards(){this.dashboardsLoading.set(!0),this.svc.listDashboards(100).then(t=>this.conversationDashboards.set(t)).catch(()=>this.conversationDashboards.set([])).finally(()=>this.dashboardsLoading.set(!1))}storyPickerOpen=f(!1);storyPickerWidget=f(null);openStoryPicker(t=this.selectedArtifactCharts()){let e=t.find(n=>!this.isFilterChart(n))??t[0];e&&(this.storyPickerWidget.set(w({id:"artifact"},this.artifactToWidget(e))),this.storyPickerOpen.set(!0))}closeStoryPicker(){this.storyPickerOpen.set(!1),this.storyPickerWidget.set(null)}onAddedToStory(){this.closeStoryPicker()}async addToExistingDashboard(t,e=this.selectedArtifactCharts()){if(!(!e.length||this.committingAction())){this.savingDashboard.set(!0),this.committingAction.set("add");try{let n=await this.publishRepo.fetchDashboard(t);this.dashboardState.replaceDashboard(n);let o=Pe(e.map(a=>this.artifactToWidget(a)));this.dashboardState.addWidgets(o),this.publishRepo.saveDraft(t,this.dashboardState.snapshot).catch(()=>{}),this.builderPreseeded.set(!0),this.builderDashboardId.set(t),this.builderOpen.set(!0),this.closeArtifact()}catch{}finally{this.savingDashboard.set(!1),this.committingAction.set(null)}}}openSaveDialog(){this.saveDialogOpen.set(!0)}newDashboardName(t){let e=this.artifactSourceMsgId(),n=e?this.messages().find(a=>a.id===e)?.dashboardTitle:void 0,o=t.find(a=>!this.isFilterChart(a));return n?.trim()||o?.title?.trim()||"Untitled Dashboard"}async addArtifactToDashboard(t=this.selectedArtifactCharts()){if(!(!t.length||this.savingDashboard())){if(this.builderOpen()&&this.builderDashboardId()){let e=Pe(t.map(n=>this.artifactToWidget(n)));this.dashboardState.addWidgets(e),this.closeArtifact(),this.showToast("success","Added to your dashboard.");return}this.savingDashboard.set(!0),this.committingAction.set("add");try{let e=this.newDashboardName(t);this.dashboardState.resetDashboard(),this.dashboardState.setDashboardName(e);let n=Pe(t.map(a=>this.artifactToWidget(a)));this.dashboardState.addWidgets(n);let o=await this.svc.createDashboard(T(w({name:e,conversationId:this.activeConversationId()??void 0},this.dashboardSource()),{widgets:this.dashboardState.snapshot.widgets}));this.dashboardState.setDashboardId(o.id),this.builderPreseeded.set(!0),this.builderDashboardId.set(o.id),this.builderOpen.set(!0),this.closeArtifact()}catch{}finally{this.savingDashboard.set(!1),this.committingAction.set(null)}}}async publishAsNewDashboard(t=this.selectedArtifactCharts()){if(!(!t.length||this.savingDashboard())){this.savingDashboard.set(!0),this.committingAction.set("publish");try{let e=this.newDashboardName(t),n=Pe(t.map(o=>{let a=ve();return w({id:a},ct(this.artifactToWidget(o),a))}));await this.svc.createDashboard(T(w({name:e,conversationId:this.activeConversationId()??void 0},this.dashboardSource()),{widgets:n,published:!0})),this.showToast("success",`Published "${e}" as a new dashboard`),this.closeArtifact()}catch{}finally{this.savingDashboard.set(!1),this.committingAction.set(null)}}}closeBuilder(){this.builderOpen.set(!1),this.builderDashboardId.set(null),this.builderFullscreen.set(!1),this.dashboardState.resetDashboard()}toggleBuilderFullscreen(){this.builderFullscreen.update(t=>!t)}static MIN_CHAT_WIDTH=320;static MIN_BUILDER_WIDTH=360;resizeShell=null;startChatResize(t){t.preventDefault();let e=t.target.closest(".aq-shell");if(!e)return;let n=e.getBoundingClientRect();this.resizeShell={left:n.left,width:n.width},this.isResizing.set(!0),window.addEventListener("pointermove",this.onChatResizeMove),window.addEventListener("pointerup",this.onChatResizeEnd,{once:!0})}onChatResizeMove=t=>{let e=this.resizeShell;if(!e)return;let n=Math.max(i.MIN_CHAT_WIDTH,e.width-i.MIN_BUILDER_WIDTH),o=Math.min(i.MIN_CHAT_WIDTH,n),a=Math.max(o,Math.min(t.clientX-e.left,n));this.chatPaneWidth.set(a)};onChatResizeEnd=()=>{this.resizeShell=null,this.isResizing.set(!1),window.removeEventListener("pointermove",this.onChatResizeMove),window.removeEventListener("pointerup",this.onChatResizeEnd)};startEditDashboardTitle(){this.builderDashboardId()&&(this.dashboardTitleDraft.set(this.builderRef?.dashboardName()??""),this.editingDashboardTitle.set(!0))}cancelEditDashboardTitle(){this.editingDashboardTitle.set(!1)}async commitDashboardTitle(){if(!this.editingDashboardTitle()||this.renamingDashboard())return;let t=this.dashboardTitleDraft().trim();if(!t){this.editingDashboardTitle.set(!1);return}this.renamingDashboard.set(!0);try{await this.builderRef?.renameTo(t),this.editingDashboardTitle.set(!1)}catch{}finally{this.renamingDashboard.set(!1)}}onBuilderMenuAction(t){if(t==="fullscreen"){this.toggleBuilderFullscreen();return}if(t==="promptGallery"){this.openGallery();return}this.builderRef?.onMenuAction(t)}onBuilderPublished(t){this.showToast("success",`Dashboard "${t}" published`)}async onExecutiveSummary(t){if(this.isStreaming())return;t&&await this.restoreThreadForDashboard(t).catch(()=>{});let e=this.builderRef?.dashboardName?.(),n=this.aiExecutiveSummaryEl?.nativeElement;n&&(n.config={summary:"",buttonLabel:"Executive Summary",buttonVariant:"secondary",drawerLabel:e?`${e} Summary`:"Dashboard Summary",typingSpeed:5,closeOnEscape:!0},n.loading=!0,n.show?.()),this.isStreaming.set(!0);try{let o=await this.svc.fetchDashboardSummary(t),a=this.aiExecutiveSummaryEl?.nativeElement;a&&(a.config=T(w({},a.config??{}),{summary:o}),a.loading=!1,a.open&&a.startTyping?.())}catch(o){let a=this.aiExecutiveSummaryEl?.nativeElement,p=o instanceof Error?o.message:"Failed to generate summary.";a&&(a.config=T(w({},a.config??{}),{summary:`<p>${p}</p>`}),a.loading=!1)}finally{this.isStreaming.set(!1)}}async confirmSaveDashboard(){let t=this.saveDashboardName().trim();if(!t||this.savingDashboard())return;let e=Pe(this.activeArtifact().map(n=>{let o=ve();return w({id:o},ct(this.artifactToWidget(n),o))}));this.savingDashboard.set(!0);try{let n=await this.svc.createDashboard(T(w({name:t,conversationId:this.activeConversationId()??void 0},this.dashboardSource()),{widgets:e,sourceTemplateId:this.templateSourceId()??void 0}));await this.svc.publishDashboard(n.id),this.showToast("success",`Dashboard "${n.name}" published`),this.closeArtifact()}catch{}finally{this.savingDashboard.set(!1)}}ngOnDestroy(){this.streamAbort?.abort(),this.onChatResizeEnd()}onComposerSubmit(t){typeof t=="string"&&this.inputText.set(t),this.sendMessage()}onComposerKeydown(t){if(t.key==="Escape"){if(!this.isStreaming())return;t.preventDefault(),t.stopPropagation(),this.stopStream();return}t.key!=="Enter"||t.shiftKey||t.metaKey||t.ctrlKey||t.isComposing||(t.preventDefault(),t.stopPropagation(),this.onComposerSubmit(this.inputText()))}isDataGrid(t){let e=(t.componentName??"").toLowerCase();return e.includes("data-grid")||e.includes("datagrid")}isKpiChart(t){return(t.componentName??"").toLowerCase().includes("kpi")||t.config?.config?.chart?.type==="kpi"}inlineChartClass(t){if(this.inlineViewModeFor(t)!=="chart")return"inline-widget__chart inline-widget__chart--grid";if(!this.isKpiChart(t))return"inline-widget__chart";let e=t.config?.config?.chart?.sparkline;return`inline-widget__chart inline-widget__chart--kpi${Array.isArray(e)&&e.length>=2?" inline-widget__chart--kpi-spark":""}`}inlineFilters=new Map;inlineFilterSeq=0;inlineChartFallbackIds=new WeakMap;inlineChartFallbackIdSeq=0;inlineChartKey(t){let e=t.config?.id;if(e!=null)return String(e);let n=this.inlineChartFallbackIds.get(t);return n||(n=`chart-${++this.inlineChartFallbackIdSeq}`,this.inlineChartFallbackIds.set(t,n)),n}inlineChartRawConfig(t){return t.config?.config?.chart}inlineWidgetMenuItems(t){let e=t.charts[0];if(!e||this.isFilterChart(e))return[];let n={canChangeChartType:!0,canManageFilters:!0,canCustomizeColors:!1,canForecast:this.canForecastChart(t),hasForecast:this.canRemoveForecast(t),canSetAlert:this.canCreateAlert(e),isKpi:this.isKpiChart(e)},o=this.inlineActiveFilters(e).length,a=Vn(n).map(v=>{if(v.type==="custom"){let S=v.id==="manageFilters"&&o>0?`${v.label} (${o})`:v.label;return{key:v.id,label:S,glyph:v.glyph,divider:v.divider,method:v.method,color:v.color,kind:"custom"}}let A=v.downloadPng?"exportPng":v.downloadCsv?"exportCsv":"print";return{key:A,label:v.label??A,glyph:v.glyph,divider:v.divider,kind:A}});this.widgetMenu().ask&&a.unshift({key:"ask",label:"Ask",glyph:"smart-code",method:"fill",color:"var(--ng-colors-border-brand)",kind:"custom"}),this.isDslEditableChart(e)&&a.push({key:"editDsl",label:"Edit query",glyph:"ng-code",divider:!0,kind:"custom"});let p=this.inlineViewModeFor(e),x=this.inlineHasQueryableData(e);return p==="chart"?(a.push({key:"viewData",label:"Chart Data",glyph:"ng-table",divider:!this.isDslEditableChart(e),kind:"custom"}),x&&a.push({key:"viewRecords",label:"View Records",glyph:"ng-database",kind:"custom"})):(a.push({key:"viewChart",label:"View Chart",glyph:"ng-chart-bar",divider:!this.isDslEditableChart(e),kind:"custom"}),x&&p!=="records"&&a.push({key:"viewRecords",label:"View Records",glyph:"ng-database",kind:"custom"})),p!=="chart"?Rn(a,v=>v.key==="viewChart"||v.key==="viewRecords",v=>v.key==="setAlert"||v.kind==="exportCsv"):a}onInlineWidgetMenuItem(t,e){let n=t.charts[0];if(e.kind!=="custom"){this.runInlineChartAction(t,e.kind);return}switch(e.key){case"ask":this.inlineChartWidgets?.find(o=>o.widgetId===t.id)?.openAiChat();break;case"changeChartType":n&&this.toggleInlineChartTypePicker(n);break;case"manageFilters":n&&this.toggleInlineFilterPicker(n);break;case"setAlert":n&&this.createAlertFromChart(n);break;case"forecast":this.canRemoveForecast(t)?this.removeForecastFromChart(t):this.forecastFromChart(t);break;case"editDsl":n&&this.openArtifactForInlineDsl(t,n);break;case"viewData":n&&this.setInlineViewMode(n,"data");break;case"viewChart":n&&this.setInlineViewMode(n,"chart");break;case"viewRecords":n&&this.viewInlineRecords(t,n);break}}async onInlineAiSend(t){let n=this.messages().find(a=>a.id===t.widgetId)?.charts?.[0],o=t.chartEl;if(!n){o?.addAiResponse?.("Sorry, I couldn't process your request. Please try again.");return}try{let{content:a}=await this.svc.chatWithAdhocWidget(n,t.message,t.sessionId);o?.addAiResponse?.(a)}catch{o?.addAiResponse?.("Sorry, I couldn't process your request. Please try again.")}}async onArtifactAiSend(t){let e=this.artifactWidgets().find(o=>o.id===t.widgetId),n=t.chartEl;if(!e){n?.addAiResponse?.("Sorry, I couldn't process your request. Please try again.");return}try{let{content:o}=await this.svc.chatWithAdhocWidget(e,t.message,t.sessionId);n?.addAiResponse?.(o)}catch{n?.addAiResponse?.("Sorry, I couldn't process your request. Please try again.")}}inlineChartWidgets;async runInlineChartAction(t,e){let n=this.inlineChartWidgets?.find(o=>o.widgetId===t.id)?.chartRef?.nativeElement;try{e==="exportPng"?await n?.exportChart?.("image/png"):e==="exportCsv"?await n?.downloadCsv?.():await n?.printChart?.()}catch{}}toggleInlineChartTypePicker(t){if(this.inlineChartTypePickerFor()===t){this.closeInlineChartTypePicker();return}this.openInlineChartTypePicker(t)}toggleInlineFilterPicker(t){if(this.inlineFilterPickerFor()===t){this.closeInlineFilterBuilder();return}this.openInlineFilterBuilder(t)}inlineDataViewCache=new WeakMap;inlineDisplayConfig(t){let e=this.inlineViewModeFor(t);if(e==="data"){let o=this.inlineDataViewCache.get(t);if(o)return o;let a=T(w({},t.config?.config),{chart:this.buildInlineDataViewChart(t)});return this.inlineDataViewCache.set(t,a),a}if(e==="records"){let o=this.inlineRecordsChartFor(t);if(o)return o.config}let n=this.inlineFilterResult.get(this.inlineChartKey(t));return n?n?.config:t.config?.config}inlineViewMode=new Map;inlineRecords=new Map;inlineRecordsLoading=f(new Set);recordsFetcher=N(wn,{optional:!0});inlineViewModeFor(t){return this.inlineViewMode.get(t)??"chart"}setInlineViewMode(t,e){e==="chart"?this.inlineViewMode.delete(t):this.inlineViewMode.set(t,e)}inlineHasQueryableData(t){if(!this.recordsFetcher)return!1;let e=t.config?.config,n=!!this.chartQueryMeta(t)?.sql,o=e?.chart?.type==="grid";return n&&!o}isDslEditableChart(t){let e=this.chartQueryMeta(t);return!e?.adapterType||!["opensearch","postgres","mssql"].includes(e.adapterType)?!1:!!(e.sql||e.dsl)}openArtifactForInlineDsl(t,e){this.isDslEditableChart(e)&&(this.dslOnlyArtifact.set(!0),this.openArtifact(t.charts,t.id),setTimeout(()=>{this.artifactGridRef?.openDslEditor(`${t.id}-0`)}))}onArtifactDslEditorClosed(){this.dslOnlyArtifact()&&this.closeArtifact()}buildInlineDataViewChart(t){let e=t.config?.config?.chart??{},{columns:n,rows:o}=vn(e);if(!this.isKpiChart(t))return{type:"grid",data:o,columns:n.map(A=>({id:A,header:A,accessorKey:A,enableSorting:!0}))};let p=o[0]?.[n[0]]??null,x=bn({config:t.config?.config,queryMeta:this.chartQueryMeta(t)});return{type:"grid",data:[{field:"Value",text:p,emphasize:!0},...x.map(A=>({field:A.label,text:A.text}))],columns:[{id:"field",header:"Field",accessorKey:"field",enableSorting:!1,width:"140px",cell:A=>st`<strong>${A.value}</strong>`},{id:"text",header:"Value",accessorKey:"text",enableSorting:!1,cell:A=>{let P=A.row.emphasize?"display:block;overflow-x:auto;white-space:nowrap;font-size:22px;font-weight:700;":"display:block;overflow-x:auto;white-space:nowrap;";return st`<span style=${P}>${A.value}</span>`}}]}}chartQueryMeta(t){let e=t.config??{};return e.queryMeta??e.config?.aq?.queryMeta}inlineRecordsChartFor(t){return this.inlineRecords.get(t)??null}isInlineRecordsLoading(t){return this.inlineRecordsLoading().has(t)}async viewInlineRecords(t,e){if(this.setInlineViewMode(e,"records"),!this.recordsFetcher||this.inlineRecords.has(e))return;let n=new Set(this.inlineRecordsLoading());n.add(e),this.inlineRecordsLoading.set(n);try{let o=T(w({},this.artifactToWidget(e)),{id:t.id}),a=await this.recordsFetcher.fetch(o,void 0);this.inlineRecords.set(e,a.empty?null:a.chart)}catch{this.inlineRecords.set(e,null)}finally{let o=new Set(this.inlineRecordsLoading());o.delete(e),this.inlineRecordsLoading.set(o)}}inlineChartTypeApplyingComponent=f(null);chartTypeIcon(t){return Dn(t)}inlineSensibleChartTypes(){return this.inlineChartTypeOptions().filter(t=>t.sensible)}inlineOtherChartTypes(){return this.inlineChartTypeOptions().filter(t=>!t.sensible)}async openInlineChartTypePicker(t){let e=++this.inlineChartTypePickerSeq;this.inlineChartTypePickerFor.set(t),this.inlineChartTypeError.set(null),this.inlineChartTypeOptions.set([]),this.inlineChartTypeLoading.set(!0);try{let n=t.config,o=await this.publishRepo.listChartTypes({id:n?.id??t.title,componentName:t.componentName,queryMeta:n?.queryMeta,config:n?.config});if(e!==this.inlineChartTypePickerSeq)return;this.inlineChartTypeOptions.set(o.filter(a=>a.component!==t.componentName))}catch(n){if(e!==this.inlineChartTypePickerSeq)return;this.inlineChartTypeError.set(n instanceof Error?n.message:"Could not load chart types")}finally{e===this.inlineChartTypePickerSeq&&this.inlineChartTypeLoading.set(!1)}}closeInlineChartTypePicker(){this.inlineChartTypePickerFor.set(null),this.inlineChartTypeOptions.set([]),this.inlineChartTypeError.set(null)}async selectInlineChartType(t){let e=this.inlineChartTypePickerFor();if(!(!e||this.inlineChartTypeApplying())){this.inlineChartTypeApplying.set(!0),this.inlineChartTypeApplyingComponent.set(t),this.inlineChartTypeError.set(null);try{let n=await this.svc.changeAdhocChartType(e.config,t);this.replaceInlineChart(e,n),this.closeInlineChartTypePicker()}catch(n){this.inlineChartTypeError.set(n instanceof Error?n.message:this.copy().errors.chartTypeChangeFailed)}finally{this.inlineChartTypeApplying.set(!1),this.inlineChartTypeApplyingComponent.set(null)}}}replaceInlineChart(t,e){let n=this.inlineChartKey(t);this.inlineFilters.delete(n),this.inlineFilterFieldsCache.delete(n),this.inlineFilterBaseConfig.delete(n),this.inlineFilterResult.delete(n);let o={title:e.title??t.title,componentName:e.componentName??"",config:e};this.messages.update(a=>a.map(p=>T(w({},p),{charts:p.charts.map(x=>x===t?o:x)})))}inlineFilterBuilderFieldId=f(null);inlineFilterBuilderOperator=f(null);inlineFilterBuilderValue=f("");inlineFilterBuilderValue2=f("");inlineFilterBuilderValues=f([]);inlineFilterFieldsLoading=f(!1);inlineFilterFieldsError=f(null);inlineFilterValuesLoading=f(!1);inlineFilterApplying=f(!1);inlineFilterApplyError=f(null);inlineFilterFieldsCache=new Map;inlineFilterValuesCache=new Map;inlineFilterBaseConfig=new Map;inlineFilterResult=new Map;toggleInlineFilterMultiValue(t){this.inlineFilterBuilderValues.update(e=>e.includes(t)?e.filter(n=>n!==t):[...e,t])}resetInlineFilterBuilderValues(){this.inlineFilterBuilderValue.set(""),this.inlineFilterBuilderValue2.set(""),this.inlineFilterBuilderValues.set([])}async openInlineFilterBuilder(t){this.inlineFilterPickerFor.set(t),this.inlineFilterApplyError.set(null);let e=this.inlineChartKey(t);if(!this.inlineFilterFieldsCache.has(e)){this.inlineFilterFieldsLoading.set(!0),this.inlineFilterFieldsError.set(null);try{let o=await this.svc.listAdhocFilterFields([t.config]);this.inlineFilterFieldsCache.set(e,o)}catch(o){this.inlineFilterFieldsError.set(o instanceof Error?o.message:"Could not load filter fields")}finally{this.inlineFilterFieldsLoading.set(!1)}}let n=this.inlineFilterFields(t)[0];this.inlineFilterBuilderFieldId.set(n?.name??null),this.inlineFilterBuilderOperator.set(n?Le(n.type)[0].value:null),this.resetInlineFilterBuilderValues(),n&&this.ensureInlineFilterValuesLoaded(t,n)}closeInlineFilterBuilder(){this.inlineFilterPickerFor.set(null)}inlineFilterFields(t){return this.inlineFilterFieldsCache.get(this.inlineChartKey(t))??[]}inlineFilterSelectedField(t){return this.inlineFilterFields(t).find(e=>e.name===this.inlineFilterBuilderFieldId())}async ensureInlineFilterValuesLoaded(t,e){let n=`${this.inlineChartKey(t)}::${e.name}`;if(!(!Sn(e.type)||this.inlineFilterValuesCache.has(n))){this.inlineFilterValuesLoading.set(!0);try{let o=await this.svc.fetchAdhocFilterValues([t.config],e.name);this.inlineFilterValuesCache.set(n,o.values)}catch{this.inlineFilterValuesCache.set(n,[])}finally{this.inlineFilterValuesLoading.set(!1)}}}inlineFilterValuesFor(t){let e=this.inlineFilterPickerFor();return!t||!e?[]:this.inlineFilterValuesCache.get(`${this.inlineChartKey(e)}::${t}`)??[]}onInlineFilterFieldChange(t,e){this.inlineFilterBuilderFieldId.set(e);let n=this.inlineFilterFields(t).find(o=>o.name===e);this.inlineFilterBuilderOperator.set(n?Le(n.type)[0].value:null),this.resetInlineFilterBuilderValues(),n&&this.ensureInlineFilterValuesLoaded(t,n)}onInlineFilterOperatorChange(t){this.inlineFilterBuilderOperator.set(t),this.resetInlineFilterBuilderValues()}inlineFilterOperators(t){let e=this.inlineFilterSelectedField(t);return e?Le(e.type):[]}inlineFilterSelectedOperator(t){return this.inlineFilterOperators(t).find(e=>e.value===this.inlineFilterBuilderOperator())}inlineActiveFilters(t){return this.inlineFilters.get(this.inlineChartKey(t))??[]}inlineFilterChipLabel(t,e){let n=this.inlineFilterFields(t).find(o=>o.name===e.fieldId);return qn(e,n?.label??e.fieldId,n?.type??"string")}async reapplyInlineFilters(t,e,n){if(!n.length)return this.inlineFilterResult.delete(e),this.inlineFilterBaseConfig.delete(e),!0;let o=this.inlineFilterBaseConfig.get(e)??t.config;this.inlineFilterApplying.set(!0),this.inlineFilterApplyError.set(null);try{let a=n.map(Tn),p=await this.svc.applyAdhocFilter(o,a);return this.inlineFilterBaseConfig.set(e,o),this.inlineFilterResult.set(e,p),!0}catch(a){return this.inlineFilterApplyError.set(a instanceof Error?a.message:"Filter could not be applied"),!1}finally{this.inlineFilterApplying.set(!1)}}async addInlineFilter(t){let e=this.inlineFilterBuilderFieldId(),n=this.inlineFilterBuilderOperator();if(!e||!n||this.inlineFilterApplying())return;let o=this.inlineFilterOperators(t).find(A=>A.value===n);if(!o)return;let a;if(o.valueKind==="none")a={id:`f${++this.inlineFilterSeq}`,fieldId:e,operator:n};else if(o.valueKind==="multi-select"){let A=this.inlineFilterBuilderValues();if(A.length===0)return;a={id:`f${++this.inlineFilterSeq}`,fieldId:e,operator:n,values:[...A]}}else{let A=this.inlineFilterBuilderValue().trim();if(!A)return;let S=o.needsSecondValue?this.inlineFilterBuilderValue2().trim():void 0;if(o.needsSecondValue&&!S)return;a={id:`f${++this.inlineFilterSeq}`,fieldId:e,operator:n,value:A,value2:S}}let p=this.inlineChartKey(t),x=[...this.inlineFilters.get(p)??[],a];await this.reapplyInlineFilters(t,p,x)&&(this.inlineFilters.set(p,x),this.resetInlineFilterBuilderValues())}async removeInlineFilter(t,e){if(this.inlineFilterApplying())return;let n=this.inlineChartKey(t),o=(this.inlineFilters.get(n)??[]).filter(p=>p.id!==e);await this.reapplyInlineFilters(t,n,o)&&(o.length?this.inlineFilters.set(n,o):this.inlineFilters.delete(n))}async clearInlineFilters(t){if(this.inlineFilterApplying())return;let e=this.inlineChartKey(t);await this.reapplyInlineFilters(t,e,[]),this.inlineFilters.delete(e)}stripLeaks(t){return t.replace(/\[[\w\s]+\]\.\[[\w\s]+\]/g,"").replace(/\b(gold|dbo|public|silver|bronze)\.\w+/gi,"").replace(/\b(the\s+)?(gold|dbo|public|silver|bronze)\s+(schema|database)\b/gi,"the database").replace(/\b(found|analyzed|using|from|in)\s+\d+\s+tables?\b/gi,"").replace(/\b\d+\s+tables?\s+(found|available|returned|in the schema)\b/gi,"").replace(/\b(the\s+)?[\w]+\s+table\b/gi,e=>/[A-Z_]/.test(e)?"":e).replace(/\b(table|view)\s+(named|called)\s+[\w[\]."'`]+/gi,"").replace(/\(\s*\)/g,"").replace(/,\s*,/g,",")}cleanText(t){return this.stripLeaks(t.replace(/^#{1,6}\s+/gm,"").replace(/\*\*(.+?)\*\*/g,"$1").replace(/\*(.+?)\*/g,"$1").replace(/^\s*[-*]\s+/gm,"\u2022 ")).replace(/\n{3,}/g,`
17
17
 
18
18
  `).replace(/ {2,}/g," ").replace(/\n /g,`
19
19
  `).trim()}cleanMarkdown(t){return this.stripLeaks(t).replace(/\*{4,}/g,"").replace(/([^\n ]) {2,}/g,"$1 ").replace(/\n{3,}/g,`
20
20
 
21
- `).trim()}updateAssistantMsg(t,e){this.messages.update(n=>n.map(o=>{if(o.id!==t)return o;let a=typeof e=="function"?e(o):e;return"charts"in a&&this.forecastableMsgs.delete(t),w(w({},o),a)}))}scrollToBottom(){setTimeout(()=>this.aqChatEl?.nativeElement?.scrollToBottom?.("auto"),100)}showToast(t,e){let n=document.createElement("nile-toast");n.variant=t,n.title=e,n.duration=5e3,n.closable=!0,n.toast(),$e()}extractMessage(t,e){return We(t,e)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=ke({type:i,selectors:[["app-ask-aquera-page"]],viewQuery:function(e,n){if(e&1&&Vt(bo,5)(_t,5)(vo,5)(wo,5)(ko,5)(pt,5),e&2){let o;xe(o=ye())&&(n.aqChatEl=o.first),xe(o=ye())&&(n.builderRef=o.first),xe(o=ye())&&(n.artifactGridRef=o.first),xe(o=ye())&&(n.composerRef=o.first),xe(o=ye())&&(n.aiExecutiveSummaryEl=o.first),xe(o=ye())&&(n.inlineChartWidgets=o)}},hostBindings:function(e,n){e&1&&u("dragover",function(a){return a.preventDefault()},ot)("drop",function(a){return a.preventDefault()},ot)("selectionchange",function(){return n.onTextSelectionChange()},Ve)("wheel",function(){return n.hideQuoteBadge()},Ve)("keydown.escape",function(){return n.hideQuoteBadge()},Ve)},features:[zt([ze(be),pn(me),hn(me),wn(me),Pn(me),An(me),On(me),kn(),xn(fn.CURATED,Je),Rn(()=>null)])],decls:41,vars:40,consts:[["composerTpl",""],["widgetDetailPanelTpl",""],["dashPickerRow",""],["aqChat",""],["inlineWidgetMenu",""],["fileInput",""],["composerEl",""],["artifactGrid",""],["aiExecutiveSummary",""],[1,"aq-shell"],["type","button",1,"reply-badge",3,"reply-badge--below","top","left"],[1,"aq-chat-pane"],[1,"wfb-header"],[1,"aq-library-pane"],[1,"aq-tools-pane"],["role","separator","aria-orientation","vertical","aria-label","Resize chat panel","title","Drag to resize",1,"aq-resizer",3,"is-active"],[1,"aq-artifact-pane",3,"aq-artifact-pane--dsl-only"],[1,"aq-builder-pane"],[3,"nile-request-close","nile-hide","label"],["label","Dashboard name",3,"nile-input","keydown.enter","placeholder","value"],["slot","footer",1,"wfb-save-dialog__actions"],["variant","secondary","size","small",3,"click"],["variant","primary","size","small",3,"click"],["placement","end",1,"forecast-drawer",3,"nile-request-close","nile-hide","label","open"],["slot","label",1,"forecast-drawer__label"],["name","ng-stars-02","method","stroke","size","16","color","#7a5af8",1,"forecast-drawer__mark"],["slot","footer",1,"fs-actions"],["placement","end",1,"prompt-gallery-drawer",3,"nile-request-close","nile-hide","label","open"],["placement","end",1,"xray-drawer",3,"nile-request-close","nile-hide","label","open"],[3,"open","widget","dashboardId","source","sourceName","authoringMode"],[1,"ai-executive-summary"],[3,"open","widget"],["type","button",1,"reply-badge",3,"click"],["name","ng-reply","method","stroke","size","14"],[1,"wfb-header__left"],["variant","toggle-button",1,"aq-chat-pane__tabs",2,"--nile-nav-tab-padding","6px 14px"],[1,"wfb-header__right"],[1,"aq-scope-chip"],["placement","bottom-end","distance","6","stay-open-on-select","",1,"scope-dropdown",3,"open"],["stay-open-on-select","","placement","bottom-end","distance","6",1,"conv-dropdown",3,"nile-hide","open"],["slot","trigger","content","Conversations"],["type","button","aria-label","Conversations",1,"aq-header-action",3,"click","disabled"],["name","ng-messages-square","method","stroke","size","18"],["searchEnabled","","customSearch","",3,"nile-search-value"],[1,"list-new",3,"click"],["slot","prefix","name","ng-plus","method","stroke","size","14","color","var(--ng-colors-border-brand)"],[1,"menu-empty"],["stay-open-on-select","","placement","bottom-end","distance","6",1,"related-dropdown",3,"open"],["content","Prompt gallery"],["variant","toggle-button",1,"aq-chat-pane__tabs",2,"--nile-nav-tab-padding","6px 14px",3,"nile-tab-change"],["slot","nav","panel","chat"],["slot","nav","panel","library"],["slot","nav","panel","tools"],["method","stroke","size","12",1,"aq-scope-chip__icon",3,"name"],[1,"aq-scope-chip__text"],["type","button","aria-label","Clear scope",1,"aq-scope-chip__clear",3,"click"],["name","ng-x-close","method","stroke","size","12"],["placement","bottom-end","distance","6","stay-open-on-select","",1,"scope-dropdown",3,"nile-hide","open"],["slot","trigger","content","Add dataset or pipeline"],["type","button","aria-label","Add dataset or pipeline",1,"aq-header-action",3,"click"],["name","ng-plus","method","stroke","size","18"],["hoist","","placement","right-start","stay-open-on-select",""],["slot","trigger",1,"scope-branch"],["name","ng-database","method","stroke","size","14",1,"scope-branch__icon"],[1,"scope-branch__label"],["name","ng-chevron-right","method","stroke","size","14",1,"scope-branch__arrow"],[1,"scope-menu__loading"],["variant","text","width","160","height","14"],["variant","text","width","120","height","14"],[1,"scope-menu__empty"],[3,"click"],[1,"scope-item__name"],["slot","suffix","name","ng-check","method","stroke","size","14","color","var(--ng-colors-border-brand)"],["name","ng-dataflow-04","method","stroke","size","14",1,"scope-branch__icon"],["aria-hidden","true",1,"menu-skeleton-item"],[1,"list-row"],["variant","rounded","width","14","height","14","border-radius","4px"],[1,"list-row__text"],["variant","text","width","100%","height","14"],["variant","text","width","60%","height","12"],[1,"list-group"],["name","ng-message-square","method","stroke","size","14",1,"list-row__icon"],["type","text",1,"list-row__rename",3,"ngModel"],[1,"list-row__actions"],["type","button",1,"list-row__act",3,"click"],["name","ng-edit-02","method","stroke","size","14"],["type","button",1,"list-row__act","list-row__act--danger",3,"click"],["name","ng-trash-01","method","stroke","size","14"],["type","text",1,"list-row__rename",3,"ngModelChange","click","keydown.enter","keydown.escape","blur","ngModel"],[1,"list-row__title",3,"title"],[1,"list-row__meta"],["stay-open-on-select","","placement","bottom-end","distance","6",1,"related-dropdown",3,"nile-hide","open"],["slot","trigger","content","Dashboards"],["type","button","aria-label","Dashboards",1,"aq-header-action",3,"click"],["name","ng-grid-01","method","stroke","size","18"],["variant","text","width","58","height","12"],["name","ng-bar-chart-square-02","method","stroke","size","14","color","var(--ng-colors-text-quaternary-500)",1,"list-row__icon"],["type","button","aria-label","Prompt gallery",1,"aq-header-action",3,"click"],["name","ng-lightbulb-05","method","stroke","size","18"],[1,"aq-library-pane__head"],[1,"aq-library-pane__intro"],[1,"aq-library-pane__intro-title"],["variant","toggle-button","fullWidth","",2,"--nile-nav-tab-padding","6px 14px",3,"nile-tab-change"],["slot","nav","panel","kpis"],[1,"aq-library-pane__tab-count"],["slot","nav","panel","templates"],[1,"aq-library-pane__body"],[1,"aq-artifact-pane__picker-overlay-footer"],["type","search","clearable","",3,"nile-input","nile-change","placeholder","value"],["slot","prefix","name","ng-search","method","stroke","size","16"],[1,"aq-picker-chips"],["aria-hidden","true",1,"aq-picker-chips"],["type","button",1,"aq-picker-chip",3,"click"],[1,"aq-picker-chip__count"],["type","button",1,"aq-picker-chip",3,"aq-picker-chip--active"],["variant","rounded","width","100%","height","28","border-radius","999px",3,"width"],["variant","rounded","width","100%","height","28","border-radius","999px"],["aria-hidden","true",1,"aq-lib-skeleton"],[1,"aq-library-group"],[1,"aq-library-group__head"],["variant","text","width","88","height","11"],["variant","text","width","52","height","12"],[1,"aq-lib-cards"],[1,"aq-lib-skeleton__kpi"],["variant","text","height","15"],["variant","text","width","64","height","30"],["variant","text","width","100%","height","12"],["variant","rectangular","width","100%","height","34","border-radius","6px"],[1,"prompt-gallery-empty"],[1,"aq-library-group__label"],["type","button",1,"aq-library-group__toggle",3,"click"],[1,"aq-lib-card-wrap",3,"aq-lib-card-wrap--selected"],[1,"aq-lib-card-wrap",3,"click"],["variant","card","sparklineType","line",3,"label","description","value","loading","sparkline","options","sparklineColor"],["type","button",1,"aq-lib-card__check",3,"click"],["name","ng-check","method","stroke","size","11","color","var(--ng-colors-fg-white)"],[1,"aq-lib-cards","aq-lib-cards--dashboards"],[1,"aq-lib-skeleton__dash"],["variant","rectangular","width","100%","height","108"],[1,"aq-lib-skeleton__dash-text"],["variant","text","width","72%","height","12"],["type","button",1,"aq-lib-card","aq-lib-card--dashboard"],["type","button",1,"aq-lib-card","aq-lib-card--dashboard",3,"click"],[1,"aq-lib-card__preview"],["aria-hidden","true",1,"aq-lib-card__viz"],["aria-hidden","true",1,"aq-lib-card__viz-empty"],[1,"aq-lib-card__chip"],[1,"aq-lib-card__row"],[1,"aq-lib-card__text"],[1,"aq-lib-card__title"],[1,"aq-lib-card__desc"],["name","ng-chevron-right","method","stroke","size","14","color","var(--ng-colors-fg-quaternary-400)"],[3,"config"],[2,"height","34%"],[2,"height","62%"],[2,"height","48%"],[2,"height","78%"],[2,"height","40%"],["name","ng-grid-01","size","10","method","stroke"],[1,"aq-artifact-pane__picker-overlay-footer-count"],["slot","prefix","name","ng-plus","method","stroke","size","14","color","var(--ng-colors-fg-white)"],[1,"aq-tools-pane__head"],[1,"aq-tools-pane__badge"],["name","ng-users-01","method","stroke","size","16","color","var(--ng-colors-fg-brand-primary-600)"],[1,"aq-tools-pane__title"],[1,"aq-tools-pane__subtitle"],[1,"aq-tools-step"],[1,"aq-tools-step__num"],[1,"aq-tools-step__label"],["role","radiogroup",1,"aq-tools-criteria"],[1,"aq-tools-criteria__failed"],["aria-hidden","true",1,"aq-tools-matches","aq-tools-matches--loading"],[1,"aq-tools-matches"],[1,"aq-tools-matches","aq-tools-matches--error"],[1,"aq-tools-pane__spacer"],[1,"aq-tools-pane__footer"],[1,"aq-tools-pane__disclaimer"],[1,"aq-tools-pane__actions"],["variant","secondary",3,"click"],["slot","prefix","name","ng-eye","method","stroke","size","15"],["variant","primary",3,"click"],["slot","prefix","name","ng-plus","method","stroke","size","16","color","var(--ng-colors-fg-white)"],["aria-hidden","true",1,"aq-tools-criteria__row","aq-tools-criteria__row--skeleton"],["variant","rounded","width","8","height","8","border-radius","50%"],["variant","text","width","70%","height","14"],[1,"aq-tools-matches__error"],["type","button","role","radio",1,"aq-tools-criteria__row",3,"is-selected"],["type","button","role","radio",1,"aq-tools-criteria__row",3,"click"],[1,"aq-tools-criteria__dot"],[1,"aq-tools-criteria__label"],["variant","text","width","220","height","14"],[1,"aq-tools-matches__row","aq-tools-matches__row--skeleton"],[1,"aq-tools-matches__check"],["variant","text","width","55%","height","14"],["variant","text","width","24","height","12"],[1,"aq-tools-matches__summary"],[1,"aq-tools-matches__empty"],["role","list",1,"aq-tools-matches__list"],["role","listitem",1,"aq-tools-matches__row"],[1,"aq-tools-matches__note"],[1,"aq-tools-matches__name"],[1,"aq-tools-matches__days"],["aria-hidden","true",1,"aq-tools-matches__row","aq-tools-matches__row--skeleton"],["type","button",1,"aq-tools-matches__view-all",3,"disabled"],["type","button",1,"aq-tools-matches__view-all",3,"click","disabled"],["variant","secondary","size","small"],[1,"welcome-wrap"],[1,"aq-chat"],[1,"welcome-section"],[1,"ai-badge","ai-badge--lg"],["name","ng-stars-02","method","stroke","size","24","color","var(--ng-colors-border-brand)"],[1,"welcome-title"],[1,"welcome-sub"],[1,"welcome-composer"],[3,"ngTemplateOutlet"],["aria-hidden","true",1,"welcome-prompts-skeleton"],[1,"welcome-prompts-skeleton__item"],["variant","rounded","width","18","height","18","border-radius","4px",1,"welcome-prompts-skeleton__icon"],[1,"welcome-prompts-skeleton__label"],[1,"welcome-prompts"],[1,"prompt-gallery-row"],["type","button",1,"prompt-card",3,"prompt-card--ai"],["type","button",1,"prompt-card",3,"click"],["method","stroke","size","18",1,"prompt-card__icon"],[1,"prompt-card__label"],[1,"prompt-card__badge"],["type","button",1,"prompt-gallery-link"],["type","button",1,"prompt-gallery-link",3,"click"],["name","ng-lightbulb-05","method","stroke","size","14"],["name","ng-database-zap","method","stroke","size","14"],[1,"aq-chat",3,"mouseup"],["slot","footer",1,"input-area"],[1,"msg-skeleton","msg-skeleton--user"],["variant","rounded","width","260","height","44","border-radius","16px"],[1,"msg-skeleton","msg-skeleton--ai"],["variant","text","width","88%","height","18"],["variant","text","width","72%","height","18"],["variant","rectangular","width","100%","height","300","border-radius","12px"],["variant","rounded","width","190","height","44","border-radius","16px"],["variant","text","width","80%","height","18"],["variant","text","width","55%","height","18"],[1,"ai-bubble","ai-bubble--user",3,"role"],[1,"sent-quote"],[1,"answer-summary"],[1,"aq-sent-text"],[1,"aq-attachments","aq-attachments--sent"],["name","ng-text-quote","method","stroke","size","12"],[1,"sent-quote__text"],[1,"answer-summary__row"],["name","ng-check","method","stroke","size","14","color","var(--ng-colors-border-brand)",1,"answer-summary__check"],[1,"answer-summary__content"],[1,"answer-summary__title"],[1,"answer-summary__answer"],[1,"aq-chip","aq-chip--static"],["method","stroke","size","14",1,"aq-chip__icon"],[1,"aq-chip__name"],["max-visible","3",1,"ai-bubble__steps",3,"steps"],[1,"ai-bubble",3,"role","hideIcon"],[1,"ai-bubble__content"],[1,"choice-picker"],["type","button",1,"choice-picker__step","choice-picker__resume-chip"],[1,"inline-widget"],[1,"forecast-record"],[1,"follow-ups"],["role","alert",1,"assistant-error"],[1,"assistant-text",3,"text","speedMs"],[1,"assistant-text","assistant-text--md",3,"value"],[1,"choice-picker__step"],[1,"choice-picker__group"],[1,"choice-picker__empty"],[1,"choice-picker__group",3,"nile-change"],[1,"choice-card",3,"choice-card--chosen","choice-card--locked"],[1,"choice-card"],[1,"choice-card__label"],[1,"choice-card__num"],[1,"choice-card__text"],[1,"choice-card__badge"],[1,"choice-card__name"],[1,"choice-card__hint"],[1,"choice-card__meta"],[3,"class"],[1,"choice-picker__footer-actions"],[1,"choice-picker__chat-draft"],["type","button",1,"choice-picker__chat-link",3,"click","disabled"],["type","button",1,"choice-picker__chat-link",3,"disabled"],["type","button",1,"choice-picker__chat-link","choice-picker__chat-link--preview",3,"disabled"],["name","ng-edit-02","method","stroke","size","12"],["type","button",1,"choice-picker__chat-link","choice-picker__chat-link--preview",3,"click","disabled"],["name","ng-eye","method","stroke","size","12"],[1,"choice-picker__chat-draft-label"],[1,"choice-picker__chat-draft-row"],[1,"choice-picker__chat-draft-input",3,"nile-input","keydown.enter","value"],["type","button",1,"choice-picker__step","choice-picker__resume-chip",3,"click"],[3,"aiSend","config","loading","widgetId","conversationId"],[1,"chart-live"],[1,"chart-live","chart-live--preview"],["hoist","","placement","bottom-end","distance","6",1,"widget-header-dropdown"],["hoist","","placement","bottom-end","distance","6",1,"widget-header-dropdown",3,"open"],[1,"forecast-meta"],[1,"inline-widget__actions"],[1,"chart-live__dot"],["slot","trigger","type","button","aria-label","Chart actions",1,"widget-header-btn"],["name","ng-dots-vertical","method","stroke","size","16"],["role","separator",1,"widget-menu__sep"],[1,"widget-menu__item",3,"click"],[1,"widget-menu__label"],["size","15",3,"name","method","color"],["size","15",3,"name","method"],["hoist","","placement","bottom-end","distance","6",1,"widget-header-dropdown",3,"nile-hide","open"],["slot","trigger","aria-hidden","true",1,"widget-header-anchor"],[1,"type-picker__panel"],[1,"inline-action__loading"],[1,"inline-action__hint"],[1,"inline-action__error"],["size","16"],[1,"type-picker__section"],[1,"type-picker__grid"],["type","button",1,"type-picker__tile","type-picker__tile--sensible"],["type","button",1,"type-picker__tile","type-picker__tile--sensible",3,"click"],["method","stroke","size","16",3,"name"],["type","button",1,"type-picker__tile"],["type","button",1,"type-picker__tile",3,"click"],[1,"filter-builder__panel"],[1,"filter-builder__active"],[1,"filter-builder__chip"],["type","button",1,"filter-builder__chip-remove",3,"click"],["name","ng-x-close","method","stroke","size","10"],[1,"filter-builder__form"],[1,"filter-builder__select",3,"ngModelChange","ngModel"],[3,"value"],["size","14"],["type","text",1,"filter-builder__input",3,"placeholder","ngModel"],[1,"filter-builder__multi"],[1,"filter-builder__select",3,"ngModel"],["type","text",1,"filter-builder__input",3,"ngModelChange","keydown.enter","placeholder","ngModel"],["type","date",1,"filter-builder__input",3,"ngModelChange","ngModel"],[1,"filter-builder__and"],["type","number",1,"filter-builder__input",3,"ngModelChange","keydown.enter","placeholder","ngModel"],["type","number",1,"filter-builder__input",3,"ngModelChange","placeholder","ngModel"],[1,"filter-builder__multi-item"],["type","checkbox",3,"change","checked"],["value","","disabled",""],[1,"forecast-meta__item"],[1,"forecast-meta__label"],[1,"forecast-meta__value"],["variant","secondary","size","small",3,"click","disabled"],["variant","secondary","size","small",3,"disabled"],["variant","primary","size","small",3,"click","disabled"],["slot","prefix","name","ng-library","method","stroke","size","14"],["placement","top-end","distance","6",1,"dash-picker",3,"open"],["variant","primary","size","small"],["placement","top-end","distance","6",1,"dash-picker",3,"nile-hide","open"],["slot","trigger","variant","primary","size","small","caret","",3,"click"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"chart-card",3,"click"],[1,"chart-card__icon"],["name","ng-bar-chart-square-02","method","stroke","size","18","color","var(--ng-colors-border-brand)"],[1,"chart-card__body"],[1,"chart-card__title"],[1,"chart-card__meta"],["slot","suffix","name","ng-chevron-right","method","stroke","size","14","color","var(--ng-colors-fg-white)"],["name","clock-rewind","method","stroke","size","13","color","var(--ng-colors-text-quaternary-500)",1,"forecast-record__icon"],[1,"forecast-record__text"],["type","button",1,"forecast-record__action",3,"click","disabled"],["type","button",1,"follow-up",3,"follow-up--ai","disabled"],["type","button",1,"follow-up",3,"click","disabled"],["method","stroke","size","14",1,"follow-up__icon"],[1,"follow-up__label"],[1,"follow-up__badge"],["name","ng-alert-circle","method","stroke","size","16",1,"assistant-error__icon"],[1,"assistant-error__text"],[1,"choice-panel"],[1,"choice-panel__header"],[1,"choice-panel__count"],[1,"choice-panel__nav-group"],["type","button",1,"choice-panel__nav",3,"click"],["name","ng-chevron-left","method","stroke","size","14"],["name","ng-chevron-right","method","stroke","size","14"],["type","button",1,"choice-panel__nav","choice-panel__close",3,"click"],["name","ng-x","method","stroke","size","14"],[1,"choice-panel__options",3,"nile-change"],[1,"choice-panel-option"],[1,"choice-panel__hint"],[1,"choice-panel-option",3,"click"],[1,"choice-panel-option__label"],[1,"choice-panel-option__num"],[1,"choice-panel-option__text"],[1,"choice-panel-option__badge"],[1,"choice-panel-option__name"],[1,"choice-panel-option__hint"],["type","button",1,"choice-panel__skip",3,"click"],[1,"choice-panel__review"],[1,"choice-panel__review-row"],[1,"choice-panel__footer","choice-panel__footer--review"],[1,"choice-panel__review-title"],[1,"choice-panel__review-answer"],[1,"aq-composer-wrap",3,"dragenter","dragover","dragleave","drop"],[1,"aq-drop-overlay"],[1,"reply-quote"],[1,"aq-attachments"],["type","file","multiple","","hidden","",3,"change"],[1,"aq-composer",3,"keydown","nile-change","nile-submit","nile-stop","placeholder","hideModel","hideAddContext","rows","speechLang","value","loading"],["slot","toolbar-extras",3,"click"],["variant","ghost","size","small","title","Attach a file","aria-label","Attach a file",1,"aq-attach-btn"],["name","ng-upload-cloud-02","method","stroke","size","20"],[1,"reply-quote__text"],["type","button","aria-label","Remove quote",1,"reply-quote__dismiss",3,"click"],["name","ng-x","method","stroke","size","12"],[1,"aq-chip",3,"aq-chip--error"],[1,"aq-chip"],["size","12",1,"aq-chip__spin"],["type","button",1,"aq-chip__retry"],["type","button","aria-label","Remove attachment",1,"aq-chip__remove",3,"click"],["type","button",1,"aq-chip__retry",3,"click"],["variant","ghost","size","small","title","Attach a file","aria-label","Attach a file",1,"aq-attach-btn",3,"click"],["name","ng-paperclip","method","stroke","size","16"],["role","separator","aria-orientation","vertical","aria-label","Resize chat panel","title","Drag to resize",1,"aq-resizer",3,"pointerdown"],[1,"aq-artifact-pane"],[1,"aq-artifact-pane__header"],[1,"aq-artifact-pane__body"],[1,"aq-artifact-pane__empty"],[3,"widgets","filtersEnabled","conversationId","editMode","selectable","canSetAlert","canAddToStory","canForecast","showWidgetMenu","canAsk","canChangeChartType","canManageFilters","canCustomizeColors","canViewChartData","canExportPng","canExportCsv","canPrint","forecastable","forecastingWidgetId","showEditDslInViewMode","widgetsLoading","dashboardFilters","resolvedFilters","applySummary","filterExplanation","detailPanel","detailRootLabel"],[1,"aq-artifact-pane__footer"],[1,"aq-artifact-pane__titles"],[1,"aq-artifact-pane__title"],[1,"aq-artifact-pane__subtitle"],[1,"aq-artifact-pane__header-actions"],[1,"aq-filters-pill",3,"aq-filters-pill--active"],[1,"aq-undo-redo-group"],["aria-hidden","true",1,"aq-artifact-pane__header-divider"],["circle","","variant","ghost","size","small",3,"click"],["name","ng-x","method","stroke","size","16"],[1,"aq-filters-pill"],["name","ng-filter-lines","method","stroke","size","14",1,"aq-filters-pill__icon"],["label","Filters","textPosition","left",3,"nile-change","isChecked"],["variant","ghost","hide-border","","size","small","aria-label","Undo",3,"click"],["slot","prefix","name","ng-undo","method","stroke","size","16","color","var(--ng-colors-text-secondary-700)"],["circle","","variant","ghost","hide-border","","size","small","aria-label","Redo","title","Redo",3,"click"],["name","ng-redo","method","stroke","size","16"],["name","ng-layout-grid","method","stroke","size","28","color","var(--ng-colors-fg-quaternary-400)"],[1,"aq-artifact-pane__empty-title"],[1,"aq-artifact-pane__empty-sub"],[3,"selectionChange","forecast","setAlert","filterSubmit","filterChange","dslWidgetUpdated","dslEditorClosed","widgetClick","aiSend","widgets","filtersEnabled","conversationId","editMode","selectable","canSetAlert","canAddToStory","canForecast","showWidgetMenu","canAsk","canChangeChartType","canManageFilters","canCustomizeColors","canViewChartData","canExportPng","canExportCsv","canPrint","forecastable","forecastingWidgetId","showEditDslInViewMode","widgetsLoading","dashboardFilters","resolvedFilters","applySummary","filterExplanation","detailPanel","detailRootLabel"],["hoist","","placement","top-end","distance","6",1,"dash-picker",3,"open"],["slot","prefix","name","ng-trend-up-01","method","stroke","size","14","color","#7a5af8"],["slot","prefix","name","ng-book-open-text","method","stroke","size","14"],["hoist","","placement","top-end","distance","6",1,"dash-picker",3,"nile-hide","open"],[1,"wfb-header","aq-builder-pane__header"],["name","ng-arrow-left","method","stroke","size","16"],["variant","text","width","180","height","16"],[3,"content"],["type","button",1,"aq-header-action",3,"click"],["method","stroke","size","18"],[3,"action","canToggleFilter","hasFilter","canForecast","anyForecastOn","editMode","showFullscreen","fullscreen","busy","exporting","showPromptGallery","canPublish"],[3,"exitBuilder","executiveSummary","galleryPrompt","published","widgetClick","dashboardId","preseeded","galleryPrompts","canAddToStory","showWidgetMenu","canAsk","canChangeChartType","canManageFilters","canCustomizeColors","canViewChartData","canExportPng","canExportCsv","canPrint","canTweak","canEdit","canDelete"],["autofocus","",1,"conv-title-input",3,"input","keydown.enter","keydown.escape","value"],["content","Save name"],["type","button","aria-label","Save dashboard name",1,"aq-header-action",3,"click","disabled"],["size","14",1,"aq-header-action__spinner"],["name","ng-check","method","stroke","size","18","color","var(--ng-colors-border-brand)"],[1,"wfb-header__title"],["content","Rename dashboard"],["type","button","aria-label","Rename dashboard",1,"aq-header-action",3,"click"],["name","ng-edit-02","method","stroke","size","16"],[1,"fs-section"],["for","fs-horizon",1,"fs-label"],[1,"fs-label__value"],["id","fs-horizon","type","range","min","1","step","1",1,"fs-slider",3,"input","value"],[1,"fs-hint"],["id","fs-gran-label",1,"fs-label"],["role","radiogroup","aria-labelledby","fs-gran-label",1,"fs-segmented"],[1,"fs-segment",3,"fs-segment--on","fs-segment--off"],["for","fs-confidence",1,"fs-label"],["id","fs-confidence","type","range","min","0","step","1",1,"fs-slider","fs-slider--ai",3,"input","value"],[1,"fs-segment"],["type","radio","name","fs-granularity",1,"fs-segment__input",3,"change","value","checked","disabled"],[1,"fs-label"],[1,"fs-card","fs-card--ai"],[1,"fs-card__title"],[1,"fs-card__body"],[1,"fs-card"],["method","stroke","size","14"],["type","search","clearable","",1,"prompt-gallery-search",3,"nile-input","nile-change","placeholder","value"],["aria-hidden","true",1,"prompt-gallery-skeleton"],[1,"prompt-gallery-prompts",3,"items","vertical","wrap"],[1,"prompt-gallery-skeleton__item"],["variant","rounded","width","16","height","16","border-radius","4px"],[1,"prompt-gallery-skeleton__label"],[1,"prompt-gallery-prompts",3,"nile-item-click","items","vertical","wrap"],[1,"xray-status"],["placement","bottom-start","distance","4",1,"xray-dataset-dropdown",3,"open"],["type","search","clearable","",1,"xray-search",3,"nile-input","nile-change","placeholder","value"],[1,"xray-focus",3,"open"],[1,"xray-focus__toggle"],["name","ng-target","method","stroke","size","14"],[1,"xray-focus__input",3,"nile-input","nile-change","placeholder","value"],[1,"xray-error"],[1,"xray-running"],[1,"xray-entities"],["placement","bottom-start","distance","4",1,"xray-dataset-dropdown",3,"nile-hide","open"],["slot","trigger","type","button",1,"xray-picker",3,"click"],["name","ng-database","method","stroke","size","15"],[1,"xray-picker__label"],["name","ng-chevron-down","method","stroke","size","14",1,"xray-picker__caret"],[1,"xray-picker__item"],["name","ng-alert-circle","method","stroke","size","15"],["size","20"],[1,"xray-running__title"],[1,"xray-running__sub"],[1,"xray-entity","xray-entity--skeleton"],["variant","text","height","14",3,"width"],[1,"xray-listhead"],[1,"xray-listhead__count"],[1,"xray-listhead__hint"],["type","button",1,"xray-entity",3,"disabled","title"],["type","button",1,"xray-entity",3,"click","disabled","title"],["method","stroke","size","16",1,"xray-entity__kind",3,"name"],[1,"xray-entity__name"],[1,"xray-entity__schema"],[1,"xray-entity__meta"],[1,"xray-entity__go"],[1,"aq-detail-overlay"],[1,"aq-detail-overlay__crumbs"],[3,"nile-click"],["variant","text","width","160","height","16"],[1,"aq-detail-overlay__body"],[1,"aq-detail-overlay__caption"],[3,"widgets","editMode","selectable","selectedWidgetIds","canSetAlert","canAddToStory","canForecast","showWidgetMenu"],[1,"aq-detail-overlay__footer"],[1,"aq-detail-skeleton-grid",3,"height"],[1,"aq-detail-skeleton"],[1,"aq-detail-skeleton-grid"],["variant","rectangular","border-radius","12px","width","100%","height","100%",1,"aq-detail-skeleton-slot",3,"left","top","width","height"],["variant","rectangular","border-radius","12px","width","100%","height","100%",1,"aq-detail-skeleton-slot"],[1,"aq-detail-skeleton__row"],["variant","rectangular","width","100%","height","96","border-radius","12px"],["variant","rectangular","width","100%","height","280","border-radius","12px"],[3,"selectionChange","widgets","editMode","selectable","selectedWidgetIds","canSetAlert","canAddToStory","canForecast","showWidgetMenu"],[1,"aq-detail-overlay__select-count"],["slot","prefix","name","ng-plus","method","stroke","size","14","color","var(--ng-colors-fg-quaternary-400)"],["slot","prefix","name","ng-layout-grid","method","stroke","size","14","color","var(--ng-colors-fg-white)"],["slot","prefix","name","ng-download-01","method","stroke","size","14","color","var(--ng-colors-fg-white)"],["slot","prefix","name","ng-copy","method","stroke","size","14"],[3,"closed","saved","open","widget","dashboardId","source","sourceName","authoringMode"],[3,"closed","added","open","widget"]],template:function(e,n){if(e&1&&(s(0,"section",9),m(1,Fo,3,7,"button",10),s(2,"div",11),m(3,Ca,19,10,"header",12),m(4,Qa,21,10,"div",13),m(5,wr,36,12,"div",14),m(6,Ls,2,1),Pe(7,Ys,10,16,"ng-template",null,0,Re),d(),m(9,Ks,1,2,"div",15),m(10,ud,7,6,"aside",16),m(11,bd,15,32,"section",17),s(12,"nile-dialog",18),u("nile-request-close",function(){return n.saveDialogOpen.set(!1)})("nile-hide",function(){return n.saveDialogOpen.set(!1)}),s(13,"nile-input",19),u("nile-input",function(a){return n.saveDashboardName.set(a.detail.value)})("keydown.enter",function(){return n.confirmSaveDashboard()}),d(),s(14,"div",20)(15,"nile-button",21),u("click",function(){return n.saveDialogOpen.set(!1)}),c(16),d(),s(17,"nile-button",22),u("click",function(){return n.confirmSaveDashboard()}),c(18),d()()(),s(19,"nile-drawer",23),u("nile-request-close",function(){return n.closeForecastSettings()})("nile-hide",function(){return n.closeForecastSettings()}),s(20,"span",24),C(21,"nile-glyph",25),s(22,"span"),c(23),d()(),m(24,Sd,1,1),s(25,"div",26)(26,"nile-button",21),u("click",function(){return n.closeForecastSettings()}),c(27),d(),s(28,"nile-button",22),u("click",function(){return n.applyForecastSettings()}),c(29),d()()(),s(30,"nile-drawer",27),u("nile-request-close",function(){return n.closeGallery()})("nile-hide",function(){return n.closeGallery()}),m(31,Ed,6,3),d(),s(32,"nile-drawer",28),u("nile-request-close",function(){return n.closeXray()})("nile-hide",function(){return n.closeXray()}),m(33,Xd,3,1),d(),Pe(34,pc,1,1,"ng-template",null,1,Re),m(36,_c,1,6,"app-alert-drawer",29),m(37,gc,2,0,"nile-executive-summary",30),d(),m(38,uc,1,2,"app-story-picker-drawer",31),Pe(39,mc,7,3,"ng-template",null,2,Re)),e&2){let o,a;W("aq-shell--fullscreen",n.builderFullscreen())("aq-shell--resizing",n.isResizing()),M("data-mode",n.layoutMode()),l(),h((o=n.quoteBadge())?1:-1,o),l(),Z("flex-basis",n.chatPaneStyleWidth(),"px")("max-width",n.chatPaneStyleWidth(),"px"),l(),h(n.showHeader()?3:-1),l(),h(n.features().library&&n.chatPaneTab()==="library"?4:-1),l(),h(n.features().tools&&n.chatPaneTab()==="tools"?5:-1),l(),h(n.chatPaneTab()==="chat"?6:-1),l(3),h((n.layoutMode()==="split"||n.layoutMode()==="builder")&&!n.builderFullscreen()?9:-1),l(),h(n.artifactOpen()?10:-1),l(),h(n.builderOpen()?11:-1),l(),b("label",n.copy().saveDashboardDialogLabel),M("open",n.saveDialogOpen()?"":null),l(),b("placeholder",n.copy().dashboardNamePlaceholder)("value",n.saveDashboardName()),l(3),y(n.copy().cancelButton),l(),M("loading",n.savingDashboard()?"":null)("disabled",!n.saveDashboardName().trim()||n.savingDashboard()?"":null),l(),q(" ",n.copy().saveDashboardButton," "),l(),b("label",n.copy().forecastSettingsLabel)("open",n.forecastSettingsOpen()),l(4),y(n.copy().forecastSettingsLabel),l(),h((a=n.forecastDraft())?24:-1,a),l(3),y(n.copy().cancelButton),l(2),y(n.copy().applyButton),l(),b("label",n.copy().promptGalleryLabel)("open",n.galleryOpen()),l(),h(n.galleryOpen()?31:-1),l(),b("label",n.copy().xrayDrawerTitle)("open",n.xrayOpen()),l(),h(n.xrayOpen()?33:-1),l(3),h(n.features().alerts?36:-1),l(),h(n.features().executiveSummary?37:-1),l(),h(-1)}},dependencies:[Bt,Qe,Ye,Ke,Be,je,He,Ue,Ge,jn,Gn,pt,zn,_t,Wn,Hn],styles:['@charset "UTF-8";[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%;overflow:hidden;position:relative;font-family:var(--ng-font-family-body, "Inter", system-ui, sans-serif);background:var(--ng-colors-bg-active);color:var(--ng-colors-text-primary-900)}.wfb-page[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}.aq-header-action[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:0;outline:0;background:transparent;color:var(--ng-colors-text-tertiary-600);cursor:pointer;border-radius:6px;flex-shrink:0}.aq-header-action[_ngcontent-%COMP%]:hover, .aq-header-action[_ngcontent-%COMP%]:focus, .aq-header-action[_ngcontent-%COMP%]:focus-visible{outline:0;background:var(--ng-colors-bg-active);color:var(--ng-colors-text-primary-900)}.aq-header-action[_ngcontent-%COMP%]:disabled{opacity:.4;cursor:not-allowed}.wfb-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;box-sizing:border-box;height:var(--aq-header-h, 56px);padding:0 20px;border-bottom:1px solid var(--ng-colors-border-secondary);background:var(--ng-colors-bg-primary);flex-shrink:0;gap:12px}.wfb-header__left[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;min-width:0;flex:1 1 auto}.wfb-header__title[_ngcontent-%COMP%]{font-size:14px;font-weight:600;color:var(--ng-colors-text-primary-900);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}.wfb-header__right[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;flex-shrink:0}.aq-scope-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;max-width:220px;height:24px;padding:0 4px 0 8px;border-radius:999px;border:1px solid var(--ng-colors-border-secondary);background:var(--ng-colors-bg-secondary);color:var(--ng-colors-text-tertiary-600);font-size:12px;font-weight:500;flex-shrink:0}.aq-scope-chip__icon[_ngcontent-%COMP%]{flex-shrink:0}.aq-scope-chip__text[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.aq-scope-chip__clear[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;border:0;border-radius:50%;background:transparent;color:inherit;cursor:pointer;flex-shrink:0}.aq-scope-chip__clear[_ngcontent-%COMP%]:hover{background:var(--ng-colors-bg-active);color:var(--ng-colors-text-primary-900)}.scope-branch[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;width:100%}.scope-branch__label[_ngcontent-%COMP%]{flex:1}.scope-branch__icon[_ngcontent-%COMP%], .scope-branch__arrow[_ngcontent-%COMP%]{flex-shrink:0}.scope-menu__loading[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px;padding:8px 12px;max-width:max-content}.scope-menu__empty[_ngcontent-%COMP%]{padding:8px 12px;color:var(--ng-colors-text-tertiary-600);font-size:13px}.scope-item__name[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:240px}.conv-trigger__label[_ngcontent-%COMP%]{display:inline-block;max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle}.conv-title-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;border:none;background:transparent;padding:4px 2px 4px 6px;border-radius:6px;cursor:pointer;max-width:360px}.conv-title-btn[_ngcontent-%COMP%] .wfb-header__title[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;font-weight:400;color:var(--ng-colors-text-secondary-700)}.conv-title-btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--ng-colors-bg-tertiary)}.conv-title-btn[_ngcontent-%COMP%]:disabled{cursor:default}.conv-title-btn__edit[_ngcontent-%COMP%]{flex-shrink:0;opacity:0;transition:opacity .12s}.conv-title-btn[_ngcontent-%COMP%]:hover:not(:disabled) .conv-title-btn__edit[_ngcontent-%COMP%]{opacity:1}.conv-title-input[_ngcontent-%COMP%]{font-family:inherit;font-size:14px;font-weight:400;color:var(--ng-colors-text-secondary-700);border:1px solid var(--ng-colors-border-brand);border-radius:6px;padding:4px 8px;outline:none;min-width:220px;box-shadow:0 0 0 3px var(--ng-colors-bg-brand-primary)}.header-conn-wrap[_ngcontent-%COMP%]{position:relative}.header-conn-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;padding:5px 10px;background:var(--ng-colors-bg-primary);border:1px solid var(--ng-colors-border-primary);border-radius:8px;font-size:12px;font-weight:500;color:var(--ng-colors-text-secondary-700);cursor:pointer;transition:border-color .15s,box-shadow .15s;white-space:nowrap;max-width:200px}.header-conn-chip[_ngcontent-%COMP%]:hover:not(:disabled){border-color:var(--ng-colors-fg-quaternary-400);box-shadow:0 1px 3px #10182814}.header-conn-chip--open[_ngcontent-%COMP%]{border-color:var(--ng-colors-border-brand);box-shadow:0 0 0 3px var(--ng-colors-bg-brand-primary)}.header-conn-chip[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.header-conn-chip__label[_ngcontent-%COMP%]{flex:1;overflow:hidden;text-overflow:ellipsis;max-width:150px}.header-conn-chip__chevron[_ngcontent-%COMP%]{flex-shrink:0;transition:transform .15s}.header-conn-chip__chevron--open[_ngcontent-%COMP%]{transform:rotate(180deg)}.header-conn-chip__spinner[_ngcontent-%COMP%]{width:12px;height:12px;border:1.5px solid var(--ng-colors-border-secondary);border-top-color:var(--ng-colors-border-brand);border-radius:50%;animation:_ngcontent-%COMP%_spin .7s linear infinite;flex-shrink:0}.header-conn-dropdown[_ngcontent-%COMP%]{position:absolute;top:calc(100% + 6px);right:0;min-width:200px;background:var(--ng-colors-bg-primary);border:1px solid var(--ng-colors-border-secondary);border-radius:10px;box-shadow:0 8px 24px #1018281f;z-index:20;overflow:hidden}.header-conn-dropdown__item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:8px 12px;font-size:12px;color:var(--ng-colors-text-secondary-700);cursor:pointer;transition:background .1s}.header-conn-dropdown__item[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:1}.header-conn-dropdown__item[_ngcontent-%COMP%]:hover{background:var(--ng-colors-bg-secondary)}.header-conn-dropdown__item--active[_ngcontent-%COMP%]{background:var(--ng-colors-bg-brand-primary);color:var(--ng-colors-border-brand);font-weight:500}.header-conn-dropdown__check[_ngcontent-%COMP%]{color:var(--ng-colors-border-brand);flex-shrink:0}.header-conn-dropdown__delete[_ngcontent-%COMP%]{flex-shrink:0;opacity:0;color:var(--ng-colors-text-quaternary-500);transition:opacity .1s,color .1s}.header-conn-dropdown__item-title[_ngcontent-%COMP%]{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.header-conn-dropdown__item[_ngcontent-%COMP%]:hover .header-conn-dropdown__delete[_ngcontent-%COMP%]{opacity:1}.header-conn-dropdown__item[_ngcontent-%COMP%]:hover .header-conn-dropdown__delete[_ngcontent-%COMP%]:hover{color:var(--ng-colors-fg-error-primary)}.header-conn-dropdown__item--new[_ngcontent-%COMP%]{color:var(--ng-colors-border-brand);font-weight:500;border-bottom:1px solid var(--ng-colors-border-tertiary);padding-bottom:10px;margin-bottom:2px}.header-new-chat[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:5px;padding:5px 10px;background:transparent;border:1px solid var(--ng-colors-border-primary);border-radius:8px;font-size:12px;font-weight:500;color:var(--ng-colors-text-secondary-700);cursor:pointer;font-family:inherit;white-space:nowrap;transition:border-color .15s,background .15s}.header-new-chat[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--ng-colors-bg-secondary);border-color:var(--ng-colors-fg-quaternary-400)}.header-new-chat[_ngcontent-%COMP%]:disabled{opacity:.4;cursor:not-allowed}.ai-badge[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:50%;background:var(--ng-colors-bg-brand-primary);flex-shrink:0}.ai-badge--sm[_ngcontent-%COMP%]{width:22px;height:22px}.ai-badge--lg[_ngcontent-%COMP%]{width:48px;height:48px}.conv-dropdown[_ngcontent-%COMP%]{margin-left:-8px}.conv-dropdown[_ngcontent-%COMP%] nile-button[_ngcontent-%COMP%]::part(base){padding-left:2px;padding-right:2px}.conv-dropdown[_ngcontent-%COMP%]::part(panel){width:380px;max-width:90vw;overflow:hidden}.conv-dropdown[_ngcontent-%COMP%] nile-menu[_ngcontent-%COMP%]::part(menu__items-wrapper), .related-dropdown[_ngcontent-%COMP%] nile-menu[_ngcontent-%COMP%]::part(menu__items-wrapper), .dash-picker[_ngcontent-%COMP%] nile-menu[_ngcontent-%COMP%]::part(menu__items-wrapper){max-height:340px;overflow-x:hidden}.related-trigger__label[_ngcontent-%COMP%]{display:inline-block;max-width:0;overflow:hidden;white-space:nowrap;opacity:0;transition:max-width .2s ease,opacity .15s ease}.related-trigger[_ngcontent-%COMP%]:hover .related-trigger__label[_ngcontent-%COMP%], .related-trigger[_ngcontent-%COMP%]:focus-visible .related-trigger__label[_ngcontent-%COMP%]{max-width:120px;opacity:1}.dash-picker[_ngcontent-%COMP%]::part(panel){width:420px;max-width:92vw;overflow:hidden}.related-dropdown[_ngcontent-%COMP%]::part(panel){width:420px;max-width:90vw;overflow:hidden}.conv-dropdown[_ngcontent-%COMP%] nile-menu[_ngcontent-%COMP%], .related-dropdown[_ngcontent-%COMP%] nile-menu[_ngcontent-%COMP%], .dash-picker[_ngcontent-%COMP%] nile-menu[_ngcontent-%COMP%]{display:block;width:100%}.conv-dropdown[_ngcontent-%COMP%] nile-menu-item[_ngcontent-%COMP%], .related-dropdown[_ngcontent-%COMP%] nile-menu-item[_ngcontent-%COMP%], .dash-picker[_ngcontent-%COMP%] nile-menu-item[_ngcontent-%COMP%]{display:block;width:100%;box-sizing:border-box}.conv-dropdown[_ngcontent-%COMP%] nile-menu-item[_ngcontent-%COMP%]::part(label), .related-dropdown[_ngcontent-%COMP%] nile-menu-item[_ngcontent-%COMP%]::part(label), .dash-picker[_ngcontent-%COMP%] nile-menu-item[_ngcontent-%COMP%]::part(label){display:flex;flex:1 1 auto;min-width:0;margin:0}.conv-dropdown[_ngcontent-%COMP%] nile-menu-item[_ngcontent-%COMP%]::part(base), .related-dropdown[_ngcontent-%COMP%] nile-menu-item[_ngcontent-%COMP%]::part(base), .dash-picker[_ngcontent-%COMP%] nile-menu-item[_ngcontent-%COMP%]::part(base){width:100%;min-width:0;overflow:hidden}.conv-dropdown[_ngcontent-%COMP%] nile-menu-item.list-new[_ngcontent-%COMP%], .related-dropdown[_ngcontent-%COMP%] nile-menu-item.list-new[_ngcontent-%COMP%], .dash-picker[_ngcontent-%COMP%] nile-menu-item.list-new[_ngcontent-%COMP%]{position:sticky;top:0;z-index:2;background:var(--ng-colors-bg-primary)}.scope-menu__loading[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:10px;padding:8px 12px}.menu-empty[_ngcontent-%COMP%]{padding:10px 16px;font-size:12.5px;color:var(--ng-colors-text-tertiary-600)}.menu-skeleton-item[_ngcontent-%COMP%]{pointer-events:none}.prompt-gallery-skeleton[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px;width:100%}.prompt-gallery-skeleton__item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;padding:16px;border:1px solid var(--ng-colors-border-secondary);border-radius:10px;background:var(--ng-colors-bg-primary)}.prompt-gallery-skeleton__label[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0}.aq-header-action__spinner[_ngcontent-%COMP%]{display:inline-flex;color:var(--ng-colors-border-brand)}.conv-dropdown[_ngcontent-%COMP%] nile-menu-item[active][_ngcontent-%COMP%] .list-row__title[_ngcontent-%COMP%], .related-dropdown[_ngcontent-%COMP%] nile-menu-item[active][_ngcontent-%COMP%] .list-row__title[_ngcontent-%COMP%]{color:var(--ng-colors-fg-brand-primary-600);font-weight:600}.conv-dropdown[_ngcontent-%COMP%] nile-menu-item[active][_ngcontent-%COMP%] .list-row__icon[_ngcontent-%COMP%], .related-dropdown[_ngcontent-%COMP%] nile-menu-item[active][_ngcontent-%COMP%] .list-row__icon[_ngcontent-%COMP%]{color:var(--ng-colors-fg-brand-primary-600);opacity:1}.conv-dropdown[_ngcontent-%COMP%] nile-menu-item[active][_ngcontent-%COMP%] .list-row__meta[_ngcontent-%COMP%], .related-dropdown[_ngcontent-%COMP%] nile-menu-item[active][_ngcontent-%COMP%] .list-row__meta[_ngcontent-%COMP%]{color:var(--ng-colors-border-brand)}.list-group[_ngcontent-%COMP%]{padding:10px 8px 4px;font-size:11px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--ng-colors-fg-quaternary-400);pointer-events:none}.list-new[_ngcontent-%COMP%]{border-bottom:1px solid var(--ng-colors-border-tertiary)}.list-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;width:100%;max-width:100%;min-width:0;overflow:hidden}.list-row__icon[_ngcontent-%COMP%]{flex-shrink:0;opacity:.55;color:var(--ng-colors-text-tertiary-600)}.list-row__text[_ngcontent-%COMP%]{flex:1 1 0;min-width:0;max-width:100%;overflow:hidden;display:flex;flex-direction:column;gap:2px}.list-row__title[_ngcontent-%COMP%]{font-size:13px;line-height:18px;font-weight:500;color:var(--ng-colors-text-primary-900);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.list-row__meta[_ngcontent-%COMP%]{font-size:12px;line-height:16px;color:var(--ng-colors-text-tertiary-600);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.list-row__rename[_ngcontent-%COMP%]{width:100%;min-width:0;font:inherit;font-size:13px;font-weight:500;color:var(--ng-colors-text-primary-900);padding:1px 6px;border:1px solid var(--ng-colors-border-primary);border-radius:6px;background:var(--ng-colors-bg-primary);outline:none}.list-row__rename[_ngcontent-%COMP%]:focus{border-color:var(--ng-colors-fg-brand-primary-600)}.list-row__actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:2px;flex:0 0 auto;margin-left:auto}.list-row__act[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:0;border-radius:6px;background:transparent;color:var(--ng-colors-text-tertiary-600);opacity:.45;cursor:pointer;transition:opacity .12s,background-color .12s,color .12s}.list-row__act[_ngcontent-%COMP%]:hover{opacity:1;background:var(--ng-colors-bg-tertiary)}.list-row__act--danger[_ngcontent-%COMP%]:hover{color:var(--ng-colors-fg-error-primary)}.aq-chat[_ngcontent-%COMP%]{flex:1;min-height:0;display:block}.aq-chat[_ngcontent-%COMP%]::part(viewport){scrollbar-width:none;-ms-overflow-style:none}.aq-chat[_ngcontent-%COMP%]::part(scroll-button){display:none}.aq-chat[_ngcontent-%COMP%]::part(messages){padding:16px;display:flex;flex-direction:column;gap:16px}.aq-chat[_ngcontent-%COMP%]::part(empty){position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;overflow:auto;padding:24px 16px;box-sizing:border-box}.msg-skeleton[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:10px;align-self:flex-start}.msg-skeleton--ai[_ngcontent-%COMP%]{width:100%;max-width:100%}.msg-skeleton--user[_ngcontent-%COMP%]{align-self:flex-end;max-width:60%}nile-skeleton-loader[_ngcontent-%COMP%]::part(skeleton){background-color:var(--ng-colors-bg-quaternary);opacity:1}.welcome-wrap[_ngcontent-%COMP%]{flex:1;min-height:0;display:flex;overflow:auto}.welcome-section[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;text-align:center;gap:12px;margin:auto;width:100%;max-width:820px;padding:48px 16px}.welcome-title[_ngcontent-%COMP%]{margin:0;font-size:22px;font-weight:700;color:var(--ng-colors-text-primary-900);letter-spacing:-.02em}.welcome-sub[_ngcontent-%COMP%]{margin:0 0 4px;font-size:14px;color:var(--ng-colors-text-tertiary-600);max-width:440px;line-height:1.6}.welcome-composer[_ngcontent-%COMP%]{width:100%;margin:8px auto 4px}.aq-composer[_ngcontent-%COMP%]{display:block;width:100%}.welcome-prompts[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;width:100%}.prompt-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;width:100%;min-width:0;padding:12px 14px;border:1px solid var(--ng-colors-border-secondary);border-radius:12px;background:var(--ng-colors-bg-primary);cursor:pointer;text-align:left;font:inherit;transition:border-color .15s ease,background .15s ease,box-shadow .15s ease}.prompt-card[_ngcontent-%COMP%]:hover{border-color:var(--ng-colors-text-tertiary-on-brand);box-shadow:0 1px 2px #1018280f}.prompt-card__icon[_ngcontent-%COMP%]{flex:0 0 auto}.prompt-card__label[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0;font-size:13px;font-weight:500;line-height:1.45;color:var(--ng-colors-text-secondary-700);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.prompt-card__badge[_ngcontent-%COMP%]{flex:0 0 auto;align-self:center;padding:2px 6px;border-radius:4px;background:#7a5af8;color:var(--ng-colors-text-white);font-size:9px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;white-space:nowrap}.prompt-card--ai[_ngcontent-%COMP%]{border-color:#d9d0fd;background:#fbfaff}.prompt-card--ai[_ngcontent-%COMP%]:hover{border-color:#b9a6fb}.forecast-drawer[_ngcontent-%COMP%]{--size: 420px}.forecast-drawer[_ngcontent-%COMP%]::part(header){align-items:center;padding:0 12px 0 16px;border-bottom:1px solid var(--ng-colors-border-secondary)}.forecast-drawer[_ngcontent-%COMP%]::part(title){display:flex;align-items:center;gap:8px;font-size:15px;font-weight:600;color:var(--ng-colors-text-primary-900)}.forecast-drawer[_ngcontent-%COMP%]::part(body){display:flex;flex-direction:column;gap:22px;padding:20px 16px}.forecast-drawer[_ngcontent-%COMP%]::part(footer){border-top:1px solid var(--ng-colors-border-secondary);padding:12px 16px}.forecast-drawer__label[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:8px;font-size:15px;font-weight:600;color:var(--ng-colors-text-primary-900)}.forecast-drawer__mark[_ngcontent-%COMP%]{flex:0 0 auto}.fs-section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:10px}.fs-label[_ngcontent-%COMP%]{font-size:13px;font-weight:600;color:var(--ng-colors-text-secondary-700)}.fs-label__value[_ngcontent-%COMP%]{color:#5925dc}.fs-hint[_ngcontent-%COMP%]{margin:0;font-size:11px;line-height:1.5;color:var(--ng-colors-text-quaternary-500)}.fs-slider[_ngcontent-%COMP%]{appearance:none;width:100%;height:6px;margin:2px 0;border-radius:3px;background:var(--ng-colors-border-secondary);cursor:pointer;background-image:linear-gradient(var(--ng-colors-border-brand),var(--ng-colors-border-brand));background-repeat:no-repeat;background-size:var(--fs-fill, 50%) 100%}.fs-slider--ai[_ngcontent-%COMP%]{background-image:linear-gradient(#7a5af8,#7a5af8)}.fs-slider[_ngcontent-%COMP%]::-webkit-slider-thumb{appearance:none;width:16px;height:16px;border:2px solid var(--ng-colors-bg-primary);border-radius:50%;background:var(--ng-colors-border-brand);box-shadow:0 1px 3px #10182833}.fs-slider--ai[_ngcontent-%COMP%]::-webkit-slider-thumb{background:#7a5af8}.fs-slider[_ngcontent-%COMP%]::-moz-range-thumb{width:14px;height:14px;border:2px solid var(--ng-colors-bg-primary);border-radius:50%;background:var(--ng-colors-border-brand);box-shadow:0 1px 3px #10182833}.fs-slider--ai[_ngcontent-%COMP%]::-moz-range-thumb{background:#7a5af8}.fs-slider[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--ng-colors-border-brand);outline-offset:3px}.fs-segmented[_ngcontent-%COMP%]{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;gap:2px;padding:3px;border:1px solid var(--ng-colors-border-secondary);border-radius:8px;background:var(--ng-colors-bg-secondary)}.fs-segment[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;padding:6px 4px;border-radius:6px;cursor:pointer;font-size:12px;font-weight:500;color:var(--ng-colors-text-tertiary-600);white-space:nowrap;transition:background .15s ease,color .15s ease}.fs-segment__input[_ngcontent-%COMP%]{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}.fs-segment[_ngcontent-%COMP%]:hover{color:var(--ng-colors-text-primary-900)}.fs-segment--on[_ngcontent-%COMP%]{background:var(--ng-colors-border-brand);color:var(--ng-colors-text-white);font-weight:600}.fs-segment--on[_ngcontent-%COMP%]:hover{color:var(--ng-colors-text-white)}.fs-segment--off[_ngcontent-%COMP%]{color:var(--ng-colors-fg-disabled);cursor:not-allowed}.fs-segment--off[_ngcontent-%COMP%]:hover{color:var(--ng-colors-fg-disabled)}.fs-segment[_ngcontent-%COMP%]:has(.fs-segment__input:focus-visible){outline:2px solid var(--ng-colors-border-brand);outline-offset:1px}.fs-card[_ngcontent-%COMP%]{padding:12px 14px;border:1px solid var(--ng-colors-border-secondary);border-radius:10px;background:var(--ng-colors-bg-secondary)}.fs-card__title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;margin:0 0 4px;font-size:12px;font-weight:600;color:var(--ng-colors-text-secondary-700)}.fs-card__body[_ngcontent-%COMP%]{margin:0;font-size:11px;line-height:1.6;color:var(--ng-colors-text-tertiary-600)}.fs-card--ai[_ngcontent-%COMP%]{border-color:#d9d0fd;background:#fbfaff}.fs-card--ai[_ngcontent-%COMP%] .fs-card__title[_ngcontent-%COMP%]{color:#5925dc}.fs-card--pass[_ngcontent-%COMP%]{border-color:var(--ng-colors-border-success-subtle);background:var(--ng-colors-bg-success-primary)}.fs-card--pass[_ngcontent-%COMP%] .fs-card__title[_ngcontent-%COMP%]{color:var(--ng-colors-fg-success-primary)}.fs-card--warn[_ngcontent-%COMP%]{border-color:var(--ng-colors-bg-warning-secondary);background:var(--ng-colors-bg-warning-primary)}.fs-card--warn[_ngcontent-%COMP%] .fs-card__title[_ngcontent-%COMP%]{color:var(--ng-colors-fg-warning-primary)}.fs-actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:8px}.aq-detail-overlay[_ngcontent-%COMP%]{position:absolute;inset:0;z-index:50;display:flex;flex-direction:column;background:var(--ng-colors-bg-primary);animation:_ngcontent-%COMP%_aq-slide-in .16s ease}.aq-detail-overlay__crumbs[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px;box-sizing:border-box;height:var(--aq-header-h, 56px);padding:0 20px;border-bottom:1px solid var(--ng-colors-border-secondary);flex-shrink:0}.aq-detail-overlay__crumbs[_ngcontent-%COMP%] nile-breadcrumb[_ngcontent-%COMP%]{display:inline-flex;align-items:center}.aq-detail-overlay__body[_ngcontent-%COMP%]{flex:1 1 auto;min-height:0;overflow:auto;scrollbar-width:none;-ms-overflow-style:none;padding:20px;background:var(--ng-colors-bg-secondary)}.aq-detail-overlay__body[_ngcontent-%COMP%]::-webkit-scrollbar{width:0;height:0}.aq-detail-overlay__footer[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;gap:8px;padding:12px 20px;border-top:1px solid var(--ng-colors-border-secondary);background:var(--ng-colors-bg-primary);flex-shrink:0}.aq-detail-overlay__select-count[_ngcontent-%COMP%]{margin-right:auto;font-size:13px;font-weight:500;color:var(--ng-colors-text-secondary-700)}.aq-detail-overlay__caption[_ngcontent-%COMP%]{margin:0 0 16px;font-size:13px;color:var(--ng-colors-text-tertiary-600)}.aq-detail-skeleton[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px}.aq-detail-skeleton__row[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}.aq-detail-skeleton-grid[_ngcontent-%COMP%]{position:relative;width:100%}.aq-detail-skeleton-slot[_ngcontent-%COMP%]{position:absolute}.aq-detail-skeleton-slot[_ngcontent-%COMP%]::part(base){height:100%}.prompt-gallery-prompts[_ngcontent-%COMP%]{width:100%}.prompt-gallery-prompts[_ngcontent-%COMP%]::part(item-label){font-weight:500}.ai-bubble__steps[_ngcontent-%COMP%]{display:block;width:100%;box-sizing:border-box;margin-bottom:12px;padding:12px 16px}.wfb-suggestions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:10px;justify-content:center;margin-top:8px}.wfb-suggestions-loading[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;margin-top:12px}.suggestions-spinner[_ngcontent-%COMP%]{width:16px;height:16px;border:2px solid var(--ng-colors-border-secondary);border-top-color:var(--ng-colors-border-brand);border-radius:50%;animation:_ngcontent-%COMP%_spin .7s linear infinite;flex-shrink:0}.suggestions-loading-content[_ngcontent-%COMP%]{display:flex;align-items:baseline;gap:2px}.suggestions-loading-text[_ngcontent-%COMP%]{color:var(--ng-colors-text-quaternary-500);font-size:13px;font-style:italic}.suggestions-loading-dots[_ngcontent-%COMP%]{display:inline-flex;gap:1px}.suggestions-loading-dots[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:var(--ng-colors-text-quaternary-500);font-size:13px;animation:_ngcontent-%COMP%_dot-fade 1.4s ease-in-out infinite}.suggestions-loading-dots[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(2){animation-delay:.2s}.suggestions-loading-dots[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(3){animation-delay:.4s}@keyframes _ngcontent-%COMP%_dot-fade{0%,80%,to{opacity:.2}40%{opacity:1}}.welcome-prompts-skeleton[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;width:100%}.welcome-prompts-skeleton__item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;padding:12px 14px;border:1px solid var(--ng-colors-border-secondary);border-radius:12px;background:var(--ng-colors-bg-primary)}.welcome-prompts-skeleton__icon[_ngcontent-%COMP%]{flex:0 0 auto}.welcome-prompts-skeleton__label[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0;max-width:70%}.prompt-gallery-row[_ngcontent-%COMP%]{width:100%;margin:2px auto 0;display:flex;justify-content:flex-end;gap:16px}.prompt-gallery-link[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;border:0;background:transparent;padding:2px 0;cursor:pointer;font:inherit;font-size:13px;font-weight:400;color:var(--ng-colors-border-brand)}.prompt-gallery-link[_ngcontent-%COMP%] nile-glyph[_ngcontent-%COMP%]{color:var(--ng-colors-border-brand)}.prompt-gallery-link[_ngcontent-%COMP%]:hover span[_ngcontent-%COMP%]{text-decoration:underline}.prompt-gallery-drawer[_ngcontent-%COMP%]{--size: calc(100vw - 248px) }.prompt-gallery-drawer[_ngcontent-%COMP%]::part(header){height:var(--aq-header-h, 56px);align-items:center;padding:0 16px;border-bottom:1px solid var(--ng-colors-border-secondary)}.prompt-gallery-drawer[_ngcontent-%COMP%]::part(title){font-size:16px;font-weight:600;color:var(--ng-colors-text-primary-900)}.prompt-gallery-drawer[_ngcontent-%COMP%]::part(body){display:flex;flex-direction:column;gap:14px}.prompt-gallery-search[_ngcontent-%COMP%]{width:100%;flex-shrink:0}.xray-drawer[_ngcontent-%COMP%]{--size: 420px}.xray-drawer[_ngcontent-%COMP%]::part(header){height:var(--aq-header-h, 56px);align-items:center;padding:0 16px;border-bottom:1px solid var(--ng-colors-border-secondary)}.xray-drawer[_ngcontent-%COMP%]::part(title){font-size:16px;font-weight:600;color:var(--ng-colors-text-primary-900)}.xray-drawer[_ngcontent-%COMP%]::part(body){display:flex;flex-direction:column;gap:12px}.xray-dataset-dropdown[_ngcontent-%COMP%]{flex-shrink:0}.xray-picker[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;width:100%;padding:9px 12px;border:1px solid var(--ng-colors-border-secondary);border-radius:8px;background:var(--ng-colors-bg-primary);cursor:pointer;font:inherit;font-size:13px;color:var(--ng-colors-text-primary-900)}.xray-picker[_ngcontent-%COMP%] nile-glyph[_ngcontent-%COMP%]{color:var(--ng-colors-text-quaternary-500)}.xray-picker[_ngcontent-%COMP%]:hover{border-color:var(--ng-colors-border-brand)}.xray-picker__label[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;font-weight:500}.xray-picker__caret[_ngcontent-%COMP%]{flex-shrink:0}.xray-picker__item[_ngcontent-%COMP%]{font-size:13px}.xray-search[_ngcontent-%COMP%]{width:100%;flex-shrink:0}.xray-focus[_ngcontent-%COMP%]{flex-shrink:0}.xray-focus__toggle[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;cursor:pointer;list-style:none;padding:2px 0;font-size:12px;color:var(--ng-colors-text-quaternary-500);-webkit-user-select:none;user-select:none}.xray-focus__toggle[_ngcontent-%COMP%]::-webkit-details-marker{display:none}.xray-focus__toggle[_ngcontent-%COMP%] nile-glyph[_ngcontent-%COMP%]{color:inherit}.xray-focus__toggle[_ngcontent-%COMP%]:hover{color:var(--ng-colors-border-brand)}.xray-focus__input[_ngcontent-%COMP%]{width:100%;margin-top:6px}.xray-error[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:8px;font-size:13px;color:var(--ng-colors-text-error-primary, #b42318);background:var(--ng-colors-bg-error-primary, rgba(180, 35, 24, .06));border-radius:8px;padding:9px 11px;flex-shrink:0}.xray-error[_ngcontent-%COMP%] nile-glyph[_ngcontent-%COMP%]{flex-shrink:0;margin-top:1px;color:inherit}.xray-status[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--ng-colors-text-quaternary-500);padding:4px 0;flex-shrink:0}.xray-running[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;flex:1 1 auto;min-height:220px;text-align:center}.xray-running__title[_ngcontent-%COMP%]{margin:0;font-size:14px;font-weight:500;color:var(--ng-colors-text-primary-900)}.xray-running__sub[_ngcontent-%COMP%]{margin:0;font-size:12px;font-family:var(--ng-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);color:var(--ng-colors-text-quaternary-500)}.xray-listhead[_ngcontent-%COMP%]{display:flex;align-items:baseline;justify-content:space-between;gap:8px;flex-shrink:0;padding:2px 2px 0}.xray-listhead__count[_ngcontent-%COMP%]{font-size:12px;font-weight:600;letter-spacing:.03em;text-transform:uppercase;color:var(--ng-colors-text-quaternary-500)}.xray-listhead__hint[_ngcontent-%COMP%]{font-size:12px;color:var(--ng-colors-text-quaternary-500)}.xray-entities[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px;overflow-y:auto;min-height:0;flex:1 1 auto}.xray-entity[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;width:100%;padding:9px 10px;border:1px solid transparent;border-radius:8px;background:transparent;cursor:pointer;font:inherit;font-size:13px;color:var(--ng-colors-text-primary-900);text-align:left}.xray-entity[_ngcontent-%COMP%] nile-glyph[_ngcontent-%COMP%]{flex-shrink:0}.xray-entity[_ngcontent-%COMP%] .xray-entity__kind[_ngcontent-%COMP%]{color:var(--ng-colors-text-quaternary-500)}.xray-entity[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--ng-colors-bg-secondary, rgba(0, 0, 0, .035));border-color:var(--ng-colors-border-secondary)}.xray-entity[_ngcontent-%COMP%]:hover:not(:disabled) .xray-entity__go[_ngcontent-%COMP%]{opacity:1}.xray-entity[_ngcontent-%COMP%]:hover:not(:disabled) .xray-entity__meta[_ngcontent-%COMP%]{opacity:0}.xray-entity[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--ng-colors-border-brand);outline-offset:-1px}.xray-entity[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:default}.xray-entity--skeleton[_ngcontent-%COMP%]{cursor:default;gap:10px}.xray-entity__name[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.xray-entity__schema[_ngcontent-%COMP%]{color:var(--ng-colors-text-quaternary-500)}.xray-entity__meta[_ngcontent-%COMP%]{flex-shrink:0;font-size:11px;color:var(--ng-colors-text-quaternary-500);font-variant-numeric:tabular-nums;transition:opacity .12s ease}.xray-entity__go[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:5px;flex-shrink:0;opacity:0;transition:opacity .12s ease;font-size:12px;font-weight:500;color:var(--ng-colors-border-brand)}.xray-entity__go[_ngcontent-%COMP%] nile-glyph[_ngcontent-%COMP%]{color:inherit}.xray-drawer[_ngcontent-%COMP%]::part(body){overflow:hidden}.prompt-gallery-empty[_ngcontent-%COMP%]{color:var(--ng-colors-text-quaternary-500);font-size:13px;padding:24px 4px}.prompt-gallery-list[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:12px;align-content:start}.prompt-gallery-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;width:100%;border:1px solid var(--ng-colors-border-secondary);border-radius:12px;padding:12px 16px;background:var(--ng-colors-bg-primary);cursor:pointer;text-align:left;font:inherit;font-size:13px;font-weight:500;color:var(--ng-colors-text-secondary-700);line-height:1.4;transition:border-color .18s,box-shadow .18s}.prompt-gallery-item[_ngcontent-%COMP%]:hover{border-color:var(--ng-colors-border-brand);box-shadow:0 6px 24px var(--ng-colors-bg-brand-primary)}.aq-library-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px}.aq-library-group__head[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}.aq-library-group__label[_ngcontent-%COMP%]{font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--ng-colors-text-quaternary-500)}.aq-library-group__toggle[_ngcontent-%COMP%]{border:none;background:none;padding:0;font:inherit;font-size:12px;font-weight:600;color:var(--ng-colors-fg-brand-primary-600);cursor:pointer}.aq-library-group__toggle[_ngcontent-%COMP%]:hover{text-decoration:underline}.aq-lib-cards[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px}.aq-lib-cards--dashboards[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fit,minmax(232px,1fr));gap:10px}.aq-lib-card-wrap[_ngcontent-%COMP%]{position:relative;cursor:pointer;border-radius:10px;transition:box-shadow .15s}.aq-lib-card-wrap[_ngcontent-%COMP%] nile-kpi-chart[_ngcontent-%COMP%]{display:block;height:172px;box-sizing:border-box}.aq-lib-card-wrap--selected[_ngcontent-%COMP%]{box-shadow:0 0 0 3px var(--ng-colors-bg-brand-secondary);border-radius:10px}.aq-lib-card[_ngcontent-%COMP%]{cursor:pointer;padding:13px 14px;border-radius:10px;background:var(--ng-colors-bg-primary);border:1.5px solid var(--ng-colors-border-secondary);box-shadow:0 1px 2px #0f172a08;transition:border-color .15s,box-shadow .15s}.aq-lib-card[_ngcontent-%COMP%]:hover{border-color:var(--ng-colors-bg-brand-secondary)}.aq-lib-card--dashboard[_ngcontent-%COMP%]{display:block;width:100%;padding:0;overflow:hidden;text-align:left;font:inherit;color:inherit}.aq-lib-card--dashboard[_ngcontent-%COMP%] .aq-lib-card__row[_ngcontent-%COMP%]{align-items:center;padding:11px 13px 12px}.aq-lib-skeleton[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px}.aq-lib-skeleton__kpi[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:10px;height:172px;box-sizing:border-box;padding:16px;border-radius:10px;background:var(--ng-colors-bg-primary);border:1px solid var(--ng-colors-border-secondary);box-shadow:0 1px 2px #0f172a08}.aq-lib-skeleton__kpi[_ngcontent-%COMP%] nile-skeleton-loader[_ngcontent-%COMP%]:last-child{margin-top:auto}.aq-lib-skeleton__dash[_ngcontent-%COMP%]{border-radius:10px;overflow:hidden;background:var(--ng-colors-bg-primary);border:1px solid var(--ng-colors-border-secondary);box-shadow:0 1px 2px #0f172a08}.aq-lib-skeleton__dash-text[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px;padding:13px 14px}.aq-lib-card__preview[_ngcontent-%COMP%]{position:relative;height:108px;background:linear-gradient(180deg,var(--ng-colors-bg-secondary-subtle) 0%,var(--ng-colors-bg-secondary) 100%);border-bottom:1px solid var(--ng-colors-border-secondary)}.aq-lib-card__viz[_ngcontent-%COMP%]{position:absolute;inset:6px 8px 4px;pointer-events:none}.aq-lib-card__viz-empty[_ngcontent-%COMP%]{position:absolute;inset:0;display:flex;align-items:flex-end;justify-content:center;gap:7px;padding:18px}.aq-lib-card__viz-empty[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:0 0 14px;border-radius:3px 3px 0 0;background:var(--ng-colors-bg-quaternary)}.aq-lib-card__chip[_ngcontent-%COMP%]{position:absolute;top:8px;right:8px;display:inline-flex;align-items:center;gap:4px;padding:2px 7px;border-radius:5px;background:var(--ng-colors-bg-primary);border:1px solid var(--ng-colors-border-secondary);font-size:10.5px;font-weight:600;color:var(--ng-colors-text-tertiary-600)}.aq-lib-card__row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:10px}.aq-lib-card__text[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0}.aq-lib-card__title[_ngcontent-%COMP%]{font-size:13px;font-weight:500;letter-spacing:-.01em;line-height:1.35;color:var(--ng-colors-text-primary-900)}.aq-lib-card__title-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:7px}.aq-lib-card__badge[_ngcontent-%COMP%]{flex-shrink:0;font-size:10.5px;font-weight:600;color:var(--ng-colors-text-tertiary-600);background:var(--ng-colors-bg-quaternary);border-radius:5px;padding:2px 6px}.aq-lib-card__desc[_ngcontent-%COMP%]{font-size:11.5px;color:var(--ng-colors-text-quaternary-500);line-height:1.45;margin-top:3px}.aq-lib-card__check[_ngcontent-%COMP%]{position:absolute;top:12px;right:12px;z-index:1;flex:0 0 18px;width:18px;height:18px;border-radius:5px;border:1.5px solid var(--ng-colors-border-primary);background:var(--ng-colors-bg-primary);display:flex;align-items:center;justify-content:center;cursor:pointer;padding:0}.aq-lib-card__check[_ngcontent-%COMP%] nile-glyph[_ngcontent-%COMP%]{opacity:0}.aq-lib-card__check--on[_ngcontent-%COMP%]{border-color:var(--ng-colors-border-brand-alt);background:var(--ng-colors-bg-brand-solid)}.aq-lib-card__check--on[_ngcontent-%COMP%] nile-glyph[_ngcontent-%COMP%]{opacity:1}.ai-bubble[_ngcontent-%COMP%]{display:block;width:100%;max-width:100%;margin-inline:auto}.ai-bubble__content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px}.aq-sent-text[_ngcontent-%COMP%]{white-space:pre-line}.sent-quote[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:6px;margin-bottom:6px;padding:6px 8px;border-radius:8px;border-left:3px solid var(--ng-colors-border-brand-alt);background:var(--ng-colors-bg-brand-primary);color:var(--ng-colors-text-tertiary-600);font-size:12px;line-height:1.4}.sent-quote[_ngcontent-%COMP%] nile-glyph[_ngcontent-%COMP%]{flex:0 0 auto;margin-top:2px;color:var(--ng-colors-fg-brand-primary-600)}.answer-summary[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:6px}.answer-summary__row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:8px}.answer-summary__check[_ngcontent-%COMP%]{flex:0 0 auto;margin-top:2px}.answer-summary__content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px;min-width:0}.answer-summary__title[_ngcontent-%COMP%]{font-size:13.5px;font-weight:400;color:var(--ng-colors-text-primary-900)}.answer-summary__answer[_ngcontent-%COMP%]{font-size:12.5px;font-weight:500;color:var(--ng-colors-text-tertiary-600)}.answer-summary__answer[_ngcontent-%COMP%]:before{content:"\\2014 "}.sent-quote__text[_ngcontent-%COMP%]{overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.ai-bubble[_ngcontent-%COMP%]::part(thinking){border:none;padding-left:2px;font-size:12px}.ai-bubble[_ngcontent-%COMP%]::part(base), .ai-bubble[_ngcontent-%COMP%]::part(bubble){transition:max-width .22s ease,width .22s ease}.assistant-text[_ngcontent-%COMP%]{display:block;max-width:680px}.user-row[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;align-items:flex-start;gap:8px;width:100%;max-width:860px;margin-inline:auto}.user-icon[_ngcontent-%COMP%]{order:2;display:flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:50%;background:var(--ng-colors-bg-tertiary);flex-shrink:0;margin-top:2px}.user-bubble[_ngcontent-%COMP%]{order:1;background:var(--ng-colors-border-brand);border-radius:12px 2px 12px 12px;padding:10px 14px;font-size:14px;color:var(--ng-colors-text-white);max-width:70%;white-space:pre-wrap;word-break:break-word}.assistant-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:10px;width:100%;max-width:860px;margin-inline:auto}.assistant-icon[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:50%;background:var(--ng-colors-bg-brand-primary);flex-shrink:0;margin-top:2px}.assistant-body[_ngcontent-%COMP%]{flex:1;min-width:0;max-width:760px;display:flex;flex-direction:column;gap:12px}.assistant-text[_ngcontent-%COMP%]{font-size:14px;color:var(--ng-colors-text-secondary-700);line-height:1.6;margin:0;white-space:pre-wrap;word-break:break-word}.assistant-text--error[_ngcontent-%COMP%]{color:var(--ng-colors-fg-error-primary)}.assistant-text--md[_ngcontent-%COMP%]{white-space:normal;display:block}.assistant-error[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:8px;padding:10px 12px;border:1px solid var(--ng-colors-border-error-subtle);border-radius:8px;background:var(--ng-colors-bg-error-primary);font-size:13px;line-height:1.5;color:var(--ng-colors-text-error-primary-hover)}.assistant-error__icon[_ngcontent-%COMP%]{flex-shrink:0;color:var(--ng-colors-fg-error-primary);margin-top:1px}.assistant-error__text[_ngcontent-%COMP%]{word-break:break-word}.wfb-tools[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:6px}.wfb-tool[_ngcontent-%COMP%]{font-size:11px}.wfb-tool[_ngcontent-%COMP%]::part(content){display:inline-flex;align-items:center;gap:5px}.wfb-tool__spinner[_ngcontent-%COMP%]{width:10px;height:10px;border:1.5px solid currentColor;border-top-color:transparent;border-radius:50%;animation:_ngcontent-%COMP%_spin .7s linear infinite;display:inline-block}.wfb-tool__detail[_ngcontent-%COMP%]{opacity:.75;font-weight:400}@keyframes _ngcontent-%COMP%_spin{to{transform:rotate(360deg)}}.agent-trace[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;gap:14px;margin:2px 0;padding-left:18px}.agent-trace[_ngcontent-%COMP%]:before{content:"";position:absolute;top:4px;bottom:4px;left:3px;width:2px;border-radius:1px;background:var(--ng-colors-border-secondary)}.agent-trace__row[_ngcontent-%COMP%]{min-width:0}.agent-trace__text[_ngcontent-%COMP%]{margin:0;font-size:13px;line-height:1.6;color:var(--ng-colors-text-quaternary-500);white-space:pre-wrap;word-break:break-word}.agent-trace__chips[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:6px}.wfb-status-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:4px 0}.wfb-status-text[_ngcontent-%COMP%]{font-size:13px;color:var(--ng-colors-text-quaternary-500);font-style:italic}.wfb-typing[_ngcontent-%COMP%]{display:flex;gap:4px;align-items:center;padding:6px 0}.wfb-typing[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{width:6px;height:6px;border-radius:50%;background:var(--ng-colors-fg-quaternary-400);animation:_ngcontent-%COMP%_bounce 1.2s ease-in-out infinite}.wfb-typing[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(2){animation-delay:.2s}.wfb-typing[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(3){animation-delay:.4s}@keyframes _ngcontent-%COMP%_bounce{0%,60%,to{transform:translateY(0);opacity:.4}30%{transform:translateY(-5px);opacity:1}}.chart-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px;padding:12px 14px;border:1px solid var(--ng-colors-border-secondary);border-radius:12px;background:var(--ng-colors-bg-primary);box-shadow:0 1px 3px #1018280f;cursor:pointer;transition:border-color .15s,box-shadow .15s;width:100%;max-width:100%;box-sizing:border-box}.chart-card[_ngcontent-%COMP%]:hover{border-color:var(--ng-colors-border-brand);box-shadow:0 0 0 3px var(--ng-colors-bg-brand-primary)}.chart-card__icon[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:8px;background:var(--ng-colors-bg-brand-primary);flex-shrink:0}.chart-card__body[_ngcontent-%COMP%]{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.chart-card__title[_ngcontent-%COMP%]{font-size:13px;font-weight:600;color:var(--ng-colors-text-primary-900);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chart-card__meta[_ngcontent-%COMP%]{font-size:12px;color:var(--ng-colors-text-quaternary-500)}.aq-composer-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;position:relative;width:100%;box-sizing:border-box;border:1px solid var(--ng-colors-border-primary);border-radius:20px;background:var(--ng-colors-bg-primary);transition:border-color .12s ease,box-shadow .12s ease}.aq-composer-wrap[_ngcontent-%COMP%]:focus-within{border-color:var(--ng-colors-border-brand-alt);box-shadow:0 0 0 3px var(--ng-colors-bg-brand-primary)}.aq-composer-wrap--dragover[_ngcontent-%COMP%]{border-color:var(--ng-colors-border-brand-alt);border-style:dashed;box-shadow:0 0 0 3px var(--ng-colors-bg-brand-primary)}.aq-composer-wrap[_ngcontent-%COMP%] > .aq-attachments[_ngcontent-%COMP%]{padding:10px 14px 0}.reply-badge[_ngcontent-%COMP%]{position:fixed;z-index:1000;transform:translate(-50%,calc(-100% - 8px));display:inline-flex;align-items:center;gap:4px;padding:6px 12px;border:none;border-radius:999px;background:var(--ng-colors-bg-primary-solid);color:var(--ng-colors-text-white);font-size:12px;font-weight:500;line-height:1;box-shadow:var(--ng-shadow-lg, 0 8px 16px rgba(16, 24, 40, .16));cursor:pointer}.reply-badge[_ngcontent-%COMP%]:hover{background:var(--ng-colors-bg-primary-solid)}.reply-badge--below[_ngcontent-%COMP%]{transform:translate(-50%,8px)}.reply-quote[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:8px;margin:10px 14px 0;padding:8px 10px;border-radius:10px;border-left:3px solid var(--ng-colors-border-brand-alt);background:var(--ng-colors-bg-secondary);color:var(--ng-colors-text-tertiary-600);font-size:12px;line-height:1.4}.reply-quote[_ngcontent-%COMP%] nile-glyph[_ngcontent-%COMP%]{flex:0 0 auto;margin-top:2px;color:var(--ng-colors-fg-brand-primary-600);transform:rotate(180deg)}.reply-quote__text[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.reply-quote__dismiss[_ngcontent-%COMP%]{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;padding:2px;border:none;background:transparent;color:inherit;cursor:pointer;border-radius:4px}.reply-quote__dismiss[_ngcontent-%COMP%]:hover{background:#0000000f}.aq-drop-overlay[_ngcontent-%COMP%]{position:absolute;inset:0;z-index:1;display:flex;align-items:center;justify-content:center;gap:8px;border-radius:20px;background:var(--ng-colors-bg-brand-primary);color:var(--ng-colors-fg-brand-primary-600);font-size:13px;font-weight:500;pointer-events:none}.aq-composer[_ngcontent-%COMP%]::part(base){border:0;border-radius:0;background:transparent;box-shadow:none}.aq-composer[_ngcontent-%COMP%]::part(toolbar-end){gap:6px;align-items:center}.aq-composer[loading][_ngcontent-%COMP%]::part(send-button){background:var(--ng-colors-bg-active);color:var(--ng-colors-text-tertiary-600)}.aq-composer[loading][_ngcontent-%COMP%]::part(send-button):hover{background:var(--ng-colors-bg-active);color:var(--ng-colors-text-primary-900)}.aq-attachments[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:6px}.aq-attachments--sent[_ngcontent-%COMP%]{margin-top:6px}.aq-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;max-width:220px;padding:4px 8px;border:1px solid var(--ng-colors-border-secondary);border-radius:8px;background:var(--ng-colors-bg-secondary);font-size:12px;color:var(--ng-colors-text-secondary-700)}.aq-chip--error[_ngcontent-%COMP%]{border-color:var(--ng-colors-border-error-subtle);background:var(--ng-colors-bg-error-primary);color:var(--ng-colors-text-error-primary-hover)}.aq-chip--static[_ngcontent-%COMP%]{background:var(--ng-colors-bg-primary)}.aq-chip__icon[_ngcontent-%COMP%]{color:var(--ng-colors-text-quaternary-500);flex-shrink:0}.aq-chip__name[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.aq-chip__spin[_ngcontent-%COMP%]{flex-shrink:0}.aq-chip__retry[_ngcontent-%COMP%]{border:none;background:none;padding:0;color:var(--ng-colors-text-error-primary-hover);font-size:12px;font-weight:600;cursor:pointer}.aq-chip__remove[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;border:none;background:none;padding:0;cursor:pointer;color:var(--ng-colors-text-placeholder);flex-shrink:0}.aq-chip__remove[_ngcontent-%COMP%]:hover{color:var(--ng-colors-text-tertiary-600)}.wfb-breadcrumb[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;font-size:13px}.wfb-breadcrumb__current[_ngcontent-%COMP%]{color:var(--ng-colors-text-primary-900);font-weight:500}.wfb-preview-close[_ngcontent-%COMP%]{cursor:pointer;color:var(--ng-colors-text-quaternary-500)}.wfb-preview-close[_ngcontent-%COMP%]:hover{color:var(--ng-colors-text-primary-900)}.wfb-preview-link[_ngcontent-%COMP%]{background:none;border:none;padding:0;font-size:13px;font-weight:500;color:var(--ng-colors-border-brand);cursor:pointer;font-family:inherit}.wfb-preview-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.input-area[_ngcontent-%COMP%]{flex-shrink:0;padding:4px 16px 18px;display:flex;flex-direction:column;justify-content:center}.chat-input-pill[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px;width:100%;max-width:100%;padding:14px 16px 12px;background:var(--ng-colors-bg-primary);border:1px solid var(--ng-colors-border-secondary);border-radius:24px;box-shadow:0 1px 2px #1018280a,0 8px 24px #1018280f;cursor:text;transition:border-color .15s,box-shadow .15s}.chat-input-pill[_ngcontent-%COMP%]:focus-within{border-color:var(--ng-colors-border-brand);box-shadow:0 0 0 3px var(--ng-colors-bg-brand-primary)}.voice-wave[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0;height:22px;margin:0 8px;display:block}.input-query[_ngcontent-%COMP%]{display:block;width:100%;min-width:0;border:none;outline:none;resize:none;font:inherit;font-size:15px;line-height:1.4;color:var(--ng-colors-text-primary-900);background:transparent;padding:6px 2px;max-height:160px;overflow-y:auto;white-space:pre-wrap;word-break:break-word}.input-query[_ngcontent-%COMP%]::placeholder{color:var(--ng-colors-text-quaternary-500)}.input-query[_ngcontent-%COMP%]:disabled{cursor:not-allowed;opacity:.6}.input-query--live[_ngcontent-%COMP%]{min-height:21px;cursor:default;text-align:left}.input-query__interim[_ngcontent-%COMP%]{font-style:italic;opacity:.55}.pill-toolbar[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:8px}.pill-toolbar__left[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px}.pill-toolbar__right[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;margin-left:auto}.conn-chip-wrap[_ngcontent-%COMP%]{position:relative}.datasource-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:5px;padding:3px 10px;background:var(--ng-colors-bg-brand-primary);border-radius:20px;font-size:12px;font-weight:500;color:var(--ng-colors-border-brand);cursor:pointer;-webkit-user-select:none;user-select:none;max-width:200px;border:1px solid transparent}.datasource-chip[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.datasource-chip__chevron[_ngcontent-%COMP%]{transition:transform .15s;flex-shrink:0}.datasource-chip__chevron--open[_ngcontent-%COMP%]{transform:rotate(180deg)}.datasource-chip[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--ng-colors-bg-brand-secondary)}.datasource-chip[_ngcontent-%COMP%]:disabled{opacity:.6;cursor:not-allowed}.datasource-chip--open[_ngcontent-%COMP%]{background:var(--ng-colors-bg-brand-secondary);border-color:var(--ng-colors-text-tertiary-on-brand)}.conn-chip-dropdown[_ngcontent-%COMP%]{position:absolute;bottom:calc(100% + 6px);left:0;min-width:200px;background:var(--ng-colors-bg-primary);border:1px solid var(--ng-colors-border-secondary);border-radius:10px;box-shadow:0 4px 16px #0000001a;z-index:100;overflow:hidden}.conn-chip-dropdown__item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:9px 12px;font-size:13px;color:var(--ng-colors-text-secondary-700);cursor:pointer}.conn-chip-dropdown__item[_ngcontent-%COMP%]:hover{background:var(--ng-colors-bg-secondary)}.conn-chip-dropdown__item--active[_ngcontent-%COMP%]{background:var(--ng-colors-bg-brand-primary);color:var(--ng-colors-border-brand)}.conn-chip-dropdown__name[_ngcontent-%COMP%]{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.conn-chip-dropdown__hint[_ngcontent-%COMP%]{font-size:11px;color:var(--ng-colors-text-placeholder);flex-shrink:0}.conn-chip-dropdown__check[_ngcontent-%COMP%]{margin-left:auto;flex-shrink:0;color:var(--ng-colors-border-brand)}.mic-icon[_ngcontent-%COMP%]{cursor:pointer;color:var(--ng-colors-text-quaternary-500);transition:color .15s}.mic-icon[_ngcontent-%COMP%]:hover{color:var(--ng-colors-text-secondary-700)}.mic-icon--recording[_ngcontent-%COMP%]{color:var(--ng-colors-fg-error-primary);animation:_ngcontent-%COMP%_mic-pulse 1s ease-in-out infinite}@keyframes _ngcontent-%COMP%_mic-pulse{0%,to{opacity:1}50%{opacity:.5}}.send-icon[_ngcontent-%COMP%]{cursor:pointer;color:var(--ng-colors-border-brand);transition:opacity .15s}.send-icon--disabled[_ngcontent-%COMP%]{opacity:.35;cursor:not-allowed;pointer-events:none}.wfb-save-dialog[_ngcontent-%COMP%]{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#10182866;z-index:20}.wfb-save-dialog__body[_ngcontent-%COMP%]{background:var(--ng-colors-bg-primary);border:1px solid var(--ng-colors-border-secondary);border-radius:12px;padding:20px;width:360px;display:flex;flex-direction:column;gap:12px;box-shadow:0 8px 24px #1018281f}.wfb-save-dialog__label[_ngcontent-%COMP%]{font-size:13px;font-weight:600;color:var(--ng-colors-text-secondary-700)}.wfb-save-dialog__input[_ngcontent-%COMP%]{width:100%;padding:8px 12px;border:1px solid var(--ng-colors-border-primary);border-radius:8px;font-size:14px;font-family:inherit;color:var(--ng-colors-text-primary-900);outline:none;box-sizing:border-box}.wfb-save-dialog__input[_ngcontent-%COMP%]:focus{border-color:var(--ng-colors-border-brand);box-shadow:0 0 0 3px var(--ng-colors-bg-brand-primary)}.wfb-save-dialog__actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:8px}.aq-shell[_ngcontent-%COMP%]{--aq-header-h: 56px;display:flex;flex:1 1 auto;min-height:0;width:100%;overflow:hidden;container-type:inline-size}.aq-chat-pane[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-width:0;flex:1 1 auto;transition:flex-basis .22s ease,max-width .22s ease;--aq-conversation-w: 900px}.aq-chat-pane__tabs[_ngcontent-%COMP%]{flex-shrink:0}.aq-library-pane__head[_ngcontent-%COMP%] nile-nav-tab-group[_ngcontent-%COMP%]{width:100%}.aq-chat-pane__tabs[_ngcontent-%COMP%] nile-nav-tab[_ngcontent-%COMP%]::part(name), .aq-library-pane__head[_ngcontent-%COMP%] nile-nav-tab-group[_ngcontent-%COMP%] nile-nav-tab[_ngcontent-%COMP%]::part(name){font-size:13px;line-height:14px}.aq-library-pane__head[_ngcontent-%COMP%] nile-nav-tab-group[_ngcontent-%COMP%] .aq-library-pane__tab-count[_ngcontent-%COMP%]{display:inline-block;min-width:18px;margin-left:6px;padding:1px 6px;border-radius:999px;background:var(--ng-colors-bg-brand-solid);color:var(--ng-colors-text-white);font-size:10px;font-weight:700;line-height:14px;text-align:center;vertical-align:1px}.aq-chat-pane__tabs[_ngcontent-%COMP%]::part(nav), .aq-library-pane__head[_ngcontent-%COMP%] nile-nav-tab-group[_ngcontent-%COMP%]::part(nav){background:var(--ng-colors-bg-quaternary)}.aq-library-pane[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1 1 auto;min-height:0;overflow:hidden}.aq-shell[data-mode=idle][_ngcontent-%COMP%] .aq-chat[_ngcontent-%COMP%]::part(messages), .aq-shell[data-mode=conversation][_ngcontent-%COMP%] .aq-chat[_ngcontent-%COMP%]::part(messages), .aq-shell[data-mode=conversation][_ngcontent-%COMP%] .input-area[_ngcontent-%COMP%]{width:100%;max-width:var(--aq-conversation-w);margin-left:auto;margin-right:auto}.aq-shell[data-mode=conversation][_ngcontent-%COMP%] .wfb-messages[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:first-child{margin-top:auto}.aq-shell[data-mode=split][_ngcontent-%COMP%] .aq-chat-pane[_ngcontent-%COMP%]{flex:0 0 auto;flex-basis:clamp(320px,41%,485px);max-width:50%;margin:0}.aq-resizer[_ngcontent-%COMP%]{align-self:stretch;position:relative;cursor:col-resize;background:transparent;z-index:6;touch-action:none}.aq-resizer[_ngcontent-%COMP%]:before{content:"";position:absolute;top:0;bottom:0;left:50%;width:1px;transform:translate(-50%);background:var(--ng-colors-border-secondary)}.aq-resizer[_ngcontent-%COMP%]:after{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:4px;height:36px;border-radius:3px;background:var(--ng-colors-border-primary);transition:background .15s,height .15s}.aq-resizer[_ngcontent-%COMP%]:hover:after, .aq-resizer.is-active[_ngcontent-%COMP%]:after{background:var(--ng-colors-border-brand);height:44px}.aq-shell--resizing[_ngcontent-%COMP%]{cursor:col-resize;-webkit-user-select:none;user-select:none}.aq-shell--resizing[_ngcontent-%COMP%] .aq-chat-pane[_ngcontent-%COMP%], .aq-shell--resizing[_ngcontent-%COMP%] .aq-builder-pane[_ngcontent-%COMP%], .aq-shell--resizing[_ngcontent-%COMP%] .aq-artifact-pane[_ngcontent-%COMP%]{transition:none}.aq-shell[data-mode=split][_ngcontent-%COMP%] .aq-builder-pane[_ngcontent-%COMP%]{display:none}.aq-artifact-pane[_ngcontent-%COMP%]{position:relative;overflow:hidden;flex:1 1 60%;display:flex;flex-direction:column;min-width:0;background:var(--ng-colors-bg-primary);animation:_ngcontent-%COMP%_aq-slide-in .22s ease}@keyframes _ngcontent-%COMP%_aq-slide-in{0%{transform:translate(16px);opacity:0}to{transform:translate(0);opacity:1}}.aq-artifact-pane--dsl-only[_ngcontent-%COMP%]{position:absolute;top:0;left:-9999px;width:1px;height:1px;overflow:hidden;pointer-events:none;animation:none}.aq-artifact-pane[_ngcontent-%COMP%]{view-transition-name:aq-artifact-pane}.aq-artifact-pane[_ngcontent-%COMP%]:has(nile-drawer.dsl-editor-drawer[open]){view-transition-name:none}@supports (view-transition-name: none){.aq-detail-overlay[_ngcontent-%COMP%]{animation:none}}.aq-artifact-pane__header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;box-sizing:border-box;height:var(--aq-header-h, 56px);padding:0 20px;border-bottom:1px solid var(--ng-colors-border-secondary);background:var(--ng-colors-bg-primary);flex-shrink:0;gap:12px}.aq-artifact-pane__header-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px;flex-shrink:0}.aq-artifact-pane__footer[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:8px;padding:12px 16px;border-top:1px solid var(--ng-colors-border-secondary);background:var(--ng-colors-bg-primary);flex-shrink:0}.aq-library-pane__head[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px;box-sizing:border-box;padding:12px 20px 16px;border-bottom:1px solid var(--ng-colors-border-secondary);flex-shrink:0;background:var(--ng-colors-bg-secondary)}.aq-library-pane__intro[_ngcontent-%COMP%]{margin:0;font-size:13px;line-height:20px;color:var(--ng-colors-text-tertiary-600)}.aq-library-pane__intro-title[_ngcontent-%COMP%]{font-weight:600;color:var(--ng-colors-text-secondary-700)}.aq-library-pane__body[_ngcontent-%COMP%]{flex:1 1 auto;overflow-y:auto;scrollbar-width:none;-ms-overflow-style:none;padding:20px;display:flex;flex-direction:column;gap:16px;background:var(--ng-colors-bg-secondary)}.aq-library-pane__body[_ngcontent-%COMP%]::-webkit-scrollbar{width:0;height:0}.aq-artifact-pane__picker-overlay-footer[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;gap:12px;box-sizing:border-box;padding:10px 16px;border-top:1px solid var(--ng-colors-border-secondary);background:var(--ng-colors-bg-primary);flex-shrink:0}.aq-artifact-pane__picker-overlay-footer-count[_ngcontent-%COMP%]{margin-right:auto;font-size:13px;font-weight:500;color:var(--ng-colors-text-secondary-700)}.aq-artifact-pane__titles[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0;display:flex;align-items:baseline;gap:8px}.aq-artifact-pane__title[_ngcontent-%COMP%]{flex-shrink:0;font-weight:600;font-size:14px;color:var(--ng-colors-text-primary-900)}.aq-artifact-pane__subtitle[_ngcontent-%COMP%]{min-width:0;font-weight:400;font-size:13px;color:var(--ng-colors-text-quaternary-500);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.aq-filters-pill[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;height:32px;padding:0 10px;border:1px solid var(--ng-colors-border-primary);border-radius:8px}.aq-filters-pill__icon[_ngcontent-%COMP%]{color:var(--ng-colors-text-quaternary-500);flex-shrink:0}.aq-filters-pill[_ngcontent-%COMP%] nile-slide-toggle[_ngcontent-%COMP%]{--slide-toggle-width: auto;font-size:13px;font-weight:500;color:var(--ng-colors-text-secondary-700)}.aq-filters-pill.aq-filters-pill--active[_ngcontent-%COMP%]{border-color:var(--nile-color-primary-300, #84adff);background:var(--ng-colors-bg-brand-primary)}.aq-filters-pill.aq-filters-pill--active[_ngcontent-%COMP%] .aq-filters-pill__icon[_ngcontent-%COMP%]{color:var(--ng-colors-border-brand)}.aq-filters-pill.aq-filters-pill--active[_ngcontent-%COMP%] nile-slide-toggle[_ngcontent-%COMP%]{color:var(--ng-colors-border-brand)}.aq-undo-redo-group[_ngcontent-%COMP%]{display:flex;align-items:stretch;height:32px;border:1px solid var(--ng-colors-border-primary);border-radius:8px;overflow:hidden;background:var(--ng-colors-bg-primary)}.aq-undo-redo-group[_ngcontent-%COMP%] nile-button[_ngcontent-%COMP%]::part(base){height:100%!important;border:none!important;border-radius:0!important;padding:0 12px!important;font-size:13px!important;font-weight:500!important;color:var(--ng-colors-text-primary-900)!important}.aq-undo-redo-group[_ngcontent-%COMP%] nile-button[_ngcontent-%COMP%]:first-child::part(base){border-right:1px solid var(--ng-colors-border-secondary)!important}.aq-undo-redo-group[_ngcontent-%COMP%] nile-button[_ngcontent-%COMP%]:last-child::part(base){padding:0 10px!important}.aq-artifact-pane__header-divider[_ngcontent-%COMP%]{width:1px;height:20px;background:var(--ng-colors-border-secondary);flex-shrink:0}.aq-artifact-pane__body[_ngcontent-%COMP%]{flex:1 1 auto;overflow:auto;scrollbar-width:none;-ms-overflow-style:none;display:flex;flex-direction:column;gap:16px;background:var(--ng-colors-bg-secondary)}.aq-artifact-pane__body[_ngcontent-%COMP%]::-webkit-scrollbar{width:0;height:0}.aq-artifact-pane__suggestions[_ngcontent-%COMP%]{flex-shrink:0;padding:10px 16px;border-bottom:1px solid var(--ng-colors-border-secondary);background:var(--ng-colors-bg-tertiary)}.aq-artifact-pane__suggestions-list[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:6px;overflow-x:auto}.aq-suggestion-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:4px;padding:4px 10px;border:1px solid var(--ng-colors-border-primary);border-radius:999px;background:var(--ng-colors-bg-primary);font-size:12px;font-weight:500;color:var(--ng-colors-text-secondary-700);cursor:pointer;white-space:nowrap;transition:border-color .15s,color .15s}.aq-suggestion-chip[_ngcontent-%COMP%]:hover{border-color:var(--ng-colors-border-brand);color:var(--ng-colors-border-brand)}.aq-artifact-pane__empty[_ngcontent-%COMP%]{flex:1 1 auto;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:32px 16px;text-align:center;color:var(--ng-colors-text-quaternary-500)}.aq-artifact-pane__empty-title[_ngcontent-%COMP%]{margin:4px 0 0;font-size:14px;font-weight:600;color:var(--ng-colors-text-secondary-700)}.aq-artifact-pane__empty-sub[_ngcontent-%COMP%]{margin:0;font-size:13px;max-width:320px}.aq-artifact-pane__kpi-picker[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:10px}.aq-picker-chips[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:6px;align-content:start}.aq-picker-chips[_ngcontent-%COMP%] nile-skeleton-loader[_ngcontent-%COMP%]{flex:0 0 auto}.aq-picker-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:5px;border:1px solid var(--ng-colors-border-secondary);border-radius:999px;padding:5px 10px;background:var(--ng-colors-bg-primary);cursor:pointer;font:inherit;font-size:12px;font-weight:600;color:var(--ng-colors-text-quaternary-500);white-space:nowrap;transition:border-color .15s,box-shadow .15s}.aq-picker-chip[_ngcontent-%COMP%]:hover{border-color:var(--ng-colors-border-brand-alt);box-shadow:0 4px 14px var(--ng-colors-bg-brand-primary)}.aq-picker-chip--active[_ngcontent-%COMP%]{background:var(--ng-colors-bg-brand-solid);border-color:var(--ng-colors-border-brand-alt);color:var(--ng-colors-text-white)}.aq-picker-chip--active[_ngcontent-%COMP%]:hover{box-shadow:none}.aq-picker-chip--active[_ngcontent-%COMP%] .aq-picker-chip__count[_ngcontent-%COMP%]{background:#ffffff40;color:var(--ng-colors-text-white)}.aq-picker-chip__count[_ngcontent-%COMP%]{min-width:16px;padding:0 5px;border-radius:999px;background:var(--ng-colors-bg-tertiary);color:var(--ng-colors-text-quaternary-500);font-size:10px;font-weight:700;text-align:center}.inline-widget[_ngcontent-%COMP%]{margin-top:10px;border:1px solid var(--ng-colors-border-secondary);border-radius:14px;background:var(--ng-colors-bg-primary);overflow:hidden;box-shadow:0 1px 2px #1018280a,0 4px 14px #1018280f}.inline-widget__chart[_ngcontent-%COMP%]{height:380px;padding:14px 16px 6px}.inline-widget__chart--kpi[_ngcontent-%COMP%]{height:150px}.inline-widget__chart--kpi-spark[_ngcontent-%COMP%]{height:220px}.inline-widget__chart--grid[_ngcontent-%COMP%]{height:auto;max-height:520px;overflow:auto}.inline-widget__chart[_ngcontent-%COMP%] shared-nile-chart-widget[_ngcontent-%COMP%]{display:block;height:100%;width:100%}.inline-widget__chart--grid[_ngcontent-%COMP%] shared-nile-chart-widget[_ngcontent-%COMP%]{height:auto}.inline-widget__actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:10px;padding:10px 16px 14px;border-top:1px solid var(--ng-colors-border-tertiary)}.chart-live[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:5px;font-size:12px;font-weight:500;color:var(--ng-colors-text-secondary-700);white-space:nowrap}.chart-live__dot[_ngcontent-%COMP%]{width:6px;height:6px;border-radius:50%;background:var(--ng-colors-fg-success-primary)}.chart-live--preview[_ngcontent-%COMP%]{padding:2px 8px;border-radius:4px;background:var(--ng-colors-bg-warning-primary);color:var(--ng-colors-fg-warning-primary)}.forecast-meta[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:4px 18px;padding:10px 14px;border-top:1px solid var(--ng-colors-border-tertiary);background:var(--ng-colors-bg-secondary);font-size:11px;line-height:1.5}.forecast-meta__item[_ngcontent-%COMP%]{display:inline-flex;gap:4px;white-space:nowrap}.forecast-meta__label[_ngcontent-%COMP%]{color:var(--ng-colors-text-quaternary-500)}.forecast-meta__value[_ngcontent-%COMP%]{color:var(--ng-colors-text-secondary-700);font-weight:600}.forecast-record[_ngcontent-%COMP%]{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-top:12px;padding-top:10px;border-top:1px solid var(--ng-colors-border-tertiary)}.forecast-record__icon[_ngcontent-%COMP%]{flex:0 0 auto}.forecast-record__text[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0;font-size:12px;line-height:1.5;color:var(--ng-colors-text-quaternary-500)}.forecast-record__action[_ngcontent-%COMP%]{flex:0 0 auto;padding:4px 10px;border:1px solid transparent;border-radius:6px;background:transparent;cursor:pointer;font:inherit;font-size:12px;font-weight:600;color:#5925dc;transition:background .15s ease,border-color .15s ease}.forecast-record__action[_ngcontent-%COMP%]:hover:not(:disabled){border-color:#d9d0fd;background:#f7f5ff}.forecast-record__action[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:default}.follow-ups[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}.follow-up[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;padding:7px 12px;border:1px solid var(--ng-colors-border-secondary);border-radius:8px;background:var(--ng-colors-bg-primary);cursor:pointer;font:inherit;font-size:13px;font-weight:500;color:var(--ng-colors-text-secondary-700);transition:border-color .15s ease,background .15s ease}.follow-up[_ngcontent-%COMP%]:hover:not(:disabled){border-color:var(--ng-colors-text-tertiary-on-brand);background:var(--ng-colors-bg-secondary)}.follow-up[_ngcontent-%COMP%]:disabled{opacity:.55;cursor:default}.follow-up__icon[_ngcontent-%COMP%]{flex:0 0 auto}.follow-up__label[_ngcontent-%COMP%]{white-space:nowrap}.follow-up__badge[_ngcontent-%COMP%]{padding:2px 6px;border-radius:4px;background:#7a5af8;color:var(--ng-colors-text-white);font-size:9px;font-weight:700;letter-spacing:.04em;text-transform:uppercase}.follow-up--ai[_ngcontent-%COMP%]{border-color:#d9d0fd;background:#f7f5ff;color:#5925dc}.follow-up--ai[_ngcontent-%COMP%]:hover:not(:disabled){border-color:#b9a6fb;background:#f0ecff}.widget-header-btn[_ngcontent-%COMP%]{position:relative;display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;padding:0;margin:0 2px;box-sizing:border-box;border:none;border-radius:6px;background:transparent;color:var(--ng-colors-text-quaternary-500);cursor:pointer}.widget-header-btn[_ngcontent-%COMP%]:hover{background:var(--ng-colors-bg-tertiary);color:var(--ng-colors-text-primary-900)}.widget-header-dropdown[_ngcontent-%COMP%]::part(panel){width:320px;max-width:92vw}.widget-header-dropdown[_ngcontent-%COMP%]::part(base){display:block}.widget-header-anchor[_ngcontent-%COMP%]{display:inline-block;width:0;height:0}.widget-menu__trigger[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;padding:0;margin:0 2px;box-sizing:border-box;border:none;border-radius:var(--ng-radius-md, 6px);background:transparent;color:var(--ng-colors-text-tertiary-600);cursor:pointer}.widget-menu__trigger[_ngcontent-%COMP%]:hover{background:var(--ng-colors-bg-secondary);color:var(--ng-colors-text-primary-900)}.widget-menu__label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;width:100%}.widget-menu__label[_ngcontent-%COMP%] nile-glyph[_ngcontent-%COMP%]{flex:none;color:var(--ng-colors-text-tertiary-600)}.widget-menu__sep[_ngcontent-%COMP%]{height:var(--ng-stroke-width-1, 1px);background:var(--ng-colors-border-secondary);margin:var(--ng-spacing-md, 8px)}.type-picker__panel[_ngcontent-%COMP%], .filter-builder__panel[_ngcontent-%COMP%]{background:var(--ng-colors-bg-primary);border:1px solid var(--ng-colors-border-secondary);border-radius:12px;box-shadow:0 8px 24px #10182824;padding:10px;box-sizing:border-box}.inline-action__loading[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:8px;min-height:56px;font-size:13px;color:var(--ng-colors-text-tertiary-600)}.inline-action__hint[_ngcontent-%COMP%]{margin:0 0 6px;font-size:12px;color:var(--ng-colors-text-tertiary-600)}.inline-action__error[_ngcontent-%COMP%]{margin:6px 0 0;font-size:12px;color:var(--ng-colors-fg-error-primary)}.type-picker__section[_ngcontent-%COMP%]{margin:6px 0 4px;font-size:11px;font-weight:600;letter-spacing:.02em;text-transform:uppercase;color:var(--ng-colors-text-quaternary-500)}.type-picker__section[_ngcontent-%COMP%]:first-child{margin-top:0}.type-picker__grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}.type-picker__tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:8px 4px;box-sizing:border-box;height:60px;border:1px solid var(--ng-colors-border-secondary);border-radius:8px;background:var(--ng-colors-bg-primary);color:var(--ng-colors-text-secondary-700);font-size:11px;font-weight:500;cursor:pointer}.type-picker__tile[_ngcontent-%COMP%] nile-glyph[_ngcontent-%COMP%]{color:var(--ng-colors-text-quaternary-500)}.type-picker__tile[_ngcontent-%COMP%]:hover:not(:disabled){border-color:var(--ng-colors-border-brand);color:var(--ng-colors-border-brand)}.type-picker__tile[_ngcontent-%COMP%]:hover:not(:disabled) nile-glyph[_ngcontent-%COMP%]{color:var(--ng-colors-border-brand)}.type-picker__tile[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:default}.type-picker__tile--sensible[_ngcontent-%COMP%]{border-color:var(--ng-colors-bg-brand-secondary);background:var(--ng-colors-bg-brand-primary)}.type-picker__tile--sensible[_ngcontent-%COMP%] nile-glyph[_ngcontent-%COMP%]{color:var(--ng-colors-border-brand)}.filter-builder__active[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:8px}.filter-builder__chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;padding:4px 8px;border-radius:999px;background:var(--ng-colors-bg-brand-primary);color:var(--ng-colors-text-secondary-700);font-size:12px}.filter-builder__chip-remove[_ngcontent-%COMP%]{display:inline-flex;border:none;background:none;padding:0;cursor:pointer;color:inherit}.filter-builder__form[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:6px}.filter-builder__field-label[_ngcontent-%COMP%]{padding:6px 2px;font-size:12px;font-weight:600;color:var(--ng-colors-text-primary-900)}.filter-builder__and[_ngcontent-%COMP%]{font-size:12px;color:var(--ng-colors-text-tertiary-600)}.filter-builder__select[_ngcontent-%COMP%], .filter-builder__input[_ngcontent-%COMP%]{flex:1 1 100%;min-width:0;padding:7px 8px;box-sizing:border-box;border:1px solid var(--ng-colors-border-secondary);border-radius:7px;background:var(--ng-colors-bg-primary);font:inherit;font-size:12px;color:var(--ng-colors-text-primary-900)}.filter-builder__multi[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px;max-height:160px;overflow-y:auto;width:100%}.filter-builder__multi-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;padding:4px 2px;font-size:12px;color:var(--ng-colors-text-secondary-700);cursor:pointer}.filter-builder__multi-item[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.aq-shell[data-mode=builder][_ngcontent-%COMP%] .aq-chat-pane[_ngcontent-%COMP%]{flex:0 0 auto;flex-basis:clamp(320px,41%,485px);max-width:50%;margin:0}.aq-builder-pane[_ngcontent-%COMP%]{position:relative;overflow:hidden;flex:1 1 60%;display:flex;flex-direction:column;min-width:0}.aq-builder-pane[_ngcontent-%COMP%] shared-builder-host[_ngcontent-%COMP%]{flex:1 1 auto;min-height:0}.aq-builder-pane[_ngcontent-%COMP%] shared-dashboard-grid{display:block;min-width:calc(100cqw - 24px)}.aq-shell--fullscreen[data-mode=builder][_ngcontent-%COMP%] .aq-chat-pane[_ngcontent-%COMP%]{flex-basis:0;max-width:0;overflow:hidden;border-right:none}.aq-shell--fullscreen[data-mode=builder][_ngcontent-%COMP%] .aq-builder-pane[_ngcontent-%COMP%]{flex-basis:100%}.aq-shell--fullscreen[data-mode=builder][_ngcontent-%COMP%] .aq-builder-pane[_ngcontent-%COMP%] shared-dashboard-grid{min-width:100%}.choice-picker[_ngcontent-%COMP%]{margin-top:16px;width:100%}.choice-picker[_ngcontent-%COMP%] + .choice-picker[_ngcontent-%COMP%]{margin-top:22px}.choice-picker__group[_ngcontent-%COMP%]{display:block;width:100%}.choice-picker__step[_ngcontent-%COMP%]{display:block;margin-bottom:4px;font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--ng-colors-text-tertiary-600)}.choice-picker__submit-row[_ngcontent-%COMP%]{margin-top:12px;display:flex;justify-content:flex-start}.choice-card[_ngcontent-%COMP%]{display:block}.choice-card[_ngcontent-%COMP%]::part(base){width:100%;box-sizing:border-box;margin:0;padding:12px 14px;gap:0;align-items:center;border:none;border-bottom:1px solid var(--ng-colors-border-secondary);border-radius:8px;background:transparent;cursor:pointer;transition:border-color .15s ease,background-color .15s ease,box-shadow .15s ease}.choice-card[_ngcontent-%COMP%]:last-of-type::part(base){border-bottom:none}.choice-card[_ngcontent-%COMP%]::part(control){display:none}.choice-card[_ngcontent-%COMP%]::part(label){flex:1 1 auto;min-width:0;margin:0}.choice-card[_ngcontent-%COMP%]:not(.choice-card--locked):hover::part(base){border-color:var(--ng-colors-border-brand);background:var(--ng-colors-bg-brand-primary)}.choice-card--chosen[_ngcontent-%COMP%]::part(base){border-color:var(--ng-colors-border-brand);background:var(--ng-colors-bg-brand-primary);box-shadow:inset 0 0 0 1px var(--ng-colors-border-brand)}.choice-card--locked[_ngcontent-%COMP%]:not(.choice-card--chosen)::part(base){opacity:.6;cursor:default}.choice-card__label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;min-width:0}.choice-card__num[_ngcontent-%COMP%]{flex:0 0 auto;display:flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:6px;font-size:11.5px;font-weight:700;color:var(--ng-colors-text-tertiary-600);background:var(--ng-colors-bg-secondary);transition:color .15s ease,background-color .15s ease}.choice-card--chosen[_ngcontent-%COMP%] .choice-card__num[_ngcontent-%COMP%]{color:var(--ng-colors-text-white);background:var(--ng-colors-bg-brand-solid)}.choice-card__text[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px;min-width:0}.choice-card__name[_ngcontent-%COMP%]{font-size:13.5px;font-weight:600;color:var(--ng-colors-text-primary-900);line-height:1.4;overflow-wrap:anywhere}.choice-card__hint[_ngcontent-%COMP%]{font-size:12.5px;font-weight:400;line-height:1.4;color:var(--ng-colors-text-tertiary-600)}.choice-card__badge[_ngcontent-%COMP%]{display:inline-block;margin-bottom:2px;font-size:10.5px;font-weight:700;letter-spacing:.03em;text-transform:uppercase;color:var(--ng-colors-fg-success-primary)}.choice-card__meta[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:10px;margin-top:1px;font-size:11.5px;color:var(--ng-colors-text-tertiary-600)}.choice-card__chip--green[_ngcontent-%COMP%]{color:var(--ng-colors-fg-success-primary);font-weight:700}.choice-card__chip--yellow[_ngcontent-%COMP%]{color:var(--ng-colors-fg-warning-primary);font-weight:700}.choice-card__chip--red[_ngcontent-%COMP%]{color:var(--ng-colors-fg-error-primary);font-weight:700}.choice-card__chip--muted[_ngcontent-%COMP%]{color:var(--ng-colors-text-tertiary-600)}.choice-picker__empty[_ngcontent-%COMP%]{margin:0;font-size:12.5px;color:var(--ng-colors-text-tertiary-600)}.choice-picker__chat-link[_ngcontent-%COMP%]{appearance:none;display:inline-flex;align-items:center;gap:4px;margin:6px 0 0;padding:0;border:none;border-radius:0;background:none;font-size:12.5px;color:var(--ng-colors-fg-brand-primary-600);cursor:pointer;text-align:left}.choice-picker__chat-link[_ngcontent-%COMP%]:hover:not(:disabled){text-decoration:underline}.choice-picker__chat-link[_ngcontent-%COMP%]:disabled{color:var(--ng-colors-text-tertiary-600);cursor:default}.choice-picker__chat-link--preview[_ngcontent-%COMP%]{gap:6px;padding:5px 10px;border:1px solid var(--ng-colors-border-secondary);border-radius:999px;color:var(--ng-colors-text-secondary-700)}.choice-picker__chat-link--preview[_ngcontent-%COMP%]:hover:not(:disabled){text-decoration:none;border-color:var(--ng-colors-border-brand);color:var(--ng-colors-fg-brand-primary-600);background:var(--ng-colors-bg-brand-primary)}.choice-picker__chat-link--preview[_ngcontent-%COMP%]:disabled{border-color:var(--ng-colors-border-secondary)}.choice-picker__footer-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;margin-top:6px}.choice-picker__footer-actions[_ngcontent-%COMP%] .choice-picker__chat-link[_ngcontent-%COMP%]{margin-top:0}.choice-picker__chat-draft[_ngcontent-%COMP%]{margin-top:8px;padding:10px;border:1px dashed var(--ng-colors-border-primary);border-radius:8px;background:var(--ng-colors-bg-secondary)}.choice-picker__chat-draft-label[_ngcontent-%COMP%]{display:block;margin-bottom:6px;font-size:11px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--ng-colors-text-tertiary-600)}.choice-picker__chat-draft-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:8px}.choice-picker__chat-draft-input[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0}.choice-picker__resume-chip[_ngcontent-%COMP%]{display:inline-block;margin-top:16px;padding:6px 10px;border:1px solid var(--ng-colors-border-secondary);border-radius:6px;background:var(--ng-colors-bg-secondary);cursor:pointer;transition:border-color .15s ease,background-color .15s ease}.choice-picker__resume-chip[_ngcontent-%COMP%]:hover{border-color:var(--ng-colors-border-brand);background:var(--ng-colors-bg-brand-primary)}.choice-panel[_ngcontent-%COMP%]{margin-bottom:10px;padding:14px 16px;border:1px solid var(--ng-colors-border-secondary);border-radius:12px;background:var(--ng-colors-bg-primary);box-shadow:0 4px 16px #10182814}.choice-panel__header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}.choice-panel__count[_ngcontent-%COMP%]{font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--ng-colors-text-tertiary-600)}.choice-panel__nav-group[_ngcontent-%COMP%]{display:flex;align-items:center;gap:2px}.choice-panel__nav[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:4px;width:24px;height:24px;padding:0;border:none;border-radius:6px;background:transparent;color:var(--ng-colors-text-tertiary-600);cursor:pointer;transition:background-color .15s ease,color .15s ease}.choice-panel__nav[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--ng-colors-bg-secondary);color:var(--ng-colors-text-primary-900)}.choice-panel__nav[_ngcontent-%COMP%]:disabled{opacity:.35;cursor:default}.choice-panel__close[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--ng-colors-bg-error-primary);color:var(--ng-colors-fg-error-primary)}.choice-panel__options[_ngcontent-%COMP%]{display:block;width:100%}.choice-panel-option[_ngcontent-%COMP%]{display:block}.choice-panel-option[_ngcontent-%COMP%]::part(base){width:100%;box-sizing:border-box;margin:0;padding:8px 10px;gap:0;align-items:center;border:none;border-radius:6px;background:transparent;cursor:pointer;transition:border-color .15s ease,background-color .15s ease}.choice-panel-option[_ngcontent-%COMP%]::part(control){display:none}.choice-panel-option[_ngcontent-%COMP%]::part(label){flex:1 1 auto;min-width:0;margin:0}.choice-panel-option[_ngcontent-%COMP%]:hover::part(base){background:var(--ng-colors-bg-brand-primary)}.choice-panel-option__label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;min-width:0}.choice-panel-option__num[_ngcontent-%COMP%]{flex:0 0 auto;display:flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:5px;font-size:11px;font-weight:700;color:var(--ng-colors-text-tertiary-600);background:var(--ng-colors-bg-secondary)}.choice-panel-option__text[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1px;min-width:0}.choice-panel-option__name[_ngcontent-%COMP%]{font-size:13px;font-weight:600;color:var(--ng-colors-text-primary-900);line-height:1.4;overflow-wrap:anywhere}.choice-panel-option__hint[_ngcontent-%COMP%]{font-size:12px;font-weight:400;line-height:1.4;color:var(--ng-colors-text-tertiary-600)}.choice-panel-option__badge[_ngcontent-%COMP%]{display:inline-block;margin-bottom:2px;font-size:10px;font-weight:700;letter-spacing:.03em;text-transform:uppercase;color:var(--ng-colors-fg-success-primary)}.choice-panel__footer[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;margin-top:10px}.choice-panel__footer--review[_ngcontent-%COMP%]{justify-content:space-between}.choice-panel__skip[_ngcontent-%COMP%]{flex:0 0 auto;padding:6px 10px;border:none;border-radius:6px;font-size:12.5px;font-weight:600;color:var(--ng-colors-text-tertiary-600);background:transparent;cursor:pointer}.choice-panel__skip[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--ng-colors-bg-secondary);color:var(--ng-colors-text-primary-900)}.choice-panel__hint[_ngcontent-%COMP%]{margin:10px 0 0;font-size:11px;color:var(--ng-colors-text-tertiary-600);text-align:center}.choice-panel__review[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}.choice-panel__review-row[_ngcontent-%COMP%]{display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding:6px 8px;border-radius:6px;background:var(--ng-colors-bg-secondary)}.choice-panel__review-title[_ngcontent-%COMP%]{font-size:12.5px;font-weight:600;color:var(--ng-colors-text-tertiary-600);flex:1 1 auto;min-width:0}.choice-panel__review-answer[_ngcontent-%COMP%]{font-size:13px;font-weight:500;color:var(--ng-colors-text-primary-900);text-align:right;flex:0 1 auto;min-width:0;max-width:55%;overflow-wrap:break-word}.ai-executive-summary[_ngcontent-%COMP%]::part(trigger){display:none}.aq-tools-pane[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1;min-height:0;overflow-y:auto;padding:16px 20px;background:var(--ng-colors-bg-secondary);scrollbar-width:none;-ms-overflow-style:none}.aq-tools-pane[_ngcontent-%COMP%]::-webkit-scrollbar{width:0;height:0}.aq-tools-pane__head[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;margin-bottom:6px}.aq-tools-pane__badge[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:28px;height:28px;flex-shrink:0;border-radius:var(--ng-radius-full, 9999px);background:var(--ng-colors-bg-brand-primary);color:var(--ng-colors-fg-brand-primary-600)}.aq-tools-pane__title[_ngcontent-%COMP%]{font-family:var(--ng-font-family-display, "Inter", system-ui, sans-serif);font-size:15px;font-weight:600;color:var(--ng-colors-text-primary-900)}.aq-tools-pane__subtitle[_ngcontent-%COMP%]{margin:0 0 18px;font-size:13px;color:var(--ng-colors-text-tertiary-600)}.aq-tools-step[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;margin-bottom:10px}.aq-tools-step__num[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:20px;height:20px;flex-shrink:0;border-radius:var(--ng-radius-full, 9999px);background:var(--ng-colors-bg-brand-solid);color:var(--ng-colors-text-white);font-size:11px;font-weight:600}.aq-tools-step__label[_ngcontent-%COMP%]{font-size:13px;font-weight:600;color:var(--ng-colors-text-primary-900)}.aq-tools-criteria[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:0 0 20px 28px;border:1px solid var(--ng-colors-border-secondary);border-radius:var(--ng-radius-md, 8px);background:var(--ng-colors-bg-primary);overflow:hidden;flex-shrink:0}.aq-tools-criteria__row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;padding:10px 12px;border:none;background:none;text-align:left;cursor:pointer;font:inherit}.aq-tools-criteria__row[_ngcontent-%COMP%] + .aq-tools-criteria__row[_ngcontent-%COMP%]{border-top:1px solid var(--ng-colors-border-tertiary)}.aq-tools-criteria__row.is-selected[_ngcontent-%COMP%]{background:var(--ng-colors-bg-brand-primary)}.aq-tools-criteria__dot[_ngcontent-%COMP%]{width:14px;height:14px;flex-shrink:0;border:1px solid var(--ng-colors-border-primary);border-radius:var(--ng-radius-full, 9999px)}.is-selected[_ngcontent-%COMP%] .aq-tools-criteria__dot[_ngcontent-%COMP%]{border:4px solid var(--ng-colors-bg-brand-solid)}.aq-tools-criteria__label[_ngcontent-%COMP%]{font-size:13px;color:var(--ng-colors-text-secondary-700)}.is-selected[_ngcontent-%COMP%] .aq-tools-criteria__label[_ngcontent-%COMP%]{color:var(--ng-colors-text-brand-secondary-700);font-weight:500}.aq-tools-criteria__row--skeleton[_ngcontent-%COMP%]{gap:10px;cursor:default}.aq-tools-criteria__row--skeleton[_ngcontent-%COMP%] + .aq-tools-criteria__row--skeleton[_ngcontent-%COMP%]{border-top:1px solid var(--ng-colors-border-tertiary)}.aq-tools-matches[_ngcontent-%COMP%]{margin:0 0 18px 28px;padding:12px;border:1px solid var(--ng-colors-border-secondary);border-radius:var(--ng-radius-md, 8px);background:var(--ng-colors-bg-primary);flex-shrink:0}.aq-tools-matches__summary[_ngcontent-%COMP%]{margin:0 0 8px;font-size:13px;color:var(--ng-colors-text-secondary-700)}.aq-tools-matches__row[_ngcontent-%COMP%]{display:flex;align-items:baseline;gap:8px;width:100%;padding:6px 4px;border-top:1px solid var(--ng-colors-border-tertiary);font:inherit}.aq-tools-matches__row[_ngcontent-%COMP%]:first-child{border-top:none}.aq-tools-matches__check[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:14px;height:14px;flex-shrink:0}.aq-tools-matches__name[_ngcontent-%COMP%]{flex:1;min-width:0;text-align:left;font-size:13px;color:var(--ng-colors-text-secondary-700);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.aq-tools-matches__days[_ngcontent-%COMP%]{font-size:13px;color:var(--ng-colors-text-quaternary-500)}.aq-tools-matches__list[_ngcontent-%COMP%]{display:flex;flex-direction:column}.aq-tools-matches__list.is-expanded[_ngcontent-%COMP%]{max-height:260px;overflow-y:auto;overscroll-behavior:contain}.aq-tools-matches__view-all[_ngcontent-%COMP%]{margin-top:8px;padding:0;border:none;background:none;cursor:pointer;font-size:12px;font-weight:600;color:var(--ng-colors-text-brand-tertiary-600)}.aq-tools-matches__view-all[_ngcontent-%COMP%]:hover{color:var(--ng-colors-text-brand-secondary-700)}.aq-tools-matches__view-all[_ngcontent-%COMP%]:disabled{cursor:default;opacity:.55}.aq-tools-matches__note[_ngcontent-%COMP%]{margin:8px 0 0;font-size:12px;color:var(--ng-colors-text-quaternary-500)}.aq-tools-matches__row--skeleton[_ngcontent-%COMP%]{cursor:default}.aq-tools-matches__empty[_ngcontent-%COMP%]{margin:4px 0 0;padding:6px 0 2px;font-size:12px;color:var(--ng-colors-text-quaternary-500)}.aq-tools-criteria__failed[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;gap:10px;padding:14px 12px}.aq-tools-matches--error[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:12px}.aq-tools-matches__error[_ngcontent-%COMP%]{margin:0;font-size:13px;color:var(--ng-colors-text-secondary-700)}.aq-tools-pane__spacer[_ngcontent-%COMP%]{flex:1;min-height:0}.aq-tools-pane__footer[_ngcontent-%COMP%]{flex-shrink:0;margin-top:4px;padding-top:12px;border-top:1px solid var(--ng-colors-border-secondary)}.aq-tools-pane__disclaimer[_ngcontent-%COMP%]{margin:0 0 10px;font-size:12px;line-height:17px;color:var(--ng-colors-text-quaternary-500)}.aq-tools-pane__actions[_ngcontent-%COMP%]{display:flex;gap:8px}.aq-tools-pane__actions[_ngcontent-%COMP%] nile-button[_ngcontent-%COMP%]{display:block;flex:1;min-width:0}.aq-tools-pane__actions[_ngcontent-%COMP%] nile-button[_ngcontent-%COMP%]::part(base){width:100%;justify-content:center;white-space:nowrap}']})};var yc=(i,t)=>t.id;function bc(i,t){if(i&1&&(s(0,"div",9),C(1,"div",12),s(2,"span"),c(3),d()()),i&2){let e=r();l(3),y(e.copy().loadingConnections)}}function vc(i,t){if(i&1){let e=k();s(0,"div",10)(1,"div",13),C(2,"nile-glyph",14),d(),s(3,"h3",15),c(4),d(),s(5,"p",16),c(6),d(),s(7,"button",7),u("click",function(){_(e);let o=r();return g(o.openForm())}),C(8,"nile-glyph",8),c(9),d()()}if(i&2){let e=r();l(4),y(e.copy().noConnectionsTitle),l(2),y(e.copy().noConnectionsSub),l(3),q(" ",e.copy().registerConnectionButton," ")}}function wc(i,t){i&1&&(s(0,"span",23),c(1,"Active"),d())}function kc(i,t){i&1&&(s(0,"span",24),c(1,"Inactive"),d())}function Pc(i,t){i&1&&(s(0,"span",25),C(1,"nile-glyph",34),c(2," Schema "),d())}function Ac(i,t){i&1&&C(0,"span",28)}function Mc(i,t){i&1&&C(0,"nile-glyph",29)}function Sc(i,t){i&1&&C(0,"span",28)}function Tc(i,t){i&1&&C(0,"nile-glyph",31)}function qc(i,t){if(i&1&&(s(0,"span",37),c(1),d()),i&2){let e=r(3).$implicit;l(),Y("",e.testResult.sampleTables.slice(0,4).join(", "),"",e.testResult.sampleTables.length>4?"\u2026":"")}}function Dc(i,t){if(i&1&&(C(0,"nile-glyph",36),s(1,"span"),c(2),d(),m(3,qc,2,2,"span",37)),i&2){let e=r(2).$implicit;l(2),q("Reachable \xB7 ",e.testResult.tableCount," tables"),l(),h(e.testResult.sampleTables.length?3:-1)}}function Fc(i,t){if(i&1&&(C(0,"nile-glyph",38),s(1,"span"),c(2),d()),i&2){let e=r(2).$implicit,n=r(2);l(2),q("Unreachable \xB7 ",e.testResult.error??n.copy().errors.connectionTestFailedFallback)}}function Oc(i,t){if(i&1&&(s(0,"div",35),m(1,Dc,4,2)(2,Fc,3,1),d()),i&2){let e=r().$implicit;W("wfconn-test-result--ok",e.testResult.reachable)("wfconn-test-result--fail",!e.testResult.reachable),l(),h(e.testResult.reachable?1:2)}}function Ec(i,t){if(i&1){let e=k();s(0,"div",18)(1,"div",19)(2,"div",20)(3,"span",21),c(4),d(),s(5,"span",22),c(6),d(),m(7,wc,2,0,"span",23)(8,kc,2,0,"span",24),m(9,Pc,3,0,"span",25),d(),s(10,"div",26)(11,"button",27),u("click",function(){let o=_(e).$implicit,a=r(2);return g(a.testConnection(o.id))}),m(12,Ac,1,0,"span",28)(13,Mc,1,0,"nile-glyph",29),c(14),d(),s(15,"button",30),u("click",function(){let o=_(e).$implicit,a=r(2);return g(a.deleteConnection(o.id,o.name))}),m(16,Sc,1,0,"span",28)(17,Tc,1,0,"nile-glyph",31),d()()(),s(18,"div",32),c(19),Nt(20,"date"),d(),m(21,Oc,3,5,"div",33),d()}if(i&2){let e=t.$implicit,n=r(2);W("wfconn-card--deleting",e.deleting),l(4),y(e.name),l(2),y(n.adapterLabel(e.adapterType)),l(),h(e.isActive?7:8),l(2),h(e.hasSchemaSnapshot?9:-1),l(2),W("wfconn-icon-btn--loading",e.testing),b("disabled",e.testing||e.deleting),l(),h(e.testing?12:13),l(2),q(" ",n.copy().testConnectionButton," "),l(),b("disabled",e.testing||e.deleting),l(),h(e.deleting?16:17),l(3),q(" Created ",Lt(20,15,e.createdAt,"mediumDate")," "),l(2),h(e.testResult?21:-1)}}function Ic(i,t){if(i&1&&(s(0,"div",11),F(1,Ec,22,18,"div",17,yc),d()),i&2){let e=r();l(),O(e.connections())}}function Vc(i,t){if(i&1){let e=k();s(0,"div",46)(1,"label",47),c(2,"Server"),d(),s(3,"input",60),u("ngModelChange",function(o){_(e);let a=r(2);return g(a.patchMssql("server",o))}),d()(),s(4,"div",46)(5,"label",47),c(6,"Database"),d(),s(7,"input",61),u("ngModelChange",function(o){_(e);let a=r(2);return g(a.patchMssql("database",o))}),d()(),s(8,"div",62)(9,"div",46)(10,"label",47),c(11,"Username"),d(),s(12,"input",63),u("ngModelChange",function(o){_(e);let a=r(2);return g(a.patchMssql("user",o))}),d()(),s(13,"div",46)(14,"label",47),c(15,"Password"),d(),s(16,"div",64)(17,"input",65),u("ngModelChange",function(o){_(e);let a=r(2);return g(a.patchMssql("password",o))}),d(),s(18,"button",66),u("click",function(){_(e);let o=r(2);return g(o.showPassword.update(a=>!a))}),C(19,"nile-glyph",67),d()()()(),s(20,"div",62)(21,"div",46)(22,"label",47),c(23,"Schema"),d(),s(24,"input",68),u("ngModelChange",function(o){_(e);let a=r(2);return g(a.patchMssql("schema",o))}),d()(),s(25,"div",69)(26,"label",47),c(27,"Port"),d(),s(28,"input",70),u("ngModelChange",function(o){_(e);let a=r(2);return g(a.patchMssql("port",+o))}),d()()()}if(i&2){let e=r(2);l(3),b("ngModel",e.mssql().server),l(4),b("ngModel",e.mssql().database),l(5),b("ngModel",e.mssql().user),l(5),b("type",e.showPassword()?"text":"password")("ngModel",e.mssql().password),l(2),M("name",e.showPassword()?"ng-eye-off":"ng-eye"),l(5),b("ngModel",e.mssql().schema),l(4),b("ngModel",e.mssql().port)}}function Rc(i,t){if(i&1){let e=k();s(0,"div",46)(1,"label",47),c(2,"URL"),d(),s(3,"input",71),u("ngModelChange",function(o){_(e);let a=r(2);return g(a.patchOpensearch("url",o))}),d()(),s(4,"div",62)(5,"div",46)(6,"label",47),c(7,"Username"),d(),s(8,"input",72),u("ngModelChange",function(o){_(e);let a=r(2);return g(a.patchOpensearch("username",o))}),d()(),s(9,"div",46)(10,"label",47),c(11,"Password"),d(),s(12,"div",64)(13,"input",65),u("ngModelChange",function(o){_(e);let a=r(2);return g(a.patchOpensearch("password",o))}),d(),s(14,"button",66),u("click",function(){_(e);let o=r(2);return g(o.showPassword.update(a=>!a))}),C(15,"nile-glyph",67),d()()()()}if(i&2){let e=r(2);l(3),b("ngModel",e.opensearch().url),l(5),b("ngModel",e.opensearch().username),l(5),b("type",e.showPassword()?"text":"password")("ngModel",e.opensearch().password),l(2),M("name",e.showPassword()?"ng-eye-off":"ng-eye")}}function zc(i,t){if(i&1){let e=k();s(0,"div",62)(1,"div",46)(2,"label",47),c(3,"Host"),d(),s(4,"input",73),u("ngModelChange",function(o){_(e);let a=r(2);return g(a.patchPostgres("host",o))}),d()(),s(5,"div",69)(6,"label",47),c(7,"Port"),d(),s(8,"input",74),u("ngModelChange",function(o){_(e);let a=r(2);return g(a.patchPostgres("port",+o))}),d()()(),s(9,"div",46)(10,"label",47),c(11,"Database"),d(),s(12,"input",61),u("ngModelChange",function(o){_(e);let a=r(2);return g(a.patchPostgres("database",o))}),d()(),s(13,"div",62)(14,"div",46)(15,"label",47),c(16,"Username"),d(),s(17,"input",75),u("ngModelChange",function(o){_(e);let a=r(2);return g(a.patchPostgres("user",o))}),d()(),s(18,"div",46)(19,"label",47),c(20,"Password"),d(),s(21,"div",64)(22,"input",65),u("ngModelChange",function(o){_(e);let a=r(2);return g(a.patchPostgres("password",o))}),d(),s(23,"button",66),u("click",function(){_(e);let o=r(2);return g(o.showPassword.update(a=>!a))}),C(24,"nile-glyph",67),d()()()(),s(25,"div",46)(26,"label",47),c(27,"Schema"),d(),s(28,"input",76),u("ngModelChange",function(o){_(e);let a=r(2);return g(a.patchPostgres("schema",o))}),d()()}if(i&2){let e=r(2);l(4),b("ngModel",e.postgres().host),l(4),b("ngModel",e.postgres().port),l(4),b("ngModel",e.postgres().database),l(5),b("ngModel",e.postgres().user),l(5),b("type",e.showPassword()?"text":"password")("ngModel",e.postgres().password),l(2),M("name",e.showPassword()?"ng-eye-off":"ng-eye"),l(4),b("ngModel",e.postgres().schema)}}function Nc(i,t){if(i&1){let e=k();s(0,"div",46)(1,"label",47),c(2,"Account"),d(),s(3,"input",77),u("ngModelChange",function(o){_(e);let a=r(2);return g(a.patchSnowflake("account",o))}),d()(),s(4,"div",62)(5,"div",46)(6,"label",47),c(7,"Database"),d(),s(8,"input",78),u("ngModelChange",function(o){_(e);let a=r(2);return g(a.patchSnowflake("database",o))}),d()(),s(9,"div",46)(10,"label",47),c(11,"Schema"),d(),s(12,"input",79),u("ngModelChange",function(o){_(e);let a=r(2);return g(a.patchSnowflake("schema",o))}),d()()(),s(13,"div",46)(14,"label",47),c(15,"Warehouse"),d(),s(16,"input",80),u("ngModelChange",function(o){_(e);let a=r(2);return g(a.patchSnowflake("warehouse",o))}),d()(),s(17,"div",62)(18,"div",46)(19,"label",47),c(20,"Username"),d(),s(21,"input",81),u("ngModelChange",function(o){_(e);let a=r(2);return g(a.patchSnowflake("user",o))}),d()(),s(22,"div",46)(23,"label",47),c(24,"Password"),d(),s(25,"div",64)(26,"input",65),u("ngModelChange",function(o){_(e);let a=r(2);return g(a.patchSnowflake("password",o))}),d(),s(27,"button",66),u("click",function(){_(e);let o=r(2);return g(o.showPassword.update(a=>!a))}),C(28,"nile-glyph",67),d()()()()}if(i&2){let e=r(2);l(3),b("ngModel",e.snowflake().account),l(5),b("ngModel",e.snowflake().database),l(4),b("ngModel",e.snowflake().schema),l(4),b("ngModel",e.snowflake().warehouse),l(5),b("ngModel",e.snowflake().user),l(5),b("type",e.showPassword()?"text":"password")("ngModel",e.snowflake().password),l(2),M("name",e.showPassword()?"ng-eye-off":"ng-eye")}}function Lc(i,t){if(i&1&&(s(0,"div",56),C(1,"nile-glyph",38),c(2),d()),i&2){let e=r(2);l(2),q(" ",e.formError()," ")}}function $c(i,t){if(i&1&&(C(0,"span",82),c(1)),i&2){let e=r(2);l(),q(" ",e.copy().registeringButton," ")}}function Wc(i,t){if(i&1&&(C(0,"nile-glyph",83),c(1)),i&2){let e=r(2);l(),q(" ",e.copy().registerAndTestButton," ")}}function Bc(i,t){if(i&1){let e=k();s(0,"div",39),u("click",function(){_(e);let o=r();return g(o.closeForm())}),d(),s(1,"aside",40)(2,"div",41)(3,"span",42),c(4),d(),s(5,"button",43),u("click",function(){_(e);let o=r();return g(o.closeForm())}),C(6,"nile-glyph",44),d()(),s(7,"div",45)(8,"div",46)(9,"label",47),c(10,"Connection name"),d(),s(11,"input",48),u("ngModelChange",function(o){_(e);let a=r();return g(a.formConnectionName.set(o))}),d()(),s(12,"div",46)(13,"label",47),c(14,"Display name "),s(15,"span",49),c(16,"(optional)"),d()(),s(17,"input",48),u("ngModelChange",function(o){_(e);let a=r();return g(a.formDisplayName.set(o))}),d()(),s(18,"div",46)(19,"label",47),c(20,"Adapter type"),d(),s(21,"select",50),u("ngModelChange",function(o){_(e);let a=r();return g(a.formAdapter.set(o))}),s(22,"option",51),c(23,"MSSQL (SQL Server)"),d(),s(24,"option",52),c(25,"OpenSearch"),d(),s(26,"option",53),c(27,"PostgreSQL"),d(),s(28,"option",54),c(29,"Snowflake"),d()()(),s(30,"div",55),c(31,"Connection config"),d(),m(32,Vc,29,8),m(33,Rc,16,5),m(34,zc,29,8),m(35,Nc,29,8),m(36,Lc,3,1,"div",56),d(),s(37,"div",57)(38,"button",58),u("click",function(){_(e);let o=r();return g(o.closeForm())}),c(39),d(),s(40,"button",59),u("click",function(){_(e);let o=r();return g(o.submitRegister())}),m(41,$c,2,1)(42,Wc,2,1),d()()()}if(i&2){let e=r();l(4),y(e.copy().registerConnectionTitle),l(7),b("ngModel",e.formConnectionName())("placeholder",e.copy().connectionNamePlaceholder),l(6),b("ngModel",e.formDisplayName())("placeholder",e.copy().displayNamePlaceholder),l(4),b("ngModel",e.formAdapter()),l(11),h(e.formAdapter()==="mssql"?32:-1),l(),h(e.formAdapter()==="opensearch"?33:-1),l(),h(e.formAdapter()==="postgres"?34:-1),l(),h(e.formAdapter()==="snowflake"?35:-1),l(),h(e.formError()?36:-1),l(2),b("disabled",e.saving()),l(),y(e.copy().cancelButton),l(),b("disabled",e.saving()),l(),h(e.saving()?41:42)}}var Fe=class i{svc=N(he);copy(){return I().copy}loading=f(!0);connections=f([]);showForm=f(!1);saving=f(!1);formConnectionName=f("Primary");formDisplayName=f("");formAdapter=f("mssql");mssql=f({server:"",database:"",user:"",password:"",schema:"gold",port:1433});opensearch=f({url:"",username:"",password:""});postgres=f({host:"",port:5432,database:"",user:"",password:"",schema:"public"});snowflake=f({account:"",database:"",schema:"",user:"",password:"",warehouse:""});showPassword=f(!1);formError=f("");hasConnections=D(()=>this.connections().length>0);async ngOnInit(){await this.loadConnections()}async loadConnections(){this.loading.set(!0);try{let t=await this.svc.listConnections();this.connections.set(t)}catch{}finally{this.loading.set(!1)}}openForm(){this.showForm.set(!0),this.formError.set("")}closeForm(){this.showForm.set(!1),this.formError.set("")}patchMssql(t,e){this.mssql.update(n=>T(w({},n),{[t]:e}))}patchOpensearch(t,e){this.opensearch.update(n=>T(w({},n),{[t]:e}))}patchPostgres(t,e){this.postgres.update(n=>T(w({},n),{[t]:e}))}patchSnowflake(t,e){this.snowflake.update(n=>T(w({},n),{[t]:e}))}buildConfig(){switch(this.formAdapter()){case"mssql":return w({},this.mssql());case"opensearch":return w({},this.opensearch());case"postgres":return w({},this.postgres());case"snowflake":return w({},this.snowflake())}}async submitRegister(){let t=this.formConnectionName().trim();if(!t){this.formError.set("Connection name is required");return}let e={productId:this.svc.productId,displayName:this.formDisplayName().trim()||void 0,connectionName:t,config:this.buildConfig()};this.saving.set(!0),this.formError.set("");try{let n=await this.svc.register(e),o={id:n.connection.id,name:n.connection.name,adapterType:n.connection.adapterType,isActive:!0,hasSchemaSnapshot:n.test.reachable,hasSemanticDoc:!1,createdAt:n.connection.createdAt,updatedAt:n.connection.createdAt,testResult:n.test};this.connections.update(a=>[o,...a]),this.closeForm(),this.showToast("success",n.test.reachable?`Connection "${t}" registered and tested successfully`:`Connection "${t}" registered (connectivity test failed: ${n.test.error??"unreachable"})`)}catch(n){this.formError.set(this.extractMessage(n,"Registration failed"))}finally{this.saving.set(!1)}}async testConnection(t){this.connections.update(e=>e.map(n=>n.id===t?T(w({},n),{testing:!0,testResult:void 0}):n));try{let e=await this.svc.testConnection(t);this.connections.update(n=>n.map(o=>o.id===t?T(w({},o),{testing:!1,testResult:e}):o))}catch{this.connections.update(e=>e.map(n=>n.id===t?T(w({},n),{testing:!1}):n))}}async deleteConnection(t,e){if(confirm(`Delete connection "${e}"? This cannot be undone.`)){this.connections.update(n=>n.map(o=>o.id===t?T(w({},o),{deleting:!0}):o));try{await this.svc.deleteConnection(t),this.connections.update(n=>n.filter(o=>o.id!==t)),this.showToast("success",`Connection "${e}" deleted`)}catch{this.connections.update(n=>n.map(o=>o.id===t?T(w({},o),{deleting:!1}):o))}}}adapterLabel(t){return{mssql:"MSSQL",opensearch:"OpenSearch",postgres:"PostgreSQL",snowflake:"Snowflake"}[t]??t}showToast(t,e){let n=document.createElement("nile-toast");n.variant=t,n.title=e,n.duration=5e3,n.closable=!0,n.toast(),$e()}extractMessage(t,e){return We(t,e)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=ke({type:i,selectors:[["app-ask-aquera-connections-page"]],decls:18,vars:5,consts:[[1,"wfconn-page"],[1,"wfconn-header"],[1,"wfconn-header__left"],["routerLink","/ask-aquera",1,"wfconn-back"],["name","ng-arrow-left","method","stroke","size","14","color","var(--ng-colors-text-secondary-700)"],[1,"wfconn-header__sep"],[1,"wfconn-header__title"],[1,"wfconn-btn","wfconn-btn--primary",3,"click"],["name","ng-plus","method","stroke","size","13","color","#fff"],[1,"wfconn-loading"],[1,"wfconn-empty"],[1,"wfconn-list"],[1,"wfconn-spinner"],[1,"wfconn-empty__icon"],["name","ng-dataflow-03","method","stroke","size","32","color","var(--ng-colors-text-placeholder)"],[1,"wfconn-empty__title"],[1,"wfconn-empty__sub"],[1,"wfconn-card",3,"wfconn-card--deleting"],[1,"wfconn-card"],[1,"wfconn-card__header"],[1,"wfconn-card__info"],[1,"wfconn-card__name"],[1,"wfconn-badge","wfconn-badge--adapter"],[1,"wfconn-badge","wfconn-badge--active"],[1,"wfconn-badge","wfconn-badge--inactive"],[1,"wfconn-badge","wfconn-badge--schema"],[1,"wfconn-card__actions"],["title","Test connectivity",1,"wfconn-icon-btn",3,"click","disabled"],[1,"wfconn-spinner","wfconn-spinner--sm"],["name","ng-activity","method","stroke","size","14"],["title","Delete connection",1,"wfconn-icon-btn","wfconn-icon-btn--danger",3,"click","disabled"],["name","ng-trash-01","method","stroke","size","14"],[1,"wfconn-card__meta"],[1,"wfconn-test-result",3,"wfconn-test-result--ok","wfconn-test-result--fail"],["name","ng-check","method","stroke","size","10"],[1,"wfconn-test-result"],["name","ng-check-circle","method","stroke","size","13"],[1,"wfconn-test-result__tables"],["name","ng-alert-circle","method","stroke","size","13"],[1,"wfconn-form-overlay",3,"click"],[1,"wfconn-form-panel"],[1,"wfconn-form-panel__header"],[1,"wfconn-form-panel__title"],[1,"wfconn-form-close",3,"click"],["name","ng-x","method","stroke","size","16"],[1,"wfconn-form-panel__body"],[1,"wfconn-field"],[1,"wfconn-label"],["type","text",1,"wfconn-input",3,"ngModelChange","ngModel","placeholder"],[1,"wfconn-label--opt"],[1,"wfconn-select",3,"ngModelChange","ngModel"],["value","mssql"],["value","opensearch"],["value","postgres"],["value","snowflake"],[1,"wfconn-divider"],[1,"wfconn-form-error"],[1,"wfconn-form-panel__footer"],[1,"wfconn-btn","wfconn-btn--secondary",3,"click","disabled"],[1,"wfconn-btn","wfconn-btn--primary",3,"click","disabled"],["type","text","placeholder","server.database.windows.net",1,"wfconn-input",3,"ngModelChange","ngModel"],["type","text","placeholder","my_database",1,"wfconn-input",3,"ngModelChange","ngModel"],[1,"wfconn-field-row"],["type","text","placeholder","sa",1,"wfconn-input",3,"ngModelChange","ngModel"],[1,"wfconn-input-wrap"],["placeholder","\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",1,"wfconn-input",3,"ngModelChange","type","ngModel"],["type","button",1,"wfconn-input-toggle",3,"click"],["method","stroke","size","14"],["type","text","placeholder","gold",1,"wfconn-input",3,"ngModelChange","ngModel"],[1,"wfconn-field","wfconn-field--sm"],["type","number","placeholder","1433",1,"wfconn-input",3,"ngModelChange","ngModel"],["type","text","placeholder","https://my-cluster.us-east-1.es.amazonaws.com",1,"wfconn-input",3,"ngModelChange","ngModel"],["type","text","placeholder","admin",1,"wfconn-input",3,"ngModelChange","ngModel"],["type","text","placeholder","localhost",1,"wfconn-input",3,"ngModelChange","ngModel"],["type","number","placeholder","5432",1,"wfconn-input",3,"ngModelChange","ngModel"],["type","text","placeholder","postgres",1,"wfconn-input",3,"ngModelChange","ngModel"],["type","text","placeholder","public",1,"wfconn-input",3,"ngModelChange","ngModel"],["type","text","placeholder","myorg-myaccount",1,"wfconn-input",3,"ngModelChange","ngModel"],["type","text","placeholder","MY_DB",1,"wfconn-input",3,"ngModelChange","ngModel"],["type","text","placeholder","PUBLIC",1,"wfconn-input",3,"ngModelChange","ngModel"],["type","text","placeholder","COMPUTE_WH",1,"wfconn-input",3,"ngModelChange","ngModel"],["type","text","placeholder","myuser",1,"wfconn-input",3,"ngModelChange","ngModel"],[1,"wfconn-spinner","wfconn-spinner--sm","wfconn-spinner--white"],["name","ng-activity","method","stroke","size","13","color","#fff"]],template:function(e,n){e&1&&(s(0,"section",0)(1,"header",1)(2,"div",2)(3,"a",3),C(4,"nile-glyph",4),s(5,"span"),c(6),d()(),s(7,"span",5),c(8,"/"),d(),s(9,"span",6),c(10),d()(),s(11,"button",7),u("click",function(){return n.openForm()}),C(12,"nile-glyph",8),c(13),d()(),m(14,bc,4,1,"div",9)(15,vc,10,3,"div",10)(16,Ic,3,0,"div",11),m(17,Bc,43,15),d()),e&2&&(l(6),y(n.copy().connectionsBreadcrumbHome),l(4),y(n.copy().connectionsTitle),l(3),q(" ",n.copy().registerConnectionButton," "),l(),h(n.loading()?14:!n.hasConnections()&&!n.showForm()?15:16),l(3),h(n.showForm()?17:-1))},dependencies:[Qe,Ye,Ke,Be,je,He,Ue,Ge,tn,Ut],styles:[".wfconn-page[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;background:var(--ng-colors-bg-secondary)}.wfconn-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:14px 24px;background:var(--ng-colors-bg-primary);border-bottom:1px solid var(--ng-colors-border-secondary);flex-shrink:0}.wfconn-header__left[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.wfconn-back[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;color:var(--ng-colors-text-secondary-700);font-size:13px;text-decoration:none;font-weight:500}.wfconn-back[_ngcontent-%COMP%]:hover{color:var(--ng-colors-text-primary-900)}.wfconn-header__sep[_ngcontent-%COMP%]{color:var(--ng-colors-text-placeholder-subtle);font-size:16px}.wfconn-header__title[_ngcontent-%COMP%]{font-size:14px;font-weight:600;color:var(--ng-colors-text-primary-900)}.wfconn-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;padding:8px 14px;border-radius:8px;font-size:13px;font-weight:500;border:none;cursor:pointer;transition:opacity .15s}.wfconn-btn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.wfconn-btn--primary[_ngcontent-%COMP%]{background:var(--ng-colors-border-brand);color:var(--ng-colors-text-white)}.wfconn-btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--ng-colors-bg-brand-solid-hover)}.wfconn-btn--secondary[_ngcontent-%COMP%]{background:var(--ng-colors-bg-primary);color:var(--ng-colors-text-secondary-700);border:1px solid var(--ng-colors-border-primary)}.wfconn-btn--secondary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--ng-colors-bg-secondary)}.wfconn-icon-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:5px;padding:6px 10px;border-radius:6px;font-size:12px;font-weight:500;border:1px solid var(--ng-colors-border-primary);background:var(--ng-colors-bg-primary);color:var(--ng-colors-text-secondary-700);cursor:pointer;transition:background .15s}.wfconn-icon-btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--ng-colors-bg-tertiary)}.wfconn-icon-btn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.wfconn-icon-btn--danger[_ngcontent-%COMP%]{color:var(--ng-colors-text-error-primary-hover)}.wfconn-icon-btn--danger[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--ng-colors-bg-error-primary);border-color:var(--ng-colors-border-error)}.wfconn-loading[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;padding:40px 24px;color:var(--ng-colors-text-quaternary-500);font-size:14px}.wfconn-empty[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;flex:1;gap:12px;padding:64px 24px;text-align:center}.wfconn-empty__icon[_ngcontent-%COMP%]{width:56px;height:56px;border-radius:12px;background:var(--ng-colors-bg-tertiary);display:flex;align-items:center;justify-content:center}.wfconn-empty__title[_ngcontent-%COMP%]{font-size:16px;font-weight:600;color:var(--ng-colors-text-primary-900);margin:0}.wfconn-empty__sub[_ngcontent-%COMP%]{font-size:14px;color:var(--ng-colors-text-quaternary-500);margin:0;max-width:380px}.wfconn-list[_ngcontent-%COMP%]{padding:20px 24px;display:flex;flex-direction:column;gap:12px;overflow-y:auto;flex:1}.wfconn-card[_ngcontent-%COMP%]{background:var(--ng-colors-bg-primary);border:1px solid var(--ng-colors-border-secondary);border-radius:10px;padding:16px 18px;transition:opacity .15s}.wfconn-card--deleting[_ngcontent-%COMP%]{opacity:.5;pointer-events:none}.wfconn-card__header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:12px}.wfconn-card__info[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.wfconn-card__name[_ngcontent-%COMP%]{font-size:14px;font-weight:600;color:var(--ng-colors-text-primary-900)}.wfconn-card__actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;flex-shrink:0}.wfconn-card__meta[_ngcontent-%COMP%]{margin-top:8px;font-size:12px;color:var(--ng-colors-text-placeholder)}.wfconn-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:4px;font-size:11px;font-weight:500}.wfconn-badge--adapter[_ngcontent-%COMP%]{background:var(--ng-colors-bg-tertiary);color:var(--ng-colors-text-secondary-700)}.wfconn-badge--active[_ngcontent-%COMP%]{background:var(--ng-colors-bg-success-primary);color:var(--ng-componentcolors-utility-success-700)}.wfconn-badge--inactive[_ngcontent-%COMP%]{background:var(--ng-colors-bg-error-primary);color:var(--ng-colors-text-error-primary-hover)}.wfconn-badge--schema[_ngcontent-%COMP%]{background:var(--ng-colors-bg-brand-primary);color:var(--ng-colors-text-brand-tertiary-600)}.wfconn-test-result[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;margin-top:10px;padding:8px 10px;border-radius:6px;font-size:12px;font-weight:500}.wfconn-test-result--ok[_ngcontent-%COMP%]{background:var(--ng-colors-bg-success-primary);color:var(--ng-componentcolors-utility-success-700)}.wfconn-test-result--fail[_ngcontent-%COMP%]{background:var(--ng-colors-bg-error-primary);color:var(--ng-colors-text-error-primary-hover)}.wfconn-test-result__tables[_ngcontent-%COMP%]{color:inherit;opacity:.7;font-weight:400;margin-left:4px}.wfconn-spinner[_ngcontent-%COMP%]{width:18px;height:18px;border:2px solid var(--ng-colors-border-secondary);border-top-color:var(--ng-colors-border-brand);border-radius:50%;animation:_ngcontent-%COMP%_wfconn-spin .7s linear infinite}.wfconn-spinner--sm[_ngcontent-%COMP%]{width:12px;height:12px;border-width:1.5px}.wfconn-spinner--white[_ngcontent-%COMP%]{border-color:#ffffff4d;border-top-color:var(--ng-colors-fg-white)}@keyframes _ngcontent-%COMP%_wfconn-spin{to{transform:rotate(360deg)}}.wfconn-form-overlay[_ngcontent-%COMP%]{position:fixed;inset:0;background:#00000040;z-index:200}.wfconn-form-panel[_ngcontent-%COMP%]{position:fixed;top:0;right:0;bottom:0;width:440px;max-width:95vw;background:var(--ng-colors-bg-primary);border-left:1px solid var(--ng-colors-border-secondary);display:flex;flex-direction:column;z-index:201;box-shadow:-4px 0 24px #00000014}.wfconn-form-panel__header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid var(--ng-colors-border-secondary);flex-shrink:0}.wfconn-form-panel__title[_ngcontent-%COMP%]{font-size:15px;font-weight:600;color:var(--ng-colors-text-primary-900)}.wfconn-form-close[_ngcontent-%COMP%]{background:none;border:none;cursor:pointer;color:var(--ng-colors-text-quaternary-500);padding:4px;border-radius:4px;display:flex}.wfconn-form-close[_ngcontent-%COMP%]:hover{background:var(--ng-colors-bg-tertiary);color:var(--ng-colors-text-secondary-700)}.wfconn-form-panel__body[_ngcontent-%COMP%]{flex:1;overflow-y:auto;padding:20px;display:flex;flex-direction:column;gap:14px}.wfconn-form-panel__footer[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;gap:10px;padding:14px 20px;border-top:1px solid var(--ng-colors-border-secondary);flex-shrink:0}.wfconn-divider[_ngcontent-%COMP%]{font-size:11px;font-weight:600;color:var(--ng-colors-text-placeholder);text-transform:uppercase;letter-spacing:.06em;padding:4px 0 2px;border-bottom:1px solid var(--ng-colors-border-tertiary)}.wfconn-field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:5px;flex:1}.wfconn-field--sm[_ngcontent-%COMP%]{max-width:100px}.wfconn-field-row[_ngcontent-%COMP%]{display:flex;gap:12px;align-items:flex-start}.wfconn-label[_ngcontent-%COMP%]{font-size:12px;font-weight:500;color:var(--ng-colors-text-secondary-700)}.wfconn-label--opt[_ngcontent-%COMP%]{font-weight:400;color:var(--ng-colors-text-placeholder)}.wfconn-input[_ngcontent-%COMP%], .wfconn-select[_ngcontent-%COMP%]{height:36px;padding:0 10px;border:1px solid var(--ng-colors-border-primary);border-radius:6px;font-size:13px;color:var(--ng-colors-text-primary-900);background:var(--ng-colors-bg-primary);width:100%;box-sizing:border-box;outline:none;transition:border-color .15s}.wfconn-input[_ngcontent-%COMP%]:focus, .wfconn-select[_ngcontent-%COMP%]:focus{border-color:var(--ng-colors-border-brand);box-shadow:0 0 0 3px var(--ng-colors-bg-brand-primary)}.wfconn-input[_ngcontent-%COMP%]::placeholder, .wfconn-select[_ngcontent-%COMP%]::placeholder{color:var(--ng-colors-text-placeholder)}.wfconn-select[_ngcontent-%COMP%]{cursor:pointer}.wfconn-input-wrap[_ngcontent-%COMP%]{position:relative;display:flex}.wfconn-input-wrap[_ngcontent-%COMP%] .wfconn-input[_ngcontent-%COMP%]{padding-right:36px}.wfconn-input-toggle[_ngcontent-%COMP%]{position:absolute;right:8px;top:50%;transform:translateY(-50%);background:none;border:none;cursor:pointer;color:var(--ng-colors-text-placeholder);padding:0;display:flex}.wfconn-input-toggle[_ngcontent-%COMP%]:hover{color:var(--ng-colors-text-secondary-700)}.wfconn-form-error[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;padding:8px 10px;background:var(--ng-colors-bg-error-primary);border-radius:6px;color:var(--ng-colors-text-error-primary-hover);font-size:12px}"]})};function Gc(i,t){i&1&&C(0,"app-ask-aquera-connections-page")}function jc(i,t){i&1&&C(0,"app-ask-aquera-page")}function Hc(i,t){if(i&1&&m(0,Gc,1,0,"app-ask-aquera-connections-page")(1,jc,1,0,"app-ask-aquera-page"),i&2){let e,n=r();h(((e=n.config())==null||e.initial==null?null:e.initial.view)==="connections"?0:1)}}var it=class i{config=lt(void 0);theme=lt(void 0);ready=Te({alias:"aq-ready"});error=Te({alias:"aq-error"});unauthorized=Te({alias:"aq-unauthorized"});host=N(Ie);stopAdopting=null;stopUi=null;themeChanged=Te({alias:"dvz-theme-changed"});themeStore=N(Wt);syncThemeInput=Ce(()=>{let t=this.theme();t&&this.themeStore.set(t)});lastAnnouncedTheme=null;announceTheme=Ce(()=>{let t=this.themeStore.resolved();if(t===this.lastAnnouncedTheme)return;let e=this.lastAnnouncedTheme===null;this.lastAnnouncedTheme=t,e||this.themeChanged.emit({theme:t,choice:this.themeStore.choice()})});tokenTimer=null;configured=!1;constructor(){Ce(()=>{let t=this.config();t&&this.apply(t)}),queueMicrotask(()=>{let t=this.host.nativeElement.shadowRoot;t&&(this.stopAdopting=qt(t))})}async apply(t){let e=t.auth;if(rn(t.api.baseUrl),Jt(t.api,e),ut({baseUrl:t.api.baseUrl,mcpUrl:t.api.mcpUrl,adminApiUrl:t.api.adminApiUrl,utilitiesUrl:t.api.utilitiesUrl,tokenizedOrigins:t.api.tokenizedOrigins,headers:t.api.headers,customerId:t.tenant.customerId??null,productId:t.tenant.productId,productName:t.tenant.productName??null,authMode:e.mode,authToken:e.mode==="token"?e.token:null,getToken:e.mode==="callback"?e.getToken:null,onUnauthorized:()=>this.unauthorized.emit(),features:t.features,ui:t.ui,copy:t.copy,routing:t.routing,initial:{dashboardId:t.initial?.dashboardId??null,conversationId:t.initial?.conversationId??null,summary:t.initial?.summary??!1},chatDefaults:{indexName:t.chatDefaults?.indexName??null,planningMode:t.chatDefaults?.planningMode??!0}}),this.stopUi?.(),this.stopUi=Dt(this.host.nativeElement,t.ui),this.themeStore.attach(this.host.nativeElement),this.theme()||this.themeStore.set(t.ui?.theme??"light"),ln({productId:t.tenant.productId,name:t.tenant.productName}),an(()=>this.unauthorized.emit()),await le(),e.mode==="callback"&&!this.tokenTimer&&(this.tokenTimer=setInterval(()=>{le()},6e4)),!this.configured){this.configured=!0;let n=I();this.ready.emit({customerId:n.customerId??"",productId:n.productId??""})}}ngOnDestroy(){this.stopAdopting?.(),this.stopUi?.(),this.tokenTimer&&clearInterval(this.tokenTimer)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=ke({type:i,selectors:[["dvz-ask-root"]],inputs:{config:[1,"config"],theme:[1,"theme"]},outputs:{ready:"aq-ready",error:"aq-error",unauthorized:"aq-unauthorized",themeChanged:"dvz-theme-changed"},decls:1,vars:1,template:function(e,n){e&1&&m(0,Hc,2,1),e&2&&h(n.config()?0:-1)},dependencies:[Fe,De],styles:[`:host{display:block;height:100%}
22
- `],encapsulation:3,changeDetection:0})};Kt();var Yc="dvz-ask";function Kc(i={}){return Yt(it,Yc,[Et(),nn([]),on(),jt(Ht([sn])),{provide:cn,useFactory:()=>I().baseUrl},{provide:Bn,useValue:"workforce/dashboards"},ze(be)],i)}Kc();export{Yc as a,Kc as b};
21
+ `).trim()}updateAssistantMsg(t,e){this.messages.update(n=>n.map(o=>{if(o.id!==t)return o;let a=typeof e=="function"?e(o):e;return"charts"in a&&this.forecastableMsgs.delete(t),w(w({},o),a)}))}scrollToBottom(){setTimeout(()=>this.aqChatEl?.nativeElement?.scrollToBottom?.("auto"),100)}showToast(t,e){let n=document.createElement("nile-toast");n.variant=t,n.title=e,n.duration=5e3,n.closable=!0,n.toast(),$e()}extractMessage(t,e){return We(t,e)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=we({type:i,selectors:[["app-ask-aquera-page"]],viewQuery:function(e,n){if(e&1&&Vt(vo,5)(_t,5)(wo,5)(ko,5)(Po,5)(pt,5),e&2){let o;fe(o=xe())&&(n.aqChatEl=o.first),fe(o=xe())&&(n.builderRef=o.first),fe(o=xe())&&(n.artifactGridRef=o.first),fe(o=xe())&&(n.composerRef=o.first),fe(o=xe())&&(n.aiExecutiveSummaryEl=o.first),fe(o=xe())&&(n.inlineChartWidgets=o)}},hostBindings:function(e,n){e&1&&u("dragover",function(a){return a.preventDefault()},ot)("drop",function(a){return a.preventDefault()},ot)("selectionchange",function(){return n.onTextSelectionChange()},Ve)("wheel",function(){return n.hideQuoteBadge()},Ve)("keydown.escape",function(){return n.hideQuoteBadge()},Ve)},features:[zt([ze(ye),_n(ue),Cn(ue),kn(ue),An(ue),Mn(ue),En(ue),Pn(),yn(xn.CURATED,Je),zn(()=>null)])],decls:41,vars:40,consts:[["composerTpl",""],["widgetDetailPanelTpl",""],["dashPickerRow",""],["aqChat",""],["inlineWidgetMenu",""],["fileInput",""],["composerEl",""],["artifactGrid",""],["aiExecutiveSummary",""],[1,"aq-shell"],["type","button",1,"reply-badge",3,"reply-badge--below","top","left"],[1,"aq-chat-pane"],[1,"wfb-header"],[1,"aq-library-pane"],[1,"aq-tools-pane"],["role","separator","aria-orientation","vertical","aria-label","Resize chat panel","title","Drag to resize",1,"aq-resizer",3,"is-active"],[1,"aq-artifact-pane",3,"aq-artifact-pane--dsl-only"],[1,"aq-builder-pane"],[3,"nile-request-close","nile-hide","label"],["label","Dashboard name",3,"nile-input","keydown.enter","placeholder","value"],["slot","footer",1,"wfb-save-dialog__actions"],["variant","secondary","size","small",3,"click"],["variant","primary","size","small",3,"click"],["placement","end",1,"forecast-drawer",3,"nile-request-close","nile-hide","label","open"],["slot","label",1,"forecast-drawer__label"],["name","ng-stars-02","method","stroke","size","16","color","#7a5af8",1,"forecast-drawer__mark"],["slot","footer",1,"fs-actions"],["placement","end",1,"prompt-gallery-drawer",3,"nile-request-close","nile-hide","label","open"],["placement","end",1,"xray-drawer",3,"nile-request-close","nile-hide","label","open"],[3,"open","widget","dashboardId","source","sourceName","authoringMode"],[1,"ai-executive-summary"],[3,"open","widget"],["type","button",1,"reply-badge",3,"click"],["name","ng-reply","method","stroke","size","14"],[1,"wfb-header__left"],["variant","toggle-button",1,"aq-chat-pane__tabs",2,"--nile-nav-tab-padding","6px 14px"],[1,"wfb-header__right"],[1,"aq-scope-chip"],["placement","bottom-end","distance","6","stay-open-on-select","",1,"scope-dropdown",3,"open"],["stay-open-on-select","","placement","bottom-end","distance","6",1,"conv-dropdown",3,"nile-hide","open"],["slot","trigger","content","Conversations"],["type","button","aria-label","Conversations",1,"aq-header-action",3,"click","disabled"],["name","ng-messages-square","method","stroke","size","18"],["searchEnabled","","customSearch","",3,"nile-search-value"],[1,"list-new",3,"click"],["slot","prefix","name","ng-plus","method","stroke","size","14","color","var(--ng-colors-border-brand)"],[1,"menu-empty"],["stay-open-on-select","","placement","bottom-end","distance","6",1,"related-dropdown",3,"open"],["content","Prompt gallery"],["variant","toggle-button",1,"aq-chat-pane__tabs",2,"--nile-nav-tab-padding","6px 14px",3,"nile-tab-change"],["slot","nav","panel","chat"],["slot","nav","panel","library"],["slot","nav","panel","tools"],["method","stroke","size","12",1,"aq-scope-chip__icon",3,"name"],[1,"aq-scope-chip__text"],["type","button","aria-label","Clear scope",1,"aq-scope-chip__clear",3,"click"],["name","ng-x-close","method","stroke","size","12"],["placement","bottom-end","distance","6","stay-open-on-select","",1,"scope-dropdown",3,"nile-hide","open"],["slot","trigger","content","Add dataset or pipeline"],["type","button","aria-label","Add dataset or pipeline",1,"aq-header-action",3,"click"],["name","ng-plus","method","stroke","size","18"],["hoist","","placement","right-start","stay-open-on-select",""],["slot","trigger",1,"scope-branch"],["name","ng-database","method","stroke","size","14",1,"scope-branch__icon"],[1,"scope-branch__label"],["name","ng-chevron-right","method","stroke","size","14",1,"scope-branch__arrow"],[1,"scope-menu__loading"],["variant","text","width","160","height","14"],["variant","text","width","120","height","14"],[1,"scope-menu__empty"],[3,"click"],[1,"scope-item__name"],["slot","suffix","name","ng-check","method","stroke","size","14","color","var(--ng-colors-border-brand)"],["name","ng-dataflow-04","method","stroke","size","14",1,"scope-branch__icon"],["aria-hidden","true",1,"menu-skeleton-item"],[1,"list-row"],["variant","rounded","width","14","height","14","border-radius","4px"],[1,"list-row__text"],["variant","text","width","100%","height","14"],["variant","text","width","60%","height","12"],[1,"list-group"],["name","ng-message-square","method","stroke","size","14",1,"list-row__icon"],["type","text",1,"list-row__rename",3,"ngModel"],[1,"list-row__actions"],["type","button",1,"list-row__act",3,"click"],["name","ng-edit-02","method","stroke","size","14"],["type","button",1,"list-row__act","list-row__act--danger",3,"click"],["name","ng-trash-01","method","stroke","size","14"],["type","text",1,"list-row__rename",3,"ngModelChange","click","keydown.enter","keydown.escape","blur","ngModel"],[1,"list-row__title",3,"title"],[1,"list-row__meta"],["stay-open-on-select","","placement","bottom-end","distance","6",1,"related-dropdown",3,"nile-hide","open"],["slot","trigger","content","Dashboards"],["type","button","aria-label","Dashboards",1,"aq-header-action",3,"click"],["name","ng-grid-01","method","stroke","size","18"],["variant","text","width","58","height","12"],["name","ng-bar-chart-square-02","method","stroke","size","14","color","var(--ng-colors-text-quaternary-500)",1,"list-row__icon"],["type","button","aria-label","Prompt gallery",1,"aq-header-action",3,"click"],["name","ng-lightbulb-05","method","stroke","size","18"],[1,"aq-library-pane__head"],[1,"aq-library-pane__intro"],[1,"aq-library-pane__intro-title"],["variant","toggle-button","fullWidth","",2,"--nile-nav-tab-padding","6px 14px",3,"nile-tab-change"],["slot","nav","panel","kpis"],[1,"aq-library-pane__tab-count"],["slot","nav","panel","templates"],[1,"aq-library-pane__body"],[1,"aq-artifact-pane__picker-overlay-footer"],["type","search","clearable","",3,"nile-input","nile-change","placeholder","value"],["slot","prefix","name","ng-search","method","stroke","size","16"],[1,"aq-picker-chips"],["aria-hidden","true",1,"aq-picker-chips"],["type","button",1,"aq-picker-chip",3,"click"],[1,"aq-picker-chip__count"],["type","button",1,"aq-picker-chip",3,"aq-picker-chip--active"],["variant","rounded","width","100%","height","28","border-radius","999px",3,"width"],["variant","rounded","width","100%","height","28","border-radius","999px"],["aria-hidden","true",1,"aq-lib-skeleton"],[1,"aq-library-group"],[1,"aq-library-group__head"],["variant","text","width","88","height","11"],["variant","text","width","52","height","12"],[1,"aq-lib-cards"],[1,"aq-lib-skeleton__kpi"],["variant","text","height","15"],["variant","text","width","64","height","30"],["variant","text","width","100%","height","12"],["variant","rectangular","width","100%","height","34","border-radius","6px"],[1,"prompt-gallery-empty"],[1,"aq-library-group__label"],["type","button",1,"aq-library-group__toggle",3,"click"],[1,"aq-lib-card-wrap",3,"aq-lib-card-wrap--selected"],[1,"aq-lib-card-wrap",3,"click"],["variant","card","sparklineType","line",3,"label","description","value","loading","sparkline","options","sparklineColor"],["type","button",1,"aq-lib-card__check",3,"click"],["name","ng-check","method","stroke","size","11","color","var(--ng-colors-fg-white)"],[1,"aq-lib-cards","aq-lib-cards--dashboards"],[1,"aq-lib-skeleton__dash"],["variant","rectangular","width","100%","height","108"],[1,"aq-lib-skeleton__dash-text"],["variant","text","width","72%","height","12"],["type","button",1,"aq-lib-card","aq-lib-card--dashboard"],["type","button",1,"aq-lib-card","aq-lib-card--dashboard",3,"click"],[1,"aq-lib-card__preview"],["aria-hidden","true",1,"aq-lib-card__viz"],["aria-hidden","true",1,"aq-lib-card__viz-empty"],[1,"aq-lib-card__chip"],[1,"aq-lib-card__row"],[1,"aq-lib-card__text"],[1,"aq-lib-card__title"],[1,"aq-lib-card__desc"],["name","ng-chevron-right","method","stroke","size","14","color","var(--ng-colors-fg-quaternary-400)"],[3,"config"],[2,"height","34%"],[2,"height","62%"],[2,"height","48%"],[2,"height","78%"],[2,"height","40%"],["name","ng-grid-01","size","10","method","stroke"],[1,"aq-artifact-pane__picker-overlay-footer-count"],["slot","prefix","name","ng-plus","method","stroke","size","14","color","var(--ng-colors-fg-white)"],[1,"aq-tools-pane__head"],[1,"aq-tools-pane__badge"],["name","ng-users-01","method","stroke","size","16","color","var(--ng-colors-fg-brand-primary-600)"],[1,"aq-tools-pane__title"],[1,"aq-tools-pane__subtitle"],[1,"aq-tools-step"],[1,"aq-tools-step__num"],[1,"aq-tools-step__label"],["role","radiogroup",1,"aq-tools-criteria"],[1,"aq-tools-criteria__failed"],["aria-hidden","true",1,"aq-tools-matches","aq-tools-matches--loading"],[1,"aq-tools-matches"],[1,"aq-tools-matches","aq-tools-matches--error"],[1,"aq-tools-pane__spacer"],[1,"aq-tools-pane__footer"],[1,"aq-tools-pane__disclaimer"],[1,"aq-tools-pane__actions"],["variant","secondary",3,"click"],["slot","prefix","name","ng-eye","method","stroke","size","15"],["variant","primary",3,"click"],["slot","prefix","name","ng-plus","method","stroke","size","16","color","var(--ng-colors-fg-white)"],["aria-hidden","true",1,"aq-tools-criteria__row","aq-tools-criteria__row--skeleton"],["variant","rounded","width","8","height","8","border-radius","50%"],["variant","text","width","70%","height","14"],[1,"aq-tools-matches__error"],["type","button","role","radio",1,"aq-tools-criteria__row",3,"is-selected"],["type","button","role","radio",1,"aq-tools-criteria__row",3,"click"],[1,"aq-tools-criteria__dot"],[1,"aq-tools-criteria__label"],["variant","text","width","220","height","14"],[1,"aq-tools-matches__row","aq-tools-matches__row--skeleton"],[1,"aq-tools-matches__check"],["variant","text","width","55%","height","14"],["variant","text","width","24","height","12"],[1,"aq-tools-matches__summary"],[1,"aq-tools-matches__empty"],["role","list",1,"aq-tools-matches__list"],["role","listitem",1,"aq-tools-matches__row"],[1,"aq-tools-matches__note"],[1,"aq-tools-matches__name"],[1,"aq-tools-matches__days"],["aria-hidden","true",1,"aq-tools-matches__row","aq-tools-matches__row--skeleton"],["type","button",1,"aq-tools-matches__view-all",3,"disabled"],["type","button",1,"aq-tools-matches__view-all",3,"click","disabled"],["variant","secondary","size","small"],[1,"welcome-wrap"],[1,"aq-chat"],[1,"welcome-section"],[1,"ai-badge","ai-badge--lg"],["name","ng-stars-02","method","stroke","size","24","color","var(--ng-colors-border-brand)"],[1,"welcome-title"],[1,"welcome-sub"],[1,"welcome-composer"],[3,"ngTemplateOutlet"],["aria-hidden","true",1,"welcome-prompts-skeleton"],[1,"welcome-prompts-skeleton__item"],["variant","rounded","width","18","height","18","border-radius","4px",1,"welcome-prompts-skeleton__icon"],[1,"welcome-prompts-skeleton__label"],[1,"welcome-prompts"],[1,"prompt-gallery-row"],["type","button",1,"prompt-card",3,"prompt-card--ai"],["type","button",1,"prompt-card",3,"click"],["method","stroke","size","18",1,"prompt-card__icon"],[1,"prompt-card__label"],[1,"prompt-card__badge"],["type","button",1,"prompt-gallery-link"],["type","button",1,"prompt-gallery-link",3,"click"],["name","ng-lightbulb-05","method","stroke","size","14"],["name","ng-database-zap","method","stroke","size","14"],[1,"aq-chat",3,"mouseup"],["slot","footer",1,"input-area"],[1,"msg-skeleton","msg-skeleton--user"],["variant","rounded","width","260","height","44","border-radius","16px"],[1,"msg-skeleton","msg-skeleton--ai"],["variant","text","width","88%","height","18"],["variant","text","width","72%","height","18"],["variant","rectangular","width","100%","height","300","border-radius","12px"],["variant","rounded","width","190","height","44","border-radius","16px"],["variant","text","width","80%","height","18"],["variant","text","width","55%","height","18"],[1,"ai-bubble","ai-bubble--user",3,"role"],[1,"sent-quote"],[1,"answer-summary"],[1,"aq-sent-text"],[1,"aq-attachments","aq-attachments--sent"],["name","ng-text-quote","method","stroke","size","12"],[1,"sent-quote__text"],[1,"answer-summary__row"],["name","ng-check","method","stroke","size","14","color","var(--ng-colors-border-brand)",1,"answer-summary__check"],[1,"answer-summary__content"],[1,"answer-summary__title"],[1,"answer-summary__answer"],[1,"aq-chip","aq-chip--static"],["method","stroke","size","14",1,"aq-chip__icon"],[1,"aq-chip__name"],["max-visible","3",1,"ai-bubble__steps",3,"steps"],[1,"ai-bubble",3,"role","hideIcon"],[1,"ai-bubble__content"],[1,"choice-picker"],["type","button",1,"choice-picker__step","choice-picker__resume-chip"],[1,"inline-widget"],[1,"forecast-record"],[1,"follow-ups"],["role","alert",1,"assistant-error"],[1,"assistant-text",3,"text","speedMs"],[1,"assistant-text","assistant-text--md",3,"value"],[1,"choice-picker__step"],[1,"choice-picker__group"],[1,"choice-picker__empty"],[1,"choice-picker__group",3,"nile-change"],[1,"choice-card",3,"choice-card--chosen","choice-card--locked"],[1,"choice-card"],[1,"choice-card__label"],[1,"choice-card__num"],[1,"choice-card__text"],[1,"choice-card__badge"],[1,"choice-card__name"],[1,"choice-card__hint"],[1,"choice-card__meta"],[3,"class"],[1,"choice-picker__footer-actions"],[1,"choice-picker__chat-draft"],["type","button",1,"choice-picker__chat-link",3,"click","disabled"],["type","button",1,"choice-picker__chat-link",3,"disabled"],["type","button",1,"choice-picker__chat-link","choice-picker__chat-link--preview",3,"disabled"],["name","ng-edit-02","method","stroke","size","12"],["type","button",1,"choice-picker__chat-link","choice-picker__chat-link--preview",3,"click","disabled"],["name","ng-eye","method","stroke","size","12"],[1,"choice-picker__chat-draft-label"],[1,"choice-picker__chat-draft-row"],[1,"choice-picker__chat-draft-input",3,"nile-input","keydown.enter","value"],["type","button",1,"choice-picker__step","choice-picker__resume-chip",3,"click"],[3,"aiSend","config","loading","widgetId","conversationId"],[1,"chart-live"],[1,"chart-live","chart-live--preview"],["hoist","","placement","bottom-end","distance","6",1,"widget-header-dropdown"],["hoist","","placement","bottom-end","distance","6",1,"widget-header-dropdown",3,"open"],[1,"forecast-meta"],[1,"inline-widget__actions"],[1,"chart-live__dot"],["slot","trigger","type","button","aria-label","Chart actions",1,"widget-header-btn"],["name","ng-dots-vertical","method","stroke","size","16"],["role","separator",1,"widget-menu__sep"],[1,"widget-menu__item",3,"click"],[1,"widget-menu__label"],["size","15",3,"name","method","color"],["size","15",3,"name","method"],["hoist","","placement","bottom-end","distance","6",1,"widget-header-dropdown",3,"nile-hide","open"],["slot","trigger","aria-hidden","true",1,"widget-header-anchor"],[1,"type-picker__panel"],[1,"inline-action__loading"],[1,"inline-action__hint"],[1,"inline-action__error"],["size","16"],[1,"type-picker__section"],[1,"type-picker__grid"],["type","button",1,"type-picker__tile","type-picker__tile--sensible"],["type","button",1,"type-picker__tile","type-picker__tile--sensible",3,"click"],["method","stroke","size","16",3,"name"],["type","button",1,"type-picker__tile"],["type","button",1,"type-picker__tile",3,"click"],[1,"filter-builder__panel"],[1,"filter-builder__active"],[1,"filter-builder__chip"],["type","button",1,"filter-builder__chip-remove",3,"click"],["name","ng-x-close","method","stroke","size","10"],[1,"filter-builder__form"],[1,"filter-builder__select",3,"ngModelChange","ngModel"],[3,"value"],["size","14"],["type","text",1,"filter-builder__input",3,"placeholder","ngModel"],[1,"filter-builder__multi"],[1,"filter-builder__select",3,"ngModel"],["type","text",1,"filter-builder__input",3,"ngModelChange","keydown.enter","placeholder","ngModel"],["type","date",1,"filter-builder__input",3,"ngModelChange","ngModel"],[1,"filter-builder__and"],["type","number",1,"filter-builder__input",3,"ngModelChange","keydown.enter","placeholder","ngModel"],["type","number",1,"filter-builder__input",3,"ngModelChange","placeholder","ngModel"],[1,"filter-builder__multi-item"],["type","checkbox",3,"change","checked"],["value","","disabled",""],[1,"forecast-meta__item"],[1,"forecast-meta__label"],[1,"forecast-meta__value"],["variant","secondary","size","small",3,"click","disabled"],["variant","secondary","size","small",3,"disabled"],["variant","primary","size","small",3,"click","disabled"],["slot","prefix","name","ng-library","method","stroke","size","14"],["placement","top-end","distance","6",1,"dash-picker",3,"open"],["variant","primary","size","small"],["placement","top-end","distance","6",1,"dash-picker",3,"nile-hide","open"],["slot","trigger","variant","primary","size","small","caret","",3,"click"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"chart-card",3,"click"],[1,"chart-card__icon"],["name","ng-bar-chart-square-02","method","stroke","size","18","color","var(--ng-colors-border-brand)"],[1,"chart-card__body"],[1,"chart-card__title"],[1,"chart-card__meta"],["slot","suffix","name","ng-chevron-right","method","stroke","size","14","color","var(--ng-colors-fg-white)"],["name","clock-rewind","method","stroke","size","13","color","var(--ng-colors-text-quaternary-500)",1,"forecast-record__icon"],[1,"forecast-record__text"],["type","button",1,"forecast-record__action",3,"click","disabled"],["type","button",1,"follow-up",3,"follow-up--ai","disabled"],["type","button",1,"follow-up",3,"click","disabled"],["method","stroke","size","14",1,"follow-up__icon"],[1,"follow-up__label"],[1,"follow-up__badge"],["name","ng-alert-circle","method","stroke","size","16",1,"assistant-error__icon"],[1,"assistant-error__text"],[1,"choice-panel"],[1,"choice-panel__header"],[1,"choice-panel__count"],[1,"choice-panel__nav-group"],["type","button",1,"choice-panel__nav",3,"click"],["name","ng-chevron-left","method","stroke","size","14"],["name","ng-chevron-right","method","stroke","size","14"],["type","button",1,"choice-panel__nav","choice-panel__close",3,"click"],["name","ng-x","method","stroke","size","14"],[1,"choice-panel__options",3,"nile-change"],[1,"choice-panel-option"],[1,"choice-panel__hint"],[1,"choice-panel-option",3,"click"],[1,"choice-panel-option__label"],[1,"choice-panel-option__num"],[1,"choice-panel-option__text"],[1,"choice-panel-option__badge"],[1,"choice-panel-option__name"],[1,"choice-panel-option__hint"],["type","button",1,"choice-panel__skip",3,"click"],[1,"choice-panel__review"],[1,"choice-panel__review-row"],[1,"choice-panel__footer","choice-panel__footer--review"],[1,"choice-panel__review-title"],[1,"choice-panel__review-answer"],[1,"aq-composer-wrap",3,"dragenter","dragover","dragleave","drop"],[1,"aq-drop-overlay"],[1,"reply-quote"],[1,"aq-attachments"],["type","file","multiple","","hidden","",3,"change"],[1,"aq-composer",3,"keydown","nile-change","nile-submit","nile-stop","placeholder","hideModel","hideAddContext","rows","speechLang","value","loading"],["slot","toolbar-extras",3,"click"],["variant","ghost","size","small","title","Attach a file","aria-label","Attach a file",1,"aq-attach-btn"],["name","ng-upload-cloud-02","method","stroke","size","20"],[1,"reply-quote__text"],["type","button","aria-label","Remove quote",1,"reply-quote__dismiss",3,"click"],["name","ng-x","method","stroke","size","12"],[1,"aq-chip",3,"aq-chip--error"],[1,"aq-chip"],["size","12",1,"aq-chip__spin"],["type","button",1,"aq-chip__retry"],["type","button","aria-label","Remove attachment",1,"aq-chip__remove",3,"click"],["type","button",1,"aq-chip__retry",3,"click"],["variant","ghost","size","small","title","Attach a file","aria-label","Attach a file",1,"aq-attach-btn",3,"click"],["name","ng-paperclip","method","stroke","size","16"],["role","separator","aria-orientation","vertical","aria-label","Resize chat panel","title","Drag to resize",1,"aq-resizer",3,"pointerdown"],[1,"aq-artifact-pane"],[1,"aq-artifact-pane__header"],[1,"aq-artifact-pane__body"],[1,"aq-artifact-pane__empty"],[3,"widgets","filtersEnabled","conversationId","editMode","selectable","canSetAlert","canAddToStory","canForecast","showWidgetMenu","canAsk","canChangeChartType","canManageFilters","canCustomizeColors","canViewChartData","canExportPng","canExportCsv","canPrint","forecastable","forecastingWidgetId","showEditDslInViewMode","widgetsLoading","dashboardFilters","resolvedFilters","applySummary","filterExplanation","detailPanel","detailRootLabel"],[1,"aq-artifact-pane__footer"],[1,"aq-artifact-pane__titles"],[1,"aq-artifact-pane__title"],[1,"aq-artifact-pane__subtitle"],[1,"aq-artifact-pane__header-actions"],[1,"aq-filters-pill",3,"aq-filters-pill--active"],[1,"aq-undo-redo-group"],["aria-hidden","true",1,"aq-artifact-pane__header-divider"],["circle","","variant","ghost","size","small",3,"click"],["name","ng-x","method","stroke","size","16"],[1,"aq-filters-pill"],["name","ng-filter-lines","method","stroke","size","14",1,"aq-filters-pill__icon"],["label","Filters","textPosition","left",3,"nile-change","isChecked"],["variant","ghost","hide-border","","size","small","aria-label","Undo",3,"click"],["slot","prefix","name","ng-undo","method","stroke","size","16","color","var(--ng-colors-text-secondary-700)"],["circle","","variant","ghost","hide-border","","size","small","aria-label","Redo","title","Redo",3,"click"],["name","ng-redo","method","stroke","size","16"],["name","ng-layout-grid","method","stroke","size","28","color","var(--ng-colors-fg-quaternary-400)"],[1,"aq-artifact-pane__empty-title"],[1,"aq-artifact-pane__empty-sub"],[3,"selectionChange","forecast","setAlert","filterSubmit","filterChange","dslWidgetUpdated","dslEditorClosed","widgetClick","aiSend","widgets","filtersEnabled","conversationId","editMode","selectable","canSetAlert","canAddToStory","canForecast","showWidgetMenu","canAsk","canChangeChartType","canManageFilters","canCustomizeColors","canViewChartData","canExportPng","canExportCsv","canPrint","forecastable","forecastingWidgetId","showEditDslInViewMode","widgetsLoading","dashboardFilters","resolvedFilters","applySummary","filterExplanation","detailPanel","detailRootLabel"],["hoist","","placement","top-end","distance","6",1,"dash-picker",3,"open"],["slot","prefix","name","ng-trend-up-01","method","stroke","size","14","color","#7a5af8"],["slot","prefix","name","ng-book-open-text","method","stroke","size","14"],["hoist","","placement","top-end","distance","6",1,"dash-picker",3,"nile-hide","open"],[1,"wfb-header","aq-builder-pane__header"],["name","ng-arrow-left","method","stroke","size","16"],["variant","text","width","180","height","16"],[3,"content"],["type","button",1,"aq-header-action",3,"click"],["method","stroke","size","18"],[3,"action","canToggleFilter","hasFilter","canForecast","anyForecastOn","editMode","showFullscreen","fullscreen","busy","exporting","showPromptGallery","canPublish"],[3,"exitBuilder","executiveSummary","galleryPrompt","published","widgetClick","dashboardId","preseeded","galleryPrompts","canAddToStory","showWidgetMenu","canAsk","canChangeChartType","canManageFilters","canCustomizeColors","canViewChartData","canExportPng","canExportCsv","canPrint","canTweak","canEdit","canDelete"],["autofocus","",1,"conv-title-input",3,"input","keydown.enter","keydown.escape","value"],["content","Save name"],["type","button","aria-label","Save dashboard name",1,"aq-header-action",3,"click","disabled"],["size","14",1,"aq-header-action__spinner"],["name","ng-check","method","stroke","size","18","color","var(--ng-colors-border-brand)"],[1,"wfb-header__title"],["content","Rename dashboard"],["type","button","aria-label","Rename dashboard",1,"aq-header-action",3,"click"],["name","ng-edit-02","method","stroke","size","16"],[1,"fs-section"],["for","fs-horizon",1,"fs-label"],[1,"fs-label__value"],["id","fs-horizon","type","range","min","1","step","1",1,"fs-slider",3,"input","value"],[1,"fs-hint"],["id","fs-gran-label",1,"fs-label"],["role","radiogroup","aria-labelledby","fs-gran-label",1,"fs-segmented"],[1,"fs-segment",3,"fs-segment--on","fs-segment--off"],["for","fs-confidence",1,"fs-label"],["id","fs-confidence","type","range","min","0","step","1",1,"fs-slider","fs-slider--ai",3,"input","value"],[1,"fs-segment"],["type","radio","name","fs-granularity",1,"fs-segment__input",3,"change","value","checked","disabled"],[1,"fs-label"],[1,"fs-card","fs-card--ai"],[1,"fs-card__title"],[1,"fs-card__body"],[1,"fs-card"],["method","stroke","size","14"],["type","search","clearable","",1,"prompt-gallery-search",3,"nile-input","nile-change","placeholder","value"],["aria-hidden","true",1,"prompt-gallery-skeleton"],[1,"prompt-gallery-prompts",3,"items","vertical","wrap"],[1,"prompt-gallery-skeleton__item"],["variant","rounded","width","16","height","16","border-radius","4px"],[1,"prompt-gallery-skeleton__label"],[1,"prompt-gallery-prompts",3,"nile-item-click","items","vertical","wrap"],[1,"xray-status"],["placement","bottom-start","distance","4",1,"xray-dataset-dropdown",3,"open"],["type","search","clearable","",1,"xray-search",3,"nile-input","nile-change","placeholder","value"],[1,"xray-focus",3,"open"],[1,"xray-focus__toggle"],["name","ng-target","method","stroke","size","14"],[1,"xray-focus__input",3,"nile-input","nile-change","placeholder","value"],[1,"xray-error"],[1,"xray-running"],[1,"xray-entities"],["placement","bottom-start","distance","4",1,"xray-dataset-dropdown",3,"nile-hide","open"],["slot","trigger","type","button",1,"xray-picker",3,"click"],["name","ng-database","method","stroke","size","15"],[1,"xray-picker__label"],["name","ng-chevron-down","method","stroke","size","14",1,"xray-picker__caret"],[1,"xray-picker__item"],["name","ng-alert-circle","method","stroke","size","15"],["size","20"],[1,"xray-running__title"],[1,"xray-running__sub"],[1,"xray-entity","xray-entity--skeleton"],["variant","text","height","14",3,"width"],[1,"xray-listhead"],[1,"xray-listhead__count"],[1,"xray-listhead__hint"],["type","button",1,"xray-entity",3,"disabled","title"],["type","button",1,"xray-entity",3,"click","disabled","title"],["method","stroke","size","16",1,"xray-entity__kind",3,"name"],[1,"xray-entity__name"],[1,"xray-entity__schema"],[1,"xray-entity__meta"],[1,"xray-entity__go"],[1,"aq-detail-overlay"],[1,"aq-detail-overlay__crumbs"],[3,"nile-click"],["variant","text","width","160","height","16"],[1,"aq-detail-overlay__body"],[1,"aq-detail-overlay__caption"],[3,"widgets","editMode","selectable","selectedWidgetIds","canSetAlert","canAddToStory","canForecast","showWidgetMenu"],[1,"aq-detail-overlay__footer"],[1,"aq-detail-skeleton-grid",3,"height"],[1,"aq-detail-skeleton"],[1,"aq-detail-skeleton-grid"],["variant","rectangular","border-radius","12px","width","100%","height","100%",1,"aq-detail-skeleton-slot",3,"left","top","width","height"],["variant","rectangular","border-radius","12px","width","100%","height","100%",1,"aq-detail-skeleton-slot"],[1,"aq-detail-skeleton__row"],["variant","rectangular","width","100%","height","96","border-radius","12px"],["variant","rectangular","width","100%","height","280","border-radius","12px"],[3,"selectionChange","widgets","editMode","selectable","selectedWidgetIds","canSetAlert","canAddToStory","canForecast","showWidgetMenu"],[1,"aq-detail-overlay__select-count"],["slot","prefix","name","ng-plus","method","stroke","size","14","color","var(--ng-colors-fg-quaternary-400)"],["slot","prefix","name","ng-layout-grid","method","stroke","size","14","color","var(--ng-colors-fg-white)"],["slot","prefix","name","ng-download-01","method","stroke","size","14","color","var(--ng-colors-fg-white)"],["slot","prefix","name","ng-copy","method","stroke","size","14"],[3,"closed","saved","open","widget","dashboardId","source","sourceName","authoringMode"],[3,"closed","added","open","widget"]],template:function(e,n){if(e&1&&(s(0,"section",9),m(1,Oo,3,7,"button",10),s(2,"div",11),m(3,fa,19,10,"header",12),m(4,Xa,21,10,"div",13),m(5,kr,36,12,"div",14),m(6,$s,2,1),ke(7,Ks,10,16,"ng-template",null,0,Re),d(),m(9,Qs,1,2,"div",15),m(10,md,7,6,"aside",16),m(11,vd,15,32,"section",17),s(12,"nile-dialog",18),u("nile-request-close",function(){return n.saveDialogOpen.set(!1)})("nile-hide",function(){return n.saveDialogOpen.set(!1)}),s(13,"nile-input",19),u("nile-input",function(a){return n.saveDashboardName.set(a.detail.value)})("keydown.enter",function(){return n.confirmSaveDashboard()}),d(),s(14,"div",20)(15,"nile-button",21),u("click",function(){return n.saveDialogOpen.set(!1)}),c(16),d(),s(17,"nile-button",22),u("click",function(){return n.confirmSaveDashboard()}),c(18),d()()(),s(19,"nile-drawer",23),u("nile-request-close",function(){return n.closeForecastSettings()})("nile-hide",function(){return n.closeForecastSettings()}),s(20,"span",24),C(21,"nile-glyph",25),s(22,"span"),c(23),d()(),m(24,Td,1,1),s(25,"div",26)(26,"nile-button",21),u("click",function(){return n.closeForecastSettings()}),c(27),d(),s(28,"nile-button",22),u("click",function(){return n.applyForecastSettings()}),c(29),d()()(),s(30,"nile-drawer",27),u("nile-request-close",function(){return n.closeGallery()})("nile-hide",function(){return n.closeGallery()}),m(31,Id,6,3),d(),s(32,"nile-drawer",28),u("nile-request-close",function(){return n.closeXray()})("nile-hide",function(){return n.closeXray()}),m(33,Jd,3,1),d(),ke(34,_c,1,1,"ng-template",null,1,Re),m(36,gc,1,6,"app-alert-drawer",29),m(37,uc,2,0,"nile-executive-summary",30),d(),m(38,mc,1,2,"app-story-picker-drawer",31),ke(39,hc,7,3,"ng-template",null,2,Re)),e&2){let o,a;W("aq-shell--fullscreen",n.builderFullscreen())("aq-shell--resizing",n.isResizing()),M("data-mode",n.layoutMode()),l(),h((o=n.quoteBadge())?1:-1,o),l(),Z("flex-basis",n.chatPaneStyleWidth(),"px")("max-width",n.chatPaneStyleWidth(),"px"),l(),h(n.showHeader()?3:-1),l(),h(n.features().library&&n.chatPaneTab()==="library"?4:-1),l(),h(n.features().tools&&n.chatPaneTab()==="tools"?5:-1),l(),h(n.chatPaneTab()==="chat"?6:-1),l(3),h((n.layoutMode()==="split"||n.layoutMode()==="builder")&&!n.builderFullscreen()?9:-1),l(),h(n.artifactOpen()?10:-1),l(),h(n.builderOpen()?11:-1),l(),b("label",n.copy().saveDashboardDialogLabel),M("open",n.saveDialogOpen()?"":null),l(),b("placeholder",n.copy().dashboardNamePlaceholder)("value",n.saveDashboardName()),l(3),y(n.copy().cancelButton),l(),M("loading",n.savingDashboard()?"":null)("disabled",!n.saveDashboardName().trim()||n.savingDashboard()?"":null),l(),q(" ",n.copy().saveDashboardButton," "),l(),b("label",n.copy().forecastSettingsLabel)("open",n.forecastSettingsOpen()),l(4),y(n.copy().forecastSettingsLabel),l(),h((a=n.forecastDraft())?24:-1,a),l(3),y(n.copy().cancelButton),l(2),y(n.copy().applyButton),l(),b("label",n.copy().promptGalleryLabel)("open",n.galleryOpen()),l(),h(n.galleryOpen()?31:-1),l(),b("label",n.copy().xrayDrawerTitle)("open",n.xrayOpen()),l(),h(n.xrayOpen()?33:-1),l(3),h(n.features().alerts?36:-1),l(),h(n.features().executiveSummary?37:-1),l(),h(-1)}},dependencies:[Bt,Qe,Ye,Ke,Be,je,He,Ue,Ge,Hn,jn,pt,Nn,_t,Bn,Yn],styles:['@charset "UTF-8";[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%;overflow:hidden;position:relative;font-family:var(--ng-font-family-body, "Inter", system-ui, sans-serif);background:var(--ng-colors-bg-active);color:var(--ng-colors-text-primary-900)}.wfb-page[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}.aq-header-action[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:0;outline:0;background:transparent;color:var(--ng-colors-text-tertiary-600);cursor:pointer;border-radius:6px;flex-shrink:0}.aq-header-action[_ngcontent-%COMP%]:hover, .aq-header-action[_ngcontent-%COMP%]:focus, .aq-header-action[_ngcontent-%COMP%]:focus-visible{outline:0;background:var(--ng-colors-bg-active);color:var(--ng-colors-text-primary-900)}.aq-header-action[_ngcontent-%COMP%]:disabled{opacity:.4;cursor:not-allowed}.wfb-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;box-sizing:border-box;height:var(--aq-header-h, 56px);padding:0 20px;border-bottom:1px solid var(--ng-colors-border-secondary);background:var(--ng-colors-bg-primary);flex-shrink:0;gap:12px}.wfb-header__left[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;min-width:0;flex:1 1 auto}.wfb-header__title[_ngcontent-%COMP%]{font-size:14px;font-weight:600;color:var(--ng-colors-text-primary-900);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}.wfb-header__right[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;flex-shrink:0}.aq-scope-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;max-width:220px;height:24px;padding:0 4px 0 8px;border-radius:999px;border:1px solid var(--ng-colors-border-secondary);background:var(--ng-colors-bg-secondary);color:var(--ng-colors-text-tertiary-600);font-size:12px;font-weight:500;flex-shrink:0}.aq-scope-chip__icon[_ngcontent-%COMP%]{flex-shrink:0}.aq-scope-chip__text[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.aq-scope-chip__clear[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;border:0;border-radius:50%;background:transparent;color:inherit;cursor:pointer;flex-shrink:0}.aq-scope-chip__clear[_ngcontent-%COMP%]:hover{background:var(--ng-colors-bg-active);color:var(--ng-colors-text-primary-900)}.scope-branch[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;width:100%}.scope-branch__label[_ngcontent-%COMP%]{flex:1}.scope-branch__icon[_ngcontent-%COMP%], .scope-branch__arrow[_ngcontent-%COMP%]{flex-shrink:0}.scope-menu__loading[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px;padding:8px 12px;max-width:max-content}.scope-menu__empty[_ngcontent-%COMP%]{padding:8px 12px;color:var(--ng-colors-text-tertiary-600);font-size:13px}.scope-item__name[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:240px}.conv-trigger__label[_ngcontent-%COMP%]{display:inline-block;max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle}.conv-title-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;border:none;background:transparent;padding:4px 2px 4px 6px;border-radius:6px;cursor:pointer;max-width:360px}.conv-title-btn[_ngcontent-%COMP%] .wfb-header__title[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;font-weight:400;color:var(--ng-colors-text-secondary-700)}.conv-title-btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--ng-colors-bg-tertiary)}.conv-title-btn[_ngcontent-%COMP%]:disabled{cursor:default}.conv-title-btn__edit[_ngcontent-%COMP%]{flex-shrink:0;opacity:0;transition:opacity .12s}.conv-title-btn[_ngcontent-%COMP%]:hover:not(:disabled) .conv-title-btn__edit[_ngcontent-%COMP%]{opacity:1}.conv-title-input[_ngcontent-%COMP%]{font-family:inherit;font-size:14px;font-weight:400;color:var(--ng-colors-text-secondary-700);border:1px solid var(--ng-colors-border-brand);border-radius:6px;padding:4px 8px;outline:none;min-width:220px;box-shadow:0 0 0 3px var(--ng-colors-bg-brand-primary)}.header-conn-wrap[_ngcontent-%COMP%]{position:relative}.header-conn-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;padding:5px 10px;background:var(--ng-colors-bg-primary);border:1px solid var(--ng-colors-border-primary);border-radius:8px;font-size:12px;font-weight:500;color:var(--ng-colors-text-secondary-700);cursor:pointer;transition:border-color .15s,box-shadow .15s;white-space:nowrap;max-width:200px}.header-conn-chip[_ngcontent-%COMP%]:hover:not(:disabled){border-color:var(--ng-colors-fg-quaternary-400);box-shadow:0 1px 3px #10182814}.header-conn-chip--open[_ngcontent-%COMP%]{border-color:var(--ng-colors-border-brand);box-shadow:0 0 0 3px var(--ng-colors-bg-brand-primary)}.header-conn-chip[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.header-conn-chip__label[_ngcontent-%COMP%]{flex:1;overflow:hidden;text-overflow:ellipsis;max-width:150px}.header-conn-chip__chevron[_ngcontent-%COMP%]{flex-shrink:0;transition:transform .15s}.header-conn-chip__chevron--open[_ngcontent-%COMP%]{transform:rotate(180deg)}.header-conn-chip__spinner[_ngcontent-%COMP%]{width:12px;height:12px;border:1.5px solid var(--ng-colors-border-secondary);border-top-color:var(--ng-colors-border-brand);border-radius:50%;animation:_ngcontent-%COMP%_spin .7s linear infinite;flex-shrink:0}.header-conn-dropdown[_ngcontent-%COMP%]{position:absolute;top:calc(100% + 6px);right:0;min-width:200px;background:var(--ng-colors-bg-primary);border:1px solid var(--ng-colors-border-secondary);border-radius:10px;box-shadow:0 8px 24px #1018281f;z-index:20;overflow:hidden}.header-conn-dropdown__item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:8px 12px;font-size:12px;color:var(--ng-colors-text-secondary-700);cursor:pointer;transition:background .1s}.header-conn-dropdown__item[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:1}.header-conn-dropdown__item[_ngcontent-%COMP%]:hover{background:var(--ng-colors-bg-secondary)}.header-conn-dropdown__item--active[_ngcontent-%COMP%]{background:var(--ng-colors-bg-brand-primary);color:var(--ng-colors-border-brand);font-weight:500}.header-conn-dropdown__check[_ngcontent-%COMP%]{color:var(--ng-colors-border-brand);flex-shrink:0}.header-conn-dropdown__delete[_ngcontent-%COMP%]{flex-shrink:0;opacity:0;color:var(--ng-colors-text-quaternary-500);transition:opacity .1s,color .1s}.header-conn-dropdown__item-title[_ngcontent-%COMP%]{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.header-conn-dropdown__item[_ngcontent-%COMP%]:hover .header-conn-dropdown__delete[_ngcontent-%COMP%]{opacity:1}.header-conn-dropdown__item[_ngcontent-%COMP%]:hover .header-conn-dropdown__delete[_ngcontent-%COMP%]:hover{color:var(--ng-colors-fg-error-primary)}.header-conn-dropdown__item--new[_ngcontent-%COMP%]{color:var(--ng-colors-border-brand);font-weight:500;border-bottom:1px solid var(--ng-colors-border-tertiary);padding-bottom:10px;margin-bottom:2px}.header-new-chat[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:5px;padding:5px 10px;background:transparent;border:1px solid var(--ng-colors-border-primary);border-radius:8px;font-size:12px;font-weight:500;color:var(--ng-colors-text-secondary-700);cursor:pointer;font-family:inherit;white-space:nowrap;transition:border-color .15s,background .15s}.header-new-chat[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--ng-colors-bg-secondary);border-color:var(--ng-colors-fg-quaternary-400)}.header-new-chat[_ngcontent-%COMP%]:disabled{opacity:.4;cursor:not-allowed}.ai-badge[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:50%;background:var(--ng-colors-bg-brand-primary);flex-shrink:0}.ai-badge--sm[_ngcontent-%COMP%]{width:22px;height:22px}.ai-badge--lg[_ngcontent-%COMP%]{width:48px;height:48px}.conv-dropdown[_ngcontent-%COMP%]{margin-left:-8px}.conv-dropdown[_ngcontent-%COMP%] nile-button[_ngcontent-%COMP%]::part(base){padding-left:2px;padding-right:2px}.conv-dropdown[_ngcontent-%COMP%]::part(panel){width:380px;max-width:90vw;overflow:hidden}.conv-dropdown[_ngcontent-%COMP%] nile-menu[_ngcontent-%COMP%]::part(menu__items-wrapper), .related-dropdown[_ngcontent-%COMP%] nile-menu[_ngcontent-%COMP%]::part(menu__items-wrapper), .dash-picker[_ngcontent-%COMP%] nile-menu[_ngcontent-%COMP%]::part(menu__items-wrapper){max-height:340px;overflow-x:hidden}.related-trigger__label[_ngcontent-%COMP%]{display:inline-block;max-width:0;overflow:hidden;white-space:nowrap;opacity:0;transition:max-width .2s ease,opacity .15s ease}.related-trigger[_ngcontent-%COMP%]:hover .related-trigger__label[_ngcontent-%COMP%], .related-trigger[_ngcontent-%COMP%]:focus-visible .related-trigger__label[_ngcontent-%COMP%]{max-width:120px;opacity:1}.dash-picker[_ngcontent-%COMP%]::part(panel){width:420px;max-width:92vw;overflow:hidden}.related-dropdown[_ngcontent-%COMP%]::part(panel){width:420px;max-width:90vw;overflow:hidden}.conv-dropdown[_ngcontent-%COMP%] nile-menu[_ngcontent-%COMP%], .related-dropdown[_ngcontent-%COMP%] nile-menu[_ngcontent-%COMP%], .dash-picker[_ngcontent-%COMP%] nile-menu[_ngcontent-%COMP%]{display:block;width:100%}.conv-dropdown[_ngcontent-%COMP%] nile-menu-item[_ngcontent-%COMP%], .related-dropdown[_ngcontent-%COMP%] nile-menu-item[_ngcontent-%COMP%], .dash-picker[_ngcontent-%COMP%] nile-menu-item[_ngcontent-%COMP%]{display:block;width:100%;box-sizing:border-box}.conv-dropdown[_ngcontent-%COMP%] nile-menu-item[_ngcontent-%COMP%]::part(label), .related-dropdown[_ngcontent-%COMP%] nile-menu-item[_ngcontent-%COMP%]::part(label), .dash-picker[_ngcontent-%COMP%] nile-menu-item[_ngcontent-%COMP%]::part(label){display:flex;flex:1 1 auto;min-width:0;margin:0}.conv-dropdown[_ngcontent-%COMP%] nile-menu-item[_ngcontent-%COMP%]::part(base), .related-dropdown[_ngcontent-%COMP%] nile-menu-item[_ngcontent-%COMP%]::part(base), .dash-picker[_ngcontent-%COMP%] nile-menu-item[_ngcontent-%COMP%]::part(base){width:100%;min-width:0;overflow:hidden}.conv-dropdown[_ngcontent-%COMP%] nile-menu-item.list-new[_ngcontent-%COMP%], .related-dropdown[_ngcontent-%COMP%] nile-menu-item.list-new[_ngcontent-%COMP%], .dash-picker[_ngcontent-%COMP%] nile-menu-item.list-new[_ngcontent-%COMP%]{position:sticky;top:0;z-index:2;background:var(--ng-colors-bg-primary)}.scope-menu__loading[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:10px;padding:8px 12px}.menu-empty[_ngcontent-%COMP%]{padding:10px 16px;font-size:12.5px;color:var(--ng-colors-text-tertiary-600)}.menu-skeleton-item[_ngcontent-%COMP%]{pointer-events:none}.prompt-gallery-skeleton[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px;width:100%}.prompt-gallery-skeleton__item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;padding:16px;border:1px solid var(--ng-colors-border-secondary);border-radius:10px;background:var(--ng-colors-bg-primary)}.prompt-gallery-skeleton__label[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0}.aq-header-action__spinner[_ngcontent-%COMP%]{display:inline-flex;color:var(--ng-colors-border-brand)}.conv-dropdown[_ngcontent-%COMP%] nile-menu-item[active][_ngcontent-%COMP%] .list-row__title[_ngcontent-%COMP%], .related-dropdown[_ngcontent-%COMP%] nile-menu-item[active][_ngcontent-%COMP%] .list-row__title[_ngcontent-%COMP%]{color:var(--ng-colors-fg-brand-primary-600);font-weight:600}.conv-dropdown[_ngcontent-%COMP%] nile-menu-item[active][_ngcontent-%COMP%] .list-row__icon[_ngcontent-%COMP%], .related-dropdown[_ngcontent-%COMP%] nile-menu-item[active][_ngcontent-%COMP%] .list-row__icon[_ngcontent-%COMP%]{color:var(--ng-colors-fg-brand-primary-600);opacity:1}.conv-dropdown[_ngcontent-%COMP%] nile-menu-item[active][_ngcontent-%COMP%] .list-row__meta[_ngcontent-%COMP%], .related-dropdown[_ngcontent-%COMP%] nile-menu-item[active][_ngcontent-%COMP%] .list-row__meta[_ngcontent-%COMP%]{color:var(--ng-colors-border-brand)}.list-group[_ngcontent-%COMP%]{padding:10px 8px 4px;font-size:11px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--ng-colors-fg-quaternary-400);pointer-events:none}.list-new[_ngcontent-%COMP%]{border-bottom:1px solid var(--ng-colors-border-tertiary)}.list-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;width:100%;max-width:100%;min-width:0;overflow:hidden}.list-row__icon[_ngcontent-%COMP%]{flex-shrink:0;opacity:.55;color:var(--ng-colors-text-tertiary-600)}.list-row__text[_ngcontent-%COMP%]{flex:1 1 0;min-width:0;max-width:100%;overflow:hidden;display:flex;flex-direction:column;gap:2px}.list-row__title[_ngcontent-%COMP%]{font-size:13px;line-height:18px;font-weight:500;color:var(--ng-colors-text-primary-900);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.list-row__meta[_ngcontent-%COMP%]{font-size:12px;line-height:16px;color:var(--ng-colors-text-tertiary-600);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.list-row__rename[_ngcontent-%COMP%]{width:100%;min-width:0;font:inherit;font-size:13px;font-weight:500;color:var(--ng-colors-text-primary-900);padding:1px 6px;border:1px solid var(--ng-colors-border-primary);border-radius:6px;background:var(--ng-colors-bg-primary);outline:none}.list-row__rename[_ngcontent-%COMP%]:focus{border-color:var(--ng-colors-fg-brand-primary-600)}.list-row__actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:2px;flex:0 0 auto;margin-left:auto}.list-row__act[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:0;border-radius:6px;background:transparent;color:var(--ng-colors-text-tertiary-600);opacity:.45;cursor:pointer;transition:opacity .12s,background-color .12s,color .12s}.list-row__act[_ngcontent-%COMP%]:hover{opacity:1;background:var(--ng-colors-bg-tertiary)}.list-row__act--danger[_ngcontent-%COMP%]:hover{color:var(--ng-colors-fg-error-primary)}.aq-chat[_ngcontent-%COMP%]{flex:1;min-height:0;display:block}.aq-chat[_ngcontent-%COMP%]::part(viewport){scrollbar-width:none;-ms-overflow-style:none}.aq-chat[_ngcontent-%COMP%]::part(scroll-button){display:none}.aq-chat[_ngcontent-%COMP%]::part(messages){padding:16px;display:flex;flex-direction:column;gap:16px}.aq-chat[_ngcontent-%COMP%]::part(empty){position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;overflow:auto;padding:24px 16px;box-sizing:border-box}.msg-skeleton[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:10px;align-self:flex-start}.msg-skeleton--ai[_ngcontent-%COMP%]{width:100%;max-width:100%}.msg-skeleton--user[_ngcontent-%COMP%]{align-self:flex-end;max-width:60%}nile-skeleton-loader[_ngcontent-%COMP%]::part(skeleton){background-color:var(--ng-colors-bg-quaternary);opacity:1}.welcome-wrap[_ngcontent-%COMP%]{flex:1;min-height:0;display:flex;overflow:auto}.welcome-section[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;text-align:center;gap:12px;margin:auto;width:100%;max-width:820px;padding:48px 16px}.welcome-title[_ngcontent-%COMP%]{margin:0;font-size:22px;font-weight:700;color:var(--ng-colors-text-primary-900);letter-spacing:-.02em}.welcome-sub[_ngcontent-%COMP%]{margin:0 0 4px;font-size:14px;color:var(--ng-colors-text-tertiary-600);max-width:440px;line-height:1.6}.welcome-composer[_ngcontent-%COMP%]{width:100%;margin:8px auto 4px}.aq-composer[_ngcontent-%COMP%]{display:block;width:100%}.welcome-prompts[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;width:100%}.prompt-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;width:100%;min-width:0;padding:12px 14px;border:1px solid var(--ng-colors-border-secondary);border-radius:12px;background:var(--ng-colors-bg-primary);cursor:pointer;text-align:left;font:inherit;transition:border-color .15s ease,background .15s ease,box-shadow .15s ease}.prompt-card[_ngcontent-%COMP%]:hover{border-color:var(--ng-colors-text-tertiary-on-brand);box-shadow:0 1px 2px #1018280f}.prompt-card__icon[_ngcontent-%COMP%]{flex:0 0 auto}.prompt-card__label[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0;font-size:13px;font-weight:500;line-height:1.45;color:var(--ng-colors-text-secondary-700);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.prompt-card__badge[_ngcontent-%COMP%]{flex:0 0 auto;align-self:center;padding:2px 6px;border-radius:4px;background:#7a5af8;color:var(--ng-colors-text-white);font-size:9px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;white-space:nowrap}.prompt-card--ai[_ngcontent-%COMP%]{border-color:#d9d0fd;background:#fbfaff}.prompt-card--ai[_ngcontent-%COMP%]:hover{border-color:#b9a6fb}.forecast-drawer[_ngcontent-%COMP%]{--size: 420px}.forecast-drawer[_ngcontent-%COMP%]::part(header){align-items:center;padding:0 12px 0 16px;border-bottom:1px solid var(--ng-colors-border-secondary)}.forecast-drawer[_ngcontent-%COMP%]::part(title){display:flex;align-items:center;gap:8px;font-size:15px;font-weight:600;color:var(--ng-colors-text-primary-900)}.forecast-drawer[_ngcontent-%COMP%]::part(body){display:flex;flex-direction:column;gap:22px;padding:20px 16px}.forecast-drawer[_ngcontent-%COMP%]::part(footer){border-top:1px solid var(--ng-colors-border-secondary);padding:12px 16px}.forecast-drawer__label[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:8px;font-size:15px;font-weight:600;color:var(--ng-colors-text-primary-900)}.forecast-drawer__mark[_ngcontent-%COMP%]{flex:0 0 auto}.fs-section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:10px}.fs-label[_ngcontent-%COMP%]{font-size:13px;font-weight:600;color:var(--ng-colors-text-secondary-700)}.fs-label__value[_ngcontent-%COMP%]{color:#5925dc}.fs-hint[_ngcontent-%COMP%]{margin:0;font-size:11px;line-height:1.5;color:var(--ng-colors-text-quaternary-500)}.fs-slider[_ngcontent-%COMP%]{appearance:none;width:100%;height:6px;margin:2px 0;border-radius:3px;background:var(--ng-colors-border-secondary);cursor:pointer;background-image:linear-gradient(var(--ng-colors-border-brand),var(--ng-colors-border-brand));background-repeat:no-repeat;background-size:var(--fs-fill, 50%) 100%}.fs-slider--ai[_ngcontent-%COMP%]{background-image:linear-gradient(#7a5af8,#7a5af8)}.fs-slider[_ngcontent-%COMP%]::-webkit-slider-thumb{appearance:none;width:16px;height:16px;border:2px solid var(--ng-colors-bg-primary);border-radius:50%;background:var(--ng-colors-border-brand);box-shadow:0 1px 3px #10182833}.fs-slider--ai[_ngcontent-%COMP%]::-webkit-slider-thumb{background:#7a5af8}.fs-slider[_ngcontent-%COMP%]::-moz-range-thumb{width:14px;height:14px;border:2px solid var(--ng-colors-bg-primary);border-radius:50%;background:var(--ng-colors-border-brand);box-shadow:0 1px 3px #10182833}.fs-slider--ai[_ngcontent-%COMP%]::-moz-range-thumb{background:#7a5af8}.fs-slider[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--ng-colors-border-brand);outline-offset:3px}.fs-segmented[_ngcontent-%COMP%]{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;gap:2px;padding:3px;border:1px solid var(--ng-colors-border-secondary);border-radius:8px;background:var(--ng-colors-bg-secondary)}.fs-segment[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;padding:6px 4px;border-radius:6px;cursor:pointer;font-size:12px;font-weight:500;color:var(--ng-colors-text-tertiary-600);white-space:nowrap;transition:background .15s ease,color .15s ease}.fs-segment__input[_ngcontent-%COMP%]{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}.fs-segment[_ngcontent-%COMP%]:hover{color:var(--ng-colors-text-primary-900)}.fs-segment--on[_ngcontent-%COMP%]{background:var(--ng-colors-border-brand);color:var(--ng-colors-text-white);font-weight:600}.fs-segment--on[_ngcontent-%COMP%]:hover{color:var(--ng-colors-text-white)}.fs-segment--off[_ngcontent-%COMP%]{color:var(--ng-colors-fg-disabled);cursor:not-allowed}.fs-segment--off[_ngcontent-%COMP%]:hover{color:var(--ng-colors-fg-disabled)}.fs-segment[_ngcontent-%COMP%]:has(.fs-segment__input:focus-visible){outline:2px solid var(--ng-colors-border-brand);outline-offset:1px}.fs-card[_ngcontent-%COMP%]{padding:12px 14px;border:1px solid var(--ng-colors-border-secondary);border-radius:10px;background:var(--ng-colors-bg-secondary)}.fs-card__title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;margin:0 0 4px;font-size:12px;font-weight:600;color:var(--ng-colors-text-secondary-700)}.fs-card__body[_ngcontent-%COMP%]{margin:0;font-size:11px;line-height:1.6;color:var(--ng-colors-text-tertiary-600)}.fs-card--ai[_ngcontent-%COMP%]{border-color:#d9d0fd;background:#fbfaff}.fs-card--ai[_ngcontent-%COMP%] .fs-card__title[_ngcontent-%COMP%]{color:#5925dc}.fs-card--pass[_ngcontent-%COMP%]{border-color:var(--ng-colors-border-success-subtle);background:var(--ng-colors-bg-success-primary)}.fs-card--pass[_ngcontent-%COMP%] .fs-card__title[_ngcontent-%COMP%]{color:var(--ng-colors-fg-success-primary)}.fs-card--warn[_ngcontent-%COMP%]{border-color:var(--ng-colors-bg-warning-secondary);background:var(--ng-colors-bg-warning-primary)}.fs-card--warn[_ngcontent-%COMP%] .fs-card__title[_ngcontent-%COMP%]{color:var(--ng-colors-fg-warning-primary)}.fs-actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:8px}.aq-detail-overlay[_ngcontent-%COMP%]{position:absolute;inset:0;z-index:50;display:flex;flex-direction:column;background:var(--ng-colors-bg-primary);animation:_ngcontent-%COMP%_aq-slide-in .16s ease}.aq-detail-overlay__crumbs[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px;box-sizing:border-box;height:var(--aq-header-h, 56px);padding:0 20px;border-bottom:1px solid var(--ng-colors-border-secondary);flex-shrink:0}.aq-detail-overlay__crumbs[_ngcontent-%COMP%] nile-breadcrumb[_ngcontent-%COMP%]{display:inline-flex;align-items:center}.aq-detail-overlay__body[_ngcontent-%COMP%]{flex:1 1 auto;min-height:0;overflow:auto;scrollbar-width:none;-ms-overflow-style:none;padding:20px;background:var(--ng-colors-bg-secondary)}.aq-detail-overlay__body[_ngcontent-%COMP%]::-webkit-scrollbar{width:0;height:0}.aq-detail-overlay__footer[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;gap:8px;padding:12px 20px;border-top:1px solid var(--ng-colors-border-secondary);background:var(--ng-colors-bg-primary);flex-shrink:0}.aq-detail-overlay__select-count[_ngcontent-%COMP%]{margin-right:auto;font-size:13px;font-weight:500;color:var(--ng-colors-text-secondary-700)}.aq-detail-overlay__caption[_ngcontent-%COMP%]{margin:0 0 16px;font-size:13px;color:var(--ng-colors-text-tertiary-600)}.aq-detail-skeleton[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px}.aq-detail-skeleton__row[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}.aq-detail-skeleton-grid[_ngcontent-%COMP%]{position:relative;width:100%}.aq-detail-skeleton-slot[_ngcontent-%COMP%]{position:absolute}.aq-detail-skeleton-slot[_ngcontent-%COMP%]::part(base){height:100%}.prompt-gallery-prompts[_ngcontent-%COMP%]{width:100%}.prompt-gallery-prompts[_ngcontent-%COMP%]::part(item-label){font-weight:500}.ai-bubble__steps[_ngcontent-%COMP%]{display:block;width:100%;box-sizing:border-box;margin-bottom:12px;padding:12px 16px}.wfb-suggestions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:10px;justify-content:center;margin-top:8px}.wfb-suggestions-loading[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;margin-top:12px}.suggestions-spinner[_ngcontent-%COMP%]{width:16px;height:16px;border:2px solid var(--ng-colors-border-secondary);border-top-color:var(--ng-colors-border-brand);border-radius:50%;animation:_ngcontent-%COMP%_spin .7s linear infinite;flex-shrink:0}.suggestions-loading-content[_ngcontent-%COMP%]{display:flex;align-items:baseline;gap:2px}.suggestions-loading-text[_ngcontent-%COMP%]{color:var(--ng-colors-text-quaternary-500);font-size:13px;font-style:italic}.suggestions-loading-dots[_ngcontent-%COMP%]{display:inline-flex;gap:1px}.suggestions-loading-dots[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:var(--ng-colors-text-quaternary-500);font-size:13px;animation:_ngcontent-%COMP%_dot-fade 1.4s ease-in-out infinite}.suggestions-loading-dots[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(2){animation-delay:.2s}.suggestions-loading-dots[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(3){animation-delay:.4s}@keyframes _ngcontent-%COMP%_dot-fade{0%,80%,to{opacity:.2}40%{opacity:1}}.welcome-prompts-skeleton[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;width:100%}.welcome-prompts-skeleton__item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;padding:12px 14px;border:1px solid var(--ng-colors-border-secondary);border-radius:12px;background:var(--ng-colors-bg-primary)}.welcome-prompts-skeleton__icon[_ngcontent-%COMP%]{flex:0 0 auto}.welcome-prompts-skeleton__label[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0;max-width:70%}.prompt-gallery-row[_ngcontent-%COMP%]{width:100%;margin:2px auto 0;display:flex;justify-content:flex-end;gap:16px}.prompt-gallery-link[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;border:0;background:transparent;padding:2px 0;cursor:pointer;font:inherit;font-size:13px;font-weight:400;color:var(--ng-colors-border-brand)}.prompt-gallery-link[_ngcontent-%COMP%] nile-glyph[_ngcontent-%COMP%]{color:var(--ng-colors-border-brand)}.prompt-gallery-link[_ngcontent-%COMP%]:hover span[_ngcontent-%COMP%]{text-decoration:underline}.prompt-gallery-drawer[_ngcontent-%COMP%]{--size: calc(100vw - 248px) }.prompt-gallery-drawer[_ngcontent-%COMP%]::part(header){height:var(--aq-header-h, 56px);align-items:center;padding:0 16px;border-bottom:1px solid var(--ng-colors-border-secondary)}.prompt-gallery-drawer[_ngcontent-%COMP%]::part(title){font-size:16px;font-weight:600;color:var(--ng-colors-text-primary-900)}.prompt-gallery-drawer[_ngcontent-%COMP%]::part(body){display:flex;flex-direction:column;gap:14px}.prompt-gallery-search[_ngcontent-%COMP%]{width:100%;flex-shrink:0}.xray-drawer[_ngcontent-%COMP%]{--size: 420px}.xray-drawer[_ngcontent-%COMP%]::part(header){height:var(--aq-header-h, 56px);align-items:center;padding:0 16px;border-bottom:1px solid var(--ng-colors-border-secondary)}.xray-drawer[_ngcontent-%COMP%]::part(title){font-size:16px;font-weight:600;color:var(--ng-colors-text-primary-900)}.xray-drawer[_ngcontent-%COMP%]::part(body){display:flex;flex-direction:column;gap:12px}.xray-dataset-dropdown[_ngcontent-%COMP%]{flex-shrink:0}.xray-picker[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;width:100%;padding:9px 12px;border:1px solid var(--ng-colors-border-secondary);border-radius:8px;background:var(--ng-colors-bg-primary);cursor:pointer;font:inherit;font-size:13px;color:var(--ng-colors-text-primary-900)}.xray-picker[_ngcontent-%COMP%] nile-glyph[_ngcontent-%COMP%]{color:var(--ng-colors-text-quaternary-500)}.xray-picker[_ngcontent-%COMP%]:hover{border-color:var(--ng-colors-border-brand)}.xray-picker__label[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;font-weight:500}.xray-picker__caret[_ngcontent-%COMP%]{flex-shrink:0}.xray-picker__item[_ngcontent-%COMP%]{font-size:13px}.xray-search[_ngcontent-%COMP%]{width:100%;flex-shrink:0}.xray-focus[_ngcontent-%COMP%]{flex-shrink:0}.xray-focus__toggle[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;cursor:pointer;list-style:none;padding:2px 0;font-size:12px;color:var(--ng-colors-text-quaternary-500);-webkit-user-select:none;user-select:none}.xray-focus__toggle[_ngcontent-%COMP%]::-webkit-details-marker{display:none}.xray-focus__toggle[_ngcontent-%COMP%] nile-glyph[_ngcontent-%COMP%]{color:inherit}.xray-focus__toggle[_ngcontent-%COMP%]:hover{color:var(--ng-colors-border-brand)}.xray-focus__input[_ngcontent-%COMP%]{width:100%;margin-top:6px}.xray-error[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:8px;font-size:13px;color:var(--ng-colors-text-error-primary, #b42318);background:var(--ng-colors-bg-error-primary, rgba(180, 35, 24, .06));border-radius:8px;padding:9px 11px;flex-shrink:0}.xray-error[_ngcontent-%COMP%] nile-glyph[_ngcontent-%COMP%]{flex-shrink:0;margin-top:1px;color:inherit}.xray-status[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--ng-colors-text-quaternary-500);padding:4px 0;flex-shrink:0}.xray-running[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;flex:1 1 auto;min-height:220px;text-align:center}.xray-running__title[_ngcontent-%COMP%]{margin:0;font-size:14px;font-weight:500;color:var(--ng-colors-text-primary-900)}.xray-running__sub[_ngcontent-%COMP%]{margin:0;font-size:12px;font-family:var(--ng-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);color:var(--ng-colors-text-quaternary-500)}.xray-listhead[_ngcontent-%COMP%]{display:flex;align-items:baseline;justify-content:space-between;gap:8px;flex-shrink:0;padding:2px 2px 0}.xray-listhead__count[_ngcontent-%COMP%]{font-size:12px;font-weight:600;letter-spacing:.03em;text-transform:uppercase;color:var(--ng-colors-text-quaternary-500)}.xray-listhead__hint[_ngcontent-%COMP%]{font-size:12px;color:var(--ng-colors-text-quaternary-500)}.xray-entities[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px;overflow-y:auto;min-height:0;flex:1 1 auto}.xray-entity[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;width:100%;padding:9px 10px;border:1px solid transparent;border-radius:8px;background:transparent;cursor:pointer;font:inherit;font-size:13px;color:var(--ng-colors-text-primary-900);text-align:left}.xray-entity[_ngcontent-%COMP%] nile-glyph[_ngcontent-%COMP%]{flex-shrink:0}.xray-entity[_ngcontent-%COMP%] .xray-entity__kind[_ngcontent-%COMP%]{color:var(--ng-colors-text-quaternary-500)}.xray-entity[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--ng-colors-bg-secondary, rgba(0, 0, 0, .035));border-color:var(--ng-colors-border-secondary)}.xray-entity[_ngcontent-%COMP%]:hover:not(:disabled) .xray-entity__go[_ngcontent-%COMP%]{opacity:1}.xray-entity[_ngcontent-%COMP%]:hover:not(:disabled) .xray-entity__meta[_ngcontent-%COMP%]{opacity:0}.xray-entity[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--ng-colors-border-brand);outline-offset:-1px}.xray-entity[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:default}.xray-entity--skeleton[_ngcontent-%COMP%]{cursor:default;gap:10px}.xray-entity__name[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.xray-entity__schema[_ngcontent-%COMP%]{color:var(--ng-colors-text-quaternary-500)}.xray-entity__meta[_ngcontent-%COMP%]{flex-shrink:0;font-size:11px;color:var(--ng-colors-text-quaternary-500);font-variant-numeric:tabular-nums;transition:opacity .12s ease}.xray-entity__go[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:5px;flex-shrink:0;opacity:0;transition:opacity .12s ease;font-size:12px;font-weight:500;color:var(--ng-colors-border-brand)}.xray-entity__go[_ngcontent-%COMP%] nile-glyph[_ngcontent-%COMP%]{color:inherit}.xray-drawer[_ngcontent-%COMP%]::part(body){overflow:hidden}.prompt-gallery-empty[_ngcontent-%COMP%]{color:var(--ng-colors-text-quaternary-500);font-size:13px;padding:24px 4px}.prompt-gallery-list[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:12px;align-content:start}.prompt-gallery-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;width:100%;border:1px solid var(--ng-colors-border-secondary);border-radius:12px;padding:12px 16px;background:var(--ng-colors-bg-primary);cursor:pointer;text-align:left;font:inherit;font-size:13px;font-weight:500;color:var(--ng-colors-text-secondary-700);line-height:1.4;transition:border-color .18s,box-shadow .18s}.prompt-gallery-item[_ngcontent-%COMP%]:hover{border-color:var(--ng-colors-border-brand);box-shadow:0 6px 24px var(--ng-colors-bg-brand-primary)}.aq-library-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px}.aq-library-group__head[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}.aq-library-group__label[_ngcontent-%COMP%]{font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--ng-colors-text-quaternary-500)}.aq-library-group__toggle[_ngcontent-%COMP%]{border:none;background:none;padding:0;font:inherit;font-size:12px;font-weight:600;color:var(--ng-colors-fg-brand-primary-600);cursor:pointer}.aq-library-group__toggle[_ngcontent-%COMP%]:hover{text-decoration:underline}.aq-lib-cards[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px}.aq-lib-cards--dashboards[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fit,minmax(232px,1fr));gap:10px}.aq-lib-card-wrap[_ngcontent-%COMP%]{position:relative;cursor:pointer;border-radius:10px;transition:box-shadow .15s}.aq-lib-card-wrap[_ngcontent-%COMP%] nile-kpi-chart[_ngcontent-%COMP%]{display:block;height:172px;box-sizing:border-box}.aq-lib-card-wrap--selected[_ngcontent-%COMP%]{box-shadow:0 0 0 3px var(--ng-colors-bg-brand-secondary);border-radius:10px}.aq-lib-card[_ngcontent-%COMP%]{cursor:pointer;padding:13px 14px;border-radius:10px;background:var(--ng-colors-bg-primary);border:1.5px solid var(--ng-colors-border-secondary);box-shadow:0 1px 2px #0f172a08;transition:border-color .15s,box-shadow .15s}.aq-lib-card[_ngcontent-%COMP%]:hover{border-color:var(--ng-colors-bg-brand-secondary)}.aq-lib-card--dashboard[_ngcontent-%COMP%]{display:block;width:100%;padding:0;overflow:hidden;text-align:left;font:inherit;color:inherit}.aq-lib-card--dashboard[_ngcontent-%COMP%] .aq-lib-card__row[_ngcontent-%COMP%]{align-items:center;padding:11px 13px 12px}.aq-lib-skeleton[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px}.aq-lib-skeleton__kpi[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:10px;height:172px;box-sizing:border-box;padding:16px;border-radius:10px;background:var(--ng-colors-bg-primary);border:1px solid var(--ng-colors-border-secondary);box-shadow:0 1px 2px #0f172a08}.aq-lib-skeleton__kpi[_ngcontent-%COMP%] nile-skeleton-loader[_ngcontent-%COMP%]:last-child{margin-top:auto}.aq-lib-skeleton__dash[_ngcontent-%COMP%]{border-radius:10px;overflow:hidden;background:var(--ng-colors-bg-primary);border:1px solid var(--ng-colors-border-secondary);box-shadow:0 1px 2px #0f172a08}.aq-lib-skeleton__dash-text[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px;padding:13px 14px}.aq-lib-card__preview[_ngcontent-%COMP%]{position:relative;height:108px;background:linear-gradient(180deg,var(--ng-colors-bg-secondary-subtle) 0%,var(--ng-colors-bg-secondary) 100%);border-bottom:1px solid var(--ng-colors-border-secondary)}.aq-lib-card__viz[_ngcontent-%COMP%]{position:absolute;inset:6px 8px 4px;pointer-events:none}.aq-lib-card__viz-empty[_ngcontent-%COMP%]{position:absolute;inset:0;display:flex;align-items:flex-end;justify-content:center;gap:7px;padding:18px}.aq-lib-card__viz-empty[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:0 0 14px;border-radius:3px 3px 0 0;background:var(--ng-colors-bg-quaternary)}.aq-lib-card__chip[_ngcontent-%COMP%]{position:absolute;top:8px;right:8px;display:inline-flex;align-items:center;gap:4px;padding:2px 7px;border-radius:5px;background:var(--ng-colors-bg-primary);border:1px solid var(--ng-colors-border-secondary);font-size:10.5px;font-weight:600;color:var(--ng-colors-text-tertiary-600)}.aq-lib-card__row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:10px}.aq-lib-card__text[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0}.aq-lib-card__title[_ngcontent-%COMP%]{font-size:13px;font-weight:500;letter-spacing:-.01em;line-height:1.35;color:var(--ng-colors-text-primary-900)}.aq-lib-card__title-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:7px}.aq-lib-card__badge[_ngcontent-%COMP%]{flex-shrink:0;font-size:10.5px;font-weight:600;color:var(--ng-colors-text-tertiary-600);background:var(--ng-colors-bg-quaternary);border-radius:5px;padding:2px 6px}.aq-lib-card__desc[_ngcontent-%COMP%]{font-size:11.5px;color:var(--ng-colors-text-quaternary-500);line-height:1.45;margin-top:3px}.aq-lib-card__check[_ngcontent-%COMP%]{position:absolute;top:12px;right:12px;z-index:1;flex:0 0 18px;width:18px;height:18px;border-radius:5px;border:1.5px solid var(--ng-colors-border-primary);background:var(--ng-colors-bg-primary);display:flex;align-items:center;justify-content:center;cursor:pointer;padding:0}.aq-lib-card__check[_ngcontent-%COMP%] nile-glyph[_ngcontent-%COMP%]{opacity:0}.aq-lib-card__check--on[_ngcontent-%COMP%]{border-color:var(--ng-colors-border-brand-alt);background:var(--ng-colors-bg-brand-solid)}.aq-lib-card__check--on[_ngcontent-%COMP%] nile-glyph[_ngcontent-%COMP%]{opacity:1}.ai-bubble[_ngcontent-%COMP%]{display:block;width:100%;max-width:100%;margin-inline:auto}.ai-bubble__content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px}.aq-sent-text[_ngcontent-%COMP%]{white-space:pre-line}.sent-quote[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:6px;margin-bottom:6px;padding:6px 8px;border-radius:8px;border-left:3px solid var(--ng-colors-border-brand-alt);background:var(--ng-colors-bg-brand-primary);color:var(--ng-colors-text-tertiary-600);font-size:12px;line-height:1.4}.sent-quote[_ngcontent-%COMP%] nile-glyph[_ngcontent-%COMP%]{flex:0 0 auto;margin-top:2px;color:var(--ng-colors-fg-brand-primary-600)}.answer-summary[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:6px}.answer-summary__row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:8px}.answer-summary__check[_ngcontent-%COMP%]{flex:0 0 auto;margin-top:2px}.answer-summary__content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px;min-width:0}.answer-summary__title[_ngcontent-%COMP%]{font-size:13.5px;font-weight:400;color:var(--ng-colors-text-primary-900)}.answer-summary__answer[_ngcontent-%COMP%]{font-size:12.5px;font-weight:500;color:var(--ng-colors-text-tertiary-600)}.answer-summary__answer[_ngcontent-%COMP%]:before{content:"\\2014 "}.sent-quote__text[_ngcontent-%COMP%]{overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.ai-bubble[_ngcontent-%COMP%]::part(thinking){border:none;padding-left:2px;font-size:12px}.ai-bubble[_ngcontent-%COMP%]::part(base), .ai-bubble[_ngcontent-%COMP%]::part(bubble){transition:max-width .22s ease,width .22s ease}.assistant-text[_ngcontent-%COMP%]{display:block;max-width:680px}.user-row[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;align-items:flex-start;gap:8px;width:100%;max-width:860px;margin-inline:auto}.user-icon[_ngcontent-%COMP%]{order:2;display:flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:50%;background:var(--ng-colors-bg-tertiary);flex-shrink:0;margin-top:2px}.user-bubble[_ngcontent-%COMP%]{order:1;background:var(--ng-colors-border-brand);border-radius:12px 2px 12px 12px;padding:10px 14px;font-size:14px;color:var(--ng-colors-text-white);max-width:70%;white-space:pre-wrap;word-break:break-word}.assistant-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:10px;width:100%;max-width:860px;margin-inline:auto}.assistant-icon[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:50%;background:var(--ng-colors-bg-brand-primary);flex-shrink:0;margin-top:2px}.assistant-body[_ngcontent-%COMP%]{flex:1;min-width:0;max-width:760px;display:flex;flex-direction:column;gap:12px}.assistant-text[_ngcontent-%COMP%]{font-size:14px;color:var(--ng-colors-text-secondary-700);line-height:1.6;margin:0;white-space:pre-wrap;word-break:break-word}.assistant-text--error[_ngcontent-%COMP%]{color:var(--ng-colors-fg-error-primary)}.assistant-text--md[_ngcontent-%COMP%]{white-space:normal;display:block}.assistant-error[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:8px;padding:10px 12px;border:1px solid var(--ng-colors-border-error-subtle);border-radius:8px;background:var(--ng-colors-bg-error-primary);font-size:13px;line-height:1.5;color:var(--ng-colors-text-error-primary-hover)}.assistant-error__icon[_ngcontent-%COMP%]{flex-shrink:0;color:var(--ng-colors-fg-error-primary);margin-top:1px}.assistant-error__text[_ngcontent-%COMP%]{word-break:break-word}.wfb-tools[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:6px}.wfb-tool[_ngcontent-%COMP%]{font-size:11px}.wfb-tool[_ngcontent-%COMP%]::part(content){display:inline-flex;align-items:center;gap:5px}.wfb-tool__spinner[_ngcontent-%COMP%]{width:10px;height:10px;border:1.5px solid currentColor;border-top-color:transparent;border-radius:50%;animation:_ngcontent-%COMP%_spin .7s linear infinite;display:inline-block}.wfb-tool__detail[_ngcontent-%COMP%]{opacity:.75;font-weight:400}@keyframes _ngcontent-%COMP%_spin{to{transform:rotate(360deg)}}.agent-trace[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;gap:14px;margin:2px 0;padding-left:18px}.agent-trace[_ngcontent-%COMP%]:before{content:"";position:absolute;top:4px;bottom:4px;left:3px;width:2px;border-radius:1px;background:var(--ng-colors-border-secondary)}.agent-trace__row[_ngcontent-%COMP%]{min-width:0}.agent-trace__text[_ngcontent-%COMP%]{margin:0;font-size:13px;line-height:1.6;color:var(--ng-colors-text-quaternary-500);white-space:pre-wrap;word-break:break-word}.agent-trace__chips[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:6px}.wfb-status-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:4px 0}.wfb-status-text[_ngcontent-%COMP%]{font-size:13px;color:var(--ng-colors-text-quaternary-500);font-style:italic}.wfb-typing[_ngcontent-%COMP%]{display:flex;gap:4px;align-items:center;padding:6px 0}.wfb-typing[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{width:6px;height:6px;border-radius:50%;background:var(--ng-colors-fg-quaternary-400);animation:_ngcontent-%COMP%_bounce 1.2s ease-in-out infinite}.wfb-typing[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(2){animation-delay:.2s}.wfb-typing[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(3){animation-delay:.4s}@keyframes _ngcontent-%COMP%_bounce{0%,60%,to{transform:translateY(0);opacity:.4}30%{transform:translateY(-5px);opacity:1}}.chart-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px;padding:12px 14px;border:1px solid var(--ng-colors-border-secondary);border-radius:12px;background:var(--ng-colors-bg-primary);box-shadow:0 1px 3px #1018280f;cursor:pointer;transition:border-color .15s,box-shadow .15s;width:100%;max-width:100%;box-sizing:border-box}.chart-card[_ngcontent-%COMP%]:hover{border-color:var(--ng-colors-border-brand);box-shadow:0 0 0 3px var(--ng-colors-bg-brand-primary)}.chart-card__icon[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:8px;background:var(--ng-colors-bg-brand-primary);flex-shrink:0}.chart-card__body[_ngcontent-%COMP%]{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.chart-card__title[_ngcontent-%COMP%]{font-size:13px;font-weight:600;color:var(--ng-colors-text-primary-900);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chart-card__meta[_ngcontent-%COMP%]{font-size:12px;color:var(--ng-colors-text-quaternary-500)}.aq-composer-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;position:relative;width:100%;box-sizing:border-box;border:1px solid var(--ng-colors-border-primary);border-radius:20px;background:var(--ng-colors-bg-primary);transition:border-color .12s ease,box-shadow .12s ease}.aq-composer-wrap[_ngcontent-%COMP%]:focus-within{border-color:var(--ng-colors-border-brand-alt);box-shadow:0 0 0 3px var(--ng-colors-bg-brand-primary)}.aq-composer-wrap--dragover[_ngcontent-%COMP%]{border-color:var(--ng-colors-border-brand-alt);border-style:dashed;box-shadow:0 0 0 3px var(--ng-colors-bg-brand-primary)}.aq-composer-wrap[_ngcontent-%COMP%] > .aq-attachments[_ngcontent-%COMP%]{padding:10px 14px 0}.reply-badge[_ngcontent-%COMP%]{position:fixed;z-index:1000;transform:translate(-50%,calc(-100% - 8px));display:inline-flex;align-items:center;gap:4px;padding:6px 12px;border:none;border-radius:999px;background:var(--ng-colors-bg-primary-solid);color:var(--ng-colors-text-white);font-size:12px;font-weight:500;line-height:1;box-shadow:var(--ng-shadow-lg, 0 8px 16px rgba(16, 24, 40, .16));cursor:pointer}.reply-badge[_ngcontent-%COMP%]:hover{background:var(--ng-colors-bg-primary-solid)}.reply-badge--below[_ngcontent-%COMP%]{transform:translate(-50%,8px)}.reply-quote[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:8px;margin:10px 14px 0;padding:8px 10px;border-radius:10px;border-left:3px solid var(--ng-colors-border-brand-alt);background:var(--ng-colors-bg-secondary);color:var(--ng-colors-text-tertiary-600);font-size:12px;line-height:1.4}.reply-quote[_ngcontent-%COMP%] nile-glyph[_ngcontent-%COMP%]{flex:0 0 auto;margin-top:2px;color:var(--ng-colors-fg-brand-primary-600);transform:rotate(180deg)}.reply-quote__text[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.reply-quote__dismiss[_ngcontent-%COMP%]{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;padding:2px;border:none;background:transparent;color:inherit;cursor:pointer;border-radius:4px}.reply-quote__dismiss[_ngcontent-%COMP%]:hover{background:#0000000f}.aq-drop-overlay[_ngcontent-%COMP%]{position:absolute;inset:0;z-index:1;display:flex;align-items:center;justify-content:center;gap:8px;border-radius:20px;background:var(--ng-colors-bg-brand-primary);color:var(--ng-colors-fg-brand-primary-600);font-size:13px;font-weight:500;pointer-events:none}.aq-composer[_ngcontent-%COMP%]::part(base){border:0;border-radius:0;background:transparent;box-shadow:none}.aq-composer[_ngcontent-%COMP%]::part(toolbar-end){gap:6px;align-items:center}.aq-composer[loading][_ngcontent-%COMP%]::part(send-button){background:var(--ng-colors-bg-active);color:var(--ng-colors-text-tertiary-600)}.aq-composer[loading][_ngcontent-%COMP%]::part(send-button):hover{background:var(--ng-colors-bg-active);color:var(--ng-colors-text-primary-900)}.aq-attachments[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:6px}.aq-attachments--sent[_ngcontent-%COMP%]{margin-top:6px}.aq-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;max-width:220px;padding:4px 8px;border:1px solid var(--ng-colors-border-secondary);border-radius:8px;background:var(--ng-colors-bg-secondary);font-size:12px;color:var(--ng-colors-text-secondary-700)}.aq-chip--error[_ngcontent-%COMP%]{border-color:var(--ng-colors-border-error-subtle);background:var(--ng-colors-bg-error-primary);color:var(--ng-colors-text-error-primary-hover)}.aq-chip--static[_ngcontent-%COMP%]{background:var(--ng-colors-bg-primary)}.aq-chip__icon[_ngcontent-%COMP%]{color:var(--ng-colors-text-quaternary-500);flex-shrink:0}.aq-chip__name[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.aq-chip__spin[_ngcontent-%COMP%]{flex-shrink:0}.aq-chip__retry[_ngcontent-%COMP%]{border:none;background:none;padding:0;color:var(--ng-colors-text-error-primary-hover);font-size:12px;font-weight:600;cursor:pointer}.aq-chip__remove[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;border:none;background:none;padding:0;cursor:pointer;color:var(--ng-colors-text-placeholder);flex-shrink:0}.aq-chip__remove[_ngcontent-%COMP%]:hover{color:var(--ng-colors-text-tertiary-600)}.wfb-breadcrumb[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;font-size:13px}.wfb-breadcrumb__current[_ngcontent-%COMP%]{color:var(--ng-colors-text-primary-900);font-weight:500}.wfb-preview-close[_ngcontent-%COMP%]{cursor:pointer;color:var(--ng-colors-text-quaternary-500)}.wfb-preview-close[_ngcontent-%COMP%]:hover{color:var(--ng-colors-text-primary-900)}.wfb-preview-link[_ngcontent-%COMP%]{background:none;border:none;padding:0;font-size:13px;font-weight:500;color:var(--ng-colors-border-brand);cursor:pointer;font-family:inherit}.wfb-preview-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.input-area[_ngcontent-%COMP%]{flex-shrink:0;padding:4px 16px 18px;display:flex;flex-direction:column;justify-content:center}.chat-input-pill[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px;width:100%;max-width:100%;padding:14px 16px 12px;background:var(--ng-colors-bg-primary);border:1px solid var(--ng-colors-border-secondary);border-radius:24px;box-shadow:0 1px 2px #1018280a,0 8px 24px #1018280f;cursor:text;transition:border-color .15s,box-shadow .15s}.chat-input-pill[_ngcontent-%COMP%]:focus-within{border-color:var(--ng-colors-border-brand);box-shadow:0 0 0 3px var(--ng-colors-bg-brand-primary)}.voice-wave[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0;height:22px;margin:0 8px;display:block}.input-query[_ngcontent-%COMP%]{display:block;width:100%;min-width:0;border:none;outline:none;resize:none;font:inherit;font-size:15px;line-height:1.4;color:var(--ng-colors-text-primary-900);background:transparent;padding:6px 2px;max-height:160px;overflow-y:auto;white-space:pre-wrap;word-break:break-word}.input-query[_ngcontent-%COMP%]::placeholder{color:var(--ng-colors-text-quaternary-500)}.input-query[_ngcontent-%COMP%]:disabled{cursor:not-allowed;opacity:.6}.input-query--live[_ngcontent-%COMP%]{min-height:21px;cursor:default;text-align:left}.input-query__interim[_ngcontent-%COMP%]{font-style:italic;opacity:.55}.pill-toolbar[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:8px}.pill-toolbar__left[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px}.pill-toolbar__right[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;margin-left:auto}.conn-chip-wrap[_ngcontent-%COMP%]{position:relative}.datasource-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:5px;padding:3px 10px;background:var(--ng-colors-bg-brand-primary);border-radius:20px;font-size:12px;font-weight:500;color:var(--ng-colors-border-brand);cursor:pointer;-webkit-user-select:none;user-select:none;max-width:200px;border:1px solid transparent}.datasource-chip[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.datasource-chip__chevron[_ngcontent-%COMP%]{transition:transform .15s;flex-shrink:0}.datasource-chip__chevron--open[_ngcontent-%COMP%]{transform:rotate(180deg)}.datasource-chip[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--ng-colors-bg-brand-secondary)}.datasource-chip[_ngcontent-%COMP%]:disabled{opacity:.6;cursor:not-allowed}.datasource-chip--open[_ngcontent-%COMP%]{background:var(--ng-colors-bg-brand-secondary);border-color:var(--ng-colors-text-tertiary-on-brand)}.conn-chip-dropdown[_ngcontent-%COMP%]{position:absolute;bottom:calc(100% + 6px);left:0;min-width:200px;background:var(--ng-colors-bg-primary);border:1px solid var(--ng-colors-border-secondary);border-radius:10px;box-shadow:0 4px 16px #0000001a;z-index:100;overflow:hidden}.conn-chip-dropdown__item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:9px 12px;font-size:13px;color:var(--ng-colors-text-secondary-700);cursor:pointer}.conn-chip-dropdown__item[_ngcontent-%COMP%]:hover{background:var(--ng-colors-bg-secondary)}.conn-chip-dropdown__item--active[_ngcontent-%COMP%]{background:var(--ng-colors-bg-brand-primary);color:var(--ng-colors-border-brand)}.conn-chip-dropdown__name[_ngcontent-%COMP%]{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.conn-chip-dropdown__hint[_ngcontent-%COMP%]{font-size:11px;color:var(--ng-colors-text-placeholder);flex-shrink:0}.conn-chip-dropdown__check[_ngcontent-%COMP%]{margin-left:auto;flex-shrink:0;color:var(--ng-colors-border-brand)}.mic-icon[_ngcontent-%COMP%]{cursor:pointer;color:var(--ng-colors-text-quaternary-500);transition:color .15s}.mic-icon[_ngcontent-%COMP%]:hover{color:var(--ng-colors-text-secondary-700)}.mic-icon--recording[_ngcontent-%COMP%]{color:var(--ng-colors-fg-error-primary);animation:_ngcontent-%COMP%_mic-pulse 1s ease-in-out infinite}@keyframes _ngcontent-%COMP%_mic-pulse{0%,to{opacity:1}50%{opacity:.5}}.send-icon[_ngcontent-%COMP%]{cursor:pointer;color:var(--ng-colors-border-brand);transition:opacity .15s}.send-icon--disabled[_ngcontent-%COMP%]{opacity:.35;cursor:not-allowed;pointer-events:none}.wfb-save-dialog[_ngcontent-%COMP%]{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#10182866;z-index:20}.wfb-save-dialog__body[_ngcontent-%COMP%]{background:var(--ng-colors-bg-primary);border:1px solid var(--ng-colors-border-secondary);border-radius:12px;padding:20px;width:360px;display:flex;flex-direction:column;gap:12px;box-shadow:0 8px 24px #1018281f}.wfb-save-dialog__label[_ngcontent-%COMP%]{font-size:13px;font-weight:600;color:var(--ng-colors-text-secondary-700)}.wfb-save-dialog__input[_ngcontent-%COMP%]{width:100%;padding:8px 12px;border:1px solid var(--ng-colors-border-primary);border-radius:8px;font-size:14px;font-family:inherit;color:var(--ng-colors-text-primary-900);outline:none;box-sizing:border-box}.wfb-save-dialog__input[_ngcontent-%COMP%]:focus{border-color:var(--ng-colors-border-brand);box-shadow:0 0 0 3px var(--ng-colors-bg-brand-primary)}.wfb-save-dialog__actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:8px}.aq-shell[_ngcontent-%COMP%]{--aq-header-h: 56px;display:flex;flex:1 1 auto;min-height:0;width:100%;overflow:hidden;container-type:inline-size}.aq-chat-pane[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-width:0;flex:1 1 auto;transition:flex-basis .22s ease,max-width .22s ease;--aq-conversation-w: 900px}.aq-chat-pane__tabs[_ngcontent-%COMP%]{flex-shrink:0}.aq-library-pane__head[_ngcontent-%COMP%] nile-nav-tab-group[_ngcontent-%COMP%]{width:100%}.aq-chat-pane__tabs[_ngcontent-%COMP%] nile-nav-tab[_ngcontent-%COMP%]::part(name), .aq-library-pane__head[_ngcontent-%COMP%] nile-nav-tab-group[_ngcontent-%COMP%] nile-nav-tab[_ngcontent-%COMP%]::part(name){font-size:13px;line-height:14px}.aq-library-pane__head[_ngcontent-%COMP%] nile-nav-tab-group[_ngcontent-%COMP%] .aq-library-pane__tab-count[_ngcontent-%COMP%]{display:inline-block;min-width:18px;margin-left:6px;padding:1px 6px;border-radius:999px;background:var(--ng-colors-bg-brand-solid);color:var(--ng-colors-text-white);font-size:10px;font-weight:700;line-height:14px;text-align:center;vertical-align:1px}.aq-chat-pane__tabs[_ngcontent-%COMP%]::part(nav), .aq-library-pane__head[_ngcontent-%COMP%] nile-nav-tab-group[_ngcontent-%COMP%]::part(nav){background:var(--ng-colors-bg-quaternary)}.aq-library-pane[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1 1 auto;min-height:0;overflow:hidden}.aq-shell[data-mode=idle][_ngcontent-%COMP%] .aq-chat[_ngcontent-%COMP%]::part(messages), .aq-shell[data-mode=conversation][_ngcontent-%COMP%] .aq-chat[_ngcontent-%COMP%]::part(messages), .aq-shell[data-mode=conversation][_ngcontent-%COMP%] .input-area[_ngcontent-%COMP%]{width:100%;max-width:var(--aq-conversation-w);margin-left:auto;margin-right:auto}.aq-shell[data-mode=conversation][_ngcontent-%COMP%] .wfb-messages[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:first-child{margin-top:auto}.aq-shell[data-mode=split][_ngcontent-%COMP%] .aq-chat-pane[_ngcontent-%COMP%]{flex:0 0 auto;flex-basis:clamp(320px,41%,485px);max-width:50%;margin:0}.aq-resizer[_ngcontent-%COMP%]{align-self:stretch;position:relative;cursor:col-resize;background:transparent;z-index:6;touch-action:none}.aq-resizer[_ngcontent-%COMP%]:before{content:"";position:absolute;top:0;bottom:0;left:50%;width:1px;transform:translate(-50%);background:var(--ng-colors-border-secondary)}.aq-resizer[_ngcontent-%COMP%]:after{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:4px;height:36px;border-radius:3px;background:var(--ng-colors-border-primary);transition:background .15s,height .15s}.aq-resizer[_ngcontent-%COMP%]:hover:after, .aq-resizer.is-active[_ngcontent-%COMP%]:after{background:var(--ng-colors-border-brand);height:44px}.aq-shell--resizing[_ngcontent-%COMP%]{cursor:col-resize;-webkit-user-select:none;user-select:none}.aq-shell--resizing[_ngcontent-%COMP%] .aq-chat-pane[_ngcontent-%COMP%], .aq-shell--resizing[_ngcontent-%COMP%] .aq-builder-pane[_ngcontent-%COMP%], .aq-shell--resizing[_ngcontent-%COMP%] .aq-artifact-pane[_ngcontent-%COMP%]{transition:none}.aq-shell[data-mode=split][_ngcontent-%COMP%] .aq-builder-pane[_ngcontent-%COMP%]{display:none}.aq-artifact-pane[_ngcontent-%COMP%]{position:relative;overflow:hidden;flex:1 1 60%;display:flex;flex-direction:column;min-width:0;background:var(--ng-colors-bg-primary);animation:_ngcontent-%COMP%_aq-slide-in .22s ease}@keyframes _ngcontent-%COMP%_aq-slide-in{0%{transform:translate(16px);opacity:0}to{transform:translate(0);opacity:1}}.aq-artifact-pane--dsl-only[_ngcontent-%COMP%]{position:absolute;top:0;left:-9999px;width:1px;height:1px;overflow:hidden;pointer-events:none;animation:none}.aq-artifact-pane[_ngcontent-%COMP%]{view-transition-name:aq-artifact-pane}.aq-artifact-pane[_ngcontent-%COMP%]:has(nile-drawer.dsl-editor-drawer[open]){view-transition-name:none}@supports (view-transition-name: none){.aq-detail-overlay[_ngcontent-%COMP%]{animation:none}}.aq-artifact-pane__header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;box-sizing:border-box;height:var(--aq-header-h, 56px);padding:0 20px;border-bottom:1px solid var(--ng-colors-border-secondary);background:var(--ng-colors-bg-primary);flex-shrink:0;gap:12px}.aq-artifact-pane__header-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px;flex-shrink:0}.aq-artifact-pane__footer[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:8px;padding:12px 16px;border-top:1px solid var(--ng-colors-border-secondary);background:var(--ng-colors-bg-primary);flex-shrink:0}.aq-library-pane__head[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px;box-sizing:border-box;padding:12px 20px 16px;border-bottom:1px solid var(--ng-colors-border-secondary);flex-shrink:0;background:var(--ng-colors-bg-secondary)}.aq-library-pane__intro[_ngcontent-%COMP%]{margin:0;font-size:13px;line-height:20px;color:var(--ng-colors-text-tertiary-600)}.aq-library-pane__intro-title[_ngcontent-%COMP%]{font-weight:600;color:var(--ng-colors-text-secondary-700)}.aq-library-pane__body[_ngcontent-%COMP%]{flex:1 1 auto;overflow-y:auto;scrollbar-width:none;-ms-overflow-style:none;padding:20px;display:flex;flex-direction:column;gap:16px;background:var(--ng-colors-bg-secondary)}.aq-library-pane__body[_ngcontent-%COMP%]::-webkit-scrollbar{width:0;height:0}.aq-artifact-pane__picker-overlay-footer[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;gap:12px;box-sizing:border-box;padding:10px 16px;border-top:1px solid var(--ng-colors-border-secondary);background:var(--ng-colors-bg-primary);flex-shrink:0}.aq-artifact-pane__picker-overlay-footer-count[_ngcontent-%COMP%]{margin-right:auto;font-size:13px;font-weight:500;color:var(--ng-colors-text-secondary-700)}.aq-artifact-pane__titles[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0;display:flex;align-items:baseline;gap:8px}.aq-artifact-pane__title[_ngcontent-%COMP%]{flex-shrink:0;font-weight:600;font-size:14px;color:var(--ng-colors-text-primary-900)}.aq-artifact-pane__subtitle[_ngcontent-%COMP%]{min-width:0;font-weight:400;font-size:13px;color:var(--ng-colors-text-quaternary-500);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.aq-filters-pill[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;height:32px;padding:0 10px;border:1px solid var(--ng-colors-border-primary);border-radius:8px}.aq-filters-pill__icon[_ngcontent-%COMP%]{color:var(--ng-colors-text-quaternary-500);flex-shrink:0}.aq-filters-pill[_ngcontent-%COMP%] nile-slide-toggle[_ngcontent-%COMP%]{--slide-toggle-width: auto;font-size:13px;font-weight:500;color:var(--ng-colors-text-secondary-700)}.aq-filters-pill.aq-filters-pill--active[_ngcontent-%COMP%]{border-color:var(--nile-color-primary-300, #84adff);background:var(--ng-colors-bg-brand-primary)}.aq-filters-pill.aq-filters-pill--active[_ngcontent-%COMP%] .aq-filters-pill__icon[_ngcontent-%COMP%]{color:var(--ng-colors-border-brand)}.aq-filters-pill.aq-filters-pill--active[_ngcontent-%COMP%] nile-slide-toggle[_ngcontent-%COMP%]{color:var(--ng-colors-border-brand)}.aq-undo-redo-group[_ngcontent-%COMP%]{display:flex;align-items:stretch;height:32px;border:1px solid var(--ng-colors-border-primary);border-radius:8px;overflow:hidden;background:var(--ng-colors-bg-primary)}.aq-undo-redo-group[_ngcontent-%COMP%] nile-button[_ngcontent-%COMP%]::part(base){height:100%!important;border:none!important;border-radius:0!important;padding:0 12px!important;font-size:13px!important;font-weight:500!important;color:var(--ng-colors-text-primary-900)!important}.aq-undo-redo-group[_ngcontent-%COMP%] nile-button[_ngcontent-%COMP%]:first-child::part(base){border-right:1px solid var(--ng-colors-border-secondary)!important}.aq-undo-redo-group[_ngcontent-%COMP%] nile-button[_ngcontent-%COMP%]:last-child::part(base){padding:0 10px!important}.aq-artifact-pane__header-divider[_ngcontent-%COMP%]{width:1px;height:20px;background:var(--ng-colors-border-secondary);flex-shrink:0}.aq-artifact-pane__body[_ngcontent-%COMP%]{flex:1 1 auto;overflow:auto;scrollbar-width:none;-ms-overflow-style:none;display:flex;flex-direction:column;gap:16px;background:var(--ng-colors-bg-secondary)}.aq-artifact-pane__body[_ngcontent-%COMP%]::-webkit-scrollbar{width:0;height:0}.aq-artifact-pane__suggestions[_ngcontent-%COMP%]{flex-shrink:0;padding:10px 16px;border-bottom:1px solid var(--ng-colors-border-secondary);background:var(--ng-colors-bg-tertiary)}.aq-artifact-pane__suggestions-list[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:6px;overflow-x:auto}.aq-suggestion-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:4px;padding:4px 10px;border:1px solid var(--ng-colors-border-primary);border-radius:999px;background:var(--ng-colors-bg-primary);font-size:12px;font-weight:500;color:var(--ng-colors-text-secondary-700);cursor:pointer;white-space:nowrap;transition:border-color .15s,color .15s}.aq-suggestion-chip[_ngcontent-%COMP%]:hover{border-color:var(--ng-colors-border-brand);color:var(--ng-colors-border-brand)}.aq-artifact-pane__empty[_ngcontent-%COMP%]{flex:1 1 auto;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:32px 16px;text-align:center;color:var(--ng-colors-text-quaternary-500)}.aq-artifact-pane__empty-title[_ngcontent-%COMP%]{margin:4px 0 0;font-size:14px;font-weight:600;color:var(--ng-colors-text-secondary-700)}.aq-artifact-pane__empty-sub[_ngcontent-%COMP%]{margin:0;font-size:13px;max-width:320px}.aq-artifact-pane__kpi-picker[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:10px}.aq-picker-chips[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:6px;align-content:start}.aq-picker-chips[_ngcontent-%COMP%] nile-skeleton-loader[_ngcontent-%COMP%]{flex:0 0 auto}.aq-picker-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:5px;border:1px solid var(--ng-colors-border-secondary);border-radius:999px;padding:5px 10px;background:var(--ng-colors-bg-primary);cursor:pointer;font:inherit;font-size:12px;font-weight:600;color:var(--ng-colors-text-quaternary-500);white-space:nowrap;transition:border-color .15s,box-shadow .15s}.aq-picker-chip[_ngcontent-%COMP%]:hover{border-color:var(--ng-colors-border-brand-alt);box-shadow:0 4px 14px var(--ng-colors-bg-brand-primary)}.aq-picker-chip--active[_ngcontent-%COMP%]{background:var(--ng-colors-bg-brand-solid);border-color:var(--ng-colors-border-brand-alt);color:var(--ng-colors-text-white)}.aq-picker-chip--active[_ngcontent-%COMP%]:hover{box-shadow:none}.aq-picker-chip--active[_ngcontent-%COMP%] .aq-picker-chip__count[_ngcontent-%COMP%]{background:#ffffff40;color:var(--ng-colors-text-white)}.aq-picker-chip__count[_ngcontent-%COMP%]{min-width:16px;padding:0 5px;border-radius:999px;background:var(--ng-colors-bg-tertiary);color:var(--ng-colors-text-quaternary-500);font-size:10px;font-weight:700;text-align:center}.inline-widget[_ngcontent-%COMP%]{margin-top:10px;border:1px solid var(--ng-colors-border-secondary);border-radius:14px;background:var(--ng-colors-bg-primary);overflow:hidden;box-shadow:0 1px 2px #1018280a,0 4px 14px #1018280f}.inline-widget__chart[_ngcontent-%COMP%]{height:380px;padding:14px 16px 6px}.inline-widget__chart--kpi[_ngcontent-%COMP%]{height:150px}.inline-widget__chart--kpi-spark[_ngcontent-%COMP%]{height:220px}.inline-widget__chart--grid[_ngcontent-%COMP%]{height:auto;max-height:520px;overflow:auto}.inline-widget__chart[_ngcontent-%COMP%] shared-nile-chart-widget[_ngcontent-%COMP%]{display:block;height:100%;width:100%}.inline-widget__chart--grid[_ngcontent-%COMP%] shared-nile-chart-widget[_ngcontent-%COMP%]{height:auto}.inline-widget__actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:10px;padding:10px 16px 14px;border-top:1px solid var(--ng-colors-border-tertiary)}.chart-live[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:5px;font-size:12px;font-weight:500;color:var(--ng-colors-text-secondary-700);white-space:nowrap}.chart-live__dot[_ngcontent-%COMP%]{width:6px;height:6px;border-radius:50%;background:var(--ng-colors-fg-success-primary)}.chart-live--preview[_ngcontent-%COMP%]{padding:2px 8px;border-radius:4px;background:var(--ng-colors-bg-warning-primary);color:var(--ng-colors-fg-warning-primary)}.forecast-meta[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:4px 18px;padding:10px 14px;border-top:1px solid var(--ng-colors-border-tertiary);background:var(--ng-colors-bg-secondary);font-size:11px;line-height:1.5}.forecast-meta__item[_ngcontent-%COMP%]{display:inline-flex;gap:4px;white-space:nowrap}.forecast-meta__label[_ngcontent-%COMP%]{color:var(--ng-colors-text-quaternary-500)}.forecast-meta__value[_ngcontent-%COMP%]{color:var(--ng-colors-text-secondary-700);font-weight:600}.forecast-record[_ngcontent-%COMP%]{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-top:12px;padding-top:10px;border-top:1px solid var(--ng-colors-border-tertiary)}.forecast-record__icon[_ngcontent-%COMP%]{flex:0 0 auto}.forecast-record__text[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0;font-size:12px;line-height:1.5;color:var(--ng-colors-text-quaternary-500)}.forecast-record__action[_ngcontent-%COMP%]{flex:0 0 auto;padding:4px 10px;border:1px solid transparent;border-radius:6px;background:transparent;cursor:pointer;font:inherit;font-size:12px;font-weight:600;color:#5925dc;transition:background .15s ease,border-color .15s ease}.forecast-record__action[_ngcontent-%COMP%]:hover:not(:disabled){border-color:#d9d0fd;background:#f7f5ff}.forecast-record__action[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:default}.follow-ups[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}.follow-up[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;padding:7px 12px;border:1px solid var(--ng-colors-border-secondary);border-radius:8px;background:var(--ng-colors-bg-primary);cursor:pointer;font:inherit;font-size:13px;font-weight:500;color:var(--ng-colors-text-secondary-700);transition:border-color .15s ease,background .15s ease}.follow-up[_ngcontent-%COMP%]:hover:not(:disabled){border-color:var(--ng-colors-text-tertiary-on-brand);background:var(--ng-colors-bg-secondary)}.follow-up[_ngcontent-%COMP%]:disabled{opacity:.55;cursor:default}.follow-up__icon[_ngcontent-%COMP%]{flex:0 0 auto}.follow-up__label[_ngcontent-%COMP%]{white-space:nowrap}.follow-up__badge[_ngcontent-%COMP%]{padding:2px 6px;border-radius:4px;background:#7a5af8;color:var(--ng-colors-text-white);font-size:9px;font-weight:700;letter-spacing:.04em;text-transform:uppercase}.follow-up--ai[_ngcontent-%COMP%]{border-color:#d9d0fd;background:#f7f5ff;color:#5925dc}.follow-up--ai[_ngcontent-%COMP%]:hover:not(:disabled){border-color:#b9a6fb;background:#f0ecff}.widget-header-btn[_ngcontent-%COMP%]{position:relative;display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;padding:0;margin:0 2px;box-sizing:border-box;border:none;border-radius:6px;background:transparent;color:var(--ng-colors-text-quaternary-500);cursor:pointer}.widget-header-btn[_ngcontent-%COMP%]:hover{background:var(--ng-colors-bg-tertiary);color:var(--ng-colors-text-primary-900)}.widget-header-dropdown[_ngcontent-%COMP%]::part(panel){width:320px;max-width:92vw}.widget-header-dropdown[_ngcontent-%COMP%]::part(base){display:block}.widget-header-anchor[_ngcontent-%COMP%]{display:inline-block;width:0;height:0}.widget-menu__trigger[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;padding:0;margin:0 2px;box-sizing:border-box;border:none;border-radius:var(--ng-radius-md, 6px);background:transparent;color:var(--ng-colors-text-tertiary-600);cursor:pointer}.widget-menu__trigger[_ngcontent-%COMP%]:hover{background:var(--ng-colors-bg-secondary);color:var(--ng-colors-text-primary-900)}.widget-menu__label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;width:100%}.widget-menu__label[_ngcontent-%COMP%] nile-glyph[_ngcontent-%COMP%]{flex:none;color:var(--ng-colors-text-tertiary-600)}.widget-menu__sep[_ngcontent-%COMP%]{height:var(--ng-stroke-width-1, 1px);background:var(--ng-colors-border-secondary);margin:var(--ng-spacing-md, 8px)}.type-picker__panel[_ngcontent-%COMP%], .filter-builder__panel[_ngcontent-%COMP%]{background:var(--ng-colors-bg-primary);border:1px solid var(--ng-colors-border-secondary);border-radius:12px;box-shadow:0 8px 24px #10182824;padding:10px;box-sizing:border-box}.inline-action__loading[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:8px;min-height:56px;font-size:13px;color:var(--ng-colors-text-tertiary-600)}.inline-action__hint[_ngcontent-%COMP%]{margin:0 0 6px;font-size:12px;color:var(--ng-colors-text-tertiary-600)}.inline-action__error[_ngcontent-%COMP%]{margin:6px 0 0;font-size:12px;color:var(--ng-colors-fg-error-primary)}.type-picker__section[_ngcontent-%COMP%]{margin:6px 0 4px;font-size:11px;font-weight:600;letter-spacing:.02em;text-transform:uppercase;color:var(--ng-colors-text-quaternary-500)}.type-picker__section[_ngcontent-%COMP%]:first-child{margin-top:0}.type-picker__grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}.type-picker__tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:8px 4px;box-sizing:border-box;height:60px;border:1px solid var(--ng-colors-border-secondary);border-radius:8px;background:var(--ng-colors-bg-primary);color:var(--ng-colors-text-secondary-700);font-size:11px;font-weight:500;cursor:pointer}.type-picker__tile[_ngcontent-%COMP%] nile-glyph[_ngcontent-%COMP%]{color:var(--ng-colors-text-quaternary-500)}.type-picker__tile[_ngcontent-%COMP%]:hover:not(:disabled){border-color:var(--ng-colors-border-brand);color:var(--ng-colors-border-brand)}.type-picker__tile[_ngcontent-%COMP%]:hover:not(:disabled) nile-glyph[_ngcontent-%COMP%]{color:var(--ng-colors-border-brand)}.type-picker__tile[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:default}.type-picker__tile--sensible[_ngcontent-%COMP%]{border-color:var(--ng-colors-bg-brand-secondary);background:var(--ng-colors-bg-brand-primary)}.type-picker__tile--sensible[_ngcontent-%COMP%] nile-glyph[_ngcontent-%COMP%]{color:var(--ng-colors-border-brand)}.filter-builder__active[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:8px}.filter-builder__chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;padding:4px 8px;border-radius:999px;background:var(--ng-colors-bg-brand-primary);color:var(--ng-colors-text-secondary-700);font-size:12px}.filter-builder__chip-remove[_ngcontent-%COMP%]{display:inline-flex;border:none;background:none;padding:0;cursor:pointer;color:inherit}.filter-builder__form[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:6px}.filter-builder__field-label[_ngcontent-%COMP%]{padding:6px 2px;font-size:12px;font-weight:600;color:var(--ng-colors-text-primary-900)}.filter-builder__and[_ngcontent-%COMP%]{font-size:12px;color:var(--ng-colors-text-tertiary-600)}.filter-builder__select[_ngcontent-%COMP%], .filter-builder__input[_ngcontent-%COMP%]{flex:1 1 100%;min-width:0;padding:7px 8px;box-sizing:border-box;border:1px solid var(--ng-colors-border-secondary);border-radius:7px;background:var(--ng-colors-bg-primary);font:inherit;font-size:12px;color:var(--ng-colors-text-primary-900)}.filter-builder__multi[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px;max-height:160px;overflow-y:auto;width:100%}.filter-builder__multi-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;padding:4px 2px;font-size:12px;color:var(--ng-colors-text-secondary-700);cursor:pointer}.filter-builder__multi-item[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.aq-shell[data-mode=builder][_ngcontent-%COMP%] .aq-chat-pane[_ngcontent-%COMP%]{flex:0 0 auto;flex-basis:clamp(320px,41%,485px);max-width:50%;margin:0}.aq-builder-pane[_ngcontent-%COMP%]{position:relative;overflow:hidden;flex:1 1 60%;display:flex;flex-direction:column;min-width:0}.aq-builder-pane[_ngcontent-%COMP%] shared-builder-host[_ngcontent-%COMP%]{flex:1 1 auto;min-height:0}.aq-builder-pane[_ngcontent-%COMP%] shared-dashboard-grid{display:block;min-width:calc(100cqw - 24px)}.aq-shell--fullscreen[data-mode=builder][_ngcontent-%COMP%] .aq-chat-pane[_ngcontent-%COMP%]{flex-basis:0;max-width:0;overflow:hidden;border-right:none}.aq-shell--fullscreen[data-mode=builder][_ngcontent-%COMP%] .aq-builder-pane[_ngcontent-%COMP%]{flex-basis:100%}.aq-shell--fullscreen[data-mode=builder][_ngcontent-%COMP%] .aq-builder-pane[_ngcontent-%COMP%] shared-dashboard-grid{min-width:100%}.choice-picker[_ngcontent-%COMP%]{margin-top:16px;width:100%}.choice-picker[_ngcontent-%COMP%] + .choice-picker[_ngcontent-%COMP%]{margin-top:22px}.choice-picker__group[_ngcontent-%COMP%]{display:block;width:100%}.choice-picker__step[_ngcontent-%COMP%]{display:block;margin-bottom:4px;font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--ng-colors-text-tertiary-600)}.choice-picker__submit-row[_ngcontent-%COMP%]{margin-top:12px;display:flex;justify-content:flex-start}.choice-card[_ngcontent-%COMP%]{display:block}.choice-card[_ngcontent-%COMP%]::part(base){width:100%;box-sizing:border-box;margin:0;padding:12px 14px;gap:0;align-items:center;border:none;border-bottom:1px solid var(--ng-colors-border-secondary);border-radius:8px;background:transparent;cursor:pointer;transition:border-color .15s ease,background-color .15s ease,box-shadow .15s ease}.choice-card[_ngcontent-%COMP%]:last-of-type::part(base){border-bottom:none}.choice-card[_ngcontent-%COMP%]::part(control){display:none}.choice-card[_ngcontent-%COMP%]::part(label){flex:1 1 auto;min-width:0;margin:0}.choice-card[_ngcontent-%COMP%]:not(.choice-card--locked):hover::part(base){border-color:var(--ng-colors-border-brand);background:var(--ng-colors-bg-brand-primary)}.choice-card--chosen[_ngcontent-%COMP%]::part(base){border-color:var(--ng-colors-border-brand);background:var(--ng-colors-bg-brand-primary);box-shadow:inset 0 0 0 1px var(--ng-colors-border-brand)}.choice-card--locked[_ngcontent-%COMP%]:not(.choice-card--chosen)::part(base){opacity:.6;cursor:default}.choice-card__label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;min-width:0}.choice-card__num[_ngcontent-%COMP%]{flex:0 0 auto;display:flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:6px;font-size:11.5px;font-weight:700;color:var(--ng-colors-text-tertiary-600);background:var(--ng-colors-bg-secondary);transition:color .15s ease,background-color .15s ease}.choice-card--chosen[_ngcontent-%COMP%] .choice-card__num[_ngcontent-%COMP%]{color:var(--ng-colors-text-white);background:var(--ng-colors-bg-brand-solid)}.choice-card__text[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px;min-width:0}.choice-card__name[_ngcontent-%COMP%]{font-size:13.5px;font-weight:600;color:var(--ng-colors-text-primary-900);line-height:1.4;overflow-wrap:anywhere}.choice-card__hint[_ngcontent-%COMP%]{font-size:12.5px;font-weight:400;line-height:1.4;color:var(--ng-colors-text-tertiary-600)}.choice-card__badge[_ngcontent-%COMP%]{display:inline-block;margin-bottom:2px;font-size:10.5px;font-weight:700;letter-spacing:.03em;text-transform:uppercase;color:var(--ng-colors-fg-success-primary)}.choice-card__meta[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:10px;margin-top:1px;font-size:11.5px;color:var(--ng-colors-text-tertiary-600)}.choice-card__chip--green[_ngcontent-%COMP%]{color:var(--ng-colors-fg-success-primary);font-weight:700}.choice-card__chip--yellow[_ngcontent-%COMP%]{color:var(--ng-colors-fg-warning-primary);font-weight:700}.choice-card__chip--red[_ngcontent-%COMP%]{color:var(--ng-colors-fg-error-primary);font-weight:700}.choice-card__chip--muted[_ngcontent-%COMP%]{color:var(--ng-colors-text-tertiary-600)}.choice-picker__empty[_ngcontent-%COMP%]{margin:0;font-size:12.5px;color:var(--ng-colors-text-tertiary-600)}.choice-picker__chat-link[_ngcontent-%COMP%]{appearance:none;display:inline-flex;align-items:center;gap:4px;margin:6px 0 0;padding:0;border:none;border-radius:0;background:none;font-size:12.5px;color:var(--ng-colors-fg-brand-primary-600);cursor:pointer;text-align:left}.choice-picker__chat-link[_ngcontent-%COMP%]:hover:not(:disabled){text-decoration:underline}.choice-picker__chat-link[_ngcontent-%COMP%]:disabled{color:var(--ng-colors-text-tertiary-600);cursor:default}.choice-picker__chat-link--preview[_ngcontent-%COMP%]{gap:6px;padding:5px 10px;border:1px solid var(--ng-colors-border-secondary);border-radius:999px;color:var(--ng-colors-text-secondary-700)}.choice-picker__chat-link--preview[_ngcontent-%COMP%]:hover:not(:disabled){text-decoration:none;border-color:var(--ng-colors-border-brand);color:var(--ng-colors-fg-brand-primary-600);background:var(--ng-colors-bg-brand-primary)}.choice-picker__chat-link--preview[_ngcontent-%COMP%]:disabled{border-color:var(--ng-colors-border-secondary)}.choice-picker__footer-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;margin-top:6px}.choice-picker__footer-actions[_ngcontent-%COMP%] .choice-picker__chat-link[_ngcontent-%COMP%]{margin-top:0}.choice-picker__chat-draft[_ngcontent-%COMP%]{margin-top:8px;padding:10px;border:1px dashed var(--ng-colors-border-primary);border-radius:8px;background:var(--ng-colors-bg-secondary)}.choice-picker__chat-draft-label[_ngcontent-%COMP%]{display:block;margin-bottom:6px;font-size:11px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--ng-colors-text-tertiary-600)}.choice-picker__chat-draft-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:8px}.choice-picker__chat-draft-input[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0}.choice-picker__resume-chip[_ngcontent-%COMP%]{display:inline-block;margin-top:16px;padding:6px 10px;border:1px solid var(--ng-colors-border-secondary);border-radius:6px;background:var(--ng-colors-bg-secondary);cursor:pointer;transition:border-color .15s ease,background-color .15s ease}.choice-picker__resume-chip[_ngcontent-%COMP%]:hover{border-color:var(--ng-colors-border-brand);background:var(--ng-colors-bg-brand-primary)}.choice-panel[_ngcontent-%COMP%]{margin-bottom:10px;padding:14px 16px;border:1px solid var(--ng-colors-border-secondary);border-radius:12px;background:var(--ng-colors-bg-primary);box-shadow:0 4px 16px #10182814}.choice-panel__header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}.choice-panel__count[_ngcontent-%COMP%]{font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--ng-colors-text-tertiary-600)}.choice-panel__nav-group[_ngcontent-%COMP%]{display:flex;align-items:center;gap:2px}.choice-panel__nav[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:4px;width:24px;height:24px;padding:0;border:none;border-radius:6px;background:transparent;color:var(--ng-colors-text-tertiary-600);cursor:pointer;transition:background-color .15s ease,color .15s ease}.choice-panel__nav[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--ng-colors-bg-secondary);color:var(--ng-colors-text-primary-900)}.choice-panel__nav[_ngcontent-%COMP%]:disabled{opacity:.35;cursor:default}.choice-panel__close[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--ng-colors-bg-error-primary);color:var(--ng-colors-fg-error-primary)}.choice-panel__options[_ngcontent-%COMP%]{display:block;width:100%}.choice-panel-option[_ngcontent-%COMP%]{display:block}.choice-panel-option[_ngcontent-%COMP%]::part(base){width:100%;box-sizing:border-box;margin:0;padding:8px 10px;gap:0;align-items:center;border:none;border-radius:6px;background:transparent;cursor:pointer;transition:border-color .15s ease,background-color .15s ease}.choice-panel-option[_ngcontent-%COMP%]::part(control){display:none}.choice-panel-option[_ngcontent-%COMP%]::part(label){flex:1 1 auto;min-width:0;margin:0}.choice-panel-option[_ngcontent-%COMP%]:hover::part(base){background:var(--ng-colors-bg-brand-primary)}.choice-panel-option__label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;min-width:0}.choice-panel-option__num[_ngcontent-%COMP%]{flex:0 0 auto;display:flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:5px;font-size:11px;font-weight:700;color:var(--ng-colors-text-tertiary-600);background:var(--ng-colors-bg-secondary)}.choice-panel-option__text[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1px;min-width:0}.choice-panel-option__name[_ngcontent-%COMP%]{font-size:13px;font-weight:600;color:var(--ng-colors-text-primary-900);line-height:1.4;overflow-wrap:anywhere}.choice-panel-option__hint[_ngcontent-%COMP%]{font-size:12px;font-weight:400;line-height:1.4;color:var(--ng-colors-text-tertiary-600)}.choice-panel-option__badge[_ngcontent-%COMP%]{display:inline-block;margin-bottom:2px;font-size:10px;font-weight:700;letter-spacing:.03em;text-transform:uppercase;color:var(--ng-colors-fg-success-primary)}.choice-panel__footer[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;margin-top:10px}.choice-panel__footer--review[_ngcontent-%COMP%]{justify-content:space-between}.choice-panel__skip[_ngcontent-%COMP%]{flex:0 0 auto;padding:6px 10px;border:none;border-radius:6px;font-size:12.5px;font-weight:600;color:var(--ng-colors-text-tertiary-600);background:transparent;cursor:pointer}.choice-panel__skip[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--ng-colors-bg-secondary);color:var(--ng-colors-text-primary-900)}.choice-panel__hint[_ngcontent-%COMP%]{margin:10px 0 0;font-size:11px;color:var(--ng-colors-text-tertiary-600);text-align:center}.choice-panel__review[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}.choice-panel__review-row[_ngcontent-%COMP%]{display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding:6px 8px;border-radius:6px;background:var(--ng-colors-bg-secondary)}.choice-panel__review-title[_ngcontent-%COMP%]{font-size:12.5px;font-weight:600;color:var(--ng-colors-text-tertiary-600);flex:1 1 auto;min-width:0}.choice-panel__review-answer[_ngcontent-%COMP%]{font-size:13px;font-weight:500;color:var(--ng-colors-text-primary-900);text-align:right;flex:0 1 auto;min-width:0;max-width:55%;overflow-wrap:break-word}.ai-executive-summary[_ngcontent-%COMP%]::part(trigger){display:none}.aq-tools-pane[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1;min-height:0;overflow-y:auto;padding:16px 20px;background:var(--ng-colors-bg-secondary);scrollbar-width:none;-ms-overflow-style:none}.aq-tools-pane[_ngcontent-%COMP%]::-webkit-scrollbar{width:0;height:0}.aq-tools-pane__head[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;margin-bottom:6px}.aq-tools-pane__badge[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:28px;height:28px;flex-shrink:0;border-radius:var(--ng-radius-full, 9999px);background:var(--ng-colors-bg-brand-primary);color:var(--ng-colors-fg-brand-primary-600)}.aq-tools-pane__title[_ngcontent-%COMP%]{font-family:var(--ng-font-family-display, "Inter", system-ui, sans-serif);font-size:15px;font-weight:600;color:var(--ng-colors-text-primary-900)}.aq-tools-pane__subtitle[_ngcontent-%COMP%]{margin:0 0 18px;font-size:13px;color:var(--ng-colors-text-tertiary-600)}.aq-tools-step[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;margin-bottom:10px}.aq-tools-step__num[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:20px;height:20px;flex-shrink:0;border-radius:var(--ng-radius-full, 9999px);background:var(--ng-colors-bg-brand-solid);color:var(--ng-colors-text-white);font-size:11px;font-weight:600}.aq-tools-step__label[_ngcontent-%COMP%]{font-size:13px;font-weight:600;color:var(--ng-colors-text-primary-900)}.aq-tools-criteria[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:0 0 20px 28px;border:1px solid var(--ng-colors-border-secondary);border-radius:var(--ng-radius-md, 8px);background:var(--ng-colors-bg-primary);overflow:hidden;flex-shrink:0}.aq-tools-criteria__row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;padding:10px 12px;border:none;background:none;text-align:left;cursor:pointer;font:inherit}.aq-tools-criteria__row[_ngcontent-%COMP%] + .aq-tools-criteria__row[_ngcontent-%COMP%]{border-top:1px solid var(--ng-colors-border-tertiary)}.aq-tools-criteria__row.is-selected[_ngcontent-%COMP%]{background:var(--ng-colors-bg-brand-primary)}.aq-tools-criteria__dot[_ngcontent-%COMP%]{width:14px;height:14px;flex-shrink:0;border:1px solid var(--ng-colors-border-primary);border-radius:var(--ng-radius-full, 9999px)}.is-selected[_ngcontent-%COMP%] .aq-tools-criteria__dot[_ngcontent-%COMP%]{border:4px solid var(--ng-colors-bg-brand-solid)}.aq-tools-criteria__label[_ngcontent-%COMP%]{font-size:13px;color:var(--ng-colors-text-secondary-700)}.is-selected[_ngcontent-%COMP%] .aq-tools-criteria__label[_ngcontent-%COMP%]{color:var(--ng-colors-text-brand-secondary-700);font-weight:500}.aq-tools-criteria__row--skeleton[_ngcontent-%COMP%]{gap:10px;cursor:default}.aq-tools-criteria__row--skeleton[_ngcontent-%COMP%] + .aq-tools-criteria__row--skeleton[_ngcontent-%COMP%]{border-top:1px solid var(--ng-colors-border-tertiary)}.aq-tools-matches[_ngcontent-%COMP%]{margin:0 0 18px 28px;padding:12px;border:1px solid var(--ng-colors-border-secondary);border-radius:var(--ng-radius-md, 8px);background:var(--ng-colors-bg-primary);flex-shrink:0}.aq-tools-matches__summary[_ngcontent-%COMP%]{margin:0 0 8px;font-size:13px;color:var(--ng-colors-text-secondary-700)}.aq-tools-matches__row[_ngcontent-%COMP%]{display:flex;align-items:baseline;gap:8px;width:100%;padding:6px 4px;border-top:1px solid var(--ng-colors-border-tertiary);font:inherit}.aq-tools-matches__row[_ngcontent-%COMP%]:first-child{border-top:none}.aq-tools-matches__check[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:14px;height:14px;flex-shrink:0}.aq-tools-matches__name[_ngcontent-%COMP%]{flex:1;min-width:0;text-align:left;font-size:13px;color:var(--ng-colors-text-secondary-700);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.aq-tools-matches__days[_ngcontent-%COMP%]{font-size:13px;color:var(--ng-colors-text-quaternary-500)}.aq-tools-matches__list[_ngcontent-%COMP%]{display:flex;flex-direction:column}.aq-tools-matches__list.is-expanded[_ngcontent-%COMP%]{max-height:260px;overflow-y:auto;overscroll-behavior:contain}.aq-tools-matches__view-all[_ngcontent-%COMP%]{margin-top:8px;padding:0;border:none;background:none;cursor:pointer;font-size:12px;font-weight:600;color:var(--ng-colors-text-brand-tertiary-600)}.aq-tools-matches__view-all[_ngcontent-%COMP%]:hover{color:var(--ng-colors-text-brand-secondary-700)}.aq-tools-matches__view-all[_ngcontent-%COMP%]:disabled{cursor:default;opacity:.55}.aq-tools-matches__note[_ngcontent-%COMP%]{margin:8px 0 0;font-size:12px;color:var(--ng-colors-text-quaternary-500)}.aq-tools-matches__row--skeleton[_ngcontent-%COMP%]{cursor:default}.aq-tools-matches__empty[_ngcontent-%COMP%]{margin:4px 0 0;padding:6px 0 2px;font-size:12px;color:var(--ng-colors-text-quaternary-500)}.aq-tools-criteria__failed[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;gap:10px;padding:14px 12px}.aq-tools-matches--error[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:12px}.aq-tools-matches__error[_ngcontent-%COMP%]{margin:0;font-size:13px;color:var(--ng-colors-text-secondary-700)}.aq-tools-pane__spacer[_ngcontent-%COMP%]{flex:1;min-height:0}.aq-tools-pane__footer[_ngcontent-%COMP%]{flex-shrink:0;margin-top:4px;padding-top:12px;border-top:1px solid var(--ng-colors-border-secondary)}.aq-tools-pane__disclaimer[_ngcontent-%COMP%]{margin:0 0 10px;font-size:12px;line-height:17px;color:var(--ng-colors-text-quaternary-500)}.aq-tools-pane__actions[_ngcontent-%COMP%]{display:flex;gap:8px}.aq-tools-pane__actions[_ngcontent-%COMP%] nile-button[_ngcontent-%COMP%]{display:block;flex:1;min-width:0}.aq-tools-pane__actions[_ngcontent-%COMP%] nile-button[_ngcontent-%COMP%]::part(base){width:100%;justify-content:center;white-space:nowrap}']})};var bc=(i,t)=>t.id;function vc(i,t){if(i&1&&(s(0,"div",9),C(1,"div",12),s(2,"span"),c(3),d()()),i&2){let e=r();l(3),y(e.copy().loadingConnections)}}function wc(i,t){if(i&1){let e=k();s(0,"div",10)(1,"div",13),C(2,"nile-glyph",14),d(),s(3,"h3",15),c(4),d(),s(5,"p",16),c(6),d(),s(7,"button",7),u("click",function(){_(e);let o=r();return g(o.openForm())}),C(8,"nile-glyph",8),c(9),d()()}if(i&2){let e=r();l(4),y(e.copy().noConnectionsTitle),l(2),y(e.copy().noConnectionsSub),l(3),q(" ",e.copy().registerConnectionButton," ")}}function kc(i,t){i&1&&(s(0,"span",23),c(1,"Active"),d())}function Pc(i,t){i&1&&(s(0,"span",24),c(1,"Inactive"),d())}function Ac(i,t){i&1&&(s(0,"span",25),C(1,"nile-glyph",34),c(2," Schema "),d())}function Mc(i,t){i&1&&C(0,"span",28)}function Sc(i,t){i&1&&C(0,"nile-glyph",29)}function Tc(i,t){i&1&&C(0,"span",28)}function qc(i,t){i&1&&C(0,"nile-glyph",31)}function Dc(i,t){if(i&1&&(s(0,"span",37),c(1),d()),i&2){let e=r(3).$implicit;l(),Y("",e.testResult.sampleTables.slice(0,4).join(", "),"",e.testResult.sampleTables.length>4?"\u2026":"")}}function Fc(i,t){if(i&1&&(C(0,"nile-glyph",36),s(1,"span"),c(2),d(),m(3,Dc,2,2,"span",37)),i&2){let e=r(2).$implicit;l(2),q("Reachable \xB7 ",e.testResult.tableCount," tables"),l(),h(e.testResult.sampleTables.length?3:-1)}}function Oc(i,t){if(i&1&&(C(0,"nile-glyph",38),s(1,"span"),c(2),d()),i&2){let e=r(2).$implicit,n=r(2);l(2),q("Unreachable \xB7 ",e.testResult.error??n.copy().errors.connectionTestFailedFallback)}}function Ec(i,t){if(i&1&&(s(0,"div",35),m(1,Fc,4,2)(2,Oc,3,1),d()),i&2){let e=r().$implicit;W("wfconn-test-result--ok",e.testResult.reachable)("wfconn-test-result--fail",!e.testResult.reachable),l(),h(e.testResult.reachable?1:2)}}function Ic(i,t){if(i&1){let e=k();s(0,"div",18)(1,"div",19)(2,"div",20)(3,"span",21),c(4),d(),s(5,"span",22),c(6),d(),m(7,kc,2,0,"span",23)(8,Pc,2,0,"span",24),m(9,Ac,3,0,"span",25),d(),s(10,"div",26)(11,"button",27),u("click",function(){let o=_(e).$implicit,a=r(2);return g(a.testConnection(o.id))}),m(12,Mc,1,0,"span",28)(13,Sc,1,0,"nile-glyph",29),c(14),d(),s(15,"button",30),u("click",function(){let o=_(e).$implicit,a=r(2);return g(a.deleteConnection(o.id,o.name))}),m(16,Tc,1,0,"span",28)(17,qc,1,0,"nile-glyph",31),d()()(),s(18,"div",32),c(19),Nt(20,"date"),d(),m(21,Ec,3,5,"div",33),d()}if(i&2){let e=t.$implicit,n=r(2);W("wfconn-card--deleting",e.deleting),l(4),y(e.name),l(2),y(n.adapterLabel(e.adapterType)),l(),h(e.isActive?7:8),l(2),h(e.hasSchemaSnapshot?9:-1),l(2),W("wfconn-icon-btn--loading",e.testing),b("disabled",e.testing||e.deleting),l(),h(e.testing?12:13),l(2),q(" ",n.copy().testConnectionButton," "),l(),b("disabled",e.testing||e.deleting),l(),h(e.deleting?16:17),l(3),q(" Created ",Lt(20,15,e.createdAt,"mediumDate")," "),l(2),h(e.testResult?21:-1)}}function Vc(i,t){if(i&1&&(s(0,"div",11),F(1,Ic,22,18,"div",17,bc),d()),i&2){let e=r();l(),O(e.connections())}}function Rc(i,t){if(i&1){let e=k();s(0,"div",46)(1,"label",47),c(2,"Server"),d(),s(3,"input",60),u("ngModelChange",function(o){_(e);let a=r(2);return g(a.patchMssql("server",o))}),d()(),s(4,"div",46)(5,"label",47),c(6,"Database"),d(),s(7,"input",61),u("ngModelChange",function(o){_(e);let a=r(2);return g(a.patchMssql("database",o))}),d()(),s(8,"div",62)(9,"div",46)(10,"label",47),c(11,"Username"),d(),s(12,"input",63),u("ngModelChange",function(o){_(e);let a=r(2);return g(a.patchMssql("user",o))}),d()(),s(13,"div",46)(14,"label",47),c(15,"Password"),d(),s(16,"div",64)(17,"input",65),u("ngModelChange",function(o){_(e);let a=r(2);return g(a.patchMssql("password",o))}),d(),s(18,"button",66),u("click",function(){_(e);let o=r(2);return g(o.showPassword.update(a=>!a))}),C(19,"nile-glyph",67),d()()()(),s(20,"div",62)(21,"div",46)(22,"label",47),c(23,"Schema"),d(),s(24,"input",68),u("ngModelChange",function(o){_(e);let a=r(2);return g(a.patchMssql("schema",o))}),d()(),s(25,"div",69)(26,"label",47),c(27,"Port"),d(),s(28,"input",70),u("ngModelChange",function(o){_(e);let a=r(2);return g(a.patchMssql("port",+o))}),d()()()}if(i&2){let e=r(2);l(3),b("ngModel",e.mssql().server),l(4),b("ngModel",e.mssql().database),l(5),b("ngModel",e.mssql().user),l(5),b("type",e.showPassword()?"text":"password")("ngModel",e.mssql().password),l(2),M("name",e.showPassword()?"ng-eye-off":"ng-eye"),l(5),b("ngModel",e.mssql().schema),l(4),b("ngModel",e.mssql().port)}}function zc(i,t){if(i&1){let e=k();s(0,"div",46)(1,"label",47),c(2,"URL"),d(),s(3,"input",71),u("ngModelChange",function(o){_(e);let a=r(2);return g(a.patchOpensearch("url",o))}),d()(),s(4,"div",62)(5,"div",46)(6,"label",47),c(7,"Username"),d(),s(8,"input",72),u("ngModelChange",function(o){_(e);let a=r(2);return g(a.patchOpensearch("username",o))}),d()(),s(9,"div",46)(10,"label",47),c(11,"Password"),d(),s(12,"div",64)(13,"input",65),u("ngModelChange",function(o){_(e);let a=r(2);return g(a.patchOpensearch("password",o))}),d(),s(14,"button",66),u("click",function(){_(e);let o=r(2);return g(o.showPassword.update(a=>!a))}),C(15,"nile-glyph",67),d()()()()}if(i&2){let e=r(2);l(3),b("ngModel",e.opensearch().url),l(5),b("ngModel",e.opensearch().username),l(5),b("type",e.showPassword()?"text":"password")("ngModel",e.opensearch().password),l(2),M("name",e.showPassword()?"ng-eye-off":"ng-eye")}}function Nc(i,t){if(i&1){let e=k();s(0,"div",62)(1,"div",46)(2,"label",47),c(3,"Host"),d(),s(4,"input",73),u("ngModelChange",function(o){_(e);let a=r(2);return g(a.patchPostgres("host",o))}),d()(),s(5,"div",69)(6,"label",47),c(7,"Port"),d(),s(8,"input",74),u("ngModelChange",function(o){_(e);let a=r(2);return g(a.patchPostgres("port",+o))}),d()()(),s(9,"div",46)(10,"label",47),c(11,"Database"),d(),s(12,"input",61),u("ngModelChange",function(o){_(e);let a=r(2);return g(a.patchPostgres("database",o))}),d()(),s(13,"div",62)(14,"div",46)(15,"label",47),c(16,"Username"),d(),s(17,"input",75),u("ngModelChange",function(o){_(e);let a=r(2);return g(a.patchPostgres("user",o))}),d()(),s(18,"div",46)(19,"label",47),c(20,"Password"),d(),s(21,"div",64)(22,"input",65),u("ngModelChange",function(o){_(e);let a=r(2);return g(a.patchPostgres("password",o))}),d(),s(23,"button",66),u("click",function(){_(e);let o=r(2);return g(o.showPassword.update(a=>!a))}),C(24,"nile-glyph",67),d()()()(),s(25,"div",46)(26,"label",47),c(27,"Schema"),d(),s(28,"input",76),u("ngModelChange",function(o){_(e);let a=r(2);return g(a.patchPostgres("schema",o))}),d()()}if(i&2){let e=r(2);l(4),b("ngModel",e.postgres().host),l(4),b("ngModel",e.postgres().port),l(4),b("ngModel",e.postgres().database),l(5),b("ngModel",e.postgres().user),l(5),b("type",e.showPassword()?"text":"password")("ngModel",e.postgres().password),l(2),M("name",e.showPassword()?"ng-eye-off":"ng-eye"),l(4),b("ngModel",e.postgres().schema)}}function Lc(i,t){if(i&1){let e=k();s(0,"div",46)(1,"label",47),c(2,"Account"),d(),s(3,"input",77),u("ngModelChange",function(o){_(e);let a=r(2);return g(a.patchSnowflake("account",o))}),d()(),s(4,"div",62)(5,"div",46)(6,"label",47),c(7,"Database"),d(),s(8,"input",78),u("ngModelChange",function(o){_(e);let a=r(2);return g(a.patchSnowflake("database",o))}),d()(),s(9,"div",46)(10,"label",47),c(11,"Schema"),d(),s(12,"input",79),u("ngModelChange",function(o){_(e);let a=r(2);return g(a.patchSnowflake("schema",o))}),d()()(),s(13,"div",46)(14,"label",47),c(15,"Warehouse"),d(),s(16,"input",80),u("ngModelChange",function(o){_(e);let a=r(2);return g(a.patchSnowflake("warehouse",o))}),d()(),s(17,"div",62)(18,"div",46)(19,"label",47),c(20,"Username"),d(),s(21,"input",81),u("ngModelChange",function(o){_(e);let a=r(2);return g(a.patchSnowflake("user",o))}),d()(),s(22,"div",46)(23,"label",47),c(24,"Password"),d(),s(25,"div",64)(26,"input",65),u("ngModelChange",function(o){_(e);let a=r(2);return g(a.patchSnowflake("password",o))}),d(),s(27,"button",66),u("click",function(){_(e);let o=r(2);return g(o.showPassword.update(a=>!a))}),C(28,"nile-glyph",67),d()()()()}if(i&2){let e=r(2);l(3),b("ngModel",e.snowflake().account),l(5),b("ngModel",e.snowflake().database),l(4),b("ngModel",e.snowflake().schema),l(4),b("ngModel",e.snowflake().warehouse),l(5),b("ngModel",e.snowflake().user),l(5),b("type",e.showPassword()?"text":"password")("ngModel",e.snowflake().password),l(2),M("name",e.showPassword()?"ng-eye-off":"ng-eye")}}function $c(i,t){if(i&1&&(s(0,"div",56),C(1,"nile-glyph",38),c(2),d()),i&2){let e=r(2);l(2),q(" ",e.formError()," ")}}function Wc(i,t){if(i&1&&(C(0,"span",82),c(1)),i&2){let e=r(2);l(),q(" ",e.copy().registeringButton," ")}}function Bc(i,t){if(i&1&&(C(0,"nile-glyph",83),c(1)),i&2){let e=r(2);l(),q(" ",e.copy().registerAndTestButton," ")}}function Uc(i,t){if(i&1){let e=k();s(0,"div",39),u("click",function(){_(e);let o=r();return g(o.closeForm())}),d(),s(1,"aside",40)(2,"div",41)(3,"span",42),c(4),d(),s(5,"button",43),u("click",function(){_(e);let o=r();return g(o.closeForm())}),C(6,"nile-glyph",44),d()(),s(7,"div",45)(8,"div",46)(9,"label",47),c(10,"Connection name"),d(),s(11,"input",48),u("ngModelChange",function(o){_(e);let a=r();return g(a.formConnectionName.set(o))}),d()(),s(12,"div",46)(13,"label",47),c(14,"Display name "),s(15,"span",49),c(16,"(optional)"),d()(),s(17,"input",48),u("ngModelChange",function(o){_(e);let a=r();return g(a.formDisplayName.set(o))}),d()(),s(18,"div",46)(19,"label",47),c(20,"Adapter type"),d(),s(21,"select",50),u("ngModelChange",function(o){_(e);let a=r();return g(a.formAdapter.set(o))}),s(22,"option",51),c(23,"MSSQL (SQL Server)"),d(),s(24,"option",52),c(25,"OpenSearch"),d(),s(26,"option",53),c(27,"PostgreSQL"),d(),s(28,"option",54),c(29,"Snowflake"),d()()(),s(30,"div",55),c(31,"Connection config"),d(),m(32,Rc,29,8),m(33,zc,16,5),m(34,Nc,29,8),m(35,Lc,29,8),m(36,$c,3,1,"div",56),d(),s(37,"div",57)(38,"button",58),u("click",function(){_(e);let o=r();return g(o.closeForm())}),c(39),d(),s(40,"button",59),u("click",function(){_(e);let o=r();return g(o.submitRegister())}),m(41,Wc,2,1)(42,Bc,2,1),d()()()}if(i&2){let e=r();l(4),y(e.copy().registerConnectionTitle),l(7),b("ngModel",e.formConnectionName())("placeholder",e.copy().connectionNamePlaceholder),l(6),b("ngModel",e.formDisplayName())("placeholder",e.copy().displayNamePlaceholder),l(4),b("ngModel",e.formAdapter()),l(11),h(e.formAdapter()==="mssql"?32:-1),l(),h(e.formAdapter()==="opensearch"?33:-1),l(),h(e.formAdapter()==="postgres"?34:-1),l(),h(e.formAdapter()==="snowflake"?35:-1),l(),h(e.formError()?36:-1),l(2),b("disabled",e.saving()),l(),y(e.copy().cancelButton),l(),b("disabled",e.saving()),l(),h(e.saving()?41:42)}}var Fe=class i{svc=N(me);copy(){return I().copy}loading=f(!0);connections=f([]);showForm=f(!1);saving=f(!1);formConnectionName=f("Primary");formDisplayName=f("");formAdapter=f("mssql");mssql=f({server:"",database:"",user:"",password:"",schema:"gold",port:1433});opensearch=f({url:"",username:"",password:""});postgres=f({host:"",port:5432,database:"",user:"",password:"",schema:"public"});snowflake=f({account:"",database:"",schema:"",user:"",password:"",warehouse:""});showPassword=f(!1);formError=f("");hasConnections=D(()=>this.connections().length>0);async ngOnInit(){await this.loadConnections()}async loadConnections(){this.loading.set(!0);try{let t=await this.svc.listConnections();this.connections.set(t)}catch{}finally{this.loading.set(!1)}}openForm(){this.showForm.set(!0),this.formError.set("")}closeForm(){this.showForm.set(!1),this.formError.set("")}patchMssql(t,e){this.mssql.update(n=>T(w({},n),{[t]:e}))}patchOpensearch(t,e){this.opensearch.update(n=>T(w({},n),{[t]:e}))}patchPostgres(t,e){this.postgres.update(n=>T(w({},n),{[t]:e}))}patchSnowflake(t,e){this.snowflake.update(n=>T(w({},n),{[t]:e}))}buildConfig(){switch(this.formAdapter()){case"mssql":return w({},this.mssql());case"opensearch":return w({},this.opensearch());case"postgres":return w({},this.postgres());case"snowflake":return w({},this.snowflake())}}async submitRegister(){let t=this.formConnectionName().trim();if(!t){this.formError.set("Connection name is required");return}let e={productId:this.svc.productId,displayName:this.formDisplayName().trim()||void 0,connectionName:t,config:this.buildConfig()};this.saving.set(!0),this.formError.set("");try{let n=await this.svc.register(e),o={id:n.connection.id,name:n.connection.name,adapterType:n.connection.adapterType,isActive:!0,hasSchemaSnapshot:n.test.reachable,hasSemanticDoc:!1,createdAt:n.connection.createdAt,updatedAt:n.connection.createdAt,testResult:n.test};this.connections.update(a=>[o,...a]),this.closeForm(),this.showToast("success",n.test.reachable?`Connection "${t}" registered and tested successfully`:`Connection "${t}" registered (connectivity test failed: ${n.test.error??"unreachable"})`)}catch(n){this.formError.set(this.extractMessage(n,"Registration failed"))}finally{this.saving.set(!1)}}async testConnection(t){this.connections.update(e=>e.map(n=>n.id===t?T(w({},n),{testing:!0,testResult:void 0}):n));try{let e=await this.svc.testConnection(t);this.connections.update(n=>n.map(o=>o.id===t?T(w({},o),{testing:!1,testResult:e}):o))}catch{this.connections.update(e=>e.map(n=>n.id===t?T(w({},n),{testing:!1}):n))}}async deleteConnection(t,e){if(confirm(`Delete connection "${e}"? This cannot be undone.`)){this.connections.update(n=>n.map(o=>o.id===t?T(w({},o),{deleting:!0}):o));try{await this.svc.deleteConnection(t),this.connections.update(n=>n.filter(o=>o.id!==t)),this.showToast("success",`Connection "${e}" deleted`)}catch{this.connections.update(n=>n.map(o=>o.id===t?T(w({},o),{deleting:!1}):o))}}}adapterLabel(t){return{mssql:"MSSQL",opensearch:"OpenSearch",postgres:"PostgreSQL",snowflake:"Snowflake"}[t]??t}showToast(t,e){let n=document.createElement("nile-toast");n.variant=t,n.title=e,n.duration=5e3,n.closable=!0,n.toast(),$e()}extractMessage(t,e){return We(t,e)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=we({type:i,selectors:[["app-ask-aquera-connections-page"]],decls:18,vars:5,consts:[[1,"wfconn-page"],[1,"wfconn-header"],[1,"wfconn-header__left"],["routerLink","/ask-aquera",1,"wfconn-back"],["name","ng-arrow-left","method","stroke","size","14","color","var(--ng-colors-text-secondary-700)"],[1,"wfconn-header__sep"],[1,"wfconn-header__title"],[1,"wfconn-btn","wfconn-btn--primary",3,"click"],["name","ng-plus","method","stroke","size","13","color","#fff"],[1,"wfconn-loading"],[1,"wfconn-empty"],[1,"wfconn-list"],[1,"wfconn-spinner"],[1,"wfconn-empty__icon"],["name","ng-dataflow-03","method","stroke","size","32","color","var(--ng-colors-text-placeholder)"],[1,"wfconn-empty__title"],[1,"wfconn-empty__sub"],[1,"wfconn-card",3,"wfconn-card--deleting"],[1,"wfconn-card"],[1,"wfconn-card__header"],[1,"wfconn-card__info"],[1,"wfconn-card__name"],[1,"wfconn-badge","wfconn-badge--adapter"],[1,"wfconn-badge","wfconn-badge--active"],[1,"wfconn-badge","wfconn-badge--inactive"],[1,"wfconn-badge","wfconn-badge--schema"],[1,"wfconn-card__actions"],["title","Test connectivity",1,"wfconn-icon-btn",3,"click","disabled"],[1,"wfconn-spinner","wfconn-spinner--sm"],["name","ng-activity","method","stroke","size","14"],["title","Delete connection",1,"wfconn-icon-btn","wfconn-icon-btn--danger",3,"click","disabled"],["name","ng-trash-01","method","stroke","size","14"],[1,"wfconn-card__meta"],[1,"wfconn-test-result",3,"wfconn-test-result--ok","wfconn-test-result--fail"],["name","ng-check","method","stroke","size","10"],[1,"wfconn-test-result"],["name","ng-check-circle","method","stroke","size","13"],[1,"wfconn-test-result__tables"],["name","ng-alert-circle","method","stroke","size","13"],[1,"wfconn-form-overlay",3,"click"],[1,"wfconn-form-panel"],[1,"wfconn-form-panel__header"],[1,"wfconn-form-panel__title"],[1,"wfconn-form-close",3,"click"],["name","ng-x","method","stroke","size","16"],[1,"wfconn-form-panel__body"],[1,"wfconn-field"],[1,"wfconn-label"],["type","text",1,"wfconn-input",3,"ngModelChange","ngModel","placeholder"],[1,"wfconn-label--opt"],[1,"wfconn-select",3,"ngModelChange","ngModel"],["value","mssql"],["value","opensearch"],["value","postgres"],["value","snowflake"],[1,"wfconn-divider"],[1,"wfconn-form-error"],[1,"wfconn-form-panel__footer"],[1,"wfconn-btn","wfconn-btn--secondary",3,"click","disabled"],[1,"wfconn-btn","wfconn-btn--primary",3,"click","disabled"],["type","text","placeholder","server.database.windows.net",1,"wfconn-input",3,"ngModelChange","ngModel"],["type","text","placeholder","my_database",1,"wfconn-input",3,"ngModelChange","ngModel"],[1,"wfconn-field-row"],["type","text","placeholder","sa",1,"wfconn-input",3,"ngModelChange","ngModel"],[1,"wfconn-input-wrap"],["placeholder","\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",1,"wfconn-input",3,"ngModelChange","type","ngModel"],["type","button",1,"wfconn-input-toggle",3,"click"],["method","stroke","size","14"],["type","text","placeholder","gold",1,"wfconn-input",3,"ngModelChange","ngModel"],[1,"wfconn-field","wfconn-field--sm"],["type","number","placeholder","1433",1,"wfconn-input",3,"ngModelChange","ngModel"],["type","text","placeholder","https://my-cluster.us-east-1.es.amazonaws.com",1,"wfconn-input",3,"ngModelChange","ngModel"],["type","text","placeholder","admin",1,"wfconn-input",3,"ngModelChange","ngModel"],["type","text","placeholder","localhost",1,"wfconn-input",3,"ngModelChange","ngModel"],["type","number","placeholder","5432",1,"wfconn-input",3,"ngModelChange","ngModel"],["type","text","placeholder","postgres",1,"wfconn-input",3,"ngModelChange","ngModel"],["type","text","placeholder","public",1,"wfconn-input",3,"ngModelChange","ngModel"],["type","text","placeholder","myorg-myaccount",1,"wfconn-input",3,"ngModelChange","ngModel"],["type","text","placeholder","MY_DB",1,"wfconn-input",3,"ngModelChange","ngModel"],["type","text","placeholder","PUBLIC",1,"wfconn-input",3,"ngModelChange","ngModel"],["type","text","placeholder","COMPUTE_WH",1,"wfconn-input",3,"ngModelChange","ngModel"],["type","text","placeholder","myuser",1,"wfconn-input",3,"ngModelChange","ngModel"],[1,"wfconn-spinner","wfconn-spinner--sm","wfconn-spinner--white"],["name","ng-activity","method","stroke","size","13","color","#fff"]],template:function(e,n){e&1&&(s(0,"section",0)(1,"header",1)(2,"div",2)(3,"a",3),C(4,"nile-glyph",4),s(5,"span"),c(6),d()(),s(7,"span",5),c(8,"/"),d(),s(9,"span",6),c(10),d()(),s(11,"button",7),u("click",function(){return n.openForm()}),C(12,"nile-glyph",8),c(13),d()(),m(14,vc,4,1,"div",9)(15,wc,10,3,"div",10)(16,Vc,3,0,"div",11),m(17,Uc,43,15),d()),e&2&&(l(6),y(n.copy().connectionsBreadcrumbHome),l(4),y(n.copy().connectionsTitle),l(3),q(" ",n.copy().registerConnectionButton," "),l(),h(n.loading()?14:!n.hasConnections()&&!n.showForm()?15:16),l(3),h(n.showForm()?17:-1))},dependencies:[Qe,Ye,Ke,Be,je,He,Ue,Ge,tn,Ut],styles:[".wfconn-page[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;background:var(--ng-colors-bg-secondary)}.wfconn-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:14px 24px;background:var(--ng-colors-bg-primary);border-bottom:1px solid var(--ng-colors-border-secondary);flex-shrink:0}.wfconn-header__left[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.wfconn-back[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;color:var(--ng-colors-text-secondary-700);font-size:13px;text-decoration:none;font-weight:500}.wfconn-back[_ngcontent-%COMP%]:hover{color:var(--ng-colors-text-primary-900)}.wfconn-header__sep[_ngcontent-%COMP%]{color:var(--ng-colors-text-placeholder-subtle);font-size:16px}.wfconn-header__title[_ngcontent-%COMP%]{font-size:14px;font-weight:600;color:var(--ng-colors-text-primary-900)}.wfconn-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;padding:8px 14px;border-radius:8px;font-size:13px;font-weight:500;border:none;cursor:pointer;transition:opacity .15s}.wfconn-btn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.wfconn-btn--primary[_ngcontent-%COMP%]{background:var(--ng-colors-border-brand);color:var(--ng-colors-text-white)}.wfconn-btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--ng-colors-bg-brand-solid-hover)}.wfconn-btn--secondary[_ngcontent-%COMP%]{background:var(--ng-colors-bg-primary);color:var(--ng-colors-text-secondary-700);border:1px solid var(--ng-colors-border-primary)}.wfconn-btn--secondary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--ng-colors-bg-secondary)}.wfconn-icon-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:5px;padding:6px 10px;border-radius:6px;font-size:12px;font-weight:500;border:1px solid var(--ng-colors-border-primary);background:var(--ng-colors-bg-primary);color:var(--ng-colors-text-secondary-700);cursor:pointer;transition:background .15s}.wfconn-icon-btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--ng-colors-bg-tertiary)}.wfconn-icon-btn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.wfconn-icon-btn--danger[_ngcontent-%COMP%]{color:var(--ng-colors-text-error-primary-hover)}.wfconn-icon-btn--danger[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--ng-colors-bg-error-primary);border-color:var(--ng-colors-border-error)}.wfconn-loading[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;padding:40px 24px;color:var(--ng-colors-text-quaternary-500);font-size:14px}.wfconn-empty[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;flex:1;gap:12px;padding:64px 24px;text-align:center}.wfconn-empty__icon[_ngcontent-%COMP%]{width:56px;height:56px;border-radius:12px;background:var(--ng-colors-bg-tertiary);display:flex;align-items:center;justify-content:center}.wfconn-empty__title[_ngcontent-%COMP%]{font-size:16px;font-weight:600;color:var(--ng-colors-text-primary-900);margin:0}.wfconn-empty__sub[_ngcontent-%COMP%]{font-size:14px;color:var(--ng-colors-text-quaternary-500);margin:0;max-width:380px}.wfconn-list[_ngcontent-%COMP%]{padding:20px 24px;display:flex;flex-direction:column;gap:12px;overflow-y:auto;flex:1}.wfconn-card[_ngcontent-%COMP%]{background:var(--ng-colors-bg-primary);border:1px solid var(--ng-colors-border-secondary);border-radius:10px;padding:16px 18px;transition:opacity .15s}.wfconn-card--deleting[_ngcontent-%COMP%]{opacity:.5;pointer-events:none}.wfconn-card__header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:12px}.wfconn-card__info[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.wfconn-card__name[_ngcontent-%COMP%]{font-size:14px;font-weight:600;color:var(--ng-colors-text-primary-900)}.wfconn-card__actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;flex-shrink:0}.wfconn-card__meta[_ngcontent-%COMP%]{margin-top:8px;font-size:12px;color:var(--ng-colors-text-placeholder)}.wfconn-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:4px;font-size:11px;font-weight:500}.wfconn-badge--adapter[_ngcontent-%COMP%]{background:var(--ng-colors-bg-tertiary);color:var(--ng-colors-text-secondary-700)}.wfconn-badge--active[_ngcontent-%COMP%]{background:var(--ng-colors-bg-success-primary);color:var(--ng-componentcolors-utility-success-700)}.wfconn-badge--inactive[_ngcontent-%COMP%]{background:var(--ng-colors-bg-error-primary);color:var(--ng-colors-text-error-primary-hover)}.wfconn-badge--schema[_ngcontent-%COMP%]{background:var(--ng-colors-bg-brand-primary);color:var(--ng-colors-text-brand-tertiary-600)}.wfconn-test-result[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;margin-top:10px;padding:8px 10px;border-radius:6px;font-size:12px;font-weight:500}.wfconn-test-result--ok[_ngcontent-%COMP%]{background:var(--ng-colors-bg-success-primary);color:var(--ng-componentcolors-utility-success-700)}.wfconn-test-result--fail[_ngcontent-%COMP%]{background:var(--ng-colors-bg-error-primary);color:var(--ng-colors-text-error-primary-hover)}.wfconn-test-result__tables[_ngcontent-%COMP%]{color:inherit;opacity:.7;font-weight:400;margin-left:4px}.wfconn-spinner[_ngcontent-%COMP%]{width:18px;height:18px;border:2px solid var(--ng-colors-border-secondary);border-top-color:var(--ng-colors-border-brand);border-radius:50%;animation:_ngcontent-%COMP%_wfconn-spin .7s linear infinite}.wfconn-spinner--sm[_ngcontent-%COMP%]{width:12px;height:12px;border-width:1.5px}.wfconn-spinner--white[_ngcontent-%COMP%]{border-color:#ffffff4d;border-top-color:var(--ng-colors-fg-white)}@keyframes _ngcontent-%COMP%_wfconn-spin{to{transform:rotate(360deg)}}.wfconn-form-overlay[_ngcontent-%COMP%]{position:fixed;inset:0;background:#00000040;z-index:200}.wfconn-form-panel[_ngcontent-%COMP%]{position:fixed;top:0;right:0;bottom:0;width:440px;max-width:95vw;background:var(--ng-colors-bg-primary);border-left:1px solid var(--ng-colors-border-secondary);display:flex;flex-direction:column;z-index:201;box-shadow:-4px 0 24px #00000014}.wfconn-form-panel__header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid var(--ng-colors-border-secondary);flex-shrink:0}.wfconn-form-panel__title[_ngcontent-%COMP%]{font-size:15px;font-weight:600;color:var(--ng-colors-text-primary-900)}.wfconn-form-close[_ngcontent-%COMP%]{background:none;border:none;cursor:pointer;color:var(--ng-colors-text-quaternary-500);padding:4px;border-radius:4px;display:flex}.wfconn-form-close[_ngcontent-%COMP%]:hover{background:var(--ng-colors-bg-tertiary);color:var(--ng-colors-text-secondary-700)}.wfconn-form-panel__body[_ngcontent-%COMP%]{flex:1;overflow-y:auto;padding:20px;display:flex;flex-direction:column;gap:14px}.wfconn-form-panel__footer[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;gap:10px;padding:14px 20px;border-top:1px solid var(--ng-colors-border-secondary);flex-shrink:0}.wfconn-divider[_ngcontent-%COMP%]{font-size:11px;font-weight:600;color:var(--ng-colors-text-placeholder);text-transform:uppercase;letter-spacing:.06em;padding:4px 0 2px;border-bottom:1px solid var(--ng-colors-border-tertiary)}.wfconn-field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:5px;flex:1}.wfconn-field--sm[_ngcontent-%COMP%]{max-width:100px}.wfconn-field-row[_ngcontent-%COMP%]{display:flex;gap:12px;align-items:flex-start}.wfconn-label[_ngcontent-%COMP%]{font-size:12px;font-weight:500;color:var(--ng-colors-text-secondary-700)}.wfconn-label--opt[_ngcontent-%COMP%]{font-weight:400;color:var(--ng-colors-text-placeholder)}.wfconn-input[_ngcontent-%COMP%], .wfconn-select[_ngcontent-%COMP%]{height:36px;padding:0 10px;border:1px solid var(--ng-colors-border-primary);border-radius:6px;font-size:13px;color:var(--ng-colors-text-primary-900);background:var(--ng-colors-bg-primary);width:100%;box-sizing:border-box;outline:none;transition:border-color .15s}.wfconn-input[_ngcontent-%COMP%]:focus, .wfconn-select[_ngcontent-%COMP%]:focus{border-color:var(--ng-colors-border-brand);box-shadow:0 0 0 3px var(--ng-colors-bg-brand-primary)}.wfconn-input[_ngcontent-%COMP%]::placeholder, .wfconn-select[_ngcontent-%COMP%]::placeholder{color:var(--ng-colors-text-placeholder)}.wfconn-select[_ngcontent-%COMP%]{cursor:pointer}.wfconn-input-wrap[_ngcontent-%COMP%]{position:relative;display:flex}.wfconn-input-wrap[_ngcontent-%COMP%] .wfconn-input[_ngcontent-%COMP%]{padding-right:36px}.wfconn-input-toggle[_ngcontent-%COMP%]{position:absolute;right:8px;top:50%;transform:translateY(-50%);background:none;border:none;cursor:pointer;color:var(--ng-colors-text-placeholder);padding:0;display:flex}.wfconn-input-toggle[_ngcontent-%COMP%]:hover{color:var(--ng-colors-text-secondary-700)}.wfconn-form-error[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;padding:8px 10px;background:var(--ng-colors-bg-error-primary);border-radius:6px;color:var(--ng-colors-text-error-primary-hover);font-size:12px}"]})};function jc(i,t){i&1&&C(0,"app-ask-aquera-connections-page")}function Hc(i,t){i&1&&C(0,"app-ask-aquera-page")}function Yc(i,t){if(i&1&&m(0,jc,1,0,"app-ask-aquera-connections-page")(1,Hc,1,0,"app-ask-aquera-page"),i&2){let e,n=r();h(((e=n.config())==null||e.initial==null?null:e.initial.view)==="connections"?0:1)}}var it=class i{config=lt(void 0);theme=lt(void 0);ready=Te({alias:"aq-ready"});error=Te({alias:"aq-error"});unauthorized=Te({alias:"aq-unauthorized"});host=N(Ie);stopAdopting=null;stopUi=null;themeChanged=Te({alias:"dvz-theme-changed"});themeStore=N(Wt);syncThemeInput=he(()=>{let t=this.theme();t&&this.themeStore.set(t)});lastAnnouncedTheme=null;announceTheme=he(()=>{let t=this.themeStore.resolved();if(t===this.lastAnnouncedTheme)return;let e=this.lastAnnouncedTheme===null;this.lastAnnouncedTheme=t,e||this.themeChanged.emit({theme:t,choice:this.themeStore.choice()})});tokenTimer=null;configured=!1;constructor(){he(()=>{let t=this.config();t&&this.apply(t)}),queueMicrotask(()=>{let t=this.host.nativeElement.shadowRoot;t&&(this.stopAdopting=qt(t))})}async apply(t){let e=t.auth;if(ln(t.api.baseUrl),Jt(t.api,e),ut({baseUrl:t.api.baseUrl,mcpUrl:t.api.mcpUrl,adminApiUrl:t.api.adminApiUrl,utilitiesUrl:t.api.utilitiesUrl,tokenizedOrigins:t.api.tokenizedOrigins,headers:t.api.headers,customerId:t.tenant.customerId??null,productId:t.tenant.productId,productName:t.tenant.productName??null,authMode:e.mode,authToken:e.mode==="token"?e.token:null,getToken:e.mode==="callback"?e.getToken:null,onUnauthorized:()=>this.unauthorized.emit(),features:t.features,ui:t.ui,copy:t.copy,routing:t.routing,initial:{dashboardId:t.initial?.dashboardId??null,conversationId:t.initial?.conversationId??null,summary:t.initial?.summary??!1},chatDefaults:{indexName:t.chatDefaults?.indexName??null,planningMode:t.chatDefaults?.planningMode??!0}}),this.stopUi?.(),this.stopUi=Dt(this.host.nativeElement,t.ui),this.themeStore.attach(this.host.nativeElement),this.theme()||this.themeStore.set(t.ui?.theme??"light"),sn({productId:t.tenant.productId,name:t.tenant.productName}),an(()=>this.unauthorized.emit()),await Ae(),(e.mode==="callback"||e.mode==="inherit")&&!this.tokenTimer&&(this.tokenTimer=setInterval(()=>{Ae()},6e4)),!this.configured){this.configured=!0;let n=I();this.ready.emit({customerId:n.customerId??"",productId:n.productId??""})}}ngOnDestroy(){this.stopAdopting?.(),this.stopUi?.(),this.tokenTimer&&clearInterval(this.tokenTimer)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=we({type:i,selectors:[["dvz-ask-root"]],inputs:{config:[1,"config"],theme:[1,"theme"]},outputs:{ready:"aq-ready",error:"aq-error",unauthorized:"aq-unauthorized",themeChanged:"dvz-theme-changed"},decls:1,vars:1,template:function(e,n){e&1&&m(0,Yc,2,1),e&2&&h(n.config()?0:-1)},dependencies:[Fe,De],styles:[`:host{display:block;height:100%}
22
+ `],encapsulation:3,changeDetection:0})};Kt();var Kc="dvz-ask";function Qc(i={}){return Yt(it,Kc,[Et(),nn([]),on(),jt(Ht([dn])),{provide:pn,useFactory:()=>I().baseUrl},{provide:Un,useValue:"workforce/dashboards"},ze(ye)],i)}Qc();export{Kc as a,Qc as b};