@aquera/data-visualizer-sdk 0.0.27 → 0.0.29
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.
- package/ask-aquera/src/ask-aquera-config.d.ts +57 -0
- package/{chunk-DYBPN3MJ.js → chunk-257G7TKK.js} +1 -1
- package/chunk-2VRDIQPN.js +11 -0
- package/{chunk-TCNUWNNB.js → chunk-CE7UGYQF.js} +1 -1
- package/{chunk-Y7A6GQNH.js → chunk-CIMDJY2O.js} +1 -1
- package/chunk-IXQAWW2G.js +21 -0
- package/{chunk-KTWHSGCC.js → chunk-L6S4UC3D.js} +177 -177
- package/{chunk-3W6SMXEN.js → chunk-QUALUM76.js} +1 -1
- package/main.js +1 -1
- package/package.json +1 -1
- package/chunk-ICUFCTKP.js +0 -11
- package/chunk-P6ZFS5BG.js +0 -21
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import{$ as _n,A as Zt,B as en,Ba as We,C as tn,Ca as Be,Da as Ue,E as nn,Ea as Ge,Fa as He,G as oe,Ga as je,H as on,Ha as Ye,Ia as Ke,J as ge,Ja as Tn,Ka as ct,La as qn,M as an,Ma as Fn,N as rn,Na as Dn,O as ln,Oa as On,Pa as En,Q as Re,S as sn,Sa as In,Ta as Vn,U as dn,Ua as Rn,V as cn,Va as zn,W as ze,Wa as ue,X as pn,Xa as Nn,Y as Ae,Z as st,_ as dt,a as Tt,aa as gn,ab as pt,b as qt,ba as un,c as $t,ca as mn,cb as Ln,da as hn,e as Wt,ea as Cn,fa as fn,g as Bt,ga as xn,gb as $n,ha as bn,hb as _t,ia as yn,ib as Wn,j as ie,k as _e,ka as vn,l as Ut,la as wn,m as Gt,ma as Ne,na as kn,o as Ht,oa as Pn,p as lt,pa as An,q as jt,qa as Mn,r as Yt,ra as Sn,t as Kt,ta as Le,w as ee,wa as $e,x as Qt,y as Jt,z as Xt}from"./chunk-L6S4UC3D.js";import{Ab as fe,Bb as k,Fb as u,Hb as r,Ka as it,Kb as It,La as Ie,Lb as xe,Ma as l,Mb as be,N as ne,Pb as le,Qb as Z,Rb as $,S as N,Sb as ot,Tb as p,Ub as b,Vb as T,Wb as K,X as _,Xb as Vt,Y as g,bb as ke,bc as Rt,cc as pe,dc as at,ea as Ft,ec as zt,gb as Pe,gc as Nt,ha as Dt,hc as Ve,ia as x,la as Ce,lb as Et,lc as Lt,mb as M,mc as F,nb as m,ob as h,p as E,pb as j,pc as Te,qa as Ot,qc as rt,rb as D,sb as O,tb as w,ub as s,vb as d,wb as C}from"./chunk-3CHM3VJC.js";import{a as v,b as S,d as Ee}from"./chunk-ZW5NV4UO.js";function Di(){return{filters:!0,undoRedo:!0,widgetSelection:!0,publishAsDashboard:!0,addToDashboard:!0}}function Oi(){return{enabled:!0,dataset:!0,pipeline:!0}}function Ei(){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 Bn(){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,welcomePrompts:!0,dashboardsMenu:!0,executiveSummary:!0,alerts:!0,library:!0,tools:!0,chat:!0,widgetMenu:Ei(),scopePicker:Oi(),canvas:Di()},ui:{theme:"light",density:"comfortable",header:!0,locale:"en"},copy:Ii(),routing:"none",initial:{dashboardId:null,conversationId:null}}}function Ii(){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",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 Un=Yt("dvz-ask",Bn);function I(){return Un.read()}function gt(i){let t=Bn(),e=S(v(v({},t),se(i)),{features:S(v(v({},t.features),se(i.features??{})),{widgetMenu:v(v({},t.features.widgetMenu),se(i.features?.widgetMenu??{})),scopePicker:v(v({},t.features.scopePicker),se(i.features?.scopePicker??{})),canvas:v(v({},t.features.canvas),se(i.features?.canvas??{}))}),ui:v(v({},t.ui),se(i.ui??{})),copy:S(v(v({},t.copy),se(i.copy??{})),{errors:v(v({},t.copy.errors),se(i.copy?.errors??{}))}),initial:v(v({},t.initial),se(i.initial??{})),headers:v(v({},t.headers),i.headers??{})});return i.tokenizedOrigins||(e.tokenizedOrigins=[e.baseUrl,e.adminApiUrl,e.mcpUrl,e.utilitiesUrl,e.proxyUrl].filter(n=>!!n)),Un.write(e)}async function de(){return Kt(I())}function Gn(i,t){return i.replace("{n}",String(t))}function se(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(oe);get customerId(){return I().customerId??this.tokenStore.tenantId()??""}async fetchGridPage(t,e,n,o,a,c,f,y){let A=`${I().baseUrl}/api/customers/${this.customerId}/products/${ge()}/workforce/data-grid/${t}?pageIndex=${e}&pageSize=${n}`,q=(o??[]).filter(P=>P&&P.value!=null&&String(P.value).trim()!=="");return q.length&&(A+=`&filters=${encodeURIComponent(JSON.stringify(q))}`),a&&Object.keys(a).length&&(A+=`&dashboardFilters=${encodeURIComponent(JSON.stringify(a))}`),f&&f.length&&(A+=`&resolvedFilters=${encodeURIComponent(JSON.stringify(f))}`),c&&(A+=`&dashboardId=${encodeURIComponent(c)}`),y&&(A+=`&conversationId=${encodeURIComponent(y)}`),E(this.http.get(A))}static \u0275fac=function(e){return new(e||i)};static \u0275prov=ne({token:i,factory:i.\u0275fac,providedIn:"root"})};var ut=["image/png","image/jpeg","image/webp","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-excel"],Hn=10*1024*1024,mt=1,ht=10,Vi=["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-excel"];function Ct(i,t){return Vi.includes(t)||/\.(xls|xlsx)$/i.test(i)}var me=class i{http=N(_e);tokenStore=N(oe);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,c=v({},n);o!==this.lastSentCustomerId&&(c.customerId=o),a!==this.lastSentProductId&&(c.productId=a);let f;try{f=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:c})),this.lastSentCustomerId=o,this.lastSentProductId=a}catch(A){throw A instanceof ie?new Error(A.error?.error?.message||A.error?.message||A.message):A}if(f.error)throw new Error(f.error.message);let y=f.result;if(y?.isError)throw new Error(y.structuredContent?.error?.message??y.content?.[0]?.text??`${t} failed`);return y?.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 f=await E(this.http.get(`${this.baseUrl}/conversations/${t}`));if(!f?.data)return null;let a=f.data,{messages:y}=a;return{conversation:Ee(a,["messages"]),messages:y??[]}}let e=await this.callMcpTool("getConversation",{conversationId:t});if(!e?.conversation)return null;let c=e.conversation,{messages:n}=c;return{conversation:Ee(c,["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,c,f,y){return c?.length||!I().features.mcpGateway?this.streamChatViaSse(t,e,n,o,a,c,f,y):this.sendChatViaGateway(t,e,n,o,a)}async sendChatViaGateway(t,e,n,o,a){let c={message:e};t&&(c.conversationId=t),o&&(c.connectionId=o);let f=Date.now(),y=new URL(this.mcpGatewayUrl());y.searchParams.set("customerId",this.customerId),y.searchParams.set("productId",this.productId);let A=await de()??this.tokenStore.accessToken()??"",q=!1,P=!1,z=R=>{switch(q=!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}},X=R=>{if(R?.isError){let W=R.structuredContent?.error?.message??R.content?.[0]?.text??"askAquera failed";n.onError(W),n.onFinish("error",t??""),P=!0;return}let V=R?.structuredContent??{};if(!q){n.onText(V.responseText??V.text??""),V.dashboardTitle&&n.onDashboardTitle?.(V.dashboardTitle);let W=V.widget?[V.widget]:V.widgets??[];for(let G of W)n.onDataPart({type:"data",data_type:"adhoc_viz",version:1,data:G})}n.onFinish("stop",V.conversationId??t??""),P=!0},Q=R=>{if(R.method==="notifications/gateway/stream"){z(R.params??{});return}if(R.id===f){if(R.error){n.onError(R.error.message??"askAquera failed"),n.onFinish("error",t??""),P=!0;return}X(R.result)}},U;try{U=await fetch(y.toString(),{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json, text/event-stream",Authorization:`Bearer ${A}`},body:JSON.stringify({jsonrpc:"2.0",id:f,method:"tools/call",params:{name:"askAquera",arguments:c}}),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(!U.ok){let R=await U.text().catch(()=>U.statusText);n.onError(`Request failed (${U.status}): ${R}`),n.onFinish("error",t??"");return}if(!(U.headers.get("content-type")??"").includes("text/event-stream")||!U.body){let R=await U.json().catch(()=>null);if(!R){n.onError("Invalid response from server"),n.onFinish("error",t??"");return}Q(R);return}let he=U.body.getReader(),L=new TextDecoder,J="";for(;;){let{done:R,value:V}=await he.read();if(R)break;J+=L.decode(V,{stream:!0});let W=J.split(`
|
|
2
|
+
|
|
3
|
+
`);J=W.pop()??"";for(let G of W){let H=G.split(`
|
|
4
|
+
`).find(B=>B.startsWith("data:"));if(H){try{Q(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,c,f,y){let A=await de()??this.tokenStore.accessToken()??"",q=`${this.baseUrl}/v1/conversations/chat`,P={message:e};t&&(P.conversationId=t),o&&(P.connectionId=o),c?.length&&(P.attachments=c),f&&(P.isPipeline=!0),y&&(P.dashboardId=y);let z=await fetch(q,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${A}`},body:JSON.stringify(P),signal:a});if(!z.ok){let Y=await z.text().catch(()=>z.statusText);n.onError(`Request failed (${z.status}): ${Y}`);return}if(!z.body){n.onError("No response body received");return}let X=z.body.getReader(),Q=new TextDecoder,U="";for(;;){let{done:Y,value:he}=await X.read();if(Y)break;U+=Q.decode(he,{stream:!0});let L=U.split(`
|
|
5
|
+
`);U=L.pop()??"";for(let J of L){let R=J.trim();R&&this.parseLine(R,n)}}U.trim()&&this.parseLine(U.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 ie?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 ie?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 ie?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 ie?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 ie?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 ie?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(y=>!!y.id).map(y=>({widgetId:y.id})),c;try{c=await E(this.http.post(`${this.baseUrl}/dashboards/${t}/filter/suggest?status=${o}`,{query:e,refreshCache:!1,widgets:a}))}catch(y){throw y instanceof ie?new Error(y.error?.error||y.message):y}if(c?.success===!1)throw new Error(c.error||"Request failed");let f=c?.data??{completions:[],suggestions:[]};return{nextToken:f.nextToken,completions:Array.isArray(f.completions)?f.completions:[],suggestions:Array.isArray(f.suggestions)?f.suggestions:[]}}async applyFilters(t,e,n,o="draft",a,c){let f=await new Promise((X,Q)=>{let U=this.http.post(`${this.baseUrl}/dashboards/${n}/filter/apply?status=${o}`,Vn(t,e,c)).subscribe({next:Y=>X(Y),error:Y=>{Q(Y instanceof ie?new Error(Y.error?.error||Y.message):Y)}});if(a){if(a.aborted){U.unsubscribe();let Y=new Error("Aborted");Y.name="AbortError",Q(Y);return}a.addEventListener("abort",()=>{U.unsubscribe();let Y=new Error("Aborted");Y.name="AbortError",Q(Y)},{once:!0})}});if(f?.success===!1)throw new Error(f.error||"Request failed");let y=f?.data??f,A=Array.isArray(y)?y:y?.widgets;if(!Array.isArray(A))throw new Error("Invalid response from apply-filters API");let q=!Array.isArray(y)&&Array.isArray(y?.resolvedFilters)?y.resolvedFilters:[],P=!Array.isArray(y)&&typeof y?.filterExplanation=="string"?y.filterExplanation:typeof f?.filterExplanation=="string"?f.filterExplanation:null,z=P&&P.trim()?P.trim():null;return{widgets:A,resolvedFilters:q,filterExplanation:z}}async uploadAttachment(t,e){let n=await de()??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 y=await a.text().catch(()=>a.statusText);throw new Error(`Upload failed (${a.status}): ${y}`)}let c=await a.json().catch(()=>null),f=c?.data?.key??c?.key;if(!f)throw new Error("Upload failed: malformed response");return{key:f}}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 de()??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(q){e.onError(q instanceof Error?q.message:"Network error");return}if(!a.ok){let q=await a.json().catch(()=>null);e.onError(q?.error??`Request failed (${a.status})`);return}if(!a.body){e.onError("No response body received");return}let c=a.body.getReader(),f=new TextDecoder,y="",A=q=>{let P=q.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:q,value:P}=await c.read();if(q)break;y+=f.decode(P,{stream:!0});let z=y.split(`
|
|
6
|
+
`);y=z.pop()??"";for(let X of z)A(X)}y.trim()&&A(y)}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",v(v({},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 c=a;e.onToolStart(c.toolCallId,c.uiLabel??c.toolName??"");break}case"a":{let c=a;e.onToolResult(c.toolCallId,c.result?.uiDetail??"",c.result?.error??!1);break}case"2":{let c=a;c.data_type==="adhoc_viz"?e.onDataPart(c):c.data_type==="dashboard_title"?e.onDashboardTitle?.(c.data?.title??""):c.data_type==="choice"?e.onChoice?.(c.data):c.data_type==="layout_patch"&&e.onLayoutPatch?.(c.data);break}case"3":e.onError(a.error??"Unknown error");break;case"d":{let c=a;e.onFinish(c.finishReason??"stop",c.conversationId??"");break}}}static \u0275fac=function(e){return new(e||i)};static \u0275prov=ne({token:i,factory:i.\u0275fac,providedIn:"root"})};function jn({hasMessages:i,artifactOpen:t,builderOpen:e}){return t?"split":e?"builder":i?"conversation":"idle"}function Yn(i,t){return i==="chat"?t.chat:i==="library"?t.library:i==="tools"?t.tools:!0}function Kn(i){return[i.chat,i.library,i.tools].filter(Boolean).length>1}var Me=class i{http=N(_e);tokenStore=N(oe);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=ne({token:i,factory:i.\u0275fac,providedIn:"root"})};function Jn(i,t,e){return{chart:v({type:"kpi",variant:"card",value:t},e?{description:e}:{}),aq:{chartTitle:i,ai:{enabled:!1}}}}function Qn(i,t,e,n){return{title:t,componentName:i,widgetType:"chart",config:e,layout:n}}function Xn(i){let t=i.kpis.map((f,y)=>Qn("nile-kpi-chart",f.label,Jn(f.label,f.value),{x:y*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=f=>i.systemRows.some(y=>y[f]>0),a=[{accessorKey:"system",header:"System"},{accessorKey:"events",header:"Events"},...o("errors")?[{accessorKey:"errors",header:"Errors"}]:[],...o("orphans")?[{accessorKey:"orphans",header:"Orphans"}]:[]],c=Qn("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,c]}var Ri={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 Zn(i,t=1){return{title:i.cohortTitle,componentName:"nile-kpi-chart",config:{title:i.cohortTitle,componentName:"nile-kpi-chart",widgetType:"chart",category:"cohort",config:S(v({},Jn(i.cohortTitle,i.matchCount,`${t} ${t===1?"criterion":"criteria"} \xB7 live membership`)),{_meta:{cohortId:i.criterionId,detailPanel:{title:i.cohortTitle,cohortId:i.criterionId,widgets:Xn(Ri)}}}),layout:{x:0,y:0,w:3,h:3}}}}function Qe(i,t){return{title:i.cohortTitle,widgets:Xn(t),skipped:[]}}var zi="__evidence-curated";function Ni(i,t){return`${i}${zi}-${t}`}function Li(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 $i=2;function Wi(i){if(!i||typeof i!="object")return;let t=i;if(![t.x,t.y,t.w,t.h].every(f=>typeof f=="number"&&Number.isFinite(f)))return;let{x:n,y:o,w:a,h:c}=t;if(!(a<=0||c<=0))return{x:n,y:o,w:a,h:Math.max($i,Math.ceil(c))}}function Bi(i,t){return i==="kpi"?"nile-kpi-chart":i==="grid"?"nile-data-grid":typeof t=="string"&&t?t:void 0}function ft(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,c=a.config??a??{},f=c.chart??{},y=S(v({},c),{chart:f,aq:c.aq??{}}),A={id:Ni(t,n.length),title:typeof a.title=="string"?a.title:"",widgetType:a.widgetType==="kpi"?"kpi":"chart",config:y,drilldownBy:Array.isArray(a.drilldownBy)?a.drilldownBy:[],category:a.category??null},q=Bi(f.type,a.componentName);q&&(A.componentName=q);let P=Wi(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=Li(t);if(!e)return[];if(e.cohortId){let[n,o]=await Promise.all([this.cohort.previewCriterion(e.cohortId),this.cohort.getDetail(e.cohortId)]);return ft(Qe(n,o),t.id)}return e.detailPanel?e.detailPanel.widgets?.length?ft(await this.svc.previewWidgetDetailPanelDefinition(e.detailPanel),t.id):[]:e.templateId?ft(await this.svc.previewWidgetTemplateDetailPanel(e.templateId),t.id):[]}static \u0275fac=function(e){return new(e||i)};static \u0275prov=ne({token:i,factory:i.\u0275fac,providedIn:"root"})};function xt(i){return!!i&&i.matchCount>0&&!i.sampleMatches?.length}function ei(i){return!i||xt(i)?!1:i.matchCount>Math.min(i.sampleMatches?.length??0,3)}function ti(i,t,e){return e&&t?t:i?.sampleMatches?.slice(0,3)??[]}function ni(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 ii(i,t,e){let n=e||"Working",o=i.map(c=>c.id==="thinking"&&c.status==="running"?S(v({},c),{status:"done"}):c),a=o.findIndex(c=>c.status==="running"&&c.baseLabel===n);if(a>=0){let c=o[a],f=[...o];return f[a]=S(v({},c),{callIds:[...c.callIds,t],pending:c.pending+1}),f}return[...o,{id:t,callIds:[t],pending:1,baseLabel:n,label:n,status:"running"}]}function oi(i,t,e,n){return i.map(o=>{if(!o.callIds.includes(t))return o;let a=Math.max(0,o.pending-1);return S(v({},o),{pending:a,detail:n?o.detail:e||o.detail,status:a===0?"done":o.status})})}function yt(i){let{finishReason:t,sawError:e,producedContent:n}=i;return t==="error"?!0:t==null?e:e&&!n}var ai=i=>S(v({},i),{isStreaming:!1,thinking:void 0,hasError:!0});function ri(i,t,e){return i.some(n=>n.id===t)?i.map(n=>n.id===t?ai(n):n):[...i,ai(e(t))]}var Xe=class i{http=N(_e);tokenStore=N(oe);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=ne({token:i,factory:i.\u0275fac,providedIn:"root"})};var Gi=[/\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],Hi=[/\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}},Yi=[[/\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 vt(i,t,e=new Date){let n=(i??"").trim();if(!n)return null;let o=Hi.some(f=>f.test(n)),a=Ki(n,Gi);if(!a&&!o)return null;let c=Qi(n);return{extendsExisting:o,metric:Ji(n,t),horizon:Xi(n,c??t.defaults.granularity,e),granularity:c,trigger:a||"refers to an existing chart"}}function Ki(i,t){for(let e of t){let n=e.exec(i);if(n)return n[0]}return""}function Qi(i){for(let[t,e]of Yi)if(t.test(i))return e}function Ji(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 Xi(i,t,e){let n=ji[t],o=/\bnext\s+(\d+)\s+(weeks?|months?|quarters?|years?)\b/i.exec(i);if(o){let f=Number(o[1]),y=o[2].toLowerCase().replace(/s$/,"");return Math.max(1,Math.round(f*n[y]))}let a=/\bnext\s+(week|month|quarter|year)\b/i.exec(i);if(a){let f=a[1].toLowerCase();return Math.max(1,n[f])}if(/\b(?:by|through)\s+(?:year[-\s]?end|end\s+of\s+(?:the\s+)?year|EOY)\b/i.test(i))return Zi(t,e);let c=/\bby\s+Q([1-4])\b/i.exec(i);if(c)return eo(t,Number(c[1]),e)}function Zi(i,t){let e=12-(t.getMonth()+1);return Math.max(1,li(e,i))}function eo(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,li(a,i))}function li(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 to=new Set(["line","area","spline","areaspline"]),wt="(?:jan|feb|mar|apr|may|jun|jul|aug|sep|sept|oct|nov|dec)[a-z]*",ae="(?:19|20)\\d{2}",si="(?:0?[1-9]|[12]\\d|3[01])",kt="(?:0?[1-9]|1[0-2])",no=[new RegExp(`^${ae}[-/.]${kt}(?:[-/.]${si})?$`,"i"),new RegExp(`^${si}[-/.]${kt}[-/.]${ae}$`,"i"),new RegExp(`^${kt}[-/.]${ae}$`,"i"),new RegExp(`^${ae}-?w\\d{1,2}$`,"i"),new RegExp(`^w(?:ee)?k\\s*\\d{1,2}[,\\s]+${ae}$`,"i"),new RegExp(`^${wt}[\\s-]*'?\\d{2}$`,"i"),new RegExp(`^${wt}[\\s-]*${ae}$`,"i"),new RegExp(`^${ae}[\\s-]*${wt}$`,"i"),new RegExp(`^q[1-4][\\s-]*${ae}$`,"i"),new RegExp(`^${ae}[\\s-]*q[1-4]$`,"i"),new RegExp("^fy\\s*'?\\d{2,4}$","i"),new RegExp(`^${ae}$`)];function io(i){let t=(i??[]).map(n=>String(n??"").trim()).filter(Boolean);return t.length<3?!1:t.filter(n=>no.some(o=>o.test(n))).length/t.length>=.8}var oo=[/forecast/i,/confidence/i,/project/i,/upper|lower/i,/band/i,/target/i],ci=3;function Ze(i){return i?.config?.chart??i?.chart??{}}function pi(i){let t=Ze(i);return t?.enableForecasting===!0?!0:(Array.isArray(t?.data)?t.data:[]).some(n=>Array.isArray(n?.projected)&&n.projected.length>0)}function et(i){let t=Ze(i),e=String(t?.type??"").toLowerCase();if(!to.has(e))return!1;let n=ao(i);if(!n||n.values.length<ci)return!1;let o=mi(t);return o.length?io(o):!!n.times?.length}function ao(i){let t=Ze(i),e=ui(t);if(!e.length)return null;let n=e.find(o=>!hi(o.name))??e[0];return gi(t,n)}function _i(i){let t=Ze(i),e=ui(t).filter(o=>!hi(o.name)),n=[];return e.forEach((o,a)=>{let c=gi(t,o);c&&n.push(S(v({},c),{name:o.name||(e.length>1?`Series ${a+1}`:"")}))}),n}function gi(i,t){let e=lo(t.data),n=e.map(c=>c.value);if(n.length<ci)return null;let o=e.every(c=>c.time!==void 0)?e.map(c=>c.time):void 0,a=mi(i).slice(0,n.length);return v({labels:a.length===n.length?a:o?o.map(c=>ro(c)):n.map((c,f)=>String(f+1)),values:n},o?{times:o}:{})}function ro(i){return new Date(i).toLocaleDateString("en-US",{month:"short",year:"numeric"})}function ui(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 mi(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 hi(i){return oo.some(t=>t.test(i))}function lo(i){let t=[];for(let e of i){let n=so(e);if(n===null)break;t.push(n)}return t}function so(i){if(typeof i=="number"&&Number.isFinite(i))return{value:i};if(Array.isArray(i)&&i.length===2&&typeof i[1]=="number")return v({value:i[1]},typeof i[0]=="number"?{time:i[0]}:{});if(i&&typeof i=="object"&&typeof i.y=="number"){let t=i;return v({value:t.y},typeof t.x=="number"?{time:t.x}:{})}return null}var At={Weekly:{Weekly:1,Monthly:4,Quarterly:13,Yearly:52},Monthly:{Monthly:1,Quarterly:3,Yearly:12},Quarterly:{Quarterly:1,Yearly:4},Yearly:{Yearly:1}},Pt={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"}},di=4;function co(i,t,e){let n=At[t]?.[e];return n?Math.max(1,Math.floor(i/n)):null}function Ci(i,t,e){return e.map(n=>{let o=Pt[n]??Pt.Monthly,a=co(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 ${Pt[i]?.adjective??i.toLowerCase()}`}:a<di?{value:n,enabled:!1,fittedPeriods:a,maxHorizon:0,label:o,reason:`only ${a} ${a===1?o.singular:o.plural} of history, needs at least ${di}`}:{value:n,enabled:!0,fittedPeriods:a,maxHorizon:Math.max(1,Math.floor(a/2)),label:o}})}function fi(i,t,e,n){if(t===e)return Math.max(1,Math.min(i,n));let o=At[t]?.[e],a=At[e]?.[t],c=o?i/o:a?i*a:i;return Math.max(1,Math.min(Math.round(c),n))}var po="#2970FF",xi="#7A5AF8";var bi={Weekly:6048e5,Monthly:26298e5,Quarterly:78894e5,Yearly:315576e5},yi={Weekly:"Week",Monthly:"Month",Quarterly:"Quarter",Yearly:"Year"};function _o(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 vi(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 wi(i,t){let e=bi[i.granularity]??bi.Monthly,n=_o(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)),c=t.length>0,f=[...n.map(P=>vi(P,i.granularity)),...c?a.map(P=>vi(P,i.granularity)):[]],y=(i.series?.length??0)>1,A=y?i.series.map(P=>v({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])}:{})):[v({name:"Actuals",color:po,actual:i.history.values},c?{projected:t.map(P=>P.value),interval:t.map(P=>[P.low,P.high])}:{})],q={type:"line",enableForecasting:!0,categories:f,data:A,lineWidth:2,showMarkers:!1,valueSuffix:i.valueSuffix??"",xAxisTitle:yi[i.granularity]??yi.Monthly,projection:S(v({start:null},y?{}:{color:xi}),{dashStyle:"Dash",showNowLine:!0,nowLabel:"",bandLabel:"Projected",interval:S(v({name:`${i.confidence}% confidence`},y?{}:{color:xi}),{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:q},queryMeta:{sql:`-- forecast:${i.metric}`}}}function Mt(i,t=[]){let e=i.guardrails?.passed?i.points??[]:[],n=e[e.length-1],o=v({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.",c=go(i,t),f=i.skipped??[],y=(i.meta??[]).map(A=>({label:A.label,value:qe(A.value,o)}));return f.length&&c.length>1&&y.push({label:"Series",value:`${c.length-f.length} of ${c.length} forecast \u2014 ${f.map(A=>A.name).join(", ")} left as history`}),{chart:uo(i,e,c),answer:a,meta:y,points:e,horizon:i.horizon,granularity:i.granularity,confidence:i.confidence,maxHorizon:i.maxHorizon}}function go(i,t){let e=i.forecasts??[];if(e.length<2&&!(i.skipped?.length&&e.length))return[];let n=c=>String(c??"").toLowerCase().replace(/[^a-z0-9]/g,""),o=new Map(t.map(c=>[n(c.name??""),c])),a=e.map(c=>({name:c.name,values:c.history?.values??o.get(n(c.name))?.values??[],points:i.guardrails?.passed?c.points??[]:[]}));for(let c of i.skipped??[]){let f=o.get(n(c.name));f?.values?.length&&a.push({name:c.name,values:f.values,note:"not forecast"})}return a}function uo(i,t,e=[]){return wi(e.length?S(v({},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 St(i){if(i.forecast||i.isStreaming||i.charts?.length!==1)return!1;let t=i.charts[0]?.config;return pi(t)?!1:et(t)}var ho=["aqChat"],Co=["artifactGrid"],fo=["composerEl"],xo=["aiExecutiveSummary"],bo=()=>[1,2,3,4],Se=()=>[],Ai=i=>({$implicit:i}),te=(i,t)=>t.id,re=(i,t)=>t.key,yo=(i,t)=>t.templateId,vo=(i,t)=>t.identityKey,Mi=(i,t)=>t.label,Si=(i,t)=>t.component,wo=(i,t)=>t.name,tt=(i,t)=>t.value,ko=(i,t)=>t.action;function Po(i,t){if(i&1){let e=k();s(0,"button",31),u("click",function(){_(e);let o=r();return g(o.addReplyQuote())}),C(1,"nile-glyph",32),p(2),d()}if(i&2){let e=t,n=r();Z("top",e.top,"px")("left",e.left,"px"),$("reply-badge--below",!e.above),l(2),T(" ",n.copy().replyButton," ")}}function Ao(i,t){if(i&1&&(s(0,"nile-nav-tab",49),p(1),d()),i&2){let e=r(3);l(),b(e.copy().chatTabLabel)}}function Mo(i,t){if(i&1&&(s(0,"nile-nav-tab",50),p(1),d()),i&2){let e=r(3);l(),b(e.copy().libraryTabLabel)}}function So(i,t){if(i&1&&(s(0,"nile-nav-tab",51),p(1),d()),i&2){let e=r(3);l(),b(e.copy().toolsTabLabel)}}function To(i,t){if(i&1){let e=k();s(0,"nile-nav-tab-group",48),u("nile-tab-change",function(o){_(e);let a=r(2);return g(a.setChatPaneTab(o.detail.value))}),m(1,Ao,2,1,"nile-nav-tab",49),m(2,Mo,2,1,"nile-nav-tab",50),m(3,So,2,1,"nile-nav-tab",51),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 qo(i,t){if(i&1){let e=k();s(0,"span",36),C(1,"nile-glyph",52),s(2,"span",53),p(3),d(),s(4,"button",54),u("click",function(){_(e);let o=r(2);return g(o.clearScope())}),C(5,"nile-glyph",55),d()()}if(i&2){let e=t;l(),w("name",e.kind==="dataset"?"ng-database":"ng-dataflow-04"),l(2),K("",e.kind==="dataset"?"Dataset":"Pipeline",": ",e.name)}}function Fo(i,t){i&1&&(s(0,"div",65),C(1,"nile-skeleton-loader",66)(2,"nile-skeleton-loader",67),d())}function Do(i,t){i&1&&C(0,"nile-glyph",71)}function Oo(i,t){if(i&1){let e=k();s(0,"nile-menu-item",69),u("click",function(){let o=_(e).$implicit,a=r(5);return g(a.selectScope("dataset",o))}),s(1,"span",70),p(2),d(),m(3,Do,1,0,"nile-glyph",71),d()}if(i&2){let e,n=t.$implicit,o=r(5);l(2),b(n.name),l(),h(((e=o.selectedScope())==null?null:e.id)===n.id?3:-1)}}function Eo(i,t){if(i&1&&(s(0,"div",68),p(1),d()),i&2){let e=r(5);l(),b(e.copy().noDatasetsFound)}}function Io(i,t){if(i&1&&D(0,Oo,4,2,"nile-menu-item",null,te,!1,Eo,2,1,"div",68),i&2){let e=r(4);O(e.datasets())}}function Vo(i,t){if(i&1&&(s(0,"nile-menu-item")(1,"nile-dropdown",60)(2,"span",61),C(3,"nile-glyph",62),s(4,"span",63),p(5,"Dataset"),d(),C(6,"nile-glyph",64),d(),s(7,"nile-menu"),m(8,Fo,3,0,"div",65)(9,Io,3,1),d()()()),i&2){let e=r(3);l(8),h(e.scopeLoading()?8:9)}}function Ro(i,t){i&1&&(s(0,"div",65),C(1,"nile-skeleton-loader",66)(2,"nile-skeleton-loader",67),d())}function zo(i,t){i&1&&C(0,"nile-glyph",71)}function No(i,t){if(i&1){let e=k();s(0,"nile-menu-item",69),u("click",function(){let o=_(e).$implicit,a=r(5);return g(a.selectScope("pipeline",o))}),s(1,"span",70),p(2),d(),m(3,zo,1,0,"nile-glyph",71),d()}if(i&2){let e,n=t.$implicit,o=r(5);l(2),b(n.name),l(),h(((e=o.selectedScope())==null?null:e.id)===n.id?3:-1)}}function Lo(i,t){if(i&1&&(s(0,"div",68),p(1),d()),i&2){let e=r(5);l(),b(e.copy().noPipelinesFound)}}function $o(i,t){if(i&1&&D(0,No,4,2,"nile-menu-item",null,te,!1,Lo,2,1,"div",68),i&2){let e=r(4);O(e.pipelines())}}function Wo(i,t){if(i&1&&(s(0,"nile-menu-item")(1,"nile-dropdown",60)(2,"span",61),C(3,"nile-glyph",72),s(4,"span",63),p(5,"Pipeline"),d(),C(6,"nile-glyph",64),d(),s(7,"nile-menu"),m(8,Ro,3,0,"div",65)(9,$o,3,1),d()()()),i&2){let e=r(3);l(8),h(e.scopeLoading()?8:9)}}function Bo(i,t){if(i&1){let e=k();s(0,"nile-dropdown",56),u("nile-hide",function(){_(e);let o=r(2);return g(o.closeScopeMenu())}),s(1,"nile-lite-tooltip",57)(2,"button",58),u("click",function(){_(e);let o=r(2);return g(o.openScopeMenu())}),C(3,"nile-glyph",59),d()(),s(4,"nile-menu"),m(5,Vo,10,1,"nile-menu-item"),m(6,Wo,10,1,"nile-menu-item"),d()()}if(i&2){let e=r(2);w("open",e.showScopePicker()),l(5),h(e.features().scopePicker.dataset?5:-1),l(),h(e.features().scopePicker.pipeline?6:-1)}}function Uo(i,t){if(i&1&&(s(0,"nile-menu-item",73)(1,"div",74),C(2,"nile-skeleton-loader",75),s(3,"div",76),C(4,"nile-skeleton-loader",77)(5,"nile-skeleton-loader",78),d()()()),i&2){let e=t.$implicit;l(3),Z("max-width",e,"px")}}function Go(i,t){if(i&1&&D(0,Uo,6,2,"nile-menu-item",73,j),i&2){let e=r(2);O(e.menuSkeletonRows)}}function Ho(i,t){if(i&1&&(s(0,"div",45),p(1),d()),i&2){let e=r(2);l(),b(e.copy().noResultsMatchFilters)}}function jo(i,t){if(i&1){let e=k();s(0,"input",87),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,c=r(4);return g(c.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,c=r(4);return g(c.commitRenameConversation(o,a))}),d()}if(i&2){let e=r(5);w("ngModel",e.renameDraft())}}function Yo(i,t){if(i&1&&(s(0,"span",88),p(1),d(),s(2,"span",89),p(3),d()),i&2){let e=r().$implicit,n=r(4);w("title",e.title||"Untitled"),l(),b(e.title||"Untitled"),l(2),b(n.conversationMeta(e))}}function Ko(i,t){if(i&1){let e=k();s(0,"nile-menu-item",69),u("click",function(){let o=_(e).$implicit,a=r(4);return g(a.selectConversation(o.id))}),s(1,"div",74),C(2,"nile-glyph",80),s(3,"div",76),m(4,jo,1,1,"input",81)(5,Yo,4,3),d(),s(6,"div",82)(7,"button",83),u("click",function(o){let a=_(e).$implicit,c=r(4);return g(c.startRename(o,a.id,a.title))}),C(8,"nile-glyph",84),d(),s(9,"button",85),u("click",function(o){let a=_(e).$implicit,c=r(4);return g(c.deleteConversation(o,a.id))}),C(10,"nile-glyph",86),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 Qo(i,t){if(i&1&&(s(0,"div",79),p(1),d(),D(2,Ko,11,4,"nile-menu-item",null,te)),i&2){let e=t.$implicit;l(),b(e.label),l(),O(e.items)}}function Jo(i,t){if(i&1&&(s(0,"div",45),p(1),d()),i&2){let e=r(3);l(),b(e.copy().noConversationsYet)}}function Xo(i,t){if(i&1&&D(0,Qo,4,1,null,null,re,!1,Jo,2,1,"div",45),i&2){let e=r(2);O(e.groupedConversations())}}function Zo(i,t){if(i&1&&(s(0,"nile-menu-item",73)(1,"div",74),C(2,"nile-skeleton-loader",75),s(3,"div",76),C(4,"nile-skeleton-loader",77)(5,"nile-skeleton-loader",94),d()()()),i&2){let e=t.$implicit;l(3),Z("max-width",e,"px")}}function ea(i,t){if(i&1&&D(0,Zo,6,2,"nile-menu-item",73,j),i&2){let e=r(3);O(e.menuSkeletonRows)}}function ta(i,t){if(i&1&&(s(0,"div",45),p(1),d()),i&2){let e=r(3);l(),b(e.copy().noResultsMatchFilters)}}function na(i,t){if(i&1){let e=k();s(0,"input",87),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,c=r(5);return g(c.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,c=r(5);return g(c.commitRenameDashboard(o,a))}),d()}if(i&2){let e=r(6);w("ngModel",e.renameDraft())}}function ia(i,t){if(i&1&&(s(0,"span",88),p(1),d(),s(2,"span",89),p(3),d()),i&2){let e=r().$implicit,n=r(5);w("title",e.name||"Untitled"),l(),b(e.name||"Untitled"),l(2),b(n.dashboardMeta(e))}}function oa(i,t){if(i&1){let e=k();s(0,"nile-menu-item",69),u("click",function(){let o=_(e).$implicit,a=r(5);return g(a.openRelatedDashboard(o.id))}),s(1,"div",74),C(2,"nile-glyph",95),s(3,"div",76),m(4,na,1,1,"input",81)(5,ia,4,3),d(),s(6,"div",82)(7,"button",83),u("click",function(o){let a=_(e).$implicit,c=r(5);return g(c.startRename(o,a.id,a.name))}),C(8,"nile-glyph",84),d(),s(9,"button",85),u("click",function(o){let a=_(e).$implicit,c=r(5);return g(c.deleteDashboardFromMenu(o,a.id))}),C(10,"nile-glyph",86),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 aa(i,t){if(i&1&&(s(0,"div",79),p(1),d(),D(2,oa,11,4,"nile-menu-item",null,te)),i&2){let e=t.$implicit;l(),b(e.label),l(),O(e.items)}}function ra(i,t){if(i&1&&(s(0,"div",45),p(1),d()),i&2){let e=r(4);l(),b(e.copy().noDashboardsYet)}}function la(i,t){if(i&1&&D(0,aa,4,1,null,null,re,!1,ra,2,1,"div",45),i&2){let e=r(3);O(e.groupedDashboards())}}function sa(i,t){if(i&1){let e=k();s(0,"nile-dropdown",90),u("nile-hide",function(){_(e);let o=r(2);return g(o.showRelatedDashboards.set(!1))}),s(1,"nile-lite-tooltip",91)(2,"button",92),u("click",function(){_(e);let o=r(2);return g(o.showRelatedDashboards.set(!o.showRelatedDashboards()))}),C(3,"nile-glyph",93),d()(),s(4,"nile-menu",42),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",43),u("click",function(){_(e);let o=r(2);return g(o.openNewDashboard())}),C(6,"nile-glyph",44),p(7),d(),m(8,ea,2,0)(9,ta,2,1,"div",45)(10,la,3,1),d()()}if(i&2){let e=r(2);w("open",e.showRelatedDashboards()),l(4),M("noResultsMessage",e.copy().noResultsMatchFilters),l(3),T(" ",e.copy().newDashboardLabel," "),l(),h(e.dashboardsLoading()?8:e.dashSearchEmpty()?9:10)}}function da(i,t){if(i&1){let e=k();s(0,"nile-lite-tooltip",47)(1,"button",96),u("click",function(){_(e);let o=r(2);return g(o.openGallery())}),C(2,"nile-glyph",97),d()()}}function ca(i,t){if(i&1){let e=k();s(0,"header",12)(1,"div",33),m(2,To,4,4,"nile-nav-tab-group",34),d(),s(3,"div",35),m(4,qo,6,3,"span",36),m(5,Bo,7,3,"nile-dropdown",37),s(6,"nile-dropdown",38),u("nile-hide",function(){_(e);let o=r();return g(o.showConversationPicker.set(!1))}),s(7,"nile-lite-tooltip",39)(8,"button",40),u("click",function(){_(e);let o=r();return g(o.showConversationPicker.set(!o.showConversationPicker()))}),C(9,"nile-glyph",41),d()(),s(10,"nile-menu",42),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",43),u("click",function(){_(e);let o=r();return g(o.newConversation())}),C(12,"nile-glyph",44),p(13),d(),m(14,Go,2,0)(15,Ho,2,1,"div",45)(16,Xo,3,1),d()(),m(17,sa,11,4,"nile-dropdown",46),m(18,da,3,0,"nile-lite-tooltip",47),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(),w("open",n.showConversationPicker()),l(2),w("disabled",n.isStreaming()),l(2),M("noResultsMessage",n.copy().noResultsMatchFilters),l(3),T(" ",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 pa(i,t){if(i&1){let e=k();s(0,"button",111),u("click",function(){let o=_(e).$implicit,a=r(4);return g(a.selectWidgetTemplateCategory(o.key))}),p(1),s(2,"span",112),p(3),d()()}if(i&2){let e=t.$implicit,n=r(4);$("aq-picker-chip--active",n.widgetTemplateActiveCategory()===e.key),l(),T("",e.label," "),l(2),b(n.widgetTemplateCountForCategory(e.key))}}function _a(i,t){if(i&1){let e=k();s(0,"div",109)(1,"button",111),u("click",function(){_(e);let o=r(3);return g(o.selectWidgetTemplateCategory("all"))}),p(2),s(3,"span",112),p(4),d()(),D(5,pa,4,4,"button",113,re),d()}if(i&2){let e=r(3);l(),$("aq-picker-chip--active",e.widgetTemplateActiveCategory()==="all"),l(),T("",e.copy().libraryAllCategoryLabel," "),l(2),b(e.widgetTemplateAllTemplates().length),l(),O(e.templateCategories())}}function ga(i,t){if(i&1&&C(0,"nile-skeleton-loader",115),i&2){let e=t.$implicit;Z("width",e,"px")}}function ua(i,t){if(i&1&&(s(0,"div",110),D(1,ga,1,2,"nile-skeleton-loader",114,j),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",107),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",108),d(),m(2,_a,7,4,"div",109)(3,ua,3,0,"div",110)}if(i&2){let e=r(2);w("placeholder",e.copy().librarySearchWidgetsPlaceholder)("value",e.librarySearch()),l(2),h(!e.templateCategoriesLoading()&&!e.widgetTemplateTemplatesLoading()?2:3)}}function ha(i,t){if(i&1){let e=k();s(0,"button",111),u("click",function(){let o=_(e).$implicit,a=r(4);return g(a.selectTemplateCategory(o.key))}),p(1),s(2,"span",112),p(3),d()()}if(i&2){let e=t.$implicit,n=r(4);$("aq-picker-chip--active",n.templateActiveCategory()===e.key),l(),T("",e.label," "),l(2),b(n.templateCountForCategory(e.key))}}function Ca(i,t){if(i&1){let e=k();s(0,"div",109)(1,"button",111),u("click",function(){_(e);let o=r(3);return g(o.selectTemplateCategory("all"))}),p(2),s(3,"span",112),p(4),d()(),D(5,ha,4,4,"button",113,re),d()}if(i&2){let e=r(3);l(),$("aq-picker-chip--active",e.templateActiveCategory()==="all"),l(),T("",e.copy().libraryAllCategoryLabel," "),l(2),b(e.templateAllTemplates().length),l(),O(e.templateCategories())}}function fa(i,t){if(i&1&&C(0,"nile-skeleton-loader",115),i&2){let e=t.$implicit;Z("width",e,"px")}}function xa(i,t){if(i&1&&(s(0,"div",110),D(1,fa,1,2,"nile-skeleton-loader",114,j),d()),i&2){let e=r(3);l(),O(e.libraryChipSkeletonWidths)}}function ba(i,t){if(i&1){let e=k();s(0,"nile-input",107),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",108),d(),m(2,Ca,7,4,"div",109)(3,xa,3,0,"div",110)}if(i&2){let e=r(2);w("placeholder",e.copy().librarySearchDashboardsPlaceholder)("value",e.librarySearch()),l(2),h(e.templateCategoriesLoading()?3:2)}}function ya(i,t){if(i&1&&(s(0,"div",122),C(1,"nile-skeleton-loader",123)(2,"nile-skeleton-loader",124)(3,"nile-skeleton-loader",125)(4,"nile-skeleton-loader",126),d()),i&2){let e=t.$implicit;l(),M("width",e)}}function va(i,t){if(i&1&&(s(0,"div",117)(1,"div",118),C(2,"nile-skeleton-loader",119)(3,"nile-skeleton-loader",120),d(),s(4,"div",121),D(5,ya,5,1,"div",122,j),d()()),i&2){let e=t.$implicit;l(5),O(e)}}function wa(i,t){if(i&1&&(s(0,"div",116),D(1,va,7,0,"div",117,j),d()),i&2){let e=r(3);l(),O(e.librarySkeletonGroups)}}function ka(i,t){if(i&1){let e=k();s(0,"div",131),u("click",function(){let o=_(e).$implicit,a=r(6);return g(a.openWidgetDetailFromCard(o.templateId))}),C(1,"nile-kpi-chart",132),s(2,"button",133),u("click",function(o){let a=_(e).$implicit,c=r(6);return o.stopPropagation(),g(c.toggleWidgetTemplateSelection(a.templateId))}),C(3,"nile-glyph",134),d()()}if(i&2){let e=t.$implicit,n=r(6);$("aq-lib-card-wrap--selected",n.widgetTemplatePickerSelectedIds().includes(e.templateId)),l(),w("label",e.title)("description",e.desc??"")("value",e.value)("loading",e.loading)("sparkline",e.sparkline)("options",n.libraryKpiChartOptions),l(),$("aq-lib-card__check--on",n.widgetTemplatePickerSelectedIds().includes(e.templateId))}}function Pa(i,t){if(i&1){let e=k();s(0,"div",117)(1,"div",118)(2,"span",128),p(3),d(),s(4,"button",129),u("click",function(){let o=_(e).$implicit,a=r(5);return g(a.toggleLibraryGroupSelection(o.cards))}),p(5),d()(),s(6,"div",121),D(7,ka,4,10,"div",130,yo),d()()}if(i&2){let e=t.$implicit,n=r(5);l(3),K("",e.label," \xB7 ",e.cards.length),l(2),T(" ",n.isGroupFullySelected(e.cards)?n.copy().libraryClearSelectionButton:n.copy().librarySelectAllButton," "),l(2),O(e.cards)}}function Aa(i,t){if(i&1&&D(0,Pa,9,3,"div",117,re),i&2){let e=r(4);O(e.libraryWidgetGroups())}}function Ma(i,t){if(i&1&&(s(0,"div",127),p(1),d()),i&2){let e=r(4);l(),b(e.librarySearch()?e.copy().noWidgetsMatch:e.copy().noWidgetsInCategory)}}function Sa(i,t){if(i&1&&m(0,Aa,2,0)(1,Ma,2,1,"div",127),i&2){let e=r(3);h(e.libraryWidgetGroups().length?0:1)}}function Ta(i,t){if(i&1&&m(0,wa,3,0,"div",116)(1,Sa,2,1),i&2){let e=r(2);h(e.templateCategoriesLoading()||e.widgetTemplateTemplatesLoading()?0:1)}}function qa(i,t){if(i&1&&(s(0,"div",136),C(1,"nile-skeleton-loader",137),s(2,"div",138),C(3,"nile-skeleton-loader",123)(4,"nile-skeleton-loader",125)(5,"nile-skeleton-loader",139),d()()),i&2){let e=t.$implicit;l(3),M("width",e)}}function Fa(i,t){if(i&1&&(s(0,"div",117)(1,"div",118),C(2,"nile-skeleton-loader",119),d(),s(3,"div",135),D(4,qa,6,1,"div",136,j),d()()),i&2){let e=t.$implicit;l(4),O(e)}}function Da(i,t){if(i&1&&(s(0,"div",116),D(1,Fa,6,0,"div",117,j),d()),i&2){let e=r(3);l(),O(e.librarySkeletonGroups)}}function Oa(i,t){if(i&1&&(s(0,"div",143),C(1,"db-dash-card-chart",151),d()),i&2){let e=r().$implicit;l(),w("config",e.preview)}}function Ea(i,t){i&1&&(s(0,"div",144),C(1,"span",152)(2,"span",153)(3,"span",154)(4,"span",155)(5,"span",156),d())}function Ia(i,t){if(i&1&&(s(0,"span",145),C(1,"nile-glyph",157),p(2),d()),i&2){let e=r().$implicit,n=r(5);l(2),T(" ",n.withCount(n.copy().libraryWidgetCountChip,(e.widgets==null?null:e.widgets.length)??0)," ")}}function Va(i,t){if(i&1&&(s(0,"div",149),p(1),d()),i&2){let e=r().$implicit;l(),b(e.description)}}function Ra(i,t){if(i&1){let e=k();s(0,"button",141),u("click",function(){let o=_(e).$implicit,a=r(5);return g(a.openWidgetDetailPanelForTemplate(o))}),s(1,"div",142),m(2,Oa,2,1,"div",143)(3,Ea,6,0,"div",144),m(4,Ia,3,1,"span",145),d(),s(5,"div",146)(6,"div",147)(7,"span",148),p(8),d(),m(9,Va,2,1,"div",149),d(),C(10,"nile-glyph",150),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),b(e.name),l(),h(e.description?9:-1)}}function za(i,t){if(i&1&&(s(0,"div",117)(1,"div",118)(2,"span",128),p(3),d()(),s(4,"div",135),D(5,Ra,11,4,"button",140,te),d()()),i&2){let e=t.$implicit;l(3),K("",e.label," \xB7 ",e.templates.length),l(2),O(e.templates)}}function Na(i,t){if(i&1&&D(0,za,7,2,"div",117,re),i&2){let e=r(3);O(e.libraryDashboardGroups())}}function La(i,t){if(i&1&&(s(0,"div",127),p(1),d()),i&2){let e=r(3);l(),b(e.librarySearch()?e.copy().noDashboardsMatch:e.copy().noDashboardsInCategory)}}function $a(i,t){if(i&1&&m(0,Da,3,0,"div",116)(1,Na,2,0)(2,La,2,1,"div",127),i&2){let e=r(2);h(e.templateTemplatesLoading()?0:e.libraryDashboardGroups().length?1:2)}}function Wa(i,t){if(i&1){let e=k();s(0,"div",106)(1,"span",158),p(2),d(),s(3,"nile-button",22),u("click",function(){_(e);let o=r(2);return g(o.addSelectedWidgetTemplates())}),C(4,"nile-glyph",159),p(5),d()()}if(i&2){let e=r(2);l(2),T(" ",e.withCount(e.copy().librarySelectedCount,e.widgetTemplatePickerSelectedIds().length)," "),l(3),T(" ",e.withCount(e.copy().libraryAddToCanvasButton,e.widgetTemplatePickerSelectedIds().length)," ")}}function Ba(i,t){if(i&1){let e=k();s(0,"div",13)(1,"div",98)(2,"p",99)(3,"strong",100),p(4),d(),p(5),d(),s(6,"nile-nav-tab-group",101),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",102),p(8),s(9,"span",103),p(10),d()(),s(11,"nile-nav-tab",104),p(12),s(13,"span",103),p(14),d()()(),m(15,ma,4,3)(16,ba,4,3),d(),s(17,"div",105),m(18,Ta,2,1)(19,$a,3,1),d(),m(20,Wa,6,2,"div",106),d()}if(i&2){let e=r();l(4),b(e.copy().libraryIntroTitle),l(),T(" ",e.copy().libraryIntro," "),l(),M("value",e.artifactPickerTab()),l(2),b(e.copy().libraryWidgetsTabLabel),l(2),b(e.widgetTemplateAllTemplates().length),l(2),b(e.copy().libraryDashboardsTabLabel),l(2),b(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 Ua(i,t){i&1&&(s(0,"div",181),C(1,"nile-skeleton-loader",182)(2,"nile-skeleton-loader",183),d())}function Ga(i,t){if(i&1&&D(0,Ua,3,0,"div",181,j),i&2){let e=r(2);O(e.cohortCriteriaSkeletonRows)}}function Ha(i,t){if(i&1&&(s(0,"p",184),p(1),d()),i&2){let e=r(3);l(),b(e.copy().cohortLogUnavailableMessage)}}function ja(i,t){if(i&1){let e=k();s(0,"p",184),p(1),d(),s(2,"nile-button",21),u("click",function(){_(e);let o=r(3);return g(o.retryCohortCriteria())}),p(3),d()}if(i&2){let e=r(3);l(),b(e.copy().cohortCriteriaErrorMessage),l(2),T(" ",e.copy().cohortPreviewRetryButton," ")}}function Ya(i,t){i&1&&(s(0,"div",169),m(1,Ha,2,1,"p",184)(2,ja,4,2),d()),i&2&&(l(),h(t==="unavailable"?1:2))}function Ka(i,t){if(i&1){let e=k();s(0,"button",186),u("click",function(){let o=_(e).$implicit,a=r(3);return g(a.selectCohortCriterion(o.id))}),C(1,"span",187),s(2,"span",188),p(3),d()()}if(i&2){let e=t.$implicit,n=r(3);$("is-selected",n.selectedCriterionId()===e.id),M("aria-checked",n.selectedCriterionId()===e.id),l(3),b(e.label)}}function Qa(i,t){if(i&1&&D(0,Ka,4,4,"button",185,te),i&2){let e=r(2);O(e.cohortCriteria())}}function Ja(i,t){i&1&&(s(0,"div",190)(1,"span",191),C(2,"nile-skeleton-loader",75),d(),C(3,"nile-skeleton-loader",192)(4,"nile-skeleton-loader",193),d())}function Xa(i,t){if(i&1&&(s(0,"div",170),C(1,"nile-skeleton-loader",189),D(2,Ja,5,0,"div",190,j),d()),i&2){let e=r(2);l(2),O(e.cohortMatchSkeletonRows)}}function Za(i,t){if(i&1&&(s(0,"p",195),p(1),d()),i&2){let e=r(3);l(),b(e.copy().cohortEmptyMatchesMessage)}}function er(i,t){if(i&1&&(s(0,"p",195),p(1),d()),i&2){let e=r(3);l(),b(e.copy().cohortNamesWithheldMessage)}}function tr(i,t){if(i&1&&(s(0,"span",200),p(1),d()),i&2){let e=r().$implicit;l(),T("",e.daysInState,"d")}}function nr(i,t){if(i&1&&(s(0,"div",197)(1,"span",199),p(2),d(),m(3,tr,2,1,"span",200),d()),i&2){let e=t.$implicit;l(2),b(e.name??"\u2014"),l(),h(e.daysInState!==null&&e.daysInState!==void 0?3:-1)}}function ir(i,t){i&1&&(s(0,"div",201)(1,"span",191),C(2,"nile-skeleton-loader",75),d(),C(3,"nile-skeleton-loader",192)(4,"nile-skeleton-loader",193),d())}function or(i,t){if(i&1&&D(0,ir,5,0,"div",201,j),i&2){let e=r(4);O(e.cohortMatchSkeletonRows)}}function ar(i,t){if(i&1&&(s(0,"p",198),p(1),d()),i&2){let e=r(4);l(),b(e.cohortMatchesTruncatedNote())}}function rr(i,t){if(i&1&&(s(0,"p",198),p(1),d()),i&2){let e=r(4);l(),b(e.copy().cohortMembersForbiddenMessage)}}function lr(i,t){if(i&1&&(s(0,"p",198),p(1),d()),i&2){let e=r(5);l(),b(e.copy().cohortMembersErrorMessage)}}function sr(i,t){if(i&1){let e=k();s(0,"button",203),u("click",function(){_(e);let o=r(5);return g(o.toggleAllCohortMatches())}),p(1),d()}if(i&2){let e=r(5);w("disabled",e.cohortMembersLoading()),M("aria-expanded",e.cohortMatchesExpanded())("aria-busy",e.cohortMembersLoading()?"true":null),l(),b(e.cohortViewAllLabel())}}function dr(i,t){if(i&1&&(m(0,lr,2,1,"p",198),m(1,sr,2,4,"button",202)),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",196),D(1,nr,4,2,"div",197,vo),m(3,or,2,0),d(),m(4,ar,2,1,"p",198),m(5,rr,2,1,"p",198)(6,dr,2,2)),i&2){let e=r(3);$("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 pr(i,t){if(i&1&&(s(0,"div",171)(1,"p",194),p(2),d(),m(3,Za,2,1,"p",195)(4,er,2,1,"p",195)(5,cr,7,5),d()),i&2){let e=r(2);l(2),b(e.cohortMatchSummary()),l(),h(t.matchCount===0?3:e.cohortNamesWithheld()?4:5)}}function _r(i,t){if(i&1&&(s(0,"p",184),p(1),d()),i&2){let e=r(3);l(),b(e.copy().cohortLogUnavailableMessage)}}function gr(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))}),p(1),d()}if(i&2){let e=r(4);l(),T(" ",e.copy().cohortPreviewRetryButton," ")}}function ur(i,t){if(i&1&&(s(0,"p",184),p(1),d(),m(2,gr,2,1,"nile-button",204)),i&2){let e,n=r(3);l(),b(n.copy().cohortPreviewErrorMessage),l(),h((e=n.selectedCriterionId())?2:-1,e)}}function mr(i,t){i&1&&(s(0,"div",172),m(1,_r,2,1,"p",184)(2,ur,3,2),d()),i&2&&(l(),h(t==="unavailable"?1:2))}function hr(i,t){if(i&1){let e=k();s(0,"div",14)(1,"div",160)(2,"span",161),C(3,"nile-glyph",162),d(),s(4,"span",163),p(5),d()(),s(6,"p",164),p(7),d(),s(8,"div",165)(9,"span",166),p(10,"1"),d(),s(11,"span",167),p(12),d()(),s(13,"div",168),m(14,Ga,2,0)(15,Ya,3,1,"div",169)(16,Qa,2,0),d(),s(17,"div",165)(18,"span",166),p(19,"2"),d(),s(20,"span",167),p(21),d()(),m(22,Xa,4,0,"div",170)(23,pr,6,2,"div",171)(24,mr,3,1,"div",172),C(25,"div",173),s(26,"div",174)(27,"p",175),p(28),d(),s(29,"div",176)(30,"nile-button",177),u("click",function(){_(e);let o=r();return g(o.addCohortToCanvas())}),C(31,"nile-glyph",178),p(32),d(),s(33,"nile-button",179),u("click",function(){_(e);let o=r();return g(o.addCohortToCanvas())}),C(34,"nile-glyph",180),p(35),d()()()()}if(i&2){let e,n,o=r();l(5),b(o.copy().cohortBuilderTitle),l(2),b(o.copy().cohortBuilderSubtitle),l(5),b(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),b(o.copy().cohortStep2Label),l(),h(o.cohortPreviewLoading()?22:(n=o.cohortPreview())?23:(n=o.cohortPreviewError())?24:-1,n),l(6),b(o.copy().cohortAddToCanvasDisclaimer),l(2),M("disabled",o.cohortPreview()?null:""),l(2),T(" ",o.copy().cohortPreviewWidgetButton," "),l(),M("disabled",o.cohortPreview()?null:""),l(2),T(" ",o.copy().cohortAddToCanvasButton," ")}}function Cr(i,t){i&1&&(s(0,"div",215),C(1,"nile-skeleton-loader",216),s(2,"div",217),C(3,"nile-skeleton-loader",77),d()())}function fr(i,t){i&1&&(s(0,"div",214),D(1,Cr,4,0,"div",215,j),d()),i&2&&(l(),O(pe(0,bo)))}function xr(i,t){if(i&1&&(s(0,"span",224),p(1),d()),i&2){let e=r().$implicit;l(),b(e.badge)}}function br(i,t){if(i&1){let e=k();s(0,"button",221),u("click",function(){let o=_(e).$implicit,a=r(5);return g(a.onWelcomePromptPick(o))}),C(1,"nile-glyph",222),s(2,"span",223),p(3),d(),m(4,xr,2,1,"span",224),d()}if(i&2){let e=t.$implicit;$("prompt-card--ai",e.tone==="ai"),l(),M("name",e.icon)("color",e.tone==="ai"?"#7a5af8":"var(--ng-colors-text-quaternary-500)"),l(2),b(e.label),l(),h(e.badge?4:-1)}}function yr(i,t){if(i&1&&(s(0,"div",218),D(1,br,5,6,"button",220,Mi),d()),i&2){let e=r(4);l(),O(e.welcomePromptCards())}}function vr(i,t){if(i&1){let e=k();s(0,"div",219)(1,"button",225),u("click",function(){_(e);let o=r(4);return g(o.openGallery())}),C(2,"nile-glyph",226),s(3,"span"),p(4),d()()()}if(i&2){let e=r(4);l(4),b(e.copy().promptGalleryLabel)}}function wr(i,t){if(i&1&&(m(0,yr,3,0,"div",218),m(1,vr,5,1,"div",219)),i&2){let e=r(3);h(e.features().welcomePrompts?0:-1),l(),h(e.features().promptGallery?1:-1)}}function kr(i,t){if(i&1&&(s(0,"div",205)(1,"div",207)(2,"div",208),C(3,"nile-glyph",209),d(),s(4,"h2",210),p(5),d(),s(6,"p",211),p(7),d(),s(8,"div",212),fe(9,213),d(),m(10,fr,3,1,"div",214)(11,wr,2,2),d()()),i&2){let e=r(2),n=le(8);l(5),b(e.copy().welcomeTitle),l(2),b(e.copy().welcomeSubtitle),l(2),w("ngTemplateOutlet",n),l(),h(e.features().welcomePrompts&&!e.welcomePromptCards().length?10:11)}}function Pr(i,t){i&1&&(s(0,"div",229),C(1,"nile-skeleton-loader",230),d(),s(2,"div",231),C(3,"nile-skeleton-loader",232)(4,"nile-skeleton-loader",233)(5,"nile-skeleton-loader",234),d(),s(6,"div",229),C(7,"nile-skeleton-loader",235),d(),s(8,"div",231),C(9,"nile-skeleton-loader",236)(10,"nile-skeleton-loader",237),d())}function Ar(i,t){if(i&1&&(s(0,"div",239),C(1,"nile-glyph",243),s(2,"span",244),p(3),d()()),i&2){let e=r(2).$implicit;l(3),b(e.quotedText)}}function Mr(i,t){if(i&1&&(s(0,"span",249),p(1),d()),i&2){let e=r().$implicit;l(),b(e.answer)}}function Sr(i,t){if(i&1&&(s(0,"div",245),C(1,"nile-glyph",246),s(2,"div",247)(3,"span",248),p(4),d(),m(5,Mr,2,1,"span",249),d()()),i&2){let e=t.$implicit;l(4),b(e.title),l(),h(e.answer&&e.answer!=="Use this"?5:-1)}}function Tr(i,t){if(i&1&&(s(0,"div",240),D(1,Sr,6,2,"div",245,j),d()),i&2){let e=r(2).$implicit,n=r(4);l(),O(n.answerSummaryRows(e))}}function qr(i,t){if(i&1&&(s(0,"span",241),p(1),d()),i&2){let e=r(2).$implicit;l(),b(e.text)}}function Fr(i,t){if(i&1&&(s(0,"div",250),C(1,"nile-glyph",251),s(2,"span",252),p(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(),b(e.name)}}function Dr(i,t){if(i&1&&(s(0,"div",242),D(1,Fr,4,3,"div",250,re),d()),i&2){let e=r(2).$implicit;l(),O(e.attachments??pe(0,Se))}}function Or(i,t){if(i&1&&(s(0,"nile-ai-chat-bubble",238),m(1,Ar,4,1,"div",239),m(2,Tr,3,0,"div",240)(3,qr,2,1,"span",241),m(4,Dr,3,1,"div",242),d()),i&2){let e=r().$implicit;w("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 Er(i,t){if(i&1&&C(0,"nile-ai-steps",253),i&2){let e=r(2).$implicit;w("steps",e.tools)}}function Ir(i,t){if(i&1&&C(0,"nile-ai-token-stream",262),i&2){let e=r(4).$implicit,n=r(4);w("text",n.cleanText(e.text))("speedMs",n.streamSpeed)}}function Vr(i,t){if(i&1&&C(0,"nile-markdown",263),i&2){let e=r(4).$implicit,n=r(4);w("value",n.cleanMarkdown(e.text))}}function Rr(i,t){if(i&1&&m(0,Ir,1,2,"nile-ai-token-stream",262)(1,Vr,1,1,"nile-markdown",263),i&2){let e=r(3).$implicit;h(e.isStreaming?0:1)}}function zr(i,t){if(i&1&&(s(0,"span",264),p(1),d()),i&2){let e=r().$implicit;l(),K("Setup ",e.step.current," of ",e.step.total)}}function Nr(i,t){i&1&&(s(0,"span",273),p(1),d()),i&2&&(l(),b(t))}function Lr(i,t){if(i&1&&(s(0,"span",275),p(1),d()),i&2){let e=r().$implicit;l(),b(e.hint)}}function $r(i,t){if(i&1&&(s(0,"span"),p(1),d()),i&2){let e=r().$implicit;ot("choice-card__chip"+(e.tone?" choice-card__chip--"+e.tone:"")),l(),b(e.text)}}function Wr(i,t){if(i&1&&m(0,$r,2,3,"span",277),i&2){let e=t.$implicit;h(e.tone!=="green"&&e.tone!=="yellow"&&e.tone!=="red"?0:-1)}}function Br(i,t){if(i&1&&(s(0,"span",276),D(1,Wr,1,1,null,null,j),d()),i&2){let e=r().$implicit;l(),O(e.meta)}}function Ur(i,t){if(i&1&&(s(0,"nile-radio",269)(1,"span",270)(2,"span",271),p(3),d(),s(4,"span",272),m(5,Nr,2,1,"span",273),s(6,"span",274),p(7),d(),m(8,Lr,2,1,"span",275),m(9,Br,3,0,"span",276),d()()()),i&2){let e,n=t.$implicit,o=t.$index,a=t.$index,c=r(2).$implicit,f=r(3).$implicit,y=r(4);$("choice-card--chosen",(c.selected||c.draftSelection)===n.id)("choice-card--locked",!!c.selected||y.isStreaming()),M("name","choice-"+f.id+"-"+o)("value",n.id)("checked",(c.selected||c.draftSelection)===n.id?"":null)("disabled",c.selected||y.isStreaming()?"":null),l(3),b(a+1),l(2),h((e=y.optionBadgeText(n))?5:-1,e),l(2),b(y.optionPrimaryText(n)),l(),h(!y.optionBadgeText(n)&&n.hint?8:-1),l(),h(n.meta!=null&&n.meta.length?9:-1)}}function Gr(i,t){if(i&1){let e=k();s(0,"nile-radio-group",267),u("nile-change",function(o){_(e);let a=r().$implicit,c=r(3).$implicit,f=r(4);return g(f.onChoiceChange(c,a,o.detail.value))}),D(1,Ur,10,13,"nile-radio",268,te),d()}if(i&2){let e=r(),n=e.$implicit,o=e.$index,a=r(3).$implicit,c=r(4);M("label",n.prompt||"Choose an index")("name","choice-"+a.id+"-"+o)("value",n.selected||n.draftSelection||null)("disabled",n.selected||c.isStreaming()?"":null),l(),O(n.options)}}function Hr(i,t){if(i&1&&(s(0,"p",266),p(1),d()),i&2){let e=r(8);l(),b(e.copy().noChoiceOptions)}}function jr(i,t){if(i&1&&p(0),i&2){let e=r(3).$implicit;T(" \u2713 Something else: ",e.chatDraftText," (edit) ")}}function Yr(i,t){if(i&1&&(C(0,"nile-glyph",283),p(1)),i&2){let e=r(10);l(),T(" ",e.copy().somethingElseButton," ")}}function Kr(i,t){if(i&1){let e=k();s(0,"button",280),u("click",function(){_(e);let o=r(3).$implicit,a=r(3).$implicit,c=r(4);return g(c.requestPlan(a,o))}),p(1),d()}if(i&2){let e=r(10);w("disabled",e.isStreaming()),l(),T(" ",e.copy().givePlanButton," ")}}function Qr(i,t){if(i&1){let e=k();s(0,"button",284),u("click",function(){_(e);let o=r(3).$implicit,a=r(3).$implicit,c=r(4);return g(c.previewWidget(a,o))}),C(1,"nile-glyph",285),p(2),d()}if(i&2){let e=r(3).$implicit,n=r(7);w("disabled",n.isStreaming()),l(2),T(' Preview "',n.choiceTitle(e),'" ')}}function Jr(i,t){if(i&1){let e=k();s(0,"div",278)(1,"button",280),u("click",function(){_(e);let o=r(2).$implicit,a=r(3).$implicit,c=r(4);return g(c.openChatDraft(a,o))}),m(2,jr,1,1)(3,Yr,2,1),d(),m(4,Kr,2,2,"button",281),m(5,Qr,3,2,"button",282),d()}if(i&2){let e=r(2).$implicit,n=r(7);l(),w("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 Xr(i,t){if(i&1){let e=k();s(0,"div",279)(1,"span",286),p(2,"Something else"),d(),s(3,"div",287)(4,"nile-input",288),u("nile-input",function(o){_(e);let a=r(2).$implicit,c=r(3).$implicit,f=r(4);return g(f.onChatDraftTextChange(c,a,o.detail.value))})("keydown.enter",function(){_(e);let o=r(2).$implicit,a=r(3).$implicit,c=r(4);return g(c.defineChatDraft(a,o))}),d(),s(5,"nile-button",22),u("click",function(){_(e);let o=r(2).$implicit,a=r(3).$implicit,c=r(4);return g(c.defineChatDraft(a,o))}),p(6),d()()()}if(i&2){let e=r(2).$implicit,n=r(7);l(4),w("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(),T(" ",n.copy().defineItButton," ")}}function Zr(i,t){if(i&1&&m(0,Jr,6,4,"div",278)(1,Xr,7,5,"div",279),i&2){let e=r().$implicit;h(e.chatOpen?1:0)}}function el(i,t){if(i&1&&(s(0,"div",256),m(1,zr,2,2,"span",264),m(2,Gr,3,4,"nile-radio-group",265)(3,Hr,2,1,"p",266),m(4,Zr,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 tl(i,t){if(i&1){let e=k();s(0,"button",289),u("click",function(){_(e);let o=r(3).$implicit,a=r(4);return g(a.resumeChoicePanel(o))}),p(1),d()}if(i&2){let e=r(3).$implicit,n=r(4);l(),K(" ",n.panelAnsweredCount(e.choices??pe(2,Se))," of ",(e.choices??pe(3,Se)).length," answered \u2014 Resume ")}}function nl(i,t){i&1&&(s(0,"span",291),C(1,"span",297),p(2,"Live "),d())}function il(i,t){i&1&&(s(0,"span",292),p(1,"Preview"),d())}function ol(i,t){i&1&&C(0,"div",300)}function al(i,t){if(i&1&&C(0,"nile-glyph",304),i&2){let e=r().$implicit;Z("color",e.color),w("name",e.glyph)("method",e.method||"stroke")}}function rl(i,t){if(i&1){let e=k();m(0,ol,1,0,"div",300),s(1,"nile-menu-item",301),u("click",function(){let o=_(e).$implicit;r();let a=le(1),c=r(4).$implicit;return r(4).onInlineWidgetMenuItem(c,o),g(a.hide())}),s(2,"span",302),m(3,al,1,4,"nile-glyph",303),p(4),d()()}if(i&2){let e=t.$implicit;h(e.divider?0:-1),l(3),h(e.glyph?3:-1),l(),T(" ",e.label," ")}}function ll(i,t){if(i&1&&(s(0,"nile-dropdown",293,4)(2,"button",298),C(3,"nile-glyph",299),d(),s(4,"nile-menu"),D(5,rl,5,3,null,null,re),d()()),i&2){let e=r(4).$implicit,n=r(4);l(5),O(n.inlineWidgetMenuItems(e))}}function sl(i,t){i&1&&(s(0,"div",308),C(1,"nile-spinner",311),s(2,"span"),p(3,"Loading chart types\u2026"),d()())}function dl(i,t){if(i&1&&(s(0,"p",309),p(1),d()),i&2){let e=r(9);l(),b(e.copy().noChartTypesFit)}}function cl(i,t){i&1&&C(0,"nile-spinner",311)}function pl(i,t){if(i&1&&C(0,"nile-glyph",316),i&2){let e=r().$implicit,n=r(11);w("name",n.chartTypeIcon(e.type))}}function _l(i,t){if(i&1){let e=k();s(0,"button",315),u("click",function(){let o=_(e).$implicit,a=r(11);return g(a.selectInlineChartType(o.component))}),m(1,cl,1,0,"nile-spinner",311)(2,pl,1,1,"nile-glyph",316),s(3,"span"),p(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),b(e.label)}}function gl(i,t){if(i&1&&(s(0,"p",312),p(1,"Recommended"),d(),s(2,"div",313),D(3,_l,5,3,"button",314,Si),d()),i&2){let e=r(10);l(3),O(e.inlineSensibleChartTypes())}}function ul(i,t){i&1&&C(0,"nile-spinner",311)}function ml(i,t){if(i&1&&C(0,"nile-glyph",316),i&2){let e=r().$implicit,n=r(11);w("name",n.chartTypeIcon(e.type))}}function hl(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,ul,1,0,"nile-spinner",311)(2,ml,1,1,"nile-glyph",316),s(3,"span"),p(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),b(e.label)}}function Cl(i,t){if(i&1&&(s(0,"p",312),p(1,"Other types"),d(),s(2,"div",313),D(3,hl,5,3,"button",317,Si),d()),i&2){let e=r(10);l(3),O(e.inlineOtherChartTypes())}}function fl(i,t){if(i&1&&(m(0,gl,5,0),m(1,Cl,5,0)),i&2){let e=r(9);h(e.inlineSensibleChartTypes().length>0?0:-1),l(),h(e.inlineOtherChartTypes().length>0?1:-1)}}function xl(i,t){if(i&1&&(s(0,"p",310),p(1),d()),i&2){let e=r(9);l(),b(e.inlineChartTypeError())}}function bl(i,t){if(i&1){let e=k();s(0,"nile-dropdown",305),u("nile-hide",function(){_(e);let o=r(8);return g(o.closeInlineChartTypePicker())}),C(1,"span",306),s(2,"div",307),m(3,sl,4,0,"div",308)(4,dl,2,1,"p",309)(5,fl,2,2),m(6,xl,2,1,"p",310),d()()}if(i&2){let e=r(4).$implicit,n=r(4);w("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 yl(i,t){if(i&1){let e=k();s(0,"span",321),p(1),s(2,"button",322),u("click",function(){let o=_(e).$implicit,a=r(6).$implicit,c=r(4);return g(c.removeInlineFilter(a.charts[0],o.id))}),C(3,"nile-glyph",323),d()()}if(i&2){let e=t.$implicit,n=r(6).$implicit,o=r(4);l(),T(" ",o.inlineFilterChipLabel(n.charts[0],e)," "),l(),M("disabled",o.inlineFilterApplying()?"":null)}}function vl(i,t){if(i&1&&(s(0,"div",320),D(1,yl,4,2,"span",321,te),d()),i&2){let e=r(5).$implicit,n=r(4);l(),O(n.inlineActiveFilters(e.charts[0]))}}function wl(i,t){i&1&&(s(0,"div",308),C(1,"nile-spinner",311),s(2,"span"),p(3,"Loading filterable fields\u2026"),d()())}function kl(i,t){if(i&1&&(s(0,"p",310),p(1),d()),i&2){let e=r(9);l(),b(e.inlineFilterFieldsError())}}function Pl(i,t){if(i&1&&(s(0,"p",309),p(1),d()),i&2){let e=r(9);l(),b(e.copy().noFilterableFields)}}function Al(i,t){if(i&1&&(s(0,"option",326),p(1),d()),i&2){let e=t.$implicit;w("value",e.name),l(),b(e.label)}}function Ml(i,t){if(i&1&&(s(0,"option",326),p(1),d()),i&2){let e=t.$implicit;w("value",e.value),l(),b(e.label)}}function Sl(i,t){i&1&&(s(0,"div",308),C(1,"nile-spinner",327),s(2,"span"),p(3,"Loading values\u2026"),d()())}function Tl(i,t){if(i&1){let e=k();s(0,"input",331),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);w("placeholder",e.copy().filterValuePlaceholder)("ngModel",e.inlineFilterBuilderValue())}}function ql(i,t){if(i&1){let e=k();s(0,"span",333),p(1,"and"),d(),s(2,"input",332),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),w("ngModel",e.inlineFilterBuilderValue2())}}function Fl(i,t){if(i&1){let e=k();s(0,"input",332),u("ngModelChange",function(o){_(e);let a=r(11);return g(a.inlineFilterBuilderValue.set(o))}),d(),m(1,ql,3,1)}if(i&2){let e,n=r(7).$implicit,o=r(4);w("ngModel",o.inlineFilterBuilderValue()),l(),h((e=o.inlineFilterSelectedOperator(n.charts[0]))!=null&&e.needsSecondValue?1:-1)}}function Dl(i,t){if(i&1){let e=k();s(0,"span",333),p(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),w("placeholder",e.copy().filterValuePlaceholder)("ngModel",e.inlineFilterBuilderValue2())}}function Ol(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(),m(1,Dl,3,2)}if(i&2){let e,n=r(7).$implicit,o=r(4);w("placeholder",o.copy().filterValuePlaceholder)("ngModel",o.inlineFilterBuilderValue()),l(),h((e=o.inlineFilterSelectedOperator(n.charts[0]))!=null&&e.needsSecondValue?1:-1)}}function El(i,t){if(i&1){let e=k();s(0,"label",336)(1,"input",337),u("change",function(){let o=_(e).$implicit,a=r(12);return g(a.toggleInlineFilterMultiValue(o.value))}),d(),s(2,"span"),p(3),d()()}if(i&2){let e=t.$implicit,n=r(12);l(),w("checked",n.inlineFilterBuilderValues().includes(e.value)),l(2),K("",e.label,"",e.count!=null?" ("+e.count+")":"")}}function Il(i,t){if(i&1&&(s(0,"div",329),D(1,El,4,3,"label",336,tt),d()),i&2){let e=r(11);l(),O(e.inlineFilterValuesFor(e.inlineFilterBuilderFieldId()))}}function Vl(i,t){if(i&1&&(s(0,"option",326),p(1),d()),i&2){let e=t.$implicit;w("value",e.value),l(),K("",e.label,"",e.count!=null?" ("+e.count+")":"")}}function Rl(i,t){if(i&1){let e=k();s(0,"select",325),u("ngModelChange",function(o){_(e);let a=r(11);return g(a.inlineFilterBuilderValue.set(o))}),s(1,"option",338),p(2,"Select\u2026"),d(),D(3,Vl,2,3,"option",326,tt),d()}if(i&2){let e=r(11);w("ngModel",e.inlineFilterBuilderValue()),l(3),O(e.inlineFilterValuesFor(e.inlineFilterBuilderFieldId()))}}function zl(i,t){if(i&1&&m(0,Tl,1,2,"input",328)(1,Fl,2,2)(2,Ol,2,3)(3,Il,3,0,"div",329)(4,Rl,5,1,"select",330),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 Nl(i,t){if(i&1&&(s(0,"p",310),p(1),d()),i&2){let e=r(10);l(),b(e.inlineFilterApplyError())}}function Ll(i,t){if(i&1){let e=k();s(0,"div",324)(1,"select",325),u("ngModelChange",function(o){_(e);let a=r(5).$implicit,c=r(4);return g(c.onInlineFilterFieldChange(a.charts[0],o))}),D(2,Al,2,2,"option",326,wo),d(),s(4,"select",325),u("ngModelChange",function(o){_(e);let a=r(9);return g(a.onInlineFilterOperatorChange(o))}),D(5,Ml,2,2,"option",326,tt),d(),m(7,Sl,4,0,"div",308)(8,zl,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]))}),p(10," Add filter "),d()(),m(11,Nl,2,1,"p",310)}if(i&2){let e=r(5).$implicit,n=r(4);l(),w("ngModel",n.inlineFilterBuilderFieldId()),l(),O(n.inlineFilterFields(e.charts[0])),l(2),w("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 $l(i,t){if(i&1){let e=k();s(0,"nile-dropdown",305),u("nile-hide",function(){_(e);let o=r(8);return g(o.closeInlineFilterBuilder())}),C(1,"span",306),s(2,"div",319)(3,"p",309),p(4,"Filters this preview only \u2014 nothing is saved."),d(),m(5,vl,3,0,"div",320),m(6,wl,4,0,"div",308)(7,kl,2,1,"p",310)(8,Pl,2,1,"p",309)(9,Ll,12,6),d()()}if(i&2){let e=r(4).$implicit,n=r(4);w("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 Wl(i,t){if(i&1&&(s(0,"span",339)(1,"span",340),p(2),d(),s(3,"span",341),p(4),d()()),i&2){let e=t.$implicit;l(2),T("",e.label,":"),l(2),b(e.value)}}function Bl(i,t){if(i&1&&(s(0,"div",295),D(1,Wl,5,2,"span",339,Mi),d()),i&2){let e=r(4).$implicit;l(),O(e.forecastMeta??pe(0,Se))}}function Ul(i,t){if(i&1){let e=k();s(0,"nile-button",342),u("click",function(){_(e);let o=r(5).$implicit,a=r(4);return g(a.tryAlternatePreview(o.charts[0]))}),p(1),d()}if(i&2){let e=r(5).$implicit,n=r(4);w("disabled",n.isStreaming()),l(),T(' Try "',n.previewAltLabel(e.charts[0]),'" instead ')}}function Gl(i,t){if(i&1){let e=k();s(0,"nile-button",342),u("click",function(){_(e);let o=r(4).$implicit,a=r(4);return g(a.skipPreview(o.charts[0]))}),p(1," Skip this widget "),d(),m(2,Ul,2,2,"nile-button",343),s(3,"nile-button",344),u("click",function(){_(e);let o=r(4).$implicit,a=r(4);return g(a.acceptPreview(o.charts[0]))}),C(4,"nile-glyph",159),p(5," Add to dashboard "),d()}if(i&2){let e=r(4).$implicit,n=r(4);w("disabled",n.isStreaming()),l(2),h(n.previewAltLabel(e.charts[0])?2:-1),l(),w("disabled",n.isStreaming())}}function Hl(i,t){if(i&1&&(s(0,"div",45),p(1),d()),i&2){let e=r(10);l(),b(e.copy().noResultsMatchFilters)}}function jl(i,t){i&1&&fe(0)}function Yl(i,t){if(i&1){let e=k();s(0,"nile-menu-item",69),u("click",function(){let o=_(e).$implicit,a=r(8).$implicit,c=r(4);return g(c.addInlineToExisting(a.charts,o.id))}),Pe(1,jl,1,0,"ng-container",350),d()}if(i&2){let e=t.$implicit;r(12);let n=le(38);l(),w("ngTemplateOutlet",n)("ngTemplateOutletContext",at(2,Ai,e))}}function Kl(i,t){if(i&1&&(s(0,"div",79),p(1),d(),D(2,Yl,2,4,"nile-menu-item",null,te)),i&2){let e=t.$implicit;l(),b(e.label),l(),O(e.items)}}function Ql(i,t){if(i&1&&(s(0,"div",45),p(1),d()),i&2){let e=r(11);l(),b(e.copy().noDashboardsYet)}}function Jl(i,t){if(i&1&&D(0,Kl,4,1,null,null,re,!1,Ql,2,1,"div",45),i&2){let e=r(10);O(e.groupedPickerDashboards())}}function Xl(i,t){if(i&1){let e=k();s(0,"nile-dropdown",348),u("nile-hide",function(){_(e);let o=r(9);return g(o.inlinePickerFor.set(null))}),s(1,"nile-button",349),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",159),p(3),d(),s(4,"nile-menu",42),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",43),u("click",function(){_(e);let o=r(5).$implicit,a=r(4);return g(a.addInlineWidget(o.charts))}),C(6,"nile-glyph",44),p(7),d(),m(8,Hl,2,1,"div",45)(9,Jl,3,1),d()()}if(i&2){let e=r(5).$implicit,n=r(4);w("open",n.inlinePickerFor()===e.id),l(),M("loading",n.committingAction()==="add"?"":null)("disabled",n.committingAction()?"":null),l(2),T(" ",n.copy().addToDashboardButton," "),l(),M("noResultsMessage",n.copy().noResultsMatchFilters),l(3),T(" ",n.copy().newDashboardLabel," "),l(),h(n.pickerSearchEmpty()?8:9)}}function Zl(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",159),p(2),d()}if(i&2){let e=r(9);M("loading",e.committingAction()==="add"?"":null)("disabled",e.committingAction()?"":null),l(2),T(" ",e.builderOpen()?e.copy().addToCurrentDashboardButton:e.copy().addToDashboardButton," ")}}function es(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",345),p(2),d(),m(3,Xl,10,7,"nile-dropdown",346)(4,Zl,3,3,"nile-button",347)}if(i&2){let e=r(8);l(2),T(" ",e.copy().addToLibraryButton," "),l(),h(!e.builderOpen()&&e.nonAutoDashboards().length>1?3:4)}}function ts(i,t){if(i&1){let e=k();s(0,"div",258)(1,"div")(2,"shared-nile-chart-widget",290),u("aiSend",function(o){_(e);let a=r(7);return g(a.onInlineAiSend(o))}),m(3,nl,3,0,"span",291),m(4,il,2,0,"span",292),m(5,ll,7,0,"nile-dropdown",293),m(6,bl,7,3,"nile-dropdown",294),m(7,$l,10,3,"nile-dropdown",294),d()(),m(8,Bl,3,1,"div",295),s(9,"div",296),m(10,Gl,6,3)(11,es,5,2),d()()}if(i&2){let e=r(3).$implicit,n=r(4);l(),ot(n.inlineChartClass(e.charts[0])),l(),w("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 ns(i,t){i&1&&(s(0,"span",292),p(1,"Preview"),d(),p(2," \xB7 "))}function is(i,t){if(i&1){let e=k();s(0,"nile-button",342),u("click",function(){_(e);let o=r(5).$implicit,a=r(4);return g(a.tryAlternatePreview(o.charts[0]))}),p(1),d()}if(i&2){let e=r(5).$implicit,n=r(4);w("disabled",n.isStreaming()),l(),T(' Try "',n.previewAltLabel(e.charts[0]),'" instead ')}}function os(i,t){if(i&1){let e=k();s(0,"div",296)(1,"nile-button",342),u("click",function(){_(e);let o=r(4).$implicit,a=r(4);return g(a.skipPreview(o.charts[0]))}),p(2," Skip this widget "),d(),m(3,is,2,2,"nile-button",343),s(4,"nile-button",344),u("click",function(){_(e);let o=r(4).$implicit,a=r(4);return g(a.acceptPreview(o.charts[0]))}),C(5,"nile-glyph",159),p(6," Add to dashboard "),d()()}if(i&2){let e=r(4).$implicit,n=r(4);l(),w("disabled",n.isStreaming()),l(2),h(n.previewAltLabel(e.charts[0])?3:-1),l(),w("disabled",n.isStreaming())}}function as(i,t){if(i&1){let e=k();s(0,"div",351),u("click",function(){_(e);let o=r(3).$implicit,a=r(4);return g(a.openArtifact(o.charts,o.id))}),s(1,"div",352),C(2,"nile-glyph",353),d(),s(3,"div",354)(4,"span",355),p(5),d(),s(6,"span",356),m(7,ns,3,0),p(8),d()(),s(9,"nile-button",22),u("click",function(o){_(e);let a=r(3).$implicit,c=r(4);return o.stopPropagation(),g(c.openArtifact(a.charts,a.id))}),p(10),C(11,"nile-glyph",357),d()(),m(12,os,7,3,"div",296)}if(i&2){let e=r(3).$implicit,n=r(4);l(5),b(e.dashboardTitle||e.charts[0].title),l(2),h(n.isPreviewChart(e.charts[0])?7:-1),l(),K(" Dashboard \xB7 ",e.charts.length," widget",e.charts.length!==1?"s":""," "),l(2),T(" ",n.copy().viewButton," "),l(2),h(e.charts.length===1&&n.isPreviewChart(e.charts[0])?12:-1)}}function rs(i,t){if(i&1){let e=k();s(0,"div",259),C(1,"nile-glyph",358),s(2,"span",359),p(3),d(),s(4,"button",360),u("click",function(){_(e);let o=r(3).$implicit,a=r(4);return g(a.recomputeStoredForecast(o))}),p(5),d()()}if(i&2){let e=r(3).$implicit,n=r(4);l(3),b(n.restoredForecastLabel(e)),l(),w("disabled",n.isStreaming()),l(),T(" ",n.copy().recomputeButton," ")}}function ls(i,t){if(i&1&&C(0,"nile-glyph",363),i&2){let e=r().$implicit;M("name",e.icon)("color",e.tone==="ai"?"#7a5af8":"var(--ng-colors-text-quaternary-500)")}}function ss(i,t){if(i&1&&(s(0,"span",365),p(1),d()),i&2){let e=r().$implicit;l(),b(e.badge)}}function ds(i,t){if(i&1){let e=k();s(0,"button",362),u("click",function(){let o=_(e).$implicit,a=r(4).$implicit,c=r(4);return g(c.onFollowUp(o,a))}),m(1,ls,1,2,"nile-glyph",363),s(2,"span",364),p(3),d(),m(4,ss,2,1,"span",365),d()}if(i&2){let e=t.$implicit,n=r(8);$("follow-up--ai",e.tone==="ai"),w("disabled",n.isStreaming()),l(),h(e.icon?1:-1),l(2),b(e.label),l(),h(e.badge?4:-1)}}function cs(i,t){if(i&1&&(s(0,"div",260),D(1,ds,5,6,"button",361,ko),d()),i&2){let e=r(3).$implicit;l(),O(e.followUps??pe(0,Se))}}function ps(i,t){if(i&1&&(s(0,"div",261),C(1,"nile-glyph",366),s(2,"span",367),p(3),d()()),i&2){let e=r(7);l(3),b(e.copy().errors.assistantErrorFallback)}}function _s(i,t){if(i&1&&(s(0,"nile-ai-chat-bubble",254)(1,"div",255),m(2,Rr,2,1),D(3,el,5,3,"div",256,j),m(5,tl,2,4,"button",257),m(6,ts,12,13,"div",258)(7,as,13,6),m(8,rs,6,3,"div",259),m(9,cs,3,1,"div",260),m(10,ps,4,1,"div",261),d()()),i&2){let e=r(2).$implicit,n=r(4);w("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 gs(i,t){if(i&1&&(m(0,Er,1,1,"nile-ai-steps",253),m(1,_s,11,9,"nile-ai-chat-bubble",254)),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 us(i,t){if(i&1&&(m(0,Or,5,4,"nile-ai-chat-bubble",238),m(1,gs,2,2)),i&2){let e=t.$implicit;h(e.role==="user"?0:-1),l(),h(e.role==="assistant"?1:-1)}}function ms(i,t){if(i&1&&D(0,us,2,2,null,null,te),i&2){let e=r(3);O(e.messages())}}function hs(i,t){if(i&1&&(s(0,"span",370),p(1),d()),i&2){let e=r(2);l(),Vt("",t," ",e.index+1," OF ",e.choices.length)}}function Cs(i,t){if(i&1&&(s(0,"span",370),p(1),d()),i&2){let e=r(2);l(),K("",e.index+1," OF ",e.choices.length)}}function fs(i,t){i&1&&(s(0,"span",384),p(1),d()),i&2&&(l(),b(t))}function xs(i,t){if(i&1&&(s(0,"span",386),p(1),d()),i&2){let e=r().$implicit;l(),b(e.hint)}}function bs(i,t){if(i&1){let e=k();s(0,"nile-radio",380),u("click",function(){_(e);let o=r(2),a=r(4);return g(a.onPanelSkip(o.msg))}),s(1,"span",381)(2,"span",382),p(3),d(),s(4,"span",383),m(5,fs,2,1,"span",384),s(6,"span",385),p(7),d(),m(8,xs,2,1,"span",386),d()()()}if(i&2){let e,n=t.$implicit,o=t.$index,a=r(2),c=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",c.isStreaming()?"":null),l(3),b(o+1),l(2),h((e=c.optionBadgeText(n))?5:-1,e),l(2),b(c.optionPrimaryText(n)),l(),h(!c.optionBadgeText(n)&&n.hint?8:-1)}}function ys(i,t){if(i&1){let e=k();s(0,"button",284),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",285),p(2),d()}if(i&2){let e=r(3),n=r(4);w("disabled",n.isStreaming()),l(2),T(' Preview "',n.choiceTitle(e.choices[e.index]),'" ')}}function vs(i,t){if(i&1){let e=k();s(0,"button",280),u("click",function(){_(e);let o=r(3),a=r(4);return g(a.requestPlan(o.msg,o.choices[o.index]))}),p(1),d()}if(i&2){let e=r(7);w("disabled",e.isStreaming()),l(),T(" ",e.copy().givePlanButton," ")}}function ws(i,t){if(i&1){let e=k();s(0,"div",278)(1,"button",280),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",283),p(3),d(),m(4,ys,3,2,"button",282),m(5,vs,2,2,"button",281),s(6,"button",387),u("click",function(){_(e);let o=r(2),a=r(4);return g(a.onPanelSkip(o.msg))}),p(7," Skip "),d()()}if(i&2){let e=r(2),n=r(4);l(),w("disabled",n.isStreaming()),l(2),T(" ",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 ks(i,t){if(i&1){let e=k();s(0,"div",279)(1,"div",287)(2,"nile-input",288),u("nile-input",function(o){_(e);let a=r(2),c=r(4);return g(c.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]))}),p(4),d()()()}if(i&2){let e=r(2),n=r(4);l(2),w("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(),T(" ",n.copy().defineItButton," ")}}function Ps(i,t){if(i&1){let e=k();s(0,"div",369),m(1,hs,2,3,"span",370)(2,Cs,2,2,"span",370),s(3,"div",371)(4,"button",372),u("click",function(){_(e);let o=r(),a=r(4);return g(a.onPanelPrev(o.msg))}),C(5,"nile-glyph",373),d(),s(6,"button",372),u("click",function(){_(e);let o=r(),a=r(4);return g(a.onPanelSkip(o.msg))}),C(7,"nile-glyph",374),d(),s(8,"button",375),u("click",function(){_(e);let o=r(),a=r(4);return g(a.dismissChoicePanel(o.msg))}),C(9,"nile-glyph",376),d()()(),s(10,"nile-radio-group",377),u("nile-change",function(o){_(e);let a=r(),c=r(4);return g(c.onChoiceChange(a.msg,a.choices[a.index],o.detail.value))}),D(11,bs,9,8,"nile-radio",378,te),d(),m(13,ws,8,5,"div",278)(14,ks,5,5,"div",279),s(15,"p",379),p(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 As(i,t){if(i&1&&(s(0,"li",389)(1,"span",391),p(2),d(),s(3,"span",392),p(4),d()()),i&2){let e=t.$implicit,n=r(6);l(2),b(n.choiceTitle(e)),l(2),b(n.panelAnswerLabel(e))}}function Ms(i,t){if(i&1){let e=k();s(0,"div",369)(1,"span",370),p(2,"READY TO SUBMIT"),d(),s(3,"button",375),u("click",function(){_(e);let o=r(),a=r(4);return g(a.dismissChoicePanel(o.msg))}),C(4,"nile-glyph",376),d()(),s(5,"ul",388),D(6,As,5,2,"li",389,j),d(),s(8,"div",390)(9,"button",372),u("click",function(){_(e);let o=r(),a=r(4);return g(a.onPanelPrev(o.msg))}),C(10,"nile-glyph",373),p(11," Back "),d(),s(12,"nile-button",22),u("click",function(){_(e);let o=r(),a=r(4);return g(a.submitChoices(o.msg))}),p(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(),T(" ",n.copy().submitAnswersButton," ")}}function Ss(i,t){if(i&1&&(s(0,"div",368),m(1,Ps,17,8)(2,Ms,14,2),d()),i&2){let e=t;l(),h(e.index<e.choices.length?1:2)}}function Ts(i,t){if(i&1&&(s(0,"div",228),m(1,Ss,3,1,"div",368),fe(2,213),d()),i&2){let e,n=r(3),o=le(8);l(),h((e=n.activeChoicePanel())?1:-1,e),l(),w("ngTemplateOutlet",o)}}function qs(i,t){if(i&1){let e=k();s(0,"nile-ai-chat",227,3),u("mouseup",function(o){_(e);let a=r(2);return g(a.onThreadMouseUp(o))}),m(2,Pr,11,0)(3,ms,2,0),m(4,Ts,3,2,"div",228),d()}if(i&2){let e=r(2);l(2),h(e.loadingConversation()?2:3),l(2),h(e.messages().length?4:-1)}}function Fs(i,t){if(i&1&&m(0,kr,12,4,"div",205)(1,qs,5,2,"nile-ai-chat",206),i&2){let e=r();h(!e.loadingConversation()&&!e.messages().length?0:1)}}function Ds(i,t){if(i&1&&(s(0,"div",394),C(1,"nile-glyph",401),s(2,"span"),p(3),d()()),i&2){let e=r(2);l(3),b(e.copy().dropFilesOverlay)}}function Os(i,t){if(i&1){let e=k();s(0,"div",395),C(1,"nile-glyph",32),s(2,"span",402),p(3),d(),s(4,"button",403),u("click",function(){_(e);let o=r(2);return g(o.clearReplyQuote())}),C(5,"nile-glyph",404),d()()}i&2&&(l(3),b(t))}function Es(i,t){i&1&&C(0,"nile-spinner",407)}function Is(i,t){if(i&1){let e=k();s(0,"button",410),u("click",function(){_(e);let o=r().$implicit,a=r(3);return g(a.retryAttachment(o.id))}),p(1,"Retry"),d()}}function Vs(i,t){if(i&1){let e=k();s(0,"div",406),C(1,"nile-glyph",251),s(2,"span",252),p(3),d(),m(4,Es,1,0,"nile-spinner",407)(5,Is,2,0,"button",408),s(6,"button",409),u("click",function(){let o=_(e).$implicit,a=r(3);return g(a.removeAttachment(o.id))}),C(7,"nile-glyph",404),d()()}if(i&2){let e=t.$implicit;$("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(),b(e.name),l(),h(e.status==="uploading"?4:e.status==="error"?5:-1)}}function Rs(i,t){if(i&1&&(s(0,"div",396),D(1,Vs,8,6,"div",405,te),d()),i&2){let e=r(2);l(),O(e.attachments())}}function zs(i,t){if(i&1){let e=k();s(0,"nile-button",411),u("click",function(){_(e),r();let o=le(5);return g(o.click())}),C(1,"nile-glyph",412),d()}if(i&2){let e=r(2);M("disabled",e.isStreaming()||e.attachAtCapacity()?"":null)}}function Ns(i,t){if(i&1){let e=k();s(0,"div",393),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,Ds,4,1,"div",394),m(2,Os,6,1,"div",395),m(3,Rs,3,0,"div",396),s(4,"input",397,5),u("change",function(o){_(e);let a=r();return g(a.onFilesPicked(o))}),d(),s(6,"nile-ai-prompt",398,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",399),u("click",function(o){return o.stopPropagation()}),m(9,zs,2,1,"nile-button",400),d()()()}if(i&2){let e,n=r();$("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),$("aq-attach-full",n.attachAtCapacity()),w("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 Ls(i,t){if(i&1){let e=k();s(0,"div",413),u("pointerdown",function(o){_(e);let a=r();return g(a.startChatResize(o))}),d()}if(i&2){let e=r();$("is-active",e.isResizing())}}function $s(i,t){if(i&1){let e=k();s(0,"div",429),C(1,"nile-glyph",430),s(2,"nile-slide-toggle",431),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);$("aq-filters-pill--active",e.artifactHasFilter()),l(2),w("isChecked",e.artifactHasFilter())}}function Ws(i,t){if(i&1){let e=k();s(0,"div",425)(1,"nile-button",432),u("click",function(){_(e);let o=r(3);return g(o.undoCanvas())}),C(2,"nile-glyph",433),p(3," Undo "),d(),s(4,"nile-button",434),u("click",function(){_(e);let o=r(3);return g(o.redoCanvas())}),C(5,"nile-glyph",435),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 Bs(i,t){if(i&1){let e=k();s(0,"div",415)(1,"div",420)(2,"span",421),p(3,"Preview"),d(),s(4,"span",422),p(5),d()(),s(6,"div",423),m(7,$s,3,3,"div",424),m(8,Ws,6,3,"div",425),C(9,"span",426),s(10,"nile-button",427),u("click",function(){_(e);let o=r(2);return g(o.closeArtifact())}),C(11,"nile-glyph",428),d()()()}if(i&2){let e=r(2);l(5),b(e.artifactSubtitle()),l(2),h(e.features().canvas.filters?7:-1),l(),h(e.features().canvas.undoRedo?8:-1)}}function Us(i,t){if(i&1&&(s(0,"div",417),C(1,"nile-glyph",436),s(2,"p",437),p(3),d(),s(4,"p",438),p(5),d()()),i&2){let e=r(2);l(3),b(e.copy().emptyCanvasTitle),l(2),b(e.copy().emptyCanvasSubtitle)}}function Gs(i,t){if(i&1){let e=k();s(0,"shared-dashboard-grid",439,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);w("widgets",e.artifactWidgets())("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 Hs(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",441),p(2),d()}if(i&2){let e=r(3);l(2),T(" ",e.copy().forecastButton," ")}}function js(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",442),p(2),d()}if(i&2){let e=r(3);M("disabled",e.committingAction()||!e.hasSelection()?"":null),l(2),T(" ",e.copy().addToStoryButton," ")}}function Ys(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())}),p(1),d()}if(i&2){let e=r(3);M("loading",e.committingAction()==="publish"?"":null)("disabled",e.committingAction()||!e.hasSelection()?"":null),l(),T(" ",e.copy().publishAsDashboardButton," ")}}function Ks(i,t){}function Qs(i,t){if(i&1&&(s(0,"div",45),p(1),d()),i&2){let e=r(4);l(),b(e.copy().noResultsMatchFilters)}}function Js(i,t){i&1&&fe(0)}function Xs(i,t){if(i&1){let e=k();s(0,"nile-menu-item",69),u("click",function(){let o=_(e).$implicit,a=r(6);return a.showAddPicker.set(!1),g(a.addToExistingDashboard(o.id))}),Pe(1,Js,1,0,"ng-container",350),d()}if(i&2){let e=t.$implicit;r(6);let n=le(38);l(),w("ngTemplateOutlet",n)("ngTemplateOutletContext",at(2,Ai,e))}}function Zs(i,t){if(i&1&&(s(0,"div",79),p(1),d(),D(2,Xs,2,4,"nile-menu-item",null,te)),i&2){let e=t.$implicit;l(),b(e.label),l(),O(e.items)}}function ed(i,t){if(i&1&&(s(0,"div",45),p(1),d()),i&2){let e=r(5);l(),b(e.copy().noDashboardsYet)}}function td(i,t){if(i&1&&D(0,Zs,4,1,null,null,re,!1,ed,2,1,"div",45),i&2){let e=r(4);O(e.groupedPickerDashboards())}}function nd(i,t){if(i&1){let e=k();s(0,"nile-dropdown",443),u("nile-hide",function(){_(e);let o=r(3);return g(o.showAddPicker.set(!1))}),s(1,"nile-button",349),u("click",function(){_(e);let o=r(3);return g(o.showAddPicker.set(!o.showAddPicker()))}),C(2,"nile-glyph",159),p(3),d(),s(4,"nile-menu",42),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",43),u("click",function(){_(e);let o=r(3);return o.showAddPicker.set(!1),g(o.addArtifactToDashboard())}),C(6,"nile-glyph",44),p(7),d(),m(8,Qs,2,1,"div",45)(9,td,3,1),d()()}if(i&2){let e=r(3);w("open",e.showAddPicker()),l(),M("loading",e.committingAction()==="add"?"":null)("disabled",e.committingAction()||!e.hasSelection()?"":null),l(2),T(" ",e.copy().addToDashboardButton," "),l(),M("noResultsMessage",e.copy().noResultsMatchFilters),l(3),T(" ",e.copy().newDashboardLabel," "),l(),h(e.pickerSearchEmpty()?8:9)}}function id(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",159),p(2),d()}if(i&2){let e=r(3);M("loading",e.committingAction()==="add"?"":null)("disabled",e.committingAction()||!e.hasSelection()?"":null),l(2),T(" ",e.builderOpen()?e.copy().addToCurrentDashboardButton:e.copy().addToDashboardButton," ")}}function od(i,t){if(i&1&&(s(0,"div",419),m(1,Hs,3,1,"nile-button",204),m(2,js,3,2,"nile-button",204),m(3,Ys,2,3,"nile-button",204),m(4,Ks,0,0)(5,nd,10,7,"nile-dropdown",440)(6,id,3,3,"nile-button",347),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.nonAutoDashboards().length>1?5:6:4)}}function ad(i,t){if(i&1&&(s(0,"aside",414),m(1,Bs,12,3,"div",415),s(2,"div",416),m(3,Us,6,2,"div",417)(4,Gs,2,26,"shared-dashboard-grid",418),d(),m(5,od,7,4,"div",419),fe(6,213),d()),i&2){let e=r(),n=le(33);$("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(),w("ngTemplateOutlet",n)}}function rd(i,t){i&1&&C(0,"nile-spinner",455)}function ld(i,t){i&1&&C(0,"nile-glyph",456)}function sd(i,t){if(i&1){let e=k();s(0,"input",452),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",453)(2,"button",454),u("click",function(){_(e);let o=r(2);return g(o.commitDashboardTitle())}),m(3,rd,1,0,"nile-spinner",455)(4,ld,1,0,"nile-glyph",456),d()()}if(i&2){let e=r(2);w("value",e.dashboardTitleDraft()),l(2),w("disabled",e.renamingDashboard()),l(),h(e.renamingDashboard()?3:4)}}function dd(i,t){i&1&&C(0,"nile-skeleton-loader",446)}function cd(i,t){if(i&1){let e=k();s(0,"nile-lite-tooltip",458)(1,"button",459),u("click",function(){_(e);let o=r(3);return g(o.startEditDashboardTitle())}),C(2,"nile-glyph",460),d()()}}function pd(i,t){if(i&1&&(s(0,"span",457),p(1),d(),m(2,cd,3,0,"nile-lite-tooltip",458)),i&2){let e=r(2);l(),b((e.builderRef==null?null:e.builderRef.dashboardName())||"Dashboard"),l(),h(e.builderDashboardId()?2:-1)}}function _d(i,t){if(i&1){let e=k();s(0,"section",17)(1,"header",444)(2,"div",33)(3,"nile-button",427),u("click",function(){_(e);let o=r();return g(o.closeBuilder())}),C(4,"nile-glyph",445),d(),m(5,sd,5,3)(6,dd,1,0,"nile-skeleton-loader",446)(7,pd,3,2),d(),s(8,"div",35)(9,"nile-lite-tooltip",447)(10,"button",448),u("click",function(){_(e);let o=r();return g(o.toggleBuilderFullscreen())}),C(11,"nile-glyph",449),d()(),s(12,"shared-builder-toolbar",450),u("action",function(o){_(e);let a=r();return g(a.onBuilderMenuAction(o))}),d()()(),s(13,"shared-builder-host",451),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,213),d()}if(i&2){let e=r(),n=le(33);l(5),h(e.editingDashboardTitle()?5:e.builderRef!=null&&e.builderRef.loading()?6:7),l(4),w("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(),w("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)("showPromptGallery",!1),l(),w("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(),w("ngTemplateOutlet",n)}}function gd(i,t){if(i&1){let e=k();s(0,"label",471)(1,"input",472),u("change",function(){let o=_(e).$implicit,a=r(3);return g(a.onGranularityPick(o))}),d(),s(2,"span"),p(3),d()()}if(i&2){let e=t.$implicit,n=r(2);$("fs-segment--on",n.granularity===e.value)("fs-segment--off",!e.enabled),M("title",e.reason||null),l(),w("value",e.value)("checked",n.granularity===e.value)("disabled",!e.enabled),l(2),b(e.value)}}function ud(i,t){i&1&&(s(0,"p",465),p(1),d()),i&2&&(l(),b(t))}function md(i,t){if(i&1&&(s(0,"p",465),p(1),d()),i&2){let e=r();l(),b(e.granularityNote)}}function hd(i,t){if(i&1&&(s(0,"div",461)(1,"span",473),p(2,"Model"),d(),s(3,"div",474)(4,"p",475),p(5),d(),s(6,"p",476),p(7),d()()()),i&2){let e=t;l(5),b(e.title),l(2),b(e.body)}}function Cd(i,t){if(i&1&&(s(0,"div",461)(1,"span",473),p(2,"Guardrails"),d(),s(3,"div",477)(4,"p",475),C(5,"nile-glyph",478),p(6),d(),s(7,"p",476),p(8),d()()()),i&2){let e=t;l(3),$("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(),T(" ",e.title," "),l(2),b(e.body)}}function fd(i,t){if(i&1){let e=k();s(0,"div",461)(1,"label",462),p(2," Horizon \u2014 "),s(3,"span",463),p(4),d()(),s(5,"input",464),u("input",function(o){_(e);let a=r(2);return g(a.onHorizonInput(o.target.value))}),d(),s(6,"p",465),p(7),d()(),s(8,"div",461)(9,"span",466),p(10,"Granularity"),d(),s(11,"div",467),D(12,gd,4,9,"label",468,tt),d(),m(14,ud,2,1,"p",465)(15,md,2,1,"p",465),d(),s(16,"div",461)(17,"label",469),p(18," Confidence interval \u2014 "),s(19,"span",463),p(20),d()(),s(21,"input",470),u("input",function(o){_(e);let a=r(2);return g(a.onConfidenceIndexInput(o.target.value))}),d(),s(22,"p",465),p(23),d()(),m(24,hd,8,2,"div",461),m(25,Cd,9,8,"div",461)}if(i&2){let e,n,o,a=t,c=r(),f=r();l(4),K("",c.horizon," ",f.horizonUnit()),l(),Z("--fs-fill",f.horizonFill()),w("value",c.horizon),M("max",f.horizonMax())("aria-valuetext",c.horizon+" "+f.horizonUnit()),l(2),b(f.horizonNote()),l(5),O(f.granularityChoices()),l(2),h((e=f.unavailableGranularityNote())?14:15,e),l(6),T("",c.confidence,"%"),l(),Z("--fs-fill",f.confidenceFill()),w("value",f.confidenceIndex()),M("max",a.confidenceLevels.length-1)("aria-valuetext",c.confidence+"%"),l(2),b(a.confidenceNote),l(),h((n=a.modelCard)?24:-1,n),l(),h((o=a.guardrails)?25:-1,o)}}function xd(i,t){if(i&1&&m(0,fd,26,18),i&2){let e,n=r();h((e=n.forecastCopy())?0:-1,e)}}function bd(i,t){if(i&1&&(s(0,"div",482),C(1,"nile-skeleton-loader",483),s(2,"div",484),C(3,"nile-skeleton-loader",77),d()()),i&2){let e=t.$implicit;l(2),Z("width",e,"px")}}function yd(i,t){if(i&1&&(s(0,"div",480),D(1,bd,4,2,"div",482,j),d()),i&2){let e=r(2);l(),O(e.gallerySkeletonRows)}}function vd(i,t){if(i&1){let e=k();s(0,"nile-ai-prompts",485),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);w("items",e.galleryPromptItems())("vertical",!0)("wrap",!0)}}function wd(i,t){if(i&1&&(s(0,"div",127),p(1),d()),i&2){let e=r(2);l(),K("",e.copy().noPromptsMatch,' "',e.gallerySearch(),'".')}}function kd(i,t){if(i&1&&(s(0,"div",127),p(1),d()),i&2){let e=r(2);l(),b(e.copy().noPromptsYet)}}function Pd(i,t){if(i&1){let e=k();s(0,"nile-input",479),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",108),d(),m(2,yd,3,0,"div",480)(3,vd,1,3,"nile-ai-prompts",481)(4,wd,2,2,"div",127)(5,kd,2,1,"div",127)}if(i&2){let e=r();w("placeholder",e.copy().promptGallerySearchPlaceholder)("value",e.gallerySearch()),l(2),h(e.suggestionsLoading()?2:e.filteredGalleryPrompts().length?3:e.gallerySearch().trim()?4:5)}}function Ad(i,t){i&1&&(s(0,"nile-breadcrumb-item"),p(1),d()),i&2&&(l(),T(" ",t," "))}function Md(i,t){i&1&&p(0),i&2&&T(" ",t," ")}function Sd(i,t){i&1&&C(0,"nile-skeleton-loader",489)}function Td(i,t){if(i&1&&(s(0,"p",491),p(1),d()),i&2){let e=r(3);l(),b(e.cohortDetailCaption())}}function qd(i,t){if(i&1&&C(0,"nile-skeleton-loader",498),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 Fd(i,t){if(i&1&&(s(0,"div",496),D(1,qd,1,8,"nile-skeleton-loader",497,j),d()),i&2){let e=r(4);Z("height",e.widgetDetailPanelSkeletonHeight(),"px"),l(),O(e.widgetDetailPanelSkeletonSlots())}}function Dd(i,t){i&1&&(s(0,"div",495)(1,"div",499),C(2,"nile-skeleton-loader",500)(3,"nile-skeleton-loader",500)(4,"nile-skeleton-loader",500),d(),C(5,"nile-skeleton-loader",501),d())}function Od(i,t){if(i&1&&m(0,Fd,3,2,"div",494)(1,Dd,6,0,"div",495),i&2){let e=r(3);h(e.widgetDetailPanelSkeletonSlots().length?0:1)}}function Ed(i,t){if(i&1){let e=k();s(0,"shared-dashboard-grid",502),u("selectionChange",function(o){_(e);let a=r(3);return g(a.widgetDetailPanelSelectedIds.set(o))}),d()}if(i&2){let e=r(3);w("widgets",e.widgetDetailPanelWidgets())("editMode",!1)("selectable",e.widgetDetailPanelKind()==="dashboard")("selectedWidgetIds",e.widgetDetailPanelSelectedIds())("canSetAlert",!1)("canAddToStory",!1)("canForecast",!1)("showWidgetMenu",!1)}}function Id(i,t){if(i&1){let e=k();s(0,"div",493)(1,"span",503),p(2),d(),s(3,"nile-button",21),u("click",function(){_(e);let o=r(3);return g(o.toggleSelectAllDetailPanelWidgets())}),p(4),d(),s(5,"nile-button",21),u("click",function(){_(e);let o=r(3);return g(o.addSelectedDetailPanelWidgetsToCanvas())}),C(6,"nile-glyph",504),p(7),d(),s(8,"nile-button",22),u("click",function(){_(e);let o=r(3);return g(o.replaceCanvasWithDetailPanel())}),C(9,"nile-glyph",505),p(10," Replace canvas "),d()()}if(i&2){let e=r(3);l(2),K(" ",e.widgetDetailPanelSelectedIds().length," of ",e.widgetDetailPanelWidgets().length," selected "),l(2),T(" ",e.isDetailPanelFullySelected()?"Deselect all":"Select all"," "),l(),M("disabled",e.widgetDetailPanelSelectedIds().length?null:""),l(2),T(" Add ",e.widgetDetailPanelSelectedIds().length," to canvas "),l(),M("disabled",e.widgetDetailPanelWidgets().length?null:"")}}function Vd(i,t){if(i&1){let e=k();s(0,"div",493)(1,"nile-button",22),u("click",function(){_(e);let o=r(3);return g(o.exportCohortRowsCsv())}),C(2,"nile-glyph",506),p(3),d(),s(4,"nile-button",21),u("click",function(){_(e);let o=r(3);return g(o.copyCohortDefinition())}),C(5,"nile-glyph",507),p(6),d()()}if(i&2){let e=r(3);l(),M("disabled",e.detailPanelCohortData()?null:""),l(2),T(" ",e.copy().cohortExportRowsButton," "),l(),M("disabled",e.detailPanelCohortData()?null:""),l(2),T(" ",e.copy().cohortCopyDefinitionButton," ")}}function Rd(i,t){if(i&1){let e=k();s(0,"div",493)(1,"nile-button",22),u("click",function(){_(e);let o=r(3);return g(o.addWidgetTemplateFromDetailPanel())}),C(2,"nile-glyph",159),p(3," Add to dashboard "),d()()}}function zd(i,t){if(i&1){let e=k();s(0,"div",486)(1,"div",487)(2,"nile-breadcrumb",488),u("nile-click",function(){_(e);let o=r(2);return g(o.closeWidgetDetailPanel())}),s(3,"nile-breadcrumb-item"),p(4),d(),m(5,Ad,2,1,"nile-breadcrumb-item"),s(6,"nile-breadcrumb-item"),m(7,Md,1,1)(8,Sd,1,0,"nile-skeleton-loader",489),d()()(),s(9,"div",490),m(10,Td,2,1,"p",491),m(11,Od,2,1)(12,Ed,1,8,"shared-dashboard-grid",492),d(),m(13,Id,11,6,"div",493)(14,Vd,7,4,"div",493)(15,Rd,4,0,"div",493),d()}if(i&2){let e,n,o=r(2);l(4),T(" ",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 Nd(i,t){if(i&1&&m(0,zd,16,6,"div",486),i&2){let e=r();h(e.widgetDetailPanelOpen()?0:-1)}}function Ld(i,t){if(i&1){let e=k();s(0,"app-alert-drawer",508),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();w("open",n.alertDrawerOpen())("widget",n.alertWidget())("dashboardId",null)("source",n.alertSource())("sourceName",((e=n.selectedScope())==null?null:e.name)??"")("authoringMode","chat")}}function $d(i,t){i&1&&C(0,"nile-executive-summary",29,8)}function Wd(i,t){if(i&1){let e=k();s(0,"app-story-picker-drawer",509),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();w("open",e.storyPickerOpen())("widget",e.storyPickerWidget())}}function Bd(i,t){if(i&1&&(s(0,"div",74),C(1,"nile-glyph",95),s(2,"div",76)(3,"span",88),p(4),d(),s(5,"span",89),p(6),d()()()),i&2){let e=t.$implicit,n=r();l(3),w("title",e.name||"Untitled"),l(),b(e.name||"Untitled"),l(2),b(n.dashboardMeta(e))}}function we(){return Math.random().toString(36).slice(2)}function Ud(i){if(!i.length)return i;let t=new Map;for(let a of i){let c=t.get(a.y)??[];c.push(a),t.set(a.y,c)}let e=[...t.keys()].sort((a,c)=>a-c),n=[],o=0;for(let a of e){let c=t.get(a);for(let f of c)n.push(S(v({},f),{y:o}));o+=Math.max(...c.map(f=>f.h))}return n}var Gd=4,Hd="forecast-settings",jd="forecast-this";function Ti(i){return i.split(`
|
|
7
|
+
`).map(t=>{let e=/^For "[^"]+":\s*(.*)$/.exec(t);return e?e[1]:t}).join(`
|
|
8
|
+
`)}function ki(i){return{id:i.id,role:i.role,text:i.role==="user"?Ti(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 Fe=class i{alertDrawerOpen=x(!1);alertWidget=x(null);onSetAlert(t){this.alertWidget.set(t),this.alertDrawerOpen.set(!0)}onAlertClosed(){this.alertDrawerOpen.set(!1)}alertSource=F(()=>{let t=_t(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(S(v({},this.artifactToWidget(t)),{id:"chat-alert"})))}aqChatEl;builderRef;artifactGridRef;composerRef;aiExecutiveSummaryEl;svc=N(me);tokenStore=N(oe);features(){return I().features}widgetMenu(){return I().features.widgetMenu}copy(){return I().copy}showHeader(){return I().ui.header}withCount(t,e){return Gn(t,e)}zone=N(Ft);appRef=N(Et);route=N(Jt);router=N(Xt);dashboardState=N(_n);publishRepo=N(ue);globalWidget=N(Nn);forecastApi=N(Xe);cohort=N(Me);forecastService=N(un);loading=x(!0);conversations=x([]);activeConversationId=x(null);conversationCustomerId=x(null);conversationConnectionId=x(null);messages=x([]);inputText=x("");isStreaming=x(!1);streamAbort=null;suggestions=x([]);suggestionsLoading=x(!0);suggestionsSeq=0;showConversationPicker=x(!1);showRelatedDashboards=x(!1);loadingConversation=x(!1);editingTitle=x(!1);titleDraft=x("");editingDashboardTitle=x(!1);dashboardTitleDraft=x("");renamingDashboard=x(!1);conversationsLoading=x(!0);dashboardsLoading=x(!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=x(!1);committingAction=x(null);conversationDashboards=x([]);nonAutoDashboards=F(()=>this.conversationDashboards().filter(t=>!t.isAutoGenerated));showAddPicker=x(!1);inlinePickerFor=x(null);inlineChartTypePickerFor=x(null);inlineChartTypeOptions=x([]);inlineChartTypeLoading=x(!1);inlineChartTypePickerSeq=0;inlineChartTypeApplying=x(!1);inlineChartTypeError=x(null);inlineFilterPickerFor=x(null);showScopePicker=x(!1);datasets=x([]);pipelines=x([]);scopeLoading=x(!1);selectedScope=x(null);scopeListsLoaded=!1;saveDialogOpen=x(!1);saveDashboardName=x("");chatPaneTab=x("chat");tabsVisible=F(()=>Kn(this.features()));cohortCriteria=x([]);selectedCriterionId=x(null);cohortPreview=x(null);cohortCriteriaLoaded=!1;cohortCriteriaLoading=x(!1);cohortCriteriaError=x(null);cohortPreviewLoading=x(!1);cohortPreviewError=x(null);cohortCriteriaSkeletonRows=[0,1,2,3];cohortMatchSkeletonRows=[0,1,2];cohortMatchesExpanded=x(!1);cohortAllMatches=x(null);cohortMembersLoading=x(!1);cohortMembersError=x(null);static COHORT_MEMBER_LIMIT=100;visibleCohortMatches=F(()=>ti(this.cohortPreview(),this.cohortAllMatches(),this.cohortMatchesExpanded()));cohortNamesWithheld=F(()=>xt(this.cohortPreview()));cohortHasMoreMatches=F(()=>ei(this.cohortPreview()));cohortMatchesTruncated=F(()=>ni(this.cohortPreview(),this.cohortAllMatches()));cohortMatchesTruncatedNote=F(()=>{let t=this.cohortPreview(),e=this.cohortAllMatches();return!t||!e?"":this.copy().cohortMatchesTruncatedNote.replace("{shown}",String(e.length)).replace("{matchCount}",String(t.matchCount))});cohortMatchSummary=F(()=>{let t=this.cohortPreview();return t?this.copy().cohortMatchSummary.replace("{matchCount}",String(t.matchCount)).replace("{totalCount}",String(t.totalCount)):""});cohortViewAllLabel=F(()=>{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=Zn(t);this.bucketExtraCharts.update(o=>[...o,n]),this.ensureArtifactPaneOpen()}setChatPaneTab(t){Yn(t,this.features())&&(this.chatPaneTab.set(t),(t==="library"||t==="tools")&&this.ensureArtifactPaneOpen(),t==="library"&&this.prefetchWidgetTemplateCatalog(),t==="tools"&&this.loadCohortCriteria())}galleryOpen=x(!1);gallerySearch=x("");templateCategories=x([]);templateAllTemplates=x([]);templateCategoriesLoading=x(!1);templateTemplatesLoading=x(!1);templateActiveCategory=x("all");widgetTemplateAllTemplates=x([]);widgetTemplateTemplatesLoading=x(!1);widgetTemplateActiveCategory=x("all");selectWidgetTemplateCategory(t){this.widgetTemplateActiveCategory.set(t)}widgetTemplatePickerSelectedIds=x([]);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=x("");libraryKpiChartOptions={exporting:{enabled:!1},credits:{enabled:!1}};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=F(()=>{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(c=>a.delete(c)):e.forEach(c=>a.add(c)),[...a]})}openWidgetDetailFromCard(t){let e=this.widgetTemplatePreviews().get(t);if(!e)return;let n=S(v({},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 c=()=>delete a.dataset.vtDirection;n.startViewTransition(()=>{t(),this.appRef.tick()})?.finished?.then(c,c)??c()}artifactPickerTab=x("kpis");templateCountForCategory(t){return this.templateAllTemplates().filter(e=>e.category===t).length}libraryDashboardGroups=F(()=>{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=x(new Map);widgetTemplateSourceId=x(null);widgetDetailPanelOpen=x(!1);widgetDetailPanelLoading=x(!1);widgetDetailPanelTitle=x(null);widgetDetailPanelRaw=x([]);widgetDetailPanelTemplateId=x(null);widgetDetailPanelCanAdd=x(!1);widgetDetailPanelKind=x("widget");widgetDetailPanelSourceWidgetTitle=x(null);detailPanelWidgetCrumb=F(()=>this.widgetDetailPanelKind()==="widget"?this.widgetDetailPanelSourceWidgetTitle():null);detailPanelLastCrumb=F(()=>{let t=this.widgetDetailPanelTitle();return t?t===this.detailPanelWidgetCrumb()?this.copy().detailCrumbLabel:t:null});widgetDetailPanelSelectedIds=x([]);widgetDetailPanelSourceTemplateId=x(null);detailPanelCohortId=x(null);detailPanelCohortData=x(null);cohortDetailCaption=F(()=>{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=x([]);widgetDetailPanelSkeletonHeight=F(()=>{let t=this.widgetDetailPanelSkeletonSlots();return t.length?Math.max(...t.map(e=>(e.y+e.h)*72)):0});widgetDetailPanelWidgets=F(()=>{let t=this.widgetDetailPanelRaw().map((e,n)=>S(v({},this.artifactToWidget(e)),{id:`detail-panel-${n}`}));return st(t)});filteredGalleryPrompts=F(()=>{let t=this.gallerySearch().trim().toLowerCase(),e=this.suggestions();return t?e.filter(n=>n.toLowerCase().includes(t)):e});welcomePromptCards=F(()=>{let t=this.forecastContext();return this.suggestions().slice(0,Gd).map(e=>(I().features.forecast&&t?!!vt(e,t):!1)?{label:e,icon:"ng-stars-02",badge:"FORECAST",tone:"ai"}:{label:e,icon:"ng-lightbulb-05",tone:"plain"})});galleryPromptItems=F(()=>this.filteredGalleryPrompts().map(t=>({key:t,label:t,icon:"ng-lightbulb-05"})));artifactSourceMsgId=x(null);activeArtifactRaw=x([]);artifactForcedOpen=x(!1);templateSourceId=x(null);bucketExtraCharts=x([]);activeArtifact=F(()=>{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=F(()=>this.artifactForcedOpen()||this.activeArtifact().length>0);dslOnlyArtifact=x(!1);CANVAS_HISTORY_LIMIT=25;canvasUndoStack=x([]);canvasRedoStack=x([]);canUndoCanvas=F(()=>this.canvasUndoStack().length>0);canRedoCanvas=F(()=>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=F(()=>{let t=this.mostRecentDashboardTitle();return t||(this.activeArtifact().find(n=>!this.isFilterChart(n))?.title??this.activeArtifact()[0]?.title??"Untitled canvas")});artifactSubtitle=F(()=>{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 ze({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=F(()=>{let t=this.artifactSourceMsgId()??"artifact",e=this.activeArtifact().map((o,a)=>S(v({},this.artifactToWidget(o)),{id:`${t}-${a}`})),n=st(e);return pn(n)});filterOverlay=x(new Map);forecastOverlay=x(new Map);artifactForecastable=x({});artifactForecastingId=x(null);artifactWidgets=F(()=>{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),c=a?S(v({},o),{config:a.config,edited:a.edited}):o,f=n.get(o.id);return f?S(v({},c),{config:f}):c})});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=x(!1);activeDashboardFilters=x(null);activeResolvedFilters=x(null);applySummary=x(null);filterExplanation=x(null);applyFiltersSeq=0;applyFiltersAbort=null;filterSuggestCache=new Map;filterSuggestInflight=new Set;selectedWidgetIds=x([]);hasSelection=F(()=>this.features().canvas.widgetSelection?this.selectedWidgetIds().length>0:this.artifactWidgets().length>0);selectedArtifactCharts=F(()=>{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=F(()=>{let t=this.features().canvas;return t.publishAsDashboard||t.addToDashboard||!!this.artifactForecastMsg()});builderOpen=x(!1);detailRootCrumb=F(()=>this.builderOpen()?this.builderRef?.dashboardName?.()?.trim()||this.copy().detailDashboardCrumbLabel:this.copy().detailCanvasCrumbLabel);builderDashboardId=x(null);builderPreseeded=x(!1);builderFullscreen=x(!1);chatPaneWidth=x(null);isResizing=x(!1);layoutMode=F(()=>jn({hasMessages:this.messages().length>0,artifactOpen:this.artifactOpen()&&!this.dslOnlyArtifact(),builderOpen:this.builderOpen()}));chatPaneStyleWidth=F(()=>{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=x([]);uploadsInFlight=F(()=>this.attachments().some(t=>t.status==="uploading"));excelCount=F(()=>this.attachments().filter(t=>Ct(t.name,t.contentType)).length);nonExcelCount=F(()=>this.attachments().length-this.excelCount());attachAtCapacity=F(()=>this.nonExcelCount()>=mt&&this.excelCount()>=ht);acceptUploadTypes=[...ut,".xls",".xlsx"].join(",");dragDepth=0;isDraggingFile=x(!1);canSend=F(()=>{let t=this.inputText().trim().length>0,e=this.attachments().some(n=>n.status==="ready");return(t||e)&&!this.isStreaming()&&!this.uploadsInFlight()});quoteBadge=x(null);replyQuote=x(null);activeConversation=F(()=>this.conversations().find(t=>t.id===this.activeConversationId())??null);forecastTitle=x(null);activeConversationTitle=F(()=>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(c=>{if(a!==this.suggestionsSeq)return;let f=[...c.widgetSuggestions??[],...c.conversationStarters??[]];this.suggestions.set(f.length?f: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&&Lt(()=>{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(){try{this.conversationsLoading.set(!0);let e=await this.svc.listConversations().catch(()=>[]);this.conversations.set(e)}finally{this.conversationsLoading.set(!1),this.loading.set(!1)}this.loadConversationDashboards(),this.prefetchTemplateCatalog();let t=this.route.snapshot.paramMap.get("id");t&&(this.builderPreseeded.set(!1),this.builderDashboardId.set(t),this.builderOpen.set(!0),this.route.snapshot.queryParamMap.get("summary")==="1"?this.onExecutiveSummary(t).then(()=>{this.router.navigate([],{relativeTo:this.route,queryParams:{},replaceUrl:!0})}):this.restoreThreadForDashboard(t))}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(c=>c.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(ki)),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 _t(this.selectedScope())??{}}closeScopeMenu(){this.showScopePicker.set(!1)}async selectConversation(t){if(this.showConversationPicker.set(!1),t!==this.activeConversationId()){this.loading.set(!0),this.loadingConversation.set(!0);try{let e=await this.svc.getConversation(t);if(!e)return;this.activeConversationId.set(t),this.conversationCustomerId.set(this.customerId()),this.conversationConnectionId.set(e.conversation.connectionId??null),this.messages.set(e.messages.map(ki)),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(S(v({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=x("");dashSearch=x("");renamingId=x(null);renameDraft=x("");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,c)=>new Date(e(c)??0).getTime()-new Date(e(a)??0).getTime());for(let a of i.BUCKETS){let c=o.filter(f=>this.daysAgo(e(f))<=a.maxDays);if(c.length&&n.push({key:a.key,label:this.bucketLabel(a.key),items:c}),o=o.filter(f=>this.daysAgo(e(f))>a.maxDays),!o.length)break}return n}matches(t,e){return e?(t??"").toLowerCase().includes(e.toLowerCase()):!0}groupedConversations=F(()=>this.groupByRecency(this.conversations().filter(t=>this.matches(t.title,this.convSearch())),t=>t.updatedAt));groupedDashboards=F(()=>this.groupByRecency(this.nonAutoDashboards().filter(t=>this.matches(t.name,this.dashSearch())),t=>t.updatedAt));pickerSearch=x("");groupedPickerDashboards=F(()=>this.groupByRecency(this.nonAutoDashboards().filter(t=>this.matches(t.name,this.pickerSearch())),t=>t.updatedAt));pickerSearchEmpty=F(()=>!!this.pickerSearch()&&this.groupedPickerDashboards().length===0);convSearchEmpty=F(()=>!!this.convSearch()&&this.groupedConversations().length===0);dashSearchEmpty=F(()=>!!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?S(v({},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?S(v({},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?S(v({},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=Ct(t.name,t.type);if(e&&this.excelCount()>=ht||!e&&this.nonExcelCount()>=mt||!e&&!ut.includes(t.type)||t.size>Hn||this.attachments().some(f=>f.name===t.name&&f.size===t.size&&f.file?.lastModified===t.lastModified))return;let o=we(),a=new AbortController,c={id:o,name:t.name,contentType:t.type,size:t.size,status:"uploading",progress:0,file:t,abort:a};this.attachments.update(f=>[...f,c]),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?v(v({},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(c=>c===e?S(v({},c),{draftSelection:o.id,chatOpen:!1,chatDraftText:void 0}):c)})):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?S(v({},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 c=a.chatDraftText?.trim();if(c)return e.push(this.chatDraftReply(a,c)),n.push(`${this.choiceTitle(a)}: ${c}`),S(v({},a),{selected:"__chat__",draftSelection:void 0,chatOpen:!1});if(!a.draftSelection)return a;let f=a.options.find(y=>y.id===a.draftSelection);return f&&(e.push(f.reply??f.label),n.push(`${this.choiceTitle(a)}: ${f.label}`)),S(v({},a),{selected:a.draftSelection,draftSelection:void 0})})})),e.length&&(this.inputText.set(e.join(`
|
|
9
|
+
`)),this.pendingDisplayOverride=n.join(`
|
|
10
|
+
`),this.sendMessage())}answerSummaryRows(t){return(t.text??"").split(`
|
|
11
|
+
`).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?S(v({},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?S(v({},o),{chatOpen:!0,draftSelection:void 0}):o)}))}onChatDraftTextChange(t,e,n){this.updateAssistantMsg(t.id,o=>({choices:(o.choices??[]).map(a=>a===e?S(v({},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?S(v({},a),{chatOpen:!1}):a)}));return}this.updateAssistantMsg(t.id,o=>({choices:(o.choices??[]).map(a=>a===e?S(v({},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(q=>q instanceof HTMLElement&&q.classList.contains("reply-badge")))return;let n=document.getSelection(),o=n?.toString().trim()??"",a=e.some(q=>q instanceof HTMLElement&&q.classList.contains("assistant-text"));if(!n||!o||!a){this.quoteBadge.set(null);return}let c=46,f=Math.min(Math.max(t.clientX,c+8),window.innerWidth-c-8),A=t.clientY>=34;this.quoteBadge.set({text:o,top:t.clientY,left:f,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=x(null);lastForecastRequest=null;forecastChartMsgId=null;forecastTurnMsgId=null;routeForecastIntent(t){let e=this.forecastContext();if(!e)return!1;let n=I().features.forecast?vt(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=_i(t.charts[0]?.config);if(!a.length)return!1;let c={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},f=t.charts[0]?.config??{};return this.runForecast(e,c,{queryMeta:f.queryMeta,dataSourceId:f.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=St(t);return t.isStreaming||this.forecastableMsgs.set(t.id,n),n}artifactForecastMsg=F(()=>{let t=this.artifactSourceMsgId();if(!t||!this.forecastContext())return null;let e=this.messages().find(n=>n.id===t);return e&&St(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)&&et(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=Mt(o,e.series??[]);this.lastForecastRequest=S(v({},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=q=>!!q&&this.messages().some(P=>P.id===q);if(o.inPlace&&a(this.forecastChartMsgId)){let q=this.messages().find(P=>P.id===this.forecastChartMsgId)?.charts[0]?.config??{};return this.recomputeForecastInPlace(this.forecastChartMsgId,e,{queryMeta:n.queryMeta??q.queryMeta,dataSourceId:n.dataSourceId??q.dataSourceId})}let c=a(o.chartMsgId??null)?o.chartMsgId:null;this.inputText.set("");let f={id:we(),role:"user",text:t,charts:[],isStreaming:!1,hasError:!1},y=we(),A={id:"forecast",callIds:["forecast"],pending:1,baseLabel:"Forecasting",label:"Forecasting",status:"running"};this.messages.update(q=>[...q,f,{id:y,role:"assistant",text:"",thinking:"Forecasting",charts:[],isStreaming:!0,hasError:!1,animate:!0,forecast:!0,tools:[A]}]),this.isStreaming.set(!0),this.scrollToBottom();try{let q=await this.forecastApi.compute(v(v({},e),this.activeConversationId()?{conversationId:this.activeConversationId(),prompt:t}:{})),P=Mt(q,e.series??[]);this.lastForecastRequest=v(v(S(v({},e),{horizon:P.horizon,granularity:P.granularity,confidence:P.confidence}),q.historyQuery?.sql?{historySql:q.historyQuery.sql}:{}),q.cohortQuery?.sql?{cohortSql:q.cohortQuery.sql}:{}),this.appliedForecastSettings.set({horizon:P.horizon,granularity:P.granularity,confidence:P.confidence}),this.forecastMaxHorizon.set(P.maxHorizon),this.forecastFitted.set({periods:q.fittedPeriods,granularity:q.sourceGranularity}),this.forecastGuardrails.set(q.guardrails),this.forecastModelCard.set(q.modelCard),q.conversationTitle&&this.forecastTitle.set(q.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},X=c??y;if(this.forecastChartMsgId=X,this.forecastTurnMsgId=y,c){let Q=this.messages().find(U=>U.id===c);this.updateAssistantMsg(c,v({charts:[z],forecastMeta:P.meta,forecast:!0},Q?.preForecastCharts?.length?{}:{preForecastCharts:Q?.charts??[]})),this.updateAssistantMsg(y,{isStreaming:!1,thinking:void 0,tools:[],text:P.answer,followUps:q.followUps})}else this.updateAssistantMsg(y,{isStreaming:!1,thinking:void 0,tools:[],text:P.answer,charts:[z],forecastMeta:P.meta,followUps:q.followUps});this.isStreaming.set(!1),this.scrollToBottom()}catch(q){let P=q;P?.isRefusal&&P.message?this.updateAssistantMsg(y,{isStreaming:!1,thinking:void 0,tools:[],text:P.message}):(console.error("[ask-aquera] forecast failed",q),this.updateAssistantMsg(y,{isStreaming:!1,thinking:void 0,tools:[],hasError:!0})),this.isStreaming.set(!1)}}refineForecast(t,e){let n=this.lastForecastRequest;if(!n)return;let o=S(v(v({},n),t),{filters:v(v({},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===jd){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===Hd){this.openForecastSettings();return}}forecastSettingsOpen=x(!1);forecastDraft=x(null);appliedForecastSettings=x(null);forecastMaxHorizon=x(null);forecastGuardrails=x(null);forecastModelCard=x(null);forecastFitted=x(null);granularityChoices=F(()=>{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 Ci(o,a,e.granularityOptions)});draftGranularity=F(()=>{let t=this.forecastDraft()?.granularity,e=this.granularityChoices();return e.find(n=>n.value===t)??e.find(n=>n.enabled)??null});horizonUnit=F(()=>{let t=this.draftGranularity(),e=this.forecastDraft()?.horizon??1;return t?e===1?t.label.singular:t.label.plural:"periods"});horizonMax=F(()=>this.draftGranularity()?.maxHorizon||1);unavailableGranularityNote=F(()=>{let t=this.granularityChoices().filter(n=>!n.enabled&&n.reason);return t.length?`Unavailable: ${t.map(n=>`${n.value} (${n.reason})`).join("; ")}.`:""});horizonNote=F(()=>{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=F(()=>{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&&v(v({},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:fi(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=F(()=>{let t=this.forecastCopy()?.confidenceLevels??[],e=this.forecastDraft()?.confidence,n=t.indexOf(e??-1);return n>=0?n:0});horizonFill=F(()=>{let t=this.forecastCopy()?.maxHorizon??1,e=this.forecastDraft()?.horizon??1;return`${t>1?(e-1)/(t-1)*100:100}%`});confidenceFill=F(()=>{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(v({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
|
+
> `)}
|
|
13
|
+
|
|
14
|
+
${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 c={id:we(),role:"user",text:this.pendingDisplayOverride??Ti(e),answerSummary:!!this.pendingDisplayOverride,quotedText:t,charts:[],attachments:a,isStreaming:!1,hasError:!1};this.pendingDisplayOverride=null,this.messages.update(L=>[...L,c]);let f=we();this.messages.update(L=>[...L,{id:f,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 y=new AbortController;this.streamAbort=y,this.scrollToBottom();let A="",q="Thinking",P=[],z=!1,X=!1,Q=!1,U=new Set,Y=L=>{let J=L?.queryMeta,R=J?.sql??(J?.dsl?JSON.stringify(J.dsl):L?.title??"");return`${L?.componentName??""}|${R}`},he=()=>{if(z||P.length===0)return;z=!0;let L=P.splice(0);this.updateAssistantMsg(f,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(()=>he())},onToolStart:(V,W)=>{A="",q=W||"Working",this.zone.run(()=>{this.updateAssistantMsg(f,G=>({thinking:q,tools:ii(G.tools??[],V,q)}))})},onToolResult:(V,W,G)=>{this.zone.run(()=>{this.updateAssistantMsg(f,H=>({tools:oi(H.tools??[],V,W,G)}))})},onDataPart:async V=>{if(V.data_type==="adhoc_viz"&&V.data){await En(V.data.config);let W={title:V.data.title??"Chart",componentName:V.data.componentName??"",config:V.data},G=V.data?.id,H=B=>G&&B.config?.id===G;this.zone.run(()=>{if(z){this.updateAssistantMsg(f,ce=>{let Oe=G?ce.charts.findIndex(H):-1;return{charts:Oe===-1?[...ce.charts,W]:ce.charts.map((qi,Fi)=>Fi===Oe?W:qi)}}),this.scrollToBottom();return}let B=G?P.findIndex(H):-1;B===-1?P.push(W):P[B]=W,P.length>=2&&he()})}},onDashboardTitle:V=>{V&&this.zone.run(()=>this.updateAssistantMsg(f,{dashboardTitle:V}))},onChoice:V=>{V?.options?.length&&this.zone.run(()=>this.updateAssistantMsg(f,W=>({choices:[...W.choices??[],V]})))},onLayoutPatch:V=>{let W=new Map((V?.layouts??[]).map(H=>[H.id,H.layout]));if(!W.size)return;let G=H=>{let B=H?.id;return B?W.get(B):void 0};for(let H of P){let B=G(H.config);B&&(H.config=S(v({},H.config),{layout:B}))}this.zone.run(()=>this.updateAssistantMsg(f,H=>({charts:H.charts.map(B=>{let ce=G(B.config);return ce?S(v({},B),{config:S(v({},B.config),{layout:ce})}):B})})))},onError:()=>{X=!0},onFinish:(V,W)=>{Q=!0,this.zone.run(()=>{he(),this.updateAssistantMsg(f,{isStreaming:!1,thinking:void 0,text:A}),this.isStreaming.set(!1);let G=this.messages().find(B=>B.id===f);yt({finishReason:V,sawError:X,producedContent:!!(G?.text||G?.charts.length||G?.choices?.length)})&&this.showStreamError(f),W&&!this.activeConversationId()&&(this.activeConversationId.set(W),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===W);this.conversationConnectionId.set(ce?.connectionId??null)}).finally(()=>this.conversationsLoading.set(!1))),this.loadConversationDashboards(),this.messages().find(B=>B.id===f)?.charts.length||this.scrollToBottom()})}},J,y.signal,a,R,this.builderDashboardId())}catch(L){y.signal.aborted||L instanceof DOMException&&L.name==="AbortError"||this.zone.run(()=>this.showStreamError(f))}finally{this.zone.run(()=>{!Q&&yt({sawError:X,producedContent:!1})&&this.showStreamError(f),this.updateAssistantMsg(f,{isStreaming:!1,thinking:void 0}),this.streamAbort===y&&(this.isStreaming.set(!1),this.streamAbort=null)})}}showStreamError(t){this.messages.update(e=>ri(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?S(v({},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.nonAutoDashboards();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("")}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=F(()=>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=cn();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,c=n?.detailPanel??null;if(!(!o&&!c)){if(c&&!c.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(c?.title??null),this.widgetDetailPanelSkeletonSlots.set(Ud((c?.widgets??[]).map(f=>f.layout).filter(f=>!!f))),this.widgetDetailPanelLoading.set(!0),this.widgetDetailPanelOpen.set(!0),this.runViewTransition(()=>{});try{let f=a?await this.resolveCohortDetailPanel(a):c?await this.svc.previewWidgetDetailPanelDefinition(c):await this.svc.previewWidgetTemplateDetailPanel(o);if(!f.widgets.length){this.widgetDetailPanelOpen.set(!1);return}this.widgetDetailPanelTitle.set(f.title),this.widgetDetailPanelRaw.set(f.widgets.map(y=>({title:y.title,componentName:y.componentName,config:y})))}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}),Qe(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
|
|
15
|
+
`)],{type:"text/csv;charset=utf-8;"}),c=URL.createObjectURL(a),f=A=>A.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"cohort",y=document.createElement("a");y.href=c,y.download=`${f(e.cohortTitle)}-${e.criterionId}-top${n.systemRows.length}-of-${n.systemCount}-systems.csv`,document.body.appendChild(y),y.click(),y.remove(),setTimeout(()=>URL.revokeObjectURL(c),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 Tn(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"),c=this.normalizeFilterSuggestions(a);if(!c.length)return;this.filterSuggestCache.set(e,c),this.artifactGridRef?.patchFilterSuggestions(e,n,c)}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(c=>!ze(c));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:c,resolvedFilters:f,filterExplanation:y}=await this.svc.applyFilters(n,t.filters,e,"draft",o.signal,{mode:t.mode,prompt:t.prompt});if(a!==this.applyFiltersSeq)return;this.applyFilterResultsToOverlay(c),this.activeDashboardFilters.set(t.filters),this.activeResolvedFilters.set(f),this.applySummary.set(In(c,this.buildActiveFilters(t.filters))),this.filterExplanation.set(y)}catch(c){if(c?.name==="AbortError"||a!==this.applyFiltersSeq)return;console.error("[ask-aquera] apply filters failed",c)}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=dn(this.baseArtifactWidgets(),t,o=>ze(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=x(!1);storyPickerWidget=x(null);openStoryPicker(t=this.selectedArtifactCharts()){let e=t.find(n=>!this.isFilterChart(n))??t[0];e&&(this.storyPickerWidget.set(v({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(S(v({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 v({id:a},dt(this.artifactToWidget(o),a))}));await this.svc.createDashboard(S(v({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=S(v({},a.config??{}),{summary:o}),a.loading=!1,a.open&&a.startTyping?.())}catch(o){let a=this.aiExecutiveSummaryEl?.nativeElement,c=o instanceof Error?o.message:"Failed to generate summary.";a&&(a.config=S(v({},a.config??{}),{summary:`<p>${c}</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 v({id:o},dt(this.artifactToWidget(n),o))}));this.savingDashboard.set(!0);try{let n=await this.svc.createDashboard(S(v({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){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=qn(n).map(y=>{if(y.type==="custom"){let q=y.id==="manageFilters"&&o>0?`${y.label} (${o})`:y.label;return{key:y.id,label:q,glyph:y.glyph,divider:y.divider,method:y.method,color:y.color,kind:"custom"}}let A=y.downloadPng?"exportPng":y.downloadCsv?"exportCsv":"print";return{key:A,label:y.label??A,glyph:y.glyph,divider:y.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 c=this.inlineViewModeFor(e),f=this.inlineHasQueryableData(e);return c==="chart"?(a.push({key:"viewData",label:"Chart Data",glyph:"ng-table",divider:!this.isDslEditableChart(e),kind:"custom"}),f&&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"}),f&&c!=="records"&&a.push({key:"viewRecords",label:"View Records",glyph:"ng-database",kind:"custom"})),c!=="chart"?Fn(a,y=>y.key==="viewChart"||y.key==="viewRecords",y=>y.key==="setAlert"||y.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=S(v({},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=x(new Set);recordsFetcher=N(xn,{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}=fn(e);if(!this.isKpiChart(t))return{type:"grid",data:o,columns:n.map(A=>({id:A,header:A,accessorKey:A,enableSorting:!0}))};let c=o[0]?.[n[0]]??null,f=Cn({config:t.config?.config,queryMeta:this.chartQueryMeta(t)});return{type:"grid",data:[{field:"Value",text:c,emphasize:!0},...f.map(A=>({field:A.label,text:A.text}))],columns:[{id:"field",header:"Field",accessorKey:"field",enableSorting:!1,width:"140px",cell:A=>lt`<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 lt`<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=S(v({},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=x(null);chartTypeIcon(t){return Mn(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(c=>S(v({},c),{charts:c.charts.map(f=>f===t?o:f)})))}inlineFilterBuilderFieldId=x(null);inlineFilterBuilderOperator=x(null);inlineFilterBuilderValue=x("");inlineFilterBuilderValue2=x("");inlineFilterBuilderValues=x([]);inlineFilterFieldsLoading=x(!1);inlineFilterFieldsError=x(null);inlineFilterValuesLoading=x(!1);inlineFilterApplying=x(!1);inlineFilterApplyError=x(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?Ne(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(!(!kn(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?Ne(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?Ne(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 An(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(Pn),c=await this.svc.applyAdhocFilter(o,a);return this.inlineFilterBaseConfig.set(e,o),this.inlineFilterResult.set(e,c),!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 q=o.needsSecondValue?this.inlineFilterBuilderValue2().trim():void 0;if(o.needsSecondValue&&!q)return;a={id:`f${++this.inlineFilterSeq}`,fieldId:e,operator:n,value:A,value2:q}}let c=this.inlineChartKey(t),f=[...this.inlineFilters.get(c)??[],a];await this.reapplyInlineFilters(t,c,f)&&(this.inlineFilters.set(c,f),this.resetInlineFilterBuilderValues())}async removeInlineFilter(t,e){if(this.inlineFilterApplying())return;let n=this.inlineChartKey(t),o=(this.inlineFilters.get(n)??[]).filter(c=>c.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,`
|
|
16
|
+
|
|
17
|
+
`).replace(/ {2,}/g," ").replace(/\n /g,`
|
|
18
|
+
`).trim()}cleanMarkdown(t){return this.stripLeaks(t).replace(/\*{4,}/g,"").replace(/([^\n ]) {2,}/g,"$1 ").replace(/\n{3,}/g,`
|
|
19
|
+
|
|
20
|
+
`).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),v(v({},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(),Le()}extractMessage(t,e){return $e(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&&It(ho,5)(pt,5)(Co,5)(fo,5)(xo,5)(ct,5),e&2){let o;xe(o=be())&&(n.aqChatEl=o.first),xe(o=be())&&(n.builderRef=o.first),xe(o=be())&&(n.artifactGridRef=o.first),xe(o=be())&&(n.composerRef=o.first),xe(o=be())&&(n.aiExecutiveSummaryEl=o.first),xe(o=be())&&(n.inlineChartWidgets=o)}},hostBindings:function(e,n){e&1&&u("dragover",function(a){return a.preventDefault()},it)("drop",function(a){return a.preventDefault()},it)("selectionchange",function(){return n.onTextSelectionChange()},Ie)("wheel",function(){return n.hideQuoteBadge()},Ie)("keydown.escape",function(){return n.hideQuoteBadge()},Ie)},features:[Rt([Re(ye),sn(ue),gn(ue),bn(ue),vn(ue),wn(ue),Sn(ue),yn(),hn(mn.CURATED,Je),Dn(()=>null)])],decls:39,vars:37,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"],[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","sparklineColor","#3b82f6",3,"label","description","value","loading","sparkline","options"],["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",3,"click"],["name","ng-lightbulb-05","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","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","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","showPromptGallery"],[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,"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,Po,3,7,"button",10),s(2,"div",11),m(3,ca,19,10,"header",12),m(4,Ba,21,10,"div",13),m(5,hr,36,12,"div",14),m(6,Fs,2,1),Pe(7,Ns,10,16,"ng-template",null,0,Ve),d(),m(9,Ls,1,2,"div",15),m(10,ad,7,6,"aside",16),m(11,_d,15,30,"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)}),p(16),d(),s(17,"nile-button",22),u("click",function(){return n.confirmSaveDashboard()}),p(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"),p(23),d()(),m(24,xd,1,1),s(25,"div",26)(26,"nile-button",21),u("click",function(){return n.closeForecastSettings()}),p(27),d(),s(28,"nile-button",22),u("click",function(){return n.applyForecastSettings()}),p(29),d()()(),s(30,"nile-drawer",27),u("nile-request-close",function(){return n.closeGallery()})("nile-hide",function(){return n.closeGallery()}),m(31,Pd,6,3),d(),Pe(32,Nd,1,1,"ng-template",null,1,Ve),m(34,Ld,1,6,"app-alert-drawer",28),m(35,$d,2,0,"nile-executive-summary",29),d(),m(36,Wd,1,2,"app-story-picker-drawer",30),Pe(37,Bd,7,3,"ng-template",null,2,Ve)),e&2){let o,a;$("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(),w("label",n.copy().saveDashboardDialogLabel),M("open",n.saveDialogOpen()?"":null),l(),w("placeholder",n.copy().dashboardNamePlaceholder)("value",n.saveDashboardName()),l(3),b(n.copy().cancelButton),l(),M("loading",n.savingDashboard()?"":null)("disabled",!n.saveDashboardName().trim()||n.savingDashboard()?"":null),l(),T(" ",n.copy().saveDashboardButton," "),l(),w("label",n.copy().forecastSettingsLabel)("open",n.forecastSettingsOpen()),l(4),b(n.copy().forecastSettingsLabel),l(),h((a=n.forecastDraft())?24:-1,a),l(3),b(n.copy().cancelButton),l(2),b(n.copy().applyButton),l(),w("label",n.copy().promptGalleryLabel)("open",n.galleryOpen()),l(),h(n.galleryOpen()?31:-1),l(3),h(n.features().alerts?34:-1),l(),h(n.features().executiveSummary?35:-1),l(),h(-1)}},dependencies:[Wt,Ke,je,Ye,We,Ge,He,Be,Ue,$n,Ln,ct,On,pt,Rn,Wn],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}.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 Yd=(i,t)=>t.id;function Kd(i,t){if(i&1&&(s(0,"div",9),C(1,"div",12),s(2,"span"),p(3),d()()),i&2){let e=r();l(3),b(e.copy().loadingConnections)}}function Qd(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),p(4),d(),s(5,"p",16),p(6),d(),s(7,"button",7),u("click",function(){_(e);let o=r();return g(o.openForm())}),C(8,"nile-glyph",8),p(9),d()()}if(i&2){let e=r();l(4),b(e.copy().noConnectionsTitle),l(2),b(e.copy().noConnectionsSub),l(3),T(" ",e.copy().registerConnectionButton," ")}}function Jd(i,t){i&1&&(s(0,"span",23),p(1,"Active"),d())}function Xd(i,t){i&1&&(s(0,"span",24),p(1,"Inactive"),d())}function Zd(i,t){i&1&&(s(0,"span",25),C(1,"nile-glyph",34),p(2," Schema "),d())}function ec(i,t){i&1&&C(0,"span",28)}function tc(i,t){i&1&&C(0,"nile-glyph",29)}function nc(i,t){i&1&&C(0,"span",28)}function ic(i,t){i&1&&C(0,"nile-glyph",31)}function oc(i,t){if(i&1&&(s(0,"span",37),p(1),d()),i&2){let e=r(3).$implicit;l(),K("",e.testResult.sampleTables.slice(0,4).join(", "),"",e.testResult.sampleTables.length>4?"\u2026":"")}}function ac(i,t){if(i&1&&(C(0,"nile-glyph",36),s(1,"span"),p(2),d(),m(3,oc,2,2,"span",37)),i&2){let e=r(2).$implicit;l(2),T("Reachable \xB7 ",e.testResult.tableCount," tables"),l(),h(e.testResult.sampleTables.length?3:-1)}}function rc(i,t){if(i&1&&(C(0,"nile-glyph",38),s(1,"span"),p(2),d()),i&2){let e=r(2).$implicit,n=r(2);l(2),T("Unreachable \xB7 ",e.testResult.error??n.copy().errors.connectionTestFailedFallback)}}function lc(i,t){if(i&1&&(s(0,"div",35),m(1,ac,4,2)(2,rc,3,1),d()),i&2){let e=r().$implicit;$("wfconn-test-result--ok",e.testResult.reachable)("wfconn-test-result--fail",!e.testResult.reachable),l(),h(e.testResult.reachable?1:2)}}function sc(i,t){if(i&1){let e=k();s(0,"div",18)(1,"div",19)(2,"div",20)(3,"span",21),p(4),d(),s(5,"span",22),p(6),d(),m(7,Jd,2,0,"span",23)(8,Xd,2,0,"span",24),m(9,Zd,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,ec,1,0,"span",28)(13,tc,1,0,"nile-glyph",29),p(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,nc,1,0,"span",28)(17,ic,1,0,"nile-glyph",31),d()()(),s(18,"div",32),p(19),zt(20,"date"),d(),m(21,lc,3,5,"div",33),d()}if(i&2){let e=t.$implicit,n=r(2);$("wfconn-card--deleting",e.deleting),l(4),b(e.name),l(2),b(n.adapterLabel(e.adapterType)),l(),h(e.isActive?7:8),l(2),h(e.hasSchemaSnapshot?9:-1),l(2),$("wfconn-icon-btn--loading",e.testing),w("disabled",e.testing||e.deleting),l(),h(e.testing?12:13),l(2),T(" ",n.copy().testConnectionButton," "),l(),w("disabled",e.testing||e.deleting),l(),h(e.deleting?16:17),l(3),T(" Created ",Nt(20,15,e.createdAt,"mediumDate")," "),l(2),h(e.testResult?21:-1)}}function dc(i,t){if(i&1&&(s(0,"div",11),D(1,sc,22,18,"div",17,Yd),d()),i&2){let e=r();l(),O(e.connections())}}function cc(i,t){if(i&1){let e=k();s(0,"div",46)(1,"label",47),p(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),p(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),p(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),p(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),p(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),p(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),w("ngModel",e.mssql().server),l(4),w("ngModel",e.mssql().database),l(5),w("ngModel",e.mssql().user),l(5),w("type",e.showPassword()?"text":"password")("ngModel",e.mssql().password),l(2),M("name",e.showPassword()?"ng-eye-off":"ng-eye"),l(5),w("ngModel",e.mssql().schema),l(4),w("ngModel",e.mssql().port)}}function pc(i,t){if(i&1){let e=k();s(0,"div",46)(1,"label",47),p(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),p(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),p(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),w("ngModel",e.opensearch().url),l(5),w("ngModel",e.opensearch().username),l(5),w("type",e.showPassword()?"text":"password")("ngModel",e.opensearch().password),l(2),M("name",e.showPassword()?"ng-eye-off":"ng-eye")}}function _c(i,t){if(i&1){let e=k();s(0,"div",62)(1,"div",46)(2,"label",47),p(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),p(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),p(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),p(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),p(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),p(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),w("ngModel",e.postgres().host),l(4),w("ngModel",e.postgres().port),l(4),w("ngModel",e.postgres().database),l(5),w("ngModel",e.postgres().user),l(5),w("type",e.showPassword()?"text":"password")("ngModel",e.postgres().password),l(2),M("name",e.showPassword()?"ng-eye-off":"ng-eye"),l(4),w("ngModel",e.postgres().schema)}}function gc(i,t){if(i&1){let e=k();s(0,"div",46)(1,"label",47),p(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),p(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),p(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),p(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),p(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),p(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),w("ngModel",e.snowflake().account),l(5),w("ngModel",e.snowflake().database),l(4),w("ngModel",e.snowflake().schema),l(4),w("ngModel",e.snowflake().warehouse),l(5),w("ngModel",e.snowflake().user),l(5),w("type",e.showPassword()?"text":"password")("ngModel",e.snowflake().password),l(2),M("name",e.showPassword()?"ng-eye-off":"ng-eye")}}function uc(i,t){if(i&1&&(s(0,"div",56),C(1,"nile-glyph",38),p(2),d()),i&2){let e=r(2);l(2),T(" ",e.formError()," ")}}function mc(i,t){if(i&1&&(C(0,"span",82),p(1)),i&2){let e=r(2);l(),T(" ",e.copy().registeringButton," ")}}function hc(i,t){if(i&1&&(C(0,"nile-glyph",83),p(1)),i&2){let e=r(2);l(),T(" ",e.copy().registerAndTestButton," ")}}function Cc(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),p(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),p(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),p(14,"Display name "),s(15,"span",49),p(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),p(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),p(23,"MSSQL (SQL Server)"),d(),s(24,"option",52),p(25,"OpenSearch"),d(),s(26,"option",53),p(27,"PostgreSQL"),d(),s(28,"option",54),p(29,"Snowflake"),d()()(),s(30,"div",55),p(31,"Connection config"),d(),m(32,cc,29,8),m(33,pc,16,5),m(34,_c,29,8),m(35,gc,29,8),m(36,uc,3,1,"div",56),d(),s(37,"div",57)(38,"button",58),u("click",function(){_(e);let o=r();return g(o.closeForm())}),p(39),d(),s(40,"button",59),u("click",function(){_(e);let o=r();return g(o.submitRegister())}),m(41,mc,2,1)(42,hc,2,1),d()()()}if(i&2){let e=r();l(4),b(e.copy().registerConnectionTitle),l(7),w("ngModel",e.formConnectionName())("placeholder",e.copy().connectionNamePlaceholder),l(6),w("ngModel",e.formDisplayName())("placeholder",e.copy().displayNamePlaceholder),l(4),w("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),w("disabled",e.saving()),l(),b(e.copy().cancelButton),l(),w("disabled",e.saving()),l(),h(e.saving()?41:42)}}var De=class i{svc=N(me);copy(){return I().copy}loading=x(!0);connections=x([]);showForm=x(!1);saving=x(!1);formConnectionName=x("Primary");formDisplayName=x("");formAdapter=x("mssql");mssql=x({server:"",database:"",user:"",password:"",schema:"gold",port:1433});opensearch=x({url:"",username:"",password:""});postgres=x({host:"",port:5432,database:"",user:"",password:"",schema:"public"});snowflake=x({account:"",database:"",schema:"",user:"",password:"",warehouse:""});showPassword=x(!1);formError=x("");hasConnections=F(()=>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=>S(v({},n),{[t]:e}))}patchOpensearch(t,e){this.opensearch.update(n=>S(v({},n),{[t]:e}))}patchPostgres(t,e){this.postgres.update(n=>S(v({},n),{[t]:e}))}patchSnowflake(t,e){this.snowflake.update(n=>S(v({},n),{[t]:e}))}buildConfig(){switch(this.formAdapter()){case"mssql":return v({},this.mssql());case"opensearch":return v({},this.opensearch());case"postgres":return v({},this.postgres());case"snowflake":return v({},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?S(v({},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?S(v({},o),{testing:!1,testResult:e}):o))}catch{this.connections.update(e=>e.map(n=>n.id===t?S(v({},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?S(v({},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?S(v({},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(),Le()}extractMessage(t,e){return $e(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"),p(6),d()(),s(7,"span",5),p(8,"/"),d(),s(9,"span",6),p(10),d()(),s(11,"button",7),u("click",function(){return n.openForm()}),C(12,"nile-glyph",8),p(13),d()(),m(14,Kd,4,1,"div",9)(15,Qd,10,3,"div",10)(16,dc,3,0,"div",11),m(17,Cc,43,15),d()),e&2&&(l(6),b(n.copy().connectionsBreadcrumbHome),l(4),b(n.copy().connectionsTitle),l(3),T(" ",n.copy().registerConnectionButton," "),l(),h(n.loading()?14:!n.hasConnections()&&!n.showForm()?15:16),l(3),h(n.showForm()?17:-1))},dependencies:[Ke,je,Ye,We,Ge,He,Be,Ue,Zt,Bt],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 xc(i,t){i&1&&C(0,"app-ask-aquera-connections-page")}function bc(i,t){i&1&&C(0,"app-ask-aquera-page")}function yc(i,t){if(i&1&&m(0,xc,1,0,"app-ask-aquera-connections-page")(1,bc,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 nt=class i{config=rt(void 0);theme=rt(void 0);ready=Te({alias:"aq-ready"});error=Te({alias:"aq-error"});unauthorized=Te({alias:"aq-unauthorized"});host=N(Ot);stopAdopting=null;stopUi=null;themeChanged=Te({alias:"dvz-theme-changed"});themeStore=N($t);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=Tt(t))})}async apply(t){let e=t.auth;if(on(t.api.baseUrl),Qt(t.api,e),gt({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}}),this.stopUi?.(),this.stopUi=qt(this.host.nativeElement,t.ui),this.themeStore.attach(this.host.nativeElement),this.theme()||this.themeStore.set(t.ui?.theme??"light"),an({productId:t.tenant.productId,name:t.tenant.productName}),nn(()=>this.unauthorized.emit()),await de(),e.mode==="callback"&&!this.tokenTimer&&(this.tokenTimer=setInterval(()=>{de()},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,yc,2,1),e&2&&h(n.config()?0:-1)},dependencies:[De,Fe],styles:[`:host{display:block;height:100%}
|
|
21
|
+
`],encapsulation:3,changeDetection:0})};jt();var vc="dvz-ask";function wc(i={}){return Ht(nt,vc,[Dt(),en([]),tn(),Ut(Gt([rn])),{provide:ln,useFactory:()=>I().baseUrl},{provide:zn,useValue:"workforce/dashboards"},Re(ye)],i)}wc();export{vc as a,wc as b};
|