@aiquants/directory-tree 2.1.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -116,7 +116,7 @@ The main component for rendering the directory tree.
116
116
  #### Props
117
117
 
118
118
  | Prop | Type | Required | Description |
119
- |------|------|----------|-------------|
119
+ | ------ | ------ | ---------- | ------------- |
120
120
  | `entries` | `DirectoryEntry[]` | Yes | Array of root directory entries to display |
121
121
  | `expansion` | `object` | Yes | Configuration for tree expansion state and behavior |
122
122
  | `selection` | `object` | Yes | Configuration for item selection |
@@ -126,7 +126,7 @@ The main component for rendering the directory tree.
126
126
  #### Expansion Options (`expansion`)
127
127
 
128
128
  | Prop | Type | Required | Default | Description |
129
- |------|------|----------|---------|-------------|
129
+ | ------ | ------ | ---------- | --------- | ------------- |
130
130
  | `toggle` | `(path: string) => void` | Yes | - | Function to toggle directory expansion state |
131
131
  | `isExpanded` | `(path: string) => boolean` | Yes | - | Function to check if a directory is expanded |
132
132
  | `expandMultiple` | `(paths: string[]) => void` | Yes | - | Function to expand multiple directories |
@@ -138,7 +138,7 @@ The main component for rendering the directory tree.
138
138
  #### Selection Options (`selection`)
139
139
 
140
140
  | Prop | Type | Required | Default | Description |
141
- |------|------|----------|---------|-------------|
141
+ | ------ | ------ | ---------- | --------- | ------------- |
142
142
  | `onEntryClick` | `(event: DirectoryTreeClickEvent) => void` | Yes | - | Callback function triggered when an entry is clicked |
143
143
  | `selectedPath` | `string \| null` | No | - | The currently selected file path |
144
144
  | `mode` | `'none' \| 'single' \| 'multiple'` | No | `'none'` | Selection mode for items |
@@ -148,7 +148,7 @@ The main component for rendering the directory tree.
148
148
  #### Visual Options (`visual`)
149
149
 
150
150
  | Prop | Type | Required | Default | Description |
151
- |------|------|----------|---------|-------------|
151
+ | ------ | ------ | ---------- | --------- | ------------- |
152
152
  | `className` | `string` | No | - | Optional CSS class name for the container |
153
153
  | `style` | `React.CSSProperties` | No | - | Optional inline styles for the container |
154
154
  | `lineColor` | `string` | No | `'#A0AEC0'` | The color of the tree lines |
@@ -158,6 +158,7 @@ The main component for rendering the directory tree.
158
158
  | `showFileIcons` | `boolean` | No | `true` | Flag indicating whether to render file type icons |
159
159
  | `iconOverrides` | `DirectoryTreeIconOverrides` | No | - | Icon overrides applied globally |
160
160
  | `expandIconSize` | `number` | No | - | Size of the expand icon |
161
+ | `itemHeight` | `number \| ((entry, index) => number)` | No | `20` | Row height in px, or a function computing the height per entry (variable-height rows). Tree connector lines follow each row's cumulative offset. Invalid values (`NaN` / `Infinity` / `0` / negative) fall back to `20`. Memoize the function to keep its identity stable. |
161
162
  | `removeRootIndent` | `boolean` | No | `false` | If true, removes the indentation and connector lines for root-level items |
162
163
  | `highlightStyles` | `HighlightStyles` | No | - | Highlight styles configuration for hover and selection states |
163
164
  | `entryClassName` | `string` | No | - | Additional CSS classes for each entry row |
@@ -205,20 +206,20 @@ A hook for managing directory tree state with localStorage persistence.
205
206
  #### Parameters
206
207
 
207
208
  | Parameter | Type | Description |
208
- |-----------|------|-------------|
209
+ | ----------- | ------ | ------------- |
209
210
  | `options` | `UseDirectoryTreeStateProps` | Configuration options |
210
211
 
211
212
  #### Options
212
213
 
213
214
  | Option | Type | Description |
214
- |--------|------|-------------|
215
+ | -------- | ------ | ------------- |
215
216
  | `initialExpanded` | `Set<string>` | Initially expanded directories |
216
217
  | `storageKey` | `string` | localStorage key for persistence (default: 'directory-tree-state') |
217
218
 
218
219
  #### Returns
219
220
 
220
221
  | Property | Type | Description |
221
- |----------|------|-------------|
222
+ | ---------- | ------ | ------------- |
222
223
  | `expanded` | `Set<string>` | Currently expanded directories |
223
224
  | `toggle` | `(path: string) => void` | Toggle directory expansion |
224
225
  | `isExpanded` | `(path: string) => boolean` | Check if directory is expanded |
@@ -326,6 +327,27 @@ Alternatively, you can dynamically configure specific highlight styles for hover
326
327
 
327
328
  ## Advanced Usage
328
329
 
330
+ ### Row Height (fixed & variable)
331
+
332
+ Rows are 20px tall by default. Pass a number for a uniform height, or a function
333
+ for variable-height rows — the virtual scroller and the tree connector lines both
334
+ follow each row's resolved height. Memoize the function so its identity stays stable.
335
+
336
+ ```tsx
337
+ import { useCallback } from 'react';
338
+ import { DirectoryTree, type DirectoryEntry } from '@aiquants/directory-tree';
339
+
340
+ // Fixed height
341
+ <DirectoryTree entries={entries} /* ...required props */ visual={{ itemHeight: 28 }} />
342
+
343
+ // Variable height: taller rows for files that render inline metadata
344
+ const itemHeight = useCallback(
345
+ (entry: DirectoryEntry) => (entry.type === 'file' ? 32 : 24),
346
+ [],
347
+ );
348
+ <DirectoryTree entries={entries} /* ...required props */ visual={{ itemHeight }} />
349
+ ```
350
+
329
351
  ### Large Datasets
330
352
 
331
353
  The component is optimized for large datasets through virtualization:
@@ -1 +1 @@
1
- @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-duration:initial}}}@layer theme{:root,:host{--color-amber-100:oklch(96.2% .059 95.617);--color-amber-900:oklch(41.4% .112 45.904);--color-yellow-50:oklch(98.7% .026 102.212);--color-yellow-400:oklch(85.2% .199 91.936);--color-yellow-500:oklch(79.5% .184 86.047);--color-yellow-600:oklch(68.1% .162 75.834);--color-yellow-900:oklch(42.1% .095 57.708);--color-emerald-100:oklch(95% .052 163.051);--color-emerald-900:oklch(37.8% .077 168.94);--color-cyan-400:oklch(78.9% .154 211.53);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-700:oklch(48.8% .243 264.376);--color-blue-800:oklch(42.4% .199 265.638);--color-indigo-100:oklch(93% .034 272.788);--color-indigo-800:oklch(39.8% .195 277.366);--color-indigo-900:oklch(35.9% .144 278.697);--color-slate-100:oklch(96.8% .007 247.896);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-600:oklch(44.6% .043 257.281);--color-slate-800:oklch(27.9% .041 260.031);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-900:oklch(21% .034 264.665);--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--font-weight-medium:500;--font-weight-bold:700;--radius-md:.375rem;--radius-lg:.5rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1)}}@layer base;@layer components{@layer theme,base;@layer components.utilities{.aqvs-scroll-pane{display:flex;position:relative}.aqvs-scroll-pane-content{flex:1;height:100%;position:relative;overflow:hidden}.aqvs-tap-scroll-circle{touch-action:none;-webkit-user-select:none;user-select:none;justify-content:center;align-items:center;transition-property:transform;transition-duration:.1s;transition-timing-function:cubic-bezier(0,0,.2,1);display:flex;position:relative}.aqvs-tap-scroll-circle-visual-outer{border-radius:9999px;position:absolute;inset:0}.aqvs-tap-scroll-circle-gradient{background:linear-gradient(to bottom right,#1d4ed899,#60a5fa8c,#bfdbfe66);border-width:1px;border-color:#fff6;border-radius:9999px;position:absolute;inset:0;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}.aqvs-tap-scroll-circle-inner{border-radius:9999px;position:absolute;inset:18%}.aqvs-sample-visual-rod{background-color:#ffffffd9;border-width:1px;border-color:#ffffff80;border-radius:9999px;position:absolute;top:50%;left:50%}.aqvs-sample-visual-pupil{background-color:#fffc;border-radius:9999px;position:absolute;top:50%;left:50%}.aqvs-sample-visual-highlight{background-color:#ffffff80;border-radius:9999px;position:absolute;top:50%;left:50%}.aqvs-scrollbar{z-index:50;cursor:default;-webkit-user-select:none;user-select:none;touch-action:none;background-color:#fff;position:relative}.aqvs-scrollbar-horizontal{flex-direction:row;align-items:stretch;display:flex}.aqvs-scrollbar-vertical{flex-direction:column;align-items:stretch;display:flex}.aqvs-scrollbar-tap-circle-wrapper{pointer-events:auto;transition-property:opacity;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1);position:absolute}.aqvs-scrollbar-arrow-button{color:#313131;background-color:#e0e0e0;justify-content:center;align-items:center;font-size:.75rem;line-height:1rem;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1);display:flex}.aqvs-scrollbar-arrow-button:focus{outline-offset:2px;outline:2px solid #0000}.aqvs-scrollbar-arrow-button:focus-visible{outline-offset:1px;outline:2px solid #60a5fa}.aqvs-scrollbar-arrow-button:disabled{cursor:not-allowed;opacity:.5}.aqvs-scrollbar-arrow-button:enabled:hover{background-color:#d4d4d4}.aqvs-scrollbar-track{background-color:#f5f5f5;flex:1;position:relative}.aqvs-scrollbar-overlay{pointer-events:none;position:absolute;inset:0}.aqvs-scrollbar-thumb-wrapper{touch-action:none;position:absolute}.aqvs-scrollbar-thumb{transform-origin:50%;background-color:#7f7f7f;transition:transform 80ms ease-out;position:absolute}.aqvs-scrollbar-thumb[data-thumb-state=disabled]{transition:none;transform:none}.aqvs-scrollbar-thumb[data-thumb-state=hover]{background-color:#5f5f5f}.aqvs-scrollbar-thumb[data-thumb-state=dragging]{background-color:#4f4f4f;transition:transform 60ms ease-out}.aqvs-scrollbar-thumb-horizontal{inset:1.5px 0}.aqvs-scrollbar-thumb-horizontal[data-thumb-state=hover]{top:-.5px;bottom:-.5px;transform:scaleY(1.06)}.aqvs-scrollbar-thumb-horizontal[data-thumb-state=dragging]{top:-.5px;bottom:-.5px;transform:scaleY(1.12)}.aqvs-scrollbar-thumb-vertical{inset:0 1.5px}.aqvs-scrollbar-thumb-vertical[data-thumb-state=hover]{left:-.5px;right:-.5px;transform:scaleX(1.06)}.aqvs-scrollbar-thumb-vertical[data-thumb-state=dragging]{left:-.5px;right:-.5px;transform:scaleX(1.12)}.aqvs-scroll-to-edge-button{pointer-events:auto;color:#fff;text-transform:uppercase;letter-spacing:.05em;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);background-color:#1f2937cc;border-radius:9999px;padding:.25rem 3rem;font-size:10px;font-weight:500;transition-property:transform,background-color;transition-duration:.15s;transform:none;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}.aqvs-scroll-to-edge-button:hover{background-color:#374151}.aqvs-scroll-to-edge-button:active{transform:scale(.95)}.aqvs-scroll-to-edge-overlay{pointer-events:none;z-index:10;transition-property:opacity;transition-duration:.5s;position:absolute;inset:0}.aqvs-scroll-to-edge-overlay[data-visible=true]{opacity:1}.aqvs-scroll-to-edge-overlay[data-visible=false]{opacity:0}.aqvs-scroll-to-edge-button-container{justify-content:center;display:flex;position:absolute;left:0;right:0}.aqvs-scroll-to-edge-button-container-top{top:.5rem}.aqvs-scroll-to-edge-button-container-bottom{bottom:.5rem}.aqvs-no-items-container{width:100%;position:absolute;top:0}.aqvs-no-items-text{text-align:center;color:#6b7280}.aqvs-item-container,.aqvs-bottom-inset,.aqvs-items-wrapper{width:100%;position:absolute}}@layer utilities;}@layer utilities{.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.absolute{position:absolute}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing) * 0)}.top-0{top:calc(var(--spacing) * 0)}.left-0{left:calc(var(--spacing) * 0)}.z-0{z-index:0}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.ml-1{margin-left:calc(var(--spacing) * 1)}.ml-2{margin-left:calc(var(--spacing) * 2)}.flex{display:flex}.hidden{display:none}.inline{display:inline}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-96{height:calc(var(--spacing) * 96)}.h-full{height:100%}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-full{width:100%}.flex-shrink-0{flex-shrink:0}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.cursor-pointer{cursor:pointer}.items-center{align-items:center}.justify-center{justify-content:center}.overflow-hidden{overflow:hidden}.overflow-y-hidden{overflow-y:hidden}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.bg-amber-100{background-color:var(--color-amber-100)}.bg-blue-400\/10{background-color:#54a2ff1a}@supports (color:color-mix(in lab,red,red)){.bg-blue-400\/10{background-color:color-mix(in oklab,var(--color-blue-400) 10%,transparent)}}.bg-blue-400\/20{background-color:#54a2ff33}@supports (color:color-mix(in lab,red,red)){.bg-blue-400\/20{background-color:color-mix(in oklab,var(--color-blue-400) 20%,transparent)}}.bg-emerald-100{background-color:var(--color-emerald-100)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-indigo-100{background-color:var(--color-indigo-100)}.bg-yellow-50{background-color:var(--color-yellow-50)}.px-2{padding-inline:calc(var(--spacing) * 2)}.py-1{padding-block:calc(var(--spacing) * 1)}.pr-\[3px\]{padding-right:3px}.pb-\[5px\]{padding-bottom:5px}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.text-blue-500{color:var(--color-blue-500)}.text-blue-700{color:var(--color-blue-700)}.text-blue-800{color:var(--color-blue-800)}.text-cyan-400{color:var(--color-cyan-400)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-700{color:var(--color-gray-700)}.text-indigo-800{color:var(--color-indigo-800)}.text-slate-600{color:var(--color-slate-600)}.text-slate-800{color:var(--color-slate-800)}.text-yellow-400{color:var(--color-yellow-400)}.text-yellow-500{color:var(--color-yellow-500)}.text-yellow-600{color:var(--color-yellow-600)}.opacity-70{opacity:.7}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_0_1px_rgba\(59\,130\,246\,0\.3\)\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,#3b82f64d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-300{--tw-duration:.3s;transition-duration:.3s}.select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.hover\:bg-gray-400\/15:hover{background-color:#99a1af26}@supports (color:color-mix(in lab,red,red)){.hover\:bg-gray-400\/15:hover{background-color:color-mix(in oklab,var(--color-gray-400) 15%,transparent)}}.hover\:bg-slate-100\/50:hover{background-color:#f1f5f980}@supports (color:color-mix(in lab,red,red)){.hover\:bg-slate-100\/50:hover{background-color:color-mix(in oklab,var(--color-slate-100) 50%,transparent)}}}@media(prefers-color-scheme:dark){.dark\:bg-amber-900\/20{background-color:#7b330633}@supports (color:color-mix(in lab,red,red)){.dark\:bg-amber-900\/20{background-color:color-mix(in oklab,var(--color-amber-900) 20%,transparent)}}.dark\:bg-blue-400\/15{background-color:#54a2ff26}@supports (color:color-mix(in lab,red,red)){.dark\:bg-blue-400\/15{background-color:color-mix(in oklab,var(--color-blue-400) 15%,transparent)}}.dark\:bg-blue-400\/25{background-color:#54a2ff40}@supports (color:color-mix(in lab,red,red)){.dark\:bg-blue-400\/25{background-color:color-mix(in oklab,var(--color-blue-400) 25%,transparent)}}.dark\:bg-emerald-900\/20{background-color:#004e3b33}@supports (color:color-mix(in lab,red,red)){.dark\:bg-emerald-900\/20{background-color:color-mix(in oklab,var(--color-emerald-900) 20%,transparent)}}.dark\:bg-gray-900{background-color:var(--color-gray-900)}.dark\:bg-indigo-900\/20{background-color:#312c8533}@supports (color:color-mix(in lab,red,red)){.dark\:bg-indigo-900\/20{background-color:color-mix(in oklab,var(--color-indigo-900) 20%,transparent)}}.dark\:bg-yellow-900\/20{background-color:#733e0a33}@supports (color:color-mix(in lab,red,red)){.dark\:bg-yellow-900\/20{background-color:color-mix(in oklab,var(--color-yellow-900) 20%,transparent)}}.dark\:text-blue-300{color:var(--color-blue-300)}.dark\:text-blue-400{color:var(--color-blue-400)}.dark\:text-gray-200{color:var(--color-gray-200)}.dark\:text-gray-400{color:var(--color-gray-400)}.dark\:text-slate-100{color:var(--color-slate-100)}.dark\:text-slate-300{color:var(--color-slate-300)}.dark\:shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.dark\:shadow-\[0_0_0_1px_rgba\(96\,165\,250\,0\.4\)\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,#60a5fa66);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}@media(hover:hover){.dark\:hover\:bg-gray-200\/10:hover{background-color:#e5e7eb1a}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-gray-200\/10:hover{background-color:color-mix(in oklab,var(--color-gray-200) 10%,transparent)}}}}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-duration{syntax:"*";inherits:false}
1
+ @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-duration:initial}}}@layer theme{:root,:host{--color-amber-100:oklch(96.2% .059 95.617);--color-amber-900:oklch(41.4% .112 45.904);--color-yellow-50:oklch(98.7% .026 102.212);--color-yellow-400:oklch(85.2% .199 91.936);--color-yellow-500:oklch(79.5% .184 86.047);--color-yellow-600:oklch(68.1% .162 75.834);--color-yellow-900:oklch(42.1% .095 57.708);--color-emerald-100:oklch(95% .052 163.051);--color-emerald-900:oklch(37.8% .077 168.94);--color-cyan-400:oklch(78.9% .154 211.53);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-700:oklch(48.8% .243 264.376);--color-blue-800:oklch(42.4% .199 265.638);--color-indigo-100:oklch(93% .034 272.788);--color-indigo-800:oklch(39.8% .195 277.366);--color-indigo-900:oklch(35.9% .144 278.697);--color-slate-100:oklch(96.8% .007 247.896);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-600:oklch(44.6% .043 257.281);--color-slate-800:oklch(27.9% .041 260.031);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-900:oklch(21% .034 264.665);--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--font-weight-medium:500;--font-weight-bold:700;--radius-md:.375rem;--radius-lg:.5rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1)}}@layer base;@layer components{@layer theme,base;@layer components.utilities{.aqvs-scroll-pane{display:flex;position:relative}.aqvs-scroll-pane-content{flex:1;height:100%;position:relative;overflow:hidden}.aqvs-tap-scroll-circle{touch-action:none;-webkit-user-select:none;user-select:none;justify-content:center;align-items:center;transition-property:transform;transition-duration:.1s;transition-timing-function:cubic-bezier(0,0,.2,1);display:flex;position:relative}.aqvs-tap-scroll-circle-visual-outer{border-radius:9999px;position:absolute;inset:0}.aqvs-tap-scroll-circle-gradient{background:linear-gradient(to bottom right,#1d4ed899,#60a5fa8c,#bfdbfe66);border-width:1px;border-color:#fff6;border-radius:9999px;position:absolute;inset:0;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}.aqvs-tap-scroll-circle-inner{border-radius:9999px;position:absolute;inset:18%}.aqvs-sample-visual-rod{background-color:#ffffffd9;border-width:1px;border-color:#ffffff80;border-radius:9999px;position:absolute;top:50%;left:50%}.aqvs-sample-visual-pupil{background-color:#fffc;border-radius:9999px;position:absolute;top:50%;left:50%}.aqvs-sample-visual-highlight{background-color:#ffffff80;border-radius:9999px;position:absolute;top:50%;left:50%}.aqvs-scrollbar{z-index:50;cursor:default;-webkit-user-select:none;user-select:none;touch-action:none;background-color:#fff;position:relative}.aqvs-scrollbar-horizontal{flex-direction:row;align-items:stretch;display:flex}.aqvs-scrollbar-vertical{flex-direction:column;align-items:stretch;display:flex}.aqvs-scrollbar-tap-circle-wrapper{pointer-events:auto;transition-property:opacity;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1);position:absolute}.aqvs-scrollbar-arrow-button{color:#313131;background-color:#e0e0e0;justify-content:center;align-items:center;font-size:.75rem;line-height:1rem;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1);display:flex}.aqvs-scrollbar-arrow-button:focus{outline-offset:2px;outline:2px solid #0000}.aqvs-scrollbar-arrow-button:focus-visible{outline-offset:1px;outline:2px solid #60a5fa}.aqvs-scrollbar-arrow-button:disabled{cursor:not-allowed;opacity:.5}.aqvs-scrollbar-arrow-button:enabled:hover{background-color:#d4d4d4}.aqvs-scrollbar-track{background-color:#f5f5f5;flex:1;position:relative}.aqvs-scrollbar-overlay{pointer-events:none;position:absolute;inset:0}.aqvs-scrollbar-thumb-wrapper{touch-action:none;position:absolute}.aqvs-scrollbar-thumb{transform-origin:50%;background-color:#7f7f7f;transition:transform 80ms ease-out;position:absolute}.aqvs-scrollbar-thumb[data-thumb-state=disabled]{transition:none;transform:none}.aqvs-scrollbar-thumb[data-thumb-state=hover]{background-color:#5f5f5f}.aqvs-scrollbar-thumb[data-thumb-state=dragging]{background-color:#4f4f4f;transition:transform 60ms ease-out}.aqvs-scrollbar-thumb-horizontal{inset:1.5px 0}.aqvs-scrollbar-thumb-horizontal[data-thumb-state=hover]{top:-.5px;bottom:-.5px;transform:scaleY(1.06)}.aqvs-scrollbar-thumb-horizontal[data-thumb-state=dragging]{top:-.5px;bottom:-.5px;transform:scaleY(1.12)}.aqvs-scrollbar-thumb-vertical{inset:0 1.5px}.aqvs-scrollbar-thumb-vertical[data-thumb-state=hover]{left:-.5px;right:-.5px;transform:scaleX(1.06)}.aqvs-scrollbar-thumb-vertical[data-thumb-state=dragging]{left:-.5px;right:-.5px;transform:scaleX(1.12)}.aqvs-scroll-to-edge-button{pointer-events:auto;color:#fff;text-transform:uppercase;letter-spacing:.05em;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);background-color:#1f2937cc;border-radius:9999px;padding:.25rem 3rem;font-size:10px;font-weight:500;transition-property:transform,background-color;transition-duration:.15s;transform:none;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}.aqvs-scroll-to-edge-button:hover{background-color:#374151}.aqvs-scroll-to-edge-button:active{transform:scale(.95)}.aqvs-scroll-to-edge-overlay{pointer-events:none;z-index:10;transition-property:opacity;transition-duration:.5s;position:absolute;inset:0}.aqvs-scroll-to-edge-overlay[data-visible=true]{opacity:1}.aqvs-scroll-to-edge-overlay[data-visible=false]{opacity:0}.aqvs-scroll-to-edge-button-container{justify-content:center;display:flex;position:absolute;left:0;right:0}.aqvs-scroll-to-edge-button-container-top{top:.5rem}.aqvs-scroll-to-edge-button-container-bottom{bottom:.5rem}.aqvs-no-items-container{width:100%;position:absolute;top:0}.aqvs-no-items-text{text-align:center;color:#6b7280}.aqvs-item-container,.aqvs-bottom-inset,.aqvs-items-wrapper{width:100%;position:absolute}}@layer utilities;}@layer utilities{.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing) * 0)}.top-0{top:calc(var(--spacing) * 0)}.left-0{left:calc(var(--spacing) * 0)}.z-0{z-index:0}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.ml-1{margin-left:calc(var(--spacing) * 1)}.ml-2{margin-left:calc(var(--spacing) * 2)}.flex{display:flex}.hidden{display:none}.inline{display:inline}.table{display:table}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-96{height:calc(var(--spacing) * 96)}.h-full{height:100%}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-full{width:100%}.flex-shrink-0{flex-shrink:0}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.cursor-pointer{cursor:pointer}.items-center{align-items:center}.justify-center{justify-content:center}.overflow-hidden{overflow:hidden}.overflow-y-hidden{overflow-y:hidden}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.bg-amber-100{background-color:var(--color-amber-100)}.bg-blue-400\/10{background-color:#54a2ff1a}@supports (color:color-mix(in lab,red,red)){.bg-blue-400\/10{background-color:color-mix(in oklab,var(--color-blue-400) 10%,transparent)}}.bg-blue-400\/20{background-color:#54a2ff33}@supports (color:color-mix(in lab,red,red)){.bg-blue-400\/20{background-color:color-mix(in oklab,var(--color-blue-400) 20%,transparent)}}.bg-emerald-100{background-color:var(--color-emerald-100)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-indigo-100{background-color:var(--color-indigo-100)}.bg-yellow-50{background-color:var(--color-yellow-50)}.px-2{padding-inline:calc(var(--spacing) * 2)}.py-1{padding-block:calc(var(--spacing) * 1)}.pr-\[3px\]{padding-right:3px}.pb-\[5px\]{padding-bottom:5px}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.text-blue-500{color:var(--color-blue-500)}.text-blue-700{color:var(--color-blue-700)}.text-blue-800{color:var(--color-blue-800)}.text-cyan-400{color:var(--color-cyan-400)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-700{color:var(--color-gray-700)}.text-indigo-800{color:var(--color-indigo-800)}.text-slate-600{color:var(--color-slate-600)}.text-slate-800{color:var(--color-slate-800)}.text-yellow-400{color:var(--color-yellow-400)}.text-yellow-500{color:var(--color-yellow-500)}.text-yellow-600{color:var(--color-yellow-600)}.opacity-70{opacity:.7}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_0_1px_rgba\(59\,130\,246\,0\.3\)\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,#3b82f64d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-300{--tw-duration:.3s;transition-duration:.3s}.select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.hover\:bg-gray-400\/15:hover{background-color:#99a1af26}@supports (color:color-mix(in lab,red,red)){.hover\:bg-gray-400\/15:hover{background-color:color-mix(in oklab,var(--color-gray-400) 15%,transparent)}}.hover\:bg-slate-100\/50:hover{background-color:#f1f5f980}@supports (color:color-mix(in lab,red,red)){.hover\:bg-slate-100\/50:hover{background-color:color-mix(in oklab,var(--color-slate-100) 50%,transparent)}}}@media(prefers-color-scheme:dark){.dark\:bg-amber-900\/20{background-color:#7b330633}@supports (color:color-mix(in lab,red,red)){.dark\:bg-amber-900\/20{background-color:color-mix(in oklab,var(--color-amber-900) 20%,transparent)}}.dark\:bg-blue-400\/15{background-color:#54a2ff26}@supports (color:color-mix(in lab,red,red)){.dark\:bg-blue-400\/15{background-color:color-mix(in oklab,var(--color-blue-400) 15%,transparent)}}.dark\:bg-blue-400\/25{background-color:#54a2ff40}@supports (color:color-mix(in lab,red,red)){.dark\:bg-blue-400\/25{background-color:color-mix(in oklab,var(--color-blue-400) 25%,transparent)}}.dark\:bg-emerald-900\/20{background-color:#004e3b33}@supports (color:color-mix(in lab,red,red)){.dark\:bg-emerald-900\/20{background-color:color-mix(in oklab,var(--color-emerald-900) 20%,transparent)}}.dark\:bg-gray-900{background-color:var(--color-gray-900)}.dark\:bg-indigo-900\/20{background-color:#312c8533}@supports (color:color-mix(in lab,red,red)){.dark\:bg-indigo-900\/20{background-color:color-mix(in oklab,var(--color-indigo-900) 20%,transparent)}}.dark\:bg-yellow-900\/20{background-color:#733e0a33}@supports (color:color-mix(in lab,red,red)){.dark\:bg-yellow-900\/20{background-color:color-mix(in oklab,var(--color-yellow-900) 20%,transparent)}}.dark\:text-blue-300{color:var(--color-blue-300)}.dark\:text-blue-400{color:var(--color-blue-400)}.dark\:text-gray-200{color:var(--color-gray-200)}.dark\:text-gray-400{color:var(--color-gray-400)}.dark\:text-slate-100{color:var(--color-slate-100)}.dark\:text-slate-300{color:var(--color-slate-300)}.dark\:shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.dark\:shadow-\[0_0_0_1px_rgba\(96\,165\,250\,0\.4\)\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,#60a5fa66);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}@media(hover:hover){.dark\:hover\:bg-gray-200\/10:hover{background-color:#e5e7eb1a}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-gray-200\/10:hover{background-color:color-mix(in oklab,var(--color-gray-200) 10%,transparent)}}}}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-duration{syntax:"*";inherits:false}
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react"),Xe=require("@aiquants/virtualscroll"),pe=require("@heroicons/react/24/solid"),Ve=require("@phosphor-icons/react"),$=require("tailwind-merge");var ye={exports:{}},ce={};var Te;function qe(){if(Te)return ce;Te=1;var e=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function a(l,n,s){var i=null;if(s!==void 0&&(i=""+s),n.key!==void 0&&(i=""+n.key),"key"in n){s={};for(var y in n)y!=="key"&&(s[y]=n[y])}else s=n;return n=s.ref,{$$typeof:e,type:l,key:i,ref:n!==void 0?n:null,props:s}}return ce.Fragment=r,ce.jsx=a,ce.jsxs=a,ce}var ue={};var Ne;function Je(){return Ne||(Ne=1,process.env.NODE_ENV!=="production"&&(function(){function e(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===D?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case o:return"Fragment";case k:return"Profiler";case h:return"StrictMode";case F:return"Suspense";case V:return"SuspenseList";case U:return"Activity"}if(typeof t=="object")switch(typeof t.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),t.$$typeof){case u:return"Portal";case w:return t.displayName||"Context";case N:return(t._context.displayName||"Context")+".Consumer";case f:var m=t.render;return t=t.displayName,t||(t=m.displayName||m.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Y:return m=t.displayName||null,m!==null?m:e(t.type)||"Memo";case B:m=t._payload,t=t._init;try{return e(t(m))}catch{}}return null}function r(t){return""+t}function a(t){try{r(t);var m=!1}catch{m=!0}if(m){m=console;var x=m.error,R=typeof Symbol=="function"&&Symbol.toStringTag&&t[Symbol.toStringTag]||t.constructor.name||"Object";return x.call(m,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",R),r(t)}}function l(t){if(t===o)return"<>";if(typeof t=="object"&&t!==null&&t.$$typeof===B)return"<...>";try{var m=e(t);return m?"<"+m+">":"<...>"}catch{return"<...>"}}function n(){var t=H.A;return t===null?null:t.getOwner()}function s(){return Error("react-stack-top-frame")}function i(t){if(Z.call(t,"key")){var m=Object.getOwnPropertyDescriptor(t,"key").get;if(m&&m.isReactWarning)return!1}return t.key!==void 0}function y(t,m){function x(){E||(E=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",m))}x.isReactWarning=!0,Object.defineProperty(t,"key",{get:x,configurable:!0})}function S(){var t=e(this.type);return j[t]||(j[t]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),t=this.props.ref,t!==void 0?t:null}function p(t,m,x,R,G,K){var _=x.ref;return t={$$typeof:I,type:t,key:m,props:x,_owner:R},(_!==void 0?_:null)!==null?Object.defineProperty(t,"ref",{enumerable:!1,get:S}):Object.defineProperty(t,"ref",{enumerable:!1,value:null}),t._store={},Object.defineProperty(t._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(t,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(t,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:G}),Object.defineProperty(t,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:K}),Object.freeze&&(Object.freeze(t.props),Object.freeze(t)),t}function c(t,m,x,R,G,K){var _=m.children;if(_!==void 0)if(R)if(q(_)){for(R=0;R<_.length;R++)v(_[R]);Object.freeze&&Object.freeze(_)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else v(_);if(Z.call(m,"key")){_=e(t);var W=Object.keys(m).filter(function(le){return le!=="key"});R=0<W.length?"{key: someKey, "+W.join(": ..., ")+": ...}":"{key: someKey}",ne[_+R]||(W=0<W.length?"{"+W.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react"),Ue=require("@aiquants/virtualscroll"),ge=require("@heroicons/react/24/solid"),Ze=require("@phosphor-icons/react"),B=require("tailwind-merge");var pe={exports:{}},ce={};var je;function Qe(){if(je)return ce;je=1;var e=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function o(n,s,l){var a=null;if(l!==void 0&&(a=""+l),s.key!==void 0&&(a=""+s.key),"key"in s){l={};for(var h in s)h!=="key"&&(l[h]=s[h])}else l=s;return s=l.ref,{$$typeof:e,type:n,key:a,ref:s!==void 0?s:null,props:l}}return ce.Fragment=r,ce.jsx=o,ce.jsxs=o,ce}var ue={};var Ae;function Ke(){return Ae||(Ae=1,process.env.NODE_ENV!=="production"&&(function(){function e(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===U?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case d:return"Fragment";case P:return"Profiler";case b:return"StrictMode";case M:return"Suspense";case N:return"SuspenseList";case z:return"Activity"}if(typeof t=="object")switch(typeof t.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),t.$$typeof){case i:return"Portal";case E:return t.displayName||"Context";case v:return(t._context.displayName||"Context")+".Consumer";case f:var m=t.render;return t=t.displayName,t||(t=m.displayName||m.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case j:return m=t.displayName||null,m!==null?m:e(t.type)||"Memo";case X:m=t._payload,t=t._init;try{return e(t(m))}catch{}}return null}function r(t){return""+t}function o(t){try{r(t);var m=!1}catch{m=!0}if(m){m=console;var x=m.error,R=typeof Symbol=="function"&&Symbol.toStringTag&&t[Symbol.toStringTag]||t.constructor.name||"Object";return x.call(m,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",R),r(t)}}function n(t){if(t===d)return"<>";if(typeof t=="object"&&t!==null&&t.$$typeof===X)return"<...>";try{var m=e(t);return m?"<"+m+">":"<...>"}catch{return"<...>"}}function s(){var t=$.A;return t===null?null:t.getOwner()}function l(){return Error("react-stack-top-frame")}function a(t){if(V.call(t,"key")){var m=Object.getOwnPropertyDescriptor(t,"key").get;if(m&&m.isReactWarning)return!1}return t.key!==void 0}function h(t,m){function x(){ne||(ne=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",m))}x.isReactWarning=!0,Object.defineProperty(t,"key",{get:x,configurable:!0})}function _(){var t=e(this.type);return S[t]||(S[t]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),t=this.props.ref,t!==void 0?t:null}function I(t,m,x,R,ee,Q){var C=x.ref;return t={$$typeof:k,type:t,key:m,props:x,_owner:R},(C!==void 0?C:null)!==null?Object.defineProperty(t,"ref",{enumerable:!1,get:_}):Object.defineProperty(t,"ref",{enumerable:!1,value:null}),t._store={},Object.defineProperty(t._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(t,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(t,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ee}),Object.defineProperty(t,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Q}),Object.freeze&&(Object.freeze(t.props),Object.freeze(t)),t}function c(t,m,x,R,ee,Q){var C=m.children;if(C!==void 0)if(R)if(Z(C)){for(R=0;R<C.length;R++)y(C[R]);Object.freeze&&Object.freeze(C)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else y(C);if(V.call(m,"key")){C=e(t);var G=Object.keys(m).filter(function(oe){return oe!=="key"});R=0<G.length?"{key: someKey, "+G.join(": ..., ")+": ...}":"{key: someKey}",A[C+R]||(G=0<G.length?"{"+G.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
2
2
  let props = %s;
3
3
  <%s {...props} />
4
4
  React keys must be passed directly to JSX without using spread:
5
5
  let props = %s;
6
- <%s key={someKey} {...props} />`,R,_,W,_),ne[_+R]=!0)}if(_=null,x!==void 0&&(a(x),_=""+x),i(m)&&(a(m.key),_=""+m.key),"key"in m){x={};for(var Q in m)Q!=="key"&&(x[Q]=m[Q])}else x=m;return _&&y(x,typeof t=="function"?t.displayName||t.name||"Unknown":t),p(t,_,x,n(),G,K)}function v(t){b(t)?t._store&&(t._store.validated=1):typeof t=="object"&&t!==null&&t.$$typeof===B&&(t._payload.status==="fulfilled"?b(t._payload.value)&&t._payload.value._store&&(t._payload.value._store.validated=1):t._store&&(t._store.validated=1))}function b(t){return typeof t=="object"&&t!==null&&t.$$typeof===I}var g=d,I=Symbol.for("react.transitional.element"),u=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),h=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),w=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),V=Symbol.for("react.suspense_list"),Y=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),U=Symbol.for("react.activity"),D=Symbol.for("react.client.reference"),H=g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z=Object.prototype.hasOwnProperty,q=Array.isArray,J=console.createTask?console.createTask:function(){return null};g={react_stack_bottom_frame:function(t){return t()}};var E,j={},O=g.react_stack_bottom_frame.bind(g,s)(),P=J(l(s)),ne={};ue.Fragment=o,ue.jsx=function(t,m,x){var R=1e4>H.recentlyCreatedOwnerStacks++;return c(t,m,x,!1,R?Error("react-stack-top-frame"):O,R?J(l(t)):P)},ue.jsxs=function(t,m,x){var R=1e4>H.recentlyCreatedOwnerStacks++;return c(t,m,x,!0,R?Error("react-stack-top-frame"):O,R?J(l(t)):P)}})()),ue}var Pe;function Ge(){return Pe||(Pe=1,process.env.NODE_ENV==="production"?ye.exports=qe():ye.exports=Je()),ye.exports}var T=Ge();const ze=(e,r,a)=>{const l=[];for(let n=r;n<a;n++){const s=e[n];if(!(!s||s.length===0))for(const i of s)l.push(i)}return l},Ue=(e,r,a)=>{const l=[];for(let n=r;n<a;n++){const s=e[n];if(!(!s||s.length===0))for(const i of s)l.push(i)}return l},Ze=(e,r,a,l)=>{const n=Math.max(1,Math.floor(r*l)),s=Math.max(1,Math.floor(a*l));(e.width!==n||e.height!==s)&&(e.width=n,e.height=s);const i=e.style;i.width!==`${r}px`&&(i.width=`${r}px`),i.height!==`${a}px`&&(i.height=`${a}px`)},Qe=(e,r,a)=>{e.lineWidth=a,e.beginPath();for(const l of r)e.moveTo(l.x1,l.y1),e.lineTo(l.x2,l.y2);e.stroke()},Ke=(e,r)=>{const a=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());if(!a)return null;let l=a[1];l.length===3&&(l=l.split("").map(y=>y+y).join(""));const n=Number.parseInt(l.slice(0,2),16),s=Number.parseInt(l.slice(2,4),16),i=Number.parseInt(l.slice(4,6),16);return`rgba(${n}, ${s}, ${i}, ${r})`},et=(e,r,a,l)=>{if(r.length===0)return;const n=Ke(a,.14),s=e.strokeStyle,i=e.fillStyle,y=e.lineWidth,S=e.lineCap,p=e.lineJoin;e.strokeStyle=a,e.lineCap="round",e.lineJoin="round";for(const c of r){const v=l??c.size,b=Math.max(0,v/2),g=Math.max(1,Math.round(v*.08)),I=Math.max(1,Math.round(v*.14)),u=Math.max(0,b-g*.8),o=Math.max(0,u*.55);n&&(e.fillStyle=n,e.beginPath(),e.arc(c.centerX,c.centerY,u,0,Math.PI*2),e.fill()),e.lineWidth=g,e.beginPath(),e.arc(c.centerX,c.centerY,Math.max(0,b-g*.3),0,Math.PI*2),e.stroke(),e.lineWidth=I,e.beginPath(),e.moveTo(c.centerX-o,c.centerY),e.lineTo(c.centerX+o,c.centerY),e.stroke(),c.isExpanded||(e.beginPath(),e.moveTo(c.centerX,c.centerY-o),e.lineTo(c.centerX,c.centerY+o),e.stroke())}e.strokeStyle=s,e.fillStyle=i,e.lineWidth=y,e.lineCap=S,e.lineJoin=p},je=d.memo(({segmentsByItem:e,glyphsByItem:r,itemHeight:a,width:l,viewportHeight:n,scrollPosition:s,color:i="#a0aec0",strokeWidth:y=1,renderStartIndex:S,renderEndIndex:p,lookaheadEndIndex:c,devicePixelRatio:v,expandGlyphColor:b,expandGlyphSize:g})=>{const I=d.useRef(null),u=d.useRef(null),o=d.useRef({segmentsByItem:e,glyphsByItem:r,itemHeight:a,width:l,viewportHeight:n,scrollPosition:s,color:i,strokeWidth:y,renderStartIndex:S,renderEndIndex:p,lookaheadEndIndex:c,devicePixelRatio:v,expandGlyphColor:b,expandGlyphSize:g}),h=d.useCallback(()=>{u.current=null;const N=I.current;if(!N)return;const w=N.getContext("2d");if(!w)return;const f=o.current;if(f.width<=0||f.viewportHeight<=0){w.clearRect(0,0,N.width,N.height);return}const F=Number.isFinite(f.devicePixelRatio??NaN)?f.devicePixelRatio:typeof window<"u"&&window.devicePixelRatio||1;Ze(N,f.width,f.viewportHeight,F);const V=f.segmentsByItem.length,Y=typeof f.renderStartIndex=="number"&&Number.isFinite(f.renderStartIndex)?Math.max(0,Math.floor(f.renderStartIndex)):Math.max(0,Math.floor(f.scrollPosition/f.itemHeight)),B=Math.min(V,Math.ceil((f.scrollPosition+f.viewportHeight)/f.itemHeight)),U=(()=>{if(typeof f.renderEndIndex=="number"&&Number.isFinite(f.renderEndIndex)){const q=Math.floor(f.renderEndIndex);return Math.max(Math.min(V,q+1),Y)}return Math.max(B,Y)})(),D=(()=>{if(typeof f.lookaheadEndIndex=="number"&&Number.isFinite(f.lookaheadEndIndex)){const q=Math.floor(f.lookaheadEndIndex),J=Math.min(V,q+1);return Math.max(J,U)}return Math.max(B,U)})(),H=ze(f.segmentsByItem,Y,D),Z=Ue(f.glyphsByItem,Y,D);w.save(),w.scale(F,F),w.clearRect(0,0,f.width,f.viewportHeight),w.translate(0,-f.scrollPosition),w.strokeStyle=f.color,Qe(w,H,f.strokeWidth),et(w,Z,f.expandGlyphColor??f.color,f.expandGlyphSize),w.restore()},[]),k=d.useCallback(()=>{u.current===null&&(u.current=window.requestAnimationFrame(h))},[h]);return d.useEffect(()=>{o.current={segmentsByItem:e,glyphsByItem:r,itemHeight:a,width:l,viewportHeight:n,scrollPosition:s,color:i,strokeWidth:y,renderStartIndex:S,renderEndIndex:p,lookaheadEndIndex:c,devicePixelRatio:v,expandGlyphColor:b,expandGlyphSize:g},k()},[e,r,a,l,n,s,i,y,S,p,c,v,b,g,k]),d.useEffect(()=>()=>{u.current!==null&&(window.cancelAnimationFrame(u.current),u.current=null)},[]),T.jsx("canvas",{ref:I,className:"pointer-events-none absolute top-0 left-0 z-0"})});je.displayName="TreeLineCanvas";const A={container:"directory-tree-container relative h-full transition-opacity duration-300 overflow-y-hidden pb-[5px] pr-[3px]",containerPending:"opacity-70",entry:"directory-tree-entry flex items-center cursor-pointer relative select-none",entryHover:$.twMerge("directory-tree-entry--hover hover:bg-gray-400/15","dark:hover:bg-gray-200/10"),entrySelected:$.twMerge("directory-tree-entry--selected bg-blue-400/10","dark:bg-blue-400/15"),entryItemSelected:$.twMerge("directory-tree-entry--item-selected bg-blue-400/20 shadow-[0_0_0_1px_rgba(59,130,246,0.3)]","dark:bg-blue-400/25 dark:shadow-[0_0_0_1px_rgba(96,165,250,0.4)]"),expandIcon:$.twMerge("directory-tree-expand-icon w-5 h-5 flex-shrink-0 flex items-center justify-center","text-gray-500","dark:text-gray-400"),expandIconSelected:$.twMerge("directory-tree-expand-icon--selected text-blue-700","dark:text-blue-400"),typeIcon:$.twMerge("directory-tree-type-icon w-5 h-5 flex-shrink-0 flex items-center justify-center","text-gray-500","dark:text-gray-400"),typeIconSelected:$.twMerge("directory-tree-type-icon--selected text-blue-700","dark:text-blue-400"),name:$.twMerge("directory-tree-name overflow-hidden text-ellipsis whitespace-nowrap ml-1","text-gray-700","dark:text-gray-200"),nameDirectory:"directory-tree-name--directory",nameSelected:$.twMerge("directory-tree-name--selected text-blue-800 font-medium","dark:text-blue-300")},tt={msOverflowStyle:"none",scrollbarWidth:"none"},rt=()=>{let e=document.getElementById("directory-tree-webkit-scrollbar-hide");e||(e=document.createElement("style"),e.id="directory-tree-webkit-scrollbar-hide",e.textContent=".directory-tree-container::-webkit-scrollbar { display: none; }",document.head.appendChild(e))},nt=(e,r,a,l)=>{const n=[],s=[];let i=0;const y=(S,p,c)=>{for(let v=0;v<S.length;v++){const b=S[v],g=v===S.length-1,I=[...c,g],u=b.children!==void 0,o=u&&r(b.absolutePath,b.relativePath);let h=p,k=I,N=c;l&&(h=p-1,k=I.slice(1),N=c.slice(1)),n.push({entry:b,indentLevel:h,parentIsLast:k}),a&&(h>i&&(i=h),s.push({id:b.absolutePath,name:b.name,absolutePath:b.absolutePath,indentLevel:h,isLastChild:g,isDirectory:u,isExpanded:o,ancestorIsLast:[...N],hideLines:l&&p===0})),u&&o&&b.children&&y(b.children,p+1,I)}};return y(e,0,[]),{flatItems:n,lineItems:s,maxIndent:i}},at=(e,r,a,l,n)=>{const s=l?.renderStart??Math.max(0,Math.floor(n/oe)),i=r>0?Math.ceil(r/oe)+a:a,y=e>0?Math.min(e-1,s+i):s,S=l?.renderEnd??y,p=e>0?Math.min(e-1,S+a):S;return{renderStart:s,renderEnd:S,lookaheadEnd:p}},st=({isDirectory:e,isExpanded:r,showExpandIcons:a,useCanvasExpandIcons:l,expandIconSize:n})=>{const s=n?{width:n,height:n}:void 0,i=n?"":"h-4 w-4";return!(a&&e)||l?T.jsx("span",{className:i,style:s,"aria-hidden":"true"}):r?T.jsx(pe.ChevronDownIcon,{className:i,style:s}):T.jsx(pe.ChevronRightIcon,{className:i,style:s})},ot=e=>e.slice((e.lastIndexOf(".")-1>>>0)+2).toLowerCase(),lt=(e,r,a,l,n)=>{if(e.length===0)return{segmentsByItem:[],glyphsByItem:[]};const s=Array.from({length:e.length},()=>[]),i=Array.from({length:e.length},()=>[]),y=l?typeof n=="number"&&Number.isFinite(n)&&n>0?n:Math.max(8,Math.min(a*.9,r*.7)):0,S=3;for(let p=0;p<e.length;p++){const c=e[p];if(c.hideLines)continue;const v=[],b=p*r,g=b+r/2,I=y>0?y/2+2:a/1.5;for(let h=0;h<c.indentLevel;h++){if(c.ancestorIsLast[h]??!1)continue;let N=!1;for(let w=p;w<e.length;w++){const f=e[w];if(f.indentLevel>h&&f.ancestorIsLast.length>h&&!f.ancestorIsLast[h]){N=!0;break}if(w>p&&f.indentLevel===h)break}if(N){const w=h*a+a/2+S;v.push({key:`${c.id}-ancestor-${h}`,x1:w,y1:b,x2:w,y2:b+r,itemIndex:p})}}const u=c.indentLevel*a,o=u+a/2+S;if(c.isDirectory?v.push({key:`${c.id}-connector-top`,x1:o,y1:b,x2:o,y2:g-I,itemIndex:p}):v.push({key:`${c.id}-connector-top`,x1:o,y1:b,x2:o,y2:g,itemIndex:p}),!c.isDirectory&&c.isLastChild&&v.push({key:`${c.id}-connector-horizontal`,x1:o,y1:g,x2:u+a+S,y2:g,itemIndex:p}),c.isLastChild||(c.isDirectory?v.push({key:`${c.id}-connector-bottom`,x1:o,y1:g+I,x2:o,y2:b+r,itemIndex:p}):v.push({key:`${c.id}-connector-bottom`,x1:o,y1:g,x2:o,y2:b+r,itemIndex:p})),s[p]=v,l&&c.isDirectory){const h=y,k=o,N=g;i[p]=[{key:`${c.id}-glyph`,itemIndex:p,centerX:k,centerY:N,size:h,isExpanded:c.isExpanded}]}}return{segmentsByItem:s,glyphsByItem:i}},Ee=(e,r)=>{if(e==null||typeof e=="boolean")return null;if(typeof e=="function")return console.warn(`[DirectoryTree] Function returned by renderer for "${r}". Return a node.`),null;if(typeof e=="object"){if("then"in e)return console.warn(`[DirectoryTree] Promise returned for "${r}". Not supported.`),null;if(Array.isArray(e)){const l=e.map(n=>Ee(n,r)).filter(Boolean);return l.length?l:null}const a=e.type;if(a&&a.$$typeof===Symbol.for("react.lazy"))return console.warn(`[DirectoryTree] Lazy component for "${r}". Not supported.`),null}return e},it=(e,r)=>{const{entry:a,isDirectory:l,isExpanded:n,extension:s}=e;let i;return a.icon!==void 0?i=a.icon:l?i=n&&r?.directoryExpanded||r?.directory||T.jsx(pe.FolderIcon,{className:"h-4 w-4"}):s&&r?.fileByExtension?.[s]?i=r.fileByExtension[s]:i=r?.file||(s==="md"?T.jsx(pe.DocumentTextIcon,{className:"h-4 w-4"}):T.jsx(Ve.FileIcon,{className:"h-4 w-4"})),Ee(typeof i=="function"?i(e):i,a.absolutePath)},xe=d.memo(({entry:e,indentLevel:r,isDirOpen:a,parentIsLast:l,renderChildren:n=!0,expansion:{toggleDirectory:s,onToggleDirectoryRecursive:i},selection:{onEntryClick:y,selectedPath:S,mode:p="none",selectedItems:c,onSelectionChange:v},visual:{iconOverrides:b,showExpandIcons:g=!0,showDirectoryIcons:I=!0,showFileIcons:u=!0,useCanvasExpandIcons:o=!1,expandIconSize:h,highlightStyles:k,entryClassName:N,entryStyle:w,nameClassName:f,nameStyle:F,directoryNameClassName:V,directoryNameStyle:Y,fileNameClassName:B,fileNameStyle:U}})=>{const D=d.useRef(null),[H,Z]=d.useState(null),[q,J]=d.useState(!1);d.useEffect(()=>()=>{D.current&&window.clearTimeout(D.current)},[]);const E=e.children!==void 0,j=E&&a(e.absolutePath),O=e.absolutePath===S,P=!E&&c?.has(e.absolutePath),ne=E?void 0:ot(e.name);d.useEffect(()=>{Z(j&&e.children?e.children:null)},[j,e.children]);const t=d.useCallback(L=>{L.stopPropagation(),p!=="none"&&!E&&v&&v(e,!P);let ae=!1;y({entry:e,isDirectory:E,isExpanded:j,preventDefault:()=>{ae=!0}}),!(!E||ae)&&(D.current?(window.clearTimeout(D.current),D.current=null,i(e)):D.current=window.setTimeout(()=>{s(e.absolutePath),D.current=null},500))},[E,e,j,i,s,y,p,v,P]),m=q?k?.hoverClassName!==void 0?k.hoverClassName:A.entryHover:"",x=(()=>{if(E){if(O)return k?.directorySelectedClassName!==void 0?k.directorySelectedClassName:A.entrySelected}else if(O||P)return k?.itemSelectedClassName!==void 0?k.itemSelectedClassName:$.twMerge(O&&A.entrySelected,P&&A.entryItemSelected);return""})(),R=$.twMerge(A.entry,m,x,N,e.className),G=$.twMerge(A.expandIcon,(O||P)&&A.expandIconSelected),K=$.twMerge(A.typeIcon,(O||P)&&A.typeIconSelected),_=$.twMerge(A.name,f,E&&A.nameDirectory,E&&V,!E&&B,(O||P)&&A.nameSelected),W=st({isDirectory:E,isExpanded:j,showExpandIcons:g,useCanvasExpandIcons:o,expandIconSize:h}),Q=(E?I:u)?it({entry:e,isDirectory:E,isExpanded:j,isSelected:O,isItemSelected:!!P,extension:ne},b):null,le={...q?k?.hoverStyle:{},...E&&O?k?.directorySelectedStyle:{},...!E&&(O||P)?k?.itemSelectedStyle:{}};return T.jsxs(d.Fragment,{children:[T.jsxs("div",{className:R,style:{paddingLeft:`${Math.max(0,r*de)}px`,transform:r<0?`translateX(${r*de}px)`:void 0,width:r<0?`calc(100% + ${Math.abs(r*de)}px)`:void 0,height:`${oe}px`,...le,...w,...e.style},"data-entry-type":E?"directory":"file","data-entry-expanded":E?String(j):void 0,"data-entry-selected":O?"true":void 0,"data-entry-item-selected":P?"true":void 0,onClick:t,onMouseEnter:()=>J(!0),onMouseLeave:()=>J(!1),onKeyDown:L=>L.key==="Enter"&&t(L),tabIndex:0,role:"treeitem","aria-expanded":E?j:void 0,"aria-label":`${e.name} (${E?"directory":"file"})`,children:[(g||o)&&T.jsx("span",{className:G,children:W}),(E?I:u)&&T.jsx("span",{className:K,children:Q}),T.jsx("span",{className:_,style:{...F,...E?Y:U},"data-entry-type":E?"directory":"file","data-entry-role":"name",children:e.label??e.name})]}),j&&H&&n&&T.jsx("fieldset",{children:H.map((L,ae)=>T.jsx(xe,{entry:L,indentLevel:r+1,isDirOpen:a,parentIsLast:[...l,ae===H.length-1],expansion:{toggleDirectory:s,onToggleDirectoryRecursive:i},selection:{onEntryClick:y,selectedPath:S,mode:p,selectedItems:c,onSelectionChange:v},visual:{iconOverrides:b,showExpandIcons:g,showDirectoryIcons:I,showFileIcons:u,useCanvasExpandIcons:o,expandIconSize:h,highlightStyles:k,entryClassName:N,entryStyle:w,nameClassName:f,nameStyle:F,directoryNameClassName:V,directoryNameStyle:Y,fileNameClassName:B,fileNameStyle:U}},L.absolutePath))})]},e.absolutePath)},(e,r)=>{if(e.entry!==r.entry)return!1;const a=e.entry.children!==void 0,l=r.entry.children!==void 0,n=a&&e.isDirOpen(e.entry.absolutePath),s=l&&r.isDirOpen(r.entry.absolutePath);return e.indentLevel===r.indentLevel&&n===s&&e.selection.selectedPath===r.selection.selectedPath&&e.selection.mode===r.selection.mode&&e.selection.selectedItems===r.selection.selectedItems&&e.visual.iconOverrides===r.visual.iconOverrides&&e.visual.showExpandIcons===r.visual.showExpandIcons&&e.visual.showDirectoryIcons===r.visual.showDirectoryIcons&&e.visual.showFileIcons===r.visual.showFileIcons&&e.visual.useCanvasExpandIcons===r.visual.useCanvasExpandIcons&&e.visual.expandIconSize===r.visual.expandIconSize&&e.visual.highlightStyles===r.visual.highlightStyles&&e.visual.entryClassName===r.visual.entryClassName&&e.visual.entryStyle===r.visual.entryStyle&&e.visual.nameClassName===r.visual.nameClassName&&e.visual.nameStyle===r.visual.nameStyle&&e.visual.directoryNameClassName===r.visual.directoryNameClassName&&e.visual.directoryNameStyle===r.visual.directoryNameStyle&&e.visual.fileNameClassName===r.visual.fileNameClassName&&e.visual.fileNameStyle===r.visual.fileNameStyle&&e.parentIsLast.length===r.parentIsLast.length&&e.parentIsLast.every((i,y)=>i===r.parentIsLast[y])});xe.displayName="DirectoryEntryItem";const oe=20,ct=()=>oe,de=16,Me=12,Oe=e=>{const r=[];if(e.children)for(const a of e.children)a.type==="directory"&&(r.push(a.absolutePath),r.push(...Oe(a)));return r},ut=({entries:e,expansion:{toggle:r,isExpanded:a,expandMultiple:l,collapseMultiple:n,isPending:s,alwaysExpanded:i=!1,doubleClickAction:y="recursive"},selection:{onEntryClick:S,selectedPath:p,mode:c="none",selectedItems:v,onSelectionChange:b},visual:{className:g,style:I,lineColor:u="#A0AEC0",showTreeLines:o=!0,showExpandIcons:h=!0,showDirectoryIcons:k=!0,showFileIcons:N=!0,iconOverrides:w,expandIconSize:f,removeRootIndent:F=!1,highlightStyles:V,entryClassName:Y,entryStyle:B,nameClassName:U,nameStyle:D,directoryNameClassName:H,directoryNameStyle:Z,fileNameClassName:q,fileNameStyle:J}={},virtualScroll:E})=>{const[j,O]=d.useState(!1),P=d.useRef(null),ne=d.useRef(null),[t,m]=d.useState(0),[x,R]=d.useState(null),{overscanCount:G=15,className:K,background:_,onScroll:W,onRangeChange:Q,initialScrollIndex:le,initialScrollOffset:L,callbackThrottleMs:ae=5,contentInsets:Ae,onItemFocus:$e,viewportHeightOverride:z,scrollBarOptions:De,behaviorOptions:Le}=E??{},[fe,Se]=d.useState(typeof L=="number"?L:0),Fe=d.useCallback((C,te)=>{Se(C),W?.(C,te)},[W]),Ye=d.useCallback(C=>{const{renderingStartIndex:te,renderingEndIndex:X}=C;R(M=>M&&M.renderStart===te&&M.renderEnd===X?M:{renderStart:te,renderEnd:X}),Q?.(C)},[Q]);d.useEffect(()=>{typeof L=="number"&&Se(L)},[L]),d.useEffect(()=>{O(!0),rt()},[]),d.useEffect(()=>{if(typeof z=="number"){m(M=>Math.abs(M-z)>1?z:M);return}const C=P.current;if(!C)return m(0);(()=>{const M=C.clientHeight;m(re=>Math.abs(re-M)>1?M:re)})();const X=new ResizeObserver(M=>{for(const re of M)re.target===C&&m(ve=>Math.abs(ve-re.contentRect.height)>1?re.contentRect.height:ve)});return X.observe(C),()=>X.disconnect()},[z]);const ee=typeof z=="number"?z:t,se=d.useCallback(C=>i||(j?a(C):!1),[j,a,i]),ke=$.twMerge(A.container,s&&A.containerPending,g),we=d.useMemo(()=>({...tt,...I??{},...typeof z=="number"?{height:z,minHeight:z}:{}}),[I,z]),Be=d.useCallback((C,te)=>{const X=[C.absolutePath,...Oe(C)],M=te||y;if(X.every(ge=>se(ge)))return n(X);if(X.every(ge=>!se(ge))||M==="recursive")return l(X);if(M==="toggle")return n(X);console.warn(`[DirectoryTree] Unknown double click action: ${M}. No action taken.`)},[se,l,n,y]),{flatItems:ie,lineItems:be,maxIndent:Ie}=d.useMemo(()=>nt(e,se,o,F),[e,se,o,F]),me=d.useMemo(()=>!o||be.length===0?{segmentsByItem:[],glyphsByItem:[]}:lt(be,oe,de,o,f??Me),[be,o,f]),he=d.useMemo(()=>!o||e.length===0?0:(Ie+2)*de,[e.length,Ie,o]),{renderStart:Re,renderEnd:_e,lookaheadEnd:Ce}=d.useMemo(()=>at(ie.length,ee,G,x,fe),[ie.length,ee,G,x,fe]),He=d.useMemo(()=>!o||he<=0||ee<=0||me.segmentsByItem.length===0?null:T.jsx("div",{className:"pointer-events-none absolute inset-0 z-0","aria-hidden":"true",children:T.jsx("div",{className:"absolute top-0 left-0",style:{width:he,height:ee},children:T.jsx(je,{segmentsByItem:me.segmentsByItem,glyphsByItem:me.glyphsByItem,itemHeight:oe,width:he,viewportHeight:ee,scrollPosition:fe,color:u,expandGlyphColor:u,expandGlyphSize:f??Me,renderStartIndex:Re,renderEndIndex:_e,lookaheadEndIndex:Ce})})}),[he,ee,Re,_e,Ce,fe,me,u,o,f]),We=d.useCallback(C=>ie[C],[ie]);return e.length===0?T.jsx("div",{className:ke,style:we}):T.jsx("div",{ref:P,className:ke,style:we,role:"tree",children:T.jsx(Xe.VirtualScroll,{ref:ne,itemCount:ie.length,getItem:We,getItemHeight:ct,viewportSize:ee,overscanCount:G,onScroll:Fe,onRangeChange:Ye,className:K,background:T.jsxs(T.Fragment,{children:[He,_]}),initialScrollIndex:le,initialScrollOffset:L,onItemFocus:$e,callbackThrottleMs:ae,contentInsets:Ae,scrollBarOptions:De,behaviorOptions:Le,children:C=>C&&T.jsx(xe,{entry:C.entry,indentLevel:C.indentLevel,isDirOpen:se,parentIsLast:C.parentIsLast,renderChildren:!1,expansion:{toggleDirectory:r,onToggleDirectoryRecursive:Be},selection:{onEntryClick:S,selectedPath:p??null,mode:c,selectedItems:v,onSelectionChange:b},visual:{iconOverrides:w,showExpandIcons:h,showDirectoryIcons:k,showFileIcons:N,useCanvasExpandIcons:o,expandIconSize:f,highlightStyles:V,entryClassName:Y,entryStyle:B,nameClassName:U,nameStyle:D,directoryNameClassName:H,directoryNameStyle:Z,fileNameClassName:q,fileNameStyle:J}},C.entry.absolutePath)})})},dt=({initialExpanded:e=new Set,storageKey:r}={})=>{const[a,l]=d.useTransition(),[n,s]=d.useState(()=>{if(typeof window<"u"&&r)try{const u=window.localStorage.getItem(r);if(u){const o=JSON.parse(u);return new Set(o)}}catch(u){console.error("[useDirectoryTreeState] Error reading from localStorage",u)}return e}),i=d.useCallback(u=>{l(()=>{s(o=>{const h=new Set(o);return u(h),h})})},[]),y=d.useCallback((u,o)=>{i(h=>{for(const k of u)o(h,k)})},[i]);d.useEffect(()=>{if(r&&typeof window<"u")try{window.localStorage.setItem(r,JSON.stringify(Array.from(n)))}catch(u){console.warn(`Error setting localStorage key "${r}":`,u)}},[n,r]);const S=d.useCallback(u=>{y([u],(o,h)=>{o.has(h)?o.delete(h):o.add(h)})},[y]),p=d.useCallback(u=>{y([u],(o,h)=>{o.add(h)})},[y]),c=d.useCallback(u=>{y([u],(o,h)=>{o.delete(h)})},[y]),v=d.useCallback(u=>{y(u,(o,h)=>{o.delete(h)})},[y]),b=d.useCallback(u=>{y(u,(o,h)=>{o.add(h)})},[y]),g=d.useCallback(()=>{i(u=>{u.clear()})},[i]),I=d.useCallback(u=>n.has(u),[n]);return{expanded:n,toggle:S,expand:p,collapse:c,collapseMultiple:v,expandMultiple:b,collapseAll:g,isExpanded:I,isPending:a}};exports.DirectoryTree=ut;exports.directoryTreeClasses=A;exports.useDirectoryTreeState=dt;
6
+ <%s key={someKey} {...props} />`,R,C,G,C),A[C+R]=!0)}if(C=null,x!==void 0&&(o(x),C=""+x),a(m)&&(o(m.key),C=""+m.key),"key"in m){x={};for(var te in m)te!=="key"&&(x[te]=m[te])}else x=m;return C&&h(x,typeof t=="function"?t.displayName||t.name||"Unknown":t),I(t,C,x,s(),ee,Q)}function y(t){p(t)?t._store&&(t._store.validated=1):typeof t=="object"&&t!==null&&t.$$typeof===X&&(t._payload.status==="fulfilled"?p(t._payload.value)&&t._payload.value._store&&(t._payload.value._store.validated=1):t._store&&(t._store.validated=1))}function p(t){return typeof t=="object"&&t!==null&&t.$$typeof===k}var w=u,k=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),P=Symbol.for("react.profiler"),v=Symbol.for("react.consumer"),E=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),X=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),U=Symbol.for("react.client.reference"),$=w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=Object.prototype.hasOwnProperty,Z=Array.isArray,q=console.createTask?console.createTask:function(){return null};w={react_stack_bottom_frame:function(t){return t()}};var ne,S={},D=w.react_stack_bottom_frame.bind(w,l)(),L=q(n(l)),A={};ue.Fragment=d,ue.jsx=function(t,m,x){var R=1e4>$.recentlyCreatedOwnerStacks++;return c(t,m,x,!1,R?Error("react-stack-top-frame"):D,R?q(n(t)):L)},ue.jsxs=function(t,m,x){var R=1e4>$.recentlyCreatedOwnerStacks++;return c(t,m,x,!0,R?Error("react-stack-top-frame"):D,R?q(n(t)):L)}})()),ue}var Oe;function et(){return Oe||(Oe=1,process.env.NODE_ENV==="production"?pe.exports=Qe():pe.exports=Ke()),pe.exports}var T=et();const tt=(e,r,o)=>{const n=[];for(let s=r;s<o;s++){const l=e[s];if(!(!l||l.length===0))for(const a of l)n.push(a)}return n},rt=(e,r,o)=>{const n=[];for(let s=r;s<o;s++){const l=e[s];if(!(!l||l.length===0))for(const a of l)n.push(a)}return n},nt=(e,r,o,n)=>{const s=Math.max(1,Math.floor(r*n)),l=Math.max(1,Math.floor(o*n));(e.width!==s||e.height!==l)&&(e.width=s,e.height=l);const a=e.style;a.width!==`${r}px`&&(a.width=`${r}px`),a.height!==`${o}px`&&(a.height=`${o}px`)},st=(e,r,o)=>{e.lineWidth=o,e.beginPath();for(const n of r)e.moveTo(n.x1,n.y1),e.lineTo(n.x2,n.y2);e.stroke()},at=(e,r)=>{const o=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());if(!o)return null;let n=o[1];n.length===3&&(n=n.split("").map(h=>h+h).join(""));const s=Number.parseInt(n.slice(0,2),16),l=Number.parseInt(n.slice(2,4),16),a=Number.parseInt(n.slice(4,6),16);return`rgba(${s}, ${l}, ${a}, ${r})`},ot=(e,r,o,n)=>{if(r.length===0)return;const s=at(o,.14),l=e.strokeStyle,a=e.fillStyle,h=e.lineWidth,_=e.lineCap,I=e.lineJoin;e.strokeStyle=o,e.lineCap="round",e.lineJoin="round";for(const c of r){const y=n??c.size,p=Math.max(0,y/2),w=Math.max(1,Math.round(y*.08)),k=Math.max(1,Math.round(y*.14)),i=Math.max(0,p-w*.8),d=Math.max(0,i*.55);s&&(e.fillStyle=s,e.beginPath(),e.arc(c.centerX,c.centerY,i,0,Math.PI*2),e.fill()),e.lineWidth=w,e.beginPath(),e.arc(c.centerX,c.centerY,Math.max(0,p-w*.3),0,Math.PI*2),e.stroke(),e.lineWidth=k,e.beginPath(),e.moveTo(c.centerX-d,c.centerY),e.lineTo(c.centerX+d,c.centerY),e.stroke(),c.isExpanded||(e.beginPath(),e.moveTo(c.centerX,c.centerY-d),e.lineTo(c.centerX,c.centerY+d),e.stroke())}e.strokeStyle=l,e.fillStyle=a,e.lineWidth=h,e.lineCap=_,e.lineJoin=I},Le=u.memo(({segmentsByItem:e,glyphsByItem:r,itemHeight:o,width:n,viewportHeight:s,scrollPosition:l,color:a="#a0aec0",strokeWidth:h=1,renderStartIndex:_,renderEndIndex:I,lookaheadEndIndex:c,devicePixelRatio:y,expandGlyphColor:p,expandGlyphSize:w})=>{const k=u.useRef(null),i=u.useRef(null),d=u.useRef({segmentsByItem:e,glyphsByItem:r,itemHeight:o,width:n,viewportHeight:s,scrollPosition:l,color:a,strokeWidth:h,renderStartIndex:_,renderEndIndex:I,lookaheadEndIndex:c,devicePixelRatio:y,expandGlyphColor:p,expandGlyphSize:w}),b=u.useCallback(()=>{i.current=null;const v=k.current;if(!v)return;const E=v.getContext("2d");if(!E)return;const f=d.current;if(f.width<=0||f.viewportHeight<=0){E.clearRect(0,0,v.width,v.height);return}const M=Number.isFinite(f.devicePixelRatio??NaN)?f.devicePixelRatio:typeof window<"u"&&window.devicePixelRatio||1;nt(v,f.width,f.viewportHeight,M);const N=f.segmentsByItem.length,j=typeof f.renderStartIndex=="number"&&Number.isFinite(f.renderStartIndex)?Math.max(0,Math.floor(f.renderStartIndex)):Math.max(0,Math.floor(f.scrollPosition/f.itemHeight)),X=Math.min(N,Math.ceil((f.scrollPosition+f.viewportHeight)/f.itemHeight)),z=(()=>{if(typeof f.renderEndIndex=="number"&&Number.isFinite(f.renderEndIndex)){const Z=Math.floor(f.renderEndIndex);return Math.max(Math.min(N,Z+1),j)}return Math.max(X,j)})(),U=(()=>{if(typeof f.lookaheadEndIndex=="number"&&Number.isFinite(f.lookaheadEndIndex)){const Z=Math.floor(f.lookaheadEndIndex),q=Math.min(N,Z+1);return Math.max(q,z)}return Math.max(X,z)})(),$=tt(f.segmentsByItem,j,U),V=rt(f.glyphsByItem,j,U);E.save(),E.scale(M,M),E.clearRect(0,0,f.width,f.viewportHeight),E.translate(0,-f.scrollPosition),E.strokeStyle=f.color,st(E,$,f.strokeWidth),ot(E,V,f.expandGlyphColor??f.color,f.expandGlyphSize),E.restore()},[]),P=u.useCallback(()=>{i.current===null&&(i.current=window.requestAnimationFrame(b))},[b]);return u.useEffect(()=>{d.current={segmentsByItem:e,glyphsByItem:r,itemHeight:o,width:n,viewportHeight:s,scrollPosition:l,color:a,strokeWidth:h,renderStartIndex:_,renderEndIndex:I,lookaheadEndIndex:c,devicePixelRatio:y,expandGlyphColor:p,expandGlyphSize:w},P()},[e,r,o,n,s,l,a,h,_,I,c,y,p,w,P]),u.useEffect(()=>()=>{i.current!==null&&(window.cancelAnimationFrame(i.current),i.current=null)},[]),T.jsx("canvas",{ref:k,className:"pointer-events-none absolute top-0 left-0 z-0"})});Le.displayName="TreeLineCanvas";const Y={container:"directory-tree-container relative h-full transition-opacity duration-300 overflow-y-hidden pb-[5px] pr-[3px]",containerPending:"opacity-70",entry:"directory-tree-entry flex items-center cursor-pointer relative select-none",entryHover:B.twMerge("directory-tree-entry--hover hover:bg-gray-400/15","dark:hover:bg-gray-200/10"),entrySelected:B.twMerge("directory-tree-entry--selected bg-blue-400/10","dark:bg-blue-400/15"),entryItemSelected:B.twMerge("directory-tree-entry--item-selected bg-blue-400/20 shadow-[0_0_0_1px_rgba(59,130,246,0.3)]","dark:bg-blue-400/25 dark:shadow-[0_0_0_1px_rgba(96,165,250,0.4)]"),expandIcon:B.twMerge("directory-tree-expand-icon w-5 h-5 flex-shrink-0 flex items-center justify-center","text-gray-500","dark:text-gray-400"),expandIconSelected:B.twMerge("directory-tree-expand-icon--selected text-blue-700","dark:text-blue-400"),typeIcon:B.twMerge("directory-tree-type-icon w-5 h-5 flex-shrink-0 flex items-center justify-center","text-gray-500","dark:text-gray-400"),typeIconSelected:B.twMerge("directory-tree-type-icon--selected text-blue-700","dark:text-blue-400"),name:B.twMerge("directory-tree-name overflow-hidden text-ellipsis whitespace-nowrap ml-1","text-gray-700","dark:text-gray-200"),nameDirectory:"directory-tree-name--directory",nameSelected:B.twMerge("directory-tree-name--selected text-blue-800 font-medium","dark:text-blue-300")},lt={msOverflowStyle:"none",scrollbarWidth:"none"},it=()=>{let e=document.getElementById("directory-tree-webkit-scrollbar-hide");e||(e=document.createElement("style"),e.id="directory-tree-webkit-scrollbar-hide",e.textContent=".directory-tree-container::-webkit-scrollbar { display: none; }",document.head.appendChild(e))},ct=(e,r,o,n)=>{const s=[],l=[];let a=0;const h=(_,I,c)=>{for(let y=0;y<_.length;y++){const p=_[y],w=y===_.length-1,k=[...c,w],i=p.children!==void 0,d=i&&r(p.absolutePath,p.relativePath);let b=I,P=k,v=c;n&&(b=I-1,P=k.slice(1),v=c.slice(1)),s.push({entry:p,indentLevel:b,parentIsLast:P}),o&&(b>a&&(a=b),l.push({id:p.absolutePath,name:p.name,absolutePath:p.absolutePath,indentLevel:b,isLastChild:w,isDirectory:i,isExpanded:d,ancestorIsLast:[...v],hideLines:n&&I===0})),i&&d&&p.children&&h(p.children,I+1,k)}};return h(e,0,[]),{flatItems:s,lineItems:l,maxIndent:a}},$e=(e,r)=>{const o=e.length-1;if(o<=0)return 0;let n=0,s=o-1,l=0;for(;n<=s;){const a=n+s>>>1;e[a]<=r?(l=a,n=a+1):s=a-1}return l},ut=(e,r,o,n,s,l)=>{const a=n?.renderStart??Math.max(0,$e(l,s)),h=r>0?$e(l,s+r)+o:a+o,_=e>0?Math.min(e-1,Math.max(a,h)):a,I=n?.renderEnd??_,c=e>0?Math.min(e-1,I+o):I;return{renderStart:a,renderEnd:I,lookaheadEnd:c}},dt=({isDirectory:e,isExpanded:r,showExpandIcons:o,useCanvasExpandIcons:n,expandIconSize:s})=>{const l=s?{width:s,height:s}:void 0,a=s?"":"h-4 w-4";return!(o&&e)||n?T.jsx("span",{className:a,style:l,"aria-hidden":"true"}):r?T.jsx(ge.ChevronDownIcon,{className:a,style:l}):T.jsx(ge.ChevronRightIcon,{className:a,style:l})},ft=e=>e.slice((e.lastIndexOf(".")-1>>>0)+2).toLowerCase(),mt=(e,r,o,n,s,l)=>{if(e.length===0)return{segmentsByItem:[],glyphsByItem:[]};const a=Array.from({length:e.length},()=>[]),h=Array.from({length:e.length},()=>[]),_=c=>s?typeof l=="number"&&Number.isFinite(l)&&l>0?l:Math.max(8,Math.min(n*.9,c*.7)):0,I=3;for(let c=0;c<e.length;c++){const y=e[c];if(y.hideLines)continue;const p=[],w=r[c]??0,k=o[c]??0,i=k+w/2,d=_(w),b=d>0?d/2+2:n/1.5;for(let E=0;E<y.indentLevel;E++){if(y.ancestorIsLast[E]??!1)continue;let M=!1;for(let N=c;N<e.length;N++){const j=e[N];if(j.indentLevel>E&&j.ancestorIsLast.length>E&&!j.ancestorIsLast[E]){M=!0;break}if(N>c&&j.indentLevel===E)break}if(M){const N=E*n+n/2+I;p.push({key:`${y.id}-ancestor-${E}`,x1:N,y1:k,x2:N,y2:k+w,itemIndex:c})}}const P=y.indentLevel*n,v=P+n/2+I;if(y.isDirectory?p.push({key:`${y.id}-connector-top`,x1:v,y1:k,x2:v,y2:i-b,itemIndex:c}):p.push({key:`${y.id}-connector-top`,x1:v,y1:k,x2:v,y2:i,itemIndex:c}),!y.isDirectory&&y.isLastChild&&p.push({key:`${y.id}-connector-horizontal`,x1:v,y1:i,x2:P+n+I,y2:i,itemIndex:c}),y.isLastChild||(y.isDirectory?p.push({key:`${y.id}-connector-bottom`,x1:v,y1:i+b,x2:v,y2:k+w,itemIndex:c}):p.push({key:`${y.id}-connector-bottom`,x1:v,y1:i,x2:v,y2:k+w,itemIndex:c})),a[c]=p,s&&y.isDirectory){const E=d,f=v,M=i;h[c]=[{key:`${y.id}-glyph`,itemIndex:c,centerX:f,centerY:M,size:E,isExpanded:y.isExpanded}]}}return{segmentsByItem:a,glyphsByItem:h}},ke=(e,r)=>{if(e==null||typeof e=="boolean")return null;if(typeof e=="function")return console.warn(`[DirectoryTree] Function returned by renderer for "${r}". Return a node.`),null;if(typeof e=="object"){if("then"in e)return console.warn(`[DirectoryTree] Promise returned for "${r}". Not supported.`),null;if(Array.isArray(e)){const n=e.map(s=>ke(s,r)).filter(Boolean);return n.length?n:null}const o=e.type;if(o&&o.$$typeof===Symbol.for("react.lazy"))return console.warn(`[DirectoryTree] Lazy component for "${r}". Not supported.`),null}return e},ht=(e,r)=>{const{entry:o,isDirectory:n,isExpanded:s,extension:l}=e;let a;return o.icon!==void 0?a=o.icon:n?a=s&&r?.directoryExpanded||r?.directory||T.jsx(ge.FolderIcon,{className:"h-4 w-4"}):l&&r?.fileByExtension?.[l]?a=r.fileByExtension[l]:a=r?.file||(l==="md"?T.jsx(ge.DocumentTextIcon,{className:"h-4 w-4"}):T.jsx(Ze.FileIcon,{className:"h-4 w-4"})),ke(typeof a=="function"?a(e):a,o.absolutePath)},Se=u.memo(({entry:e,indentLevel:r,rowHeight:o,isDirOpen:n,parentIsLast:s,renderChildren:l=!0,expansion:{toggleDirectory:a,onToggleDirectoryRecursive:h},selection:{onEntryClick:_,selectedPath:I,mode:c="none",selectedItems:y,onSelectionChange:p},visual:{iconOverrides:w,showExpandIcons:k=!0,showDirectoryIcons:i=!0,showFileIcons:d=!0,useCanvasExpandIcons:b=!1,expandIconSize:P,highlightStyles:v,entryClassName:E,entryStyle:f,nameClassName:M,nameStyle:N,directoryNameClassName:j,directoryNameStyle:X,fileNameClassName:z,fileNameStyle:U}})=>{const $=u.useRef(null),[V,Z]=u.useState(null),[q,ne]=u.useState(!1);u.useEffect(()=>()=>{$.current&&window.clearTimeout($.current)},[]);const S=e.children!==void 0,D=S&&n(e.absolutePath),L=e.absolutePath===I,A=!S&&y?.has(e.absolutePath),t=S?void 0:ft(e.name);u.useEffect(()=>{Z(D&&e.children?e.children:null)},[D,e.children]);const m=u.useCallback(W=>{W.stopPropagation(),c!=="none"&&!S&&p&&p(e,!A);let le=!1;_({entry:e,isDirectory:S,isExpanded:D,preventDefault:()=>{le=!0}}),!(!S||le)&&($.current?(window.clearTimeout($.current),$.current=null,h(e)):$.current=window.setTimeout(()=>{a(e.absolutePath),$.current=null},500))},[S,e,D,h,a,_,c,p,A]),x=q?v?.hoverClassName!==void 0?v.hoverClassName:Y.entryHover:"",R=(()=>{if(S){if(L)return v?.directorySelectedClassName!==void 0?v.directorySelectedClassName:Y.entrySelected}else if(L||A)return v?.itemSelectedClassName!==void 0?v.itemSelectedClassName:B.twMerge(L&&Y.entrySelected,A&&Y.entryItemSelected);return""})(),ee=B.twMerge(Y.entry,x,R,E,e.className),Q=B.twMerge(Y.expandIcon,(L||A)&&Y.expandIconSelected),C=B.twMerge(Y.typeIcon,(L||A)&&Y.typeIconSelected),G=B.twMerge(Y.name,M,S&&Y.nameDirectory,S&&j,!S&&z,(L||A)&&Y.nameSelected),te=dt({isDirectory:S,isExpanded:D,showExpandIcons:k,useCanvasExpandIcons:b,expandIconSize:P}),oe=(S?i:d)?ht({entry:e,isDirectory:S,isExpanded:D,isSelected:L,isItemSelected:!!A,extension:t},w):null,ve={...q?v?.hoverStyle:{},...S&&L?v?.directorySelectedStyle:{},...!S&&(L||A)?v?.itemSelectedStyle:{}};return T.jsxs(u.Fragment,{children:[T.jsxs("div",{className:ee,style:{paddingLeft:`${Math.max(0,r*de)}px`,transform:r<0?`translateX(${r*de}px)`:void 0,width:r<0?`calc(100% + ${Math.abs(r*de)}px)`:void 0,height:`${o}px`,...ve,...f,...e.style},"data-entry-type":S?"directory":"file","data-entry-expanded":S?String(D):void 0,"data-entry-selected":L?"true":void 0,"data-entry-item-selected":A?"true":void 0,onClick:m,onMouseEnter:()=>ne(!0),onMouseLeave:()=>ne(!1),onKeyDown:W=>W.key==="Enter"&&m(W),tabIndex:0,role:"treeitem","aria-expanded":S?D:void 0,"aria-label":`${e.name} (${S?"directory":"file"})`,children:[(k||b)&&T.jsx("span",{className:Q,children:te}),(S?i:d)&&T.jsx("span",{className:C,children:oe}),T.jsx("span",{className:G,style:{...N,...S?X:U},"data-entry-type":S?"directory":"file","data-entry-role":"name",children:e.label??e.name})]}),D&&V&&l&&T.jsx("fieldset",{children:V.map((W,le)=>T.jsx(Se,{entry:W,indentLevel:r+1,rowHeight:o,isDirOpen:n,parentIsLast:[...s,le===V.length-1],expansion:{toggleDirectory:a,onToggleDirectoryRecursive:h},selection:{onEntryClick:_,selectedPath:I,mode:c,selectedItems:y,onSelectionChange:p},visual:{iconOverrides:w,showExpandIcons:k,showDirectoryIcons:i,showFileIcons:d,useCanvasExpandIcons:b,expandIconSize:P,highlightStyles:v,entryClassName:E,entryStyle:f,nameClassName:M,nameStyle:N,directoryNameClassName:j,directoryNameStyle:X,fileNameClassName:z,fileNameStyle:U}},W.absolutePath))})]},e.absolutePath)},(e,r)=>{if(e.entry!==r.entry)return!1;const o=e.entry.children!==void 0,n=r.entry.children!==void 0,s=o&&e.isDirOpen(e.entry.absolutePath),l=n&&r.isDirOpen(r.entry.absolutePath);return e.indentLevel===r.indentLevel&&e.rowHeight===r.rowHeight&&s===l&&e.selection.selectedPath===r.selection.selectedPath&&e.selection.mode===r.selection.mode&&e.selection.selectedItems===r.selection.selectedItems&&e.visual.iconOverrides===r.visual.iconOverrides&&e.visual.showExpandIcons===r.visual.showExpandIcons&&e.visual.showDirectoryIcons===r.visual.showDirectoryIcons&&e.visual.showFileIcons===r.visual.showFileIcons&&e.visual.useCanvasExpandIcons===r.visual.useCanvasExpandIcons&&e.visual.expandIconSize===r.visual.expandIconSize&&e.visual.highlightStyles===r.visual.highlightStyles&&e.visual.entryClassName===r.visual.entryClassName&&e.visual.entryStyle===r.visual.entryStyle&&e.visual.nameClassName===r.visual.nameClassName&&e.visual.nameStyle===r.visual.nameStyle&&e.visual.directoryNameClassName===r.visual.directoryNameClassName&&e.visual.directoryNameStyle===r.visual.directoryNameStyle&&e.visual.fileNameClassName===r.visual.fileNameClassName&&e.visual.fileNameStyle===r.visual.fileNameStyle&&e.parentIsLast.length===r.parentIsLast.length&&e.parentIsLast.every((a,h)=>a===r.parentIsLast[h])});Se.displayName="DirectoryEntryItem";const be=20,de=16,De=12,Fe=e=>{const r=[];if(e.children)for(const o of e.children)o.type==="directory"&&(r.push(o.absolutePath),r.push(...Fe(o)));return r},yt=({entries:e,expansion:{toggle:r,isExpanded:o,expandMultiple:n,collapseMultiple:s,isPending:l,alwaysExpanded:a=!1,doubleClickAction:h="recursive"},selection:{onEntryClick:_,selectedPath:I,mode:c="none",selectedItems:y,onSelectionChange:p},visual:{className:w,style:k,lineColor:i="#A0AEC0",showTreeLines:d=!0,showExpandIcons:b=!0,showDirectoryIcons:P=!0,showFileIcons:v=!0,iconOverrides:E,expandIconSize:f,itemHeight:M=be,removeRootIndent:N=!1,highlightStyles:j,entryClassName:X,entryStyle:z,nameClassName:U,nameStyle:$,directoryNameClassName:V,directoryNameStyle:Z,fileNameClassName:q,fileNameStyle:ne}={},virtualScroll:S})=>{const[D,L]=u.useState(!1),A=u.useRef(null),t=u.useRef(null),[m,x]=u.useState(0),[R,ee]=u.useState(null),{overscanCount:Q=15,className:C,background:G,onScroll:te,onRangeChange:oe,initialScrollIndex:ve,initialScrollOffset:W,callbackThrottleMs:le=5,contentInsets:He,onItemFocus:Ye,viewportHeightOverride:J,scrollBarOptions:Be,behaviorOptions:We}=S??{},[fe,Ie]=u.useState(typeof W=="number"?W:0),Xe=u.useCallback((g,F)=>{Ie(g),te?.(g,F)},[te]),Ve=u.useCallback(g=>{const{renderingStartIndex:F,renderingEndIndex:H}=g;ee(O=>O&&O.renderStart===F&&O.renderEnd===H?O:{renderStart:F,renderEnd:H}),oe?.(g)},[oe]);u.useEffect(()=>{typeof W=="number"&&Ie(W)},[W]),u.useEffect(()=>{L(!0),it()},[]),u.useEffect(()=>{if(typeof J=="number"){x(O=>Math.abs(O-J)>1?J:O);return}const g=A.current;if(!g)return x(0);(()=>{const O=g.clientHeight;x(ae=>Math.abs(ae-O)>1?O:ae)})();const H=new ResizeObserver(O=>{for(const ae of O)ae.target===g&&x(xe=>Math.abs(xe-ae.contentRect.height)>1?ae.contentRect.height:xe)});return H.observe(g),()=>H.disconnect()},[J]);const se=typeof J=="number"?J:m,ie=u.useCallback(g=>a||(D?o(g):!1),[D,o,a]),Re=B.twMerge(Y.container,l&&Y.containerPending,w),_e=u.useMemo(()=>({...lt,...k??{},...typeof J=="number"?{height:J,minHeight:J}:{}}),[k,J]),qe=u.useCallback((g,F)=>{const H=[g.absolutePath,...Fe(g)],O=F||h;if(H.every(we=>ie(we)))return s(H);if(H.every(we=>!ie(we))||O==="recursive")return n(H);if(O==="toggle")return s(H);console.warn(`[DirectoryTree] Unknown double click action: ${O}. No action taken.`)},[ie,n,s,h]),{flatItems:Ce,lineItems:Ee,maxIndent:Te}=u.useMemo(()=>ct(e,ie,d,N),[e,ie,d,N]),K=u.useMemo(()=>Ce.map((g,F)=>{const H=typeof M=="function"?M(g.entry,F):M;return{...g,rowHeight:Number.isFinite(H)&&H>0?H:be}}),[Ce,M]),re=u.useMemo(()=>K.map(g=>g.rowHeight),[K]),me=u.useMemo(()=>{const g=new Array(re.length+1);g[0]=0;for(let F=0;F<re.length;F++)g[F+1]=g[F]+re[F];return g},[re]),Ge=u.useCallback(g=>K[g]?.rowHeight??be,[K]),he=u.useMemo(()=>!d||Ee.length===0?{segmentsByItem:[],glyphsByItem:[]}:mt(Ee,re,me,de,d,f??De),[Ee,re,me,d,f]),ye=u.useMemo(()=>!d||e.length===0?0:(Te+2)*de,[e.length,Te,d]),{renderStart:Ne,renderEnd:Me,lookaheadEnd:Pe}=u.useMemo(()=>ut(K.length,se,Q,R,fe,me),[K.length,se,Q,R,fe,me]),Je=u.useMemo(()=>!d||ye<=0||se<=0||he.segmentsByItem.length===0?null:T.jsx("div",{className:"pointer-events-none absolute inset-0 z-0","aria-hidden":"true",children:T.jsx("div",{className:"absolute top-0 left-0",style:{width:ye,height:se},children:T.jsx(Le,{segmentsByItem:he.segmentsByItem,glyphsByItem:he.glyphsByItem,itemHeight:re[0]??be,width:ye,viewportHeight:se,scrollPosition:fe,color:i,expandGlyphColor:i,expandGlyphSize:f??De,renderStartIndex:Ne,renderEndIndex:Me,lookaheadEndIndex:Pe})})}),[ye,se,Ne,Me,Pe,fe,he,i,d,f,re]),ze=u.useCallback(g=>K[g],[K]);return e.length===0?T.jsx("div",{className:Re,style:_e}):T.jsx("div",{ref:A,className:Re,style:_e,role:"tree",children:T.jsx(Ue.VirtualScroll,{ref:t,itemCount:K.length,getItem:ze,getItemHeight:Ge,viewportSize:se,overscanCount:Q,onScroll:Xe,onRangeChange:Ve,className:C,background:T.jsxs(T.Fragment,{children:[Je,G]}),initialScrollIndex:ve,initialScrollOffset:W,onItemFocus:Ye,callbackThrottleMs:le,contentInsets:He,scrollBarOptions:Be,behaviorOptions:We,children:g=>g&&T.jsx(Se,{entry:g.entry,indentLevel:g.indentLevel,rowHeight:g.rowHeight,isDirOpen:ie,parentIsLast:g.parentIsLast,renderChildren:!1,expansion:{toggleDirectory:r,onToggleDirectoryRecursive:qe},selection:{onEntryClick:_,selectedPath:I??null,mode:c,selectedItems:y,onSelectionChange:p},visual:{iconOverrides:E,showExpandIcons:b,showDirectoryIcons:P,showFileIcons:v,useCanvasExpandIcons:d,expandIconSize:f,highlightStyles:j,entryClassName:X,entryStyle:z,nameClassName:U,nameStyle:$,directoryNameClassName:V,directoryNameStyle:Z,fileNameClassName:q,fileNameStyle:ne}},g.entry.absolutePath)})})},pt=({initialExpanded:e=new Set,storageKey:r}={})=>{const[o,n]=u.useTransition(),[s,l]=u.useState(()=>{if(typeof window<"u"&&r)try{const i=window.localStorage.getItem(r);if(i){const d=JSON.parse(i);return new Set(d)}}catch(i){console.error("[useDirectoryTreeState] Error reading from localStorage",i)}return e}),a=u.useCallback(i=>{n(()=>{l(d=>{const b=new Set(d);return i(b),b})})},[]),h=u.useCallback((i,d)=>{a(b=>{for(const P of i)d(b,P)})},[a]);u.useEffect(()=>{if(r&&typeof window<"u")try{window.localStorage.setItem(r,JSON.stringify(Array.from(s)))}catch(i){console.warn(`Error setting localStorage key "${r}":`,i)}},[s,r]);const _=u.useCallback(i=>{h([i],(d,b)=>{d.has(b)?d.delete(b):d.add(b)})},[h]),I=u.useCallback(i=>{h([i],(d,b)=>{d.add(b)})},[h]),c=u.useCallback(i=>{h([i],(d,b)=>{d.delete(b)})},[h]),y=u.useCallback(i=>{h(i,(d,b)=>{d.delete(b)})},[h]),p=u.useCallback(i=>{h(i,(d,b)=>{d.add(b)})},[h]),w=u.useCallback(()=>{a(i=>{i.clear()})},[a]),k=u.useCallback(i=>s.has(i),[s]);return{expanded:s,toggle:_,expand:I,collapse:c,collapseMultiple:y,expandMultiple:p,collapseAll:w,isExpanded:k,isPending:o}};exports.DirectoryTree=yt;exports.directoryTreeClasses=Y;exports.useDirectoryTreeState=pt;