@invergent/agent-chat-react 2.11.0 → 2.11.1

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/dist/index.cjs CHANGED
@@ -16,6 +16,7 @@ var math = require('@streamdown/math');
16
16
  var mermaid = require('@streamdown/mermaid');
17
17
  var streamdown = require('streamdown');
18
18
  var reactUseControllableState = require('@radix-ui/react-use-controllable-state');
19
+ var thinkingOrbs = require('thinking-orbs');
19
20
  var shiki = require('shiki');
20
21
  var diff = require('diff');
21
22
  var AnsiImport = require('ansi-to-react');
@@ -1231,6 +1232,9 @@ function CollapsibleContent({
1231
1232
  // src/components/ai-elements/reasoning.tsx
1232
1233
  init_utils();
1233
1234
 
1235
+ // src/components/ai-elements/orb-label.tsx
1236
+ init_utils();
1237
+
1234
1238
  // src/components/ai-elements/shimmer.tsx
1235
1239
  init_utils();
1236
1240
  var ShimmerComponent = ({
@@ -1257,6 +1261,18 @@ var ShimmerComponent = ({
1257
1261
  );
1258
1262
  };
1259
1263
  var Shimmer = react.memo(ShimmerComponent);
1264
+ function OrbShimmerLabel({
1265
+ state,
1266
+ label,
1267
+ duration = 3,
1268
+ spread = 3,
1269
+ className
1270
+ }) {
1271
+ return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: cn("flex items-center gap-2", className), children: [
1272
+ /* @__PURE__ */ jsxRuntime.jsx(thinkingOrbs.ThinkingOrb, { state, size: 20, "aria-hidden": true }),
1273
+ /* @__PURE__ */ jsxRuntime.jsx(Shimmer, { duration, spread, className: "text-sm", children: label })
1274
+ ] });
1275
+ }
1260
1276
  var ReasoningContext = react.createContext(null);
1261
1277
  var useReasoning = () => {
1262
1278
  const context = react.useContext(ReasoningContext);
@@ -1326,7 +1342,7 @@ var Reasoning = react.memo(
1326
1342
  );
1327
1343
  var defaultGetThinkingMessage = (isStreaming, duration) => {
1328
1344
  if (isStreaming || duration === 0) {
1329
- return /* @__PURE__ */ jsxRuntime.jsx(Shimmer, { duration: 1, children: "Thinking..." });
1345
+ return /* @__PURE__ */ jsxRuntime.jsx(OrbShimmerLabel, { state: "solving", label: "Thinking...", duration: 1 });
1330
1346
  }
1331
1347
  if (duration === void 0) {
1332
1348
  return /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground italic", children: "Thought for a few seconds" });
@@ -1519,6 +1535,123 @@ function TimelineSeparator({
1519
1535
  }
1520
1536
  );
1521
1537
  }
1538
+
1539
+ // src/runtime/orb-state.ts
1540
+ var ORB_STATE_LABELS = {
1541
+ working: "Working on it...",
1542
+ searching: "Searching\u2026",
1543
+ solving: "Solving\u2026",
1544
+ listening: "Waiting for your answer\u2026",
1545
+ composing: "Writing\u2026",
1546
+ shaping: "Shaping\u2026"
1547
+ };
1548
+ var TOOL_ORB_STATES = {
1549
+ // Retrieval: the scan-meridian globe.
1550
+ web_search: "searching",
1551
+ web_extract: "searching",
1552
+ web_crawl: "searching",
1553
+ session_search: "searching",
1554
+ kb_list_pages: "searching",
1555
+ kb_read_page: "searching",
1556
+ search_files: "searching",
1557
+ list_files: "searching",
1558
+ research_memory: "searching",
1559
+ fetch_channel_messages: "searching",
1560
+ fetch_channel_file: "searching",
1561
+ // Creation/authoring: the circle→triangle→square morph.
1562
+ write_file: "shaping",
1563
+ patch: "shaping",
1564
+ create_artifact: "shaping",
1565
+ generate_image: "shaping",
1566
+ generate_video: "shaping",
1567
+ skill_manage: "shaping",
1568
+ research_outline: "shaping",
1569
+ // Heavy analysis/computation: bands scramble, then click back solved.
1570
+ run_coding_agent: "solving",
1571
+ consult_expert: "solving",
1572
+ vision_analyze: "solving",
1573
+ idea_tree: "solving",
1574
+ dispatch_experiments: "solving",
1575
+ merge_experiment: "solving",
1576
+ // Waiting on the user: the waveform.
1577
+ ask_user_question: "listening"
1578
+ };
1579
+ var MCP_TOOL_PREFIX = "mcp__";
1580
+ var MCP_SEARCHING_RE = /(?:^|_)(?:search|query|find|lookup|fetch|list|read|get)(?:_|$)/;
1581
+ var MCP_SHAPING_RE = /(?:^|_)(?:write|create|generate|edit|update|build|make)(?:_|$)/;
1582
+ function toolOrbState(toolName) {
1583
+ const mapped = TOOL_ORB_STATES[toolName];
1584
+ if (mapped) return mapped;
1585
+ if (toolName.startsWith(MCP_TOOL_PREFIX)) {
1586
+ const leaf = toolName.split("__").pop() ?? "";
1587
+ if (MCP_SEARCHING_RE.test(leaf)) return "searching";
1588
+ if (MCP_SHAPING_RE.test(leaf)) return "shaping";
1589
+ }
1590
+ return "working";
1591
+ }
1592
+ function lastRunningToolCall(message, toolFilter) {
1593
+ const calls = message.toolCalls ?? [];
1594
+ for (let i = calls.length - 1; i >= 0; i--) {
1595
+ const tc = calls[i];
1596
+ if (tc && tc.status === "running" && (!toolFilter || toolFilter(tc))) {
1597
+ return tc;
1598
+ }
1599
+ }
1600
+ return void 0;
1601
+ }
1602
+ function messageOrbState(message, options = {}) {
1603
+ if (message.toolCalls?.some(
1604
+ (tc) => tc.toolName === "ask_user_question" && tc.status === "running"
1605
+ )) {
1606
+ return "listening";
1607
+ }
1608
+ const running = lastRunningToolCall(message, options.toolFilter);
1609
+ if (running) return toolOrbState(running.toolName);
1610
+ if (message.toolCalls?.some((tc) => tc.status === "running")) {
1611
+ return "working";
1612
+ }
1613
+ if (message.status !== "streaming") return "working";
1614
+ if (message.content.length > 0) return "composing";
1615
+ if (message.reasoning && message.reasoning.length > 0) return "solving";
1616
+ return "working";
1617
+ }
1618
+ function deriveOrbActivity(messages, options = {}) {
1619
+ for (let i = messages.length - 1; i >= 0; i--) {
1620
+ const m = messages[i];
1621
+ if (!m) continue;
1622
+ if (m.role === "user") break;
1623
+ if (m.role !== "assistant") continue;
1624
+ const state = messageOrbState(m, options);
1625
+ return { state, label: ORB_STATE_LABELS[state] };
1626
+ }
1627
+ return { state: "working", label: ORB_STATE_LABELS.working };
1628
+ }
1629
+
1630
+ // src/runtime/simple-mode.ts
1631
+ var SIMPLE_MODE_HIDDEN_TOOLS = /* @__PURE__ */ new Set([
1632
+ "list_files",
1633
+ "search_files",
1634
+ "session_search",
1635
+ "skills_list",
1636
+ "skill_view",
1637
+ "skill_manage",
1638
+ "process",
1639
+ "memory",
1640
+ // Shell commands and code execution are infrastructure plumbing the
1641
+ // user doesn't need to see when the goal is to know *what* the
1642
+ // agent accomplished, not *how*. Expert mode still has the full
1643
+ // command + output block.
1644
+ "terminal",
1645
+ "execute_code"
1646
+ ]);
1647
+ function isHiddenSimpleTool(tc) {
1648
+ if (SIMPLE_MODE_HIDDEN_TOOLS.has(tc.toolName)) return true;
1649
+ if (tc.toolName.startsWith("browser_")) return true;
1650
+ return false;
1651
+ }
1652
+ var SIMPLE_MODE_ORB_OPTIONS = {
1653
+ toolFilter: (tc) => !isHiddenSimpleTool(tc)
1654
+ };
1522
1655
  function BrowserActivityGroup({ calls }) {
1523
1656
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 border border-line bg-card px-3 py-2 text-xs", children: [
1524
1657
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ZapIcon, { className: "size-3 shrink-0 text-amber-500", "aria-hidden": "true" }),
@@ -4196,7 +4329,34 @@ function AskUserQuestionToolBlock({ tc }) {
4196
4329
  () => questions.map((q, i) => buildAnswer(q, selections[i] ?? emptySelection())),
4197
4330
  [questions, selections]
4198
4331
  );
4199
- const allAnswered = answers.every((a) => a !== null);
4332
+ const answeredCount = answers.filter((a) => a !== null).length;
4333
+ const allAnswered = answeredCount === questions.length;
4334
+ const nextUnanswered = react.useCallback(
4335
+ (from) => {
4336
+ for (let step = 1; step < questions.length; step++) {
4337
+ const i = (from + step) % questions.length;
4338
+ if (answers[i] === null) return i;
4339
+ }
4340
+ return null;
4341
+ },
4342
+ [questions.length, answers]
4343
+ );
4344
+ const selectChoice = react.useCallback(
4345
+ (choiceIndex) => {
4346
+ const wasAnswered = answers[active] !== null;
4347
+ const copy = selections.slice();
4348
+ copy[active] = { index: choiceIndex, other: "" };
4349
+ setSelections(copy);
4350
+ if (wasAnswered) return;
4351
+ const next = nextUnanswered(active);
4352
+ if (next !== null) setActive(next);
4353
+ },
4354
+ [active, answers, selections, nextUnanswered]
4355
+ );
4356
+ const advance = react.useCallback(() => {
4357
+ const next = nextUnanswered(active);
4358
+ if (next !== null) setActive(next);
4359
+ }, [active, nextUnanswered]);
4200
4360
  const handleSubmit = react.useCallback(async () => {
4201
4361
  if (!sessionId || locked || submitting) return;
4202
4362
  if (!allAnswered) {
@@ -4274,7 +4434,7 @@ function AskUserQuestionToolBlock({ tc }) {
4274
4434
  "Question ",
4275
4435
  i + 1
4276
4436
  ] }),
4277
- answered && !isActive && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-1 text-[10px] text-emerald-500", children: "\u25CF" }),
4437
+ answered && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-1 text-[10px] text-emerald-500", children: "\u25CF" }),
4278
4438
  isActive && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute inset-x-0 bottom-0 h-px bg-foreground" })
4279
4439
  ]
4280
4440
  },
@@ -4300,7 +4460,7 @@ function AskUserQuestionToolBlock({ tc }) {
4300
4460
  {
4301
4461
  choice,
4302
4462
  selected: currentSel.index === i,
4303
- onSelect: () => updateSelection({ index: i })
4463
+ onSelect: () => selectChoice(i)
4304
4464
  },
4305
4465
  i
4306
4466
  )),
@@ -4310,32 +4470,50 @@ function AskUserQuestionToolBlock({ tc }) {
4310
4470
  selected: currentSel.index >= OTHER_INDEX_OFFSET,
4311
4471
  value: currentSel.other,
4312
4472
  onSelect: () => updateSelection({ index: OTHER_INDEX_OFFSET }),
4313
- onChange: (v) => updateSelection({ index: OTHER_INDEX_OFFSET, other: v })
4473
+ onChange: (v) => updateSelection({ index: OTHER_INDEX_OFFSET, other: v }),
4474
+ onCommit: () => {
4475
+ if (allAnswered) void handleSubmit();
4476
+ else advance();
4477
+ }
4314
4478
  }
4315
4479
  )
4316
4480
  ] }),
4317
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-t border-border px-3 py-2", children: [
4318
- /* @__PURE__ */ jsxRuntime.jsxs(
4481
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-3 border-t border-border px-3 py-2", children: [
4482
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 text-xs text-muted-foreground", children: [
4483
+ questions.length > 1 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "mr-2 tabular-nums", children: [
4484
+ answeredCount,
4485
+ " of ",
4486
+ questions.length,
4487
+ " answered"
4488
+ ] }),
4489
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground/70", children: "Esc to cancel" }),
4490
+ error && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-2 text-destructive", children: error })
4491
+ ] }),
4492
+ allAnswered || questions.length === 1 ? /* @__PURE__ */ jsxRuntime.jsx(
4319
4493
  "button",
4320
4494
  {
4321
4495
  type: "button",
4322
4496
  disabled: !allAnswered || submitting,
4323
4497
  onClick: () => void handleSubmit(),
4324
4498
  className: cn(
4325
- "w-full rounded border border-border px-2 py-1.5 text-left text-sm ",
4326
- "text-muted-foreground hover:bg-muted/40",
4327
- "disabled:cursor-not-allowed disabled:opacity-60"
4499
+ "shrink-0 rounded-md bg-primary px-4 py-1.5 text-sm font-medium text-primary-foreground transition-colors",
4500
+ "hover:bg-primary/80",
4501
+ "disabled:cursor-not-allowed disabled:opacity-50"
4328
4502
  ),
4329
- children: [
4330
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mr-2 text-muted-foreground/70", children: answers.filter((a) => a !== null).length }),
4331
- submitting ? "Submitting\u2026" : allAnswered ? "Submit answers" : `Answer ${questions.length - answers.filter((a) => a !== null).length} more to submit`
4332
- ]
4503
+ children: submitting ? "Submitting\u2026" : "Submit"
4333
4504
  }
4334
- ),
4335
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-1 flex items-center justify-between text-[10px] text-muted-foreground/70", children: [
4336
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Esc to cancel" }),
4337
- error && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-destructive", children: error })
4338
- ] })
4505
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
4506
+ "button",
4507
+ {
4508
+ type: "button",
4509
+ onClick: advance,
4510
+ className: cn(
4511
+ "shrink-0 rounded-md border border-border bg-muted/40 px-4 py-1.5 text-sm font-medium text-foreground transition-colors",
4512
+ "hover:bg-muted"
4513
+ ),
4514
+ children: "Next question \u2192"
4515
+ }
4516
+ )
4339
4517
  ] })
4340
4518
  ]
4341
4519
  }
@@ -4369,7 +4547,8 @@ function OtherRow({
4369
4547
  selected,
4370
4548
  value,
4371
4549
  onSelect,
4372
- onChange
4550
+ onChange,
4551
+ onCommit
4373
4552
  }) {
4374
4553
  return /* @__PURE__ */ jsxRuntime.jsxs(
4375
4554
  "div",
@@ -4398,6 +4577,12 @@ function OtherRow({
4398
4577
  value,
4399
4578
  onFocus: onSelect,
4400
4579
  onChange: (e) => onChange(e.target.value),
4580
+ onKeyDown: (e) => {
4581
+ if (e.key === "Enter" && !e.shiftKey && !e.nativeEvent.isComposing && value.trim()) {
4582
+ e.preventDefault();
4583
+ onCommit();
4584
+ }
4585
+ },
4401
4586
  className: "mt-0.5 h-7 px-0 text-xs"
4402
4587
  }
4403
4588
  )
@@ -5203,137 +5388,2430 @@ function InputGroupAddon({
5203
5388
  if (e.target.closest("button")) {
5204
5389
  return;
5205
5390
  }
5206
- e.currentTarget.parentElement?.querySelector("input")?.focus();
5391
+ e.currentTarget.parentElement?.querySelector("input")?.focus();
5392
+ },
5393
+ ...props
5394
+ }
5395
+ );
5396
+ }
5397
+ var inputGroupButtonVariants = classVarianceAuthority.cva(
5398
+ "flex items-center gap-2 rounded-none text-sm shadow-none",
5399
+ {
5400
+ variants: {
5401
+ size: {
5402
+ xs: "h-6 gap-1 rounded-none px-1.5 text-xs [&>svg:not([class*='size-'])]:size-3.5",
5403
+ sm: "",
5404
+ "icon-xs": "size-6 p-0 text-xs has-[>svg]:p-0",
5405
+ "icon-sm": "size-8 p-0 has-[>svg]:p-0"
5406
+ }
5407
+ },
5408
+ defaultVariants: {
5409
+ size: "xs"
5410
+ }
5411
+ }
5412
+ );
5413
+ function InputGroupButton({
5414
+ className,
5415
+ type = "button",
5416
+ variant = "ghost",
5417
+ size = "xs",
5418
+ ...props
5419
+ }) {
5420
+ return /* @__PURE__ */ jsxRuntime.jsx(
5421
+ Button,
5422
+ {
5423
+ type,
5424
+ "data-size": size,
5425
+ variant,
5426
+ className: cn(inputGroupButtonVariants({ size }), className),
5427
+ ...props
5428
+ }
5429
+ );
5430
+ }
5431
+ function InputGroupTextarea({
5432
+ className,
5433
+ ...props
5434
+ }) {
5435
+ return /* @__PURE__ */ jsxRuntime.jsx(
5436
+ Textarea,
5437
+ {
5438
+ "data-slot": "input-group-control",
5439
+ className: cn(
5440
+ "flex-1 resize-none border-0 bg-transparent py-2.5 ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent",
5441
+ className
5442
+ ),
5443
+ ...props
5444
+ }
5445
+ );
5446
+ }
5447
+ function Command({
5448
+ className,
5449
+ ...props
5450
+ }) {
5451
+ return /* @__PURE__ */ jsxRuntime.jsx(
5452
+ cmdk.Command,
5453
+ {
5454
+ "data-slot": "command",
5455
+ className: cn(
5456
+ "flex size-full flex-col overflow-hidden bg-popover text-popover-foreground",
5457
+ className
5458
+ ),
5459
+ ...props
5460
+ }
5461
+ );
5462
+ }
5463
+ function CommandList({
5464
+ className,
5465
+ ...props
5466
+ }) {
5467
+ return /* @__PURE__ */ jsxRuntime.jsx(
5468
+ cmdk.Command.List,
5469
+ {
5470
+ "data-slot": "command-list",
5471
+ className: cn(
5472
+ "no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none",
5473
+ className
5474
+ ),
5475
+ ...props
5476
+ }
5477
+ );
5478
+ }
5479
+ function CommandEmpty({
5480
+ className,
5481
+ ...props
5482
+ }) {
5483
+ return /* @__PURE__ */ jsxRuntime.jsx(
5484
+ cmdk.Command.Empty,
5485
+ {
5486
+ "data-slot": "command-empty",
5487
+ className: cn("py-6 text-center text-sm", className),
5488
+ ...props
5489
+ }
5490
+ );
5491
+ }
5492
+ function CommandItem({
5493
+ className,
5494
+ children,
5495
+ ...props
5496
+ }) {
5497
+ return /* @__PURE__ */ jsxRuntime.jsxs(
5498
+ cmdk.Command.Item,
5499
+ {
5500
+ "data-slot": "command-item",
5501
+ className: cn(
5502
+ "group/command-item relative flex cursor-default items-center gap-2 rounded-none px-3 py-2 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-muted data-[selected=true]:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 data-[selected=true]:*:[svg]:text-foreground",
5503
+ className
5504
+ ),
5505
+ ...props,
5506
+ children: [
5507
+ children,
5508
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckIcon, { className: "ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100" })
5509
+ ]
5510
+ }
5511
+ );
5512
+ }
5513
+
5514
+ // src/components/ui/spinner.tsx
5515
+ init_utils();
5516
+ function Spinner({ className, ...props }) {
5517
+ return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2Icon, { role: "status", "aria-label": "Loading", className: cn("size-4 animate-spin", className), ...props });
5518
+ }
5519
+
5520
+ // src/components/ai-elements/prompt-input.tsx
5521
+ init_utils();
5522
+
5523
+ // src/components/ui/border-beam/styles.ts
5524
+ var sizePresets = {
5525
+ sm: {
5526
+ borderRadius: 32,
5527
+ borderWidth: 1,
5528
+ width: 70,
5529
+ height: 36
5530
+ },
5531
+ md: {
5532
+ borderRadius: 16,
5533
+ borderWidth: 1
5534
+ },
5535
+ line: {
5536
+ borderRadius: 16,
5537
+ borderWidth: 1
5538
+ },
5539
+ "pulse-outside": {
5540
+ borderRadius: 16,
5541
+ borderWidth: 1
5542
+ },
5543
+ "pulse-inner": {
5544
+ borderRadius: 16,
5545
+ borderWidth: 1
5546
+ }
5547
+ };
5548
+ var sizeThemePresets = {
5549
+ sm: {
5550
+ dark: {
5551
+ strokeOpacity: 0.46,
5552
+ innerOpacity: 0.24,
5553
+ bloomOpacity: 0.38,
5554
+ innerShadow: "rgba(255, 255, 255, 0.3)",
5555
+ saturation: 1.2
5556
+ },
5557
+ light: {
5558
+ strokeOpacity: 0.12,
5559
+ innerOpacity: 0.3,
5560
+ bloomOpacity: 0.16,
5561
+ innerShadow: "rgba(0, 0, 0, 0.14)",
5562
+ saturation: 1.8
5563
+ }
5564
+ },
5565
+ md: {
5566
+ dark: {
5567
+ strokeOpacity: 0.26,
5568
+ innerOpacity: 0.42,
5569
+ bloomOpacity: 0.24,
5570
+ innerShadow: "rgba(255, 255, 255, 0.27)",
5571
+ saturation: 1.2
5572
+ },
5573
+ light: {
5574
+ strokeOpacity: 0.12,
5575
+ innerOpacity: 0.26,
5576
+ bloomOpacity: 0.34,
5577
+ innerShadow: "rgba(0, 0, 0, 0.14)",
5578
+ saturation: 1.5
5579
+ }
5580
+ },
5581
+ line: {
5582
+ dark: {
5583
+ strokeOpacity: 1.14,
5584
+ innerOpacity: 0.7,
5585
+ bloomOpacity: 0.8,
5586
+ innerShadow: "rgba(255, 255, 255, 0.1)",
5587
+ saturation: 1.2
5588
+ },
5589
+ light: {
5590
+ strokeOpacity: 0.16,
5591
+ innerOpacity: 0.32,
5592
+ bloomOpacity: 0.3,
5593
+ innerShadow: "rgba(0, 0, 0, 0.14)",
5594
+ saturation: 1.95
5595
+ }
5596
+ },
5597
+ // Pulse Outside — outward-blooming breathe (ported from v5 "Breathe Outside Uncropped" / c6)
5598
+ "pulse-outside": {
5599
+ dark: {
5600
+ strokeOpacity: 0.94,
5601
+ innerOpacity: 0.34,
5602
+ bloomOpacity: 0.3,
5603
+ innerShadow: "transparent",
5604
+ saturation: 1.2,
5605
+ brightness: 1.9,
5606
+ // v5 Card 5 frames the card with a single 1px hairline (its box-shadow at
5607
+ // 0.3). Wrapped components here already supply their own ~equivalent 1px
5608
+ // border, so the beam must NOT add a second hairline on top or the edge
5609
+ // reads brighter than v5. Kept at 0 to match v5's single-hairline look.
5610
+ hairlineOpacity: 0
5611
+ },
5612
+ light: {
5613
+ strokeOpacity: 1.96,
5614
+ innerOpacity: 1.04,
5615
+ bloomOpacity: 0.42,
5616
+ innerShadow: "transparent",
5617
+ saturation: 0.6,
5618
+ brightness: 1.7,
5619
+ hairlineOpacity: 0
5620
+ }
5621
+ },
5622
+ // Pulse Inner — contained breathe (ported from v5 "Breathe" / c4)
5623
+ "pulse-inner": {
5624
+ dark: {
5625
+ strokeOpacity: 1.54,
5626
+ innerOpacity: 0.44,
5627
+ bloomOpacity: 0.66,
5628
+ innerShadow: "transparent",
5629
+ saturation: 1.2,
5630
+ brightness: 0.75
5631
+ },
5632
+ light: {
5633
+ strokeOpacity: 0.32,
5634
+ innerOpacity: 0.4,
5635
+ bloomOpacity: 0.8,
5636
+ innerShadow: "transparent",
5637
+ saturation: 0.75,
5638
+ brightness: 1.3
5639
+ }
5640
+ }
5641
+ };
5642
+ var colorPalettes = {
5643
+ colorful: {
5644
+ border: [
5645
+ { color: "rgb(255, 50, 100)", pos: "33% -7.4%", size: "70px 40px" },
5646
+ { color: "rgb(40, 140, 255)", pos: "12% -5%", size: "60px 35px" },
5647
+ { color: "rgb(50, 200, 80)", pos: "2.1% 68.3%", size: "40px 70px" },
5648
+ { color: "rgb(30, 185, 170)", pos: "2.1% 68.3%", size: "20px 35px" },
5649
+ { color: "rgb(100, 70, 255)", pos: "74.4% 100%", size: "180px 32px" },
5650
+ { color: "rgb(40, 140, 255)", pos: "55% 100%", size: "85px 26px" },
5651
+ { color: "rgb(255, 120, 40)", pos: "93.9% 0%", size: "74px 32px" },
5652
+ { color: "rgb(240, 50, 180)", pos: "100% 27.1%", size: "26px 42px" },
5653
+ { color: "rgb(180, 40, 240)", pos: "100% 27.1%", size: "52px 48px" }
5654
+ ],
5655
+ spike: { primary: "rgb(255, 60, 80)", secondary: "rgba(40, 190, 180, 0.98)" },
5656
+ spikeLt: { primary: "rgb(200, 30, 60)", secondary: "rgb(20, 150, 140)" }
5657
+ },
5658
+ mono: {
5659
+ border: [
5660
+ { color: "rgb(180, 180, 180)", pos: "33% -7.4%", size: "70px 40px" },
5661
+ { color: "rgb(140, 140, 140)", pos: "12% -5%", size: "60px 35px" },
5662
+ { color: "rgb(160, 160, 160)", pos: "2.1% 68.3%", size: "40px 70px" },
5663
+ { color: "rgb(130, 130, 130)", pos: "2.1% 68.3%", size: "20px 35px" },
5664
+ { color: "rgb(170, 170, 170)", pos: "74.4% 100%", size: "180px 32px" },
5665
+ { color: "rgb(150, 150, 150)", pos: "55% 100%", size: "85px 26px" },
5666
+ { color: "rgb(190, 190, 190)", pos: "93.9% 0%", size: "74px 32px" },
5667
+ { color: "rgb(145, 145, 145)", pos: "100% 27.1%", size: "26px 42px" },
5668
+ { color: "rgb(165, 165, 165)", pos: "100% 27.1%", size: "52px 48px" }
5669
+ ],
5670
+ spike: { primary: "rgb(200, 200, 200)", secondary: "rgb(170, 170, 170)" },
5671
+ spikeLt: { primary: "rgb(80, 80, 80)", secondary: "rgb(120, 120, 120)" }
5672
+ },
5673
+ ocean: {
5674
+ border: [
5675
+ { color: "rgb(100, 80, 220)", pos: "33% -7.4%", size: "70px 40px" },
5676
+ { color: "rgb(60, 120, 255)", pos: "12% -5%", size: "60px 35px" },
5677
+ { color: "rgb(80, 100, 200)", pos: "2.1% 68.3%", size: "40px 70px" },
5678
+ { color: "rgb(50, 140, 220)", pos: "2.1% 68.3%", size: "20px 35px" },
5679
+ { color: "rgb(120, 80, 255)", pos: "74.4% 100%", size: "180px 32px" },
5680
+ { color: "rgb(70, 130, 255)", pos: "55% 100%", size: "85px 26px" },
5681
+ { color: "rgb(140, 100, 240)", pos: "93.9% 0%", size: "74px 32px" },
5682
+ { color: "rgb(90, 110, 230)", pos: "100% 27.1%", size: "26px 42px" },
5683
+ { color: "rgb(130, 70, 255)", pos: "100% 27.1%", size: "52px 48px" }
5684
+ ],
5685
+ spike: { primary: "rgb(100, 120, 255)", secondary: "rgba(130, 100, 220, 0.98)" },
5686
+ spikeLt: { primary: "rgb(60, 60, 180)", secondary: "rgb(80, 100, 200)" }
5687
+ },
5688
+ sunset: {
5689
+ border: [
5690
+ { color: "rgb(255, 80, 50)", pos: "33% -7.4%", size: "70px 40px" },
5691
+ { color: "rgb(255, 160, 40)", pos: "12% -5%", size: "60px 35px" },
5692
+ { color: "rgb(255, 120, 60)", pos: "2.1% 68.3%", size: "40px 70px" },
5693
+ { color: "rgb(255, 200, 50)", pos: "2.1% 68.3%", size: "20px 35px" },
5694
+ { color: "rgb(255, 100, 80)", pos: "74.4% 100%", size: "180px 32px" },
5695
+ { color: "rgb(255, 180, 60)", pos: "55% 100%", size: "85px 26px" },
5696
+ { color: "rgb(255, 60, 60)", pos: "93.9% 0%", size: "74px 32px" },
5697
+ { color: "rgb(255, 140, 50)", pos: "100% 27.1%", size: "26px 42px" },
5698
+ { color: "rgb(255, 90, 70)", pos: "100% 27.1%", size: "52px 48px" }
5699
+ ],
5700
+ spike: { primary: "rgb(255, 140, 80)", secondary: "rgba(255, 100, 60, 0.98)" },
5701
+ spikeLt: { primary: "rgb(200, 80, 40)", secondary: "rgb(220, 120, 30)" }
5702
+ },
5703
+ brand: {
5704
+ border: [
5705
+ { color: "rgb(217, 119, 6)", pos: "33% -7.4%", size: "70px 40px" },
5706
+ { color: "rgb(245, 158, 11)", pos: "12% -5%", size: "60px 35px" },
5707
+ { color: "rgb(234, 138, 9)", pos: "2.1% 68.3%", size: "40px 70px" },
5708
+ { color: "rgb(252, 211, 77)", pos: "2.1% 68.3%", size: "20px 35px" },
5709
+ { color: "rgb(245, 158, 11)", pos: "74.4% 100%", size: "180px 32px" },
5710
+ { color: "rgb(251, 191, 36)", pos: "55% 100%", size: "85px 26px" },
5711
+ { color: "rgb(217, 119, 6)", pos: "93.9% 0%", size: "74px 32px" },
5712
+ { color: "rgb(251, 191, 36)", pos: "100% 27.1%", size: "26px 42px" },
5713
+ { color: "rgb(245, 158, 11)", pos: "100% 27.1%", size: "52px 48px" }
5714
+ ],
5715
+ spike: { primary: "rgb(251, 191, 36)", secondary: "rgba(245, 158, 11, 0.98)" },
5716
+ spikeLt: { primary: "rgb(180, 83, 9)", secondary: "rgb(202, 138, 4)" }
5717
+ }
5718
+ };
5719
+ var smallColorPalettes = {
5720
+ colorful: {
5721
+ border: [
5722
+ { color: "rgb(50, 200, 80)", pos: "2% 68%", size: "9px 18px" },
5723
+ { color: "rgb(30, 185, 170)", pos: "2% 68%", size: "4px 8px" },
5724
+ { color: "rgb(255, 120, 40)", pos: "72% -3%", size: "59px 9px" },
5725
+ { color: "rgb(100, 70, 255)", pos: "74% 100%", size: "42px 7px" },
5726
+ { color: "rgb(240, 50, 180)", pos: "100% 27%", size: "10px 17px" },
5727
+ { color: "rgb(180, 40, 240)", pos: "100% 27%", size: "10px 18px" },
5728
+ { color: "rgb(40, 140, 255)", pos: "100% 27%", size: "5px 10px" },
5729
+ { color: "rgb(255, 50, 100)", pos: "100% 27%", size: "11px 12px" }
5730
+ ],
5731
+ inner: [
5732
+ { color: "rgba(50, 200, 80, 0.5)", pos: "2% 68%", size: "9px 18px" },
5733
+ { color: "rgba(30, 185, 170, 0.45)", pos: "2% 68%", size: "4px 8px" },
5734
+ { color: "rgba(255, 120, 40, 0.35)", pos: "72% -3%", size: "59px 9px" },
5735
+ { color: "rgba(100, 70, 255, 0.35)", pos: "74% 100%", size: "42px 7px" },
5736
+ { color: "rgba(240, 50, 180, 0.3)", pos: "100% 27%", size: "10px 17px" },
5737
+ { color: "rgba(180, 40, 240, 0.4)", pos: "100% 27%", size: "10px 18px" },
5738
+ { color: "rgba(40, 140, 255, 0.3)", pos: "100% 27%", size: "5px 10px" },
5739
+ { color: "rgba(255, 50, 100, 0.3)", pos: "100% 27%", size: "11px 12px" }
5740
+ ]
5741
+ },
5742
+ mono: {
5743
+ border: [
5744
+ { color: "rgb(160, 160, 160)", pos: "2% 68%", size: "9px 18px" },
5745
+ { color: "rgb(140, 140, 140)", pos: "2% 68%", size: "4px 8px" },
5746
+ { color: "rgb(180, 180, 180)", pos: "72% -3%", size: "59px 9px" },
5747
+ { color: "rgb(150, 150, 150)", pos: "74% 100%", size: "42px 7px" },
5748
+ { color: "rgb(170, 170, 170)", pos: "100% 27%", size: "10px 17px" },
5749
+ { color: "rgb(155, 155, 155)", pos: "100% 27%", size: "10px 18px" },
5750
+ { color: "rgb(145, 145, 145)", pos: "100% 27%", size: "5px 10px" },
5751
+ { color: "rgb(165, 165, 165)", pos: "100% 27%", size: "11px 12px" }
5752
+ ],
5753
+ inner: [
5754
+ { color: "rgba(160, 160, 160, 0.25)", pos: "2% 68%", size: "9px 18px" },
5755
+ { color: "rgba(140, 140, 140, 0.22)", pos: "2% 68%", size: "4px 8px" },
5756
+ { color: "rgba(180, 180, 180, 0.17)", pos: "72% -3%", size: "59px 9px" },
5757
+ { color: "rgba(150, 150, 150, 0.17)", pos: "74% 100%", size: "42px 7px" },
5758
+ { color: "rgba(170, 170, 170, 0.15)", pos: "100% 27%", size: "10px 17px" },
5759
+ { color: "rgba(155, 155, 155, 0.20)", pos: "100% 27%", size: "10px 18px" },
5760
+ { color: "rgba(145, 145, 145, 0.15)", pos: "100% 27%", size: "5px 10px" },
5761
+ { color: "rgba(165, 165, 165, 0.15)", pos: "100% 27%", size: "11px 12px" }
5762
+ ]
5763
+ },
5764
+ ocean: {
5765
+ border: [
5766
+ { color: "rgb(60, 140, 200)", pos: "2% 68%", size: "9px 18px" },
5767
+ { color: "rgb(50, 120, 180)", pos: "2% 68%", size: "4px 8px" },
5768
+ { color: "rgb(100, 80, 220)", pos: "72% -3%", size: "59px 9px" },
5769
+ { color: "rgb(80, 100, 255)", pos: "74% 100%", size: "42px 7px" },
5770
+ { color: "rgb(120, 70, 240)", pos: "100% 27%", size: "10px 17px" },
5771
+ { color: "rgb(90, 80, 220)", pos: "100% 27%", size: "10px 18px" },
5772
+ { color: "rgb(70, 110, 255)", pos: "100% 27%", size: "5px 10px" },
5773
+ { color: "rgb(110, 90, 230)", pos: "100% 27%", size: "11px 12px" }
5774
+ ],
5775
+ inner: [
5776
+ { color: "rgba(60, 140, 200, 0.5)", pos: "2% 68%", size: "9px 18px" },
5777
+ { color: "rgba(50, 120, 180, 0.45)", pos: "2% 68%", size: "4px 8px" },
5778
+ { color: "rgba(100, 80, 220, 0.35)", pos: "72% -3%", size: "59px 9px" },
5779
+ { color: "rgba(80, 100, 255, 0.35)", pos: "74% 100%", size: "42px 7px" },
5780
+ { color: "rgba(120, 70, 240, 0.3)", pos: "100% 27%", size: "10px 17px" },
5781
+ { color: "rgba(90, 80, 220, 0.4)", pos: "100% 27%", size: "10px 18px" },
5782
+ { color: "rgba(70, 110, 255, 0.3)", pos: "100% 27%", size: "5px 10px" },
5783
+ { color: "rgba(110, 90, 230, 0.3)", pos: "100% 27%", size: "11px 12px" }
5784
+ ]
5785
+ },
5786
+ sunset: {
5787
+ border: [
5788
+ { color: "rgb(255, 180, 50)", pos: "2% 68%", size: "9px 18px" },
5789
+ { color: "rgb(255, 150, 40)", pos: "2% 68%", size: "4px 8px" },
5790
+ { color: "rgb(255, 80, 60)", pos: "72% -3%", size: "59px 9px" },
5791
+ { color: "rgb(255, 100, 80)", pos: "74% 100%", size: "42px 7px" },
5792
+ { color: "rgb(255, 60, 80)", pos: "100% 27%", size: "10px 17px" },
5793
+ { color: "rgb(255, 120, 60)", pos: "100% 27%", size: "10px 18px" },
5794
+ { color: "rgb(255, 200, 50)", pos: "100% 27%", size: "5px 10px" },
5795
+ { color: "rgb(255, 90, 70)", pos: "100% 27%", size: "11px 12px" }
5796
+ ],
5797
+ inner: [
5798
+ { color: "rgba(255, 180, 50, 0.5)", pos: "2% 68%", size: "9px 18px" },
5799
+ { color: "rgba(255, 150, 40, 0.45)", pos: "2% 68%", size: "4px 8px" },
5800
+ { color: "rgba(255, 80, 60, 0.35)", pos: "72% -3%", size: "59px 9px" },
5801
+ { color: "rgba(255, 100, 80, 0.35)", pos: "74% 100%", size: "42px 7px" },
5802
+ { color: "rgba(255, 60, 80, 0.3)", pos: "100% 27%", size: "10px 17px" },
5803
+ { color: "rgba(255, 120, 60, 0.4)", pos: "100% 27%", size: "10px 18px" },
5804
+ { color: "rgba(255, 200, 50, 0.3)", pos: "100% 27%", size: "5px 10px" },
5805
+ { color: "rgba(255, 90, 70, 0.3)", pos: "100% 27%", size: "11px 12px" }
5806
+ ]
5807
+ },
5808
+ brand: {
5809
+ border: [
5810
+ { color: "rgb(251, 191, 36)", pos: "2% 68%", size: "9px 18px" },
5811
+ { color: "rgb(245, 158, 11)", pos: "2% 68%", size: "4px 8px" },
5812
+ { color: "rgb(217, 119, 6)", pos: "72% -3%", size: "59px 9px" },
5813
+ { color: "rgb(245, 158, 11)", pos: "74% 100%", size: "42px 7px" },
5814
+ { color: "rgb(217, 119, 6)", pos: "100% 27%", size: "10px 17px" },
5815
+ { color: "rgb(245, 158, 11)", pos: "100% 27%", size: "10px 18px" },
5816
+ { color: "rgb(252, 211, 77)", pos: "100% 27%", size: "5px 10px" },
5817
+ { color: "rgb(251, 191, 36)", pos: "100% 27%", size: "11px 12px" }
5818
+ ],
5819
+ inner: [
5820
+ { color: "rgba(251, 191, 36, 0.5)", pos: "2% 68%", size: "9px 18px" },
5821
+ { color: "rgba(245, 158, 11, 0.45)", pos: "2% 68%", size: "4px 8px" },
5822
+ { color: "rgba(217, 119, 6, 0.35)", pos: "72% -3%", size: "59px 9px" },
5823
+ { color: "rgba(245, 158, 11, 0.35)", pos: "74% 100%", size: "42px 7px" },
5824
+ { color: "rgba(217, 119, 6, 0.3)", pos: "100% 27%", size: "10px 17px" },
5825
+ { color: "rgba(245, 158, 11, 0.4)", pos: "100% 27%", size: "10px 18px" },
5826
+ { color: "rgba(252, 211, 77, 0.3)", pos: "100% 27%", size: "5px 10px" },
5827
+ { color: "rgba(251, 191, 36, 0.3)", pos: "100% 27%", size: "11px 12px" }
5828
+ ]
5829
+ }
5830
+ };
5831
+ function getSmallColorGradients(colorVariant) {
5832
+ const palette = smallColorPalettes[colorVariant];
5833
+ return palette.border.map((c) => `radial-gradient(ellipse ${c.size} at ${c.pos}, ${c.color}, transparent)`).join(",\n ");
5834
+ }
5835
+ function getSmallInnerGradients(colorVariant) {
5836
+ const palette = smallColorPalettes[colorVariant];
5837
+ return palette.inner.map((c) => `radial-gradient(ellipse ${c.size} at ${c.pos}, ${c.color}, transparent)`).join(",\n ");
5838
+ }
5839
+ function getColorGradients(colorVariant) {
5840
+ const palette = colorPalettes[colorVariant];
5841
+ return palette.border.map((c) => `radial-gradient(ellipse ${c.size} at ${c.pos}, ${c.color}, transparent)`).join(",\n ");
5842
+ }
5843
+ function getInnerGradients(colorVariant) {
5844
+ const palette = colorPalettes[colorVariant];
5845
+ const baseOpacity = colorVariant === "mono" ? 0.225 : 0.45;
5846
+ return palette.border.map((c) => {
5847
+ const rgba = c.color.replace("rgb(", "rgba(").replace(")", `, ${baseOpacity})`);
5848
+ const smallerSize = c.size.split(" ").map((s) => {
5849
+ const val = parseInt(s);
5850
+ return `${Math.round(val * 0.9)}px`;
5851
+ }).join(" ");
5852
+ return `radial-gradient(ellipse ${smallerSize} at ${c.pos}, ${rgba}, transparent)`;
5853
+ }).join(",\n ");
5854
+ }
5855
+ function getSpikeColors(colorVariant, isDark) {
5856
+ const palette = colorPalettes[colorVariant];
5857
+ return isDark ? palette.spike : palette.spikeLt;
5858
+ }
5859
+ var lineColorPalettes = {
5860
+ colorful: {
5861
+ dark: [
5862
+ { color: "rgb(255, 50, 100)", sizeW: 36, sizeH: 36, offsetX: 0, offsetY: 2 },
5863
+ { color: "rgb(40, 180, 220)", sizeW: 30, sizeH: 32, offsetX: 39, offsetY: 0 },
5864
+ { color: "rgb(50, 200, 80)", sizeW: 33, sizeH: 28, offsetX: -36, offsetY: 2 },
5865
+ { color: "rgb(180, 40, 240)", sizeW: 29, sizeH: 34, offsetX: -54, offsetY: 0 },
5866
+ { color: "rgb(255, 160, 30)", sizeW: 27, sizeH: 30, offsetX: 51, offsetY: -1 },
5867
+ { color: "rgb(100, 70, 255)", sizeW: 36, sizeH: 24, offsetX: 21, offsetY: 1 },
5868
+ { color: "rgb(40, 140, 255)", sizeW: 30, sizeH: 22, offsetX: -21, offsetY: 0 },
5869
+ { color: "rgb(240, 50, 180)", sizeW: 25, sizeH: 28, offsetX: 66, offsetY: 1 },
5870
+ { color: "rgb(30, 185, 170)", sizeW: 23, sizeH: 30, offsetX: -66, offsetY: -1 }
5871
+ ],
5872
+ light: [
5873
+ { color: "rgb(255, 50, 100)", sizeW: 45, sizeH: 36, offsetX: 0, offsetY: 2 },
5874
+ { color: "rgb(40, 140, 255)", sizeW: 35, sizeH: 32, offsetX: 65, offsetY: 0 },
5875
+ { color: "rgb(50, 200, 80)", sizeW: 40, sizeH: 28, offsetX: -60, offsetY: 2 },
5876
+ { color: "rgb(180, 40, 240)", sizeW: 35, sizeH: 34, offsetX: -90, offsetY: 0 },
5877
+ { color: "rgb(30, 185, 170)", sizeW: 38, sizeH: 30, offsetX: 85, offsetY: -1 },
5878
+ { color: "rgb(100, 70, 255)", sizeW: 50, sizeH: 24, offsetX: 35, offsetY: 1 },
5879
+ { color: "rgb(40, 140, 255)", sizeW: 40, sizeH: 22, offsetX: -35, offsetY: 0 },
5880
+ { color: "rgb(255, 120, 40)", sizeW: 35, sizeH: 28, offsetX: 110, offsetY: 1 },
5881
+ { color: "rgb(240, 50, 180)", sizeW: 30, sizeH: 30, offsetX: -110, offsetY: -1 }
5882
+ ]
5883
+ },
5884
+ mono: {
5885
+ dark: [
5886
+ { color: "rgb(200, 200, 200)", sizeW: 36, sizeH: 36, offsetX: 0, offsetY: 2 },
5887
+ { color: "rgb(170, 170, 170)", sizeW: 30, sizeH: 32, offsetX: 39, offsetY: 0 },
5888
+ { color: "rgb(155, 155, 155)", sizeW: 33, sizeH: 28, offsetX: -36, offsetY: 2 },
5889
+ { color: "rgb(185, 185, 185)", sizeW: 29, sizeH: 34, offsetX: -54, offsetY: 0 },
5890
+ { color: "rgb(165, 165, 165)", sizeW: 27, sizeH: 30, offsetX: 51, offsetY: -1 },
5891
+ { color: "rgb(180, 180, 180)", sizeW: 36, sizeH: 24, offsetX: 21, offsetY: 1 },
5892
+ { color: "rgb(160, 160, 160)", sizeW: 30, sizeH: 22, offsetX: -21, offsetY: 0 },
5893
+ { color: "rgb(175, 175, 175)", sizeW: 25, sizeH: 28, offsetX: 66, offsetY: 1 },
5894
+ { color: "rgb(190, 190, 190)", sizeW: 23, sizeH: 30, offsetX: -66, offsetY: -1 }
5895
+ ],
5896
+ light: [
5897
+ { color: "rgb(100, 100, 100)", sizeW: 45, sizeH: 36, offsetX: 0, offsetY: 2 },
5898
+ { color: "rgb(80, 80, 80)", sizeW: 35, sizeH: 32, offsetX: 65, offsetY: 0 },
5899
+ { color: "rgb(90, 90, 90)", sizeW: 40, sizeH: 28, offsetX: -60, offsetY: 2 },
5900
+ { color: "rgb(70, 70, 70)", sizeW: 35, sizeH: 34, offsetX: -90, offsetY: 0 },
5901
+ { color: "rgb(85, 85, 85)", sizeW: 38, sizeH: 30, offsetX: 85, offsetY: -1 },
5902
+ { color: "rgb(95, 95, 95)", sizeW: 50, sizeH: 24, offsetX: 35, offsetY: 1 },
5903
+ { color: "rgb(75, 75, 75)", sizeW: 40, sizeH: 22, offsetX: -35, offsetY: 0 },
5904
+ { color: "rgb(105, 105, 105)", sizeW: 35, sizeH: 28, offsetX: 110, offsetY: 1 },
5905
+ { color: "rgb(65, 65, 65)", sizeW: 30, sizeH: 30, offsetX: -110, offsetY: -1 }
5906
+ ]
5907
+ },
5908
+ ocean: {
5909
+ dark: [
5910
+ { color: "rgb(100, 80, 220)", sizeW: 36, sizeH: 36, offsetX: 0, offsetY: 2 },
5911
+ { color: "rgb(60, 120, 255)", sizeW: 30, sizeH: 32, offsetX: 39, offsetY: 0 },
5912
+ { color: "rgb(80, 100, 200)", sizeW: 33, sizeH: 28, offsetX: -36, offsetY: 2 },
5913
+ { color: "rgb(130, 70, 255)", sizeW: 29, sizeH: 34, offsetX: -54, offsetY: 0 },
5914
+ { color: "rgb(70, 130, 255)", sizeW: 27, sizeH: 30, offsetX: 51, offsetY: -1 },
5915
+ { color: "rgb(120, 80, 255)", sizeW: 36, sizeH: 24, offsetX: 21, offsetY: 1 },
5916
+ { color: "rgb(90, 110, 230)", sizeW: 30, sizeH: 22, offsetX: -21, offsetY: 0 },
5917
+ { color: "rgb(110, 90, 240)", sizeW: 25, sizeH: 28, offsetX: 66, offsetY: 1 },
5918
+ { color: "rgb(140, 100, 255)", sizeW: 23, sizeH: 30, offsetX: -66, offsetY: -1 }
5919
+ ],
5920
+ light: [
5921
+ { color: "rgb(80, 60, 200)", sizeW: 45, sizeH: 36, offsetX: 0, offsetY: 2 },
5922
+ { color: "rgb(50, 100, 220)", sizeW: 35, sizeH: 32, offsetX: 65, offsetY: 0 },
5923
+ { color: "rgb(70, 90, 190)", sizeW: 40, sizeH: 28, offsetX: -60, offsetY: 2 },
5924
+ { color: "rgb(110, 60, 220)", sizeW: 35, sizeH: 34, offsetX: -90, offsetY: 0 },
5925
+ { color: "rgb(60, 110, 230)", sizeW: 38, sizeH: 30, offsetX: 85, offsetY: -1 },
5926
+ { color: "rgb(100, 70, 240)", sizeW: 50, sizeH: 24, offsetX: 35, offsetY: 1 },
5927
+ { color: "rgb(80, 100, 210)", sizeW: 40, sizeH: 22, offsetX: -35, offsetY: 0 },
5928
+ { color: "rgb(90, 80, 225)", sizeW: 35, sizeH: 28, offsetX: 110, offsetY: 1 },
5929
+ { color: "rgb(120, 90, 245)", sizeW: 30, sizeH: 30, offsetX: -110, offsetY: -1 }
5930
+ ]
5931
+ },
5932
+ sunset: {
5933
+ dark: [
5934
+ { color: "rgb(255, 100, 60)", sizeW: 36, sizeH: 36, offsetX: 0, offsetY: 2 },
5935
+ { color: "rgb(255, 180, 50)", sizeW: 30, sizeH: 32, offsetX: 39, offsetY: 0 },
5936
+ { color: "rgb(255, 140, 70)", sizeW: 33, sizeH: 28, offsetX: -36, offsetY: 2 },
5937
+ { color: "rgb(255, 80, 80)", sizeW: 29, sizeH: 34, offsetX: -54, offsetY: 0 },
5938
+ { color: "rgb(255, 200, 60)", sizeW: 27, sizeH: 30, offsetX: 51, offsetY: -1 },
5939
+ { color: "rgb(255, 120, 50)", sizeW: 36, sizeH: 24, offsetX: 21, offsetY: 1 },
5940
+ { color: "rgb(255, 160, 80)", sizeW: 30, sizeH: 22, offsetX: -21, offsetY: 0 },
5941
+ { color: "rgb(255, 90, 60)", sizeW: 25, sizeH: 28, offsetX: 66, offsetY: 1 },
5942
+ { color: "rgb(255, 70, 70)", sizeW: 23, sizeH: 30, offsetX: -66, offsetY: -1 }
5943
+ ],
5944
+ light: [
5945
+ { color: "rgb(220, 80, 40)", sizeW: 45, sizeH: 36, offsetX: 0, offsetY: 2 },
5946
+ { color: "rgb(230, 150, 30)", sizeW: 35, sizeH: 32, offsetX: 65, offsetY: 0 },
5947
+ { color: "rgb(210, 110, 50)", sizeW: 40, sizeH: 28, offsetX: -60, offsetY: 2 },
5948
+ { color: "rgb(200, 60, 60)", sizeW: 35, sizeH: 34, offsetX: -90, offsetY: 0 },
5949
+ { color: "rgb(220, 170, 40)", sizeW: 38, sizeH: 30, offsetX: 85, offsetY: -1 },
5950
+ { color: "rgb(210, 100, 30)", sizeW: 50, sizeH: 24, offsetX: 35, offsetY: 1 },
5951
+ { color: "rgb(230, 130, 60)", sizeW: 40, sizeH: 22, offsetX: -35, offsetY: 0 },
5952
+ { color: "rgb(190, 70, 50)", sizeW: 35, sizeH: 28, offsetX: 110, offsetY: 1 },
5953
+ { color: "rgb(180, 50, 50)", sizeW: 30, sizeH: 30, offsetX: -110, offsetY: -1 }
5954
+ ]
5955
+ },
5956
+ brand: {
5957
+ dark: [
5958
+ { color: "rgb(245, 158, 11)", sizeW: 36, sizeH: 36, offsetX: 0, offsetY: 2 },
5959
+ { color: "rgb(251, 191, 36)", sizeW: 30, sizeH: 32, offsetX: 39, offsetY: 0 },
5960
+ { color: "rgb(245, 158, 11)", sizeW: 33, sizeH: 28, offsetX: -36, offsetY: 2 },
5961
+ { color: "rgb(217, 119, 6)", sizeW: 29, sizeH: 34, offsetX: -54, offsetY: 0 },
5962
+ { color: "rgb(252, 211, 77)", sizeW: 27, sizeH: 30, offsetX: 51, offsetY: -1 },
5963
+ { color: "rgb(234, 138, 9)", sizeW: 36, sizeH: 24, offsetX: 21, offsetY: 1 },
5964
+ { color: "rgb(251, 191, 36)", sizeW: 30, sizeH: 22, offsetX: -21, offsetY: 0 },
5965
+ { color: "rgb(217, 119, 6)", sizeW: 25, sizeH: 28, offsetX: 66, offsetY: 1 },
5966
+ { color: "rgb(245, 158, 11)", sizeW: 23, sizeH: 30, offsetX: -66, offsetY: -1 }
5967
+ ],
5968
+ light: [
5969
+ { color: "rgb(180, 83, 9)", sizeW: 45, sizeH: 36, offsetX: 0, offsetY: 2 },
5970
+ { color: "rgb(202, 138, 4)", sizeW: 35, sizeH: 32, offsetX: 65, offsetY: 0 },
5971
+ { color: "rgb(180, 83, 9)", sizeW: 40, sizeH: 28, offsetX: -60, offsetY: 2 },
5972
+ { color: "rgb(146, 64, 14)", sizeW: 35, sizeH: 34, offsetX: -90, offsetY: 0 },
5973
+ { color: "rgb(202, 138, 4)", sizeW: 38, sizeH: 30, offsetX: 85, offsetY: -1 },
5974
+ { color: "rgb(161, 98, 7)", sizeW: 50, sizeH: 24, offsetX: 35, offsetY: 1 },
5975
+ { color: "rgb(202, 138, 4)", sizeW: 40, sizeH: 22, offsetX: -35, offsetY: 0 },
5976
+ { color: "rgb(146, 64, 14)", sizeW: 35, sizeH: 28, offsetX: 110, offsetY: 1 },
5977
+ { color: "rgb(180, 83, 9)", sizeW: 30, sizeH: 30, offsetX: -110, offsetY: -1 }
5978
+ ]
5979
+ }
5980
+ };
5981
+ function getLineColorGradients(colorVariant, isDark, id) {
5982
+ const palette = lineColorPalettes[colorVariant][isDark ? "dark" : "light"];
5983
+ return palette.map((c) => {
5984
+ const offsetXStr = c.offsetX === 0 ? "" : c.offsetX > 0 ? ` + ${c.offsetX}px` : ` - ${Math.abs(c.offsetX)}px`;
5985
+ const offsetYStr = c.offsetY === 0 ? "" : c.offsetY > 0 ? ` + ${c.offsetY}px` : ` - ${Math.abs(c.offsetY)}px`;
5986
+ return `radial-gradient(ellipse calc(${c.sizeW}px * var(--beam-w-${id})) calc(${c.sizeH}px * var(--beam-h-${id})) at calc(var(--beam-x-${id}) * 100%${offsetXStr}) calc(100%${offsetYStr}), ${c.color}, transparent)`;
5987
+ }).join(",\n ");
5988
+ }
5989
+ var lineInnerGradientData = {
5990
+ colorful: [
5991
+ { color: "rgba(255, 50, 100, 0.48)", sizeW: 33, sizeH: 30, offsetX: 0, offsetY: 0 },
5992
+ { color: "rgba(40, 180, 220, 0.42)", sizeW: 24, sizeH: 26, offsetX: 39, offsetY: -3 },
5993
+ { color: "rgba(50, 200, 80, 0.48)", sizeW: 27, sizeH: 24, offsetX: -36, offsetY: 0 },
5994
+ { color: "rgba(180, 40, 240, 0.42)", sizeW: 23, sizeH: 28, offsetX: -54, offsetY: -2 },
5995
+ { color: "rgba(255, 160, 30, 0.50)", sizeW: 24, sizeH: 24, offsetX: 51, offsetY: -1 },
5996
+ { color: "rgba(100, 70, 255, 0.45)", sizeW: 30, sizeH: 20, offsetX: 21, offsetY: 0 },
5997
+ { color: "rgba(40, 140, 255, 0.40)", sizeW: 25, sizeH: 18, offsetX: -21, offsetY: -2 },
5998
+ { color: "rgba(240, 50, 180, 0.45)", sizeW: 21, sizeH: 24, offsetX: 66, offsetY: 0 },
5999
+ { color: "rgba(30, 185, 170, 0.52)", sizeW: 18, sizeH: 26, offsetX: -66, offsetY: -1 }
6000
+ ],
6001
+ mono: [
6002
+ { color: "rgba(200, 200, 200, 0.48)", sizeW: 33, sizeH: 30, offsetX: 0, offsetY: 0 },
6003
+ { color: "rgba(170, 170, 170, 0.42)", sizeW: 24, sizeH: 26, offsetX: 39, offsetY: -3 },
6004
+ { color: "rgba(155, 155, 155, 0.48)", sizeW: 27, sizeH: 24, offsetX: -36, offsetY: 0 },
6005
+ { color: "rgba(185, 185, 185, 0.42)", sizeW: 23, sizeH: 28, offsetX: -54, offsetY: -2 },
6006
+ { color: "rgba(165, 165, 165, 0.50)", sizeW: 24, sizeH: 24, offsetX: 51, offsetY: -1 },
6007
+ { color: "rgba(180, 180, 180, 0.45)", sizeW: 30, sizeH: 20, offsetX: 21, offsetY: 0 },
6008
+ { color: "rgba(160, 160, 160, 0.40)", sizeW: 25, sizeH: 18, offsetX: -21, offsetY: -2 },
6009
+ { color: "rgba(175, 175, 175, 0.45)", sizeW: 21, sizeH: 24, offsetX: 66, offsetY: 0 },
6010
+ { color: "rgba(190, 190, 190, 0.52)", sizeW: 18, sizeH: 26, offsetX: -66, offsetY: -1 }
6011
+ ],
6012
+ ocean: [
6013
+ { color: "rgba(100, 80, 220, 0.48)", sizeW: 33, sizeH: 30, offsetX: 0, offsetY: 0 },
6014
+ { color: "rgba(60, 120, 255, 0.42)", sizeW: 24, sizeH: 26, offsetX: 39, offsetY: -3 },
6015
+ { color: "rgba(80, 100, 200, 0.48)", sizeW: 27, sizeH: 24, offsetX: -36, offsetY: 0 },
6016
+ { color: "rgba(130, 70, 255, 0.42)", sizeW: 23, sizeH: 28, offsetX: -54, offsetY: -2 },
6017
+ { color: "rgba(70, 130, 255, 0.50)", sizeW: 24, sizeH: 24, offsetX: 51, offsetY: -1 },
6018
+ { color: "rgba(120, 80, 255, 0.45)", sizeW: 30, sizeH: 20, offsetX: 21, offsetY: 0 },
6019
+ { color: "rgba(90, 110, 230, 0.40)", sizeW: 25, sizeH: 18, offsetX: -21, offsetY: -2 },
6020
+ { color: "rgba(110, 90, 240, 0.45)", sizeW: 21, sizeH: 24, offsetX: 66, offsetY: 0 },
6021
+ { color: "rgba(140, 100, 255, 0.52)", sizeW: 18, sizeH: 26, offsetX: -66, offsetY: -1 }
6022
+ ],
6023
+ sunset: [
6024
+ { color: "rgba(255, 100, 60, 0.48)", sizeW: 33, sizeH: 30, offsetX: 0, offsetY: 0 },
6025
+ { color: "rgba(255, 180, 50, 0.42)", sizeW: 24, sizeH: 26, offsetX: 39, offsetY: -3 },
6026
+ { color: "rgba(255, 140, 70, 0.48)", sizeW: 27, sizeH: 24, offsetX: -36, offsetY: 0 },
6027
+ { color: "rgba(255, 80, 80, 0.42)", sizeW: 23, sizeH: 28, offsetX: -54, offsetY: -2 },
6028
+ { color: "rgba(255, 200, 60, 0.50)", sizeW: 24, sizeH: 24, offsetX: 51, offsetY: -1 },
6029
+ { color: "rgba(255, 120, 50, 0.45)", sizeW: 30, sizeH: 20, offsetX: 21, offsetY: 0 },
6030
+ { color: "rgba(255, 160, 80, 0.40)", sizeW: 25, sizeH: 18, offsetX: -21, offsetY: -2 },
6031
+ { color: "rgba(255, 90, 60, 0.45)", sizeW: 21, sizeH: 24, offsetX: 66, offsetY: 0 },
6032
+ { color: "rgba(255, 70, 70, 0.52)", sizeW: 18, sizeH: 26, offsetX: -66, offsetY: -1 }
6033
+ ],
6034
+ brand: [
6035
+ { color: "rgba(245, 158, 11, 0.48)", sizeW: 33, sizeH: 30, offsetX: 0, offsetY: 0 },
6036
+ { color: "rgba(251, 191, 36, 0.42)", sizeW: 24, sizeH: 26, offsetX: 39, offsetY: -3 },
6037
+ { color: "rgba(245, 158, 11, 0.48)", sizeW: 27, sizeH: 24, offsetX: -36, offsetY: 0 },
6038
+ { color: "rgba(217, 119, 6, 0.42)", sizeW: 23, sizeH: 28, offsetX: -54, offsetY: -2 },
6039
+ { color: "rgba(252, 211, 77, 0.50)", sizeW: 24, sizeH: 24, offsetX: 51, offsetY: -1 },
6040
+ { color: "rgba(234, 138, 9, 0.45)", sizeW: 30, sizeH: 20, offsetX: 21, offsetY: 0 },
6041
+ { color: "rgba(251, 191, 36, 0.40)", sizeW: 25, sizeH: 18, offsetX: -21, offsetY: -2 },
6042
+ { color: "rgba(217, 119, 6, 0.45)", sizeW: 21, sizeH: 24, offsetX: 66, offsetY: 0 },
6043
+ { color: "rgba(245, 158, 11, 0.52)", sizeW: 18, sizeH: 26, offsetX: -66, offsetY: -1 }
6044
+ ]
6045
+ };
6046
+ function getLineInnerGradients(colorVariant, id) {
6047
+ const data = lineInnerGradientData[colorVariant];
6048
+ return data.map((c) => {
6049
+ const offsetXStr = c.offsetX === 0 ? "" : c.offsetX > 0 ? ` + ${c.offsetX}px` : ` - ${Math.abs(c.offsetX)}px`;
6050
+ const offsetYStr = c.offsetY === 0 ? "" : ` - ${Math.abs(c.offsetY)}px`;
6051
+ return `radial-gradient(ellipse calc(${c.sizeW}px * var(--beam-w-${id})) calc(${c.sizeH}px * var(--beam-h-${id})) at calc(var(--beam-x-${id}) * 100%${offsetXStr}) calc(100%${offsetYStr}), ${c.color}, transparent)`;
6052
+ }).join(",\n ");
6053
+ }
6054
+ var lineBloomColors = {
6055
+ colorful: {
6056
+ dark: {
6057
+ spikes: [
6058
+ { color1: "rgb(100, 70, 255)", color2: "rgba(100, 70, 255, 1)" },
6059
+ // 36%
6060
+ { color1: "rgba(255, 170, 40, 0.59)", color2: "rgba(255, 170, 40, 0.29)" },
6061
+ // 50%
6062
+ { color1: "rgb(50, 200, 100)", color2: "rgba(50, 200, 100, 1)" },
6063
+ // 64%
6064
+ { color1: "rgba(200, 50, 240, 0.91)", color2: "rgba(200, 50, 240, 0.45)" },
6065
+ // 78%
6066
+ { color1: "rgb(40, 140, 255)", color2: "rgba(40, 140, 255, 1)" }
6067
+ // 92%
6068
+ ]
6069
+ },
6070
+ light: {
6071
+ spikes: [
6072
+ { color1: "rgb(80, 50, 200)", color2: "rgba(80, 50, 200, 0.8)" },
6073
+ // 36%
6074
+ { color1: "rgba(210, 130, 0, 0.7)", color2: "rgba(210, 130, 0, 0.46)" },
6075
+ // 50%
6076
+ { color1: "rgb(30, 160, 70)", color2: "rgba(30, 160, 70, 0.82)" },
6077
+ // 64%
6078
+ { color1: "rgb(160, 30, 190)", color2: "rgba(160, 30, 190, 0.7)" },
6079
+ // 78%
6080
+ { color1: "rgb(30, 100, 200)", color2: "rgba(30, 100, 200, 0.78)" }
6081
+ // 92%
6082
+ ]
6083
+ }
6084
+ },
6085
+ mono: {
6086
+ dark: {
6087
+ spikes: [
6088
+ { color1: "rgb(200, 200, 200)", color2: "rgba(200, 200, 200, 1)" },
6089
+ { color1: "rgba(180, 180, 180, 0.59)", color2: "rgba(180, 180, 180, 0.29)" },
6090
+ { color1: "rgb(190, 190, 190)", color2: "rgba(190, 190, 190, 1)" },
6091
+ { color1: "rgba(170, 170, 170, 0.91)", color2: "rgba(170, 170, 170, 0.45)" },
6092
+ { color1: "rgb(185, 185, 185)", color2: "rgba(185, 185, 185, 1)" }
6093
+ ]
6094
+ },
6095
+ light: {
6096
+ spikes: [
6097
+ { color1: "rgb(80, 80, 80)", color2: "rgba(80, 80, 80, 0.8)" },
6098
+ { color1: "rgba(100, 100, 100, 0.7)", color2: "rgba(100, 100, 100, 0.46)" },
6099
+ { color1: "rgb(70, 70, 70)", color2: "rgba(70, 70, 70, 0.82)" },
6100
+ { color1: "rgb(90, 90, 90)", color2: "rgba(90, 90, 90, 0.7)" },
6101
+ { color1: "rgb(85, 85, 85)", color2: "rgba(85, 85, 85, 0.78)" }
6102
+ ]
6103
+ }
6104
+ },
6105
+ ocean: {
6106
+ dark: {
6107
+ spikes: [
6108
+ { color1: "rgb(100, 80, 255)", color2: "rgb(100, 80, 255)" },
6109
+ { color1: "rgba(80, 130, 220, 0.59)", color2: "rgba(80, 130, 220, 0.29)" },
6110
+ { color1: "rgb(60, 100, 255)", color2: "rgb(60, 100, 255)" },
6111
+ { color1: "rgba(90, 120, 200, 0.91)", color2: "rgba(90, 120, 200, 0.45)" },
6112
+ { color1: "rgb(120, 90, 255)", color2: "rgb(120, 90, 255)" }
6113
+ ]
6114
+ },
6115
+ light: {
6116
+ spikes: [
6117
+ { color1: "rgb(50, 40, 180)", color2: "rgba(50, 40, 180, 0.8)" },
6118
+ { color1: "rgba(40, 80, 200, 0.7)", color2: "rgba(40, 80, 200, 0.46)" },
6119
+ { color1: "rgb(30, 50, 190)", color2: "rgba(30, 50, 190, 0.82)" },
6120
+ { color1: "rgb(60, 90, 180)", color2: "rgba(60, 90, 180, 0.7)" },
6121
+ { color1: "rgb(70, 60, 200)", color2: "rgba(70, 60, 200, 0.78)" }
6122
+ ]
6123
+ }
6124
+ },
6125
+ sunset: {
6126
+ dark: {
6127
+ spikes: [
6128
+ { color1: "rgb(255, 100, 80)", color2: "rgb(255, 100, 80)" },
6129
+ { color1: "rgba(255, 150, 80, 0.59)", color2: "rgba(255, 150, 80, 0.29)" },
6130
+ { color1: "rgb(255, 80, 60)", color2: "rgb(255, 80, 60)" },
6131
+ { color1: "rgba(255, 120, 50, 0.91)", color2: "rgba(255, 120, 50, 0.45)" },
6132
+ { color1: "rgb(255, 140, 70)", color2: "rgb(255, 140, 70)" }
6133
+ ]
6134
+ },
6135
+ light: {
6136
+ spikes: [
6137
+ { color1: "rgb(200, 60, 30)", color2: "rgba(200, 60, 30, 0.8)" },
6138
+ { color1: "rgba(220, 100, 20, 0.7)", color2: "rgba(220, 100, 20, 0.46)" },
6139
+ { color1: "rgb(180, 40, 20)", color2: "rgba(180, 40, 20, 0.82)" },
6140
+ { color1: "rgb(210, 80, 10)", color2: "rgba(210, 80, 10, 0.7)" },
6141
+ { color1: "rgb(190, 70, 30)", color2: "rgba(190, 70, 30, 0.78)" }
6142
+ ]
6143
+ }
6144
+ },
6145
+ brand: {
6146
+ dark: {
6147
+ spikes: [
6148
+ { color1: "rgb(251, 191, 36)", color2: "rgb(251, 191, 36)" },
6149
+ { color1: "rgba(245, 158, 11, 0.59)", color2: "rgba(245, 158, 11, 0.29)" },
6150
+ { color1: "rgb(217, 119, 6)", color2: "rgb(217, 119, 6)" },
6151
+ { color1: "rgba(252, 211, 77, 0.91)", color2: "rgba(252, 211, 77, 0.45)" },
6152
+ { color1: "rgb(245, 158, 11)", color2: "rgb(245, 158, 11)" }
6153
+ ]
6154
+ },
6155
+ light: {
6156
+ spikes: [
6157
+ { color1: "rgb(180, 83, 9)", color2: "rgba(180, 83, 9, 0.8)" },
6158
+ { color1: "rgba(202, 138, 4, 0.7)", color2: "rgba(202, 138, 4, 0.46)" },
6159
+ { color1: "rgb(146, 64, 14)", color2: "rgba(146, 64, 14, 0.82)" },
6160
+ { color1: "rgb(202, 138, 4)", color2: "rgba(202, 138, 4, 0.7)" },
6161
+ { color1: "rgb(161, 98, 7)", color2: "rgba(161, 98, 7, 0.78)" }
6162
+ ]
6163
+ }
6164
+ }
6165
+ };
6166
+ function withAlpha(color, alpha) {
6167
+ const rgbaMatch = color.match(/^rgba\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*[\d.]+\s*\)$/);
6168
+ if (rgbaMatch) return `rgba(${rgbaMatch[1]}, ${rgbaMatch[2]}, ${rgbaMatch[3]}, ${alpha})`;
6169
+ const rgbMatch = color.match(/^rgb\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)$/);
6170
+ if (rgbMatch) return `rgba(${rgbMatch[1]}, ${rgbMatch[2]}, ${rgbMatch[3]}, ${alpha})`;
6171
+ return color;
6172
+ }
6173
+ function attenuateSpike(color, factor) {
6174
+ const rgbaMatch = color.match(/^rgba\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)$/);
6175
+ if (rgbaMatch) return `rgba(${rgbaMatch[1]}, ${rgbaMatch[2]}, ${rgbaMatch[3]}, ${(parseFloat(rgbaMatch[4]) * factor).toFixed(2)})`;
6176
+ const rgbMatch = color.match(/^rgb\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)$/);
6177
+ if (rgbMatch) return `rgba(${rgbMatch[1]}, ${rgbMatch[2]}, ${rgbMatch[3]}, ${factor.toFixed(2)})`;
6178
+ return color;
6179
+ }
6180
+ function getLineBloomGradients(colorVariant, isDark, id) {
6181
+ const spikeColors = getSpikeColors(colorVariant, isDark);
6182
+ const bloomData = lineBloomColors[colorVariant][isDark ? "dark" : "light"];
6183
+ const isMono = colorVariant === "mono";
6184
+ const att = isMono ? 0.14 : 1;
6185
+ const sc1 = isMono ? attenuateSpike(spikeColors.primary, 0.14) : spikeColors.primary;
6186
+ const sc1_mid = isMono ? attenuateSpike(spikeColors.primary, 0.09) : spikeColors.primary;
6187
+ const sc2 = isMono ? attenuateSpike(spikeColors.secondary, 0.12) : spikeColors.secondary;
6188
+ const sc2_mid = isMono ? withAlpha(spikeColors.secondary, 0.06) : withAlpha(spikeColors.secondary, 0.49);
6189
+ const spikes = bloomData.spikes.map(
6190
+ (s) => isMono ? { color1: attenuateSpike(s.color1, att), color2: attenuateSpike(s.color2, att * 0.7) } : s
6191
+ );
6192
+ const thinW1 = isMono ? "12px" : "0.8px";
6193
+ const thinW2 = isMono ? "14px" : "2px";
6194
+ const thinW3 = isMono ? "12px" : "1.2px";
6195
+ const thinW4 = isMono ? "10px" : "0.6px";
6196
+ const thinH1 = isMono ? "42px" : "92px";
6197
+ const thinH2 = isMono ? "38px" : "72px";
6198
+ const thinH3 = isMono ? "40px" : "85px";
6199
+ const thinH4 = isMono ? "32px" : "60px";
6200
+ const thinLW = isMono ? "12px" : "1px";
6201
+ const glowDotC = isMono ? "rgba(255, 255, 255, 0.5)" : "rgba(255, 255, 255, 1)";
6202
+ const glowDot20 = isMono ? "rgba(255, 255, 255, 0.45)" : "rgba(255, 255, 255, 0.9)";
6203
+ const glowDot50 = isMono ? "rgba(255, 255, 255, 0.25)" : "rgba(255, 255, 255, 0.5)";
6204
+ const glowAmbC = isMono ? "rgba(255, 255, 255, 0.15)" : "rgba(255, 255, 255, 0.3)";
6205
+ const glowAmb25 = isMono ? "rgba(255, 255, 255, 0.06)" : "rgba(255, 255, 255, 0.12)";
6206
+ const glowAmb55 = isMono ? "rgba(255, 255, 255, 0.015)" : "rgba(255, 255, 255, 0.03)";
6207
+ if (isDark) {
6208
+ return `radial-gradient(ellipse calc(${thinW1} * var(--beam-spike-${id})) calc(${thinH1} * var(--beam-h-${id})) at 8% calc(100% - 2px), ${sc1}, ${sc1_mid} 30%, transparent 88%),
6209
+ radial-gradient(ellipse calc(10px * var(--beam-spike2-${id})) calc(35px * var(--beam-h-${id})) at 22% calc(100% - 4px), ${sc2}, ${sc2_mid} 50%, transparent 95%),
6210
+ radial-gradient(ellipse calc(${thinW2} * (2 - var(--beam-spike-${id}))) calc(${thinH2} * var(--beam-h-${id})) at 36% calc(100% - 3px), ${spikes[0].color1}, ${spikes[0].color2} 40%, transparent 90%),
6211
+ radial-gradient(ellipse calc(14px * var(--beam-spike2-${id})) calc(28px * var(--beam-h-${id})) at 50% calc(100% - 2px), ${spikes[1].color1}, ${spikes[1].color2} 55%, transparent 96%),
6212
+ radial-gradient(ellipse calc(${thinW3} * (2 - var(--beam-spike2-${id}))) calc(${thinH3} * var(--beam-h-${id})) at 64% calc(100% - 4px), ${spikes[2].color1}, ${spikes[2].color2} 35%, transparent 89%),
6213
+ radial-gradient(ellipse calc(7px * var(--beam-spike-${id})) calc(45px * var(--beam-h-${id})) at 78% calc(100% - 2px), ${spikes[3].color1}, ${spikes[3].color2} 48%, transparent 94%),
6214
+ radial-gradient(ellipse calc(${thinW4} * (2 - var(--beam-spike-${id}))) calc(${thinH4} * var(--beam-h-${id})) at 92% calc(100% - 3px), ${spikes[4].color1}, ${spikes[4].color2} 42%, transparent 91%),
6215
+ radial-gradient(ellipse calc(21px * var(--beam-spike-${id})) calc(15px * var(--beam-spike2-${id})) at calc(var(--beam-x-${id}) * 100%) calc(100% + 1px), ${glowDotC} 0%, ${glowDot20} 20%, ${glowDot50} 50%, transparent 100%),
6216
+ radial-gradient(ellipse calc(42px * var(--beam-w-${id})) calc(40px * var(--beam-h-${id})) at calc(var(--beam-x-${id}) * 100%) 100%, ${glowAmbC} 0%, ${glowAmb25} 25%, ${glowAmb55} 55%, transparent 80%)`;
6217
+ } else {
6218
+ const sc1_lt = isMono ? attenuateSpike(spikeColors.primary, 0.11) : withAlpha(spikeColors.primary, 0.85);
6219
+ const sc2_lt = isMono ? attenuateSpike(spikeColors.secondary, 0.09) : withAlpha(spikeColors.secondary, 0.7);
6220
+ return `radial-gradient(ellipse calc(${thinW1} * var(--beam-spike-${id})) calc(${thinH1} * var(--beam-h-${id})) at 8% calc(100% - 2px), ${sc1}, ${sc1_lt} 30%, transparent 88%),
6221
+ radial-gradient(ellipse calc(10px * var(--beam-spike2-${id})) calc(35px * var(--beam-h-${id})) at 22% calc(100% - 4px), ${sc2}, ${sc2_lt} 50%, transparent 95%),
6222
+ radial-gradient(ellipse calc(${thinW2} * (2 - var(--beam-spike-${id}))) calc(${thinH2} * var(--beam-h-${id})) at 36% calc(100% - 3px), ${spikes[0].color1}, ${spikes[0].color2} 40%, transparent 90%),
6223
+ radial-gradient(ellipse calc(14px * var(--beam-spike2-${id})) calc(28px * var(--beam-h-${id})) at 50% calc(100% - 2px), ${spikes[1].color1}, ${spikes[1].color2} 55%, transparent 96%),
6224
+ radial-gradient(ellipse calc(${thinW3} * (2 - var(--beam-spike2-${id}))) calc(${thinH3} * var(--beam-h-${id})) at 64% calc(100% - 4px), ${spikes[2].color1}, ${spikes[2].color2} 35%, transparent 89%),
6225
+ radial-gradient(ellipse calc(7px * var(--beam-spike-${id})) calc(45px * var(--beam-h-${id})) at 78% calc(100% - 2px), ${spikes[3].color1}, ${spikes[3].color2} 48%, transparent 94%),
6226
+ radial-gradient(ellipse calc(${thinLW} * (2 - var(--beam-spike-${id}))) calc(${thinH4} * var(--beam-h-${id})) at 92% calc(100% - 3px), ${spikes[4].color1}, ${spikes[4].color2} 42%, transparent 91%),
6227
+ radial-gradient(ellipse calc(50px * var(--beam-w-${id})) calc(32px * var(--beam-h-${id})) at calc(var(--beam-x-${id}) * 100%) calc(100%), rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.18) 30%, rgba(0, 0, 0, 0.03) 60%, transparent 85%)`;
6228
+ }
6229
+ }
6230
+ var PULSE_RING_MAP = [
6231
+ { region: 1, quad: "tl" },
6232
+ { region: 2, quad: "tl" },
6233
+ { region: 3, quad: "bl" },
6234
+ { region: 1, quad: "bl" },
6235
+ { region: 2, quad: "br" },
6236
+ { region: 3, quad: "br" },
6237
+ { region: 1, quad: "tr" },
6238
+ { region: 2, quad: "tr" },
6239
+ { region: 3, quad: "tr" }
6240
+ ];
6241
+ var PULSE_INNER_SIZES = [
6242
+ [65, 35],
6243
+ [55, 30],
6244
+ [35, 65],
6245
+ [15, 30],
6246
+ [173, 28],
6247
+ [80, 22],
6248
+ [69, 28],
6249
+ [22, 38],
6250
+ [47, 44]
6251
+ ];
6252
+ var PULSE_INNER_BLOOM = [
6253
+ { ci: 0, region: 1, quad: "tl", w: 84, h: 48 },
6254
+ { ci: 1, region: 2, quad: "tl", w: 72, h: 42 },
6255
+ { ci: 2, region: 3, quad: "bl", w: 48, h: 84 },
6256
+ { ci: 4, region: 2, quad: "br", w: 216, h: 38 },
6257
+ { ci: 5, region: 3, quad: "br", w: 102, h: 31 },
6258
+ { ci: 6, region: 1, quad: "tr", w: 89, h: 38 },
6259
+ { ci: 8, region: 3, quad: "tr", w: 62, h: 58 }
6260
+ ];
6261
+ var PULSE_OUTER_CORE = [
6262
+ { ci: 0, region: 1, quad: "tl", w: 80, h: 19, x: "27%", y: "0%" },
6263
+ { ci: 6, region: 2, quad: "tr", w: 74, h: 11, x: "73%", y: "-1%" },
6264
+ { ci: 7, region: 3, quad: "tr", w: 15, h: 44, x: "100%", y: "33%" },
6265
+ { ci: 8, region: 1, quad: "br", w: 19, h: 38, x: "101%", y: "72%" },
6266
+ { ci: 4, region: 2, quad: "br", w: 84, h: 13, x: "67%", y: "100%" },
6267
+ { ci: 1, region: 3, quad: "bl", w: 60, h: 21, x: "24%", y: "101%" },
6268
+ { ci: 2, region: 1, quad: "bl", w: 17, h: 40, x: "0%", y: "60%" },
6269
+ { ci: 3, region: 2, quad: "tl", w: 13, h: 32, x: "-1%", y: "28%" }
6270
+ ];
6271
+ var PULSE_OUTER_BLOOM = [
6272
+ { ci: 0, region: 1, quad: "tl", w: 110, h: 30, x: "27%", y: "3%" },
6273
+ { ci: 6, region: 2, quad: "tr", w: 100, h: 20, x: "73%", y: "1%" },
6274
+ { ci: 7, region: 3, quad: "tr", w: 26, h: 62, x: "100%", y: "33%" },
6275
+ { ci: 8, region: 1, quad: "br", w: 30, h: 56, x: "101%", y: "72%" },
6276
+ { ci: 4, region: 2, quad: "br", w: 120, h: 22, x: "67%", y: "99%" },
6277
+ { ci: 1, region: 3, quad: "bl", w: 88, h: 32, x: "24%", y: "99%" },
6278
+ { ci: 2, region: 1, quad: "bl", w: 28, h: 58, x: "0%", y: "60%" }
6279
+ ];
6280
+ function withAlphaVar(color, quad, id) {
6281
+ const m = color.match(/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/);
6282
+ const rgb = m ? `${m[1]}, ${m[2]}, ${m[3]}` : "255, 255, 255";
6283
+ return `rgba(${rgb}, var(--bop-${quad}-${id}))`;
6284
+ }
6285
+ function pulseGrad(color, w, h, region, quad, x, y, id) {
6286
+ return `radial-gradient(ellipse calc(${w}px * var(--bw${region}-${id}) * var(--pulse-glow-sx, 1) * var(--pulse-glow-boost, 1)) calc(${h}px * var(--bh${region}-${id}) * var(--bgh-${id}) * var(--pulse-glow-sy, 1) * var(--pulse-glow-boost, 1)) at calc(${x} + var(--bx${region}-${id})) calc(${y} + var(--by${region}-${id})), ${withAlphaVar(color, quad, id)}, transparent)`;
6287
+ }
6288
+ function pulseRingGradients(variant, id) {
6289
+ return colorPalettes[variant].border.map((c, i) => {
6290
+ const { region, quad } = PULSE_RING_MAP[i];
6291
+ const [x, y] = c.pos.split(" ");
6292
+ const [w, h] = c.size.split(" ").map(parseFloat);
6293
+ return pulseGrad(c.color, w, h, region, quad, x, y, id);
6294
+ }).join(",\n ");
6295
+ }
6296
+ function pulseInnerGradients(variant, id, isDark) {
6297
+ const palette = colorPalettes[variant].border;
6298
+ const grads = palette.map((c, i) => {
6299
+ const { region, quad } = PULSE_RING_MAP[i];
6300
+ const [x, y] = c.pos.split(" ");
6301
+ const [w, h] = PULSE_INNER_SIZES[i];
6302
+ return pulseGrad(c.color, w, h, region, quad, x, y, id);
6303
+ });
6304
+ const cornerRGB = isDark ? "255, 255, 255" : "0, 0, 0";
6305
+ const cornerAlpha = isDark ? 0.18 : 0.08;
6306
+ const corners = [
6307
+ ["0%", "0%", "tl"],
6308
+ ["100%", "0%", "tr"],
6309
+ ["0%", "100%", "bl"],
6310
+ ["100%", "100%", "br"]
6311
+ ];
6312
+ const cornerGrads = corners.map(
6313
+ ([x, y, q]) => `radial-gradient(ellipse 60px 60px at ${x} ${y}, rgba(${cornerRGB}, calc(${cornerAlpha} * var(--bop-${q}-${id}))), transparent 70%)`
6314
+ );
6315
+ return [...grads, ...cornerGrads].join(",\n ");
6316
+ }
6317
+ function pulseTableGradients(table, variant, id) {
6318
+ const palette = colorPalettes[variant].border;
6319
+ return table.map((e) => {
6320
+ const c = palette[e.ci];
6321
+ const [px, py] = c.pos.split(" ");
6322
+ return pulseGrad(c.color, e.w, e.h, e.region, e.quad, e.x ?? px, e.y ?? py, id);
6323
+ }).join(",\n ");
6324
+ }
6325
+ function pulseTableGradientsStatic(table, variant, frozenAlpha) {
6326
+ const palette = colorPalettes[variant].border;
6327
+ const a = +frozenAlpha.toFixed(3);
6328
+ return table.map((e) => {
6329
+ const c = palette[e.ci];
6330
+ const [px, py] = c.pos.split(" ");
6331
+ const x = e.x ?? px;
6332
+ const y = e.y ?? py;
6333
+ const m = c.color.match(/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/);
6334
+ const rgb = m ? `${m[1]}, ${m[2]}, ${m[3]}` : "255, 255, 255";
6335
+ return `radial-gradient(ellipse calc(${e.w}px * var(--pulse-glow-sx, 1) * var(--pulse-glow-boost, 1)) calc(${e.h}px * var(--pulse-glow-sy, 1) * var(--pulse-glow-boost, 1)) at ${x} ${y}, rgba(${rgb}, ${a}), transparent)`;
6336
+ }).join(",\n ");
6337
+ }
6338
+ function pausedAnimationsRule(id) {
6339
+ return `
6340
+ [data-beam="${id}"][data-paused],
6341
+ [data-beam="${id}"][data-paused]::after,
6342
+ [data-beam="${id}"][data-paused]::before,
6343
+ [data-beam="${id}"][data-paused] [data-beam-bloom] {
6344
+ animation-play-state: paused !important;
6345
+ }`;
6346
+ }
6347
+ function pulsePropertyRegs(id) {
6348
+ const numbers = ["bw1", "bh1", "bw2", "bh2", "bw3", "bh3", "bgh", "bop-tl", "bop-tr", "bop-bl", "bop-br"];
6349
+ const lengths = ["bx1", "by1", "bx2", "by2", "bx3", "by3"];
6350
+ const numReg = numbers.map(
6351
+ (n) => `@property --${n}-${id} {
6352
+ syntax: "<number>";
6353
+ initial-value: 1;
6354
+ inherits: true;
6355
+ }`
6356
+ ).join("\n\n");
6357
+ const lenReg = lengths.map(
6358
+ (n) => `@property --${n}-${id} {
6359
+ syntax: "<length>";
6360
+ initial-value: 0px;
6361
+ inherits: true;
6362
+ }`
6363
+ ).join("\n\n");
6364
+ return `${numReg}
6365
+
6366
+ ${lenReg}
6367
+
6368
+ @property --beam-opacity-${id} {
6369
+ syntax: "<number>";
6370
+ initial-value: 0;
6371
+ inherits: true;
6372
+ }
6373
+
6374
+ @property --beam-hue-${id} {
6375
+ syntax: "<angle>";
6376
+ initial-value: 0deg;
6377
+ inherits: true;
6378
+ }`;
6379
+ }
6380
+ function pulseParams(size, theme, duration) {
6381
+ const isDark = theme === "dark";
6382
+ const durScale = duration / 2.3;
6383
+ if (size === "pulse-inner") {
6384
+ return {
6385
+ sp: 0.28,
6386
+ dr: isDark ? 33 : 40,
6387
+ op: isDark ? 0.48 : 0.45,
6388
+ gh: isDark ? 0.34 : 0.22,
6389
+ bs: (isDark ? 1.9 : 2.6) * durScale,
6390
+ ss: (isDark ? 2.6 : 4.6) * durScale,
6391
+ ghs: (isDark ? 2.4 : 5.5) * durScale,
6392
+ // Full hue revolution period (seconds) — colors continuously cycle.
6393
+ huePeriod: 16
6394
+ };
6395
+ }
6396
+ return {
6397
+ sp: isDark ? 0.28 : 0.36,
6398
+ dr: isDark ? 14 : 19,
6399
+ op: isDark ? 0.46 : 0,
6400
+ gh: isDark ? 0.16 : 0.58,
6401
+ bs: (isDark ? 2.3 : 3.7) * durScale,
6402
+ ss: (isDark ? 6.4 : 4.6) * durScale,
6403
+ ghs: (isDark ? 2.4 : 3.8) * durScale,
6404
+ // Full hue revolution period (seconds) — colors continuously cycle.
6405
+ huePeriod: 14
6406
+ };
6407
+ }
6408
+ function pulseOscillatorDefs(id, p) {
6409
+ const { sp, dr, op, gh, bs, ss, ghs } = p;
6410
+ return [
6411
+ { prop: `--bw1-${id}`, a: 1 - sp, b: 1 + sp * 1.1, period: ss * 0.9, delay: 0, unit: "" },
6412
+ { prop: `--bh1-${id}`, a: 1 + sp * 0.9, b: 1 - sp * 0.85, period: ss * 1.26, delay: 0, unit: "" },
6413
+ { prop: `--bx1-${id}`, a: -dr, b: dr * 0.9, period: bs * 1.6, delay: 0, unit: "px" },
6414
+ { prop: `--by1-${id}`, a: dr * 0.55, b: -dr * 0.7, period: bs * 1.6, delay: 0, unit: "px" },
6415
+ { prop: `--bw2-${id}`, a: 1 + sp, b: 1 - sp * 0.85, period: ss * 1.1, delay: 0, unit: "" },
6416
+ { prop: `--bh2-${id}`, a: 1 - sp * 0.8, b: 1 + sp * 1.05, period: ss * 0.81, delay: 0, unit: "" },
6417
+ { prop: `--bx2-${id}`, a: dr * 0.8, b: -dr * 0.9, period: bs * 1.88, delay: 0, unit: "px" },
6418
+ { prop: `--by2-${id}`, a: -dr, b: dr * 0.65, period: bs * 1.88, delay: 0, unit: "px" },
6419
+ { prop: `--bw3-${id}`, a: 1 - sp * 0.6, b: 1 + sp * 1.15, period: ss * 0.98, delay: 0, unit: "" },
6420
+ { prop: `--bh3-${id}`, a: 1 + sp * 0.75, b: 1 - sp, period: ss * 1.4, delay: 0, unit: "" },
6421
+ { prop: `--bx3-${id}`, a: -dr * 0.6, b: dr, period: bs * 1.45, delay: 0, unit: "px" },
6422
+ { prop: `--by3-${id}`, a: -dr * 0.85, b: dr * 0.45, period: bs * 1.45, delay: 0, unit: "px" },
6423
+ { prop: `--bgh-${id}`, a: 1 - gh, b: 1 + gh, period: ghs, delay: 0, unit: "" },
6424
+ { prop: `--bop-tl-${id}`, a: 1 - op, b: 1, period: bs, delay: 0, unit: "" },
6425
+ { prop: `--bop-tr-${id}`, a: 1 - op, b: 1, period: bs * 1.32, delay: bs * 0.28, unit: "" },
6426
+ { prop: `--bop-bl-${id}`, a: 1 - op, b: 1, period: bs * 0.84, delay: bs * 0.55, unit: "" },
6427
+ { prop: `--bop-br-${id}`, a: 1 - op, b: 1, period: bs * 1.58, delay: bs * 0.83, unit: "" }
6428
+ ];
6429
+ }
6430
+ function getPulseDriverConfig(size, theme, duration, _hueRange, staticColors, id) {
6431
+ if (size !== "pulse-inner" && size !== "pulse-outside") return null;
6432
+ const p = pulseParams(size, theme, duration);
6433
+ return {
6434
+ oscillators: pulseOscillatorDefs(id, p),
6435
+ // Pulse colors continuously rotate a full hue circle so the palette is never
6436
+ // pinned to fixed edges (no more "always red top-right / green left").
6437
+ hue: staticColors ? null : { prop: `--beam-hue-${id}`, range: 360, period: p.huePeriod, continuous: true }
6438
+ };
6439
+ }
6440
+ function pulseWrapperAnimation(id, fadeName, fadeDur) {
6441
+ return ` animation: ${fadeName}-${id} ${fadeDur}s ease forwards;`;
6442
+ }
6443
+ function generateBeamCSS(options) {
6444
+ const { size } = options;
6445
+ if (size === "line") {
6446
+ return generateLineVariantCSS(options);
6447
+ }
6448
+ if (size === "sm") {
6449
+ return generateSmallVariantCSS(options);
6450
+ }
6451
+ if (size === "pulse-inner") {
6452
+ return generatePulseInnerVariantCSS(options);
6453
+ }
6454
+ if (size === "pulse-outside") {
6455
+ return generatePulseOuterVariantCSS(options);
6456
+ }
6457
+ return generateBorderVariantCSS(options);
6458
+ }
6459
+ function generateSmallVariantCSS(options) {
6460
+ const {
6461
+ id,
6462
+ borderRadius,
6463
+ borderWidth,
6464
+ duration,
6465
+ strokeOpacity,
6466
+ innerOpacity,
6467
+ bloomOpacity,
6468
+ innerShadow,
6469
+ colorVariant,
6470
+ staticColors,
6471
+ brightness,
6472
+ saturation,
6473
+ hueRange,
6474
+ theme
6475
+ } = options;
6476
+ const innerRadius = Math.max(0, borderRadius - borderWidth);
6477
+ const monoOpacityMultiplier = colorVariant === "mono" ? 0.5 : 1;
6478
+ const finalStrokeOpacity = strokeOpacity * monoOpacityMultiplier;
6479
+ const finalInnerOpacity = innerOpacity * monoOpacityMultiplier;
6480
+ const finalBloomOpacity = bloomOpacity * monoOpacityMultiplier;
6481
+ const hueShiftAnimation = staticColors ? "" : `animation: beam-hue-shift-${id} 12s ease-in-out infinite;`;
6482
+ const hueShiftKeyframes = staticColors ? "" : `
6483
+ @keyframes beam-hue-shift-${id} {
6484
+ 0% { filter: hue-rotate(calc(var(--beam-hue-base, 0deg) - ${hueRange}deg)) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)}); }
6485
+ 50% { filter: hue-rotate(calc(var(--beam-hue-base, 0deg) + ${hueRange}deg)) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)}); }
6486
+ 100% { filter: hue-rotate(calc(var(--beam-hue-base, 0deg) - ${hueRange}deg)) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)}); }
6487
+ }`;
6488
+ const isDark = theme === "dark";
6489
+ const whiteGradient = isDark ? `conic-gradient(
6490
+ from var(--beam-angle-${id}),
6491
+ transparent 0%, transparent 54%,
6492
+ rgba(255, 255, 255, 0.1) 57%,
6493
+ rgba(255, 255, 255, 0.3) 60%,
6494
+ rgba(255, 255, 255, 0.6) 63%,
6495
+ rgba(255, 255, 255, 0.75) 66%,
6496
+ rgba(255, 255, 255, 0.6) 69%,
6497
+ rgba(255, 255, 255, 0.3) 72%,
6498
+ rgba(255, 255, 255, 0.1) 75%,
6499
+ transparent 78%, transparent 100%
6500
+ )` : `conic-gradient(
6501
+ from var(--beam-angle-${id}),
6502
+ transparent 0%, transparent 54%,
6503
+ rgba(0, 0, 0, 0.08) 57%,
6504
+ rgba(0, 0, 0, 0.2) 60%,
6505
+ rgba(0, 0, 0, 0.4) 63%,
6506
+ rgba(0, 0, 0, 0.55) 66%,
6507
+ rgba(0, 0, 0, 0.4) 69%,
6508
+ rgba(0, 0, 0, 0.2) 72%,
6509
+ rgba(0, 0, 0, 0.08) 75%,
6510
+ transparent 78%, transparent 100%
6511
+ )`;
6512
+ const colorGradients = getSmallColorGradients(colorVariant);
6513
+ const innerGradients = getSmallInnerGradients(colorVariant);
6514
+ const bloomGradient = isDark ? `conic-gradient(
6515
+ from var(--beam-angle-${id}),
6516
+ transparent 0%, transparent 58%,
6517
+ rgba(255, 255, 255, 0.03) 62%,
6518
+ rgba(255, 255, 255, 0.08) 65%,
6519
+ rgba(255, 255, 255, 0.2) 67%,
6520
+ rgba(255, 255, 255, 0.45) 69%,
6521
+ rgba(255, 255, 255, 0.85) 70%,
6522
+ rgba(255, 255, 255, 0.85) 70.5%,
6523
+ rgba(255, 255, 255, 0.45) 71.5%,
6524
+ rgba(255, 255, 255, 0.2) 73%,
6525
+ rgba(255, 255, 255, 0.08) 75%,
6526
+ rgba(255, 255, 255, 0.03) 78%,
6527
+ transparent 82%
6528
+ )` : `conic-gradient(
6529
+ from var(--beam-angle-${id}),
6530
+ transparent 0%, transparent 58%,
6531
+ rgba(0, 0, 0, 0.02) 62%,
6532
+ rgba(0, 0, 0, 0.08) 65%,
6533
+ rgba(0, 0, 0, 0.2) 67%,
6534
+ rgba(0, 0, 0, 0.4) 69%,
6535
+ rgba(0, 0, 0, 0.6) 70%,
6536
+ rgba(0, 0, 0, 0.6) 70.5%,
6537
+ rgba(0, 0, 0, 0.4) 71.5%,
6538
+ rgba(0, 0, 0, 0.2) 73%,
6539
+ rgba(0, 0, 0, 0.08) 75%,
6540
+ rgba(0, 0, 0, 0.02) 78%,
6541
+ transparent 82%
6542
+ )`;
6543
+ const smallMask = `conic-gradient(
6544
+ from var(--beam-angle-${id}),
6545
+ transparent 0%, transparent 22%,
6546
+ rgba(255, 255, 255, 0.12) 28%, rgba(255, 255, 255, 0.4) 36%,
6547
+ white 46%, white 82%,
6548
+ rgba(255, 255, 255, 0.4) 88%, rgba(255, 255, 255, 0.12) 94%,
6549
+ transparent 97%, transparent 100%
6550
+ )`;
6551
+ return `
6552
+ @property --beam-angle-${id} {
6553
+ syntax: "<angle>";
6554
+ initial-value: 0deg;
6555
+ inherits: true;
6556
+ }
6557
+
6558
+ @property --beam-opacity-${id} {
6559
+ syntax: "<number>";
6560
+ initial-value: 0;
6561
+ inherits: true;
6562
+ }
6563
+
6564
+ [data-beam="${id}"] {
6565
+ position: relative;
6566
+ border-radius: ${borderRadius}px;
6567
+ overflow: hidden;
6568
+ }
6569
+
6570
+ [data-beam="${id}"][data-active] {
6571
+ animation:
6572
+ beam-spin-${id} ${duration}s linear infinite,
6573
+ beam-fade-in-${id} 0.6s ease forwards;
6574
+ }
6575
+
6576
+ [data-beam="${id}"][data-fading] {
6577
+ animation:
6578
+ beam-spin-${id} ${duration}s linear infinite,
6579
+ beam-fade-out-${id} 0.5s ease forwards;
6580
+ }
6581
+
6582
+ [data-beam="${id}"][data-active]::after,
6583
+ [data-beam="${id}"][data-fading]::after {
6584
+ content: "";
6585
+ position: absolute;
6586
+ inset: 0;
6587
+ border-radius: ${innerRadius}px;
6588
+ padding: ${borderWidth}px;
6589
+ clip-path: inset(0 round ${borderRadius}px);
6590
+ background: ${whiteGradient},${colorGradients};
6591
+ -webkit-mask:
6592
+ conic-gradient(
6593
+ from var(--beam-angle-${id}),
6594
+ transparent 0%, transparent 30%,
6595
+ rgba(255, 255, 255, 0.1) 36%, rgba(255, 255, 255, 0.35) 44%,
6596
+ white 52%, white 80%,
6597
+ rgba(255, 255, 255, 0.35) 86%, rgba(255, 255, 255, 0.1) 92%,
6598
+ transparent 95%, transparent 100%
6599
+ ),
6600
+ linear-gradient(#fff 0 0) content-box,
6601
+ linear-gradient(#fff 0 0);
6602
+ -webkit-mask-composite: source-in, xor;
6603
+ mask:
6604
+ conic-gradient(
6605
+ from var(--beam-angle-${id}),
6606
+ transparent 0%, transparent 30%,
6607
+ rgba(255, 255, 255, 0.1) 36%, rgba(255, 255, 255, 0.35) 44%,
6608
+ white 52%, white 80%,
6609
+ rgba(255, 255, 255, 0.35) 86%, rgba(255, 255, 255, 0.1) 92%,
6610
+ transparent 95%, transparent 100%
6611
+ ),
6612
+ linear-gradient(#fff 0 0) content-box,
6613
+ linear-gradient(#fff 0 0);
6614
+ mask-composite: intersect, exclude;
6615
+ pointer-events: none;
6616
+ z-index: 2;
6617
+ opacity: calc(var(--beam-opacity-${id}) * ${finalStrokeOpacity.toFixed(2)} * var(--beam-stroke-opacity, 1) * var(--beam-strength, 1));
6618
+ ${hueShiftAnimation}
6619
+ }
6620
+
6621
+ [data-beam="${id}"][data-active]::before,
6622
+ [data-beam="${id}"][data-fading]::before {
6623
+ content: "";
6624
+ position: absolute;
6625
+ inset: 0;
6626
+ border-radius: ${borderRadius}px;
6627
+ clip-path: inset(0 round ${borderRadius}px);
6628
+ background: ${innerGradients};
6629
+ box-shadow: inset 0 0 5px 1px ${innerShadow};
6630
+ -webkit-mask-image: ${smallMask};
6631
+ -webkit-mask-composite: source-over;
6632
+ mask-image: ${smallMask};
6633
+ mask-composite: add;
6634
+ pointer-events: none;
6635
+ z-index: 1;
6636
+ opacity: calc(var(--beam-opacity-${id}) * ${finalInnerOpacity.toFixed(2)} * var(--beam-inner-opacity, 1) * var(--beam-strength, 1));
6637
+ ${hueShiftAnimation}
6638
+ }
6639
+
6640
+ [data-beam="${id}"] [data-beam-bloom] {
6641
+ display: none;
6642
+ position: absolute;
6643
+ inset: 0;
6644
+ border-radius: ${innerRadius}px;
6645
+ clip-path: inset(0 round ${borderRadius}px);
6646
+ background: ${bloomGradient};
6647
+ -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
6648
+ -webkit-mask-composite: xor;
6649
+ mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
6650
+ mask-composite: exclude;
6651
+ padding: ${borderWidth}px;
6652
+ filter: blur(8px) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)});
6653
+ pointer-events: none;
6654
+ z-index: 3;
6655
+ opacity: 0;
6656
+ }
6657
+
6658
+ [data-beam="${id}"][data-active] [data-beam-bloom],
6659
+ [data-beam="${id}"][data-fading] [data-beam-bloom] {
6660
+ display: block;
6661
+ opacity: calc(var(--beam-opacity-${id}) * ${finalBloomOpacity.toFixed(2)} * var(--beam-bloom-opacity, 1) * var(--beam-strength, 1));
6662
+ }
6663
+
6664
+ @keyframes beam-spin-${id} {
6665
+ to { --beam-angle-${id}: 360deg; }
6666
+ }
6667
+
6668
+ @keyframes beam-fade-in-${id} {
6669
+ to { --beam-opacity-${id}: 1; }
6670
+ }
6671
+
6672
+ @keyframes beam-fade-out-${id} {
6673
+ from { --beam-opacity-${id}: 1; }
6674
+ to { --beam-opacity-${id}: 0; }
6675
+ }
6676
+ ${hueShiftKeyframes}
6677
+ ${pausedAnimationsRule(id)}
6678
+ `;
6679
+ }
6680
+ function generateBorderVariantCSS(options) {
6681
+ const {
6682
+ id,
6683
+ borderRadius,
6684
+ borderWidth,
6685
+ duration,
6686
+ strokeOpacity,
6687
+ innerOpacity,
6688
+ bloomOpacity,
6689
+ innerShadow,
6690
+ colorVariant,
6691
+ staticColors,
6692
+ brightness,
6693
+ saturation,
6694
+ hueRange,
6695
+ theme
6696
+ } = options;
6697
+ const innerRadius = Math.max(0, borderRadius - borderWidth);
6698
+ const monoOpacityMultiplier = colorVariant === "mono" ? 0.5 : 1;
6699
+ const finalStrokeOpacity = strokeOpacity * monoOpacityMultiplier;
6700
+ const finalInnerOpacity = innerOpacity * monoOpacityMultiplier;
6701
+ const finalBloomOpacity = bloomOpacity * monoOpacityMultiplier;
6702
+ const hueShiftAnimation = staticColors ? "" : `animation: beam-hue-shift-${id} 12s ease-in-out infinite;`;
6703
+ const hueShiftKeyframes = staticColors ? "" : `
6704
+ @keyframes beam-hue-shift-${id} {
6705
+ 0% { filter: hue-rotate(calc(var(--beam-hue-base, 0deg) - ${hueRange}deg)) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)}); }
6706
+ 50% { filter: hue-rotate(calc(var(--beam-hue-base, 0deg) + ${hueRange}deg)) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)}); }
6707
+ 100% { filter: hue-rotate(calc(var(--beam-hue-base, 0deg) - ${hueRange}deg)) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)}); }
6708
+ }`;
6709
+ const isDark = theme === "dark";
6710
+ const whiteGradient = isDark ? `conic-gradient(
6711
+ from var(--beam-angle-${id}),
6712
+ transparent 0%, transparent 54%,
6713
+ rgba(255, 255, 255, 0.1) 57%,
6714
+ rgba(255, 255, 255, 0.3) 60%,
6715
+ rgba(255, 255, 255, 0.6) 63%,
6716
+ rgba(255, 255, 255, 0.75) 66%,
6717
+ rgba(255, 255, 255, 0.6) 69%,
6718
+ rgba(255, 255, 255, 0.3) 72%,
6719
+ rgba(255, 255, 255, 0.1) 75%,
6720
+ transparent 78%, transparent 100%
6721
+ )` : `conic-gradient(
6722
+ from var(--beam-angle-${id}),
6723
+ transparent 0%, transparent 54%,
6724
+ rgba(0, 0, 0, 0.08) 57%,
6725
+ rgba(0, 0, 0, 0.2) 60%,
6726
+ rgba(0, 0, 0, 0.4) 63%,
6727
+ rgba(0, 0, 0, 0.55) 66%,
6728
+ rgba(0, 0, 0, 0.4) 69%,
6729
+ rgba(0, 0, 0, 0.2) 72%,
6730
+ rgba(0, 0, 0, 0.08) 75%,
6731
+ transparent 78%, transparent 100%
6732
+ )`;
6733
+ const colorGradients = getColorGradients(colorVariant);
6734
+ const innerGradients = getInnerGradients(colorVariant);
6735
+ const bloomGradient = isDark ? `conic-gradient(
6736
+ from var(--beam-angle-${id}),
6737
+ transparent 0%, transparent 58%,
6738
+ rgba(255, 255, 255, 0.03) 62%,
6739
+ rgba(255, 255, 255, 0.08) 65%,
6740
+ rgba(255, 255, 255, 0.2) 67%,
6741
+ rgba(255, 255, 255, 0.45) 69%,
6742
+ rgba(255, 255, 255, 0.85) 70%,
6743
+ rgba(255, 255, 255, 0.85) 70.5%,
6744
+ rgba(255, 255, 255, 0.45) 71.5%,
6745
+ rgba(255, 255, 255, 0.2) 73%,
6746
+ rgba(255, 255, 255, 0.08) 75%,
6747
+ rgba(255, 255, 255, 0.03) 78%,
6748
+ transparent 82%
6749
+ )` : `conic-gradient(
6750
+ from var(--beam-angle-${id}),
6751
+ transparent 0%, transparent 58%,
6752
+ rgba(0, 0, 0, 0.02) 62%,
6753
+ rgba(0, 0, 0, 0.08) 65%,
6754
+ rgba(0, 0, 0, 0.2) 67%,
6755
+ rgba(0, 0, 0, 0.4) 69%,
6756
+ rgba(0, 0, 0, 0.6) 70%,
6757
+ rgba(0, 0, 0, 0.6) 70.5%,
6758
+ rgba(0, 0, 0, 0.4) 71.5%,
6759
+ rgba(0, 0, 0, 0.2) 73%,
6760
+ rgba(0, 0, 0, 0.08) 75%,
6761
+ rgba(0, 0, 0, 0.02) 78%,
6762
+ transparent 82%
6763
+ )`;
6764
+ return `
6765
+ @property --beam-angle-${id} {
6766
+ syntax: "<angle>";
6767
+ initial-value: 0deg;
6768
+ inherits: true;
6769
+ }
6770
+
6771
+ @property --beam-opacity-${id} {
6772
+ syntax: "<number>";
6773
+ initial-value: 0;
6774
+ inherits: true;
6775
+ }
6776
+
6777
+ [data-beam="${id}"] {
6778
+ position: relative;
6779
+ border-radius: ${borderRadius}px;
6780
+ overflow: hidden;
6781
+ }
6782
+
6783
+ [data-beam="${id}"][data-active] {
6784
+ animation:
6785
+ beam-spin-${id} ${duration}s linear infinite,
6786
+ beam-fade-in-${id} 0.6s ease forwards;
6787
+ }
6788
+
6789
+ [data-beam="${id}"][data-fading] {
6790
+ animation:
6791
+ beam-spin-${id} ${duration}s linear infinite,
6792
+ beam-fade-out-${id} 0.5s ease forwards;
6793
+ }
6794
+
6795
+ [data-beam="${id}"][data-active]::after,
6796
+ [data-beam="${id}"][data-fading]::after {
6797
+ content: "";
6798
+ position: absolute;
6799
+ inset: 0;
6800
+ border-radius: ${innerRadius}px;
6801
+ padding: ${borderWidth}px;
6802
+ clip-path: inset(0 round ${borderRadius}px);
6803
+ background: ${whiteGradient},${colorGradients};
6804
+ -webkit-mask:
6805
+ conic-gradient(
6806
+ from var(--beam-angle-${id}),
6807
+ transparent 0%, transparent 30%,
6808
+ rgba(255, 255, 255, 0.1) 36%, rgba(255, 255, 255, 0.35) 44%,
6809
+ white 52%, white 80%,
6810
+ rgba(255, 255, 255, 0.35) 86%, rgba(255, 255, 255, 0.1) 92%,
6811
+ transparent 95%, transparent 100%
6812
+ ),
6813
+ linear-gradient(#fff 0 0) content-box,
6814
+ linear-gradient(#fff 0 0);
6815
+ -webkit-mask-composite: source-in, xor;
6816
+ mask:
6817
+ conic-gradient(
6818
+ from var(--beam-angle-${id}),
6819
+ transparent 0%, transparent 30%,
6820
+ rgba(255, 255, 255, 0.1) 36%, rgba(255, 255, 255, 0.35) 44%,
6821
+ white 52%, white 80%,
6822
+ rgba(255, 255, 255, 0.35) 86%, rgba(255, 255, 255, 0.1) 92%,
6823
+ transparent 95%, transparent 100%
6824
+ ),
6825
+ linear-gradient(#fff 0 0) content-box,
6826
+ linear-gradient(#fff 0 0);
6827
+ mask-composite: intersect, exclude;
6828
+ pointer-events: none;
6829
+ z-index: 2;
6830
+ opacity: calc(var(--beam-opacity-${id}) * ${finalStrokeOpacity.toFixed(2)} * var(--beam-stroke-opacity, 1) * var(--beam-strength, 1));
6831
+ ${hueShiftAnimation}
6832
+ }
6833
+
6834
+ [data-beam="${id}"][data-active]::before,
6835
+ [data-beam="${id}"][data-fading]::before {
6836
+ content: "";
6837
+ position: absolute;
6838
+ inset: 0;
6839
+ border-radius: ${borderRadius}px;
6840
+ background: ${innerGradients};
6841
+ box-shadow: inset 0 0 9px 1px ${innerShadow};
6842
+ -webkit-mask-image:
6843
+ conic-gradient(
6844
+ from var(--beam-angle-${id}),
6845
+ transparent 0%, transparent 30%,
6846
+ rgba(255, 255, 255, 0.1) 36%, rgba(255, 255, 255, 0.35) 44%,
6847
+ white 52%, white 80%,
6848
+ rgba(255, 255, 255, 0.35) 86%, rgba(255, 255, 255, 0.1) 92%,
6849
+ transparent 95%, transparent 100%
6850
+ ),
6851
+ linear-gradient(white, transparent 28px, transparent calc(100% - 28px), white),
6852
+ linear-gradient(to right, white, transparent 28px, transparent calc(100% - 28px), white);
6853
+ -webkit-mask-composite: source-in, source-over;
6854
+ mask-image:
6855
+ conic-gradient(
6856
+ from var(--beam-angle-${id}),
6857
+ transparent 0%, transparent 30%,
6858
+ rgba(255, 255, 255, 0.1) 36%, rgba(255, 255, 255, 0.35) 44%,
6859
+ white 52%, white 80%,
6860
+ rgba(255, 255, 255, 0.35) 86%, rgba(255, 255, 255, 0.1) 92%,
6861
+ transparent 95%, transparent 100%
6862
+ ),
6863
+ linear-gradient(white, transparent 28px, transparent calc(100% - 28px), white),
6864
+ linear-gradient(to right, white, transparent 28px, transparent calc(100% - 28px), white);
6865
+ mask-composite: intersect, add;
6866
+ pointer-events: none;
6867
+ z-index: 1;
6868
+ opacity: calc(var(--beam-opacity-${id}) * ${finalInnerOpacity.toFixed(2)} * var(--beam-inner-opacity, 1) * var(--beam-strength, 1));
6869
+ clip-path: inset(0 round ${borderRadius}px);
6870
+ ${hueShiftAnimation}
6871
+ }
6872
+
6873
+ [data-beam="${id}"] [data-beam-bloom] {
6874
+ display: none;
6875
+ position: absolute;
6876
+ inset: 0;
6877
+ border-radius: ${innerRadius}px;
6878
+ clip-path: inset(0 round ${borderRadius}px);
6879
+ background: ${bloomGradient};
6880
+ -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
6881
+ -webkit-mask-composite: xor;
6882
+ mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
6883
+ mask-composite: exclude;
6884
+ padding: ${borderWidth}px;
6885
+ filter: blur(8px) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)});
6886
+ pointer-events: none;
6887
+ z-index: 3;
6888
+ opacity: 0;
6889
+ }
6890
+
6891
+ [data-beam="${id}"][data-active] [data-beam-bloom],
6892
+ [data-beam="${id}"][data-fading] [data-beam-bloom] {
6893
+ display: block;
6894
+ opacity: calc(var(--beam-opacity-${id}) * ${finalBloomOpacity.toFixed(2)} * var(--beam-bloom-opacity, 1) * var(--beam-strength, 1));
6895
+ }
6896
+
6897
+ @keyframes beam-spin-${id} {
6898
+ to { --beam-angle-${id}: 360deg; }
6899
+ }
6900
+
6901
+ @keyframes beam-fade-in-${id} {
6902
+ to { --beam-opacity-${id}: 1; }
6903
+ }
6904
+
6905
+ @keyframes beam-fade-out-${id} {
6906
+ from { --beam-opacity-${id}: 1; }
6907
+ to { --beam-opacity-${id}: 0; }
6908
+ }
6909
+ ${hueShiftKeyframes}
6910
+ ${pausedAnimationsRule(id)}
6911
+ `;
6912
+ }
6913
+ function generatePulseInnerVariantCSS(options) {
6914
+ const {
6915
+ id,
6916
+ borderRadius,
6917
+ borderWidth,
6918
+ duration,
6919
+ strokeOpacity,
6920
+ innerOpacity,
6921
+ bloomOpacity,
6922
+ colorVariant,
6923
+ staticColors,
6924
+ brightness,
6925
+ saturation,
6926
+ theme
6927
+ } = options;
6928
+ const isDark = theme === "dark";
6929
+ const monoMul = colorVariant === "mono" ? 0.5 : 1;
6930
+ const sStroke = (strokeOpacity * monoMul).toFixed(2);
6931
+ const sInner = (innerOpacity * monoMul).toFixed(2);
6932
+ const sBloom = (bloomOpacity * monoMul).toFixed(2);
6933
+ const { op } = pulseParams("pulse-inner", theme, duration);
6934
+ const bloomBlur = 8;
6935
+ const b = brightness.toFixed(2);
6936
+ const s = saturation.toFixed(2);
6937
+ const ringAnim = staticColors ? `filter: brightness(${b}) saturate(${s});` : `filter: hue-rotate(calc(var(--beam-hue-base, 0deg) + var(--beam-hue-${id}))) brightness(${b}) saturate(${s});`;
6938
+ const bloomAnim = staticColors ? `filter: blur(${bloomBlur}px) brightness(${b}) saturate(${s});` : `filter: blur(${bloomBlur}px) hue-rotate(calc(var(--beam-hue-base, 0deg) + var(--beam-hue-${id}))) brightness(${b}) saturate(${s});`;
6939
+ const ringGradients = pulseRingGradients(colorVariant, id);
6940
+ const innerGradients = pulseInnerGradients(colorVariant, id, isDark);
6941
+ const bloomGradients = pulseTableGradientsStatic(PULSE_INNER_BLOOM, colorVariant, 1 - op * 0.5);
6942
+ return `
6943
+ ${pulsePropertyRegs(id)}
6944
+
6945
+ [data-beam="${id}"] {
6946
+ position: relative;
6947
+ border-radius: ${borderRadius}px;
6948
+ overflow: hidden;
6949
+ isolation: isolate;
6950
+ }
6951
+
6952
+ [data-beam="${id}"][data-active] {
6953
+ ${pulseWrapperAnimation(id, "beam-fade-in", 0.6)}
6954
+ }
6955
+
6956
+ [data-beam="${id}"][data-fading] {
6957
+ ${pulseWrapperAnimation(id, "beam-fade-out", 0.5)}
6958
+ }
6959
+
6960
+ [data-beam="${id}"][data-active]::after,
6961
+ [data-beam="${id}"][data-fading]::after {
6962
+ content: "";
6963
+ position: absolute;
6964
+ inset: 0;
6965
+ border-radius: ${borderRadius}px;
6966
+ padding: ${borderWidth}px;
6967
+ clip-path: inset(0 round ${borderRadius}px);
6968
+ background: ${ringGradients};
6969
+ -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
6970
+ -webkit-mask-composite: xor;
6971
+ mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
6972
+ mask-composite: exclude;
6973
+ pointer-events: none;
6974
+ z-index: 2;
6975
+ will-change: opacity, filter;
6976
+ opacity: calc(var(--beam-opacity-${id}) * ${sStroke} * var(--beam-stroke-opacity, 1) * var(--beam-strength, 1));
6977
+ ${ringAnim}
6978
+ }
6979
+
6980
+ [data-beam="${id}"][data-active]::before,
6981
+ [data-beam="${id}"][data-fading]::before {
6982
+ content: "";
6983
+ position: absolute;
6984
+ inset: 0;
6985
+ border-radius: ${borderRadius}px;
6986
+ clip-path: inset(0 round ${borderRadius}px);
6987
+ background: ${innerGradients};
6988
+ -webkit-mask-image:
6989
+ linear-gradient(white, transparent 28px, transparent calc(100% - 28px), white),
6990
+ linear-gradient(to right, white, transparent 28px, transparent calc(100% - 28px), white);
6991
+ -webkit-mask-composite: source-over;
6992
+ mask-image:
6993
+ linear-gradient(white, transparent 28px, transparent calc(100% - 28px), white),
6994
+ linear-gradient(to right, white, transparent 28px, transparent calc(100% - 28px), white);
6995
+ mask-composite: add;
6996
+ pointer-events: none;
6997
+ z-index: 1;
6998
+ will-change: opacity, filter;
6999
+ opacity: calc(var(--beam-opacity-${id}) * ${sInner} * var(--beam-inner-opacity, 1) * var(--beam-strength, 1));
7000
+ ${ringAnim}
7001
+ }
7002
+
7003
+ [data-beam="${id}"] [data-beam-bloom] {
7004
+ display: none;
7005
+ position: absolute;
7006
+ inset: 0;
7007
+ border-radius: ${borderRadius}px;
7008
+ clip-path: inset(0 round ${borderRadius}px);
7009
+ background: ${bloomGradients};
7010
+ -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
7011
+ -webkit-mask-composite: xor;
7012
+ mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
7013
+ mask-composite: exclude;
7014
+ padding: ${borderWidth}px;
7015
+ pointer-events: none;
7016
+ z-index: 3;
7017
+ will-change: opacity;
7018
+ opacity: 0;
7019
+ }
7020
+
7021
+ [data-beam="${id}"][data-active] [data-beam-bloom],
7022
+ [data-beam="${id}"][data-fading] [data-beam-bloom] {
7023
+ display: block;
7024
+ opacity: calc(var(--beam-opacity-${id}) * ${sBloom} * var(--beam-bloom-opacity, 1) * var(--beam-strength, 1));
7025
+ ${bloomAnim}
7026
+ }
7027
+
7028
+ @keyframes beam-fade-in-${id} { to { --beam-opacity-${id}: 1; } }
7029
+ @keyframes beam-fade-out-${id} { from { --beam-opacity-${id}: 1; } to { --beam-opacity-${id}: 0; } }
7030
+ ${pausedAnimationsRule(id)}
7031
+
7032
+ @media (prefers-reduced-motion: reduce) {
7033
+ [data-beam="${id}"][data-active],
7034
+ [data-beam="${id}"][data-fading],
7035
+ [data-beam="${id}"][data-active]::after,
7036
+ [data-beam="${id}"][data-fading]::after,
7037
+ [data-beam="${id}"][data-active]::before,
7038
+ [data-beam="${id}"][data-fading]::before,
7039
+ [data-beam="${id}"][data-active] [data-beam-bloom],
7040
+ [data-beam="${id}"][data-fading] [data-beam-bloom] {
7041
+ animation: none !important;
7042
+ }
7043
+ }
7044
+ `;
7045
+ }
7046
+ function generatePulseOuterVariantCSS(options) {
7047
+ const {
7048
+ id,
7049
+ borderRadius,
7050
+ duration,
7051
+ strokeOpacity,
7052
+ innerOpacity,
7053
+ bloomOpacity,
7054
+ colorVariant,
7055
+ staticColors,
7056
+ brightness,
7057
+ saturation,
7058
+ theme,
7059
+ hairlineOpacity = 0
7060
+ } = options;
7061
+ const isDark = theme === "dark";
7062
+ const monoMul = colorVariant === "mono" ? 0.5 : 1;
7063
+ const sStroke = (strokeOpacity * monoMul).toFixed(2);
7064
+ const sInner = (innerOpacity * monoMul).toFixed(2);
7065
+ const sBloom = (bloomOpacity * monoMul).toFixed(2);
7066
+ const hairRGB = isDark ? "70, 70, 70" : "0, 0, 0";
7067
+ const hairOp = hairlineOpacity.toFixed(2);
7068
+ const hairlineLine = `linear-gradient(rgba(${hairRGB}, ${hairOp}), rgba(${hairRGB}, ${hairOp}))`;
7069
+ const { op } = pulseParams("pulse-outside", theme, duration);
7070
+ const sw = 0.95;
7071
+ const sh = 0.9;
7072
+ const glowBlur = isDark ? 3 : 6;
7073
+ const bloomBlur = isDark ? 22.5 : 15;
7074
+ const b = brightness.toFixed(2);
7075
+ const s = saturation.toFixed(2);
7076
+ const strokeAnim = staticColors ? `filter: brightness(${b}) saturate(${s});` : `filter: hue-rotate(calc(var(--beam-hue-base, 0deg) + var(--beam-hue-${id}))) brightness(${b}) saturate(${s});`;
7077
+ const glowBright = `brightness(var(--beam-glow-brightness, ${b})) saturate(var(--beam-glow-saturate, ${s}))`;
7078
+ const coreAnim = staticColors ? `filter: blur(var(--beam-core-blur, ${glowBlur}px)) ${glowBright};` : `filter: blur(var(--beam-core-blur, ${glowBlur}px)) hue-rotate(calc(var(--beam-hue-base, 0deg) + var(--beam-hue-${id}))) ${glowBright};`;
7079
+ const bloomAnim = staticColors ? `filter: blur(var(--beam-bloom-blur, ${bloomBlur}px)) ${glowBright};` : `filter: blur(var(--beam-bloom-blur, ${bloomBlur}px)) hue-rotate(calc(var(--beam-hue-base, 0deg) + var(--beam-hue-${id}))) ${glowBright};`;
7080
+ const strokeGradients = pulseTableGradients(PULSE_OUTER_CORE, colorVariant, id);
7081
+ const coreGradients = pulseTableGradients(PULSE_OUTER_CORE, colorVariant, id);
7082
+ const bloomGradients = pulseTableGradientsStatic(PULSE_OUTER_BLOOM, colorVariant, 1 - op * 0.5);
7083
+ const strokeBackground = hairlineOpacity > 0 ? `${strokeGradients},
7084
+ ${hairlineLine}` : strokeGradients;
7085
+ return `
7086
+ ${pulsePropertyRegs(id)}
7087
+
7088
+ [data-beam="${id}"] {
7089
+ position: relative;
7090
+ border-radius: ${borderRadius}px;
7091
+ overflow: visible;
7092
+ isolation: isolate;
7093
+ }
7094
+
7095
+ [data-beam="${id}"][data-active] {
7096
+ ${pulseWrapperAnimation(id, "beam-fade-in", 0.6)}
7097
+ }
7098
+
7099
+ [data-beam="${id}"][data-fading] {
7100
+ ${pulseWrapperAnimation(id, "beam-fade-out", 0.5)}
7101
+ }
7102
+ ${hairlineOpacity > 0 ? `
7103
+ /* Idle hairline \u2014 painted above the (opaque) child in the inner 1px edge ring so
7104
+ it overlaps a standard inset component border exactly. */
7105
+ [data-beam="${id}"]::after {
7106
+ content: "";
7107
+ position: absolute;
7108
+ inset: 0;
7109
+ border-radius: ${borderRadius}px;
7110
+ padding: 1px;
7111
+ clip-path: inset(0 round ${borderRadius}px);
7112
+ background: ${hairlineLine};
7113
+ -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
7114
+ -webkit-mask-composite: xor;
7115
+ mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
7116
+ mask-composite: exclude;
7117
+ pointer-events: none;
7118
+ z-index: 2;
7119
+ }
7120
+ ` : ""}
7121
+ [data-beam="${id}"][data-active]::after,
7122
+ [data-beam="${id}"][data-fading]::after {
7123
+ content: "";
7124
+ position: absolute;
7125
+ inset: 0;
7126
+ border-radius: ${borderRadius}px;
7127
+ padding: 1px;
7128
+ clip-path: inset(0 round ${borderRadius}px);
7129
+ background: ${strokeBackground};
7130
+ -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
7131
+ -webkit-mask-composite: xor;
7132
+ mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
7133
+ mask-composite: exclude;
7134
+ pointer-events: none;
7135
+ z-index: 2;
7136
+ will-change: opacity, filter;
7137
+ opacity: calc(var(--beam-opacity-${id}) * ${sStroke} * var(--beam-stroke-opacity, 1) * var(--beam-strength, 1));
7138
+ ${strokeAnim}
7139
+ }
7140
+
7141
+ [data-beam="${id}"][data-active]::before,
7142
+ [data-beam="${id}"][data-fading]::before {
7143
+ content: "";
7144
+ position: absolute;
7145
+ inset: -10px;
7146
+ z-index: -1;
7147
+ border-radius: ${borderRadius + 10}px;
7148
+ background: ${coreGradients};
7149
+ transform: scale(${sw}, ${sh});
7150
+ pointer-events: none;
7151
+ will-change: opacity, filter;
7152
+ opacity: calc(var(--beam-opacity-${id}) * ${sInner} * var(--beam-inner-opacity, 1) * var(--beam-strength, 1));
7153
+ ${coreAnim}
7154
+ }
7155
+
7156
+ [data-beam="${id}"] [data-beam-bloom] {
7157
+ display: none;
7158
+ position: absolute;
7159
+ inset: -30px;
7160
+ z-index: -1;
7161
+ border-radius: ${borderRadius + 30}px;
7162
+ background: ${bloomGradients};
7163
+ transform: scale(${sw}, ${sh});
7164
+ pointer-events: none;
7165
+ will-change: transform;
7166
+ opacity: 0;
7167
+ }
7168
+
7169
+ [data-beam="${id}"][data-active] [data-beam-bloom],
7170
+ [data-beam="${id}"][data-fading] [data-beam-bloom] {
7171
+ display: block;
7172
+ opacity: calc(var(--beam-opacity-${id}) * ${sBloom} * var(--beam-bloom-opacity, 1) * var(--beam-strength, 1));
7173
+ ${bloomAnim}
7174
+ }
7175
+
7176
+ @keyframes beam-fade-in-${id} { to { --beam-opacity-${id}: 1; } }
7177
+ @keyframes beam-fade-out-${id} { from { --beam-opacity-${id}: 1; } to { --beam-opacity-${id}: 0; } }
7178
+ ${pausedAnimationsRule(id)}
7179
+
7180
+ @media (prefers-reduced-motion: reduce) {
7181
+ [data-beam="${id}"][data-active],
7182
+ [data-beam="${id}"][data-fading],
7183
+ [data-beam="${id}"][data-active]::after,
7184
+ [data-beam="${id}"][data-fading]::after,
7185
+ [data-beam="${id}"][data-active]::before,
7186
+ [data-beam="${id}"][data-fading]::before,
7187
+ [data-beam="${id}"][data-active] [data-beam-bloom],
7188
+ [data-beam="${id}"][data-fading] [data-beam-bloom] {
7189
+ animation: none !important;
7190
+ }
7191
+ }
7192
+ `;
7193
+ }
7194
+ function generateLineVariantCSS(options) {
7195
+ const {
7196
+ id,
7197
+ borderRadius,
7198
+ borderWidth,
7199
+ duration,
7200
+ strokeOpacity,
7201
+ innerOpacity,
7202
+ bloomOpacity,
7203
+ innerShadow,
7204
+ colorVariant,
7205
+ staticColors,
7206
+ brightness,
7207
+ saturation,
7208
+ hueRange,
7209
+ theme
7210
+ } = options;
7211
+ const innerRadius = Math.max(0, borderRadius - borderWidth);
7212
+ const isDark = theme === "dark";
7213
+ const finalStrokeOpacity = strokeOpacity;
7214
+ const finalInnerOpacity = innerOpacity;
7215
+ const finalBloomOpacity = bloomOpacity;
7216
+ const hueShiftAnimation = staticColors ? "" : `animation: beam-hue-shift-${id} 12s ease-in-out infinite;`;
7217
+ const hueShiftBloomAnimation = staticColors ? "" : `animation: beam-hue-shift-bloom-${id} 8s ease-in-out infinite;`;
7218
+ const hueShiftKeyframes = staticColors ? "" : `
7219
+ @keyframes beam-hue-shift-${id} {
7220
+ 0% { filter: hue-rotate(calc(var(--beam-hue-base, 0deg) - ${hueRange}deg)) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)}); }
7221
+ 50% { filter: hue-rotate(calc(var(--beam-hue-base, 0deg) + ${hueRange}deg)) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)}); }
7222
+ 100% { filter: hue-rotate(calc(var(--beam-hue-base, 0deg) - ${hueRange}deg)) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)}); }
7223
+ }
7224
+
7225
+ @keyframes beam-hue-shift-bloom-${id} {
7226
+ 0% { filter: blur(8px) hue-rotate(calc(var(--beam-hue-base, 0deg) - ${hueRange + 10}deg)) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)}); }
7227
+ 50% { filter: blur(8px) hue-rotate(calc(var(--beam-hue-base, 0deg) + ${hueRange + 10}deg)) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)}); }
7228
+ 100% { filter: blur(8px) hue-rotate(calc(var(--beam-hue-base, 0deg) - ${hueRange + 10}deg)) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)}); }
7229
+ }`;
7230
+ const whiteHighlight = isDark ? `radial-gradient(
7231
+ ellipse calc(24px * var(--beam-w-${id})) calc(28px * var(--beam-h-${id})) at calc(var(--beam-x-${id}) * 100%) calc(100% + 2px),
7232
+ rgba(255, 255, 255, 0.38) 0%,
7233
+ rgba(255, 255, 255, 0.12) 30%,
7234
+ transparent 65%
7235
+ )` : `radial-gradient(
7236
+ ellipse calc(35px * var(--beam-w-${id})) calc(28px * var(--beam-h-${id})) at calc(var(--beam-x-${id}) * 100%) calc(100% + 2px),
7237
+ rgba(0, 0, 0, 0.6) 0%,
7238
+ rgba(0, 0, 0, 0.25) 35%,
7239
+ transparent 70%
7240
+ )`;
7241
+ const colorGradients = getLineColorGradients(colorVariant, isDark, id);
7242
+ const innerGradients = getLineInnerGradients(colorVariant, id);
7243
+ const bloomGradients = getLineBloomGradients(colorVariant, isDark, id);
7244
+ const monoBloomBlur = colorVariant === "mono" ? "filter: blur(6px);" : "";
7245
+ return `
7246
+ @property --beam-x-${id} {
7247
+ syntax: "<number>";
7248
+ initial-value: 0;
7249
+ inherits: true;
7250
+ }
7251
+
7252
+ @property --beam-w-${id} {
7253
+ syntax: "<number>";
7254
+ initial-value: 1;
7255
+ inherits: true;
7256
+ }
7257
+
7258
+ @property --beam-h-${id} {
7259
+ syntax: "<number>";
7260
+ initial-value: 1;
7261
+ inherits: true;
7262
+ }
7263
+
7264
+ @property --beam-spike-${id} {
7265
+ syntax: "<number>";
7266
+ initial-value: 1;
7267
+ inherits: true;
7268
+ }
7269
+
7270
+ @property --beam-spike2-${id} {
7271
+ syntax: "<number>";
7272
+ initial-value: 1;
7273
+ inherits: true;
7274
+ }
7275
+
7276
+ @property --beam-edge-${id} {
7277
+ syntax: "<number>";
7278
+ initial-value: 1;
7279
+ inherits: true;
7280
+ }
7281
+
7282
+ @property --beam-opacity-${id} {
7283
+ syntax: "<number>";
7284
+ initial-value: 0;
7285
+ inherits: true;
7286
+ }
7287
+
7288
+ [data-beam="${id}"] {
7289
+ position: relative;
7290
+ border-radius: ${borderRadius}px;
7291
+ overflow: hidden;
7292
+ }
7293
+
7294
+ [data-beam="${id}"][data-active] {
7295
+ animation:
7296
+ beam-travel-${id} ${duration}s linear infinite,
7297
+ beam-edge-fade-${id} ${duration}s linear infinite,
7298
+ beam-breathe-${id} ${(duration * 1.3).toFixed(1)}s ease-in-out infinite,
7299
+ beam-spike-${id} ${(duration * 1.33).toFixed(1)}s ease-in-out infinite,
7300
+ beam-spike2-${id} ${(duration * 1.7).toFixed(1)}s ease-in-out infinite,
7301
+ beam-fade-in-${id} 0.6s ease forwards;
7302
+ }
7303
+
7304
+ [data-beam="${id}"][data-fading] {
7305
+ animation:
7306
+ beam-travel-${id} ${duration}s linear infinite,
7307
+ beam-edge-fade-${id} ${duration}s linear infinite,
7308
+ beam-breathe-${id} ${(duration * 1.3).toFixed(1)}s ease-in-out infinite,
7309
+ beam-spike-${id} ${(duration * 1.33).toFixed(1)}s ease-in-out infinite,
7310
+ beam-spike2-${id} ${(duration * 1.7).toFixed(1)}s ease-in-out infinite,
7311
+ beam-fade-out-${id} 0.5s ease forwards;
7312
+ }
7313
+
7314
+ [data-beam="${id}"][data-active]::after,
7315
+ [data-beam="${id}"][data-fading]::after {
7316
+ content: "";
7317
+ position: absolute;
7318
+ inset: 0;
7319
+ border-radius: ${innerRadius}px;
7320
+ padding: ${borderWidth}px;
7321
+ clip-path: inset(0 round ${borderRadius}px);
7322
+ background: ${whiteHighlight}, ${colorGradients};
7323
+ -webkit-mask:
7324
+ radial-gradient(
7325
+ ellipse calc(78px * var(--beam-w-${id})) calc(60px * var(--beam-h-${id})) at calc(var(--beam-x-${id}) * 100%) 100%,
7326
+ white 0%, rgba(255, 255, 255, 0.5) 45%, transparent 100%
7327
+ ),
7328
+ linear-gradient(#fff 0 0) content-box,
7329
+ linear-gradient(#fff 0 0);
7330
+ -webkit-mask-composite: source-in, xor;
7331
+ mask:
7332
+ radial-gradient(
7333
+ ellipse calc(78px * var(--beam-w-${id})) calc(60px * var(--beam-h-${id})) at calc(var(--beam-x-${id}) * 100%) 100%,
7334
+ white 0%, rgba(255, 255, 255, 0.5) 45%, transparent 100%
7335
+ ),
7336
+ linear-gradient(#fff 0 0) content-box,
7337
+ linear-gradient(#fff 0 0);
7338
+ mask-composite: intersect, exclude;
7339
+ pointer-events: none;
7340
+ z-index: 2;
7341
+ opacity: calc(var(--beam-opacity-${id}) * var(--beam-edge-${id}) * ${finalStrokeOpacity.toFixed(2)} * var(--beam-stroke-opacity, 1) * var(--beam-strength, 1));
7342
+ ${hueShiftAnimation}
7343
+ }
7344
+
7345
+ [data-beam="${id}"][data-active]::before,
7346
+ [data-beam="${id}"][data-fading]::before {
7347
+ content: "";
7348
+ position: absolute;
7349
+ inset: 0;
7350
+ border-radius: ${borderRadius}px;
7351
+ background: ${innerGradients};
7352
+ box-shadow: inset 0 0 9px 1px ${innerShadow};
7353
+ -webkit-mask-image:
7354
+ radial-gradient(
7355
+ ellipse calc(78px * var(--beam-w-${id})) calc(60px * var(--beam-h-${id})) at calc(var(--beam-x-${id}) * 100%) 100%,
7356
+ white 0%, rgba(255, 255, 255, 0.5) 45%, transparent 100%
7357
+ ),
7358
+ linear-gradient(white, transparent 28px, transparent calc(100% - 28px), white),
7359
+ linear-gradient(to right, white, transparent 28px, transparent calc(100% - 28px), white);
7360
+ -webkit-mask-composite: source-in, source-over;
7361
+ mask-image:
7362
+ radial-gradient(
7363
+ ellipse calc(78px * var(--beam-w-${id})) calc(60px * var(--beam-h-${id})) at calc(var(--beam-x-${id}) * 100%) 100%,
7364
+ white 0%, rgba(255, 255, 255, 0.5) 45%, transparent 100%
7365
+ ),
7366
+ linear-gradient(white, transparent 28px, transparent calc(100% - 28px), white),
7367
+ linear-gradient(to right, white, transparent 28px, transparent calc(100% - 28px), white);
7368
+ mask-composite: intersect, add;
7369
+ pointer-events: none;
7370
+ z-index: 1;
7371
+ opacity: calc(var(--beam-opacity-${id}) * var(--beam-edge-${id}) * ${finalInnerOpacity.toFixed(2)} * var(--beam-inner-opacity, 1) * var(--beam-strength, 1));
7372
+ clip-path: inset(0 round ${borderRadius}px);
7373
+ ${hueShiftAnimation}
7374
+ }
7375
+
7376
+ [data-beam="${id}"] [data-beam-bloom] {
7377
+ display: none;
7378
+ position: absolute;
7379
+ inset: 0;
7380
+ border-radius: ${innerRadius}px;
7381
+ clip-path: inset(0 round ${borderRadius}px);
7382
+ padding: 0;
7383
+ -webkit-mask: radial-gradient(
7384
+ ellipse calc(84px * var(--beam-w-${id})) calc(110px * var(--beam-h-${id})) at calc(var(--beam-x-${id}) * 100%) 100%,
7385
+ white 0%, rgba(255, 255, 255, 0.5) 35%, transparent 100%
7386
+ );
7387
+ -webkit-mask-composite: source-over;
7388
+ mask: radial-gradient(
7389
+ ellipse calc(84px * var(--beam-w-${id})) calc(110px * var(--beam-h-${id})) at calc(var(--beam-x-${id}) * 100%) 100%,
7390
+ white 0%, rgba(255, 255, 255, 0.5) 35%, transparent 100%
7391
+ );
7392
+ mask-composite: add;
7393
+ background: ${bloomGradients};
7394
+ ${monoBloomBlur}
7395
+ pointer-events: none;
7396
+ z-index: 3;
7397
+ opacity: 0;
7398
+ }
7399
+
7400
+ [data-beam="${id}"][data-active] [data-beam-bloom],
7401
+ [data-beam="${id}"][data-fading] [data-beam-bloom] {
7402
+ display: block;
7403
+ opacity: calc(var(--beam-opacity-${id}) * var(--beam-edge-${id}) * ${finalBloomOpacity.toFixed(2)} * var(--beam-bloom-opacity, 1) * var(--beam-strength, 1));
7404
+ ${hueShiftBloomAnimation}
7405
+ }
7406
+
7407
+ @keyframes beam-travel-${id} {
7408
+ 0% { --beam-x-${id}: 0.06; --beam-w-${id}: 0.5; }
7409
+ 10% { --beam-x-${id}: 0.15; --beam-w-${id}: 0.8; }
7410
+ 20% { --beam-x-${id}: 0.25; --beam-w-${id}: 1.1; }
7411
+ 30% { --beam-x-${id}: 0.35; --beam-w-${id}: 1.3; }
7412
+ 40% { --beam-x-${id}: 0.44; --beam-w-${id}: 1.45; }
7413
+ 50% { --beam-x-${id}: 0.5; --beam-w-${id}: 1.5; }
7414
+ 60% { --beam-x-${id}: 0.56; --beam-w-${id}: 1.45; }
7415
+ 70% { --beam-x-${id}: 0.65; --beam-w-${id}: 1.3; }
7416
+ 80% { --beam-x-${id}: 0.75; --beam-w-${id}: 1.1; }
7417
+ 90% { --beam-x-${id}: 0.85; --beam-w-${id}: 0.8; }
7418
+ 100% { --beam-x-${id}: 0.94; --beam-w-${id}: 0.5; }
7419
+ }
7420
+
7421
+ @keyframes beam-edge-fade-${id} {
7422
+ 0% { --beam-edge-${id}: 0; }
7423
+ 12.5% { --beam-edge-${id}: 0; }
7424
+ 32.5% { --beam-edge-${id}: 1; }
7425
+ 67.5% { --beam-edge-${id}: 1; }
7426
+ 87.5% { --beam-edge-${id}: 0; }
7427
+ 100% { --beam-edge-${id}: 0; }
7428
+ }
7429
+
7430
+ @keyframes beam-breathe-${id} {
7431
+ 0%, 100% { --beam-h-${id}: 0.8; }
7432
+ 25% { --beam-h-${id}: 1.25; }
7433
+ 55% { --beam-h-${id}: 0.85; }
7434
+ 80% { --beam-h-${id}: 1.3; }
7435
+ }
7436
+
7437
+ @keyframes beam-spike-${id} {
7438
+ 0% { --beam-spike-${id}: 0.8; }
7439
+ 25% { --beam-spike-${id}: 1.3; }
7440
+ 50% { --beam-spike-${id}: 0.9; }
7441
+ 75% { --beam-spike-${id}: 1.4; }
7442
+ 100% { --beam-spike-${id}: 0.8; }
7443
+ }
7444
+
7445
+ @keyframes beam-spike2-${id} {
7446
+ 0% { --beam-spike2-${id}: 1.2; }
7447
+ 25% { --beam-spike2-${id}: 0.7; }
7448
+ 50% { --beam-spike2-${id}: 1.4; }
7449
+ 75% { --beam-spike2-${id}: 0.8; }
7450
+ 100% { --beam-spike2-${id}: 1.2; }
7451
+ }
7452
+
7453
+ @keyframes beam-fade-in-${id} {
7454
+ to { --beam-opacity-${id}: 1; }
7455
+ }
7456
+
7457
+ @keyframes beam-fade-out-${id} {
7458
+ from { --beam-opacity-${id}: 1; }
7459
+ to { --beam-opacity-${id}: 0; }
7460
+ }
7461
+ ${hueShiftKeyframes}
7462
+ ${pausedAnimationsRule(id)}
7463
+ `;
7464
+ }
7465
+
7466
+ // src/components/ui/border-beam/pulseDriver.ts
7467
+ var instances = /* @__PURE__ */ new Set();
7468
+ var rafId = null;
7469
+ var lastFrame = 0;
7470
+ var FRAME_INTERVAL = 1e3 / 30 - 2;
7471
+ var TWO_PI = Math.PI * 2;
7472
+ function pingPong(phase) {
7473
+ return (1 - Math.cos(TWO_PI * phase)) / 2;
7474
+ }
7475
+ function frame(ts) {
7476
+ rafId = requestAnimationFrame(frame);
7477
+ if (ts - lastFrame < FRAME_INTERVAL) return;
7478
+ lastFrame = ts;
7479
+ const tSec = ts / 1e3;
7480
+ instances.forEach(({ el, config }) => {
7481
+ for (const osc of config.oscillators) {
7482
+ const phase = (tSec - osc.delay) / osc.period;
7483
+ const value = osc.a + (osc.b - osc.a) * pingPong(phase);
7484
+ el.style.setProperty(
7485
+ osc.prop,
7486
+ osc.unit === "px" ? `${value.toFixed(2)}px` : value.toFixed(4)
7487
+ );
7488
+ }
7489
+ if (config.hue) {
7490
+ const { prop, range, period, continuous } = config.hue;
7491
+ const value = continuous ? tSec / period % 1 * range : -range + 2 * range * pingPong(tSec / period);
7492
+ el.style.setProperty(prop, `${value.toFixed(2)}deg`);
7493
+ }
7494
+ });
7495
+ }
7496
+ function startLoop() {
7497
+ if (rafId == null) {
7498
+ lastFrame = 0;
7499
+ rafId = requestAnimationFrame(frame);
7500
+ }
7501
+ }
7502
+ function stopLoopIfIdle() {
7503
+ if (instances.size === 0 && rafId != null) {
7504
+ cancelAnimationFrame(rafId);
7505
+ rafId = null;
7506
+ }
7507
+ }
7508
+ function registerPulseInstance(el, config) {
7509
+ const instance = { el, config };
7510
+ instances.add(instance);
7511
+ startLoop();
7512
+ return () => {
7513
+ instances.delete(instance);
7514
+ stopLoopIfIdle();
7515
+ };
7516
+ }
7517
+ function documentTheme() {
7518
+ if (typeof document === "undefined") return null;
7519
+ const root = document.documentElement;
7520
+ const attr = root.getAttribute("data-theme");
7521
+ if (attr === "dark" || attr === "light") return attr;
7522
+ if (root.classList.contains("dark")) return "dark";
7523
+ if (root.classList.contains("light")) return "light";
7524
+ return null;
7525
+ }
7526
+ function useSystemTheme(enabled) {
7527
+ const [theme, setTheme] = react.useState(() => {
7528
+ const fromDocument = documentTheme();
7529
+ if (fromDocument) return fromDocument;
7530
+ if (typeof window === "undefined") return "dark";
7531
+ return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
7532
+ });
7533
+ react.useEffect(() => {
7534
+ if (!enabled || typeof window === "undefined") return;
7535
+ const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
7536
+ const resolve = () => {
7537
+ setTheme(documentTheme() ?? (mediaQuery.matches ? "dark" : "light"));
7538
+ };
7539
+ resolve();
7540
+ mediaQuery.addEventListener("change", resolve);
7541
+ const observer = typeof MutationObserver !== "undefined" ? new MutationObserver(resolve) : null;
7542
+ observer?.observe(document.documentElement, {
7543
+ attributes: true,
7544
+ attributeFilter: ["class", "data-theme"]
7545
+ });
7546
+ return () => {
7547
+ mediaQuery.removeEventListener("change", resolve);
7548
+ observer?.disconnect();
7549
+ };
7550
+ }, [enabled]);
7551
+ return theme;
7552
+ }
7553
+ function resolveTheme(theme, systemTheme) {
7554
+ return theme === "auto" ? systemTheme : theme;
7555
+ }
7556
+ var BorderBeam = react.forwardRef(
7557
+ function BorderBeam2({
7558
+ children,
7559
+ size = "md",
7560
+ colorVariant = "colorful",
7561
+ theme = "dark",
7562
+ staticColors = false,
7563
+ duration,
7564
+ active = true,
7565
+ borderRadius: customBorderRadius,
7566
+ brightness: brightnessProp,
7567
+ saturation,
7568
+ hueRange = 30,
7569
+ strength = 1,
7570
+ className,
7571
+ style,
7572
+ onActivate,
7573
+ onDeactivate,
7574
+ onAnimationEnd: consumerOnAnimationEnd,
7575
+ ...props
7576
+ }, ref) {
7577
+ const baseId = react.useId();
7578
+ const id = baseId.replace(/:/g, "-");
7579
+ const internalRef = react.useRef(null);
7580
+ const [isActive, setIsActive] = react.useState(active);
7581
+ const [isFading, setIsFading] = react.useState(false);
7582
+ const [isVisible, setIsVisible] = react.useState(true);
7583
+ const [detectedRadius, setDetectedRadius] = react.useState(null);
7584
+ const [pulseGlowScale, setPulseGlowScale] = react.useState({ x: 1, y: 1 });
7585
+ const effectsOn = isActive || isFading;
7586
+ const systemTheme = useSystemTheme(effectsOn);
7587
+ react.useEffect(() => {
7588
+ if (!effectsOn || customBorderRadius != null) return;
7589
+ const el = internalRef.current;
7590
+ if (!el) return;
7591
+ const detect = () => {
7592
+ const child = el.firstElementChild;
7593
+ if (!child) return;
7594
+ const computed = getComputedStyle(child);
7595
+ const raw = parseFloat(computed.borderTopLeftRadius);
7596
+ if (!isNaN(raw) && raw > 0) {
7597
+ setDetectedRadius(raw);
7598
+ }
7599
+ };
7600
+ detect();
7601
+ const observer = new MutationObserver(detect);
7602
+ observer.observe(el, { childList: true, subtree: false });
7603
+ return () => observer.disconnect();
7604
+ }, [effectsOn, customBorderRadius, children]);
7605
+ react.useEffect(() => {
7606
+ if (active && !isActive && !isFading) {
7607
+ setIsActive(true);
7608
+ } else if (!active && isActive && !isFading) {
7609
+ setIsFading(true);
7610
+ }
7611
+ }, [active, isActive, isFading]);
7612
+ react.useEffect(() => {
7613
+ if (!effectsOn) return;
7614
+ const el = internalRef.current;
7615
+ if (!el || typeof IntersectionObserver === "undefined") return;
7616
+ const observer = new IntersectionObserver(
7617
+ (entries) => {
7618
+ for (const entry of entries) setIsVisible(entry.isIntersecting);
7619
+ },
7620
+ // Start animating slightly before the element scrolls into view.
7621
+ { rootMargin: "256px" }
7622
+ );
7623
+ observer.observe(el);
7624
+ return () => observer.disconnect();
7625
+ }, [effectsOn]);
7626
+ react.useEffect(() => {
7627
+ if (!effectsOn || size !== "pulse-outside") {
7628
+ setPulseGlowScale({ x: 1, y: 1 });
7629
+ return;
7630
+ }
7631
+ const el = internalRef.current;
7632
+ if (!el) return;
7633
+ const REF_WIDTH = 350;
7634
+ const REF_HEIGHT = 140;
7635
+ const MIN_SCALE = 0.35;
7636
+ const MAX_SCALE = 4;
7637
+ const clamp = (value) => Math.max(MIN_SCALE, Math.min(MAX_SCALE, value));
7638
+ const measure = () => {
7639
+ const child2 = el.firstElementChild;
7640
+ if (!child2) return;
7641
+ const rect = child2.getBoundingClientRect();
7642
+ if (!rect.width || !rect.height) return;
7643
+ const x = +clamp(rect.width / REF_WIDTH).toFixed(3);
7644
+ const y = +clamp(rect.height / REF_HEIGHT).toFixed(3);
7645
+ setPulseGlowScale((prev) => prev.x === x && prev.y === y ? prev : { x, y });
7646
+ };
7647
+ measure();
7648
+ if (typeof ResizeObserver === "undefined") return;
7649
+ const child = el.firstElementChild;
7650
+ if (!child) return;
7651
+ const resizeObserver = new ResizeObserver(measure);
7652
+ resizeObserver.observe(child);
7653
+ return () => resizeObserver.disconnect();
7654
+ }, [effectsOn, size, children]);
7655
+ const handleAnimationEnd = react.useCallback(
7656
+ (e) => {
7657
+ const animationName = e.animationName;
7658
+ if (animationName.includes("fade-out")) {
7659
+ setIsActive(false);
7660
+ setIsFading(false);
7661
+ onDeactivate?.();
7662
+ } else if (animationName.includes("fade-in")) {
7663
+ onActivate?.();
7664
+ }
7665
+ consumerOnAnimationEnd?.(e);
5207
7666
  },
5208
- ...props
5209
- }
5210
- );
5211
- }
5212
- var inputGroupButtonVariants = classVarianceAuthority.cva(
5213
- "flex items-center gap-2 rounded-none text-sm shadow-none",
5214
- {
5215
- variants: {
5216
- size: {
5217
- xs: "h-6 gap-1 rounded-none px-1.5 text-xs [&>svg:not([class*='size-'])]:size-3.5",
5218
- sm: "",
5219
- "icon-xs": "size-6 p-0 text-xs has-[>svg]:p-0",
5220
- "icon-sm": "size-8 p-0 has-[>svg]:p-0"
7667
+ [onActivate, onDeactivate, consumerOnAnimationEnd]
7668
+ );
7669
+ const resolvedTheme = resolveTheme(theme, systemTheme);
7670
+ const themeConfig = sizeThemePresets[size][resolvedTheme];
7671
+ const sizeConfig = sizePresets[size];
7672
+ const isPulse = size === "pulse-inner" || size === "pulse-outside";
7673
+ const finalBorderRadius = customBorderRadius ?? detectedRadius ?? sizeConfig.borderRadius;
7674
+ const finalDuration = duration ?? (size === "line" ? 3.1 : isPulse ? 2.3 : 1.96);
7675
+ const finalSaturation = saturation ?? themeConfig.saturation;
7676
+ const finalBrightness = brightnessProp ?? themeConfig.brightness ?? 1.3;
7677
+ const finalHueRange = size === "line" ? Math.min(hueRange, 13) : hueRange;
7678
+ const finalStaticColors = colorVariant === "mono" ? true : staticColors;
7679
+ const cssStyles = react.useMemo(
7680
+ () => !effectsOn ? "" : generateBeamCSS({
7681
+ id,
7682
+ borderRadius: finalBorderRadius,
7683
+ borderWidth: sizeConfig.borderWidth,
7684
+ duration: finalDuration,
7685
+ strokeOpacity: themeConfig.strokeOpacity,
7686
+ innerOpacity: themeConfig.innerOpacity,
7687
+ bloomOpacity: themeConfig.bloomOpacity,
7688
+ innerShadow: themeConfig.innerShadow,
7689
+ size,
7690
+ colorVariant,
7691
+ staticColors: finalStaticColors,
7692
+ brightness: finalBrightness,
7693
+ saturation: finalSaturation,
7694
+ hueRange: finalHueRange,
7695
+ theme: resolvedTheme,
7696
+ hairlineOpacity: themeConfig.hairlineOpacity
7697
+ }),
7698
+ [
7699
+ effectsOn,
7700
+ id,
7701
+ finalBorderRadius,
7702
+ sizeConfig.borderWidth,
7703
+ finalDuration,
7704
+ themeConfig.strokeOpacity,
7705
+ themeConfig.innerOpacity,
7706
+ themeConfig.bloomOpacity,
7707
+ themeConfig.innerShadow,
7708
+ themeConfig.hairlineOpacity,
7709
+ size,
7710
+ colorVariant,
7711
+ finalStaticColors,
7712
+ finalBrightness,
7713
+ finalSaturation,
7714
+ finalHueRange,
7715
+ resolvedTheme
7716
+ ]
7717
+ );
7718
+ const driverConfig = react.useMemo(
7719
+ () => isPulse ? getPulseDriverConfig(size, resolvedTheme, finalDuration, finalHueRange, finalStaticColors, id) : null,
7720
+ [isPulse, size, resolvedTheme, finalDuration, finalHueRange, finalStaticColors, id]
7721
+ );
7722
+ react.useEffect(() => {
7723
+ if (!driverConfig) return;
7724
+ if (!(isActive || isFading) || !isVisible) return;
7725
+ const el = internalRef.current;
7726
+ if (!el) return;
7727
+ if (typeof window !== "undefined" && window.matchMedia?.("(prefers-reduced-motion: reduce)").matches) {
7728
+ return;
5221
7729
  }
5222
- },
5223
- defaultVariants: {
5224
- size: "xs"
5225
- }
7730
+ return registerPulseInstance(el, driverConfig);
7731
+ }, [driverConfig, isActive, isFading, isVisible]);
7732
+ const setRefs = react.useCallback(
7733
+ (node) => {
7734
+ internalRef.current = node;
7735
+ if (typeof ref === "function") {
7736
+ ref(node);
7737
+ } else if (ref) {
7738
+ ref.current = node;
7739
+ }
7740
+ },
7741
+ [ref]
7742
+ );
7743
+ const mergedStyle = {
7744
+ ...style ?? {},
7745
+ "--beam-strength": Math.max(0, Math.min(1, strength)),
7746
+ ...size === "pulse-outside" ? { "--pulse-glow-sx": pulseGlowScale.x, "--pulse-glow-sy": pulseGlowScale.y } : {}
7747
+ };
7748
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
7749
+ effectsOn && /* @__PURE__ */ jsxRuntime.jsx("style", { children: cssStyles }),
7750
+ /* @__PURE__ */ jsxRuntime.jsxs(
7751
+ "div",
7752
+ {
7753
+ ...props,
7754
+ ref: setRefs,
7755
+ "data-beam": id,
7756
+ "data-active": isActive && !isFading ? "" : void 0,
7757
+ "data-fading": isFading ? "" : void 0,
7758
+ "data-paused": isActive && !isFading && !isVisible ? "" : void 0,
7759
+ className,
7760
+ style: mergedStyle,
7761
+ onAnimationEnd: handleAnimationEnd,
7762
+ children: [
7763
+ children,
7764
+ /* @__PURE__ */ jsxRuntime.jsx("div", { "data-beam-bloom": true })
7765
+ ]
7766
+ }
7767
+ )
7768
+ ] });
5226
7769
  }
5227
7770
  );
5228
- function InputGroupButton({
5229
- className,
5230
- type = "button",
5231
- variant = "ghost",
5232
- size = "xs",
5233
- ...props
5234
- }) {
5235
- return /* @__PURE__ */ jsxRuntime.jsx(
5236
- Button,
5237
- {
5238
- type,
5239
- "data-size": size,
5240
- variant,
5241
- className: cn(inputGroupButtonVariants({ size }), className),
5242
- ...props
5243
- }
5244
- );
7771
+ var ROTATE_SIZES = /* @__PURE__ */ new Set(["sm", "md", "line"]);
7772
+ var REDUCED_MOTION_QUERY = "(prefers-reduced-motion: reduce)";
7773
+ function subscribeReducedMotion(onChange) {
7774
+ if (typeof window === "undefined" || !window.matchMedia) return () => {
7775
+ };
7776
+ const mediaQuery = window.matchMedia(REDUCED_MOTION_QUERY);
7777
+ mediaQuery.addEventListener("change", onChange);
7778
+ return () => mediaQuery.removeEventListener("change", onChange);
5245
7779
  }
5246
- function InputGroupTextarea({
5247
- className,
5248
- ...props
5249
- }) {
5250
- return /* @__PURE__ */ jsxRuntime.jsx(
5251
- Textarea,
5252
- {
5253
- "data-slot": "input-group-control",
5254
- className: cn(
5255
- "flex-1 resize-none border-0 bg-transparent py-2.5 ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent",
5256
- className
5257
- ),
5258
- ...props
5259
- }
5260
- );
7780
+ function readReducedMotion() {
7781
+ if (typeof window === "undefined" || !window.matchMedia) return false;
7782
+ return window.matchMedia(REDUCED_MOTION_QUERY).matches;
5261
7783
  }
5262
- function Command({
5263
- className,
5264
- ...props
5265
- }) {
5266
- return /* @__PURE__ */ jsxRuntime.jsx(
5267
- cmdk.Command,
5268
- {
5269
- "data-slot": "command",
5270
- className: cn(
5271
- "flex size-full flex-col overflow-hidden bg-popover text-popover-foreground",
5272
- className
5273
- ),
5274
- ...props
5275
- }
5276
- );
7784
+ function readReducedMotionServer() {
7785
+ return false;
5277
7786
  }
5278
- function CommandList({
5279
- className,
5280
- ...props
7787
+ function BrandBeam({
7788
+ children,
7789
+ size = "md",
7790
+ active = true,
7791
+ strength,
7792
+ borderRadius,
7793
+ className
5281
7794
  }) {
5282
- return /* @__PURE__ */ jsxRuntime.jsx(
5283
- cmdk.Command.List,
5284
- {
5285
- "data-slot": "command-list",
5286
- className: cn(
5287
- "no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none",
5288
- className
5289
- ),
5290
- ...props
5291
- }
7795
+ const reducedMotion = react.useSyncExternalStore(
7796
+ subscribeReducedMotion,
7797
+ readReducedMotion,
7798
+ readReducedMotionServer
5292
7799
  );
5293
- }
5294
- function CommandEmpty({
5295
- className,
5296
- ...props
5297
- }) {
7800
+ const effectiveActive = active && !(reducedMotion && ROTATE_SIZES.has(size));
5298
7801
  return /* @__PURE__ */ jsxRuntime.jsx(
5299
- cmdk.Command.Empty,
5300
- {
5301
- "data-slot": "command-empty",
5302
- className: cn("py-6 text-center text-sm", className),
5303
- ...props
5304
- }
5305
- );
5306
- }
5307
- function CommandItem({
5308
- className,
5309
- children,
5310
- ...props
5311
- }) {
5312
- return /* @__PURE__ */ jsxRuntime.jsxs(
5313
- cmdk.Command.Item,
7802
+ BorderBeam,
5314
7803
  {
5315
- "data-slot": "command-item",
5316
- className: cn(
5317
- "group/command-item relative flex cursor-default items-center gap-2 rounded-none px-3 py-2 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-muted data-[selected=true]:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 data-[selected=true]:*:[svg]:text-foreground",
5318
- className
5319
- ),
5320
- ...props,
5321
- children: [
5322
- children,
5323
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckIcon, { className: "ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100" })
5324
- ]
7804
+ size,
7805
+ colorVariant: "brand",
7806
+ theme: "auto",
7807
+ active: effectiveActive,
7808
+ strength,
7809
+ borderRadius,
7810
+ className,
7811
+ children
5325
7812
  }
5326
7813
  );
5327
7814
  }
5328
-
5329
- // src/components/ui/spinner.tsx
5330
- init_utils();
5331
- function Spinner({ className, ...props }) {
5332
- return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2Icon, { role: "status", "aria-label": "Loading", className: cn("size-4 animate-spin", className), ...props });
5333
- }
5334
-
5335
- // src/components/ai-elements/prompt-input.tsx
5336
- init_utils();
5337
7815
  var convertBlobUrlToDataUrl = async (url) => {
5338
7816
  try {
5339
7817
  const response = await fetch(url);
@@ -5492,6 +7970,7 @@ var PromptInput = ({
5492
7970
  maxFileSize,
5493
7971
  onError,
5494
7972
  onSubmit,
7973
+ beamActive = false,
5495
7974
  children,
5496
7975
  ...props
5497
7976
  }) => {
@@ -5806,7 +8285,7 @@ var PromptInput = ({
5806
8285
  onSubmit: handleSubmit,
5807
8286
  ref: formRef,
5808
8287
  ...props,
5809
- children: /* @__PURE__ */ jsxRuntime.jsx(InputGroup, { className: "overflow-hidden rounded-3xl border border-input bg-white px-4 py-2 shadow-sm dark:bg-card dark:shadow-none dark:ring-1 dark:ring-white/5 has-[textarea]:rounded-3xl has-[>[data-align=block-end]]:rounded-3xl has-[>[data-align=block-start]]:rounded-3xl", children })
8288
+ children: /* @__PURE__ */ jsxRuntime.jsx(BrandBeam, { size: "line", active: beamActive, strength: 0.7, borderRadius: 24, children: /* @__PURE__ */ jsxRuntime.jsx(InputGroup, { className: "overflow-hidden rounded-3xl border border-input bg-white px-4 py-2 shadow-sm dark:bg-card dark:shadow-none dark:ring-1 dark:ring-white/5 has-[textarea]:rounded-3xl has-[>[data-align=block-end]]:rounded-3xl has-[>[data-align=block-start]]:rounded-3xl", children }) })
5810
8289
  }
5811
8290
  )
5812
8291
  ] });
@@ -6780,19 +9259,19 @@ function ChatComposerInner({
6780
9259
  }) {
6781
9260
  const { adapter } = useAgentChatAdapterContext();
6782
9261
  const [profileMenuOpen, setProfileMenuOpen] = react.useState(false);
6783
- const [browserProfiles, setBrowserProfiles] = react.useState([]);
6784
- react.useEffect(() => {
6785
- if (!profileMenuOpen || !adapter.listBrowserProfiles) return;
6786
- let cancelled = false;
6787
- void adapter.listBrowserProfiles().then((p) => {
6788
- if (!cancelled) setBrowserProfiles(p);
6789
- }).catch(() => {
6790
- if (!cancelled) setBrowserProfiles([]);
9262
+ const [browserProfiles, setBrowserProfiles] = react.useState(null);
9263
+ const loadBrowserProfiles = react.useCallback(() => {
9264
+ if (!adapter.listBrowserProfiles) return;
9265
+ void adapter.listBrowserProfiles().then(setBrowserProfiles).catch(() => {
6791
9266
  });
6792
- return () => {
6793
- cancelled = true;
6794
- };
6795
- }, [profileMenuOpen, adapter]);
9267
+ }, [adapter]);
9268
+ react.useEffect(() => {
9269
+ if (!browserProfilesEnabled || !browserProfileId) return;
9270
+ if (browserProfiles !== null) return;
9271
+ loadBrowserProfiles();
9272
+ }, [browserProfilesEnabled, browserProfileId, browserProfiles, loadBrowserProfiles]);
9273
+ const activeBrowserProfile = (browserProfiles ?? []).find((p) => p.id === browserProfileId) ?? null;
9274
+ const profileTriggerLabel = activeBrowserProfile && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "max-w-24 truncate text-xs", children: activeBrowserProfile.name });
6796
9275
  const { textInput, attachments } = usePromptInputController();
6797
9276
  const status = isRunning ? "streaming" : disabled ? "error" : "ready";
6798
9277
  const [adapterCommands, setAdapterCommands] = react.useState([]);
@@ -7060,6 +9539,7 @@ function ChatComposerInner({
7060
9539
  maxFiles: MAX_IMAGES_PER_MESSAGE + MAX_ATTACHMENTS_PER_MESSAGE,
7061
9540
  maxFileSize: MAX_ATTACHMENT_BYTES,
7062
9541
  onError: handlePromptInputError,
9542
+ beamActive: status === "streaming",
7063
9543
  children: [
7064
9544
  /* @__PURE__ */ jsxRuntime.jsx(PromptInputBody, { children: /* @__PURE__ */ jsxRuntime.jsx(
7065
9545
  PromptInputTextarea,
@@ -7137,30 +9617,40 @@ function ChatComposerInner({
7137
9617
  // active the choice can't change. Render disabled (via
7138
9618
  // aria-disabled, not the `disabled` attribute, so the
7139
9619
  // tooltip still shows on hover) with an explanation.
7140
- /* @__PURE__ */ jsxRuntime.jsx(
9620
+ /* @__PURE__ */ jsxRuntime.jsxs(
7141
9621
  PromptInputButton,
7142
9622
  {
7143
9623
  "aria-label": "Select browser profile",
7144
9624
  "aria-disabled": true,
7145
9625
  "aria-pressed": !!browserProfileId,
7146
- tooltip: "A browser profile must be chosen before starting the session",
9626
+ tooltip: activeBrowserProfile ? `Browser profile: ${activeBrowserProfile.name} (locked for this session)` : "A browser profile must be chosen before starting the session",
7147
9627
  className: `cursor-not-allowed opacity-50 ${browserProfileId ? "bg-accent text-foreground" : ""}`,
7148
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.IdCardIcon, { className: "size-4" })
9628
+ children: [
9629
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.IdCardIcon, { className: "size-4" }),
9630
+ profileTriggerLabel
9631
+ ]
7149
9632
  }
7150
9633
  )
7151
9634
  ) : /* @__PURE__ */ jsxRuntime.jsxs(
7152
9635
  Popover,
7153
9636
  {
7154
9637
  open: profileMenuOpen,
7155
- onOpenChange: setProfileMenuOpen,
9638
+ onOpenChange: (open) => {
9639
+ setProfileMenuOpen(open);
9640
+ if (open) loadBrowserProfiles();
9641
+ },
7156
9642
  children: [
7157
- /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
9643
+ /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
7158
9644
  PromptInputButton,
7159
9645
  {
7160
9646
  "aria-label": "Select browser profile",
7161
9647
  "aria-pressed": !!browserProfileId,
9648
+ tooltip: activeBrowserProfile ? `Browser profile: ${activeBrowserProfile.name}` : "Select browser profile",
7162
9649
  className: browserProfileId ? "bg-accent text-foreground" : void 0,
7163
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.IdCardIcon, { className: "size-4" })
9650
+ children: [
9651
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.IdCardIcon, { className: "size-4" }),
9652
+ profileTriggerLabel
9653
+ ]
7164
9654
  }
7165
9655
  ) }),
7166
9656
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -7169,34 +9659,22 @@ function ChatComposerInner({
7169
9659
  side: "top",
7170
9660
  align: "start",
7171
9661
  className: "w-64 overflow-hidden rounded-xl p-1",
7172
- children: /* @__PURE__ */ jsxRuntime.jsx(Command, { children: /* @__PURE__ */ jsxRuntime.jsxs(CommandList, { children: [
7173
- /* @__PURE__ */ jsxRuntime.jsx(
7174
- CommandItem,
7175
- {
7176
- onSelect: () => {
7177
- setProfileMenuOpen(false);
7178
- onSelectBrowserProfile(null);
7179
- },
7180
- className: "gap-3 rounded-md px-3 py-2",
7181
- children: "No profile"
7182
- }
7183
- ),
7184
- browserProfiles.map((p) => /* @__PURE__ */ jsxRuntime.jsxs(
7185
- CommandItem,
7186
- {
7187
- onSelect: () => {
7188
- setProfileMenuOpen(false);
7189
- onSelectBrowserProfile(p.id);
7190
- },
7191
- className: "gap-3 rounded-md px-3 py-2",
7192
- children: [
7193
- p.name,
7194
- browserProfileId === p.id && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-auto text-xs text-muted-foreground", children: "Active" })
7195
- ]
9662
+ children: /* @__PURE__ */ jsxRuntime.jsx(Command, { children: /* @__PURE__ */ jsxRuntime.jsx(CommandList, { children: [
9663
+ { id: null, name: "No profile" },
9664
+ ...browserProfiles ?? []
9665
+ ].map((p) => /* @__PURE__ */ jsxRuntime.jsx(
9666
+ CommandItem,
9667
+ {
9668
+ onSelect: () => {
9669
+ setProfileMenuOpen(false);
9670
+ onSelectBrowserProfile(p.id);
7196
9671
  },
7197
- p.id
7198
- ))
7199
- ] }) })
9672
+ "data-checked": (browserProfileId ?? null) === p.id || void 0,
9673
+ className: "gap-3 rounded-md px-3 py-2",
9674
+ children: p.name
9675
+ },
9676
+ p.id ?? "none"
9677
+ )) }) })
7200
9678
  }
7201
9679
  )
7202
9680
  ]
@@ -8201,6 +10679,18 @@ var KIND_LABEL = {
8201
10679
  video: "Generated video"
8202
10680
  };
8203
10681
  var COPY_FEEDBACK_MS = 1500;
10682
+ var ARTIFACT_PAYLOAD_CACHE_LIMIT = 64;
10683
+ var artifactPayloadCache = /* @__PURE__ */ new Map();
10684
+ function cachePayload(key, version, payload) {
10685
+ const existing = artifactPayloadCache.get(key);
10686
+ if (existing && existing.version >= version) return;
10687
+ artifactPayloadCache.delete(key);
10688
+ artifactPayloadCache.set(key, { version, payload });
10689
+ if (artifactPayloadCache.size > ARTIFACT_PAYLOAD_CACHE_LIMIT) {
10690
+ const oldest = artifactPayloadCache.keys().next().value;
10691
+ if (oldest !== void 0) artifactPayloadCache.delete(oldest);
10692
+ }
10693
+ }
8204
10694
  function ArtifactBlock({
8205
10695
  sessionId,
8206
10696
  artifactId,
@@ -8209,15 +10699,24 @@ function ArtifactBlock({
8209
10699
  version
8210
10700
  }) {
8211
10701
  const { adapter } = useAgentChatAdapterContext();
8212
- const [payload, setPayload] = react.useState(null);
10702
+ const cacheKey = `${sessionId}:${artifactId}`;
10703
+ const [payload, setPayload] = react.useState(
10704
+ () => artifactPayloadCache.get(cacheKey)?.payload ?? null
10705
+ );
8213
10706
  const [error, setError] = react.useState(null);
8214
10707
  const [copied, setCopied] = react.useState(false);
8215
10708
  const [expanded, setExpanded] = react.useState(false);
8216
10709
  react.useEffect(() => {
10710
+ const cached = artifactPayloadCache.get(cacheKey);
10711
+ if (cached) {
10712
+ setPayload(cached.payload);
10713
+ setError(null);
10714
+ if (cached.version >= version) return;
10715
+ }
8217
10716
  let cancelled = false;
8218
- setPayload(null);
8219
10717
  setError(null);
8220
10718
  adapter.getArtifact({ sessionId, artifactId }).then((p) => {
10719
+ cachePayload(cacheKey, version, p);
8221
10720
  if (!cancelled) setPayload(p);
8222
10721
  }).catch((e) => {
8223
10722
  if (!cancelled) {
@@ -8227,7 +10726,7 @@ function ArtifactBlock({
8227
10726
  return () => {
8228
10727
  cancelled = true;
8229
10728
  };
8230
- }, [adapter, sessionId, artifactId, version]);
10729
+ }, [adapter, sessionId, artifactId, version, cacheKey]);
8231
10730
  const handleCopy = async () => {
8232
10731
  if (!payload) return;
8233
10732
  const { text } = exportArtifact(payload);
@@ -8256,48 +10755,65 @@ function ArtifactBlock({
8256
10755
  };
8257
10756
  const description = error ?? (payload ? KIND_LABEL[kind] : "Loading\u2026");
8258
10757
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
8259
- /* @__PURE__ */ jsxRuntime.jsxs(Artifact, { className: "my-2 w-full overflow-visible border-border", children: [
8260
- /* @__PURE__ */ jsxRuntime.jsxs(ArtifactHeader, { children: [
8261
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-col", children: [
8262
- /* @__PURE__ */ jsxRuntime.jsx(ArtifactTitle, { className: "truncate", children: name }),
8263
- /* @__PURE__ */ jsxRuntime.jsx(ArtifactDescription, { children: description })
8264
- ] }),
8265
- /* @__PURE__ */ jsxRuntime.jsxs(ArtifactActions, { children: [
8266
- /* @__PURE__ */ jsxRuntime.jsx(
8267
- ArtifactAction,
8268
- {
8269
- tooltip: copied ? "Copied!" : "Copy",
8270
- label: "Copy artifact",
8271
- icon: copied ? lucideReact.CheckIcon : lucideReact.CopyIcon,
8272
- disabled: !payload,
8273
- onClick: handleCopy,
8274
- className: copied ? "text-emerald-500 hover:text-emerald-500" : ""
8275
- }
8276
- ),
8277
- /* @__PURE__ */ jsxRuntime.jsx(
8278
- ArtifactAction,
8279
- {
8280
- tooltip: "Download",
8281
- label: "Download artifact",
8282
- icon: lucideReact.DownloadIcon,
8283
- disabled: !payload,
8284
- onClick: handleDownload
8285
- }
8286
- ),
8287
- /* @__PURE__ */ jsxRuntime.jsx(
8288
- ArtifactAction,
8289
- {
8290
- tooltip: "Full screen",
8291
- label: "Open artifact in full screen",
8292
- icon: lucideReact.Maximize2Icon,
8293
- disabled: !payload,
8294
- onClick: () => setExpanded(true)
8295
- }
8296
- )
8297
- ] })
8298
- ] }),
8299
- /* @__PURE__ */ jsxRuntime.jsx(ArtifactContent, { className: "p-0 overflow-visible", children: /* @__PURE__ */ jsxRuntime.jsx(ArtifactBody, { error, payload, sessionId }) })
8300
- ] }),
10758
+ /* @__PURE__ */ jsxRuntime.jsx(
10759
+ BrandBeam,
10760
+ {
10761
+ size: "pulse-inner",
10762
+ active: !payload && !error,
10763
+ strength: 0.6,
10764
+ borderRadius: 10,
10765
+ className: "w-full",
10766
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
10767
+ Artifact,
10768
+ {
10769
+ className: "my-2 w-full overflow-visible border-border",
10770
+ "data-artifact-anchor": artifactId,
10771
+ children: [
10772
+ /* @__PURE__ */ jsxRuntime.jsxs(ArtifactHeader, { children: [
10773
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-col", children: [
10774
+ /* @__PURE__ */ jsxRuntime.jsx(ArtifactTitle, { className: "truncate", children: name }),
10775
+ /* @__PURE__ */ jsxRuntime.jsx(ArtifactDescription, { children: description })
10776
+ ] }),
10777
+ /* @__PURE__ */ jsxRuntime.jsxs(ArtifactActions, { children: [
10778
+ /* @__PURE__ */ jsxRuntime.jsx(
10779
+ ArtifactAction,
10780
+ {
10781
+ tooltip: copied ? "Copied!" : "Copy",
10782
+ label: "Copy artifact",
10783
+ icon: copied ? lucideReact.CheckIcon : lucideReact.CopyIcon,
10784
+ disabled: !payload,
10785
+ onClick: handleCopy,
10786
+ className: copied ? "text-emerald-500 hover:text-emerald-500" : ""
10787
+ }
10788
+ ),
10789
+ /* @__PURE__ */ jsxRuntime.jsx(
10790
+ ArtifactAction,
10791
+ {
10792
+ tooltip: "Download",
10793
+ label: "Download artifact",
10794
+ icon: lucideReact.DownloadIcon,
10795
+ disabled: !payload,
10796
+ onClick: handleDownload
10797
+ }
10798
+ ),
10799
+ /* @__PURE__ */ jsxRuntime.jsx(
10800
+ ArtifactAction,
10801
+ {
10802
+ tooltip: "Full screen",
10803
+ label: "Open artifact in full screen",
10804
+ icon: lucideReact.Maximize2Icon,
10805
+ disabled: !payload,
10806
+ onClick: () => setExpanded(true)
10807
+ }
10808
+ )
10809
+ ] })
10810
+ ] }),
10811
+ /* @__PURE__ */ jsxRuntime.jsx(ArtifactContent, { className: "p-0 overflow-visible", children: /* @__PURE__ */ jsxRuntime.jsx(ArtifactBody, { error, payload, sessionId }) })
10812
+ ]
10813
+ }
10814
+ )
10815
+ }
10816
+ ),
8301
10817
  /* @__PURE__ */ jsxRuntime.jsx(Dialog, { open: expanded, onOpenChange: setExpanded, children: /* @__PURE__ */ jsxRuntime.jsxs(DialogContent, { className: "flex h-[95vh] w-[95vw] max-w-[95vw] flex-col gap-4 overflow-hidden p-6 sm:max-w-[95vw]", children: [
8302
10818
  /* @__PURE__ */ jsxRuntime.jsxs(DialogHeader, { children: [
8303
10819
  /* @__PURE__ */ jsxRuntime.jsx(DialogTitle, { className: "truncate pr-10", children: name }),
@@ -9057,6 +11573,28 @@ function WorkspaceFilePreviewDialog({
9057
11573
  ) })
9058
11574
  ] }) });
9059
11575
  }
11576
+ function scrollToArtifactBlock(artifactId) {
11577
+ document.querySelector(`[data-artifact-anchor="${CSS.escape(artifactId)}"]`)?.scrollIntoView({ behavior: "smooth", block: "center" });
11578
+ }
11579
+ function ArtifactRefCard({
11580
+ artifactId,
11581
+ name,
11582
+ kind
11583
+ }) {
11584
+ return /* @__PURE__ */ jsxRuntime.jsxs(
11585
+ "button",
11586
+ {
11587
+ type: "button",
11588
+ onClick: () => scrollToArtifactBlock(artifactId),
11589
+ className: "flex w-full min-w-0 cursor-pointer items-center gap-2 rounded border border-border bg-background px-3 py-2 text-left text-sm transition-colors hover:bg-muted/60",
11590
+ children: [
11591
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FileTextIcon, { className: "size-4 shrink-0 text-muted-foreground", "aria-hidden": true }),
11592
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate font-medium text-foreground", children: name }),
11593
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 text-xs text-muted-foreground", children: KIND_LABEL[kind] })
11594
+ ]
11595
+ }
11596
+ );
11597
+ }
9060
11598
  function resolveArtifactRef(ref, messages) {
9061
11599
  for (const msg of messages) {
9062
11600
  if (msg.role !== "system" || msg.systemKind !== "artifact") continue;
@@ -9097,15 +11635,13 @@ function TurnSummaryCard({
9097
11635
  }
9098
11636
  if (artifact.kind === "artifact") {
9099
11637
  const resolved = sessionId ? resolveArtifactRef(artifact.ref, messages) : null;
9100
- if (resolved && sessionId) {
11638
+ if (resolved) {
9101
11639
  return /* @__PURE__ */ jsxRuntime.jsx(
9102
- ArtifactBlock,
11640
+ ArtifactRefCard,
9103
11641
  {
9104
- sessionId,
9105
11642
  artifactId: resolved.artifactId,
9106
11643
  name: resolved.name || artifact.label,
9107
- kind: resolved.kind,
9108
- version: resolved.version
11644
+ kind: resolved.kind
9109
11645
  },
9110
11646
  key
9111
11647
  );
@@ -9121,8 +11657,6 @@ function TurnSummaryCard({
9121
11657
  ArtifactRow,
9122
11658
  {
9123
11659
  artifact,
9124
- sessionId,
9125
- messages,
9126
11660
  onFileSelect,
9127
11661
  onCommandSelect
9128
11662
  }
@@ -9136,8 +11670,6 @@ function TurnSummaryCard({
9136
11670
  }
9137
11671
  function ArtifactRow({
9138
11672
  artifact,
9139
- sessionId,
9140
- messages,
9141
11673
  onFileSelect,
9142
11674
  onCommandSelect
9143
11675
  }) {
@@ -9181,20 +11713,7 @@ function ArtifactRow({
9181
11713
  }
9182
11714
  );
9183
11715
  }
9184
- const resolved = sessionId ? resolveArtifactRef(artifact.ref, messages) : null;
9185
- if (!resolved) {
9186
- return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-muted-foreground", children: artifact.label });
9187
- }
9188
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ jsxRuntime.jsx(
9189
- ArtifactBlock,
9190
- {
9191
- sessionId,
9192
- artifactId: resolved.artifactId,
9193
- name: resolved.name || artifact.label,
9194
- kind: resolved.kind,
9195
- version: resolved.version
9196
- }
9197
- ) });
11716
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-muted-foreground", children: artifact.label });
9198
11717
  }
9199
11718
 
9200
11719
  // src/components/chat/chat-thread.tsx
@@ -9641,9 +12160,9 @@ function TimelineEntryItem({
9641
12160
  return /* @__PURE__ */ jsxRuntime.jsxs(TimelineItem, { step, children: [
9642
12161
  /* @__PURE__ */ jsxRuntime.jsxs(TimelineHeader, { children: [
9643
12162
  /* @__PURE__ */ jsxRuntime.jsx(TimelineSeparator, { style: { backgroundColor: "var(--color-border)" } }),
9644
- /* @__PURE__ */ jsxRuntime.jsx(TimelineIndicator, { className: "size-2 border-none bg-primary animate-pulse" })
12163
+ /* @__PURE__ */ jsxRuntime.jsx(TimelineIndicator, { className: "size-2 border-none bg-primary" })
9645
12164
  ] }),
9646
- /* @__PURE__ */ jsxRuntime.jsx(TimelineContent, { children: /* @__PURE__ */ jsxRuntime.jsx(Shimmer, { duration: 3, spread: 3, className: "text-sm", children: "Working on it..." }) })
12165
+ /* @__PURE__ */ jsxRuntime.jsx(TimelineContent, { children: /* @__PURE__ */ jsxRuntime.jsx(OrbShimmerLabel, { state: "working", label: "Working on it...", className: "py-0.5" }) })
9647
12166
  ] });
9648
12167
  }
9649
12168
  function ReasoningEntry({
@@ -9851,30 +12370,9 @@ function lastPathSegment(path) {
9851
12370
  function truncate3(s, max) {
9852
12371
  return s.length > max ? `${s.slice(0, max - 1)}\u2026` : s;
9853
12372
  }
9854
- var _SIMPLE_MODE_HIDDEN_TOOLS = /* @__PURE__ */ new Set([
9855
- "list_files",
9856
- "search_files",
9857
- "session_search",
9858
- "skills_list",
9859
- "skill_view",
9860
- "skill_manage",
9861
- "process",
9862
- "memory",
9863
- // Shell commands and code execution are infrastructure plumbing the
9864
- // user doesn't need to see when the goal is to know *what* the
9865
- // agent accomplished, not *how*. Expert mode still has the full
9866
- // command + output block.
9867
- "terminal",
9868
- "execute_code"
9869
- ]);
9870
- function _isHiddenSimpleTool(tc) {
9871
- if (_SIMPLE_MODE_HIDDEN_TOOLS.has(tc.toolName)) return true;
9872
- if (tc.toolName.startsWith("browser_")) return true;
9873
- return false;
9874
- }
9875
12373
  function visibleToolCalls(message) {
9876
12374
  return (message.toolCalls ?? []).filter((tc) => {
9877
- if (_isHiddenSimpleTool(tc)) return false;
12375
+ if (isHiddenSimpleTool(tc)) return false;
9878
12376
  const status = effectiveStatus(tc);
9879
12377
  if (status === "error" || status === "cancelled") return false;
9880
12378
  return true;
@@ -9889,7 +12387,7 @@ function isIterationLive(message) {
9889
12387
  }
9890
12388
  function liveIterationLabel(message) {
9891
12389
  const running = (message.toolCalls ?? []).filter(
9892
- (tc) => tc.status === "running" && !_isHiddenSimpleTool(tc)
12390
+ (tc) => tc.status === "running" && !isHiddenSimpleTool(tc)
9893
12391
  );
9894
12392
  if (running.length === 0) return "Thinking\u2026";
9895
12393
  if (running.length === 1) {
@@ -10087,8 +12585,14 @@ function IterationGroup({
10087
12585
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-1 py-0.5", children: /* @__PURE__ */ jsxRuntime.jsx(AskUserQuestionToolBlock, { tc: askCall }) });
10088
12586
  }
10089
12587
  if (isIterationLive(message)) {
10090
- const label2 = liveIterationLabel(message);
10091
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "py-0.5 text-sm", children: /* @__PURE__ */ jsxRuntime.jsx(Shimmer, { duration: 3, spread: 3, className: "text-sm", children: label2 }) });
12588
+ return /* @__PURE__ */ jsxRuntime.jsx(
12589
+ OrbShimmerLabel,
12590
+ {
12591
+ state: messageOrbState(message, SIMPLE_MODE_ORB_OPTIONS),
12592
+ label: liveIterationLabel(message),
12593
+ className: "py-0.5"
12594
+ }
12595
+ );
10092
12596
  }
10093
12597
  const label = summary ?? deriveIterationLabel(message);
10094
12598
  if (!label) {
@@ -10362,8 +12866,8 @@ function RetryBanner({ indicator }) {
10362
12866
  }
10363
12867
  );
10364
12868
  }
10365
- function WorkingOnItIndicator() {
10366
- return /* @__PURE__ */ jsxRuntime.jsx(Message, { from: "assistant", children: /* @__PURE__ */ jsxRuntime.jsx(MessageContent, { children: /* @__PURE__ */ jsxRuntime.jsx(Shimmer, { duration: 3, spread: 3, className: "text-sm", children: "Working on it..." }) }) });
12869
+ function WorkingOnItIndicator({ activity }) {
12870
+ return /* @__PURE__ */ jsxRuntime.jsx(Message, { from: "assistant", children: /* @__PURE__ */ jsxRuntime.jsx(MessageContent, { children: /* @__PURE__ */ jsxRuntime.jsx(OrbShimmerLabel, { state: activity.state, label: activity.label }) }) });
10367
12871
  }
10368
12872
  function useDelayedRunningIndicator(isRunning) {
10369
12873
  const [visible, setVisible] = react.useState(isRunning);
@@ -10422,6 +12926,13 @@ function ChatThread({
10422
12926
  }) {
10423
12927
  const groups = react.useMemo(() => groupMessages(messages), [messages]);
10424
12928
  const awaitingInput = react.useMemo(() => isAwaitingUserInput(messages), [messages]);
12929
+ const orbActivity = react.useMemo(
12930
+ () => deriveOrbActivity(
12931
+ messages,
12932
+ viewMode === "simple" ? SIMPLE_MODE_ORB_OPTIONS : void 0
12933
+ ),
12934
+ [messages, viewMode]
12935
+ );
10425
12936
  const showWorkingOnIt = useDelayedRunningIndicator(isRunning) && !awaitingInput;
10426
12937
  const composerDisabled = disabled || awaitingInput;
10427
12938
  const composerDisabledReason = awaitingInput ? "Answer the question above to continue." : disabledReason;
@@ -10563,7 +13074,7 @@ function ChatThread({
10563
13074
  group.messages[0].id
10564
13075
  );
10565
13076
  }),
10566
- showWorkingOnIt && /* @__PURE__ */ jsxRuntime.jsx(WorkingOnItIndicator, {})
13077
+ showWorkingOnIt && /* @__PURE__ */ jsxRuntime.jsx(WorkingOnItIndicator, { activity: orbActivity })
10567
13078
  ] }) }),
10568
13079
  /* @__PURE__ */ jsxRuntime.jsx(ConversationScrollButton, {})
10569
13080
  ] }),
@@ -12193,9 +14704,9 @@ function applyCodeRunProgress(messages, data) {
12193
14704
  ...msg,
12194
14705
  toolCalls: msg.toolCalls?.map((tc) => {
12195
14706
  if (tc.id !== match.toolId) return tc;
12196
- const frame = parseCodeRunState(tc.result);
12197
- frame.output += chunk;
12198
- return { ...tc, result: JSON.stringify(frame) };
14707
+ const frame2 = parseCodeRunState(tc.result);
14708
+ frame2.output += chunk;
14709
+ return { ...tc, result: JSON.stringify(frame2) };
12199
14710
  })
12200
14711
  };
12201
14712
  return next;
@@ -12215,15 +14726,15 @@ function applyCodeRunResult(messages, data) {
12215
14726
  ...msg,
12216
14727
  toolCalls: msg.toolCalls?.map((tc) => {
12217
14728
  if (tc.id !== match.toolId) return tc;
12218
- const frame = parseCodeRunState(tc.result);
12219
- frame.finalMessage = finalMessage;
12220
- frame.error = error;
12221
- frame.inputTokens = inputTokens;
12222
- frame.outputTokens = outputTokens;
14729
+ const frame2 = parseCodeRunState(tc.result);
14730
+ frame2.finalMessage = finalMessage;
14731
+ frame2.error = error;
14732
+ frame2.inputTokens = inputTokens;
14733
+ frame2.outputTokens = outputTokens;
12223
14734
  return {
12224
14735
  ...tc,
12225
14736
  status: error ? "error" : "complete",
12226
- result: JSON.stringify(frame)
14737
+ result: JSON.stringify(frame2)
12227
14738
  };
12228
14739
  })
12229
14740
  };
@@ -12651,6 +15162,15 @@ function useAgentChatRuntime({
12651
15162
  } catch {
12652
15163
  }
12653
15164
  if (live) reviveStreamIfNeeded(targetSessionId);
15165
+ if (statusKnown && !live && !appliedNew && stateRef.current.isRunning) {
15166
+ setState(
15167
+ (prev) => prev.isRunning ? applyRuntimeEvent(prev, {
15168
+ type: "session.done",
15169
+ eventId: 0,
15170
+ data: {}
15171
+ }) : prev
15172
+ );
15173
+ }
12654
15174
  if (appliedNew) return RECONCILE_FAST;
12655
15175
  if (live || !statusKnown) return RECONCILE_ACTIVE;
12656
15176
  return isMission || stateRef.current.isRunning ? RECONCILE_MISSION_IDLE : RECONCILE_IDLE;
@@ -17040,6 +19560,7 @@ function SessionTreePanel({
17040
19560
  exports.ACTIVE_MISSION_STATUSES = ACTIVE_MISSION_STATUSES;
17041
19561
  exports.AgentChat = AgentChat;
17042
19562
  exports.AgentChatAdapterProvider = AgentChatAdapterProvider;
19563
+ exports.BrandBeam = BrandBeam;
17043
19564
  exports.BrowserLiveView = BrowserLiveView;
17044
19565
  exports.CitationText = CitationText;
17045
19566
  exports.CodingAgentsPanel = CodingAgentsPanel;
@@ -17052,15 +19573,22 @@ exports.MISSION_EVENT_CATEGORIES = MISSION_EVENT_CATEGORIES;
17052
19573
  exports.MessageResponse = MessageResponse;
17053
19574
  exports.MissionDashboard = MissionDashboard;
17054
19575
  exports.MissionsPanel = MissionsPanel;
19576
+ exports.ORB_STATE_LABELS = ORB_STATE_LABELS;
19577
+ exports.OrbShimmerLabel = OrbShimmerLabel;
17055
19578
  exports.ResearchSourcesPanel = ResearchSourcesPanel;
19579
+ exports.SIMPLE_MODE_HIDDEN_TOOLS = SIMPLE_MODE_HIDDEN_TOOLS;
19580
+ exports.SIMPLE_MODE_ORB_OPTIONS = SIMPLE_MODE_ORB_OPTIONS;
17056
19581
  exports.ScheduledWorkPanel = ScheduledWorkPanel;
17057
19582
  exports.SessionTreePanel = SessionTreePanel;
17058
19583
  exports.defaultSelectedMissionTaskId = defaultSelectedMissionTaskId;
17059
19584
  exports.deriveMissionWorkerActivityLabel = deriveMissionWorkerActivityLabel;
19585
+ exports.deriveOrbActivity = deriveOrbActivity;
17060
19586
  exports.formatMissionTimestamp = formatMissionTimestamp;
17061
19587
  exports.groupMissionTasksByBucket = groupMissionTasksByBucket;
19588
+ exports.isHiddenSimpleTool = isHiddenSimpleTool;
17062
19589
  exports.isTerminalMissionStatus = isTerminalMissionStatus;
17063
19590
  exports.mergeMissionEvents = mergeMissionEvents;
19591
+ exports.messageOrbState = messageOrbState;
17064
19592
  exports.missionEventActorLabel = missionEventActorLabel;
17065
19593
  exports.missionEventCategory = missionEventCategory;
17066
19594
  exports.missionEventSummary = missionEventSummary;
@@ -17073,6 +19601,7 @@ exports.missionTaskTitle = missionTaskTitle;
17073
19601
  exports.missionWorkerTaskCounts = missionWorkerTaskCounts;
17074
19602
  exports.splitCitations = splitCitations;
17075
19603
  exports.stripMissionControlMarkup = stripMissionControlMarkup;
19604
+ exports.toolOrbState = toolOrbState;
17076
19605
  exports.useAgentChatAdapterContext = useAgentChatAdapterContext;
17077
19606
  exports.useAgentChatRuntime = useAgentChatRuntime;
17078
19607
  exports.useChatViewMode = useChatViewMode;