@xenosystem/blocks 0.24.0 → 0.25.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.
@@ -0,0 +1,1345 @@
1
+ import {
2
+ PLATFORM_SHELL_BLOCK_MANIFEST,
3
+ PLATFORM_SHELL_PANEL_ID
4
+ } from "../chunk-OB3VAVQI.js";
5
+ import "../chunk-2KG3PWR4.js";
6
+
7
+ // src/shell/PlatformShell.tsx
8
+ import { useState } from "react";
9
+ import {
10
+ buildPlatformThemeCssVars,
11
+ getClosestPlatformTheme,
12
+ normalizePlatformBrightness
13
+ } from "@xenosystem/elements/tokens";
14
+
15
+ // src/shell/PlatformUpdatePill.tsx
16
+ import { jsx, jsxs } from "react/jsx-runtime";
17
+ function sanitizeErrorCode(code) {
18
+ const cleaned = code.replace(/[^A-Za-z0-9_.-]/g, "").slice(0, 32);
19
+ return cleaned || "UNKNOWN";
20
+ }
21
+ function formatVersion(version) {
22
+ const trimmed = version.trim();
23
+ if (!trimmed) return "";
24
+ return trimmed.startsWith("v") ? trimmed : `v${trimmed}`;
25
+ }
26
+ function clampPercent(percent) {
27
+ if (typeof percent !== "number" || !Number.isFinite(percent)) return void 0;
28
+ return Math.max(0, Math.min(100, Math.round(percent)));
29
+ }
30
+ function PlatformUpdatePill({
31
+ status,
32
+ onCheckForUpdates,
33
+ onDownloadUpdate,
34
+ onInstallAndRestart,
35
+ onSignIn,
36
+ onManagePlan,
37
+ className
38
+ }) {
39
+ const cls = className ? `xeno-ps-update ${className}` : "xeno-ps-update";
40
+ switch (status.state) {
41
+ case "idle": {
42
+ if (!onCheckForUpdates) return null;
43
+ return /* @__PURE__ */ jsx(
44
+ "button",
45
+ {
46
+ type: "button",
47
+ className: cls,
48
+ "data-state": "idle",
49
+ "data-no-drag": "true",
50
+ "aria-label": "Check for updates",
51
+ onClick: onCheckForUpdates,
52
+ children: /* @__PURE__ */ jsx("span", { children: "Check updates" })
53
+ }
54
+ );
55
+ }
56
+ case "checking": {
57
+ return /* @__PURE__ */ jsxs(
58
+ "button",
59
+ {
60
+ type: "button",
61
+ className: cls,
62
+ "data-state": "checking",
63
+ "data-no-drag": "true",
64
+ disabled: true,
65
+ "aria-live": "polite",
66
+ "aria-label": "Checking for updates",
67
+ children: [
68
+ /* @__PURE__ */ jsx("span", { className: "xeno-ps-update-pip", "aria-hidden": "true" }),
69
+ /* @__PURE__ */ jsx("span", { children: "Checking\u2026" })
70
+ ]
71
+ }
72
+ );
73
+ }
74
+ case "up-to-date": {
75
+ const ver = formatVersion(status.version);
76
+ return /* @__PURE__ */ jsxs(
77
+ "button",
78
+ {
79
+ type: "button",
80
+ className: cls,
81
+ "data-state": "up-to-date",
82
+ "data-no-drag": "true",
83
+ disabled: !onCheckForUpdates,
84
+ "aria-label": `Up to date ${ver}`.trim(),
85
+ title: onCheckForUpdates ? `Up to date (${ver}) \u2014 click to re-check` : `Up to date (${ver})`,
86
+ onClick: onCheckForUpdates,
87
+ children: [
88
+ /* @__PURE__ */ jsx("span", { className: "xeno-ps-update-pip", "aria-hidden": "true" }),
89
+ /* @__PURE__ */ jsx("span", { children: ver || "Up to date" })
90
+ ]
91
+ }
92
+ );
93
+ }
94
+ case "available": {
95
+ const ver = formatVersion(status.version);
96
+ return /* @__PURE__ */ jsxs(
97
+ "button",
98
+ {
99
+ type: "button",
100
+ className: cls,
101
+ "data-state": "available",
102
+ "data-no-drag": "true",
103
+ disabled: !onDownloadUpdate,
104
+ "aria-label": `Download update ${ver}`.trim(),
105
+ onClick: onDownloadUpdate,
106
+ children: [
107
+ /* @__PURE__ */ jsx("span", { className: "xeno-ps-update-pip", "aria-hidden": "true" }),
108
+ /* @__PURE__ */ jsx("span", { children: ver ? `Update ${ver}` : "Update available" })
109
+ ]
110
+ }
111
+ );
112
+ }
113
+ case "downloading": {
114
+ const pct = clampPercent(status.percent);
115
+ const ver = formatVersion(status.version);
116
+ return /* @__PURE__ */ jsxs(
117
+ "button",
118
+ {
119
+ type: "button",
120
+ className: cls,
121
+ "data-state": "downloading",
122
+ "data-no-drag": "true",
123
+ disabled: true,
124
+ "aria-live": "polite",
125
+ "aria-label": pct !== void 0 ? `Downloading update ${ver} (${pct}%)` : `Downloading update ${ver}`,
126
+ children: [
127
+ /* @__PURE__ */ jsx("span", { children: pct !== void 0 ? `Downloading ${pct}%` : "Downloading\u2026" }),
128
+ pct !== void 0 ? /* @__PURE__ */ jsx("span", { className: "xeno-ps-update-bar", "aria-hidden": "true", children: /* @__PURE__ */ jsx("span", { className: "xeno-ps-update-fill", style: { width: `${pct}%` } }) }) : null
129
+ ]
130
+ }
131
+ );
132
+ }
133
+ case "ready": {
134
+ const ver = formatVersion(status.version);
135
+ return /* @__PURE__ */ jsx(
136
+ "button",
137
+ {
138
+ type: "button",
139
+ className: cls,
140
+ "data-state": "ready",
141
+ "data-no-drag": "true",
142
+ disabled: !onInstallAndRestart,
143
+ "aria-label": ver ? `Restart to install update ${ver}` : "Restart to update",
144
+ onClick: onInstallAndRestart,
145
+ children: /* @__PURE__ */ jsx("span", { children: "Restart to update" })
146
+ }
147
+ );
148
+ }
149
+ case "signed-out": {
150
+ return /* @__PURE__ */ jsxs(
151
+ "button",
152
+ {
153
+ type: "button",
154
+ className: cls,
155
+ "data-state": "signed-out",
156
+ "data-no-drag": "true",
157
+ disabled: !onSignIn,
158
+ "aria-label": "Sign in for updates",
159
+ onClick: onSignIn,
160
+ children: [
161
+ /* @__PURE__ */ jsx("span", { className: "xeno-ps-update-pip", "aria-hidden": "true" }),
162
+ /* @__PURE__ */ jsx("span", { children: "Sign in for updates" })
163
+ ]
164
+ }
165
+ );
166
+ }
167
+ case "not-entitled": {
168
+ return /* @__PURE__ */ jsxs(
169
+ "button",
170
+ {
171
+ type: "button",
172
+ className: cls,
173
+ "data-state": "not-entitled",
174
+ "data-no-drag": "true",
175
+ disabled: !onManagePlan,
176
+ "aria-label": "Manage plan for updates",
177
+ onClick: onManagePlan,
178
+ children: [
179
+ /* @__PURE__ */ jsx("span", { className: "xeno-ps-update-pip", "aria-hidden": "true" }),
180
+ /* @__PURE__ */ jsx("span", { children: "Manage plan" })
181
+ ]
182
+ }
183
+ );
184
+ }
185
+ case "error": {
186
+ const safeCode = sanitizeErrorCode(status.code);
187
+ return /* @__PURE__ */ jsxs(
188
+ "button",
189
+ {
190
+ type: "button",
191
+ className: cls,
192
+ "data-state": "error",
193
+ "data-no-drag": "true",
194
+ disabled: !onCheckForUpdates,
195
+ "aria-label": `Update error ${safeCode}`,
196
+ title: onCheckForUpdates ? `Update error (${safeCode}) \u2014 click to retry` : `Update error (${safeCode})`,
197
+ onClick: onCheckForUpdates,
198
+ children: [
199
+ /* @__PURE__ */ jsx("span", { className: "xeno-ps-update-pip", "aria-hidden": "true" }),
200
+ /* @__PURE__ */ jsx("span", { children: "Update failed" })
201
+ ]
202
+ }
203
+ );
204
+ }
205
+ }
206
+ }
207
+
208
+ // src/shell/styles.ts
209
+ var STYLE_ELEMENT_ID = "xeno-platform-shell-block-styles";
210
+ var PLATFORM_SHELL_CSS = `
211
+ @property --xeno-fr {
212
+ syntax: '<length>';
213
+ inherits: true;
214
+ initial-value: 15px;
215
+ }
216
+
217
+ .xeno-ps-root {
218
+ --xeno-layout-gap: 7px;
219
+ --xeno-layout-gap-y: 7px;
220
+ --xeno-layout-radius: 14px;
221
+ --xeno-layout-rail-w: 56px;
222
+ --xeno-layout-sidebar-w: 236px;
223
+ --xeno-layout-flare: 15px;
224
+ --xeno-ease-open: cubic-bezier(0.22, 0.9, 0.24, 1);
225
+ --xeno-ease-close: cubic-bezier(0.45, 0, 0.2, 1);
226
+ position: relative;
227
+ width: 100%;
228
+ height: 100%;
229
+ min-height: 0;
230
+ box-sizing: border-box;
231
+ font-size: 13px;
232
+ line-height: 1.45;
233
+ -webkit-font-smoothing: antialiased;
234
+ }
235
+
236
+ .xeno-ps-root *,
237
+ .xeno-ps-root *::before,
238
+ .xeno-ps-root *::after {
239
+ box-sizing: border-box;
240
+ }
241
+
242
+ .xeno-ps-root .xeno-app-shell {
243
+ position: relative;
244
+ display: flex;
245
+ width: 100%;
246
+ height: 100%;
247
+ min-height: 0;
248
+ background: var(--xeno-canvas);
249
+ color: var(--xeno-text);
250
+ overflow: hidden;
251
+ }
252
+
253
+ .xeno-ps-root .xeno-app-rail {
254
+ position: relative;
255
+ flex: none;
256
+ width: var(--xeno-layout-rail-w);
257
+ display: flex;
258
+ flex-direction: column;
259
+ align-items: center;
260
+ gap: 4px;
261
+ padding: 10px 0;
262
+ background: var(--xeno-rail-bg);
263
+ z-index: 30;
264
+ }
265
+
266
+ .xeno-ps-root .xeno-app-rail::after {
267
+ content: '';
268
+ position: absolute;
269
+ right: 0;
270
+ top: 0;
271
+ bottom: 0;
272
+ width: 1px;
273
+ background: var(--xeno-rail-stroke);
274
+ transition: top 260ms var(--xeno-ease-open), bottom 260ms var(--xeno-ease-open);
275
+ }
276
+
277
+ .xeno-ps-root .xeno-app-shell[data-sidebar='open'] .xeno-app-rail::after {
278
+ top: calc(var(--xeno-layout-flare) + 1px);
279
+ bottom: calc(var(--xeno-layout-flare) + 1px);
280
+ }
281
+
282
+ .xeno-ps-root .xeno-app-rail-logo {
283
+ width: 40px;
284
+ height: 40px;
285
+ border-radius: 10px;
286
+ border: 0;
287
+ background: transparent;
288
+ color: var(--xeno-text);
289
+ display: grid;
290
+ place-items: center;
291
+ margin-bottom: 4px;
292
+ cursor: pointer;
293
+ padding: 0;
294
+ transition: background 150ms ease, transform 180ms var(--xeno-ease-open);
295
+ }
296
+
297
+ .xeno-ps-root .xeno-app-rail-logo:hover {
298
+ background: var(--xeno-hover);
299
+ }
300
+
301
+ .xeno-ps-root .xeno-app-rail-logo:active {
302
+ transform: scale(0.94);
303
+ }
304
+
305
+ .xeno-ps-root .xeno-app-rail-btn {
306
+ position: relative;
307
+ width: 40px;
308
+ height: 40px;
309
+ border-radius: 10px;
310
+ border: 0;
311
+ background: transparent;
312
+ color: var(--xeno-muted-text);
313
+ display: grid;
314
+ place-items: center;
315
+ cursor: pointer;
316
+ padding: 0;
317
+ transition: background 150ms ease, color 150ms ease;
318
+ }
319
+
320
+ .xeno-ps-root .xeno-app-rail-btn:hover:not(:disabled) {
321
+ background: var(--xeno-hover);
322
+ color: var(--xeno-text);
323
+ }
324
+
325
+ .xeno-ps-root .xeno-app-rail-btn[aria-current='page'],
326
+ .xeno-ps-root .xeno-app-rail-btn[aria-current='true'] {
327
+ background: var(--xeno-hover-strong);
328
+ color: var(--xeno-text);
329
+ }
330
+
331
+ .xeno-ps-root .xeno-app-rail-btn:disabled {
332
+ opacity: 0.4;
333
+ cursor: default;
334
+ }
335
+
336
+ .xeno-ps-root .xeno-app-rail-btn:focus-visible,
337
+ .xeno-ps-root .xeno-app-rail-logo:focus-visible,
338
+ .xeno-ps-root .sb-ib:focus-visible,
339
+ .xeno-ps-root .sb-row:focus-visible,
340
+ .xeno-ps-root .xeno-ps-update:focus-visible,
341
+ .xeno-ps-root .xeno-ps-theme-btn:focus-visible,
342
+ .xeno-ps-root .xeno-ps-win-btn:focus-visible {
343
+ outline: 2px solid var(--xeno-accent);
344
+ outline-offset: 1px;
345
+ }
346
+
347
+ .xeno-ps-root .xeno-app-rail-grow {
348
+ flex: 1 1 auto;
349
+ }
350
+
351
+ .xeno-ps-root .xeno-app-rail-footer {
352
+ display: flex;
353
+ flex-direction: column;
354
+ align-items: center;
355
+ gap: 6px;
356
+ }
357
+
358
+ .xeno-ps-root .xeno-app-rail-dot {
359
+ position: absolute;
360
+ top: 7px;
361
+ right: 7px;
362
+ width: 6px;
363
+ height: 6px;
364
+ border-radius: 2px;
365
+ background: var(--xeno-success-text);
366
+ box-shadow: 0 0 0 2px var(--xeno-rail-bg);
367
+ }
368
+
369
+ .xeno-ps-root .xeno-app-rail-dot[data-tone='warn'] {
370
+ background: var(--xeno-warning-text);
371
+ }
372
+
373
+ .xeno-ps-root .xeno-app-rail-dot[data-tone='err'] {
374
+ background: var(--xeno-danger-text);
375
+ }
376
+
377
+ .xeno-ps-root .xeno-app-rail-badge {
378
+ position: absolute;
379
+ bottom: 4px;
380
+ right: 3px;
381
+ min-width: 15px;
382
+ height: 14px;
383
+ padding: 0 3px;
384
+ border-radius: 4px;
385
+ background: var(--xeno-accent);
386
+ color: var(--xeno-accent-text);
387
+ font-size: 9px;
388
+ font-weight: 700;
389
+ line-height: 14px;
390
+ text-align: center;
391
+ font-variant-numeric: tabular-nums;
392
+ }
393
+
394
+ .xeno-ps-root .xeno-app-slot {
395
+ position: relative;
396
+ flex: none;
397
+ width: calc(var(--xeno-layout-sidebar-w) + var(--xeno-layout-gap));
398
+ padding: var(--xeno-layout-gap-y) 0 var(--xeno-layout-gap-y) var(--xeno-layout-gap);
399
+ display: flex;
400
+ min-height: 0;
401
+ z-index: 20;
402
+ --xeno-fr: var(--xeno-layout-flare);
403
+ transition: width 280ms var(--xeno-ease-open), padding 280ms var(--xeno-ease-open), --xeno-fr 280ms var(--xeno-ease-open);
404
+ }
405
+
406
+ .xeno-ps-root .xeno-app-shell[data-sidebar='closed'] .xeno-app-slot {
407
+ width: 0;
408
+ padding: 0;
409
+ --xeno-fr: 0px;
410
+ pointer-events: none;
411
+ overflow: hidden;
412
+ transition: width 240ms var(--xeno-ease-close), padding 240ms var(--xeno-ease-close), --xeno-fr 220ms var(--xeno-ease-close);
413
+ }
414
+
415
+ .xeno-ps-root .xeno-app-slot::before,
416
+ .xeno-ps-root .xeno-app-slot::after {
417
+ content: '';
418
+ position: absolute;
419
+ left: 0;
420
+ width: calc(var(--xeno-fr) + 1px);
421
+ height: calc(var(--xeno-fr) + 1px);
422
+ pointer-events: none;
423
+ z-index: 25;
424
+ }
425
+
426
+ .xeno-ps-root .xeno-app-slot::before {
427
+ top: 0;
428
+ background: radial-gradient(
429
+ circle at 100% 100%,
430
+ transparent calc(var(--xeno-fr) - 0.4px),
431
+ var(--xeno-rail-stroke) var(--xeno-fr),
432
+ var(--xeno-rail-stroke) calc(var(--xeno-fr) + 0.6px),
433
+ var(--xeno-rail-bg) calc(var(--xeno-fr) + 1px)
434
+ );
435
+ }
436
+
437
+ .xeno-ps-root .xeno-app-slot::after {
438
+ bottom: 0;
439
+ background: radial-gradient(
440
+ circle at 100% 0%,
441
+ transparent calc(var(--xeno-fr) - 0.4px),
442
+ var(--xeno-rail-stroke) var(--xeno-fr),
443
+ var(--xeno-rail-stroke) calc(var(--xeno-fr) + 0.6px),
444
+ var(--xeno-rail-bg) calc(var(--xeno-fr) + 1px)
445
+ );
446
+ }
447
+
448
+ .xeno-ps-root .xeno-app-sidebar {
449
+ flex: 1 1 auto;
450
+ display: flex;
451
+ flex-direction: column;
452
+ width: 100%;
453
+ min-width: 0;
454
+ min-height: 0;
455
+ background: var(--xeno-surface);
456
+ border: 1px solid var(--xeno-border);
457
+ border-radius: var(--xeno-layout-radius);
458
+ overflow: hidden;
459
+ }
460
+
461
+ .xeno-ps-root .sb-head {
462
+ display: flex;
463
+ align-items: center;
464
+ gap: 8px;
465
+ height: 46px;
466
+ padding: 0 10px 0 13px;
467
+ flex: none;
468
+ border-bottom: 1px solid var(--xeno-border-subtle);
469
+ }
470
+
471
+ .xeno-ps-root .sb-head-ttl {
472
+ flex: 1;
473
+ min-width: 0;
474
+ font-weight: 600;
475
+ font-size: 13.5px;
476
+ letter-spacing: -0.01em;
477
+ color: var(--xeno-text);
478
+ white-space: nowrap;
479
+ overflow: hidden;
480
+ text-overflow: ellipsis;
481
+ }
482
+
483
+ .xeno-ps-root .sb-head-ttl small {
484
+ display: block;
485
+ font-weight: 400;
486
+ font-size: 10.5px;
487
+ color: var(--xeno-dim-text);
488
+ }
489
+
490
+ .xeno-ps-root .sb-ib {
491
+ width: 28px;
492
+ height: 28px;
493
+ border-radius: 7px;
494
+ border: 0;
495
+ background: transparent;
496
+ color: var(--xeno-muted-text);
497
+ display: grid;
498
+ place-items: center;
499
+ cursor: pointer;
500
+ flex: none;
501
+ padding: 0;
502
+ }
503
+
504
+ .xeno-ps-root .sb-ib:hover {
505
+ background: var(--xeno-hover);
506
+ color: var(--xeno-text);
507
+ }
508
+
509
+ .xeno-ps-root .sb-body {
510
+ flex: 1 1 auto;
511
+ overflow-y: auto;
512
+ padding: 8px;
513
+ display: flex;
514
+ flex-direction: column;
515
+ gap: 2px;
516
+ }
517
+
518
+ .xeno-ps-root .sb-grp {
519
+ padding: 10px 9px 4px;
520
+ font-size: 10px;
521
+ font-weight: 600;
522
+ color: var(--xeno-dim-text);
523
+ text-transform: uppercase;
524
+ letter-spacing: 0.06em;
525
+ }
526
+
527
+ .xeno-ps-root .sb-row {
528
+ display: flex;
529
+ align-items: center;
530
+ gap: 9px;
531
+ width: 100%;
532
+ height: 32px;
533
+ padding: 0 9px;
534
+ border-radius: 8px;
535
+ border: 0;
536
+ background: transparent;
537
+ color: var(--xeno-muted-text);
538
+ font-size: 12.5px;
539
+ font-weight: 500;
540
+ cursor: pointer;
541
+ text-align: left;
542
+ transition: background 120ms, color 120ms;
543
+ }
544
+
545
+ .xeno-ps-root .sb-row:hover:not(:disabled) {
546
+ background: var(--xeno-hover);
547
+ color: var(--xeno-text);
548
+ }
549
+
550
+ .xeno-ps-root .sb-row[aria-current='true'] {
551
+ background: var(--xeno-hover-strong);
552
+ color: var(--xeno-text);
553
+ }
554
+
555
+ .xeno-ps-root .sb-row:disabled {
556
+ opacity: 0.4;
557
+ cursor: default;
558
+ }
559
+
560
+ .xeno-ps-root .sb-row-icon {
561
+ display: inline-flex;
562
+ align-items: center;
563
+ justify-content: center;
564
+ flex: none;
565
+ }
566
+
567
+ .xeno-ps-root .sb-row-label {
568
+ flex: 1 1 auto;
569
+ min-width: 0;
570
+ white-space: nowrap;
571
+ overflow: hidden;
572
+ text-overflow: ellipsis;
573
+ }
574
+
575
+ .xeno-ps-root .sb-row .meta {
576
+ margin-left: auto;
577
+ font-size: 10.5px;
578
+ font-variant-numeric: tabular-nums;
579
+ color: var(--xeno-dim-text);
580
+ flex: none;
581
+ }
582
+
583
+ .xeno-ps-root .sb-row[aria-current='true'] .meta {
584
+ color: var(--xeno-muted-text);
585
+ }
586
+
587
+ .xeno-ps-root .sb-foot {
588
+ flex: none;
589
+ border-top: 1px solid var(--xeno-border-subtle);
590
+ padding: 8px 10px;
591
+ display: flex;
592
+ align-items: center;
593
+ justify-content: space-between;
594
+ gap: 6px;
595
+ }
596
+
597
+ .xeno-ps-root .xeno-app-main {
598
+ flex: 1 1 auto;
599
+ min-width: 0;
600
+ min-height: 0;
601
+ display: flex;
602
+ padding: var(--xeno-layout-gap-y) var(--xeno-layout-gap) var(--xeno-layout-gap-y) var(--xeno-layout-gap);
603
+ }
604
+
605
+ .xeno-ps-root .xeno-app-plate {
606
+ container-type: inline-size;
607
+ flex: 1 1 auto;
608
+ display: flex;
609
+ flex-direction: column;
610
+ min-width: 0;
611
+ min-height: 0;
612
+ background: var(--xeno-viewport);
613
+ border: 1px solid var(--xeno-border);
614
+ border-radius: var(--xeno-layout-radius);
615
+ overflow: hidden;
616
+ }
617
+
618
+ .xeno-ps-root .plate-topbar {
619
+ flex: none;
620
+ display: flex;
621
+ align-items: center;
622
+ justify-content: space-between;
623
+ gap: 10px;
624
+ height: 46px;
625
+ padding: 0 12px 0 14px;
626
+ border-bottom: 1px solid var(--xeno-border-subtle);
627
+ background: var(--xeno-panel-header);
628
+ user-select: none;
629
+ }
630
+
631
+ .xeno-ps-root .plate-topbar[data-drag-region='true'] {
632
+ -webkit-app-region: drag;
633
+ }
634
+
635
+ .xeno-ps-root .plate-topbar[data-drag-region='true'] button,
636
+ .xeno-ps-root .plate-topbar[data-drag-region='true'] a,
637
+ .xeno-ps-root .plate-topbar[data-drag-region='true'] input,
638
+ .xeno-ps-root .plate-topbar[data-drag-region='true'] select,
639
+ .xeno-ps-root .plate-topbar[data-drag-region='true'] [data-no-drag='true'] {
640
+ -webkit-app-region: no-drag;
641
+ }
642
+
643
+ .xeno-ps-root .plate-topbar-left {
644
+ display: flex;
645
+ align-items: center;
646
+ gap: 8px;
647
+ min-width: 0;
648
+ flex: 1 1 0;
649
+ }
650
+
651
+ .xeno-ps-root .plate-topbar-center {
652
+ display: flex;
653
+ align-items: center;
654
+ justify-content: center;
655
+ flex: none;
656
+ }
657
+
658
+ .xeno-ps-root .plate-topbar-right {
659
+ display: flex;
660
+ align-items: center;
661
+ justify-content: flex-end;
662
+ gap: 6px;
663
+ flex: 1 1 0;
664
+ min-width: 0;
665
+ }
666
+
667
+ .xeno-ps-root .plate-crumb {
668
+ display: flex;
669
+ align-items: center;
670
+ gap: 7px;
671
+ font-size: 13px;
672
+ color: var(--xeno-muted-text);
673
+ min-width: 0;
674
+ white-space: nowrap;
675
+ overflow: hidden;
676
+ text-overflow: ellipsis;
677
+ }
678
+
679
+ .xeno-ps-root .plate-crumb-sep {
680
+ color: var(--xeno-dim-text);
681
+ }
682
+
683
+ .xeno-ps-root .plate-crumb-section {
684
+ color: var(--xeno-text);
685
+ font-weight: 600;
686
+ overflow: hidden;
687
+ text-overflow: ellipsis;
688
+ }
689
+
690
+ .xeno-ps-root .plate-body {
691
+ flex: 1 1 auto;
692
+ min-height: 0;
693
+ min-width: 0;
694
+ display: flex;
695
+ flex-direction: column;
696
+ overflow: auto;
697
+ }
698
+
699
+ /* \u2500\u2500 PlatformUpdatePill \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
700
+ .xeno-ps-update {
701
+ appearance: none;
702
+ display: inline-flex;
703
+ align-items: center;
704
+ gap: 6px;
705
+ height: 26px;
706
+ padding: 0 9px;
707
+ border-radius: 6px;
708
+ border: 1px solid var(--xeno-border);
709
+ background: var(--xeno-control);
710
+ color: var(--xeno-muted-text);
711
+ font-size: 11.5px;
712
+ font-weight: 500;
713
+ line-height: 1;
714
+ white-space: nowrap;
715
+ cursor: pointer;
716
+ flex: none;
717
+ font-variant-numeric: tabular-nums;
718
+ transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
719
+ }
720
+
721
+ .xeno-ps-update:hover:not(:disabled) {
722
+ background: var(--xeno-hover-strong);
723
+ color: var(--xeno-text);
724
+ }
725
+
726
+ .xeno-ps-update:disabled {
727
+ cursor: default;
728
+ }
729
+
730
+ .xeno-ps-update[data-state='idle'],
731
+ .xeno-ps-update[data-state='up-to-date'] {
732
+ background: transparent;
733
+ border-color: var(--xeno-border-subtle);
734
+ color: var(--xeno-dim-text);
735
+ }
736
+
737
+ .xeno-ps-update[data-state='checking'] {
738
+ background: var(--xeno-control);
739
+ border-color: var(--xeno-border);
740
+ color: var(--xeno-muted-text);
741
+ }
742
+
743
+ .xeno-ps-update[data-state='available'] {
744
+ background: color-mix(in srgb, var(--xeno-warning-text) 14%, var(--xeno-surface));
745
+ border-color: color-mix(in srgb, var(--xeno-warning-text) 48%, var(--xeno-border));
746
+ color: var(--xeno-warning-text);
747
+ font-weight: 600;
748
+ }
749
+
750
+ .xeno-ps-update[data-state='downloading'] {
751
+ background: var(--xeno-control);
752
+ border-color: var(--xeno-plate-border);
753
+ color: var(--xeno-text);
754
+ }
755
+
756
+ .xeno-ps-update[data-state='ready'] {
757
+ background: var(--xeno-accent);
758
+ border-color: transparent;
759
+ color: var(--xeno-accent-text);
760
+ font-weight: 600;
761
+ }
762
+
763
+ .xeno-ps-update[data-state='ready']:hover:not(:disabled) {
764
+ background: var(--xeno-accent-hover);
765
+ color: var(--xeno-accent-text);
766
+ }
767
+
768
+ .xeno-ps-update[data-state='signed-out'],
769
+ .xeno-ps-update[data-state='not-entitled'] {
770
+ background: var(--xeno-control);
771
+ border-color: var(--xeno-border-strong);
772
+ color: var(--xeno-text);
773
+ }
774
+
775
+ .xeno-ps-update[data-state='error'] {
776
+ background: color-mix(in srgb, var(--xeno-danger-text) 12%, var(--xeno-surface));
777
+ border-color: color-mix(in srgb, var(--xeno-danger-text) 48%, var(--xeno-border));
778
+ color: var(--xeno-danger-text);
779
+ }
780
+
781
+ .xeno-ps-update-pip {
782
+ width: 6px;
783
+ height: 6px;
784
+ border-radius: 1.5px;
785
+ background: currentColor;
786
+ flex: none;
787
+ }
788
+
789
+ .xeno-ps-update[data-state='up-to-date'] .xeno-ps-update-pip {
790
+ background: var(--xeno-success-text);
791
+ }
792
+
793
+ .xeno-ps-update-bar {
794
+ width: 34px;
795
+ height: 4px;
796
+ border-radius: 2px;
797
+ background: var(--xeno-border);
798
+ overflow: hidden;
799
+ flex: none;
800
+ }
801
+
802
+ .xeno-ps-update-fill {
803
+ display: block;
804
+ height: 100%;
805
+ background: var(--xeno-success-text);
806
+ transition: width 160ms ease;
807
+ }
808
+
809
+ /* \u2500\u2500 Theme Stop Toggle & WindowControls \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
810
+ .xeno-ps-theme-btn {
811
+ appearance: none;
812
+ display: inline-flex;
813
+ align-items: center;
814
+ gap: 5px;
815
+ height: 26px;
816
+ padding: 0 8px;
817
+ border-radius: 6px;
818
+ border: 1px solid var(--xeno-border);
819
+ background: var(--xeno-control);
820
+ color: var(--xeno-muted-text);
821
+ font-size: 11px;
822
+ font-weight: 500;
823
+ cursor: pointer;
824
+ flex: none;
825
+ white-space: nowrap;
826
+ transition: background 120ms ease, color 120ms ease;
827
+ }
828
+
829
+ .xeno-ps-theme-btn:hover {
830
+ background: var(--xeno-hover-strong);
831
+ color: var(--xeno-text);
832
+ }
833
+
834
+ .xeno-ps-win {
835
+ display: inline-flex;
836
+ align-items: center;
837
+ gap: 2px;
838
+ margin-left: 4px;
839
+ padding-left: 6px;
840
+ border-left: 1px solid var(--xeno-border-subtle);
841
+ flex: none;
842
+ }
843
+
844
+ .xeno-ps-win-btn {
845
+ appearance: none;
846
+ width: 28px;
847
+ height: 26px;
848
+ border-radius: 6px;
849
+ border: 0;
850
+ background: transparent;
851
+ color: var(--xeno-muted-text);
852
+ display: grid;
853
+ place-items: center;
854
+ cursor: pointer;
855
+ padding: 0;
856
+ transition: background 120ms ease, color 120ms ease;
857
+ }
858
+
859
+ .xeno-ps-win-btn:hover {
860
+ background: var(--xeno-hover);
861
+ color: var(--xeno-text);
862
+ }
863
+
864
+ .xeno-ps-win-btn[data-win-action='close']:hover {
865
+ background: color-mix(in srgb, var(--xeno-danger) 20%, transparent);
866
+ color: var(--xeno-danger-text);
867
+ }
868
+
869
+ /* \u2500\u2500 Container-Query Tightening & Narrow Responsive Collapse \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
870
+ @container (max-width: 620px) {
871
+ .xeno-ps-root .plate-topbar {
872
+ gap: 6px;
873
+ padding: 0 8px 0 10px;
874
+ }
875
+ .xeno-ps-root .plate-crumb-brand,
876
+ .xeno-ps-root .plate-crumb-sep {
877
+ display: none;
878
+ }
879
+ .xeno-ps-root .xeno-ps-theme-label {
880
+ display: none;
881
+ }
882
+ .xeno-ps-root .xeno-ps-update {
883
+ padding: 0 7px;
884
+ font-size: 11px;
885
+ }
886
+ .xeno-ps-root .xeno-ps-update-bar {
887
+ display: none;
888
+ }
889
+ }
890
+
891
+ @media (max-width: 780px) {
892
+ .xeno-ps-root .xeno-app-slot {
893
+ display: none;
894
+ }
895
+ .xeno-ps-root .xeno-app-shell[data-sidebar='open'] .xeno-app-rail::after {
896
+ top: 0;
897
+ bottom: 0;
898
+ }
899
+ }
900
+
901
+ @media (prefers-reduced-motion: reduce) {
902
+ .xeno-ps-root .xeno-app-rail::after,
903
+ .xeno-ps-root .xeno-app-rail-logo,
904
+ .xeno-ps-root .xeno-app-rail-btn,
905
+ .xeno-ps-root .xeno-app-slot,
906
+ .xeno-ps-root .sb-row,
907
+ .xeno-ps-update,
908
+ .xeno-ps-update-fill,
909
+ .xeno-ps-theme-btn,
910
+ .xeno-ps-win-btn {
911
+ transition: none;
912
+ }
913
+ }
914
+ `;
915
+ function ensurePlatformShellStyles() {
916
+ if (typeof document === "undefined" || !document.head) return;
917
+ if (document.getElementById(STYLE_ELEMENT_ID)) return;
918
+ const style = document.createElement("style");
919
+ style.id = STYLE_ELEMENT_ID;
920
+ style.textContent = PLATFORM_SHELL_CSS;
921
+ document.head.appendChild(style);
922
+ }
923
+
924
+ // src/shell/WindowControls.tsx
925
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
926
+ function WindowControls({
927
+ onMinimize,
928
+ onMaximize,
929
+ onClose,
930
+ isMaximized = false,
931
+ minimizeLabel = "Minimize window",
932
+ maximizeLabel = "Maximize window",
933
+ restoreLabel = "Restore window",
934
+ closeLabel = "Close window",
935
+ className
936
+ }) {
937
+ if (!onMinimize && !onMaximize && !onClose) return null;
938
+ return /* @__PURE__ */ jsxs2(
939
+ "div",
940
+ {
941
+ className: className ? `xeno-ps-win ${className}` : "xeno-ps-win",
942
+ role: "group",
943
+ "aria-label": "Window controls",
944
+ "data-no-drag": "true",
945
+ children: [
946
+ onMinimize ? /* @__PURE__ */ jsx2(
947
+ "button",
948
+ {
949
+ type: "button",
950
+ className: "xeno-ps-win-btn",
951
+ "data-win-action": "minimize",
952
+ "aria-label": minimizeLabel,
953
+ title: minimizeLabel,
954
+ onClick: onMinimize,
955
+ children: /* @__PURE__ */ jsx2(
956
+ "svg",
957
+ {
958
+ width: "10",
959
+ height: "10",
960
+ viewBox: "0 0 10 10",
961
+ fill: "none",
962
+ stroke: "currentColor",
963
+ strokeWidth: "1.25",
964
+ "aria-hidden": "true",
965
+ children: /* @__PURE__ */ jsx2("path", { d: "M1.5 5.5h7" })
966
+ }
967
+ )
968
+ }
969
+ ) : null,
970
+ onMaximize ? /* @__PURE__ */ jsx2(
971
+ "button",
972
+ {
973
+ type: "button",
974
+ className: "xeno-ps-win-btn",
975
+ "data-win-action": isMaximized ? "restore" : "maximize",
976
+ "aria-label": isMaximized ? restoreLabel : maximizeLabel,
977
+ title: isMaximized ? restoreLabel : maximizeLabel,
978
+ onClick: onMaximize,
979
+ children: isMaximized ? /* @__PURE__ */ jsxs2(
980
+ "svg",
981
+ {
982
+ width: "10",
983
+ height: "10",
984
+ viewBox: "0 0 10 10",
985
+ fill: "none",
986
+ stroke: "currentColor",
987
+ strokeWidth: "1.15",
988
+ "aria-hidden": "true",
989
+ children: [
990
+ /* @__PURE__ */ jsx2("rect", { x: "1.5", y: "3", width: "5.5", height: "5.5", rx: "1" }),
991
+ /* @__PURE__ */ jsx2("path", { d: "M3.5 3V2a1 1 0 0 1 1-1H8a1 1 0 0 1 1 1v3.5a1 1 0 0 1-1 1H7" })
992
+ ]
993
+ }
994
+ ) : /* @__PURE__ */ jsx2(
995
+ "svg",
996
+ {
997
+ width: "10",
998
+ height: "10",
999
+ viewBox: "0 0 10 10",
1000
+ fill: "none",
1001
+ stroke: "currentColor",
1002
+ strokeWidth: "1.15",
1003
+ "aria-hidden": "true",
1004
+ children: /* @__PURE__ */ jsx2("rect", { x: "1.75", y: "1.75", width: "6.5", height: "6.5", rx: "1" })
1005
+ }
1006
+ )
1007
+ }
1008
+ ) : null,
1009
+ onClose ? /* @__PURE__ */ jsx2(
1010
+ "button",
1011
+ {
1012
+ type: "button",
1013
+ className: "xeno-ps-win-btn",
1014
+ "data-win-action": "close",
1015
+ "aria-label": closeLabel,
1016
+ title: closeLabel,
1017
+ onClick: onClose,
1018
+ children: /* @__PURE__ */ jsx2(
1019
+ "svg",
1020
+ {
1021
+ width: "10",
1022
+ height: "10",
1023
+ viewBox: "0 0 10 10",
1024
+ fill: "none",
1025
+ stroke: "currentColor",
1026
+ strokeWidth: "1.25",
1027
+ "aria-hidden": "true",
1028
+ children: /* @__PURE__ */ jsx2("path", { d: "M2 2l6 6M8 2L2 8" })
1029
+ }
1030
+ )
1031
+ }
1032
+ ) : null
1033
+ ]
1034
+ }
1035
+ );
1036
+ }
1037
+
1038
+ // src/shell/PlatformShell.tsx
1039
+ import { Fragment, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
1040
+ var THEME_STOP_CYCLE = [0, 50, 100];
1041
+ function nextThemeStop(currentPosition) {
1042
+ const norm = normalizePlatformBrightness(currentPosition);
1043
+ if (norm < 25) return THEME_STOP_CYCLE[1];
1044
+ if (norm < 75) return THEME_STOP_CYCLE[2];
1045
+ return THEME_STOP_CYCLE[0];
1046
+ }
1047
+ function themeLabelFor(position) {
1048
+ const closest = getClosestPlatformTheme(position);
1049
+ if (closest === "dim") return "Dim";
1050
+ if (closest === "light") return "Light";
1051
+ return "Dark";
1052
+ }
1053
+ function PlatformShell({
1054
+ brandIcon,
1055
+ brandLabel,
1056
+ railItems = [],
1057
+ activeSectionId,
1058
+ onSelectSection,
1059
+ themePosition = 0,
1060
+ onThemePositionChange,
1061
+ railFooter,
1062
+ sidebarTitle,
1063
+ sidebarSubtitle,
1064
+ sidebarOpen: controlledSidebarOpen,
1065
+ defaultSidebarOpen = true,
1066
+ onSidebarOpenChange,
1067
+ sidebarSections = [],
1068
+ activeSidebarItemId,
1069
+ onSelectSidebarItem,
1070
+ sidebarFooter,
1071
+ sidebarContent,
1072
+ sidebarWidth,
1073
+ desktopDragRegion = false,
1074
+ sectionLabel,
1075
+ breadcrumb,
1076
+ modeSlot,
1077
+ headerActions,
1078
+ updateState,
1079
+ onCheckForUpdates,
1080
+ onDownloadUpdate,
1081
+ onInstallAndRestart,
1082
+ onSignIn,
1083
+ onManagePlan,
1084
+ themeToggle = false,
1085
+ accountSlot,
1086
+ onMinimize,
1087
+ onMaximize,
1088
+ onClose,
1089
+ isMaximized,
1090
+ hideTopbar = false,
1091
+ children,
1092
+ label = "XENO Platform Shell",
1093
+ className
1094
+ }) {
1095
+ useState(() => {
1096
+ ensurePlatformShellStyles();
1097
+ return null;
1098
+ });
1099
+ const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultSidebarOpen);
1100
+ const hasSidebar = sidebarContent != null || sidebarSections.length > 0 || sidebarTitle != null || sidebarFooter != null;
1101
+ const isSidebarOpen = hasSidebar ? controlledSidebarOpen ?? uncontrolledOpen : false;
1102
+ const toggleSidebar = () => {
1103
+ if (!hasSidebar) return;
1104
+ const next = !isSidebarOpen;
1105
+ if (controlledSidebarOpen === void 0) setUncontrolledOpen(next);
1106
+ onSidebarOpenChange?.(next);
1107
+ };
1108
+ const normalizedPosition = normalizePlatformBrightness(themePosition);
1109
+ const resolvedTheme = getClosestPlatformTheme(normalizedPosition);
1110
+ const themeVars = buildPlatformThemeCssVars(normalizedPosition);
1111
+ const rootStyle = {
1112
+ ...themeVars,
1113
+ ...sidebarWidth !== void 0 ? { "--xeno-layout-sidebar-w": `${sidebarWidth}px` } : {},
1114
+ colorScheme: resolvedTheme === "light" ? "light" : "dark"
1115
+ };
1116
+ const rootClass = className ? `xeno xeno-ps-root ${className}` : "xeno xeno-ps-root";
1117
+ return /* @__PURE__ */ jsx3(
1118
+ "div",
1119
+ {
1120
+ className: rootClass,
1121
+ "data-layout": "platform",
1122
+ "data-theme": resolvedTheme,
1123
+ "data-theme-position": String(normalizedPosition),
1124
+ style: rootStyle,
1125
+ "aria-label": label,
1126
+ children: /* @__PURE__ */ jsxs3(
1127
+ "div",
1128
+ {
1129
+ className: "xeno-app-shell",
1130
+ "data-sidebar": isSidebarOpen ? "open" : "closed",
1131
+ children: [
1132
+ /* @__PURE__ */ jsxs3("nav", { className: "xeno-app-rail", "aria-label": "Primary rail", children: [
1133
+ brandIcon != null ? /* @__PURE__ */ jsx3(
1134
+ "button",
1135
+ {
1136
+ type: "button",
1137
+ className: "xeno-app-rail-logo",
1138
+ "aria-label": hasSidebar ? isSidebarOpen ? `Collapse ${brandLabel ?? "navigation"} sidebar` : `Expand ${brandLabel ?? "navigation"} sidebar` : brandLabel ?? "Home",
1139
+ "aria-expanded": hasSidebar ? isSidebarOpen : void 0,
1140
+ title: brandLabel,
1141
+ onClick: toggleSidebar,
1142
+ children: brandIcon
1143
+ }
1144
+ ) : null,
1145
+ railItems.map((item) => {
1146
+ const isActive = item.id === activeSectionId;
1147
+ return /* @__PURE__ */ jsxs3(
1148
+ "button",
1149
+ {
1150
+ type: "button",
1151
+ className: "xeno-app-rail-btn",
1152
+ disabled: item.disabled,
1153
+ "aria-label": item.label,
1154
+ "aria-current": isActive ? "page" : void 0,
1155
+ title: item.label,
1156
+ onClick: () => onSelectSection?.(item.id),
1157
+ children: [
1158
+ item.icon,
1159
+ item.tone ? /* @__PURE__ */ jsx3(
1160
+ "span",
1161
+ {
1162
+ className: "xeno-app-rail-dot",
1163
+ "data-tone": item.tone,
1164
+ "aria-hidden": "true"
1165
+ }
1166
+ ) : null,
1167
+ item.badge != null ? /* @__PURE__ */ jsx3("span", { className: "xeno-app-rail-badge", "aria-hidden": "true", children: item.badge }) : null
1168
+ ]
1169
+ },
1170
+ item.id
1171
+ );
1172
+ }),
1173
+ /* @__PURE__ */ jsx3("div", { className: "xeno-app-rail-grow" }),
1174
+ railFooter != null ? /* @__PURE__ */ jsx3("div", { className: "xeno-app-rail-footer", children: railFooter }) : null
1175
+ ] }),
1176
+ hasSidebar ? /* @__PURE__ */ jsx3("div", { className: "xeno-app-slot", "aria-hidden": !isSidebarOpen, children: /* @__PURE__ */ jsxs3("aside", { className: "xeno-app-sidebar", "aria-label": "Workspace sidebar", children: [
1177
+ sidebarTitle != null || sidebarSubtitle != null ? /* @__PURE__ */ jsxs3("div", { className: "sb-head", children: [
1178
+ /* @__PURE__ */ jsxs3("div", { className: "sb-head-ttl", children: [
1179
+ sidebarTitle,
1180
+ sidebarSubtitle != null ? /* @__PURE__ */ jsx3("small", { children: sidebarSubtitle }) : null
1181
+ ] }),
1182
+ /* @__PURE__ */ jsx3(
1183
+ "button",
1184
+ {
1185
+ type: "button",
1186
+ className: "sb-ib",
1187
+ "aria-label": "Collapse sidebar",
1188
+ title: "Collapse sidebar",
1189
+ onClick: toggleSidebar,
1190
+ children: /* @__PURE__ */ jsx3(
1191
+ "svg",
1192
+ {
1193
+ width: "14",
1194
+ height: "14",
1195
+ viewBox: "0 0 16 16",
1196
+ fill: "none",
1197
+ stroke: "currentColor",
1198
+ strokeWidth: "1.5",
1199
+ strokeLinecap: "round",
1200
+ strokeLinejoin: "round",
1201
+ "aria-hidden": "true",
1202
+ children: /* @__PURE__ */ jsx3("path", { d: "M10 4L6 8l4 4" })
1203
+ }
1204
+ )
1205
+ }
1206
+ )
1207
+ ] }) : null,
1208
+ /* @__PURE__ */ jsx3("div", { className: "sb-body", children: sidebarContent != null ? sidebarContent : sidebarSections.map((section, idx) => /* @__PURE__ */ jsxs3("div", { children: [
1209
+ section.title ? /* @__PURE__ */ jsx3("div", { className: "sb-grp", children: section.title }) : null,
1210
+ section.items.map((row) => {
1211
+ const isCurrent = row.active !== void 0 ? row.active : row.id === activeSidebarItemId;
1212
+ return /* @__PURE__ */ jsxs3(
1213
+ "button",
1214
+ {
1215
+ type: "button",
1216
+ className: "sb-row",
1217
+ disabled: row.disabled,
1218
+ "aria-current": isCurrent ? "true" : void 0,
1219
+ onClick: () => onSelectSidebarItem?.(row.id),
1220
+ children: [
1221
+ row.icon != null ? /* @__PURE__ */ jsx3("span", { className: "sb-row-icon", "aria-hidden": "true", children: row.icon }) : null,
1222
+ /* @__PURE__ */ jsx3("span", { className: "sb-row-label", children: row.label }),
1223
+ row.meta != null ? /* @__PURE__ */ jsx3("span", { className: "meta", children: row.meta }) : null
1224
+ ]
1225
+ },
1226
+ row.id
1227
+ );
1228
+ })
1229
+ ] }, section.id ?? section.title ?? `sec-${idx}`)) }),
1230
+ sidebarFooter != null ? /* @__PURE__ */ jsx3("div", { className: "sb-foot", children: sidebarFooter }) : null
1231
+ ] }) }) : null,
1232
+ /* @__PURE__ */ jsx3("main", { className: "xeno-app-main", children: /* @__PURE__ */ jsxs3("section", { className: "xeno-app-plate", children: [
1233
+ !hideTopbar ? /* @__PURE__ */ jsxs3(
1234
+ "header",
1235
+ {
1236
+ className: "plate-topbar",
1237
+ "data-drag-region": desktopDragRegion ? "true" : void 0,
1238
+ children: [
1239
+ /* @__PURE__ */ jsxs3("div", { className: "plate-topbar-left", children: [
1240
+ hasSidebar && !isSidebarOpen && brandIcon == null ? /* @__PURE__ */ jsx3(
1241
+ "button",
1242
+ {
1243
+ type: "button",
1244
+ className: "sb-ib",
1245
+ "aria-label": "Expand sidebar",
1246
+ title: "Expand sidebar",
1247
+ onClick: toggleSidebar,
1248
+ children: /* @__PURE__ */ jsx3(
1249
+ "svg",
1250
+ {
1251
+ width: "14",
1252
+ height: "14",
1253
+ viewBox: "0 0 16 16",
1254
+ fill: "none",
1255
+ stroke: "currentColor",
1256
+ strokeWidth: "1.5",
1257
+ strokeLinecap: "round",
1258
+ strokeLinejoin: "round",
1259
+ "aria-hidden": "true",
1260
+ children: /* @__PURE__ */ jsx3("path", { d: "M6 4l4 4-4 4" })
1261
+ }
1262
+ )
1263
+ }
1264
+ ) : null,
1265
+ /* @__PURE__ */ jsx3("div", { className: "plate-crumb", children: breadcrumb != null ? breadcrumb : /* @__PURE__ */ jsxs3(Fragment, { children: [
1266
+ brandLabel ? /* @__PURE__ */ jsx3("span", { className: "plate-crumb-brand", children: brandLabel }) : null,
1267
+ brandLabel && sectionLabel ? /* @__PURE__ */ jsx3("span", { className: "plate-crumb-sep", "aria-hidden": "true", children: "/" }) : null,
1268
+ sectionLabel ? /* @__PURE__ */ jsx3("span", { className: "plate-crumb-section", children: sectionLabel }) : null
1269
+ ] }) })
1270
+ ] }),
1271
+ modeSlot != null ? /* @__PURE__ */ jsx3("div", { className: "plate-topbar-center", "data-no-drag": "true", children: modeSlot }) : null,
1272
+ /* @__PURE__ */ jsxs3("div", { className: "plate-topbar-right", children: [
1273
+ headerActions,
1274
+ updateState ? /* @__PURE__ */ jsx3(
1275
+ PlatformUpdatePill,
1276
+ {
1277
+ status: updateState,
1278
+ onCheckForUpdates,
1279
+ onDownloadUpdate,
1280
+ onInstallAndRestart,
1281
+ onSignIn,
1282
+ onManagePlan
1283
+ }
1284
+ ) : null,
1285
+ themeToggle && onThemePositionChange ? /* @__PURE__ */ jsxs3(
1286
+ "button",
1287
+ {
1288
+ type: "button",
1289
+ className: "xeno-ps-theme-btn",
1290
+ "data-no-drag": "true",
1291
+ "aria-label": `Switch theme (currently ${themeLabelFor(normalizedPosition)})`,
1292
+ title: `Theme: ${themeLabelFor(normalizedPosition)} (${normalizedPosition}%)`,
1293
+ onClick: () => onThemePositionChange(nextThemeStop(normalizedPosition)),
1294
+ children: [
1295
+ /* @__PURE__ */ jsxs3(
1296
+ "svg",
1297
+ {
1298
+ width: "12",
1299
+ height: "12",
1300
+ viewBox: "0 0 16 16",
1301
+ fill: "none",
1302
+ stroke: "currentColor",
1303
+ strokeWidth: "1.5",
1304
+ "aria-hidden": "true",
1305
+ children: [
1306
+ /* @__PURE__ */ jsx3("rect", { x: "2", y: "2", width: "12", height: "12", rx: "2.5" }),
1307
+ /* @__PURE__ */ jsx3("path", { d: "M8 2v12" })
1308
+ ]
1309
+ }
1310
+ ),
1311
+ /* @__PURE__ */ jsx3("span", { className: "xeno-ps-theme-label", children: themeLabelFor(normalizedPosition) })
1312
+ ]
1313
+ }
1314
+ ) : null,
1315
+ accountSlot,
1316
+ /* @__PURE__ */ jsx3(
1317
+ WindowControls,
1318
+ {
1319
+ onMinimize,
1320
+ onMaximize,
1321
+ onClose,
1322
+ isMaximized
1323
+ }
1324
+ )
1325
+ ] })
1326
+ ]
1327
+ }
1328
+ ) : null,
1329
+ /* @__PURE__ */ jsx3("div", { className: "plate-body", children })
1330
+ ] }) })
1331
+ ]
1332
+ }
1333
+ )
1334
+ }
1335
+ );
1336
+ }
1337
+ export {
1338
+ PLATFORM_SHELL_BLOCK_MANIFEST,
1339
+ PLATFORM_SHELL_CSS,
1340
+ PLATFORM_SHELL_PANEL_ID,
1341
+ PlatformShell,
1342
+ PlatformUpdatePill,
1343
+ WindowControls,
1344
+ ensurePlatformShellStyles
1345
+ };