@continuous-excellence/ze-great-dashboard-aws 0.14.2 → 0.14.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/client/.vite/manifest.json +2 -2
- package/client/assets/index-1YsIVWxe.js +3 -0
- package/client/assets/index-1YsIVWxe.js.map +1 -0
- package/client/assets/index-BRONWQIP.css +1 -0
- package/client/index.html +2 -2
- package/dist/bootstrap-check.d.ts +2 -0
- package/dist/bootstrap.d.ts +2 -0
- package/dist/cli.js +242 -73
- package/dist/doctor.d.ts +2 -0
- package/dist/guided.d.ts +2 -0
- package/dist/handoff.d.ts +3 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +109 -9
- package/dist/remediation.d.ts +23 -0
- package/package.json +1 -1
- package/client/assets/index-B1CYozDH.js +0 -3
- package/client/assets/index-B1CYozDH.js.map +0 -1
- package/client/assets/index-BVFmOmLK.css +0 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{z as e}from"zod";import{StrictMode as t,useEffect as n,useMemo as r,useRef as i,useState as a,useSyncExternalStore as o}from"react";import{createRoot as s}from"react-dom/client";import{Fragment as c,jsx as l,jsxs as u}from"react/jsx-runtime";(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),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var d=/^(\d+)(ms|s|m|h)$/,f={ms:1,s:1e3,m:6e4,h:36e5};function p(e){let t=d.exec(e);if(!t)return null;let[,n,r]=t;if(n===void 0||r===void 0)return null;let i=Number(n);return i<=0?null:i*f[r]}var m=e.string().refine(e=>p(e)!==null,{message:`must be a positive duration like "30s", "5m", or "1h"`}).brand(),h=e.union([e.object({x:e.number().int().min(0),y:e.number().int().min(0),w:e.number().int().min(1).max(12),h:e.number().int().min(1)}),e.object({x:e.literal(0),y:e.literal(0),w:e.literal(0),h:e.literal(0)})]),ee=e.string().min(1),g=[`radial`,`runway`,`orbit`,`signal-field`,`telemetry-bloom`,`release-transit`,`status-weather`,`falling-shapes`],_=e.enum([...g,`off`]),te=e.looseObject({label:e.string().min(1).optional(),id:e.string().min(1),type:e.string().min(1),source:e.string().min(1).optional(),display:ee.optional(),position:h.optional(),refresh:m.optional(),running_refresh:m.optional(),running_completion_refresh:m.optional(),running_completion_window:m.optional(),running_animation:_.optional(),demo_run_duration:m.optional(),demo_review_duration:m.optional(),link:e.url().optional(),url:e.url().optional(),json_path:e.string().regex(/^\$(?:\.[A-Za-z_][A-Za-z0-9_]*|\[\d+\])*$/,`must be a simple JSON path`).optional()}),v=e.looseObject({type:e.string().min(1),token_env:e.string().min(1).optional()}),y=e.object({refresh:m.optional(),running_refresh:m.optional(),running_completion_refresh:m.optional(),running_completion_window:m.optional(),panels:e.array(te).min(1).superRefine((e,t)=>{let n=new Map;e.forEach((e,r)=>{let i=n.get(e.id);if(i===void 0){n.set(e.id,r);return}t.addIssue({code:`custom`,path:[r,`id`],message:`duplicate panel id "${e.id}" (already used by panel at index ${i})`})})})}),b=e.object({issuer:e.url(),client_id:e.string().min(1).optional(),allow:e.object({groups:e.array(e.string().min(1)).optional(),subjects:e.array(e.string().min(1)).optional()}).optional()});e.object({sources:e.record(e.string().min(1),v).default({}),boards:e.record(e.string().min(1),y),auth:b.optional()});var x=e.object({assetPath:e.string().min(1),proxyPath:e.string().min(1),board:e.string().min(1),clientVersion:e.string().min(1),auth:e.object({issuer:e.string().min(1),clientId:e.string().min(1).optional()}).optional()}),S=x.pick({assetPath:!0,clientVersion:!0});function C(t=globalThis.window?.env){let n=x.safeParse(t);if(!n.success)throw Error(`window.env is missing or invalid \u2014 the server did not inject usable configuration.
|
|
2
|
+
${e.prettifyError(n.error)}`);return n.data}var w=e.enum([`unreachable`,`unauthorized`,`not-found`,`no-runs`,`upstream-error`]),T=e.object({kind:w,message:e.string()}),ne=e.discriminatedUnion(`state`,[e.object({panelId:e.string().min(1),state:e.literal(`ok`),observedAt:e.iso.datetime(),link:e.url().nullable(),signal:e.unknown()}),e.object({panelId:e.string().min(1),state:e.literal(`error`),observedAt:e.iso.datetime(),link:e.url().nullable(),error:T})]),E=e.object({type:e.literal(`pipeline-status`),status:e.enum([`passed`,`failed`,`running`,`cancelled`,`unknown`]),rawStatus:e.string(),name:e.string().min(1),branch:e.string().min(1).optional(),durationMs:e.number().int().nonnegative().optional(),runStartedAt:e.iso.datetime().optional(),estimatedDurationMs:e.number().int().positive().optional(),sourceUpdatedAt:e.iso.datetime().optional()}),re=e.object({label:e.string().min(1),status:E.shape.status,detail:e.string().min(1),link:e.url().nullable()}),ie=e.object({type:e.literal(`pull-request-health`),status:E.shape.status,summary:e.string().min(1),workflows:e.array(re),pullRequests:e.array(re)}),ae=e.object({type:e.literal(`http-value`),value:e.union([e.string(),e.number(),e.boolean()])}),oe=12,se=12;function ce(e){let t=e.flatMap(e=>!e.position||D(e.position)||le(e.position)?[]:[{panelId:e.id,kind:`out-of-bounds`,position:e.position,conflictsWith:[]}]),n=new Map;for(let r=0;r<e.length;r++){let i=e[r];if(!(!i?.position||D(i.position)))for(let a=r+1;a<e.length;a++){let r=e[a];if(!r?.position||D(r.position)||!ue(i.position,r.position))continue;let o=`${r.id}\0overlap`,s=n.get(o);if(s)s.conflictsWith.push(i.id);else{let e={panelId:r.id,kind:`overlap`,position:r.position,conflictsWith:[i.id]};n.set(o,e),t.push(e)}}}return{issues:t}}function D(e){return e?.x===0&&e.y===0&&e.w===0&&e.h===0}function le(e){return!D(e)&&e.x+e.w<=oe&&e.y+e.h<=se}function ue(e,t){return e.x<t.x+t.w&&e.x+e.w>t.x&&e.y<t.y+t.h&&e.y+e.h>t.y}var O={refreshMillis:6e4,runningRefreshMillis:15e3,runningCompletionRefreshMillis:5e3,runningCompletionWindowMillis:12e4};function de(e,t){let n=(e,t)=>p(e??``)??t,r=(r,i,a)=>n(t[r],n(e[i],a));return{refreshMillis:r(`refresh`,`refresh`,O.refreshMillis),runningRefreshMillis:r(`running_refresh`,`running_refresh`,O.runningRefreshMillis),runningCompletionRefreshMillis:r(`running_completion_refresh`,`running_completion_refresh`,O.runningCompletionRefreshMillis),runningCompletionWindowMillis:r(`running_completion_window`,`running_completion_window`,O.runningCompletionWindowMillis)}}var k={board:`_board_91ffc_1`,header:`_header_91ffc_11`,title:`_title_91ffc_18`,grid:`_grid_91ffc_24`,footerTools:`_footerTools_91ffc_34`,layoutWarning:`_layoutWarning_91ffc_39`,layoutWarningButton:`_layoutWarningButton_91ffc_42`,layoutWarningDialog:`_layoutWarningDialog_91ffc_60`,layoutWarningHeading:`_layoutWarningHeading_91ffc_73`,layoutWarningClose:`_layoutWarningClose_91ffc_91`,layoutWarningDownloads:`_layoutWarningDownloads_91ffc_99`,layoutWarningNote:`_layoutWarningNote_91ffc_118`,footer:`_footer_91ffc_34`},A={diagnostics:`_diagnostics_lseur_1`,button:`_button_lseur_5`,area:`_area_lseur_14`,warning:`_warning_lseur_31`,panels:`_panels_lseur_35`,actions:`_actions_lseur_43`};function fe({log:e}){let[t,n]=a(!1);o(e.subscribe,e.snapshot,e.snapshot);let r=e.count(),i=e.summary();return u(`section`,{className:A.diagnostics,children:[u(`button`,{className:A.button,type:`button`,"aria-expanded":t,onClick:()=>n(!t),children:[`Diagnostics (`,r,`)`]}),t&&u(`div`,{className:A.area,children:[u(`p`,{children:[`Client `,e.clientVersion(),` · assets `,e.assetPath()]}),u(`p`,{children:[i.retained.eventCount,` retained browser-local events across`,` `,i.retained.sessionCount,` session`,i.retained.sessionCount===1?``:`s`,i.retained.firstEventAt&&i.retained.lastEventAt?` (${pe(i.retained.firstEventAt,i.retained.lastEventAt)})`:``,`. They are never uploaded.`]}),i.retained.evidenceMayBeIncomplete&&u(`p`,{className:A.warning,role:`alert`,children:[`Earlier evidence was pruned: `,i.retained.retention.eventsPrunedByCount,` at the 2,000-event cap and `,i.retained.retention.eventsPrunedByAge,` by the 7-day age limit. “No failures” applies only to the retained window.`]}),u(`p`,{children:[`Update failures: `,i.failures.clientUpdate,`; board fetch failures:`,` `,i.failures.boardFetch,`.`]}),i.panels.length>0&&l(`div`,{className:A.panels,children:i.panels.map(e=>u(`p`,{children:[l(`strong`,{children:e.panelId}),` — `,e.requests,` requests`,Object.keys(e.httpStatuses).length?`; HTTP ${Object.entries(e.httpStatuses).map(([e,t])=>`${e}×${t}`).join(`, `)}`:``,`; parse/network failures `,e.parseFailures,`/`,e.networkFailures,`; visible changes `,e.visibleStateChanges,`; latest`,` `,e.latestRendered?`${e.latestRendered.state}${e.latestRendered.status?`/${e.latestRendered.status}`:``}`:`not rendered`,`.`]},e.panelId))}),u(`div`,{className:A.actions,children:[l(`button`,{className:A.button,type:`button`,onClick:()=>{let t=new Blob([JSON.stringify(e.export(),null,2)],{type:`application/json`}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=`dashboard-diagnostics-${new Date().toISOString().replaceAll(`:`,`-`)}.json`,r.click(),URL.revokeObjectURL(n)},children:`Download`}),l(`button`,{className:A.button,type:`button`,onClick:()=>{window.confirm(`Clear this browser’s retained dashboard diagnostics?`)&&e.clear()},children:`Clear`})]})]})]})}function pe(e,t){return e===t?e:`${e} to ${t}`}function me(e,t){let n=new Map,r=new Set,i=0,a=0;for(let t of e){if(r.add(t.sessionId),t.kind===`client-update-failure`&&i++,(t.kind===`board-fetch-failure`||t.kind===`board-fetch-parse-failure`)&&a++,!(`panelId`in t))continue;let e=n.get(t.panelId)??{panelId:t.panelId,requests:0,httpStatuses:{},parseFailures:0,networkFailures:0,visibleStateChanges:0};if(t.kind===`panel-fetch-start`&&e.requests++,t.kind===`panel-fetch-response`&&t.status!==void 0){let n=String(t.status);e.httpStatuses[n]=(e.httpStatuses[n]??0)+1}t.kind===`panel-fetch-parse-failure`&&e.parseFailures++,t.kind===`panel-fetch-failure`&&e.networkFailures++,t.kind===`panel-rendered`&&(e.visibleStateChanges++,e.latestRendered=t.rendered),n.set(t.panelId,e)}let o=e.map(e=>e.at).sort(),s=t.eventsPrunedByAge+t.eventsPrunedByCount;return{retained:{eventCount:e.length,firstEventAt:o[0],lastEventAt:o.at(-1),sessionCount:r.size,retention:t,evidenceMayBeIncomplete:s>0},failures:{clientUpdate:i,boardFetch:a},panels:[...n.values()].sort((e,t)=>e.panelId.localeCompare(t.panelId))}}var j=`ze-great-dashboard.diagnostics.v1`,he=2e3,ge=6048e5,_e=[`session-start`,`client-update-check`,`client-update-failure`,`client-update-detected`,`board-fetch-start`,`board-fetch-response`,`board-fetch-parse-failure`,`board-fetch-failure`,`layout-analyzed`,`panel-fetch-start`,`panel-fetch-response`,`panel-fetch-parse-failure`,`panel-fetch-failure`,`panel-rendered`],ve=class{env;storage;now;events=[];retention=N();revision=0;listeners=new Set;sessionId=crypto.randomUUID?.()??`${Date.now()}-${Math.random()}`;constructor(e,t=xe(),n=()=>new Date){this.env=e,this.storage=t,this.now=n,this.events=this.read(),this.record({kind:`session-start`})}record(e){let t=P([...this.events,{...e,schemaVersion:1,at:this.now().toISOString(),sessionId:this.sessionId,board:this.env.board}],this.now(),this.retention);this.events=t.events,this.retention=t.retention,this.persist(),this.revision++,this.notify()}count=()=>this.events.length;clientVersion=()=>this.env.clientVersion;assetPath=()=>this.env.assetPath;snapshot=()=>this.revision;summary=()=>me(this.events,this.retention);clear(){this.events=[],this.retention=N();try{this.storage?.removeItem(j)}catch{}this.revision++,this.notify()}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});export=()=>({schemaVersion:1,exportedAt:this.now().toISOString(),client:{version:this.env.clientVersion,assetPath:this.env.assetPath,board:this.env.board,sessionId:this.sessionId},events:this.events,summary:this.summary()});read(){try{let e=this.storage?.getItem(j);if(!e)return[];let t=JSON.parse(e);if(t.schemaVersion!==1||!Array.isArray(t.events)||!t.events.every(be))return this.storage?.removeItem(j),[];let n=P(t.events.map(e=>({...e,schemaVersion:1})),this.now(),ye(t.retention));return this.retention=n.retention,n.events}catch{try{this.storage?.removeItem(j)}catch{}return[]}}persist(){try{this.storage?.setItem(j,JSON.stringify({schemaVersion:1,events:this.events,retention:this.retention}))}catch{}}notify(){for(let e of this.listeners)e()}};function M(e){let t=Object.fromEntries([[`cacheControl`,`cache-control`],[`etag`,`etag`],[`lastModified`,`last-modified`],[`date`,`date`],[`age`,`age`]].flatMap(([t,n])=>{let r=e.get(n);return r?[[t,r]]:[]}));return Object.keys(t).length?t:void 0}function N(){return{eventsPrunedByAge:0,eventsPrunedByCount:0}}function ye(e){if(!e||typeof e!=`object`)return N();let t=e;return{eventsPrunedByAge:typeof t.eventsPrunedByAge==`number`&&t.eventsPrunedByAge>=0?t.eventsPrunedByAge:0,eventsPrunedByCount:typeof t.eventsPrunedByCount==`number`&&t.eventsPrunedByCount>=0?t.eventsPrunedByCount:0}}function P(e,t,n){let r=t.valueOf()-ge,i=e.filter(e=>Number.isFinite(new Date(e.at).valueOf())&&new Date(e.at).valueOf()>=r),a=e.length-i.length,o=Math.max(0,i.length-he);return{events:i.slice(-2e3),retention:{eventsPrunedByAge:n.eventsPrunedByAge+a,eventsPrunedByCount:n.eventsPrunedByCount+o}}}function be(e){if(!e||typeof e!=`object`)return!1;let t=e;return(t.schemaVersion===void 0||t.schemaVersion===1)&&typeof t.at==`string`&&Number.isFinite(new Date(t.at).valueOf())&&typeof t.sessionId==`string`&&typeof t.board==`string`&&_e.includes(t.kind)}function xe(){try{return window.localStorage}catch{return}}var F={panel:`_panel_1vwpp_1`,content:`_content_1vwpp_21`,details:`_details_1vwpp_33`,error:`_error_1vwpp_41`,wide:`_wide_1vwpp_44`,primary:`_primary_1vwpp_47`,compact:`_compact_1vwpp_54`,label:`_label_1vwpp_64`,hint:`_hint_1vwpp_75`,branch:`_branch_1vwpp_81`,observed:`_observed_1vwpp_85`,stale:`_stale_1vwpp_91`,status:`_status_1vwpp_94`,passed:`_passed_1vwpp_102`,failed:`_failed_1vwpp_105`,running:`_running_1vwpp_108`,cancelled:`_cancelled_1vwpp_111`,unknown:`_unknown_1vwpp_112`,sourceAction:`_sourceAction_1vwpp_115`,shallow:`_shallow_1vwpp_145`};function Se({label:e,hint:t,wide:n=!1}){return u(`section`,{className:`${F.panel} ${n?F.wide:``}`,"data-panel":!0,"data-panel-id":`placeholder`,children:[l(`h2`,{className:F.label,children:e}),l(`p`,{className:F.hint,children:t})]})}var Ce={fact:`_fact_17pw7_1`};function we(e){let t=e.position;if(t)return{"--panel-column":`${t.x+1} / span ${t.w}`,"--panel-row":`${t.y+1} / span ${t.h}`}}function I({children:e}){return l(`p`,{className:F.hint,children:e})}function L({children:e,status:t}){return l(`p`,{className:`${F.status} ${t?F[t]:``}`,children:e})}function Te({children:e,title:t}){return l(`span`,{className:F.branch,title:t,children:e})}function Ee({children:e,stale:t=!1}){return l(`p`,{className:`${F.hint} ${F.observed} ${t?F.stale:``}`,children:e})}function R({panel:e,envelope:t,error:n=!1,field:r,children:i}){let a=e.display===`primary`||e.display===`compact`?e.display:`supporting`,o=e.position,s=o!==void 0&&o.h<=2,c=o!==void 0&&o.h<=3;return u(`section`,{className:`${F.panel} ${F[a]} ${s?F.shallow:``} ${c?F.short:``} ${n?F.error:``}`,style:we(e),"aria-busy":!t||void 0,"data-panel":!0,"data-panel-id":e.id,"data-panel-position":o?`${o.x},${o.y},${o.w},${o.h}`:void 0,"data-display":a,"data-shallow":s,"data-short":c,"data-error":n||void 0,children:[r,l(De,{panelId:e.id,link:t?.link}),u(`div`,{className:F.content,"data-panel-content":!0,children:[l(`h2`,{className:F.label,children:e.label??e.id}),i]})]})}function De({panelId:e,link:t}){return t?u(`a`,{className:F.sourceAction,href:t,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`View source for ${e} (opens in a new tab)`,title:`View source for ${e} (opens in a new tab)`,"data-panel-action":`source`,"data-panel-link":!0,children:[l(`span`,{"aria-hidden":`true`,children:`↗`}),l(`span`,{className:`screen-reader-only`,children:`View source`})]}):null}function z({value:e,label:t=`As of`}){let n=new Date(e),r=n.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}),i=Date.now()-n.getTime(),a=i>3e5,o=Oe(i);return u(Ee,{stale:a,children:[l(`span`,{"aria-hidden":`true`,children:`◷`}),` `,t,` `,r,` · `,o]})}function Oe(e){if(e<6e4)return`just now`;let t=Math.floor(e/6e4);return t<60?`${t}m ago`:`${Math.floor(t/60)}h ${t%60}m ago`}function ke({panel:e,envelope:t}){if(!t)return l(R,{panel:e,children:l(I,{children:`Loading…`})});if(t.state===`error`)return u(R,{panel:e,envelope:t,error:!0,children:[l(L,{children:`⚠ Unable to read`}),l(I,{children:t.error.message}),l(z,{value:t.observedAt})]});let n=ae.safeParse(t.signal);return n.success?l(R,{panel:e,envelope:t,children:u(`div`,{className:Ce.fact,children:[l(L,{children:String(n.data.value)}),l(z,{value:t.observedAt})]})}):u(R,{panel:e,envelope:t,error:!0,children:[l(L,{children:`⚠ Invalid value`}),l(z,{value:t.observedAt})]})}var Ae=.85,je=[[{x:0,y:0},{x:1,y:0}],[{x:0,y:0},{x:0,y:1}],[{x:0,y:0},{x:1,y:0},{x:0,y:1}],[{x:0,y:0},{x:1,y:0},{x:2,y:0}],[{x:0,y:0},{x:0,y:1},{x:1,y:1}]];function Me(e,t){return e>t?`horizontal`:`vertical`}function Ne(e,t=e===`horizontal`?12:3,n=e===`horizontal`?3:12){let r=Math.max(1,t*.8),i=Math.max(1,n*.8),a=Math.max(24,Math.min(42,Math.min(r,i)/4)),o=Math.max(3,Math.min(24,Math.round(r/a))),s=Math.max(3,Math.min(16,Math.round(i/a)));return e===`horizontal`?{columns:Math.max(o,s),rows:s}:{columns:o,rows:Math.max(s,o)}}function Pe(e){return Array.from(e).reduce((e,t)=>e*31+t.charCodeAt(0)>>>0,7)}function B(e,t,n){let r=Math.max(...e.map(e=>e.x)),i=Math.max(...e.map(e=>e.y));return r<t&&i<n}function V(e,t){return e.cells.some(n=>t.cells.some(r=>e.x+n.x===t.x+r.x&&e.y+n.y===t.y+r.y))}function Fe(e,t,n){let r=je.filter(e=>B(e,t,n));return r[H(e,r.length)]??[{x:0,y:0}]}function Ie(e,t,n,r,i,a=0,o=!1){let s=Math.max(...e.map(e=>e.x))+1,c=Math.max(...e.map(e=>e.y))+1,l=[];for(let a=0;a<=r-c;a++)for(let c=0;c<=n-s;c++){let s={id:-1,bornAt:0,cells:e,x:c,y:a,phase:`settled`};if(i.some(e=>V(s,e))||!Ue(e,t,n,r,s,i))continue;let u=t===`vertical`?e.filter(e=>a+e.y===r-1||i.some(t=>t.cells.some(n=>t.x+n.x===c+e.x&&t.y+n.y===a+e.y+1))).length:e.filter(e=>c+e.x===0||i.some(t=>t.cells.some(n=>t.x+n.x===c+e.x-1&&t.y+n.y===a+e.y))).length;o&&u<He(e,t)||l.push({x:c,y:a,support:u})}l.sort((e,n)=>n.support-e.support||(t===`vertical`?n.y-e.y||e.x-n.x:e.x-n.x||e.y-n.y));let u=l[0]?.support,d=l.filter(e=>e.support===u),f=d[H(a,d.length)];return f?{x:f.x,y:f.y}:void 0}function Le(e,t,n,r,i,a){let o=je.flatMap((o,s)=>{if(!B(o,t,n))return[];let c=Ie(o,e,t,n,r,i+s*31,a);return c?[{shape:o,destination:c}]:[]});if(o.length!==0)return o[H(i,o.length)]}function Re(e,t,n){return Math.ceil(e*t*Ae*Math.min(1,Math.max(0,n)))}function ze(e){return e.reduce((e,t)=>e+t.cells.length,0)}function Be(e,t,n,r,i){let a=e===`vertical`?n-1:0,o=new Set(r.flatMap(t=>t.cells.filter(n=>e===`vertical`?t.y+n.y===a:t.x+n.x===a).map(n=>e===`vertical`?t.x+n.x:t.y+n.y))),s=e===`vertical`?t:n,c=o.size===s;if(!c&&!i||o.size===0)return;let l=[];return{shapes:r.flatMap(t=>{let n=t.cells.filter(n=>{let r=e===`vertical`?t.y+n.y===a:t.x+n.x===a;return r&&l.push({x:t.x+n.x,y:t.y+n.y}),!r});return n.length===0?[]:[{...t,cells:n,y:e===`vertical`?t.y+1:t.y,x:e===`horizontal`?t.x-1:t.x}]}),cleared:l,complete:c}}function Ve(e,t,n,r,i){let a=[];for(let o=0;o<i;o+=1){let i=r+o*17,s=Fe(i,t,n),c=Ie(s,e,t,n,a,i+1);if(!c)break;a.push({id:o,bornAt:0,cells:s,x:c.x,y:c.y,phase:`settled`})}return a}function He(e,t){return t===`vertical`?new Set(e.map(e=>e.x)).size:new Set(e.map(e=>e.y)).size}function Ue(e,t,n,r,i,a){let o=Math.max(...e.map(e=>e.x))+1,s=Math.max(...e.map(e=>e.y))+1;if(t===`vertical`){for(let e=0;e<=i.y;e+=1)if(a.some(t=>V({...i,y:e},t)))return!1;return i.y+s<=r}for(let e=n-o;e>=i.x;--e)if(a.some(t=>V({...i,x:e},t)))return!1;return i.x+o<=n}function H(e,t){if(t<=1)return 0;let n=Math.sin(e*12.9898+78.233)*43758.5453;return Math.floor((n-Math.floor(n))*t)}var We={variant:`_variant_1lsfm_1`},U={field:`_field_1x3vm_1`,grid:`_grid_1x3vm_10`,piece:`_piece_1x3vm_14`,cell:`_cell_1x3vm_34`,clearingCell:`_clearingCell_1x3vm_38`,"clear-cell":`_clear-cell_1x3vm_1`},Ge=50,W=1250,Ke=250,qe=850,Je=500;function Ye({progress:e,estimatedDurationMs:t,overdue:r,seed:o=0}){let s=i(null),[c,d]=a({...Ne(`vertical`),direction:`vertical`}),[f,p]=a([]),[m,h]=a(!1),[ee,g]=a([]),[_,te]=a(!1),v=i(c),y=i(c),b=i(e),x=i(o),S=i(void 0),C=i([]),w=i(!1),T=i({startedAt:Date.now(),nextPieceAt:W,recycleUntil:0,id:0,settled:[]});return n(()=>{b.current=e},[e]),n(()=>{x.current=o},[o]),n(()=>{let e=s.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect();t.width!==0&&t.height!==0&&d(e=>{let n=S.current??Me(t.width,t.height);S.current=n;let r={...Ne(n,t.width,t.height),direction:n};return v.current=r,r})};if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]),n(()=>{let e=window.matchMedia(`(prefers-reduced-motion: reduce)`),t=()=>te(e.matches);return t(),e.addEventListener?.(`change`,t),()=>e.removeEventListener?.(`change`,t)},[]),n(()=>{let e=y.current,t=e.direction!==c.direction||e.columns!==c.columns||e.rows!==c.rows;y.current=c,!(!t||_)&&(T.current={startedAt:Date.now(),nextPieceAt:W,id:0,recycleUntil:0,settled:[]},C.current=[],p([]),h(!1),g([]),w.current=!1)},[c,_]),n(()=>{if(!_)return;let e=Ve(c.direction,c.columns,c.rows,x.current,Math.max(1,Math.floor(b.current*6)));C.current=e,T.current.settled=e,p(e)},[c,_]),n(()=>{if(_)return;let e=window.setInterval(()=>{let e=T.current,n=Date.now()-e.startedAt,i=v.current,a=b.current,o=Re(i.columns,i.rows,a),s=[...e.settled],c=C.current.filter(e=>e.phase!==`settled`);if(n<e.recycleUntil)return;if(w.current&&(w.current=!1,h(!1),g([])),n>=e.nextPieceAt&&c.length===0){if(a<1&&ze(s)>=o)return;let l=e.id,u=x.current+l*17,d=Le(i.direction,i.columns,i.rows,s,u+1,!r);if(!d&&(a>=1||t===void 0)){let t=Be(i.direction,i.columns,i.rows,s,!0);if(t){s=t.shapes,e.settled=s,e.recycleUntil=n+Je,e.nextPieceAt=e.recycleUntil,C.current=s,w.current=!0,g(t.cleared),p(s),h(!0);return}}if(d){e.id+=1;let{shape:t,destination:r}=d,a=Math.max(...t.map(e=>e.y))+1;c=[...c,{id:l,bornAt:n,cells:t,x:i.direction===`horizontal`?i.columns-Math.max(...t.map(e=>e.x))-.5:r.x,y:i.direction===`vertical`?-a+.5:r.y,targetX:r.x,targetY:r.y,phase:`entry`}]}e.nextPieceAt+=Xe(t,i)}c=c.map(e=>{let t=n-e.bornAt,r=e.targetX===void 0||e.targetY===void 0?void 0:{x:e.targetX,y:e.targetY};if(!r)return e;let a=Math.min(1,Math.max(0,(t-Ke)/qe));if(a>=1)return s=[...s,{...e,x:r.x,y:r.y,phase:`settled`}],{...e,x:r.x,y:r.y,phase:`settled`};let o=i.direction===`horizontal`?i.columns-Math.max(...e.cells.map(e=>e.x))-1:r.x,c=i.direction===`vertical`?0:r.y,l=Math.min(1,Math.max(0,t/1100));return{...e,x:i.direction===`horizontal`?o+(r.x-o)*a:o,y:i.direction===`vertical`?c+(r.y-c)*a:c,phase:t<Ke?`entry`:l<.35?`align`:`travel`}}),e.settled=s;let l=[...s,...c.filter(e=>e.phase!==`settled`)];C.current=l,p(l)},Ge);return()=>window.clearInterval(e)},[t,r,_]),l(`div`,{ref:s,className:U.field,"data-running-part":`falling-shapes-field`,"data-overdue":r||void 0,"data-direction":c.direction,"data-recycling":m||void 0,style:{"--shape-columns":c.columns,"--shape-rows":c.rows},children:u(`div`,{className:U.grid,children:[ee.map(e=>l(`span`,{className:U.clearingCell,style:{"--clear-x":e.x,"--clear-y":e.y}},`${e.x}-${e.y}`)),f.map(e=>l(`div`,{className:U.piece,"data-piece":e.id,"data-piece-phase":e.phase,style:{"--piece-x":e.x,"--piece-y":e.y,"--piece-width":Math.max(...e.cells.map(e=>e.x))+1,"--piece-height":Math.max(...e.cells.map(e=>e.y))+1},children:e.cells.map(e=>l(`span`,{className:U.cell,style:{"--cell-x":e.x,"--cell-y":e.y}},`${e.x}-${e.y}`))},e.id))]})})}function Xe(e,t){let n=Math.ceil(t.columns*t.rows*.85);return e===void 0||n<=0?W:Math.max(400,e/Math.max(1,Math.ceil(n/3)))}var G={frontier:`_frontier_rnw91_1`,now:`_now_rnw91_12`,routes:`_routes_rnw91_20`,route:`_route_rnw91_20`,trail:`_trail_rnw91_41`,packet:`_packet_rnw91_42`,"packet-stall":`_packet-stall_rnw91_1`,"trail-backup":`_trail-backup_rnw91_1`};function Ze(){return u(c,{children:[l(`span`,{className:G.frontier,"data-running-part":`frontier`}),l(`span`,{className:G.now,"data-running-part":`transit-now`}),l(`span`,{className:G.routes,"data-running-part":`transit-routes`,children:[0,1,2].map(e=>l(`span`,{className:G.route},e))}),l(`span`,{className:G.trail,"data-running-part":`transit-trail`}),l(`span`,{className:G.packet,"data-running-part":`transit-packet`})]})}var K={field:`_field_1i9kx_1`,overdue:`_overdue_1i9kx_11`,timing:`_timing_1i9kx_14`,timingOverdue:`_timingOverdue_1i9kx_28`},q={haze:`_haze_3npie_1`,pressure:`_pressure_3npie_17`,band:`_band_3npie_20`,bandOne:`_bandOne_3npie_33`,bandTwo:`_bandTwo_3npie_36`,bandThree:`_bandThree_3npie_40`,drift:`_drift_3npie_45`,driftOne:`_driftOne_3npie_54`,driftTwo:`_driftTwo_3npie_58`,driftThree:`_driftThree_3npie_67`,driftFour:`_driftFour_3npie_76`,driftFive:`_driftFive_3npie_85`,"storm-band":`_storm-band_3npie_1`};function Qe(){return u(c,{children:[l(`span`,{className:q.haze,"data-running-part":`weather-haze`}),l(`span`,{className:q.pressure,"data-running-part":`weather-pressure`}),l(`span`,{className:`${q.band} ${q.bandOne}`}),l(`span`,{className:`${q.band} ${q.bandTwo}`}),l(`span`,{className:`${q.band} ${q.bandThree}`}),l(`span`,{className:`${q.drift} ${q.driftOne}`}),l(`span`,{className:`${q.drift} ${q.driftTwo}`}),l(`span`,{className:`${q.drift} ${q.driftThree}`}),l(`span`,{className:`${q.drift} ${q.driftFour}`}),l(`span`,{className:`${q.drift} ${q.driftFive}`})]})}var $e={anchor:`_anchor_1bd86_1`,body:`_body_1bd86_6`,"phased-marker":`_phased-marker_1bd86_1`};function et({anchorClassName:e,bodyClassName:t,delay:n,anchorPart:r,bodyPart:i}){let a=n?{"--phased-marker-delay":n}:void 0;return l(`span`,{className:`${$e.anchor} ${e??``}`,"data-running-part":r,children:l(`span`,{className:`${$e.body} ${t??``}`,"data-running-part":i,style:a})})}var J={frontier:`_frontier_2wwhn_1`,flare:`_flare_2wwhn_12`,lanes:`_lanes_2wwhn_15`,lane:`_lane_2wwhn_15`,markerAnchor:`_markerAnchor_2wwhn_31`,markerBody:`_markerBody_2wwhn_35`,"bloom-flare":`_bloom-flare_2wwhn_1`};function tt(){return u(c,{children:[l(`span`,{className:J.frontier,"data-running-part":`frontier`}),l(`span`,{className:J.flare,"data-running-part":`bloom-flare`}),l(`span`,{className:J.lanes,"data-running-part":`bloom-lanes`,children:[0,1,2,3].map(e=>l(`span`,{className:J.lane,"data-running-part":`bloom-lane`,children:l(et,{anchorClassName:J.markerAnchor,bodyClassName:J.markerBody,delay:[void 0,`-0.8s`,`-1.7s`,`-2.4s`][e],anchorPart:`bloom-marker-anchor`,bodyPart:`bloom-marker`})},e))})]})}function nt(e){return[`telemetry-bloom`,`release-transit`,`status-weather`,`falling-shapes`].includes(e)}function rt({animation:e,progress:t,estimatedDurationMs:n,overdue:r,indeterminate:i,seed:a}){let o={"--running-progress":`${t*100}%`};return u(`div`,{className:`${K.field} ${r?K.overdue:``}`,"data-animation":e,"data-running-field":!0,"data-overdue":r||void 0,"data-indeterminate":i||void 0,"aria-hidden":`true`,style:o,children:[e===`telemetry-bloom`&&l(tt,{}),e===`release-transit`&&l(Ze,{}),e===`status-weather`&&l(Qe,{}),e===`falling-shapes`&&l(Ye,{progress:t,estimatedDurationMs:n,overdue:r,seed:a})]})}var it=20;function at(e,t){let n=ot(!!e),r=e?new Date(e).valueOf():NaN,i=Number.isFinite(r)?Math.max(0,n-r):void 0,a=i!==void 0&&t!==void 0;return{elapsedMs:i,estimatedDurationMs:t,hasEstimate:a,overdue:a&&i>t,progress:a?Math.min(i/t,1):0}}function ot(e){let[t,r]=a(()=>Date.now());return n(()=>{if(!e)return;r(Date.now());let t=window.setInterval(()=>r(Date.now()),it);return()=>window.clearInterval(t)},[e]),t}function st(e,t,n){return`${e===void 0?`Run in progress`:`Elapsed ${lt(e)}`} · ${t===void 0?`Expected duration unavailable`:`Expected ≈ ${lt(t)}`}${n?` · Over estimate`:``}`}function ct(e,t,n){let r=e===void 0?`—`:ut(e),i=t===void 0?`?`:`~${ut(t)}`;return`${n?`⚠`:`\xA0`}${r}/${i}`}function lt(e){let t=Math.floor(e/1e3),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60;return n>0?`${n}h ${r}m`:r>0?`${r}m ${i}s`:`${i}s`}function ut(e){let t=Math.floor(e/1e3),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60,a=`${r}:${String(i).padStart(2,`0`)}`;return n>0?`${n}:${a.padStart(5,`0`)}`:a}function dt({elapsedMs:e,estimatedDurationMs:t,overdue:n}){return u(`p`,{className:`${K.timing} ${n?K.timingOverdue:``}`,children:[l(`span`,{className:`screen-reader-only`,children:st(e,t,n)}),l(`span`,{"aria-hidden":`true`,children:ct(e,t,n)})]})}var Y={progress:`_progress_1x79l_1`,visual:`_visual_1x79l_8`,timing:`_timing_1x79l_12`,overdue:`_overdue_1x79l_17`,readout:`_readout_1x79l_23`,radial:`_radial_1x79l_31`,sweep:`_sweep_1x79l_1`,"alarm-ring":`_alarm-ring_1x79l_1`,radialCore:`_radialCore_1x79l_58`,"reactor-breathe":`_reactor-breathe_1x79l_1`,runway:`_runway_1x79l_70`,"barrier-pulse":`_barrier-pulse_1x79l_1`,spark:`_spark_1x79l_114`,sparkTwo:`_sparkTwo_1x79l_128`,orbit:`_orbit_1x79l_135`,orbitCore:`_orbitCore_1x79l_151`,particle:`_particle_1x79l_163`,particleTwo:`_particleTwo_1x79l_174`,"gravity-well":`_gravity-well_1x79l_1`,indeterminate:`_indeterminate_1x79l_191`,shift:`_shift_1x79l_1`,signalField:`_signalField_1x79l_199`,rail:`_rail_1x79l_217`,lead:`_lead_1x79l_223`,pulse:`_pulse_1x79l_233`,pulseTwo:`_pulseTwo_1x79l_244`,tracks:`_tracks_1x79l_247`,sparkWide:`_sparkWide_1x79l_1`,track:`_track_1x79l_247`,markerAnchor:`_markerAnchor_1x79l_371`,markerBody:`_markerBody_1x79l_375`,"endpoint-pulse":`_endpoint-pulse_1x79l_1`,short:`_short_1x79l_413`};function ft({animation:e,timing:t}){let{elapsedMs:n,estimatedDurationMs:r,hasEstimate:i,overdue:a,progress:o}=t,s=e===`runway`||e===`signal-field`,d=st(n,r,a),f={"--running-progress":`${o*100}%`,"--running-degrees":`${o*360}deg`},p=e===`signal-field`?Y.signalField:Y[e];return u(`div`,{className:`${Y.progress} ${p} ${a?Y.overdue:``} ${i?``:Y.indeterminate}`,style:f,"data-running-progress":e,"data-overdue":a||void 0,"data-indeterminate":!i||void 0,children:[u(`div`,{className:Y.visual,"aria-hidden":`true`,"data-running-visual":!0,children:[e===`radial`&&l(`span`,{className:Y.radialCore}),e===`runway`&&u(c,{children:[l(`span`,{className:Y.spark,"data-running-part":`runway-spark`}),l(`span`,{className:`${Y.spark} ${Y.sparkTwo}`,"data-running-part":`runway-spark-two`})]}),e===`orbit`&&u(c,{children:[l(`span`,{className:Y.orbitCore}),l(`span`,{className:Y.particle}),l(`span`,{className:`${Y.particle} ${Y.particleTwo}`})]}),e===`signal-field`&&u(c,{children:[l(`span`,{className:Y.rail}),l(`span`,{className:Y.lead}),l(`span`,{className:Y.pulse}),l(`span`,{className:`${Y.pulse} ${Y.pulseTwo}`}),l(`span`,{className:Y.tracks,"data-running-part":`signal-tracks`,children:[0,1,2,3,4].map(e=>l(`span`,{className:Y.track,"data-running-part":`signal-track`,children:l(et,{anchorClassName:Y.markerAnchor,bodyClassName:Y.markerBody,delay:[void 0,`-0.8s`,`-1.7s`,`-2.4s`,`-0.35s`][e],anchorPart:`signal-marker-anchor`,bodyPart:`signal-marker`})},e))})]})]}),l(`p`,{className:`${Y.timing} ${s?Y.readout:``}`,children:s?u(c,{children:[l(`span`,{className:`screen-reader-only`,children:d}),l(`span`,{"aria-hidden":`true`,children:ct(n,r,a)})]}):d})]})}function pt(e){return[`radial`,`runway`,`orbit`,`signal-field`].includes(e)}var mt=2e4,ht=15e3,gt=3e5,_t=1.25,vt=[`radial`,`runway`,`orbit`,`signal-field`,`telemetry-bloom`,`release-transit`,`status-weather`,`falling-shapes`];function yt({panel:e}){let t=St(),n=e.running_animation===void 0||e.running_animation===`off`?void 0:e.running_animation,r=bt(e.demo_run_duration,mt),i=bt(e.demo_review_duration,gt),a=n?Math.ceil(i*_t):r,o=Math.floor(t/a),s=n??vt[o%vt.length]??`radial`,c=o*a;return l(xt,{panel:e,animation:s,runStartedAt:c,estimatedDurationMs:n?i:ht})}function bt(e,t){return e?p(e)??t:t}function xt({panel:e,animation:t,runStartedAt:n,estimatedDurationMs:r}){let i=at(new Date(n).toISOString(),r),a=nt(t);return u(R,{panel:e,field:a?l(rt,{animation:t,progress:i.progress,estimatedDurationMs:i.estimatedDurationMs,overdue:i.overdue,indeterminate:!i.hasEstimate,seed:Pe(e.id)},`${t}-${n}`):void 0,children:[l(L,{status:`running`,children:`↻ Running`}),u(`p`,{className:We.variant,children:[`Demo treatment · `,t]}),a?l(dt,{elapsedMs:i.elapsedMs,estimatedDurationMs:r,overdue:i.overdue}):l(ft,{animation:t,timing:i})]})}function St(){let[e,t]=a(()=>Date.now());return n(()=>{let e=window.setInterval(()=>t(Date.now()),1e3);return()=>window.clearInterval(e)},[]),e}var Ct={details:`_details_1isu9_1`};function wt({panel:e,envelope:t}){if(!t)return l(R,{panel:e,children:l(I,{children:`Loading…`})});if(t.state===`error`)return u(R,{panel:e,envelope:t,error:!0,children:[u(L,{children:[`⚠ `,t.error.kind===`no-runs`?`No workflow runs`:`Unable to read`]}),l(I,{children:t.error.message}),l(z,{value:t.observedAt})]});let n=E.safeParse(t.signal);return n.success?l(Tt,{panel:e,envelope:t,signal:n.data}):u(R,{panel:e,envelope:t,error:!0,children:[l(L,{children:`⚠ Invalid signal`}),l(z,{value:t.observedAt})]})}function Tt({panel:e,envelope:t,signal:n}){let r=Ot(n.status),[o,s]=a(()=>n.status===`running`?Et():void 0),c=i(n.status);if(n.status!==c.current){let t=c.current===`running`;c.current=n.status,e.running_animation===void 0&&!t&&n.status===`running`&&s(e=>Et(e))}let d=e.running_animation??o??`off`,f=n.status===`running`&&d!==`off`,p=at(n.runStartedAt,n.estimatedDurationMs),m=f&&nt(d),h=f&&pt(d);return l(R,{panel:e,envelope:t,field:m?l(rt,{animation:d,progress:p.progress,estimatedDurationMs:p.estimatedDurationMs,overdue:p.overdue,indeterminate:!p.hasEstimate,seed:Pe(e.id)}):void 0,children:u(`div`,{className:Ct.details,children:[u(L,{status:n.status,children:[r.glyph,` `,r.label]}),u(I,{children:[n.name,` · `,n.rawStatus,n.branch&&u(Te,{title:`Branch: ${n.branch}`,children:[l(`span`,{"aria-hidden":`true`,children:` · ⎇ `}),l(`span`,{className:`screen-reader-only`,children:`Branch: `}),n.branch]})]}),m&&l(dt,{elapsedMs:p.elapsedMs,estimatedDurationMs:n.estimatedDurationMs,overdue:p.overdue}),h&&l(ft,{animation:d,timing:p}),n.status!==`running`&&n.durationMs!==void 0&&u(I,{children:[`Took `,Dt(n.durationMs)]}),n.sourceUpdatedAt&&l(z,{value:n.sourceUpdatedAt,label:`Run updated`}),l(z,{value:t.observedAt})]})})}function Et(e){let t=g.filter(t=>t!==e);return t[Math.floor(Math.random()*t.length)]??`telemetry-bloom`}function Dt(e){let t=Math.floor(e/1e3),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60;return n>0?`${n}h ${r}m`:r>0?`${r}m ${i}s`:`${i}s`}function Ot(e){switch(e){case`passed`:return{glyph:`✓`,label:`Passed`};case`failed`:return{glyph:`✕`,label:`Failed`};case`running`:return{glyph:`↻`,label:`Running`};case`cancelled`:return{glyph:`⊘`,label:`Cancelled`};case`unknown`:return{glyph:`?`,label:`Unknown`}}}function kt({panel:e,envelope:t}){if(!t)return l(R,{panel:e,children:l(I,{children:`Loading…`})});if(t.state===`error`)return u(R,{panel:e,envelope:t,error:!0,children:[l(L,{children:`⚠ Unable to read`}),l(I,{children:t.error.message}),l(z,{value:t.observedAt})]});let n=ie.safeParse(t.signal);if(!n.success)return l(R,{panel:e,envelope:t,error:!0,children:l(L,{children:`⚠ Invalid signal`})});let r=At(n.data.status);return u(R,{panel:e,envelope:t,children:[u(L,{status:n.data.status,children:[r.glyph,` `,r.label]}),l(I,{children:n.data.summary}),l(z,{value:t.observedAt})]})}function At(e){switch(e){case`passed`:return{glyph:`✓`,label:`Healthy`};case`failed`:return{glyph:`✕`,label:`Failed`};case`running`:return{glyph:`↻`,label:`Running`};case`cancelled`:return{glyph:`⊘`,label:`Cancelled`};case`unknown`:return{glyph:`?`,label:`Unknown`}}}var jt={"pipeline-status":wt,"pull-request-health":kt,"http-value":ke,"pipeline-animation-demo":yt};function Mt({panel:e,envelope:t}){let n=jt[e.type];return n?l(n,{panel:e,envelope:t}):l(Se,{label:e.type,hint:`Not wired yet`,wide:!0})}var Nt=6e4,Pt=1e4,Ft=()=>globalThis.window.location.reload();function It({env:e,diagnostics:t,fetcher:r,reload:i=Ft}){n(()=>{let n=!1,a=!1,o,s=`${e.proxyPath}/client`,c=async()=>{if(n||a)return;a=!0;let l=new AbortController;o=l;let u=globalThis.setTimeout(()=>l.abort(),Pt);t.record({kind:`client-update-check`,path:s});try{let a=await(r??globalThis.fetch)(s,{cache:`no-store`,signal:l.signal});if(!a.ok)throw Error(`Client identity returned ${a.status}`);let o=S.safeParse(await a.json());if(!o.success)throw Error(`Client identity response was invalid`);if(n)return;o.data.assetPath!==e.assetPath&&(t.record({kind:`client-update-detected`,path:s,current:{assetPath:e.assetPath,clientVersion:e.clientVersion},next:o.data}),i())}catch(e){!n&&!(e instanceof DOMException&&e.name===`AbortError`)&&t.record({kind:`client-update-failure`,path:s,message:e instanceof Error?e.message:String(e)})}finally{globalThis.clearTimeout(u),a=!1,o===l&&(o=void 0),n||globalThis.setTimeout(()=>void c(),Nt)}};return c(),()=>{n=!0,o?.abort()}},[t,e.assetPath,e.clientVersion,e.proxyPath,r,i])}function X(e,t){if(t.state===`error`)return{state:t.state,link:t.link};if(e.type===`pipeline-status`){let e=E.safeParse(t.signal);return{state:t.state,status:e.success?e.data.status:void 0,link:t.link}}if(e.type===`pull-request-health`){let e=ie.safeParse(t.signal);return{state:t.state,status:e.success?e.data.status:void 0,link:t.link}}return{state:t.state,link:t.link}}function Lt(e,t,n){if(!e)return!0;let r=X(t,e),i=X(t,n);return r.state!==i.state||r.status!==i.status||r.link!==i.link}function Rt(e,t,n){let r=zt(e);if(!r)return n.refreshMillis;let i=Bt(r);return i===void 0?n.runningRefreshMillis:t<i?Math.min(n.runningRefreshMillis,i-t):t<i+n.runningCompletionWindowMillis?n.runningCompletionRefreshMillis:n.runningRefreshMillis}function zt(e){if(e?.state!==`ok`)return;let t=E.safeParse(e.signal);return t.success&&t.data.status===`running`?t.data:void 0}function Bt(e){if(!e.runStartedAt||e.estimatedDurationMs===void 0)return;let t=Date.parse(e.runStartedAt);return Number.isFinite(t)?t+e.estimatedDurationMs:void 0}function Vt({board:e,env:t,diagnostics:r}){let[o,s]=a({}),c=i({});return n(()=>{if(c.current={},s({}),!e)return;let n=!1,i=new Set;for(let a of e.panels){if(D(a.position)||a.type!==`pipeline-status`&&a.type!==`pull-request-health`&&a.type!==`http-value`)continue;let o=!1,l=de(e,a),u=`${t.proxyPath}/panel/${encodeURIComponent(t.board)}/${encodeURIComponent(a.id)}`,d,f=()=>{n||o||(o=!0,r.record({kind:`panel-fetch-start`,panelId:a.id,path:u}),fetch(u).then(async e=>{let t={kind:`panel-fetch-response`,panelId:a.id,path:u,status:e.status,cache:M(e.headers)};if(e.status===304){r.record(t);return}try{let n=Ht(await e.json());if(!n){r.record(t),r.record({kind:`panel-fetch-parse-failure`,panelId:a.id,path:u,message:`Response was not a valid signal envelope.`});return}return r.record({...t,envelope:n}),n}catch(e){throw r.record(t),r.record({kind:`panel-fetch-parse-failure`,panelId:a.id,path:u,message:Z(e)}),new Q(e)}}).then(e=>{if(e&&(d=e),!n&&e){let t=c.current[a.id];Lt(t,a,e)&&r.record({kind:`panel-rendered`,panelId:a.id,path:u,rendered:X(a,e)}),c.current={...c.current,[a.id]:e},s(c.current)}}).catch(e=>{e instanceof Q||r.record({kind:`panel-fetch-failure`,panelId:a.id,path:u,message:Z(e)})}).finally(()=>{if(o=!1,!n){let e=window.setTimeout(()=>{i.delete(e),f()},Rt(d,Date.now(),l));i.add(e)}}))};f()}return()=>{n=!0;for(let e of i)window.clearTimeout(e)}},[e,r,t.board,t.proxyPath]),o}function Z(e){return e instanceof Error?e.message:String(e)}var Q=class extends Error{constructor(e){super(Z(e))}};function Ht(e){let t=ne.safeParse(e);return t.success?t.data:void 0}function Ut({env:e}){let[t,o]=a(),[s,c]=a(),d=i(null);d.current||=new ve(e);let f=d.current;It({env:e,diagnostics:f});let p=Vt({board:s===e.board?t:void 0,env:e,diagnostics:f}),m=r(()=>t?ce(t.panels):void 0,[t]);return n(()=>{!m||m.issues.length===0||f.record({kind:`layout-analyzed`,issueCount:m.issues.length,affectedPanelIds:m.issues.map(e=>e.panelId)})},[f,m]),n(()=>{let t=!1;o(void 0),c(void 0);let n=`${e.proxyPath}/boards/${encodeURIComponent(e.board)}`;return f.record({kind:`board-fetch-start`,path:n}),fetch(n).then(async e=>{if(f.record({kind:`board-fetch-response`,path:n,status:e.status,cache:M(e.headers)}),!e.ok)throw Error(`Board configuration returned ${e.status}`);try{return await e.json()}catch(e){throw f.record({kind:`board-fetch-parse-failure`,path:n,message:$(e)}),new Gt(e)}}).then(r=>{if(!t){o(r),c(e.board);let t=Array.isArray(r.panels)?r.panels:[];f.record({kind:`board-fetch-response`,path:n,boardSummary:{panelCount:t.length,panelIds:t.flatMap(e=>typeof e.id==`string`?[e.id]:[])}})}}).catch(r=>{r instanceof Gt||f.record({kind:`board-fetch-failure`,path:n,message:$(r)}),t||(o({panels:[]}),c(e.board))}),()=>{t=!0}},[f,e.board,e.proxyPath]),u(`div`,{className:k.board,children:[l(`header`,{className:k.header,children:l(`h1`,{className:k.title,children:e.board})}),u(`main`,{className:k.grid,children:[!t&&l(Se,{label:`board`,hint:`Loading configuration…`,wide:!0}),t?.panels.filter(e=>!D(e.position)).map(e=>l(Mt,{panel:e,envelope:p[e.id]},e.id))]}),u(`footer`,{className:k.footer,"data-board-footer":!0,children:[l(`span`,{children:`Signals are read live from their configured authorities.`}),u(`div`,{className:k.footerTools,children:[m&&m.issues.length>0&&l(Wt,{board:e.board,layout:m,proxyPath:e.proxyPath}),l(fe,{log:f})]})]})]})}function Wt({board:e,layout:t,proxyPath:r}){let[i,o]=a(!1),s=`layout-warning-${e}`;n(()=>{if(!i)return;let e=e=>{e.key===`Escape`&&o(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[i]);let c=`${r}/boards/${encodeURIComponent(e)}`;return u(`div`,{className:k.layoutWarning,"data-layout-warning":!0,children:[u(`button`,{className:k.layoutWarningButton,type:`button`,"aria-label":`Layout warnings (${t.issues.length})`,"aria-expanded":i,"aria-controls":s,onClick:()=>o(!i),children:[l(`span`,{"aria-hidden":`true`,children:`⚠`}),l(`span`,{children:t.issues.length})]}),i&&u(`aside`,{className:k.layoutWarningDialog,id:s,role:`dialog`,"aria-labelledby":`${s}-title`,"aria-modal":`false`,children:[u(`div`,{className:k.layoutWarningHeading,children:[l(`strong`,{id:`${s}-title`,children:`Layout warnings`}),l(`button`,{className:k.layoutWarningClose,type:`button`,"aria-label":`Close layout warnings`,onClick:()=>o(!1),children:`×`})]}),u(`p`,{children:[t.issues.length,` layout issue`,t.issues.length===1?``:`s`,` detected against the intended 12×12 space. The live board is unchanged: explicit overlaps remain overlapped and overflow continues in implicit rows.`]}),l(`ul`,{children:t.issues.map(e=>u(`li`,{children:[l(`strong`,{children:e.panelId}),`: `,e.kind,` at (`,e.position.x,`,`,` `,e.position.y,`), `,e.position.w,`×`,e.position.h,e.conflictsWith.length?`; overlaps ${e.conflictsWith.join(`, `)}`:``]},`${e.panelId}-${e.kind}`))}),u(`div`,{className:k.layoutWarningDownloads,children:[l(`a`,{href:`${c}/rendered`,download:`${e}-layout-rendered.yaml`,children:`Download legal rendered layout`}),l(`a`,{href:`${c}/authored`,download:`${e}-layout-authored.yaml`,children:`Download authored layout`})]}),l(`p`,{className:k.layoutWarningNote,children:`The legal rendered layout normalizes the currently visible explicit area into 12×12 and makes the smallest deterministic adjustments needed to avoid collisions. The authored layout preserves the original coordinates exactly.`})]})]})}function $(e){return e instanceof Error?e.message:String(e)}var Gt=class extends Error{constructor(e){super($(e))}},Kt={error:`_error_yx1g9_1`};function qt({message:e}){return u(`div`,{className:Kt.error,role:`alert`,children:[l(`h1`,{children:`⚠️ Dashboard misconfigured`}),l(`p`,{children:`The page loaded, but the server did not hand it usable configuration.`}),l(`pre`,{children:e})]})}var Jt=document.getElementById(`root`);if(!Jt)throw Error(`No #root element in the document — the template is not the one we expect.`);var Yt=s(Jt);try{Yt.render(l(t,{children:l(Ut,{env:C()})}))}catch(e){Yt.render(l(qt,{message:e instanceof Error?e.message:String(e)}))}
|
|
3
|
+
//# sourceMappingURL=index-1YsIVWxe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-1YsIVWxe.js","names":[],"sources":["../../../shared/dist/index.js","../../src/App.module.css","../../src/Diagnostics.module.css","../../src/Diagnostics.tsx","../../src/diagnostics-summary.ts","../../src/diagnostics.ts","../../src/PanelFrame.module.css","../../src/PanelPlaceholder.tsx","../../src/HttpValuePanel.module.css","../../src/panel-layout.ts","../../src/PanelFrame.tsx","../../src/ObservedAt.tsx","../../src/HttpValuePanel.tsx","../../src/falling-shapes.ts","../../src/PipelineAnimationDemoPanel.module.css","../../src/FallingShapesField.module.css","../../src/FallingShapesField.tsx","../../src/ReleaseTransitField.module.css","../../src/ReleaseTransitField.tsx","../../src/RunningField.module.css","../../src/StatusWeatherField.module.css","../../src/StatusWeatherField.tsx","../../src/PhasedProgressMarker.module.css","../../src/PhasedProgressMarker.tsx","../../src/TelemetryBloomField.module.css","../../src/TelemetryBloomField.tsx","../../src/RunningField.tsx","../../src/running-timing.ts","../../src/RunningFieldTiming.tsx","../../src/RunningProgress.module.css","../../src/RunningProgress.tsx","../../src/PipelineAnimationDemoPanel.tsx","../../src/PipelinePanel.module.css","../../src/PipelinePanel.tsx","../../src/PullRequestHealthPanel.tsx","../../src/panel-registry.tsx","../../src/useClientUpdate.ts","../../src/panel-diagnostics.ts","../../src/polling-schedule.ts","../../src/usePanelSignals.ts","../../src/App.tsx","../../src/ConfigError.module.css","../../src/ConfigError.tsx","../../src/main.tsx"],"sourcesContent":["// packages/shared/src/board-config.ts\nimport { z as z2 } from \"zod\";\n\n// packages/shared/src/duration.ts\nimport { z } from \"zod\";\nvar DURATION_PATTERN = /^(\\d+)(ms|s|m|h)$/;\nvar UNIT_MILLIS = {\n ms: 1,\n s: 1e3,\n m: 6e4,\n h: 36e5\n};\nfunction parseDuration(value) {\n const match = DURATION_PATTERN.exec(value);\n if (!match) return null;\n const [, rawAmount, rawUnit] = match;\n if (rawAmount === void 0 || rawUnit === void 0) return null;\n const amount = Number(rawAmount);\n if (amount <= 0) return null;\n return amount * UNIT_MILLIS[rawUnit];\n}\nvar durationSchema = z.string().refine((value) => parseDuration(value) !== null, {\n message: 'must be a positive duration like \"30s\", \"5m\", or \"1h\"'\n}).brand();\n\n// packages/shared/src/board-config.ts\nvar positionSchema = z2.union([\n z2.object({\n x: z2.number().int().min(0),\n y: z2.number().int().min(0),\n w: z2.number().int().min(1).max(12),\n h: z2.number().int().min(1)\n }),\n z2.object({ x: z2.literal(0), y: z2.literal(0), w: z2.literal(0), h: z2.literal(0) })\n]);\nvar panelDisplayRoles = [\"primary\", \"supporting\", \"compact\"];\nvar panelDisplaySchema = z2.string().min(1);\nvar visibleRunningAnimations = [\n \"radial\",\n \"runway\",\n \"orbit\",\n \"signal-field\",\n \"telemetry-bloom\",\n \"release-transit\",\n \"status-weather\",\n \"falling-shapes\"\n];\nvar runningAnimationSchema = z2.enum([...visibleRunningAnimations, \"off\"]);\nvar panelSchema = z2.looseObject({\n /** Presentation-only wall label. `id` remains the stable proxy and allowlist address. */\n label: z2.string().min(1).optional(),\n id: z2.string().min(1),\n type: z2.string().min(1),\n source: z2.string().min(1).optional(),\n /** Semantic visual weight; position still controls the panel's explicit grid placement. */\n display: panelDisplaySchema.optional(),\n /** Advisory in v1 — a panel without a position renders in config order rather than not at all. */\n position: positionSchema.optional(),\n refresh: durationSchema.optional(),\n /** Active pipeline runs are checked more often than normal panels. */\n running_refresh: durationSchema.optional(),\n /** Polling cadence around the estimated completion boundary. */\n running_completion_refresh: durationSchema.optional(),\n /** Maximum length of the tighter completion polling burst. */\n running_completion_window: durationSchema.optional(),\n /** Optional active-run treatment. Omitted selects a visible treatment at random. */\n running_animation: runningAnimationSchema.optional(),\n /** Local animation-demo cycle duration; ignored by other panel types. */\n demo_run_duration: durationSchema.optional(),\n /** Local animation-demo focused-review duration; ignored by other panel types. */\n demo_review_duration: durationSchema.optional(),\n /** A deliberate override only. Adapters derive links; hand-written ones drift. */\n link: z2.url().optional(),\n /** Source-agnostic endpoint used by the http-value signal. */\n url: z2.url().optional(),\n /** Small, deliberate JSON path subset: $.version, $.deployment.version, or $.response.docs[0].latestVersion. */\n json_path: z2.string().regex(/^\\$(?:\\.[A-Za-z_][A-Za-z0-9_]*|\\[\\d+\\])*$/, \"must be a simple JSON path\").optional()\n});\nvar sourceSchema = z2.looseObject({\n type: z2.string().min(1),\n /** Credentials are never in the config — only the name of the env var holding one. */\n token_env: z2.string().min(1).optional()\n});\nvar boardSchema = z2.object({\n refresh: durationSchema.optional(),\n running_refresh: durationSchema.optional(),\n running_completion_refresh: durationSchema.optional(),\n running_completion_window: durationSchema.optional(),\n panels: z2.array(panelSchema).min(1).superRefine((panels, ctx) => {\n const seen = /* @__PURE__ */ new Map();\n panels.forEach((panel, index) => {\n const firstIndex = seen.get(panel.id);\n if (firstIndex === void 0) {\n seen.set(panel.id, index);\n return;\n }\n ctx.addIssue({\n code: \"custom\",\n path: [index, \"id\"],\n message: `duplicate panel id \"${panel.id}\" (already used by panel at index ${firstIndex})`\n });\n });\n })\n});\nvar authSchema = z2.object({\n issuer: z2.url(),\n /** Absent in gateway mode — the gateway does the flow, the proxy still validates. */\n client_id: z2.string().min(1).optional(),\n allow: z2.object({\n groups: z2.array(z2.string().min(1)).optional(),\n subjects: z2.array(z2.string().min(1)).optional()\n }).optional()\n});\nvar boardConfigSchema = z2.object({\n sources: z2.record(z2.string().min(1), sourceSchema).default({}),\n boards: z2.record(z2.string().min(1), boardSchema),\n auth: authSchema.optional()\n});\nfunction resolveRefreshMillis(args) {\n const requested = args.panelOverrideMillis ?? args.boardDefaultMillis;\n return Math.max(requested, args.adapterFloorMillis);\n}\n\n// packages/shared/src/client-env.ts\nimport { z as z3 } from \"zod\";\nvar clientEnvSchema = z3.object({\n /** Where the immutable client assets live. The one variable that repoints the whole client. */\n assetPath: z3.string().min(1),\n /** Same-origin path the proxy is mounted at, so there is no CORS and no cookie problem. */\n proxyPath: z3.string().min(1),\n /** Which board this is, resolved server-side so the client parses no URLs. */\n board: z3.string().min(1),\n /** The client version being served, so two published versions are visibly distinguishable. */\n clientVersion: z3.string().min(1),\n /** Omitted entirely when unauthenticated — presence is what turns auth on. */\n auth: z3.object({\n issuer: z3.string().min(1),\n clientId: z3.string().min(1).optional()\n }).optional()\n});\nvar clientIdentitySchema = clientEnvSchema.pick({ assetPath: true, clientVersion: true });\nfunction readClientEnv(source = globalThis.window?.env) {\n const result = clientEnvSchema.safeParse(source);\n if (!result.success) {\n throw new Error(\n `window.env is missing or invalid \\u2014 the server did not inject usable configuration.\n${z3.prettifyError(result.error)}`\n );\n }\n return result.data;\n}\n\n// packages/shared/src/envelope.ts\nimport { z as z4 } from \"zod\";\nvar errorKindSchema = z4.enum([\n \"unreachable\",\n \"unauthorized\",\n \"not-found\",\n \"no-runs\",\n \"upstream-error\"\n]);\nvar envelopeErrorSchema = z4.object({\n kind: errorKindSchema,\n message: z4.string()\n});\nvar envelopeSchema = z4.discriminatedUnion(\"state\", [\n z4.object({\n panelId: z4.string().min(1),\n state: z4.literal(\"ok\"),\n /** From the upstream response `Date`. A cached value must never be shown without its age. */\n observedAt: z4.iso.datetime(),\n /** Adapter-derived. The authority for this panel; the dashboard itself asserts nothing. */\n link: z4.url().nullable(),\n signal: z4.unknown()\n }),\n z4.object({\n panelId: z4.string().min(1),\n state: z4.literal(\"error\"),\n /**\n * Populated even on error: knowing *when* a failure was observed is the difference between\n * \"broken just now\" and \"broken all morning\", and a panel that can't reach its source is\n * exactly when a viewer most wants to click through.\n */\n observedAt: z4.iso.datetime(),\n link: z4.url().nullable(),\n error: envelopeErrorSchema\n })\n]);\nvar pipelineStatusSchema = z4.object({\n type: z4.literal(\"pipeline-status\"),\n status: z4.enum([\"passed\", \"failed\", \"running\", \"cancelled\", \"unknown\"]),\n /** The source's unmodified status/result vocabulary, for an honest display. */\n rawStatus: z4.string(),\n name: z4.string().min(1),\n /** The branch represented by this status, when the upstream supplies or filters by one. */\n branch: z4.string().min(1).optional(),\n /** Elapsed execution time, supplied only after the upstream run has completed. */\n durationMs: z4.number().int().nonnegative().optional(),\n /** When an active run began, so the client can advance its elapsed display between polls. */\n runStartedAt: z4.iso.datetime().optional(),\n /** Advisory median duration from recent completed runs from the same source response. */\n estimatedDurationMs: z4.number().int().positive().optional(),\n /** When this workflow run was last updated by its source, distinct from our observation time. */\n sourceUpdatedAt: z4.iso.datetime().optional()\n});\nvar pullRequestHealthItemSchema = z4.object({\n label: z4.string().min(1),\n status: pipelineStatusSchema.shape.status,\n detail: z4.string().min(1),\n link: z4.url().nullable()\n});\nvar pullRequestHealthSchema = z4.object({\n type: z4.literal(\"pull-request-health\"),\n status: pipelineStatusSchema.shape.status,\n summary: z4.string().min(1),\n workflows: z4.array(pullRequestHealthItemSchema),\n pullRequests: z4.array(pullRequestHealthItemSchema)\n});\nvar httpValueSchema = z4.object({\n type: z4.literal(\"http-value\"),\n value: z4.union([z4.string(), z4.number(), z4.boolean()])\n});\n\n// packages/shared/src/layout.ts\nvar columnCount = 12;\nvar rowCount = 12;\nfunction analyzeBoardLayout(panels) {\n const issues = panels.flatMap((panel) => {\n if (!panel.position || isZeroPosition(panel.position) || isPositionInCanvas(panel.position))\n return [];\n return [\n {\n panelId: panel.id,\n kind: \"out-of-bounds\",\n position: panel.position,\n conflictsWith: []\n }\n ];\n });\n const overlapIssues = /* @__PURE__ */ new Map();\n for (let leftIndex = 0; leftIndex < panels.length; leftIndex++) {\n const left = panels[leftIndex];\n if (!left?.position || isZeroPosition(left.position)) continue;\n for (let rightIndex = leftIndex + 1; rightIndex < panels.length; rightIndex++) {\n const right = panels[rightIndex];\n if (!right?.position || isZeroPosition(right.position)) continue;\n if (!overlaps(left.position, right.position)) continue;\n const key = `${right.id}\\0overlap`;\n const issue = overlapIssues.get(key);\n if (issue) issue.conflictsWith.push(left.id);\n else {\n const nextIssue = {\n panelId: right.id,\n kind: \"overlap\",\n position: right.position,\n conflictsWith: [left.id]\n };\n overlapIssues.set(key, nextIssue);\n issues.push(nextIssue);\n }\n }\n }\n return { issues };\n}\nfunction normalizeBoardLayout(panels) {\n const positioned = panels.flatMap((panel) => {\n if (!panel.position || isZeroPosition(panel.position)) return [];\n return [{ ...panel.position, panelId: panel.id }];\n });\n if (positioned.length === 0) return panels.map((panel) => ({ ...panel }));\n const minX = Math.min(...positioned.map((rectangle) => rectangle.x));\n const minY = Math.min(...positioned.map((rectangle) => rectangle.y));\n const maxX = Math.max(...positioned.map((rectangle) => rectangle.x + rectangle.w));\n const maxY = Math.max(...positioned.map((rectangle) => rectangle.y + rectangle.h));\n const scaleX = maxX - minX > columnCount ? columnCount / (maxX - minX) : 1;\n const scaleY = maxY - minY > rowCount ? rowCount / (maxY - minY) : 1;\n const accepted = [];\n return panels.map((panel) => {\n const position = panel.position;\n if (!position || isZeroPosition(position)) return { ...panel };\n const desired = scaleRectangle(position, minX, minY, scaleX, scaleY);\n const legal = nearestLegalRectangle(desired, accepted);\n if (!legal) return { ...panel, position: zeroPosition };\n accepted.push({ ...legal, panelId: panel.id });\n return { ...panel, position: legal };\n });\n}\nfunction isZeroPosition(position) {\n return position?.x === 0 && position.y === 0 && position.w === 0 && position.h === 0;\n}\nvar zeroPosition = { x: 0, y: 0, w: 0, h: 0 };\nfunction isPositionInCanvas(position) {\n return !isZeroPosition(position) && position.x + position.w <= columnCount && position.y + position.h <= rowCount;\n}\nfunction overlaps(left, right) {\n return left.x < right.x + right.w && left.x + left.w > right.x && left.y < right.y + right.h && left.y + left.h > right.y;\n}\nfunction scaleRectangle(position, minX, minY, scaleX, scaleY) {\n const x = scaleCoordinate(position.x, minX, scaleX);\n const y = scaleCoordinate(position.y, minY, scaleY);\n const right = scaleCoordinate(position.x + position.w, minX, scaleX);\n const bottom = scaleCoordinate(position.y + position.h, minY, scaleY);\n return {\n x,\n y,\n w: Math.max(1, right - x),\n h: Math.max(1, bottom - y)\n };\n}\nfunction scaleCoordinate(value, origin, scale) {\n return Math.round((value - origin) * scale);\n}\nfunction nearestLegalRectangle(desired, accepted) {\n const candidates = [];\n for (let width = desired.w; width >= 1; width--) {\n for (let height = desired.h; height >= 1; height--) {\n const shrink = desired.w - width + (desired.h - height);\n for (let y = 0; y <= rowCount - height; y++) {\n for (let x = 0; x <= columnCount - width; x++) {\n const candidate2 = { x, y, w: width, h: height };\n if (accepted.some((rectangle) => overlaps(candidate2, rectangle))) continue;\n candidates.push({\n ...candidate2,\n shrink,\n distance: Math.abs(x - desired.x) + Math.abs(y - desired.y)\n });\n }\n }\n }\n }\n candidates.sort(\n (left, right) => left.shrink - right.shrink || left.distance - right.distance || left.y - right.y || left.x - right.x\n );\n const [candidate] = candidates;\n if (!candidate) return void 0;\n return { x: candidate.x, y: candidate.y, w: candidate.w, h: candidate.h };\n}\n\n// packages/shared/src/polling-policy.ts\nvar pollingDefaults = {\n refreshMillis: 6e4,\n runningRefreshMillis: 15e3,\n runningCompletionRefreshMillis: 5e3,\n runningCompletionWindowMillis: 12e4\n};\nfunction resolvePollingSettings(board, panel) {\n const duration = (value, fallback) => parseDuration(value ?? \"\") ?? fallback;\n const panelValue = (key, boardValue, fallback) => duration(panel[key], duration(board[boardValue], fallback));\n return {\n refreshMillis: panelValue(\"refresh\", \"refresh\", pollingDefaults.refreshMillis),\n runningRefreshMillis: panelValue(\n \"running_refresh\",\n \"running_refresh\",\n pollingDefaults.runningRefreshMillis\n ),\n runningCompletionRefreshMillis: panelValue(\n \"running_completion_refresh\",\n \"running_completion_refresh\",\n pollingDefaults.runningCompletionRefreshMillis\n ),\n runningCompletionWindowMillis: panelValue(\n \"running_completion_window\",\n \"running_completion_window\",\n pollingDefaults.runningCompletionWindowMillis\n )\n };\n}\nexport {\n analyzeBoardLayout,\n authSchema,\n boardConfigSchema,\n boardSchema,\n clientEnvSchema,\n clientIdentitySchema,\n durationSchema,\n envelopeSchema,\n errorKindSchema,\n httpValueSchema,\n isZeroPosition,\n normalizeBoardLayout,\n panelDisplayRoles,\n panelDisplaySchema,\n panelSchema,\n parseDuration,\n pipelineStatusSchema,\n pollingDefaults,\n positionSchema,\n pullRequestHealthSchema,\n readClientEnv,\n resolvePollingSettings,\n resolveRefreshMillis,\n runningAnimationSchema,\n sourceSchema,\n visibleRunningAnimations\n};\n",".board {\n display: flex;\n flex-direction: column;\n gap: var(--gap);\n height: 100dvh;\n min-height: 0;\n padding: var(--gap);\n overflow-x: hidden;\n overflow-y: auto;\n}\n.header {\n display: flex;\n align-items: baseline;\n border-bottom: 1px solid var(--edge);\n padding-bottom: var(--gap);\n flex: 0 0 auto;\n}\n.title {\n margin: 0;\n font-size: 1.75em;\n font-weight: 650;\n letter-spacing: -0.01em;\n}\n.grid {\n display: grid;\n grid-template-columns: repeat(12, minmax(0, 1fr));\n grid-template-rows: repeat(12, minmax(0, 1fr));\n grid-auto-rows: minmax(0, 1fr);\n gap: var(--gap);\n flex: 1;\n min-height: 0;\n align-content: stretch;\n}\n.footerTools {\n display: flex;\n align-items: center;\n gap: 0.75rem;\n}\n.layoutWarning {\n position: relative;\n}\n.layoutWarningButton {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 0.2em;\n min-width: 2em;\n min-height: 2em;\n border: 1px solid var(--status-warning);\n border-radius: 50%;\n color: var(--status-warning);\n background: var(--surface-raised);\n font: inherit;\n cursor: pointer;\n}\n.layoutWarningButton:hover,\n.layoutWarningButton:focus-visible {\n background: var(--surface);\n}\n.layoutWarningDialog {\n position: absolute;\n z-index: 10;\n right: 0;\n bottom: calc(100% + 0.75rem);\n width: min(32rem, calc(100vw - 2 * var(--gap)));\n padding: 0.8rem;\n border: 1px solid var(--status-warning);\n border-radius: var(--radius);\n color: var(--ink-secondary);\n background: var(--surface-raised);\n box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 35%);\n}\n.layoutWarningHeading {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 1rem;\n}\n.layoutWarningHeading strong {\n color: var(--status-warning);\n}\n.layoutWarningDialog p {\n margin: 0.6rem 0;\n}\n.layoutWarningDialog ul {\n margin: 0.35rem 0 0.75rem;\n padding-left: 1.25rem;\n font-family: ui-monospace, SFMono-Regular, Menlo, monospace;\n font-size: 0.85em;\n}\n.layoutWarningClose {\n border: 0;\n color: var(--ink-muted);\n background: transparent;\n font-size: 1.25em;\n line-height: 1;\n cursor: pointer;\n}\n.layoutWarningDownloads {\n display: grid;\n gap: 0.35rem;\n}\n.layoutWarningDownloads a {\n border: 1px solid var(--edge);\n border-radius: 0.25rem;\n background: var(--surface-raised);\n color: var(--ink-secondary);\n font: inherit;\n padding: 0.3em 0.55em;\n text-align: center;\n text-decoration: none;\n}\n.layoutWarningDownloads a:hover,\n.layoutWarningDownloads a:focus-visible {\n border-color: var(--ink-secondary);\n color: var(--ink-primary);\n}\n.layoutWarningNote {\n color: var(--ink-muted);\n font-size: 0.85em;\n}\n.footer {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: space-between;\n gap: 0.5rem;\n color: var(--ink-muted);\n font-size: 0.75em;\n flex: 0 0 auto;\n}\n@media (max-width: 64rem) {\n .board {\n height: auto;\n min-height: 100dvh;\n overflow: visible;\n }\n .grid {\n grid-template-columns: 1fr;\n grid-auto-rows: auto;\n flex: 0 0 auto;\n min-height: auto;\n }\n .layoutWarningDialog {\n position: fixed;\n right: var(--gap);\n bottom: calc(var(--gap) + 3rem);\n }\n}\n",".diagnostics {\n position: relative;\n}\n\n.button {\n border: 1px solid var(--edge);\n border-radius: 0.25rem;\n background: var(--surface-raised);\n color: var(--ink-secondary);\n font: inherit;\n padding: 0.3em 0.55em;\n}\n\n.area {\n position: absolute;\n z-index: 1;\n right: 0;\n bottom: calc(100% + 0.5rem);\n width: min(24rem, 90vw);\n padding: 0.75rem;\n border: 1px solid var(--edge);\n border-radius: var(--radius);\n background: var(--surface-raised);\n box-shadow: 0 0.5rem 1.5rem #0008;\n}\n\n.area p {\n margin: 0 0 0.5rem;\n}\n\n.warning {\n color: var(--status-warning);\n}\n\n.panels {\n max-height: 12rem;\n overflow-y: auto;\n border-top: 1px solid var(--edge);\n margin: 0.5rem 0;\n padding-top: 0.5rem;\n}\n\n.actions {\n display: flex;\n gap: 0.5rem;\n}\n","import { useState, useSyncExternalStore } from 'react'\nimport styles from './Diagnostics.module.css'\nimport type { BrowserDiagnosticStore } from './diagnostics.ts'\n\nexport function Diagnostics({ log }: { log: BrowserDiagnosticStore }) {\n const [open, setOpen] = useState(false)\n useSyncExternalStore(log.subscribe, log.snapshot, log.snapshot)\n const count = log.count()\n const summary = log.summary()\n const download = () => {\n const blob = new Blob([JSON.stringify(log.export(), null, 2)], { type: 'application/json' })\n const url = URL.createObjectURL(blob)\n const link = document.createElement('a')\n link.href = url\n link.download = `dashboard-diagnostics-${new Date().toISOString().replaceAll(':', '-')}.json`\n link.click()\n URL.revokeObjectURL(url)\n }\n const clear = () => {\n if (!window.confirm('Clear this browser’s retained dashboard diagnostics?')) return\n log.clear()\n }\n\n return (\n <section className={styles.diagnostics}>\n <button\n className={styles.button}\n type=\"button\"\n aria-expanded={open}\n onClick={() => setOpen(!open)}\n >\n Diagnostics ({count})\n </button>\n {open && (\n <div className={styles.area}>\n <p>\n Client {log.clientVersion()} · assets {log.assetPath()}\n </p>\n <p>\n {summary.retained.eventCount} retained browser-local events across{' '}\n {summary.retained.sessionCount} session{summary.retained.sessionCount === 1 ? '' : 's'}\n {summary.retained.firstEventAt && summary.retained.lastEventAt\n ? ` (${formatWindow(summary.retained.firstEventAt, summary.retained.lastEventAt)})`\n : ''}\n . They are never uploaded.\n </p>\n {summary.retained.evidenceMayBeIncomplete && (\n <p className={styles.warning} role=\"alert\">\n Earlier evidence was pruned: {summary.retained.retention.eventsPrunedByCount} at the\n 2,000-event cap and {summary.retained.retention.eventsPrunedByAge} by the 7-day age\n limit. “No failures” applies only to the retained window.\n </p>\n )}\n <p>\n Update failures: {summary.failures.clientUpdate}; board fetch failures:{' '}\n {summary.failures.boardFetch}.\n </p>\n {summary.panels.length > 0 && (\n <div className={styles.panels}>\n {summary.panels.map((panel) => (\n <p key={panel.panelId}>\n <strong>{panel.panelId}</strong> — {panel.requests} requests\n {Object.keys(panel.httpStatuses).length\n ? `; HTTP ${Object.entries(panel.httpStatuses)\n .map(([status, count]) => `${status}×${count}`)\n .join(', ')}`\n : ''}\n ; parse/network failures {panel.parseFailures}/{panel.networkFailures}; visible\n changes {panel.visibleStateChanges}; latest{' '}\n {panel.latestRendered\n ? `${panel.latestRendered.state}${panel.latestRendered.status ? `/${panel.latestRendered.status}` : ''}`\n : 'not rendered'}\n .\n </p>\n ))}\n </div>\n )}\n <div className={styles.actions}>\n <button className={styles.button} type=\"button\" onClick={download}>\n Download\n </button>\n <button className={styles.button} type=\"button\" onClick={clear}>\n Clear\n </button>\n </div>\n </div>\n )}\n </section>\n )\n}\n\nfunction formatWindow(first: string, last: string) {\n return first === last ? first : `${first} to ${last}`\n}\n","import type {\n DiagnosticEvent,\n DiagnosticRetention,\n RenderedPanelDiagnostic,\n} from './diagnostics.ts'\n\nexport type PanelDiagnosticsSummary = {\n panelId: string\n requests: number\n httpStatuses: Record<string, number>\n parseFailures: number\n networkFailures: number\n visibleStateChanges: number\n latestRendered?: RenderedPanelDiagnostic\n}\n\nexport type DiagnosticsSummary = {\n retained: {\n eventCount: number\n firstEventAt?: string\n lastEventAt?: string\n sessionCount: number\n retention: DiagnosticRetention\n evidenceMayBeIncomplete: boolean\n }\n failures: {\n clientUpdate: number\n boardFetch: number\n }\n panels: PanelDiagnosticsSummary[]\n}\n\n/** Summarizes retained browser evidence only; omitted history is disclosed through retention. */\nexport function summarizeDiagnostics(\n events: readonly DiagnosticEvent[],\n retention: DiagnosticRetention,\n): DiagnosticsSummary {\n const panels = new Map<string, PanelDiagnosticsSummary>()\n const sessions = new Set<string>()\n let clientUpdate = 0\n let boardFetch = 0\n\n for (const event of events) {\n sessions.add(event.sessionId)\n if (event.kind === 'client-update-failure') clientUpdate++\n if (event.kind === 'board-fetch-failure' || event.kind === 'board-fetch-parse-failure')\n boardFetch++\n if (!('panelId' in event)) continue\n\n const panel = panels.get(event.panelId) ?? {\n panelId: event.panelId,\n requests: 0,\n httpStatuses: {},\n parseFailures: 0,\n networkFailures: 0,\n visibleStateChanges: 0,\n }\n if (event.kind === 'panel-fetch-start') panel.requests++\n if (event.kind === 'panel-fetch-response') {\n if (event.status !== undefined) {\n const status = String(event.status)\n panel.httpStatuses[status] = (panel.httpStatuses[status] ?? 0) + 1\n }\n }\n if (event.kind === 'panel-fetch-parse-failure') panel.parseFailures++\n if (event.kind === 'panel-fetch-failure') panel.networkFailures++\n if (event.kind === 'panel-rendered') {\n panel.visibleStateChanges++\n panel.latestRendered = event.rendered\n }\n panels.set(event.panelId, panel)\n }\n\n const timestamps = events.map((event) => event.at).sort()\n const discarded = retention.eventsPrunedByAge + retention.eventsPrunedByCount\n return {\n retained: {\n eventCount: events.length,\n firstEventAt: timestamps[0],\n lastEventAt: timestamps.at(-1),\n sessionCount: sessions.size,\n retention,\n evidenceMayBeIncomplete: discarded > 0,\n },\n failures: { clientUpdate, boardFetch },\n panels: [...panels.values()].sort((left, right) => left.panelId.localeCompare(right.panelId)),\n }\n}\n","import type { ClientEnv, Envelope } from '@ze-great-dashboard/shared'\nimport { type DiagnosticsSummary, summarizeDiagnostics } from './diagnostics-summary.ts'\n\nconst storageKey = 'ze-great-dashboard.diagnostics.v1'\nexport const diagnosticsSchemaVersion = 1\nconst maximumEvents = 2_000\nconst maximumAgeMillis = 7 * 24 * 60 * 60 * 1_000\nconst diagnosticKinds = [\n 'session-start',\n 'client-update-check',\n 'client-update-failure',\n 'client-update-detected',\n 'board-fetch-start',\n 'board-fetch-response',\n 'board-fetch-parse-failure',\n 'board-fetch-failure',\n 'layout-analyzed',\n 'panel-fetch-start',\n 'panel-fetch-response',\n 'panel-fetch-parse-failure',\n 'panel-fetch-failure',\n 'panel-rendered',\n] as const\n\nexport type CacheMetadata = Partial<\n Record<'cacheControl' | 'etag' | 'lastModified' | 'date' | 'age', string>\n>\n\ntype EventMetadata = {\n schemaVersion: typeof diagnosticsSchemaVersion\n at: string\n sessionId: string\n board: string\n}\n\nexport type RenderedPanelDiagnostic = {\n state: Envelope['state']\n status?: string\n link: string | null\n}\n\nexport type DiagnosticEventInput =\n | { kind: 'session-start' }\n | { kind: 'client-update-check'; path: string }\n | { kind: 'client-update-failure'; path: string; message: string }\n | {\n kind: 'client-update-detected'\n path: string\n current: { assetPath: string; clientVersion: string }\n next: { assetPath: string; clientVersion: string }\n }\n | { kind: 'board-fetch-start'; path: string }\n | {\n kind: 'board-fetch-response'\n path: string\n status?: number\n cache?: CacheMetadata\n boardSummary?: { panelCount: number; panelIds: string[] }\n }\n | { kind: 'board-fetch-parse-failure'; path: string; message: string }\n | { kind: 'board-fetch-failure'; path: string; message: string }\n | { kind: 'layout-analyzed'; issueCount: number; affectedPanelIds: string[] }\n | { kind: 'panel-fetch-start'; panelId: string; path: string }\n | {\n kind: 'panel-fetch-response'\n panelId: string\n path: string\n status?: number\n cache?: CacheMetadata\n envelope?: Envelope\n }\n | { kind: 'panel-fetch-parse-failure'; panelId: string; path: string; message: string }\n | { kind: 'panel-fetch-failure'; panelId: string; path: string; message: string }\n | {\n kind: 'panel-rendered'\n panelId: string\n path: string\n rendered: RenderedPanelDiagnostic\n }\n\nexport type DiagnosticEvent = DiagnosticEventInput extends infer Event\n ? Event extends DiagnosticEventInput\n ? Event & EventMetadata\n : never\n : never\n\n/** The only interface client features need in order to emit browser diagnostics. */\nexport interface DiagnosticSink {\n record(event: DiagnosticEventInput): void\n}\n\ntype PersistedDiagnosticEvent = Omit<DiagnosticEvent, 'schemaVersion'> & { schemaVersion?: number }\nexport type DiagnosticRetention = {\n eventsPrunedByAge: number\n eventsPrunedByCount: number\n}\n\ntype StoredDiagnostics = {\n schemaVersion: number\n events: PersistedDiagnosticEvent[]\n retention?: Partial<DiagnosticRetention>\n}\n\ntype StorageLike = Pick<Storage, 'getItem' | 'setItem' | 'removeItem'>\n\n/** Browser-local diagnostic evidence. It deliberately has no server or shared-contract counterpart. */\nexport class BrowserDiagnosticStore implements DiagnosticSink {\n private events: DiagnosticEvent[] = []\n private retention: DiagnosticRetention = emptyRetention()\n private revision = 0\n private readonly listeners = new Set<() => void>()\n private readonly sessionId = crypto.randomUUID?.() ?? `${Date.now()}-${Math.random()}`\n\n constructor(\n private readonly env: ClientEnv,\n private readonly storage: StorageLike | undefined = storageOrUndefined(),\n private readonly now: () => Date = () => new Date(),\n ) {\n this.events = this.read()\n this.record({ kind: 'session-start' })\n }\n\n record(event: DiagnosticEventInput) {\n const pruned = prune(\n [\n ...this.events,\n {\n ...event,\n schemaVersion: diagnosticsSchemaVersion,\n at: this.now().toISOString(),\n sessionId: this.sessionId,\n board: this.env.board,\n },\n ],\n this.now(),\n this.retention,\n )\n this.events = pruned.events\n this.retention = pruned.retention\n this.persist()\n this.revision++\n this.notify()\n }\n\n count = () => {\n return this.events.length\n }\n\n clientVersion = () => this.env.clientVersion\n\n assetPath = () => this.env.assetPath\n\n snapshot = () => this.revision\n\n summary = (): DiagnosticsSummary => summarizeDiagnostics(this.events, this.retention)\n\n clear() {\n this.events = []\n this.retention = emptyRetention()\n try {\n this.storage?.removeItem(storageKey)\n } catch {\n // Diagnostics must not interrupt the radiator when browser storage is unavailable.\n }\n this.revision++\n this.notify()\n }\n\n subscribe = (listener: () => void) => {\n this.listeners.add(listener)\n return () => {\n this.listeners.delete(listener)\n }\n }\n\n export = () => {\n return {\n schemaVersion: diagnosticsSchemaVersion,\n exportedAt: this.now().toISOString(),\n client: {\n version: this.env.clientVersion,\n assetPath: this.env.assetPath,\n board: this.env.board,\n sessionId: this.sessionId,\n },\n events: this.events,\n summary: this.summary(),\n }\n }\n\n private read(): DiagnosticEvent[] {\n try {\n const raw = this.storage?.getItem(storageKey)\n if (!raw) return []\n const parsed = JSON.parse(raw) as Partial<StoredDiagnostics>\n if (parsed.schemaVersion !== diagnosticsSchemaVersion || !Array.isArray(parsed.events)) {\n this.storage?.removeItem(storageKey)\n return []\n }\n if (!parsed.events.every(isDiagnosticEvent)) {\n this.storage?.removeItem(storageKey)\n return []\n }\n // v1 retained events predate per-event versions. Their containing store was already v1, so\n // retain them and normalize on the next write rather than discarding viewer evidence.\n const pruned = prune(\n parsed.events.map(\n (event) => ({ ...event, schemaVersion: diagnosticsSchemaVersion }) as DiagnosticEvent,\n ),\n this.now(),\n validRetention(parsed.retention),\n )\n this.retention = pruned.retention\n return pruned.events\n } catch {\n try {\n this.storage?.removeItem(storageKey)\n } catch {\n // Storage can fail on both reads and writes (for example, private browsing policies).\n }\n return []\n }\n }\n\n private persist() {\n try {\n this.storage?.setItem(\n storageKey,\n JSON.stringify({\n schemaVersion: diagnosticsSchemaVersion,\n events: this.events,\n retention: this.retention,\n }),\n )\n } catch {\n // Keep the in-memory record for this page, but never make diagnostics a rendering failure.\n }\n }\n\n private notify() {\n for (const listener of this.listeners) listener()\n }\n}\n\nexport function cacheMetadata(headers: Headers): CacheMetadata | undefined {\n const entries = [\n ['cacheControl', 'cache-control'],\n ['etag', 'etag'],\n ['lastModified', 'last-modified'],\n ['date', 'date'],\n ['age', 'age'],\n ] as const\n const metadata = Object.fromEntries(\n entries.flatMap(([key, header]) => {\n const value = headers.get(header)\n return value ? [[key, value]] : []\n }),\n ) as CacheMetadata\n return Object.keys(metadata).length ? metadata : undefined\n}\n\nfunction emptyRetention(): DiagnosticRetention {\n return { eventsPrunedByAge: 0, eventsPrunedByCount: 0 }\n}\n\nfunction validRetention(value: unknown): DiagnosticRetention {\n if (!value || typeof value !== 'object') return emptyRetention()\n const retention = value as Partial<DiagnosticRetention>\n return {\n eventsPrunedByAge:\n typeof retention.eventsPrunedByAge === 'number' && retention.eventsPrunedByAge >= 0\n ? retention.eventsPrunedByAge\n : 0,\n eventsPrunedByCount:\n typeof retention.eventsPrunedByCount === 'number' && retention.eventsPrunedByCount >= 0\n ? retention.eventsPrunedByCount\n : 0,\n }\n}\n\nfunction prune(events: DiagnosticEvent[], now: Date, priorRetention: DiagnosticRetention) {\n const cutoff = now.valueOf() - maximumAgeMillis\n const current = events.filter(\n (event) =>\n Number.isFinite(new Date(event.at).valueOf()) && new Date(event.at).valueOf() >= cutoff,\n )\n const discardedByAge = events.length - current.length\n const discardedByCount = Math.max(0, current.length - maximumEvents)\n return {\n events: current.slice(-maximumEvents),\n retention: {\n eventsPrunedByAge: priorRetention.eventsPrunedByAge + discardedByAge,\n eventsPrunedByCount: priorRetention.eventsPrunedByCount + discardedByCount,\n },\n }\n}\n\nfunction isDiagnosticEvent(value: unknown): value is PersistedDiagnosticEvent {\n if (!value || typeof value !== 'object') return false\n const event = value as Partial<DiagnosticEvent>\n return (\n (event.schemaVersion === undefined || event.schemaVersion === diagnosticsSchemaVersion) &&\n typeof event.at === 'string' &&\n Number.isFinite(new Date(event.at).valueOf()) &&\n typeof event.sessionId === 'string' &&\n typeof event.board === 'string' &&\n diagnosticKinds.includes(event.kind as (typeof diagnosticKinds)[number])\n )\n}\n\nfunction storageOrUndefined(): StorageLike | undefined {\n try {\n return window.localStorage\n } catch {\n return undefined\n }\n}\n",".panel {\n grid-column: var(--panel-column, span 6);\n grid-row: var(--panel-row, auto);\n display: flex;\n flex-direction: column;\n justify-content: center;\n gap: 0.15em;\n min-width: 0;\n min-height: 0;\n padding: clamp(0.5rem, 0.8vw, var(--gap));\n border: 1px solid var(--edge);\n border-radius: var(--radius);\n background: var(--surface-raised);\n position: relative;\n isolation: isolate;\n overflow: hidden;\n line-height: 1.2;\n container-name: panel;\n container-type: inline-size;\n}\n.content {\n position: relative;\n z-index: 1;\n display: flex;\n flex: 0 1 auto;\n flex-direction: column;\n justify-content: center;\n gap: 0.1em;\n min-width: 0;\n min-height: 0;\n}\n.content > *,\n.details > * {\n min-width: 0;\n max-width: 100%;\n}\n.content:has([data-running-progress=\"runway\"]),\n.content:has([data-running-progress=\"signal-field\"]) {\n flex: 1 1 0;\n}\n.error {\n border-color: var(--status-serious);\n}\n.wide {\n grid-column: span 12;\n}\n.primary {\n padding: 0.65em;\n gap: 0.1em;\n}\n.primary .content {\n gap: 0.1em;\n}\n.compact {\n min-height: 3.5em;\n padding: 0.2em;\n gap: 0;\n line-height: 1.05;\n justify-content: flex-start;\n}\n.compact .content {\n gap: 0;\n}\n.label {\n margin: 0;\n overflow-wrap: anywhere;\n font-size: 1em;\n font-weight: 600;\n font-family: ui-monospace, SFMono-Regular, Menlo, monospace;\n color: var(--ink-secondary);\n}\n.compact .label {\n font-size: 0.8em;\n}\n.hint {\n margin: 0;\n font-size: 0.75em;\n color: var(--ink-muted);\n overflow-wrap: anywhere;\n}\n.branch {\n font-family: ui-monospace, SFMono-Regular, Menlo, monospace;\n overflow-wrap: anywhere;\n}\n.observed {\n display: flex;\n flex-wrap: wrap;\n gap: 0.35em;\n align-items: center;\n}\n.stale {\n color: var(--status-warning);\n}\n.status {\n margin: 0;\n font-size: 1.35em;\n font-weight: 650;\n}\n.compact .status {\n font-size: 1.1em;\n}\n.passed {\n color: var(--status-good);\n}\n.failed {\n color: var(--status-critical);\n}\n.running {\n color: var(--status-warning);\n}\n.cancelled,\n.unknown {\n color: var(--ink-secondary);\n}\n.sourceAction {\n position: absolute;\n z-index: 2;\n top: 0.35em;\n right: 0.35em;\n display: inline-grid;\n width: 2em;\n height: 2em;\n place-items: center;\n border-radius: 0.3em;\n color: var(--ink-secondary);\n font-size: 0.85em;\n font-weight: 600;\n line-height: 1;\n text-decoration: none;\n}\n.sourceAction:hover {\n color: var(--ink-primary);\n background: color-mix(in srgb, var(--ink-primary) 8%, transparent);\n}\n.sourceAction:focus-visible {\n outline: 2px solid var(--ink-primary);\n outline-offset: 2px;\n}\n\n.primary :is(.hint, .observed),\n.compact :is(.hint, .observed) {\n font-size: 0.65em;\n}\n@container panel (min-width: 48rem) {\n .primary.shallow {\n padding: 0.45em 0.65em;\n }\n .primary.shallow .content {\n flex-direction: row;\n flex-wrap: wrap;\n align-items: baseline;\n column-gap: 0.7em;\n row-gap: 0.15em;\n }\n .primary.shallow .status {\n flex: 0 0 auto;\n font-size: 1em;\n }\n .primary.shallow :is(.label, .observed) {\n flex: 0 0 auto;\n }\n}\n@container panel (min-width: 12rem) {\n .compact.shallow .content {\n flex-direction: row;\n flex-wrap: wrap;\n align-items: baseline;\n column-gap: 0.7em;\n row-gap: 0.15em;\n }\n .compact.shallow :is(.label, .observed) {\n flex: 0 0 auto;\n }\n}\n@container panel (max-width: 15rem) {\n .panel {\n font-size: 0.9em;\n }\n}\n@container panel (max-width: 22rem) {\n .panel {\n font-size: 0.8em;\n }\n}\n@media (max-width: 64rem) {\n .panel {\n grid-column: 1 / -1;\n grid-row: auto;\n min-height: 6em;\n }\n .primary .content,\n .compact .content {\n flex-direction: column;\n align-items: stretch;\n }\n}\n","/**\n * A panel-shaped hole, so the grid can be looked at and argued with before any signal exists.\n * Replaced by real panels in Stage 2 — nothing here is meant to survive.\n */\nexport function PanelPlaceholder({\n label,\n hint,\n wide = false,\n}: {\n label: string\n hint: string\n wide?: boolean\n}) {\n return (\n <section\n className={`${styles.panel} ${wide ? styles.wide : ''}`}\n data-panel\n data-panel-id=\"placeholder\"\n >\n <h2 className={styles.label}>{label}</h2>\n <p className={styles.hint}>{hint}</p>\n </section>\n )\n}\n\nimport styles from './PanelFrame.module.css'\n",".fact {\n display: contents;\n}\n@container panel (min-width: 48rem) {\n :global([data-display=\"compact\"][data-shallow=\"true\"]) .fact > * {\n margin: 0;\n }\n}\n@container panel (min-width: 12rem) {\n :global([data-display=\"compact\"][data-shallow=\"true\"]) .fact > * {\n margin: 0;\n }\n}\n","import type { Panel } from '@ze-great-dashboard/shared'\nimport type { CSSProperties } from 'react'\n\n/** Convert the advisory board position into CSS grid placement. */\nexport function panelLayout(panel: Panel): CSSProperties | undefined {\n const position = panel.position\n if (!position) return undefined\n\n return {\n '--panel-column': `${position.x + 1} / span ${position.w}`,\n '--panel-row': `${position.y + 1} / span ${position.h}`,\n } as CSSProperties\n}\n","import type { Envelope, Panel } from '@ze-great-dashboard/shared'\nimport type { ReactNode } from 'react'\nimport styles from './PanelFrame.module.css'\nimport { panelLayout } from './panel-layout.ts'\n\ntype PanelStatusKind = 'passed' | 'failed' | 'running' | 'cancelled' | 'unknown'\n\nexport function PanelHint({ children }: { children: ReactNode }) {\n return <p className={styles.hint}>{children}</p>\n}\n\nexport function PanelStatus({\n children,\n status,\n}: {\n children: ReactNode\n status?: PanelStatusKind\n}) {\n return <p className={`${styles.status} ${status ? styles[status] : ''}`}>{children}</p>\n}\n\nexport function PanelBranch({ children, title }: { children: ReactNode; title: string }) {\n return (\n <span className={styles.branch} title={title}>\n {children}\n </span>\n )\n}\n\nexport function PanelObserved({\n children,\n stale = false,\n}: {\n children: ReactNode\n stale?: boolean\n}) {\n return (\n <p className={`${styles.hint} ${styles.observed} ${stale ? styles.stale : ''}`}>{children}</p>\n )\n}\n\nexport function PanelFrame({\n panel,\n envelope,\n error = false,\n field,\n children,\n}: {\n panel: Panel\n envelope?: Envelope\n error?: boolean\n /** Decorative active-run layer. It is intentionally a sibling of readable panel content. */\n field?: ReactNode\n children: ReactNode\n}) {\n const display =\n panel.display === 'primary' || panel.display === 'compact' ? panel.display : 'supporting'\n const position = panel.position\n const shallow = position !== undefined && position.h <= 2\n const short = position !== undefined && position.h <= 3\n return (\n <section\n className={`${styles.panel} ${styles[display]} ${shallow ? styles.shallow : ''} ${short ? styles.short : ''} ${error ? styles.error : ''}`}\n style={panelLayout(panel)}\n aria-busy={envelope ? undefined : true}\n data-panel\n data-panel-id={panel.id}\n data-panel-position={\n position ? `${position.x},${position.y},${position.w},${position.h}` : undefined\n }\n data-display={display}\n data-shallow={shallow}\n data-short={short}\n data-error={error || undefined}\n >\n {field}\n <PanelSourceLink panelId={panel.id} link={envelope?.link} />\n <div className={styles.content} data-panel-content>\n <h2 className={styles.label}>{panel.label ?? panel.id}</h2>\n {children}\n </div>\n </section>\n )\n}\n\nfunction PanelSourceLink({ panelId, link }: { panelId: string; link?: string | null }) {\n if (!link) return null\n\n return (\n <a\n className={styles.sourceAction}\n href={link}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n aria-label={`View source for ${panelId} (opens in a new tab)`}\n title={`View source for ${panelId} (opens in a new tab)`}\n data-panel-action=\"source\"\n data-panel-link\n >\n <span aria-hidden=\"true\">↗</span>\n <span className=\"screen-reader-only\">View source</span>\n </a>\n )\n}\n","import { PanelObserved } from './PanelFrame.tsx'\n\nexport function ObservedAt({ value, label = 'As of' }: { value: string; label?: string }) {\n const observed = new Date(value)\n const formatted = observed.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })\n const age = Date.now() - observed.getTime()\n const stale = age > 5 * 60 * 1000\n const ageText = formatAge(age)\n return (\n <PanelObserved stale={stale}>\n <span aria-hidden=\"true\">◷</span> {label} {formatted} · {ageText}\n </PanelObserved>\n )\n}\n\nexport function formatAge(milliseconds: number) {\n if (milliseconds < 60_000) return 'just now'\n const minutes = Math.floor(milliseconds / 60_000)\n if (minutes < 60) return `${minutes}m ago`\n const hours = Math.floor(minutes / 60)\n return `${hours}h ${minutes % 60}m ago`\n}\n","import type { Panel } from '@ze-great-dashboard/shared'\nimport { type Envelope, httpValueSchema } from '@ze-great-dashboard/shared'\nimport styles from './HttpValuePanel.module.css'\nimport { ObservedAt } from './ObservedAt.tsx'\nimport { PanelFrame, PanelHint, PanelStatus } from './PanelFrame.tsx'\n\nexport function HttpValuePanel({\n panel,\n envelope,\n}: {\n panel: Panel\n envelope: Envelope | undefined\n}) {\n if (!envelope)\n return (\n <PanelFrame panel={panel}>\n <PanelHint>Loading…</PanelHint>\n </PanelFrame>\n )\n if (envelope.state === 'error')\n return (\n <PanelFrame panel={panel} envelope={envelope} error>\n <PanelStatus>⚠ Unable to read</PanelStatus>\n <PanelHint>{envelope.error.message}</PanelHint>\n <ObservedAt value={envelope.observedAt} />\n </PanelFrame>\n )\n const signal = httpValueSchema.safeParse(envelope.signal)\n if (!signal.success)\n return (\n <PanelFrame panel={panel} envelope={envelope} error>\n <PanelStatus>⚠ Invalid value</PanelStatus>\n <ObservedAt value={envelope.observedAt} />\n </PanelFrame>\n )\n return (\n <PanelFrame panel={panel} envelope={envelope}>\n <div className={styles.fact}>\n <PanelStatus>{String(signal.data.value)}</PanelStatus>\n <ObservedAt value={envelope.observedAt} />\n </div>\n </PanelFrame>\n )\n}\n","export type FallingDirection = 'horizontal' | 'vertical'\nexport type FallingCell = { x: number; y: number }\nexport type FallingShape = {\n id: number\n bornAt: number\n cells: FallingCell[]\n x: number\n y: number\n targetX?: number\n targetY?: number\n phase: 'entry' | 'align' | 'travel' | 'settled'\n}\n\nexport const FALLING_TARGET_FILL = 0.85\n\nconst shapes: FallingCell[][] = [\n [\n { x: 0, y: 0 },\n { x: 1, y: 0 },\n ],\n [\n { x: 0, y: 0 },\n { x: 0, y: 1 },\n ],\n [\n { x: 0, y: 0 },\n { x: 1, y: 0 },\n { x: 0, y: 1 },\n ],\n [\n { x: 0, y: 0 },\n { x: 1, y: 0 },\n { x: 2, y: 0 },\n ],\n [\n { x: 0, y: 0 },\n { x: 0, y: 1 },\n { x: 1, y: 1 },\n ],\n]\n\nexport function fallingDirection(width: number, height: number): FallingDirection {\n return width > height ? 'horizontal' : 'vertical'\n}\n\nexport function fallingGrid(\n direction: FallingDirection,\n width = direction === 'horizontal' ? 12 : 3,\n height = direction === 'horizontal' ? 3 : 12,\n): { columns: number; rows: number } {\n const fieldWidth = Math.max(1, width * 0.8)\n const fieldHeight = Math.max(1, height * 0.8)\n const cellSize = Math.max(24, Math.min(42, Math.min(fieldWidth, fieldHeight) / 4))\n const columns = Math.max(3, Math.min(24, Math.round(fieldWidth / cellSize)))\n const rows = Math.max(3, Math.min(16, Math.round(fieldHeight / cellSize)))\n return direction === 'horizontal'\n ? { columns: Math.max(columns, rows), rows }\n : { columns, rows: Math.max(rows, columns) }\n}\n\nexport function fallingSeed(value: string): number {\n return Array.from(value).reduce(\n (hash, character) => (hash * 31 + character.charCodeAt(0)) >>> 0,\n 7,\n )\n}\n\nexport function shapeFits(shape: FallingCell[], columns: number, rows: number): boolean {\n const maxX = Math.max(...shape.map((cell) => cell.x))\n const maxY = Math.max(...shape.map((cell) => cell.y))\n return maxX < columns && maxY < rows\n}\n\nexport function overlaps(left: FallingShape, right: FallingShape): boolean {\n return left.cells.some((leftCell) =>\n right.cells.some(\n (rightCell) =>\n left.x + leftCell.x === right.x + rightCell.x &&\n left.y + leftCell.y === right.y + rightCell.y,\n ),\n )\n}\n\nexport function chooseShape(seed: number, columns: number, rows: number): FallingCell[] {\n const candidates = shapes.filter((shape) => shapeFits(shape, columns, rows))\n return candidates[randomIndex(seed, candidates.length)] ?? [{ x: 0, y: 0 }]\n}\n\nexport function findDestination(\n shape: FallingCell[],\n direction: FallingDirection,\n columns: number,\n rows: number,\n settled: readonly FallingShape[],\n seed = 0,\n requireSupported = false,\n): { x: number; y: number } | undefined {\n const width = Math.max(...shape.map((cell) => cell.x)) + 1\n const height = Math.max(...shape.map((cell) => cell.y)) + 1\n const candidates: Array<{ x: number; y: number; support: number }> = []\n for (let y = 0; y <= rows - height; y++) {\n for (let x = 0; x <= columns - width; x++) {\n const candidate = { id: -1, bornAt: 0, cells: shape, x, y, phase: 'settled' as const }\n if (settled.some((item) => overlaps(candidate, item))) continue\n if (!clearPath(shape, direction, columns, rows, candidate, settled)) continue\n const support =\n direction === 'vertical'\n ? shape.filter(\n (cell) =>\n y + cell.y === rows - 1 ||\n settled.some((item) =>\n item.cells.some(\n (other) =>\n item.x + other.x === x + cell.x && item.y + other.y === y + cell.y + 1,\n ),\n ),\n ).length\n : shape.filter(\n (cell) =>\n x + cell.x === 0 ||\n settled.some((item) =>\n item.cells.some(\n (other) =>\n item.x + other.x === x + cell.x - 1 && item.y + other.y === y + cell.y,\n ),\n ),\n ).length\n if (requireSupported && support < leadingEdgeCount(shape, direction)) continue\n candidates.push({ x, y, support })\n }\n }\n candidates.sort(\n (left, right) =>\n right.support - left.support ||\n (direction === 'vertical'\n ? right.y - left.y || left.x - right.x\n : left.x - right.x || left.y - right.y),\n )\n const bestSupport = candidates[0]?.support\n const best = candidates.filter((candidate) => candidate.support === bestSupport)\n const destination = best[randomIndex(seed, best.length)]\n return destination ? { x: destination.x, y: destination.y } : undefined\n}\n\nexport function findPlacement(\n direction: FallingDirection,\n columns: number,\n rows: number,\n settled: readonly FallingShape[],\n seed: number,\n requireSupported: boolean,\n): { shape: FallingCell[]; destination: { x: number; y: number } } | undefined {\n const candidates = shapes.flatMap((shape, index) => {\n if (!shapeFits(shape, columns, rows)) return []\n const destination = findDestination(\n shape,\n direction,\n columns,\n rows,\n settled,\n seed + index * 31,\n requireSupported,\n )\n return destination ? [{ shape, destination }] : []\n })\n if (candidates.length === 0) return undefined\n return candidates[randomIndex(seed, candidates.length)]\n}\n\nexport function targetCellCount(columns: number, rows: number, progress: number): number {\n return Math.ceil(columns * rows * FALLING_TARGET_FILL * Math.min(1, Math.max(0, progress)))\n}\n\nexport function occupiedCellCount(shapes: readonly FallingShape[]): number {\n return shapes.reduce((count, shape) => count + shape.cells.length, 0)\n}\n\nexport type LineClear = {\n shapes: FallingShape[]\n cleared: FallingCell[]\n complete: boolean\n}\n\n/** Clears only cells in the trailing edge line and slides the surviving field into it. */\nexport function clearTrailingLine(\n direction: FallingDirection,\n columns: number,\n rows: number,\n settled: readonly FallingShape[],\n allowPartial: boolean,\n): LineClear | undefined {\n const edgeLine = direction === 'vertical' ? rows - 1 : 0\n const occupied = new Set(\n settled.flatMap((item) =>\n item.cells\n .filter((cell) =>\n direction === 'vertical' ? item.y + cell.y === edgeLine : item.x + cell.x === edgeLine,\n )\n .map((cell) => (direction === 'vertical' ? item.x + cell.x : item.y + cell.y)),\n ),\n )\n const lineWidth = direction === 'vertical' ? columns : rows\n const complete = occupied.size === lineWidth\n if (!complete && !allowPartial) return undefined\n if (occupied.size === 0) return undefined\n\n const cleared: FallingCell[] = []\n const shapes = settled.flatMap((item) => {\n const remaining = item.cells.filter((cell) => {\n const onLine =\n direction === 'vertical' ? item.y + cell.y === edgeLine : item.x + cell.x === edgeLine\n if (onLine) {\n cleared.push({ x: item.x + cell.x, y: item.y + cell.y })\n }\n return !onLine\n })\n if (remaining.length === 0) return []\n return [\n {\n ...item,\n cells: remaining,\n y: direction === 'vertical' ? item.y + 1 : item.y,\n x: direction === 'horizontal' ? item.x - 1 : item.x,\n },\n ]\n })\n return { shapes, cleared, complete }\n}\n\nexport function buildStaticField(\n direction: FallingDirection,\n columns: number,\n rows: number,\n seed: number,\n count: number,\n): FallingShape[] {\n const settled: FallingShape[] = []\n for (let id = 0; id < count; id += 1) {\n const pieceSeed = seed + id * 17\n const shape = chooseShape(pieceSeed, columns, rows)\n const destination = findDestination(shape, direction, columns, rows, settled, pieceSeed + 1)\n if (!destination) break\n settled.push({\n id,\n bornAt: 0,\n cells: shape,\n x: destination.x,\n y: destination.y,\n phase: 'settled',\n })\n }\n return settled\n}\n\nfunction leadingEdgeCount(shape: FallingCell[], direction: FallingDirection): number {\n if (direction === 'vertical') {\n return new Set(shape.map((cell) => cell.x)).size\n }\n return new Set(shape.map((cell) => cell.y)).size\n}\n\nfunction clearPath(\n shape: FallingCell[],\n direction: FallingDirection,\n columns: number,\n rows: number,\n destination: FallingShape,\n settled: readonly FallingShape[],\n): boolean {\n const width = Math.max(...shape.map((cell) => cell.x)) + 1\n const height = Math.max(...shape.map((cell) => cell.y)) + 1\n if (direction === 'vertical') {\n for (let y = 0; y <= destination.y; y += 1) {\n if (settled.some((item) => overlaps({ ...destination, y }, item))) return false\n }\n return destination.y + height <= rows\n }\n for (let x = columns - width; x >= destination.x; x -= 1) {\n if (settled.some((item) => overlaps({ ...destination, x }, item))) return false\n }\n return destination.x + width <= columns\n}\n\nfunction randomIndex(seed: number, length: number): number {\n if (length <= 1) return 0\n const value = Math.sin(seed * 12.9898 + 78.233) * 43_758.5453\n return Math.floor((value - Math.floor(value)) * length)\n}\n",".variant {\n margin: 0;\n color: var(--ink-muted);\n font-size: 0.72em;\n text-transform: capitalize;\n transition: color 180ms ease;\n}\n@media (prefers-reduced-motion: reduce) {\n .variant {\n transition: none;\n }\n}\n",".field {\n position: absolute;\n z-index: 0;\n inset: 0;\n overflow: hidden;\n pointer-events: none;\n contain: layout paint;\n color: var(--status-warning);\n}\n.grid {\n position: absolute;\n inset: 10%;\n}\n.piece {\n position: absolute;\n left: calc((var(--piece-x) / var(--shape-columns)) * 100%);\n top: calc((var(--piece-y) / var(--shape-rows)) * 100%);\n width: calc((var(--piece-width) / var(--shape-columns)) * 100%);\n height: calc((var(--piece-height) / var(--shape-rows)) * 100%);\n transition:\n left 120ms linear,\n top 120ms linear;\n}\n.field[data-recycling=\"true\"] .piece {\n transition:\n left 500ms cubic-bezier(0.22, 1, 0.36, 1),\n top 500ms cubic-bezier(0.22, 1, 0.36, 1),\n opacity 180ms ease;\n}\n.field[data-overdue=\"true\"] .piece[data-piece-phase=\"settled\"] {\n opacity: 0.72;\n border-color: currentColor;\n}\n.field[data-overdue=\"true\"] .cell {\n background: color-mix(in srgb, currentColor 38%, transparent);\n box-shadow: 0 0 0.6em color-mix(in srgb, currentColor 48%, transparent);\n}\n.field[data-overdue=\"true\"] .clearingCell {\n animation-duration: 900ms;\n}\n/* biome-ignore lint/style/noDescendingSpecificity: base cell rules follow the overdue override intentionally. */\n.cell {\n position: absolute;\n left: calc((var(--cell-x) / var(--piece-width)) * 100% + 0.12em);\n top: calc((var(--cell-y) / var(--piece-height)) * 100% + 0.12em);\n width: calc(100% / var(--piece-width) - 0.24em);\n height: calc(100% / var(--piece-height) - 0.24em);\n border: 1px solid color-mix(in srgb, currentColor 55%, transparent);\n border-radius: 0.12em;\n background: color-mix(in srgb, currentColor 28%, transparent);\n box-shadow: 0 0 0.45em color-mix(in srgb, currentColor 35%, transparent);\n}\n/* biome-ignore lint/style/noDescendingSpecificity: base clearing rules follow the overdue override intentionally. */\n.clearingCell {\n position: absolute;\n left: calc((var(--clear-x) / var(--shape-columns)) * 100% + 0.12em);\n top: calc((var(--clear-y) / var(--shape-rows)) * 100% + 0.12em);\n width: calc(100% / var(--shape-columns) - 0.24em);\n height: calc(100% / var(--shape-rows) - 0.24em);\n border: 1px solid color-mix(in srgb, currentColor 55%, transparent);\n border-radius: 0.12em;\n background: color-mix(in srgb, currentColor 28%, transparent);\n animation: clear-cell 500ms ease-out forwards;\n}\n.piece[data-piece-phase=\"entry\"] {\n opacity: 0.35;\n}\n.piece[data-piece-phase=\"align\"] {\n opacity: 0.65;\n}\n.piece[data-piece-phase=\"travel\"] {\n opacity: 0.9;\n}\n/* biome-ignore lint/style/noDescendingSpecificity: settled phase is the base state for the overdue override. */\n.piece[data-piece-phase=\"settled\"] {\n opacity: 0.5;\n}\n@media (prefers-reduced-motion: reduce) {\n .piece,\n .field[data-recycling=\"true\"] .piece {\n transition: none;\n }\n .field[data-overdue=\"true\"] .clearingCell {\n animation: none;\n opacity: 0;\n }\n /* biome-ignore lint/style/noDescendingSpecificity: reduced-motion base rule follows the overdue override. */\n .clearingCell {\n animation: none;\n opacity: 0;\n }\n}\n\n@keyframes clear-cell {\n to {\n opacity: 0;\n transform: scale(0.35);\n }\n}\n","import type { CSSProperties } from 'react'\nimport { useEffect, useRef, useState } from 'react'\nimport styles from './FallingShapesField.module.css'\nimport {\n buildStaticField,\n clearTrailingLine,\n type FallingDirection,\n type FallingShape,\n fallingDirection,\n fallingGrid,\n findPlacement,\n occupiedCellCount,\n targetCellCount,\n} from './falling-shapes.ts'\n\nconst TICK_MS = 50\nconst PIECE_INTERVAL_MS = 1_250\nconst ENTRY_MS = 250\nconst TRAVEL_MS = 850\nconst RECYCLE_MS = 500\n\nexport function FallingShapesField({\n progress,\n estimatedDurationMs,\n overdue,\n seed = 0,\n}: {\n progress: number\n estimatedDurationMs?: number\n overdue: boolean\n seed?: number\n}) {\n const rootRef = useRef<HTMLDivElement>(null)\n const [geometry, setGeometry] = useState<{\n columns: number\n rows: number\n direction: FallingDirection\n }>({\n ...fallingGrid('vertical'),\n direction: 'vertical' as const,\n })\n const [pieces, setPieces] = useState<FallingShape[]>([])\n const [recycling, setRecycling] = useState(false)\n const [clearingCells, setClearingCells] = useState<{ x: number; y: number }[]>([])\n const [reducedMotion, setReducedMotion] = useState(false)\n const geometryRef = useRef(geometry)\n const previousGeometryRef = useRef(geometry)\n const progressRef = useRef(progress)\n const seedRef = useRef(seed)\n const directionRef = useRef<FallingDirection | undefined>(undefined)\n const piecesRef = useRef<FallingShape[]>([])\n const recyclingRef = useRef(false)\n const simulation = useRef({\n startedAt: Date.now(),\n nextPieceAt: PIECE_INTERVAL_MS,\n recycleUntil: 0,\n id: 0,\n settled: [] as FallingShape[],\n })\n\n useEffect(() => {\n progressRef.current = progress\n }, [progress])\n\n useEffect(() => {\n seedRef.current = seed\n }, [seed])\n\n useEffect(() => {\n const root = rootRef.current\n if (!root) return\n const update = () => {\n const rect = root.getBoundingClientRect()\n if (rect.width === 0 || rect.height === 0) return\n setGeometry((_current) => {\n const direction = directionRef.current ?? fallingDirection(rect.width, rect.height)\n directionRef.current = direction\n const next = { ...fallingGrid(direction, rect.width, rect.height), direction }\n geometryRef.current = next\n return next\n })\n }\n update()\n if (typeof ResizeObserver === 'undefined') return\n const observer = new ResizeObserver(update)\n observer.observe(root)\n return () => observer.disconnect()\n }, [])\n\n useEffect(() => {\n const media = window.matchMedia('(prefers-reduced-motion: reduce)')\n const update = () => setReducedMotion(media.matches)\n update()\n media.addEventListener?.('change', update)\n return () => media.removeEventListener?.('change', update)\n }, [])\n\n useEffect(() => {\n const previous = previousGeometryRef.current\n const changed =\n previous.direction !== geometry.direction ||\n previous.columns !== geometry.columns ||\n previous.rows !== geometry.rows\n previousGeometryRef.current = geometry\n if (!changed || reducedMotion) return\n simulation.current = {\n startedAt: Date.now(),\n nextPieceAt: PIECE_INTERVAL_MS,\n id: 0,\n recycleUntil: 0,\n settled: [],\n }\n piecesRef.current = []\n setPieces([])\n setRecycling(false)\n setClearingCells([])\n recyclingRef.current = false\n }, [geometry, reducedMotion])\n\n useEffect(() => {\n if (!reducedMotion) return\n const staticPieces = buildStaticField(\n geometry.direction,\n geometry.columns,\n geometry.rows,\n seedRef.current,\n Math.max(1, Math.floor(progressRef.current * 6)),\n )\n piecesRef.current = staticPieces\n simulation.current.settled = staticPieces\n setPieces(staticPieces)\n }, [geometry, reducedMotion])\n\n useEffect(() => {\n if (reducedMotion) return\n const timer = window.setInterval(() => {\n const state = simulation.current\n const elapsed = Date.now() - state.startedAt\n const currentGeometry = geometryRef.current\n const currentProgress = progressRef.current\n const target = targetCellCount(currentGeometry.columns, currentGeometry.rows, currentProgress)\n let next = [...state.settled]\n let active = piecesRef.current.filter((piece) => piece.phase !== 'settled')\n if (elapsed < state.recycleUntil) return\n if (recyclingRef.current) {\n recyclingRef.current = false\n setRecycling(false)\n setClearingCells([])\n }\n if (elapsed >= state.nextPieceAt && active.length === 0) {\n if (currentProgress < 1 && occupiedCellCount(next) >= target) {\n return\n }\n const id = state.id\n const pieceSeed = seedRef.current + id * 17\n const placement = findPlacement(\n currentGeometry.direction,\n currentGeometry.columns,\n currentGeometry.rows,\n next,\n pieceSeed + 1,\n !overdue,\n )\n if (!placement && (currentProgress >= 1 || estimatedDurationMs === undefined)) {\n const cleared = clearTrailingLine(\n currentGeometry.direction,\n currentGeometry.columns,\n currentGeometry.rows,\n next,\n true,\n )\n if (cleared) {\n next = cleared.shapes\n state.settled = next\n state.recycleUntil = elapsed + RECYCLE_MS\n state.nextPieceAt = state.recycleUntil\n piecesRef.current = next\n recyclingRef.current = true\n setClearingCells(cleared.cleared)\n setPieces(next)\n setRecycling(true)\n return\n }\n }\n if (placement) {\n state.id += 1\n const { shape, destination } = placement\n const height = Math.max(...shape.map((cell) => cell.y)) + 1\n active = [\n ...active,\n {\n id,\n bornAt: elapsed,\n cells: shape,\n x:\n currentGeometry.direction === 'horizontal'\n ? currentGeometry.columns - Math.max(...shape.map((cell) => cell.x)) - 0.5\n : destination.x,\n y: currentGeometry.direction === 'vertical' ? -height + 0.5 : destination.y,\n targetX: destination.x,\n targetY: destination.y,\n phase: 'entry',\n },\n ]\n }\n state.nextPieceAt += pieceInterval(estimatedDurationMs, currentGeometry)\n }\n active = active.map((piece) => {\n const age = elapsed - piece.bornAt\n const destination =\n piece.targetX === undefined || piece.targetY === undefined\n ? undefined\n : { x: piece.targetX, y: piece.targetY }\n if (!destination) return piece\n const amount = Math.min(1, Math.max(0, (age - ENTRY_MS) / TRAVEL_MS))\n if (amount >= 1) {\n next = [\n ...next,\n { ...piece, x: destination.x, y: destination.y, phase: 'settled' as const },\n ]\n return { ...piece, x: destination.x, y: destination.y, phase: 'settled' as const }\n }\n const startX =\n currentGeometry.direction === 'horizontal'\n ? currentGeometry.columns - Math.max(...piece.cells.map((cell) => cell.x)) - 1\n : destination.x\n const startY = currentGeometry.direction === 'vertical' ? 0 : destination.y\n const lifecycleAmount = Math.min(1, Math.max(0, age / (ENTRY_MS + TRAVEL_MS)))\n return {\n ...piece,\n x:\n currentGeometry.direction === 'horizontal'\n ? startX + (destination.x - startX) * amount\n : startX,\n y:\n currentGeometry.direction === 'vertical'\n ? startY + (destination.y - startY) * amount\n : startY,\n phase: age < ENTRY_MS ? 'entry' : lifecycleAmount < 0.35 ? 'align' : 'travel',\n }\n })\n state.settled = next\n const visible = [...next, ...active.filter((piece) => piece.phase !== 'settled')]\n piecesRef.current = visible\n setPieces(visible)\n }, TICK_MS)\n return () => window.clearInterval(timer)\n }, [estimatedDurationMs, overdue, reducedMotion])\n\n return (\n <div\n ref={rootRef}\n className={styles.field}\n data-running-part=\"falling-shapes-field\"\n data-overdue={overdue || undefined}\n data-direction={geometry.direction}\n data-recycling={recycling || undefined}\n style={\n { '--shape-columns': geometry.columns, '--shape-rows': geometry.rows } as CSSProperties\n }\n >\n <div className={styles.grid}>\n {clearingCells.map((cell) => (\n <span\n key={`${cell.x}-${cell.y}`}\n className={styles.clearingCell}\n style={{ '--clear-x': cell.x, '--clear-y': cell.y } as CSSProperties}\n />\n ))}\n {pieces.map((piece) => (\n <div\n key={piece.id}\n className={styles.piece}\n data-piece={piece.id}\n data-piece-phase={piece.phase}\n style={\n {\n '--piece-x': piece.x,\n '--piece-y': piece.y,\n '--piece-width': Math.max(...piece.cells.map((cell) => cell.x)) + 1,\n '--piece-height': Math.max(...piece.cells.map((cell) => cell.y)) + 1,\n } as CSSProperties\n }\n >\n {piece.cells.map((cell) => (\n <span\n key={`${cell.x}-${cell.y}`}\n className={styles.cell}\n style={{ '--cell-x': cell.x, '--cell-y': cell.y } as CSSProperties}\n />\n ))}\n </div>\n ))}\n </div>\n </div>\n )\n}\n\nfunction pieceInterval(\n estimatedDurationMs: number | undefined,\n geometry: { columns: number; rows: number },\n) {\n const target = Math.ceil(geometry.columns * geometry.rows * 0.85)\n if (estimatedDurationMs === undefined || target <= 0) return PIECE_INTERVAL_MS\n return Math.max(400, estimatedDurationMs / Math.max(1, Math.ceil(target / 3)))\n}\n",".frontier {\n position: absolute;\n inset: 0 auto 0 0;\n width: var(--running-progress);\n background: linear-gradient(\n 90deg,\n color-mix(in srgb, currentColor 16%, transparent),\n transparent\n );\n border-right: 1px solid color-mix(in srgb, currentColor 75%, transparent);\n}\n.now {\n position: absolute;\n top: 10%;\n bottom: 10%;\n left: 70%;\n width: 1px;\n background: color-mix(in srgb, var(--ink-primary) 45%, transparent);\n}\n.routes {\n position: absolute;\n inset: 18% 8%;\n display: grid;\n align-content: space-between;\n}\n.route {\n height: 1px;\n background: linear-gradient(\n 90deg,\n transparent,\n color-mix(in srgb, var(--ink-muted) 45%, transparent),\n transparent\n );\n}\n.route:nth-child(2) {\n transform: translateX(8%);\n}\n.route:nth-child(3) {\n transform: translateX(-6%);\n}\n.trail,\n.packet {\n position: absolute;\n top: 50%;\n left: -10%;\n border-radius: 999px;\n animation: packet 4.8s ease-in-out infinite alternate;\n}\n.trail {\n width: 18%;\n height: 2px;\n background: linear-gradient(90deg, transparent, currentColor);\n opacity: 0.65;\n}\n.packet {\n width: 0.48em;\n height: 0.48em;\n background: currentColor;\n box-shadow: 0 0 0.65em currentColor;\n}\n@container running-field (max-width: 40rem) {\n .routes,\n .trail,\n .packet,\n .now {\n display: none;\n }\n .frontier {\n width: 0.28em;\n border-right: 0;\n background: currentColor;\n }\n}\n[data-overdue=\"true\"] .frontier {\n width: 70%;\n background: linear-gradient(\n 90deg,\n color-mix(in srgb, currentColor 28%, transparent),\n transparent\n );\n}\n[data-overdue=\"true\"] .packet {\n left: 70%;\n animation: packet-stall 1.8s ease-in-out infinite alternate;\n}\n[data-overdue=\"true\"] .trail {\n left: 43%;\n width: 27%;\n animation: trail-backup 1.8s ease-in-out infinite alternate;\n}\n@keyframes packet {\n from {\n transform: translate(-10cqw, -50%);\n }\n to {\n transform: translate(120cqw, -50%);\n }\n}\n@keyframes packet-stall {\n from {\n transform: translate(-50%, -50%) scale(0.82);\n opacity: 0.72;\n }\n to {\n transform: translate(-50%, -50%) scale(1.12);\n opacity: 1;\n }\n}\n@keyframes trail-backup {\n from {\n transform: translate(-8%, -50%);\n opacity: 0.5;\n }\n to {\n transform: translate(8%, -50%);\n opacity: 0.95;\n }\n}\n@media (prefers-reduced-motion: reduce) {\n [data-overdue=\"true\"] .trail,\n [data-overdue=\"true\"] .packet,\n .trail,\n .packet {\n animation: none;\n }\n .frontier {\n transition: none;\n }\n}\n","import styles from './ReleaseTransitField.module.css'\n\nexport function ReleaseTransitField() {\n return (\n <>\n <span className={styles.frontier} data-running-part=\"frontier\" />\n <span className={styles.now} data-running-part=\"transit-now\" />\n <span className={styles.routes} data-running-part=\"transit-routes\">\n {[0, 1, 2].map((route) => (\n <span className={styles.route} key={route} />\n ))}\n </span>\n <span className={styles.trail} data-running-part=\"transit-trail\" />\n <span className={styles.packet} data-running-part=\"transit-packet\" />\n </>\n )\n}\n",".field {\n position: absolute;\n z-index: 0;\n inset: 0;\n overflow: hidden;\n pointer-events: none;\n container-type: size;\n container-name: running-field;\n color: var(--status-warning);\n}\n.overdue {\n color: var(--status-serious);\n}\n.timing {\n width: min(12ch, 100%);\n max-width: 100%;\n min-width: 0;\n flex: 0 1 12ch;\n margin: 0;\n color: var(--ink-secondary);\n font-family: ui-monospace, SFMono-Regular, Menlo, monospace;\n font-size: 0.72em;\n font-variant-numeric: tabular-nums;\n text-align: end;\n white-space: nowrap;\n overflow: hidden;\n}\n.timingOverdue {\n color: var(--status-serious);\n}\n",".haze {\n position: absolute;\n inset: -15%;\n background:\n radial-gradient(\n ellipse at 18% 44%,\n color-mix(in srgb, currentColor 19%, transparent),\n transparent 42%\n ),\n radial-gradient(\n ellipse at 74% 63%,\n color-mix(in srgb, currentColor 12%, transparent),\n transparent 38%\n );\n animation: haze 15s ease-in-out infinite alternate;\n}\n.pressure {\n display: none;\n}\n.band {\n position: absolute;\n right: -15%;\n left: -15%;\n height: 1px;\n background: linear-gradient(\n 90deg,\n transparent,\n color-mix(in srgb, currentColor 32%, transparent),\n transparent\n );\n animation: band 10s ease-in-out infinite alternate;\n}\n.bandOne {\n top: 32%;\n}\n.bandTwo {\n top: 67%;\n animation-delay: -4s;\n}\n.bandThree {\n top: 49%;\n animation-delay: -7s;\n opacity: 0.55;\n}\n.drift {\n position: absolute;\n width: clamp(0.34em, 0.9cqw, 0.7em);\n height: clamp(0.34em, 0.9cqw, 0.7em);\n border: 1px solid color-mix(in srgb, currentColor 78%, transparent);\n border-radius: 50%;\n box-shadow: 0 0 0.55em color-mix(in srgb, currentColor 55%, transparent);\n animation: drift 11s ease-in-out infinite alternate;\n}\n.driftOne {\n top: 25%;\n left: 12%;\n}\n.driftTwo {\n top: 72%;\n left: 58%;\n width: 0.34em;\n height: 0.34em;\n animation-duration: 14s;\n animation-delay: -4s;\n opacity: 0.6;\n}\n.driftThree {\n top: 18%;\n left: 74%;\n width: 0.7em;\n height: 0.7em;\n animation-duration: 17s;\n animation-delay: -9s;\n opacity: 0.55;\n}\n.driftFour {\n top: 58%;\n left: 31%;\n width: 0.42em;\n height: 0.42em;\n animation-duration: 9s;\n animation-delay: -2s;\n opacity: 0.75;\n}\n.driftFive {\n top: 84%;\n left: 83%;\n width: 0.58em;\n height: 0.58em;\n animation-duration: 13s;\n animation-delay: -6s;\n opacity: 0.45;\n}\n@container running-field (max-width: 40rem) or (max-height: 6rem) {\n .drift,\n .band {\n display: none;\n }\n .haze {\n inset: auto 0 0 auto;\n width: 2.5em;\n height: 2.5em;\n opacity: 0.65;\n }\n}\n[data-overdue=\"true\"] .haze {\n inset: -30%;\n background:\n radial-gradient(\n ellipse at 22% 48%,\n color-mix(in srgb, currentColor 34%, transparent),\n transparent 42%\n ),\n radial-gradient(\n ellipse at 78% 58%,\n color-mix(in srgb, currentColor 25%, transparent),\n transparent 36%\n );\n}\n[data-overdue=\"true\"] .pressure {\n display: block;\n position: absolute;\n inset: 20% 0;\n border-top: 1px solid color-mix(in srgb, currentColor 65%, transparent);\n border-bottom: 1px solid color-mix(in srgb, currentColor 65%, transparent);\n background: repeating-linear-gradient(\n 180deg,\n transparent 0 0.55em,\n color-mix(in srgb, currentColor 14%, transparent) 0.55em 0.62em\n );\n opacity: 0.75;\n animation: pressure 3.4s ease-in-out infinite alternate;\n}\n[data-overdue=\"true\"] .band {\n background: linear-gradient(90deg, transparent, currentColor, transparent);\n animation-name: storm-band;\n}\n[data-overdue=\"true\"] .drift {\n transform: translate(12cqw, -2cqh) scale(0.82);\n}\n@keyframes haze {\n to {\n transform: translate(9%, -4%);\n }\n}\n@keyframes band {\n to {\n transform: translateX(8%);\n opacity: 0.45;\n }\n}\n@keyframes drift {\n to {\n transform: translate(10cqw, -2cqh);\n }\n}\n@keyframes pressure {\n from {\n transform: scaleY(0.72);\n opacity: 0.45;\n }\n to {\n transform: scaleY(1.12);\n opacity: 0.9;\n }\n}\n@keyframes storm-band {\n to {\n transform: translateX(-14%);\n opacity: 0.9;\n }\n}\n@media (prefers-reduced-motion: reduce) {\n [data-overdue=\"true\"] .pressure,\n .haze,\n .band,\n .drift {\n animation: none;\n }\n .pressure {\n animation: none;\n }\n}\n","import styles from './StatusWeatherField.module.css'\n\nexport function StatusWeatherField() {\n return (\n <>\n <span className={styles.haze} data-running-part=\"weather-haze\" />\n <span className={styles.pressure} data-running-part=\"weather-pressure\" />\n <span className={`${styles.band} ${styles.bandOne}`} />\n <span className={`${styles.band} ${styles.bandTwo}`} />\n <span className={`${styles.band} ${styles.bandThree}`} />\n <span className={`${styles.drift} ${styles.driftOne}`} />\n <span className={`${styles.drift} ${styles.driftTwo}`} />\n <span className={`${styles.drift} ${styles.driftThree}`} />\n <span className={`${styles.drift} ${styles.driftFour}`} />\n <span className={`${styles.drift} ${styles.driftFive}`} />\n </>\n )\n}\n",".anchor {\n position: absolute;\n top: 50%;\n left: var(--running-progress);\n}\n.body {\n position: absolute;\n inset: 0;\n animation: phased-marker 3.2s ease-in-out infinite alternate;\n animation-delay: var(--phased-marker-delay, 0s);\n will-change: transform;\n}\n@keyframes phased-marker {\n from {\n transform: translate(var(--phased-marker-travel, -10em), -50%);\n }\n to {\n transform: translate(-50%, -50%);\n }\n}\n@media (prefers-reduced-motion: reduce) {\n .body {\n animation: none;\n }\n}\n","import type { CSSProperties } from 'react'\nimport styles from './PhasedProgressMarker.module.css'\n\n/**\n * A progress-anchored decorative marker. The anchor owns live progress geometry; the body owns\n * its independent phase animation, so a timing render cannot replace its transform.\n */\nexport function PhasedProgressMarker({\n anchorClassName,\n bodyClassName,\n delay,\n anchorPart,\n bodyPart,\n}: {\n anchorClassName: string | undefined\n bodyClassName: string | undefined\n delay?: string\n anchorPart?: string\n bodyPart: string\n}) {\n const style = delay ? ({ '--phased-marker-delay': delay } as CSSProperties) : undefined\n return (\n <span className={`${styles.anchor} ${anchorClassName ?? ''}`} data-running-part={anchorPart}>\n <span\n className={`${styles.body} ${bodyClassName ?? ''}`}\n data-running-part={bodyPart}\n style={style}\n />\n </span>\n )\n}\n",".frontier {\n position: absolute;\n inset: 0 auto 0 0;\n width: var(--running-progress);\n background: linear-gradient(\n 90deg,\n color-mix(in srgb, currentColor 16%, transparent),\n transparent\n );\n border-right: 1px solid color-mix(in srgb, currentColor 75%, transparent);\n}\n.flare {\n display: none;\n}\n.lanes {\n position: absolute;\n inset: 13% 7%;\n display: grid;\n align-content: space-between;\n}\n.lane {\n position: relative;\n height: 1px;\n background: linear-gradient(\n 90deg,\n transparent,\n color-mix(in srgb, var(--edge) 90%, transparent),\n transparent\n );\n}\n.markerAnchor {\n width: 0.42em;\n height: 0.25em;\n}\n.markerBody {\n --phased-marker-travel: -10cqw;\n border-radius: 999px;\n background: currentColor;\n box-shadow: 0 0 0.6em currentColor;\n}\n.lane:nth-child(2) .markerBody {\n opacity: 0.7;\n}\n.lane:nth-child(3) .markerBody {\n opacity: 0.5;\n}\n.lane:nth-child(4) .markerBody {\n opacity: 0.8;\n}\n@container running-field (max-width: 40rem) or (max-height: 6rem) {\n .lanes {\n display: none;\n }\n .frontier {\n width: 0.28em;\n border-right: 0;\n background: currentColor;\n }\n}\n[data-overdue=\"true\"] .frontier {\n width: 100%;\n background: linear-gradient(\n 90deg,\n color-mix(in srgb, currentColor 34%, transparent),\n transparent\n );\n border-right-color: currentColor;\n}\n[data-overdue=\"true\"] .flare {\n display: block;\n position: absolute;\n top: 0;\n left: 100%;\n width: 2.4em;\n height: 100%;\n background: radial-gradient(ellipse, currentColor 0, transparent 68%);\n transform: translateX(-50%);\n animation: bloom-flare 1.6s ease-in-out infinite alternate;\n}\n[data-overdue=\"true\"] .markerBody {\n --phased-marker-travel: -22.5cqw;\n animation-duration: 0.72s;\n animation-timing-function: ease-in-out;\n}\n@media (prefers-reduced-motion: reduce) {\n .frontier {\n transition: none;\n }\n [data-overdue=\"true\"] .flare,\n [data-overdue=\"true\"] .markerBody {\n animation: none;\n }\n}\n@keyframes bloom-flare {\n from {\n opacity: 0.42;\n transform: translateX(-50%) scale(0.8);\n }\n to {\n opacity: 0.95;\n transform: translateX(-50%) scale(1.15);\n }\n}\n","import { PhasedProgressMarker } from './PhasedProgressMarker.tsx'\nimport styles from './TelemetryBloomField.module.css'\n\nexport function TelemetryBloomField() {\n return (\n <>\n <span className={styles.frontier} data-running-part=\"frontier\" />\n <span className={styles.flare} data-running-part=\"bloom-flare\" />\n <span className={styles.lanes} data-running-part=\"bloom-lanes\">\n {[0, 1, 2, 3].map((lane) => (\n <span className={styles.lane} key={lane} data-running-part=\"bloom-lane\">\n <PhasedProgressMarker\n anchorClassName={styles.markerAnchor}\n bodyClassName={styles.markerBody}\n delay={[undefined, '-0.8s', '-1.7s', '-2.4s'][lane]}\n anchorPart=\"bloom-marker-anchor\"\n bodyPart=\"bloom-marker\"\n />\n </span>\n ))}\n </span>\n </>\n )\n}\n","import type { RunningAnimation } from '@ze-great-dashboard/shared'\nimport type { CSSProperties } from 'react'\nimport { FallingShapesField } from './FallingShapesField.tsx'\nimport { ReleaseTransitField } from './ReleaseTransitField.tsx'\nimport styles from './RunningField.module.css'\nimport { StatusWeatherField } from './StatusWeatherField.tsx'\nimport { TelemetryBloomField } from './TelemetryBloomField.tsx'\n\nexport type RunningFieldAnimation = Extract<\n RunningAnimation,\n 'telemetry-bloom' | 'release-transit' | 'status-weather' | 'falling-shapes'\n>\n\nexport function isRunningFieldAnimation(\n animation: Exclude<RunningAnimation, 'off'>,\n): animation is RunningFieldAnimation {\n return ['telemetry-bloom', 'release-transit', 'status-weather', 'falling-shapes'].includes(\n animation,\n )\n}\n\nexport function RunningField({\n animation,\n progress,\n estimatedDurationMs,\n overdue,\n indeterminate,\n seed,\n}: {\n animation: RunningFieldAnimation\n progress: number\n estimatedDurationMs?: number\n overdue: boolean\n indeterminate: boolean\n seed?: number\n}) {\n const style = {\n '--running-progress': `${progress * 100}%`,\n } as CSSProperties\n return (\n <div\n className={`${styles.field} ${overdue ? styles.overdue : ''}`}\n data-animation={animation}\n data-running-field\n data-overdue={overdue || undefined}\n data-indeterminate={indeterminate || undefined}\n aria-hidden=\"true\"\n style={style}\n >\n {animation === 'telemetry-bloom' && <TelemetryBloomField />}\n {animation === 'release-transit' && <ReleaseTransitField />}\n {animation === 'status-weather' && <StatusWeatherField />}\n {animation === 'falling-shapes' && (\n <FallingShapesField\n progress={progress}\n estimatedDurationMs={estimatedDurationMs}\n overdue={overdue}\n seed={seed}\n />\n )}\n </div>\n )\n}\n","import { useEffect, useState } from 'react'\n\nconst VISUAL_TICK_MS = 20\n\nexport type RunningTiming = {\n elapsedMs: number | undefined\n estimatedDurationMs: number | undefined\n hasEstimate: boolean\n overdue: boolean\n progress: number\n}\n\nexport function useRunningTiming(\n runStartedAt?: string,\n estimatedDurationMs?: number,\n): RunningTiming {\n const now = useClock(Boolean(runStartedAt))\n const startedAt = runStartedAt ? new Date(runStartedAt).valueOf() : Number.NaN\n const elapsedMs = Number.isFinite(startedAt) ? Math.max(0, now - startedAt) : undefined\n const hasEstimate = elapsedMs !== undefined && estimatedDurationMs !== undefined\n const overdue = hasEstimate && elapsedMs > estimatedDurationMs\n const progress = hasEstimate ? Math.min(elapsedMs / estimatedDurationMs, 1) : 0\n return { elapsedMs, estimatedDurationMs, hasEstimate, overdue, progress }\n}\n\nfunction useClock(enabled: boolean) {\n const [now, setNow] = useState(() => Date.now())\n useEffect(() => {\n if (!enabled) return\n setNow(Date.now())\n // The timing text rounds to seconds, but progress gets display-cadence intermediate positions.\n // This avoids the visible sawtooth created by a coarse timer and CSS transition.\n const interval = window.setInterval(() => setNow(Date.now()), VISUAL_TICK_MS)\n return () => window.clearInterval(interval)\n }, [enabled])\n return now\n}\n\nexport function timingDescription(\n elapsedMs: number | undefined,\n estimatedDurationMs: number | undefined,\n overdue: boolean,\n) {\n const elapsed =\n elapsedMs === undefined ? 'Run in progress' : `Elapsed ${formatDuration(elapsedMs)}`\n const expected =\n estimatedDurationMs === undefined\n ? 'Expected duration unavailable'\n : `Expected ≈ ${formatDuration(estimatedDurationMs)}`\n return `${elapsed} · ${expected}${overdue ? ' · Over estimate' : ''}`\n}\n\nexport function compactTiming(\n elapsedMs: number | undefined,\n estimatedDurationMs: number | undefined,\n overdue: boolean,\n) {\n const elapsed = elapsedMs === undefined ? '—' : formatClockDuration(elapsedMs)\n const expected =\n estimatedDurationMs === undefined ? '?' : `~${formatClockDuration(estimatedDurationMs)}`\n return `${overdue ? '⚠' : '\\u00a0'}${elapsed}/${expected}`\n}\n\nfunction formatDuration(durationMs: number) {\n const totalSeconds = Math.floor(durationMs / 1_000)\n const hours = Math.floor(totalSeconds / 3_600)\n const minutes = Math.floor((totalSeconds % 3_600) / 60)\n const seconds = totalSeconds % 60\n if (hours > 0) return `${hours}h ${minutes}m`\n if (minutes > 0) return `${minutes}m ${seconds}s`\n return `${seconds}s`\n}\n\nfunction formatClockDuration(durationMs: number) {\n const totalSeconds = Math.floor(durationMs / 1_000)\n const hours = Math.floor(totalSeconds / 3_600)\n const minutes = Math.floor((totalSeconds % 3_600) / 60)\n const seconds = totalSeconds % 60\n const clock = `${minutes}:${String(seconds).padStart(2, '0')}`\n return hours > 0 ? `${hours}:${clock.padStart(5, '0')}` : clock\n}\n","import styles from './RunningField.module.css'\nimport { compactTiming, timingDescription } from './running-timing.ts'\n\n/** The sole readable timing projection for panel-scale decorative fields. */\nexport function RunningFieldTiming({\n elapsedMs,\n estimatedDurationMs,\n overdue,\n}: {\n elapsedMs: number | undefined\n estimatedDurationMs: number | undefined\n overdue: boolean\n}) {\n return (\n <p className={`${styles.timing} ${overdue ? styles.timingOverdue : ''}`}>\n <span className=\"screen-reader-only\">\n {timingDescription(elapsedMs, estimatedDurationMs, overdue)}\n </span>\n <span aria-hidden=\"true\">{compactTiming(elapsedMs, estimatedDurationMs, overdue)}</span>\n </p>\n )\n}\n",".progress {\n display: flex;\n align-items: center;\n gap: 0.6em;\n min-width: 0;\n color: var(--status-warning);\n}\n.visual {\n position: relative;\n flex: 0 0 auto;\n}\n.timing {\n margin: 0;\n color: var(--ink-secondary);\n font-size: 0.72em;\n}\n.overdue {\n color: var(--status-serious);\n}\n.overdue .timing {\n color: var(--status-serious);\n}\n.readout {\n width: 12ch;\n flex: 0 0 12ch;\n font-family: ui-monospace, SFMono-Regular, Menlo, monospace;\n font-variant-numeric: tabular-nums;\n text-align: end;\n white-space: nowrap;\n}\n.radial .visual {\n width: 2.35em;\n height: 2.35em;\n border: 0.14em solid var(--edge);\n border-radius: 50%;\n background: conic-gradient(var(--status-warning) var(--running-progress), var(--edge) 0);\n box-shadow:\n inset 0 0 0 0.22em var(--surface-raised),\n 0 0 0.55em color-mix(in srgb, var(--status-warning) 45%, transparent);\n}\n.radial .visual::after {\n content: \"\";\n position: absolute;\n inset: -0.14em;\n border-radius: 50%;\n border-top: 0.14em solid var(--status-warning);\n animation: sweep 1.7s linear infinite;\n}\n.overdue.radial .visual::before {\n content: \"\";\n position: absolute;\n inset: -0.42em;\n border: 0.1em solid var(--status-serious);\n border-radius: 50%;\n box-shadow: 0 0 0.55em color-mix(in srgb, var(--status-serious) 65%, transparent);\n animation: alarm-ring 1.8s ease-in-out infinite;\n}\n.radialCore {\n position: absolute;\n inset: 0.68em;\n border-radius: 50%;\n background: var(--status-warning);\n box-shadow: 0 0 0.45em var(--status-warning);\n}\n.overdue .radialCore {\n background: var(--status-serious);\n box-shadow: 0 0 0.55em var(--status-serious);\n animation: reactor-breathe 1.8s ease-in-out infinite alternate;\n}\n.runway {\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto;\n align-self: stretch;\n container-type: inline-size;\n}\n.runway .visual {\n width: min(12em, 100%);\n max-width: 100%;\n height: 0.8em;\n overflow: hidden;\n border: 1px solid var(--edge);\n border-radius: 999px;\n background: linear-gradient(90deg, var(--status-warning) var(--running-progress), var(--edge) 0);\n}\n.runway .visual::after {\n content: \"\";\n position: absolute;\n top: -0.25em;\n bottom: -0.25em;\n left: calc(var(--running-progress) - 0.06em);\n width: 0.12em;\n background: var(--ink-primary);\n box-shadow: 0 0 0.45em var(--ink-primary);\n}\n.overdue.runway .visual::before {\n content: \"\";\n position: absolute;\n inset: -0.2em 0;\n left: calc(100% - 0.55em);\n width: 0.55em;\n background: repeating-linear-gradient(\n -45deg,\n var(--status-serious) 0 0.12em,\n var(--surface) 0.12em 0.24em\n );\n box-shadow: 0 0 0.5em color-mix(in srgb, var(--status-serious) 70%, transparent);\n animation: barrier-pulse 1.4s ease-in-out infinite alternate;\n}\n.overdue.runway .visual::after {\n background: var(--status-serious);\n box-shadow: 0 0 0.55em var(--status-serious);\n animation: barrier-pulse 1.4s ease-in-out infinite alternate;\n}\n.spark {\n position: absolute;\n top: 50%;\n left: -0.5em;\n width: 0.35em;\n height: 0.35em;\n border-radius: 50%;\n background: var(--ink-primary);\n box-shadow: 0 0 0.4em var(--status-warning);\n animation: spark 1.5s linear infinite;\n}\n.overdue.runway .spark {\n animation-duration: 1s;\n}\n.sparkTwo {\n display: none;\n animation-delay: -0.5s;\n}\n.overdue.runway .sparkTwo {\n display: block;\n}\n.orbit .visual {\n width: 2.4em;\n height: 2.4em;\n border: 1px solid var(--edge);\n border-radius: 50%;\n}\n/* biome-ignore lint/style/noDescendingSpecificity: the radial overdue ring precedes this separate legacy treatment. */\n.orbit .visual::before {\n content: \"\";\n position: absolute;\n inset: 0.18em;\n border: 0.12em solid transparent;\n border-top-color: var(--status-warning);\n border-radius: 50%;\n transform: rotate(var(--running-degrees));\n}\n.orbitCore {\n position: absolute;\n inset: 0.75em;\n border-radius: 50%;\n background: var(--status-warning);\n box-shadow: 0 0 0.45em var(--status-warning);\n}\n.overdue .orbitCore {\n background: var(--status-serious);\n box-shadow: 0 0 0.55em var(--status-serious);\n animation: reactor-breathe 1.15s ease-in-out infinite alternate;\n}\n.particle {\n position: absolute;\n top: 0.25em;\n left: calc(50% - 0.16em);\n width: 0.32em;\n height: 0.32em;\n border-radius: 50%;\n background: var(--ink-primary);\n transform-origin: 0.16em 0.95em;\n animation: orbit 1.8s linear infinite;\n}\n.particleTwo {\n animation-delay: -0.9s;\n background: var(--status-warning);\n}\n.overdue.orbit .visual::after {\n content: \"\";\n position: absolute;\n inset: 0.42em;\n border: 0.08em solid color-mix(in srgb, var(--status-serious) 75%, transparent);\n border-radius: 50%;\n box-shadow: 0 0 0.6em color-mix(in srgb, var(--status-serious) 55%, transparent);\n animation: gravity-well 1.15s ease-in-out infinite alternate;\n}\n.overdue.orbit .particle {\n transform-origin: 0.16em 0.7em;\n animation-duration: 0.95s;\n}\n.indeterminate .visual {\n background-image: repeating-linear-gradient(\n 135deg,\n color-mix(in srgb, var(--status-warning) 70%, transparent) 0 0.25em,\n var(--edge) 0.25em 0.5em\n );\n animation: shift 1s linear infinite;\n}\n.signalField {\n container-type: size;\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto;\n align-self: stretch;\n flex: 1 1 auto;\n min-height: 0;\n max-height: 100%;\n}\n.signalField .visual {\n width: auto;\n height: 1em;\n max-height: 100%;\n overflow: hidden;\n border: 1px solid var(--edge);\n border-radius: 999px;\n background: var(--surface);\n}\n.rail {\n position: absolute;\n inset: 0;\n background: linear-gradient(90deg, var(--status-warning) var(--running-progress), var(--edge) 0);\n opacity: 0.75;\n}\n.lead {\n position: absolute;\n top: -0.2em;\n bottom: -0.2em;\n left: calc(var(--running-progress) - 0.08em);\n width: 0.16em;\n border-radius: 999px;\n background: var(--ink-primary);\n box-shadow: 0 0 0.5em var(--status-warning);\n}\n.pulse {\n position: absolute;\n top: 50%;\n left: -0.5em;\n width: 0.3em;\n height: 0.3em;\n border-radius: 50%;\n background: var(--ink-primary);\n box-shadow: 0 0 0.4em var(--status-warning);\n animation: pulse 2.4s ease-in-out infinite alternate;\n}\n.pulseTwo {\n animation-delay: -1.2s;\n}\n.tracks {\n display: none;\n}\n@container panel (min-width: 26rem) {\n .runway .visual {\n flex: 1 1 auto;\n width: auto;\n height: clamp(1.1em, 7cqw, 2.7em);\n box-shadow: inset 0 0 1em color-mix(in srgb, var(--status-warning) 16%, transparent);\n }\n .runway .visual::after {\n left: calc(var(--running-progress) - 0.08em);\n width: 0.16em;\n }\n .spark {\n animation-name: sparkWide;\n }\n}\n@container panel (max-width: 18rem) {\n .signalField {\n flex: 0 1 auto;\n min-height: 0;\n }\n .signalField .visual {\n width: 2.65em;\n height: 1.15em;\n }\n .signalField .rail {\n background: var(--edge);\n }\n .signalField .lead {\n top: 0.2em;\n bottom: 0.2em;\n width: 0.38em;\n border-radius: 50%;\n }\n .pulse {\n display: none;\n }\n}\n@container panel (max-height: 5rem) {\n .signalField {\n flex: 0 1 auto;\n min-height: 0;\n }\n .signalField .visual {\n width: 2.65em;\n height: 1.15em;\n }\n .signalField .rail {\n background: var(--edge);\n }\n .signalField .lead {\n top: 0.2em;\n bottom: 0.2em;\n width: 0.38em;\n border-radius: 50%;\n }\n .pulse {\n display: none;\n }\n}\n/* A size-contained signal field cannot use its own intrinsic height as a query input: its\n auto-sized content would always satisfy the compact branch. Width is the stable panel-scale\n discriminator; the field's parent already controls its available height. */\n@container panel (min-width: 26rem) {\n .signalField .visual {\n height: 100%;\n min-height: 0;\n border-radius: 0.25em;\n background: linear-gradient(\n 180deg,\n color-mix(in srgb, var(--edge) 60%, transparent),\n transparent\n );\n }\n .signalField .visual::before {\n content: \"\";\n position: absolute;\n inset: 0 auto 0 0;\n width: var(--running-progress);\n background:\n repeating-linear-gradient(\n 0deg,\n transparent 0 0.55em,\n color-mix(in srgb, var(--status-warning) 16%, transparent) 0.55em 0.6em\n ),\n linear-gradient(\n 90deg,\n color-mix(in srgb, var(--status-warning) 19%, transparent),\n color-mix(in srgb, var(--status-warning) 7%, transparent)\n );\n box-shadow: inset -0.8em 0 1em color-mix(in srgb, var(--status-warning) 22%, transparent);\n }\n .signalField .rail {\n top: 50%;\n bottom: auto;\n height: 1px;\n }\n .signalField .lead {\n top: calc(50% - 0.45em);\n bottom: auto;\n height: 0.9em;\n }\n .pulse {\n display: none;\n }\n .tracks {\n position: absolute;\n inset: 0.8em 0;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n }\n .track {\n position: relative;\n height: 1px;\n background: linear-gradient(\n 90deg,\n transparent,\n color-mix(in srgb, var(--edge) 85%, transparent),\n transparent\n );\n }\n .markerAnchor {\n width: 0.38em;\n height: 0.22em;\n }\n .markerBody {\n border-radius: 0.06em;\n background: var(--status-warning);\n box-shadow: 0 0 0.4em var(--status-warning);\n }\n .track:nth-child(2) .markerBody {\n animation-delay: -0.8s;\n opacity: 0.7;\n }\n .track:nth-child(3) .markerBody {\n animation-delay: -1.7s;\n opacity: 0.45;\n }\n .track:nth-child(4) .markerBody {\n animation-delay: -2.4s;\n opacity: 0.7;\n }\n .track:nth-child(5) .markerBody {\n animation-delay: -0.35s;\n opacity: 0.55;\n }\n}\n.overdue.signalField .rail {\n background: linear-gradient(90deg, var(--status-serious) 0 100%);\n opacity: 0.42;\n}\n.overdue.signalField .lead {\n background: var(--status-serious);\n box-shadow: 0 0 0.7em var(--status-serious);\n animation: endpoint-pulse 1.2s ease-in-out infinite alternate;\n}\n.overdue.signalField .markerBody {\n --phased-marker-travel: -10em;\n background: var(--status-serious);\n box-shadow: 0 0 0.55em var(--status-serious);\n animation-duration: 0.68s;\n animation-timing-function: ease-in-out;\n}\n.short .signalField .visual {\n height: 1em;\n}\n@keyframes sweep {\n to {\n transform: rotate(360deg);\n }\n}\n@keyframes alarm-ring {\n from {\n transform: scale(0.92);\n opacity: 0.45;\n }\n to {\n transform: scale(1.08);\n opacity: 1;\n }\n}\n@keyframes reactor-breathe {\n from {\n transform: scale(0.84);\n opacity: 0.7;\n }\n to {\n transform: scale(1.12);\n opacity: 1;\n }\n}\n@keyframes barrier-pulse {\n from {\n opacity: 0.55;\n }\n to {\n opacity: 1;\n }\n}\n@keyframes gravity-well {\n from {\n transform: scale(0.82);\n opacity: 0.45;\n }\n to {\n transform: scale(1.08);\n opacity: 0.95;\n }\n}\n@keyframes endpoint-pulse {\n from {\n transform: scaleY(0.75);\n opacity: 0.65;\n }\n to {\n transform: scaleY(1.15);\n opacity: 1;\n }\n}\n@keyframes spark {\n to {\n transform: translateX(13em);\n }\n}\n@keyframes sparkWide {\n to {\n transform: translateX(100cqw);\n }\n}\n@keyframes orbit {\n to {\n transform: rotate(360deg);\n }\n}\n@keyframes shift {\n to {\n background-position: 1em 0;\n }\n}\n@keyframes pulse {\n from {\n transform: translate(-0.5em, -50%);\n }\n to {\n transform: translate(calc(var(--running-progress) + 0.5em), -50%);\n }\n}\n@media (prefers-reduced-motion: reduce) {\n .radial .visual::after,\n .overdue.radial .visual::before,\n .overdue .radialCore,\n .spark,\n .runway .visual::after,\n .overdue.runway .visual::before,\n .overdue.runway .visual::after,\n .particle,\n .overdue.orbit .visual::after,\n .pulse,\n .lead,\n .overdue.signalField .lead,\n .overdue.signalField .markerBody,\n /* biome-ignore lint/style/noDescendingSpecificity: the shared reduced-motion list intentionally follows themed overrides. */\n .signalField .visual::before,\n .indeterminate .visual {\n animation: none;\n }\n}\n","import type { RunningAnimation } from '@ze-great-dashboard/shared'\nimport type { CSSProperties } from 'react'\nimport { PhasedProgressMarker } from './PhasedProgressMarker.tsx'\nimport styles from './RunningProgress.module.css'\nimport { compactTiming, type RunningTiming, timingDescription } from './running-timing.ts'\n\nexport function RunningProgress({\n animation,\n timing,\n}: {\n animation: LegacyRunningAnimation\n timing: RunningTiming\n}) {\n const { elapsedMs, estimatedDurationMs, hasEstimate, overdue, progress } = timing\n const usesReadout = animation === 'runway' || animation === 'signal-field'\n const timingText = timingDescription(elapsedMs, estimatedDurationMs, overdue)\n const style = {\n '--running-progress': `${progress * 100}%`,\n '--running-degrees': `${progress * 360}deg`,\n } as CSSProperties\n const animationStyle = animation === 'signal-field' ? styles.signalField : styles[animation]\n\n return (\n <div\n className={`${styles.progress} ${animationStyle} ${overdue ? styles.overdue : ''} ${hasEstimate ? '' : styles.indeterminate}`}\n style={style}\n data-running-progress={animation}\n data-overdue={overdue || undefined}\n data-indeterminate={!hasEstimate || undefined}\n >\n <div className={styles.visual} aria-hidden=\"true\" data-running-visual>\n {animation === 'radial' && <span className={styles.radialCore} />}\n {animation === 'runway' && (\n <>\n <span className={styles.spark} data-running-part=\"runway-spark\" />\n <span\n className={`${styles.spark} ${styles.sparkTwo}`}\n data-running-part=\"runway-spark-two\"\n />\n </>\n )}\n {animation === 'orbit' && (\n <>\n <span className={styles.orbitCore} />\n <span className={styles.particle} />\n <span className={`${styles.particle} ${styles.particleTwo}`} />\n </>\n )}\n {animation === 'signal-field' && (\n <>\n <span className={styles.rail} />\n <span className={styles.lead} />\n <span className={styles.pulse} />\n <span className={`${styles.pulse} ${styles.pulseTwo}`} />\n <span className={styles.tracks} data-running-part=\"signal-tracks\">\n {[0, 1, 2, 3, 4].map((track) => (\n <span className={styles.track} key={track} data-running-part=\"signal-track\">\n <PhasedProgressMarker\n anchorClassName={styles.markerAnchor}\n bodyClassName={styles.markerBody}\n delay={[undefined, '-0.8s', '-1.7s', '-2.4s', '-0.35s'][track]}\n anchorPart=\"signal-marker-anchor\"\n bodyPart=\"signal-marker\"\n />\n </span>\n ))}\n </span>\n </>\n )}\n </div>\n <p className={`${styles.timing} ${usesReadout ? styles.readout : ''}`}>\n {usesReadout ? (\n <>\n <span className=\"screen-reader-only\">{timingText}</span>\n <span aria-hidden=\"true\">{compactTiming(elapsedMs, estimatedDurationMs, overdue)}</span>\n </>\n ) : (\n timingText\n )}\n </p>\n </div>\n )\n}\n\n/** The compact, inline treatments retained for existing boards. */\nexport type LegacyRunningAnimation = Extract<\n RunningAnimation,\n 'radial' | 'runway' | 'orbit' | 'signal-field'\n>\n\nexport function isLegacyRunningAnimation(\n animation: RunningAnimation,\n): animation is LegacyRunningAnimation {\n return ['radial', 'runway', 'orbit', 'signal-field'].includes(animation)\n}\n","import { type Panel, parseDuration } from '@ze-great-dashboard/shared'\nimport { useEffect, useState } from 'react'\nimport { fallingSeed } from './falling-shapes.ts'\nimport { PanelFrame, PanelStatus } from './PanelFrame.tsx'\nimport styles from './PipelineAnimationDemoPanel.module.css'\nimport { isRunningFieldAnimation, RunningField } from './RunningField.tsx'\nimport { RunningFieldTiming } from './RunningFieldTiming.tsx'\nimport { RunningProgress } from './RunningProgress.tsx'\nimport { useRunningTiming } from './running-timing.ts'\n\nconst DEFAULT_RUN_DURATION_MS = 20_000\nconst ESTIMATED_DURATION_MS = 15_000\nconst DEFAULT_REVIEW_DURATION_MS = 300_000\nconst REVIEW_CYCLE_MULTIPLIER = 1.25\nconst variants = [\n 'radial',\n 'runway',\n 'orbit',\n 'signal-field',\n 'telemetry-bloom',\n 'release-transit',\n 'status-weather',\n 'falling-shapes',\n] as const\n\n/**\n * A local comparison aid for the active-run treatments. It deliberately creates no signal or\n * diagnostic evidence: its state is derived only from the wall clock and repeats forever.\n */\nexport function PipelineAnimationDemoPanel({ panel }: { panel: Panel }) {\n const now = useClock()\n // A configured visible treatment turns the local comparison aid into a stable review panel.\n // `off` retains the rotating default: the demo exists to render a treatment.\n const fixedAnimation =\n panel.running_animation === undefined || panel.running_animation === 'off'\n ? undefined\n : panel.running_animation\n const runDurationMs = durationMillis(panel.demo_run_duration, DEFAULT_RUN_DURATION_MS)\n const reviewDurationMs = durationMillis(panel.demo_review_duration, DEFAULT_REVIEW_DURATION_MS)\n const durationMs = fixedAnimation\n ? Math.ceil(reviewDurationMs * REVIEW_CYCLE_MULTIPLIER)\n : runDurationMs\n const runNumber = Math.floor(now / durationMs)\n const animation = fixedAnimation ?? variants[runNumber % variants.length] ?? 'radial'\n const runStartedAt = runNumber * durationMs\n\n return (\n <DemoRun\n panel={panel}\n animation={animation}\n runStartedAt={runStartedAt}\n estimatedDurationMs={fixedAnimation ? reviewDurationMs : ESTIMATED_DURATION_MS}\n />\n )\n}\n\nfunction durationMillis(value: Panel['demo_run_duration'], fallback: number): number {\n if (!value) return fallback\n return parseDuration(value) ?? fallback\n}\n\nfunction DemoRun({\n panel,\n animation,\n runStartedAt,\n estimatedDurationMs,\n}: {\n panel: Panel\n animation: (typeof variants)[number]\n runStartedAt: number\n estimatedDurationMs: number\n}) {\n const startedAt = new Date(runStartedAt).toISOString()\n const timing = useRunningTiming(startedAt, estimatedDurationMs)\n const usesField = isRunningFieldAnimation(animation)\n return (\n <PanelFrame\n panel={panel}\n field={\n usesField ? (\n <RunningField\n key={`${animation}-${runStartedAt}`}\n animation={animation}\n progress={timing.progress}\n estimatedDurationMs={timing.estimatedDurationMs}\n overdue={timing.overdue}\n indeterminate={!timing.hasEstimate}\n seed={fallingSeed(panel.id)}\n />\n ) : undefined\n }\n >\n <PanelStatus status=\"running\">↻ Running</PanelStatus>\n <p className={styles.variant}>Demo treatment · {animation}</p>\n {usesField ? (\n <RunningFieldTiming\n elapsedMs={timing.elapsedMs}\n estimatedDurationMs={estimatedDurationMs}\n overdue={timing.overdue}\n />\n ) : (\n <RunningProgress animation={animation} timing={timing} />\n )}\n </PanelFrame>\n )\n}\n\nfunction useClock() {\n const [now, setNow] = useState(() => Date.now())\n useEffect(() => {\n const interval = window.setInterval(() => setNow(Date.now()), 1_000)\n return () => window.clearInterval(interval)\n }, [])\n return now\n}\n",".details {\n display: contents;\n}\n@container panel (min-width: 48rem) {\n :global([data-display=\"primary\"][data-shallow=\"true\"]) .details > * {\n margin: 0;\n }\n}\n","import {\n type Envelope,\n type Panel,\n type PipelineStatus,\n pipelineStatusSchema,\n type RunningAnimation,\n visibleRunningAnimations,\n} from '@ze-great-dashboard/shared'\nimport { useRef, useState } from 'react'\nimport { fallingSeed } from './falling-shapes.ts'\nimport { ObservedAt } from './ObservedAt.tsx'\nimport { PanelBranch, PanelFrame, PanelHint, PanelStatus } from './PanelFrame.tsx'\nimport styles from './PipelinePanel.module.css'\nimport { isRunningFieldAnimation, RunningField } from './RunningField.tsx'\nimport { RunningFieldTiming } from './RunningFieldTiming.tsx'\nimport { isLegacyRunningAnimation, RunningProgress } from './RunningProgress.tsx'\nimport { useRunningTiming } from './running-timing.ts'\n\nexport function PipelinePanel({\n panel,\n envelope,\n}: {\n panel: Panel\n envelope: Envelope | undefined\n}) {\n if (!envelope)\n return (\n <PanelFrame panel={panel}>\n <PanelHint>Loading…</PanelHint>\n </PanelFrame>\n )\n if (envelope.state === 'error') {\n return (\n <PanelFrame panel={panel} envelope={envelope} error>\n <PanelStatus>\n ⚠ {envelope.error.kind === 'no-runs' ? 'No workflow runs' : 'Unable to read'}\n </PanelStatus>\n <PanelHint>{envelope.error.message}</PanelHint>\n <ObservedAt value={envelope.observedAt} />\n </PanelFrame>\n )\n }\n\n const signal = pipelineStatusSchema.safeParse(envelope.signal)\n if (!signal.success)\n return (\n <PanelFrame panel={panel} envelope={envelope} error>\n <PanelStatus>⚠ Invalid signal</PanelStatus>\n <ObservedAt value={envelope.observedAt} />\n </PanelFrame>\n )\n return <PipelineSignalPanel panel={panel} envelope={envelope} signal={signal.data} />\n}\n\nfunction PipelineSignalPanel({\n panel,\n envelope,\n signal,\n}: {\n panel: Panel\n envelope: Envelope\n signal: PipelineStatus\n}) {\n const presentation = statusPresentation(signal.status)\n const [defaultAnimation, setDefaultAnimation] = useState<RunningAnimation | undefined>(() =>\n signal.status === 'running' ? selectDefaultRunningAnimation() : undefined,\n )\n const previousStatusRef = useRef(signal.status)\n if (signal.status !== previousStatusRef.current) {\n const wasRunning = previousStatusRef.current === 'running'\n previousStatusRef.current = signal.status\n if (panel.running_animation === undefined && !wasRunning && signal.status === 'running') {\n setDefaultAnimation((previousAnimation) => selectDefaultRunningAnimation(previousAnimation))\n }\n }\n const animation = panel.running_animation ?? defaultAnimation ?? 'off'\n const activeRun = signal.status === 'running' && animation !== 'off'\n const timing = useRunningTiming(signal.runStartedAt, signal.estimatedDurationMs)\n const usesField = activeRun && isRunningFieldAnimation(animation)\n const usesLegacyProgress = activeRun && isLegacyRunningAnimation(animation)\n return (\n <PanelFrame\n panel={panel}\n envelope={envelope}\n field={\n usesField ? (\n <RunningField\n animation={animation}\n progress={timing.progress}\n estimatedDurationMs={timing.estimatedDurationMs}\n overdue={timing.overdue}\n indeterminate={!timing.hasEstimate}\n seed={fallingSeed(panel.id)}\n />\n ) : undefined\n }\n >\n <div className={styles.details}>\n <PanelStatus status={signal.status}>\n {presentation.glyph} {presentation.label}\n </PanelStatus>\n <PanelHint>\n {signal.name} · {signal.rawStatus}\n {signal.branch && (\n <PanelBranch title={`Branch: ${signal.branch}`}>\n <span aria-hidden=\"true\"> · ⎇ </span>\n <span className=\"screen-reader-only\">Branch: </span>\n {signal.branch}\n </PanelBranch>\n )}\n </PanelHint>\n {usesField && (\n <RunningFieldTiming\n elapsedMs={timing.elapsedMs}\n estimatedDurationMs={signal.estimatedDurationMs}\n overdue={timing.overdue}\n />\n )}\n {usesLegacyProgress && <RunningProgress animation={animation} timing={timing} />}\n {signal.status !== 'running' && signal.durationMs !== undefined && (\n <PanelHint>Took {formatDuration(signal.durationMs)}</PanelHint>\n )}\n {signal.sourceUpdatedAt && (\n <ObservedAt value={signal.sourceUpdatedAt} label=\"Run updated\" />\n )}\n <ObservedAt value={envelope.observedAt} />\n </div>\n </PanelFrame>\n )\n}\n\nfunction selectDefaultRunningAnimation(previousAnimation?: RunningAnimation) {\n const candidates = visibleRunningAnimations.filter((animation) => animation !== previousAnimation)\n return candidates[Math.floor(Math.random() * candidates.length)] ?? 'telemetry-bloom'\n}\n\nfunction formatDuration(durationMs: number) {\n const totalSeconds = Math.floor(durationMs / 1_000)\n const hours = Math.floor(totalSeconds / 3_600)\n const minutes = Math.floor((totalSeconds % 3_600) / 60)\n const seconds = totalSeconds % 60\n\n if (hours > 0) return `${hours}h ${minutes}m`\n if (minutes > 0) return `${minutes}m ${seconds}s`\n return `${seconds}s`\n}\n\nfunction statusPresentation(status: 'passed' | 'failed' | 'running' | 'cancelled' | 'unknown') {\n switch (status) {\n case 'passed':\n return { glyph: '✓', label: 'Passed' }\n case 'failed':\n return { glyph: '✕', label: 'Failed' }\n case 'running':\n return { glyph: '↻', label: 'Running' }\n case 'cancelled':\n return { glyph: '⊘', label: 'Cancelled' }\n case 'unknown':\n return { glyph: '?', label: 'Unknown' }\n }\n}\n","import { type Envelope, type Panel, pullRequestHealthSchema } from '@ze-great-dashboard/shared'\nimport { ObservedAt } from './ObservedAt.tsx'\nimport { PanelFrame, PanelHint, PanelStatus } from './PanelFrame.tsx'\n\nexport function PullRequestHealthPanel({\n panel,\n envelope,\n}: {\n panel: Panel\n envelope: Envelope | undefined\n}) {\n if (!envelope)\n return (\n <PanelFrame panel={panel}>\n <PanelHint>Loading…</PanelHint>\n </PanelFrame>\n )\n if (envelope.state === 'error')\n return (\n <PanelFrame panel={panel} envelope={envelope} error>\n <PanelStatus>⚠ Unable to read</PanelStatus>\n <PanelHint>{envelope.error.message}</PanelHint>\n <ObservedAt value={envelope.observedAt} />\n </PanelFrame>\n )\n const signal = pullRequestHealthSchema.safeParse(envelope.signal)\n if (!signal.success)\n return (\n <PanelFrame panel={panel} envelope={envelope} error>\n <PanelStatus>⚠ Invalid signal</PanelStatus>\n </PanelFrame>\n )\n const presentation = statusPresentation(signal.data.status)\n return (\n <PanelFrame panel={panel} envelope={envelope}>\n <PanelStatus status={signal.data.status}>\n {presentation.glyph} {presentation.label}\n </PanelStatus>\n <PanelHint>{signal.data.summary}</PanelHint>\n <ObservedAt value={envelope.observedAt} />\n </PanelFrame>\n )\n}\n\nfunction statusPresentation(status: 'passed' | 'failed' | 'running' | 'cancelled' | 'unknown') {\n switch (status) {\n case 'passed':\n return { glyph: '✓', label: 'Healthy' }\n case 'failed':\n return { glyph: '✕', label: 'Failed' }\n case 'running':\n return { glyph: '↻', label: 'Running' }\n case 'cancelled':\n return { glyph: '⊘', label: 'Cancelled' }\n case 'unknown':\n return { glyph: '?', label: 'Unknown' }\n }\n}\n","import type { Envelope, Panel } from '@ze-great-dashboard/shared'\nimport type { ComponentType } from 'react'\nimport { HttpValuePanel } from './HttpValuePanel.tsx'\nimport { PanelPlaceholder } from './PanelPlaceholder.tsx'\nimport { PipelineAnimationDemoPanel } from './PipelineAnimationDemoPanel.tsx'\nimport { PipelinePanel } from './PipelinePanel.tsx'\nimport { PullRequestHealthPanel } from './PullRequestHealthPanel.tsx'\n\ntype PanelRendererProps = {\n panel: Panel\n envelope: Envelope | undefined\n}\n\n/** The one client-side dispatch point for panel types. */\nexport const panelRenderers: Record<string, ComponentType<PanelRendererProps>> = {\n 'pipeline-status': PipelinePanel,\n 'pull-request-health': PullRequestHealthPanel,\n 'http-value': HttpValuePanel,\n 'pipeline-animation-demo': PipelineAnimationDemoPanel,\n}\n\nexport function PanelRenderer({ panel, envelope }: PanelRendererProps) {\n const Renderer = panelRenderers[panel.type]\n return Renderer ? (\n <Renderer panel={panel} envelope={envelope} />\n ) : (\n <PanelPlaceholder label={panel.type} hint=\"Not wired yet\" wide />\n )\n}\n","import { type ClientEnv, clientIdentitySchema } from '@ze-great-dashboard/shared'\nimport { useEffect } from 'react'\nimport type { DiagnosticSink } from './diagnostics.ts'\n\nconst clientUpdateIntervalMillis = 60_000\nconst clientUpdateTimeoutMillis = 10_000\nconst defaultReload = () => globalThis.window.location.reload()\n\nexport function useClientUpdate({\n env,\n diagnostics,\n fetcher,\n reload = defaultReload,\n}: {\n env: ClientEnv\n diagnostics: DiagnosticSink\n fetcher?: typeof fetch\n reload?: () => void\n}) {\n useEffect(() => {\n let cancelled = false\n let inFlight = false\n let activeController: AbortController | undefined\n const path = `${env.proxyPath}/client`\n\n const check = async () => {\n if (cancelled || inFlight) return\n inFlight = true\n const controller = new AbortController()\n activeController = controller\n const timeout = globalThis.setTimeout(() => controller.abort(), clientUpdateTimeoutMillis)\n diagnostics.record({ kind: 'client-update-check', path })\n try {\n const response = await (fetcher ?? globalThis.fetch)(path, {\n cache: 'no-store',\n signal: controller.signal,\n })\n if (!response.ok) throw new Error(`Client identity returned ${response.status}`)\n const parsed = clientIdentitySchema.safeParse(await response.json())\n if (!parsed.success) throw new Error('Client identity response was invalid')\n if (cancelled) return\n // assetPath is the server's immutable deployment selector. clientVersion is a label and\n // can change independently without changing the code the browser should load.\n if (parsed.data.assetPath !== env.assetPath) {\n diagnostics.record({\n kind: 'client-update-detected',\n path,\n current: { assetPath: env.assetPath, clientVersion: env.clientVersion },\n next: parsed.data,\n })\n reload()\n }\n } catch (error) {\n if (!cancelled && !(error instanceof DOMException && error.name === 'AbortError')) {\n diagnostics.record({\n kind: 'client-update-failure',\n path,\n message: error instanceof Error ? error.message : String(error),\n })\n }\n } finally {\n globalThis.clearTimeout(timeout)\n inFlight = false\n if (activeController === controller) activeController = undefined\n if (!cancelled) globalThis.setTimeout(() => void check(), clientUpdateIntervalMillis)\n }\n }\n\n void check()\n return () => {\n cancelled = true\n activeController?.abort()\n }\n }, [diagnostics, env.assetPath, env.clientVersion, env.proxyPath, fetcher, reload])\n}\n","import {\n type Envelope,\n type Panel,\n pipelineStatusSchema,\n pullRequestHealthSchema,\n} from '@ze-great-dashboard/shared'\nimport type { RenderedPanelDiagnostic } from './diagnostics.ts'\n\n/**\n * The compact public fact a viewer saw. Keep new panel projections here beside their\n * presentation boundary; this is intentionally not a source or server event contract.\n */\nexport function projectPanelDiagnostic(panel: Panel, envelope: Envelope): RenderedPanelDiagnostic {\n if (envelope.state === 'error') return { state: envelope.state, link: envelope.link }\n\n if (panel.type === 'pipeline-status') {\n const signal = pipelineStatusSchema.safeParse(envelope.signal)\n return {\n state: envelope.state,\n status: signal.success ? signal.data.status : undefined,\n link: envelope.link,\n }\n }\n\n if (panel.type === 'pull-request-health') {\n const signal = pullRequestHealthSchema.safeParse(envelope.signal)\n return {\n state: envelope.state,\n status: signal.success ? signal.data.status : undefined,\n link: envelope.link,\n }\n }\n\n return { state: envelope.state, link: envelope.link }\n}\n\nexport function panelDiagnosticChanged(\n previous: Envelope | undefined,\n panel: Panel,\n next: Envelope,\n) {\n if (!previous) return true\n const before = projectPanelDiagnostic(panel, previous)\n const after = projectPanelDiagnostic(panel, next)\n return (\n before.state !== after.state || before.status !== after.status || before.link !== after.link\n )\n}\n","import {\n type Envelope,\n type PipelineStatus,\n type PollingSettings,\n pipelineStatusSchema,\n} from '@ze-great-dashboard/shared'\n\n/** Return the next delay for a panel, keeping active runs responsive without polling forever at burst speed. */\nexport function nextPollDelayMillis(\n envelope: Envelope | undefined,\n nowMillis: number,\n settings: PollingSettings,\n): number {\n const pipeline = runningPipeline(envelope)\n if (!pipeline) return settings.refreshMillis\n\n const completionAt = estimatedCompletionAt(pipeline)\n if (completionAt === undefined) return settings.runningRefreshMillis\n\n if (nowMillis < completionAt) {\n return Math.min(settings.runningRefreshMillis, completionAt - nowMillis)\n }\n if (nowMillis < completionAt + settings.runningCompletionWindowMillis) {\n return settings.runningCompletionRefreshMillis\n }\n return settings.runningRefreshMillis\n}\n\nfunction runningPipeline(envelope: Envelope | undefined): PipelineStatus | undefined {\n if (envelope?.state !== 'ok') return undefined\n const result = pipelineStatusSchema.safeParse(envelope.signal)\n return result.success && result.data.status === 'running' ? result.data : undefined\n}\n\nfunction estimatedCompletionAt(signal: PipelineStatus): number | undefined {\n if (!signal.runStartedAt || signal.estimatedDurationMs === undefined) return undefined\n const startedAt = Date.parse(signal.runStartedAt)\n return Number.isFinite(startedAt) ? startedAt + signal.estimatedDurationMs : undefined\n}\n","import {\n type Board,\n type ClientEnv,\n type Envelope,\n envelopeSchema,\n isZeroPosition,\n resolvePollingSettings,\n} from '@ze-great-dashboard/shared'\nimport { useEffect, useRef, useState } from 'react'\nimport { cacheMetadata, type DiagnosticSink } from './diagnostics.ts'\nimport { panelDiagnosticChanged, projectPanelDiagnostic } from './panel-diagnostics.ts'\nimport { nextPollDelayMillis } from './polling-schedule.ts'\n\nexport function usePanelSignals({\n board,\n env,\n diagnostics,\n}: {\n board: Board | undefined\n env: ClientEnv\n diagnostics: DiagnosticSink\n}) {\n const [signals, setSignals] = useState<Record<string, Envelope | undefined>>({})\n const signalsRef = useRef<Record<string, Envelope | undefined>>({})\n\n useEffect(() => {\n signalsRef.current = {}\n setSignals({})\n if (!board) return\n\n let cancelled = false\n const timers = new Set<number>()\n for (const panel of board.panels) {\n if (isZeroPosition(panel.position)) continue\n if (\n panel.type !== 'pipeline-status' &&\n panel.type !== 'pull-request-health' &&\n panel.type !== 'http-value'\n )\n continue\n let inFlight = false\n const settings = resolvePollingSettings(board, panel)\n const path = `${env.proxyPath}/panel/${encodeURIComponent(env.board)}/${encodeURIComponent(panel.id)}`\n let lastEnvelope: Envelope | undefined\n const refresh = () => {\n if (cancelled || inFlight) return\n inFlight = true\n diagnostics.record({ kind: 'panel-fetch-start', panelId: panel.id, path })\n fetch(path)\n .then(async (response) => {\n const transport = {\n kind: 'panel-fetch-response' as const,\n panelId: panel.id,\n path,\n status: response.status,\n cache: cacheMetadata(response.headers),\n }\n if (response.status === 304) {\n diagnostics.record(transport)\n return undefined\n }\n try {\n const value: unknown = await response.json()\n const envelope = parseEnvelope(value)\n if (!envelope) {\n diagnostics.record(transport)\n diagnostics.record({\n kind: 'panel-fetch-parse-failure',\n panelId: panel.id,\n path,\n message: 'Response was not a valid signal envelope.',\n })\n return undefined\n }\n diagnostics.record({ ...transport, envelope })\n return envelope\n } catch (error) {\n diagnostics.record(transport)\n diagnostics.record({\n kind: 'panel-fetch-parse-failure',\n panelId: panel.id,\n path,\n message: errorMessage(error),\n })\n throw new DiagnosticParseFailure(error)\n }\n })\n .then((envelope) => {\n if (envelope) lastEnvelope = envelope\n if (!cancelled && envelope) {\n const previous = signalsRef.current[panel.id]\n if (panelDiagnosticChanged(previous, panel, envelope)) {\n diagnostics.record({\n kind: 'panel-rendered',\n panelId: panel.id,\n path,\n rendered: projectPanelDiagnostic(panel, envelope),\n })\n }\n signalsRef.current = { ...signalsRef.current, [panel.id]: envelope }\n setSignals(signalsRef.current)\n }\n })\n .catch((error) => {\n if (!(error instanceof DiagnosticParseFailure)) {\n diagnostics.record({\n kind: 'panel-fetch-failure',\n panelId: panel.id,\n path,\n message: errorMessage(error),\n })\n }\n })\n .finally(() => {\n inFlight = false\n if (!cancelled) {\n const nextTimer = window.setTimeout(\n () => {\n timers.delete(nextTimer)\n refresh()\n },\n nextPollDelayMillis(lastEnvelope, Date.now(), settings),\n )\n timers.add(nextTimer)\n }\n })\n }\n refresh()\n }\n return () => {\n cancelled = true\n for (const timer of timers) window.clearTimeout(timer)\n }\n }, [board, diagnostics, env.board, env.proxyPath])\n\n return signals\n}\n\nfunction errorMessage(error: unknown) {\n return error instanceof Error ? error.message : String(error)\n}\n\nclass DiagnosticParseFailure extends Error {\n constructor(error: unknown) {\n super(errorMessage(error))\n }\n}\n\nfunction parseEnvelope(value: unknown): Envelope | undefined {\n const result = envelopeSchema.safeParse(value)\n return result.success ? result.data : undefined\n}\n","import {\n analyzeBoardLayout,\n type Board,\n type ClientEnv,\n isZeroPosition,\n} from '@ze-great-dashboard/shared'\nimport { useEffect, useMemo, useRef, useState } from 'react'\nimport styles from './App.module.css'\nimport { Diagnostics } from './Diagnostics.tsx'\nimport { BrowserDiagnosticStore, cacheMetadata } from './diagnostics.ts'\nimport { PanelPlaceholder } from './PanelPlaceholder.tsx'\nimport { PanelRenderer } from './panel-registry.tsx'\nimport { useClientUpdate } from './useClientUpdate.ts'\nimport { usePanelSignals } from './usePanelSignals.ts'\n\n/**\n * The board shell.\n *\n * Stage 1 has no data: there is no proxy endpoint to poll yet. What this proves is the plumbing —\n * that the client was handed its configuration by the server and knows which version of itself it\n * is. The version readout is what makes two published versions visibly different, which is the\n * whole point of the Stage 1 exit criterion.\n */\nexport function App({ env }: { env: ClientEnv }) {\n const [board, setBoard] = useState<Board>()\n const [loadedBoardName, setLoadedBoardName] = useState<string>()\n const diagnosticsRef = useRef<BrowserDiagnosticStore | null>(null)\n if (!diagnosticsRef.current) diagnosticsRef.current = new BrowserDiagnosticStore(env)\n const diagnostics = diagnosticsRef.current\n useClientUpdate({ env, diagnostics })\n const signals = usePanelSignals({\n board: loadedBoardName === env.board ? board : undefined,\n env,\n diagnostics,\n })\n const layout = useMemo(() => (board ? analyzeBoardLayout(board.panels) : undefined), [board])\n\n useEffect(() => {\n if (!layout || layout.issues.length === 0) return\n diagnostics.record({\n kind: 'layout-analyzed',\n issueCount: layout.issues.length,\n affectedPanelIds: layout.issues.map((issue) => issue.panelId),\n })\n }, [diagnostics, layout])\n\n useEffect(() => {\n let cancelled = false\n setBoard(undefined)\n setLoadedBoardName(undefined)\n const path = `${env.proxyPath}/boards/${encodeURIComponent(env.board)}`\n diagnostics.record({ kind: 'board-fetch-start', path })\n fetch(path)\n .then(async (response) => {\n diagnostics.record({\n kind: 'board-fetch-response',\n path,\n status: response.status,\n cache: cacheMetadata(response.headers),\n })\n if (!response.ok) throw new Error(`Board configuration returned ${response.status}`)\n try {\n return await response.json()\n } catch (error) {\n diagnostics.record({\n kind: 'board-fetch-parse-failure',\n path,\n message: errorMessage(error),\n })\n throw new DiagnosticParseFailure(error)\n }\n })\n .then((value: unknown) => {\n if (!cancelled) {\n setBoard(value as Board)\n setLoadedBoardName(env.board)\n const panels = Array.isArray((value as { panels?: unknown }).panels)\n ? (value as { panels: Array<{ id?: unknown }> }).panels\n : []\n diagnostics.record({\n kind: 'board-fetch-response',\n path,\n boardSummary: {\n panelCount: panels.length,\n panelIds: panels.flatMap((panel) => (typeof panel.id === 'string' ? [panel.id] : [])),\n },\n })\n }\n })\n .catch((error) => {\n if (!(error instanceof DiagnosticParseFailure)) {\n diagnostics.record({ kind: 'board-fetch-failure', path, message: errorMessage(error) })\n }\n if (!cancelled) {\n setBoard({ panels: [] })\n setLoadedBoardName(env.board)\n }\n })\n return () => {\n cancelled = true\n }\n }, [diagnostics, env.board, env.proxyPath])\n\n return (\n <div className={styles.board}>\n <header className={styles.header}>\n <h1 className={styles.title}>{env.board}</h1>\n </header>\n <main className={styles.grid}>\n {!board && <PanelPlaceholder label=\"board\" hint=\"Loading configuration…\" wide />}\n {board?.panels\n .filter((panel) => !isZeroPosition(panel.position))\n .map((panel) => (\n <PanelRenderer key={panel.id} panel={panel} envelope={signals[panel.id]} />\n ))}\n </main>\n\n <footer className={styles.footer} data-board-footer>\n <span>Signals are read live from their configured authorities.</span>\n <div className={styles.footerTools}>\n {layout && layout.issues.length > 0 && (\n <LayoutWarning board={env.board} layout={layout} proxyPath={env.proxyPath} />\n )}\n <Diagnostics log={diagnostics} />\n </div>\n </footer>\n </div>\n )\n}\n\nfunction LayoutWarning({\n board,\n layout,\n proxyPath,\n}: {\n board: string\n layout: ReturnType<typeof analyzeBoardLayout>\n proxyPath: string\n}) {\n const [open, setOpen] = useState(false)\n const dialogId = `layout-warning-${board}`\n\n useEffect(() => {\n if (!open) return\n const closeOnEscape = (event: KeyboardEvent) => {\n if (event.key === 'Escape') setOpen(false)\n }\n window.addEventListener('keydown', closeOnEscape)\n return () => window.removeEventListener('keydown', closeOnEscape)\n }, [open])\n\n const boardPath = `${proxyPath}/boards/${encodeURIComponent(board)}`\n return (\n <div className={styles.layoutWarning} data-layout-warning>\n <button\n className={styles.layoutWarningButton}\n type=\"button\"\n aria-label={`Layout warnings (${layout.issues.length})`}\n aria-expanded={open}\n aria-controls={dialogId}\n onClick={() => setOpen(!open)}\n >\n <span aria-hidden=\"true\">⚠</span>\n <span>{layout.issues.length}</span>\n </button>\n {open && (\n <aside\n className={styles.layoutWarningDialog}\n id={dialogId}\n role=\"dialog\"\n aria-labelledby={`${dialogId}-title`}\n aria-modal=\"false\"\n >\n <div className={styles.layoutWarningHeading}>\n <strong id={`${dialogId}-title`}>Layout warnings</strong>\n <button\n className={styles.layoutWarningClose}\n type=\"button\"\n aria-label=\"Close layout warnings\"\n onClick={() => setOpen(false)}\n >\n ×\n </button>\n </div>\n <p>\n {layout.issues.length} layout issue{layout.issues.length === 1 ? '' : 's'} detected\n against the intended 12×12 space. The live board is unchanged: explicit overlaps remain\n overlapped and overflow continues in implicit rows.\n </p>\n <ul>\n {layout.issues.map((issue) => (\n <li key={`${issue.panelId}-${issue.kind}`}>\n <strong>{issue.panelId}</strong>: {issue.kind} at ({issue.position.x},{' '}\n {issue.position.y}), {issue.position.w}×{issue.position.h}\n {issue.conflictsWith.length ? `; overlaps ${issue.conflictsWith.join(', ')}` : ''}\n </li>\n ))}\n </ul>\n <div className={styles.layoutWarningDownloads}>\n <a href={`${boardPath}/rendered`} download={`${board}-layout-rendered.yaml`}>\n Download legal rendered layout\n </a>\n <a href={`${boardPath}/authored`} download={`${board}-layout-authored.yaml`}>\n Download authored layout\n </a>\n </div>\n <p className={styles.layoutWarningNote}>\n The legal rendered layout normalizes the currently visible explicit area into 12×12 and\n makes the smallest deterministic adjustments needed to avoid collisions. The authored\n layout preserves the original coordinates exactly.\n </p>\n </aside>\n )}\n </div>\n )\n}\n\nfunction errorMessage(error: unknown) {\n return error instanceof Error ? error.message : String(error)\n}\n\nclass DiagnosticParseFailure extends Error {\n constructor(error: unknown) {\n super(errorMessage(error))\n }\n}\n",".error {\n margin: 0 auto;\n max-width: 60ch;\n padding: 2rem;\n color: var(--ink-primary);\n}\n.error pre {\n padding: 1rem;\n border-radius: var(--radius);\n border: 1px solid var(--status-critical);\n background: var(--surface-raised);\n color: var(--ink-secondary);\n font-size: 0.75em;\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n}\n","import styles from './ConfigError.module.css'\n\nexport function ConfigError({ message }: { message: string }) {\n return (\n <div className={styles.error} role=\"alert\">\n <h1>⚠️ Dashboard misconfigured</h1>\n <p>The page loaded, but the server did not hand it usable configuration.</p>\n <pre>{message}</pre>\n </div>\n )\n}\n","import { readClientEnv } from '@ze-great-dashboard/shared'\nimport { StrictMode } from 'react'\nimport { createRoot } from 'react-dom/client'\nimport { App } from './App.tsx'\nimport { ConfigError } from './ConfigError.tsx'\nimport './styles.css'\n\nconst container = document.getElementById('root')\nif (!container) {\n throw new Error('No #root element in the document — the template is not the one we expect.')\n}\n\nconst root = createRoot(container)\n\ntry {\n root.render(\n <StrictMode>\n <App env={readClientEnv()} />\n </StrictMode>,\n )\n} catch (error) {\n // A radiator that fails silently is worse than one that says what's wrong. If configuration\n // never arrived, say so on screen rather than rendering an empty board.\n root.render(<ConfigError message={error instanceof Error ? error.message : String(error)} />)\n}\n"],"mappings":"u5BAKA,IAAI,EAAmB,oBACnB,EAAc,CAChB,GAAI,EACJ,EAAG,IACH,EAAG,IACH,EAAG,IACL,EACA,SAAS,EAAc,EAAO,CAC5B,IAAM,EAAQ,EAAiB,KAAK,CAAK,EACzC,GAAI,CAAC,EAAO,OAAO,KACnB,GAAM,EAAG,EAAW,GAAW,EAC/B,GAAI,IAAc,IAAK,IAAK,IAAY,IAAK,GAAG,OAAO,KACvD,IAAM,EAAS,OAAO,CAAS,EAE/B,OADI,GAAU,EAAU,KACjB,EAAS,EAAY,EAC9B,CACA,IAAI,EAAiB,EAAE,OAAO,CAAC,CAAC,OAAQ,GAAU,EAAc,CAAK,IAAM,KAAM,CAC/E,QAAS,uDACX,CAAC,CAAC,CAAC,MAAM,EAGL,EAAiB,EAAG,MAAM,CAC5B,EAAG,OAAO,CACR,EAAG,EAAG,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAC1B,EAAG,EAAG,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAC1B,EAAG,EAAG,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,EAClC,EAAG,EAAG,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAC5B,CAAC,EACD,EAAG,OAAO,CAAE,EAAG,EAAG,QAAQ,CAAC,EAAG,EAAG,EAAG,QAAQ,CAAC,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