burnout-components
Version:
A component library for burnout brands that contains common react-components and util functions used throughout it and it's portfolio companies
1 lines • 118 kB
JavaScript
var e=require('react/jsx-runtime'),t=require('react'),n=require('react-dom'),r=require('@tiptap/extension-text-align'),o=require('@tiptap/starter-kit'),i=require('lucide-react'),l=require('@tiptap/react'),s=require('@tanstack/react-form');function a(e){var t=Object.create(null);return e&&Object.keys(e).forEach((n=>{if('default'!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}})),t.default=e,Object.freeze(t)}var u=a(t),c=a(n);function d({children:t,colorSwap:n,fit:r,onClick:o,red:i,type:l='submit',disabled:s}){return n?e.jsx('button',{disabled:s,onClick:o,type:l,className:`bg-burnout-dark-gray hover:bg-burnout-light-gray ${r?'w-fit':'w-full'} border-burnout-blue nice-hover-burnout hober:text-black cursor-pointer rounded-lg border-2 px-3 py-2 text-center font-bold text-white transition-all duration-200 ease-in-out`,children:t}):i?e.jsx('button',{disabled:s,onClick:o,type:l,className:(r?'w-fit':'w-full')+' border-burnout-blue nice-hover-burnout bg-burnout-red hover:bg-burnout-light-red cursor-pointer rounded-lg border-2 px-3 py-2 text-center font-bold text-white transition-all duration-200 ease-in-out',children:t}):e.jsx('button',{disabled:s,onClick:o,className:`bg-burnout-light-gray hover:bg-burnout-dark-gray border-burnout-blue text-burnout-black nice-hover-burnout border-2 ${r?'w-fit':'w-full'} cursor-pointer rounded-lg px-3 py-2 text-center font-bold transition-all duration-200 ease-in-out hover:text-white`,children:t})}function f({children:t,colorSwap:n,fit:r,onClick:o,red:i,type:l='submit',disabled:s}){return n?e.jsx('button',{disabled:s,onClick:o,type:l,className:`bg-monsterPurple/50 hover:bg-monsterPurpleHover/50 ${r?'w-fit':'w-full'} border-monsterPurple/50 hover:border-monsterPurpleHover/50 nice-hover-no-shadow nice-pop cursor-pointer rounded-lg border px-3 py-2 text-center font-bold text-white backdrop-blur-sm transition-all duration-300 ease-in-out`,children:t}):i?e.jsx('button',{disabled:s,onClick:o,type:l,className:(r?'w-fit':'w-full')+' nice-hover-no-shadow nice-pop cursor-pointer rounded-lg border border-red-600/50 bg-red-600/50 px-3 py-2 text-center font-bold text-white backdrop-blur-sm transition-all duration-300 ease-in-out hover:border-red-800/50 hover:bg-red-800/50',children:t}):e.jsx('button',{disabled:s,onClick:o,className:`bg-monsterGreen/50 hover:bg-monsterGreenHover/50 hover:border-monsterGreenHover/50 border-monsterGreen/50 nice-hover-no-shadow nice-pop border text-white ${r?'w-fit':'w-full'} cursor-pointer rounded-lg px-3 py-2 text-center font-bold transition-all duration-300 ease-in-out`,children:t})}function p({children:t,colorSwap:n,fit:r,onClick:o,red:i,type:l='submit',disabled:s}){return n?e.jsx('button',{disabled:s,onClick:o,type:l,className:`bg-monsterPurple hover:bg-monsterPurpleHover ${r?'w-fit':'w-full'} border-siteBackground nice-hover-burnout cursor-pointer rounded-lg border-2 px-3 py-2 text-center font-bold text-white transition-all duration-200 ease-in-out`,children:t}):i?e.jsx('button',{disabled:s,onClick:o,type:l,className:(r?'w-fit':'w-full')+' border-siteBackground nice-hover-burnout cursor-pointer rounded-lg border-2 bg-red-600 px-3 py-2 text-center font-bold text-white transition-all duration-200 ease-in-out hover:bg-red-800',children:t}):e.jsx('button',{disabled:s,onClick:o,className:`bg-monsterGreen hover:bg-monsterGreenHover border-siteBackground text-siteBackground nice-hover-burnout border-2 ${r?'w-fit':'w-full'} cursor-pointer rounded-lg px-3 py-2 text-center font-bold transition-all duration-200 ease-in-out`,children:t})}function m({meta:t}){return t.isTouched?t.errors.map((({message:t},n)=>e.jsx('p',{className:'mt-2 text-sm font-medium text-red-600 italic',children:t},n))):null}const h='undefined'!=typeof document?t.useLayoutEffect:()=>{};const g=e=>{var t;return null!==(t=null==e?void 0:e.ownerDocument)&&void 0!==t?t:document},v=e=>{if(e&&'window'in e&&e.window===e)return e;return g(e).defaultView||window};function b(e,t){return!(!t||!e)&&e.contains(t)}const x=(e=document)=>e.activeElement;function y(e){return e.target}function w(e){var t;return'undefined'!=typeof window&&null!=window.navigator&&((null===(t=window.navigator.userAgentData)||void 0===t?void 0:t.brands.some((t=>e.test(t.brand))))||e.test(window.navigator.userAgent))}function E(e){var t;return'undefined'!=typeof window&&null!=window.navigator&&e.test((null===(t=window.navigator.userAgentData)||void 0===t?void 0:t.platform)||window.navigator.platform)}function C(e){if('test'===process.env.NODE_ENV)return e;let t=null;return()=>(null==t&&(t=e()),t)}const S=C((()=>E(/^Mac/i))),O=C((()=>E(/^iPhone/i))),k=C((()=>E(/^iPad/i)||S()&&navigator.maxTouchPoints>1)),L=C((()=>O()||k()));C((()=>S()||L())),C((()=>w(/AppleWebKit/i)&&!j()));const j=C((()=>w(/Chrome/i))),T=C((()=>w(/Android/i)));function N(){let e=t.useRef(new Map),n=t.useCallback(((t,n,r,o)=>{let i=(null==o?void 0:o.once)?(...t)=>{e.current.delete(r),r(...t)}:r;e.current.set(r,{type:n,eventTarget:t,fn:i,options:o}),t.addEventListener(n,i,o)}),[]),r=t.useCallback(((t,n,r,o)=>{var i;let l=(null===(i=e.current.get(r))||void 0===i?void 0:i.fn)||r;t.removeEventListener(n,l,o),e.current.delete(r)}),[]),o=t.useCallback((()=>{e.current.forEach(((e,t)=>{r(e.eventTarget,e.type,t,e.options)}))}),[r]);return t.useEffect((()=>o),[o]),{addGlobalListener:n,removeGlobalListener:r,removeAllGlobalListeners:o}}function A(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function F(e){let n=t.useRef({isFocused:!1,observer:null});h((()=>{const e=n.current;return()=>{e.observer&&(e.observer.disconnect(),e.observer=null)}}),[]);let r=function(e){const n=t.useRef(null);return h((()=>{n.current=e}),[e]),t.useCallback(((...e)=>{const t=n.current;return null==t?void 0:t(...e)}),[])}((t=>{null==e||e(t)}));return t.useCallback((e=>{if(e.target instanceof HTMLButtonElement||e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement||e.target instanceof HTMLSelectElement){n.current.isFocused=!0;let t=e.target,o=e=>{if(n.current.isFocused=!1,t.disabled){let t=A(e);r(t)}n.current.observer&&(n.current.observer.disconnect(),n.current.observer=null)};t.addEventListener('focusout',o,{once:!0}),n.current.observer=new MutationObserver((()=>{if(n.current.isFocused&&t.disabled){var e;null===(e=n.current.observer)||void 0===e||e.disconnect();let r=t===document.activeElement?null:document.activeElement;t.dispatchEvent(new FocusEvent('blur',{relatedTarget:r})),t.dispatchEvent(new FocusEvent('focusout',{bubbles:!0,relatedTarget:r}))}})),n.current.observer.observe(t,{attributes:!0,attributeFilter:['disabled']})}}),[r])}C((()=>w(/Firefox/i)));let R=null,P=new Set,M=new Map,D=!1,I=!1;const H={Tab:!0,Escape:!0};function _(e,t){for(let n of P)n(e,t)}function B(e){D=!0,function(e){return!(e.metaKey||!S()&&e.altKey||e.ctrlKey||'Control'===e.key||'Shift'===e.key||'Meta'===e.key)}(e)&&(R='keyboard',_('keyboard',e))}function V(e){R='pointer','mousedown'!==e.type&&'pointerdown'!==e.type||(D=!0,_('pointer',e))}function q(e){var t;(0===(t=e).mozInputSource&&t.isTrusted||(T()&&t.pointerType?'click'===t.type&&1===t.buttons:0===t.detail&&!t.pointerType))&&(D=!0,R='virtual')}function W(e){e.target!==window&&e.target!==document&&e.isTrusted&&(D||I||(R='virtual',_('virtual',e)),D=!1,I=!1)}function G(){D=!1,I=!0}function $(e){if('undefined'==typeof window||M.get(v(e)))return;const t=v(e),n=g(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){D=!0,r.apply(this,arguments)},n.addEventListener('keydown',B,!0),n.addEventListener('keyup',B,!0),n.addEventListener('click',q,!0),t.addEventListener('focus',W,!0),t.addEventListener('blur',G,!1),'undefined'!=typeof PointerEvent?(n.addEventListener('pointerdown',V,!0),n.addEventListener('pointermove',V,!0),n.addEventListener('pointerup',V,!0)):'test'===process.env.NODE_ENV&&(n.addEventListener('mousedown',V,!0),n.addEventListener('mousemove',V,!0),n.addEventListener('mouseup',V,!0)),t.addEventListener('beforeunload',(()=>{z(e)}),{once:!0}),M.set(t,{focus:r})}const z=(e,t)=>{const n=v(e),r=g(e);t&&r.removeEventListener('DOMContentLoaded',t),M.has(n)&&(n.HTMLElement.prototype.focus=M.get(n).focus,r.removeEventListener('keydown',B,!0),r.removeEventListener('keyup',B,!0),r.removeEventListener('click',q,!0),n.removeEventListener('focus',W,!0),n.removeEventListener('blur',G,!1),'undefined'!=typeof PointerEvent?(r.removeEventListener('pointerdown',V,!0),r.removeEventListener('pointermove',V,!0),r.removeEventListener('pointerup',V,!0)):'test'===process.env.NODE_ENV&&(r.removeEventListener('mousedown',V,!0),r.removeEventListener('mousemove',V,!0),r.removeEventListener('mouseup',V,!0)),M.delete(n))};function U(){return'pointer'!==R}'undefined'!=typeof document&&function(e){const t=g(e);let n;'loading'!==t.readyState?$(e):(n=()=>{$(e)},t.addEventListener('DOMContentLoaded',n))}();const K=new Set(['checkbox','radio','range','color','file','image','button','submit','reset']);function Y(e,n,r){$(),t.useEffect((()=>{let t=(t,n)=>{(function(e,t,n){let r=g(null==n?void 0:n.target);const o='undefined'!=typeof window?v(null==n?void 0:n.target).HTMLInputElement:HTMLInputElement,i='undefined'!=typeof window?v(null==n?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,l='undefined'!=typeof window?v(null==n?void 0:n.target).HTMLElement:HTMLElement,s='undefined'!=typeof window?v(null==n?void 0:n.target).KeyboardEvent:KeyboardEvent;return!((e=e||r.activeElement instanceof o&&!K.has(r.activeElement.type)||r.activeElement instanceof i||r.activeElement instanceof l&&r.activeElement.isContentEditable)&&'keyboard'===t&&n instanceof s&&!H[n.key])})(!!(null==r?void 0:r.isTextInput),t,n)&&e(U())};return P.add(t),()=>{P.delete(t)}}),n)}function X(e){let{isDisabled:n,onBlurWithin:r,onFocusWithin:o,onFocusWithinChange:i}=e,l=t.useRef({isFocusWithin:!1}),{addGlobalListener:s,removeAllGlobalListeners:a}=N(),u=t.useCallback((e=>{e.currentTarget.contains(e.target)&&l.current.isFocusWithin&&!e.currentTarget.contains(e.relatedTarget)&&(l.current.isFocusWithin=!1,a(),r&&r(e),i&&i(!1))}),[r,i,l,a]),c=F(u),d=t.useCallback((e=>{if(!e.currentTarget.contains(e.target))return;const t=g(e.target),n=x(t);if(!l.current.isFocusWithin&&n===y(e.nativeEvent)){o&&o(e),i&&i(!0),l.current.isFocusWithin=!0,c(e);let n=e.currentTarget;s(t,'focus',(e=>{if(l.current.isFocusWithin&&!b(n,e.target)){let r=new t.defaultView.FocusEvent('blur',{relatedTarget:e.target});!function(e,t){Object.defineProperty(e,'target',{value:t}),Object.defineProperty(e,'currentTarget',{value:t})}(r,n);let o=A(r);u(o)}}),{capture:!0})}}),[o,i,c,s,u]);return n?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:d,onBlur:u}}}let Q=!1,Z=0;function J(){Q=!0,setTimeout((()=>{Q=!1}),50)}function ee(e){'touch'===e.pointerType&&J()}function te(){if('undefined'!=typeof document)return'undefined'!=typeof PointerEvent?document.addEventListener('pointerup',ee):'test'===process.env.NODE_ENV&&document.addEventListener('touchend',J),Z++,()=>{Z--,Z>0||('undefined'!=typeof PointerEvent?document.removeEventListener('pointerup',ee):'test'===process.env.NODE_ENV&&document.removeEventListener('touchend',J))}}function ne(e={}){let{autoFocus:n=!1,isTextInput:r,within:o}=e,i=t.useRef({isFocused:!1,isFocusVisible:n||U()}),[l,s]=t.useState(!1),[a,u]=t.useState((()=>i.current.isFocused&&i.current.isFocusVisible)),c=t.useCallback((()=>u(i.current.isFocused&&i.current.isFocusVisible)),[]),d=t.useCallback((e=>{i.current.isFocused=e,s(e),c()}),[c]);Y((e=>{i.current.isFocusVisible=e,c()}),[],{isTextInput:r});let{focusProps:f}=function(e){let{isDisabled:n,onFocus:r,onBlur:o,onFocusChange:i}=e;const l=t.useCallback((e=>{if(e.target===e.currentTarget)return o&&o(e),i&&i(!1),!0}),[o,i]),s=F(l),a=t.useCallback((e=>{const t=g(e.target),n=t?x(t):x();e.target===e.currentTarget&&n===y(e.nativeEvent)&&(r&&r(e),i&&i(!0),s(e))}),[i,r,s]);return{focusProps:{onFocus:!n&&(r||i||o)?a:void 0,onBlur:n||!o&&!i?void 0:l}}}({isDisabled:o,onFocusChange:d}),{focusWithinProps:p}=X({isDisabled:!o,onFocusWithinChange:d});return{isFocused:l,isFocusVisible:a,focusProps:o?p:f}}var re=Object.defineProperty,oe=(e,t,n)=>(((e,t,n)=>{t in e?re(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,'symbol'!=typeof t?t+'':t,n),n);let ie=new class{constructor(){oe(this,'current',this.detect()),oe(this,'handoffState','pending'),oe(this,'currentId',0)}set(e){this.current!==e&&(this.handoffState='pending',this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return'server'===this.current}get isClient(){return'client'===this.current}detect(){return'undefined'==typeof window||'undefined'==typeof document?'server':'client'}handoff(){'pending'===this.handoffState&&(this.handoffState='complete')}get isHandoffComplete(){return'complete'===this.handoffState}};function le(e){var t,n;return ie.isServer?null:e?'ownerDocument'in e?e.ownerDocument:'current'in e?null!=(n=null==(t=e.current)?void 0:t.ownerDocument)?n:document:null:document}function se(e){'function'==typeof queueMicrotask?queueMicrotask(e):Promise.resolve().then(e).catch((e=>setTimeout((()=>{throw e}))))}function ae(){let e=[],t={addEventListener:(e,n,r,o)=>(e.addEventListener(n,r,o),t.add((()=>e.removeEventListener(n,r,o)))),requestAnimationFrame(...e){let n=requestAnimationFrame(...e);return t.add((()=>cancelAnimationFrame(n)))},nextFrame:(...e)=>t.requestAnimationFrame((()=>t.requestAnimationFrame(...e))),setTimeout(...e){let n=setTimeout(...e);return t.add((()=>clearTimeout(n)))},microTask(...e){let n={current:!0};return se((()=>{n.current&&e[0]()})),t.add((()=>{n.current=!1}))},style(e,t,n){let r=e.style.getPropertyValue(t);return Object.assign(e.style,{[t]:n}),this.add((()=>{Object.assign(e.style,{[t]:r})}))},group(e){let t=ae();return e(t),this.add((()=>t.dispose()))},add:t=>(e.includes(t)||e.push(t),()=>{let n=e.indexOf(t);if(n>=0)for(let t of e.splice(n,1))t()}),dispose(){for(let t of e.splice(0))t()}};return t}function ue(){let[e]=t.useState(ae);return t.useEffect((()=>()=>e.dispose()),[e]),e}let ce=(e,n)=>{ie.isServer?t.useEffect(e,n):t.useLayoutEffect(e,n)};function de(e){let n=t.useRef(e);return ce((()=>{n.current=e}),[e]),n}let fe=e=>{let n=de(e);return t.useCallback(((...e)=>n.current(...e)),[n])};let pe=t.createContext(void 0);function me(){return t.useContext(pe)}function he(...e){return Array.from(new Set(e.flatMap((e=>'string'==typeof e?e.split(' '):[])))).filter(Boolean).join(' ')}function ge(e,t,...n){if(e in t){let r=t[e];return'function'==typeof r?r(...n):r}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map((e=>`"${e}"`)).join(', ')}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,ge),r}var ve=(e=>(e[e.None=0]='None',e[e.RenderStrategy=1]='RenderStrategy',e[e.Static=2]='Static',e))(ve||{}),be=(e=>(e[e.Unmount=0]='Unmount',e[e.Hidden=1]='Hidden',e))(be||{});function xe(){let e=function(){let e=t.useRef([]),n=t.useCallback((t=>{for(let n of e.current)null!=n&&('function'==typeof n?n(t):n.current=t)}),[]);return(...t)=>{if(!t.every((e=>null==e)))return e.current=t,n}}();return t.useCallback((t=>function({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:i=!0,name:l,mergeRefs:s}){s=null!=s?s:we;let a=Ee(t,e);if(i)return ye(a,n,r,l,s);let u=null!=o?o:0;if(2&u){let{static:e=!1,...t}=a;if(e)return ye(t,n,r,l,s)}if(1&u){let{unmount:e=!0,...t}=a;return ge(e?0:1,{0:()=>null,1:()=>ye({...t,hidden:!0,style:{display:'none'}},n,r,l,s)})}return ye(a,n,r,l,s)}({mergeRefs:e,...t})),[e])}function ye(e,n={},r,o,i){let{as:l=r,children:s,refName:a='ref',...u}=ke(e,['unmount','static']),c=void 0!==e.ref?{[a]:e.ref}:{},d='function'==typeof s?s(n):s;'className'in u&&u.className&&'function'==typeof u.className&&(u.className=u.className(n)),u['aria-labelledby']&&u['aria-labelledby']===u.id&&(u['aria-labelledby']=void 0);let f={};if(n){let e=!1,t=[];for(let[r,o]of Object.entries(n))'boolean'==typeof o&&(e=!0),!0===o&&t.push(r.replace(/([A-Z])/g,(e=>`-${e.toLowerCase()}`)));if(e){f['data-headlessui-state']=t.join(' ');for(let e of t)f[`data-${e}`]=''}}if(l===t.Fragment&&(Object.keys(Oe(u)).length>0||Object.keys(Oe(f)).length>0)){if(t.isValidElement(d)&&!(Array.isArray(d)&&d.length>1)){let e=d.props,n=null==e?void 0:e.className,r='function'==typeof n?(...e)=>he(n(...e),u.className):he(n,u.className),o=r?{className:r}:{},l=Ee(d.props,Oe(ke(u,['ref'])));for(let e in f)e in l&&delete f[e];return t.cloneElement(d,Object.assign({},l,f,c,{ref:i(Le(d),c.ref)},o))}if(Object.keys(Oe(u)).length>0)throw new Error(['Passing props on "Fragment"!','',`The current component <${o} /> is rendering a "Fragment".`,'However we need to passthrough the following props:',Object.keys(Oe(u)).concat(Object.keys(Oe(f))).map((e=>` - ${e}`)).join('\n'),'','You can apply a few solutions:',['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".','Render a single element as the child so that we can forward the props onto that element.'].map((e=>` - ${e}`)).join('\n')].join('\n'))}return t.createElement(l,Object.assign({},ke(u,['ref']),l!==t.Fragment&&c,l!==t.Fragment&&f),d)}function we(...e){return e.every((e=>null==e))?void 0:t=>{for(let n of e)null!=n&&('function'==typeof n?n(t):n.current=t)}}function Ee(...e){if(0===e.length)return{};if(1===e.length)return e[0];let t={},n={};for(let r of e)for(let e in r)e.startsWith('on')&&'function'==typeof r[e]?(null!=n[e]||(n[e]=[]),n[e].push(r[e])):t[e]=r[e];if(t.disabled||t['aria-disabled'])for(let e in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(e)&&(n[e]=[e=>{var t;return null==(t=null==e?void 0:e.preventDefault)?void 0:t.call(e)}]);for(let e in n)Object.assign(t,{[e](t,...r){let o=n[e];for(let e of o){if((t instanceof Event||(null==t?void 0:t.nativeEvent)instanceof Event)&&t.defaultPrevented)return;e(t,...r)}}});return t}function Ce(...e){if(0===e.length)return{};if(1===e.length)return e[0];let t={},n={};for(let r of e)for(let e in r)e.startsWith('on')&&'function'==typeof r[e]?(null!=n[e]||(n[e]=[]),n[e].push(r[e])):t[e]=r[e];for(let e in n)Object.assign(t,{[e](...t){let r=n[e];for(let e of r)null==e||e(...t)}});return t}function Se(e){var n;return Object.assign(t.forwardRef(e),{displayName:null!=(n=e.displayName)?n:e.name})}function Oe(e){let t=Object.assign({},e);for(let e in t)void 0===t[e]&&delete t[e];return t}function ke(e,t=[]){let n=Object.assign({},e);for(let e of t)e in n&&delete n[e];return n}function Le(e){return t.version.split('.')[0]>='19'?e.props.ref:e.ref}function je(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))Ne(n,Te(t,r),o);return n}function Te(e,t){return e?e+'['+t+']':t}function Ne(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())Ne(e,Te(t,r.toString()),o);else n instanceof Date?e.push([t,n.toISOString()]):'boolean'==typeof n?e.push([t,n?'1':'0']):'string'==typeof n?e.push([t,n]):'number'==typeof n?e.push([t,`${n}`]):null==n?e.push([t,'']):je(n,t,e)}var Ae=(e=>(e[e.None=1]='None',e[e.Focusable=2]='Focusable',e[e.Hidden=4]='Hidden',e))(Ae||{});let Fe=Se((function(e,t){var n;let{features:r=1,...o}=e,i={ref:t,'aria-hidden':!(2&~r)||(null!=(n=o['aria-hidden'])?n:void 0),hidden:!(4&~r)||void 0,style:{position:'fixed',top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:'hidden',clip:'rect(0, 0, 0, 0)',whiteSpace:'nowrap',borderWidth:'0',...!(4&~r)&&!!(2&~r)&&{display:'none'}}};return xe()({ourProps:i,theirProps:o,slot:{},defaultTag:'span',name:'Hidden'})})),Re=t.createContext(null);function Pe({children:e}){let r=t.useContext(Re);if(!r)return t.createElement(t.Fragment,null,e);let{target:o}=r;return o?n.createPortal(t.createElement(t.Fragment,null,e),o):null}function Me({data:e,form:n,disabled:r,onReset:o,overrides:i}){let[l,s]=t.useState(null),a=ue();return t.useEffect((()=>{if(o&&l)return a.addEventListener(l,'reset',o)}),[l,n,o]),t.createElement(Pe,null,t.createElement(De,{setForm:s,formId:n}),je(e).map((([e,o])=>t.createElement(Fe,{features:Ae.Hidden,...Oe({key:e,as:'input',type:'hidden',hidden:!0,readOnly:!0,form:n,disabled:r,name:e,value:o,...i})}))))}function De({setForm:e,formId:n}){return t.useEffect((()=>{if(n){let t=document.getElementById(n);t&&e(t)}}),[e,n]),n?null:t.createElement(Fe,{features:Ae.Hidden,as:'input',type:'hidden',hidden:!0,readOnly:!0,ref:t=>{if(!t)return;let n=t.closest('form');n&&e(n)}})}let Ie=t.createContext(void 0);function He(){return t.useContext(Ie)}function _e(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=''===(null==t?void 0:t.getAttribute('disabled'));return(!r||!function(e){if(!e)return!1;let t=e.previousElementSibling;for(;null!==t;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}(n))&&r}let Be=Symbol();function Ve(...e){let n=t.useRef(e);t.useEffect((()=>{n.current=e}),[e]);let r=fe((e=>{for(let t of n.current)null!=t&&('function'==typeof t?t(e):t.current=e)}));return e.every((e=>null==e||(null==e?void 0:e[Be])))?void 0:r}let qe=t.createContext(null);function We(){let e=t.useContext(qe);if(null===e){let e=new Error('You used a <Description /> component, but it is not inside a relevant parent.');throw Error.captureStackTrace&&Error.captureStackTrace(e,We),e}return e}qe.displayName='DescriptionContext';let Ge=Se((function(e,n){let r=t.useId(),o=me(),{id:i=`headlessui-description-${r}`,...l}=e,s=We(),a=Ve(n);ce((()=>s.register(i)),[i,s.register]);let u=o||!1,c=t.useMemo((()=>({...s.slot,disabled:u})),[s.slot,u]),d={ref:a,...s.props,id:i};return xe()({ourProps:d,theirProps:l,slot:c,defaultTag:'p',name:s.name||'Description'})}));Object.assign(Ge,{});var $e=(e=>(e.Space=' ',e.Enter='Enter',e.Escape='Escape',e.Backspace='Backspace',e.Delete='Delete',e.ArrowLeft='ArrowLeft',e.ArrowUp='ArrowUp',e.ArrowRight='ArrowRight',e.ArrowDown='ArrowDown',e.Home='Home',e.End='End',e.PageUp='PageUp',e.PageDown='PageDown',e.Tab='Tab',e))($e||{});let ze=t.createContext(null);function Ue(){let e=t.useContext(ze);if(null===e){let e=new Error('You used a <Label /> component, but it is not inside a relevant parent.');throw Error.captureStackTrace&&Error.captureStackTrace(e,Ue),e}return e}function Ke(e){var n,r,o;let i=null!=(r=null==(n=t.useContext(ze))?void 0:n.value)?r:void 0;return(null!=(o=null==e?void 0:e.length)?o:0)>0?[i,...e].filter(Boolean).join(' '):i}ze.displayName='LabelContext';let Ye=Se((function(e,n){var r;let o=t.useId(),i=Ue(),l=He(),s=me(),{id:a=`headlessui-label-${o}`,htmlFor:u=(null!=l?l:null==(r=i.props)?void 0:r.htmlFor),passive:c=!1,...d}=e,f=Ve(n);ce((()=>i.register(a)),[a,i.register]);let p=fe((e=>{let t=e.currentTarget;if(t instanceof HTMLLabelElement&&e.preventDefault(),i.props&&'onClick'in i.props&&'function'==typeof i.props.onClick&&i.props.onClick(e),t instanceof HTMLLabelElement){let e=document.getElementById(t.htmlFor);if(e){let t=e.getAttribute('disabled');if('true'===t||''===t)return;let n=e.getAttribute('aria-disabled');if('true'===n||''===n)return;(e instanceof HTMLInputElement&&('radio'===e.type||'checkbox'===e.type)||'radio'===e.role||'checkbox'===e.role||'switch'===e.role)&&e.click(),e.focus({preventScroll:!0})}}})),m=s||!1,h=t.useMemo((()=>({...i.slot,disabled:m})),[i.slot,m]),g={ref:f,...i.props,id:a,htmlFor:u,onClick:p};return c&&('onClick'in g&&(delete g.htmlFor,delete g.onClick),'onClick'in d&&delete d.onClick),xe()({ourProps:g,theirProps:d,slot:h,defaultTag:u?'label':'div',name:i.name||'Label'})})),Xe=Object.assign(Ye,{});function Qe(e,t){return null!==e&&null!==t&&'object'==typeof e&&'object'==typeof t&&'id'in e&&'id'in t?e.id===t.id:e===t}function Ze(e,n=!1){let[r,o]=t.useReducer((()=>({})),{}),i=t.useMemo((()=>function(e){if(null===e)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}(e)),[e,r]);return ce((()=>{if(!e)return;let t=new ResizeObserver(o);return t.observe(e),()=>{t.disconnect()}}),[e]),n?{width:`${i.width}px`,height:`${i.height}px`}:i}let Je=class extends Map{constructor(e){super(),this.factory=e}get(e){let t=super.get(e);return void 0===t&&(t=this.factory(e),this.set(e,t)),t}};function et(e,t){let n=e(),r=new Set;return{getSnapshot:()=>n,subscribe:e=>(r.add(e),()=>r.delete(e)),dispatch(e,...o){let i=t[e].call(n,...o);i&&(n=i,r.forEach((e=>e())))}}}function tt(e){return t.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}let nt=new Je((()=>et((()=>[]),{ADD(e){return this.includes(e)?this:[...this,e]},REMOVE(e){let t=this.indexOf(e);if(-1===t)return this;let n=this.slice();return n.splice(t,1),n}})));function rt(e,n){let r=nt.get(n),o=t.useId(),i=tt(r);if(ce((()=>{if(e)return r.dispatch('ADD',o),()=>r.dispatch('REMOVE',o)}),[r,e]),!e)return!1;let l=i.indexOf(o),s=i.length;return-1===l&&(l=s,s+=1),l===s-1}let ot=new Map,it=new Map;function lt(e){var t;let n=null!=(t=it.get(e))?t:0;return it.set(e,n+1),0!==n||(ot.set(e,{'aria-hidden':e.getAttribute('aria-hidden'),inert:e.inert}),e.setAttribute('aria-hidden','true'),e.inert=!0),()=>st(e)}function st(e){var t;let n=null!=(t=it.get(e))?t:1;if(1===n?it.delete(e):it.set(e,n-1),1!==n)return;let r=ot.get(e);r&&(null===r['aria-hidden']?e.removeAttribute('aria-hidden'):e.setAttribute('aria-hidden',r['aria-hidden']),e.inert=r.inert,ot.delete(e))}function at(e,{allowed:t,disallowed:n}={}){let r=rt(e,'inert-others');ce((()=>{var e,o;if(!r)return;let i=ae();for(let t of null!=(e=null==n?void 0:n())?e:[])t&&i.add(lt(t));let l=null!=(o=null==t?void 0:t())?o:[];for(let e of l){if(!e)continue;let t=le(e);if(!t)continue;let n=e.parentElement;for(;n&&n!==t.body;){for(let e of n.children)l.some((t=>e.contains(t)))||i.add(lt(e));n=n.parentElement}}return i.dispose}),[r,t,n])}let ut=['[contentEditable=true]','[tabindex]','a[href]','area[href]','button:not([disabled])','iframe','input:not([disabled])','select:not([disabled])','textarea:not([disabled])'].map((e=>`${e}:not([tabindex='-1'])`)).join(','),ct=['[data-autofocus]'].map((e=>`${e}:not([tabindex='-1'])`)).join(',');var dt=(e=>(e[e.First=1]='First',e[e.Previous=2]='Previous',e[e.Next=4]='Next',e[e.Last=8]='Last',e[e.WrapAround=16]='WrapAround',e[e.NoScroll=32]='NoScroll',e[e.AutoFocus=64]='AutoFocus',e))(dt||{}),ft=(e=>(e[e.Error=0]='Error',e[e.Overflow=1]='Overflow',e[e.Success=2]='Success',e[e.Underflow=3]='Underflow',e))(ft||{}),pt=(e=>(e[e.Previous=-1]='Previous',e[e.Next=1]='Next',e))(pt||{});function mt(e=document.body){return null==e?[]:Array.from(e.querySelectorAll(ut)).sort(((e,t)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER))))}var ht=(e=>(e[e.Strict=0]='Strict',e[e.Loose=1]='Loose',e))(ht||{});function gt(e,t=0){var n;return e!==(null==(n=le(e))?void 0:n.body)&&ge(t,{0:()=>e.matches(ut),1(){let t=e;for(;null!==t;){if(t.matches(ut))return!0;t=t.parentElement}return!1}})}var vt=(e=>(e[e.Keyboard=0]='Keyboard',e[e.Mouse=1]='Mouse',e))(vt||{});'undefined'!=typeof window&&'undefined'!=typeof document&&(document.addEventListener('keydown',(e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible='')}),!0),document.addEventListener('click',(e=>{1===e.detail?delete document.documentElement.dataset.headlessuiFocusVisible:0===e.detail&&(document.documentElement.dataset.headlessuiFocusVisible='')}),!0));let bt=['textarea','input'].join(',');function xt(e,t=e=>e){return e.slice().sort(((e,n)=>{let r=t(e),o=t(n);if(null===r||null===o)return 0;let i=r.compareDocumentPosition(o);return i&Node.DOCUMENT_POSITION_FOLLOWING?-1:i&Node.DOCUMENT_POSITION_PRECEDING?1:0}))}function yt(e,t){return function(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:o=[]}={}){let i=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,l=Array.isArray(e)?n?xt(e):e:64&t?function(e=document.body){return null==e?[]:Array.from(e.querySelectorAll(ct)).sort(((e,t)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER))))}(e):mt(e);o.length>0&&l.length>1&&(l=l.filter((e=>!o.some((t=>null!=t&&'current'in t?(null==t?void 0:t.current)===e:t===e))))),r=null!=r?r:i.activeElement;let s,a=(()=>{if(5&t)return 1;if(10&t)return-1;throw new Error('Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last')})(),u=(()=>{if(1&t)return 0;if(2&t)return Math.max(0,l.indexOf(r))-1;if(4&t)return Math.max(0,l.indexOf(r))+1;if(8&t)return l.length-1;throw new Error('Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last')})(),c=32&t?{preventScroll:!0}:{},d=0,f=l.length;do{if(d>=f||d+f<=0)return 0;let e=u+d;if(16&t)e=(e+f)%f;else{if(e<0)return 3;if(e>=f)return 1}s=l[e],null==s||s.focus(c),d+=a}while(s!==i.activeElement);return 6&t&&function(e){var t,n;return null!=(n=null==(t=null==e?void 0:e.matches)?void 0:t.call(e,bt))&&n}(s)&&s.select(),2}(mt(),t,{relativeTo:e})}function wt(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function Et(){return wt()||/Android/gi.test(window.navigator.userAgent)}function Ct(e,n,r,o){let i=de(r);t.useEffect((()=>{if(e)return document.addEventListener(n,t,o),()=>document.removeEventListener(n,t,o);function t(e){i.current(e)}}),[e,n,o])}function St(e,n,r){let o=rt(e,'outside-click'),i=de(r),l=t.useCallback(((e,t)=>{if(e.defaultPrevented)return;let r=t(e);if(null===r||!r.getRootNode().contains(r)||!r.isConnected)return;let o=function e(t){return'function'==typeof t?e(t()):Array.isArray(t)||t instanceof Set?t:[t]}(n);for(let t of o)if(null!==t&&(t.contains(r)||e.composed&&e.composedPath().includes(t)))return;return!gt(r,ht.Loose)&&-1!==r.tabIndex&&e.preventDefault(),i.current(e,r)}),[i,n]),s=t.useRef(null);Ct(o,'pointerdown',(e=>{var t,n;s.current=(null==(n=null==(t=e.composedPath)?void 0:t.call(e))?void 0:n[0])||e.target}),!0),Ct(o,'mousedown',(e=>{var t,n;s.current=(null==(n=null==(t=e.composedPath)?void 0:t.call(e))?void 0:n[0])||e.target}),!0),Ct(o,'click',(e=>{Et()||s.current&&(l(e,(()=>s.current)),s.current=null)}),!0);let a=t.useRef({x:0,y:0});Ct(o,'touchstart',(e=>{a.current.x=e.touches[0].clientX,a.current.y=e.touches[0].clientY}),!0),Ct(o,'touchend',(e=>{let t=e.changedTouches[0].clientX,n=e.changedTouches[0].clientY;if(!(Math.abs(t-a.current.x)>=30||Math.abs(n-a.current.y)>=30))return l(e,(()=>e.target instanceof HTMLElement?e.target:null))}),!0),function(e,n,r,o){let i=de(r);t.useEffect((()=>{if(e)return window.addEventListener(n,t,o),()=>window.removeEventListener(n,t,o);function t(e){i.current(e)}}),[e,n,o])}(o,'blur',(e=>l(e,(()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null))),!0)}function Ot(...e){return t.useMemo((()=>le(...e)),[...e])}function kt(e,n){return t.useMemo((()=>{var t;if(e.type)return e.type;let r=null!=(t=e.as)?t:'button';return'string'==typeof r&&'button'===r.toLowerCase()||'BUTTON'===(null==n?void 0:n.tagName)&&!n.hasAttribute('type')?'button':void 0}),[e.type,e.as,n])}function Lt(){let e;return{before({doc:t}){var n;let r=t.documentElement,o=null!=(n=t.defaultView)?n:window;e=Math.max(0,o.innerWidth-r.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,o=Math.max(0,r.clientWidth-r.offsetWidth),i=Math.max(0,e-o);n.style(r,'paddingRight',`${i}px`)}}}function jt(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let Tt=et((()=>new Map),{PUSH(e,t){var n;let r=null!=(n=this.get(e))?n:{doc:e,count:0,d:ae(),meta:new Set};return r.count++,r.meta.add(t),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:n}){let r={doc:e,d:t,meta:jt(n)},o=[wt()?{before({doc:e,d:t,meta:n}){function r(e){return n.containers.flatMap((e=>e())).some((t=>t.contains(e)))}t.microTask((()=>{var n;if('auto'!==window.getComputedStyle(e.documentElement).scrollBehavior){let n=ae();n.style(e.documentElement,'scrollBehavior','auto'),t.add((()=>t.microTask((()=>n.dispose()))))}let o=null!=(n=window.scrollY)?n:window.pageYOffset,i=null;t.addEventListener(e,'click',(t=>{if(t.target instanceof HTMLElement)try{let n=t.target.closest('a');if(!n)return;let{hash:o}=new URL(n.href),l=e.querySelector(o);l&&!r(l)&&(i=l)}catch{}}),!0),t.addEventListener(e,'touchstart',(e=>{if(e.target instanceof HTMLElement)if(r(e.target)){let n=e.target;for(;n.parentElement&&r(n.parentElement);)n=n.parentElement;t.style(n,'overscrollBehavior','contain')}else t.style(e.target,'touchAction','none')})),t.addEventListener(e,'touchmove',(e=>{if(e.target instanceof HTMLElement){if('INPUT'===e.target.tagName)return;if(r(e.target)){let t=e.target;for(;t.parentElement&&''!==t.dataset.headlessuiPortal&&!(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth);)t=t.parentElement;''===t.dataset.headlessuiPortal&&e.preventDefault()}else e.preventDefault()}}),{passive:!1}),t.add((()=>{var e;let t=null!=(e=window.scrollY)?e:window.pageYOffset;o!==t&&window.scrollTo(0,o),i&&i.isConnected&&(i.scrollIntoView({block:'nearest'}),i=null)}))}))}}:{},Lt(),{before({doc:e,d:t}){t.style(e.documentElement,'overflow','hidden')}}];o.forEach((({before:e})=>null==e?void 0:e(r))),o.forEach((({after:e})=>null==e?void 0:e(r)))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});function Nt(e,t,n=()=>[document.body]){!function(e,t,n=()=>({containers:[]})){let r=tt(Tt),o=t?r.get(t):void 0,i=!!o&&o.count>0;ce((()=>{if(t&&e)return Tt.dispatch('PUSH',t,n),()=>Tt.dispatch('POP',t,n)}),[e,t])}(rt(e,'scroll-lock'),t,(e=>{var t;return{containers:[...null!=(t=e.containers)?t:[],n]}}))}function At(e){return[e.screenX,e.screenY]}function Ft(){let e=t.useRef([-1,-1]);return{wasMoved(t){let n=At(t);return(e.current[0]!==n[0]||e.current[1]!==n[1])&&(e.current=n,!0)},update(t){e.current=At(t)}}}var Rt,Pt;Tt.subscribe((()=>{let e=Tt.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let e='hidden'===t.get(n.doc),r=0!==n.count;(r&&!e||!r&&e)&&Tt.dispatch(n.count>0?'SCROLL_PREVENT':'SCROLL_ALLOW',n),0===n.count&&Tt.dispatch('TEARDOWN',n)}})),'undefined'!=typeof process&&'undefined'!=typeof globalThis&&'undefined'!=typeof Element&&'test'===(null==(Rt=null==process?void 0:process.env)?void 0:Rt.NODE_ENV)&&void 0===(null==(Pt=null==Element?void 0:Element.prototype)?void 0:Pt.getAnimations)&&(Element.prototype.getAnimations=()=>(console.warn(['Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.','Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.','','Example usage:','```js','import { mockAnimationsApi } from \'jsdom-testing-mocks\'','mockAnimationsApi()','```'].join('\n')),[]));var Mt=(e=>(e[e.None=0]='None',e[e.Closed=1]='Closed',e[e.Enter=2]='Enter',e[e.Leave=4]='Leave',e))(Mt||{});function Dt(e){let t={};for(let n in e)!0===e[n]&&(t[`data-${n}`]='');return t}function It(e,n,r,o){let[i,l]=t.useState(r),{hasFlag:s,addFlag:a,removeFlag:u}=function(e=0){let[n,r]=t.useState(e),o=t.useCallback((e=>r(e)),[n]),i=t.useCallback((e=>r((t=>t|e))),[n]),l=t.useCallback((e=>(n&e)===e),[n]),s=t.useCallback((e=>r((t=>t&~e))),[r]),a=t.useCallback((e=>r((t=>t^e))),[r]);return{flags:n,setFlag:o,addFlag:i,hasFlag:l,removeFlag:s,toggleFlag:a}}(e&&i?3:0),c=t.useRef(!1),d=t.useRef(!1),f=ue();return ce((()=>{if(e)return r&&l(!0),n?(null==void 0||undefined.call(o,r),function(e,{prepare:t,run:n,done:r,inFlight:o}){let i=ae();return function(e,{inFlight:t,prepare:n}){if(null!=t&&t.current)return void n();let r=e.style.transition;e.style.transition='none',n(),e.offsetHeight,e.style.transition=r}(e,{prepare:t,inFlight:o}),i.nextFrame((()=>{n(),i.requestAnimationFrame((()=>{i.add(function(e,t){var n,r;let o=ae();if(!e)return o.dispose;let i=!1;o.add((()=>{i=!0}));let l=null!=(r=null==(n=e.getAnimations)?void 0:n.call(e).filter((e=>e instanceof CSSTransition)))?r:[];return 0===l.length?(t(),o.dispose):(Promise.allSettled(l.map((e=>e.finished))).then((()=>{i||t()})),o.dispose)}(e,r))}))})),i.dispose}(n,{inFlight:c,prepare(){d.current?d.current=!1:d.current=c.current,c.current=!0,!d.current&&(r?(a(3),u(4)):(a(4),u(2)))},run(){d.current?r?(u(3),a(4)):(u(4),a(3)):r?u(1):a(1)},done(){d.current&&'function'==typeof n.getAnimations&&n.getAnimations().length>0||(c.current=!1,u(7),r||l(!1),null==void 0||undefined.call(o,r))}})):void(r&&a(3))}),[e,r,n,f]),e?[i,{closed:s(1),enter:s(2),leave:s(4),transition:s(2)||s(4)}]:[r,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function Ht(){return'undefined'!=typeof window}function _t(e){return qt(e)?(e.nodeName||'').toLowerCase():'#document'}function Bt(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Vt(e){var t;return null==(t=(qt(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function qt(e){return!!Ht()&&(e instanceof Node||e instanceof Bt(e).Node)}function Wt(e){return!!Ht()&&(e instanceof Element||e instanceof Bt(e).Element)}function Gt(e){return!!Ht()&&(e instanceof HTMLElement||e instanceof Bt(e).HTMLElement)}function $t(e){return!(!Ht()||'undefined'==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Bt(e).ShadowRoot)}function zt(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Zt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!['inline','contents'].includes(o)}function Ut(e){return['table','td','th'].includes(_t(e))}function Kt(e){return[':popover-open',':modal'].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function Yt(e){const t=Xt(),n=Wt(e)?Zt(e):e;return['transform','translate','scale','rotate','perspective'].some((e=>!!n[e]&&'none'!==n[e]))||!!n.containerType&&'normal'!==n.containerType||!t&&!!n.backdropFilter&&'none'!==n.backdropFilter||!t&&!!n.filter&&'none'!==n.filter||['transform','translate','scale','rotate','perspective','filter'].some((e=>(n.willChange||'').includes(e)))||['paint','layout','strict','content'].some((e=>(n.contain||'').includes(e)))}function Xt(){return!('undefined'==typeof CSS||!CSS.supports)&&CSS.supports('-webkit-backdrop-filter','none')}function Qt(e){return['html','body','#document'].includes(_t(e))}function Zt(e){return Bt(e).getComputedStyle(e)}function Jt(e){return Wt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function en(e){if('html'===_t(e))return e;const t=e.assignedSlot||e.parentNode||$t(e)&&e.host||Vt(e);return $t(t)?t.host:t}function tn(e){const t=en(e);return Qt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Gt(t)&&zt(t)?t:tn(t)}function nn(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=tn(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),l=Bt(o);if(i){const e=rn(l);return t.concat(l,l.visualViewport||[],zt(o)?o:[],e&&n?nn(e):[])}return t.concat(o,nn(o,[],n))}function rn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const on=Math.min,ln=Math.max,sn=Math.round,an=Math.floor,un=e=>({x:e,y:e}),cn={left:'right',right:'left',bottom:'top',top:'bottom'},dn={start:'end',end:'start'};function fn(e,t,n){return ln(e,on(t,n))}function pn(e,t){return'function'==typeof e?e(t):e}function mn(e){return e.split('-')[0]}function hn(e){return e.split('-')[1]}function gn(e){return'x'===e?'y':'x'}function vn(e){return'y'===e?'height':'width'}function bn(e){return['top','bottom'].includes(mn(e))?'y':'x'}function xn(e){return gn(bn(e))}function yn(e){return e.replace(/start|end/g,(e=>dn[e]))}function wn(e){return e.replace(/left|right|bottom|top/g,(e=>cn[e]))}function En(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Cn(e,t,n){let{reference:r,floating:o}=e;const i=bn(t),l=xn(t),s=vn(l),a=mn(t),u='y'===i,c=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[s]/2-o[s]/2;let p;switch(a){case'top':p={x:c,y:r.y-o.height};break;case'bottom':p={x:c,y:r.y+r.height};break;case'right':p={x:r.x+r.width,y:d};break;case'left':p={x:r.x-o.width,y:d};break;default:p={x:r.x,y:r.y}}switch(hn(t)){case'start':p[l]-=f*(n&&u?-1:1);break;case'end':p[l]+=f*(n&&u?-1:1)}return p}async function Sn(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:l,elements:s,strategy:a}=e,{boundary:u='clippingAncestors',rootBoundary:c='viewport',elementContext:d='floating',altBoundary:f=!1,padding:p=0}=pn(t,e),m=function(e){return'number'!=typeof e?(e=>({top:0,right:0,bottom:0,left:0,...e}))(e):{top:e,right:e,bottom:e,left:e}}(p),h=s[f?'floating'===d?'reference':'floating':d],g=En(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(h)))||n?h:h.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:a})),v='floating'===d?{x:r,y:o,width:l.floating.width,height:l.floating.height}:l.reference,b=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),x=await(null==i.isElement?void 0:i.isElement(b))&&await(null==i.getScale?void 0:i.getScale(b))||{x:1,y:1},y=En(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:b,strategy:a}):v);return{top:(g.top-y.top+m.top)/x.y,bottom:(y.bottom-g.bottom+m.bottom)/x.y,left:(g.left-y.left+m.left)/x.x,right:(y.right-g.right+m.right)/x.x}}function On(e){const t=Zt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Gt(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,s=sn(n)!==i||sn(r)!==l;return s&&(n=i,r=l),{width:n,height:r,$:s}}function kn(e){return Wt(e)?e:e.contextElement}function Ln(e){const t=kn(e);if(!Gt(t))return un(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=On(t);let l=(i?sn(n.width):n.width)/r,s=(i?sn(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),s&&Number.isFinite(s)||(s=1),{x:l,y:s}}const jn=un(0);function Tn(e){const t=Bt(e);return Xt()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:jn}function Nn(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=kn(e);let l=un(1);t&&(r?Wt(r)&&(l=Ln(r)):l=Ln(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==Bt(e))&&t}(i,n,r)?Tn(i):un(0);let a=(o.left+s.x)/l.x,u=(o.top+s.y)/l.y,c=o.width/l.x,d=o.height/l.y;if(i){const e=Bt(i),t=r&&Wt(r)?Bt(r):r;let n=e,o=rn(n);for(;o&&r&&t!==n;){const e=Ln(o),t=o.getBoundingClientRect(),r=Zt(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,l=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;a*=e.x,u*=e.y,c*=e.x,d*=e.y,a+=i,u+=l,n=Bt(o),o=rn(n)}}return En({width:c,height:d,x:a,y:u})}function An(e,t){const n=Jt(e).scrollLeft;return t?t.left+n:Nn(Vt(e)).left+n}function Fn(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:An(e,r)),y:r.top+t.scrollTop}}function Rn(e,t,n){let r;if('viewport'===t)r=function(e,t){const n=Bt(e),r=Vt(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,s=0,a=0;if(o){i=o.width,l=o.height;const e=Xt();(!e||e&&'fixed'===t)&&(s=o.offsetLeft,a=o.offsetTop)}return{width:i,height:l,x:s,y:a}}(e,n);else if('document'===t)r=function(e){const t=Vt(e),n=Jt(e),r=e.ownerDocument.body,o=ln(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=ln(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+An(e);const s=-n.scrollTop;return'rtl'===Zt(r).direction&&(l+=ln(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:s}}(Vt(e));else if(Wt(t))r=function(e,t){const n=Nn(e,!0,'fixed'===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Gt(e)?Ln(e):un(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=Tn(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return En(r)}function Pn(e,t){const n=en(e);return!(n===t||!Wt(n)||Qt(n))&&('fixed'===Zt(n).position||Pn(n,t))}function Mn(e,t,n){const r=Gt(t),o=Vt(t),i='fixed'===n,l=Nn(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const a=un(0);function u(){a.x=An(o)}if(r||!r&&!i)if(('body'!==_t(t)||zt(o))&&(s=Jt(t)),r){const e=Nn(t,!0,i,t);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}else o&&u();i&&!r&&o&&u();const c=!o||r||i?un(0):Fn(o,s);return{x:l.left+s.scrollLeft-a.x-c.x,y:l.top+s.scrollTop-a.y-c.y,width:l.width,height:l.height}}function Dn(e){return'static'===Zt(e).position}function In(e,t){if(!Gt(e)||'fixed'===Zt(e).position)return null;if(t)return t(e);let n=e.offsetParent;return Vt(e)===n&&(n=n.ownerDocument.body),n}function Hn(e,t){const n=Bt(e);if(Kt(e))return n;if(!Gt(e)){let t=en(e);for(;t&&!Qt(t);){if(Wt(t)&&!Dn(t))return t;t=en(t)}return n}let r=In(e,t);for(;r&&Ut(r)&&Dn(r);)r=In(r,t);return r&&Qt(r)&&Dn(r)&&!Yt(r)?n:r||function(e){let t=en(e);for(;Gt(t)&&!Qt(t);){if(Yt(t))return t;if(Kt(t))return null;t=en(t)}return null}(e)||n}const _n={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i='fixed'===o,l=Vt(r),s=!!t&&Kt(t.floating);if(r===l||s&&i)return n;let a={scrollLeft:0,scrollTop:0},u=un(1);const c=un(0),d=Gt(r);if((d||!d&&!i)&&(('body'!==_t(r)||zt(l))&&(a=Jt(r)),Gt(r))){const e=Nn(r);u=Ln(r),c.x=e.x+r.clientLeft,c.y=e.y+r.clientTop}const f=!l||d||i?un(0):Fn(l,a,!0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-a.scrollLeft*u.x+c.x+f.x,y:n.y*u.y-a.scrollTop*u.y+c.y+f.y}},getDocumentElement:Vt,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...'clippingAncestors'===n?Kt(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=nn(e,[],!1).filter((e=>Wt(e)&&'body'!==_t(e))),o=null;const i='fixed'===Zt(e).position;let l=i?en(e):e;for(;Wt(l)&&!Qt(l);){const t=Zt(l),n=Yt(l);n||'fixed'!==t.position||(o=null),(i?!n&&!o:!n&&'static'===t.position&&o&&['absolute','fixed'].includes(o.position)||zt(l)&&!n&&Pn(e,l))?r=r.filter((e=>e!==l)):o=t,l=en(l)}return t.set(e,r),r}(t,this._c):[].concat(n),r],l=i[0],s=i.reduce(((e,n)=>{const r=Rn(t,n,o);return e.top=ln(r.top,e.top),e.right=on(r.right,e.right),e.bottom=on(r.bottom,e.bottom),e.left=ln(r.left,e.left),e}),Rn(t,l,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:Hn,getElementRects:async function(e){const t=this.getOffsetParent||Hn,n=this.getDimensions,r=await n(e.floating);return{reference:Mn(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=On(e);return{width:t,height:n}},getScale:Ln,isElement:Wt,isRTL:function(e){return'rtl'===Zt(e).direction}};function Bn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Vn(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:l='function'==typeof ResizeObserver,layoutShift:s='function'==typeof IntersectionObserver,animationFrame:a=!1}=r,u=kn(e),c=o||i?[...u?nn(u):[],...nn(t)]:[];c.forEach((e=>{o&&e.addEventListener('scroll',n,{passive:!0}),i&&e.addEventListener('resize',n)}));const d=u&&s?function(e,t){let n,r=null;const o=Vt(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function l(s,a){void 0===s&&(s=!1),void 0===a&&(a=1),i();const u=e.getBoundingClientRect(),{left:c,top:d,width:f,height:p}=u;if(s||t(),!f||!p)return;const m={rootMargin:-an(d)+'px '+-an(o.clientWidth-(c+f))+'px '+-an(o.clientHeight-(d+p))+'px '+-an(c)+'px',threshold:ln(0,on(1,a))||1};let h=!0;function g(t){const r=t[0].intersectionRatio;if(r!==a){if(!h)return l();r?l(!1,r):n=setTimeout((()=>{l(!1,1e-7)}),1e3)}1!==r||Bn(u,e.getBoundingClientRect())||l(),h=!1}try{r=new IntersectionObserver(g,{...m,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(g,m)}r.observe(e)}(!0),i}(u,n):null;let f,p=-1,m=null;l&&(m=new ResizeObserver((e=>{let[r]=e;r&&r.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{var e;null==(e=m)||e.observe(t)}))),n()})),u&&!a&&m.observe(u),m.observe(t));let h=a?Nn(e):null;return a&&function t(){const r=Nn(e);h&&!Bn(h,r)&&n();h=r,f=requestAnimationFrame(t)}(),n(),()=>{var e;c.forEach((e=>{o&&e.removeEventListener('scroll',n),i&&e.removeEventListener('resize',n)})),null==d||d(),null==(e=m)||e.disconnect(),m=null,a&&cancelAnimationFrame(f)}}const qn=Sn,Wn=e=>(void 0===e&&(e=0),{name:'offset',options:e,async fn(t){var n,r;const{x:o,y:i,placement:l,middlewareData:s}=t,a=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),l=mn(n),s=hn(n),a='y'===bn(n),u=['left','top'].includes(l)?-1:1,c=i&&a?-1:1,d=pn(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:m}='number'==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&'number'==typeof m&&(p='end'===s?-1*m:m),a?{x:p*c,y:f*u}:{x:f*u,y:p*c}}(t,e);return l===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+a.x,y:i+a.y,data:{...a,placement:l}}}}),Gn=e=>(void 0===e&&(e={}),{name:'shift',options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...a}=pn(e,t),u={x:n,y:r},c=await Sn(t,a),d=bn(mn(o)),f=gn(d);let p=u[f],m=u[d];if(i){const e='y'===f?'bottom':'right';p=fn(p+c['y'===f?'top':'left'],p,p-c[e])}if(l){const e='y'===d?'bottom':'right';m=fn(m+c['y'===d?'top':'left'],m,m-c[e])}const h=s.fn({...t,[f]:p,[d]:m});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[f]:i,[d]:l}}}}}),$n=e=>(void 0===e&&(e={}),{name:'flip',options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:l,initialPlacement:s,platform:a,elements:u}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p='bestFit',fallbackAxisSideDirection:m='none',flipAlignment:h=!0,...g}=pn(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=mn(o),b=bn(s),x=mn(s)===s,y=await(null==a.isRTL?void 0:a.isRTL(u.floating)),w=f||(x||!h?[wn(s)]:f