@aiquants/directory-tree 5.0.1 → 6.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react"),me=require("@aiquants/virtualscroll"),A=require("tailwind-merge"),le=require("@phosphor-icons/react");function cn(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=cn(l);var ut={exports:{}},Ke={};var Sr;function un(){if(Sr)return Ke;Sr=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,o,c){var i=null;if(c!==void 0&&(i=""+c),o.key!==void 0&&(i=""+o.key),"key"in o){c={};for(var d in o)d!=="key"&&(c[d]=o[d])}else c=o;return o=c.ref,{$$typeof:e,type:n,key:i,ref:o!==void 0?o:null,props:c}}return Ke.Fragment=t,Ke.jsx=r,Ke.jsxs=r,Ke}var Ue={};var vr;function dn(){return vr||(vr=1,process.env.NODE_ENV!=="production"&&(function(){function e(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===z?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case y:return"Fragment";case $:return"Profiler";case v:return"StrictMode";case D:return"Suspense";case F:return"SuspenseList";case K:return"Activity"}if(typeof s=="object")switch(typeof s.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),s.$$typeof){case p:return"Portal";case P:return s.displayName||"Context";case N:return(s._context.displayName||"Context")+".Consumer";case g:var f=s.render;return s=s.displayName,s||(s=f.displayName||f.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case O:return f=s.displayName||null,f!==null?f:e(s.type)||"Memo";case q:f=s._payload,s=s._init;try{return e(s(f))}catch{}}return null}function t(s){return""+s}function r(s){try{t(s);var f=!1}catch{f=!0}if(f){f=console;var T=f.error,R=typeof Symbol=="function"&&Symbol.toStringTag&&s[Symbol.toStringTag]||s.constructor.name||"Object";return T.call(f,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",R),t(s)}}function n(s){if(s===y)return"<>";if(typeof s=="object"&&s!==null&&s.$$typeof===q)return"<...>";try{var f=e(s);return f?"<"+f+">":"<...>"}catch{return"<...>"}}function o(){var s=H.A;return s===null?null:s.getOwner()}function c(){return Error("react-stack-top-frame")}function i(s){if(ue.call(s,"key")){var f=Object.getOwnPropertyDescriptor(s,"key").get;if(f&&f.isReactWarning)return!1}return s.key!==void 0}function d(s,f){function T(){de||(de=!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))}T.isReactWarning=!0,Object.defineProperty(s,"key",{get:T,configurable:!0})}function S(){var s=e(this.type);return G[s]||(G[s]=!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.")),s=this.props.ref,s!==void 0?s:null}function w(s,f,T,R,ye,C){var j=T.ref;return s={$$typeof:b,type:s,key:f,props:T,_owner:R},(j!==void 0?j:null)!==null?Object.defineProperty(s,"ref",{enumerable:!1,get:S}):Object.defineProperty(s,"ref",{enumerable:!1,value:null}),s._store={},Object.defineProperty(s._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(s,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(s,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ye}),Object.defineProperty(s,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:C}),Object.freeze&&(Object.freeze(s.props),Object.freeze(s)),s}function E(s,f,T,R,ye,C){var j=f.children;if(j!==void 0)if(R)if(W(j)){for(R=0;R<j.length;R++)I(j[R]);Object.freeze&&Object.freeze(j)}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 I(j);if(ue.call(f,"key")){j=e(s);var Z=Object.keys(f).filter(function(Re){return Re!=="key"});R=0<Z.length?"{key: someKey, "+Z.join(": ..., ")+": ...}":"{key: someKey}",pe[j+R]||(Z=0<Z.length?"{"+Z.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react"),ye=require("@aiquants/virtualscroll"),K=require("tailwind-merge"),le=require("@phosphor-icons/react");function hn(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 ue=hn(l);var ft={exports:{}},Je={};var wr;function mn(){if(wr)return Je;wr=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,a,i){var c=null;if(i!==void 0&&(c=""+i),a.key!==void 0&&(c=""+a.key),"key"in a){i={};for(var u in a)u!=="key"&&(i[u]=a[u])}else i=a;return a=i.ref,{$$typeof:e,type:n,key:c,ref:a!==void 0?a:null,props:i}}return Je.Fragment=t,Je.jsx=r,Je.jsxs=r,Je}var qe={};var Er;function pn(){return Er||(Er=1,process.env.NODE_ENV!=="production"&&(function(){function e(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===F?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case E:return"Fragment";case $:return"Profiler";case v:return"StrictMode";case M:return"Suspense";case D:return"SuspenseList";case X: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 y:return"Portal";case P:return o.displayName||"Context";case N:return(o._context.displayName||"Context")+".Consumer";case b:var f=o.render;return o=o.displayName,o||(o=f.displayName||f.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case O: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 I=f.error,R=typeof Symbol=="function"&&Symbol.toStringTag&&o[Symbol.toStringTag]||o.constructor.name||"Object";return I.call(f,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",R),t(o)}}function n(o){if(o===E)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 i(){return Error("react-stack-top-frame")}function c(o){if(fe.call(o,"key")){var f=Object.getOwnPropertyDescriptor(o,"key").get;if(f&&f.isReactWarning)return!1}return o.key!==void 0}function u(o,f){function I(){he||(he=!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))}I.isReactWarning=!0,Object.defineProperty(o,"key",{get:I,configurable:!0})}function m(){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,I,R,be,C){var L=I.ref;return o={$$typeof:g,type:o,key:f,props:I,_owner:R},(L!==void 0?L:null)!==null?Object.defineProperty(o,"ref",{enumerable:!1,get:m}):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:be}),Object.defineProperty(o,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:C}),Object.freeze&&(Object.freeze(o.props),Object.freeze(o)),o}function T(o,f,I,R,be,C){var L=f.children;if(L!==void 0)if(R)if(B(L)){for(R=0;R<L.length;R++)x(L[R]);Object.freeze&&Object.freeze(L)}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 x(L);if(fe.call(f,"key")){L=e(o);var Z=Object.keys(f).filter(function(Ie){return Ie!=="key"});R=0<Z.length?"{key: someKey, "+Z.join(": ..., ")+": ...}":"{key: someKey}",ge[L+R]||(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} />`,R,j,Z,j),pe[j+R]=!0)}if(j=null,T!==void 0&&(r(T),j=""+T),i(f)&&(r(f.key),j=""+f.key),"key"in f){T={};for(var fe in f)fe!=="key"&&(T[fe]=f[fe])}else T=f;return j&&d(T,typeof s=="function"?s.displayName||s.name||"Unknown":s),w(s,j,T,o(),ye,C)}function I(s){_(s)?s._store&&(s._store.validated=1):typeof s=="object"&&s!==null&&s.$$typeof===q&&(s._payload.status==="fulfilled"?_(s._payload.value)&&s._payload.value._store&&(s._payload.value._store.validated=1):s._store&&(s._store.validated=1))}function _(s){return typeof s=="object"&&s!==null&&s.$$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"),$=Symbol.for("react.profiler"),N=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"),O=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),K=Symbol.for("react.activity"),z=Symbol.for("react.client.reference"),H=m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue=Object.prototype.hasOwnProperty,W=Array.isArray,re=console.createTask?console.createTask:function(){return null};m={react_stack_bottom_frame:function(s){return s()}};var de,G={},V=m.react_stack_bottom_frame.bind(m,c)(),ve=re(n(c)),pe={};Ue.Fragment=y,Ue.jsx=function(s,f,T){var R=1e4>H.recentlyCreatedOwnerStacks++;return E(s,f,T,!1,R?Error("react-stack-top-frame"):V,R?re(n(s)):ve)},Ue.jsxs=function(s,f,T){var R=1e4>H.recentlyCreatedOwnerStacks++;return E(s,f,T,!0,R?Error("react-stack-top-frame"):V,R?re(n(s)):ve)}})()),Ue}var wr;function fn(){return wr||(wr=1,process.env.NODE_ENV==="production"?ut.exports=un():ut.exports=dn()),ut.exports}var h=fn();function hn({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 mn=ce.forwardRef(hn);function pn({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 yn=ce.forwardRef(pn);function gn({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 bn=ce.forwardRef(gn),Pr="text-[length:var(--dt-font-size-body,0.8125rem)]",Sn=`${Pr} leading-[max(var(--dt-line-height-body,1.25rem),1.5em)]`,Tt=44,vn=12,wn=8,ie=14,En=14,Or=e=>e===void 0?void 0:{fontSize:typeof e=="number"?`${e}px`:e},oe=e=>({width:e,height:e}),M={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 ${Sn}`,entryHover:A.twMerge("directory-tree-entry--hover hover:bg-gray-400/15","dark:hover:bg-gray-200/10"),entrySelected:A.twMerge("directory-tree-entry--selected bg-blue-400/10","dark:bg-blue-400/15"),entryItemSelected:A.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:A.twMerge("directory-tree-expand-icon flex-shrink-0 flex items-center justify-center","text-gray-500","dark:text-gray-400"),expandIconSelected:A.twMerge("directory-tree-expand-icon--selected text-blue-700","dark:text-blue-400"),typeIcon:A.twMerge("directory-tree-type-icon flex-shrink-0 flex items-center justify-center","text-gray-500","dark:text-gray-400"),typeIconSelected:A.twMerge("directory-tree-type-icon--selected text-blue-700","dark:text-blue-400"),name:A.twMerge(`directory-tree-name overflow-hidden text-ellipsis whitespace-nowrap ml-1 ${Pr} font-normal`,"text-gray-700","dark:text-gray-200"),nameDirectory:"directory-tree-name--directory font-medium",nameSelected:A.twMerge("directory-tree-name--selected text-blue-800 font-semibold","dark:text-blue-300")},Lt=e=>{const t=e.slice(e.lastIndexOf("/")+1),r=t.lastIndexOf(".");return r<=0?"":t.slice(r+1).toLowerCase()},xn=/^[a-z][a-z\d+.-]*:\/\//i,Er=e=>Lt(xn.test(e)?e.split(/[?#]/,1)[0]:e),jr=e=>Lt(e.name)||Er(e.relativePath)||Er(e.absolutePath),Lr=({isDirectory:e,isExpanded:t,showExpandIcons:r,useCanvasExpandIcons:n,expandIconSize:o})=>{const c=o?{width:o,height:o}:void 0,i=o?"":"h-4 w-4";return!(r&&e)||n?h.jsx("span",{className:i,style:c,"aria-hidden":"true"}):t?h.jsx(mn,{className:i,style:c}):h.jsx(yn,{className:i,style:c})},_t=(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(o=>_t(o,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},Rn={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)})},In={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"]},kn=new Map(Object.entries(In).flatMap(([e,t])=>t.map(r=>[r,e]))),Tn=new Set(["","application/octet-stream","binary/octet-stream","text/plain","application/x-empty"]),Cn=e=>(e??"").split(";",1)[0].trim().toLowerCase(),_n=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"},Nn=(e,t,r,n)=>{const o=Cn(e),c=_n(o),i=kn.get((t||(r?Lt(r):"")).toLowerCase()),S=(Tn.has(o)?[i,c]:[c,i]).find(w=>w!==void 0);return S===void 0?h.jsx(le.FileIcon,{className:"text-gray-400 dark:text-gray-400",style:oe(n)}):Rn[S](n)},Ar=(e,t,r)=>{const{entry:n,isDirectory:o,isExpanded:c,extension:i,mimeType:d}=e;let S;const w=d||n.mimeType;return n.icon!==void 0?S=n.icon:o?S=c&&t?.directoryExpanded||t?.directory||h.jsx(bn,{style:oe(r)}):i&&t?.fileByExtension?.[i]?S=t.fileByExtension[i]:S=t?.file||Nn(w,i,n.name,r),_t(typeof S=="function"?S(e):S,n.absolutePath)},Pn=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Mr=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-${Pn(r)}`,String(n)]))},Dr=["color","background","backgroundColor","backgroundImage","backgroundPosition","backgroundSize","backgroundRepeat","backgroundClip","backgroundOrigin","backgroundAttachment","backgroundBlendMode","opacity","boxShadow","filter","backdropFilter","mixBlendMode","borderColor","borderRadius","outline","outlineColor","outlineStyle","outlineWidth","outlineOffset","textShadow","accentColor","caretColor","cursor","fontFamily","fontSize","fontStyle","fontWeight","fontVariant","fontFeatureSettings","fontVariationSettings","fontKerning","letterSpacing","lineHeight","textDecoration","textDecorationColor","textDecorationLine","textDecorationStyle","textDecorationThickness","textUnderlineOffset","textTransform"],Fr=["color","opacity"],On="the row's box belongs to the tree (height: visual.itemHeight, indent: visual.indentSize, icons: visual.typeIconSize, text size: visual.fontSize)",jn=new Set(Dr),Ln=new Set(Fr),xr=(e,t)=>{const r=t===void 0?e.option:`${e.option}.${t}`;return e.absolutePath===void 0?r:`${r} of "${e.absolutePath}"`},$r=(e,t,r,n)=>{if(e!==void 0){if(typeof e!="object"||e===null)throw new RangeError(`${xr(r,void 0)} must be an object of CSS properties or undefined, got ${e===null?"null":typeof e}.`);for(const[o,c]of Object.entries(e))if(c!==void 0&&!t.has(o))throw new RangeError(`${xr(r,o)} cannot be set: ${On}, so ${n}.`)}},Be=(e,t)=>$r(e,jn,t,"a row style accepts only paint and text properties (ROW_STYLE_PROPERTIES)"),An=(e,t)=>$r(e,Ln,t,"the expand icon style accepts only the glyph's colour and opacity (EXPAND_ICON_STYLE_PROPERTIES), and the 14 px expand box is the tree's"),Mn=500,zr=({entry:e,isDirectory:t,isExpanded:r,isItemSelected:n,selectionMode:o,onSelectionChange:c,onEntryClick:i,toggleDirectory:d,onToggleDirectoryRecursive:S})=>{const w=l.useRef(null);return l.useEffect(()=>()=>{w.current&&window.clearTimeout(w.current)},[]),l.useCallback(E=>{E.stopPropagation(),o!=="none"&&!t&&c&&c(e,!n);let I=!1;i({entry:e,isDirectory:t,isExpanded:r,preventDefault:()=>{I=!0}}),!(!t||I)&&(w.current?(window.clearTimeout(w.current),w.current=null,S(e)):w.current=window.setTimeout(()=>{d(e.absolutePath),w.current=null},Mn))},[t,e,r,S,d,i,o,c,n])},Br=e=>e==="right"?"dt-grid-cell--right":e==="center"?"dt-grid-cell--center":"",Rr=(e,t)=>e.children!==void 0&&t(e.absolutePath),Wr=(e,t)=>({width:e,gridTemplateColumns:t}),Hr=l.memo(({entry:e,indentLevel:t,positionInSet:r,setSize:n,rowIndex:o,flatIndex:c,onRowFocus:i,onRowBlur:d,isSelectedForAria:S,rowHeight:w,isDirOpen:E,columns:I,numericTemplate:_,numericTotal:m,nameWidth:b,rowClassName:p,selection:{onEntryClick:y,selectedPath:v,currentPath:$,mode:N="none",selectedItems:P,onSelectionChange:g},expansion:{toggleDirectory:D,onToggleDirectoryRecursive:F},visual:{iconOverrides:O,showExpandIcons:q=!0,showDirectoryIcons:K=!0,showFileIcons:z=!0,useCanvasExpandIcons:H=!1,expandIconSize:ue,typeIconSize:W,fontSize:re,indentSize:de,highlightStyles:G,expandIconClassName:V,expandIconStyle:ve}})=>{Be(e.style,{option:"entry.style",absolutePath:e.absolutePath});const[pe,s]=l.useState(!1),f=e.children!==void 0,T=f&&E(e.absolutePath),R=e.absolutePath===v,ye=e.absolutePath===$,C=!f&&!!P?.has(e.absolutePath),j=f?void 0:jr(e),Z=zr({entry:e,isDirectory:f,isExpanded:T,isItemSelected:C,selectionMode:N,onSelectionChange:g,onEntryClick:y,toggleDirectory:D,onToggleDirectoryRecursive:F}),fe=pe?G?.hoverClassName!==void 0?G.hoverClassName:M.entryHover:"",Re=(()=>{if(f){if(R)return G?.directorySelectedClassName!==void 0?G.directorySelectedClassName:M.entrySelected}else if(R||C)return G?.itemSelectedClassName!==void 0?G.itemSelectedClassName:A.twMerge(R&&M.entrySelected,C&&M.entryItemSelected);return""})(),L=typeof p=="function"?p(e):p,ge=A.twMerge("dt-grid-row cursor-pointer select-none",fe,Re,L,e.className),U=A.twMerge(M.expandIcon,V,(R||C)&&M.expandIconSelected),je=A.twMerge(M.typeIcon,(R||C)&&M.typeIconSelected),ne=A.twMerge("dt-grid-name-label ml-1","text-gray-700 dark:text-gray-200",f&&M.nameDirectory,(R||C)&&M.nameSelected),Q=Lr({isDirectory:f,isExpanded:T,showExpandIcons:q,useCanvasExpandIcons:H,expandIconSize:ue}),se=(f?K:z)?Ar({entry:e,isDirectory:f,isExpanded:T,isSelected:R,isItemSelected:C,extension:j,mimeType:e.mimeType},O,W):null,Ie={indentLevel:t,isDirectory:f,isExpanded:T},[_e,...ke]=I,Le=_e?.render?_e.render(e,Ie):e.label??e.name,we={...pe?G?.hoverStyle:{},...f&&R?G?.directorySelectedStyle:{},...!f&&(R||C)?G?.itemSelectedStyle:{}};return h.jsxs("div",{className:ge,style:{...we,...e.style,height:w},role:"row","aria-expanded":f?T:void 0,"aria-level":t+1,"aria-posinset":r,"aria-setsize":n,"aria-rowindex":o,"aria-selected":N==="none"?void 0:S,"aria-current":ye?"page":void 0,...Mr(e.data),"data-entry-type":f?"directory":"file","data-entry-expanded":f?String(T):void 0,"data-entry-selected":R?"true":void 0,"data-entry-item-selected":C?"true":void 0,onClick:Z,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),onFocus:Y=>i(c,e.absolutePath,Y.currentTarget),onBlur:Y=>d(e.absolutePath,Y.currentTarget),onKeyDown:Y=>{if(Y.key==="Enter"){if(Y.repeat){Y.preventDefault();return}Z(Y)}},tabIndex:0,children:[h.jsxs("div",{className:A.twMerge("dt-grid-name-cell",_e?.className),role:"gridcell",style:{width:b,paddingLeft:Math.max(0,t*de)},children:[(q||H)&&h.jsx("span",{className:U,style:{...ve,width:ie,height:ie},children:Q}),(f?K:z)&&h.jsx("span",{className:je,style:{width:W,height:W},children:se}),h.jsx("span",{className:ne,style:Or(re),children:Le})]}),ke.length>0&&h.jsx("div",{className:"dt-grid-numeric-viewport",children:h.jsx("div",{className:"dt-grid-numeric-track",style:Wr(m,_),children:ke.map(Y=>h.jsx("div",{className:A.twMerge("dt-grid-cell",Br(Y.align),Y.className),role:"gridcell",children:Y.render?Y.render(e,Ie):null},Y.key))})})]})},(e,t)=>{if(e.entry!==t.entry)return!1;const r=Rr(e.entry,e.isDirOpen),n=Rr(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});Hr.displayName="DirectoryTreeGridRow";const Yr=({kind:e,columns:t,numericTemplate:r,numericTotal:n,nameWidth:o,scrollBarWidth:c,className:i,nameContent:d,renderCell:S})=>{const[,...w]=t,E=e==="header"?"dt-grid-name-header":"dt-grid-name-footer",I=e==="header"?"dt-grid-header":"dt-grid-footer",_=e==="header"?"columnheader":"gridcell";return h.jsxs("div",{className:A.twMerge(I,"text-gray-600 dark:text-gray-300",i),role:"row",children:[h.jsx("div",{className:A.twMerge(E,"px-1",t[0]?.className),role:_,style:{width:o},children:d}),w.length>0&&h.jsx("div",{className:"dt-grid-numeric-viewport",children:h.jsx("div",{className:"dt-grid-numeric-track",style:Wr(n,r),children:w.map(m=>h.jsx("div",{className:A.twMerge("dt-grid-cell",Br(m.align),m.className),role:_,children:S(m)},m.key))})}),h.jsx("div",{className:"dt-grid-scrollbar-spacer",style:{width:c},"aria-hidden":"true"})]})},Dn=({columns:e,className:t,...r})=>h.jsx(Yr,{kind:"header",columns:e,className:t,nameContent:e[0]?.header??null,renderCell:n=>n.header??null,...r}),Ir=(e,t)=>typeof e=="function"?e(t):e??null,Fn=({columns:e,allEntries:t,className:r,...n})=>h.jsx(Yr,{kind:"footer",columns:e,className:r,nameContent:Ir(e[0]?.footer,t),renderCell:o=>Ir(o.footer,t),...n}),$n=240,Gr=96,Vr=12,Nt=(e,t)=>{const r=e?.width;return typeof r=="number"&&Number.isFinite(r)&&r>0?r:t},zn=e=>e.slice(1).map(t=>`${Nt(t,Gr)}px`).join(" "),Bn=({measuredWidth:e,columns:t,scrollBarWidth:r=Vr})=>{const n=Nt(t[0],$n),o=t.slice(1).reduce((S,w)=>S+Nt(w,Gr),0),c=Number.isFinite(e)&&e>0?e:0,i=Math.max(0,c-n-Math.max(0,r)),d=Math.max(0,o-i);return{nameWidth:n,numericTotal:o,numericVisible:i,maxHScroll:d}},Ct=(e,t)=>!Number.isFinite(e)||e<0?0:e>t?t:e,Wn=e=>{const t=[],r=n=>{for(const o of n)t.push(o),o.children&&o.children.length>0&&r(o.children)};return r(e),t},Xr=["entryKindDirectory","entryKindFile"],Pt=[...me.VIRTUAL_SCROLL_LABEL_KEYS,...Xr],Ot=Object.freeze({en:Object.freeze({entryKindDirectory:"directory",entryKindFile:"file"}),ja:Object.freeze({entryKindDirectory:"ディレクトリ",entryKindFile:"ファイル"})}),Kr=Object.freeze({en:Object.freeze({...me.VIRTUAL_SCROLL_LABEL_CATALOGS.en,...Ot.en}),ja:Object.freeze({...me.VIRTUAL_SCROLL_LABEL_CATALOGS.ja,...Ot.ja})}),kr=e=>typeof e=="string"?JSON.stringify(e):e===null?"null":typeof e,Hn=e=>{const t={};let r=!1;for(const n of me.VIRTUAL_SCROLL_LABEL_KEYS){const o=Object.hasOwn(e,n)?e[n]:void 0;o!==void 0&&(t[n]=o,r=!0)}return r?t:void 0},Ur=(e,t)=>{const r=me.resolveVirtualScrollLocale(e);if(t===void 0)return Kr[r];if(t===null||typeof t!="object")throw new RangeError(`[directory-tree] labels must be an object; got ${kr(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(!Pt.includes(i))throw new RangeError(`[directory-tree] labels.${i} is not a known label key; expected one of ${Pt.join(", ")}`);const c={...me.resolveVirtualScrollLabels(r,Hn(t)),...Ot[r]};for(const i of Xr){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 ${kr(d)}`);c[i]=d}}return Object.freeze(c)},Yn=e=>{const t={};for(const r of me.VIRTUAL_SCROLL_LABEL_KEYS)t[r]=e[r];return Object.freeze(t)},Gn=()=>{let e=null;return{mark:t=>{const r=t.composedPath();e=r,setTimeout(()=>{e===r&&(e=null)},0)},landedOn:t=>e?.includes(t)===!0}},Je=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 ${Je(t)}.`);return t},Vn=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 ${Je(e)}.`)},Xn=({indentSize:e,typeIconSize:t,fontSize:r})=>({indentSize:e===void 0?vn:jt("indentSize",e),typeIconSize:t===void 0?En:jt("typeIconSize",t),fontSize:r===void 0?void 0:Vn(r)}),Kn=({indentSize:e,removeRootIndent:t,hasExpandBox:r})=>t?Math.max(0,e-(r?ie:0)):0,Un=(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 ${Je(n)} for ${JSON.stringify(t.absolutePath)} (row ${r}); it must return a finite number greater than 0 (px).`);return n},Jn=(e,t,r)=>{const n=t===void 0?wn: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 ${Je(n)}.`);const{indentSize:o,typeIconSize:c}=e,i=n/2,d=ie+c-n/2;if(o<i||o>d)throw new RangeError(`[directory-tree] visual.indentSize ${Je(o)} 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:o,typeIconSize:c,glyphSize:n,originX:r}},qn=({indentSize:e,typeIconSize:t,glyphSize:r})=>Math.min(Math.max(ie+t/2-e,r/2),ie-r/2),Zn=(e,t)=>{const r=e.length-1;if(r<=0)return 0;let n=0,o=r-1,c=0;for(;n<=o;){const i=n+o>>>1;e[i]<=t?(c=i,n=i+1):o=i-1}return c},Qn=(e,t,r)=>{if(r<=0||e.length===0||t.length!==e.length+1)return null;const n=Zn(t,r),o=e[n];return o?{path:o.entry.absolutePath,offsetInViewport:r-t[n]}:null},eo=(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},to=(e,t,r)=>{const n=[];for(let o=t;o<r;o++){const c=e[o];if(!(!c||c.length===0))for(const i of c)n.push(i)}return n},ro=(e,t,r)=>{const n=[];for(let o=t;o<r;o++){const c=e[o];if(!(!c||c.length===0))for(const i of c)n.push(i)}return n},no=(e,t,r,n)=>{const o=Math.max(1,Math.floor(t*n)),c=Math.max(1,Math.floor(r*n));(e.width!==o||e.height!==c)&&(e.width=o,e.height=c);const i=e.style;i.width!==`${t}px`&&(i.width=`${t}px`),i.height!==`${r}px`&&(i.height=`${r}px`)},oo=(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()},so=(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 o=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(${o}, ${c}, ${i}, ${t})`},ao=(e,t,r,n)=>{if(t.length===0)return;const o=so(r,.14),c=e.strokeStyle,i=e.fillStyle,d=e.lineWidth,S=e.lineCap,w=e.lineJoin;e.strokeStyle=r,e.lineCap="round",e.lineJoin="round";for(const E of t){const I=n??E.size,_=Math.max(0,I/2),m=Math.max(1,Math.round(I*.08)),b=Math.max(1,Math.round(I*.14)),p=Math.max(0,_-m*.8),y=Math.max(0,p*.55);o&&(e.fillStyle=o,e.beginPath(),e.arc(E.centerX,E.centerY,p,0,Math.PI*2),e.fill()),e.lineWidth=m,e.beginPath(),e.arc(E.centerX,E.centerY,Math.max(0,_-m*.3),0,Math.PI*2),e.stroke(),e.lineWidth=b,e.beginPath(),e.moveTo(E.centerX-y,E.centerY),e.lineTo(E.centerX+y,E.centerY),e.stroke(),E.isExpanded||(e.beginPath(),e.moveTo(E.centerX,E.centerY-y),e.lineTo(E.centerX,E.centerY+y),e.stroke())}e.strokeStyle=c,e.fillStyle=i,e.lineWidth=d,e.lineCap=S,e.lineJoin=w},Jr=l.memo(({segmentsByItem:e,glyphsByItem:t,itemHeight:r,width:n,viewportHeight:o,scrollPosition:c,color:i="#a0aec0",strokeWidth:d=1,renderStartIndex:S,renderEndIndex:w,lookaheadEndIndex:E,devicePixelRatio:I,expandGlyphColor:_,expandGlyphSize:m})=>{const b=l.useRef(null),p=l.useRef(null),y=l.useRef({segmentsByItem:e,glyphsByItem:t,itemHeight:r,width:n,viewportHeight:o,scrollPosition:c,color:i,strokeWidth:d,renderStartIndex:S,renderEndIndex:w,lookaheadEndIndex:E,devicePixelRatio:I,expandGlyphColor:_,expandGlyphSize:m}),v=l.useCallback(()=>{p.current=null;const N=b.current;if(!N)return;const P=N.getContext("2d");if(!P)return;const g=y.current;if(g.width<=0||g.viewportHeight<=0){P.clearRect(0,0,N.width,N.height);return}const D=Number.isFinite(g.devicePixelRatio??NaN)?g.devicePixelRatio:typeof window<"u"&&window.devicePixelRatio||1;no(N,g.width,g.viewportHeight,D);const F=g.segmentsByItem.length,O=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 W=Math.floor(g.renderEndIndex);return Math.max(Math.min(F,W+1),O)}return Math.max(q,O)})(),z=(()=>{if(typeof g.lookaheadEndIndex=="number"&&Number.isFinite(g.lookaheadEndIndex)){const W=Math.floor(g.lookaheadEndIndex),re=Math.min(F,W+1);return Math.max(re,K)}return Math.max(q,K)})(),H=to(g.segmentsByItem,O,z),ue=ro(g.glyphsByItem,O,z);P.save(),P.scale(D,D),P.clearRect(0,0,g.width,g.viewportHeight),P.translate(0,-g.scrollPosition),P.strokeStyle=g.color,oo(P,H,g.strokeWidth),ao(P,ue,g.expandGlyphColor??g.color,g.expandGlyphSize),P.restore()},[]),$=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:o,scrollPosition:c,color:i,strokeWidth:d,renderStartIndex:S,renderEndIndex:w,lookaheadEndIndex:E,devicePixelRatio:I,expandGlyphColor:_,expandGlyphSize:m},$()},[e,t,r,n,o,c,i,d,S,w,E,I,_,m,$]),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"})});Jr.displayName="TreeLineCanvas";const lo=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},Tr=(e,t)=>e.selectedPath===t?e:{selectedPath:t,selectionGeneration:e.selectionGeneration+1,anchor:e.anchor},io=(e,t)=>({...e,anchor:{path:t,selectionGeneration:e.selectionGeneration,focused:!0}}),co=(e,t)=>{const{anchor:r,selectionGeneration:n,selectedPath:o}=t;if(r!==null&&(r.focused||r.selectionGeneration===n)){const c=e.get(r.path);if(c!==void 0)return c}if(o!==null){const c=e.get(o);if(c!==void 0)return c}return 0},uo={msOverflowStyle:"none",scrollbarWidth:"none"},fo=()=>{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))},ho=e=>{const t=l.useRef(null),r=t.current;return r!==null&&me.VIRTUAL_SCROLL_LABEL_KEYS.every(n=>r[n]===e[n])?r:(t.current=e,e)},Cr=new Set(["top","bottom","center","nearest"]),_r=e=>{const t=e?.align;if(t===void 0)return"top";if(!Cr.has(t))throw new RangeError(`[directory-tree] Unsupported scroll alignment ${JSON.stringify(t)}; expected one of ${[...Cr].join(", ")}.`);return t},mo={position:"absolute",width:1,height:1,margin:-1,padding:0,border:0,overflow:"hidden",clipPath:"inset(50%)",whiteSpace:"nowrap"},po=(e,t,r,n,o)=>{const c=[],i=[];let d=0;const S=(w,E,I)=>{const _=o?[...w].sort(o):w;for(let m=0;m<_.length;m++){const b=_[m],p=m===_.length-1,y=[...I,p],v=b.children!==void 0,$=v&&t(b.absolutePath,b.relativePath);let N=E,P=I;n&&(N=E-1,P=I.slice(1)),c.push({entry:b,indentLevel:N,depth:E,positionInSet:m+1,setSize:_.length}),r&&(N>d&&(d=N),i.push({id:b.absolutePath,name:b.name,absolutePath:b.absolutePath,indentLevel:N,isLastChild:p,isDirectory:v,isExpanded:$,ancestorIsLast:[...P],hideLines:n&&E===0})),v&&$&&b.children&&S(b.children,E+1,y)}};return S(e,0,[]),{flatItems:c,lineItems:i,maxIndent:d}},Nr=(e,t)=>{const r=e.length-1;if(r<=0)return 0;let n=0,o=r-1,c=0;for(;n<=o;){const i=n+o>>>1;e[i]<=t?(c=i,n=i+1):o=i-1}return c},yo=(e,t,r,n,o,c)=>{const i=n?.renderStart??Math.max(0,Nr(c,o)),d=t>0?Nr(c,o+t)+r:i+r,S=e>0?Math.min(e-1,Math.max(i,d)):i,w=n?.renderEnd??S,E=e>0?Math.min(e-1,w+r):w;return{renderStart:i,renderEnd:w,lookaheadEnd:E}},go=(e,t,r,n)=>{if(e.length===0)return{segmentsByItem:[],glyphsByItem:[]};const{indentSize:o,typeIconSize:c,glyphSize:i,originX:d}=n,S=Array.from({length:e.length},()=>[]),w=Array.from({length:e.length},()=>[]),E=d+qn(n),I=m=>m*o+E,_=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,$=e[m+1],N=v+c/2,P=y+p,g=$!==void 0&&$.indentLevel===b.indentLevel+1&&N<P?{key:`${b.id}-connector-children`,x1:I($.indentLevel),y1:N,x2:I($.indentLevel),y2:P,itemIndex:m}:null;if(b.hideLines){g!==null&&(S[m]=[g]);continue}const D=[];for(let O=0;O<b.indentLevel;O++){if(b.ancestorIsLast[O]??!1)continue;let K=!1;for(let z=m;z<e.length;z++){const H=e[z];if(H.indentLevel>O&&H.ancestorIsLast.length>O&&!H.ancestorIsLast[O]){K=!0;break}if(z>m&&H.indentLevel===O)break}if(K){const z=I(O);D.push({key:`${b.id}-ancestor-${O}`,x1:z,y1:y,x2:z,y2:y+p,itemIndex:m})}}const F=I(b.indentLevel);m>0&&D.push({key:`${b.id}-connector-top`,x1:F,y1:y,x2:F,y2:b.isDirectory?v-_:v,itemIndex:m}),!b.isDirectory&&b.isLastChild&&D.push({key:`${b.id}-connector-horizontal`,x1:F,y1:v,x2:d+b.indentLevel*o+ie,y2:v,itemIndex:m}),b.isLastChild||(b.isDirectory?D.push({key:`${b.id}-connector-bottom`,x1:F,y1:v+_,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),S[m]=D,b.isDirectory&&(w[m]=[{key:`${b.id}-glyph`,itemIndex:m,centerX:F,centerY:v,size:i,isExpanded:b.isExpanded}])}return{segmentsByItem:S,glyphsByItem:w}},qr=l.memo(({entry:e,indentLevel:t,originX:r,depth:n,positionInSet:o,setSize:c,isSelectedForAria:i,flatIndex:d,isActive:S,registerRowRef:w,onNavigationKeyDown:E,onRowFocus:I,onRowBlur:_,rowHeight:m,entryKindDirectory:b,entryKindFile:p,isDirOpen:y,expansion:{toggleDirectory:v,onToggleDirectoryRecursive:$},selection:{onEntryClick:N,selectedPath:P,currentPath:g,mode:D="none",selectedItems:F,onSelectionChange:O},visual:{iconOverrides:q,showExpandIcons:K=!0,showDirectoryIcons:z=!0,showFileIcons:H=!0,useCanvasExpandIcons:ue=!1,expandIconSize:W,typeIconSize:re,fontSize:de,indentSize:G,highlightStyles:V,entryClassName:ve,entryStyle:pe,nameClassName:s,nameStyle:f,directoryNameClassName:T,directoryNameStyle:R,fileNameClassName:ye,fileNameStyle:C,expandIconClassName:j,expandIconStyle:Z}})=>{Be(e.style,{option:"entry.style",absolutePath:e.absolutePath});const[fe,Re]=l.useState(!1),L=e.children!==void 0,ge=L&&y(e.absolutePath),U=e.absolutePath===P,je=e.absolutePath===g,ne=!L&&F?.has(e.absolutePath),Q=l.useCallback(ee=>w(d,ee),[w,d]),se=L?void 0:jr(e),Ie=zr({entry:e,isDirectory:L,isExpanded:ge,isItemSelected:!!ne,selectionMode:D,onSelectionChange:O,onEntryClick:N,toggleDirectory:v,onToggleDirectoryRecursive:$}),_e=fe?V?.hoverClassName!==void 0?V.hoverClassName:M.entryHover:"",ke=(()=>{if(L){if(U)return V?.directorySelectedClassName!==void 0?V.directorySelectedClassName:M.entrySelected}else if(U||ne)return V?.itemSelectedClassName!==void 0?V.itemSelectedClassName:A.twMerge(U&&M.entrySelected,ne&&M.entryItemSelected);return""})(),Le=A.twMerge(M.entry,_e,ke,ve,e.className),we=A.twMerge(M.expandIcon,j,(U||ne)&&M.expandIconSelected),Y=A.twMerge(M.typeIcon,(U||ne)&&M.typeIconSelected),We=A.twMerge(M.name,s,L&&M.nameDirectory,L&&T,!L&&ye,(U||ne)&&M.nameSelected),qe=Lr({isDirectory:L,isExpanded:ge,showExpandIcons:K&&t>=0,useCanvasExpandIcons:ue,expandIconSize:W}),dt=(L?z:H)?Ar({entry:e,isDirectory:L,isExpanded:ge,isSelected:U,isItemSelected:!!ne,extension:se,mimeType:e.mimeType},q,re):null,He={...fe?V?.hoverStyle:{},...L&&U?V?.directorySelectedStyle:{},...!L&&(U||ne)?V?.itemSelectedStyle:{}},Ye=Mr(e.data),Ze={width:re,height:re},Qe=Or(de),be=r+t*G;return h.jsxs("div",{className:Le,style:{...Qe,...He,...pe,...e.style,paddingLeft:`${Math.max(0,be)}px`,transform:be<0?`translateX(${be}px)`:void 0,width:be<0?`calc(100% + ${-be}px)`:void 0,height:`${m}px`},...Ye,"data-entry-type":L?"directory":"file","data-entry-expanded":L?String(ge):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=>I(d,e.absolutePath,ee.currentTarget),onBlur:ee=>_(e.absolutePath,ee.currentTarget),ref:Q,onKeyDown:ee=>{if(ee.key==="Enter"||ee.key===" "){ee.preventDefault(),ee.repeat||Ie(ee);return}E(ee,d)},tabIndex:S?0:-1,role:"treeitem","aria-expanded":L?ge:void 0,"aria-level":n+1,"aria-posinset":o,"aria-setsize":c,"aria-selected":D==="none"?void 0:i,"aria-current":je?"page":void 0,"aria-label":`${e.name} (${L?b:p})`,children:[(K||ue)&&h.jsx("span",{className:we,style:{...Z,width:ie,height:ie},children:qe}),(L?z:H)&&h.jsx("span",{className:Y,style:Ze,children:dt}),h.jsx("span",{className:We,style:{...Qe,...f,...L?R:C},"data-entry-type":L?"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,o=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&&o===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});qr.displayName="DirectoryEntryItem";const Zr=e=>{const t=[];if(e.children)for(const r of e.children)r.type==="directory"&&(t.push(r.absolutePath),t.push(...Zr(r)));return t},bo=({entries:e,expansion:{toggle:t,isExpanded:r,expandMultiple:n,collapseMultiple:o,isPending:c,alwaysExpanded:i=!1,doubleClickAction:d="recursive"},selection:{onEntryClick:S,selectedPath:w,currentPath:E,mode:I="none",selectedItems:_,onSelectionChange:m},visual:{className:b,style:p,ariaLabel:y,ariaLabelledBy:v,lineColor:$="#A0AEC0",showTreeLines:N=!0,showExpandIcons:P=!0,showDirectoryIcons:g=!0,showFileIcons:D=!0,iconOverrides:F,expandIconSize:O,typeIconSize:q,fontSize:K,indentSize:z,itemHeight:H=Tt,removeRootIndent:ue=!1,highlightStyles:W,entryClassName:re,entryStyle:de,nameClassName:G,nameStyle:V,directoryNameClassName:ve,directoryNameStyle:pe,fileNameClassName:s,fileNameStyle:f,expandIconClassName:T,expandIconStyle:R}={},virtualScroll:ye,grid:C,sort:j,locale:Z,labels:fe,ref:Re})=>{const L=me.resolveVirtualScrollLocale(Z),ge=l.useMemo(()=>Ur(Z,fe),[Z,fe]),U=ho(Yn(ge)),{entryKindDirectory:je,entryKindFile:ne}=ge,Q=l.useMemo(()=>Xn({indentSize:z,typeIconSize:q,fontSize:K}),[z,q,K]);l.useMemo(()=>{Be(de,{option:"visual.entryStyle"}),Be(W?.hoverStyle,{option:"visual.highlightStyles.hoverStyle"}),Be(W?.directorySelectedStyle,{option:"visual.highlightStyles.directorySelectedStyle"}),Be(W?.itemSelectedStyle,{option:"visual.highlightStyles.itemSelectedStyle"}),An(R,{option:"visual.expandIconStyle"})},[de,W,R]);const se=C!==void 0,[Ie,_e]=l.useState(!1),ke=l.useRef(null),Le=l.useRef(null),we=l.useRef(null),[Y,We]=l.useState(0),[qe,dt]=l.useState(0),[He,Ye]=l.useState(0),[Ze,Qe]=l.useState(null),{overscanCount:be=15,className:ee,background:At,onScroll:Mt,onRangeChange:Dt,onScrollAdjust:Ft,liveRegion:$t,initialScrollIndex:zt,initialScrollOffset:Ae,initialScrollAnchor:Bt,callbackThrottleMs:Wt=5,contentInsets:Ht,onItemFocus:Yt,viewportHeightOverride:ae,scrollBarOptions:ft,behaviorOptions:Gt,preserveScrollAnchor:Vt=!1,getItemKey:Qr,testId:Xt,contentProps:ht}=ye??{},Kt=l.useMemo(()=>se?{...ht,role:"rowgroup"}:{...ht,role:"tree","aria-label":v?void 0:y,"aria-labelledby":v,"aria-multiselectable":I==="multiple"?!0:void 0},[se,ht,y,v,I]),Ut=l.useMemo(()=>({...Gt,enableKeyboardNavigation:!1}),[Gt]),[et,Jt]=l.useState(typeof Ae=="number"?Ae:0),mt=l.useRef(typeof Ae=="number"?Ae:0),qt=l.useCallback((a,u)=>{mt.current=a,Jt(a),Mt?.(a,u)},[Mt]),Zt=l.useCallback(a=>{const{renderingStartIndex:u,renderingEndIndex:x}=a;Qe(k=>k&&k.renderStart===u&&k.renderEnd===x?k:{renderStart:u,renderEnd:x}),Dt?.(a)},[Dt]);l.useEffect(()=>{_e(!0),fo()},[]),l.useEffect(()=>{const a=ke.current,u=se?Le.current:a,x=()=>{if(a){const B=a.clientWidth;dt(J=>Math.abs(J-B)>1?B:J)}if(typeof ae=="number")We(B=>Math.abs(B-ae)>1?ae:B);else if(u){const B=u.clientHeight;We(J=>Math.abs(J-B)>1?B:J)}};if(!(a||u))return We(0);x();const k=new ResizeObserver(x);return a&&k.observe(a),u&&u!==a&&k.observe(u),()=>k.disconnect()},[ae,se]);const Me=typeof ae=="number"?ae:Y,Se=l.useCallback(a=>i||(Ie?r(a):!1),[Ie,r,i]),Qt=A.twMerge(M.container,c&&M.containerPending,b),er=l.useMemo(()=>({...uo,...p??{},...typeof ae=="number"?{height:ae,minHeight:ae}:{}}),[p,ae]),pt=l.useCallback((a,u)=>{const x=[a.absolutePath,...Zr(a)],k=u||d;if(x.every(xe=>Se(xe)))return o(x);if(x.every(xe=>!Se(xe))||k==="recursive")return n(x);if(k==="toggle")return o(x);console.warn(`[DirectoryTree] Unknown double click action: ${k}. No action taken.`)},[Se,n,o,d]),yt=se?!1:ue,{flatItems:Ne,lineItems:gt,maxIndent:tr}=l.useMemo(()=>po(e,Se,N,yt,j),[e,Se,N,yt,j]),tt=Kn({indentSize:Q.indentSize,removeRootIndent:yt,hasExpandBox:P||N}),he=l.useMemo(()=>N?Jn(Q,O,tt):null,[N,Q,O,tt]),X=l.useMemo(()=>Ne.map((a,u)=>({...a,rowHeight:Un(H,a.entry,u)})),[Ne,H]),Te=l.useMemo(()=>X.map(a=>a.rowHeight),[X]),Pe=l.useMemo(()=>{const a=new Array(Te.length+1);a[0]=0;for(let u=0;u<Te.length;u++)a[u+1]=a[u]+Te[u];return a},[Te]),rr=l.useCallback(a=>X[a]?.rowHeight??Tt,[X]),en=l.useCallback(a=>X[a]?.entry.absolutePath??a,[X]),nr=Qr??en,De=w??null,bt=E??null,[or,Ge]=l.useState(()=>({selectedPath:De,selectionGeneration:0,anchor:null})),St=Tr(or,De);St!==or&&Ge(a=>Tr(a,De));const rt=l.useMemo(()=>lo(Ne),[Ne]),Fe=l.useMemo(()=>co(rt,St),[rt,St]),Ve=l.useRef(new Map),nt=l.useRef(null),[ot]=l.useState(Gn),Xe=l.useRef(null),[tn,sr]=l.useState(!0),vt=l.useRef(Ne);vt.current=Ne;const ar=l.useRef(Se);ar.current=Se;const wt=l.useRef(t);wt.current=t;const lr=l.useRef(rt);lr.current=rt;const Et=l.useRef(Fe);Et.current=Fe;const ir=l.useRef(Yt);ir.current=Yt;const Oe=l.useCallback(a=>{const u=we.current;return!u||u.getViewportSize()<=0?!1:(u.scrollToIndex(a,{align:"nearest"}),!0)},[]),Ee=l.useCallback(a=>{const u=Ve.current.get(a);if(u===void 0){Xe.current=a,Oe(a)||(Xe.current=null);return}Xe.current=null,Oe(a),u.focus({preventScroll:!0})},[Oe]),cr=l.useCallback((a,u)=>{if(u)Ve.current.set(a,u),Xe.current===a?(Xe.current=null,u.focus({preventScroll:!0})):u.contains(u.ownerDocument.activeElement)&&Ge(x=>x.anchor===null?x:{...x,anchor:{...x.anchor,focused:!0}});else{const x=Ve.current.get(a);Ve.current.delete(a),x?.contains(x.ownerDocument.activeElement)&&Ge(k=>k.anchor===null?k:{...k,anchor:{...k.anchor,focused:!1}})}a===Et.current&&sr(u!==null)},[]);l.useLayoutEffect(()=>{sr(Ve.current.has(Fe))},[Fe]);const xt=l.useCallback((a,u,x)=>{const k=nt.current===x;nt.current=null,k||(Ge(B=>io(B,u)),ot.landedOn(x)||Oe(a)),ir.current?.(a)},[Oe,ot]),st=l.useCallback(a=>ot.mark(a.nativeEvent),[ot]),Rt=l.useCallback((a,u)=>{const{ownerDocument:x}=u;if(!x.hasFocus()&&u.contains(x.activeElement)){nt.current=u;return}nt.current=null,Ge(k=>k.anchor!==null&&k.anchor.path===a?{...k,anchor:{...k.anchor,focused:!1}}:k)},[]),rn=l.useCallback(()=>Ee(Et.current),[Ee]),It=l.useCallback((a,u)=>{const x=_r(u),k=vt.current.length;if(!Number.isInteger(a)||a<0||a>=k)throw new RangeError(`[directory-tree] scrollToIndex: ${String(a)} is not a row index (${k===0?"the tree has no rows":`expected an integer in 0..${String(k-1)}`}).`);if(x==="nearest"){Oe(a);return}we.current?.scrollToIndex(a,{align:x})},[Oe]);l.useImperativeHandle(Re,()=>({scrollToIndex:It,scrollToPath:(a,u)=>{_r(u);const x=lr.current.get(a);return x===void 0?!1:(It(x,u),!0)},getScrollAnchor:()=>we.current?.getScrollAnchor()??null}),[It]);const ur=l.useCallback((a,u)=>{if(a.altKey||a.ctrlKey||a.metaKey)return;const x=vt.current,k=x.length-1;if(k<0)return;const B=x[u],J=B?.entry.children!==void 0,xe=J&&ar.current(B.entry.absolutePath);switch(a.key){case"ArrowDown":a.preventDefault(),Ee(Math.min(u+1,k));break;case"ArrowUp":a.preventDefault(),Ee(Math.max(u-1,0));break;case"Home":a.preventDefault(),Ee(0);break;case"End":a.preventDefault(),Ee(k);break;case"ArrowRight":a.preventDefault(),J&&!xe?wt.current(B.entry.absolutePath):J&&u<k&&x[u+1].depth>B.depth&&Ee(u+1);break;case"ArrowLeft":{if(a.preventDefault(),J&&xe){wt.current(B.entry.absolutePath);break}const ln=B?.depth??0;for(let ct=u-1;ct>=0;ct--)if(x[ct].depth<ln){Ee(ct);break}break}}},[Ee]),at=l.useMemo(()=>he===null||gt.length===0?{segmentsByItem:[],glyphsByItem:[]}:go(gt,Te,Pe,he),[gt,Te,Pe,he]),lt=l.useMemo(()=>he===null||e.length===0?0:he.originX+tr*he.indentSize+ie+he.typeIconSize,[e.length,tr,he]),{renderStart:dr,renderEnd:fr,lookaheadEnd:hr}=l.useMemo(()=>yo(X.length,Me,be,Ze,et,Pe),[X.length,Me,be,Ze,et,Pe]),kt=l.useMemo(()=>he===null||lt<=0||Me<=0||at.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:lt,height:Me},children:h.jsx(Jr,{segmentsByItem:at.segmentsByItem,glyphsByItem:at.glyphsByItem,itemHeight:Te[0]??Tt,width:lt,viewportHeight:Me,scrollPosition:et,color:$,expandGlyphColor:$,expandGlyphSize:he.glyphSize,renderStartIndex:dr,renderEndIndex:fr,lookaheadEndIndex:hr})})}),[lt,Me,dr,fr,hr,et,at,$,he,Te]),mr=l.useCallback(a=>X[a],[X]),pr=l.useRef(null);l.useLayoutEffect(()=>{const a=pr.current;if(pr.current={items:X,offsets:Pe},!Vt||!a||a.items===X)return;const u=we.current,x=u?.getScrollPosition(),k=typeof x=="number"&&x>=0?x:mt.current,B=Qn(a.items,a.offsets,k);if(!B)return;const J=eo(B,X,Pe);if(J===null||Math.abs(J-k)<1)return;const xe=u?u.scrollTo(J):J;mt.current=xe,Jt(xe)},[X,Pe,Vt]);const Ce=C?.columns,$e=C?.scrollBarWidth??ft?.width??Vr,te=l.useMemo(()=>Ce?Bn({measuredWidth:qe,columns:Ce,scrollBarWidth:$e}):null,[Ce,qe,$e]),it=l.useMemo(()=>Ce?zn(Ce):"",[Ce]),nn=l.useMemo(()=>C?.showFooter&&Ce?Wn(e):[],[C?.showFooter,Ce,e]),ze=te?.maxHScroll??0;l.useEffect(()=>{Ye(a=>Ct(a,ze))},[ze]);const yr=l.useCallback(a=>Ye(u=>Ct(u+a,ze)),[ze]),gr=l.useMemo(()=>({iconOverrides:F,showExpandIcons:P,showDirectoryIcons:g,showFileIcons:D,useCanvasExpandIcons:N,expandIconSize:O,typeIconSize:Q.typeIconSize,fontSize:Q.fontSize,indentSize:Q.indentSize,highlightStyles:W,expandIconClassName:T,expandIconStyle:R}),[F,P,g,D,N,O,Q,W,T,R]),br=l.useMemo(()=>h.jsx(me.VirtualScroll,{ref:we,itemCount:X.length,getItem:mr,getItemHeight:rr,getItemKey:nr,testId:Xt,contentProps:Kt,locale:L,labels:U,viewportSize:typeof ae=="number"?ae:void 0,overscanCount:be,onScroll:qt,onRangeChange:Zt,onScrollAdjust:Ft,liveRegion:$t,className:ee,onWheelHorizontal:se?yr: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:kt}):kt,At]}),initialScrollIndex:zt,initialScrollOffset:Ae,initialScrollAnchor:Bt,callbackThrottleMs:Wt,contentInsets:Ht,scrollBarOptions:ft,behaviorOptions:Ut,children:(a,u)=>a?se&&C&&te?h.jsx(Hr,{entry:a.entry,indentLevel:a.indentLevel,positionInSet:a.positionInSet,setSize:a.setSize,rowIndex:u+(C.showHeader??!0?2:1),flatIndex:u,onRowFocus:xt,onRowBlur:Rt,isSelectedForAria:!!_?.has(a.entry.absolutePath),rowHeight:a.rowHeight,isDirOpen:Se,columns:C.columns,numericTemplate:it,numericTotal:te.numericTotal,nameWidth:te.nameWidth,rowClassName:C.rowClassName,selection:{onEntryClick:S,selectedPath:De,currentPath:bt,mode:I,selectedItems:_,onSelectionChange:m},expansion:{toggleDirectory:t,onToggleDirectoryRecursive:pt},visual:gr},a.entry.absolutePath):h.jsx(qr,{entry:a.entry,indentLevel:a.indentLevel,originX:tt,depth:a.depth,positionInSet:a.positionInSet,setSize:a.setSize,isSelectedForAria:!!_?.has(a.entry.absolutePath),flatIndex:u,isActive:u===Fe,registerRowRef:cr,onNavigationKeyDown:ur,onRowFocus:xt,onRowBlur:Rt,rowHeight:a.rowHeight,entryKindDirectory:je,entryKindFile:ne,isDirOpen:Se,expansion:{toggleDirectory:t,onToggleDirectoryRecursive:pt},selection:{onEntryClick:S,selectedPath:De,currentPath:bt,mode:I,selectedItems:_,onSelectionChange:m},visual:{iconOverrides:F,showExpandIcons:P,showDirectoryIcons:g,showFileIcons:D,useCanvasExpandIcons:N,expandIconSize:O,typeIconSize:Q.typeIconSize,fontSize:Q.fontSize,indentSize:Q.indentSize,highlightStyles:W,entryClassName:re,entryStyle:de,nameClassName:G,nameStyle:V,directoryNameClassName:ve,directoryNameStyle:pe,fileNameClassName:s,fileNameStyle:f,expandIconClassName:T,expandIconStyle:R}},a.entry.absolutePath):null}),[X.length,mr,rr,nr,Xt,Kt,L,U,je,ne,Fe,cr,ur,xt,Rt,ae,be,qt,Zt,Ft,$t,ee,se,yr,te,kt,At,zt,Ae,Bt,Wt,Ht,ft,Ut,C,it,Se,S,De,bt,I,_,m,t,pt,gr,F,P,g,D,N,O,Q,tt,W,re,de,G,V,ve,pe,s,f,T,R]);if(!(C&&te))return h.jsxs("div",{ref:ke,className:Qt,style:er,onPointerDownCapture:st,onMouseDownCapture:st,children:[Ne.length>0&&!tn&&h.jsx("span",{tabIndex:0,"data-directory-tree-tab-stop":"",style:mo,onFocus:rn}),br]});const on=C.showHeader??!0,sn=C.showFooter??!1,an={...er,"--dt-hscroll":`${He}px`};return h.jsxs("div",{ref:ke,className:A.twMerge(Qt,"dt-grid"),style:an,role:"treegrid","aria-label":v?void 0:y,"aria-labelledby":v,"aria-multiselectable":I==="multiple"?!0:void 0,"aria-rowcount":X.length+(C.showHeader??!0?1:0),onPointerDownCapture:st,onMouseDownCapture:st,children:[on&&h.jsx("div",{role:"rowgroup",children:h.jsx(Dn,{columns:C.columns,numericTemplate:it,numericTotal:te.numericTotal,nameWidth:te.nameWidth,scrollBarWidth:$e,className:C.headerClassName})}),h.jsx("div",{ref:Le,className:"dt-grid-body",children:br}),ze>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(me.ScrollBar,{horizontal:!0,contentSize:te.numericTotal,viewportSize:te.numericVisible,scrollPosition:He,scrollBarWidth:$e,locale:L,labels:U,onScroll:a=>{const u=typeof a=="function"?a(He):a,x=Ct(u,ze);return Ye(x),x}}),h.jsx("div",{className:"dt-grid-scrollbar-spacer",style:{width:$e},"aria-hidden":"true"})]}),sn&&h.jsx("div",{role:"rowgroup",children:h.jsx(Fn,{columns:C.columns,numericTemplate:it,numericTotal:te.numericTotal,nameWidth:te.nameWidth,scrollBarWidth:$e,allEntries:nn,className:C.footerClassName})})]})},So=({initialExpanded:e=new Set,storageKey:t}={})=>{const[r,n]=l.useTransition(),[o,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 $ of p)y(v,$)})},[i]);l.useEffect(()=>{if(t&&typeof window<"u")try{window.localStorage.setItem(t,JSON.stringify(Array.from(o)))}catch(p){console.warn(`Error setting localStorage key "${t}":`,p)}},[o,t]);const S=l.useCallback(p=>{d([p],(y,v)=>{y.has(v)?y.delete(v):y.add(v)})},[d]),w=l.useCallback(p=>{d([p],(y,v)=>{y.add(v)})},[d]),E=l.useCallback(p=>{d([p],(y,v)=>{y.delete(v)})},[d]),I=l.useCallback(p=>{d(p,(y,v)=>{y.delete(v)})},[d]),_=l.useCallback(p=>{d(p,(y,v)=>{y.add(v)})},[d]),m=l.useCallback(()=>{i(p=>{p.clear()})},[i]),b=l.useCallback(p=>o.has(p),[o]);return{expanded:o,toggle:S,expand:w,collapse:E,collapseMultiple:I,expandMultiple:_,collapseAll:m,isExpanded:b,isPending:r}};exports.DIRECTORY_TREE_LABEL_CATALOGS=Kr;exports.DIRECTORY_TREE_LABEL_KEYS=Pt;exports.DirectoryTree=bo;exports.EXPAND_ICON_STYLE_PROPERTIES=Fr;exports.ROW_STYLE_PROPERTIES=Dr;exports.directoryTreeClasses=M;exports.resolveDirectoryTreeLabels=Ur;exports.useDirectoryTreeState=So;
6
+ <%s key={someKey} {...props} />`,R,L,Z,L),ge[L+R]=!0)}if(L=null,I!==void 0&&(r(I),L=""+I),c(f)&&(r(f.key),L=""+f.key),"key"in f){I={};for(var me in f)me!=="key"&&(I[me]=f[me])}else I=f;return L&&u(I,typeof o=="function"?o.displayName||o.name||"Unknown":o),S(o,L,I,a(),be,C)}function x(o){_(o)?o._store&&(o._store.validated=1):typeof o=="object"&&o!==null&&o.$$typeof===q&&(o._payload.status==="fulfilled"?_(o._payload.value)&&o._payload.value._store&&(o._payload.value._store.validated=1):o._store&&(o._store.validated=1))}function _(o){return typeof o=="object"&&o!==null&&o.$$typeof===g}var p=l,g=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),$=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),P=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),X=Symbol.for("react.activity"),F=Symbol.for("react.client.reference"),H=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,fe=Object.prototype.hasOwnProperty,B=Array.isArray,re=console.createTask?console.createTask:function(){return null};p={react_stack_bottom_frame:function(o){return o()}};var he,Y={},G=p.react_stack_bottom_frame.bind(p,i)(),Ee=re(n(i)),ge={};qe.Fragment=E,qe.jsx=function(o,f,I){var R=1e4>H.recentlyCreatedOwnerStacks++;return T(o,f,I,!1,R?Error("react-stack-top-frame"):G,R?re(n(o)):Ee)},qe.jsxs=function(o,f,I){var R=1e4>H.recentlyCreatedOwnerStacks++;return T(o,f,I,!0,R?Error("react-stack-top-frame"):G,R?re(n(o)):Ee)}})()),qe}var Rr;function yn(){return Rr||(Rr=1,process.env.NODE_ENV==="production"?ft.exports=mn():ft.exports=pn()),ft.exports}var h=yn();function gn({title:e,titleId:t,...r},n){return ue.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?ue.createElement("title",{id:t},e):null,ue.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 bn=ue.forwardRef(gn);function Sn({title:e,titleId:t,...r},n){return ue.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?ue.createElement("title",{id:t},e):null,ue.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 vn=ue.forwardRef(Sn);function wn({title:e,titleId:t,...r},n){return ue.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?ue.createElement("title",{id:t},e):null,ue.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 En=ue.forwardRef(wn),Lr={icon:{light:"#6a7282",dark:"#99a1af"},iconSelected:{light:"#1447e6",dark:"#51a2ff"},checkedRing:{light:"#155dfc",dark:"#51a2ff"}},Rn={markdown:{light:"#0084d1",dark:"#00bcff"},pdf:{light:"#e7000b",dark:"#ff6467"},spreadsheet:{light:"#007a55",dark:"#00d492"},csv:{light:"#007a55",dark:"#00d492"},document:{light:"#155dfc",dark:"#51a2ff"},presentation:{light:"#ca3500",dark:"#ff8904"},image:{light:"#00786f",dark:"#00d5be"},audio:{light:"#e60076",dark:"#fb64b6"},video:{light:"#7f22fe",dark:"#a684ff"},archive:{light:"#bb4d00",dark:"#ffb900"},code:{light:"#9810fa",dark:"#c27aff"},text:Lr.icon},jr="#71829b",ie={rowHover:"hover:bg-[color:light-dark(#f3f4f6,#1e2939)]",rowSelected:"bg-[color:light-dark(#eff6ff,#162456)]",checkedRing:"inset-ring-1 inset-ring-[color:light-dark(#155dfc,#51a2ff)]",name:"text-[color:light-dark(#364153,#e5e7eb)]",nameSelected:"text-[color:light-dark(#193cb8,#bedbff)]",gridEdge:"text-[color:light-dark(#4a5565,#d1d5dc)]",icon:"text-[color:light-dark(#6a7282,#99a1af)]",iconSelected:"text-[color:light-dark(#1447e6,#51a2ff)]"},de={markdown:"text-[color:light-dark(#0084d1,#00bcff)]",pdf:"text-[color:light-dark(#e7000b,#ff6467)]",spreadsheet:"text-[color:light-dark(#007a55,#00d492)]",csv:"text-[color:light-dark(#007a55,#00d492)]",document:"text-[color:light-dark(#155dfc,#51a2ff)]",presentation:"text-[color:light-dark(#ca3500,#ff8904)]",image:"text-[color:light-dark(#00786f,#00d5be)]",audio:"text-[color:light-dark(#e60076,#fb64b6)]",video:"text-[color:light-dark(#7f22fe,#a684ff)]",archive:"text-[color:light-dark(#bb4d00,#ffb900)]",code:"text-[color:light-dark(#9810fa,#c27aff)]",text:"text-[color:light-dark(#6a7282,#99a1af)]"},Ar="text-[length:var(--dt-font-size-body,0.8125rem)]",xn=`${Ar} leading-[max(var(--dt-line-height-body,1.25rem),1.5em)]`,_t=44,kn=12,In=8,ce=14,Cn=14,Mr=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 overflow-y-hidden pb-[3px] pr-[2px]",containerPending:"cursor-progress",entry:`directory-tree-entry flex items-center cursor-pointer relative select-none ${xn}`,entryHover:`directory-tree-entry--hover ${ie.rowHover}`,entrySelected:`directory-tree-entry--selected ${ie.rowSelected}`,entryItemSelected:`directory-tree-entry--item-selected ${ie.rowSelected} ${ie.checkedRing}`,expandIcon:`directory-tree-expand-icon flex-shrink-0 flex items-center justify-center ${ie.icon}`,expandIconSelected:`directory-tree-expand-icon--selected ${ie.iconSelected}`,typeIcon:`directory-tree-type-icon flex-shrink-0 flex items-center justify-center ${ie.icon}`,typeIconSelected:`directory-tree-type-icon--selected ${ie.iconSelected}`,name:`directory-tree-name overflow-hidden text-ellipsis whitespace-nowrap ml-1 ${Ar} font-normal ${ie.name}`,nameDirectory:"directory-tree-name--directory font-medium",nameSelected:`directory-tree-name--selected font-semibold ${ie.nameSelected}`},Mt=e=>{const t=e.slice(e.lastIndexOf("/")+1),r=t.lastIndexOf(".");return r<=0?"":t.slice(r+1).toLowerCase()},Tn=/^[a-z][a-z\d+.-]*:\/\//i,xr=e=>Mt(Tn.test(e)?e.split(/[?#]/,1)[0]:e),Dr=e=>Mt(e.name)||xr(e.relativePath)||xr(e.absolutePath),$r=({isDirectory:e,isExpanded:t,showExpandIcons:r,useCanvasExpandIcons:n,expandIconSize:a})=>{const i=a?{width:a,height:a}:void 0,c=a?"":"h-4 w-4";return!(r&&e)||n?h.jsx("span",{className:c,style:i,"aria-hidden":"true"}):t?h.jsx(bn,{className:c,style:i}):h.jsx(vn,{className:c,style:i})},Pt=(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=>Pt(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},_n={markdown:e=>h.jsx(le.FileMd,{className:de.markdown,style:oe(e)}),pdf:e=>h.jsx(le.FilePdf,{className:de.pdf,style:oe(e)}),spreadsheet:e=>h.jsx(le.FileXls,{className:de.spreadsheet,style:oe(e)}),csv:e=>h.jsx(le.FileCsv,{className:de.csv,style:oe(e)}),document:e=>h.jsx(le.FileDoc,{className:de.document,style:oe(e)}),presentation:e=>h.jsx(le.FilePpt,{className:de.presentation,style:oe(e)}),image:e=>h.jsx(le.FileImage,{className:de.image,style:oe(e)}),audio:e=>h.jsx(le.FileAudio,{className:de.audio,style:oe(e)}),video:e=>h.jsx(le.FileVideo,{className:de.video,style:oe(e)}),archive:e=>h.jsx(le.FileZip,{className:de.archive,style:oe(e)}),code:e=>h.jsx(le.FileCode,{className:de.code,style:oe(e)}),text:e=>h.jsx(le.FileText,{className:de.text,style:oe(e)})},Nn={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"]},Pn=new Map(Object.entries(Nn).flatMap(([e,t])=>t.map(r=>[r,e]))),On=new Set(["","application/octet-stream","binary/octet-stream","text/plain","application/x-empty"]),Ln=e=>(e??"").split(";",1)[0].trim().toLowerCase(),jn=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"},An=(e,t,r,n)=>{const a=Ln(e),i=jn(a),c=Pn.get((t||(r?Mt(r):"")).toLowerCase()),m=(On.has(a)?[c,i]:[i,c]).find(S=>S!==void 0);return m===void 0?h.jsx(le.FileIcon,{className:ie.icon,style:oe(n)}):_n[m](n)},Fr=(e,t,r)=>{const{entry:n,isDirectory:a,isExpanded:i,extension:c,mimeType:u}=e;let m;const S=u||n.mimeType;return n.icon!==void 0?m=n.icon:a?m=i&&t?.directoryExpanded||t?.directory||h.jsx(En,{style:oe(r)}):c&&t?.fileByExtension?.[c]?m=t.fileByExtension[c]:m=t?.file||An(S,c,n.name,r),Pt(typeof m=="function"?m(e):m,n.absolutePath)},Mn=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),zr=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-${Mn(r)}`,String(n)]))},Br=["color","background","backgroundColor","backgroundImage","backgroundPosition","backgroundSize","backgroundRepeat","backgroundClip","backgroundOrigin","backgroundAttachment","backgroundBlendMode","opacity","boxShadow","filter","backdropFilter","mixBlendMode","borderColor","borderRadius","outline","outlineColor","outlineStyle","outlineWidth","outlineOffset","textShadow","accentColor","caretColor","cursor","fontFamily","fontSize","fontStyle","fontWeight","fontVariant","fontFeatureSettings","fontVariationSettings","fontKerning","letterSpacing","lineHeight","textDecoration","textDecorationColor","textDecorationLine","textDecorationStyle","textDecorationThickness","textUnderlineOffset","textTransform"],Hr=["color","opacity"],Dn="the row's box belongs to the tree (height: visual.itemHeight, indent: visual.indentSize, icons: visual.typeIconSize, text size: visual.fontSize)",$n=new Set(Br),Fn=new Set(Hr),kr=(e,t)=>{const r=t===void 0?e.option:`${e.option}.${t}`;return e.absolutePath===void 0?r:`${r} of "${e.absolutePath}"`},Wr=(e,t,r,n)=>{if(e!==void 0){if(typeof e!="object"||e===null)throw new RangeError(`${kr(r,void 0)} must be an object of CSS properties or undefined, got ${e===null?"null":typeof e}.`);for(const[a,i]of Object.entries(e))if(i!==void 0&&!t.has(a))throw new RangeError(`${kr(r,a)} cannot be set: ${Dn}, so ${n}.`)}},We=(e,t)=>Wr(e,$n,t,"a row style accepts only paint and text properties (ROW_STYLE_PROPERTIES)"),zn=(e,t)=>Wr(e,Fn,t,"the expand icon style accepts only the glyph's colour and opacity (EXPAND_ICON_STYLE_PROPERTIES), and the 14 px expand box is the tree's"),Bn=500,Yr=({entry:e,isDirectory:t,isExpanded:r,isItemSelected:n,selectionMode:a,onSelectionChange:i,onEntryClick:c,toggleDirectory:u,onToggleDirectoryRecursive:m})=>{const S=l.useRef(null);return l.useEffect(()=>()=>{S.current&&window.clearTimeout(S.current)},[]),l.useCallback(T=>{T.stopPropagation(),a!=="none"&&!t&&i&&i(e,!n);let x=!1;c({entry:e,isDirectory:t,isExpanded:r,preventDefault:()=>{x=!0}}),!(!t||x)&&(S.current?(window.clearTimeout(S.current),S.current=null,m(e)):S.current=window.setTimeout(()=>{u(e.absolutePath),S.current=null},Bn))},[t,e,r,m,u,c,a,i,n])},Gr=e=>e==="right"?"dt-grid-cell--right":e==="center"?"dt-grid-cell--center":"",Ir=(e,t)=>e.children!==void 0&&t(e.absolutePath),Vr=(e,t)=>({width:e,gridTemplateColumns:t}),Kr=l.memo(({entry:e,indentLevel:t,positionInSet:r,setSize:n,rowIndex:a,flatIndex:i,onRowFocus:c,onRowBlur:u,isSelectedForAria:m,rowHeight:S,isDirOpen:T,columns:x,numericTemplate:_,numericTotal:p,nameWidth:g,rowClassName:y,selection:{onEntryClick:E,selectedPath:v,currentPath:$,mode:N="none",selectedItems:P,onSelectionChange:b},expansion:{toggleDirectory:M,onToggleDirectoryRecursive:D},visual:{iconOverrides:O,showExpandIcons:q=!0,showDirectoryIcons:X=!0,showFileIcons:F=!0,useCanvasExpandIcons:H=!1,expandIconSize:fe,typeIconSize:B,fontSize:re,indentSize:he,highlightStyles:Y,expandIconClassName:G,expandIconStyle:Ee}})=>{We(e.style,{option:"entry.style",absolutePath:e.absolutePath});const[ge,o]=l.useState(!1),f=e.children!==void 0,I=f&&T(e.absolutePath),R=e.absolutePath===v,be=e.absolutePath===$,C=!f&&!!P?.has(e.absolutePath),L=f?void 0:Dr(e),Z=Yr({entry:e,isDirectory:f,isExpanded:I,isItemSelected:C,selectionMode:N,onSelectionChange:b,onEntryClick:E,toggleDirectory:M,onToggleDirectoryRecursive:D}),me=ge?Y?.hoverClassName!==void 0?Y.hoverClassName:A.entryHover:"",Ie=(()=>{if(f){if(R)return Y?.directorySelectedClassName!==void 0?Y.directorySelectedClassName:A.entrySelected}else if(R||C)return Y?.itemSelectedClassName!==void 0?Y.itemSelectedClassName:K.twMerge(R&&A.entrySelected,C&&A.entryItemSelected);return""})(),j=typeof y=="function"?y(e):y,Se=K.twMerge("dt-grid-row cursor-pointer select-none",me,Ie,j,e.className),U=K.twMerge(A.expandIcon,G,(R||C)&&A.expandIconSelected),Ae=K.twMerge(A.typeIcon,(R||C)&&A.typeIconSelected),ne=K.twMerge("dt-grid-name-label ml-1",ie.name,f&&A.nameDirectory,(R||C)&&A.nameSelected),Q=$r({isDirectory:f,isExpanded:I,showExpandIcons:q,useCanvasExpandIcons:H,expandIconSize:fe}),se=(f?X:F)?Fr({entry:e,isDirectory:f,isExpanded:I,isSelected:R,isItemSelected:C,extension:L,mimeType:e.mimeType},O,B):null,Ce={indentLevel:t,isDirectory:f,isExpanded:I},[Pe,...Te]=x,Me=Pe?.render?Pe.render(e,Ce):e.label??e.name,Re={...ge?Y?.hoverStyle:{},...f&&R?Y?.directorySelectedStyle:{},...!f&&(R||C)?Y?.itemSelectedStyle:{}};return h.jsxs("div",{className:Se,style:{...Re,...e.style,height:S},role:"row","aria-expanded":f?I:void 0,"aria-level":t+1,"aria-posinset":r,"aria-setsize":n,"aria-rowindex":a,"aria-selected":N==="none"?void 0:m,"aria-current":be?"page":void 0,...zr(e.data),"data-entry-type":f?"directory":"file","data-entry-expanded":f?String(I):void 0,"data-entry-selected":R?"true":void 0,"data-entry-item-selected":C?"true":void 0,onClick:Z,onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),onFocus:W=>c(i,e.absolutePath,W.currentTarget),onBlur:W=>u(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:K.twMerge("dt-grid-name-cell",Pe?.className),role:"gridcell",style:{width:g,paddingLeft:Math.max(0,t*he)},children:[(q||H)&&h.jsx("span",{className:U,style:{...Ee,width:ce,height:ce},children:Q}),(f?X:F)&&h.jsx("span",{className:Ae,style:{width:B,height:B},children:se}),h.jsx("span",{className:ne,style:Mr(re),children:Me})]}),Te.length>0&&h.jsx("div",{className:"dt-grid-numeric-viewport",children:h.jsx("div",{className:"dt-grid-numeric-track",style:Vr(p,_),children:Te.map(W=>h.jsx("div",{className:K.twMerge("dt-grid-cell",Gr(W.align),W.className),role:"gridcell",children:W.render?W.render(e,Ce):null},W.key))})})]})},(e,t)=>{if(e.entry!==t.entry)return!1;const r=Ir(e.entry,e.isDirOpen),n=Ir(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});Kr.displayName="DirectoryTreeGridRow";const Xr=({kind:e,columns:t,numericTemplate:r,numericTotal:n,nameWidth:a,scrollBarWidth:i,className:c,nameContent:u,renderCell:m})=>{const[,...S]=t,T=e==="header"?"dt-grid-name-header":"dt-grid-name-footer",x=e==="header"?"dt-grid-header":"dt-grid-footer",_=e==="header"?"columnheader":"gridcell";return h.jsxs("div",{className:K.twMerge(x,ie.gridEdge,c),role:"row",children:[h.jsx("div",{className:K.twMerge(T,"px-1",t[0]?.className),role:_,style:{width:a},children:u}),S.length>0&&h.jsx("div",{className:"dt-grid-numeric-viewport",children:h.jsx("div",{className:"dt-grid-numeric-track",style:Vr(n,r),children:S.map(p=>h.jsx("div",{className:K.twMerge("dt-grid-cell",Gr(p.align),p.className),role:_,children:m(p)},p.key))})}),h.jsx("div",{className:"dt-grid-scrollbar-spacer",style:{width:i},"aria-hidden":"true"})]})},Hn=({columns:e,className:t,...r})=>h.jsx(Xr,{kind:"header",columns:e,className:t,nameContent:e[0]?.header??null,renderCell:n=>n.header??null,...r}),Cr=(e,t)=>typeof e=="function"?e(t):e??null,Wn=({columns:e,allEntries:t,className:r,...n})=>h.jsx(Xr,{kind:"footer",columns:e,className:r,nameContent:Cr(e[0]?.footer,t),renderCell:a=>Cr(a.footer,t),...n}),Yn=240,Ur=96,Jr=12,Ot=(e,t)=>{const r=e?.width;return typeof r=="number"&&Number.isFinite(r)&&r>0?r:t},Gn=e=>e.slice(1).map(t=>`${Ot(t,Ur)}px`).join(" "),Vn=({measuredWidth:e,columns:t,scrollBarWidth:r=Jr})=>{const n=Ot(t[0],Yn),a=t.slice(1).reduce((m,S)=>m+Ot(S,Ur),0),i=Number.isFinite(e)&&e>0?e:0,c=Math.max(0,i-n-Math.max(0,r)),u=Math.max(0,a-c);return{nameWidth:n,numericTotal:a,numericVisible:c,maxHScroll:u}},Nt=(e,t)=>!Number.isFinite(e)||e<0?0:e>t?t:e,Kn=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},qr=["entryKindDirectory","entryKindFile"],Lt=[...ye.VIRTUAL_SCROLL_LABEL_KEYS,...qr],jt=Object.freeze({en:Object.freeze({entryKindDirectory:"directory",entryKindFile:"file"}),ja:Object.freeze({entryKindDirectory:"ディレクトリ",entryKindFile:"ファイル"})}),Zr=Object.freeze({en:Object.freeze({...ye.VIRTUAL_SCROLL_LABEL_CATALOGS.en,...jt.en}),ja:Object.freeze({...ye.VIRTUAL_SCROLL_LABEL_CATALOGS.ja,...jt.ja})}),Tr=e=>typeof e=="string"?JSON.stringify(e):e===null?"null":typeof e,Xn=e=>{const t={};let r=!1;for(const n of ye.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},Qr=(e,t)=>{const r=ye.resolveVirtualScrollLocale(e);if(t===void 0)return Zr[r];if(t===null||typeof t!="object")throw new RangeError(`[directory-tree] labels must be an object; got ${Tr(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 c of Object.keys(t))if(!Lt.includes(c))throw new RangeError(`[directory-tree] labels.${c} is not a known label key; expected one of ${Lt.join(", ")}`);const i={...ye.resolveVirtualScrollLabels(r,Xn(t)),...jt[r]};for(const c of qr){const u=Object.hasOwn(t,c)?t[c]:void 0;if(u!==void 0){if(typeof u!="string"||u.trim()==="")throw new RangeError(`[directory-tree] labels.${c} must be a non-blank string; got ${Tr(u)}`);i[c]=u}}return Object.freeze(i)},Un=e=>{const t={};for(const r of ye.VIRTUAL_SCROLL_LABEL_KEYS)t[r]=e[r];return Object.freeze(t)},Jn=()=>{let e=null;return{mark:t=>{const r=t.composedPath();e=r,setTimeout(()=>{e===r&&(e=null)},0)},landedOn:t=>e?.includes(t)===!0}},Ze=e=>typeof e=="string"?JSON.stringify(e):String(e),At=(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 ${Ze(t)}.`);return t},qn=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 ${Ze(e)}.`)},Zn=({indentSize:e,typeIconSize:t,fontSize:r})=>({indentSize:e===void 0?kn:At("indentSize",e),typeIconSize:t===void 0?Cn:At("typeIconSize",t),fontSize:r===void 0?void 0:qn(r)}),Qn=({indentSize:e,removeRootIndent:t,hasExpandBox:r})=>t?Math.max(0,e-(r?ce:0)):0,eo=(e,t,r)=>{if(typeof e!="function")return At("itemHeight",e);const n=e(t,r);if(typeof n!="number"||!Number.isFinite(n)||n<=0)throw new RangeError(`[directory-tree] visual.itemHeight returned ${Ze(n)} for ${JSON.stringify(t.absolutePath)} (row ${r}); it must return a finite number greater than 0 (px).`);return n},to=(e,t,r)=>{const n=t===void 0?In:t;if(typeof n!="number"||!Number.isFinite(n)||n<=0||n>ce)throw new RangeError(`[directory-tree] visual.expandIconSize must be a finite number greater than 0 and at most ${ce} (the expand box, px) while tree lines are drawn; got ${Ze(n)}.`);const{indentSize:a,typeIconSize:i}=e,c=n/2,u=ce+i-n/2;if(a<c||a>u)throw new RangeError(`[directory-tree] visual.indentSize ${Ze(a)} does not fit the tree lines: with typeIconSize ${i} and an expand glyph of ${n} px it must be from ${c} (half the glyph) to ${u} (the ${ce} px expand box + typeIconSize − half the glyph).`);return{indentSize:a,typeIconSize:i,glyphSize:n,originX:r}},ro=({indentSize:e,typeIconSize:t,glyphSize:r})=>Math.min(Math.max(ce+t/2-e,r/2),ce-r/2),no=(e,t)=>{const r=e.length-1;if(r<=0)return 0;let n=0,a=r-1,i=0;for(;n<=a;){const c=n+a>>>1;e[c]<=t?(i=c,n=c+1):a=c-1}return i},oo=(e,t,r)=>{if(r<=0||e.length===0||t.length!==e.length+1)return null;const n=no(t,r),a=e[n];return a?{path:a.entry.absolutePath,offsetInViewport:r-t[n]}:null},so=(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},ao=(e,t,r)=>{const n=[];for(let a=t;a<r;a++){const i=e[a];if(!(!i||i.length===0))for(const c of i)n.push(c)}return n},lo=(e,t,r)=>{const n=[];for(let a=t;a<r;a++){const i=e[a];if(!(!i||i.length===0))for(const c of i)n.push(c)}return n},io=(e,t,r,n)=>{const a=Math.max(1,Math.floor(t*n)),i=Math.max(1,Math.floor(r*n));(e.width!==a||e.height!==i)&&(e.width=a,e.height=i);const c=e.style;c.width!==`${t}px`&&(c.width=`${t}px`),c.height!==`${r}px`&&(c.height=`${r}px`)},co=(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()},uo=(e,t,r,n)=>{if(t.length===0)return;const a=e.strokeStyle,i=e.lineWidth,c=e.lineCap,u=e.lineJoin;e.strokeStyle=r,e.lineCap="round",e.lineJoin="round";for(const m of t){const S=n??m.size,T=Math.max(0,S/2),x=Math.max(1,Math.round(S*.08)),_=Math.max(1,Math.round(S*.14)),p=Math.max(0,T-x*.8),g=Math.max(0,p*.55);e.lineWidth=x,e.beginPath(),e.arc(m.centerX,m.centerY,Math.max(0,T-x*.3),0,Math.PI*2),e.stroke(),e.lineWidth=_,e.beginPath(),e.moveTo(m.centerX-g,m.centerY),e.lineTo(m.centerX+g,m.centerY),e.stroke(),m.isExpanded||(e.beginPath(),e.moveTo(m.centerX,m.centerY-g),e.lineTo(m.centerX,m.centerY+g),e.stroke())}e.strokeStyle=a,e.lineWidth=i,e.lineCap=c,e.lineJoin=u},en=l.memo(({segmentsByItem:e,glyphsByItem:t,itemHeight:r,width:n,viewportHeight:a,scrollPosition:i,color:c=jr,strokeWidth:u=1,renderStartIndex:m,renderEndIndex:S,lookaheadEndIndex:T,devicePixelRatio:x,expandGlyphColor:_,expandGlyphSize:p})=>{const g=l.useRef(null),y=l.useRef(null),E=l.useRef({segmentsByItem:e,glyphsByItem:t,itemHeight:r,width:n,viewportHeight:a,scrollPosition:i,color:c,strokeWidth:u,renderStartIndex:m,renderEndIndex:S,lookaheadEndIndex:T,devicePixelRatio:x,expandGlyphColor:_,expandGlyphSize:p}),v=l.useCallback(()=>{y.current=null;const N=g.current;if(!N)return;const P=N.getContext("2d");if(!P)return;const b=E.current;if(b.width<=0||b.viewportHeight<=0){P.clearRect(0,0,N.width,N.height);return}const M=Number.isFinite(b.devicePixelRatio??NaN)?b.devicePixelRatio:typeof window<"u"&&window.devicePixelRatio||1;io(N,b.width,b.viewportHeight,M);const D=b.segmentsByItem.length,O=typeof b.renderStartIndex=="number"&&Number.isFinite(b.renderStartIndex)?Math.max(0,Math.floor(b.renderStartIndex)):Math.max(0,Math.floor(b.scrollPosition/b.itemHeight)),q=Math.min(D,Math.ceil((b.scrollPosition+b.viewportHeight)/b.itemHeight)),X=(()=>{if(typeof b.renderEndIndex=="number"&&Number.isFinite(b.renderEndIndex)){const B=Math.floor(b.renderEndIndex);return Math.max(Math.min(D,B+1),O)}return Math.max(q,O)})(),F=(()=>{if(typeof b.lookaheadEndIndex=="number"&&Number.isFinite(b.lookaheadEndIndex)){const B=Math.floor(b.lookaheadEndIndex),re=Math.min(D,B+1);return Math.max(re,X)}return Math.max(q,X)})(),H=ao(b.segmentsByItem,O,F),fe=lo(b.glyphsByItem,O,F);P.save(),P.scale(M,M),P.clearRect(0,0,b.width,b.viewportHeight),P.translate(0,-b.scrollPosition),P.strokeStyle=b.color,co(P,H,b.strokeWidth),uo(P,fe,b.expandGlyphColor??b.color,b.expandGlyphSize),P.restore()},[]),$=l.useCallback(()=>{y.current===null&&(y.current=window.requestAnimationFrame(v))},[v]);return l.useEffect(()=>{E.current={segmentsByItem:e,glyphsByItem:t,itemHeight:r,width:n,viewportHeight:a,scrollPosition:i,color:c,strokeWidth:u,renderStartIndex:m,renderEndIndex:S,lookaheadEndIndex:T,devicePixelRatio:x,expandGlyphColor:_,expandGlyphSize:p},$()},[e,t,r,n,a,i,c,u,m,S,T,x,_,p,$]),l.useEffect(()=>()=>{y.current!==null&&(window.cancelAnimationFrame(y.current),y.current=null)},[]),h.jsx("canvas",{ref:g,className:"pointer-events-none absolute top-0 left-0 z-0"})});en.displayName="TreeLineCanvas";const fo=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},_r=(e,t)=>e.selectedPath===t?e:{selectedPath:t,selectionGeneration:e.selectionGeneration+1,anchor:e.anchor},ho=(e,t)=>({...e,anchor:{path:t,selectionGeneration:e.selectionGeneration,focused:!0}}),mo=(e,t)=>{const{anchor:r,selectionGeneration:n,selectedPath:a}=t;if(r!==null&&(r.focused||r.selectionGeneration===n)){const i=e.get(r.path);if(i!==void 0)return i}if(a!==null){const i=e.get(a);if(i!==void 0)return i}return 0},po={msOverflowStyle:"none",scrollbarWidth:"none"},yo=()=>{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))},go=e=>{const t=l.useRef(null),r=t.current;return r!==null&&ye.VIRTUAL_SCROLL_LABEL_KEYS.every(n=>r[n]===e[n])?r:(t.current=e,e)},Nr=new Set(["top","bottom","center","nearest"]),Pr=e=>{const t=e?.align;if(t===void 0)return"top";if(!Nr.has(t))throw new RangeError(`[directory-tree] Unsupported scroll alignment ${JSON.stringify(t)}; expected one of ${[...Nr].join(", ")}.`);return t},bo={position:"absolute",width:1,height:1,margin:-1,padding:0,border:0,overflow:"hidden",clipPath:"inset(50%)",whiteSpace:"nowrap"},So=(e,t,r,n,a)=>{const i=[],c=[];let u=0;const m=(S,T,x)=>{const _=a?[...S].sort(a):S;for(let p=0;p<_.length;p++){const g=_[p],y=p===_.length-1,E=[...x,y],v=g.children!==void 0,$=v&&t(g.absolutePath,g.relativePath);let N=T,P=x;n&&(N=T-1,P=x.slice(1)),i.push({entry:g,indentLevel:N,depth:T,positionInSet:p+1,setSize:_.length}),r&&(N>u&&(u=N),c.push({id:g.absolutePath,name:g.name,absolutePath:g.absolutePath,indentLevel:N,isLastChild:y,isDirectory:v,isExpanded:$,ancestorIsLast:[...P],hideLines:n&&T===0})),v&&$&&g.children&&m(g.children,T+1,E)}};return m(e,0,[]),{flatItems:i,lineItems:c,maxIndent:u}},Or=(e,t)=>{const r=e.length-1;if(r<=0)return 0;let n=0,a=r-1,i=0;for(;n<=a;){const c=n+a>>>1;e[c]<=t?(i=c,n=c+1):a=c-1}return i},vo=(e,t,r,n,a,i)=>{const c=n?.renderStart??Math.max(0,Or(i,a)),u=t>0?Or(i,a+t)+r:c+r,m=e>0?Math.min(e-1,Math.max(c,u)):c,S=n?.renderEnd??m,T=e>0?Math.min(e-1,S+r):S;return{renderStart:c,renderEnd:S,lookaheadEnd:T}},wo=(e,t,r,n)=>{if(e.length===0)return{segmentsByItem:[],glyphsByItem:[]};const{indentSize:a,typeIconSize:i,glyphSize:c,originX:u}=n,m=Array.from({length:e.length},()=>[]),S=Array.from({length:e.length},()=>[]),T=u+ro(n),x=p=>p*a+T,_=c/2+2;for(let p=0;p<e.length;p++){const g=e[p],y=t[p]??0,E=r[p]??0,v=E+y/2,$=e[p+1],N=v+i/2,P=E+y,b=$!==void 0&&$.indentLevel===g.indentLevel+1&&N<P?{key:`${g.id}-connector-children`,x1:x($.indentLevel),y1:N,x2:x($.indentLevel),y2:P,itemIndex:p}:null;if(g.hideLines){b!==null&&(m[p]=[b]);continue}const M=[];for(let O=0;O<g.indentLevel;O++){if(g.ancestorIsLast[O]??!1)continue;let X=!1;for(let F=p;F<e.length;F++){const H=e[F];if(H.indentLevel>O&&H.ancestorIsLast.length>O&&!H.ancestorIsLast[O]){X=!0;break}if(F>p&&H.indentLevel===O)break}if(X){const F=x(O);M.push({key:`${g.id}-ancestor-${O}`,x1:F,y1:E,x2:F,y2:E+y,itemIndex:p})}}const D=x(g.indentLevel);p>0&&M.push({key:`${g.id}-connector-top`,x1:D,y1:E,x2:D,y2:g.isDirectory?v-_:v,itemIndex:p}),!g.isDirectory&&g.isLastChild&&M.push({key:`${g.id}-connector-horizontal`,x1:D,y1:v,x2:u+g.indentLevel*a+ce,y2:v,itemIndex:p}),g.isLastChild||(g.isDirectory?M.push({key:`${g.id}-connector-bottom`,x1:D,y1:v+_,x2:D,y2:E+y,itemIndex:p}):M.push({key:`${g.id}-connector-bottom`,x1:D,y1:v,x2:D,y2:E+y,itemIndex:p})),b!==null&&M.push(b),m[p]=M,g.isDirectory&&(S[p]=[{key:`${g.id}-glyph`,itemIndex:p,centerX:D,centerY:v,size:c,isExpanded:g.isExpanded}])}return{segmentsByItem:m,glyphsByItem:S}},tn=l.memo(({entry:e,indentLevel:t,originX:r,depth:n,positionInSet:a,setSize:i,isSelectedForAria:c,flatIndex:u,isActive:m,registerRowRef:S,onNavigationKeyDown:T,onRowFocus:x,onRowBlur:_,rowHeight:p,entryKindDirectory:g,entryKindFile:y,isDirOpen:E,expansion:{toggleDirectory:v,onToggleDirectoryRecursive:$},selection:{onEntryClick:N,selectedPath:P,currentPath:b,mode:M="none",selectedItems:D,onSelectionChange:O},visual:{iconOverrides:q,showExpandIcons:X=!0,showDirectoryIcons:F=!0,showFileIcons:H=!0,useCanvasExpandIcons:fe=!1,expandIconSize:B,typeIconSize:re,fontSize:he,indentSize:Y,highlightStyles:G,entryClassName:Ee,entryStyle:ge,nameClassName:o,nameStyle:f,directoryNameClassName:I,directoryNameStyle:R,fileNameClassName:be,fileNameStyle:C,expandIconClassName:L,expandIconStyle:Z}})=>{We(e.style,{option:"entry.style",absolutePath:e.absolutePath});const[me,Ie]=l.useState(!1),j=e.children!==void 0,Se=j&&E(e.absolutePath),U=e.absolutePath===P,Ae=e.absolutePath===b,ne=!j&&D?.has(e.absolutePath),Q=l.useCallback(ee=>S(u,ee),[S,u]),se=j?void 0:Dr(e),Ce=Yr({entry:e,isDirectory:j,isExpanded:Se,isItemSelected:!!ne,selectionMode:M,onSelectionChange:O,onEntryClick:N,toggleDirectory:v,onToggleDirectoryRecursive:$}),Pe=me?G?.hoverClassName!==void 0?G.hoverClassName:A.entryHover:"",Te=(()=>{if(j){if(U)return G?.directorySelectedClassName!==void 0?G.directorySelectedClassName:A.entrySelected}else if(U||ne)return G?.itemSelectedClassName!==void 0?G.itemSelectedClassName:K.twMerge(U&&A.entrySelected,ne&&A.entryItemSelected);return""})(),Me=K.twMerge(A.entry,Pe,Te,Ee,e.className),Re=K.twMerge(A.expandIcon,L,(U||ne)&&A.expandIconSelected),W=K.twMerge(A.typeIcon,(U||ne)&&A.typeIconSelected),Ye=K.twMerge(A.name,o,j&&A.nameDirectory,j&&I,!j&&be,(U||ne)&&A.nameSelected),Qe=$r({isDirectory:j,isExpanded:Se,showExpandIcons:X&&t>=0,useCanvasExpandIcons:fe,expandIconSize:B}),ht=(j?F:H)?Fr({entry:e,isDirectory:j,isExpanded:Se,isSelected:U,isItemSelected:!!ne,extension:se,mimeType:e.mimeType},q,re):null,Ge={...me?G?.hoverStyle:{},...j&&U?G?.directorySelectedStyle:{},...!j&&(U||ne)?G?.itemSelectedStyle:{}},Ve=zr(e.data),et={width:re,height:re},tt=Mr(he),ve=r+t*Y;return h.jsxs("div",{className:Me,style:{...tt,...Ge,...ge,...e.style,paddingLeft:`${Math.max(0,ve)}px`,transform:ve<0?`translateX(${ve}px)`:void 0,width:ve<0?`calc(100% + ${-ve}px)`:void 0,height:`${p}px`},...Ve,"data-entry-type":j?"directory":"file","data-entry-expanded":j?String(Se):void 0,"data-entry-selected":U?"true":void 0,"data-entry-item-selected":ne?"true":void 0,onClick:Ce,onMouseEnter:()=>Ie(!0),onMouseLeave:()=>Ie(!1),onFocus:ee=>x(u,e.absolutePath,ee.currentTarget),onBlur:ee=>_(e.absolutePath,ee.currentTarget),ref:Q,onKeyDown:ee=>{if(ee.key==="Enter"||ee.key===" "){ee.preventDefault(),ee.repeat||Ce(ee);return}T(ee,u)},tabIndex:m?0:-1,role:"treeitem","aria-expanded":j?Se:void 0,"aria-level":n+1,"aria-posinset":a,"aria-setsize":i,"aria-selected":M==="none"?void 0:c,"aria-current":Ae?"page":void 0,"aria-label":`${e.name} (${j?g:y})`,children:[(X||fe)&&h.jsx("span",{className:Re,style:{...Z,width:ce,height:ce},children:Qe}),(j?F:H)&&h.jsx("span",{className:W,style:et,children:ht}),h.jsx("span",{className:Ye,style:{...tt,...f,...j?R:C},"data-entry-type":j?"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),i=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===i&&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});tn.displayName="DirectoryEntryItem";const rn=e=>{const t=[];if(e.children)for(const r of e.children)r.type==="directory"&&(t.push(r.absolutePath),t.push(...rn(r)));return t},Eo=({entries:e,expansion:{toggle:t,isExpanded:r,expandMultiple:n,collapseMultiple:a,isPending:i,alwaysExpanded:c=!1,doubleClickAction:u="recursive"},selection:{onEntryClick:m,selectedPath:S,currentPath:T,mode:x="none",selectedItems:_,onSelectionChange:p},visual:{className:g,style:y,ariaLabel:E,ariaLabelledBy:v,lineColor:$=jr,showTreeLines:N=!0,showExpandIcons:P=!0,showDirectoryIcons:b=!0,showFileIcons:M=!0,iconOverrides:D,expandIconSize:O,typeIconSize:q,fontSize:X,indentSize:F,itemHeight:H=_t,removeRootIndent:fe=!1,highlightStyles:B,entryClassName:re,entryStyle:he,nameClassName:Y,nameStyle:G,directoryNameClassName:Ee,directoryNameStyle:ge,fileNameClassName:o,fileNameStyle:f,expandIconClassName:I,expandIconStyle:R}={},virtualScroll:be,grid:C,sort:L,locale:Z,labels:me,ref:Ie})=>{const j=ye.resolveVirtualScrollLocale(Z),Se=l.useMemo(()=>Qr(Z,me),[Z,me]),U=go(Un(Se)),{entryKindDirectory:Ae,entryKindFile:ne}=Se,Q=l.useMemo(()=>Zn({indentSize:F,typeIconSize:q,fontSize:X}),[F,q,X]);l.useMemo(()=>{We(he,{option:"visual.entryStyle"}),We(B?.hoverStyle,{option:"visual.highlightStyles.hoverStyle"}),We(B?.directorySelectedStyle,{option:"visual.highlightStyles.directorySelectedStyle"}),We(B?.itemSelectedStyle,{option:"visual.highlightStyles.itemSelectedStyle"}),zn(R,{option:"visual.expandIconStyle"})},[he,B,R]);const se=C!==void 0,[Ce,Pe]=l.useState(!1),Te=l.useRef(null),Me=l.useRef(null),Re=l.useRef(null),[W,Ye]=l.useState(0),[Qe,ht]=l.useState(0),[Ge,Ve]=l.useState(0),[et,tt]=l.useState(null),{overscanCount:ve=15,className:ee,background:Dt,onScroll:$t,onRangeChange:Ft,onScrollAdjust:zt,liveRegion:Bt,initialScrollIndex:Ht,initialScrollOffset:De,initialScrollAnchor:Wt,callbackThrottleMs:Yt=5,contentInsets:Gt,onItemFocus:Vt,viewportHeightOverride:ae,scrollBarOptions:mt,behaviorOptions:Kt,preserveScrollAnchor:Xt=!1,getItemKey:nn,testId:Ut,contentProps:pt}=be??{},Jt=l.useMemo(()=>se?{...pt,role:"rowgroup"}:{...pt,role:"tree","aria-label":v?void 0:E,"aria-labelledby":v,"aria-multiselectable":x==="multiple"?!0:void 0,"aria-busy":i?!0:void 0},[se,pt,E,v,x,i]),qt=l.useMemo(()=>({...Kt,enableKeyboardNavigation:!1}),[Kt]),[rt,Zt]=l.useState(typeof De=="number"?De:0),yt=l.useRef(typeof De=="number"?De:0),Qt=l.useCallback((s,d)=>{yt.current=s,Zt(s),$t?.(s,d)},[$t]),er=l.useCallback(s=>{const{renderingStartIndex:d,renderingEndIndex:w}=s;tt(k=>k&&k.renderStart===d&&k.renderEnd===w?k:{renderStart:d,renderEnd:w}),Ft?.(s)},[Ft]);l.useEffect(()=>{Pe(!0),yo()},[]),l.useEffect(()=>{const s=Te.current,d=se?Me.current:s,w=()=>{if(s){const z=s.clientWidth;ht(J=>Math.abs(J-z)>1?z:J)}if(typeof ae=="number")Ye(z=>Math.abs(z-ae)>1?ae:z);else if(d){const z=d.clientHeight;Ye(J=>Math.abs(J-z)>1?z:J)}};if(!(s||d))return Ye(0);w();const k=new ResizeObserver(w);return s&&k.observe(s),d&&d!==s&&k.observe(d),()=>k.disconnect()},[ae,se]);const $e=typeof ae=="number"?ae:W,we=l.useCallback(s=>c||(Ce?r(s):!1),[Ce,r,c]),tr=K.twMerge(A.container,i&&A.containerPending,g),rr=l.useMemo(()=>({...po,...y??{},...typeof ae=="number"?{height:ae,minHeight:ae}:{}}),[y,ae]),gt=l.useCallback((s,d)=>{const w=[s.absolutePath,...rn(s)],k=d||u;if(w.every(ke=>we(ke)))return a(w);if(w.every(ke=>!we(ke))||k==="recursive")return n(w);if(k==="toggle")return a(w);console.warn(`[DirectoryTree] Unknown double click action: ${k}. No action taken.`)},[we,n,a,u]),bt=se?!1:fe,{flatItems:Oe,lineItems:St,maxIndent:nr}=l.useMemo(()=>So(e,we,N,bt,L),[e,we,N,bt,L]),nt=Qn({indentSize:Q.indentSize,removeRootIndent:bt,hasExpandBox:P||N}),pe=l.useMemo(()=>N?to(Q,O,nt):null,[N,Q,O,nt]),V=l.useMemo(()=>Oe.map((s,d)=>({...s,rowHeight:eo(H,s.entry,d)})),[Oe,H]),_e=l.useMemo(()=>V.map(s=>s.rowHeight),[V]),Le=l.useMemo(()=>{const s=new Array(_e.length+1);s[0]=0;for(let d=0;d<_e.length;d++)s[d+1]=s[d]+_e[d];return s},[_e]),or=l.useCallback(s=>V[s]?.rowHeight??_t,[V]),on=l.useCallback(s=>V[s]?.entry.absolutePath??s,[V]),sr=nn??on,Fe=S??null,vt=T??null,[ar,Ke]=l.useState(()=>({selectedPath:Fe,selectionGeneration:0,anchor:null})),wt=_r(ar,Fe);wt!==ar&&Ke(s=>_r(s,Fe));const ot=l.useMemo(()=>fo(Oe),[Oe]),ze=l.useMemo(()=>mo(ot,wt),[ot,wt]),Xe=l.useRef(new Map),st=l.useRef(null),[at]=l.useState(Jn),Ue=l.useRef(null),[sn,lr]=l.useState(!0),Et=l.useRef(Oe);Et.current=Oe;const ir=l.useRef(we);ir.current=we;const Rt=l.useRef(t);Rt.current=t;const cr=l.useRef(ot);cr.current=ot;const xt=l.useRef(ze);xt.current=ze;const dr=l.useRef(Vt);dr.current=Vt;const je=l.useCallback(s=>{const d=Re.current;return!d||d.getViewportSize()<=0?!1:(d.scrollToIndex(s,{align:"nearest"}),!0)},[]),xe=l.useCallback(s=>{const d=Xe.current.get(s);if(d===void 0){Ue.current=s,je(s)||(Ue.current=null);return}Ue.current=null,je(s),d.focus({preventScroll:!0})},[je]),ur=l.useCallback((s,d)=>{if(d)Xe.current.set(s,d),Ue.current===s?(Ue.current=null,d.focus({preventScroll:!0})):d.contains(d.ownerDocument.activeElement)&&Ke(w=>w.anchor===null?w:{...w,anchor:{...w.anchor,focused:!0}});else{const w=Xe.current.get(s);Xe.current.delete(s),w?.contains(w.ownerDocument.activeElement)&&Ke(k=>k.anchor===null?k:{...k,anchor:{...k.anchor,focused:!1}})}s===xt.current&&lr(d!==null)},[]);l.useLayoutEffect(()=>{lr(Xe.current.has(ze))},[ze]);const kt=l.useCallback((s,d,w)=>{const k=st.current===w;st.current=null,k||(Ke(z=>ho(z,d)),at.landedOn(w)||je(s)),dr.current?.(s)},[je,at]),lt=l.useCallback(s=>at.mark(s.nativeEvent),[at]),It=l.useCallback((s,d)=>{const{ownerDocument:w}=d;if(!w.hasFocus()&&d.contains(w.activeElement)){st.current=d;return}st.current=null,Ke(k=>k.anchor!==null&&k.anchor.path===s?{...k,anchor:{...k.anchor,focused:!1}}:k)},[]),an=l.useCallback(()=>xe(xt.current),[xe]),Ct=l.useCallback((s,d)=>{const w=Pr(d),k=Et.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(w==="nearest"){je(s);return}Re.current?.scrollToIndex(s,{align:w})},[je]);l.useImperativeHandle(Ie,()=>({scrollToIndex:Ct,scrollToPath:(s,d)=>{Pr(d);const w=cr.current.get(s);return w===void 0?!1:(Ct(w,d),!0)},getScrollAnchor:()=>Re.current?.getScrollAnchor()??null}),[Ct]);const fr=l.useCallback((s,d)=>{if(s.altKey||s.ctrlKey||s.metaKey)return;const w=Et.current,k=w.length-1;if(k<0)return;const z=w[d],J=z?.entry.children!==void 0,ke=J&&ir.current(z.entry.absolutePath);switch(s.key){case"ArrowDown":s.preventDefault(),xe(Math.min(d+1,k));break;case"ArrowUp":s.preventDefault(),xe(Math.max(d-1,0));break;case"Home":s.preventDefault(),xe(0);break;case"End":s.preventDefault(),xe(k);break;case"ArrowRight":s.preventDefault(),J&&!ke?Rt.current(z.entry.absolutePath):J&&d<k&&w[d+1].depth>z.depth&&xe(d+1);break;case"ArrowLeft":{if(s.preventDefault(),J&&ke){Rt.current(z.entry.absolutePath);break}const fn=z?.depth??0;for(let ut=d-1;ut>=0;ut--)if(w[ut].depth<fn){xe(ut);break}break}}},[xe]),it=l.useMemo(()=>pe===null||St.length===0?{segmentsByItem:[],glyphsByItem:[]}:wo(St,_e,Le,pe),[St,_e,Le,pe]),ct=l.useMemo(()=>pe===null||e.length===0?0:pe.originX+nr*pe.indentSize+ce+pe.typeIconSize,[e.length,nr,pe]),{renderStart:hr,renderEnd:mr,lookaheadEnd:pr}=l.useMemo(()=>vo(V.length,$e,ve,et,rt,Le),[V.length,$e,ve,et,rt,Le]),Tt=l.useMemo(()=>pe===null||ct<=0||$e<=0||it.segmentsByItem.length===0?null:h.jsx("div",{className:"pointer-events-none absolute inset-0 z-1","aria-hidden":"true",children:h.jsx("div",{className:"absolute top-0 left-0",style:{width:ct,height:$e},children:h.jsx(en,{segmentsByItem:it.segmentsByItem,glyphsByItem:it.glyphsByItem,itemHeight:_e[0]??_t,width:ct,viewportHeight:$e,scrollPosition:rt,color:$,expandGlyphColor:$,expandGlyphSize:pe.glyphSize,renderStartIndex:hr,renderEndIndex:mr,lookaheadEndIndex:pr})})}),[ct,$e,hr,mr,pr,rt,it,$,pe,_e]),yr=l.useCallback(s=>V[s],[V]),gr=l.useRef(null);l.useLayoutEffect(()=>{const s=gr.current;if(gr.current={items:V,offsets:Le},!Xt||!s||s.items===V)return;const d=Re.current,w=d?.getScrollPosition(),k=typeof w=="number"&&w>=0?w:yt.current,z=oo(s.items,s.offsets,k);if(!z)return;const J=so(z,V,Le);if(J===null||Math.abs(J-k)<1)return;const ke=d?d.scrollTo(J):J;yt.current=ke,Zt(ke)},[V,Le,Xt]);const Ne=C?.columns,Be=C?.scrollBarWidth??mt?.width??Jr,te=l.useMemo(()=>Ne?Vn({measuredWidth:Qe,columns:Ne,scrollBarWidth:Be}):null,[Ne,Qe,Be]),dt=l.useMemo(()=>Ne?Gn(Ne):"",[Ne]),ln=l.useMemo(()=>C?.showFooter&&Ne?Kn(e):[],[C?.showFooter,Ne,e]),He=te?.maxHScroll??0;l.useEffect(()=>{Ve(s=>Nt(s,He))},[He]);const br=l.useCallback(s=>Ve(d=>Nt(d+s,He)),[He]),Sr=l.useMemo(()=>({iconOverrides:D,showExpandIcons:P,showDirectoryIcons:b,showFileIcons:M,useCanvasExpandIcons:N,expandIconSize:O,typeIconSize:Q.typeIconSize,fontSize:Q.fontSize,indentSize:Q.indentSize,highlightStyles:B,expandIconClassName:I,expandIconStyle:R}),[D,P,b,M,N,O,Q,B,I,R]),vr=l.useMemo(()=>h.jsx(ye.VirtualScroll,{ref:Re,itemCount:V.length,getItem:yr,getItemHeight:or,getItemKey:sr,testId:Ut,contentProps:Jt,locale:j,labels:U,viewportSize:typeof ae=="number"?ae:void 0,overscanCount:ve,onScroll:Qt,onRangeChange:er,onScrollAdjust:zt,liveRegion:Bt,className:ee,onWheelHorizontal:se?br:void 0,background:h.jsxs(h.Fragment,{children:[se&&te?h.jsx("div",{className:"pointer-events-none absolute top-0 left-0 z-1 h-full overflow-hidden",style:{width:te.nameWidth},"aria-hidden":"true",children:Tt}):Tt,Dt]}),initialScrollIndex:Ht,initialScrollOffset:De,initialScrollAnchor:Wt,callbackThrottleMs:Yt,contentInsets:Gt,scrollBarOptions:mt,behaviorOptions:qt,children:(s,d)=>s?se&&C&&te?h.jsx(Kr,{entry:s.entry,indentLevel:s.indentLevel,positionInSet:s.positionInSet,setSize:s.setSize,rowIndex:d+(C.showHeader??!0?2:1),flatIndex:d,onRowFocus:kt,onRowBlur:It,isSelectedForAria:!!_?.has(s.entry.absolutePath),rowHeight:s.rowHeight,isDirOpen:we,columns:C.columns,numericTemplate:dt,numericTotal:te.numericTotal,nameWidth:te.nameWidth,rowClassName:C.rowClassName,selection:{onEntryClick:m,selectedPath:Fe,currentPath:vt,mode:x,selectedItems:_,onSelectionChange:p},expansion:{toggleDirectory:t,onToggleDirectoryRecursive:gt},visual:Sr},s.entry.absolutePath):h.jsx(tn,{entry:s.entry,indentLevel:s.indentLevel,originX:nt,depth:s.depth,positionInSet:s.positionInSet,setSize:s.setSize,isSelectedForAria:!!_?.has(s.entry.absolutePath),flatIndex:d,isActive:d===ze,registerRowRef:ur,onNavigationKeyDown:fr,onRowFocus:kt,onRowBlur:It,rowHeight:s.rowHeight,entryKindDirectory:Ae,entryKindFile:ne,isDirOpen:we,expansion:{toggleDirectory:t,onToggleDirectoryRecursive:gt},selection:{onEntryClick:m,selectedPath:Fe,currentPath:vt,mode:x,selectedItems:_,onSelectionChange:p},visual:{iconOverrides:D,showExpandIcons:P,showDirectoryIcons:b,showFileIcons:M,useCanvasExpandIcons:N,expandIconSize:O,typeIconSize:Q.typeIconSize,fontSize:Q.fontSize,indentSize:Q.indentSize,highlightStyles:B,entryClassName:re,entryStyle:he,nameClassName:Y,nameStyle:G,directoryNameClassName:Ee,directoryNameStyle:ge,fileNameClassName:o,fileNameStyle:f,expandIconClassName:I,expandIconStyle:R}},s.entry.absolutePath):null}),[V.length,yr,or,sr,Ut,Jt,j,U,Ae,ne,ze,ur,fr,kt,It,ae,ve,Qt,er,zt,Bt,ee,se,br,te,Tt,Dt,Ht,De,Wt,Yt,Gt,mt,qt,C,dt,we,m,Fe,vt,x,_,p,t,gt,Sr,D,P,b,M,N,O,Q,nt,B,re,he,Y,G,Ee,ge,o,f,I,R]);if(!(C&&te))return h.jsxs("div",{ref:Te,className:tr,style:rr,onPointerDownCapture:lt,onMouseDownCapture:lt,children:[Oe.length>0&&!sn&&h.jsx("span",{tabIndex:0,"data-directory-tree-tab-stop":"",style:bo,onFocus:an}),vr]});const cn=C.showHeader??!0,dn=C.showFooter??!1,un={...rr,"--dt-hscroll":`${Ge}px`};return h.jsxs("div",{ref:Te,className:K.twMerge(tr,"dt-grid"),style:un,role:"treegrid","aria-label":v?void 0:E,"aria-labelledby":v,"aria-multiselectable":x==="multiple"?!0:void 0,"aria-busy":i?!0:void 0,"aria-rowcount":V.length+(C.showHeader??!0?1:0),onPointerDownCapture:lt,onMouseDownCapture:lt,children:[cn&&h.jsx("div",{role:"rowgroup",children:h.jsx(Hn,{columns:C.columns,numericTemplate:dt,numericTotal:te.numericTotal,nameWidth:te.nameWidth,scrollBarWidth:Be,className:C.headerClassName})}),h.jsx("div",{ref:Me,className:"dt-grid-body",children:vr}),He>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(ye.ScrollBar,{horizontal:!0,contentSize:te.numericTotal,viewportSize:te.numericVisible,scrollPosition:Ge,scrollBarWidth:Be,locale:j,labels:U,onScroll:s=>{const d=typeof s=="function"?s(Ge):s,w=Nt(d,He);return Ve(w),w}}),h.jsx("div",{className:"dt-grid-scrollbar-spacer",style:{width:Be},"aria-hidden":"true"})]}),dn&&h.jsx("div",{role:"rowgroup",children:h.jsx(Wn,{columns:C.columns,numericTemplate:dt,numericTotal:te.numericTotal,nameWidth:te.nameWidth,scrollBarWidth:Be,allEntries:ln,className:C.footerClassName})})]})},Ro=({initialExpanded:e=new Set,storageKey:t}={})=>{const[r,n]=l.useTransition(),[a,i]=l.useState(()=>{if(typeof window<"u"&&t)try{const y=window.localStorage.getItem(t);if(y){const E=JSON.parse(y);return new Set(E)}}catch(y){console.error("[useDirectoryTreeState] Error reading from localStorage",y)}return e}),c=l.useCallback(y=>{n(()=>{i(E=>{const v=new Set(E);return y(v),v})})},[]),u=l.useCallback((y,E)=>{c(v=>{for(const $ of y)E(v,$)})},[c]);l.useEffect(()=>{if(t&&typeof window<"u")try{window.localStorage.setItem(t,JSON.stringify(Array.from(a)))}catch(y){console.warn(`Error setting localStorage key "${t}":`,y)}},[a,t]);const m=l.useCallback(y=>{u([y],(E,v)=>{E.has(v)?E.delete(v):E.add(v)})},[u]),S=l.useCallback(y=>{u([y],(E,v)=>{E.add(v)})},[u]),T=l.useCallback(y=>{u([y],(E,v)=>{E.delete(v)})},[u]),x=l.useCallback(y=>{u(y,(E,v)=>{E.delete(v)})},[u]),_=l.useCallback(y=>{u(y,(E,v)=>{E.add(v)})},[u]),p=l.useCallback(()=>{c(y=>{y.clear()})},[c]),g=l.useCallback(y=>a.has(y),[a]);return{expanded:a,toggle:m,expand:S,collapse:T,collapseMultiple:x,expandMultiple:_,collapseAll:p,isExpanded:g,isPending:r}};exports.DIRECTORY_TREE_LABEL_CATALOGS=Zr;exports.DIRECTORY_TREE_LABEL_KEYS=Lt;exports.DirectoryTree=Eo;exports.EXPAND_ICON_STYLE_PROPERTIES=Hr;exports.FILE_ICON_PAIRS=Rn;exports.MARK_PAIRS=Lr;exports.ROW_STYLE_PROPERTIES=Br;exports.directoryTreeClasses=A;exports.resolveDirectoryTreeLabels=Qr;exports.useDirectoryTreeState=Ro;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export { DirectoryTree, directoryTreeClasses } from "./DirectoryTree.tsx";
2
2
  export { type DirectoryTreeExpandIconStyle, type DirectoryTreeRowStyle, EXPAND_ICON_STYLE_PROPERTIES, ROW_STYLE_PROPERTIES } from "./hostStyle.ts";
3
3
  export { DIRECTORY_TREE_LABEL_CATALOGS, DIRECTORY_TREE_LABEL_KEYS, type DirectoryTreeLabelOverrides, type DirectoryTreeLabels, type DirectoryTreeLocale, resolveDirectoryTreeLabels } from "./labels.ts";
4
+ export { FILE_ICON_PAIRS, type FileIconKind, MARK_PAIRS, type SchemePair } from "./palette.ts";
4
5
  export type { DirectoryEntry, DirectoryEntryComparator, DirectoryEntryItemProps, DirectoryTreeClickEvent, DirectoryTreeColumn, DirectoryTreeGrid, DirectoryTreeHandle, DirectoryTreeIconOverrides, DirectoryTreeIconRenderContext, DirectoryTreeIconRenderer, DirectoryTreeProps, DirectoryTreeScrollAlign, DirectoryTreeScrollOptions, DirectoryTreeState, DirectoryTreeVirtualScrollOptions, HighlightStyles, ItemHeight, TreeLineItemInfo, TreeLineProps, UseDirectoryTreeStateProps, } from "./types.ts";
5
6
  export { useDirectoryTreeState } from "./useDirectoryTreeState.ts";