@continuous-excellence/ze-great-dashboard-client 0.31.46 → 0.31.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/.vite/manifest.json +1 -1
- package/client/assets/index-UhsodIrK.js +3 -0
- package/client/assets/index-UhsodIrK.js.map +1 -0
- package/client/board-config.schema.json +19 -0
- package/client/index.html +1 -1
- package/package.json +1 -1
- package/client/assets/index-B6LHEOFj.js +0 -3
- package/client/assets/index-B6LHEOFj.js.map +0 -1
|
@@ -303,6 +303,25 @@
|
|
|
303
303
|
"merge_group"
|
|
304
304
|
]
|
|
305
305
|
}
|
|
306
|
+
},
|
|
307
|
+
"test_results": {
|
|
308
|
+
"type": "object",
|
|
309
|
+
"properties": {
|
|
310
|
+
"artifact": {
|
|
311
|
+
"type": "string",
|
|
312
|
+
"minLength": 1,
|
|
313
|
+
"maxLength": 128
|
|
314
|
+
},
|
|
315
|
+
"entry": {
|
|
316
|
+
"type": "string",
|
|
317
|
+
"pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*\\.json$"
|
|
318
|
+
}
|
|
319
|
+
},
|
|
320
|
+
"required": [
|
|
321
|
+
"artifact",
|
|
322
|
+
"entry"
|
|
323
|
+
],
|
|
324
|
+
"additionalProperties": false
|
|
306
325
|
}
|
|
307
326
|
},
|
|
308
327
|
"required": [
|
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.1","react/":"https://esm.sh/react@19.3.1/","react-dom":"https://esm.sh/react-dom@19.3.1?external=react","react-dom/":"https://esm.sh/react-dom@19.3.1/","react-oidc-context":"https://esm.sh/react-oidc-context@3.3.1?external=oidc-client-ts,react","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.7","zod/":"https://esm.sh/zod@4.6.7/"}}</script>
|
|
14
|
-
<script type="module" crossorigin src="/__ASSET_PATH__/assets/index-
|
|
14
|
+
<script type="module" crossorigin src="/__ASSET_PATH__/assets/index-UhsodIrK.js"></script>
|
|
15
15
|
<link rel="stylesheet" crossorigin href="/__ASSET_PATH__/assets/index-CGi5Duxk.css">
|
|
16
16
|
</head>
|
|
17
17
|
<body>
|
package/package.json
CHANGED
|
@@ -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,hasAuthParams as p,useAuth as m}from"react-oidc-context";import{User as h,UserManager as g,WebStorageStateStore as _}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 v=e.enum([`warning`,`blocked`]),y=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:v.optional()}),b=y.pick({assetPath:!0,assetPathId:!0}).extend({serverVersion:e.string().min(1)});function x(t=globalThis.window?.env){let n=y.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 S=/^([1-9][0-9]*)(ms|s|m|h)$/,C={ms:1,s:1e3,m:6e4,h:36e5};function w(e){let t=S.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*C[r]}e.string().regex(/^[1-9][0-9]*(?:ms|s|m|h)$/,{message:`must be a positive duration like "30s", "5m", or "1h"`}).brand();var T=e.enum([`unreachable`,`unauthorized`,`not-found`,`no-runs`,`upstream-error`]),ee=e.object({kind:T,message:e.string()}),te=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:ee})]),ne=e.object({kind:e.enum([`job`,`stage`,`step`]),name:e.string().min(1),parent:e.string().min(1).optional()}),E=e.object({type:e.literal(`pipeline-status`),status:e.enum([`passed`,`failed`,`warning`,`running`,`cancelled`,`unknown`]),rawStatus:e.string(),name:e.string().min(1),branch:e.string().min(1).optional(),durationMs:e.number().int().nonnegative().optional(),runStartedAt:e.iso.datetime().optional(),sourceRunId:e.string().min(1).optional(),activity:ne.optional(),estimatedDurationMs:e.number().int().positive().optional(),sourceUpdatedAt:e.iso.datetime().optional()}),re={passed:0,cancelled:1,unknown:2,running:3,warning:4,failed:5};function ie(e){return re[e]}var ae=e.object({label:e.string().min(1),status:E.shape.status,detail:e.string().min(1),link:e.url().nullable()}),oe=e.object({type:e.literal(`pull-request-health`),status:E.shape.status,summary:e.string().min(1),workflows:e.array(ae),pullRequests:e.array(ae),incompleteObservations:e.array(e.object({label:e.string().min(1),message:e.string().min(1)})).optional(),newestObservedAt:e.iso.datetime().optional()}),se=e.object({number:e.number().int().positive(),branch:e.string().min(1),link:e.url()}),ce=e.object({type:e.literal(`pull-request-candidates`),pullRequests:e.array(se),truncated:e.boolean().optional()}),le=e.object({type:e.literal(`pull-request-workflow`),workflow:e.string().min(1),item:ae}),ue=e.object({type:e.literal(`pull-request-build`),branch:e.string().min(1),item:ae}),de=e.object({type:e.literal(`http-value`),value:e.union([e.string(),e.number(),e.boolean()])}),fe=12,pe=12;function me(e){let t=e.flatMap(e=>!e.position||D(e.position)||he(e.position)?[]:[{panelId:e.id,kind:`out-of-bounds`,position:e.position,conflictsWith:[]}]),n=new Map;for(let r=0;r<e.length;r++){let i=e[r];if(i?.position&&!D(i.position))for(let a=r+1;a<e.length;a++){let r=e[a];if(!r?.position||D(r.position)||!ge(i.position,r.position))continue;let o=`${r.id}\0overlap`,s=n.get(o);if(s)s.conflictsWith.push(i.id);else{let e={panelId:r.id,kind:`overlap`,position:r.position,conflictsWith:[i.id]};n.set(o,e),t.push(e)}}}return{issues:t}}function D(e){return e?.x===0&&e.y===0&&e.w===0&&e.h===0}function he(e){return!D(e)&&e.x+e.w<=fe&&e.y+e.h<=pe}function ge(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 _e={refreshMillis:6e4,runningRefreshMillis:15e3,runningCompletionRefreshMillis:5e3,runningCompletionWindowMillis:12e4};function ve(e,t){let n=(e,t)=>w(e??``)??t,r=(r,i,a)=>n(t[r],n(e[i],a));return{refreshMillis:r(`refresh`,`refresh`,_e.refreshMillis),runningRefreshMillis:r(`running_refresh`,`running_refresh`,_e.runningRefreshMillis),runningCompletionRefreshMillis:r(`running_completion_refresh`,`running_completion_refresh`,_e.runningCompletionRefreshMillis),runningCompletionWindowMillis:r(`running_completion_window`,`running_completion_window`,_e.runningCompletionWindowMillis)}}var ye=[`radial`,`runway`,`orbit`,`signal-field`,`telemetry-bloom`,`release-transit`,`status-weather`,`falling-shapes`,`snowman`,`flight-path`],be=e.strictObject({oidc:e.literal(!0),policy:e.discriminatedUnion(`mode`,[e.strictObject({mode:e.literal(`authenticated`)}),e.strictObject({mode:e.literal(`subjects`)}),e.strictObject({mode:e.literal(`claim`),claim:e.string().min(1),match:e.enum([`any`,`all`])})])}),O={board:`_board_12472_1`,header:`_header_12472_11`,attentionRail:`_attentionRail_12472_18`,attentionGlyph:`_attentionGlyph_12472_43`,"attention-beacon":`_attention-beacon_12472_46`,"attention-alarm":`_attention-alarm_12472_51`,"attention-steady":`_attention-steady_12472_59`,title:`_title_12472_81`,grid:`_grid_12472_87`,footerTools:`_footerTools_12472_97`,layoutWarning:`_layoutWarning_12472_102`,layoutWarningButton:`_layoutWarningButton_12472_105`,layoutWarningDialog:`_layoutWarningDialog_12472_123`,layoutWarningHeading:`_layoutWarningHeading_12472_136`,layoutWarningClose:`_layoutWarningClose_12472_154`,layoutWarningDownloads:`_layoutWarningDownloads_12472_162`,layoutWarningNote:`_layoutWarningNote_12472_181`,footer:`_footer_12472_97`};function xe(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=Se(i);return a?[{panelId:t.id,label:n,reason:`${r.label}: ${a}`,factId:r.id}]:[]});let r=Ce(t.type,e.signals[t.id],e.updateHealth[t.id]);return r?[{panelId:t.id,label:n,reason:r}]:[]}):[]}function Se(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:de.safeParse(e.envelope.signal).success?void 0:`Invalid value`}function Ce(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=E.safeParse(t.signal);return e.success?e.data.status===`failed`?`Pipeline failed`:void 0:`Invalid signal`}if(e===`pull-request-health`){let e=oe.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 de.safeParse(t.signal).success?void 0:`Invalid value`}}var k={diagnostics:`_diagnostics_lseur_1`,button:`_button_lseur_5`,area:`_area_lseur_14`,warning:`_warning_lseur_31`,panels:`_panels_lseur_35`,actions:`_actions_lseur_43`};function we({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:k.diagnostics,children:[d(`button`,{className:k.button,type:`button`,"aria-expanded":n,onClick:()=>r(!n),children:[`Diagnostics (`,i,`)`,a>0&&` · GitHub consistency ${a}`]}),n&&d(`div`,{className:k.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?` (${Te(c.retained.firstEventAt,c.retained.lastEventAt)})`:``,`. They are never uploaded.`]}),c.retained.evidenceMayBeIncomplete&&d(`p`,{className:k.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:k.warning,role:`alert`,children:[`GitHub API consistency incidents: `,e.githubConsistencyIncidentCount(),`. A response older than the last accepted run was rejected; download diagnostics to report it.`]}),c.panels.length>0&&u(`div`,{className:k.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:k.actions,children:[u(`button`,{className:k.button,type:`button`,onClick:()=>{let n=new Blob([JSON.stringify(e.export(t?{updateActivity:t()}:{}),null,2)],{type:`application/json`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=`dashboard-diagnostics-${new Date().toISOString().replaceAll(`:`,`-`)}.json`,i.click(),URL.revokeObjectURL(r)},children:`Download`}),u(`button`,{className:k.button,type:`button`,onClick:()=>{window.confirm(`Clear this browser’s retained dashboard diagnostics?`)&&e.clear()},children:`Clear`})]})]})]})}function Te(e,t){return e===t?e:`${e} to ${t}`}var Ee=`0.31.46`;function A(e,t,n,r=globalThis.fetch,i={}){let a=new Headers(n?.headers);return a.set(`X-Dashboard-Client-Version`,Ee),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 De(){try{return window.localStorage}catch{return}}function Oe(e,t){try{let n=e?.getItem(t);return n?JSON.parse(n):void 0}catch{return}}function ke(e,t,n){try{e?.setItem(t,JSON.stringify(n))}catch{}}function Ae(e,t){try{e?.removeItem(t)}catch{}}function je(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 Me=`ze-great-dashboard.diagnostics.v2`,Ne=`ze-great-dashboard.diagnostics.v1`,Pe=2e3,Fe=6048e5,Ie=[`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`],Le=class{env;storage;now;events=[];retention=Be();revision=0;incidents=[];listeners=new Set;sessionId=crypto.randomUUID?.()??`${Date.now()}-${Math.random()}`;constructor(e,t=De(),n=()=>new Date){this.env=e,this.storage=t,this.now=n,Ae(this.storage,Ne),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=He([...this.events,{...e,schemaVersion:2,at:this.now().toISOString(),sessionId:this.sessionId,board:this.env.board,clientVersion:Ee,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=()=>Ee;assetPath=()=>this.env.assetPath;snapshot=()=>this.revision;summary=()=>je(this.events,this.retention,this.incidents.length);retainedEvidence=()=>({events:[...this.events],retention:{...this.retention}});clear(){this.events=[],this.incidents=[],this.retention=Be(),Ae(this.storage,Me),this.revision++,this.notify()}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});export=e=>({schemaVersion:2,exportedAt:this.now().toISOString(),client:{version:Ee,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=Oe(this.storage,Me);if(!e||e.schemaVersion!==2||!Array.isArray(e.events)||!e.events.every(Ue))return Ae(this.storage,Me),[];let t=He(e.events.map(e=>({...e,schemaVersion:2})),this.now(),Ve(e.retention));return this.retention=t.retention,this.incidents=Re(e.githubConsistencyIncidents),t.events}persist(){ke(this.storage,Me,{schemaVersion:2,events:this.events,retention:this.retention,githubConsistencyIncidents:this.incidents})}notify(){for(let e of this.listeners)e()}};function Re(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 ze(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 Be(){return{eventsPrunedByAge:0,eventsPrunedByCount:0}}function Ve(e){if(!e||typeof e!=`object`)return Be();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 He(e,t,n){let r=t.valueOf()-Fe,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-Pe);return{events:i.slice(-2e3),retention:{eventsPrunedByAge:n.eventsPrunedByAge+a,eventsPrunedByCount:n.eventsPrunedByCount+o}}}function Ue(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`&&Ie.includes(t.kind)}var We={auth:`_auth_19xn9_1`,signout:`_signout_19xn9_24`},Ge=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 Ke(e){let t=new g({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 Ge,stateStore:new _({store:window.sessionStorage}),automaticSilentRenew:!0}),n=qe(window);return n&&t.storeUser(new h({access_token:n.accessToken,expires_at:n.expiresAt,scope:n.scope,token_type:n.tokenType,profile:{iss:e.issuer,aud:e.clientId,exp:n.expiresAt,iat:n.expiresAt-1,sub:`playwright-token-bootstrap`}})),t}function qe(e=window){let t=e.__DASHBOARD_OIDC_TEST_BOOTSTRAP__;if(delete e.__DASHBOARD_OIDC_TEST_BOOTSTRAP__,t&&typeof t.accessToken==`string`&&t.accessToken&&Number.isSafeInteger(t.expiresAt)&&typeof t.scope==`string`&&typeof t.tokenType==`string`)return t}function Je({env:e,auth:t,children:n}){let r=i(()=>Ke(t),[t]);return u(f,{userManager:r,onSigninCallback:()=>window.history.replaceState({},document.title,window.location.pathname),children:u(Ye,{env:e,children:n})})}function Ye({env:e,children:t}){let i=m(),[s,c]=o(!1),f=a(!1),h=n(()=>c(!0),[]);return r(()=>{i.isAuthenticated||c(!1)},[i.isAuthenticated]),r(()=>{f.current||i.isLoading||i.isAuthenticated||i.activeNavigator||p()||(f.current=!0,i.signinSilent())},[i]),i.isLoading?u(`main`,{className:We.auth,"aria-live":`polite`,children:`Signing in…`}):s?d(`main`,{className:We.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:We.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:We.signout,type:`button`,onClick:()=>void i.signoutRedirect(),children:`Sign out`}),t(i.user.access_token,h)]})}var j={panel:`_panel_1n078_1`,attentionActive:`_attentionActive_1n078_22`,content:`_content_1n078_26`,evidence:`_evidence_1n078_38`,sourceAction:`_sourceAction_1n078_42`,details:`_details_1n078_46`,statusBand:`_statusBand_1n078_54`,error:`_error_1n078_80`,wide:`_wide_1n078_83`,"density-comfortable":`_density-comfortable_1n078_86`,"density-compact":`_density-compact_1n078_93`,label:`_label_1n078_103`,typeGlyph:`_typeGlyph_1n078_114`,identityText:`_identityText_1n078_117`,hint:`_hint_1n078_123`,branch:`_branch_1n078_129`,observed:`_observed_1n078_133`,meta:`_meta_1n078_139`,metaValue:`_metaValue_1n078_142`,compactValue:`_compactValue_1n078_146`,warning:`_warning_1n078_149`,serious:`_serious_1n078_152`,status:`_status_1n078_54`,statusGlyph:`_statusGlyph_1n078_160`,compactOnlyStatus:`_compactOnlyStatus_1n078_163`,passed:`_passed_1n078_169`,failed:`_failed_1n078_172`,running:`_running_1n078_176`,cancelled:`_cancelled_1n078_179`,unknown:`_unknown_1n078_180`,shallow:`_shallow_1n078_213`,"density-auto":`_density-auto_1n078_214`,fullValue:`_fullValue_1n078_372`,statusText:`_statusText_1n078_467`};function Xe({label:e,hint:t,wide:n=!1}){return d(`section`,{className:`${j.panel} ${n?j.wide:``}`,"data-panel":!0,"data-panel-id":`placeholder`,children:[u(`h2`,{className:j.label,children:e}),u(`p`,{className:j.hint,children:t})]})}function Ze(e){switch(e){case`unauthorized`:return{label:`Access denied`,emphasis:`serious`};case`not-found`:return{label:`Source not found`,emphasis:`serious`};case`unreachable`:case`upstream-error`:return{label:`Source unavailable`,emphasis:`serious`};case`no-runs`:return{label:`No workflow runs`,emphasis:`warning`}}}var M={fact:`_fact_bnc4n_1`,facts:`_facts_bnc4n_5`,factCell:`_factCell_bnc4n_12`,factSource:`_factSource_bnc4n_31`};function Qe(e){let t=e.position;if(t)return{"--panel-column":`${t.x+1} / span ${t.w}`,"--panel-row":`${t.y+1} / span ${t.h}`}}var $e={"pipeline-status":{glyph:`▣`,label:`Pipeline status`},"pull-request-health":{glyph:`⌘`,label:`Pull request health`},"http-value":{glyph:`◌`,label:`HTTP value`},"pipeline-animation-demo":{glyph:`✦`,label:`Pipeline animation demo`}},et={passed:{glyph:`✓`,label:`Passed`},failed:{glyph:`✕`,label:`Failed`},warning:{glyph:`⚠`,label:`Warning`},running:{glyph:`↻`,label:`Running`},cancelled:{glyph:`⊘`,label:`Cancelled`},unknown:{glyph:`?`,label:`Unknown`}};function tt(e){return $e[e]}[...Object.entries($e).map(([e,t])=>({glyph:t.glyph,meaning:`panel type: ${e}`})),...Object.entries(et).map(([e,t])=>({glyph:t.glyph,meaning:`status: ${e}`}))];function N({children:e,className:t,title:n}){return u(`p`,{className:`${j.hint} ${t??``}`,title:n,children:e})}function P({glyph:e,label:t,value:n,compact:r,title:i,observed:a=!1,emphasis:o,className:s}){return d(`p`,{className:`${j.hint} ${a?j.observed:``} ${o?j[o]:``} ${j.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:j.metaValue,title:i,children:[u(`span`,{className:j.fullValue,children:n}),r&&u(`span`,{className:j.compactValue,"aria-hidden":`true`,children:r.kind===`short-value`?r.value:null})]})]})}function F({children:e,className:t,priority:n=`secondary`,anchor:r}){return u(`div`,{className:`${j.evidence} ${t??``}`,"data-panel-evidence":!0,"data-panel-evidence-priority":n,"data-panel-anchor":r,children:e})}function I({status:e,emphasis:t,glyph:n,label:r,compactOnly:i=!1}){return d(`p`,{className:`${j.status} ${e?j[e]:``} ${t?j[t]:``} ${i?j.compactOnlyStatus:``}`,"data-panel-status":!0,children:[n&&u(`span`,{className:j.statusGlyph,"aria-hidden":`true`,children:n}),n&&r&&` `,u(`span`,{className:j.statusText,children:r})]})}function nt({children:e,emphasis:t}){return u(`p`,{className:`${j.status} ${t?j[t]:``}`,children:e})}function L({panel:e,envelope:t,sourceLink:n,busy:r,attentionActive:i=!1,error:a=!1,field:o,layout:s,children:c}){let l=e.density??`auto`,f=e.position,p=tt(e.type),m=f!==void 0&&f.h<=2,h=f!==void 0&&f.h<=3;return d(`section`,{className:`${j.panel} ${j[`density-${l}`]} ${m?j.shallow:``} ${h?j.short:``} ${a?j.error:``} ${i?j.attentionActive:``}`,id:`panel-${e.id}`,style:Qe(e),"aria-busy":r===!0?!0:t||r===!1?void 0:!0,"data-panel":!0,"data-panel-id":e.id,"data-panel-position":f?`${f.x},${f.y},${f.w},${f.h}`:void 0,"data-density":l,"data-shallow":m,"data-short":h,"data-error":a||void 0,"data-panel-type":e.type,"data-attention-active":i||void 0,children:[o,u(rt,{panelId:e.id,link:t?.link??n}),d(`div`,{className:`${j.content} ${s===`status-band`?j.statusBand:``}`,"data-panel-content":!0,"data-panel-layout":s,children:[d(`h2`,{className:j.label,"data-panel-anchor":`identity`,children:[p&&u(`span`,{className:j.typeGlyph,"aria-hidden":`true`,title:p.label,"data-panel-type-glyph":!0,children:p.glyph}),u(`span`,{className:j.identityText,"data-panel-identity-text":!0,children:e.label??e.id})]}),c]})]})}function rt({panelId:e,link:t}){return t?d(`a`,{className:j.sourceAction,href:t,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`View source for ${e} (opens in a new tab)`,title:`View source for ${e} (opens in a new tab)`,"data-panel-action":`source`,"data-panel-link":!0,children:[u(`span`,{"aria-hidden":`true`,children:`↗`}),u(`span`,{className:`screen-reader-only`,children:`View source`})]}):null}function R({value:e,label:t=`Observed`}){return u(z,{value:e,label:t})}function it({sourceUpdatedAt:e,observedAt:t,running:n,runStartedAt:r}){return n&&r?u(z,{value:r,label:`Started`}):u(z,{value:e??t,label:e?`Last update`:`Observed`})}function at({health:e}){let t=e.consecutiveFailures>=3,n=t?`Updates unavailable`:`Updates delayed`;return d(l,{children:[u(P,{glyph:`⚠`,label:n,value:`${n} · ${e.message}`,title:e.message,emphasis:t?`serious`:`warning`}),u(z,{value:e.lastConfirmedAt,label:`Last confirmed`})]})}function ot({value:e}){return u(z,{value:e,label:`Last confirmed`})}function z({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(P,{glyph:`◷`,label:t,value:a,compact:{kind:`short-value`,value:ct(i)},title:`${t} at ${r}`,observed:!0})}function st(e){if(e<6e4)return`just now`;let t=Math.floor(e/6e4);return t<60?`${t}m ago`:`${Math.floor(t/60)}h ${t%60}m ago`}function ct(e){if(e<6e4)return`now`;let t=Math.floor(e/6e4);return t<60?`${t}m`:`${Math.floor(t/60)}h ${t%60}m`}function lt({panel:e,envelope:t,attentionActive:n,updateHealth:r,facts:i}){if(e.facts)return u(ut,{panel:e,attentionActive:n,facts:i});if(!t)return u(L,{panel:e,attentionActive:n,children:u(F,{children:u(N,{children:`Loading…`})})});if(t.state===`error`){let r=Ze(t.error.kind);return u(L,{panel:e,envelope:t,attentionActive:n,error:!0,children:d(F,{children:[u(I,{glyph:`⚠`,label:r.label,emphasis:r.emphasis}),u(N,{children:t.error.message})]})})}let a=de.safeParse(t.signal);return a.success?u(L,{panel:e,envelope:t,attentionActive:n,children:d(F,{className:M.fact,children:[u(I,{glyph:`✓`,label:`Value read`,compactOnly:!0}),u(nt,{children:String(a.data.value)}),u(R,{value:t.observedAt}),r&&u(at,{health:r})]})}):u(L,{panel:e,envelope:t,attentionActive:n,error:!0,children:u(F,{children:u(I,{glyph:`⚠`,label:`Invalid value`})})})}function ut({panel:e,attentionActive:t,facts:n}){return e.facts?u(L,{panel:e,attentionActive:t,children:u(F,{children:u(`div`,{className:M.facts,"data-http-value-facts":!0,children:e.facts.map(e=>u(dt,{label:e.label,observation:n?.[e.id]},e.id))})})}):null}function dt({label:e,observation:t}){let n=t?.envelope;if(!n)return d(`section`,{className:M.factCell,"data-http-value-fact":!0,children:[u(`h3`,{children:e}),u(nt,{emphasis:t?.failure?`serious`:void 0,children:t?.failure?`⚠ Updates unavailable`:`Loading…`}),t?.updateHealth&&u(at,{health:t.updateHealth})]});if(n.state===`error`){let t=Ze(n.error.kind);return d(`section`,{className:M.factCell,"data-http-value-fact":!0,"data-error":!0,children:[u(ft,{label:e,link:n.link}),u(`h3`,{children:e}),u(I,{glyph:`⚠`,label:t.label,emphasis:t.emphasis}),u(N,{children:n.error.message}),u(R,{value:n.observedAt})]})}let r=de.safeParse(n.signal);return r.success?d(`section`,{className:M.factCell,"data-http-value-fact":!0,children:[u(ft,{label:e,link:n.link}),u(`h3`,{children:e}),u(nt,{children:String(r.data.value)}),u(R,{value:n.observedAt})]}):d(`section`,{className:M.factCell,"data-http-value-fact":!0,"data-error":!0,children:[u(ft,{label:e,link:n.link}),u(`h3`,{children:e}),u(I,{glyph:`⚠`,label:`Invalid value`,emphasis:`serious`}),u(R,{value:n.observedAt})]})}function ft({label:e,link:t}){return t?d(`a`,{className:M.factSource,href:t,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`View source for ${e} (opens in a new tab)`,title:`View source for ${e} (opens in a new tab)`,children:[u(`span`,{"aria-hidden":`true`,children:`↗`}),u(`span`,{className:`screen-reader-only`,children:`View source`})]}):null}var pt={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`},mt=.85,ht=[[{x:0,y:0},{x:1,y:0}],[{x:0,y:0},{x:0,y:1}],[{x:0,y:0},{x:1,y:0},{x:0,y:1}],[{x:0,y:0},{x:1,y:0},{x:2,y:0}],[{x:0,y:0},{x:0,y:1},{x:1,y:1}]];function gt(e,t){return e>t?`horizontal`:`vertical`}function _t(e,t=e===`horizontal`?12:3,n=e===`horizontal`?3:12){let r=Math.max(1,t*.8),i=Math.max(1,n*.8),a=Math.max(24,Math.min(42,Math.min(r,i)/4)),o=Math.max(3,Math.min(24,Math.round(r/a))),s=Math.max(3,Math.min(16,Math.round(i/a)));return e===`horizontal`?{columns:Math.max(o,s),rows:s}:{columns:o,rows:Math.max(s,o)}}function vt(e,t,n){let r=Math.max(...e.map(e=>e.x)),i=Math.max(...e.map(e=>e.y));return r<t&&i<n}function yt(e,t){return e.cells.some(n=>t.cells.some(r=>e.x+n.x===t.x+r.x&&e.y+n.y===t.y+r.y))}function bt(e,t,n){let r=ht.filter(e=>vt(e,t,n));return r[kt(e,r.length)]??[{x:0,y:0}]}function xt(e,t,n,r,i,a=0,o=!1){let s=Math.max(...e.map(e=>e.x))+1,c=Math.max(...e.map(e=>e.y))+1,l=[];for(let a=0;a<=r-c;a++)for(let c=0;c<=n-s;c++){let s={id:-1,bornAt:0,cells:e,x:c,y:a,phase:`settled`};if(i.some(e=>yt(s,e))||!Ot(e,t,n,r,s,i))continue;let u=t===`vertical`?e.filter(e=>a+e.y===r-1||i.some(t=>t.cells.some(n=>t.x+n.x===c+e.x&&t.y+n.y===a+e.y+1))).length:e.filter(e=>c+e.x===0||i.some(t=>t.cells.some(n=>t.x+n.x===c+e.x-1&&t.y+n.y===a+e.y))).length;o&&u<Dt(e,t)||l.push({x:c,y:a,support:u})}l.sort((e,n)=>n.support-e.support||(t===`vertical`?n.y-e.y||e.x-n.x:e.x-n.x||e.y-n.y));let u=l[0]?.support,d=l.filter(e=>e.support===u),f=d[kt(a,d.length)];return f?{x:f.x,y:f.y}:void 0}function St(e,t,n,r,i,a){let o=ht.flatMap((o,s)=>{if(!vt(o,t,n))return[];let c=xt(o,e,t,n,r,i+s*31,a);return c?[{shape:o,destination:c}]:[]});if(o.length!==0)return o[kt(i,o.length)]}function Ct(e,t,n){return Math.ceil(e*t*mt*Math.min(1,Math.max(0,n)))}function wt(e){return e.reduce((e,t)=>e+t.cells.length,0)}function Tt(e,t,n,r,i){let a=e===`vertical`?n-1:0,o=new Set(r.flatMap(t=>t.cells.filter(n=>e===`vertical`?t.y+n.y===a:t.x+n.x===a).map(n=>e===`vertical`?t.x+n.x:t.y+n.y))),s=e===`vertical`?t:n,c=o.size===s;if(!c&&!i||o.size===0)return;let l=[];return{shapes:r.flatMap(t=>{let n=t.cells.filter(n=>{let r=e===`vertical`?t.y+n.y===a:t.x+n.x===a;return r&&l.push({x:t.x+n.x,y:t.y+n.y}),!r});return n.length===0?[]:[{...t,cells:n,y:e===`vertical`?t.y+1:t.y,x:e===`horizontal`?t.x-1:t.x}]}),cleared:l,complete:c}}function Et(e,t,n,r,i){let a=[];for(let o=0;o<i;o+=1){let i=r+o*17,s=bt(i,t,n),c=xt(s,e,t,n,a,i+1);if(!c)break;a.push({id:o,bornAt:0,cells:s,x:c.x,y:c.y,phase:`settled`})}return a}function Dt(e,t){return t===`vertical`?new Set(e.map(e=>e.x)).size:new Set(e.map(e=>e.y)).size}function Ot(e,t,n,r,i,a){let o=Math.max(...e.map(e=>e.x))+1,s=Math.max(...e.map(e=>e.y))+1;if(t===`vertical`){for(let e=0;e<=i.y;e+=1)if(a.some(t=>yt({...i,y:e},t)))return!1;return i.y+s<=r}for(let e=n-o;e>=i.x;--e)if(a.some(t=>yt({...i,x:e},t)))return!1;return i.x+o<=n}function kt(e,t){if(t<=1)return 0;let n=Math.sin(e*12.9898+78.233)*43758.5453;return Math.floor((n-Math.floor(n))*t)}var At=50,jt=1250,Mt=250,Nt=850,Pt=500;function Ft({progress:e,estimatedDurationMs:t,overdue:n,seed:i=0}){let s=a(null),[c,l]=o({..._t(`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),te=a({startedAt:Date.now(),nextPieceAt:jt,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??gt(t.width,t.height);w.current=n;let r={..._t(n,t.width,t.height),direction:n};return b.current=r,r})};if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]),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&&(te.current={startedAt:Date.now(),nextPieceAt:jt,id:0,recycleUntil:0,settled:[]},T.current=[],p([]),h(!1),_([]),ee.current=!1)},[c,v]),r(()=>{if(!v)return;let e=Et(c.direction,c.columns,c.rows,C.current,Math.max(1,Math.floor(S.current*6)));T.current=e,te.current.settled=e,p(e)},[c,v]),r(()=>{if(v)return;let e=window.setInterval(()=>{let e=te.current,r=Date.now()-e.startedAt,i=b.current,a=S.current,o=Ct(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&&wt(s)>=o)return;let l=e.id,u=C.current+l*17,d=St(i.direction,i.columns,i.rows,s,u+1,!n);if(!d&&(a>=1||t===void 0)){let t=Tt(i.direction,i.columns,i.rows,s,!0);if(t){s=t.shapes,e.settled=s,e.recycleUntil=r+Pt,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+=It(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-Mt)/Nt));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<Mt?`entry`:l<.35?`align`:`travel`}}),e.settled=s;let l=[...s,...c.filter(e=>e.phase!==`settled`)];T.current=l,p(l)},At);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 It(e,t){let n=Math.ceil(t.columns*t.rows*.85);return e===void 0||n<=0?jt:Math.max(400,e/Math.max(1,Math.ceil(n/3)))}var V={scene:`_scene_1u5dz_1`,ground:`_ground_1u5dz_6`,groundGlow:`_groundGlow_1u5dz_12`,groundTerrain:`_groundTerrain_1u5dz_25`,groundTerrainOverdrive:`_groundTerrainOverdrive_1u5dz_26`,"ground-stream":`_ground-stream_1u5dz_1`,groundRunway:`_groundRunway_1u5dz_48`,"runway-stream":`_runway-stream_1u5dz_1`,cloudLayer:`_cloudLayer_1u5dz_62`,cloudLayerFar:`_cloudLayerFar_1u5dz_67`,cloudLayerNear:`_cloudLayerNear_1u5dz_70`,plane:`_plane_1u5dz_73`,aircraft:`_aircraft_1u5dz_83`,windows:`_windows_1u5dz_90`,"holding-pattern":`_holding-pattern_1u5dz_1`,cloud:`_cloud_1u5dz_62`,"cloud-stream":`_cloud-stream_1u5dz_1`,cloudOne:`_cloudOne_1u5dz_129`,cloudTwo:`_cloudTwo_1u5dz_135`,cloudThree:`_cloudThree_1u5dz_141`,cloudFour:`_cloudFour_1u5dz_147`,cloudFive:`_cloudFive_1u5dz_153`,cloudSix:`_cloudSix_1u5dz_159`,cloudSeven:`_cloudSeven_1u5dz_165`,cloudEight:`_cloudEight_1u5dz_171`,"rough-air":`_rough-air_1u5dz_1`},Lt={x:8,y:74},Rt={x:22,y:74},zt={x:38,y:30},Bt={x:65,y:30},Vt={x:88,y:48};function Ht(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function Ut(e,t,n,r,i){let a=1-i;return{x:a**3*e.x+3*a**2*i*t.x+3*a*i**2*n.x+i**3*r.x,y:a**3*e.y+3*a**2*i*t.y+3*a*i**2*n.y+i**3*r.y}}function H(e,t,n,r,i=0){return{worldX:e.x,worldY:e.y,cameraX:t.x,cameraY:t.y,x:e.x-t.x,y:e.y-t.y,pitch:n,groundOffsetY:i,stage:r}}function Wt(e){return{x:e.x-50,y:e.y-50}}function Gt(e,t){if(t){let e={x:50,y:30};return H(e,Wt(e),0,`holding`,20)}let n=Math.min(1,Math.max(0,e));if(n<.18)return H(Ht(Lt,Rt,n/.18),{x:0,y:0},0,`rollout`);if(n<.35){let e=(n-.18)/.17,t=Ut(Rt,{x:28,y:74},{x:32,y:30},zt,e),r=e*e*(3-2*e),i=Wt(t);return H(t,{x:i.x*r,y:i.y*r},-7,`climb`,20*r)}if(n<.7){let e=Ht(zt,Bt,(n-.35)/.35);return H(e,Wt(e),0,`cruise`,20)}let r=(n-.7)/.3,i=Ut(Bt,{x:72,y:30},{x:80,y:47},Vt,r),a=r*r*(3-2*r);return H(i,Wt(i),4,`approach`,20*(1-a))}function Kt({progress:e,indeterminate:t}){let n=Gt(e,t),r={"--flight-x":`${n.x}%`,"--flight-y":`${n.y}%`,"--flight-camera-x":`${n.cameraX}%`,"--flight-camera-y":`${n.cameraY}%`,"--flight-ground-x":`${-n.cameraX}%`,"--flight-ground-y":`${-n.cameraY+n.groundOffsetY}%`,"--flight-cloud-x":`${-n.cameraX*.45}%`,"--flight-cloud-y":`${-n.cameraY*.32}%`,"--flight-pitch":`${n.pitch}deg`};return d(`span`,{className:V.scene,"data-running-part":`flight-path`,"data-flight-stage":n.stage,style:r,children:[d(`span`,{className:V.ground,"data-running-part":`flight-ground`,children:[u(`span`,{className:V.groundGlow}),u(`span`,{className:V.groundTerrain,"data-running-part":`flight-ground-terrain`}),u(`span`,{className:V.groundTerrainOverdrive,"data-running-part":`flight-ground-overdrive`}),u(`span`,{className:V.groundRunway,"data-running-part":`flight-ground-runway`})]}),d(`span`,{className:`${V.cloudLayer} ${V.cloudLayerFar}`,"data-running-part":`flight-cloud-layer`,"data-flight-depth":`far`,children:[u(`span`,{className:`${V.cloud} ${V.cloudOne}`,"data-running-part":`flight-cloud`}),u(`span`,{className:`${V.cloud} ${V.cloudTwo}`,"data-running-part":`flight-cloud`}),u(`span`,{className:`${V.cloud} ${V.cloudThree}`,"data-running-part":`flight-cloud`}),u(`span`,{className:`${V.cloud} ${V.cloudFour}`,"data-running-part":`flight-cloud`})]}),u(`span`,{className:V.plane,"data-running-part":`flight-plane`,children:d(`svg`,{className:V.aircraft,viewBox:`0 0 72 40`,"aria-hidden":`true`,children:[u(`path`,{"data-running-part":`flight-fuselage`,d:`M3 21c5-4 12-6 23-6h27c8 0 13 2 16 5-3 3-8 5-16 5H26C15 25 8 24 3 21Z`}),u(`path`,{"data-running-part":`flight-wing`,d:`m33 23 17 11h-12L23 24Z`}),u(`path`,{"data-running-part":`flight-tail`,d:`m13 17 5-11h7l-1 11Z`}),u(`path`,{className:V.windows,d:`M25 18h4v2h-4zm7 0h4v2h-4zm7 0h4v2h-4z`})]})}),d(`span`,{className:`${V.cloudLayer} ${V.cloudLayerNear}`,"data-running-part":`flight-cloud-layer`,"data-flight-depth":`near`,children:[u(`span`,{className:`${V.cloud} ${V.cloudFive}`,"data-running-part":`flight-cloud`}),u(`span`,{className:`${V.cloud} ${V.cloudSix}`,"data-running-part":`flight-cloud`}),u(`span`,{className:`${V.cloud} ${V.cloudSeven}`,"data-running-part":`flight-cloud`}),u(`span`,{className:`${V.cloud} ${V.cloudEight}`,"data-running-part":`flight-cloud`})]})]})}var U={frontier:`_frontier_xpzp3_1`,now:`_now_xpzp3_12`,routes:`_routes_xpzp3_20`,route:`_route_xpzp3_20`,trail:`_trail_xpzp3_41`,packet:`_packet_xpzp3_42`,"packet-stall":`_packet-stall_xpzp3_1`,"trail-backup":`_trail-backup_xpzp3_1`};function qt(){return d(l,{children:[u(`span`,{className:U.frontier,"data-running-part":`frontier`}),u(`span`,{className:U.now,"data-running-part":`transit-now`}),u(`span`,{className:U.routes,"data-running-part":`transit-routes`,children:[0,1,2].map(e=>u(`span`,{className:U.route},e))}),u(`span`,{className:U.trail,"data-running-part":`transit-trail`}),u(`span`,{className:U.packet,"data-running-part":`transit-packet`})]})}var Jt={field:`_field_1i9kx_1`,overdue:`_overdue_1i9kx_11`,timing:`_timing_1i9kx_14`,timingOverdue:`_timingOverdue_1i9kx_28`},Yt={field:`_field_ozs8n_1`,canvas:`_canvas_ozs8n_7`};function Xt(e){let t=e*.25,n=e*.2,r=t<700||n<350?`snowfall`:n<530?`arrival`:n<1030?`hop`:`full`,i=Qt((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 W(e,t,n){return n===t?Number(e>=n):Qt((e-t)/(n-t),0,1)}function Zt(e){return e*e*(3-2*e)}function Qt(e,t,n){return Math.max(t,Math.min(n,e))}var $t=25,en=.5,tn=.95;function nn(e={width:360,height:180}){return{nextAt:0,id:0,lastElapsed:0,grid:rn(e),flakes:[],cells:[],toppled:!1}}function rn(e){return{columns:Fn(Math.round(e.width/4),48,180),rows:Fn(Math.round(e.height/4),28,100)}}function an(e,t,n){return n?`overdue`:t===void 0||Xt(t).mode===`snowfall`?`snowing`:e>=tn?`complete`:e>=en?`assembling`:`drift`}function on(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 sn(e){let t=rn(e);return Math.round(t.columns*t.rows*.18)}function cn(e,t,n=!1,r=0){if(e===void 0)return n?30:60;let i=e*tn/sn(t);if(n)return i/2;let a=Xt(e);return a.mode!==`snowfall`&&r>=Math.max(0,a.bodyStart-500)?i*4:i}function ln(e,{elapsed:t,progress:n,estimatedDurationMs:r,overdue:i,seed:a,dimensions:o}){let s=rn(o),c=e.grid.columns===s.columns&&e.grid.rows===s.rows?Pn(e):nn(o),l=Math.max(c.lastElapsed,t);for(let e=c.lastElapsed+$t;e<=l;e+=$t)c=fn(c,e,r===void 0?n:e/r,r,i&&(r===void 0||e>=r),a,o),c.lastElapsed=e;return c}function un(e){return e.filter(e=>e.owner===`snowman`).length}function dn(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`?Nn(r,e.toppling):r})}function fn(e,t,n,r,i,a,o){let s=an(n,r,i),c=cn(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;pn(e,n,r,i);let l=En(e),u=on(a,t)*($t/1e3),d=r===void 0?.52:Math.max(.52,(e.grid.rows+7)*$t/(r*.25)),f=[];for(let t of e.flakes){let n={...t,x:t.x+u,y:t.y+d},r=_n(e,n);if(r){vn(e,r,t.id,n.x-r.x,n.y-r.y);continue}let i=On(n,l,e.grid,u,a);if(!i){f.push({...n,x:Fn(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`&&hn(e),xn(e),Dn(e,a,t),Dn(e,a,t+$t/2);let p=e.body;return p?.locked&&(p.supportY??=kn(e,p.x,p.radius,p.y+p.radius),p.y=p.supportY),i&&!e.toppling&&!e.toppled&&un(e.cells)>=60&&jn(e,t),Mn(e,t),e}function pn(e,t,n,r){if(n===void 0)return;let i=Xt(n);if(i.mode===`snowfall`)return;let a=t*n,{columns:o,rows:s}=e.grid,c=Zt(W(a,i.bodyStart,i.bodyEnd));if(a>=i.bodyStart&&!e.body){let t=o*.14;e.body={kind:`body`,x:t,y:kn(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,An(e,`body`,2));let t=o*(.14+.38*c);mn(l,t,kn(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:kn(e,t,1.7,s-1),radius:1.7,angle:0,locked:!1},hn(e)}let u=e.head;if(u&&l&&!u.locked){if(u.radius=Math.max(u.radius,An(e,`head`,1.7)),a<i.hopStart){let t=o*(.88-.22*Zt(W(a,i.headStart,i.hopStart)));mn(u,t,kn(e,t,u.radius,s-1))}else{u.launch??={x:u.x,y:u.y};let e=W(a,i.hopStart,i.land),t=l.y-l.radius-u.radius+.5;if(u.x=u.launch.x+(l.x-u.launch.x)*Zt(e),u.y=u.launch.y+(t-u.launch.y)*Zt(e)-Math.sin(Math.PI*e)*Math.max(5,l.radius*1.5),a>=i.land){let e=W(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=W(a,i.land,i.end);e.hat={x:u.x,y:u.y-u.radius-1-5*(1-t*t),angle:(1-Zt(t))*-.22}}}function mn(e,t,n){let r=In(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 hn(e){let t=dn(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(!gn(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&&vn(e,r,l.id,t,s)}r.radius=Math.max(r.radius,An(e,a,r.kind===`body`?2:1.7))}}function gn(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 _n(e,t){return[e.body,e.head].filter(e=>e!==void 0&&!e.locked).find(n=>gn(e,n)&&Math.hypot(t.x-n.x,t.y-n.y)<=n.radius)}function vn(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=bn(e,t,n),u=yn(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,An(e,t.kind,t.kind===`body`?2:1.7)),Sn(e,t)}function yn(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 bn(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 xn(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=In(t.localX,t.targetLocalX,.25),n=In(t.localY,t.targetLocalY,.25);t.localX=e,t.localY=n,t.packed=e===t.targetLocalX&&n===t.targetLocalY}}function Sn(e,t){let n=e.cells.filter(e=>e.owner===t.kind&&e.localX!==void 0&&e.localY!==void 0),r=Cn(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 Cn(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 wn(e){if(e.hat)return e.toppling?{...Nn(e.hat,e.toppling),angle:e.hat.angle+e.toppling.angle}:e.hat}function Tn(e,t,n){let r=Pn(t),i=(e,t)=>e+(t-e)*Fn(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 En(e){let t=new Map;for(let n of dn(e))t.set(G(Math.round(n.x),Math.round(n.y)),n.owner);return t}function Dn(e,t,n){let r=En(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 On(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 kn(e,t,n,r){let i=dn(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 An(e,t,n){let r=e.cells.filter(e=>e.owner===t).length;return n+Math.sqrt(r/Math.PI)*.5}function jn(e,t){let n=e.body;n&&(e.toppling={startedAt:t,angle:0,pivotX:n.x,pivotY:n.y+n.radius*.72})}function Mn(e,t){let n=e.toppling;if(!n)return;let r=Fn((t-n.startedAt)/750,0,1);n.angle=(1-(1-r)**3)*(Math.PI/2),r===1&&(e.toppled=!0)}function Nn(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 Pn(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 Fn(e,t,n){return Math.max(t,Math.min(n,e))}function In(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 Ln(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 dn(t))Rn(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)Rn(r,(e.x+.5)*s,(e.y+.5)*c,s*.72,c*.72);let l=wn(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 Rn(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 zn({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:nn()});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=nn(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=ln(r.simulation,{...o,elapsed:a});r.simulation=u;let d=Tn(u,ln(u,{...o,elapsed:u.lastElapsed+25}),(a-u.lastElapsed)/25);Ln(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=ln(nn(l),{elapsed:t===void 0?4800:e*t,progress:e,estimatedDurationMs:t,overdue:n,seed:i,dimensions:l});Ln(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 _=an(e,t,n);return u(`div`,{ref:s,className:Yt.field,"data-running-part":`snowman-field`,"data-snowman-phase":_,"data-reduced-motion":f||void 0,children:u(`canvas`,{ref:c,className:Yt.canvas,"data-running-part":`snowman-canvas`})})}var q={haze:`_haze_1uy2p_1`,pressure:`_pressure_1uy2p_17`,band:`_band_1uy2p_20`,bandOne:`_bandOne_1uy2p_33`,bandTwo:`_bandTwo_1uy2p_36`,bandThree:`_bandThree_1uy2p_40`,drift:`_drift_1uy2p_45`,driftOne:`_driftOne_1uy2p_54`,driftTwo:`_driftTwo_1uy2p_58`,driftThree:`_driftThree_1uy2p_67`,driftFour:`_driftFour_1uy2p_76`,driftFive:`_driftFive_1uy2p_85`,"storm-band":`_storm-band_1uy2p_1`};function Bn(){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 Vn={anchor:`_anchor_1bd86_1`,body:`_body_1bd86_6`,"phased-marker":`_phased-marker_1bd86_1`};function Hn({anchorClassName:e,bodyClassName:t,delay:n,anchorPart:r,bodyPart:i}){let a=n?{"--phased-marker-delay":n}:void 0;return u(`span`,{className:`${Vn.anchor} ${e??``}`,"data-running-part":r,children:u(`span`,{className:`${Vn.body} ${t??``}`,"data-running-part":i,style:a})})}var J={frontier:`_frontier_1dg7b_1`,flare:`_flare_1dg7b_12`,lanes:`_lanes_1dg7b_15`,lane:`_lane_1dg7b_15`,markerAnchor:`_markerAnchor_1dg7b_31`,markerBody:`_markerBody_1dg7b_35`,"bloom-flare":`_bloom-flare_1dg7b_1`};function Un(){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(Hn,{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 Wn(e){return[`telemetry-bloom`,`release-transit`,`status-weather`,`falling-shapes`,`snowman`,`flight-path`].includes(e)}function Gn({animation:e,progress:t,estimatedDurationMs:n,overdue:r,indeterminate:i,seed:a}){let o={"--running-progress":`${t*100}%`};return d(`div`,{className:`${Jt.field} ${r?Jt.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(Un,{}),e===`release-transit`&&u(qt,{}),e===`status-weather`&&u(Bn,{}),e===`falling-shapes`&&u(Ft,{progress:t,estimatedDurationMs:n,overdue:r,seed:a}),e===`snowman`&&u(zn,{progress:t,estimatedDurationMs:n,overdue:r,seed:a}),e===`flight-path`&&u(Kt,{progress:t,indeterminate:i})]})}var Kn=20;function qn(e,t){let n=Jn(!!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 Jn(e){let[t,n]=o(()=>Date.now());return r(()=>{if(!e)return;n(Date.now());let t=window.setInterval(()=>n(Date.now()),Kn);return()=>window.clearInterval(t)},[e]),t}function Yn(e,t,n){return`${e===void 0?`Run in progress`:`Elapsed ${Zn(e)}`} · ${t===void 0?`Expected duration unavailable`:`Expected ≈ ${Zn(t)}`}${n?` · Over estimate`:``}`}function Xn(e,t,n){let r=e===void 0?`—`:Qn(e),i=t===void 0?`?`:`~${Qn(t)}`;return`${n?`⚠`:`\xA0`}${r}/${i}`}function Zn(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 Qn(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 $n({elapsedMs:e,estimatedDurationMs:t,overdue:n}){return d(`p`,{className:`${Jt.timing} ${n?Jt.timingOverdue:``}`,children:[u(`span`,{className:`screen-reader-only`,children:Yn(e,t,n)}),u(`span`,{"aria-hidden":`true`,children:Xn(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 er({animation:e,timing:t}){let{elapsedMs:n,estimatedDurationMs:r,hasEstimate:i,overdue:a,progress:o}=t,s=e===`runway`||e===`signal-field`,c=Yn(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(Hn,{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:Xn(n,r,a)})]}):c})]})}function tr(e){return[`radial`,`runway`,`orbit`,`signal-field`].includes(e)}function nr(e){return Array.from(e).reduce((e,t)=>e*31+t.charCodeAt(0)>>>0,7)}var rr=2e4,ir=15e3,ar=3e5,or=1.25,sr=[`radial`,`runway`,`orbit`,`signal-field`,`telemetry-bloom`,`release-transit`,`status-weather`,`falling-shapes`,`snowman`,`flight-path`];function cr({panel:e}){let t=dr(),n=e.running_animation===void 0||e.running_animation===`off`?void 0:e.running_animation,r=lr(e.demo_run_duration,rr),i=lr(e.demo_review_duration,ar),a=n?Math.ceil(i*or):r,o=Math.floor(t/a),s=n??sr[o%sr.length]??`radial`,c=o*a;return u(ur,{panel:e,animation:s,runStartedAt:c,estimatedDurationMs:n?i:ir})}function lr(e,t){return e?w(e)??t:t}function ur({panel:e,animation:t,runStartedAt:n,estimatedDurationMs:r}){let i=qn(new Date(n).toISOString(),r),a=Wn(t);return u(L,{panel:e,field:a?u(Gn,{animation:t,progress:i.progress,estimatedDurationMs:i.estimatedDurationMs,overdue:i.overdue,indeterminate:!i.hasEstimate,seed:nr(e.id)},`${t}-${n}`):void 0,children:d(F,{children:[u(I,{status:`running`,glyph:`↻`,label:`Running`}),d(`p`,{className:pt.variant,children:[u(`span`,{className:pt.variantPrefix,children:`Demo treatment · `}),t]}),a?u($n,{elapsedMs:i.elapsedMs,estimatedDurationMs:r,overdue:i.overdue}):u(er,{animation:t,timing:i})]})})}function dr(){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 fr(e,t=`Passed`){let n=et[e];return e===`passed`?{...n,label:t}:n}function pr(e){return e?e.parent?`${e.parent} › ${e.name}`:e.name:`Activity unavailable`}function mr({panel:e,envelope:t,attentionActive:n,updateHealth:r,rejectedPipeline:i}){if(!t&&i)return u(hr,{panel:e,rejected:i});if(!t)return u(L,{panel:e,attentionActive:n,children:u(F,{children:u(N,{children:`Loading…`})})});if(t.state===`error`){let r=Ze(t.error.kind);return d(L,{panel:e,envelope:t,attentionActive:n,error:!0,layout:`status-band`,children:[u(`div`,{"data-panel-anchor":`status`,children:u(I,{glyph:`⚠`,label:r.label,emphasis:r.emphasis})}),u(F,{anchor:`evidence`,children:u(N,{children:t.error.message})})]})}let a=E.safeParse(t.signal);return a.success?u(gr,{panel:e,envelope:t,signal:a.data,updateHealth:r,attentionActive:n}):d(L,{panel:e,envelope:t,attentionActive:n,error:!0,layout:`status-band`,children:[u(`div`,{"data-panel-anchor":`status`,children:u(I,{glyph:`⚠`,label:`Invalid signal`})}),u(F,{anchor:`evidence`,children:u(N,{children:`The received pipeline status could not be read.`})})]})}function hr({panel:e,rejected:t}){let n=fr(t.status);return d(L,{panel:e,sourceLink:t.link,busy:!1,layout:`status-band`,children:[u(`div`,{"data-panel-anchor":`status`,children:u(I,{status:t.status,glyph:n.glyph,label:n.label})}),d(F,{className:X.details,anchor:`evidence`,children:[d(N,{children:[t.github?`GitHub`:`The source`,` returned an older result; checking again`,t.github&&d(l,{children:[` · `,u(`a`,{href:`https://github.com/orgs/community/discussions/206725`,target:`_blank`,rel:`noopener noreferrer`,children:`GitHub API report`})]})]}),u(ot,{value:t.sourceUpdatedAt})]})]})}function gr({panel:e,envelope:t,signal:n,updateHealth:r,attentionActive:i}){let s=fr(n.status),[c,l]=o(()=>n.status===`running`?_r():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=>_r(e))}let p=e.running_animation??c??`off`,m=n.status===`running`&&p!==`off`,h=qn(n.runStartedAt,n.estimatedDurationMs),g=m&&Wn(p),_=m&&tr(p);return d(L,{panel:e,envelope:t,attentionActive:i,layout:g||_?void 0:`status-band`,field:g?u(Gn,{animation:p,progress:h.progress,estimatedDurationMs:h.estimatedDurationMs,overdue:h.overdue,indeterminate:!h.hasEstimate,seed:nr(e.id)}):void 0,children:[u(`div`,{"data-panel-anchor":`status`,children:u(I,{status:n.status,glyph:s.glyph,label:s.label})}),d(F,{className:X.details,anchor:`evidence`,children:[n.status===`running`&&u(P,{glyph:`⚙`,label:`Activity`,value:pr(n.activity),compact:{kind:`glyph-only`},title:`Activity: ${pr(n.activity)}`,className:X.activity}),n.branch&&u(P,{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($n,{elapsedMs:h.elapsedMs,estimatedDurationMs:n.estimatedDurationMs,overdue:h.overdue}),_&&u(er,{animation:p,timing:h}),n.status!==`running`&&n.durationMs!==void 0&&u(P,{glyph:`◷`,label:`Duration`,value:`Took ${vr(n.durationMs)}`,compact:{kind:`short-value`,value:vr(n.durationMs)},title:`Duration: Took ${vr(n.durationMs)}`,className:X.duration}),u(it,{sourceUpdatedAt:n.sourceUpdatedAt,observedAt:t.observedAt,running:n.status===`running`,runStartedAt:n.runStartedAt}),r&&u(at,{health:r})]})]})}function _r(e){let t=ye.filter(t=>t!==e);return t[Math.floor(Math.random()*t.length)]??`telemetry-bloom`}function vr(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 yr(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 br({panel:e,envelope:t,attentionActive:n,updateHealth:r}){if(!t)return u(L,{panel:e,attentionActive:n,children:u(F,{children:u(N,{children:`Loading…`})})});if(t.state===`error`){let r=Ze(t.error.kind);return d(L,{panel:e,envelope:t,attentionActive:n,error:!0,layout:`status-band`,children:[u(`div`,{"data-panel-anchor":`status`,children:u(I,{glyph:`⚠`,label:r.label,emphasis:r.emphasis})}),u(F,{anchor:`evidence`,children:u(N,{children:t.error.message})})]})}let i=oe.safeParse(t.signal);if(!i.success)return d(L,{panel:e,envelope:t,attentionActive:n,error:!0,layout:`status-band`,children:[u(`div`,{"data-panel-anchor":`status`,children:u(I,{glyph:`⚠`,label:`Invalid signal`})}),u(F,{anchor:`evidence`,children:u(N,{children:`The received pull-request health status could not be read.`})})]});let a=fr(i.data.status,`Healthy`),o=yr(i.data);return d(L,{panel:e,envelope:t,attentionActive:n,layout:`status-band`,children:[u(`div`,{className:Z.statusAnchor,"data-panel-anchor":`status`,children:u(I,{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(N,{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(P,{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(P,{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(R,{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(at,{health:r})]}),i.data.incompleteObservations&&u(`div`,{role:`status`,children:d(N,{className:Z.incomplete,children:[`⚠ Incomplete observations:`,` `,i.data.incompleteObservations.map(({label:e,message:t})=>`${e}: ${t}`).join(` · `)]})})]})]})}var xr={"pipeline-status":mr,"pull-request-health":br,"http-value":lt,"pipeline-animation-demo":cr};function Sr({panel:e,envelope:t,attentionActive:n,updateHealth:r,rejectedPipeline:i,facts:a}){let o=xr[e.type];return o?u(o,{panel:e,envelope:t,attentionActive:n,updateHealth:r,rejectedPipeline:i,facts:a}):u(Xe,{label:e.type,hint:`Not wired yet`,wide:!0})}var Cr={control:`_control_giazw_1`,backdrop:`_backdrop_giazw_5`,dialog:`_dialog_giazw_15`};function wr({env:e,auth:t}){let[n,i]=o(!1),[s,c]=o(`idle`),[f,p]=o(),m=a(null),h=a(null),g=a(null),_=a(!1);r(()=>{if(!n){_.current&&m.current?.focus(),_.current=!1;return}_.current=!0;let e=()=>i(!1),t=t=>{t.key===`Escape`&&e()},r=e=>{if(e.key!==`Tab`)return;let t=[...h.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=h.current;return a?.addEventListener(`keydown`,r),window.addEventListener(`keydown`,t),g.current?.focus(),()=>{a?.removeEventListener(`keydown`,r),window.removeEventListener(`keydown`,t)}},[n]);async function v(){i(!0),c(`loading`),p(void 0);try{let n=await A(e,`${e.proxyPath}/boards/${encodeURIComponent(e.board)}/security`,void 0,globalThis.fetch,t);if(!n.ok)throw Error(`Security details returned ${n.status}`);let r=be.safeParse(await n.json());if(!r.success)throw Error(`Security details were malformed`);p(r.data),c(`idle`)}catch{c(`error`)}}return d(l,{children:[u(`button`,{ref:m,className:Cr.control,type:`button`,"aria-expanded":n,"aria-controls":`security-details-dialog`,onClick:()=>void v(),children:`Security`}),n&&u(`div`,{className:Cr.backdrop,role:`presentation`,children:d(`section`,{ref:h,className:Cr.dialog,id:`security-details-dialog`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`security-title`,children:[u(`h2`,{id:`security-title`,children:`Security details`}),s===`loading`&&u(`p`,{"aria-live":`polite`,children:`Loading security details…`}),s===`error`&&u(`p`,{role:`alert`,children:`Security details are unavailable.`}),f&&u(Tr,{details:f}),u(`button`,{ref:g,type:`button`,onClick:()=>i(!1),children:`Close`})]})})]})}function Tr({details:e}){return e.policy.mode===`claim`?d(`p`,{children:[`OIDC is enabled. Access uses the `,u(`code`,{children:e.policy.claim}),` claim with a`,` `,u(`strong`,{children:e.policy.match}),` match policy.`]}):e.policy.mode===`authenticated`?u(`p`,{children:`OIDC is enabled. Any verified API access token with a subject may view this board.`}):u(`p`,{children:`OIDC is enabled. Access is limited to a server-held subject policy.`})}var Er={notice:`_notice_1h5h0_1`,blocked:`_blocked_1h5h0_18`},Dr=`https://github.com/robertfmurdock/ze-great-dashboard/blob/main/docs/oidc-authentication.md`;function Or({mode:e}){return e===`blocked`?d(`main`,{className:Er.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:Dr,children:`Read the authentication setup guide`}),`.`]})]}):d(`aside`,{className:Er.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:Dr,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`},kr=6e5;function Ar({schedules:e,events:t,retention:n,now:r=new Date}){let i=r.valueOf(),a=i-kr,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 jr(e,t){return Math.max(0,Math.min(100,(Date.parse(e)-(t.valueOf()-kr))/kr*100))}function Mr(e,t){return`${e.label}, panel ${e.panelId}; ${Nr(e.cadence)} cadence; ${e.inFlight?`request in flight`:e.nextDueAt?Pr(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 Nr(e){return e===`completion-window`?`Completion-window`:e===`running`?`Running`:`Normal`}function Pr(e,t){let n=Date.parse(e)-t.valueOf();return n<0?`Overdue by ${Fr(-n)}`:`Next poll in ${Fr(n)}`}function Fr(e){return e%6e4==0?`${Math.round(e/6e4)}m`:`${Math.max(1,Math.round(e/1e3))}s`}function Ir({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(()=>Ar({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":Mr(e,c),children:[e.observed.flatMap(({path:e,starts:t})=>t.map(t=>u(`i`,{className:$.observed,style:{left:`${jr(t,c)}%`},title:`Observed request: ${e}`},`${e}-${t}`))),e.nextDueAt&&u(`i`,{className:$.expected,style:{left:`${jr(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 Lr=6e4,Rr=1e4,zr=()=>globalThis.window.location.reload();function Br({env:e,diagnostics:t,fetcher:n,reload:i=zr,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(),Rr);t.record({kind:`client-update-check`,path:c});try{let o=await A(e,c,{cache:`no-store`,signal:u.signal},n??globalThis.fetch,a);if(!o.ok)throw Error(`Client identity returned ${o.status}`);let s=b.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(),Lr)}};return l(),()=>{r=!0,s?.abort()}},[a,t,e,n,i])}function Vr(e,t){if(t.state===`error`)return{state:t.state,link:t.link};if(e.type===`pipeline-status`){let e=E.safeParse(t.signal);return{state:t.state,status:e.success?e.data.status:void 0,link:t.link}}if(e.type===`pull-request-health`){let e=oe.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 Hr(e,t,n){if(!e)return!0;let r=Vr(t,e),i=Vr(t,n);return r.state!==i.state||r.status!==i.status||r.link!==i.link}function Ur(e){let t=Object.entries(e).map(([e,t])=>t?.envelope?{id:e,state:t.envelope.state,link:t.envelope.link}:{id:e,state:`unavailable`,link:null});return{state:t.some(e=>e.state===`ok`)?`ok`:`error`,link:null,facts:t}}function Wr(e,t){return JSON.stringify(e&&Ur(e))!==JSON.stringify(Ur(t))}var Gr=`ze-great-dashboard.panel-memory.v1`,Kr=1,qr=12096e5,Jr=class{now;histories;storage;constructor(e=De(),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[Yr(t)]=t);let i=r.latestCompleted;(!i||Xr(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=$r(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()-qr;for(let[n,r]of Object.entries(e.durations)){let i=Zr(r.sourceUpdatedAt);(i===void 0||i<t)&&delete e.durations[n]}let n=e.latestCompleted?Zr(e.latestCompleted.sourceUpdatedAt):void 0;e.latestCompleted&&(n===void 0||n<t)&&delete e.latestCompleted}read(){let e=Oe(this.storage,Gr);return e?.schemaVersion!==Kr||!e.histories?{}:ei(e.histories)?e.histories:{}}persist(){ke(this.storage,Gr,{schemaVersion:Kr,histories:this.histories})}};function Yr(e){return e.sourceRunId??e.link??e.sourceUpdatedAt}function Xr(e,t){let n=Zr(e),r=Zr(t);return n!==void 0&&(r===void 0||n>=r)}function Zr(e){let t=Date.parse(e);return Number.isFinite(t)?t:void 0}function Qr(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 $r(e){return JSON.stringify([e.board,e.panelId,e.source,e.workflow,e.branch])}function ei(e){return ri(e)?Object.values(e).every(ti):!1}function ti(e){return!ri(e)||!ri(e.durations)||!Object.values(e.durations).every(ni)?!1:e.latestCompleted===void 0||ni(e.latestCompleted)}function ni(e){return ri(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`&&Zr(e.sourceUpdatedAt)!==void 0:!1}function ri(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}async function ii(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:ze(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=te.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:ai(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:oi(t)}),{error:oi(t)}}}function ai(e,t){let n=t.headers.get(`x-dashboard-request-id`);return{reason:e.error.message,...n?{supportReference:n}:{}}}function oi(e){return e instanceof Error?e.message:String(e)}function si(e){return e.reconciliation.kind===`rejected`&&e.accepted?{envelope:e.current,rejected:{status:e.accepted.status,sourceUpdatedAt:e.accepted.sourceUpdatedAt,link:e.accepted.link,github:ui(e.reconciliation.envelope.link)}}:{envelope:e.reconciliation.envelope}}function ci(e){let t=li(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 li(e){if(e.state!==`ok`)return;let t=E.safeParse(e.signal);return t.success?t.data:void 0}function ui(e){if(!e)return!1;try{return new URL(e).hostname===`github.com`}catch{return!1}}function di(e){return e.panels.filter(e=>!D(e.position)&&(e.type===`pipeline-status`||e.type===`pull-request-health`||e.type===`http-value`))}function fi(e,t){return`${e.proxyPath}/panel/${encodeURIComponent(e.board)}/${encodeURIComponent(t)}`}function pi(e,t,n){let r=fi(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`,...mi(n).map(({workflow:e})=>`${r}/update-workflow/${encodeURIComponent(e)}`)]:[r];return{panelId:n.id,label:n.label??n.id,settings:ve(e,n),cadence:`normal`,inFlight:!1,knownPaths:i}}function mi(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 hi(e,t,n){let r=gi(e);if(!r)return{delayMillis:n.refreshMillis,cadence:`normal`};let i=_i(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 gi(e){if(e?.state!==`ok`)return;let t=E.safeParse(e.signal);return t.success&&t.data.status===`running`?t.data:void 0}function _i(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 vi(e){let t=[],n=e.workflows.map(({workflow:e,observation:n})=>{let r=bi(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=xi(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:yi(e,n,[],t,Si(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.`}),yi(e,n,r.pullRequests.map(n=>{let r=e.builds.get(n.branch),i=bi(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,Si([...e.workflows.map(({observation:e})=>e),e.candidates,...e.builds.values()]))}function yi(e,t,n,r,i){let a=Ci([...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 bi(e,t){if(e?.state!==`ok`)return;let n=(t===`pull-request-workflow`?le:ue).safeParse(e.signal);return n.success?{item:n.data.item}:void 0}function xi(e){if(e?.state!==`ok`)return;let t=ce.safeParse(e.signal);return t.success?t.data:void 0}function Si(e){return e.flatMap(({envelope:e})=>e?.state===`ok`?[e.observedAt]:[])}function Ci(e){return e.reduce((e,t)=>ie(t)>ie(e)?t:e,`passed`)}function wi({board:e,env:t,diagnostics:n,memory:i,auth:s}){let[c,l]=o({}),[u,d]=o({}),[f,p]=o({}),[m,h]=o([]),[g,_]=o({}),v=a({}),y=a({}),b=a(null);return b.current||=i??new Jr,r(()=>{if(v.current={},y.current={},l({}),d({}),p({}),h([]),_({}),!e)return;let r=!1,i=new Set,a=new Set,o=di(e),c=o.map(n=>pi(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=b.current;if(!c)return;let m=u.get(e.id);if(!m)continue;let{settings:h}=m,g=fi(t,e.id),x,S,C=()=>{S=new Date().toISOString(),r||d(t=>{if(!t[e.id])return t;let n={...t};return delete n[e.id],n})},w=t=>{let n=S;if(r||!n)return;let i=Di(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=`${g}/facts`,_=await Promise.all(c.map(async r=>{let i=`${m}/${encodeURIComponent(r.id)}`,a=await ii({diagnostics:n,panelId:e.id,path:i,signal:u?.signal,cache:l,fetcher:(e,n)=>A(t,e,n,globalThis.fetch,s)});return[r.id,a.error?{failure:a.error}:a]}));if(!r&&!u.signal.aborted){let t=Object.fromEntries(_),r=y.current[e.id];Wr(r,t)&&n.record({kind:`panel-rendered`,panelId:e.id,path:g,rendered:Ur(t)}),y.current={...y.current,[e.id]:t},p(y.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=mi(e),u=new Map,d,p=async r=>{let i=await ii({diagnostics:n,panelId:e.id,path:r,signal:d?.signal,cache:u,fetcher:(e,n)=>A(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=g,[s,...u]=await Promise.all([p(`${t}/pull-requests`),...c.map(({workflow:e})=>p(`${t}/update-workflow/${encodeURIComponent(e)}`))]),_=s.envelope?.state===`ok`&&Ei(s.envelope.signal)?s.envelope.signal.pullRequests:[];if(r||d.signal.aborted){a.delete(d);return}let y=await Promise.all(_.map(async e=>[e.branch,await p(`${t}/pull-request-build?branch=${encodeURIComponent(e.branch)}`)])),b=vi({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(y)});if(r||d.signal.aborted)a.delete(d);else{if(b&&!r){x=b,C();let t=v.current[e.id];Hr(t,e,b)&&n.record({kind:`panel-rendered`,panelId:e.id,path:g,rendered:Vr(e,b)}),v.current={...v.current,[e.id]:b},l(v.current)}else r||w(`No usable pull-request observations.`);if(o=!1,a.delete(d),!r){let t=hi(x,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 T=()=>{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:g}),A(t,g,void 0,globalThis.fetch,s).then(async t=>{let r={kind:`panel-fetch-response`,panelId:e.id,path:g,status:t.status,cache:ze(t.headers)};if(t.status===304)n.record(r),C();else try{let i=ki(await t.json());if(!i){n.record(r),n.record({kind:`panel-fetch-parse-failure`,panelId:e.id,path:g,message:`Response was not a valid signal envelope.`}),w(`Response was not a valid signal envelope.`);return}return n.record({...r,envelope:i,...i.state===`error`?{failure:Ti(i,t)}:{}}),C(),{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:g,message:Di(t)}),new Oi(t)}}).then(i=>{if(!i)return;let a=i.envelope;if(e.type===`pipeline-status`){let o=Qr(t.board,e),s=c.latest(o),l=ci({envelope:a,accepted:s,estimatedDurationMs:c.resolveEstimatedDuration(o)}),u=si({current:v.current[e.id],reconciliation:l,accepted:s});if(l.kind===`rejected`&&s){let t=l.signal;n.recordGithubConsistencyIncident({panelId:e.id,endpoint:g,identity:{source:o.source,workflow:o.workflow,branch:o.branch},accepted:s,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}}),r||_(t=>({...t,[e.id]:u.rejected}));return}if(l.kind===`accepted`&&(a=l.envelope,!r&&u.rejected===void 0&&_(t=>{if(!t[e.id])return t;let n={...t};return delete n[e.id],n}),l.accepted&&c.rememberLatest(o,l.accepted),l.durationSample)){let e={link:l.durationSample.link,...l.durationSample.sourceRunId?{sourceRunId:l.durationSample.sourceRunId}:{},durationMs:l.durationSample.durationMs,sourceUpdatedAt:l.durationSample.sourceUpdatedAt};c.recordRun(o,e,l.signal.status===`passed`)}}if(x=a,!r){let t=v.current[e.id];Hr(t,e,a)&&n.record({kind:`panel-rendered`,panelId:e.id,path:g,rendered:Vr(e,a)}),v.current={...v.current,[e.id]:a},l(v.current)}}).catch(t=>{w(t),t instanceof Oi||n.record({kind:`panel-fetch-failure`,panelId:e.id,path:g,message:Di(t)})}).finally(()=>{if(o=!1,!r){let t=hi(x,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),T()},t.delayMillis);i.add(r)}}))};T()}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,rejectedPipelines:g}}function Ti(e,t){let n=t.headers.get(`x-dashboard-request-id`);return{reason:e.error.message,...n?{supportReference:n}:{}}}function Ei(e){return typeof e==`object`&&!!e&&e.type===`pull-request-candidates`&&Array.isArray(e.pullRequests)}function Di(e){return e instanceof Error?e.message:String(e)}var Oi=class extends Error{constructor(e){super(Di(e))}};function ki(e){let t=te.safeParse(e);return t.success?t.data:void 0}function Ai({env:e}){return e.security===`blocked`?u(Or,{mode:`blocked`}):e.auth?u(Je,{env:e,auth:e.auth,children:(t,n)=>u(ji,{env:e,accessToken:t,onDenied:n})}):u(ji,{env:e})}function ji({env:e,accessToken:t,onDenied:n}){let[s,c]=o(),[l,f]=o(),p=a(null);p.current||=new Le(e);let m=p.current,h=i(()=>t?{accessToken:t,onAuthenticationFailure:e=>e===403&&n?.()}:void 0,[t,n]);Br({env:e,diagnostics:m,auth:h});let{signals:g,updateHealth:_,factSignals:v,schedules:y,rejectedPipelines:b}=wi({board:l===e.board?s:void 0,env:e,diagnostics:m,auth:h}),x=i(()=>s?me(s.panels):void 0,[s]),S=i(()=>xe({board:s,signals:g,updateHealth:_,factSignals:v}),[s,v,g,_]),C=S.length?s?.attention?.treatment:void 0,w=new Set(S.map(e=>e.panelId));return r(()=>{x&&x.issues.length!==0&&m.record({kind:`layout-analyzed`,issueCount:x.issues.length,affectedPanelIds:x.issues.map(e=>e.panelId)})},[m,x]),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}),A(e,n,void 0,globalThis.fetch,h).then(async e=>{if(m.record({kind:`board-fetch-response`,path:n,status:e.status,cache:ze(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:Pi(e)}),new Fi(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 Fi||m.record({kind:`board-fetch-failure`,path:n,message:Pi(r)}),t||(c({panels:[]}),f(e.board))}),()=>{t=!0}},[h,m,e]),d(`div`,{className:`${O.board} ${C?O[`attention-${C}`]:``}`,"data-attention-treatment":C,"data-attention-active":S.length||void 0,children:[d(`header`,{className:O.header,children:[u(`h1`,{className:O.title,children:e.board}),e.security===`warning`&&u(Or,{mode:`warning`}),S.length>0&&d(`aside`,{className:O.attentionRail,role:`alert`,"aria-label":`Important panel attention`,children:[u(`span`,{className:O.attentionGlyph,"aria-hidden":`true`,children:`⚠`}),u(`ul`,{children:S.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:O.grid,children:[!s&&u(Xe,{label:`board`,hint:`Loading configuration…`,wide:!0}),s?.panels.filter(e=>!D(e.position)).map(e=>u(Sr,{panel:e,envelope:g[e.id],attentionActive:w.has(e.id),updateHealth:_[e.id],rejectedPipeline:b[e.id],facts:v[e.id]},e.id))]}),d(`footer`,{className:O.footer,"data-board-footer":!0,children:[u(`span`,{children:`Signals are read live from their configured authorities.`}),d(`div`,{className:O.footerTools,children:[h&&u(wr,{env:e,auth:h}),x&&x.issues.length>0&&u(Mi,{board:e.board,layout:x,env:e,auth:h}),u(we,{log:m,updateActivity:()=>{let e=m.retainedEvidence(),t=Ar({schedules:y,...e});return{capturedAt:t.capturedAt,window:t.window,schedules:t.schedules}}}),u(Ir,{board:s,schedules:y,log:m})]})]})]})}function Mi({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:O.layoutWarning,"data-layout-warning":!0,children:[d(`button`,{className:O.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:O.layoutWarningDialog,id:c,role:`dialog`,"aria-labelledby":`${c}-title`,"aria-modal":`false`,children:[d(`div`,{className:O.layoutWarningHeading,children:[u(`strong`,{id:`${c}-title`,children:`Layout warnings`}),u(`button`,{className:O.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:O.layoutWarningDownloads,children:[u(`button`,{type:`button`,onClick:()=>void Ni(n,`${l}/rendered`,i),children:`Download legal rendered layout`}),u(`button`,{type:`button`,onClick:()=>void Ni(n,`${l}/authored`,i),children:`Download authored layout`})]}),u(`p`,{className:O.layoutWarningNote,children:`The legal rendered layout normalizes the currently visible explicit area into 12×12 and makes the smallest deterministic adjustments needed to avoid collisions. The authored layout preserves the original coordinates exactly.`})]})]})}async function Ni(e,t,n){let r=await A(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 Pi(e){return e instanceof Error?e.message:String(e)}var Fi=class extends Error{constructor(e){super(Pi(e))}},Ii={error:`_error_yx1g9_1`};function Li({message:e}){return d(`div`,{className:Ii.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 Ri=document.getElementById(`root`);if(!Ri)throw Error(`No #root element in the document — the template is not the one we expect.`);var zi=c(Ri);try{zi.render(u(t,{children:u(Ai,{env:x()})}))}catch(e){zi.render(u(Li,{message:e instanceof Error?e.message:String(e)}))}
|
|
3
|
-
//# sourceMappingURL=index-B6LHEOFj.js.map
|