@radix-ui/react-navigation-menu 0.1.3-rc.4 → 0.1.3-rc.7

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.js CHANGED
@@ -1,2 +1,848 @@
1
- var e=R({},require("@radix-ui/react-visually-hidden")),t=require("@radix-ui/react-use-callback-ref").useCallbackRef,n=require("@radix-ui/react-use-layout-effect").useLayoutEffect,o=require("@radix-ui/react-use-previous").usePrevious,r=require("@radix-ui/react-dismissable-layer").DismissableLayer,a=require("@radix-ui/react-collection").createCollection,i=require("@radix-ui/react-id").useId,u=require("@radix-ui/react-presence").Presence,s=require("@radix-ui/react-direction").useDirection,c=require("@radix-ui/react-compose-refs"),l=c.composeRefs,d=c.useComposedRefs,v=require("@radix-ui/react-use-controllable-state").useControllableState,f=require("@radix-ui/react-primitive").Primitive,p=require("@radix-ui/primitive").composeEventHandlers,m=require("@radix-ui/react-context").createContextScope,g=w(require("react-dom")),M=R({},require("react")),E=w(require("@babel/runtime/helpers/extends"));function w(e){return e&&e.__esModule?e.default:e}function R(e,t){return Object.keys(t).forEach((function(n){"default"!==n&&"__esModule"!==n&&Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})})),e}const[x,N,h]=a("NavigationMenu"),[C,b,_]=a("NavigationMenu"),[y,I]=m("NavigationMenu",[h,_]);exports.createNavigationMenuScope=I;const[P,T]=y("NavigationMenu"),[L,k]=y("NavigationMenu"),D=/*#__PURE__*/M.forwardRef(((e,t)=>{const{__scopeNavigationMenu:n,value:o,onValueChange:r,defaultValue:a,orientation:i="horizontal",dir:u,...c}=e,[l,v]=M.useState(null),p=d(t,(e=>v(e))),m=s(u);/*#__PURE__*/return M.createElement(F,{scope:n,isRootMenu:!0,value:o,onValueChange:r,defaultValue:a,dir:m,orientation:i,rootNavigationMenu:l},/*#__PURE__*/M.createElement(f.nav,E({"aria-label":"Main","data-orientation":i,dir:m},c,{ref:p})))}));exports.NavigationMenu=D;const V=/*#__PURE__*/M.forwardRef(((e,t)=>{const{__scopeNavigationMenu:n,value:o,onValueChange:r,defaultValue:a,orientation:i="horizontal",...u}=e,s=T("NavigationMenuSub",n);/*#__PURE__*/return M.createElement(F,{scope:n,isRootMenu:!1,value:o,onValueChange:r,defaultValue:a,dir:s.dir,orientation:i,rootNavigationMenu:s.rootNavigationMenu},/*#__PURE__*/M.createElement(f.div,E({"data-orientation":i},u,{ref:t})))}));exports.NavigationMenuSub=V;const F=e=>{const{scope:t,isRootMenu:n,rootNavigationMenu:r,value:a,onValueChange:u,defaultValue:s,dir:c,orientation:l,children:d}=e,[f,p]=M.useState(null),[m,g]=M.useState(new Map),[E,w]=M.useState(null),R=M.useRef(0),[N="",h]=v({prop:a,onChange:u,defaultProp:s});return M.useEffect((()=>()=>window.clearTimeout(R.current)),[R]),/*#__PURE__*/M.createElement(P,{scope:t,isRootMenu:n,rootNavigationMenu:r,value:N,previousValue:o(N),baseId:i(),dir:c,orientation:l,viewport:f,onViewportChange:p,indicatorTrack:E,onIndicatorTrackChange:w,onItemOver:M.useCallback((e=>{n&&window.clearTimeout(R.current),h(e)}),[h,n]),onItemLeave:M.useCallback((()=>{n&&(window.clearTimeout(R.current),R.current=window.setTimeout((()=>h("")),150))}),[h,n]),onItemSelect:M.useCallback((e=>{h((t=>n&&t===e?"":e))}),[h,n]),onItemDismiss:M.useCallback((()=>h("")),[h]),onViewportContentChange:M.useCallback(((e,t)=>{g((n=>(n.set(e,t),new Map(n))))}),[]),onViewportContentRemove:M.useCallback((e=>{g((t=>t.has(e)?(t.delete(e),new Map(t)):t))}),[])},/*#__PURE__*/M.createElement(x.Provider,{scope:t},/*#__PURE__*/M.createElement(L,{scope:t,items:m},d)))},S=/*#__PURE__*/M.forwardRef(((e,t)=>{const{__scopeNavigationMenu:n,...o}=e,r=T("NavigationMenuList",n),a=/*#__PURE__*/M.createElement(f.ul,E({"data-orientation":r.orientation},o,{ref:t}));/*#__PURE__*/return M.createElement(f.div,{style:{position:"relative"},ref:r.onIndicatorTrackChange},/*#__PURE__*/M.createElement(x.Slot,{scope:n},r.isRootMenu?/*#__PURE__*/M.createElement(Y,{asChild:!0},a):a))}));exports.NavigationMenuList=S;const[A,O]=y("NavigationMenuItem"),q=/*#__PURE__*/M.forwardRef(((e,t)=>{const{__scopeNavigationMenu:n,value:o,...r}=e,a=i(),u=o||a||"LEGACY_REACT_AUTO_VALUE",s=M.useRef(null),c=M.useRef(null),l=M.useRef(null),d=M.useRef((()=>{})),v=M.useCallback(((e="start")=>{if(s.current){d.current();const t=Q(s.current);t.length&&Z("start"===e?t:t.reverse())}}),[]),p=M.useCallback((()=>{if(s.current){const e=Q(s.current);e.length&&(d.current=function(e){return e.forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")})),()=>{e.forEach((e=>{const t=e.dataset.tabindex;e.setAttribute("tabindex",t)}))}}(e))}}),[]);/*#__PURE__*/return M.createElement(A,{scope:n,value:u,triggerRef:c,contentRef:s,focusProxyRef:l,onEntryKeyDown:v,onFocusProxyEnter:v,onRootContentClose:p,onContentFocusOutside:p},/*#__PURE__*/M.createElement(f.li,E({},r,{ref:t})))}));exports.NavigationMenuItem=q;const K=/*#__PURE__*/M.forwardRef(((t,n)=>{const{__scopeNavigationMenu:o,disabled:r,...a}=t,i=T("NavigationMenuTrigger",t.__scopeNavigationMenu),u=O("NavigationMenuTrigger",t.__scopeNavigationMenu),s=M.useRef(null),c=d(s,u.triggerRef,n),l=ne(i.baseId,u.value),v=oe(i.baseId,u.value),m=M.useRef(!1),g=u.value===i.value;/*#__PURE__*/return M.createElement(M.Fragment,null,/*#__PURE__*/M.createElement(x.ItemSlot,{scope:o,value:u.value},/*#__PURE__*/M.createElement(J,{asChild:!0},/*#__PURE__*/M.createElement(f.button,E({id:l,disabled:r,"data-disabled":r?"":void 0,"data-state":te(g),"aria-expanded":g,"aria-controls":v},a,{ref:c,onPointerEnter:p(t.onPointerEnter,(()=>{m.current=!1})),onPointerMove:p(t.onPointerMove,re((()=>{r||m.current||i.onItemOver(u.value)}))),onPointerLeave:p(t.onPointerLeave,re((()=>{r||i.onItemLeave()}))),onClick:p(t.onClick,(()=>{i.onItemSelect(u.value),m.current=g})),onKeyDown:p(t.onKeyDown,(e=>{const t={horizontal:"ArrowDown",vertical:"rtl"===i.dir?"ArrowLeft":"ArrowRight"}[i.orientation];g&&e.key===t&&(u.onEntryKeyDown(),e.preventDefault())}))})))),g&&/*#__PURE__*/M.createElement(M.Fragment,null,/*#__PURE__*/M.createElement(e.Root,{"aria-hidden":!0,tabIndex:0,ref:u.focusProxyRef,onFocus:e=>{const t=u.contentRef.current,n=e.relatedTarget,o=n===s.current,r=null==t?void 0:t.contains(n);!o&&r||u.onFocusProxyEnter(o?"start":"end")}}),i.viewport&&/*#__PURE__*/M.createElement("span",{"aria-owns":v})))}));exports.NavigationMenuTrigger=K;const z=/*#__PURE__*/M.forwardRef(((e,t)=>{const{__scopeNavigationMenu:n,active:o,...r}=e;/*#__PURE__*/return M.createElement(J,{asChild:!0},/*#__PURE__*/M.createElement(f.a,E({"data-active":o?"":void 0,"aria-current":o?"page":void 0},r,{ref:t})))}));exports.NavigationMenuLink=z;const $=/*#__PURE__*/M.forwardRef(((e,t)=>{const{forceMount:n,...o}=e,r=T("NavigationMenuIndicator",e.__scopeNavigationMenu),a=Boolean(r.value);return r.indicatorTrack?/*#__PURE__*/g.createPortal(/*#__PURE__*/M.createElement(u,{present:n||a},/*#__PURE__*/M.createElement(H,E({},o,{ref:t}))),r.indicatorTrack):null}));exports.NavigationMenuIndicator=$;const H=/*#__PURE__*/M.forwardRef(((e,t)=>{const{__scopeNavigationMenu:n,...o}=e,r=T("NavigationMenuIndicator",n),a=N(n),[i,u]=M.useState(null),[s,c]=M.useState(null),l="horizontal"===r.orientation,d=Boolean(r.value);M.useEffect((()=>{var e;const t=null===(e=a().find((e=>e.value===r.value)))||void 0===e?void 0:e.ref.current;t&&u(t)}),[a,r.value]);const v=()=>{i&&c({size:l?i.offsetWidth:i.offsetHeight,offset:l?i.offsetLeft:i.offsetTop})};return ee(i,v),ee(r.indicatorTrack,v),s?/*#__PURE__*/M.createElement(f.div,E({"aria-hidden":!0,"data-state":d?"visible":"hidden","data-orientation":r.orientation},o,{ref:t,style:{position:"absolute",...l?{left:0,width:s.size+"px",transform:`translateX(${s.offset}px)`}:{top:0,height:s.size+"px",transform:`translateY(${s.offset}px)`},...o.style}})):null})),U=/*#__PURE__*/M.forwardRef(((e,t)=>{const{forceMount:n,...o}=e,r=T("NavigationMenuContent",e.__scopeNavigationMenu),a=O("NavigationMenuContent",e.__scopeNavigationMenu),i=d(a.contentRef,t),s=a.value===r.value,c={value:a.value,triggerRef:a.triggerRef,focusProxyRef:a.focusProxyRef,onContentFocusOutside:a.onContentFocusOutside,onRootContentClose:a.onRootContentClose,...o};return r.viewport?/*#__PURE__*/M.createElement(B,E({forceMount:n},c,{ref:i})):/*#__PURE__*/M.createElement(u,{present:n||s},/*#__PURE__*/M.createElement(W,E({"data-state":te(s)},c,{ref:i,onPointerEnter:p(e.onPointerEnter,(()=>{r.onItemOver(a.value)})),onPointerLeave:p(e.onPointerLeave,re(r.onItemLeave)),style:{pointerEvents:!s&&r.isRootMenu?"none":void 0,...c.style}})))}));exports.NavigationMenuContent=U;const B=/*#__PURE__*/M.forwardRef(((e,t)=>{const o=T("NavigationMenuContent",e.__scopeNavigationMenu),{onViewportContentChange:r,onViewportContentRemove:a}=o;return n((()=>{r(e.value,{ref:t,...e})}),[e,t,r]),n((()=>()=>a(e.value)),[e.value,a]),null})),W=/*#__PURE__*/M.forwardRef(((e,t)=>{const{__scopeNavigationMenu:n,value:o,triggerRef:a,focusProxyRef:i,onRootContentClose:u,onContentFocusOutside:s,...c}=e,l=T("NavigationMenuContent",n),v=M.useRef(null),f=d(v,t),m=ne(l.baseId,o),g=oe(l.baseId,o),w=N(n),R=M.useRef(null),{onItemDismiss:x}=l;M.useEffect((()=>{const e=v.current;if(l.isRootMenu&&e){const t=()=>{var t;x(),u(),e.contains(document.activeElement)&&(null===(t=a.current)||void 0===t||t.focus())};return e.addEventListener("navigationMenu.contentDismiss",t),()=>e.removeEventListener("navigationMenu.contentDismiss",t)}}),[l.isRootMenu,e.value,a,x,u]);const h=M.useMemo((()=>{const e=w().map((e=>e.value));"rtl"===l.dir&&e.reverse();const t=e.indexOf(l.value),n=e.indexOf(l.previousValue),r=o===l.value,a=n===e.indexOf(o);if(!r&&!a)return R.current;const i=(()=>{if(t!==n){if(r&&-1!==n)return t>n?"from-end":"from-start";if(a&&-1!==t)return t>n?"to-start":"to-end"}return null})();return R.current=i,i}),[l.previousValue,l.value,l.dir,w,o]);/*#__PURE__*/return M.createElement(Y,{asChild:!0},/*#__PURE__*/M.createElement(r,E({id:g,"aria-labelledby":m,"data-motion":h,"data-orientation":l.orientation},c,{ref:f,onDismiss:()=>{var e;const t=new Event("navigationMenu.contentDismiss",{bubbles:!0,cancelable:!0});null===(e=v.current)||void 0===e||e.dispatchEvent(t)},onFocusOutside:p(e.onFocusOutside,(e=>{var t;s();const n=e.target;null!==(t=l.rootNavigationMenu)&&void 0!==t&&t.contains(n)&&e.preventDefault()})),onPointerDownOutside:p(e.onPointerDownOutside,(e=>{var t;const n=e.target,o=w().some((e=>{var t;return null===(t=e.ref.current)||void 0===t?void 0:t.contains(n)})),r=l.isRootMenu&&(null===(t=l.viewport)||void 0===t?void 0:t.contains(n));(o||r||!l.isRootMenu)&&e.preventDefault()})),onKeyDown:p(e.onKeyDown,(e=>{const t=e.altKey||e.ctrlKey||e.metaKey;if("Tab"===e.key&&!t){const t=Q(e.currentTarget),o=document.activeElement,r=t.findIndex((e=>e===o));var n;if(Z(e.shiftKey?t.slice(0,r).reverse():t.slice(r+1,t.length)))e.preventDefault();else null===(n=i.current)||void 0===n||n.focus()}}))})))})),G=/*#__PURE__*/M.forwardRef(((e,t)=>{const{forceMount:n,...o}=e,r=T("NavigationMenuViewport",e.__scopeNavigationMenu),a=Boolean(r.value);/*#__PURE__*/return M.createElement(u,{present:n||a},/*#__PURE__*/M.createElement(j,E({},o,{ref:t})))}));exports.NavigationMenuViewport=G;const j=/*#__PURE__*/M.forwardRef(((e,t)=>{const{__scopeNavigationMenu:n,children:o,...r}=e,a=T("NavigationMenuViewport",n),i=d(t,a.onViewportChange),s=k("NavigationMenuContent",e.__scopeNavigationMenu),[c,v]=M.useState(null),[m,g]=M.useState(null),w=c?(null==c?void 0:c.width)+"px":void 0,R=c?(null==c?void 0:c.height)+"px":void 0,x=Boolean(a.value),N=x?a.value:a.previousValue;return ee(m,(()=>{m&&v({width:m.offsetWidth,height:m.offsetHeight})})),/*#__PURE__*/M.createElement(f.div,E({"data-state":te(x),"data-orientation":a.orientation},r,{ref:i,style:{pointerEvents:!x&&a.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":w,"--radix-navigation-menu-viewport-height":R,...r.style},onPointerEnter:p(e.onPointerEnter,(()=>{a.onItemOver(N)})),onPointerLeave:p(e.onPointerLeave,re(a.onItemLeave))}),Array.from(s.items).map((([e,{ref:t,forceMount:n,...o}])=>{const r=N===e;/*#__PURE__*/return M.createElement(u,{key:e,present:n||r},/*#__PURE__*/M.createElement(W,E({},o,{ref:l(t,(e=>{r&&e&&g(e)}))})))})))})),Y=/*#__PURE__*/M.forwardRef(((e,t)=>{const{__scopeNavigationMenu:n,...o}=e,r=T("FocusGroup",n);/*#__PURE__*/return M.createElement(C.Provider,{scope:n},/*#__PURE__*/M.createElement(C.Slot,{scope:n},/*#__PURE__*/M.createElement(f.div,E({dir:r.dir},o,{ref:t}))))})),X=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],J=/*#__PURE__*/M.forwardRef(((e,t)=>{const{__scopeNavigationMenu:n,...o}=e,r=b(n),a=T("FocusGroupItem",n);/*#__PURE__*/return M.createElement(C.ItemSlot,{scope:n},/*#__PURE__*/M.createElement(f.button,E({},o,{ref:t,onKeyDown:p(e.onKeyDown,(e=>{if(["Home","End",...X].includes(e.key)){let t=r().map((e=>e.ref.current));if(["rtl"===a.dir?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(e.key)&&t.reverse(),X.includes(e.key)){const n=t.indexOf(e.currentTarget);t=t.slice(n+1)}setTimeout((()=>Z(t))),e.preventDefault()}}))})))}));function Q(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Z(e){const t=document.activeElement;return e.some((e=>e===t||(e.focus(),document.activeElement!==t)))}function ee(e,o){const r=t(o);n((()=>{let t=0;if(e){const n=new ResizeObserver((()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(r)}));return n.observe(e),()=>{window.cancelAnimationFrame(t),n.unobserve(e)}}}),[e,r])}function te(e){return e?"open":"closed"}function ne(e,t){return`${e}-trigger-${t}`}function oe(e,t){return`${e}-content-${t}`}function re(e){return t=>"mouse"===t.pointerType?e(t):void 0}const ae=D;exports.Root=ae;const ie=V;exports.Sub=ie;const ue=S;exports.List=ue;const se=q;exports.Item=se;const ce=K;exports.Trigger=ce;const le=z;exports.Link=le;const de=$;exports.Indicator=de;const ve=U;exports.Content=ve;const fe=G;exports.Viewport=fe;
1
+ var $6jHCS$babelruntimehelpersextends = require("@babel/runtime/helpers/extends");
2
+ var $6jHCS$react = require("react");
3
+ var $6jHCS$reactdom = require("react-dom");
4
+ var $6jHCS$radixuireactcontext = require("@radix-ui/react-context");
5
+ var $6jHCS$radixuiprimitive = require("@radix-ui/primitive");
6
+ var $6jHCS$radixuireactprimitive = require("@radix-ui/react-primitive");
7
+ var $6jHCS$radixuireactusecontrollablestate = require("@radix-ui/react-use-controllable-state");
8
+ var $6jHCS$radixuireactcomposerefs = require("@radix-ui/react-compose-refs");
9
+ var $6jHCS$radixuireactdirection = require("@radix-ui/react-direction");
10
+ var $6jHCS$radixuireactpresence = require("@radix-ui/react-presence");
11
+ var $6jHCS$radixuireactid = require("@radix-ui/react-id");
12
+ var $6jHCS$radixuireactcollection = require("@radix-ui/react-collection");
13
+ var $6jHCS$radixuireactdismissablelayer = require("@radix-ui/react-dismissable-layer");
14
+ var $6jHCS$radixuireactuseprevious = require("@radix-ui/react-use-previous");
15
+ var $6jHCS$radixuireactuselayouteffect = require("@radix-ui/react-use-layout-effect");
16
+ var $6jHCS$radixuireactusecallbackref = require("@radix-ui/react-use-callback-ref");
17
+ var $6jHCS$radixuireactvisuallyhidden = require("@radix-ui/react-visually-hidden");
18
+
19
+ function $parcel$exportWildcard(dest, source) {
20
+ Object.keys(source).forEach(function(key) {
21
+ if (key === 'default' || key === '__esModule' || dest.hasOwnProperty(key)) {
22
+ return;
23
+ }
24
+
25
+ Object.defineProperty(dest, key, {
26
+ enumerable: true,
27
+ get: function get() {
28
+ return source[key];
29
+ }
30
+ });
31
+ });
32
+
33
+ return dest;
34
+ }
35
+ function $parcel$interopDefault(a) {
36
+ return a && a.__esModule ? a.default : a;
37
+ }
38
+ function $parcel$export(e, n, v, s) {
39
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
40
+ }
41
+ var $7f73b938b73b5118$exports = {};
42
+
43
+ $parcel$export($7f73b938b73b5118$exports, "createNavigationMenuScope", () => $7f73b938b73b5118$export$fb8ea5af8c9fcdf0);
44
+ $parcel$export($7f73b938b73b5118$exports, "NavigationMenu", () => $7f73b938b73b5118$export$5b2278cf1e8bcae2);
45
+ $parcel$export($7f73b938b73b5118$exports, "NavigationMenuSub", () => $7f73b938b73b5118$export$5958edd6c4ee7c79);
46
+ $parcel$export($7f73b938b73b5118$exports, "NavigationMenuList", () => $7f73b938b73b5118$export$c361068a95fd2286);
47
+ $parcel$export($7f73b938b73b5118$exports, "NavigationMenuItem", () => $7f73b938b73b5118$export$ffdbb83a2de845c2);
48
+ $parcel$export($7f73b938b73b5118$exports, "NavigationMenuTrigger", () => $7f73b938b73b5118$export$37fe8002734d8f2);
49
+ $parcel$export($7f73b938b73b5118$exports, "NavigationMenuLink", () => $7f73b938b73b5118$export$6893bf21536567da);
50
+ $parcel$export($7f73b938b73b5118$exports, "NavigationMenuIndicator", () => $7f73b938b73b5118$export$8ddb526647c0d8fb);
51
+ $parcel$export($7f73b938b73b5118$exports, "NavigationMenuContent", () => $7f73b938b73b5118$export$38e00e996c2f93f7);
52
+ $parcel$export($7f73b938b73b5118$exports, "NavigationMenuViewport", () => $7f73b938b73b5118$export$ee880b97cc6d44a5);
53
+ $parcel$export($7f73b938b73b5118$exports, "Root", () => $7f73b938b73b5118$export$be92b6f5f03c0fe9);
54
+ $parcel$export($7f73b938b73b5118$exports, "Sub", () => $7f73b938b73b5118$export$d7a01e11500dfb6f);
55
+ $parcel$export($7f73b938b73b5118$exports, "List", () => $7f73b938b73b5118$export$54c2e3dc7acea9f5);
56
+ $parcel$export($7f73b938b73b5118$exports, "Item", () => $7f73b938b73b5118$export$6d08773d2e66f8f2);
57
+ $parcel$export($7f73b938b73b5118$exports, "Trigger", () => $7f73b938b73b5118$export$41fb9f06171c75f4);
58
+ $parcel$export($7f73b938b73b5118$exports, "Link", () => $7f73b938b73b5118$export$a6c7ac8248d6e38a);
59
+ $parcel$export($7f73b938b73b5118$exports, "Indicator", () => $7f73b938b73b5118$export$adb584737d712b70);
60
+ $parcel$export($7f73b938b73b5118$exports, "Content", () => $7f73b938b73b5118$export$7c6e2c02157bb7d2);
61
+ $parcel$export($7f73b938b73b5118$exports, "Viewport", () => $7f73b938b73b5118$export$d5c6c08dc2d3ca7);
62
+
63
+
64
+
65
+
66
+
67
+
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+ /* -------------------------------------------------------------------------------------------------
80
+ * NavigationMenu
81
+ * -----------------------------------------------------------------------------------------------*/ const $7f73b938b73b5118$var$NAVIGATION_MENU_NAME = 'NavigationMenu';
82
+ const [$7f73b938b73b5118$var$Collection, $7f73b938b73b5118$var$useCollection, $7f73b938b73b5118$var$createCollectionScope] = $6jHCS$radixuireactcollection.createCollection($7f73b938b73b5118$var$NAVIGATION_MENU_NAME);
83
+ const [$7f73b938b73b5118$var$FocusGroupCollection, $7f73b938b73b5118$var$useFocusGroupCollection, $7f73b938b73b5118$var$createFocusGroupCollectionScope] = $6jHCS$radixuireactcollection.createCollection($7f73b938b73b5118$var$NAVIGATION_MENU_NAME);
84
+ const [$7f73b938b73b5118$var$createNavigationMenuContext, $7f73b938b73b5118$export$fb8ea5af8c9fcdf0] = $6jHCS$radixuireactcontext.createContextScope($7f73b938b73b5118$var$NAVIGATION_MENU_NAME, [
85
+ $7f73b938b73b5118$var$createCollectionScope,
86
+ $7f73b938b73b5118$var$createFocusGroupCollectionScope
87
+ ]);
88
+ const [$7f73b938b73b5118$var$NavigationMenuProviderImpl, $7f73b938b73b5118$var$useNavigationMenuContext] = $7f73b938b73b5118$var$createNavigationMenuContext($7f73b938b73b5118$var$NAVIGATION_MENU_NAME);
89
+ const [$7f73b938b73b5118$var$ViewportContentProvider, $7f73b938b73b5118$var$useViewportContentContext] = $7f73b938b73b5118$var$createNavigationMenuContext($7f73b938b73b5118$var$NAVIGATION_MENU_NAME);
90
+ const $7f73b938b73b5118$export$5b2278cf1e8bcae2 = /*#__PURE__*/ $6jHCS$react.forwardRef((props, forwardedRef)=>{
91
+ const { __scopeNavigationMenu: __scopeNavigationMenu , value: value , onValueChange: onValueChange , defaultValue: defaultValue , orientation: orientation = 'horizontal' , dir: dir , ...NavigationMenuProps } = props;
92
+ const [navigationMenu, setNavigationMenu] = $6jHCS$react.useState(null);
93
+ const composedRef = $6jHCS$radixuireactcomposerefs.useComposedRefs(forwardedRef, (node)=>setNavigationMenu(node)
94
+ );
95
+ const direction = $6jHCS$radixuireactdirection.useDirection(dir);
96
+ return /*#__PURE__*/ $6jHCS$react.createElement($7f73b938b73b5118$var$NavigationMenuProvider, {
97
+ scope: __scopeNavigationMenu,
98
+ isRootMenu: true,
99
+ value: value,
100
+ onValueChange: onValueChange,
101
+ defaultValue: defaultValue,
102
+ dir: direction,
103
+ orientation: orientation,
104
+ rootNavigationMenu: navigationMenu
105
+ }, /*#__PURE__*/ $6jHCS$react.createElement($6jHCS$radixuireactprimitive.Primitive.nav, ($parcel$interopDefault($6jHCS$babelruntimehelpersextends))({
106
+ "aria-label": "Main",
107
+ "data-orientation": orientation,
108
+ dir: direction
109
+ }, NavigationMenuProps, {
110
+ ref: composedRef
111
+ })));
112
+ });
113
+ /*#__PURE__*/ Object.assign($7f73b938b73b5118$export$5b2278cf1e8bcae2, {
114
+ displayName: $7f73b938b73b5118$var$NAVIGATION_MENU_NAME
115
+ });
116
+ /* -------------------------------------------------------------------------------------------------
117
+ * NavigationMenuSub
118
+ * -----------------------------------------------------------------------------------------------*/ const $7f73b938b73b5118$var$SUB_NAME = 'NavigationMenuSub';
119
+ const $7f73b938b73b5118$export$5958edd6c4ee7c79 = /*#__PURE__*/ $6jHCS$react.forwardRef((props, forwardedRef)=>{
120
+ const { __scopeNavigationMenu: __scopeNavigationMenu , value: value , onValueChange: onValueChange , defaultValue: defaultValue , orientation: orientation = 'horizontal' , ...subProps } = props;
121
+ const context = $7f73b938b73b5118$var$useNavigationMenuContext($7f73b938b73b5118$var$SUB_NAME, __scopeNavigationMenu);
122
+ return /*#__PURE__*/ $6jHCS$react.createElement($7f73b938b73b5118$var$NavigationMenuProvider, {
123
+ scope: __scopeNavigationMenu,
124
+ isRootMenu: false,
125
+ value: value,
126
+ onValueChange: onValueChange,
127
+ defaultValue: defaultValue,
128
+ dir: context.dir,
129
+ orientation: orientation,
130
+ rootNavigationMenu: context.rootNavigationMenu
131
+ }, /*#__PURE__*/ $6jHCS$react.createElement($6jHCS$radixuireactprimitive.Primitive.div, ($parcel$interopDefault($6jHCS$babelruntimehelpersextends))({
132
+ "data-orientation": orientation
133
+ }, subProps, {
134
+ ref: forwardedRef
135
+ })));
136
+ });
137
+ /*#__PURE__*/ Object.assign($7f73b938b73b5118$export$5958edd6c4ee7c79, {
138
+ displayName: $7f73b938b73b5118$var$SUB_NAME
139
+ });
140
+ /* -----------------------------------------------------------------------------------------------*/ const $7f73b938b73b5118$var$NavigationMenuProvider = (props)=>{
141
+ const { scope: scope , isRootMenu: isRootMenu , rootNavigationMenu: rootNavigationMenu , value: valueProp , onValueChange: onValueChange , defaultValue: defaultValue , dir: dir , orientation: orientation , children: children } = props;
142
+ const [viewport, setViewport] = $6jHCS$react.useState(null);
143
+ const [viewportContent, setViewportContent] = $6jHCS$react.useState(new Map());
144
+ const [indicatorTrack, setIndicatorTrack] = $6jHCS$react.useState(null);
145
+ const closeTimerRef = $6jHCS$react.useRef(0);
146
+ const [value = '', setValue] = $6jHCS$radixuireactusecontrollablestate.useControllableState({
147
+ prop: valueProp,
148
+ onChange: onValueChange,
149
+ defaultProp: defaultValue
150
+ });
151
+ $6jHCS$react.useEffect(()=>{
152
+ return ()=>window.clearTimeout(closeTimerRef.current)
153
+ ;
154
+ }, [
155
+ closeTimerRef
156
+ ]);
157
+ return /*#__PURE__*/ $6jHCS$react.createElement($7f73b938b73b5118$var$NavigationMenuProviderImpl, {
158
+ scope: scope,
159
+ isRootMenu: isRootMenu,
160
+ rootNavigationMenu: rootNavigationMenu,
161
+ value: value,
162
+ previousValue: $6jHCS$radixuireactuseprevious.usePrevious(value),
163
+ baseId: $6jHCS$radixuireactid.useId(),
164
+ dir: dir,
165
+ orientation: orientation,
166
+ viewport: viewport,
167
+ onViewportChange: setViewport,
168
+ indicatorTrack: indicatorTrack,
169
+ onIndicatorTrackChange: setIndicatorTrack,
170
+ onItemOver: $6jHCS$react.useCallback((itemValue)=>{
171
+ if (isRootMenu) window.clearTimeout(closeTimerRef.current);
172
+ setValue(itemValue);
173
+ }, [
174
+ setValue,
175
+ isRootMenu
176
+ ]),
177
+ onItemLeave: $6jHCS$react.useCallback(()=>{
178
+ if (isRootMenu) {
179
+ window.clearTimeout(closeTimerRef.current);
180
+ closeTimerRef.current = window.setTimeout(()=>setValue('')
181
+ , 150);
182
+ }
183
+ }, [
184
+ setValue,
185
+ isRootMenu
186
+ ]),
187
+ onItemSelect: $6jHCS$react.useCallback((itemValue)=>{
188
+ setValue((prevValue)=>{
189
+ return isRootMenu ? prevValue === itemValue ? '' : itemValue : itemValue;
190
+ });
191
+ }, [
192
+ setValue,
193
+ isRootMenu
194
+ ]),
195
+ onItemDismiss: $6jHCS$react.useCallback(()=>setValue('')
196
+ , [
197
+ setValue
198
+ ]),
199
+ onViewportContentChange: $6jHCS$react.useCallback((contentValue, contentData)=>{
200
+ setViewportContent((prevContent)=>{
201
+ prevContent.set(contentValue, contentData);
202
+ return new Map(prevContent);
203
+ });
204
+ }, []),
205
+ onViewportContentRemove: $6jHCS$react.useCallback((contentValue)=>{
206
+ setViewportContent((prevContent)=>{
207
+ if (!prevContent.has(contentValue)) return prevContent;
208
+ prevContent.delete(contentValue);
209
+ return new Map(prevContent);
210
+ });
211
+ }, [])
212
+ }, /*#__PURE__*/ $6jHCS$react.createElement($7f73b938b73b5118$var$Collection.Provider, {
213
+ scope: scope
214
+ }, /*#__PURE__*/ $6jHCS$react.createElement($7f73b938b73b5118$var$ViewportContentProvider, {
215
+ scope: scope,
216
+ items: viewportContent
217
+ }, children)));
218
+ };
219
+ /* -------------------------------------------------------------------------------------------------
220
+ * NavigationMenuList
221
+ * -----------------------------------------------------------------------------------------------*/ const $7f73b938b73b5118$var$LIST_NAME = 'NavigationMenuList';
222
+ const $7f73b938b73b5118$export$c361068a95fd2286 = /*#__PURE__*/ $6jHCS$react.forwardRef((props, forwardedRef)=>{
223
+ const { __scopeNavigationMenu: __scopeNavigationMenu , ...listProps } = props;
224
+ const context = $7f73b938b73b5118$var$useNavigationMenuContext($7f73b938b73b5118$var$LIST_NAME, __scopeNavigationMenu);
225
+ const list = /*#__PURE__*/ $6jHCS$react.createElement($6jHCS$radixuireactprimitive.Primitive.ul, ($parcel$interopDefault($6jHCS$babelruntimehelpersextends))({
226
+ "data-orientation": context.orientation
227
+ }, listProps, {
228
+ ref: forwardedRef
229
+ }));
230
+ return /*#__PURE__*/ $6jHCS$react.createElement($6jHCS$radixuireactprimitive.Primitive.div, {
231
+ style: {
232
+ position: 'relative'
233
+ },
234
+ ref: context.onIndicatorTrackChange
235
+ }, /*#__PURE__*/ $6jHCS$react.createElement($7f73b938b73b5118$var$Collection.Slot, {
236
+ scope: __scopeNavigationMenu
237
+ }, context.isRootMenu ? /*#__PURE__*/ $6jHCS$react.createElement($7f73b938b73b5118$var$FocusGroup, {
238
+ asChild: true
239
+ }, list) : list));
240
+ });
241
+ /*#__PURE__*/ Object.assign($7f73b938b73b5118$export$c361068a95fd2286, {
242
+ displayName: $7f73b938b73b5118$var$LIST_NAME
243
+ });
244
+ /* -------------------------------------------------------------------------------------------------
245
+ * NavigationMenuItem
246
+ * -----------------------------------------------------------------------------------------------*/ const $7f73b938b73b5118$var$ITEM_NAME = 'NavigationMenuItem';
247
+ const [$7f73b938b73b5118$var$NavigationMenuItemContextProvider, $7f73b938b73b5118$var$useNavigationMenuItemContext] = $7f73b938b73b5118$var$createNavigationMenuContext($7f73b938b73b5118$var$ITEM_NAME);
248
+ const $7f73b938b73b5118$export$ffdbb83a2de845c2 = /*#__PURE__*/ $6jHCS$react.forwardRef((props, forwardedRef)=>{
249
+ const { __scopeNavigationMenu: __scopeNavigationMenu , value: valueProp , ...itemProps } = props;
250
+ const autoValue = $6jHCS$radixuireactid.useId(); // We need to provide an initial deterministic value as `useId` will return
251
+ // empty string on the first render and we don't want to match our internal "closed" value.
252
+ const value = valueProp || autoValue || 'LEGACY_REACT_AUTO_VALUE';
253
+ const contentRef = $6jHCS$react.useRef(null);
254
+ const triggerRef = $6jHCS$react.useRef(null);
255
+ const focusProxyRef = $6jHCS$react.useRef(null);
256
+ const restoreContentTabOrderRef = $6jHCS$react.useRef(()=>{});
257
+ const handleContentEntry = $6jHCS$react.useCallback((side = 'start')=>{
258
+ if (contentRef.current) {
259
+ restoreContentTabOrderRef.current();
260
+ const candidates = $7f73b938b73b5118$var$getTabbableCandidates(contentRef.current);
261
+ if (candidates.length) $7f73b938b73b5118$var$focusFirst(side === 'start' ? candidates : candidates.reverse());
262
+ }
263
+ }, []);
264
+ const handleContentExit = $6jHCS$react.useCallback(()=>{
265
+ if (contentRef.current) {
266
+ const candidates = $7f73b938b73b5118$var$getTabbableCandidates(contentRef.current);
267
+ if (candidates.length) restoreContentTabOrderRef.current = $7f73b938b73b5118$var$removeFromTabOrder(candidates);
268
+ }
269
+ }, []);
270
+ return /*#__PURE__*/ $6jHCS$react.createElement($7f73b938b73b5118$var$NavigationMenuItemContextProvider, {
271
+ scope: __scopeNavigationMenu,
272
+ value: value,
273
+ triggerRef: triggerRef,
274
+ contentRef: contentRef,
275
+ focusProxyRef: focusProxyRef,
276
+ onEntryKeyDown: handleContentEntry,
277
+ onFocusProxyEnter: handleContentEntry,
278
+ onRootContentClose: handleContentExit,
279
+ onContentFocusOutside: handleContentExit
280
+ }, /*#__PURE__*/ $6jHCS$react.createElement($6jHCS$radixuireactprimitive.Primitive.li, ($parcel$interopDefault($6jHCS$babelruntimehelpersextends))({}, itemProps, {
281
+ ref: forwardedRef
282
+ })));
283
+ });
284
+ /*#__PURE__*/ Object.assign($7f73b938b73b5118$export$ffdbb83a2de845c2, {
285
+ displayName: $7f73b938b73b5118$var$ITEM_NAME
286
+ });
287
+ /* -------------------------------------------------------------------------------------------------
288
+ * NavigationMenuTrigger
289
+ * -----------------------------------------------------------------------------------------------*/ const $7f73b938b73b5118$var$TRIGGER_NAME = 'NavigationMenuTrigger';
290
+ const $7f73b938b73b5118$export$37fe8002734d8f2 = /*#__PURE__*/ $6jHCS$react.forwardRef((props, forwardedRef)=>{
291
+ const { __scopeNavigationMenu: __scopeNavigationMenu , disabled: disabled , ...triggerProps } = props;
292
+ const context = $7f73b938b73b5118$var$useNavigationMenuContext($7f73b938b73b5118$var$TRIGGER_NAME, props.__scopeNavigationMenu);
293
+ const itemContext = $7f73b938b73b5118$var$useNavigationMenuItemContext($7f73b938b73b5118$var$TRIGGER_NAME, props.__scopeNavigationMenu);
294
+ const ref = $6jHCS$react.useRef(null);
295
+ const composedRefs = $6jHCS$radixuireactcomposerefs.useComposedRefs(ref, itemContext.triggerRef, forwardedRef);
296
+ const triggerId = $7f73b938b73b5118$var$makeTriggerId(context.baseId, itemContext.value);
297
+ const contentId = $7f73b938b73b5118$var$makeContentId(context.baseId, itemContext.value);
298
+ const wasClickCloseRef = $6jHCS$react.useRef(false);
299
+ const open = itemContext.value === context.value;
300
+ return /*#__PURE__*/ $6jHCS$react.createElement($6jHCS$react.Fragment, null, /*#__PURE__*/ $6jHCS$react.createElement($7f73b938b73b5118$var$Collection.ItemSlot, {
301
+ scope: __scopeNavigationMenu,
302
+ value: itemContext.value
303
+ }, /*#__PURE__*/ $6jHCS$react.createElement($7f73b938b73b5118$var$FocusGroupItem, {
304
+ asChild: true
305
+ }, /*#__PURE__*/ $6jHCS$react.createElement($6jHCS$radixuireactprimitive.Primitive.button, ($parcel$interopDefault($6jHCS$babelruntimehelpersextends))({
306
+ id: triggerId,
307
+ disabled: disabled,
308
+ "data-disabled": disabled ? '' : undefined,
309
+ "data-state": $7f73b938b73b5118$var$getOpenState(open),
310
+ "aria-expanded": open,
311
+ "aria-controls": contentId
312
+ }, triggerProps, {
313
+ ref: composedRefs,
314
+ onPointerEnter: $6jHCS$radixuiprimitive.composeEventHandlers(props.onPointerEnter, ()=>{
315
+ wasClickCloseRef.current = false;
316
+ }),
317
+ onPointerMove: $6jHCS$radixuiprimitive.composeEventHandlers(props.onPointerMove, $7f73b938b73b5118$var$whenMouse(()=>{
318
+ if (disabled || wasClickCloseRef.current) return;
319
+ context.onItemOver(itemContext.value);
320
+ })),
321
+ onPointerLeave: $6jHCS$radixuiprimitive.composeEventHandlers(props.onPointerLeave, $7f73b938b73b5118$var$whenMouse(()=>{
322
+ if (disabled) return;
323
+ context.onItemLeave();
324
+ })),
325
+ onClick: $6jHCS$radixuiprimitive.composeEventHandlers(props.onClick, ()=>{
326
+ context.onItemSelect(itemContext.value);
327
+ wasClickCloseRef.current = open;
328
+ }),
329
+ onKeyDown: $6jHCS$radixuiprimitive.composeEventHandlers(props.onKeyDown, (event)=>{
330
+ const verticalEntryKey = context.dir === 'rtl' ? 'ArrowLeft' : 'ArrowRight';
331
+ const entryKey = {
332
+ horizontal: 'ArrowDown',
333
+ vertical: verticalEntryKey
334
+ }[context.orientation];
335
+ if (open && event.key === entryKey) {
336
+ itemContext.onEntryKeyDown(); // Prevent FocusGroupItem from handling the event
337
+ event.preventDefault();
338
+ }
339
+ })
340
+ })))), open && /*#__PURE__*/ $6jHCS$react.createElement($6jHCS$react.Fragment, null, /*#__PURE__*/ $6jHCS$react.createElement($6jHCS$radixuireactvisuallyhidden.Root, {
341
+ "aria-hidden": true,
342
+ tabIndex: 0,
343
+ ref: itemContext.focusProxyRef,
344
+ onFocus: (event)=>{
345
+ const content = itemContext.contentRef.current;
346
+ const prevFocusedElement = event.relatedTarget;
347
+ const wasTriggerFocused = prevFocusedElement === ref.current;
348
+ const wasFocusFromContent = content === null || content === void 0 ? void 0 : content.contains(prevFocusedElement);
349
+ if (wasTriggerFocused || !wasFocusFromContent) itemContext.onFocusProxyEnter(wasTriggerFocused ? 'start' : 'end');
350
+ }
351
+ }), context.viewport && /*#__PURE__*/ $6jHCS$react.createElement("span", {
352
+ "aria-owns": contentId
353
+ })));
354
+ });
355
+ /*#__PURE__*/ Object.assign($7f73b938b73b5118$export$37fe8002734d8f2, {
356
+ displayName: $7f73b938b73b5118$var$TRIGGER_NAME
357
+ });
358
+ /* -------------------------------------------------------------------------------------------------
359
+ * NavigationMenuLink
360
+ * -----------------------------------------------------------------------------------------------*/ const $7f73b938b73b5118$var$LINK_NAME = 'NavigationMenuLink';
361
+ const $7f73b938b73b5118$export$6893bf21536567da = /*#__PURE__*/ $6jHCS$react.forwardRef((props, forwardedRef)=>{
362
+ const { __scopeNavigationMenu: __scopeNavigationMenu , active: active , ...linkProps } = props;
363
+ return /*#__PURE__*/ $6jHCS$react.createElement($7f73b938b73b5118$var$FocusGroupItem, {
364
+ asChild: true
365
+ }, /*#__PURE__*/ $6jHCS$react.createElement($6jHCS$radixuireactprimitive.Primitive.a, ($parcel$interopDefault($6jHCS$babelruntimehelpersextends))({
366
+ "data-active": active ? '' : undefined,
367
+ "aria-current": active ? 'page' : undefined
368
+ }, linkProps, {
369
+ ref: forwardedRef
370
+ })));
371
+ });
372
+ /*#__PURE__*/ Object.assign($7f73b938b73b5118$export$6893bf21536567da, {
373
+ displayName: $7f73b938b73b5118$var$LINK_NAME
374
+ });
375
+ /* -------------------------------------------------------------------------------------------------
376
+ * NavigationMenuIndicator
377
+ * -----------------------------------------------------------------------------------------------*/ const $7f73b938b73b5118$var$INDICATOR_NAME = 'NavigationMenuIndicator';
378
+ const $7f73b938b73b5118$export$8ddb526647c0d8fb = /*#__PURE__*/ $6jHCS$react.forwardRef((props, forwardedRef)=>{
379
+ const { forceMount: forceMount , ...indicatorProps } = props;
380
+ const context = $7f73b938b73b5118$var$useNavigationMenuContext($7f73b938b73b5118$var$INDICATOR_NAME, props.__scopeNavigationMenu);
381
+ const isVisible = Boolean(context.value);
382
+ return context.indicatorTrack ? /*#__PURE__*/ ($parcel$interopDefault($6jHCS$reactdom)).createPortal(/*#__PURE__*/ $6jHCS$react.createElement($6jHCS$radixuireactpresence.Presence, {
383
+ present: forceMount || isVisible
384
+ }, /*#__PURE__*/ $6jHCS$react.createElement($7f73b938b73b5118$var$NavigationMenuIndicatorImpl, ($parcel$interopDefault($6jHCS$babelruntimehelpersextends))({}, indicatorProps, {
385
+ ref: forwardedRef
386
+ }))), context.indicatorTrack) : null;
387
+ });
388
+ /*#__PURE__*/ Object.assign($7f73b938b73b5118$export$8ddb526647c0d8fb, {
389
+ displayName: $7f73b938b73b5118$var$INDICATOR_NAME
390
+ });
391
+ const $7f73b938b73b5118$var$NavigationMenuIndicatorImpl = /*#__PURE__*/ $6jHCS$react.forwardRef((props, forwardedRef)=>{
392
+ const { __scopeNavigationMenu: __scopeNavigationMenu , ...indicatorProps } = props;
393
+ const context = $7f73b938b73b5118$var$useNavigationMenuContext($7f73b938b73b5118$var$INDICATOR_NAME, __scopeNavigationMenu);
394
+ const getItems = $7f73b938b73b5118$var$useCollection(__scopeNavigationMenu);
395
+ const [activeTrigger, setActiveTrigger] = $6jHCS$react.useState(null);
396
+ const [position, setPosition] = $6jHCS$react.useState(null);
397
+ const isHorizontal = context.orientation === 'horizontal';
398
+ const isVisible = Boolean(context.value);
399
+ $6jHCS$react.useEffect(()=>{
400
+ var _items$find;
401
+ const items = getItems();
402
+ const triggerNode = (_items$find = items.find((item)=>item.value === context.value
403
+ )) === null || _items$find === void 0 ? void 0 : _items$find.ref.current;
404
+ if (triggerNode) setActiveTrigger(triggerNode);
405
+ }, [
406
+ getItems,
407
+ context.value
408
+ ]);
409
+ /**
410
+ * Update position when the indicator or parent track size changes
411
+ */ const handlePositionChange = ()=>{
412
+ if (activeTrigger) setPosition({
413
+ size: isHorizontal ? activeTrigger.offsetWidth : activeTrigger.offsetHeight,
414
+ offset: isHorizontal ? activeTrigger.offsetLeft : activeTrigger.offsetTop
415
+ });
416
+ };
417
+ $7f73b938b73b5118$var$useResizeObserver(activeTrigger, handlePositionChange);
418
+ $7f73b938b73b5118$var$useResizeObserver(context.indicatorTrack, handlePositionChange); // We need to wait for the indicator position to be available before rendering to
419
+ // snap immediately into position rather than transitioning from initial
420
+ return position ? /*#__PURE__*/ $6jHCS$react.createElement($6jHCS$radixuireactprimitive.Primitive.div, ($parcel$interopDefault($6jHCS$babelruntimehelpersextends))({
421
+ "aria-hidden": true,
422
+ "data-state": isVisible ? 'visible' : 'hidden',
423
+ "data-orientation": context.orientation
424
+ }, indicatorProps, {
425
+ ref: forwardedRef,
426
+ style: {
427
+ position: 'absolute',
428
+ ...isHorizontal ? {
429
+ left: 0,
430
+ width: position.size + 'px',
431
+ transform: `translateX(${position.offset}px)`
432
+ } : {
433
+ top: 0,
434
+ height: position.size + 'px',
435
+ transform: `translateY(${position.offset}px)`
436
+ },
437
+ ...indicatorProps.style
438
+ }
439
+ })) : null;
440
+ });
441
+ /* -------------------------------------------------------------------------------------------------
442
+ * NavigationMenuContent
443
+ * -----------------------------------------------------------------------------------------------*/ const $7f73b938b73b5118$var$CONTENT_NAME = 'NavigationMenuContent';
444
+ const $7f73b938b73b5118$export$38e00e996c2f93f7 = /*#__PURE__*/ $6jHCS$react.forwardRef((props, forwardedRef)=>{
445
+ const { forceMount: forceMount , ...contentProps } = props;
446
+ const context = $7f73b938b73b5118$var$useNavigationMenuContext($7f73b938b73b5118$var$CONTENT_NAME, props.__scopeNavigationMenu);
447
+ const itemContext = $7f73b938b73b5118$var$useNavigationMenuItemContext($7f73b938b73b5118$var$CONTENT_NAME, props.__scopeNavigationMenu);
448
+ const composedRefs = $6jHCS$radixuireactcomposerefs.useComposedRefs(itemContext.contentRef, forwardedRef);
449
+ const open = itemContext.value === context.value;
450
+ const commonProps = {
451
+ value: itemContext.value,
452
+ triggerRef: itemContext.triggerRef,
453
+ focusProxyRef: itemContext.focusProxyRef,
454
+ onContentFocusOutside: itemContext.onContentFocusOutside,
455
+ onRootContentClose: itemContext.onRootContentClose,
456
+ ...contentProps
457
+ };
458
+ return !context.viewport ? /*#__PURE__*/ $6jHCS$react.createElement($6jHCS$radixuireactpresence.Presence, {
459
+ present: forceMount || open
460
+ }, /*#__PURE__*/ $6jHCS$react.createElement($7f73b938b73b5118$var$NavigationMenuContentImpl, ($parcel$interopDefault($6jHCS$babelruntimehelpersextends))({
461
+ "data-state": $7f73b938b73b5118$var$getOpenState(open)
462
+ }, commonProps, {
463
+ ref: composedRefs,
464
+ onPointerEnter: $6jHCS$radixuiprimitive.composeEventHandlers(props.onPointerEnter, ()=>{
465
+ context.onItemOver(itemContext.value);
466
+ }),
467
+ onPointerLeave: $6jHCS$radixuiprimitive.composeEventHandlers(props.onPointerLeave, $7f73b938b73b5118$var$whenMouse(context.onItemLeave)),
468
+ style: {
469
+ // Prevent interaction when animating out
470
+ pointerEvents: !open && context.isRootMenu ? 'none' : undefined,
471
+ ...commonProps.style
472
+ }
473
+ }))) : /*#__PURE__*/ $6jHCS$react.createElement($7f73b938b73b5118$var$ViewportContentMounter, ($parcel$interopDefault($6jHCS$babelruntimehelpersextends))({
474
+ forceMount: forceMount
475
+ }, commonProps, {
476
+ ref: composedRefs
477
+ }));
478
+ });
479
+ /*#__PURE__*/ Object.assign($7f73b938b73b5118$export$38e00e996c2f93f7, {
480
+ displayName: $7f73b938b73b5118$var$CONTENT_NAME
481
+ });
482
+ /* -----------------------------------------------------------------------------------------------*/ const $7f73b938b73b5118$var$ViewportContentMounter = /*#__PURE__*/ $6jHCS$react.forwardRef((props, forwardedRef)=>{
483
+ const context = $7f73b938b73b5118$var$useNavigationMenuContext($7f73b938b73b5118$var$CONTENT_NAME, props.__scopeNavigationMenu);
484
+ const { onViewportContentChange: onViewportContentChange , onViewportContentRemove: onViewportContentRemove } = context;
485
+ $6jHCS$radixuireactuselayouteffect.useLayoutEffect(()=>{
486
+ onViewportContentChange(props.value, {
487
+ ref: forwardedRef,
488
+ ...props
489
+ });
490
+ }, [
491
+ props,
492
+ forwardedRef,
493
+ onViewportContentChange
494
+ ]);
495
+ $6jHCS$radixuireactuselayouteffect.useLayoutEffect(()=>{
496
+ return ()=>onViewportContentRemove(props.value)
497
+ ;
498
+ }, [
499
+ props.value,
500
+ onViewportContentRemove
501
+ ]); // Content is proxied into the viewport
502
+ return null;
503
+ });
504
+ /* -----------------------------------------------------------------------------------------------*/ const $7f73b938b73b5118$var$CONTENT_DISMISS = 'navigationMenu.contentDismiss';
505
+ const $7f73b938b73b5118$var$NavigationMenuContentImpl = /*#__PURE__*/ $6jHCS$react.forwardRef((props, forwardedRef)=>{
506
+ const { __scopeNavigationMenu: __scopeNavigationMenu , value: value , triggerRef: triggerRef , focusProxyRef: focusProxyRef , onRootContentClose: onRootContentClose , onContentFocusOutside: onContentFocusOutside , ...contentProps } = props;
507
+ const context = $7f73b938b73b5118$var$useNavigationMenuContext($7f73b938b73b5118$var$CONTENT_NAME, __scopeNavigationMenu);
508
+ const ref = $6jHCS$react.useRef(null);
509
+ const composedRefs = $6jHCS$radixuireactcomposerefs.useComposedRefs(ref, forwardedRef);
510
+ const triggerId = $7f73b938b73b5118$var$makeTriggerId(context.baseId, value);
511
+ const contentId = $7f73b938b73b5118$var$makeContentId(context.baseId, value);
512
+ const getItems = $7f73b938b73b5118$var$useCollection(__scopeNavigationMenu);
513
+ const prevMotionAttributeRef = $6jHCS$react.useRef(null);
514
+ const { onItemDismiss: onItemDismiss } = context;
515
+ $6jHCS$react.useEffect(()=>{
516
+ const content = ref.current; // Bubble dismiss to the root content node and focus its trigger
517
+ if (context.isRootMenu && content) {
518
+ const handleClose = ()=>{
519
+ var _triggerRef$current;
520
+ onItemDismiss();
521
+ onRootContentClose();
522
+ if (content.contains(document.activeElement)) (_triggerRef$current = triggerRef.current) === null || _triggerRef$current === void 0 || _triggerRef$current.focus();
523
+ };
524
+ content.addEventListener($7f73b938b73b5118$var$CONTENT_DISMISS, handleClose);
525
+ return ()=>content.removeEventListener($7f73b938b73b5118$var$CONTENT_DISMISS, handleClose)
526
+ ;
527
+ }
528
+ }, [
529
+ context.isRootMenu,
530
+ props.value,
531
+ triggerRef,
532
+ onItemDismiss,
533
+ onRootContentClose
534
+ ]);
535
+ const motionAttribute = $6jHCS$react.useMemo(()=>{
536
+ const items = getItems();
537
+ const values = items.map((item)=>item.value
538
+ );
539
+ if (context.dir === 'rtl') values.reverse();
540
+ const index = values.indexOf(context.value);
541
+ const prevIndex = values.indexOf(context.previousValue);
542
+ const isSelected = value === context.value;
543
+ const wasSelected = prevIndex === values.indexOf(value); // We only want to update selected and the last selected content
544
+ // this avoids animations being interrupted outside of that range
545
+ if (!isSelected && !wasSelected) return prevMotionAttributeRef.current;
546
+ const attribute = (()=>{
547
+ // Don't provide a direction on the initial open
548
+ if (index !== prevIndex) {
549
+ // If we're moving to this item from another
550
+ if (isSelected && prevIndex !== -1) return index > prevIndex ? 'from-end' : 'from-start'; // If we're leaving this item for another
551
+ if (wasSelected && index !== -1) return index > prevIndex ? 'to-start' : 'to-end';
552
+ } // Otherwise we're entering from closed or leaving the list
553
+ // entirely and should not animate in any direction
554
+ return null;
555
+ })();
556
+ prevMotionAttributeRef.current = attribute;
557
+ return attribute;
558
+ }, [
559
+ context.previousValue,
560
+ context.value,
561
+ context.dir,
562
+ getItems,
563
+ value
564
+ ]);
565
+ return /*#__PURE__*/ $6jHCS$react.createElement($7f73b938b73b5118$var$FocusGroup, {
566
+ asChild: true
567
+ }, /*#__PURE__*/ $6jHCS$react.createElement($6jHCS$radixuireactdismissablelayer.DismissableLayer, ($parcel$interopDefault($6jHCS$babelruntimehelpersextends))({
568
+ id: contentId,
569
+ "aria-labelledby": triggerId,
570
+ "data-motion": motionAttribute,
571
+ "data-orientation": context.orientation
572
+ }, contentProps, {
573
+ ref: composedRefs,
574
+ onDismiss: ()=>{
575
+ var _ref$current;
576
+ const contentDismissEvent = new Event($7f73b938b73b5118$var$CONTENT_DISMISS, {
577
+ bubbles: true,
578
+ cancelable: true
579
+ });
580
+ (_ref$current = ref.current) === null || _ref$current === void 0 || _ref$current.dispatchEvent(contentDismissEvent);
581
+ },
582
+ onFocusOutside: $6jHCS$radixuiprimitive.composeEventHandlers(props.onFocusOutside, (event)=>{
583
+ var _context$rootNavigati;
584
+ onContentFocusOutside();
585
+ const target = event.target; // Only dismiss content when focus moves outside of the menu
586
+ if ((_context$rootNavigati = context.rootNavigationMenu) !== null && _context$rootNavigati !== void 0 && _context$rootNavigati.contains(target)) event.preventDefault();
587
+ }),
588
+ onPointerDownOutside: $6jHCS$radixuiprimitive.composeEventHandlers(props.onPointerDownOutside, (event)=>{
589
+ var _context$viewport;
590
+ const target = event.target;
591
+ const isTrigger = getItems().some((item)=>{
592
+ var _item$ref$current;
593
+ return (_item$ref$current = item.ref.current) === null || _item$ref$current === void 0 ? void 0 : _item$ref$current.contains(target);
594
+ });
595
+ const isRootViewport = context.isRootMenu && ((_context$viewport = context.viewport) === null || _context$viewport === void 0 ? void 0 : _context$viewport.contains(target));
596
+ if (isTrigger || isRootViewport || !context.isRootMenu) event.preventDefault();
597
+ }),
598
+ onKeyDown: $6jHCS$radixuiprimitive.composeEventHandlers(props.onKeyDown, (event)=>{
599
+ const isMetaKey = event.altKey || event.ctrlKey || event.metaKey;
600
+ const isTabKey = event.key === 'Tab' && !isMetaKey;
601
+ if (isTabKey) {
602
+ const candidates = $7f73b938b73b5118$var$getTabbableCandidates(event.currentTarget);
603
+ const focusedElement = document.activeElement;
604
+ const index = candidates.findIndex((candidate)=>candidate === focusedElement
605
+ );
606
+ const isMovingBackwards = event.shiftKey;
607
+ const nextCandidates = isMovingBackwards ? candidates.slice(0, index).reverse() : candidates.slice(index + 1, candidates.length);
608
+ if ($7f73b938b73b5118$var$focusFirst(nextCandidates)) // prevent browser tab keydown because we've handled focus
609
+ event.preventDefault();
610
+ else {
611
+ var _focusProxyRef$curren;
612
+ // If we can't focus that means we're at the edges
613
+ // so focus the proxy and let browser handle
614
+ // tab/shift+tab keypress on the proxy instead
615
+ (_focusProxyRef$curren = focusProxyRef.current) === null || _focusProxyRef$curren === void 0 || _focusProxyRef$curren.focus();
616
+ }
617
+ }
618
+ })
619
+ })));
620
+ });
621
+ /* -------------------------------------------------------------------------------------------------
622
+ * NavigationMenuViewport
623
+ * -----------------------------------------------------------------------------------------------*/ const $7f73b938b73b5118$var$VIEWPORT_NAME = 'NavigationMenuViewport';
624
+ const $7f73b938b73b5118$export$ee880b97cc6d44a5 = /*#__PURE__*/ $6jHCS$react.forwardRef((props, forwardedRef)=>{
625
+ const { forceMount: forceMount , ...viewportProps } = props;
626
+ const context = $7f73b938b73b5118$var$useNavigationMenuContext($7f73b938b73b5118$var$VIEWPORT_NAME, props.__scopeNavigationMenu);
627
+ const open = Boolean(context.value);
628
+ return /*#__PURE__*/ $6jHCS$react.createElement($6jHCS$radixuireactpresence.Presence, {
629
+ present: forceMount || open
630
+ }, /*#__PURE__*/ $6jHCS$react.createElement($7f73b938b73b5118$var$NavigationMenuViewportImpl, ($parcel$interopDefault($6jHCS$babelruntimehelpersextends))({}, viewportProps, {
631
+ ref: forwardedRef
632
+ })));
633
+ });
634
+ /*#__PURE__*/ Object.assign($7f73b938b73b5118$export$ee880b97cc6d44a5, {
635
+ displayName: $7f73b938b73b5118$var$VIEWPORT_NAME
636
+ });
637
+ /* -----------------------------------------------------------------------------------------------*/ const $7f73b938b73b5118$var$NavigationMenuViewportImpl = /*#__PURE__*/ $6jHCS$react.forwardRef((props1, forwardedRef)=>{
638
+ const { __scopeNavigationMenu: __scopeNavigationMenu , children: children , ...viewportImplProps } = props1;
639
+ const context = $7f73b938b73b5118$var$useNavigationMenuContext($7f73b938b73b5118$var$VIEWPORT_NAME, __scopeNavigationMenu);
640
+ const composedRefs = $6jHCS$radixuireactcomposerefs.useComposedRefs(forwardedRef, context.onViewportChange);
641
+ const viewportContentContext = $7f73b938b73b5118$var$useViewportContentContext($7f73b938b73b5118$var$CONTENT_NAME, props1.__scopeNavigationMenu);
642
+ const [size, setSize] = $6jHCS$react.useState(null);
643
+ const [content, setContent] = $6jHCS$react.useState(null);
644
+ const viewportWidth = size ? (size === null || size === void 0 ? void 0 : size.width) + 'px' : undefined;
645
+ const viewportHeight = size ? (size === null || size === void 0 ? void 0 : size.height) + 'px' : undefined;
646
+ const open = Boolean(context.value); // We persist the last active content value as the viewport may be animating out
647
+ // and we want the content to remain mounted for the lifecycle of the viewport.
648
+ const activeContentValue = open ? context.value : context.previousValue;
649
+ /**
650
+ * Update viewport size to match the active content node.
651
+ * We prefer offset dimensions over `getBoundingClientRect` as the latter respects CSS transform.
652
+ * For example, if content animates in from `scale(0.5)` the dimensions would be anything
653
+ * from `0.5` to `1` of the intended size.
654
+ */ const handleSizeChange = ()=>{
655
+ if (content) setSize({
656
+ width: content.offsetWidth,
657
+ height: content.offsetHeight
658
+ });
659
+ };
660
+ $7f73b938b73b5118$var$useResizeObserver(content, handleSizeChange);
661
+ return /*#__PURE__*/ $6jHCS$react.createElement($6jHCS$radixuireactprimitive.Primitive.div, ($parcel$interopDefault($6jHCS$babelruntimehelpersextends))({
662
+ "data-state": $7f73b938b73b5118$var$getOpenState(open),
663
+ "data-orientation": context.orientation
664
+ }, viewportImplProps, {
665
+ ref: composedRefs,
666
+ style: {
667
+ // Prevent interaction when animating out
668
+ pointerEvents: !open && context.isRootMenu ? 'none' : undefined,
669
+ ['--radix-navigation-menu-viewport-width']: viewportWidth,
670
+ ['--radix-navigation-menu-viewport-height']: viewportHeight,
671
+ ...viewportImplProps.style
672
+ },
673
+ onPointerEnter: $6jHCS$radixuiprimitive.composeEventHandlers(props1.onPointerEnter, ()=>{
674
+ context.onItemOver(activeContentValue);
675
+ }),
676
+ onPointerLeave: $6jHCS$radixuiprimitive.composeEventHandlers(props1.onPointerLeave, $7f73b938b73b5118$var$whenMouse(context.onItemLeave))
677
+ }), Array.from(viewportContentContext.items).map(([value, { ref: ref , forceMount: forceMount , ...props }])=>{
678
+ const isActive = activeContentValue === value;
679
+ return /*#__PURE__*/ $6jHCS$react.createElement($6jHCS$radixuireactpresence.Presence, {
680
+ key: value,
681
+ present: forceMount || isActive
682
+ }, /*#__PURE__*/ $6jHCS$react.createElement($7f73b938b73b5118$var$NavigationMenuContentImpl, ($parcel$interopDefault($6jHCS$babelruntimehelpersextends))({}, props, {
683
+ ref: $6jHCS$radixuireactcomposerefs.composeRefs(ref, (node)=>{
684
+ // We only want to update the stored node when another is available
685
+ // as we need to smoothly transition between them.
686
+ if (isActive && node) setContent(node);
687
+ })
688
+ })));
689
+ }));
690
+ });
691
+ /* -----------------------------------------------------------------------------------------------*/ const $7f73b938b73b5118$var$FOCUS_GROUP_NAME = 'FocusGroup';
692
+ const $7f73b938b73b5118$var$FocusGroup = /*#__PURE__*/ $6jHCS$react.forwardRef((props, forwardedRef)=>{
693
+ const { __scopeNavigationMenu: __scopeNavigationMenu , ...groupProps } = props;
694
+ const context = $7f73b938b73b5118$var$useNavigationMenuContext($7f73b938b73b5118$var$FOCUS_GROUP_NAME, __scopeNavigationMenu);
695
+ return /*#__PURE__*/ $6jHCS$react.createElement($7f73b938b73b5118$var$FocusGroupCollection.Provider, {
696
+ scope: __scopeNavigationMenu
697
+ }, /*#__PURE__*/ $6jHCS$react.createElement($7f73b938b73b5118$var$FocusGroupCollection.Slot, {
698
+ scope: __scopeNavigationMenu
699
+ }, /*#__PURE__*/ $6jHCS$react.createElement($6jHCS$radixuireactprimitive.Primitive.div, ($parcel$interopDefault($6jHCS$babelruntimehelpersextends))({
700
+ dir: context.dir
701
+ }, groupProps, {
702
+ ref: forwardedRef
703
+ }))));
704
+ });
705
+ /* -----------------------------------------------------------------------------------------------*/ const $7f73b938b73b5118$var$ARROW_KEYS = [
706
+ 'ArrowRight',
707
+ 'ArrowLeft',
708
+ 'ArrowUp',
709
+ 'ArrowDown'
710
+ ];
711
+ const $7f73b938b73b5118$var$FOCUS_GROUP_ITEM_NAME = 'FocusGroupItem';
712
+ const $7f73b938b73b5118$var$FocusGroupItem = /*#__PURE__*/ $6jHCS$react.forwardRef((props, forwardedRef)=>{
713
+ const { __scopeNavigationMenu: __scopeNavigationMenu , ...groupProps } = props;
714
+ const getItems = $7f73b938b73b5118$var$useFocusGroupCollection(__scopeNavigationMenu);
715
+ const context = $7f73b938b73b5118$var$useNavigationMenuContext($7f73b938b73b5118$var$FOCUS_GROUP_ITEM_NAME, __scopeNavigationMenu);
716
+ return /*#__PURE__*/ $6jHCS$react.createElement($7f73b938b73b5118$var$FocusGroupCollection.ItemSlot, {
717
+ scope: __scopeNavigationMenu
718
+ }, /*#__PURE__*/ $6jHCS$react.createElement($6jHCS$radixuireactprimitive.Primitive.button, ($parcel$interopDefault($6jHCS$babelruntimehelpersextends))({}, groupProps, {
719
+ ref: forwardedRef,
720
+ onKeyDown: $6jHCS$radixuiprimitive.composeEventHandlers(props.onKeyDown, (event)=>{
721
+ const isFocusNavigationKey = [
722
+ 'Home',
723
+ 'End',
724
+ ...$7f73b938b73b5118$var$ARROW_KEYS
725
+ ].includes(event.key);
726
+ if (isFocusNavigationKey) {
727
+ let candidateNodes = getItems().map((item)=>item.ref.current
728
+ );
729
+ const prevItemKey = context.dir === 'rtl' ? 'ArrowRight' : 'ArrowLeft';
730
+ const prevKeys = [
731
+ prevItemKey,
732
+ 'ArrowUp',
733
+ 'End'
734
+ ];
735
+ if (prevKeys.includes(event.key)) candidateNodes.reverse();
736
+ if ($7f73b938b73b5118$var$ARROW_KEYS.includes(event.key)) {
737
+ const currentIndex = candidateNodes.indexOf(event.currentTarget);
738
+ candidateNodes = candidateNodes.slice(currentIndex + 1);
739
+ }
740
+ /**
741
+ * Imperative focus during keydown is risky so we prevent React's batching updates
742
+ * to avoid potential bugs. See: https://github.com/facebook/react/issues/20332
743
+ */ setTimeout(()=>$7f73b938b73b5118$var$focusFirst(candidateNodes)
744
+ ); // Prevent page scroll while navigating
745
+ event.preventDefault();
746
+ }
747
+ })
748
+ })));
749
+ });
750
+ /**
751
+ * Returns a list of potential tabbable candidates.
752
+ *
753
+ * NOTE: This is only a close approximation. For example it doesn't take into account cases like when
754
+ * elements are not visible. This cannot be worked out easily by just reading a property, but rather
755
+ * necessitate runtime knowledge (computed styles, etc). We deal with these cases separately.
756
+ *
757
+ * See: https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker
758
+ * Credit: https://github.com/discord/focus-layers/blob/master/src/util/wrapFocus.tsx#L1
759
+ */ function $7f73b938b73b5118$var$getTabbableCandidates(container) {
760
+ const nodes = [];
761
+ const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
762
+ acceptNode: (node)=>{
763
+ const isHiddenInput = node.tagName === 'INPUT' && node.type === 'hidden';
764
+ if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP; // `.tabIndex` is not the same as the `tabindex` attribute. It works on the
765
+ // runtime's understanding of tabbability, so this automatically accounts
766
+ // for any kind of element that could be tabbed to.
767
+ return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
768
+ }
769
+ });
770
+ while(walker.nextNode())nodes.push(walker.currentNode); // we do not take into account the order of nodes with positive `tabIndex` as it
771
+ // hinders accessibility to have tab order different from visual order.
772
+ return nodes;
773
+ }
774
+ function $7f73b938b73b5118$var$focusFirst(candidates) {
775
+ const previouslyFocusedElement = document.activeElement;
776
+ return candidates.some((candidate)=>{
777
+ // if focus is already where we want to go, we don't want to keep going through the candidates
778
+ if (candidate === previouslyFocusedElement) return true;
779
+ candidate.focus();
780
+ return document.activeElement !== previouslyFocusedElement;
781
+ });
782
+ }
783
+ function $7f73b938b73b5118$var$removeFromTabOrder(candidates) {
784
+ candidates.forEach((candidate)=>{
785
+ candidate.dataset.tabindex = candidate.getAttribute('tabindex') || '';
786
+ candidate.setAttribute('tabindex', '-1');
787
+ });
788
+ return ()=>{
789
+ candidates.forEach((candidate)=>{
790
+ const prevTabIndex = candidate.dataset.tabindex;
791
+ candidate.setAttribute('tabindex', prevTabIndex);
792
+ });
793
+ };
794
+ }
795
+ function $7f73b938b73b5118$var$useResizeObserver(element, onResize) {
796
+ const handleResize = $6jHCS$radixuireactusecallbackref.useCallbackRef(onResize);
797
+ $6jHCS$radixuireactuselayouteffect.useLayoutEffect(()=>{
798
+ let rAF = 0;
799
+ if (element) {
800
+ /**
801
+ * Resize Observer will throw an often benign error that says `ResizeObserver loop
802
+ * completed with undelivered notifications`. This means that ResizeObserver was not
803
+ * able to deliver all observations within a single animation frame, so we use
804
+ * `requestAnimationFrame` to ensure we don't deliver unnecessary observations.
805
+ * Further reading: https://github.com/WICG/resize-observer/issues/38
806
+ */ const resizeObserver = new ResizeObserver(()=>{
807
+ cancelAnimationFrame(rAF);
808
+ rAF = window.requestAnimationFrame(handleResize);
809
+ });
810
+ resizeObserver.observe(element);
811
+ return ()=>{
812
+ window.cancelAnimationFrame(rAF);
813
+ resizeObserver.unobserve(element);
814
+ };
815
+ }
816
+ }, [
817
+ element,
818
+ handleResize
819
+ ]);
820
+ }
821
+ function $7f73b938b73b5118$var$getOpenState(open) {
822
+ return open ? 'open' : 'closed';
823
+ }
824
+ function $7f73b938b73b5118$var$makeTriggerId(baseId, value) {
825
+ return `${baseId}-trigger-${value}`;
826
+ }
827
+ function $7f73b938b73b5118$var$makeContentId(baseId, value) {
828
+ return `${baseId}-content-${value}`;
829
+ }
830
+ function $7f73b938b73b5118$var$whenMouse(handler) {
831
+ return (event)=>event.pointerType === 'mouse' ? handler(event) : undefined
832
+ ;
833
+ }
834
+ /* -----------------------------------------------------------------------------------------------*/ const $7f73b938b73b5118$export$be92b6f5f03c0fe9 = $7f73b938b73b5118$export$5b2278cf1e8bcae2;
835
+ const $7f73b938b73b5118$export$d7a01e11500dfb6f = $7f73b938b73b5118$export$5958edd6c4ee7c79;
836
+ const $7f73b938b73b5118$export$54c2e3dc7acea9f5 = $7f73b938b73b5118$export$c361068a95fd2286;
837
+ const $7f73b938b73b5118$export$6d08773d2e66f8f2 = $7f73b938b73b5118$export$ffdbb83a2de845c2;
838
+ const $7f73b938b73b5118$export$41fb9f06171c75f4 = $7f73b938b73b5118$export$37fe8002734d8f2;
839
+ const $7f73b938b73b5118$export$a6c7ac8248d6e38a = $7f73b938b73b5118$export$6893bf21536567da;
840
+ const $7f73b938b73b5118$export$adb584737d712b70 = $7f73b938b73b5118$export$8ddb526647c0d8fb;
841
+ const $7f73b938b73b5118$export$7c6e2c02157bb7d2 = $7f73b938b73b5118$export$38e00e996c2f93f7;
842
+ const $7f73b938b73b5118$export$d5c6c08dc2d3ca7 = $7f73b938b73b5118$export$ee880b97cc6d44a5;
843
+
844
+
845
+ $parcel$exportWildcard(module.exports, $7f73b938b73b5118$exports);
846
+
847
+
2
848
  //# sourceMappingURL=index.js.map