@aiquants/directory-tree 4.2.0 → 4.4.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 +51 -5
- package/dist/DirectoryTree.d.ts +3 -2
- package/dist/DirectoryTreeGrid.d.ts +2 -2
- package/dist/entryRendering.d.ts +5 -3
- package/dist/index.cjs +2 -2
- package/dist/index.js +1158 -1172
- package/dist/rowSizing.d.ts +25 -0
- package/dist/styles/directory-tree.css +1 -1
- package/dist/styles/directory-tree.standalone.css +1 -1
- package/dist/types.d.ts +3 -4
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -164,9 +164,12 @@ The main component for rendering the directory tree.
|
|
|
164
164
|
| `showDirectoryIcons` | `boolean` | No | `true` | Flag indicating whether to render directory type icons |
|
|
165
165
|
| `showFileIcons` | `boolean` | No | `true` | Flag indicating whether to render file type icons |
|
|
166
166
|
| `iconOverrides` | `DirectoryTreeIconOverrides` | No | - | Icon overrides applied globally |
|
|
167
|
-
| `expandIconSize` | `number` | No |
|
|
168
|
-
| `
|
|
169
|
-
| `
|
|
167
|
+
| `expandIconSize` | `number` | No | `8` on the canvas | Size of the expand icon in px: the chevron in the row when `showTreeLines` is `false`, the glyph on the tree-line canvas when it is `true`. While tree lines are drawn it must be greater than 0 and at most 14 (the expand box); otherwise rendering throws a `RangeError` |
|
|
168
|
+
| `typeIconSize` | `number` | No | `14` | Side of the file/folder icon's box in px; the built-in icons grow and shrink with it. See [Sizing](#sizing) |
|
|
169
|
+
| `fontSize` | `number \| string` | No | inherited | Font size of the labels: px, or any CSS font size. See [Sizing](#sizing) |
|
|
170
|
+
| `indentSize` | `number` | No | `12` | Indentation per depth level in px; with tree lines it must lie in the range [Sizing](#sizing) gives |
|
|
171
|
+
| `itemHeight` | `number \| ((entry, index) => number)` | No | `44` | Row height in px, or a function computing the height per entry (variable-height rows). The default makes every row a pointer target of at least 44 × 44 CSS px under every pointer (WCAG 2.5.5). Tree connector lines follow each row's cumulative offset. The number, and every value the function returns, must be a finite number greater than 0; an invalid one (`NaN` / `Infinity` / `0` / negative) throws a `RangeError` at render that names the value (and, for the function, the entry). Memoize the function to keep its identity stable. |
|
|
172
|
+
| `removeRootIndent` | `boolean` | No | `false` | If true, the root rows drop their lead column (the expand box, with its chevron or glyph) and their own connector lines, and every list row moves left by that lead, at most one `indentSize` (see [Sizing](#sizing)). Ignored in grid mode. |
|
|
170
173
|
| `highlightStyles` | `HighlightStyles` | No | - | Highlight styles configuration for hover and selection states |
|
|
171
174
|
| `entryClassName` | `string` | No | - | Additional CSS classes for each entry row |
|
|
172
175
|
| `entryStyle` | `React.CSSProperties` | No | - | Additional inline styles for each entry row |
|
|
@@ -483,8 +486,8 @@ and the tree connector lines both follow each row's resolved height. Memoize the
|
|
|
483
486
|
identity stays stable.
|
|
484
487
|
|
|
485
488
|
At any row height, fixed or variable, the line from an expanded folder to its children starts just
|
|
486
|
-
below the folder's type icon (a 14 px
|
|
487
|
-
connector, so the tree reads as one joined line however tall the rows are. A host that hides
|
|
489
|
+
below the folder's type icon (a `typeIconSize` box, 14 px by default, centred in the row) and runs on
|
|
490
|
+
into the first child's connector, so the tree reads as one joined line however tall the rows are. A host that hides
|
|
488
491
|
directory icons (`showDirectoryIcons: false`) gets the same line: the name takes the icon's place,
|
|
489
492
|
and the line starts just below it.
|
|
490
493
|
|
|
@@ -503,6 +506,49 @@ const itemHeight = useCallback(
|
|
|
503
506
|
<DirectoryTree entries={entries} /* ...required props */ visual={{ itemHeight }} />
|
|
504
507
|
```
|
|
505
508
|
|
|
509
|
+
### Sizing
|
|
510
|
+
|
|
511
|
+
Three settings size the parts of a row in list rows and grid rows alike; omitted, each keeps its default.
|
|
512
|
+
|
|
513
|
+
| Setting | Default | What it sizes |
|
|
514
|
+
| --- | --- | --- |
|
|
515
|
+
| `indentSize` | `12` | The indentation per depth level: a row at depth *d* is padded by *d* × `indentSize` (in grid mode, its name cell). |
|
|
516
|
+
| `typeIconSize` | `14` | The side of the file/folder icon's box. The built-in icons fill the box, so they grow and shrink with it; an icon you supply (`iconOverrides`, `entry.icon`) keeps its own size and is centred in the box. |
|
|
517
|
+
| `fontSize` | inherited | The labels' font size: a number in px or any CSS font size (`'0.875rem'`). Omitted, list rows keep their 12 px labels and grid rows the font size they inherit. Rows keep `itemHeight`. |
|
|
518
|
+
|
|
519
|
+
From its indentation, every row lays out the 14 px expand box (the chevron, or the tree lines'
|
|
520
|
+
glyph), the type icon box, then the label. The tree lines follow these sizes at any row height,
|
|
521
|
+
fixed or per entry: the line of a depth runs under the parents' icons (under their centre whenever
|
|
522
|
+
the glyph fits there, see below), every expand glyph sits on its line inside its own row's expand
|
|
523
|
+
box, and the line from an expanded folder starts just below its icon and runs straight on into its
|
|
524
|
+
children's lines. The font size moves no line:
|
|
525
|
+
the icon box stays centred in the row.
|
|
526
|
+
|
|
527
|
+
With `removeRootIndent`, the root rows give up their lead — the 14 px expand box while expand icons
|
|
528
|
+
or tree lines are shown, nothing otherwise — and every list row moves left by that lead, but by at
|
|
529
|
+
most one `indentSize`. The root's icon (or label) therefore starts at the left edge without being
|
|
530
|
+
clipped, every deeper row keeps its whole expand box, and the root rows draw no chevron. At the
|
|
531
|
+
default indentation (12, narrower than the box) the rows move by 12 and 2 px of the root's empty box
|
|
532
|
+
stay at the left; from 14 up the root's icon touches the left edge. Without an expand box there is
|
|
533
|
+
no lead to drop and the rows stay where they are.
|
|
534
|
+
|
|
535
|
+
The values are checked when the tree renders, and an invalid one throws a `RangeError` that names
|
|
536
|
+
the setting and the value (nothing falls back to a default):
|
|
537
|
+
|
|
538
|
+
- `indentSize` and `typeIconSize` must be finite numbers greater than 0; `fontSize` a finite number
|
|
539
|
+
greater than 0 or a string that is not blank; `itemHeight` a finite number greater than 0, and so
|
|
540
|
+
must every value its function returns (the error then also names the entry).
|
|
541
|
+
- While tree lines are drawn (`showTreeLines`, the default), `indentSize` must also lie from *g* / 2
|
|
542
|
+
to 14 + `typeIconSize` − *g* / 2, where *g* is the glyph (`expandIconSize`, 8 by default, at most
|
|
543
|
+
14): 4 to 24 with the default icon, 4 to 30 with a 20 px icon. Inside that range the line hangs
|
|
544
|
+
from the parent's icon — from its centre when the glyph fits there, otherwise moved toward the
|
|
545
|
+
glyph's box (2 px left of the centre at `indentSize: 8` with a 12 px icon). A tree without lines
|
|
546
|
+
takes any valid indentation.
|
|
547
|
+
|
|
548
|
+
```tsx
|
|
549
|
+
<DirectoryTree entries={entries} /* ...required props */ visual={{ indentSize: 20, typeIconSize: 20, fontSize: 16 }} />
|
|
550
|
+
```
|
|
551
|
+
|
|
506
552
|
### TreeGrid (columns) mode
|
|
507
553
|
|
|
508
554
|
Pass the optional `grid` prop to turn the tree into a **TreeGrid**: the name/tree column
|
package/dist/DirectoryTree.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { directoryTreeClasses } from "./entryRendering.tsx";
|
|
2
|
+
import { TreeLineLayout } from "./rowSizing.ts";
|
|
2
3
|
import { DirectoryTreeProps, TreeLineGeometry, TreeLineItemInfo } from "./types.ts";
|
|
3
|
-
export declare const buildTreeLineGeometry: (items: TreeLineItemInfo[], itemHeights: number[], itemOffsets: number[],
|
|
4
|
-
export declare const DirectoryTree: ({ entries, expansion: { toggle, isExpanded, expandMultiple, collapseMultiple, isPending, alwaysExpanded, doubleClickAction }, selection: { onEntryClick, selectedPath, currentPath, mode: selectionMode, selectedItems, onSelectionChange }, visual: { className, style, ariaLabel, ariaLabelledBy, lineColor, showTreeLines, showExpandIcons, showDirectoryIcons, showFileIcons, iconOverrides, expandIconSize, itemHeight, removeRootIndent, highlightStyles, entryClassName, entryStyle, nameClassName, nameStyle, directoryNameClassName, directoryNameStyle, fileNameClassName, fileNameStyle, expandIconClassName, expandIconStyle, }, virtualScroll: virtualScrollOptions, grid, sort, locale, labels, ref, }: DirectoryTreeProps) => import("react").JSX.Element;
|
|
4
|
+
export declare const buildTreeLineGeometry: (items: TreeLineItemInfo[], itemHeights: number[], itemOffsets: number[], layout: TreeLineLayout) => TreeLineGeometry;
|
|
5
|
+
export declare const DirectoryTree: ({ entries, expansion: { toggle, isExpanded, expandMultiple, collapseMultiple, isPending, alwaysExpanded, doubleClickAction }, selection: { onEntryClick, selectedPath, currentPath, mode: selectionMode, selectedItems, onSelectionChange }, visual: { className, style, ariaLabel, ariaLabelledBy, lineColor, showTreeLines, showExpandIcons, showDirectoryIcons, showFileIcons, iconOverrides, expandIconSize, typeIconSize, fontSize, indentSize, itemHeight, removeRootIndent, highlightStyles, entryClassName, entryStyle, nameClassName, nameStyle, directoryNameClassName, directoryNameStyle, fileNameClassName, fileNameStyle, expandIconClassName, expandIconStyle, }, virtualScroll: virtualScrollOptions, grid, sort, locale, labels, ref, }: DirectoryTreeProps) => import("react").JSX.Element;
|
|
5
6
|
export { directoryTreeClasses };
|
|
@@ -7,9 +7,9 @@ export type GridRowVisual = {
|
|
|
7
7
|
showFileIcons?: boolean;
|
|
8
8
|
useCanvasExpandIcons?: boolean;
|
|
9
9
|
expandIconSize?: number;
|
|
10
|
-
typeIconSize
|
|
10
|
+
typeIconSize: number;
|
|
11
11
|
fontSize?: number | string;
|
|
12
|
-
indentSize
|
|
12
|
+
indentSize: number;
|
|
13
13
|
highlightStyles?: HighlightStyles;
|
|
14
14
|
expandIconClassName?: string;
|
|
15
15
|
expandIconStyle?: CSSProperties;
|
package/dist/entryRendering.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
1
|
+
import { CSSProperties, ReactNode } from "react";
|
|
2
2
|
import { DirectoryEntry, DirectoryTreeIconOverrides, DirectoryTreeIconRenderContext } from "./types.ts";
|
|
3
3
|
export declare const DEFAULT_ITEM_HEIGHT = 44;
|
|
4
4
|
export declare const INDENT_SIZE = 12;
|
|
5
5
|
export declare const EXPAND_GLYPH_SIZE = 8;
|
|
6
|
+
export declare const EXPAND_BOX_SIZE = 14;
|
|
6
7
|
export declare const TYPE_ICON_SIZE = 14;
|
|
8
|
+
export declare const toFontSizeStyle: (fontSize: number | string | undefined) => CSSProperties | undefined;
|
|
7
9
|
export declare const directoryTreeClasses: {
|
|
8
10
|
container: string;
|
|
9
11
|
containerPending: string;
|
|
@@ -32,6 +34,6 @@ export type ExpandIconParams = {
|
|
|
32
34
|
export declare const resolveExpandIcon: ({ isDirectory, isExpanded, showExpandIcons, useCanvasExpandIcons, expandIconSize }: ExpandIconParams) => ReactNode;
|
|
33
35
|
export declare const GENERIC_MIME_TYPES: ReadonlySet<string>;
|
|
34
36
|
export declare const normalizeMimeType: (mimeType: string | undefined) => string;
|
|
35
|
-
export declare const getFileIconByMimeOrExtension: (mimeType
|
|
36
|
-
export declare const resolveEntryIcon: (ctx: DirectoryTreeIconRenderContext, overrides
|
|
37
|
+
export declare const getFileIconByMimeOrExtension: (mimeType: string | undefined, extension: string | undefined, filename: string | undefined, typeIconSize: number) => ReactNode;
|
|
38
|
+
export declare const resolveEntryIcon: (ctx: DirectoryTreeIconRenderContext, overrides: DirectoryTreeIconOverrides | undefined, typeIconSize: number) => ReactNode;
|
|
37
39
|
export declare const toDataAttributes: (data?: Record<string, string | number | boolean>) => Record<string, string> | undefined;
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react"),he=require("@aiquants/virtualscroll"),L=require("tailwind-merge"),le=require("@phosphor-icons/react");function rn(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const ce=rn(l);var ct={exports:{}},Ke={};var br;function nn(){if(br)return Ke;br=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,a,c){var i=null;if(c!==void 0&&(i=""+c),a.key!==void 0&&(i=""+a.key),"key"in a){c={};for(var d in a)d!=="key"&&(c[d]=a[d])}else c=a;return a=c.ref,{$$typeof:e,type:n,key:i,ref:a!==void 0?a:null,props:c}}return Ke.Fragment=t,Ke.jsx=r,Ke.jsxs=r,Ke}var Xe={};var wr;function on(){return wr||(wr=1,process.env.NODE_ENV!=="production"&&(function(){function e(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===$?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case y:return"Fragment";case z:return"Profiler";case v:return"StrictMode";case D:return"Suspense";case F:return"SuspenseList";case K:return"Activity"}if(typeof o=="object")switch(typeof o.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),o.$$typeof){case p:return"Portal";case P:return o.displayName||"Context";case _:return(o._context.displayName||"Context")+".Consumer";case g:var f=o.render;return o=o.displayName,o||(o=f.displayName||f.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case j:return f=o.displayName||null,f!==null?f:e(o.type)||"Memo";case q:f=o._payload,o=o._init;try{return e(o(f))}catch{}}return null}function t(o){return""+o}function r(o){try{t(o);var f=!1}catch{f=!0}if(f){f=console;var C=f.error,I=typeof Symbol=="function"&&Symbol.toStringTag&&o[Symbol.toStringTag]||o.constructor.name||"Object";return C.call(f,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",I),t(o)}}function n(o){if(o===y)return"<>";if(typeof o=="object"&&o!==null&&o.$$typeof===q)return"<...>";try{var f=e(o);return f?"<"+f+">":"<...>"}catch{return"<...>"}}function a(){var o=H.A;return o===null?null:o.getOwner()}function c(){return Error("react-stack-top-frame")}function i(o){if(ue.call(o,"key")){var f=Object.getOwnPropertyDescriptor(o,"key").get;if(f&&f.isReactWarning)return!1}return o.key!==void 0}function d(o,f){function C(){we||(we=!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)",f))}C.isReactWarning=!0,Object.defineProperty(o,"key",{get:C,configurable:!0})}function w(){var o=e(this.type);return Y[o]||(Y[o]=!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.")),o=this.props.ref,o!==void 0?o:null}function S(o,f,C,I,pe,T){var O=C.ref;return o={$$typeof:b,type:o,key:f,props:C,_owner:I},(O!==void 0?O:null)!==null?Object.defineProperty(o,"ref",{enumerable:!1,get:w}):Object.defineProperty(o,"ref",{enumerable:!1,value:null}),o._store={},Object.defineProperty(o._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(o,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(o,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:pe}),Object.defineProperty(o,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:T}),Object.freeze&&(Object.freeze(o.props),Object.freeze(o)),o}function x(o,f,C,I,pe,T){var O=f.children;if(O!==void 0)if(I)if(X(O)){for(I=0;I<O.length;I++)R(O[I]);Object.freeze&&Object.freeze(O)}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 R(O);if(ue.call(f,"key")){O=e(o);var Z=Object.keys(f).filter(function(Re){return Re!=="key"});I=0<Z.length?"{key: someKey, "+Z.join(": ..., ")+": ...}":"{key: someKey}",me[O+I]||(Z=0<Z.length?"{"+Z.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} />`,P,A,te,A),se[A+P]=!0)}if(A=null,p!==void 0&&(r(p),A=""+p),i(g)&&(r(g.key),A=""+g.key),"key"in g){p={};for(var me in g)me!=="key"&&(p[me]=g[me])}else p=g;return A&&u(p,typeof n=="function"?n.displayName||n.name||"Unknown":n),S(n,A,p,a(),B,he)}function m(n){y(n)?n._store&&(n._store.validated=1):typeof n=="object"&&n!==null&&n.$$typeof===j&&(n._payload.status==="fulfilled"?y(n._payload.value)&&n._payload.value._store&&(n._payload.value._store.validated=1):n._store&&(n._store.validated=1))}function y(n){return typeof n=="object"&&n!==null&&n.$$typeof===T}var E=l,T=Symbol.for("react.transitional.element"),h=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),F=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),_=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),G=Symbol.for("react.suspense"),V=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),Q=Symbol.for("react.activity"),$=Symbol.for("react.client.reference"),D=E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=Object.prototype.hasOwnProperty,ee=Array.isArray,oe=console.createTask?console.createTask:function(){return null};E={react_stack_bottom_frame:function(n){return n()}};var U,ce={},fe=E.react_stack_bottom_frame.bind(E,c)(),W=oe(o(c)),se={};ze.Fragment=x,ze.jsx=function(n,g,p){var P=1e4>D.recentlyCreatedOwnerStacks++;return v(n,g,p,!1,P?Error("react-stack-top-frame"):fe,P?oe(o(n)):W)},ze.jsxs=function(n,g,p){var P=1e4>D.recentlyCreatedOwnerStacks++;return v(n,g,p,!0,P?Error("react-stack-top-frame"):fe,P?oe(o(n)):W)}})()),ze}var hr;function qr(){return hr||(hr=1,process.env.NODE_ENV==="production"?at.exports=Xr():at.exports=Jr()),at.exports}var f=qr();function Zr({title:e,titleId:t,...r},o){return de.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":t},r),e?de.createElement("title",{id:t},e):null,de.createElement("path",{fillRule:"evenodd",d:"M12.53 16.28a.75.75 0 0 1-1.06 0l-7.5-7.5a.75.75 0 0 1 1.06-1.06L12 14.69l6.97-6.97a.75.75 0 1 1 1.06 1.06l-7.5 7.5Z",clipRule:"evenodd"}))}const Qr=de.forwardRef(Zr);function en({title:e,titleId:t,...r},o){return de.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":t},r),e?de.createElement("title",{id:t},e):null,de.createElement("path",{fillRule:"evenodd",d:"M16.28 11.47a.75.75 0 0 1 0 1.06l-7.5 7.5a.75.75 0 0 1-1.06-1.06L14.69 12 7.72 5.03a.75.75 0 0 1 1.06-1.06l7.5 7.5Z",clipRule:"evenodd"}))}const tn=de.forwardRef(en);function rn({title:e,titleId:t,...r},o){return de.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":t},r),e?de.createElement("title",{id:t},e):null,de.createElement("path",{d:"M19.5 21a3 3 0 0 0 3-3v-4.5a3 3 0 0 0-3-3h-15a3 3 0 0 0-3 3V18a3 3 0 0 0 3 3h15ZM1.5 10.146V6a3 3 0 0 1 3-3h5.379a2.25 2.25 0 0 1 1.59.659l2.122 2.121c.14.141.331.22.53.22H19.5a3 3 0 0 1 3 3v1.146A4.483 4.483 0 0 0 19.5 9h-15a4.483 4.483 0 0 0-3 1.146Z"}))}const nn=de.forwardRef(rn),lt=44,ct=12,mr=8,_t=14,O={container:"directory-tree-container relative h-full transition-opacity duration-300 overflow-y-hidden pb-[3px] pr-[2px]",containerPending:"opacity-70",entry:"directory-tree-entry flex items-center cursor-pointer relative select-none text-xs leading-tight py-0.5",entryHover:M.twMerge("directory-tree-entry--hover hover:bg-gray-400/15","dark:hover:bg-gray-200/10"),entrySelected:M.twMerge("directory-tree-entry--selected bg-blue-400/10","dark:bg-blue-400/15"),entryItemSelected:M.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:M.twMerge("directory-tree-expand-icon w-3.5 h-3.5 flex-shrink-0 flex items-center justify-center","text-gray-500","dark:text-gray-400"),expandIconSelected:M.twMerge("directory-tree-expand-icon--selected text-blue-700","dark:text-blue-400"),typeIcon:M.twMerge("directory-tree-type-icon flex-shrink-0 flex items-center justify-center","text-gray-500","dark:text-gray-400"),typeIconSelected:M.twMerge("directory-tree-type-icon--selected text-blue-700","dark:text-blue-400"),name:M.twMerge("directory-tree-name overflow-hidden text-ellipsis whitespace-nowrap ml-1 text-xs font-normal","text-gray-700","dark:text-gray-200"),nameDirectory:"directory-tree-name--directory font-medium",nameSelected:M.twMerge("directory-tree-name--selected text-blue-800 font-semibold","dark:text-blue-300")},Nt=e=>{const t=e.slice(e.lastIndexOf("/")+1),r=t.lastIndexOf(".");return r<=0?"":t.slice(r+1).toLowerCase()},on=/^[a-z][a-z\d+.-]*:\/\//i,pr=e=>Nt(on.test(e)?e.split(/[?#]/,1)[0]:e),Sr=e=>Nt(e.name)||pr(e.relativePath)||pr(e.absolutePath),Rr=({isDirectory:e,isExpanded:t,showExpandIcons:r,useCanvasExpandIcons:o,expandIconSize:a})=>{const c=a?{width:a,height:a}:void 0,i=a?"":"h-4 w-4";return!(r&&e)||o?f.jsx("span",{className:i,style:c,"aria-hidden":"true"}):t?f.jsx(Qr,{className:i,style:c}):f.jsx(tn,{className:i,style:c})},kt=(e,t)=>{if(e==null||typeof e=="boolean")return null;if(typeof e=="function")return console.warn(`[DirectoryTree] Function returned by renderer for "${t}". Return a node.`),null;if(typeof e=="object"){if("then"in e)return console.warn(`[DirectoryTree] Promise returned for "${t}". Not supported.`),null;if(Array.isArray(e)){const o=e.map(a=>kt(a,t)).filter(Boolean);return o.length?o:null}const r=e.type;if(r&&r.$$typeof===Symbol.for("react.lazy"))return console.warn(`[DirectoryTree] Lazy component for "${t}". Not supported.`),null}return e},sn={markdown:()=>f.jsx(le.FileMd,{className:"h-4 w-4 text-sky-500 dark:text-sky-400"}),pdf:()=>f.jsx(le.FilePdf,{className:"h-4 w-4 text-red-500 dark:text-red-400"}),spreadsheet:()=>f.jsx(le.FileXls,{className:"h-4 w-4 text-emerald-600 dark:text-emerald-400"}),csv:()=>f.jsx(le.FileCsv,{className:"h-4 w-4 text-emerald-600 dark:text-emerald-400"}),document:()=>f.jsx(le.FileDoc,{className:"h-4 w-4 text-blue-600 dark:text-blue-400"}),presentation:()=>f.jsx(le.FilePpt,{className:"h-4 w-4 text-orange-500 dark:text-orange-400"}),image:()=>f.jsx(le.FileImage,{className:"h-4 w-4 text-teal-500 dark:text-teal-400"}),audio:()=>f.jsx(le.FileAudio,{className:"h-4 w-4 text-pink-500 dark:text-pink-400"}),video:()=>f.jsx(le.FileVideo,{className:"h-4 w-4 text-violet-500 dark:text-violet-400"}),archive:()=>f.jsx(le.FileZip,{className:"h-4 w-4 text-amber-500 dark:text-amber-400"}),code:()=>f.jsx(le.FileCode,{className:"h-4 w-4 text-purple-500 dark:text-purple-400"}),text:()=>f.jsx(le.FileText,{className:"h-4 w-4 text-gray-500 dark:text-gray-400"})},an={markdown:["md","markdown","mdx"],pdf:["pdf"],spreadsheet:["xls","xlsx","xlsm","xlsb","ods"],csv:["csv","tsv"],document:["doc","docx","rtf","odt"],presentation:["ppt","pptx","odp"],image:["png","jpg","jpeg","gif","svg","webp","ico","bmp","tiff","avif"],audio:["mp3","wav","ogg","m4a","flac","aac","wma"],video:["mp4","webm","mov","avi","mkv","wmv","flv"],archive:["zip","tar","gz","7z","rar","tgz","bz2"],code:["js","mjs","cjs","ts","tsx","jsx","json","html","htm","css","scss","py","go","rs","c","cpp","h","hpp","sh","bash","yaml","yml","sql","xml","toml"],text:["txt","log"]},ln=new Map(Object.entries(an).flatMap(([e,t])=>t.map(r=>[r,e]))),cn=new Set(["","application/octet-stream","binary/octet-stream","text/plain","application/x-empty"]),un=e=>(e??"").split(";",1)[0].trim().toLowerCase(),dn=e=>{if(e==="text/markdown"||e==="text/x-markdown")return"markdown";if(e==="application/pdf")return"pdf";if(e.includes("excel")||e.includes("spreadsheet"))return"spreadsheet";if(e==="text/csv"||e==="text/tab-separated-values")return"csv";if(e.includes("word")||e.includes("google-apps.document")||e==="application/rtf")return"document";if(e.includes("powerpoint")||e.includes("presentation"))return"presentation";if(e.startsWith("image/"))return"image";if(e.startsWith("audio/"))return"audio";if(e.startsWith("video/"))return"video";if(e.includes("zip")||e.includes("tar")||e.includes("compressed")||e.includes("archive"))return"archive";if(e==="application/json"||e.includes("javascript")||e.includes("typescript")||e.includes("xml")||e.startsWith("text/html")||e.startsWith("text/css")||e.includes("x-python")||e.includes("x-sh")||e.includes("x-go")||e.includes("x-rust"))return"code";if(e.startsWith("text/"))return"text"},fn=(e,t,r)=>{const o=un(e),a=dn(o),c=ln.get((t||(r?Nt(r):"")).toLowerCase()),u=(cn.has(o)?[c,a]:[a,c]).find(I=>I!==void 0);return u===void 0?f.jsx(le.FileIcon,{className:"h-4 w-4 text-gray-400 dark:text-gray-400"}):sn[u]()},kr=(e,t)=>{const{entry:r,isDirectory:o,isExpanded:a,extension:c,mimeType:i}=e;let u;const I=i||r.mimeType;return r.icon!==void 0?u=r.icon:o?u=a&&t?.directoryExpanded||t?.directory||f.jsx(nn,{className:"h-4 w-4"}):c&&t?.fileByExtension?.[c]?u=t.fileByExtension[c]:u=t?.file||fn(I,c,r.name),kt(typeof u=="function"?u(e):u,r.absolutePath)},hn=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ir=e=>{if(!e)return;const t=Object.entries(e).filter(([,r])=>r!=null);if(t.length!==0)return Object.fromEntries(t.map(([r,o])=>[`data-${hn(r)}`,String(o)]))},mn=500,Cr=({entry:e,isDirectory:t,isExpanded:r,isItemSelected:o,selectionMode:a,onSelectionChange:c,onEntryClick:i,toggleDirectory:u,onToggleDirectoryRecursive:I})=>{const S=l.useRef(null);return l.useEffect(()=>()=>{S.current&&window.clearTimeout(S.current)},[]),l.useCallback(v=>{v.stopPropagation(),a!=="none"&&!t&&c&&c(e,!o);let m=!1;i({entry:e,isDirectory:t,isExpanded:r,preventDefault:()=>{m=!0}}),!(!t||m)&&(S.current?(window.clearTimeout(S.current),S.current=null,I(e)):S.current=window.setTimeout(()=>{u(e.absolutePath),S.current=null},mn))},[t,e,r,I,u,i,a,c,o])},Tr=e=>e==="right"?"dt-grid-cell--right":e==="center"?"dt-grid-cell--center":"",yr=(e,t)=>e.children!==void 0&&t(e.absolutePath),_r=(e,t)=>({width:e,gridTemplateColumns:t}),Nr=l.memo(({entry:e,indentLevel:t,positionInSet:r,setSize:o,rowIndex:a,flatIndex:c,onRowFocus:i,onRowBlur:u,isSelectedForAria:I,rowHeight:S,isDirOpen:v,columns:m,numericTemplate:y,numericTotal:E,nameWidth:T,rowClassName:h,selection:{onEntryClick:x,selectedPath:R,currentPath:F,mode:k="none",selectedItems:_,onSelectionChange:b},expansion:{toggleDirectory:G,onToggleDirectoryRecursive:V},visual:{iconOverrides:N,showExpandIcons:j=!0,showDirectoryIcons:Q=!0,showFileIcons:$=!0,useCanvasExpandIcons:D=!1,expandIconSize:K,typeIconSize:ee=_t,indentSize:oe=ct,highlightStyles:U,expandIconClassName:ce,expandIconStyle:fe}})=>{const[W,se]=l.useState(!1),n=e.children!==void 0,g=n&&v(e.absolutePath),p=e.absolutePath===R,P=e.absolutePath===F,B=!n&&!!_?.has(e.absolutePath),he=n?void 0:Sr(e),A=Cr({entry:e,isDirectory:n,isExpanded:g,isItemSelected:B,selectionMode:k,onSelectionChange:b,onEntryClick:x,toggleDirectory:G,onToggleDirectoryRecursive:V}),te=W?U?.hoverClassName!==void 0?U.hoverClassName:O.entryHover:"",me=(()=>{if(n){if(p)return U?.directorySelectedClassName!==void 0?U.directorySelectedClassName:O.entrySelected}else if(p||B)return U?.itemSelectedClassName!==void 0?U.itemSelectedClassName:M.twMerge(p&&O.entrySelected,B&&O.entryItemSelected);return""})(),ie=typeof h=="function"?h(e):h,_e=M.twMerge("dt-grid-row cursor-pointer select-none",te,me,ie,e.className),Ee=M.twMerge(O.expandIcon,ce,(p||B)&&O.expandIconSelected),ne=M.twMerge(O.typeIcon,(p||B)&&O.typeIconSelected),L=M.twMerge("dt-grid-name-label ml-1","text-gray-700 dark:text-gray-200",n&&O.nameDirectory,(p||B)&&O.nameSelected),ue=Rr({isDirectory:n,isExpanded:g,showExpandIcons:j,useCanvasExpandIcons:D,expandIconSize:K}),q=(n?Q:$)?kr({entry:e,isDirectory:n,isExpanded:g,isSelected:p,isItemSelected:B,extension:he,mimeType:e.mimeType},N):null,Se={indentLevel:t,isDirectory:n,isExpanded:g},[Y,...Ne]=m,Re=Y?.render?Y.render(e,Se):e.label??e.name,ke={...W?U?.hoverStyle:{},...n&&p?U?.directorySelectedStyle:{},...!n&&(p||B)?U?.itemSelectedStyle:{}};return f.jsxs("div",{className:_e,style:{height:S,...ke,...e.style},role:"row","aria-expanded":n?g:void 0,"aria-level":t+1,"aria-posinset":r,"aria-setsize":o,"aria-rowindex":a,"aria-selected":k==="none"?void 0:I,"aria-current":P?"page":void 0,...Ir(e.data),"data-entry-type":n?"directory":"file","data-entry-expanded":n?String(g):void 0,"data-entry-selected":p?"true":void 0,"data-entry-item-selected":B?"true":void 0,onClick:A,onMouseEnter:()=>se(!0),onMouseLeave:()=>se(!1),onFocus:X=>i(c,e.absolutePath,X.currentTarget),onBlur:X=>u(e.absolutePath,X.currentTarget),onKeyDown:X=>{if(X.key==="Enter"){if(X.repeat){X.preventDefault();return}A(X)}},tabIndex:0,children:[f.jsxs("div",{className:M.twMerge("dt-grid-name-cell",Y?.className),role:"gridcell",style:{width:T,paddingLeft:Math.max(0,t*oe)},children:[(j||D)&&f.jsx("span",{className:Ee,style:fe,children:ue}),(n?Q:$)&&f.jsx("span",{className:ne,style:{width:ee,height:ee},children:q}),f.jsx("span",{className:L,children:Re})]}),Ne.length>0&&f.jsx("div",{className:"dt-grid-numeric-viewport",children:f.jsx("div",{className:"dt-grid-numeric-track",style:_r(E,y),children:Ne.map(X=>f.jsx("div",{className:M.twMerge("dt-grid-cell",Tr(X.align),X.className),role:"gridcell",children:X.render?X.render(e,Se):null},X.key))})})]})},(e,t)=>{if(e.entry!==t.entry)return!1;const r=yr(e.entry,e.isDirOpen),o=yr(t.entry,t.isDirOpen);return e.indentLevel===t.indentLevel&&e.positionInSet===t.positionInSet&&e.setSize===t.setSize&&e.rowIndex===t.rowIndex&&e.flatIndex===t.flatIndex&&e.isSelectedForAria===t.isSelectedForAria&&e.rowHeight===t.rowHeight&&r===o&&e.columns===t.columns&&e.numericTemplate===t.numericTemplate&&e.numericTotal===t.numericTotal&&e.nameWidth===t.nameWidth&&e.rowClassName===t.rowClassName&&e.selection.selectedPath===t.selection.selectedPath&&e.selection.currentPath===t.selection.currentPath&&e.selection.mode===t.selection.mode&&e.selection.selectedItems===t.selection.selectedItems&&e.visual===t.visual});Nr.displayName="DirectoryTreeGridRow";const jr=({kind:e,columns:t,numericTemplate:r,numericTotal:o,nameWidth:a,scrollBarWidth:c,className:i,nameContent:u,renderCell:I})=>{const[,...S]=t,v=e==="header"?"dt-grid-name-header":"dt-grid-name-footer",m=e==="header"?"dt-grid-header":"dt-grid-footer",y=e==="header"?"columnheader":"gridcell";return f.jsxs("div",{className:M.twMerge(m,"text-gray-600 dark:text-gray-300",i),role:"row",children:[f.jsx("div",{className:M.twMerge(v,"px-1",t[0]?.className),role:y,style:{width:a},children:u}),S.length>0&&f.jsx("div",{className:"dt-grid-numeric-viewport",children:f.jsx("div",{className:"dt-grid-numeric-track",style:_r(o,r),children:S.map(E=>f.jsx("div",{className:M.twMerge("dt-grid-cell",Tr(E.align),E.className),role:y,children:I(E)},E.key))})}),f.jsx("div",{className:"dt-grid-scrollbar-spacer",style:{width:c},"aria-hidden":"true"})]})},pn=({columns:e,className:t,...r})=>f.jsx(jr,{kind:"header",columns:e,className:t,nameContent:e[0]?.header??null,renderCell:o=>o.header??null,...r}),br=(e,t)=>typeof e=="function"?e(t):e??null,yn=({columns:e,allEntries:t,className:r,...o})=>f.jsx(jr,{kind:"footer",columns:e,className:r,nameContent:br(e[0]?.footer,t),renderCell:a=>br(a.footer,t),...o}),bn=240,Pr=96,Ar=12,It=(e,t)=>{const r=e?.width;return typeof r=="number"&&Number.isFinite(r)&&r>0?r:t},gn=e=>e.slice(1).map(t=>`${It(t,Pr)}px`).join(" "),vn=({measuredWidth:e,columns:t,scrollBarWidth:r=Ar})=>{const o=It(t[0],bn),a=t.slice(1).reduce((I,S)=>I+It(S,Pr),0),c=Number.isFinite(e)&&e>0?e:0,i=Math.max(0,c-o-Math.max(0,r)),u=Math.max(0,a-i);return{nameWidth:o,numericTotal:a,numericVisible:i,maxHScroll:u}},Rt=(e,t)=>!Number.isFinite(e)||e<0?0:e>t?t:e,wn=e=>{const t=[],r=o=>{for(const a of o)t.push(a),a.children&&a.children.length>0&&r(a.children)};return r(e),t},Mr=["entryKindDirectory","entryKindFile"],Ct=[...pe.VIRTUAL_SCROLL_LABEL_KEYS,...Mr],Tt=Object.freeze({en:Object.freeze({entryKindDirectory:"directory",entryKindFile:"file"}),ja:Object.freeze({entryKindDirectory:"ディレクトリ",entryKindFile:"ファイル"})}),Lr=Object.freeze({en:Object.freeze({...pe.VIRTUAL_SCROLL_LABEL_CATALOGS.en,...Tt.en}),ja:Object.freeze({...pe.VIRTUAL_SCROLL_LABEL_CATALOGS.ja,...Tt.ja})}),gr=e=>typeof e=="string"?JSON.stringify(e):e===null?"null":typeof e,xn=e=>{const t={};let r=!1;for(const o of pe.VIRTUAL_SCROLL_LABEL_KEYS){const a=Object.hasOwn(e,o)?e[o]:void 0;a!==void 0&&(t[o]=a,r=!0)}return r?t:void 0},Or=(e,t)=>{const r=pe.resolveVirtualScrollLocale(e);if(t===void 0)return Lr[r];if(t===null||typeof t!="object")throw new RangeError(`[directory-tree] labels must be an object; got ${gr(t)}`);const o=Object.getPrototypeOf(t);if(o!==Object.prototype&&o!==null)throw new RangeError(`[directory-tree] labels must be a plain object (prototype Object.prototype or null); got ${Array.isArray(t)?"an array":"an object with a non-plain prototype"}`);for(const i of Object.keys(t))if(!Ct.includes(i))throw new RangeError(`[directory-tree] labels.${i} is not a known label key; expected one of ${Ct.join(", ")}`);const c={...pe.resolveVirtualScrollLabels(r,xn(t)),...Tt[r]};for(const i of Mr){const u=Object.hasOwn(t,i)?t[i]:void 0;if(u!==void 0){if(typeof u!="string"||u.trim()==="")throw new RangeError(`[directory-tree] labels.${i} must be a non-blank string; got ${gr(u)}`);c[i]=u}}return Object.freeze(c)},En=e=>{const t={};for(const r of pe.VIRTUAL_SCROLL_LABEL_KEYS)t[r]=e[r];return Object.freeze(t)},Sn=()=>{let e=null;return{mark:t=>{const r=t.composedPath();e=r,setTimeout(()=>{e===r&&(e=null)},0)},landedOn:t=>e?.includes(t)===!0}},Rn=(e,t)=>{const r=e.length-1;if(r<=0)return 0;let o=0,a=r-1,c=0;for(;o<=a;){const i=o+a>>>1;e[i]<=t?(c=i,o=i+1):a=i-1}return c},kn=(e,t,r)=>{if(r<=0||e.length===0||t.length!==e.length+1)return null;const o=Rn(t,r),a=e[o];return a?{path:a.entry.absolutePath,offsetInViewport:r-t[o]}:null},In=(e,t,r)=>{if(t.length===0||r.length!==t.length+1)return null;for(let o=0;o<t.length;o++)if(t[o].entry.absolutePath===e.path)return Math.max(0,r[o]+e.offsetInViewport);return null},Cn=(e,t,r)=>{const o=[];for(let a=t;a<r;a++){const c=e[a];if(!(!c||c.length===0))for(const i of c)o.push(i)}return o},Tn=(e,t,r)=>{const o=[];for(let a=t;a<r;a++){const c=e[a];if(!(!c||c.length===0))for(const i of c)o.push(i)}return o},_n=(e,t,r,o)=>{const a=Math.max(1,Math.floor(t*o)),c=Math.max(1,Math.floor(r*o));(e.width!==a||e.height!==c)&&(e.width=a,e.height=c);const i=e.style;i.width!==`${t}px`&&(i.width=`${t}px`),i.height!==`${r}px`&&(i.height=`${r}px`)},Nn=(e,t,r)=>{e.lineWidth=r,e.beginPath();for(const o of t)e.moveTo(o.x1,o.y1),e.lineTo(o.x2,o.y2);e.stroke()},jn=(e,t)=>{const r=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());if(!r)return null;let o=r[1];o.length===3&&(o=o.split("").map(u=>u+u).join(""));const a=Number.parseInt(o.slice(0,2),16),c=Number.parseInt(o.slice(2,4),16),i=Number.parseInt(o.slice(4,6),16);return`rgba(${a}, ${c}, ${i}, ${t})`},Pn=(e,t,r,o)=>{if(t.length===0)return;const a=jn(r,.14),c=e.strokeStyle,i=e.fillStyle,u=e.lineWidth,I=e.lineCap,S=e.lineJoin;e.strokeStyle=r,e.lineCap="round",e.lineJoin="round";for(const v of t){const m=o??v.size,y=Math.max(0,m/2),E=Math.max(1,Math.round(m*.08)),T=Math.max(1,Math.round(m*.14)),h=Math.max(0,y-E*.8),x=Math.max(0,h*.55);a&&(e.fillStyle=a,e.beginPath(),e.arc(v.centerX,v.centerY,h,0,Math.PI*2),e.fill()),e.lineWidth=E,e.beginPath(),e.arc(v.centerX,v.centerY,Math.max(0,y-E*.3),0,Math.PI*2),e.stroke(),e.lineWidth=T,e.beginPath(),e.moveTo(v.centerX-x,v.centerY),e.lineTo(v.centerX+x,v.centerY),e.stroke(),v.isExpanded||(e.beginPath(),e.moveTo(v.centerX,v.centerY-x),e.lineTo(v.centerX,v.centerY+x),e.stroke())}e.strokeStyle=c,e.fillStyle=i,e.lineWidth=u,e.lineCap=I,e.lineJoin=S},Dr=l.memo(({segmentsByItem:e,glyphsByItem:t,itemHeight:r,width:o,viewportHeight:a,scrollPosition:c,color:i="#a0aec0",strokeWidth:u=1,renderStartIndex:I,renderEndIndex:S,lookaheadEndIndex:v,devicePixelRatio:m,expandGlyphColor:y,expandGlyphSize:E})=>{const T=l.useRef(null),h=l.useRef(null),x=l.useRef({segmentsByItem:e,glyphsByItem:t,itemHeight:r,width:o,viewportHeight:a,scrollPosition:c,color:i,strokeWidth:u,renderStartIndex:I,renderEndIndex:S,lookaheadEndIndex:v,devicePixelRatio:m,expandGlyphColor:y,expandGlyphSize:E}),R=l.useCallback(()=>{h.current=null;const k=T.current;if(!k)return;const _=k.getContext("2d");if(!_)return;const b=x.current;if(b.width<=0||b.viewportHeight<=0){_.clearRect(0,0,k.width,k.height);return}const G=Number.isFinite(b.devicePixelRatio??NaN)?b.devicePixelRatio:typeof window<"u"&&window.devicePixelRatio||1;_n(k,b.width,b.viewportHeight,G);const V=b.segmentsByItem.length,N=typeof b.renderStartIndex=="number"&&Number.isFinite(b.renderStartIndex)?Math.max(0,Math.floor(b.renderStartIndex)):Math.max(0,Math.floor(b.scrollPosition/b.itemHeight)),j=Math.min(V,Math.ceil((b.scrollPosition+b.viewportHeight)/b.itemHeight)),Q=(()=>{if(typeof b.renderEndIndex=="number"&&Number.isFinite(b.renderEndIndex)){const ee=Math.floor(b.renderEndIndex);return Math.max(Math.min(V,ee+1),N)}return Math.max(j,N)})(),$=(()=>{if(typeof b.lookaheadEndIndex=="number"&&Number.isFinite(b.lookaheadEndIndex)){const ee=Math.floor(b.lookaheadEndIndex),oe=Math.min(V,ee+1);return Math.max(oe,Q)}return Math.max(j,Q)})(),D=Cn(b.segmentsByItem,N,$),K=Tn(b.glyphsByItem,N,$);_.save(),_.scale(G,G),_.clearRect(0,0,b.width,b.viewportHeight),_.translate(0,-b.scrollPosition),_.strokeStyle=b.color,Nn(_,D,b.strokeWidth),Pn(_,K,b.expandGlyphColor??b.color,b.expandGlyphSize),_.restore()},[]),F=l.useCallback(()=>{h.current===null&&(h.current=window.requestAnimationFrame(R))},[R]);return l.useEffect(()=>{x.current={segmentsByItem:e,glyphsByItem:t,itemHeight:r,width:o,viewportHeight:a,scrollPosition:c,color:i,strokeWidth:u,renderStartIndex:I,renderEndIndex:S,lookaheadEndIndex:v,devicePixelRatio:m,expandGlyphColor:y,expandGlyphSize:E},F()},[e,t,r,o,a,c,i,u,I,S,v,m,y,E,F]),l.useEffect(()=>()=>{h.current!==null&&(window.cancelAnimationFrame(h.current),h.current=null)},[]),f.jsx("canvas",{ref:T,className:"pointer-events-none absolute top-0 left-0 z-0"})});Dr.displayName="TreeLineCanvas";const An=e=>{const t=new Map;for(let r=0;r<e.length;r++){const o=e[r].entry.absolutePath;t.has(o)||t.set(o,r)}return t},vr=(e,t)=>e.selectedPath===t?e:{selectedPath:t,selectionGeneration:e.selectionGeneration+1,anchor:e.anchor},Mn=(e,t)=>({...e,anchor:{path:t,selectionGeneration:e.selectionGeneration,focused:!0}}),Ln=(e,t)=>{const{anchor:r,selectionGeneration:o,selectedPath:a}=t;if(r!==null&&(r.focused||r.selectionGeneration===o)){const c=e.get(r.path);if(c!==void 0)return c}if(a!==null){const c=e.get(a);if(c!==void 0)return c}return 0},On={msOverflowStyle:"none",scrollbarWidth:"none"},Dn=()=>{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))},Fn=e=>{const t=l.useRef(null),r=t.current;return r!==null&&pe.VIRTUAL_SCROLL_LABEL_KEYS.every(o=>r[o]===e[o])?r:(t.current=e,e)},wr=new Set(["top","bottom","center","nearest"]),xr=e=>{const t=e?.align;if(t===void 0)return"top";if(!wr.has(t))throw new RangeError(`[directory-tree] Unsupported scroll alignment ${JSON.stringify(t)}; expected one of ${[...wr].join(", ")}.`);return t},$n={position:"absolute",width:1,height:1,margin:-1,padding:0,border:0,overflow:"hidden",clipPath:"inset(50%)",whiteSpace:"nowrap"},Bn=(e,t,r,o,a)=>{const c=[],i=[];let u=0;const I=(S,v,m)=>{const y=a?[...S].sort(a):S;for(let E=0;E<y.length;E++){const T=y[E],h=E===y.length-1,x=[...m,h],R=T.children!==void 0,F=R&&t(T.absolutePath,T.relativePath);let k=v,_=x,b=m;o&&(k=v-1,_=x.slice(1),b=m.slice(1)),c.push({entry:T,indentLevel:k,depth:v,positionInSet:E+1,setSize:y.length,parentIsLast:_}),r&&(k>u&&(u=k),i.push({id:T.absolutePath,name:T.name,absolutePath:T.absolutePath,indentLevel:k,isLastChild:h,isDirectory:R,isExpanded:F,ancestorIsLast:[...b],hideLines:o&&v===0})),R&&F&&T.children&&I(T.children,v+1,x)}};return I(e,0,[]),{flatItems:c,lineItems:i,maxIndent:u}},Er=(e,t)=>{const r=e.length-1;if(r<=0)return 0;let o=0,a=r-1,c=0;for(;o<=a;){const i=o+a>>>1;e[i]<=t?(c=i,o=i+1):a=i-1}return c},Hn=(e,t,r,o,a,c)=>{const i=o?.renderStart??Math.max(0,Er(c,a)),u=t>0?Er(c,a+t)+r:i+r,I=e>0?Math.min(e-1,Math.max(i,u)):i,S=o?.renderEnd??I,v=e>0?Math.min(e-1,S+r):S;return{renderStart:i,renderEnd:S,lookaheadEnd:v}},Wn=(e,t,r,o,a,c)=>{if(e.length===0)return{segmentsByItem:[],glyphsByItem:[]};const i=Array.from({length:e.length},()=>[]),u=Array.from({length:e.length},()=>[]),I=m=>a?typeof c=="number"&&Number.isFinite(c)&&c>0?c:Math.max(8,Math.min(o*.9,m*.7)):0,S=3,v=m=>m*o+o/2+S;for(let m=0;m<e.length;m++){const y=e[m],E=t[m]??0,T=r[m]??0,h=T+E/2,x=e[m+1],R=h+_t/2,F=T+E,k=x!==void 0&&x.indentLevel===y.indentLevel+1&&R<F?{key:`${y.id}-connector-children`,x1:v(x.indentLevel),y1:R,x2:v(x.indentLevel),y2:F,itemIndex:m}:null;if(y.hideLines){k!==null&&(i[m]=[k]);continue}const _=[],b=I(E),G=b>0?b/2+2:o/1.5;for(let j=0;j<y.indentLevel;j++){if(y.ancestorIsLast[j]??!1)continue;let $=!1;for(let D=m;D<e.length;D++){const K=e[D];if(K.indentLevel>j&&K.ancestorIsLast.length>j&&!K.ancestorIsLast[j]){$=!0;break}if(D>m&&K.indentLevel===j)break}if($){const D=v(j);_.push({key:`${y.id}-ancestor-${j}`,x1:D,y1:T,x2:D,y2:T+E,itemIndex:m})}}const V=y.indentLevel*o,N=v(y.indentLevel);if(m>0&&_.push({key:`${y.id}-connector-top`,x1:N,y1:T,x2:N,y2:y.isDirectory?h-G:h,itemIndex:m}),!y.isDirectory&&y.isLastChild&&_.push({key:`${y.id}-connector-horizontal`,x1:N,y1:h,x2:V+o+S,y2:h,itemIndex:m}),y.isLastChild||(y.isDirectory?_.push({key:`${y.id}-connector-bottom`,x1:N,y1:h+G,x2:N,y2:T+E,itemIndex:m}):_.push({key:`${y.id}-connector-bottom`,x1:N,y1:h,x2:N,y2:T+E,itemIndex:m})),k!==null&&_.push(k),i[m]=_,a&&y.isDirectory){const j=b,Q=N,$=h;u[m]=[{key:`${y.id}-glyph`,itemIndex:m,centerX:Q,centerY:$,size:j,isExpanded:y.isExpanded}]}}return{segmentsByItem:i,glyphsByItem:u}},jt=l.memo(({entry:e,indentLevel:t,depth:r,positionInSet:o,setSize:a,isSelectedForAria:c,flatIndex:i,isActive:u,registerRowRef:I,onNavigationKeyDown:S,onRowFocus:v,onRowBlur:m,rowHeight:y,entryKindDirectory:E,entryKindFile:T,isDirOpen:h,parentIsLast:x,renderChildren:R=!0,expansion:{toggleDirectory:F,onToggleDirectoryRecursive:k},selection:{onEntryClick:_,selectedPath:b,currentPath:G,mode:V="none",selectedItems:N,onSelectionChange:j},visual:{iconOverrides:Q,showExpandIcons:$=!0,showDirectoryIcons:D=!0,showFileIcons:K=!0,useCanvasExpandIcons:ee=!1,expandIconSize:oe,typeIconSize:U=_t,fontSize:ce,indentSize:fe=ct,highlightStyles:W,entryClassName:se,entryStyle:n,nameClassName:g,nameStyle:p,directoryNameClassName:P,directoryNameStyle:B,fileNameClassName:he,fileNameStyle:A,expandIconClassName:te,expandIconStyle:me}})=>{const[ie,_e]=l.useState(null),[Ee,ne]=l.useState(!1),L=e.children!==void 0,ue=L&&h(e.absolutePath),q=e.absolutePath===b,Se=e.absolutePath===G,Y=!L&&N?.has(e.absolutePath),Ne=l.useCallback(z=>I(i,z),[I,i]),Re=L?void 0:Sr(e);l.useEffect(()=>{_e(ue&&e.children?e.children:null)},[ue,e.children]);const ke=Cr({entry:e,isDirectory:L,isExpanded:ue,isItemSelected:!!Y,selectionMode:V,onSelectionChange:j,onEntryClick:_,toggleDirectory:F,onToggleDirectoryRecursive:k}),X=Ee?W?.hoverClassName!==void 0?W.hoverClassName:O.entryHover:"",De=(()=>{if(L){if(q)return W?.directorySelectedClassName!==void 0?W.directorySelectedClassName:O.entrySelected}else if(q||Y)return W?.itemSelectedClassName!==void 0?W.itemSelectedClassName:M.twMerge(q&&O.entrySelected,Y&&O.entryItemSelected);return""})(),Fe=M.twMerge(O.entry,X,De,se,e.className),Ge=M.twMerge(O.expandIcon,te,(q||Y)&&O.expandIconSelected),it=M.twMerge(O.typeIcon,(q||Y)&&O.typeIconSelected),je=M.twMerge(O.name,g,L&&O.nameDirectory,L&&P,!L&&he,(q||Y)&&O.nameSelected),Ve=Rr({isDirectory:L,isExpanded:ue,showExpandIcons:$,useCanvasExpandIcons:ee,expandIconSize:oe}),Ke=(L?D:K)?kr({entry:e,isDirectory:L,isExpanded:ue,isSelected:q,isItemSelected:!!Y,extension:Re,mimeType:e.mimeType},Q):null,Ue={...Ee?W?.hoverStyle:{},...L&&q?W?.directorySelectedStyle:{},...!L&&(q||Y)?W?.itemSelectedStyle:{}},Xe=Ir(e.data),Je={width:U,height:U},$e=ce?{fontSize:typeof ce=="number"?`${ce}px`:ce}:void 0;return f.jsxs(l.Fragment,{children:[f.jsxs("div",{className:Fe,style:{paddingLeft:`${Math.max(0,t*fe)}px`,transform:t<0?`translateX(${t*fe}px)`:void 0,width:t<0?`calc(100% + ${Math.abs(t*fe)}px)`:void 0,height:`${y}px`,...$e,...Ue,...n,...e.style},...Xe,"data-entry-type":L?"directory":"file","data-entry-expanded":L?String(ue):void 0,"data-entry-selected":q?"true":void 0,"data-entry-item-selected":Y?"true":void 0,onClick:ke,onMouseEnter:()=>ne(!0),onMouseLeave:()=>ne(!1),onFocus:z=>v(i,e.absolutePath,z.currentTarget),onBlur:z=>m(e.absolutePath,z.currentTarget),ref:Ne,onKeyDown:z=>{if(z.key==="Enter"||z.key===" "){z.preventDefault(),z.repeat||ke(z);return}S(z,i)},tabIndex:u?0:-1,role:"treeitem","aria-expanded":L?ue:void 0,"aria-level":r+1,"aria-posinset":o,"aria-setsize":a,"aria-selected":V==="none"?void 0:c,"aria-current":Se?"page":void 0,"aria-label":`${e.name} (${L?E:T})`,children:[($||ee)&&f.jsx("span",{className:Ge,style:me,children:Ve}),(L?D:K)&&f.jsx("span",{className:it,style:Je,children:Ke}),f.jsx("span",{className:je,style:{...$e,...p,...L?B:A},"data-entry-type":L?"directory":"file","data-entry-role":"name",children:e.label??e.name})]}),ue&&ie&&R&&f.jsx("fieldset",{children:ie.map((z,be)=>f.jsx(jt,{entry:z,indentLevel:t+1,depth:r+1,positionInSet:be+1,setSize:ie.length,isSelectedForAria:!!N?.has(z.absolutePath),flatIndex:-1,isActive:!1,registerRowRef:I,onNavigationKeyDown:S,onRowFocus:v,onRowBlur:m,rowHeight:y,entryKindDirectory:E,entryKindFile:T,isDirOpen:h,parentIsLast:[...x,be===ie.length-1],expansion:{toggleDirectory:F,onToggleDirectoryRecursive:k},selection:{onEntryClick:_,selectedPath:b,currentPath:G,mode:V,selectedItems:N,onSelectionChange:j},visual:{iconOverrides:Q,showExpandIcons:$,showDirectoryIcons:D,showFileIcons:K,useCanvasExpandIcons:ee,expandIconSize:oe,highlightStyles:W,entryClassName:se,entryStyle:n,nameClassName:g,nameStyle:p,directoryNameClassName:P,directoryNameStyle:B,fileNameClassName:he,fileNameStyle:A,expandIconClassName:te,expandIconStyle:me}},z.absolutePath))})]},e.absolutePath)},(e,t)=>{if(e.entry!==t.entry)return!1;const r=e.entry.children!==void 0,o=t.entry.children!==void 0,a=r&&e.isDirOpen(e.entry.absolutePath),c=o&&t.isDirOpen(t.entry.absolutePath);return e.indentLevel===t.indentLevel&&e.depth===t.depth&&e.positionInSet===t.positionInSet&&e.setSize===t.setSize&&e.isSelectedForAria===t.isSelectedForAria&&e.flatIndex===t.flatIndex&&e.isActive===t.isActive&&e.rowHeight===t.rowHeight&&e.entryKindDirectory===t.entryKindDirectory&&e.entryKindFile===t.entryKindFile&&a===c&&e.selection.selectedPath===t.selection.selectedPath&&e.selection.currentPath===t.selection.currentPath&&e.selection.mode===t.selection.mode&&e.selection.selectedItems===t.selection.selectedItems&&e.visual.iconOverrides===t.visual.iconOverrides&&e.visual.showExpandIcons===t.visual.showExpandIcons&&e.visual.showDirectoryIcons===t.visual.showDirectoryIcons&&e.visual.showFileIcons===t.visual.showFileIcons&&e.visual.useCanvasExpandIcons===t.visual.useCanvasExpandIcons&&e.visual.expandIconSize===t.visual.expandIconSize&&e.visual.highlightStyles===t.visual.highlightStyles&&e.visual.entryClassName===t.visual.entryClassName&&e.visual.entryStyle===t.visual.entryStyle&&e.visual.nameClassName===t.visual.nameClassName&&e.visual.nameStyle===t.visual.nameStyle&&e.visual.directoryNameClassName===t.visual.directoryNameClassName&&e.visual.directoryNameStyle===t.visual.directoryNameStyle&&e.visual.fileNameClassName===t.visual.fileNameClassName&&e.visual.fileNameStyle===t.visual.fileNameStyle&&e.visual.expandIconClassName===t.visual.expandIconClassName&&e.visual.expandIconStyle===t.visual.expandIconStyle&&e.parentIsLast.length===t.parentIsLast.length&&e.parentIsLast.every((i,u)=>i===t.parentIsLast[u])});jt.displayName="DirectoryEntryItem";const Fr=e=>{const t=[];if(e.children)for(const r of e.children)r.type==="directory"&&(t.push(r.absolutePath),t.push(...Fr(r)));return t},Yn=({entries:e,expansion:{toggle:t,isExpanded:r,expandMultiple:o,collapseMultiple:a,isPending:c,alwaysExpanded:i=!1,doubleClickAction:u="recursive"},selection:{onEntryClick:I,selectedPath:S,currentPath:v,mode:m="none",selectedItems:y,onSelectionChange:E},visual:{className:T,style:h,ariaLabel:x,ariaLabelledBy:R,lineColor:F="#A0AEC0",showTreeLines:k=!0,showExpandIcons:_=!0,showDirectoryIcons:b=!0,showFileIcons:G=!0,iconOverrides:V,expandIconSize:N,itemHeight:j=lt,removeRootIndent:Q=!1,highlightStyles:$,entryClassName:D,entryStyle:K,nameClassName:ee,nameStyle:oe,directoryNameClassName:U,directoryNameStyle:ce,fileNameClassName:fe,fileNameStyle:W,expandIconClassName:se,expandIconStyle:n}={},virtualScroll:g,grid:p,sort:P,locale:B,labels:he,ref:A})=>{const te=pe.resolveVirtualScrollLocale(B),me=l.useMemo(()=>Or(B,he),[B,he]),ie=Fn(En(me)),{entryKindDirectory:_e,entryKindFile:Ee}=me,ne=p!==void 0,[L,ue]=l.useState(!1),q=l.useRef(null),Se=l.useRef(null),Y=l.useRef(null),[Ne,Re]=l.useState(0),[ke,X]=l.useState(0),[De,Fe]=l.useState(0),[Ge,it]=l.useState(null),{overscanCount:je=15,className:Ve,background:Ke,onScroll:Ue,onRangeChange:Xe,onScrollAdjust:Je,liveRegion:$e,initialScrollIndex:z,initialScrollOffset:be,initialScrollAnchor:Pt,callbackThrottleMs:At=5,contentInsets:Mt,onItemFocus:Lt,viewportHeightOverride:ae,scrollBarOptions:ut,behaviorOptions:Ot,preserveScrollAnchor:Dt=!1,getItemKey:$r,testId:Ft,contentProps:dt}=g??{},$t=l.useMemo(()=>ne?{...dt,role:"rowgroup"}:{...dt,role:"tree","aria-label":R?void 0:x,"aria-labelledby":R,"aria-multiselectable":m==="multiple"?!0:void 0},[ne,dt,x,R,m]),Bt=l.useMemo(()=>({...Ot,enableKeyboardNavigation:!1}),[Ot]),[qe,Ht]=l.useState(typeof be=="number"?be:0),ft=l.useRef(typeof be=="number"?be:0),Wt=l.useCallback((s,d)=>{ft.current=s,Ht(s),Ue?.(s,d)},[Ue]),Yt=l.useCallback(s=>{const{renderingStartIndex:d,renderingEndIndex:w}=s;it(C=>C&&C.renderStart===d&&C.renderEnd===w?C:{renderStart:d,renderEnd:w}),Xe?.(s)},[Xe]);l.useEffect(()=>{ue(!0),Dn()},[]),l.useEffect(()=>{const s=q.current,d=ne?Se.current:s,w=()=>{if(s){const H=s.clientWidth;X(Z=>Math.abs(Z-H)>1?H:Z)}if(typeof ae=="number")Re(H=>Math.abs(H-ae)>1?ae:H);else if(d){const H=d.clientHeight;Re(Z=>Math.abs(Z-H)>1?H:Z)}};if(!(s||d))return Re(0);w();const C=new ResizeObserver(w);return s&&C.observe(s),d&&d!==s&&C.observe(d),()=>C.disconnect()},[ae,ne]);const Pe=typeof ae=="number"?ae:Ne,ye=l.useCallback(s=>i||(L?r(s):!1),[L,r,i]),zt=M.twMerge(O.container,c&&O.containerPending,T),Gt=l.useMemo(()=>({...On,...h??{},...typeof ae=="number"?{height:ae,minHeight:ae}:{}}),[h,ae]),ht=l.useCallback((s,d)=>{const w=[s.absolutePath,...Fr(s)],C=d||u;if(w.every(ve=>ye(ve)))return a(w);if(w.every(ve=>!ye(ve))||C==="recursive")return o(w);if(C==="toggle")return a(w);console.warn(`[DirectoryTree] Unknown double click action: ${C}. No action taken.`)},[ye,o,a,u]),Vt=ne?!1:Q,{flatItems:Ie,lineItems:mt,maxIndent:Kt}=l.useMemo(()=>Bn(e,ye,k,Vt,P),[e,ye,k,Vt,P]),J=l.useMemo(()=>Ie.map((s,d)=>{const w=typeof j=="function"?j(s.entry,d):j;return{...s,rowHeight:Number.isFinite(w)&&w>0?w:lt}}),[Ie,j]),we=l.useMemo(()=>J.map(s=>s.rowHeight),[J]),Ce=l.useMemo(()=>{const s=new Array(we.length+1);s[0]=0;for(let d=0;d<we.length;d++)s[d+1]=s[d]+we[d];return s},[we]),Ut=l.useCallback(s=>J[s]?.rowHeight??lt,[J]),Br=l.useCallback(s=>J[s]?.entry.absolutePath??s,[J]),Xt=$r??Br,Ae=S??null,pt=v??null,[Jt,Be]=l.useState(()=>({selectedPath:Ae,selectionGeneration:0,anchor:null})),yt=vr(Jt,Ae);yt!==Jt&&Be(s=>vr(s,Ae));const Ze=l.useMemo(()=>An(Ie),[Ie]),Me=l.useMemo(()=>Ln(Ze,yt),[Ze,yt]),He=l.useRef(new Map),Qe=l.useRef(null),[et]=l.useState(Sn),We=l.useRef(null),[Hr,qt]=l.useState(!0),bt=l.useRef(Ie);bt.current=Ie;const Zt=l.useRef(ye);Zt.current=ye;const gt=l.useRef(t);gt.current=t;const Qt=l.useRef(Ze);Qt.current=Ze;const vt=l.useRef(Me);vt.current=Me;const er=l.useRef(Lt);er.current=Lt;const Te=l.useCallback(s=>{const d=Y.current;return!d||d.getViewportSize()<=0?!1:(d.scrollToIndex(s,{align:"nearest"}),!0)},[]),ge=l.useCallback(s=>{const d=He.current.get(s);if(d===void 0){We.current=s,Te(s)||(We.current=null);return}We.current=null,Te(s),d.focus({preventScroll:!0})},[Te]),tr=l.useCallback((s,d)=>{if(d)He.current.set(s,d),We.current===s?(We.current=null,d.focus({preventScroll:!0})):d.contains(d.ownerDocument.activeElement)&&Be(w=>w.anchor===null?w:{...w,anchor:{...w.anchor,focused:!0}});else{const w=He.current.get(s);He.current.delete(s),w?.contains(w.ownerDocument.activeElement)&&Be(C=>C.anchor===null?C:{...C,anchor:{...C.anchor,focused:!1}})}s===vt.current&&qt(d!==null)},[]);l.useLayoutEffect(()=>{qt(He.current.has(Me))},[Me]);const wt=l.useCallback((s,d,w)=>{const C=Qe.current===w;Qe.current=null,C||(Be(H=>Mn(H,d)),et.landedOn(w)||Te(s)),er.current?.(s)},[Te,et]),tt=l.useCallback(s=>et.mark(s.nativeEvent),[et]),xt=l.useCallback((s,d)=>{const{ownerDocument:w}=d;if(!w.hasFocus()&&d.contains(w.activeElement)){Qe.current=d;return}Qe.current=null,Be(C=>C.anchor!==null&&C.anchor.path===s?{...C,anchor:{...C.anchor,focused:!1}}:C)},[]),Wr=l.useCallback(()=>ge(vt.current),[ge]),Et=l.useCallback((s,d)=>{const w=xr(d),C=bt.current.length;if(!Number.isInteger(s)||s<0||s>=C)throw new RangeError(`[directory-tree] scrollToIndex: ${String(s)} is not a row index (${C===0?"the tree has no rows":`expected an integer in 0..${String(C-1)}`}).`);if(w==="nearest"){Te(s);return}Y.current?.scrollToIndex(s,{align:w})},[Te]);l.useImperativeHandle(A,()=>({scrollToIndex:Et,scrollToPath:(s,d)=>{xr(d);const w=Qt.current.get(s);return w===void 0?!1:(Et(w,d),!0)},getScrollAnchor:()=>Y.current?.getScrollAnchor()??null}),[Et]);const rr=l.useCallback((s,d)=>{if(s.altKey||s.ctrlKey||s.metaKey)return;const w=bt.current,C=w.length-1;if(C<0)return;const H=w[d],Z=H?.entry.children!==void 0,ve=Z&&Zt.current(H.entry.absolutePath);switch(s.key){case"ArrowDown":s.preventDefault(),ge(Math.min(d+1,C));break;case"ArrowUp":s.preventDefault(),ge(Math.max(d-1,0));break;case"Home":s.preventDefault(),ge(0);break;case"End":s.preventDefault(),ge(C);break;case"ArrowRight":s.preventDefault(),Z&&!ve?gt.current(H.entry.absolutePath):Z&&d<C&&w[d+1].depth>H.depth&&ge(d+1);break;case"ArrowLeft":{if(s.preventDefault(),Z&&ve){gt.current(H.entry.absolutePath);break}const Kr=H?.depth??0;for(let st=d-1;st>=0;st--)if(w[st].depth<Kr){ge(st);break}break}}},[ge]),rt=l.useMemo(()=>!k||mt.length===0?{segmentsByItem:[],glyphsByItem:[]}:Wn(mt,we,Ce,ct,k,N??mr),[mt,we,Ce,k,N]),nt=l.useMemo(()=>!k||e.length===0?0:(Kt+2)*ct,[e.length,Kt,k]),{renderStart:nr,renderEnd:or,lookaheadEnd:sr}=l.useMemo(()=>Hn(J.length,Pe,je,Ge,qe,Ce),[J.length,Pe,je,Ge,qe,Ce]),St=l.useMemo(()=>!k||nt<=0||Pe<=0||rt.segmentsByItem.length===0?null:f.jsx("div",{className:"pointer-events-none absolute inset-0 z-0","aria-hidden":"true",children:f.jsx("div",{className:"absolute top-0 left-0",style:{width:nt,height:Pe},children:f.jsx(Dr,{segmentsByItem:rt.segmentsByItem,glyphsByItem:rt.glyphsByItem,itemHeight:we[0]??lt,width:nt,viewportHeight:Pe,scrollPosition:qe,color:F,expandGlyphColor:F,expandGlyphSize:N??mr,renderStartIndex:nr,renderEndIndex:or,lookaheadEndIndex:sr})})}),[nt,Pe,nr,or,sr,qe,rt,F,k,N,we]),ar=l.useCallback(s=>J[s],[J]),lr=l.useRef(null);l.useLayoutEffect(()=>{const s=lr.current;if(lr.current={items:J,offsets:Ce},!Dt||!s||s.items===J)return;const d=Y.current,w=d?.getScrollPosition(),C=typeof w=="number"&&w>=0?w:ft.current,H=kn(s.items,s.offsets,C);if(!H)return;const Z=In(H,J,Ce);if(Z===null||Math.abs(Z-C)<1)return;const ve=d?d.scrollTo(Z):Z;ft.current=ve,Ht(ve)},[J,Ce,Dt]);const xe=p?.columns,Le=p?.scrollBarWidth??ut?.width??Ar,re=l.useMemo(()=>xe?vn({measuredWidth:ke,columns:xe,scrollBarWidth:Le}):null,[xe,ke,Le]),ot=l.useMemo(()=>xe?gn(xe):"",[xe]),Yr=l.useMemo(()=>p?.showFooter&&xe?wn(e):[],[p?.showFooter,xe,e]),Oe=re?.maxHScroll??0;l.useEffect(()=>{Fe(s=>Rt(s,Oe))},[Oe]);const cr=l.useCallback(s=>Fe(d=>Rt(d+s,Oe)),[Oe]),ir=l.useMemo(()=>({iconOverrides:V,showExpandIcons:_,showDirectoryIcons:b,showFileIcons:G,useCanvasExpandIcons:k,expandIconSize:N,highlightStyles:$,expandIconClassName:se,expandIconStyle:n}),[V,_,b,G,k,N,$,se,n]),ur=l.useMemo(()=>f.jsx(pe.VirtualScroll,{ref:Y,itemCount:J.length,getItem:ar,getItemHeight:Ut,getItemKey:Xt,testId:Ft,contentProps:$t,locale:te,labels:ie,viewportSize:typeof ae=="number"?ae:void 0,overscanCount:je,onScroll:Wt,onRangeChange:Yt,onScrollAdjust:Je,liveRegion:$e,className:Ve,onWheelHorizontal:ne?cr:void 0,background:f.jsxs(f.Fragment,{children:[ne&&re?f.jsx("div",{className:"pointer-events-none absolute top-0 left-0 z-0 h-full overflow-hidden",style:{width:re.nameWidth},"aria-hidden":"true",children:St}):St,Ke]}),initialScrollIndex:z,initialScrollOffset:be,initialScrollAnchor:Pt,callbackThrottleMs:At,contentInsets:Mt,scrollBarOptions:ut,behaviorOptions:Bt,children:(s,d)=>s?ne&&p&&re?f.jsx(Nr,{entry:s.entry,indentLevel:s.indentLevel,positionInSet:s.positionInSet,setSize:s.setSize,rowIndex:d+(p.showHeader??!0?2:1),flatIndex:d,onRowFocus:wt,onRowBlur:xt,isSelectedForAria:!!y?.has(s.entry.absolutePath),rowHeight:s.rowHeight,isDirOpen:ye,columns:p.columns,numericTemplate:ot,numericTotal:re.numericTotal,nameWidth:re.nameWidth,rowClassName:p.rowClassName,selection:{onEntryClick:I,selectedPath:Ae,currentPath:pt,mode:m,selectedItems:y,onSelectionChange:E},expansion:{toggleDirectory:t,onToggleDirectoryRecursive:ht},visual:ir},s.entry.absolutePath):f.jsx(jt,{entry:s.entry,indentLevel:s.indentLevel,depth:s.depth,positionInSet:s.positionInSet,setSize:s.setSize,isSelectedForAria:!!y?.has(s.entry.absolutePath),flatIndex:d,isActive:d===Me,registerRowRef:tr,onNavigationKeyDown:rr,onRowFocus:wt,onRowBlur:xt,rowHeight:s.rowHeight,entryKindDirectory:_e,entryKindFile:Ee,isDirOpen:ye,parentIsLast:s.parentIsLast,renderChildren:!1,expansion:{toggleDirectory:t,onToggleDirectoryRecursive:ht},selection:{onEntryClick:I,selectedPath:Ae,currentPath:pt,mode:m,selectedItems:y,onSelectionChange:E},visual:{iconOverrides:V,showExpandIcons:_,showDirectoryIcons:b,showFileIcons:G,useCanvasExpandIcons:k,expandIconSize:N,highlightStyles:$,entryClassName:D,entryStyle:K,nameClassName:ee,nameStyle:oe,directoryNameClassName:U,directoryNameStyle:ce,fileNameClassName:fe,fileNameStyle:W,expandIconClassName:se,expandIconStyle:n}},s.entry.absolutePath):null}),[J.length,ar,Ut,Xt,Ft,$t,te,ie,_e,Ee,Me,tr,rr,wt,xt,ae,je,Wt,Yt,Je,$e,Ve,ne,cr,re,St,Ke,z,be,Pt,At,Mt,ut,Bt,p,ot,ye,I,Ae,pt,m,y,E,t,ht,ir,V,_,b,G,k,N,$,D,K,ee,oe,U,ce,fe,W,se,n]);if(!(p&&re))return f.jsxs("div",{ref:q,className:zt,style:Gt,onPointerDownCapture:tt,onMouseDownCapture:tt,children:[Ie.length>0&&!Hr&&f.jsx("span",{tabIndex:0,"data-directory-tree-tab-stop":"",style:$n,onFocus:Wr}),ur]});const zr=p.showHeader??!0,Gr=p.showFooter??!1,Vr={...Gt,"--dt-hscroll":`${De}px`};return f.jsxs("div",{ref:q,className:M.twMerge(zt,"dt-grid"),style:Vr,role:"treegrid","aria-label":R?void 0:x,"aria-labelledby":R,"aria-multiselectable":m==="multiple"?!0:void 0,"aria-rowcount":J.length+(p.showHeader??!0?1:0),onPointerDownCapture:tt,onMouseDownCapture:tt,children:[zr&&f.jsx("div",{role:"rowgroup",children:f.jsx(pn,{columns:p.columns,numericTemplate:ot,numericTotal:re.numericTotal,nameWidth:re.nameWidth,scrollBarWidth:Le,className:p.headerClassName})}),f.jsx("div",{ref:Se,className:"dt-grid-body",children:ur}),Oe>0&&f.jsxs("div",{className:"dt-grid-hscrollbar-row",children:[f.jsx("div",{className:"dt-grid-scrollbar-spacer",style:{width:re.nameWidth},"aria-hidden":"true"}),f.jsx(pe.ScrollBar,{horizontal:!0,contentSize:re.numericTotal,viewportSize:re.numericVisible,scrollPosition:De,scrollBarWidth:Le,locale:te,labels:ie,onScroll:s=>{const d=typeof s=="function"?s(De):s,w=Rt(d,Oe);return Fe(w),w}}),f.jsx("div",{className:"dt-grid-scrollbar-spacer",style:{width:Le},"aria-hidden":"true"})]}),Gr&&f.jsx("div",{role:"rowgroup",children:f.jsx(yn,{columns:p.columns,numericTemplate:ot,numericTotal:re.numericTotal,nameWidth:re.nameWidth,scrollBarWidth:Le,allEntries:Yr,className:p.footerClassName})})]})},zn=({initialExpanded:e=new Set,storageKey:t}={})=>{const[r,o]=l.useTransition(),[a,c]=l.useState(()=>{if(typeof window<"u"&&t)try{const h=window.localStorage.getItem(t);if(h){const x=JSON.parse(h);return new Set(x)}}catch(h){console.error("[useDirectoryTreeState] Error reading from localStorage",h)}return e}),i=l.useCallback(h=>{o(()=>{c(x=>{const R=new Set(x);return h(R),R})})},[]),u=l.useCallback((h,x)=>{i(R=>{for(const F of h)x(R,F)})},[i]);l.useEffect(()=>{if(t&&typeof window<"u")try{window.localStorage.setItem(t,JSON.stringify(Array.from(a)))}catch(h){console.warn(`Error setting localStorage key "${t}":`,h)}},[a,t]);const I=l.useCallback(h=>{u([h],(x,R)=>{x.has(R)?x.delete(R):x.add(R)})},[u]),S=l.useCallback(h=>{u([h],(x,R)=>{x.add(R)})},[u]),v=l.useCallback(h=>{u([h],(x,R)=>{x.delete(R)})},[u]),m=l.useCallback(h=>{u(h,(x,R)=>{x.delete(R)})},[u]),y=l.useCallback(h=>{u(h,(x,R)=>{x.add(R)})},[u]),E=l.useCallback(()=>{i(h=>{h.clear()})},[i]),T=l.useCallback(h=>a.has(h),[a]);return{expanded:a,toggle:I,expand:S,collapse:v,collapseMultiple:m,expandMultiple:y,collapseAll:E,isExpanded:T,isPending:r}};exports.DIRECTORY_TREE_LABEL_CATALOGS=Lr;exports.DIRECTORY_TREE_LABEL_KEYS=Ct;exports.DirectoryTree=Yn;exports.directoryTreeClasses=O;exports.resolveDirectoryTreeLabels=Or;exports.useDirectoryTreeState=zn;
|
|
6
|
+
<%s key={someKey} {...props} />`,I,O,Z,O),me[O+I]=!0)}if(O=null,C!==void 0&&(r(C),O=""+C),i(f)&&(r(f.key),O=""+f.key),"key"in f){C={};for(var de in f)de!=="key"&&(C[de]=f[de])}else C=f;return O&&d(C,typeof o=="function"?o.displayName||o.name||"Unknown":o),S(o,O,C,a(),pe,T)}function R(o){N(o)?o._store&&(o._store.validated=1):typeof o=="object"&&o!==null&&o.$$typeof===q&&(o._payload.status==="fulfilled"?N(o._payload.value)&&o._payload.value._store&&(o._payload.value._store.validated=1):o._store&&(o._store.validated=1))}function N(o){return typeof o=="object"&&o!==null&&o.$$typeof===b}var m=l,b=Symbol.for("react.transitional.element"),p=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),z=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),P=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),F=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),K=Symbol.for("react.activity"),$=Symbol.for("react.client.reference"),H=m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue=Object.prototype.hasOwnProperty,X=Array.isArray,re=console.createTask?console.createTask:function(){return null};m={react_stack_bottom_frame:function(o){return o()}};var we,Y={},G=m.react_stack_bottom_frame.bind(m,c)(),ve=re(n(c)),me={};Xe.Fragment=y,Xe.jsx=function(o,f,C){var I=1e4>H.recentlyCreatedOwnerStacks++;return x(o,f,C,!1,I?Error("react-stack-top-frame"):G,I?re(n(o)):ve)},Xe.jsxs=function(o,f,C){var I=1e4>H.recentlyCreatedOwnerStacks++;return x(o,f,C,!0,I?Error("react-stack-top-frame"):G,I?re(n(o)):ve)}})()),Xe}var vr;function sn(){return vr||(vr=1,process.env.NODE_ENV==="production"?ct.exports=nn():ct.exports=on()),ct.exports}var h=sn();function an({title:e,titleId:t,...r},n){return ce.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?ce.createElement("title",{id:t},e):null,ce.createElement("path",{fillRule:"evenodd",d:"M12.53 16.28a.75.75 0 0 1-1.06 0l-7.5-7.5a.75.75 0 0 1 1.06-1.06L12 14.69l6.97-6.97a.75.75 0 1 1 1.06 1.06l-7.5 7.5Z",clipRule:"evenodd"}))}const ln=ce.forwardRef(an);function cn({title:e,titleId:t,...r},n){return ce.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?ce.createElement("title",{id:t},e):null,ce.createElement("path",{fillRule:"evenodd",d:"M16.28 11.47a.75.75 0 0 1 0 1.06l-7.5 7.5a.75.75 0 0 1-1.06-1.06L14.69 12 7.72 5.03a.75.75 0 0 1 1.06-1.06l7.5 7.5Z",clipRule:"evenodd"}))}const un=ce.forwardRef(cn);function dn({title:e,titleId:t,...r},n){return ce.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?ce.createElement("title",{id:t},e):null,ce.createElement("path",{d:"M19.5 21a3 3 0 0 0 3-3v-4.5a3 3 0 0 0-3-3h-15a3 3 0 0 0-3 3V18a3 3 0 0 0 3 3h15ZM1.5 10.146V6a3 3 0 0 1 3-3h5.379a2.25 2.25 0 0 1 1.59.659l2.122 2.121c.14.141.331.22.53.22H19.5a3 3 0 0 1 3 3v1.146A4.483 4.483 0 0 0 19.5 9h-15a4.483 4.483 0 0 0-3 1.146Z"}))}const fn=ce.forwardRef(dn),kt=44,hn=12,mn=8,ie=14,pn=14,Nr=e=>e===void 0?void 0:{fontSize:typeof e=="number"?`${e}px`:e},oe=e=>({width:e,height:e}),A={container:"directory-tree-container relative h-full transition-opacity duration-300 overflow-y-hidden pb-[3px] pr-[2px]",containerPending:"opacity-70",entry:"directory-tree-entry flex items-center cursor-pointer relative select-none text-xs leading-tight py-0.5",entryHover:L.twMerge("directory-tree-entry--hover hover:bg-gray-400/15","dark:hover:bg-gray-200/10"),entrySelected:L.twMerge("directory-tree-entry--selected bg-blue-400/10","dark:bg-blue-400/15"),entryItemSelected:L.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:L.twMerge("directory-tree-expand-icon flex-shrink-0 flex items-center justify-center","text-gray-500","dark:text-gray-400"),expandIconSelected:L.twMerge("directory-tree-expand-icon--selected text-blue-700","dark:text-blue-400"),typeIcon:L.twMerge("directory-tree-type-icon flex-shrink-0 flex items-center justify-center","text-gray-500","dark:text-gray-400"),typeIconSelected:L.twMerge("directory-tree-type-icon--selected text-blue-700","dark:text-blue-400"),name:L.twMerge("directory-tree-name overflow-hidden text-ellipsis whitespace-nowrap ml-1 text-xs font-normal","text-gray-700","dark:text-gray-200"),nameDirectory:"directory-tree-name--directory font-medium",nameSelected:L.twMerge("directory-tree-name--selected text-blue-800 font-semibold","dark:text-blue-300")},Ot=e=>{const t=e.slice(e.lastIndexOf("/")+1),r=t.lastIndexOf(".");return r<=0?"":t.slice(r+1).toLowerCase()},yn=/^[a-z][a-z\d+.-]*:\/\//i,Sr=e=>Ot(yn.test(e)?e.split(/[?#]/,1)[0]:e),_r=e=>Ot(e.name)||Sr(e.relativePath)||Sr(e.absolutePath),Pr=({isDirectory:e,isExpanded:t,showExpandIcons:r,useCanvasExpandIcons:n,expandIconSize:a})=>{const c=a?{width:a,height:a}:void 0,i=a?"":"h-4 w-4";return!(r&&e)||n?h.jsx("span",{className:i,style:c,"aria-hidden":"true"}):t?h.jsx(ln,{className:i,style:c}):h.jsx(un,{className:i,style:c})},Tt=(e,t)=>{if(e==null||typeof e=="boolean")return null;if(typeof e=="function")return console.warn(`[DirectoryTree] Function returned by renderer for "${t}". Return a node.`),null;if(typeof e=="object"){if("then"in e)return console.warn(`[DirectoryTree] Promise returned for "${t}". Not supported.`),null;if(Array.isArray(e)){const n=e.map(a=>Tt(a,t)).filter(Boolean);return n.length?n:null}const r=e.type;if(r&&r.$$typeof===Symbol.for("react.lazy"))return console.warn(`[DirectoryTree] Lazy component for "${t}". Not supported.`),null}return e},gn={markdown:e=>h.jsx(le.FileMd,{className:"text-sky-500 dark:text-sky-400",style:oe(e)}),pdf:e=>h.jsx(le.FilePdf,{className:"text-red-500 dark:text-red-400",style:oe(e)}),spreadsheet:e=>h.jsx(le.FileXls,{className:"text-emerald-600 dark:text-emerald-400",style:oe(e)}),csv:e=>h.jsx(le.FileCsv,{className:"text-emerald-600 dark:text-emerald-400",style:oe(e)}),document:e=>h.jsx(le.FileDoc,{className:"text-blue-600 dark:text-blue-400",style:oe(e)}),presentation:e=>h.jsx(le.FilePpt,{className:"text-orange-500 dark:text-orange-400",style:oe(e)}),image:e=>h.jsx(le.FileImage,{className:"text-teal-500 dark:text-teal-400",style:oe(e)}),audio:e=>h.jsx(le.FileAudio,{className:"text-pink-500 dark:text-pink-400",style:oe(e)}),video:e=>h.jsx(le.FileVideo,{className:"text-violet-500 dark:text-violet-400",style:oe(e)}),archive:e=>h.jsx(le.FileZip,{className:"text-amber-500 dark:text-amber-400",style:oe(e)}),code:e=>h.jsx(le.FileCode,{className:"text-purple-500 dark:text-purple-400",style:oe(e)}),text:e=>h.jsx(le.FileText,{className:"text-gray-500 dark:text-gray-400",style:oe(e)})},bn={markdown:["md","markdown","mdx"],pdf:["pdf"],spreadsheet:["xls","xlsx","xlsm","xlsb","ods"],csv:["csv","tsv"],document:["doc","docx","rtf","odt"],presentation:["ppt","pptx","odp"],image:["png","jpg","jpeg","gif","svg","webp","ico","bmp","tiff","avif"],audio:["mp3","wav","ogg","m4a","flac","aac","wma"],video:["mp4","webm","mov","avi","mkv","wmv","flv"],archive:["zip","tar","gz","7z","rar","tgz","bz2"],code:["js","mjs","cjs","ts","tsx","jsx","json","html","htm","css","scss","py","go","rs","c","cpp","h","hpp","sh","bash","yaml","yml","sql","xml","toml"],text:["txt","log"]},wn=new Map(Object.entries(bn).flatMap(([e,t])=>t.map(r=>[r,e]))),vn=new Set(["","application/octet-stream","binary/octet-stream","text/plain","application/x-empty"]),Sn=e=>(e??"").split(";",1)[0].trim().toLowerCase(),xn=e=>{if(e==="text/markdown"||e==="text/x-markdown")return"markdown";if(e==="application/pdf")return"pdf";if(e.includes("excel")||e.includes("spreadsheet"))return"spreadsheet";if(e==="text/csv"||e==="text/tab-separated-values")return"csv";if(e.includes("word")||e.includes("google-apps.document")||e==="application/rtf")return"document";if(e.includes("powerpoint")||e.includes("presentation"))return"presentation";if(e.startsWith("image/"))return"image";if(e.startsWith("audio/"))return"audio";if(e.startsWith("video/"))return"video";if(e.includes("zip")||e.includes("tar")||e.includes("compressed")||e.includes("archive"))return"archive";if(e==="application/json"||e.includes("javascript")||e.includes("typescript")||e.includes("xml")||e.startsWith("text/html")||e.startsWith("text/css")||e.includes("x-python")||e.includes("x-sh")||e.includes("x-go")||e.includes("x-rust"))return"code";if(e.startsWith("text/"))return"text"},En=(e,t,r,n)=>{const a=Sn(e),c=xn(a),i=wn.get((t||(r?Ot(r):"")).toLowerCase()),w=(vn.has(a)?[i,c]:[c,i]).find(S=>S!==void 0);return w===void 0?h.jsx(le.FileIcon,{className:"text-gray-400 dark:text-gray-400",style:oe(n)}):gn[w](n)},jr=(e,t,r)=>{const{entry:n,isDirectory:a,isExpanded:c,extension:i,mimeType:d}=e;let w;const S=d||n.mimeType;return n.icon!==void 0?w=n.icon:a?w=c&&t?.directoryExpanded||t?.directory||h.jsx(fn,{style:oe(r)}):i&&t?.fileByExtension?.[i]?w=t.fileByExtension[i]:w=t?.file||En(S,i,n.name,r),Tt(typeof w=="function"?w(e):w,n.absolutePath)},Rn=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Or=e=>{if(!e)return;const t=Object.entries(e).filter(([,r])=>r!=null);if(t.length!==0)return Object.fromEntries(t.map(([r,n])=>[`data-${Rn(r)}`,String(n)]))},In=500,Mr=({entry:e,isDirectory:t,isExpanded:r,isItemSelected:n,selectionMode:a,onSelectionChange:c,onEntryClick:i,toggleDirectory:d,onToggleDirectoryRecursive:w})=>{const S=l.useRef(null);return l.useEffect(()=>()=>{S.current&&window.clearTimeout(S.current)},[]),l.useCallback(x=>{x.stopPropagation(),a!=="none"&&!t&&c&&c(e,!n);let R=!1;i({entry:e,isDirectory:t,isExpanded:r,preventDefault:()=>{R=!0}}),!(!t||R)&&(S.current?(window.clearTimeout(S.current),S.current=null,w(e)):S.current=window.setTimeout(()=>{d(e.absolutePath),S.current=null},In))},[t,e,r,w,d,i,a,c,n])},Lr=e=>e==="right"?"dt-grid-cell--right":e==="center"?"dt-grid-cell--center":"",xr=(e,t)=>e.children!==void 0&&t(e.absolutePath),Ar=(e,t)=>({width:e,gridTemplateColumns:t}),Dr=l.memo(({entry:e,indentLevel:t,positionInSet:r,setSize:n,rowIndex:a,flatIndex:c,onRowFocus:i,onRowBlur:d,isSelectedForAria:w,rowHeight:S,isDirOpen:x,columns:R,numericTemplate:N,numericTotal:m,nameWidth:b,rowClassName:p,selection:{onEntryClick:y,selectedPath:v,currentPath:z,mode:_="none",selectedItems:P,onSelectionChange:g},expansion:{toggleDirectory:D,onToggleDirectoryRecursive:F},visual:{iconOverrides:j,showExpandIcons:q=!0,showDirectoryIcons:K=!0,showFileIcons:$=!0,useCanvasExpandIcons:H=!1,expandIconSize:ue,typeIconSize:X,fontSize:re,indentSize:we,highlightStyles:Y,expandIconClassName:G,expandIconStyle:ve}})=>{const[me,o]=l.useState(!1),f=e.children!==void 0,C=f&&x(e.absolutePath),I=e.absolutePath===v,pe=e.absolutePath===z,T=!f&&!!P?.has(e.absolutePath),O=f?void 0:_r(e),Z=Mr({entry:e,isDirectory:f,isExpanded:C,isItemSelected:T,selectionMode:_,onSelectionChange:g,onEntryClick:y,toggleDirectory:D,onToggleDirectoryRecursive:F}),de=me?Y?.hoverClassName!==void 0?Y.hoverClassName:A.entryHover:"",Re=(()=>{if(f){if(I)return Y?.directorySelectedClassName!==void 0?Y.directorySelectedClassName:A.entrySelected}else if(I||T)return Y?.itemSelectedClassName!==void 0?Y.itemSelectedClassName:L.twMerge(I&&A.entrySelected,T&&A.entryItemSelected);return""})(),M=typeof p=="function"?p(e):p,ye=L.twMerge("dt-grid-row cursor-pointer select-none",de,Re,M,e.className),U=L.twMerge(A.expandIcon,G,(I||T)&&A.expandIconSelected),Oe=L.twMerge(A.typeIcon,(I||T)&&A.typeIconSelected),ne=L.twMerge("dt-grid-name-label ml-1","text-gray-700 dark:text-gray-200",f&&A.nameDirectory,(I||T)&&A.nameSelected),Q=Pr({isDirectory:f,isExpanded:C,showExpandIcons:q,useCanvasExpandIcons:H,expandIconSize:ue}),se=(f?K:$)?jr({entry:e,isDirectory:f,isExpanded:C,isSelected:I,isItemSelected:T,extension:O,mimeType:e.mimeType},j,X):null,Ie={indentLevel:t,isDirectory:f,isExpanded:C},[Ne,...ke]=R,Me=Ne?.render?Ne.render(e,Ie):e.label??e.name,Se={...me?Y?.hoverStyle:{},...f&&I?Y?.directorySelectedStyle:{},...!f&&(I||T)?Y?.itemSelectedStyle:{}};return h.jsxs("div",{className:ye,style:{height:S,...Se,...e.style},role:"row","aria-expanded":f?C:void 0,"aria-level":t+1,"aria-posinset":r,"aria-setsize":n,"aria-rowindex":a,"aria-selected":_==="none"?void 0:w,"aria-current":pe?"page":void 0,...Or(e.data),"data-entry-type":f?"directory":"file","data-entry-expanded":f?String(C):void 0,"data-entry-selected":I?"true":void 0,"data-entry-item-selected":T?"true":void 0,onClick:Z,onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),onFocus:W=>i(c,e.absolutePath,W.currentTarget),onBlur:W=>d(e.absolutePath,W.currentTarget),onKeyDown:W=>{if(W.key==="Enter"){if(W.repeat){W.preventDefault();return}Z(W)}},tabIndex:0,children:[h.jsxs("div",{className:L.twMerge("dt-grid-name-cell",Ne?.className),role:"gridcell",style:{width:b,paddingLeft:Math.max(0,t*we)},children:[(q||H)&&h.jsx("span",{className:U,style:{width:ie,height:ie,...ve},children:Q}),(f?K:$)&&h.jsx("span",{className:Oe,style:{width:X,height:X},children:se}),h.jsx("span",{className:ne,style:Nr(re),children:Me})]}),ke.length>0&&h.jsx("div",{className:"dt-grid-numeric-viewport",children:h.jsx("div",{className:"dt-grid-numeric-track",style:Ar(m,N),children:ke.map(W=>h.jsx("div",{className:L.twMerge("dt-grid-cell",Lr(W.align),W.className),role:"gridcell",children:W.render?W.render(e,Ie):null},W.key))})})]})},(e,t)=>{if(e.entry!==t.entry)return!1;const r=xr(e.entry,e.isDirOpen),n=xr(t.entry,t.isDirOpen);return e.indentLevel===t.indentLevel&&e.positionInSet===t.positionInSet&&e.setSize===t.setSize&&e.rowIndex===t.rowIndex&&e.flatIndex===t.flatIndex&&e.isSelectedForAria===t.isSelectedForAria&&e.rowHeight===t.rowHeight&&r===n&&e.columns===t.columns&&e.numericTemplate===t.numericTemplate&&e.numericTotal===t.numericTotal&&e.nameWidth===t.nameWidth&&e.rowClassName===t.rowClassName&&e.selection.selectedPath===t.selection.selectedPath&&e.selection.currentPath===t.selection.currentPath&&e.selection.mode===t.selection.mode&&e.selection.selectedItems===t.selection.selectedItems&&e.visual===t.visual});Dr.displayName="DirectoryTreeGridRow";const Fr=({kind:e,columns:t,numericTemplate:r,numericTotal:n,nameWidth:a,scrollBarWidth:c,className:i,nameContent:d,renderCell:w})=>{const[,...S]=t,x=e==="header"?"dt-grid-name-header":"dt-grid-name-footer",R=e==="header"?"dt-grid-header":"dt-grid-footer",N=e==="header"?"columnheader":"gridcell";return h.jsxs("div",{className:L.twMerge(R,"text-gray-600 dark:text-gray-300",i),role:"row",children:[h.jsx("div",{className:L.twMerge(x,"px-1",t[0]?.className),role:N,style:{width:a},children:d}),S.length>0&&h.jsx("div",{className:"dt-grid-numeric-viewport",children:h.jsx("div",{className:"dt-grid-numeric-track",style:Ar(n,r),children:S.map(m=>h.jsx("div",{className:L.twMerge("dt-grid-cell",Lr(m.align),m.className),role:N,children:w(m)},m.key))})}),h.jsx("div",{className:"dt-grid-scrollbar-spacer",style:{width:c},"aria-hidden":"true"})]})},kn=({columns:e,className:t,...r})=>h.jsx(Fr,{kind:"header",columns:e,className:t,nameContent:e[0]?.header??null,renderCell:n=>n.header??null,...r}),Er=(e,t)=>typeof e=="function"?e(t):e??null,Cn=({columns:e,allEntries:t,className:r,...n})=>h.jsx(Fr,{kind:"footer",columns:e,className:r,nameContent:Er(e[0]?.footer,t),renderCell:a=>Er(a.footer,t),...n}),Tn=240,zr=96,$r=12,Nt=(e,t)=>{const r=e?.width;return typeof r=="number"&&Number.isFinite(r)&&r>0?r:t},Nn=e=>e.slice(1).map(t=>`${Nt(t,zr)}px`).join(" "),_n=({measuredWidth:e,columns:t,scrollBarWidth:r=$r})=>{const n=Nt(t[0],Tn),a=t.slice(1).reduce((w,S)=>w+Nt(S,zr),0),c=Number.isFinite(e)&&e>0?e:0,i=Math.max(0,c-n-Math.max(0,r)),d=Math.max(0,a-i);return{nameWidth:n,numericTotal:a,numericVisible:i,maxHScroll:d}},Ct=(e,t)=>!Number.isFinite(e)||e<0?0:e>t?t:e,Pn=e=>{const t=[],r=n=>{for(const a of n)t.push(a),a.children&&a.children.length>0&&r(a.children)};return r(e),t},Br=["entryKindDirectory","entryKindFile"],_t=[...he.VIRTUAL_SCROLL_LABEL_KEYS,...Br],Pt=Object.freeze({en:Object.freeze({entryKindDirectory:"directory",entryKindFile:"file"}),ja:Object.freeze({entryKindDirectory:"ディレクトリ",entryKindFile:"ファイル"})}),Hr=Object.freeze({en:Object.freeze({...he.VIRTUAL_SCROLL_LABEL_CATALOGS.en,...Pt.en}),ja:Object.freeze({...he.VIRTUAL_SCROLL_LABEL_CATALOGS.ja,...Pt.ja})}),Rr=e=>typeof e=="string"?JSON.stringify(e):e===null?"null":typeof e,jn=e=>{const t={};let r=!1;for(const n of he.VIRTUAL_SCROLL_LABEL_KEYS){const a=Object.hasOwn(e,n)?e[n]:void 0;a!==void 0&&(t[n]=a,r=!0)}return r?t:void 0},Wr=(e,t)=>{const r=he.resolveVirtualScrollLocale(e);if(t===void 0)return Hr[r];if(t===null||typeof t!="object")throw new RangeError(`[directory-tree] labels must be an object; got ${Rr(t)}`);const n=Object.getPrototypeOf(t);if(n!==Object.prototype&&n!==null)throw new RangeError(`[directory-tree] labels must be a plain object (prototype Object.prototype or null); got ${Array.isArray(t)?"an array":"an object with a non-plain prototype"}`);for(const i of Object.keys(t))if(!_t.includes(i))throw new RangeError(`[directory-tree] labels.${i} is not a known label key; expected one of ${_t.join(", ")}`);const c={...he.resolveVirtualScrollLabels(r,jn(t)),...Pt[r]};for(const i of Br){const d=Object.hasOwn(t,i)?t[i]:void 0;if(d!==void 0){if(typeof d!="string"||d.trim()==="")throw new RangeError(`[directory-tree] labels.${i} must be a non-blank string; got ${Rr(d)}`);c[i]=d}}return Object.freeze(c)},On=e=>{const t={};for(const r of he.VIRTUAL_SCROLL_LABEL_KEYS)t[r]=e[r];return Object.freeze(t)},Mn=()=>{let e=null;return{mark:t=>{const r=t.composedPath();e=r,setTimeout(()=>{e===r&&(e=null)},0)},landedOn:t=>e?.includes(t)===!0}},Ue=e=>typeof e=="string"?JSON.stringify(e):String(e),jt=(e,t)=>{if(typeof t!="number"||!Number.isFinite(t)||t<=0)throw new RangeError(`[directory-tree] visual.${e} must be a finite number greater than 0 (px); got ${Ue(t)}.`);return t},Ln=e=>{if(typeof e=="string"&&e.trim()!==""||typeof e=="number"&&Number.isFinite(e)&&e>0)return e;throw new RangeError(`[directory-tree] visual.fontSize must be a finite number greater than 0 (px) or a CSS font size that is not blank; got ${Ue(e)}.`)},An=({indentSize:e,typeIconSize:t,fontSize:r})=>({indentSize:e===void 0?hn:jt("indentSize",e),typeIconSize:t===void 0?pn:jt("typeIconSize",t),fontSize:r===void 0?void 0:Ln(r)}),Dn=({indentSize:e,removeRootIndent:t,hasExpandBox:r})=>t?Math.max(0,e-(r?ie:0)):0,Fn=(e,t,r)=>{if(typeof e!="function")return jt("itemHeight",e);const n=e(t,r);if(typeof n!="number"||!Number.isFinite(n)||n<=0)throw new RangeError(`[directory-tree] visual.itemHeight returned ${Ue(n)} for ${JSON.stringify(t.absolutePath)} (row ${r}); it must return a finite number greater than 0 (px).`);return n},zn=(e,t,r)=>{const n=t===void 0?mn:t;if(typeof n!="number"||!Number.isFinite(n)||n<=0||n>ie)throw new RangeError(`[directory-tree] visual.expandIconSize must be a finite number greater than 0 and at most ${ie} (the expand box, px) while tree lines are drawn; got ${Ue(n)}.`);const{indentSize:a,typeIconSize:c}=e,i=n/2,d=ie+c-n/2;if(a<i||a>d)throw new RangeError(`[directory-tree] visual.indentSize ${Ue(a)} does not fit the tree lines: with typeIconSize ${c} and an expand glyph of ${n} px it must be from ${i} (half the glyph) to ${d} (the ${ie} px expand box + typeIconSize − half the glyph).`);return{indentSize:a,typeIconSize:c,glyphSize:n,originX:r}},$n=({indentSize:e,typeIconSize:t,glyphSize:r})=>Math.min(Math.max(ie+t/2-e,r/2),ie-r/2),Bn=(e,t)=>{const r=e.length-1;if(r<=0)return 0;let n=0,a=r-1,c=0;for(;n<=a;){const i=n+a>>>1;e[i]<=t?(c=i,n=i+1):a=i-1}return c},Hn=(e,t,r)=>{if(r<=0||e.length===0||t.length!==e.length+1)return null;const n=Bn(t,r),a=e[n];return a?{path:a.entry.absolutePath,offsetInViewport:r-t[n]}:null},Wn=(e,t,r)=>{if(t.length===0||r.length!==t.length+1)return null;for(let n=0;n<t.length;n++)if(t[n].entry.absolutePath===e.path)return Math.max(0,r[n]+e.offsetInViewport);return null},Yn=(e,t,r)=>{const n=[];for(let a=t;a<r;a++){const c=e[a];if(!(!c||c.length===0))for(const i of c)n.push(i)}return n},Gn=(e,t,r)=>{const n=[];for(let a=t;a<r;a++){const c=e[a];if(!(!c||c.length===0))for(const i of c)n.push(i)}return n},Vn=(e,t,r,n)=>{const a=Math.max(1,Math.floor(t*n)),c=Math.max(1,Math.floor(r*n));(e.width!==a||e.height!==c)&&(e.width=a,e.height=c);const i=e.style;i.width!==`${t}px`&&(i.width=`${t}px`),i.height!==`${r}px`&&(i.height=`${r}px`)},Kn=(e,t,r)=>{e.lineWidth=r,e.beginPath();for(const n of t)e.moveTo(n.x1,n.y1),e.lineTo(n.x2,n.y2);e.stroke()},Xn=(e,t)=>{const r=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());if(!r)return null;let n=r[1];n.length===3&&(n=n.split("").map(d=>d+d).join(""));const a=Number.parseInt(n.slice(0,2),16),c=Number.parseInt(n.slice(2,4),16),i=Number.parseInt(n.slice(4,6),16);return`rgba(${a}, ${c}, ${i}, ${t})`},Un=(e,t,r,n)=>{if(t.length===0)return;const a=Xn(r,.14),c=e.strokeStyle,i=e.fillStyle,d=e.lineWidth,w=e.lineCap,S=e.lineJoin;e.strokeStyle=r,e.lineCap="round",e.lineJoin="round";for(const x of t){const R=n??x.size,N=Math.max(0,R/2),m=Math.max(1,Math.round(R*.08)),b=Math.max(1,Math.round(R*.14)),p=Math.max(0,N-m*.8),y=Math.max(0,p*.55);a&&(e.fillStyle=a,e.beginPath(),e.arc(x.centerX,x.centerY,p,0,Math.PI*2),e.fill()),e.lineWidth=m,e.beginPath(),e.arc(x.centerX,x.centerY,Math.max(0,N-m*.3),0,Math.PI*2),e.stroke(),e.lineWidth=b,e.beginPath(),e.moveTo(x.centerX-y,x.centerY),e.lineTo(x.centerX+y,x.centerY),e.stroke(),x.isExpanded||(e.beginPath(),e.moveTo(x.centerX,x.centerY-y),e.lineTo(x.centerX,x.centerY+y),e.stroke())}e.strokeStyle=c,e.fillStyle=i,e.lineWidth=d,e.lineCap=w,e.lineJoin=S},Yr=l.memo(({segmentsByItem:e,glyphsByItem:t,itemHeight:r,width:n,viewportHeight:a,scrollPosition:c,color:i="#a0aec0",strokeWidth:d=1,renderStartIndex:w,renderEndIndex:S,lookaheadEndIndex:x,devicePixelRatio:R,expandGlyphColor:N,expandGlyphSize:m})=>{const b=l.useRef(null),p=l.useRef(null),y=l.useRef({segmentsByItem:e,glyphsByItem:t,itemHeight:r,width:n,viewportHeight:a,scrollPosition:c,color:i,strokeWidth:d,renderStartIndex:w,renderEndIndex:S,lookaheadEndIndex:x,devicePixelRatio:R,expandGlyphColor:N,expandGlyphSize:m}),v=l.useCallback(()=>{p.current=null;const _=b.current;if(!_)return;const P=_.getContext("2d");if(!P)return;const g=y.current;if(g.width<=0||g.viewportHeight<=0){P.clearRect(0,0,_.width,_.height);return}const D=Number.isFinite(g.devicePixelRatio??NaN)?g.devicePixelRatio:typeof window<"u"&&window.devicePixelRatio||1;Vn(_,g.width,g.viewportHeight,D);const F=g.segmentsByItem.length,j=typeof g.renderStartIndex=="number"&&Number.isFinite(g.renderStartIndex)?Math.max(0,Math.floor(g.renderStartIndex)):Math.max(0,Math.floor(g.scrollPosition/g.itemHeight)),q=Math.min(F,Math.ceil((g.scrollPosition+g.viewportHeight)/g.itemHeight)),K=(()=>{if(typeof g.renderEndIndex=="number"&&Number.isFinite(g.renderEndIndex)){const X=Math.floor(g.renderEndIndex);return Math.max(Math.min(F,X+1),j)}return Math.max(q,j)})(),$=(()=>{if(typeof g.lookaheadEndIndex=="number"&&Number.isFinite(g.lookaheadEndIndex)){const X=Math.floor(g.lookaheadEndIndex),re=Math.min(F,X+1);return Math.max(re,K)}return Math.max(q,K)})(),H=Yn(g.segmentsByItem,j,$),ue=Gn(g.glyphsByItem,j,$);P.save(),P.scale(D,D),P.clearRect(0,0,g.width,g.viewportHeight),P.translate(0,-g.scrollPosition),P.strokeStyle=g.color,Kn(P,H,g.strokeWidth),Un(P,ue,g.expandGlyphColor??g.color,g.expandGlyphSize),P.restore()},[]),z=l.useCallback(()=>{p.current===null&&(p.current=window.requestAnimationFrame(v))},[v]);return l.useEffect(()=>{y.current={segmentsByItem:e,glyphsByItem:t,itemHeight:r,width:n,viewportHeight:a,scrollPosition:c,color:i,strokeWidth:d,renderStartIndex:w,renderEndIndex:S,lookaheadEndIndex:x,devicePixelRatio:R,expandGlyphColor:N,expandGlyphSize:m},z()},[e,t,r,n,a,c,i,d,w,S,x,R,N,m,z]),l.useEffect(()=>()=>{p.current!==null&&(window.cancelAnimationFrame(p.current),p.current=null)},[]),h.jsx("canvas",{ref:b,className:"pointer-events-none absolute top-0 left-0 z-0"})});Yr.displayName="TreeLineCanvas";const Jn=e=>{const t=new Map;for(let r=0;r<e.length;r++){const n=e[r].entry.absolutePath;t.has(n)||t.set(n,r)}return t},Ir=(e,t)=>e.selectedPath===t?e:{selectedPath:t,selectionGeneration:e.selectionGeneration+1,anchor:e.anchor},qn=(e,t)=>({...e,anchor:{path:t,selectionGeneration:e.selectionGeneration,focused:!0}}),Zn=(e,t)=>{const{anchor:r,selectionGeneration:n,selectedPath:a}=t;if(r!==null&&(r.focused||r.selectionGeneration===n)){const c=e.get(r.path);if(c!==void 0)return c}if(a!==null){const c=e.get(a);if(c!==void 0)return c}return 0},Qn={msOverflowStyle:"none",scrollbarWidth:"none"},eo=()=>{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))},to=e=>{const t=l.useRef(null),r=t.current;return r!==null&&he.VIRTUAL_SCROLL_LABEL_KEYS.every(n=>r[n]===e[n])?r:(t.current=e,e)},kr=new Set(["top","bottom","center","nearest"]),Cr=e=>{const t=e?.align;if(t===void 0)return"top";if(!kr.has(t))throw new RangeError(`[directory-tree] Unsupported scroll alignment ${JSON.stringify(t)}; expected one of ${[...kr].join(", ")}.`);return t},ro={position:"absolute",width:1,height:1,margin:-1,padding:0,border:0,overflow:"hidden",clipPath:"inset(50%)",whiteSpace:"nowrap"},no=(e,t,r,n,a)=>{const c=[],i=[];let d=0;const w=(S,x,R)=>{const N=a?[...S].sort(a):S;for(let m=0;m<N.length;m++){const b=N[m],p=m===N.length-1,y=[...R,p],v=b.children!==void 0,z=v&&t(b.absolutePath,b.relativePath);let _=x,P=R;n&&(_=x-1,P=R.slice(1)),c.push({entry:b,indentLevel:_,depth:x,positionInSet:m+1,setSize:N.length}),r&&(_>d&&(d=_),i.push({id:b.absolutePath,name:b.name,absolutePath:b.absolutePath,indentLevel:_,isLastChild:p,isDirectory:v,isExpanded:z,ancestorIsLast:[...P],hideLines:n&&x===0})),v&&z&&b.children&&w(b.children,x+1,y)}};return w(e,0,[]),{flatItems:c,lineItems:i,maxIndent:d}},Tr=(e,t)=>{const r=e.length-1;if(r<=0)return 0;let n=0,a=r-1,c=0;for(;n<=a;){const i=n+a>>>1;e[i]<=t?(c=i,n=i+1):a=i-1}return c},oo=(e,t,r,n,a,c)=>{const i=n?.renderStart??Math.max(0,Tr(c,a)),d=t>0?Tr(c,a+t)+r:i+r,w=e>0?Math.min(e-1,Math.max(i,d)):i,S=n?.renderEnd??w,x=e>0?Math.min(e-1,S+r):S;return{renderStart:i,renderEnd:S,lookaheadEnd:x}},so=(e,t,r,n)=>{if(e.length===0)return{segmentsByItem:[],glyphsByItem:[]};const{indentSize:a,typeIconSize:c,glyphSize:i,originX:d}=n,w=Array.from({length:e.length},()=>[]),S=Array.from({length:e.length},()=>[]),x=d+$n(n),R=m=>m*a+x,N=i/2+2;for(let m=0;m<e.length;m++){const b=e[m],p=t[m]??0,y=r[m]??0,v=y+p/2,z=e[m+1],_=v+c/2,P=y+p,g=z!==void 0&&z.indentLevel===b.indentLevel+1&&_<P?{key:`${b.id}-connector-children`,x1:R(z.indentLevel),y1:_,x2:R(z.indentLevel),y2:P,itemIndex:m}:null;if(b.hideLines){g!==null&&(w[m]=[g]);continue}const D=[];for(let j=0;j<b.indentLevel;j++){if(b.ancestorIsLast[j]??!1)continue;let K=!1;for(let $=m;$<e.length;$++){const H=e[$];if(H.indentLevel>j&&H.ancestorIsLast.length>j&&!H.ancestorIsLast[j]){K=!0;break}if($>m&&H.indentLevel===j)break}if(K){const $=R(j);D.push({key:`${b.id}-ancestor-${j}`,x1:$,y1:y,x2:$,y2:y+p,itemIndex:m})}}const F=R(b.indentLevel);m>0&&D.push({key:`${b.id}-connector-top`,x1:F,y1:y,x2:F,y2:b.isDirectory?v-N:v,itemIndex:m}),!b.isDirectory&&b.isLastChild&&D.push({key:`${b.id}-connector-horizontal`,x1:F,y1:v,x2:d+b.indentLevel*a+ie,y2:v,itemIndex:m}),b.isLastChild||(b.isDirectory?D.push({key:`${b.id}-connector-bottom`,x1:F,y1:v+N,x2:F,y2:y+p,itemIndex:m}):D.push({key:`${b.id}-connector-bottom`,x1:F,y1:v,x2:F,y2:y+p,itemIndex:m})),g!==null&&D.push(g),w[m]=D,b.isDirectory&&(S[m]=[{key:`${b.id}-glyph`,itemIndex:m,centerX:F,centerY:v,size:i,isExpanded:b.isExpanded}])}return{segmentsByItem:w,glyphsByItem:S}},Gr=l.memo(({entry:e,indentLevel:t,originX:r,depth:n,positionInSet:a,setSize:c,isSelectedForAria:i,flatIndex:d,isActive:w,registerRowRef:S,onNavigationKeyDown:x,onRowFocus:R,onRowBlur:N,rowHeight:m,entryKindDirectory:b,entryKindFile:p,isDirOpen:y,expansion:{toggleDirectory:v,onToggleDirectoryRecursive:z},selection:{onEntryClick:_,selectedPath:P,currentPath:g,mode:D="none",selectedItems:F,onSelectionChange:j},visual:{iconOverrides:q,showExpandIcons:K=!0,showDirectoryIcons:$=!0,showFileIcons:H=!0,useCanvasExpandIcons:ue=!1,expandIconSize:X,typeIconSize:re,fontSize:we,indentSize:Y,highlightStyles:G,entryClassName:ve,entryStyle:me,nameClassName:o,nameStyle:f,directoryNameClassName:C,directoryNameStyle:I,fileNameClassName:pe,fileNameStyle:T,expandIconClassName:O,expandIconStyle:Z}})=>{const[de,Re]=l.useState(!1),M=e.children!==void 0,ye=M&&y(e.absolutePath),U=e.absolutePath===P,Oe=e.absolutePath===g,ne=!M&&F?.has(e.absolutePath),Q=l.useCallback(ee=>S(d,ee),[S,d]),se=M?void 0:_r(e),Ie=Mr({entry:e,isDirectory:M,isExpanded:ye,isItemSelected:!!ne,selectionMode:D,onSelectionChange:j,onEntryClick:_,toggleDirectory:v,onToggleDirectoryRecursive:z}),Ne=de?G?.hoverClassName!==void 0?G.hoverClassName:A.entryHover:"",ke=(()=>{if(M){if(U)return G?.directorySelectedClassName!==void 0?G.directorySelectedClassName:A.entrySelected}else if(U||ne)return G?.itemSelectedClassName!==void 0?G.itemSelectedClassName:L.twMerge(U&&A.entrySelected,ne&&A.entryItemSelected);return""})(),Me=L.twMerge(A.entry,Ne,ke,ve,e.className),Se=L.twMerge(A.expandIcon,O,(U||ne)&&A.expandIconSelected),W=L.twMerge(A.typeIcon,(U||ne)&&A.typeIconSelected),Be=L.twMerge(A.name,o,M&&A.nameDirectory,M&&C,!M&&pe,(U||ne)&&A.nameSelected),Je=Pr({isDirectory:M,isExpanded:ye,showExpandIcons:K&&t>=0,useCanvasExpandIcons:ue,expandIconSize:X}),ut=(M?$:H)?jr({entry:e,isDirectory:M,isExpanded:ye,isSelected:U,isItemSelected:!!ne,extension:se,mimeType:e.mimeType},q,re):null,He={...de?G?.hoverStyle:{},...M&&U?G?.directorySelectedStyle:{},...!M&&(U||ne)?G?.itemSelectedStyle:{}},We=Or(e.data),qe={width:re,height:re},Ze=Nr(we),ge=r+t*Y;return h.jsxs("div",{className:Me,style:{paddingLeft:`${Math.max(0,ge)}px`,transform:ge<0?`translateX(${ge}px)`:void 0,width:ge<0?`calc(100% + ${-ge}px)`:void 0,height:`${m}px`,...Ze,...He,...me,...e.style},...We,"data-entry-type":M?"directory":"file","data-entry-expanded":M?String(ye):void 0,"data-entry-selected":U?"true":void 0,"data-entry-item-selected":ne?"true":void 0,onClick:Ie,onMouseEnter:()=>Re(!0),onMouseLeave:()=>Re(!1),onFocus:ee=>R(d,e.absolutePath,ee.currentTarget),onBlur:ee=>N(e.absolutePath,ee.currentTarget),ref:Q,onKeyDown:ee=>{if(ee.key==="Enter"||ee.key===" "){ee.preventDefault(),ee.repeat||Ie(ee);return}x(ee,d)},tabIndex:w?0:-1,role:"treeitem","aria-expanded":M?ye:void 0,"aria-level":n+1,"aria-posinset":a,"aria-setsize":c,"aria-selected":D==="none"?void 0:i,"aria-current":Oe?"page":void 0,"aria-label":`${e.name} (${M?b:p})`,children:[(K||ue)&&h.jsx("span",{className:Se,style:{width:ie,height:ie,...Z},children:Je}),(M?$:H)&&h.jsx("span",{className:W,style:qe,children:ut}),h.jsx("span",{className:Be,style:{...Ze,...f,...M?I:T},"data-entry-type":M?"directory":"file","data-entry-role":"name",children:e.label??e.name})]})},(e,t)=>{if(e.entry!==t.entry)return!1;const r=e.entry.children!==void 0,n=t.entry.children!==void 0,a=r&&e.isDirOpen(e.entry.absolutePath),c=n&&t.isDirOpen(t.entry.absolutePath);return e.indentLevel===t.indentLevel&&e.originX===t.originX&&e.depth===t.depth&&e.positionInSet===t.positionInSet&&e.setSize===t.setSize&&e.isSelectedForAria===t.isSelectedForAria&&e.flatIndex===t.flatIndex&&e.isActive===t.isActive&&e.rowHeight===t.rowHeight&&e.entryKindDirectory===t.entryKindDirectory&&e.entryKindFile===t.entryKindFile&&a===c&&e.selection.selectedPath===t.selection.selectedPath&&e.selection.currentPath===t.selection.currentPath&&e.selection.mode===t.selection.mode&&e.selection.selectedItems===t.selection.selectedItems&&e.visual.iconOverrides===t.visual.iconOverrides&&e.visual.showExpandIcons===t.visual.showExpandIcons&&e.visual.showDirectoryIcons===t.visual.showDirectoryIcons&&e.visual.showFileIcons===t.visual.showFileIcons&&e.visual.useCanvasExpandIcons===t.visual.useCanvasExpandIcons&&e.visual.expandIconSize===t.visual.expandIconSize&&e.visual.typeIconSize===t.visual.typeIconSize&&e.visual.fontSize===t.visual.fontSize&&e.visual.indentSize===t.visual.indentSize&&e.visual.highlightStyles===t.visual.highlightStyles&&e.visual.entryClassName===t.visual.entryClassName&&e.visual.entryStyle===t.visual.entryStyle&&e.visual.nameClassName===t.visual.nameClassName&&e.visual.nameStyle===t.visual.nameStyle&&e.visual.directoryNameClassName===t.visual.directoryNameClassName&&e.visual.directoryNameStyle===t.visual.directoryNameStyle&&e.visual.fileNameClassName===t.visual.fileNameClassName&&e.visual.fileNameStyle===t.visual.fileNameStyle&&e.visual.expandIconClassName===t.visual.expandIconClassName&&e.visual.expandIconStyle===t.visual.expandIconStyle});Gr.displayName="DirectoryEntryItem";const Vr=e=>{const t=[];if(e.children)for(const r of e.children)r.type==="directory"&&(t.push(r.absolutePath),t.push(...Vr(r)));return t},ao=({entries:e,expansion:{toggle:t,isExpanded:r,expandMultiple:n,collapseMultiple:a,isPending:c,alwaysExpanded:i=!1,doubleClickAction:d="recursive"},selection:{onEntryClick:w,selectedPath:S,currentPath:x,mode:R="none",selectedItems:N,onSelectionChange:m},visual:{className:b,style:p,ariaLabel:y,ariaLabelledBy:v,lineColor:z="#A0AEC0",showTreeLines:_=!0,showExpandIcons:P=!0,showDirectoryIcons:g=!0,showFileIcons:D=!0,iconOverrides:F,expandIconSize:j,typeIconSize:q,fontSize:K,indentSize:$,itemHeight:H=kt,removeRootIndent:ue=!1,highlightStyles:X,entryClassName:re,entryStyle:we,nameClassName:Y,nameStyle:G,directoryNameClassName:ve,directoryNameStyle:me,fileNameClassName:o,fileNameStyle:f,expandIconClassName:C,expandIconStyle:I}={},virtualScroll:pe,grid:T,sort:O,locale:Z,labels:de,ref:Re})=>{const M=he.resolveVirtualScrollLocale(Z),ye=l.useMemo(()=>Wr(Z,de),[Z,de]),U=to(On(ye)),{entryKindDirectory:Oe,entryKindFile:ne}=ye,Q=l.useMemo(()=>An({indentSize:$,typeIconSize:q,fontSize:K}),[$,q,K]),se=T!==void 0,[Ie,Ne]=l.useState(!1),ke=l.useRef(null),Me=l.useRef(null),Se=l.useRef(null),[W,Be]=l.useState(0),[Je,ut]=l.useState(0),[He,We]=l.useState(0),[qe,Ze]=l.useState(null),{overscanCount:ge=15,className:ee,background:Mt,onScroll:Lt,onRangeChange:At,onScrollAdjust:Dt,liveRegion:Ft,initialScrollIndex:zt,initialScrollOffset:Le,initialScrollAnchor:$t,callbackThrottleMs:Bt=5,contentInsets:Ht,onItemFocus:Wt,viewportHeightOverride:ae,scrollBarOptions:dt,behaviorOptions:Yt,preserveScrollAnchor:Gt=!1,getItemKey:Kr,testId:Vt,contentProps:ft}=pe??{},Kt=l.useMemo(()=>se?{...ft,role:"rowgroup"}:{...ft,role:"tree","aria-label":v?void 0:y,"aria-labelledby":v,"aria-multiselectable":R==="multiple"?!0:void 0},[se,ft,y,v,R]),Xt=l.useMemo(()=>({...Yt,enableKeyboardNavigation:!1}),[Yt]),[Qe,Ut]=l.useState(typeof Le=="number"?Le:0),ht=l.useRef(typeof Le=="number"?Le:0),Jt=l.useCallback((s,u)=>{ht.current=s,Ut(s),Lt?.(s,u)},[Lt]),qt=l.useCallback(s=>{const{renderingStartIndex:u,renderingEndIndex:E}=s;Ze(k=>k&&k.renderStart===u&&k.renderEnd===E?k:{renderStart:u,renderEnd:E}),At?.(s)},[At]);l.useEffect(()=>{Ne(!0),eo()},[]),l.useEffect(()=>{const s=ke.current,u=se?Me.current:s,E=()=>{if(s){const B=s.clientWidth;ut(J=>Math.abs(J-B)>1?B:J)}if(typeof ae=="number")Be(B=>Math.abs(B-ae)>1?ae:B);else if(u){const B=u.clientHeight;Be(J=>Math.abs(J-B)>1?B:J)}};if(!(s||u))return Be(0);E();const k=new ResizeObserver(E);return s&&k.observe(s),u&&u!==s&&k.observe(u),()=>k.disconnect()},[ae,se]);const Ae=typeof ae=="number"?ae:W,be=l.useCallback(s=>i||(Ie?r(s):!1),[Ie,r,i]),Zt=L.twMerge(A.container,c&&A.containerPending,b),Qt=l.useMemo(()=>({...Qn,...p??{},...typeof ae=="number"?{height:ae,minHeight:ae}:{}}),[p,ae]),mt=l.useCallback((s,u)=>{const E=[s.absolutePath,...Vr(s)],k=u||d;if(E.every(Ee=>be(Ee)))return a(E);if(E.every(Ee=>!be(Ee))||k==="recursive")return n(E);if(k==="toggle")return a(E);console.warn(`[DirectoryTree] Unknown double click action: ${k}. No action taken.`)},[be,n,a,d]),pt=se?!1:ue,{flatItems:_e,lineItems:yt,maxIndent:er}=l.useMemo(()=>no(e,be,_,pt,O),[e,be,_,pt,O]),et=Dn({indentSize:Q.indentSize,removeRootIndent:pt,hasExpandBox:P||_}),fe=l.useMemo(()=>_?zn(Q,j,et):null,[_,Q,j,et]),V=l.useMemo(()=>_e.map((s,u)=>({...s,rowHeight:Fn(H,s.entry,u)})),[_e,H]),Ce=l.useMemo(()=>V.map(s=>s.rowHeight),[V]),Pe=l.useMemo(()=>{const s=new Array(Ce.length+1);s[0]=0;for(let u=0;u<Ce.length;u++)s[u+1]=s[u]+Ce[u];return s},[Ce]),tr=l.useCallback(s=>V[s]?.rowHeight??kt,[V]),Xr=l.useCallback(s=>V[s]?.entry.absolutePath??s,[V]),rr=Kr??Xr,De=S??null,gt=x??null,[nr,Ye]=l.useState(()=>({selectedPath:De,selectionGeneration:0,anchor:null})),bt=Ir(nr,De);bt!==nr&&Ye(s=>Ir(s,De));const tt=l.useMemo(()=>Jn(_e),[_e]),Fe=l.useMemo(()=>Zn(tt,bt),[tt,bt]),Ge=l.useRef(new Map),rt=l.useRef(null),[nt]=l.useState(Mn),Ve=l.useRef(null),[Ur,or]=l.useState(!0),wt=l.useRef(_e);wt.current=_e;const sr=l.useRef(be);sr.current=be;const vt=l.useRef(t);vt.current=t;const ar=l.useRef(tt);ar.current=tt;const St=l.useRef(Fe);St.current=Fe;const lr=l.useRef(Wt);lr.current=Wt;const je=l.useCallback(s=>{const u=Se.current;return!u||u.getViewportSize()<=0?!1:(u.scrollToIndex(s,{align:"nearest"}),!0)},[]),xe=l.useCallback(s=>{const u=Ge.current.get(s);if(u===void 0){Ve.current=s,je(s)||(Ve.current=null);return}Ve.current=null,je(s),u.focus({preventScroll:!0})},[je]),ir=l.useCallback((s,u)=>{if(u)Ge.current.set(s,u),Ve.current===s?(Ve.current=null,u.focus({preventScroll:!0})):u.contains(u.ownerDocument.activeElement)&&Ye(E=>E.anchor===null?E:{...E,anchor:{...E.anchor,focused:!0}});else{const E=Ge.current.get(s);Ge.current.delete(s),E?.contains(E.ownerDocument.activeElement)&&Ye(k=>k.anchor===null?k:{...k,anchor:{...k.anchor,focused:!1}})}s===St.current&&or(u!==null)},[]);l.useLayoutEffect(()=>{or(Ge.current.has(Fe))},[Fe]);const xt=l.useCallback((s,u,E)=>{const k=rt.current===E;rt.current=null,k||(Ye(B=>qn(B,u)),nt.landedOn(E)||je(s)),lr.current?.(s)},[je,nt]),ot=l.useCallback(s=>nt.mark(s.nativeEvent),[nt]),Et=l.useCallback((s,u)=>{const{ownerDocument:E}=u;if(!E.hasFocus()&&u.contains(E.activeElement)){rt.current=u;return}rt.current=null,Ye(k=>k.anchor!==null&&k.anchor.path===s?{...k,anchor:{...k.anchor,focused:!1}}:k)},[]),Jr=l.useCallback(()=>xe(St.current),[xe]),Rt=l.useCallback((s,u)=>{const E=Cr(u),k=wt.current.length;if(!Number.isInteger(s)||s<0||s>=k)throw new RangeError(`[directory-tree] scrollToIndex: ${String(s)} is not a row index (${k===0?"the tree has no rows":`expected an integer in 0..${String(k-1)}`}).`);if(E==="nearest"){je(s);return}Se.current?.scrollToIndex(s,{align:E})},[je]);l.useImperativeHandle(Re,()=>({scrollToIndex:Rt,scrollToPath:(s,u)=>{Cr(u);const E=ar.current.get(s);return E===void 0?!1:(Rt(E,u),!0)},getScrollAnchor:()=>Se.current?.getScrollAnchor()??null}),[Rt]);const cr=l.useCallback((s,u)=>{if(s.altKey||s.ctrlKey||s.metaKey)return;const E=wt.current,k=E.length-1;if(k<0)return;const B=E[u],J=B?.entry.children!==void 0,Ee=J&&sr.current(B.entry.absolutePath);switch(s.key){case"ArrowDown":s.preventDefault(),xe(Math.min(u+1,k));break;case"ArrowUp":s.preventDefault(),xe(Math.max(u-1,0));break;case"Home":s.preventDefault(),xe(0);break;case"End":s.preventDefault(),xe(k);break;case"ArrowRight":s.preventDefault(),J&&!Ee?vt.current(B.entry.absolutePath):J&&u<k&&E[u+1].depth>B.depth&&xe(u+1);break;case"ArrowLeft":{if(s.preventDefault(),J&&Ee){vt.current(B.entry.absolutePath);break}const tn=B?.depth??0;for(let it=u-1;it>=0;it--)if(E[it].depth<tn){xe(it);break}break}}},[xe]),st=l.useMemo(()=>fe===null||yt.length===0?{segmentsByItem:[],glyphsByItem:[]}:so(yt,Ce,Pe,fe),[yt,Ce,Pe,fe]),at=l.useMemo(()=>fe===null||e.length===0?0:fe.originX+er*fe.indentSize+ie+fe.typeIconSize,[e.length,er,fe]),{renderStart:ur,renderEnd:dr,lookaheadEnd:fr}=l.useMemo(()=>oo(V.length,Ae,ge,qe,Qe,Pe),[V.length,Ae,ge,qe,Qe,Pe]),It=l.useMemo(()=>fe===null||at<=0||Ae<=0||st.segmentsByItem.length===0?null:h.jsx("div",{className:"pointer-events-none absolute inset-0 z-0","aria-hidden":"true",children:h.jsx("div",{className:"absolute top-0 left-0",style:{width:at,height:Ae},children:h.jsx(Yr,{segmentsByItem:st.segmentsByItem,glyphsByItem:st.glyphsByItem,itemHeight:Ce[0]??kt,width:at,viewportHeight:Ae,scrollPosition:Qe,color:z,expandGlyphColor:z,expandGlyphSize:fe.glyphSize,renderStartIndex:ur,renderEndIndex:dr,lookaheadEndIndex:fr})})}),[at,Ae,ur,dr,fr,Qe,st,z,fe,Ce]),hr=l.useCallback(s=>V[s],[V]),mr=l.useRef(null);l.useLayoutEffect(()=>{const s=mr.current;if(mr.current={items:V,offsets:Pe},!Gt||!s||s.items===V)return;const u=Se.current,E=u?.getScrollPosition(),k=typeof E=="number"&&E>=0?E:ht.current,B=Hn(s.items,s.offsets,k);if(!B)return;const J=Wn(B,V,Pe);if(J===null||Math.abs(J-k)<1)return;const Ee=u?u.scrollTo(J):J;ht.current=Ee,Ut(Ee)},[V,Pe,Gt]);const Te=T?.columns,ze=T?.scrollBarWidth??dt?.width??$r,te=l.useMemo(()=>Te?_n({measuredWidth:Je,columns:Te,scrollBarWidth:ze}):null,[Te,Je,ze]),lt=l.useMemo(()=>Te?Nn(Te):"",[Te]),qr=l.useMemo(()=>T?.showFooter&&Te?Pn(e):[],[T?.showFooter,Te,e]),$e=te?.maxHScroll??0;l.useEffect(()=>{We(s=>Ct(s,$e))},[$e]);const pr=l.useCallback(s=>We(u=>Ct(u+s,$e)),[$e]),yr=l.useMemo(()=>({iconOverrides:F,showExpandIcons:P,showDirectoryIcons:g,showFileIcons:D,useCanvasExpandIcons:_,expandIconSize:j,typeIconSize:Q.typeIconSize,fontSize:Q.fontSize,indentSize:Q.indentSize,highlightStyles:X,expandIconClassName:C,expandIconStyle:I}),[F,P,g,D,_,j,Q,X,C,I]),gr=l.useMemo(()=>h.jsx(he.VirtualScroll,{ref:Se,itemCount:V.length,getItem:hr,getItemHeight:tr,getItemKey:rr,testId:Vt,contentProps:Kt,locale:M,labels:U,viewportSize:typeof ae=="number"?ae:void 0,overscanCount:ge,onScroll:Jt,onRangeChange:qt,onScrollAdjust:Dt,liveRegion:Ft,className:ee,onWheelHorizontal:se?pr:void 0,background:h.jsxs(h.Fragment,{children:[se&&te?h.jsx("div",{className:"pointer-events-none absolute top-0 left-0 z-0 h-full overflow-hidden",style:{width:te.nameWidth},"aria-hidden":"true",children:It}):It,Mt]}),initialScrollIndex:zt,initialScrollOffset:Le,initialScrollAnchor:$t,callbackThrottleMs:Bt,contentInsets:Ht,scrollBarOptions:dt,behaviorOptions:Xt,children:(s,u)=>s?se&&T&&te?h.jsx(Dr,{entry:s.entry,indentLevel:s.indentLevel,positionInSet:s.positionInSet,setSize:s.setSize,rowIndex:u+(T.showHeader??!0?2:1),flatIndex:u,onRowFocus:xt,onRowBlur:Et,isSelectedForAria:!!N?.has(s.entry.absolutePath),rowHeight:s.rowHeight,isDirOpen:be,columns:T.columns,numericTemplate:lt,numericTotal:te.numericTotal,nameWidth:te.nameWidth,rowClassName:T.rowClassName,selection:{onEntryClick:w,selectedPath:De,currentPath:gt,mode:R,selectedItems:N,onSelectionChange:m},expansion:{toggleDirectory:t,onToggleDirectoryRecursive:mt},visual:yr},s.entry.absolutePath):h.jsx(Gr,{entry:s.entry,indentLevel:s.indentLevel,originX:et,depth:s.depth,positionInSet:s.positionInSet,setSize:s.setSize,isSelectedForAria:!!N?.has(s.entry.absolutePath),flatIndex:u,isActive:u===Fe,registerRowRef:ir,onNavigationKeyDown:cr,onRowFocus:xt,onRowBlur:Et,rowHeight:s.rowHeight,entryKindDirectory:Oe,entryKindFile:ne,isDirOpen:be,expansion:{toggleDirectory:t,onToggleDirectoryRecursive:mt},selection:{onEntryClick:w,selectedPath:De,currentPath:gt,mode:R,selectedItems:N,onSelectionChange:m},visual:{iconOverrides:F,showExpandIcons:P,showDirectoryIcons:g,showFileIcons:D,useCanvasExpandIcons:_,expandIconSize:j,typeIconSize:Q.typeIconSize,fontSize:Q.fontSize,indentSize:Q.indentSize,highlightStyles:X,entryClassName:re,entryStyle:we,nameClassName:Y,nameStyle:G,directoryNameClassName:ve,directoryNameStyle:me,fileNameClassName:o,fileNameStyle:f,expandIconClassName:C,expandIconStyle:I}},s.entry.absolutePath):null}),[V.length,hr,tr,rr,Vt,Kt,M,U,Oe,ne,Fe,ir,cr,xt,Et,ae,ge,Jt,qt,Dt,Ft,ee,se,pr,te,It,Mt,zt,Le,$t,Bt,Ht,dt,Xt,T,lt,be,w,De,gt,R,N,m,t,mt,yr,F,P,g,D,_,j,Q,et,X,re,we,Y,G,ve,me,o,f,C,I]);if(!(T&&te))return h.jsxs("div",{ref:ke,className:Zt,style:Qt,onPointerDownCapture:ot,onMouseDownCapture:ot,children:[_e.length>0&&!Ur&&h.jsx("span",{tabIndex:0,"data-directory-tree-tab-stop":"",style:ro,onFocus:Jr}),gr]});const Zr=T.showHeader??!0,Qr=T.showFooter??!1,en={...Qt,"--dt-hscroll":`${He}px`};return h.jsxs("div",{ref:ke,className:L.twMerge(Zt,"dt-grid"),style:en,role:"treegrid","aria-label":v?void 0:y,"aria-labelledby":v,"aria-multiselectable":R==="multiple"?!0:void 0,"aria-rowcount":V.length+(T.showHeader??!0?1:0),onPointerDownCapture:ot,onMouseDownCapture:ot,children:[Zr&&h.jsx("div",{role:"rowgroup",children:h.jsx(kn,{columns:T.columns,numericTemplate:lt,numericTotal:te.numericTotal,nameWidth:te.nameWidth,scrollBarWidth:ze,className:T.headerClassName})}),h.jsx("div",{ref:Me,className:"dt-grid-body",children:gr}),$e>0&&h.jsxs("div",{className:"dt-grid-hscrollbar-row",children:[h.jsx("div",{className:"dt-grid-scrollbar-spacer",style:{width:te.nameWidth},"aria-hidden":"true"}),h.jsx(he.ScrollBar,{horizontal:!0,contentSize:te.numericTotal,viewportSize:te.numericVisible,scrollPosition:He,scrollBarWidth:ze,locale:M,labels:U,onScroll:s=>{const u=typeof s=="function"?s(He):s,E=Ct(u,$e);return We(E),E}}),h.jsx("div",{className:"dt-grid-scrollbar-spacer",style:{width:ze},"aria-hidden":"true"})]}),Qr&&h.jsx("div",{role:"rowgroup",children:h.jsx(Cn,{columns:T.columns,numericTemplate:lt,numericTotal:te.numericTotal,nameWidth:te.nameWidth,scrollBarWidth:ze,allEntries:qr,className:T.footerClassName})})]})},lo=({initialExpanded:e=new Set,storageKey:t}={})=>{const[r,n]=l.useTransition(),[a,c]=l.useState(()=>{if(typeof window<"u"&&t)try{const p=window.localStorage.getItem(t);if(p){const y=JSON.parse(p);return new Set(y)}}catch(p){console.error("[useDirectoryTreeState] Error reading from localStorage",p)}return e}),i=l.useCallback(p=>{n(()=>{c(y=>{const v=new Set(y);return p(v),v})})},[]),d=l.useCallback((p,y)=>{i(v=>{for(const z of p)y(v,z)})},[i]);l.useEffect(()=>{if(t&&typeof window<"u")try{window.localStorage.setItem(t,JSON.stringify(Array.from(a)))}catch(p){console.warn(`Error setting localStorage key "${t}":`,p)}},[a,t]);const w=l.useCallback(p=>{d([p],(y,v)=>{y.has(v)?y.delete(v):y.add(v)})},[d]),S=l.useCallback(p=>{d([p],(y,v)=>{y.add(v)})},[d]),x=l.useCallback(p=>{d([p],(y,v)=>{y.delete(v)})},[d]),R=l.useCallback(p=>{d(p,(y,v)=>{y.delete(v)})},[d]),N=l.useCallback(p=>{d(p,(y,v)=>{y.add(v)})},[d]),m=l.useCallback(()=>{i(p=>{p.clear()})},[i]),b=l.useCallback(p=>a.has(p),[a]);return{expanded:a,toggle:w,expand:S,collapse:x,collapseMultiple:R,expandMultiple:N,collapseAll:m,isExpanded:b,isPending:r}};exports.DIRECTORY_TREE_LABEL_CATALOGS=Hr;exports.DIRECTORY_TREE_LABEL_KEYS=_t;exports.DirectoryTree=ao;exports.directoryTreeClasses=A;exports.resolveDirectoryTreeLabels=Wr;exports.useDirectoryTreeState=lo;
|