@continuous-excellence/ze-great-dashboard-client 0.27.7 → 0.27.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "index.html": {
3
- "file": "assets/index-Cdmkz_uI.js",
3
+ "file": "assets/index-YLTkVv3A.js",
4
4
  "name": "index",
5
5
  "src": "index.html",
6
6
  "isEntry": true,
@@ -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`]),_=e.string().regex(/^\$(?:\.[A-Za-z_][A-Za-z0-9_]*|\[\d+\])*$/,`must be a simple JSON path`),v=e.object({id:e.string().min(1),label:e.string().min(1),url:e.url(),json_path:_.optional()}),y=e.object({id:e.string().min(1),type:e.literal(`http-value`)});y.extend({url:e.url(),json_path:_.optional(),link:e.url().optional()});var b=y.extend({facts:e.array(v).min(1).max(4)}),x=[`radial`,`runway`,`orbit`,`signal-field`,`telemetry-bloom`,`release-transit`,`status-weather`,`falling-shapes`,`snowman`],S=e.enum([...x,`off`]),C=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:S.optional(),demo_run_duration:m.optional(),demo_review_duration:m.optional(),link:e.url().optional(),url:e.url().optional(),json_path:_.optional(),facts:b.shape.facts.optional()}).superRefine((e,t)=>{if(`display`in e&&t.addIssue({code:`custom`,path:[`display`],message:`display was removed; use density`}),e.type===`http-value`&&e.facts){e.url!==void 0&&t.addIssue({code:`custom`,path:[`url`],message:`use facts URLs for grouped panels`}),e.json_path!==void 0&&t.addIssue({code:`custom`,path:[`json_path`],message:`use facts json_path values for grouped panels`});let n=new Map;e.facts.forEach((e,r)=>{let i=n.get(e.id);i===void 0?n.set(e.id,r):t.addIssue({code:`custom`,path:[`facts`,r,`id`],message:`duplicate fact id "${e.id}" (already used by fact at index ${i})`})})}}),ee=e.object({app_id_env:e.string().min(1),private_key_env:e.string().min(1),installation_id_env:e.string().min(1)}),w={token_env:e.string().min(1).optional(),github_app:ee.optional()};function T(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(),...w}).superRefine(T);var te=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).optional(),entra_token_file_env:e.string().min(1).optional()}).superRefine((e,t)=>{e.token_env&&e.entra_token_file_env&&t.addIssue({code:`custom`,message:`configure token_env or entra_token_file_env, not both`}),!e.token_env&&!e.entra_token_file_env&&t.addIssue({code:`custom`,message:`configure token_env or entra_token_file_env`})}),ne=e.url().superRefine((e,t)=>{let n=new URL(e);n.protocol!==`https:`&&t.addIssue({code:`custom`,message:`must be an HTTPS GitLab instance URL`}),(n.username||n.password)&&t.addIssue({code:`custom`,message:`must not include credentials`}),n.search&&t.addIssue({code:`custom`,message:`must not include a query string`}),n.hash&&t.addIssue({code:`custom`,message:`must not include a fragment`})}),re=e.looseObject({type:e.literal(`gitlab-ci`),project:e.string().regex(/^[^/\s]+(?:\/[^/\s]+)+$/,`must be a namespace/project path`),token_env:e.string().min(1),branch:e.string().min(1).optional(),url:ne.optional().default(`https://gitlab.com`)}),ie=e.looseObject({type:e.string().min(1),...w}).superRefine(T),ae=e.object({refresh:m.optional(),running_refresh:m.optional(),running_completion_refresh:m.optional(),running_completion_window:m.optional(),panels:e.array(C).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})`})})})}),oe=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),ie).default({}),boards:e.record(e.string().min(1),ae),auth:oe.optional()}).superRefine((e,t)=>{for(let[n,r]of Object.entries(e.sources)){let e=r.type===`azure-devops`?te:r.type===`gitlab-ci`?re:void 0;if(!e)continue;let i=e.safeParse(r);if(!i.success)for(let e of i.error.issues)t.addIssue({code:`custom`,path:[`sources`,n,...e.path],message:e.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 se=e.object({assetPath:e.string().min(1),assetPathId:e.string().regex(/^sha256:[a-f0-9]{64}$/),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()}),ce=se.pick({assetPath:!0,assetPathId:!0}).extend({serverVersion:e.string().min(1)});function le(t=globalThis.window?.env){let n=se.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 ue=e.enum([`unreachable`,`unauthorized`,`not-found`,`no-runs`,`upstream-error`]),de=e.object({kind:ue,message:e.string()}),fe=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:de})]),pe=e.object({kind:e.enum([`job`,`stage`,`step`]),name:e.string().min(1),parent:e.string().min(1).optional()}),E=e.object({type:e.literal(`pipeline-status`),status:e.enum([`passed`,`failed`,`warning`,`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:pe.optional(),estimatedDurationMs:e.number().int().positive().optional(),sourceUpdatedAt:e.iso.datetime().optional()}),me={passed:0,cancelled:1,unknown:2,running:3,warning:4,failed:5};function he(e){return me[e]}var ge=e.object({label:e.string().min(1),status:E.shape.status,detail:e.string().min(1),link:e.url().nullable()}),_e=e.object({type:e.literal(`pull-request-health`),status:E.shape.status,summary:e.string().min(1),workflows:e.array(ge),pullRequests:e.array(ge),incompleteObservations:e.array(e.object({label:e.string().min(1),message:e.string().min(1)})).optional(),newestObservedAt:e.iso.datetime().optional()}),ve=e.object({number:e.number().int().positive(),branch:e.string().min(1),link:e.url()}),ye=e.object({type:e.literal(`pull-request-candidates`),pullRequests:e.array(ve),truncated:e.boolean().optional()}),be=e.object({type:e.literal(`pull-request-workflow`),workflow:e.string().min(1),item:ge}),xe=e.object({type:e.literal(`pull-request-build`),branch:e.string().min(1),item:ge}),Se=e.object({type:e.literal(`http-value`),value:e.union([e.string(),e.number(),e.boolean()])}),Ce=12,we=12;function Te(e){let t=e.flatMap(e=>!e.position||D(e.position)||Ee(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)||!De(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 Ee(e){return!D(e)&&e.x+e.w<=Ce&&e.y+e.h<=we}function De(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 Oe={refreshMillis:6e4,runningRefreshMillis:15e3,runningCompletionRefreshMillis:5e3,runningCompletionWindowMillis:12e4};function ke(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`,Oe.refreshMillis),runningRefreshMillis:r(`running_refresh`,`running_refresh`,Oe.runningRefreshMillis),runningCompletionRefreshMillis:r(`running_completion_refresh`,`running_completion_refresh`,Oe.runningCompletionRefreshMillis),runningCompletionWindowMillis:r(`running_completion_window`,`running_completion_window`,Oe.runningCompletionWindowMillis)}}var O={board:`_board_5mm1v_1`,header:`_header_5mm1v_11`,title:`_title_5mm1v_18`,grid:`_grid_5mm1v_24`,footerTools:`_footerTools_5mm1v_34`,layoutWarning:`_layoutWarning_5mm1v_39`,layoutWarningButton:`_layoutWarningButton_5mm1v_42`,layoutWarningDialog:`_layoutWarningDialog_5mm1v_60`,layoutWarningHeading:`_layoutWarningHeading_5mm1v_73`,layoutWarningClose:`_layoutWarningClose_5mm1v_91`,layoutWarningDownloads:`_layoutWarningDownloads_5mm1v_99`,layoutWarningNote:`_layoutWarningNote_5mm1v_118`,footer:`_footer_5mm1v_34`},k={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 Ae({log:e,updateActivity:t}){let[n,r]=a(!1);o(e.subscribe,e.snapshot,e.snapshot);let i=e.count(),s=e.githubConsistencyIncidentCount(),d=e.summary();return u(`section`,{className:k.diagnostics,children:[u(`button`,{className:k.button,type:`button`,"aria-expanded":n,onClick:()=>r(!n),children:[`Diagnostics (`,i,`)`,s>0&&` · GitHub consistency ${s}`]}),n&&u(`div`,{className:k.area,children:[u(`p`,{children:[`Client `,e.clientVersion(),` · assets `,e.assetPath()]}),u(`p`,{children:[d.retained.eventCount,` retained browser-local events across`,` `,d.retained.sessionCount,` session`,d.retained.sessionCount===1?``:`s`,d.retained.firstEventAt&&d.retained.lastEventAt?` (${je(d.retained.firstEventAt,d.retained.lastEventAt)})`:``,`. They are never uploaded.`]}),d.retained.evidenceMayBeIncomplete&&u(`p`,{className:k.warning,role:`alert`,children:[`Earlier evidence was pruned: `,d.retained.retention.eventsPrunedByCount,` at the 2,000-event cap and `,d.retained.retention.eventsPrunedByAge,` by the 7-day age limit. “No failures” applies only to the retained window.`]}),u(`p`,{children:[`Update failures: `,d.failures.clientUpdate,`; board fetch failures:`,` `,d.failures.boardFetch,`.`]}),e.githubConsistencyIncidentCount()>0&&u(`p`,{className:k.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.`]}),d.panels.length>0&&l(`div`,{className:k.panels,children:d.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:k.actions,children:[l(`button`,{className:k.button,type:`button`,onClick:()=>{let n=new Blob([JSON.stringify(e.export(t?{updateActivity:t()}:{}),null,2)],{type:`application/json`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=`dashboard-diagnostics-${new Date().toISOString().replaceAll(`:`,`-`)}.json`,i.click(),URL.revokeObjectURL(r)},children:`Download`}),l(`button`,{className:k.button,type:`button`,onClick:()=>{window.confirm(`Clear this browser’s retained dashboard diagnostics?`)&&e.clear()},children:`Clear`})]})]})]})}function je(e,t){return e===t?e:`${e} to ${t}`}var Me=`0.27.9`;function A(e,t,n,r=globalThis.fetch){let i=new Headers(n?.headers);return i.set(`X-Dashboard-Client-Version`,Me),i.set(`X-Dashboard-Client-Origin`,globalThis.window.location.origin),i.set(`X-Dashboard-Client-Asset-Id`,e.assetPathId),r(t,{...n,headers:i})}function Ne(){try{return window.localStorage}catch{return}}function Pe(e,t){try{let n=e?.getItem(t);return n?JSON.parse(n):void 0}catch{return}}function Fe(e,t,n){try{e?.setItem(t,JSON.stringify(n))}catch{}}function Ie(e,t){try{e?.removeItem(t)}catch{}}function Le(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 Re=`ze-great-dashboard.diagnostics.v2`,ze=`ze-great-dashboard.diagnostics.v1`,Be=2e3,Ve=6048e5,He=[`session-start`,`client-update-check`,`client-update-response`,`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`],Ue=class{env;storage;now;events=[];retention=Ke();revision=0;incidents=[];listeners=new Set;sessionId=crypto.randomUUID?.()??`${Date.now()}-${Math.random()}`;constructor(e,t=Ne(),n=()=>new Date){this.env=e,this.storage=t,this.now=n,Ie(this.storage,ze),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=Je([...this.events,{...e,schemaVersion:2,at:this.now().toISOString(),sessionId:this.sessionId,board:this.env.board,clientVersion:Me,clientAssetPath:this.env.assetPath,clientAssetPathId:this.env.assetPathId}],this.now(),this.retention);this.events=t.events,this.retention=t.retention,this.persist(),this.revision++,this.notify()}count=()=>this.events.length;clientVersion=()=>Me;assetPath=()=>this.env.assetPath;snapshot=()=>this.revision;summary=()=>Le(this.events,this.retention,this.incidents.length);retainedEvidence=()=>({events:[...this.events],retention:{...this.retention}});clear(){this.events=[],this.incidents=[],this.retention=Ke(),Ie(this.storage,Re),this.revision++,this.notify()}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});export=e=>({schemaVersion:2,exportedAt:this.now().toISOString(),client:{version:Me,assetPath:this.env.assetPath,assetPathId:this.env.assetPathId,board:this.env.board,sessionId:this.sessionId},events:this.events,githubConsistencyIncidents:this.incidents,summary:this.summary(),...e});read(){let e=Pe(this.storage,Re);if(!e||e.schemaVersion!==2||!Array.isArray(e.events)||!e.events.every(Ye))return Ie(this.storage,Re),[];let t=Je(e.events.map(e=>({...e,schemaVersion:2})),this.now(),qe(e.retention));return this.retention=t.retention,this.incidents=We(e.githubConsistencyIncidents),t.events}persist(){Fe(this.storage,Re,{schemaVersion:2,events:this.events,retention:this.retention,githubConsistencyIncidents:this.incidents})}notify(){for(let e of this.listeners)e()}};function We(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 Ge(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 Ke(){return{eventsPrunedByAge:0,eventsPrunedByCount:0}}function qe(e){if(!e||typeof e!=`object`)return Ke();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 Je(e,t,n){let r=t.valueOf()-Ve,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-Be);return{events:i.slice(-2e3),retention:{eventsPrunedByAge:n.eventsPrunedByAge+a,eventsPrunedByCount:n.eventsPrunedByCount+o}}}function Ye(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`&&He.includes(t.kind)}var j={panel:`_panel_7veam_1`,content:`_content_7veam_22`,evidence:`_evidence_7veam_34`,sourceAction:`_sourceAction_7veam_38`,details:`_details_7veam_42`,threeAnchor:`_threeAnchor_7veam_50`,error:`_error_7veam_54`,wide:`_wide_7veam_57`,"density-comfortable":`_density-comfortable_7veam_60`,"density-compact":`_density-compact_7veam_67`,label:`_label_7veam_77`,typeGlyph:`_typeGlyph_7veam_85`,identityText:`_identityText_7veam_88`,hint:`_hint_7veam_94`,branch:`_branch_7veam_100`,observed:`_observed_7veam_104`,meta:`_meta_7veam_110`,metaValue:`_metaValue_7veam_113`,compactValue:`_compactValue_7veam_117`,warning:`_warning_7veam_120`,serious:`_serious_7veam_123`,status:`_status_7veam_126`,statusGlyph:`_statusGlyph_7veam_131`,compactOnlyStatus:`_compactOnlyStatus_7veam_134`,passed:`_passed_7veam_140`,failed:`_failed_7veam_143`,running:`_running_7veam_147`,cancelled:`_cancelled_7veam_150`,unknown:`_unknown_7veam_151`,shallow:`_shallow_7veam_184`,"density-auto":`_density-auto_7veam_185`,fullValue:`_fullValue_7veam_305`,statusText:`_statusText_7veam_404`};function Xe({label:e,hint:t,wide:n=!1}){return u(`section`,{className:`${j.panel} ${n?j.wide:``}`,"data-panel":!0,"data-panel-id":`placeholder`,children:[l(`h2`,{className:j.label,children:e}),l(`p`,{className:j.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 M={fact:`_fact_bnc4n_1`,facts:`_facts_bnc4n_5`,factCell:`_factCell_bnc4n_12`,factSource:`_factSource_bnc4n_31`};function Qe(e){let t=e.position;if(t)return{"--panel-column":`${t.x+1} / span ${t.w}`,"--panel-row":`${t.y+1} / span ${t.h}`}}var $e={"pipeline-status":{glyph:`▣`,label:`Pipeline status`},"pull-request-health":{glyph:`⌘`,label:`Pull request health`},"http-value":{glyph:`◌`,label:`HTTP value`},"pipeline-animation-demo":{glyph:`✦`,label:`Pipeline animation demo`}},et={passed:{glyph:`✓`,label:`Passed`},failed:{glyph:`✕`,label:`Failed`},warning:{glyph:`⚠`,label:`Warning`},running:{glyph:`↻`,label:`Running`},cancelled:{glyph:`⊘`,label:`Cancelled`},unknown:{glyph:`?`,label:`Unknown`}};function tt(e){return $e[e]}[...Object.entries($e).map(([e,t])=>({glyph:t.glyph,meaning:`panel type: ${e}`})),...Object.entries(et).map(([e,t])=>({glyph:t.glyph,meaning:`status: ${e}`}))];function N({children:e,className:t,title:n}){return l(`p`,{className:`${j.hint} ${t??``}`,title:n,children:e})}function P({glyph:e,label:t,value:n,compact:r,title:i,observed:a=!1,emphasis:o,className:s}){return u(`p`,{className:`${j.hint} ${a?j.observed:``} ${o?j[o]:``} ${j.meta} ${s??``}`,"data-panel-meta":!0,children:[l(`span`,{"aria-hidden":`true`,children:e}),` `,u(`span`,{className:`screen-reader-only`,children:[t,`: `]}),u(`span`,{className:j.metaValue,title:i,children:[l(`span`,{className:j.fullValue,children:n}),r&&l(`span`,{className:j.compactValue,"aria-hidden":`true`,children:r.kind===`short-value`?r.value:null})]})]})}function F({children:e,className:t,priority:n=`secondary`}){return l(`div`,{className:`${j.evidence} ${t??``}`,"data-panel-evidence":!0,"data-panel-evidence-priority":n,children:e})}function I({status:e,emphasis:t,glyph:n,label:r,compactOnly:i=!1}){return u(`p`,{className:`${j.status} ${e?j[e]:``} ${t?j[t]:``} ${i?j.compactOnlyStatus:``}`,"data-panel-status":!0,children:[n&&l(`span`,{className:j.statusGlyph,"aria-hidden":`true`,children:n}),n&&r&&` `,l(`span`,{className:j.statusText,children:r})]})}function nt({children:e,emphasis:t}){return l(`p`,{className:`${j.status} ${t?j[t]:``}`,children:e})}function L({panel:e,envelope:t,error:n=!1,field:r,layout:i,children:a}){let o=e.density??`auto`,s=e.position,c=tt(e.type),d=s!==void 0&&s.h<=2,f=s!==void 0&&s.h<=3;return u(`section`,{className:`${j.panel} ${j[`density-${o}`]} ${d?j.shallow:``} ${f?j.short:``} ${n?j.error:``}`,style:Qe(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":d,"data-short":f,"data-error":n||void 0,"data-panel-type":e.type,children:[r,l(rt,{panelId:e.id,link:t?.link}),u(`div`,{className:`${j.content} ${i===`three-anchor`?j.threeAnchor:``}`,"data-panel-content":!0,"data-panel-layout":i,children:[u(`h2`,{className:j.label,"data-panel-anchor":`identity`,children:[c&&l(`span`,{className:j.typeGlyph,"aria-hidden":`true`,title:c.label,"data-panel-type-glyph":!0,children:c.glyph}),l(`span`,{className:j.identityText,"data-panel-identity-text":!0,children:e.label??e.id})]}),a]})]})}function rt({panelId:e,link:t}){return t?u(`a`,{className:j.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 R({value:e,label:t=`Observed`}){return l(ot,{value:e,label:t})}function it({sourceUpdatedAt:e,observedAt:t,running:n,runStartedAt:r}){return n&&r?l(ot,{value:r,label:`Started`}):l(ot,{value:e??t,label:e?`Last update`:`Observed`})}function at({health:e}){let t=e.consecutiveFailures>=3,n=t?`Updates unavailable`:`Updates delayed`;return u(c,{children:[l(P,{glyph:`⚠`,label:n,value:`${n} · ${e.message}`,title:e.message,emphasis:t?`serious`:`warning`}),l(ot,{value:e.lastConfirmedAt,label:`Last confirmed`})]})}function ot({value:e,label:t}){let n=new Date(e),r=n.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}),i=Date.now()-n.getTime(),a=`${t} ${st(i)}`;return l(P,{glyph:`◷`,label:t,value:a,compact:{kind:`short-value`,value:ct(i)},title:`${t} at ${r}`,observed:!0})}function st(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 ct(e){if(e<6e4)return`now`;let t=Math.floor(e/6e4);return t<60?`${t}m`:`${Math.floor(t/60)}h ${t%60}m`}function lt({panel:e,envelope:t,updateHealth:n,facts:r}){if(e.facts)return l(ut,{panel:e,facts:r});if(!t)return l(L,{panel:e,children:l(F,{children:l(N,{children:`Loading…`})})});if(t.state===`error`){let n=Ze(t.error.kind);return l(L,{panel:e,envelope:t,error:!0,children:u(F,{children:[l(I,{glyph:`⚠`,label:n.label,emphasis:n.emphasis}),l(N,{children:t.error.message})]})})}let i=Se.safeParse(t.signal);return i.success?l(L,{panel:e,envelope:t,children:u(F,{className:M.fact,children:[l(I,{glyph:`✓`,label:`Value read`,compactOnly:!0}),l(nt,{children:String(i.data.value)}),l(R,{value:t.observedAt}),n&&l(at,{health:n})]})}):l(L,{panel:e,envelope:t,error:!0,children:l(F,{children:l(I,{glyph:`⚠`,label:`Invalid value`})})})}function ut({panel:e,facts:t}){return e.facts?l(L,{panel:e,children:l(F,{children:l(`div`,{className:M.facts,"data-http-value-facts":!0,children:e.facts.map(e=>l(dt,{label:e.label,observation:t?.[e.id]},e.id))})})}):null}function dt({label:e,observation:t}){let n=t?.envelope;if(!n)return u(`section`,{className:M.factCell,"data-http-value-fact":!0,children:[l(`h3`,{children:e}),l(nt,{emphasis:t?.failure?`serious`:void 0,children:t?.failure?`⚠ Updates unavailable`:`Loading…`}),t?.updateHealth&&l(at,{health:t.updateHealth})]});if(n.state===`error`){let t=Ze(n.error.kind);return u(`section`,{className:M.factCell,"data-http-value-fact":!0,"data-error":!0,children:[l(ft,{label:e,link:n.link}),l(`h3`,{children:e}),l(I,{glyph:`⚠`,label:t.label,emphasis:t.emphasis}),l(N,{children:n.error.message}),l(R,{value:n.observedAt})]})}let r=Se.safeParse(n.signal);return r.success?u(`section`,{className:M.factCell,"data-http-value-fact":!0,children:[l(ft,{label:e,link:n.link}),l(`h3`,{children:e}),l(nt,{children:String(r.data.value)}),l(R,{value:n.observedAt})]}):u(`section`,{className:M.factCell,"data-http-value-fact":!0,"data-error":!0,children:[l(ft,{label:e,link:n.link}),l(`h3`,{children:e}),l(I,{glyph:`⚠`,label:`Invalid value`,emphasis:`serious`}),l(R,{value:n.observedAt})]})}function ft({label:e,link:t}){return t?u(`a`,{className:M.factSource,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)`,children:[l(`span`,{"aria-hidden":`true`,children:`↗`}),l(`span`,{className:`screen-reader-only`,children:`View source`})]}):null}var pt={variant:`_variant_14ks8_1`,variantPrefix:`_variantPrefix_14ks8_9`},z={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`},mt=.85,ht=[[{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 gt(e,t){return e>t?`horizontal`:`vertical`}function _t(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 vt(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 yt(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 bt(e,t,n){let r=ht.filter(e=>vt(e,t,n));return r[kt(e,r.length)]??[{x:0,y:0}]}function xt(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=>yt(s,e))||!Ot(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<Dt(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[kt(a,d.length)];return f?{x:f.x,y:f.y}:void 0}function St(e,t,n,r,i,a){let o=ht.flatMap((o,s)=>{if(!vt(o,t,n))return[];let c=xt(o,e,t,n,r,i+s*31,a);return c?[{shape:o,destination:c}]:[]});if(o.length!==0)return o[kt(i,o.length)]}function Ct(e,t,n){return Math.ceil(e*t*mt*Math.min(1,Math.max(0,n)))}function wt(e){return e.reduce((e,t)=>e+t.cells.length,0)}function Tt(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 Et(e,t,n,r,i){let a=[];for(let o=0;o<i;o+=1){let i=r+o*17,s=bt(i,t,n),c=xt(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 Dt(e,t){return t===`vertical`?new Set(e.map(e=>e.x)).size:new Set(e.map(e=>e.y)).size}function Ot(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=>yt({...i,y:e},t)))return!1;return i.y+s<=r}for(let e=n-o;e>=i.x;--e)if(a.some(t=>yt({...i,x:e},t)))return!1;return i.x+o<=n}function kt(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 At=50,jt=1250,Mt=250,Nt=850,Pt=500;function Ft({progress:e,estimatedDurationMs:t,overdue:r,seed:o=0}){let s=i(null),[c,d]=a({..._t(`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),te=i({startedAt:Date.now(),nextPieceAt:jt,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??gt(t.width,t.height);ee.current=n;let r={..._t(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)&&(te.current={startedAt:Date.now(),nextPieceAt:jt,id:0,recycleUntil:0,settled:[]},w.current=[],p([]),h(!1),_([]),T.current=!1)},[c,v]),n(()=>{if(!v)return;let e=Et(c.direction,c.columns,c.rows,C.current,Math.max(1,Math.floor(S.current*6)));w.current=e,te.current.settled=e,p(e)},[c,v]),n(()=>{if(v)return;let e=window.setInterval(()=>{let e=te.current,n=Date.now()-e.startedAt,i=b.current,a=S.current,o=Ct(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&&wt(s)>=o)return;let l=e.id,u=C.current+l*17,d=St(i.direction,i.columns,i.rows,s,u+1,!r);if(!d&&(a>=1||t===void 0)){let t=Tt(i.direction,i.columns,i.rows,s,!0);if(t){s=t.shapes,e.settled=s,e.recycleUntil=n+Pt,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+=It(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-Mt)/Nt));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<Mt?`entry`:l<.35?`align`:`travel`}}),e.settled=s;let l=[...s,...c.filter(e=>e.phase!==`settled`)];w.current=l,p(l)},At);return()=>window.clearInterval(e)},[t,r,v]),l(`div`,{ref:s,className:z.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:z.grid,children:[g.map(e=>l(`span`,{className:z.clearingCell,style:{"--clear-x":e.x,"--clear-y":e.y}},`${e.x}-${e.y}`)),f.map(e=>l(`div`,{className:z.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:z.cell,style:{"--cell-x":e.x,"--cell-y":e.y}},`${e.x}-${e.y}`))},e.id))]})})}function It(e,t){let n=Math.ceil(t.columns*t.rows*.85);return e===void 0||n<=0?jt:Math.max(400,e/Math.max(1,Math.ceil(n/3)))}var B={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 Lt(){return u(c,{children:[l(`span`,{className:B.frontier,"data-running-part":`frontier`}),l(`span`,{className:B.now,"data-running-part":`transit-now`}),l(`span`,{className:B.routes,"data-running-part":`transit-routes`,children:[0,1,2].map(e=>l(`span`,{className:B.route},e))}),l(`span`,{className:B.trail,"data-running-part":`transit-trail`}),l(`span`,{className:B.packet,"data-running-part":`transit-packet`})]})}var Rt={field:`_field_1i9kx_1`,overdue:`_overdue_1i9kx_11`,timing:`_timing_1i9kx_14`,timingOverdue:`_timingOverdue_1i9kx_28`},zt={field:`_field_ozs8n_1`,canvas:`_canvas_ozs8n_7`};function Bt(e){let t=e*.25,n=e*.2,r=t<700||n<350?`snowfall`:n<530?`arrival`:n<1030?`hop`:`full`,i=Vt((n-(r===`full`?1030:530))/(r===`full`?1620:620),0,1),a=r===`full`?500+1e3*i:0,o=r===`arrival`?0:180+70*i,s=r===`arrival`?Math.min(900,n):350+550*i,c=e*.95,l=c-o;return{mode:r,bodyStart:e*.75-Math.min(2500,t),bodyEnd:e*.75,headStart:l-s-a,hopStart:l-s,land:l,settleEnd:l+(o?120+60*i:0),end:c}}function V(e,t,n){return n===t?Number(e>=n):Vt((e-t)/(n-t),0,1)}function H(e){return e*e*(3-2*e)}function Vt(e,t,n){return Math.max(t,Math.min(n,e))}var U=25,Ht=.5,Ut=.95;function Wt(e={width:360,height:180}){return{nextAt:0,id:0,lastElapsed:0,grid:Gt(e),flakes:[],cells:[],toppled:!1}}function Gt(e){return{columns:K(Math.round(e.width/4),48,180),rows:K(Math.round(e.height/4),28,100)}}function Kt(e,t,n){return n?`overdue`:t===void 0||Bt(t).mode===`snowfall`?`snowing`:e>=Ut?`complete`:e>=Ht?`assembling`:`drift`}function qt(e,t){let n=q(e+41)<.5?-1:1,r=n*(.72+q(e+43)*.45),i=Math.sin(t/1600+q(e+47)*Math.PI*2)*.4,a=n*Math.max(0,Math.sin(t/3100+q(e+53)*Math.PI*2))**7*(3.2+q(e+59)*1.8);return r+i+a}function Jt(e){let t=Gt(e);return Math.round(t.columns*t.rows*.18)}function Yt(e,t,n=!1,r=0){if(e===void 0)return n?30:60;let i=e*Ut/Jt(t);if(n)return i/2;let a=Bt(e);return a.mode!==`snowfall`&&r>=Math.max(0,a.bodyStart-500)?i*4:i}function Xt(e,{elapsed:t,progress:n,estimatedDurationMs:r,overdue:i,seed:a,dimensions:o}){let s=Gt(o),c=e.grid.columns===s.columns&&e.grid.rows===s.rows?xn(e):Wt(o),l=Math.max(c.lastElapsed,t);for(let e=c.lastElapsed+U;e<=l;e+=U)c=$t(c,e,r===void 0?n:e/r,r,i&&(r===void 0||e>=r),a,o),c.lastElapsed=e;return c}function Zt(e){return e.filter(e=>e.owner===`snowman`).length}function Qt(e){return e.cells.map(t=>{let n=t.owner===`body`?e.body:t.owner===`head`?e.head:void 0,r=n&&t.localX!==void 0&&t.localY!==void 0?{...t,x:n.x+t.localX*Math.cos(n.angle)-t.localY*Math.sin(n.angle),y:n.y+t.localX*Math.sin(n.angle)+t.localY*Math.cos(n.angle)}:t;return e.toppling&&r.owner!==`ground`?bn(r,e.toppling):r})}function $t(e,t,n,r,i,a,o){let s=Kt(n,r,i),c=Yt(r,o,i,t);for(;t>=e.nextAt;)e.flakes.push({id:e.id++,x:q(a+e.id*17)*e.grid.columns,y:-1-q(a+e.id*23)*6,bornAt:e.nextAt}),e.nextAt+=c;en(e,n,r,i);let l=mn(e),u=qt(a,t)*(U/1e3),d=r===void 0?.52:Math.max(.52,(e.grid.rows+7)*U/(r*.25)),f=[];for(let t of e.flakes){let n={...t,x:t.x+u,y:t.y+d},r=an(e,n);if(r){on(e,r,t.id,n.x-r.x,n.y-r.y);continue}let i=gn(n,l,e.grid,u,a);if(!i){f.push({...n,x:K(n.x,0,e.grid.columns-1)});continue}let o=l.get(G(i.x,i.y+1));e.cells.push({id:t.id,x:i.x,y:i.y,owner:o===`body`||o===`head`||o===`snowman`?`snowman`:`ground`}),l.set(G(i.x,i.y),e.cells.at(-1)?.owner??`ground`)}e.flakes=f,r!==void 0&&s!==`drift`&&s!==`snowing`&&nn(e),ln(e),hn(e,a,t),hn(e,a,t+U/2);let p=e.body;return p?.locked&&(p.supportY??=W(e,p.x,p.radius,p.y+p.radius),p.y=p.supportY),i&&!e.toppling&&!e.toppled&&Zt(e.cells)>=60&&vn(e,t),yn(e,t),e}function en(e,t,n,r){if(n===void 0)return;let i=Bt(n);if(i.mode===`snowfall`)return;let a=t*n,{columns:o,rows:s}=e.grid,c=H(V(a,i.bodyStart,i.bodyEnd));if(a>=i.bodyStart&&!e.body){let t=o*.14;e.body={kind:`body`,x:t,y:W(e,t,2,s-1),radius:2,angle:0,locked:!1}}let l=e.body;if(l&&!l.locked){l.radius=Math.max(l.radius,_n(e,`body`,2));let t=o*(.14+.38*c);tn(l,t,W(e,t,l.radius,s-1)),l.locked=a>=i.bodyEnd}if(a>=i.headStart&&!e.head){let t=o*(i.mode===`full`?.88:.66);e.head={kind:`head`,x:t,y:W(e,t,1.7,s-1),radius:1.7,angle:0,locked:!1},nn(e)}let u=e.head;if(u&&l&&!u.locked){if(u.radius=Math.max(u.radius,_n(e,`head`,1.7)),a<i.hopStart){let t=o*(.88-.22*H(V(a,i.headStart,i.hopStart)));tn(u,t,W(e,t,u.radius,s-1))}else{u.launch??={x:u.x,y:u.y};let e=V(a,i.hopStart,i.land),t=l.y-l.radius-u.radius+.5;if(u.x=u.launch.x+(l.x-u.launch.x)*H(e),u.y=u.launch.y+(t-u.launch.y)*H(e)-Math.sin(Math.PI*e)*Math.max(5,l.radius*1.5),a>=i.land){let e=V(a,i.land,i.settleEnd);u.y+=Math.sin(Math.PI*e)*.45}u.locked=a>=i.settleEnd}}if(u&&a>=i.land){let t=V(a,i.land,i.end);e.hat={x:u.x,y:u.y-u.radius-1-5*(1-t*t),angle:(1-H(t))*-.22}}}function tn(e,t,n){let r=Sn(e.y,n,.16),i=t-e.x;e.angle+=Math.sign(i)*Math.hypot(i,r-e.y)/Math.max(e.radius,1),e.x=t,e.y=r}function nn(e){let t=Qt(e),n=new Map(e.cells.map(e=>[e.id,e])),r=new Set(t.filter(e=>e.owner===`ground`).map(e=>G(Math.round(e.x),Math.round(e.y)))),i=new Set(t.filter(e=>e.owner===`ground`).filter(e=>!r.has(G(Math.round(e.x),Math.round(e.y)-1))).map(e=>e.id));for(let r of[e.body,e.head]){if(!r||r.locked)continue;let a=r.kind,o=r.radius+.75;for(let a of t){if(!rn(e,r))break;if(a.owner!==`ground`)continue;let t=a.x-r.x,s=a.y-r.y,c=Math.hypot(t,s);if(!i.has(a.id)||c>o||s<-r.radius*.2)continue;let l=n.get(a.id);l&&on(e,r,l.id,t,s)}r.radius=Math.max(r.radius,_n(e,a,r.kind===`body`?2:1.7))}}function rn(e,t){if(t.kind===`body`||!e.body)return!0;let n=e.body.radius*.72,r=Math.max(12,Math.round(Math.PI*(Math.max(0,n-1.7)/.6)**2));return e.cells.filter(e=>e.owner===`head`).length<r}function an(e,t){return[e.body,e.head].filter(e=>e!==void 0&&!e.locked).find(n=>rn(e,n)&&Math.hypot(t.x-n.x,t.y-n.y)<=n.radius)}function on(e,t,n,r,i){let a=Math.cos(-t.angle),o=Math.sin(-t.angle),s=r*a-i*o;i=r*o+i*a,r=s;let c=e.cells.find(e=>e.id===n),l=cn(e,t,n),u=sn(e,t,r,i,n),d={id:n,x:t.x+u.x,y:t.y+u.y,owner:t.kind,localX:u.x,localY:u.y,targetLocalX:l.x,targetLocalY:l.y};c?Object.assign(c,d):e.cells.push(d),t.radius=Math.max(t.radius,_n(e,t.kind,t.kind===`body`?2:1.7)),un(e,t)}function sn(e,t,n,r,i){let a=e.cells.filter(e=>e.id!==i&&e.owner===t.kind),o=(e,t)=>a.every(n=>Math.hypot((n.localX??0)-e,(n.localY??0)-t)>=.75);if(o(n,r))return{x:n,y:r};for(let e=.75;;e+=.75)for(let i=0;i<32;i++){let a=i*Math.PI/16,s=n+Math.cos(a)*e,c=r+Math.sin(a)*e;if((Math.hypot(s,c)<=t.radius+.75||e>t.radius*2)&&o(s,c))return t.radius=Math.max(t.radius,Math.hypot(s,c)-.5),{x:s,y:c}}}function cn(e,t,n){let r=e.cells.filter(e=>e.owner===t.kind&&e.targetLocalX!==void 0&&e.targetLocalY!==void 0),i=(e,t,n=.72)=>r.every(r=>Math.hypot((r.targetLocalX??0)-e,(r.targetLocalY??0)-t)>=n);for(let e=0;e<64;e+=1){let r=q(n*31+e*17)*Math.PI*2,a=Math.sqrt(q(n*37+e*19))*Math.max(.4,t.radius-.35),o=Math.cos(r)*a,s=Math.sin(r)*a;if(i(o,s))return{x:o,y:s}}for(let e=.4;e<=t.radius-.35;e+=.5){let t=Math.max(6,Math.round(2*Math.PI*e/.72));for(let r=0;r<t;r++){let a=r*Math.PI*2/t+q(n*13),o=Math.cos(a)*e,s=Math.sin(a)*e;if(i(o,s,.6))return{x:o,y:s}}}return{x:0,y:0}}function ln(e){for(let t of e.cells){if(t.packed||t.localX===void 0||t.localY===void 0||t.targetLocalX===void 0||t.targetLocalY===void 0)continue;let e=Sn(t.localX,t.targetLocalX,.25),n=Sn(t.localY,t.targetLocalY,.25);t.localX=e,t.localY=n,t.packed=e===t.targetLocalX&&n===t.targetLocalY}}function un(e,t){let n=e.cells.filter(e=>e.owner===t.kind&&e.localX!==void 0&&e.localY!==void 0),r=dn(t.radius,n.length);n.sort((e,t)=>e.id-t.id);for(let[e,t]of n.entries()){let n=r[e];if(!n)break;t.targetLocalX=n.x,t.targetLocalY=n.y,t.packed=!1}}function dn(e,t){let n=Math.max(.2,e-.1),r=[],i=.9,a=i*Math.sqrt(3)/2;for(let e=-Math.ceil(n/a);e<=Math.ceil(n/a);e+=1){let t=e*a,o=e&1?i/2:0;for(let e=-Math.ceil(n/i);e<=Math.ceil(n/i);e+=1){let a=e*i+o;Math.hypot(a,t)<=n&&r.push({x:a,y:t})}}r.sort((e,t)=>Math.hypot(e.x,e.y)-Math.hypot(t.x,t.y));let o=[];for(let e of r)if(o.every(t=>Math.hypot(t.x-e.x,t.y-e.y)>=.82)&&o.push(e),o.length===t)break;return o}function fn(e){if(e.hat)return e.toppling?{...bn(e.hat,e.toppling),angle:e.hat.angle+e.toppling.angle}:e.hat}function pn(e,t,n){let r=xn(t),i=(e,t)=>e+(t-e)*K(n,0,1);for(let t of[`body`,`head`]){let n=e[t],a=r[t];n&&a&&(a.x=i(n.x,a.x),a.y=i(n.y,a.y),a.angle=i(n.angle,a.angle))}let a=new Map(e.flakes.map(e=>[e.id,e]));for(let e of r.flakes){let t=a.get(e.id);t&&(e.x=i(t.x,e.x),e.y=i(t.y,e.y))}return r.toppling&&e.toppling&&(r.toppling.angle=i(e.toppling.angle,r.toppling.angle)),r.hat&&e.hat&&(r.hat={x:i(e.hat.x,r.hat.x),y:i(e.hat.y,r.hat.y),angle:i(e.hat.angle,r.hat.angle)}),r}function mn(e){let t=new Map;for(let n of Qt(e))t.set(G(Math.round(n.x),Math.round(n.y)),n.owner);return t}function hn(e,t,n){let r=mn(e),i=e.cells.filter(e=>e.owner===`ground`).sort((e,t)=>t.y-e.y||e.x-t.x);for(let a of i){let i=G(a.x,a.y+1);if(a.y<e.grid.rows-1&&!r.has(i)){r.delete(G(a.x,a.y)),a.y+=1,r.set(G(a.x,a.y),a.owner);continue}let o=q(t+a.id*29+n)<.5?-1:1;for(let t of[o,-o]){let n=a.x+t;if(!(n<0||n>=e.grid.columns||a.y>=e.grid.rows-1||r.has(G(n,a.y))||r.has(G(n,a.y+1)))){r.delete(G(a.x,a.y)),a.x=n,a.y+=1,r.set(G(a.x,a.y),a.owner);break}}}}function gn(e,t,n,r,i){let a=Math.round(e.x),o=Math.round(e.y);if(o<0)return;if(o>=n.rows-1)return{x:a,y:n.rows-1};if(!t.has(G(a,o+1)))return;let s=r>=0?1:-1,c=q(i+e.id*71+o)>.5?s:-s;for(let e of[c,-c]){let r=a+e;if(r>=0&&r<n.columns&&!t.has(G(r,o+1))&&!t.has(G(r,o)))return{x:r,y:o+1}}return t.has(G(a,o))?{x:a,y:Math.max(0,o-1)}:{x:a,y:o}}function W(e,t,n,r){let i=Qt(e).filter(e=>e.owner===`ground`&&Math.abs(e.x-t)<=n);return(i.length?Math.min(...i.map(e=>e.y)):r)-n}function _n(e,t,n){let r=e.cells.filter(e=>e.owner===t).length;return n+Math.sqrt(r/Math.PI)*.5}function vn(e,t){let n=e.body;n&&(e.toppling={startedAt:t,angle:0,pivotX:n.x,pivotY:n.y+n.radius*.72})}function yn(e,t){let n=e.toppling;if(!n)return;let r=K((t-n.startedAt)/750,0,1);n.angle=(1-(1-r)**3)*(Math.PI/2),r===1&&(e.toppled=!0)}function bn(e,t){let n=Math.cos(t.angle),r=Math.sin(t.angle),i=e.x-t.pivotX,a=e.y-t.pivotY;return{...e,x:t.pivotX+i*n-a*r,y:t.pivotY+i*r+a*n}}function xn(e){return{...e,grid:{...e.grid},hat:e.hat&&{...e.hat},flakes:e.flakes.map(e=>({...e})),cells:e.cells.map(e=>({...e})),body:e.body&&{...e.body},head:e.head&&{...e.head},toppling:e.toppling&&{...e.toppling}}}function G(e,t){return`${e}:${t}`}function K(e,t,n){return Math.max(t,Math.min(n,e))}function Sn(e,t,n){return Math.abs(t-e)<=n?t:e+Math.sign(t-e)*n}function q(e){let t=Math.sin(e*12.9898)*43758.5453;return t-Math.floor(t)}function Cn(e,t,n){if(!e)return;let r=e.getContext(`2d`);if(!r)return;let i=window.devicePixelRatio||1,a=Math.max(1,Math.round(n.width)),o=Math.max(1,Math.round(n.height));(e.width!==a*i||e.height!==o*i)&&(e.width=a*i,e.height=o*i,e.style.width=`${a}px`,e.style.height=`${o}px`),r.setTransform(i,0,0,i,0,0),r.clearRect(0,0,a,o);let s=a/t.grid.columns,c=o/t.grid.rows;r.fillStyle=`rgba(244, 241, 223, 0.52)`;for(let e of Qt(t))wn(r,(e.x+.5)*s,(e.y+.5)*c,s,c);r.fillStyle=`rgba(244, 241, 223, 0.76)`;for(let e of t.flakes)wn(r,(e.x+.5)*s,(e.y+.5)*c,s*.72,c*.72);let l=fn(t);if(l&&t.head){let e=t.head.radius;r.save(),r.translate(l.x*s,l.y*c),r.scale(s,c),r.rotate(l.angle),r.fillStyle=`rgba(27, 31, 24, 0.78)`,r.fillRect(-e*.65,-2,e*1.3,2),r.fillRect(-e,-.3,e*2,.45),r.restore()}}function wn(e,t,n,r,i){e.beginPath(),e.arc(t,n,Math.max(.8,Math.min(r,i)*.42),0,Math.PI*2),e.fill()}function Tn({progress:e,estimatedDurationMs:t,overdue:r,seed:o=0}){let s=i(null),c=i(null),[u,d]=a({width:360,height:180}),[f,p]=a(()=>window.matchMedia(`(prefers-reduced-motion: reduce)`).matches),m=i(e),h=i(r),g=i({startedAt:Date.now(),progressAt:Date.now(),progress:e,simulation:Wt()});n(()=>{m.current=e,g.current.progressAt=Date.now(),g.current.progress=e},[e]),n(()=>{h.current=r},[r]),n(()=>{let e=window.matchMedia(`(prefers-reduced-motion: reduce)`),t=()=>p(e.matches);return t(),e.addEventListener?.(`change`,t),()=>e.removeEventListener?.(`change`,t)},[]),n(()=>{let e=s.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect();t.width>0&&t.height>0&&d({width:t.width,height:t.height})};if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]),n(()=>{if(f)return;g.current.simulation=Wt(u);let e=0,n=()=>{let r=g.current,i=t===void 0?Date.now()-r.startedAt:r.progress*t+(Date.now()-r.progressAt),a={progress:m.current,estimatedDurationMs:t,overdue:h.current,seed:o,dimensions:u},l=Xt(r.simulation,{...a,elapsed:i});r.simulation=l;let d=pn(l,Xt(l,{...a,elapsed:l.lastElapsed+25}),(i-l.lastElapsed)/25);Cn(c.current,d,u);let p=s.current;p&&(p.dataset.snowCellCount=String(l.cells.length),p.dataset.snowDensity=l.grid.columns<65?`compact`:`full`,l.toppled?p.dataset.snowmanToppled=`true`:delete p.dataset.snowmanToppled),f||(e=window.requestAnimationFrame(n))};return e=window.requestAnimationFrame(n),()=>window.cancelAnimationFrame(e)},[u,t,f,o]),n(()=>{if(!f)return;let n=Xt(Wt(u),{elapsed:t===void 0?4800:e*t,progress:e,estimatedDurationMs:t,overdue:r,seed:o,dimensions:u});Cn(c.current,n,u),s.current&&(s.current.dataset.snowCellCount=String(n.cells.length),n.toppled?s.current.dataset.snowmanToppled=`true`:delete s.current.dataset.snowmanToppled)},[u,t,r,e,f,o]);let _=Kt(e,t,r);return l(`div`,{ref:s,className:zt.field,"data-running-part":`snowman-field`,"data-snowman-phase":_,"data-reduced-motion":f||void 0,children:l(`canvas`,{ref:c,className:zt.canvas,"data-running-part":`snowman-canvas`})})}var J={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 En(){return u(c,{children:[l(`span`,{className:J.haze,"data-running-part":`weather-haze`}),l(`span`,{className:J.pressure,"data-running-part":`weather-pressure`}),l(`span`,{className:`${J.band} ${J.bandOne}`}),l(`span`,{className:`${J.band} ${J.bandTwo}`}),l(`span`,{className:`${J.band} ${J.bandThree}`}),l(`span`,{className:`${J.drift} ${J.driftOne}`}),l(`span`,{className:`${J.drift} ${J.driftTwo}`}),l(`span`,{className:`${J.drift} ${J.driftThree}`}),l(`span`,{className:`${J.drift} ${J.driftFour}`}),l(`span`,{className:`${J.drift} ${J.driftFive}`})]})}var Dn={anchor:`_anchor_1bd86_1`,body:`_body_1bd86_6`,"phased-marker":`_phased-marker_1bd86_1`};function On({anchorClassName:e,bodyClassName:t,delay:n,anchorPart:r,bodyPart:i}){let a=n?{"--phased-marker-delay":n}:void 0;return l(`span`,{className:`${Dn.anchor} ${e??``}`,"data-running-part":r,children:l(`span`,{className:`${Dn.body} ${t??``}`,"data-running-part":i,style:a})})}var Y={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 kn(){return u(c,{children:[l(`span`,{className:Y.frontier,"data-running-part":`frontier`}),l(`span`,{className:Y.flare,"data-running-part":`bloom-flare`}),l(`span`,{className:Y.lanes,"data-running-part":`bloom-lanes`,children:[0,1,2,3].map(e=>l(`span`,{className:Y.lane,"data-running-part":`bloom-lane`,children:l(On,{anchorClassName:Y.markerAnchor,bodyClassName:Y.markerBody,delay:[void 0,`-0.8s`,`-1.7s`,`-2.4s`][e],anchorPart:`bloom-marker-anchor`,bodyPart:`bloom-marker`})},e))})]})}function An(e){return[`telemetry-bloom`,`release-transit`,`status-weather`,`falling-shapes`,`snowman`].includes(e)}function jn({animation:e,progress:t,estimatedDurationMs:n,overdue:r,indeterminate:i,seed:a}){let o={"--running-progress":`${t*100}%`};return u(`div`,{className:`${Rt.field} ${r?Rt.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(kn,{}),e===`release-transit`&&l(Lt,{}),e===`status-weather`&&l(En,{}),e===`falling-shapes`&&l(Ft,{progress:t,estimatedDurationMs:n,overdue:r,seed:a}),e===`snowman`&&l(Tn,{progress:t,estimatedDurationMs:n,overdue:r,seed:a})]})}var Mn=20;function Nn(e,t){let n=Pn(!!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 Pn(e){let[t,r]=a(()=>Date.now());return n(()=>{if(!e)return;r(Date.now());let t=window.setInterval(()=>r(Date.now()),Mn);return()=>window.clearInterval(t)},[e]),t}function Fn(e,t,n){return`${e===void 0?`Run in progress`:`Elapsed ${Ln(e)}`} · ${t===void 0?`Expected duration unavailable`:`Expected ≈ ${Ln(t)}`}${n?` · Over estimate`:``}`}function In(e,t,n){let r=e===void 0?`—`:Rn(e),i=t===void 0?`?`:`~${Rn(t)}`;return`${n?`⚠`:`\xA0`}${r}/${i}`}function Ln(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 Rn(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 zn({elapsedMs:e,estimatedDurationMs:t,overdue:n}){return u(`p`,{className:`${Rt.timing} ${n?Rt.timingOverdue:``}`,children:[l(`span`,{className:`screen-reader-only`,children:Fn(e,t,n)}),l(`span`,{"aria-hidden":`true`,children:In(e,t,n)})]})}var X={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 Bn({animation:e,timing:t}){let{elapsedMs:n,estimatedDurationMs:r,hasEstimate:i,overdue:a,progress:o}=t,s=e===`runway`||e===`signal-field`,d=Fn(n,r,a),f={"--running-progress":`${o*100}%`,"--running-degrees":`${o*360}deg`},p=e===`signal-field`?X.signalField:X[e];return u(`div`,{className:`${X.progress} ${p} ${a?X.overdue:``} ${i?``:X.indeterminate}`,style:f,"data-running-progress":e,"data-overdue":a||void 0,"data-indeterminate":!i||void 0,children:[u(`div`,{className:X.visual,"aria-hidden":`true`,"data-running-visual":!0,children:[e===`radial`&&l(`span`,{className:X.radialCore}),e===`runway`&&u(c,{children:[l(`span`,{className:X.spark,"data-running-part":`runway-spark`}),l(`span`,{className:`${X.spark} ${X.sparkTwo}`,"data-running-part":`runway-spark-two`})]}),e===`orbit`&&u(c,{children:[l(`span`,{className:X.orbitCore}),l(`span`,{className:X.particle}),l(`span`,{className:`${X.particle} ${X.particleTwo}`})]}),e===`signal-field`&&u(c,{children:[l(`span`,{className:X.rail}),l(`span`,{className:X.lead}),l(`span`,{className:X.pulse}),l(`span`,{className:`${X.pulse} ${X.pulseTwo}`}),l(`span`,{className:X.tracks,"data-running-part":`signal-tracks`,children:[0,1,2,3,4].map(e=>l(`span`,{className:X.track,"data-running-part":`signal-track`,children:l(On,{anchorClassName:X.markerAnchor,bodyClassName:X.markerBody,delay:[void 0,`-0.8s`,`-1.7s`,`-2.4s`,`-0.35s`][e],anchorPart:`signal-marker-anchor`,bodyPart:`signal-marker`})},e))})]})]}),l(`p`,{className:`${X.timing} ${s?X.readout:``}`,children:s?u(c,{children:[l(`span`,{className:`screen-reader-only`,children:d}),l(`span`,{"aria-hidden":`true`,children:In(n,r,a)})]}):d})]})}function Vn(e){return[`radial`,`runway`,`orbit`,`signal-field`].includes(e)}function Hn(e){return Array.from(e).reduce((e,t)=>e*31+t.charCodeAt(0)>>>0,7)}var Un=2e4,Wn=15e3,Gn=3e5,Kn=1.25,qn=[`radial`,`runway`,`orbit`,`signal-field`,`telemetry-bloom`,`release-transit`,`status-weather`,`falling-shapes`,`snowman`];function Jn({panel:e}){let t=Zn(),n=e.running_animation===void 0||e.running_animation===`off`?void 0:e.running_animation,r=Yn(e.demo_run_duration,Un),i=Yn(e.demo_review_duration,Gn),a=n?Math.ceil(i*Kn):r,o=Math.floor(t/a),s=n??qn[o%qn.length]??`radial`,c=o*a;return l(Xn,{panel:e,animation:s,runStartedAt:c,estimatedDurationMs:n?i:Wn})}function Yn(e,t){return e?p(e)??t:t}function Xn({panel:e,animation:t,runStartedAt:n,estimatedDurationMs:r}){let i=Nn(new Date(n).toISOString(),r),a=An(t);return l(L,{panel:e,field:a?l(jn,{animation:t,progress:i.progress,estimatedDurationMs:i.estimatedDurationMs,overdue:i.overdue,indeterminate:!i.hasEstimate,seed:Hn(e.id)},`${t}-${n}`):void 0,children:u(F,{children:[l(I,{status:`running`,glyph:`↻`,label:`Running`}),u(`p`,{className:pt.variant,children:[l(`span`,{className:pt.variantPrefix,children:`Demo treatment · `}),t]}),a?l(zn,{elapsedMs:i.elapsedMs,estimatedDurationMs:r,overdue:i.overdue}):l(Bn,{animation:t,timing:i})]})})}function Zn(){let[e,t]=a(()=>Date.now());return n(()=>{let e=window.setInterval(()=>t(Date.now()),1e3);return()=>window.clearInterval(e)},[]),e}var Qn={details:`_details_19avj_1`,activity:`_activity_19avj_7`,duration:`_duration_19avj_8`};function $n(e,t=`Passed`){let n=et[e];return e===`passed`?{...n,label:t}:n}function er(e){return e?e.parent?`${e.parent} › ${e.name}`:e.name:`Activity unavailable`}function tr({panel:e,envelope:t,updateHealth:n}){if(!t)return l(L,{panel:e,children:l(F,{children:l(N,{children:`Loading…`})})});if(t.state===`error`){let n=Ze(t.error.kind);return l(L,{panel:e,envelope:t,error:!0,children:u(F,{children:[l(I,{glyph:`⚠`,label:n.label,emphasis:n.emphasis}),l(N,{children:t.error.message})]})})}let r=E.safeParse(t.signal);return r.success?l(nr,{panel:e,envelope:t,signal:r.data,updateHealth:n}):l(L,{panel:e,envelope:t,error:!0,children:l(F,{children:l(I,{glyph:`⚠`,label:`Invalid signal`})})})}function nr({panel:e,envelope:t,signal:n,updateHealth:r}){let o=$n(n.status),[s,c]=a(()=>n.status===`running`?rr():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=>rr(e))}let f=e.running_animation??s??`off`,p=n.status===`running`&&f!==`off`,m=Nn(n.runStartedAt,n.estimatedDurationMs),h=p&&An(f),g=p&&Vn(f);return l(L,{panel:e,envelope:t,field:h?l(jn,{animation:f,progress:m.progress,estimatedDurationMs:m.estimatedDurationMs,overdue:m.overdue,indeterminate:!m.hasEstimate,seed:Hn(e.id)}):void 0,children:u(F,{className:Qn.details,children:[l(I,{status:n.status,glyph:o.glyph,label:o.label}),n.status===`running`&&l(P,{glyph:`⚙`,label:`Activity`,value:er(n.activity),compact:{kind:`glyph-only`},title:`Activity: ${er(n.activity)}`,className:Qn.activity}),n.branch&&l(P,{glyph:`⎇`,label:`Branch`,value:l(`span`,{className:Qn.branch,children:n.branch}),compact:{kind:`short-value`,value:l(`span`,{className:Qn.branch,children:n.branch})},title:`Branch: ${n.branch}`}),h&&l(zn,{elapsedMs:m.elapsedMs,estimatedDurationMs:n.estimatedDurationMs,overdue:m.overdue}),g&&l(Bn,{animation:f,timing:m}),n.status!==`running`&&n.durationMs!==void 0&&l(P,{glyph:`◷`,label:`Duration`,value:`Took ${ir(n.durationMs)}`,compact:{kind:`short-value`,value:ir(n.durationMs)},title:`Duration: Took ${ir(n.durationMs)}`,className:Qn.duration}),l(it,{sourceUpdatedAt:n.sourceUpdatedAt,observedAt:t.observedAt,running:n.status===`running`,runStartedAt:n.runStartedAt}),r&&l(at,{health:r})]})})}function rr(e){let t=x.filter(t=>t!==e);return t[Math.floor(Math.random()*t.length)]??`telemetry-bloom`}function ir(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 Z={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 Q(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}function ar(e){let t=[...e.workflows,...e.pullRequests].find(e=>e.status===`failed`||e.status===`warning`);return t?{workflow:Q(e.workflows.length,`workflow`),pullRequests:Q(e.pullRequests.length,`open PR`),primary:`${t.label} ${t.status}`,secondary:`${Q(e.workflows.length,`workflow`)} · ${Q(e.pullRequests.length,`open PR`)}`,primaryDetail:t.detail,primaryKind:t.status===`warning`?`warning`:`failed`,title:`${e.summary} — ${t.label}: ${t.detail}`}:{workflow:Q(e.workflows.length,`workflow`),pullRequests:Q(e.pullRequests.length,`open PR`),primary:Q(e.workflows.length,`workflow`),secondary:Q(e.pullRequests.length,`open PR`),title:e.summary}}function or({panel:e,envelope:t,updateHealth:n}){if(!t)return l(L,{panel:e,children:l(F,{children:l(N,{children:`Loading…`})})});if(t.state===`error`){let n=Ze(t.error.kind);return l(L,{panel:e,envelope:t,error:!0,children:u(F,{children:[l(I,{glyph:`⚠`,label:n.label,emphasis:n.emphasis}),l(N,{children:t.error.message})]})})}let r=_e.safeParse(t.signal);if(!r.success)return l(L,{panel:e,envelope:t,error:!0,children:l(F,{children:l(I,{glyph:`⚠`,label:`Invalid signal`})})});let i=$n(r.data.status,`Healthy`),a=ar(r.data);return u(L,{panel:e,envelope:t,layout:`three-anchor`,children:[l(`div`,{className:Z.statusAnchor,"data-panel-anchor":`status`,children:l(I,{status:r.data.status,glyph:i.glyph,label:i.label})}),u(`div`,{className:Z.evidence,"data-panel-anchor":`evidence`,"data-panel-evidence-priority":`secondary`,children:[l(N,{className:Z.fullSummary,title:r.data.summary,children:r.data.summary}),u(`div`,{className:Z.compactFacts,title:a.title,"data-compact-facts":!0,children:[a.primaryDetail&&u(`p`,{className:Z.failedItem,title:a.primaryDetail,children:[l(`span`,{"aria-hidden":`true`,children:`⚠`}),` `,u(`span`,{className:`screen-reader-only`,children:[a.primaryKind===`warning`?`Warning`:`Failed`,` item:`,` `]}),a.primary,u(`span`,{className:`screen-reader-only`,children:[`. Detail: `,a.primaryDetail]})]}),l(P,{glyph:`⚙`,label:`Update workflows`,value:a.workflow,compact:{kind:`short-value`,value:r.data.workflows.length},title:`Update workflows: ${a.workflow}`,className:Z.compactFact}),l(P,{glyph:`⎇`,label:`Open update pull requests`,value:a.pullRequests,compact:{kind:`short-value`,value:r.data.pullRequests.length},title:`Open update pull requests: ${a.pullRequests}`,className:Z.compactFact})]}),u(`div`,{className:Z.freshness,children:[l(R,{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(at,{health:n})]}),r.data.incompleteObservations&&l(`div`,{role:`status`,children:u(N,{className:Z.incomplete,children:[`⚠ Incomplete observations:`,` `,r.data.incompleteObservations.map(({label:e,message:t})=>`${e}: ${t}`).join(` · `)]})})]})]})}var sr={"pipeline-status":tr,"pull-request-health":or,"http-value":lt,"pipeline-animation-demo":Jn};function cr({panel:e,envelope:t,updateHealth:n,facts:r}){let i=sr[e.type];return i?l(i,{panel:e,envelope:t,updateHealth:n,facts:r}):l(Xe,{label:e.type,hint:`Not wired yet`,wide:!0})}var $={activity:`_activity_1vqfl_1`,heading:`_heading_1vqfl_8`,note:`_note_1vqfl_15`,empty:`_empty_1vqfl_16`,legend:`_legend_1vqfl_19`,axis:`_axis_1vqfl_28`,lanes:`_lanes_1vqfl_35`,lane:`_lane_1vqfl_35`,laneLabel:`_laneLabel_1vqfl_46`,track:`_track_1vqfl_49`,observed:`_observed_1vqfl_56`,expected:`_expected_1vqfl_57`},lr=6e5;function ur({schedules:e,events:t,retention:n,now:r=new Date}){let i=r.valueOf(),a=i-lr,o=t.filter(e=>e.kind===`panel-fetch-start`&&Number.isFinite(Date.parse(e.at))&&Date.parse(e.at)>=a&&Date.parse(e.at)<=i),s=e.map(e=>{let t=new Map;for(let n of o){if(n.panelId!==e.panelId)continue;let r=t.get(n.path)??[];r.push(n.at),t.set(n.path,r)}return{...e,observed:[...t.entries()].map(([e,t])=>({path:e,starts:t})),hasRetainedEvidence:t.size>0}});return{capturedAt:r.toISOString(),window:{from:new Date(a).toISOString(),to:r.toISOString()},schedules:e,lanes:s,evidenceMayBeIncomplete:n.eventsPrunedByAge>0||n.eventsPrunedByCount>0}}function dr(e,t){return Math.max(0,Math.min(100,(Date.parse(e)-(t.valueOf()-lr))/lr*100))}function fr(e,t){return`${e.label}, panel ${e.panelId}; ${pr(e.cadence)} cadence; ${e.inFlight?`request in flight`:e.nextDueAt?mr(e.nextDueAt,t):`awaiting first request`}; ${e.observed.length?`${e.observed.length} observed proxy path${e.observed.length===1?``:`s`}`:`no retained requests in the last 10 minutes`}`}function pr(e){return e===`completion-window`?`Completion-window`:e===`running`?`Running`:`Normal`}function mr(e,t){let n=Date.parse(e)-t.valueOf();return n<0?`Overdue by ${hr(-n)}`:`Next poll in ${hr(n)}`}function hr(e){return e%6e4==0?`${Math.round(e/6e4)}m`:`${Math.max(1,Math.round(e/1e3))}s`}function gr({board:e,schedules:t,log:i}){let[s,d]=a(()=>new Date);o(i.subscribe,i.snapshot,i.snapshot),n(()=>{let e=window.setInterval(()=>d(new Date),1e3);return()=>window.clearInterval(e)},[]);let f=r(()=>ur({schedules:t,...i.retainedEvidence(),now:s}),[i,s,t]);return u(`section`,{className:$.activity,"data-update-activity":!0,"aria-labelledby":`update-activity-title`,children:[u(`div`,{className:$.heading,children:[u(`div`,{children:[l(`strong`,{id:`update-activity-title`,children:`Update activity`}),l(`p`,{children:`Browser-local proxy reads from the last 10 minutes. Panels schedule independently.`})]}),l(`span`,{className:$.legend,children:`● observed · ◇ expected`})]}),e&&f.lanes.length===0&&l(`p`,{className:$.empty,children:`No visible polling panels are configured.`}),f.lanes.length>0&&u(c,{children:[u(`div`,{className:$.axis,"aria-hidden":`true`,children:[l(`span`,{children:`10m ago`}),l(`span`,{children:`now`})]}),l(`div`,{className:$.lanes,children:f.lanes.map(e=>u(`div`,{className:$.lane,"data-update-activity-lane":!0,children:[l(`span`,{className:$.laneLabel,children:e.label}),u(`span`,{className:$.track,role:`img`,"aria-label":fr(e,s),children:[e.observed.flatMap(({path:e,starts:t})=>t.map(t=>l(`i`,{className:$.observed,style:{left:`${dr(t,s)}%`},title:`Observed request: ${e}`},`${e}-${t}`))),e.nextDueAt&&l(`i`,{className:$.expected,style:{left:`${dr(e.nextDueAt,s)}%`},title:`Expected next poll`})]})]},e.panelId))})]}),f.evidenceMayBeIncomplete&&l(`p`,{className:$.note,children:`Older browser evidence was pruned, so an empty lane only means no retained request in this window.`}),l(`p`,{className:$.note,children:`Observed markers are requests this browser started; the outlined marker is the current expected next poll, not an observed request.`})]})}var _r=6e4,vr=1e4,yr=()=>globalThis.window.location.reload();function br({env:e,diagnostics:t,fetcher:r,reload:i=yr}){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(),vr);t.record({kind:`client-update-check`,path:s});try{let a=await A(e,s,{cache:`no-store`,signal:l.signal},r??globalThis.fetch);if(!a.ok)throw Error(`Client identity returned ${a.status}`);let o=ce.safeParse(await a.json());if(!o.success)throw Error(`Client identity response was invalid`);if(n)return;t.record({kind:`client-update-response`,path:s,serverVersion:o.data.serverVersion,assetPathIdMatches:o.data.assetPathId===e.assetPathId}),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(),_r)}};return c(),()=>{n=!0,o?.abort()}},[t,e,r,i])}function xr(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=_e.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 Sr(e,t,n){if(!e)return!0;let r=xr(t,e),i=xr(t,n);return r.state!==i.state||r.status!==i.status||r.link!==i.link}function Cr(e){let t=Object.entries(e).map(([e,t])=>t?.envelope?{id:e,state:t.envelope.state,link:t.envelope.link}:{id:e,state:`unavailable`,link:null});return{state:t.some(e=>e.state===`ok`)?`ok`:`error`,link:null,facts:t}}function wr(e,t){return JSON.stringify(e&&Cr(e))!==JSON.stringify(Cr(t))}var Tr=`ze-great-dashboard.panel-memory.v1`,Er=1,Dr=12096e5,Or=class{now;histories;storage;constructor(e=Ne(),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[kr(t)]=t);let i=r.latestCompleted;(!i||Ar(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=Nr(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()-Dr;for(let[n,r]of Object.entries(e.durations)){let i=jr(r.sourceUpdatedAt);(i===void 0||i<t)&&delete e.durations[n]}let n=e.latestCompleted?jr(e.latestCompleted.sourceUpdatedAt):void 0;e.latestCompleted&&(n===void 0||n<t)&&delete e.latestCompleted}read(){let e=Pe(this.storage,Tr);return e?.schemaVersion!==Er||!e.histories?{}:Pr(e.histories)?e.histories:{}}persist(){Fe(this.storage,Tr,{schemaVersion:Er,histories:this.histories})}};function kr(e){return e.sourceRunId??e.link??e.sourceUpdatedAt}function Ar(e,t){let n=jr(e),r=jr(t);return n!==void 0&&(r===void 0||n>=r)}function jr(e){let t=Date.parse(e);return Number.isFinite(t)?t:void 0}function Mr(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 Nr(e){return JSON.stringify([e.board,e.panelId,e.source,e.workflow,e.branch])}function Pr(e){return Lr(e)?Object.values(e).every(Fr):!1}function Fr(e){return!Lr(e)||!Lr(e.durations)||!Object.values(e.durations).every(Ir)?!1:e.latestCompleted===void 0||Ir(e.latestCompleted)}function Ir(e){return Lr(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`&&jr(e.sourceUpdatedAt)!==void 0:!1}function Lr(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}async function Rr(e){e.diagnostics.record({kind:`panel-fetch-start`,panelId:e.panelId,path:e.path});try{let t=await e.fetcher(e.path,{signal:e.signal}),n={kind:`panel-fetch-response`,panelId:e.panelId,path:e.path,status:t.status,cache:Ge(t.headers)};if(t.status===304){e.diagnostics.record(n);let t=e.cache.get(e.path);return t?{envelope:t}:{error:`Source returned not modified before an initial observation.`}}let r=fe.safeParse(await t.json());if(!r.success)return e.diagnostics.record(n),e.diagnostics.record({kind:`panel-fetch-parse-failure`,panelId:e.panelId,path:e.path,message:`Response was not a valid signal envelope.`}),{error:`Response was not a valid signal envelope.`};let i=r.data;return e.diagnostics.record({...n,envelope:i,...i.state===`error`?{failure:zr(i,t)}:{}}),i.state===`ok`&&e.cache.set(e.path,i),{envelope:i}}catch(t){return e.signal?.aborted||e.diagnostics.record({kind:`panel-fetch-failure`,panelId:e.panelId,path:e.path,message:Br(t)}),{error:Br(t)}}}function zr(e,t){let n=t.headers.get(`x-dashboard-request-id`);return{reason:e.error.message,...n?{supportReference:n}:{}}}function Br(e){return e instanceof Error?e.message:String(e)}function Vr(e){let t=Hr(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 Hr(e){if(e.state!==`ok`)return;let t=E.safeParse(e.signal);return t.success?t.data:void 0}function Ur(e){return e.panels.filter(e=>!D(e.position)&&(e.type===`pipeline-status`||e.type===`pull-request-health`||e.type===`http-value`))}function Wr(e,t){return`${e.proxyPath}/panel/${encodeURIComponent(e.board)}/${encodeURIComponent(t)}`}function Gr(e,t,n){let r=Wr(t,n.id),i=n.type===`http-value`&&n.facts?n.facts.map(e=>`${r}/facts/${encodeURIComponent(e.id)}`):n.type===`pull-request-health`?[`${r}/pull-requests`,...Kr(n).map(({workflow:e})=>`${r}/update-workflow/${encodeURIComponent(e)}`)]:[r];return{panelId:n.id,label:n.label??n.id,settings:ke(e,n),cadence:`normal`,inFlight:!1,knownPaths:i}}function Kr(e){let t=typeof e==`object`&&e?e.update_workflows:void 0;return Array.isArray(t)?t.flatMap(e=>typeof e==`object`&&e&&typeof e.workflow==`string`?[{workflow:e.workflow}]:[]):[]}function qr(e,t,n){let r=Jr(e);if(!r)return{delayMillis:n.refreshMillis,cadence:`normal`};let i=Yr(r);return i===void 0?{delayMillis:n.runningRefreshMillis,cadence:`running`}:t<i?{delayMillis:Math.min(n.runningRefreshMillis,i-t),cadence:`running`}:t<i+n.runningCompletionWindowMillis?{delayMillis:n.runningCompletionRefreshMillis,cadence:`completion-window`}:{delayMillis:n.runningRefreshMillis,cadence:`running`}}function Jr(e){if(e?.state!==`ok`)return;let t=E.safeParse(e.signal);return t.success&&t.data.status===`running`?t.data:void 0}function Yr(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 Xr(e){let t=[],n=e.workflows.map(({workflow:e,observation:n})=>{let r=Qr(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=$r(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:Zr(e,n,[],t,ei(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.`}),Zr(e,n,r.pullRequests.map(n=>{let r=e.builds.get(n.branch),i=Qr(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,ei([...e.workflows.map(({observation:e})=>e),e.candidates,...e.builds.values()]))}function Zr(e,t,n,r,i){let a=ti([...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 Qr(e,t){if(e?.state!==`ok`)return;let n=(t===`pull-request-workflow`?be:xe).safeParse(e.signal);return n.success?{item:n.data.item}:void 0}function $r(e){if(e?.state!==`ok`)return;let t=ye.safeParse(e.signal);return t.success?t.data:void 0}function ei(e){return e.flatMap(({envelope:e})=>e?.state===`ok`?[e.observedAt]:[])}function ti(e){return e.reduce((e,t)=>he(t)>he(e)?t:e,`passed`)}function ni({board:e,env:t,diagnostics:r,memory:o}){let[s,c]=a({}),[l,u]=a({}),[d,f]=a({}),[p,m]=a([]),h=i({}),g=i({}),_=i(null);return _.current||=o??new Or,n(()=>{if(h.current={},g.current={},c({}),u({}),f({}),m([]),!e)return;let n=!1,i=new Set,a=new Set,o=Ur(e),s=o.map(n=>Gr(e,t,n)),l=new Map(s.map(e=>[e.panelId,e]));m(s);let d=(e,t)=>{n||m(n=>n.map(n=>n.panelId===e?{...n,...t}:n))};for(let e of o){let o=!1,s=_.current;if(!s)return;let p=l.get(e.id);if(!p)continue;let{settings:m}=p,v=Wr(t,e.id),y,b,x=()=>{b=new Date().toISOString(),n||u(t=>{if(!t[e.id])return t;let n={...t};return delete n[e.id],n})},S=t=>{let r=b;if(n||!r)return;let i=ai(t);u(t=>{let n=t[e.id];return{...t,[e.id]:{consecutiveFailures:(n?.consecutiveFailures??0)+1,message:i,lastConfirmedAt:r}}})};if(e.type===`http-value`&&e.facts){let s=e.facts,c=new Map,l,u=async()=>{if(n||o)return;o=!0,d(e.id,{inFlight:!0,lastRequestStartedAt:new Date().toISOString(),nextDueAt:void 0}),l=new AbortController,a.add(l);let p=`${v}/facts`,h=await Promise.all(s.map(async n=>{let i=`${p}/${encodeURIComponent(n.id)}`,a=await Rr({diagnostics:r,panelId:e.id,path:i,signal:l?.signal,cache:c,fetcher:(e,n)=>A(t,e,n)});return[n.id,a.error?{failure:a.error}:a]}));if(!n&&!l.signal.aborted){let t=Object.fromEntries(h),n=g.current[e.id];wr(n,t)&&r.record({kind:`panel-rendered`,panelId:e.id,path:v,rendered:Cr(t)}),g.current={...g.current,[e.id]:t},f(g.current)}if(o=!1,a.delete(l),!n){let t=Date.now()+m.refreshMillis;d(e.id,{inFlight:!1,cadence:`normal`,nextDueAt:new Date(t).toISOString()});let n=window.setTimeout(()=>{i.delete(n),u()},m.refreshMillis);i.add(n)}};u();continue}if(e.type===`pull-request-health`){let s=Kr(e),l=new Map,u,f=async n=>{let i=await Rr({diagnostics:r,panelId:e.id,path:n,signal:u?.signal,cache:l,fetcher:(e,n)=>A(t,e,n)});return i.envelope?.state===`error`?{error:i.envelope.error.message}:i},p=async()=>{if(n||o)return;o=!0,d(e.id,{inFlight:!0,lastRequestStartedAt:new Date().toISOString(),nextDueAt:void 0}),u=new AbortController,a.add(u);let t=v,[l,...g]=await Promise.all([f(`${t}/pull-requests`),...s.map(({workflow:e})=>f(`${t}/update-workflow/${encodeURIComponent(e)}`))]),_=l.envelope?.state===`ok`&&ii(l.envelope.signal)?l.envelope.signal.pullRequests:[];if(n||u.signal.aborted){a.delete(u);return}let b=await Promise.all(_.map(async e=>[e.branch,await f(`${t}/pull-request-build?branch=${encodeURIComponent(e.branch)}`)])),C=Xr({panelId:e.id,link:l.envelope?.link??null,workflows:s.map(({workflow:e},t)=>({workflow:e,observation:g[t]??{error:`Missing workflow result.`}})),candidates:l,builds:new Map(b)});if(n||u.signal.aborted){a.delete(u);return}if(C&&!n){y=C,x();let t=h.current[e.id];Sr(t,e,C)&&r.record({kind:`panel-rendered`,panelId:e.id,path:v,rendered:xr(e,C)}),h.current={...h.current,[e.id]:C},c(h.current)}else n||S(`No usable pull-request observations.`);if(o=!1,a.delete(u),!n){let t=qr(y,Date.now(),m),n=Date.now()+t.delayMillis;d(e.id,{inFlight:!1,cadence:t.cadence,nextDueAt:new Date(n).toISOString()});let r=window.setTimeout(()=>{i.delete(r),p()},t.delayMillis);i.add(r)}};p();continue}let C=()=>{n||o||(o=!0,d(e.id,{inFlight:!0,lastRequestStartedAt:new Date().toISOString(),nextDueAt:void 0}),r.record({kind:`panel-fetch-start`,panelId:e.id,path:v}),A(t,v).then(async t=>{let n={kind:`panel-fetch-response`,panelId:e.id,path:v,status:t.status,cache:Ge(t.headers)};if(t.status===304){r.record(n),x();return}try{let i=si(await t.json());if(!i){r.record(n),r.record({kind:`panel-fetch-parse-failure`,panelId:e.id,path:v,message:`Response was not a valid signal envelope.`}),S(`Response was not a valid signal envelope.`);return}return r.record({...n,envelope:i,...i.state===`error`?{failure:ri(i,t)}:{}}),x(),{envelope:i,cache:n.cache,status:t.status}}catch(t){throw r.record(n),r.record({kind:`panel-fetch-parse-failure`,panelId:e.id,path:v,message:ai(t)}),new oi(t)}}).then(i=>{if(!i)return;let a=i.envelope;if(e.type===`pipeline-status`){let n=Mr(t.board,e),o=s.latest(n),c=Vr({envelope:a,accepted:o,estimatedDurationMs:s.resolveEstimatedDuration(n)});if(c.kind===`rejected`&&o){let t=c.signal;r.recordGithubConsistencyIncident({panelId:e.id,endpoint:v,identity:{source:n.source,workflow:n.workflow,branch:n.branch},accepted:o,regressed:{sourceUpdatedAt:t.sourceUpdatedAt,status:t.status,link:a.link},response:{httpStatus:i.status,date:i.cache?.date,etag:i.cache?.etag,cacheControl:i.cache?.cacheControl}});return}if(c.kind===`accepted`&&(a=c.envelope,c.accepted&&s.rememberLatest(n,c.accepted),c.durationSample)){let e={link:c.durationSample.link,...c.durationSample.sourceRunId?{sourceRunId:c.durationSample.sourceRunId}:{},durationMs:c.durationSample.durationMs,sourceUpdatedAt:c.durationSample.sourceUpdatedAt};s.recordRun(n,e,c.signal.status===`passed`)}}if(y=a,!n){let t=h.current[e.id];Sr(t,e,a)&&r.record({kind:`panel-rendered`,panelId:e.id,path:v,rendered:xr(e,a)}),h.current={...h.current,[e.id]:a},c(h.current)}}).catch(t=>{S(t),t instanceof oi||r.record({kind:`panel-fetch-failure`,panelId:e.id,path:v,message:ai(t)})}).finally(()=>{if(o=!1,!n){let t=qr(y,Date.now(),m),n=Date.now()+t.delayMillis;d(e.id,{inFlight:!1,cadence:t.cadence,nextDueAt:new Date(n).toISOString()});let r=window.setTimeout(()=>{i.delete(r),C()},t.delayMillis);i.add(r)}}))};C()}return()=>{n=!0;for(let e of a)e.abort();for(let e of i)window.clearTimeout(e)}},[e,r,t]),{signals:s,updateHealth:l,factSignals:d,schedules:p}}function ri(e,t){let n=t.headers.get(`x-dashboard-request-id`);return{reason:e.error.message,...n?{supportReference:n}:{}}}function ii(e){return typeof e==`object`&&!!e&&e.type===`pull-request-candidates`&&Array.isArray(e.pullRequests)}function ai(e){return e instanceof Error?e.message:String(e)}var oi=class extends Error{constructor(e){super(ai(e))}};function si(e){let t=fe.safeParse(e);return t.success?t.data:void 0}function ci({env:e}){let[t,o]=a(),[s,c]=a(),d=i(null);d.current||=new Ue(e);let f=d.current;br({env:e,diagnostics:f});let{signals:p,updateHealth:m,factSignals:h,schedules:g}=ni({board:s===e.board?t:void 0,env:e,diagnostics:f}),_=r(()=>t?Te(t.panels):void 0,[t]);return n(()=>{!_||_.issues.length===0||f.record({kind:`layout-analyzed`,issueCount:_.issues.length,affectedPanelIds:_.issues.map(e=>e.panelId)})},[f,_]),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}),A(e,n).then(async e=>{if(f.record({kind:`board-fetch-response`,path:n,status:e.status,cache:Ge(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:ui(e)}),new di(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 di||f.record({kind:`board-fetch-failure`,path:n,message:ui(r)}),t||(o({panels:[]}),c(e.board))}),()=>{t=!0}},[f,e]),u(`div`,{className:O.board,children:[l(`header`,{className:O.header,children:l(`h1`,{className:O.title,children:e.board})}),u(`main`,{className:O.grid,children:[!t&&l(Xe,{label:`board`,hint:`Loading configuration…`,wide:!0}),t?.panels.filter(e=>!D(e.position)).map(e=>l(cr,{panel:e,envelope:p[e.id],updateHealth:m[e.id],facts:h[e.id]},e.id))]}),u(`footer`,{className:O.footer,"data-board-footer":!0,children:[l(`span`,{children:`Signals are read live from their configured authorities.`}),u(`div`,{className:O.footerTools,children:[_&&_.issues.length>0&&l(li,{board:e.board,layout:_,proxyPath:e.proxyPath}),l(Ae,{log:f,updateActivity:()=>{let e=f.retainedEvidence(),t=ur({schedules:g,...e});return{capturedAt:t.capturedAt,window:t.window,schedules:t.schedules}}})]}),l(gr,{board:t,schedules:g,log:f})]})]})}function li({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:O.layoutWarning,"data-layout-warning":!0,children:[u(`button`,{className:O.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:O.layoutWarningDialog,id:s,role:`dialog`,"aria-labelledby":`${s}-title`,"aria-modal":`false`,children:[u(`div`,{className:O.layoutWarningHeading,children:[l(`strong`,{id:`${s}-title`,children:`Layout warnings`}),l(`button`,{className:O.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:O.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:O.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 ui(e){return e instanceof Error?e.message:String(e)}var di=class extends Error{constructor(e){super(ui(e))}},fi={error:`_error_yx1g9_1`};function pi({message:e}){return u(`div`,{className:fi.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 mi=document.getElementById(`root`);if(!mi)throw Error(`No #root element in the document — the template is not the one we expect.`);var hi=s(mi);try{hi.render(l(t,{children:l(ci,{env:le()})}))}catch(e){hi.render(l(pi,{message:e instanceof Error?e.message:String(e)}))}
3
+ //# sourceMappingURL=index-YLTkVv3A.js.map