@continuous-excellence/ze-great-dashboard-client 0.31.51 → 0.31.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,3 +1,3 @@
|
|
|
1
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 ee=/^([1-9][0-9]*)(ms|s|m|h)$/,te={ms:1,s:1e3,m:6e4,h:36e5};function S(e){let t=ee.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*te[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 ne=e.enum([`unreachable`,`unauthorized`,`not-found`,`no-runs`,`upstream-error`]),re=e.object({kind:ne,message:e.string()}),ie=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:re})]),ae=e.object({kind:e.enum([`job`,`stage`,`step`]),name:e.string().min(1),parent:e.string().min(1).optional()}),C=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:ae.optional(),estimatedDurationMs:e.number().int().positive().optional(),sourceUpdatedAt:e.iso.datetime().optional()}),oe=e.discriminatedUnion(`status`,[e.object({type:e.literal(`test-count`),status:e.literal(`reported`),total:e.number().int().nonnegative(),passed:e.number().int().nonnegative().optional(),failed:e.number().int().nonnegative().optional(),skipped:e.number().int().nonnegative().optional()}),e.object({type:e.literal(`test-count`),status:e.literal(`pending`)}),e.object({type:e.literal(`test-count`),status:e.literal(`not-reported`)})]),se={passed:0,cancelled:1,unknown:2,running:3,warning:4,failed:5};function ce(e){return se[e]}var le=e.object({label:e.string().min(1),status:C.shape.status,detail:e.string().min(1),link:e.url().nullable()}),ue=e.object({type:e.literal(`pull-request-health`),status:C.shape.status,summary:e.string().min(1),workflows:e.array(le),pullRequests:e.array(le),incompleteObservations:e.array(e.object({label:e.string().min(1),message:e.string().min(1)})).optional(),newestObservedAt:e.iso.datetime().optional()}),de=e.object({number:e.number().int().positive(),branch:e.string().min(1),link:e.url()}),fe=e.object({type:e.literal(`pull-request-candidates`),pullRequests:e.array(de),truncated:e.boolean().optional()}),pe=e.object({type:e.literal(`pull-request-workflow`),workflow:e.string().min(1),item:le}),me=e.object({type:e.literal(`pull-request-build`),branch:e.string().min(1),item:le}),he=e.object({type:e.literal(`http-value`),value:e.union([e.string(),e.number(),e.boolean()])}),ge=12,_e=12;function ve(e){let t=e.flatMap(e=>!e.position||w(e.position)||ye(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&&!w(i.position))for(let a=r+1;a<e.length;a++){let r=e[a];if(!r?.position||w(r.position)||!be(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 w(e){return e?.x===0&&e.y===0&&e.w===0&&e.h===0}function ye(e){return!w(e)&&e.x+e.w<=ge&&e.y+e.h<=_e}function be(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 xe={refreshMillis:6e4,runningRefreshMillis:15e3,runningCompletionRefreshMillis:5e3,runningCompletionWindowMillis:12e4};function Se(e,t){let n=(e,t)=>S(e??``)??t,r=(r,i,a)=>n(t[r],n(e[i],a));return{refreshMillis:r(`refresh`,`refresh`,xe.refreshMillis),runningRefreshMillis:r(`running_refresh`,`running_refresh`,xe.runningRefreshMillis),runningCompletionRefreshMillis:r(`running_completion_refresh`,`running_completion_refresh`,xe.runningCompletionRefreshMillis),runningCompletionWindowMillis:r(`running_completion_window`,`running_completion_window`,xe.runningCompletionWindowMillis)}}var Ce=[`radial`,`runway`,`orbit`,`signal-field`,`telemetry-bloom`,`release-transit`,`status-weather`,`falling-shapes`,`snowman`,`flight-path`],we=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`])})])}),T={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 Te(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=Ee(i);return a?[{panelId:t.id,label:n,reason:`${r.label}: ${a}`,factId:r.id}]:[]});let r=De(t.type,e.signals[t.id],e.updateHealth[t.id]);return r?[{panelId:t.id,label:n,reason:r}]:[]}):[]}function Ee(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:he.safeParse(e.envelope.signal).success?void 0:`Invalid value`}function De(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=C.safeParse(t.signal);return e.success?e.data.status===`failed`?`Pipeline failed`:void 0:`Invalid signal`}if(e===`pull-request-health`){let e=ue.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 he.safeParse(t.signal).success?void 0:`Invalid value`}}var E={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 Oe({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:E.diagnostics,children:[d(`button`,{className:E.button,type:`button`,"aria-expanded":n,onClick:()=>r(!n),children:[`Diagnostics (`,i,`)`,a>0&&` · GitHub consistency ${a}`]}),n&&d(`div`,{className:E.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?` (${ke(c.retained.firstEventAt,c.retained.lastEventAt)})`:``,`. They are never uploaded.`]}),c.retained.evidenceMayBeIncomplete&&d(`p`,{className:E.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:E.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:E.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:E.actions,children:[u(`button`,{className:E.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:E.button,type:`button`,onClick:()=>{window.confirm(`Clear this browser’s retained dashboard diagnostics?`)&&e.clear()},children:`Clear`})]})]})]})}function ke(e,t){return e===t?e:`${e} to ${t}`}function Ae(){try{return window.localStorage}catch{return}}function je(e,t){try{let n=e?.getItem(t);return n?JSON.parse(n):void 0}catch{return}}function Me(e,t,n){try{e?.setItem(t,JSON.stringify(n))}catch{}}function Ne(e,t){try{e?.removeItem(t)}catch{}}function Pe(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 Fe=`0.31.51`,Ie=`ze-great-dashboard.diagnostics.v2`,Le=`ze-great-dashboard.diagnostics.v1`,Re=2e3,ze=6048e5,Be=[`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`],Ve=class{env;storage;now;events=[];retention=We();revision=0;incidents=[];listeners=new Set;sessionId=crypto.randomUUID?.()??`${Date.now()}-${Math.random()}`;constructor(e,t=Ae(),n=()=>new Date){this.env=e,this.storage=t,this.now=n,Ne(this.storage,Le),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=Ke([...this.events,{...e,schemaVersion:2,at:this.now().toISOString(),sessionId:this.sessionId,board:this.env.board,clientVersion:Fe,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=()=>Fe;assetPath=()=>this.env.assetPath;snapshot=()=>this.revision;summary=()=>Pe(this.events,this.retention,this.incidents.length);retainedEvidence=()=>({events:[...this.events],retention:{...this.retention}});clear(){this.events=[],this.incidents=[],this.retention=We(),Ne(this.storage,Ie),this.revision++,this.notify()}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});export=e=>({schemaVersion:2,exportedAt:this.now().toISOString(),client:{version:Fe,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=je(this.storage,Ie);if(!e||e.schemaVersion!==2||!Array.isArray(e.events)||!e.events.every(qe))return Ne(this.storage,Ie),[];let t=Ke(e.events.map(e=>({...e,schemaVersion:2})),this.now(),Ge(e.retention));return this.retention=t.retention,this.incidents=He(e.githubConsistencyIncidents),t.events}persist(){Me(this.storage,Ie,{schemaVersion:2,events:this.events,retention:this.retention,githubConsistencyIncidents:this.incidents})}notify(){for(let e of this.listeners)e()}};function He(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 Ue(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 We(){return{eventsPrunedByAge:0,eventsPrunedByCount:0}}function Ge(e){if(!e||typeof e!=`object`)return We();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 Ke(e,t,n){let r=t.valueOf()-ze,i=e.filter(e=>Number.isFinite(new Date(e.at).valueOf())&&new Date(e.at).valueOf()>=r),a=e.length-i.length,o=Math.max(0,i.length-Re);return{events:i.slice(-2e3),retention:{eventsPrunedByAge:n.eventsPrunedByAge+a,eventsPrunedByCount:n.eventsPrunedByCount+o}}}function qe(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`&&Be.includes(t.kind)}function D(e,t,n,r=globalThis.fetch,i={}){let a=new Headers(n?.headers);return a.set(`X-Dashboard-Client-Version`,Fe),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 Je({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:T.layoutWarning,"data-layout-warning":!0,children:[d(`button`,{className:T.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:T.layoutWarningDialog,id:c,role:`dialog`,"aria-labelledby":`${c}-title`,"aria-modal":`false`,children:[d(`div`,{className:T.layoutWarningHeading,children:[u(`strong`,{id:`${c}-title`,children:`Layout warnings`}),u(`button`,{className:T.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:T.layoutWarningDownloads,children:[u(`button`,{type:`button`,onClick:()=>void Ye(n,`${l}/rendered`,i),children:`Download legal rendered layout`}),u(`button`,{type:`button`,onClick:()=>void Ye(n,`${l}/authored`,i),children:`Download authored layout`})]}),u(`p`,{className:T.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 Ye(e,t,n){let r=await D(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)}var Xe={auth:`_auth_19xn9_1`,signout:`_signout_19xn9_24`},Ze=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 Qe(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 Ze,stateStore:new _({store:window.sessionStorage}),automaticSilentRenew:!0}),n=$e(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 $e(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 et({env:e,auth:t,children:n}){let r=i(()=>Qe(t),[t]);return u(f,{userManager:r,onSigninCallback:()=>window.history.replaceState({},document.title,window.location.pathname),children:u(tt,{env:e,children:n})})}function tt({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:Xe.auth,"aria-live":`polite`,children:`Signing in…`}):s?d(`main`,{className:Xe.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:Xe.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:Xe.signout,type:`button`,onClick:()=>void i.signoutRedirect(),children:`Sign out`}),t(i.user.access_token,h)]})}var O={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 nt({label:e,hint:t,wide:n=!1}){return d(`section`,{className:`${O.panel} ${n?O.wide:``}`,"data-panel":!0,"data-panel-id":`placeholder`,children:[u(`h2`,{className:O.label,children:e}),u(`p`,{className:O.hint,children:t})]})}function k(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 A={fact:`_fact_bnc4n_1`,facts:`_facts_bnc4n_5`,factCell:`_factCell_bnc4n_12`,factSource:`_factSource_bnc4n_31`};function rt(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 it={"pipeline-status":{glyph:`▣`,label:`Pipeline status`},"pull-request-health":{glyph:`⌘`,label:`Pull request health`},"http-value":{glyph:`◌`,label:`HTTP value`},"test-count":{glyph:`≡`,label:`Test count`},"pipeline-animation-demo":{glyph:`✦`,label:`Pipeline animation demo`}},at={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 ot(e){return it[e]}[...Object.entries(it).map(([e,t])=>({glyph:t.glyph,meaning:`panel type: ${e}`})),...Object.entries(at).map(([e,t])=>({glyph:t.glyph,meaning:`status: ${e}`}))];function j({children:e,className:t,title:n}){return u(`p`,{className:`${O.hint} ${t??``}`,title:n,children:e})}function M({glyph:e,label:t,value:n,compact:r,title:i,observed:a=!1,emphasis:o,className:s}){return d(`p`,{className:`${O.hint} ${a?O.observed:``} ${o?O[o]:``} ${O.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:O.metaValue,title:i,children:[u(`span`,{className:O.fullValue,children:n}),r&&u(`span`,{className:O.compactValue,"aria-hidden":`true`,children:r.kind===`short-value`?r.value:null})]})]})}function N({children:e,className:t,priority:n=`secondary`,anchor:r}){return u(`div`,{className:`${O.evidence} ${t??``}`,"data-panel-evidence":!0,"data-panel-evidence-priority":n,"data-panel-anchor":r,children:e})}function P({status:e,emphasis:t,glyph:n,label:r,compactOnly:i=!1}){return d(`p`,{className:`${O.status} ${e?O[e]:``} ${t?O[t]:``} ${i?O.compactOnlyStatus:``}`,"data-panel-status":!0,children:[n&&u(`span`,{className:O.statusGlyph,"aria-hidden":`true`,children:n}),n&&r&&` `,u(`span`,{className:O.statusText,children:r})]})}function st({children:e,emphasis:t}){return u(`p`,{className:`${O.status} ${t?O[t]:``}`,children:e})}function F({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=ot(e.type),m=f!==void 0&&f.h<=2,h=f!==void 0&&f.h<=3;return d(`section`,{className:`${O.panel} ${O[`density-${l}`]} ${m?O.shallow:``} ${h?O.short:``} ${a?O.error:``} ${i?O.attentionActive:``}`,id:`panel-${e.id}`,style:rt(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(ct,{panelId:e.id,link:t?.link??n}),d(`div`,{className:`${O.content} ${s===`status-band`?O.statusBand:``}`,"data-panel-content":!0,"data-panel-layout":s,children:[d(`h2`,{className:O.label,"data-panel-anchor":`identity`,children:[p&&u(`span`,{className:O.typeGlyph,"aria-hidden":`true`,title:p.label,"data-panel-type-glyph":!0,children:p.glyph}),u(`span`,{className:O.identityText,"data-panel-identity-text":!0,children:e.label??e.id})]}),c]})]})}function ct({panelId:e,link:t}){return t?d(`a`,{className:O.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 I({value:e,label:t=`Observed`}){return u(R,{value:e,label:t})}function lt({sourceUpdatedAt:e,observedAt:t,running:n,runStartedAt:r}){return n&&r?u(R,{value:r,label:`Started`}):u(R,{value:e??t,label:e?`Last update`:`Observed`})}function L({health:e}){let t=e.consecutiveFailures>=3,n=t?`Updates unavailable`:`Updates delayed`;return d(l,{children:[u(M,{glyph:`⚠`,label:n,value:`${n} · ${e.message}`,title:e.message,emphasis:t?`serious`:`warning`}),u(R,{value:e.lastConfirmedAt,label:`Last confirmed`})]})}function ut({value:e}){return u(R,{value:e,label:`Last confirmed`})}function R({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} ${dt(i)}`;return u(M,{glyph:`◷`,label:t,value:a,compact:{kind:`short-value`,value:ft(i)},title:`${t} at ${r}`,observed:!0})}function dt(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 ft(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 pt({panel:e,envelope:t,attentionActive:n,updateHealth:r,facts:i}){if(e.facts)return u(mt,{panel:e,attentionActive:n,facts:i});if(!t)return u(F,{panel:e,attentionActive:n,children:u(N,{children:u(j,{children:`Loading…`})})});if(t.state===`error`){let r=k(t.error.kind);return u(F,{panel:e,envelope:t,attentionActive:n,error:!0,children:d(N,{children:[u(P,{glyph:`⚠`,label:r.label,emphasis:r.emphasis}),u(j,{children:t.error.message})]})})}let a=he.safeParse(t.signal);return a.success?u(F,{panel:e,envelope:t,attentionActive:n,children:d(N,{className:A.fact,children:[u(P,{glyph:`✓`,label:`Value read`,compactOnly:!0}),u(st,{children:String(a.data.value)}),u(I,{value:t.observedAt}),r&&u(L,{health:r})]})}):u(F,{panel:e,envelope:t,attentionActive:n,error:!0,children:u(N,{children:u(P,{glyph:`⚠`,label:`Invalid value`})})})}function mt({panel:e,attentionActive:t,facts:n}){return e.facts?u(F,{panel:e,attentionActive:t,children:u(N,{children:u(`div`,{className:A.facts,"data-http-value-facts":!0,children:e.facts.map(e=>u(ht,{label:e.label,observation:n?.[e.id]},e.id))})})}):null}function ht({label:e,observation:t}){let n=t?.envelope;if(!n)return d(`section`,{className:A.factCell,"data-http-value-fact":!0,children:[u(`h3`,{children:e}),u(st,{emphasis:t?.failure?`serious`:void 0,children:t?.failure?`⚠ Updates unavailable`:`Loading…`}),t?.updateHealth&&u(L,{health:t.updateHealth})]});if(n.state===`error`){let t=k(n.error.kind);return d(`section`,{className:A.factCell,"data-http-value-fact":!0,"data-error":!0,children:[u(gt,{label:e,link:n.link}),u(`h3`,{children:e}),u(P,{glyph:`⚠`,label:t.label,emphasis:t.emphasis}),u(j,{children:n.error.message}),u(I,{value:n.observedAt})]})}let r=he.safeParse(n.signal);return r.success?d(`section`,{className:A.factCell,"data-http-value-fact":!0,children:[u(gt,{label:e,link:n.link}),u(`h3`,{children:e}),u(st,{children:String(r.data.value)}),u(I,{value:n.observedAt})]}):d(`section`,{className:A.factCell,"data-http-value-fact":!0,"data-error":!0,children:[u(gt,{label:e,link:n.link}),u(`h3`,{children:e}),u(P,{glyph:`⚠`,label:`Invalid value`,emphasis:`serious`}),u(I,{value:n.observedAt})]})}function gt({label:e,link:t}){return t?d(`a`,{className:A.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 _t={variant:`_variant_14ks8_1`,variantPrefix:`_variantPrefix_14ks8_9`},z={field:`_field_1x3vm_1`,grid:`_grid_1x3vm_10`,piece:`_piece_1x3vm_14`,cell:`_cell_1x3vm_34`,clearingCell:`_clearingCell_1x3vm_38`,"clear-cell":`_clear-cell_1x3vm_1`},vt=.85,yt=[[{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 bt(e,t){return e>t?`horizontal`:`vertical`}function xt(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 St(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 Ct(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 wt(e,t,n){let r=yt.filter(e=>St(e,t,n));return r[Nt(e,r.length)]??[{x:0,y:0}]}function Tt(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=>Ct(s,e))||!Mt(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<jt(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[Nt(a,d.length)];return f?{x:f.x,y:f.y}:void 0}function Et(e,t,n,r,i,a){let o=yt.flatMap((o,s)=>{if(!St(o,t,n))return[];let c=Tt(o,e,t,n,r,i+s*31,a);return c?[{shape:o,destination:c}]:[]});if(o.length!==0)return o[Nt(i,o.length)]}function Dt(e,t,n){return Math.ceil(e*t*vt*Math.min(1,Math.max(0,n)))}function Ot(e){return e.reduce((e,t)=>e+t.cells.length,0)}function kt(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 At(e,t,n,r,i){let a=[];for(let o=0;o<i;o+=1){let i=r+o*17,s=wt(i,t,n),c=Tt(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 jt(e,t){return t===`vertical`?new Set(e.map(e=>e.x)).size:new Set(e.map(e=>e.y)).size}function Mt(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=>Ct({...i,y:e},t)))return!1;return i.y+s<=r}for(let e=n-o;e>=i.x;--e)if(a.some(t=>Ct({...i,x:e},t)))return!1;return i.x+o<=n}function Nt(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 Pt=1250;function Ft(){return{settled:[],active:[],nextPieceAt:Pt,recycleUntil:0,nextId:0,recycling:!1,clearingCells:[]}}function It(e,t){if(t.elapsed<e.recycleUntil)return e;let n=e.settled,r=e.active,i=e.nextPieceAt,a=e.recycleUntil,o=e.nextId,s=e.recycling,c=e.clearingCells;if(s&&(s=!1,c=[]),t.elapsed>=i&&r.length===0){let a=Dt(t.columns,t.rows,t.progress);if(t.progress<1&&Ot(n)>=a)return{...e,recycling:s,clearingCells:c};let l=Et(t.direction,t.columns,t.rows,n,t.seed+o*17+1,!t.overdue);if(!l&&(t.progress>=1||t.estimatedDurationMs===void 0)){let r=kt(t.direction,t.columns,t.rows,n,!0);if(r)return{...e,settled:r.shapes,recycleUntil:t.elapsed+500,nextPieceAt:t.elapsed+500,recycling:!0,clearingCells:r.cleared}}if(l){let e=Math.max(...l.shape.map(e=>e.y))+1;r=[{id:o,bornAt:t.elapsed,cells:l.shape,x:t.direction===`horizontal`?t.columns-Math.max(...l.shape.map(e=>e.x))-.5:l.destination.x,y:t.direction===`vertical`?-e+.5:l.destination.y,targetX:l.destination.x,targetY:l.destination.y,phase:`entry`}],o+=1,i+=Rt(t.estimatedDurationMs,t.columns,t.rows)}}let l=[];for(let e of r){let r=t.elapsed-e.bornAt,i=Math.min(1,Math.max(0,(r-250)/850));if(i>=1&&e.targetX!==void 0&&e.targetY!==void 0){n=[...n,{...e,x:e.targetX,y:e.targetY,phase:`settled`}];continue}let a=t.direction===`horizontal`?t.columns-Math.max(...e.cells.map(e=>e.x))-1:e.targetX??e.x,o=t.direction===`vertical`?0:e.targetY??e.y,s=Math.min(1,Math.max(0,r/1100));l.push({...e,x:t.direction===`horizontal`?a+((e.targetX??a)-a)*i:a,y:t.direction===`vertical`?o+((e.targetY??o)-o)*i:o,phase:r<250?`entry`:s<.35?`align`:`travel`})}return{settled:n,active:l,nextPieceAt:i,recycleUntil:a,nextId:o,recycling:s,clearingCells:c}}function Lt(e){return[...e.settled,...e.active]}function Rt(e,t,n){let r=Math.ceil(t*n*.85);return e===void 0||r<=0?Pt:Math.max(400,e/Math.max(1,Math.ceil(r/3)))}var zt=50;function Bt({progress:e,estimatedDurationMs:t,overdue:n,seed:i=0}){let s=a(null),[c,l]=o({...xt(`vertical`),direction:`vertical`}),[f,p]=o(!1),[m,h]=o(Ft),g=a(c),_=a(void 0),v=a(e),y=a(i),b=a(Ft()),x=a(Date.now());r(()=>{v.current=e,y.current=i},[e,i]),r(()=>{let e=s.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect();if(t.width===0||t.height===0)return;let n=_.current??bt(t.width,t.height);_.current=n;let r={...xt(n,t.width,t.height),direction:n};g.current=r,l(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=()=>p(e.matches);return t(),e.addEventListener?.(`change`,t),()=>e.removeEventListener?.(`change`,t)},[]),r(()=>{if(b.current=Ft(),x.current=Date.now(),f){let e=At(c.direction,c.columns,c.rows,y.current,Math.max(1,Math.floor(v.current*6)));h({...Ft(),settled:e})}else h(b.current)},[c,f]),r(()=>{if(f)return;let e=window.setInterval(()=>{let e=It(b.current,{elapsed:Date.now()-x.current,...g.current,progress:v.current,estimatedDurationMs:t,overdue:n,seed:y.current});b.current=e,h(e)},zt);return()=>window.clearInterval(e)},[t,n,f]);let ee=Lt(m);return u(`div`,{ref:s,className:z.field,"data-running-part":`falling-shapes-field`,"data-overdue":n||void 0,"data-direction":c.direction,"data-recycling":m.recycling||void 0,style:{"--shape-columns":c.columns,"--shape-rows":c.rows},children:d(`div`,{className:z.grid,children:[m.clearingCells.map(e=>u(`span`,{className:z.clearingCell,style:{"--clear-x":e.x,"--clear-y":e.y}},`${e.x}-${e.y}`)),ee.map(e=>u(`div`,{className:z.piece,"data-piece":e.id,"data-piece-phase":e.phase,style:{"--piece-x":e.x,"--piece-y":e.y,"--piece-width":Math.max(...e.cells.map(e=>e.x))+1,"--piece-height":Math.max(...e.cells.map(e=>e.y))+1},children:e.cells.map(e=>u(`span`,{className:z.cell,style:{"--cell-x":e.x,"--cell-y":e.y}},`${e.x}-${e.y}`))},e.id))]})})}var B={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`},Vt={x:8,y:74},Ht={x:22,y:74},Ut={x:38,y:30},Wt={x:65,y:30},Gt={x:88,y:48};function Kt(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function qt(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 V(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 Jt(e){return{x:e.x-50,y:e.y-50}}function Yt(e,t){if(t){let e={x:50,y:30};return V(e,Jt(e),0,`holding`,20)}let n=Math.min(1,Math.max(0,e));if(n<.18)return V(Kt(Vt,Ht,n/.18),{x:0,y:0},0,`rollout`);if(n<.35){let e=(n-.18)/.17,t=qt(Ht,{x:28,y:74},{x:32,y:30},Ut,e),r=e*e*(3-2*e),i=Jt(t);return V(t,{x:i.x*r,y:i.y*r},-7,`climb`,20*r)}if(n<.7){let e=Kt(Ut,Wt,(n-.35)/.35);return V(e,Jt(e),0,`cruise`,20)}let r=(n-.7)/.3,i=qt(Wt,{x:72,y:30},{x:80,y:47},Gt,r),a=r*r*(3-2*r);return V(i,Jt(i),4,`approach`,20*(1-a))}function Xt({progress:e,indeterminate:t}){let n=Yt(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:B.scene,"data-running-part":`flight-path`,"data-flight-stage":n.stage,style:r,children:[d(`span`,{className:B.ground,"data-running-part":`flight-ground`,children:[u(`span`,{className:B.groundGlow}),u(`span`,{className:B.groundTerrain,"data-running-part":`flight-ground-terrain`}),u(`span`,{className:B.groundTerrainOverdrive,"data-running-part":`flight-ground-overdrive`}),u(`span`,{className:B.groundRunway,"data-running-part":`flight-ground-runway`})]}),d(`span`,{className:`${B.cloudLayer} ${B.cloudLayerFar}`,"data-running-part":`flight-cloud-layer`,"data-flight-depth":`far`,children:[u(`span`,{className:`${B.cloud} ${B.cloudOne}`,"data-running-part":`flight-cloud`}),u(`span`,{className:`${B.cloud} ${B.cloudTwo}`,"data-running-part":`flight-cloud`}),u(`span`,{className:`${B.cloud} ${B.cloudThree}`,"data-running-part":`flight-cloud`}),u(`span`,{className:`${B.cloud} ${B.cloudFour}`,"data-running-part":`flight-cloud`})]}),u(`span`,{className:B.plane,"data-running-part":`flight-plane`,children:d(`svg`,{className:B.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:B.windows,d:`M25 18h4v2h-4zm7 0h4v2h-4zm7 0h4v2h-4z`})]})}),d(`span`,{className:`${B.cloudLayer} ${B.cloudLayerNear}`,"data-running-part":`flight-cloud-layer`,"data-flight-depth":`near`,children:[u(`span`,{className:`${B.cloud} ${B.cloudFive}`,"data-running-part":`flight-cloud`}),u(`span`,{className:`${B.cloud} ${B.cloudSix}`,"data-running-part":`flight-cloud`}),u(`span`,{className:`${B.cloud} ${B.cloudSeven}`,"data-running-part":`flight-cloud`}),u(`span`,{className:`${B.cloud} ${B.cloudEight}`,"data-running-part":`flight-cloud`})]})]})}var H={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 Zt(){return d(l,{children:[u(`span`,{className:H.frontier,"data-running-part":`frontier`}),u(`span`,{className:H.now,"data-running-part":`transit-now`}),u(`span`,{className:H.routes,"data-running-part":`transit-routes`,children:[0,1,2].map(e=>u(`span`,{className:H.route},e))}),u(`span`,{className:H.trail,"data-running-part":`transit-trail`}),u(`span`,{className:H.packet,"data-running-part":`transit-packet`})]})}var Qt={field:`_field_1i9kx_1`,overdue:`_overdue_1i9kx_11`,timing:`_timing_1i9kx_14`,timingOverdue:`_timingOverdue_1i9kx_28`},$t={field:`_field_ozs8n_1`,canvas:`_canvas_ozs8n_7`};function en(e){let t=e*.25,n=e*.2,r=t<700||n<350?`snowfall`:n<530?`arrival`:n<1030?`hop`:`full`,i=tn((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 U(e,t,n){return n===t?Number(e>=n):tn((e-t)/(n-t),0,1)}function W(e){return e*e*(3-2*e)}function tn(e,t,n){return Math.max(t,Math.min(n,e))}var nn=25,rn=.5,an=.95;function on(e={width:360,height:180}){return{nextAt:0,id:0,lastElapsed:0,grid:sn(e),flakes:[],cells:[],toppled:!1}}function sn(e){return{columns:Rn(Math.round(e.width/4),48,180),rows:Rn(Math.round(e.height/4),28,100)}}function cn(e,t,n){return n?`overdue`:t===void 0||en(t).mode===`snowfall`?`snowing`:e>=an?`complete`:e>=rn?`assembling`:`drift`}function ln(e,t){let n=K(e+41)<.5?-1:1,r=n*(.72+K(e+43)*.45),i=Math.sin(t/1600+K(e+47)*Math.PI*2)*.4,a=n*Math.max(0,Math.sin(t/3100+K(e+53)*Math.PI*2))**7*(3.2+K(e+59)*1.8);return r+i+a}function un(e){let t=sn(e);return Math.round(t.columns*t.rows*.18)}function dn(e,t,n=!1,r=0){if(e===void 0)return n?30:60;let i=e*an/un(t);if(n)return i/2;let a=en(e);return a.mode!==`snowfall`&&r>=Math.max(0,a.bodyStart-500)?i*4:i}function fn(e,{elapsed:t,progress:n,estimatedDurationMs:r,overdue:i,seed:a,dimensions:o}){let s=sn(o),c=e.grid.columns===s.columns&&e.grid.rows===s.rows?Ln(e):on(o),l=Math.max(c.lastElapsed,t);for(let e=c.lastElapsed+nn;e<=l;e+=nn)c=hn(c,e,r===void 0?n:e/r,r,i&&(r===void 0||e>=r),a,o),c.lastElapsed=e;return c}function pn(e){return e.filter(e=>e.owner===`snowman`).length}function mn(e){return e.cells.map(t=>{let n=t.owner===`body`?e.body:t.owner===`head`?e.head:void 0,r=n&&t.localX!==void 0&&t.localY!==void 0?{...t,x:n.x+t.localX*Math.cos(n.angle)-t.localY*Math.sin(n.angle),y:n.y+t.localX*Math.sin(n.angle)+t.localY*Math.cos(n.angle)}:t;return e.toppling&&r.owner!==`ground`?In(r,e.toppling):r})}function hn(e,t,n,r,i,a,o){let s=cn(n,r,i),c=dn(r,o,i,t);for(;t>=e.nextAt;)e.flakes.push({id:e.id++,x:K(a+e.id*17)*e.grid.columns,y:-1-K(a+e.id*23)*6,bornAt:e.nextAt}),e.nextAt+=c;gn(e,n,r,i);let l=kn(e),u=ln(a,t)*(nn/1e3),d=r===void 0?.52:Math.max(.52,(e.grid.rows+7)*nn/(r*.25)),f=[];for(let t of e.flakes){let n={...t,x:t.x+u,y:t.y+d},r=bn(e,n);if(r){xn(e,r,t.id,n.x-r.x,n.y-r.y);continue}let i=jn(n,l,e.grid,u,a);if(!i){f.push({...n,x:Rn(n.x,0,e.grid.columns-1)});continue}let o=l.get(G(i.x,i.y+1));e.cells.push({id:t.id,x:i.x,y:i.y,owner:o===`body`||o===`head`||o===`snowman`?`snowman`:`ground`}),l.set(G(i.x,i.y),e.cells.at(-1)?.owner??`ground`)}e.flakes=f,r!==void 0&&s!==`drift`&&s!==`snowing`&&vn(e),wn(e),An(e,a,t),An(e,a,t+nn/2);let p=e.body;return p?.locked&&(p.supportY??=Mn(e,p.x,p.radius,p.y+p.radius),p.y=p.supportY),i&&!e.toppling&&!e.toppled&&pn(e.cells)>=60&&Pn(e,t),Fn(e,t),e}function gn(e,t,n,r){if(n===void 0)return;let i=en(n);if(i.mode===`snowfall`)return;let a=t*n,{columns:o,rows:s}=e.grid,c=W(U(a,i.bodyStart,i.bodyEnd));if(a>=i.bodyStart&&!e.body){let t=o*.14;e.body={kind:`body`,x:t,y:Mn(e,t,2,s-1),radius:2,angle:0,locked:!1}}let l=e.body;if(l&&!l.locked){l.radius=Math.max(l.radius,Nn(e,`body`,2));let t=o*(.14+.38*c);_n(l,t,Mn(e,t,l.radius,s-1)),l.locked=a>=i.bodyEnd}if(a>=i.headStart&&!e.head){let t=o*(i.mode===`full`?.88:.66);e.head={kind:`head`,x:t,y:Mn(e,t,1.7,s-1),radius:1.7,angle:0,locked:!1},vn(e)}let u=e.head;if(u&&l&&!u.locked){if(u.radius=Math.max(u.radius,Nn(e,`head`,1.7)),a<i.hopStart){let t=o*(.88-.22*W(U(a,i.headStart,i.hopStart)));_n(u,t,Mn(e,t,u.radius,s-1))}else{u.launch??={x:u.x,y:u.y};let e=U(a,i.hopStart,i.land),t=l.y-l.radius-u.radius+.5;if(u.x=u.launch.x+(l.x-u.launch.x)*W(e),u.y=u.launch.y+(t-u.launch.y)*W(e)-Math.sin(Math.PI*e)*Math.max(5,l.radius*1.5),a>=i.land){let e=U(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=U(a,i.land,i.end);e.hat={x:u.x,y:u.y-u.radius-1-5*(1-t*t),angle:(1-W(t))*-.22}}}function _n(e,t,n){let r=zn(e.y,n,.16),i=t-e.x;e.angle+=Math.sign(i)*Math.hypot(i,r-e.y)/Math.max(e.radius,1),e.x=t,e.y=r}function vn(e){let t=mn(e),n=new Map(e.cells.map(e=>[e.id,e])),r=new Set(t.filter(e=>e.owner===`ground`).map(e=>G(Math.round(e.x),Math.round(e.y)))),i=new Set(t.filter(e=>e.owner===`ground`).filter(e=>!r.has(G(Math.round(e.x),Math.round(e.y)-1))).map(e=>e.id));for(let r of[e.body,e.head]){if(!r||r.locked)continue;let a=r.kind,o=r.radius+.75;for(let a of t){if(!yn(e,r))break;if(a.owner!==`ground`)continue;let t=a.x-r.x,s=a.y-r.y,c=Math.hypot(t,s);if(!i.has(a.id)||c>o||s<-r.radius*.2)continue;let l=n.get(a.id);l&&xn(e,r,l.id,t,s)}r.radius=Math.max(r.radius,Nn(e,a,r.kind===`body`?2:1.7))}}function yn(e,t){if(t.kind===`body`||!e.body)return!0;let n=e.body.radius*.72,r=Math.max(12,Math.round(Math.PI*(Math.max(0,n-1.7)/.6)**2));return e.cells.filter(e=>e.owner===`head`).length<r}function bn(e,t){return[e.body,e.head].filter(e=>e!==void 0&&!e.locked).find(n=>yn(e,n)&&Math.hypot(t.x-n.x,t.y-n.y)<=n.radius)}function xn(e,t,n,r,i){let a=Math.cos(-t.angle),o=Math.sin(-t.angle),s=r*a-i*o;i=r*o+i*a,r=s;let c=e.cells.find(e=>e.id===n),l=Cn(e,t,n),u=Sn(e,t,r,i,n),d={id:n,x:t.x+u.x,y:t.y+u.y,owner:t.kind,localX:u.x,localY:u.y,targetLocalX:l.x,targetLocalY:l.y};c?Object.assign(c,d):e.cells.push(d),t.radius=Math.max(t.radius,Nn(e,t.kind,t.kind===`body`?2:1.7)),Tn(e,t)}function Sn(e,t,n,r,i){let a=e.cells.filter(e=>e.id!==i&&e.owner===t.kind),o=(e,t)=>a.every(n=>Math.hypot((n.localX??0)-e,(n.localY??0)-t)>=.75);if(o(n,r))return{x:n,y:r};for(let e=.75;;e+=.75)for(let i=0;i<32;i++){let a=i*Math.PI/16,s=n+Math.cos(a)*e,c=r+Math.sin(a)*e;if((Math.hypot(s,c)<=t.radius+.75||e>t.radius*2)&&o(s,c))return t.radius=Math.max(t.radius,Math.hypot(s,c)-.5),{x:s,y:c}}}function Cn(e,t,n){let r=e.cells.filter(e=>e.owner===t.kind&&e.targetLocalX!==void 0&&e.targetLocalY!==void 0),i=(e,t,n=.72)=>r.every(r=>Math.hypot((r.targetLocalX??0)-e,(r.targetLocalY??0)-t)>=n);for(let e=0;e<64;e+=1){let r=K(n*31+e*17)*Math.PI*2,a=Math.sqrt(K(n*37+e*19))*Math.max(.4,t.radius-.35),o=Math.cos(r)*a,s=Math.sin(r)*a;if(i(o,s))return{x:o,y:s}}for(let e=.4;e<=t.radius-.35;e+=.5){let t=Math.max(6,Math.round(2*Math.PI*e/.72));for(let r=0;r<t;r++){let a=r*Math.PI*2/t+K(n*13),o=Math.cos(a)*e,s=Math.sin(a)*e;if(i(o,s,.6))return{x:o,y:s}}}return{x:0,y:0}}function wn(e){for(let t of e.cells){if(t.packed||t.localX===void 0||t.localY===void 0||t.targetLocalX===void 0||t.targetLocalY===void 0)continue;let e=zn(t.localX,t.targetLocalX,.25),n=zn(t.localY,t.targetLocalY,.25);t.localX=e,t.localY=n,t.packed=e===t.targetLocalX&&n===t.targetLocalY}}function Tn(e,t){let n=e.cells.filter(e=>e.owner===t.kind&&e.localX!==void 0&&e.localY!==void 0),r=En(t.radius,n.length);n.sort((e,t)=>e.id-t.id);for(let[e,t]of n.entries()){let n=r[e];if(!n)break;t.targetLocalX=n.x,t.targetLocalY=n.y,t.packed=!1}}function En(e,t){let n=Math.max(.2,e-.1),r=[],i=.9,a=i*Math.sqrt(3)/2;for(let e=-Math.ceil(n/a);e<=Math.ceil(n/a);e+=1){let t=e*a,o=e&1?i/2:0;for(let e=-Math.ceil(n/i);e<=Math.ceil(n/i);e+=1){let a=e*i+o;Math.hypot(a,t)<=n&&r.push({x:a,y:t})}}r.sort((e,t)=>Math.hypot(e.x,e.y)-Math.hypot(t.x,t.y));let o=[];for(let e of r)if(o.every(t=>Math.hypot(t.x-e.x,t.y-e.y)>=.82)&&o.push(e),o.length===t)break;return o}function Dn(e){if(e.hat)return e.toppling?{...In(e.hat,e.toppling),angle:e.hat.angle+e.toppling.angle}:e.hat}function On(e,t,n){let r=Ln(t),i=(e,t)=>e+(t-e)*Rn(n,0,1);for(let t of[`body`,`head`]){let n=e[t],a=r[t];n&&a&&(a.x=i(n.x,a.x),a.y=i(n.y,a.y),a.angle=i(n.angle,a.angle))}let a=new Map(e.flakes.map(e=>[e.id,e]));for(let e of r.flakes){let t=a.get(e.id);t&&(e.x=i(t.x,e.x),e.y=i(t.y,e.y))}return r.toppling&&e.toppling&&(r.toppling.angle=i(e.toppling.angle,r.toppling.angle)),r.hat&&e.hat&&(r.hat={x:i(e.hat.x,r.hat.x),y:i(e.hat.y,r.hat.y),angle:i(e.hat.angle,r.hat.angle)}),r}function kn(e){let t=new Map;for(let n of mn(e))t.set(G(Math.round(n.x),Math.round(n.y)),n.owner);return t}function An(e,t,n){let r=kn(e),i=e.cells.filter(e=>e.owner===`ground`).sort((e,t)=>t.y-e.y||e.x-t.x);for(let a of i){let i=G(a.x,a.y+1);if(a.y<e.grid.rows-1&&!r.has(i)){r.delete(G(a.x,a.y)),a.y+=1,r.set(G(a.x,a.y),a.owner);continue}let o=K(t+a.id*29+n)<.5?-1:1;for(let t of[o,-o]){let n=a.x+t;if(!(n<0||n>=e.grid.columns||a.y>=e.grid.rows-1||r.has(G(n,a.y))||r.has(G(n,a.y+1)))){r.delete(G(a.x,a.y)),a.x=n,a.y+=1,r.set(G(a.x,a.y),a.owner);break}}}}function jn(e,t,n,r,i){let a=Math.round(e.x),o=Math.round(e.y);if(o<0)return;if(o>=n.rows-1)return{x:a,y:n.rows-1};if(!t.has(G(a,o+1)))return;let s=r>=0?1:-1,c=K(i+e.id*71+o)>.5?s:-s;for(let e of[c,-c]){let r=a+e;if(r>=0&&r<n.columns&&!t.has(G(r,o+1))&&!t.has(G(r,o)))return{x:r,y:o+1}}return t.has(G(a,o))?{x:a,y:Math.max(0,o-1)}:{x:a,y:o}}function Mn(e,t,n,r){let i=mn(e).filter(e=>e.owner===`ground`&&Math.abs(e.x-t)<=n);return(i.length?Math.min(...i.map(e=>e.y)):r)-n}function Nn(e,t,n){let r=e.cells.filter(e=>e.owner===t).length;return n+Math.sqrt(r/Math.PI)*.5}function Pn(e,t){let n=e.body;n&&(e.toppling={startedAt:t,angle:0,pivotX:n.x,pivotY:n.y+n.radius*.72})}function Fn(e,t){let n=e.toppling;if(!n)return;let r=Rn((t-n.startedAt)/750,0,1);n.angle=(1-(1-r)**3)*(Math.PI/2),r===1&&(e.toppled=!0)}function In(e,t){let n=Math.cos(t.angle),r=Math.sin(t.angle),i=e.x-t.pivotX,a=e.y-t.pivotY;return{...e,x:t.pivotX+i*n-a*r,y:t.pivotY+i*r+a*n}}function Ln(e){return{...e,grid:{...e.grid},hat:e.hat&&{...e.hat},flakes:e.flakes.map(e=>({...e})),cells:e.cells.map(e=>({...e})),body:e.body&&{...e.body},head:e.head&&{...e.head},toppling:e.toppling&&{...e.toppling}}}function G(e,t){return`${e}:${t}`}function Rn(e,t,n){return Math.max(t,Math.min(n,e))}function zn(e,t,n){return Math.abs(t-e)<=n?t:e+Math.sign(t-e)*n}function K(e){let t=Math.sin(e*12.9898)*43758.5453;return t-Math.floor(t)}function Bn(e,t,n){if(!e)return;let r=e.getContext(`2d`);if(!r)return;let i=window.devicePixelRatio||1,a=Math.max(1,Math.round(n.width)),o=Math.max(1,Math.round(n.height));(e.width!==a*i||e.height!==o*i)&&(e.width=a*i,e.height=o*i,e.style.width=`${a}px`,e.style.height=`${o}px`),r.setTransform(i,0,0,i,0,0),r.clearRect(0,0,a,o);let s=a/t.grid.columns,c=o/t.grid.rows;r.fillStyle=`rgba(244, 241, 223, 0.52)`;for(let e of mn(t))Vn(r,(e.x+.5)*s,(e.y+.5)*c,s,c);r.fillStyle=`rgba(244, 241, 223, 0.76)`;for(let e of t.flakes)Vn(r,(e.x+.5)*s,(e.y+.5)*c,s*.72,c*.72);let l=Dn(t);if(l&&t.head){let e=t.head.radius;r.save(),r.translate(l.x*s,l.y*c),r.scale(s,c),r.rotate(l.angle),r.fillStyle=`rgba(27, 31, 24, 0.78)`,r.fillRect(-e*.65,-2,e*1.3,2),r.fillRect(-e,-.3,e*2,.45),r.restore()}}function Vn(e,t,n,r,i){e.beginPath(),e.arc(t,n,Math.max(.8,Math.min(r,i)*.42),0,Math.PI*2),e.fill()}function Hn({progress:e,estimatedDurationMs:t,overdue:n,seed:i=0}){let s=a(null),c=a(null),[l,d]=o({width:360,height:180}),[f,p]=o(()=>window.matchMedia(`(prefers-reduced-motion: reduce)`).matches),m=a(e),h=a(n),g=a({startedAt:Date.now(),progressAt:Date.now(),progress:e,simulation:on()});r(()=>{m.current=e,g.current.progressAt=Date.now(),g.current.progress=e},[e]),r(()=>{h.current=n},[n]),r(()=>{let e=window.matchMedia(`(prefers-reduced-motion: reduce)`),t=()=>p(e.matches);return t(),e.addEventListener?.(`change`,t),()=>e.removeEventListener?.(`change`,t)},[]),r(()=>{let e=s.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect();t.width>0&&t.height>0&&d({width:t.width,height:t.height})};if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]),r(()=>{if(f)return;g.current.simulation=on(l);let e=0,n=()=>{let r=g.current,a=t===void 0?Date.now()-r.startedAt:r.progress*t+(Date.now()-r.progressAt),o={progress:m.current,estimatedDurationMs:t,overdue:h.current,seed:i,dimensions:l},u=fn(r.simulation,{...o,elapsed:a});r.simulation=u;let d=On(u,fn(u,{...o,elapsed:u.lastElapsed+25}),(a-u.lastElapsed)/25);Bn(c.current,d,l);let p=s.current;p&&(p.dataset.snowCellCount=String(u.cells.length),p.dataset.snowDensity=u.grid.columns<65?`compact`:`full`,u.toppled?p.dataset.snowmanToppled=`true`:delete p.dataset.snowmanToppled),f||(e=window.requestAnimationFrame(n))};return e=window.requestAnimationFrame(n),()=>window.cancelAnimationFrame(e)},[l,t,f,i]),r(()=>{if(!f)return;let r=fn(on(l),{elapsed:t===void 0?4800:e*t,progress:e,estimatedDurationMs:t,overdue:n,seed:i,dimensions:l});Bn(c.current,r,l),s.current&&(s.current.dataset.snowCellCount=String(r.cells.length),r.toppled?s.current.dataset.snowmanToppled=`true`:delete s.current.dataset.snowmanToppled)},[l,t,n,e,f,i]);let _=cn(e,t,n);return u(`div`,{ref:s,className:$t.field,"data-running-part":`snowman-field`,"data-snowman-phase":_,"data-reduced-motion":f||void 0,children:u(`canvas`,{ref:c,className:$t.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 Un(){return d(l,{children:[u(`span`,{className:q.haze,"data-running-part":`weather-haze`}),u(`span`,{className:q.pressure,"data-running-part":`weather-pressure`}),u(`span`,{className:`${q.band} ${q.bandOne}`}),u(`span`,{className:`${q.band} ${q.bandTwo}`}),u(`span`,{className:`${q.band} ${q.bandThree}`}),u(`span`,{className:`${q.drift} ${q.driftOne}`}),u(`span`,{className:`${q.drift} ${q.driftTwo}`}),u(`span`,{className:`${q.drift} ${q.driftThree}`}),u(`span`,{className:`${q.drift} ${q.driftFour}`}),u(`span`,{className:`${q.drift} ${q.driftFive}`})]})}var Wn={anchor:`_anchor_1bd86_1`,body:`_body_1bd86_6`,"phased-marker":`_phased-marker_1bd86_1`};function Gn({anchorClassName:e,bodyClassName:t,delay:n,anchorPart:r,bodyPart:i}){let a=n?{"--phased-marker-delay":n}:void 0;return u(`span`,{className:`${Wn.anchor} ${e??``}`,"data-running-part":r,children:u(`span`,{className:`${Wn.body} ${t??``}`,"data-running-part":i,style:a})})}var J={frontier:`_frontier_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 Kn(){return d(l,{children:[u(`span`,{className:J.frontier,"data-running-part":`frontier`}),u(`span`,{className:J.flare,"data-running-part":`bloom-flare`}),u(`span`,{className:J.lanes,"data-running-part":`bloom-lanes`,children:[0,1,2,3].map(e=>u(`span`,{className:J.lane,"data-running-part":`bloom-lane`,children:u(Gn,{anchorClassName:J.markerAnchor,bodyClassName:J.markerBody,delay:[void 0,`-0.8s`,`-1.7s`,`-2.4s`][e],anchorPart:`bloom-marker-anchor`,bodyPart:`bloom-marker`})},e))})]})}function qn(e){return[`telemetry-bloom`,`release-transit`,`status-weather`,`falling-shapes`,`snowman`,`flight-path`].includes(e)}function Jn({animation:e,progress:t,estimatedDurationMs:n,overdue:r,indeterminate:i,seed:a}){let o={"--running-progress":`${t*100}%`};return d(`div`,{className:`${Qt.field} ${r?Qt.overdue:``}`,"data-animation":e,"data-running-field":!0,"data-overdue":r||void 0,"data-indeterminate":i||void 0,"aria-hidden":`true`,style:o,children:[e===`telemetry-bloom`&&u(Kn,{}),e===`release-transit`&&u(Zt,{}),e===`status-weather`&&u(Un,{}),e===`falling-shapes`&&u(Bt,{progress:t,estimatedDurationMs:n,overdue:r,seed:a}),e===`snowman`&&u(Hn,{progress:t,estimatedDurationMs:n,overdue:r,seed:a}),e===`flight-path`&&u(Xt,{progress:t,indeterminate:i})]})}var Yn=20;function Xn(e,t){let n=Zn(!!e),r=e?new Date(e).valueOf():NaN,i=Number.isFinite(r)?Math.max(0,n-r):void 0,a=i!==void 0&&t!==void 0;return{elapsedMs:i,estimatedDurationMs:t,hasEstimate:a,overdue:a&&i>t,progress:a?Math.min(i/t,1):0}}function Zn(e){let[t,n]=o(()=>Date.now());return r(()=>{if(!e)return;n(Date.now());let t=window.setInterval(()=>n(Date.now()),Yn);return()=>window.clearInterval(t)},[e]),t}function Qn(e,t,n){return`${e===void 0?`Run in progress`:`Elapsed ${er(e)}`} · ${t===void 0?`Expected duration unavailable`:`Expected ≈ ${er(t)}`}${n?` · Over estimate`:``}`}function $n(e,t,n){let r=e===void 0?`—`:tr(e),i=t===void 0?`?`:`~${tr(t)}`;return`${n?`⚠`:`\xA0`}${r}/${i}`}function er(e){let t=Math.floor(e/1e3),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60;return n>0?`${n}h ${r}m`:r>0?`${r}m ${i}s`:`${i}s`}function tr(e){let t=Math.floor(e/1e3),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60,a=`${r}:${String(i).padStart(2,`0`)}`;return n>0?`${n}:${a.padStart(5,`0`)}`:a}function nr({elapsedMs:e,estimatedDurationMs:t,overdue:n}){return d(`p`,{className:`${Qt.timing} ${n?Qt.timingOverdue:``}`,children:[u(`span`,{className:`screen-reader-only`,children:Qn(e,t,n)}),u(`span`,{"aria-hidden":`true`,children:$n(e,t,n)})]})}var Y={progress:`_progress_1ti2m_1`,visual:`_visual_1ti2m_8`,timing:`_timing_1ti2m_12`,overdue:`_overdue_1ti2m_17`,readout:`_readout_1ti2m_23`,radial:`_radial_1ti2m_31`,sweep:`_sweep_1ti2m_1`,"alarm-ring":`_alarm-ring_1ti2m_1`,radialCore:`_radialCore_1ti2m_58`,"reactor-breathe":`_reactor-breathe_1ti2m_1`,runway:`_runway_1ti2m_70`,"barrier-pulse":`_barrier-pulse_1ti2m_1`,spark:`_spark_1ti2m_114`,sparkTwo:`_sparkTwo_1ti2m_128`,orbit:`_orbit_1ti2m_135`,orbitCore:`_orbitCore_1ti2m_151`,particle:`_particle_1ti2m_163`,particleTwo:`_particleTwo_1ti2m_174`,"gravity-well":`_gravity-well_1ti2m_1`,indeterminate:`_indeterminate_1ti2m_191`,shift:`_shift_1ti2m_1`,signalField:`_signalField_1ti2m_199`,rail:`_rail_1ti2m_217`,lead:`_lead_1ti2m_223`,pulse:`_pulse_1ti2m_233`,pulseTwo:`_pulseTwo_1ti2m_244`,tracks:`_tracks_1ti2m_247`,sparkWide:`_sparkWide_1ti2m_1`,track:`_track_1ti2m_247`,markerAnchor:`_markerAnchor_1ti2m_382`,markerBody:`_markerBody_1ti2m_386`,"endpoint-pulse":`_endpoint-pulse_1ti2m_1`,short:`_short_1ti2m_424`};function rr({animation:e,timing:t}){let{elapsedMs:n,estimatedDurationMs:r,hasEstimate:i,overdue:a,progress:o}=t,s=e===`runway`||e===`signal-field`,c=Qn(n,r,a),f={"--running-progress":`${o*100}%`,"--running-degrees":`${o*360}deg`},p=e===`signal-field`?Y.signalField:Y[e];return d(`div`,{className:`${Y.progress} ${p} ${a?Y.overdue:``} ${i?``:Y.indeterminate}`,style:f,"data-running-progress":e,"data-overdue":a||void 0,"data-indeterminate":!i||void 0,children:[d(`div`,{className:Y.visual,"aria-hidden":`true`,"data-running-visual":!0,children:[e===`radial`&&u(`span`,{className:Y.radialCore}),e===`runway`&&d(l,{children:[u(`span`,{className:Y.spark,"data-running-part":`runway-spark`}),u(`span`,{className:`${Y.spark} ${Y.sparkTwo}`,"data-running-part":`runway-spark-two`})]}),e===`orbit`&&d(l,{children:[u(`span`,{className:Y.orbitCore}),u(`span`,{className:Y.particle}),u(`span`,{className:`${Y.particle} ${Y.particleTwo}`})]}),e===`signal-field`&&d(l,{children:[u(`span`,{className:Y.rail}),u(`span`,{className:Y.lead}),u(`span`,{className:Y.pulse}),u(`span`,{className:`${Y.pulse} ${Y.pulseTwo}`}),u(`span`,{className:Y.tracks,"data-running-part":`signal-tracks`,children:[0,1,2,3,4].map(e=>u(`span`,{className:Y.track,"data-running-part":`signal-track`,children:u(Gn,{anchorClassName:Y.markerAnchor,bodyClassName:Y.markerBody,delay:[void 0,`-0.8s`,`-1.7s`,`-2.4s`,`-0.35s`][e],anchorPart:`signal-marker-anchor`,bodyPart:`signal-marker`})},e))})]})]}),u(`p`,{className:`${Y.timing} ${s?Y.readout:``}`,children:s?d(l,{children:[u(`span`,{className:`screen-reader-only`,children:c}),u(`span`,{"aria-hidden":`true`,children:$n(n,r,a)})]}):c})]})}function ir(e){return[`radial`,`runway`,`orbit`,`signal-field`].includes(e)}function ar(e){return Array.from(e).reduce((e,t)=>e*31+t.charCodeAt(0)>>>0,7)}var or=2e4,sr=15e3,cr=3e5,lr=1.25,ur=[`radial`,`runway`,`orbit`,`signal-field`,`telemetry-bloom`,`release-transit`,`status-weather`,`falling-shapes`,`snowman`,`flight-path`];function dr({panel:e}){let t=mr(),n=e.running_animation===void 0||e.running_animation===`off`?void 0:e.running_animation,r=fr(e.demo_run_duration,or),i=fr(e.demo_review_duration,cr),a=n?Math.ceil(i*lr):r,o=Math.floor(t/a),s=n??ur[o%ur.length]??`radial`,c=o*a;return u(pr,{panel:e,animation:s,runStartedAt:c,estimatedDurationMs:n?i:sr})}function fr(e,t){return e?S(e)??t:t}function pr({panel:e,animation:t,runStartedAt:n,estimatedDurationMs:r}){let i=Xn(new Date(n).toISOString(),r),a=qn(t);return u(F,{panel:e,field:a?u(Jn,{animation:t,progress:i.progress,estimatedDurationMs:i.estimatedDurationMs,overdue:i.overdue,indeterminate:!i.hasEstimate,seed:ar(e.id)},`${t}-${n}`):void 0,children:d(N,{children:[u(P,{status:`running`,glyph:`↻`,label:`Running`}),d(`p`,{className:_t.variant,children:[u(`span`,{className:_t.variantPrefix,children:`Demo treatment · `}),t]}),a?u(nr,{elapsedMs:i.elapsedMs,estimatedDurationMs:r,overdue:i.overdue}):u(rr,{animation:t,timing:i})]})})}function mr(){let[e,t]=o(()=>Date.now());return r(()=>{let e=window.setInterval(()=>t(Date.now()),1e3);return()=>window.clearInterval(e)},[]),e}var X={details:`_details_19avj_1`,activity:`_activity_19avj_7`,duration:`_duration_19avj_8`};function hr(e,t=`Passed`){let n=at[e];return e===`passed`?{...n,label:t}:n}function gr(e){return e?e.parent?`${e.parent} › ${e.name}`:e.name:`Activity unavailable`}function _r({panel:e,envelope:t,attentionActive:n,updateHealth:r,rejectedPipeline:i}){if(!t&&i)return u(vr,{panel:e,rejected:i});if(!t)return u(F,{panel:e,attentionActive:n,children:u(N,{children:u(j,{children:`Loading…`})})});if(t.state===`error`){let r=k(t.error.kind);return d(F,{panel:e,envelope:t,attentionActive:n,error:!0,layout:`status-band`,children:[u(`div`,{"data-panel-anchor":`status`,children:u(P,{glyph:`⚠`,label:r.label,emphasis:r.emphasis})}),u(N,{anchor:`evidence`,children:u(j,{children:t.error.message})})]})}let a=C.safeParse(t.signal);return a.success?u(yr,{panel:e,envelope:t,signal:a.data,updateHealth:r,attentionActive:n}):d(F,{panel:e,envelope:t,attentionActive:n,error:!0,layout:`status-band`,children:[u(`div`,{"data-panel-anchor":`status`,children:u(P,{glyph:`⚠`,label:`Invalid signal`})}),u(N,{anchor:`evidence`,children:u(j,{children:`The received pipeline status could not be read.`})})]})}function vr({panel:e,rejected:t}){let n=hr(t.status);return d(F,{panel:e,sourceLink:t.link,busy:!1,layout:`status-band`,children:[u(`div`,{"data-panel-anchor":`status`,children:u(P,{status:t.status,glyph:n.glyph,label:n.label})}),d(N,{className:X.details,anchor:`evidence`,children:[d(j,{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(ut,{value:t.sourceUpdatedAt})]})]})}function yr({panel:e,envelope:t,signal:n,updateHealth:r,attentionActive:i}){let s=hr(n.status),[c,l]=o(()=>n.status===`running`?br():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=>br(e))}let p=e.running_animation??c??`off`,m=n.status===`running`&&p!==`off`,h=Xn(n.runStartedAt,n.estimatedDurationMs),g=m&&qn(p),_=m&&ir(p);return d(F,{panel:e,envelope:t,attentionActive:i,layout:g||_?void 0:`status-band`,field:g?u(Jn,{animation:p,progress:h.progress,estimatedDurationMs:h.estimatedDurationMs,overdue:h.overdue,indeterminate:!h.hasEstimate,seed:ar(e.id)}):void 0,children:[u(`div`,{"data-panel-anchor":`status`,children:u(P,{status:n.status,glyph:s.glyph,label:s.label})}),d(N,{className:X.details,anchor:`evidence`,children:[n.status===`running`&&u(M,{glyph:`⚙`,label:`Activity`,value:gr(n.activity),compact:{kind:`glyph-only`},title:`Activity: ${gr(n.activity)}`,className:X.activity}),n.branch&&u(M,{glyph:`⎇`,label:`Branch`,value:u(`span`,{className:X.branch,children:n.branch}),compact:{kind:`short-value`,value:u(`span`,{className:X.branch,children:n.branch})},title:`Branch: ${n.branch}`}),g&&u(nr,{elapsedMs:h.elapsedMs,estimatedDurationMs:n.estimatedDurationMs,overdue:h.overdue}),_&&u(rr,{animation:p,timing:h}),n.status!==`running`&&n.durationMs!==void 0&&u(M,{glyph:`◷`,label:`Duration`,value:`Took ${xr(n.durationMs)}`,compact:{kind:`short-value`,value:xr(n.durationMs)},title:`Duration: Took ${xr(n.durationMs)}`,className:X.duration}),u(lt,{sourceUpdatedAt:n.sourceUpdatedAt,observedAt:t.observedAt,running:n.status===`running`,runStartedAt:n.runStartedAt}),r&&u(L,{health:r})]})]})}function br(e){let t=Ce.filter(t=>t!==e);return t[Math.floor(Math.random()*t.length)]??`telemetry-bloom`}function xr(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 Sr(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 Cr({panel:e,envelope:t,attentionActive:n,updateHealth:r}){if(!t)return u(F,{panel:e,attentionActive:n,children:u(N,{children:u(j,{children:`Loading…`})})});if(t.state===`error`){let r=k(t.error.kind);return d(F,{panel:e,envelope:t,attentionActive:n,error:!0,layout:`status-band`,children:[u(`div`,{"data-panel-anchor":`status`,children:u(P,{glyph:`⚠`,label:r.label,emphasis:r.emphasis})}),u(N,{anchor:`evidence`,children:u(j,{children:t.error.message})})]})}let i=ue.safeParse(t.signal);if(!i.success)return d(F,{panel:e,envelope:t,attentionActive:n,error:!0,layout:`status-band`,children:[u(`div`,{"data-panel-anchor":`status`,children:u(P,{glyph:`⚠`,label:`Invalid signal`})}),u(N,{anchor:`evidence`,children:u(j,{children:`The received pull-request health status could not be read.`})})]});let a=hr(i.data.status,`Healthy`),o=Sr(i.data);return d(F,{panel:e,envelope:t,attentionActive:n,layout:`status-band`,children:[u(`div`,{className:Z.statusAnchor,"data-panel-anchor":`status`,children:u(P,{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(j,{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(M,{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(M,{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(I,{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(L,{health:r})]}),i.data.incompleteObservations&&u(`div`,{role:`status`,children:d(j,{className:Z.incomplete,children:[`⚠ Incomplete observations:`,` `,i.data.incompleteObservations.map(({label:e,message:t})=>`${e}: ${t}`).join(` · `)]})})]})]})}function wr({panel:e,envelope:t,attentionActive:n,updateHealth:r}){if(!t)return u(F,{panel:e,attentionActive:n,children:u(N,{children:u(j,{children:`Loading…`})})});if(t.state===`error`){let r=k(t.error.kind);return u(F,{panel:e,envelope:t,attentionActive:n,error:!0,children:d(N,{children:[u(P,{glyph:`⚠`,label:r.label,emphasis:r.emphasis}),u(j,{children:t.error.message})]})})}let i=oe.safeParse(t.signal);if(!i.success)return u(F,{panel:e,envelope:t,attentionActive:n,error:!0,children:u(N,{children:u(P,{glyph:`⚠`,label:`Invalid test result`})})});let a=i.data;if(a.status===`pending`)return u(Tr,{panel:e,envelope:t,attentionActive:n,label:`Pending`,hint:`The selected workflow run is still in progress.`});if(a.status===`not-reported`)return u(Tr,{panel:e,envelope:t,attentionActive:n,label:`No test results published`,hint:`This completed workflow did not publish the configured test summary.`});let o=[[`passed`,a.passed],[`failed`,a.failed],[`skipped`,a.skipped]].filter(([,e])=>e!==void 0).map(([e,t])=>`${t} ${e}`).join(` · `);return u(F,{panel:e,envelope:t,attentionActive:n,children:d(N,{children:[u(P,{glyph:`✓`,label:`Test results reported`,compactOnly:!0}),d(st,{children:[a.total.toLocaleString(),` tests`]}),o&&u(M,{glyph:`≡`,label:`Outcomes`,value:o}),u(I,{value:t.observedAt}),r&&u(L,{health:r})]})})}function Tr({panel:e,envelope:t,attentionActive:n,label:r,hint:i}){return u(F,{panel:e,envelope:t,attentionActive:n,children:d(N,{children:[u(P,{glyph:`◌`,label:r}),u(j,{children:i}),u(I,{value:t.observedAt})]})})}var Er={"pipeline-status":_r,"pull-request-health":Cr,"http-value":pt,"test-count":wr,"pipeline-animation-demo":dr};function Dr({panel:e,envelope:t,attentionActive:n,updateHealth:r,rejectedPipeline:i,facts:a}){let o=Er[e.type];return o?u(o,{panel:e,envelope:t,attentionActive:n,updateHealth:r,rejectedPipeline:i,facts:a}):u(nt,{label:e.type,hint:`Not wired yet`,wide:!0})}var Or={control:`_control_giazw_1`,backdrop:`_backdrop_giazw_5`,dialog:`_dialog_giazw_15`};function kr({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 D(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=we.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:Or.control,type:`button`,"aria-expanded":n,"aria-controls":`security-details-dialog`,onClick:()=>void v(),children:`Security`}),n&&u(`div`,{className:Or.backdrop,role:`presentation`,children:d(`section`,{ref:h,className:Or.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(Ar,{details:f}),u(`button`,{ref:g,type:`button`,onClick:()=>i(!1),children:`Close`})]})})]})}function Ar({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 jr={notice:`_notice_1h5h0_1`,blocked:`_blocked_1h5h0_18`},Mr=`https://github.com/robertfmurdock/ze-great-dashboard/blob/main/docs/oidc-authentication.md`;function Nr({mode:e}){return e===`blocked`?d(`main`,{className:jr.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:Mr,children:`Read the authentication setup guide`}),`.`]})]}):d(`aside`,{className:jr.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:Mr,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`},Pr=6e5;function Fr({schedules:e,events:t,retention:n,now:r=new Date}){let i=r.valueOf(),a=i-Pr,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 Ir(e,t){return Math.max(0,Math.min(100,(Date.parse(e)-(t.valueOf()-Pr))/Pr*100))}function Lr(e,t){return`${e.label}, panel ${e.panelId}; ${Rr(e.cadence)} cadence; ${e.inFlight?`request in flight`:e.nextDueAt?zr(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 Rr(e){return e===`completion-window`?`Completion-window`:e===`running`?`Running`:`Normal`}function zr(e,t){let n=Date.parse(e)-t.valueOf();return n<0?`Overdue by ${Br(-n)}`:`Next poll in ${Br(n)}`}function Br(e){return e%6e4==0?`${Math.round(e/6e4)}m`:`${Math.max(1,Math.round(e/1e3))}s`}function Vr({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(()=>Fr({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":Lr(e,c),children:[e.observed.flatMap(({path:e,starts:t})=>t.map(t=>u(`i`,{className:$.observed,style:{left:`${Ir(t,c)}%`},title:`Observed request: ${e}`},`${e}-${t}`))),e.nextDueAt&&u(`i`,{className:$.expected,style:{left:`${Ir(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.`})]})]})]})}function Hr({env:e,diagnostics:t,auth:n}){let[i,a]=o(),[s,c]=o();return r(()=>{let r=!1;a(void 0),c(void 0);let i=`${e.proxyPath}/boards/${encodeURIComponent(e.board)}`;return t.record({kind:`board-fetch-start`,path:i}),D(e,i,void 0,globalThis.fetch,n).then(async e=>{if(t.record({kind:`board-fetch-response`,path:i,status:e.status,cache:Ue(e.headers)}),!e.ok)throw Error(`Board configuration returned ${e.status}`);try{return await e.json()}catch(e){throw t.record({kind:`board-fetch-parse-failure`,path:i,message:Ur(e)}),new Wr(e)}}).then(n=>{if(r)return;a(n),c(e.board);let o=Array.isArray(n.panels)?n.panels:[];t.record({kind:`board-fetch-response`,path:i,boardSummary:{panelCount:o.length,panelIds:o.flatMap(e=>typeof e.id==`string`?[e.id]:[])}})}).catch(n=>{n instanceof Wr||t.record({kind:`board-fetch-failure`,path:i,message:Ur(n)}),r||(a({panels:[]}),c(e.board))}),()=>{r=!0}},[n,t,e]),{board:i,loadedBoardName:s}}function Ur(e){return e instanceof Error?e.message:String(e)}var Wr=class extends Error{constructor(e){super(Ur(e))}},Gr=6e4,Kr=1e4,qr=()=>globalThis.window.location.reload();function Jr({env:e,diagnostics:t,fetcher:n,reload:i=qr,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(),Kr);t.record({kind:`client-update-check`,path:c});try{let o=await D(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(),Gr)}};return l(),()=>{r=!0,s?.abort()}},[a,t,e,n,i])}function Yr(e,t){if(t.state===`error`)return{state:t.state,link:t.link};if(e.type===`pipeline-status`){let e=C.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=ue.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 Xr(e,t,n){if(!e)return!0;let r=Yr(t,e),i=Yr(t,n);return r.state!==i.state||r.status!==i.status||r.link!==i.link}function Zr(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 Qr(e,t){return JSON.stringify(e&&Zr(e))!==JSON.stringify(Zr(t))}var $r=`ze-great-dashboard.panel-memory.v1`,ei=1,ti=12096e5,ni=class{now;histories;storage;constructor(e=Ae(),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[ri(t)]=t);let i=r.latestCompleted;(!i||ii(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=si(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()-ti;for(let[n,r]of Object.entries(e.durations)){let i=ai(r.sourceUpdatedAt);(i===void 0||i<t)&&delete e.durations[n]}let n=e.latestCompleted?ai(e.latestCompleted.sourceUpdatedAt):void 0;e.latestCompleted&&(n===void 0||n<t)&&delete e.latestCompleted}read(){let e=je(this.storage,$r);return e?.schemaVersion!==ei||!e.histories?{}:ci(e.histories)?e.histories:{}}persist(){Me(this.storage,$r,{schemaVersion:ei,histories:this.histories})}};function ri(e){return e.sourceRunId??e.link??e.sourceUpdatedAt}function ii(e,t){let n=ai(e),r=ai(t);return n!==void 0&&(r===void 0||n>=r)}function ai(e){let t=Date.parse(e);return Number.isFinite(t)?t:void 0}function oi(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 si(e){return JSON.stringify([e.board,e.panelId,e.source,e.workflow,e.branch])}function ci(e){return di(e)?Object.values(e).every(li):!1}function li(e){return!di(e)||!di(e.durations)||!Object.values(e.durations).every(ui)?!1:e.latestCompleted===void 0||ui(e.latestCompleted)}function ui(e){return di(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`&&ai(e.sourceUpdatedAt)!==void 0:!1}function di(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}async function fi(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:Ue(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=ie.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:pi(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:mi(t)}),{error:mi(t)}}}function pi(e,t){let n=t.headers.get(`x-dashboard-request-id`);return{reason:e.error.message,...n?{supportReference:n}:{}}}function mi(e){return e instanceof Error?e.message:String(e)}function hi(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:vi(e.reconciliation.envelope.link)}}:{envelope:e.reconciliation.envelope}}function gi(e){let t=_i(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 _i(e){if(e.state!==`ok`)return;let t=C.safeParse(e.signal);return t.success?t.data:void 0}function vi(e){if(!e)return!1;try{return new URL(e).hostname===`github.com`}catch{return!1}}function yi(e){return e.panels.filter(e=>!w(e.position)&&(e.type===`pipeline-status`||e.type===`pull-request-health`||e.type===`http-value`))}function bi(e,t){return`${e.proxyPath}/panel/${encodeURIComponent(e.board)}/${encodeURIComponent(t)}`}function xi(e,t,n){let r=bi(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`,...Si(n).map(({workflow:e})=>`${r}/update-workflow/${encodeURIComponent(e)}`)]:[r];return{panelId:n.id,label:n.label??n.id,settings:Se(e,n),cadence:`normal`,inFlight:!1,knownPaths:i}}function Si(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 Ci(e,t,n){let r=wi(e);if(!r)return{delayMillis:n.refreshMillis,cadence:`normal`};let i=Ti(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 wi(e){if(e?.state!==`ok`)return;let t=C.safeParse(e.signal);return t.success&&t.data.status===`running`?t.data:void 0}function Ti(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 Ei(e){let t=[],n=e.workflows.map(({workflow:e,observation:n})=>{let r=Oi(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=ki(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:Di(e,n,[],t,Ai(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.`}),Di(e,n,r.pullRequests.map(n=>{let r=e.builds.get(n.branch),i=Oi(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,Ai([...e.workflows.map(({observation:e})=>e),e.candidates,...e.builds.values()]))}function Di(e,t,n,r,i){let a=ji([...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 Oi(e,t){if(e?.state!==`ok`)return;let n=(t===`pull-request-workflow`?pe:me).safeParse(e.signal);return n.success?{item:n.data.item}:void 0}function ki(e){if(e?.state!==`ok`)return;let t=fe.safeParse(e.signal);return t.success?t.data:void 0}function Ai(e){return e.flatMap(({envelope:e})=>e?.state===`ok`?[e.observedAt]:[])}function ji(e){return e.reduce((e,t)=>ce(t)>ce(e)?t:e,`passed`)}function Mi({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 ni,r(()=>{if(v.current={},y.current={},l({}),d({}),p({}),h([]),_({}),!e)return;let r=!1,i=new Set,a=new Set,o=yi(e),c=o.map(n=>xi(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=bi(t,e.id),x,ee,te=()=>{ee=new Date().toISOString(),r||d(t=>{if(!t[e.id])return t;let n={...t};return delete n[e.id],n})},S=t=>{let n=ee;if(r||!n)return;let i=Fi(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 fi({diagnostics:n,panelId:e.id,path:i,signal:u?.signal,cache:l,fetcher:(e,n)=>D(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];Qr(r,t)&&n.record({kind:`panel-rendered`,panelId:e.id,path:g,rendered:Zr(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=Si(e),u=new Map,d,p=async r=>{let i=await fi({diagnostics:n,panelId:e.id,path:r,signal:d?.signal,cache:u,fetcher:(e,n)=>D(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`&&Pi(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=Ei({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,te();let t=v.current[e.id];Xr(t,e,b)&&n.record({kind:`panel-rendered`,panelId:e.id,path:g,rendered:Yr(e,b)}),v.current={...v.current,[e.id]:b},l(v.current)}else r||S(`No usable pull-request observations.`);if(o=!1,a.delete(d),!r){let t=Ci(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 ne=()=>{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}),D(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:Ue(t.headers)};if(t.status===304)n.record(r),te();else try{let i=Li(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.`}),S(`Response was not a valid signal envelope.`);return}return n.record({...r,envelope:i,...i.state===`error`?{failure:Ni(i,t)}:{}}),te(),{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:Fi(t)}),new Ii(t)}}).then(i=>{if(!i)return;let a=i.envelope;if(e.type===`pipeline-status`){let o=oi(t.board,e),s=c.latest(o),l=gi({envelope:a,accepted:s,estimatedDurationMs:c.resolveEstimatedDuration(o)}),u=hi({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];Xr(t,e,a)&&n.record({kind:`panel-rendered`,panelId:e.id,path:g,rendered:Yr(e,a)}),v.current={...v.current,[e.id]:a},l(v.current)}}).catch(t=>{S(t),t instanceof Ii||n.record({kind:`panel-fetch-failure`,panelId:e.id,path:g,message:Fi(t)})}).finally(()=>{if(o=!1,!r){let t=Ci(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),ne()},t.delayMillis);i.add(r)}}))};ne()}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 Ni(e,t){let n=t.headers.get(`x-dashboard-request-id`);return{reason:e.error.message,...n?{supportReference:n}:{}}}function Pi(e){return typeof e==`object`&&!!e&&e.type===`pull-request-candidates`&&Array.isArray(e.pullRequests)}function Fi(e){return e instanceof Error?e.message:String(e)}var Ii=class extends Error{constructor(e){super(Fi(e))}};function Li(e){let t=ie.safeParse(e);return t.success?t.data:void 0}function Ri({env:e}){return e.security===`blocked`?u(Nr,{mode:`blocked`}):e.auth?u(et,{env:e,auth:e.auth,children:(t,n)=>u(zi,{env:e,accessToken:t,onDenied:n})}):u(zi,{env:e})}function zi({env:e,accessToken:t,onDenied:n}){let o=a(null);o.current||=new Ve(e);let s=o.current,c=i(()=>t?{accessToken:t,onAuthenticationFailure:e=>e===403&&n?.()}:void 0,[t,n]);Jr({env:e,diagnostics:s,auth:c});let{board:l,loadedBoardName:f}=Hr({env:e,diagnostics:s,auth:c}),{signals:p,updateHealth:m,factSignals:h,schedules:g,rejectedPipelines:_}=Mi({board:f===e.board?l:void 0,env:e,diagnostics:s,auth:c}),v=i(()=>l?ve(l.panels):void 0,[l]),y=i(()=>Te({board:l,signals:p,updateHealth:m,factSignals:h}),[l,h,p,m]),b=y.length?l?.attention?.treatment:void 0,x=new Set(y.map(e=>e.panelId));return r(()=>{v&&v.issues.length!==0&&s.record({kind:`layout-analyzed`,issueCount:v.issues.length,affectedPanelIds:v.issues.map(e=>e.panelId)})},[s,v]),d(`div`,{className:`${T.board} ${b?T[`attention-${b}`]:``}`,"data-attention-treatment":b,"data-attention-active":y.length||void 0,children:[d(`header`,{className:T.header,children:[u(`h1`,{className:T.title,children:e.board}),e.security===`warning`&&u(Nr,{mode:`warning`}),y.length>0&&d(`aside`,{className:T.attentionRail,role:`alert`,"aria-label":`Important panel attention`,children:[u(`span`,{className:T.attentionGlyph,"aria-hidden":`true`,children:`⚠`}),u(`ul`,{children:y.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:T.grid,children:[!l&&u(nt,{label:`board`,hint:`Loading configuration…`,wide:!0}),l?.panels.filter(e=>!w(e.position)).map(e=>u(Dr,{panel:e,envelope:p[e.id],attentionActive:x.has(e.id),updateHealth:m[e.id],rejectedPipeline:_[e.id],facts:h[e.id]},e.id))]}),d(`footer`,{className:T.footer,"data-board-footer":!0,children:[u(`span`,{children:`Signals are read live from their configured authorities.`}),d(`div`,{className:T.footerTools,children:[c&&u(kr,{env:e,auth:c}),v&&v.issues.length>0&&u(Je,{board:e.board,layout:v,env:e,auth:c}),u(Oe,{log:s,updateActivity:()=>{let e=s.retainedEvidence(),t=Fr({schedules:g,...e});return{capturedAt:t.capturedAt,window:t.window,schedules:t.schedules}}}),u(Vr,{board:l,schedules:g,log:s})]})]})]})}var Bi={error:`_error_yx1g9_1`};function Vi({message:e}){return d(`div`,{className:Bi.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 Hi=document.getElementById(`root`);if(!Hi)throw Error(`No #root element in the document — the template is not the one we expect.`);var Ui=c(Hi);try{Ui.render(u(t,{children:u(Ri,{env:x()})}))}catch(e){Ui.render(u(Vi,{message:e instanceof Error?e.message:String(e)}))}
|
|
3
|
-
//# sourceMappingURL=index-
|
|
2
|
+
${e.prettifyError(n.error)}`);return n.data}var ee=/^([1-9][0-9]*)(ms|s|m|h)$/,te={ms:1,s:1e3,m:6e4,h:36e5};function S(e){let t=ee.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*te[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 ne=e.enum([`unreachable`,`unauthorized`,`not-found`,`no-runs`,`upstream-error`]),re=e.object({kind:ne,message:e.string()}),ie=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:re})]),ae=e.object({kind:e.enum([`job`,`stage`,`step`]),name:e.string().min(1),parent:e.string().min(1).optional()}),C=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:ae.optional(),estimatedDurationMs:e.number().int().positive().optional(),sourceUpdatedAt:e.iso.datetime().optional()}),oe=e.discriminatedUnion(`status`,[e.object({type:e.literal(`test-count`),status:e.literal(`reported`),total:e.number().int().nonnegative(),passed:e.number().int().nonnegative().optional(),failed:e.number().int().nonnegative().optional(),skipped:e.number().int().nonnegative().optional()}),e.object({type:e.literal(`test-count`),status:e.literal(`pending`)}),e.object({type:e.literal(`test-count`),status:e.literal(`not-reported`)})]),se={passed:0,cancelled:1,unknown:2,running:3,warning:4,failed:5};function ce(e){return se[e]}var le=e.object({label:e.string().min(1),status:C.shape.status,detail:e.string().min(1),link:e.url().nullable()}),ue=e.object({type:e.literal(`pull-request-health`),status:C.shape.status,summary:e.string().min(1),workflows:e.array(le),pullRequests:e.array(le),incompleteObservations:e.array(e.object({label:e.string().min(1),message:e.string().min(1)})).optional(),newestObservedAt:e.iso.datetime().optional()}),de=e.object({number:e.number().int().positive(),branch:e.string().min(1),link:e.url()}),fe=e.object({type:e.literal(`pull-request-candidates`),pullRequests:e.array(de),truncated:e.boolean().optional()}),pe=e.object({type:e.literal(`pull-request-workflow`),workflow:e.string().min(1),item:le}),me=e.object({type:e.literal(`pull-request-build`),branch:e.string().min(1),item:le}),he=e.object({type:e.literal(`http-value`),value:e.union([e.string(),e.number(),e.boolean()])}),ge=12,_e=12;function ve(e){let t=e.flatMap(e=>!e.position||w(e.position)||ye(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&&!w(i.position))for(let a=r+1;a<e.length;a++){let r=e[a];if(!r?.position||w(r.position)||!be(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 w(e){return e?.x===0&&e.y===0&&e.w===0&&e.h===0}function ye(e){return!w(e)&&e.x+e.w<=ge&&e.y+e.h<=_e}function be(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 xe={refreshMillis:6e4,runningRefreshMillis:15e3,runningCompletionRefreshMillis:5e3,runningCompletionWindowMillis:12e4};function Se(e,t){let n=(e,t)=>S(e??``)??t,r=(r,i,a)=>n(t[r],n(e[i],a));return{refreshMillis:r(`refresh`,`refresh`,xe.refreshMillis),runningRefreshMillis:r(`running_refresh`,`running_refresh`,xe.runningRefreshMillis),runningCompletionRefreshMillis:r(`running_completion_refresh`,`running_completion_refresh`,xe.runningCompletionRefreshMillis),runningCompletionWindowMillis:r(`running_completion_window`,`running_completion_window`,xe.runningCompletionWindowMillis)}}var Ce=[`radial`,`runway`,`orbit`,`signal-field`,`telemetry-bloom`,`release-transit`,`status-weather`,`falling-shapes`,`snowman`,`flight-path`],we=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`])})])}),T={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 Te(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=Ee(i);return a?[{panelId:t.id,label:n,reason:`${r.label}: ${a}`,factId:r.id}]:[]});let r=De(t.type,e.signals[t.id],e.updateHealth[t.id]);return r?[{panelId:t.id,label:n,reason:r}]:[]}):[]}function Ee(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:he.safeParse(e.envelope.signal).success?void 0:`Invalid value`}function De(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=C.safeParse(t.signal);return e.success?e.data.status===`failed`?`Pipeline failed`:void 0:`Invalid signal`}if(e===`pull-request-health`){let e=ue.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 he.safeParse(t.signal).success?void 0:`Invalid value`}}var E={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 Oe({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:E.diagnostics,children:[d(`button`,{className:E.button,type:`button`,"aria-expanded":n,onClick:()=>r(!n),children:[`Diagnostics (`,i,`)`,a>0&&` · GitHub consistency ${a}`]}),n&&d(`div`,{className:E.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?` (${ke(c.retained.firstEventAt,c.retained.lastEventAt)})`:``,`. They are never uploaded.`]}),c.retained.evidenceMayBeIncomplete&&d(`p`,{className:E.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:E.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:E.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:E.actions,children:[u(`button`,{className:E.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:E.button,type:`button`,onClick:()=>{window.confirm(`Clear this browser’s retained dashboard diagnostics?`)&&e.clear()},children:`Clear`})]})]})]})}function ke(e,t){return e===t?e:`${e} to ${t}`}function Ae(){try{return window.localStorage}catch{return}}function je(e,t){try{let n=e?.getItem(t);return n?JSON.parse(n):void 0}catch{return}}function Me(e,t,n){try{e?.setItem(t,JSON.stringify(n))}catch{}}function Ne(e,t){try{e?.removeItem(t)}catch{}}function Pe(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 Fe=`0.31.52`,Ie=`ze-great-dashboard.diagnostics.v2`,Le=`ze-great-dashboard.diagnostics.v1`,Re=2e3,ze=6048e5,Be=[`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`],Ve=class{env;storage;now;events=[];retention=We();revision=0;incidents=[];listeners=new Set;sessionId=crypto.randomUUID?.()??`${Date.now()}-${Math.random()}`;constructor(e,t=Ae(),n=()=>new Date){this.env=e,this.storage=t,this.now=n,Ne(this.storage,Le),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=Ke([...this.events,{...e,schemaVersion:2,at:this.now().toISOString(),sessionId:this.sessionId,board:this.env.board,clientVersion:Fe,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=()=>Fe;assetPath=()=>this.env.assetPath;snapshot=()=>this.revision;summary=()=>Pe(this.events,this.retention,this.incidents.length);retainedEvidence=()=>({events:[...this.events],retention:{...this.retention}});clear(){this.events=[],this.incidents=[],this.retention=We(),Ne(this.storage,Ie),this.revision++,this.notify()}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});export=e=>({schemaVersion:2,exportedAt:this.now().toISOString(),client:{version:Fe,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=je(this.storage,Ie);if(!e||e.schemaVersion!==2||!Array.isArray(e.events)||!e.events.every(qe))return Ne(this.storage,Ie),[];let t=Ke(e.events.map(e=>({...e,schemaVersion:2})),this.now(),Ge(e.retention));return this.retention=t.retention,this.incidents=He(e.githubConsistencyIncidents),t.events}persist(){Me(this.storage,Ie,{schemaVersion:2,events:this.events,retention:this.retention,githubConsistencyIncidents:this.incidents})}notify(){for(let e of this.listeners)e()}};function He(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 Ue(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 We(){return{eventsPrunedByAge:0,eventsPrunedByCount:0}}function Ge(e){if(!e||typeof e!=`object`)return We();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 Ke(e,t,n){let r=t.valueOf()-ze,i=e.filter(e=>Number.isFinite(new Date(e.at).valueOf())&&new Date(e.at).valueOf()>=r),a=e.length-i.length,o=Math.max(0,i.length-Re);return{events:i.slice(-2e3),retention:{eventsPrunedByAge:n.eventsPrunedByAge+a,eventsPrunedByCount:n.eventsPrunedByCount+o}}}function qe(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`&&Be.includes(t.kind)}function D(e,t,n,r=globalThis.fetch,i={}){let a=new Headers(n?.headers);return a.set(`X-Dashboard-Client-Version`,Fe),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 Je({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:T.layoutWarning,"data-layout-warning":!0,children:[d(`button`,{className:T.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:T.layoutWarningDialog,id:c,role:`dialog`,"aria-labelledby":`${c}-title`,"aria-modal":`false`,children:[d(`div`,{className:T.layoutWarningHeading,children:[u(`strong`,{id:`${c}-title`,children:`Layout warnings`}),u(`button`,{className:T.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:T.layoutWarningDownloads,children:[u(`button`,{type:`button`,onClick:()=>void Ye(n,`${l}/rendered`,i),children:`Download legal rendered layout`}),u(`button`,{type:`button`,onClick:()=>void Ye(n,`${l}/authored`,i),children:`Download authored layout`})]}),u(`p`,{className:T.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 Ye(e,t,n){let r=await D(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)}var Xe={auth:`_auth_19xn9_1`,signout:`_signout_19xn9_24`},Ze=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 Qe(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 Ze,stateStore:new _({store:window.sessionStorage}),automaticSilentRenew:!0}),n=$e(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 $e(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 et({env:e,auth:t,children:n}){let r=i(()=>Qe(t),[t]);return u(f,{userManager:r,onSigninCallback:()=>window.history.replaceState({},document.title,window.location.pathname),children:u(tt,{env:e,children:n})})}function tt({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:Xe.auth,"aria-live":`polite`,children:`Signing in…`}):s?d(`main`,{className:Xe.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:Xe.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:Xe.signout,type:`button`,onClick:()=>void i.signoutRedirect(),children:`Sign out`}),t(i.user.access_token,h)]})}var O={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 nt({label:e,hint:t,wide:n=!1}){return d(`section`,{className:`${O.panel} ${n?O.wide:``}`,"data-panel":!0,"data-panel-id":`placeholder`,children:[u(`h2`,{className:O.label,children:e}),u(`p`,{className:O.hint,children:t})]})}function k(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 A={fact:`_fact_bnc4n_1`,facts:`_facts_bnc4n_5`,factCell:`_factCell_bnc4n_12`,factSource:`_factSource_bnc4n_31`};function rt(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 it={"pipeline-status":{glyph:`▣`,label:`Pipeline status`},"pull-request-health":{glyph:`⌘`,label:`Pull request health`},"http-value":{glyph:`◌`,label:`HTTP value`},"test-count":{glyph:`≡`,label:`Test count`},"pipeline-animation-demo":{glyph:`✦`,label:`Pipeline animation demo`}},at={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 ot(e){return it[e]}[...Object.entries(it).map(([e,t])=>({glyph:t.glyph,meaning:`panel type: ${e}`})),...Object.entries(at).map(([e,t])=>({glyph:t.glyph,meaning:`status: ${e}`}))];function j({children:e,className:t,title:n}){return u(`p`,{className:`${O.hint} ${t??``}`,title:n,children:e})}function M({glyph:e,label:t,value:n,compact:r,title:i,observed:a=!1,emphasis:o,className:s}){return d(`p`,{className:`${O.hint} ${a?O.observed:``} ${o?O[o]:``} ${O.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:O.metaValue,title:i,children:[u(`span`,{className:O.fullValue,children:n}),r&&u(`span`,{className:O.compactValue,"aria-hidden":`true`,children:r.kind===`short-value`?r.value:null})]})]})}function N({children:e,className:t,priority:n=`secondary`,anchor:r}){return u(`div`,{className:`${O.evidence} ${t??``}`,"data-panel-evidence":!0,"data-panel-evidence-priority":n,"data-panel-anchor":r,children:e})}function P({status:e,emphasis:t,glyph:n,label:r,compactOnly:i=!1}){return d(`p`,{className:`${O.status} ${e?O[e]:``} ${t?O[t]:``} ${i?O.compactOnlyStatus:``}`,"data-panel-status":!0,children:[n&&u(`span`,{className:O.statusGlyph,"aria-hidden":`true`,children:n}),n&&r&&` `,u(`span`,{className:O.statusText,children:r})]})}function st({children:e,emphasis:t}){return u(`p`,{className:`${O.status} ${t?O[t]:``}`,children:e})}function F({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=ot(e.type),m=f!==void 0&&f.h<=2,h=f!==void 0&&f.h<=3;return d(`section`,{className:`${O.panel} ${O[`density-${l}`]} ${m?O.shallow:``} ${h?O.short:``} ${a?O.error:``} ${i?O.attentionActive:``}`,id:`panel-${e.id}`,style:rt(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(ct,{panelId:e.id,link:t?.link??n}),d(`div`,{className:`${O.content} ${s===`status-band`?O.statusBand:``}`,"data-panel-content":!0,"data-panel-layout":s,children:[d(`h2`,{className:O.label,"data-panel-anchor":`identity`,children:[p&&u(`span`,{className:O.typeGlyph,"aria-hidden":`true`,title:p.label,"data-panel-type-glyph":!0,children:p.glyph}),u(`span`,{className:O.identityText,"data-panel-identity-text":!0,children:e.label??e.id})]}),c]})]})}function ct({panelId:e,link:t}){return t?d(`a`,{className:O.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 I({value:e,label:t=`Observed`}){return u(R,{value:e,label:t})}function lt({sourceUpdatedAt:e,observedAt:t,running:n,runStartedAt:r}){return n&&r?u(R,{value:r,label:`Started`}):u(R,{value:e??t,label:e?`Last update`:`Observed`})}function L({health:e}){let t=e.consecutiveFailures>=3,n=t?`Updates unavailable`:`Updates delayed`;return d(l,{children:[u(M,{glyph:`⚠`,label:n,value:`${n} · ${e.message}`,title:e.message,emphasis:t?`serious`:`warning`}),u(R,{value:e.lastConfirmedAt,label:`Last confirmed`})]})}function ut({value:e}){return u(R,{value:e,label:`Last confirmed`})}function R({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} ${dt(i)}`;return u(M,{glyph:`◷`,label:t,value:a,compact:{kind:`short-value`,value:ft(i)},title:`${t} at ${r}`,observed:!0})}function dt(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 ft(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 pt({panel:e,envelope:t,attentionActive:n,updateHealth:r,facts:i}){if(e.facts)return u(mt,{panel:e,attentionActive:n,facts:i});if(!t)return u(F,{panel:e,attentionActive:n,children:u(N,{children:u(j,{children:`Loading…`})})});if(t.state===`error`){let r=k(t.error.kind);return u(F,{panel:e,envelope:t,attentionActive:n,error:!0,children:d(N,{children:[u(P,{glyph:`⚠`,label:r.label,emphasis:r.emphasis}),u(j,{children:t.error.message})]})})}let a=he.safeParse(t.signal);return a.success?u(F,{panel:e,envelope:t,attentionActive:n,children:d(N,{className:A.fact,children:[u(P,{glyph:`✓`,label:`Value read`,compactOnly:!0}),u(st,{children:String(a.data.value)}),u(I,{value:t.observedAt}),r&&u(L,{health:r})]})}):u(F,{panel:e,envelope:t,attentionActive:n,error:!0,children:u(N,{children:u(P,{glyph:`⚠`,label:`Invalid value`})})})}function mt({panel:e,attentionActive:t,facts:n}){return e.facts?u(F,{panel:e,attentionActive:t,children:u(N,{children:u(`div`,{className:A.facts,"data-http-value-facts":!0,children:e.facts.map(e=>u(ht,{label:e.label,observation:n?.[e.id]},e.id))})})}):null}function ht({label:e,observation:t}){let n=t?.envelope;if(!n)return d(`section`,{className:A.factCell,"data-http-value-fact":!0,children:[u(`h3`,{children:e}),u(st,{emphasis:t?.failure?`serious`:void 0,children:t?.failure?`⚠ Updates unavailable`:`Loading…`}),t?.updateHealth&&u(L,{health:t.updateHealth})]});if(n.state===`error`){let t=k(n.error.kind);return d(`section`,{className:A.factCell,"data-http-value-fact":!0,"data-error":!0,children:[u(gt,{label:e,link:n.link}),u(`h3`,{children:e}),u(P,{glyph:`⚠`,label:t.label,emphasis:t.emphasis}),u(j,{children:n.error.message}),u(I,{value:n.observedAt})]})}let r=he.safeParse(n.signal);return r.success?d(`section`,{className:A.factCell,"data-http-value-fact":!0,children:[u(gt,{label:e,link:n.link}),u(`h3`,{children:e}),u(st,{children:String(r.data.value)}),u(I,{value:n.observedAt})]}):d(`section`,{className:A.factCell,"data-http-value-fact":!0,"data-error":!0,children:[u(gt,{label:e,link:n.link}),u(`h3`,{children:e}),u(P,{glyph:`⚠`,label:`Invalid value`,emphasis:`serious`}),u(I,{value:n.observedAt})]})}function gt({label:e,link:t}){return t?d(`a`,{className:A.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 _t={variant:`_variant_14ks8_1`,variantPrefix:`_variantPrefix_14ks8_9`},z={field:`_field_1x3vm_1`,grid:`_grid_1x3vm_10`,piece:`_piece_1x3vm_14`,cell:`_cell_1x3vm_34`,clearingCell:`_clearingCell_1x3vm_38`,"clear-cell":`_clear-cell_1x3vm_1`},vt=.85,yt=[[{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 bt(e,t){return e>t?`horizontal`:`vertical`}function xt(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 St(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 Ct(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 wt(e,t,n){let r=yt.filter(e=>St(e,t,n));return r[Nt(e,r.length)]??[{x:0,y:0}]}function Tt(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=>Ct(s,e))||!Mt(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<jt(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[Nt(a,d.length)];return f?{x:f.x,y:f.y}:void 0}function Et(e,t,n,r,i,a){let o=yt.flatMap((o,s)=>{if(!St(o,t,n))return[];let c=Tt(o,e,t,n,r,i+s*31,a);return c?[{shape:o,destination:c}]:[]});if(o.length!==0)return o[Nt(i,o.length)]}function Dt(e,t,n){return Math.ceil(e*t*vt*Math.min(1,Math.max(0,n)))}function Ot(e){return e.reduce((e,t)=>e+t.cells.length,0)}function kt(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 At(e,t,n,r,i){let a=[];for(let o=0;o<i;o+=1){let i=r+o*17,s=wt(i,t,n),c=Tt(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 jt(e,t){return t===`vertical`?new Set(e.map(e=>e.x)).size:new Set(e.map(e=>e.y)).size}function Mt(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=>Ct({...i,y:e},t)))return!1;return i.y+s<=r}for(let e=n-o;e>=i.x;--e)if(a.some(t=>Ct({...i,x:e},t)))return!1;return i.x+o<=n}function Nt(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 Pt=1250;function Ft(){return{settled:[],active:[],nextPieceAt:Pt,recycleUntil:0,nextId:0,recycling:!1,clearingCells:[]}}function It(e,t){if(t.elapsed<e.recycleUntil)return e;let n=e.settled,r=e.active,i=e.nextPieceAt,a=e.recycleUntil,o=e.nextId,s=e.recycling,c=e.clearingCells;if(s&&(s=!1,c=[]),t.elapsed>=i&&r.length===0){let a=Dt(t.columns,t.rows,t.progress);if(t.progress<1&&Ot(n)>=a)return{...e,recycling:s,clearingCells:c};let l=Et(t.direction,t.columns,t.rows,n,t.seed+o*17+1,!t.overdue);if(!l&&(t.progress>=1||t.estimatedDurationMs===void 0)){let r=kt(t.direction,t.columns,t.rows,n,!0);if(r)return{...e,settled:r.shapes,recycleUntil:t.elapsed+500,nextPieceAt:t.elapsed+500,recycling:!0,clearingCells:r.cleared}}if(l){let e=Math.max(...l.shape.map(e=>e.y))+1;r=[{id:o,bornAt:t.elapsed,cells:l.shape,x:t.direction===`horizontal`?t.columns-Math.max(...l.shape.map(e=>e.x))-.5:l.destination.x,y:t.direction===`vertical`?-e+.5:l.destination.y,targetX:l.destination.x,targetY:l.destination.y,phase:`entry`}],o+=1,i+=Rt(t.estimatedDurationMs,t.columns,t.rows)}}let l=[];for(let e of r){let r=t.elapsed-e.bornAt,i=Math.min(1,Math.max(0,(r-250)/850));if(i>=1&&e.targetX!==void 0&&e.targetY!==void 0){n=[...n,{...e,x:e.targetX,y:e.targetY,phase:`settled`}];continue}let a=t.direction===`horizontal`?t.columns-Math.max(...e.cells.map(e=>e.x))-1:e.targetX??e.x,o=t.direction===`vertical`?0:e.targetY??e.y,s=Math.min(1,Math.max(0,r/1100));l.push({...e,x:t.direction===`horizontal`?a+((e.targetX??a)-a)*i:a,y:t.direction===`vertical`?o+((e.targetY??o)-o)*i:o,phase:r<250?`entry`:s<.35?`align`:`travel`})}return{settled:n,active:l,nextPieceAt:i,recycleUntil:a,nextId:o,recycling:s,clearingCells:c}}function Lt(e){return[...e.settled,...e.active]}function Rt(e,t,n){let r=Math.ceil(t*n*.85);return e===void 0||r<=0?Pt:Math.max(400,e/Math.max(1,Math.ceil(r/3)))}var zt=50;function Bt({progress:e,estimatedDurationMs:t,overdue:n,seed:i=0}){let s=a(null),[c,l]=o({...xt(`vertical`),direction:`vertical`}),[f,p]=o(!1),[m,h]=o(Ft),g=a(c),_=a(void 0),v=a(e),y=a(i),b=a(Ft()),x=a(Date.now());r(()=>{v.current=e,y.current=i},[e,i]),r(()=>{let e=s.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect();if(t.width===0||t.height===0)return;let n=_.current??bt(t.width,t.height);_.current=n;let r={...xt(n,t.width,t.height),direction:n};g.current=r,l(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=()=>p(e.matches);return t(),e.addEventListener?.(`change`,t),()=>e.removeEventListener?.(`change`,t)},[]),r(()=>{if(b.current=Ft(),x.current=Date.now(),f){let e=At(c.direction,c.columns,c.rows,y.current,Math.max(1,Math.floor(v.current*6)));h({...Ft(),settled:e})}else h(b.current)},[c,f]),r(()=>{if(f)return;let e=window.setInterval(()=>{let e=It(b.current,{elapsed:Date.now()-x.current,...g.current,progress:v.current,estimatedDurationMs:t,overdue:n,seed:y.current});b.current=e,h(e)},zt);return()=>window.clearInterval(e)},[t,n,f]);let ee=Lt(m);return u(`div`,{ref:s,className:z.field,"data-running-part":`falling-shapes-field`,"data-overdue":n||void 0,"data-direction":c.direction,"data-recycling":m.recycling||void 0,style:{"--shape-columns":c.columns,"--shape-rows":c.rows},children:d(`div`,{className:z.grid,children:[m.clearingCells.map(e=>u(`span`,{className:z.clearingCell,style:{"--clear-x":e.x,"--clear-y":e.y}},`${e.x}-${e.y}`)),ee.map(e=>u(`div`,{className:z.piece,"data-piece":e.id,"data-piece-phase":e.phase,style:{"--piece-x":e.x,"--piece-y":e.y,"--piece-width":Math.max(...e.cells.map(e=>e.x))+1,"--piece-height":Math.max(...e.cells.map(e=>e.y))+1},children:e.cells.map(e=>u(`span`,{className:z.cell,style:{"--cell-x":e.x,"--cell-y":e.y}},`${e.x}-${e.y}`))},e.id))]})})}var B={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`},Vt={x:8,y:74},Ht={x:22,y:74},Ut={x:38,y:30},Wt={x:65,y:30},Gt={x:88,y:48};function Kt(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function qt(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 V(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 Jt(e){return{x:e.x-50,y:e.y-50}}function Yt(e,t){if(t){let e={x:50,y:30};return V(e,Jt(e),0,`holding`,20)}let n=Math.min(1,Math.max(0,e));if(n<.18)return V(Kt(Vt,Ht,n/.18),{x:0,y:0},0,`rollout`);if(n<.35){let e=(n-.18)/.17,t=qt(Ht,{x:28,y:74},{x:32,y:30},Ut,e),r=e*e*(3-2*e),i=Jt(t);return V(t,{x:i.x*r,y:i.y*r},-7,`climb`,20*r)}if(n<.7){let e=Kt(Ut,Wt,(n-.35)/.35);return V(e,Jt(e),0,`cruise`,20)}let r=(n-.7)/.3,i=qt(Wt,{x:72,y:30},{x:80,y:47},Gt,r),a=r*r*(3-2*r);return V(i,Jt(i),4,`approach`,20*(1-a))}function Xt({progress:e,indeterminate:t}){let n=Yt(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:B.scene,"data-running-part":`flight-path`,"data-flight-stage":n.stage,style:r,children:[d(`span`,{className:B.ground,"data-running-part":`flight-ground`,children:[u(`span`,{className:B.groundGlow}),u(`span`,{className:B.groundTerrain,"data-running-part":`flight-ground-terrain`}),u(`span`,{className:B.groundTerrainOverdrive,"data-running-part":`flight-ground-overdrive`}),u(`span`,{className:B.groundRunway,"data-running-part":`flight-ground-runway`})]}),d(`span`,{className:`${B.cloudLayer} ${B.cloudLayerFar}`,"data-running-part":`flight-cloud-layer`,"data-flight-depth":`far`,children:[u(`span`,{className:`${B.cloud} ${B.cloudOne}`,"data-running-part":`flight-cloud`}),u(`span`,{className:`${B.cloud} ${B.cloudTwo}`,"data-running-part":`flight-cloud`}),u(`span`,{className:`${B.cloud} ${B.cloudThree}`,"data-running-part":`flight-cloud`}),u(`span`,{className:`${B.cloud} ${B.cloudFour}`,"data-running-part":`flight-cloud`})]}),u(`span`,{className:B.plane,"data-running-part":`flight-plane`,children:d(`svg`,{className:B.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:B.windows,d:`M25 18h4v2h-4zm7 0h4v2h-4zm7 0h4v2h-4z`})]})}),d(`span`,{className:`${B.cloudLayer} ${B.cloudLayerNear}`,"data-running-part":`flight-cloud-layer`,"data-flight-depth":`near`,children:[u(`span`,{className:`${B.cloud} ${B.cloudFive}`,"data-running-part":`flight-cloud`}),u(`span`,{className:`${B.cloud} ${B.cloudSix}`,"data-running-part":`flight-cloud`}),u(`span`,{className:`${B.cloud} ${B.cloudSeven}`,"data-running-part":`flight-cloud`}),u(`span`,{className:`${B.cloud} ${B.cloudEight}`,"data-running-part":`flight-cloud`})]})]})}var H={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 Zt(){return d(l,{children:[u(`span`,{className:H.frontier,"data-running-part":`frontier`}),u(`span`,{className:H.now,"data-running-part":`transit-now`}),u(`span`,{className:H.routes,"data-running-part":`transit-routes`,children:[0,1,2].map(e=>u(`span`,{className:H.route},e))}),u(`span`,{className:H.trail,"data-running-part":`transit-trail`}),u(`span`,{className:H.packet,"data-running-part":`transit-packet`})]})}var Qt={field:`_field_1i9kx_1`,overdue:`_overdue_1i9kx_11`,timing:`_timing_1i9kx_14`,timingOverdue:`_timingOverdue_1i9kx_28`},$t={field:`_field_ozs8n_1`,canvas:`_canvas_ozs8n_7`};function en(e){let t=e*.25,n=e*.2,r=t<700||n<350?`snowfall`:n<530?`arrival`:n<1030?`hop`:`full`,i=tn((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 U(e,t,n){return n===t?Number(e>=n):tn((e-t)/(n-t),0,1)}function W(e){return e*e*(3-2*e)}function tn(e,t,n){return Math.max(t,Math.min(n,e))}var nn=25,rn=.5,an=.95;function on(e={width:360,height:180}){return{nextAt:0,id:0,lastElapsed:0,grid:sn(e),flakes:[],cells:[],toppled:!1}}function sn(e){return{columns:Rn(Math.round(e.width/4),48,180),rows:Rn(Math.round(e.height/4),28,100)}}function cn(e,t,n){return n?`overdue`:t===void 0||en(t).mode===`snowfall`?`snowing`:e>=an?`complete`:e>=rn?`assembling`:`drift`}function ln(e,t){let n=K(e+41)<.5?-1:1,r=n*(.72+K(e+43)*.45),i=Math.sin(t/1600+K(e+47)*Math.PI*2)*.4,a=n*Math.max(0,Math.sin(t/3100+K(e+53)*Math.PI*2))**7*(3.2+K(e+59)*1.8);return r+i+a}function un(e){let t=sn(e);return Math.round(t.columns*t.rows*.18)}function dn(e,t,n=!1,r=0){if(e===void 0)return n?30:60;let i=e*an/un(t);if(n)return i/2;let a=en(e);return a.mode!==`snowfall`&&r>=Math.max(0,a.bodyStart-500)?i*4:i}function fn(e,{elapsed:t,progress:n,estimatedDurationMs:r,overdue:i,seed:a,dimensions:o}){let s=sn(o),c=e.grid.columns===s.columns&&e.grid.rows===s.rows?Ln(e):on(o),l=Math.max(c.lastElapsed,t);for(let e=c.lastElapsed+nn;e<=l;e+=nn)c=hn(c,e,r===void 0?n:e/r,r,i&&(r===void 0||e>=r),a,o),c.lastElapsed=e;return c}function pn(e){return e.filter(e=>e.owner===`snowman`).length}function mn(e){return e.cells.map(t=>{let n=t.owner===`body`?e.body:t.owner===`head`?e.head:void 0,r=n&&t.localX!==void 0&&t.localY!==void 0?{...t,x:n.x+t.localX*Math.cos(n.angle)-t.localY*Math.sin(n.angle),y:n.y+t.localX*Math.sin(n.angle)+t.localY*Math.cos(n.angle)}:t;return e.toppling&&r.owner!==`ground`?In(r,e.toppling):r})}function hn(e,t,n,r,i,a,o){let s=cn(n,r,i),c=dn(r,o,i,t);for(;t>=e.nextAt;)e.flakes.push({id:e.id++,x:K(a+e.id*17)*e.grid.columns,y:-1-K(a+e.id*23)*6,bornAt:e.nextAt}),e.nextAt+=c;gn(e,n,r,i);let l=kn(e),u=ln(a,t)*(nn/1e3),d=r===void 0?.52:Math.max(.52,(e.grid.rows+7)*nn/(r*.25)),f=[];for(let t of e.flakes){let n={...t,x:t.x+u,y:t.y+d},r=bn(e,n);if(r){xn(e,r,t.id,n.x-r.x,n.y-r.y);continue}let i=jn(n,l,e.grid,u,a);if(!i){f.push({...n,x:Rn(n.x,0,e.grid.columns-1)});continue}let o=l.get(G(i.x,i.y+1));e.cells.push({id:t.id,x:i.x,y:i.y,owner:o===`body`||o===`head`||o===`snowman`?`snowman`:`ground`}),l.set(G(i.x,i.y),e.cells.at(-1)?.owner??`ground`)}e.flakes=f,r!==void 0&&s!==`drift`&&s!==`snowing`&&vn(e),wn(e),An(e,a,t),An(e,a,t+nn/2);let p=e.body;return p?.locked&&(p.supportY??=Mn(e,p.x,p.radius,p.y+p.radius),p.y=p.supportY),i&&!e.toppling&&!e.toppled&&pn(e.cells)>=60&&Pn(e,t),Fn(e,t),e}function gn(e,t,n,r){if(n===void 0)return;let i=en(n);if(i.mode===`snowfall`)return;let a=t*n,{columns:o,rows:s}=e.grid,c=W(U(a,i.bodyStart,i.bodyEnd));if(a>=i.bodyStart&&!e.body){let t=o*.14;e.body={kind:`body`,x:t,y:Mn(e,t,2,s-1),radius:2,angle:0,locked:!1}}let l=e.body;if(l&&!l.locked){l.radius=Math.max(l.radius,Nn(e,`body`,2));let t=o*(.14+.38*c);_n(l,t,Mn(e,t,l.radius,s-1)),l.locked=a>=i.bodyEnd}if(a>=i.headStart&&!e.head){let t=o*(i.mode===`full`?.88:.66);e.head={kind:`head`,x:t,y:Mn(e,t,1.7,s-1),radius:1.7,angle:0,locked:!1},vn(e)}let u=e.head;if(u&&l&&!u.locked){if(u.radius=Math.max(u.radius,Nn(e,`head`,1.7)),a<i.hopStart){let t=o*(.88-.22*W(U(a,i.headStart,i.hopStart)));_n(u,t,Mn(e,t,u.radius,s-1))}else{u.launch??={x:u.x,y:u.y};let e=U(a,i.hopStart,i.land),t=l.y-l.radius-u.radius+.5;if(u.x=u.launch.x+(l.x-u.launch.x)*W(e),u.y=u.launch.y+(t-u.launch.y)*W(e)-Math.sin(Math.PI*e)*Math.max(5,l.radius*1.5),a>=i.land){let e=U(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=U(a,i.land,i.end);e.hat={x:u.x,y:u.y-u.radius-1-5*(1-t*t),angle:(1-W(t))*-.22}}}function _n(e,t,n){let r=zn(e.y,n,.16),i=t-e.x;e.angle+=Math.sign(i)*Math.hypot(i,r-e.y)/Math.max(e.radius,1),e.x=t,e.y=r}function vn(e){let t=mn(e),n=new Map(e.cells.map(e=>[e.id,e])),r=new Set(t.filter(e=>e.owner===`ground`).map(e=>G(Math.round(e.x),Math.round(e.y)))),i=new Set(t.filter(e=>e.owner===`ground`).filter(e=>!r.has(G(Math.round(e.x),Math.round(e.y)-1))).map(e=>e.id));for(let r of[e.body,e.head]){if(!r||r.locked)continue;let a=r.kind,o=r.radius+.75;for(let a of t){if(!yn(e,r))break;if(a.owner!==`ground`)continue;let t=a.x-r.x,s=a.y-r.y,c=Math.hypot(t,s);if(!i.has(a.id)||c>o||s<-r.radius*.2)continue;let l=n.get(a.id);l&&xn(e,r,l.id,t,s)}r.radius=Math.max(r.radius,Nn(e,a,r.kind===`body`?2:1.7))}}function yn(e,t){if(t.kind===`body`||!e.body)return!0;let n=e.body.radius*.72,r=Math.max(12,Math.round(Math.PI*(Math.max(0,n-1.7)/.6)**2));return e.cells.filter(e=>e.owner===`head`).length<r}function bn(e,t){return[e.body,e.head].filter(e=>e!==void 0&&!e.locked).find(n=>yn(e,n)&&Math.hypot(t.x-n.x,t.y-n.y)<=n.radius)}function xn(e,t,n,r,i){let a=Math.cos(-t.angle),o=Math.sin(-t.angle),s=r*a-i*o;i=r*o+i*a,r=s;let c=e.cells.find(e=>e.id===n),l=Cn(e,t,n),u=Sn(e,t,r,i,n),d={id:n,x:t.x+u.x,y:t.y+u.y,owner:t.kind,localX:u.x,localY:u.y,targetLocalX:l.x,targetLocalY:l.y};c?Object.assign(c,d):e.cells.push(d),t.radius=Math.max(t.radius,Nn(e,t.kind,t.kind===`body`?2:1.7)),Tn(e,t)}function Sn(e,t,n,r,i){let a=e.cells.filter(e=>e.id!==i&&e.owner===t.kind),o=(e,t)=>a.every(n=>Math.hypot((n.localX??0)-e,(n.localY??0)-t)>=.75);if(o(n,r))return{x:n,y:r};for(let e=.75;;e+=.75)for(let i=0;i<32;i++){let a=i*Math.PI/16,s=n+Math.cos(a)*e,c=r+Math.sin(a)*e;if((Math.hypot(s,c)<=t.radius+.75||e>t.radius*2)&&o(s,c))return t.radius=Math.max(t.radius,Math.hypot(s,c)-.5),{x:s,y:c}}}function Cn(e,t,n){let r=e.cells.filter(e=>e.owner===t.kind&&e.targetLocalX!==void 0&&e.targetLocalY!==void 0),i=(e,t,n=.72)=>r.every(r=>Math.hypot((r.targetLocalX??0)-e,(r.targetLocalY??0)-t)>=n);for(let e=0;e<64;e+=1){let r=K(n*31+e*17)*Math.PI*2,a=Math.sqrt(K(n*37+e*19))*Math.max(.4,t.radius-.35),o=Math.cos(r)*a,s=Math.sin(r)*a;if(i(o,s))return{x:o,y:s}}for(let e=.4;e<=t.radius-.35;e+=.5){let t=Math.max(6,Math.round(2*Math.PI*e/.72));for(let r=0;r<t;r++){let a=r*Math.PI*2/t+K(n*13),o=Math.cos(a)*e,s=Math.sin(a)*e;if(i(o,s,.6))return{x:o,y:s}}}return{x:0,y:0}}function wn(e){for(let t of e.cells){if(t.packed||t.localX===void 0||t.localY===void 0||t.targetLocalX===void 0||t.targetLocalY===void 0)continue;let e=zn(t.localX,t.targetLocalX,.25),n=zn(t.localY,t.targetLocalY,.25);t.localX=e,t.localY=n,t.packed=e===t.targetLocalX&&n===t.targetLocalY}}function Tn(e,t){let n=e.cells.filter(e=>e.owner===t.kind&&e.localX!==void 0&&e.localY!==void 0),r=En(t.radius,n.length);n.sort((e,t)=>e.id-t.id);for(let[e,t]of n.entries()){let n=r[e];if(!n)break;t.targetLocalX=n.x,t.targetLocalY=n.y,t.packed=!1}}function En(e,t){let n=Math.max(.2,e-.1),r=[],i=.9,a=i*Math.sqrt(3)/2;for(let e=-Math.ceil(n/a);e<=Math.ceil(n/a);e+=1){let t=e*a,o=e&1?i/2:0;for(let e=-Math.ceil(n/i);e<=Math.ceil(n/i);e+=1){let a=e*i+o;Math.hypot(a,t)<=n&&r.push({x:a,y:t})}}r.sort((e,t)=>Math.hypot(e.x,e.y)-Math.hypot(t.x,t.y));let o=[];for(let e of r)if(o.every(t=>Math.hypot(t.x-e.x,t.y-e.y)>=.82)&&o.push(e),o.length===t)break;return o}function Dn(e){if(e.hat)return e.toppling?{...In(e.hat,e.toppling),angle:e.hat.angle+e.toppling.angle}:e.hat}function On(e,t,n){let r=Ln(t),i=(e,t)=>e+(t-e)*Rn(n,0,1);for(let t of[`body`,`head`]){let n=e[t],a=r[t];n&&a&&(a.x=i(n.x,a.x),a.y=i(n.y,a.y),a.angle=i(n.angle,a.angle))}let a=new Map(e.flakes.map(e=>[e.id,e]));for(let e of r.flakes){let t=a.get(e.id);t&&(e.x=i(t.x,e.x),e.y=i(t.y,e.y))}return r.toppling&&e.toppling&&(r.toppling.angle=i(e.toppling.angle,r.toppling.angle)),r.hat&&e.hat&&(r.hat={x:i(e.hat.x,r.hat.x),y:i(e.hat.y,r.hat.y),angle:i(e.hat.angle,r.hat.angle)}),r}function kn(e){let t=new Map;for(let n of mn(e))t.set(G(Math.round(n.x),Math.round(n.y)),n.owner);return t}function An(e,t,n){let r=kn(e),i=e.cells.filter(e=>e.owner===`ground`).sort((e,t)=>t.y-e.y||e.x-t.x);for(let a of i){let i=G(a.x,a.y+1);if(a.y<e.grid.rows-1&&!r.has(i)){r.delete(G(a.x,a.y)),a.y+=1,r.set(G(a.x,a.y),a.owner);continue}let o=K(t+a.id*29+n)<.5?-1:1;for(let t of[o,-o]){let n=a.x+t;if(!(n<0||n>=e.grid.columns||a.y>=e.grid.rows-1||r.has(G(n,a.y))||r.has(G(n,a.y+1)))){r.delete(G(a.x,a.y)),a.x=n,a.y+=1,r.set(G(a.x,a.y),a.owner);break}}}}function jn(e,t,n,r,i){let a=Math.round(e.x),o=Math.round(e.y);if(o<0)return;if(o>=n.rows-1)return{x:a,y:n.rows-1};if(!t.has(G(a,o+1)))return;let s=r>=0?1:-1,c=K(i+e.id*71+o)>.5?s:-s;for(let e of[c,-c]){let r=a+e;if(r>=0&&r<n.columns&&!t.has(G(r,o+1))&&!t.has(G(r,o)))return{x:r,y:o+1}}return t.has(G(a,o))?{x:a,y:Math.max(0,o-1)}:{x:a,y:o}}function Mn(e,t,n,r){let i=mn(e).filter(e=>e.owner===`ground`&&Math.abs(e.x-t)<=n);return(i.length?Math.min(...i.map(e=>e.y)):r)-n}function Nn(e,t,n){let r=e.cells.filter(e=>e.owner===t).length;return n+Math.sqrt(r/Math.PI)*.5}function Pn(e,t){let n=e.body;n&&(e.toppling={startedAt:t,angle:0,pivotX:n.x,pivotY:n.y+n.radius*.72})}function Fn(e,t){let n=e.toppling;if(!n)return;let r=Rn((t-n.startedAt)/750,0,1);n.angle=(1-(1-r)**3)*(Math.PI/2),r===1&&(e.toppled=!0)}function In(e,t){let n=Math.cos(t.angle),r=Math.sin(t.angle),i=e.x-t.pivotX,a=e.y-t.pivotY;return{...e,x:t.pivotX+i*n-a*r,y:t.pivotY+i*r+a*n}}function Ln(e){return{...e,grid:{...e.grid},hat:e.hat&&{...e.hat},flakes:e.flakes.map(e=>({...e})),cells:e.cells.map(e=>({...e})),body:e.body&&{...e.body},head:e.head&&{...e.head},toppling:e.toppling&&{...e.toppling}}}function G(e,t){return`${e}:${t}`}function Rn(e,t,n){return Math.max(t,Math.min(n,e))}function zn(e,t,n){return Math.abs(t-e)<=n?t:e+Math.sign(t-e)*n}function K(e){let t=Math.sin(e*12.9898)*43758.5453;return t-Math.floor(t)}function Bn(e,t,n){if(!e)return;let r=e.getContext(`2d`);if(!r)return;let i=window.devicePixelRatio||1,a=Math.max(1,Math.round(n.width)),o=Math.max(1,Math.round(n.height));(e.width!==a*i||e.height!==o*i)&&(e.width=a*i,e.height=o*i,e.style.width=`${a}px`,e.style.height=`${o}px`),r.setTransform(i,0,0,i,0,0),r.clearRect(0,0,a,o);let s=a/t.grid.columns,c=o/t.grid.rows;r.fillStyle=`rgba(244, 241, 223, 0.52)`;for(let e of mn(t))Vn(r,(e.x+.5)*s,(e.y+.5)*c,s,c);r.fillStyle=`rgba(244, 241, 223, 0.76)`;for(let e of t.flakes)Vn(r,(e.x+.5)*s,(e.y+.5)*c,s*.72,c*.72);let l=Dn(t);if(l&&t.head){let e=t.head.radius;r.save(),r.translate(l.x*s,l.y*c),r.scale(s,c),r.rotate(l.angle),r.fillStyle=`rgba(27, 31, 24, 0.78)`,r.fillRect(-e*.65,-2,e*1.3,2),r.fillRect(-e,-.3,e*2,.45),r.restore()}}function Vn(e,t,n,r,i){e.beginPath(),e.arc(t,n,Math.max(.8,Math.min(r,i)*.42),0,Math.PI*2),e.fill()}function Hn({progress:e,estimatedDurationMs:t,overdue:n,seed:i=0}){let s=a(null),c=a(null),[l,d]=o({width:360,height:180}),[f,p]=o(()=>window.matchMedia(`(prefers-reduced-motion: reduce)`).matches),m=a(e),h=a(n),g=a({startedAt:Date.now(),progressAt:Date.now(),progress:e,simulation:on()});r(()=>{m.current=e,g.current.progressAt=Date.now(),g.current.progress=e},[e]),r(()=>{h.current=n},[n]),r(()=>{let e=window.matchMedia(`(prefers-reduced-motion: reduce)`),t=()=>p(e.matches);return t(),e.addEventListener?.(`change`,t),()=>e.removeEventListener?.(`change`,t)},[]),r(()=>{let e=s.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect();t.width>0&&t.height>0&&d({width:t.width,height:t.height})};if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]),r(()=>{if(f)return;g.current.simulation=on(l);let e=0,n=()=>{let r=g.current,a=t===void 0?Date.now()-r.startedAt:r.progress*t+(Date.now()-r.progressAt),o={progress:m.current,estimatedDurationMs:t,overdue:h.current,seed:i,dimensions:l},u=fn(r.simulation,{...o,elapsed:a});r.simulation=u;let d=On(u,fn(u,{...o,elapsed:u.lastElapsed+25}),(a-u.lastElapsed)/25);Bn(c.current,d,l);let p=s.current;p&&(p.dataset.snowCellCount=String(u.cells.length),p.dataset.snowDensity=u.grid.columns<65?`compact`:`full`,u.toppled?p.dataset.snowmanToppled=`true`:delete p.dataset.snowmanToppled),f||(e=window.requestAnimationFrame(n))};return e=window.requestAnimationFrame(n),()=>window.cancelAnimationFrame(e)},[l,t,f,i]),r(()=>{if(!f)return;let r=fn(on(l),{elapsed:t===void 0?4800:e*t,progress:e,estimatedDurationMs:t,overdue:n,seed:i,dimensions:l});Bn(c.current,r,l),s.current&&(s.current.dataset.snowCellCount=String(r.cells.length),r.toppled?s.current.dataset.snowmanToppled=`true`:delete s.current.dataset.snowmanToppled)},[l,t,n,e,f,i]);let _=cn(e,t,n);return u(`div`,{ref:s,className:$t.field,"data-running-part":`snowman-field`,"data-snowman-phase":_,"data-reduced-motion":f||void 0,children:u(`canvas`,{ref:c,className:$t.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 Un(){return d(l,{children:[u(`span`,{className:q.haze,"data-running-part":`weather-haze`}),u(`span`,{className:q.pressure,"data-running-part":`weather-pressure`}),u(`span`,{className:`${q.band} ${q.bandOne}`}),u(`span`,{className:`${q.band} ${q.bandTwo}`}),u(`span`,{className:`${q.band} ${q.bandThree}`}),u(`span`,{className:`${q.drift} ${q.driftOne}`}),u(`span`,{className:`${q.drift} ${q.driftTwo}`}),u(`span`,{className:`${q.drift} ${q.driftThree}`}),u(`span`,{className:`${q.drift} ${q.driftFour}`}),u(`span`,{className:`${q.drift} ${q.driftFive}`})]})}var Wn={anchor:`_anchor_1bd86_1`,body:`_body_1bd86_6`,"phased-marker":`_phased-marker_1bd86_1`};function Gn({anchorClassName:e,bodyClassName:t,delay:n,anchorPart:r,bodyPart:i}){let a=n?{"--phased-marker-delay":n}:void 0;return u(`span`,{className:`${Wn.anchor} ${e??``}`,"data-running-part":r,children:u(`span`,{className:`${Wn.body} ${t??``}`,"data-running-part":i,style:a})})}var J={frontier:`_frontier_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 Kn(){return d(l,{children:[u(`span`,{className:J.frontier,"data-running-part":`frontier`}),u(`span`,{className:J.flare,"data-running-part":`bloom-flare`}),u(`span`,{className:J.lanes,"data-running-part":`bloom-lanes`,children:[0,1,2,3].map(e=>u(`span`,{className:J.lane,"data-running-part":`bloom-lane`,children:u(Gn,{anchorClassName:J.markerAnchor,bodyClassName:J.markerBody,delay:[void 0,`-0.8s`,`-1.7s`,`-2.4s`][e],anchorPart:`bloom-marker-anchor`,bodyPart:`bloom-marker`})},e))})]})}function qn(e){return[`telemetry-bloom`,`release-transit`,`status-weather`,`falling-shapes`,`snowman`,`flight-path`].includes(e)}function Jn({animation:e,progress:t,estimatedDurationMs:n,overdue:r,indeterminate:i,seed:a}){let o={"--running-progress":`${t*100}%`};return d(`div`,{className:`${Qt.field} ${r?Qt.overdue:``}`,"data-animation":e,"data-running-field":!0,"data-overdue":r||void 0,"data-indeterminate":i||void 0,"aria-hidden":`true`,style:o,children:[e===`telemetry-bloom`&&u(Kn,{}),e===`release-transit`&&u(Zt,{}),e===`status-weather`&&u(Un,{}),e===`falling-shapes`&&u(Bt,{progress:t,estimatedDurationMs:n,overdue:r,seed:a}),e===`snowman`&&u(Hn,{progress:t,estimatedDurationMs:n,overdue:r,seed:a}),e===`flight-path`&&u(Xt,{progress:t,indeterminate:i})]})}var Yn=20;function Xn(e,t){let n=Zn(!!e),r=e?new Date(e).valueOf():NaN,i=Number.isFinite(r)?Math.max(0,n-r):void 0,a=i!==void 0&&t!==void 0;return{elapsedMs:i,estimatedDurationMs:t,hasEstimate:a,overdue:a&&i>t,progress:a?Math.min(i/t,1):0}}function Zn(e){let[t,n]=o(()=>Date.now());return r(()=>{if(!e)return;n(Date.now());let t=window.setInterval(()=>n(Date.now()),Yn);return()=>window.clearInterval(t)},[e]),t}function Qn(e,t,n){return`${e===void 0?`Run in progress`:`Elapsed ${er(e)}`} · ${t===void 0?`Expected duration unavailable`:`Expected ≈ ${er(t)}`}${n?` · Over estimate`:``}`}function $n(e,t,n){let r=e===void 0?`—`:tr(e),i=t===void 0?`?`:`~${tr(t)}`;return`${n?`⚠`:`\xA0`}${r}/${i}`}function er(e){let t=Math.floor(e/1e3),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60;return n>0?`${n}h ${r}m`:r>0?`${r}m ${i}s`:`${i}s`}function tr(e){let t=Math.floor(e/1e3),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60,a=`${r}:${String(i).padStart(2,`0`)}`;return n>0?`${n}:${a.padStart(5,`0`)}`:a}function nr({elapsedMs:e,estimatedDurationMs:t,overdue:n}){return d(`p`,{className:`${Qt.timing} ${n?Qt.timingOverdue:``}`,children:[u(`span`,{className:`screen-reader-only`,children:Qn(e,t,n)}),u(`span`,{"aria-hidden":`true`,children:$n(e,t,n)})]})}var Y={progress:`_progress_1ti2m_1`,visual:`_visual_1ti2m_8`,timing:`_timing_1ti2m_12`,overdue:`_overdue_1ti2m_17`,readout:`_readout_1ti2m_23`,radial:`_radial_1ti2m_31`,sweep:`_sweep_1ti2m_1`,"alarm-ring":`_alarm-ring_1ti2m_1`,radialCore:`_radialCore_1ti2m_58`,"reactor-breathe":`_reactor-breathe_1ti2m_1`,runway:`_runway_1ti2m_70`,"barrier-pulse":`_barrier-pulse_1ti2m_1`,spark:`_spark_1ti2m_114`,sparkTwo:`_sparkTwo_1ti2m_128`,orbit:`_orbit_1ti2m_135`,orbitCore:`_orbitCore_1ti2m_151`,particle:`_particle_1ti2m_163`,particleTwo:`_particleTwo_1ti2m_174`,"gravity-well":`_gravity-well_1ti2m_1`,indeterminate:`_indeterminate_1ti2m_191`,shift:`_shift_1ti2m_1`,signalField:`_signalField_1ti2m_199`,rail:`_rail_1ti2m_217`,lead:`_lead_1ti2m_223`,pulse:`_pulse_1ti2m_233`,pulseTwo:`_pulseTwo_1ti2m_244`,tracks:`_tracks_1ti2m_247`,sparkWide:`_sparkWide_1ti2m_1`,track:`_track_1ti2m_247`,markerAnchor:`_markerAnchor_1ti2m_382`,markerBody:`_markerBody_1ti2m_386`,"endpoint-pulse":`_endpoint-pulse_1ti2m_1`,short:`_short_1ti2m_424`};function rr({animation:e,timing:t}){let{elapsedMs:n,estimatedDurationMs:r,hasEstimate:i,overdue:a,progress:o}=t,s=e===`runway`||e===`signal-field`,c=Qn(n,r,a),f={"--running-progress":`${o*100}%`,"--running-degrees":`${o*360}deg`},p=e===`signal-field`?Y.signalField:Y[e];return d(`div`,{className:`${Y.progress} ${p} ${a?Y.overdue:``} ${i?``:Y.indeterminate}`,style:f,"data-running-progress":e,"data-overdue":a||void 0,"data-indeterminate":!i||void 0,children:[d(`div`,{className:Y.visual,"aria-hidden":`true`,"data-running-visual":!0,children:[e===`radial`&&u(`span`,{className:Y.radialCore}),e===`runway`&&d(l,{children:[u(`span`,{className:Y.spark,"data-running-part":`runway-spark`}),u(`span`,{className:`${Y.spark} ${Y.sparkTwo}`,"data-running-part":`runway-spark-two`})]}),e===`orbit`&&d(l,{children:[u(`span`,{className:Y.orbitCore}),u(`span`,{className:Y.particle}),u(`span`,{className:`${Y.particle} ${Y.particleTwo}`})]}),e===`signal-field`&&d(l,{children:[u(`span`,{className:Y.rail}),u(`span`,{className:Y.lead}),u(`span`,{className:Y.pulse}),u(`span`,{className:`${Y.pulse} ${Y.pulseTwo}`}),u(`span`,{className:Y.tracks,"data-running-part":`signal-tracks`,children:[0,1,2,3,4].map(e=>u(`span`,{className:Y.track,"data-running-part":`signal-track`,children:u(Gn,{anchorClassName:Y.markerAnchor,bodyClassName:Y.markerBody,delay:[void 0,`-0.8s`,`-1.7s`,`-2.4s`,`-0.35s`][e],anchorPart:`signal-marker-anchor`,bodyPart:`signal-marker`})},e))})]})]}),u(`p`,{className:`${Y.timing} ${s?Y.readout:``}`,children:s?d(l,{children:[u(`span`,{className:`screen-reader-only`,children:c}),u(`span`,{"aria-hidden":`true`,children:$n(n,r,a)})]}):c})]})}function ir(e){return[`radial`,`runway`,`orbit`,`signal-field`].includes(e)}function ar(e){return Array.from(e).reduce((e,t)=>e*31+t.charCodeAt(0)>>>0,7)}var or=2e4,sr=15e3,cr=3e5,lr=1.25,ur=[`radial`,`runway`,`orbit`,`signal-field`,`telemetry-bloom`,`release-transit`,`status-weather`,`falling-shapes`,`snowman`,`flight-path`];function dr({panel:e}){let t=mr(),n=e.running_animation===void 0||e.running_animation===`off`?void 0:e.running_animation,r=fr(e.demo_run_duration,or),i=fr(e.demo_review_duration,cr),a=n?Math.ceil(i*lr):r,o=Math.floor(t/a),s=n??ur[o%ur.length]??`radial`,c=o*a;return u(pr,{panel:e,animation:s,runStartedAt:c,estimatedDurationMs:n?i:sr})}function fr(e,t){return e?S(e)??t:t}function pr({panel:e,animation:t,runStartedAt:n,estimatedDurationMs:r}){let i=Xn(new Date(n).toISOString(),r),a=qn(t);return u(F,{panel:e,field:a?u(Jn,{animation:t,progress:i.progress,estimatedDurationMs:i.estimatedDurationMs,overdue:i.overdue,indeterminate:!i.hasEstimate,seed:ar(e.id)},`${t}-${n}`):void 0,children:d(N,{children:[u(P,{status:`running`,glyph:`↻`,label:`Running`}),d(`p`,{className:_t.variant,children:[u(`span`,{className:_t.variantPrefix,children:`Demo treatment · `}),t]}),a?u(nr,{elapsedMs:i.elapsedMs,estimatedDurationMs:r,overdue:i.overdue}):u(rr,{animation:t,timing:i})]})})}function mr(){let[e,t]=o(()=>Date.now());return r(()=>{let e=window.setInterval(()=>t(Date.now()),1e3);return()=>window.clearInterval(e)},[]),e}var X={details:`_details_19avj_1`,activity:`_activity_19avj_7`,duration:`_duration_19avj_8`};function hr(e,t=`Passed`){let n=at[e];return e===`passed`?{...n,label:t}:n}function gr(e){return e?e.parent?`${e.parent} › ${e.name}`:e.name:`Activity unavailable`}function _r({panel:e,envelope:t,attentionActive:n,updateHealth:r,rejectedPipeline:i}){if(!t&&i)return u(vr,{panel:e,rejected:i});if(!t)return u(F,{panel:e,attentionActive:n,children:u(N,{children:u(j,{children:`Loading…`})})});if(t.state===`error`){let r=k(t.error.kind);return d(F,{panel:e,envelope:t,attentionActive:n,error:!0,layout:`status-band`,children:[u(`div`,{"data-panel-anchor":`status`,children:u(P,{glyph:`⚠`,label:r.label,emphasis:r.emphasis})}),u(N,{anchor:`evidence`,children:u(j,{children:t.error.message})})]})}let a=C.safeParse(t.signal);return a.success?u(yr,{panel:e,envelope:t,signal:a.data,updateHealth:r,attentionActive:n}):d(F,{panel:e,envelope:t,attentionActive:n,error:!0,layout:`status-band`,children:[u(`div`,{"data-panel-anchor":`status`,children:u(P,{glyph:`⚠`,label:`Invalid signal`})}),u(N,{anchor:`evidence`,children:u(j,{children:`The received pipeline status could not be read.`})})]})}function vr({panel:e,rejected:t}){let n=hr(t.status);return d(F,{panel:e,sourceLink:t.link,busy:!1,layout:`status-band`,children:[u(`div`,{"data-panel-anchor":`status`,children:u(P,{status:t.status,glyph:n.glyph,label:n.label})}),d(N,{className:X.details,anchor:`evidence`,children:[d(j,{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(ut,{value:t.sourceUpdatedAt})]})]})}function yr({panel:e,envelope:t,signal:n,updateHealth:r,attentionActive:i}){let s=hr(n.status),[c,l]=o(()=>n.status===`running`?br():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=>br(e))}let p=e.running_animation??c??`off`,m=n.status===`running`&&p!==`off`,h=Xn(n.runStartedAt,n.estimatedDurationMs),g=m&&qn(p),_=m&&ir(p);return d(F,{panel:e,envelope:t,attentionActive:i,layout:g||_?void 0:`status-band`,field:g?u(Jn,{animation:p,progress:h.progress,estimatedDurationMs:h.estimatedDurationMs,overdue:h.overdue,indeterminate:!h.hasEstimate,seed:ar(e.id)}):void 0,children:[u(`div`,{"data-panel-anchor":`status`,children:u(P,{status:n.status,glyph:s.glyph,label:s.label})}),d(N,{className:X.details,anchor:`evidence`,children:[n.status===`running`&&u(M,{glyph:`⚙`,label:`Activity`,value:gr(n.activity),compact:{kind:`glyph-only`},title:`Activity: ${gr(n.activity)}`,className:X.activity}),n.branch&&u(M,{glyph:`⎇`,label:`Branch`,value:u(`span`,{className:X.branch,children:n.branch}),compact:{kind:`short-value`,value:u(`span`,{className:X.branch,children:n.branch})},title:`Branch: ${n.branch}`}),g&&u(nr,{elapsedMs:h.elapsedMs,estimatedDurationMs:n.estimatedDurationMs,overdue:h.overdue}),_&&u(rr,{animation:p,timing:h}),n.status!==`running`&&n.durationMs!==void 0&&u(M,{glyph:`◷`,label:`Duration`,value:`Took ${xr(n.durationMs)}`,compact:{kind:`short-value`,value:xr(n.durationMs)},title:`Duration: Took ${xr(n.durationMs)}`,className:X.duration}),u(lt,{sourceUpdatedAt:n.sourceUpdatedAt,observedAt:t.observedAt,running:n.status===`running`,runStartedAt:n.runStartedAt}),r&&u(L,{health:r})]})]})}function br(e){let t=Ce.filter(t=>t!==e);return t[Math.floor(Math.random()*t.length)]??`telemetry-bloom`}function xr(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 Sr(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 Cr({panel:e,envelope:t,attentionActive:n,updateHealth:r}){if(!t)return u(F,{panel:e,attentionActive:n,children:u(N,{children:u(j,{children:`Loading…`})})});if(t.state===`error`){let r=k(t.error.kind);return d(F,{panel:e,envelope:t,attentionActive:n,error:!0,layout:`status-band`,children:[u(`div`,{"data-panel-anchor":`status`,children:u(P,{glyph:`⚠`,label:r.label,emphasis:r.emphasis})}),u(N,{anchor:`evidence`,children:u(j,{children:t.error.message})})]})}let i=ue.safeParse(t.signal);if(!i.success)return d(F,{panel:e,envelope:t,attentionActive:n,error:!0,layout:`status-band`,children:[u(`div`,{"data-panel-anchor":`status`,children:u(P,{glyph:`⚠`,label:`Invalid signal`})}),u(N,{anchor:`evidence`,children:u(j,{children:`The received pull-request health status could not be read.`})})]});let a=hr(i.data.status,`Healthy`),o=Sr(i.data);return d(F,{panel:e,envelope:t,attentionActive:n,layout:`status-band`,children:[u(`div`,{className:Z.statusAnchor,"data-panel-anchor":`status`,children:u(P,{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(j,{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(M,{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(M,{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(I,{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(L,{health:r})]}),i.data.incompleteObservations&&u(`div`,{role:`status`,children:d(j,{className:Z.incomplete,children:[`⚠ Incomplete observations:`,` `,i.data.incompleteObservations.map(({label:e,message:t})=>`${e}: ${t}`).join(` · `)]})})]})]})}function wr({panel:e,envelope:t,attentionActive:n,updateHealth:r}){if(!t)return u(F,{panel:e,attentionActive:n,children:u(N,{children:u(j,{children:`Loading…`})})});if(t.state===`error`){let r=k(t.error.kind);return u(F,{panel:e,envelope:t,attentionActive:n,error:!0,children:d(N,{children:[u(P,{glyph:`⚠`,label:r.label,emphasis:r.emphasis}),u(j,{children:t.error.message})]})})}let i=oe.safeParse(t.signal);if(!i.success)return u(F,{panel:e,envelope:t,attentionActive:n,error:!0,children:u(N,{children:u(P,{glyph:`⚠`,label:`Invalid test result`})})});let a=i.data;if(a.status===`pending`)return u(Tr,{panel:e,envelope:t,attentionActive:n,label:`Pending`,hint:`The selected workflow run is still in progress.`});if(a.status===`not-reported`)return u(Tr,{panel:e,envelope:t,attentionActive:n,label:`No test results published`,hint:`This completed workflow did not publish the configured test summary.`});let o=[[`passed`,a.passed],[`failed`,a.failed],[`skipped`,a.skipped]].filter(([,e])=>e!==void 0).map(([e,t])=>`${t} ${e}`).join(` · `);return u(F,{panel:e,envelope:t,attentionActive:n,children:d(N,{children:[u(P,{glyph:`✓`,label:`Test results reported`,compactOnly:!0}),d(st,{children:[a.total.toLocaleString(),` tests`]}),o&&u(M,{glyph:`≡`,label:`Outcomes`,value:o}),u(I,{value:t.observedAt}),r&&u(L,{health:r})]})})}function Tr({panel:e,envelope:t,attentionActive:n,label:r,hint:i}){return u(F,{panel:e,envelope:t,attentionActive:n,children:d(N,{children:[u(P,{glyph:`◌`,label:r}),u(j,{children:i}),u(I,{value:t.observedAt})]})})}var Er={"pipeline-status":_r,"pull-request-health":Cr,"http-value":pt,"test-count":wr,"pipeline-animation-demo":dr};function Dr({panel:e,envelope:t,attentionActive:n,updateHealth:r,rejectedPipeline:i,facts:a}){let o=Er[e.type];return o?u(o,{panel:e,envelope:t,attentionActive:n,updateHealth:r,rejectedPipeline:i,facts:a}):u(nt,{label:e.type,hint:`Not wired yet`,wide:!0})}var Or={control:`_control_giazw_1`,backdrop:`_backdrop_giazw_5`,dialog:`_dialog_giazw_15`};function kr({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 D(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=we.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:Or.control,type:`button`,"aria-expanded":n,"aria-controls":`security-details-dialog`,onClick:()=>void v(),children:`Security`}),n&&u(`div`,{className:Or.backdrop,role:`presentation`,children:d(`section`,{ref:h,className:Or.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(Ar,{details:f}),u(`button`,{ref:g,type:`button`,onClick:()=>i(!1),children:`Close`})]})})]})}function Ar({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 jr={notice:`_notice_1h5h0_1`,blocked:`_blocked_1h5h0_18`},Mr=`https://github.com/robertfmurdock/ze-great-dashboard/blob/main/docs/oidc-authentication.md`;function Nr({mode:e}){return e===`blocked`?d(`main`,{className:jr.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:Mr,children:`Read the authentication setup guide`}),`.`]})]}):d(`aside`,{className:jr.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:Mr,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`},Pr=6e5;function Fr({schedules:e,events:t,retention:n,now:r=new Date}){let i=r.valueOf(),a=i-Pr,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 Ir(e,t){return Math.max(0,Math.min(100,(Date.parse(e)-(t.valueOf()-Pr))/Pr*100))}function Lr(e,t){return`${e.label}, panel ${e.panelId}; ${Rr(e.cadence)} cadence; ${e.inFlight?`request in flight`:e.nextDueAt?zr(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 Rr(e){return e===`completion-window`?`Completion-window`:e===`running`?`Running`:`Normal`}function zr(e,t){let n=Date.parse(e)-t.valueOf();return n<0?`Overdue by ${Br(-n)}`:`Next poll in ${Br(n)}`}function Br(e){return e%6e4==0?`${Math.round(e/6e4)}m`:`${Math.max(1,Math.round(e/1e3))}s`}function Vr({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(()=>Fr({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":Lr(e,c),children:[e.observed.flatMap(({path:e,starts:t})=>t.map(t=>u(`i`,{className:$.observed,style:{left:`${Ir(t,c)}%`},title:`Observed request: ${e}`},`${e}-${t}`))),e.nextDueAt&&u(`i`,{className:$.expected,style:{left:`${Ir(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.`})]})]})]})}function Hr({env:e,diagnostics:t,auth:n}){let[i,a]=o(),[s,c]=o();return r(()=>{let r=!1;a(void 0),c(void 0);let i=`${e.proxyPath}/boards/${encodeURIComponent(e.board)}`;return t.record({kind:`board-fetch-start`,path:i}),D(e,i,void 0,globalThis.fetch,n).then(async e=>{if(t.record({kind:`board-fetch-response`,path:i,status:e.status,cache:Ue(e.headers)}),!e.ok)throw Error(`Board configuration returned ${e.status}`);try{return await e.json()}catch(e){throw t.record({kind:`board-fetch-parse-failure`,path:i,message:Ur(e)}),new Wr(e)}}).then(n=>{if(r)return;a(n),c(e.board);let o=Array.isArray(n.panels)?n.panels:[];t.record({kind:`board-fetch-response`,path:i,boardSummary:{panelCount:o.length,panelIds:o.flatMap(e=>typeof e.id==`string`?[e.id]:[])}})}).catch(n=>{n instanceof Wr||t.record({kind:`board-fetch-failure`,path:i,message:Ur(n)}),r||(a({panels:[]}),c(e.board))}),()=>{r=!0}},[n,t,e]),{board:i,loadedBoardName:s}}function Ur(e){return e instanceof Error?e.message:String(e)}var Wr=class extends Error{constructor(e){super(Ur(e))}},Gr=6e4,Kr=1e4,qr=()=>globalThis.window.location.reload();function Jr({env:e,diagnostics:t,fetcher:n,reload:i=qr,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(),Kr);t.record({kind:`client-update-check`,path:c});try{let o=await D(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(),Gr)}};return l(),()=>{r=!0,s?.abort()}},[a,t,e,n,i])}function Yr(e,t){if(t.state===`error`)return{state:t.state,link:t.link};if(e.type===`pipeline-status`){let e=C.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=ue.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 Xr(e,t,n){if(!e)return!0;let r=Yr(t,e),i=Yr(t,n);return r.state!==i.state||r.status!==i.status||r.link!==i.link}function Zr(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 Qr(e,t){return JSON.stringify(e&&Zr(e))!==JSON.stringify(Zr(t))}var $r=`ze-great-dashboard.panel-memory.v1`,ei=1,ti=12096e5,ni=class{now;histories;storage;constructor(e=Ae(),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[ri(t)]=t);let i=r.latestCompleted;(!i||ii(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=si(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()-ti;for(let[n,r]of Object.entries(e.durations)){let i=ai(r.sourceUpdatedAt);(i===void 0||i<t)&&delete e.durations[n]}let n=e.latestCompleted?ai(e.latestCompleted.sourceUpdatedAt):void 0;e.latestCompleted&&(n===void 0||n<t)&&delete e.latestCompleted}read(){let e=je(this.storage,$r);return e?.schemaVersion!==ei||!e.histories?{}:ci(e.histories)?e.histories:{}}persist(){Me(this.storage,$r,{schemaVersion:ei,histories:this.histories})}};function ri(e){return e.sourceRunId??e.link??e.sourceUpdatedAt}function ii(e,t){let n=ai(e),r=ai(t);return n!==void 0&&(r===void 0||n>=r)}function ai(e){let t=Date.parse(e);return Number.isFinite(t)?t:void 0}function oi(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 si(e){return JSON.stringify([e.board,e.panelId,e.source,e.workflow,e.branch])}function ci(e){return di(e)?Object.values(e).every(li):!1}function li(e){return!di(e)||!di(e.durations)||!Object.values(e.durations).every(ui)?!1:e.latestCompleted===void 0||ui(e.latestCompleted)}function ui(e){return di(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`&&ai(e.sourceUpdatedAt)!==void 0:!1}function di(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}async function fi(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:Ue(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=ie.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:pi(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:mi(t)}),{error:mi(t)}}}function pi(e,t){let n=t.headers.get(`x-dashboard-request-id`);return{reason:e.error.message,...n?{supportReference:n}:{}}}function mi(e){return e instanceof Error?e.message:String(e)}function hi(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:vi(e.reconciliation.envelope.link)}}:{envelope:e.reconciliation.envelope}}function gi(e){let t=_i(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 _i(e){if(e.state!==`ok`)return;let t=C.safeParse(e.signal);return t.success?t.data:void 0}function vi(e){if(!e)return!1;try{return new URL(e).hostname===`github.com`}catch{return!1}}function yi(e){return e.panels.filter(e=>!w(e.position)&&(e.type===`pipeline-status`||e.type===`pull-request-health`||e.type===`http-value`))}function bi(e,t){return`${e.proxyPath}/panel/${encodeURIComponent(e.board)}/${encodeURIComponent(t)}`}function xi(e,t,n){let r=bi(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`,...Si(n).map(({workflow:e})=>`${r}/update-workflow/${encodeURIComponent(e)}`)]:[r];return{panelId:n.id,label:n.label??n.id,settings:Se(e,n),cadence:`normal`,inFlight:!1,knownPaths:i}}function Si(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 Ci(e,t,n){let r=wi(e);if(!r)return{delayMillis:n.refreshMillis,cadence:`normal`};let i=Ti(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 wi(e){if(e?.state!==`ok`)return;let t=C.safeParse(e.signal);return t.success&&t.data.status===`running`?t.data:void 0}function Ti(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 Ei(e){let t=[],n=e.workflows.map(({workflow:e,observation:n})=>{let r=Oi(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=ki(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:Di(e,n,[],t,Ai(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.`}),Di(e,n,r.pullRequests.map(n=>{let r=e.builds.get(n.branch),i=Oi(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,Ai([...e.workflows.map(({observation:e})=>e),e.candidates,...e.builds.values()]))}function Di(e,t,n,r,i){let a=ji([...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 Oi(e,t){if(e?.state!==`ok`)return;let n=(t===`pull-request-workflow`?pe:me).safeParse(e.signal);return n.success?{item:n.data.item}:void 0}function ki(e){if(e?.state!==`ok`)return;let t=fe.safeParse(e.signal);return t.success?t.data:void 0}function Ai(e){return e.flatMap(({envelope:e})=>e?.state===`ok`?[e.observedAt]:[])}function ji(e){return e.reduce((e,t)=>ce(t)>ce(e)?t:e,`passed`)}function Mi({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 ni,r(()=>{if(v.current={},y.current={},l({}),d({}),p({}),h([]),_({}),!e)return;let r=!1,i=new Set,a=new Set,o=yi(e),c=o.map(n=>xi(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=bi(t,e.id),x,ee,te=()=>{ee=new Date().toISOString(),r||d(t=>{if(!t[e.id])return t;let n={...t};return delete n[e.id],n})},S=t=>{let n=ee;if(r||!n)return;let i=Fi(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 fi({diagnostics:n,panelId:e.id,path:i,signal:u?.signal,cache:l,fetcher:(e,n)=>D(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];Qr(r,t)&&n.record({kind:`panel-rendered`,panelId:e.id,path:g,rendered:Zr(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=Si(e),u=new Map,d,p=async r=>{let i=await fi({diagnostics:n,panelId:e.id,path:r,signal:d?.signal,cache:u,fetcher:(e,n)=>D(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`&&Pi(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=Ei({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,te();let t=v.current[e.id];Xr(t,e,b)&&n.record({kind:`panel-rendered`,panelId:e.id,path:g,rendered:Yr(e,b)}),v.current={...v.current,[e.id]:b},l(v.current)}else r||S(`No usable pull-request observations.`);if(o=!1,a.delete(d),!r){let t=Ci(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 ne=()=>{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}),D(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:Ue(t.headers)};if(t.status===304)n.record(r),te();else try{let i=Li(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.`}),S(`Response was not a valid signal envelope.`);return}return n.record({...r,envelope:i,...i.state===`error`?{failure:Ni(i,t)}:{}}),te(),{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:Fi(t)}),new Ii(t)}}).then(i=>{if(!i)return;let a=i.envelope;if(e.type===`pipeline-status`){let o=oi(t.board,e),s=c.latest(o),l=gi({envelope:a,accepted:s,estimatedDurationMs:c.resolveEstimatedDuration(o)}),u=hi({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];Xr(t,e,a)&&n.record({kind:`panel-rendered`,panelId:e.id,path:g,rendered:Yr(e,a)}),v.current={...v.current,[e.id]:a},l(v.current)}}).catch(t=>{S(t),t instanceof Ii||n.record({kind:`panel-fetch-failure`,panelId:e.id,path:g,message:Fi(t)})}).finally(()=>{if(o=!1,!r){let t=Ci(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),ne()},t.delayMillis);i.add(r)}}))};ne()}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 Ni(e,t){let n=t.headers.get(`x-dashboard-request-id`);return{reason:e.error.message,...n?{supportReference:n}:{}}}function Pi(e){return typeof e==`object`&&!!e&&e.type===`pull-request-candidates`&&Array.isArray(e.pullRequests)}function Fi(e){return e instanceof Error?e.message:String(e)}var Ii=class extends Error{constructor(e){super(Fi(e))}};function Li(e){let t=ie.safeParse(e);return t.success?t.data:void 0}function Ri({env:e}){return e.security===`blocked`?u(Nr,{mode:`blocked`}):e.auth?u(et,{env:e,auth:e.auth,children:(t,n)=>u(zi,{env:e,accessToken:t,onDenied:n})}):u(zi,{env:e})}function zi({env:e,accessToken:t,onDenied:n}){let o=a(null);o.current||=new Ve(e);let s=o.current,c=i(()=>t?{accessToken:t,onAuthenticationFailure:e=>e===403&&n?.()}:void 0,[t,n]);Jr({env:e,diagnostics:s,auth:c});let{board:l,loadedBoardName:f}=Hr({env:e,diagnostics:s,auth:c}),{signals:p,updateHealth:m,factSignals:h,schedules:g,rejectedPipelines:_}=Mi({board:f===e.board?l:void 0,env:e,diagnostics:s,auth:c}),v=i(()=>l?ve(l.panels):void 0,[l]),y=i(()=>Te({board:l,signals:p,updateHealth:m,factSignals:h}),[l,h,p,m]),b=y.length?l?.attention?.treatment:void 0,x=new Set(y.map(e=>e.panelId));return r(()=>{v&&v.issues.length!==0&&s.record({kind:`layout-analyzed`,issueCount:v.issues.length,affectedPanelIds:v.issues.map(e=>e.panelId)})},[s,v]),d(`div`,{className:`${T.board} ${b?T[`attention-${b}`]:``}`,"data-attention-treatment":b,"data-attention-active":y.length||void 0,children:[d(`header`,{className:T.header,children:[u(`h1`,{className:T.title,children:e.board}),e.security===`warning`&&u(Nr,{mode:`warning`}),y.length>0&&d(`aside`,{className:T.attentionRail,role:`alert`,"aria-label":`Important panel attention`,children:[u(`span`,{className:T.attentionGlyph,"aria-hidden":`true`,children:`⚠`}),u(`ul`,{children:y.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:T.grid,children:[!l&&u(nt,{label:`board`,hint:`Loading configuration…`,wide:!0}),l?.panels.filter(e=>!w(e.position)).map(e=>u(Dr,{panel:e,envelope:p[e.id],attentionActive:x.has(e.id),updateHealth:m[e.id],rejectedPipeline:_[e.id],facts:h[e.id]},e.id))]}),d(`footer`,{className:T.footer,"data-board-footer":!0,children:[u(`span`,{children:`Signals are read live from their configured authorities.`}),d(`div`,{className:T.footerTools,children:[c&&u(kr,{env:e,auth:c}),v&&v.issues.length>0&&u(Je,{board:e.board,layout:v,env:e,auth:c}),u(Oe,{log:s,updateActivity:()=>{let e=s.retainedEvidence(),t=Fr({schedules:g,...e});return{capturedAt:t.capturedAt,window:t.window,schedules:t.schedules}}}),u(Vr,{board:l,schedules:g,log:s})]})]})]})}var Bi={error:`_error_yx1g9_1`};function Vi({message:e}){return d(`div`,{className:Bi.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 Hi=document.getElementById(`root`);if(!Hi)throw Error(`No #root element in the document — the template is not the one we expect.`);var Ui=c(Hi);try{Ui.render(u(t,{children:u(Ri,{env:x()})}))}catch(e){Ui.render(u(Vi,{message:e instanceof Error?e.message:String(e)}))}
|
|
3
|
+
//# sourceMappingURL=index-CWEcBTFd.js.map
|