@continuous-excellence/ze-great-dashboard-client 0.30.2 → 0.30.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,6 @@
3
3
  "type": "object",
4
4
  "properties": {
5
5
  "sources": {
6
- "default": {},
7
6
  "type": "object",
8
7
  "propertyNames": {
9
8
  "type": "string",
package/client/index.html CHANGED
@@ -11,7 +11,7 @@
11
11
  <title>Trust Dashboard</title>
12
12
 
13
13
  <script type="importmap">{"imports":{"jwt-decode":"https://esm.sh/jwt-decode@4.0.0","jwt-decode/":"https://esm.sh/jwt-decode@4.0.0/","oidc-client-ts":"https://esm.sh/oidc-client-ts@3.5.0","oidc-client-ts/":"https://esm.sh/oidc-client-ts@3.5.0/","react":"https://esm.sh/react@19.3.0","react/":"https://esm.sh/react@19.3.0/","react-dom":"https://esm.sh/react-dom@19.3.0","react-dom/":"https://esm.sh/react-dom@19.3.0/","react-oidc-context":"https://esm.sh/react-oidc-context@3.3.1","react-oidc-context/":"https://esm.sh/react-oidc-context@3.3.1/","scheduler":"https://esm.sh/scheduler@0.28.0","scheduler/":"https://esm.sh/scheduler@0.28.0/","zod":"https://esm.sh/zod@4.6.2","zod/":"https://esm.sh/zod@4.6.2/"}}</script>
14
- <script type="module" crossorigin src="/__ASSET_PATH__/assets/index-CMoIpVra.js"></script>
14
+ <script type="module" crossorigin src="/__ASSET_PATH__/assets/index-CiXpfXXD.js"></script>
15
15
  <link rel="stylesheet" crossorigin href="/__ASSET_PATH__/assets/index-CAW4qONv.css">
16
16
  </head>
17
17
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@continuous-excellence/ze-great-dashboard-client",
3
- "version": "0.30.2",
3
+ "version": "0.30.4",
4
4
  "type": "module",
5
5
  "description": "Immutable browser assets for Ze Great Dashboard.",
6
6
  "repository": {
@@ -1,3 +0,0 @@
1
- import{z as e}from"zod";import{StrictMode as t,useCallback as n,useEffect as r,useMemo as i,useRef as a,useState as o,useSyncExternalStore as s}from"react";import{createRoot as c}from"react-dom/client";import{Fragment as l,jsx as u,jsxs as d}from"react/jsx-runtime";import{AuthProvider as f,useAuth as p}from"react-oidc-context";import{UserManager as m,WebStorageStateStore as h}from"oidc-client-ts";(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 g=/^([1-9][0-9]*)(ms|s|m|h)$/,_={ms:1,s:1e3,m:6e4,h:36e5};function v(e){let t=g.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*_[r]}var y=e.string().regex(/^[1-9][0-9]*(?:ms|s|m|h)$/,{message:`must be a positive duration like "30s", "5m", or "1h"`}).brand(),b=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)})]),x=e.enum([`auto`,`comfortable`,`compact`]),S=e.enum([`beacon`,`alarm`,`steady`]),C=e.string().regex(/^\$(?:\.[A-Za-z_][A-Za-z0-9_]*|\[\d+\])*$/,`must be a simple JSON path`),w=e.object({id:e.string().min(1),label:e.string().min(1),link:e.url().optional(),url:e.url(),json_path:C.optional()}),T=e.object({id:e.string().min(1),type:e.literal(`http-value`)});T.extend({url:e.url(),json_path:C.optional(),link:e.url().optional()});var ee=T.extend({facts:e.array(w).min(1).max(4)}),E=[`radial`,`runway`,`orbit`,`signal-field`,`telemetry-bloom`,`release-transit`,`status-weather`,`falling-shapes`,`snowman`],te=e.enum([...E,`off`]),ne=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:x.optional(),attention:e.literal(!0).optional(),position:b.optional(),refresh:y.optional(),running_refresh:y.optional(),running_completion_refresh:y.optional(),running_completion_window:y.optional(),running_animation:te.optional(),demo_run_duration:y.optional(),demo_review_duration:y.optional(),link:e.url().optional(),url:e.url().optional(),json_path:C.optional(),facts:ee.shape.facts.optional()}).superRefine((e,t)=>{if(`display`in e&&t.addIssue({code:`custom`,path:[`display`],message:`display was removed; use density`,params:{constraint:`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`,params:{constraint:`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`,params:{constraint:`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})`,params:{constraint:`Use a unique fact id within this panel.`}})})}}),re=e.object({app_id_env:e.string().min(1),private_key_env:e.string().min(1),installation_id_env:e.string().min(1)}),ie={token_env:e.string().min(1).optional(),github_app:re.optional()};function ae(e,t){e.token_env&&e.github_app&&t.addIssue({code:`custom`,message:`configure token_env or github_app, not both`,params:{constraint:`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(),...ie}).superRefine(ae);var oe=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`,params:{constraint:`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`,params:{constraint:`configure token_env or entra_token_file_env`}})}),se=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`,params:{constraint:`must be an HTTPS GitLab instance URL`}}),(n.username||n.password)&&t.addIssue({code:`custom`,message:`must not include credentials`,params:{constraint:`must not include credentials`}}),n.search&&t.addIssue({code:`custom`,message:`must not include a query string`,params:{constraint:`must not include a query string`}}),n.hash&&t.addIssue({code:`custom`,message:`must not include a fragment`,params:{constraint:`must not include a fragment`}})}),ce=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:se.optional().default(`https://gitlab.com`)}),le=e.looseObject({type:e.string().min(1),...ie}).superRefine(ae),ue=e.object({refresh:y.optional(),running_refresh:y.optional(),running_completion_refresh:y.optional(),running_completion_window:y.optional(),attention:e.object({treatment:S}).optional(),panels:e.array(ne).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})`,params:{constraint:`Use a unique panel id within this board.`}})})})}).superRefine((e,t)=>{e.panels.some(e=>e.attention)&&!e.attention&&t.addIssue({code:`custom`,path:[`attention`],message:`configure attention.treatment when one or more panels opt into attention`,params:{constraint:`Important panels require one board attention treatment.`}})}),de=e.strictObject({issuer:e.url(),client_id:e.string().min(1),audience:e.string().min(1),allow:e.strictObject({subjects:e.array(e.string().min(1)).min(1)})}),fe=e.enum([`warn`,`required`,`unsecured`]);e.object({sources:e.record(e.string().min(1),le).default({}),boards:e.record(e.string().min(1),ue),auth:de.optional(),security:fe.optional()}).superRefine((e,t)=>{e.security===`unsecured`&&e.auth&&t.addIssue({code:`custom`,path:[`security`],message:`security: unsecured cannot be combined with auth`,params:{constraint:`Remove auth or select warn or required.`}});for(let[n,r]of Object.entries(e.sources)){let e=r.type===`azure-devops`?oe:r.type===`gitlab-ci`?ce:void 0;if(!e)continue;let i=e.safeParse(r);if(!i.success)for(let e of i.error.issues)t.addIssue({...e,path:[`sources`,n,...e.path]})}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`,params:{constraint:`Provide a positive numeric Azure DevOps pipeline definition id.`}})})});var pe=e.enum([`warning`,`blocked`]),me=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),audience:e.string().min(1)}).optional(),security:pe.optional()}),he=me.pick({assetPath:!0,assetPathId:!0}).extend({serverVersion:e.string().min(1)});function ge(t=globalThis.window?.env){let n=me.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 _e=e.enum([`unreachable`,`unauthorized`,`not-found`,`no-runs`,`upstream-error`]),ve=e.object({kind:_e,message:e.string()}),ye=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:ve})]),be=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`,`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:be.optional(),estimatedDurationMs:e.number().int().positive().optional(),sourceUpdatedAt:e.iso.datetime().optional()}),xe={passed:0,cancelled:1,unknown:2,running:3,warning:4,failed:5};function Se(e){return xe[e]}var Ce=e.object({label:e.string().min(1),status:D.shape.status,detail:e.string().min(1),link:e.url().nullable()}),we=e.object({type:e.literal(`pull-request-health`),status:D.shape.status,summary:e.string().min(1),workflows:e.array(Ce),pullRequests:e.array(Ce),incompleteObservations:e.array(e.object({label:e.string().min(1),message:e.string().min(1)})).optional(),newestObservedAt:e.iso.datetime().optional()}),Te=e.object({number:e.number().int().positive(),branch:e.string().min(1),link:e.url()}),Ee=e.object({type:e.literal(`pull-request-candidates`),pullRequests:e.array(Te),truncated:e.boolean().optional()}),De=e.object({type:e.literal(`pull-request-workflow`),workflow:e.string().min(1),item:Ce}),Oe=e.object({type:e.literal(`pull-request-build`),branch:e.string().min(1),item:Ce}),ke=e.object({type:e.literal(`http-value`),value:e.union([e.string(),e.number(),e.boolean()])}),Ae=12,je=12;function Me(e){let t=e.flatMap(e=>!e.position||O(e.position)||Ne(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&&!O(i.position))for(let a=r+1;a<e.length;a++){let r=e[a];if(!r?.position||O(r.position)||!Pe(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 O(e){return e?.x===0&&e.y===0&&e.w===0&&e.h===0}function Ne(e){return!O(e)&&e.x+e.w<=Ae&&e.y+e.h<=je}function Pe(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 Fe={refreshMillis:6e4,runningRefreshMillis:15e3,runningCompletionRefreshMillis:5e3,runningCompletionWindowMillis:12e4};function Ie(e,t){let n=(e,t)=>v(e??``)??t,r=(r,i,a)=>n(t[r],n(e[i],a));return{refreshMillis:r(`refresh`,`refresh`,Fe.refreshMillis),runningRefreshMillis:r(`running_refresh`,`running_refresh`,Fe.runningRefreshMillis),runningCompletionRefreshMillis:r(`running_completion_refresh`,`running_completion_refresh`,Fe.runningCompletionRefreshMillis),runningCompletionWindowMillis:r(`running_completion_window`,`running_completion_window`,Fe.runningCompletionWindowMillis)}}var k={board:`_board_2ghlz_1`,header:`_header_2ghlz_11`,attentionRail:`_attentionRail_2ghlz_18`,attentionGlyph:`_attentionGlyph_2ghlz_43`,"attention-beacon":`_attention-beacon_2ghlz_46`,"attention-alarm":`_attention-alarm_2ghlz_51`,"attention-steady":`_attention-steady_2ghlz_59`,title:`_title_2ghlz_81`,grid:`_grid_2ghlz_87`,footerTools:`_footerTools_2ghlz_97`,layoutWarning:`_layoutWarning_2ghlz_102`,layoutWarningButton:`_layoutWarningButton_2ghlz_105`,layoutWarningDialog:`_layoutWarningDialog_2ghlz_123`,layoutWarningHeading:`_layoutWarningHeading_2ghlz_136`,layoutWarningClose:`_layoutWarningClose_2ghlz_154`,layoutWarningDownloads:`_layoutWarningDownloads_2ghlz_162`,layoutWarningNote:`_layoutWarningNote_2ghlz_181`,footer:`_footer_2ghlz_97`};function Le(e){return e.board?.attention?e.board.panels.flatMap(t=>{if(!t.attention)return[];let n=t.label??t.id;if(t.type===`http-value`&&t.facts)return t.facts.flatMap(r=>{let i=e.factSignals[t.id]?.[r.id],a=Re(i);return a?[{panelId:t.id,label:n,reason:`${r.label}: ${a}`,factId:r.id}]:[]});let r=ze(t.type,e.signals[t.id],e.updateHealth[t.id]);return r?[{panelId:t.id,label:n,reason:r}]:[]}):[]}function Re(e){if(e?.failure)return`Updates unavailable — ${e.failure}`;if(e?.updateHealth)return`Updates unavailable — ${e.updateHealth.message}`;if(e?.envelope)return e.envelope.state===`error`?e.envelope.error.message:ke.safeParse(e.envelope.signal).success?void 0:`Invalid value`}function ze(e,t,n){if(n)return`Updates unavailable — ${n.message}`;if(t){if(t.state===`error`)return t.error.message;if(e===`pipeline-status`){let e=D.safeParse(t.signal);return e.success?e.data.status===`failed`?`Pipeline failed`:void 0:`Invalid signal`}if(e===`pull-request-health`){let e=we.safeParse(t.signal);if(!e.success)return`Invalid signal`;if(e.data.status===`failed`)return e.data.summary;let n=e.data.incompleteObservations?.[0];return n?`${n.label}: ${n.message}`:void 0}if(e===`http-value`)return ke.safeParse(t.signal).success?void 0:`Invalid value`}}var A={diagnostics:`_diagnostics_lseur_1`,button:`_button_lseur_5`,area:`_area_lseur_14`,warning:`_warning_lseur_31`,panels:`_panels_lseur_35`,actions:`_actions_lseur_43`};function Be({log:e,updateActivity:t}){let[n,r]=o(!1);s(e.subscribe,e.snapshot,e.snapshot);let i=e.count(),a=e.githubConsistencyIncidentCount(),c=e.summary();return d(`section`,{className:A.diagnostics,children:[d(`button`,{className:A.button,type:`button`,"aria-expanded":n,onClick:()=>r(!n),children:[`Diagnostics (`,i,`)`,a>0&&` · GitHub consistency ${a}`]}),n&&d(`div`,{className:A.area,children:[d(`p`,{children:[`Client `,e.clientVersion(),` · assets `,e.assetPath()]}),d(`p`,{children:[c.retained.eventCount,` retained browser-local events across`,` `,c.retained.sessionCount,` session`,c.retained.sessionCount===1?``:`s`,c.retained.firstEventAt&&c.retained.lastEventAt?` (${Ve(c.retained.firstEventAt,c.retained.lastEventAt)})`:``,`. They are never uploaded.`]}),c.retained.evidenceMayBeIncomplete&&d(`p`,{className:A.warning,role:`alert`,children:[`Earlier evidence was pruned: `,c.retained.retention.eventsPrunedByCount,` at the 2,000-event cap and `,c.retained.retention.eventsPrunedByAge,` by the 7-day age limit. “No failures” applies only to the retained window.`]}),d(`p`,{children:[`Update failures: `,c.failures.clientUpdate,`; board fetch failures:`,` `,c.failures.boardFetch,`.`]}),e.githubConsistencyIncidentCount()>0&&d(`p`,{className:A.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.`]}),c.panels.length>0&&u(`div`,{className:A.panels,children:c.panels.map(e=>d(`p`,{children:[u(`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&&d(l,{children:[` `,`Failure: `,e.latestFailedObservation.reason,`. Support reference:`,` `,u(`code`,{children:e.latestFailedObservation.supportReference??`not provided`}),`.`]})]},e.panelId))}),d(`div`,{className:A.actions,children:[u(`button`,{className:A.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`}),u(`button`,{className:A.button,type:`button`,onClick:()=>{window.confirm(`Clear this browser’s retained dashboard diagnostics?`)&&e.clear()},children:`Clear`})]})]})]})}function Ve(e,t){return e===t?e:`${e} to ${t}`}var He=`0.30.2`;function j(e,t,n,r=globalThis.fetch,i={}){let a=new Headers(n?.headers);return a.set(`X-Dashboard-Client-Version`,He),a.set(`X-Dashboard-Client-Origin`,globalThis.window.location.origin),a.set(`X-Dashboard-Client-Asset-Id`,e.assetPathId),i.accessToken&&a.set(`authorization`,`Bearer ${i.accessToken}`),r(t,{...n,headers:a}).then(e=>((e.status===401||e.status===403)&&i.onAuthenticationFailure?.(e.status),e))}function Ue(){try{return window.localStorage}catch{return}}function We(e,t){try{let n=e?.getItem(t);return n?JSON.parse(n):void 0}catch{return}}function Ge(e,t,n){try{e?.setItem(t,JSON.stringify(n))}catch{}}function Ke(e,t){try{e?.removeItem(t)}catch{}}function qe(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 Je=`ze-great-dashboard.diagnostics.v2`,Ye=`ze-great-dashboard.diagnostics.v1`,Xe=2e3,Ze=6048e5,Qe=[`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`],$e=class{env;storage;now;events=[];retention=nt();revision=0;incidents=[];listeners=new Set;sessionId=crypto.randomUUID?.()??`${Date.now()}-${Math.random()}`;constructor(e,t=Ue(),n=()=>new Date){this.env=e,this.storage=t,this.now=n,Ke(this.storage,Ye),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=it([...this.events,{...e,schemaVersion:2,at:this.now().toISOString(),sessionId:this.sessionId,board:this.env.board,clientVersion:He,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=()=>He;assetPath=()=>this.env.assetPath;snapshot=()=>this.revision;summary=()=>qe(this.events,this.retention,this.incidents.length);retainedEvidence=()=>({events:[...this.events],retention:{...this.retention}});clear(){this.events=[],this.incidents=[],this.retention=nt(),Ke(this.storage,Je),this.revision++,this.notify()}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});export=e=>({schemaVersion:2,exportedAt:this.now().toISOString(),client:{version:He,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=We(this.storage,Je);if(!e||e.schemaVersion!==2||!Array.isArray(e.events)||!e.events.every(at))return Ke(this.storage,Je),[];let t=it(e.events.map(e=>({...e,schemaVersion:2})),this.now(),rt(e.retention));return this.retention=t.retention,this.incidents=et(e.githubConsistencyIncidents),t.events}persist(){Ge(this.storage,Je,{schemaVersion:2,events:this.events,retention:this.retention,githubConsistencyIncidents:this.incidents})}notify(){for(let e of this.listeners)e()}};function et(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 tt(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 nt(){return{eventsPrunedByAge:0,eventsPrunedByCount:0}}function rt(e){if(!e||typeof e!=`object`)return nt();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 it(e,t,n){let r=t.valueOf()-Ze,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-Xe);return{events:i.slice(-2e3),retention:{eventsPrunedByAge:n.eventsPrunedByAge+a,eventsPrunedByCount:n.eventsPrunedByCount+o}}}function at(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`&&Qe.includes(t.kind)}var ot={auth:`_auth_19xn9_1`,signout:`_signout_19xn9_24`},st=class{values=new Map;async set(e,t){this.values.set(e,t)}async get(e){return this.values.get(e)??null}async remove(e){let t=this.values.get(e)??null;return this.values.delete(e),t}async getAllKeys(){return[...this.values.keys()]}};function ct(e){return new m({authority:e.issuer,client_id:e.clientId,redirect_uri:`${window.location.origin}/`,post_logout_redirect_uri:`${window.location.origin}/`,response_type:`code`,scope:`openid profile offline_access`,resource:e.audience,extraQueryParams:{audience:e.audience},userStore:new st,stateStore:new h({store:window.sessionStorage}),automaticSilentRenew:!0})}function lt({env:e,auth:t,children:n}){let r=i(()=>ct(t),[t]);return u(f,{userManager:r,onSigninCallback:()=>window.history.replaceState({},document.title,window.location.pathname),children:u(ut,{env:e,children:n})})}function ut({env:e,children:t}){let i=p(),[a,s]=o(!1),c=n(()=>s(!0),[]);return r(()=>{i.isAuthenticated||s(!1)},[i.isAuthenticated]),i.isLoading?u(`main`,{className:ot.auth,"aria-live":`polite`,children:`Signing in…`}):a?d(`main`,{className:ot.auth,children:[u(`h1`,{children:`Access denied`}),u(`p`,{children:`Your authenticated identity is not permitted to view this dashboard.`})]}):!i.isAuthenticated||!i.user?.access_token?d(`main`,{className:ot.auth,children:[u(`h1`,{children:e.board}),u(`p`,{children:`Sign in to view the dashboard.`}),u(`button`,{type:`button`,onClick:()=>void i.signinRedirect(),children:`Sign in`})]}):d(l,{children:[u(`button`,{className:ot.signout,type:`button`,onClick:()=>void i.signoutRedirect(),children:`Sign out`}),t(i.user.access_token,c)]})}var M={panel:`_panel_j8o4e_1`,attentionActive:`_attentionActive_j8o4e_22`,content:`_content_j8o4e_26`,evidence:`_evidence_j8o4e_38`,sourceAction:`_sourceAction_j8o4e_42`,details:`_details_j8o4e_46`,statusBand:`_statusBand_j8o4e_54`,error:`_error_j8o4e_80`,wide:`_wide_j8o4e_83`,"density-comfortable":`_density-comfortable_j8o4e_86`,"density-compact":`_density-compact_j8o4e_93`,label:`_label_j8o4e_103`,typeGlyph:`_typeGlyph_j8o4e_114`,identityText:`_identityText_j8o4e_117`,hint:`_hint_j8o4e_123`,branch:`_branch_j8o4e_129`,observed:`_observed_j8o4e_133`,meta:`_meta_j8o4e_139`,metaValue:`_metaValue_j8o4e_142`,compactValue:`_compactValue_j8o4e_146`,warning:`_warning_j8o4e_149`,serious:`_serious_j8o4e_152`,status:`_status_j8o4e_54`,statusGlyph:`_statusGlyph_j8o4e_160`,compactOnlyStatus:`_compactOnlyStatus_j8o4e_163`,passed:`_passed_j8o4e_169`,failed:`_failed_j8o4e_172`,running:`_running_j8o4e_176`,cancelled:`_cancelled_j8o4e_179`,unknown:`_unknown_j8o4e_180`,shallow:`_shallow_j8o4e_213`,"density-auto":`_density-auto_j8o4e_214`,fullValue:`_fullValue_j8o4e_334`,statusText:`_statusText_j8o4e_429`};function dt({label:e,hint:t,wide:n=!1}){return d(`section`,{className:`${M.panel} ${n?M.wide:``}`,"data-panel":!0,"data-panel-id":`placeholder`,children:[u(`h2`,{className:M.label,children:e}),u(`p`,{className:M.hint,children:t})]})}function ft(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 N={fact:`_fact_bnc4n_1`,facts:`_facts_bnc4n_5`,factCell:`_factCell_bnc4n_12`,factSource:`_factSource_bnc4n_31`};function pt(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 mt={"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`}},ht={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 gt(e){return mt[e]}[...Object.entries(mt).map(([e,t])=>({glyph:t.glyph,meaning:`panel type: ${e}`})),...Object.entries(ht).map(([e,t])=>({glyph:t.glyph,meaning:`status: ${e}`}))];function P({children:e,className:t,title:n}){return u(`p`,{className:`${M.hint} ${t??``}`,title:n,children:e})}function F({glyph:e,label:t,value:n,compact:r,title:i,observed:a=!1,emphasis:o,className:s}){return d(`p`,{className:`${M.hint} ${a?M.observed:``} ${o?M[o]:``} ${M.meta} ${s??``}`,"data-panel-meta":!0,children:[u(`span`,{"aria-hidden":`true`,children:e}),` `,d(`span`,{className:`screen-reader-only`,children:[t,`: `]}),d(`span`,{className:M.metaValue,title:i,children:[u(`span`,{className:M.fullValue,children:n}),r&&u(`span`,{className:M.compactValue,"aria-hidden":`true`,children:r.kind===`short-value`?r.value:null})]})]})}function I({children:e,className:t,priority:n=`secondary`,anchor:r}){return u(`div`,{className:`${M.evidence} ${t??``}`,"data-panel-evidence":!0,"data-panel-evidence-priority":n,"data-panel-anchor":r,children:e})}function L({status:e,emphasis:t,glyph:n,label:r,compactOnly:i=!1}){return d(`p`,{className:`${M.status} ${e?M[e]:``} ${t?M[t]:``} ${i?M.compactOnlyStatus:``}`,"data-panel-status":!0,children:[n&&u(`span`,{className:M.statusGlyph,"aria-hidden":`true`,children:n}),n&&r&&` `,u(`span`,{className:M.statusText,children:r})]})}function _t({children:e,emphasis:t}){return u(`p`,{className:`${M.status} ${t?M[t]:``}`,children:e})}function R({panel:e,envelope:t,attentionActive:n=!1,error:r=!1,field:i,layout:a,children:o}){let s=e.density??`auto`,c=e.position,l=gt(e.type),f=c!==void 0&&c.h<=2,p=c!==void 0&&c.h<=3;return d(`section`,{className:`${M.panel} ${M[`density-${s}`]} ${f?M.shallow:``} ${p?M.short:``} ${r?M.error:``} ${n?M.attentionActive:``}`,id:`panel-${e.id}`,style:pt(e),"aria-busy":!t||void 0,"data-panel":!0,"data-panel-id":e.id,"data-panel-position":c?`${c.x},${c.y},${c.w},${c.h}`:void 0,"data-density":s,"data-shallow":f,"data-short":p,"data-error":r||void 0,"data-panel-type":e.type,"data-attention-active":n||void 0,children:[i,u(vt,{panelId:e.id,link:t?.link}),d(`div`,{className:`${M.content} ${a===`status-band`?M.statusBand:``}`,"data-panel-content":!0,"data-panel-layout":a,children:[d(`h2`,{className:M.label,"data-panel-anchor":`identity`,children:[l&&u(`span`,{className:M.typeGlyph,"aria-hidden":`true`,title:l.label,"data-panel-type-glyph":!0,children:l.glyph}),u(`span`,{className:M.identityText,"data-panel-identity-text":!0,children:e.label??e.id})]}),o]})]})}function vt({panelId:e,link:t}){return t?d(`a`,{className:M.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:[u(`span`,{"aria-hidden":`true`,children:`↗`}),u(`span`,{className:`screen-reader-only`,children:`View source`})]}):null}function z({value:e,label:t=`Observed`}){return u(xt,{value:e,label:t})}function yt({sourceUpdatedAt:e,observedAt:t,running:n,runStartedAt:r}){return n&&r?u(xt,{value:r,label:`Started`}):u(xt,{value:e??t,label:e?`Last update`:`Observed`})}function bt({health:e}){let t=e.consecutiveFailures>=3,n=t?`Updates unavailable`:`Updates delayed`;return d(l,{children:[u(F,{glyph:`⚠`,label:n,value:`${n} · ${e.message}`,title:e.message,emphasis:t?`serious`:`warning`}),u(xt,{value:e.lastConfirmedAt,label:`Last confirmed`})]})}function xt({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 u(F,{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 wt({panel:e,envelope:t,attentionActive:n,updateHealth:r,facts:i}){if(e.facts)return u(Tt,{panel:e,attentionActive:n,facts:i});if(!t)return u(R,{panel:e,attentionActive:n,children:u(I,{children:u(P,{children:`Loading…`})})});if(t.state===`error`){let r=ft(t.error.kind);return u(R,{panel:e,envelope:t,attentionActive:n,error:!0,children:d(I,{children:[u(L,{glyph:`⚠`,label:r.label,emphasis:r.emphasis}),u(P,{children:t.error.message})]})})}let a=ke.safeParse(t.signal);return a.success?u(R,{panel:e,envelope:t,attentionActive:n,children:d(I,{className:N.fact,children:[u(L,{glyph:`✓`,label:`Value read`,compactOnly:!0}),u(_t,{children:String(a.data.value)}),u(z,{value:t.observedAt}),r&&u(bt,{health:r})]})}):u(R,{panel:e,envelope:t,attentionActive:n,error:!0,children:u(I,{children:u(L,{glyph:`⚠`,label:`Invalid value`})})})}function Tt({panel:e,attentionActive:t,facts:n}){return e.facts?u(R,{panel:e,attentionActive:t,children:u(I,{children:u(`div`,{className:N.facts,"data-http-value-facts":!0,children:e.facts.map(e=>u(Et,{label:e.label,observation:n?.[e.id]},e.id))})})}):null}function Et({label:e,observation:t}){let n=t?.envelope;if(!n)return d(`section`,{className:N.factCell,"data-http-value-fact":!0,children:[u(`h3`,{children:e}),u(_t,{emphasis:t?.failure?`serious`:void 0,children:t?.failure?`⚠ Updates unavailable`:`Loading…`}),t?.updateHealth&&u(bt,{health:t.updateHealth})]});if(n.state===`error`){let t=ft(n.error.kind);return d(`section`,{className:N.factCell,"data-http-value-fact":!0,"data-error":!0,children:[u(Dt,{label:e,link:n.link}),u(`h3`,{children:e}),u(L,{glyph:`⚠`,label:t.label,emphasis:t.emphasis}),u(P,{children:n.error.message}),u(z,{value:n.observedAt})]})}let r=ke.safeParse(n.signal);return r.success?d(`section`,{className:N.factCell,"data-http-value-fact":!0,children:[u(Dt,{label:e,link:n.link}),u(`h3`,{children:e}),u(_t,{children:String(r.data.value)}),u(z,{value:n.observedAt})]}):d(`section`,{className:N.factCell,"data-http-value-fact":!0,"data-error":!0,children:[u(Dt,{label:e,link:n.link}),u(`h3`,{children:e}),u(L,{glyph:`⚠`,label:`Invalid value`,emphasis:`serious`}),u(z,{value:n.observedAt})]})}function Dt({label:e,link:t}){return t?d(`a`,{className:N.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:[u(`span`,{"aria-hidden":`true`,children:`↗`}),u(`span`,{className:`screen-reader-only`,children:`View source`})]}):null}var Ot={variant:`_variant_14ks8_1`,variantPrefix:`_variantPrefix_14ks8_9`},B={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`},kt=.85,At=[[{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 jt(e,t){return e>t?`horizontal`:`vertical`}function Mt(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 Nt(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 Pt(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 Ft(e,t,n){let r=At.filter(e=>Nt(e,t,n));return r[Wt(e,r.length)]??[{x:0,y:0}]}function It(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=>Pt(s,e))||!Ut(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<Ht(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[Wt(a,d.length)];return f?{x:f.x,y:f.y}:void 0}function Lt(e,t,n,r,i,a){let o=At.flatMap((o,s)=>{if(!Nt(o,t,n))return[];let c=It(o,e,t,n,r,i+s*31,a);return c?[{shape:o,destination:c}]:[]});if(o.length!==0)return o[Wt(i,o.length)]}function Rt(e,t,n){return Math.ceil(e*t*kt*Math.min(1,Math.max(0,n)))}function zt(e){return e.reduce((e,t)=>e+t.cells.length,0)}function Bt(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 Vt(e,t,n,r,i){let a=[];for(let o=0;o<i;o+=1){let i=r+o*17,s=Ft(i,t,n),c=It(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 Ht(e,t){return t===`vertical`?new Set(e.map(e=>e.x)).size:new Set(e.map(e=>e.y)).size}function Ut(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=>Pt({...i,y:e},t)))return!1;return i.y+s<=r}for(let e=n-o;e>=i.x;--e)if(a.some(t=>Pt({...i,x:e},t)))return!1;return i.x+o<=n}function Wt(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 Gt=50,Kt=1250,qt=250,Jt=850,Yt=500;function Xt({progress:e,estimatedDurationMs:t,overdue:n,seed:i=0}){let s=a(null),[c,l]=o({...Mt(`vertical`),direction:`vertical`}),[f,p]=o([]),[m,h]=o(!1),[g,_]=o([]),[v,y]=o(!1),b=a(c),x=a(c),S=a(e),C=a(i),w=a(void 0),T=a([]),ee=a(!1),E=a({startedAt:Date.now(),nextPieceAt:Kt,recycleUntil:0,id:0,settled:[]});return r(()=>{S.current=e},[e]),r(()=>{C.current=i},[i]),r(()=>{let e=s.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect();t.width!==0&&t.height!==0&&l(e=>{let n=w.current??jt(t.width,t.height);w.current=n;let r={...Mt(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()},[]),r(()=>{let e=window.matchMedia(`(prefers-reduced-motion: reduce)`),t=()=>y(e.matches);return t(),e.addEventListener?.(`change`,t),()=>e.removeEventListener?.(`change`,t)},[]),r(()=>{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:Kt,id:0,recycleUntil:0,settled:[]},T.current=[],p([]),h(!1),_([]),ee.current=!1)},[c,v]),r(()=>{if(!v)return;let e=Vt(c.direction,c.columns,c.rows,C.current,Math.max(1,Math.floor(S.current*6)));T.current=e,E.current.settled=e,p(e)},[c,v]),r(()=>{if(v)return;let e=window.setInterval(()=>{let e=E.current,r=Date.now()-e.startedAt,i=b.current,a=S.current,o=Rt(i.columns,i.rows,a),s=[...e.settled],c=T.current.filter(e=>e.phase!==`settled`);if(r<e.recycleUntil)return;if(ee.current&&(ee.current=!1,h(!1),_([])),r>=e.nextPieceAt&&c.length===0){if(a<1&&zt(s)>=o)return;let l=e.id,u=C.current+l*17,d=Lt(i.direction,i.columns,i.rows,s,u+1,!n);if(!d&&(a>=1||t===void 0)){let t=Bt(i.direction,i.columns,i.rows,s,!0);if(t){s=t.shapes,e.settled=s,e.recycleUntil=r+Yt,e.nextPieceAt=e.recycleUntil,T.current=s,ee.current=!0,_(t.cleared),p(s),h(!0);return}}if(d){e.id+=1;let{shape:t,destination:n}=d,a=Math.max(...t.map(e=>e.y))+1;c=[...c,{id:l,bornAt:r,cells:t,x:i.direction===`horizontal`?i.columns-Math.max(...t.map(e=>e.x))-.5:n.x,y:i.direction===`vertical`?-a+.5:n.y,targetX:n.x,targetY:n.y,phase:`entry`}]}e.nextPieceAt+=Zt(t,i)}c=c.map(e=>{let t=r-e.bornAt,n=e.targetX===void 0||e.targetY===void 0?void 0:{x:e.targetX,y:e.targetY};if(!n)return e;let a=Math.min(1,Math.max(0,(t-qt)/Jt));if(a>=1)return s=[...s,{...e,x:n.x,y:n.y,phase:`settled`}],{...e,x:n.x,y:n.y,phase:`settled`};let o=i.direction===`horizontal`?i.columns-Math.max(...e.cells.map(e=>e.x))-1:n.x,c=i.direction===`vertical`?0:n.y,l=Math.min(1,Math.max(0,t/1100));return{...e,x:i.direction===`horizontal`?o+(n.x-o)*a:o,y:i.direction===`vertical`?c+(n.y-c)*a:c,phase:t<qt?`entry`:l<.35?`align`:`travel`}}),e.settled=s;let l=[...s,...c.filter(e=>e.phase!==`settled`)];T.current=l,p(l)},Gt);return()=>window.clearInterval(e)},[t,n,v]),u(`div`,{ref:s,className:B.field,"data-running-part":`falling-shapes-field`,"data-overdue":n||void 0,"data-direction":c.direction,"data-recycling":m||void 0,style:{"--shape-columns":c.columns,"--shape-rows":c.rows},children:d(`div`,{className:B.grid,children:[g.map(e=>u(`span`,{className:B.clearingCell,style:{"--clear-x":e.x,"--clear-y":e.y}},`${e.x}-${e.y}`)),f.map(e=>u(`div`,{className:B.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=>u(`span`,{className:B.cell,style:{"--cell-x":e.x,"--cell-y":e.y}},`${e.x}-${e.y}`))},e.id))]})})}function Zt(e,t){let n=Math.ceil(t.columns*t.rows*.85);return e===void 0||n<=0?Kt:Math.max(400,e/Math.max(1,Math.ceil(n/3)))}var V={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 Qt(){return d(l,{children:[u(`span`,{className:V.frontier,"data-running-part":`frontier`}),u(`span`,{className:V.now,"data-running-part":`transit-now`}),u(`span`,{className:V.routes,"data-running-part":`transit-routes`,children:[0,1,2].map(e=>u(`span`,{className:V.route},e))}),u(`span`,{className:V.trail,"data-running-part":`transit-trail`}),u(`span`,{className:V.packet,"data-running-part":`transit-packet`})]})}var $t={field:`_field_1i9kx_1`,overdue:`_overdue_1i9kx_11`,timing:`_timing_1i9kx_14`,timingOverdue:`_timingOverdue_1i9kx_28`},en={field:`_field_ozs8n_1`,canvas:`_canvas_ozs8n_7`};function tn(e){let t=e*.25,n=e*.2,r=t<700||n<350?`snowfall`:n<530?`arrival`:n<1030?`hop`:`full`,i=nn((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 H(e,t,n){return n===t?Number(e>=n):nn((e-t)/(n-t),0,1)}function U(e){return e*e*(3-2*e)}function nn(e,t,n){return Math.max(t,Math.min(n,e))}var W=25,rn=.5,an=.95;function on(e={width:360,height:180}){return{nextAt:0,id:0,lastElapsed:0,grid:sn(e),flakes:[],cells:[],toppled:!1}}function sn(e){return{columns:Rn(Math.round(e.width/4),48,180),rows:Rn(Math.round(e.height/4),28,100)}}function cn(e,t,n){return n?`overdue`:t===void 0||tn(t).mode===`snowfall`?`snowing`:e>=an?`complete`:e>=rn?`assembling`:`drift`}function ln(e,t){let n=K(e+41)<.5?-1:1,r=n*(.72+K(e+43)*.45),i=Math.sin(t/1600+K(e+47)*Math.PI*2)*.4,a=n*Math.max(0,Math.sin(t/3100+K(e+53)*Math.PI*2))**7*(3.2+K(e+59)*1.8);return r+i+a}function un(e){let t=sn(e);return Math.round(t.columns*t.rows*.18)}function dn(e,t,n=!1,r=0){if(e===void 0)return n?30:60;let i=e*an/un(t);if(n)return i/2;let a=tn(e);return a.mode!==`snowfall`&&r>=Math.max(0,a.bodyStart-500)?i*4:i}function fn(e,{elapsed:t,progress:n,estimatedDurationMs:r,overdue:i,seed:a,dimensions:o}){let s=sn(o),c=e.grid.columns===s.columns&&e.grid.rows===s.rows?Ln(e):on(o),l=Math.max(c.lastElapsed,t);for(let e=c.lastElapsed+W;e<=l;e+=W)c=hn(c,e,r===void 0?n:e/r,r,i&&(r===void 0||e>=r),a,o),c.lastElapsed=e;return c}function pn(e){return e.filter(e=>e.owner===`snowman`).length}function mn(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`?In(r,e.toppling):r})}function hn(e,t,n,r,i,a,o){let s=cn(n,r,i),c=dn(r,o,i,t);for(;t>=e.nextAt;)e.flakes.push({id:e.id++,x:K(a+e.id*17)*e.grid.columns,y:-1-K(a+e.id*23)*6,bornAt:e.nextAt}),e.nextAt+=c;gn(e,n,r,i);let l=kn(e),u=ln(a,t)*(W/1e3),d=r===void 0?.52:Math.max(.52,(e.grid.rows+7)*W/(r*.25)),f=[];for(let t of e.flakes){let n={...t,x:t.x+u,y:t.y+d},r=bn(e,n);if(r){xn(e,r,t.id,n.x-r.x,n.y-r.y);continue}let i=jn(n,l,e.grid,u,a);if(!i){f.push({...n,x:Rn(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`&&vn(e),wn(e),An(e,a,t),An(e,a,t+W/2);let p=e.body;return p?.locked&&(p.supportY??=Mn(e,p.x,p.radius,p.y+p.radius),p.y=p.supportY),i&&!e.toppling&&!e.toppled&&pn(e.cells)>=60&&Pn(e,t),Fn(e,t),e}function gn(e,t,n,r){if(n===void 0)return;let i=tn(n);if(i.mode===`snowfall`)return;let a=t*n,{columns:o,rows:s}=e.grid,c=U(H(a,i.bodyStart,i.bodyEnd));if(a>=i.bodyStart&&!e.body){let t=o*.14;e.body={kind:`body`,x:t,y:Mn(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,Nn(e,`body`,2));let t=o*(.14+.38*c);_n(l,t,Mn(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:Mn(e,t,1.7,s-1),radius:1.7,angle:0,locked:!1},vn(e)}let u=e.head;if(u&&l&&!u.locked){if(u.radius=Math.max(u.radius,Nn(e,`head`,1.7)),a<i.hopStart){let t=o*(.88-.22*U(H(a,i.headStart,i.hopStart)));_n(u,t,Mn(e,t,u.radius,s-1))}else{u.launch??={x:u.x,y:u.y};let e=H(a,i.hopStart,i.land),t=l.y-l.radius-u.radius+.5;if(u.x=u.launch.x+(l.x-u.launch.x)*U(e),u.y=u.launch.y+(t-u.launch.y)*U(e)-Math.sin(Math.PI*e)*Math.max(5,l.radius*1.5),a>=i.land){let e=H(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=H(a,i.land,i.end);e.hat={x:u.x,y:u.y-u.radius-1-5*(1-t*t),angle:(1-U(t))*-.22}}}function _n(e,t,n){let r=zn(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 vn(e){let t=mn(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(!yn(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&&xn(e,r,l.id,t,s)}r.radius=Math.max(r.radius,Nn(e,a,r.kind===`body`?2:1.7))}}function yn(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 bn(e,t){return[e.body,e.head].filter(e=>e!==void 0&&!e.locked).find(n=>yn(e,n)&&Math.hypot(t.x-n.x,t.y-n.y)<=n.radius)}function xn(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,Nn(e,t.kind,t.kind===`body`?2:1.7)),Tn(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=K(n*31+e*17)*Math.PI*2,a=Math.sqrt(K(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+K(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 wn(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=zn(t.localX,t.targetLocalX,.25),n=zn(t.localY,t.targetLocalY,.25);t.localX=e,t.localY=n,t.packed=e===t.targetLocalX&&n===t.targetLocalY}}function Tn(e,t){let n=e.cells.filter(e=>e.owner===t.kind&&e.localX!==void 0&&e.localY!==void 0),r=En(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 En(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 Dn(e){if(e.hat)return e.toppling?{...In(e.hat,e.toppling),angle:e.hat.angle+e.toppling.angle}:e.hat}function On(e,t,n){let r=Ln(t),i=(e,t)=>e+(t-e)*Rn(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 kn(e){let t=new Map;for(let n of mn(e))t.set(G(Math.round(n.x),Math.round(n.y)),n.owner);return t}function An(e,t,n){let r=kn(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=K(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 jn(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=K(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 Mn(e,t,n,r){let i=mn(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 Nn(e,t,n){let r=e.cells.filter(e=>e.owner===t).length;return n+Math.sqrt(r/Math.PI)*.5}function Pn(e,t){let n=e.body;n&&(e.toppling={startedAt:t,angle:0,pivotX:n.x,pivotY:n.y+n.radius*.72})}function Fn(e,t){let n=e.toppling;if(!n)return;let r=Rn((t-n.startedAt)/750,0,1);n.angle=(1-(1-r)**3)*(Math.PI/2),r===1&&(e.toppled=!0)}function In(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 Ln(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 Rn(e,t,n){return Math.max(t,Math.min(n,e))}function zn(e,t,n){return Math.abs(t-e)<=n?t:e+Math.sign(t-e)*n}function K(e){let t=Math.sin(e*12.9898)*43758.5453;return t-Math.floor(t)}function Bn(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 mn(t))Vn(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)Vn(r,(e.x+.5)*s,(e.y+.5)*c,s*.72,c*.72);let l=Dn(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 Vn(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 Hn({progress:e,estimatedDurationMs:t,overdue:n,seed:i=0}){let s=a(null),c=a(null),[l,d]=o({width:360,height:180}),[f,p]=o(()=>window.matchMedia(`(prefers-reduced-motion: reduce)`).matches),m=a(e),h=a(n),g=a({startedAt:Date.now(),progressAt:Date.now(),progress:e,simulation:on()});r(()=>{m.current=e,g.current.progressAt=Date.now(),g.current.progress=e},[e]),r(()=>{h.current=n},[n]),r(()=>{let e=window.matchMedia(`(prefers-reduced-motion: reduce)`),t=()=>p(e.matches);return t(),e.addEventListener?.(`change`,t),()=>e.removeEventListener?.(`change`,t)},[]),r(()=>{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()},[]),r(()=>{if(f)return;g.current.simulation=on(l);let e=0,n=()=>{let r=g.current,a=t===void 0?Date.now()-r.startedAt:r.progress*t+(Date.now()-r.progressAt),o={progress:m.current,estimatedDurationMs:t,overdue:h.current,seed:i,dimensions:l},u=fn(r.simulation,{...o,elapsed:a});r.simulation=u;let d=On(u,fn(u,{...o,elapsed:u.lastElapsed+25}),(a-u.lastElapsed)/25);Bn(c.current,d,l);let p=s.current;p&&(p.dataset.snowCellCount=String(u.cells.length),p.dataset.snowDensity=u.grid.columns<65?`compact`:`full`,u.toppled?p.dataset.snowmanToppled=`true`:delete p.dataset.snowmanToppled),f||(e=window.requestAnimationFrame(n))};return e=window.requestAnimationFrame(n),()=>window.cancelAnimationFrame(e)},[l,t,f,i]),r(()=>{if(!f)return;let r=fn(on(l),{elapsed:t===void 0?4800:e*t,progress:e,estimatedDurationMs:t,overdue:n,seed:i,dimensions:l});Bn(c.current,r,l),s.current&&(s.current.dataset.snowCellCount=String(r.cells.length),r.toppled?s.current.dataset.snowmanToppled=`true`:delete s.current.dataset.snowmanToppled)},[l,t,n,e,f,i]);let _=cn(e,t,n);return u(`div`,{ref:s,className:en.field,"data-running-part":`snowman-field`,"data-snowman-phase":_,"data-reduced-motion":f||void 0,children:u(`canvas`,{ref:c,className:en.canvas,"data-running-part":`snowman-canvas`})})}var q={haze:`_haze_3npie_1`,pressure:`_pressure_3npie_17`,band:`_band_3npie_20`,bandOne:`_bandOne_3npie_33`,bandTwo:`_bandTwo_3npie_36`,bandThree:`_bandThree_3npie_40`,drift:`_drift_3npie_45`,driftOne:`_driftOne_3npie_54`,driftTwo:`_driftTwo_3npie_58`,driftThree:`_driftThree_3npie_67`,driftFour:`_driftFour_3npie_76`,driftFive:`_driftFive_3npie_85`,"storm-band":`_storm-band_3npie_1`};function Un(){return d(l,{children:[u(`span`,{className:q.haze,"data-running-part":`weather-haze`}),u(`span`,{className:q.pressure,"data-running-part":`weather-pressure`}),u(`span`,{className:`${q.band} ${q.bandOne}`}),u(`span`,{className:`${q.band} ${q.bandTwo}`}),u(`span`,{className:`${q.band} ${q.bandThree}`}),u(`span`,{className:`${q.drift} ${q.driftOne}`}),u(`span`,{className:`${q.drift} ${q.driftTwo}`}),u(`span`,{className:`${q.drift} ${q.driftThree}`}),u(`span`,{className:`${q.drift} ${q.driftFour}`}),u(`span`,{className:`${q.drift} ${q.driftFive}`})]})}var Wn={anchor:`_anchor_1bd86_1`,body:`_body_1bd86_6`,"phased-marker":`_phased-marker_1bd86_1`};function Gn({anchorClassName:e,bodyClassName:t,delay:n,anchorPart:r,bodyPart:i}){let a=n?{"--phased-marker-delay":n}:void 0;return u(`span`,{className:`${Wn.anchor} ${e??``}`,"data-running-part":r,children:u(`span`,{className:`${Wn.body} ${t??``}`,"data-running-part":i,style:a})})}var J={frontier:`_frontier_2wwhn_1`,flare:`_flare_2wwhn_12`,lanes:`_lanes_2wwhn_15`,lane:`_lane_2wwhn_15`,markerAnchor:`_markerAnchor_2wwhn_31`,markerBody:`_markerBody_2wwhn_35`,"bloom-flare":`_bloom-flare_2wwhn_1`};function Kn(){return d(l,{children:[u(`span`,{className:J.frontier,"data-running-part":`frontier`}),u(`span`,{className:J.flare,"data-running-part":`bloom-flare`}),u(`span`,{className:J.lanes,"data-running-part":`bloom-lanes`,children:[0,1,2,3].map(e=>u(`span`,{className:J.lane,"data-running-part":`bloom-lane`,children:u(Gn,{anchorClassName:J.markerAnchor,bodyClassName:J.markerBody,delay:[void 0,`-0.8s`,`-1.7s`,`-2.4s`][e],anchorPart:`bloom-marker-anchor`,bodyPart:`bloom-marker`})},e))})]})}function qn(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 d(`div`,{className:`${$t.field} ${r?$t.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`&&u(Kn,{}),e===`release-transit`&&u(Qt,{}),e===`status-weather`&&u(Un,{}),e===`falling-shapes`&&u(Xt,{progress:t,estimatedDurationMs:n,overdue:r,seed:a}),e===`snowman`&&u(Hn,{progress:t,estimatedDurationMs:n,overdue:r,seed:a})]})}var Yn=20;function Xn(e,t){let n=Zn(!!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 Zn(e){let[t,n]=o(()=>Date.now());return r(()=>{if(!e)return;n(Date.now());let t=window.setInterval(()=>n(Date.now()),Yn);return()=>window.clearInterval(t)},[e]),t}function Qn(e,t,n){return`${e===void 0?`Run in progress`:`Elapsed ${er(e)}`} · ${t===void 0?`Expected duration unavailable`:`Expected ≈ ${er(t)}`}${n?` · Over estimate`:``}`}function $n(e,t,n){let r=e===void 0?`—`:tr(e),i=t===void 0?`?`:`~${tr(t)}`;return`${n?`⚠`:`\xA0`}${r}/${i}`}function er(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 tr(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 nr({elapsedMs:e,estimatedDurationMs:t,overdue:n}){return d(`p`,{className:`${$t.timing} ${n?$t.timingOverdue:``}`,children:[u(`span`,{className:`screen-reader-only`,children:Qn(e,t,n)}),u(`span`,{"aria-hidden":`true`,children:$n(e,t,n)})]})}var Y={progress:`_progress_1x79l_1`,visual:`_visual_1x79l_8`,timing:`_timing_1x79l_12`,overdue:`_overdue_1x79l_17`,readout:`_readout_1x79l_23`,radial:`_radial_1x79l_31`,sweep:`_sweep_1x79l_1`,"alarm-ring":`_alarm-ring_1x79l_1`,radialCore:`_radialCore_1x79l_58`,"reactor-breathe":`_reactor-breathe_1x79l_1`,runway:`_runway_1x79l_70`,"barrier-pulse":`_barrier-pulse_1x79l_1`,spark:`_spark_1x79l_114`,sparkTwo:`_sparkTwo_1x79l_128`,orbit:`_orbit_1x79l_135`,orbitCore:`_orbitCore_1x79l_151`,particle:`_particle_1x79l_163`,particleTwo:`_particleTwo_1x79l_174`,"gravity-well":`_gravity-well_1x79l_1`,indeterminate:`_indeterminate_1x79l_191`,shift:`_shift_1x79l_1`,signalField:`_signalField_1x79l_199`,rail:`_rail_1x79l_217`,lead:`_lead_1x79l_223`,pulse:`_pulse_1x79l_233`,pulseTwo:`_pulseTwo_1x79l_244`,tracks:`_tracks_1x79l_247`,sparkWide:`_sparkWide_1x79l_1`,track:`_track_1x79l_247`,markerAnchor:`_markerAnchor_1x79l_371`,markerBody:`_markerBody_1x79l_375`,"endpoint-pulse":`_endpoint-pulse_1x79l_1`,short:`_short_1x79l_413`};function rr({animation:e,timing:t}){let{elapsedMs:n,estimatedDurationMs:r,hasEstimate:i,overdue:a,progress:o}=t,s=e===`runway`||e===`signal-field`,c=Qn(n,r,a),f={"--running-progress":`${o*100}%`,"--running-degrees":`${o*360}deg`},p=e===`signal-field`?Y.signalField:Y[e];return d(`div`,{className:`${Y.progress} ${p} ${a?Y.overdue:``} ${i?``:Y.indeterminate}`,style:f,"data-running-progress":e,"data-overdue":a||void 0,"data-indeterminate":!i||void 0,children:[d(`div`,{className:Y.visual,"aria-hidden":`true`,"data-running-visual":!0,children:[e===`radial`&&u(`span`,{className:Y.radialCore}),e===`runway`&&d(l,{children:[u(`span`,{className:Y.spark,"data-running-part":`runway-spark`}),u(`span`,{className:`${Y.spark} ${Y.sparkTwo}`,"data-running-part":`runway-spark-two`})]}),e===`orbit`&&d(l,{children:[u(`span`,{className:Y.orbitCore}),u(`span`,{className:Y.particle}),u(`span`,{className:`${Y.particle} ${Y.particleTwo}`})]}),e===`signal-field`&&d(l,{children:[u(`span`,{className:Y.rail}),u(`span`,{className:Y.lead}),u(`span`,{className:Y.pulse}),u(`span`,{className:`${Y.pulse} ${Y.pulseTwo}`}),u(`span`,{className:Y.tracks,"data-running-part":`signal-tracks`,children:[0,1,2,3,4].map(e=>u(`span`,{className:Y.track,"data-running-part":`signal-track`,children:u(Gn,{anchorClassName:Y.markerAnchor,bodyClassName:Y.markerBody,delay:[void 0,`-0.8s`,`-1.7s`,`-2.4s`,`-0.35s`][e],anchorPart:`signal-marker-anchor`,bodyPart:`signal-marker`})},e))})]})]}),u(`p`,{className:`${Y.timing} ${s?Y.readout:``}`,children:s?d(l,{children:[u(`span`,{className:`screen-reader-only`,children:c}),u(`span`,{"aria-hidden":`true`,children:$n(n,r,a)})]}):c})]})}function ir(e){return[`radial`,`runway`,`orbit`,`signal-field`].includes(e)}function ar(e){return Array.from(e).reduce((e,t)=>e*31+t.charCodeAt(0)>>>0,7)}var or=2e4,sr=15e3,cr=3e5,lr=1.25,ur=[`radial`,`runway`,`orbit`,`signal-field`,`telemetry-bloom`,`release-transit`,`status-weather`,`falling-shapes`,`snowman`];function dr({panel:e}){let t=mr(),n=e.running_animation===void 0||e.running_animation===`off`?void 0:e.running_animation,r=fr(e.demo_run_duration,or),i=fr(e.demo_review_duration,cr),a=n?Math.ceil(i*lr):r,o=Math.floor(t/a),s=n??ur[o%ur.length]??`radial`,c=o*a;return u(pr,{panel:e,animation:s,runStartedAt:c,estimatedDurationMs:n?i:sr})}function fr(e,t){return e?v(e)??t:t}function pr({panel:e,animation:t,runStartedAt:n,estimatedDurationMs:r}){let i=Xn(new Date(n).toISOString(),r),a=qn(t);return u(R,{panel:e,field:a?u(Jn,{animation:t,progress:i.progress,estimatedDurationMs:i.estimatedDurationMs,overdue:i.overdue,indeterminate:!i.hasEstimate,seed:ar(e.id)},`${t}-${n}`):void 0,children:d(I,{children:[u(L,{status:`running`,glyph:`↻`,label:`Running`}),d(`p`,{className:Ot.variant,children:[u(`span`,{className:Ot.variantPrefix,children:`Demo treatment · `}),t]}),a?u(nr,{elapsedMs:i.elapsedMs,estimatedDurationMs:r,overdue:i.overdue}):u(rr,{animation:t,timing:i})]})})}function mr(){let[e,t]=o(()=>Date.now());return r(()=>{let e=window.setInterval(()=>t(Date.now()),1e3);return()=>window.clearInterval(e)},[]),e}var X={details:`_details_19avj_1`,activity:`_activity_19avj_7`,duration:`_duration_19avj_8`};function hr(e,t=`Passed`){let n=ht[e];return e===`passed`?{...n,label:t}:n}function gr(e){return e?e.parent?`${e.parent} › ${e.name}`:e.name:`Activity unavailable`}function _r({panel:e,envelope:t,attentionActive:n,updateHealth:r}){if(!t)return u(R,{panel:e,attentionActive:n,children:u(I,{children:u(P,{children:`Loading…`})})});if(t.state===`error`){let r=ft(t.error.kind);return d(R,{panel:e,envelope:t,attentionActive:n,error:!0,layout:`status-band`,children:[u(`div`,{"data-panel-anchor":`status`,children:u(L,{glyph:`⚠`,label:r.label,emphasis:r.emphasis})}),u(I,{anchor:`evidence`,children:u(P,{children:t.error.message})})]})}let i=D.safeParse(t.signal);return i.success?u(vr,{panel:e,envelope:t,signal:i.data,updateHealth:r,attentionActive:n}):d(R,{panel:e,envelope:t,attentionActive:n,error:!0,layout:`status-band`,children:[u(`div`,{"data-panel-anchor":`status`,children:u(L,{glyph:`⚠`,label:`Invalid signal`})}),u(I,{anchor:`evidence`,children:u(P,{children:`The received pipeline status could not be read.`})})]})}function vr({panel:e,envelope:t,signal:n,updateHealth:r,attentionActive:i}){let s=hr(n.status),[c,l]=o(()=>n.status===`running`?yr():void 0),f=a(n.status);if(n.status!==f.current){let t=f.current===`running`;f.current=n.status,e.running_animation===void 0&&!t&&n.status===`running`&&l(e=>yr(e))}let p=e.running_animation??c??`off`,m=n.status===`running`&&p!==`off`,h=Xn(n.runStartedAt,n.estimatedDurationMs),g=m&&qn(p),_=m&&ir(p);return d(R,{panel:e,envelope:t,attentionActive:i,layout:g||_?void 0:`status-band`,field:g?u(Jn,{animation:p,progress:h.progress,estimatedDurationMs:h.estimatedDurationMs,overdue:h.overdue,indeterminate:!h.hasEstimate,seed:ar(e.id)}):void 0,children:[u(`div`,{"data-panel-anchor":`status`,children:u(L,{status:n.status,glyph:s.glyph,label:s.label})}),d(I,{className:X.details,anchor:`evidence`,children:[n.status===`running`&&u(F,{glyph:`⚙`,label:`Activity`,value:gr(n.activity),compact:{kind:`glyph-only`},title:`Activity: ${gr(n.activity)}`,className:X.activity}),n.branch&&u(F,{glyph:`⎇`,label:`Branch`,value:u(`span`,{className:X.branch,children:n.branch}),compact:{kind:`short-value`,value:u(`span`,{className:X.branch,children:n.branch})},title:`Branch: ${n.branch}`}),g&&u(nr,{elapsedMs:h.elapsedMs,estimatedDurationMs:n.estimatedDurationMs,overdue:h.overdue}),_&&u(rr,{animation:p,timing:h}),n.status!==`running`&&n.durationMs!==void 0&&u(F,{glyph:`◷`,label:`Duration`,value:`Took ${br(n.durationMs)}`,compact:{kind:`short-value`,value:br(n.durationMs)},title:`Duration: Took ${br(n.durationMs)}`,className:X.duration}),u(yt,{sourceUpdatedAt:n.sourceUpdatedAt,observedAt:t.observedAt,running:n.status===`running`,runStartedAt:n.runStartedAt}),r&&u(bt,{health:r})]})]})}function yr(e){let t=E.filter(t=>t!==e);return t[Math.floor(Math.random()*t.length)]??`telemetry-bloom`}function br(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 xr(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 Sr({panel:e,envelope:t,attentionActive:n,updateHealth:r}){if(!t)return u(R,{panel:e,attentionActive:n,children:u(I,{children:u(P,{children:`Loading…`})})});if(t.state===`error`){let r=ft(t.error.kind);return d(R,{panel:e,envelope:t,attentionActive:n,error:!0,layout:`status-band`,children:[u(`div`,{"data-panel-anchor":`status`,children:u(L,{glyph:`⚠`,label:r.label,emphasis:r.emphasis})}),u(I,{anchor:`evidence`,children:u(P,{children:t.error.message})})]})}let i=we.safeParse(t.signal);if(!i.success)return d(R,{panel:e,envelope:t,attentionActive:n,error:!0,layout:`status-band`,children:[u(`div`,{"data-panel-anchor":`status`,children:u(L,{glyph:`⚠`,label:`Invalid signal`})}),u(I,{anchor:`evidence`,children:u(P,{children:`The received pull-request health status could not be read.`})})]});let a=hr(i.data.status,`Healthy`),o=xr(i.data);return d(R,{panel:e,envelope:t,attentionActive:n,layout:`status-band`,children:[u(`div`,{className:Z.statusAnchor,"data-panel-anchor":`status`,children:u(L,{status:i.data.status,glyph:a.glyph,label:a.label})}),d(`div`,{className:Z.evidence,"data-panel-anchor":`evidence`,"data-panel-evidence-priority":`secondary`,children:[u(P,{className:Z.fullSummary,title:i.data.summary,children:i.data.summary}),d(`div`,{className:Z.compactFacts,title:o.title,"data-compact-facts":!0,children:[o.primaryDetail&&d(`p`,{className:Z.failedItem,title:o.primaryDetail,children:[u(`span`,{"aria-hidden":`true`,children:`⚠`}),` `,d(`span`,{className:`screen-reader-only`,children:[o.primaryKind===`warning`?`Warning`:`Failed`,` item:`,` `]}),o.primary,d(`span`,{className:`screen-reader-only`,children:[`. Detail: `,o.primaryDetail]})]}),u(F,{glyph:`⚙`,label:`Update workflows`,value:o.workflow,compact:{kind:`short-value`,value:i.data.workflows.length},title:`Update workflows: ${o.workflow}`,className:Z.compactFact}),u(F,{glyph:`⎇`,label:`Open update pull requests`,value:o.pullRequests,compact:{kind:`short-value`,value:i.data.pullRequests.length},title:`Open update pull requests: ${o.pullRequests}`,className:Z.compactFact})]}),d(`div`,{className:Z.freshness,children:[u(z,{value:t.observedAt,label:`Observed (oldest evidence)`}),i.data.newestObservedAt&&d(`span`,{className:`screen-reader-only`,children:[`Newest evidence observed `,i.data.newestObservedAt,`.`]}),r&&u(bt,{health:r})]}),i.data.incompleteObservations&&u(`div`,{role:`status`,children:d(P,{className:Z.incomplete,children:[`⚠ Incomplete observations:`,` `,i.data.incompleteObservations.map(({label:e,message:t})=>`${e}: ${t}`).join(` · `)]})})]})]})}var Cr={"pipeline-status":_r,"pull-request-health":Sr,"http-value":wt,"pipeline-animation-demo":dr};function wr({panel:e,envelope:t,attentionActive:n,updateHealth:r,facts:i}){let a=Cr[e.type];return a?u(a,{panel:e,envelope:t,attentionActive:n,updateHealth:r,facts:i}):u(dt,{label:e.type,hint:`Not wired yet`,wide:!0})}var Tr={notice:`_notice_1h5h0_1`,blocked:`_blocked_1h5h0_18`},Er=`https://github.com/robertfmurdock/ze-great-dashboard/blob/main/docs/oidc-authentication.md`;function Dr({mode:e}){return e===`blocked`?d(`main`,{className:Tr.blocked,role:`alert`,children:[u(`h1`,{children:`⚠ Authentication configuration required`}),u(`p`,{children:`This dashboard is blocked because authentication is required but has not been configured.`}),u(`p`,{children:`No dashboard data was loaded.`}),d(`p`,{children:[u(`a`,{href:Er,children:`Read the authentication setup guide`}),`.`]})]}):d(`aside`,{className:Tr.notice,role:`alert`,"aria-label":`Unauthenticated deployment warning`,children:[u(`span`,{"aria-hidden":`true`,children:`⚠`}),d(`span`,{children:[u(`strong`,{children:`This deployment has no authentication.`}),` If this is reachable on a public network and reveals important information, take it down now. Configure the board’s`,` `,u(`code`,{children:`auth`}),` block and `,u(`code`,{children:`security: required`}),`, or set`,` `,u(`code`,{children:`security: unsecured`}),` to explicitly acknowledge intentional public access.`,` `,u(`a`,{href:Er,children:`Read the authentication setup guide`}),`.`]})]})}var $={trigger:`_trigger_g9eon_1`,close:`_close_g9eon_2`,dialog:`_dialog_g9eon_11`,dialogHeader:`_dialogHeader_g9eon_22`,note:`_note_g9eon_32`,empty:`_empty_g9eon_33`,body:`_body_g9eon_43`,legend:`_legend_g9eon_48`,axis:`_axis_g9eon_57`,lanes:`_lanes_g9eon_64`,lane:`_lane_g9eon_64`,laneLabel:`_laneLabel_g9eon_75`,track:`_track_g9eon_78`,observed:`_observed_g9eon_85`,expected:`_expected_g9eon_86`},Or=6e5;function kr({schedules:e,events:t,retention:n,now:r=new Date}){let i=r.valueOf(),a=i-Or,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 Ar(e,t){return Math.max(0,Math.min(100,(Date.parse(e)-(t.valueOf()-Or))/Or*100))}function jr(e,t){return`${e.label}, panel ${e.panelId}; ${Mr(e.cadence)} cadence; ${e.inFlight?`request in flight`:e.nextDueAt?Nr(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 Mr(e){return e===`completion-window`?`Completion-window`:e===`running`?`Running`:`Normal`}function Nr(e,t){let n=Date.parse(e)-t.valueOf();return n<0?`Overdue by ${Pr(-n)}`:`Next poll in ${Pr(n)}`}function Pr(e){return e%6e4==0?`${Math.round(e/6e4)}m`:`${Math.max(1,Math.round(e/1e3))}s`}function Fr({board:e,schedules:t,log:n}){let[c,f]=o(()=>new Date),[p,m]=o(!1),h=a(null),g=a(null),_=a(null),v=a(!1);s(n.subscribe,n.snapshot,n.snapshot),r(()=>{if(!p)return;let e=window.setInterval(()=>f(new Date),1e3);return()=>window.clearInterval(e)},[p]);let y=i(()=>kr({schedules:t,...n.retainedEvidence(),now:c}),[n,c,t]);return r(()=>{if(!p){v.current&&h.current?.focus(),v.current=!1;return}v.current=!0;let e=()=>m(!1),t=window.setTimeout(e,6e4),n=()=>{window.clearTimeout(t),t=window.setTimeout(e,6e4)},r=t=>{t.key===`Escape`&&e()},i=e=>{if(e.key!==`Tab`)return;let t=[...g.current?.querySelectorAll(`button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`)??[]],n=t.at(0),r=t.at(-1);n&&r&&(e.shiftKey&&document.activeElement===n?(e.preventDefault(),r?.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n.focus()))},a=g.current;return a?.addEventListener(`pointerdown`,n),a?.addEventListener(`keydown`,n),a?.addEventListener(`focusin`,n),a?.addEventListener(`keydown`,i),window.addEventListener(`keydown`,r),_.current?.focus(),()=>{window.clearTimeout(t),a?.removeEventListener(`pointerdown`,n),a?.removeEventListener(`keydown`,n),a?.removeEventListener(`focusin`,n),a?.removeEventListener(`keydown`,i),window.removeEventListener(`keydown`,r)}},[p]),d(l,{children:[u(`button`,{ref:h,className:$.trigger,type:`button`,"aria-expanded":p,"aria-controls":`update-activity-dialog`,onClick:()=>{f(new Date),m(!0)},children:`Update activity`}),p&&d(`section`,{ref:g,className:$.dialog,"data-update-activity":!0,id:`update-activity-dialog`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`update-activity-title`,children:[d(`div`,{className:$.dialogHeader,children:[d(`div`,{children:[u(`h2`,{id:`update-activity-title`,children:`Update activity`}),u(`p`,{children:`Browser-local proxy reads from the last 10 minutes. Panels schedule independently.`})]}),u(`button`,{ref:_,className:$.close,type:`button`,onClick:()=>m(!1),children:`Close`})]}),d(`div`,{className:$.body,children:[u(`span`,{className:$.legend,children:`● observed · ◇ expected`}),e&&y.lanes.length===0&&u(`p`,{className:$.empty,children:`No visible polling panels are configured.`}),y.lanes.length>0&&d(l,{children:[d(`div`,{className:$.axis,"aria-hidden":`true`,children:[u(`span`,{children:`10m ago`}),u(`span`,{children:`now`})]}),u(`div`,{className:$.lanes,children:y.lanes.map(e=>d(`div`,{className:$.lane,"data-update-activity-lane":!0,children:[u(`span`,{className:$.laneLabel,children:e.label}),d(`span`,{className:$.track,role:`img`,"aria-label":jr(e,c),children:[e.observed.flatMap(({path:e,starts:t})=>t.map(t=>u(`i`,{className:$.observed,style:{left:`${Ar(t,c)}%`},title:`Observed request: ${e}`},`${e}-${t}`))),e.nextDueAt&&u(`i`,{className:$.expected,style:{left:`${Ar(e.nextDueAt,c)}%`},title:`Expected next poll`})]})]},e.panelId))})]}),y.evidenceMayBeIncomplete&&u(`p`,{className:$.note,children:`Older browser evidence was pruned, so an empty lane only means no retained request in this window.`}),u(`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 Ir=6e4,Lr=1e4,Rr=()=>globalThis.window.location.reload();function zr({env:e,diagnostics:t,fetcher:n,reload:i=Rr,auth:a}){r(()=>{let r=!1,o=!1,s,c=`${e.proxyPath}/client`,l=async()=>{if(r||o)return;o=!0;let u=new AbortController;s=u;let d=globalThis.setTimeout(()=>u.abort(),Lr);t.record({kind:`client-update-check`,path:c});try{let o=await j(e,c,{cache:`no-store`,signal:u.signal},n??globalThis.fetch,a);if(!o.ok)throw Error(`Client identity returned ${o.status}`);let s=he.safeParse(await o.json());if(!s.success)throw Error(`Client identity response was invalid`);if(r)return;t.record({kind:`client-update-response`,path:c,serverVersion:s.data.serverVersion,assetPathIdMatches:s.data.assetPathId===e.assetPathId}),s.data.assetPath!==e.assetPath&&(t.record({kind:`client-update-detected`,path:c,current:{assetPath:e.assetPath},next:s.data}),i())}catch(e){!r&&!(e instanceof DOMException&&e.name===`AbortError`)&&t.record({kind:`client-update-failure`,path:c,message:e instanceof Error?e.message:String(e)})}finally{globalThis.clearTimeout(d),o=!1,s===u&&(s=void 0),r||globalThis.setTimeout(()=>void l(),Ir)}};return l(),()=>{r=!0,s?.abort()}},[a,t,e,n,i])}function Br(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=we.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 Vr(e,t,n){if(!e)return!0;let r=Br(t,e),i=Br(t,n);return r.state!==i.state||r.status!==i.status||r.link!==i.link}function Hr(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 Ur(e,t){return JSON.stringify(e&&Hr(e))!==JSON.stringify(Hr(t))}var Wr=`ze-great-dashboard.panel-memory.v1`,Gr=1,Kr=12096e5,qr=class{now;histories;storage;constructor(e=Ue(),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[Jr(t)]=t);let i=r.latestCompleted;(!i||Yr(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=Qr(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()-Kr;for(let[n,r]of Object.entries(e.durations)){let i=Xr(r.sourceUpdatedAt);(i===void 0||i<t)&&delete e.durations[n]}let n=e.latestCompleted?Xr(e.latestCompleted.sourceUpdatedAt):void 0;e.latestCompleted&&(n===void 0||n<t)&&delete e.latestCompleted}read(){let e=We(this.storage,Wr);return e?.schemaVersion!==Gr||!e.histories?{}:$r(e.histories)?e.histories:{}}persist(){Ge(this.storage,Wr,{schemaVersion:Gr,histories:this.histories})}};function Jr(e){return e.sourceRunId??e.link??e.sourceUpdatedAt}function Yr(e,t){let n=Xr(e),r=Xr(t);return n!==void 0&&(r===void 0||n>=r)}function Xr(e){let t=Date.parse(e);return Number.isFinite(t)?t:void 0}function Zr(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 Qr(e){return JSON.stringify([e.board,e.panelId,e.source,e.workflow,e.branch])}function $r(e){return ni(e)?Object.values(e).every(ei):!1}function ei(e){return!ni(e)||!ni(e.durations)||!Object.values(e.durations).every(ti)?!1:e.latestCompleted===void 0||ti(e.latestCompleted)}function ti(e){return ni(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`&&Xr(e.sourceUpdatedAt)!==void 0:!1}function ni(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}async function ri(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:tt(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=ye.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:ii(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:ai(t)}),{error:ai(t)}}}function ii(e,t){let n=t.headers.get(`x-dashboard-request-id`);return{reason:e.error.message,...n?{supportReference:n}:{}}}function ai(e){return e instanceof Error?e.message:String(e)}function oi(e){let t=si(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 si(e){if(e.state!==`ok`)return;let t=D.safeParse(e.signal);return t.success?t.data:void 0}function ci(e){return e.panels.filter(e=>!O(e.position)&&(e.type===`pipeline-status`||e.type===`pull-request-health`||e.type===`http-value`))}function li(e,t){return`${e.proxyPath}/panel/${encodeURIComponent(e.board)}/${encodeURIComponent(t)}`}function ui(e,t,n){let r=li(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`,...di(n).map(({workflow:e})=>`${r}/update-workflow/${encodeURIComponent(e)}`)]:[r];return{panelId:n.id,label:n.label??n.id,settings:Ie(e,n),cadence:`normal`,inFlight:!1,knownPaths:i}}function di(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 fi(e,t,n){let r=pi(e);if(!r)return{delayMillis:n.refreshMillis,cadence:`normal`};let i=mi(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 pi(e){if(e?.state!==`ok`)return;let t=D.safeParse(e.signal);return t.success&&t.data.status===`running`?t.data:void 0}function mi(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 hi(e){let t=[],n=e.workflows.map(({workflow:e,observation:n})=>{let r=_i(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=vi(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:gi(e,n,[],t,yi(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.`}),gi(e,n,r.pullRequests.map(n=>{let r=e.builds.get(n.branch),i=_i(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,yi([...e.workflows.map(({observation:e})=>e),e.candidates,...e.builds.values()]))}function gi(e,t,n,r,i){let a=bi([...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 _i(e,t){if(e?.state!==`ok`)return;let n=(t===`pull-request-workflow`?De:Oe).safeParse(e.signal);return n.success?{item:n.data.item}:void 0}function vi(e){if(e?.state!==`ok`)return;let t=Ee.safeParse(e.signal);return t.success?t.data:void 0}function yi(e){return e.flatMap(({envelope:e})=>e?.state===`ok`?[e.observedAt]:[])}function bi(e){return e.reduce((e,t)=>Se(t)>Se(e)?t:e,`passed`)}function xi({board:e,env:t,diagnostics:n,memory:i,auth:s}){let[c,l]=o({}),[u,d]=o({}),[f,p]=o({}),[m,h]=o([]),g=a({}),_=a({}),v=a(null);return v.current||=i??new qr,r(()=>{if(g.current={},_.current={},l({}),d({}),p({}),h([]),!e)return;let r=!1,i=new Set,a=new Set,o=ci(e),c=o.map(n=>ui(e,t,n)),u=new Map(c.map(e=>[e.panelId,e]));h(c);let f=(e,t)=>{r||h(n=>n.map(n=>n.panelId===e?{...n,...t}:n))};for(let e of o){let o=!1,c=v.current;if(!c)return;let m=u.get(e.id);if(!m)continue;let{settings:h}=m,y=li(t,e.id),b,x,S=()=>{x=new Date().toISOString(),r||d(t=>{if(!t[e.id])return t;let n={...t};return delete n[e.id],n})},C=t=>{let n=x;if(r||!n)return;let i=wi(t);d(t=>{let r=t[e.id];return{...t,[e.id]:{consecutiveFailures:(r?.consecutiveFailures??0)+1,message:i,lastConfirmedAt:n}}})};if(e.type===`http-value`&&e.facts){let c=e.facts,l=new Map,u,d=async()=>{if(r||o)return;o=!0,f(e.id,{inFlight:!0,lastRequestStartedAt:new Date().toISOString(),nextDueAt:void 0}),u=new AbortController,a.add(u);let m=`${y}/facts`,g=await Promise.all(c.map(async r=>{let i=`${m}/${encodeURIComponent(r.id)}`,a=await ri({diagnostics:n,panelId:e.id,path:i,signal:u?.signal,cache:l,fetcher:(e,n)=>j(t,e,n,globalThis.fetch,s)});return[r.id,a.error?{failure:a.error}:a]}));if(!r&&!u.signal.aborted){let t=Object.fromEntries(g),r=_.current[e.id];Ur(r,t)&&n.record({kind:`panel-rendered`,panelId:e.id,path:y,rendered:Hr(t)}),_.current={..._.current,[e.id]:t},p(_.current)}if(o=!1,a.delete(u),!r){let t=Date.now()+h.refreshMillis;f(e.id,{inFlight:!1,cadence:`normal`,nextDueAt:new Date(t).toISOString()});let n=window.setTimeout(()=>{i.delete(n),d()},h.refreshMillis);i.add(n)}};d();continue}if(e.type===`pull-request-health`){let c=di(e),u=new Map,d,p=async r=>{let i=await ri({diagnostics:n,panelId:e.id,path:r,signal:d?.signal,cache:u,fetcher:(e,n)=>j(t,e,n,globalThis.fetch,s)});return i.envelope?.state===`error`?{error:i.envelope.error.message}:i},m=async()=>{if(r||o)return;o=!0,f(e.id,{inFlight:!0,lastRequestStartedAt:new Date().toISOString(),nextDueAt:void 0}),d=new AbortController,a.add(d);let t=y,[s,...u]=await Promise.all([p(`${t}/pull-requests`),...c.map(({workflow:e})=>p(`${t}/update-workflow/${encodeURIComponent(e)}`))]),_=s.envelope?.state===`ok`&&Ci(s.envelope.signal)?s.envelope.signal.pullRequests:[];if(r||d.signal.aborted){a.delete(d);return}let v=await Promise.all(_.map(async e=>[e.branch,await p(`${t}/pull-request-build?branch=${encodeURIComponent(e.branch)}`)])),x=hi({panelId:e.id,link:s.envelope?.link??null,workflows:c.map(({workflow:e},t)=>({workflow:e,observation:u[t]??{error:`Missing workflow result.`}})),candidates:s,builds:new Map(v)});if(r||d.signal.aborted){a.delete(d);return}if(x&&!r){b=x,S();let t=g.current[e.id];Vr(t,e,x)&&n.record({kind:`panel-rendered`,panelId:e.id,path:y,rendered:Br(e,x)}),g.current={...g.current,[e.id]:x},l(g.current)}else r||C(`No usable pull-request observations.`);if(o=!1,a.delete(d),!r){let t=fi(b,Date.now(),h),n=Date.now()+t.delayMillis;f(e.id,{inFlight:!1,cadence:t.cadence,nextDueAt:new Date(n).toISOString()});let r=window.setTimeout(()=>{i.delete(r),m()},t.delayMillis);i.add(r)}};m();continue}let w=()=>{r||o||(o=!0,f(e.id,{inFlight:!0,lastRequestStartedAt:new Date().toISOString(),nextDueAt:void 0}),n.record({kind:`panel-fetch-start`,panelId:e.id,path:y}),j(t,y,void 0,globalThis.fetch,s).then(async t=>{let r={kind:`panel-fetch-response`,panelId:e.id,path:y,status:t.status,cache:tt(t.headers)};if(t.status===304){n.record(r),S();return}try{let i=Ei(await t.json());if(!i){n.record(r),n.record({kind:`panel-fetch-parse-failure`,panelId:e.id,path:y,message:`Response was not a valid signal envelope.`}),C(`Response was not a valid signal envelope.`);return}return n.record({...r,envelope:i,...i.state===`error`?{failure:Si(i,t)}:{}}),S(),{envelope:i,cache:r.cache,status:t.status}}catch(t){throw n.record(r),n.record({kind:`panel-fetch-parse-failure`,panelId:e.id,path:y,message:wi(t)}),new Ti(t)}}).then(i=>{if(!i)return;let a=i.envelope;if(e.type===`pipeline-status`){let r=Zr(t.board,e),o=c.latest(r),s=oi({envelope:a,accepted:o,estimatedDurationMs:c.resolveEstimatedDuration(r)});if(s.kind===`rejected`&&o){let t=s.signal;n.recordGithubConsistencyIncident({panelId:e.id,endpoint:y,identity:{source:r.source,workflow:r.workflow,branch:r.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(s.kind===`accepted`&&(a=s.envelope,s.accepted&&c.rememberLatest(r,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};c.recordRun(r,e,s.signal.status===`passed`)}}if(b=a,!r){let t=g.current[e.id];Vr(t,e,a)&&n.record({kind:`panel-rendered`,panelId:e.id,path:y,rendered:Br(e,a)}),g.current={...g.current,[e.id]:a},l(g.current)}}).catch(t=>{C(t),t instanceof Ti||n.record({kind:`panel-fetch-failure`,panelId:e.id,path:y,message:wi(t)})}).finally(()=>{if(o=!1,!r){let t=fi(b,Date.now(),h),n=Date.now()+t.delayMillis;f(e.id,{inFlight:!1,cadence:t.cadence,nextDueAt:new Date(n).toISOString()});let r=window.setTimeout(()=>{i.delete(r),w()},t.delayMillis);i.add(r)}}))};w()}return()=>{r=!0;for(let e of a)e.abort();for(let e of i)window.clearTimeout(e)}},[s,e,n,t]),{signals:c,updateHealth:u,factSignals:f,schedules:m}}function Si(e,t){let n=t.headers.get(`x-dashboard-request-id`);return{reason:e.error.message,...n?{supportReference:n}:{}}}function Ci(e){return typeof e==`object`&&!!e&&e.type===`pull-request-candidates`&&Array.isArray(e.pullRequests)}function wi(e){return e instanceof Error?e.message:String(e)}var Ti=class extends Error{constructor(e){super(wi(e))}};function Ei(e){let t=ye.safeParse(e);return t.success?t.data:void 0}function Di({env:e}){return e.security===`blocked`?u(Dr,{mode:`blocked`}):e.auth?u(lt,{env:e,auth:e.auth,children:(t,n)=>u(Oi,{env:e,accessToken:t,onDenied:n})}):u(Oi,{env:e})}function Oi({env:e,accessToken:t,onDenied:n}){let[s,c]=o(),[l,f]=o(),p=a(null);p.current||=new $e(e);let m=p.current,h=i(()=>t?{accessToken:t,onAuthenticationFailure:e=>e===403&&n?.()}:void 0,[t,n]);zr({env:e,diagnostics:m,auth:h});let{signals:g,updateHealth:_,factSignals:v,schedules:y}=xi({board:l===e.board?s:void 0,env:e,diagnostics:m,auth:h}),b=i(()=>s?Me(s.panels):void 0,[s]),x=i(()=>Le({board:s,signals:g,updateHealth:_,factSignals:v}),[s,v,g,_]),S=x.length?s?.attention?.treatment:void 0,C=new Set(x.map(e=>e.panelId));return r(()=>{b&&b.issues.length!==0&&m.record({kind:`layout-analyzed`,issueCount:b.issues.length,affectedPanelIds:b.issues.map(e=>e.panelId)})},[m,b]),r(()=>{let t=!1;c(void 0),f(void 0);let n=`${e.proxyPath}/boards/${encodeURIComponent(e.board)}`;return m.record({kind:`board-fetch-start`,path:n}),j(e,n,void 0,globalThis.fetch,h).then(async e=>{if(m.record({kind:`board-fetch-response`,path:n,status:e.status,cache:tt(e.headers)}),!e.ok)throw Error(`Board configuration returned ${e.status}`);try{return await e.json()}catch(e){throw m.record({kind:`board-fetch-parse-failure`,path:n,message:ji(e)}),new Mi(e)}}).then(r=>{if(!t){c(r),f(e.board);let t=Array.isArray(r.panels)?r.panels:[];m.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 Mi||m.record({kind:`board-fetch-failure`,path:n,message:ji(r)}),t||(c({panels:[]}),f(e.board))}),()=>{t=!0}},[h,m,e]),d(`div`,{className:`${k.board} ${S?k[`attention-${S}`]:``}`,"data-attention-treatment":S,"data-attention-active":x.length||void 0,children:[d(`header`,{className:k.header,children:[u(`h1`,{className:k.title,children:e.board}),e.security===`warning`&&u(Dr,{mode:`warning`}),x.length>0&&d(`aside`,{className:k.attentionRail,role:`alert`,"aria-label":`Important panel attention`,children:[u(`span`,{className:k.attentionGlyph,"aria-hidden":`true`,children:`⚠`}),u(`ul`,{children:x.map(e=>u(`li`,{children:d(`a`,{href:`#panel-${e.panelId}`,children:[u(`strong`,{children:e.label}),`: `,e.reason]})},`${e.panelId}-${e.factId??`panel`}-${e.reason}`))})]})]}),d(`main`,{className:k.grid,children:[!s&&u(dt,{label:`board`,hint:`Loading configuration…`,wide:!0}),s?.panels.filter(e=>!O(e.position)).map(e=>u(wr,{panel:e,envelope:g[e.id],attentionActive:C.has(e.id),updateHealth:_[e.id],facts:v[e.id]},e.id))]}),d(`footer`,{className:k.footer,"data-board-footer":!0,children:[u(`span`,{children:`Signals are read live from their configured authorities.`}),d(`div`,{className:k.footerTools,children:[b&&b.issues.length>0&&u(ki,{board:e.board,layout:b,env:e,auth:h}),u(Be,{log:m,updateActivity:()=>{let e=m.retainedEvidence(),t=kr({schedules:y,...e});return{capturedAt:t.capturedAt,window:t.window,schedules:t.schedules}}}),u(Fr,{board:s,schedules:y,log:m})]})]})]})}function ki({board:e,layout:t,env:n,auth:i}){let[a,s]=o(!1),c=`layout-warning-${e}`;r(()=>{if(!a)return;let e=e=>{e.key===`Escape`&&s(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[a]);let l=`${n.proxyPath}/boards/${encodeURIComponent(e)}`;return d(`div`,{className:k.layoutWarning,"data-layout-warning":!0,children:[d(`button`,{className:k.layoutWarningButton,type:`button`,"aria-label":`Layout warnings (${t.issues.length})`,"aria-expanded":a,"aria-controls":c,onClick:()=>s(!a),children:[u(`span`,{"aria-hidden":`true`,children:`⚠`}),u(`span`,{children:t.issues.length})]}),a&&d(`aside`,{className:k.layoutWarningDialog,id:c,role:`dialog`,"aria-labelledby":`${c}-title`,"aria-modal":`false`,children:[d(`div`,{className:k.layoutWarningHeading,children:[u(`strong`,{id:`${c}-title`,children:`Layout warnings`}),u(`button`,{className:k.layoutWarningClose,type:`button`,"aria-label":`Close layout warnings`,onClick:()=>s(!1),children:`×`})]}),d(`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.`]}),u(`ul`,{children:t.issues.map(e=>d(`li`,{children:[u(`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}`))}),d(`div`,{className:k.layoutWarningDownloads,children:[u(`button`,{type:`button`,onClick:()=>void Ai(n,`${l}/rendered`,i),children:`Download legal rendered layout`}),u(`button`,{type:`button`,onClick:()=>void Ai(n,`${l}/authored`,i),children:`Download authored layout`})]}),u(`p`,{className:k.layoutWarningNote,children:`The legal rendered layout normalizes the currently visible explicit area into 12×12 and makes the smallest deterministic adjustments needed to avoid collisions. The authored layout preserves the original coordinates exactly.`})]})]})}async function Ai(e,t,n){let r=await j(e,t,void 0,globalThis.fetch,n);if(!r.ok)throw Error(`Layout download returned ${r.status}`);let i=document.createElement(`a`);i.href=URL.createObjectURL(await r.blob()),i.download=r.headers.get(`content-disposition`)?.match(/filename="([^"]+)"/)?.[1]??`layout.yaml`,i.click(),URL.revokeObjectURL(i.href)}function ji(e){return e instanceof Error?e.message:String(e)}var Mi=class extends Error{constructor(e){super(ji(e))}},Ni={error:`_error_yx1g9_1`};function Pi({message:e}){return d(`div`,{className:Ni.error,role:`alert`,children:[u(`h1`,{children:`⚠️ Dashboard misconfigured`}),u(`p`,{children:`The page loaded, but the server did not hand it usable configuration.`}),u(`pre`,{children:e})]})}var Fi=document.getElementById(`root`);if(!Fi)throw Error(`No #root element in the document — the template is not the one we expect.`);var Ii=c(Fi);try{Ii.render(u(t,{children:u(Di,{env:ge()})}))}catch(e){Ii.render(u(Pi,{message:e instanceof Error?e.message:String(e)}))}
3
- //# sourceMappingURL=index-CMoIpVra.js.map