@continuous-excellence/ze-great-dashboard-aws 0.13.7 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,7 +1,17 @@
1
1
  # Ze Great Dashboard on AWS
2
2
 
3
- `@continuous-excellence/ze-great-dashboard-aws` packages a board as a private AWS Lambda. It
4
- includes the Lambda runtime, matching browser client, deployment CLI, and CloudFormation templates.
3
+ `@continuous-excellence/ze-great-dashboard-aws` packages a board for a private AWS Lambda or ECS
4
+ deployment. It includes the Lambda runtime, matching browser client, deployment CLI, and
5
+ CloudFormation templates.
6
+
7
+ Deployment mode is persisted in `dashboard-bootstrap.json` and generated application parameters
8
+ as `ComputeMode`. Existing files without that field mean `lambda`. Choose `--mode ecs` during
9
+ bootstrap initialization; routine packaging and diagnostics then select the matching template.
10
+ An explicit mode fails if it disagrees with persisted configuration, so changing mode requires
11
+ regenerating the reviewed bootstrap and parameter artifacts.
12
+
13
+ Consumer ECS deployments use the long-lived service template and provide their own subnets and
14
+ security groups.
5
15
 
6
16
  This deployment path is intended for teams that already operate AWS and have a protected gateway
7
17
  such as API Gateway or an ALB. It deliberately does not create a public endpoint, choose an
@@ -0,0 +1,86 @@
1
+ AWSTemplateFormatVersion: '2010-09-09'
2
+ Description: Ze Great Dashboard ECS bootstrap core v1. Administrator-managed; do not grant this authority to CI.
3
+
4
+ Parameters:
5
+ ComputeMode: { Type: String, Default: ecs, AllowedValues: [ecs] }
6
+ ArtifactBucketName: { Type: String, Description: Compatibility artifact bucket; ECS packages use the published image }
7
+ ApplicationStackName: { Type: String }
8
+ DashboardFunctionName: { Type: String, Description: Compatibility name retained by the bootstrap manifest }
9
+ RuntimeSecretArn: { Type: String, Default: '' }
10
+ ArtifactKmsKeyArn: { Type: String, Default: '' }
11
+
12
+ Conditions:
13
+ HasRuntimeSecret: !Not [!Equals [!Ref RuntimeSecretArn, '']]
14
+
15
+ Resources:
16
+ ArtifactBucket:
17
+ Type: AWS::S3::Bucket
18
+ DeletionPolicy: Retain
19
+ UpdateReplacePolicy: Retain
20
+ Properties:
21
+ BucketName: !Ref ArtifactBucketName
22
+ OwnershipControls: { Rules: [{ ObjectOwnership: BucketOwnerEnforced }] }
23
+ PublicAccessBlockConfiguration: { BlockPublicAcls: true, BlockPublicPolicy: true, IgnorePublicAcls: true, RestrictPublicBuckets: true }
24
+ CloudFormationExecutionRole:
25
+ Type: AWS::IAM::Role
26
+ DeletionPolicy: Retain
27
+ UpdateReplacePolicy: Retain
28
+ Properties:
29
+ RoleName: !Sub '${ApplicationStackName}-execution'
30
+ AssumeRolePolicyDocument:
31
+ Version: '2012-10-17'
32
+ Statement: [{ Effect: Allow, Principal: { Service: cloudformation.amazonaws.com }, Action: sts:AssumeRole }]
33
+ Policies:
34
+ - PolicyName: DashboardEcsApplicationResources
35
+ PolicyDocument:
36
+ Version: '2012-10-17'
37
+ Statement:
38
+ - Sid: DashboardEcs
39
+ Effect: Allow
40
+ Action: [ecs:CreateCluster, ecs:DescribeClusters, ecs:UpdateCluster, ecs:DeleteCluster, ecs:CreateService, ecs:DescribeServices, ecs:UpdateService, ecs:DeleteService, ecs:RegisterTaskDefinition, ecs:DeregisterTaskDefinition, ecs:DescribeTaskDefinition, ecs:TagResource, ecs:UntagResource]
41
+ Resource: '*'
42
+ - Sid: DashboardEcsLogs
43
+ Effect: Allow
44
+ Action: [logs:CreateLogGroup, logs:DeleteLogGroup, logs:DescribeLogGroups, logs:PutRetentionPolicy, logs:TagResource, logs:UntagResource]
45
+ Resource: !Sub 'arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/ecs/${ApplicationStackName}:*'
46
+ - Sid: ManageEcsRuntimeRoles
47
+ Effect: Allow
48
+ Action: [iam:CreateRole, iam:GetRole, iam:DeleteRole, iam:UpdateAssumeRolePolicy, iam:PutRolePolicy, iam:GetRolePolicy, iam:DeleteRolePolicy, iam:TagRole, iam:UntagRole]
49
+ Resource: !Sub 'arn:${AWS::Partition}:iam::${AWS::AccountId}:role/${ApplicationStackName}-*'
50
+ - Sid: PassRuntimeRolesToEcsOnly
51
+ Effect: Allow
52
+ Action: iam:PassRole
53
+ Resource: !Sub 'arn:${AWS::Partition}:iam::${AWS::AccountId}:role/${ApplicationStackName}-*'
54
+ Condition: { StringEquals: { 'iam:PassedToService': ecs-tasks.amazonaws.com } }
55
+ - !If
56
+ - HasRuntimeSecret
57
+ - Sid: ReadConfiguredRuntimeCredentials
58
+ Effect: Allow
59
+ Action: [secretsmanager:DescribeSecret, secretsmanager:GetSecretValue]
60
+ Resource: !Ref RuntimeSecretArn
61
+ - !Ref AWS::NoValue
62
+ - !If
63
+ - HasRuntimeSecret
64
+ - Sid: ReadConfiguredRuntimeParameter
65
+ Effect: Allow
66
+ Action: ssm:GetParameter
67
+ Resource: !Ref RuntimeSecretArn
68
+ - !Ref AWS::NoValue
69
+ - !If
70
+ - HasRuntimeSecret
71
+ - Sid: DecryptConfiguredRuntimeParameter
72
+ Effect: Allow
73
+ Action: kms:Decrypt
74
+ Resource: '*'
75
+ Condition:
76
+ StringEquals:
77
+ 'kms:ViaService': !Sub 'ssm.${AWS::Region}.amazonaws.com'
78
+ 'kms:EncryptionContext:PARAMETER_ARN': !Ref RuntimeSecretArn
79
+ - !Ref AWS::NoValue
80
+ Outputs:
81
+ BootstrapContractVersion: { Value: '1' }
82
+ BootstrapTemplateRevision: { Value: '1.0-ecs' }
83
+ ArtifactBucketName: { Value: !Ref ArtifactBucket }
84
+ ArtifactBucketArn: { Value: !GetAtt ArtifactBucket.Arn }
85
+ CloudFormationExecutionRoleArn: { Value: !GetAtt CloudFormationExecutionRole.Arn }
86
+ ApplicationStackName: { Value: !Ref ApplicationStackName }
@@ -2,6 +2,11 @@ AWSTemplateFormatVersion: '2010-09-09'
2
2
  Description: Ze Great Dashboard bootstrap core v1. Administrator-managed; do not grant this authority to CI.
3
3
 
4
4
  Parameters:
5
+ ComputeMode:
6
+ Type: String
7
+ Default: lambda
8
+ AllowedValues: [lambda]
9
+ Description: Persistent application compute mode for this bootstrap
5
10
  ArtifactBucketName:
6
11
  Type: String
7
12
  Description: Globally unique bucket for private Lambda artifacts
@@ -123,7 +128,7 @@ Resources:
123
128
 
124
129
  Outputs:
125
130
  BootstrapContractVersion: { Value: '1' }
126
- BootstrapTemplateRevision: { Value: '1.2' }
131
+ BootstrapTemplateRevision: { Value: '1.3' }
127
132
  ArtifactBucketName: { Value: !Ref ArtifactBucket }
128
133
  ArtifactBucketArn: { Value: !GetAtt ArtifactBucket.Arn }
129
134
  CloudFormationExecutionRoleArn: { Value: !GetAtt CloudFormationExecutionRole.Arn }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "mode": "lambda",
2
3
  "region": "us-east-1",
3
4
  "core": {
4
5
  "stackName": "team-dashboard-bootstrap",
@@ -0,0 +1,39 @@
1
+ AWSTemplateFormatVersion: '2010-09-09'
2
+ Description: Ze Great Dashboard GitHub OIDC adapter for ECS deployments.
3
+ Parameters:
4
+ ComputeMode: { Type: String, Default: ecs, AllowedValues: [ecs] }
5
+ GitHubOidcProviderArn: { Type: String }
6
+ GitHubRepository: { Type: String }
7
+ GitHubOwnerId: { Type: String }
8
+ GitHubRepositoryId: { Type: String }
9
+ GitHubEnvironment: { Type: String }
10
+ CoreBootstrapStackName: { Type: String }
11
+ ApplicationStackName: { Type: String }
12
+ ArtifactBucketName: { Type: String }
13
+ CloudFormationExecutionRoleArn: { Type: String }
14
+ Resources:
15
+ GitHubDeployRole:
16
+ Type: AWS::IAM::Role
17
+ Properties:
18
+ RoleName: !Sub '${ApplicationStackName}-github-deploy'
19
+ AssumeRolePolicyDocument:
20
+ Version: '2012-10-17'
21
+ Statement: [{ Effect: Allow, Principal: { Federated: !Ref GitHubOidcProviderArn }, Action: sts:AssumeRoleWithWebIdentity }]
22
+ Policies:
23
+ - PolicyName: DeployOneEcsApplication
24
+ PolicyDocument:
25
+ Version: '2012-10-17'
26
+ Statement:
27
+ - Sid: OperateOneApplicationStack
28
+ Effect: Allow
29
+ Action: [cloudformation:CreateChangeSet, cloudformation:DescribeChangeSet, cloudformation:ExecuteChangeSet, cloudformation:DeleteChangeSet, cloudformation:DescribeStacks, cloudformation:GetTemplate, cloudformation:GetTemplateSummary]
30
+ Resource: !Sub 'arn:${AWS::Partition}:cloudformation:${AWS::Region}:${AWS::AccountId}:stack/${ApplicationStackName}/*'
31
+ - Sid: PassCoreExecutionRole
32
+ Effect: Allow
33
+ Action: iam:PassRole
34
+ Resource: !Ref CloudFormationExecutionRoleArn
35
+ Condition: { StringEquals: { 'iam:PassedToService': cloudformation.amazonaws.com } }
36
+ Outputs:
37
+ BootstrapContractVersion: { Value: '1' }
38
+ BootstrapTemplateRevision: { Value: '1.0-ecs' }
39
+ GitHubDeployRoleArn: { Value: !GetAtt GitHubDeployRole.Arn }
@@ -2,6 +2,11 @@ AWSTemplateFormatVersion: '2010-09-09'
2
2
  Description: Ze Great Dashboard GitHub OIDC adapter v2. Administrator-managed; requires a central OIDC provider.
3
3
 
4
4
  Parameters:
5
+ ComputeMode:
6
+ Type: String
7
+ Default: lambda
8
+ AllowedValues: [lambda]
9
+ Description: Persistent application compute mode for this bootstrap
5
10
  GitHubOidcProviderArn: { Type: String }
6
11
  GitHubRepository: { Type: String, Description: owner/repository }
7
12
  GitHubOwnerId: { Type: String, Description: Immutable numeric GitHub owner id }
@@ -97,5 +102,5 @@ Resources:
97
102
 
98
103
  Outputs:
99
104
  BootstrapContractVersion: { Value: '2' }
100
- BootstrapTemplateRevision: { Value: '2.2' }
105
+ BootstrapTemplateRevision: { Value: '2.3' }
101
106
  GitHubDeployRoleArn: { Value: !GetAtt GitHubDeployRole.Arn }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "index.html": {
3
- "file": "assets/index-DEohlAIs.js",
3
+ "file": "assets/index-zOEGeAGM.js",
4
4
  "name": "index",
5
5
  "src": "index.html",
6
6
  "isEntry": true,
@@ -0,0 +1,3 @@
1
+ import{z as e}from"zod";import{StrictMode as t,useEffect as n,useMemo as r,useRef as i,useState as a,useSyncExternalStore as o}from"react";import{createRoot as s}from"react-dom/client";import{Fragment as c,jsx as l,jsxs as u}from"react/jsx-runtime";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var d=/^(\d+)(ms|s|m|h)$/,f={ms:1,s:1e3,m:6e4,h:36e5};function p(e){let t=d.exec(e);if(!t)return null;let[,n,r]=t;if(n===void 0||r===void 0)return null;let i=Number(n);return i<=0?null:i*f[r]}var m=e.string().refine(e=>p(e)!==null,{message:`must be a positive duration like "30s", "5m", or "1h"`}).brand(),h=e.union([e.object({x:e.number().int().min(0),y:e.number().int().min(0),w:e.number().int().min(1).max(12),h:e.number().int().min(1)}),e.object({x:e.literal(0),y:e.literal(0),w:e.literal(0),h:e.literal(0)})]),ee=e.string().min(1),g=[`radial`,`runway`,`orbit`,`signal-field`,`telemetry-bloom`,`release-transit`,`status-weather`,`falling-shapes`],_=e.enum([...g,`off`]),te=e.looseObject({label:e.string().min(1).optional(),id:e.string().min(1),type:e.string().min(1),source:e.string().min(1).optional(),display:ee.optional(),position:h.optional(),refresh:m.optional(),running_refresh:m.optional(),running_completion_refresh:m.optional(),running_completion_window:m.optional(),running_animation:_.optional(),demo_run_duration:m.optional(),demo_review_duration:m.optional(),link:e.url().optional(),url:e.url().optional(),json_path:e.string().regex(/^\$(?:\.[A-Za-z_][A-Za-z0-9_]*|\[\d+\])*$/,`must be a simple JSON path`).optional()}),v=e.looseObject({type:e.string().min(1),token_env:e.string().min(1).optional()}),y=e.object({refresh:m.optional(),running_refresh:m.optional(),running_completion_refresh:m.optional(),running_completion_window:m.optional(),panels:e.array(te).min(1).superRefine((e,t)=>{let n=new Map;e.forEach((e,r)=>{let i=n.get(e.id);if(i===void 0){n.set(e.id,r);return}t.addIssue({code:`custom`,path:[r,`id`],message:`duplicate panel id "${e.id}" (already used by panel at index ${i})`})})})}),b=e.object({issuer:e.url(),client_id:e.string().min(1).optional(),allow:e.object({groups:e.array(e.string().min(1)).optional(),subjects:e.array(e.string().min(1)).optional()}).optional()});e.object({sources:e.record(e.string().min(1),v).default({}),boards:e.record(e.string().min(1),y),auth:b.optional()});var x=e.object({assetPath:e.string().min(1),proxyPath:e.string().min(1),board:e.string().min(1),clientVersion:e.string().min(1),auth:e.object({issuer:e.string().min(1),clientId:e.string().min(1).optional()}).optional()}),S=x.pick({assetPath:!0,clientVersion:!0});function C(t=globalThis.window?.env){let n=x.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 w=e.enum([`unreachable`,`unauthorized`,`not-found`,`no-runs`,`upstream-error`]),T=e.object({kind:w,message:e.string()}),ne=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:T})]),E=e.object({type:e.literal(`pipeline-status`),status:e.enum([`passed`,`failed`,`running`,`cancelled`,`unknown`]),rawStatus:e.string(),name:e.string().min(1),branch:e.string().min(1).optional(),durationMs:e.number().int().nonnegative().optional(),runStartedAt:e.iso.datetime().optional(),estimatedDurationMs:e.number().int().positive().optional(),sourceUpdatedAt:e.iso.datetime().optional()}),re=e.object({label:e.string().min(1),status:E.shape.status,detail:e.string().min(1),link:e.url().nullable()}),ie=e.object({type:e.literal(`pull-request-health`),status:E.shape.status,summary:e.string().min(1),workflows:e.array(re),pullRequests:e.array(re)}),ae=e.object({type:e.literal(`http-value`),value:e.union([e.string(),e.number(),e.boolean()])}),oe=12,se=12;function ce(e){let t=e.flatMap(e=>!e.position||D(e.position)||le(e.position)?[]:[{panelId:e.id,kind:`out-of-bounds`,position:e.position,conflictsWith:[]}]),n=new Map;for(let r=0;r<e.length;r++){let i=e[r];if(!(!i?.position||D(i.position)))for(let a=r+1;a<e.length;a++){let r=e[a];if(!r?.position||D(r.position)||!ue(i.position,r.position))continue;let o=`${r.id}\0overlap`,s=n.get(o);if(s)s.conflictsWith.push(i.id);else{let e={panelId:r.id,kind:`overlap`,position:r.position,conflictsWith:[i.id]};n.set(o,e),t.push(e)}}}return{issues:t}}function D(e){return e?.x===0&&e.y===0&&e.w===0&&e.h===0}function le(e){return!D(e)&&e.x+e.w<=oe&&e.y+e.h<=se}function ue(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 O={refreshMillis:6e4,runningRefreshMillis:15e3,runningCompletionRefreshMillis:5e3,runningCompletionWindowMillis:12e4};function de(e,t){let n=(e,t)=>p(e??``)??t,r=(r,i,a)=>n(t[r],n(e[i],a));return{refreshMillis:r(`refresh`,`refresh`,O.refreshMillis),runningRefreshMillis:r(`running_refresh`,`running_refresh`,O.runningRefreshMillis),runningCompletionRefreshMillis:r(`running_completion_refresh`,`running_completion_refresh`,O.runningCompletionRefreshMillis),runningCompletionWindowMillis:r(`running_completion_window`,`running_completion_window`,O.runningCompletionWindowMillis)}}var k={board:`_board_1s6f5_1`,header:`_header_1s6f5_11`,title:`_title_1s6f5_18`,grid:`_grid_1s6f5_24`,footerTools:`_footerTools_1s6f5_34`,layoutWarning:`_layoutWarning_1s6f5_39`,layoutWarningButton:`_layoutWarningButton_1s6f5_42`,layoutWarningDialog:`_layoutWarningDialog_1s6f5_60`,layoutWarningHeading:`_layoutWarningHeading_1s6f5_73`,layoutWarningClose:`_layoutWarningClose_1s6f5_91`,layoutWarningDownloads:`_layoutWarningDownloads_1s6f5_99`,layoutWarningNote:`_layoutWarningNote_1s6f5_118`,footer:`_footer_1s6f5_34`},A={diagnostics:`_diagnostics_lseur_1`,button:`_button_lseur_5`,area:`_area_lseur_14`,warning:`_warning_lseur_31`,panels:`_panels_lseur_35`,actions:`_actions_lseur_43`};function fe({log:e}){let[t,n]=a(!1);o(e.subscribe,e.snapshot,e.snapshot);let r=e.count(),i=e.summary();return u(`section`,{className:A.diagnostics,children:[u(`button`,{className:A.button,type:`button`,"aria-expanded":t,onClick:()=>n(!t),children:[`Diagnostics (`,r,`)`]}),t&&u(`div`,{className:A.area,children:[u(`p`,{children:[`Client `,e.clientVersion(),` · assets `,e.assetPath()]}),u(`p`,{children:[i.retained.eventCount,` retained browser-local events across`,` `,i.retained.sessionCount,` session`,i.retained.sessionCount===1?``:`s`,i.retained.firstEventAt&&i.retained.lastEventAt?` (${pe(i.retained.firstEventAt,i.retained.lastEventAt)})`:``,`. They are never uploaded.`]}),i.retained.evidenceMayBeIncomplete&&u(`p`,{className:A.warning,role:`alert`,children:[`Earlier evidence was pruned: `,i.retained.retention.eventsPrunedByCount,` at the 2,000-event cap and `,i.retained.retention.eventsPrunedByAge,` by the 7-day age limit. “No failures” applies only to the retained window.`]}),u(`p`,{children:[`Update failures: `,i.failures.clientUpdate,`; board fetch failures:`,` `,i.failures.boardFetch,`.`]}),i.panels.length>0&&l(`div`,{className:A.panels,children:i.panels.map(e=>u(`p`,{children:[l(`strong`,{children:e.panelId}),` — `,e.requests,` requests`,Object.keys(e.httpStatuses).length?`; HTTP ${Object.entries(e.httpStatuses).map(([e,t])=>`${e}×${t}`).join(`, `)}`:``,`; parse/network failures `,e.parseFailures,`/`,e.networkFailures,`; visible changes `,e.visibleStateChanges,`; latest`,` `,e.latestRendered?`${e.latestRendered.state}${e.latestRendered.status?`/${e.latestRendered.status}`:``}`:`not rendered`,`.`]},e.panelId))}),u(`div`,{className:A.actions,children:[l(`button`,{className:A.button,type:`button`,onClick:()=>{let t=new Blob([JSON.stringify(e.export(),null,2)],{type:`application/json`}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=`dashboard-diagnostics-${new Date().toISOString().replaceAll(`:`,`-`)}.json`,r.click(),URL.revokeObjectURL(n)},children:`Download`}),l(`button`,{className:A.button,type:`button`,onClick:()=>{window.confirm(`Clear this browser’s retained dashboard diagnostics?`)&&e.clear()},children:`Clear`})]})]})]})}function pe(e,t){return e===t?e:`${e} to ${t}`}function me(e,t){let n=new Map,r=new Set,i=0,a=0;for(let t of e){if(r.add(t.sessionId),t.kind===`client-update-failure`&&i++,(t.kind===`board-fetch-failure`||t.kind===`board-fetch-parse-failure`)&&a++,!(`panelId`in t))continue;let e=n.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`&&t.status!==void 0){let n=String(t.status);e.httpStatuses[n]=(e.httpStatuses[n]??0)+1}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),n.set(t.panelId,e)}let o=e.map(e=>e.at).sort(),s=t.eventsPrunedByAge+t.eventsPrunedByCount;return{retained:{eventCount:e.length,firstEventAt:o[0],lastEventAt:o.at(-1),sessionCount:r.size,retention:t,evidenceMayBeIncomplete:s>0},failures:{clientUpdate:i,boardFetch:a},panels:[...n.values()].sort((e,t)=>e.panelId.localeCompare(t.panelId))}}var j=`ze-great-dashboard.diagnostics.v1`,he=2e3,ge=6048e5,_e=[`session-start`,`client-update-check`,`client-update-failure`,`client-update-detected`,`board-fetch-start`,`board-fetch-response`,`board-fetch-parse-failure`,`board-fetch-failure`,`layout-analyzed`,`panel-fetch-start`,`panel-fetch-response`,`panel-fetch-parse-failure`,`panel-fetch-failure`,`panel-rendered`],ve=class{env;storage;now;events=[];retention=N();revision=0;listeners=new Set;sessionId=crypto.randomUUID?.()??`${Date.now()}-${Math.random()}`;constructor(e,t=xe(),n=()=>new Date){this.env=e,this.storage=t,this.now=n,this.events=this.read(),this.record({kind:`session-start`})}record(e){let t=P([...this.events,{...e,schemaVersion:1,at:this.now().toISOString(),sessionId:this.sessionId,board:this.env.board}],this.now(),this.retention);this.events=t.events,this.retention=t.retention,this.persist(),this.revision++,this.notify()}count=()=>this.events.length;clientVersion=()=>this.env.clientVersion;assetPath=()=>this.env.assetPath;snapshot=()=>this.revision;summary=()=>me(this.events,this.retention);clear(){this.events=[],this.retention=N();try{this.storage?.removeItem(j)}catch{}this.revision++,this.notify()}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});export=()=>({schemaVersion:1,exportedAt:this.now().toISOString(),client:{version:this.env.clientVersion,assetPath:this.env.assetPath,board:this.env.board,sessionId:this.sessionId},events:this.events,summary:this.summary()});read(){try{let e=this.storage?.getItem(j);if(!e)return[];let t=JSON.parse(e);if(t.schemaVersion!==1||!Array.isArray(t.events)||!t.events.every(be))return this.storage?.removeItem(j),[];let n=P(t.events.map(e=>({...e,schemaVersion:1})),this.now(),ye(t.retention));return this.retention=n.retention,n.events}catch{try{this.storage?.removeItem(j)}catch{}return[]}}persist(){try{this.storage?.setItem(j,JSON.stringify({schemaVersion:1,events:this.events,retention:this.retention}))}catch{}}notify(){for(let e of this.listeners)e()}};function M(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 N(){return{eventsPrunedByAge:0,eventsPrunedByCount:0}}function ye(e){if(!e||typeof e!=`object`)return N();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 P(e,t,n){let r=t.valueOf()-ge,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-he);return{events:i.slice(-2e3),retention:{eventsPrunedByAge:n.eventsPrunedByAge+a,eventsPrunedByCount:n.eventsPrunedByCount+o}}}function be(e){if(!e||typeof e!=`object`)return!1;let t=e;return(t.schemaVersion===void 0||t.schemaVersion===1)&&typeof t.at==`string`&&Number.isFinite(new Date(t.at).valueOf())&&typeof t.sessionId==`string`&&typeof t.board==`string`&&_e.includes(t.kind)}function xe(){try{return window.localStorage}catch{return}}var F={panel:`_panel_188aj_1`,content:`_content_188aj_21`,error:`_error_188aj_35`,wide:`_wide_188aj_38`,primary:`_primary_188aj_41`,compact:`_compact_188aj_48`,label:`_label_188aj_58`,hint:`_hint_188aj_68`,branch:`_branch_188aj_73`,observed:`_observed_188aj_77`,stale:`_stale_188aj_82`,status:`_status_188aj_85`,passed:`_passed_188aj_93`,failed:`_failed_188aj_96`,running:`_running_188aj_99`,cancelled:`_cancelled_188aj_102`,unknown:`_unknown_188aj_103`,sourceAction:`_sourceAction_188aj_106`,shallow:`_shallow_188aj_136`};function Se({label:e,hint:t,wide:n=!1}){return u(`section`,{className:`${F.panel} ${n?F.wide:``}`,"data-panel":!0,"data-panel-id":`placeholder`,children:[l(`h2`,{className:F.label,children:e}),l(`p`,{className:F.hint,children:t})]})}var Ce={fact:`_fact_17pw7_1`};function we(e){let t=e.position;if(t)return{"--panel-column":`${t.x+1} / span ${t.w}`,"--panel-row":`${t.y+1} / span ${t.h}`}}function I({children:e}){return l(`p`,{className:F.hint,children:e})}function L({children:e,status:t}){return l(`p`,{className:`${F.status} ${t?F[t]:``}`,children:e})}function Te({children:e,title:t}){return l(`span`,{className:F.branch,title:t,children:e})}function Ee({children:e,stale:t=!1}){return l(`p`,{className:`${F.hint} ${F.observed} ${t?F.stale:``}`,children:e})}function R({panel:e,envelope:t,error:n=!1,field:r,children:i}){let a=e.display===`primary`||e.display===`compact`?e.display:`supporting`,o=e.position,s=o!==void 0&&o.h<=2,c=o!==void 0&&o.h<=3;return u(`section`,{className:`${F.panel} ${F[a]} ${s?F.shallow:``} ${c?F.short:``} ${n?F.error:``}`,style:we(e),"aria-busy":!t||void 0,"data-panel":!0,"data-panel-id":e.id,"data-panel-position":o?`${o.x},${o.y},${o.w},${o.h}`:void 0,"data-display":a,"data-shallow":s,"data-short":c,"data-error":n||void 0,children:[r,l(De,{panelId:e.id,link:t?.link}),u(`div`,{className:F.content,"data-panel-content":!0,children:[l(`h2`,{className:F.label,children:e.label??e.id}),i]})]})}function De({panelId:e,link:t}){return t?u(`a`,{className:F.sourceAction,href:t,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`View source for ${e} (opens in a new tab)`,title:`View source for ${e} (opens in a new tab)`,"data-panel-action":`source`,"data-panel-link":!0,children:[l(`span`,{"aria-hidden":`true`,children:`↗`}),l(`span`,{className:`screen-reader-only`,children:`View source`})]}):null}function z({value:e,label:t=`As of`}){let n=new Date(e),r=n.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}),i=Date.now()-n.getTime(),a=i>3e5,o=Oe(i);return u(Ee,{stale:a,children:[l(`span`,{"aria-hidden":`true`,children:`◷`}),` `,t,` `,r,` · `,o]})}function Oe(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 ke({panel:e,envelope:t}){if(!t)return l(R,{panel:e,children:l(I,{children:`Loading…`})});if(t.state===`error`)return u(R,{panel:e,envelope:t,error:!0,children:[l(L,{children:`⚠ Unable to read`}),l(I,{children:t.error.message}),l(z,{value:t.observedAt})]});let n=ae.safeParse(t.signal);return n.success?l(R,{panel:e,envelope:t,children:u(`div`,{className:Ce.fact,children:[l(L,{children:String(n.data.value)}),l(z,{value:t.observedAt})]})}):u(R,{panel:e,envelope:t,error:!0,children:[l(L,{children:`⚠ Invalid value`}),l(z,{value:t.observedAt})]})}var Ae=.85,je=[[{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 Me(e,t){return e>t?`horizontal`:`vertical`}function Ne(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 Pe(e){return Array.from(e).reduce((e,t)=>e*31+t.charCodeAt(0)>>>0,7)}function B(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 V(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 Fe(e,t,n){let r=je.filter(e=>B(e,t,n));return r[H(e,r.length)]??[{x:0,y:0}]}function Ie(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=>V(s,e))||!Ue(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<He(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[H(a,d.length)];return f?{x:f.x,y:f.y}:void 0}function Le(e,t,n,r,i,a){let o=je.flatMap((o,s)=>{if(!B(o,t,n))return[];let c=Ie(o,e,t,n,r,i+s*31,a);return c?[{shape:o,destination:c}]:[]});if(o.length!==0)return o[H(i,o.length)]}function Re(e,t,n){return Math.ceil(e*t*Ae*Math.min(1,Math.max(0,n)))}function ze(e){return e.reduce((e,t)=>e+t.cells.length,0)}function Be(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 Ve(e,t,n,r,i){let a=[];for(let o=0;o<i;o+=1){let i=r+o*17,s=Fe(i,t,n),c=Ie(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 He(e,t){return t===`vertical`?new Set(e.map(e=>e.x)).size:new Set(e.map(e=>e.y)).size}function Ue(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=>V({...i,y:e},t)))return!1;return i.y+s<=r}for(let e=n-o;e>=i.x;--e)if(a.some(t=>V({...i,x:e},t)))return!1;return i.x+o<=n}function H(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 We={variant:`_variant_1lsfm_1`},U={field:`_field_1lcxp_1`,grid:`_grid_1lcxp_10`,piece:`_piece_1lcxp_14`,cell:`_cell_1lcxp_30`,clearingCell:`_clearingCell_1lcxp_41`,"clear-cell":`_clear-cell_1lcxp_1`},Ge=50,W=1250,Ke=250,qe=850,Je=500;function Ye({progress:e,estimatedDurationMs:t,overdue:r,seed:o=0}){let s=i(null),[c,d]=a({...Ne(`vertical`),direction:`vertical`}),[f,p]=a([]),[m,h]=a(!1),[ee,g]=a([]),[_,te]=a(!1),v=i(c),y=i(c),b=i(e),x=i(o),S=i(void 0),C=i([]),w=i(!1),T=i({startedAt:Date.now(),nextPieceAt:W,recycleUntil:0,id:0,settled:[]});return n(()=>{b.current=e},[e]),n(()=>{x.current=o},[o]),n(()=>{let e=s.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect();t.width!==0&&t.height!==0&&d(e=>{let n=S.current??Me(t.width,t.height);S.current=n;let r={...Ne(n,t.width,t.height),direction:n};return v.current=r,r})};if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]),n(()=>{let e=window.matchMedia(`(prefers-reduced-motion: reduce)`),t=()=>te(e.matches);return t(),e.addEventListener?.(`change`,t),()=>e.removeEventListener?.(`change`,t)},[]),n(()=>{let e=y.current,t=e.direction!==c.direction||e.columns!==c.columns||e.rows!==c.rows;y.current=c,!(!t||_)&&(T.current={startedAt:Date.now(),nextPieceAt:W,id:0,recycleUntil:0,settled:[]},C.current=[],p([]),h(!1),g([]),w.current=!1)},[c,_]),n(()=>{if(!_)return;let e=Ve(c.direction,c.columns,c.rows,x.current,Math.max(1,Math.floor(b.current*6)));C.current=e,T.current.settled=e,p(e)},[c,_]),n(()=>{if(_)return;let e=window.setInterval(()=>{let e=T.current,n=Date.now()-e.startedAt,i=v.current,a=b.current,o=Re(i.columns,i.rows,a),s=[...e.settled],c=C.current.filter(e=>e.phase!==`settled`);if(n<e.recycleUntil)return;if(w.current&&(w.current=!1,h(!1),g([])),n>=e.nextPieceAt&&c.length===0){if(a<1&&ze(s)>=o)return;let l=e.id,u=x.current+l*17,d=Le(i.direction,i.columns,i.rows,s,u+1,!r);if(!d&&(a>=1||t===void 0)){let t=Be(i.direction,i.columns,i.rows,s,!0);if(t){s=t.shapes,e.settled=s,e.recycleUntil=n+Je,e.nextPieceAt=e.recycleUntil,C.current=s,w.current=!0,g(t.cleared),p(s),h(!0);return}}if(d){e.id+=1;let{shape:t,destination:r}=d,a=Math.max(...t.map(e=>e.y))+1;c=[...c,{id:l,bornAt:n,cells:t,x:i.direction===`horizontal`?i.columns-Math.max(...t.map(e=>e.x))-.5:r.x,y:i.direction===`vertical`?-a+.5:r.y,targetX:r.x,targetY:r.y,phase:`entry`}]}e.nextPieceAt+=Xe(t,i)}c=c.map(e=>{let t=n-e.bornAt,r=e.targetX===void 0||e.targetY===void 0?void 0:{x:e.targetX,y:e.targetY};if(!r)return e;let a=Math.min(1,Math.max(0,(t-Ke)/qe));if(a>=1)return s=[...s,{...e,x:r.x,y:r.y,phase:`settled`}],{...e,x:r.x,y:r.y,phase:`settled`};let o=i.direction===`horizontal`?i.columns-Math.max(...e.cells.map(e=>e.x))-1:r.x,c=i.direction===`vertical`?0:r.y,l=Math.min(1,Math.max(0,t/1100));return{...e,x:i.direction===`horizontal`?o+(r.x-o)*a:o,y:i.direction===`vertical`?c+(r.y-c)*a:c,phase:t<Ke?`entry`:l<.35?`align`:`travel`}}),e.settled=s;let l=[...s,...c.filter(e=>e.phase!==`settled`)];C.current=l,p(l)},Ge);return()=>window.clearInterval(e)},[t,r,_]),l(`div`,{ref:s,className:U.field,"data-running-part":`falling-shapes-field`,"data-direction":c.direction,"data-recycling":m||void 0,style:{"--shape-columns":c.columns,"--shape-rows":c.rows},children:u(`div`,{className:U.grid,children:[ee.map(e=>l(`span`,{className:U.clearingCell,style:{"--clear-x":e.x,"--clear-y":e.y}},`${e.x}-${e.y}`)),f.map(e=>l(`div`,{className:U.piece,"data-piece":e.id,"data-piece-phase":e.phase,style:{"--piece-x":e.x,"--piece-y":e.y,"--piece-width":Math.max(...e.cells.map(e=>e.x))+1,"--piece-height":Math.max(...e.cells.map(e=>e.y))+1},children:e.cells.map(e=>l(`span`,{className:U.cell,style:{"--cell-x":e.x,"--cell-y":e.y}},`${e.x}-${e.y}`))},e.id))]})})}function Xe(e,t){let n=Math.ceil(t.columns*t.rows*.85);return e===void 0||n<=0?W:Math.max(400,e/Math.max(1,Math.ceil(n/3)))}var G={frontier:`_frontier_16b4l_1`,now:`_now_16b4l_12`,routes:`_routes_16b4l_20`,route:`_route_16b4l_20`,trail:`_trail_16b4l_41`,packet:`_packet_16b4l_42`};function Ze(){return u(c,{children:[l(`span`,{className:G.frontier,"data-running-part":`frontier`}),l(`span`,{className:G.now,"data-running-part":`transit-now`}),l(`span`,{className:G.routes,"data-running-part":`transit-routes`,children:[0,1,2].map(e=>l(`span`,{className:G.route},e))}),l(`span`,{className:G.trail,"data-running-part":`transit-trail`}),l(`span`,{className:G.packet,"data-running-part":`transit-packet`})]})}var K={field:`_field_1mp6g_1`,overdue:`_overdue_1mp6g_11`,timing:`_timing_1mp6g_14`,timingOverdue:`_timingOverdue_1mp6g_24`},q={haze:`_haze_1wpvk_1`,band:`_band_1wpvk_17`,bandOne:`_bandOne_1wpvk_30`,bandTwo:`_bandTwo_1wpvk_33`,bandThree:`_bandThree_1wpvk_37`,drift:`_drift_1wpvk_42`,driftOne:`_driftOne_1wpvk_51`,driftTwo:`_driftTwo_1wpvk_55`,driftThree:`_driftThree_1wpvk_64`,driftFour:`_driftFour_1wpvk_73`,driftFive:`_driftFive_1wpvk_82`};function Qe(){return u(c,{children:[l(`span`,{className:q.haze,"data-running-part":`weather-haze`}),l(`span`,{className:`${q.band} ${q.bandOne}`}),l(`span`,{className:`${q.band} ${q.bandTwo}`}),l(`span`,{className:`${q.band} ${q.bandThree}`}),l(`span`,{className:`${q.drift} ${q.driftOne}`}),l(`span`,{className:`${q.drift} ${q.driftTwo}`}),l(`span`,{className:`${q.drift} ${q.driftThree}`}),l(`span`,{className:`${q.drift} ${q.driftFour}`}),l(`span`,{className:`${q.drift} ${q.driftFive}`})]})}var $e={anchor:`_anchor_1bd86_1`,body:`_body_1bd86_6`,"phased-marker":`_phased-marker_1bd86_1`};function et({anchorClassName:e,bodyClassName:t,delay:n,anchorPart:r,bodyPart:i}){let a=n?{"--phased-marker-delay":n}:void 0;return l(`span`,{className:`${$e.anchor} ${e??``}`,"data-running-part":r,children:l(`span`,{className:`${$e.body} ${t??``}`,"data-running-part":i,style:a})})}var J={frontier:`_frontier_1iaei_1`,lanes:`_lanes_1iaei_12`,lane:`_lane_1iaei_12`,markerAnchor:`_markerAnchor_1iaei_28`,markerBody:`_markerBody_1iaei_32`};function tt(){return u(c,{children:[l(`span`,{className:J.frontier,"data-running-part":`frontier`}),l(`span`,{className:J.lanes,"data-running-part":`bloom-lanes`,children:[0,1,2,3].map(e=>l(`span`,{className:J.lane,"data-running-part":`bloom-lane`,children:l(et,{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 nt(e){return[`telemetry-bloom`,`release-transit`,`status-weather`,`falling-shapes`].includes(e)}function rt({animation:e,progress:t,estimatedDurationMs:n,overdue:r,indeterminate:i,seed:a}){let o={"--running-progress":`${t*100}%`};return u(`div`,{className:`${K.field} ${r?K.overdue:``}`,"data-animation":e,"data-running-field":!0,"data-indeterminate":i||void 0,"aria-hidden":`true`,style:o,children:[e===`telemetry-bloom`&&l(tt,{}),e===`release-transit`&&l(Ze,{}),e===`status-weather`&&l(Qe,{}),e===`falling-shapes`&&l(Ye,{progress:t,estimatedDurationMs:n,overdue:r,seed:a})]})}var it=20;function at(e,t){let n=ot(!!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 ot(e){let[t,r]=a(()=>Date.now());return n(()=>{if(!e)return;r(Date.now());let t=window.setInterval(()=>r(Date.now()),it);return()=>window.clearInterval(t)},[e]),t}function st(e,t,n){return`${e===void 0?`Run in progress`:`Elapsed ${lt(e)}`} · ${t===void 0?`Expected duration unavailable`:`Expected ≈ ${lt(t)}`}${n?` · Over estimate`:``}`}function ct(e,t,n){let r=e===void 0?`—`:ut(e),i=t===void 0?`?`:`~${ut(t)}`;return`${n?`⚠`:`\xA0`}${r}/${i}`}function lt(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 ut(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 dt({elapsedMs:e,estimatedDurationMs:t,overdue:n}){return u(`p`,{className:`${K.timing} ${n?K.timingOverdue:``}`,children:[l(`span`,{className:`screen-reader-only`,children:st(e,t,n)}),l(`span`,{"aria-hidden":`true`,children:ct(e,t,n)})]})}var Y={progress:`_progress_47ww5_1`,visual:`_visual_47ww5_8`,timing:`_timing_47ww5_12`,overdue:`_overdue_47ww5_17`,readout:`_readout_47ww5_23`,radial:`_radial_47ww5_31`,sweep:`_sweep_47ww5_1`,radialCore:`_radialCore_47ww5_49`,runway:`_runway_47ww5_56`,spark:`_spark_47ww5_81`,orbit:`_orbit_47ww5_92`,orbitCore:`_orbitCore_47ww5_107`,particle:`_particle_47ww5_114`,particleTwo:`_particleTwo_47ww5_125`,indeterminate:`_indeterminate_47ww5_129`,shift:`_shift_47ww5_1`,signalField:`_signalField_47ww5_137`,rail:`_rail_47ww5_155`,lead:`_lead_47ww5_161`,pulse:`_pulse_47ww5_171`,pulseTwo:`_pulseTwo_47ww5_182`,tracks:`_tracks_47ww5_185`,sparkWide:`_sparkWide_47ww5_1`,track:`_track_47ww5_185`,markerAnchor:`_markerAnchor_47ww5_309`,markerBody:`_markerBody_47ww5_313`,short:`_short_47ww5_335`};function ft({animation:e,timing:t}){let{elapsedMs:n,estimatedDurationMs:r,hasEstimate:i,overdue:a,progress:o}=t,s=e===`runway`||e===`signal-field`,d=st(n,r,a),f={"--running-progress":`${o*100}%`,"--running-degrees":`${o*360}deg`},p=e===`signal-field`?Y.signalField:Y[e];return u(`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:[u(`div`,{className:Y.visual,"aria-hidden":`true`,"data-running-visual":!0,children:[e===`radial`&&l(`span`,{className:Y.radialCore}),e===`runway`&&l(`span`,{className:Y.spark}),e===`orbit`&&u(c,{children:[l(`span`,{className:Y.orbitCore}),l(`span`,{className:Y.particle}),l(`span`,{className:`${Y.particle} ${Y.particleTwo}`})]}),e===`signal-field`&&u(c,{children:[l(`span`,{className:Y.rail}),l(`span`,{className:Y.lead}),l(`span`,{className:Y.pulse}),l(`span`,{className:`${Y.pulse} ${Y.pulseTwo}`}),l(`span`,{className:Y.tracks,"data-running-part":`signal-tracks`,children:[0,1,2,3,4].map(e=>l(`span`,{className:Y.track,"data-running-part":`signal-track`,children:l(et,{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))})]})]}),l(`p`,{className:`${Y.timing} ${s?Y.readout:``}`,children:s?u(c,{children:[l(`span`,{className:`screen-reader-only`,children:d}),l(`span`,{"aria-hidden":`true`,children:ct(n,r,a)})]}):d})]})}function pt(e){return[`radial`,`runway`,`orbit`,`signal-field`].includes(e)}var mt=2e4,ht=15e3,gt=3e5,_t=1.25,vt=[`radial`,`runway`,`orbit`,`signal-field`,`telemetry-bloom`,`release-transit`,`status-weather`,`falling-shapes`];function yt({panel:e}){let t=St(),n=e.running_animation===void 0||e.running_animation===`off`?void 0:e.running_animation,r=bt(e.demo_run_duration,mt),i=bt(e.demo_review_duration,gt),a=n?Math.ceil(i*_t):r,o=Math.floor(t/a),s=n??vt[o%vt.length]??`radial`,c=o*a;return l(xt,{panel:e,animation:s,runStartedAt:c,estimatedDurationMs:n?i:ht})}function bt(e,t){return e?p(e)??t:t}function xt({panel:e,animation:t,runStartedAt:n,estimatedDurationMs:r}){let i=at(new Date(n).toISOString(),r),a=nt(t);return u(R,{panel:e,field:a?l(rt,{animation:t,progress:i.progress,estimatedDurationMs:i.estimatedDurationMs,overdue:i.overdue,indeterminate:!i.hasEstimate,seed:Pe(e.id)},`${t}-${n}`):void 0,children:[l(L,{status:`running`,children:`↻ Running`}),u(`p`,{className:We.variant,children:[`Demo treatment · `,t]}),a?l(dt,{elapsedMs:i.elapsedMs,estimatedDurationMs:r,overdue:i.overdue}):l(ft,{animation:t,timing:i})]})}function St(){let[e,t]=a(()=>Date.now());return n(()=>{let e=window.setInterval(()=>t(Date.now()),1e3);return()=>window.clearInterval(e)},[]),e}var Ct={details:`_details_1isu9_1`};function wt({panel:e,envelope:t}){if(!t)return l(R,{panel:e,children:l(I,{children:`Loading…`})});if(t.state===`error`)return u(R,{panel:e,envelope:t,error:!0,children:[u(L,{children:[`⚠ `,t.error.kind===`no-runs`?`No workflow runs`:`Unable to read`]}),l(I,{children:t.error.message}),l(z,{value:t.observedAt})]});let n=E.safeParse(t.signal);return n.success?l(Tt,{panel:e,envelope:t,signal:n.data}):u(R,{panel:e,envelope:t,error:!0,children:[l(L,{children:`⚠ Invalid signal`}),l(z,{value:t.observedAt})]})}function Tt({panel:e,envelope:t,signal:n}){let r=Ot(n.status),[o,s]=a(()=>n.status===`running`?Et():void 0),c=i(n.status);if(n.status!==c.current){let t=c.current===`running`;c.current=n.status,e.running_animation===void 0&&!t&&n.status===`running`&&s(e=>Et(e))}let d=e.running_animation??o??`off`,f=n.status===`running`&&d!==`off`,p=at(n.runStartedAt,n.estimatedDurationMs),m=f&&nt(d),h=f&&pt(d);return l(R,{panel:e,envelope:t,field:m?l(rt,{animation:d,progress:p.progress,estimatedDurationMs:p.estimatedDurationMs,overdue:p.overdue,indeterminate:!p.hasEstimate,seed:Pe(e.id)}):void 0,children:u(`div`,{className:Ct.details,children:[u(L,{status:n.status,children:[r.glyph,` `,r.label]}),u(I,{children:[n.name,` · `,n.rawStatus,n.branch&&u(Te,{title:`Branch: ${n.branch}`,children:[l(`span`,{"aria-hidden":`true`,children:` · ⎇ `}),l(`span`,{className:`screen-reader-only`,children:`Branch: `}),n.branch]})]}),m&&l(dt,{elapsedMs:p.elapsedMs,estimatedDurationMs:n.estimatedDurationMs,overdue:p.overdue}),h&&l(ft,{animation:d,timing:p}),n.status!==`running`&&n.durationMs!==void 0&&u(I,{children:[`Took `,Dt(n.durationMs)]}),n.sourceUpdatedAt&&l(z,{value:n.sourceUpdatedAt,label:`Run updated`}),l(z,{value:t.observedAt})]})})}function Et(e){let t=g.filter(t=>t!==e);return t[Math.floor(Math.random()*t.length)]??`telemetry-bloom`}function Dt(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 Ot(e){switch(e){case`passed`:return{glyph:`✓`,label:`Passed`};case`failed`:return{glyph:`✕`,label:`Failed`};case`running`:return{glyph:`↻`,label:`Running`};case`cancelled`:return{glyph:`⊘`,label:`Cancelled`};case`unknown`:return{glyph:`?`,label:`Unknown`}}}function kt({panel:e,envelope:t}){if(!t)return l(R,{panel:e,children:l(I,{children:`Loading…`})});if(t.state===`error`)return u(R,{panel:e,envelope:t,error:!0,children:[l(L,{children:`⚠ Unable to read`}),l(I,{children:t.error.message}),l(z,{value:t.observedAt})]});let n=ie.safeParse(t.signal);if(!n.success)return l(R,{panel:e,envelope:t,error:!0,children:l(L,{children:`⚠ Invalid signal`})});let r=At(n.data.status);return u(R,{panel:e,envelope:t,children:[u(L,{status:n.data.status,children:[r.glyph,` `,r.label]}),l(I,{children:n.data.summary}),l(z,{value:t.observedAt})]})}function At(e){switch(e){case`passed`:return{glyph:`✓`,label:`Healthy`};case`failed`:return{glyph:`✕`,label:`Failed`};case`running`:return{glyph:`↻`,label:`Running`};case`cancelled`:return{glyph:`⊘`,label:`Cancelled`};case`unknown`:return{glyph:`?`,label:`Unknown`}}}var jt={"pipeline-status":wt,"pull-request-health":kt,"http-value":ke,"pipeline-animation-demo":yt};function Mt({panel:e,envelope:t}){let n=jt[e.type];return n?l(n,{panel:e,envelope:t}):l(Se,{label:e.type,hint:`Not wired yet`,wide:!0})}var Nt=6e4,Pt=1e4,Ft=()=>globalThis.window.location.reload();function It({env:e,diagnostics:t,fetcher:r,reload:i=Ft}){n(()=>{let n=!1,a=!1,o,s=`${e.proxyPath}/client`,c=async()=>{if(n||a)return;a=!0;let l=new AbortController;o=l;let u=globalThis.setTimeout(()=>l.abort(),Pt);t.record({kind:`client-update-check`,path:s});try{let a=await(r??globalThis.fetch)(s,{cache:`no-store`,signal:l.signal});if(!a.ok)throw Error(`Client identity returned ${a.status}`);let o=S.safeParse(await a.json());if(!o.success)throw Error(`Client identity response was invalid`);if(n)return;o.data.assetPath!==e.assetPath&&(t.record({kind:`client-update-detected`,path:s,current:{assetPath:e.assetPath,clientVersion:e.clientVersion},next:o.data}),i())}catch(e){!n&&!(e instanceof DOMException&&e.name===`AbortError`)&&t.record({kind:`client-update-failure`,path:s,message:e instanceof Error?e.message:String(e)})}finally{globalThis.clearTimeout(u),a=!1,o===l&&(o=void 0),n||globalThis.setTimeout(()=>void c(),Nt)}};return c(),()=>{n=!0,o?.abort()}},[t,e.assetPath,e.clientVersion,e.proxyPath,r,i])}function X(e,t){if(t.state===`error`)return{state:t.state,link:t.link};if(e.type===`pipeline-status`){let e=E.safeParse(t.signal);return{state:t.state,status:e.success?e.data.status:void 0,link:t.link}}if(e.type===`pull-request-health`){let e=ie.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 Lt(e,t,n){if(!e)return!0;let r=X(t,e),i=X(t,n);return r.state!==i.state||r.status!==i.status||r.link!==i.link}function Rt(e,t,n){let r=zt(e);if(!r)return n.refreshMillis;let i=Bt(r);return i===void 0?n.runningRefreshMillis:t<i?Math.min(n.runningRefreshMillis,i-t):t<i+n.runningCompletionWindowMillis?n.runningCompletionRefreshMillis:n.runningRefreshMillis}function zt(e){if(e?.state!==`ok`)return;let t=E.safeParse(e.signal);return t.success&&t.data.status===`running`?t.data:void 0}function Bt(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 Vt({board:e,env:t,diagnostics:r}){let[o,s]=a({}),c=i({});return n(()=>{if(c.current={},s({}),!e)return;let n=!1,i=new Set;for(let a of e.panels){if(D(a.position)||a.type!==`pipeline-status`&&a.type!==`pull-request-health`&&a.type!==`http-value`)continue;let o=!1,l=de(e,a),u=`${t.proxyPath}/panel/${encodeURIComponent(t.board)}/${encodeURIComponent(a.id)}`,d,f=()=>{n||o||(o=!0,r.record({kind:`panel-fetch-start`,panelId:a.id,path:u}),fetch(u).then(async e=>{let t={kind:`panel-fetch-response`,panelId:a.id,path:u,status:e.status,cache:M(e.headers)};if(e.status===304){r.record(t);return}try{let n=Ht(await e.json());if(!n){r.record(t),r.record({kind:`panel-fetch-parse-failure`,panelId:a.id,path:u,message:`Response was not a valid signal envelope.`});return}return r.record({...t,envelope:n}),n}catch(e){throw r.record(t),r.record({kind:`panel-fetch-parse-failure`,panelId:a.id,path:u,message:Z(e)}),new Q(e)}}).then(e=>{if(e&&(d=e),!n&&e){let t=c.current[a.id];Lt(t,a,e)&&r.record({kind:`panel-rendered`,panelId:a.id,path:u,rendered:X(a,e)}),c.current={...c.current,[a.id]:e},s(c.current)}}).catch(e=>{e instanceof Q||r.record({kind:`panel-fetch-failure`,panelId:a.id,path:u,message:Z(e)})}).finally(()=>{if(o=!1,!n){let e=window.setTimeout(()=>{i.delete(e),f()},Rt(d,Date.now(),l));i.add(e)}}))};f()}return()=>{n=!0;for(let e of i)window.clearTimeout(e)}},[e,r,t.board,t.proxyPath]),o}function Z(e){return e instanceof Error?e.message:String(e)}var Q=class extends Error{constructor(e){super(Z(e))}};function Ht(e){let t=ne.safeParse(e);return t.success?t.data:void 0}function Ut({env:e}){let[t,o]=a(),[s,c]=a(),d=i(null);d.current||=new ve(e);let f=d.current;It({env:e,diagnostics:f});let p=Vt({board:s===e.board?t:void 0,env:e,diagnostics:f}),m=r(()=>t?ce(t.panels):void 0,[t]);return n(()=>{!m||m.issues.length===0||f.record({kind:`layout-analyzed`,issueCount:m.issues.length,affectedPanelIds:m.issues.map(e=>e.panelId)})},[f,m]),n(()=>{let t=!1;o(void 0),c(void 0);let n=`${e.proxyPath}/boards/${encodeURIComponent(e.board)}`;return f.record({kind:`board-fetch-start`,path:n}),fetch(n).then(async e=>{if(f.record({kind:`board-fetch-response`,path:n,status:e.status,cache:M(e.headers)}),!e.ok)throw Error(`Board configuration returned ${e.status}`);try{return await e.json()}catch(e){throw f.record({kind:`board-fetch-parse-failure`,path:n,message:$(e)}),new Gt(e)}}).then(r=>{if(!t){o(r),c(e.board);let t=Array.isArray(r.panels)?r.panels:[];f.record({kind:`board-fetch-response`,path:n,boardSummary:{panelCount:t.length,panelIds:t.flatMap(e=>typeof e.id==`string`?[e.id]:[])}})}}).catch(r=>{r instanceof Gt||f.record({kind:`board-fetch-failure`,path:n,message:$(r)}),t||(o({panels:[]}),c(e.board))}),()=>{t=!0}},[f,e.board,e.proxyPath]),u(`div`,{className:k.board,children:[l(`header`,{className:k.header,children:l(`h1`,{className:k.title,children:e.board})}),u(`main`,{className:k.grid,children:[!t&&l(Se,{label:`board`,hint:`Loading configuration…`,wide:!0}),t?.panels.filter(e=>!D(e.position)).map(e=>l(Mt,{panel:e,envelope:p[e.id]},e.id))]}),u(`footer`,{className:k.footer,"data-board-footer":!0,children:[l(`span`,{children:`Signals are read live from their configured authorities.`}),u(`div`,{className:k.footerTools,children:[m&&m.issues.length>0&&l(Wt,{board:e.board,layout:m,proxyPath:e.proxyPath}),l(fe,{log:f})]})]})]})}function Wt({board:e,layout:t,proxyPath:r}){let[i,o]=a(!1),s=`layout-warning-${e}`;n(()=>{if(!i)return;let e=e=>{e.key===`Escape`&&o(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[i]);let c=`${r}/boards/${encodeURIComponent(e)}`;return u(`div`,{className:k.layoutWarning,"data-layout-warning":!0,children:[u(`button`,{className:k.layoutWarningButton,type:`button`,"aria-label":`Layout warnings (${t.issues.length})`,"aria-expanded":i,"aria-controls":s,onClick:()=>o(!i),children:[l(`span`,{"aria-hidden":`true`,children:`⚠`}),l(`span`,{children:t.issues.length})]}),i&&u(`aside`,{className:k.layoutWarningDialog,id:s,role:`dialog`,"aria-labelledby":`${s}-title`,"aria-modal":`false`,children:[u(`div`,{className:k.layoutWarningHeading,children:[l(`strong`,{id:`${s}-title`,children:`Layout warnings`}),l(`button`,{className:k.layoutWarningClose,type:`button`,"aria-label":`Close layout warnings`,onClick:()=>o(!1),children:`×`})]}),u(`p`,{children:[t.issues.length,` layout issue`,t.issues.length===1?``:`s`,` detected against the intended 12×12 space. The live board is unchanged: explicit overlaps remain overlapped and overflow continues in implicit rows.`]}),l(`ul`,{children:t.issues.map(e=>u(`li`,{children:[l(`strong`,{children:e.panelId}),`: `,e.kind,` at (`,e.position.x,`,`,` `,e.position.y,`), `,e.position.w,`×`,e.position.h,e.conflictsWith.length?`; overlaps ${e.conflictsWith.join(`, `)}`:``]},`${e.panelId}-${e.kind}`))}),u(`div`,{className:k.layoutWarningDownloads,children:[l(`a`,{href:`${c}/rendered`,download:`${e}-layout-rendered.yaml`,children:`Download legal rendered layout`}),l(`a`,{href:`${c}/authored`,download:`${e}-layout-authored.yaml`,children:`Download authored layout`})]}),l(`p`,{className:k.layoutWarningNote,children:`The legal rendered layout normalizes the currently visible explicit area into 12×12 and makes the smallest deterministic adjustments needed to avoid collisions. The authored layout preserves the original coordinates exactly.`})]})]})}function $(e){return e instanceof Error?e.message:String(e)}var Gt=class extends Error{constructor(e){super($(e))}},Kt={error:`_error_yx1g9_1`};function qt({message:e}){return u(`div`,{className:Kt.error,role:`alert`,children:[l(`h1`,{children:`⚠️ Dashboard misconfigured`}),l(`p`,{children:`The page loaded, but the server did not hand it usable configuration.`}),l(`pre`,{children:e})]})}var Jt=document.getElementById(`root`);if(!Jt)throw Error(`No #root element in the document — the template is not the one we expect.`);var Yt=s(Jt);try{Yt.render(l(t,{children:l(Ut,{env:C()})}))}catch(e){Yt.render(l(qt,{message:e instanceof Error?e.message:String(e)}))}
3
+ //# sourceMappingURL=index-zOEGeAGM.js.map