react-composable-treeview 1.0.13 → 1.0.14

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.
@@ -5,7 +5,7 @@ export interface TreeViewContextType {
5
5
  rootValue: Set<string>;
6
6
  setRootValue: React.Dispatch<React.SetStateAction<Set<string>>>;
7
7
  selection: string | null;
8
- setSelection: React.Dispatch<React.SetStateAction<string | null>>;
8
+ setSelection: React.Dispatch<React.SetStateAction<string>>;
9
9
  focus: React.MutableRefObject<string>;
10
10
  nodeMap: useNodeMapHook[0];
11
11
  pushToNodeMap: useNodeMapHook[1];
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";const b=require("react");var ce={exports:{}},q={};/**
1
+ "use strict";const g=require("react");var fe={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 dr(){if(Ie)return q;Ie=1;var t=b,o=Symbol.for("react.element"),i=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,h=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,v={key:!0,ref:!0,__self:!0,__source:!0};function f(l,_,w){var R,x={},C=null,P=null;w!==void 0&&(C=""+w),_.key!==void 0&&(C=""+_.key),_.ref!==void 0&&(P=_.ref);for(R in _)a.call(_,R)&&!v.hasOwnProperty(R)&&(x[R]=_[R]);if(l&&l.defaultProps)for(R in _=l.defaultProps,_)x[R]===void 0&&(x[R]=_[R]);return{$$typeof:o,type:l,key:C,ref:P,props:x,_owner:h.current}}return q.Fragment=i,q.jsx=f,q.jsxs=f,q}var B={};/**
9
+ */var Ve;function dr(){if(Ve)return B;Ve=1;var t=g,o=Symbol.for("react.element"),i=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,p=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,v={key:!0,ref:!0,__self:!0,__source:!0};function c(l,h,w){var b,C={},T=null,P=null;w!==void 0&&(T=""+w),h.key!==void 0&&(T=""+h.key),h.ref!==void 0&&(P=h.ref);for(b in h)a.call(h,b)&&!v.hasOwnProperty(b)&&(C[b]=h[b]);if(l&&l.defaultProps)for(b in h=l.defaultProps,h)C[b]===void 0&&(C[b]=h[b]);return{$$typeof:o,type:l,key:T,ref:P,props:C,_owner:p.current}}return B.Fragment=i,B.jsx=c,B.jsxs=c,B}var K={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,15 +14,15 @@
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 Ve;function vr(){return Ve||(Ve=1,process.env.NODE_ENV!=="production"&&function(){var t=b,o=Symbol.for("react.element"),i=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),h=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),l=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),x=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),P=Symbol.for("react.offscreen"),F=Symbol.iterator,m="@@iterator";function V(e){if(e===null||typeof e!="object")return null;var r=F&&e[F]||e[m];return typeof r=="function"?r:null}var k=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function p(e){{for(var r=arguments.length,n=new Array(r>1?r-1:0),u=1;u<r;u++)n[u-1]=arguments[u];T("error",e,n)}}function T(e,r,n){{var u=k.ReactDebugCurrentFrame,d=u.getStackAddendum();d!==""&&(r+="%s",n=n.concat([d]));var g=n.map(function(c){return String(c)});g.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,g)}}var j=!1,L=!1,J=!1,z=!1,Ne=!1,le;le=Symbol.for("react.module.reference");function $e(e){return!!(typeof e=="string"||typeof e=="function"||e===a||e===v||Ne||e===h||e===w||e===R||z||e===P||j||L||J||typeof e=="object"&&e!==null&&(e.$$typeof===C||e.$$typeof===x||e.$$typeof===f||e.$$typeof===l||e.$$typeof===_||e.$$typeof===le||e.getModuleId!==void 0))}function We(e,r,n){var u=e.displayName;if(u)return u;var d=r.displayName||r.name||"";return d!==""?n+"("+d+")":n}function de(e){return e.displayName||"Context"}function D(e){if(e==null)return null;if(typeof e.tag=="number"&&p("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 i:return"Portal";case v:return"Profiler";case h:return"StrictMode";case w:return"Suspense";case R:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case l:var r=e;return de(r)+".Consumer";case f:var n=e;return de(n._context)+".Provider";case _:return We(e,e.render,"ForwardRef");case x:var u=e.displayName||null;return u!==null?u:D(e.type)||"Memo";case C:{var d=e,g=d._payload,c=d._init;try{return D(c(g))}catch{return null}}}return null}var N=Object.assign,U=0,ve,pe,he,_e,ge,be,Re;function Ee(){}Ee.__reactDisabledLog=!0;function Ye(){{if(U===0){ve=console.log,pe=console.info,he=console.warn,_e=console.error,ge=console.group,be=console.groupCollapsed,Re=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Ee,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}U++}}function Ue(){{if(U--,U===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:N({},e,{value:ve}),info:N({},e,{value:pe}),warn:N({},e,{value:he}),error:N({},e,{value:_e}),group:N({},e,{value:ge}),groupCollapsed:N({},e,{value:be}),groupEnd:N({},e,{value:Re})})}U<0&&p("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var re=k.ReactCurrentDispatcher,te;function H(e,r,n){{if(te===void 0)try{throw Error()}catch(d){var u=d.stack.trim().match(/\n( *(at )?)/);te=u&&u[1]||""}return`
18
- `+te+e}}var ne=!1,X;{var Ge=typeof WeakMap=="function"?WeakMap:Map;X=new Ge}function me(e,r){if(!e||ne)return"";{var n=X.get(e);if(n!==void 0)return n}var u;ne=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var g;g=re.current,re.current=null,Ye();try{if(r){var c=function(){throw Error()};if(Object.defineProperty(c.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(c,[])}catch(A){u=A}Reflect.construct(e,[],c)}else{try{c.call()}catch(A){u=A}e.call(c.prototype)}}else{try{throw Error()}catch(A){u=A}e()}}catch(A){if(A&&u&&typeof A.stack=="string"){for(var s=A.stack.split(`
17
+ */var Le;function vr(){return Le||(Le=1,process.env.NODE_ENV!=="production"&&function(){var t=g,o=Symbol.for("react.element"),i=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),l=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),b=Symbol.for("react.suspense_list"),C=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),P=Symbol.for("react.offscreen"),I=Symbol.iterator,R="@@iterator";function L(e){if(e===null||typeof e!="object")return null;var r=I&&e[I]||e[R];return typeof r=="function"?r:null}var O=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function E(e){{for(var r=arguments.length,n=new Array(r>1?r-1:0),u=1;u<r;u++)n[u-1]=arguments[u];x("error",e,n)}}function x(e,r,n){{var u=O.ReactDebugCurrentFrame,d=u.getStackAddendum();d!==""&&(r+="%s",n=n.concat([d]));var _=n.map(function(f){return String(f)});_.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,_)}}var k=!1,D=!1,N=!1,z=!1,H=!1,de;de=Symbol.for("react.module.reference");function $e(e){return!!(typeof e=="string"||typeof e=="function"||e===a||e===v||H||e===p||e===w||e===b||z||e===P||k||D||N||typeof e=="object"&&e!==null&&(e.$$typeof===T||e.$$typeof===C||e.$$typeof===c||e.$$typeof===l||e.$$typeof===h||e.$$typeof===de||e.getModuleId!==void 0))}function We(e,r,n){var u=e.displayName;if(u)return u;var d=r.displayName||r.name||"";return d!==""?n+"("+d+")":n}function ve(e){return e.displayName||"Context"}function A(e){if(e==null)return null;if(typeof e.tag=="number"&&E("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 i:return"Portal";case v:return"Profiler";case p:return"StrictMode";case w:return"Suspense";case b:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case l:var r=e;return ve(r)+".Consumer";case c:var n=e;return ve(n._context)+".Provider";case h:return We(e,e.render,"ForwardRef");case C:var u=e.displayName||null;return u!==null?u:A(e.type)||"Memo";case T:{var d=e,_=d._payload,f=d._init;try{return A(f(_))}catch{return null}}}return null}var $=Object.assign,G=0,pe,he,_e,ge,be,Re,Ee;function me(){}me.__reactDisabledLog=!0;function Ye(){{if(G===0){pe=console.log,he=console.info,_e=console.warn,ge=console.error,be=console.group,Re=console.groupCollapsed,Ee=console.groupEnd;var e={configurable:!0,enumerable:!0,value:me,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}G++}}function Ue(){{if(G--,G===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:$({},e,{value:pe}),info:$({},e,{value:he}),warn:$({},e,{value:_e}),error:$({},e,{value:ge}),group:$({},e,{value:be}),groupCollapsed:$({},e,{value:Re}),groupEnd:$({},e,{value:Ee})})}G<0&&E("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var te=O.ReactCurrentDispatcher,ne;function X(e,r,n){{if(ne===void 0)try{throw Error()}catch(d){var u=d.stack.trim().match(/\n( *(at )?)/);ne=u&&u[1]||""}return`
18
+ `+ne+e}}var oe=!1,Z;{var Ge=typeof WeakMap=="function"?WeakMap:Map;Z=new Ge}function ye(e,r){if(!e||oe)return"";{var n=Z.get(e);if(n!==void 0)return n}var u;oe=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var _;_=te.current,te.current=null,Ye();try{if(r){var f=function(){throw Error()};if(Object.defineProperty(f.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(f,[])}catch(F){u=F}Reflect.construct(e,[],f)}else{try{f.call()}catch(F){u=F}e.call(f.prototype)}}else{try{throw Error()}catch(F){u=F}e()}}catch(F){if(F&&u&&typeof F.stack=="string"){for(var s=F.stack.split(`
19
19
  `),S=u.stack.split(`
20
- `),E=s.length-1,y=S.length-1;E>=1&&y>=0&&s[E]!==S[y];)y--;for(;E>=1&&y>=0;E--,y--)if(s[E]!==S[y]){if(E!==1||y!==1)do if(E--,y--,y<0||s[E]!==S[y]){var O=`
21
- `+s[E].replace(" at new "," at ");return e.displayName&&O.includes("<anonymous>")&&(O=O.replace("<anonymous>",e.displayName)),typeof e=="function"&&X.set(e,O),O}while(E>=1&&y>=0);break}}}finally{ne=!1,re.current=g,Ue(),Error.prepareStackTrace=d}var W=e?e.displayName||e.name:"",Fe=W?H(W):"";return typeof e=="function"&&X.set(e,Fe),Fe}function qe(e,r,n){return me(e,!1)}function Be(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function Z(e,r,n){if(e==null)return"";if(typeof e=="function")return me(e,Be(e));if(typeof e=="string")return H(e);switch(e){case w:return H("Suspense");case R:return H("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case _:return qe(e.render);case x:return Z(e.type,r,n);case C:{var u=e,d=u._payload,g=u._init;try{return Z(g(d),r,n)}catch{}}}return""}var Q=Object.prototype.hasOwnProperty,ye={},we=k.ReactDebugCurrentFrame;function ee(e){if(e){var r=e._owner,n=Z(e.type,e._source,r?r.type:null);we.setExtraStackFrame(n)}else we.setExtraStackFrame(null)}function Ke(e,r,n,u,d){{var g=Function.call.bind(Q);for(var c in e)if(g(e,c)){var s=void 0;try{if(typeof e[c]!="function"){var S=Error((u||"React class")+": "+n+" type `"+c+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[c]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw S.name="Invariant Violation",S}s=e[c](r,c,u,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(E){s=E}s&&!(s instanceof Error)&&(ee(d),p("%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).",u||"React class",n,c,typeof s),ee(null)),s instanceof Error&&!(s.message in ye)&&(ye[s.message]=!0,ee(d),p("Failed %s type: %s",n,s.message),ee(null))}}}var Me=Array.isArray;function oe(e){return Me(e)}function Je(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,n=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return n}}function ze(e){try{return xe(e),!1}catch{return!0}}function xe(e){return""+e}function Ce(e){if(ze(e))return p("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Je(e)),xe(e)}var G=k.ReactCurrentOwner,He={key:!0,ref:!0,__self:!0,__source:!0},Te,Se,ae;ae={};function Xe(e){if(Q.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Ze(e){if(Q.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Qe(e,r){if(typeof e.ref=="string"&&G.current&&r&&G.current.stateNode!==r){var n=D(G.current.type);ae[n]||(p('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',D(G.current.type),e.ref),ae[n]=!0)}}function er(e,r){{var n=function(){Te||(Te=!0,p("%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)",r))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}}function rr(e,r){{var n=function(){Se||(Se=!0,p("%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)",r))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}}var tr=function(e,r,n,u,d,g,c){var s={$$typeof:o,type:e,key:r,ref:n,props:c,_owner:g};return s._store={},Object.defineProperty(s._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(s,"_self",{configurable:!1,enumerable:!1,writable:!1,value:u}),Object.defineProperty(s,"_source",{configurable:!1,enumerable:!1,writable:!1,value:d}),Object.freeze&&(Object.freeze(s.props),Object.freeze(s)),s};function nr(e,r,n,u,d){{var g,c={},s=null,S=null;n!==void 0&&(Ce(n),s=""+n),Ze(r)&&(Ce(r.key),s=""+r.key),Xe(r)&&(S=r.ref,Qe(r,d));for(g in r)Q.call(r,g)&&!He.hasOwnProperty(g)&&(c[g]=r[g]);if(e&&e.defaultProps){var E=e.defaultProps;for(g in E)c[g]===void 0&&(c[g]=E[g])}if(s||S){var y=typeof e=="function"?e.displayName||e.name||"Unknown":e;s&&er(c,y),S&&rr(c,y)}return tr(e,s,S,d,u,G.current,c)}}var ie=k.ReactCurrentOwner,Pe=k.ReactDebugCurrentFrame;function $(e){if(e){var r=e._owner,n=Z(e.type,e._source,r?r.type:null);Pe.setExtraStackFrame(n)}else Pe.setExtraStackFrame(null)}var ue;ue=!1;function se(e){return typeof e=="object"&&e!==null&&e.$$typeof===o}function ke(){{if(ie.current){var e=D(ie.current.type);if(e)return`
20
+ `),m=s.length-1,y=S.length-1;m>=1&&y>=0&&s[m]!==S[y];)y--;for(;m>=1&&y>=0;m--,y--)if(s[m]!==S[y]){if(m!==1||y!==1)do if(m--,y--,y<0||s[m]!==S[y]){var j=`
21
+ `+s[m].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(m>=1&&y>=0);break}}}finally{oe=!1,te.current=_,Ue(),Error.prepareStackTrace=d}var Y=e?e.displayName||e.name:"",Ie=Y?X(Y):"";return typeof e=="function"&&Z.set(e,Ie),Ie}function qe(e,r,n){return ye(e,!1)}function Be(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function Q(e,r,n){if(e==null)return"";if(typeof e=="function")return ye(e,Be(e));if(typeof e=="string")return X(e);switch(e){case w:return X("Suspense");case b:return X("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case h:return qe(e.render);case C:return Q(e.type,r,n);case T:{var u=e,d=u._payload,_=u._init;try{return Q(_(d),r,n)}catch{}}}return""}var ee=Object.prototype.hasOwnProperty,we={},xe=O.ReactDebugCurrentFrame;function re(e){if(e){var r=e._owner,n=Q(e.type,e._source,r?r.type:null);xe.setExtraStackFrame(n)}else xe.setExtraStackFrame(null)}function Ke(e,r,n,u,d){{var _=Function.call.bind(ee);for(var f in e)if(_(e,f)){var s=void 0;try{if(typeof e[f]!="function"){var S=Error((u||"React class")+": "+n+" type `"+f+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[f]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw S.name="Invariant Violation",S}s=e[f](r,f,u,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(m){s=m}s&&!(s instanceof Error)&&(re(d),E("%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).",u||"React class",n,f,typeof s),re(null)),s instanceof Error&&!(s.message in we)&&(we[s.message]=!0,re(d),E("Failed %s type: %s",n,s.message),re(null))}}}var Me=Array.isArray;function ae(e){return Me(e)}function Je(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,n=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return n}}function ze(e){try{return Ce(e),!1}catch{return!0}}function Ce(e){return""+e}function Te(e){if(ze(e))return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Je(e)),Ce(e)}var q=O.ReactCurrentOwner,He={key:!0,ref:!0,__self:!0,__source:!0},Se,Pe,ie;ie={};function Xe(e){if(ee.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Ze(e){if(ee.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Qe(e,r){if(typeof e.ref=="string"&&q.current&&r&&q.current.stateNode!==r){var n=A(q.current.type);ie[n]||(E('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',A(q.current.type),e.ref),ie[n]=!0)}}function er(e,r){{var n=function(){Se||(Se=!0,E("%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)",r))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}}function rr(e,r){{var n=function(){Pe||(Pe=!0,E("%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)",r))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}}var tr=function(e,r,n,u,d,_,f){var s={$$typeof:o,type:e,key:r,ref:n,props:f,_owner:_};return s._store={},Object.defineProperty(s._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(s,"_self",{configurable:!1,enumerable:!1,writable:!1,value:u}),Object.defineProperty(s,"_source",{configurable:!1,enumerable:!1,writable:!1,value:d}),Object.freeze&&(Object.freeze(s.props),Object.freeze(s)),s};function nr(e,r,n,u,d){{var _,f={},s=null,S=null;n!==void 0&&(Te(n),s=""+n),Ze(r)&&(Te(r.key),s=""+r.key),Xe(r)&&(S=r.ref,Qe(r,d));for(_ in r)ee.call(r,_)&&!He.hasOwnProperty(_)&&(f[_]=r[_]);if(e&&e.defaultProps){var m=e.defaultProps;for(_ in m)f[_]===void 0&&(f[_]=m[_])}if(s||S){var y=typeof e=="function"?e.displayName||e.name||"Unknown":e;s&&er(f,y),S&&rr(f,y)}return tr(e,s,S,d,u,q.current,f)}}var ue=O.ReactCurrentOwner,ke=O.ReactDebugCurrentFrame;function W(e){if(e){var r=e._owner,n=Q(e.type,e._source,r?r.type:null);ke.setExtraStackFrame(n)}else ke.setExtraStackFrame(null)}var se;se=!1;function ce(e){return typeof e=="object"&&e!==null&&e.$$typeof===o}function Oe(){{if(ue.current){var e=A(ue.current.type);if(e)return`
22
22
 
23
23
  Check the render method of \``+e+"`."}return""}}function or(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),n=e.lineNumber;return`
24
24
 
25
- Check your code at `+r+":"+n+"."}return""}}var Oe={};function ar(e){{var r=ke();if(!r){var n=typeof e=="string"?e:e.displayName||e.name;n&&(r=`
25
+ Check your code at `+r+":"+n+"."}return""}}var je={};function ar(e){{var r=Oe();if(!r){var n=typeof e=="string"?e:e.displayName||e.name;n&&(r=`
26
26
 
27
- Check the top-level render call using <`+n+">.")}return r}}function je(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var n=ar(r);if(Oe[n])return;Oe[n]=!0;var u="";e&&e._owner&&e._owner!==ie.current&&(u=" It was passed a child from "+D(e._owner.type)+"."),$(e),p('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',n,u),$(null)}}function De(e,r){{if(typeof e!="object")return;if(oe(e))for(var n=0;n<e.length;n++){var u=e[n];se(u)&&je(u,r)}else if(se(e))e._store&&(e._store.validated=!0);else if(e){var d=V(e);if(typeof d=="function"&&d!==e.entries)for(var g=d.call(e),c;!(c=g.next()).done;)se(c.value)&&je(c.value,r)}}}function ir(e){{var r=e.type;if(r==null||typeof r=="string")return;var n;if(typeof r=="function")n=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===_||r.$$typeof===x))n=r.propTypes;else return;if(n){var u=D(r);Ke(n,e.props,"prop",u,e)}else if(r.PropTypes!==void 0&&!ue){ue=!0;var d=D(r);p("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",d||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&p("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ur(e){{for(var r=Object.keys(e.props),n=0;n<r.length;n++){var u=r[n];if(u!=="children"&&u!=="key"){$(e),p("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",u),$(null);break}}e.ref!==null&&($(e),p("Invalid attribute `ref` supplied to `React.Fragment`."),$(null))}}function Ae(e,r,n,u,d,g){{var c=$e(e);if(!c){var s="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(s+=" 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=or(d);S?s+=S:s+=ke();var E;e===null?E="null":oe(e)?E="array":e!==void 0&&e.$$typeof===o?(E="<"+(D(e.type)||"Unknown")+" />",s=" Did you accidentally export a JSX literal instead of a component?"):E=typeof e,p("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",E,s)}var y=nr(e,r,n,d,g);if(y==null)return y;if(c){var O=r.children;if(O!==void 0)if(u)if(oe(O)){for(var W=0;W<O.length;W++)De(O[W],e);Object.freeze&&Object.freeze(O)}else p("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(O,e)}return e===a?ur(y):ir(y),y}}function sr(e,r,n){return Ae(e,r,n,!0)}function cr(e,r,n){return Ae(e,r,n,!1)}var fr=cr,lr=sr;B.Fragment=a,B.jsx=fr,B.jsxs=lr}()),B}process.env.NODE_ENV==="production"?ce.exports=dr():ce.exports=vr();var I=ce.exports;const M=b.createContext({rootValue:new Set,setRootValue:()=>{},selection:null,setSelection:()=>{},focus:{current:""},nodeMap:{current:{}},pushToNodeMap:()=>{}});function pr(){const t=b.useRef({});return t.current={__root__:{value:"__root__",parent:"",children:{},index:0,childrenLength:0,isGroup:!0,ref:{current:null}}},[t,(i,a,h,v,f)=>{t.current[i]={value:i,parent:a,children:{},childrenLength:0,index:h,isGroup:v,ref:f},t.current[a].children[h]=i,(h+1>t.current[a].childrenLength||t.current[t.current[a].childrenLength-1]==null)&&(t.current[a].childrenLength=h+1)}]}const Y=b.createContext({parent:"",getIndex:()=>-1,depth:-1});function hr(t,o,i){const[a,h]=b.useState(i),v=t!==void 0?t:a;return[v,l=>{const _=typeof l=="function"?l(v):l;o&&o(_),h(_)}]}function K(t,o){return function(a){const h=a.defaultPrevented;h&&(a.defaultPrevented=!1),t==null||t(a);let v;return a.defaultPrevented||(v=o==null?void 0:o(a),h&&(a.defaultPrevented=!0)),v}}function fe(...t){return b.useCallback(o=>{for(const i of t)typeof i=="function"?i(o):i!=null&&(i.current=o)},[t])}function Le(){let t=-1;const o={};function i(a){return o[a]==null&&(o[a]=++t),o[a]}return i}const _r=["ArrowRight","ArrowUp","ArrowLeft","ArrowDown","Home","End","Enter"];function gr(t,o){var a;const i=t[o].children[0];i!=null&&((a=t[i].ref.current)==null||a.focus())}function br(t,o){var a;const i=t[o].parent;i!="__root__"&&((a=t[i].ref.current)==null||a.focus())}function Rr(t,o){var h,v;const i=t[o].parent,a=t[o].index;if(a!=0){let f=t[i].children[a-1],l;for(;t[f].isGroup&&(l=t[f].children[t[f].childrenLength-1],!(l==null||t[l].ref.current==null));)f=l;(h=t[f].ref.current)==null||h.focus();return}i!="__root__"&&((v=t[i].ref.current)==null||v.focus())}function Er(t,o){var h,v;if(t[o].isGroup){const f=(h=t[t[o].children[0]])==null?void 0:h.ref.current;if(f){f.focus();return}}let i,a;for(;i=t[o].parent,a=t[i].children[t[o].index+1],a==null;){if(i=="__root__")return;o=i}(v=t[a].ref.current)==null||v.focus()}function mr(t){var i;const o=t.__root__.children[0];(i=t[o].ref.current)==null||i.focus()}function yr(t){var a;let o="__root__",i;for(;t[o].isGroup&&(i=t[o].children[t[o].childrenLength-1],!(i==null||t[i].ref.current==null));)o=i;(a=t[o].ref.current)==null||a.focus()}const wr=b.forwardRef(({value:t,onValueChange:o,defaultValue:i,onKeyDown:a,...h},v)=>{const[f,l]=pr(),_=Le(),[w,R]=hr(t,o,i??new Set),[x,C]=b.useState(null),P=b.useRef(null),F=fe(P,v),m=b.useRef(""),V=b.useCallback(p=>{if(!(!_r.includes(p.key)||!f.current))switch(p.key){case"ArrowRight":if(!f.current[m.current].isGroup)break;p.preventDefault(),w.has(m.current)?gr(f.current,m.current):R(T=>new Set([...T,m.current]));break;case"ArrowLeft":p.preventDefault(),w.has(m.current)?R(T=>new Set([...T].filter(j=>j!==m.current))):br(f.current,m.current);break;case"ArrowUp":p.preventDefault(),Rr(f.current,m.current);break;case"ArrowDown":p.preventDefault(),Er(f.current,m.current);break;case"Home":p.preventDefault(),mr(f.current);break;case"End":p.preventDefault(),yr(f.current);break;case"Enter":p.preventDefault(),C(m.current),w.has(m.current)?R(T=>new Set([...T].filter(j=>j!==m.current))):R(T=>new Set([...T,m.current]));break}},[w]),k=K(a,V);return I.jsx(M.Provider,{value:{rootValue:w,setRootValue:R,selection:x,setSelection:C,focus:m,nodeMap:f,pushToNodeMap:l},children:I.jsx(Y.Provider,{value:{parent:"__root__",getIndex:_,depth:0},children:I.jsx("ul",{ref:F,role:"tree","aria-multiselectable":"false",onKeyDown:k,...h})})})}),xr=b.forwardRef(({value:t,onFocus:o,onClick:i,...a},h)=>{const{selection:v,setSelection:f,focus:l,nodeMap:_,pushToNodeMap:w}=b.useContext(M),{parent:R,getIndex:x,depth:C}=b.useContext(Y),P=b.useRef(null),F=fe(P,h),m=K(o,k),V=K(i,p);function k(j){var L,J,z;(J=(L=_.current)==null?void 0:L[l.current].ref.current)==null||J.setAttribute("tabindex","-1"),(z=P.current)==null||z.setAttribute("tabindex","0"),l.current=t,j.stopPropagation()}function p(){f(t)}const T=x(t);return w(t,R,T,!1,P),l.current==""&&R=="__root__"&&T==0&&(l.current=t),I.jsx("li",{ref:F,role:"treenode","aria-selected":v==t,tabIndex:l.current==t?0:-1,onFocus:m,onClick:V,"data-depth":C,...a})}),Cr=b.forwardRef(({value:t,onFocus:o,...i},a)=>{const h=Le(),{rootValue:v,selection:f,focus:l,nodeMap:_,pushToNodeMap:w}=b.useContext(M),{parent:R,getIndex:x,depth:C}=b.useContext(Y),P=b.useRef(null),F=fe(P,a),m=K(o,V);function V(p){var T,j,L;(j=(T=_.current)==null?void 0:T[l.current].ref.current)==null||j.setAttribute("tabindex","-1"),(L=P.current)==null||L.setAttribute("tabindex","0"),l.current=t,p.stopPropagation()}const k=x(t);return w(t,R,k,!0,P),l.current==""&&R=="__root__"&&k==0&&(l.current=t),I.jsx(Y.Provider,{value:{parent:t,getIndex:h,depth:C+1},children:I.jsx("li",{ref:F,role:"treenode","data-state":v.has(t)?"open":"closed","data-depth":C,"aria-expanded":v.has(t),"aria-selected":f==t,tabIndex:l.current==t?0:-1,onFocus:m,...i})})}),Tr=b.forwardRef(({onClick:t,...o},i)=>{const{setRootValue:a,setSelection:h}=b.useContext(M),{parent:v}=b.useContext(Y),f=K(t,l);function l(){h(v),a(_=>_.has(v)?new Set([..._].filter(w=>w!==v)):new Set([..._,v]))}return I.jsx("div",{ref:i,onClick:f,...o})}),Sr=b.forwardRef(({...t},o)=>{const{rootValue:i}=b.useContext(M),{parent:a}=b.useContext(Y);if(i.has(a))return I.jsx("ul",{ref:o,role:"group",...t})}),Pr={Root:wr,Group:Cr,Trigger:Tr,Content:Sr,Item:xr};module.exports=Pr;
27
+ Check the top-level render call using <`+n+">.")}return r}}function De(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var n=ar(r);if(je[n])return;je[n]=!0;var u="";e&&e._owner&&e._owner!==ue.current&&(u=" It was passed a child from "+A(e._owner.type)+"."),W(e),E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',n,u),W(null)}}function Ae(e,r){{if(typeof e!="object")return;if(ae(e))for(var n=0;n<e.length;n++){var u=e[n];ce(u)&&De(u,r)}else if(ce(e))e._store&&(e._store.validated=!0);else if(e){var d=L(e);if(typeof d=="function"&&d!==e.entries)for(var _=d.call(e),f;!(f=_.next()).done;)ce(f.value)&&De(f.value,r)}}}function ir(e){{var r=e.type;if(r==null||typeof r=="string")return;var n;if(typeof r=="function")n=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===h||r.$$typeof===C))n=r.propTypes;else return;if(n){var u=A(r);Ke(n,e.props,"prop",u,e)}else if(r.PropTypes!==void 0&&!se){se=!0;var d=A(r);E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",d||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ur(e){{for(var r=Object.keys(e.props),n=0;n<r.length;n++){var u=r[n];if(u!=="children"&&u!=="key"){W(e),E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",u),W(null);break}}e.ref!==null&&(W(e),E("Invalid attribute `ref` supplied to `React.Fragment`."),W(null))}}function Fe(e,r,n,u,d,_){{var f=$e(e);if(!f){var s="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(s+=" 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=or(d);S?s+=S:s+=Oe();var m;e===null?m="null":ae(e)?m="array":e!==void 0&&e.$$typeof===o?(m="<"+(A(e.type)||"Unknown")+" />",s=" Did you accidentally export a JSX literal instead of a component?"):m=typeof e,E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",m,s)}var y=nr(e,r,n,d,_);if(y==null)return y;if(f){var j=r.children;if(j!==void 0)if(u)if(ae(j)){for(var Y=0;Y<j.length;Y++)Ae(j[Y],e);Object.freeze&&Object.freeze(j)}else E("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 Ae(j,e)}return e===a?ur(y):ir(y),y}}function sr(e,r,n){return Fe(e,r,n,!0)}function cr(e,r,n){return Fe(e,r,n,!1)}var fr=cr,lr=sr;K.Fragment=a,K.jsx=fr,K.jsxs=lr}()),K}process.env.NODE_ENV==="production"?fe.exports=dr():fe.exports=vr();var V=fe.exports;const J=g.createContext({rootValue:new Set,setRootValue:()=>{},selection:null,setSelection:()=>{},focus:{current:""},nodeMap:{current:{}},pushToNodeMap:()=>{}});function pr(){const t=g.useRef({});return t.current={__root__:{value:"__root__",parent:"",children:{},index:0,childrenLength:0,isGroup:!0,ref:{current:null}}},[t,(i,a,p,v,c)=>{t.current[i]={value:i,parent:a,children:{},childrenLength:0,index:p,isGroup:v,ref:c},t.current[a].children[p]=i,(p+1>t.current[a].childrenLength||t.current[t.current[a].childrenLength-1]==null)&&(t.current[a].childrenLength=p+1)}]}const U=g.createContext({parent:"",getIndex:()=>-1,depth:-1});function hr(t,o,i){const[a,p]=g.useState(i),v=t!==void 0?t:a;return[v,l=>{const h=typeof l=="function"?l(v):l;o&&o(h),p(h)}]}function M(t,o){return function(a){const p=a.defaultPrevented;p&&(a.defaultPrevented=!1),t==null||t(a);let v;return a.defaultPrevented||(v=o==null?void 0:o(a),p&&(a.defaultPrevented=!0)),v}}function le(...t){return g.useCallback(o=>{for(const i of t)typeof i=="function"?i(o):i!=null&&(i.current=o)},[t])}function Ne(){let t=-1;const o={};function i(a){return o[a]==null&&(o[a]=++t),o[a]}return i}const _r=["ArrowRight","ArrowUp","ArrowLeft","ArrowDown","Home","End","Enter"];function gr(t,o){var a;const i=t[o].children[0];i!=null&&((a=t[i].ref.current)==null||a.focus())}function br(t,o){var a;const i=t[o].parent;i!="__root__"&&((a=t[i].ref.current)==null||a.focus())}function Rr(t,o){var p,v;const i=t[o].parent,a=t[o].index;if(a!=0){let c=t[i].children[a-1],l;for(;t[c].isGroup&&(l=t[c].children[t[c].childrenLength-1],!(l==null||t[l].ref.current==null));)c=l;(p=t[c].ref.current)==null||p.focus();return}i!="__root__"&&((v=t[i].ref.current)==null||v.focus())}function Er(t,o){var p,v;if(t[o].isGroup){const c=(p=t[t[o].children[0]])==null?void 0:p.ref.current;if(c){c.focus();return}}let i,a;for(;i=t[o].parent,a=t[i].children[t[o].index+1],a==null;){if(i=="__root__")return;o=i}(v=t[a].ref.current)==null||v.focus()}function mr(t){var i;const o=t.__root__.children[0];(i=t[o].ref.current)==null||i.focus()}function yr(t){var a;let o="__root__",i;for(;t[o].isGroup&&(i=t[o].children[t[o].childrenLength-1],!(i==null||t[i].ref.current==null));)o=i;(a=t[o].ref.current)==null||a.focus()}const wr=g.forwardRef(({value:t,onValueChange:o,defaultValue:i,onKeyDown:a,...p},v)=>{var E;const[c,l]=pr(),h=Ne(),[w,b]=hr(t,o,i??new Set),[C,T]=g.useState(""),P=g.useRef(null),I=le(P,v),R=g.useRef("");R.current!=""&&!((E=c.current)!=null&&E[R.current])&&(R.current="");const L=g.useCallback(x=>{if(!(!_r.includes(x.key)||!c.current))switch(x.key){case"ArrowRight":if(!c.current[R.current].isGroup)break;x.preventDefault(),w.has(R.current)?gr(c.current,R.current):b(k=>new Set([...k,R.current]));break;case"ArrowLeft":x.preventDefault(),w.has(R.current)?b(k=>new Set([...k].filter(D=>D!==R.current))):br(c.current,R.current);break;case"ArrowUp":x.preventDefault(),Rr(c.current,R.current);break;case"ArrowDown":x.preventDefault(),Er(c.current,R.current);break;case"Home":x.preventDefault(),mr(c.current);break;case"End":x.preventDefault(),yr(c.current);break;case"Enter":x.preventDefault(),T(R.current),w.has(R.current)?b(k=>new Set([...k].filter(D=>D!==R.current))):b(k=>new Set([...k,R.current]));break}},[w]),O=M(a,L);return V.jsx(J.Provider,{value:{rootValue:w,setRootValue:b,selection:C,setSelection:T,focus:R,nodeMap:c,pushToNodeMap:l},children:V.jsx(U.Provider,{value:{parent:"__root__",getIndex:h,depth:0},children:V.jsx("ul",{ref:I,role:"tree","aria-multiselectable":"false",onKeyDown:O,...p})})})}),xr=g.forwardRef(({value:t,onFocus:o,onClick:i,...a},p)=>{const{selection:v,setSelection:c,focus:l,nodeMap:h,pushToNodeMap:w}=g.useContext(J),{parent:b,getIndex:C,depth:T}=g.useContext(U),P=g.useRef(null),I=le(P,p),R=M(o,O),L=M(i,E);function O(k){var D,N,z,H;(z=(N=(D=h.current)==null?void 0:D[l.current])==null?void 0:N.ref.current)==null||z.setAttribute("tabindex","-1"),(H=P.current)==null||H.setAttribute("tabindex","0"),l.current=t,k.stopPropagation()}function E(){c(t)}const x=C(t);return w(t,b,x,!1,P),l.current==""&&b=="__root__"&&x==0&&(l.current=t),V.jsx("li",{ref:I,role:"treenode","aria-selected":v==t,tabIndex:l.current==t?0:-1,onFocus:R,onClick:L,"data-depth":T,...a})}),Cr=g.forwardRef(({value:t,onFocus:o,...i},a)=>{const p=Ne(),{rootValue:v,selection:c,focus:l,nodeMap:h,pushToNodeMap:w}=g.useContext(J),{parent:b,getIndex:C,depth:T}=g.useContext(U),P=g.useRef(null),I=le(P,a),R=M(o,L);function L(E){var x,k,D,N;(D=(k=(x=h.current)==null?void 0:x[l.current])==null?void 0:k.ref.current)==null||D.setAttribute("tabindex","-1"),(N=P.current)==null||N.setAttribute("tabindex","0"),l.current=t,E.stopPropagation()}const O=C(t);return w(t,b,O,!0,P),l.current==""&&b=="__root__"&&O==0&&(l.current=t),V.jsx(U.Provider,{value:{parent:t,getIndex:p,depth:T+1},children:V.jsx("li",{ref:I,role:"treenode","data-state":v.has(t)?"open":"closed","data-depth":T,"aria-expanded":v.has(t),"aria-selected":c==t,tabIndex:l.current==t?0:-1,onFocus:R,...i})})}),Tr=g.forwardRef(({onClick:t,...o},i)=>{const{setRootValue:a,setSelection:p}=g.useContext(J),{parent:v}=g.useContext(U),c=M(t,l);function l(){p(v),a(h=>h.has(v)?new Set([...h].filter(w=>w!==v)):new Set([...h,v]))}return V.jsx("div",{ref:i,onClick:c,...o})}),Sr=g.forwardRef(({...t},o)=>{const{rootValue:i}=g.useContext(J),{parent:a}=g.useContext(U);if(i.has(a))return V.jsx("ul",{ref:o,role:"group",...t})}),Pr={Root:wr,Group:Cr,Trigger:Tr,Content:Sr,Item:xr};module.exports=Pr;
28
28
  //# sourceMappingURL=index.cjs.map