Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@headlessui/react

Package Overview
Dependencies
Maintainers
2
Versions
727
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@headlessui/react - npm Package Compare versions

Comparing version 0.2.0-95c8cc7 to 0.2.0-9891fa3

6

dist/components/switch/switch.d.ts

@@ -7,3 +7,3 @@ import React, { ElementType } from 'react';

}
declare type SwitchPropsWeControl = 'id' | 'role' | 'tabIndex' | 'aria-checked' | 'aria-labelledby' | 'aria-describedby' | 'onClick' | 'onKeyUp' | 'onKeyPress';
declare type SwitchPropsWeControl = 'id' | 'role' | 'tabIndex' | 'aria-checked' | 'onClick' | 'onKeyUp' | 'onKeyPress';
export declare function Switch<TTag extends ElementType = typeof DEFAULT_SWITCH_TAG>(props: Props<TTag, SwitchRenderPropArg, SwitchPropsWeControl | 'checked' | 'onChange' | 'className'> & {

@@ -19,3 +19,2 @@ checked: boolean;

var Label: <TTag extends React.ElementType<any> = "label">(props: Props<TTag, LabelRenderPropArg, LabelPropsWeControl>) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | null;
var Description: <TTag extends React.ElementType<any> = "label">(props: Props<TTag, DescriptionRenderPropArg, DescriptionPropsWeControl>) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | null;
}

@@ -25,5 +24,2 @@ interface LabelRenderPropArg {

declare type LabelPropsWeControl = 'id' | 'ref' | 'onClick';
interface DescriptionRenderPropArg {
}
declare type DescriptionPropsWeControl = 'id' | 'ref';
export {};

2

dist/headlessui.cjs.production.min.js

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,n,t,r,o=require("react"),u=(e=o)&&"object"==typeof e&&"default"in e?e.default:e;function i(){return(i=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(this,arguments)}function a(e,n){if(null==e)return{};var t,r,o={},u=Object.keys(e);for(r=0;r<u.length;r++)n.indexOf(t=u[r])>=0||(o[t]=e[t]);return o}function c(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function l(e,n){var t;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return c(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?c(e,void 0):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(t=e[Symbol.iterator]()).next.bind(t)}function s(e,n){if(e in n){for(var t=n[e],r=arguments.length,o=new Array(r>2?r-2:0),u=2;u<r;u++)o[u-2]=arguments[u];return"function"==typeof t?t.apply(void 0,o):t}var i=new Error('Tried to handle "'+e+'" but there is no handler defined. Only defined handlers are: '+Object.keys(n).map((function(e){return'"'+e+'"'})).join(", ")+".");throw Error.captureStackTrace&&Error.captureStackTrace(i,s),i}function f(e,r,o,u,c){if(void 0===c&&(c=!0),c)return d(e,r,o);var l=null!=u?u:n.None;if(l&n.Static){var f=e.static,p=void 0!==f&&f,v=a(e,["static"]);if(p)return d(v,r,o)}if(l&n.RenderStrategy){var m,b=e.unmount,y=void 0===b||b,h=a(e,["unmount"]);return s(y?t.Unmount:t.Hidden,((m={})[t.Unmount]=function(){return null},m[t.Hidden]=function(){return d(i({},h,{hidden:!0,style:{display:"none"}}),r,o)},m))}return d(e,r,o)}function d(e,n,t){var r,u=v(e,["unmount","static"]),i=u.as,c=void 0===i?t:i,s=u.children,f=u.refName,p=void 0===f?"ref":f,m=a(u,["as","children","refName"]),b=void 0!==e.ref?((r={})[p]=e.ref,r):{},y="function"==typeof s?s(n):s;if(c===o.Fragment&&Object.keys(m).length>0){if(Array.isArray(y)&&y.length>1){var h=new Error("You should only render 1 child");throw Error.captureStackTrace&&Error.captureStackTrace(h,d),h}if(!o.isValidElement(y)){var g=new Error('You should render an element as a child. Did you forget the as="..." prop?');throw Error.captureStackTrace&&Error.captureStackTrace(g,d),g}return o.cloneElement(y,Object.assign({},function(e,n,t){for(var r,o=Object.assign({},e),u=function(){var t,u=r.value;void 0!==e[u]&&void 0!==n[u]&&Object.assign(o,((t={})[u]=function(t){t.defaultPrevented||e[u](t),t.defaultPrevented||n[u](t)},t))},i=l(["onClick"]);!(r=i()).done;)u();return o}(function(e){var n=Object.assign({},e);for(var t in n)void 0===n[t]&&delete n[t];return n}(v(m,["ref"])),y.props),b))}return o.createElement(c,Object.assign({},v(m,["ref"]),c!==o.Fragment&&b),y)}function p(e){return o.forwardRef(e)}function v(e,n){void 0===n&&(n=[]);for(var t,r=Object.assign({},e),o=l(n);!(t=o()).done;){var u=t.value;u in r&&delete r[u]}return r}function m(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];return o.useCallback((function(e){n.forEach((function(n){if(null!==n)return"function"==typeof n?n(e):void(n.current=e)}))}),[n])}function b(e){for(var n,t,r=e.parentElement,o=null;r&&!(r instanceof HTMLFieldSetElement);)r instanceof HTMLLegendElement&&(o=r),r=r.parentElement;var u=null!=(n=""===(null==(t=r)?void 0:t.getAttribute("disabled")))&&n;return(!u||!function(e){if(!e)return!1;for(var n=e.previousElementSibling;null!==n;){if(n instanceof HTMLLegendElement)return!1;n=n.previousElementSibling}return!0}(o))&&u}!function(e){e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static"}(n||(n={})),function(e){e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden"}(t||(t={})),function(e){e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.ArrowUp="ArrowUp",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab"}(r||(r={}));var y="undefined"!=typeof window?o.useLayoutEffect:o.useEffect,h={serverHandoffComplete:!1},g=0;function S(){return++g}function x(){var e=o.useState(h.serverHandoffComplete?S:null),n=e[0],t=e[1];return y((function(){null===n&&t(S())}),[n]),o.useEffect((function(){!1===h.serverHandoffComplete&&(h.serverHandoffComplete=!0)}),[]),null!=n?""+n:void 0}var C,w,O,I=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map((function(e){return e+":not([tabindex='-1'])"})).join(",");function E(e){e&&e.focus({preventScroll:!0})}function k(e,n){void 0===n&&(n=!0);var t=o.useRef(null),u=o.useCallback((function(){return e.current?Array.from(e.current.querySelectorAll(I)):[]}),[e]);y((function(){if(n){t.current=document.activeElement;var e=u();if(e.length<=0)throw new Error("There are no focusable elements inside the <FocusTrap />");return E(e[0]),function(){return E(t.current)}}}),[n]);var i=o.useCallback((function(e){if(n&&e.key===r.Tab&&document.activeElement){e.preventDefault();var t=e.shiftKey?-1:1,o=u(),i=o.length;!function e(n){void 0===n&&(n=0);var r=o.indexOf(document.activeElement),u=o[(r+i+t+n)%i];E(u),u!==document.activeElement&&e(n+t)}()}}),[u,n]);return o.useMemo((function(){return{handleKeyDown:i}}),[i])}!function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(w||(w={})),function(e){e[e.OpenDialog=0]="OpenDialog",e[e.CloseDialog=1]="CloseDialog"}(O||(O={}));var R=((C={})[O.OpenDialog]=function(e){return e.dialogState===w.Open?e:i({},e,{dialogState:w.Open})},C[O.CloseDialog]=function(e){return e.dialogState===w.Closed?e:i({},e,{dialogState:w.Closed})},C),D=o.createContext(null);function T(e){var n=o.useContext(D);if(null===n){var t=new Error("<"+e+" /> is missing a parent <"+M.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(t,T),t}return n}function L(e,n){return s(n.type,R,e,n)}D.displayName="DialogContext";var F=o.Fragment;function M(e){var n,t=function(){var n=e.hasOwnProperty("open"),t=e.hasOwnProperty("onClose");if(!n&&!t)return!1;if(!n)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!t)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if("boolean"!=typeof e.open)throw new Error("You provided an `open` prop to the `Dialog`, but the value is not a boolean. Received: "+e.open);if("function"!=typeof e.onClose)throw new Error("You provided an `onClose` prop to the `Dialog`, but the value is not a function. Received: "+e.onClose);return!0}(),i=o.useReducer(L,{dialogState:t?s(Number(e.open),(n={},n[Number(!0)]=w.Open,n[Number(!1)]=w.Closed,n)):w.Closed}),a=i[0],c=i[1],l=a.dialogState,d=e.onClose,p=o.useCallback((function(){c({type:O.CloseDialog}),t&&d(!1)}),[c,t,d]),v=o.useCallback((function(){return c({type:O.OpenDialog})}),[c]),m=o.useCallback((function(){var e;return s(l,((e={})[w.Open]=function(){return p()},e[w.Closed]=function(){return v()},e))}),[l,v,p]);o.useEffect((function(){t&&c(e.open?{type:O.OpenDialog}:{type:O.CloseDialog})}),[t,e.open]),o.useEffect((function(){function e(e){e.key===r.Escape&&l===w.Open&&p()}return window.addEventListener("keydown",e),function(){return window.removeEventListener("keydown",e)}}),[p,l]);var b=o.useMemo((function(){return[a,{open:v,close:p,toggle:m}]}),[a,v,p,m]),y=o.useMemo((function(){return{open:l===w.Open,close:p}}),[l,p]);return u.createElement(D.Provider,{value:b},f(e,y,F))}var P,A,N,j=p((function e(n,t){var u=T([M.name,e.name].join(".")),a=u[0],c=u[1].toggle,l=m(t),s="headlessui-dialog-button-"+x(),d=o.useCallback((function(e){if(b(e.currentTarget))return e.preventDefault();if(!n.disabled)switch(e.key){case r.Space:case r.Enter:e.preventDefault(),c()}}),[c,n.disabled]),p=o.useCallback((function(e){b(e.currentTarget)||n.disabled||c()}),[c,n.disabled]),v=o.useMemo((function(){return{open:a.dialogState===w.Open}}),[a]);return f(i({},n,{ref:l,id:s,type:"button",onKeyDown:d,onClick:p}),v,"button")})),U=n.RenderStrategy|n.Static,G=p((function e(n,t){var r=T([M.name,e.name].join(".")),u=r[0],a=r[1].close,c=o.useRef(null),l=m(c,t),s=k(c,!!n.static||u.dialogState===w.Open).handleKeyDown,d="headlessui-dialog-panel-"+x(),p=o.useCallback((function(e){return s(e)}),[s]),v=o.useMemo((function(){return{open:u.dialogState===w.Open,close:a}}),[u,a]);return f(i({},n,{ref:l,id:d,role:"dialog","aria-modal":!0,onKeyDown:p}),v,"div",U,u.dialogState===w.Open)})),H=n.RenderStrategy|n.Static,V=p((function e(n,t){var r=T([M.name,e.name].join(".")),u=r[0],a=r[1].close,c=m(t),l="headlessui-dialog-overlay-"+x(),s=o.useCallback((function(e){if(b(e.currentTarget))return e.preventDefault();a()}),[a]),d=o.useMemo((function(){return{open:u.dialogState===w.Open,close:a}}),[u,a]);return f(i({},n,{ref:c,id:l,onClick:s}),d,"button",H,u.dialogState===w.Open)}));M.Button=j,M.Panel=G,M.Overlay=V,function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(A||(A={})),function(e){e[e.ToggleDisclosure=0]="ToggleDisclosure",e[e.SetButtonId=1]="SetButtonId",e[e.SetPanelId=2]="SetPanelId",e[e.LinkPanel=3]="LinkPanel",e[e.UnlinkPanel=4]="UnlinkPanel"}(N||(N={}));var B=((P={})[N.ToggleDisclosure]=function(e){var n;return i({},e,{disclosureState:s(e.disclosureState,(n={},n[A.Open]=A.Closed,n[A.Closed]=A.Open,n))})},P[N.LinkPanel]=function(e){return i({},e,{linkedPanel:!0})},P[N.UnlinkPanel]=function(e){return i({},e,{linkedPanel:!1})},P[N.SetButtonId]=function(e,n){return i({},e,{buttonId:n.buttonId})},P[N.SetPanelId]=function(e,n){return i({},e,{panelId:n.panelId})},P),Q=o.createContext(null);function K(e){var n=o.useContext(Q);if(null===n){var t=new Error("<"+e+" /> is missing a parent <"+W.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(t,K),t}return n}function q(e,n){return s(n.type,B,e,n)}Q.displayName="DisclosureContext";var Y=o.Fragment;function W(e){var n="headlessui-disclosure-button-"+x(),t="headlessui-disclosure-panel-"+x(),r=o.useReducer(q,{disclosureState:A.Closed,linkedPanel:!1,buttonId:n,panelId:t}),i=r[0].disclosureState,a=r[1];o.useEffect((function(){return a({type:N.SetButtonId,buttonId:n})}),[n,a]),o.useEffect((function(){return a({type:N.SetPanelId,panelId:t})}),[t,a]);var c=o.useMemo((function(){return{open:i===A.Open}}),[i]);return u.createElement(Q.Provider,{value:r},f(e,c,Y))}var _=p((function e(n,t){var u=K([W.name,e.name].join(".")),a=u[0],c=u[1],l=m(t),s=o.useCallback((function(e){switch(e.key){case r.Space:case r.Enter:e.preventDefault(),c({type:N.ToggleDisclosure})}}),[c]),d=o.useCallback((function(e){b(e.currentTarget)||n.disabled||c({type:N.ToggleDisclosure})}),[c,n.disabled]),p=o.useMemo((function(){return{open:a.disclosureState===A.Open}}),[a]);return f(i({},n,{ref:l,id:a.buttonId,type:"button","aria-expanded":a.disclosureState===A.Open||void 0,"aria-controls":a.linkedPanel?a.panelId:void 0,onKeyDown:s,onClick:d}),p,"button")})),$=n.RenderStrategy|n.Static,z=p((function e(n,t){var r=K([W.name,e.name].join(".")),a=r[0],c=r[1],l=m(t,(function(){a.linkedPanel||c({type:N.LinkPanel})}));o.useEffect((function(){return function(){return c({type:N.UnlinkPanel})}}),[c]),u.useEffect((function(){var e;a.disclosureState!==A.Closed||null!=(e=n.unmount)&&!e||c({type:N.UnlinkPanel})}),[a.disclosureState,n.unmount,c]);var s=u.useMemo((function(){return{open:a.disclosureState===A.Open}}),[a]);return f(i({},n,{ref:l,id:a.panelId}),s,"div",$,a.disclosureState===A.Open)}));W.Button=_,W.Panel=z;var J,X,Z,ee,ne=p((function(e,n){var t=o.useRef(null),r=m(t,n),u=k(t).handleKeyDown,a=o.useMemo((function(){return{}}),[]);return f(i({},e,{ref:r,onKeyDown:u}),a,"div")}));function te(){var e=[],n={requestAnimationFrame:function(e){function n(){return e.apply(this,arguments)}return n.toString=function(){return e.toString()},n}((function(){var e=requestAnimationFrame.apply(void 0,arguments);n.add((function(){return cancelAnimationFrame(e)}))})),nextFrame:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];n.requestAnimationFrame((function(){n.requestAnimationFrame.apply(n,t)}))},setTimeout:function(e){function n(){return e.apply(this,arguments)}return n.toString=function(){return e.toString()},n}((function(){var e=setTimeout.apply(void 0,arguments);n.add((function(){return clearTimeout(e)}))})),add:function(n){e.push(n)},dispose:function(){for(var n,t=l(e.splice(0));!(n=t()).done;)(0,n.value)()}};return n}function re(){var e=o.useState(te)[0];return o.useEffect((function(){return function(){return e.dispose()}}),[e]),e}function oe(e,n){var t=o.useState(e),r=t[0],u=t[1],i=o.useRef(e);return y((function(){i.current=e}),[e]),y((function(){return u(i.current)}),[i,u].concat(n)),r}function ue(e,n){var t=n.resolveItems();if(t.length<=0)return null;var r=n.resolveActiveIndex(),o=null!=r?r:-1,u=function(){switch(e.focus){case J.First:return t.findIndex((function(e){return!n.resolveDisabled(e)}));case J.Previous:var r=t.slice().reverse().findIndex((function(e,t,r){return!(-1!==o&&r.length-t-1>=o||n.resolveDisabled(e))}));return-1===r?r:t.length-1-r;case J.Next:return t.findIndex((function(e,t){return!(t<=o||n.resolveDisabled(e))}));case J.Last:var u=t.slice().reverse().findIndex((function(e){return!n.resolveDisabled(e)}));return-1===u?u:t.length-1-u;case J.Specific:return t.findIndex((function(t){return n.resolveId(t)===e.id}));case J.Nothing:return null;default:!function(e){throw new Error("Unexpected object: "+e)}(e)}}();return-1===u?r:u}function ie(e,n){if(void 0!==e)return"function"==typeof e?e(n):e}!function(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"}(J||(J={})),function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(Z||(Z={})),function(e){e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.GoToOption=2]="GoToOption",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterOption=5]="RegisterOption",e[e.UnregisterOption=6]="UnregisterOption"}(ee||(ee={}));var ae=((X={})[ee.CloseListbox]=function(e){return i({},e,{activeOptionIndex:null,listboxState:Z.Closed})},X[ee.OpenListbox]=function(e){return i({},e,{listboxState:Z.Open})},X[ee.GoToOption]=function(e,n){var t=ue(n,{resolveItems:function(){return e.options},resolveActiveIndex:function(){return e.activeOptionIndex},resolveId:function(e){return e.id},resolveDisabled:function(e){return e.dataRef.current.disabled}});return""===e.searchQuery&&e.activeOptionIndex===t?e:i({},e,{searchQuery:"",activeOptionIndex:t})},X[ee.Search]=function(e,n){var t=e.searchQuery+n.value,r=e.options.findIndex((function(e){var n;return!e.dataRef.current.disabled&&(null==(n=e.dataRef.current.textValue)?void 0:n.startsWith(t))}));return i({},e,-1===r||r===e.activeOptionIndex?{searchQuery:t}:{searchQuery:t,activeOptionIndex:r})},X[ee.ClearSearch]=function(e){return i({},e,{searchQuery:""})},X[ee.RegisterOption]=function(e,n){return i({},e,{options:[].concat(e.options,[{id:n.id,dataRef:n.dataRef}])})},X[ee.UnregisterOption]=function(e,n){var t=e.options.slice(),r=null!==e.activeOptionIndex?t[e.activeOptionIndex]:null,o=t.findIndex((function(e){return e.id===n.id}));return-1!==o&&t.splice(o,1),i({},e,{options:t,activeOptionIndex:o===e.activeOptionIndex||null===r?null:t.indexOf(r)})},X),ce=o.createContext(null);function le(e){var n=o.useContext(ce);if(null===n){var t=new Error("<"+e+" /> is missing a parent <"+de.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(t,le),t}return n}function se(e,n){return s(n.type,ae,e,n)}ce.displayName="ListboxContext";var fe=o.Fragment;function de(e){var n=e.value,t=e.onChange,r=a(e,["value","onChange"]),i=re(),c=o.useReducer(se,{listboxState:Z.Closed,propsRef:{current:{value:n,onChange:t}},labelRef:o.createRef(),buttonRef:o.createRef(),optionsRef:o.createRef(),options:[],searchQuery:"",activeOptionIndex:null}),l=c[0],s=l.listboxState,d=l.propsRef,p=l.optionsRef,v=l.buttonRef,m=c[1];y((function(){d.current.value=n}),[n,d]),y((function(){d.current.onChange=t}),[t,d]),o.useEffect((function(){function e(e){var n,t,r,o=e.target,u=document.activeElement;s===Z.Open&&((null==(n=v.current)?void 0:n.contains(o))||((null==(t=p.current)?void 0:t.contains(o))||m({type:ee.CloseListbox}),u!==document.body&&(null==u?void 0:u.contains(o))||e.defaultPrevented||null==(r=v.current)||r.focus({preventScroll:!0})))}return window.addEventListener("mousedown",e),function(){return window.removeEventListener("mousedown",e)}}),[s,p,v,i,m]);var b=o.useMemo((function(){return{open:s===Z.Open}}),[s]);return u.createElement(ce.Provider,{value:c},f(r,b,fe))}var pe,ve,me,be=p((function e(n,t){var u,a=le([de.name,e.name].join(".")),c=a[0],l=a[1],s=m(c.buttonRef,t),d="headlessui-listbox-button-"+x(),p=re(),v=o.useCallback((function(e){switch(e.key){case r.Space:case r.Enter:case r.ArrowDown:e.preventDefault(),l({type:ee.OpenListbox}),p.nextFrame((function(){var e;null==(e=c.optionsRef.current)||e.focus({preventScroll:!0}),c.propsRef.current.value||l({type:ee.GoToOption,focus:J.First})}));break;case r.ArrowUp:e.preventDefault(),l({type:ee.OpenListbox}),p.nextFrame((function(){var e;null==(e=c.optionsRef.current)||e.focus({preventScroll:!0}),c.propsRef.current.value||l({type:ee.GoToOption,focus:J.Last})}))}}),[l,c,p]),y=o.useCallback((function(e){if(b(e.currentTarget))return e.preventDefault();n.disabled||(c.listboxState===Z.Open?(l({type:ee.CloseListbox}),p.nextFrame((function(){var e;return null==(e=c.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(e.preventDefault(),l({type:ee.OpenListbox}),p.nextFrame((function(){var e;return null==(e=c.optionsRef.current)?void 0:e.focus({preventScroll:!0})}))))}),[l,p,c,n.disabled]),h=oe((function(){if(c.labelRef.current)return[c.labelRef.current.id,d].join(" ")}),[c.labelRef.current,d]),g=o.useMemo((function(){return{open:c.listboxState===Z.Open}}),[c]);return f(i({},n,{ref:s,id:d,type:"button","aria-haspopup":!0,"aria-controls":null==(u=c.optionsRef.current)?void 0:u.id,"aria-expanded":c.listboxState===Z.Open||void 0,"aria-labelledby":h,onKeyDown:v,onClick:y}),g,"button")})),ye=n.RenderStrategy|n.Static,he=p((function e(n,t){var u,a=le([de.name,e.name].join(".")),c=a[0],l=a[1],s=m(c.optionsRef,t),d="headlessui-listbox-options-"+x(),p=re(),v=re(),b=o.useCallback((function(e){switch(v.dispose(),e.key){case r.Space:if(""!==c.searchQuery)return e.preventDefault(),l({type:ee.Search,value:e.key});case r.Enter:e.preventDefault(),l({type:ee.CloseListbox}),null!==c.activeOptionIndex&&c.propsRef.current.onChange(c.options[c.activeOptionIndex].dataRef.current.value),te().nextFrame((function(){var e;return null==(e=c.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case r.ArrowDown:return e.preventDefault(),l({type:ee.GoToOption,focus:J.Next});case r.ArrowUp:return e.preventDefault(),l({type:ee.GoToOption,focus:J.Previous});case r.Home:case r.PageUp:return e.preventDefault(),l({type:ee.GoToOption,focus:J.First});case r.End:case r.PageDown:return e.preventDefault(),l({type:ee.GoToOption,focus:J.Last});case r.Escape:return e.preventDefault(),l({type:ee.CloseListbox}),p.nextFrame((function(){var e;return null==(e=c.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));case r.Tab:return e.preventDefault();default:1===e.key.length&&(l({type:ee.Search,value:e.key}),v.setTimeout((function(){return l({type:ee.ClearSearch})}),350))}}),[p,l,v,c]),y=oe((function(){var e,n,t;return null!=(e=null==(n=c.labelRef.current)?void 0:n.id)?e:null==(t=c.buttonRef.current)?void 0:t.id}),[c.labelRef.current,c.buttonRef.current]),h=o.useMemo((function(){return{open:c.listboxState===Z.Open}}),[c]);return f(i({},n,{"aria-activedescendant":null===c.activeOptionIndex||null==(u=c.options[c.activeOptionIndex])?void 0:u.id,"aria-labelledby":y,id:d,onKeyDown:b,role:"listbox",tabIndex:0,ref:s}),h,"ul",ye,c.listboxState===Z.Open)}));de.Button=be,de.Label=function e(n){var t=le([de.name,e.name].join("."))[0],r="headlessui-listbox-label-"+x(),u=o.useCallback((function(){var e;return null==(e=t.buttonRef.current)?void 0:e.focus({preventScroll:!0})}),[t.buttonRef]),a=o.useMemo((function(){return{open:t.listboxState===Z.Open}}),[t]);return f(i({},n,{ref:t.labelRef,id:r,onClick:u}),a,"label")},de.Options=he,de.Option=function e(n){var t=n.disabled,r=void 0!==t&&t,u=n.value,c=n.className,l=a(n,["disabled","value","className"]),s=le([de.name,e.name].join(".")),d=s[0],p=s[1],v="headlessui-listbox-option-"+x(),m=null!==d.activeOptionIndex&&d.options[d.activeOptionIndex].id===v,b=d.propsRef.current.value===u,h=o.useRef({disabled:r,value:u});y((function(){h.current.disabled=r}),[h,r]),y((function(){h.current.value=u}),[h,u]),y((function(){var e,n;h.current.textValue=null==(e=document.getElementById(v))||null==(n=e.textContent)?void 0:n.toLowerCase()}),[h,v]);var g=o.useCallback((function(){return d.propsRef.current.onChange(u)}),[d.propsRef,u]);y((function(){return p({type:ee.RegisterOption,id:v,dataRef:h}),function(){return p({type:ee.UnregisterOption,id:v})}}),[h,v]),y((function(){var e;d.listboxState===Z.Open&&b&&(p({type:ee.GoToOption,focus:J.Specific,id:v}),null==(e=document.getElementById(v))||null==e.focus||e.focus())}),[d.listboxState]),y((function(){if(d.listboxState===Z.Open&&m){var e=te();return e.nextFrame((function(){var e;return null==(e=document.getElementById(v))||null==e.scrollIntoView?void 0:e.scrollIntoView({block:"nearest"})})),e.dispose}}),[m,d.listboxState]);var S=o.useCallback((function(e){if(r)return e.preventDefault();g(),p({type:ee.CloseListbox}),te().nextFrame((function(){var e;return null==(e=d.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))}),[p,d.buttonRef,r,g]),C=o.useCallback((function(){if(r)return p({type:ee.GoToOption,focus:J.Nothing});p({type:ee.GoToOption,focus:J.Specific,id:v})}),[r,v,p]),w=o.useCallback((function(){r||m||p({type:ee.GoToOption,focus:J.Specific,id:v})}),[r,m,v,p]),O=o.useCallback((function(){r||m&&p({type:ee.GoToOption,focus:J.Nothing})}),[r,m,p]),I=o.useMemo((function(){return{active:m,selected:b,disabled:r}}),[m,b,r]);return f(i({},l,{id:v,role:"option",tabIndex:-1,className:ie(c,I),"aria-disabled":!0===r||void 0,"aria-selected":!0===b||void 0,onClick:S,onFocus:C,onPointerMove:w,onMouseMove:w,onPointerLeave:O,onMouseLeave:O}),I,"li")},function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(ve||(ve={})),function(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.RegisterItem=5]="RegisterItem",e[e.UnregisterItem=6]="UnregisterItem"}(me||(me={}));var ge=((pe={})[me.CloseMenu]=function(e){return i({},e,{activeItemIndex:null,menuState:ve.Closed})},pe[me.OpenMenu]=function(e){return i({},e,{menuState:ve.Open})},pe[me.GoToItem]=function(e,n){var t=ue(n,{resolveItems:function(){return e.items},resolveActiveIndex:function(){return e.activeItemIndex},resolveId:function(e){return e.id},resolveDisabled:function(e){return e.dataRef.current.disabled}});return""===e.searchQuery&&e.activeItemIndex===t?e:i({},e,{searchQuery:"",activeItemIndex:t})},pe[me.Search]=function(e,n){var t=e.searchQuery+n.value,r=e.items.findIndex((function(e){var n;return(null==(n=e.dataRef.current.textValue)?void 0:n.startsWith(t))&&!e.dataRef.current.disabled}));return i({},e,-1===r||r===e.activeItemIndex?{searchQuery:t}:{searchQuery:t,activeItemIndex:r})},pe[me.ClearSearch]=function(e){return i({},e,{searchQuery:""})},pe[me.RegisterItem]=function(e,n){return i({},e,{items:[].concat(e.items,[{id:n.id,dataRef:n.dataRef}])})},pe[me.UnregisterItem]=function(e,n){var t=e.items.slice(),r=null!==e.activeItemIndex?t[e.activeItemIndex]:null,o=t.findIndex((function(e){return e.id===n.id}));return-1!==o&&t.splice(o,1),i({},e,{items:t,activeItemIndex:o===e.activeItemIndex||null===r?null:t.indexOf(r)})},pe),Se=o.createContext(null);function xe(e){var n=o.useContext(Se);if(null===n){var t=new Error("<"+e+" /> is missing a parent <"+Oe.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(t,xe),t}return n}function Ce(e,n){return s(n.type,ge,e,n)}Se.displayName="MenuContext";var we=o.Fragment;function Oe(e){var n=o.useReducer(Ce,{menuState:ve.Closed,buttonRef:o.createRef(),itemsRef:o.createRef(),items:[],searchQuery:"",activeItemIndex:null}),t=n[0],r=t.menuState,i=t.itemsRef,a=t.buttonRef,c=n[1];o.useEffect((function(){function e(e){var n,t,o,u=e.target,l=document.activeElement;r===ve.Open&&((null==(n=a.current)?void 0:n.contains(u))||((null==(t=i.current)?void 0:t.contains(u))||c({type:me.CloseMenu}),l!==document.body&&(null==l?void 0:l.contains(u))||e.defaultPrevented||null==(o=a.current)||o.focus({preventScroll:!0})))}return window.addEventListener("mousedown",e),function(){return window.removeEventListener("mousedown",e)}}),[r,i,a,c]);var l=o.useMemo((function(){return{open:r===ve.Open}}),[r]);return u.createElement(Se.Provider,{value:n},f(e,l,we))}var Ie=p((function e(n,t){var u,a=xe([Oe.name,e.name].join(".")),c=a[0],l=a[1],s=m(c.buttonRef,t),d="headlessui-menu-button-"+x(),p=re(),v=o.useCallback((function(e){switch(e.key){case r.Space:case r.Enter:case r.ArrowDown:e.preventDefault(),l({type:me.OpenMenu}),p.nextFrame((function(){var e;null==(e=c.itemsRef.current)||e.focus({preventScroll:!0}),l({type:me.GoToItem,focus:J.First})}));break;case r.ArrowUp:e.preventDefault(),l({type:me.OpenMenu}),p.nextFrame((function(){var e;null==(e=c.itemsRef.current)||e.focus({preventScroll:!0}),l({type:me.GoToItem,focus:J.Last})}))}}),[l,c,p]),y=o.useCallback((function(e){if(b(e.currentTarget))return e.preventDefault();n.disabled||(c.menuState===ve.Open?(l({type:me.CloseMenu}),p.nextFrame((function(){var e;return null==(e=c.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(e.preventDefault(),l({type:me.OpenMenu}),p.nextFrame((function(){var e;return null==(e=c.itemsRef.current)?void 0:e.focus({preventScroll:!0})}))))}),[l,p,c,n.disabled]),h=o.useMemo((function(){return{open:c.menuState===ve.Open}}),[c]);return f(i({},n,{ref:s,id:d,type:"button","aria-haspopup":!0,"aria-controls":null==(u=c.itemsRef.current)?void 0:u.id,"aria-expanded":c.menuState===ve.Open||void 0,onKeyDown:v,onClick:y}),h,"button")})),Ee=n.RenderStrategy|n.Static,ke=p((function e(n,t){var u,a,c=xe([Oe.name,e.name].join(".")),l=c[0],s=c[1],d=m(l.itemsRef,t),p="headlessui-menu-items-"+x(),v=re(),b=o.useCallback((function(e){switch(v.dispose(),e.key){case r.Space:if(""!==l.searchQuery)return e.preventDefault(),s({type:me.Search,value:e.key});case r.Enter:var n;e.preventDefault(),s({type:me.CloseMenu}),null!==l.activeItemIndex&&(null==(n=document.getElementById(l.items[l.activeItemIndex].id))||n.click()),te().nextFrame((function(){var e;return null==(e=l.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case r.ArrowDown:return e.preventDefault(),s({type:me.GoToItem,focus:J.Next});case r.ArrowUp:return e.preventDefault(),s({type:me.GoToItem,focus:J.Previous});case r.Home:case r.PageUp:return e.preventDefault(),s({type:me.GoToItem,focus:J.First});case r.End:case r.PageDown:return e.preventDefault(),s({type:me.GoToItem,focus:J.Last});case r.Escape:e.preventDefault(),s({type:me.CloseMenu}),te().nextFrame((function(){var e;return null==(e=l.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case r.Tab:return e.preventDefault();default:1===e.key.length&&(s({type:me.Search,value:e.key}),v.setTimeout((function(){return s({type:me.ClearSearch})}),350))}}),[s,v,l]),y=o.useMemo((function(){return{open:l.menuState===ve.Open}}),[l]);return f(i({},n,{"aria-activedescendant":null===l.activeItemIndex||null==(u=l.items[l.activeItemIndex])?void 0:u.id,"aria-labelledby":null==(a=l.buttonRef.current)?void 0:a.id,id:p,onKeyDown:b,role:"menu",tabIndex:0,ref:d}),y,"div",Ee,l.menuState===ve.Open)})),Re=o.Fragment;Oe.Button=Ie,Oe.Items=ke,Oe.Item=function e(n){var t=n.disabled,r=void 0!==t&&t,u=n.className,c=n.onClick,l=a(n,["disabled","className","onClick"]),s=xe([Oe.name,e.name].join(".")),d=s[0],p=s[1],v="headlessui-menu-item-"+x(),m=null!==d.activeItemIndex&&d.items[d.activeItemIndex].id===v,b=o.useRef({disabled:r});y((function(){b.current.disabled=r}),[b,r]),y((function(){var e,n;b.current.textValue=null==(e=document.getElementById(v))||null==(n=e.textContent)?void 0:n.toLowerCase()}),[b,v]),y((function(){return p({type:me.RegisterItem,id:v,dataRef:b}),function(){return p({type:me.UnregisterItem,id:v})}}),[b,v]);var h=o.useCallback((function(e){return r?e.preventDefault():(p({type:me.CloseMenu}),te().nextFrame((function(){var e;return null==(e=d.buttonRef.current)?void 0:e.focus({preventScroll:!0})})),c?c(e):void 0)}),[p,d.buttonRef,r,c]),g=o.useCallback((function(){if(r)return p({type:me.GoToItem,focus:J.Nothing});p({type:me.GoToItem,focus:J.Specific,id:v})}),[r,v,p]),S=o.useCallback((function(){r||m||p({type:me.GoToItem,focus:J.Specific,id:v})}),[r,m,v,p]),C=o.useCallback((function(){r||m&&p({type:me.GoToItem,focus:J.Nothing})}),[r,m,p]),w=o.useMemo((function(){return{active:m,disabled:r}}),[m,r]);return f(i({},l,{id:v,role:"menuitem",tabIndex:-1,className:ie(u,w),"aria-disabled":!0===r||void 0,onClick:h,onFocus:g,onPointerMove:S,onMouseMove:S,onPointerLeave:C,onMouseLeave:C}),w,Re)};var De=o.createContext(null);function Te(e){var n=o.useContext(De);if(null===n){var t=new Error("<"+e+" /> is missing a parent <Switch.Group /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Te),t}return n}De.displayName="GroupContext";var Le,Fe=o.Fragment;function Me(e){var n,t,u=e.checked,c=e.onChange,l=e.className,s=a(e,["checked","onChange","className"]),d="headlessui-switch-"+x(),p=o.useContext(De),v=o.useCallback((function(){return c(!u)}),[c,u]),m=o.useCallback((function(e){if(b(e.currentTarget))return e.preventDefault();e.preventDefault(),v()}),[v]),y=o.useCallback((function(e){e.key!==r.Tab&&e.preventDefault(),e.key===r.Space&&v()}),[v]),h=o.useCallback((function(e){return e.preventDefault()}),[]),g=o.useMemo((function(){return{checked:u}}),[u]),S={id:d,ref:null===p?void 0:p.setSwitch,role:"switch",tabIndex:0,className:ie(l,g),"aria-checked":u,"aria-labelledby":null==p||null==(n=p.label)?void 0:n.id,"aria-describedby":null==p||null==(t=p.description)?void 0:t.id,onClick:m,onKeyUp:y,onKeyPress:h};return"button"===s.as&&Object.assign(S,{type:"button"}),f(i({},s,S),g,"button")}function Pe(){var e=o.useRef(!0);return o.useEffect((function(){e.current=!1}),[]),e.current}function Ae(e){for(var n,t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];e&&r.length>0&&(n=e.classList).add.apply(n,r)}function Ne(e){for(var n,t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];e&&r.length>0&&(n=e.classList).remove.apply(n,r)}function je(e,n,t,r,o){var u=te(),i=void 0!==o?function(e){var n={called:!1};return function(){if(!n.called)return n.called=!0,e.apply(void 0,arguments)}}(o):function(){};return Ae.apply(void 0,[e].concat(n,t)),u.nextFrame((function(){Ne.apply(void 0,[e].concat(t)),Ae.apply(void 0,[e].concat(r)),u.add(function(e,n){var t=te();if(!e)return t.dispose;var r=getComputedStyle(e),o=[r.transitionDuration,r.transitionDelay].map((function(e){var n=e.split(",").filter(Boolean).map((function(e){return e.includes("ms")?parseFloat(e):1e3*parseFloat(e)})).sort((function(e,n){return n-e}))[0];return void 0===n?0:n})),u=o[0];return 0!==u?t.setTimeout((function(){n(Le.Finished)}),u+o[1]):n(Le.Finished),t.add((function(){return n(Le.Cancelled)})),t.dispose}(e,(function(t){return Ne.apply(void 0,[e].concat(r,n)),i(t)})))})),u.add((function(){return Ne.apply(void 0,[e].concat(n,t,r))})),u.add((function(){return i(Le.Cancelled)})),u.dispose}function Ue(e){return void 0===e&&(e=""),o.useMemo((function(){return e.split(" ").filter((function(e){return e.trim().length>1}))}),[e])}Me.Group=function(e){var n=o.useState(null),t=n[0],r=n[1],i=o.useState(null),a=i[0],c=i[1],l=o.useState(null),s=l[0],d=l[1],p=o.useMemo((function(){return{switch:t,setSwitch:r,label:a,setLabel:c,description:s,setDescription:d}}),[t,r,a,c,s,d]);return u.createElement(De.Provider,{value:p},f(e,{},Fe))},Me.Label=function e(n){var t=Te([Me.name,e.name].join(".")),r="headlessui-switch-label-"+x(),u=o.useCallback((function(){t.switch&&(t.switch.click(),t.switch.focus({preventScroll:!0}))}),[t.switch]);return f(i({},n,{ref:t.setLabel,id:r,onClick:u}),{},"label")},Me.Description=function e(n){var t=Te([Me.name,e.name].join(".")),r="headlessui-switch-description-"+x();return f(i({},n,{ref:t.setDescription,id:r}),{},"p")},function(e){e.Finished="finished",e.Cancelled="cancelled"}(Le||(Le={}));var Ge,He=o.createContext(null);He.displayName="TransitionContext",function(e){e.Visible="visible",e.Hidden="hidden"}(Ge||(Ge={}));var Ve=o.createContext(null);function Be(e){return"children"in e?Be(e.children):e.current.filter((function(e){return e.state===Ge.Visible})).length>0}function Qe(e){var n=o.useRef(e),r=o.useRef([]),u=function(){var e=o.useRef(!0);return o.useEffect((function(){return function(){e.current=!1}}),[]),e}();o.useEffect((function(){n.current=e}),[e]);var i=o.useCallback((function(e,o){var i;void 0===o&&(o=t.Hidden);var a=r.current.findIndex((function(n){return n.id===e}));-1!==a&&(s(o,((i={})[t.Unmount]=function(){r.current.splice(a,1)},i[t.Hidden]=function(){r.current[a].state=Ge.Hidden},i)),!Be(r)&&u.current&&(null==n.current||n.current()))}),[n,u,r]),a=o.useCallback((function(e){var n=r.current.find((function(n){return n.id===e}));return n?n.state!==Ge.Visible&&(n.state=Ge.Visible):r.current.push({id:e,state:Ge.Visible}),function(){return i(e,t.Unmount)}}),[r,i]);return o.useMemo((function(){return{children:r,register:a,unregister:i}}),[a,i,r])}function Ke(){}Ve.displayName="NestingContext";var qe=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function Ye(e){for(var n,t={},r=l(qe);!(n=r()).done;){var o,u=n.value;t[u]=null!=(o=e[u])?o:Ke}return t}var We=n.RenderStrategy;function _e(e){var n=e.beforeEnter,r=e.afterEnter,c=e.beforeLeave,l=e.afterLeave,d=e.enter,p=e.enterFrom,v=e.enterTo,m=e.leave,b=e.leaveFrom,h=e.leaveTo,g=a(e,["beforeEnter","afterEnter","beforeLeave","afterLeave","enter","enterFrom","enterTo","leave","leaveFrom","leaveTo"]),S=o.useRef(null),C=o.useState(Ge.Visible),w=C[0],O=C[1],I=g.unmount?t.Unmount:t.Hidden,E=function(){var e=o.useContext(He);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition />.");return e}(),k=E.show,R=E.appear,D=function(){var e=o.useContext(Ve);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition />.");return e}(),T=D.register,L=D.unregister,F=Pe(),M=x(),P=o.useRef(!1),A=Qe((function(){P.current||(O(Ge.Hidden),L(M),B.current.afterLeave())}));y((function(){if(M)return T(M)}),[T,M]),y((function(){var e;I===t.Hidden&&M&&(k&&w!==Ge.Visible?O(Ge.Visible):s(w,((e={})[Ge.Hidden]=function(){return L(M)},e[Ge.Visible]=function(){return T(M)},e)))}),[w,M,T,L,k,I]);var N=Ue(d),j=Ue(p),U=Ue(v),G=Ue(m),H=Ue(b),V=Ue(h),B=function(e){var n=o.useRef(Ye(e));return o.useEffect((function(){n.current=Ye(e)}),[e]),n}({beforeEnter:n,afterEnter:r,beforeLeave:c,afterLeave:l});o.useEffect((function(){if(w===Ge.Visible&&null===S.current)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")}),[S,w]);var Q=F&&!R;return y((function(){var e=S.current;if(e&&!Q)return P.current=!0,k&&B.current.beforeEnter(),k||B.current.beforeLeave(),k?je(e,N,j,U,(function(e){P.current=!1,e===Le.Finished&&B.current.afterEnter()})):je(e,G,H,V,(function(e){P.current=!1,e===Le.Finished&&(Be(A)||(O(Ge.Hidden),L(M),B.current.afterLeave()))}))}),[B,M,P,L,A,S,Q,k,N,j,U,G,H,V]),u.createElement(Ve.Provider,{value:A},f(i({},g,{ref:S}),{},"div",We,w===Ge.Visible))}function $e(e){var n=e.show,t=e.appear,r=void 0!==t&&t,c=e.unmount,l=a(e,["show","appear","unmount"]);if(![!0,!1].includes(n))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");var s=o.useState(n?Ge.Visible:Ge.Hidden),d=s[0],p=s[1],v=Qe((function(){p(Ge.Hidden)})),m=Pe(),b=o.useMemo((function(){return{show:n,appear:r||!m}}),[n,r,m]);o.useEffect((function(){n?p(Ge.Visible):Be(v)||p(Ge.Hidden)}),[n,v]);var y={unmount:c};return u.createElement(Ve.Provider,{value:v},u.createElement(He.Provider,{value:b},f(i({},y,{as:o.Fragment,children:u.createElement(_e,Object.assign({},y,l))}),{},o.Fragment,We,d===Ge.Visible)))}$e.Child=_e,exports.Dialog=M,exports.Disclosure=W,exports.FocusTrap=ne,exports.Listbox=de,exports.Menu=Oe,exports.Switch=Me,exports.Transition=$e;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,n=require("react"),t=(e=n)&&"object"==typeof e&&"default"in e?e.default:e;function r(){return(r=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(this,arguments)}function o(e,n){if(null==e)return{};var t,r,o={},u=Object.keys(e);for(r=0;r<u.length;r++)n.indexOf(t=u[r])>=0||(o[t]=e[t]);return o}function u(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function i(e,n){var t;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return u(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?u(e,void 0):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(t=e[Symbol.iterator]()).next.bind(t)}var a,c,l,s="undefined"!=typeof window?n.useLayoutEffect:n.useEffect,f={serverHandoffComplete:!1},d=0;function v(){return++d}function p(){var e=n.useState(f.serverHandoffComplete?v:null),t=e[0],r=e[1];return s((function(){null===t&&r(v())}),[t]),n.useEffect((function(){!1===f.serverHandoffComplete&&(f.serverHandoffComplete=!0)}),[]),null!=t?""+t:void 0}function m(){var e=n.useRef(!0);return n.useEffect((function(){e.current=!1}),[]),e.current}function b(e,n){if(e in n){for(var t=n[e],r=arguments.length,o=new Array(r>2?r-2:0),u=2;u<r;u++)o[u-2]=arguments[u];return"function"==typeof t?t.apply(void 0,o):t}var i=new Error('Tried to handle "'+e+'" but there is no handler defined. Only defined handlers are: '+Object.keys(n).map((function(e){return'"'+e+'"'})).join(", ")+".");throw Error.captureStackTrace&&Error.captureStackTrace(i,b),i}function y(e,n,t,u,i){if(void 0===i&&(i=!0),i)return h(e,n,t);var l=null!=u?u:a.None;if(l&a.Static){var s=e.static,f=void 0!==s&&s,d=o(e,["static"]);if(f)return h(d,n,t)}if(l&a.RenderStrategy){var v,p=e.unmount,m=void 0===p||p,y=o(e,["unmount"]);return b(m?c.Unmount:c.Hidden,((v={})[c.Unmount]=function(){return null},v[c.Hidden]=function(){return h(r({},y,{hidden:!0,style:{display:"none"}}),n,t)},v))}return h(e,n,t)}function h(e,t,r){var u,a=g(e,["unmount","static"]),c=a.as,l=void 0===c?r:c,s=a.children,f=a.refName,d=void 0===f?"ref":f,v=o(a,["as","children","refName"]),p=void 0!==e.ref?((u={})[d]=e.ref,u):{},m="function"==typeof s?s(t):s;if(l===n.Fragment&&Object.keys(v).length>0){if(Array.isArray(m)&&m.length>1){var b=new Error("You should only render 1 child");throw Error.captureStackTrace&&Error.captureStackTrace(b,h),b}if(!n.isValidElement(m)){var y=new Error('You should render an element as a child. Did you forget the as="..." prop?');throw Error.captureStackTrace&&Error.captureStackTrace(y,h),y}return n.cloneElement(m,Object.assign({},function(e,n,t){for(var r,o=Object.assign({},e),u=function(){var t,u=r.value;void 0!==e[u]&&void 0!==n[u]&&Object.assign(o,((t={})[u]=function(t){t.defaultPrevented||e[u](t),t.defaultPrevented||n[u](t)},t))},a=i(["onClick"]);!(r=a()).done;)u();return o}(function(e){var n=Object.assign({},e);for(var t in n)void 0===n[t]&&delete n[t];return n}(g(v,["ref"])),m.props),p))}return n.createElement(l,Object.assign({},g(v,["ref"]),l!==n.Fragment&&p),m)}function x(e){return n.forwardRef(e)}function g(e,n){void 0===n&&(n=[]);for(var t,r=Object.assign({},e),o=i(n);!(t=o()).done;){var u=t.value;u in r&&delete r[u]}return r}function S(){var e=[],n={requestAnimationFrame:function(e){function n(){return e.apply(this,arguments)}return n.toString=function(){return e.toString()},n}((function(){var e=requestAnimationFrame.apply(void 0,arguments);n.add((function(){return cancelAnimationFrame(e)}))})),nextFrame:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];n.requestAnimationFrame((function(){n.requestAnimationFrame.apply(n,t)}))},setTimeout:function(e){function n(){return e.apply(this,arguments)}return n.toString=function(){return e.toString()},n}((function(){var e=setTimeout.apply(void 0,arguments);n.add((function(){return clearTimeout(e)}))})),add:function(n){e.push(n)},dispose:function(){for(var n,t=i(e.splice(0));!(n=t()).done;)(0,n.value)()}};return n}function I(e){for(var n,t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];e&&r.length>0&&(n=e.classList).add.apply(n,r)}function C(e){for(var n,t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];e&&r.length>0&&(n=e.classList).remove.apply(n,r)}function w(e,n,t,r,o){var u=S(),i=void 0!==o?function(e){var n={called:!1};return function(){if(!n.called)return n.called=!0,e.apply(void 0,arguments)}}(o):function(){};return I.apply(void 0,[e].concat(n,t)),u.nextFrame((function(){C.apply(void 0,[e].concat(t)),I.apply(void 0,[e].concat(r)),u.add(function(e,n){var t=S();if(!e)return t.dispose;var r=getComputedStyle(e),o=[r.transitionDuration,r.transitionDelay].map((function(e){var n=e.split(",").filter(Boolean).map((function(e){return e.includes("ms")?parseFloat(e):1e3*parseFloat(e)})).sort((function(e,n){return n-e}))[0];return void 0===n?0:n})),u=o[0];return 0!==u?t.setTimeout((function(){n(l.Finished)}),u+o[1]):n(l.Finished),t.add((function(){return n(l.Cancelled)})),t.dispose}(e,(function(t){return C.apply(void 0,[e].concat(r,n)),i(t)})))})),u.add((function(){return C.apply(void 0,[e].concat(n,t,r))})),u.add((function(){return i(l.Cancelled)})),u.dispose}function O(e){return void 0===e&&(e=""),n.useMemo((function(){return e.split(" ").filter((function(e){return e.trim().length>1}))}),[e])}!function(e){e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static"}(a||(a={})),function(e){e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden"}(c||(c={})),function(e){e.Finished="finished",e.Cancelled="cancelled"}(l||(l={}));var R,E=n.createContext(null);E.displayName="TransitionContext",function(e){e.Visible="visible",e.Hidden="hidden"}(R||(R={}));var k=n.createContext(null);function T(e){return"children"in e?T(e.children):e.current.filter((function(e){return e.state===R.Visible})).length>0}function L(e){var t=n.useRef(e),r=n.useRef([]),o=function(){var e=n.useRef(!0);return n.useEffect((function(){return function(){e.current=!1}}),[]),e}();n.useEffect((function(){t.current=e}),[e]);var u=n.useCallback((function(e,n){var u;void 0===n&&(n=c.Hidden);var i=r.current.findIndex((function(n){return n.id===e}));-1!==i&&(b(n,((u={})[c.Unmount]=function(){r.current.splice(i,1)},u[c.Hidden]=function(){r.current[i].state=R.Hidden},u)),!T(r)&&o.current&&(null==t.current||t.current()))}),[t,o,r]),i=n.useCallback((function(e){var n=r.current.find((function(n){return n.id===e}));return n?n.state!==R.Visible&&(n.state=R.Visible):r.current.push({id:e,state:R.Visible}),function(){return u(e,c.Unmount)}}),[r,u]);return n.useMemo((function(){return{children:r,register:i,unregister:u}}),[i,u,r])}function D(){}k.displayName="NestingContext";var F=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function M(e){return F.reduce((function(n,t){return n[t]=e[t]||D,n}),{})}var A,N,G,P,j,U=a.RenderStrategy;function H(e){var u=e.beforeEnter,i=e.afterEnter,a=e.beforeLeave,f=e.afterLeave,d=e.enter,v=e.enterFrom,h=e.enterTo,x=e.leave,g=e.leaveFrom,S=e.leaveTo,I=o(e,["beforeEnter","afterEnter","beforeLeave","afterLeave","enter","enterFrom","enterTo","leave","leaveFrom","leaveTo"]),C=n.useRef(null),D=n.useState(R.Visible),F=D[0],A=D[1],N=I.unmount?c.Unmount:c.Hidden,G=function(){var e=n.useContext(E);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition />.");return e}(),P=G.show,j=G.appear,H=function(){var e=n.useContext(k);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition />.");return e}(),V=H.register,Q=H.unregister,B=m(),K=p(),q=n.useRef(!1),W=L((function(){q.current||(A(R.Hidden),Q(K),Z.current.afterLeave())}));s((function(){if(K)return V(K)}),[V,K]),s((function(){var e;N===c.Hidden&&K&&(P&&F!==R.Visible?A(R.Visible):b(F,((e={})[R.Hidden]=function(){return Q(K)},e[R.Visible]=function(){return V(K)},e)))}),[F,K,V,Q,P,N]);var Y=O(d),_=O(v),$=O(h),z=O(x),J=O(g),X=O(S),Z=function(e){var t=n.useRef(M(e));return n.useEffect((function(){t.current=M(e)}),[e]),t}({beforeEnter:u,afterEnter:i,beforeLeave:a,afterLeave:f});n.useEffect((function(){if(F===R.Visible&&null===C.current)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")}),[C,F]);var ee=B&&!j;return s((function(){var e=C.current;if(e&&!ee)return q.current=!0,P&&Z.current.beforeEnter(),P||Z.current.beforeLeave(),P?w(e,Y,_,$,(function(e){q.current=!1,e===l.Finished&&Z.current.afterEnter()})):w(e,z,J,X,(function(e){q.current=!1,e===l.Finished&&(T(W)||(A(R.Hidden),Q(K),Z.current.afterLeave()))}))}),[Z,K,q,Q,W,C,ee,P,Y,_,$,z,J,X]),t.createElement(k.Provider,{value:W},y(r({},I,{ref:C}),{},"div",U,F===R.Visible))}function V(e){var u=e.show,i=e.appear,a=void 0!==i&&i,c=e.unmount,l=o(e,["show","appear","unmount"]);if(![!0,!1].includes(u))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");var s=n.useState(u?R.Visible:R.Hidden),f=s[0],d=s[1],v=L((function(){d(R.Hidden)})),p=m(),b=n.useMemo((function(){return{show:u,appear:a||!p}}),[u,a,p]);n.useEffect((function(){u?d(R.Visible):T(v)||d(R.Hidden)}),[u,v]);var h={unmount:c};return t.createElement(k.Provider,{value:v},t.createElement(E.Provider,{value:b},y(r({},h,{as:n.Fragment,children:t.createElement(H,Object.assign({},h,l))}),{},n.Fragment,U,f===R.Visible)))}function Q(){var e=n.useState(S)[0];return n.useEffect((function(){return function(){return e.dispose()}}),[e]),e}function B(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.useCallback((function(e){t.forEach((function(n){if(null!==n)return"function"==typeof n?n(e):void(n.current=e)}))}),[t])}function K(e,n){var t=n.resolveItems();if(t.length<=0)return null;var r=n.resolveActiveIndex(),o=null!=r?r:-1,u=function(){switch(e.focus){case N.First:return t.findIndex((function(e){return!n.resolveDisabled(e)}));case N.Previous:var r=t.slice().reverse().findIndex((function(e,t,r){return!(-1!==o&&r.length-t-1>=o||n.resolveDisabled(e))}));return-1===r?r:t.length-1-r;case N.Next:return t.findIndex((function(e,t){return!(t<=o||n.resolveDisabled(e))}));case N.Last:var u=t.slice().reverse().findIndex((function(e){return!n.resolveDisabled(e)}));return-1===u?u:t.length-1-u;case N.Specific:return t.findIndex((function(t){return n.resolveId(t)===e.id}));case N.Nothing:return null;default:!function(e){throw new Error("Unexpected object: "+e)}(e)}}();return-1===u?r:u}function q(e,n){if(void 0!==e)return"function"==typeof e?e(n):e}function W(e){for(var n,t,r=e.parentElement,o=null;r&&!(r instanceof HTMLFieldSetElement);)r instanceof HTMLLegendElement&&(o=r),r=r.parentElement;var u=null!=(n=""===(null==(t=r)?void 0:t.getAttribute("disabled")))&&n;return(!u||!function(e){if(!e)return!1;for(var n=e.previousElementSibling;null!==n;){if(n instanceof HTMLLegendElement)return!1;n=n.previousElementSibling}return!0}(o))&&u}V.Child=H,function(e){e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.ArrowUp="ArrowUp",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab"}(A||(A={})),function(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"}(N||(N={})),function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(P||(P={})),function(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.RegisterItem=5]="RegisterItem",e[e.UnregisterItem=6]="UnregisterItem"}(j||(j={}));var Y=((G={})[j.CloseMenu]=function(e){return r({},e,{activeItemIndex:null,menuState:P.Closed})},G[j.OpenMenu]=function(e){return r({},e,{menuState:P.Open})},G[j.GoToItem]=function(e,n){var t=K(n,{resolveItems:function(){return e.items},resolveActiveIndex:function(){return e.activeItemIndex},resolveId:function(e){return e.id},resolveDisabled:function(e){return e.dataRef.current.disabled}});return""===e.searchQuery&&e.activeItemIndex===t?e:r({},e,{searchQuery:"",activeItemIndex:t})},G[j.Search]=function(e,n){var t=e.searchQuery+n.value,o=e.items.findIndex((function(e){var n;return(null==(n=e.dataRef.current.textValue)?void 0:n.startsWith(t))&&!e.dataRef.current.disabled}));return r({},e,-1===o||o===e.activeItemIndex?{searchQuery:t}:{searchQuery:t,activeItemIndex:o})},G[j.ClearSearch]=function(e){return r({},e,{searchQuery:""})},G[j.RegisterItem]=function(e,n){return r({},e,{items:[].concat(e.items,[{id:n.id,dataRef:n.dataRef}])})},G[j.UnregisterItem]=function(e,n){var t=e.items.slice(),o=null!==e.activeItemIndex?t[e.activeItemIndex]:null,u=t.findIndex((function(e){return e.id===n.id}));return-1!==u&&t.splice(u,1),r({},e,{items:t,activeItemIndex:u===e.activeItemIndex||null===o?null:t.indexOf(o)})},G),_=n.createContext(null);function $(e){var t=n.useContext(_);if(null===t){var r=new Error("<"+e+" /> is missing a parent <"+X.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(r,$),r}return t}function z(e,n){return b(n.type,Y,e,n)}_.displayName="MenuContext";var J=n.Fragment;function X(e){var r=n.useReducer(z,{menuState:P.Closed,buttonRef:n.createRef(),itemsRef:n.createRef(),items:[],searchQuery:"",activeItemIndex:null}),o=r[0],u=o.menuState,i=o.itemsRef,a=o.buttonRef,c=r[1];n.useEffect((function(){function e(e){var n,t,r,o=e.target,l=document.activeElement;u===P.Open&&((null==(n=a.current)?void 0:n.contains(o))||((null==(t=i.current)?void 0:t.contains(o))||c({type:j.CloseMenu}),l!==document.body&&(null==l?void 0:l.contains(o))||e.defaultPrevented||null==(r=a.current)||r.focus({preventScroll:!0})))}return window.addEventListener("mousedown",e),function(){return window.removeEventListener("mousedown",e)}}),[u,i,a,c]);var l=n.useMemo((function(){return{open:u===P.Open}}),[u]);return t.createElement(_.Provider,{value:r},y(e,l,J))}var Z,ee,ne,te=x((function e(t,o){var u,i=$([X.name,e.name].join(".")),a=i[0],c=i[1],l=B(a.buttonRef,o),s="headlessui-menu-button-"+p(),f=Q(),d=n.useCallback((function(e){switch(e.key){case A.Space:case A.Enter:case A.ArrowDown:e.preventDefault(),c({type:j.OpenMenu}),f.nextFrame((function(){var e;null==(e=a.itemsRef.current)||e.focus({preventScroll:!0}),c({type:j.GoToItem,focus:N.First})}));break;case A.ArrowUp:e.preventDefault(),c({type:j.OpenMenu}),f.nextFrame((function(){var e;null==(e=a.itemsRef.current)||e.focus({preventScroll:!0}),c({type:j.GoToItem,focus:N.Last})}))}}),[c,a,f]),v=n.useCallback((function(e){if(W(e.currentTarget))return e.preventDefault();t.disabled||(a.menuState===P.Open?(c({type:j.CloseMenu}),f.nextFrame((function(){var e;return null==(e=a.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(e.preventDefault(),c({type:j.OpenMenu}),f.nextFrame((function(){var e;return null==(e=a.itemsRef.current)?void 0:e.focus({preventScroll:!0})}))))}),[c,f,a,t.disabled]),m=n.useMemo((function(){return{open:a.menuState===P.Open}}),[a]);return y(r({},t,{ref:l,id:s,type:"button","aria-haspopup":!0,"aria-controls":null==(u=a.itemsRef.current)?void 0:u.id,"aria-expanded":a.menuState===P.Open||void 0,onKeyDown:d,onClick:v}),m,"button")})),re=a.RenderStrategy|a.Static,oe=x((function e(t,o){var u,i,a=$([X.name,e.name].join(".")),c=a[0],l=a[1],s=B(c.itemsRef,o),f="headlessui-menu-items-"+p(),d=Q(),v=n.useCallback((function(e){switch(d.dispose(),e.key){case A.Space:if(""!==c.searchQuery)return e.preventDefault(),l({type:j.Search,value:e.key});case A.Enter:var n;e.preventDefault(),l({type:j.CloseMenu}),null!==c.activeItemIndex&&(null==(n=document.getElementById(c.items[c.activeItemIndex].id))||n.click()),S().nextFrame((function(){var e;return null==(e=c.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case A.ArrowDown:return e.preventDefault(),l({type:j.GoToItem,focus:N.Next});case A.ArrowUp:return e.preventDefault(),l({type:j.GoToItem,focus:N.Previous});case A.Home:case A.PageUp:return e.preventDefault(),l({type:j.GoToItem,focus:N.First});case A.End:case A.PageDown:return e.preventDefault(),l({type:j.GoToItem,focus:N.Last});case A.Escape:e.preventDefault(),l({type:j.CloseMenu}),S().nextFrame((function(){var e;return null==(e=c.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case A.Tab:return e.preventDefault();default:1===e.key.length&&(l({type:j.Search,value:e.key}),d.setTimeout((function(){return l({type:j.ClearSearch})}),350))}}),[l,d,c]),m=n.useMemo((function(){return{open:c.menuState===P.Open}}),[c]);return y(r({},t,{"aria-activedescendant":null===c.activeItemIndex||null==(u=c.items[c.activeItemIndex])?void 0:u.id,"aria-labelledby":null==(i=c.buttonRef.current)?void 0:i.id,id:f,onKeyDown:v,role:"menu",tabIndex:0,ref:s}),m,"div",re,c.menuState===P.Open)})),ue=n.Fragment;function ie(e,t){var r=n.useState(e),o=r[0],u=r[1],i=n.useRef(e);return s((function(){i.current=e}),[e]),s((function(){return u(i.current)}),[i,u].concat(t)),o}X.Button=te,X.Items=oe,X.Item=function e(t){var u=t.disabled,i=void 0!==u&&u,a=t.className,c=t.onClick,l=o(t,["disabled","className","onClick"]),f=$([X.name,e.name].join(".")),d=f[0],v=f[1],m="headlessui-menu-item-"+p(),b=null!==d.activeItemIndex&&d.items[d.activeItemIndex].id===m;s((function(){if(d.menuState===P.Open&&b){var e=S();return e.nextFrame((function(){var e;return null==(e=document.getElementById(m))||null==e.scrollIntoView?void 0:e.scrollIntoView({block:"nearest"})})),e.dispose}}),[m,b,d.menuState]);var h=n.useRef({disabled:i});s((function(){h.current.disabled=i}),[h,i]),s((function(){var e,n;h.current.textValue=null==(e=document.getElementById(m))||null==(n=e.textContent)?void 0:n.toLowerCase()}),[h,m]),s((function(){return v({type:j.RegisterItem,id:m,dataRef:h}),function(){return v({type:j.UnregisterItem,id:m})}}),[h,m]);var x=n.useCallback((function(e){return i?e.preventDefault():(v({type:j.CloseMenu}),S().nextFrame((function(){var e;return null==(e=d.buttonRef.current)?void 0:e.focus({preventScroll:!0})})),c?c(e):void 0)}),[v,d.buttonRef,i,c]),g=n.useCallback((function(){if(i)return v({type:j.GoToItem,focus:N.Nothing});v({type:j.GoToItem,focus:N.Specific,id:m})}),[i,m,v]),I=n.useCallback((function(){i||b||v({type:j.GoToItem,focus:N.Specific,id:m})}),[i,b,m,v]),C=n.useCallback((function(){i||b&&v({type:j.GoToItem,focus:N.Nothing})}),[i,b,v]),w=n.useMemo((function(){return{active:b,disabled:i}}),[b,i]);return y(r({},l,{id:m,role:"menuitem",tabIndex:-1,className:q(a,w),"aria-disabled":!0===i||void 0,onClick:x,onFocus:g,onPointerMove:I,onMouseMove:I,onPointerLeave:C,onMouseLeave:C}),w,ue)},function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(ee||(ee={})),function(e){e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.GoToOption=2]="GoToOption",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterOption=5]="RegisterOption",e[e.UnregisterOption=6]="UnregisterOption"}(ne||(ne={}));var ae=((Z={})[ne.CloseListbox]=function(e){return r({},e,{activeOptionIndex:null,listboxState:ee.Closed})},Z[ne.OpenListbox]=function(e){return r({},e,{listboxState:ee.Open})},Z[ne.GoToOption]=function(e,n){var t=K(n,{resolveItems:function(){return e.options},resolveActiveIndex:function(){return e.activeOptionIndex},resolveId:function(e){return e.id},resolveDisabled:function(e){return e.dataRef.current.disabled}});return""===e.searchQuery&&e.activeOptionIndex===t?e:r({},e,{searchQuery:"",activeOptionIndex:t})},Z[ne.Search]=function(e,n){var t=e.searchQuery+n.value,o=e.options.findIndex((function(e){var n;return!e.dataRef.current.disabled&&(null==(n=e.dataRef.current.textValue)?void 0:n.startsWith(t))}));return r({},e,-1===o||o===e.activeOptionIndex?{searchQuery:t}:{searchQuery:t,activeOptionIndex:o})},Z[ne.ClearSearch]=function(e){return r({},e,{searchQuery:""})},Z[ne.RegisterOption]=function(e,n){return r({},e,{options:[].concat(e.options,[{id:n.id,dataRef:n.dataRef}])})},Z[ne.UnregisterOption]=function(e,n){var t=e.options.slice(),o=null!==e.activeOptionIndex?t[e.activeOptionIndex]:null,u=t.findIndex((function(e){return e.id===n.id}));return-1!==u&&t.splice(u,1),r({},e,{options:t,activeOptionIndex:u===e.activeOptionIndex||null===o?null:t.indexOf(o)})},Z),ce=n.createContext(null);function le(e){var t=n.useContext(ce);if(null===t){var r=new Error("<"+e+" /> is missing a parent <"+de.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(r,le),r}return t}function se(e,n){return b(n.type,ae,e,n)}ce.displayName="ListboxContext";var fe=n.Fragment;function de(e){var r=e.value,u=e.onChange,i=o(e,["value","onChange"]),a=Q(),c=n.useReducer(se,{listboxState:ee.Closed,propsRef:{current:{value:r,onChange:u}},labelRef:n.createRef(),buttonRef:n.createRef(),optionsRef:n.createRef(),options:[],searchQuery:"",activeOptionIndex:null}),l=c[0],f=l.listboxState,d=l.propsRef,v=l.optionsRef,p=l.buttonRef,m=c[1];s((function(){d.current.value=r}),[r,d]),s((function(){d.current.onChange=u}),[u,d]),n.useEffect((function(){function e(e){var n,t,r,o=e.target,u=document.activeElement;f===ee.Open&&((null==(n=p.current)?void 0:n.contains(o))||((null==(t=v.current)?void 0:t.contains(o))||m({type:ne.CloseListbox}),u!==document.body&&(null==u?void 0:u.contains(o))||e.defaultPrevented||null==(r=p.current)||r.focus({preventScroll:!0})))}return window.addEventListener("mousedown",e),function(){return window.removeEventListener("mousedown",e)}}),[f,v,p,a,m]);var b=n.useMemo((function(){return{open:f===ee.Open}}),[f]);return t.createElement(ce.Provider,{value:c},y(i,b,fe))}var ve=x((function e(t,o){var u,i=le([de.name,e.name].join(".")),a=i[0],c=i[1],l=B(a.buttonRef,o),s="headlessui-listbox-button-"+p(),f=Q(),d=n.useCallback((function(e){switch(e.key){case A.Space:case A.Enter:case A.ArrowDown:e.preventDefault(),c({type:ne.OpenListbox}),f.nextFrame((function(){var e;null==(e=a.optionsRef.current)||e.focus({preventScroll:!0}),a.propsRef.current.value||c({type:ne.GoToOption,focus:N.First})}));break;case A.ArrowUp:e.preventDefault(),c({type:ne.OpenListbox}),f.nextFrame((function(){var e;null==(e=a.optionsRef.current)||e.focus({preventScroll:!0}),a.propsRef.current.value||c({type:ne.GoToOption,focus:N.Last})}))}}),[c,a,f]),v=n.useCallback((function(e){if(W(e.currentTarget))return e.preventDefault();t.disabled||(a.listboxState===ee.Open?(c({type:ne.CloseListbox}),f.nextFrame((function(){var e;return null==(e=a.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(e.preventDefault(),c({type:ne.OpenListbox}),f.nextFrame((function(){var e;return null==(e=a.optionsRef.current)?void 0:e.focus({preventScroll:!0})}))))}),[c,f,a,t.disabled]),m=ie((function(){if(a.labelRef.current)return[a.labelRef.current.id,s].join(" ")}),[a.labelRef.current,s]),b=n.useMemo((function(){return{open:a.listboxState===ee.Open}}),[a]);return y(r({},t,{ref:l,id:s,type:"button","aria-haspopup":!0,"aria-controls":null==(u=a.optionsRef.current)?void 0:u.id,"aria-expanded":a.listboxState===ee.Open||void 0,"aria-labelledby":m,onKeyDown:d,onClick:v}),b,"button")})),pe=a.RenderStrategy|a.Static,me=x((function e(t,o){var u,i=le([de.name,e.name].join(".")),a=i[0],c=i[1],l=B(a.optionsRef,o),s="headlessui-listbox-options-"+p(),f=Q(),d=Q(),v=n.useCallback((function(e){switch(d.dispose(),e.key){case A.Space:if(""!==a.searchQuery)return e.preventDefault(),c({type:ne.Search,value:e.key});case A.Enter:e.preventDefault(),c({type:ne.CloseListbox}),null!==a.activeOptionIndex&&a.propsRef.current.onChange(a.options[a.activeOptionIndex].dataRef.current.value),S().nextFrame((function(){var e;return null==(e=a.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case A.ArrowDown:return e.preventDefault(),c({type:ne.GoToOption,focus:N.Next});case A.ArrowUp:return e.preventDefault(),c({type:ne.GoToOption,focus:N.Previous});case A.Home:case A.PageUp:return e.preventDefault(),c({type:ne.GoToOption,focus:N.First});case A.End:case A.PageDown:return e.preventDefault(),c({type:ne.GoToOption,focus:N.Last});case A.Escape:return e.preventDefault(),c({type:ne.CloseListbox}),f.nextFrame((function(){var e;return null==(e=a.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));case A.Tab:return e.preventDefault();default:1===e.key.length&&(c({type:ne.Search,value:e.key}),d.setTimeout((function(){return c({type:ne.ClearSearch})}),350))}}),[f,c,d,a]),m=ie((function(){var e,n,t;return null!=(e=null==(n=a.labelRef.current)?void 0:n.id)?e:null==(t=a.buttonRef.current)?void 0:t.id}),[a.labelRef.current,a.buttonRef.current]),b=n.useMemo((function(){return{open:a.listboxState===ee.Open}}),[a]);return y(r({},t,{"aria-activedescendant":null===a.activeOptionIndex||null==(u=a.options[a.activeOptionIndex])?void 0:u.id,"aria-labelledby":m,id:s,onKeyDown:v,role:"listbox",tabIndex:0,ref:l}),b,"ul",pe,a.listboxState===ee.Open)}));de.Button=ve,de.Label=function e(t){var o=le([de.name,e.name].join("."))[0],u="headlessui-listbox-label-"+p(),i=n.useCallback((function(){var e;return null==(e=o.buttonRef.current)?void 0:e.focus({preventScroll:!0})}),[o.buttonRef]),a=n.useMemo((function(){return{open:o.listboxState===ee.Open}}),[o]);return y(r({},t,{ref:o.labelRef,id:u,onClick:i}),a,"label")},de.Options=me,de.Option=function e(t){var u=t.disabled,i=void 0!==u&&u,a=t.value,c=t.className,l=o(t,["disabled","value","className"]),f=le([de.name,e.name].join(".")),d=f[0],v=f[1],m="headlessui-listbox-option-"+p(),b=null!==d.activeOptionIndex&&d.options[d.activeOptionIndex].id===m,h=d.propsRef.current.value===a,x=n.useRef({disabled:i,value:a});s((function(){x.current.disabled=i}),[x,i]),s((function(){x.current.value=a}),[x,a]),s((function(){var e,n;x.current.textValue=null==(e=document.getElementById(m))||null==(n=e.textContent)?void 0:n.toLowerCase()}),[x,m]);var g=n.useCallback((function(){return d.propsRef.current.onChange(a)}),[d.propsRef,a]);s((function(){return v({type:ne.RegisterOption,id:m,dataRef:x}),function(){return v({type:ne.UnregisterOption,id:m})}}),[x,m]),s((function(){var e;d.listboxState===ee.Open&&h&&(v({type:ne.GoToOption,focus:N.Specific,id:m}),null==(e=document.getElementById(m))||null==e.focus||e.focus())}),[d.listboxState]),s((function(){if(d.listboxState===ee.Open&&b){var e=S();return e.nextFrame((function(){var e;return null==(e=document.getElementById(m))||null==e.scrollIntoView?void 0:e.scrollIntoView({block:"nearest"})})),e.dispose}}),[m,b,d.listboxState]);var I=n.useCallback((function(e){if(i)return e.preventDefault();g(),v({type:ne.CloseListbox}),S().nextFrame((function(){var e;return null==(e=d.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))}),[v,d.buttonRef,i,g]),C=n.useCallback((function(){if(i)return v({type:ne.GoToOption,focus:N.Nothing});v({type:ne.GoToOption,focus:N.Specific,id:m})}),[i,m,v]),w=n.useCallback((function(){i||b||v({type:ne.GoToOption,focus:N.Specific,id:m})}),[i,b,m,v]),O=n.useCallback((function(){i||b&&v({type:ne.GoToOption,focus:N.Nothing})}),[i,b,v]),R=n.useMemo((function(){return{active:b,selected:h,disabled:i}}),[b,h,i]);return y(r({},l,{id:m,role:"option",tabIndex:-1,className:q(c,R),"aria-disabled":!0===i||void 0,"aria-selected":!0===h||void 0,onClick:I,onFocus:C,onPointerMove:w,onMouseMove:w,onPointerLeave:O,onMouseLeave:O}),R,"li")};var be=n.createContext(null);function ye(e){var t=n.useContext(be);if(null===t){var r=new Error("<"+e+" /> is missing a parent <Switch.Group /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(r,ye),r}return t}be.displayName="GroupContext";var he=n.Fragment;function xe(e){var t,u=e.checked,i=e.onChange,a=e.className,c=o(e,["checked","onChange","className"]),l="headlessui-switch-"+p(),s=n.useContext(be),f=n.useCallback((function(){return i(!u)}),[i,u]),d=n.useCallback((function(e){if(W(e.currentTarget))return e.preventDefault();e.preventDefault(),f()}),[f]),v=n.useCallback((function(e){e.key!==A.Tab&&e.preventDefault(),e.key===A.Space&&f()}),[f]),m=n.useCallback((function(e){return e.preventDefault()}),[]),b=n.useMemo((function(){return{checked:u}}),[u]),h={id:l,ref:null===s?void 0:s.setSwitch,role:"switch",tabIndex:0,className:q(a,b),"aria-checked":u,"aria-labelledby":null==s||null==(t=s.label)?void 0:t.id,onClick:d,onKeyUp:v,onKeyPress:m};return"button"===c.as&&Object.assign(h,{type:"button"}),y(r({},c,h),b,"button")}xe.Group=function(e){var r=n.useState(null),o=r[0],u=r[1],i=n.useState(null),a=i[0],c=i[1],l=n.useMemo((function(){return{switch:o,label:a,setSwitch:u,setLabel:c}}),[o,u,a,c]);return t.createElement(be.Provider,{value:l},y(e,{},he))},xe.Label=function e(t){var o=ye([xe.name,e.name].join(".")),u="headlessui-switch-label-"+p(),i=n.useCallback((function(){o.switch&&(o.switch.click(),o.switch.focus({preventScroll:!0}))}),[o.switch]);return y(r({},t,{ref:o.setLabel,id:u,onClick:i}),{},"label")},exports.Listbox=de,exports.Menu=X,exports.Switch=xe,exports.Transition=V;
//# sourceMappingURL=headlessui.cjs.production.min.js.map

@@ -1,2 +0,2 @@

!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],n):n((e=e||self).headlessui={},e.React)}(this,(function(e,n){"use strict";var t,r,o,u="default"in n?n.default:n;function i(){return(i=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(this,arguments)}function a(e,n){if(null==e)return{};var t,r,o={},u=Object.keys(e);for(r=0;r<u.length;r++)n.indexOf(t=u[r])>=0||(o[t]=e[t]);return o}function c(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function l(e,n){var t;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return c(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?c(e,void 0):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(t=e[Symbol.iterator]()).next.bind(t)}function s(e,n){if(e in n){for(var t=n[e],r=arguments.length,o=new Array(r>2?r-2:0),u=2;u<r;u++)o[u-2]=arguments[u];return"function"==typeof t?t.apply(void 0,o):t}var i=new Error('Tried to handle "'+e+'" but there is no handler defined. Only defined handlers are: '+Object.keys(n).map((function(e){return'"'+e+'"'})).join(", ")+".");throw Error.captureStackTrace&&Error.captureStackTrace(i,s),i}function f(e,n,o,u,c){if(void 0===c&&(c=!0),c)return d(e,n,o);var l=null!=u?u:t.None;if(l&t.Static){var f=e.static,p=void 0!==f&&f,v=a(e,["static"]);if(p)return d(v,n,o)}if(l&t.RenderStrategy){var m,b=e.unmount,y=void 0===b||b,h=a(e,["unmount"]);return s(y?r.Unmount:r.Hidden,((m={})[r.Unmount]=function(){return null},m[r.Hidden]=function(){return d(i({},h,{hidden:!0,style:{display:"none"}}),n,o)},m))}return d(e,n,o)}function d(e,t,r){var o,u=v(e,["unmount","static"]),i=u.as,c=void 0===i?r:i,s=u.children,f=u.refName,p=void 0===f?"ref":f,m=a(u,["as","children","refName"]),b=void 0!==e.ref?((o={})[p]=e.ref,o):{},y="function"==typeof s?s(t):s;if(c===n.Fragment&&Object.keys(m).length>0){if(Array.isArray(y)&&y.length>1){var h=new Error("You should only render 1 child");throw Error.captureStackTrace&&Error.captureStackTrace(h,d),h}if(!n.isValidElement(y)){var g=new Error('You should render an element as a child. Did you forget the as="..." prop?');throw Error.captureStackTrace&&Error.captureStackTrace(g,d),g}return n.cloneElement(y,Object.assign({},function(e,n,t){for(var r,o=Object.assign({},e),u=function(){var t,u=r.value;void 0!==e[u]&&void 0!==n[u]&&Object.assign(o,((t={})[u]=function(t){t.defaultPrevented||e[u](t),t.defaultPrevented||n[u](t)},t))},i=l(["onClick"]);!(r=i()).done;)u();return o}(function(e){var n=Object.assign({},e);for(var t in n)void 0===n[t]&&delete n[t];return n}(v(m,["ref"])),y.props),b))}return n.createElement(c,Object.assign({},v(m,["ref"]),c!==n.Fragment&&b),y)}function p(e){return n.forwardRef(e)}function v(e,n){void 0===n&&(n=[]);for(var t,r=Object.assign({},e),o=l(n);!(t=o()).done;){var u=t.value;u in r&&delete r[u]}return r}function m(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.useCallback((function(e){t.forEach((function(n){if(null!==n)return"function"==typeof n?n(e):void(n.current=e)}))}),[t])}function b(e){for(var n,t,r=e.parentElement,o=null;r&&!(r instanceof HTMLFieldSetElement);)r instanceof HTMLLegendElement&&(o=r),r=r.parentElement;var u=null!=(n=""===(null==(t=r)?void 0:t.getAttribute("disabled")))&&n;return(!u||!function(e){if(!e)return!1;for(var n=e.previousElementSibling;null!==n;){if(n instanceof HTMLLegendElement)return!1;n=n.previousElementSibling}return!0}(o))&&u}!function(e){e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static"}(t||(t={})),function(e){e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden"}(r||(r={})),function(e){e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.ArrowUp="ArrowUp",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab"}(o||(o={}));var y="undefined"!=typeof window?n.useLayoutEffect:n.useEffect,h={serverHandoffComplete:!1},g=0;function S(){return++g}function x(){var e=n.useState(h.serverHandoffComplete?S:null),t=e[0],r=e[1];return y((function(){null===t&&r(S())}),[t]),n.useEffect((function(){!1===h.serverHandoffComplete&&(h.serverHandoffComplete=!0)}),[]),null!=t?""+t:void 0}var C,w,O,I=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map((function(e){return e+":not([tabindex='-1'])"})).join(",");function E(e){e&&e.focus({preventScroll:!0})}function k(e,t){void 0===t&&(t=!0);var r=n.useRef(null),u=n.useCallback((function(){return e.current?Array.from(e.current.querySelectorAll(I)):[]}),[e]);y((function(){if(t){r.current=document.activeElement;var e=u();if(e.length<=0)throw new Error("There are no focusable elements inside the <FocusTrap />");return E(e[0]),function(){return E(r.current)}}}),[t]);var i=n.useCallback((function(e){if(t&&e.key===o.Tab&&document.activeElement){e.preventDefault();var n=e.shiftKey?-1:1,r=u(),i=r.length;!function e(t){void 0===t&&(t=0);var o=r.indexOf(document.activeElement),u=r[(o+i+n+t)%i];E(u),u!==document.activeElement&&e(t+n)}()}}),[u,t]);return n.useMemo((function(){return{handleKeyDown:i}}),[i])}!function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(w||(w={})),function(e){e[e.OpenDialog=0]="OpenDialog",e[e.CloseDialog=1]="CloseDialog"}(O||(O={}));var R=((C={})[O.OpenDialog]=function(e){return e.dialogState===w.Open?e:i({},e,{dialogState:w.Open})},C[O.CloseDialog]=function(e){return e.dialogState===w.Closed?e:i({},e,{dialogState:w.Closed})},C),D=n.createContext(null);function T(e){var t=n.useContext(D);if(null===t){var r=new Error("<"+e+" /> is missing a parent <"+M.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(r,T),r}return t}function L(e,n){return s(n.type,R,e,n)}D.displayName="DialogContext";var F=n.Fragment;function M(e){var t,r=function(){var n=e.hasOwnProperty("open"),t=e.hasOwnProperty("onClose");if(!n&&!t)return!1;if(!n)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!t)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if("boolean"!=typeof e.open)throw new Error("You provided an `open` prop to the `Dialog`, but the value is not a boolean. Received: "+e.open);if("function"!=typeof e.onClose)throw new Error("You provided an `onClose` prop to the `Dialog`, but the value is not a function. Received: "+e.onClose);return!0}(),i=n.useReducer(L,{dialogState:r?s(Number(e.open),(t={},t[Number(!0)]=w.Open,t[Number(!1)]=w.Closed,t)):w.Closed}),a=i[0],c=i[1],l=a.dialogState,d=e.onClose,p=n.useCallback((function(){c({type:O.CloseDialog}),r&&d(!1)}),[c,r,d]),v=n.useCallback((function(){return c({type:O.OpenDialog})}),[c]),m=n.useCallback((function(){var e;return s(l,((e={})[w.Open]=function(){return p()},e[w.Closed]=function(){return v()},e))}),[l,v,p]);n.useEffect((function(){r&&c(e.open?{type:O.OpenDialog}:{type:O.CloseDialog})}),[r,e.open]),n.useEffect((function(){function e(e){e.key===o.Escape&&l===w.Open&&p()}return window.addEventListener("keydown",e),function(){return window.removeEventListener("keydown",e)}}),[p,l]);var b=n.useMemo((function(){return[a,{open:v,close:p,toggle:m}]}),[a,v,p,m]),y=n.useMemo((function(){return{open:l===w.Open,close:p}}),[l,p]);return u.createElement(D.Provider,{value:b},f(e,y,F))}var P,A,N,j=p((function e(t,r){var u=T([M.name,e.name].join(".")),a=u[0],c=u[1].toggle,l=m(r),s="headlessui-dialog-button-"+x(),d=n.useCallback((function(e){if(b(e.currentTarget))return e.preventDefault();if(!t.disabled)switch(e.key){case o.Space:case o.Enter:e.preventDefault(),c()}}),[c,t.disabled]),p=n.useCallback((function(e){b(e.currentTarget)||t.disabled||c()}),[c,t.disabled]),v=n.useMemo((function(){return{open:a.dialogState===w.Open}}),[a]);return f(i({},t,{ref:l,id:s,type:"button",onKeyDown:d,onClick:p}),v,"button")})),U=t.RenderStrategy|t.Static,G=p((function e(t,r){var o=T([M.name,e.name].join(".")),u=o[0],a=o[1].close,c=n.useRef(null),l=m(c,r),s=k(c,!!t.static||u.dialogState===w.Open).handleKeyDown,d="headlessui-dialog-panel-"+x(),p=n.useCallback((function(e){return s(e)}),[s]),v=n.useMemo((function(){return{open:u.dialogState===w.Open,close:a}}),[u,a]);return f(i({},t,{ref:l,id:d,role:"dialog","aria-modal":!0,onKeyDown:p}),v,"div",U,u.dialogState===w.Open)})),H=t.RenderStrategy|t.Static,V=p((function e(t,r){var o=T([M.name,e.name].join(".")),u=o[0],a=o[1].close,c=m(r),l="headlessui-dialog-overlay-"+x(),s=n.useCallback((function(e){if(b(e.currentTarget))return e.preventDefault();a()}),[a]),d=n.useMemo((function(){return{open:u.dialogState===w.Open,close:a}}),[u,a]);return f(i({},t,{ref:c,id:l,onClick:s}),d,"button",H,u.dialogState===w.Open)}));M.Button=j,M.Panel=G,M.Overlay=V,function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(A||(A={})),function(e){e[e.ToggleDisclosure=0]="ToggleDisclosure",e[e.SetButtonId=1]="SetButtonId",e[e.SetPanelId=2]="SetPanelId",e[e.LinkPanel=3]="LinkPanel",e[e.UnlinkPanel=4]="UnlinkPanel"}(N||(N={}));var B=((P={})[N.ToggleDisclosure]=function(e){var n;return i({},e,{disclosureState:s(e.disclosureState,(n={},n[A.Open]=A.Closed,n[A.Closed]=A.Open,n))})},P[N.LinkPanel]=function(e){return i({},e,{linkedPanel:!0})},P[N.UnlinkPanel]=function(e){return i({},e,{linkedPanel:!1})},P[N.SetButtonId]=function(e,n){return i({},e,{buttonId:n.buttonId})},P[N.SetPanelId]=function(e,n){return i({},e,{panelId:n.panelId})},P),Q=n.createContext(null);function K(e){var t=n.useContext(Q);if(null===t){var r=new Error("<"+e+" /> is missing a parent <"+W.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(r,K),r}return t}function q(e,n){return s(n.type,B,e,n)}Q.displayName="DisclosureContext";var Y=n.Fragment;function W(e){var t="headlessui-disclosure-button-"+x(),r="headlessui-disclosure-panel-"+x(),o=n.useReducer(q,{disclosureState:A.Closed,linkedPanel:!1,buttonId:t,panelId:r}),i=o[0].disclosureState,a=o[1];n.useEffect((function(){return a({type:N.SetButtonId,buttonId:t})}),[t,a]),n.useEffect((function(){return a({type:N.SetPanelId,panelId:r})}),[r,a]);var c=n.useMemo((function(){return{open:i===A.Open}}),[i]);return u.createElement(Q.Provider,{value:o},f(e,c,Y))}var _=p((function e(t,r){var u=K([W.name,e.name].join(".")),a=u[0],c=u[1],l=m(r),s=n.useCallback((function(e){switch(e.key){case o.Space:case o.Enter:e.preventDefault(),c({type:N.ToggleDisclosure})}}),[c]),d=n.useCallback((function(e){b(e.currentTarget)||t.disabled||c({type:N.ToggleDisclosure})}),[c,t.disabled]),p=n.useMemo((function(){return{open:a.disclosureState===A.Open}}),[a]);return f(i({},t,{ref:l,id:a.buttonId,type:"button","aria-expanded":a.disclosureState===A.Open||void 0,"aria-controls":a.linkedPanel?a.panelId:void 0,onKeyDown:s,onClick:d}),p,"button")})),$=t.RenderStrategy|t.Static,z=p((function e(t,r){var o=K([W.name,e.name].join(".")),a=o[0],c=o[1],l=m(r,(function(){a.linkedPanel||c({type:N.LinkPanel})}));n.useEffect((function(){return function(){return c({type:N.UnlinkPanel})}}),[c]),u.useEffect((function(){var e;a.disclosureState!==A.Closed||null!=(e=t.unmount)&&!e||c({type:N.UnlinkPanel})}),[a.disclosureState,t.unmount,c]);var s=u.useMemo((function(){return{open:a.disclosureState===A.Open}}),[a]);return f(i({},t,{ref:l,id:a.panelId}),s,"div",$,a.disclosureState===A.Open)}));W.Button=_,W.Panel=z;var J,X,Z,ee,ne=p((function(e,t){var r=n.useRef(null),o=m(r,t),u=k(r).handleKeyDown,a=n.useMemo((function(){return{}}),[]);return f(i({},e,{ref:o,onKeyDown:u}),a,"div")}));function te(){var e=[],n={requestAnimationFrame:function(e){function n(){return e.apply(this,arguments)}return n.toString=function(){return e.toString()},n}((function(){var e=requestAnimationFrame.apply(void 0,arguments);n.add((function(){return cancelAnimationFrame(e)}))})),nextFrame:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];n.requestAnimationFrame((function(){n.requestAnimationFrame.apply(n,t)}))},setTimeout:function(e){function n(){return e.apply(this,arguments)}return n.toString=function(){return e.toString()},n}((function(){var e=setTimeout.apply(void 0,arguments);n.add((function(){return clearTimeout(e)}))})),add:function(n){e.push(n)},dispose:function(){for(var n,t=l(e.splice(0));!(n=t()).done;)(0,n.value)()}};return n}function re(){var e=n.useState(te)[0];return n.useEffect((function(){return function(){return e.dispose()}}),[e]),e}function oe(e,t){var r=n.useState(e),o=r[0],u=r[1],i=n.useRef(e);return y((function(){i.current=e}),[e]),y((function(){return u(i.current)}),[i,u].concat(t)),o}function ue(e,n){var t=n.resolveItems();if(t.length<=0)return null;var r=n.resolveActiveIndex(),o=null!=r?r:-1,u=function(){switch(e.focus){case J.First:return t.findIndex((function(e){return!n.resolveDisabled(e)}));case J.Previous:var r=t.slice().reverse().findIndex((function(e,t,r){return!(-1!==o&&r.length-t-1>=o||n.resolveDisabled(e))}));return-1===r?r:t.length-1-r;case J.Next:return t.findIndex((function(e,t){return!(t<=o||n.resolveDisabled(e))}));case J.Last:var u=t.slice().reverse().findIndex((function(e){return!n.resolveDisabled(e)}));return-1===u?u:t.length-1-u;case J.Specific:return t.findIndex((function(t){return n.resolveId(t)===e.id}));case J.Nothing:return null;default:!function(e){throw new Error("Unexpected object: "+e)}(e)}}();return-1===u?r:u}function ie(e,n){if(void 0!==e)return"function"==typeof e?e(n):e}!function(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"}(J||(J={})),function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(Z||(Z={})),function(e){e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.GoToOption=2]="GoToOption",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterOption=5]="RegisterOption",e[e.UnregisterOption=6]="UnregisterOption"}(ee||(ee={}));var ae=((X={})[ee.CloseListbox]=function(e){return i({},e,{activeOptionIndex:null,listboxState:Z.Closed})},X[ee.OpenListbox]=function(e){return i({},e,{listboxState:Z.Open})},X[ee.GoToOption]=function(e,n){var t=ue(n,{resolveItems:function(){return e.options},resolveActiveIndex:function(){return e.activeOptionIndex},resolveId:function(e){return e.id},resolveDisabled:function(e){return e.dataRef.current.disabled}});return""===e.searchQuery&&e.activeOptionIndex===t?e:i({},e,{searchQuery:"",activeOptionIndex:t})},X[ee.Search]=function(e,n){var t=e.searchQuery+n.value,r=e.options.findIndex((function(e){var n;return!e.dataRef.current.disabled&&(null==(n=e.dataRef.current.textValue)?void 0:n.startsWith(t))}));return i({},e,-1===r||r===e.activeOptionIndex?{searchQuery:t}:{searchQuery:t,activeOptionIndex:r})},X[ee.ClearSearch]=function(e){return i({},e,{searchQuery:""})},X[ee.RegisterOption]=function(e,n){return i({},e,{options:[].concat(e.options,[{id:n.id,dataRef:n.dataRef}])})},X[ee.UnregisterOption]=function(e,n){var t=e.options.slice(),r=null!==e.activeOptionIndex?t[e.activeOptionIndex]:null,o=t.findIndex((function(e){return e.id===n.id}));return-1!==o&&t.splice(o,1),i({},e,{options:t,activeOptionIndex:o===e.activeOptionIndex||null===r?null:t.indexOf(r)})},X),ce=n.createContext(null);function le(e){var t=n.useContext(ce);if(null===t){var r=new Error("<"+e+" /> is missing a parent <"+de.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(r,le),r}return t}function se(e,n){return s(n.type,ae,e,n)}ce.displayName="ListboxContext";var fe=n.Fragment;function de(e){var t=e.value,r=e.onChange,o=a(e,["value","onChange"]),i=re(),c=n.useReducer(se,{listboxState:Z.Closed,propsRef:{current:{value:t,onChange:r}},labelRef:n.createRef(),buttonRef:n.createRef(),optionsRef:n.createRef(),options:[],searchQuery:"",activeOptionIndex:null}),l=c[0],s=l.listboxState,d=l.propsRef,p=l.optionsRef,v=l.buttonRef,m=c[1];y((function(){d.current.value=t}),[t,d]),y((function(){d.current.onChange=r}),[r,d]),n.useEffect((function(){function e(e){var n,t,r,o=e.target,u=document.activeElement;s===Z.Open&&((null==(n=v.current)?void 0:n.contains(o))||((null==(t=p.current)?void 0:t.contains(o))||m({type:ee.CloseListbox}),u!==document.body&&(null==u?void 0:u.contains(o))||e.defaultPrevented||null==(r=v.current)||r.focus({preventScroll:!0})))}return window.addEventListener("mousedown",e),function(){return window.removeEventListener("mousedown",e)}}),[s,p,v,i,m]);var b=n.useMemo((function(){return{open:s===Z.Open}}),[s]);return u.createElement(ce.Provider,{value:c},f(o,b,fe))}var pe,ve,me,be=p((function e(t,r){var u,a=le([de.name,e.name].join(".")),c=a[0],l=a[1],s=m(c.buttonRef,r),d="headlessui-listbox-button-"+x(),p=re(),v=n.useCallback((function(e){switch(e.key){case o.Space:case o.Enter:case o.ArrowDown:e.preventDefault(),l({type:ee.OpenListbox}),p.nextFrame((function(){var e;null==(e=c.optionsRef.current)||e.focus({preventScroll:!0}),c.propsRef.current.value||l({type:ee.GoToOption,focus:J.First})}));break;case o.ArrowUp:e.preventDefault(),l({type:ee.OpenListbox}),p.nextFrame((function(){var e;null==(e=c.optionsRef.current)||e.focus({preventScroll:!0}),c.propsRef.current.value||l({type:ee.GoToOption,focus:J.Last})}))}}),[l,c,p]),y=n.useCallback((function(e){if(b(e.currentTarget))return e.preventDefault();t.disabled||(c.listboxState===Z.Open?(l({type:ee.CloseListbox}),p.nextFrame((function(){var e;return null==(e=c.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(e.preventDefault(),l({type:ee.OpenListbox}),p.nextFrame((function(){var e;return null==(e=c.optionsRef.current)?void 0:e.focus({preventScroll:!0})}))))}),[l,p,c,t.disabled]),h=oe((function(){if(c.labelRef.current)return[c.labelRef.current.id,d].join(" ")}),[c.labelRef.current,d]),g=n.useMemo((function(){return{open:c.listboxState===Z.Open}}),[c]);return f(i({},t,{ref:s,id:d,type:"button","aria-haspopup":!0,"aria-controls":null==(u=c.optionsRef.current)?void 0:u.id,"aria-expanded":c.listboxState===Z.Open||void 0,"aria-labelledby":h,onKeyDown:v,onClick:y}),g,"button")})),ye=t.RenderStrategy|t.Static,he=p((function e(t,r){var u,a=le([de.name,e.name].join(".")),c=a[0],l=a[1],s=m(c.optionsRef,r),d="headlessui-listbox-options-"+x(),p=re(),v=re(),b=n.useCallback((function(e){switch(v.dispose(),e.key){case o.Space:if(""!==c.searchQuery)return e.preventDefault(),l({type:ee.Search,value:e.key});case o.Enter:e.preventDefault(),l({type:ee.CloseListbox}),null!==c.activeOptionIndex&&c.propsRef.current.onChange(c.options[c.activeOptionIndex].dataRef.current.value),te().nextFrame((function(){var e;return null==(e=c.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case o.ArrowDown:return e.preventDefault(),l({type:ee.GoToOption,focus:J.Next});case o.ArrowUp:return e.preventDefault(),l({type:ee.GoToOption,focus:J.Previous});case o.Home:case o.PageUp:return e.preventDefault(),l({type:ee.GoToOption,focus:J.First});case o.End:case o.PageDown:return e.preventDefault(),l({type:ee.GoToOption,focus:J.Last});case o.Escape:return e.preventDefault(),l({type:ee.CloseListbox}),p.nextFrame((function(){var e;return null==(e=c.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));case o.Tab:return e.preventDefault();default:1===e.key.length&&(l({type:ee.Search,value:e.key}),v.setTimeout((function(){return l({type:ee.ClearSearch})}),350))}}),[p,l,v,c]),y=oe((function(){var e,n,t;return null!=(e=null==(n=c.labelRef.current)?void 0:n.id)?e:null==(t=c.buttonRef.current)?void 0:t.id}),[c.labelRef.current,c.buttonRef.current]),h=n.useMemo((function(){return{open:c.listboxState===Z.Open}}),[c]);return f(i({},t,{"aria-activedescendant":null===c.activeOptionIndex||null==(u=c.options[c.activeOptionIndex])?void 0:u.id,"aria-labelledby":y,id:d,onKeyDown:b,role:"listbox",tabIndex:0,ref:s}),h,"ul",ye,c.listboxState===Z.Open)}));de.Button=be,de.Label=function e(t){var r=le([de.name,e.name].join("."))[0],o="headlessui-listbox-label-"+x(),u=n.useCallback((function(){var e;return null==(e=r.buttonRef.current)?void 0:e.focus({preventScroll:!0})}),[r.buttonRef]),a=n.useMemo((function(){return{open:r.listboxState===Z.Open}}),[r]);return f(i({},t,{ref:r.labelRef,id:o,onClick:u}),a,"label")},de.Options=he,de.Option=function e(t){var r=t.disabled,o=void 0!==r&&r,u=t.value,c=t.className,l=a(t,["disabled","value","className"]),s=le([de.name,e.name].join(".")),d=s[0],p=s[1],v="headlessui-listbox-option-"+x(),m=null!==d.activeOptionIndex&&d.options[d.activeOptionIndex].id===v,b=d.propsRef.current.value===u,h=n.useRef({disabled:o,value:u});y((function(){h.current.disabled=o}),[h,o]),y((function(){h.current.value=u}),[h,u]),y((function(){var e,n;h.current.textValue=null==(e=document.getElementById(v))||null==(n=e.textContent)?void 0:n.toLowerCase()}),[h,v]);var g=n.useCallback((function(){return d.propsRef.current.onChange(u)}),[d.propsRef,u]);y((function(){return p({type:ee.RegisterOption,id:v,dataRef:h}),function(){return p({type:ee.UnregisterOption,id:v})}}),[h,v]),y((function(){var e;d.listboxState===Z.Open&&b&&(p({type:ee.GoToOption,focus:J.Specific,id:v}),null==(e=document.getElementById(v))||null==e.focus||e.focus())}),[d.listboxState]),y((function(){if(d.listboxState===Z.Open&&m){var e=te();return e.nextFrame((function(){var e;return null==(e=document.getElementById(v))||null==e.scrollIntoView?void 0:e.scrollIntoView({block:"nearest"})})),e.dispose}}),[m,d.listboxState]);var S=n.useCallback((function(e){if(o)return e.preventDefault();g(),p({type:ee.CloseListbox}),te().nextFrame((function(){var e;return null==(e=d.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))}),[p,d.buttonRef,o,g]),C=n.useCallback((function(){if(o)return p({type:ee.GoToOption,focus:J.Nothing});p({type:ee.GoToOption,focus:J.Specific,id:v})}),[o,v,p]),w=n.useCallback((function(){o||m||p({type:ee.GoToOption,focus:J.Specific,id:v})}),[o,m,v,p]),O=n.useCallback((function(){o||m&&p({type:ee.GoToOption,focus:J.Nothing})}),[o,m,p]),I=n.useMemo((function(){return{active:m,selected:b,disabled:o}}),[m,b,o]);return f(i({},l,{id:v,role:"option",tabIndex:-1,className:ie(c,I),"aria-disabled":!0===o||void 0,"aria-selected":!0===b||void 0,onClick:S,onFocus:C,onPointerMove:w,onMouseMove:w,onPointerLeave:O,onMouseLeave:O}),I,"li")},function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(ve||(ve={})),function(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.RegisterItem=5]="RegisterItem",e[e.UnregisterItem=6]="UnregisterItem"}(me||(me={}));var ge=((pe={})[me.CloseMenu]=function(e){return i({},e,{activeItemIndex:null,menuState:ve.Closed})},pe[me.OpenMenu]=function(e){return i({},e,{menuState:ve.Open})},pe[me.GoToItem]=function(e,n){var t=ue(n,{resolveItems:function(){return e.items},resolveActiveIndex:function(){return e.activeItemIndex},resolveId:function(e){return e.id},resolveDisabled:function(e){return e.dataRef.current.disabled}});return""===e.searchQuery&&e.activeItemIndex===t?e:i({},e,{searchQuery:"",activeItemIndex:t})},pe[me.Search]=function(e,n){var t=e.searchQuery+n.value,r=e.items.findIndex((function(e){var n;return(null==(n=e.dataRef.current.textValue)?void 0:n.startsWith(t))&&!e.dataRef.current.disabled}));return i({},e,-1===r||r===e.activeItemIndex?{searchQuery:t}:{searchQuery:t,activeItemIndex:r})},pe[me.ClearSearch]=function(e){return i({},e,{searchQuery:""})},pe[me.RegisterItem]=function(e,n){return i({},e,{items:[].concat(e.items,[{id:n.id,dataRef:n.dataRef}])})},pe[me.UnregisterItem]=function(e,n){var t=e.items.slice(),r=null!==e.activeItemIndex?t[e.activeItemIndex]:null,o=t.findIndex((function(e){return e.id===n.id}));return-1!==o&&t.splice(o,1),i({},e,{items:t,activeItemIndex:o===e.activeItemIndex||null===r?null:t.indexOf(r)})},pe),Se=n.createContext(null);function xe(e){var t=n.useContext(Se);if(null===t){var r=new Error("<"+e+" /> is missing a parent <"+Oe.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(r,xe),r}return t}function Ce(e,n){return s(n.type,ge,e,n)}Se.displayName="MenuContext";var we=n.Fragment;function Oe(e){var t=n.useReducer(Ce,{menuState:ve.Closed,buttonRef:n.createRef(),itemsRef:n.createRef(),items:[],searchQuery:"",activeItemIndex:null}),r=t[0],o=r.menuState,i=r.itemsRef,a=r.buttonRef,c=t[1];n.useEffect((function(){function e(e){var n,t,r,u=e.target,l=document.activeElement;o===ve.Open&&((null==(n=a.current)?void 0:n.contains(u))||((null==(t=i.current)?void 0:t.contains(u))||c({type:me.CloseMenu}),l!==document.body&&(null==l?void 0:l.contains(u))||e.defaultPrevented||null==(r=a.current)||r.focus({preventScroll:!0})))}return window.addEventListener("mousedown",e),function(){return window.removeEventListener("mousedown",e)}}),[o,i,a,c]);var l=n.useMemo((function(){return{open:o===ve.Open}}),[o]);return u.createElement(Se.Provider,{value:t},f(e,l,we))}var Ie=p((function e(t,r){var u,a=xe([Oe.name,e.name].join(".")),c=a[0],l=a[1],s=m(c.buttonRef,r),d="headlessui-menu-button-"+x(),p=re(),v=n.useCallback((function(e){switch(e.key){case o.Space:case o.Enter:case o.ArrowDown:e.preventDefault(),l({type:me.OpenMenu}),p.nextFrame((function(){var e;null==(e=c.itemsRef.current)||e.focus({preventScroll:!0}),l({type:me.GoToItem,focus:J.First})}));break;case o.ArrowUp:e.preventDefault(),l({type:me.OpenMenu}),p.nextFrame((function(){var e;null==(e=c.itemsRef.current)||e.focus({preventScroll:!0}),l({type:me.GoToItem,focus:J.Last})}))}}),[l,c,p]),y=n.useCallback((function(e){if(b(e.currentTarget))return e.preventDefault();t.disabled||(c.menuState===ve.Open?(l({type:me.CloseMenu}),p.nextFrame((function(){var e;return null==(e=c.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(e.preventDefault(),l({type:me.OpenMenu}),p.nextFrame((function(){var e;return null==(e=c.itemsRef.current)?void 0:e.focus({preventScroll:!0})}))))}),[l,p,c,t.disabled]),h=n.useMemo((function(){return{open:c.menuState===ve.Open}}),[c]);return f(i({},t,{ref:s,id:d,type:"button","aria-haspopup":!0,"aria-controls":null==(u=c.itemsRef.current)?void 0:u.id,"aria-expanded":c.menuState===ve.Open||void 0,onKeyDown:v,onClick:y}),h,"button")})),Ee=t.RenderStrategy|t.Static,ke=p((function e(t,r){var u,a,c=xe([Oe.name,e.name].join(".")),l=c[0],s=c[1],d=m(l.itemsRef,r),p="headlessui-menu-items-"+x(),v=re(),b=n.useCallback((function(e){switch(v.dispose(),e.key){case o.Space:if(""!==l.searchQuery)return e.preventDefault(),s({type:me.Search,value:e.key});case o.Enter:var n;e.preventDefault(),s({type:me.CloseMenu}),null!==l.activeItemIndex&&(null==(n=document.getElementById(l.items[l.activeItemIndex].id))||n.click()),te().nextFrame((function(){var e;return null==(e=l.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case o.ArrowDown:return e.preventDefault(),s({type:me.GoToItem,focus:J.Next});case o.ArrowUp:return e.preventDefault(),s({type:me.GoToItem,focus:J.Previous});case o.Home:case o.PageUp:return e.preventDefault(),s({type:me.GoToItem,focus:J.First});case o.End:case o.PageDown:return e.preventDefault(),s({type:me.GoToItem,focus:J.Last});case o.Escape:e.preventDefault(),s({type:me.CloseMenu}),te().nextFrame((function(){var e;return null==(e=l.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case o.Tab:return e.preventDefault();default:1===e.key.length&&(s({type:me.Search,value:e.key}),v.setTimeout((function(){return s({type:me.ClearSearch})}),350))}}),[s,v,l]),y=n.useMemo((function(){return{open:l.menuState===ve.Open}}),[l]);return f(i({},t,{"aria-activedescendant":null===l.activeItemIndex||null==(u=l.items[l.activeItemIndex])?void 0:u.id,"aria-labelledby":null==(a=l.buttonRef.current)?void 0:a.id,id:p,onKeyDown:b,role:"menu",tabIndex:0,ref:d}),y,"div",Ee,l.menuState===ve.Open)})),Re=n.Fragment;Oe.Button=Ie,Oe.Items=ke,Oe.Item=function e(t){var r=t.disabled,o=void 0!==r&&r,u=t.className,c=t.onClick,l=a(t,["disabled","className","onClick"]),s=xe([Oe.name,e.name].join(".")),d=s[0],p=s[1],v="headlessui-menu-item-"+x(),m=null!==d.activeItemIndex&&d.items[d.activeItemIndex].id===v,b=n.useRef({disabled:o});y((function(){b.current.disabled=o}),[b,o]),y((function(){var e,n;b.current.textValue=null==(e=document.getElementById(v))||null==(n=e.textContent)?void 0:n.toLowerCase()}),[b,v]),y((function(){return p({type:me.RegisterItem,id:v,dataRef:b}),function(){return p({type:me.UnregisterItem,id:v})}}),[b,v]);var h=n.useCallback((function(e){return o?e.preventDefault():(p({type:me.CloseMenu}),te().nextFrame((function(){var e;return null==(e=d.buttonRef.current)?void 0:e.focus({preventScroll:!0})})),c?c(e):void 0)}),[p,d.buttonRef,o,c]),g=n.useCallback((function(){if(o)return p({type:me.GoToItem,focus:J.Nothing});p({type:me.GoToItem,focus:J.Specific,id:v})}),[o,v,p]),S=n.useCallback((function(){o||m||p({type:me.GoToItem,focus:J.Specific,id:v})}),[o,m,v,p]),C=n.useCallback((function(){o||m&&p({type:me.GoToItem,focus:J.Nothing})}),[o,m,p]),w=n.useMemo((function(){return{active:m,disabled:o}}),[m,o]);return f(i({},l,{id:v,role:"menuitem",tabIndex:-1,className:ie(u,w),"aria-disabled":!0===o||void 0,onClick:h,onFocus:g,onPointerMove:S,onMouseMove:S,onPointerLeave:C,onMouseLeave:C}),w,Re)};var De=n.createContext(null);function Te(e){var t=n.useContext(De);if(null===t){var r=new Error("<"+e+" /> is missing a parent <Switch.Group /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(r,Te),r}return t}De.displayName="GroupContext";var Le,Fe=n.Fragment;function Me(e){var t,r,u=e.checked,c=e.onChange,l=e.className,s=a(e,["checked","onChange","className"]),d="headlessui-switch-"+x(),p=n.useContext(De),v=n.useCallback((function(){return c(!u)}),[c,u]),m=n.useCallback((function(e){if(b(e.currentTarget))return e.preventDefault();e.preventDefault(),v()}),[v]),y=n.useCallback((function(e){e.key!==o.Tab&&e.preventDefault(),e.key===o.Space&&v()}),[v]),h=n.useCallback((function(e){return e.preventDefault()}),[]),g=n.useMemo((function(){return{checked:u}}),[u]),S={id:d,ref:null===p?void 0:p.setSwitch,role:"switch",tabIndex:0,className:ie(l,g),"aria-checked":u,"aria-labelledby":null==p||null==(t=p.label)?void 0:t.id,"aria-describedby":null==p||null==(r=p.description)?void 0:r.id,onClick:m,onKeyUp:y,onKeyPress:h};return"button"===s.as&&Object.assign(S,{type:"button"}),f(i({},s,S),g,"button")}function Pe(){var e=n.useRef(!0);return n.useEffect((function(){e.current=!1}),[]),e.current}function Ae(e){for(var n,t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];e&&r.length>0&&(n=e.classList).add.apply(n,r)}function Ne(e){for(var n,t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];e&&r.length>0&&(n=e.classList).remove.apply(n,r)}function je(e,n,t,r,o){var u=te(),i=void 0!==o?function(e){var n={called:!1};return function(){if(!n.called)return n.called=!0,e.apply(void 0,arguments)}}(o):function(){};return Ae.apply(void 0,[e].concat(n,t)),u.nextFrame((function(){Ne.apply(void 0,[e].concat(t)),Ae.apply(void 0,[e].concat(r)),u.add(function(e,n){var t=te();if(!e)return t.dispose;var r=getComputedStyle(e),o=[r.transitionDuration,r.transitionDelay].map((function(e){var n=e.split(",").filter(Boolean).map((function(e){return e.includes("ms")?parseFloat(e):1e3*parseFloat(e)})).sort((function(e,n){return n-e}))[0];return void 0===n?0:n})),u=o[0];return 0!==u?t.setTimeout((function(){n(Le.Finished)}),u+o[1]):n(Le.Finished),t.add((function(){return n(Le.Cancelled)})),t.dispose}(e,(function(t){return Ne.apply(void 0,[e].concat(r,n)),i(t)})))})),u.add((function(){return Ne.apply(void 0,[e].concat(n,t,r))})),u.add((function(){return i(Le.Cancelled)})),u.dispose}function Ue(e){return void 0===e&&(e=""),n.useMemo((function(){return e.split(" ").filter((function(e){return e.trim().length>1}))}),[e])}Me.Group=function(e){var t=n.useState(null),r=t[0],o=t[1],i=n.useState(null),a=i[0],c=i[1],l=n.useState(null),s=l[0],d=l[1],p=n.useMemo((function(){return{switch:r,setSwitch:o,label:a,setLabel:c,description:s,setDescription:d}}),[r,o,a,c,s,d]);return u.createElement(De.Provider,{value:p},f(e,{},Fe))},Me.Label=function e(t){var r=Te([Me.name,e.name].join(".")),o="headlessui-switch-label-"+x(),u=n.useCallback((function(){r.switch&&(r.switch.click(),r.switch.focus({preventScroll:!0}))}),[r.switch]);return f(i({},t,{ref:r.setLabel,id:o,onClick:u}),{},"label")},Me.Description=function e(n){var t=Te([Me.name,e.name].join(".")),r="headlessui-switch-description-"+x();return f(i({},n,{ref:t.setDescription,id:r}),{},"p")},function(e){e.Finished="finished",e.Cancelled="cancelled"}(Le||(Le={}));var Ge,He=n.createContext(null);He.displayName="TransitionContext",function(e){e.Visible="visible",e.Hidden="hidden"}(Ge||(Ge={}));var Ve=n.createContext(null);function Be(e){return"children"in e?Be(e.children):e.current.filter((function(e){return e.state===Ge.Visible})).length>0}function Qe(e){var t=n.useRef(e),o=n.useRef([]),u=function(){var e=n.useRef(!0);return n.useEffect((function(){return function(){e.current=!1}}),[]),e}();n.useEffect((function(){t.current=e}),[e]);var i=n.useCallback((function(e,n){var i;void 0===n&&(n=r.Hidden);var a=o.current.findIndex((function(n){return n.id===e}));-1!==a&&(s(n,((i={})[r.Unmount]=function(){o.current.splice(a,1)},i[r.Hidden]=function(){o.current[a].state=Ge.Hidden},i)),!Be(o)&&u.current&&(null==t.current||t.current()))}),[t,u,o]),a=n.useCallback((function(e){var n=o.current.find((function(n){return n.id===e}));return n?n.state!==Ge.Visible&&(n.state=Ge.Visible):o.current.push({id:e,state:Ge.Visible}),function(){return i(e,r.Unmount)}}),[o,i]);return n.useMemo((function(){return{children:o,register:a,unregister:i}}),[a,i,o])}function Ke(){}Ve.displayName="NestingContext";var qe=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function Ye(e){for(var n,t={},r=l(qe);!(n=r()).done;){var o,u=n.value;t[u]=null!=(o=e[u])?o:Ke}return t}var We=t.RenderStrategy;function _e(e){var t=e.beforeEnter,o=e.afterEnter,c=e.beforeLeave,l=e.afterLeave,d=e.enter,p=e.enterFrom,v=e.enterTo,m=e.leave,b=e.leaveFrom,h=e.leaveTo,g=a(e,["beforeEnter","afterEnter","beforeLeave","afterLeave","enter","enterFrom","enterTo","leave","leaveFrom","leaveTo"]),S=n.useRef(null),C=n.useState(Ge.Visible),w=C[0],O=C[1],I=g.unmount?r.Unmount:r.Hidden,E=function(){var e=n.useContext(He);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition />.");return e}(),k=E.show,R=E.appear,D=function(){var e=n.useContext(Ve);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition />.");return e}(),T=D.register,L=D.unregister,F=Pe(),M=x(),P=n.useRef(!1),A=Qe((function(){P.current||(O(Ge.Hidden),L(M),B.current.afterLeave())}));y((function(){if(M)return T(M)}),[T,M]),y((function(){var e;I===r.Hidden&&M&&(k&&w!==Ge.Visible?O(Ge.Visible):s(w,((e={})[Ge.Hidden]=function(){return L(M)},e[Ge.Visible]=function(){return T(M)},e)))}),[w,M,T,L,k,I]);var N=Ue(d),j=Ue(p),U=Ue(v),G=Ue(m),H=Ue(b),V=Ue(h),B=function(e){var t=n.useRef(Ye(e));return n.useEffect((function(){t.current=Ye(e)}),[e]),t}({beforeEnter:t,afterEnter:o,beforeLeave:c,afterLeave:l});n.useEffect((function(){if(w===Ge.Visible&&null===S.current)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")}),[S,w]);var Q=F&&!R;return y((function(){var e=S.current;if(e&&!Q)return P.current=!0,k&&B.current.beforeEnter(),k||B.current.beforeLeave(),k?je(e,N,j,U,(function(e){P.current=!1,e===Le.Finished&&B.current.afterEnter()})):je(e,G,H,V,(function(e){P.current=!1,e===Le.Finished&&(Be(A)||(O(Ge.Hidden),L(M),B.current.afterLeave()))}))}),[B,M,P,L,A,S,Q,k,N,j,U,G,H,V]),u.createElement(Ve.Provider,{value:A},f(i({},g,{ref:S}),{},"div",We,w===Ge.Visible))}function $e(e){var t=e.show,r=e.appear,o=void 0!==r&&r,c=e.unmount,l=a(e,["show","appear","unmount"]);if(![!0,!1].includes(t))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");var s=n.useState(t?Ge.Visible:Ge.Hidden),d=s[0],p=s[1],v=Qe((function(){p(Ge.Hidden)})),m=Pe(),b=n.useMemo((function(){return{show:t,appear:o||!m}}),[t,o,m]);n.useEffect((function(){t?p(Ge.Visible):Be(v)||p(Ge.Hidden)}),[t,v]);var y={unmount:c};return u.createElement(Ve.Provider,{value:v},u.createElement(He.Provider,{value:b},f(i({},y,{as:n.Fragment,children:u.createElement(_e,Object.assign({},y,l))}),{},n.Fragment,We,d===Ge.Visible)))}$e.Child=_e,e.Dialog=M,e.Disclosure=W,e.FocusTrap=ne,e.Listbox=de,e.Menu=Oe,e.Switch=Me,e.Transition=$e,Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],n):n((e=e||self).headlessui={},e.React)}(this,(function(e,n){"use strict";var t="default"in n?n.default:n;function r(){return(r=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(this,arguments)}function o(e,n){if(null==e)return{};var t,r,o={},u=Object.keys(e);for(r=0;r<u.length;r++)n.indexOf(t=u[r])>=0||(o[t]=e[t]);return o}function u(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function i(e,n){var t;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return u(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?u(e,void 0):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(t=e[Symbol.iterator]()).next.bind(t)}var a,c,l,s="undefined"!=typeof window?n.useLayoutEffect:n.useEffect,f={serverHandoffComplete:!1},d=0;function v(){return++d}function p(){var e=n.useState(f.serverHandoffComplete?v:null),t=e[0],r=e[1];return s((function(){null===t&&r(v())}),[t]),n.useEffect((function(){!1===f.serverHandoffComplete&&(f.serverHandoffComplete=!0)}),[]),null!=t?""+t:void 0}function m(){var e=n.useRef(!0);return n.useEffect((function(){e.current=!1}),[]),e.current}function b(e,n){if(e in n){for(var t=n[e],r=arguments.length,o=new Array(r>2?r-2:0),u=2;u<r;u++)o[u-2]=arguments[u];return"function"==typeof t?t.apply(void 0,o):t}var i=new Error('Tried to handle "'+e+'" but there is no handler defined. Only defined handlers are: '+Object.keys(n).map((function(e){return'"'+e+'"'})).join(", ")+".");throw Error.captureStackTrace&&Error.captureStackTrace(i,b),i}function y(e,n,t,u,i){if(void 0===i&&(i=!0),i)return h(e,n,t);var l=null!=u?u:a.None;if(l&a.Static){var s=e.static,f=void 0!==s&&s,d=o(e,["static"]);if(f)return h(d,n,t)}if(l&a.RenderStrategy){var v,p=e.unmount,m=void 0===p||p,y=o(e,["unmount"]);return b(m?c.Unmount:c.Hidden,((v={})[c.Unmount]=function(){return null},v[c.Hidden]=function(){return h(r({},y,{hidden:!0,style:{display:"none"}}),n,t)},v))}return h(e,n,t)}function h(e,t,r){var u,a=g(e,["unmount","static"]),c=a.as,l=void 0===c?r:c,s=a.children,f=a.refName,d=void 0===f?"ref":f,v=o(a,["as","children","refName"]),p=void 0!==e.ref?((u={})[d]=e.ref,u):{},m="function"==typeof s?s(t):s;if(l===n.Fragment&&Object.keys(v).length>0){if(Array.isArray(m)&&m.length>1){var b=new Error("You should only render 1 child");throw Error.captureStackTrace&&Error.captureStackTrace(b,h),b}if(!n.isValidElement(m)){var y=new Error('You should render an element as a child. Did you forget the as="..." prop?');throw Error.captureStackTrace&&Error.captureStackTrace(y,h),y}return n.cloneElement(m,Object.assign({},function(e,n,t){for(var r,o=Object.assign({},e),u=function(){var t,u=r.value;void 0!==e[u]&&void 0!==n[u]&&Object.assign(o,((t={})[u]=function(t){t.defaultPrevented||e[u](t),t.defaultPrevented||n[u](t)},t))},a=i(["onClick"]);!(r=a()).done;)u();return o}(function(e){var n=Object.assign({},e);for(var t in n)void 0===n[t]&&delete n[t];return n}(g(v,["ref"])),m.props),p))}return n.createElement(l,Object.assign({},g(v,["ref"]),l!==n.Fragment&&p),m)}function x(e){return n.forwardRef(e)}function g(e,n){void 0===n&&(n=[]);for(var t,r=Object.assign({},e),o=i(n);!(t=o()).done;){var u=t.value;u in r&&delete r[u]}return r}function S(){var e=[],n={requestAnimationFrame:function(e){function n(){return e.apply(this,arguments)}return n.toString=function(){return e.toString()},n}((function(){var e=requestAnimationFrame.apply(void 0,arguments);n.add((function(){return cancelAnimationFrame(e)}))})),nextFrame:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];n.requestAnimationFrame((function(){n.requestAnimationFrame.apply(n,t)}))},setTimeout:function(e){function n(){return e.apply(this,arguments)}return n.toString=function(){return e.toString()},n}((function(){var e=setTimeout.apply(void 0,arguments);n.add((function(){return clearTimeout(e)}))})),add:function(n){e.push(n)},dispose:function(){for(var n,t=i(e.splice(0));!(n=t()).done;)(0,n.value)()}};return n}function I(e){for(var n,t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];e&&r.length>0&&(n=e.classList).add.apply(n,r)}function C(e){for(var n,t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];e&&r.length>0&&(n=e.classList).remove.apply(n,r)}function w(e,n,t,r,o){var u=S(),i=void 0!==o?function(e){var n={called:!1};return function(){if(!n.called)return n.called=!0,e.apply(void 0,arguments)}}(o):function(){};return I.apply(void 0,[e].concat(n,t)),u.nextFrame((function(){C.apply(void 0,[e].concat(t)),I.apply(void 0,[e].concat(r)),u.add(function(e,n){var t=S();if(!e)return t.dispose;var r=getComputedStyle(e),o=[r.transitionDuration,r.transitionDelay].map((function(e){var n=e.split(",").filter(Boolean).map((function(e){return e.includes("ms")?parseFloat(e):1e3*parseFloat(e)})).sort((function(e,n){return n-e}))[0];return void 0===n?0:n})),u=o[0];return 0!==u?t.setTimeout((function(){n(l.Finished)}),u+o[1]):n(l.Finished),t.add((function(){return n(l.Cancelled)})),t.dispose}(e,(function(t){return C.apply(void 0,[e].concat(r,n)),i(t)})))})),u.add((function(){return C.apply(void 0,[e].concat(n,t,r))})),u.add((function(){return i(l.Cancelled)})),u.dispose}function O(e){return void 0===e&&(e=""),n.useMemo((function(){return e.split(" ").filter((function(e){return e.trim().length>1}))}),[e])}!function(e){e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static"}(a||(a={})),function(e){e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden"}(c||(c={})),function(e){e.Finished="finished",e.Cancelled="cancelled"}(l||(l={}));var R,E=n.createContext(null);E.displayName="TransitionContext",function(e){e.Visible="visible",e.Hidden="hidden"}(R||(R={}));var k=n.createContext(null);function T(e){return"children"in e?T(e.children):e.current.filter((function(e){return e.state===R.Visible})).length>0}function L(e){var t=n.useRef(e),r=n.useRef([]),o=function(){var e=n.useRef(!0);return n.useEffect((function(){return function(){e.current=!1}}),[]),e}();n.useEffect((function(){t.current=e}),[e]);var u=n.useCallback((function(e,n){var u;void 0===n&&(n=c.Hidden);var i=r.current.findIndex((function(n){return n.id===e}));-1!==i&&(b(n,((u={})[c.Unmount]=function(){r.current.splice(i,1)},u[c.Hidden]=function(){r.current[i].state=R.Hidden},u)),!T(r)&&o.current&&(null==t.current||t.current()))}),[t,o,r]),i=n.useCallback((function(e){var n=r.current.find((function(n){return n.id===e}));return n?n.state!==R.Visible&&(n.state=R.Visible):r.current.push({id:e,state:R.Visible}),function(){return u(e,c.Unmount)}}),[r,u]);return n.useMemo((function(){return{children:r,register:i,unregister:u}}),[i,u,r])}function D(){}k.displayName="NestingContext";var F=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function M(e){return F.reduce((function(n,t){return n[t]=e[t]||D,n}),{})}var A,N,G,P,j,U=a.RenderStrategy;function H(e){var u=e.beforeEnter,i=e.afterEnter,a=e.beforeLeave,f=e.afterLeave,d=e.enter,v=e.enterFrom,h=e.enterTo,x=e.leave,g=e.leaveFrom,S=e.leaveTo,I=o(e,["beforeEnter","afterEnter","beforeLeave","afterLeave","enter","enterFrom","enterTo","leave","leaveFrom","leaveTo"]),C=n.useRef(null),D=n.useState(R.Visible),F=D[0],A=D[1],N=I.unmount?c.Unmount:c.Hidden,G=function(){var e=n.useContext(E);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition />.");return e}(),P=G.show,j=G.appear,H=function(){var e=n.useContext(k);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition />.");return e}(),V=H.register,Q=H.unregister,B=m(),K=p(),q=n.useRef(!1),W=L((function(){q.current||(A(R.Hidden),Q(K),Z.current.afterLeave())}));s((function(){if(K)return V(K)}),[V,K]),s((function(){var e;N===c.Hidden&&K&&(P&&F!==R.Visible?A(R.Visible):b(F,((e={})[R.Hidden]=function(){return Q(K)},e[R.Visible]=function(){return V(K)},e)))}),[F,K,V,Q,P,N]);var Y=O(d),_=O(v),$=O(h),z=O(x),J=O(g),X=O(S),Z=function(e){var t=n.useRef(M(e));return n.useEffect((function(){t.current=M(e)}),[e]),t}({beforeEnter:u,afterEnter:i,beforeLeave:a,afterLeave:f});n.useEffect((function(){if(F===R.Visible&&null===C.current)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")}),[C,F]);var ee=B&&!j;return s((function(){var e=C.current;if(e&&!ee)return q.current=!0,P&&Z.current.beforeEnter(),P||Z.current.beforeLeave(),P?w(e,Y,_,$,(function(e){q.current=!1,e===l.Finished&&Z.current.afterEnter()})):w(e,z,J,X,(function(e){q.current=!1,e===l.Finished&&(T(W)||(A(R.Hidden),Q(K),Z.current.afterLeave()))}))}),[Z,K,q,Q,W,C,ee,P,Y,_,$,z,J,X]),t.createElement(k.Provider,{value:W},y(r({},I,{ref:C}),{},"div",U,F===R.Visible))}function V(e){var u=e.show,i=e.appear,a=void 0!==i&&i,c=e.unmount,l=o(e,["show","appear","unmount"]);if(![!0,!1].includes(u))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");var s=n.useState(u?R.Visible:R.Hidden),f=s[0],d=s[1],v=L((function(){d(R.Hidden)})),p=m(),b=n.useMemo((function(){return{show:u,appear:a||!p}}),[u,a,p]);n.useEffect((function(){u?d(R.Visible):T(v)||d(R.Hidden)}),[u,v]);var h={unmount:c};return t.createElement(k.Provider,{value:v},t.createElement(E.Provider,{value:b},y(r({},h,{as:n.Fragment,children:t.createElement(H,Object.assign({},h,l))}),{},n.Fragment,U,f===R.Visible)))}function Q(){var e=n.useState(S)[0];return n.useEffect((function(){return function(){return e.dispose()}}),[e]),e}function B(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.useCallback((function(e){t.forEach((function(n){if(null!==n)return"function"==typeof n?n(e):void(n.current=e)}))}),[t])}function K(e,n){var t=n.resolveItems();if(t.length<=0)return null;var r=n.resolveActiveIndex(),o=null!=r?r:-1,u=function(){switch(e.focus){case N.First:return t.findIndex((function(e){return!n.resolveDisabled(e)}));case N.Previous:var r=t.slice().reverse().findIndex((function(e,t,r){return!(-1!==o&&r.length-t-1>=o||n.resolveDisabled(e))}));return-1===r?r:t.length-1-r;case N.Next:return t.findIndex((function(e,t){return!(t<=o||n.resolveDisabled(e))}));case N.Last:var u=t.slice().reverse().findIndex((function(e){return!n.resolveDisabled(e)}));return-1===u?u:t.length-1-u;case N.Specific:return t.findIndex((function(t){return n.resolveId(t)===e.id}));case N.Nothing:return null;default:!function(e){throw new Error("Unexpected object: "+e)}(e)}}();return-1===u?r:u}function q(e,n){if(void 0!==e)return"function"==typeof e?e(n):e}function W(e){for(var n,t,r=e.parentElement,o=null;r&&!(r instanceof HTMLFieldSetElement);)r instanceof HTMLLegendElement&&(o=r),r=r.parentElement;var u=null!=(n=""===(null==(t=r)?void 0:t.getAttribute("disabled")))&&n;return(!u||!function(e){if(!e)return!1;for(var n=e.previousElementSibling;null!==n;){if(n instanceof HTMLLegendElement)return!1;n=n.previousElementSibling}return!0}(o))&&u}V.Child=H,function(e){e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.ArrowUp="ArrowUp",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab"}(A||(A={})),function(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"}(N||(N={})),function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(P||(P={})),function(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.RegisterItem=5]="RegisterItem",e[e.UnregisterItem=6]="UnregisterItem"}(j||(j={}));var Y=((G={})[j.CloseMenu]=function(e){return r({},e,{activeItemIndex:null,menuState:P.Closed})},G[j.OpenMenu]=function(e){return r({},e,{menuState:P.Open})},G[j.GoToItem]=function(e,n){var t=K(n,{resolveItems:function(){return e.items},resolveActiveIndex:function(){return e.activeItemIndex},resolveId:function(e){return e.id},resolveDisabled:function(e){return e.dataRef.current.disabled}});return""===e.searchQuery&&e.activeItemIndex===t?e:r({},e,{searchQuery:"",activeItemIndex:t})},G[j.Search]=function(e,n){var t=e.searchQuery+n.value,o=e.items.findIndex((function(e){var n;return(null==(n=e.dataRef.current.textValue)?void 0:n.startsWith(t))&&!e.dataRef.current.disabled}));return r({},e,-1===o||o===e.activeItemIndex?{searchQuery:t}:{searchQuery:t,activeItemIndex:o})},G[j.ClearSearch]=function(e){return r({},e,{searchQuery:""})},G[j.RegisterItem]=function(e,n){return r({},e,{items:[].concat(e.items,[{id:n.id,dataRef:n.dataRef}])})},G[j.UnregisterItem]=function(e,n){var t=e.items.slice(),o=null!==e.activeItemIndex?t[e.activeItemIndex]:null,u=t.findIndex((function(e){return e.id===n.id}));return-1!==u&&t.splice(u,1),r({},e,{items:t,activeItemIndex:u===e.activeItemIndex||null===o?null:t.indexOf(o)})},G),_=n.createContext(null);function $(e){var t=n.useContext(_);if(null===t){var r=new Error("<"+e+" /> is missing a parent <"+X.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(r,$),r}return t}function z(e,n){return b(n.type,Y,e,n)}_.displayName="MenuContext";var J=n.Fragment;function X(e){var r=n.useReducer(z,{menuState:P.Closed,buttonRef:n.createRef(),itemsRef:n.createRef(),items:[],searchQuery:"",activeItemIndex:null}),o=r[0],u=o.menuState,i=o.itemsRef,a=o.buttonRef,c=r[1];n.useEffect((function(){function e(e){var n,t,r,o=e.target,l=document.activeElement;u===P.Open&&((null==(n=a.current)?void 0:n.contains(o))||((null==(t=i.current)?void 0:t.contains(o))||c({type:j.CloseMenu}),l!==document.body&&(null==l?void 0:l.contains(o))||e.defaultPrevented||null==(r=a.current)||r.focus({preventScroll:!0})))}return window.addEventListener("mousedown",e),function(){return window.removeEventListener("mousedown",e)}}),[u,i,a,c]);var l=n.useMemo((function(){return{open:u===P.Open}}),[u]);return t.createElement(_.Provider,{value:r},y(e,l,J))}var Z,ee,ne,te=x((function e(t,o){var u,i=$([X.name,e.name].join(".")),a=i[0],c=i[1],l=B(a.buttonRef,o),s="headlessui-menu-button-"+p(),f=Q(),d=n.useCallback((function(e){switch(e.key){case A.Space:case A.Enter:case A.ArrowDown:e.preventDefault(),c({type:j.OpenMenu}),f.nextFrame((function(){var e;null==(e=a.itemsRef.current)||e.focus({preventScroll:!0}),c({type:j.GoToItem,focus:N.First})}));break;case A.ArrowUp:e.preventDefault(),c({type:j.OpenMenu}),f.nextFrame((function(){var e;null==(e=a.itemsRef.current)||e.focus({preventScroll:!0}),c({type:j.GoToItem,focus:N.Last})}))}}),[c,a,f]),v=n.useCallback((function(e){if(W(e.currentTarget))return e.preventDefault();t.disabled||(a.menuState===P.Open?(c({type:j.CloseMenu}),f.nextFrame((function(){var e;return null==(e=a.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(e.preventDefault(),c({type:j.OpenMenu}),f.nextFrame((function(){var e;return null==(e=a.itemsRef.current)?void 0:e.focus({preventScroll:!0})}))))}),[c,f,a,t.disabled]),m=n.useMemo((function(){return{open:a.menuState===P.Open}}),[a]);return y(r({},t,{ref:l,id:s,type:"button","aria-haspopup":!0,"aria-controls":null==(u=a.itemsRef.current)?void 0:u.id,"aria-expanded":a.menuState===P.Open||void 0,onKeyDown:d,onClick:v}),m,"button")})),re=a.RenderStrategy|a.Static,oe=x((function e(t,o){var u,i,a=$([X.name,e.name].join(".")),c=a[0],l=a[1],s=B(c.itemsRef,o),f="headlessui-menu-items-"+p(),d=Q(),v=n.useCallback((function(e){switch(d.dispose(),e.key){case A.Space:if(""!==c.searchQuery)return e.preventDefault(),l({type:j.Search,value:e.key});case A.Enter:var n;e.preventDefault(),l({type:j.CloseMenu}),null!==c.activeItemIndex&&(null==(n=document.getElementById(c.items[c.activeItemIndex].id))||n.click()),S().nextFrame((function(){var e;return null==(e=c.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case A.ArrowDown:return e.preventDefault(),l({type:j.GoToItem,focus:N.Next});case A.ArrowUp:return e.preventDefault(),l({type:j.GoToItem,focus:N.Previous});case A.Home:case A.PageUp:return e.preventDefault(),l({type:j.GoToItem,focus:N.First});case A.End:case A.PageDown:return e.preventDefault(),l({type:j.GoToItem,focus:N.Last});case A.Escape:e.preventDefault(),l({type:j.CloseMenu}),S().nextFrame((function(){var e;return null==(e=c.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case A.Tab:return e.preventDefault();default:1===e.key.length&&(l({type:j.Search,value:e.key}),d.setTimeout((function(){return l({type:j.ClearSearch})}),350))}}),[l,d,c]),m=n.useMemo((function(){return{open:c.menuState===P.Open}}),[c]);return y(r({},t,{"aria-activedescendant":null===c.activeItemIndex||null==(u=c.items[c.activeItemIndex])?void 0:u.id,"aria-labelledby":null==(i=c.buttonRef.current)?void 0:i.id,id:f,onKeyDown:v,role:"menu",tabIndex:0,ref:s}),m,"div",re,c.menuState===P.Open)})),ue=n.Fragment;function ie(e,t){var r=n.useState(e),o=r[0],u=r[1],i=n.useRef(e);return s((function(){i.current=e}),[e]),s((function(){return u(i.current)}),[i,u].concat(t)),o}X.Button=te,X.Items=oe,X.Item=function e(t){var u=t.disabled,i=void 0!==u&&u,a=t.className,c=t.onClick,l=o(t,["disabled","className","onClick"]),f=$([X.name,e.name].join(".")),d=f[0],v=f[1],m="headlessui-menu-item-"+p(),b=null!==d.activeItemIndex&&d.items[d.activeItemIndex].id===m;s((function(){if(d.menuState===P.Open&&b){var e=S();return e.nextFrame((function(){var e;return null==(e=document.getElementById(m))||null==e.scrollIntoView?void 0:e.scrollIntoView({block:"nearest"})})),e.dispose}}),[m,b,d.menuState]);var h=n.useRef({disabled:i});s((function(){h.current.disabled=i}),[h,i]),s((function(){var e,n;h.current.textValue=null==(e=document.getElementById(m))||null==(n=e.textContent)?void 0:n.toLowerCase()}),[h,m]),s((function(){return v({type:j.RegisterItem,id:m,dataRef:h}),function(){return v({type:j.UnregisterItem,id:m})}}),[h,m]);var x=n.useCallback((function(e){return i?e.preventDefault():(v({type:j.CloseMenu}),S().nextFrame((function(){var e;return null==(e=d.buttonRef.current)?void 0:e.focus({preventScroll:!0})})),c?c(e):void 0)}),[v,d.buttonRef,i,c]),g=n.useCallback((function(){if(i)return v({type:j.GoToItem,focus:N.Nothing});v({type:j.GoToItem,focus:N.Specific,id:m})}),[i,m,v]),I=n.useCallback((function(){i||b||v({type:j.GoToItem,focus:N.Specific,id:m})}),[i,b,m,v]),C=n.useCallback((function(){i||b&&v({type:j.GoToItem,focus:N.Nothing})}),[i,b,v]),w=n.useMemo((function(){return{active:b,disabled:i}}),[b,i]);return y(r({},l,{id:m,role:"menuitem",tabIndex:-1,className:q(a,w),"aria-disabled":!0===i||void 0,onClick:x,onFocus:g,onPointerMove:I,onMouseMove:I,onPointerLeave:C,onMouseLeave:C}),w,ue)},function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(ee||(ee={})),function(e){e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.GoToOption=2]="GoToOption",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterOption=5]="RegisterOption",e[e.UnregisterOption=6]="UnregisterOption"}(ne||(ne={}));var ae=((Z={})[ne.CloseListbox]=function(e){return r({},e,{activeOptionIndex:null,listboxState:ee.Closed})},Z[ne.OpenListbox]=function(e){return r({},e,{listboxState:ee.Open})},Z[ne.GoToOption]=function(e,n){var t=K(n,{resolveItems:function(){return e.options},resolveActiveIndex:function(){return e.activeOptionIndex},resolveId:function(e){return e.id},resolveDisabled:function(e){return e.dataRef.current.disabled}});return""===e.searchQuery&&e.activeOptionIndex===t?e:r({},e,{searchQuery:"",activeOptionIndex:t})},Z[ne.Search]=function(e,n){var t=e.searchQuery+n.value,o=e.options.findIndex((function(e){var n;return!e.dataRef.current.disabled&&(null==(n=e.dataRef.current.textValue)?void 0:n.startsWith(t))}));return r({},e,-1===o||o===e.activeOptionIndex?{searchQuery:t}:{searchQuery:t,activeOptionIndex:o})},Z[ne.ClearSearch]=function(e){return r({},e,{searchQuery:""})},Z[ne.RegisterOption]=function(e,n){return r({},e,{options:[].concat(e.options,[{id:n.id,dataRef:n.dataRef}])})},Z[ne.UnregisterOption]=function(e,n){var t=e.options.slice(),o=null!==e.activeOptionIndex?t[e.activeOptionIndex]:null,u=t.findIndex((function(e){return e.id===n.id}));return-1!==u&&t.splice(u,1),r({},e,{options:t,activeOptionIndex:u===e.activeOptionIndex||null===o?null:t.indexOf(o)})},Z),ce=n.createContext(null);function le(e){var t=n.useContext(ce);if(null===t){var r=new Error("<"+e+" /> is missing a parent <"+de.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(r,le),r}return t}function se(e,n){return b(n.type,ae,e,n)}ce.displayName="ListboxContext";var fe=n.Fragment;function de(e){var r=e.value,u=e.onChange,i=o(e,["value","onChange"]),a=Q(),c=n.useReducer(se,{listboxState:ee.Closed,propsRef:{current:{value:r,onChange:u}},labelRef:n.createRef(),buttonRef:n.createRef(),optionsRef:n.createRef(),options:[],searchQuery:"",activeOptionIndex:null}),l=c[0],f=l.listboxState,d=l.propsRef,v=l.optionsRef,p=l.buttonRef,m=c[1];s((function(){d.current.value=r}),[r,d]),s((function(){d.current.onChange=u}),[u,d]),n.useEffect((function(){function e(e){var n,t,r,o=e.target,u=document.activeElement;f===ee.Open&&((null==(n=p.current)?void 0:n.contains(o))||((null==(t=v.current)?void 0:t.contains(o))||m({type:ne.CloseListbox}),u!==document.body&&(null==u?void 0:u.contains(o))||e.defaultPrevented||null==(r=p.current)||r.focus({preventScroll:!0})))}return window.addEventListener("mousedown",e),function(){return window.removeEventListener("mousedown",e)}}),[f,v,p,a,m]);var b=n.useMemo((function(){return{open:f===ee.Open}}),[f]);return t.createElement(ce.Provider,{value:c},y(i,b,fe))}var ve=x((function e(t,o){var u,i=le([de.name,e.name].join(".")),a=i[0],c=i[1],l=B(a.buttonRef,o),s="headlessui-listbox-button-"+p(),f=Q(),d=n.useCallback((function(e){switch(e.key){case A.Space:case A.Enter:case A.ArrowDown:e.preventDefault(),c({type:ne.OpenListbox}),f.nextFrame((function(){var e;null==(e=a.optionsRef.current)||e.focus({preventScroll:!0}),a.propsRef.current.value||c({type:ne.GoToOption,focus:N.First})}));break;case A.ArrowUp:e.preventDefault(),c({type:ne.OpenListbox}),f.nextFrame((function(){var e;null==(e=a.optionsRef.current)||e.focus({preventScroll:!0}),a.propsRef.current.value||c({type:ne.GoToOption,focus:N.Last})}))}}),[c,a,f]),v=n.useCallback((function(e){if(W(e.currentTarget))return e.preventDefault();t.disabled||(a.listboxState===ee.Open?(c({type:ne.CloseListbox}),f.nextFrame((function(){var e;return null==(e=a.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(e.preventDefault(),c({type:ne.OpenListbox}),f.nextFrame((function(){var e;return null==(e=a.optionsRef.current)?void 0:e.focus({preventScroll:!0})}))))}),[c,f,a,t.disabled]),m=ie((function(){if(a.labelRef.current)return[a.labelRef.current.id,s].join(" ")}),[a.labelRef.current,s]),b=n.useMemo((function(){return{open:a.listboxState===ee.Open}}),[a]);return y(r({},t,{ref:l,id:s,type:"button","aria-haspopup":!0,"aria-controls":null==(u=a.optionsRef.current)?void 0:u.id,"aria-expanded":a.listboxState===ee.Open||void 0,"aria-labelledby":m,onKeyDown:d,onClick:v}),b,"button")})),pe=a.RenderStrategy|a.Static,me=x((function e(t,o){var u,i=le([de.name,e.name].join(".")),a=i[0],c=i[1],l=B(a.optionsRef,o),s="headlessui-listbox-options-"+p(),f=Q(),d=Q(),v=n.useCallback((function(e){switch(d.dispose(),e.key){case A.Space:if(""!==a.searchQuery)return e.preventDefault(),c({type:ne.Search,value:e.key});case A.Enter:e.preventDefault(),c({type:ne.CloseListbox}),null!==a.activeOptionIndex&&a.propsRef.current.onChange(a.options[a.activeOptionIndex].dataRef.current.value),S().nextFrame((function(){var e;return null==(e=a.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case A.ArrowDown:return e.preventDefault(),c({type:ne.GoToOption,focus:N.Next});case A.ArrowUp:return e.preventDefault(),c({type:ne.GoToOption,focus:N.Previous});case A.Home:case A.PageUp:return e.preventDefault(),c({type:ne.GoToOption,focus:N.First});case A.End:case A.PageDown:return e.preventDefault(),c({type:ne.GoToOption,focus:N.Last});case A.Escape:return e.preventDefault(),c({type:ne.CloseListbox}),f.nextFrame((function(){var e;return null==(e=a.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));case A.Tab:return e.preventDefault();default:1===e.key.length&&(c({type:ne.Search,value:e.key}),d.setTimeout((function(){return c({type:ne.ClearSearch})}),350))}}),[f,c,d,a]),m=ie((function(){var e,n,t;return null!=(e=null==(n=a.labelRef.current)?void 0:n.id)?e:null==(t=a.buttonRef.current)?void 0:t.id}),[a.labelRef.current,a.buttonRef.current]),b=n.useMemo((function(){return{open:a.listboxState===ee.Open}}),[a]);return y(r({},t,{"aria-activedescendant":null===a.activeOptionIndex||null==(u=a.options[a.activeOptionIndex])?void 0:u.id,"aria-labelledby":m,id:s,onKeyDown:v,role:"listbox",tabIndex:0,ref:l}),b,"ul",pe,a.listboxState===ee.Open)}));de.Button=ve,de.Label=function e(t){var o=le([de.name,e.name].join("."))[0],u="headlessui-listbox-label-"+p(),i=n.useCallback((function(){var e;return null==(e=o.buttonRef.current)?void 0:e.focus({preventScroll:!0})}),[o.buttonRef]),a=n.useMemo((function(){return{open:o.listboxState===ee.Open}}),[o]);return y(r({},t,{ref:o.labelRef,id:u,onClick:i}),a,"label")},de.Options=me,de.Option=function e(t){var u=t.disabled,i=void 0!==u&&u,a=t.value,c=t.className,l=o(t,["disabled","value","className"]),f=le([de.name,e.name].join(".")),d=f[0],v=f[1],m="headlessui-listbox-option-"+p(),b=null!==d.activeOptionIndex&&d.options[d.activeOptionIndex].id===m,h=d.propsRef.current.value===a,x=n.useRef({disabled:i,value:a});s((function(){x.current.disabled=i}),[x,i]),s((function(){x.current.value=a}),[x,a]),s((function(){var e,n;x.current.textValue=null==(e=document.getElementById(m))||null==(n=e.textContent)?void 0:n.toLowerCase()}),[x,m]);var g=n.useCallback((function(){return d.propsRef.current.onChange(a)}),[d.propsRef,a]);s((function(){return v({type:ne.RegisterOption,id:m,dataRef:x}),function(){return v({type:ne.UnregisterOption,id:m})}}),[x,m]),s((function(){var e;d.listboxState===ee.Open&&h&&(v({type:ne.GoToOption,focus:N.Specific,id:m}),null==(e=document.getElementById(m))||null==e.focus||e.focus())}),[d.listboxState]),s((function(){if(d.listboxState===ee.Open&&b){var e=S();return e.nextFrame((function(){var e;return null==(e=document.getElementById(m))||null==e.scrollIntoView?void 0:e.scrollIntoView({block:"nearest"})})),e.dispose}}),[m,b,d.listboxState]);var I=n.useCallback((function(e){if(i)return e.preventDefault();g(),v({type:ne.CloseListbox}),S().nextFrame((function(){var e;return null==(e=d.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))}),[v,d.buttonRef,i,g]),C=n.useCallback((function(){if(i)return v({type:ne.GoToOption,focus:N.Nothing});v({type:ne.GoToOption,focus:N.Specific,id:m})}),[i,m,v]),w=n.useCallback((function(){i||b||v({type:ne.GoToOption,focus:N.Specific,id:m})}),[i,b,m,v]),O=n.useCallback((function(){i||b&&v({type:ne.GoToOption,focus:N.Nothing})}),[i,b,v]),R=n.useMemo((function(){return{active:b,selected:h,disabled:i}}),[b,h,i]);return y(r({},l,{id:m,role:"option",tabIndex:-1,className:q(c,R),"aria-disabled":!0===i||void 0,"aria-selected":!0===h||void 0,onClick:I,onFocus:C,onPointerMove:w,onMouseMove:w,onPointerLeave:O,onMouseLeave:O}),R,"li")};var be=n.createContext(null);function ye(e){var t=n.useContext(be);if(null===t){var r=new Error("<"+e+" /> is missing a parent <Switch.Group /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(r,ye),r}return t}be.displayName="GroupContext";var he=n.Fragment;function xe(e){var t,u=e.checked,i=e.onChange,a=e.className,c=o(e,["checked","onChange","className"]),l="headlessui-switch-"+p(),s=n.useContext(be),f=n.useCallback((function(){return i(!u)}),[i,u]),d=n.useCallback((function(e){if(W(e.currentTarget))return e.preventDefault();e.preventDefault(),f()}),[f]),v=n.useCallback((function(e){e.key!==A.Tab&&e.preventDefault(),e.key===A.Space&&f()}),[f]),m=n.useCallback((function(e){return e.preventDefault()}),[]),b=n.useMemo((function(){return{checked:u}}),[u]),h={id:l,ref:null===s?void 0:s.setSwitch,role:"switch",tabIndex:0,className:q(a,b),"aria-checked":u,"aria-labelledby":null==s||null==(t=s.label)?void 0:t.id,onClick:d,onKeyUp:v,onKeyPress:m};return"button"===c.as&&Object.assign(h,{type:"button"}),y(r({},c,h),b,"button")}xe.Group=function(e){var r=n.useState(null),o=r[0],u=r[1],i=n.useState(null),a=i[0],c=i[1],l=n.useMemo((function(){return{switch:o,label:a,setSwitch:u,setLabel:c}}),[o,u,a,c]);return t.createElement(be.Provider,{value:l},y(e,{},he))},xe.Label=function e(t){var o=ye([xe.name,e.name].join(".")),u="headlessui-switch-label-"+p(),i=n.useCallback((function(){o.switch&&(o.switch.click(),o.switch.focus({preventScroll:!0}))}),[o.switch]);return y(r({},t,{ref:o.setLabel,id:u,onClick:i}),{},"label")},e.Listbox=de,e.Menu=X,e.Switch=xe,e.Transition=V,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=headlessui.umd.production.min.js.map

@@ -1,7 +0,4 @@

export * from './components/dialog/dialog';
export * from './components/disclosure/disclosure';
export * from './components/focus-trap/focus-trap';
export * from './components/transitions/transition';
export * from './components/menu/menu';
export * from './components/listbox/listbox';
export * from './components/menu/menu';
export * from './components/switch/switch';
export * from './components/transitions/transition';

@@ -82,54 +82,6 @@ export declare function getMenuButton(): HTMLElement | null;

label?: string;
description?: string;
}, switchElement?: HTMLElement | null): void;
export declare function getDisclosureButton(): HTMLElement | null;
export declare function getDisclosurePanel(): HTMLElement | null;
export declare enum DisclosureState {
/** The disclosure is visible to the user. */
Visible = 0,
/** The disclosure is **not** visible to the user. It's still in the DOM, but it is hidden. */
InvisibleHidden = 1,
/** The disclosure is **not** visible to the user. It's not in the DOM, it is unmounted. */
InvisibleUnmounted = 2
}
export declare function assertDisclosureButton(options: {
attributes?: Record<string, string | null>;
textContent?: string;
state: DisclosureState;
}, button?: HTMLElement | null): void;
export declare function assertDisclosurePanel(options: {
attributes?: Record<string, string | null>;
textContent?: string;
state: DisclosureState;
}, panel?: HTMLElement | null): void;
export declare function assertLabelValue(element: HTMLElement | null, value: string): void;
export declare function assertDescriptionValue(element: HTMLElement | null, value: string): void;
export declare function getDialogButton(): HTMLElement | null;
export declare function getDialogPanel(): HTMLElement | null;
export declare function getDialogOverlay(): HTMLElement | null;
export declare enum DialogState {
/** The dialog is visible to the user. */
Visible = 0,
/** The dialog is **not** visible to the user. It's still in the DOM, but it is hidden. */
InvisibleHidden = 1,
/** The dialog is **not** visible to the user. It's not in the DOM, it is unmounted. */
InvisibleUnmounted = 2
}
export declare function assertDialogButton(options: {
attributes?: Record<string, string | null>;
textContent?: string;
state: DialogState;
}, button?: HTMLElement | null): void;
export declare function assertDialogPanel(options: {
attributes?: Record<string, string | null>;
textContent?: string;
state: DialogState;
}, panel?: HTMLElement | null): void;
export declare function assertDialogOverlay(options: {
attributes?: Record<string, string | null>;
textContent?: string;
state: DialogState;
}, panel?: HTMLElement | null): void;
export declare function assertActiveElement(element: HTMLElement | null): void;
export declare function assertHidden(element: HTMLElement | null): void;
export declare function assertVisible(element: HTMLElement | null): void;

@@ -48,3 +48,3 @@ export declare let Keys: Record<string, Partial<KeyboardEvent>>;

export declare function type(events: Partial<KeyboardEvent>[], element?: Element | null): Promise<void>;
export declare function press(event: Partial<KeyboardEvent>, element?: Element | null): Promise<void>;
export declare function press(event: Partial<KeyboardEvent>): Promise<void>;
export declare enum MouseButton {

@@ -51,0 +51,0 @@ Left = 0,

{
"name": "@headlessui/react",
"version": "0.2.0-95c8cc7",
"version": "0.2.0-9891fa3",
"main": "dist/index.js",

@@ -5,0 +5,0 @@ "typings": "dist/index.d.ts",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc