@optilogic/core 1.0.0-beta.9 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/index.cjs +1385 -45
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +360 -1
  4. package/dist/index.d.ts +360 -1
  5. package/dist/index.js +1364 -47
  6. package/dist/index.js.map +1 -1
  7. package/dist/styles.css +22 -0
  8. package/dist/tailwind-preset.cjs +17 -2
  9. package/dist/tailwind-preset.cjs.map +1 -1
  10. package/dist/tailwind-preset.js +17 -2
  11. package/dist/tailwind-preset.js.map +1 -1
  12. package/package.json +15 -1
  13. package/src/components/autocomplete.tsx +2 -1
  14. package/src/components/branding/CosmicFrogIcon.tsx +59 -0
  15. package/src/components/branding/DataStarIcon.tsx +35 -0
  16. package/src/components/branding/OptilogicLogo.tsx +88 -0
  17. package/src/components/branding/OptilogicLogoWithText.tsx +110 -0
  18. package/src/components/branding/index.ts +7 -0
  19. package/src/components/button.tsx +10 -8
  20. package/src/components/calendar.tsx +7 -7
  21. package/src/components/data-grid/DataGrid.tsx +6 -1
  22. package/src/components/data-grid/components/CellEditor.tsx +3 -3
  23. package/src/components/data-grid/hooks/useDataGridState.ts +18 -3
  24. package/src/components/data-grid/types.ts +4 -0
  25. package/src/components/data-grid/utils/dataProcessing.ts +40 -11
  26. package/src/components/date-picker.tsx +2 -1
  27. package/src/components/dropdown-menu.tsx +1 -1
  28. package/src/components/file-view/FileView.tsx +147 -0
  29. package/src/components/file-view/components/CodeRenderer.tsx +97 -0
  30. package/src/components/file-view/components/CsvRenderer.tsx +127 -0
  31. package/src/components/file-view/components/HtmlRenderer.tsx +24 -0
  32. package/src/components/file-view/components/ImageRenderer.tsx +67 -0
  33. package/src/components/file-view/components/MarkdownRenderer.tsx +304 -0
  34. package/src/components/file-view/components/PlainTextRenderer.tsx +27 -0
  35. package/src/components/file-view/components/index.ts +4 -0
  36. package/src/components/file-view/hooks/index.ts +5 -0
  37. package/src/components/file-view/hooks/useContentType.ts +34 -0
  38. package/src/components/file-view/hooks/useDarkMode.ts +62 -0
  39. package/src/components/file-view/hooks/useHighlightedTokens.ts +83 -0
  40. package/src/components/file-view/hooks/useShikiHighlighter.ts +69 -0
  41. package/src/components/file-view/index.ts +47 -0
  42. package/src/components/file-view/types.ts +180 -0
  43. package/src/components/file-view/utils/contentTypeDetection.ts +157 -0
  44. package/src/components/file-view/utils/index.ts +12 -0
  45. package/src/components/file-view/utils/languageMapping.ts +78 -0
  46. package/src/components/file-view/utils/rendererRegistry.ts +42 -0
  47. package/src/components/input.tsx +1 -1
  48. package/src/components/popover.tsx +1 -1
  49. package/src/components/select.tsx +1 -1
  50. package/src/components/switch.tsx +5 -3
  51. package/src/components/textarea.tsx +1 -1
  52. package/src/index.ts +51 -0
  53. package/src/styles.css +22 -0
  54. package/src/tailwind-preset.ts +17 -1
  55. package/src/theme/index.ts +5 -0
  56. package/src/theme/presets.ts +112 -2
  57. package/src/theme/types.ts +35 -0
  58. package/src/theme/utils.ts +231 -0
package/dist/index.cjs CHANGED
@@ -23,6 +23,10 @@ var sonner = require('sonner');
23
23
  var reactVirtual = require('@tanstack/react-virtual');
24
24
  var dateFns = require('date-fns');
25
25
  var reactDayPicker = require('react-day-picker');
26
+ var ReactMarkdownImport = require('react-markdown');
27
+ var remarkGfmImport = require('remark-gfm');
28
+
29
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
26
30
 
27
31
  function _interopNamespace(e) {
28
32
  if (e && e.__esModule) return e;
@@ -55,23 +59,25 @@ var TooltipPrimitive__namespace = /*#__PURE__*/_interopNamespace(TooltipPrimitiv
55
59
  var PopoverPrimitive__namespace = /*#__PURE__*/_interopNamespace(PopoverPrimitive);
56
60
  var DropdownMenuPrimitive__namespace = /*#__PURE__*/_interopNamespace(DropdownMenuPrimitive);
57
61
  var AlertDialogPrimitive__namespace = /*#__PURE__*/_interopNamespace(AlertDialogPrimitive);
62
+ var ReactMarkdownImport__default = /*#__PURE__*/_interopDefault(ReactMarkdownImport);
63
+ var remarkGfmImport__default = /*#__PURE__*/_interopDefault(remarkGfmImport);
58
64
 
59
65
  // src/utils/cn.ts
60
66
  function cn(...inputs) {
61
67
  return tailwindMerge.twMerge(clsx.clsx(inputs));
62
68
  }
63
69
  var buttonVariants = classVarianceAuthority.cva(
64
- "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
70
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
65
71
  {
66
72
  variants: {
67
73
  variant: {
68
- default: "bg-muted text-muted-foreground hover:bg-accent hover:text-accent-foreground",
69
- primary: "bg-accent text-accent-foreground shadow hover:shadow-md",
70
- destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90 hover:shadow-md",
71
- outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
72
- secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
73
- ghost: "hover:bg-accent hover:text-accent-foreground",
74
- link: "text-primary underline-offset-4 hover:underline"
74
+ default: "bg-muted text-foreground hover:bg-accent hover:text-accent-foreground disabled:opacity-50 disabled:text-muted-foreground",
75
+ primary: "bg-accent text-accent-foreground shadow hover:shadow-md disabled:opacity-50",
76
+ destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90 hover:shadow-md disabled:opacity-50",
77
+ outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground disabled:opacity-50 disabled:bg-muted/20 disabled:text-muted-foreground",
78
+ secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80 disabled:opacity-50",
79
+ ghost: "text-foreground hover:bg-accent hover:text-accent-foreground disabled:text-muted-foreground disabled:bg-muted/30 disabled:opacity-70",
80
+ link: "text-primary underline-offset-4 hover:underline disabled:opacity-50 disabled:text-muted-foreground"
75
81
  },
76
82
  size: {
77
83
  default: "h-9 px-4 py-2",
@@ -107,7 +113,7 @@ var Input = React20__namespace.forwardRef(
107
113
  {
108
114
  type,
109
115
  className: cn(
110
- "flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
116
+ "flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground hover:border-input-hover focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-input md:text-sm",
111
117
  className
112
118
  ),
113
119
  ref,
@@ -135,7 +141,7 @@ var Textarea = React20__namespace.forwardRef(
135
141
  "textarea",
136
142
  {
137
143
  className: cn(
138
- "flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
144
+ "flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground hover:border-input-hover focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-input md:text-sm",
139
145
  className
140
146
  ),
141
147
  ref,
@@ -223,9 +229,11 @@ var Switch = React20__namespace.forwardRef(({ className, ...props }, ref) => /*
223
229
  // Focus styles
224
230
  "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
225
231
  // Disabled styles
226
- "disabled:cursor-not-allowed disabled:opacity-50",
232
+ "disabled:cursor-not-allowed disabled:opacity-50 disabled:bg-muted",
227
233
  // Unchecked state
228
- "bg-input",
234
+ "bg-toggle-track",
235
+ // Hover
236
+ "hover:bg-toggle-track/80 data-[state=checked]:hover:bg-primary/80",
229
237
  // Checked state
230
238
  "data-[state=checked]:bg-primary",
231
239
  className
@@ -238,7 +246,7 @@ var Switch = React20__namespace.forwardRef(({ className, ...props }, ref) => /*
238
246
  className: cn(
239
247
  // Base styles
240
248
  "pointer-events-none block h-4 w-4 rounded-full",
241
- "bg-background shadow-lg ring-0",
249
+ "bg-toggle-track-foreground shadow-lg ring-0",
242
250
  "transition-transform",
243
251
  // Position based on state
244
252
  "data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0"
@@ -301,7 +309,7 @@ var SelectTrigger = React20__namespace.forwardRef(({ className, children, ...pro
301
309
  {
302
310
  ref,
303
311
  className: cn(
304
- "flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
312
+ "flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground hover:border-input-hover focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-input [&>span]:line-clamp-1",
305
313
  className
306
314
  ),
307
315
  ...props,
@@ -637,7 +645,7 @@ var PopoverContent = React20__namespace.forwardRef(({ className, align = "center
637
645
  align,
638
646
  sideOffset,
639
647
  className: cn(
640
- "z-50 w-72 rounded-md border border-border bg-popover p-4 text-popover-foreground shadow-md outline-none",
648
+ "z-50 w-auto max-w-[90vw] rounded-md border border-border bg-popover p-4 text-popover-foreground shadow-md outline-none",
641
649
  // Animation
642
650
  "data-[state=open]:animate-in data-[state=closed]:animate-out",
643
651
  "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
@@ -698,7 +706,7 @@ var DropdownMenuContent = React20__namespace.forwardRef(({ className, sideOffset
698
706
  ref,
699
707
  sideOffset,
700
708
  className: cn(
701
- "z-50 min-w-[8rem] overflow-hidden rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md",
709
+ "z-50 min-w-[8rem] max-w-[90vw] overflow-hidden rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md",
702
710
  "data-[state=open]:animate-in data-[state=closed]:animate-out",
703
711
  "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
704
712
  "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
@@ -2735,19 +2743,19 @@ function Calendar({
2735
2743
  className: cn("p-3", className),
2736
2744
  classNames: {
2737
2745
  months: "flex flex-col sm:flex-row gap-4",
2738
- month: "flex flex-col gap-4",
2739
- month_caption: "flex justify-center pt-1 relative items-center h-7 px-10",
2746
+ month: "flex flex-col gap-2 relative px-8",
2747
+ month_caption: "flex justify-center pt-1 items-center h-7",
2740
2748
  caption_label: "text-sm font-medium hidden",
2741
2749
  nav: "flex items-center gap-1",
2742
2750
  button_previous: cn(
2743
2751
  buttonVariants({ variant: "outline" }),
2744
- "absolute left-1 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100 z-10"
2752
+ "absolute left-1 top-1/2 -translate-y-1/2 h-6 w-6 bg-transparent p-0 opacity-50 hover:opacity-100 z-10"
2745
2753
  ),
2746
2754
  button_next: cn(
2747
2755
  buttonVariants({ variant: "outline" }),
2748
- "absolute right-1 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100 z-10"
2756
+ "absolute right-1 top-1/2 -translate-y-1/2 h-6 w-6 bg-transparent p-0 opacity-50 hover:opacity-100 z-10"
2749
2757
  ),
2750
- month_grid: "w-full border-collapse px-1",
2758
+ month_grid: "border-collapse mx-auto",
2751
2759
  weekdays: "flex",
2752
2760
  weekday: "text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",
2753
2761
  week: "flex w-full mt-2",
@@ -2772,12 +2780,12 @@ function Calendar({
2772
2780
  components: {
2773
2781
  Chevron: ({ orientation }) => {
2774
2782
  const Icon2 = orientation === "left" ? lucideReact.ChevronLeft : lucideReact.ChevronRight;
2775
- return /* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: "h-4 w-4" });
2783
+ return /* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: "h-3.5 w-3.5" });
2776
2784
  },
2777
2785
  MonthCaption: ({ calendarMonth }) => {
2778
2786
  const month = calendarMonth.date.getMonth();
2779
2787
  const year = calendarMonth.date.getFullYear();
2780
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-center gap-1 px-10", children: [
2788
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-center gap-1", children: [
2781
2789
  /* @__PURE__ */ jsxRuntime.jsxs(
2782
2790
  Select,
2783
2791
  {
@@ -3013,8 +3021,9 @@ function DatePickerInput({
3013
3021
  {
3014
3022
  className: cn(
3015
3023
  "flex items-center rounded-md border border-input bg-background ring-offset-background",
3024
+ "hover:border-input-hover",
3016
3025
  "focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",
3017
- disabled && "opacity-50 cursor-not-allowed",
3026
+ disabled && "opacity-50 cursor-not-allowed hover:border-input",
3018
3027
  sizeClasses[size]
3019
3028
  ),
3020
3029
  children: [
@@ -3646,7 +3655,7 @@ function CellEditor({
3646
3655
  onKeyDown: handleKeyDown,
3647
3656
  onBlur: handleBlur,
3648
3657
  className: cn(
3649
- "h-full w-full border-0 rounded-none focus:ring-2 focus:ring-primary text-sm px-2",
3658
+ "h-full w-full border-0 rounded-none bg-background focus:ring-0 text-sm px-2",
3650
3659
  validationError && "ring-2 ring-destructive focus:ring-destructive",
3651
3660
  className
3652
3661
  ),
@@ -3664,7 +3673,7 @@ function CellEditor({
3664
3673
  onKeyDown: handleKeyDown,
3665
3674
  onBlur: handleBlur,
3666
3675
  className: cn(
3667
- "h-full w-full border-0 rounded-none focus:ring-2 focus:ring-primary text-sm px-2",
3676
+ "h-full w-full border-0 rounded-none bg-background focus:ring-0 text-sm px-2",
3668
3677
  validationError && "ring-2 ring-destructive focus:ring-destructive",
3669
3678
  className
3670
3679
  ),
@@ -3734,7 +3743,7 @@ function CellEditor({
3734
3743
  {
3735
3744
  ref: selectRef,
3736
3745
  className: cn(
3737
- "h-full w-full border-0 rounded-none focus:ring-2 focus:ring-primary text-sm",
3746
+ "h-full w-full border-0 rounded-none bg-background focus:ring-0 text-sm",
3738
3747
  validationError && "ring-2 ring-destructive focus:ring-destructive",
3739
3748
  className
3740
3749
  ),
@@ -3879,6 +3888,7 @@ function useDataGridState(options) {
3879
3888
  const [internalColumnWidths, setInternalColumnWidths] = React20.useState(defaultColumnWidths);
3880
3889
  const [internalFocusedCell, setInternalFocusedCell] = React20.useState(null);
3881
3890
  const [editingCell, setEditingCell] = React20.useState(null);
3891
+ const processedDataRef = React20.useRef([]);
3882
3892
  const sorting = isControlled.sorting ? controlledSorting : internalSorting;
3883
3893
  const filters = isControlled.filters ? controlledFilters : internalFilters;
3884
3894
  const focusedCell = isControlled.focusedCell ? controlledFocusedCell : internalFocusedCell;
@@ -3999,7 +4009,8 @@ function useDataGridState(options) {
3999
4009
  }
4000
4010
  const column = columns.find((c) => c.key === columnKey);
4001
4011
  if (!column || !column.editable) return;
4002
- const row = data[rowIndex];
4012
+ const resolvedData = processedDataRef.current.length > 0 ? processedDataRef.current : data;
4013
+ const row = resolvedData[rowIndex];
4003
4014
  if (!row) return;
4004
4015
  const value = getCellValue2(row, column);
4005
4016
  setEditingCell({
@@ -4021,7 +4032,8 @@ function useDataGridState(options) {
4021
4032
  const value = valueOverride !== void 0 ? valueOverride : editingCell.value;
4022
4033
  const column = columns.find((c) => c.key === columnKey);
4023
4034
  if (column?.validator) {
4024
- const row = data[rowIndex];
4035
+ const resolvedData = processedDataRef.current.length > 0 ? processedDataRef.current : data;
4036
+ const row = resolvedData[rowIndex];
4025
4037
  const validationResult = column.validator(value, row);
4026
4038
  if (validationResult !== true && typeof validationResult === "string") {
4027
4039
  return;
@@ -4053,6 +4065,7 @@ function useDataGridState(options) {
4053
4065
  commitEdit,
4054
4066
  cancelEdit
4055
4067
  },
4068
+ processedDataRef,
4056
4069
  isControlled
4057
4070
  };
4058
4071
  }
@@ -4506,16 +4519,44 @@ function applySorting(data, sorting, columns) {
4506
4519
  if (aVal == null) return sort.direction === "asc" ? 1 : -1;
4507
4520
  if (bVal == null) return sort.direction === "asc" ? -1 : 1;
4508
4521
  let comparison = 0;
4509
- if (typeof aVal === "string" && typeof bVal === "string") {
4510
- comparison = aVal.localeCompare(bVal);
4511
- } else if (typeof aVal === "number" && typeof bVal === "number") {
4512
- comparison = aVal - bVal;
4513
- } else if (aVal instanceof Date && bVal instanceof Date) {
4514
- comparison = aVal.getTime() - bVal.getTime();
4515
- } else if (typeof aVal === "boolean" && typeof bVal === "boolean") {
4516
- comparison = aVal === bVal ? 0 : aVal ? 1 : -1;
4517
- } else {
4522
+ if (column.dataType === "number") {
4523
+ const aNum = Number(aVal);
4524
+ const bNum = Number(bVal);
4525
+ if (!isNaN(aNum) && !isNaN(bNum)) {
4526
+ comparison = aNum - bNum;
4527
+ } else {
4528
+ comparison = String(aVal).localeCompare(String(bVal));
4529
+ }
4530
+ } else if (column.dataType === "date") {
4531
+ const aDate = aVal instanceof Date ? aVal : new Date(aVal);
4532
+ const bDate = bVal instanceof Date ? bVal : new Date(bVal);
4533
+ const aTime = isNaN(aDate.getTime()) ? 0 : aDate.getTime();
4534
+ const bTime = isNaN(bDate.getTime()) ? 0 : bDate.getTime();
4535
+ comparison = aTime - bTime;
4536
+ } else if (column.dataType === "boolean") {
4537
+ const aBool = aVal === true || aVal === "true" || aVal === 1;
4538
+ const bBool = bVal === true || bVal === "true" || bVal === 1;
4539
+ comparison = aBool === bBool ? 0 : aBool ? 1 : -1;
4540
+ } else if (column.dataType === "string") {
4518
4541
  comparison = String(aVal).localeCompare(String(bVal));
4542
+ } else {
4543
+ if (typeof aVal === "number" && typeof bVal === "number") {
4544
+ comparison = aVal - bVal;
4545
+ } else if (aVal instanceof Date && bVal instanceof Date) {
4546
+ comparison = aVal.getTime() - bVal.getTime();
4547
+ } else if (typeof aVal === "boolean" && typeof bVal === "boolean") {
4548
+ comparison = aVal === bVal ? 0 : aVal ? 1 : -1;
4549
+ } else {
4550
+ const aStr = String(aVal);
4551
+ const bStr = String(bVal);
4552
+ const aNum = Number(aStr);
4553
+ const bNum = Number(bStr);
4554
+ if (!isNaN(aNum) && !isNaN(bNum) && aStr !== "" && bStr !== "") {
4555
+ comparison = aNum - bNum;
4556
+ } else {
4557
+ comparison = aStr.localeCompare(bStr);
4558
+ }
4559
+ }
4519
4560
  }
4520
4561
  return sort.direction === "asc" ? comparison : -comparison;
4521
4562
  });
@@ -4737,7 +4778,7 @@ function DataGrid({
4737
4778
  },
4738
4779
  []
4739
4780
  );
4740
- const { state, actions, isControlled } = useDataGridState({
4781
+ const { state, actions, processedDataRef, isControlled } = useDataGridState({
4741
4782
  sorting: controlledSorting,
4742
4783
  filters: controlledFilters,
4743
4784
  columnWidths: controlledColumnWidths,
@@ -4776,6 +4817,7 @@ function DataGrid({
4776
4817
  state.sorting,
4777
4818
  visibleColumns
4778
4819
  ]);
4820
+ processedDataRef.current = processedData;
4779
4821
  const { resizingColumn, getResizeProps } = useColumnResizeManager({
4780
4822
  columns: visibleColumns,
4781
4823
  columnWidths: state.columnWidths,
@@ -5111,6 +5153,7 @@ function DataGrid({
5111
5153
  "flex-shrink-0 px-3 py-2 text-sm overflow-hidden",
5112
5154
  showColumnBorders && "border-r border-border last:border-r-0",
5113
5155
  isFocused && !isEditingThisCell && "ring-2 ring-inset ring-primary",
5156
+ isEditingThisCell && "ring-2 ring-inset ring-primary bg-background",
5114
5157
  column.align === "center" && "text-center",
5115
5158
  column.align === "right" && "text-right"
5116
5159
  ),
@@ -5280,6 +5323,7 @@ function DataGrid({
5280
5323
  "flex-shrink-0 px-3 py-2 text-sm overflow-hidden",
5281
5324
  showColumnBorders && "border-r border-border last:border-r-0",
5282
5325
  isFocused && !isEditingThisCell && "ring-2 ring-inset ring-primary",
5326
+ isEditingThisCell && "ring-2 ring-inset ring-primary bg-background",
5283
5327
  column.align === "center" && "text-center",
5284
5328
  column.align === "right" && "text-right"
5285
5329
  ),
@@ -5535,8 +5579,9 @@ function Autocomplete({
5535
5579
  disabled,
5536
5580
  className: cn(
5537
5581
  "flex h-9 w-full items-center justify-between gap-2 whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background",
5582
+ "hover:border-input-hover",
5538
5583
  "focus:outline-none focus:ring-1 focus:ring-ring",
5539
- "disabled:cursor-not-allowed disabled:opacity-50",
5584
+ "disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-input",
5540
5585
  !selectedOption && "text-muted-foreground",
5541
5586
  className
5542
5587
  ),
@@ -5767,11 +5812,21 @@ var GREEN_THEME = {
5767
5812
  border: "#243630",
5768
5813
  input: "#243630",
5769
5814
  ring: "#6FCF97",
5815
+ toggleTrack: "#354840",
5816
+ toggleTrackForeground: "#E6F5EC",
5817
+ inputHover: "#6FCF97",
5770
5818
  chart1: "#6FCF97",
5771
5819
  chart2: "#8FE3B0",
5772
5820
  chart3: "#9DB8A8",
5773
5821
  chart4: "#2d4038",
5774
5822
  chart5: "#354840",
5823
+ chart6: "#4CAF50",
5824
+ chart7: "#81C784",
5825
+ chart8: "#F2C94C",
5826
+ chart9: "#EB5757",
5827
+ chart10: "#56CCF2",
5828
+ chart11: "#BB6BD9",
5829
+ chart12: "#2D9CDB",
5775
5830
  radius: "0.5rem"
5776
5831
  };
5777
5832
  var OPTILOGIC_LEGACY_THEME = {
@@ -5802,13 +5857,23 @@ var OPTILOGIC_LEGACY_THEME = {
5802
5857
  chip: "#B8C5F9",
5803
5858
  chipForeground: "#0C0A5A",
5804
5859
  border: "#D0D0D0",
5805
- input: "#FFFFFF",
5860
+ input: "#D0D0D0",
5806
5861
  ring: "#5766F2",
5862
+ toggleTrack: "#D0D0D0",
5863
+ toggleTrackForeground: "#FFFFFF",
5864
+ inputHover: "#5766F2",
5807
5865
  chart1: "#78D237",
5808
5866
  chart2: "#F5CF47",
5809
5867
  chart3: "#5766F2",
5810
5868
  chart4: "#44BD7E",
5811
5869
  chart5: "#929BEF",
5870
+ chart6: "#DB2828",
5871
+ chart7: "#E07B39",
5872
+ chart8: "#2BBBAD",
5873
+ chart9: "#A5673F",
5874
+ chart10: "#00B5AD",
5875
+ chart11: "#6435C9",
5876
+ chart12: "#E03997",
5812
5877
  radius: "0.5rem"
5813
5878
  };
5814
5879
  var FUTURISTIC_THEME = {
@@ -5841,11 +5906,21 @@ var FUTURISTIC_THEME = {
5841
5906
  border: "#1e293b",
5842
5907
  input: "#1e293b",
5843
5908
  ring: "#6366f1",
5909
+ toggleTrack: "#334155",
5910
+ toggleTrackForeground: "#e0e7ff",
5911
+ inputHover: "#6366f1",
5844
5912
  chart1: "#6366f1",
5845
5913
  chart2: "#8b5cf6",
5846
5914
  chart3: "#a855f7",
5847
5915
  chart4: "#ec4899",
5848
5916
  chart5: "#f43f5e",
5917
+ chart6: "#06b6d4",
5918
+ chart7: "#14b8a6",
5919
+ chart8: "#f97316",
5920
+ chart9: "#eab308",
5921
+ chart10: "#22c55e",
5922
+ chart11: "#0ea5e9",
5923
+ chart12: "#f43f5e",
5849
5924
  radius: "0.5rem"
5850
5925
  };
5851
5926
  var NATURE_THEME = {
@@ -5878,11 +5953,21 @@ var NATURE_THEME = {
5878
5953
  border: "#243824",
5879
5954
  input: "#243824",
5880
5955
  ring: "#4caf50",
5956
+ toggleTrack: "#3d5a3d",
5957
+ toggleTrackForeground: "#e8f5e9",
5958
+ inputHover: "#4caf50",
5881
5959
  chart1: "#4caf50",
5882
5960
  chart2: "#66bb6a",
5883
5961
  chart3: "#81c784",
5884
5962
  chart4: "#a5d6a7",
5885
5963
  chart5: "#c8e6c9",
5964
+ chart6: "#8bc34a",
5965
+ chart7: "#cddc39",
5966
+ chart8: "#ffb74d",
5967
+ chart9: "#4db6ac",
5968
+ chart10: "#7986cb",
5969
+ chart11: "#e57373",
5970
+ chart12: "#64b5f6",
5886
5971
  radius: "0.5rem"
5887
5972
  };
5888
5973
  var SCIFI_THEME = {
@@ -5915,11 +6000,21 @@ var SCIFI_THEME = {
5915
6000
  border: "#30363d",
5916
6001
  input: "#21262d",
5917
6002
  ring: "#00d9ff",
6003
+ toggleTrack: "#30363d",
6004
+ toggleTrackForeground: "#c9d1d9",
6005
+ inputHover: "#00d9ff",
5918
6006
  chart1: "#00d9ff",
5919
6007
  chart2: "#ff00ff",
5920
6008
  chart3: "#00ff88",
5921
6009
  chart4: "#ffd93d",
5922
6010
  chart5: "#58a6ff",
6011
+ chart6: "#ff6b6b",
6012
+ chart7: "#4ecdc4",
6013
+ chart8: "#a855f7",
6014
+ chart9: "#fb923c",
6015
+ chart10: "#38bdf8",
6016
+ chart11: "#f472b6",
6017
+ chart12: "#34d399",
5923
6018
  radius: "0.5rem"
5924
6019
  };
5925
6020
  var OCEAN_THEME = {
@@ -5952,11 +6047,21 @@ var OCEAN_THEME = {
5952
6047
  border: "#1e3a5f",
5953
6048
  input: "#1e3a5f",
5954
6049
  ring: "#2196f3",
6050
+ toggleTrack: "#264a6e",
6051
+ toggleTrackForeground: "#e3f2fd",
6052
+ inputHover: "#2196f3",
5955
6053
  chart1: "#2196f3",
5956
6054
  chart2: "#00bcd4",
5957
6055
  chart3: "#03a9f4",
5958
6056
  chart4: "#0288d1",
5959
6057
  chart5: "#0277bd",
6058
+ chart6: "#26c6da",
6059
+ chart7: "#42a5f5",
6060
+ chart8: "#66bb6a",
6061
+ chart9: "#ffb74d",
6062
+ chart10: "#ef5350",
6063
+ chart11: "#ab47bc",
6064
+ chart12: "#78909c",
5960
6065
  radius: "0.5rem"
5961
6066
  };
5962
6067
  var SUNSET_THEME = {
@@ -5989,11 +6094,21 @@ var SUNSET_THEME = {
5989
6094
  border: "#241424",
5990
6095
  input: "#241424",
5991
6096
  ring: "#ff6b35",
6097
+ toggleTrack: "#3d2a3d",
6098
+ toggleTrackForeground: "#ffe0e6",
6099
+ inputHover: "#ff6b35",
5992
6100
  chart1: "#ff6b35",
5993
6101
  chart2: "#c44569",
5994
6102
  chart3: "#f7931e",
5995
6103
  chart4: "#ffb703",
5996
6104
  chart5: "#ff8c42",
6105
+ chart6: "#06d6a0",
6106
+ chart7: "#118ab2",
6107
+ chart8: "#ef476f",
6108
+ chart9: "#ffd166",
6109
+ chart10: "#073b4c",
6110
+ chart11: "#8338ec",
6111
+ chart12: "#3a86ff",
5997
6112
  radius: "0.5rem"
5998
6113
  };
5999
6114
  var FOREST_THEME = {
@@ -6026,11 +6141,21 @@ var FOREST_THEME = {
6026
6141
  border: "#1b5e20",
6027
6142
  input: "#1a2e1a",
6028
6143
  ring: "#2e7d32",
6144
+ toggleTrack: "#2d4a2d",
6145
+ toggleTrackForeground: "#e8f5e9",
6146
+ inputHover: "#2e7d32",
6029
6147
  chart1: "#2e7d32",
6030
6148
  chart2: "#388e3c",
6031
6149
  chart3: "#43a047",
6032
6150
  chart4: "#66bb6a",
6033
6151
  chart5: "#81c784",
6152
+ chart6: "#a5d6a7",
6153
+ chart7: "#c8e6c9",
6154
+ chart8: "#ffb74d",
6155
+ chart9: "#4db6ac",
6156
+ chart10: "#7986cb",
6157
+ chart11: "#e57373",
6158
+ chart12: "#64b5f6",
6034
6159
  radius: "0.5rem"
6035
6160
  };
6036
6161
  var CYBERPUNK_THEME = {
@@ -6063,11 +6188,21 @@ var CYBERPUNK_THEME = {
6063
6188
  border: "#1a1a2e",
6064
6189
  input: "#16213e",
6065
6190
  ring: "#ff00ff",
6191
+ toggleTrack: "#2a2a4e",
6192
+ toggleTrackForeground: "#f0f0f0",
6193
+ inputHover: "#ff00ff",
6066
6194
  chart1: "#ff00ff",
6067
6195
  chart2: "#00ffff",
6068
6196
  chart3: "#00ff88",
6069
6197
  chart4: "#ffd700",
6070
6198
  chart5: "#ff1744",
6199
+ chart6: "#ff6b6b",
6200
+ chart7: "#4ecdc4",
6201
+ chart8: "#a855f7",
6202
+ chart9: "#fb923c",
6203
+ chart10: "#38bdf8",
6204
+ chart11: "#84cc16",
6205
+ chart12: "#f97316",
6071
6206
  radius: "0.5rem"
6072
6207
  };
6073
6208
  var MINIMALIST_LIGHT_THEME = {
@@ -6098,13 +6233,23 @@ var MINIMALIST_LIGHT_THEME = {
6098
6233
  chip: "#e9ecef",
6099
6234
  chipForeground: "#495057",
6100
6235
  border: "#dee2e6",
6101
- input: "#ffffff",
6236
+ input: "#dee2e6",
6102
6237
  ring: "#000000",
6238
+ toggleTrack: "#ced4da",
6239
+ toggleTrackForeground: "#ffffff",
6240
+ inputHover: "#6c757d",
6103
6241
  chart1: "#000000",
6104
6242
  chart2: "#6c757d",
6105
6243
  chart3: "#adb5bd",
6106
6244
  chart4: "#dee2e6",
6107
6245
  chart5: "#e9ecef",
6246
+ chart6: "#343a40",
6247
+ chart7: "#495057",
6248
+ chart8: "#868e96",
6249
+ chart9: "#5c6bc0",
6250
+ chart10: "#26a69a",
6251
+ chart11: "#ef5350",
6252
+ chart12: "#ffa726",
6108
6253
  radius: "0.5rem"
6109
6254
  };
6110
6255
  var DARK_ELEGANT_THEME = {
@@ -6137,11 +6282,21 @@ var DARK_ELEGANT_THEME = {
6137
6282
  border: "#2d2d2d",
6138
6283
  input: "#1e1e1e",
6139
6284
  ring: "#bb86fc",
6285
+ toggleTrack: "#3d3d3d",
6286
+ toggleTrackForeground: "#e0e0e0",
6287
+ inputHover: "#bb86fc",
6140
6288
  chart1: "#bb86fc",
6141
6289
  chart2: "#03dac6",
6142
6290
  chart3: "#4caf50",
6143
6291
  chart4: "#ff9800",
6144
6292
  chart5: "#cf6679",
6293
+ chart6: "#64b5f6",
6294
+ chart7: "#81c784",
6295
+ chart8: "#ffb74d",
6296
+ chart9: "#e57373",
6297
+ chart10: "#7986cb",
6298
+ chart11: "#4db6ac",
6299
+ chart12: "#f06292",
6145
6300
  radius: "0.5rem"
6146
6301
  };
6147
6302
  var PRESET_THEMES = [OPTILOGIC_LEGACY_THEME];
@@ -6227,13 +6382,32 @@ function themeToHsl(theme) {
6227
6382
  border: hexToHsl(theme.border),
6228
6383
  input: hexToHsl(theme.input),
6229
6384
  ring: hexToHsl(theme.ring),
6385
+ toggleTrack: theme.toggleTrack ? hexToHsl(theme.toggleTrack) : void 0,
6386
+ toggleTrackForeground: theme.toggleTrackForeground ? hexToHsl(theme.toggleTrackForeground) : void 0,
6387
+ inputHover: theme.inputHover ? hexToHsl(theme.inputHover) : void 0,
6230
6388
  chart1: hexToHsl(theme.chart1),
6231
6389
  chart2: hexToHsl(theme.chart2),
6232
6390
  chart3: hexToHsl(theme.chart3),
6233
6391
  chart4: hexToHsl(theme.chart4),
6234
- chart5: hexToHsl(theme.chart5)
6392
+ chart5: hexToHsl(theme.chart5),
6393
+ chart6: hexToHsl(theme.chart6),
6394
+ chart7: hexToHsl(theme.chart7),
6395
+ chart8: hexToHsl(theme.chart8),
6396
+ chart9: hexToHsl(theme.chart9),
6397
+ chart10: hexToHsl(theme.chart10),
6398
+ chart11: hexToHsl(theme.chart11),
6399
+ chart12: hexToHsl(theme.chart12)
6235
6400
  };
6236
6401
  }
6402
+ function deriveInputHoverHsl(hslTheme) {
6403
+ const parts = hslTheme.foreground.split(/\s+/);
6404
+ if (parts.length >= 3) {
6405
+ const h = parts[0];
6406
+ const s = parts[1];
6407
+ return `${h} ${s} 50%`;
6408
+ }
6409
+ return hslTheme.foreground;
6410
+ }
6237
6411
  function applyTheme(theme, targetElement) {
6238
6412
  const element = targetElement || document.documentElement;
6239
6413
  const hslTheme = themeToHsl(theme);
@@ -6268,11 +6442,33 @@ function applyTheme(theme, targetElement) {
6268
6442
  element.style.setProperty("--border", hslTheme.border);
6269
6443
  element.style.setProperty("--input", hslTheme.input);
6270
6444
  element.style.setProperty("--ring", hslTheme.ring);
6445
+ element.style.setProperty(
6446
+ "--toggle-track",
6447
+ hslTheme.toggleTrack ?? hslTheme.muted
6448
+ );
6449
+ element.style.setProperty(
6450
+ "--toggle-track-foreground",
6451
+ hslTheme.toggleTrackForeground ?? hslTheme.background
6452
+ );
6453
+ element.style.setProperty(
6454
+ "--input-hover",
6455
+ hslTheme.inputHover ?? deriveInputHoverHsl(hslTheme)
6456
+ );
6271
6457
  element.style.setProperty("--chart-1", hslTheme.chart1);
6272
6458
  element.style.setProperty("--chart-2", hslTheme.chart2);
6273
6459
  element.style.setProperty("--chart-3", hslTheme.chart3);
6274
6460
  element.style.setProperty("--chart-4", hslTheme.chart4);
6275
6461
  element.style.setProperty("--chart-5", hslTheme.chart5);
6462
+ element.style.setProperty("--chart-6", hslTheme.chart6);
6463
+ element.style.setProperty("--chart-7", hslTheme.chart7);
6464
+ element.style.setProperty("--chart-8", hslTheme.chart8);
6465
+ element.style.setProperty("--chart-9", hslTheme.chart9);
6466
+ element.style.setProperty("--chart-10", hslTheme.chart10);
6467
+ element.style.setProperty("--chart-11", hslTheme.chart11);
6468
+ element.style.setProperty("--chart-12", hslTheme.chart12);
6469
+ if (theme.disabledOpacity) {
6470
+ element.style.setProperty("--disabled-opacity", theme.disabledOpacity);
6471
+ }
6276
6472
  if (theme.radius) {
6277
6473
  element.style.setProperty("--radius", theme.radius);
6278
6474
  }
@@ -6315,7 +6511,14 @@ function validateTheme(theme) {
6315
6511
  "chart2",
6316
6512
  "chart3",
6317
6513
  "chart4",
6318
- "chart5"
6514
+ "chart5",
6515
+ "chart6",
6516
+ "chart7",
6517
+ "chart8",
6518
+ "chart9",
6519
+ "chart10",
6520
+ "chart11",
6521
+ "chart12"
6319
6522
  ];
6320
6523
  for (const field of requiredFields) {
6321
6524
  if (!(field in t)) {
@@ -6363,11 +6566,21 @@ function areThemesEqual(theme1, theme2) {
6363
6566
  "border",
6364
6567
  "input",
6365
6568
  "ring",
6569
+ "toggleTrack",
6570
+ "toggleTrackForeground",
6571
+ "inputHover",
6366
6572
  "chart1",
6367
6573
  "chart2",
6368
6574
  "chart3",
6369
6575
  "chart4",
6370
- "chart5"
6576
+ "chart5",
6577
+ "chart6",
6578
+ "chart7",
6579
+ "chart8",
6580
+ "chart9",
6581
+ "chart10",
6582
+ "chart11",
6583
+ "chart12"
6371
6584
  ];
6372
6585
  for (const field of colorFields) {
6373
6586
  if (theme1[field] !== theme2[field]) {
@@ -6801,6 +7014,1114 @@ function useContextMenu() {
6801
7014
  };
6802
7015
  }
6803
7016
 
7017
+ // src/components/file-view/utils/contentTypeDetection.ts
7018
+ var EXTENSION_MAP = {
7019
+ // Code / programming languages
7020
+ ts: "code",
7021
+ tsx: "code",
7022
+ js: "code",
7023
+ jsx: "code",
7024
+ mjs: "code",
7025
+ cjs: "code",
7026
+ py: "code",
7027
+ rb: "code",
7028
+ go: "code",
7029
+ rs: "code",
7030
+ java: "code",
7031
+ c: "code",
7032
+ cpp: "code",
7033
+ h: "code",
7034
+ hpp: "code",
7035
+ cs: "code",
7036
+ php: "code",
7037
+ swift: "code",
7038
+ kt: "code",
7039
+ scala: "code",
7040
+ r: "code",
7041
+ sql: "code",
7042
+ sh: "code",
7043
+ bash: "code",
7044
+ zsh: "code",
7045
+ ps1: "code",
7046
+ bat: "code",
7047
+ lua: "code",
7048
+ perl: "code",
7049
+ pl: "code",
7050
+ // Config / data (code-rendered)
7051
+ json: "code",
7052
+ yaml: "code",
7053
+ yml: "code",
7054
+ toml: "code",
7055
+ xml: "code",
7056
+ html: "html",
7057
+ htm: "html",
7058
+ css: "code",
7059
+ scss: "code",
7060
+ sass: "code",
7061
+ less: "code",
7062
+ graphql: "code",
7063
+ gql: "code",
7064
+ // Optimization / domain-specific
7065
+ lp: "code",
7066
+ dat: "code",
7067
+ // Markdown
7068
+ md: "markdown",
7069
+ mdx: "markdown",
7070
+ // Images
7071
+ png: "image",
7072
+ jpg: "image",
7073
+ jpeg: "image",
7074
+ gif: "image",
7075
+ svg: "image",
7076
+ webp: "image",
7077
+ ico: "image",
7078
+ bmp: "image",
7079
+ // PDF
7080
+ pdf: "pdf",
7081
+ // CSV
7082
+ csv: "csv",
7083
+ tsv: "csv",
7084
+ // Plain text
7085
+ txt: "plaintext",
7086
+ log: "plaintext",
7087
+ env: "plaintext"
7088
+ };
7089
+ var SPECIAL_FILES = {
7090
+ dockerfile: "code",
7091
+ makefile: "code",
7092
+ rakefile: "code",
7093
+ gemfile: "code",
7094
+ procfile: "code"
7095
+ };
7096
+ function getFileExtension(fileName) {
7097
+ if (!fileName) return null;
7098
+ const baseName = fileName.split("/").pop() || fileName;
7099
+ if (baseName.startsWith(".") && !baseName.slice(1).includes(".")) {
7100
+ return baseName.slice(1).toLowerCase();
7101
+ }
7102
+ const lastDot = baseName.lastIndexOf(".");
7103
+ if (lastDot === -1 || lastDot === baseName.length - 1) return null;
7104
+ return baseName.slice(lastDot + 1).toLowerCase();
7105
+ }
7106
+ function detectContentType(fileName) {
7107
+ const baseName = (fileName.split("/").pop() || fileName).toLowerCase();
7108
+ const specialType = SPECIAL_FILES[baseName];
7109
+ if (specialType) {
7110
+ return { type: specialType, extension: baseName };
7111
+ }
7112
+ const extension = getFileExtension(fileName);
7113
+ if (!extension) {
7114
+ return { type: "unknown", extension: null };
7115
+ }
7116
+ const type = EXTENSION_MAP[extension] ?? "unknown";
7117
+ return { type, extension };
7118
+ }
7119
+ function isTextContentType(contentType) {
7120
+ return contentType === "code" || contentType === "markdown" || contentType === "plaintext" || contentType === "csv" || contentType === "html" || contentType === "unknown";
7121
+ }
7122
+ function isUrlContentType(contentType) {
7123
+ return contentType === "image" || contentType === "pdf";
7124
+ }
7125
+
7126
+ // src/components/file-view/hooks/useContentType.ts
7127
+ function useContentType({
7128
+ fileName,
7129
+ contentTypeOverride
7130
+ }) {
7131
+ return React20.useMemo(() => {
7132
+ if (contentTypeOverride) {
7133
+ return {
7134
+ type: contentTypeOverride,
7135
+ extension: null,
7136
+ isOverridden: true
7137
+ };
7138
+ }
7139
+ const detected = detectContentType(fileName);
7140
+ return { ...detected, isOverridden: false };
7141
+ }, [fileName, contentTypeOverride]);
7142
+ }
7143
+ var globalHighlighter = null;
7144
+ var initPromise = null;
7145
+ async function getOrCreateHighlighter() {
7146
+ if (globalHighlighter) return globalHighlighter;
7147
+ if (!initPromise) {
7148
+ initPromise = (async () => {
7149
+ try {
7150
+ const { createHighlighter } = await import('shiki');
7151
+ globalHighlighter = await createHighlighter({
7152
+ themes: ["github-light", "github-dark"],
7153
+ langs: []
7154
+ });
7155
+ return globalHighlighter;
7156
+ } catch {
7157
+ return null;
7158
+ }
7159
+ })();
7160
+ }
7161
+ return initPromise;
7162
+ }
7163
+ function useShikiHighlighter() {
7164
+ const [state, setState] = React20.useState({
7165
+ highlighter: globalHighlighter,
7166
+ isReady: globalHighlighter !== null
7167
+ });
7168
+ React20.useEffect(() => {
7169
+ if (globalHighlighter) {
7170
+ setState({ highlighter: globalHighlighter, isReady: true });
7171
+ return;
7172
+ }
7173
+ let cancelled = false;
7174
+ getOrCreateHighlighter().then((h) => {
7175
+ if (!cancelled) {
7176
+ setState({ highlighter: h, isReady: true });
7177
+ }
7178
+ });
7179
+ return () => {
7180
+ cancelled = true;
7181
+ };
7182
+ }, []);
7183
+ return state;
7184
+ }
7185
+ function getBackgroundLightness(el) {
7186
+ const value = getComputedStyle(el).getPropertyValue("--background").trim();
7187
+ if (!value) return null;
7188
+ const match = value.match(/(\d+(?:\.\d+)?)%\s*$/);
7189
+ return match ? parseFloat(match[1]) : null;
7190
+ }
7191
+ function useDarkMode() {
7192
+ const checkDark = React20.useCallback(() => {
7193
+ if (typeof document === "undefined") return false;
7194
+ const lightness = getBackgroundLightness(document.documentElement);
7195
+ if (lightness === null) {
7196
+ return document.documentElement.classList.contains("dark");
7197
+ }
7198
+ return lightness < 50;
7199
+ }, []);
7200
+ const [isDark, setIsDark] = React20.useState(checkDark);
7201
+ React20.useEffect(() => {
7202
+ const el = document.documentElement;
7203
+ const update = () => {
7204
+ setIsDark(checkDark());
7205
+ };
7206
+ const observer = new MutationObserver(update);
7207
+ observer.observe(el, {
7208
+ attributes: true,
7209
+ attributeFilter: ["class", "style"]
7210
+ });
7211
+ update();
7212
+ return () => observer.disconnect();
7213
+ }, [checkDark]);
7214
+ return isDark;
7215
+ }
7216
+
7217
+ // src/components/file-view/hooks/useHighlightedTokens.ts
7218
+ function useHighlightedTokens(code, language) {
7219
+ const { highlighter, isReady } = useShikiHighlighter();
7220
+ const isDark = useDarkMode();
7221
+ const [lines, setLines] = React20.useState(null);
7222
+ React20.useEffect(() => {
7223
+ if (!isReady || !highlighter || !code) {
7224
+ setLines(null);
7225
+ return;
7226
+ }
7227
+ let cancelled = false;
7228
+ const theme = isDark ? "github-dark" : "github-light";
7229
+ (async () => {
7230
+ try {
7231
+ if (language !== "text") {
7232
+ const loadedLangs = highlighter.getLoadedLanguages();
7233
+ if (!loadedLangs.includes(language)) {
7234
+ await highlighter.loadLanguage(language);
7235
+ }
7236
+ }
7237
+ } catch {
7238
+ if (!cancelled) setLines(null);
7239
+ return;
7240
+ }
7241
+ if (cancelled) return;
7242
+ try {
7243
+ const result = highlighter.codeToTokens(code, {
7244
+ lang: language,
7245
+ theme
7246
+ });
7247
+ if (!cancelled) {
7248
+ setLines(
7249
+ result.tokens.map(
7250
+ (line) => line.map((token) => ({
7251
+ content: token.content,
7252
+ color: token.color
7253
+ }))
7254
+ )
7255
+ );
7256
+ }
7257
+ } catch {
7258
+ if (!cancelled) setLines(null);
7259
+ }
7260
+ })();
7261
+ return () => {
7262
+ cancelled = true;
7263
+ };
7264
+ }, [highlighter, isReady, code, language, isDark]);
7265
+ return { lines };
7266
+ }
7267
+
7268
+ // src/components/file-view/utils/languageMapping.ts
7269
+ var EXTENSION_OVERRIDES = {
7270
+ yml: "yaml",
7271
+ htm: "html",
7272
+ cjs: "javascript",
7273
+ mjs: "javascript",
7274
+ jsx: "jsx",
7275
+ tsx: "tsx",
7276
+ h: "c",
7277
+ hpp: "cpp",
7278
+ cs: "csharp",
7279
+ rb: "ruby",
7280
+ sh: "shellscript",
7281
+ bash: "shellscript",
7282
+ zsh: "shellscript",
7283
+ ps1: "powershell",
7284
+ bat: "bat",
7285
+ kt: "kotlin",
7286
+ rs: "rust",
7287
+ gql: "graphql",
7288
+ pl: "perl",
7289
+ sass: "sass",
7290
+ scss: "scss",
7291
+ less: "less",
7292
+ // Domain-specific / data formats without shiki support
7293
+ lp: "text",
7294
+ dat: "text",
7295
+ env: "shellscript"
7296
+ };
7297
+ var SPECIAL_FILE_LANGUAGES = {
7298
+ dockerfile: "dockerfile",
7299
+ makefile: "makefile",
7300
+ rakefile: "ruby",
7301
+ gemfile: "ruby",
7302
+ procfile: "yaml"
7303
+ };
7304
+ function getLanguageFromFileName(fileName) {
7305
+ const baseName = (fileName.split("/").pop() || fileName).toLowerCase();
7306
+ const specialLang = SPECIAL_FILE_LANGUAGES[baseName];
7307
+ if (specialLang) return specialLang;
7308
+ let ext = null;
7309
+ if (baseName.startsWith(".") && !baseName.slice(1).includes(".")) {
7310
+ ext = baseName.slice(1);
7311
+ } else {
7312
+ const lastDot = baseName.lastIndexOf(".");
7313
+ if (lastDot !== -1 && lastDot !== baseName.length - 1) {
7314
+ ext = baseName.slice(lastDot + 1);
7315
+ }
7316
+ }
7317
+ if (!ext) return "text";
7318
+ return EXTENSION_OVERRIDES[ext] ?? ext;
7319
+ }
7320
+ function CodeRenderer({
7321
+ content,
7322
+ fileName,
7323
+ className
7324
+ }) {
7325
+ const language = React20__namespace.useMemo(
7326
+ () => getLanguageFromFileName(fileName),
7327
+ [fileName]
7328
+ );
7329
+ const plainLines = React20__namespace.useMemo(
7330
+ () => (content ?? "").split("\n"),
7331
+ [content]
7332
+ );
7333
+ const { lines: highlightedLines } = useHighlightedTokens(
7334
+ content ?? "",
7335
+ language
7336
+ );
7337
+ const gutterWidth = React20__namespace.useMemo(
7338
+ () => `${Math.max(String(plainLines.length).length, 2) + 2}ch`,
7339
+ [plainLines.length]
7340
+ );
7341
+ return /* @__PURE__ */ jsxRuntime.jsx(
7342
+ "div",
7343
+ {
7344
+ className: cn(
7345
+ "relative h-full w-full overflow-auto rounded-md border border-border bg-background",
7346
+ "scrollbar-thin",
7347
+ className
7348
+ ),
7349
+ children: /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "m-0 p-0", children: /* @__PURE__ */ jsxRuntime.jsx("code", { className: "block font-mono text-sm leading-relaxed", children: highlightedLines ? highlightedLines.map((tokens, index) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex", children: [
7350
+ /* @__PURE__ */ jsxRuntime.jsx(
7351
+ "span",
7352
+ {
7353
+ className: "sticky left-0 shrink-0 select-none border-r border-border bg-muted px-3 text-right text-muted-foreground",
7354
+ style: { minWidth: gutterWidth },
7355
+ children: index + 1
7356
+ }
7357
+ ),
7358
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "whitespace-pre px-4", children: tokens.length === 0 || tokens.length === 1 && tokens[0].content === "" ? " " : tokens.map((token, ti) => /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: token.color }, children: token.content }, ti)) })
7359
+ ] }, index)) : plainLines.map((line, index) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex", children: [
7360
+ /* @__PURE__ */ jsxRuntime.jsx(
7361
+ "span",
7362
+ {
7363
+ className: "sticky left-0 shrink-0 select-none border-r border-border bg-muted px-3 text-right text-muted-foreground",
7364
+ style: { minWidth: gutterWidth },
7365
+ children: index + 1
7366
+ }
7367
+ ),
7368
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "whitespace-pre px-4 text-foreground", children: line || " " })
7369
+ ] }, index)) }) })
7370
+ }
7371
+ );
7372
+ }
7373
+ CodeRenderer.displayName = "CodeRenderer";
7374
+ function HighlightedCodeBlock({
7375
+ children,
7376
+ className: codeClassName,
7377
+ ...props
7378
+ }) {
7379
+ const language = React20__namespace.useMemo(() => {
7380
+ if (!codeClassName) return "text";
7381
+ const match = codeClassName.match(/language-(\S+)/);
7382
+ return match ? match[1] : "text";
7383
+ }, [codeClassName]);
7384
+ const code = React20__namespace.useMemo(() => {
7385
+ const raw = String(children);
7386
+ return raw.endsWith("\n") ? raw.slice(0, -1) : raw;
7387
+ }, [children]);
7388
+ const { lines } = useHighlightedTokens(code, language);
7389
+ if (lines) {
7390
+ return /* @__PURE__ */ jsxRuntime.jsx("code", { className: cn("bg-transparent p-0", codeClassName), ...props, children: lines.map((tokens, i) => /* @__PURE__ */ jsxRuntime.jsxs(React20__namespace.Fragment, { children: [
7391
+ i > 0 && "\n",
7392
+ tokens.map((token, ti) => /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: token.color }, children: token.content }, ti))
7393
+ ] }, i)) });
7394
+ }
7395
+ return /* @__PURE__ */ jsxRuntime.jsx("code", { className: cn("bg-transparent p-0", codeClassName), ...props, children });
7396
+ }
7397
+ function MarkdownImage({
7398
+ src,
7399
+ alt,
7400
+ resolveImageUrl,
7401
+ ...props
7402
+ }) {
7403
+ const needsResolution = !!src && !!resolveImageUrl && !src.startsWith("http://") && !src.startsWith("https://") && !src.startsWith("data:");
7404
+ const [resolvedUrl, setResolvedUrl] = React20__namespace.useState(null);
7405
+ const [error, setError] = React20__namespace.useState(false);
7406
+ const [loading, setLoading] = React20__namespace.useState(needsResolution);
7407
+ React20__namespace.useEffect(() => {
7408
+ if (!needsResolution || !src || !resolveImageUrl) return;
7409
+ let cancelled = false;
7410
+ let blobUrl = null;
7411
+ setLoading(true);
7412
+ setError(false);
7413
+ setResolvedUrl(null);
7414
+ Promise.resolve(resolveImageUrl(src)).then((url) => {
7415
+ if (cancelled) {
7416
+ if (url.startsWith("blob:")) URL.revokeObjectURL(url);
7417
+ return;
7418
+ }
7419
+ if (url.startsWith("blob:")) blobUrl = url;
7420
+ setResolvedUrl(url);
7421
+ setLoading(false);
7422
+ }).catch(() => {
7423
+ if (!cancelled) {
7424
+ setError(true);
7425
+ setLoading(false);
7426
+ }
7427
+ });
7428
+ return () => {
7429
+ cancelled = true;
7430
+ if (blobUrl) URL.revokeObjectURL(blobUrl);
7431
+ };
7432
+ }, [needsResolution, src, resolveImageUrl]);
7433
+ if (!needsResolution) {
7434
+ return /* @__PURE__ */ jsxRuntime.jsx("img", { src, alt, className: "max-w-full rounded", ...props });
7435
+ }
7436
+ if (loading) {
7437
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "my-2 inline-block h-24 w-40 animate-pulse rounded bg-muted" });
7438
+ }
7439
+ if (error || !resolvedUrl) {
7440
+ return /* @__PURE__ */ jsxRuntime.jsx("img", { src, alt, className: "max-w-full rounded", ...props });
7441
+ }
7442
+ return /* @__PURE__ */ jsxRuntime.jsx(
7443
+ "img",
7444
+ {
7445
+ src: resolvedUrl,
7446
+ alt,
7447
+ className: "max-w-full rounded",
7448
+ ...props
7449
+ }
7450
+ );
7451
+ }
7452
+ function MarkdownRenderer({
7453
+ content,
7454
+ className,
7455
+ resolveImageUrl
7456
+ }) {
7457
+ const markdownComponents = React20__namespace.useMemo(
7458
+ () => ({
7459
+ code: ({
7460
+ children,
7461
+ className: codeClassName,
7462
+ ...props
7463
+ }) => {
7464
+ const isInline = !codeClassName;
7465
+ if (isInline) {
7466
+ return /* @__PURE__ */ jsxRuntime.jsx(
7467
+ "code",
7468
+ {
7469
+ className: "rounded bg-muted px-1.5 py-0.5 font-mono text-[85%]",
7470
+ ...props,
7471
+ children
7472
+ }
7473
+ );
7474
+ }
7475
+ return /* @__PURE__ */ jsxRuntime.jsx(HighlightedCodeBlock, { className: codeClassName, ...props, children });
7476
+ },
7477
+ pre: ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
7478
+ "pre",
7479
+ {
7480
+ className: "my-4 overflow-auto rounded-md border border-border bg-muted p-4 font-mono text-sm leading-relaxed",
7481
+ ...props,
7482
+ children
7483
+ }
7484
+ ),
7485
+ blockquote: ({
7486
+ children,
7487
+ ...props
7488
+ }) => /* @__PURE__ */ jsxRuntime.jsx(
7489
+ "blockquote",
7490
+ {
7491
+ className: "my-4 border-l-4 border-border pl-4 text-muted-foreground",
7492
+ ...props,
7493
+ children
7494
+ }
7495
+ ),
7496
+ a: ({
7497
+ children,
7498
+ href,
7499
+ ...props
7500
+ }) => /* @__PURE__ */ jsxRuntime.jsx(
7501
+ "a",
7502
+ {
7503
+ href,
7504
+ target: "_blank",
7505
+ rel: "noopener noreferrer",
7506
+ className: "text-primary hover:underline",
7507
+ ...props,
7508
+ children
7509
+ }
7510
+ ),
7511
+ table: ({
7512
+ children,
7513
+ ...props
7514
+ }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "my-4 overflow-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
7515
+ "table",
7516
+ {
7517
+ className: "w-full border-collapse border border-border text-sm",
7518
+ ...props,
7519
+ children
7520
+ }
7521
+ ) }),
7522
+ th: ({
7523
+ children,
7524
+ ...props
7525
+ }) => /* @__PURE__ */ jsxRuntime.jsx(
7526
+ "th",
7527
+ {
7528
+ className: "border border-border bg-muted px-3 py-2 text-left font-semibold",
7529
+ ...props,
7530
+ children
7531
+ }
7532
+ ),
7533
+ td: ({
7534
+ children,
7535
+ ...props
7536
+ }) => /* @__PURE__ */ jsxRuntime.jsx("td", { className: "border border-border px-3 py-2", ...props, children }),
7537
+ img: ({
7538
+ src,
7539
+ alt,
7540
+ ...props
7541
+ }) => /* @__PURE__ */ jsxRuntime.jsx(
7542
+ MarkdownImage,
7543
+ {
7544
+ src,
7545
+ alt,
7546
+ resolveImageUrl,
7547
+ ...props
7548
+ }
7549
+ )
7550
+ }),
7551
+ [resolveImageUrl]
7552
+ );
7553
+ return /* @__PURE__ */ jsxRuntime.jsx(
7554
+ "div",
7555
+ {
7556
+ className: cn(
7557
+ "h-full w-full overflow-auto bg-background p-6 text-sm leading-relaxed text-foreground",
7558
+ // Heading styles
7559
+ "[&_h1]:mb-4 [&_h1]:mt-6 [&_h1]:border-b [&_h1]:border-border [&_h1]:pb-2 [&_h1]:text-2xl [&_h1]:font-bold",
7560
+ "[&_h2]:mb-4 [&_h2]:mt-6 [&_h2]:border-b [&_h2]:border-border [&_h2]:pb-2 [&_h2]:text-xl [&_h2]:font-semibold",
7561
+ "[&_h3]:mb-3 [&_h3]:mt-5 [&_h3]:text-lg [&_h3]:font-semibold",
7562
+ "[&_h4]:mb-3 [&_h4]:mt-4 [&_h4]:text-base [&_h4]:font-semibold",
7563
+ // Paragraph and list styles
7564
+ "[&_p]:mb-4 [&_p]:leading-relaxed",
7565
+ "[&_ul]:mb-4 [&_ul]:list-disc [&_ul]:pl-6",
7566
+ "[&_ol]:mb-4 [&_ol]:list-decimal [&_ol]:pl-6",
7567
+ "[&_li]:mb-1",
7568
+ // Horizontal rule
7569
+ "[&_hr]:my-6 [&_hr]:border-border",
7570
+ "scrollbar-thin",
7571
+ className
7572
+ ),
7573
+ children: /* @__PURE__ */ jsxRuntime.jsx(
7574
+ ReactMarkdownImport__default.default,
7575
+ {
7576
+ remarkPlugins: [remarkGfmImport__default.default],
7577
+ components: markdownComponents,
7578
+ children: content ?? ""
7579
+ }
7580
+ )
7581
+ }
7582
+ );
7583
+ }
7584
+ MarkdownRenderer.displayName = "MarkdownRenderer";
7585
+ function ImageRenderer({
7586
+ url,
7587
+ fileName,
7588
+ className
7589
+ }) {
7590
+ const [hasError, setHasError] = React20__namespace.useState(false);
7591
+ React20__namespace.useEffect(() => {
7592
+ setHasError(false);
7593
+ }, [url]);
7594
+ if (!url) {
7595
+ return /* @__PURE__ */ jsxRuntime.jsx(
7596
+ "div",
7597
+ {
7598
+ className: cn(
7599
+ "flex h-full w-full items-center justify-center text-sm text-muted-foreground",
7600
+ className
7601
+ ),
7602
+ children: "No image URL provided"
7603
+ }
7604
+ );
7605
+ }
7606
+ if (hasError) {
7607
+ return /* @__PURE__ */ jsxRuntime.jsxs(
7608
+ "div",
7609
+ {
7610
+ className: cn(
7611
+ "flex h-full w-full flex-col items-center justify-center gap-2 text-sm text-muted-foreground",
7612
+ className
7613
+ ),
7614
+ children: [
7615
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Failed to load image" }),
7616
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs", children: fileName })
7617
+ ]
7618
+ }
7619
+ );
7620
+ }
7621
+ return /* @__PURE__ */ jsxRuntime.jsx(
7622
+ "div",
7623
+ {
7624
+ className: cn(
7625
+ "flex h-full w-full items-center justify-center overflow-auto bg-background p-4",
7626
+ "scrollbar-thin",
7627
+ className
7628
+ ),
7629
+ children: /* @__PURE__ */ jsxRuntime.jsx(
7630
+ "img",
7631
+ {
7632
+ src: url,
7633
+ alt: fileName,
7634
+ onError: () => setHasError(true),
7635
+ className: "max-h-full max-w-full object-contain"
7636
+ }
7637
+ )
7638
+ }
7639
+ );
7640
+ }
7641
+ ImageRenderer.displayName = "ImageRenderer";
7642
+ function PlainTextRenderer({ content, className }) {
7643
+ return /* @__PURE__ */ jsxRuntime.jsx(
7644
+ "div",
7645
+ {
7646
+ className: cn(
7647
+ "h-full w-full overflow-auto rounded-md border border-border bg-background p-4",
7648
+ "scrollbar-thin",
7649
+ className
7650
+ ),
7651
+ children: /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "m-0 whitespace-pre-wrap break-words font-mono text-sm leading-relaxed text-foreground", children: content ?? "" })
7652
+ }
7653
+ );
7654
+ }
7655
+ PlainTextRenderer.displayName = "PlainTextRenderer";
7656
+ function parseCSV(text) {
7657
+ const lines = text.split("\n");
7658
+ if (lines.length === 0) return { headers: [], rows: [] };
7659
+ const firstLine = lines[0] ?? "";
7660
+ const delimiter = firstLine.includes(" ") ? " " : ",";
7661
+ function parseLine(line) {
7662
+ const fields = [];
7663
+ let current = "";
7664
+ let inQuotes = false;
7665
+ let i = 0;
7666
+ while (i < line.length) {
7667
+ const char = line[i];
7668
+ if (inQuotes) {
7669
+ if (char === '"') {
7670
+ if (i + 1 < line.length && line[i + 1] === '"') {
7671
+ current += '"';
7672
+ i += 2;
7673
+ } else {
7674
+ inQuotes = false;
7675
+ i++;
7676
+ }
7677
+ } else {
7678
+ current += char;
7679
+ i++;
7680
+ }
7681
+ } else {
7682
+ if (char === '"') {
7683
+ inQuotes = true;
7684
+ i++;
7685
+ } else if (char === delimiter) {
7686
+ fields.push(current.trim());
7687
+ current = "";
7688
+ i++;
7689
+ } else {
7690
+ current += char;
7691
+ i++;
7692
+ }
7693
+ }
7694
+ }
7695
+ fields.push(current.trim());
7696
+ return fields;
7697
+ }
7698
+ const headers = parseLine(firstLine);
7699
+ const rows = [];
7700
+ for (let i = 1; i < lines.length; i++) {
7701
+ const line = lines[i];
7702
+ if (line.trim() === "") continue;
7703
+ const values = parseLine(line);
7704
+ const row = {};
7705
+ for (let j = 0; j < headers.length; j++) {
7706
+ row[headers[j]] = values[j] ?? "";
7707
+ }
7708
+ rows.push(row);
7709
+ }
7710
+ return { headers, rows };
7711
+ }
7712
+ function CsvRenderer({ content, className }) {
7713
+ const { headers, rows } = React20__namespace.useMemo(
7714
+ () => parseCSV(content ?? ""),
7715
+ [content]
7716
+ );
7717
+ const columns = React20__namespace.useMemo(
7718
+ () => headers.map((header) => ({
7719
+ key: header,
7720
+ header,
7721
+ sortable: true,
7722
+ filterable: true,
7723
+ filterType: "text"
7724
+ })),
7725
+ [headers]
7726
+ );
7727
+ if (headers.length === 0) {
7728
+ return /* @__PURE__ */ jsxRuntime.jsx(
7729
+ "div",
7730
+ {
7731
+ className: cn(
7732
+ "flex h-full w-full items-center justify-center text-sm text-muted-foreground",
7733
+ className
7734
+ ),
7735
+ children: "No CSV data to display"
7736
+ }
7737
+ );
7738
+ }
7739
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("h-full w-full overflow-auto", className), children: /* @__PURE__ */ jsxRuntime.jsx(
7740
+ DataGrid,
7741
+ {
7742
+ data: rows,
7743
+ columns,
7744
+ getRowKey: (_, index) => String(index),
7745
+ resizableColumns: true
7746
+ }
7747
+ ) });
7748
+ }
7749
+ CsvRenderer.displayName = "CsvRenderer";
7750
+ function HtmlRenderer({
7751
+ content,
7752
+ fileName,
7753
+ className
7754
+ }) {
7755
+ return /* @__PURE__ */ jsxRuntime.jsx(
7756
+ "iframe",
7757
+ {
7758
+ srcDoc: content ?? "",
7759
+ sandbox: "allow-scripts",
7760
+ title: fileName,
7761
+ className: cn("h-full w-full border-0", className)
7762
+ }
7763
+ );
7764
+ }
7765
+ HtmlRenderer.displayName = "HtmlRenderer";
7766
+
7767
+ // src/components/file-view/utils/rendererRegistry.ts
7768
+ var DEFAULT_RENDERERS = {
7769
+ code: CodeRenderer,
7770
+ markdown: MarkdownRenderer,
7771
+ image: ImageRenderer,
7772
+ plaintext: PlainTextRenderer,
7773
+ csv: CsvRenderer,
7774
+ html: HtmlRenderer
7775
+ };
7776
+ function mergeRenderers(userRenderers) {
7777
+ if (!userRenderers) return DEFAULT_RENDERERS;
7778
+ return { ...DEFAULT_RENDERERS, ...userRenderers };
7779
+ }
7780
+ function resolveRenderer(registry, contentType) {
7781
+ return registry[contentType] ?? registry["plaintext"] ?? PlainTextRenderer;
7782
+ }
7783
+ function DefaultEmptyState({ message }) {
7784
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-full w-full items-center justify-center text-sm text-muted-foreground", children: message });
7785
+ }
7786
+ function DefaultLoadingState() {
7787
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-full w-full items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-3", children: [
7788
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-8 w-8 animate-spin rounded-full border-2 border-primary/20 border-t-primary" }),
7789
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: "Loading file..." })
7790
+ ] }) });
7791
+ }
7792
+ function DefaultErrorState({ error }) {
7793
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-full w-full items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex max-w-sm flex-col items-center gap-3 text-center", children: [
7794
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium text-destructive", children: error.message }),
7795
+ error.onRetry && /* @__PURE__ */ jsxRuntime.jsx(
7796
+ "button",
7797
+ {
7798
+ onClick: error.onRetry,
7799
+ className: cn(
7800
+ "rounded-md border border-border bg-background px-3 py-1.5 text-sm text-foreground",
7801
+ "transition-colors hover:bg-muted"
7802
+ ),
7803
+ children: "Retry"
7804
+ }
7805
+ )
7806
+ ] }) });
7807
+ }
7808
+ function FileView({
7809
+ content,
7810
+ url = null,
7811
+ fileName,
7812
+ contentType: contentTypeOverride,
7813
+ renderers: userRenderers,
7814
+ loading = false,
7815
+ error = null,
7816
+ loadingComponent,
7817
+ emptyComponent,
7818
+ emptyMessage = "No content to display",
7819
+ errorComponent: ErrorComponent,
7820
+ className,
7821
+ rendererClassName,
7822
+ resolveImageUrl
7823
+ }) {
7824
+ const { type: resolvedType } = useContentType({
7825
+ fileName,
7826
+ contentTypeOverride
7827
+ });
7828
+ const registry = React20__namespace.useMemo(
7829
+ () => mergeRenderers(userRenderers),
7830
+ [userRenderers]
7831
+ );
7832
+ const Renderer = React20__namespace.useMemo(
7833
+ () => resolveRenderer(registry, resolvedType),
7834
+ [registry, resolvedType]
7835
+ );
7836
+ if (loading) {
7837
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("relative h-full w-full", className), children: loadingComponent ?? /* @__PURE__ */ jsxRuntime.jsx(DefaultLoadingState, {}) });
7838
+ }
7839
+ if (error) {
7840
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("relative h-full w-full", className), children: ErrorComponent ? /* @__PURE__ */ jsxRuntime.jsx(ErrorComponent, { error }) : /* @__PURE__ */ jsxRuntime.jsx(DefaultErrorState, { error }) });
7841
+ }
7842
+ if ((content == null || content === "") && url == null) {
7843
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("relative h-full w-full", className), children: emptyComponent ?? /* @__PURE__ */ jsxRuntime.jsx(DefaultEmptyState, { message: emptyMessage }) });
7844
+ }
7845
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("relative h-full w-full", className), children: /* @__PURE__ */ jsxRuntime.jsx(
7846
+ Renderer,
7847
+ {
7848
+ content,
7849
+ url: url ?? null,
7850
+ fileName,
7851
+ contentType: resolvedType,
7852
+ className: rendererClassName,
7853
+ resolveImageUrl
7854
+ }
7855
+ ) });
7856
+ }
7857
+ FileView.displayName = "FileView";
7858
+ var OptilogicLogo = React20.forwardRef(
7859
+ ({ color, size, width, height, ...props }, ref) => {
7860
+ const uid = React20.useId();
7861
+ const w = size ?? width ?? 32;
7862
+ const h = size ?? height ?? 32;
7863
+ const useGradient = !color;
7864
+ const fill = (idx) => useGradient ? `url(#${uid}-g${idx})` : color;
7865
+ return /* @__PURE__ */ jsxRuntime.jsxs(
7866
+ "svg",
7867
+ {
7868
+ ref,
7869
+ width: w,
7870
+ height: h,
7871
+ viewBox: "0 0 44 44",
7872
+ fill: "none",
7873
+ xmlns: "http://www.w3.org/2000/svg",
7874
+ ...props,
7875
+ children: [
7876
+ /* @__PURE__ */ jsxRuntime.jsx(
7877
+ "path",
7878
+ {
7879
+ d: "m 19.710153,24.886531 -0.018,-0.0332 -13.0194005,8.2119 17.2811005,-0.0485 -4.2451,-8.1302 z",
7880
+ fill: fill(0)
7881
+ }
7882
+ ),
7883
+ /* @__PURE__ */ jsxRuntime.jsx(
7884
+ "path",
7885
+ {
7886
+ d: "m 31.367953,26.996531 7.3048,-4.2341 -7.334,-12.652796 -7.3048,4.2341 z",
7887
+ fill: fill(1)
7888
+ }
7889
+ ),
7890
+ /* @__PURE__ */ jsxRuntime.jsx(
7891
+ "path",
7892
+ {
7893
+ d: "m 19.257253,24.563831 -3.8352,-6.752096 -8.7493005,15.254896 13.0942005,-7.6094 c -0.1597,-0.3029 -0.3297,-0.6007 -0.5097,-0.8934 z",
7894
+ fill: fill(2)
7895
+ }
7896
+ ),
7897
+ /* @__PURE__ */ jsxRuntime.jsx(
7898
+ "path",
7899
+ {
7900
+ d: "m 24.393053,23.112531 c -1.0221,-1.9514 -2.5557,-3.587996 -4.4365,-4.734696 -1.8808,-1.1467 -4.0381,-1.7602 -6.2408,-1.775 l 4.8033,8.455596 c 0.1745,0.2844 0.3398,0.5753 0.4959,0.8726 l 5.0969,8.9751 c 1.0457,-1.7798 1.6202,-3.7968 1.6694,-5.8604 0.0492,-2.0636 -0.4286,-4.1057 -1.3882,-5.9332 z",
7901
+ fill: fill(3)
7902
+ }
7903
+ ),
7904
+ useGradient && /* @__PURE__ */ jsxRuntime.jsxs("defs", { children: [
7905
+ /* @__PURE__ */ jsxRuntime.jsxs("linearGradient", { id: `${uid}-g0`, x1: "-10.349", y1: "21.971", x2: "7.45", y2: "21.971", gradientUnits: "userSpaceOnUse", children: [
7906
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { stopColor: "#58F1A2" }),
7907
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0.016", stopColor: "#56EF9F" }),
7908
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0.308", stopColor: "#36D87A" }),
7909
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0.578", stopColor: "#20C75F" }),
7910
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0.817", stopColor: "#12BD4E" }),
7911
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "1", stopColor: "#0EBA49" })
7912
+ ] }),
7913
+ /* @__PURE__ */ jsxRuntime.jsxs("linearGradient", { id: `${uid}-g1`, x1: "-590.283", y1: "3567.46", x2: "-597.588", y2: "3571.69", gradientUnits: "userSpaceOnUse", children: [
7914
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { stopColor: "#0EBA49" }),
7915
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0.031", stopColor: "#11BC4D" }),
7916
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0.315", stopColor: "#30D371" }),
7917
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0.58", stopColor: "#46E38C" }),
7918
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0.816", stopColor: "#53ED9C" }),
7919
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "1", stopColor: "#58F1A2" })
7920
+ ] }),
7921
+ /* @__PURE__ */ jsxRuntime.jsxs("linearGradient", { id: `${uid}-g2`, x1: "-10.35", y1: "18.453", x2: "7.38", y2: "18.453", gradientUnits: "userSpaceOnUse", children: [
7922
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { stopColor: "#58F1A2" }),
7923
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0.184", stopColor: "#53ED9C" }),
7924
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0.42", stopColor: "#46E38C" }),
7925
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0.685", stopColor: "#30D371" }),
7926
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0.969", stopColor: "#11BC4D" }),
7927
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "1", stopColor: "#0EBA49" })
7928
+ ] }),
7929
+ /* @__PURE__ */ jsxRuntime.jsxs("linearGradient", { id: `${uid}-g3`, x1: "8.369", y1: "24.711", x2: "26.243", y2: "24.711", gradientUnits: "userSpaceOnUse", children: [
7930
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { stopColor: "#58F1A2" }),
7931
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0.184", stopColor: "#53ED9C" }),
7932
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0.42", stopColor: "#46E38C" }),
7933
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0.685", stopColor: "#30D371" }),
7934
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0.969", stopColor: "#11BC4D" }),
7935
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "1", stopColor: "#0EBA49" })
7936
+ ] })
7937
+ ] })
7938
+ ]
7939
+ }
7940
+ );
7941
+ }
7942
+ );
7943
+ OptilogicLogo.displayName = "OptilogicLogo";
7944
+ var OptilogicLogoWithText = React20.forwardRef(({ color, textColor = "currentColor", size, width, height, ...props }, ref) => {
7945
+ const uid = React20.useId();
7946
+ const h = size ?? height ?? 35;
7947
+ const w = width ?? (typeof h === "number" ? Math.round(h * (102 / 35)) : 102);
7948
+ const useGradient = !color;
7949
+ const iconFill = (idx) => useGradient ? `url(#${uid}-g${idx})` : color;
7950
+ return /* @__PURE__ */ jsxRuntime.jsxs(
7951
+ "svg",
7952
+ {
7953
+ ref,
7954
+ width: w,
7955
+ height: h,
7956
+ viewBox: "0 0 102 35",
7957
+ fill: "none",
7958
+ xmlns: "http://www.w3.org/2000/svg",
7959
+ ...props,
7960
+ children: [
7961
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M87.8887 8.94166L87.9811 9.12063L87.7877 8.76953C87.8258 8.81696 87.8588 8.87662 87.8887 8.94166Z", fill: iconFill(0) }),
7962
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M87.9808 9.11386L87.7872 8.76282L87.6158 8.45508C87.6774 8.55543 87.7358 8.65573 87.7938 8.75874C87.8253 8.81704 87.8583 8.87665 87.8883 8.93494L87.9808 9.11386Z", fill: iconFill(1) }),
7963
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M93.0335 2.12149L91.0895 3.27987C90.4698 3.64931 90.2588 4.46544 90.6177 5.10275L93.5225 10.2545C93.8819 10.8918 94.6755 11.109 95.2957 10.7395L97.2391 9.58114C97.8588 9.21171 98.0703 8.39559 97.7109 7.75827L94.8061 2.60653C94.4467 1.96921 93.6532 1.75205 93.0335 2.12149Z", fill: iconFill(2) }),
7964
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M79.4231 14.3186L84.3908 5.41699L86.529 9.28695L86.9077 9.96469L87.0633 10.2467L87.2412 10.5665L87.2529 10.5883L90.0601 15.6768L80.2116 15.7039C80.0535 15.7051 79.8974 15.6634 79.7597 15.583C79.6224 15.5025 79.5075 15.3862 79.4277 15.2457C79.3479 15.1052 79.3052 14.9456 79.3047 14.7828C79.3037 14.62 79.3449 14.4599 79.4231 14.3186Z", fill: iconFill(3) }),
7965
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M91.9324 13.4257C91.9171 13.5856 91.8988 13.7456 91.877 13.9056C91.8612 14.0113 91.8439 14.117 91.8241 14.2228C91.8043 14.3285 91.7844 14.4355 91.7611 14.5399C91.7372 14.6443 91.7123 14.7486 91.6858 14.853C91.6594 14.9574 91.6304 15.0631 91.5999 15.1661C91.5592 15.3017 91.5145 15.4373 91.4682 15.5728C91.422 15.7084 91.3681 15.8439 91.3142 15.9794C91.2771 16.0703 91.239 16.1571 91.2003 16.2506V16.2587C91.1653 16.3358 91.1098 16.4014 91.0407 16.4484C90.9716 16.4954 90.8907 16.5218 90.8079 16.5249C90.725 16.5279 90.6432 16.5075 90.5705 16.4658C90.4983 16.4241 90.4383 16.3628 90.3976 16.2885L90.0616 15.6785L87.256 10.5995C87.256 10.5927 87.256 10.5845 87.2453 10.5778L87.1609 10.4151C87.1335 10.3609 87.1029 10.3067 87.074 10.2538C87.0211 10.1603 86.9672 10.0681 86.9118 9.98269L86.5336 9.30494L84.3914 5.41738L83.9704 4.65422C83.9293 4.5799 83.9089 4.49533 83.9115 4.40982C83.914 4.32431 83.9394 4.24116 83.9847 4.16955C84.0304 4.09794 84.0945 4.04062 84.1692 4.00392C84.2444 3.96723 84.3283 3.95257 84.4107 3.96156C85.7934 4.11436 87.1177 4.61474 88.2671 5.41853C89.417 6.22228 90.3564 7.30472 91.0026 8.57025C91.1642 8.88468 91.3061 9.20929 91.4276 9.54216C91.4881 9.70619 91.5435 9.87429 91.5948 10.041C91.6106 10.0939 91.6253 10.1467 91.6396 10.1982C91.6843 10.3568 91.7239 10.5154 91.7611 10.6754C91.9598 11.5769 92.0178 12.5054 91.9324 13.4257Z", fill: iconFill(4) }),
7966
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M87.1593 10.4138C87.1289 10.3609 87.101 10.3067 87.0711 10.2538C87.0183 10.1589 86.9656 10.0668 86.9103 9.97461C86.9656 10.0668 87.0198 10.1589 87.0721 10.2457C87.0944 10.3053 87.1248 10.3596 87.1593 10.4138Z", fill: iconFill(5) }),
7967
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M16.9243 20.9745C16.9243 25.6035 13.6033 29.5561 8.46292 29.5561C3.32258 29.5561 0.00289826 25.6035 0.00289826 20.9745C-0.0434 18.7389 0.775929 16.576 2.28065 14.9615C3.78537 13.3471 5.85223 12.4133 8.02654 12.3657C8.17158 12.3657 8.31661 12.3657 8.46292 12.3657C10.6366 12.294 12.7488 13.1131 14.3351 14.6426C15.9214 16.1721 16.8518 18.2869 16.9217 20.5217C16.9256 20.6749 16.9269 20.824 16.9243 20.9745ZM3.6179 20.9745C3.6179 24.1314 5.59546 26.3056 8.46292 26.3056C11.3304 26.3056 13.3093 24.1368 13.3093 20.9745C13.3093 17.8121 11.3317 15.6175 8.46424 15.6175C5.59678 15.6175 3.6179 17.8175 3.6179 20.9745Z", fill: textColor }),
7968
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M30.774 23.8266C30.774 27.0541 28.4998 29.5563 25.5004 29.5563C24.4662 29.56 23.4594 29.2147 22.6343 28.5736V34.1162H19.2065V18.4723H21.8683L22.2968 19.4077C23.1653 18.5707 24.3141 18.1099 25.5044 18.1213C28.4998 18.1213 30.774 20.5991 30.774 23.8266ZM22.6317 23.8266C22.6317 25.3001 23.4965 26.6095 24.9744 26.6095C26.4523 26.6095 27.3172 25.3001 27.3172 23.8266C27.3172 22.3532 26.4536 21.0654 24.9744 21.0654C23.4952 21.0654 22.6317 22.3532 22.6317 23.8266Z", fill: textColor }),
7969
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M41.148 18.4718V21.4186H37.5739V24.9958C37.5739 26.0246 38.4374 26.5154 39.4196 26.1412L40.2107 25.8376L41.235 28.6435L40.2107 29.0854C37.3458 30.3473 34.1382 29.0393 34.1382 25.0406V21.4186H31.4553V18.4718H34.1395V15.083H37.5673V18.4718H41.148Z", fill: textColor }),
7970
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M46.9673 14.8024C46.9673 15.1778 46.8591 15.5447 46.6563 15.8567C46.4535 16.1688 46.1652 16.4121 45.8279 16.5557C45.4907 16.6993 45.1195 16.7369 44.7615 16.6637C44.4035 16.5905 44.0746 16.4097 43.8165 16.1443C43.5584 15.8789 43.3826 15.5408 43.3113 15.1727C43.2401 14.8045 43.2767 14.423 43.4164 14.0762C43.5561 13.7295 43.7927 13.4331 44.0962 13.2246C44.3997 13.016 44.7566 12.9047 45.1216 12.9047C45.3591 12.8995 45.5953 12.9425 45.8166 13.0312C46.0379 13.1199 46.2401 13.2525 46.4115 13.4216C46.5829 13.5907 46.7202 13.7928 46.8156 14.0165C46.911 14.2402 46.9625 14.481 46.9673 14.7252V14.8024ZM43.4196 29.2074V18.4718H46.8473V29.2047L43.4196 29.2074Z", fill: textColor }),
7971
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M49.5854 29.2044V12.7188H53.0133V29.2044H49.5854Z", fill: textColor }),
7972
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M66.7762 23.8518C66.7762 26.9844 64.5018 29.5571 60.9753 29.5571C57.4483 29.5571 55.1744 26.9817 55.1744 23.8518C55.1744 20.7219 57.4483 18.1221 60.9753 18.1221C64.5018 18.1221 66.7762 20.7165 66.7762 23.8518ZM58.6338 23.8518C58.6338 25.3713 59.5209 26.6116 60.9763 26.6116C62.4317 26.6116 63.3193 25.3727 63.3193 23.8518C63.3193 22.3309 62.4317 21.0689 60.9763 21.0689C59.5209 21.0689 58.6338 22.3295 58.6338 23.8518Z", fill: textColor }),
7973
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M76.5321 19.4068L76.9617 18.4715H79.6224V28.9468C79.6224 31.6836 77.9626 34.8867 73.6619 34.8867C70.5228 34.8867 68.4085 33.0391 68.0222 30.0068L71.2294 29.4457C71.3204 30.9652 72.1841 31.9479 73.7768 31.9479C75.5738 31.9479 76.164 30.5667 76.164 29.3521V28.0427C75.3273 28.6367 74.3334 28.9526 73.3167 28.9482C71.9203 28.9482 70.5807 28.3778 69.5935 27.3625C68.6057 26.3472 68.0511 24.9702 68.0511 23.5343C68.0511 22.0984 68.6057 20.7214 69.5935 19.7061C70.5807 18.6908 71.9203 18.1204 73.3167 18.1204C74.5098 18.107 75.6618 18.5678 76.5321 19.4068ZM71.5064 23.5221C71.5156 23.9966 71.661 24.4578 71.9238 24.8477C72.1871 25.2376 72.5562 25.539 72.9853 25.7139C73.4143 25.8888 73.8846 25.9294 74.336 25.8307C74.7874 25.7321 75.2002 25.4985 75.523 25.1593C75.8463 24.82 76.0644 24.3903 76.1503 23.9241C76.2367 23.4578 76.1869 22.9758 76.0075 22.5385C75.828 22.1012 75.5271 21.7282 75.1422 21.4662C74.7569 21.2042 74.3055 21.0649 73.8439 21.0659C73.5399 21.0618 73.2384 21.1193 72.9563 21.235C72.6742 21.3509 72.4169 21.5227 72.1993 21.7407C71.9818 21.9587 71.8084 22.2187 71.6884 22.5057C71.5685 22.7928 71.5049 23.1013 71.5014 23.4137C71.5039 23.4448 71.5049 23.4855 71.5064 23.5221Z", fill: textColor }),
7974
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M82.4911 29.2048V18.4746H85.9281V29.2075L82.4911 29.2048Z", fill: textColor }),
7975
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M98.8928 22.0489L95.7288 22.774C95.6388 22.2871 95.3841 21.8486 95.0099 21.5362C94.6358 21.2239 94.1661 21.0578 93.6841 21.0675C92.5698 21.0675 91.4321 21.9553 91.4321 23.8503C91.4321 25.7453 92.5698 26.6101 93.6841 26.6101C94.1661 26.6201 94.6358 26.4541 95.0104 26.1417C95.3846 25.8293 95.6393 25.3906 95.7288 24.9036L98.8928 25.6287C98.5969 26.7867 97.9269 27.8067 96.9925 28.5211C96.0582 29.2355 94.9149 29.6018 93.7512 29.5597C90.272 29.5597 87.9742 26.9409 87.9742 23.8544C87.9697 23.1054 88.1089 22.3628 88.3835 21.6691C88.658 20.9754 89.0626 20.344 89.5751 19.8112C90.087 19.2784 90.696 18.8545 91.3675 18.5637C92.0386 18.2729 92.7589 18.121 93.4874 18.1165C93.5748 18.1165 93.6628 18.1165 93.7512 18.1165C94.9154 18.0745 96.0582 18.441 96.9931 19.1557C97.9274 19.8703 98.5974 20.8907 98.8928 22.0489Z", fill: textColor }),
7976
+ useGradient && /* @__PURE__ */ jsxRuntime.jsxs("defs", { children: [
7977
+ /* @__PURE__ */ jsxRuntime.jsxs("linearGradient", { id: `${uid}-g0`, x1: "87.5964", y1: "8.93628", x2: "87.7953", y2: "8.93628", gradientUnits: "userSpaceOnUse", children: [
7978
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { stopColor: "#58F1A2" }),
7979
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0.02", stopColor: "#56EF9F" }),
7980
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0.31", stopColor: "#36D87A" }),
7981
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0.58", stopColor: "#20C75F" }),
7982
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0.82", stopColor: "#12BD4E" }),
7983
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "1", stopColor: "#0EBA49" })
7984
+ ] }),
7985
+ /* @__PURE__ */ jsxRuntime.jsxs("linearGradient", { id: `${uid}-g1`, x1: "87.1426", y1: "8.7845", x2: "87.6357", y2: "8.7845", gradientUnits: "userSpaceOnUse", children: [
7986
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { stopColor: "#58F1A2" }),
7987
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0.18", stopColor: "#53ED9C" }),
7988
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0.42", stopColor: "#46E38C" }),
7989
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0.69", stopColor: "#30D371" }),
7990
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0.97", stopColor: "#11BC4D" }),
7991
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "1", stopColor: "#0EBA49" })
7992
+ ] }),
7993
+ /* @__PURE__ */ jsxRuntime.jsxs("linearGradient", { id: `${uid}-g2`, x1: "-1054.89", y1: "692.801", x2: "-1059.13", y2: "695.193", gradientUnits: "userSpaceOnUse", children: [
7994
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { stopColor: "#0EBA49" }),
7995
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0.03", stopColor: "#11BC4D" }),
7996
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0.32", stopColor: "#30D371" }),
7997
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0.58", stopColor: "#46E38C" }),
7998
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0.82", stopColor: "#53ED9C" }),
7999
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "1", stopColor: "#58F1A2" })
8000
+ ] }),
8001
+ /* @__PURE__ */ jsxRuntime.jsxs("linearGradient", { id: `${uid}-g3`, x1: "79.3032", y1: "10.5625", x2: "90.0545", y2: "10.5625", gradientUnits: "userSpaceOnUse", children: [
8002
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { stopColor: "#58F1A2" }),
8003
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0.02", stopColor: "#56EF9F" }),
8004
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0.31", stopColor: "#36D87A" }),
8005
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0.58", stopColor: "#20C75F" }),
8006
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0.82", stopColor: "#12BD4E" }),
8007
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "1", stopColor: "#0EBA49" })
8008
+ ] }),
8009
+ /* @__PURE__ */ jsxRuntime.jsxs("linearGradient", { id: `${uid}-g4`, x1: "83.9074", y1: "10.2429", x2: "91.969", y2: "10.2429", gradientUnits: "userSpaceOnUse", children: [
8010
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { stopColor: "#58F1A2" }),
8011
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0.02", stopColor: "#56EF9F" }),
8012
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0.31", stopColor: "#36D87A" }),
8013
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0.58", stopColor: "#20C75F" }),
8014
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0.82", stopColor: "#12BD4E" }),
8015
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "1", stopColor: "#0EBA49" })
8016
+ ] }),
8017
+ /* @__PURE__ */ jsxRuntime.jsxs("linearGradient", { id: `${uid}-g5`, x1: "86.7936", y1: "10.1942", x2: "87.1619", y2: "10.1942", gradientUnits: "userSpaceOnUse", children: [
8018
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { stopColor: "#58F1A2" }),
8019
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0.18", stopColor: "#53ED9C" }),
8020
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0.42", stopColor: "#46E38C" }),
8021
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0.69", stopColor: "#30D371" }),
8022
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0.97", stopColor: "#11BC4D" }),
8023
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "1", stopColor: "#0EBA49" })
8024
+ ] })
8025
+ ] })
8026
+ ]
8027
+ }
8028
+ );
8029
+ });
8030
+ OptilogicLogoWithText.displayName = "OptilogicLogoWithText";
8031
+ var CosmicFrogIcon = React20.forwardRef(
8032
+ ({ color = "currentColor", size, width, height, ...props }, ref) => {
8033
+ const w = size ?? width ?? 24;
8034
+ const h = size ?? height ?? 24;
8035
+ return /* @__PURE__ */ jsxRuntime.jsxs(
8036
+ "svg",
8037
+ {
8038
+ ref,
8039
+ width: w,
8040
+ height: h,
8041
+ viewBox: "0 0 300 286.9",
8042
+ fill: "none",
8043
+ xmlns: "http://www.w3.org/2000/svg",
8044
+ ...props,
8045
+ children: [
8046
+ /* @__PURE__ */ jsxRuntime.jsx(
8047
+ "path",
8048
+ {
8049
+ d: "M189.4,277.9l0-0.7c0-2.3,1.3-4.4,3.5-5.2c5.9-2.2,9.2-9.9,4.9-16.1c-6.2-9-20.2-28.4-25.3-35.3 c0,0,6-9.4,13.2-19.5c5.8,6.9,36.2,46.7,45.7,58.4c6.8,8.3,20.3,11.9,29.5,12.9c2.9,0.3,5.1,2.8,5,5.7v0c0,3.2-2.6,5.7-5.7,5.7 h-65.2C192,283.6,189.4,281.1,189.4,277.9z",
8050
+ fill: color
8051
+ }
8052
+ ),
8053
+ /* @__PURE__ */ jsxRuntime.jsx(
8054
+ "path",
8055
+ {
8056
+ d: "M214.5,154.3c9.1-9.5,29.6-47.6,19.9-65c-7.6-13.7-26-11.9-48.7-3.1c-1.5,0.6-2.5,2.1-2.3,3.6 c0.9,10.5-6,20.9-17.3,25.8c-13.8,6-29.2,1.2-34.5-11.2c-4.2-9.8-2.9-20.5,2.5-28.3c0.7-1-0.5-2.2-1.5-1.6 c-9.3,6.1-15.5,16.7-15.5,28.7c0,6.1,1.6,11.8,4.4,16.7c-31.6,21.4-48.6,48-55.3,59.6c-7.4,12.8-7.5,29.9-7.5,34.2 c0,0-5.2-8.1-10.5-17.6c-1.9-3.4-5.4-7.9-12-3c-8.8,6.6-27.6,29.3-31.7,57c-2.9,19.8,6.7,33.4,18.8,33.4h33.9c3,0,5.4-2.4,5.5-5.4 l0-1c0-2.5-1.6-4.6-3.9-5.3c-12.7-3.9-17.8-26.3-15.2-38c7.2,9.7,10.7,14.8,24.7,27.7c9.6,8.8,20.2,4.2,23.6-2.5 c5.7-11.3,8.7-24.3,12-35.3c1.4,5.1,6.8,22.2,6.8,30.3c0,7.1-2.9,16-10.2,18.3c-2.3,0.7-3.9,2.8-3.9,5.2l0,0.5 c0,3.1,2.5,5.5,5.5,5.5h59.7c2.6,0,5.1-1.7,5.7-4.3c0.8-3.3-1.4-6.3-4.6-6.8c-9.4-1.6-24.3-7.3-27.4-17c-4.5-14-14.5-55-15.2-60.4 l14.4,15.3c9.9-17.1,40.6-67.7,64.3-92.6c23.7-25,29.2-9.6,25.6,4.2C221.7,133.6,217.9,146.9,214.5,154.3z",
8057
+ fill: color
8058
+ }
8059
+ ),
8060
+ /* @__PURE__ */ jsxRuntime.jsx(
8061
+ "path",
8062
+ {
8063
+ d: "M269,19.7l3.5,12.1c1.3,4.4,4.7,7.8,9.1,9.1l12.1,3.5c2.9,0.9,2.9,5,0,5.8l-12.1,3.5c-4.4,1.3-7.8,4.7-9.1,9.1 L269,75c-0.9,2.9-5,2.9-5.8,0l-3.5-12.1c-1.3-4.4-4.7-7.8-9.1-9.1l-12.1-3.5c-2.9-0.9-2.9-5,0-5.8l12.1-3.5 c4.4-1.3,7.8-4.7,9.1-9.1l3.5-12.1C264,16.7,268.2,16.7,269,19.7z",
8064
+ fill: color
8065
+ }
8066
+ ),
8067
+ /* @__PURE__ */ jsxRuntime.jsx(
8068
+ "path",
8069
+ {
8070
+ d: "M185.3,4.6l2.2,7.5c0.8,2.7,2.9,4.8,5.6,5.6l7.5,2.2c1.8,0.5,1.8,3.1,0,3.6l-7.5,2.2c-2.7,0.8-4.8,2.9-5.6,5.6 l-2.2,7.5c-0.5,1.8-3.1,1.8-3.6,0l-2.2-7.5c-0.8-2.7-2.9-4.8-5.6-5.6l-7.5-2.2c-1.8-0.5-1.8-3.1,0-3.6l7.5-2.2 c2.7-0.8,4.8-2.9,5.6-5.6l2.2-7.5C182.2,2.8,184.8,2.8,185.3,4.6z",
8071
+ fill: color
8072
+ }
8073
+ ),
8074
+ /* @__PURE__ */ jsxRuntime.jsx(
8075
+ "path",
8076
+ {
8077
+ d: "M274.3,131.6l2.2,7.7c0.8,2.8,3,5,5.8,5.8l7.7,2.2c1.9,0.5,1.9,3.2,0,3.7l-7.7,2.2c-2.8,0.8-5,3-5.8,5.8 l-2.2,7.7c-0.5,1.9-3.2,1.9-3.7,0l-2.2-7.7c-0.8-2.8-3-5-5.8-5.8l-7.7-2.2c-1.9-0.5-1.9-3.2,0-3.7l7.7-2.2c2.8-0.8,5-3,5.8-5.8 l2.2-7.7C271.1,129.8,273.7,129.8,274.3,131.6z",
8078
+ fill: color
8079
+ }
8080
+ ),
8081
+ /* @__PURE__ */ jsxRuntime.jsx(
8082
+ "ellipse",
8083
+ {
8084
+ transform: "matrix(0.7071 -0.7071 0.7071 0.7071 -11.8631 139.9984)",
8085
+ cx: "163.1",
8086
+ cy: "84.3",
8087
+ rx: "10.2",
8088
+ ry: "16.5",
8089
+ fill: color
8090
+ }
8091
+ )
8092
+ ]
8093
+ }
8094
+ );
8095
+ }
8096
+ );
8097
+ CosmicFrogIcon.displayName = "CosmicFrogIcon";
8098
+ var DataStarIcon = React20.forwardRef(
8099
+ ({ color = "currentColor", size, width, height, ...props }, ref) => {
8100
+ const w = size ?? width ?? 24;
8101
+ const h = size ?? height ?? 24;
8102
+ return /* @__PURE__ */ jsxRuntime.jsx(
8103
+ "svg",
8104
+ {
8105
+ ref,
8106
+ width: w,
8107
+ height: h,
8108
+ viewBox: "0 0 31 29",
8109
+ fill: "none",
8110
+ xmlns: "http://www.w3.org/2000/svg",
8111
+ ...props,
8112
+ children: /* @__PURE__ */ jsxRuntime.jsx(
8113
+ "path",
8114
+ {
8115
+ d: "M26.9476 14.2775C30.1992 9.06819 30.9839 4.11351 28.4804 1.69452C25.9768 -0.724468 20.8494 0.0323405 15.4592 3.17632C9.90111 -0.190461 4.5547 -1.06752 1.98551 1.40805C-0.583687 3.88363 0.295825 8.9727 3.68979 14.2775C0.0622617 19.7379 -0.912135 25.0321 1.7045 27.5607C4.32114 30.0893 9.79893 29.1486 15.4519 25.6439C20.9479 28.9258 26.2104 29.7534 28.7577 27.2919C31.305 24.8305 30.4328 19.6424 26.9476 14.2775ZM27.4074 3.96143C28.4767 5.84641 27.7724 9.03282 25.736 12.5446C24.5761 10.9981 23.2924 9.54244 21.8968 8.19113C23.5104 6.54516 25.3528 5.12513 27.3709 3.97204L27.4074 3.96143ZM24.6193 14.2987C23.4165 16.0228 22.0545 17.6374 20.5501 19.1226C19.5977 18.0439 18.9371 17.1775 18.6707 16.8132C17.7036 14.9494 17.7328 13.6303 18.7619 11.7418C19.1524 11.2361 19.7619 10.4757 20.5501 9.61989C22.0448 11.0668 23.4052 12.6384 24.6156 14.3164L24.6193 14.2987ZM25.7141 2.55036C24.5163 4.44516 23.0632 6.17683 21.3932 7.69955C20.0996 6.48666 18.7191 5.36399 17.262 4.33984C20.6414 2.49377 23.7434 1.79 25.7287 2.54682L25.7141 2.55036ZM19.9334 8.99392C18.7291 10.0018 17.7437 10.695 17.3788 10.9567C15.4592 11.8338 14.0943 11.7135 12.0178 10.603L11.9192 10.5606C11.5069 10.2529 10.9996 9.8533 10.4376 9.39355C11.9782 7.93165 13.6515 6.60719 15.4373 5.43617C17.0317 6.50371 18.5353 7.69343 19.9334 8.99392ZM11.609 16.3994C11.4667 16.5975 10.8098 17.4993 9.76611 18.6911C8.40065 17.3248 7.15322 15.8522 6.03638 14.2881C7.15586 12.7784 8.39558 11.3559 9.74418 10.0337C10.9376 11.3952 11.6346 12.389 11.6346 12.389C11.951 13.0138 12.1134 13.7012 12.109 14.3971C12.1045 15.0931 11.9334 15.7785 11.609 16.3994ZM13.6454 4.30094C11.9738 5.43758 10.4006 6.7043 8.9413 8.08857C7.11704 6.45833 5.54718 4.57962 4.28101 2.51146L4.24084 2.50085C6.2736 1.36562 9.79893 2.12244 13.6454 4.31155V4.30094ZM2.84313 4.13472C4.90738 5.37184 6.78411 6.88106 8.41947 8.61905C7.15181 9.86002 5.97733 11.1872 4.90507 12.5906C2.88327 9.21672 2.0804 6.14348 2.84313 4.14533V4.13472ZM4.87587 15.9963C5.95746 17.4555 7.14924 18.835 8.44136 20.1234C6.72159 21.949 4.73312 23.5184 2.54022 24.781C1.78844 22.7192 2.6935 19.4833 4.87587 16.0069V15.9963ZM4.00366 26.4892V26.4715C5.35389 24.2982 7.03309 22.3335 8.98512 20.6433C10.4334 22.0512 11.9995 23.3405 13.6673 24.4981C9.71502 26.811 6.06558 27.6421 4.00366 26.4998V26.4892ZM15.43 23.3664C13.6493 22.1829 11.9809 20.8479 10.4449 19.3772C11.2696 18.7088 11.9521 18.2137 12.3462 17.9378C14.171 17.0254 15.4519 16.9405 17.1671 17.6832C17.2438 17.7362 18.386 18.4966 19.886 19.7485C18.4975 21.0722 17.0026 22.2867 15.4154 23.3805L15.43 23.3664ZM17.2219 24.4627C18.6867 23.4156 20.0722 22.268 21.3676 21.0287C23.1328 22.6267 24.6552 24.4592 25.8893 26.4715C23.8383 27.1894 20.6633 26.4114 17.2219 24.4733V24.4627ZM27.6629 25.0569L27.6447 25.0286C25.5077 23.8079 23.5653 22.2926 21.8786 20.5301C23.3024 19.1424 24.6049 17.6425 25.7725 16.0458C28.0205 19.7238 28.8052 23.1188 27.6629 25.0675V25.0569Z",
8116
+ fill: color
8117
+ }
8118
+ )
8119
+ }
8120
+ );
8121
+ }
8122
+ );
8123
+ DataStarIcon.displayName = "DataStarIcon";
8124
+
6804
8125
  exports.ALL_THEMES = ALL_THEMES;
6805
8126
  exports.Accordion = Accordion;
6806
8127
  exports.AccordionContent = AccordionContent;
@@ -6838,11 +8159,16 @@ exports.CardTitle = CardTitle;
6838
8159
  exports.CellEditor = CellEditor;
6839
8160
  exports.Checkbox = Checkbox;
6840
8161
  exports.Chip = Chip;
8162
+ exports.CodeRenderer = CodeRenderer;
6841
8163
  exports.ConfirmationModal = ConfirmationModal;
6842
8164
  exports.ContextMenu = ContextMenu;
6843
8165
  exports.CopyButton = CopyButton;
8166
+ exports.CosmicFrogIcon = CosmicFrogIcon;
8167
+ exports.CsvRenderer = CsvRenderer;
6844
8168
  exports.DARK_ELEGANT_THEME = DARK_ELEGANT_THEME;
8169
+ exports.DEFAULT_RENDERERS = DEFAULT_RENDERERS;
6845
8170
  exports.DataGrid = DataGrid;
8171
+ exports.DataStarIcon = DataStarIcon;
6846
8172
  exports.DataTable = DataTable;
6847
8173
  exports.DatePicker = DatePicker;
6848
8174
  exports.DatePickerInput = DatePickerInput;
@@ -6863,20 +8189,27 @@ exports.DropdownMenuSubTrigger = DropdownMenuSubTrigger;
6863
8189
  exports.DropdownMenuTrigger = DropdownMenuTrigger;
6864
8190
  exports.FOREST_THEME = FOREST_THEME;
6865
8191
  exports.FUTURISTIC_THEME = FUTURISTIC_THEME;
8192
+ exports.FileView = FileView;
6866
8193
  exports.FilterPopover = FilterPopover;
6867
8194
  exports.GREEN_THEME = GREEN_THEME;
6868
8195
  exports.HeaderCell = HeaderCell;
8196
+ exports.HtmlRenderer = HtmlRenderer;
6869
8197
  exports.IconButton = IconButton;
8198
+ exports.ImageRenderer = ImageRenderer;
6870
8199
  exports.Input = Input;
6871
8200
  exports.Label = Label;
6872
8201
  exports.LoadingSpinner = LoadingSpinner;
6873
8202
  exports.MINIMALIST_LIGHT_THEME = MINIMALIST_LIGHT_THEME;
8203
+ exports.MarkdownRenderer = MarkdownRenderer;
6874
8204
  exports.Modal = Modal;
6875
8205
  exports.ModalButton = ModalButton;
6876
8206
  exports.NATURE_THEME = NATURE_THEME;
6877
8207
  exports.OCEAN_THEME = OCEAN_THEME;
6878
8208
  exports.OPTILOGIC_LEGACY_THEME = OPTILOGIC_LEGACY_THEME;
8209
+ exports.OptilogicLogo = OptilogicLogo;
8210
+ exports.OptilogicLogoWithText = OptilogicLogoWithText;
6879
8211
  exports.PRESET_THEMES = PRESET_THEMES;
8212
+ exports.PlainTextRenderer = PlainTextRenderer;
6880
8213
  exports.Popover = Popover;
6881
8214
  exports.PopoverAnchor = PopoverAnchor;
6882
8215
  exports.PopoverContent = PopoverContent;
@@ -6940,21 +8273,28 @@ exports.cardListVariants = cardListVariants;
6940
8273
  exports.cardVariants = cardVariants;
6941
8274
  exports.cloneTheme = cloneTheme;
6942
8275
  exports.cn = cn;
8276
+ exports.detectContentType = detectContentType;
6943
8277
  exports.exportTheme = exportTheme;
6944
8278
  exports.getCellValue = getCellValue;
6945
8279
  exports.getCurrentTheme = getCurrentTheme;
6946
8280
  exports.getDefaultTheme = getDefaultTheme;
8281
+ exports.getFileExtension = getFileExtension;
6947
8282
  exports.getPresetTheme = getPresetTheme;
6948
8283
  exports.hexToHsl = hexToHsl;
6949
8284
  exports.iconButtonVariants = iconButtonVariants;
6950
8285
  exports.importTheme = importTheme;
6951
8286
  exports.isPresetTheme = isPresetTheme;
8287
+ exports.isTextContentType = isTextContentType;
8288
+ exports.isUrlContentType = isUrlContentType;
6952
8289
  exports.labelVariants = labelVariants;
6953
8290
  exports.loadingSpinnerVariants = loadingSpinnerVariants;
8291
+ exports.mergeRenderers = mergeRenderers;
8292
+ exports.resolveRenderer = resolveRenderer;
6954
8293
  exports.themeToHsl = themeToHsl;
6955
8294
  exports.useColumnResize = useColumnResize;
6956
8295
  exports.useColumnResizeManager = useColumnResizeManager;
6957
8296
  exports.useConfirmation = useConfirmation;
8297
+ exports.useContentType = useContentType;
6958
8298
  exports.useContextMenu = useContextMenu;
6959
8299
  exports.useDataGridState = useDataGridState;
6960
8300
  exports.useKeyboardNavigation = useKeyboardNavigation;