@continuous-excellence/ze-great-dashboard-client 0.21.0 → 0.22.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -4
- package/client/.vite/manifest.json +1 -1
- package/client/assets/index-TT8Nan_w.js +3 -0
- package/client/assets/index-TT8Nan_w.js.map +1 -0
- package/client/index.html +1 -1
- package/package.json +1 -1
- package/client/assets/index-CB4qd5YD.js +0 -3
- package/client/assets/index-CB4qd5YD.js.map +0 -1
package/README.md
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
`@continuous-excellence/ze-great-dashboard-client` is the immutable browser artifact for Ze Great
|
|
4
4
|
Dashboard. It is not an importable JavaScript API.
|
|
5
5
|
|
|
6
|
-
Use an exact version and serve the files in its `client/` directory from any static host.
|
|
7
|
-
example,
|
|
6
|
+
Use an exact version and serve the files in its `client/` directory from any static host. jsDelivr
|
|
7
|
+
is a known alternative CDN for this package; for example, it exposes version `0.21.0` at:
|
|
8
8
|
|
|
9
9
|
```text
|
|
10
|
-
https://cdn.jsdelivr.net/npm/@continuous-excellence/ze-great-dashboard-client@
|
|
10
|
+
https://cdn.jsdelivr.net/npm/@continuous-excellence/ze-great-dashboard-client@0.21.0/client
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
That directory contains `index.html`, hashed assets, source maps, Vite's manifest, and
|
|
@@ -15,5 +15,11 @@ That directory contains `index.html`, hashed assets, source maps, Vite's manifes
|
|
|
15
15
|
server's `ASSET_PATH` (or the AWS package's `--asset-path`) at the directory; the server fetches
|
|
16
16
|
and configures `index.html` at runtime.
|
|
17
17
|
|
|
18
|
+
The server must be able to reach `index.html` and `board-config.schema.json`. Browsers load the
|
|
19
|
+
hashed assets directly, so a non-jsDelivr host must serve them over HTTPS with CORS that permits the
|
|
20
|
+
dashboard origin; `Access-Control-Allow-Origin: *` is suitable because the files are public and
|
|
21
|
+
environment-free. Do not replace files at a published version path.
|
|
22
|
+
|
|
18
23
|
The normal AWS deployment uses its versioned S3/CloudFront asset path. This package is the
|
|
19
|
-
portable alternative for npm CDNs, internal CDNs, and other static hosts.
|
|
24
|
+
portable alternative for jsDelivr, other npm CDNs, internal CDNs, and other static hosts. Select a
|
|
25
|
+
reviewed exact version, never a moving tag.
|
|
@@ -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)})]),g=e.enum([`auto`,`comfortable`,`compact`]),_=[`radial`,`runway`,`orbit`,`signal-field`,`telemetry-bloom`,`release-transit`,`status-weather`,`falling-shapes`],v=e.enum([..._,`off`]),y=e.looseObject({label:e.string().min(1).optional(),id:e.string().min(1),type:e.string().min(1),source:e.string().min(1).optional(),pipeline:e.union([e.string(),e.number()]).optional(),branch:e.string().min(1).optional(),density:g.optional(),position:h.optional(),refresh:m.optional(),running_refresh:m.optional(),running_completion_refresh:m.optional(),running_completion_window:m.optional(),running_animation:v.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()}).superRefine((e,t)=>{`display`in e&&t.addIssue({code:`custom`,path:[`display`],message:`display was removed; use density`})}),b=e.object({app_id_env:e.string().min(1),private_key_env:e.string().min(1),installation_id_env:e.string().min(1)}),x={token_env:e.string().min(1).optional(),github_app:b.optional()};function S(e,t){e.token_env&&e.github_app&&t.addIssue({code:`custom`,message:`configure token_env or github_app, not both`})}e.looseObject({type:e.literal(`github-actions`),repo:e.string().regex(/^[^/\s]+\/[^/\s]+$/,`must be an owner/repository pair`),branch:e.string().min(1).optional(),...x}).superRefine(S);var C=e.looseObject({type:e.literal(`azure-devops`),organization:e.string().regex(/^[^/\s]+$/,`must be an organization name`),project:e.string().min(1),branch:e.string().min(1).optional(),token_env:e.string().min(1)}),ee=e.looseObject({type:e.string().min(1),...x}).superRefine(S),w=e.object({refresh:m.optional(),running_refresh:m.optional(),running_completion_refresh:m.optional(),running_completion_window:m.optional(),panels:e.array(y).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})`})})})}),T=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),ee).default({}),boards:e.record(e.string().min(1),w),auth:T.optional()}).superRefine((e,t)=>{for(let[n,r]of Object.entries(e.sources)){if(r.type!==`azure-devops`)continue;let e=C.safeParse(r);if(!e.success)for(let r of e.error.issues)t.addIssue({code:`custom`,path:[`sources`,n,...r.path],message:r.message})}for(let[n,r]of Object.entries(e.boards))r.panels.forEach((r,i)=>{let a=r.source?e.sources[r.source]:void 0;r.type===`pipeline-status`&&a?.type===`azure-devops`&&(typeof r.pipeline!=`number`||!Number.isInteger(r.pipeline)||r.pipeline<=0)&&t.addIssue({code:`custom`,path:[`boards`,n,`panels`,i,`pipeline`],message:`Azure DevOps pipeline-status panels require a positive numeric pipeline definition id`})})});var E=e.object({assetPath:e.string().min(1),proxyPath:e.string().min(1),board:e.string().min(1),auth:e.object({issuer:e.string().min(1),clientId:e.string().min(1).optional()}).optional()}),te=E.pick({assetPath:!0});function ne(t=globalThis.window?.env){let n=E.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 re=e.enum([`unreachable`,`unauthorized`,`not-found`,`no-runs`,`upstream-error`]),ie=e.object({kind:re,message:e.string()}),ae=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:ie})]),oe=e.object({kind:e.enum([`job`,`stage`,`step`]),name:e.string().min(1),parent:e.string().min(1).optional()}),D=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(),sourceRunId:e.string().min(1).optional(),activity:oe.optional(),estimatedDurationMs:e.number().int().positive().optional(),sourceUpdatedAt:e.iso.datetime().optional()}),O=e.object({label:e.string().min(1),status:D.shape.status,detail:e.string().min(1),link:e.url().nullable()}),se=e.object({type:e.literal(`pull-request-health`),status:D.shape.status,summary:e.string().min(1),workflows:e.array(O),pullRequests:e.array(O),incompleteObservations:e.array(e.object({label:e.string().min(1),message:e.string().min(1)})).optional(),newestObservedAt:e.iso.datetime().optional()}),ce=e.object({number:e.number().int().positive(),branch:e.string().min(1),link:e.url()}),le=e.object({type:e.literal(`pull-request-candidates`),pullRequests:e.array(ce),truncated:e.boolean().optional()}),ue=e.object({type:e.literal(`pull-request-workflow`),workflow:e.string().min(1),item:O}),de=e.object({type:e.literal(`pull-request-build`),branch:e.string().min(1),item:O}),fe=e.object({type:e.literal(`http-value`),value:e.union([e.string(),e.number(),e.boolean()])}),pe=12,me=12;function he(e){let t=e.flatMap(e=>!e.position||k(e.position)||ge(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||k(i.position)))for(let a=r+1;a<e.length;a++){let r=e[a];if(!r?.position||k(r.position)||!_e(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 k(e){return e?.x===0&&e.y===0&&e.w===0&&e.h===0}function ge(e){return!k(e)&&e.x+e.w<=pe&&e.y+e.h<=me}function _e(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 A={refreshMillis:6e4,runningRefreshMillis:15e3,runningCompletionRefreshMillis:5e3,runningCompletionWindowMillis:12e4};function ve(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`,A.refreshMillis),runningRefreshMillis:r(`running_refresh`,`running_refresh`,A.runningRefreshMillis),runningCompletionRefreshMillis:r(`running_completion_refresh`,`running_completion_refresh`,A.runningCompletionRefreshMillis),runningCompletionWindowMillis:r(`running_completion_window`,`running_completion_window`,A.runningCompletionWindowMillis)}}var j={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`},M={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 ye({log:e}){let[t,n]=a(!1);o(e.subscribe,e.snapshot,e.snapshot);let r=e.count(),i=e.githubConsistencyIncidentCount(),s=e.summary();return u(`section`,{className:M.diagnostics,children:[u(`button`,{className:M.button,type:`button`,"aria-expanded":t,onClick:()=>n(!t),children:[`Diagnostics (`,r,`)`,i>0&&` · GitHub consistency ${i}`]}),t&&u(`div`,{className:M.area,children:[u(`p`,{children:[`Client `,e.clientVersion(),` · assets `,e.assetPath()]}),u(`p`,{children:[s.retained.eventCount,` retained browser-local events across`,` `,s.retained.sessionCount,` session`,s.retained.sessionCount===1?``:`s`,s.retained.firstEventAt&&s.retained.lastEventAt?` (${be(s.retained.firstEventAt,s.retained.lastEventAt)})`:``,`. They are never uploaded.`]}),s.retained.evidenceMayBeIncomplete&&u(`p`,{className:M.warning,role:`alert`,children:[`Earlier evidence was pruned: `,s.retained.retention.eventsPrunedByCount,` at the 2,000-event cap and `,s.retained.retention.eventsPrunedByAge,` by the 7-day age limit. “No failures” applies only to the retained window.`]}),u(`p`,{children:[`Update failures: `,s.failures.clientUpdate,`; board fetch failures:`,` `,s.failures.boardFetch,`.`]}),e.githubConsistencyIncidentCount()>0&&u(`p`,{className:M.warning,role:`alert`,children:[`GitHub API consistency incidents: `,e.githubConsistencyIncidentCount(),`. A response older than the last accepted run was rejected; download diagnostics to report it.`]}),s.panels.length>0&&l(`div`,{className:M.panels,children:s.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.latestFailedObservation&&u(c,{children:[` `,`Failure: `,e.latestFailedObservation.reason,`. Support reference:`,` `,l(`code`,{children:e.latestFailedObservation.supportReference??`not provided`}),`.`]})]},e.panelId))}),u(`div`,{className:M.actions,children:[l(`button`,{className:M.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:M.button,type:`button`,onClick:()=>{window.confirm(`Clear this browser’s retained dashboard diagnostics?`)&&e.clear()},children:`Clear`})]})]})]})}function be(e,t){return e===t?e:`${e} to ${t}`}function xe(){try{return window.localStorage}catch{return}}function Se(e,t){try{let n=e?.getItem(t);return n?JSON.parse(n):void 0}catch{return}}function Ce(e,t,n){try{e?.setItem(t,JSON.stringify(n))}catch{}}function we(e,t){try{e?.removeItem(t)}catch{}}function Te(e,t,n=0){let r=new Map,i=new Set,a=0,o=0;for(let t of e){if(i.add(t.sessionId),t.kind===`client-update-failure`&&a++,(t.kind===`board-fetch-failure`||t.kind===`board-fetch-parse-failure`)&&o++,!(`panelId`in t))continue;let e=r.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`){if(t.status!==void 0){let n=String(t.status);e.httpStatuses[n]=(e.httpStatuses[n]??0)+1}t.failure&&(e.latestFailedObservation=t.failure)}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),r.set(t.panelId,e)}let s=e.map(e=>e.at).sort(),c=t.eventsPrunedByAge+t.eventsPrunedByCount;return{githubConsistencyIncidents:n,retained:{eventCount:e.length,firstEventAt:s[0],lastEventAt:s.at(-1),sessionCount:i.size,retention:t,evidenceMayBeIncomplete:c>0},failures:{clientUpdate:a,boardFetch:o},panels:[...r.values()].sort((e,t)=>e.panelId.localeCompare(t.panelId))}}var Ee=`0.22.1`,N=`ze-great-dashboard.diagnostics.v2`,De=`ze-great-dashboard.diagnostics.v1`,Oe=2e3,ke=6048e5,Ae=[`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`],je=class{env;storage;now;events=[];retention=Pe();revision=0;incidents=[];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,we(this.storage,De),this.events=this.read(),this.record({kind:`session-start`})}recordGithubConsistencyIncident(e){this.incidents.push({...e,at:this.now().toISOString(),board:this.env.board}),this.persist(),this.revision++,this.notify()}githubConsistencyIncidentCount=()=>this.incidents.length;record(e){let t=Ie([...this.events,{...e,schemaVersion:2,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=()=>Ee;assetPath=()=>this.env.assetPath;snapshot=()=>this.revision;summary=()=>Te(this.events,this.retention,this.incidents.length);clear(){this.events=[],this.incidents=[],this.retention=Pe(),we(this.storage,N),this.revision++,this.notify()}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});export=()=>({schemaVersion:2,exportedAt:this.now().toISOString(),client:{version:Ee,assetPath:this.env.assetPath,board:this.env.board,sessionId:this.sessionId},events:this.events,githubConsistencyIncidents:this.incidents,summary:this.summary()});read(){let e=Se(this.storage,N);if(!e||e.schemaVersion!==2||!Array.isArray(e.events)||!e.events.every(Le))return we(this.storage,N),[];let t=Ie(e.events.map(e=>({...e,schemaVersion:2})),this.now(),Fe(e.retention));return this.retention=t.retention,this.incidents=Me(e.githubConsistencyIncidents),t.events}persist(){Ce(this.storage,N,{schemaVersion:2,events:this.events,retention:this.retention,githubConsistencyIncidents:this.incidents})}notify(){for(let e of this.listeners)e()}};function Me(e){return Array.isArray(e)?e.filter(e=>{if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.at==`string`&&typeof t.board==`string`&&typeof t.panelId==`string`&&typeof t.endpoint==`string`&&!!t.accepted&&!!t.regressed&&!!t.response}):[]}function Ne(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 Pe(){return{eventsPrunedByAge:0,eventsPrunedByCount:0}}function Fe(e){if(!e||typeof e!=`object`)return Pe();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 Ie(e,t,n){let r=t.valueOf()-ke,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-Oe);return{events:i.slice(-2e3),retention:{eventsPrunedByAge:n.eventsPrunedByAge+a,eventsPrunedByCount:n.eventsPrunedByCount+o}}}function Le(e){if(!e||typeof e!=`object`)return!1;let t=e;return(t.schemaVersion===void 0||t.schemaVersion===2)&&typeof t.at==`string`&&Number.isFinite(new Date(t.at).valueOf())&&typeof t.sessionId==`string`&&typeof t.board==`string`&&Ae.includes(t.kind)}var P={panel:`_panel_ditgn_1`,content:`_content_ditgn_22`,sourceAction:`_sourceAction_ditgn_35`,details:`_details_ditgn_39`,threeAnchor:`_threeAnchor_ditgn_47`,error:`_error_ditgn_51`,wide:`_wide_ditgn_54`,"density-comfortable":`_density-comfortable_ditgn_57`,"density-compact":`_density-compact_ditgn_64`,label:`_label_ditgn_74`,hint:`_hint_ditgn_85`,branch:`_branch_ditgn_91`,observed:`_observed_ditgn_95`,meta:`_meta_ditgn_101`,metaValue:`_metaValue_ditgn_104`,warning:`_warning_ditgn_108`,serious:`_serious_ditgn_111`,status:`_status_ditgn_114`,passed:`_passed_ditgn_122`,failed:`_failed_ditgn_125`,running:`_running_ditgn_128`,cancelled:`_cancelled_ditgn_131`,unknown:`_unknown_ditgn_132`,shallow:`_shallow_ditgn_165`,"density-auto":`_density-auto_ditgn_166`};function Re({label:e,hint:t,wide:n=!1}){return u(`section`,{className:`${P.panel} ${n?P.wide:``}`,"data-panel":!0,"data-panel-id":`placeholder`,children:[l(`h2`,{className:P.label,children:e}),l(`p`,{className:P.hint,children:t})]})}function ze(e){switch(e){case`unauthorized`:return{label:`Access denied`,emphasis:`serious`};case`not-found`:return{label:`Source not found`,emphasis:`serious`};case`unreachable`:case`upstream-error`:return{label:`Source unavailable`,emphasis:`serious`};case`no-runs`:return{label:`No workflow runs`,emphasis:`warning`}}}var Be={fact:`_fact_envkl_1`};function Ve(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 F({children:e,className:t,title:n}){return l(`p`,{className:`${P.hint} ${t??``}`,title:n,children:e})}function I({glyph:e,label:t,value:n,title:r,observed:i=!1,emphasis:a,className:o}){return u(`p`,{className:`${P.hint} ${i?P.observed:``} ${a?P[a]:``} ${P.meta} ${o??``}`,"data-panel-meta":!0,children:[l(`span`,{"aria-hidden":`true`,children:e}),` `,u(`span`,{className:`screen-reader-only`,children:[t,`: `]}),l(`span`,{className:P.metaValue,title:r,children:n})]})}function L({children:e,status:t,emphasis:n}){return l(`p`,{className:`${P.status} ${t?P[t]:``} ${n?P[n]:``}`,children:e})}function R({panel:e,envelope:t,error:n=!1,field:r,layout:i,children:a}){let o=e.density??`auto`,s=e.position,c=s!==void 0&&s.h<=2,d=s!==void 0&&s.h<=3;return u(`section`,{className:`${P.panel} ${P[`density-${o}`]} ${c?P.shallow:``} ${d?P.short:``} ${n?P.error:``}`,style:Ve(e),"aria-busy":!t||void 0,"data-panel":!0,"data-panel-id":e.id,"data-panel-position":s?`${s.x},${s.y},${s.w},${s.h}`:void 0,"data-density":o,"data-shallow":c,"data-short":d,"data-error":n||void 0,children:[r,l(He,{panelId:e.id,link:t?.link}),u(`div`,{className:`${P.content} ${i===`three-anchor`?P.threeAnchor:``}`,"data-panel-content":!0,"data-panel-layout":i,children:[l(`h2`,{className:P.label,children:e.label??e.id}),a]})]})}function He({panelId:e,link:t}){return t?u(`a`,{className:P.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 Ue({value:e,label:t=`Observed`}){return l(z,{value:e,label:t})}function We({sourceUpdatedAt:e,observedAt:t,running:n,runStartedAt:r}){return n&&r?l(z,{value:r,label:`Started`}):l(z,{value:e??t,label:e?`Last update`:`Observed`})}function Ge({health:e}){let t=e.consecutiveFailures>=3,n=t?`Updates unavailable`:`Updates delayed`;return u(c,{children:[l(I,{glyph:`⚠`,label:n,value:`${n} · ${e.message}`,title:e.message,emphasis:t?`serious`:`warning`}),l(z,{value:e.lastConfirmedAt,label:`Last confirmed`})]})}function z({value:e,label:t}){let n=new Date(e),r=n.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}),i=`${t} ${Ke(Date.now()-n.getTime())}`;return l(I,{glyph:`◷`,label:t,value:i,title:`${t} at ${r}`,observed:!0})}function Ke(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 qe({panel:e,envelope:t,updateHealth:n}){if(!t)return l(R,{panel:e,children:l(F,{children:`Loading…`})});if(t.state===`error`){let n=ze(t.error.kind);return u(R,{panel:e,envelope:t,error:!0,children:[u(L,{emphasis:n.emphasis,children:[`⚠ `,n.label]}),l(F,{children:t.error.message})]})}let r=fe.safeParse(t.signal);return r.success?l(R,{panel:e,envelope:t,children:u(`div`,{className:Be.fact,children:[l(L,{children:String(r.data.value)}),l(Ue,{value:t.observedAt}),n&&l(Ge,{health:n})]})}):l(R,{panel:e,envelope:t,error:!0,children:l(L,{children:`⚠ Invalid value`})})}var Je=.85,Ye=[[{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 Xe(e,t){return e>t?`horizontal`:`vertical`}function Ze(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 Qe(e){return Array.from(e).reduce((e,t)=>e*31+t.charCodeAt(0)>>>0,7)}function $e(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 et(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 tt(e,t,n){let r=Ye.filter(e=>$e(e,t,n));return r[B(e,r.length)]??[{x:0,y:0}]}function nt(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=>et(s,e))||!lt(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<ct(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[B(a,d.length)];return f?{x:f.x,y:f.y}:void 0}function rt(e,t,n,r,i,a){let o=Ye.flatMap((o,s)=>{if(!$e(o,t,n))return[];let c=nt(o,e,t,n,r,i+s*31,a);return c?[{shape:o,destination:c}]:[]});if(o.length!==0)return o[B(i,o.length)]}function it(e,t,n){return Math.ceil(e*t*Je*Math.min(1,Math.max(0,n)))}function at(e){return e.reduce((e,t)=>e+t.cells.length,0)}function ot(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 st(e,t,n,r,i){let a=[];for(let o=0;o<i;o+=1){let i=r+o*17,s=tt(i,t,n),c=nt(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 ct(e,t){return t===`vertical`?new Set(e.map(e=>e.x)).size:new Set(e.map(e=>e.y)).size}function lt(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=>et({...i,y:e},t)))return!1;return i.y+s<=r}for(let e=n-o;e>=i.x;--e)if(a.some(t=>et({...i,x:e},t)))return!1;return i.x+o<=n}function B(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 ut={variant:`_variant_1lsfm_1`},V={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`},dt=50,ft=1250,pt=250,mt=850,ht=500;function gt({progress:e,estimatedDurationMs:t,overdue:r,seed:o=0}){let s=i(null),[c,d]=a({...Ze(`vertical`),direction:`vertical`}),[f,p]=a([]),[m,h]=a(!1),[g,_]=a([]),[v,y]=a(!1),b=i(c),x=i(c),S=i(e),C=i(o),ee=i(void 0),w=i([]),T=i(!1),E=i({startedAt:Date.now(),nextPieceAt:ft,recycleUntil:0,id:0,settled:[]});return n(()=>{S.current=e},[e]),n(()=>{C.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=ee.current??Xe(t.width,t.height);ee.current=n;let r={...Ze(n,t.width,t.height),direction:n};return b.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=()=>y(e.matches);return t(),e.addEventListener?.(`change`,t),()=>e.removeEventListener?.(`change`,t)},[]),n(()=>{let e=x.current,t=e.direction!==c.direction||e.columns!==c.columns||e.rows!==c.rows;x.current=c,!(!t||v)&&(E.current={startedAt:Date.now(),nextPieceAt:ft,id:0,recycleUntil:0,settled:[]},w.current=[],p([]),h(!1),_([]),T.current=!1)},[c,v]),n(()=>{if(!v)return;let e=st(c.direction,c.columns,c.rows,C.current,Math.max(1,Math.floor(S.current*6)));w.current=e,E.current.settled=e,p(e)},[c,v]),n(()=>{if(v)return;let e=window.setInterval(()=>{let e=E.current,n=Date.now()-e.startedAt,i=b.current,a=S.current,o=it(i.columns,i.rows,a),s=[...e.settled],c=w.current.filter(e=>e.phase!==`settled`);if(n<e.recycleUntil)return;if(T.current&&(T.current=!1,h(!1),_([])),n>=e.nextPieceAt&&c.length===0){if(a<1&&at(s)>=o)return;let l=e.id,u=C.current+l*17,d=rt(i.direction,i.columns,i.rows,s,u+1,!r);if(!d&&(a>=1||t===void 0)){let t=ot(i.direction,i.columns,i.rows,s,!0);if(t){s=t.shapes,e.settled=s,e.recycleUntil=n+ht,e.nextPieceAt=e.recycleUntil,w.current=s,T.current=!0,_(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+=_t(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-pt)/mt));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<pt?`entry`:l<.35?`align`:`travel`}}),e.settled=s;let l=[...s,...c.filter(e=>e.phase!==`settled`)];w.current=l,p(l)},dt);return()=>window.clearInterval(e)},[t,r,v]),l(`div`,{ref:s,className:V.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:V.grid,children:[g.map(e=>l(`span`,{className:V.clearingCell,style:{"--clear-x":e.x,"--clear-y":e.y}},`${e.x}-${e.y}`)),f.map(e=>l(`div`,{className:V.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:V.cell,style:{"--cell-x":e.x,"--cell-y":e.y}},`${e.x}-${e.y}`))},e.id))]})})}function _t(e,t){let n=Math.ceil(t.columns*t.rows*.85);return e===void 0||n<=0?ft:Math.max(400,e/Math.max(1,Math.ceil(n/3)))}var H={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 vt(){return u(c,{children:[l(`span`,{className:H.frontier,"data-running-part":`frontier`}),l(`span`,{className:H.now,"data-running-part":`transit-now`}),l(`span`,{className:H.routes,"data-running-part":`transit-routes`,children:[0,1,2].map(e=>l(`span`,{className:H.route},e))}),l(`span`,{className:H.trail,"data-running-part":`transit-trail`}),l(`span`,{className:H.packet,"data-running-part":`transit-packet`})]})}var U={field:`_field_1i9kx_1`,overdue:`_overdue_1i9kx_11`,timing:`_timing_1i9kx_14`,timingOverdue:`_timingOverdue_1i9kx_28`},W={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 yt(){return u(c,{children:[l(`span`,{className:W.haze,"data-running-part":`weather-haze`}),l(`span`,{className:W.pressure,"data-running-part":`weather-pressure`}),l(`span`,{className:`${W.band} ${W.bandOne}`}),l(`span`,{className:`${W.band} ${W.bandTwo}`}),l(`span`,{className:`${W.band} ${W.bandThree}`}),l(`span`,{className:`${W.drift} ${W.driftOne}`}),l(`span`,{className:`${W.drift} ${W.driftTwo}`}),l(`span`,{className:`${W.drift} ${W.driftThree}`}),l(`span`,{className:`${W.drift} ${W.driftFour}`}),l(`span`,{className:`${W.drift} ${W.driftFive}`})]})}var bt={anchor:`_anchor_1bd86_1`,body:`_body_1bd86_6`,"phased-marker":`_phased-marker_1bd86_1`};function xt({anchorClassName:e,bodyClassName:t,delay:n,anchorPart:r,bodyPart:i}){let a=n?{"--phased-marker-delay":n}:void 0;return l(`span`,{className:`${bt.anchor} ${e??``}`,"data-running-part":r,children:l(`span`,{className:`${bt.body} ${t??``}`,"data-running-part":i,style:a})})}var G={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 St(){return u(c,{children:[l(`span`,{className:G.frontier,"data-running-part":`frontier`}),l(`span`,{className:G.flare,"data-running-part":`bloom-flare`}),l(`span`,{className:G.lanes,"data-running-part":`bloom-lanes`,children:[0,1,2,3].map(e=>l(`span`,{className:G.lane,"data-running-part":`bloom-lane`,children:l(xt,{anchorClassName:G.markerAnchor,bodyClassName:G.markerBody,delay:[void 0,`-0.8s`,`-1.7s`,`-2.4s`][e],anchorPart:`bloom-marker-anchor`,bodyPart:`bloom-marker`})},e))})]})}function Ct(e){return[`telemetry-bloom`,`release-transit`,`status-weather`,`falling-shapes`].includes(e)}function wt({animation:e,progress:t,estimatedDurationMs:n,overdue:r,indeterminate:i,seed:a}){let o={"--running-progress":`${t*100}%`};return u(`div`,{className:`${U.field} ${r?U.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(St,{}),e===`release-transit`&&l(vt,{}),e===`status-weather`&&l(yt,{}),e===`falling-shapes`&&l(gt,{progress:t,estimatedDurationMs:n,overdue:r,seed:a})]})}var Tt=20;function Et(e,t){let n=Dt(!!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 Dt(e){let[t,r]=a(()=>Date.now());return n(()=>{if(!e)return;r(Date.now());let t=window.setInterval(()=>r(Date.now()),Tt);return()=>window.clearInterval(t)},[e]),t}function Ot(e,t,n){return`${e===void 0?`Run in progress`:`Elapsed ${At(e)}`} · ${t===void 0?`Expected duration unavailable`:`Expected ≈ ${At(t)}`}${n?` · Over estimate`:``}`}function kt(e,t,n){let r=e===void 0?`—`:jt(e),i=t===void 0?`?`:`~${jt(t)}`;return`${n?`⚠`:`\xA0`}${r}/${i}`}function At(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 jt(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 Mt({elapsedMs:e,estimatedDurationMs:t,overdue:n}){return u(`p`,{className:`${U.timing} ${n?U.timingOverdue:``}`,children:[l(`span`,{className:`screen-reader-only`,children:Ot(e,t,n)}),l(`span`,{"aria-hidden":`true`,children:kt(e,t,n)})]})}var K={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 Nt({animation:e,timing:t}){let{elapsedMs:n,estimatedDurationMs:r,hasEstimate:i,overdue:a,progress:o}=t,s=e===`runway`||e===`signal-field`,d=Ot(n,r,a),f={"--running-progress":`${o*100}%`,"--running-degrees":`${o*360}deg`},p=e===`signal-field`?K.signalField:K[e];return u(`div`,{className:`${K.progress} ${p} ${a?K.overdue:``} ${i?``:K.indeterminate}`,style:f,"data-running-progress":e,"data-overdue":a||void 0,"data-indeterminate":!i||void 0,children:[u(`div`,{className:K.visual,"aria-hidden":`true`,"data-running-visual":!0,children:[e===`radial`&&l(`span`,{className:K.radialCore}),e===`runway`&&u(c,{children:[l(`span`,{className:K.spark,"data-running-part":`runway-spark`}),l(`span`,{className:`${K.spark} ${K.sparkTwo}`,"data-running-part":`runway-spark-two`})]}),e===`orbit`&&u(c,{children:[l(`span`,{className:K.orbitCore}),l(`span`,{className:K.particle}),l(`span`,{className:`${K.particle} ${K.particleTwo}`})]}),e===`signal-field`&&u(c,{children:[l(`span`,{className:K.rail}),l(`span`,{className:K.lead}),l(`span`,{className:K.pulse}),l(`span`,{className:`${K.pulse} ${K.pulseTwo}`}),l(`span`,{className:K.tracks,"data-running-part":`signal-tracks`,children:[0,1,2,3,4].map(e=>l(`span`,{className:K.track,"data-running-part":`signal-track`,children:l(xt,{anchorClassName:K.markerAnchor,bodyClassName:K.markerBody,delay:[void 0,`-0.8s`,`-1.7s`,`-2.4s`,`-0.35s`][e],anchorPart:`signal-marker-anchor`,bodyPart:`signal-marker`})},e))})]})]}),l(`p`,{className:`${K.timing} ${s?K.readout:``}`,children:s?u(c,{children:[l(`span`,{className:`screen-reader-only`,children:d}),l(`span`,{"aria-hidden":`true`,children:kt(n,r,a)})]}):d})]})}function Pt(e){return[`radial`,`runway`,`orbit`,`signal-field`].includes(e)}var Ft=2e4,It=15e3,Lt=3e5,Rt=1.25,zt=[`radial`,`runway`,`orbit`,`signal-field`,`telemetry-bloom`,`release-transit`,`status-weather`,`falling-shapes`];function Bt({panel:e}){let t=Ut(),n=e.running_animation===void 0||e.running_animation===`off`?void 0:e.running_animation,r=Vt(e.demo_run_duration,Ft),i=Vt(e.demo_review_duration,Lt),a=n?Math.ceil(i*Rt):r,o=Math.floor(t/a),s=n??zt[o%zt.length]??`radial`,c=o*a;return l(Ht,{panel:e,animation:s,runStartedAt:c,estimatedDurationMs:n?i:It})}function Vt(e,t){return e?p(e)??t:t}function Ht({panel:e,animation:t,runStartedAt:n,estimatedDurationMs:r}){let i=Et(new Date(n).toISOString(),r),a=Ct(t);return u(R,{panel:e,field:a?l(wt,{animation:t,progress:i.progress,estimatedDurationMs:i.estimatedDurationMs,overdue:i.overdue,indeterminate:!i.hasEstimate,seed:Qe(e.id)},`${t}-${n}`):void 0,children:[l(L,{status:`running`,children:`↻ Running`}),u(`p`,{className:ut.variant,children:[`Demo treatment · `,t]}),a?l(Mt,{elapsedMs:i.elapsedMs,estimatedDurationMs:r,overdue:i.overdue}):l(Nt,{animation:t,timing:i})]})}function Ut(){let[e,t]=a(()=>Date.now());return n(()=>{let e=window.setInterval(()=>t(Date.now()),1e3);return()=>window.clearInterval(e)},[]),e}var q={details:`_details_19avj_1`,activity:`_activity_19avj_7`,duration:`_duration_19avj_8`};function Wt(e,t=`Passed`){switch(e){case`passed`:return{glyph:`✓`,label:t};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 Gt(e){return e?e.parent?`${e.parent} › ${e.name}`:e.name:`Activity unavailable`}function Kt({panel:e,envelope:t,updateHealth:n}){if(!t)return l(R,{panel:e,children:l(F,{children:`Loading…`})});if(t.state===`error`){let n=ze(t.error.kind);return u(R,{panel:e,envelope:t,error:!0,children:[u(L,{emphasis:n.emphasis,children:[`⚠ `,n.label]}),l(F,{children:t.error.message})]})}let r=D.safeParse(t.signal);return r.success?l(qt,{panel:e,envelope:t,signal:r.data,updateHealth:n}):l(R,{panel:e,envelope:t,error:!0,children:l(L,{children:`⚠ Invalid signal`})})}function qt({panel:e,envelope:t,signal:n,updateHealth:r}){let o=Wt(n.status),[s,c]=a(()=>n.status===`running`?Jt():void 0),d=i(n.status);if(n.status!==d.current){let t=d.current===`running`;d.current=n.status,e.running_animation===void 0&&!t&&n.status===`running`&&c(e=>Jt(e))}let f=e.running_animation??s??`off`,p=n.status===`running`&&f!==`off`,m=Et(n.runStartedAt,n.estimatedDurationMs),h=p&&Ct(f),g=p&&Pt(f);return l(R,{panel:e,envelope:t,field:h?l(wt,{animation:f,progress:m.progress,estimatedDurationMs:m.estimatedDurationMs,overdue:m.overdue,indeterminate:!m.hasEstimate,seed:Qe(e.id)}):void 0,children:u(`div`,{className:q.details,children:[u(L,{status:n.status,children:[o.glyph,` `,o.label]}),n.status===`running`&&l(I,{glyph:`⚙`,label:`Activity`,value:Gt(n.activity),title:`Activity: ${Gt(n.activity)}`,className:q.activity}),n.branch&&l(I,{glyph:`⎇`,label:`Branch`,value:l(`span`,{className:q.branch,children:n.branch}),title:`Branch: ${n.branch}`}),h&&l(Mt,{elapsedMs:m.elapsedMs,estimatedDurationMs:n.estimatedDurationMs,overdue:m.overdue}),g&&l(Nt,{animation:f,timing:m}),n.status!==`running`&&n.durationMs!==void 0&&l(I,{glyph:`◷`,label:`Duration`,value:`Took ${Yt(n.durationMs)}`,title:`Duration: Took ${Yt(n.durationMs)}`,className:q.duration}),l(We,{sourceUpdatedAt:n.sourceUpdatedAt,observedAt:t.observedAt,running:n.status===`running`,runStartedAt:n.runStartedAt}),r&&l(Ge,{health:r})]})})}function Jt(e){let t=_.filter(t=>t!==e);return t[Math.floor(Math.random()*t.length)]??`telemetry-bloom`}function Yt(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`}var J={compactFacts:`_compactFacts_f62xm_1`,incomplete:`_incomplete_f62xm_8`,compactFact:`_compactFact_f62xm_1`,failedItem:`_failedItem_f62xm_19`,evidence:`_evidence_f62xm_27`,freshness:`_freshness_f62xm_28`,statusAnchor:`_statusAnchor_f62xm_36`,fullSummary:`_fullSummary_f62xm_44`};function Y(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}function Xt(e){let t=[...e.workflows,...e.pullRequests].find(e=>e.status===`failed`);return t?{workflow:Y(e.workflows.length,`workflow`),pullRequests:Y(e.pullRequests.length,`open PR`),primary:`${t.label} failed`,secondary:`${Y(e.workflows.length,`workflow`)} · ${Y(e.pullRequests.length,`open PR`)}`,primaryDetail:t.detail,title:`${e.summary} — ${t.label}: ${t.detail}`}:{workflow:Y(e.workflows.length,`workflow`),pullRequests:Y(e.pullRequests.length,`open PR`),primary:Y(e.workflows.length,`workflow`),secondary:Y(e.pullRequests.length,`open PR`),title:e.summary}}function Zt({panel:e,envelope:t,updateHealth:n}){if(!t)return l(R,{panel:e,children:l(F,{children:`Loading…`})});if(t.state===`error`){let n=ze(t.error.kind);return u(R,{panel:e,envelope:t,error:!0,children:[u(L,{emphasis:n.emphasis,children:[`⚠ `,n.label]}),l(F,{children:t.error.message})]})}let r=se.safeParse(t.signal);if(!r.success)return l(R,{panel:e,envelope:t,error:!0,children:l(L,{children:`⚠ Invalid signal`})});let i=Wt(r.data.status,`Healthy`),a=Xt(r.data);return u(R,{panel:e,envelope:t,layout:`three-anchor`,children:[l(`div`,{className:J.statusAnchor,"data-panel-anchor":`status`,children:u(L,{status:r.data.status,children:[i.glyph,` `,i.label]})}),u(`div`,{className:J.evidence,"data-panel-anchor":`evidence`,children:[l(F,{className:J.fullSummary,title:r.data.summary,children:r.data.summary}),u(`div`,{className:J.compactFacts,title:a.title,"data-compact-facts":!0,children:[a.primaryDetail&&u(`p`,{className:J.failedItem,title:a.primaryDetail,children:[l(`span`,{"aria-hidden":`true`,children:`⚠`}),` `,l(`span`,{className:`screen-reader-only`,children:`Failed item: `}),a.primary,u(`span`,{className:`screen-reader-only`,children:[`. Detail: `,a.primaryDetail]})]}),l(I,{glyph:`⚙`,label:`Update workflows`,value:a.workflow,title:`Update workflows: ${a.workflow}`,className:J.compactFact}),l(I,{glyph:`⎇`,label:`Open update pull requests`,value:a.pullRequests,title:`Open update pull requests: ${a.pullRequests}`,className:J.compactFact})]}),u(`div`,{className:J.freshness,children:[l(Ue,{value:t.observedAt,label:`Observed (oldest evidence)`}),r.data.newestObservedAt&&u(`span`,{className:`screen-reader-only`,children:[`Newest evidence observed `,r.data.newestObservedAt,`.`]}),n&&l(Ge,{health:n})]}),r.data.incompleteObservations&&l(`div`,{role:`status`,children:u(F,{className:J.incomplete,children:[`⚠ Incomplete observations:`,` `,r.data.incompleteObservations.map(({label:e,message:t})=>`${e}: ${t}`).join(` · `)]})})]})]})}var Qt={"pipeline-status":Kt,"pull-request-health":Zt,"http-value":qe,"pipeline-animation-demo":Bt};function $t({panel:e,envelope:t,updateHealth:n}){let r=Qt[e.type];return r?l(r,{panel:e,envelope:t,updateHealth:n}):l(Re,{label:e.type,hint:`Not wired yet`,wide:!0})}var en=6e4,tn=1e4,nn=()=>globalThis.window.location.reload();function rn({env:e,diagnostics:t,fetcher:r,reload:i=nn}){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(),tn);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=te.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},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(),en)}};return c(),()=>{n=!0,o?.abort()}},[t,e.assetPath,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=D.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=se.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 an(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}var on=`ze-great-dashboard.panel-memory.v1`,sn=1,cn=12096e5,ln=class{now;histories;storage;constructor(e=xe(),t=()=>new Date){this.now=t,this.storage=e,this.histories=this.read(),this.pruneAll()}latest(e){return this.history(e).latest}rememberLatest(e,t){this.history(e).latest=t,this.persist()}recordRun(e,t,n=!1){let r=this.history(e);n&&(r.durations[un(t)]=t);let i=r.latestCompleted;(!i||dn(t.sourceUpdatedAt,i.sourceUpdatedAt))&&(r.latestCompleted=t),this.pruneHistory(r),this.persist()}recordSuccessfulRun(e,t){this.recordRun(e,t,!0)}recordCompletedRun(e,t){this.recordRun(e,t)}medianDuration(e){let t=this.history(e);this.pruneHistory(t);let n=Object.values(t.durations).map(({durationMs:e})=>e).sort((e,t)=>e-t);if(n.length===0)return;let r=Math.floor(n.length/2);if(n.length%2==1)return n[r];let i=n[r-1],a=n[r];return i===void 0||a===void 0?void 0:Math.floor((i+a)/2)}resolveEstimatedDuration(e){let t=this.medianDuration(e);if(t!==void 0)return t;let n=this.history(e);return this.pruneHistory(n),n.latestCompleted?.durationMs}history(e){let t=pn(e),n=this.histories[t];if(n)return n;let r={durations:{}};return this.histories[t]=r,r}pruneAll(){for(let e of Object.values(this.histories))this.pruneHistory(e);this.persist()}pruneHistory(e){let t=this.now().valueOf()-cn;for(let[n,r]of Object.entries(e.durations)){let i=Z(r.sourceUpdatedAt);(i===void 0||i<t)&&delete e.durations[n]}let n=e.latestCompleted?Z(e.latestCompleted.sourceUpdatedAt):void 0;e.latestCompleted&&(n===void 0||n<t)&&delete e.latestCompleted}read(){let e=Se(this.storage,on);return e?.schemaVersion!==sn||!e.histories?{}:mn(e.histories)?e.histories:{}}persist(){Ce(this.storage,on,{schemaVersion:sn,histories:this.histories})}};function un(e){return e.sourceRunId??e.link??e.sourceUpdatedAt}function dn(e,t){let n=Z(e),r=Z(t);return n!==void 0&&(r===void 0||n>=r)}function Z(e){let t=Date.parse(e);return Number.isFinite(t)?t:void 0}function fn(e,t){return{board:e,panelId:t.id,source:t.source??``,workflow:typeof t.pipeline==`string`||typeof t.pipeline==`number`?String(t.pipeline):``,branch:t.branch??``}}function pn(e){return JSON.stringify([e.board,e.panelId,e.source,e.workflow,e.branch])}function mn(e){return Q(e)?Object.values(e).every(hn):!1}function hn(e){return!Q(e)||!Q(e.durations)||!Object.values(e.durations).every(gn)?!1:e.latestCompleted===void 0||gn(e.latestCompleted)}function gn(e){return Q(e)?(typeof e.link==`string`||e.link===null)&&(e.sourceRunId===void 0||typeof e.sourceRunId==`string`)&&typeof e.durationMs==`number`&&Number.isInteger(e.durationMs)&&e.durationMs>=0&&typeof e.sourceUpdatedAt==`string`&&Z(e.sourceUpdatedAt)!==void 0:!1}function Q(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function _n(e){let t=vn(e.envelope);if(!t)return{kind:`not-pipeline`,envelope:e.envelope};if(e.accepted&&t.sourceUpdatedAt&&Date.parse(t.sourceUpdatedAt)<Date.parse(e.accepted.sourceUpdatedAt))return e.envelope.state!==`ok`||!t.sourceUpdatedAt?{kind:`not-pipeline`,envelope:e.envelope}:{kind:`rejected`,envelope:e.envelope,signal:{...t,sourceUpdatedAt:t.sourceUpdatedAt}};let n=t.sourceUpdatedAt?{sourceUpdatedAt:t.sourceUpdatedAt,status:t.status,link:e.envelope.link}:void 0,r=t.status!==`running`&&t.durationMs!==void 0&&t.sourceUpdatedAt&&Number.isFinite(Date.parse(t.sourceUpdatedAt))?{link:e.envelope.link,...t.sourceRunId?{sourceRunId:t.sourceRunId}:{},durationMs:t.durationMs,sourceUpdatedAt:t.sourceUpdatedAt}:void 0;return{kind:`accepted`,envelope:t.status===`running`&&e.estimatedDurationMs!==void 0&&e.envelope.state===`ok`?{...e.envelope,signal:{...t,estimatedDurationMs:e.estimatedDurationMs}}:e.envelope,signal:t,accepted:n,durationSample:r}}function vn(e){if(e.state!==`ok`)return;let t=D.safeParse(e.signal);return t.success?t.data:void 0}function yn(e,t,n){let r=bn(e);if(!r)return n.refreshMillis;let i=xn(r);return i===void 0?n.runningRefreshMillis:t<i?Math.min(n.runningRefreshMillis,i-t):t<i+n.runningCompletionWindowMillis?n.runningCompletionRefreshMillis:n.runningRefreshMillis}function bn(e){if(e?.state!==`ok`)return;let t=D.safeParse(e.signal);return t.success&&t.data.status===`running`?t.data:void 0}function xn(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 Sn(e){let t=[],n=e.workflows.map(({workflow:e,observation:n})=>{let r=wn(n.envelope,`pull-request-workflow`);if(r)return r.item;let i=n.error??`No usable observation is available.`;return t.push({label:`Update workflow ${e}`,message:i}),{label:e,status:`unknown`,detail:`Update workflow ${e} · Unavailable: ${i}`,link:null}}),r=Tn(e.candidates.envelope);if(!r){let r=e.candidates.error??`No usable observation is available.`;return t.push({label:`Open update PR candidates`,message:r}),n.every(e=>e.status===`unknown`)?void 0:Cn(e,n,[],t,En(e.workflows.map(({observation:e})=>e)))}return r.truncated&&t.push({label:`Open update PR candidates`,message:`The first 100 candidates were observed; additional open update PRs may exist.`}),Cn(e,n,r.pullRequests.map(n=>{let r=e.builds.get(n.branch),i=wn(r?.envelope,`pull-request-build`);if(i)return{...i.item,label:`PR #${n.number}`,detail:i.item.detail,link:n.link};let a=r?.error??`No usable observation is available.`;return t.push({label:`PR #${n.number}`,message:a}),{label:`PR #${n.number}`,status:`unknown`,detail:`${n.branch} · Unavailable: ${a}`,link:n.link}}),t,En([...e.workflows.map(({observation:e})=>e),e.candidates,...e.builds.values()]))}function Cn(e,t,n,r,i){let a=Dn([...t,...n].map(e=>e.status)),o=[...t,...n].find(e=>e.status===a),s=a!==`passed`&&o?`${o.label}: ${o.detail}`:n.length===0?`${t.length} update workflow${t.length===1?``:`s`} · No open update PRs`:`${t.length} update workflow${t.length===1?``:`s`} · ${n.length} open update PR${n.length===1?``:`s`}`,c=i.sort();return{panelId:e.panelId,state:`ok`,observedAt:c[0]??new Date().toISOString(),link:e.link,signal:{type:`pull-request-health`,status:a,summary:s,workflows:t,pullRequests:n,...r.length?{incompleteObservations:r}:{},...c.length>1?{newestObservedAt:c.at(-1)}:{}}}}function wn(e,t){if(e?.state!==`ok`)return;let n=(t===`pull-request-workflow`?ue:de).safeParse(e.signal);return n.success?{item:n.data.item}:void 0}function Tn(e){if(e?.state!==`ok`)return;let t=le.safeParse(e.signal);return t.success?t.data:void 0}function En(e){return e.flatMap(({envelope:e})=>e?.state===`ok`?[e.observedAt]:[])}function Dn(e){return e.some(e=>e===`failed`)?`failed`:e.some(e=>e===`running`)?`running`:e.some(e=>e===`unknown`)?`unknown`:e.some(e=>e===`cancelled`)?`cancelled`:`passed`}function On({board:e,env:t,diagnostics:r,memory:o}){let[s,c]=a({}),[l,u]=a({}),d=i({}),f=i(null);return f.current||=o??new ln,n(()=>{if(d.current={},c({}),u({}),!e)return;let n=!1,i=new Set,a=new Set;for(let o of e.panels){if(k(o.position)||o.type!==`pipeline-status`&&o.type!==`pull-request-health`&&o.type!==`http-value`)continue;let s=!1,l=f.current;if(!l)return;let p=ve(e,o),m=`${t.proxyPath}/panel/${encodeURIComponent(t.board)}/${encodeURIComponent(o.id)}`,h,g,_=()=>{g=new Date().toISOString(),n||u(e=>{if(!e[o.id])return e;let t={...e};return delete t[o.id],t})},v=e=>{let t=g;if(n||!t)return;let r=$(e);u(e=>{let n=e[o.id];return{...e,[o.id]:{consecutiveFailures:(n?.consecutiveFailures??0)+1,message:r,lastConfirmedAt:t}}})};if(o.type===`pull-request-health`){let e=An(o),t=new Map,l,u=async e=>{r.record({kind:`panel-fetch-start`,panelId:o.id,path:e});try{let n=await fetch(e,{signal:l?.signal}),i={kind:`panel-fetch-response`,panelId:o.id,path:e,status:n.status,cache:Ne(n.headers)};if(n.status===304){r.record(i);let n=t.get(e);return n?{envelope:n}:{error:`Source returned not modified before an initial observation.`}}let a=Nn(await n.json());return r.record({...i,...a?{envelope:a}:{},...a?.state===`error`?{failure:kn(a,n)}:{}}),a?a.state===`error`?{error:a.error.message}:(t.set(e,a),{envelope:a}):{error:`Response was not a valid signal envelope.`}}catch(t){return l?.signal.aborted?{error:`Observation cancelled.`}:(r.record({kind:`panel-fetch-failure`,panelId:o.id,path:e,message:$(t)}),{error:$(t)})}},f=async()=>{if(n||s)return;s=!0,l=new AbortController,a.add(l);let t=m,[g,...y]=await Promise.all([u(`${t}/pull-requests`),...e.map(({workflow:e})=>u(`${t}/update-workflow/${encodeURIComponent(e)}`))]),b=g.envelope?.state===`ok`&&jn(g.envelope.signal)?g.envelope.signal.pullRequests:[];if(n||l.signal.aborted){a.delete(l);return}let x=await Promise.all(b.map(async e=>[e.branch,await u(`${t}/pull-request-build?branch=${encodeURIComponent(e.branch)}`)])),S=Sn({panelId:o.id,link:g.envelope?.link??null,workflows:e.map(({workflow:e},t)=>({workflow:e,observation:y[t]??{error:`Missing workflow result.`}})),candidates:g,builds:new Map(x)});if(n||l.signal.aborted){a.delete(l);return}if(S&&!n){h=S,_();let e=d.current[o.id];an(e,o,S)&&r.record({kind:`panel-rendered`,panelId:o.id,path:m,rendered:X(o,S)}),d.current={...d.current,[o.id]:S},c(d.current)}else n||v(`No usable pull-request observations.`);if(s=!1,a.delete(l),!n){let e=window.setTimeout(()=>{i.delete(e),f()},yn(h,Date.now(),p));i.add(e)}};f();continue}let y=()=>{n||s||(s=!0,r.record({kind:`panel-fetch-start`,panelId:o.id,path:m}),fetch(m).then(async e=>{let t={kind:`panel-fetch-response`,panelId:o.id,path:m,status:e.status,cache:Ne(e.headers)};if(e.status===304){r.record(t),_();return}try{let n=Nn(await e.json());if(!n){r.record(t),r.record({kind:`panel-fetch-parse-failure`,panelId:o.id,path:m,message:`Response was not a valid signal envelope.`}),v(`Response was not a valid signal envelope.`);return}return r.record({...t,envelope:n,...n.state===`error`?{failure:kn(n,e)}:{}}),_(),{envelope:n,cache:t.cache,status:e.status}}catch(e){throw r.record(t),r.record({kind:`panel-fetch-parse-failure`,panelId:o.id,path:m,message:$(e)}),new Mn(e)}}).then(e=>{if(!e)return;let i=e.envelope;if(o.type===`pipeline-status`){let n=fn(t.board,o),a=l.latest(n),s=_n({envelope:i,accepted:a,estimatedDurationMs:l.resolveEstimatedDuration(n)});if(s.kind===`rejected`&&a){let t=s.signal;r.recordGithubConsistencyIncident({panelId:o.id,endpoint:m,identity:{source:n.source,workflow:n.workflow,branch:n.branch},accepted:a,regressed:{sourceUpdatedAt:t.sourceUpdatedAt,status:t.status,link:i.link},response:{httpStatus:e.status,date:e.cache?.date,etag:e.cache?.etag,cacheControl:e.cache?.cacheControl}});return}if(s.kind===`accepted`&&(i=s.envelope,s.accepted&&l.rememberLatest(n,s.accepted),s.durationSample)){let e={link:s.durationSample.link,...s.durationSample.sourceRunId?{sourceRunId:s.durationSample.sourceRunId}:{},durationMs:s.durationSample.durationMs,sourceUpdatedAt:s.durationSample.sourceUpdatedAt};l.recordRun(n,e,s.signal.status===`passed`)}}if(h=i,!n){let e=d.current[o.id];an(e,o,i)&&r.record({kind:`panel-rendered`,panelId:o.id,path:m,rendered:X(o,i)}),d.current={...d.current,[o.id]:i},c(d.current)}}).catch(e=>{v(e),e instanceof Mn||r.record({kind:`panel-fetch-failure`,panelId:o.id,path:m,message:$(e)})}).finally(()=>{if(s=!1,!n){let e=window.setTimeout(()=>{i.delete(e),y()},yn(h,Date.now(),p));i.add(e)}}))};y()}return()=>{n=!0;for(let e of a)e.abort();for(let e of i)window.clearTimeout(e)}},[e,r,t.board,t.proxyPath]),{signals:s,updateHealth:l}}function kn(e,t){let n=t.headers.get(`x-dashboard-request-id`);return{reason:e.error.message,...n?{supportReference:n}:{}}}function An(e){let t=e.update_workflows;return Array.isArray(t)?t.flatMap(e=>typeof e==`object`&&e&&typeof e.workflow==`string`?[{workflow:e.workflow}]:[]):[]}function jn(e){return typeof e==`object`&&!!e&&e.type===`pull-request-candidates`&&Array.isArray(e.pullRequests)}function $(e){return e instanceof Error?e.message:String(e)}var Mn=class extends Error{constructor(e){super($(e))}};function Nn(e){let t=ae.safeParse(e);return t.success?t.data:void 0}function Pn({env:e}){let[t,o]=a(),[s,c]=a(),d=i(null);d.current||=new je(e);let f=d.current;rn({env:e,diagnostics:f});let{signals:p,updateHealth:m}=On({board:s===e.board?t:void 0,env:e,diagnostics:f}),h=r(()=>t?he(t.panels):void 0,[t]);return n(()=>{!h||h.issues.length===0||f.record({kind:`layout-analyzed`,issueCount:h.issues.length,affectedPanelIds:h.issues.map(e=>e.panelId)})},[f,h]),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:Ne(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:In(e)}),new Ln(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 Ln||f.record({kind:`board-fetch-failure`,path:n,message:In(r)}),t||(o({panels:[]}),c(e.board))}),()=>{t=!0}},[f,e.board,e.proxyPath]),u(`div`,{className:j.board,children:[l(`header`,{className:j.header,children:l(`h1`,{className:j.title,children:e.board})}),u(`main`,{className:j.grid,children:[!t&&l(Re,{label:`board`,hint:`Loading configuration…`,wide:!0}),t?.panels.filter(e=>!k(e.position)).map(e=>l($t,{panel:e,envelope:p[e.id],updateHealth:m[e.id]},e.id))]}),u(`footer`,{className:j.footer,"data-board-footer":!0,children:[l(`span`,{children:`Signals are read live from their configured authorities.`}),u(`div`,{className:j.footerTools,children:[h&&h.issues.length>0&&l(Fn,{board:e.board,layout:h,proxyPath:e.proxyPath}),l(ye,{log:f})]})]})]})}function Fn({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:j.layoutWarning,"data-layout-warning":!0,children:[u(`button`,{className:j.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:j.layoutWarningDialog,id:s,role:`dialog`,"aria-labelledby":`${s}-title`,"aria-modal":`false`,children:[u(`div`,{className:j.layoutWarningHeading,children:[l(`strong`,{id:`${s}-title`,children:`Layout warnings`}),l(`button`,{className:j.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:j.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:j.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 In(e){return e instanceof Error?e.message:String(e)}var Ln=class extends Error{constructor(e){super(In(e))}},Rn={error:`_error_yx1g9_1`};function zn({message:e}){return u(`div`,{className:Rn.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 Bn=document.getElementById(`root`);if(!Bn)throw Error(`No #root element in the document — the template is not the one we expect.`);var Vn=s(Bn);try{Vn.render(l(t,{children:l(Pn,{env:ne()})}))}catch(e){Vn.render(l(zn,{message:e instanceof Error?e.message:String(e)}))}
|
|
3
|
+
//# sourceMappingURL=index-TT8Nan_w.js.map
|