@dbt-tools/web 0.3.2 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +184 -19
- package/dist/assets/analysis.worker-uCmLG0eu.js +1 -0
- package/dist/assets/{index-D8XVXIat.css → index-BKeq9m6P.css} +1 -1
- package/dist/assets/index-zSNSA1E5.js +2 -0
- package/dist/index.html +4 -4
- package/package.json +3 -3
- package/dist/assets/analysis.worker-Ca2gZuDr.js +0 -1
- package/dist/assets/index-Djbo833V.js +0 -2
- /package/dist/assets/{recharts-vendor-d9PRyZM1.js → recharts-vendor-Ds9sjKZG.js} +0 -0
- /package/dist/assets/{tanstack-virtual-vendor-DWJdLbXi.js → tanstack-virtual-vendor-DdCr1qam.js} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{i as t,n,r,t as i}from"./react-vendor-DL38pS2M.js";import{t as a}from"./tanstack-virtual-vendor-DdCr1qam.js";import{a as o,i as s,n as c,r as l,t as u}from"./recharts-vendor-Ds9sjKZG.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var d=e(t(),1),f=n(),p={accent:`#635BFF`,text:`#171C28`,textSoft:`#6B7385`,bg:`#F6F7FB`,bgSoft:`#FFFFFF`,borderDefault:`#D7DCE7`,borderSubtle:`#E6E9F0`,slate:`#64748B`,rose:`#C0352B`,mint:`#0F8A4B`,amber:`#A56315`},m={accent:`#8A7CFF`,text:`#F3F6FC`,textSoft:`#98A3BC`,bg:`#0D1120`,bgSoft:`#151A2E`,borderDefault:`#313A58`,borderSubtle:`#262E47`,slate:`#8690AA`,rose:`#FF8D86`,mint:`#59D38C`,amber:`#F5B95C`};function h(e){return e===`dark`?m:p}var g={success:p.mint,error:p.rose,skipped:p.slate,"run error":p.rose,pass:p.mint,fail:p.rose,warn:p.amber,"no op":p.slate},_={success:m.mint,error:m.rose,skipped:m.slate,"run error":m.rose,pass:m.mint,fail:m.rose,warn:m.amber,"no op":m.slate},v=`#059669`,y=`#45c49a`,b=`rgba(100, 116, 139, 0.2)`,x=`rgba(134, 144, 170, 0.28)`,S=`rgba(5, 150, 105, 0.2)`,C=`rgba(69, 196, 154, 0.26)`,w={model:`#1D4ED8`,test:`#64748B`,seed:`#635BFF`,snapshot:`#D97706`,source:v,source_freshness:v,exposure:`#EA580C`,metric:`#DB2777`,semantic_model:`#0891B2`,analysis:`#64748B`,unit_test:`#64748B`},T={model:`#5c8deb`,test:`#8690aa`,seed:`#9588e8`,snapshot:`#d4a24a`,source:y,source_freshness:y,exposure:`#d9845c`,metric:`#d172ae`,semantic_model:`#3eb0c8`,analysis:`#8690aa`,unit_test:`#8690aa`},E={model:`rgba(29, 78, 216, 0.2)`,test:b,seed:`rgba(99, 91, 255, 0.2)`,snapshot:`rgba(217, 119, 6, 0.2)`,source:S,source_freshness:S,semantic_model:`rgba(8, 145, 178, 0.2)`,metric:`rgba(219, 39, 119, 0.2)`,exposure:`rgba(234, 88, 12, 0.2)`,analysis:b,unit_test:b},D={model:`rgba(92, 141, 235, 0.28)`,test:x,seed:`rgba(149, 136, 232, 0.28)`,snapshot:`rgba(212, 162, 74, 0.28)`,source:C,source_freshness:C,semantic_model:`rgba(62, 176, 200, 0.28)`,metric:`rgba(209, 114, 174, 0.28)`,exposure:`rgba(217, 132, 92, 0.28)`,analysis:x,unit_test:x};function O(e){return e===`dark`?T:w}function k(e){return e===`dark`?D:E}function A(e,t){let n=k(t);return e&&n[e]?n[e]:t===`dark`?x:b}var j={rowStripe:`#F1F3F8`,rowStripeHover:`#EEF0FF`,labelText:p.text,metaText:p.textSoft,axisTick:p.slate,gridLine:`#E6E9F0`,barHoverStroke:p.accent,testFailStripe:`rgba(192, 53, 43, 0.9)`,testSkipStripe:`rgba(165, 99, 21, 0.88)`,hullStroke:`#C8CEDB`,hullFill:`rgba(230, 233, 240, 0.35)`},M={rowStripe:`#101527`,rowStripeHover:`#232845`,labelText:m.text,metaText:m.textSoft,axisTick:m.slate,gridLine:`#262E47`,barHoverStroke:m.accent,testFailStripe:`rgba(255, 141, 134, 0.88)`,testSkipStripe:`rgba(245, 185, 92, 0.88)`,hullStroke:`#2E3759`,hullFill:`rgba(38, 46, 71, 0.4)`};function N(e){return e===`dark`?M:j}function P(e){let t=h(e);return{positive:t.mint,warning:t.amber,danger:t.rose,neutral:t.slate}}P(`light`);var F=`workspace-pill workspace-pill--active`,I=`workspace-pill`,L=[{key:`model`,label:`Models`},{key:`tests`,label:`Tests`},{key:`snapshot`,label:`Snapshots`},{key:`metric`,label:`Metrics`},{key:`semantic_model`,label:`Semantic models`}],ee=new Set([`model`,`seed`,`snapshot`,`source`,`source_freshness`,`test`,`unit_test`,`metric`,`semantic_model`]),R=new Set([`test`,`unit_test`]),z=new Set([`model`,`seed`,`snapshot`,`source`]),B={project:`Project`,database:`Database`};function te(e){return e.statusTone===`danger`&&!R.has(e.resourceType)&&e.resourceType!==`operation`&&e.resourceType!==`sql_operation`}function V(e){return typeof e!=`number`||Number.isNaN(e)?`n/a`:e>=60?`${Math.floor(e/60)}m ${(e%60).toFixed(2).padStart(5,`0`)}s`:e>=10?`${e.toFixed(1)}s`:`${e.toFixed(2)}s`}function H(e){return new Date(e).toLocaleString(`en-US`,{dateStyle:`medium`,timeStyle:`short`})}function ne(e){return e.runStartedAt}function re(e){return`tone-badge tone-badge--${e}`}function ie(e){return ae(e.originalFilePath??e.patchPath??e.path)}function ae(e){if(!e)return null;let t=e.includes(`://`)?e.split(`://`)[1]??null:e;if(!t)return null;let n=t.split(`/`).map(e=>e.trim()).filter(Boolean).join(`/`);return n.length>0?n:null}function oe(e,t){if(!t)return!0;let n=t.trim().toLowerCase();return n?[e.name,e.resourceType,e.packageName,e.path??``,e.originalFilePath??``,e.patchPath??``,e.uniqueId].some(e=>e.toLowerCase().includes(n)):!0}function se(e,t){return t===`all`||e.statusTone===t}function ce(e,t){return t.size===0||t.has(e.resourceType)}function le(e,t){if(!t)return!0;let n=t.trim().toLowerCase();return n?[e.name,e.resourceType,e.packageName,e.path??``,e.uniqueId,e.status,e.threadId??``].some(e=>e.toLowerCase().includes(n)):!0}function ue(e){if(e.length===0)return null;let t={};for(let n of e)n.packageName&&(t[n.packageName]=(t[n.packageName]??0)+1);return Object.entries(t).sort((e,t)=>t[1]-e[1])[0]?.[0]??null}function de(e,t){return t!=null&&e.packageName===t}function fe({name:e,packageName:t,path:n}){let r=e.toLowerCase(),i=t.toLowerCase(),a=(n??``).toLowerCase();return new Set([`dbt_artifacts_hashes`,`dbt_columns`,`dbt_exposures`,`dbt_groups`,`dbt_invocations`,`dbt_metrics`,`dbt_models`,`dbt_run_results`,`dbt_seeds`,`dbt_snapshots`,`dbt_source_freshness_results`,`dbt_sources`,`dbt_tests`,`elementary_test_results`,`job_run_results`,`locations`,`metadata`,`metricflow_time_spine`,`model_run_results`,`schema_columns_snapshot`,`seed_run_results`,`snapshot_run_results`,`test_result_rows`]).has(r)||r.startsWith(`dbt_`)||r.startsWith(`alerts_dbt_`)||a.includes(`/edr/`)||a.includes(`/dbt_artifacts/`)||a.includes(`/run_results/`)||a.includes(`/manifest/`)||a.includes(`/catalog/`)||i===`elementary`&&(r.includes(`dbt_`)||a.includes(`/edr/dbt_artifacts/`))}function pe(e){return new Set(e.filter(e=>e!==`macro`&&e!==`test`&&e!==`unit_test`))}function me(e,t){return!ee.has(e.resourceType)||R.has(e.resourceType)||fe(e)?!1:t==null?!0:e.packageName===t}function he(e){return e.status!==`all`||e.resourceTypes.size>0||e.query.trim().length>0}function ge(e,t){let n=t??{},r=e.filter(e=>R.has(e.resourceType)),i=new Map;for(let e of r){let t=n[e.uniqueId]?.upstream?.map(e=>e.uniqueId)??[];for(let n of t){let t=i.get(n)??{pass:0,fail:0,error:0};e.statusTone===`positive`?t.pass+=1:e.statusTone===`danger`?t.error+=1:t.fail+=1,i.set(n,t)}}return i}function _e(e,t,n){return{id:e,label:t,kind:`branch`,children:[],count:0,parentIds:n}}function ve(e,t,n,r=null){return{id:e,label:t.name,kind:`resource`,children:[],resource:t,originLabel:r,count:1,parentIds:n}}function ye(e){let t=e.split(`/`).map(e=>e.trim()).filter(Boolean);return{directories:t.slice(0,-1),fileName:t[t.length-1]??e}}function be(e){return ae(e.originalFilePath??e.patchPath??e.path)}function xe(e){let t=be(e);return t?ye(t).directories:[]}function Se(e){let t=be(e);return t?ye(t).fileName:null}function Ce(e){return!e.database||!e.schema?[]:[e.database,e.schema,e.packageName]}function we(e,t){let n=[`model`,`seed`,`snapshot`,`source`,`macro`,`operation`,`sql_operation`,`analysis`,`semantic_model`,`metric`,`test`,`unit_test`,`exposure`],r=n.indexOf(e.resourceType),i=n.indexOf(t.resourceType);return r===i?e.name.localeCompare(t.name):r===-1?1:i===-1?-1:r-i}function Te(e,t){let n={branch:0,resource:1};return e.kind===t.kind?e.kind===`resource`&&t.kind===`resource`&&e.resource&&t.resource?we(e.resource,t.resource):e.label.localeCompare(t.label):n[e.kind]-n[t.kind]}function Ee(e){return e.map(e=>{if(e.kind===`resource`)return e;let t=Ee(e.children).sort(Te);return{...e,children:t,count:t.reduce((e,t)=>e+t.count,0)}}).sort(Te)}function De(e,t,n,r){let i=r??{},a=e.filter(e=>!R.has(e.resourceType)),o=ge(e,i),s=e=>{let t={pass:0,fail:0,error:0};for(let n of e){let e;n.kind===`resource`?e=n.testStats??{pass:0,fail:0,error:0}:(e=s(n.children),e.pass+e.fail+e.error>0&&(n.testStats=e)),t.pass+=e.pass,t.fail+=e.fail,t.error+=e.error}return t},c=[],l=(e,t,n,r)=>{let i=e.find(e=>e.kind===`branch`&&e.id===t);if(i)return i;let a=_e(t,n,r);return e.push(a),a};if(t===`project`){let e=n??`Workspace`,r=l(c,`${t}:branch:${e}`,e,[]);for(let n of a){if(!be(n))continue;let i=xe(n),a=Se(n),s=[r.id],c=r.children;for(let n=0;n<i.length;n+=1){let r=i[n],a=`${t}:branch:${[e,...i.slice(0,n+1)].join(`/`)}`,o=l(c,a,r,[...s]);s.push(a),c=o.children}let u=ve(`${t}:resource:${n.uniqueId}`,n,s,a),d=o.get(n.uniqueId);d&&d.pass+d.fail+d.error>0&&(u.testStats=d),c.push(u)}return s(c),Ee(c).filter(e=>e.count>0)}for(let e of a){let n=Ce(e);if(n.length===0)continue;let r=[],i=c;for(let e=0;e<n.length;e+=1){let a=n[e],o=`${t}:branch:${n.slice(0,e+1).join(`/`)}`,s=l(i,o,a,[...r]);r.push(o),i=s.children}let a=ve(`${t}:resource:${e.uniqueId}`,e,r),s=o.get(e.uniqueId);s&&s.pass+s.fail+s.error>0&&(a.testStats=s),i.push(a)}return s(c),Ee(c)}function Oe(e,t,n=0){let r=[];for(let i of e)r.push({node:i,depth:n}),i.kind===`branch`&&t.has(i.id)&&r.push(...Oe(i.children,t,n+1));return r}function ke(e){let t=new Set,n=[...e];for(;n.length>0;){let e=n.pop();e.kind!==`resource`&&(t.add(e.id),n.push(...e.children))}return t}function Ae(e){let t=[],n=[...e];for(;n.length>0;){let e=n.pop();e.kind===`resource`&&e.resource?t.push(e.resource.uniqueId):n.push(...[...e.children].reverse())}return t}function je(e,t){if(!t)return null;let n=[...e];for(;n.length>0;){let e=n.pop();if(e.kind===`resource`&&e.resource?.uniqueId===t)return e;n.push(...e.children)}return null}function Me(e,t){let n=je(e,t);return new Set(n?.parentIds??[])}var U=i();function W({icon:e,headline:t,subtext:n}){return(0,U.jsxs)(`div`,{className:`empty-state-block`,children:[e!==void 0&&(0,U.jsx)(`span`,{className:`empty-state-block__icon`,"aria-hidden":`true`,children:e}),(0,U.jsx)(`strong`,{className:`empty-state-block__headline`,children:t}),n&&(0,U.jsx)(`p`,{className:`empty-state-block__subtext`,children:n})]})}function G(e){return e.split(`_`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function K({title:e,subtitle:t,headerRight:n,children:r}){return(0,U.jsxs)(`section`,{className:`workspace-card`,children:[(0,U.jsxs)(`div`,{className:`workspace-card__header`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{children:e}),t&&(0,U.jsx)(`p`,{children:t})]}),n]}),r]})}function Ne({resourceType:e}){return(0,U.jsxs)(`span`,{className:`resource-type-badge`,children:[(0,U.jsx)(Pe,{resourceType:e}),G(e)]})}function Pe({resourceType:e}){switch(e){case`model`:return(0,U.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:[(0,U.jsx)(`path`,{d:`m8 2.2 4.8 2.7L8 7.6 3.2 4.9 8 2.2Z`}),(0,U.jsx)(`path`,{d:`m3.2 5 4.8 2.6L12.8 5M3.2 8l4.8 2.7 4.8-2.7M3.2 11l4.8 2.8 4.8-2.8`})]});case`source`:return(0,U.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:[(0,U.jsx)(`ellipse`,{cx:`8`,cy:`4`,rx:`4.6`,ry:`1.8`}),(0,U.jsx)(`path`,{d:`M3.4 4v5.3C3.4 10.7 5.5 12 8 12s4.6-1.3 4.6-2.7V4`}),(0,U.jsx)(`path`,{d:`M3.4 6.7C3.4 8 5.5 9.3 8 9.3s4.6-1.3 4.6-2.6`})]});case`test`:case`unit_test`:return(0,U.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:[(0,U.jsx)(`path`,{d:`M8 2.2 12.6 4v3.8c0 2.6-1.7 5-4.6 5.8-2.9-.8-4.6-3.2-4.6-5.8V4L8 2.2Z`}),(0,U.jsx)(`path`,{d:`m5.6 7.9 1.5 1.5 3.3-3.3`})]});case`metric`:return(0,U.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:[(0,U.jsx)(`path`,{d:`M2.5 11.8h11`}),(0,U.jsx)(`path`,{d:`M4.2 10.8V8.1M8 10.8V5.2m3.8 5.6V3.6`})]});case`semantic_model`:return(0,U.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:[(0,U.jsx)(`rect`,{x:`2.4`,y:`3`,width:`4.2`,height:`4.2`,rx:`1`}),(0,U.jsx)(`rect`,{x:`9.4`,y:`3`,width:`4.2`,height:`4.2`,rx:`1`}),(0,U.jsx)(`rect`,{x:`5.9`,y:`9`,width:`4.2`,height:`4.2`,rx:`1`}),(0,U.jsx)(`path`,{d:`M6.6 5.1h2.8M8 7.2V9`})]});case`macro`:return(0,U.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:[(0,U.jsx)(`path`,{d:`M5.2 3.3H3.4v9.4h1.8M10.8 3.3h1.8v9.4h-1.8`}),(0,U.jsx)(`path`,{d:`m9.6 5.1-3.2 5.8`})]});case`operation`:case`sql_operation`:return(0,U.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:(0,U.jsx)(`path`,{d:`M9.8 2.9a3.2 3.2 0 1 1-1.1 6.2L4 13.8 2.2 12l4.7-4.7a3.2 3.2 0 0 1 2.9-4.4Z`})});default:return(0,U.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:[(0,U.jsx)(`path`,{d:`M4.3 2.8h5l2.4 2.4v7.9H4.3z`}),(0,U.jsx)(`path`,{d:`M9.3 2.8v2.4h2.4`}),(0,U.jsx)(`path`,{d:`M5.8 8h4.4M5.8 10.2h4.4`})]})}}function Fe({mode:e,depth:t}){return e===`database`&&t===0?(0,U.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:[(0,U.jsx)(`ellipse`,{cx:`8`,cy:`4`,rx:`4.6`,ry:`1.8`}),(0,U.jsx)(`path`,{d:`M3.4 4v4.6C3.4 10 5.5 11.2 8 11.2s4.6-1.2 4.6-2.6V4`}),(0,U.jsx)(`path`,{d:`M3.4 6.4C3.4 7.8 5.5 9 8 9s4.6-1.2 4.6-2.6`})]}):(0,U.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:(0,U.jsx)(`path`,{d:`M2.5 4.3h4.1l1.2 1.5H13a.9.9 0 0 1 .9.9v5a.9.9 0 0 1-.9.9H3a.9.9 0 0 1-.9-.9V5.2a.9.9 0 0 1 .4-.9Z`})})}function Ie({title:e,description:t,toolbar:n,leadingPane:r,children:i,inspector:a,className:o=``,suppressHeader:s=!1}){return(0,U.jsxs)(`div`,{className:`workspace-view workspace-scaffold ${o}`.trim(),children:[s?null:(0,U.jsx)(`div`,{className:`lens-header`,children:(0,U.jsxs)(`div`,{className:`lens-header__title`,children:[(0,U.jsx)(`p`,{className:`eyebrow`,children:`Workspace lens`}),(0,U.jsx)(`h2`,{children:e}),(0,U.jsx)(`p`,{className:`lens-header__desc`,children:t})]})}),n?(0,U.jsx)(`div`,{className:`workspace-scaffold__toolbar`,children:n}):null,(0,U.jsxs)(`div`,{className:`workspace-scaffold__body${r?` workspace-scaffold__body--with-leading`:``}${a?` workspace-scaffold__body--with-inspector`:``}`,children:[r?(0,U.jsx)(`aside`,{className:`workspace-scaffold__leading`,children:r}):null,(0,U.jsx)(`div`,{className:`workspace-scaffold__main`,children:i}),a?(0,U.jsx)(`aside`,{className:`workspace-scaffold__inspector`,children:a}):null]})]})}function Le({actions:e}){return(0,U.jsx)(`div`,{className:`entity-inspector__actions`,children:e.map(e=>(0,U.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:e.onClick,disabled:e.disabled,children:e.label},e.label))})}var Re=`dbt-tools.explorerFiltersExpanded`;function ze(){try{let e=window.localStorage.getItem(Re);if(e!==null)return e===`true`}catch{}return!1}function Be({mode:e}){return e===`project`?(0,U.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,children:(0,U.jsx)(`path`,{d:`M3.5 7.5h6l1.8 2h8.7v7.8a1.2 1.2 0 0 1-1.2 1.2H4.7a1.2 1.2 0 0 1-1.2-1.2V8.7a1.2 1.2 0 0 1 1.2-1.2Z`})}):e===`database`?(0,U.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,children:[(0,U.jsx)(`ellipse`,{cx:`12`,cy:`6.2`,rx:`6.5`,ry:`2.7`}),(0,U.jsx)(`path`,{d:`M5.5 6.2v5.6c0 1.5 2.9 2.7 6.5 2.7s6.5-1.2 6.5-2.7V6.2`}),(0,U.jsx)(`path`,{d:`M5.5 11.8v5.8c0 1.5 2.9 2.7 6.5 2.7s6.5-1.2 6.5-2.7v-5.8`})]}):null}function Ve({resources:e}){let t=e.filter(e=>!R.has(e.resourceType)&&e.statusTone!==`neutral`);if(t.length===0)return null;let n=new Map;for(let e of t){let t=n.get(e.resourceType)??{pass:0,fail:0};e.statusTone===`positive`?t.pass++:(e.statusTone===`danger`||e.statusTone===`warning`)&&t.fail++,n.set(e.resourceType,t)}let r=Array.from(n.entries()).sort(([e],[t])=>e.localeCompare(t));return(0,U.jsx)(`div`,{className:`resource-type-summary`,"aria-label":`Resource type summary`,children:r.map(([e,{pass:t,fail:n}])=>(0,U.jsxs)(`span`,{className:`resource-type-summary__item`,children:[(0,U.jsx)(`span`,{className:`resource-type-summary__type`,children:G(e)}),t>0&&(0,U.jsxs)(`span`,{className:`resource-type-summary__pass`,children:[`✓`,t]}),n>0&&(0,U.jsxs)(`span`,{className:`resource-type-summary__fail`,children:[`✗`,n]})]},e))})}function He({treeRows:e,explorerMode:t,expandedNodeIds:n,toggleExpandedNode:r,selectedResourceId:i,setSelectedResourceId:o}){let s=(0,d.useRef)(null),c=a({count:e.length,getScrollElement:()=>s.current,estimateSize:()=>36,overscan:16});return e.length===0?(0,U.jsx)(`div`,{ref:s,className:`explorer-tree`,children:(0,U.jsx)(W,{icon:`🔍`,headline:`No resources found`,subtext:`Adjust the search query to find matching branches or assets.`})}):(0,U.jsx)(`div`,{ref:s,className:`explorer-tree`,children:(0,U.jsx)(`div`,{className:`explorer-tree__virtual-spacer`,style:{height:c.getTotalSize(),width:`100%`,position:`relative`},children:c.getVirtualItems().map(a=>{let s=e[a.index];if(!s)return null;let{node:c,depth:l}=s;if(c.kind===`branch`){let e=n.has(c.id);return(0,U.jsx)(`div`,{className:`explorer-tree__virtual-row`,style:{position:`absolute`,top:0,left:0,width:`100%`,transform:`translateY(${a.start}px)`},children:(0,U.jsxs)(`button`,{type:`button`,className:`explorer-tree__row explorer-tree__row--branch`,style:{paddingLeft:`${.9+l*1.05}rem`},onClick:()=>r(c.id),children:[(0,U.jsx)(`span`,{className:`explorer-tree__chevron${e?` explorer-tree__chevron--expanded`:``}`,"aria-hidden":`true`,children:`▸`}),(0,U.jsx)(`span`,{className:`explorer-tree__folder`,"aria-hidden":`true`,children:(0,U.jsx)(Fe,{mode:t,depth:l})}),(0,U.jsx)(`span`,{className:`explorer-tree__label`,children:c.label}),c.testStats&&c.testStats.pass+c.testStats.fail+c.testStats.error>0&&(0,U.jsxs)(`span`,{className:`explorer-tree__test-stats`,children:[c.testStats.pass>0&&(0,U.jsxs)(`span`,{className:`explorer-tree__test-stat explorer-tree__test-stat--pass`,children:[`✓`,c.testStats.pass]}),(c.testStats.fail>0||c.testStats.error>0)&&(0,U.jsxs)(`span`,{className:`explorer-tree__test-stat explorer-tree__test-stat--fail`,children:[`✗`,c.testStats.fail+c.testStats.error]})]}),(0,U.jsx)(`span`,{className:`explorer-tree__count`,children:c.count})]})},a.key)}let u=c.resource;return(0,U.jsx)(`div`,{className:`explorer-tree__virtual-row`,style:{position:`absolute`,top:0,left:0,width:`100%`,transform:`translateY(${a.start}px)`},children:(0,U.jsxs)(`button`,{type:`button`,className:u.uniqueId===i?`explorer-tree__row explorer-tree__row--leaf explorer-tree__row--active`:`explorer-tree__row explorer-tree__row--leaf`,style:{paddingLeft:`${.9+l*1.05}rem`},onClick:()=>o(u.uniqueId),title:u.uniqueId,children:[(0,U.jsx)(`span`,{className:`explorer-tree__leaf-icon`,"aria-hidden":`true`,children:(0,U.jsx)(Pe,{resourceType:u.resourceType})}),(0,U.jsxs)(`span`,{className:`explorer-tree__resource-body`,children:[(0,U.jsxs)(`span`,{className:`explorer-tree__resource-text`,children:[(0,U.jsx)(`span`,{className:`explorer-tree__label`,children:u.name}),c.originLabel&&(0,U.jsx)(`span`,{className:`explorer-tree__origin`,children:c.originLabel})]}),(0,U.jsx)(`span`,{className:`explorer-tree__resource-type`,children:G(u.resourceType)})]}),c.testStats&&c.testStats.pass+c.testStats.fail+c.testStats.error>0&&(0,U.jsxs)(`span`,{className:`explorer-tree__test-stats`,children:[c.testStats.pass>0&&(0,U.jsxs)(`span`,{className:`explorer-tree__test-stat explorer-tree__test-stat--pass`,children:[`✓`,c.testStats.pass]}),(c.testStats.fail>0||c.testStats.error>0)&&(0,U.jsxs)(`span`,{className:`explorer-tree__test-stat explorer-tree__test-stat--fail`,children:[`✗`,c.testStats.fail+c.testStats.error]})]})]})},a.key)})})})}function Ue({treeRows:e,filteredResources:t,totalResources:n,matchedResources:r,explorerMode:i,setExplorerMode:a,status:o,setStatus:s,availableResourceTypes:c,activeResourceTypes:l,toggleResourceType:u,resourceQuery:f,setResourceQuery:p,selectedResourceId:m,expandedNodeIds:h,toggleExpandedNode:g,setSelectedResourceId:_}){let[v,y]=(0,d.useState)(ze),b=e=>{y(e);try{window.localStorage.setItem(Re,String(e))}catch{}},x=(f.trim()?1:0)+(o===`all`?0:1)+(l.size>0?1:0),S=x>0?`${x} active`:`Search, status, and type`;return(0,U.jsxs)(`aside`,{className:`explorer-pane`,children:[(0,U.jsxs)(`div`,{className:`explorer-pane__header`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`p`,{className:`eyebrow`,children:`Asset explorer`}),(0,U.jsx)(`h2`,{children:`Workspace inventory`})]}),(0,U.jsxs)(`div`,{className:`explorer-pane__count`,children:[r,r!==n&&(0,U.jsxs)(`span`,{className:`explorer-pane__count-subtext`,children:[`of `,n]})]})]}),(0,U.jsx)(`div`,{className:`explorer-mode-tabs`,role:`tablist`,"aria-label":`Explorer modes`,children:[`project`,`database`].map(e=>(0,U.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":i===e,className:i===e?`explorer-mode-tab explorer-mode-tab--active`:`explorer-mode-tab`,onClick:()=>a(e),children:[(0,U.jsx)(`span`,{className:`explorer-mode-tab__icon`,"aria-hidden":`true`,children:(0,U.jsx)(Be,{mode:e})}),B[e]]},e))}),(0,U.jsxs)(`section`,{className:`explorer-filters`,"aria-label":`Explorer filters`,children:[(0,U.jsxs)(`button`,{type:`button`,className:`explorer-filters__toggle`,"aria-expanded":v,onClick:()=>b(!v),children:[(0,U.jsxs)(`span`,{className:`explorer-filters__toggle-copy`,children:[(0,U.jsx)(`span`,{className:`explorer-filters__toggle-label`,children:`Filters`}),(0,U.jsx)(`span`,{className:`explorer-filters__toggle-summary`,children:S})]}),(0,U.jsxs)(`span`,{className:`explorer-filters__toggle-meta`,children:[x>0&&(0,U.jsx)(`span`,{className:`explorer-filters__badge`,children:x}),(0,U.jsx)(`span`,{className:`explorer-filters__chevron${v?` explorer-filters__chevron--expanded`:``}`,"aria-hidden":`true`,children:`▾`})]})]}),v&&(0,U.jsxs)(`div`,{className:`explorer-filter-stack`,children:[(0,U.jsxs)(`label`,{className:`workspace-search`,children:[(0,U.jsx)(`span`,{children:`Search resources`}),(0,U.jsx)(`input`,{value:f,onChange:e=>p(e.target.value),placeholder:`Filter tree by name, path, type, or id`})]}),(0,U.jsxs)(`div`,{className:`explorer-filter-group`,children:[(0,U.jsx)(`span`,{className:`explorer-filter-group__label`,children:`Execution status`}),(0,U.jsx)(`div`,{className:`pill-row`,children:[[`all`,`All`],[`positive`,`Success`],[`warning`,`Warn`],[`danger`,`Fail`],[`neutral`,`Not executed`]].map(([e,t])=>(0,U.jsx)(`button`,{type:`button`,className:o===e?`workspace-pill workspace-pill--active`:`workspace-pill`,onClick:()=>s(e),children:t},e))})]}),c.length>0&&(0,U.jsxs)(`div`,{className:`explorer-filter-group`,children:[(0,U.jsx)(`span`,{className:`explorer-filter-group__label`,children:`dbt resource type`}),(0,U.jsx)(`div`,{className:`pill-row`,children:c.map(e=>(0,U.jsx)(`button`,{type:`button`,className:l.size===0||l.has(e)?`workspace-pill workspace-pill--active`:`workspace-pill`,onClick:()=>u(e),children:G(e)},e))})]})]})]}),(0,U.jsx)(Ve,{resources:t}),(0,U.jsx)(He,{treeRows:e,explorerMode:i,expandedNodeIds:h,toggleExpandedNode:g,selectedResourceId:m,setSelectedResourceId:_})]})}function We(e){let t=new Map;for(let n of e){let e=t.get(n.status)??{count:0,duration:0,tone:n.statusTone};e.count+=1,e.duration+=n.executionTime,t.set(n.status,e)}return[...t.entries()].map(([t,n])=>({status:t,count:n.count,duration:n.duration,share:e.length>0?n.count/e.length:0,tone:n.tone})).sort((e,t)=>t.count-e.count)}function Ge(e){let t=new Map;for(let n of e){let e=n.threadId??`unknown`,r=t.get(e)??{count:0,totalExecutionTime:0};r.count+=1,r.totalExecutionTime+=n.executionTime,t.set(e,r)}return[...t.entries()].map(([e,t])=>({threadId:e,count:t.count,totalExecutionTime:t.totalExecutionTime})).sort((e,t)=>t.totalExecutionTime-e.totalExecutionTime)}function Ke(e,t){let n=e.executions.filter(e=>t.status!==`all`&&e.statusTone!==t.status||t.resourceTypes.size>0&&!t.resourceTypes.has(e.resourceType)?!1:le(e,t.query)),r=n.filter(e=>R.has(e.resourceType)),i=Ge(n);return{filteredExecutions:n,filteredStatusBreakdown:We(n),filteredThreadStats:i,filteredTypes:Array.from(new Set(n.map(e=>e.resourceType))).sort(),failingNodes:n.filter(e=>e.statusTone===`danger`).length,warningNodes:n.filter(e=>e.statusTone===`warning`).length,failedModels:n.filter(te).length,passingTests:r.filter(e=>e.statusTone===`positive`).length,failingTests:r.filter(e=>e.statusTone===`danger`).length,threadCount:i.filter(e=>e.threadId!==`unknown`).length,filteredExecutionTime:n.reduce((e,t)=>e+t.executionTime,0),topFailures:n.filter(e=>e.statusTone===`danger`).slice(0,3),topBottlenecks:[...n].sort((e,t)=>t.executionTime-e.executionTime).slice(0,3)}}function qe(e,t,n){if(t.length===0&&n.length===0)return null;let r=n.filter(e=>e.statusTone===`danger`||e.statusTone===`warning`).length;return{label:e,value:`${t.length} total`,detail:[`${n.length} executed`,r>0?`${r} attention`:null].filter(e=>!!e).join(` · `)}}function Je(e,t,n,r,i){let a=e.resources.filter(e=>de(e,t)),o=e.executions.filter(e=>de(e,t)),s=new Map,c=new Map;for(let e of a){let t=R.has(e.resourceType)?`tests`:e.resourceType,n=s.get(t)??[];n.push(e),s.set(t,n)}for(let e of o){let t=R.has(e.resourceType)?`tests`:e.resourceType,n=c.get(t)??[];n.push(e),c.set(t,n)}let l={label:`Run time`,value:V(i?r.filteredExecutionTime:e.summary.total_execution_time)},u=L.map(({key:e,label:t})=>qe(t,s.get(e)??[],c.get(e)??[])).filter(e=>e!=null),d=`positive`,f=`Healthy run`,p=i?`No failing nodes match the current dashboard filters.`:`No failing nodes surfaced in the latest run.`;return r.failingNodes>0?(d=`danger`,f=`${r.failingNodes} failing node${r.failingNodes===1?``:`s`} require attention`,p=`Prioritize failing nodes before reviewing downstream impact.`):r.warningNodes>0&&(d=`warning`,f=`${r.warningNodes} warning node${r.warningNodes===1?``:`s`} need review`,p=`Warnings surfaced in this run. Review tests and runtime hotspots next.`),{tone:d,title:f,summary:p,sourceLabel:n===`preload`?`DBT_TARGET`:n===`upload`?`UPLOADED`:`ARTIFACTS`,summaryBits:[t??`Workspace`,`${e.graphSummary.totalNodes} graph nodes`,`${e.summary.total_nodes} executions`,e.invocationId==null?null:`invocation ${e.invocationId}`,ne(e)==null?null:`invocation started ${H(ne(e))}`].filter(e=>!!e),chips:[l,...u]}}function Ye({analysis:e,projectName:t,analysisSource:n,derived:r,filtered:i,embedded:a=!1}){let o=Je(e,t,n,r,i);return(0,U.jsxs)(`section`,{className:`overview-banner overview-banner--${o.tone}${a?` overview-banner--embedded`:``}`,children:[(0,U.jsxs)(`div`,{className:`overview-banner__topline`,children:[(0,U.jsx)(`p`,{className:`eyebrow`,children:`Workspace overview`}),(0,U.jsx)(`span`,{className:`overview-banner__source`,children:o.sourceLabel})]}),(0,U.jsx)(`p`,{className:`overview-banner__summary`,children:o.summaryBits.join(` · `)}),(0,U.jsxs)(`div`,{className:`overview-banner__body`,children:[(0,U.jsxs)(`div`,{className:`overview-banner__copy`,children:[(0,U.jsx)(`h3`,{children:o.title}),(0,U.jsx)(`p`,{children:o.summary})]}),(0,U.jsx)(`div`,{className:`overview-banner__chips`,children:o.chips.map(e=>(0,U.jsxs)(`div`,{className:`overview-chip`,children:[(0,U.jsx)(`span`,{children:e.label}),(0,U.jsx)(`strong`,{children:e.value}),e.detail&&(0,U.jsx)(`small`,{children:e.detail})]},e.label))})]})]})}function Xe({label:e}){return(0,U.jsx)(`span`,{className:`overview-scope-badge`,children:e})}function Ze({derived:e}){let t=e.failingNodes>0?`danger`:e.warningNodes>0?`warning`:`positive`,n=e.failingNodes>0?`${e.failedModels} failed model${e.failedModels===1?``:`s`} block downstream investigation.`:e.warningNodes>0?`Warnings surfaced. Review tests and freshness signals next.`:`No immediate triage items.`;return(0,U.jsxs)(`section`,{className:`overview-module overview-module--attention overview-module--${t}`,children:[(0,U.jsxs)(`div`,{className:`overview-module__header`,children:[(0,U.jsx)(`h3`,{children:`Attention`}),(0,U.jsx)(`p`,{children:`Immediate run posture and next step.`})]}),(0,U.jsxs)(`div`,{className:`attention-card attention-card--${t}`,children:[(0,U.jsxs)(`div`,{className:`attention-card__metrics`,children:[(0,U.jsxs)(`div`,{className:`attention-card__metric`,children:[(0,U.jsx)(`span`,{children:`Failing`}),(0,U.jsx)(`strong`,{children:e.failingNodes})]}),(0,U.jsxs)(`div`,{className:`attention-card__metric`,children:[(0,U.jsx)(`span`,{children:`Warnings`}),(0,U.jsx)(`strong`,{children:e.warningNodes})]})]}),(0,U.jsx)(`p`,{children:n})]})]})}function Qe({derived:e,title:t=`Bottlenecks`,subtitle:n=`Longest-running nodes in the filtered execution slice.`,embedded:r=!1}){let i=e.topBottlenecks;return(0,U.jsxs)(`section`,{className:`overview-module overview-module--bottlenecks${r?` overview-module--embedded`:``}`,children:[!r&&(0,U.jsxs)(`div`,{className:`overview-module__header`,children:[(0,U.jsx)(`h3`,{children:t}),(0,U.jsx)(`p`,{children:n})]}),i.length>0?(0,U.jsx)(`div`,{className:`action-list`,children:i.map((t,n)=>(0,U.jsxs)(`div`,{className:`action-list__row`,children:[(0,U.jsxs)(`div`,{className:`action-list__body`,children:[(0,U.jsx)(`strong`,{children:`${n+1}. ${t.name}`}),(0,U.jsx)(`span`,{children:`${(t.executionTime/Math.max(e.filteredExecutionTime,1e-4)*100).toFixed(1)}% of filtered run`})]}),(0,U.jsx)(`div`,{className:`action-list__metric`,children:(0,U.jsx)(`strong`,{children:V(t.executionTime)})})]},t.uniqueId))}):(0,U.jsx)(W,{icon:`⚡`,headline:`No matching bottlenecks`,subtext:`No executions match the current dashboard filters.`})]})}function $e({analysis:e,filtered:t}){let n=e.summary.critical_path?.path.length??0;return(0,U.jsxs)(`section`,{className:`overview-module overview-module--critical`,children:[(0,U.jsxs)(`div`,{className:`overview-module__header`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{children:`Critical path`}),(0,U.jsx)(`p`,{children:`Dependency pressure and scheduling risk.`})]}),t&&(0,U.jsx)(Xe,{label:`Workspace-wide`})]}),(0,U.jsxs)(`div`,{className:`critical-path-card`,children:[(0,U.jsxs)(`div`,{className:`critical-path-card__headline`,children:[(0,U.jsxs)(`strong`,{children:[n,` nodes`]}),(0,U.jsx)(`span`,{children:e.graphSummary.hasCycles?`Cycles detected in the dependency graph.`:`No cycles detected in the dependency graph.`})]}),(0,U.jsxs)(`div`,{className:`critical-path-card__detail`,children:[(0,U.jsx)(`span`,{children:`Graph edges`}),(0,U.jsx)(`strong`,{children:e.graphSummary.totalEdges})]})]})]})}function et({analysis:e,filtered:t}){let n=e.resources.filter(e=>!!e.description?.trim()).length,r=e.resources.length>0?Math.round(n/e.resources.length*100):0,i=Math.max(e.resources.length-n,0),a=e.resources.filter(e=>e.resourceType===`model`).length;return(0,U.jsxs)(`section`,{className:`overview-module overview-module--coverage`,children:[(0,U.jsxs)(`div`,{className:`overview-module__header`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{children:`Coverage`}),(0,U.jsx)(`p`,{children:`Structural health of metadata and discovery quality.`})]}),t&&(0,U.jsx)(Xe,{label:`Workspace-wide`})]}),(0,U.jsxs)(`div`,{className:`coverage-card`,children:[(0,U.jsxs)(`div`,{className:`coverage-card__headline`,children:[(0,U.jsxs)(`strong`,{children:[r,`%`]}),(0,U.jsx)(`span`,{children:`Metadata coverage`})]}),(0,U.jsxs)(`div`,{className:`coverage-card__stats`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{children:`Documented`}),(0,U.jsxs)(`strong`,{children:[n,` / `,e.resources.length]})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{children:`Missing descriptions`}),(0,U.jsx)(`strong`,{children:i})]})]}),(0,U.jsx)(`p`,{children:a>0?`Next improvement: document core models first to improve catalog-style discovery.`:`Add descriptions to core resources to improve catalog-style discovery.`})]})]})}var tt=`data-theme`,q=`dark`,J=`light`,nt=`system`;function rt(e){if(e===q)return q;if(e===J)return J;try{return window.matchMedia(`(prefers-color-scheme: dark)`).matches?q:J}catch{return J}}function it(){return typeof document>`u`?`light`:document.documentElement.getAttribute(tt)===q?q:`light`}function at(e){e(it());let t=new MutationObserver(()=>e(it()));return t.observe(document.documentElement,{attributes:!0,attributeFilter:[tt]}),()=>t.disconnect()}function ot(){let[e,t]=(0,d.useState)(()=>it());return(0,d.useEffect)(()=>(t(it()),at(t)),[]),e}function st(){let[e,t]=(0,d.useState)(()=>{try{let e=window.localStorage.getItem(`dbt-tools.theme`);if(e===J||e===q||e===nt)return e}catch{}return nt}),[n,r]=(0,d.useState)(()=>rt(e));return(0,d.useEffect)(()=>{r(rt(e));try{window.localStorage.setItem(`dbt-tools.theme`,e)}catch{}},[e]),(0,d.useEffect)(()=>{document.documentElement.setAttribute(tt,n)},[n]),{theme:n,themePreference:e,setThemePreference:t,toggleTheme:()=>t(e=>e===J?q:e===q?J:q)}}var ct={display:`flex`,justifyContent:`flex-end`,marginBottom:`0.75rem`};function lt(e){let t=new Map;for(let n of e){let e=t.get(n.resourceType)??[];e.push(n),t.set(n.resourceType,e)}return[...t.entries()].map(([e,t])=>({resourceType:e,count:t.length,duration:t.reduce((e,t)=>e+t.executionTime,0),statusBreakdown:We(t)})).sort((e,t)=>t.count-e.count)}function ut({group:e,statusColors:t,tooltipContentStyle:n}){let r=e.statusBreakdown.map(e=>({name:e.status,value:e.count,tone:e.tone})),i=e.statusBreakdown[0]?.tone??`neutral`;return(0,U.jsxs)(`article`,{className:`type-donut-card`,style:{"--type-accent":t[i]},children:[(0,U.jsxs)(`div`,{className:`type-donut-card__title`,children:[(0,U.jsx)(`strong`,{children:G(e.resourceType)}),(0,U.jsxs)(`span`,{className:`type-donut-card__count`,children:[e.count,` runs`]})]}),(0,U.jsx)(`div`,{className:`type-donut-card__meta`,children:(0,U.jsxs)(`span`,{children:[V(e.duration),` runtime`]})}),(0,U.jsx)(`div`,{className:`type-donut-card__chart`,children:(0,U.jsx)(o,{width:`100%`,height:`100%`,children:(0,U.jsxs)(u,{children:[(0,U.jsx)(c,{data:r,dataKey:`value`,nameKey:`name`,innerRadius:26,outerRadius:42,paddingAngle:2,strokeWidth:0,children:r.map(n=>(0,U.jsx)(l,{fill:t[n.tone]},`${e.resourceType}-${n.name}`))}),(0,U.jsx)(s,{formatter:e=>[`${Number(e??0)} runs`,`Count`],contentStyle:n})]})})}),(0,U.jsx)(`div`,{className:`type-donut-card__legend`,children:e.statusBreakdown.map(n=>(0,U.jsxs)(`div`,{className:`type-donut-card__legend-row`,children:[(0,U.jsxs)(`div`,{className:`type-donut-card__legend-label`,children:[(0,U.jsx)(`span`,{className:`legend-row__swatch`,style:{background:t[n.tone]}}),(0,U.jsx)(`span`,{children:n.status})]}),(0,U.jsxs)(`div`,{className:`type-donut-card__legend-metric`,children:[(0,U.jsx)(`strong`,{children:n.count}),(0,U.jsxs)(`span`,{children:[(n.share*100).toFixed(0),`%`]})]})]},`${e.resourceType}-${n.status}`))})]})}function dt({executions:e}){let t=ot(),n=(0,d.useMemo)(()=>P(t),[t]),r=(0,d.useMemo)(()=>({borderRadius:12,border:`1px solid ${h(t).borderDefault}`,boxShadow:t===`dark`?`0 8px 24px rgba(0, 0, 0, 0.45)`:`0 20px 40px rgba(26, 34, 43, 0.14)`}),[t]),i=lt(e);return i.length===0?(0,U.jsx)(`div`,{className:`empty-state`,children:`No execution data.`}):(0,U.jsx)(`div`,{className:`type-donut-grid`,children:i.map(e=>(0,U.jsx)(ut,{group:e,statusColors:n,tooltipContentStyle:r},e.resourceType))})}function ft({statusData:e,statusBreakdown:t}){let n=ot(),r=(0,d.useMemo)(()=>P(n),[n]),i=(0,d.useMemo)(()=>({borderRadius:14,border:`1px solid ${h(n).borderDefault}`,boxShadow:n===`dark`?`0 8px 24px rgba(0, 0, 0, 0.45)`:`0 20px 40px rgba(26, 34, 43, 0.14)`}),[n]);return(0,U.jsxs)(`div`,{className:`status-donut`,children:[(0,U.jsx)(`div`,{className:`status-donut__chart`,children:(0,U.jsx)(o,{width:`100%`,height:`100%`,children:(0,U.jsxs)(u,{children:[(0,U.jsx)(c,{data:e,dataKey:`value`,nameKey:`name`,innerRadius:56,outerRadius:82,paddingAngle:3,strokeWidth:0,labelLine:!1,label:({cx:e,cy:t,midAngle:n,outerRadius:r,percent:i,name:a})=>{if(e==null||t==null||n==null||r==null||i==null||a==null||i<.08)return null;let o=Math.PI/180,s=r+6,c=r+18,l=e+s*Math.cos(-n*o),u=t+s*Math.sin(-n*o),d=e+c*Math.cos(-n*o),f=t+c*Math.sin(-n*o),p=d>=e,m=d+(p?12:-12);return(0,U.jsxs)(`g`,{className:`status-donut__callout`,children:[(0,U.jsx)(`path`,{d:`M${l},${u} L${d},${f} L${m},${f}`}),(0,U.jsx)(`text`,{x:m+(p?4:-4),y:f,textAnchor:p?`start`:`end`,dominantBaseline:`central`,children:a})]})},children:e.map(e=>(0,U.jsx)(l,{fill:r[e.tone]},e.name))}),(0,U.jsx)(s,{formatter:e=>[`${Number(e??0)} runs`,`Count`],contentStyle:i})]})})}),(0,U.jsx)(`div`,{className:`status-donut__legend`,children:t.map(e=>(0,U.jsxs)(`div`,{className:`legend-row`,children:[(0,U.jsxs)(`div`,{className:`legend-row__label`,children:[(0,U.jsx)(`span`,{className:`legend-row__swatch`,style:{background:r[e.tone]}}),e.status]}),(0,U.jsxs)(`div`,{className:`legend-row__value`,children:[e.count,` · `,V(e.duration)]})]},e.status))})]})}function pt({statusBreakdown:e,executions:t}){let[n,r]=(0,d.useState)(`status`),i=e.map(e=>({name:e.status,value:e.count,tone:e.tone})),a=(0,U.jsxs)(`div`,{className:`health-toggle`,children:[(0,U.jsx)(`button`,{type:`button`,className:n===`status`?`active`:``,onClick:()=>r(`status`),children:`By status`}),(0,U.jsx)(`button`,{type:`button`,className:n===`type`?`active`:``,onClick:()=>r(`type`),children:`By type`})]});return n===`type`?(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{style:ct,children:a}),(0,U.jsx)(dt,{executions:t})]}):i.length===0?(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{style:ct,children:a}),(0,U.jsx)(`div`,{className:`empty-state`,children:`No execution statuses were recorded.`})]}):(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{style:ct,children:a}),(0,U.jsx)(ft,{statusData:i,statusBreakdown:e})]})}function mt({filters:e,setFilters:t,availableTypes:n,resultCount:r}){let i=(e.status===`all`?0:1)+e.resourceTypes.size+(e.query.trim()?1:0);function a(e){t(t=>{let n=new Set(t.resourceTypes);return n.has(e)?n.delete(e):n.add(e),{...t,resourceTypes:n}})}return(0,U.jsxs)(`div`,{className:`overview-filter-bar`,children:[(0,U.jsxs)(`div`,{className:`overview-filter-bar__topline`,children:[(0,U.jsxs)(`div`,{className:`overview-filter-bar__title`,children:[(0,U.jsx)(`span`,{children:`Dashboard filters`}),(0,U.jsxs)(`strong`,{children:[r,` matching runs`]})]}),i>0&&(0,U.jsxs)(`button`,{type:`button`,className:`workspace-pill`,onClick:()=>t({status:`all`,resourceTypes:new Set,query:``}),children:[`Clear all (`,i,`)`]})]}),(0,U.jsxs)(`div`,{className:`overview-filter-bar__controls`,children:[(0,U.jsx)(`div`,{className:`pill-row`,children:[{value:`all`,label:`All`},{value:`positive`,label:`Healthy`},{value:`warning`,label:`Warnings`},{value:`danger`,label:`Errors`}].map(n=>(0,U.jsx)(`button`,{type:`button`,className:e.status===n.value?F:I,onClick:()=>t(e=>({...e,status:n.value})),children:n.label},n.value))}),n.length>0&&(0,U.jsx)(`div`,{className:`pill-row`,children:n.map(t=>{let n=e.resourceTypes.has(t);return(0,U.jsxs)(`button`,{type:`button`,className:n?`workspace-pill workspace-pill--active`:`workspace-pill`,onClick:()=>a(t),children:[t.replace(`_`,` `),n&&` ✓`]},t)})}),(0,U.jsxs)(`label`,{className:`workspace-search workspace-search--compact overview-filter-bar__search`,children:[(0,U.jsx)(`span`,{children:`Search executions`}),(0,U.jsxs)(`div`,{className:`workspace-search__input-row`,children:[(0,U.jsx)(`input`,{value:e.query,onChange:e=>t(t=>({...t,query:e.target.value})),placeholder:`Filter by name, path, status, or thread…`}),e.query&&(0,U.jsx)(`button`,{type:`button`,className:`workspace-search__clear`,"aria-label":`Clear dashboard search`,onClick:()=>t(e=>({...e,query:``})),children:`✕`})]})]})]})]})}function ht({graphSummary:e}){let t=Object.entries(e.nodesByType).sort((e,t)=>t[1]-e[1]);return t.length===0?(0,U.jsx)(`div`,{className:`empty-state`,children:`No node-type breakdown available.`}):(0,U.jsx)(`div`,{className:`rank-list`,children:t.map(([t,n])=>(0,U.jsxs)(`div`,{className:`rank-list__row`,children:[(0,U.jsx)(`div`,{className:`rank-list__body`,children:(0,U.jsx)(`strong`,{children:t})}),(0,U.jsxs)(`div`,{className:`rank-list__metric`,children:[(0,U.jsx)(`strong`,{children:n}),(0,U.jsx)(`span`,{children:e.totalNodes>0?`${(n/e.totalNodes*100).toFixed(0)}% of graph`:``})]})]},t))})}function gt({derived:e,analysis:t,workerThreadCount:n,modelsCount:r,testsCount:i}){let a=t.summary.critical_path?.path.length??0;return(0,U.jsxs)(`div`,{className:`overview-band overview-band--context`,children:[(0,U.jsxs)(`section`,{className:`overview-module overview-module--threads`,children:[(0,U.jsxs)(`div`,{className:`overview-module__header`,children:[(0,U.jsx)(`h3`,{children:`Thread distribution`}),(0,U.jsx)(`p`,{children:`The busiest worker lanes in the current execution slice.`})]}),e.filteredThreadStats.length>0?(0,U.jsx)(`div`,{className:`thread-list`,children:e.filteredThreadStats.slice(0,6).map(e=>(0,U.jsxs)(`div`,{className:`thread-list__row`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`strong`,{children:e.threadId}),(0,U.jsxs)(`span`,{children:[e.count,` nodes`]})]}),(0,U.jsx)(`div`,{children:V(e.totalExecutionTime)})]},e.threadId))}):(0,U.jsx)(W,{icon:`⋯`,headline:`No thread data in slice`,subtext:`No matching executions were found for the current dashboard filters.`})]}),(0,U.jsxs)(`section`,{className:`overview-module overview-module--footprint`,children:[(0,U.jsxs)(`div`,{className:`overview-module__header`,children:[(0,U.jsx)(`h3`,{children:`Footprint`}),(0,U.jsx)(`p`,{children:`Filtered execution volume, duration, and worker scale.`})]}),(0,U.jsxs)(`div`,{className:`footprint-card`,children:[(0,U.jsxs)(`div`,{className:`footprint-card__stats`,children:[(0,U.jsxs)(`div`,{className:`footprint-card__stat`,children:[(0,U.jsx)(`span`,{children:`Executed`}),(0,U.jsx)(`strong`,{children:e.filteredExecutions.length})]}),(0,U.jsxs)(`div`,{className:`footprint-card__stat`,children:[(0,U.jsx)(`span`,{children:`Runtime`}),(0,U.jsx)(`strong`,{children:V(e.filteredExecutionTime)})]}),(0,U.jsxs)(`div`,{className:`footprint-card__stat`,children:[(0,U.jsx)(`span`,{children:`Worker lanes`}),(0,U.jsx)(`strong`,{children:n})]}),(0,U.jsxs)(`div`,{className:`footprint-card__stat`,children:[(0,U.jsx)(`span`,{children:`Models`}),(0,U.jsx)(`strong`,{children:r})]}),(0,U.jsxs)(`div`,{className:`footprint-card__stat`,children:[(0,U.jsx)(`span`,{children:`Tests`}),(0,U.jsx)(`strong`,{children:i})]})]}),(0,U.jsxs)(`p`,{className:`footprint-card__detail`,children:[`Graph totals remain workspace-wide:`,` `,t.graphSummary.totalNodes,` nodes,`,` `,t.graphSummary.totalEdges,` edges, `,a,` `,`critical-path nodes.`]})]})]})]})}function _t({analysis:e,projectName:t,analysisSource:n,filters:r,setFilters:i,workspaceSignals:a,onNavigateTo:o}){let s=(0,d.useDeferredValue)(r.query),c=(0,d.useMemo)(()=>Ke(e,{...r,query:s}),[e,s,r]),l=he(r),u=c.threadCount||c.filteredThreadStats.length,f=c.filteredExecutions.filter(e=>e.resourceType===`model`).length,p=c.filteredExecutions.filter(e=>R.has(e.resourceType)).length,m=(0,d.useMemo)(()=>Array.from(new Set(e.executions.map(e=>e.resourceType))).sort(),[e.executions]);return(0,U.jsxs)(`div`,{className:`workspace-view health-view`,children:[(0,U.jsxs)(`div`,{className:`lens-header`,children:[(0,U.jsxs)(`div`,{className:`lens-header__title`,children:[(0,U.jsx)(`p`,{className:`eyebrow`,children:`Workspace lens`}),(0,U.jsx)(`h2`,{children:`Health`}),(0,U.jsx)(`p`,{className:`lens-header__desc`,children:`Run posture, critical issues, and dependency pressure at a glance.`})]}),l&&(0,U.jsx)(`span`,{className:`lens-header__badge`,children:`Filtered view`})]}),a.length>0&&(0,U.jsx)(`section`,{className:`health-hero-strip`,"aria-label":`Workspace signals`,children:a.map(e=>(0,U.jsxs)(`article`,{className:`signal-card signal-card--${e.tone}`,children:[(0,U.jsx)(`p`,{className:`signal-card__label`,children:e.label}),(0,U.jsx)(`strong`,{children:e.value}),(0,U.jsx)(`span`,{children:e.detail})]},e.label))}),(0,U.jsxs)(`section`,{className:`health-section health-section--status`,children:[(0,U.jsx)(Ye,{analysis:e,projectName:t,analysisSource:n,derived:c,filtered:l,embedded:!0}),(0,U.jsx)(mt,{filters:r,setFilters:i,availableTypes:m,resultCount:c.filteredExecutions.length})]}),(0,U.jsxs)(`section`,{className:`health-grid`,"aria-label":`Run triage`,children:[(0,U.jsx)(`div`,{className:`health-grid__col health-grid__col--attention`,children:(0,U.jsx)(Ze,{derived:c})}),(0,U.jsx)(`div`,{className:`health-grid__col health-grid__col--bottlenecks`,children:(0,U.jsx)(Qe,{derived:c})}),(0,U.jsx)(`div`,{className:`health-grid__col health-grid__col--critical`,children:(0,U.jsx)($e,{analysis:e,filtered:l})})]}),(0,U.jsx)(`section`,{className:`health-section health-section--actions`,children:(0,U.jsxs)(`div`,{className:`workspace-pill-row`,children:[(0,U.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:()=>o(`runs`),children:`Open Runs`}),(0,U.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:()=>o(`timeline`),children:`Open Timeline`}),(0,U.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:()=>o(`inventory`),children:`Browse Inventory`}),(0,U.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:()=>o(`inventory`,{assetTab:`lineage`}),children:`Open Lineage`})]})}),(0,U.jsxs)(`section`,{className:`health-section health-section--execution`,children:[(0,U.jsxs)(`div`,{className:`health-section__header`,children:[(0,U.jsx)(`h3`,{children:`Execution breakdown`}),(0,U.jsx)(`p`,{children:`Status distribution across the filtered execution slice.`})]}),c.filteredExecutions.length>0?(0,U.jsx)(pt,{statusBreakdown:c.filteredStatusBreakdown,executions:c.filteredExecutions}):(0,U.jsx)(W,{icon:`◌`,headline:`No matching executions`,subtext:`Try clearing the dashboard filters or broadening your search.`})]}),(0,U.jsxs)(`section`,{className:`health-section health-section--context`,children:[(0,U.jsxs)(`div`,{className:`health-section__header`,children:[(0,U.jsx)(`h3`,{children:`Execution context`}),(0,U.jsx)(`p`,{children:`Worker pressure and run footprint for the current slice.`})]}),(0,U.jsx)(gt,{derived:c,analysis:e,workerThreadCount:u,modelsCount:f,testsCount:p})]}),(0,U.jsxs)(`section`,{className:`health-section health-section--structure`,children:[(0,U.jsxs)(`div`,{className:`health-section__header`,children:[(0,U.jsx)(`h3`,{children:`Structural health`}),(0,U.jsx)(`p`,{children:`Coverage and graph shape across the workspace.`})]}),(0,U.jsxs)(`div`,{className:`health-structure-band`,children:[(0,U.jsx)(et,{analysis:e,filtered:l}),(0,U.jsxs)(`div`,{className:`health-structure-composition`,children:[(0,U.jsxs)(`div`,{className:`overview-module__header`,children:[(0,U.jsx)(`h3`,{children:`Graph composition`}),(0,U.jsx)(`p`,{children:`Node type breakdown in the manifest graph.`})]}),(0,U.jsx)(ht,{graphSummary:e.graphSummary})]})]})]})]})}var vt=typeof window<`u`?new URLSearchParams(window.location.search).get(`debug`)===`1`:!1;function Y(...e){vt&&console.log(`[dbt-tools]`,...e)}function yt(e){!vt||typeof performance>`u`||performance.mark(e)}function bt(e,t,n){if(!vt||typeof performance>`u`)return;performance.measure(e,t,n);let r=performance.getEntriesByName(e,`measure`),i=r[r.length-1];i&&Y(`${e}: ${i.duration.toFixed(1)}ms`)}var xt=`Unexpected analysis worker response`,St=`Unexpected resource-code worker response`,Ct=`Unexpected search-resources worker response`,wt=`search-resources`,Tt=class{worker;requestId=0;pending=new Map;constructor(){this.worker=new Worker(new URL(`/assets/analysis.worker-uCmLG0eu.js`,``+import.meta.url),{type:`module`}),this.worker.onmessage=e=>{this.handleMessage(e.data)},this.worker.onerror=e=>{let t=e.message||`Analysis worker failed`;for(let e of this.pending.values())e.reject(Error(t));this.pending.clear()}}async loadAnalysis(e,t,n){let r=this.requestId+1;this.requestId=r;let i=`analysis-load:${r}:dispatch`,a=`analysis-load:${r}:ready`,o=`analysis-load:${r}:analysis-ready`;yt(i);let s={type:`load-analysis`,protocolVersion:2,requestId:r,manifestBytes:e,runResultsBytes:t,source:n},c=new Promise((e,t)=>{this.pending.set(r,{kind:`load`,resolve:e,reject:t,source:n})});return this.worker.postMessage(s,[e,t]),c.then(e=>(yt(a),bt(o,i,a),Y(`Analysis worker ready`,{requestId:r,source:n,timings:e.metrics.timings}),{...e,metrics:{...e.metrics,dispatchMarkName:i,readyMarkName:a,analysisReadyMeasureName:o}}))}async requestResourceCode(e){let t=this.requestId+1;this.requestId=t;let n={type:`get-resource-code`,protocolVersion:2,requestId:t,uniqueId:e},r=new Promise((e,n)=>{this.pending.set(t,{kind:`resource-code`,resolve:e,reject:n})});return this.worker.postMessage(n),r}async searchResources(e){let t=this.requestId+1;this.requestId=t;let n={type:wt,protocolVersion:2,requestId:t,query:e},r=new Promise((e,n)=>{this.pending.set(t,{kind:wt,resolve:e,reject:n})});return this.worker.postMessage(n),r}terminate(){this.worker.terminate();for(let e of this.pending.values())e.reject(Error(`Analysis worker terminated`));this.pending.clear()}handleMessage(e){let t=this.pending.get(e.requestId);if(t){if(this.pending.delete(e.requestId),t.kind===`load`){if(e.type===`analysis-error`){t.reject(Error(e.message));return}if(e.type===`analysis-ready`){t.resolve({analysis:e.analysis,metrics:{requestId:e.requestId,source:t.source,dispatchMarkName:``,readyMarkName:``,analysisReadyMeasureName:``,timings:e.timings}});return}t.reject(Error(xt));return}if(t.kind===`resource-code`){if(e.type===`resource-code-error`){t.reject(Error(e.message));return}if(e.type===`resource-code-ready`){t.resolve({compiledCode:e.compiledCode,rawCode:e.rawCode});return}t.reject(Error(St));return}if(t.kind===wt){if(e.type===`search-resources-error`){t.reject(Error(e.message));return}if(e.type===`search-resources-ready`){t.resolve(e.resources);return}t.reject(Error(Ct))}}}},Et=null;function Dt(){return Et??=new Tt,Et}async function Ot(e,t,n){return Dt().loadAnalysis(e,t,n)}async function kt(e){return Dt().requestResourceCode(e)}async function At(e){return Dt().searchResources(e)}var jt=r();function Mt(e){return Math.max(0,Math.min(10,e))}function Nt(e){return z.has(e)}function Pt(e,t,n,r){let i=new Map,a=[t];for(let o=1;o<=n;o+=1){let n=[];for(let s of a){let a=e[s],c=r===`upstream`?a?.upstream?.map(e=>e.uniqueId)??[]:a?.downstream?.map(e=>e.uniqueId)??[];for(let e of c)i.has(e)||e===t||(i.set(e,o),n.push(e))}if(a=n,a.length===0)break}return i}function Ft(e){switch(e){case`source`:case`seed`:case`snapshot`:return 0;case`model`:return 1;case`semantic_model`:return 2;case`metric`:case`exposure`:return 3;default:return 4}}function It(e,t,n,r){if(e===t)return{side:`selected`,depth:0};let i=n.get(e),a=r.get(e);return i!=null&&a!=null?i<=a?{side:`upstream`,depth:i}:{side:`downstream`,depth:a}:i==null?a==null?{side:`selected`,depth:0}:{side:`downstream`,depth:a}:{side:`upstream`,depth:i}}function Lt(e,t,n,r,i){let a=new Map,o=[...t.keys()].sort((e,n)=>t.get(e)-t.get(n));for(let t of o){let n=r.get(t);if(!n||R.has(n.resourceType))continue;let o=i[t]?.downstream?.map(e=>e.uniqueId)??[],s=0;for(let t of o)if(t===e)s=Math.max(s,0);else{let e=a.get(t);e!==void 0&&(s=Math.max(s,e))}a.set(t,s+1)}let s=new Map,c=[...n.keys()].sort((e,t)=>n.get(e)-n.get(t));for(let t of c){let n=r.get(t);if(!n||R.has(n.resourceType))continue;let a=i[t]?.upstream?.map(e=>e.uniqueId)??[],o=0;for(let t of a)if(t===e)o=Math.max(o,0);else{let e=s.get(t);e!==void 0&&(o=Math.max(o,e))}s.set(t,o+1)}let l=new Map,u=r.get(e);u&&l.set(0,[u]);for(let[e]of t){let t=r.get(e);if(!t||R.has(t.resourceType))continue;let n=-(a.get(e)??1),i=l.get(n)??[];i.push(t),l.set(n,i)}for(let[e]of n){let t=r.get(e);if(!t||R.has(t.resourceType))continue;let n=s.get(e)??1,i=l.get(n)??[];i.push(t),l.set(n,i)}return Array.from(l.entries()).sort((e,t)=>e[0]-t[0]).map(([e,t])=>({column:e,resources:[...new Map(t.map(e=>[e.uniqueId,e])).values()].sort((e,t)=>{let n=Ft(e.resourceType)-Ft(t.resourceType);return n===0?e.name.localeCompare(t.name):n})}))}function Rt(e,t){let n=new Map;e.forEach(e=>e.resources.forEach((e,t)=>n.set(e.uniqueId,t)));let r=e.map(e=>({...e,resources:[...e.resources]}));for(let e=0;e<4;e+=1){for(let e=1;e<r.length;e+=1){let i=r[e-1],a=r[e];a.resources.sort((e,r)=>{let a=t[e.uniqueId]?.upstream?.map(e=>e.uniqueId)??[],o=t[r.uniqueId]?.upstream?.map(e=>e.uniqueId)??[];return(a.length>0?a.reduce((e,t)=>e+(n.get(t)??i.resources.length),0)/a.length:n.get(e.uniqueId)??0)-(o.length>0?o.reduce((e,t)=>e+(n.get(t)??i.resources.length),0)/o.length:n.get(r.uniqueId)??0)}),a.resources.forEach((e,t)=>n.set(e.uniqueId,t))}for(let e=r.length-2;e>=0;--e){let i=r[e+1],a=r[e];a.resources.sort((e,r)=>{let a=t[e.uniqueId]?.downstream?.map(e=>e.uniqueId)??[],o=t[r.uniqueId]?.downstream?.map(e=>e.uniqueId)??[];return(a.length>0?a.reduce((e,t)=>e+(n.get(t)??i.resources.length),0)/a.length:n.get(e.uniqueId)??0)-(o.length>0?o.reduce((e,t)=>e+(n.get(t)??i.resources.length),0)/o.length:n.get(r.uniqueId)??0)}),a.resources.forEach((e,t)=>n.set(e.uniqueId,t))}}return r}function zt({resource:e,dependencySummary:t,dependencyIndex:n,resourceById:r,upstreamDepth:i,downstreamDepth:a,displayMode:o=`focused`}){let s=Pt(n,e.uniqueId,i,`upstream`),c=Pt(n,e.uniqueId,a,`downstream`),l=Rt(Lt(e.uniqueId,s,c,r,n),n).filter(e=>e.resources.length>0),u=ge(Array.from(r.values()),n),d=l.length,f=o===`summary`?176:212,p=o===`summary`?64:80,m=o===`summary`?14:18,h=o===`summary`?104:160,g=o===`summary`?24:40,_=o===`summary`?40:56,v=o===`summary`?40:52,y=_*2+d*f+Math.max(0,d-1)*h,b=Math.max(1,...l.map(e=>e.resources.length)),x=v*2+b*p+Math.max(0,b-1)*g,S=new Map;l.forEach((t,n)=>{let r=t.resources.length*p+Math.max(0,t.resources.length-1)*g,i=v+(x-v*2-r)/2,a=_+n*(f+h);t.resources.forEach((n,r)=>{let o=i+r*(p+g),{depth:l,side:d}=It(n.uniqueId,e.uniqueId,s,c),f=u.get(n.uniqueId);S.set(n.uniqueId,{resource:n,x:a,y:o,column:t.column,depth:l,side:d,passCount:f?.pass??0,failCount:(f?.fail??0)+(f?.error??0)})})});let C=new Set(S.keys()),w=[];for(let e of C){let t=n[e];if(t)for(let n of t.downstream.map(e=>e.uniqueId))C.has(n)&&w.push({from:e,to:n})}return{upstreamMap:s,downstreamMap:c,columnNodes:l,nodeLayouts:S,graphEdges:w,svgWidth:y,svgHeight:x,hasRelatedNodes:S.size>1&&((t?.upstreamCount??0)>0||(t?.downstreamCount??0)>0),nodeWidth:f,nodeHeight:p,nodeRadius:m,displayMode:o}}function Bt(e,t){if(!e)return new Set;let n=new Set([e]);for(let r of t)r.from===e&&n.add(r.to),r.to===e&&n.add(r.from);return n}function Vt(e){return Array.from(new Set(Array.from(e.values()).map(e=>e.resource.resourceType))).sort((e,t)=>{let n=Ft(e)-Ft(t);return n===0?e.localeCompare(t):n})}var Ht={positive:`var(--bg-success-soft)`,warning:`var(--bg-warning-soft)`,danger:`var(--bg-danger-soft)`,neutral:`var(--bg-surface-muted)`},Ut=`var(--bg-success-soft)`,Wt=`var(--bg-danger-soft)`,Gt=`var(--dbt-type-generic-soft)`,Kt={model:`var(--dbt-type-model-soft)`,source:`var(--dbt-type-source-soft)`,seed:`var(--dbt-type-seed-soft)`,snapshot:`var(--dbt-type-snapshot-soft)`,test:`var(--dbt-type-test-soft)`,unit_test:`var(--dbt-type-test-soft)`,metric:`var(--dbt-type-metric-soft)`,semantic_model:`var(--dbt-type-semantic-model-soft)`,exposure:`var(--dbt-type-exposure-soft)`,macro:`var(--dbt-type-macro-soft)`,operation:`var(--dbt-type-operation-soft)`,sql_operation:`var(--dbt-type-operation-soft)`},qt={model:`var(--dbt-type-model)`,source:`var(--dbt-type-source)`,seed:`var(--dbt-type-seed)`,snapshot:`var(--dbt-type-snapshot)`,test:`var(--dbt-type-test)`,unit_test:`var(--dbt-type-test)`,metric:`var(--dbt-type-metric)`,semantic_model:`var(--dbt-type-semantic-model)`,exposure:`var(--dbt-type-exposure)`,macro:`var(--dbt-type-macro)`,operation:`var(--dbt-type-operation)`,sql_operation:`var(--dbt-type-operation)`};function Jt(e,t){switch(t){case`status`:return Ht[e.statusTone??`neutral`];case`type`:return Kt[e.resourceType]??Gt;case`coverage`:return e.description?Ut:Wt}}function Yt(e,t){switch(t){case`status`:return e.statusTone??`neutral`;case`type`:return e.resourceType;case`coverage`:return e.description?`documented`:`undocumented`}}function Xt(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Zt(e){return e.split(`_`).map(e=>Xt(e)).join(` `)}function Qt(e,t){switch(e){case`status`:{let e=new Set;for(let n of t.values())e.add(n.resource.statusTone??`neutral`);return[`positive`,`warning`,`danger`,`neutral`].map(e=>({key:e,label:Xt(e),color:Ht[e]}))}case`type`:return Vt(t).map(e=>({key:e,label:Zt(e),color:Kt[e]??Gt,borderColor:qt[e]??`var(--dbt-type-generic)`}));case`coverage`:return[{key:`documented`,label:`Documented`,color:Ut},{key:`undocumented`,label:`No description`,color:Wt}]}}function $t(e,t,n,r){if(n.size===0)return{nodeLayouts:e.nodeLayouts,graphEdges:e.graphEdges};let i=new Map;for(let[a,o]of e.nodeLayouts.entries())(a===r||n.has(Yt(o.resource,t)))&&i.set(a,o);let a=new Set(i.keys());return{nodeLayouts:i,graphEdges:e.graphEdges.filter(e=>a.has(e.from)&&a.has(e.to))}}function en({label:e,value:t,setValue:n,disabled:r=!1}){return(0,U.jsxs)(`div`,{className:`lineage-stepper${r?` lineage-stepper--disabled`:``}`,children:[(0,U.jsx)(`span`,{className:`lineage-stepper__label`,children:e}),(0,U.jsxs)(`div`,{className:`lineage-stepper__controls`,children:[(0,U.jsx)(`button`,{type:`button`,className:`lineage-stepper__button`,disabled:r||t<=1,onClick:()=>n(e=>Mt(e-1)),children:`−`}),(0,U.jsx)(`span`,{className:`lineage-stepper__value`,children:t}),(0,U.jsx)(`button`,{type:`button`,className:`lineage-stepper__button`,disabled:r||t>=3,onClick:()=>n(e=>Mt(e+1)),children:`+`})]})]})}function tn(e,t,n){return n?`all`:e===t&&e>=1&&e<=3?String(e):`custom`}function nn({upstreamDepth:e,downstreamDepth:t,allDepsMode:n,setUpstreamDepth:r,setDownstreamDepth:i,setAllDepsMode:a}){let o=tn(e,t,n),s=e=>{if(e===`all`){a(!0);return}let t=Number(e);a(!1),r(t),i(t)};return(0,U.jsxs)(`div`,{className:`shared-depth-selector`,children:[(0,U.jsx)(`span`,{className:`shared-depth-selector__label`,children:`Depth`}),[`1`,`2`,`3`,`all`].map(e=>(0,U.jsx)(`button`,{type:`button`,className:o===e?F:I,onClick:()=>s(e),children:e===`all`?`All`:e},e)),o===`custom`&&(0,U.jsx)(`span`,{className:`shared-depth-selector__state`,children:`Custom`})]})}function rn({lensMode:e,setLensMode:t}){return(0,U.jsxs)(`div`,{className:`lens-selector`,children:[(0,U.jsx)(`span`,{className:`lens-selector__label`,children:`Lens`}),[{value:`type`,label:`Type`},{value:`status`,label:`Status`},{value:`coverage`,label:`Coverage`}].map(({value:n,label:r})=>(0,U.jsx)(`button`,{type:`button`,className:e===n?F:I,onClick:()=>t(n),children:r},n))]})}var an={width:248,height:176},on={width:220,height:120},sn={x:10,y:8};function cn(e){return 16+e.length*6.2}function ln({anchorX:e,anchorY:t,width:n,height:r,offset:i=6,margin:a=12}){let o=window.innerWidth,s=window.innerHeight,c=e+i,l=t+i;return c+n+a>o&&(c=e-n-i),l+r+a>s&&(l=t-r-i),c=Math.min(Math.max(a,c),Math.max(a,o-n-a)),l=Math.min(Math.max(a,l),Math.max(a,s-r-a)),{x:c,y:l}}function un({model:e,onSelectResource:t,lensMode:n=`type`,activeLegendKeys:r,onToggleLegendKey:i,fullscreen:a=!1,displayMode:o=`focused`}){let{nodeLayouts:s,svgHeight:c,svgWidth:l,nodeWidth:u,nodeHeight:f,nodeRadius:p}=e,[m,h]=(0,d.useState)(null),[g,_]=(0,d.useState)(null),[v,y]=(0,d.useState)(1),[b,x]=(0,d.useState)(0),[S,C]=(0,d.useState)(null),[w,T]=(0,d.useState)(new Map),[E,D]=(0,d.useState)(null),O=(0,d.useRef)(null),k=(0,d.useRef)(null),A=(0,d.useRef)(null),j=(0,d.useRef)(null),M=(0,d.useMemo)(()=>Array.from(s.values()).find(e=>e.side===`selected`)?.resource.uniqueId??``,[s]),N=(0,d.useMemo)(()=>$t(e,n,r,M),[r,n,e,M]),P=N.nodeLayouts,F=N.graphEdges;(0,d.useEffect)(()=>{queueMicrotask(()=>{y(1),T(new Map);let e=A.current;e&&(e.scrollLeft=0,e.scrollTop=0)})},[e]),(0,d.useLayoutEffect)(()=>{let e=j.current;e&&A.current&&(A.current.scrollLeft=e.x,A.current.scrollTop=e.y,j.current=null)},[v]),(0,d.useEffect)(()=>{if(!E)return;let e=()=>D(null),t=t=>{t.key===`Escape`&&e()};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[E]),(0,d.useEffect)(()=>{let e=A.current;if(!e)return;let t=t=>{if(t.preventDefault(),t.ctrlKey){let n=e.getBoundingClientRect(),r=t.clientX-n.left,i=t.clientY-n.top,a=e.scrollLeft,o=e.scrollTop;y(e=>{let n=Math.max(.4,Math.min(2.5,e*(1-t.deltaY*.003)));return j.current={x:(a+r)/e*n-r,y:(o+i)/e*n-i},n})}else e.scrollLeft+=t.deltaX,e.scrollTop+=t.deltaY};return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},[]);let L=(0,d.useCallback)((e,t,n)=>{let r=w.get(e);return{x:t+(r?.dx??0),y:n+(r?.dy??0)}},[w]),ee=g!==null&&P.has(g)?g:null,R=ee?P.get(ee)??null:null;if((0,d.useLayoutEffect)(()=>{if(!R)return;let e=A.current;if(!e)return;let{x:t,y:n}=L(R.resource.uniqueId,R.x,R.y),r=t*v,i=n*v,a=u*v,o=f*v,s=r+a-an.width-sn.x,c=i+sn.y;s<e.scrollLeft+12&&(s=r+sn.x),c+an.height>e.scrollTop+e.clientHeight&&(c=i+o-an.height-sn.y),s=Math.min(Math.max(e.scrollLeft+12,s),Math.max(e.scrollLeft+12,e.scrollLeft+e.clientWidth-an.width-12)),c=Math.min(Math.max(e.scrollTop+12,c),Math.max(e.scrollTop+12,e.scrollTop+e.clientHeight-an.height-12)),C({left:s,top:c})},[R,v,u,f,b,L]),P.size===0)return(0,U.jsx)(`div`,{className:`dependency-graph dependency-graph--empty dependency-graph--${o}${a?` dependency-graph--fullscreen`:``}`,children:(0,U.jsx)(W,{icon:`↔`,headline:`No lineage available`,subtext:`This resource could not be placed on the lineage canvas.`})});let z=Qt(n,s),B=Bt(m,F),te=B.size>0;return(0,U.jsxs)(`div`,{className:`dependency-graph dependency-graph--${o}${a?` dependency-graph--fullscreen`:``}`,children:[(0,U.jsxs)(`div`,{className:`lineage-legend`,children:[(0,U.jsx)(`span`,{className:`lineage-legend__mode-label`,children:n===`status`?`By status`:n===`type`?`By type`:`By coverage`}),z.map(e=>(0,U.jsxs)(`button`,{type:`button`,className:`lineage-legend__item${r.size===0||r.has(e.key)?` lineage-legend__item--active`:` lineage-legend__item--inactive`}`,onClick:()=>i(e.key),children:[(0,U.jsx)(`span`,{className:`lineage-legend__swatch`,style:{background:e.color,borderColor:e.borderColor}}),e.label]},e.key)),r.size>0&&(0,U.jsx)(`button`,{type:`button`,className:`lineage-legend__clear`,onClick:()=>r.forEach(e=>{i(e)}),children:`Clear`})]}),(0,U.jsxs)(`div`,{className:`lineage-graph__viewport-toolbar`,children:[(0,U.jsxs)(`div`,{className:`lineage-graph__zoom-controls`,children:[(0,U.jsx)(`button`,{type:`button`,className:I,onClick:()=>y(e=>Math.max(.4,e-.1)),children:`−`}),(0,U.jsxs)(`button`,{type:`button`,className:I,onClick:()=>y(1),children:[Math.round(v*100),`%`]}),(0,U.jsx)(`button`,{type:`button`,className:I,onClick:()=>y(e=>Math.min(2.5,e+.1)),children:`+`}),w.size>0&&(0,U.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:()=>T(new Map),children:`Reset layout`})]}),(0,U.jsxs)(`p`,{className:`lineage-graph__summary`,children:[P.size,` nodes · `,e.upstreamMap.size,` upstream ·`,` `,e.downstreamMap.size,` downstream`]})]}),(0,U.jsx)(`div`,{ref:A,className:`lineage-graph__viewport${a?` lineage-graph__viewport--fullscreen`:``}`,onPointerDown:e=>{let t=A.current;t&&(O.current={pointerId:e.pointerId,startX:e.clientX,startY:e.clientY,scrollLeft:t.scrollLeft,scrollTop:t.scrollTop},t.setPointerCapture(e.pointerId))},onPointerMove:e=>{let t=O.current,n=A.current;!t||!n||t.pointerId!==e.pointerId||(n.scrollLeft=t.scrollLeft-(e.clientX-t.startX),n.scrollTop=t.scrollTop-(e.clientY-t.startY))},onPointerUp:e=>{let t=A.current;O.current?.pointerId===e.pointerId&&t&&t.releasePointerCapture(e.pointerId),O.current=null},onPointerCancel:()=>{O.current=null},onScroll:()=>x(e=>e+1),children:(0,U.jsxs)(`div`,{className:`lineage-graph__canvas`,style:{width:`${l*v}px`,height:`${c*v}px`},children:[(0,U.jsxs)(`div`,{className:`lineage-graph__zoom-layer`,style:{width:`${l}px`,height:`${c}px`,transform:`scale(${v})`},children:[(0,U.jsxs)(`svg`,{className:`dependency-graph__svg`,viewBox:`0 0 ${l} ${c}`,preserveAspectRatio:`xMidYMid meet`,"aria-hidden":`true`,children:[F.map(e=>{let t=P.get(e.from),n=P.get(e.to);if(!t||!n)return null;let r=L(e.from,t.x,t.y),i=L(e.to,n.x,n.y),a=r.x+u,o=r.y+f/2,s=i.x,c=i.y+f/2,l=Math.max(28,Math.abs(s-a)*.34);return(0,U.jsx)(`path`,{d:`M ${a} ${o} C ${a+l} ${o}, ${s-l} ${c}, ${s} ${c}`,className:`dependency-graph__edge${!te||B.has(e.from)||B.has(e.to)?``:` dependency-graph__edge--dimmed`}`},`${e.from}->${e.to}`)}),Array.from(P.values()).map(e=>{let t=!te||B.has(e.resource.uniqueId),{x:r,y:i}=L(e.resource.uniqueId,e.x,e.y),a=String(e.passCount),s=String(e.failCount),c=cn(a),l=cn(s),d=o===`summary`?i+f-20:i+f-23,m=o===`summary`?15:17,h=m/2;return(0,U.jsxs)(`g`,{children:[(0,U.jsx)(`rect`,{x:r,y:i,width:u,height:f,rx:p,className:`dependency-graph__node${e.side===`selected`?` dependency-graph__node--selected`:``}${t?``:` dependency-graph__node--dimmed`}`,stroke:e.side===`selected`?`var(--graph-node-selected-stroke)`:void 0,strokeWidth:e.side===`selected`?3:0,style:{fill:Jt(e.resource,n)}}),(0,U.jsx)(`foreignObject`,{x:r+16,y:o===`summary`?i+10:i+14,width:u-32,height:24,children:(0,U.jsxs)(`div`,{className:`dependency-graph__node-title-row`,title:`${e.resource.name} (${G(e.resource.resourceType)})`,children:[(0,U.jsx)(`span`,{className:`dependency-graph__node-title-icon`,title:G(e.resource.resourceType),children:(0,U.jsx)(Pe,{resourceType:e.resource.resourceType})}),(0,U.jsx)(`span`,{className:`dependency-graph__node-title-text`,children:e.resource.name})]})}),Nt(e.resource.resourceType)&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`rect`,{x:r+16,y:d,width:c,height:m,rx:h,className:`dependency-graph__node-stat-pill dependency-graph__node-stat-pill--pass`}),(0,U.jsx)(`text`,{x:r+16+c/2,y:d+m/2,className:`dependency-graph__node-stat dependency-graph__node-stat--pass`,textAnchor:`middle`,dominantBaseline:`middle`,children:a}),(0,U.jsx)(`rect`,{x:r+16+c+6,y:d,width:l,height:m,rx:h,className:`dependency-graph__node-stat-pill ${e.failCount===0?`dependency-graph__node-stat-pill--neutral`:`dependency-graph__node-stat-pill--fail`}`}),(0,U.jsx)(`text`,{x:r+16+c+6+l/2,y:d+m/2,className:`dependency-graph__node-stat ${e.failCount===0?`dependency-graph__node-stat--neutral`:`dependency-graph__node-stat--fail`}`,textAnchor:`middle`,dominantBaseline:`middle`,children:s})]})]},e.resource.uniqueId)})]}),(0,U.jsx)(`div`,{className:`dependency-graph__interactive-layer`,children:Array.from(P.values()).map(e=>{let{x:n,y:r}=L(e.resource.uniqueId,e.x,e.y),i={left:`${n/l*100}%`,top:`${r/c*100}%`,width:`${u/l*100}%`,height:`${f/c*100}%`};return(0,U.jsx)(`button`,{type:`button`,className:`dependency-graph__hotspot dependency-graph__hotspot--${e.side}`,style:i,onClick:()=>{k.current?.hasMoved||t(e.resource.uniqueId)},onContextMenu:t=>{t.preventDefault();let n=ln({anchorX:t.clientX,anchorY:t.clientY,width:on.width,height:on.height});D({x:n.x,y:n.y,nodeId:e.resource.uniqueId})},onMouseEnter:()=>{h(e.resource.uniqueId),_(e.resource.uniqueId)},onMouseLeave:()=>{h(null),_(null)},title:e.resource.uniqueId,onPointerDown:t=>{t.stopPropagation();let n=w.get(e.resource.uniqueId)??{dx:0,dy:0};k.current={nodeId:e.resource.uniqueId,pointerId:t.pointerId,startClientX:t.clientX,startClientY:t.clientY,initialDx:n.dx,initialDy:n.dy,hasMoved:!1},t.currentTarget.setPointerCapture(t.pointerId)},onPointerMove:t=>{let n=k.current;if(!n||n.pointerId!==t.pointerId||n.nodeId!==e.resource.uniqueId)return;let r=t.clientX-n.startClientX,i=t.clientY-n.startClientY;(Math.abs(r)>4||Math.abs(i)>4)&&(n.hasMoved=!0);let a=n.initialDx+r/v,o=n.initialDy+i/v;T(e=>{let t=new Map(e);return t.set(n.nodeId,{dx:a,dy:o}),t})},onPointerUp:e=>{k.current?.pointerId===e.pointerId&&(e.currentTarget.releasePointerCapture(e.pointerId),setTimeout(()=>{k.current=null},0))},onPointerCancel:()=>{k.current=null}},e.resource.uniqueId)})})]}),R&&S&&(0,U.jsxs)(`div`,{className:`graph-node-tooltip`,style:{left:S.left,top:S.top},"aria-hidden":`true`,children:[(0,U.jsx)(`div`,{className:`graph-node-tooltip__name`,children:R.resource.name}),(0,U.jsxs)(`div`,{className:`graph-node-tooltip__meta`,children:[G(R.resource.resourceType),R.resource.packageName?` · ${R.resource.packageName}`:``]}),R.resource.status&&(0,U.jsxs)(`div`,{className:`graph-node-tooltip__status graph-node-tooltip__status--${R.resource.statusTone}`,children:[R.resource.status,R.resource.executionTime==null?``:` · ${V(R.resource.executionTime)}`]}),R.resource.description&&(0,U.jsx)(`div`,{className:`graph-node-tooltip__description`,children:R.resource.description})]})]})}),E&&(0,U.jsxs)(`div`,{className:`graph-context-menu`,style:{left:E.x,top:E.y},onPointerDown:e=>e.stopPropagation(),children:[(0,U.jsx)(`button`,{type:`button`,className:`graph-context-menu__item`,onClick:()=>{t(E.nodeId),D(null)},children:`Focus on this node`}),(()=>{let e=P.get(E.nodeId);return e?(0,U.jsx)(`div`,{className:`graph-context-menu__label`,children:e.resource.name}):null})()]})]})}function dn({resource:e,dependencySummary:t,dependencyIndex:n,resourceById:r,upstreamDepth:i,downstreamDepth:a,allDepsMode:o,lensMode:s,activeLegendKeys:c,setUpstreamDepth:l,setDownstreamDepth:u,setAllDepsMode:f,setLensMode:p,setActiveLegendKeys:m,onSelectResource:h,displayMode:g=`focused`,openFullscreen:_=!1,onFullscreenChange:v,fullscreenScope:y=`viewport`}){let[b,x]=(0,d.useState)(!1);(0,d.useEffect)(()=>{x(_)},[_]);let S=(0,d.useCallback)(e=>{x(e),v?.(e)},[v]);(0,d.useEffect)(()=>{if(!b)return;let e=e=>{e.key===`Escape`&&S(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[b,S]),(0,d.useEffect)(()=>{if(!b||typeof document>`u`)return;let e=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=e}},[b]);let C=e=>{m(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},w=(0,d.useMemo)(()=>zt({resource:e,dependencySummary:t,dependencyIndex:n,resourceById:r,upstreamDepth:o?20:i,downstreamDepth:o?20:a,displayMode:g}),[o,n,t,g,a,e,r,i]),T=()=>(0,U.jsxs)(`div`,{className:`lineage-toolbar`,children:[(0,U.jsx)(rn,{lensMode:s,setLensMode:p}),(0,U.jsx)(nn,{upstreamDepth:i,downstreamDepth:a,allDepsMode:o,setUpstreamDepth:l,setDownstreamDepth:u,setAllDepsMode:f}),(0,U.jsx)(en,{label:`Upstream`,value:i,setValue:l,disabled:o}),(0,U.jsx)(en,{label:`Downstream`,value:a,setValue:u,disabled:o}),c.size>0&&(0,U.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:()=>m(new Set),children:`Clear filters`}),g===`focused`&&!b?(0,U.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:()=>S(!0),children:`Expand`}):null]}),E=g===`summary`?(0,U.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:()=>S(!0),children:`Expand lineage`}):void 0,D=b?(0,U.jsxs)(`div`,{className:`lineage-dialog lineage-dialog--${y}`,role:`dialog`,"aria-modal":`true`,children:[(0,U.jsx)(`button`,{type:`button`,className:`lineage-dialog__backdrop`,"aria-label":`Dismiss lineage overlay`,onClick:()=>S(!1)}),(0,U.jsxs)(`section`,{className:`lineage-dialog__panel`,children:[(0,U.jsxs)(`div`,{className:`lineage-dialog__header`,children:[(0,U.jsxs)(`div`,{className:`lineage-dialog__header-main`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`p`,{className:`eyebrow`,children:`Lineage`}),(0,U.jsx)(`h3`,{children:e.name}),(0,U.jsx)(`p`,{className:`lineage-dialog__subtitle`,children:`Exact dependency graph with staged upstream and downstream columns.`})]}),(0,U.jsx)(`button`,{type:`button`,className:`lineage-dialog__close`,"aria-label":`Close lineage graph`,onClick:()=>S(!1),children:(0,U.jsx)(`span`,{"aria-hidden":`true`,children:`×`})})]}),(0,U.jsx)(`div`,{className:`lineage-dialog__toolbar`,children:T()})]}),(0,U.jsx)(un,{model:w,onSelectResource:h,lensMode:s,activeLegendKeys:c,onToggleLegendKey:C,displayMode:`focused`,fullscreen:!0})]})]}):null;return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(K,{title:g===`summary`?`Lineage graph`:`Lineage`,subtitle:g===`summary`?void 0:`Exact upstream and downstream lineage for ${e.name}.`,headerRight:g===`focused`?T():E,children:(0,U.jsxs)(`div`,{className:`lineage-summary lineage-summary--${g}`,children:[(0,U.jsxs)(`div`,{className:`lineage-summary__stats`,children:[(0,U.jsxs)(`div`,{className:`lineage-summary__stat`,children:[(0,U.jsx)(`span`,{children:`Selected resource`}),(0,U.jsx)(`strong`,{children:G(e.resourceType)})]}),(0,U.jsxs)(`div`,{className:`lineage-summary__stat`,children:[(0,U.jsx)(`span`,{children:`Direct upstream`}),(0,U.jsx)(`strong`,{children:t?.upstreamCount??0})]}),(0,U.jsxs)(`div`,{className:`lineage-summary__stat`,children:[(0,U.jsx)(`span`,{children:`Direct downstream`}),(0,U.jsx)(`strong`,{children:t?.downstreamCount??0})]})]}),(0,U.jsx)(un,{model:w,onSelectResource:h,lensMode:s,activeLegendKeys:c,onToggleLegendKey:C,displayMode:g})]})}),D&&typeof document<`u`&&(0,jt.createPortal)(D,document.body)]})}function fn(e,t){let[n,r]=(0,d.useState)(null),[i,a]=(0,d.useState)(null),[o,s]=(0,d.useState)(!1),[c,l]=(0,d.useState)(null),u=(0,d.useRef)(0);return(0,d.useEffect)(()=>{u.current+=1;let t=u.current;if(!e){r(null),a(null),l(null),s(!1);return}let n=!1;return r(null),a(null),s(!0),l(null),kt(e).then(e=>{n||u.current!==t||(r(e.compiledCode),a(e.rawCode))}).catch(e=>{n||u.current!==t||(r(null),a(null),l(e instanceof Error?e.message:`Failed to load SQL`))}).finally(()=>{!n&&u.current===t&&s(!1)}),()=>{n=!0}},[t,e]),{compiledCode:n,rawCode:i,loading:o,error:c}}function pn({size:e=24,label:t}){return(0,U.jsxs)(`svg`,{className:`spinner`,width:e,height:e,viewBox:`0 0 24 24`,fill:`none`,"aria-hidden":t?void 0:`true`,"aria-label":t,role:t?`img`:void 0,children:[(0,U.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`,stroke:`var(--panel-border)`,strokeWidth:`2.5`}),(0,U.jsx)(`path`,{d:`M12 2 A10 10 0 0 1 22 12`,stroke:`var(--accent)`,strokeWidth:`2.5`,strokeLinecap:`round`})]})}var X=`Not captured`,mn=`Not executed`,hn=new Set(`SELECT FROM WHERE WITH AS JOIN ON GROUP BY ORDER LIMIT HAVING UNION CASE WHEN THEN ELSE END LEFT RIGHT INNER OUTER CROSS DISTINCT NULL AND OR NOT IN IS BETWEEN LIKE EXISTS INSERT INTO UPDATE SET DELETE CREATE TABLE VIEW REPLACE IF ASC DESC USING AT ZONE INTERVAL QUALIFY WINDOW ROWS RANGE UNBOUNDED PRECEDING FOLLOWING CURRENT ROW PARTITION OVER`.split(` `)),gn=new Set(`SUM COUNT AVG MAX MIN COALESCE CAST IFF IF ROW_NUMBER RANK DENSE_RANK NTILE LEAD LAG FIRST_VALUE LAST_VALUE NVL NVL2 NULLIF GREATEST LEAST TRIM LTRIM RTRIM UPPER LOWER LENGTH SUBSTR SUBSTRING REPLACE SPLIT CONCAT DATE YEAR MONTH DAY HOUR MINUTE SECOND DATEDIFF DATEADD CURRENT_DATE CURRENT_TIMESTAMP TO_DATE TO_TIMESTAMP TO_NUMBER TO_VARCHAR TRY_CAST CONVERT FLOOR CEIL ROUND ABS MOD SQRT LOG EXP ARRAY_AGG LISTAGG STRING_AGG GROUP_CONCAT FLATTEN UNNEST GENERATE_SERIES`.split(` `));function _n(e){let t=[],n=0,r=e.length;for(;n<r;){if(e.startsWith(`/*`,n)){let r=e.indexOf(`*/`,n+2),i=r===-1?e.slice(n):e.slice(n,r+2);t.push({type:`comment`,value:i}),n+=i.length;continue}if(e.startsWith(`--`,n)){let r=e.indexOf(`
|
|
2
|
+
`,n),i=r===-1?e.slice(n):e.slice(n,r+1);t.push({type:`comment`,value:i}),n+=i.length;continue}if(e[n]===`'`){let i=n+1;for(;i<r;){if(e[i]===`'`&&e[i-1]!==`\\`){i++;break}i++}t.push({type:`string`,value:e.slice(n,i)}),n=i;continue}let i=/^[0-9]+(\.[0-9]+)?/.exec(e.slice(n));if(i&&(n===0||!/[a-zA-Z_]/.test(e[n-1]))){t.push({type:`number`,value:i[0]}),n+=i[0].length;continue}let a=/^[a-zA-Z_][a-zA-Z0-9_]*/.exec(e.slice(n));if(a){let e=a[0],r=e.toUpperCase(),i=hn.has(r)?`keyword`:gn.has(r)?`function`:`identifier`;t.push({type:i,value:e}),n+=e.length;continue}if(/[=<>!|+\-*/%^&~]/.test(e[n])){t.push({type:`operator`,value:e[n]}),n++;continue}if(/[(),;.[\]{}]/.test(e[n])){t.push({type:`punctuation`,value:e[n]}),n++;continue}t.push({type:`plain`,value:e[n]}),n++}return t}function vn({sql:e}){return(0,U.jsx)(`pre`,{className:`sql-panel`,children:(0,U.jsx)(`code`,{children:_n(e).map((e,t)=>e.type===`plain`||e.type===`identifier`?e.value:(0,U.jsx)(`span`,{className:`sql-token-${e.type}`,children:e.value},t))})})}function yn({label:e,values:t}){return t.length===0?null:(0,U.jsxs)(`div`,{className:`definition-list`,children:[(0,U.jsx)(`span`,{children:e}),(0,U.jsx)(`div`,{className:`definition-list__values`,children:t.map(e=>(0,U.jsx)(`span`,{className:`definition-pill`,children:e},e))})]})}function bn(e){return(0,U.jsxs)(`div`,{className:`definition-panel`,children:[(0,U.jsxs)(`div`,{className:`detail-grid`,children:[(0,U.jsxs)(`div`,{className:`detail-stat`,children:[(0,U.jsx)(`span`,{children:`Label`}),(0,U.jsx)(`strong`,{children:e.label??X})]}),(0,U.jsxs)(`div`,{className:`detail-stat`,children:[(0,U.jsx)(`span`,{children:`Metric type`}),(0,U.jsx)(`strong`,{children:e.metricType??X})]}),(0,U.jsxs)(`div`,{className:`detail-stat`,children:[(0,U.jsx)(`span`,{children:`Source`}),(0,U.jsx)(`strong`,{children:e.sourceReference??X})]}),(0,U.jsxs)(`div`,{className:`detail-stat`,children:[(0,U.jsx)(`span`,{children:`Time granularity`}),(0,U.jsx)(`strong`,{children:e.timeGranularity??X})]})]}),e.expression&&(0,U.jsxs)(`div`,{className:`definition-block`,children:[(0,U.jsx)(`span`,{children:`Expression`}),(0,U.jsx)(`pre`,{children:e.expression})]}),e.description&&(0,U.jsxs)(`div`,{className:`definition-block`,children:[(0,U.jsx)(`span`,{children:`Description`}),(0,U.jsx)(`p`,{children:e.description})]}),(0,U.jsx)(yn,{label:`Measures`,values:e.measures}),(0,U.jsx)(yn,{label:`Referenced metrics`,values:e.metrics}),(0,U.jsx)(yn,{label:`Filters`,values:e.filters})]})}function xn(e){return(0,U.jsxs)(`div`,{className:`definition-panel`,children:[(0,U.jsxs)(`div`,{className:`detail-grid`,children:[(0,U.jsxs)(`div`,{className:`detail-stat`,children:[(0,U.jsx)(`span`,{children:`Label`}),(0,U.jsx)(`strong`,{children:e.label??X})]}),(0,U.jsxs)(`div`,{className:`detail-stat`,children:[(0,U.jsx)(`span`,{children:`Source model`}),(0,U.jsx)(`strong`,{children:e.sourceReference??X})]}),(0,U.jsxs)(`div`,{className:`detail-stat`,children:[(0,U.jsx)(`span`,{children:`Default time dimension`}),(0,U.jsx)(`strong`,{children:e.defaultTimeDimension??X})]})]}),(0,U.jsx)(yn,{label:`Entities`,values:e.entities}),(0,U.jsx)(yn,{label:`Measures`,values:e.measures}),(0,U.jsx)(yn,{label:`Dimensions`,values:e.dimensions}),e.description&&(0,U.jsxs)(`div`,{className:`definition-block`,children:[(0,U.jsx)(`span`,{children:`Description`}),(0,U.jsx)(`p`,{children:e.description})]})]})}function Sn({showsDefinition:e,definition:t,sqlText:n,codeLoading:r,codeError:i}){return e&&t?t.kind===`metric`?bn(t):xn(t):r?(0,U.jsxs)(`div`,{className:`asset-sql-loading`,"aria-busy":`true`,children:[(0,U.jsx)(pn,{size:28,label:`Loading SQL`}),(0,U.jsx)(`span`,{className:`asset-sql-loading__label`,children:`Loading SQL…`})]}):i?(0,U.jsx)(W,{icon:`⚠`,headline:`Could not load SQL`,subtext:i}):n?(0,U.jsx)(vn,{sql:n}):(0,U.jsx)(W,{icon:`⌘`,headline:e?`No definition available`:`No SQL available`,subtext:e?`This resource does not expose enough definition metadata in the current artifacts.`:`This resource does not expose compiled or raw SQL in the current artifacts.`})}function Cn({showsDefinition:e,definition:t,sqlText:n,codeLoading:r,codeError:i,hasCompiledSql:a}){return(0,U.jsx)(K,{title:e?`Definition`:`SQL`,subtitle:e?t?.kind===`metric`?`Structured metric definition captured from the manifest.`:`Structured semantic model definition captured from the manifest.`:a?`Compiled SQL for the selected resource.`:`Raw SQL captured from the manifest.`,children:Sn({showsDefinition:e,definition:t,sqlText:n,codeLoading:r,codeError:i})})}function wn({resource:e,dependencySummary:t}){return(0,U.jsxs)(K,{title:`Asset summary`,subtitle:`Core execution and discovery context for the selected asset.`,children:[(0,U.jsxs)(`div`,{className:`detail-grid`,children:[(0,U.jsxs)(`div`,{className:`detail-stat`,children:[(0,U.jsx)(`span`,{children:`Status`}),(0,U.jsx)(`strong`,{children:e.status??mn})]}),(0,U.jsxs)(`div`,{className:`detail-stat`,children:[(0,U.jsx)(`span`,{children:`Execution time`}),(0,U.jsx)(`strong`,{children:V(e.executionTime)})]}),(0,U.jsxs)(`div`,{className:`detail-stat`,children:[(0,U.jsx)(`span`,{children:`Thread`}),(0,U.jsx)(`strong`,{children:e.threadId??`n/a`})]}),(0,U.jsxs)(`div`,{className:`detail-stat`,children:[(0,U.jsx)(`span`,{children:`Path`}),(0,U.jsx)(`strong`,{children:ie(e)??`n/a`})]}),(0,U.jsxs)(`div`,{className:`detail-stat`,children:[(0,U.jsx)(`span`,{children:`Direct upstream`}),(0,U.jsx)(`strong`,{children:t?.upstreamCount??0})]}),(0,U.jsxs)(`div`,{className:`detail-stat`,children:[(0,U.jsx)(`span`,{children:`Direct downstream`}),(0,U.jsx)(`strong`,{children:t?.downstreamCount??0})]})]}),e.description?(0,U.jsx)(`p`,{className:`resource-spotlight__description`,children:e.description}):(0,U.jsx)(`p`,{className:`resource-spotlight__description resource-spotlight__description--muted`,children:`No description was captured for this asset. Catalog-oriented metadata can surface here when present in the manifest.`})]})}function Tn({resource:e}){return(0,U.jsx)(K,{title:`Runtime`,subtitle:`Execution evidence linked to the selected asset.`,children:(0,U.jsxs)(`div`,{className:`detail-grid`,children:[(0,U.jsxs)(`div`,{className:`detail-stat`,children:[(0,U.jsx)(`span`,{children:`Status`}),(0,U.jsx)(`strong`,{children:e.status??mn})]}),(0,U.jsxs)(`div`,{className:`detail-stat`,children:[(0,U.jsx)(`span`,{children:`Execution time`}),(0,U.jsx)(`strong`,{children:V(e.executionTime)})]}),(0,U.jsxs)(`div`,{className:`detail-stat`,children:[(0,U.jsx)(`span`,{children:`Thread`}),(0,U.jsx)(`strong`,{children:e.threadId??`n/a`})]})]})})}function En({dependencySummary:e}){return(0,U.jsxs)(K,{title:`Tests`,subtitle:`Quality evidence and related dependency posture.`,children:[(0,U.jsxs)(`div`,{className:`detail-grid`,children:[(0,U.jsxs)(`div`,{className:`detail-stat`,children:[(0,U.jsx)(`span`,{children:`Direct upstream`}),(0,U.jsx)(`strong`,{children:e?.upstreamCount??0})]}),(0,U.jsxs)(`div`,{className:`detail-stat`,children:[(0,U.jsx)(`span`,{children:`Direct downstream`}),(0,U.jsx)(`strong`,{children:e?.downstreamCount??0})]})]}),(0,U.jsx)(`p`,{className:`resource-spotlight__description`,children:`Use Runs to inspect detailed execution and quality evidence linked to this asset.`})]})}function Dn({resource:e,analysis:t,onSelectResource:n,assetViewState:r,onAssetViewStateChange:i,lineageViewState:a,onLineageViewStateChange:o,onNavigateTo:s}){let c=(0,d.useMemo)(()=>new Map(t.resources.map(e=>[e.uniqueId,e])),[t.resources]),l=a.upstreamDepth,u=a.downstreamDepth,f=a.allDepsMode,p=a.lensMode,m=a.activeLegendKeys,h=e=>o(t=>({...t,upstreamDepth:typeof e==`function`?e(t.upstreamDepth):e})),g=e=>o(t=>({...t,downstreamDepth:typeof e==`function`?e(t.downstreamDepth):e})),_=e=>o(t=>({...t,allDepsMode:typeof e==`function`?e(t.allDepsMode):e})),v=e=>o(t=>({...t,lensMode:e,activeLegendKeys:new Set})),y=e=>o(t=>({...t,activeLegendKeys:typeof e==`function`?e(t.activeLegendKeys):e})),b=r.activeTab,[x,S]=(0,d.useState)(!1),C=(0,d.useRef)({summary:null,lineage:null,sql:null,runtime:null,tests:null});(0,d.useEffect)(()=>{if(!e)return;let t=C.current[b];if(!t)return;let n=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;t.scrollIntoView({block:`start`,behavior:n?`auto`:`smooth`})},[b,e]);let{compiledCode:w,rawCode:T,loading:E,error:D}=fn(e?.uniqueId??null,t);if(!e)return(0,U.jsx)(`div`,{className:`workspace-card`,children:(0,U.jsx)(W,{icon:`🔍`,headline:`No resource selected`,subtext:`Adjust the explorer filters or search to find the resource you're looking for.`})});let O=t.dependencyIndex[e.uniqueId],k=w??T??void 0,A=w!=null&&w!==``,j=e.definition??null,M=j?.kind===`metric`||j?.kind===`semantic_model`,N=(0,U.jsxs)(`div`,{className:`resource-detail__subtitle`,children:[(0,U.jsx)(Ne,{resourceType:e.resourceType}),(0,U.jsx)(`span`,{className:`resource-detail__package`,children:e.packageName||`workspace`})]}),P={resource:e,dependencySummary:O,dependencyIndex:t.dependencyIndex,resourceById:c,upstreamDepth:l,downstreamDepth:u,allDepsMode:f,lensMode:p,activeLegendKeys:m,setUpstreamDepth:h,setDownstreamDepth:g,setAllDepsMode:_,setLensMode:v,setActiveLegendKeys:y,onSelectResource:e=>{n(e),o(t=>({...t,selectedResourceId:e})),i(t=>({...t,selectedResourceId:e,activeTab:`lineage`}))}};return(0,U.jsxs)(`div`,{className:`workspace-view asset-workspace`,children:[(0,U.jsxs)(`section`,{className:`catalog-detail-hero`,children:[(0,U.jsxs)(`div`,{className:`catalog-detail-hero__content`,children:[(0,U.jsx)(`p`,{className:`eyebrow`,children:`Selected asset`}),(0,U.jsx)(`h3`,{children:e.name}),N]}),(0,U.jsx)(`div`,{className:`asset-hero__actions`,"aria-label":`Asset actions`,children:(0,U.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:()=>s(`timeline`,{resourceId:e.uniqueId,executionId:e.uniqueId}),children:`Open in Timeline`})})]}),(0,U.jsx)(`div`,{className:`asset-workspace__body`,children:(0,U.jsxs)(`div`,{className:`asset-workspace__sections`,children:[(0,U.jsx)(`section`,{id:`asset-section-summary`,ref:e=>{C.current.summary=e},className:`asset-workspace__section`,children:(0,U.jsx)(wn,{resource:e,dependencySummary:O})}),(0,U.jsx)(`section`,{id:`asset-section-lineage`,ref:e=>{C.current.lineage=e},className:`asset-workspace__section`,children:(0,U.jsx)(dn,{...P,displayMode:`summary`,openFullscreen:x,onFullscreenChange:S})}),(0,U.jsx)(`section`,{id:`asset-section-sql`,ref:e=>{C.current.sql=e},className:`asset-workspace__section`,children:(0,U.jsx)(Cn,{showsDefinition:M,definition:j,sqlText:k,codeLoading:E,codeError:D,hasCompiledSql:A})}),(0,U.jsx)(`section`,{id:`asset-section-runtime`,ref:e=>{C.current.runtime=e},className:`asset-workspace__section`,children:(0,U.jsx)(Tn,{resource:e})}),(0,U.jsx)(`section`,{id:`asset-section-tests`,ref:e=>{C.current.tests=e},className:`asset-workspace__section`,children:(0,U.jsx)(En,{dependencySummary:O})})]})})]})}var On=200;function kn({analysis:e,resource:t,onSelectResource:n,assetViewState:r,onAssetViewStateChange:i,lineageViewState:a,onLineageViewStateChange:o,onInvestigationSelectionChange:s,onNavigateTo:c}){let[l,u]=(0,d.useState)(``),[f,p]=(0,d.useState)([]),[m,h]=(0,d.useState)(!1),[g,_]=(0,d.useState)(``),v=(0,d.useRef)(0);(0,d.useEffect)(()=>{let e=l.trim(),t=e?On:0,n=window.setTimeout(()=>{if(!e){v.current+=1,p([]),h(!1);return}v.current+=1;let t=v.current;h(!0),At(e).then(e=>{v.current===t&&p(e)}).catch(()=>{v.current===t&&p([])}).finally(()=>{v.current===t&&h(!1)})},t);return()=>window.clearTimeout(n)},[l]);let y=e=>{e&&(i(t=>({...t,selectedResourceId:e,activeTab:`lineage`})),o(t=>({...t,rootResourceId:e,selectedResourceId:e})),s(t=>({...t,selectedResourceId:e,sourceLens:`inventory`})))};return(0,U.jsx)(Ie,{title:`Inventory`,description:`Browse, filter, and inspect all workspace assets.`,className:`inventory-view`,suppressHeader:t!=null,children:t?(0,U.jsx)(Dn,{analysis:e,resource:t,onSelectResource:e=>{n(e),s(t=>({...t,selectedResourceId:e,sourceLens:`inventory`}))},assetViewState:r,onAssetViewStateChange:i,lineageViewState:a,onLineageViewStateChange:o,onNavigateTo:c}):(0,U.jsx)(`div`,{className:`inventory-empty-state`,children:(0,U.jsxs)(`div`,{className:`inventory-empty-state__inner`,children:[(0,U.jsx)(W,{icon:`◱`,headline:`Select an asset to inspect`,subtext:`Use the browser panel on the left to find and select a model, source, seed, or other asset.`}),(0,U.jsxs)(`div`,{className:`inventory-empty-state__lineage-pick`,role:`group`,"aria-label":`Jump to lineage for an asset`,children:[(0,U.jsx)(`label`,{className:`inventory-empty-state__lineage-label`,htmlFor:`inventory-lineage-search`,children:`Or search for an asset to open its lineage graph`}),(0,U.jsx)(`input`,{id:`inventory-lineage-search`,type:`search`,className:`inventory-empty-state__lineage-search`,value:l,onChange:e=>{u(e.target.value),_(``)},placeholder:`Name, type, package, or unique id…`,autoComplete:`off`,enterKeyHint:`search`}),m&&(0,U.jsx)(`p`,{className:`inventory-empty-state__lineage-hint`,"aria-live":`polite`,children:`Searching…`}),f.length>0&&(0,U.jsx)(`ul`,{className:`inventory-empty-state__lineage-suggestions`,role:`listbox`,"aria-label":`Matching assets`,children:f.map(e=>(0,U.jsx)(`li`,{role:`none`,children:(0,U.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":g===e.uniqueId,className:g===e.uniqueId?`inventory-lineage-suggestion inventory-lineage-suggestion--active`:`inventory-lineage-suggestion`,onClick:()=>{v.current+=1,_(e.uniqueId),u(`${e.name} (${e.resourceType})`),p([]),h(!1)},children:[(0,U.jsx)(`span`,{className:`inventory-lineage-suggestion__name`,children:e.name}),(0,U.jsxs)(`span`,{className:`inventory-lineage-suggestion__meta`,children:[e.resourceType,e.packageName?` · ${e.packageName}`:``]})]})},e.uniqueId))}),(0,U.jsx)(`button`,{type:`button`,className:`workspace-pill`,disabled:!g,onClick:()=>y(g),children:`Open lineage graph`})]})]})})})}function An(e){let t=[],n=new Map;for(let r of e)if(R.has(r.resourceType)){if(r.parentId!=null){let e=n.get(r.parentId)??[];e.push(r),n.set(r.parentId,e)}}else t.push(r);return t.sort((e,t)=>{let n=e.start-t.start;return n===0?t.duration-e.duration:n}),t.map(e=>{let t=n.get(e.unique_id)??[],{lanes:r,laneCount:i}=jn(t);return{item:e,tests:t,lanes:r,laneCount:i}})}function jn(e){if(e.length===0)return{lanes:[],laneCount:0};let t=[...e].sort((e,t)=>e.start-t.start),n=[],r=[];for(let e of t){let t=-1;for(let r=0;r<n.length;r++)if((n[r]??0)<=e.start){t=r,n[r]=e.end;break}t===-1&&(t=n.length,n.push(e.end)),r.push({item:e,lane:t})}return{lanes:r,laneCount:n.length}}var Mn=.78,Z={color:`var(--text-soft)`,fontSize:`0.82rem`},Nn=`dbt-tools.timelineTimezone`;function Q(e){return e>=6e4?`${(e/6e4).toFixed(0)}m`:e>=1e4?`${(e/1e3).toFixed(0)}s`:e>=1e3?`${(e/1e3).toFixed(1)}s`:`${e.toFixed(0)}ms`}function Pn(e,t){return new Intl.DateTimeFormat(`en-US`,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1,timeZone:t}).format(new Date(e))}function Fn(){let e=Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`,t=Intl.supportedValuesOf,n=t?.(`timeZone`)??[];return Array.from(new Set([e,`UTC`,...n]))}function In(){let e=Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`;try{return window.localStorage.getItem(`dbt-tools.timelineTimezone`)||e}catch{return e}}function Ln(e){return[`success`,`pass`,`passed`].includes(e.trim().toLowerCase())}function Rn(e){return[`skipped`,`no op`].includes(e.trim().toLowerCase())}function zn(e){let t=e.trim().toLowerCase();return!Ln(t)&&!Rn(t)}function Bn(e,t){if(t<=e)return[];let n=t-e,r=[50,100,200,500,1e3,2e3,5e3,1e4,2e4,3e4,6e4,12e4].find(e=>n/e<=6)??12e4,i=[],a=Math.ceil(e/r)*r;e>0&&i.push({ms:e,label:Q(e)});for(let n=a;n<=t;n+=r)n<=e||n>=t||i.push({ms:n,label:Q(n)});return i.push({ms:t,label:Q(t)}),i}function Vn(e,t){return!e||!t||!R.has(t.resourceType)||!R.has(e.resourceType)||t.parentId==null||e.parentId==null?!1:t.parentId===e.parentId}var Hn={model:0,source:1,source_freshness:1,snapshot:2,seed:3,exposure:4,metric:5,semantic_model:6,test:7,unit_test:8,macro:9,analysis:10};function Un(e){return e?Hn[e]??98:99}function Wn(e,t,n){return[...e].sort((e,r)=>{let i=n.get(e),a=n.get(r),o=Vn(i,t)?0:1,s=Vn(a,t)?0:1;if(o!==s)return o-s;let c=Un(i?.resourceType),l=Un(a?.resourceType);if(c!==l)return c-l;let u=Math.abs((i?.end??0)-t.start),d=Math.abs((a?.end??0)-t.start);return u===d?e.localeCompare(r):u-d})}function Gn(e,t,n){return t||e.length<=n?e:e.slice(0,n)}function Kn(e,t,n){return[...e].sort((e,r)=>{let i=n.get(e),a=n.get(r),o=Vn(i,t)?0:1,s=Vn(a,t)?0:1;if(o!==s)return o-s;let c=Un(i?.resourceType),l=Un(a?.resourceType);if(c!==l)return c-l;let u=Math.abs((i?.start??0)-t.end),d=Math.abs((a?.start??0)-t.end);return u===d?e.localeCompare(r):u-d})}function qn(e){return`${e.fromId}\t${e.toId}`}function Jn(e,t){if(e.hop!==t.hop)return e.hop-t.hop;let n=e.leg===`upstream`?0:1,r=t.leg===`upstream`?0:1;if(n!==r)return n-r;let i=e.fromId.localeCompare(t.fromId);return i===0?e.toId.localeCompare(t.toId):i}function Yn(e,t,n,r,i,a){return Gn(Wn(t.inbound.filter(e=>i(e)),n,r),a.showAllUpstream,a.maxUpstreamEdges).map(t=>({fromId:t,toId:e,tier:Vn(r.get(t),n)?`secondary`:`primary`,hop:1,leg:`upstream`}))}function Xn(e,t,n,r,i,a){return Gn(Kn(t.outbound.filter(e=>i(e)),n,r),a.showAllDownstream,a.maxDownstreamEdges).map(t=>({fromId:e,toId:t,tier:`downstream`,hop:1,leg:`downstream`}))}function Zn(e,t,n,r,i,a,o){return{upExt:a?tr(e,t,n,r,i):{edges:[],truncated:!1},downExt:o?nr(e,t,n,r,i):{edges:[],truncated:!1}}}function Qn(e,t,n){let r=new Map;for(let t of e)r.set(qn(t),t);for(let e of t){let t=qn(e);r.has(t)||r.set(t,e)}for(let e of n){let t=qn(e);r.has(t)||r.set(t,e)}return[...r.values()].sort(Jn)}function $n(e,t){let n=t.timelineAdjacency[e];if(!n)return!1;let r=t.direction===`upstream`?n.inbound:n.outbound;for(let n of r){if(!t.inTimeline(n))continue;let r=t.direction===`upstream`?n:e,i=t.direction===`upstream`?e:n,a=qn({fromId:r,toId:i});if(!t.seen.has(a)){if(t.seen.add(a),t.hop>=2&&(t.edges.push({fromId:r,toId:i,tier:t.direction===`upstream`?`primary`:`downstream`,hop:t.hop,leg:t.direction}),t.edges.length>=t.maxEdges))return!0;t.nextFrontier.add(n)}}return!1}function er(e,t,n,r,i,a){let o=e=>n.has(e),s=new Set,c=[],l=!1,u=new Set([e]);for(let e=1;e<=r&&c.length<i;e++){let n=new Set,r={hop:e,direction:a,timelineAdjacency:t,inTimeline:o,seen:s,edges:c,maxEdges:i,nextFrontier:n};for(let e of u)if(l=$n(e,r),l)break;if(u=n,l||u.size===0)break}return{edges:c,truncated:l}}function tr(e,t,n,r,i){return er(e,t,n,r,i,`upstream`)}function nr(e,t,n,r,i){return er(e,t,n,r,i,`downstream`)}function rr(e,t,n){if(!e||!t)return 0;let r=t[e];if(!r)return 0;let i=0;for(let e of r.inbound)n.has(e)&&(i+=1);return i}function ir(e,t,n){if(!e||!t)return 0;let r=t[e];if(!r)return 0;let i=0;for(let e of r.outbound)n.has(e)&&(i+=1);return i}function ar(e,t){return!e||!t?0:t[e]?.inbound.length??0}function or(e,t){return!e||!t?0:t[e]?.outbound.length??0}function sr(e,t){t.includeUpstream&&!t.showAllUpstream&&t.upstreamOnTimelineCount>8&&e.push(`Showing ${t.upstreamShownCount} of ${t.upstreamOnTimelineCount} direct dependencies.`),t.includeDownstream&&!t.showAllDownstream&&t.outboundOnTimelineCount>8&&e.push(`Showing ${t.downstreamShownCount} of ${t.outboundOnTimelineCount} direct dependents.`)}function cr(e,t,n){t>0&&e.push(`${t} direct dependenc${t===1?`y`:`ies`} not on this timeline (filters or scope).`),n>0&&e.push(`${n} direct dependent${n===1?``:`s`} not on this timeline (filters or scope).`)}function lr(e,t){if(!t.showExtendedDeps&&t.hiddenUp===0&&t.hiddenDown===0&&t.onTimelineNeighborSum>0&&e.push(`Transitive dependency lines are off for this timeline focus.`),t.showExtendedDeps&&t.extendedTruncated){let n=t.edges.filter(e=>e.hop>=2).length;n>0?e.push(`Showing ${n} transitive-on-timeline line${n===1?``:`s`}. Extended paths may be truncated by caps.`):e.push(`Extended dependency lines may be truncated by caps.`)}}function ur(e){let{focusId:t,timelineAdjacency:n,bundleIndexById:r,edges:i,focusOptions:a,extendedTruncated:o}=e,s=a.includeUpstream??!0,c=a.includeDownstream,l=a.extendedDeps?.enabled===!0,u=[],d=rr(t,n,r),f=i.filter(e=>e.toId===t&&e.hop===1&&e.leg===`upstream`).length,p=ir(t,n,r),m=i.filter(e=>e.hop===1&&e.leg===`downstream`).length;sr(u,{includeUpstream:s,showAllUpstream:a.showAllUpstream,upstreamOnTimelineCount:d,upstreamShownCount:f,includeDownstream:c,showAllDownstream:a.showAllDownstream,outboundOnTimelineCount:p,downstreamShownCount:m});let h=ar(t,n),g=or(t,n),_=s?Math.max(0,h-d):0,v=c?Math.max(0,g-p):0;return cr(u,_,v),lr(u,{showExtendedDeps:l,hiddenUp:_,hiddenDown:v,onTimelineNeighborSum:d+p,extendedTruncated:o,edges:i}),u.length>0?u.join(` `):void 0}function dr(e,t,n,r,i){if(!e||!t)return{edges:[],extendedTruncated:!1};let a=t[e],o=n.get(e);if(!a||!o||!r.has(e))return{edges:[],extendedTruncated:!1};let s=e=>r.has(e),c=i.includeUpstream??!0,l=i.includeDownstream,u=[...c?Yn(e,a,o,n,s,i):[],...l?Xn(e,a,o,n,s,i):[]],d=i.extendedDeps;if(!d?.enabled)return{edges:[...u].sort(Jn),extendedTruncated:!1};let{upExt:f,downExt:p}=Zn(e,t,r,d.maxHops??3,d.maxEdgesPerDirection??12,c,l);return{edges:Qn(u,f.edges,p.edges),extendedTruncated:f.truncated||p.truncated}}function fr(e,t,n,r,i,a){let o=n[e];if(!o)return null;let s=32+(r[e]??0)-i;if(o.item.unique_id===t)return s+6+14/2;if(!a)return null;for(let{item:e,lane:n}of o.lanes)if(e.unique_id===t)return s+44+5+n*14+10/2;return null}function pr(e){let{edge:t,itemById:n,bundleIndexById:r,bundles:i,rowOffsets:a,scrollTop:o,showTests:s,effectiveLabelW:c,rangeStart:l,rangeEnd:u,chartW:d}=e,f=n.get(t.fromId),p=n.get(t.toId),m=r.get(t.fromId),h=r.get(t.toId);if(f==null||p==null||m===void 0||h===void 0)return``;let g=fr(m,t.fromId,i,a,o,s),_=fr(h,t.toId,i,a,o,s);if(g==null||_==null)return``;let v=Math.max(1,u-l),y=c+(f.start+f.duration-l)/v*d,b=c+(p.start-l)/v*d,x=Math.abs(b-y)*.4;return`M${y},${g} C${y+x},${g} ${b-x},${_} ${b},${_}`}var mr=8,hr=8;function gr(e,t,n){if((e.hop??1)>=2)return e.leg===`upstream`?{stroke:t.slate,strokeWidth:1,strokeDasharray:`3 4`,opacity:.36,markerEnd:`url(#${n.secondary})`}:{stroke:t.accent,strokeWidth:1,strokeDasharray:`4 5`,opacity:.4,markerEnd:`url(#${n.downstream})`};switch(e.tier){case`secondary`:return{stroke:t.slate,strokeWidth:1,strokeDasharray:`4 3`,opacity:.42,markerEnd:`url(#${n.secondary})`};case`downstream`:return{stroke:t.accent,strokeWidth:1.5,strokeDasharray:`5 4`,opacity:.62,markerEnd:`url(#${n.downstream})`};default:return{stroke:t.accent,strokeWidth:2,strokeDasharray:`6 4`,opacity:.88,markerEnd:`url(#${n.primary})`}}}function _r({id:e,fill:t}){return(0,U.jsx)(`marker`,{id:e,viewBox:`0 0 ${mr} ${hr}`,refX:mr-.5,refY:hr/2,markerWidth:mr,markerHeight:hr,orient:`auto`,markerUnits:`userSpaceOnUse`,children:(0,U.jsx)(`path`,{d:`M0,0 L${mr},${hr/2} L0,${hr} Z`,fill:t})})}function vr({edges:e,focusId:t,itemById:n,bundleIndexById:r,bundles:i,rowOffsets:a,canvasWidth:o,effectiveLabelW:s,rangeStart:c,rangeEnd:l,scrollTop:u,viewportH:d,theme:f=`light`,showTests:p=!0}){if(t==null||e.length===0)return null;let m=h(f),g=o-s-24,_=`gantt-edge-mk-primary`,v=`gantt-edge-mk-secondary`,y=`gantt-edge-mk-downstream`,b={primary:_,secondary:v,downstream:y};return(0,U.jsxs)(`svg`,{style:{position:`absolute`,top:0,left:0,width:`100%`,height:d,pointerEvents:`none`,overflow:`hidden`,zIndex:5},"aria-hidden":!0,children:[(0,U.jsxs)(`defs`,{children:[(0,U.jsx)(_r,{id:_,fill:m.accent}),(0,U.jsx)(_r,{id:v,fill:m.slate}),(0,U.jsx)(_r,{id:y,fill:m.accent})]}),e.map((e,t)=>{let o=pr({edge:e,itemById:n,bundleIndexById:r,bundles:i,rowOffsets:a,scrollTop:u,showTests:p,effectiveLabelW:s,rangeStart:c,rangeEnd:l,chartW:g});if(!o)return null;let{stroke:d,strokeWidth:f,strokeDasharray:h,opacity:_,markerEnd:v}=gr(e,m,b);return(0,U.jsx)(`path`,{d:o,stroke:d,strokeWidth:f,strokeDasharray:h,fill:`none`,opacity:_,markerEnd:v},`${e.fromId}-${e.toId}-${e.tier}-${e.hop}-${e.leg}-${t}`)})]})}var yr=16,br=0,xr=12;function Sr(e){return e.split(/[\s_-]+/).filter(Boolean).map(e=>e[0].toUpperCase()+e.slice(1).toLowerCase()).join(` `)}function Cr({hoverX:e,hoverY:t,frameWidth:n,frameHeight:r,tooltipWidth:i,tooltipHeight:a,offsetX:o=yr,offsetY:s=br,margin:c=xr}){let l=Math.max(n,i+c*2),u=Math.max(r,a+c*2),d=e+o;d+i>l-c&&(d=e-i-o);let f=t+s;return f+a>u-c&&(f=u-a-c),d=Math.min(Math.max(c,d),Math.max(c,l-i-c)),f=Math.min(Math.max(c,f),Math.max(c,u-a-c)),{left:d,top:f}}function wr({hover:e,frameWidth:t,frameHeight:n,runStartedAt:r,canShowTimestamps:i,timeZone:a,testStats:o,dependencyEdgeHint:s}){let c=(0,d.useRef)(null),[l,u]=(0,d.useState)(()=>Cr({hoverX:e.x,hoverY:e.y,frameWidth:t,frameHeight:n,tooltipWidth:220,tooltipHeight:160}));return(0,d.useLayoutEffect)(()=>{let r=c.current;if(!r)return;let i=Cr({hoverX:e.x,hoverY:e.y,frameWidth:t,frameHeight:n,tooltipWidth:r.offsetWidth,tooltipHeight:r.offsetHeight});u(e=>e.left===i.left&&e.top===i.top?e:i)},[n,t,e.x,e.y,e.item.unique_id]),(0,U.jsxs)(`div`,{ref:c,className:`chart-tooltip`,style:{position:`absolute`,left:l.left,top:l.top,pointerEvents:`none`,zIndex:20,minWidth:180},children:[(0,U.jsx)(`div`,{style:{fontWeight:700,marginBottom:`0.3rem`},children:e.item.name||e.item.unique_id}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{style:Z,children:`Status: `}),e.item.status]}),e.item.resourceType&&(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{style:Z,children:`Type: `}),e.item.resourceType]}),e.item.materialized?(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{style:Z,children:`Materialization: `}),Sr(e.item.materialized)]}):null,i&&r!=null?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{style:Z,children:`Start: `}),Pn(r+e.item.start,a)]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{style:Z,children:`End: `}),Pn(r+e.item.end,a)]})]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{style:Z,children:`Start: `}),`+`,Q(e.item.start)]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{style:Z,children:`End: `}),`+`,Q(e.item.end)]})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{style:Z,children:`Duration: `}),Q(e.item.duration)]}),e.item.compileStart!=null&&e.item.compileEnd!=null&&e.item.compileEnd>e.item.compileStart&&(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{style:Z,children:`Compile: `}),Q(e.item.compileEnd-e.item.compileStart)]}),e.item.executeStart!=null&&e.item.executeEnd!=null&&e.item.executeEnd>e.item.executeStart&&(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{style:Z,children:`Execute: `}),Q(e.item.executeEnd-e.item.executeStart)]}),o&&o.pass+o.fail+o.error>0&&(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{style:Z,children:`Tests: `}),`✓`,o.pass,` · ✗`,o.fail+o.error]}),s?(0,U.jsxs)(`div`,{style:{marginTop:`0.35rem`},children:[(0,U.jsx)(`div`,{style:Z,children:`Dependency context`}),(0,U.jsx)(`div`,{children:s})]}):null]})}function Tr({canvasRef:e,scrollRef:t,edges:n,edgeFocusId:r,itemById:i,bundleIndexById:a,bundles:o,rowOffsets:s,containerWidth:c,effectiveLabelW:l,rangeStart:u,rangeEnd:f,scrollTop:p,viewportH:m,needsScroll:h,totalScrollH:g,theme:_,showTests:v,hover:y,runStartedAt:b,canShowTimestamps:x,timeZone:S,testStatsById:C,selectedId:w,onSelect:T,onPointer:E,onHoverClear:D,dependencyEdgeHint:O}){let k=(0,d.useRef)(null),[A,j]=(0,d.useState)(0);return(0,d.useLayoutEffect)(()=>{let e=k.current;if(!e)return;let t=()=>j(e.getBoundingClientRect().width);t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]),(0,U.jsxs)(`section`,{ref:k,className:`chart-frame`,style:{position:`relative`,userSelect:`none`},children:[(0,U.jsx)(`canvas`,{ref:e,style:{position:`absolute`,top:0,left:0,width:`100%`,height:m,pointerEvents:`none`,display:`block`}}),(0,U.jsx)(vr,{edges:n,focusId:r,itemById:i,bundleIndexById:a,bundles:o,rowOffsets:s,canvasWidth:c>0?c:600,effectiveLabelW:l,rangeStart:u,rangeEnd:f,scrollTop:p,viewportH:m,theme:_,showTests:v}),(0,U.jsx)(`div`,{ref:t,className:`chart-frame__viewport`,role:`region`,tabIndex:0,"aria-label":`Timeline chart viewport — use arrow keys to scroll`,style:{position:`relative`,height:m,overflowY:h?`auto`:`hidden`},onMouseMove:e=>E(e,`move`),onClick:e=>E(e,`click`),onKeyDown:e=>{if(e.key!==`Enter`&&e.key!==` `)return;e.preventDefault();let t=y?.item.unique_id??w;t&&T?.(t)},onMouseLeave:D,children:(0,U.jsx)(`div`,{style:{height:g}})}),y&&(0,U.jsx)(wr,{hover:y,frameWidth:A>0?A:c,frameHeight:m,runStartedAt:b,canShowTimestamps:x,timeZone:S,testStats:C?.get(y.item.unique_id),dependencyEdgeHint:O})]})}function Er({activeMode:e,onChange:t,activeTimeZone:n,timeZones:r,onTimeZoneChange:i}){return(0,U.jsx)(`div`,{className:`gantt-controls`,children:(0,U.jsxs)(`div`,{className:`gantt-controls__cluster`,children:[e===`timestamps`&&(0,U.jsxs)(`label`,{className:`gantt-timezone-select`,children:[(0,U.jsx)(`span`,{children:`Timezone`}),(0,U.jsx)(`select`,{value:n,onChange:e=>i(e.target.value),children:r.map(e=>(0,U.jsx)(`option`,{value:e,children:e},e))})]}),(0,U.jsxs)(`div`,{className:`gantt-mode-toggle`,children:[(0,U.jsx)(`button`,{type:`button`,className:e===`duration`?`active`:``,onClick:()=>t(`duration`),children:`Duration`}),(0,U.jsx)(`button`,{type:`button`,className:e===`timestamps`?`active`:``,onClick:()=>t(`timestamps`),children:`Timestamps`})]})]})})}var Dr=1e3;function Or(e,t){let n=t?.get(e.item.unique_id);return n&&n.fail+n.error>0?!0:zn(e.item.status)||e.tests.some(e=>zn(e.status))}function kr(e,t,n){return{start:Math.max(0,Math.min(e,n)),end:Math.max(0,Math.min(t,n))}}function Ar({bundles:e,maxEnd:t,timeWindow:n,testStatsById:r,onChange:i}){let a=(0,d.useRef)(null),[o,s]=(0,d.useState)(null),c=(0,d.useRef)(null),l=Math.min(Math.max(Dr,t*.01),t),u=n?.start??0,f=n?.end??t,p=n!=null;function m(e){let n=a.current;if(!n)return 0;let r=n.clientWidth;return r<=0||t<=0?0:(e-n.getBoundingClientRect().left)/r*t}function h(e,r){if(!a.current||a.current.clientWidth<=0||t<=0)return;let i=m(e.clientX);c.current={mode:r,startPx:e.clientX,initialStart:r===`create`?i:u,initialEnd:r===`create`?i:f,currentStart:r===`create`?i:u,currentEnd:r===`create`?i:f},s(r===`create`?{start:i,end:i}:n),a.current.setPointerCapture(e.pointerId)}function g(e){let n=c.current,r=a.current;if(!n||!r||t<=0)return;let i=r.clientWidth;if(i<=0)return;let o=(e.clientX-n.startPx)/i*t,u=n.initialEnd-n.initialStart,d=m(e.clientX);if(n.mode===`create`){let e={start:Math.min(n.initialStart,d),end:Math.max(n.initialStart,d)};c.current={...n,currentStart:e.start,currentEnd:e.end},s(e);return}if(n.mode===`pan`){let e=Math.min(Math.max(0,n.initialStart+o),t-u),r={start:e,end:e+u};c.current={...n,currentStart:r.start,currentEnd:r.end},s(r);return}if(n.mode===`start`){let e={start:Math.min(Math.max(0,n.initialStart+o),n.initialEnd-l),end:n.initialEnd};c.current={...n,currentStart:e.start,currentEnd:e.end},s(e);return}let f=Math.max(Math.min(t,n.initialEnd+o),n.initialStart+l),p={start:n.initialStart,end:f};c.current={...n,currentStart:p.start,currentEnd:p.end},s(p)}function _(e){let n=c.current;if(n&&a.current?.hasPointerCapture(e.pointerId)&&a.current.releasePointerCapture(e.pointerId),n){let e=kr(n.currentStart,n.currentEnd,t),r=e.end-e.start;(n.mode!==`create`||r>=l)&&(e.start<=0&&e.end>=t?i(null):i(e))}c.current=null,s(null)}let v=o??(p?{start:u,end:f}:{start:0,end:t}),y=v==null?0:Math.max(0,Math.min(100,v.start/t*100)),b=v==null?0:Math.max(0,Math.min(100,v.end/t*100)),x=Math.max(0,b-y);return(0,U.jsxs)(`div`,{className:`gantt-brush-wrap`,children:[(0,U.jsxs)(`div`,{className:`gantt-brush__header`,children:[(0,U.jsx)(`p`,{className:`gantt-brush__title`,children:`Time range`}),(0,U.jsx)(`button`,{type:`button`,className:`workspace-pill`,disabled:!p,onClick:()=>i(null),children:`Reset zoom`})]}),(0,U.jsxs)(`div`,{ref:a,className:`gantt-brush`,onPointerDown:e=>{e.target!==e.currentTarget||e.button!==0||h(e,`create`)},onPointerMove:g,onPointerUp:_,onPointerCancel:_,role:`slider`,"aria-label":`Timeline time range`,"aria-valuemin":0,"aria-valuemax":Math.round(t),"aria-valuenow":Math.round(u),"aria-valuetext":`${Math.round(u)} to ${Math.round(f)} ms`,children:[e.map(e=>{let n=Math.max(0,e.item.start),i=Math.max(n,e.item.end),a=n/t*100,o=Math.max(.2,(i-n)/t*100),s=Or(e,r);return(0,U.jsx)(`span`,{className:s?`gantt-brush__bar gantt-brush__bar--issue`:`gantt-brush__bar`,"data-issue":s?`true`:`false`,style:{left:`${a}%`,width:`${o}%`}},e.item.unique_id)}),v!=null&&(0,U.jsxs)(`div`,{className:p||o!=null?`gantt-brush__selection`:`gantt-brush__selection gantt-brush__selection--default`,"data-default-range":p||o!=null?`false`:`true`,style:{left:`${y}%`,width:`${x}%`},onPointerDown:e=>h(e,`pan`),children:[(0,U.jsx)(`span`,{className:`gantt-brush__handle gantt-brush__handle--start`,onPointerDown:e=>{e.stopPropagation(),h(e,`start`)}}),(0,U.jsx)(`span`,{className:`gantt-brush__handle gantt-brush__handle--end`,onPointerDown:e=>{e.stopPropagation(),h(e,`end`)}})]})]})]})}function jr(e,t){return t&&e.laneCount>0?49+e.laneCount*14+5:44}function Mr(e,t){let n=[],r=[],i=0;for(let a of e){n.push(i);let e=jr(a,t);r.push(e),i+=e}return{rowOffsets:n,rowHeights:r,totalHeight:i}}function Nr(e,t,n){if(e.length===0)return-1;let r=0,i=e.length-1;for(;r<=i;){let a=Math.floor((r+i)/2),o=e[a]??0,s=t[a]??44;if(o>n)i=a-1;else if(o+s<=n)r=a+1;else return a}return-1}function Pr(e,t,n,r,i,a,o,s){let{rowOffsets:c,rowHeights:l,showTests:u}=n;if(!s)return null;let d=e.currentTarget.getBoundingClientRect(),f=e.clientX-d.left,p=e.clientY-d.top;if(p<32||f<0)return null;let m=Nr(c,l,p-32+r);if(m<0||m>=t.length)return null;let h=t[m];if(!h)return null;let g=Math.max(1,a-i),_=s.getBoundingClientRect().width-o-24,v=32+(c[m]??0)-r;if(f<o)return{item:h.item,x:f,y:p};let y=o,b=o+_,x=o+(h.item.start-i)/g*_,S=o+(h.item.end-i)/g*_,C=Math.max(y,Math.min(x,S)),w=Math.max(2,Math.min(b,Math.max(x,S))-C);if(f>=C&&f<=C+w)return{item:h.item,x:f,y:p};if(u&&h.lanes.length>0)for(let{item:e,lane:t}of h.lanes){let n=o+(e.start-i)/g*_,r=o+(e.end-i)/g*_,a=Math.max(y,Math.min(n,r)),s=Math.max(2,Math.min(b,Math.max(n,r))-a),c=v+44+5+t*14;if(f>=a&&f<=a+s&&p>=c&&p<=c+10)return{item:e,x:f,y:p}}return null}function Fr(e,t,n){let{bundles:r,layout:i,scrollTop:a,rangeStart:o,rangeEnd:s,effectiveLabelW:c,canvas:l,setHover:u,onSelect:d}=n,f=Pr(e,r,i,a,o,s,c,l);if(!f){t===`move`?u(null):d?.(null);return}if(t===`move`){u({item:f.item,x:f.x,y:f.y});return}d?.(f.item.unique_id)}var Ir={...g};function Lr(e,t=`light`){return(t===`dark`?_:g)[e.toLowerCase()]??h(t).textSoft}({...O(`light`)});function Rr(e,t=`light`){let n=O(t);return(e&&n[e])??h(t).borderSubtle}var zr=3,Br=2.25;function Vr(e){return(e?.fail??0)+(e?.error??0)>0}function Hr(e,t,n,r,i,a){r<2*a&&(a=r/2),i<2*a&&(a=i/2),e.beginPath(),e.moveTo(t+a,n),e.arcTo(t+r,n,t+r,n+i,a),e.arcTo(t+r,n+i,t,n+i,a),e.arcTo(t,n+i,t,n,a),e.arcTo(t,n,t+r,n,a),e.closePath()}function Ur(e,t,n,r,i,a){Hr(e,t,n,r,i,a),e.fill()}function Wr(e,t,n,r,i,a){Hr(e,t,n,r,i,a),e.stroke()}function Gr(e,t,n,r,i,a,o){t%2==0&&(e.fillStyle=a?o.rowStripeHover:o.rowStripe,e.globalAlpha=i?1:.35,e.fillRect(0,n,r,44),e.globalAlpha=1)}function Kr({ctx:e,item:t,rowY:n,labelW:r,xOffset:i,displayMode:a,runStartedAt:o,timeZone:s,emphasis:c,palette:l}){e.save(),e.globalAlpha=c,e.beginPath(),e.rect(i,n,r-10-i,44),e.clip(),e.textAlign=`left`,e.font=`12px "IBM Plex Sans", "Avenir Next", sans-serif`,e.fillStyle=l.labelText,e.fillText(t.name||t.unique_id,i+2,n+14);let u=a===`timestamps`&&o!=null?Pn(o+t.start,s):`+${Q(t.start)}`,d=a===`timestamps`&&o!=null?Pn(o+t.end,s):`+${Q(t.end)}`;e.font=`10px "IBM Plex Mono", "Fira Mono", monospace`,e.fillStyle=l.metaText,e.fillText(`${u} → ${d}`,i+2,n+34),e.restore()}function qr({ctx:e,item:t,rowY:n,rangeStart:r,rangeEnd:i,chartW:a,labelW:o,emphasis:s,isHovered:c,attachedTestStats:l,palette:u,theme:d}){let f=Math.max(1,i-r),p=n+6,m=o+(t.start-r)/f*a,h=o+(t.end-r)/f*a,g=Math.min(m,h),_=Math.max(2,h-m),v=Vr(l),y=zn(t.status)||v;e.save(),e.globalAlpha=s,e.fillStyle=A(t.resourceType,d),Ur(e,g,p,_,14,3);let b=t.compileStart,x=t.compileEnd;if(b!=null&&x!=null&&x>b){let t=o+(b-r)/f*a,n=o+(x-r)/f*a,i=Math.max(g,t),s=Math.min(g+_,n)-i;s>.5&&(e.save(),Hr(e,g,p,_,14,3),e.clip(),e.fillStyle=d===`dark`?`rgba(0, 0, 0, 0.24)`:`rgba(0, 0, 0, 0.12)`,e.fillRect(i,p,s,14),e.restore())}v&&Ln(t.status)&&(e.fillStyle=u.testFailStripe,Ur(e,g,p+14-4,_,4,2)),e.strokeStyle=y?u.testFailStripe:Lr(t.status,d),e.lineWidth=y?zr:2,Wr(e,g,p,_,14,3),e.restore(),c&&(e.save(),e.globalAlpha=1,e.strokeStyle=u.barHoverStroke,e.lineWidth=1.5,Wr(e,g,p,_,14,3),e.restore())}function Jr({ctx:e,test:t,chipY:n,rangeStart:r,rangeEnd:i,chartW:a,labelW:o,palette:s,theme:c,emphasis:l,isHovered:u}){let d=Math.max(1,i-r),f=o+(t.start-r)/d*a,p=o+(t.end-r)/d*a,m=Math.min(f,p),h=Math.max(4,p-f),g=zn(t.status);e.save(),e.globalAlpha=l,e.fillStyle=A(t.resourceType,c),Ur(e,m,n,h,10,2);let _=t.compileStart,v=t.compileEnd;if(_!=null&&v!=null&&v>_){let t=o+(_-r)/d*a,i=o+(v-r)/d*a,s=Math.max(m,t),l=Math.min(m+h,i)-s;l>.5&&(e.save(),Hr(e,m,n,h,10,2),e.clip(),e.fillStyle=c===`dark`?`rgba(0, 0, 0, 0.24)`:`rgba(0, 0, 0, 0.12)`,e.fillRect(s,n,l,10),e.restore())}e.strokeStyle=g?s.testFailStripe:Lr(t.status,c),e.lineWidth=g?Br:1.5,Wr(e,m,n,h,10,2),e.restore(),h>=40&&(e.save(),e.globalAlpha=l,e.beginPath(),e.rect(m+2,n,h-4,10),e.clip(),e.font=`9px "IBM Plex Sans", "Avenir Next", sans-serif`,e.fillStyle=s.labelText,e.textAlign=`left`,e.textBaseline=`middle`,e.fillText(t.name,m+2,n+10/2),e.restore()),u&&(e.save(),e.globalAlpha=1,e.strokeStyle=s.barHoverStroke,e.lineWidth=1,Wr(e,m,n,h,10,2),e.restore())}function Yr(e,t){let n=e.getContext(`2d`);if(!n)return null;let r=e.getBoundingClientRect(),i=window.devicePixelRatio||1,a=r.width,o=r.height;return a===0||o===0?null:(e.width=a*i,e.height=o*i,n.scale(i,i),n.clearRect(0,0,a,o),{ctx:n,w:a,h:o,chartW:a-t-24})}function Xr({ctx:e,labelW:t,chartW:n,h:r,rangeStart:i,rangeEnd:a,displayMode:o,runStartedAt:s,timeZone:c,palette:l}){let u=Math.max(1,a-i),d=Bn(i,a);e.font=`11px 'IBM Plex Mono', 'Fira Mono', monospace`,e.textAlign=`center`,e.textBaseline=`middle`,e.fillStyle=l.axisTick;for(let a of d){let d=t+(a.ms-i)/u*n;e.strokeStyle=l.gridLine,e.lineWidth=1,e.beginPath(),e.moveTo(d,32),e.lineTo(d,r),e.stroke();let f=o===`timestamps`&&s!=null?Pn(s+a.ms,c):a.label;e.fillText(f,d,32/2)}}function Zr(e){let{ctx:t,bundle:n,rowIndex:r,rowY:i,w:a,labelW:o,chartW:s,rangeStart:c,rangeEnd:l,focusIds:u,hoveredId:d,displayMode:f,runStartedAt:p,timeZone:m,theme:h,palette:g,testStatsById:_,showTests:v}=e,y=u==null||u.has(n.item.unique_id)||n.lanes.some(e=>u.has(e.item.unique_id)),b=u==null||u.has(n.item.unique_id),x=d===n.item.unique_id,S=b?1:.18;if(Gr(t,r,i,a,y,x,g),Kr({ctx:t,item:n.item,rowY:i,labelW:o,xOffset:0,displayMode:f,runStartedAt:p,timeZone:m,emphasis:S,palette:g}),qr({ctx:t,item:n.item,rowY:i,rangeStart:c,rangeEnd:l,chartW:s,labelW:o,emphasis:S,isHovered:x,attachedTestStats:_?.get(n.item.unique_id),palette:g,theme:h}),!(!v||n.lanes.length===0))for(let{item:e,lane:r}of n.lanes){let n=i+44+5+r*14,a=d===e.unique_id;Jr({ctx:t,test:e,chipY:n,rangeStart:c,rangeEnd:l,chartW:s,labelW:o,palette:g,theme:h,emphasis:u==null||u.has(e.unique_id)?1:.18,isHovered:a})}}function Qr(e,t,n,r,{scrollTop:i,rangeStart:a,rangeEnd:o,displayMode:s,runStartedAt:c,focusIds:l,hoveredId:u,labelW:d=160,timeZone:f,testStatsById:p,theme:m=`light`,showTests:h=!1}){let g=Yr(e,d);if(!g)return;let{ctx:_,w:v,h:y,chartW:b}=g,x=N(m);if(Xr({ctx:_,labelW:d,chartW:b,h:y,rangeStart:a,rangeEnd:o,displayMode:s,runStartedAt:c,timeZone:f,palette:x}),t.length===0)return;let S=y-32,C=$r(n,i),w=ei(n,r,i,S);_.textBaseline=`middle`;for(let e=C;e<=w;e++){let r=t[e];if(!r)continue;let g=32+(n[e]??0)-i;Zr({ctx:_,bundle:r,rowIndex:e,rowY:g,w:v,labelW:d,chartW:b,rangeStart:a,rangeEnd:o,focusIds:l,hoveredId:u,displayMode:s,runStartedAt:c,timeZone:f,theme:m,palette:x,testStatsById:p,showTests:h})}}function $r(e,t){if(e.length===0)return 0;let n=0,r=e.length-1;for(;n<r;){let i=Math.floor((n+r)/2);(e[i]??0)<t?n=i+1:r=i}return Math.max(0,n-1)}function ei(e,t,n,r){let i=n+r,a=0;for(let r=0;r<e.length;r++){let o=e[r]??0;if(!(o+(t[r]??44)<=n)){if(o>=i)break;a=r}}return a}function ti({canvasRef:e,bundles:t,rowOffsets:n,rowHeights:r,scrollTop:i,rangeStart:a,rangeEnd:o,activeMode:s,runStartedAt:c,focusedIds:l,hoveredId:u,effectiveLabelW:f,timeZone:p,testStatsById:m,theme:h,showTests:g,setContainerWidth:_}){(0,d.useEffect)(()=>{if(t.length===0)return;function d(){let d=e.current;d&&Qr(d,t,n,r,{scrollTop:i,rangeStart:a,rangeEnd:o,displayMode:s,runStartedAt:c,focusIds:l,hoveredId:u,labelW:f,timeZone:p,testStatsById:m,theme:h,showTests:g})}let v=e.current;if(!v)return;d();let y=new ResizeObserver(e=>{let t=e[0];t&&_(t.contentRect.width),d()});return y.observe(v),()=>y.disconnect()},[t,n,r,i,a,o,s,c,l,u,f,p,m,h,g,_])}function ni(e){return Math.max(1,Math.min(3,Math.trunc(e)))}function ri(e){let t=ni(e.dependencyDepthHops);return{includeUpstream:e.dependencyDirection!==`downstream`,includeDownstream:e.dependencyDirection!==`upstream`,showAllUpstream:!1,maxUpstreamEdges:8,showAllDownstream:!1,maxDownstreamEdges:8,extendedDeps:t>1?{enabled:!0,maxHops:ni(t),maxEdgesPerDirection:12}:{enabled:!1}}}function ii({edgeFocusId:e,timelineAdjacency:t,itemById:n,bundleIndexById:r,dependencyDirection:i,dependencyDepthHops:a,hoverUniqueId:o}){let s=(0,d.useMemo)(()=>ri({dependencyDirection:i,dependencyDepthHops:a}),[a,i]),{edges:c,extendedTruncated:l}=(0,d.useMemo)(()=>dr(e,t,n,r,s),[e,t,n,r,s]);return{edges:c,dependencyEdgeHint:(0,d.useMemo)(()=>{if(!(!e||o!==e))return ur({focusId:e,timelineAdjacency:t,bundleIndexById:r,edges:c,focusOptions:s,extendedTruncated:l})},[e,o,c,l,t,r,s])}}function ai({data:e,runStartedAt:t,timelineAdjacency:n,testStatsById:r,showTests:i=!1,dependencyDirection:o=`both`,dependencyDepthHops:s=2,selectedId:c=null,onSelect:l,timeWindow:u=null,onTimeWindowChange:f}){let p=ot(),m=(0,d.useRef)(null),h=(0,d.useRef)(null),[g,_]=(0,d.useState)(null),[v,y]=(0,d.useState)(`duration`),[b,x]=(0,d.useState)(In),[S,C]=(0,d.useState)(0),[w,T]=(0,d.useState)(()=>typeof window>`u`?900:window.innerHeight),E=(0,d.useMemo)(()=>Fn(),[]),D=t!=null,O=D?v:`duration`;(0,d.useEffect)(()=>{try{window.localStorage.setItem(Nn,b)}catch{}},[b]);let k=S>0?Math.max(80,Math.min(160,Math.round(S*.35))):160,A=(0,d.useMemo)(()=>An(e),[e]),j=(0,d.useMemo)(()=>{let e=1;for(let t of A){e=Math.max(e,t.item.end);for(let n of t.tests)e=Math.max(e,n.end)}return e},[A]),M=(0,d.useMemo)(()=>{if(!u)return A;let{start:t,end:n}=u,r=new Set;for(let e of A)for(let i of e.tests)if(i.end>t&&i.start<n){r.add(e.item.unique_id);break}return An(e.filter(e=>e.end>t&&e.start<n?!0:r.has(e.unique_id)))},[e,A,u]),N=u?.start??0,P=u?u.end:j,F=N,I=P,{rowOffsets:L,rowHeights:ee}=(0,d.useMemo)(()=>Mr(M,i),[M,i]),R=(0,d.useMemo)(()=>{let t=new Map;for(let n of e)t.set(n.unique_id,n);return t},[e]),z=a({count:M.length,getScrollElement:()=>h.current,estimateSize:e=>M[e]?jr(M[e],i):44,getItemKey:e=>M[e]?.item.unique_id??e,overscan:10}),B=z.scrollOffset??0;(0,d.useLayoutEffect)(()=>{z.measure()},[M,i,z]);let te=(0,d.useMemo)(()=>({rowOffsets:L,rowHeights:ee,showTests:i}),[L,ee,i]),V=(0,d.useMemo)(()=>{let e=new Map;for(let t=0;t<M.length;t++){let n=M[t];if(n){e.set(n.item.unique_id,t);for(let r of n.tests)e.set(r.unique_id,t)}}return e},[M]),H=c??g?.item.unique_id??null,{edges:ne,dependencyEdgeHint:re}=ii({edgeFocusId:H,timelineAdjacency:n,itemById:R,bundleIndexById:V,dependencyDirection:o,dependencyDepthHops:s,hoverUniqueId:g?.item.unique_id}),ie=(0,d.useMemo)(()=>{if(!H)return null;let e=new Set([H]);for(let t of ne)e.add(t.fromId),e.add(t.toId);return e},[H,ne]),ae=32+z.getTotalSize(),oe=Math.max(240,Math.min(w-320,Math.round(w*Mn))),se=Math.max(240,Math.min(oe,ae)),ce=ae>se;if((0,d.useEffect)(()=>{let e=()=>T(window.innerHeight);return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),ti({canvasRef:m,bundles:M,rowOffsets:L,rowHeights:ee,scrollTop:B,rangeStart:F,rangeEnd:I,activeMode:O,runStartedAt:t,focusedIds:ie,hoveredId:g?.item.unique_id??null,effectiveLabelW:k,timeZone:b,testStatsById:r,theme:p,showTests:i,setContainerWidth:C}),A.length===0)return(0,U.jsx)(`div`,{className:`empty-state empty-state--chart`,children:`No Gantt data (run_results may lack timing info)`});function le(e,t){Fr(e,t,{bundles:M,layout:te,scrollTop:B,rangeStart:F,rangeEnd:I,effectiveLabelW:k,canvas:m.current,setHover:_,onSelect:l})}return(0,U.jsxs)(`div`,{className:`gantt-shell`,role:`region`,"aria-label":`Execution timeline`,children:[D&&(0,U.jsx)(Er,{activeMode:O,onChange:y,activeTimeZone:b,timeZones:E,onTimeZoneChange:x}),(0,U.jsx)(Ar,{bundles:A,maxEnd:j,timeWindow:u,testStatsById:r,onChange:f??(()=>{})}),(0,U.jsx)(Tr,{canvasRef:m,scrollRef:h,edges:ne,edgeFocusId:H,itemById:R,bundleIndexById:V,bundles:M,rowOffsets:L,containerWidth:S,effectiveLabelW:k,rangeStart:F,rangeEnd:I,scrollTop:B,viewportH:se,needsScroll:ce,totalScrollH:ae,theme:p,showTests:i,hover:g,runStartedAt:t,canShowTimestamps:D,timeZone:b,testStatsById:r,selectedId:c,onSelect:l,onPointer:le,onHoverClear:()=>_(null),dependencyEdgeHint:re})]})}var oi={display:`inline-block`,width:10,height:10,borderRadius:2,flexShrink:0},si=` gantt-legend__item--active`;function ci({theme:e,themeHex:t,showCompileExecuteLegend:n}){let r=A(`model`,e),i=Lr(`success`,e);return(0,U.jsxs)(`div`,{className:`gantt-legend__group gantt-legend__group--bar-key`,children:[(0,U.jsx)(`span`,{className:`gantt-legend__label`,children:`Bars`}),(0,U.jsxs)(`div`,{className:`gantt-legend__bar-key-row`,children:[(0,U.jsx)(`span`,{className:`gantt-legend__bar-key-swatch`,style:{background:r,border:`2px solid ${t.borderDefault}`,borderRadius:3},title:`Bar fill follows resource type`,"aria-hidden":!0}),(0,U.jsx)(`span`,{className:`gantt-legend__bar-key-caption`,children:`Fill = type`}),(0,U.jsx)(`span`,{className:`gantt-legend__bar-key-swatch`,style:{background:t.bgSoft,border:`2px solid ${i}`,borderRadius:3},title:`Bar outline follows run status`,"aria-hidden":!0}),(0,U.jsx)(`span`,{className:`gantt-legend__bar-key-caption`,children:`Border = status`})]}),n?(0,U.jsxs)(`div`,{className:`gantt-legend__bar-key-row gantt-legend__bar-key-row--phases`,children:[(0,U.jsx)(`span`,{className:`gantt-legend__bar-key-swatch`,style:{background:e===`dark`?`rgba(0, 0, 0, 0.24)`:`rgba(0, 0, 0, 0.12)`,border:`1px solid ${t.borderDefault}`,borderRadius:2},"aria-hidden":!0}),(0,U.jsx)(`span`,{className:`gantt-legend__bar-key-caption`,children:`Compile (darker)`}),(0,U.jsx)(`span`,{className:`gantt-legend__bar-key-swatch`,style:{background:r,border:`1px solid ${t.borderDefault}`,borderRadius:2},"aria-hidden":!0}),(0,U.jsx)(`span`,{className:`gantt-legend__bar-key-caption`,children:`Execute`})]}):null]})}function li({themeHex:e,showTests:t,onToggleShowTests:n,failuresOnly:r,onToggleFailuresOnly:i}){return n==null&&i==null?null:(0,U.jsxs)(`div`,{className:`gantt-legend__group gantt-legend__group--actions`,children:[n!=null&&(0,U.jsxs)(`button`,{type:`button`,className:`gantt-legend__item${t?si:``}`,onClick:n,title:t?`Hide test chips`:`Show test chips`,"aria-pressed":t??!1,children:[(0,U.jsx)(`span`,{style:{...oi,background:e.mint,borderRadius:50},"aria-hidden":!0}),(0,U.jsx)(`span`,{className:`gantt-legend__name`,children:`Tests`})]}),i!=null&&(0,U.jsxs)(`button`,{type:`button`,className:`gantt-legend__item${r?si:``}`,onClick:i,title:r?`Show all parent rows`:`Show only parents with errors or failing tests`,"aria-pressed":r??!1,children:[(0,U.jsx)(`span`,{style:{...oi,background:e.rose,borderRadius:50},"aria-hidden":!0}),(0,U.jsx)(`span`,{className:`gantt-legend__name`,children:`Failures only`})]})]})}function ui({statusCounts:e,typeCounts:t,activeStatuses:n,activeTypes:r,onToggleStatus:i,onToggleType:a,showTests:o,onToggleShowTests:s,failuresOnly:c,onToggleFailuresOnly:l,showBarEncodingKey:u=!0,showCompileExecuteLegend:d=!1}){let f=ot(),p=h(f),m=Object.keys(Ir).filter(t=>(e[t]??0)>0),g=Object.keys(t).filter(e=>(t[e]??0)>0).sort((e,t)=>e.localeCompare(t));return m.length>0||g.length>0||s!=null||l!=null?(0,U.jsxs)(`div`,{className:`gantt-legend`,children:[u?(0,U.jsx)(ci,{theme:f,themeHex:p,showCompileExecuteLegend:d}):null,m.length>0&&(0,U.jsxs)(`div`,{className:`gantt-legend__group`,children:[(0,U.jsx)(`span`,{className:`gantt-legend__label`,children:`Status`}),m.map(t=>{let r=n?.has(t)??!1,a=Lr(t,f),o=e[t]??0;return(0,U.jsxs)(`button`,{type:`button`,className:`gantt-legend__item${r?si:``}`,onClick:()=>i?.(t),title:`${t} (${o})`,children:[(0,U.jsx)(`span`,{style:{...oi,background:a}}),(0,U.jsx)(`span`,{className:`gantt-legend__name`,children:t}),(0,U.jsx)(`span`,{className:`gantt-legend__count`,children:o})]},t)})]}),g.length>0&&(0,U.jsxs)(`div`,{className:`gantt-legend__group`,children:[(0,U.jsx)(`span`,{className:`gantt-legend__label`,children:`Type`}),g.map(e=>{let n=r?.has(e)??!1,i=Rr(e,f),o=t[e]??0;return(0,U.jsxs)(`button`,{type:`button`,className:`gantt-legend__item${n?si:``}`,onClick:()=>a?.(e),title:`${e} (${o})`,children:[(0,U.jsx)(`span`,{style:{...oi,background:p.bgSoft,borderLeft:`3px solid ${i}`,borderRadius:0}}),(0,U.jsx)(`span`,{className:`gantt-legend__name`,children:e}),(0,U.jsx)(`span`,{className:`gantt-legend__count`,children:o})]},e)})]}),(0,U.jsx)(li,{themeHex:p,showTests:o,onToggleShowTests:s,failuresOnly:c,onToggleFailuresOnly:l})]}):null}var di=[{value:`upstream`,label:`Upstream`,glyph:`←`},{value:`both`,label:`Both`,glyph:`⇄`},{value:`downstream`,label:`Downstream`,glyph:`→`}];function fi({filters:e,setFilters:t}){let n=ni(e.dependencyDepthHops),r=e=>t(t=>({...t,dependencyDepthHops:ni(e)}));return(0,U.jsx)(`div`,{className:`timeline-dependency-controls gantt-legend`,"aria-label":`Dependency visualization controls`,children:(0,U.jsxs)(`div`,{className:`timeline-dependency-controls__top-row`,children:[(0,U.jsxs)(`div`,{className:`timeline-dependency-controls__zone`,children:[(0,U.jsx)(`span`,{className:`gantt-legend__label`,children:`Depth`}),(0,U.jsxs)(`div`,{className:`timeline-dependency-controls__stepper`,role:`group`,"aria-label":`Dependency depth`,children:[(0,U.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:()=>r(n-1),disabled:n<=1,"aria-label":`Decrease dependency depth`,children:`-`}),(0,U.jsx)(`span`,{className:`timeline-dependency-controls__depth-value`,children:n}),(0,U.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:()=>r(n+1),disabled:n>=3,"aria-label":`Increase dependency depth`,children:`+`})]})]}),(0,U.jsx)(`div`,{className:`timeline-dependency-controls__divider`,"aria-hidden":`true`}),(0,U.jsxs)(`div`,{className:`timeline-dependency-controls__zone timeline-dependency-controls__zone--direction`,children:[(0,U.jsx)(`span`,{className:`gantt-legend__label`,children:`Direction`}),(0,U.jsx)(`div`,{className:`workspace-segmented-control`,role:`tablist`,"aria-label":`Dependency direction`,children:di.map(n=>{let r=e.dependencyDirection===n.value;return(0,U.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":r,className:r?`workspace-segmented-control__button workspace-segmented-control__button--active`:`workspace-segmented-control__button`,onClick:()=>t(e=>({...e,dependencyDirection:n.value})),children:[(0,U.jsx)(`span`,{"aria-hidden":`true`,children:n.glyph}),` `,n.label]},n.value)})}),(0,U.jsx)(`button`,{type:`button`,className:`workspace-pill timeline-dependency-controls__max-button`,onClick:()=>r(3),children:`Max`})]})]})})}function pi({filters:e,hasActiveFilters:t,typeFilterHint:n,setFilters:r}){return(0,U.jsxs)(`div`,{className:`timeline-toolbar`,children:[(0,U.jsxs)(`label`,{className:`workspace-search workspace-search--compact timeline-toolbar__search`,children:[(0,U.jsx)(`span`,{children:`Search nodes`}),(0,U.jsxs)(`div`,{className:`workspace-search__input-row`,children:[(0,U.jsx)(`input`,{value:e.query,onChange:e=>r(t=>({...t,query:e.target.value})),placeholder:`Filter by name or id…`,"aria-label":`Search timeline nodes`}),e.query&&(0,U.jsx)(`button`,{type:`button`,className:`workspace-search__clear`,"aria-label":`Clear search`,onClick:()=>r(e=>({...e,query:``})),children:`✕`})]})]}),(n!=null||t)&&(0,U.jsxs)(`div`,{className:`timeline-toolbar__actions`,children:[n!=null&&(0,U.jsxs)(`p`,{className:`timeline-toolbar__hint`,role:`status`,children:[n.shown.length>0?`Showing types: ${n.shown.join(`, `)}. `:``,`Hidden by type filter:`,` `,n.hidden.map(({type:e,count:t})=>`${e} (${t})`).join(`, `),`.`]}),(0,U.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:()=>{r(e=>({...e,query:``,activeStatuses:new Set,activeTypes:new Set,selectedExecutionId:null,dependencyDirection:`both`,dependencyDepthHops:2}))},children:`Clear all filters`})]})]})}function mi(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function hi(e,t,n){let r=n.get(e.unique_id),i=r?r.fail+r.error>0:t.some(e=>!Ln(e.status));return!Ln(e.status)||i}function gi({analysis:e,filters:t,effectiveActiveTypes:n,filteredData:r,bundleRowCount:i,statusCounts:a,typeCounts:o,hasActiveFilters:s,typeFilterHint:c,testStatsById:l,setFilters:u,toggleStatus:f,toggleType:p,onInvestigationSelectionChange:m}){let h=(0,d.useMemo)(()=>e.ganttData.some(e=>e.compileStart!=null&&e.compileEnd!=null&&e.compileEnd>e.compileStart&&e.executeStart!=null&&e.executeEnd!=null&&e.executeEnd>e.executeStart),[e.ganttData]),{timeWindow:g}=t;return(0,U.jsxs)(K,{title:`Execution timeline`,subtitle:`Relative start and duration for each executed node.`,children:[(0,U.jsx)(ui,{statusCounts:a,typeCounts:o,activeStatuses:t.activeStatuses,activeTypes:n,onToggleStatus:f,onToggleType:p,showTests:t.showTests,onToggleShowTests:()=>u(e=>({...e,showTests:!e.showTests})),failuresOnly:t.failuresOnly,onToggleFailuresOnly:()=>u(e=>({...e,failuresOnly:!e.failuresOnly})),showCompileExecuteLegend:h}),(0,U.jsx)(fi,{filters:t,setFilters:u}),(0,U.jsx)(pi,{filters:t,hasActiveFilters:s,typeFilterHint:c,setFilters:u}),g!=null&&(0,U.jsxs)(`p`,{className:`timeline-zoom-active`,role:`status`,children:[`Zoomed to `,Q(g.end-g.start),` window`,` — `,(0,U.jsx)(`button`,{type:`button`,className:`timeline-zoom-clear`,onClick:()=>u(e=>({...e,timeWindow:null})),children:`Clear zoom ×`})]}),i>=2e4?(0,U.jsxs)(`p`,{className:`timeline-large-dataset-hint`,role:`status`,children:[`Showing `,i.toLocaleString(),` timeline rows. Use search or type and status filters to narrow the list.`]}):null,(0,U.jsx)(ai,{data:r,runStartedAt:e.runStartedAt,timelineAdjacency:e.timelineAdjacency,testStatsById:l,showTests:t.showTests,dependencyDirection:t.dependencyDirection,dependencyDepthHops:t.dependencyDepthHops,selectedId:t.selectedExecutionId,timeWindow:g,onTimeWindowChange:e=>u(t=>({...t,timeWindow:e})),onSelect:t=>{u(e=>({...e,selectedExecutionId:t})),m(n=>({...n,selectedExecutionId:t,selectedResourceId:t==null?n.selectedResourceId:e.resources.find(e=>e.uniqueId===t)?.uniqueId??n.selectedResourceId,sourceLens:`timeline`}))}})]})}function _i({analysis:e,filters:t,setFilters:n,onInvestigationSelectionChange:r}){let i=(0,d.useDeferredValue)(t.query),a=e.projectName??ue(e.executions),o=(0,d.useMemo)(()=>Array.from(new Set(e.ganttData.filter(e=>me(e,a)).map(e=>e.resourceType).filter(e=>!!e))).sort(),[e.ganttData,a]),s=(0,d.useMemo)(()=>pe(o),[o]),c=t.activeTypes.size>0?t.activeTypes:s;function l(e){n(t=>{let n=new Set(t.activeStatuses);return n.has(e)?n.delete(e):n.add(e),{...t,activeStatuses:n}})}function u(e){n(t=>{let n=new Set(t.activeTypes.size>0?t.activeTypes:s);return n.has(e)?n.delete(e):n.add(e),{...t,activeTypes:n}})}let f=(0,d.useMemo)(()=>ge(e.resources,e.dependencyIndex),[e.dependencyIndex,e.resources]),p=(0,d.useMemo)(()=>{let t=new Map;for(let n of e.ganttData){if(!R.has(n.resourceType)||n.parentId==null)continue;let e=t.get(n.parentId)??[];e.push(n),t.set(n.parentId,e)}return t},[e.ganttData]),m=(0,d.useMemo)(()=>e.ganttData.filter(e=>{if(R.has(e.resourceType)||t.activeTypes.size===0&&!me(e,a)||t.activeStatuses.size>0&&!t.activeStatuses.has(e.status.toLowerCase())||c.size>0&&!c.has(e.resourceType??``))return!1;if(i){let t=i.trim().toLowerCase();if(t&&!e.name.toLowerCase().includes(t)&&!e.unique_id.toLowerCase().includes(t))return!1}return!(t.failuresOnly&&!hi(e,p.get(e.unique_id)??[],f))}),[e.ganttData,i,c,t.activeStatuses,t.failuresOnly,t.activeTypes.size,a,f,p]),h=(0,d.useMemo)(()=>new Set(m.map(e=>e.unique_id)),[m]),g=(0,d.useMemo)(()=>t.showTests?e.ganttData.filter(e=>R.has(e.resourceType)&&e.parentId!=null&&h.has(e.parentId)):[],[e.ganttData,t.showTests,h]),_=(0,d.useMemo)(()=>[...m,...g],[m,g]),v=(0,d.useMemo)(()=>{let t={};for(let n of e.ganttData.filter(e=>me(e,a))){let e=n.status.toLowerCase();t[e]=(t[e]??0)+1}return t},[e.ganttData,a]),y=(0,d.useMemo)(()=>{let t={};for(let n of e.ganttData.filter(e=>me(e,a)))t[n.resourceType]=(t[n.resourceType]??0)+1;return t},[e.ganttData,a]),b=!mi(c,s),x=(0,d.useMemo)(()=>{if(!b)return null;let e=[...c].filter(e=>s.has(e)).sort(),t=[...s].filter(e=>!c.has(e)).sort().map(e=>({type:e,count:y[e]??0}));return t.length===0?null:{shown:e,hidden:t}},[s,c,b,y]),S=t.activeStatuses.size>0||b||t.query.length>0;return(0,U.jsx)(Ie,{title:`Timeline`,description:`Runtime timing, concurrency, bottlenecks, and execution order.`,className:`timeline-view`,children:(0,U.jsx)(gi,{analysis:e,filters:t,effectiveActiveTypes:c,filteredData:_,bundleRowCount:m.length,statusCounts:v,typeCounts:y,hasActiveFilters:S,typeFilterHint:x,testStatsById:f,setFilters:n,toggleStatus:l,toggleType:u,onInvestigationSelectionChange:r})})}var vi=100;function yi(){return{status:{all:0,positive:0,warning:0,danger:0},facets:{all:0,models:0,tests:0,seeds:0,snapshots:0,operations:0,healthy:0,warnings:0,errors:0},resourceTypes:{},threadIds:{}}}function bi(e,t,n=!0){let r=(0,d.useRef)(null),i=(0,d.useRef)(0),[a,o]=(0,d.useState)(!1),[s,c]=(0,d.useState)(vi),[l,u]=(0,d.useState)([]),[f,p]=(0,d.useState)(0),[m,h]=(0,d.useState)(yi),[g,_]=(0,d.useState)(!0),[v,y]=(0,d.useState)(!1),[b,x]=(0,d.useState)(null);return(0,d.useEffect)(()=>{c(vi)},[t.kind,t.status,t.query,t.durationBand,t.sortBy,t.resourceTypes,t.threadIds,e]),(0,d.useEffect)(()=>{if(!n){o(!1),_(!1),y(!1),u([]),p(0),h(yi()),x(null);return}let t=new Worker(new URL(`/assets/resultsQuery.worker-BAssRVck.js`,``+import.meta.url),{type:`module`});return r.current=t,o(!1),_(!0),u([]),p(0),h(yi()),x(null),t.onmessage=e=>{let t=e.data;if(t.type===`ready`){o(!0),_(!1),h(t.summary);return}if(t.type===`query-result`){if(t.requestId!==i.current)return;u(t.rows),p(t.totalMatches),h(t.summary),y(!1);return}x(t.message),_(!1),y(!1)},t.postMessage({type:`init`,rows:e}),()=>{t.terminate(),r.current=null}},[e,n]),(0,d.useEffect)(()=>{if(!n||!a||r.current==null)return;let e=i.current+1;i.current=e,y(!0),x(null),r.current.postMessage({type:`query`,requestId:e,kind:t.kind,status:t.status,query:t.query,resourceTypes:Array.from(t.resourceTypes),threadIds:Array.from(t.threadIds),durationBand:t.durationBand,sortBy:t.sortBy,limit:s})},[n,a,s,t]),(0,d.useMemo)(()=>({rows:l,totalMatches:f,totalVisible:l.length,summary:m,hasMore:l.length<f,isIndexing:g,isLoading:v,error:b,loadMore:()=>c(e=>e+vi)}),[l,f,m,g,v,b])}var xi=[{label:`All`,countKey:`all`},{kind:`models`,label:`Models`,countKey:`models`},{kind:`tests`,label:`Tests`,countKey:`tests`},{kind:`seeds`,label:`Seeds`,countKey:`seeds`},{kind:`snapshots`,label:`Snapshots`,countKey:`snapshots`},{kind:`operations`,label:`Operations`,countKey:`operations`},{status:`positive`,label:`Healthy`,countKey:`healthy`},{status:`warning`,label:`Warnings`,countKey:`warnings`},{status:`danger`,label:`Errors`,countKey:`errors`}];function Si(e){return e.facets}function Ci({runsViewState:e,runsResults:t,onRunsViewStateChange:n}){return(0,U.jsxs)(`div`,{className:`runs-toolbar runs-toolbar--stacked`,children:[(0,U.jsxs)(`div`,{className:`runs-toolbar__row`,children:[(0,U.jsxs)(`label`,{className:`workspace-search workspace-search--compact`,children:[(0,U.jsx)(`span`,{children:`Search`}),(0,U.jsx)(`input`,{value:e.query,onChange:e=>n(t=>({...t,query:e.target.value})),placeholder:`Filter by name, type, status, thread…`})]}),(0,U.jsxs)(`label`,{className:`workspace-search workspace-search--compact`,children:[(0,U.jsx)(`span`,{children:`Sort`}),(0,U.jsxs)(`select`,{value:e.sortBy,onChange:e=>n(t=>({...t,sortBy:e.target.value})),children:[(0,U.jsx)(`option`,{value:`attention`,children:`Attention`}),(0,U.jsx)(`option`,{value:`duration`,children:`Duration`}),(0,U.jsx)(`option`,{value:`name`,children:`Name`}),(0,U.jsx)(`option`,{value:`status`,children:`Status`}),(0,U.jsx)(`option`,{value:`start`,children:`Start`})]})]})]}),(0,U.jsx)(`div`,{className:`runs-toolbar__row runs-toolbar__row--facets`,children:xi.map(r=>{let i=Si(t.summary);return(0,U.jsxs)(`button`,{type:`button`,className:r.kind!=null&&e.kind===r.kind||r.status!=null&&e.status===r.status||r.kind==null&&r.status==null&&e.kind===`all`&&e.status===`all`?`workspace-pill workspace-pill--active`:`workspace-pill`,onClick:()=>n(e=>({...e,kind:r.kind??`all`,status:r.status??`all`})),children:[r.label,` (`,i[r.countKey],`)`]},r.label)})})]})}function wi({selectedRow:e,relatedResource:t,onNavigateTo:n}){return e?(0,U.jsxs)(`section`,{className:`workspace-card results-selection-summary`,children:[(0,U.jsxs)(`div`,{className:`results-selection-summary__header`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`p`,{className:`eyebrow`,children:`Selected run item`}),(0,U.jsx)(`h3`,{children:e.name})]}),(0,U.jsxs)(`div`,{className:`results-selection-summary__badges`,children:[(0,U.jsx)(`span`,{className:`entity-inspector__type-badge`,children:e.resourceType}),(0,U.jsx)(`span`,{className:re(e.statusTone),children:e.status})]})]}),(0,U.jsxs)(`dl`,{className:`results-selection-summary__stats`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`dt`,{children:`Duration`}),(0,U.jsx)(`dd`,{children:V(e.executionTime)})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`dt`,{children:`Thread`}),(0,U.jsx)(`dd`,{children:e.threadId??`n/a`})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`dt`,{children:`Path`}),(0,U.jsx)(`dd`,{children:e.path??`n/a`})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`dt`,{children:`Unique ID`}),(0,U.jsx)(`dd`,{children:e.uniqueId})]})]}),(0,U.jsx)(Le,{actions:[{label:`Open in Inventory`,onClick:()=>n(`inventory`,{resourceId:t?.uniqueId??e.uniqueId,assetTab:`summary`}),disabled:!t},{label:`Open in Timeline`,onClick:()=>n(`timeline`,{resourceId:t?.uniqueId??e.uniqueId,executionId:e.uniqueId})},{label:`Open in Lineage`,onClick:()=>n(`inventory`,{resourceId:t?.uniqueId??e.uniqueId,rootResourceId:t?.uniqueId??e.uniqueId,assetTab:`lineage`}),disabled:!t}]})]}):null}function Ti({analysis:e,runsResults:t,runsViewState:n,resultsBodyRef:r,virtualizer:i,onRunsViewStateChange:a,onInvestigationSelectionChange:o}){return(0,U.jsxs)(`div`,{className:`results-table`,children:[(0,U.jsxs)(`div`,{className:`results-table__header`,children:[(0,U.jsx)(`span`,{children:`Item`}),(0,U.jsx)(`span`,{children:`Type`}),(0,U.jsx)(`span`,{children:`Status`}),(0,U.jsx)(`span`,{children:`Duration`}),(0,U.jsx)(`span`,{children:`Thread`})]}),(0,U.jsx)(`div`,{ref:r,className:`results-table__body`,style:{height:Math.min(560,Math.max(120,t.rows.length*76)),overflowY:`auto`,position:`relative`},children:(0,U.jsx)(`div`,{style:{height:i.getTotalSize(),position:`relative`},children:i.getVirtualItems().map(r=>{let i=t.rows[r.index];return i?(0,U.jsxs)(`button`,{type:`button`,className:`results-table__row${i.uniqueId===n.selectedExecutionId?` results-table__row--active`:``}`,style:{position:`absolute`,top:0,left:0,width:`100%`,transform:`translateY(${r.start}px)`},onClick:()=>{let t=e.resources.find(e=>e.uniqueId===i.uniqueId)??null;a(e=>({...e,selectedExecutionId:i.uniqueId})),o(e=>({...e,selectedExecutionId:i.uniqueId,selectedResourceId:t?.uniqueId??i.uniqueId,sourceLens:`runs`}))},children:[(0,U.jsx)(`span`,{children:(0,U.jsx)(`strong`,{children:i.name})}),(0,U.jsx)(`span`,{children:i.resourceType}),(0,U.jsx)(`span`,{children:(0,U.jsx)(`span`,{className:re(i.statusTone),children:i.status})}),(0,U.jsx)(`span`,{children:V(i.executionTime)}),(0,U.jsx)(`span`,{children:i.threadId??`n/a`})]},i.uniqueId):null})})})]})}function Ei({analysis:e,runsViewState:t,onRunsViewStateChange:n,onInvestigationSelectionChange:r,onNavigateTo:i}){let o=(0,d.useRef)(null),s=bi(e.executions,t,!0),c=s.rows.find(e=>e.uniqueId===t.selectedExecutionId)??e.executions.find(e=>e.uniqueId===t.selectedExecutionId)??null,l=c==null?null:e.resources.find(e=>e.uniqueId===c.uniqueId)??null,u=a({count:s.rows.length,getScrollElement:()=>o.current,estimateSize:()=>76,overscan:10});return(0,d.useEffect)(()=>{let e=o.current;if(!e)return;let t=()=>{e.scrollHeight-e.scrollTop-e.clientHeight<220&&s.hasMore&&!s.isLoading&&!s.isIndexing&&s.loadMore()};return e.addEventListener(`scroll`,t),t(),()=>e.removeEventListener(`scroll`,t)},[s]),(0,U.jsxs)(Ie,{title:`Runs`,description:`Execution and quality evidence across models, tests, seeds, snapshots, and operations.`,toolbar:(0,U.jsx)(Ci,{runsViewState:t,runsResults:s,onRunsViewStateChange:n}),className:`runs-view`,children:[(0,U.jsx)(wi,{selectedRow:c,relatedResource:l,onNavigateTo:i}),(0,U.jsx)(Ti,{analysis:e,runsResults:s,runsViewState:t,resultsBodyRef:o,virtualizer:u,onRunsViewStateChange:n,onInvestigationSelectionChange:r})]})}function Di(e){return e===`inventory`}function Oi(e,t){return t||(e[0]??null)}function ki({analysis:e,activeView:t,analysisSource:n,overviewFilters:r,onOverviewFiltersChange:i,timelineFilters:a,onTimelineFiltersChange:o,assetViewState:s,onAssetViewStateChange:c,runsViewState:l,onRunsViewStateChange:u,lineageViewState:f,onLineageViewStateChange:p,investigationSelection:m,onInvestigationSelectionChange:h,onNavigateTo:g,workspaceSignals:_}){let v=e.projectName??ue(e.executions),y=(0,d.useMemo)(()=>s.explorerMode!==`project`||v==null?e.resources:e.resources.filter(e=>de(e,v)),[e.resources,s.explorerMode,v]),b=(0,d.useMemo)(()=>Array.from(new Set(y.map(e=>e.resourceType))).sort(),[y]),x=(0,d.useMemo)(()=>y.filter(e=>se(e,s.status)&&ce(e,s.resourceTypes)&&oe(e,s.resourceQuery)),[y,s.resourceQuery,s.resourceTypes,s.status]),S=(0,d.useMemo)(()=>De(x,s.explorerMode,v,e.dependencyIndex),[e.dependencyIndex,s.explorerMode,x,v]),C=(0,d.useMemo)(()=>ke(S),[S]),w=(0,d.useRef)(null),T=(0,d.useRef)(s.selectedResourceId);(0,d.useEffect)(()=>{S.length!==0&&w.current!==s.explorerMode&&(w.current=s.explorerMode,c(e=>({...e,expandedNodeIds:new Set(C)})))},[C,s.explorerMode,S.length,c]);let E=(0,d.useMemo)(()=>new Set([...s.expandedNodeIds].filter(e=>C.has(e))),[C,s.expandedNodeIds]),D=(0,d.useMemo)(()=>Oe(S,E),[E,S]),O=(0,d.useMemo)(()=>Ae(S),[S]),k=Oi(O,s.selectedResourceId),A=e.resources.find(e=>e.uniqueId===k)??null;(0,d.useEffect)(()=>{let e=s.selectedResourceId,t=T.current;if(T.current=e,!e||e===t||O.includes(e))return;let n=Me(S,e);n.size!==0&&c(e=>({...e,expandedNodeIds:new Set([...e.expandedNodeIds,...n])}))},[s.selectedResourceId,S,c,O]);let j=Di(t)?(0,U.jsx)(Ue,{treeRows:D,filteredResources:x,totalResources:y.length,matchedResources:O.length,explorerMode:s.explorerMode,setExplorerMode:e=>c(t=>({...t,explorerMode:e})),status:s.status,setStatus:e=>c(t=>({...t,status:e})),availableResourceTypes:b,activeResourceTypes:s.resourceTypes,toggleResourceType:e=>c(t=>{let n=new Set(t.resourceTypes);return n.has(e)?n.delete(e):n.add(e),{...t,resourceTypes:n}}),resourceQuery:s.resourceQuery,setResourceQuery:e=>c(t=>({...t,resourceQuery:e})),selectedResourceId:k,expandedNodeIds:E,toggleExpandedNode:e=>c(t=>{let n=new Set(t.expandedNodeIds);return n.has(e)?n.delete(e):n.add(e),{...t,expandedNodeIds:n}}),setSelectedResourceId:e=>{c(t=>({...t,selectedResourceId:e})),h(t=>({...t,selectedResourceId:e,sourceLens:`inventory`}))}}):null;return(0,U.jsxs)(`div`,{className:`workspace-layout${j?``:` workspace-layout--full`}`,children:[j,(0,U.jsxs)(`div`,{className:`workspace-main-panel`,children:[t===`health`&&(0,U.jsx)(_t,{analysis:e,projectName:v,analysisSource:n,filters:r,setFilters:i,workspaceSignals:_,onNavigateTo:g}),t===`inventory`&&(0,U.jsx)(kn,{analysis:e,resource:A,onSelectResource:e=>c(t=>({...t,selectedResourceId:e})),assetViewState:{...s,selectedResourceId:k},onAssetViewStateChange:c,lineageViewState:f,onLineageViewStateChange:p,onInvestigationSelectionChange:h,onNavigateTo:g}),t===`runs`&&(0,U.jsx)(Ei,{analysis:e,runsViewState:l,onRunsViewStateChange:u,onInvestigationSelectionChange:h,onNavigateTo:g}),t===`timeline`&&(0,U.jsx)(_i,{analysis:e,filters:a,setFilters:o,onInvestigationSelectionChange:h})]})]})}function Ai({message:e}){return(0,U.jsx)(`div`,{className:`error-banner`,children:e})}var ji=(0,d.createContext)({toast:()=>{}}),Mi=0,Ni=4e3;function Pi({children:e}){let[t,n]=(0,d.useState)([]),r=(0,d.useCallback)((e,t=`neutral`)=>{let r=++Mi;n(n=>[...n,{id:r,message:e,tone:t}]),setTimeout(()=>{n(e=>e.filter(e=>e.id!==r))},Ni)},[]);function i(e){n(t=>t.filter(t=>t.id!==e))}return(0,U.jsxs)(ji.Provider,{value:{toast:r},children:[e,t.length>0&&(0,U.jsx)(`div`,{className:`toast-portal`,role:`status`,"aria-live":`polite`,children:t.map(e=>(0,U.jsxs)(`div`,{className:`toast toast--${e.tone}`,children:[(0,U.jsx)(`span`,{className:`toast__dot`,"aria-hidden":`true`}),(0,U.jsx)(`span`,{className:`toast__message`,children:e.message}),(0,U.jsx)(`button`,{type:`button`,className:`toast__dismiss`,"aria-label":`Dismiss notification`,onClick:()=>i(e.id),children:`✕`})]},e.id))})]})}function Fi(){return(0,d.useContext)(ji)}function Ii({id:e,label:t,file:n,onFileChange:r}){return(0,U.jsxs)(`div`,{className:`file-input-card`,children:[(0,U.jsx)(`label`,{htmlFor:e,children:t}),(0,U.jsx)(`input`,{id:e,type:`file`,accept:`.json`,onChange:e=>r(e.target.files?.[0]??null)}),n&&(0,U.jsx)(`span`,{className:`file-input-card__filename`,children:n.name})]})}var Li=[{title:`Health-first overview`,body:`Spot failing nodes, long-running bottlenecks, and critical-path pressure before opening individual assets.`},{title:`Catalog-style context`,body:`Browse lineage-adjacent metadata such as descriptions, packages, execution status, and dependency depth in one flow.`},{title:`Timeline investigation`,body:`Shift from summary to execution sequencing without leaving the workspace, inspired by dbt docs and observability tools.`}];function Ri({onAnalysis:e,onError:t}){let{toast:n}=Fi(),[r,i]=(0,d.useState)(null),[a,o]=(0,d.useState)(null),[s,c]=(0,d.useState)(!1);async function l(){if(!r||!a){t(`Please select both manifest.json and run_results.json`);return}c(!0),t(null);try{let[t,i]=await Promise.all([r.arrayBuffer(),a.arrayBuffer()]),o=await Ot(t,i,`upload`);e(o),n(`Analyzed ${o.analysis.summary.total_nodes} executions successfully`,`positive`)}catch(e){let r=e instanceof Error?e.message:`Failed to parse artifacts`;t(r),n(`Parse failed — ${r}`,`danger`)}finally{c(!1)}}let u=r&&a&&!s,f=(0,d.useMemo)(()=>r&&a?`Ready to analyze`:r||a?`Waiting for one more file`:`Add both dbt artifacts to continue`,[r,a]);return(0,U.jsxs)(`section`,{className:`upload-hero`,children:[(0,U.jsxs)(`div`,{className:`upload-hero__copy`,children:[(0,U.jsx)(`p`,{className:`eyebrow`,children:`Bring your artifacts`}),(0,U.jsx)(`h2`,{children:`Review dbt runs like a modern control plane, not a raw JSON dump.`}),(0,U.jsxs)(`p`,{children:[`Start from the two artifacts that power `,(0,U.jsx)(`code`,{children:`dbt docs`}),` and most run analysis workflows: a matching `,(0,U.jsx)(`code`,{children:`manifest.json`}),` and`,(0,U.jsx)(`code`,{children:` run_results.json`}),` pair.`]}),(0,U.jsxs)(`div`,{className:`upload-hero__callout`,children:[(0,U.jsx)(`span`,{className:`upload-hero__callout-badge`,children:`Recommended flow`}),(0,U.jsxs)(`strong`,{children:[`Run `,(0,U.jsx)(`code`,{children:`dbt docs generate`}),` after a representative job.`]}),(0,U.jsx)(`p`,{children:`That keeps lineage, metadata, and runtime results aligned so the workspace can feel closer to dbt Docs for discovery and closer to Elementary for health triage.`})]}),(0,U.jsx)(`div`,{className:`upload-feature-grid`,children:Li.map(e=>(0,U.jsxs)(`article`,{className:`upload-feature-card`,children:[(0,U.jsx)(`strong`,{children:e.title}),(0,U.jsx)(`p`,{children:e.body})]},e.title))})]}),(0,U.jsxs)(`div`,{className:`upload-panel`,children:[(0,U.jsxs)(`div`,{className:`upload-panel__header`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`p`,{className:`eyebrow`,children:`Artifact intake`}),(0,U.jsx)(`h3`,{children:`Open investigation workspace`})]}),(0,U.jsx)(`span`,{className:`upload-panel__status`,children:f})]}),(0,U.jsxs)(`div`,{className:`upload-panel__inputs`,children:[(0,U.jsx)(Ii,{id:`manifest-input`,label:`manifest.json`,file:r,onFileChange:i}),(0,U.jsx)(Ii,{id:`run-results-input`,label:`run_results.json`,file:a,onFileChange:o})]}),(0,U.jsxs)(`div`,{className:`upload-panel__tips`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`strong`,{children:`Best when files come from the same run.`}),(0,U.jsx)(`span`,{children:`Mismatched manifests and run results usually surface missing nodes or stale timings.`})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`strong`,{children:`Use local outputs or DBT_TARGET.`}),(0,U.jsx)(`span`,{children:`The app supports both uploaded artifacts and auto-loaded local targets for faster iteration.`})]})]}),(0,U.jsxs)(`button`,{type:`button`,onClick:()=>{l()},disabled:!u,className:`primary-action`,style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,gap:`0.5rem`},children:[s&&(0,U.jsx)(pn,{size:16}),s?`Analyzing…`:`Analyze artifacts`]})]})]})}var zi=8;function Bi(e,t){return!e||t.query.trim()?[]:t.recentResourceIds.map(t=>e.resources.find(e=>e.uniqueId===t)??null).filter(e=>e!=null).slice(0,zi)}function Vi(e,t){let n=t.query.trim(),r=(0,d.useMemo)(()=>Bi(e,t),[e,t.query,t.recentResourceIds]),[i,a]=(0,d.useState)([]),[o,s]=(0,d.useState)(!1),c=(0,d.useRef)(0);return(0,d.useEffect)(()=>{if(!e||!n){c.current+=1,a([]),s(!1);return}c.current+=1;let r=c.current,i=!1;return a([]),s(!0),At(t.query).then(e=>{!i&&c.current===r&&(a(e),s(!1))}).catch(()=>{!i&&c.current===r&&(a([]),s(!1))}),()=>{i=!0}},[e,n,t.query]),n?{results:i,loading:o}:{results:r,loading:!1}}var Hi=`/assets/app-logo-ByfNNtT8.svg`;function Ui({className:e,size:t,title:n,testId:r}){return(0,U.jsx)(`img`,{src:Hi,alt:n??``,"aria-hidden":n?void 0:!0,className:e,style:t?{width:`${t}px`,height:`${t}px`}:void 0,"data-testid":r})}var Wi=[{id:`health`,view:`health`,label:`Health`},{id:`timeline`,view:`timeline`,label:`Timeline`},{id:`inventory`,view:`inventory`,label:`Inventory`},{id:`runs`,view:`runs`,label:`Runs`}],Gi=new Set([`health`,`inventory`,`runs`,`timeline`,`settings`,`overview`,`catalog`,`execution`,`quality`,`dependencies`,`search`]);function Ki(e){let t=new URLSearchParams(e).get(`view`);return t===`lineage`||t===`dependencies`}function qi(e){switch(e){case`overview`:return`health`;case`catalog`:return`inventory`;case`execution`:case`quality`:return`runs`;case`dependencies`:case`lineage`:return`inventory`;case`search`:return`inventory`;case`runs`:case`timeline`:case`inventory`:case`health`:case`settings`:return e;default:return`health`}}function Ji(e){let t=new URLSearchParams(e),n=t.get(`view`);return n?n===`runs`&&t.get(`tab`)===`timeline`?`timeline`:n===`lineage`||n===`dependencies`?`inventory`:Gi.has(n)?qi(n):null:null}function Yi(e){return new URLSearchParams(e).get(`resource`)}function Xi(e){return new URLSearchParams(e).get(`selected`)}function Zi(e){let t=new URLSearchParams(e).get(`assetTab`);return t===`summary`||t===`lineage`||t===`sql`||t===`runtime`||t===`tests`?t:null}function Qi(e){return Zi(e)??(Ki(e)?`lineage`:`summary`)}function $i(e){let t=new URLSearchParams(e).get(`kind`);return t===`all`||t===`models`||t===`tests`||t===`seeds`||t===`snapshots`||t===`operations`?t:null}function ea(e){let t=new URLSearchParams(e).get(`lens`);return t===`status`||t===`type`||t===`coverage`?t:null}function ta(e){let t=new URLSearchParams(e).get(`up`);if(t==null||t===``)return null;let n=Number(t);return Number.isFinite(n)?n:null}function na(e){let t=new URLSearchParams(e).get(`down`);if(t==null||t===``)return null;let n=Number(t);return Number.isFinite(n)?n:null}function ra(e){let t=new URLSearchParams(e).get(`allDeps`);return t===`1`?!0:t===`0`?!1:null}function ia(e){return Math.max(0,Math.min(10,e))}function aa(e){let t=Yi(e),n=new URLSearchParams(e).get(`selected`),r=Zi(e),i=Ki(e)||r===`lineage`,a=ta(e),o=na(e),s=ra(e),c=ea(e);return{rootResourceId:t,selectedResourceId:i?n??t:t,upstreamDepth:ia(a??2),downstreamDepth:ia(o??2),allDepsMode:s??!1,lensMode:c??`type`,activeLegendKeys:new Set}}var oa=`dbt-tools.sidebarCollapsed`;function sa(e=!0){try{let e=window.localStorage.getItem(oa);if(e!==null)return e===`true`}catch{}return e}function ca(e,t){return qi(t)===e.view}function la({id:e}){let t={viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,width:20,height:20,"aria-hidden":!0};return e===`health`?(0,U.jsx)(`svg`,{...t,children:(0,U.jsx)(`polyline`,{points:`2,12 6,12 8,5 10,19 13,12 15,12 17,8 19,12 22,12`})}):e===`runs`?(0,U.jsxs)(`svg`,{...t,children:[(0,U.jsx)(`rect`,{x:`3`,y:`4`,width:`3`,height:`16`,rx:`1`}),(0,U.jsx)(`rect`,{x:`9`,y:`8`,width:`3`,height:`12`,rx:`1`}),(0,U.jsx)(`rect`,{x:`15`,y:`6`,width:`3`,height:`14`,rx:`1`}),(0,U.jsx)(`rect`,{x:`21`,y:`10`,width:`0`,height:`0`}),(0,U.jsx)(`line`,{x1:`3`,y1:`20`,x2:`21`,y2:`20`})]}):e===`timeline`?(0,U.jsxs)(`svg`,{...t,children:[(0,U.jsx)(`path`,{d:`M4 18V7`}),(0,U.jsx)(`path`,{d:`M10 18V11`}),(0,U.jsx)(`path`,{d:`M16 18V5`}),(0,U.jsx)(`path`,{d:`M2 18h20`}),(0,U.jsx)(`path`,{d:`M4 9h3M10 13h3M16 7h3`})]}):e===`inventory`?(0,U.jsxs)(`svg`,{...t,children:[(0,U.jsx)(`path`,{d:`M2 7l10-4 10 4-10 4-10-4z`}),(0,U.jsx)(`path`,{d:`M2 12l10 4 10-4`}),(0,U.jsx)(`path`,{d:`M2 17l10 4 10-4`})]}):e===`settings`?(0,U.jsxs)(`svg`,{...t,children:[(0,U.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`}),(0,U.jsx)(`path`,{d:`M12 2.75v2.5`}),(0,U.jsx)(`path`,{d:`M12 18.75v2.5`}),(0,U.jsx)(`path`,{d:`M21.25 12h-2.5`}),(0,U.jsx)(`path`,{d:`M5.25 12h-2.5`}),(0,U.jsx)(`path`,{d:`M18.54 5.46l-1.77 1.77`}),(0,U.jsx)(`path`,{d:`M7.23 16.77l-1.77 1.77`}),(0,U.jsx)(`path`,{d:`M18.54 18.54l-1.77-1.77`}),(0,U.jsx)(`path`,{d:`M7.23 7.23L5.46 5.46`})]}):(0,U.jsxs)(`svg`,{...t,children:[(0,U.jsx)(`path`,{d:`M4 7h16`}),(0,U.jsx)(`path`,{d:`M4 12h9`}),(0,U.jsx)(`path`,{d:`M4 17h13`})]})}var ua=`Waiting for artifacts`,da=`Live target`,fa=`Local upload`;function pa({activeView:e,setNavigationTarget:t,sidebarCollapsed:n,setSidebarCollapsed:r,onNavigate:i,analysis:a,analysisSource:o}){let s=o===`preload`?da:o===`upload`?fa:ua;return(0,U.jsxs)(`aside`,{id:`app-sidebar`,className:`app-sidebar${n?` app-sidebar--collapsed`:``}`,children:[(0,U.jsxs)(`button`,{type:`button`,className:`app-sidebar__brand-link`,onClick:()=>{t({view:`health`}),i()},title:`Go to Health`,children:[(0,U.jsx)(Ui,{className:`app-logo app-logo--brand`}),!n&&(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`strong`,{children:`dbt-tools`}),(0,U.jsx)(`span`,{children:`Artifact operations console`})]})]}),(0,U.jsx)(`nav`,{className:`app-sidebar__nav`,"aria-label":`Workspace sections`,children:(0,U.jsx)(`div`,{className:`nav-group`,children:Wi.map(n=>{let r=!a;return(0,U.jsxs)(`button`,{type:`button`,className:ca(n,e)?`sidebar-link sidebar-link--active`:`sidebar-link`,disabled:r,onClick:()=>{t(n),i()},"aria-label":n.label,title:n.label,children:[(0,U.jsx)(`span`,{className:`sidebar-link__icon`,children:(0,U.jsx)(la,{id:n.id})}),(0,U.jsx)(`div`,{className:`sidebar-link__body`,children:(0,U.jsx)(`strong`,{children:n.label})})]},n.id)})})}),(0,U.jsx)(`button`,{type:`button`,className:`sidebar-toggle`,onClick:()=>r(e=>!e),"aria-label":n?`Expand sidebar`:`Collapse sidebar`,children:n?`›`:`‹`}),(0,U.jsxs)(`div`,{className:`app-sidebar__footer`,children:[(0,U.jsxs)(`button`,{type:`button`,className:e===`settings`?`sidebar-link sidebar-link--active sidebar-settings-trigger`:`sidebar-link sidebar-settings-trigger`,onClick:()=>{t({view:`settings`}),i()},"aria-current":e===`settings`?`page`:void 0,"aria-label":`Open settings`,title:`Settings`,children:[(0,U.jsx)(`span`,{className:`sidebar-link__icon`,children:(0,U.jsx)(la,{id:`settings`})}),!n&&(0,U.jsx)(`div`,{className:`sidebar-link__body`,children:(0,U.jsx)(`strong`,{children:`Settings`})})]}),!n&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:`sidebar-settings-divider`}),(0,U.jsxs)(`div`,{className:`app-sidebar__session`,children:[(0,U.jsx)(`p`,{className:`eyebrow`,children:`Session`}),(0,U.jsx)(`strong`,{children:s}),(0,U.jsx)(`span`,{children:a?`${a.summary.total_nodes} executions analyzed`:ua})]})]})]})]})}function ma({className:e,style:t}){return(0,U.jsx)(`div`,{className:[`skeleton`,e].filter(Boolean).join(` `),style:t,"aria-hidden":`true`})}function ha(){return(0,U.jsxs)(`div`,{className:`loading-card`,children:[(0,U.jsx)(ma,{className:`loading-card__skeleton-icon`}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(ma,{className:`loading-card__skeleton-title`}),(0,U.jsx)(ma,{className:`loading-card__skeleton-body`})]})]})}var ga=`workspace-pill workspace-pill--active`,_a=`workspace-pill`;function va(e){return e===`preload`?`Live target`:e===`upload`?`Local upload`:`Waiting for artifacts`}function ya(e){return e?ga:_a}function ba({analysisSource:e,executionCount:t}){return(0,U.jsxs)(`section`,{className:`settings-hero`,"aria-label":`Workspace preferences`,children:[(0,U.jsx)(`p`,{className:`eyebrow`,children:`Workspace profile`}),(0,U.jsx)(`h3`,{children:`Configure how this console looks and behaves by default.`}),(0,U.jsx)(`p`,{children:`Changes save locally and apply to the current workspace immediately when the relevant view is open.`}),(0,U.jsxs)(`div`,{className:`settings-chip-row`,children:[(0,U.jsx)(`span`,{className:`app-badge`,children:va(e)}),(0,U.jsx)(`span`,{className:`settings-chip`,children:t==null?`No artifacts loaded`:`${t} executions loaded`})]})]})}function xa({themePreference:e,onThemeChange:t}){return(0,U.jsx)(K,{title:`Appearance`,subtitle:`Choose how the workspace chrome should render by default.`,children:(0,U.jsxs)(`div`,{className:`settings-field-group`,children:[(0,U.jsx)(`span`,{className:`settings-field-label`,children:`Theme`}),(0,U.jsx)(`div`,{className:`settings-segmented`,children:[`system`,`light`,`dark`].map(n=>(0,U.jsx)(`button`,{type:`button`,className:ya(e===n),onClick:()=>t(n),children:n===`system`?`System`:n.charAt(0).toUpperCase()+n.slice(1)},n))})]})})}function Sa({analysisSource:e,executionCount:t,onLoadDifferent:n}){return(0,U.jsx)(K,{title:`Session`,subtitle:`Current artifact source and data-loading controls.`,children:(0,U.jsxs)(`div`,{className:`settings-stack`,children:[(0,U.jsxs)(`div`,{className:`settings-readout`,children:[(0,U.jsx)(`span`,{className:`settings-field-label`,children:`Current source`}),(0,U.jsx)(`strong`,{children:va(e)}),(0,U.jsx)(`p`,{children:t==null?`Load artifacts to unlock analysis views.`:`${t} executions are available in this session.`})]}),(0,U.jsx)(`button`,{type:`button`,className:`primary-action settings-primary-action`,onClick:n,children:`Load different artifacts`})]})})}function Ca({preferences:e,setPreferences:t}){return(0,U.jsx)(K,{title:`Shell Defaults`,subtitle:`Control the default shape of the workspace chrome.`,children:(0,U.jsxs)(`div`,{className:`settings-field-group`,children:[(0,U.jsx)(`span`,{className:`settings-field-label`,children:`Sidebar`}),(0,U.jsxs)(`div`,{className:`settings-segmented`,children:[(0,U.jsx)(`button`,{type:`button`,className:ya(!e.sidebarCollapsedDefault),onClick:()=>t(e=>({...e,sidebarCollapsedDefault:!1})),children:`Expanded`}),(0,U.jsx)(`button`,{type:`button`,className:ya(e.sidebarCollapsedDefault),onClick:()=>t(e=>({...e,sidebarCollapsedDefault:!0})),children:`Collapsed`})]})]})})}function wa({preferences:e,setPreferences:t}){return(0,U.jsx)(K,{title:`Timeline Defaults`,subtitle:`Set the default execution timeline filters and dependency focus.`,children:(0,U.jsxs)(`div`,{className:`settings-stack`,children:[(0,U.jsxs)(`div`,{className:`settings-inline-grid`,children:[(0,U.jsxs)(`label`,{className:`settings-toggle`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:e.timelineDefaults.showTests,onChange:e=>t(t=>({...t,timelineDefaults:{...t.timelineDefaults,showTests:e.target.checked}}))}),(0,U.jsx)(`span`,{children:`Show tests by default`})]}),(0,U.jsxs)(`label`,{className:`settings-toggle`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:e.timelineDefaults.failuresOnly,onChange:e=>t(t=>({...t,timelineDefaults:{...t.timelineDefaults,failuresOnly:e.target.checked}}))}),(0,U.jsx)(`span`,{children:`Start with failures-only emphasis`})]})]}),(0,U.jsxs)(`div`,{className:`settings-inline-grid`,children:[(0,U.jsxs)(`label`,{className:`settings-field`,children:[(0,U.jsx)(`span`,{className:`settings-field-label`,children:`Dependency direction`}),(0,U.jsxs)(`select`,{value:e.timelineDefaults.dependencyDirection,onChange:e=>t(t=>({...t,timelineDefaults:{...t.timelineDefaults,dependencyDirection:e.target.value}})),children:[(0,U.jsx)(`option`,{value:`upstream`,children:`Upstream`}),(0,U.jsx)(`option`,{value:`both`,children:`Both`}),(0,U.jsx)(`option`,{value:`downstream`,children:`Downstream`})]})]}),(0,U.jsxs)(`label`,{className:`settings-field`,children:[(0,U.jsx)(`span`,{className:`settings-field-label`,children:`Dependency depth`}),(0,U.jsx)(`input`,{type:`number`,min:`1`,max:`10`,value:e.timelineDefaults.dependencyDepthHops,onChange:e=>t(t=>({...t,timelineDefaults:{...t.timelineDefaults,dependencyDepthHops:Math.max(1,Math.min(10,Number(e.target.value)||1))}}))})]})]})]})})}function Ta({preferences:e,setPreferences:t}){return(0,U.jsx)(K,{title:`Inventory Defaults`,subtitle:`Choose how asset exploration and lineage open by default.`,children:(0,U.jsxs)(`div`,{className:`settings-stack`,children:[(0,U.jsxs)(`div`,{className:`settings-inline-grid`,children:[(0,U.jsxs)(`label`,{className:`settings-field`,children:[(0,U.jsx)(`span`,{className:`settings-field-label`,children:`Explorer mode`}),(0,U.jsxs)(`select`,{value:e.inventoryDefaults.explorerMode,onChange:e=>t(t=>({...t,inventoryDefaults:{...t.inventoryDefaults,explorerMode:e.target.value}})),children:[(0,U.jsx)(`option`,{value:`project`,children:`Project`}),(0,U.jsx)(`option`,{value:`database`,children:`Database`})]})]}),(0,U.jsxs)(`label`,{className:`settings-field`,children:[(0,U.jsx)(`span`,{className:`settings-field-label`,children:`Lineage lens`}),(0,U.jsxs)(`select`,{value:e.inventoryDefaults.lineageLensMode,onChange:e=>t(t=>({...t,inventoryDefaults:{...t.inventoryDefaults,lineageLensMode:e.target.value}})),children:[(0,U.jsx)(`option`,{value:`type`,children:`Type`}),(0,U.jsx)(`option`,{value:`status`,children:`Status`}),(0,U.jsx)(`option`,{value:`coverage`,children:`Coverage`})]})]})]}),(0,U.jsxs)(`div`,{className:`settings-inline-grid`,children:[(0,U.jsxs)(`label`,{className:`settings-field`,children:[(0,U.jsx)(`span`,{className:`settings-field-label`,children:`Upstream depth`}),(0,U.jsx)(`input`,{type:`number`,min:`1`,max:`10`,value:e.inventoryDefaults.lineageUpstreamDepth,onChange:e=>t(t=>({...t,inventoryDefaults:{...t.inventoryDefaults,lineageUpstreamDepth:Math.max(1,Math.min(10,Number(e.target.value)||1))}}))})]}),(0,U.jsxs)(`label`,{className:`settings-field`,children:[(0,U.jsx)(`span`,{className:`settings-field-label`,children:`Downstream depth`}),(0,U.jsx)(`input`,{type:`number`,min:`1`,max:`10`,value:e.inventoryDefaults.lineageDownstreamDepth,onChange:e=>t(t=>({...t,inventoryDefaults:{...t.inventoryDefaults,lineageDownstreamDepth:Math.max(1,Math.min(10,Number(e.target.value)||1))}}))})]})]}),(0,U.jsxs)(`label`,{className:`settings-toggle`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:e.inventoryDefaults.allDepsMode,onChange:e=>t(t=>({...t,inventoryDefaults:{...t.inventoryDefaults,allDepsMode:e.target.checked}}))}),(0,U.jsx)(`span`,{children:`Open lineage with all dependencies expanded`})]})]})})}function Ea({preferences:e,setPreferences:t,themePreference:n,setThemePreference:r,analysisSource:i,executionCount:a,onLoadDifferent:o}){return(0,U.jsx)(Ie,{title:`Settings`,description:`Workspace defaults, visual preferences, and session controls.`,className:`settings-view`,children:(0,U.jsxs)(`div`,{className:`settings-grid`,children:[(0,U.jsx)(ba,{analysisSource:i,executionCount:a}),(0,U.jsx)(xa,{themePreference:n,onThemeChange:e=>{r(e),t(t=>({...t,theme:e}))}}),(0,U.jsx)(Sa,{analysisSource:i,executionCount:a,onLoadDifferent:o}),(0,U.jsx)(Ca,{preferences:e,setPreferences:t}),(0,U.jsx)(wa,{preferences:e,setPreferences:t}),(0,U.jsx)(Ta,{preferences:e,setPreferences:t})]})})}function Da(e){return e===`preload`?`Live target`:e===`upload`?`Local upload`:`Waiting for artifacts`}function Oa({kind:e}){let t={fill:`none`,stroke:`currentColor`,strokeWidth:1.8,strokeLinecap:`round`,strokeLinejoin:`round`};return e===`invocation`?(0,U.jsxs)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,U.jsx)(`path`,{...t,d:`M20 12.5V7a2 2 0 0 0-2-2h-6.2a2 2 0 0 0-1.4.58l-4.82 4.82A2 2 0 0 0 5 11.82V17a2 2 0 0 0 2 2h5.5`}),(0,U.jsx)(`path`,{...t,d:`M9 5v4a2 2 0 0 1-2 2H5`}),(0,U.jsx)(`circle`,{...t,cx:`17.5`,cy:`17.5`,r:`3.5`})]}):e===`time`?(0,U.jsxs)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,U.jsx)(`circle`,{...t,cx:`12`,cy:`12`,r:`8`}),(0,U.jsx)(`path`,{...t,d:`M12 7.8v4.6l3 1.8`})]}):e===`project`?(0,U.jsx)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,U.jsx)(`path`,{...t,d:`M3.5 8.5a2 2 0 0 1 2-2h3l1.4 1.7h8.6a2 2 0 0 1 2 2v7.5a2 2 0 0 1-2 2h-13a2 2 0 0 1-2-2z`})}):(0,U.jsxs)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,U.jsx)(`path`,{...t,d:`M11.25 4.75 5.5 7.7v4.55c0 3.65 2.7 6.95 6.5 7.95 3.8-1 6.5-4.3 6.5-7.95V7.7z`}),(0,U.jsx)(`path`,{...t,d:`M9.4 12.15 11.2 14l3.35-3.45`})]})}function ka(e,t){let n=e?.projectName??null,r=e?.invocationId??null,i=e?.warehouseType??null,a=e?ne(e):null,o=a==null?null:H(a);return{label:n??`Workspace session`,subtitle:n==null&&r==null&&o==null?`Load artifacts to populate session details.`:null,summaryItems:[r?{key:`invocation`,label:`Invocation ID`,value:r,icon:`invocation`}:null,o?{key:`timestamp`,label:`Timestamp`,value:o,icon:`time`}:null,{key:`source`,label:`Source mode`,value:Da(t),icon:`source`},i?{key:`warehouse`,label:`Warehouse type`,value:i.charAt(0).toUpperCase()+i.slice(1),icon:`project`}:null].filter(e=>e!=null)}}function Aa({summaryItems:e}){return(0,U.jsx)(`div`,{className:`app-header__summary-grid`,"aria-label":`Session metadata`,children:e.map(e=>(0,U.jsxs)(`div`,{className:`app-header__summary-item`,children:[(0,U.jsx)(`span`,{className:`app-header__summary-icon`,children:(0,U.jsx)(Oa,{kind:e.icon})}),(0,U.jsxs)(`span`,{className:`app-header__summary-copy`,children:[(0,U.jsx)(`span`,{className:`app-header__summary-label`,children:e.label}),(0,U.jsx)(`strong`,{className:`app-header__summary-value`,children:e.value})]})]},e.key))})}function ja({header:e}){return(0,U.jsxs)(`div`,{className:`app-header__identity`,children:[(0,U.jsx)(`p`,{className:`eyebrow`,title:e.label,children:e.label}),e.subtitle?(0,U.jsx)(`p`,{className:`app-header__subheadline`,children:e.subtitle}):null,(0,U.jsx)(Aa,{summaryItems:e.summaryItems})]})}function Ma({analysis:e,searchState:t,setSearchState:n,omniboxResults:r,handleNavigateTo:i}){let a=t.query.trim().length>0;return(0,U.jsxs)(`div`,{className:`app-header__omnibox`,children:[(0,U.jsx)(`label`,{className:`app-header__search-control`,children:(0,U.jsxs)(`div`,{className:`app-header__search-shell`,children:[(0,U.jsxs)(`svg`,{className:`workspace-search__icon`,viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,U.jsx)(`circle`,{cx:`11`,cy:`11`,r:`6.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`}),(0,U.jsx)(`path`,{d:`M16 16l4 4`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`})]}),(0,U.jsx)(`input`,{value:t.query,onFocus:()=>n(e=>({...e,isOpen:!0})),onChange:e=>n(t=>({...t,query:e.target.value,isOpen:!0})),placeholder:`Search runs, pipelines, assets...`,"aria-label":`Global search`})]})}),t.isOpen&&e&&(0,U.jsx)(`div`,{className:`omnibox-results`,children:r.loading&&a?(0,U.jsx)(`div`,{className:`omnibox-results__empty`,children:`Searching…`}):r.results.length>0?r.results.map(e=>(0,U.jsxs)(`button`,{type:`button`,className:`omnibox-results__item`,onClick:()=>{n(t=>({...t,isOpen:!1,recentResourceIds:[e.uniqueId,...t.recentResourceIds.filter(t=>t!==e.uniqueId)].slice(0,8)})),i(`inventory`,{resourceId:e.uniqueId,assetTab:`summary`})},children:[(0,U.jsx)(`strong`,{children:e.name}),(0,U.jsx)(`span`,{children:e.resourceType})]},e.uniqueId)):(0,U.jsx)(`div`,{className:`omnibox-results__empty`,children:a?`No matching resources`:`Recent items will appear here`})})]})}function Na({activeView:e,analysis:t,analysisSource:n,preloadLoading:r,preferences:i,setPreferences:a,themePreference:o,setThemePreference:s,onLoadDifferent:c,onAnalysis:l,onError:u,workspaceSignals:d,overviewFilters:f,setOverviewFilters:p,timelineFilters:m,setTimelineFilters:h,assetViewState:g,setAssetViewState:_,runsViewState:v,setRunsViewState:y,lineageViewState:b,setLineageViewState:x,investigationSelection:S,setInvestigationSelection:C,handleNavigateTo:w}){return e===`settings`?(0,U.jsx)(Ea,{preferences:i,setPreferences:a,themePreference:o,setThemePreference:s,analysisSource:n,executionCount:t?.summary.total_nodes??null,onLoadDifferent:c}):t?(0,U.jsx)(ki,{analysis:t,activeView:e,analysisSource:n,overviewFilters:f,onOverviewFiltersChange:p,timelineFilters:m,onTimelineFiltersChange:h,assetViewState:g,onAssetViewStateChange:_,runsViewState:v,onRunsViewStateChange:y,lineageViewState:b,onLineageViewStateChange:x,investigationSelection:S,onInvestigationSelectionChange:C,onNavigateTo:w,workspaceSignals:d}):r?(0,U.jsx)(ha,{}):(0,U.jsx)(Ri,{onAnalysis:l,onError:u})}function Pa({workspace:e,analysis:t,analysisSource:n,error:r,preloadLoading:i,onLoadDifferent:a,onAnalysis:o,onError:s,themePreference:c,setThemePreference:l,preferences:u,setPreferences:d,workspaceSignals:f}){let{activeView:p,sidebarCollapsed:m,setSidebarCollapsed:h,sidebarOpen:g,setSidebarOpen:_,overviewFilters:v,setOverviewFilters:y,timelineFilters:b,setTimelineFilters:x,assetViewState:S,setAssetViewState:C,runsViewState:w,setRunsViewState:T,lineageViewState:E,setLineageViewState:D,searchState:O,setSearchState:k,investigationSelection:A,setInvestigationSelection:j,setNavigationTarget:M,handleNavigateTo:N,frameClass:P}=e,F=Vi(t,O),I=ka(t,n);return(0,U.jsxs)(`div`,{className:P,children:[g&&(0,U.jsx)(`div`,{className:`sidebar-backdrop`,role:`presentation`,onClick:()=>_(!1)}),(0,U.jsx)(pa,{activeView:p,setNavigationTarget:M,sidebarCollapsed:m,setSidebarCollapsed:h,onNavigate:()=>_(!1),analysis:t,analysisSource:n}),(0,U.jsxs)(`main`,{className:`app-main`,children:[(0,U.jsxs)(`header`,{className:`app-header app-header--workspace`,children:[(0,U.jsx)(`button`,{type:`button`,className:`hamburger-btn`,"aria-label":`Open navigation`,"aria-expanded":g,"aria-controls":`app-sidebar`,onClick:()=>_(!0),children:(0,U.jsx)(`span`,{"aria-hidden":`true`,children:`☰`})}),(0,U.jsx)(ja,{header:I}),(0,U.jsx)(Ma,{analysis:t,searchState:O,setSearchState:k,omniboxResults:F,handleNavigateTo:N})]}),r&&(0,U.jsx)(Ai,{message:r}),(0,U.jsx)(Na,{activeView:p,analysis:t,analysisSource:n,preloadLoading:i,preferences:u,setPreferences:d,themePreference:c,setThemePreference:l,onLoadDifferent:a,onAnalysis:o,onError:s,workspaceSignals:f,overviewFilters:v,setOverviewFilters:y,timelineFilters:b,setTimelineFilters:x,assetViewState:S,setAssetViewState:C,runsViewState:w,setRunsViewState:T,lineageViewState:E,setLineageViewState:D,investigationSelection:A,setInvestigationSelection:j,handleNavigateTo:N})]})]})}function Fa(e,t){let n=e.executions.filter(e=>e.statusTone===`danger`).length,r=e.executions.filter(e=>e.statusTone===`warning`).length,i=e.executions.filter(e=>[`test`,`unit_test`].includes(e.resourceType)).length,a=e.resources.filter(e=>!!e.description?.trim()).length,o=e.resources.length>0?Math.round(a/e.resources.length*100):0;return[{label:`Run posture`,value:n>0?`${n} failing`:r>0?`${r} warning`:`Healthy`,detail:n>0?`Prioritize failing nodes before reviewing downstream impact.`:r>0?`Warnings detected; review tests and exposures next.`:`No failing nodes surfaced in this run.`,tone:n>0?`danger`:r>0?`warning`:`positive`},{label:`Metadata coverage`,value:`${o}%`,detail:`${a} of ${e.resources.length} resources include descriptions for catalog-style discovery.`,tone:o>=70?`positive`:o>=35?`warning`:`neutral`},{label:`Workspace mode`,value:t===`preload`?`Live target`:`Artifact upload`,detail:t===`preload`?`Synced from DBT_TARGET with ${e.graphSummary.totalEdges} dependency edges ready for investigation.`:`${e.summary.total_nodes} executions loaded from local artifacts${i>0?`, including ${i} tests`:``}.`,tone:`neutral`}]}async function Ia(){let[e,t]=await Promise.all([fetch(`/api/manifest.json`),fetch(`/api/run_results.json`)]);if(!e.ok||!t.ok)return null;let[n,r]=await Promise.all([e.arrayBuffer(),t.arrayBuffer()]);return Ot(n,r,`preload`)}function La({setPreloadLoading:e,setAnalysis:t,setAnalysisSource:n,setError:r,pendingMetricsRef:i}){let a=(0,d.useRef)(!1);(0,d.useEffect)(()=>{a.current||(a.current=!0,Y(`Preload: fetching /api/manifest.json and /api/run_results.json`),Ia().then(a=>{e(!1),a&&(Y(`Preload: success, analysis loaded`),i.current=a.metrics,t(a.analysis),n(`preload`),r(null))}).catch(t=>{e(!1),Y(`Preload: error`,t),r(t instanceof Error?t.message:`Failed to load artifacts from server`)}))},[i,e,t,n,r])}function Ra(e,t,n,r){(0,d.useEffect)(()=>{},[e,r,t,n])}function za(){let[e,t]=(0,d.useState)(null),[n,r]=(0,d.useState)(null),[i,a]=(0,d.useState)(null),[o,s]=(0,d.useState)(!0),c=(0,d.useRef)(null);return La({setPreloadLoading:s,setAnalysis:t,setAnalysisSource:a,setError:r,pendingMetricsRef:c}),Ra(i,t,r,c),(0,d.useEffect)(()=>{if(e==null||c.current==null)return;let t=c.current;c.current=null,requestAnimationFrame(()=>{let e=`analysis-load:${t.requestId}:interactive`,n=`analysis-load:${t.requestId}:first-interactive-frame`;yt(e),bt(n,t.dispatchMarkName,e),Y(`Analysis load metrics`,{requestId:t.requestId,source:t.source,timings:t.timings})})},[e]),{analysis:e,analysisSource:i,error:n,preloadLoading:o,onLoadDifferent:()=>{t(null),a(null),r(null)},onAnalysis:e=>{c.current=e.metrics,a(`upload`),t(e.analysis)},onError:r}}var Ba=`dbt-tools.workspacePreferences`,$={theme:`system`,sidebarCollapsedDefault:!0,timelineDefaults:{showTests:!1,failuresOnly:!1,dependencyDirection:`both`,dependencyDepthHops:2},inventoryDefaults:{explorerMode:`project`,lineageLensMode:`type`,lineageUpstreamDepth:2,lineageDownstreamDepth:2,allDepsMode:!1}};function Va(e,t){return typeof e!=`number`||!Number.isFinite(e)?t:Math.max(1,Math.min(10,Math.round(e)))}function Ha(e){return e===`upstream`||e===`both`||e===`downstream`}function Ua(e){return e===`project`||e===`database`}function Wa(e){return e===`status`||e===`type`||e===`coverage`}function Ga(e){return e===`light`||e===`dark`||e===`system`}function Ka(e){if(!e)return $;try{let t=JSON.parse(e);return{theme:Ga(t.theme)?t.theme:$.theme,sidebarCollapsedDefault:typeof t.sidebarCollapsedDefault==`boolean`?t.sidebarCollapsedDefault:$.sidebarCollapsedDefault,timelineDefaults:{showTests:typeof t.timelineDefaults?.showTests==`boolean`?t.timelineDefaults.showTests:$.timelineDefaults.showTests,failuresOnly:typeof t.timelineDefaults?.failuresOnly==`boolean`?t.timelineDefaults.failuresOnly:$.timelineDefaults.failuresOnly,dependencyDirection:Ha(t.timelineDefaults?.dependencyDirection)?t.timelineDefaults.dependencyDirection:$.timelineDefaults.dependencyDirection,dependencyDepthHops:Va(t.timelineDefaults?.dependencyDepthHops,$.timelineDefaults.dependencyDepthHops)},inventoryDefaults:{explorerMode:Ua(t.inventoryDefaults?.explorerMode)?t.inventoryDefaults.explorerMode:$.inventoryDefaults.explorerMode,lineageLensMode:Wa(t.inventoryDefaults?.lineageLensMode)?t.inventoryDefaults.lineageLensMode:$.inventoryDefaults.lineageLensMode,lineageUpstreamDepth:Va(t.inventoryDefaults?.lineageUpstreamDepth,$.inventoryDefaults.lineageUpstreamDepth),lineageDownstreamDepth:Va(t.inventoryDefaults?.lineageDownstreamDepth,$.inventoryDefaults.lineageDownstreamDepth),allDepsMode:typeof t.inventoryDefaults?.allDepsMode==`boolean`?t.inventoryDefaults.allDepsMode:$.inventoryDefaults.allDepsMode}}}catch{return $}}function qa(){let[e,t]=(0,d.useState)(()=>{try{return Ka(window.localStorage.getItem(Ba))}catch{return $}});return(0,d.useEffect)(()=>{try{window.localStorage.setItem(Ba,JSON.stringify(e))}catch{}},[e]),{preferences:e,setPreferences:t}}var Ja=(e,t)=>({activeTab:Qi(e),expandedNodeIds:new Set,explorerMode:t?.inventoryDefaults.explorerMode??`project`,status:`all`,resourceTypes:new Set,resourceQuery:``,selectedResourceId:Yi(e),upstreamDepth:ta(e)??t?.inventoryDefaults.lineageUpstreamDepth??2,downstreamDepth:na(e)??t?.inventoryDefaults.lineageDownstreamDepth??2,allDepsMode:ra(e)??t?.inventoryDefaults.allDepsMode??!1,lensMode:ea(e)??t?.inventoryDefaults.lineageLensMode??`type`,activeLegendKeys:new Set}),Ya=e=>{let t=Ji(e);return{kind:$i(e)??`all`,status:`all`,query:``,resourceTypes:new Set,threadIds:new Set,durationBand:`all`,sortBy:`attention`,groupBy:`none`,selectedExecutionId:t===`runs`?Xi(e):null}},Xa=(e,t)=>{let n=Ji(e),r=n===`runs`||n===`timeline`?Xi(e):null;return{query:``,activeStatuses:new Set,activeTypes:new Set,selectedExecutionId:r,showTests:t?.timelineDefaults.showTests??!1,failuresOnly:t?.timelineDefaults.failuresOnly??!1,dependencyDirection:t?.timelineDefaults.dependencyDirection??`both`,dependencyDepthHops:t?.timelineDefaults.dependencyDepthHops??2,timeWindow:null}},Za=e=>{let t=Ji(e)??`health`,n=Yi(e),r=Xi(e);return{selectedResourceId:n,selectedExecutionId:t===`runs`||t===`timeline`?r:null,sourceLens:null}};function Qa(e,t){return{activeView:Ji(e)??`health`,assetViewState:Ja(e,t),runsViewState:Ya(e),timelineFilters:Xa(e,t),lineageViewState:{...aa(e),upstreamDepth:ta(e)??t?.inventoryDefaults.lineageUpstreamDepth??2,downstreamDepth:na(e)??t?.inventoryDefaults.lineageDownstreamDepth??2,allDepsMode:ra(e)??t?.inventoryDefaults.allDepsMode??!1,lensMode:ea(e)??t?.inventoryDefaults.lineageLensMode??`type`},investigationSelection:Za(e)}}function $a(e){let t=Ji(e),n=Yi(e),r=Xi(e);return{activeView:t??void 0,assetViewState:t=>({...t,selectedResourceId:n,activeTab:Qi(e)}),runsViewState:n=>({...n,kind:$i(e)??n.kind,selectedExecutionId:t===`runs`?r:null}),timelineFilters:e=>({...e,selectedExecutionId:t===`timeline`?r:null}),lineageViewState:aa(e),investigationSelection:e=>({...e,selectedResourceId:n,selectedExecutionId:t===`runs`||t===`timeline`?r:null,sourceLens:e.sourceLens})}}var eo=[`resource`,`assetTab`,`selected`,`kind`,`up`,`down`,`allDeps`,`lens`];function to(e,t){for(let n of eo)t?.has(n)||e.searchParams.delete(n)}function no(e,t,n){t.selectedResourceId?e.searchParams.set(`resource`,t.selectedResourceId):e.searchParams.delete(`resource`),e.searchParams.set(`assetTab`,t.activeTab),e.searchParams.delete(`kind`),t.activeTab===`lineage`?(n.selectedResourceId?e.searchParams.set(`selected`,n.selectedResourceId):e.searchParams.delete(`selected`),e.searchParams.set(`up`,String(n.upstreamDepth)),e.searchParams.set(`down`,String(n.downstreamDepth)),e.searchParams.set(`allDeps`,n.allDepsMode?`1`:`0`),e.searchParams.set(`lens`,n.lensMode)):to(e,new Set([`resource`,`assetTab`]))}function ro(e,t){e.searchParams.set(`kind`,t.kind),t.selectedExecutionId?e.searchParams.set(`selected`,t.selectedExecutionId):e.searchParams.delete(`selected`),to(e,new Set([`kind`,`selected`]))}function io(e,t){t?e.searchParams.set(`selected`,t):e.searchParams.delete(`selected`),to(e,new Set([`selected`]))}function ao(e){let{pathname:t,hash:n,activeView:r,assetViewState:i,runsViewState:a,timelineSelectedExecutionId:o,lineageViewState:s}=e,c=new URL(`http://local.invalid${t}${n}`);return c.searchParams.set(`view`,r),r===`inventory`?no(c,i,s):r===`runs`?ro(c,a):r===`timeline`?io(c,o):to(c),`${t}${c.search}${n}`}function oo(e){let t=(0,d.useRef)(!1),n=Qa(window.location.search,e),[r,i]=(0,d.useState)(()=>n.activeView),[a,o]=(0,d.useState)(()=>sa(e.sidebarCollapsedDefault)),[s,c]=(0,d.useState)(!1),[l,u]=(0,d.useState)({status:`all`,resourceTypes:new Set,query:``}),[f,p]=(0,d.useState)(()=>n.timelineFilters),[m,h]=(0,d.useState)(()=>n.assetViewState),[g,_]=(0,d.useState)(()=>n.runsViewState),[v,y]=(0,d.useState)(()=>n.lineageViewState),[b,x]=(0,d.useState)({query:``,recentResourceIds:[],isOpen:!1}),[S,C]=(0,d.useState)(()=>n.investigationSelection),w=(0,d.useCallback)(e=>{o(t=>{let n=e(t);try{window.localStorage.setItem(oa,String(n))}catch{}return n})},[]),T=(0,d.useCallback)(e=>{i(e.view===`search`?`inventory`:e.view)},[]),E=(0,d.useCallback)((e,t)=>{i(e),t?.resourceId?(h(e=>({...e,selectedResourceId:t.resourceId??e.selectedResourceId,activeTab:t.assetTab??e.activeTab})),y(e=>({...e,rootResourceId:t.rootResourceId??t.resourceId??e.rootResourceId,selectedResourceId:t.resourceId??e.selectedResourceId}))):t?.assetTab&&e===`inventory`&&h(e=>({...e,activeTab:t.assetTab??e.activeTab})),t?.executionId&&(_(e=>({...e,selectedExecutionId:t.executionId??e.selectedExecutionId})),p(e=>({...e,selectedExecutionId:t.executionId??e.selectedExecutionId}))),e===`runs`&&t?.resourceId&&_(e=>({...e,query:t.resourceId??e.query})),C(n=>({selectedResourceId:t?.resourceId??n.selectedResourceId,selectedExecutionId:t?.executionId??n.selectedExecutionId,sourceLens:e}))},[]);return(0,d.useEffect)(()=>{let e=ao({pathname:window.location.pathname,hash:window.location.hash,activeView:r,assetViewState:m,runsViewState:g,timelineSelectedExecutionId:f.selectedExecutionId,lineageViewState:v});e!==`${window.location.pathname}${window.location.search}${window.location.hash}`&&window.history.pushState(null,``,e)},[r,m,g,f.selectedExecutionId,v]),(0,d.useEffect)(()=>{let e=()=>{let e=$a(window.location.search);e.activeView!==void 0&&i(e.activeView),h(t=>e.assetViewState(t)),_(t=>e.runsViewState(t)),p(t=>e.timelineFilters(t)),y(e.lineageViewState),C(t=>e.investigationSelection(t))};return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]),(0,d.useEffect)(()=>{if(!t.current){t.current=!0;return}p(t=>({...t,showTests:e.timelineDefaults.showTests,failuresOnly:e.timelineDefaults.failuresOnly,dependencyDirection:e.timelineDefaults.dependencyDirection,dependencyDepthHops:e.timelineDefaults.dependencyDepthHops})),h(t=>({...t,explorerMode:e.inventoryDefaults.explorerMode})),y(t=>({...t,upstreamDepth:e.inventoryDefaults.lineageUpstreamDepth,downstreamDepth:e.inventoryDefaults.lineageDownstreamDepth,allDepsMode:e.inventoryDefaults.allDepsMode,lensMode:e.inventoryDefaults.lineageLensMode})),o(e.sidebarCollapsedDefault);try{window.localStorage.setItem(oa,String(e.sidebarCollapsedDefault))}catch{}},[e]),(0,d.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`k`&&(e.preventDefault(),x(e=>({...e,isOpen:!0}))),e.key===`Escape`&&(c(!1),x(e=>({...e,isOpen:!1})))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),{activeView:r,sidebarCollapsed:a,setSidebarCollapsed:w,sidebarOpen:s,setSidebarOpen:c,overviewFilters:l,setOverviewFilters:u,timelineFilters:f,setTimelineFilters:p,assetViewState:m,setAssetViewState:h,runsViewState:g,setRunsViewState:_,lineageViewState:v,setLineageViewState:y,searchState:b,setSearchState:x,investigationSelection:S,setInvestigationSelection:C,setNavigationTarget:T,handleNavigateTo:E,frameClass:[`app-frame`,a?`app-frame--sidebar-collapsed`:``,s?`app-frame--nav-open`:``].filter(Boolean).join(` `)}}function so(){let{toast:e}=Fi(),{preferences:t,setPreferences:n}=qa(),r=oo(t),{analysis:i,analysisSource:a,error:o,preloadLoading:s,onLoadDifferent:c,onAnalysis:l,onError:u}=za(),{themePreference:f,setThemePreference:p}=st();(0,d.useEffect)(()=>{t.theme!==f&&p(t.theme)},[t.theme,p,f]);let m=(0,d.useRef)(null);return(0,d.useEffect)(()=>{i&&!m.current&&a===`preload`&&e(`Workspace loaded — ${i.summary.total_nodes} executions`,`positive`),m.current=i},[i,a,e]),(0,U.jsx)(Pa,{workspace:r,analysis:i,analysisSource:a,error:o,preloadLoading:s,onLoadDifferent:c,onAnalysis:l,onError:u,themePreference:f,setPreferences:n,preferences:t,setThemePreference:p,workspaceSignals:i?Fa(i,a):[]})}function co(){return(0,U.jsx)(Pi,{children:(0,U.jsx)(so,{})})}(0,f.createRoot)(document.getElementById(`root`)).render((0,U.jsx)(d.StrictMode,{children:(0,U.jsx)(co,{})}));
|
package/dist/index.html
CHANGED
|
@@ -11,12 +11,12 @@
|
|
|
11
11
|
href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&family=Space+Grotesk:wght@500;600;700&display=swap"
|
|
12
12
|
rel="stylesheet"
|
|
13
13
|
/>
|
|
14
|
-
<script type="module" crossorigin src="/assets/index-
|
|
14
|
+
<script type="module" crossorigin src="/assets/index-zSNSA1E5.js"></script>
|
|
15
15
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-Dw2cE7zH.js">
|
|
16
16
|
<link rel="modulepreload" crossorigin href="/assets/react-vendor-DL38pS2M.js">
|
|
17
|
-
<link rel="modulepreload" crossorigin href="/assets/recharts-vendor-
|
|
18
|
-
<link rel="modulepreload" crossorigin href="/assets/tanstack-virtual-vendor-
|
|
19
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
17
|
+
<link rel="modulepreload" crossorigin href="/assets/recharts-vendor-Ds9sjKZG.js">
|
|
18
|
+
<link rel="modulepreload" crossorigin href="/assets/tanstack-virtual-vendor-DdCr1qam.js">
|
|
19
|
+
<link rel="stylesheet" crossorigin href="/assets/index-BKeq9m6P.css">
|
|
20
20
|
</head>
|
|
21
21
|
<body>
|
|
22
22
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dbt-tools/web",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"description": "Web application for visual dbt artifact analysis",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dbt",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"react": "^19.2.4",
|
|
20
20
|
"react-dom": "^19.2.4",
|
|
21
21
|
"recharts": "^3.8.1",
|
|
22
|
-
"@dbt-tools/core": "0.3.
|
|
23
|
-
"dbt-artifacts-parser": "0.3.
|
|
22
|
+
"@dbt-tools/core": "0.3.4",
|
|
23
|
+
"dbt-artifacts-parser": "0.3.4"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@playwright/test": "^1.58.2",
|