@aquera/data-visualizer-sdk 0.0.50 → 0.0.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{a,b}from"./chunk-HHHSUVAV.js";import"./chunk-FKHJV7T4.js";import"./chunk-ZRJYRUTX.js";import"./chunk-T4WJW6GR.js";import"./chunk-JP5QY5S6.js";import"./chunk-6SX2WEWK.js";import"./chunk-FK6H3RFT.js";import"./chunk-SYVY7IJY.js";import"./chunk-DPY4ZJSO.js";import"./chunk-T3NXAI3H.js";import"./chunk-JWVGGQEQ.js";import"./chunk-R3C2A3GE.js";import"./chunk-RRYXNANE.js";import"./chunk-SVXYWKUB.js";import"./chunk-QXVITQOV.js";import"./chunk-I4TM4AGJ.js";import"./chunk-F6YL5NFN.js";import"./chunk-ATUZQYGW.js";import"./chunk-XCT4UKLK.js";import"./chunk-4XZ7RFFX.js";import"./chunk-YHTLTPEH.js";import"./chunk-LFSX3TZJ.js";import"./chunk-BTDKTIE6.js";import"./chunk-5CTM6JVQ.js";import"./chunk-W2HKCDVZ.js";import"./chunk-MPGDQZRI.js";import"./chunk-HOS2FAXH.js";import"./chunk-INJSG5RK.js";import"./chunk-RCWO45CI.js";import"./chunk-ZW5NV4UO.js";export{a as DVZ_ASK_TAG,b as defineDvzAsk};
1
+ import{a,b}from"./chunk-WAZHPSQ5.js";import"./chunk-FKHJV7T4.js";import"./chunk-ZRJYRUTX.js";import"./chunk-T4WJW6GR.js";import"./chunk-JP5QY5S6.js";import"./chunk-6SX2WEWK.js";import"./chunk-FK6H3RFT.js";import"./chunk-SYVY7IJY.js";import"./chunk-DPY4ZJSO.js";import"./chunk-T3NXAI3H.js";import"./chunk-JWVGGQEQ.js";import"./chunk-R3C2A3GE.js";import"./chunk-RRYXNANE.js";import"./chunk-SVXYWKUB.js";import"./chunk-QXVITQOV.js";import"./chunk-I4TM4AGJ.js";import"./chunk-F6YL5NFN.js";import"./chunk-ATUZQYGW.js";import"./chunk-XCT4UKLK.js";import"./chunk-4XZ7RFFX.js";import"./chunk-YHTLTPEH.js";import"./chunk-LFSX3TZJ.js";import"./chunk-BTDKTIE6.js";import"./chunk-5CTM6JVQ.js";import"./chunk-W2HKCDVZ.js";import"./chunk-MPGDQZRI.js";import"./chunk-HOS2FAXH.js";import"./chunk-INJSG5RK.js";import"./chunk-RCWO45CI.js";import"./chunk-ZW5NV4UO.js";export{a as DVZ_ASK_TAG,b as defineDvzAsk};
@@ -9,7 +9,7 @@ ${t}`:t}var we=class i{http=z(_e);tokenStore=z(ae);get customerId(){return I().c
9
9
  `);v=N.pop()??"";for(let X of N)A(X)}v.trim()&&A(v)}async listXraySources(){return!this.customerId||!this.productId?[]:(await E(this.http.get(`${this.baseUrl}/xray/sources`)))?.data?.connections??[]}async listXrayEntities(t,e,n){if(!this.customerId||!this.productId)return{adapterType:"",entities:[]};let o=new Yt;return e&&(o=o.set("datasetId",e)),n&&(o=o.set("search",n)),(await E(this.http.get(`${this.baseUrl}/xray/sources/${t}/entities`,{params:o})))?.data??{adapterType:"",entities:[]}}async xrayPreviewStream(t,e,n){await this.readNdjsonStream(`${this.baseUrl}/xray/sources/${t}/preview`,e,o=>{switch(o.type){case"profile":n.onProfile?.(o.profile);break;case"semantic":n.onSemantic?.(o.semanticRead);break;case"widget":n.onWidget(o.widget);break;case"layout":n.onLayout?.(o.layouts);break;case"conversation":n.onConversation?.(o.conversationId);break;case"summary":n.onSummary?.(o.summary);break;case"empty":n.onEmpty?.(o.message);break;case"error":n.onError(o.message);break;case"done":n.onDone?.(o.widgetCount,o.title,o.conversationId??null);break;default:break}},n.onError)}async readNdjsonStream(t,e,n,o){let a=await this.bearer(),p;try{p=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:JSON.stringify(e??{})})}catch(P){o(P instanceof Error?P.message:"Network error");return}if(!p.ok){let P=await p.json().catch(()=>null);o(P?.error??`Request failed (${p.status})`);return}if(!p.body){o("No response body received");return}let x=p.body.getReader(),v=new TextDecoder,A="",S=P=>{let N=P.trim();if(N)try{n(JSON.parse(N))}catch{}};for(;;){let{done:P,value:N}=await x.read();if(P)break;A+=v.decode(N,{stream:!0});let X=A.split(`
10
10
  `);A=X.pop()??"";for(let U of X)S(U)}A.trim()&&S(A)}async createDashboardFromTemplate(t){return(await E(this.http.post(`${this.baseUrl}/category-templates/${t}/dashboard`,{}))).data}async listWidgetTemplates(){return(await E(this.http.get(`${this.baseUrl}/widget-templates`))).data}async previewWidgetTemplate(t){return(await E(this.http.post(`${this.baseUrl}/widget-templates/${t}/preview`,{}))).data}async loadAllWidgetTemplatePreviews(){return(await E(this.http.post(`${this.baseUrl}/widget-templates/preview-all`,{}))).data}async previewWidgetTemplateDetailPanel(t){return(await E(this.http.post(`${this.baseUrl}/widget-templates/${t}/detail-panel`,{}))).data}async previewWidgetDetailPanelDefinition(t){return(await E(this.http.post(`${this.baseUrl}/widget-templates/preview-detail-panel`,{detailPanel:t}))).data}async createDashboard(t){let a=t,{published:e}=a,n=Ve(a,["published"]);return I().features.mcpGateway?(await this.callMcpTool("createDashboard",w(w({},n),e?{published:!0}:{}))).dashboard:(await E(this.http.post(`${this.baseUrl}/dashboards${e?"?published=true":""}`,n))).data}async publishDashboard(t){return I().features.mcpGateway?(await this.callMcpTool("publishDashboard",{dashboardId:t}))?.publishedDashboardId??t:(await E(this.http.post(`${this.baseUrl}/dashboards/${t}/publish`,{})))?.data?.publishedDashboardId??t}async updateDashboard(t,e){await E(this.http.put(`${this.baseUrl}/dashboards/${t}?published=false`,e))}async deleteDashboard(t){if(!I().features.mcpGateway){await E(this.http.delete(`${this.baseUrl}/dashboards/${t}`));return}await this.callMcpTool("deleteDashboard",{dashboardId:t})}async register(t){return(await E(this.http.post(`${I().baseUrl}/api/customers/${this.customerId}/workforce/register`,t))).data}async listConnections(){return!this.customerId||!this.productId?[]:(await E(this.http.get(`${this.baseUrl}/connections`)))?.data??[]}async listDatasets(){return!this.customerId||!this.productId?[]:((await E(this.http.get(`${this.baseUrl}/connections/datasets`)))?.data??[]).map(e=>({id:e.id,name:e.name}))}async listPipelines(){if(!this.customerId||!this.productId)return[];let t=`${I().baseUrl}/api/customers/${this.customerId}/products/${this.productId}/applications/orchestrations/v2?startIndex=0&limit=100`;return((await E(this.http.get(t)))?.data??[]).map(n=>({id:n.publicOrchestrationGuid??n.guid??n.id??"",name:n.name})).filter(n=>n.id)}async createConnection(t,e){return(await E(this.http.post(`${this.baseUrl}/connections`,{name:t,config:e}))).data}async updateConnection(t,e){return(await E(this.http.put(`${this.baseUrl}/connections/${t}`,e))).data}async testConnection(t){return(await E(this.http.post(`${this.baseUrl}/connections/${t}/test`,{}))).data}async deleteConnection(t){await E(this.http.delete(`${this.baseUrl}/connections/${t}`))}parseLine(t,e){let n=t.indexOf(":");if(n===-1)return;let o=t.slice(0,n),a;try{a=JSON.parse(t.slice(n+1))}catch{return}switch(o){case"f":break;case"0":e.onText(a.text??"");break;case"9":{let p=a;e.onToolStart(p.toolCallId,p.uiLabel??p.toolName??"");break}case"a":{let p=a;e.onToolResult(p.toolCallId,p.result?.uiDetail??"",p.result?.error??!1);break}case"2":{let p=a;p.data_type==="adhoc_viz"?e.onDataPart(p):p.data_type==="dashboard_title"?e.onDashboardTitle?.(p.data?.title??""):p.data_type==="choice"?e.onChoice?.(p.data):p.data_type==="layout_patch"&&e.onLayoutPatch?.(p.data);break}case"3":e.onError(a.error??"Unknown error");break;case"d":{let p=a;e.onFinish(p.finishReason??"stop",p.conversationId??"");break}}}static \u0275fac=function(e){return new(e||i)};static \u0275prov=ie({token:i,factory:i.\u0275fac,providedIn:"root"})};function ri({hasMessages:i,artifactOpen:t,builderOpen:e}){return t?"split":e?"builder":i?"conversation":"idle"}function li(i,t){return i==="chat"?t.chat:i==="library"?t.library:i==="tools"?t.tools:!0}function si(i){return[i.chat,i.library,i.tools].filter(Boolean).length>1}var qe=class i{http=z(_e);tokenStore=z(ae);get customerId(){return I().customerId??this.tokenStore.tenantId()??""}get productId(){return I().productId??ge()}get baseUrl(){return`${I().baseUrl}/api/customers/${this.customerId}/products/${this.productId}/workforce`}async listCriteria(){return(await E(this.http.get(`${this.baseUrl}/cohort-criteria?category=cohort`)))?.criteria??[]}async previewCriterion(t){return E(this.http.get(`${this.baseUrl}/cohorts/preview?criterion=${encodeURIComponent(t)}`))}async getDetail(t){return E(this.http.get(`${this.baseUrl}/cohorts/detail?criterion=${encodeURIComponent(t)}`))}async listMembers(t,e){return(await E(this.http.get(`${this.baseUrl}/cohorts/members?criterion=${encodeURIComponent(t)}&limit=${e}`)))?.members??[]}static \u0275fac=function(e){return new(e||i)};static \u0275prov=ie({token:i,factory:i.\u0275fac,providedIn:"root"})};function ci(i,t,e){return{chart:w({type:"kpi",variant:"card",value:t},e?{description:e}:{}),aq:{chartTitle:i,ai:{enabled:!1}}}}function di(i,t,e,n){return{title:t,componentName:i,widgetType:"chart",config:e,layout:n}}function pi(i){let t=i.kpis.map((x,v)=>di("nile-kpi-chart",x.label,ci(x.label,x.value),{x:v*3,y:0,w:3,h:2})),e=i.systemRows.length,n=e<i.systemCount?`Underlying rows \xB7 top ${e} of ${i.systemCount} systems`:`Underlying rows \xB7 ${e} ${e===1?"system":"systems"}`,o=x=>i.systemRows.some(v=>v[x]>0),a=[{accessorKey:"system",header:"System"},{accessorKey:"events",header:"Events"},...o("errors")?[{accessorKey:"errors",header:"Errors"}]:[],...o("orphans")?[{accessorKey:"orphans",header:"Orphans"}]:[]],p=di("nile-data-grid",n,{chart:{type:"grid",columns:a,data:i.systemRows},aq:{chartTitle:n,ai:{enabled:!1}}},{x:0,y:2,w:12,h:6});return[...t,p]}var io={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 _i(i,t=1){return{title:i.cohortTitle,componentName:"nile-kpi-chart",config:{title:i.cohortTitle,componentName:"nile-kpi-chart",widgetType:"chart",category:"cohort",config:T(w({},ci(i.cohortTitle,i.matchCount,`${t} ${t===1?"criterion":"criteria"} \xB7 live membership`)),{_meta:{cohortId:i.criterionId,detailPanel:{title:i.cohortTitle,cohortId:i.criterionId,widgets:pi(io)}}}),layout:{x:0,y:0,w:3,h:3}}}}function et(i,t){return{title:i.cohortTitle,widgets:pi(t),skipped:[]}}var oo="__evidence-curated";function ao(i,t){return`${i}${oo}-${t}`}function ro(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 lo=2;function so(i){if(!i||typeof i!="object")return;let t=i;if(![t.x,t.y,t.w,t.h].every(x=>typeof x=="number"&&Number.isFinite(x)))return;let{x:n,y:o,w:a,h:p}=t;if(!(a<=0||p<=0))return{x:n,y:o,w:a,h:Math.max(lo,Math.ceil(p))}}function co(i,t){return i==="kpi"?"nile-kpi-chart":i==="grid"?"nile-data-grid":typeof t=="string"&&t?t:void 0}function vt(i,t){let e=Array.isArray(i?.widgets)?i.widgets:[],n=[];for(let o of e){if(!o||typeof o!="object")continue;let a=o,p=a.config??a??{},x=p.chart??{},v=T(w({},p),{chart:x,aq:p.aq??{}}),A={id:ao(t,n.length),title:typeof a.title=="string"?a.title:"",widgetType:a.widgetType==="kpi"?"kpi":"chart",config:v,drilldownBy:Array.isArray(a.drilldownBy)?a.drilldownBy:[],category:a.category??null},S=co(x.type,a.componentName);S&&(A.componentName=S);let P=so(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 tt=class i{svc=z(he);cohort=z(qe);async resolveEvidence(t){let e=ro(t);if(!e)return[];if(e.cohortId){let[n,o]=await Promise.all([this.cohort.previewCriterion(e.cohortId),this.cohort.getDetail(e.cohortId)]);return vt(et(n,o),t.id)}return e.detailPanel?e.detailPanel.widgets?.length?vt(await this.svc.previewWidgetDetailPanelDefinition(e.detailPanel),t.id):[]:e.templateId?vt(await this.svc.previewWidgetTemplateDetailPanel(e.templateId),t.id):[]}static \u0275fac=function(e){return new(e||i)};static \u0275prov=ie({token:i,factory:i.\u0275fac,providedIn:"root"})};function wt(i){return!!i&&i.matchCount>0&&!i.sampleMatches?.length}function gi(i){return!i||wt(i)?!1:i.matchCount>Math.min(i.sampleMatches?.length??0,3)}function ui(i,t,e){return e&&t?t:i?.sampleMatches?.slice(0,3)??[]}function mi(i,t){return!!i&&!!t&&t.length<i.matchCount}function kt(i){let t=i?.status;return t===503?"unavailable":t===403?"forbidden":"failed"}function hi(i,t,e){let n=e||"Working",o=i.map(p=>p.id==="thinking"&&p.status==="running"?T(w({},p),{status:"done"}):p),a=o.findIndex(p=>p.status==="running"&&p.baseLabel===n);if(a>=0){let p=o[a],x=[...o];return x[a]=T(w({},p),{callIds:[...p.callIds,t],pending:p.pending+1}),x}return[...o,{id:t,callIds:[t],pending:1,baseLabel:n,label:n,status:"running"}]}function Ci(i,t,e,n){return i.map(o=>{if(!o.callIds.includes(t))return o;let a=Math.max(0,o.pending-1);return T(w({},o),{pending:a,detail:n?o.detail:e||o.detail,status:a===0?"done":o.status})})}function Pt(i){let{finishReason:t,sawError:e,producedContent:n}=i;return t==="error"?!0:t==null?e:e&&!n}var fi=i=>T(w({},i),{isStreaming:!1,thinking:void 0,hasError:!0});function xi(i,t,e){return i.some(n=>n.id===t)?i.map(n=>n.id===t?fi(n):n):[...i,fi(e(t))]}var nt=class i{http=z(_e);tokenStore=z(ae);get customerId(){return I().customerId??this.tokenStore.tenantId()??""}get productId(){return I().productId??ge()}get apiUrl(){return`${I().baseUrl}/api/customers/${this.customerId}/products/${this.productId}/workforcebot/forecast`}cachedContext=null;context(){return this.cachedContext?this.cachedContext:(this.cachedContext=E(this.http.get(`${this.apiUrl}/context`)).catch(t=>(console.info('[ask-aquera] forecast context unavailable \u2014 "forecast this" will not be claimed.',t),null)),this.cachedContext)}async compute(t){try{return await E(this.http.post(`${this.apiUrl}/compute`,t))}catch(e){let n=e,o=n?.error?.error;throw Object.assign(new Error(o||`Forecast failed (HTTP ${n?.status??"?"})`),{status:n?.status,code:n?.error?.code,isRefusal:n?.status===422})}}static \u0275fac=function(e){return new(e||i)};static \u0275prov=ie({token:i,factory:i.\u0275fac,providedIn:"root"})};var _o=[/\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],go=[/\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],uo={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}},mo=[[/\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 At(i,t,e=new Date){let n=(i??"").trim();if(!n)return null;let o=go.some(x=>x.test(n)),a=ho(n,_o);if(!a&&!o)return null;let p=Co(n);return{extendsExisting:o,metric:fo(n,t),horizon:xo(n,p??t.defaults.granularity,e),granularity:p,trigger:a||"refers to an existing chart"}}function ho(i,t){for(let e of t){let n=e.exec(i);if(n)return n[0]}return""}function Co(i){for(let[t,e]of mo)if(t.test(i))return e}function fo(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 xo(i,t,e){let n=uo[t],o=/\bnext\s+(\d+)\s+(weeks?|months?|quarters?|years?)\b/i.exec(i);if(o){let x=Number(o[1]),v=o[2].toLowerCase().replace(/s$/,"");return Math.max(1,Math.round(x*n[v]))}let a=/\bnext\s+(week|month|quarter|year)\b/i.exec(i);if(a){let x=a[1].toLowerCase();return Math.max(1,n[x])}if(/\b(?:by|through)\s+(?:year[-\s]?end|end\s+of\s+(?:the\s+)?year|EOY)\b/i.test(i))return yo(t,e);let p=/\bby\s+Q([1-4])\b/i.exec(i);if(p)return bo(t,Number(p[1]),e)}function yo(i,t){let e=12-(t.getMonth()+1);return Math.max(1,yi(e,i))}function bo(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,yi(a,i))}function yi(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 vo=new Set(["line","area","spline","areaspline"]),Mt="(?:jan|feb|mar|apr|may|jun|jul|aug|sep|sept|oct|nov|dec)[a-z]*",le="(?:19|20)\\d{2}",bi="(?:0?[1-9]|[12]\\d|3[01])",St="(?:0?[1-9]|1[0-2])",wo=[new RegExp(`^${le}[-/.]${St}(?:[-/.]${bi})?$`,"i"),new RegExp(`^${bi}[-/.]${St}[-/.]${le}$`,"i"),new RegExp(`^${St}[-/.]${le}$`,"i"),new RegExp(`^${le}-?w\\d{1,2}$`,"i"),new RegExp(`^w(?:ee)?k\\s*\\d{1,2}[,\\s]+${le}$`,"i"),new RegExp(`^${Mt}[\\s-]*'?\\d{2}$`,"i"),new RegExp(`^${Mt}[\\s-]*${le}$`,"i"),new RegExp(`^${le}[\\s-]*${Mt}$`,"i"),new RegExp(`^q[1-4][\\s-]*${le}$`,"i"),new RegExp(`^${le}[\\s-]*q[1-4]$`,"i"),new RegExp("^fy\\s*'?\\d{2,4}$","i"),new RegExp(`^${le}$`)];function ko(i){let t=(i??[]).map(n=>String(n??"").trim()).filter(Boolean);return t.length<3?!1:t.filter(n=>wo.some(o=>o.test(n))).length/t.length>=.8}var Po=[/forecast/i,/confidence/i,/project/i,/upper|lower/i,/band/i,/target/i],wi=3;function it(i){return i?.config?.chart??i?.chart??{}}function ki(i){let t=it(i);return t?.enableForecasting===!0?!0:(Array.isArray(t?.data)?t.data:[]).some(n=>Array.isArray(n?.projected)&&n.projected.length>0)}function ot(i){let t=it(i),e=String(t?.type??"").toLowerCase();if(!vo.has(e))return!1;let n=Ao(i);if(!n||n.values.length<wi)return!1;let o=Si(t);return o.length?ko(o):!!n.times?.length}function Ao(i){let t=it(i),e=Mi(t);if(!e.length)return null;let n=e.find(o=>!Ti(o.name))??e[0];return Ai(t,n)}function Pi(i){let t=it(i),e=Mi(t).filter(o=>!Ti(o.name)),n=[];return e.forEach((o,a)=>{let p=Ai(t,o);p&&n.push(T(w({},p),{name:o.name||(e.length>1?`Series ${a+1}`:"")}))}),n}function Ai(i,t){let e=So(t.data),n=e.map(p=>p.value);if(n.length<wi)return null;let o=e.every(p=>p.time!==void 0)?e.map(p=>p.time):void 0,a=Si(i).slice(0,n.length);return w({labels:a.length===n.length?a:o?o.map(p=>Mo(p)):n.map((p,x)=>String(x+1)),values:n},o?{times:o}:{})}function Mo(i){return new Date(i).toLocaleDateString("en-US",{month:"short",year:"numeric"})}function Mi(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 Si(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 Ti(i){return Po.some(t=>t.test(i))}function So(i){let t=[];for(let e of i){let n=To(e);if(n===null)break;t.push(n)}return t}function To(i){if(typeof i=="number"&&Number.isFinite(i))return{value:i};if(Array.isArray(i)&&i.length===2&&typeof i[1]=="number")return w({value:i[1]},typeof i[0]=="number"?{time:i[0]}:{});if(i&&typeof i=="object"&&typeof i.y=="number"){let t=i;return w({value:t.y},typeof t.x=="number"?{time:t.x}:{})}return null}var qt={Weekly:{Weekly:1,Monthly:4,Quarterly:13,Yearly:52},Monthly:{Monthly:1,Quarterly:3,Yearly:12},Quarterly:{Quarterly:1,Yearly:4},Yearly:{Yearly:1}},Tt={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"}},vi=4;function qo(i,t,e){let n=qt[t]?.[e];return n?Math.max(1,Math.floor(i/n)):null}function qi(i,t,e){return e.map(n=>{let o=Tt[n]??Tt.Monthly,a=qo(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 ${Tt[i]?.adjective??i.toLowerCase()}`}:a<vi?{value:n,enabled:!1,fittedPeriods:a,maxHorizon:0,label:o,reason:`only ${a} ${a===1?o.singular:o.plural} of history, needs at least ${vi}`}:{value:n,enabled:!0,fittedPeriods:a,maxHorizon:Math.max(1,Math.floor(a/2)),label:o}})}function Di(i,t,e,n){if(t===e)return Math.max(1,Math.min(i,n));let o=qt[t]?.[e],a=qt[e]?.[t],p=o?i/o:a?i*a:i;return Math.max(1,Math.min(Math.round(p),n))}var Do="#2970FF",Fi="#7A5AF8";var Oi={Weekly:6048e5,Monthly:26298e5,Quarterly:78894e5,Yearly:315576e5},Ei={Weekly:"Week",Monthly:"Month",Quarterly:"Quarter",Yearly:"Year"};function Fo(i,t){if(i.times?.length===i.values.length)return i.times;let e=Date.now(),n=i.values.length;return i.values.map((o,a)=>Math.round(e-(n-1-a)*t))}function Ii(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 Vi(i,t){let e=Oi[i.granularity]??Oi.Monthly,n=Fo(i.history,e),o=n[n.length-1]??Date.now(),a=i.forecastTimes?.length===t.length?i.forecastTimes:t.map((P,N)=>Math.round(o+(N+1)*e)),p=t.length>0,x=[...n.map(P=>Ii(P,i.granularity)),...p?a.map(P=>Ii(P,i.granularity)):[]],v=(i.series?.length??0)>1,A=v?i.series.map(P=>w({name:P.note?`${P.name} \xB7 ${P.note}`:P.name,actual:P.values},P.points?.length?{projected:P.points.map(N=>N.value),interval:P.points.map(N=>[N.low,N.high])}:{})):[w({name:"Actuals",color:Do,actual:i.history.values},p?{projected:t.map(P=>P.value),interval:t.map(P=>[P.low,P.high])}:{})],S={type:"line",enableForecasting:!0,categories:x,data:A,lineWidth:2,showMarkers:!1,valueSuffix:i.valueSuffix??"",xAxisTitle:Ei[i.granularity]??Ei.Monthly,projection:T(w({start:null},v?{}:{color:Fi}),{dashStyle:"Dash",showNowLine:!0,nowLabel:"",bandLabel:"Projected",interval:T(w({name:`${i.confidence}% confidence`},v?{}:{color:Fi}),{opacity:.16,level:i.confidence})}),legend:{show:!0},height:"400px",loading:!1,options:{}};return{title:i.chartTitle,componentName:"nile-line-chart",widgetType:"chart",config:{aq:{chartTitle:i.chartTitle,chartSubtitle:i.chartSubtitle},chart:S},queryMeta:{sql:`-- forecast:${i.metric}`}}}function Dt(i,t=[]){let e=i.guardrails?.passed?i.points??[]:[],n=e[e.length-1],o=w({horizon:i.horizon,confidence:i.confidence,granularity:i.granularity},n?{value:n.value,low:n.low,high:n.high}:{}),a=e.length?Fe(i.narrative,o):i.guardrails?.body?`I can't forecast this reliably. ${i.guardrails.body}`:"I can't forecast this series.",p=Oo(i,t),x=i.skipped??[],v=(i.meta??[]).map(A=>({label:A.label,value:Fe(A.value,o)}));return x.length&&p.length>1&&v.push({label:"Series",value:`${p.length-x.length} of ${p.length} forecast \u2014 ${x.map(A=>A.name).join(", ")} left as history`}),{chart:Eo(i,e,p),answer:a,meta:v,points:e,horizon:i.horizon,granularity:i.granularity,confidence:i.confidence,maxHorizon:i.maxHorizon}}function Oo(i,t){let e=i.forecasts??[];if(e.length<2&&!(i.skipped?.length&&e.length))return[];let n=p=>String(p??"").toLowerCase().replace(/[^a-z0-9]/g,""),o=new Map(t.map(p=>[n(p.name??""),p])),a=e.map(p=>({name:p.name,values:p.history?.values??o.get(n(p.name))?.values??[],points:i.guardrails?.passed?p.points??[]:[]}));for(let p of i.skipped??[]){let x=o.get(n(p.name));x?.values?.length&&a.push({name:p.name,values:x.values,note:"not forecast"})}return a}function Eo(i,t,e=[]){return Vi(e.length?T(w({},i),{series:e}):i,t)}function Fe(i,t){return String(i??"").replace(/\{\{(\w+)\}\}/g,(e,n)=>n in t?String(t[n]):e)}function Ft(i){if(i.forecast||i.isStreaming||i.charts?.length!==1)return!1;let t=i.charts[0]?.config;return ki(t)?!1:ot(t)}var Vo=["aqChat"],Ro=["artifactGrid"],zo=["composerEl"],No=["aiExecutiveSummary"],Lo=()=>[1,2,3,4],De=()=>[],Ni=i=>({$implicit:i}),te=(i,t)=>t.id,se=(i,t)=>t.key,$o=(i,t)=>t.templateId,Wo=(i,t)=>t.identityKey,Li=(i,t)=>t.label,$i=(i,t)=>t.component,Bo=(i,t)=>t.name,at=(i,t)=>t.value,Uo=(i,t)=>t.action,Go=(i,t)=>t.datasetId,Ho=(i,t)=>t.schema+"."+t.name;function jo(i,t){if(i&1){let e=k();s(0,"button",32),u("click",function(){_(e);let o=r();return g(o.addReplyQuote())}),C(1,"nile-glyph",33),c(2),d()}if(i&2){let e=t,n=r();J("top",e.top,"px")("left",e.left,"px"),W("reply-badge--below",!e.above),l(2),q(" ",n.copy().replyButton," ")}}function Yo(i,t){if(i&1&&(s(0,"nile-nav-tab",50),c(1),d()),i&2){let e=r(3);l(),y(e.copy().chatTabLabel)}}function Qo(i,t){if(i&1&&(s(0,"nile-nav-tab",51),c(1),d()),i&2){let e=r(3);l(),y(e.copy().libraryTabLabel)}}function Xo(i,t){if(i&1&&(s(0,"nile-nav-tab",52),c(1),d()),i&2){let e=r(3);l(),y(e.copy().toolsTabLabel)}}function Ko(i,t){if(i&1){let e=k();s(0,"nile-nav-tab-group",49),u("nile-tab-change",function(o){_(e);let a=r(2);return g(a.setChatPaneTab(o.detail.value))}),m(1,Yo,2,1,"nile-nav-tab",50),m(2,Qo,2,1,"nile-nav-tab",51),m(3,Xo,2,1,"nile-nav-tab",52),d()}if(i&2){let e=r(2);M("value",e.chatPaneTab()),l(),h(e.features().chat?1:-1),l(),h(e.features().library?2:-1),l(),h(e.features().tools?3:-1)}}function Jo(i,t){if(i&1){let e=k();s(0,"span",37),C(1,"nile-glyph",53),s(2,"span",54),c(3),d(),s(4,"button",55),u("click",function(){_(e);let o=r(2);return g(o.clearScope())}),C(5,"nile-glyph",56),d()()}if(i&2){let e=t;l(),b("name",e.kind==="dataset"?"ng-database":"ng-dataflow-04"),l(2),Y("",e.kind==="dataset"?"Dataset":"Pipeline",": ",e.name)}}function Zo(i,t){i&1&&(s(0,"div",66),C(1,"nile-skeleton-loader",67)(2,"nile-skeleton-loader",68),d())}function ea(i,t){i&1&&C(0,"nile-glyph",72)}function ta(i,t){if(i&1){let e=k();s(0,"nile-menu-item",70),u("click",function(){let o=_(e).$implicit,a=r(5);return g(a.selectScope("dataset",o))}),s(1,"span",71),c(2),d(),m(3,ea,1,0,"nile-glyph",72),d()}if(i&2){let e,n=t.$implicit,o=r(5);l(2),y(n.name),l(),h(((e=o.selectedScope())==null?null:e.id)===n.id?3:-1)}}function na(i,t){if(i&1&&(s(0,"div",69),c(1),d()),i&2){let e=r(5);l(),y(e.copy().noDatasetsFound)}}function ia(i,t){if(i&1&&F(0,ta,4,2,"nile-menu-item",null,te,!1,na,2,1,"div",69),i&2){let e=r(4);O(e.datasets())}}function oa(i,t){if(i&1&&(s(0,"nile-menu-item")(1,"nile-dropdown",61)(2,"span",62),C(3,"nile-glyph",63),s(4,"span",64),c(5,"Dataset"),d(),C(6,"nile-glyph",65),d(),s(7,"nile-menu"),m(8,Zo,3,0,"div",66)(9,ia,3,1),d()()()),i&2){let e=r(3);l(8),h(e.scopeLoading()?8:9)}}function aa(i,t){i&1&&(s(0,"div",66),C(1,"nile-skeleton-loader",67)(2,"nile-skeleton-loader",68),d())}function ra(i,t){i&1&&C(0,"nile-glyph",72)}function la(i,t){if(i&1){let e=k();s(0,"nile-menu-item",70),u("click",function(){let o=_(e).$implicit,a=r(5);return g(a.selectScope("pipeline",o))}),s(1,"span",71),c(2),d(),m(3,ra,1,0,"nile-glyph",72),d()}if(i&2){let e,n=t.$implicit,o=r(5);l(2),y(n.name),l(),h(((e=o.selectedScope())==null?null:e.id)===n.id?3:-1)}}function sa(i,t){if(i&1&&(s(0,"div",69),c(1),d()),i&2){let e=r(5);l(),y(e.copy().noPipelinesFound)}}function da(i,t){if(i&1&&F(0,la,4,2,"nile-menu-item",null,te,!1,sa,2,1,"div",69),i&2){let e=r(4);O(e.pipelines())}}function ca(i,t){if(i&1&&(s(0,"nile-menu-item")(1,"nile-dropdown",61)(2,"span",62),C(3,"nile-glyph",73),s(4,"span",64),c(5,"Pipeline"),d(),C(6,"nile-glyph",65),d(),s(7,"nile-menu"),m(8,aa,3,0,"div",66)(9,da,3,1),d()()()),i&2){let e=r(3);l(8),h(e.scopeLoading()?8:9)}}function pa(i,t){if(i&1){let e=k();s(0,"nile-dropdown",57),u("nile-hide",function(){_(e);let o=r(2);return g(o.closeScopeMenu())}),s(1,"nile-lite-tooltip",58)(2,"button",59),u("click",function(){_(e);let o=r(2);return g(o.openScopeMenu())}),C(3,"nile-glyph",60),d()(),s(4,"nile-menu"),m(5,oa,10,1,"nile-menu-item"),m(6,ca,10,1,"nile-menu-item"),d()()}if(i&2){let e=r(2);b("open",e.showScopePicker()),l(5),h(e.features().scopePicker.dataset?5:-1),l(),h(e.features().scopePicker.pipeline?6:-1)}}function _a(i,t){if(i&1&&(s(0,"nile-menu-item",74)(1,"div",75),C(2,"nile-skeleton-loader",76),s(3,"div",77),C(4,"nile-skeleton-loader",78)(5,"nile-skeleton-loader",79),d()()()),i&2){let e=t.$implicit;l(3),J("max-width",e,"px")}}function ga(i,t){if(i&1&&F(0,_a,6,2,"nile-menu-item",74,G),i&2){let e=r(2);O(e.menuSkeletonRows)}}function ua(i,t){if(i&1&&(s(0,"div",46),c(1),d()),i&2){let e=r(2);l(),y(e.copy().noResultsMatchFilters)}}function ma(i,t){if(i&1){let e=k();s(0,"input",88),u("ngModelChange",function(o){_(e);let a=r(5);return g(a.renameDraft.set(o))})("click",function(o){return o.stopPropagation()})("keydown.enter",function(o){_(e);let a=r().$implicit,p=r(4);return g(p.commitRenameConversation(o,a))})("keydown.escape",function(o){_(e);let a=r(5);return g(a.cancelRename(o))})("blur",function(o){_(e);let a=r().$implicit,p=r(4);return g(p.commitRenameConversation(o,a))}),d()}if(i&2){let e=r(5);b("ngModel",e.renameDraft())}}function ha(i,t){if(i&1&&(s(0,"span",89),c(1),d(),s(2,"span",90),c(3),d()),i&2){let e=r().$implicit,n=r(4);b("title",e.title||"Untitled"),l(),y(e.title||"Untitled"),l(2),y(n.conversationMeta(e))}}function Ca(i,t){if(i&1){let e=k();s(0,"nile-menu-item",70),u("click",function(){let o=_(e).$implicit,a=r(4);return g(a.selectConversation(o.id))}),s(1,"div",75),C(2,"nile-glyph",81),s(3,"div",77),m(4,ma,1,1,"input",82)(5,ha,4,3),d(),s(6,"div",83)(7,"button",84),u("click",function(o){let a=_(e).$implicit,p=r(4);return g(p.startRename(o,a.id,a.title))}),C(8,"nile-glyph",85),d(),s(9,"button",86),u("click",function(o){let a=_(e).$implicit,p=r(4);return g(p.deleteConversation(o,a.id))}),C(10,"nile-glyph",87),d()()()()}if(i&2){let e=t.$implicit,n=r(4);M("active",e.id===n.activeConversationId()?"":null),l(4),h(n.renamingId()===e.id?4:5),l(3),M("aria-label",n.copy().renameLabel),l(2),M("aria-label",n.copy().deleteLabel)}}function fa(i,t){if(i&1&&(s(0,"div",80),c(1),d(),F(2,Ca,11,4,"nile-menu-item",null,te)),i&2){let e=t.$implicit;l(),y(e.label),l(),O(e.items)}}function xa(i,t){if(i&1&&(s(0,"div",46),c(1),d()),i&2){let e=r(3);l(),y(e.copy().noConversationsYet)}}function ya(i,t){if(i&1&&F(0,fa,4,1,null,null,se,!1,xa,2,1,"div",46),i&2){let e=r(2);O(e.groupedConversations())}}function ba(i,t){if(i&1&&(s(0,"nile-menu-item",74)(1,"div",75),C(2,"nile-skeleton-loader",76),s(3,"div",77),C(4,"nile-skeleton-loader",78)(5,"nile-skeleton-loader",95),d()()()),i&2){let e=t.$implicit;l(3),J("max-width",e,"px")}}function va(i,t){if(i&1&&F(0,ba,6,2,"nile-menu-item",74,G),i&2){let e=r(3);O(e.menuSkeletonRows)}}function wa(i,t){if(i&1&&(s(0,"div",46),c(1),d()),i&2){let e=r(3);l(),y(e.copy().noResultsMatchFilters)}}function ka(i,t){if(i&1){let e=k();s(0,"input",88),u("ngModelChange",function(o){_(e);let a=r(6);return g(a.renameDraft.set(o))})("click",function(o){return o.stopPropagation()})("keydown.enter",function(o){_(e);let a=r().$implicit,p=r(5);return g(p.commitRenameDashboard(o,a))})("keydown.escape",function(o){_(e);let a=r(6);return g(a.cancelRename(o))})("blur",function(o){_(e);let a=r().$implicit,p=r(5);return g(p.commitRenameDashboard(o,a))}),d()}if(i&2){let e=r(6);b("ngModel",e.renameDraft())}}function Pa(i,t){if(i&1&&(s(0,"span",89),c(1),d(),s(2,"span",90),c(3),d()),i&2){let e=r().$implicit,n=r(5);b("title",e.name||"Untitled"),l(),y(e.name||"Untitled"),l(2),y(n.dashboardMeta(e))}}function Aa(i,t){if(i&1){let e=k();s(0,"nile-menu-item",70),u("click",function(){let o=_(e).$implicit,a=r(5);return g(a.openRelatedDashboard(o.id))}),s(1,"div",75),C(2,"nile-glyph",96),s(3,"div",77),m(4,ka,1,1,"input",82)(5,Pa,4,3),d(),s(6,"div",83)(7,"button",84),u("click",function(o){let a=_(e).$implicit,p=r(5);return g(p.startRename(o,a.id,a.name))}),C(8,"nile-glyph",85),d(),s(9,"button",86),u("click",function(o){let a=_(e).$implicit,p=r(5);return g(p.deleteDashboardFromMenu(o,a.id))}),C(10,"nile-glyph",87),d()()()()}if(i&2){let e=t.$implicit,n=r(5);M("active",n.builderOpen()&&e.id===n.builderDashboardId()?"":null),l(4),h(n.renamingId()===e.id?4:5),l(3),M("aria-label",n.copy().renameLabel),l(2),M("aria-label",n.copy().deleteLabel)}}function Ma(i,t){if(i&1&&(s(0,"div",80),c(1),d(),F(2,Aa,11,4,"nile-menu-item",null,te)),i&2){let e=t.$implicit;l(),y(e.label),l(),O(e.items)}}function Sa(i,t){if(i&1&&(s(0,"div",46),c(1),d()),i&2){let e=r(4);l(),y(e.copy().noDashboardsYet)}}function Ta(i,t){if(i&1&&F(0,Ma,4,1,null,null,se,!1,Sa,2,1,"div",46),i&2){let e=r(3);O(e.groupedDashboards())}}function qa(i,t){if(i&1){let e=k();s(0,"nile-dropdown",91),u("nile-hide",function(){_(e);let o=r(2);return g(o.showRelatedDashboards.set(!1))}),s(1,"nile-lite-tooltip",92)(2,"button",93),u("click",function(){_(e);let o=r(2);return g(o.showRelatedDashboards.set(!o.showRelatedDashboards()))}),C(3,"nile-glyph",94),d()(),s(4,"nile-menu",43),u("nile-search-value",function(o){_(e);let a=r(2);return g(a.dashSearch.set((o.detail==null?null:o.detail.value)??""))}),s(5,"nile-menu-item",44),u("click",function(){_(e);let o=r(2);return g(o.openNewDashboard())}),C(6,"nile-glyph",45),c(7),d(),m(8,va,2,0)(9,wa,2,1,"div",46)(10,Ta,3,1),d()()}if(i&2){let e=r(2);b("open",e.showRelatedDashboards()),l(4),M("noResultsMessage",e.copy().noResultsMatchFilters),l(3),q(" ",e.copy().newDashboardLabel," "),l(),h(e.dashboardsLoading()?8:e.dashSearchEmpty()?9:10)}}function Da(i,t){if(i&1){let e=k();s(0,"nile-lite-tooltip",48)(1,"button",97),u("click",function(){_(e);let o=r(2);return g(o.openGallery())}),C(2,"nile-glyph",98),d()()}}function Fa(i,t){if(i&1){let e=k();s(0,"header",12)(1,"div",34),m(2,Ko,4,4,"nile-nav-tab-group",35),d(),s(3,"div",36),m(4,Jo,6,3,"span",37),m(5,pa,7,3,"nile-dropdown",38),s(6,"nile-dropdown",39),u("nile-hide",function(){_(e);let o=r();return g(o.showConversationPicker.set(!1))}),s(7,"nile-lite-tooltip",40)(8,"button",41),u("click",function(){_(e);let o=r();return g(o.showConversationPicker.set(!o.showConversationPicker()))}),C(9,"nile-glyph",42),d()(),s(10,"nile-menu",43),u("nile-search-value",function(o){_(e);let a=r();return g(a.convSearch.set((o.detail==null?null:o.detail.value)??""))}),s(11,"nile-menu-item",44),u("click",function(){_(e);let o=r();return g(o.newConversation())}),C(12,"nile-glyph",45),c(13),d(),m(14,ga,2,0)(15,ua,2,1,"div",46)(16,ya,3,1),d()(),m(17,qa,11,4,"nile-dropdown",47),m(18,Da,3,0,"nile-lite-tooltip",48),d()()}if(i&2){let e,n=r();l(2),h(n.tabsVisible()?2:-1),l(2),h((e=n.features().connections&&n.selectedScope())?4:-1,e),l(),h(n.features().scopePicker.enabled?5:-1),l(),b("open",n.showConversationPicker()),l(2),b("disabled",n.isStreaming()),l(2),M("noResultsMessage",n.copy().noResultsMatchFilters),l(3),q(" ",n.copy().newConversationLabel," "),l(),h(n.conversationsLoading()?14:n.convSearchEmpty()?15:16),l(3),h(n.features().dashboardsMenu?17:-1),l(),h(n.features().promptGallery?18:-1)}}function Oa(i,t){if(i&1){let e=k();s(0,"button",112),u("click",function(){let o=_(e).$implicit,a=r(4);return g(a.selectWidgetTemplateCategory(o.key))}),c(1),s(2,"span",113),c(3),d()()}if(i&2){let e=t.$implicit,n=r(4);W("aq-picker-chip--active",n.widgetTemplateActiveCategory()===e.key),l(),q("",e.label," "),l(2),y(n.widgetTemplateCountForCategory(e.key))}}function Ea(i,t){if(i&1){let e=k();s(0,"div",110)(1,"button",112),u("click",function(){_(e);let o=r(3);return g(o.selectWidgetTemplateCategory("all"))}),c(2),s(3,"span",113),c(4),d()(),F(5,Oa,4,4,"button",114,se),d()}if(i&2){let e=r(3);l(),W("aq-picker-chip--active",e.widgetTemplateActiveCategory()==="all"),l(),q("",e.copy().libraryAllCategoryLabel," "),l(2),y(e.widgetTemplateAllTemplates().length),l(),O(e.templateCategories())}}function Ia(i,t){if(i&1&&C(0,"nile-skeleton-loader",116),i&2){let e=t.$implicit;J("width",e,"px")}}function Va(i,t){if(i&1&&(s(0,"div",111),F(1,Ia,1,2,"nile-skeleton-loader",115,G),d()),i&2){let e=r(3);l(),O(e.libraryChipSkeletonWidths)}}function Ra(i,t){if(i&1){let e=k();s(0,"nile-input",108),u("nile-input",function(o){_(e);let a=r(2);return g(a.librarySearch.set((o.detail==null?null:o.detail.value)??""))})("nile-change",function(o){_(e);let a=r(2);return g(a.librarySearch.set((o.detail==null?null:o.detail.value)??""))}),C(1,"nile-glyph",109),d(),m(2,Ea,7,4,"div",110)(3,Va,3,0,"div",111)}if(i&2){let e=r(2);b("placeholder",e.copy().librarySearchWidgetsPlaceholder)("value",e.librarySearch()),l(2),h(!e.templateCategoriesLoading()&&!e.widgetTemplateTemplatesLoading()?2:3)}}function za(i,t){if(i&1){let e=k();s(0,"button",112),u("click",function(){let o=_(e).$implicit,a=r(4);return g(a.selectTemplateCategory(o.key))}),c(1),s(2,"span",113),c(3),d()()}if(i&2){let e=t.$implicit,n=r(4);W("aq-picker-chip--active",n.templateActiveCategory()===e.key),l(),q("",e.label," "),l(2),y(n.templateCountForCategory(e.key))}}function Na(i,t){if(i&1){let e=k();s(0,"div",110)(1,"button",112),u("click",function(){_(e);let o=r(3);return g(o.selectTemplateCategory("all"))}),c(2),s(3,"span",113),c(4),d()(),F(5,za,4,4,"button",114,se),d()}if(i&2){let e=r(3);l(),W("aq-picker-chip--active",e.templateActiveCategory()==="all"),l(),q("",e.copy().libraryAllCategoryLabel," "),l(2),y(e.templateAllTemplates().length),l(),O(e.templateCategories())}}function La(i,t){if(i&1&&C(0,"nile-skeleton-loader",116),i&2){let e=t.$implicit;J("width",e,"px")}}function $a(i,t){if(i&1&&(s(0,"div",111),F(1,La,1,2,"nile-skeleton-loader",115,G),d()),i&2){let e=r(3);l(),O(e.libraryChipSkeletonWidths)}}function Wa(i,t){if(i&1){let e=k();s(0,"nile-input",108),u("nile-input",function(o){_(e);let a=r(2);return g(a.librarySearch.set((o.detail==null?null:o.detail.value)??""))})("nile-change",function(o){_(e);let a=r(2);return g(a.librarySearch.set((o.detail==null?null:o.detail.value)??""))}),C(1,"nile-glyph",109),d(),m(2,Na,7,4,"div",110)(3,$a,3,0,"div",111)}if(i&2){let e=r(2);b("placeholder",e.copy().librarySearchDashboardsPlaceholder)("value",e.librarySearch()),l(2),h(e.templateCategoriesLoading()?3:2)}}function Ba(i,t){if(i&1&&(s(0,"div",123),C(1,"nile-skeleton-loader",124)(2,"nile-skeleton-loader",125)(3,"nile-skeleton-loader",126)(4,"nile-skeleton-loader",127),d()),i&2){let e=t.$implicit;l(),M("width",e)}}function Ua(i,t){if(i&1&&(s(0,"div",118)(1,"div",119),C(2,"nile-skeleton-loader",120)(3,"nile-skeleton-loader",121),d(),s(4,"div",122),F(5,Ba,5,1,"div",123,G),d()()),i&2){let e=t.$implicit;l(5),O(e)}}function Ga(i,t){if(i&1&&(s(0,"div",117),F(1,Ua,7,0,"div",118,G),d()),i&2){let e=r(3);l(),O(e.librarySkeletonGroups)}}function Ha(i,t){if(i&1){let e=k();s(0,"div",132),u("click",function(){let o=_(e).$implicit,a=r(6);return g(a.openWidgetDetailFromCard(o.templateId))}),C(1,"nile-kpi-chart",133),s(2,"button",134),u("click",function(o){let a=_(e).$implicit,p=r(6);return o.stopPropagation(),g(p.toggleWidgetTemplateSelection(a.templateId))}),C(3,"nile-glyph",135),d()()}if(i&2){let e=t.$implicit,n=r(6);W("aq-lib-card-wrap--selected",n.widgetTemplatePickerSelectedIds().includes(e.templateId)),l(),b("label",e.title)("description",e.desc??"")("value",e.value)("loading",e.loading)("sparkline",e.sparkline)("options",n.libraryKpiChartOptions)("sparklineColor",n.brandSparklineColor()),l(),W("aq-lib-card__check--on",n.widgetTemplatePickerSelectedIds().includes(e.templateId))}}function ja(i,t){if(i&1){let e=k();s(0,"div",118)(1,"div",119)(2,"span",129),c(3),d(),s(4,"button",130),u("click",function(){let o=_(e).$implicit,a=r(5);return g(a.toggleLibraryGroupSelection(o.cards))}),c(5),d()(),s(6,"div",122),F(7,Ha,4,11,"div",131,$o),d()()}if(i&2){let e=t.$implicit,n=r(5);l(3),Y("",e.label," \xB7 ",e.cards.length),l(2),q(" ",n.isGroupFullySelected(e.cards)?n.copy().libraryClearSelectionButton:n.copy().librarySelectAllButton," "),l(2),O(e.cards)}}function Ya(i,t){if(i&1&&F(0,ja,9,3,"div",118,se),i&2){let e=r(4);O(e.libraryWidgetGroups())}}function Qa(i,t){if(i&1&&(s(0,"div",128),c(1),d()),i&2){let e=r(4);l(),y(e.librarySearch()?e.copy().noWidgetsMatch:e.copy().noWidgetsInCategory)}}function Xa(i,t){if(i&1&&m(0,Ya,2,0)(1,Qa,2,1,"div",128),i&2){let e=r(3);h(e.libraryWidgetGroups().length?0:1)}}function Ka(i,t){if(i&1&&m(0,Ga,3,0,"div",117)(1,Xa,2,1),i&2){let e=r(2);h(e.templateCategoriesLoading()||e.widgetTemplateTemplatesLoading()?0:1)}}function Ja(i,t){if(i&1&&(s(0,"div",137),C(1,"nile-skeleton-loader",138),s(2,"div",139),C(3,"nile-skeleton-loader",124)(4,"nile-skeleton-loader",126)(5,"nile-skeleton-loader",140),d()()),i&2){let e=t.$implicit;l(3),M("width",e)}}function Za(i,t){if(i&1&&(s(0,"div",118)(1,"div",119),C(2,"nile-skeleton-loader",120),d(),s(3,"div",136),F(4,Ja,6,1,"div",137,G),d()()),i&2){let e=t.$implicit;l(4),O(e)}}function er(i,t){if(i&1&&(s(0,"div",117),F(1,Za,6,0,"div",118,G),d()),i&2){let e=r(3);l(),O(e.librarySkeletonGroups)}}function tr(i,t){if(i&1&&(s(0,"div",144),C(1,"db-dash-card-chart",152),d()),i&2){let e=r().$implicit;l(),b("config",e.preview)}}function nr(i,t){i&1&&(s(0,"div",145),C(1,"span",153)(2,"span",154)(3,"span",155)(4,"span",156)(5,"span",157),d())}function ir(i,t){if(i&1&&(s(0,"span",146),C(1,"nile-glyph",158),c(2),d()),i&2){let e=r().$implicit,n=r(5);l(2),q(" ",n.withCount(n.copy().libraryWidgetCountChip,(e.widgets==null?null:e.widgets.length)??0)," ")}}function or(i,t){if(i&1&&(s(0,"div",150),c(1),d()),i&2){let e=r().$implicit;l(),y(e.description)}}function ar(i,t){if(i&1){let e=k();s(0,"button",142),u("click",function(){let o=_(e).$implicit,a=r(5);return g(a.openWidgetDetailPanelForTemplate(o))}),s(1,"div",143),m(2,tr,2,1,"div",144)(3,nr,6,0,"div",145),m(4,ir,3,1,"span",146),d(),s(5,"div",147)(6,"div",148)(7,"span",149),c(8),d(),m(9,or,2,1,"div",150),d(),C(10,"nile-glyph",151),d()()}if(i&2){let e=t.$implicit;l(2),h(e.preview!=null&&e.preview.chart?2:3),l(2),h(e.widgets!=null&&e.widgets.length?4:-1),l(4),y(e.name),l(),h(e.description?9:-1)}}function rr(i,t){if(i&1&&(s(0,"div",118)(1,"div",119)(2,"span",129),c(3),d()(),s(4,"div",136),F(5,ar,11,4,"button",141,te),d()()),i&2){let e=t.$implicit;l(3),Y("",e.label," \xB7 ",e.templates.length),l(2),O(e.templates)}}function lr(i,t){if(i&1&&F(0,rr,7,2,"div",118,se),i&2){let e=r(3);O(e.libraryDashboardGroups())}}function sr(i,t){if(i&1&&(s(0,"div",128),c(1),d()),i&2){let e=r(3);l(),y(e.librarySearch()?e.copy().noDashboardsMatch:e.copy().noDashboardsInCategory)}}function dr(i,t){if(i&1&&m(0,er,3,0,"div",117)(1,lr,2,0)(2,sr,2,1,"div",128),i&2){let e=r(2);h(e.templateTemplatesLoading()?0:e.libraryDashboardGroups().length?1:2)}}function cr(i,t){if(i&1){let e=k();s(0,"div",107)(1,"span",159),c(2),d(),s(3,"nile-button",22),u("click",function(){_(e);let o=r(2);return g(o.addSelectedWidgetTemplates())}),C(4,"nile-glyph",160),c(5),d()()}if(i&2){let e=r(2);l(2),q(" ",e.withCount(e.copy().librarySelectedCount,e.widgetTemplatePickerSelectedIds().length)," "),l(3),q(" ",e.withCount(e.copy().libraryAddToCanvasButton,e.widgetTemplatePickerSelectedIds().length)," ")}}function pr(i,t){if(i&1){let e=k();s(0,"div",13)(1,"div",99)(2,"p",100)(3,"strong",101),c(4),d(),c(5),d(),s(6,"nile-nav-tab-group",102),u("nile-tab-change",function(o){_(e);let a=r();return a.artifactPickerTab.set(o.detail.value),a.widgetTemplatePickerSelectedIds.set([]),g(a.librarySearch.set(""))}),s(7,"nile-nav-tab",103),c(8),s(9,"span",104),c(10),d()(),s(11,"nile-nav-tab",105),c(12),s(13,"span",104),c(14),d()()(),m(15,Ra,4,3)(16,Wa,4,3),d(),s(17,"div",106),m(18,Ka,2,1)(19,dr,3,1),d(),m(20,cr,6,2,"div",107),d()}if(i&2){let e=r();l(4),y(e.copy().libraryIntroTitle),l(),q(" ",e.copy().libraryIntro," "),l(),M("value",e.artifactPickerTab()),l(2),y(e.copy().libraryWidgetsTabLabel),l(2),y(e.widgetTemplateAllTemplates().length),l(2),y(e.copy().libraryDashboardsTabLabel),l(2),y(e.templateAllTemplates().length),l(),h(e.artifactPickerTab()==="kpis"?15:16),l(3),h(e.artifactPickerTab()==="kpis"?18:19),l(2),h(e.artifactPickerTab()==="kpis"&&e.widgetTemplatePickerSelectedIds().length?20:-1)}}function _r(i,t){i&1&&(s(0,"div",182),C(1,"nile-skeleton-loader",183)(2,"nile-skeleton-loader",184),d())}function gr(i,t){if(i&1&&F(0,_r,3,0,"div",182,G),i&2){let e=r(2);O(e.cohortCriteriaSkeletonRows)}}function ur(i,t){if(i&1&&(s(0,"p",185),c(1),d()),i&2){let e=r(3);l(),y(e.copy().cohortLogUnavailableMessage)}}function mr(i,t){if(i&1){let e=k();s(0,"p",185),c(1),d(),s(2,"nile-button",21),u("click",function(){_(e);let o=r(3);return g(o.retryCohortCriteria())}),c(3),d()}if(i&2){let e=r(3);l(),y(e.copy().cohortCriteriaErrorMessage),l(2),q(" ",e.copy().cohortPreviewRetryButton," ")}}function hr(i,t){i&1&&(s(0,"div",170),m(1,ur,2,1,"p",185)(2,mr,4,2),d()),i&2&&(l(),h(t==="unavailable"?1:2))}function Cr(i,t){if(i&1){let e=k();s(0,"button",187),u("click",function(){let o=_(e).$implicit,a=r(3);return g(a.selectCohortCriterion(o.id))}),C(1,"span",188),s(2,"span",189),c(3),d()()}if(i&2){let e=t.$implicit,n=r(3);W("is-selected",n.selectedCriterionId()===e.id),M("aria-checked",n.selectedCriterionId()===e.id),l(3),y(e.label)}}function fr(i,t){if(i&1&&F(0,Cr,4,4,"button",186,te),i&2){let e=r(2);O(e.cohortCriteria())}}function xr(i,t){i&1&&(s(0,"div",191)(1,"span",192),C(2,"nile-skeleton-loader",76),d(),C(3,"nile-skeleton-loader",193)(4,"nile-skeleton-loader",194),d())}function yr(i,t){if(i&1&&(s(0,"div",171),C(1,"nile-skeleton-loader",190),F(2,xr,5,0,"div",191,G),d()),i&2){let e=r(2);l(2),O(e.cohortMatchSkeletonRows)}}function br(i,t){if(i&1&&(s(0,"p",196),c(1),d()),i&2){let e=r(3);l(),y(e.copy().cohortEmptyMatchesMessage)}}function vr(i,t){if(i&1&&(s(0,"p",196),c(1),d()),i&2){let e=r(3);l(),y(e.copy().cohortNamesWithheldMessage)}}function wr(i,t){if(i&1&&(s(0,"span",201),c(1),d()),i&2){let e=r().$implicit;l(),q("",e.daysInState,"d")}}function kr(i,t){if(i&1&&(s(0,"div",198)(1,"span",200),c(2),d(),m(3,wr,2,1,"span",201),d()),i&2){let e=t.$implicit;l(2),y(e.name??"\u2014"),l(),h(e.daysInState!==null&&e.daysInState!==void 0?3:-1)}}function Pr(i,t){i&1&&(s(0,"div",202)(1,"span",192),C(2,"nile-skeleton-loader",76),d(),C(3,"nile-skeleton-loader",193)(4,"nile-skeleton-loader",194),d())}function Ar(i,t){if(i&1&&F(0,Pr,5,0,"div",202,G),i&2){let e=r(4);O(e.cohortMatchSkeletonRows)}}function Mr(i,t){if(i&1&&(s(0,"p",199),c(1),d()),i&2){let e=r(4);l(),y(e.cohortMatchesTruncatedNote())}}function Sr(i,t){if(i&1&&(s(0,"p",199),c(1),d()),i&2){let e=r(4);l(),y(e.copy().cohortMembersForbiddenMessage)}}function Tr(i,t){if(i&1&&(s(0,"p",199),c(1),d()),i&2){let e=r(5);l(),y(e.copy().cohortMembersErrorMessage)}}function qr(i,t){if(i&1){let e=k();s(0,"button",204),u("click",function(){_(e);let o=r(5);return g(o.toggleAllCohortMatches())}),c(1),d()}if(i&2){let e=r(5);b("disabled",e.cohortMembersLoading()),M("aria-expanded",e.cohortMatchesExpanded())("aria-busy",e.cohortMembersLoading()?"true":null),l(),y(e.cohortViewAllLabel())}}function Dr(i,t){if(i&1&&(m(0,Tr,2,1,"p",199),m(1,qr,2,4,"button",203)),i&2){let e=r(4);h(e.cohortMembersError()==="failed"?0:-1),l(),h(e.cohortHasMoreMatches()?1:-1)}}function Fr(i,t){if(i&1&&(s(0,"div",197),F(1,kr,4,2,"div",198,Wo),m(3,Ar,2,0),d(),m(4,Mr,2,1,"p",199),m(5,Sr,2,1,"p",199)(6,Dr,2,2)),i&2){let e=r(3);W("is-expanded",e.cohortMatchesExpanded()),l(),O(e.visibleCohortMatches()),l(2),h(e.cohortMembersLoading()?3:-1),l(),h(e.cohortMatchesExpanded()&&e.cohortMatchesTruncated()?4:-1),l(),h(e.cohortMembersError()==="forbidden"?5:6)}}function Or(i,t){if(i&1&&(s(0,"div",172)(1,"p",195),c(2),d(),m(3,br,2,1,"p",196)(4,vr,2,1,"p",196)(5,Fr,7,5),d()),i&2){let e=r(2);l(2),y(e.cohortMatchSummary()),l(),h(t.matchCount===0?3:e.cohortNamesWithheld()?4:5)}}function Er(i,t){if(i&1&&(s(0,"p",185),c(1),d()),i&2){let e=r(3);l(),y(e.copy().cohortLogUnavailableMessage)}}function Ir(i,t){if(i&1){let e=k();s(0,"nile-button",21),u("click",function(){let o=_(e),a=r(4);return g(a.selectCohortCriterion(o))}),c(1),d()}if(i&2){let e=r(4);l(),q(" ",e.copy().cohortPreviewRetryButton," ")}}function Vr(i,t){if(i&1&&(s(0,"p",185),c(1),d(),m(2,Ir,2,1,"nile-button",205)),i&2){let e,n=r(3);l(),y(n.copy().cohortPreviewErrorMessage),l(),h((e=n.selectedCriterionId())?2:-1,e)}}function Rr(i,t){i&1&&(s(0,"div",173),m(1,Er,2,1,"p",185)(2,Vr,3,2),d()),i&2&&(l(),h(t==="unavailable"?1:2))}function zr(i,t){if(i&1){let e=k();s(0,"div",14)(1,"div",161)(2,"span",162),C(3,"nile-glyph",163),d(),s(4,"span",164),c(5),d()(),s(6,"p",165),c(7),d(),s(8,"div",166)(9,"span",167),c(10,"1"),d(),s(11,"span",168),c(12),d()(),s(13,"div",169),m(14,gr,2,0)(15,hr,3,1,"div",170)(16,fr,2,0),d(),s(17,"div",166)(18,"span",167),c(19,"2"),d(),s(20,"span",168),c(21),d()(),m(22,yr,4,0,"div",171)(23,Or,6,2,"div",172)(24,Rr,3,1,"div",173),C(25,"div",174),s(26,"div",175)(27,"p",176),c(28),d(),s(29,"div",177)(30,"nile-button",178),u("click",function(){_(e);let o=r();return g(o.addCohortToCanvas())}),C(31,"nile-glyph",179),c(32),d(),s(33,"nile-button",180),u("click",function(){_(e);let o=r();return g(o.addCohortToCanvas())}),C(34,"nile-glyph",181),c(35),d()()()()}if(i&2){let e,n,o=r();l(5),y(o.copy().cohortBuilderTitle),l(2),y(o.copy().cohortBuilderSubtitle),l(5),y(o.copy().cohortStep1Label),l(),M("aria-label",o.copy().cohortStep1Label),l(),h(o.cohortCriteriaLoading()&&!o.cohortCriteria().length?14:(e=o.cohortCriteriaError())?15:16,e),l(7),y(o.copy().cohortStep2Label),l(),h(o.cohortPreviewLoading()?22:(n=o.cohortPreview())?23:(n=o.cohortPreviewError())?24:-1,n),l(6),y(o.copy().cohortAddToCanvasDisclaimer),l(2),M("disabled",o.cohortPreview()?null:""),l(2),q(" ",o.copy().cohortPreviewWidgetButton," "),l(),M("disabled",o.cohortPreview()?null:""),l(2),q(" ",o.copy().cohortAddToCanvasButton," ")}}function Nr(i,t){i&1&&(s(0,"div",216),C(1,"nile-skeleton-loader",217),s(2,"div",218),C(3,"nile-skeleton-loader",78),d()())}function Lr(i,t){i&1&&(s(0,"div",215),F(1,Nr,4,0,"div",216,G),d()),i&2&&(l(),O(pe(0,Lo)))}function $r(i,t){if(i&1&&(s(0,"span",225),c(1),d()),i&2){let e=r().$implicit;l(),y(e.badge)}}function Wr(i,t){if(i&1){let e=k();s(0,"button",222),u("click",function(){let o=_(e).$implicit,a=r(5);return g(a.onWelcomePromptPick(o))}),C(1,"nile-glyph",223),s(2,"span",224),c(3),d(),m(4,$r,2,1,"span",225),d()}if(i&2){let e=t.$implicit;W("prompt-card--ai",e.tone==="ai"),l(),M("name",e.icon)("color",e.tone==="ai"?"#7a5af8":"var(--ng-colors-text-quaternary-500)"),l(2),y(e.label),l(),h(e.badge?4:-1)}}function Br(i,t){if(i&1&&(s(0,"div",219),F(1,Wr,5,6,"button",221,Li),d()),i&2){let e=r(4);l(),O(e.welcomePromptCards())}}function Ur(i,t){if(i&1){let e=k();s(0,"button",227),u("click",function(){_(e);let o=r(5);return g(o.openGallery())}),C(1,"nile-glyph",228),s(2,"span"),c(3),d()()}if(i&2){let e=r(5);l(3),y(e.copy().promptGalleryLabel)}}function Gr(i,t){if(i&1){let e=k();s(0,"button",227),u("click",function(){_(e);let o=r(5);return g(o.openXray())}),C(1,"nile-glyph",229),s(2,"span"),c(3),d()()}if(i&2){let e=r(5);l(3),y(e.copy().xrayLabel)}}function Hr(i,t){if(i&1&&(s(0,"div",220),m(1,Ur,4,1,"button",226),m(2,Gr,4,1,"button",226),d()),i&2){let e=r(4);l(),h(e.features().promptGallery?1:-1),l(),h(e.features().xray?2:-1)}}function jr(i,t){if(i&1&&(m(0,Br,3,0,"div",219),m(1,Hr,3,2,"div",220)),i&2){let e=r(3);h(e.features().welcomePrompts?0:-1),l(),h(e.features().promptGallery||e.features().xray?1:-1)}}function Yr(i,t){if(i&1&&(s(0,"div",206)(1,"div",208)(2,"div",209),C(3,"nile-glyph",210),d(),s(4,"h2",211),c(5),d(),s(6,"p",212),c(7),d(),s(8,"div",213),xe(9,214),d(),m(10,Lr,3,1,"div",215)(11,jr,2,2),d()()),i&2){let e=r(2),n=de(8);l(5),y(e.copy().welcomeTitle),l(2),y(e.copy().welcomeSubtitle),l(2),b("ngTemplateOutlet",n),l(),h(e.features().welcomePrompts&&!e.welcomePromptCards().length?10:11)}}function Qr(i,t){i&1&&(s(0,"div",232),C(1,"nile-skeleton-loader",233),d(),s(2,"div",234),C(3,"nile-skeleton-loader",235)(4,"nile-skeleton-loader",236)(5,"nile-skeleton-loader",237),d(),s(6,"div",232),C(7,"nile-skeleton-loader",238),d(),s(8,"div",234),C(9,"nile-skeleton-loader",239)(10,"nile-skeleton-loader",240),d())}function Xr(i,t){if(i&1&&(s(0,"div",246),C(1,"nile-glyph",250),s(2,"span",251),c(3),d()()),i&2){let e=r(2).$implicit;l(3),y(e.quotedText)}}function Kr(i,t){if(i&1&&(s(0,"span",256),c(1),d()),i&2){let e=r().$implicit;l(),y(e.answer)}}function Jr(i,t){if(i&1&&(s(0,"div",252),C(1,"nile-glyph",253),s(2,"div",254)(3,"span",255),c(4),d(),m(5,Kr,2,1,"span",256),d()()),i&2){let e=t.$implicit;l(4),y(e.title),l(),h(e.answer&&e.answer!=="Use this"?5:-1)}}function Zr(i,t){if(i&1&&(s(0,"div",247),F(1,Jr,6,2,"div",252,G),d()),i&2){let e=r(2).$implicit,n=r(4);l(),O(n.answerSummaryRows(e))}}function el(i,t){if(i&1&&(s(0,"span",248),c(1),d()),i&2){let e=r(2).$implicit;l(),y(e.text)}}function tl(i,t){if(i&1&&(s(0,"div",257),C(1,"nile-glyph",258),s(2,"span",259),c(3),d()()),i&2){let e=t.$implicit;l(),M("name",e.contentType.startsWith("image/")?"ng-image-03":"ng-file-06"),l(),M("title",e.name),l(),y(e.name)}}function nl(i,t){if(i&1&&(s(0,"div",249),F(1,tl,4,3,"div",257,se),d()),i&2){let e=r(2).$implicit;l(),O(e.attachments??pe(0,De))}}function il(i,t){if(i&1){let e=k();s(0,"div",242),u("swipeReply",function(){_(e);let o=r().$implicit,a=r(4);return g(a.replyToMessage(o))}),s(1,"span",243),C(2,"nile-glyph",244),d(),s(3,"nile-ai-chat-bubble",245),m(4,Xr,4,1,"div",246),m(5,Zr,3,0,"div",247)(6,el,2,1,"span",248),m(7,nl,3,1,"div",249),d()()}if(i&2){let e=r().$implicit;l(3),b("role","user"),l(),h(e.quotedText?4:-1),l(),h(e.answerSummary?5:6),l(2),h(e.attachments!=null&&e.attachments.length?7:-1)}}function ol(i,t){if(i&1&&C(0,"nile-ai-steps",260),i&2){let e=r(2).$implicit;b("steps",e.tools)}}function al(i,t){if(i&1&&C(0,"nile-ai-token-stream",271),i&2){let e=r(4).$implicit,n=r(4);b("text",n.cleanText(e.text))("speedMs",n.streamSpeed)}}function rl(i,t){if(i&1&&C(0,"nile-markdown",272),i&2){let e=r(4).$implicit,n=r(4);b("value",n.cleanMarkdown(e.text))}}function ll(i,t){if(i&1&&m(0,al,1,2,"nile-ai-token-stream",271)(1,rl,1,1,"nile-markdown",272),i&2){let e=r(3).$implicit;h(e.isStreaming?0:1)}}function sl(i,t){if(i&1&&(s(0,"span",273),c(1),d()),i&2){let e=r().$implicit;l(),Y("Setup ",e.step.current," of ",e.step.total)}}function dl(i,t){i&1&&(s(0,"span",282),c(1),d()),i&2&&(l(),y(t))}function cl(i,t){if(i&1&&(s(0,"span",284),c(1),d()),i&2){let e=r().$implicit;l(),y(e.hint)}}function pl(i,t){if(i&1&&(s(0,"span"),c(1),d()),i&2){let e=r().$implicit;st("choice-card__chip"+(e.tone?" choice-card__chip--"+e.tone:"")),l(),y(e.text)}}function _l(i,t){if(i&1&&m(0,pl,2,3,"span",286),i&2){let e=t.$implicit;h(e.tone!=="green"&&e.tone!=="yellow"&&e.tone!=="red"?0:-1)}}function gl(i,t){if(i&1&&(s(0,"span",285),F(1,_l,1,1,null,null,G),d()),i&2){let e=r().$implicit;l(),O(e.meta)}}function ul(i,t){if(i&1&&(s(0,"nile-radio",278)(1,"span",279)(2,"span",280),c(3),d(),s(4,"span",281),m(5,dl,2,1,"span",282),s(6,"span",283),c(7),d(),m(8,cl,2,1,"span",284),m(9,gl,3,0,"span",285),d()()()),i&2){let e,n=t.$implicit,o=t.$index,a=t.$index,p=r(2).$implicit,x=r(3).$implicit,v=r(4);W("choice-card--chosen",(p.selected||p.draftSelection)===n.id)("choice-card--locked",!!p.selected||v.isStreaming()),M("name","choice-"+x.id+"-"+o)("value",n.id)("checked",(p.selected||p.draftSelection)===n.id?"":null)("disabled",p.selected||v.isStreaming()?"":null),l(3),y(a+1),l(2),h((e=v.optionBadgeText(n))?5:-1,e),l(2),y(v.optionPrimaryText(n)),l(),h(!v.optionBadgeText(n)&&n.hint?8:-1),l(),h(n.meta!=null&&n.meta.length?9:-1)}}function ml(i,t){if(i&1){let e=k();s(0,"nile-radio-group",276),u("nile-change",function(o){_(e);let a=r().$implicit,p=r(3).$implicit,x=r(4);return g(x.onChoiceChange(p,a,o.detail.value))}),F(1,ul,10,13,"nile-radio",277,te),d()}if(i&2){let e=r(),n=e.$implicit,o=e.$index,a=r(3).$implicit,p=r(4);M("label",n.prompt||"Choose an index")("name","choice-"+a.id+"-"+o)("value",n.selected||n.draftSelection||null)("disabled",n.selected||p.isStreaming()?"":null),l(),O(n.options)}}function hl(i,t){if(i&1&&(s(0,"p",275),c(1),d()),i&2){let e=r(8);l(),y(e.copy().noChoiceOptions)}}function Cl(i,t){if(i&1&&c(0),i&2){let e=r(3).$implicit;q(" \u2713 Something else: ",e.chatDraftText," (edit) ")}}function fl(i,t){if(i&1&&(C(0,"nile-glyph",292),c(1)),i&2){let e=r(10);l(),q(" ",e.copy().somethingElseButton," ")}}function xl(i,t){if(i&1){let e=k();s(0,"button",289),u("click",function(){_(e);let o=r(3).$implicit,a=r(3).$implicit,p=r(4);return g(p.requestPlan(a,o))}),c(1),d()}if(i&2){let e=r(10);b("disabled",e.isStreaming()),l(),q(" ",e.copy().givePlanButton," ")}}function yl(i,t){if(i&1){let e=k();s(0,"button",293),u("click",function(){_(e);let o=r(3).$implicit,a=r(3).$implicit,p=r(4);return g(p.previewWidget(a,o))}),C(1,"nile-glyph",294),c(2),d()}if(i&2){let e=r(3).$implicit,n=r(7);b("disabled",n.isStreaming()),l(2),q(' Preview "',n.choiceTitle(e),'" ')}}function bl(i,t){if(i&1){let e=k();s(0,"div",287)(1,"button",289),u("click",function(){_(e);let o=r(2).$implicit,a=r(3).$implicit,p=r(4);return g(p.openChatDraft(a,o))}),m(2,Cl,1,1)(3,fl,2,1),d(),m(4,xl,2,2,"button",290),m(5,yl,3,2,"button",291),d()}if(i&2){let e=r(2).$implicit,n=r(7);l(),b("disabled",n.isStreaming()),l(),h(e.chatDraftText!=null&&e.chatDraftText.trim()?2:3),l(2),h(e.kind==="clarification"?4:-1),l(),h(e.kind==="widget_plan"?5:-1)}}function vl(i,t){if(i&1){let e=k();s(0,"div",288)(1,"span",295),c(2,"Something else"),d(),s(3,"div",296)(4,"nile-input",297),u("nile-input",function(o){_(e);let a=r(2).$implicit,p=r(3).$implicit,x=r(4);return g(x.onChatDraftTextChange(p,a,o.detail.value))})("keydown.enter",function(){_(e);let o=r(2).$implicit,a=r(3).$implicit,p=r(4);return g(p.defineChatDraft(a,o))}),d(),s(5,"nile-button",22),u("click",function(){_(e);let o=r(2).$implicit,a=r(3).$implicit,p=r(4);return g(p.defineChatDraft(a,o))}),c(6),d()()()}if(i&2){let e=r(2).$implicit,n=r(7);l(4),b("value",e.chatDraftText??""),M("placeholder",e.kind==="widget_clarification"?n.copy().chatDraftPlaceholderWidget:e.kind==="widget_plan"?n.copy().chatDraftPlaceholderPlan:e.kind==="plan_intake"?n.copy().chatDraftPlaceholderIntake:n.copy().chatDraftPlaceholderClarification)("disabled",n.isStreaming()?"":null),l(),M("disabled",!(e.chatDraftText!=null&&e.chatDraftText.trim())||n.isStreaming()?"":null),l(),q(" ",n.copy().defineItButton," ")}}function wl(i,t){if(i&1&&m(0,bl,6,4,"div",287)(1,vl,7,5,"div",288),i&2){let e=r().$implicit;h(e.chatOpen?1:0)}}function kl(i,t){if(i&1&&(s(0,"div",265),m(1,sl,2,2,"span",273),m(2,ml,3,4,"nile-radio-group",274)(3,hl,2,1,"p",275),m(4,wl,2,1),d()),i&2){let e=t.$implicit;l(),h(e.step?1:-1),l(),h(e.options.length?2:3),l(2),h((e.kind==="widget_clarification"||e.kind==="clarification"||e.kind==="widget_plan"||e.kind==="plan_intake")&&!e.selected&&e.options.length?4:-1)}}function Pl(i,t){if(i&1){let e=k();s(0,"button",298),u("click",function(){_(e);let o=r(3).$implicit,a=r(4);return g(a.resumeChoicePanel(o))}),c(1),d()}if(i&2){let e=r(3).$implicit,n=r(4);l(),Y(" ",n.panelAnsweredCount(e.choices??pe(2,De))," of ",(e.choices??pe(3,De)).length," answered \u2014 Resume ")}}function Al(i,t){i&1&&(s(0,"span",300),C(1,"span",306),c(2,"Live "),d())}function Ml(i,t){i&1&&(s(0,"span",301),c(1,"Preview"),d())}function Sl(i,t){i&1&&C(0,"div",309)}function Tl(i,t){if(i&1&&C(0,"nile-glyph",313),i&2){let e=r().$implicit;J("color",e.color),b("name",e.glyph)("method",e.method||"stroke")}}function ql(i,t){if(i&1){let e=k();m(0,Sl,1,0,"div",309),s(1,"nile-menu-item",310),u("click",function(){let o=_(e).$implicit;r();let a=de(1),p=r(4).$implicit;return r(4).onInlineWidgetMenuItem(p,o),g(a.hide())}),s(2,"span",311),m(3,Tl,1,4,"nile-glyph",312),c(4),d()()}if(i&2){let e=t.$implicit;h(e.divider?0:-1),l(3),h(e.glyph?3:-1),l(),q(" ",e.label," ")}}function Dl(i,t){if(i&1&&(s(0,"nile-dropdown",302,4)(2,"button",307),C(3,"nile-glyph",308),d(),s(4,"nile-menu"),F(5,ql,5,3,null,null,se),d()()),i&2){let e=r(4).$implicit,n=r(4);l(5),O(n.inlineWidgetMenuItems(e))}}function Fl(i,t){i&1&&(s(0,"div",317),C(1,"nile-spinner",320),s(2,"span"),c(3,"Loading chart types\u2026"),d()())}function Ol(i,t){if(i&1&&(s(0,"p",318),c(1),d()),i&2){let e=r(9);l(),y(e.copy().noChartTypesFit)}}function El(i,t){i&1&&C(0,"nile-spinner",320)}function Il(i,t){if(i&1&&C(0,"nile-glyph",325),i&2){let e=r().$implicit,n=r(11);b("name",n.chartTypeIcon(e.type))}}function Vl(i,t){if(i&1){let e=k();s(0,"button",324),u("click",function(){let o=_(e).$implicit,a=r(11);return g(a.selectInlineChartType(o.component))}),m(1,El,1,0,"nile-spinner",320)(2,Il,1,1,"nile-glyph",325),s(3,"span"),c(4),d()()}if(i&2){let e=t.$implicit,n=r(11);M("disabled",n.inlineChartTypeApplying()?"":null),l(),h(n.inlineChartTypeApplyingComponent()===e.component?1:2),l(3),y(e.label)}}function Rl(i,t){if(i&1&&(s(0,"p",321),c(1,"Recommended"),d(),s(2,"div",322),F(3,Vl,5,3,"button",323,$i),d()),i&2){let e=r(10);l(3),O(e.inlineSensibleChartTypes())}}function zl(i,t){i&1&&C(0,"nile-spinner",320)}function Nl(i,t){if(i&1&&C(0,"nile-glyph",325),i&2){let e=r().$implicit,n=r(11);b("name",n.chartTypeIcon(e.type))}}function Ll(i,t){if(i&1){let e=k();s(0,"button",327),u("click",function(){let o=_(e).$implicit,a=r(11);return g(a.selectInlineChartType(o.component))}),m(1,zl,1,0,"nile-spinner",320)(2,Nl,1,1,"nile-glyph",325),s(3,"span"),c(4),d()()}if(i&2){let e=t.$implicit,n=r(11);M("disabled",n.inlineChartTypeApplying()?"":null),l(),h(n.inlineChartTypeApplyingComponent()===e.component?1:2),l(3),y(e.label)}}function $l(i,t){if(i&1&&(s(0,"p",321),c(1,"Other types"),d(),s(2,"div",322),F(3,Ll,5,3,"button",326,$i),d()),i&2){let e=r(10);l(3),O(e.inlineOtherChartTypes())}}function Wl(i,t){if(i&1&&(m(0,Rl,5,0),m(1,$l,5,0)),i&2){let e=r(9);h(e.inlineSensibleChartTypes().length>0?0:-1),l(),h(e.inlineOtherChartTypes().length>0?1:-1)}}function Bl(i,t){if(i&1&&(s(0,"p",319),c(1),d()),i&2){let e=r(9);l(),y(e.inlineChartTypeError())}}function Ul(i,t){if(i&1){let e=k();s(0,"nile-dropdown",314),u("nile-hide",function(){_(e);let o=r(8);return g(o.closeInlineChartTypePicker())}),C(1,"span",315),s(2,"div",316),m(3,Fl,4,0,"div",317)(4,Ol,2,1,"p",318)(5,Wl,2,2),m(6,Bl,2,1,"p",319),d()()}if(i&2){let e=r(4).$implicit,n=r(4);b("open",n.inlineChartTypePickerFor()===e.charts[0]),l(3),h(n.inlineChartTypeLoading()?3:n.inlineChartTypeOptions().length===0?4:5),l(3),h(n.inlineChartTypeError()?6:-1)}}function Gl(i,t){if(i&1){let e=k();s(0,"span",330),c(1),s(2,"button",331),u("click",function(){let o=_(e).$implicit,a=r(6).$implicit,p=r(4);return g(p.removeInlineFilter(a.charts[0],o.id))}),C(3,"nile-glyph",332),d()()}if(i&2){let e=t.$implicit,n=r(6).$implicit,o=r(4);l(),q(" ",o.inlineFilterChipLabel(n.charts[0],e)," "),l(),M("disabled",o.inlineFilterApplying()?"":null)}}function Hl(i,t){if(i&1&&(s(0,"div",329),F(1,Gl,4,2,"span",330,te),d()),i&2){let e=r(5).$implicit,n=r(4);l(),O(n.inlineActiveFilters(e.charts[0]))}}function jl(i,t){i&1&&(s(0,"div",317),C(1,"nile-spinner",320),s(2,"span"),c(3,"Loading filterable fields\u2026"),d()())}function Yl(i,t){if(i&1&&(s(0,"p",319),c(1),d()),i&2){let e=r(9);l(),y(e.inlineFilterFieldsError())}}function Ql(i,t){if(i&1&&(s(0,"p",318),c(1),d()),i&2){let e=r(9);l(),y(e.copy().noFilterableFields)}}function Xl(i,t){if(i&1&&(s(0,"option",335),c(1),d()),i&2){let e=t.$implicit;b("value",e.name),l(),y(e.label)}}function Kl(i,t){if(i&1&&(s(0,"option",335),c(1),d()),i&2){let e=t.$implicit;b("value",e.value),l(),y(e.label)}}function Jl(i,t){i&1&&(s(0,"div",317),C(1,"nile-spinner",336),s(2,"span"),c(3,"Loading values\u2026"),d()())}function Zl(i,t){if(i&1){let e=k();s(0,"input",340),u("ngModelChange",function(o){_(e);let a=r(11);return g(a.inlineFilterBuilderValue.set(o))})("keydown.enter",function(){_(e);let o=r(7).$implicit,a=r(4);return g(a.addInlineFilter(o.charts[0]))}),d()}if(i&2){let e=r(11);b("placeholder",e.copy().filterValuePlaceholder)("ngModel",e.inlineFilterBuilderValue())}}function es(i,t){if(i&1){let e=k();s(0,"span",342),c(1,"and"),d(),s(2,"input",341),u("ngModelChange",function(o){_(e);let a=r(12);return g(a.inlineFilterBuilderValue2.set(o))}),d()}if(i&2){let e=r(12);l(2),b("ngModel",e.inlineFilterBuilderValue2())}}function ts(i,t){if(i&1){let e=k();s(0,"input",341),u("ngModelChange",function(o){_(e);let a=r(11);return g(a.inlineFilterBuilderValue.set(o))}),d(),m(1,es,3,1)}if(i&2){let e,n=r(7).$implicit,o=r(4);b("ngModel",o.inlineFilterBuilderValue()),l(),h((e=o.inlineFilterSelectedOperator(n.charts[0]))!=null&&e.needsSecondValue?1:-1)}}function ns(i,t){if(i&1){let e=k();s(0,"span",342),c(1,"and"),d(),s(2,"input",344),u("ngModelChange",function(o){_(e);let a=r(12);return g(a.inlineFilterBuilderValue2.set(o))}),d()}if(i&2){let e=r(12);l(2),b("placeholder",e.copy().filterValuePlaceholder)("ngModel",e.inlineFilterBuilderValue2())}}function is(i,t){if(i&1){let e=k();s(0,"input",343),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,ns,3,2)}if(i&2){let e,n=r(7).$implicit,o=r(4);b("placeholder",o.copy().filterValuePlaceholder)("ngModel",o.inlineFilterBuilderValue()),l(),h((e=o.inlineFilterSelectedOperator(n.charts[0]))!=null&&e.needsSecondValue?1:-1)}}function os(i,t){if(i&1){let e=k();s(0,"label",345)(1,"input",346),u("change",function(){let o=_(e).$implicit,a=r(12);return g(a.toggleInlineFilterMultiValue(o.value))}),d(),s(2,"span"),c(3),d()()}if(i&2){let e=t.$implicit,n=r(12);l(),b("checked",n.inlineFilterBuilderValues().includes(e.value)),l(2),Y("",e.label,"",e.count!=null?" ("+e.count+")":"")}}function as(i,t){if(i&1&&(s(0,"div",338),F(1,os,4,3,"label",345,at),d()),i&2){let e=r(11);l(),O(e.inlineFilterValuesFor(e.inlineFilterBuilderFieldId()))}}function rs(i,t){if(i&1&&(s(0,"option",335),c(1),d()),i&2){let e=t.$implicit;b("value",e.value),l(),Y("",e.label,"",e.count!=null?" ("+e.count+")":"")}}function ls(i,t){if(i&1){let e=k();s(0,"select",334),u("ngModelChange",function(o){_(e);let a=r(11);return g(a.inlineFilterBuilderValue.set(o))}),s(1,"option",347),c(2,"Select\u2026"),d(),F(3,rs,2,3,"option",335,at),d()}if(i&2){let e=r(11);b("ngModel",e.inlineFilterBuilderValue()),l(3),O(e.inlineFilterValuesFor(e.inlineFilterBuilderFieldId()))}}function ss(i,t){if(i&1&&m(0,Zl,1,2,"input",337)(1,ts,2,2)(2,is,2,3)(3,as,3,0,"div",338)(4,ls,5,1,"select",339),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 ds(i,t){if(i&1&&(s(0,"p",319),c(1),d()),i&2){let e=r(10);l(),y(e.inlineFilterApplyError())}}function cs(i,t){if(i&1){let e=k();s(0,"div",333)(1,"select",334),u("ngModelChange",function(o){_(e);let a=r(5).$implicit,p=r(4);return g(p.onInlineFilterFieldChange(a.charts[0],o))}),F(2,Xl,2,2,"option",335,Bo),d(),s(4,"select",334),u("ngModelChange",function(o){_(e);let a=r(9);return g(a.onInlineFilterOperatorChange(o))}),F(5,Kl,2,2,"option",335,at),d(),m(7,Jl,4,0,"div",317)(8,ss,5,1),s(9,"nile-button",21),u("click",function(){_(e);let o=r(5).$implicit,a=r(4);return g(a.addInlineFilter(o.charts[0]))}),c(10," Add filter "),d()(),m(11,ds,2,1,"p",319)}if(i&2){let e=r(5).$implicit,n=r(4);l(),b("ngModel",n.inlineFilterBuilderFieldId()),l(),O(n.inlineFilterFields(e.charts[0])),l(2),b("ngModel",n.inlineFilterBuilderOperator()),l(),O(n.inlineFilterOperators(e.charts[0])),l(2),h(n.inlineFilterValuesLoading()?7:8),l(2),M("loading",n.inlineFilterApplying()?"":null)("disabled",n.inlineFilterApplying()?"":null),l(2),h(n.inlineFilterApplyError()?11:-1)}}function ps(i,t){if(i&1){let e=k();s(0,"nile-dropdown",314),u("nile-hide",function(){_(e);let o=r(8);return g(o.closeInlineFilterBuilder())}),C(1,"span",315),s(2,"div",328)(3,"p",318),c(4,"Filters this preview only \u2014 nothing is saved."),d(),m(5,Hl,3,0,"div",329),m(6,jl,4,0,"div",317)(7,Yl,2,1,"p",319)(8,Ql,2,1,"p",318)(9,cs,12,6),d()()}if(i&2){let e=r(4).$implicit,n=r(4);b("open",n.inlineFilterPickerFor()===e.charts[0]),l(5),h(n.inlineActiveFilters(e.charts[0]).length>0?5:-1),l(),h(n.inlineFilterFieldsLoading()?6:n.inlineFilterFieldsError()?7:n.inlineFilterFields(e.charts[0]).length===0?8:9)}}function _s(i,t){if(i&1&&(s(0,"span",348)(1,"span",349),c(2),d(),s(3,"span",350),c(4),d()()),i&2){let e=t.$implicit;l(2),q("",e.label,":"),l(2),y(e.value)}}function gs(i,t){if(i&1&&(s(0,"div",304),F(1,_s,5,2,"span",348,Li),d()),i&2){let e=r(4).$implicit;l(),O(e.forecastMeta??pe(0,De))}}function us(i,t){if(i&1){let e=k();s(0,"nile-button",351),u("click",function(){_(e);let o=r(5).$implicit,a=r(4);return g(a.tryAlternatePreview(o.charts[0]))}),c(1),d()}if(i&2){let e=r(5).$implicit,n=r(4);b("disabled",n.isStreaming()),l(),q(' Try "',n.previewAltLabel(e.charts[0]),'" instead ')}}function ms(i,t){if(i&1){let e=k();s(0,"nile-button",351),u("click",function(){_(e);let o=r(4).$implicit,a=r(4);return g(a.skipPreview(o.charts[0]))}),c(1," Skip this widget "),d(),m(2,us,2,2,"nile-button",352),s(3,"nile-button",353),u("click",function(){_(e);let o=r(4).$implicit,a=r(4);return g(a.acceptPreview(o.charts[0]))}),C(4,"nile-glyph",160),c(5," Add to dashboard "),d()}if(i&2){let e=r(4).$implicit,n=r(4);b("disabled",n.isStreaming()),l(2),h(n.previewAltLabel(e.charts[0])?2:-1),l(),b("disabled",n.isStreaming())}}function hs(i,t){if(i&1&&(s(0,"div",46),c(1),d()),i&2){let e=r(10);l(),y(e.copy().noResultsMatchFilters)}}function Cs(i,t){i&1&&xe(0)}function fs(i,t){if(i&1){let e=k();s(0,"nile-menu-item",70),u("click",function(){let o=_(e).$implicit,a=r(8).$implicit,p=r(4);return g(p.addInlineToExisting(a.charts,o.id))}),Ae(1,Cs,1,0,"ng-container",359),d()}if(i&2){let e=t.$implicit;r(12);let n=de(40);l(),b("ngTemplateOutlet",n)("ngTemplateOutletContext",dt(2,Ni,e))}}function xs(i,t){if(i&1&&(s(0,"div",80),c(1),d(),F(2,fs,2,4,"nile-menu-item",null,te)),i&2){let e=t.$implicit;l(),y(e.label),l(),O(e.items)}}function ys(i,t){if(i&1&&(s(0,"div",46),c(1),d()),i&2){let e=r(11);l(),y(e.copy().noDashboardsYet)}}function bs(i,t){if(i&1&&F(0,xs,4,1,null,null,se,!1,ys,2,1,"div",46),i&2){let e=r(10);O(e.groupedPickerDashboards())}}function vs(i,t){if(i&1){let e=k();s(0,"nile-dropdown",357),u("nile-hide",function(){_(e);let o=r(9);return g(o.inlinePickerFor.set(null))}),s(1,"nile-button",358),u("click",function(){_(e);let o=r(5).$implicit,a=r(4);return g(a.inlinePickerFor.set(a.inlinePickerFor()===o.id?null:o.id))}),C(2,"nile-glyph",160),c(3),d(),s(4,"nile-menu",43),u("nile-search-value",function(o){_(e);let a=r(9);return g(a.pickerSearch.set((o.detail==null?null:o.detail.value)??""))}),s(5,"nile-menu-item",44),u("click",function(){_(e);let o=r(5).$implicit,a=r(4);return g(a.addInlineWidget(o.charts))}),C(6,"nile-glyph",45),c(7),d(),m(8,hs,2,1,"div",46)(9,bs,3,1),d()()}if(i&2){let e=r(5).$implicit,n=r(4);b("open",n.inlinePickerFor()===e.id),l(),M("loading",n.committingAction()==="add"?"":null)("disabled",n.committingAction()?"":null),l(2),q(" ",n.copy().addToDashboardButton," "),l(),M("noResultsMessage",n.copy().noResultsMatchFilters),l(3),q(" ",n.copy().newDashboardLabel," "),l(),h(n.pickerSearchEmpty()?8:9)}}function ws(i,t){if(i&1){let e=k();s(0,"nile-button",22),u("click",function(){_(e);let o=r(5).$implicit,a=r(4);return g(a.addInlineDefault(o.charts))}),C(1,"nile-glyph",160),c(2),d()}if(i&2){let e=r(9);M("loading",e.committingAction()==="add"?"":null)("disabled",e.committingAction()?"":null),l(2),q(" ",e.builderOpen()?e.copy().addToCurrentDashboardButton:e.copy().addToDashboardButton," ")}}function ks(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",354),c(2),d(),m(3,vs,10,7,"nile-dropdown",355)(4,ws,3,3,"nile-button",356)}if(i&2){let e=r(8);l(2),q(" ",e.copy().addToLibraryButton," "),l(),h(!e.builderOpen()&&e.conversationDashboards().length>1?3:4)}}function Ps(i,t){if(i&1){let e=k();s(0,"div",267)(1,"div")(2,"shared-nile-chart-widget",299),u("aiSend",function(o){_(e);let a=r(7);return g(a.onInlineAiSend(o))}),m(3,Al,3,0,"span",300),m(4,Ml,2,0,"span",301),m(5,Dl,7,0,"nile-dropdown",302),m(6,Ul,7,3,"nile-dropdown",303),m(7,ps,10,3,"nile-dropdown",303),d()(),m(8,gs,3,1,"div",304),s(9,"div",305),m(10,ms,6,3)(11,ks,5,2),d()()}if(i&2){let e=r(3).$implicit,n=r(4);l(),st(n.inlineChartClass(e.charts[0])),l(),b("config",n.inlineDisplayConfig(e.charts[0]))("loading",!!e.forecastRecomputing||n.isInlineRecordsLoading(e.charts[0]))("widgetId",e.id)("conversationId",n.activeConversationId()),l(),h(e.forecast?3:-1),l(),h(n.isPreviewChart(e.charts[0])?4:-1),l(),h(n.inlineWidgetMenuItems(e).length?5:-1),l(),h(n.isFilterChart(e.charts[0])?-1:6),l(),h(n.isFilterChart(e.charts[0])?-1:7),l(),h(e.forecastMeta!=null&&e.forecastMeta.length?8:-1),l(2),h(n.isPreviewChart(e.charts[0])?10:11)}}function As(i,t){i&1&&(s(0,"span",301),c(1,"Preview"),d(),c(2," \xB7 "))}function Ms(i,t){if(i&1){let e=k();s(0,"nile-button",351),u("click",function(){_(e);let o=r(5).$implicit,a=r(4);return g(a.tryAlternatePreview(o.charts[0]))}),c(1),d()}if(i&2){let e=r(5).$implicit,n=r(4);b("disabled",n.isStreaming()),l(),q(' Try "',n.previewAltLabel(e.charts[0]),'" instead ')}}function Ss(i,t){if(i&1){let e=k();s(0,"div",305)(1,"nile-button",351),u("click",function(){_(e);let o=r(4).$implicit,a=r(4);return g(a.skipPreview(o.charts[0]))}),c(2," Skip this widget "),d(),m(3,Ms,2,2,"nile-button",352),s(4,"nile-button",353),u("click",function(){_(e);let o=r(4).$implicit,a=r(4);return g(a.acceptPreview(o.charts[0]))}),C(5,"nile-glyph",160),c(6," Add to dashboard "),d()()}if(i&2){let e=r(4).$implicit,n=r(4);l(),b("disabled",n.isStreaming()),l(2),h(n.previewAltLabel(e.charts[0])?3:-1),l(),b("disabled",n.isStreaming())}}function Ts(i,t){if(i&1){let e=k();s(0,"div",360),u("click",function(){_(e);let o=r(3).$implicit,a=r(4);return g(a.openArtifact(o.charts,o.id))}),s(1,"div",361),C(2,"nile-glyph",362),d(),s(3,"div",363)(4,"span",364),c(5),d(),s(6,"span",365),m(7,As,3,0),c(8),d()(),s(9,"nile-button",22),u("click",function(o){_(e);let a=r(3).$implicit,p=r(4);return o.stopPropagation(),g(p.openArtifact(a.charts,a.id))}),c(10),C(11,"nile-glyph",366),d()(),m(12,Ss,7,3,"div",305)}if(i&2){let e=r(3).$implicit,n=r(4);l(5),y(e.dashboardTitle||e.charts[0].title),l(2),h(n.isPreviewChart(e.charts[0])?7:-1),l(),Y(" Dashboard \xB7 ",e.charts.length," widget",e.charts.length!==1?"s":""," "),l(2),q(" ",n.copy().viewButton," "),l(2),h(e.charts.length===1&&n.isPreviewChart(e.charts[0])?12:-1)}}function qs(i,t){if(i&1){let e=k();s(0,"div",268),C(1,"nile-glyph",367),s(2,"span",368),c(3),d(),s(4,"button",369),u("click",function(){_(e);let o=r(3).$implicit,a=r(4);return g(a.recomputeStoredForecast(o))}),c(5),d()()}if(i&2){let e=r(3).$implicit,n=r(4);l(3),y(n.restoredForecastLabel(e)),l(),b("disabled",n.isStreaming()),l(),q(" ",n.copy().recomputeButton," ")}}function Ds(i,t){if(i&1&&C(0,"nile-glyph",372),i&2){let e=r().$implicit;M("name",e.icon)("color",e.tone==="ai"?"#7a5af8":"var(--ng-colors-text-quaternary-500)")}}function Fs(i,t){if(i&1&&(s(0,"span",374),c(1),d()),i&2){let e=r().$implicit;l(),y(e.badge)}}function Os(i,t){if(i&1){let e=k();s(0,"button",371),u("click",function(){let o=_(e).$implicit,a=r(4).$implicit,p=r(4);return g(p.onFollowUp(o,a))}),m(1,Ds,1,2,"nile-glyph",372),s(2,"span",373),c(3),d(),m(4,Fs,2,1,"span",374),d()}if(i&2){let e=t.$implicit,n=r(8);W("follow-up--ai",e.tone==="ai"),b("disabled",n.isStreaming()),l(),h(e.icon?1:-1),l(2),y(e.label),l(),h(e.badge?4:-1)}}function Es(i,t){if(i&1&&(s(0,"div",269),F(1,Os,5,6,"button",370,Uo),d()),i&2){let e=r(3).$implicit;l(),O(e.followUps??pe(0,De))}}function Is(i,t){if(i&1&&(s(0,"div",270),C(1,"nile-glyph",375),s(2,"span",376),c(3),d()()),i&2){let e=r(7);l(3),y(e.copy().errors.assistantErrorFallback)}}function Vs(i,t){if(i&1){let e=k();s(0,"div",262),u("swipeReply",function(){_(e);let o=r(2).$implicit,a=r(4);return g(a.replyToMessage(o))}),s(1,"span",243),C(2,"nile-glyph",244),d(),s(3,"nile-ai-chat-bubble",263)(4,"div",264),m(5,ll,2,1),F(6,kl,5,3,"div",265,G),m(8,Pl,2,4,"button",266),m(9,Ps,12,13,"div",267)(10,Ts,13,6),m(11,qs,6,3,"div",268),m(12,Es,3,1,"div",269),m(13,Is,4,1,"div",270),d()()()}if(i&2){let e=r(2).$implicit,n=r(4);b("aqSwipeDisabled",e.isStreaming),l(3),b("role","ai")("hideIcon",!0),l(2),h(e.text&&!n.suppressTextFor(e)?5:-1),l(),O(n.nonPanelChoices(e)),l(2),h(n.isMultiChoice(e)&&n.isChoicePanelDismissed(e)&&!n.isChoicePanelComplete(e.choices??pe(9,De))?8:-1),l(),h(e.charts.length===1&&!n.isDataGrid(e.charts[0])?9:e.charts.length?10:-1),l(2),h(n.isRestoredForecast(e)?11:-1),l(),h(e.followUps!=null&&e.followUps.length?12:-1),l(),h(e.hasError?13:-1)}}function Rs(i,t){if(i&1&&(m(0,ol,1,1,"nile-ai-steps",260),m(1,Vs,14,10,"div",261)),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 zs(i,t){if(i&1&&(m(0,il,8,4,"div",241),m(1,Rs,2,2)),i&2){let e=t.$implicit;h(e.role==="user"?0:-1),l(),h(e.role==="assistant"?1:-1)}}function Ns(i,t){if(i&1&&F(0,zs,2,2,null,null,te),i&2){let e=r(3);O(e.messages())}}function Ls(i,t){if(i&1&&(s(0,"span",379),c(1),d()),i&2){let e=r(2);l(),Lt("",t," ",e.index+1," OF ",e.choices.length)}}function $s(i,t){if(i&1&&(s(0,"span",379),c(1),d()),i&2){let e=r(2);l(),Y("",e.index+1," OF ",e.choices.length)}}function Ws(i,t){i&1&&(s(0,"span",393),c(1),d()),i&2&&(l(),y(t))}function Bs(i,t){if(i&1&&(s(0,"span",395),c(1),d()),i&2){let e=r().$implicit;l(),y(e.hint)}}function Us(i,t){if(i&1){let e=k();s(0,"nile-radio",389),u("click",function(){_(e);let o=r(2),a=r(4);return g(a.onPanelSkip(o.msg))}),s(1,"span",390)(2,"span",391),c(3),d(),s(4,"span",392),m(5,Ws,2,1,"span",393),s(6,"span",394),c(7),d(),m(8,Bs,2,1,"span",395),d()()()}if(i&2){let e,n=t.$implicit,o=t.$index,a=r(2),p=r(4);M("name","choice-panel-"+a.msg.id+"-"+a.index)("value",n.id)("checked",(a.choices[a.index].draftSelection||a.choices[a.index].selected)===n.id?"":null)("disabled",p.isStreaming()?"":null),l(3),y(o+1),l(2),h((e=p.optionBadgeText(n))?5:-1,e),l(2),y(p.optionPrimaryText(n)),l(),h(!p.optionBadgeText(n)&&n.hint?8:-1)}}function Gs(i,t){if(i&1){let e=k();s(0,"button",293),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",294),c(2),d()}if(i&2){let e=r(3),n=r(4);b("disabled",n.isStreaming()),l(2),q(' Preview "',n.choiceTitle(e.choices[e.index]),'" ')}}function Hs(i,t){if(i&1){let e=k();s(0,"button",289),u("click",function(){_(e);let o=r(3),a=r(4);return g(a.requestPlan(o.msg,o.choices[o.index]))}),c(1),d()}if(i&2){let e=r(7);b("disabled",e.isStreaming()),l(),q(" ",e.copy().givePlanButton," ")}}function js(i,t){if(i&1){let e=k();s(0,"div",287)(1,"button",289),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",292),c(3),d(),m(4,Gs,3,2,"button",291),m(5,Hs,2,2,"button",290),s(6,"button",396),u("click",function(){_(e);let o=r(2),a=r(4);return g(a.onPanelSkip(o.msg))}),c(7," Skip "),d()()}if(i&2){let e=r(2),n=r(4);l(),b("disabled",n.isStreaming()),l(2),q(" ",n.copy().somethingElseButton," "),l(),h(e.choices[e.index].kind==="widget_plan"?4:-1),l(),h(e.choices[e.index].kind==="clarification"?5:-1),l(),M("disabled",n.isStreaming()?"":null)}}function Ys(i,t){if(i&1){let e=k();s(0,"div",288)(1,"div",296)(2,"nile-input",297),u("nile-input",function(o){_(e);let a=r(2),p=r(4);return g(p.onChatDraftTextChange(a.msg,a.choices[a.index],o.detail.value))})("keydown.enter",function(){_(e);let o=r(2),a=r(4);return g(a.onPanelChatDraftConfirm(o.msg,o.choices[o.index]))}),d(),s(3,"nile-button",22),u("click",function(){_(e);let o=r(2),a=r(4);return g(a.onPanelChatDraftConfirm(o.msg,o.choices[o.index]))}),c(4),d()()()}if(i&2){let e=r(2),n=r(4);l(2),b("value",e.choices[e.index].chatDraftText??""),M("placeholder",n.chatDraftPlaceholderFor(e.choices[e.index]))("disabled",n.isStreaming()?"":null),l(),M("disabled",!(e.choices[e.index].chatDraftText!=null&&e.choices[e.index].chatDraftText.trim())||n.isStreaming()?"":null),l(),q(" ",n.copy().defineItButton," ")}}function Qs(i,t){if(i&1){let e=k();s(0,"div",378),m(1,Ls,2,3,"span",379)(2,$s,2,2,"span",379),s(3,"div",380)(4,"button",381),u("click",function(){_(e);let o=r(),a=r(4);return g(a.onPanelPrev(o.msg))}),C(5,"nile-glyph",382),d(),s(6,"button",381),u("click",function(){_(e);let o=r(),a=r(4);return g(a.onPanelSkip(o.msg))}),C(7,"nile-glyph",383),d(),s(8,"button",384),u("click",function(){_(e);let o=r(),a=r(4);return g(a.dismissChoicePanel(o.msg))}),C(9,"nile-glyph",385),d()()(),s(10,"nile-radio-group",386),u("nile-change",function(o){_(e);let a=r(),p=r(4);return g(p.onChoiceChange(a.msg,a.choices[a.index],o.detail.value))}),F(11,Us,9,8,"nile-radio",387,te),d(),m(13,js,8,5,"div",287)(14,Ys,5,5,"div",288),s(15,"p",388),c(16,"\u2191\u2193 to navigate \xB7 \u21B5 to select \xB7 or type below"),d()}if(i&2){let e,n=r(),o=r(4);l(),h((e=o.panelBadgeLabel(n.choices[n.index]))?1:2,e),l(3),M("disabled",n.index===0?"":null),l(2),M("disabled",o.isStreaming()?"":null),l(4),M("label",n.choices[n.index].prompt||"Choose an option")("name","choice-panel-"+n.msg.id+"-"+n.index)("value",n.choices[n.index].draftSelection||n.choices[n.index].selected||null)("disabled",o.isStreaming()?"":null),l(),O(n.choices[n.index].options),l(2),h(n.choices[n.index].chatOpen?14:13)}}function Xs(i,t){if(i&1&&(s(0,"li",398)(1,"span",400),c(2),d(),s(3,"span",401),c(4),d()()),i&2){let e=t.$implicit,n=r(6);l(2),y(n.choiceTitle(e)),l(2),y(n.panelAnswerLabel(e))}}function Ks(i,t){if(i&1){let e=k();s(0,"div",378)(1,"span",379),c(2,"READY TO SUBMIT"),d(),s(3,"button",384),u("click",function(){_(e);let o=r(),a=r(4);return g(a.dismissChoicePanel(o.msg))}),C(4,"nile-glyph",385),d()(),s(5,"ul",397),F(6,Xs,5,2,"li",398,G),d(),s(8,"div",399)(9,"button",381),u("click",function(){_(e);let o=r(),a=r(4);return g(a.onPanelPrev(o.msg))}),C(10,"nile-glyph",382),c(11," Back "),d(),s(12,"nile-button",22),u("click",function(){_(e);let o=r(),a=r(4);return g(a.submitChoices(o.msg))}),c(13),d()()}if(i&2){let e=r(),n=r(4);l(6),O(e.choices),l(6),M("disabled",!n.hasPendingDraft(e.msg)||n.isStreaming()?"":null),l(),q(" ",n.copy().submitAnswersButton," ")}}function Js(i,t){if(i&1&&(s(0,"div",377),m(1,Qs,17,8)(2,Ks,14,2),d()),i&2){let e=t;l(),h(e.index<e.choices.length?1:2)}}function Zs(i,t){if(i&1&&(s(0,"div",231),m(1,Js,3,1,"div",377),xe(2,214),d()),i&2){let e,n=r(3),o=de(8);l(),h((e=n.activeChoicePanel())?1:-1,e),l(),b("ngTemplateOutlet",o)}}function ed(i,t){if(i&1){let e=k();s(0,"nile-ai-chat",230,3),u("mouseup",function(o){_(e);let a=r(2);return g(a.onThreadMouseUp(o))}),m(2,Qr,11,0)(3,Ns,2,0),m(4,Zs,3,2,"div",231),d()}if(i&2){let e=r(2);l(2),h(e.loadingConversation()?2:3),l(2),h(e.messages().length?4:-1)}}function td(i,t){if(i&1&&m(0,Yr,12,4,"div",206)(1,ed,5,2,"nile-ai-chat",207),i&2){let e=r();h(!e.loadingConversation()&&!e.messages().length?0:1)}}function nd(i,t){if(i&1&&(s(0,"div",403),C(1,"nile-glyph",410),s(2,"span"),c(3),d()()),i&2){let e=r(2);l(3),y(e.copy().dropFilesOverlay)}}function id(i,t){if(i&1){let e=k();s(0,"div",404),C(1,"nile-glyph",33),s(2,"span",411),c(3),d(),s(4,"button",412),u("click",function(){_(e);let o=r(2);return g(o.clearReplyQuote())}),C(5,"nile-glyph",413),d()()}i&2&&(l(3),y(t))}function od(i,t){i&1&&C(0,"nile-spinner",416)}function ad(i,t){if(i&1){let e=k();s(0,"button",419),u("click",function(){_(e);let o=r().$implicit,a=r(3);return g(a.retryAttachment(o.id))}),c(1,"Retry"),d()}}function rd(i,t){if(i&1){let e=k();s(0,"div",415),C(1,"nile-glyph",258),s(2,"span",259),c(3),d(),m(4,od,1,0,"nile-spinner",416)(5,ad,2,0,"button",417),s(6,"button",418),u("click",function(){let o=_(e).$implicit,a=r(3);return g(a.removeAttachment(o.id))}),C(7,"nile-glyph",413),d()()}if(i&2){let e=t.$implicit;W("aq-chip--error",e.status==="error"),l(),M("name",e.contentType.startsWith("image/")?"ng-image-03":"ng-file-06"),l(),M("title",e.name),l(),y(e.name),l(),h(e.status==="uploading"?4:e.status==="error"?5:-1)}}function ld(i,t){if(i&1&&(s(0,"div",405),F(1,rd,8,6,"div",414,te),d()),i&2){let e=r(2);l(),O(e.attachments())}}function sd(i,t){if(i&1){let e=k();s(0,"nile-button",420),u("click",function(){_(e),r();let o=de(5);return g(o.click())}),C(1,"nile-glyph",421),d()}if(i&2){let e=r(2);M("disabled",e.isStreaming()||e.attachAtCapacity()?"":null)}}function dd(i,t){if(i&1){let e=k();s(0,"div",402),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,nd,4,1,"div",403),m(2,id,6,1,"div",404),m(3,ld,3,0,"div",405),s(4,"input",406,5),u("change",function(o){_(e);let a=r();return g(a.onFilesPicked(o))}),d(),s(6,"nile-ai-prompt",407,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",408),u("click",function(o){return o.stopPropagation()}),m(9,sd,2,1,"nile-button",409),d()()()}if(i&2){let e,n=r();W("aq-composer-wrap--dragover",n.isDraggingFile()),l(),h(n.features().attachments&&n.isDraggingFile()?1:-1),l(),h((e=n.replyQuote())?2:-1,e),l(),h(n.features().attachments&&n.attachments().length?3:-1),l(),M("accept",n.acceptUploadTypes),l(2),W("aq-attach-full",n.attachAtCapacity()),b("placeholder",n.copy().composerPlaceholder)("hideModel",!0)("hideAddContext",!0)("rows",1)("speechLang","en-US")("value",n.inputText())("loading",n.isStreaming()),l(3),h(n.features().attachments?9:-1)}}function cd(i,t){if(i&1){let e=k();s(0,"div",422),u("pointerdown",function(o){_(e);let a=r();return g(a.startChatResize(o))}),d()}if(i&2){let e=r();W("is-active",e.isResizing())}}function pd(i,t){if(i&1){let e=k();s(0,"div",438),C(1,"nile-glyph",439),s(2,"nile-slide-toggle",440),u("nile-change",function(o){_(e);let a=r(3);return g(a.onFiltersToggle(o.detail.checked))}),d()()}if(i&2){let e=r(3);W("aq-filters-pill--active",e.artifactHasFilter()),l(2),b("isChecked",e.artifactHasFilter())}}function _d(i,t){if(i&1){let e=k();s(0,"div",434)(1,"nile-button",441),u("click",function(){_(e);let o=r(3);return g(o.undoCanvas())}),C(2,"nile-glyph",442),c(3," Undo "),d(),s(4,"nile-button",443),u("click",function(){_(e);let o=r(3);return g(o.redoCanvas())}),C(5,"nile-glyph",444),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 gd(i,t){if(i&1){let e=k();s(0,"div",424)(1,"div",429)(2,"span",430),c(3,"Preview"),d(),s(4,"span",431),c(5),d()(),s(6,"div",432),m(7,pd,3,3,"div",433),m(8,_d,6,3,"div",434),C(9,"span",435),s(10,"nile-button",436),u("click",function(){_(e);let o=r(2);return g(o.closeArtifact())}),C(11,"nile-glyph",437),d()()()}if(i&2){let e=r(2);l(5),y(e.artifactSubtitle()),l(2),h(e.features().canvas.filters?7:-1),l(),h(e.features().canvas.undoRedo?8:-1)}}function ud(i,t){if(i&1&&(s(0,"div",426),C(1,"nile-glyph",445),s(2,"p",446),c(3),d(),s(4,"p",447),c(5),d()()),i&2){let e=r(2);l(3),y(e.copy().emptyCanvasTitle),l(2),y(e.copy().emptyCanvasSubtitle)}}function md(i,t){if(i&1){let e=k();s(0,"shared-dashboard-grid",448,7),u("selectionChange",function(o){_(e);let a=r(2);return g(a.onSelectionChange(o))})("forecast",function(o){_(e);let a=r(2);return g(a.onArtifactForecast(o))})("setAlert",function(o){_(e);let a=r(2);return g(a.onSetAlert(o))})("filterSubmit",function(o){_(e);let a=r(2);return g(a.onArtifactFilterSubmit(o))})("filterChange",function(o){_(e);let a=r(2);return g(a.onArtifactFilterChange(o))})("dslWidgetUpdated",function(o){_(e);let a=r(2);return g(a.onDslWidgetUpdated(o))})("dslEditorClosed",function(){_(e);let o=r(2);return g(o.onArtifactDslEditorClosed())})("widgetClick",function(o){_(e);let a=r(2);return g(a.onKpiWidgetClicked(o))})("aiSend",function(o){_(e);let a=r(2);return g(a.onArtifactAiSend(o))}),d()}if(i&2){let e=r(2);b("widgets",e.artifactWidgets())("filtersEnabled",!!e.builderDashboardId())("conversationId",e.activeConversationId())("editMode",!1)("selectable",e.features().canvas.widgetSelection)("canSetAlert",!0)("canAddToStory",e.widgetMenu().addToStory)("canForecast",!0)("showWidgetMenu",e.widgetMenu().enabled)("canAsk",e.widgetMenu().ask)("canChangeChartType",e.widgetMenu().changeChartType)("canManageFilters",e.widgetMenu().manageFilters)("canCustomizeColors",e.widgetMenu().customizeColors)("canViewChartData",e.widgetMenu().chartData)("canExportPng",e.widgetMenu().exportPng)("canExportCsv",e.widgetMenu().exportCsv)("canPrint",e.widgetMenu().print)("forecastable",e.artifactForecastable())("forecastingWidgetId",e.artifactForecastingId())("showEditDslInViewMode",!0)("widgetsLoading",e.applyingFilters())("dashboardFilters",e.activeDashboardFilters())("resolvedFilters",e.activeResolvedFilters())("applySummary",e.applySummary())("filterExplanation",e.filterExplanation())("detailPanel",!0)("detailRootLabel","Canvas")}}function hd(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",450),c(2),d()}if(i&2){let e=r(3);l(2),q(" ",e.copy().forecastButton," ")}}function Cd(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",451),c(2),d()}if(i&2){let e=r(3);M("disabled",e.committingAction()||!e.hasSelection()?"":null),l(2),q(" ",e.copy().addToStoryButton," ")}}function fd(i,t){if(i&1){let e=k();s(0,"nile-button",21),u("click",function(){_(e);let o=r(3);return g(o.publishAsNewDashboard())}),c(1),d()}if(i&2){let e=r(3);M("loading",e.committingAction()==="publish"?"":null)("disabled",e.committingAction()||!e.hasSelection()?"":null),l(),q(" ",e.copy().publishAsDashboardButton," ")}}function xd(i,t){}function yd(i,t){if(i&1&&(s(0,"div",46),c(1),d()),i&2){let e=r(4);l(),y(e.copy().noResultsMatchFilters)}}function bd(i,t){i&1&&xe(0)}function vd(i,t){if(i&1){let e=k();s(0,"nile-menu-item",70),u("click",function(){let o=_(e).$implicit,a=r(6);return a.showAddPicker.set(!1),g(a.addToExistingDashboard(o.id))}),Ae(1,bd,1,0,"ng-container",359),d()}if(i&2){let e=t.$implicit;r(6);let n=de(40);l(),b("ngTemplateOutlet",n)("ngTemplateOutletContext",dt(2,Ni,e))}}function wd(i,t){if(i&1&&(s(0,"div",80),c(1),d(),F(2,vd,2,4,"nile-menu-item",null,te)),i&2){let e=t.$implicit;l(),y(e.label),l(),O(e.items)}}function kd(i,t){if(i&1&&(s(0,"div",46),c(1),d()),i&2){let e=r(5);l(),y(e.copy().noDashboardsYet)}}function Pd(i,t){if(i&1&&F(0,wd,4,1,null,null,se,!1,kd,2,1,"div",46),i&2){let e=r(4);O(e.groupedPickerDashboards())}}function Ad(i,t){if(i&1){let e=k();s(0,"nile-dropdown",452),u("nile-hide",function(){_(e);let o=r(3);return g(o.showAddPicker.set(!1))}),s(1,"nile-button",358),u("click",function(){_(e);let o=r(3);return g(o.showAddPicker.set(!o.showAddPicker()))}),C(2,"nile-glyph",160),c(3),d(),s(4,"nile-menu",43),u("nile-search-value",function(o){_(e);let a=r(3);return g(a.pickerSearch.set((o.detail==null?null:o.detail.value)??""))}),s(5,"nile-menu-item",44),u("click",function(){_(e);let o=r(3);return o.showAddPicker.set(!1),g(o.addArtifactToDashboard())}),C(6,"nile-glyph",45),c(7),d(),m(8,yd,2,1,"div",46)(9,Pd,3,1),d()()}if(i&2){let e=r(3);b("open",e.showAddPicker()),l(),M("loading",e.committingAction()==="add"?"":null)("disabled",e.committingAction()||!e.hasSelection()?"":null),l(2),q(" ",e.copy().addToDashboardButton," "),l(),M("noResultsMessage",e.copy().noResultsMatchFilters),l(3),q(" ",e.copy().newDashboardLabel," "),l(),h(e.pickerSearchEmpty()?8:9)}}function Md(i,t){if(i&1){let e=k();s(0,"nile-button",22),u("click",function(){_(e);let o=r(3);return g(o.addArtifactToDashboard())}),C(1,"nile-glyph",160),c(2),d()}if(i&2){let e=r(3);M("loading",e.committingAction()==="add"?"":null)("disabled",e.committingAction()||!e.hasSelection()?"":null),l(2),q(" ",e.builderOpen()?e.copy().addToCurrentDashboardButton:e.copy().addToDashboardButton," ")}}function Sd(i,t){if(i&1&&(s(0,"div",428),m(1,hd,3,1,"nile-button",205),m(2,Cd,3,2,"nile-button",205),m(3,fd,2,3,"nile-button",205),m(4,xd,0,0)(5,Ad,10,7,"nile-dropdown",449)(6,Md,3,3,"nile-button",356),d()),i&2){let e,n=r(2);l(),h((e=n.artifactForecastMsg())?1:-1,e),l(),h(-1),l(),h(n.features().canvas.publishAsDashboard?3:-1),l(),h(n.features().canvas.addToDashboard?!n.builderOpen()&&n.conversationDashboards().length>1?5:6:4)}}function Td(i,t){if(i&1&&(s(0,"aside",423),m(1,gd,12,3,"div",424),s(2,"div",425),m(3,ud,6,2,"div",426)(4,md,2,27,"shared-dashboard-grid",427),d(),m(5,Sd,7,4,"div",428),xe(6,214),d()),i&2){let e=r(),n=de(35);W("aq-artifact-pane--dsl-only",e.dslOnlyArtifact()),l(),h(e.dslOnlyArtifact()?-1:1),l(2),h(e.artifactWidgets().length===0?3:4),l(2),h(!e.dslOnlyArtifact()&&e.artifactFooterHasActions()?5:-1),l(),b("ngTemplateOutlet",n)}}function qd(i,t){i&1&&C(0,"nile-spinner",464)}function Dd(i,t){i&1&&C(0,"nile-glyph",465)}function Fd(i,t){if(i&1){let e=k();s(0,"input",461),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",462)(2,"button",463),u("click",function(){_(e);let o=r(2);return g(o.commitDashboardTitle())}),m(3,qd,1,0,"nile-spinner",464)(4,Dd,1,0,"nile-glyph",465),d()()}if(i&2){let e=r(2);b("value",e.dashboardTitleDraft()),l(2),b("disabled",e.renamingDashboard()),l(),h(e.renamingDashboard()?3:4)}}function Od(i,t){i&1&&C(0,"nile-skeleton-loader",455)}function Ed(i,t){if(i&1){let e=k();s(0,"nile-lite-tooltip",467)(1,"button",468),u("click",function(){_(e);let o=r(3);return g(o.startEditDashboardTitle())}),C(2,"nile-glyph",469),d()()}}function Id(i,t){if(i&1&&(s(0,"span",466),c(1),d(),m(2,Ed,3,0,"nile-lite-tooltip",467)),i&2){let e=r(2);l(),y((e.builderRef==null?null:e.builderRef.dashboardName())||"Dashboard"),l(),h(e.builderDashboardId()?2:-1)}}function Vd(i,t){if(i&1){let e=k();s(0,"section",17)(1,"header",453)(2,"div",34)(3,"nile-button",436),u("click",function(){_(e);let o=r();return g(o.closeBuilder())}),C(4,"nile-glyph",454),d(),m(5,Fd,5,3)(6,Od,1,0,"nile-skeleton-loader",455)(7,Id,3,2),d(),s(8,"div",36)(9,"nile-lite-tooltip",456)(10,"button",457),u("click",function(){_(e);let o=r();return g(o.toggleBuilderFullscreen())}),C(11,"nile-glyph",458),d()(),s(12,"shared-builder-toolbar",459),u("action",function(o){_(e);let a=r();return g(a.onBuilderMenuAction(o))}),d()()(),s(13,"shared-builder-host",460),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(),xe(14,214),d()}if(i&2){let e=r(),n=de(35);l(5),h(e.editingDashboardTitle()?5:e.builderRef!=null&&e.builderRef.loading()?6:7),l(4),b("content",e.builderFullscreen()?"Exit full screen":"Full screen"),l(),M("aria-label",e.builderFullscreen()?"Exit full screen":"Full screen"),l(),M("name",e.builderFullscreen()?"ng-minimize":"ng-maximize"),l(),b("canToggleFilter",!0)("hasFilter",(e.builderRef==null?null:e.builderRef.hasFilter())??!1)("canForecast",!0)("anyForecastOn",(e.builderRef==null?null:e.builderRef.anyForecastOn())??!1)("editMode",(e.builderRef==null?null:e.builderRef.editMode())??!0)("showFullscreen",!1)("fullscreen",e.builderFullscreen())("busy",(e.builderRef==null?null:e.builderRef.isPublishing())??!1)("exporting",(e.builderRef==null?null:e.builderRef.isExporting())??!1)("showPromptGallery",!1)("canPublish",(e.builderRef==null?null:e.builderRef.canPublish())??!0),l(),b("dashboardId",e.builderDashboardId())("preseeded",e.builderPreseeded())("galleryPrompts",e.suggestions())("canAddToStory",e.widgetMenu().addToStory)("showWidgetMenu",e.widgetMenu().enabled)("canAsk",e.widgetMenu().ask)("canChangeChartType",e.widgetMenu().changeChartType)("canManageFilters",e.widgetMenu().manageFilters)("canCustomizeColors",e.widgetMenu().customizeColors)("canViewChartData",e.widgetMenu().chartData)("canExportPng",e.widgetMenu().exportPng)("canExportCsv",e.widgetMenu().exportCsv)("canPrint",e.widgetMenu().print)("canTweak",e.widgetMenu().tweak)("canEdit",e.widgetMenu().edit)("canDelete",e.widgetMenu().delete),l(),b("ngTemplateOutlet",n)}}function Rd(i,t){if(i&1){let e=k();s(0,"label",480)(1,"input",481),u("change",function(){let o=_(e).$implicit,a=r(3);return g(a.onGranularityPick(o))}),d(),s(2,"span"),c(3),d()()}if(i&2){let e=t.$implicit,n=r(2);W("fs-segment--on",n.granularity===e.value)("fs-segment--off",!e.enabled),M("title",e.reason||null),l(),b("value",e.value)("checked",n.granularity===e.value)("disabled",!e.enabled),l(2),y(e.value)}}function zd(i,t){i&1&&(s(0,"p",474),c(1),d()),i&2&&(l(),y(t))}function Nd(i,t){if(i&1&&(s(0,"p",474),c(1),d()),i&2){let e=r();l(),y(e.granularityNote)}}function Ld(i,t){if(i&1&&(s(0,"div",470)(1,"span",482),c(2,"Model"),d(),s(3,"div",483)(4,"p",484),c(5),d(),s(6,"p",485),c(7),d()()()),i&2){let e=t;l(5),y(e.title),l(2),y(e.body)}}function $d(i,t){if(i&1&&(s(0,"div",470)(1,"span",482),c(2,"Guardrails"),d(),s(3,"div",486)(4,"p",484),C(5,"nile-glyph",487),c(6),d(),s(7,"p",485),c(8),d()()()),i&2){let e=t;l(3),W("fs-card--pass",e.passed)("fs-card--warn",!e.passed),l(2),M("name",e.passed?"ng-check":"ng-alert-circle")("color",e.passed?"var(--ng-colors-fg-success-primary)":"var(--ng-colors-fg-warning-primary)"),l(),q(" ",e.title," "),l(2),y(e.body)}}function Wd(i,t){if(i&1){let e=k();s(0,"div",470)(1,"label",471),c(2," Horizon \u2014 "),s(3,"span",472),c(4),d()(),s(5,"input",473),u("input",function(o){_(e);let a=r(2);return g(a.onHorizonInput(o.target.value))}),d(),s(6,"p",474),c(7),d()(),s(8,"div",470)(9,"span",475),c(10,"Granularity"),d(),s(11,"div",476),F(12,Rd,4,9,"label",477,at),d(),m(14,zd,2,1,"p",474)(15,Nd,2,1,"p",474),d(),s(16,"div",470)(17,"label",478),c(18," Confidence interval \u2014 "),s(19,"span",472),c(20),d()(),s(21,"input",479),u("input",function(o){_(e);let a=r(2);return g(a.onConfidenceIndexInput(o.target.value))}),d(),s(22,"p",474),c(23),d()(),m(24,Ld,8,2,"div",470),m(25,$d,9,8,"div",470)}if(i&2){let e,n,o,a=t,p=r(),x=r();l(4),Y("",p.horizon," ",x.horizonUnit()),l(),J("--fs-fill",x.horizonFill()),b("value",p.horizon),M("max",x.horizonMax())("aria-valuetext",p.horizon+" "+x.horizonUnit()),l(2),y(x.horizonNote()),l(5),O(x.granularityChoices()),l(2),h((e=x.unavailableGranularityNote())?14:15,e),l(6),q("",p.confidence,"%"),l(),J("--fs-fill",x.confidenceFill()),b("value",x.confidenceIndex()),M("max",a.confidenceLevels.length-1)("aria-valuetext",p.confidence+"%"),l(2),y(a.confidenceNote),l(),h((n=a.modelCard)?24:-1,n),l(),h((o=a.guardrails)?25:-1,o)}}function Bd(i,t){if(i&1&&m(0,Wd,26,18),i&2){let e,n=r();h((e=n.forecastCopy())?0:-1,e)}}function Ud(i,t){if(i&1&&(s(0,"div",491),C(1,"nile-skeleton-loader",492),s(2,"div",493),C(3,"nile-skeleton-loader",78),d()()),i&2){let e=t.$implicit;l(2),J("width",e,"px")}}function Gd(i,t){if(i&1&&(s(0,"div",489),F(1,Ud,4,2,"div",491,G),d()),i&2){let e=r(2);l(),O(e.gallerySkeletonRows)}}function Hd(i,t){if(i&1){let e=k();s(0,"nile-ai-prompts",494),u("nile-item-click",function(o){_(e);let a=r(2);return g(a.onGalleryPromptPick(o.detail==null?null:o.detail.data))}),d()}if(i&2){let e=r(2);b("items",e.galleryPromptItems())("vertical",!0)("wrap",!0)}}function jd(i,t){if(i&1&&(s(0,"div",128),c(1),d()),i&2){let e=r(2);l(),Y("",e.copy().noPromptsMatch,' "',e.gallerySearch(),'".')}}function Yd(i,t){if(i&1&&(s(0,"div",128),c(1),d()),i&2){let e=r(2);l(),y(e.copy().noPromptsYet)}}function Qd(i,t){if(i&1){let e=k();s(0,"nile-input",488),u("nile-input",function(o){_(e);let a=r();return g(a.gallerySearch.set((o.detail==null?null:o.detail.value)??""))})("nile-change",function(o){_(e);let a=r();return g(a.gallerySearch.set((o.detail==null?null:o.detail.value)??""))}),C(1,"nile-glyph",109),d(),m(2,Gd,3,0,"div",489)(3,Hd,1,3,"nile-ai-prompts",490)(4,jd,2,2,"div",128)(5,Yd,2,1,"div",128)}if(i&2){let e=r();b("placeholder",e.copy().promptGallerySearchPlaceholder)("value",e.gallerySearch()),l(2),h(e.suggestionsLoading()?2:e.filteredGalleryPrompts().length?3:e.gallerySearch().trim()?4:5)}}function Xd(i,t){if(i&1&&(s(0,"div",495),c(1),d()),i&2){let e=r(2);l(),y(e.copy().xrayLoadingSources)}}function Kd(i,t){if(i&1&&(s(0,"div",128),c(1),d()),i&2){let e=r(2);l(),y(e.copy().xrayNoSources)}}function Jd(i,t){i&1&&C(0,"nile-glyph",72)}function Zd(i,t){if(i&1){let e=k();s(0,"nile-menu-item",70),u("click",function(){let o=_(e).$implicit,a=r(4);return g(a.onXrayDatasetPick(o.datasetId))}),s(1,"span",510),c(2),d(),m(3,Jd,1,0,"nile-glyph",72),d()}if(i&2){let e=t.$implicit,n=r(4);l(2),y(e.label),l(),h(n.xraySelectedDatasetId()===e.datasetId?3:-1)}}function ec(i,t){if(i&1){let e=k();s(0,"nile-dropdown",505),u("nile-hide",function(){_(e);let o=r(3);return g(o.xrayDatasetMenuOpen.set(!1))}),s(1,"button",506),u("click",function(){_(e);let o=r(3);return g(o.xrayDatasetMenuOpen.set(!o.xrayDatasetMenuOpen()))}),C(2,"nile-glyph",507),s(3,"span",508),c(4),d(),C(5,"nile-glyph",509),d(),s(6,"nile-menu"),F(7,Zd,4,2,"nile-menu-item",null,Go),d()()}if(i&2){let e=r(3);b("open",e.xrayDatasetMenuOpen()),l(4),y(e.xraySelectedDatasetLabel()),l(3),O(e.xrayDatasets())}}function tc(i,t){if(i&1&&(s(0,"div",502),C(1,"nile-glyph",511),s(2,"span"),c(3),d()()),i&2){let e=r(3);l(3),y(e.xrayError())}}function nc(i,t){if(i&1&&(s(0,"div",503),C(1,"nile-spinner",512),s(2,"p",513),c(3),d(),s(4,"p",514),c(5),d()()),i&2){let e=r(3);l(3),y(e.xrayStatus()==="analyzing"?e.copy().xrayAnalyzing:e.copy().xrayBuilding),l(2),y(e.xrayRunningEntityLabel())}}function ic(i,t){if(i&1&&(s(0,"div",515),C(1,"nile-skeleton-loader",492)(2,"nile-skeleton-loader",516),d()),i&2){let e=t.$implicit;l(2),b("width",e)}}function oc(i,t){if(i&1&&(s(0,"div",504),F(1,ic,3,1,"div",515,G),d()),i&2){let e=r(3);l(),O(e.xraySkeletonRows)}}function ac(i,t){if(i&1&&(s(0,"span",524),c(1),d()),i&2){let e=r().$implicit;l(),q("",e.schema,".")}}function rc(i,t){if(i&1&&(s(0,"span",525),c(1),d()),i&2){let e=r().$implicit,n=r(4);l(),Y("",e.fieldCount," ",n.copy().xrayFieldsLabel)}}function lc(i,t){if(i&1){let e=k();s(0,"button",521),u("click",function(){let o=_(e).$implicit,a=r(4);return g(a.runXray(o))}),C(1,"nile-glyph",522),s(2,"span",523),m(3,ac,2,1,"span",524),c(4),d(),m(5,rc,2,2,"span",525),s(6,"span",526),C(7,"nile-glyph",229),s(8,"span"),c(9),d()()()}if(i&2){let e=t.$implicit,n=r(4);b("disabled",n.xrayRunning())("title",n.xrayEntityLabel(e)),l(),b("name",e.kind==="index"?"ng-layers-three-01":"ng-table"),l(2),h(e.schema?3:-1),l(),q("",e.name," "),l(),h(e.fieldCount?5:-1),l(4),y(n.copy().xrayRunLabel)}}function sc(i,t){if(i&1&&(s(0,"div",517)(1,"span",518),c(2),d(),s(3,"span",519),c(4),d()(),s(5,"div",504),F(6,lc,10,7,"button",520,Ho),d()),i&2){let e=r(3);l(2),Y("",e.xrayFilteredEntities().length," ",e.xrayEntityNoun()),l(2),y(e.copy().xrayPickHint),l(2),O(e.xrayFilteredEntities())}}function dc(i,t){if(i&1&&(s(0,"div",128),c(1),d()),i&2){let e=r(3);l(),Y("",e.copy().xrayNoEntitiesMatch,' "',e.xrayEntitySearch(),'".')}}function cc(i,t){if(i&1&&(s(0,"div",128),c(1),d()),i&2){let e=r(3);l(),y(e.copy().xrayNoEntities)}}function pc(i,t){if(i&1){let e=k();m(0,ec,9,2,"nile-dropdown",496),s(1,"nile-input",497),u("nile-input",function(o){_(e);let a=r(2);return g(a.xrayEntitySearch.set((o.detail==null?null:o.detail.value)??""))})("nile-change",function(o){_(e);let a=r(2);return g(a.xrayEntitySearch.set((o.detail==null?null:o.detail.value)??""))}),C(2,"nile-glyph",109),d(),s(3,"details",498)(4,"summary",499),C(5,"nile-glyph",500),s(6,"span"),c(7),d()(),s(8,"nile-input",501),u("nile-input",function(o){_(e);let a=r(2);return g(a.xrayTopic.set((o.detail==null?null:o.detail.value)??""))})("nile-change",function(o){_(e);let a=r(2);return g(a.xrayTopic.set((o.detail==null?null:o.detail.value)??""))}),d()(),m(9,tc,4,1,"div",502),m(10,nc,6,2,"div",503)(11,oc,3,0,"div",504)(12,sc,8,3)(13,dc,2,2,"div",128)(14,cc,2,1,"div",128)}if(i&2){let e=r(2);h(e.xrayDatasets().length>1?0:-1),l(),b("placeholder",e.copy().xrayEntitySearchPlaceholder)("value",e.xrayEntitySearch()),l(2),b("open",!!e.xrayTopic()),l(4),y(e.copy().xrayFocusToggle),l(),b("placeholder",e.copy().xrayTopicPlaceholder)("value",e.xrayTopic()),l(),h(e.xrayError()?9:-1),l(),h(e.xrayRunning()?10:e.xrayEntitiesLoading()?11:e.xrayFilteredEntities().length?12:e.xrayEntitySearch().trim()?13:14)}}function _c(i,t){if(i&1&&m(0,Xd,2,1,"div",495)(1,Kd,2,1,"div",128)(2,pc,15,9),i&2){let e=r();h(e.xraySourcesLoading()?0:e.xraySources().length?2:1)}}function gc(i,t){i&1&&(s(0,"nile-breadcrumb-item"),c(1),d()),i&2&&(l(),q(" ",t," "))}function uc(i,t){i&1&&c(0),i&2&&q(" ",t," ")}function mc(i,t){i&1&&C(0,"nile-skeleton-loader",530)}function hc(i,t){if(i&1&&(s(0,"p",532),c(1),d()),i&2){let e=r(3);l(),y(e.cohortDetailCaption())}}function Cc(i,t){if(i&1&&C(0,"nile-skeleton-loader",539),i&2){let e=t.$implicit;J("left",e.x/12*100,"%")("top",e.y*72,"px")("width","calc("+e.w/12*100+"% - 12px)")("height",e.h*72-12,"px")}}function fc(i,t){if(i&1&&(s(0,"div",537),F(1,Cc,1,8,"nile-skeleton-loader",538,G),d()),i&2){let e=r(4);J("height",e.widgetDetailPanelSkeletonHeight(),"px"),l(),O(e.widgetDetailPanelSkeletonSlots())}}function xc(i,t){i&1&&(s(0,"div",536)(1,"div",540),C(2,"nile-skeleton-loader",541)(3,"nile-skeleton-loader",541)(4,"nile-skeleton-loader",541),d(),C(5,"nile-skeleton-loader",542),d())}function yc(i,t){if(i&1&&m(0,fc,3,2,"div",535)(1,xc,6,0,"div",536),i&2){let e=r(3);h(e.widgetDetailPanelSkeletonSlots().length?0:1)}}function bc(i,t){if(i&1){let e=k();s(0,"shared-dashboard-grid",543),u("selectionChange",function(o){_(e);let a=r(3);return g(a.widgetDetailPanelSelectedIds.set(o))}),d()}if(i&2){let e=r(3);b("widgets",e.widgetDetailPanelWidgets())("editMode",!1)("selectable",e.widgetDetailPanelKind()==="dashboard")("selectedWidgetIds",e.widgetDetailPanelSelectedIds())("canSetAlert",!1)("canAddToStory",!1)("canForecast",!1)("showWidgetMenu",!1)}}function vc(i,t){if(i&1){let e=k();s(0,"div",534)(1,"span",544),c(2),d(),s(3,"nile-button",21),u("click",function(){_(e);let o=r(3);return g(o.toggleSelectAllDetailPanelWidgets())}),c(4),d(),s(5,"nile-button",21),u("click",function(){_(e);let o=r(3);return g(o.addSelectedDetailPanelWidgetsToCanvas())}),C(6,"nile-glyph",545),c(7),d(),s(8,"nile-button",22),u("click",function(){_(e);let o=r(3);return g(o.replaceCanvasWithDetailPanel())}),C(9,"nile-glyph",546),c(10," Replace canvas "),d()()}if(i&2){let e=r(3);l(2),Y(" ",e.widgetDetailPanelSelectedIds().length," of ",e.widgetDetailPanelWidgets().length," selected "),l(2),q(" ",e.isDetailPanelFullySelected()?"Deselect all":"Select all"," "),l(),M("disabled",e.widgetDetailPanelSelectedIds().length?null:""),l(2),q(" Add ",e.widgetDetailPanelSelectedIds().length," to canvas "),l(),M("disabled",e.widgetDetailPanelWidgets().length?null:"")}}function wc(i,t){if(i&1){let e=k();s(0,"div",534)(1,"nile-button",22),u("click",function(){_(e);let o=r(3);return g(o.exportCohortRowsCsv())}),C(2,"nile-glyph",547),c(3),d(),s(4,"nile-button",21),u("click",function(){_(e);let o=r(3);return g(o.copyCohortDefinition())}),C(5,"nile-glyph",548),c(6),d()()}if(i&2){let e=r(3);l(),M("disabled",e.detailPanelCohortData()?null:""),l(2),q(" ",e.copy().cohortExportRowsButton," "),l(),M("disabled",e.detailPanelCohortData()?null:""),l(2),q(" ",e.copy().cohortCopyDefinitionButton," ")}}function kc(i,t){if(i&1){let e=k();s(0,"div",534)(1,"nile-button",22),u("click",function(){_(e);let o=r(3);return g(o.addWidgetTemplateFromDetailPanel())}),C(2,"nile-glyph",160),c(3," Add to dashboard "),d()()}}function Pc(i,t){if(i&1){let e=k();s(0,"div",527)(1,"div",528)(2,"nile-breadcrumb",529),u("nile-click",function(){_(e);let o=r(2);return g(o.closeWidgetDetailPanel())}),s(3,"nile-breadcrumb-item"),c(4),d(),m(5,gc,2,1,"nile-breadcrumb-item"),s(6,"nile-breadcrumb-item"),m(7,uc,1,1)(8,mc,1,0,"nile-skeleton-loader",530),d()()(),s(9,"div",531),m(10,hc,2,1,"p",532),m(11,yc,2,1)(12,bc,1,8,"shared-dashboard-grid",533),d(),m(13,vc,11,6,"div",534)(14,wc,7,4,"div",534)(15,kc,4,0,"div",534),d()}if(i&2){let e,n,o=r(2);l(4),q(" ",o.detailRootCrumb()," "),l(),h((e=o.detailPanelWidgetCrumb())?5:-1,e),l(2),h((n=o.detailPanelLastCrumb())?7:8,n),l(3),h(o.detailPanelCohortId()?10:-1),l(),h(o.widgetDetailPanelLoading()?11:12),l(2),h(o.widgetDetailPanelKind()==="dashboard"?13:o.detailPanelCohortId()?14:o.widgetDetailPanelCanAdd()?15:-1)}}function Ac(i,t){if(i&1&&m(0,Pc,16,6,"div",527),i&2){let e=r();h(e.widgetDetailPanelOpen()?0:-1)}}function Mc(i,t){if(i&1){let e=k();s(0,"app-alert-drawer",549),u("closed",function(){_(e);let o=r();return g(o.onAlertClosed())})("saved",function(){_(e);let o=r();return g(o.onAlertClosed())}),d()}if(i&2){let e,n=r();b("open",n.alertDrawerOpen())("widget",n.alertWidget())("dashboardId",null)("source",n.alertSource())("sourceName",((e=n.selectedScope())==null?null:e.name)??"")("authoringMode","chat")}}function Sc(i,t){i&1&&C(0,"nile-executive-summary",30,8)}function Tc(i,t){if(i&1){let e=k();s(0,"app-story-picker-drawer",550),u("closed",function(){_(e);let o=r();return g(o.closeStoryPicker())})("added",function(){_(e);let o=r();return g(o.onAddedToStory())}),d()}if(i&2){let e=r();b("open",e.storyPickerOpen())("widget",e.storyPickerWidget())}}function qc(i,t){if(i&1&&(s(0,"div",75),C(1,"nile-glyph",96),s(2,"div",77)(3,"span",89),c(4),d(),s(5,"span",90),c(6),d()()()),i&2){let e=t.$implicit,n=r();l(3),b("title",e.name||"Untitled"),l(),y(e.name||"Untitled"),l(2),y(n.dashboardMeta(e))}}function Ce(){return Math.random().toString(36).slice(2)}function Dc(i){if(!i.length)return i;let t=new Map;for(let a of i){let p=t.get(a.y)??[];p.push(a),t.set(a.y,p)}let e=[...t.keys()].sort((a,p)=>a-p),n=[],o=0;for(let a of e){let p=t.get(a);for(let x of p)n.push(T(w({},x),{y:o}));o+=Math.max(...p.map(x=>x.h))}return n}var Fc=4,Oc="forecast-settings",Ec="forecast-this";function Wi(i){return i.split(`
11
11
  `).map(t=>{let e=/^For "[^"]+":\s*(.*)$/.exec(t);return e?e[1]:t}).join(`
12
- `)}function Ri(i){return{id:i.id,role:i.role,text:i.role==="user"?Wi(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 Oe=class i{alertDrawerOpen=f(!1);alertWidget=f(null);onSetAlert(t){this.alertWidget.set(t),this.alertDrawerOpen.set(!0)}onAlertClosed(){this.alertDrawerOpen.set(!1)}alertSource=D(()=>{let t=mt(this.selectedScope());if(t)return t;let e=this.conversationConnectionId();return e?{connectionId:e}:null});chartDataSourceId(t){return(t?.config??{}).dataSourceId??null}canCreateAlert(t){return!!this.alertSource()||!!this.chartDataSourceId(t)}createAlertFromChart(t){this.canCreateAlert(t)&&(this.isFilterChart(t)||this.onSetAlert(T(w({},this.artifactToWidget(t)),{id:"chat-alert"})))}aqChatEl;builderRef;artifactGridRef;composerRef;aiExecutiveSummaryEl;svc=z(he);tokenStore=z(ae);destroyRef=z(It);hostEl=z(ke);features(){return I().features}widgetMenu(){return I().features.widgetMenu}copy(){return I().copy}showHeader(){return I().ui.header}withCount(t,e){return ei(t,e)}zone=z(Re);appRef=z(zt);route=z(nn);router=z(on);dashboardState=z(xn);publishRepo=z(ue);globalWidget=z(Yn);forecastApi=z(nt);cohort=z(qe);forecastService=z(bn);loading=f(!0);conversations=f([]);activeConversationId=f(null);conversationCustomerId=f(null);conversationConnectionId=f(null);messages=f([]);inputText=f("");isStreaming=f(!1);streamAbort=null;suggestions=f([]);suggestionsLoading=f(!0);suggestionsSeq=0;showConversationPicker=f(!1);showRelatedDashboards=f(!1);loadingConversation=f(!1);editingTitle=f(!1);titleDraft=f("");editingDashboardTitle=f(!1);dashboardTitleDraft=f("");renamingDashboard=f(!1);conversationsLoading=f(!0);dashboardsLoading=f(!0);menuSkeletonRows=[188,142,205];gallerySkeletonRows=[420,300,480,360,260,400];librarySkeletonGroups=[["62%","48%"],["55%","70%"]];libraryChipSkeletonWidths=[58,96,84,78,86,88,100,104,76,88];savingDashboard=f(!1);committingAction=f(null);conversationDashboards=f([]);showAddPicker=f(!1);inlinePickerFor=f(null);inlineChartTypePickerFor=f(null);inlineChartTypeOptions=f([]);inlineChartTypeLoading=f(!1);inlineChartTypePickerSeq=0;inlineChartTypeApplying=f(!1);inlineChartTypeError=f(null);inlineFilterPickerFor=f(null);showScopePicker=f(!1);datasets=f([]);pipelines=f([]);scopeLoading=f(!1);selectedScope=f(null);scopeListsLoaded=!1;saveDialogOpen=f(!1);saveDashboardName=f("");chatPaneTab=f("chat");tabsVisible=D(()=>si(this.features()));cohortCriteria=f([]);selectedCriterionId=f(null);cohortPreview=f(null);cohortCriteriaLoaded=!1;cohortCriteriaLoading=f(!1);cohortCriteriaError=f(null);cohortPreviewLoading=f(!1);cohortPreviewError=f(null);cohortCriteriaSkeletonRows=[0,1,2,3];cohortMatchSkeletonRows=[0,1,2];cohortMatchesExpanded=f(!1);cohortAllMatches=f(null);cohortMembersLoading=f(!1);cohortMembersError=f(null);static COHORT_MEMBER_LIMIT=100;visibleCohortMatches=D(()=>ui(this.cohortPreview(),this.cohortAllMatches(),this.cohortMatchesExpanded()));cohortNamesWithheld=D(()=>wt(this.cohortPreview()));cohortHasMoreMatches=D(()=>gi(this.cohortPreview()));cohortMatchesTruncated=D(()=>mi(this.cohortPreview(),this.cohortAllMatches()));cohortMatchesTruncatedNote=D(()=>{let t=this.cohortPreview(),e=this.cohortAllMatches();return!t||!e?"":this.copy().cohortMatchesTruncatedNote.replace("{shown}",String(e.length)).replace("{matchCount}",String(t.matchCount))});cohortMatchSummary=D(()=>{let t=this.cohortPreview();return t?this.copy().cohortMatchSummary.replace("{matchCount}",String(t.matchCount)).replace("{totalCount}",String(t.totalCount)):""});cohortViewAllLabel=D(()=>{let t=this.cohortPreview();return t?this.cohortMatchesExpanded()?this.copy().cohortShowFewerLink:this.copy().cohortViewAllLink.replace("{matchCount}",String(t.matchCount)):""});async loadCohortCriteria(){if(!this.cohortCriteriaLoaded){this.cohortCriteriaLoading.set(!0),this.cohortCriteriaError.set(null);try{this.cohortCriteria.set(await this.cohort.listCriteria()),this.cohortCriteriaLoaded=!0}catch(t){this.cohortCriteriaError.set(kt(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(kt(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=_i(t);this.bucketExtraCharts.update(o=>[...o,n]),this.ensureArtifactPaneOpen()}setChatPaneTab(t){li(t,this.features())&&(this.chatPaneTab.set(t),(t==="library"||t==="tools")&&this.ensureArtifactPaneOpen(),t==="library"&&this.prefetchWidgetTemplateCatalog(),t==="tools"&&this.loadCohortCriteria())}galleryOpen=f(!1);gallerySearch=f("");templateCategories=f([]);templateAllTemplates=f([]);templateCategoriesLoading=f(!1);templateTemplatesLoading=f(!1);templateActiveCategory=f("all");widgetTemplateAllTemplates=f([]);widgetTemplateTemplatesLoading=f(!1);widgetTemplateActiveCategory=f("all");selectWidgetTemplateCategory(t){this.widgetTemplateActiveCategory.set(t)}widgetTemplatePickerSelectedIds=f([]);toggleWidgetTemplateSelection(t){this.widgetTemplatePickerSelectedIds.update(e=>e.includes(t)?e.filter(n=>n!==t):[...e,t])}addSelectedWidgetTemplates(){let t=this.widgetTemplatePickerSelectedIds();t.length&&(this.asOneCanvasStep(()=>{for(let e of t)this.selectWidgetTemplate(e)}),this.widgetTemplatePickerSelectedIds.set([]))}widgetTemplateCountForCategory(t){return this.widgetTemplateAllTemplates().filter(e=>e.category===t).length}librarySearch=f("");libraryKpiChartOptions={exporting:{enabled:!1},credits:{enabled:!1}};brandSparklineColor=f(In);readBrandSparklineColor(){this.brandSparklineColor.set(Vn(this.hostEl.nativeElement))}widgetTemplateCard(t){let e=this.widgetTemplatePreviews(),a=e.get(t.id)?.config?.config?.chart;return{templateId:t.id,title:t.widgetName,desc:t.description,value:a?.value??"\u2014",loading:!e.has(t.id),sparkline:a?.sparkline??[]}}libraryWidgetGroups=D(()=>{let t=this.widgetTemplateActiveCategory(),e=this.librarySearch().trim().toLowerCase();return(t==="all"?this.templateCategories():this.templateCategories().filter(o=>o.key===t)).map(o=>({key:o.key,label:o.label,cards:this.widgetTemplateAllTemplates().filter(a=>a.category===o.key).filter(a=>!e||a.widgetName.toLowerCase().includes(e)||(a.description??"").toLowerCase().includes(e)).map(a=>this.widgetTemplateCard(a))})).filter(o=>o.cards.length>0)});isGroupFullySelected(t){let e=this.widgetTemplatePickerSelectedIds();return t.length>0&&t.every(n=>e.includes(n.templateId))}toggleLibraryGroupSelection(t){let e=t.map(o=>o.templateId),n=this.isGroupFullySelected(t);this.widgetTemplatePickerSelectedIds.update(o=>{let a=new Set(o);return n?e.forEach(p=>a.delete(p)):e.forEach(p=>a.add(p)),[...a]})}openWidgetDetailFromCard(t){let e=this.widgetTemplatePreviews().get(t);if(!e)return;let n=T(w({},this.artifactToWidget(e)),{id:`kpi-gallery-${t}`});this.openWidgetDetailPanelForWidget(n,!0)}runViewTransition(t,e="forward"){let n=document,o=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;if(typeof n.startViewTransition!="function"||o){t();return}let a=document.documentElement;e==="back"&&(a.dataset.vtDirection="back");let p=()=>delete a.dataset.vtDirection;n.startViewTransition(()=>{t(),this.appRef.tick()})?.finished?.then(p,p)??p()}artifactPickerTab=f("kpis");templateCountForCategory(t){return this.templateAllTemplates().filter(e=>e.category===t).length}libraryDashboardGroups=D(()=>{let t=this.templateActiveCategory(),e=this.librarySearch().trim().toLowerCase();return(t==="all"?this.templateCategories():this.templateCategories().filter(o=>o.key===t)).map(o=>({key:o.key,label:o.label,templates:this.templateAllTemplates().filter(a=>a.category===o.key).filter(a=>!e||a.name.toLowerCase().includes(e)||(a.description??"").toLowerCase().includes(e))})).filter(o=>o.templates.length>0)});widgetTemplatePreviews=f(new Map);widgetTemplateSourceId=f(null);widgetDetailPanelOpen=f(!1);widgetDetailPanelLoading=f(!1);widgetDetailPanelTitle=f(null);widgetDetailPanelRaw=f([]);widgetDetailPanelTemplateId=f(null);widgetDetailPanelCanAdd=f(!1);widgetDetailPanelKind=f("widget");widgetDetailPanelSourceWidgetTitle=f(null);detailPanelWidgetCrumb=D(()=>this.widgetDetailPanelKind()==="widget"?this.widgetDetailPanelSourceWidgetTitle():null);detailPanelLastCrumb=D(()=>{let t=this.widgetDetailPanelTitle();return t?t===this.detailPanelWidgetCrumb()?this.copy().detailCrumbLabel:t:null});widgetDetailPanelSelectedIds=f([]);widgetDetailPanelSourceTemplateId=f(null);detailPanelCohortId=f(null);detailPanelCohortData=f(null);cohortDetailCaption=D(()=>{let t=this.copy().cohortDetailCaption,e=this.detailPanelCohortData()?.detail?.scan;if(!e)return t;let n=this.copy().cohortDetailCoverage.replace("{events}",String(e.events)).replace("{systems}",String(e.systems));return`${t} \xB7 ${n}`});widgetDetailPanelSkeletonSlots=f([]);widgetDetailPanelSkeletonHeight=D(()=>{let t=this.widgetDetailPanelSkeletonSlots();return t.length?Math.max(...t.map(e=>(e.y+e.h)*72)):0});widgetDetailPanelWidgets=D(()=>{let t=this.widgetDetailPanelRaw().map((e,n)=>T(w({},this.artifactToWidget(e)),{id:`detail-panel-${n}`}));return pt(t)});filteredGalleryPrompts=D(()=>{let t=this.gallerySearch().trim().toLowerCase(),e=this.suggestions();return t?e.filter(n=>n.toLowerCase().includes(t)):e});welcomePromptCards=D(()=>{let t=this.forecastContext();return this.suggestions().slice(0,Fc).map(e=>(I().features.forecast&&t?!!At(e,t):!1)?{label:e,icon:"ng-stars-02",badge:"FORECAST",tone:"ai"}:{label:e,icon:"ng-lightbulb-05",tone:"plain"})});galleryPromptItems=D(()=>this.filteredGalleryPrompts().map(t=>({key:t,label:t,icon:"ng-lightbulb-05"})));artifactSourceMsgId=f(null);activeArtifactRaw=f([]);artifactForcedOpen=f(!1);templateSourceId=f(null);bucketExtraCharts=f([]);activeArtifact=D(()=>{let t=this.artifactSourceMsgId(),e=t?this.messages().find(o=>o.id===t)?.charts??this.activeArtifactRaw():this.activeArtifactRaw(),n=this.bucketExtraCharts();return n.length?[...e,...n]:e});artifactOpen=D(()=>this.artifactForcedOpen()||this.activeArtifact().length>0);dslOnlyArtifact=f(!1);CANVAS_HISTORY_LIMIT=25;canvasUndoStack=f([]);canvasRedoStack=f([]);canUndoCanvas=D(()=>this.canvasUndoStack().length>0);canRedoCanvas=D(()=>this.canvasRedoStack().length>0);canvasHistorySuspended=!1;snapshotCanvas(){return{base:[...this.activeArtifactRaw()],extras:[...this.bucketExtraCharts()],sourceMsgId:this.artifactSourceMsgId(),templateSourceId:this.templateSourceId(),widgetTemplateSourceId:this.widgetTemplateSourceId(),saveName:this.saveDashboardName()}}restoreCanvas(t){this.artifactSourceMsgId.set(t.sourceMsgId),this.activeArtifactRaw.set(t.base),this.bucketExtraCharts.set(t.extras),this.templateSourceId.set(t.templateSourceId),this.widgetTemplateSourceId.set(t.widgetTemplateSourceId),this.saveDashboardName.set(t.saveName),this.selectedWidgetIds.set([]),this.ensureArtifactPaneOpen()}pushCanvasHistory(){this.canvasHistorySuspended||(this.canvasUndoStack.update(t=>[...t,this.snapshotCanvas()].slice(-this.CANVAS_HISTORY_LIMIT)),this.canvasRedoStack.set([]))}asOneCanvasStep(t){this.pushCanvasHistory(),this.canvasHistorySuspended=!0;try{t()}finally{this.canvasHistorySuspended=!1}}undoCanvas(){let t=this.canvasUndoStack();t.length&&(this.canvasRedoStack.update(e=>[...e,this.snapshotCanvas()].slice(-this.CANVAS_HISTORY_LIMIT)),this.canvasUndoStack.set(t.slice(0,-1)),this.restoreCanvas(t[t.length-1]))}redoCanvas(){let t=this.canvasRedoStack();t.length&&(this.canvasUndoStack.update(e=>[...e,this.snapshotCanvas()].slice(-this.CANVAS_HISTORY_LIMIT)),this.canvasRedoStack.set(t.slice(0,-1)),this.restoreCanvas(t[t.length-1]))}ensureArtifactPaneOpen(){this.artifactForcedOpen()||this.artifactForcedOpen.set(!0)}artifactTitle=D(()=>{let t=this.mostRecentDashboardTitle();return t||(this.activeArtifact().find(n=>!this.isFilterChart(n))?.title??this.activeArtifact()[0]?.title??"Untitled canvas")});artifactSubtitle=D(()=>{let t=this.activeArtifact().filter(e=>!this.isFilterChart(e)).length;return`${this.artifactTitle()} \xB7 ${t} widget${t===1?"":"s"}`});isFilterChart(t){if(!t)return!1;let e=t.config??{};return $e({componentName:(e.componentName??t.componentName??"").toLowerCase(),config:e.config??e})}mostRecentDashboardTitle(){let t=this.artifactSourceMsgId();if(!t)return;let e=this.messages(),n=e.findIndex(o=>o.id===t);for(let o=n;o>=0;o--)if(e[o]?.dashboardTitle)return e[o].dashboardTitle}baseArtifactWidgets=D(()=>{let t=this.artifactSourceMsgId()??"artifact",e=this.activeArtifact().map((o,a)=>T(w({},this.artifactToWidget(o)),{id:`${t}-${a}`})),n=pt(e);return fn(n)});filterOverlay=f(new Map);forecastOverlay=f(new Map);artifactForecastable=f({});artifactForecastingId=f(null);artifactWidgets=D(()=>{let t=this.baseArtifactWidgets(),e=this.filterOverlay(),n=this.forecastOverlay();return!e.size&&!n.size?t:t.map(o=>{let a=e.get(o.id),p=a?T(w({},o),{config:a.config,edited:a.edited}):o,x=n.get(o.id);return x?T(w({},p),{config:x}):p})});async onArtifactForecast(t){let e=String(t.widget.id);if(!this.artifactForecastingId()){if(!t.enable){this.forecastOverlay.update(n=>{let o=new Map(n);return o.delete(e),o});return}this.artifactForecastingId.set(e);try{let n=await this.forecastService.forecastWidget(t.widget);if(n?.guardrails&&n.guardrails.passed===!1)return;n?.widget?.config&&this.forecastOverlay.update(o=>new Map(o).set(e,n.widget.config))}catch{}finally{this.artifactForecastingId.set(null)}}}async loadArtifactForecastable(){let t=this.baseArtifactWidgets();if(!t.length){this.artifactForecastable.set({});return}this.artifactForecastable.set(await this.forecastService.probeWidgets(t))}applyingFilters=f(!1);activeDashboardFilters=f(null);activeResolvedFilters=f(null);applySummary=f(null);filterExplanation=f(null);applyFiltersSeq=0;applyFiltersAbort=null;filterSuggestCache=new Map;filterSuggestInflight=new Set;selectedWidgetIds=f([]);hasSelection=D(()=>this.features().canvas.widgetSelection?this.selectedWidgetIds().length>0:this.artifactWidgets().length>0);selectedArtifactCharts=D(()=>{if(!this.features().canvas.widgetSelection)return this.activeArtifact();let t=new Set(this.selectedWidgetIds()),e=this.artifactWidgets();return this.activeArtifact().filter((n,o)=>t.has(e[o]?.id))});artifactFooterHasActions=D(()=>{let t=this.features().canvas;return t.publishAsDashboard||t.addToDashboard||!!this.artifactForecastMsg()});builderOpen=f(!1);detailRootCrumb=D(()=>this.builderOpen()?this.builderRef?.dashboardName?.()?.trim()||this.copy().detailDashboardCrumbLabel:this.copy().detailCanvasCrumbLabel);builderDashboardId=f(null);builderPreseeded=f(!1);builderFullscreen=f(!1);chatPaneWidth=f(null);isResizing=f(!1);layoutMode=D(()=>ri({hasMessages:this.messages().length>0,artifactOpen:this.artifactOpen()&&!this.dslOnlyArtifact(),builderOpen:this.builderOpen()}));chatPaneStyleWidth=D(()=>{if(this.builderFullscreen())return null;let t=this.layoutMode();return t==="split"||t==="builder"?this.chatPaneWidth():null});customerId=()=>{let t=this.tokenStore.tenantId();return I().customerId??t??""};attachments=f([]);uploadsInFlight=D(()=>this.attachments().some(t=>t.status==="uploading"));excelCount=D(()=>this.attachments().filter(t=>bt(t.name,t.contentType)).length);nonExcelCount=D(()=>this.attachments().length-this.excelCount());attachAtCapacity=D(()=>this.nonExcelCount()>=xt&&this.excelCount()>=yt);acceptUploadTypes=[...ft,".xls",".xlsx"].join(",");dragDepth=0;isDraggingFile=f(!1);canSend=D(()=>{let t=this.inputText().trim().length>0,e=this.attachments().some(n=>n.status==="ready");return(t||e)&&!this.isStreaming()&&!this.uploadsInFlight()});quoteBadge=f(null);replyQuote=f(null);activeConversation=D(()=>this.conversations().find(t=>t.id===this.activeConversationId())??null);forecastTitle=f(null);activeConversationTitle=D(()=>this.activeConversation()?.title??this.forecastTitle()??"New conversation");static FALLBACK_PROMPTS=["Give me a dashboard overview of my workforce","Show headcount breakdown by department","What are the top metrics I should be tracking?","Analyze trends over the last quarter","Show me employee distribution by location"];constructor(){fe(()=>{let t=this.customerId(),e=this.selectedScope();if(!t)return;let n=e?e.id:null,o=e?.kind==="pipeline",a=++this.suggestionsSeq;this.suggestionsLoading.set(!0),this.svc.getSuggestedPrompts(n,o).then(p=>{if(a!==this.suggestionsSeq)return;let x=[...p.widgetSuggestions??[],...p.conversationStarters??[]];this.suggestions.set(x.length?x:i.FALLBACK_PROMPTS)}).catch(()=>{a===this.suggestionsSeq&&this.suggestions.set(i.FALLBACK_PROMPTS)}).finally(()=>{a===this.suggestionsSeq&&this.suggestionsLoading.set(!1)})}),this.forecastApi.context().then(t=>this.forecastContext.set(t)),fe(()=>{let t=this.customerId();t&&Ut(()=>{let e=this.conversationCustomerId();!e||e===t||this.resetForTenantChange()})})}resetForTenantChange(){this.activeConversationId.set(null),this.conversationCustomerId.set(null),this.conversationConnectionId.set(null),this.messages.set([]),this.conversations.set([]),this.closeArtifact(),this.builderOpen.set(!1),this.builderPreseeded.set(!1),this.builderDashboardId.set(null),this.conversationsLoading.set(!0),this.svc.listConversations().then(t=>this.conversations.set(t)).catch(()=>this.conversations.set([])).finally(()=>this.conversationsLoading.set(!1)),this.loadConversationDashboards()}async ngOnInit(){this.destroyRef.onDestroy(gn(()=>this.readBrandSparklineColor())),this.readBrandSparklineColor();try{this.conversationsLoading.set(!0);let o=await this.svc.listConversations().catch(()=>[]);this.conversations.set(o)}finally{this.conversationsLoading.set(!1),this.loading.set(!1)}this.loadConversationDashboards(),this.prefetchTemplateCatalog();let t=I().initial,e=this.route.snapshot.queryParamMap.get("summary")==="1",n=t.dashboardId??this.route.snapshot.paramMap.get("id");n&&(this.builderPreseeded.set(!1),this.builderDashboardId.set(n),this.builderOpen.set(!0),t.summary||e?this.onExecutiveSummary(n).then(()=>{e&&this.router.navigate([],{relativeTo:this.route,queryParams:{},replaceUrl:!0})}):this.restoreThreadForDashboard(n))}async restoreThreadForDashboard(t){try{let e=null;if(e=(await this.svc.getDashboard(t).catch(()=>null))?.conversationId??null,e||(e=(await this.svc.listDashboards(100).catch(()=>[])).find(p=>p.id===t)?.conversationId??null),!e)return;let o=await this.svc.getConversation(e);if(!o)return;this.activeConversationId.set(e),this.conversationCustomerId.set(this.customerId()),this.conversationConnectionId.set(o.conversation.connectionId??null),this.messages.set(o.messages.map(Ri)),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 mt(this.selectedScope())??{}}closeScopeMenu(){this.showScopePicker.set(!1)}async selectConversation(t,e=!1){if(this.showConversationPicker.set(!1),!(t===this.activeConversationId()&&!e)){this.loading.set(!0),this.loadingConversation.set(!0);try{let n=await this.svc.getConversation(t);if(!n)return;this.activeConversationId.set(t),this.conversationCustomerId.set(this.customerId()),this.conversationConnectionId.set(n.conversation.connectionId??null),this.messages.set(n.messages.map(Ri)),this.loadConversationDashboards(),this.scrollToBottom()}catch{}finally{this.loading.set(!1),this.loadingConversation.set(!1)}}}async deleteConversation(t,e){t.stopPropagation();try{await this.svc.deleteConversation(e),this.conversations.update(n=>n.filter(o=>o.id!==e)),this.activeConversationId()===e&&(this.activeConversationId.set(null),this.conversationCustomerId.set(null),this.conversationConnectionId.set(null),this.messages.set([]))}catch{}}newConversation(){this.forecastTitle.set(null),this.closeForecastSettings(),this.appliedForecastSettings.set(null),this.activeConversationId.set(null),this.conversationCustomerId.set(null),this.conversationConnectionId.set(null),this.messages.set([]),this.showConversationPicker.set(!1)}openRelatedDashboard(t){this.showRelatedDashboards.set(!1),this.closeArtifact(),this.builderPreseeded.set(!1),this.builderDashboardId.set(t),this.builderOpen.set(!0)}async openNewDashboard(){if(!this.savingDashboard()){this.showRelatedDashboards.set(!1),this.savingDashboard.set(!0);try{let t="Untitled Dashboard";this.closeArtifact(),this.dashboardState.resetDashboard(),this.dashboardState.setDashboardName(t);let e=await this.svc.createDashboard(T(w({name:t,conversationId:this.activeConversationId()??void 0},this.dashboardSource()),{widgets:[]}));this.dashboardState.setDashboardId(e.id),this.builderPreseeded.set(!0),this.builderDashboardId.set(e.id),this.builderOpen.set(!0)}catch{}finally{this.savingDashboard.set(!1)}}}convSearch=f("");dashSearch=f("");renamingId=f(null);renameDraft=f("");static BUCKETS=[{key:"today",maxDays:0},{key:"yesterday",maxDays:1},{key:"week",maxDays:7},{key:"older",maxDays:1/0}];daysAgo(t){if(!t)return 1/0;let e=new Date(t);if(Number.isNaN(e.getTime()))return 1/0;let n=new Date;n.setHours(0,0,0,0);let o=new Date(e);return o.setHours(0,0,0,0),Math.round((n.getTime()-o.getTime())/864e5)}relativeStamp(t){if(!t)return"";let e=new Date(t);return Number.isNaN(e.getTime())?"":this.daysAgo(t)===0?e.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}):e.toLocaleDateString(void 0,{month:"short",day:"numeric"})}bucketLabel(t){let e=this.copy();return t==="today"?e.groupToday:t==="yesterday"?e.groupYesterday:t==="week"?e.groupPrevious7Days:e.groupOlder}groupByRecency(t,e){let n=[],o=[...t].sort((a,p)=>new Date(e(p)??0).getTime()-new Date(e(a)??0).getTime());for(let a of i.BUCKETS){let p=o.filter(x=>this.daysAgo(e(x))<=a.maxDays);if(p.length&&n.push({key:a.key,label:this.bucketLabel(a.key),items:p}),o=o.filter(x=>this.daysAgo(e(x))>a.maxDays),!o.length)break}return n}matches(t,e){return e?(t??"").toLowerCase().includes(e.toLowerCase()):!0}groupedConversations=D(()=>this.groupByRecency(this.conversations().filter(t=>this.matches(t.title,this.convSearch())),t=>t.updatedAt));groupedDashboards=D(()=>this.groupByRecency(this.conversationDashboards().filter(t=>this.matches(t.name,this.dashSearch())),t=>t.updatedAt));pickerSearch=f("");groupedPickerDashboards=D(()=>this.groupByRecency(this.conversationDashboards().filter(t=>this.matches(t.name,this.pickerSearch())),t=>t.updatedAt));pickerSearchEmpty=D(()=>!!this.pickerSearch()&&this.groupedPickerDashboards().length===0);convSearchEmpty=D(()=>!!this.convSearch()&&this.groupedConversations().length===0);dashSearchEmpty=D(()=>!!this.dashSearch()&&this.groupedDashboards().length===0);countClause(t,e){return typeof t!="number"||!Number.isFinite(t)?"":`${t} ${e}${t===1?"":"s"}`}conversationMeta(t){let e=this.relativeStamp(t.lastMessageAt??t.updatedAt);return[this.countClause(t.messageCount,"message"),e].filter(Boolean).join(" \xB7 ")}dashboardMeta(t){let e=this.relativeStamp(t.updatedAt);return[this.countClause(t.widgetCount,"widget"),e].filter(Boolean).join(" \xB7 ")}startRename(t,e,n){t.stopPropagation(),this.renamingId.set(e),this.renameDraft.set(n??"")}cancelRename(t){t?.stopPropagation(),this.renamingId.set(null)}async commitRenameConversation(t,e){t.stopPropagation();let n=this.renameDraft().trim();if(this.renamingId.set(null),!(!n||n===e.title))try{await this.svc.updateConversation(e.id,{title:n}),this.conversations.update(o=>o.map(a=>a.id===e.id?T(w({},a),{title:n}):a))}catch{}}async commitRenameDashboard(t,e){t.stopPropagation();let n=this.renameDraft().trim();if(this.renamingId.set(null),!(!n||n===e.name))try{await this.svc.updateDashboard(e.id,{name:n}),this.conversationDashboards.update(o=>o.map(a=>a.id===e.id?T(w({},a),{name:n}):a))}catch{}}async deleteDashboardFromMenu(t,e){t.stopPropagation();try{await this.svc.deleteDashboard(e),this.conversationDashboards.update(n=>n.filter(o=>o.id!==e)),this.builderDashboardId()===e&&this.builderOpen.set(!1)}catch{}}startEditTitle(){this.activeConversationId()&&(this.titleDraft.set(this.activeConversationTitle()),this.editingTitle.set(!0))}cancelEditTitle(){this.editingTitle.set(!1)}async commitTitle(){if(!this.editingTitle())return;this.editingTitle.set(!1);let t=this.activeConversationId(),e=this.titleDraft().trim();if(!(!t||!e||e===this.activeConversationTitle()))try{await this.svc.updateConversation(t,{title:e}),this.conversations.update(n=>n.map(o=>o.id===t?T(w({},o),{title:e}):o))}catch{}}onFilesPicked(t){let e=t.target,n=Array.from(e.files??[]);e.value="";for(let o of n)this.startUpload(o)}onComposerDragOver(t){this.attachAtCapacity()||this.isStreaming()||(t.preventDefault(),t.dataTransfer&&(t.dataTransfer.dropEffect="copy"))}onComposerDragEnter(t){this.attachAtCapacity()||this.isStreaming()||t.dataTransfer?.types.includes("Files")&&(t.preventDefault(),this.dragDepth++,this.isDraggingFile.set(!0))}onComposerDragLeave(t){t.preventDefault(),this.dragDepth=Math.max(0,this.dragDepth-1),this.dragDepth===0&&this.isDraggingFile.set(!1)}onComposerDrop(t){if(t.preventDefault(),this.dragDepth=0,this.isDraggingFile.set(!1),this.attachAtCapacity()||this.isStreaming())return;let e=Array.from(t.dataTransfer?.files??[]);for(let n of e)this.startUpload(n)}startUpload(t){let e=bt(t.name,t.type);if(e&&this.excelCount()>=yt||!e&&this.nonExcelCount()>=xt||!e&&!ft.includes(t.type)||t.size>ai||this.attachments().some(x=>x.name===t.name&&x.size===t.size&&x.file?.lastModified===t.lastModified))return;let o=Ce(),a=new AbortController,p={id:o,name:t.name,contentType:t.type,size:t.size,status:"uploading",progress:0,file:t,abort:a};this.attachments.update(x=>[...x,p]),this.runUpload(o,t,a)}async runUpload(t,e,n){try{let{key:o}=await this.svc.uploadAttachment(e,{signal:n.signal});this.patchAttachment(t,{status:"ready",key:o,progress:100})}catch(o){if(n.signal.aborted)return;console.error("[ask-aquera] attachment upload failed",o),this.patchAttachment(t,{status:"error"})}}patchAttachment(t,e){this.attachments.update(n=>n.map(o=>o.id===t?w(w({},o),e):o))}removeAttachment(t){this.attachments().find(e=>e.id===t)?.abort?.abort(),this.attachments.update(e=>e.filter(n=>n.id!==t))}retryAttachment(t){let e=this.attachments().find(o=>o.id===t);if(!e?.file)return;let n=new AbortController;this.patchAttachment(t,{status:"uploading",progress:0,abort:n}),this.runUpload(t,e.file,n)}isMultiChoice(t){return(t.choices?.length??0)>1}onChoiceChange(t,e,n){if(!n||e.selected||this.isStreaming())return;let o=e.options.find(a=>a.id===n);o&&(this.isMultiChoice(t)?this.updateAssistantMsg(t.id,a=>({choices:(a.choices??[]).map(p=>p===e?T(w({},p),{draftSelection:o.id,chatOpen:!1,chatDraftText:void 0}):p)})):this.selectChoice(t,e,o))}selectChoice(t,e,n){e.selected||this.isStreaming()||(this.updateAssistantMsg(t.id,o=>({choices:(o.choices??[]).map(a=>a===e?T(w({},a),{selected:n.id,draftSelection:void 0,chatOpen:!1,chatDraftText:void 0}):a)})),this.pendingDisplayOverride=`${this.choiceTitle(e)}: ${n.label}`,this.inputText.set(n.reply??n.label),this.sendMessage())}hasPendingDraft(t){return!!t.choices?.some(e=>!e.selected&&(e.draftSelection||e.chatDraftText?.trim()))}submitChoices(t){if(this.isStreaming())return;let e=[],n=[];this.updateAssistantMsg(t.id,o=>({choices:(o.choices??[]).map(a=>{if(a.selected)return a;let p=a.chatDraftText?.trim();if(p)return e.push(this.chatDraftReply(a,p)),n.push(`${this.choiceTitle(a)}: ${p}`),T(w({},a),{selected:"__chat__",draftSelection:void 0,chatOpen:!1});if(!a.draftSelection)return a;let x=a.options.find(v=>v.id===a.draftSelection);return x&&(e.push(x.reply??x.label),n.push(`${this.choiceTitle(a)}: ${x.label}`)),T(w({},a),{selected:a.draftSelection,draftSelection:void 0})})})),e.length&&(this.inputText.set(e.join(`
12
+ `)}function Ri(i){return{id:i.id,role:i.role,text:i.role==="user"?Wi(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 Oe=class i{alertDrawerOpen=f(!1);alertWidget=f(null);onSetAlert(t){this.alertWidget.set(t),this.alertDrawerOpen.set(!0)}onAlertClosed(){this.alertDrawerOpen.set(!1)}alertSource=D(()=>{let t=mt(this.selectedScope());if(t)return t;let e=this.conversationConnectionId();return e?{connectionId:e}:null});chartDataSourceId(t){return(t?.config??{}).dataSourceId??null}canCreateAlert(t){return!!this.alertSource()||!!this.chartDataSourceId(t)}createAlertFromChart(t){this.canCreateAlert(t)&&(this.isFilterChart(t)||this.onSetAlert(T(w({},this.artifactToWidget(t)),{id:"chat-alert"})))}aqChatEl;builderRef;artifactGridRef;composerRef;aiExecutiveSummaryEl;svc=z(he);tokenStore=z(ae);destroyRef=z(It);hostEl=z(ke);features(){return I().features}widgetMenu(){return I().features.widgetMenu}copy(){return I().copy}showHeader(){return I().ui.header}withCount(t,e){return ei(t,e)}zone=z(Re);appRef=z(zt);route=z(nn);router=z(on);dashboardState=z(xn);publishRepo=z(ue);globalWidget=z(Yn);forecastApi=z(nt);cohort=z(qe);forecastService=z(bn);loading=f(!0);conversations=f([]);activeConversationId=f(null);conversationCustomerId=f(null);conversationConnectionId=f(null);messages=f([]);inputText=f("");isStreaming=f(!1);streamAbort=null;suggestions=f([]);suggestionsLoading=f(!0);suggestionsSeq=0;showConversationPicker=f(!1);showRelatedDashboards=f(!1);loadingConversation=f(!1);editingTitle=f(!1);titleDraft=f("");editingDashboardTitle=f(!1);dashboardTitleDraft=f("");renamingDashboard=f(!1);conversationsLoading=f(!0);dashboardsLoading=f(!0);menuSkeletonRows=[188,142,205];gallerySkeletonRows=[420,300,480,360,260,400];librarySkeletonGroups=[["62%","48%"],["55%","70%"]];libraryChipSkeletonWidths=[58,96,84,78,86,88,100,104,76,88];savingDashboard=f(!1);committingAction=f(null);conversationDashboards=f([]);showAddPicker=f(!1);inlinePickerFor=f(null);inlineChartTypePickerFor=f(null);inlineChartTypeOptions=f([]);inlineChartTypeLoading=f(!1);inlineChartTypePickerSeq=0;inlineChartTypeApplying=f(!1);inlineChartTypeError=f(null);inlineFilterPickerFor=f(null);showScopePicker=f(!1);datasets=f([]);pipelines=f([]);scopeLoading=f(!1);selectedScope=f(null);scopeListsLoaded=!1;saveDialogOpen=f(!1);saveDashboardName=f("");chatPaneTab=f("chat");tabsVisible=D(()=>si(this.features()));cohortCriteria=f([]);selectedCriterionId=f(null);cohortPreview=f(null);cohortCriteriaLoaded=!1;cohortCriteriaLoading=f(!1);cohortCriteriaError=f(null);cohortPreviewLoading=f(!1);cohortPreviewError=f(null);cohortCriteriaSkeletonRows=[0,1,2,3];cohortMatchSkeletonRows=[0,1,2];cohortMatchesExpanded=f(!1);cohortAllMatches=f(null);cohortMembersLoading=f(!1);cohortMembersError=f(null);static COHORT_MEMBER_LIMIT=100;visibleCohortMatches=D(()=>ui(this.cohortPreview(),this.cohortAllMatches(),this.cohortMatchesExpanded()));cohortNamesWithheld=D(()=>wt(this.cohortPreview()));cohortHasMoreMatches=D(()=>gi(this.cohortPreview()));cohortMatchesTruncated=D(()=>mi(this.cohortPreview(),this.cohortAllMatches()));cohortMatchesTruncatedNote=D(()=>{let t=this.cohortPreview(),e=this.cohortAllMatches();return!t||!e?"":this.copy().cohortMatchesTruncatedNote.replace("{shown}",String(e.length)).replace("{matchCount}",String(t.matchCount))});cohortMatchSummary=D(()=>{let t=this.cohortPreview();return t?this.copy().cohortMatchSummary.replace("{matchCount}",String(t.matchCount)).replace("{totalCount}",String(t.totalCount)):""});cohortViewAllLabel=D(()=>{let t=this.cohortPreview();return t?this.cohortMatchesExpanded()?this.copy().cohortShowFewerLink:this.copy().cohortViewAllLink.replace("{matchCount}",String(t.matchCount)):""});async loadCohortCriteria(){if(!this.cohortCriteriaLoaded){this.cohortCriteriaLoading.set(!0),this.cohortCriteriaError.set(null);try{this.cohortCriteria.set(await this.cohort.listCriteria()),this.cohortCriteriaLoaded=!0}catch(t){this.cohortCriteriaError.set(kt(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(kt(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=_i(t);this.bucketExtraCharts.update(o=>[...o,n]),this.ensureArtifactPaneOpen()}setChatPaneTab(t){li(t,this.features())&&(this.chatPaneTab.set(t),(t==="library"||t==="tools")&&this.ensureArtifactPaneOpen(),t==="chat"&&this.activeArtifact().length===0&&this.closeArtifact(),t==="library"&&this.prefetchWidgetTemplateCatalog(),t==="tools"&&this.loadCohortCriteria())}galleryOpen=f(!1);gallerySearch=f("");templateCategories=f([]);templateAllTemplates=f([]);templateCategoriesLoading=f(!1);templateTemplatesLoading=f(!1);templateActiveCategory=f("all");widgetTemplateAllTemplates=f([]);widgetTemplateTemplatesLoading=f(!1);widgetTemplateActiveCategory=f("all");selectWidgetTemplateCategory(t){this.widgetTemplateActiveCategory.set(t)}widgetTemplatePickerSelectedIds=f([]);toggleWidgetTemplateSelection(t){this.widgetTemplatePickerSelectedIds.update(e=>e.includes(t)?e.filter(n=>n!==t):[...e,t])}addSelectedWidgetTemplates(){let t=this.widgetTemplatePickerSelectedIds();t.length&&(this.asOneCanvasStep(()=>{for(let e of t)this.selectWidgetTemplate(e)}),this.widgetTemplatePickerSelectedIds.set([]))}widgetTemplateCountForCategory(t){return this.widgetTemplateAllTemplates().filter(e=>e.category===t).length}librarySearch=f("");libraryKpiChartOptions={exporting:{enabled:!1},credits:{enabled:!1}};brandSparklineColor=f(In);readBrandSparklineColor(){this.brandSparklineColor.set(Vn(this.hostEl.nativeElement))}widgetTemplateCard(t){let e=this.widgetTemplatePreviews(),a=e.get(t.id)?.config?.config?.chart;return{templateId:t.id,title:t.widgetName,desc:t.description,value:a?.value??"\u2014",loading:!e.has(t.id),sparkline:a?.sparkline??[]}}libraryWidgetGroups=D(()=>{let t=this.widgetTemplateActiveCategory(),e=this.librarySearch().trim().toLowerCase();return(t==="all"?this.templateCategories():this.templateCategories().filter(o=>o.key===t)).map(o=>({key:o.key,label:o.label,cards:this.widgetTemplateAllTemplates().filter(a=>a.category===o.key).filter(a=>!e||a.widgetName.toLowerCase().includes(e)||(a.description??"").toLowerCase().includes(e)).map(a=>this.widgetTemplateCard(a))})).filter(o=>o.cards.length>0)});isGroupFullySelected(t){let e=this.widgetTemplatePickerSelectedIds();return t.length>0&&t.every(n=>e.includes(n.templateId))}toggleLibraryGroupSelection(t){let e=t.map(o=>o.templateId),n=this.isGroupFullySelected(t);this.widgetTemplatePickerSelectedIds.update(o=>{let a=new Set(o);return n?e.forEach(p=>a.delete(p)):e.forEach(p=>a.add(p)),[...a]})}openWidgetDetailFromCard(t){let e=this.widgetTemplatePreviews().get(t);if(!e)return;let n=T(w({},this.artifactToWidget(e)),{id:`kpi-gallery-${t}`});this.openWidgetDetailPanelForWidget(n,!0)}runViewTransition(t,e="forward"){let n=document,o=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;if(typeof n.startViewTransition!="function"||o){t();return}let a=document.documentElement;e==="back"&&(a.dataset.vtDirection="back");let p=()=>delete a.dataset.vtDirection;n.startViewTransition(()=>{t(),this.appRef.tick()})?.finished?.then(p,p)??p()}artifactPickerTab=f("kpis");templateCountForCategory(t){return this.templateAllTemplates().filter(e=>e.category===t).length}libraryDashboardGroups=D(()=>{let t=this.templateActiveCategory(),e=this.librarySearch().trim().toLowerCase();return(t==="all"?this.templateCategories():this.templateCategories().filter(o=>o.key===t)).map(o=>({key:o.key,label:o.label,templates:this.templateAllTemplates().filter(a=>a.category===o.key).filter(a=>!e||a.name.toLowerCase().includes(e)||(a.description??"").toLowerCase().includes(e))})).filter(o=>o.templates.length>0)});widgetTemplatePreviews=f(new Map);widgetTemplateSourceId=f(null);widgetDetailPanelOpen=f(!1);widgetDetailPanelLoading=f(!1);widgetDetailPanelTitle=f(null);widgetDetailPanelRaw=f([]);widgetDetailPanelTemplateId=f(null);widgetDetailPanelCanAdd=f(!1);widgetDetailPanelKind=f("widget");widgetDetailPanelSourceWidgetTitle=f(null);detailPanelWidgetCrumb=D(()=>this.widgetDetailPanelKind()==="widget"?this.widgetDetailPanelSourceWidgetTitle():null);detailPanelLastCrumb=D(()=>{let t=this.widgetDetailPanelTitle();return t?t===this.detailPanelWidgetCrumb()?this.copy().detailCrumbLabel:t:null});widgetDetailPanelSelectedIds=f([]);widgetDetailPanelSourceTemplateId=f(null);detailPanelCohortId=f(null);detailPanelCohortData=f(null);cohortDetailCaption=D(()=>{let t=this.copy().cohortDetailCaption,e=this.detailPanelCohortData()?.detail?.scan;if(!e)return t;let n=this.copy().cohortDetailCoverage.replace("{events}",String(e.events)).replace("{systems}",String(e.systems));return`${t} \xB7 ${n}`});widgetDetailPanelSkeletonSlots=f([]);widgetDetailPanelSkeletonHeight=D(()=>{let t=this.widgetDetailPanelSkeletonSlots();return t.length?Math.max(...t.map(e=>(e.y+e.h)*72)):0});widgetDetailPanelWidgets=D(()=>{let t=this.widgetDetailPanelRaw().map((e,n)=>T(w({},this.artifactToWidget(e)),{id:`detail-panel-${n}`}));return pt(t)});filteredGalleryPrompts=D(()=>{let t=this.gallerySearch().trim().toLowerCase(),e=this.suggestions();return t?e.filter(n=>n.toLowerCase().includes(t)):e});welcomePromptCards=D(()=>{let t=this.forecastContext();return this.suggestions().slice(0,Fc).map(e=>(I().features.forecast&&t?!!At(e,t):!1)?{label:e,icon:"ng-stars-02",badge:"FORECAST",tone:"ai"}:{label:e,icon:"ng-lightbulb-05",tone:"plain"})});galleryPromptItems=D(()=>this.filteredGalleryPrompts().map(t=>({key:t,label:t,icon:"ng-lightbulb-05"})));artifactSourceMsgId=f(null);activeArtifactRaw=f([]);artifactForcedOpen=f(!1);templateSourceId=f(null);bucketExtraCharts=f([]);activeArtifact=D(()=>{let t=this.artifactSourceMsgId(),e=t?this.messages().find(o=>o.id===t)?.charts??this.activeArtifactRaw():this.activeArtifactRaw(),n=this.bucketExtraCharts();return n.length?[...e,...n]:e});artifactOpen=D(()=>this.artifactForcedOpen()||this.activeArtifact().length>0);dslOnlyArtifact=f(!1);CANVAS_HISTORY_LIMIT=25;canvasUndoStack=f([]);canvasRedoStack=f([]);canUndoCanvas=D(()=>this.canvasUndoStack().length>0);canRedoCanvas=D(()=>this.canvasRedoStack().length>0);canvasHistorySuspended=!1;snapshotCanvas(){return{base:[...this.activeArtifactRaw()],extras:[...this.bucketExtraCharts()],sourceMsgId:this.artifactSourceMsgId(),templateSourceId:this.templateSourceId(),widgetTemplateSourceId:this.widgetTemplateSourceId(),saveName:this.saveDashboardName()}}restoreCanvas(t){this.artifactSourceMsgId.set(t.sourceMsgId),this.activeArtifactRaw.set(t.base),this.bucketExtraCharts.set(t.extras),this.templateSourceId.set(t.templateSourceId),this.widgetTemplateSourceId.set(t.widgetTemplateSourceId),this.saveDashboardName.set(t.saveName),this.selectedWidgetIds.set([]),this.ensureArtifactPaneOpen()}pushCanvasHistory(){this.canvasHistorySuspended||(this.canvasUndoStack.update(t=>[...t,this.snapshotCanvas()].slice(-this.CANVAS_HISTORY_LIMIT)),this.canvasRedoStack.set([]))}asOneCanvasStep(t){this.pushCanvasHistory(),this.canvasHistorySuspended=!0;try{t()}finally{this.canvasHistorySuspended=!1}}undoCanvas(){let t=this.canvasUndoStack();t.length&&(this.canvasRedoStack.update(e=>[...e,this.snapshotCanvas()].slice(-this.CANVAS_HISTORY_LIMIT)),this.canvasUndoStack.set(t.slice(0,-1)),this.restoreCanvas(t[t.length-1]))}redoCanvas(){let t=this.canvasRedoStack();t.length&&(this.canvasUndoStack.update(e=>[...e,this.snapshotCanvas()].slice(-this.CANVAS_HISTORY_LIMIT)),this.canvasRedoStack.set(t.slice(0,-1)),this.restoreCanvas(t[t.length-1]))}ensureArtifactPaneOpen(){this.artifactForcedOpen()||this.artifactForcedOpen.set(!0)}artifactTitle=D(()=>{let t=this.mostRecentDashboardTitle();return t||(this.activeArtifact().find(n=>!this.isFilterChart(n))?.title??this.activeArtifact()[0]?.title??"Untitled canvas")});artifactSubtitle=D(()=>{let t=this.activeArtifact().filter(e=>!this.isFilterChart(e)).length;return`${this.artifactTitle()} \xB7 ${t} widget${t===1?"":"s"}`});isFilterChart(t){if(!t)return!1;let e=t.config??{};return $e({componentName:(e.componentName??t.componentName??"").toLowerCase(),config:e.config??e})}mostRecentDashboardTitle(){let t=this.artifactSourceMsgId();if(!t)return;let e=this.messages(),n=e.findIndex(o=>o.id===t);for(let o=n;o>=0;o--)if(e[o]?.dashboardTitle)return e[o].dashboardTitle}baseArtifactWidgets=D(()=>{let t=this.artifactSourceMsgId()??"artifact",e=this.activeArtifact().map((o,a)=>T(w({},this.artifactToWidget(o)),{id:`${t}-${a}`})),n=pt(e);return fn(n)});filterOverlay=f(new Map);forecastOverlay=f(new Map);artifactForecastable=f({});artifactForecastingId=f(null);artifactWidgets=D(()=>{let t=this.baseArtifactWidgets(),e=this.filterOverlay(),n=this.forecastOverlay();return!e.size&&!n.size?t:t.map(o=>{let a=e.get(o.id),p=a?T(w({},o),{config:a.config,edited:a.edited}):o,x=n.get(o.id);return x?T(w({},p),{config:x}):p})});async onArtifactForecast(t){let e=String(t.widget.id);if(!this.artifactForecastingId()){if(!t.enable){this.forecastOverlay.update(n=>{let o=new Map(n);return o.delete(e),o});return}this.artifactForecastingId.set(e);try{let n=await this.forecastService.forecastWidget(t.widget);if(n?.guardrails&&n.guardrails.passed===!1)return;n?.widget?.config&&this.forecastOverlay.update(o=>new Map(o).set(e,n.widget.config))}catch{}finally{this.artifactForecastingId.set(null)}}}async loadArtifactForecastable(){let t=this.baseArtifactWidgets();if(!t.length){this.artifactForecastable.set({});return}this.artifactForecastable.set(await this.forecastService.probeWidgets(t))}applyingFilters=f(!1);activeDashboardFilters=f(null);activeResolvedFilters=f(null);applySummary=f(null);filterExplanation=f(null);applyFiltersSeq=0;applyFiltersAbort=null;filterSuggestCache=new Map;filterSuggestInflight=new Set;selectedWidgetIds=f([]);hasSelection=D(()=>this.features().canvas.widgetSelection?this.selectedWidgetIds().length>0:this.artifactWidgets().length>0);selectedArtifactCharts=D(()=>{if(!this.features().canvas.widgetSelection)return this.activeArtifact();let t=new Set(this.selectedWidgetIds()),e=this.artifactWidgets();return this.activeArtifact().filter((n,o)=>t.has(e[o]?.id))});artifactFooterHasActions=D(()=>{let t=this.features().canvas;return t.publishAsDashboard||t.addToDashboard||!!this.artifactForecastMsg()});builderOpen=f(!1);detailRootCrumb=D(()=>this.builderOpen()?this.builderRef?.dashboardName?.()?.trim()||this.copy().detailDashboardCrumbLabel:this.copy().detailCanvasCrumbLabel);builderDashboardId=f(null);builderPreseeded=f(!1);builderFullscreen=f(!1);chatPaneWidth=f(null);isResizing=f(!1);layoutMode=D(()=>ri({hasMessages:this.messages().length>0,artifactOpen:this.artifactOpen()&&!this.dslOnlyArtifact(),builderOpen:this.builderOpen()}));chatPaneStyleWidth=D(()=>{if(this.builderFullscreen())return null;let t=this.layoutMode();return t==="split"||t==="builder"?this.chatPaneWidth():null});customerId=()=>{let t=this.tokenStore.tenantId();return I().customerId??t??""};attachments=f([]);uploadsInFlight=D(()=>this.attachments().some(t=>t.status==="uploading"));excelCount=D(()=>this.attachments().filter(t=>bt(t.name,t.contentType)).length);nonExcelCount=D(()=>this.attachments().length-this.excelCount());attachAtCapacity=D(()=>this.nonExcelCount()>=xt&&this.excelCount()>=yt);acceptUploadTypes=[...ft,".xls",".xlsx"].join(",");dragDepth=0;isDraggingFile=f(!1);canSend=D(()=>{let t=this.inputText().trim().length>0,e=this.attachments().some(n=>n.status==="ready");return(t||e)&&!this.isStreaming()&&!this.uploadsInFlight()});quoteBadge=f(null);replyQuote=f(null);activeConversation=D(()=>this.conversations().find(t=>t.id===this.activeConversationId())??null);forecastTitle=f(null);activeConversationTitle=D(()=>this.activeConversation()?.title??this.forecastTitle()??"New conversation");static FALLBACK_PROMPTS=["Give me a dashboard overview of my workforce","Show headcount breakdown by department","What are the top metrics I should be tracking?","Analyze trends over the last quarter","Show me employee distribution by location"];constructor(){fe(()=>{let t=this.customerId(),e=this.selectedScope();if(!t)return;let n=e?e.id:null,o=e?.kind==="pipeline",a=++this.suggestionsSeq;this.suggestionsLoading.set(!0),this.svc.getSuggestedPrompts(n,o).then(p=>{if(a!==this.suggestionsSeq)return;let x=[...p.widgetSuggestions??[],...p.conversationStarters??[]];this.suggestions.set(x.length?x:i.FALLBACK_PROMPTS)}).catch(()=>{a===this.suggestionsSeq&&this.suggestions.set(i.FALLBACK_PROMPTS)}).finally(()=>{a===this.suggestionsSeq&&this.suggestionsLoading.set(!1)})}),this.forecastApi.context().then(t=>this.forecastContext.set(t)),fe(()=>{let t=this.customerId();t&&Ut(()=>{let e=this.conversationCustomerId();!e||e===t||this.resetForTenantChange()})})}resetForTenantChange(){this.activeConversationId.set(null),this.conversationCustomerId.set(null),this.conversationConnectionId.set(null),this.messages.set([]),this.conversations.set([]),this.closeArtifact(),this.builderOpen.set(!1),this.builderPreseeded.set(!1),this.builderDashboardId.set(null),this.conversationsLoading.set(!0),this.svc.listConversations().then(t=>this.conversations.set(t)).catch(()=>this.conversations.set([])).finally(()=>this.conversationsLoading.set(!1)),this.loadConversationDashboards()}async ngOnInit(){this.destroyRef.onDestroy(gn(()=>this.readBrandSparklineColor())),this.readBrandSparklineColor();try{this.conversationsLoading.set(!0);let o=await this.svc.listConversations().catch(()=>[]);this.conversations.set(o)}finally{this.conversationsLoading.set(!1),this.loading.set(!1)}this.loadConversationDashboards(),this.prefetchTemplateCatalog();let t=I().initial,e=this.route.snapshot.queryParamMap.get("summary")==="1",n=t.dashboardId??this.route.snapshot.paramMap.get("id");n&&(this.builderPreseeded.set(!1),this.builderDashboardId.set(n),this.builderOpen.set(!0),t.summary||e?this.onExecutiveSummary(n).then(()=>{e&&this.router.navigate([],{relativeTo:this.route,queryParams:{},replaceUrl:!0})}):this.restoreThreadForDashboard(n))}async restoreThreadForDashboard(t){try{let e=null;if(e=(await this.svc.getDashboard(t).catch(()=>null))?.conversationId??null,e||(e=(await this.svc.listDashboards(100).catch(()=>[])).find(p=>p.id===t)?.conversationId??null),!e)return;let o=await this.svc.getConversation(e);if(!o)return;this.activeConversationId.set(e),this.conversationCustomerId.set(this.customerId()),this.conversationConnectionId.set(o.conversation.connectionId??null),this.messages.set(o.messages.map(Ri)),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 mt(this.selectedScope())??{}}closeScopeMenu(){this.showScopePicker.set(!1)}async selectConversation(t,e=!1){if(this.showConversationPicker.set(!1),!(t===this.activeConversationId()&&!e)){this.loading.set(!0),this.loadingConversation.set(!0);try{let n=await this.svc.getConversation(t);if(!n)return;this.activeConversationId.set(t),this.conversationCustomerId.set(this.customerId()),this.conversationConnectionId.set(n.conversation.connectionId??null),this.messages.set(n.messages.map(Ri)),this.loadConversationDashboards(),this.scrollToBottom()}catch{}finally{this.loading.set(!1),this.loadingConversation.set(!1)}}}async deleteConversation(t,e){t.stopPropagation();try{await this.svc.deleteConversation(e),this.conversations.update(n=>n.filter(o=>o.id!==e)),this.activeConversationId()===e&&(this.activeConversationId.set(null),this.conversationCustomerId.set(null),this.conversationConnectionId.set(null),this.messages.set([]))}catch{}}newConversation(){this.forecastTitle.set(null),this.closeForecastSettings(),this.appliedForecastSettings.set(null),this.activeConversationId.set(null),this.conversationCustomerId.set(null),this.conversationConnectionId.set(null),this.messages.set([]),this.showConversationPicker.set(!1)}openRelatedDashboard(t){this.showRelatedDashboards.set(!1),this.closeArtifact(),this.builderPreseeded.set(!1),this.builderDashboardId.set(t),this.builderOpen.set(!0)}async openNewDashboard(){if(!this.savingDashboard()){this.showRelatedDashboards.set(!1),this.savingDashboard.set(!0);try{let t="Untitled Dashboard";this.closeArtifact(),this.dashboardState.resetDashboard(),this.dashboardState.setDashboardName(t);let e=await this.svc.createDashboard(T(w({name:t,conversationId:this.activeConversationId()??void 0},this.dashboardSource()),{widgets:[]}));this.dashboardState.setDashboardId(e.id),this.builderPreseeded.set(!0),this.builderDashboardId.set(e.id),this.builderOpen.set(!0)}catch{}finally{this.savingDashboard.set(!1)}}}convSearch=f("");dashSearch=f("");renamingId=f(null);renameDraft=f("");static BUCKETS=[{key:"today",maxDays:0},{key:"yesterday",maxDays:1},{key:"week",maxDays:7},{key:"older",maxDays:1/0}];daysAgo(t){if(!t)return 1/0;let e=new Date(t);if(Number.isNaN(e.getTime()))return 1/0;let n=new Date;n.setHours(0,0,0,0);let o=new Date(e);return o.setHours(0,0,0,0),Math.round((n.getTime()-o.getTime())/864e5)}relativeStamp(t){if(!t)return"";let e=new Date(t);return Number.isNaN(e.getTime())?"":this.daysAgo(t)===0?e.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}):e.toLocaleDateString(void 0,{month:"short",day:"numeric"})}bucketLabel(t){let e=this.copy();return t==="today"?e.groupToday:t==="yesterday"?e.groupYesterday:t==="week"?e.groupPrevious7Days:e.groupOlder}groupByRecency(t,e){let n=[],o=[...t].sort((a,p)=>new Date(e(p)??0).getTime()-new Date(e(a)??0).getTime());for(let a of i.BUCKETS){let p=o.filter(x=>this.daysAgo(e(x))<=a.maxDays);if(p.length&&n.push({key:a.key,label:this.bucketLabel(a.key),items:p}),o=o.filter(x=>this.daysAgo(e(x))>a.maxDays),!o.length)break}return n}matches(t,e){return e?(t??"").toLowerCase().includes(e.toLowerCase()):!0}groupedConversations=D(()=>this.groupByRecency(this.conversations().filter(t=>this.matches(t.title,this.convSearch())),t=>t.updatedAt));groupedDashboards=D(()=>this.groupByRecency(this.conversationDashboards().filter(t=>this.matches(t.name,this.dashSearch())),t=>t.updatedAt));pickerSearch=f("");groupedPickerDashboards=D(()=>this.groupByRecency(this.conversationDashboards().filter(t=>this.matches(t.name,this.pickerSearch())),t=>t.updatedAt));pickerSearchEmpty=D(()=>!!this.pickerSearch()&&this.groupedPickerDashboards().length===0);convSearchEmpty=D(()=>!!this.convSearch()&&this.groupedConversations().length===0);dashSearchEmpty=D(()=>!!this.dashSearch()&&this.groupedDashboards().length===0);countClause(t,e){return typeof t!="number"||!Number.isFinite(t)?"":`${t} ${e}${t===1?"":"s"}`}conversationMeta(t){let e=this.relativeStamp(t.lastMessageAt??t.updatedAt);return[this.countClause(t.messageCount,"message"),e].filter(Boolean).join(" \xB7 ")}dashboardMeta(t){let e=this.relativeStamp(t.updatedAt);return[this.countClause(t.widgetCount,"widget"),e].filter(Boolean).join(" \xB7 ")}startRename(t,e,n){t.stopPropagation(),this.renamingId.set(e),this.renameDraft.set(n??"")}cancelRename(t){t?.stopPropagation(),this.renamingId.set(null)}async commitRenameConversation(t,e){t.stopPropagation();let n=this.renameDraft().trim();if(this.renamingId.set(null),!(!n||n===e.title))try{await this.svc.updateConversation(e.id,{title:n}),this.conversations.update(o=>o.map(a=>a.id===e.id?T(w({},a),{title:n}):a))}catch{}}async commitRenameDashboard(t,e){t.stopPropagation();let n=this.renameDraft().trim();if(this.renamingId.set(null),!(!n||n===e.name))try{await this.svc.updateDashboard(e.id,{name:n}),this.conversationDashboards.update(o=>o.map(a=>a.id===e.id?T(w({},a),{name:n}):a))}catch{}}async deleteDashboardFromMenu(t,e){t.stopPropagation();try{await this.svc.deleteDashboard(e),this.conversationDashboards.update(n=>n.filter(o=>o.id!==e)),this.builderDashboardId()===e&&this.builderOpen.set(!1)}catch{}}startEditTitle(){this.activeConversationId()&&(this.titleDraft.set(this.activeConversationTitle()),this.editingTitle.set(!0))}cancelEditTitle(){this.editingTitle.set(!1)}async commitTitle(){if(!this.editingTitle())return;this.editingTitle.set(!1);let t=this.activeConversationId(),e=this.titleDraft().trim();if(!(!t||!e||e===this.activeConversationTitle()))try{await this.svc.updateConversation(t,{title:e}),this.conversations.update(n=>n.map(o=>o.id===t?T(w({},o),{title:e}):o))}catch{}}onFilesPicked(t){let e=t.target,n=Array.from(e.files??[]);e.value="";for(let o of n)this.startUpload(o)}onComposerDragOver(t){this.attachAtCapacity()||this.isStreaming()||(t.preventDefault(),t.dataTransfer&&(t.dataTransfer.dropEffect="copy"))}onComposerDragEnter(t){this.attachAtCapacity()||this.isStreaming()||t.dataTransfer?.types.includes("Files")&&(t.preventDefault(),this.dragDepth++,this.isDraggingFile.set(!0))}onComposerDragLeave(t){t.preventDefault(),this.dragDepth=Math.max(0,this.dragDepth-1),this.dragDepth===0&&this.isDraggingFile.set(!1)}onComposerDrop(t){if(t.preventDefault(),this.dragDepth=0,this.isDraggingFile.set(!1),this.attachAtCapacity()||this.isStreaming())return;let e=Array.from(t.dataTransfer?.files??[]);for(let n of e)this.startUpload(n)}startUpload(t){let e=bt(t.name,t.type);if(e&&this.excelCount()>=yt||!e&&this.nonExcelCount()>=xt||!e&&!ft.includes(t.type)||t.size>ai||this.attachments().some(x=>x.name===t.name&&x.size===t.size&&x.file?.lastModified===t.lastModified))return;let o=Ce(),a=new AbortController,p={id:o,name:t.name,contentType:t.type,size:t.size,status:"uploading",progress:0,file:t,abort:a};this.attachments.update(x=>[...x,p]),this.runUpload(o,t,a)}async runUpload(t,e,n){try{let{key:o}=await this.svc.uploadAttachment(e,{signal:n.signal});this.patchAttachment(t,{status:"ready",key:o,progress:100})}catch(o){if(n.signal.aborted)return;console.error("[ask-aquera] attachment upload failed",o),this.patchAttachment(t,{status:"error"})}}patchAttachment(t,e){this.attachments.update(n=>n.map(o=>o.id===t?w(w({},o),e):o))}removeAttachment(t){this.attachments().find(e=>e.id===t)?.abort?.abort(),this.attachments.update(e=>e.filter(n=>n.id!==t))}retryAttachment(t){let e=this.attachments().find(o=>o.id===t);if(!e?.file)return;let n=new AbortController;this.patchAttachment(t,{status:"uploading",progress:0,abort:n}),this.runUpload(t,e.file,n)}isMultiChoice(t){return(t.choices?.length??0)>1}onChoiceChange(t,e,n){if(!n||e.selected||this.isStreaming())return;let o=e.options.find(a=>a.id===n);o&&(this.isMultiChoice(t)?this.updateAssistantMsg(t.id,a=>({choices:(a.choices??[]).map(p=>p===e?T(w({},p),{draftSelection:o.id,chatOpen:!1,chatDraftText:void 0}):p)})):this.selectChoice(t,e,o))}selectChoice(t,e,n){e.selected||this.isStreaming()||(this.updateAssistantMsg(t.id,o=>({choices:(o.choices??[]).map(a=>a===e?T(w({},a),{selected:n.id,draftSelection:void 0,chatOpen:!1,chatDraftText:void 0}):a)})),this.pendingDisplayOverride=`${this.choiceTitle(e)}: ${n.label}`,this.inputText.set(n.reply??n.label),this.sendMessage())}hasPendingDraft(t){return!!t.choices?.some(e=>!e.selected&&(e.draftSelection||e.chatDraftText?.trim()))}submitChoices(t){if(this.isStreaming())return;let e=[],n=[];this.updateAssistantMsg(t.id,o=>({choices:(o.choices??[]).map(a=>{if(a.selected)return a;let p=a.chatDraftText?.trim();if(p)return e.push(this.chatDraftReply(a,p)),n.push(`${this.choiceTitle(a)}: ${p}`),T(w({},a),{selected:"__chat__",draftSelection:void 0,chatOpen:!1});if(!a.draftSelection)return a;let x=a.options.find(v=>v.id===a.draftSelection);return x&&(e.push(x.reply??x.label),n.push(`${this.choiceTitle(a)}: ${x.label}`)),T(w({},a),{selected:a.draftSelection,draftSelection:void 0})})})),e.length&&(this.inputText.set(e.join(`
13
13
  `)),this.pendingDisplayOverride=n.join(`
14
14
  `),this.sendMessage())}answerSummaryRows(t){return(t.text??"").split(`
15
15
  `).map(e=>{let n=e.indexOf(": ");return n===-1?{title:e,answer:""}:{title:e.slice(0,n),answer:e.slice(n+2)}})}choiceTitle(t){let e=t.prompt??"",n=/—\s*(.+)$/.exec(e);return(n?n[1].trim():e)||"Answer"}subjectIdOf(t){let e=t.options[0]?.id??"";return e.includes("::")?e.slice(0,e.lastIndexOf("::")):e}chatDraftReply(t,e){return t.kind==="widget_clarification"||t.kind==="widget_plan"||t.kind==="plan_intake"?`For "${this.subjectIdOf(t)}": ${e}`:e}requestPlan(t,e){e.selected||this.isStreaming()||(this.updateAssistantMsg(t.id,n=>({choices:(n.choices??[]).map(o=>o===e?T(w({},o),{selected:"__plan__"}):o)})),this.inputText.set("Give me the plan"),this.sendMessage())}previewWidget(t,e){e.selected||this.isStreaming()||(this.pendingDisplayOverride=`Preview "${this.choiceTitle(e)}"`,this.inputText.set(`For "${this.subjectIdOf(e)}": Preview this widget`),this.sendMessage())}isPreviewChart(t){return!!t?.config?.preview&&!!t?.config?.previewOf}previewAltLabel(t){return t?.config?.previewAltLabel??null}replyForPreview(t,e){if(this.isStreaming())return;let n=t?.config?.previewOf;n&&(this.inputText.set(`For "${n}": ${e}`),this.sendMessage())}acceptPreview(t){this.replyForPreview(t,"Use this")}tryAlternatePreview(t){let e=this.previewAltLabel(t);e&&this.replyForPreview(t,e)}skipPreview(t){this.replyForPreview(t,"Skip this widget")}openChatDraft(t,e){this.isStreaming()||e.selected||this.updateAssistantMsg(t.id,n=>({choices:(n.choices??[]).map(o=>o===e?T(w({},o),{chatOpen:!0,draftSelection:void 0}):o)}))}onChatDraftTextChange(t,e,n){this.updateAssistantMsg(t.id,o=>({choices:(o.choices??[]).map(a=>a===e?T(w({},a),{chatDraftText:n}):a)}))}defineChatDraft(t,e){let n=e.chatDraftText?.trim();if(!(!n||this.isStreaming())){if(this.isMultiChoice(t)){this.updateAssistantMsg(t.id,o=>({choices:(o.choices??[]).map(a=>a===e?T(w({},a),{chatOpen:!1}):a)}));return}this.updateAssistantMsg(t.id,o=>({choices:(o.choices??[]).map(a=>a===e?T(w({},a),{selected:"__chat__",chatOpen:!1}):a)})),this.inputText.set(this.chatDraftReply(e,n)),this.sendMessage()}}choicePanelIndex=new Map;dismissedChoicePanels=new Set;nonPanelChoices(t){return this.isMultiChoice(t)?[]:t.choices??[]}panelAnsweredCount(t){return t.filter(e=>!!e.selected||!!e.draftSelection||!!e.chatDraftText?.trim()).length}isChoicePanelComplete(t){return t.every(e=>!!e.selected)}choicePanelIndexFor(t,e){return this.choicePanelIndex.has(t.id)||this.choicePanelIndex.set(t.id,this.panelAnsweredCount(e)),Math.min(this.choicePanelIndex.get(t.id),e.length)}activeChoicePanel(){let t=this.messages();for(let e=t.length-1;e>=0;e--){let n=t[e];if(!this.isMultiChoice(n))continue;let o=n.choices;if(!this.isChoicePanelComplete(o)&&!this.dismissedChoicePanels.has(n.id))return{msg:n,choices:o,index:this.choicePanelIndexFor(n,o)}}return null}panelBadgeLabel(t){switch(t.kind){case"plan_intake":return"SETUP";case"widget_clarification":case"clarification":return"CLARIFY";default:return null}}chatDraftPlaceholderFor(t){switch(t.kind){case"widget_clarification":return this.copy().chatDraftPlaceholderWidget;case"widget_plan":return this.copy().chatDraftPlaceholderPlan;case"plan_intake":return this.copy().chatDraftPlaceholderIntake;default:return this.copy().chatDraftPlaceholderClarification}}panelAnswerLabel(t){let e=t.chatDraftText?.trim();if(e)return e;let n=t.draftSelection??t.selected,o=t.options.find(a=>a.id===n);return o?o.label==="Use this"?"Recommended":o.label:"Skipped"}optionPrimaryText(t){return t.label==="Use this"&&t.hint?t.hint:t.label}optionBadgeText(t){return t.label==="Use this"&&t.hint?"Recommended":null}advanceChoicePanel(t){let e=this.choicePanelIndex.get(t.id)??0;this.choicePanelIndex.set(t.id,e+1)}onPanelChatDraftConfirm(t,e){!e.chatDraftText?.trim()||this.isStreaming()||(this.defineChatDraft(t,e),this.advanceChoicePanel(t))}onPanelSkip(t){this.isStreaming()||this.advanceChoicePanel(t)}onPanelPrev(t){let e=this.choicePanelIndex.get(t.id)??0;e>0&&this.choicePanelIndex.set(t.id,e-1)}dismissChoicePanel(t){this.dismissedChoicePanels.add(t.id)}resumeChoicePanel(t){this.dismissedChoicePanels.delete(t.id)}isChoicePanelDismissed(t){return this.dismissedChoicePanels.has(t.id)}static TEXT_REDUNDANT_CHOICE_KINDS=new Set(["index","clarification","widget_clarification"]);suppressTextFor(t){let e=t.choices;return!!e?.length&&e.every(n=>!!n.kind&&i.TEXT_REDUNDANT_CHOICE_KINDS.has(n.kind))}onThreadMouseUp(t){let e=t.composedPath();if(e.some(S=>S instanceof HTMLElement&&S.classList.contains("reply-badge")))return;let n=document.getSelection(),o=n?.toString().trim()??"",a=e.some(S=>S instanceof HTMLElement&&S.classList.contains("assistant-text"));if(!n||!o||!a){this.quoteBadge.set(null);return}let p=46,x=Math.min(Math.max(t.clientX,p+8),window.innerWidth-p-8),A=t.clientY>=34;this.quoteBadge.set({text:o,top:t.clientY,left:x,above:A})}onTextSelectionChange(){if(!this.quoteBadge())return;let t=document.getSelection();(!t||!t.toString().trim())&&this.quoteBadge.set(null)}hideQuoteBadge(){this.quoteBadge.set(null)}addReplyQuote(){let t=this.quoteBadge();t&&(this.quoteBadge.set(null),document.getSelection()?.removeAllRanges(),this.setReplyQuote(t.text))}replyToMessage(t){let e=ii(t);e&&(this.quoteBadge.set(null),this.setReplyQuote(e))}setReplyQuote(t){this.replyQuote.set(t),this.composerRef?.nativeElement?.focus?.()}clearReplyQuote(){this.replyQuote.set(null)}forecastContext=f(null);lastForecastRequest=null;forecastChartMsgId=null;forecastTurnMsgId=null;routeForecastIntent(t){let e=this.forecastContext();if(!e)return!1;let n=I().features.forecast?At(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=Pi(t.charts[0]?.config);if(!a.length)return!1;let p={metric:n.metric??o.metrics[0]?.id??"headcount",horizon:n.horizon??o.defaults.horizon,granularity:n.granularity??o.defaults.granularity,confidence:o.defaults.confidence,series:a,sourceGranularity:o.defaults.granularity},x=t.charts[0]?.config??{};return this.runForecast(e,p,{queryMeta:x.queryMeta,dataSourceId:x.dataSourceId},{chartMsgId:t.id}),!0}forecastableMsgs=new Map;canForecastChart(t){if(!this.forecastContext())return!1;let e=this.forecastableMsgs.get(t.id);if(e!==void 0)return e;let n=Ft(t);return t.isStreaming||this.forecastableMsgs.set(t.id,n),n}artifactForecastMsg=D(()=>{let t=this.artifactSourceMsgId();if(!t||!this.forecastContext())return null;let e=this.messages().find(n=>n.id===t);return e&&Ft(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)&&ot(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=Dt(o,e.series??[]);this.lastForecastRequest=T(w({},e),{horizon:a.horizon,granularity:a.granularity,confidence:a.confidence}),this.appliedForecastSettings.set({horizon:a.horizon,granularity:a.granularity,confidence:a.confidence}),this.forecastMaxHorizon.set(a.maxHorizon),this.forecastFitted.set({periods:o.fittedPeriods,granularity:o.sourceGranularity}),this.forecastGuardrails.set(o.guardrails),this.forecastModelCard.set(o.modelCard),n.queryMeta&&(a.chart.queryMeta=n.queryMeta),n.dataSourceId&&(a.chart.dataSourceId=n.dataSourceId),a.chart.config&&(a.chart.config.forecast={enabled:!0,horizon:a.horizon,granularity:a.granularity,confidence:a.confidence}),this.updateAssistantMsg(t,{forecastRecomputing:!1,charts:[{title:a.chart.title,componentName:a.chart.componentName,config:a.chart}],forecastMeta:a.meta}),this.forecastTurnMsgId&&this.forecastTurnMsgId!==t?this.updateAssistantMsg(this.forecastTurnMsgId,{text:a.answer,followUps:o.followUps}):this.updateAssistantMsg(t,{text:a.answer,followUps:o.followUps})}catch(o){let a=o;a?.isRefusal&&a.message?(this.updateAssistantMsg(t,{forecastRecomputing:!1}),this.updateAssistantMsg(this.forecastTurnMsgId??t,{text:a.message})):(console.error("[ask-aquera] forecast recompute failed",o),this.updateAssistantMsg(t,{forecastRecomputing:!1}))}finally{this.isStreaming.set(!1)}}async runForecast(t,e,n={},o={}){if(this.isStreaming())return;let a=S=>!!S&&this.messages().some(P=>P.id===S);if(o.inPlace&&a(this.forecastChartMsgId)){let S=this.messages().find(P=>P.id===this.forecastChartMsgId)?.charts[0]?.config??{};return this.recomputeForecastInPlace(this.forecastChartMsgId,e,{queryMeta:n.queryMeta??S.queryMeta,dataSourceId:n.dataSourceId??S.dataSourceId})}let p=a(o.chartMsgId??null)?o.chartMsgId:null;this.inputText.set("");let x={id:Ce(),role:"user",text:t,charts:[],isStreaming:!1,hasError:!1},v=Ce(),A={id:"forecast",callIds:["forecast"],pending:1,baseLabel:"Forecasting",label:"Forecasting",status:"running"};this.messages.update(S=>[...S,x,{id:v,role:"assistant",text:"",thinking:"Forecasting",charts:[],isStreaming:!0,hasError:!1,animate:!0,forecast:!0,tools:[A]}]),this.isStreaming.set(!0),this.scrollToBottom();try{let S=await this.forecastApi.compute(w(w({},e),this.activeConversationId()?{conversationId:this.activeConversationId(),prompt:t}:{})),P=Dt(S,e.series??[]);this.lastForecastRequest=w(w(T(w({},e),{horizon:P.horizon,granularity:P.granularity,confidence:P.confidence}),S.historyQuery?.sql?{historySql:S.historyQuery.sql}:{}),S.cohortQuery?.sql?{cohortSql:S.cohortQuery.sql}:{}),this.appliedForecastSettings.set({horizon:P.horizon,granularity:P.granularity,confidence:P.confidence}),this.forecastMaxHorizon.set(P.maxHorizon),this.forecastFitted.set({periods:S.fittedPeriods,granularity:S.sourceGranularity}),this.forecastGuardrails.set(S.guardrails),this.forecastModelCard.set(S.modelCard),S.conversationTitle&&this.forecastTitle.set(S.conversationTitle),n.queryMeta&&(P.chart.queryMeta=n.queryMeta),n.dataSourceId&&(P.chart.dataSourceId=n.dataSourceId),P.chart.config&&(P.chart.config.forecast={enabled:!0,horizon:P.horizon,granularity:P.granularity,confidence:P.confidence});let N={title:P.chart.title,componentName:P.chart.componentName,config:P.chart},X=p??v;if(this.forecastChartMsgId=X,this.forecastTurnMsgId=v,p){let U=this.messages().find(Q=>Q.id===p);this.updateAssistantMsg(p,w({charts:[N],forecastMeta:P.meta,forecast:!0},U?.preForecastCharts?.length?{}:{preForecastCharts:U?.charts??[]})),this.updateAssistantMsg(v,{isStreaming:!1,thinking:void 0,tools:[],text:P.answer,followUps:S.followUps})}else this.updateAssistantMsg(v,{isStreaming:!1,thinking:void 0,tools:[],text:P.answer,charts:[N],forecastMeta:P.meta,followUps:S.followUps});this.isStreaming.set(!1),this.scrollToBottom()}catch(S){let P=S;P?.isRefusal&&P.message?this.updateAssistantMsg(v,{isStreaming:!1,thinking:void 0,tools:[],text:P.message}):(console.error("[ask-aquera] forecast failed",S),this.updateAssistantMsg(v,{isStreaming:!1,thinking:void 0,tools:[],hasError:!0})),this.isStreaming.set(!1)}}refineForecast(t,e){let n=this.lastForecastRequest;if(!n)return;let o=T(w(w({},n),t),{filters:w(w({},n.filters),t.filters)});(t.metric!==void 0&&t.metric!==n.metric||t.granularity!==void 0&&t.granularity!==n.granularity||t.filters!==void 0&&JSON.stringify(o.filters??{})!==JSON.stringify(n.filters??{}))&&(o.historySql=void 0),t.filters!==void 0&&JSON.stringify(o.filters??{})!==JSON.stringify(n.filters??{})&&(o.cohortSql=void 0),this.runForecast(e,o,{},{inPlace:!0})}onFollowUp(t,e){if(!t.action||this.isStreaming())return;if(t.action===Ec){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===Oc){this.openForecastSettings();return}}forecastSettingsOpen=f(!1);forecastDraft=f(null);appliedForecastSettings=f(null);forecastMaxHorizon=f(null);forecastGuardrails=f(null);forecastModelCard=f(null);forecastFitted=f(null);granularityChoices=D(()=>{let t=this.forecastCopy(),e=this.forecastContext();if(!e)return[];let n=this.forecastFitted(),o=n?.granularity??e.defaults.granularity,a=n?.periods??0;return qi(o,a,e.granularityOptions)});draftGranularity=D(()=>{let t=this.forecastDraft()?.granularity,e=this.granularityChoices();return e.find(n=>n.value===t)??e.find(n=>n.enabled)??null});horizonUnit=D(()=>{let t=this.draftGranularity(),e=this.forecastDraft()?.horizon??1;return t?e===1?t.label.singular:t.label.plural:"periods"});horizonMax=D(()=>this.draftGranularity()?.maxHorizon||1);unavailableGranularityNote=D(()=>{let t=this.granularityChoices().filter(n=>!n.enabled&&n.reason);return t.length?`Unavailable: ${t.map(n=>`${n.value} (${n.reason})`).join("; ")}.`:""});horizonNote=D(()=>{let t=this.draftGranularity();if(!t)return"";let e=t.maxHorizon===1?t.label.singular:t.label.plural;return`Capped at ${t.maxHorizon} ${e} for this series (\xBD of ${t.fittedPeriods} ${t.label.plural} of history).`});forecastCopy=D(()=>{let t=this.forecastContext();if(!t)return null;let e=this.forecastFitted(),n={maxHorizon:this.forecastMaxHorizon()??"",sourceGranularity:(e?.granularity??t.defaults.granularity).toLowerCase(),historyPeriods:e?.periods??""};return{granularityNote:Fe(t.copy?.granularityNote??"",n),confidenceNote:Fe(t.copy?.confidenceNote??"",n),guardrails:this.forecastGuardrails(),modelCard:this.forecastModelCard(),confidenceLevels:t.confidenceLevels,granularityOptions:t.granularityOptions,maxHorizon:this.forecastMaxHorizon()??0}});openForecastSettings(){let t=this.appliedForecastSettings(),e=this.forecastContext(),n=t??(e?{horizon:e.defaults.horizon,granularity:e.defaults.granularity,confidence:e.defaults.confidence}:null);n&&(this.forecastDraft.set(n),this.forecastSettingsOpen.set(!0))}closeForecastSettings(){this.forecastSettingsOpen.set(!1),this.forecastDraft.set(null)}patchForecastDraft(t){this.forecastDraft.update(e=>e&&w(w({},e),t))}onHorizonInput(t){let e=Number(t);Number.isFinite(e)&&this.patchForecastDraft({horizon:Math.max(1,Math.min(e,this.horizonMax()))})}onGranularityPick(t){let e=this.forecastDraft();!e||!t.enabled||e.granularity===t.value||this.patchForecastDraft({granularity:t.value,horizon:Di(e.horizon,e.granularity,t.value,t.maxHorizon)})}onConfidenceIndexInput(t){let e=this.forecastCopy()?.confidenceLevels??[],n=Number(t);!e.length||!Number.isFinite(n)||this.patchForecastDraft({confidence:e[Math.max(0,Math.min(n,e.length-1))]})}confidenceIndex=D(()=>{let t=this.forecastCopy()?.confidenceLevels??[],e=this.forecastDraft()?.confidence,n=t.indexOf(e??-1);return n>=0?n:0});horizonFill=D(()=>{let t=this.forecastCopy()?.maxHorizon??1,e=this.forecastDraft()?.horizon??1;return`${t>1?(e-1)/(t-1)*100:100}%`});confidenceFill=D(()=>{let t=this.forecastCopy()?.confidenceLevels.length??1;return`${t>1?this.confidenceIndex()/(t-1)*100:100}%`});applyForecastSettings(){let t=this.forecastDraft();if(!t||(this.appliedForecastSettings.set(t),this.forecastSettingsOpen.set(!1),this.forecastDraft.set(null),!this.lastForecastRequest))return;let e=t.granularity!==this.lastForecastRequest.granularity;this.refineForecast(w({horizon:t.horizon,granularity:t.granularity,confidence:t.confidence},e?{series:void 0}:{}),`Recompute at ${t.horizon} ${t.granularity.toLowerCase()} periods, ${t.confidence}% confidence`)}pendingDisplayOverride=null;async sendMessage(){if(!this.canSend())return;let t=this.replyQuote()??void 0;this.replyQuote.set(null);let e=this.inputText().trim();if(!this.attachments().length&&!t&&this.routeForecastIntent(e))return;this.inputText.set("");let n=oi(t,e),a=this.attachments().filter(L=>L.status==="ready").map(L=>({key:L.key,name:L.name,contentType:L.contentType,size:L.size}));this.attachments.set([]);let p={id:Ce(),role:"user",text:this.pendingDisplayOverride??Wi(e),answerSummary:!!this.pendingDisplayOverride,quotedText:t,charts:[],attachments:a,isStreaming:!1,hasError:!1};this.pendingDisplayOverride=null,this.messages.update(L=>[...L,p]);let x=Ce();this.messages.update(L=>[...L,{id:x,role:"assistant",text:"",thinking:"Thinking",charts:[],isStreaming:!0,hasError:!1,animate:!0,tools:[{id:"thinking",callIds:["thinking"],pending:1,baseLabel:"Thinking",label:"Thinking",status:"running"}]}]),this.isStreaming.set(!0);let v=new AbortController;this.streamAbort=v,this.scrollToBottom();let A="",S="Thinking",P=[],N=!1,X=!1,U=!1,Q=new Set,K=L=>{let Z=L?.queryMeta,R=Z?.sql??(Z?.dsl?JSON.stringify(Z.dsl):L?.title??"");return`${L?.componentName??""}|${R}`},ne=()=>{if(N||P.length===0)return;N=!0;let L=P.splice(0);this.updateAssistantMsg(x,Z=>({charts:[...Z.charts,...L]})),this.scrollToBottom()};try{let L=this.selectedScope(),Z=L?L.id:null,R=L?.kind==="pipeline";await this.svc.streamChat(this.activeConversationId(),n,{onText:V=>{A+=V,!N&&P.length>=1&&this.zone.run(()=>ne())},onToolStart:(V,$)=>{A="",S=$||"Working",this.zone.run(()=>{this.updateAssistantMsg(x,H=>({thinking:S,tools:hi(H.tools??[],V,S)}))})},onToolResult:(V,$,H)=>{this.zone.run(()=>{this.updateAssistantMsg(x,j=>({tools:Ci(j.tools??[],V,$,H)}))})},onDataPart:async V=>{if(V.data_type==="adhoc_viz"&&V.data){await Bn(V.data.config);let $={title:V.data.title??"Chart",componentName:V.data.componentName??"",config:V.data},H=V.data?.id,j=B=>H&&B.config?.id===H;this.zone.run(()=>{if(N){this.updateAssistantMsg(x,ce=>{let Ie=H?ce.charts.findIndex(j):-1;return{charts:Ie===-1?[...ce.charts,$]:ce.charts.map((Bi,Ui)=>Ui===Ie?$:Bi)}}),this.scrollToBottom();return}let B=H?P.findIndex(j):-1;B===-1?P.push($):P[B]=$,P.length>=2&&ne()})}},onDashboardTitle:V=>{V&&this.zone.run(()=>this.updateAssistantMsg(x,{dashboardTitle:V}))},onChoice:V=>{V?.options?.length&&this.zone.run(()=>this.updateAssistantMsg(x,$=>({choices:[...$.choices??[],V]})))},onLayoutPatch:V=>{let $=new Map((V?.layouts??[]).map(j=>[j.id,j.layout]));if(!$.size)return;let H=j=>{let B=j?.id;return B?$.get(B):void 0};for(let j of P){let B=H(j.config);B&&(j.config=T(w({},j.config),{layout:B}))}this.zone.run(()=>this.updateAssistantMsg(x,j=>({charts:j.charts.map(B=>{let ce=H(B.config);return ce?T(w({},B),{config:T(w({},B.config),{layout:ce})}):B})})))},onError:()=>{X=!0},onFinish:(V,$)=>{U=!0,this.zone.run(()=>{ne(),this.updateAssistantMsg(x,{isStreaming:!1,thinking:void 0,text:A}),this.isStreaming.set(!1);let H=this.messages().find(B=>B.id===x);Pt({finishReason:V,sawError:X,producedContent:!!(H?.text||H?.charts.length||H?.choices?.length)})&&this.showStreamError(x),$&&!this.activeConversationId()&&(this.activeConversationId.set($),this.conversationCustomerId.set(this.customerId()),this.conversationsLoading.set(!0),this.svc.listConversations().then(B=>{this.conversations.set(B);let ce=B.find(Ie=>Ie.id===$);this.conversationConnectionId.set(ce?.connectionId??null)}).finally(()=>this.conversationsLoading.set(!1))),this.loadConversationDashboards(),this.messages().find(B=>B.id===x)?.charts.length||this.scrollToBottom()})}},Z,v.signal,a,R,this.builderDashboardId())}catch(L){v.signal.aborted||L instanceof DOMException&&L.name==="AbortError"||this.zone.run(()=>this.showStreamError(x))}finally{this.zone.run(()=>{!U&&Pt({sawError:X,producedContent:!1})&&this.showStreamError(x),this.updateAssistantMsg(x,{isStreaming:!1,thinking:void 0}),this.streamAbort===v&&(this.isStreaming.set(!1),this.streamAbort=null)})}}showStreamError(t){this.messages.update(e=>xi(e,t,n=>({id:n,role:"assistant",text:"",charts:[],isStreaming:!1,hasError:!1}))),this.isStreaming.set(!1)}stopStream(){this.messages.update(t=>t.map(e=>e.isStreaming?T(w({},e),{isStreaming:!1,thinking:void 0,tools:[]}):e)),this.streamAbort?.abort(),this.isStreaming.set(!1)}openArtifact(t,e){this.artifactSourceMsgId.set(e??null),this.activeArtifactRaw.set(e?[]:t),this.bucketExtraCharts.set([]),this.forecastOverlay.set(new Map),this.loadArtifactForecastable(),this.prefetchWidgetTemplateCatalog();let n=this.mostRecentDashboardTitle(),o=t.find(a=>!this.isFilterChart(a));this.saveDashboardName.set(n||o?.title||t[0]?.title||"My Dashboard"),this.resetArtifactFilterState()}addInlineWidget(t){this.inlinePickerFor.set(null),this.addArtifactToDashboard(t)}addInlineToExisting(t,e){this.inlinePickerFor.set(null),this.addToExistingDashboard(e,t)}addInlineDefault(t){let e=this.conversationDashboards();if(!this.builderOpen()&&e.length===1){this.addInlineToExisting(t,e[0].id);return}this.addInlineWidget(t)}async addToLibrary(t){try{await this.globalWidget.add(this.artifactToWidget(t)),this.showToast("success","Saved to your widget library.")}catch{}}onSelectionChange(t){this.selectedWidgetIds.set(t)}pickGalleryPrompt(t){this.inputText.set(t),this.closeGallery()}onWelcomePromptPick(t){this.isStreaming()||(this.inputText.set(t.label),this.sendMessage())}onGalleryPromptPick(t){t?.key&&this.pickGalleryPrompt(t.key)}openGallery(){this.gallerySearch.set(""),this.galleryOpen.set(!0)}closeGallery(){this.galleryOpen.set(!1),this.gallerySearch.set("")}xrayOpen=f(!1);xraySources=f([]);xraySourcesLoading=f(!1);xraySelectedConnectionId=f(null);xraySelectedDatasetId=f(null);xrayEntities=f([]);xrayEntitiesLoading=f(!1);xrayEntitySearch=f("");xrayTopic=f("");xrayRunning=f(!1);xrayStatus=f("idle");xrayError=f(null);xrayConversationId=f(null);xrayDatasetMenuOpen=f(!1);xrayRunningEntity=f(null);xraySkeletonRows=[180,140,200,120,165,150];xraySelectedDatasetLabel=D(()=>{let t=this.xraySelectedDatasetId();return this.xrayDatasets().find(e=>e.datasetId===t)?.label??this.copy().xrayDatasetLabel});xrayEntityNoun=D(()=>{let t=this.xrayFilteredEntities(),e=t.some(o=>o.kind==="table");return t.some(o=>o.kind==="index")&&!e?this.copy().xrayIndexesNoun:this.copy().xrayTablesNoun});xrayEntityLabel(t){return t.schema?`${t.schema}.${t.name}`:t.name}xrayRunningEntityLabel=D(()=>{let t=this.xrayRunningEntity();return t?this.xrayEntityLabel(t):""});xrayDatasets=D(()=>{let t=this.xraySources(),e=new Map;for(let n of t)for(let o of n.datasets)e.set(o.name,(e.get(o.name)??0)+1);return t.flatMap(n=>n.datasets.map(o=>({datasetId:o.id,label:(e.get(o.name)??0)>1?`${o.name} \u2014 ${n.name}`:o.name,connectionId:n.id,isDefault:n.isDefault})))});xrayFilteredEntities=D(()=>{let t=this.xrayEntitySearch().trim().toLowerCase(),e=this.xrayEntities();return t?e.filter(n=>n.name.toLowerCase().includes(t)||(n.schema??"").toLowerCase().includes(t)):e});async openXray(){if(this.xrayOpen.set(!0),this.xrayError.set(null),this.xrayStatus.set("idle"),!this.xraySources().length){this.xraySourcesLoading.set(!0);try{let t=await this.svc.listXraySources();this.xraySources.set(t);let e=this.xrayDatasets(),n=e.find(o=>o.isDefault)??e[0]??null;n&&await this.selectXrayDataset(n.datasetId)}catch(t){this.xrayError.set(t instanceof Error?t.message:String(t))}finally{this.xraySourcesLoading.set(!1)}}}closeXray(){this.xrayOpen.set(!1),this.xrayEntitySearch.set(""),this.xrayError.set(null)}async selectXrayDataset(t){let e=this.xrayDatasets().find(n=>n.datasetId===t)??null;this.xraySelectedDatasetId.set(e?e.datasetId:null),this.xraySelectedConnectionId.set(e?e.connectionId:null),await this.loadXrayEntities()}async loadXrayEntities(){let t=this.xraySelectedConnectionId();if(t){this.xrayEntitiesLoading.set(!0),this.xrayEntities.set([]),this.xrayError.set(null);try{let e=await this.svc.listXrayEntities(t,this.xraySelectedDatasetId()??void 0);this.xrayEntities.set(e.entities??[])}catch(e){this.xrayError.set(e instanceof Error?e.message:String(e))}finally{this.xrayEntitiesLoading.set(!1)}}}onXrayDatasetPick(t){this.xrayDatasetMenuOpen.set(!1),this.selectXrayDataset(t)}xrayThinkingMsgId=null;xrayThinkingSeed(t){let e=Ce();this.xrayThinkingMsgId=e,this.messages.update(n=>[...n,{id:e,role:"assistant",text:"",thinking:t,charts:[],isStreaming:!0,hasError:!1,animate:!0,tools:[{id:"xray",callIds:["xray"],pending:1,baseLabel:t,label:t,status:"running"}]}]),this.isStreaming.set(!0)}xrayThinkingUpdate(t){let e=this.xrayThinkingMsgId;e&&this.updateAssistantMsg(e,{thinking:t,tools:[{id:"xray",callIds:["xray"],pending:1,baseLabel:t,label:t,status:"running"}]})}xrayThinkingClear(){let t=this.xrayThinkingMsgId;this.xrayThinkingMsgId=null,this.isStreaming.set(!1),t&&this.messages.update(e=>e.filter(n=>n.id!==t))}async runXray(t){let e=this.xraySelectedConnectionId();if(!e||this.xrayRunning())return;this.xrayRunning.set(!0),this.xrayRunningEntity.set(t),this.xrayStatus.set("analyzing"),this.xrayError.set(null),this.xrayConversationId.set(null),this.closeXray();let n=[],o=null;try{await this.svc.xrayPreviewStream(e,{entity:{kind:t.kind,schema:t.schema,name:t.name},datasetId:this.xraySelectedDatasetId()??void 0,topic:this.xrayTopic().trim()||void 0},{onProfile:()=>{this.xrayStatus.set("building"),this.xrayThinkingUpdate(this.copy().xrayBuilding)},onWidget:a=>{n.push({title:a.title,componentName:a.componentName,config:a}),this.openArtifact([...n]),this.xrayThinkingUpdate(n.length===1?this.copy().xrayBuiltOne:this.copy().xrayBuiltMany.replace("{n}",String(n.length)))},onConversation:a=>{this.xrayConversationId.set(a),this.selectConversation(a).then(()=>{this.xrayRunning()&&this.xrayThinkingSeed(this.copy().xrayBuilding)})},onEmpty:a=>{o=a},onError:a=>{o=a},onDone:(a,p,x)=>{x&&this.xrayConversationId.set(x)}})}catch(a){o=a instanceof Error?a.message:String(a)}finally{this.xrayRunning.set(!1),this.xrayRunningEntity.set(null)}if(n.length){this.xrayStatus.set("idle"),this.saveDashboardName.set(this.xrayDashboardName(t));let a=this.xrayConversationId();a&&await this.selectConversation(a,!0),this.xrayThinkingClear()}else this.xrayThinkingClear(),this.xrayStatus.set("failed"),this.xrayError.set(o??this.copy().xrayFailed),this.xrayOpen.set(!0)}xrayDashboardName(t){return`A look at ${t.schema?`${t.schema}.${t.name}`:t.name}`}templateCatalogPrefetch=null;prefetchTemplateCatalog(){return this.templateCatalogPrefetch?this.templateCatalogPrefetch:(this.templateCatalogPrefetch=(async()=>{if(!this.templateCategories().length){this.templateCategoriesLoading.set(!0);try{this.templateCategories.set(await this.svc.listDashboardCategories())}catch{}finally{this.templateCategoriesLoading.set(!1)}}if(!this.templateAllTemplates().length){this.templateTemplatesLoading.set(!0);try{this.templateAllTemplates.set(await this.svc.listAllCategoryTemplates())}catch{}finally{this.templateTemplatesLoading.set(!1)}}})(),this.templateCatalogPrefetch)}selectTemplateCategory(t){this.templateActiveCategory.set(t)}widgetTemplateCatalogPrefetch=null;prefetchWidgetTemplateCatalog(){return this.widgetTemplateCatalogPrefetch?this.widgetTemplateCatalogPrefetch:(this.widgetTemplateCatalogPrefetch=(async()=>{if(!this.templateCategories().length){this.templateCategoriesLoading.set(!0);try{this.templateCategories.set(await this.svc.listDashboardCategories())}catch{}finally{this.templateCategoriesLoading.set(!1)}}if(!this.widgetTemplateAllTemplates().length){this.widgetTemplateTemplatesLoading.set(!0);try{let t=await this.svc.loadAllWidgetTemplatePreviews();this.widgetTemplateAllTemplates.set(t.map(n=>n.template));let e=new Map;for(let n of t)e.set(n.template.id,n.widget?{title:n.widget.title,componentName:n.widget.componentName,config:n.widget}:null);this.widgetTemplatePreviews.set(e)}catch{}finally{this.widgetTemplateTemplatesLoading.set(!1)}}})(),this.widgetTemplateCatalogPrefetch)}selectWidgetTemplate(t){let e=this.widgetTemplatePreviews().get(t);if(e){this.addKpiToBucket(e,t);return}this.pickWidgetTemplate(t)}addKpiToBucket(t,e){this.activeArtifact().some(o=>o.config?._meta?.templateId===e)||(this.pushCanvasHistory(),this.bucketExtraCharts.update(o=>[...o,t]),this.ensureArtifactPaneOpen(),this.closeWidgetDetailPanel())}artifactHasFilter=D(()=>this.activeArtifact().some(t=>this.isFilterChart(t)));onFiltersToggle(t){t?this.addFilterToBucket():this.removeFilterFromArtifact()}addFilterToBucket(){this.artifactHasFilter()||(this.pushCanvasHistory(),this.bucketExtraCharts.update(t=>[...t,this.buildEmptyFilterChart()]),this.ensureArtifactPaneOpen())}removeFilterFromArtifact(){let t=this.activeArtifact().find(n=>this.isFilterChart(n));if(!t)return;if(this.pushCanvasHistory(),this.bucketExtraCharts().includes(t)){this.bucketExtraCharts.update(n=>n.filter(o=>o!==t));return}let e=this.artifactSourceMsgId();e?this.updateAssistantMsg(e,n=>({charts:n.charts.filter(o=>o!==t)})):this.activeArtifactRaw.update(n=>n.filter(o=>o!==t))}buildEmptyFilterChart(){let t=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,p=n?.detailPanel??null;if(!(!o&&!p)){if(p&&!p.widgets?.length){e&&o&&this.selectWidgetTemplate(o);return}this.ensureArtifactPaneOpen(),this.widgetDetailPanelTemplateId.set(o),this.detailPanelCohortId.set(a),this.widgetDetailPanelCanAdd.set(e),this.widgetDetailPanelSourceWidgetTitle.set(t.title??null),this.widgetDetailPanelTitle.set(p?.title??null),this.widgetDetailPanelSkeletonSlots.set(Dc((p?.widgets??[]).map(x=>x.layout).filter(x=>!!x))),this.widgetDetailPanelLoading.set(!0),this.widgetDetailPanelOpen.set(!0),this.runViewTransition(()=>{});try{let x=a?await this.resolveCohortDetailPanel(a):p?await this.svc.previewWidgetDetailPanelDefinition(p):await this.svc.previewWidgetTemplateDetailPanel(o);if(!x.widgets.length){this.widgetDetailPanelOpen.set(!1);return}this.widgetDetailPanelTitle.set(x.title),this.widgetDetailPanelRaw.set(x.widgets.map(v=>({title:v.title,componentName:v.componentName,config:v})))}catch{this.widgetDetailPanelOpen.set(!1)}finally{this.widgetDetailPanelLoading.set(!1)}}}async resolveCohortDetailPanel(t){try{let[e,n]=await Promise.all([this.cohort.previewCriterion(t),this.cohort.getDetail(t)]);return this.detailPanelCohortData.set({preview:e,detail:n}),et(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
package/main.js CHANGED
@@ -1 +1 @@
1
- import{a as i,b as n}from"./chunk-HHHSUVAV.js";import{a as D,b as t}from"./chunk-GF542NOC.js";import{a as d,b as f,c as p}from"./chunk-5TCUNERG.js";import{x as s}from"./chunk-FKHJV7T4.js";import"./chunk-ZRJYRUTX.js";import"./chunk-T4WJW6GR.js";import"./chunk-JP5QY5S6.js";import"./chunk-XUJBDACP.js";import"./chunk-6SX2WEWK.js";import"./chunk-FK6H3RFT.js";import"./chunk-SYVY7IJY.js";import"./chunk-DPY4ZJSO.js";import"./chunk-T3NXAI3H.js";import"./chunk-JWVGGQEQ.js";import"./chunk-R3C2A3GE.js";import"./chunk-RRYXNANE.js";import"./chunk-SVXYWKUB.js";import"./chunk-QXVITQOV.js";import"./chunk-I4TM4AGJ.js";import"./chunk-F6YL5NFN.js";import"./chunk-ATUZQYGW.js";import"./chunk-XCT4UKLK.js";import"./chunk-4XZ7RFFX.js";import"./chunk-YHTLTPEH.js";import"./chunk-LFSX3TZJ.js";import"./chunk-BTDKTIE6.js";import"./chunk-5CTM6JVQ.js";import"./chunk-W2HKCDVZ.js";import"./chunk-MPGDQZRI.js";import"./chunk-HOS2FAXH.js";import"./chunk-INJSG5RK.js";import"./chunk-RCWO45CI.js";import"./chunk-ZW5NV4UO.js";var A="0.0.50",a=A;function g(){typeof window>"u"||(window.dataViz={packageName:"@aquera/data-visualizer-sdk",version:a,getVersion:()=>a})}g();async function z(){let[{defineDvzAsk:e},{defineDvzDashboards:o},{defineDvzManageDashboards:r}]=await Promise.all([import("./chunk-QVKK5WN7.js"),import("./chunk-QGJ2ZM35.js"),import("./chunk-GEBMFK34.js")]);await Promise.all([e(),o(),r()])}export{a as DATA_VISUALIZER_SDK_VERSION,i as DVZ_ASK_TAG,D as DVZ_DASHBOARDS_TAG,d as DVZ_MANAGE_DASHBOARDS_DEFAULT_PAGE_SIZE,f as DVZ_MANAGE_DASHBOARDS_TAG,z as defineDvzAll,n as defineDvzAsk,t as defineDvzDashboards,p as defineDvzManageDashboards,s as setDvzEnv};
1
+ import{a as i,b as n}from"./chunk-WAZHPSQ5.js";import{a as D,b as t}from"./chunk-GF542NOC.js";import{a as d,b as f,c as p}from"./chunk-5TCUNERG.js";import{x as s}from"./chunk-FKHJV7T4.js";import"./chunk-ZRJYRUTX.js";import"./chunk-T4WJW6GR.js";import"./chunk-JP5QY5S6.js";import"./chunk-XUJBDACP.js";import"./chunk-6SX2WEWK.js";import"./chunk-FK6H3RFT.js";import"./chunk-SYVY7IJY.js";import"./chunk-DPY4ZJSO.js";import"./chunk-T3NXAI3H.js";import"./chunk-JWVGGQEQ.js";import"./chunk-R3C2A3GE.js";import"./chunk-RRYXNANE.js";import"./chunk-SVXYWKUB.js";import"./chunk-QXVITQOV.js";import"./chunk-I4TM4AGJ.js";import"./chunk-F6YL5NFN.js";import"./chunk-ATUZQYGW.js";import"./chunk-XCT4UKLK.js";import"./chunk-4XZ7RFFX.js";import"./chunk-YHTLTPEH.js";import"./chunk-LFSX3TZJ.js";import"./chunk-BTDKTIE6.js";import"./chunk-5CTM6JVQ.js";import"./chunk-W2HKCDVZ.js";import"./chunk-MPGDQZRI.js";import"./chunk-HOS2FAXH.js";import"./chunk-INJSG5RK.js";import"./chunk-RCWO45CI.js";import"./chunk-ZW5NV4UO.js";var A="0.0.51",a=A;function g(){typeof window>"u"||(window.dataViz={packageName:"@aquera/data-visualizer-sdk",version:a,getVersion:()=>a})}g();async function z(){let[{defineDvzAsk:e},{defineDvzDashboards:o},{defineDvzManageDashboards:r}]=await Promise.all([import("./chunk-RQNESQGI.js"),import("./chunk-QGJ2ZM35.js"),import("./chunk-GEBMFK34.js")]);await Promise.all([e(),o(),r()])}export{a as DATA_VISUALIZER_SDK_VERSION,i as DVZ_ASK_TAG,D as DVZ_DASHBOARDS_TAG,d as DVZ_MANAGE_DASHBOARDS_DEFAULT_PAGE_SIZE,f as DVZ_MANAGE_DASHBOARDS_TAG,z as defineDvzAll,n as defineDvzAsk,t as defineDvzDashboards,p as defineDvzManageDashboards,s as setDvzEnv};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aquera/data-visualizer-sdk",
3
- "version": "0.0.50",
3
+ "version": "0.0.51",
4
4
  "description": "Every Aquera data-visualizer element — <dvz-ask>, <dvz-dashboards> and <dvz-manage-dashboards> — in one bundle that loads their shared Nile and Highcharts dependencies once. Use this when a page mounts more than one; use the individual @aquera/dvz-* packages when it mounts only one.",
5
5
  "type": "module",
6
6
  "sideEffects": [