react-composable-treeview 1.0.21 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -65,9 +65,14 @@ Contains all the parts of an tree view
65
65
 
66
66
  Contains all the parts of a collapsible group.
67
67
 
68
+ The index property is required for keybinding to work. In a previous version of
69
+ this package we tryed to infer the index but this was brittle and non-reactive.
70
+ Now the package user has to specify the index itself.
71
+
68
72
  | Prop | Type | Default |
69
73
  | --------- | --------- | ------- |
70
74
  | value | `string` | "" |
75
+ | index | `number` | - |
71
76
  | draggable | `boolean` | `false` |
72
77
 
73
78
  | Data attribute | Values |
@@ -80,9 +85,14 @@ Contains all the parts of a collapsible group.
80
85
 
81
86
  Contains an item.
82
87
 
88
+ The index property is required for keybinding to work. In a previous version of
89
+ this package we tryed to infer the index but this was brittle and non-reactive.
90
+ Now the package user has to specify the index itself.
91
+
83
92
  | Prop | Type | Default |
84
93
  | --------- | --------- | ------- |
85
94
  | value | `string` | "" |
95
+ | index | `number` | - |
86
96
  | draggable | `boolean` | `false` |
87
97
 
88
98
  | Data attribute | Values |
@@ -1,8 +1,6 @@
1
- import { useIndexType } from '../hooks/useIndex';
2
-
1
+ /// <reference types="react" />
3
2
  export interface GroupContextType {
4
3
  parent: string;
5
- getIndex: useIndexType;
6
4
  depth: number;
7
5
  }
8
6
  export declare const GroupContext: import('react').Context<GroupContextType>;
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";const _=require("react");var ce={exports:{}},J={};/**
1
+ "use strict";const _=require("react");var se={exports:{}},B={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var Ie;function vr(){if(Ie)return J;Ie=1;var r=_,u=Symbol.for("react.element"),n=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,i=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,f={key:!0,ref:!0,__self:!0,__source:!0};function x(c,v,P){var y,R={},w=null,j=null;P!==void 0&&(w=""+P),v.key!==void 0&&(w=""+v.key),v.ref!==void 0&&(j=v.ref);for(y in v)o.call(v,y)&&!f.hasOwnProperty(y)&&(R[y]=v[y]);if(c&&c.defaultProps)for(y in v=c.defaultProps,v)R[y]===void 0&&(R[y]=v[y]);return{$$typeof:u,type:c,key:w,ref:j,props:R,_owner:i.current}}return J.Fragment=n,J.jsx=x,J.jsxs=x,J}var z={};/**
9
+ */var Ne;function dr(){if(Ne)return B;Ne=1;var r=_,o=Symbol.for("react.element"),n=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,i=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function w(f,l,S){var h,R={},C=null,P=null;S!==void 0&&(C=""+S),l.key!==void 0&&(C=""+l.key),l.ref!==void 0&&(P=l.ref);for(h in l)a.call(l,h)&&!c.hasOwnProperty(h)&&(R[h]=l[h]);if(f&&f.defaultProps)for(h in l=f.defaultProps,l)R[h]===void 0&&(R[h]=l[h]);return{$$typeof:o,type:f,key:C,ref:P,props:R,_owner:i.current}}return B.Fragment=n,B.jsx=w,B.jsxs=w,B}var K={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,13 +14,13 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var Ne;function pr(){return Ne||(Ne=1,process.env.NODE_ENV!=="production"&&function(){var r=_,u=Symbol.for("react.element"),n=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),x=Symbol.for("react.provider"),c=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),y=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),j=Symbol.for("react.offscreen"),O=Symbol.iterator,V="@@iterator";function $(e){if(e===null||typeof e!="object")return null;var t=O&&e[O]||e[V];return typeof t=="function"?t:null}var h=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function b(e){{for(var t=arguments.length,a=new Array(t>1?t-1:0),s=1;s<t;s++)a[s-1]=arguments[s];Y("error",e,a)}}function Y(e,t,a){{var s=h.ReactDebugCurrentFrame,p=s.getStackAddendum();p!==""&&(t+="%s",a=a.concat([p]));var g=a.map(function(d){return String(d)});g.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,g)}}var C=!1,F=!1,D=!1,T=!1,I=!1,B;B=Symbol.for("react.module.reference");function Le(e){return!!(typeof e=="string"||typeof e=="function"||e===o||e===f||I||e===i||e===P||e===y||T||e===j||C||F||D||typeof e=="object"&&e!==null&&(e.$$typeof===w||e.$$typeof===R||e.$$typeof===x||e.$$typeof===c||e.$$typeof===v||e.$$typeof===B||e.getModuleId!==void 0))}function We(e,t,a){var s=e.displayName;if(s)return s;var p=t.displayName||t.name||"";return p!==""?a+"("+p+")":a}function le(e){return e.displayName||"Context"}function L(e){if(e==null)return null;if(typeof e.tag=="number"&&b("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case o:return"Fragment";case n:return"Portal";case f:return"Profiler";case i:return"StrictMode";case P:return"Suspense";case y:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case c:var t=e;return le(t)+".Consumer";case x:var a=e;return le(a._context)+".Provider";case v:return We(e,e.render,"ForwardRef");case R:var s=e.displayName||null;return s!==null?s:L(e.type)||"Memo";case w:{var p=e,g=p._payload,d=p._init;try{return L(d(g))}catch{return null}}}return null}var W=Object.assign,K=0,de,ve,pe,_e,ge,he,Re;function be(){}be.__reactDisabledLog=!0;function Ue(){{if(K===0){de=console.log,ve=console.info,pe=console.warn,_e=console.error,ge=console.group,he=console.groupCollapsed,Re=console.groupEnd;var e={configurable:!0,enumerable:!0,value:be,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}K++}}function Ge(){{if(K--,K===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:W({},e,{value:de}),info:W({},e,{value:ve}),warn:W({},e,{value:pe}),error:W({},e,{value:_e}),group:W({},e,{value:ge}),groupCollapsed:W({},e,{value:he}),groupEnd:W({},e,{value:Re})})}K<0&&b("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var te=h.ReactCurrentDispatcher,ne;function Z(e,t,a){{if(ne===void 0)try{throw Error()}catch(p){var s=p.stack.trim().match(/\n( *(at )?)/);ne=s&&s[1]||""}return`
18
- `+ne+e}}var oe=!1,M;{var qe=typeof WeakMap=="function"?WeakMap:Map;M=new qe}function Ee(e,t){if(!e||oe)return"";{var a=M.get(e);if(a!==void 0)return a}var s;oe=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var g;g=te.current,te.current=null,Ue();try{if(t){var d=function(){throw Error()};if(Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(A){s=A}Reflect.construct(e,[],d)}else{try{d.call()}catch(A){s=A}e.call(d.prototype)}}else{try{throw Error()}catch(A){s=A}e()}}catch(A){if(A&&s&&typeof A.stack=="string"){for(var l=A.stack.split(`
19
- `),S=s.stack.split(`
20
- `),E=l.length-1,m=S.length-1;E>=1&&m>=0&&l[E]!==S[m];)m--;for(;E>=1&&m>=0;E--,m--)if(l[E]!==S[m]){if(E!==1||m!==1)do if(E--,m--,m<0||l[E]!==S[m]){var k=`
21
- `+l[E].replace(" at new "," at ");return e.displayName&&k.includes("<anonymous>")&&(k=k.replace("<anonymous>",e.displayName)),typeof e=="function"&&M.set(e,k),k}while(E>=1&&m>=0);break}}}finally{oe=!1,te.current=g,Ge(),Error.prepareStackTrace=p}var G=e?e.displayName||e.name:"",Ae=G?Z(G):"";return typeof e=="function"&&M.set(e,Ae),Ae}function Be(e,t,a){return Ee(e,!1)}function Ke(e){var t=e.prototype;return!!(t&&t.isReactComponent)}function Q(e,t,a){if(e==null)return"";if(typeof e=="function")return Ee(e,Ke(e));if(typeof e=="string")return Z(e);switch(e){case P:return Z("Suspense");case y:return Z("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case v:return Be(e.render);case R:return Q(e.type,t,a);case w:{var s=e,p=s._payload,g=s._init;try{return Q(g(p),t,a)}catch{}}}return""}var ee=Object.prototype.hasOwnProperty,me={},xe=h.ReactDebugCurrentFrame;function re(e){if(e){var t=e._owner,a=Q(e.type,e._source,t?t.type:null);xe.setExtraStackFrame(a)}else xe.setExtraStackFrame(null)}function Je(e,t,a,s,p){{var g=Function.call.bind(ee);for(var d in e)if(g(e,d)){var l=void 0;try{if(typeof e[d]!="function"){var S=Error((s||"React class")+": "+a+" type `"+d+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[d]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw S.name="Invariant Violation",S}l=e[d](t,d,s,a,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(E){l=E}l&&!(l instanceof Error)&&(re(p),b("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",s||"React class",a,d,typeof l),re(null)),l instanceof Error&&!(l.message in me)&&(me[l.message]=!0,re(p),b("Failed %s type: %s",a,l.message),re(null))}}}var ze=Array.isArray;function ue(e){return ze(e)}function He(e){{var t=typeof Symbol=="function"&&Symbol.toStringTag,a=t&&e[Symbol.toStringTag]||e.constructor.name||"Object";return a}}function Xe(e){try{return ye(e),!1}catch{return!0}}function ye(e){return""+e}function we(e){if(Xe(e))return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",He(e)),ye(e)}var Ce=h.ReactCurrentOwner,Ze={key:!0,ref:!0,__self:!0,__source:!0},Te,Se;function Me(e){if(ee.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return e.ref!==void 0}function Qe(e){if(ee.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function er(e,t){typeof e.ref=="string"&&Ce.current}function rr(e,t){{var a=function(){Te||(Te=!0,b("%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://reactjs.org/link/special-props)",t))};a.isReactWarning=!0,Object.defineProperty(e,"key",{get:a,configurable:!0})}}function tr(e,t){{var a=function(){Se||(Se=!0,b("%s: `ref` 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://reactjs.org/link/special-props)",t))};a.isReactWarning=!0,Object.defineProperty(e,"ref",{get:a,configurable:!0})}}var nr=function(e,t,a,s,p,g,d){var l={$$typeof:u,type:e,key:t,ref:a,props:d,_owner:g};return l._store={},Object.defineProperty(l._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(l,"_self",{configurable:!1,enumerable:!1,writable:!1,value:s}),Object.defineProperty(l,"_source",{configurable:!1,enumerable:!1,writable:!1,value:p}),Object.freeze&&(Object.freeze(l.props),Object.freeze(l)),l};function or(e,t,a,s,p){{var g,d={},l=null,S=null;a!==void 0&&(we(a),l=""+a),Qe(t)&&(we(t.key),l=""+t.key),Me(t)&&(S=t.ref,er(t,p));for(g in t)ee.call(t,g)&&!Ze.hasOwnProperty(g)&&(d[g]=t[g]);if(e&&e.defaultProps){var E=e.defaultProps;for(g in E)d[g]===void 0&&(d[g]=E[g])}if(l||S){var m=typeof e=="function"?e.displayName||e.name||"Unknown":e;l&&rr(d,m),S&&tr(d,m)}return nr(e,l,S,p,s,Ce.current,d)}}var ae=h.ReactCurrentOwner,Pe=h.ReactDebugCurrentFrame;function U(e){if(e){var t=e._owner,a=Q(e.type,e._source,t?t.type:null);Pe.setExtraStackFrame(a)}else Pe.setExtraStackFrame(null)}var ie;ie=!1;function se(e){return typeof e=="object"&&e!==null&&e.$$typeof===u}function Oe(){{if(ae.current){var e=L(ae.current.type);if(e)return`
17
+ */var Ve;function vr(){return Ve||(Ve=1,process.env.NODE_ENV!=="production"&&function(){var r=_,o=Symbol.for("react.element"),n=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),w=Symbol.for("react.provider"),f=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),P=Symbol.for("react.offscreen"),D=Symbol.iterator,$="@@iterator";function m(e){if(e===null||typeof e!="object")return null;var t=D&&e[D]||e[$];return typeof t=="function"?t:null}var O=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function b(e){{for(var t=arguments.length,u=new Array(t>1?t-1:0),s=1;s<t;s++)u[s-1]=arguments[s];x("error",e,u)}}function x(e,t,u){{var s=O.ReactDebugCurrentFrame,p=s.getStackAddendum();p!==""&&(t+="%s",u=u.concat([p]));var g=u.map(function(v){return String(v)});g.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,g)}}var A=!1,F=!1,k=!1,V=!1,H=!1,fe;fe=Symbol.for("react.module.reference");function Ye(e){return!!(typeof e=="string"||typeof e=="function"||e===a||e===c||H||e===i||e===S||e===h||V||e===P||A||F||k||typeof e=="object"&&e!==null&&(e.$$typeof===C||e.$$typeof===R||e.$$typeof===w||e.$$typeof===f||e.$$typeof===l||e.$$typeof===fe||e.getModuleId!==void 0))}function Le(e,t,u){var s=e.displayName;if(s)return s;var p=t.displayName||t.name||"";return p!==""?u+"("+p+")":u}function le(e){return e.displayName||"Context"}function Y(e){if(e==null)return null;if(typeof e.tag=="number"&&b("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case a:return"Fragment";case n:return"Portal";case c:return"Profiler";case i:return"StrictMode";case S:return"Suspense";case h:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case f:var t=e;return le(t)+".Consumer";case w:var u=e;return le(u._context)+".Provider";case l:return Le(e,e.render,"ForwardRef");case R:var s=e.displayName||null;return s!==null?s:Y(e.type)||"Memo";case C:{var p=e,g=p._payload,v=p._init;try{return Y(v(g))}catch{return null}}}return null}var L=Object.assign,q=0,de,ve,pe,_e,ge,he,Re;function be(){}be.__reactDisabledLog=!0;function We(){{if(q===0){de=console.log,ve=console.info,pe=console.warn,_e=console.error,ge=console.group,he=console.groupCollapsed,Re=console.groupEnd;var e={configurable:!0,enumerable:!0,value:be,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}q++}}function Ue(){{if(q--,q===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:L({},e,{value:de}),info:L({},e,{value:ve}),warn:L({},e,{value:pe}),error:L({},e,{value:_e}),group:L({},e,{value:ge}),groupCollapsed:L({},e,{value:he}),groupEnd:L({},e,{value:Re})})}q<0&&b("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var re=O.ReactCurrentDispatcher,te;function X(e,t,u){{if(te===void 0)try{throw Error()}catch(p){var s=p.stack.trim().match(/\n( *(at )?)/);te=s&&s[1]||""}return`
18
+ `+te+e}}var ne=!1,Z;{var Ge=typeof WeakMap=="function"?WeakMap:Map;Z=new Ge}function Ee(e,t){if(!e||ne)return"";{var u=Z.get(e);if(u!==void 0)return u}var s;ne=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var g;g=re.current,re.current=null,We();try{if(t){var v=function(){throw Error()};if(Object.defineProperty(v.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(v,[])}catch(N){s=N}Reflect.construct(e,[],v)}else{try{v.call()}catch(N){s=N}e.call(v.prototype)}}else{try{throw Error()}catch(N){s=N}e()}}catch(N){if(N&&s&&typeof N.stack=="string"){for(var d=N.stack.split(`
19
+ `),T=s.stack.split(`
20
+ `),E=d.length-1,y=T.length-1;E>=1&&y>=0&&d[E]!==T[y];)y--;for(;E>=1&&y>=0;E--,y--)if(d[E]!==T[y]){if(E!==1||y!==1)do if(E--,y--,y<0||d[E]!==T[y]){var j=`
21
+ `+d[E].replace(" at new "," at ");return e.displayName&&j.includes("<anonymous>")&&(j=j.replace("<anonymous>",e.displayName)),typeof e=="function"&&Z.set(e,j),j}while(E>=1&&y>=0);break}}}finally{ne=!1,re.current=g,Ue(),Error.prepareStackTrace=p}var U=e?e.displayName||e.name:"",Ae=U?X(U):"";return typeof e=="function"&&Z.set(e,Ae),Ae}function qe(e,t,u){return Ee(e,!1)}function Be(e){var t=e.prototype;return!!(t&&t.isReactComponent)}function Q(e,t,u){if(e==null)return"";if(typeof e=="function")return Ee(e,Be(e));if(typeof e=="string")return X(e);switch(e){case S:return X("Suspense");case h:return X("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case l:return qe(e.render);case R:return Q(e.type,t,u);case C:{var s=e,p=s._payload,g=s._init;try{return Q(g(p),t,u)}catch{}}}return""}var M=Object.prototype.hasOwnProperty,me={},ye=O.ReactDebugCurrentFrame;function ee(e){if(e){var t=e._owner,u=Q(e.type,e._source,t?t.type:null);ye.setExtraStackFrame(u)}else ye.setExtraStackFrame(null)}function Ke(e,t,u,s,p){{var g=Function.call.bind(M);for(var v in e)if(g(e,v)){var d=void 0;try{if(typeof e[v]!="function"){var T=Error((s||"React class")+": "+u+" type `"+v+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[v]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw T.name="Invariant Violation",T}d=e[v](t,v,s,u,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(E){d=E}d&&!(d instanceof Error)&&(ee(p),b("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",s||"React class",u,v,typeof d),ee(null)),d instanceof Error&&!(d.message in me)&&(me[d.message]=!0,ee(p),b("Failed %s type: %s",u,d.message),ee(null))}}}var Je=Array.isArray;function oe(e){return Je(e)}function ze(e){{var t=typeof Symbol=="function"&&Symbol.toStringTag,u=t&&e[Symbol.toStringTag]||e.constructor.name||"Object";return u}}function He(e){try{return we(e),!1}catch{return!0}}function we(e){return""+e}function Ce(e){if(He(e))return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ze(e)),we(e)}var xe=O.ReactCurrentOwner,Xe={key:!0,ref:!0,__self:!0,__source:!0},Te,Se;function Ze(e){if(M.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return e.ref!==void 0}function Qe(e){if(M.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function Me(e,t){typeof e.ref=="string"&&xe.current}function er(e,t){{var u=function(){Te||(Te=!0,b("%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://reactjs.org/link/special-props)",t))};u.isReactWarning=!0,Object.defineProperty(e,"key",{get:u,configurable:!0})}}function rr(e,t){{var u=function(){Se||(Se=!0,b("%s: `ref` 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://reactjs.org/link/special-props)",t))};u.isReactWarning=!0,Object.defineProperty(e,"ref",{get:u,configurable:!0})}}var tr=function(e,t,u,s,p,g,v){var d={$$typeof:o,type:e,key:t,ref:u,props:v,_owner:g};return d._store={},Object.defineProperty(d._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(d,"_self",{configurable:!1,enumerable:!1,writable:!1,value:s}),Object.defineProperty(d,"_source",{configurable:!1,enumerable:!1,writable:!1,value:p}),Object.freeze&&(Object.freeze(d.props),Object.freeze(d)),d};function nr(e,t,u,s,p){{var g,v={},d=null,T=null;u!==void 0&&(Ce(u),d=""+u),Qe(t)&&(Ce(t.key),d=""+t.key),Ze(t)&&(T=t.ref,Me(t,p));for(g in t)M.call(t,g)&&!Xe.hasOwnProperty(g)&&(v[g]=t[g]);if(e&&e.defaultProps){var E=e.defaultProps;for(g in E)v[g]===void 0&&(v[g]=E[g])}if(d||T){var y=typeof e=="function"?e.displayName||e.name||"Unknown":e;d&&er(v,y),T&&rr(v,y)}return tr(e,d,T,p,s,xe.current,v)}}var ue=O.ReactCurrentOwner,Pe=O.ReactDebugCurrentFrame;function W(e){if(e){var t=e._owner,u=Q(e.type,e._source,t?t.type:null);Pe.setExtraStackFrame(u)}else Pe.setExtraStackFrame(null)}var ae;ae=!1;function ie(e){return typeof e=="object"&&e!==null&&e.$$typeof===o}function Oe(){{if(ue.current){var e=Y(ue.current.type);if(e)return`
22
22
 
23
- Check the render method of \``+e+"`."}return""}}function ur(e){return""}var ke={};function ar(e){{var t=Oe();if(!t){var a=typeof e=="string"?e:e.displayName||e.name;a&&(t=`
23
+ Check the render method of \``+e+"`."}return""}}function or(e){return""}var ke={};function ur(e){{var t=Oe();if(!t){var u=typeof e=="string"?e:e.displayName||e.name;u&&(t=`
24
24
 
25
- Check the top-level render call using <`+a+">.")}return t}}function je(e,t){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var a=ar(t);if(ke[a])return;ke[a]=!0;var s="";e&&e._owner&&e._owner!==ae.current&&(s=" It was passed a child from "+L(e._owner.type)+"."),U(e),b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',a,s),U(null)}}function De(e,t){{if(typeof e!="object")return;if(ue(e))for(var a=0;a<e.length;a++){var s=e[a];se(s)&&je(s,t)}else if(se(e))e._store&&(e._store.validated=!0);else if(e){var p=$(e);if(typeof p=="function"&&p!==e.entries)for(var g=p.call(e),d;!(d=g.next()).done;)se(d.value)&&je(d.value,t)}}}function ir(e){{var t=e.type;if(t==null||typeof t=="string")return;var a;if(typeof t=="function")a=t.propTypes;else if(typeof t=="object"&&(t.$$typeof===v||t.$$typeof===R))a=t.propTypes;else return;if(a){var s=L(t);Je(a,e.props,"prop",s,e)}else if(t.PropTypes!==void 0&&!ie){ie=!0;var p=L(t);b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",p||"Unknown")}typeof t.getDefaultProps=="function"&&!t.getDefaultProps.isReactClassApproved&&b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function sr(e){{for(var t=Object.keys(e.props),a=0;a<t.length;a++){var s=t[a];if(s!=="children"&&s!=="key"){U(e),b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",s),U(null);break}}e.ref!==null&&(U(e),b("Invalid attribute `ref` supplied to `React.Fragment`."),U(null))}}function Fe(e,t,a,s,p,g){{var d=Le(e);if(!d){var l="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(l+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var S=ur();S?l+=S:l+=Oe();var E;e===null?E="null":ue(e)?E="array":e!==void 0&&e.$$typeof===u?(E="<"+(L(e.type)||"Unknown")+" />",l=" Did you accidentally export a JSX literal instead of a component?"):E=typeof e,b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",E,l)}var m=or(e,t,a,p,g);if(m==null)return m;if(d){var k=t.children;if(k!==void 0)if(s)if(ue(k)){for(var G=0;G<k.length;G++)De(k[G],e);Object.freeze&&Object.freeze(k)}else b("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 De(k,e)}return e===o?sr(m):ir(m),m}}function cr(e,t,a){return Fe(e,t,a,!0)}function fr(e,t,a){return Fe(e,t,a,!1)}var lr=fr,dr=cr;z.Fragment=o,z.jsx=lr,z.jsxs=dr}()),z}process.env.NODE_ENV==="production"?ce.exports=vr():ce.exports=pr();var N=ce.exports;const X=_.createContext({rootValue:new Set,setRootValue:()=>{},selection:null,setSelection:()=>{},focus:{current:""},nodeMap:{current:new Map},registerNode:()=>{},removeNode:()=>{}});function _r(){const r=_.useRef(new Map([["__root__",{value:"__root__",parent:"",index:0,isGroup:!0,ref:{current:null}}]]));return[r,(o,i,f,x,c)=>{var v;(v=r.current)==null||v.set(o,{value:o,parent:i,index:f,isGroup:x,ref:c})},o=>{var i;(i=r.current)==null||i.delete(o)}]}function Ve(r,u){if(!r.current)return"";for(const[n,o]of r.current)if(o.parent==u&&o.index==0)return o.value;return""}function gr(r,u){if(!r.current)return"";const n=r.current.get(u);if(n){for(const[o,i]of r.current)if(i.parent==n.parent&&i.index==n.index-1)return i.value;return""}else return""}function hr(r,u){if(!r.current)return"";const n=r.current.get(u);if(n){if(n.index==0)return n.parent;{let o=r.current.get(gr(r,n.value));for(;o&&o.isGroup;){const i=r.current.get($e(r,o.value));if(!i)return o.value;o=i}return o?o.value:""}}else return""}function Rr(r,u){if(!r.current)return"";const n=r.current.get(u);if(n){for(const[o,i]of r.current)if(i.parent==n.parent&&i.index==n.index+1)return i.value;return""}else return""}function br(r,u){if(!r.current)return"";const n=r.current.get(u);if(n){if(n.isGroup){const i=Ve(r,u);if(i)return i}let o=n;for(;;){const i=Rr(r,o.value);if(i)return i;{const f=r.current.get(o.parent);if(!f||o.value=="__root__")return"";o=f}}}else return""}function Er(r){if(!r.current)return"";for(const[u,n]of r.current)if(n.parent=="__root__"&&n.index==0)return n.value;return""}function $e(r,u){if(!r.current)return"";let n=null;for(const[o,i]of r.current)i.parent==u&&(!n||i.index>n.index)&&(n=i);return n?n.value:""}function mr(r){if(!r.current)return"";let u=r.current.get("__root__");for(;u&&u.isGroup;){const n=r.current.get($e(r,u.value));if(!n)return u.value;u=n}return u?u.value:""}const q=_.createContext({parent:"",getIndex:()=>-1,depth:-1});function xr(r,u,n){const[o,i]=_.useState(n),f=r!==void 0?r:o;return[f,c=>{const v=typeof c=="function"?c(f):c;u&&u(v),i(v)}]}function H(r,u){return function(o){const i=o.defaultPrevented;i&&(o.defaultPrevented=!1),r==null||r(o);let f;return o.defaultPrevented||(f=u==null?void 0:u(o),i&&(o.defaultPrevented=!0)),f}}function fe(...r){return _.useCallback(u=>{for(const n of r)typeof n=="function"?n(u):n!=null&&(n.current=u)},[r])}function Ye(){let r=-1;const u={};function n(o){return u[o]==null&&(u[o]=++r),u[o]}return n}const yr=["ArrowRight","ArrowUp","ArrowLeft","ArrowDown","Home","End","Enter"];function wr(r,u){var o,i,f;const n=Ve(r,u);n&&((f=(i=(o=r.current)==null?void 0:o.get(n))==null?void 0:i.ref.current)==null||f.focus())}function Cr(r,u){var o,i,f,x,c;const n=(i=(o=r.current)==null?void 0:o.get(u))==null?void 0:i.parent;n&&n!="__root__"&&((c=(x=(f=r.current)==null?void 0:f.get(n))==null?void 0:x.ref.current)==null||c.focus())}function Tr(r,u){var o,i,f;const n=hr(r,u);n&&n!="__root__"&&((f=(i=(o=r.current)==null?void 0:o.get(n))==null?void 0:i.ref.current)==null||f.focus())}function Sr(r,u){var o,i,f;const n=br(r,u);n&&n!="__root__"&&((f=(i=(o=r.current)==null?void 0:o.get(n))==null?void 0:i.ref.current)==null||f.focus())}function Pr(r){var n,o,i;const u=Er(r);u&&u!="__root__"&&((i=(o=(n=r.current)==null?void 0:n.get(u))==null?void 0:o.ref.current)==null||i.focus())}function Or(r){var n,o,i;const u=mr(r);u&&u!="__root__"&&((i=(o=(n=r.current)==null?void 0:n.get(u))==null?void 0:o.ref.current)==null||i.focus())}const kr=_.forwardRef(({value:r,onValueChange:u,defaultValue:n,defaultSelection:o,onKeyDown:i,...f},x)=>{const[c,v,P]=_r(),y=Ye(),[R,w]=xr(r,u,n??new Set),[j,O]=_.useState(""),V=_.useRef(null),$=fe(V,x),h=_.useRef(""),b=_.useCallback(C=>{var F;if(!(!yr.includes(C.key)||!c))switch(C.key){case"ArrowRight":const D=(F=c.current)==null?void 0:F.get(h.current);if(!D||!D.isGroup)break;C.preventDefault(),R.has(h.current)?wr(c,h.current):w(T=>new Set([...T,h.current]));break;case"ArrowLeft":C.preventDefault(),R.has(h.current)?w(T=>new Set([...T].filter(I=>I!==h.current))):Cr(c,h.current);break;case"ArrowUp":C.preventDefault(),Tr(c,h.current);break;case"ArrowDown":C.preventDefault(),Sr(c,h.current);break;case"Home":C.preventDefault(),Pr(c);break;case"End":C.preventDefault(),Or(c);break;case"Enter":C.preventDefault(),O(h.current),R.has(h.current)?w(T=>new Set([...T].filter(I=>I!==h.current))):w(T=>new Set([...T,h.current]));break}},[R]),Y=H(i,b);return N.jsx(X.Provider,{value:{rootValue:R,setRootValue:w,selection:j,setSelection:O,focus:h,nodeMap:c,registerNode:v,removeNode:P},children:N.jsx(q.Provider,{value:{parent:"__root__",getIndex:y,depth:0},children:N.jsx("ul",{ref:$,role:"tree","aria-multiselectable":"false",onKeyDown:Y,...f})})})}),jr=_.forwardRef(({value:r,onFocus:u,onClick:n,...o},i)=>{const{selection:f,setSelection:x,focus:c,nodeMap:v,registerNode:P,removeNode:y}=_.useContext(X),{parent:R,getIndex:w,depth:j}=_.useContext(q),O=_.useRef(null),V=fe(O,i),$=H(u,b),h=H(n,Y);function b(F){var D,T,I,B;(I=(T=(D=v.current)==null?void 0:D.get(c.current))==null?void 0:T.ref.current)==null||I.setAttribute("tabindex","-1"),(B=O.current)==null||B.setAttribute("tabindex","0"),c.current=r,F.stopPropagation()}function Y(){x(r)}const C=w(r);return c.current==""&&R=="__root__"&&C==0&&(c.current=r),_.useEffect(()=>(P(r,R,C,!1,O),()=>y(r)),[]),_.useEffect(()=>()=>{c.current==r&&(c.current="")},[]),N.jsx("li",{ref:V,role:"treeitem","aria-selected":f==r,tabIndex:c.current==r?0:-1,onFocus:$,onClick:h,"data-depth":j,...o})}),Dr=_.forwardRef(({value:r,onFocus:u,...n},o)=>{const i=Ye(),{rootValue:f,selection:x,focus:c,nodeMap:v,registerNode:P,removeNode:y}=_.useContext(X),{parent:R,getIndex:w,depth:j}=_.useContext(q),O=_.useRef(null),V=fe(O,o),$=H(u,h);function h(Y){var C,F,D,T;(D=(F=(C=v.current)==null?void 0:C.get(c.current))==null?void 0:F.ref.current)==null||D.setAttribute("tabindex","-1"),(T=O.current)==null||T.setAttribute("tabindex","0"),c.current=r,Y.stopPropagation()}const b=w(r);return c.current==""&&R=="__root__"&&b==0&&(c.current=r),_.useEffect(()=>(P(r,R,b,!0,O),()=>y(r)),[]),_.useEffect(()=>()=>{c.current==r&&(c.current="")},[]),N.jsx(q.Provider,{value:{parent:r,getIndex:i,depth:j+1},children:N.jsx("li",{ref:V,role:"treeitem","data-state":f.has(r)?"open":"closed","data-depth":j,"aria-expanded":f.has(r),"aria-selected":x==r,tabIndex:c.current==r?0:-1,onFocus:$,...n})})}),Fr=_.forwardRef(({onClick:r,...u},n)=>{const{setRootValue:o,setSelection:i}=_.useContext(X),{parent:f}=_.useContext(q),x=H(r,c);function c(){i(f),o(v=>v.has(f)?new Set([...v].filter(P=>P!==f)):new Set([...v,f]))}return N.jsx("div",{ref:n,onClick:x,...u})}),Ar=_.forwardRef(({...r},u)=>{const{rootValue:n}=_.useContext(X),{parent:o}=_.useContext(q);if(n.has(o))return N.jsx("ul",{ref:u,role:"group",...r})}),Ir={Root:kr,Group:Dr,Trigger:Fr,Content:Ar,Item:jr};module.exports=Ir;
25
+ Check the top-level render call using <`+u+">.")}return t}}function je(e,t){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var u=ur(t);if(ke[u])return;ke[u]=!0;var s="";e&&e._owner&&e._owner!==ue.current&&(s=" It was passed a child from "+Y(e._owner.type)+"."),W(e),b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',u,s),W(null)}}function De(e,t){{if(typeof e!="object")return;if(oe(e))for(var u=0;u<e.length;u++){var s=e[u];ie(s)&&je(s,t)}else if(ie(e))e._store&&(e._store.validated=!0);else if(e){var p=m(e);if(typeof p=="function"&&p!==e.entries)for(var g=p.call(e),v;!(v=g.next()).done;)ie(v.value)&&je(v.value,t)}}}function ar(e){{var t=e.type;if(t==null||typeof t=="string")return;var u;if(typeof t=="function")u=t.propTypes;else if(typeof t=="object"&&(t.$$typeof===l||t.$$typeof===R))u=t.propTypes;else return;if(u){var s=Y(t);Ke(u,e.props,"prop",s,e)}else if(t.PropTypes!==void 0&&!ae){ae=!0;var p=Y(t);b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",p||"Unknown")}typeof t.getDefaultProps=="function"&&!t.getDefaultProps.isReactClassApproved&&b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ir(e){{for(var t=Object.keys(e.props),u=0;u<t.length;u++){var s=t[u];if(s!=="children"&&s!=="key"){W(e),b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",s),W(null);break}}e.ref!==null&&(W(e),b("Invalid attribute `ref` supplied to `React.Fragment`."),W(null))}}function Fe(e,t,u,s,p,g){{var v=Ye(e);if(!v){var d="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(d+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var T=or();T?d+=T:d+=Oe();var E;e===null?E="null":oe(e)?E="array":e!==void 0&&e.$$typeof===o?(E="<"+(Y(e.type)||"Unknown")+" />",d=" Did you accidentally export a JSX literal instead of a component?"):E=typeof e,b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",E,d)}var y=nr(e,t,u,p,g);if(y==null)return y;if(v){var j=t.children;if(j!==void 0)if(s)if(oe(j)){for(var U=0;U<j.length;U++)De(j[U],e);Object.freeze&&Object.freeze(j)}else b("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 De(j,e)}return e===a?ir(y):ar(y),y}}function sr(e,t,u){return Fe(e,t,u,!0)}function cr(e,t,u){return Fe(e,t,u,!1)}var fr=cr,lr=sr;K.Fragment=a,K.jsx=fr,K.jsxs=lr}()),K}process.env.NODE_ENV==="production"?se.exports=dr():se.exports=vr();var I=se.exports;const z=_.createContext({rootValue:new Set,setRootValue:()=>{},selection:null,setSelection:()=>{},focus:{current:""},nodeMap:{current:new Map},registerNode:()=>{},removeNode:()=>{}});function pr(){const r=_.useRef(new Map([["__root__",{value:"__root__",parent:"",index:0,isGroup:!0,ref:{current:null}}]]));return[r,(a,i,c,w,f)=>{var l;(l=r.current)==null||l.set(a,{value:a,parent:i,index:c,isGroup:w,ref:f})},a=>{var i;(i=r.current)==null||i.delete(a)}]}function Ie(r,o){if(!r.current)return"";for(const[n,a]of r.current)if(a.parent==o&&a.index==0)return a.value;return""}function _r(r,o){if(!r.current)return"";const n=r.current.get(o);if(n){for(const[a,i]of r.current)if(i.parent==n.parent&&i.index==n.index-1)return i.value;return""}else return""}function gr(r,o){if(!r.current)return"";const n=r.current.get(o);if(n){if(n.index==0)return n.parent;{let a=r.current.get(_r(r,n.value));for(;a&&a.isGroup;){const i=r.current.get($e(r,a.value));if(!i)return a.value;a=i}return a?a.value:""}}else return""}function hr(r,o){if(!r.current)return"";const n=r.current.get(o);if(n){for(const[a,i]of r.current)if(i.parent==n.parent&&i.index==n.index+1)return i.value;return""}else return""}function Rr(r,o){if(!r.current)return"";const n=r.current.get(o);if(n){if(n.isGroup){const i=Ie(r,o);if(i)return i}let a=n;for(;;){const i=hr(r,a.value);if(i)return i;{const c=r.current.get(a.parent);if(!c||a.value=="__root__")return"";a=c}}}else return""}function br(r){if(!r.current)return"";for(const[o,n]of r.current)if(n.parent=="__root__"&&n.index==0)return n.value;return""}function $e(r,o){if(!r.current)return"";let n=null;for(const[a,i]of r.current)i.parent==o&&(!n||i.index>n.index)&&(n=i);return n?n.value:""}function Er(r){if(!r.current)return"";let o=r.current.get("__root__");for(;o&&o.isGroup;){const n=r.current.get($e(r,o.value));if(!n)return o.value;o=n}return o?o.value:""}const G=_.createContext({parent:"",depth:-1});function mr(r,o,n){const[a,i]=_.useState(n),c=r!==void 0?r:a;return[c,f=>{const l=typeof f=="function"?f(c):f;o&&o(l),i(l)}]}function J(r,o){return function(a){const i=a.defaultPrevented;i&&(a.defaultPrevented=!1),r==null||r(a);let c;return a.defaultPrevented||(c=o==null?void 0:o(a),i&&(a.defaultPrevented=!0)),c}}function ce(...r){return _.useCallback(o=>{for(const n of r)typeof n=="function"?n(o):n!=null&&(n.current=o)},[r])}const yr=["ArrowRight","ArrowUp","ArrowLeft","ArrowDown","Home","End","Enter"];function wr(r,o){var a,i,c;const n=Ie(r,o);n&&((c=(i=(a=r.current)==null?void 0:a.get(n))==null?void 0:i.ref.current)==null||c.focus())}function Cr(r,o){var a,i,c,w,f;const n=(i=(a=r.current)==null?void 0:a.get(o))==null?void 0:i.parent;n&&n!="__root__"&&((f=(w=(c=r.current)==null?void 0:c.get(n))==null?void 0:w.ref.current)==null||f.focus())}function xr(r,o){var a,i,c;const n=gr(r,o);n&&n!="__root__"&&((c=(i=(a=r.current)==null?void 0:a.get(n))==null?void 0:i.ref.current)==null||c.focus())}function Tr(r,o){var a,i,c;const n=Rr(r,o);n&&n!="__root__"&&((c=(i=(a=r.current)==null?void 0:a.get(n))==null?void 0:i.ref.current)==null||c.focus())}function Sr(r){var n,a,i;const o=br(r);o&&o!="__root__"&&((i=(a=(n=r.current)==null?void 0:n.get(o))==null?void 0:a.ref.current)==null||i.focus())}function Pr(r){var n,a,i;const o=Er(r);o&&o!="__root__"&&((i=(a=(n=r.current)==null?void 0:n.get(o))==null?void 0:a.ref.current)==null||i.focus())}const Or=_.forwardRef(({value:r,onValueChange:o,defaultValue:n,defaultSelection:a,onKeyDown:i,...c},w)=>{const[f,l,S]=pr(),[h,R]=mr(r,o,n??new Set),[C,P]=_.useState(""),D=_.useRef(null),$=ce(D,w),m=_.useRef(""),O=_.useCallback(x=>{var A;if(!(!yr.includes(x.key)||!f))switch(x.key){case"ArrowRight":const F=(A=f.current)==null?void 0:A.get(m.current);if(!F||!F.isGroup)break;x.preventDefault(),h.has(m.current)?wr(f,m.current):R(k=>new Set([...k,m.current]));break;case"ArrowLeft":x.preventDefault(),h.has(m.current)?R(k=>new Set([...k].filter(V=>V!==m.current))):Cr(f,m.current);break;case"ArrowUp":x.preventDefault(),xr(f,m.current);break;case"ArrowDown":x.preventDefault(),Tr(f,m.current);break;case"Home":x.preventDefault(),Sr(f);break;case"End":x.preventDefault(),Pr(f);break;case"Enter":x.preventDefault(),P(m.current),h.has(m.current)?R(k=>new Set([...k].filter(V=>V!==m.current))):R(k=>new Set([...k,m.current]));break}},[h]),b=J(i,O);return I.jsx(z.Provider,{value:{rootValue:h,setRootValue:R,selection:C,setSelection:P,focus:m,nodeMap:f,registerNode:l,removeNode:S},children:I.jsx(G.Provider,{value:{parent:"__root__",depth:0},children:I.jsx("ul",{ref:$,role:"tree","aria-multiselectable":"false",onKeyDown:b,...c})})})}),kr=_.forwardRef(({value:r,index:o,onFocus:n,onClick:a,...i},c)=>{const{selection:w,setSelection:f,focus:l,nodeMap:S,registerNode:h,removeNode:R}=_.useContext(z),{parent:C,depth:P}=_.useContext(G),D=_.useRef(null),$=ce(D,c),m=J(n,b),O=J(a,x);function b(A){var F,k,V,H;(V=(k=(F=S.current)==null?void 0:F.get(l.current))==null?void 0:k.ref.current)==null||V.setAttribute("tabindex","-1"),(H=D.current)==null||H.setAttribute("tabindex","0"),l.current=r,A.stopPropagation()}function x(){f(r)}return l.current==""&&C=="__root__"&&o==0&&(l.current=r),_.useEffect(()=>(h(r,C,o,!1,D),()=>R(r)),[r,C,o]),_.useEffect(()=>()=>{l.current==r&&(l.current="")},[]),I.jsx("li",{ref:$,role:"treeitem","aria-selected":w==r,tabIndex:l.current==r?0:-1,onFocus:m,onClick:O,"data-depth":P,...i})}),jr=_.forwardRef(({value:r,index:o,onFocus:n,...a},i)=>{const{rootValue:c,selection:w,focus:f,nodeMap:l,registerNode:S,removeNode:h}=_.useContext(z),{parent:R,depth:C}=_.useContext(G),P=_.useRef(null),D=ce(P,i),$=J(n,m);function m(O){var b,x,A,F;(A=(x=(b=l.current)==null?void 0:b.get(f.current))==null?void 0:x.ref.current)==null||A.setAttribute("tabindex","-1"),(F=P.current)==null||F.setAttribute("tabindex","0"),f.current=r,O.stopPropagation()}return f.current==""&&R=="__root__"&&o==0&&(f.current=r),_.useEffect(()=>(S(r,R,o,!0,P),()=>h(r)),[r,R,o]),_.useEffect(()=>()=>{f.current==r&&(f.current="")},[]),I.jsx(G.Provider,{value:{parent:r,depth:C+1},children:I.jsx("li",{ref:D,role:"treeitem","data-state":c.has(r)?"open":"closed","data-depth":C,"aria-expanded":c.has(r),"aria-selected":w==r,tabIndex:f.current==r?0:-1,onFocus:$,...a})})}),Dr=_.forwardRef(({onClick:r,...o},n)=>{const{setRootValue:a,setSelection:i}=_.useContext(z),{parent:c}=_.useContext(G),w=J(r,f);function f(){i(c),a(l=>l.has(c)?new Set([...l].filter(S=>S!==c)):new Set([...l,c]))}return I.jsx("div",{ref:n,onClick:w,...o})}),Fr=_.forwardRef(({...r},o)=>{const{rootValue:n}=_.useContext(z),{parent:a}=_.useContext(G);if(n.has(a))return I.jsx("ul",{ref:o,role:"group",...r})}),Ar={Root:Or,Group:jr,Trigger:Dr,Content:Fr,Item:kr};module.exports=Ar;
26
26
  //# sourceMappingURL=index.cjs.map