@reactfast/nav 0.2.17 → 0.2.18

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.
@@ -1,21 +1 @@
1
- (function(be,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("react/jsx-runtime"),require("react"),require("react-dom"),require("next/link")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom","next/link"],d):(be=typeof globalThis<"u"?globalThis:be||self,d(be.ReactFastNav={},be.jsxRuntime,be.React,be.ReactDOM,be.Link))})(this,function(be,d,u,pt,Ae){"use strict";function Fr(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const w=Fr(u),It=Fr(pt),Jl=typeof document<"u"?u.useLayoutEffect:()=>{},De=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},Ge=e=>e&&"window"in e&&e.window===e?e:De(e).defaultView||window;function Rl(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function es(e){return Rl(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let ts=!1;function En(){return ts}function Mr(e,t){if(!En())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let n=t;for(;n!==null;){if(n===e)return!0;n.tagName==="SLOT"&&n.assignedSlot?n=n.assignedSlot.parentNode:es(n)?n=n.host:n=n.parentNode}return!1}const kn=(e=document)=>{var t;if(!En())return e.activeElement;let n=e.activeElement;for(;n&&"shadowRoot"in n&&(!((t=n.shadowRoot)===null||t===void 0)&&t.activeElement);)n=n.shadowRoot.activeElement;return n};function Ir(e){return En()&&e.target.shadowRoot&&e.composedPath?e.composedPath()[0]:e.target}function ns(e){if(rs())e.focus({preventScroll:!0});else{let t=os(e);e.focus(),ls(t)}}let Lt=null;function rs(){if(Lt==null){Lt=!1;try{document.createElement("div").focus({get preventScroll(){return Lt=!0,!0}})}catch{}}return Lt}function os(e){let t=e.parentNode,n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function ls(e){for(let{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}function At(e){var t;if(typeof window>"u"||window.navigator==null)return!1;let n=(t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands;return Array.isArray(n)&&n.some(r=>e.test(r.brand))||e.test(window.navigator.userAgent)}function $n(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function Oe(e){if(process.env.NODE_ENV==="test")return e;let t=null;return()=>(t==null&&(t=e()),t)}const ht=Oe(function(){return $n(/^Mac/i)}),ss=Oe(function(){return $n(/^iPhone/i)}),Lr=Oe(function(){return $n(/^iPad/i)||ht()&&navigator.maxTouchPoints>1}),as=Oe(function(){return ss()||Lr()});Oe(function(){return ht()||as()});const is=Oe(function(){return At(/AppleWebKit/i)&&!us()}),us=Oe(function(){return At(/Chrome/i)}),cs=Oe(function(){return At(/Android/i)}),ds=Oe(function(){return At(/Firefox/i)});function mt(e,t,n=!0){var r,o;let{metaKey:l,ctrlKey:s,altKey:a,shiftKey:i}=t;ds()&&(!((o=window.event)===null||o===void 0||(r=o.type)===null||r===void 0)&&r.startsWith("key"))&&e.target==="_blank"&&(ht()?l=!0:s=!0);let f=is()&&ht()&&!Lr()&&process.env.NODE_ENV!=="test"?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:l,ctrlKey:s,altKey:a,shiftKey:i}):new MouseEvent("click",{metaKey:l,ctrlKey:s,altKey:a,shiftKey:i,detail:1,bubbles:!0,cancelable:!0});mt.isOpening=n,ns(e),e.dispatchEvent(f),mt.isOpening=!1}mt.isOpening=!1;function Ar(){let e=u.useRef(new Map),t=u.useCallback((o,l,s,a)=>{let i=a!=null&&a.once?(...f)=>{e.current.delete(s),s(...f)}:s;e.current.set(s,{type:l,eventTarget:o,fn:i,options:a}),o.addEventListener(l,i,a)},[]),n=u.useCallback((o,l,s,a)=>{var i;let f=((i=e.current.get(s))===null||i===void 0?void 0:i.fn)||s;o.removeEventListener(l,f,a),e.current.delete(s)},[]),r=u.useCallback(()=>{e.current.forEach((o,l)=>{n(o.eventTarget,o.type,l,o.options)})},[n]);return u.useEffect(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function fs(e){return e.pointerType===""&&e.isTrusted?!0:cs()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Dr(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function ps(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function jr(e){let t=u.useRef({isFocused:!1,observer:null});return Jl(()=>{const n=t.current;return()=>{n.observer&&(n.observer.disconnect(),n.observer=null)}},[]),u.useCallback(n=>{if(n.target instanceof HTMLButtonElement||n.target instanceof HTMLInputElement||n.target instanceof HTMLTextAreaElement||n.target instanceof HTMLSelectElement){t.current.isFocused=!0;let r=n.target,o=l=>{if(t.current.isFocused=!1,r.disabled){let s=Dr(l);e==null||e(s)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};r.addEventListener("focusout",o,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&r.disabled){var l;(l=t.current.observer)===null||l===void 0||l.disconnect();let s=r===document.activeElement?null:document.activeElement;r.dispatchEvent(new FocusEvent("blur",{relatedTarget:s})),r.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:s}))}}),t.current.observer.observe(r,{attributes:!0,attributeFilter:["disabled"]})}},[e])}let hs=!1,gt=null,Sn=new Set,vt=new Map,Ke=!1,Nn=!1;const ms={Tab:!0,Escape:!0};function Cn(e,t){for(let n of Sn)n(e,t)}function gs(e){return!(e.metaKey||!ht()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function Dt(e){Ke=!0,!mt.isOpening&&gs(e)&&(gt="keyboard",Cn("keyboard",e))}function ye(e){gt="pointer","pointerType"in e&&e.pointerType,(e.type==="mousedown"||e.type==="pointerdown")&&(Ke=!0,Cn("pointer",e))}function _r(e){!mt.isOpening&&fs(e)&&(Ke=!0,gt="virtual")}function Br(e){e.target===window||e.target===document||hs||!e.isTrusted||(!Ke&&!Nn&&(gt="virtual",Cn("virtual",e)),Ke=!1,Nn=!1)}function Hr(){Ke=!1,Nn=!0}function Pn(e){if(typeof window>"u"||typeof document>"u"||vt.get(Ge(e)))return;const t=Ge(e),n=De(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){Ke=!0,r.apply(this,arguments)},n.addEventListener("keydown",Dt,!0),n.addEventListener("keyup",Dt,!0),n.addEventListener("click",_r,!0),t.addEventListener("focus",Br,!0),t.addEventListener("blur",Hr,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",ye,!0),n.addEventListener("pointermove",ye,!0),n.addEventListener("pointerup",ye,!0)):process.env.NODE_ENV==="test"&&(n.addEventListener("mousedown",ye,!0),n.addEventListener("mousemove",ye,!0),n.addEventListener("mouseup",ye,!0)),t.addEventListener("beforeunload",()=>{Vr(e)},{once:!0}),vt.set(t,{focus:r})}const Vr=(e,t)=>{const n=Ge(e),r=De(e);t&&r.removeEventListener("DOMContentLoaded",t),vt.has(n)&&(n.HTMLElement.prototype.focus=vt.get(n).focus,r.removeEventListener("keydown",Dt,!0),r.removeEventListener("keyup",Dt,!0),r.removeEventListener("click",_r,!0),n.removeEventListener("focus",Br,!0),n.removeEventListener("blur",Hr,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",ye,!0),r.removeEventListener("pointermove",ye,!0),r.removeEventListener("pointerup",ye,!0)):process.env.NODE_ENV==="test"&&(r.removeEventListener("mousedown",ye,!0),r.removeEventListener("mousemove",ye,!0),r.removeEventListener("mouseup",ye,!0)),vt.delete(n))};function vs(e){const t=De(e);let n;return t.readyState!=="loading"?Pn(e):(n=()=>{Pn(e)},t.addEventListener("DOMContentLoaded",n)),()=>Vr(e,n)}typeof document<"u"&&vs();function Wr(){return gt!=="pointer"}const bs=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function ys(e,t,n){let r=De(n==null?void 0:n.target);const o=typeof window<"u"?Ge(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,l=typeof window<"u"?Ge(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,s=typeof window<"u"?Ge(n==null?void 0:n.target).HTMLElement:HTMLElement,a=typeof window<"u"?Ge(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return e=e||r.activeElement instanceof o&&!bs.has(r.activeElement.type)||r.activeElement instanceof l||r.activeElement instanceof s&&r.activeElement.isContentEditable,!(e&&t==="keyboard"&&n instanceof a&&!ms[n.key])}function ws(e,t,n){Pn(),u.useEffect(()=>{let r=(o,l)=>{ys(!!(n!=null&&n.isTextInput),o,l)&&e(Wr())};return Sn.add(r),()=>{Sn.delete(r)}},t)}function xs(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:o}=e;const l=u.useCallback(i=>{if(i.target===i.currentTarget)return r&&r(i),o&&o(!1),!0},[r,o]),s=jr(l),a=u.useCallback(i=>{const f=De(i.target),c=f?kn(f):kn();i.target===i.currentTarget&&c===Ir(i.nativeEvent)&&(n&&n(i),o&&o(!0),s(i))},[o,n,s]);return{focusProps:{onFocus:!t&&(n||o||r)?a:void 0,onBlur:!t&&(r||o)?l:void 0}}}function Es(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=e,l=u.useRef({isFocusWithin:!1}),{addGlobalListener:s,removeAllGlobalListeners:a}=Ar(),i=u.useCallback(g=>{g.currentTarget.contains(g.target)&&l.current.isFocusWithin&&!g.currentTarget.contains(g.relatedTarget)&&(l.current.isFocusWithin=!1,a(),n&&n(g),o&&o(!1))},[n,o,l,a]),f=jr(i),c=u.useCallback(g=>{if(!g.currentTarget.contains(g.target))return;const p=De(g.target),h=kn(p);if(!l.current.isFocusWithin&&h===Ir(g.nativeEvent)){r&&r(g),o&&o(!0),l.current.isFocusWithin=!0,f(g);let m=g.currentTarget;s(p,"focus",v=>{if(l.current.isFocusWithin&&!Mr(m,v.target)){let b=new p.defaultView.FocusEvent("blur",{relatedTarget:v.target});ps(b,m);let y=Dr(b);i(y)}},{capture:!0})}},[r,o,f,s,i]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:c,onBlur:i}}}let jt=!1,_t=0;function Tn(){jt=!0,setTimeout(()=>{jt=!1},50)}function zr(e){e.pointerType==="touch"&&Tn()}function ks(){if(!(typeof document>"u"))return _t===0&&(typeof PointerEvent<"u"?document.addEventListener("pointerup",zr):process.env.NODE_ENV==="test"&&document.addEventListener("touchend",Tn)),_t++,()=>{_t--,!(_t>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",zr):process.env.NODE_ENV==="test"&&document.removeEventListener("touchend",Tn))}}function On(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:o}=e,[l,s]=u.useState(!1),a=u.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;u.useEffect(ks,[]);let{addGlobalListener:i,removeAllGlobalListeners:f}=Ar(),{hoverProps:c,triggerHoverEnd:g}=u.useMemo(()=>{let p=(v,b)=>{if(a.pointerType=b,o||b==="touch"||a.isHovered||!v.currentTarget.contains(v.target))return;a.isHovered=!0;let y=v.currentTarget;a.target=y,i(De(v.target),"pointerover",E=>{a.isHovered&&a.target&&!Mr(a.target,E.target)&&h(E,E.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:y,pointerType:b}),n&&n(!0),s(!0)},h=(v,b)=>{let y=a.target;a.pointerType="",a.target=null,!(b==="touch"||!a.isHovered||!y)&&(a.isHovered=!1,f(),r&&r({type:"hoverend",target:y,pointerType:b}),n&&n(!1),s(!1))},m={};return typeof PointerEvent<"u"?(m.onPointerEnter=v=>{jt&&v.pointerType==="mouse"||p(v,v.pointerType)},m.onPointerLeave=v=>{!o&&v.currentTarget.contains(v.target)&&h(v,v.pointerType)}):process.env.NODE_ENV==="test"&&(m.onTouchStart=()=>{a.ignoreEmulatedMouseEvents=!0},m.onMouseEnter=v=>{!a.ignoreEmulatedMouseEvents&&!jt&&p(v,"mouse"),a.ignoreEmulatedMouseEvents=!1},m.onMouseLeave=v=>{!o&&v.currentTarget.contains(v.target)&&h(v,"mouse")}),{hoverProps:m,triggerHoverEnd:h}},[t,n,r,o,a,i,f]);return u.useEffect(()=>{o&&g({currentTarget:a.target},a.pointerType)},[o]),{hoverProps:c,isHovered:l}}function Fn(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,o=u.useRef({isFocused:!1,isFocusVisible:t||Wr()}),[l,s]=u.useState(!1),[a,i]=u.useState(()=>o.current.isFocused&&o.current.isFocusVisible),f=u.useCallback(()=>i(o.current.isFocused&&o.current.isFocusVisible),[]),c=u.useCallback(h=>{o.current.isFocused=h,s(h),f()},[f]);ws(h=>{o.current.isFocusVisible=h,f()},[],{isTextInput:n});let{focusProps:g}=xs({isDisabled:r,onFocusChange:c}),{focusWithinProps:p}=Es({isDisabled:!r,onFocusWithinChange:c});return{isFocused:l,isFocusVisible:a,focusProps:r?p:g}}var $s=Object.defineProperty,Ss=(e,t,n)=>t in e?$s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mn=(e,t,n)=>(Ss(e,typeof t!="symbol"?t+"":t,n),n);let Ns=class{constructor(){Mn(this,"current",this.detect()),Mn(this,"handoffState","pending"),Mn(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},$e=new Ns;function Fe(e){var t;return $e.isServer?null:e==null?document:(t=e==null?void 0:e.ownerDocument)!=null?t:document}function je(e){var t,n;return $e.isServer?null:e==null?document:(n=(t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))!=null?n:document}function _e(e){var t,n;return(n=(t=je(e))==null?void 0:t.activeElement)!=null?n:null}function Gr(e){return _e(e)===e}function Bt(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function ie(){let e=[],t={addEventListener(n,r,o,l){return n.addEventListener(r,o,l),t.add(()=>n.removeEventListener(r,o,l))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return t.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return Bt(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,o){let l=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:o}),this.add(()=>{Object.assign(n.style,{[r]:l})})},group(n){let r=ie();return n(r),this.add(()=>r.dispose())},add(n){return e.includes(n)||e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let o of e.splice(r,1))o()}},dispose(){for(let n of e.splice(0))n()}};return t}function Ue(){let[e]=u.useState(ie);return u.useEffect(()=>()=>e.dispose(),[e]),e}let q=(e,t)=>{$e.isServer?u.useEffect(e,t):u.useLayoutEffect(e,t)};function Me(e){let t=u.useRef(e);return q(()=>{t.current=e},[e]),t}let C=function(e){let t=Me(e);return u.useCallback((...n)=>t.current(...n),[t])};function Cs(e){let t=e.width/2,n=e.height/2;return{top:e.clientY-n,right:e.clientX+t,bottom:e.clientY+n,left:e.clientX-t}}function Ps(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function In({disabled:e=!1}={}){let t=u.useRef(null),[n,r]=u.useState(!1),o=Ue(),l=C(()=>{t.current=null,r(!1),o.dispose()}),s=C(a=>{if(o.dispose(),t.current===null){t.current=a.currentTarget,r(!0);{let i=Fe(a.currentTarget);o.addEventListener(i,"pointerup",l,!1),o.addEventListener(i,"pointermove",f=>{if(t.current){let c=Cs(f);r(Ps(c,t.current.getBoundingClientRect()))}},!1),o.addEventListener(i,"pointercancel",l,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:s,onPointerUp:l,onClick:l}}}function ne(e){return u.useMemo(()=>e,Object.values(e))}let Ts=u.createContext(void 0);function Kr(){return u.useContext(Ts)}function Ln(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function X(e,t,...n){if(e in t){let o=t[e];return typeof o=="function"?o(...n):o}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(o=>`"${o}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,X),r}var we=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(we||{}),Be=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Be||{});function U(){let e=Fs();return u.useCallback(t=>Os({mergeRefs:e,...t}),[e])}function Os({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:l=!0,name:s,mergeRefs:a}){a=a??Ms;let i=Ur(t,e);if(l)return Ht(i,n,r,s,a);let f=o??0;if(f&2){let{static:c=!1,...g}=i;if(c)return Ht(g,n,r,s,a)}if(f&1){let{unmount:c=!0,...g}=i;return X(c?0:1,{0(){return null},1(){return Ht({...g,hidden:!0,style:{display:"none"}},n,r,s,a)}})}return Ht(i,n,r,s,a)}function Ht(e,t={},n,r,o){let{as:l=n,children:s,refName:a="ref",...i}=An(e,["unmount","static"]),f=e.ref!==void 0?{[a]:e.ref}:{},c=typeof s=="function"?s(t):s;"className"in i&&i.className&&typeof i.className=="function"&&(i.className=i.className(t)),i["aria-labelledby"]&&i["aria-labelledby"]===i.id&&(i["aria-labelledby"]=void 0);let g={};if(t){let p=!1,h=[];for(let[m,v]of Object.entries(t))typeof v=="boolean"&&(p=!0),v===!0&&h.push(m.replace(/([A-Z])/g,b=>`-${b.toLowerCase()}`));if(p){g["data-headlessui-state"]=h.join(" ");for(let m of h)g[`data-${m}`]=""}}if(tt(l)&&(Object.keys(qe(i)).length>0||Object.keys(qe(g)).length>0))if(!u.isValidElement(c)||Array.isArray(c)&&c.length>1||Ls(c)){if(Object.keys(qe(i)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(qe(i)).concat(Object.keys(qe(g))).map(p=>` - ${p}`).join(`
2
- `),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(p=>` - ${p}`).join(`
3
- `)].join(`
4
- `))}else{let p=c.props,h=p==null?void 0:p.className,m=typeof h=="function"?(...y)=>Ln(h(...y),i.className):Ln(h,i.className),v=m?{className:m}:{},b=Ur(c.props,qe(An(i,["ref"])));for(let y in g)y in b&&delete g[y];return u.cloneElement(c,Object.assign({},b,g,f,{ref:o(Is(c),f.ref)},v))}return u.createElement(l,Object.assign({},An(i,["ref"]),!tt(l)&&f,!tt(l)&&g),c)}function Fs(){let e=u.useRef([]),t=u.useCallback(n=>{for(let r of e.current)r!=null&&(typeof r=="function"?r(n):r.current=n)},[]);return(...n)=>{if(!n.every(r=>r==null))return e.current=n,t}}function Ms(...e){return e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}function Ur(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];if(t.disabled||t["aria-disabled"])for(let r in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(r)&&(n[r]=[o=>{var l;return(l=o==null?void 0:o.preventDefault)==null?void 0:l.call(o)}]);for(let r in n)Object.assign(t,{[r](o,...l){let s=n[r];for(let a of s){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;a(o,...l)}}});return t}function Ye(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];for(let r in n)Object.assign(t,{[r](...o){let l=n[r];for(let s of l)s==null||s(...o)}});return t}function V(e){var t;return Object.assign(u.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function qe(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function An(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function Is(e){return u.version.split(".")[0]>="19"?e.props.ref:e.ref}function tt(e){return e===u.Fragment||e===Symbol.for("react.fragment")}function Ls(e){return tt(e.type)}let As="span";var Ze=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(Ze||{});function Ds(e,t){var n;let{features:r=1,...o}=e,l={ref:t,"aria-hidden":(r&2)===2?!0:(n=o["aria-hidden"])!=null?n:void 0,hidden:(r&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return U()({ourProps:l,theirProps:o,slot:{},defaultTag:As,name:"Hidden"})}let nt=V(Ds),js=u.createContext(void 0);function _s(){return u.useContext(js)}function Yr(e){return typeof e!="object"||e===null?!1:"nodeType"in e}function Ie(e){return Yr(e)&&"tagName"in e}function oe(e){return Ie(e)&&"accessKey"in e}function de(e){return Ie(e)&&"tabIndex"in e}function Bs(e){return Ie(e)&&"style"in e}function Hs(e){return oe(e)&&e.nodeName==="IFRAME"}function qr(e){return oe(e)&&e.nodeName==="INPUT"}function Zr(e){return oe(e)&&e.nodeName==="LABEL"}function Vs(e){return oe(e)&&e.nodeName==="FIELDSET"}function Qr(e){return oe(e)&&e.nodeName==="LEGEND"}function Ws(e){return Ie(e)?e.matches('a[href],audio[controls],button,details,embed,iframe,img[usemap],input:not([type="hidden"]),label,select,textarea,video[controls]'):!1}function bt(e){let t=e.parentElement,n=null;for(;t&&!Vs(t);)Qr(t)&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&zs(n)?!1:r}function zs(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(Qr(t))return!1;t=t.previousElementSibling}return!0}let Xr=Symbol();function Dn(e,t=!0){return Object.assign(e,{[Xr]:t})}function Q(...e){let t=u.useRef(e);u.useEffect(()=>{t.current=e},[e]);let n=C(r=>{for(let o of t.current)o!=null&&(typeof o=="function"?o(r):o.current=r)});return e.every(r=>r==null||(r==null?void 0:r[Xr]))?void 0:n}let jn=u.createContext(null);jn.displayName="DescriptionContext";function Jr(){let e=u.useContext(jn);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Jr),t}return e}function Rr(){let[e,t]=u.useState([]);return[e.length>0?e.join(" "):void 0,u.useMemo(()=>function(n){let r=C(l=>(t(s=>[...s,l]),()=>t(s=>{let a=s.slice(),i=a.indexOf(l);return i!==-1&&a.splice(i,1),a}))),o=u.useMemo(()=>({register:r,slot:n.slot,name:n.name,props:n.props,value:n.value}),[r,n.slot,n.name,n.props,n.value]);return u.createElement(jn.Provider,{value:o},n.children)},[t])]}let Gs="p";function Ks(e,t){let n=u.useId(),r=Kr(),{id:o=`headlessui-description-${n}`,...l}=e,s=Jr(),a=Q(t);q(()=>s.register(o),[o,s.register]);let i=ne({...s.slot,disabled:r||!1}),f={ref:a,...s.props,id:o};return U()({ourProps:f,theirProps:l,slot:i,defaultTag:Gs,name:s.name||"Description"})}let Us=V(Ks),Ys=Object.assign(Us,{});var W=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(W||{});let Vt=u.createContext(null);Vt.displayName="LabelContext";function _n(){let e=u.useContext(Vt);if(e===null){let t=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,_n),t}return e}function qs(e){var t,n,r;let o=(n=(t=u.useContext(Vt))==null?void 0:t.value)!=null?n:void 0;return((r=void 0)!=null?r:0)>0?[o,...e].filter(Boolean).join(" "):o}function eo({inherit:e=!1}={}){let t=qs(),[n,r]=u.useState([]),o=e?[t,...n].filter(Boolean):n;return[o.length>0?o.join(" "):void 0,u.useMemo(()=>function(l){let s=C(i=>(r(f=>[...f,i]),()=>r(f=>{let c=f.slice(),g=c.indexOf(i);return g!==-1&&c.splice(g,1),c}))),a=u.useMemo(()=>({register:s,slot:l.slot,name:l.name,props:l.props,value:l.value}),[s,l.slot,l.name,l.props,l.value]);return u.createElement(Vt.Provider,{value:a},l.children)},[r])]}let Zs="label";function Qs(e,t){var n;let r=u.useId(),o=_n(),l=_s(),s=Kr(),{id:a=`headlessui-label-${r}`,htmlFor:i=l??((n=o.props)==null?void 0:n.htmlFor),passive:f=!1,...c}=e,g=Q(t);q(()=>o.register(a),[a,o.register]);let p=C(v=>{let b=v.currentTarget;if(!(v.target!==v.currentTarget&&Ws(v.target))&&(Zr(b)&&v.preventDefault(),o.props&&"onClick"in o.props&&typeof o.props.onClick=="function"&&o.props.onClick(v),Zr(b))){let y=document.getElementById(b.htmlFor);if(y){let E=y.getAttribute("disabled");if(E==="true"||E==="")return;let x=y.getAttribute("aria-disabled");if(x==="true"||x==="")return;(qr(y)&&(y.type==="file"||y.type==="radio"||y.type==="checkbox")||y.role==="radio"||y.role==="checkbox"||y.role==="switch")&&y.click(),y.focus({preventScroll:!0})}}}),h=ne({...o.slot,disabled:s||!1}),m={ref:g,...o.props,id:a,htmlFor:i,onClick:p};return f&&("onClick"in m&&(delete m.htmlFor,delete m.onClick),"onClick"in c&&delete c.onClick),U()({ourProps:m,theirProps:c,slot:h,defaultTag:i?Zs:"div",name:o.name||"Label"})}let Xs=V(Qs);Object.assign(Xs,{});let Js=u.createContext(()=>{});function Wt({value:e,children:t}){return u.createElement(Js.Provider,{value:e},t)}function to(e){if(e===null)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function no(e,t,n=!1){let[r,o]=u.useState(()=>to(t));return q(()=>{if(!t||!e)return;let l=ie();return l.requestAnimationFrame(function s(){l.requestAnimationFrame(s),o(a=>{let i=to(t);return i.width===a.width&&i.height===a.height?a:i})}),()=>{l.dispose()}},[t,e]),n?{width:`${r.width}px`,height:`${r.height}px`}:r}var ro=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(ro||{});function Rs(e){let t=u.useRef(null),n=C(o=>{t.current=o.pointerType,!bt(o.currentTarget)&&o.pointerType==="mouse"&&o.button===ro.Left&&(o.preventDefault(),e(o))}),r=C(o=>{t.current!=="mouse"&&(bt(o.currentTarget)||e(o))});return{onPointerDown:n,onClick:r}}let oo=class extends Map{constructor(t){super(),this.factory=t}get(t){let n=super.get(t);return n===void 0&&(n=this.factory(t),this.set(t,n)),n}};var ea=Object.defineProperty,ta=(e,t,n)=>t in e?ea(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,na=(e,t,n)=>(ta(e,t+"",n),n),lo=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},xe=(e,t,n)=>(lo(e,t,"read from private field"),n?n.call(e):t.get(e)),Bn=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},so=(e,t,n,r)=>(lo(e,t,"write to private field"),t.set(e,n),n),Se,yt,wt;let Hn=class{constructor(t){Bn(this,Se,{}),Bn(this,yt,new oo(()=>new Set)),Bn(this,wt,new Set),na(this,"disposables",ie()),so(this,Se,t),$e.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return xe(this,Se)}subscribe(t,n){if($e.isServer)return()=>{};let r={selector:t,callback:n,current:t(xe(this,Se))};return xe(this,wt).add(r),this.disposables.add(()=>{xe(this,wt).delete(r)})}on(t,n){return $e.isServer?()=>{}:(xe(this,yt).get(t).add(n),this.disposables.add(()=>{xe(this,yt).get(t).delete(n)}))}send(t){let n=this.reduce(xe(this,Se),t);if(n!==xe(this,Se)){so(this,Se,n);for(let r of xe(this,wt)){let o=r.selector(xe(this,Se));ao(r.current,o)||(r.current=o,r.callback(o))}for(let r of xe(this,yt).get(t.type))r(xe(this,Se),t)}}};Se=new WeakMap,yt=new WeakMap,wt=new WeakMap;function ao(e,t){return Object.is(e,t)?!0:typeof e!="object"||e===null||typeof t!="object"||t===null?!1:Array.isArray(e)&&Array.isArray(t)?e.length!==t.length?!1:Vn(e[Symbol.iterator](),t[Symbol.iterator]()):e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size!==t.size?!1:Vn(e.entries(),t.entries()):io(e)&&io(t)?Vn(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()):!1}function Vn(e,t){do{let n=e.next(),r=t.next();if(n.done&&r.done)return!0;if(n.done||r.done||!Object.is(n.value,r.value))return!1}while(!0)}function io(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}function uo(e){let[t,n]=e(),r=ie();return(...o)=>{t(...o),r.dispose(),r.microTask(n)}}var ra=Object.defineProperty,oa=(e,t,n)=>t in e?ra(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,co=(e,t,n)=>(oa(e,typeof t!="symbol"?t+"":t,n),n),fo=(e=>(e[e.Push=0]="Push",e[e.Pop=1]="Pop",e))(fo||{});let la={0(e,t){let n=t.id,r=e.stack,o=e.stack.indexOf(n);if(o!==-1){let l=e.stack.slice();return l.splice(o,1),l.push(n),r=l,{...e,stack:r}}return{...e,stack:[...e.stack,n]}},1(e,t){let n=t.id,r=e.stack.indexOf(n);if(r===-1)return e;let o=e.stack.slice();return o.splice(r,1),{...e,stack:o}}},sa=class Ql extends Hn{constructor(){super(...arguments),co(this,"actions",{push:t=>this.send({type:0,id:t}),pop:t=>this.send({type:1,id:t})}),co(this,"selectors",{isTop:(t,n)=>t.stack[t.stack.length-1]===n,inStack:(t,n)=>t.stack.includes(n)})}static new(){return new Ql({stack:[]})}reduce(t,n){return X(n.type,la,t,n)}};const xt=new oo(()=>sa.new());var Wn={exports:{}},zn={};/**
5
- * @license React
6
- * use-sync-external-store-with-selector.production.js
7
- *
8
- * Copyright (c) Meta Platforms, Inc. and affiliates.
9
- *
10
- * This source code is licensed under the MIT license found in the
11
- * LICENSE file in the root directory of this source tree.
12
- */var po;function aa(){if(po)return zn;po=1;var e=u;function t(i,f){return i===f&&(i!==0||1/i===1/f)||i!==i&&f!==f}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,o=e.useRef,l=e.useEffect,s=e.useMemo,a=e.useDebugValue;return zn.useSyncExternalStoreWithSelector=function(i,f,c,g,p){var h=o(null);if(h.current===null){var m={hasValue:!1,value:null};h.current=m}else m=h.current;h=s(function(){function b($){if(!y){if(y=!0,E=$,$=g($),p!==void 0&&m.hasValue){var P=m.value;if(p(P,$))return x=P}return x=$}if(P=x,n(E,$))return P;var O=g($);return p!==void 0&&p(P,O)?(E=$,P):(E=$,x=O)}var y=!1,E,x,k=c===void 0?null:c;return[function(){return b(f())},k===null?void 0:function(){return b(k())}]},[f,c,g,p]);var v=r(i,h[0],h[1]);return l(function(){m.hasValue=!0,m.value=v},[v]),a(v),v},zn}var Gn={};/**
13
- * @license React
14
- * use-sync-external-store-with-selector.development.js
15
- *
16
- * Copyright (c) Meta Platforms, Inc. and affiliates.
17
- *
18
- * This source code is licensed under the MIT license found in the
19
- * LICENSE file in the root directory of this source tree.
20
- */var ho;function ia(){return ho||(ho=1,process.env.NODE_ENV!=="production"&&function(){function e(i,f){return i===f&&(i!==0||1/i===1/f)||i!==i&&f!==f}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=u,n=typeof Object.is=="function"?Object.is:e,r=t.useSyncExternalStore,o=t.useRef,l=t.useEffect,s=t.useMemo,a=t.useDebugValue;Gn.useSyncExternalStoreWithSelector=function(i,f,c,g,p){var h=o(null);if(h.current===null){var m={hasValue:!1,value:null};h.current=m}else m=h.current;h=s(function(){function b($){if(!y){if(y=!0,E=$,$=g($),p!==void 0&&m.hasValue){var P=m.value;if(p(P,$))return x=P}return x=$}if(P=x,n(E,$))return P;var O=g($);return p!==void 0&&p(P,O)?(E=$,P):(E=$,x=O)}var y=!1,E,x,k=c===void 0?null:c;return[function(){return b(f())},k===null?void 0:function(){return b(k())}]},[f,c,g,p]);var v=r(i,h[0],h[1]);return l(function(){m.hasValue=!0,m.value=v},[v]),a(v),v},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Gn}process.env.NODE_ENV==="production"?Wn.exports=aa():Wn.exports=ia();var ua=Wn.exports;function re(e,t,n=ao){return ua.useSyncExternalStoreWithSelector(C(r=>e.subscribe(ca,r)),C(()=>e.state),C(()=>e.state),C(t),n)}function ca(e){return e}function Et(e,t){let n=u.useId(),r=xt.get(t),[o,l]=re(r,u.useCallback(s=>[r.selectors.isTop(s,n),r.selectors.inStack(s,n)],[r,n]));return q(()=>{if(e)return r.actions.push(n),()=>r.actions.pop(n)},[r,e,n]),e?l?o:!0:!1}let Kn=new Map,kt=new Map;function mo(e){var t;let n=(t=kt.get(e))!=null?t:0;return kt.set(e,n+1),n!==0?()=>go(e):(Kn.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>go(e))}function go(e){var t;let n=(t=kt.get(e))!=null?t:1;if(n===1?kt.delete(e):kt.set(e,n-1),n!==1)return;let r=Kn.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,Kn.delete(e))}function vo(e,{allowed:t,disallowed:n}={}){let r=Et(e,"inert-others");q(()=>{var o,l;if(!r)return;let s=ie();for(let i of(o=n==null?void 0:n())!=null?o:[])i&&s.add(mo(i));let a=(l=t==null?void 0:t())!=null?l:[];for(let i of a){if(!i)continue;let f=Fe(i);if(!f)continue;let c=i.parentElement;for(;c&&c!==f.body;){for(let g of c.children)a.some(p=>g.contains(p))||s.add(mo(g));c=c.parentElement}}return s.dispose},[r,t,n])}function Un(e,t,n){let r=Me(o=>{let l=o.getBoundingClientRect();l.x===0&&l.y===0&&l.width===0&&l.height===0&&n()});u.useEffect(()=>{if(!e)return;let o=t===null?null:oe(t)?t:t.current;if(!o)return;let l=ie();if(typeof ResizeObserver<"u"){let s=new ResizeObserver(()=>r.current(o));s.observe(o),l.add(()=>s.disconnect())}if(typeof IntersectionObserver<"u"){let s=new IntersectionObserver(()=>r.current(o));s.observe(o),l.add(()=>s.disconnect())}return()=>l.dispose()},[t,r,e])}let zt=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","details>summary","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(","),da=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var ee=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e[e.AutoFocus=64]="AutoFocus",e))(ee||{}),rt=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(rt||{}),fa=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(fa||{});function $t(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(zt)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}function pa(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(da)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var Gt=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Gt||{});function Kt(e,t=0){var n;return e===((n=Fe(e))==null?void 0:n.body)?!1:X(t,{0(){return e.matches(zt)},1(){let r=e;for(;r!==null;){if(r.matches(zt))return!0;r=r.parentElement}return!1}})}function bo(e){ie().nextFrame(()=>{let t=_e(e);t&&de(t)&&!Kt(t,0)&&Ne(e)})}var ha=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(ha||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function Ne(e){e==null||e.focus({preventScroll:!0})}let ma=["textarea","input"].join(",");function ga(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,ma))!=null?n:!1}function yo(e,t=n=>n){return e.slice().sort((n,r)=>{let o=t(n),l=t(r);if(o===null||l===null)return 0;let s=o.compareDocumentPosition(l);return s&Node.DOCUMENT_POSITION_FOLLOWING?-1:s&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function va(e,t,n=e===null?document.body:je(e)){return fe($t(n),t,{relativeTo:e})}function fe(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:o=[]}={}){let l=Array.isArray(e)?e.length>0?je(e[0]):document:je(e),s=Array.isArray(e)?n?yo(e):e:t&64?pa(e):$t(e);o.length>0&&s.length>1&&(s=s.filter(h=>!o.some(m=>m!=null&&"current"in m?(m==null?void 0:m.current)===h:m===h))),r=r??(l==null?void 0:l.activeElement);let a=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),i=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,s.indexOf(r))-1;if(t&4)return Math.max(0,s.indexOf(r))+1;if(t&8)return s.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),f=t&32?{preventScroll:!0}:{},c=0,g=s.length,p;do{if(c>=g||c+g<=0)return 0;let h=i+c;if(t&16)h=(h+g)%g;else{if(h<0)return 3;if(h>=g)return 1}p=s[h],p==null||p.focus(f),c+=a}while(p!==_e(p));return t&6&&ga(p)&&p.select(),2}function wo(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function ba(){return/Android/gi.test(window.navigator.userAgent)}function xo(){return wo()||ba()}function ot(e,t,n,r){let o=Me(n);u.useEffect(()=>{if(!e)return;function l(s){o.current(s)}return document.addEventListener(t,l,r),()=>document.removeEventListener(t,l,r)},[e,t,r])}function Eo(e,t,n,r){let o=Me(n);u.useEffect(()=>{if(!e)return;function l(s){o.current(s)}return window.addEventListener(t,l,r),()=>window.removeEventListener(t,l,r)},[e,t,r])}const ko=30;function Yn(e,t,n){let r=Me(n),o=u.useCallback(function(a,i){if(a.defaultPrevented)return;let f=i(a);if(f===null||!f.getRootNode().contains(f)||!f.isConnected)return;let c=function g(p){return typeof p=="function"?g(p()):Array.isArray(p)||p instanceof Set?p:[p]}(t);for(let g of c)if(g!==null&&(g.contains(f)||a.composed&&a.composedPath().includes(g)))return;return!Kt(f,Gt.Loose)&&f.tabIndex!==-1&&a.preventDefault(),r.current(a,f)},[r,t]),l=u.useRef(null);ot(e,"pointerdown",a=>{var i,f;xo()||(l.current=((f=(i=a.composedPath)==null?void 0:i.call(a))==null?void 0:f[0])||a.target)},!0),ot(e,"pointerup",a=>{if(xo()||!l.current)return;let i=l.current;return l.current=null,o(a,()=>i)},!0);let s=u.useRef({x:0,y:0});ot(e,"touchstart",a=>{s.current.x=a.touches[0].clientX,s.current.y=a.touches[0].clientY},!0),ot(e,"touchend",a=>{let i={x:a.changedTouches[0].clientX,y:a.changedTouches[0].clientY};if(!(Math.abs(i.x-s.current.x)>=ko||Math.abs(i.y-s.current.y)>=ko))return o(a,()=>de(a.target)?a.target:null)},!0),Eo(e,"blur",a=>o(a,()=>Hs(window.document.activeElement)?window.document.activeElement:null),!0)}function Qe(...e){return u.useMemo(()=>Fe(...e),[...e])}function ya(...e){return u.useMemo(()=>je(...e),[...e])}var wa=(e=>(e[e.Ignore=0]="Ignore",e[e.Select=1]="Select",e[e.Close=2]="Close",e))(wa||{});const Ut={Ignore:{kind:0},Select:e=>({kind:1,target:e}),Close:{kind:2}},xa=200,$o=5;function Ea(e,{trigger:t,action:n,close:r,select:o}){let l=u.useRef(null),s=u.useRef(null),a=u.useRef(null);ot(e&&t!==null,"pointerdown",i=>{Yr(i==null?void 0:i.target)&&t!=null&&t.contains(i.target)&&(s.current=i.x,a.current=i.y,l.current=i.timeStamp)}),ot(e&&t!==null,"pointerup",i=>{var f,c;let g=l.current;if(g===null||(l.current=null,!de(i.target))||Math.abs(i.x-((f=s.current)!=null?f:i.x))<$o&&Math.abs(i.y-((c=a.current)!=null?c:i.y))<$o)return;let p=n(i);switch(p.kind){case 0:return;case 1:{i.timeStamp-g>xa&&(o(p.target),r());break}case 2:{r();break}}},{capture:!0})}function qn(e,t,n,r){let o=Me(n);u.useEffect(()=>{e=e??window;function l(s){o.current(s)}return e.addEventListener(t,l,r),()=>e.removeEventListener(t,l,r)},[e,t,r])}function Zn(e,t){return u.useMemo(()=>{var n;if(e.type)return e.type;let r=(n=e.as)!=null?n:"button";if(typeof r=="string"&&r.toLowerCase()==="button"||(t==null?void 0:t.tagName)==="BUTTON"&&!t.hasAttribute("type"))return"button"},[e.type,e.as,t])}function ka(e){return u.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function $a(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(o){return r.add(o),()=>r.delete(o)},dispatch(o,...l){let s=t[o].call(n,...l);s&&(n=s,r.forEach(a=>a()))}}}function Sa(){let e;return{before({doc:t}){var n;let r=t.documentElement,o=(n=t.defaultView)!=null?n:window;e=Math.max(0,o.innerWidth-r.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,o=Math.max(0,r.clientWidth-r.offsetWidth),l=Math.max(0,e-o);n.style(r,"paddingRight",`${l}px`)}}}function Na(){return wo()?{before({doc:e,d:t,meta:n}){function r(o){for(let l of n().containers)for(let s of l())if(s.contains(o))return!0;return!1}t.microTask(()=>{var o;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let a=ie();a.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>a.dispose()))}let l=(o=window.scrollY)!=null?o:window.pageYOffset,s=null;t.addEventListener(e,"click",a=>{if(de(a.target))try{let i=a.target.closest("a");if(!i)return;let{hash:f}=new URL(i.href),c=e.querySelector(f);de(c)&&!r(c)&&(s=c)}catch{}},!0),t.group(a=>{t.addEventListener(e,"touchstart",i=>{if(a.dispose(),de(i.target)&&Bs(i.target))if(r(i.target)){let f=i.target;for(;f.parentElement&&r(f.parentElement);)f=f.parentElement;a.style(f,"overscrollBehavior","contain")}else a.style(i.target,"touchAction","none")})}),t.addEventListener(e,"touchmove",a=>{if(de(a.target)){if(qr(a.target))return;if(r(a.target)){let i=a.target;for(;i.parentElement&&i.dataset.headlessuiPortal!==""&&!(i.scrollHeight>i.clientHeight||i.scrollWidth>i.clientWidth);)i=i.parentElement;i.dataset.headlessuiPortal===""&&a.preventDefault()}else a.preventDefault()}},{passive:!1}),t.add(()=>{var a;let i=(a=window.scrollY)!=null?a:window.pageYOffset;l!==i&&window.scrollTo(0,l),s&&s.isConnected&&(s.scrollIntoView({block:"nearest"}),s=null)})})}}:{}}function Ca(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function So(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let Xe=$a(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:ie(),meta:new Set,computedMeta:{}};return r.count++,r.meta.add(t),r.computedMeta=So(r.meta),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t),n.computedMeta=So(n.meta)),this},SCROLL_PREVENT(e){let t={doc:e.doc,d:e.d,meta(){return e.computedMeta}},n=[Na(),Sa(),Ca()];n.forEach(({before:r})=>r==null?void 0:r(t)),n.forEach(({after:r})=>r==null?void 0:r(t))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});Xe.subscribe(()=>{let e=Xe.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let r=t.get(n.doc)==="hidden",o=n.count!==0;(o&&!r||!o&&r)&&Xe.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&Xe.dispatch("TEARDOWN",n)}});function Pa(e,t,n=()=>({containers:[]})){let r=ka(Xe),o=t?r.get(t):void 0,l=o?o.count>0:!1;return q(()=>{if(!(!t||!e))return Xe.dispatch("PUSH",t,n),()=>Xe.dispatch("POP",t,n)},[e,t]),l}function Qn(e,t,n=()=>[document.body]){let r=Et(e,"scroll-lock");Pa(r,t,o=>{var l;return{containers:[...(l=o.containers)!=null?l:[],n]}})}function No(e){return[e.screenX,e.screenY]}function Ta(){let e=u.useRef([-1,-1]);return{wasMoved(t){let n=No(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=No(t)}}}function Oa(e=0){let[t,n]=u.useState(e),r=u.useCallback(i=>n(i),[]),o=u.useCallback(i=>n(f=>f|i),[]),l=u.useCallback(i=>(t&i)===i,[t]),s=u.useCallback(i=>n(f=>f&~i),[]),a=u.useCallback(i=>n(f=>f^i),[]);return{flags:t,setFlag:r,addFlag:o,hasFlag:l,removeFlag:s,toggleFlag:a}}var Co,Po;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((Co=process==null?void 0:process.env)==null?void 0:Co.NODE_ENV)==="test"&&typeof((Po=Element==null?void 0:Element.prototype)==null?void 0:Po.getAnimations)>"u"&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join(`
21
- `)),[]});var Fa=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(Fa||{});function St(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function Nt(e,t,n,r){let[o,l]=u.useState(n),{hasFlag:s,addFlag:a,removeFlag:i}=Oa(e&&o?3:0),f=u.useRef(!1),c=u.useRef(!1),g=Ue();return q(()=>{var p;if(e){if(n&&l(!0),!t){n&&a(3);return}return(p=r==null?void 0:r.start)==null||p.call(r,n),Ma(t,{inFlight:f,prepare(){c.current?c.current=!1:c.current=f.current,f.current=!0,!c.current&&(n?(a(3),i(4)):(a(4),i(2)))},run(){c.current?n?(i(3),a(4)):(i(4),a(3)):n?i(1):a(1)},done(){var h;c.current&&Aa(t)||(f.current=!1,i(7),n||l(!1),(h=r==null?void 0:r.end)==null||h.call(r,n))}})}},[e,n,t,g]),e?[o,{closed:s(1),enter:s(2),leave:s(4),transition:s(2)||s(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function Ma(e,{prepare:t,run:n,done:r,inFlight:o}){let l=ie();return La(e,{prepare:t,inFlight:o}),l.nextFrame(()=>{n(),l.requestAnimationFrame(()=>{l.add(Ia(e,r))})}),l.dispose}function Ia(e,t){var n,r;let o=ie();if(!e)return o.dispose;let l=!1;o.add(()=>{l=!0});let s=(r=(n=e.getAnimations)==null?void 0:n.call(e).filter(a=>a instanceof CSSTransition))!=null?r:[];return s.length===0?(t(),o.dispose):(Promise.allSettled(s.map(a=>a.finished)).then(()=>{l||t()}),o.dispose)}function La(e,{inFlight:t,prepare:n}){if(t!=null&&t.current){n();return}let r=e.style.transition;e.style.transition="none",n(),e.offsetHeight,e.style.transition=r}function Aa(e){var t,n;return((n=(t=e.getAnimations)==null?void 0:t.call(e))!=null?n:[]).some(r=>r instanceof CSSTransition&&r.playState!=="finished")}function Da(e,{container:t,accept:n,walk:r}){let o=u.useRef(n),l=u.useRef(r);u.useEffect(()=>{o.current=n,l.current=r},[n,r]),q(()=>{if(!t||!e)return;let s=Fe(t);if(!s)return;let a=o.current,i=l.current,f=Object.assign(g=>a(g),{acceptNode:a}),c=s.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,f,!1);for(;c.nextNode();)i(c.currentNode)},[t,e,o,l])}function Xn(e,t){let n=u.useRef([]),r=C(e);u.useEffect(()=>{let o=[...n.current];for(let[l,s]of t.entries())if(n.current[l]!==s){let a=r(t,o);return n.current=t,a}},[r,...t])}function Yt(){return typeof window<"u"}function lt(e){return To(e)?(e.nodeName||"").toLowerCase():"#document"}function pe(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ce(e){var t;return(t=(To(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function To(e){return Yt()?e instanceof Node||e instanceof pe(e).Node:!1}function le(e){return Yt()?e instanceof Element||e instanceof pe(e).Element:!1}function Pe(e){return Yt()?e instanceof HTMLElement||e instanceof pe(e).HTMLElement:!1}function Oo(e){return!Yt()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof pe(e).ShadowRoot}const ja=new Set(["inline","contents"]);function Ct(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ee(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!ja.has(o)}const _a=new Set(["table","td","th"]);function Ba(e){return _a.has(lt(e))}const Ha=[":popover-open",":modal"];function qt(e){return Ha.some(t=>{try{return e.matches(t)}catch{return!1}})}const Va=["transform","translate","scale","rotate","perspective"],Wa=["transform","translate","scale","rotate","perspective","filter"],za=["paint","layout","strict","content"];function Jn(e){const t=Rn(),n=le(e)?Ee(e):e;return Va.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Wa.some(r=>(n.willChange||"").includes(r))||za.some(r=>(n.contain||"").includes(r))}function Ga(e){let t=He(e);for(;Pe(t)&&!st(t);){if(Jn(t))return t;if(qt(t))return null;t=He(t)}return null}function Rn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Ka=new Set(["html","body","#document"]);function st(e){return Ka.has(lt(e))}function Ee(e){return pe(e).getComputedStyle(e)}function Zt(e){return le(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function He(e){if(lt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Oo(e)&&e.host||Ce(e);return Oo(t)?t.host:t}function Fo(e){const t=He(e);return st(t)?e.ownerDocument?e.ownerDocument.body:e.body:Pe(t)&&Ct(t)?t:Fo(t)}function Pt(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Fo(e),l=o===((r=e.ownerDocument)==null?void 0:r.body),s=pe(o);if(l){const a=er(s);return t.concat(s,s.visualViewport||[],Ct(o)?o:[],a&&n?Pt(a):[])}return t.concat(o,Pt(o,[],n))}function er(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ua(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}const Je=Math.min,se=Math.max,Tt=Math.round,Qt=Math.floor,Te=e=>({x:e,y:e}),Ya={left:"right",right:"left",bottom:"top",top:"bottom"},qa={start:"end",end:"start"};function Mo(e,t,n){return se(e,Je(t,n))}function at(e,t){return typeof e=="function"?e(t):e}function Ve(e){return e.split("-")[0]}function Ot(e){return e.split("-")[1]}function Io(e){return e==="x"?"y":"x"}function Lo(e){return e==="y"?"height":"width"}const Za=new Set(["top","bottom"]);function Le(e){return Za.has(Ve(e))?"y":"x"}function Ao(e){return Io(Le(e))}function Qa(e,t,n){n===void 0&&(n=!1);const r=Ot(e),o=Ao(e),l=Lo(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(s=Xt(s)),[s,Xt(s)]}function Xa(e){const t=Xt(e);return[tr(e),t,tr(t)]}function tr(e){return e.replace(/start|end/g,t=>qa[t])}const Do=["left","right"],jo=["right","left"],Ja=["top","bottom"],Ra=["bottom","top"];function ei(e,t,n){switch(e){case"top":case"bottom":return n?t?jo:Do:t?Do:jo;case"left":case"right":return t?Ja:Ra;default:return[]}}function ti(e,t,n,r){const o=Ot(e);let l=ei(Ve(e),n==="start",r);return o&&(l=l.map(s=>s+"-"+o),t&&(l=l.concat(l.map(tr)))),l}function Xt(e){return e.replace(/left|right|bottom|top/g,t=>Ya[t])}function ni(e){return{top:0,right:0,bottom:0,left:0,...e}}function ri(e){return typeof e!="number"?ni(e):{top:e,right:e,bottom:e,left:e}}function Jt(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function _o(e,t,n){let{reference:r,floating:o}=e;const l=Le(t),s=Ao(t),a=Lo(s),i=Ve(t),f=l==="y",c=r.x+r.width/2-o.width/2,g=r.y+r.height/2-o.height/2,p=r[a]/2-o[a]/2;let h;switch(i){case"top":h={x:c,y:r.y-o.height};break;case"bottom":h={x:c,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:g};break;case"left":h={x:r.x-o.width,y:g};break;default:h={x:r.x,y:r.y}}switch(Ot(t)){case"start":h[s]-=p*(n&&f?-1:1);break;case"end":h[s]+=p*(n&&f?-1:1);break}return h}const oi=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:l=[],platform:s}=n,a=l.filter(Boolean),i=await(s.isRTL==null?void 0:s.isRTL(t));let f=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:g}=_o(f,r,i),p=r,h={},m=0;for(let v=0;v<a.length;v++){const{name:b,fn:y}=a[v],{x:E,y:x,data:k,reset:$}=await y({x:c,y:g,initialPlacement:r,placement:p,strategy:o,middlewareData:h,rects:f,platform:s,elements:{reference:e,floating:t}});c=E??c,g=x??g,h={...h,[b]:{...h[b],...k}},$&&m<=50&&(m++,typeof $=="object"&&($.placement&&(p=$.placement),$.rects&&(f=$.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):$.rects),{x:c,y:g}=_o(f,p,i)),v=-1)}return{x:c,y:g,placement:p,strategy:o,middlewareData:h}};async function Rt(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:l,rects:s,elements:a,strategy:i}=e,{boundary:f="clippingAncestors",rootBoundary:c="viewport",elementContext:g="floating",altBoundary:p=!1,padding:h=0}=at(t,e),m=ri(h),b=a[p?g==="floating"?"reference":"floating":g],y=Jt(await l.getClippingRect({element:(n=await(l.isElement==null?void 0:l.isElement(b)))==null||n?b:b.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(a.floating)),boundary:f,rootBoundary:c,strategy:i})),E=g==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,x=await(l.getOffsetParent==null?void 0:l.getOffsetParent(a.floating)),k=await(l.isElement==null?void 0:l.isElement(x))?await(l.getScale==null?void 0:l.getScale(x))||{x:1,y:1}:{x:1,y:1},$=Jt(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:E,offsetParent:x,strategy:i}):E);return{top:(y.top-$.top+m.top)/k.y,bottom:($.bottom-y.bottom+m.bottom)/k.y,left:(y.left-$.left+m.left)/k.x,right:($.right-y.right+m.right)/k.x}}const li=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:l,rects:s,initialPlacement:a,platform:i,elements:f}=t,{mainAxis:c=!0,crossAxis:g=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:v=!0,...b}=at(e,t);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const y=Ve(o),E=Le(a),x=Ve(a)===a,k=await(i.isRTL==null?void 0:i.isRTL(f.floating)),$=p||(x||!v?[Xt(a)]:Xa(a)),P=m!=="none";!p&&P&&$.push(...ti(a,v,m,k));const O=[a,...$],D=await Rt(t,b),L=[];let N=((r=l.flip)==null?void 0:r.overflows)||[];if(c&&L.push(D[y]),g){const T=Qa(o,s,k);L.push(D[T[0]],D[T[1]])}if(N=[...N,{placement:o,overflows:L}],!L.every(T=>T<=0)){var F,H;const T=(((F=l.flip)==null?void 0:F.index)||0)+1,z=O[T];if(z&&(!(g==="alignment"?E!==Le(z):!1)||N.every(S=>Le(S.placement)===E?S.overflows[0]>0:!0)))return{data:{index:T,overflows:N},reset:{placement:z}};let _=(H=N.filter(G=>G.overflows[0]<=0).sort((G,S)=>G.overflows[1]-S.overflows[1])[0])==null?void 0:H.placement;if(!_)switch(h){case"bestFit":{var j;const G=(j=N.filter(S=>{if(P){const A=Le(S.placement);return A===E||A==="y"}return!0}).map(S=>[S.placement,S.overflows.filter(A=>A>0).reduce((A,K)=>A+K,0)]).sort((S,A)=>S[1]-A[1])[0])==null?void 0:j[0];G&&(_=G);break}case"initialPlacement":_=a;break}if(o!==_)return{reset:{placement:_}}}return{}}}},si=new Set(["left","top"]);async function ai(e,t){const{placement:n,platform:r,elements:o}=e,l=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Ve(n),a=Ot(n),i=Le(n)==="y",f=si.has(s)?-1:1,c=l&&i?-1:1,g=at(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:m}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return a&&typeof m=="number"&&(h=a==="end"?m*-1:m),i?{x:h*c,y:p*f}:{x:p*f,y:h*c}}const ii=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:l,placement:s,middlewareData:a}=t,i=await ai(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+i.x,y:l+i.y,data:{...i,placement:s}}}}},ui=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:l=!0,crossAxis:s=!1,limiter:a={fn:b=>{let{x:y,y:E}=b;return{x:y,y:E}}},...i}=at(e,t),f={x:n,y:r},c=await Rt(t,i),g=Le(Ve(o)),p=Io(g);let h=f[p],m=f[g];if(l){const b=p==="y"?"top":"left",y=p==="y"?"bottom":"right",E=h+c[b],x=h-c[y];h=Mo(E,h,x)}if(s){const b=g==="y"?"top":"left",y=g==="y"?"bottom":"right",E=m+c[b],x=m-c[y];m=Mo(E,m,x)}const v=a.fn({...t,[p]:h,[g]:m});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[p]:l,[g]:s}}}}}},ci=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:l,platform:s,elements:a}=t,{apply:i=()=>{},...f}=at(e,t),c=await Rt(t,f),g=Ve(o),p=Ot(o),h=Le(o)==="y",{width:m,height:v}=l.floating;let b,y;g==="top"||g==="bottom"?(b=g,y=p===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(y=g,b=p==="end"?"top":"bottom");const E=v-c.top-c.bottom,x=m-c.left-c.right,k=Je(v-c[b],E),$=Je(m-c[y],x),P=!t.middlewareData.shift;let O=k,D=$;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(O=E),P&&!p){const N=se(c.left,0),F=se(c.right,0),H=se(c.top,0),j=se(c.bottom,0);h?D=m-2*(N!==0||F!==0?N+F:se(c.left,c.right)):O=v-2*(H!==0||j!==0?H+j:se(c.top,c.bottom))}await i({...t,availableWidth:D,availableHeight:O});const L=await s.getDimensions(a.floating);return m!==L.width||v!==L.height?{reset:{rects:!0}}:{}}}};function Bo(e){const t=Ee(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Pe(e),l=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Tt(n)!==l||Tt(r)!==s;return a&&(n=l,r=s),{width:n,height:r,$:a}}function nr(e){return le(e)?e:e.contextElement}function it(e){const t=nr(e);if(!Pe(t))return Te(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:l}=Bo(t);let s=(l?Tt(n.width):n.width)/r,a=(l?Tt(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const di=Te(0);function Ho(e){const t=pe(e);return!Rn()||!t.visualViewport?di:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function fi(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==pe(e)?!1:t}function Re(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),l=nr(e);let s=Te(1);t&&(r?le(r)&&(s=it(r)):s=it(e));const a=fi(l,n,r)?Ho(l):Te(0);let i=(o.left+a.x)/s.x,f=(o.top+a.y)/s.y,c=o.width/s.x,g=o.height/s.y;if(l){const p=pe(l),h=r&&le(r)?pe(r):r;let m=p,v=er(m);for(;v&&r&&h!==m;){const b=it(v),y=v.getBoundingClientRect(),E=Ee(v),x=y.left+(v.clientLeft+parseFloat(E.paddingLeft))*b.x,k=y.top+(v.clientTop+parseFloat(E.paddingTop))*b.y;i*=b.x,f*=b.y,c*=b.x,g*=b.y,i+=x,f+=k,m=pe(v),v=er(m)}}return Jt({width:c,height:g,x:i,y:f})}function en(e,t){const n=Zt(e).scrollLeft;return t?t.left+n:Re(Ce(e)).left+n}function Vo(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-en(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function pi(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const l=o==="fixed",s=Ce(r),a=t?qt(t.floating):!1;if(r===s||a&&l)return n;let i={scrollLeft:0,scrollTop:0},f=Te(1);const c=Te(0),g=Pe(r);if((g||!g&&!l)&&((lt(r)!=="body"||Ct(s))&&(i=Zt(r)),Pe(r))){const h=Re(r);f=it(r),c.x=h.x+r.clientLeft,c.y=h.y+r.clientTop}const p=s&&!g&&!l?Vo(s,i):Te(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-i.scrollLeft*f.x+c.x+p.x,y:n.y*f.y-i.scrollTop*f.y+c.y+p.y}}function hi(e){return Array.from(e.getClientRects())}function mi(e){const t=Ce(e),n=Zt(e),r=e.ownerDocument.body,o=se(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),l=se(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+en(e);const a=-n.scrollTop;return Ee(r).direction==="rtl"&&(s+=se(t.clientWidth,r.clientWidth)-o),{width:o,height:l,x:s,y:a}}const Wo=25;function gi(e,t){const n=pe(e),r=Ce(e),o=n.visualViewport;let l=r.clientWidth,s=r.clientHeight,a=0,i=0;if(o){l=o.width,s=o.height;const c=Rn();(!c||c&&t==="fixed")&&(a=o.offsetLeft,i=o.offsetTop)}const f=en(r);if(f<=0){const c=r.ownerDocument,g=c.body,p=getComputedStyle(g),h=c.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,m=Math.abs(r.clientWidth-g.clientWidth-h);m<=Wo&&(l-=m)}else f<=Wo&&(l+=f);return{width:l,height:s,x:a,y:i}}const vi=new Set(["absolute","fixed"]);function bi(e,t){const n=Re(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,l=Pe(e)?it(e):Te(1),s=e.clientWidth*l.x,a=e.clientHeight*l.y,i=o*l.x,f=r*l.y;return{width:s,height:a,x:i,y:f}}function zo(e,t,n){let r;if(t==="viewport")r=gi(e,n);else if(t==="document")r=mi(Ce(e));else if(le(t))r=bi(t,n);else{const o=Ho(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Jt(r)}function Go(e,t){const n=He(e);return n===t||!le(n)||st(n)?!1:Ee(n).position==="fixed"||Go(n,t)}function yi(e,t){const n=t.get(e);if(n)return n;let r=Pt(e,[],!1).filter(a=>le(a)&&lt(a)!=="body"),o=null;const l=Ee(e).position==="fixed";let s=l?He(e):e;for(;le(s)&&!st(s);){const a=Ee(s),i=Jn(s);!i&&a.position==="fixed"&&(o=null),(l?!i&&!o:!i&&a.position==="static"&&!!o&&vi.has(o.position)||Ct(s)&&!i&&Go(e,s))?r=r.filter(c=>c!==s):o=a,s=He(s)}return t.set(e,r),r}function wi(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?qt(t)?[]:yi(t,this._c):[].concat(n),r],a=s[0],i=s.reduce((f,c)=>{const g=zo(t,c,o);return f.top=se(g.top,f.top),f.right=Je(g.right,f.right),f.bottom=Je(g.bottom,f.bottom),f.left=se(g.left,f.left),f},zo(t,a,o));return{width:i.right-i.left,height:i.bottom-i.top,x:i.left,y:i.top}}function xi(e){const{width:t,height:n}=Bo(e);return{width:t,height:n}}function Ei(e,t,n){const r=Pe(t),o=Ce(t),l=n==="fixed",s=Re(e,!0,l,t);let a={scrollLeft:0,scrollTop:0};const i=Te(0);function f(){i.x=en(o)}if(r||!r&&!l)if((lt(t)!=="body"||Ct(o))&&(a=Zt(t)),r){const h=Re(t,!0,l,t);i.x=h.x+t.clientLeft,i.y=h.y+t.clientTop}else o&&f();l&&!r&&o&&f();const c=o&&!r&&!l?Vo(o,a):Te(0),g=s.left+a.scrollLeft-i.x-c.x,p=s.top+a.scrollTop-i.y-c.y;return{x:g,y:p,width:s.width,height:s.height}}function rr(e){return Ee(e).position==="static"}function Ko(e,t){if(!Pe(e)||Ee(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ce(e)===n&&(n=n.ownerDocument.body),n}function Uo(e,t){const n=pe(e);if(qt(e))return n;if(!Pe(e)){let o=He(e);for(;o&&!st(o);){if(le(o)&&!rr(o))return o;o=He(o)}return n}let r=Ko(e,t);for(;r&&Ba(r)&&rr(r);)r=Ko(r,t);return r&&st(r)&&rr(r)&&!Jn(r)?n:r||Ga(e)||n}const ki=async function(e){const t=this.getOffsetParent||Uo,n=this.getDimensions,r=await n(e.floating);return{reference:Ei(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function $i(e){return Ee(e).direction==="rtl"}const Si={convertOffsetParentRelativeRectToViewportRelativeRect:pi,getDocumentElement:Ce,getClippingRect:wi,getOffsetParent:Uo,getElementRects:ki,getClientRects:hi,getDimensions:xi,getScale:it,isElement:le,isRTL:$i};function Yo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ni(e,t){let n=null,r;const o=Ce(e);function l(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,i){a===void 0&&(a=!1),i===void 0&&(i=1),l();const f=e.getBoundingClientRect(),{left:c,top:g,width:p,height:h}=f;if(a||t(),!p||!h)return;const m=Qt(g),v=Qt(o.clientWidth-(c+p)),b=Qt(o.clientHeight-(g+h)),y=Qt(c),x={rootMargin:-m+"px "+-v+"px "+-b+"px "+-y+"px",threshold:se(0,Je(1,i))||1};let k=!0;function $(P){const O=P[0].intersectionRatio;if(O!==i){if(!k)return s();O?s(!1,O):r=setTimeout(()=>{s(!1,1e-7)},1e3)}O===1&&!Yo(f,e.getBoundingClientRect())&&s(),k=!1}try{n=new IntersectionObserver($,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver($,x)}n.observe(e)}return s(!0),l}function Ci(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:l=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:i=!1}=r,f=nr(e),c=o||l?[...f?Pt(f):[],...Pt(t)]:[];c.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),l&&y.addEventListener("resize",n)});const g=f&&a?Ni(f,n):null;let p=-1,h=null;s&&(h=new ResizeObserver(y=>{let[E]=y;E&&E.target===f&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var x;(x=h)==null||x.observe(t)})),n()}),f&&!i&&h.observe(f),h.observe(t));let m,v=i?Re(e):null;i&&b();function b(){const y=Re(e);v&&!Yo(v,y)&&n(),v=y,m=requestAnimationFrame(b)}return n(),()=>{var y;c.forEach(E=>{o&&E.removeEventListener("scroll",n),l&&E.removeEventListener("resize",n)}),g==null||g(),(y=h)==null||y.disconnect(),h=null,i&&cancelAnimationFrame(m)}}const or=Rt,Pi=ii,Ti=ui,Oi=li,Fi=ci,Mi=(e,t,n)=>{const r=new Map,o={platform:Si,...n},l={...o.platform,_c:r};return oi(e,t,{...o,platform:l})};var Ii=typeof document<"u",Li=function(){},tn=Ii?u.useLayoutEffect:Li;function nn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!nn(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const l=o[r];if(!(l==="_owner"&&e.$$typeof)&&!nn(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function qo(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Zo(e,t){const n=qo(e);return Math.round(t*n)/n}function lr(e){const t=w.useRef(e);return tn(()=>{t.current=e}),t}function Ai(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:l,floating:s}={},transform:a=!0,whileElementsMounted:i,open:f}=e,[c,g]=w.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=w.useState(r);nn(p,r)||h(r);const[m,v]=w.useState(null),[b,y]=w.useState(null),E=w.useCallback(S=>{S!==P.current&&(P.current=S,v(S))},[]),x=w.useCallback(S=>{S!==O.current&&(O.current=S,y(S))},[]),k=l||m,$=s||b,P=w.useRef(null),O=w.useRef(null),D=w.useRef(c),L=i!=null,N=lr(i),F=lr(o),H=lr(f),j=w.useCallback(()=>{if(!P.current||!O.current)return;const S={placement:t,strategy:n,middleware:p};F.current&&(S.platform=F.current),Mi(P.current,O.current,S).then(A=>{const K={...A,isPositioned:H.current!==!1};T.current&&!nn(D.current,K)&&(D.current=K,It.flushSync(()=>{g(K)}))})},[p,t,n,F,H]);tn(()=>{f===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,g(S=>({...S,isPositioned:!1})))},[f]);const T=w.useRef(!1);tn(()=>(T.current=!0,()=>{T.current=!1}),[]),tn(()=>{if(k&&(P.current=k),$&&(O.current=$),k&&$){if(N.current)return N.current(k,$,j);j()}},[k,$,j,N,L]);const z=w.useMemo(()=>({reference:P,floating:O,setReference:E,setFloating:x}),[E,x]),_=w.useMemo(()=>({reference:k,floating:$}),[k,$]),G=w.useMemo(()=>{const S={position:n,left:0,top:0};if(!_.floating)return S;const A=Zo(_.floating,c.x),K=Zo(_.floating,c.y);return a?{...S,transform:"translate("+A+"px, "+K+"px)",...qo(_.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:A,top:K}},[n,a,_.floating,c.x,c.y]);return w.useMemo(()=>({...c,update:j,refs:z,elements:_,floatingStyles:G}),[c,j,z,_,G])}const Qo=(e,t)=>({...Pi(e),options:[e,t]}),Di=(e,t)=>({...Ti(e),options:[e,t]}),ji=(e,t)=>({...Oi(e),options:[e,t]}),_i=(e,t)=>({...Fi(e),options:[e,t]}),Xo={...w},Bi=Xo.useInsertionEffect||(e=>e());function Jo(e){const t=w.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Bi(()=>{t.current=e}),w.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}var sr=typeof document<"u"?u.useLayoutEffect:u.useEffect;let Ro=!1,Hi=0;const el=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Hi++;function Vi(){const[e,t]=w.useState(()=>Ro?el():void 0);return sr(()=>{e==null&&t(el())},[]),w.useEffect(()=>{Ro=!0},[]),e}const Wi=Xo.useId||Vi;let Ft;process.env.NODE_ENV!=="production"&&(Ft=new Set);function zi(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=Ft)!=null&&e.has(o))){var l;(l=Ft)==null||l.add(o),console.warn(o)}}function Gi(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=Ft)!=null&&e.has(o))){var l;(l=Ft)==null||l.add(o),console.error(o)}}function Ki(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(o=>o!==n))||[])}}}const Ui=w.createContext(null),Yi=w.createContext(null),qi=()=>{var e;return((e=w.useContext(Ui))==null?void 0:e.id)||null},Zi=()=>w.useContext(Yi),Qi="data-floating-ui-focusable";function Xi(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=Wi(),l=w.useRef({}),[s]=w.useState(()=>Ki()),a=qi()!=null;if(process.env.NODE_ENV!=="production"){const h=r.reference;h&&!le(h)&&Gi("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[i,f]=w.useState(r.reference),c=Jo((h,m,v)=>{l.current.openEvent=h?m:void 0,s.emit("openchange",{open:h,event:m,reason:v,nested:a}),n==null||n(h,m,v)}),g=w.useMemo(()=>({setPositionReference:f}),[]),p=w.useMemo(()=>({reference:i||r.reference||null,floating:r.floating||null,domReference:r.reference}),[i,r.reference,r.floating]);return w.useMemo(()=>({dataRef:l,open:t,onOpenChange:c,elements:p,events:s,floatingId:o,refs:g}),[t,c,p,s,o,g])}function Ji(e){e===void 0&&(e={});const{nodeId:t}=e,n=Xi({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[l,s]=w.useState(null),[a,i]=w.useState(null),c=(o==null?void 0:o.domReference)||l,g=w.useRef(null),p=Zi();sr(()=>{c&&(g.current=c)},[c]);const h=Ai({...e,elements:{...o,...a&&{reference:a}}}),m=w.useCallback(x=>{const k=le(x)?{getBoundingClientRect:()=>x.getBoundingClientRect(),contextElement:x}:x;i(k),h.refs.setReference(k)},[h.refs]),v=w.useCallback(x=>{(le(x)||x===null)&&(g.current=x,s(x)),(le(h.refs.reference.current)||h.refs.reference.current===null||x!==null&&!le(x))&&h.refs.setReference(x)},[h.refs]),b=w.useMemo(()=>({...h.refs,setReference:v,setPositionReference:m,domReference:g}),[h.refs,v,m]),y=w.useMemo(()=>({...h.elements,domReference:c}),[h.elements,c]),E=w.useMemo(()=>({...h,...r,refs:b,elements:y,nodeId:t}),[h,b,y,t,r]);return sr(()=>{r.dataRef.current.floatingContext=E;const x=p==null?void 0:p.nodesRef.current.find(k=>k.id===t);x&&(x.context=E)}),w.useMemo(()=>({...h,context:E,refs:b,elements:y}),[h,b,y,E])}const tl="active",nl="selected";function ar(e,t,n){const r=new Map,o=n==="item";let l=e;if(o&&e){const{[tl]:s,[nl]:a,...i}=e;l=i}return{...n==="floating"&&{tabIndex:-1,[Qi]:""},...l,...t.map(s=>{const a=s?s[n]:null;return typeof a=="function"?e?a(e):null:a}).concat(e).reduce((s,a)=>(a&&Object.entries(a).forEach(i=>{let[f,c]=i;if(!(o&&[tl,nl].includes(f)))if(f.indexOf("on")===0){if(r.has(f)||r.set(f,[]),typeof c=="function"){var g;(g=r.get(f))==null||g.push(c),s[f]=function(){for(var p,h=arguments.length,m=new Array(h),v=0;v<h;v++)m[v]=arguments[v];return(p=r.get(f))==null?void 0:p.map(b=>b(...m)).find(b=>b!==void 0)}}}else s[f]=c}),s),{})}}function Ri(e){e===void 0&&(e=[]);const t=e.map(a=>a==null?void 0:a.reference),n=e.map(a=>a==null?void 0:a.floating),r=e.map(a=>a==null?void 0:a.item),o=w.useCallback(a=>ar(a,e,"reference"),t),l=w.useCallback(a=>ar(a,e,"floating"),n),s=w.useCallback(a=>ar(a,e,"item"),r);return w.useMemo(()=>({getReferenceProps:o,getFloatingProps:l,getItemProps:s}),[o,l,s])}function rl(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const eu=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:r,onFallbackChange:o,offset:l=0,index:s=0,minItemsVisible:a=4,referenceOverflowThreshold:i=0,scrollRef:f,...c}=at(e,t),{rects:g,elements:{floating:p}}=t,h=n.current[s],m=(f==null?void 0:f.current)||p,v=p.clientTop||m.clientTop,b=p.clientTop!==0,y=m.clientTop!==0,E=p===m;if(process.env.NODE_ENV!=="production"&&(t.placement.startsWith("bottom")||zi('`placement` side must be "bottom" when using the `inner`',"middleware.")),!h)return{};const x={...t,...await Qo(-h.offsetTop-p.clientTop-g.reference.height/2-h.offsetHeight/2-l).fn(t)},k=await or(rl(x,m.scrollHeight+v+p.clientTop),c),$=await or(x,{...c,elementContext:"reference"}),P=se(0,k.top),O=x.y+P,N=(m.scrollHeight>m.clientHeight?F=>F:Tt)(se(0,m.scrollHeight+(b&&E||y?v*2:0)-P-se(0,k.bottom)));if(m.style.maxHeight=N+"px",m.scrollTop=P,o){const F=m.offsetHeight<h.offsetHeight*Je(a,n.current.length)-1||$.top>=-i||$.bottom>=-i;It.flushSync(()=>o(F))}return r&&(r.current=await or(rl({...x,y:O},m.offsetHeight+v+p.clientTop),c)),{y:O}}});function tu(e,t){const{open:n,elements:r}=e,{enabled:o=!0,overflowRef:l,scrollRef:s,onChange:a}=t,i=Jo(a),f=w.useRef(!1),c=w.useRef(null),g=w.useRef(null);w.useEffect(()=>{if(!o)return;function h(v){if(v.ctrlKey||!m||l.current==null)return;const b=v.deltaY,y=l.current.top>=-.5,E=l.current.bottom>=-.5,x=m.scrollHeight-m.clientHeight,k=b<0?-1:1,$=b<0?"max":"min";m.scrollHeight<=m.clientHeight||(!y&&b>0||!E&&b<0?(v.preventDefault(),It.flushSync(()=>{i(P=>P+Math[$](b,x*k))})):/firefox/i.test(Ua())&&(m.scrollTop+=b))}const m=(s==null?void 0:s.current)||r.floating;if(n&&m)return m.addEventListener("wheel",h),requestAnimationFrame(()=>{c.current=m.scrollTop,l.current!=null&&(g.current={...l.current})}),()=>{c.current=null,g.current=null,m.removeEventListener("wheel",h)}},[o,n,r.floating,l,s,i]);const p=w.useMemo(()=>({onKeyDown(){f.current=!0},onWheel(){f.current=!1},onPointerMove(){f.current=!1},onScroll(){const h=(s==null?void 0:s.current)||r.floating;if(!(!l.current||!h||!f.current)){if(c.current!==null){const m=h.scrollTop-c.current;(l.current.bottom<-.5&&m<-1||l.current.top<-.5&&m>1)&&It.flushSync(()=>i(v=>v+m))}requestAnimationFrame(()=>{c.current=h.scrollTop})}}}),[r.floating,i,l,s]);return w.useMemo(()=>o?{floating:p}:{},[o,p])}let ut=u.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});ut.displayName="FloatingContext";let ir=u.createContext(null);ir.displayName="PlacementContext";function ol(e){return u.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function ll(){return u.useContext(ut).setReference}function nu(){return u.useContext(ut).getReferenceProps}function sl(){let{getFloatingProps:e,slot:t}=u.useContext(ut);return u.useCallback((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor}),[e,t])}function al(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=u.useContext(ir),n=u.useMemo(()=>e,[JSON.stringify(e,(o,l)=>{var s;return(s=l==null?void 0:l.outerHTML)!=null?s:l})]);q(()=>{t==null||t(n??null)},[t,n]);let r=u.useContext(ut);return u.useMemo(()=>[r.setFloating,e?r.styles:{}],[r.setFloating,e,r.styles])}let il=4;function ul({children:e,enabled:t=!0}){let[n,r]=u.useState(null),[o,l]=u.useState(0),s=u.useRef(null),[a,i]=u.useState(null);ru(a);let f=t&&n!==null&&a!==null,{to:c="bottom",gap:g=0,offset:p=0,padding:h=0,inner:m}=ou(n,a),[v,b="center"]=c.split(" ");q(()=>{f&&l(0)},[f]);let{refs:y,floatingStyles:E,context:x}=Ji({open:f,placement:v==="selection"?b==="center"?"bottom":`bottom-${b}`:b==="center"?`${v}`:`${v}-${b}`,strategy:"absolute",transform:!1,middleware:[Qo({mainAxis:v==="selection"?0:g,crossAxis:p}),Di({padding:h}),v!=="selection"&&ji({padding:h}),v==="selection"&&m?eu({...m,padding:h,overflowRef:s,offset:o,minItemsVisible:il,referenceOverflowThreshold:h,onFallbackChange(F){var H,j;if(!F)return;let T=x.elements.floating;if(!T)return;let z=parseFloat(getComputedStyle(T).scrollPaddingBottom)||0,_=Math.min(il,T.childElementCount),G=0,S=0;for(let A of(j=(H=x.elements.floating)==null?void 0:H.childNodes)!=null?j:[])if(oe(A)){let K=A.offsetTop,te=K+A.clientHeight+z,me=T.scrollTop,M=me+T.clientHeight;if(K>=me&&te<=M)_--;else{S=Math.max(0,Math.min(te,M)-Math.max(K,me)),G=A.clientHeight;break}}_>=1&&l(A=>{let K=G*_-S+z;return A>=K?A:K})}}):null,_i({padding:h,apply({availableWidth:F,availableHeight:H,elements:j}){Object.assign(j.floating.style,{overflow:"auto",maxWidth:`${F}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${H}px)`})}})].filter(Boolean),whileElementsMounted:Ci}),[k=v,$=b]=x.placement.split("-");v==="selection"&&(k="selection");let P=u.useMemo(()=>({anchor:[k,$].filter(Boolean).join(" ")}),[k,$]),O=tu(x,{overflowRef:s,onChange:l}),{getReferenceProps:D,getFloatingProps:L}=Ri([O]),N=C(F=>{i(F),y.setFloating(F)});return w.createElement(ir.Provider,{value:r},w.createElement(ut.Provider,{value:{setFloating:N,setReference:y.setReference,styles:E,getReferenceProps:D,getFloatingProps:L,slot:P}},e))}function ru(e){q(()=>{if(!e)return;let t=new MutationObserver(()=>{let n=window.getComputedStyle(e).maxHeight,r=parseFloat(n);if(isNaN(r))return;let o=parseInt(n);isNaN(o)||r!==o&&(e.style.maxHeight=`${Math.ceil(r)}px`)});return t.observe(e,{attributes:!0,attributeFilter:["style"]}),()=>{t.disconnect()}},[e])}function ou(e,t){var n,r,o;let l=ur((n=e==null?void 0:e.gap)!=null?n:"var(--anchor-gap, 0)",t),s=ur((r=e==null?void 0:e.offset)!=null?r:"var(--anchor-offset, 0)",t),a=ur((o=e==null?void 0:e.padding)!=null?o:"var(--anchor-padding, 0)",t);return{...e,gap:l,offset:s,padding:a}}function ur(e,t,n=void 0){let r=Ue(),o=C((i,f)=>{if(i==null)return[n,null];if(typeof i=="number")return[i,null];if(typeof i=="string"){if(!f)return[n,null];let c=dl(i,f);return[c,g=>{let p=cl(i);{let h=p.map(m=>window.getComputedStyle(f).getPropertyValue(m));r.requestAnimationFrame(function m(){r.nextFrame(m);let v=!1;for(let[y,E]of p.entries()){let x=window.getComputedStyle(f).getPropertyValue(E);if(h[y]!==x){h[y]=x,v=!0;break}}if(!v)return;let b=dl(i,f);c!==b&&(g(b),c=b)})}return r.dispose}]}return[n,null]}),l=u.useMemo(()=>o(e,t)[0],[e,t]),[s=l,a]=u.useState();return q(()=>{let[i,f]=o(e,t);if(a(i),!!f)return f(a)},[e,t]),s}function cl(e){let t=/var\((.*)\)/.exec(e);if(t){let n=t[1].indexOf(",");if(n===-1)return[t[1]];let r=t[1].slice(0,n).trim(),o=t[1].slice(n+1).trim();return o?[r,...cl(o)]:[r]}return[]}function dl(e,t){let n=document.createElement("div");t.appendChild(n),n.style.setProperty("margin-top","0px","important"),n.style.setProperty("margin-top",e,"important");let r=parseFloat(window.getComputedStyle(n).marginTop)||0;return t.removeChild(n),r}let rn=u.createContext(null);rn.displayName="OpenClosedContext";var Z=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(Z||{});function We(){return u.useContext(rn)}function on({value:e,children:t}){return u.createElement(rn.Provider,{value:e},t)}function cr({children:e}){return u.createElement(rn.Provider,{value:null},e)}function lu(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let ze=[];lu(()=>{function e(t){if(!de(t.target)||t.target===document.body||ze[0]===t.target)return;let n=t.target;n=n.closest(zt),ze.unshift(n??t.target),ze=ze.filter(r=>r!=null&&r.isConnected),ze.splice(10)}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function su(e){throw new Error("Unexpected object: "+e)}var J=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(J||{});function ln(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),o=r??-1;switch(e.focus){case 0:{for(let l=0;l<n.length;++l)if(!t.resolveDisabled(n[l],l,n))return l;return r}case 1:{o===-1&&(o=n.length);for(let l=o-1;l>=0;--l)if(!t.resolveDisabled(n[l],l,n))return l;return r}case 2:{for(let l=o+1;l<n.length;++l)if(!t.resolveDisabled(n[l],l,n))return l;return r}case 3:{for(let l=n.length-1;l>=0;--l)if(!t.resolveDisabled(n[l],l,n))return l;return r}case 4:{for(let l=0;l<n.length;++l)if(t.resolveId(n[l],l,n)===e.id)return l;return r}case 5:return null;default:su(e)}}function sn(e){let t=C(e),n=u.useRef(!1);u.useEffect(()=>(n.current=!1,()=>{n.current=!0,Bt(()=>{n.current&&t()})}),[t])}let fl=u.createContext(!1);function au(){return u.useContext(fl)}function pl(e){return u.createElement(fl.Provider,{value:e.force},e.children)}function iu(e){let t=au(),n=u.useContext(ml),[r,o]=u.useState(()=>{var l;if(!t&&n!==null)return(l=n.current)!=null?l:null;if($e.isServer)return null;let s=e==null?void 0:e.getElementById("headlessui-portal-root");if(s)return s;if(e===null)return null;let a=e.createElement("div");return a.setAttribute("id","headlessui-portal-root"),e.body.appendChild(a)});return u.useEffect(()=>{r!==null&&(e!=null&&e.body.contains(r)||e==null||e.body.appendChild(r))},[r,e]),u.useEffect(()=>{t||n!==null&&o(n.current)},[n,o,t]),r}let hl=u.Fragment,uu=V(function(e,t){let{ownerDocument:n=null,...r}=e,o=u.useRef(null),l=Q(Dn(p=>{o.current=p}),t),s=Qe(o.current),a=n??s,i=iu(a),f=u.useContext(dr),c=Ue(),g=U();return sn(()=>{var p;i&&i.childNodes.length<=0&&((p=i.parentElement)==null||p.removeChild(i))}),i?pt.createPortal(u.createElement("div",{"data-headlessui-portal":"",ref:p=>{c.dispose(),f&&p&&c.add(f.register(p))}},g({ourProps:{ref:l},theirProps:r,slot:{},defaultTag:hl,name:"Portal"})),i):null});function cu(e,t){let n=Q(t),{enabled:r=!0,ownerDocument:o,...l}=e,s=U();return r?u.createElement(uu,{...l,ownerDocument:o,ref:n}):s({ourProps:{ref:n},theirProps:l,slot:{},defaultTag:hl,name:"Portal"})}let du=u.Fragment,ml=u.createContext(null);function fu(e,t){let{target:n,...r}=e,o={ref:Q(t)},l=U();return u.createElement(ml.Provider,{value:n},l({ourProps:o,theirProps:r,defaultTag:du,name:"Popover.Group"}))}let dr=u.createContext(null);function gl(){let e=u.useContext(dr),t=u.useRef([]),n=C(l=>(t.current.push(l),e&&e.register(l),()=>r(l))),r=C(l=>{let s=t.current.indexOf(l);s!==-1&&t.current.splice(s,1),e&&e.unregister(l)}),o=u.useMemo(()=>({register:n,unregister:r,portals:t}),[n,r,t]);return[t,u.useMemo(()=>function({children:l}){return u.createElement(dr.Provider,{value:o},l)},[o])]}let pu=V(cu),vl=V(fu),fr=Object.assign(pu,{Group:vl});const an={Idle:{kind:"Idle"},Tracked:e=>({kind:"Tracked",position:e}),Moved:{kind:"Moved"}};function bl(e){let t=e.getBoundingClientRect();return`${t.x},${t.y}`}function hu(e,t,n){let r=ie();if(t.kind==="Tracked"){let o=function(){l!==bl(e)&&(r.dispose(),n())},{position:l}=t,s=new ResizeObserver(o);s.observe(e),r.add(()=>s.disconnect()),r.addEventListener(window,"scroll",o,{passive:!0}),r.addEventListener(window,"resize",o)}return()=>r.dispose()}function mu(e,t=typeof document<"u"?document.defaultView:null,n){let r=Et(e,"escape");qn(t,"keydown",o=>{r&&(o.defaultPrevented||o.key===W.Escape&&n(o))})}function gu(){var e;let[t]=u.useState(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)"):null),[n,r]=u.useState((e=t==null?void 0:t.matches)!=null?e:!1);return q(()=>{if(!t)return;function o(l){r(l.matches)}return t.addEventListener("change",o),()=>t.removeEventListener("change",o)},[t]),n}function yl({defaultContainers:e=[],portals:t,mainTreeNode:n}={}){let r=C(()=>{var o,l;let s=Fe(n),a=[];for(let i of e)i!==null&&(Ie(i)?a.push(i):"current"in i&&Ie(i.current)&&a.push(i.current));if(t!=null&&t.current)for(let i of t.current)a.push(i);for(let i of(o=s==null?void 0:s.querySelectorAll("html > *, body > *"))!=null?o:[])i!==document.body&&i!==document.head&&Ie(i)&&i.id!=="headlessui-portal-root"&&(n&&(i.contains(n)||i.contains((l=n==null?void 0:n.getRootNode())==null?void 0:l.host))||a.some(f=>i.contains(f))||a.push(i));return a});return{resolveContainers:r,contains:C(o=>r().some(l=>l.contains(o)))}}let wl=u.createContext(null);function un({children:e,node:t}){let[n,r]=u.useState(null),o=pr(t??n);return u.createElement(wl.Provider,{value:o},e,o===null&&u.createElement(nt,{features:Ze.Hidden,ref:l=>{var s,a;if(l){for(let i of(a=(s=Fe(l))==null?void 0:s.querySelectorAll("html > *, body > *"))!=null?a:[])if(i!==document.body&&i!==document.head&&Ie(i)&&i!=null&&i.contains(l)){r(i);break}}}}))}function pr(e=null){var t;return(t=u.useContext(wl))!=null?t:e}function vu(){let e=typeof document>"u";return"useSyncExternalStore"in w?(t=>t.useSyncExternalStore)(w)(()=>()=>{},()=>!1,()=>!e):!1}function cn(){let e=vu(),[t,n]=w.useState($e.isHandoffComplete);return t&&$e.isHandoffComplete===!1&&n(!1),w.useEffect(()=>{t!==!0&&n(!0)},[t]),w.useEffect(()=>$e.handoff(),[]),e?!1:t}function hr(){let e=u.useRef(!1);return q(()=>(e.current=!0,()=>{e.current=!1}),[]),e}var he=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(he||{});function mr(){let e=u.useRef(0);return Eo(!0,"keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}function xl(e){if(!e)return new Set;if(typeof e=="function")return new Set(e());let t=new Set;for(let n of e.current)Ie(n.current)&&t.add(n.current);return t}let bu="div";var et=(e=>(e[e.None=0]="None",e[e.InitialFocus=1]="InitialFocus",e[e.TabLock=2]="TabLock",e[e.FocusLock=4]="FocusLock",e[e.RestoreFocus=8]="RestoreFocus",e[e.AutoFocus=16]="AutoFocus",e))(et||{});function yu(e,t){let n=u.useRef(null),r=Q(n,t),{initialFocus:o,initialFocusFallback:l,containers:s,features:a=15,...i}=e;cn()||(a=0);let f=Qe(n.current);ku(a,{ownerDocument:f});let c=$u(a,{ownerDocument:f,container:n,initialFocus:o,initialFocusFallback:l});Su(a,{ownerDocument:f,container:n,containers:s,previousActiveElement:c});let g=mr(),p=C(E=>{if(!oe(n.current))return;let x=n.current;(k=>k())(()=>{X(g.current,{[he.Forwards]:()=>{fe(x,ee.First,{skipElements:[E.relatedTarget,l]})},[he.Backwards]:()=>{fe(x,ee.Last,{skipElements:[E.relatedTarget,l]})}})})}),h=Et(!!(a&2),"focus-trap#tab-lock"),m=Ue(),v=u.useRef(!1),b={ref:r,onKeyDown(E){E.key=="Tab"&&(v.current=!0,m.requestAnimationFrame(()=>{v.current=!1}))},onBlur(E){if(!(a&4))return;let x=xl(s);oe(n.current)&&x.add(n.current);let k=E.relatedTarget;de(k)&&k.dataset.headlessuiFocusGuard!=="true"&&(El(x,k)||(v.current?fe(n.current,X(g.current,{[he.Forwards]:()=>ee.Next,[he.Backwards]:()=>ee.Previous})|ee.WrapAround,{relativeTo:E.target}):de(E.target)&&Ne(E.target)))}},y=U();return u.createElement(u.Fragment,null,h&&u.createElement(nt,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:p,features:Ze.Focusable}),y({ourProps:b,theirProps:i,defaultTag:bu,name:"FocusTrap"}),h&&u.createElement(nt,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:p,features:Ze.Focusable}))}let wu=V(yu),xu=Object.assign(wu,{features:et});function Eu(e=!0){let t=u.useRef(ze.slice());return Xn(([n],[r])=>{r===!0&&n===!1&&Bt(()=>{t.current.splice(0)}),r===!1&&n===!0&&(t.current=ze.slice())},[e,ze,t]),C(()=>{var n;return(n=t.current.find(r=>r!=null&&r.isConnected))!=null?n:null})}function ku(e,{ownerDocument:t}){let n=!!(e&8),r=Eu(n);Xn(()=>{n||Gr(t==null?void 0:t.body)&&Ne(r())},[n]),sn(()=>{n&&Ne(r())})}function $u(e,{ownerDocument:t,container:n,initialFocus:r,initialFocusFallback:o}){let l=u.useRef(null),s=Et(!!(e&1),"focus-trap#initial-focus"),a=hr();return Xn(()=>{if(e===0)return;if(!s){o!=null&&o.current&&Ne(o.current);return}let i=n.current;i&&Bt(()=>{if(!a.current)return;let f=t==null?void 0:t.activeElement;if(r!=null&&r.current){if((r==null?void 0:r.current)===f){l.current=f;return}}else if(i.contains(f)){l.current=f;return}if(r!=null&&r.current)Ne(r.current);else{if(e&16){if(fe(i,ee.First|ee.AutoFocus)!==rt.Error)return}else if(fe(i,ee.First)!==rt.Error)return;if(o!=null&&o.current&&(Ne(o.current),(t==null?void 0:t.activeElement)===o.current))return;console.warn("There are no focusable elements inside the <FocusTrap />")}l.current=t==null?void 0:t.activeElement})},[o,s,e]),l}function Su(e,{ownerDocument:t,container:n,containers:r,previousActiveElement:o}){let l=hr(),s=!!(e&4);qn(t==null?void 0:t.defaultView,"focus",a=>{if(!s||!l.current)return;let i=xl(r);oe(n.current)&&i.add(n.current);let f=o.current;if(!f)return;let c=a.target;oe(c)?El(i,c)?(o.current=c,Ne(c)):(a.preventDefault(),a.stopPropagation(),Ne(f)):Ne(o.current)},!0)}function El(e,t){for(let n of e)if(n.contains(t))return!0;return!1}function kl(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||!tt((t=e.as)!=null?t:Sl)||u.Children.count(e.children)===1}let dn=u.createContext(null);dn.displayName="TransitionContext";var Nu=(e=>(e.Visible="visible",e.Hidden="hidden",e))(Nu||{});function Cu(){let e=u.useContext(dn);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function Pu(){let e=u.useContext(fn);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let fn=u.createContext(null);fn.displayName="NestingContext";function pn(e){return"children"in e?pn(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function $l(e,t){let n=Me(e),r=u.useRef([]),o=hr(),l=Ue(),s=C((h,m=Be.Hidden)=>{let v=r.current.findIndex(({el:b})=>b===h);v!==-1&&(X(m,{[Be.Unmount](){r.current.splice(v,1)},[Be.Hidden](){r.current[v].state="hidden"}}),l.microTask(()=>{var b;!pn(r)&&o.current&&((b=n.current)==null||b.call(n))}))}),a=C(h=>{let m=r.current.find(({el:v})=>v===h);return m?m.state!=="visible"&&(m.state="visible"):r.current.push({el:h,state:"visible"}),()=>s(h,Be.Unmount)}),i=u.useRef([]),f=u.useRef(Promise.resolve()),c=u.useRef({enter:[],leave:[]}),g=C((h,m,v)=>{i.current.splice(0),t&&(t.chains.current[m]=t.chains.current[m].filter(([b])=>b!==h)),t==null||t.chains.current[m].push([h,new Promise(b=>{i.current.push(b)})]),t==null||t.chains.current[m].push([h,new Promise(b=>{Promise.all(c.current[m].map(([y,E])=>E)).then(()=>b())})]),m==="enter"?f.current=f.current.then(()=>t==null?void 0:t.wait.current).then(()=>v(m)):v(m)}),p=C((h,m,v)=>{Promise.all(c.current[m].splice(0).map(([b,y])=>y)).then(()=>{var b;(b=i.current.shift())==null||b()}).then(()=>v(m))});return u.useMemo(()=>({children:r,register:a,unregister:s,onStart:g,onStop:p,wait:f,chains:c}),[a,s,r,g,p,c,f])}let Sl=u.Fragment,Nl=we.RenderStrategy;function Tu(e,t){var n,r;let{transition:o=!0,beforeEnter:l,afterEnter:s,beforeLeave:a,afterLeave:i,enter:f,enterFrom:c,enterTo:g,entered:p,leave:h,leaveFrom:m,leaveTo:v,...b}=e,[y,E]=u.useState(null),x=u.useRef(null),k=kl(e),$=Q(...k?[x,t,E]:t===null?[]:[t]),P=(n=b.unmount)==null||n?Be.Unmount:Be.Hidden,{show:O,appear:D,initial:L}=Cu(),[N,F]=u.useState(O?"visible":"hidden"),H=Pu(),{register:j,unregister:T}=H;q(()=>j(x),[j,x]),q(()=>{if(P===Be.Hidden&&x.current){if(O&&N!=="visible"){F("visible");return}return X(N,{hidden:()=>T(x),visible:()=>j(x)})}},[N,x,j,T,O,P]);let z=cn();q(()=>{if(k&&z&&N==="visible"&&x.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[x,N,z,k]);let _=L&&!D,G=D&&O&&L,S=u.useRef(!1),A=$l(()=>{S.current||(F("hidden"),T(x))},H),K=C(ce=>{S.current=!0;let ge=ce?"enter":"leave";A.onStart(x,ge,ve=>{ve==="enter"?l==null||l():ve==="leave"&&(a==null||a())})}),te=C(ce=>{let ge=ce?"enter":"leave";S.current=!1,A.onStop(x,ge,ve=>{ve==="enter"?s==null||s():ve==="leave"&&(i==null||i())}),ge==="leave"&&!pn(A)&&(F("hidden"),T(x))});u.useEffect(()=>{k&&o||(K(O),te(O))},[O,k,o]);let me=!(!o||!k||!z||_),[,M]=Nt(me,y,O,{start:K,end:te}),I=qe({ref:$,className:((r=Ln(b.className,G&&f,G&&c,M.enter&&f,M.enter&&M.closed&&c,M.enter&&!M.closed&&g,M.leave&&h,M.leave&&!M.closed&&m,M.leave&&M.closed&&v,!M.transition&&O&&p))==null?void 0:r.trim())||void 0,...St(M)}),B=0;N==="visible"&&(B|=Z.Open),N==="hidden"&&(B|=Z.Closed),O&&N==="hidden"&&(B|=Z.Opening),!O&&N==="visible"&&(B|=Z.Closing);let ue=U();return u.createElement(fn.Provider,{value:A},u.createElement(on,{value:B},ue({ourProps:I,theirProps:b,defaultTag:Sl,features:Nl,visible:N==="visible",name:"Transition.Child"})))}function Ou(e,t){let{show:n,appear:r=!1,unmount:o=!0,...l}=e,s=u.useRef(null),a=kl(e),i=Q(...a?[s,t]:t===null?[]:[t]);cn();let f=We();if(n===void 0&&f!==null&&(n=(f&Z.Open)===Z.Open),n===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[c,g]=u.useState(n?"visible":"hidden"),p=$l(()=>{n||g("hidden")}),[h,m]=u.useState(!0),v=u.useRef([n]);q(()=>{h!==!1&&v.current[v.current.length-1]!==n&&(v.current.push(n),m(!1))},[v,n]);let b=u.useMemo(()=>({show:n,appear:r,initial:h}),[n,r,h]);q(()=>{n?g("visible"):!pn(p)&&s.current!==null&&g("hidden")},[n,p]);let y={unmount:o},E=C(()=>{var $;h&&m(!1),($=e.beforeEnter)==null||$.call(e)}),x=C(()=>{var $;h&&m(!1),($=e.beforeLeave)==null||$.call(e)}),k=U();return u.createElement(fn.Provider,{value:p},u.createElement(dn.Provider,{value:b},k({ourProps:{...y,as:u.Fragment,children:u.createElement(Cl,{ref:i,...y,...l,beforeEnter:E,beforeLeave:x})},theirProps:{},defaultTag:u.Fragment,features:Nl,visible:c==="visible",name:"Transition"})))}function Fu(e,t){let n=u.useContext(dn)!==null,r=We()!==null;return u.createElement(u.Fragment,null,!n&&r?u.createElement(gr,{ref:t,...e}):u.createElement(Cl,{ref:t,...e}))}let gr=V(Ou),Cl=V(Tu),vr=V(Fu),Mu=Object.assign(gr,{Child:vr,Root:gr});var Iu=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Iu||{}),Lu=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(Lu||{});let Au={0(e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},br=u.createContext(null);br.displayName="DialogContext";function hn(e){let t=u.useContext(br);if(t===null){let n=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,hn),n}return t}function Du(e,t){return X(t.type,Au,e,t)}let Pl=V(function(e,t){let n=u.useId(),{id:r=`headlessui-dialog-${n}`,open:o,onClose:l,initialFocus:s,role:a="dialog",autoFocus:i=!0,__demoMode:f=!1,unmount:c=!1,...g}=e,p=u.useRef(!1);a=function(){return a==="dialog"||a==="alertdialog"?a:(p.current||(p.current=!0,console.warn(`Invalid role [${a}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")}();let h=We();o===void 0&&h!==null&&(o=(h&Z.Open)===Z.Open);let m=u.useRef(null),v=Q(m,t),b=Qe(m.current),y=o?0:1,[E,x]=u.useReducer(Du,{titleId:null,descriptionId:null,panelRef:u.createRef()}),k=C(()=>l(!1)),$=C(M=>x({type:0,id:M})),P=cn()?y===0:!1,[O,D]=gl(),L={get current(){var M;return(M=E.panelRef.current)!=null?M:m.current}},N=pr(),{resolveContainers:F}=yl({mainTreeNode:N,portals:O,defaultContainers:[L]}),H=h!==null?(h&Z.Closing)===Z.Closing:!1;vo(f||H?!1:P,{allowed:C(()=>{var M,I;return[(I=(M=m.current)==null?void 0:M.closest("[data-headlessui-portal]"))!=null?I:null]}),disallowed:C(()=>{var M;return[(M=N==null?void 0:N.closest("body > *:not(#headlessui-portal-root)"))!=null?M:null]})});let j=xt.get(null);q(()=>{if(P)return j.actions.push(r),()=>j.actions.pop(r)},[j,r,P]);let T=re(j,u.useCallback(M=>j.selectors.isTop(M,r),[j,r]));Yn(T,F,M=>{M.preventDefault(),k()}),mu(T,b==null?void 0:b.defaultView,M=>{M.preventDefault(),M.stopPropagation(),document.activeElement&&"blur"in document.activeElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur(),k()}),Qn(f||H?!1:P,b,F),Un(P,m,k);let[z,_]=Rr(),G=u.useMemo(()=>[{dialogState:y,close:k,setTitleId:$,unmount:c},E],[y,k,$,c,E]),S=ne({open:y===0}),A={ref:v,id:r,role:a,tabIndex:-1,"aria-modal":f?void 0:y===0?!0:void 0,"aria-labelledby":E.titleId,"aria-describedby":z,unmount:c},K=!gu(),te=et.None;P&&!f&&(te|=et.RestoreFocus,te|=et.TabLock,i&&(te|=et.AutoFocus),K&&(te|=et.InitialFocus));let me=U();return u.createElement(cr,null,u.createElement(pl,{force:!0},u.createElement(fr,null,u.createElement(br.Provider,{value:G},u.createElement(vl,{target:m},u.createElement(pl,{force:!1},u.createElement(_,{slot:S},u.createElement(D,null,u.createElement(xu,{initialFocus:s,initialFocusFallback:m,containers:F,features:te},u.createElement(Wt,{value:k},me({ourProps:A,theirProps:g,slot:S,defaultTag:ju,features:_u,visible:y===0,name:"Dialog"})))))))))))}),ju="div",_u=we.RenderStrategy|we.Static;function Bu(e,t){let{transition:n=!1,open:r,...o}=e,l=We(),s=e.hasOwnProperty("open")||l!==null,a=e.hasOwnProperty("onClose");if(!s&&!a)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!s)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!a)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!l&&typeof e.open!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${e.open}`);if(typeof e.onClose!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${e.onClose}`);return(r!==void 0||n)&&!o.static?u.createElement(un,null,u.createElement(Mu,{show:r,transition:n,unmount:o.unmount},u.createElement(Pl,{ref:t,...o}))):u.createElement(un,null,u.createElement(Pl,{ref:t,open:r,...o}))}let Hu="div";function Vu(e,t){let n=u.useId(),{id:r=`headlessui-dialog-panel-${n}`,transition:o=!1,...l}=e,[{dialogState:s,unmount:a},i]=hn("Dialog.Panel"),f=Q(t,i.panelRef),c=ne({open:s===0}),g=C(b=>{b.stopPropagation()}),p={ref:f,id:r,onClick:g},h=o?vr:u.Fragment,m=o?{unmount:a}:{},v=U();return u.createElement(h,{...m},v({ourProps:p,theirProps:l,slot:c,defaultTag:Hu,name:"Dialog.Panel"}))}let Wu="div";function zu(e,t){let{transition:n=!1,...r}=e,[{dialogState:o,unmount:l}]=hn("Dialog.Backdrop"),s=ne({open:o===0}),a={ref:t,"aria-hidden":!0},i=n?vr:u.Fragment,f=n?{unmount:l}:{},c=U();return u.createElement(i,{...f},c({ourProps:a,theirProps:r,slot:s,defaultTag:Wu,name:"Dialog.Backdrop"}))}let Gu="h2";function Ku(e,t){let n=u.useId(),{id:r=`headlessui-dialog-title-${n}`,...o}=e,[{dialogState:l,setTitleId:s}]=hn("Dialog.Title"),a=Q(t);u.useEffect(()=>(s(r),()=>s(null)),[r,s]);let i=ne({open:l===0}),f={ref:a,id:r};return U()({ourProps:f,theirProps:o,slot:i,defaultTag:Gu,name:"Dialog.Title"})}let Uu=V(Bu),mn=V(Vu);V(zu);let Yu=V(Ku),yr=Object.assign(Uu,{Panel:mn,Title:Yu,Description:Ys});var Tl;let qu=(Tl=u.startTransition)!=null?Tl:function(e){e()};var Zu=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Zu||{}),Qu=(e=>(e[e.ToggleDisclosure=0]="ToggleDisclosure",e[e.CloseDisclosure=1]="CloseDisclosure",e[e.SetButtonId=2]="SetButtonId",e[e.SetPanelId=3]="SetPanelId",e[e.SetButtonElement=4]="SetButtonElement",e[e.SetPanelElement=5]="SetPanelElement",e))(Qu||{});let Xu={0:e=>({...e,disclosureState:X(e.disclosureState,{0:1,1:0})}),1:e=>e.disclosureState===1?e:{...e,disclosureState:1},2(e,t){return e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId}},3(e,t){return e.panelId===t.panelId?e:{...e,panelId:t.panelId}},4(e,t){return e.buttonElement===t.element?e:{...e,buttonElement:t.element}},5(e,t){return e.panelElement===t.element?e:{...e,panelElement:t.element}}},wr=u.createContext(null);wr.displayName="DisclosureContext";function xr(e){let t=u.useContext(wr);if(t===null){let n=new Error(`<${e} /> is missing a parent <Disclosure /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,xr),n}return t}let Er=u.createContext(null);Er.displayName="DisclosureAPIContext";function Ol(e){let t=u.useContext(Er);if(t===null){let n=new Error(`<${e} /> is missing a parent <Disclosure /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Ol),n}return t}let kr=u.createContext(null);kr.displayName="DisclosurePanelContext";function Ju(){return u.useContext(kr)}function Ru(e,t){return X(t.type,Xu,e,t)}let ec=u.Fragment;function tc(e,t){let{defaultOpen:n=!1,...r}=e,o=u.useRef(null),l=Q(t,Dn(v=>{o.current=v},e.as===void 0||tt(e.as))),s=u.useReducer(Ru,{disclosureState:n?0:1,buttonElement:null,panelElement:null,buttonId:null,panelId:null}),[{disclosureState:a,buttonId:i},f]=s,c=C(v=>{f({type:1});let b=Fe(o.current);if(!b||!i)return;let y=v?de(v)?v:"current"in v&&de(v.current)?v.current:b.getElementById(i):b.getElementById(i);y==null||y.focus()}),g=u.useMemo(()=>({close:c}),[c]),p=ne({open:a===0,close:c}),h={ref:l},m=U();return u.createElement(wr.Provider,{value:s},u.createElement(Er.Provider,{value:g},u.createElement(Wt,{value:c},u.createElement(on,{value:X(a,{0:Z.Open,1:Z.Closed})},m({ourProps:h,theirProps:r,slot:p,defaultTag:ec,name:"Disclosure"})))))}let nc="button";function rc(e,t){let n=u.useId(),{id:r=`headlessui-disclosure-button-${n}`,disabled:o=!1,autoFocus:l=!1,...s}=e,[a,i]=xr("Disclosure.Button"),f=Ju(),c=f===null?!1:f===a.panelId,g=u.useRef(null),p=Q(g,t,C(L=>{if(!c)return i({type:4,element:L})}));u.useEffect(()=>{if(!c)return i({type:2,buttonId:r}),()=>{i({type:2,buttonId:null})}},[r,i,c]);let h=C(L=>{var N;if(c){if(a.disclosureState===1)return;switch(L.key){case W.Space:case W.Enter:L.preventDefault(),L.stopPropagation(),i({type:0}),(N=a.buttonElement)==null||N.focus();break}}else switch(L.key){case W.Space:case W.Enter:L.preventDefault(),L.stopPropagation(),i({type:0});break}}),m=C(L=>{switch(L.key){case W.Space:L.preventDefault();break}}),v=C(L=>{var N;bt(L.currentTarget)||o||(c?(i({type:0}),(N=a.buttonElement)==null||N.focus()):i({type:0}))}),{isFocusVisible:b,focusProps:y}=Fn({autoFocus:l}),{isHovered:E,hoverProps:x}=On({isDisabled:o}),{pressed:k,pressProps:$}=In({disabled:o}),P=ne({open:a.disclosureState===0,hover:E,active:k,disabled:o,focus:b,autofocus:l}),O=Zn(e,a.buttonElement),D=Ye(c?{ref:p,type:O,disabled:o||void 0,autoFocus:l,onKeyDown:h,onClick:v}:{ref:p,id:r,type:O,"aria-expanded":a.disclosureState===0,"aria-controls":a.panelElement?a.panelId:void 0,disabled:o||void 0,autoFocus:l,onKeyDown:h,onKeyUp:m,onClick:v},y,x,$);return U()({ourProps:D,theirProps:s,slot:P,defaultTag:nc,name:"Disclosure.Button"})}let oc="div",lc=we.RenderStrategy|we.Static;function sc(e,t){let n=u.useId(),{id:r=`headlessui-disclosure-panel-${n}`,transition:o=!1,...l}=e,[s,a]=xr("Disclosure.Panel"),{close:i}=Ol("Disclosure.Panel"),[f,c]=u.useState(null),g=Q(t,C(E=>{qu(()=>a({type:5,element:E}))}),c);u.useEffect(()=>(a({type:3,panelId:r}),()=>{a({type:3,panelId:null})}),[r,a]);let p=We(),[h,m]=Nt(o,f,p!==null?(p&Z.Open)===Z.Open:s.disclosureState===0),v=ne({open:s.disclosureState===0,close:i}),b={ref:g,id:r,...St(m)},y=U();return u.createElement(cr,null,u.createElement(kr.Provider,{value:s.panelId},y({ourProps:b,theirProps:l,slot:v,defaultTag:oc,features:lc,visible:h,name:"Disclosure.Panel"})))}let ac=V(tc),ke=V(rc),$r=V(sc),Fl=Object.assign(ac,{Button:ke,Panel:$r}),Ml=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function Il(e){var t,n;let r=(t=e.innerText)!=null?t:"",o=e.cloneNode(!0);if(!oe(o))return r;let l=!1;for(let a of o.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))a.remove(),l=!0;let s=l?(n=o.innerText)!=null?n:"":r;return Ml.test(s)&&(s=s.replace(Ml,"")),s}function ic(e){let t=e.getAttribute("aria-label");if(typeof t=="string")return t.trim();let n=e.getAttribute("aria-labelledby");if(n){let r=n.split(" ").map(o=>{let l=document.getElementById(o);if(l){let s=l.getAttribute("aria-label");return typeof s=="string"?s.trim():Il(l).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return Il(e).trim()}function uc(e){let t=u.useRef(""),n=u.useRef("");return C(()=>{let r=e.current;if(!r)return"";let o=r.innerText;if(t.current===o)return n.current;let l=ic(r).trim().toLowerCase();return t.current=o,n.current=l,l})}var cc=Object.defineProperty,dc=(e,t,n)=>t in e?cc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ll=(e,t,n)=>(dc(e,typeof t!="symbol"?t+"":t,n),n),ae=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(ae||{}),gn=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(gn||{}),Y=(e=>(e[e.OpenMenu=0]="OpenMenu",e[e.CloseMenu=1]="CloseMenu",e[e.GoToItem=2]="GoToItem",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterItems=5]="RegisterItems",e[e.UnregisterItems=6]="UnregisterItems",e[e.SetButtonElement=7]="SetButtonElement",e[e.SetItemsElement=8]="SetItemsElement",e[e.SortItems=9]="SortItems",e[e.MarkButtonAsMoved=10]="MarkButtonAsMoved",e))(Y||{});function Al(e,t=n=>n){let n=e.activeItemIndex!==null?e.items[e.activeItemIndex]:null,r=yo(t(e.items.slice()),l=>l.dataRef.current.domRef.current),o=n?r.indexOf(n):null;return o===-1&&(o=null),{items:r,activeItemIndex:o}}let fc={1(e){if(e.menuState===1)return e;let t=e.buttonElement?an.Tracked(bl(e.buttonElement)):e.buttonPositionState;return{...e,activeItemIndex:null,pendingFocus:{focus:J.Nothing},menuState:1,buttonPositionState:t}},0(e,t){return e.menuState===0?e:{...e,__demoMode:!1,pendingFocus:t.focus,menuState:0,buttonPositionState:an.Idle}},2:(e,t)=>{var n,r,o,l,s;if(e.menuState===1)return e;let a={...e,searchQuery:"",activationTrigger:(n=t.trigger)!=null?n:1,__demoMode:!1};if(t.focus===J.Nothing)return{...a,activeItemIndex:null};if(t.focus===J.Specific)return{...a,activeItemIndex:e.items.findIndex(c=>c.id===t.id)};if(t.focus===J.Previous){let c=e.activeItemIndex;if(c!==null){let g=e.items[c].dataRef.current.domRef,p=ln(t,{resolveItems:()=>e.items,resolveActiveIndex:()=>e.activeItemIndex,resolveId:h=>h.id,resolveDisabled:h=>h.dataRef.current.disabled});if(p!==null){let h=e.items[p].dataRef.current.domRef;if(((r=g.current)==null?void 0:r.previousElementSibling)===h.current||((o=h.current)==null?void 0:o.previousElementSibling)===null)return{...a,activeItemIndex:p}}}}else if(t.focus===J.Next){let c=e.activeItemIndex;if(c!==null){let g=e.items[c].dataRef.current.domRef,p=ln(t,{resolveItems:()=>e.items,resolveActiveIndex:()=>e.activeItemIndex,resolveId:h=>h.id,resolveDisabled:h=>h.dataRef.current.disabled});if(p!==null){let h=e.items[p].dataRef.current.domRef;if(((l=g.current)==null?void 0:l.nextElementSibling)===h.current||((s=h.current)==null?void 0:s.nextElementSibling)===null)return{...a,activeItemIndex:p}}}}let i=Al(e),f=ln(t,{resolveItems:()=>i.items,resolveActiveIndex:()=>i.activeItemIndex,resolveId:c=>c.id,resolveDisabled:c=>c.dataRef.current.disabled});return{...a,...i,activeItemIndex:f}},3:(e,t)=>{let n=e.searchQuery!==""?0:1,r=e.searchQuery+t.value.toLowerCase(),o=(e.activeItemIndex!==null?e.items.slice(e.activeItemIndex+n).concat(e.items.slice(0,e.activeItemIndex+n)):e.items).find(s=>{var a;return((a=s.dataRef.current.textValue)==null?void 0:a.startsWith(r))&&!s.dataRef.current.disabled}),l=o?e.items.indexOf(o):-1;return l===-1||l===e.activeItemIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeItemIndex:l,activationTrigger:1}},4(e){return e.searchQuery===""?e:{...e,searchQuery:"",searchActiveItemIndex:null}},5:(e,t)=>{let n=e.items.concat(t.items.map(o=>o)),r=e.activeItemIndex;return e.pendingFocus.focus!==J.Nothing&&(r=ln(e.pendingFocus,{resolveItems:()=>n,resolveActiveIndex:()=>e.activeItemIndex,resolveId:o=>o.id,resolveDisabled:o=>o.dataRef.current.disabled})),{...e,items:n,activeItemIndex:r,pendingFocus:{focus:J.Nothing},pendingShouldSort:!0}},6:(e,t)=>{let n=e.items,r=[],o=new Set(t.items);for(let[l,s]of n.entries())if(o.has(s.id)&&(r.push(l),o.delete(s.id),o.size===0))break;if(r.length>0){n=n.slice();for(let l of r.reverse())n.splice(l,1)}return{...e,items:n,activationTrigger:1}},7:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},8:(e,t)=>e.itemsElement===t.element?e:{...e,itemsElement:t.element},9:e=>e.pendingShouldSort?{...e,...Al(e),pendingShouldSort:!1}:e,10(e){return e.buttonPositionState.kind!=="Tracked"?e:{...e,buttonPositionState:an.Moved}}},pc=class Xl extends Hn{constructor(t){super(t),Ll(this,"actions",{registerItem:uo(()=>{let n=[],r=new Set;return[(o,l)=>{r.has(l)||(r.add(l),n.push({id:o,dataRef:l}))},()=>(r.clear(),this.send({type:5,items:n.splice(0)}))]}),unregisterItem:uo(()=>{let n=[];return[r=>n.push(r),()=>this.send({type:6,items:n.splice(0)})]})}),Ll(this,"selectors",{activeDescendantId(n){var r;let o=n.activeItemIndex,l=n.items;return o===null||(r=l[o])==null?void 0:r.id},isActive(n,r){var o;let l=n.activeItemIndex,s=n.items;return l!==null?((o=s[l])==null?void 0:o.id)===r:!1},shouldScrollIntoView(n,r){return n.__demoMode||n.menuState!==0||n.activationTrigger===0?!1:this.isActive(n,r)},didButtonMove(n){return n.buttonPositionState.kind==="Moved"}}),this.on(5,()=>{this.disposables.requestAnimationFrame(()=>{this.send({type:9})})});{let n=this.state.id,r=xt.get(null);this.disposables.add(r.on(fo.Push,o=>{!r.selectors.isTop(o,n)&&this.state.menuState===0&&this.send({type:1})})),this.on(0,()=>r.actions.push(n)),this.on(1,()=>r.actions.pop(n))}this.disposables.group(n=>{this.on(1,r=>{r.buttonElement&&(n.dispose(),n.add(hu(r.buttonElement,r.buttonPositionState,()=>{this.send({type:10})})))})})}static new({id:t,__demoMode:n=!1}){return new Xl({id:t,__demoMode:n,menuState:n?0:1,buttonElement:null,itemsElement:null,items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1,pendingShouldSort:!1,pendingFocus:{focus:J.Nothing},buttonPositionState:an.Idle})}reduce(t,n){return X(n.type,fc,t,n)}};const Dl=u.createContext(null);function Sr(e){let t=u.useContext(Dl);if(t===null){let n=new Error(`<${e} /> is missing a parent <Menu /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,jl),n}return t}function jl({id:e,__demoMode:t=!1}){let n=u.useMemo(()=>pc.new({id:e,__demoMode:t}),[]);return sn(()=>n.dispose()),n}let hc=u.Fragment;function mc(e,t){let n=u.useId(),{__demoMode:r=!1,...o}=e,l=jl({id:n,__demoMode:r}),[s,a,i]=re(l,b=>[b.menuState,b.itemsElement,b.buttonElement]),f=Q(t),c=xt.get(null),g=re(c,u.useCallback(b=>c.selectors.isTop(b,n),[c,n]));Yn(g,[i,a],(b,y)=>{var E;l.send({type:Y.CloseMenu}),Kt(y,Gt.Loose)||(b.preventDefault(),(E=l.state.buttonElement)==null||E.focus())});let p=C(()=>{l.send({type:Y.CloseMenu})}),h=ne({open:s===ae.Open,close:p}),m={ref:f},v=U();return u.createElement(ul,null,u.createElement(Dl.Provider,{value:l},u.createElement(on,{value:X(s,{[ae.Open]:Z.Open,[ae.Closed]:Z.Closed})},v({ourProps:m,theirProps:o,slot:h,defaultTag:hc,name:"Menu"}))))}let gc="button";function vc(e,t){let n=Sr("Menu.Button"),r=u.useId(),{id:o=`headlessui-menu-button-${r}`,disabled:l=!1,autoFocus:s=!1,...a}=e,i=u.useRef(null),f=nu(),c=Q(t,i,ll(),C(N=>n.send({type:Y.SetButtonElement,element:N}))),g=C(N=>{switch(N.key){case W.Space:case W.Enter:case W.ArrowDown:N.preventDefault(),N.stopPropagation(),n.send({type:Y.OpenMenu,focus:{focus:J.First}});break;case W.ArrowUp:N.preventDefault(),N.stopPropagation(),n.send({type:Y.OpenMenu,focus:{focus:J.Last}});break}}),p=C(N=>{switch(N.key){case W.Space:N.preventDefault();break}}),[h,m,v]=re(n,N=>[N.menuState,N.buttonElement,N.itemsElement]),b=h===ae.Open;Ea(b,{trigger:m,action:u.useCallback(N=>{if(m!=null&&m.contains(N.target))return Ut.Ignore;let F=N.target.closest('[role="menuitem"]:not([data-disabled])');return oe(F)?Ut.Select(F):v!=null&&v.contains(N.target)?Ut.Ignore:Ut.Close},[m,v]),close:u.useCallback(()=>n.send({type:Y.CloseMenu}),[]),select:u.useCallback(N=>N.click(),[])});let y=Rs(N=>{var F;l||(h===ae.Open?(pt.flushSync(()=>n.send({type:Y.CloseMenu})),(F=i.current)==null||F.focus({preventScroll:!0})):(N.preventDefault(),n.send({type:Y.OpenMenu,focus:{focus:J.Nothing},trigger:gn.Pointer})))}),{isFocusVisible:E,focusProps:x}=Fn({autoFocus:s}),{isHovered:k,hoverProps:$}=On({isDisabled:l}),{pressed:P,pressProps:O}=In({disabled:l}),D=ne({open:h===ae.Open,active:P||h===ae.Open,disabled:l,hover:k,focus:E,autofocus:s}),L=Ye(f(),{ref:c,id:o,type:Zn(e,i.current),"aria-haspopup":"menu","aria-controls":v==null?void 0:v.id,"aria-expanded":h===ae.Open,disabled:l||void 0,autoFocus:s,onKeyDown:g,onKeyUp:p},y,x,$,O);return U()({ourProps:L,theirProps:a,slot:D,defaultTag:gc,name:"Menu.Button"})}let bc="div",yc=we.RenderStrategy|we.Static;function wc(e,t){let n=u.useId(),{id:r=`headlessui-menu-items-${n}`,anchor:o,portal:l=!1,modal:s=!0,transition:a=!1,...i}=e,f=ol(o),c=Sr("Menu.Items"),[g,p]=al(f),h=sl(),[m,v]=u.useState(null),b=Q(t,f?g:null,C(S=>c.send({type:Y.SetItemsElement,element:S})),v),[y,E]=re(c,S=>[S.menuState,S.buttonElement]),x=Qe(E),k=Qe(m);f&&(l=!0);let $=We(),[P,O]=Nt(a,m,$!==null?($&Z.Open)===Z.Open:y===ae.Open);Un(P,E,()=>{c.send({type:Y.CloseMenu})});let D=re(c,S=>S.__demoMode),L=D?!1:s&&y===ae.Open;Qn(L,k);let N=D?!1:s&&y===ae.Open;vo(N,{allowed:u.useCallback(()=>[E,m],[E,m])});let F=re(c,c.selectors.didButtonMove)?!1:P;u.useEffect(()=>{let S=m;S&&y===ae.Open&&(Gr(S)||S.focus({preventScroll:!0}))},[y,m]),Da(y===ae.Open,{container:m,accept(S){return S.getAttribute("role")==="menuitem"?NodeFilter.FILTER_REJECT:S.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(S){S.setAttribute("role","none")}});let H=Ue(),j=C(S=>{var A,K,te;switch(H.dispose(),S.key){case W.Space:if(c.state.searchQuery!=="")return S.preventDefault(),S.stopPropagation(),c.send({type:Y.Search,value:S.key});case W.Enter:if(S.preventDefault(),S.stopPropagation(),c.state.activeItemIndex!==null){let{dataRef:me}=c.state.items[c.state.activeItemIndex];(K=(A=me.current)==null?void 0:A.domRef.current)==null||K.click()}c.send({type:Y.CloseMenu}),bo(c.state.buttonElement);break;case W.ArrowDown:return S.preventDefault(),S.stopPropagation(),c.send({type:Y.GoToItem,focus:J.Next});case W.ArrowUp:return S.preventDefault(),S.stopPropagation(),c.send({type:Y.GoToItem,focus:J.Previous});case W.Home:case W.PageUp:return S.preventDefault(),S.stopPropagation(),c.send({type:Y.GoToItem,focus:J.First});case W.End:case W.PageDown:return S.preventDefault(),S.stopPropagation(),c.send({type:Y.GoToItem,focus:J.Last});case W.Escape:S.preventDefault(),S.stopPropagation(),pt.flushSync(()=>c.send({type:Y.CloseMenu})),(te=c.state.buttonElement)==null||te.focus({preventScroll:!0});break;case W.Tab:S.preventDefault(),S.stopPropagation(),pt.flushSync(()=>c.send({type:Y.CloseMenu})),va(c.state.buttonElement,S.shiftKey?ee.Previous:ee.Next);break;default:S.key.length===1&&(c.send({type:Y.Search,value:S.key}),H.setTimeout(()=>c.send({type:Y.ClearSearch}),350));break}}),T=C(S=>{switch(S.key){case W.Space:S.preventDefault();break}}),z=ne({open:y===ae.Open}),_=Ye(f?h():{},{"aria-activedescendant":re(c,c.selectors.activeDescendantId),"aria-labelledby":re(c,S=>{var A;return(A=S.buttonElement)==null?void 0:A.id}),id:r,onKeyDown:j,onKeyUp:T,role:"menu",tabIndex:y===ae.Open?0:void 0,ref:b,style:{...i.style,...p,"--button-width":no(P,E,!0).width},...St(O)}),G=U();return u.createElement(fr,{enabled:l?e.static||P:!1,ownerDocument:x},G({ourProps:_,theirProps:i,slot:z,defaultTag:bc,features:yc,visible:F,name:"Menu.Items"}))}let xc=u.Fragment;function Ec(e,t){let n=u.useId(),{id:r=`headlessui-menu-item-${n}`,disabled:o=!1,...l}=e,s=Sr("Menu.Item"),a=re(s,F=>s.selectors.isActive(F,r)),i=u.useRef(null),f=Q(t,i),c=re(s,F=>s.selectors.shouldScrollIntoView(F,r));q(()=>{if(c)return ie().requestAnimationFrame(()=>{var F,H;(H=(F=i.current)==null?void 0:F.scrollIntoView)==null||H.call(F,{block:"nearest"})})},[c,i]);let g=uc(i),p=u.useRef({disabled:o,domRef:i,get textValue(){return g()}});q(()=>{p.current.disabled=o},[p,o]),q(()=>(s.actions.registerItem(r,p),()=>s.actions.unregisterItem(r)),[p,r]);let h=C(()=>{s.send({type:Y.CloseMenu})}),m=C(F=>{if(o)return F.preventDefault();s.send({type:Y.CloseMenu}),bo(s.state.buttonElement)}),v=C(()=>{if(o)return s.send({type:Y.GoToItem,focus:J.Nothing});s.send({type:Y.GoToItem,focus:J.Specific,id:r})}),b=Ta(),y=C(F=>b.update(F)),E=C(F=>{b.wasMoved(F)&&(o||a||s.send({type:Y.GoToItem,focus:J.Specific,id:r,trigger:gn.Pointer}))}),x=C(F=>{b.wasMoved(F)&&(o||a&&s.state.activationTrigger===gn.Pointer&&s.send({type:Y.GoToItem,focus:J.Nothing}))}),[k,$]=eo(),[P,O]=Rr(),D=ne({active:a,focus:a,disabled:o,close:h}),L={id:r,ref:f,role:"menuitem",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,"aria-labelledby":k,"aria-describedby":P,disabled:void 0,onClick:m,onFocus:v,onPointerEnter:y,onMouseEnter:y,onPointerMove:E,onMouseMove:E,onPointerLeave:x,onMouseLeave:x},N=U();return u.createElement($,null,u.createElement(O,null,N({ourProps:L,theirProps:l,slot:D,defaultTag:xc,name:"Menu.Item"})))}let kc="div";function $c(e,t){let[n,r]=eo(),o=e,l={ref:t,"aria-labelledby":n,role:"group"},s=U();return u.createElement(r,null,s({ourProps:l,theirProps:o,slot:{},defaultTag:kc,name:"Menu.Section"}))}let Sc="header";function Nc(e,t){let n=u.useId(),{id:r=`headlessui-menu-heading-${n}`,...o}=e,l=_n();q(()=>l.register(r),[r,l.register]);let s={id:r,ref:t,role:"presentation",...l.props};return U()({ourProps:s,theirProps:o,slot:{},defaultTag:Sc,name:"Menu.Heading"})}let Cc="div";function Pc(e,t){let n=e,r={ref:t,role:"separator"};return U()({ourProps:r,theirProps:n,slot:{},defaultTag:Cc,name:"Menu.Separator"})}let Tc=V(mc),_l=V(vc),Bl=V(wc),vn=V(Ec),Oc=V($c),Fc=V(Nc),Mc=V(Pc),Ic=Object.assign(Tc,{Button:_l,Items:Bl,Item:vn,Section:Oc,Heading:Fc,Separator:Mc});var Lc=Object.defineProperty,Ac=(e,t,n)=>t in e?Lc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Hl=(e,t,n)=>(Ac(e,typeof t!="symbol"?t+"":t,n),n),R=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(R||{}),Dc=(e=>(e[e.OpenPopover=0]="OpenPopover",e[e.ClosePopover=1]="ClosePopover",e[e.SetButton=2]="SetButton",e[e.SetButtonId=3]="SetButtonId",e[e.SetPanel=4]="SetPanel",e[e.SetPanelId=5]="SetPanelId",e))(Dc||{});let jc={0:e=>e.popoverState===0?e:{...e,popoverState:0,__demoMode:!1},1(e){return e.popoverState===1?e:{...e,popoverState:1,__demoMode:!1}},2(e,t){return e.button===t.button?e:{...e,button:t.button}},3(e,t){return e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId}},4(e,t){return e.panel===t.panel?e:{...e,panel:t.panel}},5(e,t){return e.panelId===t.panelId?e:{...e,panelId:t.panelId}}};class Nr extends Hn{constructor(t){super(t),Hl(this,"actions",{close:()=>this.send({type:1}),refocusableClose:n=>{this.actions.close();let r=n?oe(n)?n:"current"in n&&oe(n.current)?n.current:this.state.button:this.state.button;r==null||r.focus()},open:()=>this.send({type:0}),setButtonId:n=>this.send({type:3,buttonId:n}),setButton:n=>this.send({type:2,button:n}),setPanelId:n=>this.send({type:5,panelId:n}),setPanel:n=>this.send({type:4,panel:n})}),Hl(this,"selectors",{isPortalled:n=>{var r;if(!n.button||!n.panel)return!1;let o=(r=Fe(n.button))!=null?r:document;for(let g of o.querySelectorAll("body > *"))if(Number(g==null?void 0:g.contains(n.button))^Number(g==null?void 0:g.contains(n.panel)))return!0;let l=$t(o),s=l.indexOf(n.button),a=(s+l.length-1)%l.length,i=(s+1)%l.length,f=l[a],c=l[i];return!n.panel.contains(f)&&!n.panel.contains(c)}});{let n=this.state.id,r=xt.get(null);this.on(0,()=>r.actions.push(n)),this.on(1,()=>r.actions.pop(n))}}static new({id:t,__demoMode:n=!1}){return new Nr({id:t,__demoMode:n,popoverState:n?0:1,buttons:{current:[]},button:null,buttonId:null,panel:null,panelId:null,beforePanelSentinel:{current:null},afterPanelSentinel:{current:null},afterButtonSentinel:{current:null}})}reduce(t,n){return X(n.type,jc,t,n)}}const Vl=u.createContext(null);function bn(e){let t=u.useContext(Vl);if(t===null){let n=new Error(`<${e} /> is missing a parent <Popover /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,bn),n}return t}function _c({id:e,__demoMode:t=!1}){let n=u.useMemo(()=>Nr.new({id:e,__demoMode:t}),[]);return sn(()=>n.dispose()),n}let Cr=u.createContext(null);Cr.displayName="PopoverGroupContext";function Wl(){return u.useContext(Cr)}let yn=u.createContext(null);yn.displayName="PopoverPanelContext";function Bc(){return u.useContext(yn)}let Hc="div";function Vc(e,t){var n;let r=u.useId(),{__demoMode:o=!1,...l}=e,s=_c({id:r,__demoMode:o}),a=u.useRef(null),i=Q(t,Dn(T=>{a.current=T})),[f,c,g,p,h]=re(s,u.useCallback(T=>[T.popoverState,T.button,T.panel,T.buttonId,T.panelId],[])),m=ya((n=a.current)!=null?n:c),v=Me(p),b=Me(h),y=u.useMemo(()=>({buttonId:v,panelId:b,close:s.actions.close}),[v,b,s]),E=Wl(),x=E==null?void 0:E.registerPopover,k=C(()=>{var T,z;let _=_e((T=a.current)!=null?T:c);return(z=E==null?void 0:E.isFocusWithinPopoverGroup())!=null?z:_&&((c==null?void 0:c.contains(_))||(g==null?void 0:g.contains(_)))});u.useEffect(()=>x==null?void 0:x(y),[x,y]);let[$,P]=gl(),O=pr(c),D=yl({mainTreeNode:O,portals:$,defaultContainers:[{get current(){return s.state.button}},{get current(){return s.state.panel}}]});qn(m,"focus",T=>{var z,_,G,S,A,K;T.target!==window&&de(T.target)&&s.state.popoverState===R.Open&&(k()||s.state.button&&s.state.panel&&(D.contains(T.target)||(_=(z=s.state.beforePanelSentinel.current)==null?void 0:z.contains)!=null&&_.call(z,T.target)||(S=(G=s.state.afterPanelSentinel.current)==null?void 0:G.contains)!=null&&S.call(G,T.target)||(K=(A=s.state.afterButtonSentinel.current)==null?void 0:A.contains)!=null&&K.call(A,T.target)||s.actions.close()))},!0);let L=f===R.Open;Yn(L,D.resolveContainers,(T,z)=>{s.actions.close(),Kt(z,Gt.Loose)||(T.preventDefault(),c==null||c.focus())});let N=ne({open:f===R.Open,close:s.actions.refocusableClose}),F=re(s,u.useCallback(T=>X(T.popoverState,{[R.Open]:Z.Open,[R.Closed]:Z.Closed}),[])),H={ref:i},j=U();return u.createElement(un,{node:O},u.createElement(ul,null,u.createElement(yn.Provider,{value:null},u.createElement(Vl.Provider,{value:s},u.createElement(Wt,{value:s.actions.refocusableClose},u.createElement(on,{value:F},u.createElement(P,null,j({ourProps:H,theirProps:l,slot:N,defaultTag:Hc,name:"Popover"}))))))))}let Wc="button";function zc(e,t){let n=u.useId(),{id:r=`headlessui-popover-button-${n}`,disabled:o=!1,autoFocus:l=!1,...s}=e,a=bn("Popover.Button"),[i,f,c,g,p,h,m]=re(a,u.useCallback(I=>[I.popoverState,a.selectors.isPortalled(I),I.button,I.buttonId,I.panel,I.panelId,I.afterButtonSentinel],[])),v=u.useRef(null),b=`headlessui-focus-sentinel-${u.useId()}`,y=Wl(),E=y==null?void 0:y.closeOthers,x=Bc()!==null;u.useEffect(()=>{if(!x)return a.actions.setButtonId(r),()=>a.actions.setButtonId(null)},[x,r,a]);let[k]=u.useState(()=>Symbol()),$=Q(v,t,ll(),C(I=>{if(!x){if(I)a.state.buttons.current.push(k);else{let B=a.state.buttons.current.indexOf(k);B!==-1&&a.state.buttons.current.splice(B,1)}a.state.buttons.current.length>1&&console.warn("You are already using a <Popover.Button /> but only 1 <Popover.Button /> is supported."),I&&a.actions.setButton(I)}})),P=Q(v,t),O=C(I=>{var B,ue,ce;if(x){if(a.state.popoverState===R.Closed)return;switch(I.key){case W.Space:case W.Enter:I.preventDefault(),(ue=(B=I.target).click)==null||ue.call(B),a.actions.close(),(ce=a.state.button)==null||ce.focus();break}}else switch(I.key){case W.Space:case W.Enter:I.preventDefault(),I.stopPropagation(),a.state.popoverState===R.Closed?(E==null||E(a.state.buttonId),a.actions.open()):a.actions.close();break;case W.Escape:if(a.state.popoverState!==R.Open)return E==null?void 0:E(a.state.buttonId);if(!v.current)return;let ge=_e(v.current);if(ge&&!v.current.contains(ge))return;I.preventDefault(),I.stopPropagation(),a.actions.close();break}}),D=C(I=>{x||I.key===W.Space&&I.preventDefault()}),L=C(I=>{var B,ue;bt(I.currentTarget)||o||(x?(a.actions.close(),(B=a.state.button)==null||B.focus()):(I.preventDefault(),I.stopPropagation(),a.state.popoverState===R.Closed?(E==null||E(a.state.buttonId),a.actions.open()):a.actions.close(),(ue=a.state.button)==null||ue.focus()))}),N=C(I=>{I.preventDefault(),I.stopPropagation()}),{isFocusVisible:F,focusProps:H}=Fn({autoFocus:l}),{isHovered:j,hoverProps:T}=On({isDisabled:o}),{pressed:z,pressProps:_}=In({disabled:o}),G=i===R.Open,S=ne({open:G,active:z||G,disabled:o,hover:j,focus:F,autofocus:l}),A=Zn(e,c),K=Ye(x?{ref:P,type:A,onKeyDown:O,onClick:L,disabled:o||void 0,autoFocus:l}:{ref:$,id:g,type:A,"aria-expanded":i===R.Open,"aria-controls":p?h:void 0,disabled:o||void 0,autoFocus:l,onKeyDown:O,onKeyUp:D,onClick:L,onMouseDown:N},H,T,_),te=mr(),me=C(()=>{if(!oe(a.state.panel))return;let I=a.state.panel;function B(){X(te.current,{[he.Forwards]:()=>fe(I,ee.First),[he.Backwards]:()=>fe(I,ee.Last)})===rt.Error&&fe($t(je(a.state.button)).filter(ue=>ue.dataset.headlessuiFocusGuard!=="true"),X(te.current,{[he.Forwards]:ee.Next,[he.Backwards]:ee.Previous}),{relativeTo:a.state.button})}B()}),M=U();return u.createElement(u.Fragment,null,M({ourProps:K,theirProps:s,slot:S,defaultTag:Wc,name:"Popover.Button"}),G&&!x&&f&&u.createElement(nt,{id:b,ref:m,features:Ze.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:me}))}let Gc="div",Kc=we.RenderStrategy|we.Static;function zl(e,t){let n=u.useId(),{id:r=`headlessui-popover-backdrop-${n}`,transition:o=!1,...l}=e,s=bn("Popover.Backdrop"),a=re(s,u.useCallback(y=>y.popoverState,[])),[i,f]=u.useState(null),c=Q(t,f),g=We(),[p,h]=Nt(o,i,g!==null?(g&Z.Open)===Z.Open:a===R.Open),m=C(y=>{if(bt(y.currentTarget))return y.preventDefault();s.actions.close()}),v=ne({open:a===R.Open}),b={ref:c,id:r,"aria-hidden":!0,onClick:m,...St(h)};return U()({ourProps:b,theirProps:l,slot:v,defaultTag:Gc,features:Kc,visible:p,name:"Popover.Backdrop"})}let Uc="div",Yc=we.RenderStrategy|we.Static;function qc(e,t){let n=u.useId(),{id:r=`headlessui-popover-panel-${n}`,focus:o=!1,anchor:l,portal:s=!1,modal:a=!1,transition:i=!1,...f}=e,c=bn("Popover.Panel"),g=re(c,c.selectors.isPortalled),[p,h,m,v,b]=re(c,u.useCallback(M=>[M.popoverState,M.button,M.__demoMode,M.beforePanelSentinel,M.afterPanelSentinel],[])),y=`headlessui-focus-sentinel-before-${n}`,E=`headlessui-focus-sentinel-after-${n}`,x=u.useRef(null),k=ol(l),[$,P]=al(k),O=sl();k&&(s=!0);let[D,L]=u.useState(null),N=Q(x,t,k?$:null,c.actions.setPanel,L),F=Qe(h),H=Qe(x.current);q(()=>(c.actions.setPanelId(r),()=>c.actions.setPanelId(null)),[r,c]);let j=We(),[T,z]=Nt(i,D,j!==null?(j&Z.Open)===Z.Open:p===R.Open);Un(T,h,c.actions.close),Qn(m?!1:a&&T,H);let _=C(M=>{var I;switch(M.key){case W.Escape:if(c.state.popoverState!==R.Open||!x.current)return;let B=_e(x.current);if(B&&!x.current.contains(B))return;M.preventDefault(),M.stopPropagation(),c.actions.close(),(I=c.state.button)==null||I.focus();break}});u.useEffect(()=>{var M;e.static||p===R.Closed&&((M=e.unmount)==null||M)&&c.actions.setPanel(null)},[p,e.unmount,e.static,c]),u.useEffect(()=>{if(m||!o||p!==R.Open||!x.current)return;let M=_e(x.current);x.current.contains(M)||fe(x.current,ee.First)},[m,o,x.current,p]);let G=ne({open:p===R.Open,close:c.actions.refocusableClose}),S=Ye(k?O():{},{ref:N,id:r,onKeyDown:_,onBlur:o&&p===R.Open?M=>{var I,B,ue,ce,ge;let ve=M.relatedTarget;ve&&x.current&&((I=x.current)!=null&&I.contains(ve)||(c.actions.close(),((ue=(B=v.current)==null?void 0:B.contains)!=null&&ue.call(B,ve)||(ge=(ce=b.current)==null?void 0:ce.contains)!=null&&ge.call(ce,ve))&&ve.focus({preventScroll:!0})))}:void 0,tabIndex:-1,style:{...f.style,...P,"--button-width":no(T,h,!0).width},...St(z)}),A=mr(),K=C(()=>{let M=x.current;if(!M)return;function I(){X(A.current,{[he.Forwards]:()=>{var B;fe(M,ee.First)===rt.Error&&((B=c.state.afterPanelSentinel.current)==null||B.focus())},[he.Backwards]:()=>{var B;(B=c.state.button)==null||B.focus({preventScroll:!0})}})}I()}),te=C(()=>{let M=x.current;if(!M)return;function I(){X(A.current,{[he.Forwards]:()=>{var B;if(!c.state.button)return;let ue=(B=je(c.state.button))!=null?B:document.body,ce=$t(ue),ge=ce.indexOf(c.state.button),ve=ce.slice(0,ge+1),xn=[...ce.slice(ge+1),...ve];for(let Or of xn.slice())if(Or.dataset.headlessuiFocusGuard==="true"||D!=null&&D.contains(Or)){let Zl=xn.indexOf(Or);Zl!==-1&&xn.splice(Zl,1)}fe(xn,ee.First,{sorted:!1})},[he.Backwards]:()=>{var B;fe(M,ee.Previous)===rt.Error&&((B=c.state.button)==null||B.focus())}})}I()}),me=U();return u.createElement(cr,null,u.createElement(yn.Provider,{value:r},u.createElement(Wt,{value:c.actions.refocusableClose},u.createElement(fr,{enabled:s?e.static||T:!1,ownerDocument:F},T&&g&&u.createElement(nt,{id:y,ref:v,features:Ze.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:K}),me({ourProps:S,theirProps:f,slot:G,defaultTag:Uc,features:Yc,visible:T,name:"Popover.Panel"}),T&&g&&u.createElement(nt,{id:E,ref:b,features:Ze.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:te})))))}let Zc="div";function Qc(e,t){let n=u.useRef(null),r=Q(n,t),[o,l]=u.useState([]),s=C(v=>{l(b=>{let y=b.indexOf(v);if(y!==-1){let E=b.slice();return E.splice(y,1),E}return b})}),a=C(v=>(l(b=>[...b,v]),()=>s(v))),i=C(()=>{var v;let b=je(n.current);if(!b)return!1;let y=_e(n.current);return(v=n.current)!=null&&v.contains(y)?!0:o.some(E=>{var x,k;return((x=b.getElementById(E.buttonId.current))==null?void 0:x.contains(y))||((k=b.getElementById(E.panelId.current))==null?void 0:k.contains(y))})}),f=C(v=>{for(let b of o)b.buttonId.current!==v&&b.close()}),c=u.useMemo(()=>({registerPopover:a,unregisterPopover:s,isFocusWithinPopoverGroup:i,closeOthers:f}),[a,s,i,f]),g=ne({}),p=e,h={ref:r},m=U();return u.createElement(un,null,u.createElement(Cr.Provider,{value:c},m({ourProps:h,theirProps:p,slot:g,defaultTag:Zc,name:"Popover.Group"})))}let Xc=V(Vc),ct=V(zc),Jc=V(zl),Rc=V(zl),dt=V(qc),Pr=V(Qc),Mt=Object.assign(Xc,{Button:ct,Backdrop:Rc,Overlay:Jc,Panel:dt,Group:Pr});function ed({title:e,titleId:t,...n},r){return w.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?w.createElement("title",{id:t},e):null,w.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"}))}const td=w.forwardRef(ed);function nd({title:e,titleId:t,...n},r){return w.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?w.createElement("title",{id:t},e):null,w.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"}))}const Tr=w.forwardRef(nd);function rd({title:e,titleId:t,...n},r){return w.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?w.createElement("title",{id:t},e):null,w.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.857 17.082a23.848 23.848 0 0 0 5.454-1.31A8.967 8.967 0 0 1 18 9.75V9A6 6 0 0 0 6 9v.75a8.967 8.967 0 0 1-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 0 1-5.714 0m5.714 0a3 3 0 1 1-5.714 0"}))}const Gl=w.forwardRef(rd);function od({title:e,titleId:t,...n},r){return w.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?w.createElement("title",{id:t},e):null,w.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 14.15v4.25c0 1.094-.787 2.036-1.872 2.18-2.087.277-4.216.42-6.378.42s-4.291-.143-6.378-.42c-1.085-.144-1.872-1.086-1.872-2.18v-4.25m16.5 0a2.18 2.18 0 0 0 .75-1.661V8.706c0-1.081-.768-2.015-1.837-2.175a48.114 48.114 0 0 0-3.413-.387m4.5 8.006c-.194.165-.42.295-.673.38A23.978 23.978 0 0 1 12 15.75c-2.648 0-5.195-.429-7.577-1.22a2.016 2.016 0 0 1-.673-.38m0 0A2.18 2.18 0 0 1 3 12.489V8.706c0-1.081.768-2.015 1.837-2.175a48.111 48.111 0 0 1 3.413-.387m7.5 0V5.25A2.25 2.25 0 0 0 13.5 3h-3a2.25 2.25 0 0 0-2.25 2.25v.894m7.5 0a48.667 48.667 0 0 0-7.5 0M12 12.75h.008v.008H12v-.008Z"}))}const ld=w.forwardRef(od);function sd({title:e,titleId:t,...n},r){return w.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?w.createElement("title",{id:t},e):null,w.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 6a7.5 7.5 0 1 0 7.5 7.5h-7.5V6Z"}),w.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 10.5H21A7.5 7.5 0 0 0 13.5 3v7.5Z"}))}const ad=w.forwardRef(sd);function id({title:e,titleId:t,...n},r){return w.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?w.createElement("title",{id:t},e):null,w.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 7.5-2.25-1.313M21 7.5v2.25m0-2.25-2.25 1.313M3 7.5l2.25-1.313M3 7.5l2.25 1.313M3 7.5v2.25m9 3 2.25-1.313M12 12.75l-2.25-1.313M12 12.75V15m0 6.75 2.25-1.313M12 21.75V19.5m0 2.25-2.25-1.313m0-16.875L12 2.25l2.25 1.313M21 14.25v2.25l-2.25 1.313m-13.5 0L3 16.5v-2.25"}))}const ud=w.forwardRef(id);function cd({title:e,titleId:t,...n},r){return w.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?w.createElement("title",{id:t},e):null,w.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.042 21.672 13.684 16.6m0 0-2.51 2.225.569-9.47 5.227 7.917-3.286-.672ZM12 2.25V4.5m5.834.166-1.591 1.591M20.25 10.5H18M7.757 14.743l-1.59 1.59M6 10.5H3.75m4.007-4.243-1.59-1.59"}))}const dd=w.forwardRef(cd);function fd({title:e,titleId:t,...n},r){return w.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?w.createElement("title",{id:t},e):null,w.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.864 4.243A7.5 7.5 0 0 1 19.5 10.5c0 2.92-.556 5.709-1.568 8.268M5.742 6.364A7.465 7.465 0 0 0 4.5 10.5a7.464 7.464 0 0 1-1.15 3.993m1.989 3.559A11.209 11.209 0 0 0 8.25 10.5a3.75 3.75 0 1 1 7.5 0c0 .527-.021 1.049-.064 1.565M12 10.5a14.94 14.94 0 0 1-3.6 9.75m6.633-4.596a18.666 18.666 0 0 1-2.485 5.33"}))}const pd=w.forwardRef(fd);function hd({title:e,titleId:t,...n},r){return w.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?w.createElement("title",{id:t},e):null,w.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"}))}const Kl=w.forwardRef(hd);function md({title:e,titleId:t,...n},r){return w.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?w.createElement("title",{id:t},e):null,w.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 10.5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}),w.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 10.5c0 7.142-7.5 11.25-7.5 11.25S4.5 17.642 4.5 10.5a7.5 7.5 0 1 1 15 0Z"}))}const gd=w.forwardRef(md);function vd({title:e,titleId:t,...n},r){return w.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?w.createElement("title",{id:t},e):null,w.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 7.5h1.5m-1.5 3h1.5m-7.5 3h7.5m-7.5 3h7.5m3-9h3.375c.621 0 1.125.504 1.125 1.125V18a2.25 2.25 0 0 1-2.25 2.25M16.5 7.5V18a2.25 2.25 0 0 0 2.25 2.25M16.5 7.5V4.875c0-.621-.504-1.125-1.125-1.125H4.125C3.504 3.75 3 4.254 3 4.875V18a2.25 2.25 0 0 0 2.25 2.25h13.5M6 7.5h3v3H6v-3Z"}))}const bd=w.forwardRef(vd);function yd({title:e,titleId:t,...n},r){return w.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?w.createElement("title",{id:t},e):null,w.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m2.25 15.75 5.159-5.159a2.25 2.25 0 0 1 3.182 0l5.159 5.159m-1.5-1.5 1.409-1.409a2.25 2.25 0 0 1 3.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 0 0 1.5-1.5V6a1.5 1.5 0 0 0-1.5-1.5H3.75A1.5 1.5 0 0 0 2.25 6v12a1.5 1.5 0 0 0 1.5 1.5Zm10.5-11.25h.008v.008h-.008V8.25Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z"}))}const wd=w.forwardRef(yd);function xd({title:e,titleId:t,...n},r){return w.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?w.createElement("title",{id:t},e):null,w.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 5.25h.008v.008H12v-.008Z"}))}const Ed=w.forwardRef(xd);function kd({title:e,titleId:t,...n},r){return w.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?w.createElement("title",{id:t},e):null,w.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 16.875h3.375m0 0h3.375m-3.375 0V13.5m0 3.375v3.375M6 10.5h2.25a2.25 2.25 0 0 0 2.25-2.25V6a2.25 2.25 0 0 0-2.25-2.25H6A2.25 2.25 0 0 0 3.75 6v2.25A2.25 2.25 0 0 0 6 10.5Zm0 9.75h2.25A2.25 2.25 0 0 0 10.5 18v-2.25a2.25 2.25 0 0 0-2.25-2.25H6a2.25 2.25 0 0 0-2.25 2.25V18A2.25 2.25 0 0 0 6 20.25Zm9.75-9.75H18a2.25 2.25 0 0 0 2.25-2.25V6A2.25 2.25 0 0 0 18 3.75h-2.25A2.25 2.25 0 0 0 13.5 6v2.25a2.25 2.25 0 0 0 2.25 2.25Z"}))}const $d=w.forwardRef(kd);function Sd({title:e,titleId:t,...n},r){return w.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?w.createElement("title",{id:t},e):null,w.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"}))}const wn=w.forwardRef(Sd);function Nd({title:e,titleId:t,...n},r){return w.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?w.createElement("title",{id:t},e):null,w.createElement("path",{fillRule:"evenodd",d:"M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}const ft=w.forwardRef(Nd);function Cd({title:e,titleId:t,...n},r){return w.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?w.createElement("title",{id:t},e):null,w.createElement("path",{fillRule:"evenodd",d:"M2 3.5A1.5 1.5 0 0 1 3.5 2h1.148a1.5 1.5 0 0 1 1.465 1.175l.716 3.223a1.5 1.5 0 0 1-1.052 1.767l-.933.267c-.41.117-.643.555-.48.95a11.542 11.542 0 0 0 6.254 6.254c.395.163.833-.07.95-.48l.267-.933a1.5 1.5 0 0 1 1.767-1.052l3.223.716A1.5 1.5 0 0 1 18 15.352V16.5a1.5 1.5 0 0 1-1.5 1.5H15c-1.149 0-2.263-.15-3.326-.43A13.022 13.022 0 0 1 2.43 8.326 13.019 13.019 0 0 1 2 5V3.5Z",clipRule:"evenodd"}))}const Pd=w.forwardRef(Cd);function Td({title:e,titleId:t,...n},r){return w.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?w.createElement("title",{id:t},e):null,w.createElement("path",{fillRule:"evenodd",d:"M2 10a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm6.39-2.908a.75.75 0 0 1 .766.027l3.5 2.25a.75.75 0 0 1 0 1.262l-3.5 2.25A.75.75 0 0 1 8 12.25v-4.5a.75.75 0 0 1 .39-.658Z",clipRule:"evenodd"}))}const Od=w.forwardRef(Td);function Fd({title:e,titleId:t,...n},r){return w.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?w.createElement("title",{id:t},e):null,w.createElement("path",{d:"M10.75 4.75a.75.75 0 0 0-1.5 0v4.5h-4.5a.75.75 0 0 0 0 1.5h4.5v4.5a.75.75 0 0 0 1.5 0v-4.5h4.5a.75.75 0 0 0 0-1.5h-4.5v-4.5Z"}))}const Md=w.forwardRef(Fd);function Id({title:e,titleId:t,...n},r){return w.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?w.createElement("title",{id:t},e):null,w.createElement("path",{fillRule:"evenodd",d:"M14.5 10a4.5 4.5 0 0 0 4.284-5.882c-.105-.324-.51-.391-.752-.15L15.34 6.66a.454.454 0 0 1-.493.11 3.01 3.01 0 0 1-1.618-1.616.455.455 0 0 1 .11-.494l2.694-2.692c.24-.241.174-.647-.15-.752a4.5 4.5 0 0 0-5.873 4.575c.055.873-.128 1.808-.8 2.368l-7.23 6.024a2.724 2.724 0 1 0 3.837 3.837l6.024-7.23c.56-.672 1.495-.855 2.368-.8.096.007.193.01.291.01ZM5 16a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z",clipRule:"evenodd"}),w.createElement("path",{d:"M14.5 11.5c.173 0 .345-.007.514-.022l3.754 3.754a2.5 2.5 0 0 1-3.536 3.536l-4.41-4.41 2.172-2.607c.052-.063.147-.138.342-.196.202-.06.469-.087.777-.067.128.008.257.012.387.012ZM6 4.586l2.33 2.33a.452.452 0 0 1-.08.09L6.8 8.214 4.586 6H3.309a.5.5 0 0 1-.447-.276l-1.7-3.402a.5.5 0 0 1 .093-.577l.49-.49a.5.5 0 0 1 .577-.094l3.402 1.7A.5.5 0 0 1 6 3.31v1.277Z"}))}const Ld=w.forwardRef(Id),Ul=[{name:"Analytics",description:"Get a better understanding of your traffic",href:"#",icon:ad},{name:"Engagement",description:"Speak directly to your customers",href:"#",icon:dd},{name:"Security",description:"Your customers’ data will be safe and secure",href:"#",icon:pd},{name:"Integrations",description:"Connect with third-party tools",href:"#",icon:$d},{name:"Automations",description:"Build strategic funnels that will convert",href:"#",icon:td}],Ad=[{name:"Watch demo",href:"#",icon:Od},{name:"Contact sales",href:"#",icon:Pd}],Yl=[{name:"About us",href:"#",description:"Learn more about our company values and mission to empower others"},{name:"Careers",href:"#",description:"Looking for you next career opportunity? See all of our open positions"},{name:"Support",href:"#",description:"Get in touch with our dedicated support team or reach out on our community forums"},{name:"Blog",href:"#",description:"Read our latest announcements and get perspectives from our team"}];function Dd(){const[e,t]=u.useState(!1);return d.jsxs("header",{className:"bg-white dark:bg-gray-900",children:[d.jsxs("nav",{"aria-label":"Global",className:"mx-auto flex max-w-7xl items-center justify-between p-6 lg:px-8",children:[d.jsx("div",{className:"flex lg:flex-1",children:d.jsxs("a",{href:"#",className:"-m-1.5 p-1.5",children:[d.jsx("span",{className:"sr-only",children:"Your Company"}),d.jsx("img",{alt:"",src:"https://tailwindcss.com/plus-assets/img/logos/mark.svg?color=indigo&shade=600",className:"h-8 w-auto dark:hidden"}),d.jsx("img",{alt:"",src:"https://tailwindcss.com/plus-assets/img/logos/mark.svg?color=indigo&shade=500",className:"hidden h-8 w-auto dark:block"})]})}),d.jsx("div",{className:"flex lg:hidden",children:d.jsxs("button",{type:"button",onClick:()=>t(!0),className:"-m-2.5 inline-flex items-center justify-center rounded-md p-2.5 text-gray-700 dark:text-gray-400",children:[d.jsx("span",{className:"sr-only",children:"Open main menu"}),d.jsx(Tr,{"aria-hidden":"true",className:"size-6"})]})}),d.jsxs(Pr,{className:"hidden lg:flex lg:gap-x-12",children:[d.jsxs(Mt,{className:"relative",children:[d.jsxs(ct,{className:"flex items-center gap-x-1 text-sm/6 font-semibold text-gray-900 dark:text-white",children:["Product",d.jsx(ft,{"aria-hidden":"true",className:"size-5 flex-none text-gray-400 dark:text-gray-500"})]}),d.jsxs(dt,{transition:!0,className:"absolute left-1/2 z-10 mt-3 w-screen max-w-md -translate-x-1/2 overflow-hidden rounded-3xl bg-white shadow-lg outline outline-1 outline-gray-900/5 transition data-[closed]:translate-y-1 data-[closed]:opacity-0 data-[enter]:duration-200 data-[leave]:duration-150 data-[enter]:ease-out data-[leave]:ease-in dark:bg-gray-800 dark:shadow-none dark:-outline-offset-1 dark:outline-white/10",children:[d.jsx("div",{className:"p-4",children:Ul.map(n=>d.jsxs("div",{className:"group relative flex items-center gap-x-6 rounded-lg p-4 text-sm/6 hover:bg-gray-50 dark:hover:bg-white/5",children:[d.jsx("div",{className:"flex size-11 flex-none items-center justify-center rounded-lg bg-gray-50 group-hover:bg-white dark:bg-gray-700/50 dark:group-hover:bg-gray-700",children:d.jsx(n.icon,{"aria-hidden":"true",className:"size-6 text-gray-600 group-hover:text-indigo-600 dark:text-gray-400 dark:group-hover:text-white"})}),d.jsxs("div",{className:"flex-auto",children:[d.jsxs("a",{href:n.href,className:"block font-semibold text-gray-900 dark:text-white",children:[n.name,d.jsx("span",{className:"absolute inset-0"})]}),d.jsx("p",{className:"mt-1 text-gray-600 dark:text-gray-400",children:n.description})]})]},n.name))}),d.jsx("div",{className:"grid grid-cols-2 divide-x divide-gray-900/5 bg-gray-50 dark:divide-white/10 dark:bg-gray-700/50",children:Ad.map(n=>d.jsxs("a",{href:n.href,className:"flex items-center justify-center gap-x-2.5 p-3 text-sm/6 font-semibold text-gray-900 hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700/50",children:[d.jsx(n.icon,{"aria-hidden":"true",className:"size-5 flex-none text-gray-400 dark:text-gray-500"}),n.name]},n.name))})]})]}),d.jsx("a",{href:"#",className:"text-sm/6 font-semibold text-gray-900 dark:text-white",children:"Features"}),d.jsx("a",{href:"#",className:"text-sm/6 font-semibold text-gray-900 dark:text-white",children:"Marketplace"}),d.jsxs(Mt,{className:"relative",children:[d.jsxs(ct,{className:"flex items-center gap-x-1 text-sm/6 font-semibold text-gray-900 dark:text-white",children:["Company",d.jsx(ft,{"aria-hidden":"true",className:"size-5 flex-none text-gray-400 dark:text-gray-500"})]}),d.jsx(dt,{transition:!0,className:"absolute left-1/2 z-10 mt-3 w-96 -translate-x-1/2 rounded-3xl bg-white p-4 shadow-lg outline outline-1 outline-gray-900/5 transition data-[closed]:translate-y-1 data-[closed]:opacity-0 data-[enter]:duration-200 data-[leave]:duration-150 data-[enter]:ease-out data-[leave]:ease-in dark:bg-gray-800 dark:-outline-offset-1 dark:outline-white/10",children:Yl.map(n=>d.jsxs("div",{className:"relative rounded-lg p-4 hover:bg-gray-50 dark:hover:bg-white/5",children:[d.jsxs("a",{href:n.href,className:"block text-sm/6 font-semibold text-gray-900 dark:text-white",children:[n.name,d.jsx("span",{className:"absolute inset-0"})]}),d.jsx("p",{className:"mt-1 text-sm/6 text-gray-600 dark:text-gray-400",children:n.description})]},n.name))})]})]}),d.jsx("div",{className:"hidden lg:flex lg:flex-1 lg:justify-end",children:d.jsxs("a",{href:"#",className:"text-sm/6 font-semibold text-gray-900 dark:text-white",children:["Log in ",d.jsx("span",{"aria-hidden":"true",children:"→"})]})})]}),d.jsxs(yr,{open:e,onClose:t,className:"lg:hidden",children:[d.jsx("div",{className:"fixed inset-0 z-10"}),d.jsxs(mn,{className:"fixed inset-y-0 right-0 z-10 flex w-full flex-col justify-between overflow-y-auto bg-white sm:max-w-sm sm:ring-1 sm:ring-gray-900/10 dark:bg-gray-900 dark:sm:ring-white/10",children:[d.jsxs("div",{className:"p-6",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("a",{href:"#",className:"-m-1.5 p-1.5",children:[d.jsx("span",{className:"sr-only",children:"Your Company"}),d.jsx("img",{alt:"",src:"https://tailwindcss.com/plus-assets/img/logos/mark.svg?color=indigo&shade=600",className:"h-8 w-auto dark:hidden"}),d.jsx("img",{alt:"",src:"https://tailwindcss.com/plus-assets/img/logos/mark.svg?color=indigo&shade=500",className:"hidden h-8 w-auto dark:block"})]}),d.jsxs("button",{type:"button",onClick:()=>t(!1),className:"-m-2.5 rounded-md p-2.5 text-gray-700 dark:text-gray-400",children:[d.jsx("span",{className:"sr-only",children:"Close menu"}),d.jsx(wn,{"aria-hidden":"true",className:"size-6"})]})]}),d.jsx("div",{className:"mt-6 flow-root",children:d.jsxs("div",{className:"-my-6 divide-y divide-gray-500/10 dark:divide-white/10",children:[d.jsx("div",{className:"space-y-2 py-6",children:Ul.map(n=>d.jsxs("a",{href:n.href,className:"group -mx-3 flex items-center gap-x-6 rounded-lg p-3 text-base/7 font-semibold text-gray-900 hover:bg-gray-50 dark:text-white dark:hover:bg-white/5",children:[d.jsx("div",{className:"flex size-11 flex-none items-center justify-center rounded-lg bg-gray-50 group-hover:bg-white dark:bg-gray-800 dark:group-hover:bg-gray-700",children:d.jsx(n.icon,{"aria-hidden":"true",className:"size-6 text-gray-600 group-hover:text-indigo-600 dark:text-gray-300 dark:group-hover:text-white"})}),n.name]},n.name))}),d.jsxs("div",{className:"space-y-2 py-6",children:[d.jsx("a",{href:"#",className:"-mx-3 block rounded-lg px-3 py-2 text-base/7 font-semibold text-gray-900 hover:bg-gray-50 dark:text-white dark:hover:bg-white/5",children:"Features"}),d.jsx("a",{href:"#",className:"-mx-3 block rounded-lg px-3 py-2 text-base/7 font-semibold text-gray-900 hover:bg-gray-50 dark:text-white dark:hover:bg-white/5",children:"Marketplace"}),Yl.map(n=>d.jsx("a",{href:n.href,className:"-mx-3 block rounded-lg px-3 py-2 text-base/7 font-semibold text-gray-900 hover:bg-gray-50 dark:text-white dark:hover:bg-white/5",children:n.name},n.name))]}),d.jsx("div",{className:"py-6",children:d.jsx("a",{href:"#",className:"-mx-3 block rounded-lg px-3 py-2.5 text-base/7 font-semibold text-gray-900 hover:bg-gray-50 dark:text-white dark:hover:bg-white/5",children:"Log in"})})]})})]}),d.jsx("div",{className:"sticky bottom-0 grid grid-cols-2 divide-x divide-gray-900/5 bg-gray-50 text-center dark:divide-white/5 dark:bg-gray-800/50",children:item.ctas.map(n=>d.jsx("a",{href:n.href,className:"p-3 text-base/7 font-semibold text-gray-900 hover:bg-gray-100 dark:text-white dark:hover:bg-gray-800",children:n.title},n.title))})]})]})]})}function jd(){return d.jsxs(Fl,{as:"nav",className:"relative bg-white shadow dark:bg-gray-800/50 dark:shadow-none dark:after:pointer-events-none dark:after:absolute dark:after:inset-x-0 dark:after:bottom-0 dark:after:h-px dark:after:bg-white/10",children:[d.jsx("div",{className:"mx-auto max-w-7xl px-4 sm:px-6 lg:px-8",children:d.jsxs("div",{className:"flex h-16 justify-between",children:[d.jsxs("div",{className:"flex",children:[d.jsx("div",{className:"-ml-2 mr-2 flex items-center md:hidden",children:d.jsxs(ke,{className:"group relative inline-flex items-center justify-center rounded-md p-2 text-gray-400 hover:bg-gray-100 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-indigo-600 dark:hover:bg-white/5 dark:hover:text-white dark:focus:ring-white",children:[d.jsx("span",{className:"absolute -inset-0.5"}),d.jsx("span",{className:"sr-only",children:"Open main menu"}),d.jsx(Tr,{"aria-hidden":"true",className:"block size-6 group-data-[open]:hidden"}),d.jsx(wn,{"aria-hidden":"true",className:"hidden size-6 group-data-[open]:block"})]})}),d.jsxs("div",{className:"flex shrink-0 items-center",children:[d.jsx("img",{alt:"Your Company",src:"https://tailwindcss.com/plus-assets/img/logos/mark.svg?color=indigo&shade=600",className:"h-8 w-auto dark:hidden"}),d.jsx("img",{alt:"Your Company",src:"https://tailwindcss.com/plus-assets/img/logos/mark.svg?color=indigo&shade=500",className:"hidden h-8 w-auto dark:block"})]}),d.jsxs("div",{className:"hidden md:ml-6 md:flex md:space-x-8",children:[d.jsx("a",{href:"#",className:"inline-flex items-center border-b-2 border-indigo-600 px-1 pt-1 text-sm font-medium text-gray-900 dark:border-indigo-500 dark:text-white",children:"Dashboard"}),d.jsx("a",{href:"#",className:"inline-flex items-center border-b-2 border-transparent px-1 pt-1 text-sm font-medium text-gray-500 hover:border-gray-300 hover:text-gray-700 dark:text-gray-300 dark:hover:border-white/20 dark:hover:text-white",children:"Team"}),d.jsx("a",{href:"#",className:"inline-flex items-center border-b-2 border-transparent px-1 pt-1 text-sm font-medium text-gray-500 hover:border-gray-300 hover:text-gray-700 dark:text-gray-300 dark:hover:border-white/20 dark:hover:text-white",children:"Projects"}),d.jsx("a",{href:"#",className:"inline-flex items-center border-b-2 border-transparent px-1 pt-1 text-sm font-medium text-gray-500 hover:border-gray-300 hover:text-gray-700 dark:text-gray-300 dark:hover:border-white/20 dark:hover:text-white",children:"Calendar"})]})]}),d.jsxs("div",{className:"flex items-center",children:[d.jsx("div",{className:"shrink-0",children:d.jsxs("button",{type:"button",className:"relative inline-flex items-center gap-x-1.5 rounded-md bg-indigo-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600 dark:bg-indigo-500 dark:shadow-none dark:hover:bg-indigo-400 dark:focus-visible:outline-indigo-500",children:[d.jsx(Md,{"aria-hidden":"true",className:"-ml-0.5 size-5"}),"New Job"]})}),d.jsxs("div",{className:"hidden md:ml-4 md:flex md:shrink-0 md:items-center",children:[d.jsxs("button",{type:"button",className:"relative rounded-full p-1 text-gray-400 hover:text-gray-500 focus:outline focus:outline-2 focus:outline-offset-2 focus:outline-indigo-600 dark:hover:text-white dark:focus:outline-indigo-500",children:[d.jsx("span",{className:"absolute -inset-1.5"}),d.jsx("span",{className:"sr-only",children:"View notifications"}),d.jsx(Gl,{"aria-hidden":"true",className:"size-6"})]}),d.jsxs(Ic,{as:"div",className:"relative ml-3",children:[d.jsxs(_l,{className:"relative flex rounded-full focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600 dark:focus-visible:outline-indigo-500",children:[d.jsx("span",{className:"absolute -inset-1.5"}),d.jsx("span",{className:"sr-only",children:"Open user menu"}),d.jsx("img",{alt:"",src:"https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80",className:"size-8 rounded-full bg-gray-100 outline outline-1 -outline-offset-1 outline-black/5 dark:bg-gray-800 dark:outline-white/10"})]}),d.jsxs(Bl,{transition:!0,className:"absolute right-0 z-10 mt-2 w-48 origin-top-right rounded-md bg-white py-1 shadow-lg outline outline-1 outline-black/5 transition data-[closed]:scale-95 data-[closed]:transform data-[closed]:opacity-0 data-[enter]:duration-200 data-[leave]:duration-75 data-[enter]:ease-out data-[leave]:ease-in dark:bg-gray-800 dark:shadow-none dark:-outline-offset-1 dark:outline-white/10",children:[d.jsx(vn,{children:d.jsx("a",{href:"#",className:"block px-4 py-2 text-sm text-gray-700 data-[focus]:bg-gray-100 data-[focus]:outline-none dark:text-gray-300 dark:data-[focus]:bg-white/5",children:"Your profile"})}),d.jsx(vn,{children:d.jsx("a",{href:"#",className:"block px-4 py-2 text-sm text-gray-700 data-[focus]:bg-gray-100 data-[focus]:outline-none dark:text-gray-300 dark:data-[focus]:bg-white/5",children:"Settings"})}),d.jsx(vn,{children:d.jsx("a",{href:"#",className:"block px-4 py-2 text-sm text-gray-700 data-[focus]:bg-gray-100 data-[focus]:outline-none dark:text-gray-300 dark:data-[focus]:bg-white/5",children:"Sign out"})})]})]})]})]})]})}),d.jsxs($r,{className:"md:hidden",children:[d.jsxs("div",{className:"space-y-1 pb-3 pt-2",children:[d.jsx(ke,{as:"a",href:"#",className:"block border-l-4 border-indigo-600 bg-indigo-50 py-2 pl-3 pr-4 text-base font-medium text-indigo-700 sm:pl-5 sm:pr-6 dark:border-indigo-500 dark:bg-indigo-600/10 dark:text-indigo-400",children:"Dashboard"}),d.jsx(ke,{as:"a",href:"#",className:"block border-l-4 border-transparent py-2 pl-3 pr-4 text-base font-medium text-gray-500 hover:border-gray-300 hover:bg-gray-50 hover:text-gray-800 sm:pl-5 sm:pr-6 dark:text-gray-300 dark:hover:border-white/20 dark:hover:bg-white/5 dark:hover:text-white",children:"Team"}),d.jsx(ke,{as:"a",href:"#",className:"block border-l-4 border-transparent py-2 pl-3 pr-4 text-base font-medium text-gray-500 hover:border-gray-300 hover:bg-gray-50 hover:text-gray-800 sm:pl-5 sm:pr-6 dark:text-gray-300 dark:hover:border-white/20 dark:hover:bg-white/5 dark:hover:text-white",children:"Projects"}),d.jsx(ke,{as:"a",href:"#",className:"block border-l-4 border-transparent py-2 pl-3 pr-4 text-base font-medium text-gray-500 hover:border-gray-300 hover:bg-gray-50 hover:text-gray-800 sm:pl-5 sm:pr-6 dark:text-gray-300 dark:hover:border-white/20 dark:hover:bg-white/5 dark:hover:text-white",children:"Calendar"})]}),d.jsxs("div",{className:"border-t border-gray-200 pb-3 pt-4 dark:border-white/10",children:[d.jsxs("div",{className:"flex items-center px-4 sm:px-6",children:[d.jsx("div",{className:"shrink-0",children:d.jsx("img",{alt:"",src:"https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80",className:"size-10 rounded-full bg-gray-100 outline outline-1 -outline-offset-1 outline-black/5 dark:bg-gray-800 dark:outline-white/10"})}),d.jsxs("div",{className:"ml-3",children:[d.jsx("div",{className:"text-base font-medium text-gray-800 dark:text-white",children:"Tom Cook"}),d.jsx("div",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:"tom@example.com"})]}),d.jsxs("button",{type:"button",className:"relative ml-auto shrink-0 rounded-full p-1 text-gray-400 hover:text-gray-500 focus:outline focus:outline-2 focus:outline-offset-2 focus:outline-indigo-600 dark:hover:text-white dark:focus:outline-indigo-500",children:[d.jsx("span",{className:"absolute -inset-1.5"}),d.jsx("span",{className:"sr-only",children:"View notifications"}),d.jsx(Gl,{"aria-hidden":"true",className:"size-6"})]})]}),d.jsxs("div",{className:"mt-3 space-y-1",children:[d.jsx(ke,{as:"a",href:"#",className:"block px-4 py-2 text-base font-medium text-gray-500 hover:bg-gray-100 hover:text-gray-800 dark:text-gray-400 dark:hover:bg-white/5 dark:hover:text-white",children:"Your profile"}),d.jsx(ke,{as:"a",href:"#",className:"block px-4 py-2 text-base font-medium text-gray-500 hover:bg-gray-100 hover:text-gray-800 dark:text-gray-400 dark:hover:bg-white/5 dark:hover:text-white",children:"Settings"}),d.jsx(ke,{as:"a",href:"#",className:"block px-4 py-2 text-base font-medium text-gray-500 hover:bg-gray-100 hover:text-gray-800 dark:text-gray-400 dark:hover:bg-white/5 dark:hover:text-white",children:"Sign out"})]})]})]})]})}function _d({item:e,onHover:t}){const n=u.useRef(null);return d.jsx(Mt,{children:({open:r})=>d.jsxs("div",{className:"relative",onMouseEnter:()=>{var o;t&&!r&&((o=n.current)==null||o.click())},onMouseLeave:()=>{var o;t&&r&&((o=n.current)==null||o.click())},children:[d.jsxs("div",{className:"flex items-center gap-x-1",children:[e.useLink?d.jsx(Ae,{href:e.href,className:"text-sm/6 font-semibold text-gray-900 dark:text-white",children:e.title}):d.jsx("span",{className:"text-sm/6 font-semibold text-gray-900 dark:text-white",children:e.title}),d.jsx(ct,{ref:n,className:"inline-flex items-center p-1 text-gray-700 hover:text-gray-900 dark:text-gray-300 dark:hover:text-white","aria-label":`Open ${e.title} menu`,children:d.jsx(ft,{"aria-hidden":"true",className:"size-5 flex-none"})})]}),d.jsxs(dt,{transition:!0,className:"absolute left-1/2 z-10 mt-3 w-screen max-w-md -translate-x-1/2 overflow-hidden rounded-3xl bg-white shadow-lg outline outline-1 outline-gray-900/5 transition data-[closed]:translate-y-1 data-[closed]:opacity-0 data-[enter]:duration-200 data-[leave]:duration-150 data-[enter]:ease-out data-[leave]:ease-in dark:bg-gray-800 dark:shadow-none dark:-outline-offset-1 dark:outline-white/10",children:[d.jsx("div",{className:"p-4",children:e.subMenu.map(o=>d.jsxs("div",{className:"group relative flex items-center gap-x-6 rounded-lg p-4 text-sm/6 hover:bg-gray-50 dark:hover:bg-white/5",children:[d.jsx("div",{className:"flex size-11 flex-none items-center justify-center rounded-lg bg-gray-50 group-hover:bg-white dark:bg-gray-700/50 dark:group-hover:bg-gray-700",children:(()=>{const l=o.icon;if(!l)return null;if(u.isValidElement(l))return u.cloneElement(l,{className:"size-6 text-gray-600 group-hover:text-primary","aria-hidden":!0});if(typeof l=="function"){const s=l;return d.jsx(s,{"aria-hidden":!0,className:"size-6 text-gray-600 group-hover:text-primary"})}return null})()}),d.jsxs("div",{className:"flex-auto",children:[d.jsxs("a",{href:o.href,className:"block font-semibold text-gray-900 dark:text-white",children:[o.title,d.jsx("span",{className:"absolute inset-0"})]}),d.jsx("p",{className:"mt-1 text-gray-600 dark:text-gray-400",children:o.description})]})]},o.title))}),d.jsx("div",{className:"grid grid-cols-2 divide-x divide-gray-900/5 bg-gray-50 dark:divide-white/10 dark:bg-gray-700/50",children:e.ctas&&e.ctas.map(o=>d.jsxs("a",{href:o.href,className:"flex items-center justify-center gap-x-2.5 p-3 text-sm/6 font-semibold text-gray-900 hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700/50",children:[(()=>{const l=o.icon;if(!l)return null;if(u.isValidElement(l))return u.cloneElement(l,{className:"size-5 flex-none text-gray-400","aria-hidden":!0});if(typeof l=="function"){const s=l;return d.jsx(s,{"aria-hidden":!0,className:"size-5 flex-none text-gray-400"})}return null})(),o.title]},o.title))})]})]})})}function Bd({item:e,onHover:t}){const n=u.useRef(null);return d.jsx(Mt,{children:({open:r})=>d.jsxs("div",{onMouseEnter:()=>{var o;t&&!r&&((o=n.current)==null||o.click())},onMouseLeave:()=>{var o;t&&r&&((o=n.current)==null||o.click())},children:[d.jsxs("div",{className:"flex items-center gap-x-1",children:[e.useLink?d.jsx(Ae,{href:e.href,className:"text-sm/6 font-semibold text-gray-900",children:e.title}):d.jsx("span",{className:"text-sm/6 font-semibold text-gray-900",children:e.title}),d.jsx(ct,{ref:n,className:"inline-flex items-center p-1 text-gray-700 hover:text-gray-900","aria-label":`Open ${e.title} menu`,children:d.jsx(ft,{"aria-hidden":"true",className:"size-5 flex-none"})})]}),d.jsxs(dt,{transition:!0,className:"absolute inset-x-0 top-0 -z-10 bg-white pt-14 shadow-lg ring-1 ring-gray-900/5 transition data-[closed]:-translate-y-1 data-[closed]:opacity-0 data-[enter]:duration-200 data-[leave]:duration-150 data-[enter]:ease-out data-[leave]:ease-in",children:[d.jsx("div",{className:"mx-auto grid max-w-7xl grid-cols-4 gap-x-4 px-6 py-10 lg:px-8 xl:gap-x-8",children:e.subMenu.map(o=>d.jsxs("div",{className:"group relative rounded-lg p-6 text-sm/6 hover:bg-gray-50",children:[o.image?d.jsx("div",{className:"aspect-[4/3] w-full overflow-hidden rounded-md bg-gray-100",children:d.jsx("img",{alt:o.imageAlt||o.title,src:o.image,className:"h-full w-full object-cover transition-transform duration-200 group-hover:scale-105"})}):d.jsx("div",{className:"flex size-11 items-center justify-center rounded-lg bg-gray-50 group-hover:bg-white",children:(()=>{const l=o.icon;if(!l)return null;if(u.isValidElement(l))return u.cloneElement(l,{className:"size-6 text-gray-600 group-hover:text-primary","aria-hidden":!0});if(typeof l=="function"){const s=l;return d.jsx(s,{"aria-hidden":!0,className:"size-6 text-gray-600 group-hover:text-primary"})}return null})()}),d.jsxs("a",{href:o.href,className:`${o.image?"mt-4":"mt-6"} block font-semibold text-gray-900`,children:[o.title,d.jsx("span",{className:"absolute inset-0"})]}),d.jsx("p",{className:"mt-1 text-gray-600",children:o.description})]},o.title))}),d.jsx("div",{className:"bg-gray-50",children:e.ctas&&d.jsx("div",{className:"mx-auto max-w-7xl px-6 lg:px-8",children:d.jsx("div",{className:"grid grid-cols-3 divide-x divide-gray-900/5 border-x border-gray-900/5",children:e.ctas.map(o=>d.jsxs("a",{href:o.href,className:"flex items-center justify-center gap-x-2.5 p-3 text-sm/6 font-semibold text-gray-900 hover:bg-gray-100",children:[(()=>{const l=o.icon;if(!l)return null;if(u.isValidElement(l))return u.cloneElement(l,{className:"size-5 flex-none text-gray-400","aria-hidden":!0});if(typeof l=="function"){const s=l;return d.jsx(s,{"aria-hidden":!0,className:"size-5 flex-none text-gray-400"})}return null})(),o.title]},o.title))})})})]})]})},e.id)}function Hd({title:e,titleId:t,...n},r){return w.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?w.createElement("title",{id:t},e):null,w.createElement("path",{fillRule:"evenodd",d:"M16.28 11.47a.75.75 0 0 1 0 1.06l-7.5 7.5a.75.75 0 0 1-1.06-1.06L14.69 12 7.72 5.03a.75.75 0 0 1 1.06-1.06l7.5 7.5Z",clipRule:"evenodd"}))}const ql=w.forwardRef(Hd);function Vd({item:e,onHover:t}){const n=u.useRef(null);return d.jsx(Mt,{children:({open:r})=>{var o,l;return d.jsxs("div",{className:"relative",onMouseEnter:()=>{var s;t&&!r&&((s=n.current)==null||s.click())},onMouseLeave:()=>{var s;t&&r&&((s=n.current)==null||s.click())},children:[d.jsxs("div",{className:"flex items-center gap-x-1",children:[e.useLink?d.jsx(Ae,{href:e.href,className:"text-sm/6 font-semibold text-gray-900",children:e.title}):d.jsx("span",{className:"text-sm/6 font-semibold text-gray-900",children:e.title}),d.jsx(ct,{ref:n,className:"inline-flex items-center p-1 text-gray-700 hover:text-gray-900","aria-label":`Open ${e.title} menu`,children:d.jsx(ft,{"aria-hidden":"true",className:"size-5 flex-none"})})]}),d.jsx(dt,{transition:!0,className:"absolute left-1/2 z-10 mt-3 w-72 -translate-x-1/2 overflow-hidden rounded-2xl bg-white p-2 shadow-lg ring-1 ring-gray-900/5 transition data-[closed]:translate-y-1 data-[closed]:opacity-0 data-[enter]:duration-200 data-[leave]:duration-150 data-[enter]:ease-out data-[leave]:ease-in",children:d.jsxs("ul",{className:"space-y-1",children:[(o=e.subMenu)==null?void 0:o.map(s=>d.jsx("li",{className:"group",children:d.jsxs(Ae,{href:s.href,className:"flex items-center rounded-md px-3 py-2 text-sm text-gray-400 transition-colors duration-300 group-hover:text-black",children:[(()=>{const a=s.icon;if(!a)return d.jsx(ql,{className:"mr-2 h-5 w-5 text-gray-500 transition-all duration-300 group-hover:mr-3 group-hover:text-primary"});if(u.isValidElement(a))return u.cloneElement(a,{className:"mr-2 h-5 w-5 text-gray-500 transition-all duration-300 group-hover:mr-3 group-hover:text-primary","aria-hidden":!0});if(typeof a=="function"){const i=a;return d.jsx(i,{"aria-hidden":!0,className:"mr-2 h-5 w-5 text-gray-500 transition-all duration-300 group-hover:mr-3 group-hover:text-primary"})}return null})(),d.jsx("span",{children:s.title})]})},s.title)),(l=e.ctas)==null?void 0:l.map(s=>d.jsx("li",{className:"group",children:d.jsxs("a",{href:s.href,className:"flex items-center rounded-md px-3 py-2 text-sm text-gray-400 transition-colors duration-300 group-hover:text-black",children:[(()=>{const a=s.icon;if(!a)return d.jsx(ql,{className:"mr-2 h-5 w-5 text-gray-500 transition-all duration-300 group-hover:mr-3 group-hover:text-primary"});if(u.isValidElement(a))return u.cloneElement(a,{className:"mr-2 h-5 w-5 text-gray-500 transition-all duration-300 group-hover:mr-3 group-hover:text-primary","aria-hidden":!0});if(typeof a=="function"){const i=a;return d.jsx(i,{"aria-hidden":!0,className:"mr-2 h-5 w-5 text-gray-500 transition-all duration-300 group-hover:mr-3 group-hover:text-primary"})}return null})(),d.jsx("span",{children:s.title})]})},s.title))]})})]})}})}function Wd({config:e,onScrolledChange:t,scrollThreshold:n=10,quickSearchResults:r=[]}){const[o,l]=u.useState(!1),[s,a]=u.useState(!1),[i,f]=u.useState(!1),[c,g]=u.useState("");return u.useEffect(()=>{typeof(e==null?void 0:e.onSearchOpenChange)=="function"&&e.onSearchOpenChange(i),i||(g(""),typeof(e==null?void 0:e.onClearQuickResults)=="function"&&e.onClearQuickResults())},[i]),u.useEffect(()=>{const p=()=>{const h=window.scrollY>n;a(m=>(m!==h&&typeof t=="function"&&t(h),h))};return p(),window.addEventListener("scroll",p,{passive:!0}),()=>window.removeEventListener("scroll",p)},[t,n]),d.jsxs("header",{className:`${e!=null&&e.sticky?"sticky top-0 z-50 bg-white/95 backdrop-blur supports-[backdrop-filter]:bg-white/70":"relative z-10"} isolate bg-white`,children:[d.jsxs("nav",{"aria-label":"Global",className:"mx-auto flex max-w-7xl items-center justify-between p-6 lg:px-8",children:[d.jsx("div",{className:"flex lg:flex-1",children:d.jsx(Ae,{href:"/","aria-label":e.logoAlt||"Home",children:e.logo?d.jsx("img",{alt:e.logoAlt||"Logo",src:e.logo,className:`w-auto transition-all duration-300 ${s?"h-8 md:h-14":"h-12 md:h-20"}`}):d.jsx("div",{className:`h-auto transition-all duration-300 ${s?"w-28":"w-32"}`,children:d.jsx("h1",{className:`transition-all duration-300 ${s?"text-xl":"text-2xl"}`,children:e.fallbackText||"<NovaNav>"})})})}),d.jsx("div",{className:"flex lg:hidden",children:d.jsxs("button",{type:"button",onClick:()=>l(!0),className:"-m-2.5 inline-flex items-center justify-center rounded-md p-2.5 text-gray-700",children:[d.jsx("span",{className:"sr-only",children:"Open main menu"}),d.jsx(Tr,{"aria-hidden":"true",className:"size-6"})]})}),d.jsx(Pr,{className:"hidden lg:flex lg:gap-x-12",children:e.menuItems.map(p=>{const h=p.type||(p.full?"full":"default");return p.subMenu?h==="full"?d.jsx(Bd,{item:p,onHover:p.onHover},p.id||p.title):h==="simple"?d.jsx(Vd,{item:p,onHover:p.onHover},p.id||p.title):d.jsx(_d,{item:p,onHover:p.onHover},p.id||p.title):p.useLink?d.jsx(Ae,{href:p.href,className:"text-sm/6 font-semibold text-gray-900",children:p.title},p.id):d.jsx("a",{href:p.href,className:"text-sm/6 font-semibold text-gray-900",children:p.title},p.id)})}),d.jsxs("div",{className:"hidden gap-4 lg:flex lg:flex-1 lg:justify-end",children:[e.search&&d.jsx("button",{type:"button",onClick:()=>f(!0),className:"-m-2.5 inline-flex items-center justify-center rounded-md p-2.5 text-gray-700 hover:bg-gray-100","aria-label":"Open search",children:d.jsx(Kl,{"aria-hidden":"true",className:"size-6"})}),e.login&&d.jsxs("a",{href:e.loginHref,className:"text-sm/6 font-semibold text-gray-900",children:["Log in ",d.jsx("span",{"aria-hidden":"true",children:"→"})]}),e.cta&&d.jsx("a",{href:e.ctaBtnHref,className:"rounded-md bg-gray-900 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-gray-800 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gray-900",children:e.ctaTitle||"Sign up"})]})]}),d.jsxs(yr,{open:i,onClose:f,children:[d.jsx("div",{className:"fixed inset-0 z-50 bg-black/30"}),d.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:d.jsxs(mn,{className:"w-full max-w-lg rounded-lg bg-white p-6 shadow-lg ring-1 ring-gray-900/10",children:[d.jsxs("div",{className:"flex items-center justify-between pb-2",children:[d.jsx("h2",{className:"text-base font-semibold text-gray-900",children:"Search"}),d.jsx("button",{type:"button",onClick:()=>f(!1),className:"-m-2.5 rounded-md p-2.5 text-gray-700 hover:bg-gray-100","aria-label":"Close search",children:d.jsx(wn,{"aria-hidden":"true",className:"size-5"})})]}),d.jsxs("form",{className:"mt-2",onSubmit:p=>{p.preventDefault(),typeof(e==null?void 0:e.onSearch)=="function"&&e.onSearch(c),f(!1)},children:[d.jsx("label",{htmlFor:"site-search",className:"sr-only",children:"Search"}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("input",{id:"site-search",type:"search",placeholder:"Search...",autoFocus:!0,value:c,onChange:p=>{const h=p.target.value;g(h),typeof(e==null?void 0:e.onSearchChange)=="function"&&e.onSearchChange(h)},className:"w-full rounded-md border border-gray-300 px-3 py-2 text-gray-900 shadow-sm placeholder:text-gray-400 focus:border-gray-900 focus:outline-none focus:ring-2 focus:ring-gray-900"}),d.jsx("button",{type:"submit",className:"rounded-md bg-gray-900 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-gray-800 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gray-900",children:"Search"})]})]}),Array.isArray(r)&&r.length>0&&d.jsx("div",{className:"mt-4 divide-y divide-gray-200",children:r.map((p,h)=>{if(!p||typeof p!="object")return null;const m=p.title||p.q||p.name||"Result",v=p.desc||p.description||p.summary||p.a||"",b=typeof(e==null?void 0:e.searchTitleMax)=="number"?e.searchTitleMax:60,y=typeof(e==null?void 0:e.searchDescMax)=="number"?e.searchDescMax:100,E=typeof m=="string"&&m.length>b?`${m.slice(0,b-1)}…`:m,x=typeof v=="string"&&v.length>y?`${v.slice(0,y-1)}…`:v,k=typeof p.link=="string"?p.link:void 0,$=typeof k=="string"&&k.startsWith("/"),P=d.jsxs("div",{className:"flex items-start gap-3 py-3",children:[p!=null&&p.icon?d.jsx("div",{className:"mt-0.5 h-6 w-6 text-gray-500",children:p.icon}):p!=null&&p.image?d.jsx("img",{src:p.image,alt:m,className:"mt-0.5 h-6 w-6 rounded object-cover"}):d.jsx(Kl,{"aria-hidden":"true",className:"mt-0.5 size-6 text-gray-400"}),d.jsxs("div",{children:[d.jsx("div",{className:"text-sm font-medium text-gray-900 truncate",children:E}),x?d.jsx("div",{className:"text-sm text-gray-500 truncate",children:x}):null]})]});return k?$?d.jsx("a",{href:k,className:"block hover:bg-gray-50",onClick:()=>{typeof(e==null?void 0:e.onBeginNavigate)=="function"&&e.onBeginNavigate(),typeof(e==null?void 0:e.onClearQuickResults)=="function"&&e.onClearQuickResults(),f(!1)},children:P},k||h):d.jsx("a",{href:k,className:"block hover:bg-gray-50",onClick:()=>{typeof(e==null?void 0:e.onBeginNavigate)=="function"&&e.onBeginNavigate(),typeof(e==null?void 0:e.onClearQuickResults)=="function"&&e.onClearQuickResults(),f(!1)},children:P},k||h):d.jsx("div",{className:"block hover:bg-gray-50",children:P},h)})})]})})]}),d.jsxs(yr,{open:o,onClose:l,className:"lg:hidden",children:[d.jsx("div",{className:"fixed inset-0 z-50"}),d.jsxs(mn,{className:"fixed inset-y-0 right-0 z-50 w-full overflow-y-auto bg-white p-6 sm:max-w-sm sm:ring-1 sm:ring-gray-900/10",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx(Ae,{href:"/",className:"-m-1.5 p-1.5","aria-label":e.logoAlt||"Home",children:e.logo?d.jsx("img",{alt:e.logoAlt||"Logo",src:e.logo,className:"h-8 w-auto"}):d.jsx("span",{className:"text-lg font-semibold",children:e.fallbackText||"NEXGEN Roofing Systems"})}),d.jsxs("button",{type:"button",onClick:()=>l(!1),className:"-m-2.5 rounded-md p-2.5 text-gray-700",children:[d.jsx("span",{className:"sr-only",children:"Close menu"}),d.jsx(wn,{"aria-hidden":"true",className:"size-6"})]})]}),d.jsx("div",{className:"mt-6 flow-root",children:d.jsxs("div",{className:"-my-6 divide-y divide-gray-500/10",children:[d.jsx("div",{className:"space-y-2 py-6",children:e.menuItems.map(p=>p.subMenu?d.jsxs(Fl,{as:"div",className:"-mx-3",children:[d.jsxs(ke,{className:"group flex w-full items-center justify-between rounded-lg py-2 pl-3 pr-3.5 text-base/7 font-semibold text-gray-900 hover:bg-gray-50",children:[p.title,d.jsx(ft,{"aria-hidden":"true",className:"size-5 flex-none group-data-[open]:rotate-180"})]}),d.jsx($r,{className:"mt-2 space-y-2",children:[...p.subMenu,...p.ctas||[]].map(h=>d.jsx(ke,{as:"a",href:h.href,className:"block rounded-lg py-2 pl-6 pr-3 text-sm/7 font-semibold text-gray-900 hover:bg-gray-50",children:h.title},h.title))})]},p.id):p.useLink?d.jsx(Ae,{href:p.href,className:"-mx-3 block rounded-lg px-3 py-2 text-base/7 font-semibold text-gray-900 hover:bg-gray-50",children:p.title},p.id):d.jsx("a",{href:p.href,className:"-mx-3 block rounded-lg px-3 py-2 text-base/7 font-semibold text-gray-900 hover:bg-gray-50",children:p.title},p.id))}),d.jsxs("div",{className:"space-y-2 py-6",children:[e.login&&d.jsxs("a",{href:e.loginHref,className:"-mx-3 block rounded-lg px-3 py-2.5 text-base/7 font-semibold text-gray-900 hover:bg-gray-50",children:["Log in ",d.jsx("span",{"aria-hidden":"true",children:"→"})]}),e.cta&&d.jsx("a",{href:e.ctaBtnHref,className:"-mx-3 block rounded-lg bg-gray-900 px-3 py-2.5 text-base/7 font-semibold text-white hover:bg-gray-800",children:e.ctaTitle||"Sign up"})]})]})})]})]})]})}function zd(){return d.jsx(d.Fragment,{children:d.jsx("div",{className:"absolute inset-0 z-50 flex items-center justify-center",children:d.jsxs("div",{className:"flex flex-col items-center justify-center space-y-4",children:[d.jsx(ud,{className:"inset-shadow-sm 8 h-16 w-16 animate-[spin_2s_linear_infinite] rounded-full border-4 border-t-4 border-solid border-white text-5xl font-black text-primary"}),d.jsx("div",{className:"mt-16 flex w-full items-center justify-center py-8",children:d.jsx("p",{className:"text-xl font-thin uppercase tracking-widest text-primary",children:"Loading..."})})]})})})}function Gd({baseConfig:e}){const[t,n]=u.useState([]),[r,o]=u.useState(""),l=u.useRef(null),[s,a]=u.useState(!1),i=async h=>{const m=(h||"").trim();if(!m){n([]);return}try{const v=await fetch(`/api/search?q=${encodeURIComponent(m)}`);if(!v.ok)throw new Error("search failed");const b=await v.json(),y=[...Array.isArray(b==null?void 0:b.services)?b.services:[],...Array.isArray(b==null?void 0:b.faqs)?b.faqs:[],...Array.isArray(b==null?void 0:b.gallery)?b.gallery:[],...Array.isArray(b==null?void 0:b.posts)?b.posts:[],...Array.isArray(b==null?void 0:b.projects)?b.projects:[],...Array.isArray(b==null?void 0:b.locations)?b.locations:[]].filter(k=>k&&typeof k=="object"),E=new Set,x=y.filter(k=>{const $=`${(k.link||"").toLowerCase()}|${(k.title||k.q||"").toLowerCase()}`;return E.has($)?!1:(E.add($),!0)}).map(k=>{if(k!=null&&k.icon)return k;const $="h-6 w-6 text-gray-400";switch(k==null?void 0:k.kind){case"faq":return{...k,icon:d.jsx(Ed,{"aria-hidden":"true",className:$})};case"service":return{...k,icon:d.jsx(Ld,{"aria-hidden":"true",className:$})};case"project":return{...k,icon:d.jsx(ld,{"aria-hidden":"true",className:$})};case"post":return{...k,icon:d.jsx(bd,{"aria-hidden":"true",className:$})};case"gallery":return{...k,icon:d.jsx(wd,{"aria-hidden":"true",className:$})};case"location":return{...k,icon:d.jsx(gd,{"aria-hidden":"true",className:$})};default:return k}});n(x)}catch{n([])}},f=h=>{o(h),l.current&&clearTimeout(l.current),l.current=setTimeout(()=>i(h),300)},c=h=>{const m=(h||"").trim();m&&(a(!0),typeof window<"u"&&(window.location.href=`/search?q=${encodeURIComponent(m)}`))},g=h=>{h||(o(""),n([]),l.current&&clearTimeout(l.current))},p=u.useMemo(()=>({...e,search:!0,onSearchChange:f,onSearch:c,onSearchOpenChange:g,onClearQuickResults:()=>n([]),onBeginNavigate:()=>a(!0)}),[e]);return d.jsxs(d.Fragment,{children:[s&&d.jsx("div",{className:"fixed inset-0 z-[60]",children:d.jsx(zd,{})}),d.jsx(Wd,{config:p,quickSearchResults:t})]})}be.NavController=Gd,be.SimpleLight=jd,be.WithFlyout=Dd,Object.defineProperty(be,Symbol.toStringTag,{value:"Module"})});
1
+ (function(p,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("react/jsx-runtime"),require("react"),require("@headlessui/react"),require("@heroicons/react/24/outline"),require("@heroicons/react/20/solid"),require("next/link"),require("@heroicons/react/24/solid")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","@headlessui/react","@heroicons/react/24/outline","@heroicons/react/20/solid","next/link","@heroicons/react/24/solid"],e):(p=typeof globalThis<"u"?globalThis:p||self,e(p.ReactFastNav={},p.jsxRuntime,p.React,p.react,p.outline,p.solid,p.Link,p.solid$1))})(this,function(p,e,i,l,g,b,N,I){"use strict";const D=[{name:"Analytics",description:"Get a better understanding of your traffic",href:"#",icon:g.ChartPieIcon},{name:"Engagement",description:"Speak directly to your customers",href:"#",icon:g.CursorArrowRaysIcon},{name:"Security",description:"Your customers’ data will be safe and secure",href:"#",icon:g.FingerPrintIcon},{name:"Integrations",description:"Connect with third-party tools",href:"#",icon:g.SquaresPlusIcon},{name:"Automations",description:"Build strategic funnels that will convert",href:"#",icon:g.ArrowPathIcon}],E=[{name:"Watch demo",href:"#",icon:b.PlayCircleIcon},{name:"Contact sales",href:"#",icon:b.PhoneIcon}],B=[{name:"About us",href:"#",description:"Learn more about our company values and mission to empower others"},{name:"Careers",href:"#",description:"Looking for you next career opportunity? See all of our open positions"},{name:"Support",href:"#",description:"Get in touch with our dedicated support team or reach out on our community forums"},{name:"Blog",href:"#",description:"Read our latest announcements and get perspectives from our team"}];function A(){const[r,f]=i.useState(!1);return e.jsxs("header",{className:"bg-white dark:bg-gray-900",children:[e.jsxs("nav",{"aria-label":"Global",className:"mx-auto flex max-w-7xl items-center justify-between p-6 lg:px-8",children:[e.jsx("div",{className:"flex lg:flex-1",children:e.jsxs("a",{href:"#",className:"-m-1.5 p-1.5",children:[e.jsx("span",{className:"sr-only",children:"Your Company"}),e.jsx("img",{alt:"",src:"https://tailwindcss.com/plus-assets/img/logos/mark.svg?color=indigo&shade=600",className:"h-8 w-auto dark:hidden"}),e.jsx("img",{alt:"",src:"https://tailwindcss.com/plus-assets/img/logos/mark.svg?color=indigo&shade=500",className:"hidden h-8 w-auto dark:block"})]})}),e.jsx("div",{className:"flex lg:hidden",children:e.jsxs("button",{type:"button",onClick:()=>f(!0),className:"-m-2.5 inline-flex items-center justify-center rounded-md p-2.5 text-gray-700 dark:text-gray-400",children:[e.jsx("span",{className:"sr-only",children:"Open main menu"}),e.jsx(g.Bars3Icon,{"aria-hidden":"true",className:"size-6"})]})}),e.jsxs(l.PopoverGroup,{className:"hidden lg:flex lg:gap-x-12",children:[e.jsxs(l.Popover,{className:"relative",children:[e.jsxs(l.PopoverButton,{className:"flex items-center gap-x-1 text-sm/6 font-semibold text-gray-900 dark:text-white",children:["Product",e.jsx(b.ChevronDownIcon,{"aria-hidden":"true",className:"size-5 flex-none text-gray-400 dark:text-gray-500"})]}),e.jsxs(l.PopoverPanel,{transition:!0,className:"absolute left-1/2 z-10 mt-3 w-screen max-w-md -translate-x-1/2 overflow-hidden rounded-3xl bg-white shadow-lg outline outline-1 outline-gray-900/5 transition data-[closed]:translate-y-1 data-[closed]:opacity-0 data-[enter]:duration-200 data-[leave]:duration-150 data-[enter]:ease-out data-[leave]:ease-in dark:bg-gray-800 dark:shadow-none dark:-outline-offset-1 dark:outline-white/10",children:[e.jsx("div",{className:"p-4",children:D.map(s=>e.jsxs("div",{className:"group relative flex items-center gap-x-6 rounded-lg p-4 text-sm/6 hover:bg-gray-50 dark:hover:bg-white/5",children:[e.jsx("div",{className:"flex size-11 flex-none items-center justify-center rounded-lg bg-gray-50 group-hover:bg-white dark:bg-gray-700/50 dark:group-hover:bg-gray-700",children:e.jsx(s.icon,{"aria-hidden":"true",className:"size-6 text-gray-600 group-hover:text-indigo-600 dark:text-gray-400 dark:group-hover:text-white"})}),e.jsxs("div",{className:"flex-auto",children:[e.jsxs("a",{href:s.href,className:"block font-semibold text-gray-900 dark:text-white",children:[s.name,e.jsx("span",{className:"absolute inset-0"})]}),e.jsx("p",{className:"mt-1 text-gray-600 dark:text-gray-400",children:s.description})]})]},s.name))}),e.jsx("div",{className:"grid grid-cols-2 divide-x divide-gray-900/5 bg-gray-50 dark:divide-white/10 dark:bg-gray-700/50",children:E.map(s=>e.jsxs("a",{href:s.href,className:"flex items-center justify-center gap-x-2.5 p-3 text-sm/6 font-semibold text-gray-900 hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700/50",children:[e.jsx(s.icon,{"aria-hidden":"true",className:"size-5 flex-none text-gray-400 dark:text-gray-500"}),s.name]},s.name))})]})]}),e.jsx("a",{href:"#",className:"text-sm/6 font-semibold text-gray-900 dark:text-white",children:"Features"}),e.jsx("a",{href:"#",className:"text-sm/6 font-semibold text-gray-900 dark:text-white",children:"Marketplace"}),e.jsxs(l.Popover,{className:"relative",children:[e.jsxs(l.PopoverButton,{className:"flex items-center gap-x-1 text-sm/6 font-semibold text-gray-900 dark:text-white",children:["Company",e.jsx(b.ChevronDownIcon,{"aria-hidden":"true",className:"size-5 flex-none text-gray-400 dark:text-gray-500"})]}),e.jsx(l.PopoverPanel,{transition:!0,className:"absolute left-1/2 z-10 mt-3 w-96 -translate-x-1/2 rounded-3xl bg-white p-4 shadow-lg outline outline-1 outline-gray-900/5 transition data-[closed]:translate-y-1 data-[closed]:opacity-0 data-[enter]:duration-200 data-[leave]:duration-150 data-[enter]:ease-out data-[leave]:ease-in dark:bg-gray-800 dark:-outline-offset-1 dark:outline-white/10",children:B.map(s=>e.jsxs("div",{className:"relative rounded-lg p-4 hover:bg-gray-50 dark:hover:bg-white/5",children:[e.jsxs("a",{href:s.href,className:"block text-sm/6 font-semibold text-gray-900 dark:text-white",children:[s.name,e.jsx("span",{className:"absolute inset-0"})]}),e.jsx("p",{className:"mt-1 text-sm/6 text-gray-600 dark:text-gray-400",children:s.description})]},s.name))})]})]}),e.jsx("div",{className:"hidden lg:flex lg:flex-1 lg:justify-end",children:e.jsxs("a",{href:"#",className:"text-sm/6 font-semibold text-gray-900 dark:text-white",children:["Log in ",e.jsx("span",{"aria-hidden":"true",children:"→"})]})})]}),e.jsxs(l.Dialog,{open:r,onClose:f,className:"lg:hidden",children:[e.jsx("div",{className:"fixed inset-0 z-10"}),e.jsxs(l.DialogPanel,{className:"fixed inset-y-0 right-0 z-10 flex w-full flex-col justify-between overflow-y-auto bg-white sm:max-w-sm sm:ring-1 sm:ring-gray-900/10 dark:bg-gray-900 dark:sm:ring-white/10",children:[e.jsxs("div",{className:"p-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("a",{href:"#",className:"-m-1.5 p-1.5",children:[e.jsx("span",{className:"sr-only",children:"Your Company"}),e.jsx("img",{alt:"",src:"https://tailwindcss.com/plus-assets/img/logos/mark.svg?color=indigo&shade=600",className:"h-8 w-auto dark:hidden"}),e.jsx("img",{alt:"",src:"https://tailwindcss.com/plus-assets/img/logos/mark.svg?color=indigo&shade=500",className:"hidden h-8 w-auto dark:block"})]}),e.jsxs("button",{type:"button",onClick:()=>f(!1),className:"-m-2.5 rounded-md p-2.5 text-gray-700 dark:text-gray-400",children:[e.jsx("span",{className:"sr-only",children:"Close menu"}),e.jsx(g.XMarkIcon,{"aria-hidden":"true",className:"size-6"})]})]}),e.jsx("div",{className:"mt-6 flow-root",children:e.jsxs("div",{className:"-my-6 divide-y divide-gray-500/10 dark:divide-white/10",children:[e.jsx("div",{className:"space-y-2 py-6",children:D.map(s=>e.jsxs("a",{href:s.href,className:"group -mx-3 flex items-center gap-x-6 rounded-lg p-3 text-base/7 font-semibold text-gray-900 hover:bg-gray-50 dark:text-white dark:hover:bg-white/5",children:[e.jsx("div",{className:"flex size-11 flex-none items-center justify-center rounded-lg bg-gray-50 group-hover:bg-white dark:bg-gray-800 dark:group-hover:bg-gray-700",children:e.jsx(s.icon,{"aria-hidden":"true",className:"size-6 text-gray-600 group-hover:text-indigo-600 dark:text-gray-300 dark:group-hover:text-white"})}),s.name]},s.name))}),e.jsxs("div",{className:"space-y-2 py-6",children:[e.jsx("a",{href:"#",className:"-mx-3 block rounded-lg px-3 py-2 text-base/7 font-semibold text-gray-900 hover:bg-gray-50 dark:text-white dark:hover:bg-white/5",children:"Features"}),e.jsx("a",{href:"#",className:"-mx-3 block rounded-lg px-3 py-2 text-base/7 font-semibold text-gray-900 hover:bg-gray-50 dark:text-white dark:hover:bg-white/5",children:"Marketplace"}),B.map(s=>e.jsx("a",{href:s.href,className:"-mx-3 block rounded-lg px-3 py-2 text-base/7 font-semibold text-gray-900 hover:bg-gray-50 dark:text-white dark:hover:bg-white/5",children:s.name},s.name))]}),e.jsx("div",{className:"py-6",children:e.jsx("a",{href:"#",className:"-mx-3 block rounded-lg px-3 py-2.5 text-base/7 font-semibold text-gray-900 hover:bg-gray-50 dark:text-white dark:hover:bg-white/5",children:"Log in"})})]})})]}),e.jsx("div",{className:"sticky bottom-0 grid grid-cols-2 divide-x divide-gray-900/5 bg-gray-50 text-center dark:divide-white/5 dark:bg-gray-800/50",children:item.ctas.map(s=>e.jsx("a",{href:s.href,className:"p-3 text-base/7 font-semibold text-gray-900 hover:bg-gray-100 dark:text-white dark:hover:bg-gray-800",children:s.title},s.title))})]})]})]})}function O(){return e.jsxs(l.Disclosure,{as:"nav",className:"relative bg-white shadow dark:bg-gray-800/50 dark:shadow-none dark:after:pointer-events-none dark:after:absolute dark:after:inset-x-0 dark:after:bottom-0 dark:after:h-px dark:after:bg-white/10",children:[e.jsx("div",{className:"mx-auto max-w-7xl px-4 sm:px-6 lg:px-8",children:e.jsxs("div",{className:"flex h-16 justify-between",children:[e.jsxs("div",{className:"flex",children:[e.jsx("div",{className:"-ml-2 mr-2 flex items-center md:hidden",children:e.jsxs(l.DisclosureButton,{className:"group relative inline-flex items-center justify-center rounded-md p-2 text-gray-400 hover:bg-gray-100 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-indigo-600 dark:hover:bg-white/5 dark:hover:text-white dark:focus:ring-white",children:[e.jsx("span",{className:"absolute -inset-0.5"}),e.jsx("span",{className:"sr-only",children:"Open main menu"}),e.jsx(g.Bars3Icon,{"aria-hidden":"true",className:"block size-6 group-data-[open]:hidden"}),e.jsx(g.XMarkIcon,{"aria-hidden":"true",className:"hidden size-6 group-data-[open]:block"})]})}),e.jsxs("div",{className:"flex shrink-0 items-center",children:[e.jsx("img",{alt:"Your Company",src:"https://tailwindcss.com/plus-assets/img/logos/mark.svg?color=indigo&shade=600",className:"h-8 w-auto dark:hidden"}),e.jsx("img",{alt:"Your Company",src:"https://tailwindcss.com/plus-assets/img/logos/mark.svg?color=indigo&shade=500",className:"hidden h-8 w-auto dark:block"})]}),e.jsxs("div",{className:"hidden md:ml-6 md:flex md:space-x-8",children:[e.jsx("a",{href:"#",className:"inline-flex items-center border-b-2 border-indigo-600 px-1 pt-1 text-sm font-medium text-gray-900 dark:border-indigo-500 dark:text-white",children:"Dashboard"}),e.jsx("a",{href:"#",className:"inline-flex items-center border-b-2 border-transparent px-1 pt-1 text-sm font-medium text-gray-500 hover:border-gray-300 hover:text-gray-700 dark:text-gray-300 dark:hover:border-white/20 dark:hover:text-white",children:"Team"}),e.jsx("a",{href:"#",className:"inline-flex items-center border-b-2 border-transparent px-1 pt-1 text-sm font-medium text-gray-500 hover:border-gray-300 hover:text-gray-700 dark:text-gray-300 dark:hover:border-white/20 dark:hover:text-white",children:"Projects"}),e.jsx("a",{href:"#",className:"inline-flex items-center border-b-2 border-transparent px-1 pt-1 text-sm font-medium text-gray-500 hover:border-gray-300 hover:text-gray-700 dark:text-gray-300 dark:hover:border-white/20 dark:hover:text-white",children:"Calendar"})]})]}),e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"shrink-0",children:e.jsxs("button",{type:"button",className:"relative inline-flex items-center gap-x-1.5 rounded-md bg-indigo-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600 dark:bg-indigo-500 dark:shadow-none dark:hover:bg-indigo-400 dark:focus-visible:outline-indigo-500",children:[e.jsx(b.PlusIcon,{"aria-hidden":"true",className:"-ml-0.5 size-5"}),"New Job"]})}),e.jsxs("div",{className:"hidden md:ml-4 md:flex md:shrink-0 md:items-center",children:[e.jsxs("button",{type:"button",className:"relative rounded-full p-1 text-gray-400 hover:text-gray-500 focus:outline focus:outline-2 focus:outline-offset-2 focus:outline-indigo-600 dark:hover:text-white dark:focus:outline-indigo-500",children:[e.jsx("span",{className:"absolute -inset-1.5"}),e.jsx("span",{className:"sr-only",children:"View notifications"}),e.jsx(g.BellIcon,{"aria-hidden":"true",className:"size-6"})]}),e.jsxs(l.Menu,{as:"div",className:"relative ml-3",children:[e.jsxs(l.MenuButton,{className:"relative flex rounded-full focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600 dark:focus-visible:outline-indigo-500",children:[e.jsx("span",{className:"absolute -inset-1.5"}),e.jsx("span",{className:"sr-only",children:"Open user menu"}),e.jsx("img",{alt:"",src:"https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80",className:"size-8 rounded-full bg-gray-100 outline outline-1 -outline-offset-1 outline-black/5 dark:bg-gray-800 dark:outline-white/10"})]}),e.jsxs(l.MenuItems,{transition:!0,className:"absolute right-0 z-10 mt-2 w-48 origin-top-right rounded-md bg-white py-1 shadow-lg outline outline-1 outline-black/5 transition data-[closed]:scale-95 data-[closed]:transform data-[closed]:opacity-0 data-[enter]:duration-200 data-[leave]:duration-75 data-[enter]:ease-out data-[leave]:ease-in dark:bg-gray-800 dark:shadow-none dark:-outline-offset-1 dark:outline-white/10",children:[e.jsx(l.MenuItem,{children:e.jsx("a",{href:"#",className:"block px-4 py-2 text-sm text-gray-700 data-[focus]:bg-gray-100 data-[focus]:outline-none dark:text-gray-300 dark:data-[focus]:bg-white/5",children:"Your profile"})}),e.jsx(l.MenuItem,{children:e.jsx("a",{href:"#",className:"block px-4 py-2 text-sm text-gray-700 data-[focus]:bg-gray-100 data-[focus]:outline-none dark:text-gray-300 dark:data-[focus]:bg-white/5",children:"Settings"})}),e.jsx(l.MenuItem,{children:e.jsx("a",{href:"#",className:"block px-4 py-2 text-sm text-gray-700 data-[focus]:bg-gray-100 data-[focus]:outline-none dark:text-gray-300 dark:data-[focus]:bg-white/5",children:"Sign out"})})]})]})]})]})]})}),e.jsxs(l.DisclosurePanel,{className:"md:hidden",children:[e.jsxs("div",{className:"space-y-1 pb-3 pt-2",children:[e.jsx(l.DisclosureButton,{as:"a",href:"#",className:"block border-l-4 border-indigo-600 bg-indigo-50 py-2 pl-3 pr-4 text-base font-medium text-indigo-700 sm:pl-5 sm:pr-6 dark:border-indigo-500 dark:bg-indigo-600/10 dark:text-indigo-400",children:"Dashboard"}),e.jsx(l.DisclosureButton,{as:"a",href:"#",className:"block border-l-4 border-transparent py-2 pl-3 pr-4 text-base font-medium text-gray-500 hover:border-gray-300 hover:bg-gray-50 hover:text-gray-800 sm:pl-5 sm:pr-6 dark:text-gray-300 dark:hover:border-white/20 dark:hover:bg-white/5 dark:hover:text-white",children:"Team"}),e.jsx(l.DisclosureButton,{as:"a",href:"#",className:"block border-l-4 border-transparent py-2 pl-3 pr-4 text-base font-medium text-gray-500 hover:border-gray-300 hover:bg-gray-50 hover:text-gray-800 sm:pl-5 sm:pr-6 dark:text-gray-300 dark:hover:border-white/20 dark:hover:bg-white/5 dark:hover:text-white",children:"Projects"}),e.jsx(l.DisclosureButton,{as:"a",href:"#",className:"block border-l-4 border-transparent py-2 pl-3 pr-4 text-base font-medium text-gray-500 hover:border-gray-300 hover:bg-gray-50 hover:text-gray-800 sm:pl-5 sm:pr-6 dark:text-gray-300 dark:hover:border-white/20 dark:hover:bg-white/5 dark:hover:text-white",children:"Calendar"})]}),e.jsxs("div",{className:"border-t border-gray-200 pb-3 pt-4 dark:border-white/10",children:[e.jsxs("div",{className:"flex items-center px-4 sm:px-6",children:[e.jsx("div",{className:"shrink-0",children:e.jsx("img",{alt:"",src:"https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80",className:"size-10 rounded-full bg-gray-100 outline outline-1 -outline-offset-1 outline-black/5 dark:bg-gray-800 dark:outline-white/10"})}),e.jsxs("div",{className:"ml-3",children:[e.jsx("div",{className:"text-base font-medium text-gray-800 dark:text-white",children:"Tom Cook"}),e.jsx("div",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:"tom@example.com"})]}),e.jsxs("button",{type:"button",className:"relative ml-auto shrink-0 rounded-full p-1 text-gray-400 hover:text-gray-500 focus:outline focus:outline-2 focus:outline-offset-2 focus:outline-indigo-600 dark:hover:text-white dark:focus:outline-indigo-500",children:[e.jsx("span",{className:"absolute -inset-1.5"}),e.jsx("span",{className:"sr-only",children:"View notifications"}),e.jsx(g.BellIcon,{"aria-hidden":"true",className:"size-6"})]})]}),e.jsxs("div",{className:"mt-3 space-y-1",children:[e.jsx(l.DisclosureButton,{as:"a",href:"#",className:"block px-4 py-2 text-base font-medium text-gray-500 hover:bg-gray-100 hover:text-gray-800 dark:text-gray-400 dark:hover:bg-white/5 dark:hover:text-white",children:"Your profile"}),e.jsx(l.DisclosureButton,{as:"a",href:"#",className:"block px-4 py-2 text-base font-medium text-gray-500 hover:bg-gray-100 hover:text-gray-800 dark:text-gray-400 dark:hover:bg-white/5 dark:hover:text-white",children:"Settings"}),e.jsx(l.DisclosureButton,{as:"a",href:"#",className:"block px-4 py-2 text-base font-medium text-gray-500 hover:bg-gray-100 hover:text-gray-800 dark:text-gray-400 dark:hover:bg-white/5 dark:hover:text-white",children:"Sign out"})]})]})]})]})}function q({item:r,onHover:f}){const s=i.useRef(null);return e.jsx(l.Popover,{children:({open:y})=>e.jsxs("div",{className:"relative",onMouseEnter:()=>{var t;f&&!y&&((t=s.current)==null||t.click())},onMouseLeave:()=>{var t;f&&y&&((t=s.current)==null||t.click())},children:[e.jsxs("div",{className:"flex items-center gap-x-1",children:[r.useLink?e.jsx(N,{href:r.href,className:"text-sm/6 font-semibold text-gray-900 dark:text-white",children:r.title}):e.jsx("span",{className:"text-sm/6 font-semibold text-gray-900 dark:text-white",children:r.title}),e.jsx(l.PopoverButton,{ref:s,className:"inline-flex items-center p-1 text-gray-700 hover:text-gray-900 dark:text-gray-300 dark:hover:text-white","aria-label":`Open ${r.title} menu`,children:e.jsx(b.ChevronDownIcon,{"aria-hidden":"true",className:"size-5 flex-none"})})]}),e.jsxs(l.PopoverPanel,{transition:!0,className:"absolute left-1/2 z-10 mt-3 w-screen max-w-md -translate-x-1/2 overflow-hidden rounded-3xl bg-white shadow-lg outline outline-1 outline-gray-900/5 transition data-[closed]:translate-y-1 data-[closed]:opacity-0 data-[enter]:duration-200 data-[leave]:duration-150 data-[enter]:ease-out data-[leave]:ease-in dark:bg-gray-800 dark:shadow-none dark:-outline-offset-1 dark:outline-white/10",children:[e.jsx("div",{className:"p-4",children:r.subMenu.map(t=>e.jsxs("div",{className:"group relative flex items-center gap-x-6 rounded-lg p-4 text-sm/6 hover:bg-gray-50 dark:hover:bg-white/5",children:[e.jsx("div",{className:"flex size-11 flex-none items-center justify-center rounded-lg bg-gray-50 group-hover:bg-white dark:bg-gray-700/50 dark:group-hover:bg-gray-700",children:(()=>{const o=t.icon;if(!o)return null;if(i.isValidElement(o))return i.cloneElement(o,{className:"size-6 text-gray-600 group-hover:text-primary","aria-hidden":!0});if(typeof o=="function"){const n=o;return e.jsx(n,{"aria-hidden":!0,className:"size-6 text-gray-600 group-hover:text-primary"})}return null})()}),e.jsxs("div",{className:"flex-auto",children:[e.jsxs("a",{href:t.href,className:"block font-semibold text-gray-900 dark:text-white",children:[t.title,e.jsx("span",{className:"absolute inset-0"})]}),e.jsx("p",{className:"mt-1 text-gray-600 dark:text-gray-400",children:t.description})]})]},t.title))}),e.jsx("div",{className:"grid grid-cols-2 divide-x divide-gray-900/5 bg-gray-50 dark:divide-white/10 dark:bg-gray-700/50",children:r.ctas&&r.ctas.map(t=>e.jsxs("a",{href:t.href,className:"flex items-center justify-center gap-x-2.5 p-3 text-sm/6 font-semibold text-gray-900 hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700/50",children:[(()=>{const o=t.icon;if(!o)return null;if(i.isValidElement(o))return i.cloneElement(o,{className:"size-5 flex-none text-gray-400","aria-hidden":!0});if(typeof o=="function"){const n=o;return e.jsx(n,{"aria-hidden":!0,className:"size-5 flex-none text-gray-400"})}return null})(),t.title]},t.title))})]})]})})}function L({item:r,onHover:f}){const s=i.useRef(null);return e.jsx(l.Popover,{children:({open:y})=>e.jsxs("div",{onMouseEnter:()=>{var t;f&&!y&&((t=s.current)==null||t.click())},onMouseLeave:()=>{var t;f&&y&&((t=s.current)==null||t.click())},children:[e.jsxs("div",{className:"flex items-center gap-x-1",children:[r.useLink?e.jsx(N,{href:r.href,className:"text-sm/6 font-semibold text-gray-900",children:r.title}):e.jsx("span",{className:"text-sm/6 font-semibold text-gray-900",children:r.title}),e.jsx(l.PopoverButton,{ref:s,className:"inline-flex items-center p-1 text-gray-700 hover:text-gray-900","aria-label":`Open ${r.title} menu`,children:e.jsx(b.ChevronDownIcon,{"aria-hidden":"true",className:"size-5 flex-none"})})]}),e.jsxs(l.PopoverPanel,{transition:!0,className:"absolute inset-x-0 top-0 -z-10 bg-white pt-14 shadow-lg ring-1 ring-gray-900/5 transition data-[closed]:-translate-y-1 data-[closed]:opacity-0 data-[enter]:duration-200 data-[leave]:duration-150 data-[enter]:ease-out data-[leave]:ease-in",children:[e.jsx("div",{className:"mx-auto grid max-w-7xl grid-cols-4 gap-x-4 px-6 py-10 lg:px-8 xl:gap-x-8",children:r.subMenu.map(t=>e.jsxs("div",{className:"group relative rounded-lg p-6 text-sm/6 hover:bg-gray-50",children:[t.image?e.jsx("div",{className:"aspect-[4/3] w-full overflow-hidden rounded-md bg-gray-100",children:e.jsx("img",{alt:t.imageAlt||t.title,src:t.image,className:"h-full w-full object-cover transition-transform duration-200 group-hover:scale-105"})}):e.jsx("div",{className:"flex size-11 items-center justify-center rounded-lg bg-gray-50 group-hover:bg-white",children:(()=>{const o=t.icon;if(!o)return null;if(i.isValidElement(o))return i.cloneElement(o,{className:"size-6 text-gray-600 group-hover:text-primary","aria-hidden":!0});if(typeof o=="function"){const n=o;return e.jsx(n,{"aria-hidden":!0,className:"size-6 text-gray-600 group-hover:text-primary"})}return null})()}),e.jsxs("a",{href:t.href,className:`${t.image?"mt-4":"mt-6"} block font-semibold text-gray-900`,children:[t.title,e.jsx("span",{className:"absolute inset-0"})]}),e.jsx("p",{className:"mt-1 text-gray-600",children:t.description})]},t.title))}),e.jsx("div",{className:"bg-gray-50",children:r.ctas&&e.jsx("div",{className:"mx-auto max-w-7xl px-6 lg:px-8",children:e.jsx("div",{className:"grid grid-cols-3 divide-x divide-gray-900/5 border-x border-gray-900/5",children:r.ctas.map(t=>e.jsxs("a",{href:t.href,className:"flex items-center justify-center gap-x-2.5 p-3 text-sm/6 font-semibold text-gray-900 hover:bg-gray-100",children:[(()=>{const o=t.icon;if(!o)return null;if(i.isValidElement(o))return i.cloneElement(o,{className:"size-5 flex-none text-gray-400","aria-hidden":!0});if(typeof o=="function"){const n=o;return e.jsx(n,{"aria-hidden":!0,className:"size-5 flex-none text-gray-400"})}return null})(),t.title]},t.title))})})})]})]})},r.id)}function T({item:r,onHover:f}){const s=i.useRef(null);return e.jsx(l.Popover,{children:({open:y})=>{var t,o;return e.jsxs("div",{className:"relative",onMouseEnter:()=>{var n;f&&!y&&((n=s.current)==null||n.click())},onMouseLeave:()=>{var n;f&&y&&((n=s.current)==null||n.click())},children:[e.jsxs("div",{className:"flex items-center gap-x-1",children:[r.useLink?e.jsx(N,{href:r.href,className:"text-sm/6 font-semibold text-gray-900",children:r.title}):e.jsx("span",{className:"text-sm/6 font-semibold text-gray-900",children:r.title}),e.jsx(l.PopoverButton,{ref:s,className:"inline-flex items-center p-1 text-gray-700 hover:text-gray-900","aria-label":`Open ${r.title} menu`,children:e.jsx(b.ChevronDownIcon,{"aria-hidden":"true",className:"size-5 flex-none"})})]}),e.jsx(l.PopoverPanel,{transition:!0,className:"absolute left-1/2 z-10 mt-3 w-72 -translate-x-1/2 overflow-hidden rounded-2xl bg-white p-2 shadow-lg ring-1 ring-gray-900/5 transition data-[closed]:translate-y-1 data-[closed]:opacity-0 data-[enter]:duration-200 data-[leave]:duration-150 data-[enter]:ease-out data-[leave]:ease-in",children:e.jsxs("ul",{className:"space-y-1",children:[(t=r.subMenu)==null?void 0:t.map(n=>e.jsx("li",{className:"group",children:e.jsxs(N,{href:n.href,className:"flex items-center rounded-md px-3 py-2 text-sm text-gray-400 transition-colors duration-300 group-hover:text-black",children:[(()=>{const x=n.icon;if(!x)return e.jsx(I.ChevronRightIcon,{className:"mr-2 h-5 w-5 text-gray-500 transition-all duration-300 group-hover:mr-3 group-hover:text-primary"});if(i.isValidElement(x))return i.cloneElement(x,{className:"mr-2 h-5 w-5 text-gray-500 transition-all duration-300 group-hover:mr-3 group-hover:text-primary","aria-hidden":!0});if(typeof x=="function"){const v=x;return e.jsx(v,{"aria-hidden":!0,className:"mr-2 h-5 w-5 text-gray-500 transition-all duration-300 group-hover:mr-3 group-hover:text-primary"})}return null})(),e.jsx("span",{children:n.title})]})},n.title)),(o=r.ctas)==null?void 0:o.map(n=>e.jsx("li",{className:"group",children:e.jsxs("a",{href:n.href,className:"flex items-center rounded-md px-3 py-2 text-sm text-gray-400 transition-colors duration-300 group-hover:text-black",children:[(()=>{const x=n.icon;if(!x)return e.jsx(I.ChevronRightIcon,{className:"mr-2 h-5 w-5 text-gray-500 transition-all duration-300 group-hover:mr-3 group-hover:text-primary"});if(i.isValidElement(x))return i.cloneElement(x,{className:"mr-2 h-5 w-5 text-gray-500 transition-all duration-300 group-hover:mr-3 group-hover:text-primary","aria-hidden":!0});if(typeof x=="function"){const v=x;return e.jsx(v,{"aria-hidden":!0,className:"mr-2 h-5 w-5 text-gray-500 transition-all duration-300 group-hover:mr-3 group-hover:text-primary"})}return null})(),e.jsx("span",{children:n.title})]})},n.title))]})})]})}})}function $({config:r,onScrolledChange:f,scrollThreshold:s=10,quickSearchResults:y=[]}){const[t,o]=i.useState(!1),[n,x]=i.useState(!1),[v,k]=i.useState(!1),[C,z]=i.useState("");return i.useEffect(()=>{typeof(r==null?void 0:r.onSearchOpenChange)=="function"&&r.onSearchOpenChange(v),v||(z(""),typeof(r==null?void 0:r.onClearQuickResults)=="function"&&r.onClearQuickResults())},[v]),i.useEffect(()=>{const a=()=>{const h=window.scrollY>s;x(u=>(u!==h&&typeof f=="function"&&f(h),h))};return a(),window.addEventListener("scroll",a,{passive:!0}),()=>window.removeEventListener("scroll",a)},[f,s]),e.jsxs("header",{className:`${r!=null&&r.sticky?"sticky top-0 z-50 bg-white/95 backdrop-blur supports-[backdrop-filter]:bg-white/70":"relative z-10"} isolate bg-white`,children:[e.jsxs("nav",{"aria-label":"Global",className:"mx-auto flex max-w-7xl items-center justify-between p-6 lg:px-8",children:[e.jsx("div",{className:"flex lg:flex-1",children:e.jsx(N,{href:"/","aria-label":r.logoAlt||"Home",children:r.logo?e.jsx("img",{alt:r.logoAlt||"Logo",src:r.logo,className:`w-auto transition-all duration-300 ${n?"h-8 md:h-14":"h-12 md:h-20"}`}):e.jsx("div",{className:`h-auto transition-all duration-300 ${n?"w-28":"w-32"}`,children:e.jsx("h1",{className:`transition-all duration-300 ${n?"text-xl":"text-2xl"}`,children:r.fallbackText||"<NovaNav>"})})})}),e.jsx("div",{className:"flex lg:hidden",children:e.jsxs("button",{type:"button",onClick:()=>o(!0),className:"-m-2.5 inline-flex items-center justify-center rounded-md p-2.5 text-gray-700",children:[e.jsx("span",{className:"sr-only",children:"Open main menu"}),e.jsx(g.Bars3Icon,{"aria-hidden":"true",className:"size-6"})]})}),e.jsx(l.PopoverGroup,{className:"hidden lg:flex lg:gap-x-12",children:r.menuItems.map(a=>{const h=a.type||(a.full?"full":"default");return a.subMenu?h==="full"?e.jsx(L,{item:a,onHover:a.onHover},a.id||a.title):h==="simple"?e.jsx(T,{item:a,onHover:a.onHover},a.id||a.title):e.jsx(q,{item:a,onHover:a.onHover},a.id||a.title):a.useLink?e.jsx(N,{href:a.href,className:"text-sm/6 font-semibold text-gray-900",children:a.title},a.id):e.jsx("a",{href:a.href,className:"text-sm/6 font-semibold text-gray-900",children:a.title},a.id)})}),e.jsxs("div",{className:"hidden gap-4 lg:flex lg:flex-1 lg:justify-end",children:[r.search&&e.jsx("button",{type:"button",onClick:()=>k(!0),className:"-m-2.5 inline-flex items-center justify-center rounded-md p-2.5 text-gray-700 hover:bg-gray-100","aria-label":"Open search",children:e.jsx(g.MagnifyingGlassIcon,{"aria-hidden":"true",className:"size-6"})}),r.login&&e.jsxs("a",{href:r.loginHref,className:"text-sm/6 font-semibold text-gray-900",children:["Log in ",e.jsx("span",{"aria-hidden":"true",children:"→"})]}),r.cta&&e.jsx("a",{href:r.ctaBtnHref,className:"rounded-md bg-gray-900 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-gray-800 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gray-900",children:r.ctaTitle||"Sign up"})]})]}),e.jsxs(l.Dialog,{open:v,onClose:k,children:[e.jsx("div",{className:"fixed inset-0 z-50 bg-black/30"}),e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:e.jsxs(l.DialogPanel,{className:"w-full max-w-lg rounded-lg bg-white p-6 shadow-lg ring-1 ring-gray-900/10",children:[e.jsxs("div",{className:"flex items-center justify-between pb-2",children:[e.jsx("h2",{className:"text-base font-semibold text-gray-900",children:"Search"}),e.jsx("button",{type:"button",onClick:()=>k(!1),className:"-m-2.5 rounded-md p-2.5 text-gray-700 hover:bg-gray-100","aria-label":"Close search",children:e.jsx(g.XMarkIcon,{"aria-hidden":"true",className:"size-5"})})]}),e.jsxs("form",{className:"mt-2",onSubmit:a=>{a.preventDefault(),typeof(r==null?void 0:r.onSearch)=="function"&&r.onSearch(C),k(!1)},children:[e.jsx("label",{htmlFor:"site-search",className:"sr-only",children:"Search"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{id:"site-search",type:"search",placeholder:"Search...",autoFocus:!0,value:C,onChange:a=>{const h=a.target.value;z(h),typeof(r==null?void 0:r.onSearchChange)=="function"&&r.onSearchChange(h)},className:"w-full rounded-md border border-gray-300 px-3 py-2 text-gray-900 shadow-sm placeholder:text-gray-400 focus:border-gray-900 focus:outline-none focus:ring-2 focus:ring-gray-900"}),e.jsx("button",{type:"submit",className:"rounded-md bg-gray-900 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-gray-800 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gray-900",children:"Search"})]})]}),Array.isArray(y)&&y.length>0&&e.jsx("div",{className:"mt-4 divide-y divide-gray-200",children:y.map((a,h)=>{if(!a||typeof a!="object")return null;const u=a.title||a.q||a.name||"Result",w=a.desc||a.description||a.summary||a.a||"",c=typeof(r==null?void 0:r.searchTitleMax)=="number"?r.searchTitleMax:60,S=typeof(r==null?void 0:r.searchDescMax)=="number"?r.searchDescMax:100,M=typeof u=="string"&&u.length>c?`${u.slice(0,c-1)}…`:u,j=typeof w=="string"&&w.length>S?`${w.slice(0,S-1)}…`:w,d=typeof a.link=="string"?a.link:void 0,m=typeof d=="string"&&d.startsWith("/"),P=e.jsxs("div",{className:"flex items-start gap-3 py-3",children:[a!=null&&a.icon?e.jsx("div",{className:"mt-0.5 h-6 w-6 text-gray-500",children:a.icon}):a!=null&&a.image?e.jsx("img",{src:a.image,alt:u,className:"mt-0.5 h-6 w-6 rounded object-cover"}):e.jsx(g.MagnifyingGlassIcon,{"aria-hidden":"true",className:"mt-0.5 size-6 text-gray-400"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-gray-900 truncate",children:M}),j?e.jsx("div",{className:"text-sm text-gray-500 truncate",children:j}):null]})]});return d?m?e.jsx("a",{href:d,className:"block hover:bg-gray-50",onClick:()=>{typeof(r==null?void 0:r.onBeginNavigate)=="function"&&r.onBeginNavigate(),typeof(r==null?void 0:r.onClearQuickResults)=="function"&&r.onClearQuickResults(),k(!1)},children:P},d||h):e.jsx("a",{href:d,className:"block hover:bg-gray-50",onClick:()=>{typeof(r==null?void 0:r.onBeginNavigate)=="function"&&r.onBeginNavigate(),typeof(r==null?void 0:r.onClearQuickResults)=="function"&&r.onClearQuickResults(),k(!1)},children:P},d||h):e.jsx("div",{className:"block hover:bg-gray-50",children:P},h)})})]})})]}),e.jsxs(l.Dialog,{open:t,onClose:o,className:"lg:hidden",children:[e.jsx("div",{className:"fixed inset-0 z-50"}),e.jsxs(l.DialogPanel,{className:"fixed inset-y-0 right-0 z-50 w-full overflow-y-auto bg-white p-6 sm:max-w-sm sm:ring-1 sm:ring-gray-900/10",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(N,{href:"/",className:"-m-1.5 p-1.5","aria-label":r.logoAlt||"Home",children:r.logo?e.jsx("img",{alt:r.logoAlt||"Logo",src:r.logo,className:"h-8 w-auto"}):e.jsx("span",{className:"text-lg font-semibold",children:r.fallbackText||"NEXGEN Roofing Systems"})}),e.jsxs("button",{type:"button",onClick:()=>o(!1),className:"-m-2.5 rounded-md p-2.5 text-gray-700",children:[e.jsx("span",{className:"sr-only",children:"Close menu"}),e.jsx(g.XMarkIcon,{"aria-hidden":"true",className:"size-6"})]})]}),e.jsx("div",{className:"mt-6 flow-root",children:e.jsxs("div",{className:"-my-6 divide-y divide-gray-500/10",children:[e.jsx("div",{className:"space-y-2 py-6",children:r.menuItems.map(a=>a.subMenu?e.jsxs(l.Disclosure,{as:"div",className:"-mx-3",children:[e.jsxs(l.DisclosureButton,{className:"group flex w-full items-center justify-between rounded-lg py-2 pl-3 pr-3.5 text-base/7 font-semibold text-gray-900 hover:bg-gray-50",children:[a.title,e.jsx(b.ChevronDownIcon,{"aria-hidden":"true",className:"size-5 flex-none group-data-[open]:rotate-180"})]}),e.jsx(l.DisclosurePanel,{className:"mt-2 space-y-2",children:[...a.subMenu,...a.ctas||[]].map(h=>e.jsx(l.DisclosureButton,{as:"a",href:h.href,className:"block rounded-lg py-2 pl-6 pr-3 text-sm/7 font-semibold text-gray-900 hover:bg-gray-50",children:h.title},h.title))})]},a.id):a.useLink?e.jsx(N,{href:a.href,className:"-mx-3 block rounded-lg px-3 py-2 text-base/7 font-semibold text-gray-900 hover:bg-gray-50",children:a.title},a.id):e.jsx("a",{href:a.href,className:"-mx-3 block rounded-lg px-3 py-2 text-base/7 font-semibold text-gray-900 hover:bg-gray-50",children:a.title},a.id))}),e.jsxs("div",{className:"space-y-2 py-6",children:[r.login&&e.jsxs("a",{href:r.loginHref,className:"-mx-3 block rounded-lg px-3 py-2.5 text-base/7 font-semibold text-gray-900 hover:bg-gray-50",children:["Log in ",e.jsx("span",{"aria-hidden":"true",children:"→"})]}),r.cta&&e.jsx("a",{href:r.ctaBtnHref,className:"-mx-3 block rounded-lg bg-gray-900 px-3 py-2.5 text-base/7 font-semibold text-white hover:bg-gray-800",children:r.ctaTitle||"Sign up"})]})]})})]})]})]})}function Q(){return e.jsx(e.Fragment,{children:e.jsx("div",{className:"absolute inset-0 z-50 flex items-center justify-center",children:e.jsxs("div",{className:"flex flex-col items-center justify-center space-y-4",children:[e.jsx(g.CubeTransparentIcon,{className:"inset-shadow-sm 8 h-16 w-16 animate-[spin_2s_linear_infinite] rounded-full border-4 border-t-4 border-solid border-white text-5xl font-black text-primary"}),e.jsx("div",{className:"mt-16 flex w-full items-center justify-center py-8",children:e.jsx("p",{className:"text-xl font-thin uppercase tracking-widest text-primary",children:"Loading..."})})]})})})}function F({baseConfig:r}){const[f,s]=i.useState([]),[y,t]=i.useState(""),o=i.useRef(null),[n,x]=i.useState(!1),v=async h=>{const u=(h||"").trim();if(!u){s([]);return}try{const w=await fetch(`/api/search?q=${encodeURIComponent(u)}`);if(!w.ok)throw new Error("search failed");const c=await w.json(),S=[...Array.isArray(c==null?void 0:c.services)?c.services:[],...Array.isArray(c==null?void 0:c.faqs)?c.faqs:[],...Array.isArray(c==null?void 0:c.gallery)?c.gallery:[],...Array.isArray(c==null?void 0:c.posts)?c.posts:[],...Array.isArray(c==null?void 0:c.projects)?c.projects:[],...Array.isArray(c==null?void 0:c.locations)?c.locations:[]].filter(d=>d&&typeof d=="object"),M=new Set,j=S.filter(d=>{const m=`${(d.link||"").toLowerCase()}|${(d.title||d.q||"").toLowerCase()}`;return M.has(m)?!1:(M.add(m),!0)}).map(d=>{if(d!=null&&d.icon)return d;const m="h-6 w-6 text-gray-400";switch(d==null?void 0:d.kind){case"faq":return{...d,icon:e.jsx(g.QuestionMarkCircleIcon,{"aria-hidden":"true",className:m})};case"service":return{...d,icon:e.jsx(b.WrenchScrewdriverIcon,{"aria-hidden":"true",className:m})};case"project":return{...d,icon:e.jsx(g.BriefcaseIcon,{"aria-hidden":"true",className:m})};case"post":return{...d,icon:e.jsx(g.NewspaperIcon,{"aria-hidden":"true",className:m})};case"gallery":return{...d,icon:e.jsx(g.PhotoIcon,{"aria-hidden":"true",className:m})};case"location":return{...d,icon:e.jsx(g.MapPinIcon,{"aria-hidden":"true",className:m})};default:return d}});s(j)}catch{s([])}},k=h=>{t(h),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>v(h),300)},C=h=>{const u=(h||"").trim();u&&(x(!0),typeof window<"u"&&(window.location.href=`/search?q=${encodeURIComponent(u)}`))},z=h=>{h||(t(""),s([]),o.current&&clearTimeout(o.current))},a=i.useMemo(()=>({...r,search:!0,onSearchChange:k,onSearch:C,onSearchOpenChange:z,onClearQuickResults:()=>s([]),onBeginNavigate:()=>x(!0)}),[r]);return e.jsxs(e.Fragment,{children:[n&&e.jsx("div",{className:"fixed inset-0 z-[60]",children:e.jsx(Q,{})}),e.jsx($,{config:a,quickSearchResults:f})]})}p.NavController=F,p.SimpleLight=O,p.WithFlyout=A,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})});