@petnow/ui 2.4.0 → 2.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -50,7 +50,7 @@ Valid keys: `+JSON.stringify(Object.keys(P),null," "));var Q=Ie(A,J,F,ne,U+"."+
50
50
  also providing a custom height.
51
51
  The custom height has a higher priority than the animateHeight property.
52
52
  So animateHeight is most likely having no effect at all.`);var en=(0,e.default)({},m.slide,W),vt,Lt;if(J||!Y||A)vt="all 0s ease 0s",Lt="all 0s ease 0s";else if(vt=g("transform",j),Lt=g("-webkit-transform",j),B!==0){var Jr=", ".concat(g("height",j));vt+=Jr,Lt+=Jr}var Ln={height:null,WebkitFlexDirection:v.flexDirection[I],flexDirection:v.flexDirection[I],WebkitTransition:Lt,transition:vt};if(!Ie){var Fn=v.transform[I](this.indexCurrent*100);Ln.WebkitTransform=Fn,Ln.transform=Fn}return $&&(Ln.height=B),u.createElement(T.Provider,{value:this.getSwipeableViewsContext()},u.createElement("div",(0,e.default)({ref:this.setRootNode,style:(0,e.default)({},v.root[I],F)},ne,Q,nt,{onScroll:this.handleScroll}),u.createElement("div",{ref:this.setContainerNode,style:(0,e.default)({},Ln,m.container,C),className:"react-swipeable-view-container"},u.Children.map(V,function(Zr,ga){if(Ie&&ga!==K)return null;process.env.NODE_ENV!=="production"&&(0,f.default)(u.isValidElement(Zr),"react-swipeable-view: one of the children provided is invalid: ".concat(Zr,`.
53
- We are expecting a valid React Element`));var sr,ba=!0;return ga===K&&(ba=!1,$&&(sr=b.setActiveSlide,en.overflowY="hidden")),u.createElement("div",{ref:sr,style:en,className:G,"aria-hidden":ba,"data-swipeable":"true"},Zr)}))))}}]),M}(u.Component);N.displayName="ReactSwipableView",N.propTypes=process.env.NODE_ENV!=="production"?{action:c.default.func,animateHeight:c.default.bool,animateTransitions:c.default.bool,axis:c.default.oneOf(["x","x-reverse","y","y-reverse"]),children:c.default.node.isRequired,containerStyle:c.default.object,disabled:c.default.bool,disableLazyLoading:c.default.bool,enableMouseEvents:c.default.bool,hysteresis:c.default.number,ignoreNativeScroll:c.default.bool,index:c.default.number,onChangeIndex:c.default.func,onMouseDown:c.default.func,onMouseLeave:c.default.func,onMouseMove:c.default.func,onMouseUp:c.default.func,onScroll:c.default.func,onSwitching:c.default.func,onTouchEnd:c.default.func,onTouchMove:c.default.func,onTouchStart:c.default.func,onTransitionEnd:c.default.func,resistance:c.default.bool,slideClassName:c.default.string,slideStyle:c.default.object,springConfig:c.default.shape({delay:c.default.string,duration:c.default.string,easeFunction:c.default.string}),style:c.default.object,threshold:c.default.number}:{},N.defaultProps={animateHeight:!1,animateTransitions:!0,axis:"x",disabled:!1,disableLazyLoading:!1,enableMouseEvents:!1,hysteresis:.6,ignoreNativeScroll:!1,index:0,threshold:5,springConfig:{duration:"0.35s",easeFunction:"cubic-bezier(0.15, 0.3, 0.25, 1)",delay:"0s"},resistance:!1};var _=N;return At.default=_,At}var Cl;function Gp(){return Cl||(Cl=1,function(n){var r=zs();Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(n,"SwipeableViewsContext",{enumerable:!0,get:function(){return e.SwipeableViewsContext}});var e=r(Qp())}(ka)),ka}var Kp=Gp();const Xp=jf(Kp),Jp=({className:n,tabList:r,isCuratedcontent:e,unswipeableContent:t,defaultIndex:o=0,onTabChange:a,disabled:i,allowScrollToSection:s=!0})=>{const[l,u]=d.useState(o),c=d.useRef(null),f=m=>{m.current&&window.scrollTo({top:m.current.offsetTop-50,behavior:"smooth"})},h=m=>{u(m),s&&f(c),a==null||a(m)},p=()=>{const v=100/r.length;return{width:`${v}%`,left:`${l*v}%`}};return R.jsxs("div",{ref:c,className:"w-full",children:[R.jsxs("div",{className:ot(n==null?void 0:n.tab,`z-50 mb-[20px] flex w-full flex-col bg-white ${e&&"sticky top-[50px]"}`),children:[R.jsx("div",{className:"flex",children:r.map((m,v)=>R.jsx("div",{className:"flex flex-1 flex-col",children:R.jsx("button",{className:ot(n==null?void 0:n.tabTitle,`cursor-pointer ${l===v?"text-petnow-grey-30 text-label-large":"text-petnow-grey-70 text-body-large disabled:opacity-40"}`),onClick:()=>h(v),disabled:i,children:m.displayName})},m.key))}),R.jsx("div",{className:ot(n==null?void 0:n.underline,`relative h-[2px] w-full ${i?"bg-petnow-grey-70/40":"bg-petnow-grey-70"}`),children:R.jsx("div",{className:ot(n==null?void 0:n.selectedUnderline,"bg-petnow-grey-30 absolute h-[2px] transition-all duration-200"),style:p()})})]}),t,R.jsx(Xp,{index:l,onChangeIndex:m=>{u(m),a==null||a(m)},disabled:i,children:r.map(m=>R.jsx("div",{children:m.content},m.key))})]})},Zp=({className:n,id:r,onChange:e,disabled:t,isChecked:o})=>R.jsxs("label",{className:"relative flex h-min w-min cursor-pointer items-center rounded-full",htmlFor:r,children:[R.jsx("input",{type:"checkbox",disabled:t,className:ot(n,"before:content[''] peer bg-petnow-grey-primary checked:border-petnow-orange-primary checked:bg-petnow-orange-primary checked:before:bg-petnow-orange-primary border-petnow-grey-primary relative size-6 cursor-pointer appearance-none rounded-xl border transition-all before:absolute before:top-2/4 before:left-2/4 before:block before:h-6 before:w-6 before:-translate-x-2/4 before:-translate-y-2/4 before:rounded-full before:opacity-0 before:transition-opacity"),id:r,checked:o,onChange:a=>{e(a.target.checked)}}),R.jsx("span",{className:"text-petnow-grey-secondary pointer-events-none absolute top-2/4 left-2/4 -translate-x-2/4 -translate-y-2/4 transition peer-checked:text-white",children:R.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",stroke:"currentColor",strokeWidth:"1",children:R.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})})]}),eh=({className:n,text:r,isSelected:e,onClick:t,disabled:o})=>R.jsx("button",{className:ot(n,`keen-slider__slide text-body-medium rounded-full border-1 px-[12px] py-[6px] whitespace-nowrap ${e?"border-petnow-orange-primary bg-petnow-orange-secondary text-petnow-orange-primary":"border-petnow-grey-90 disabled:opacity-40"}`),onClick:t,style:{width:"min-content",minWidth:"fit-content"},disabled:o,children:r}),_l=typeof document<"u"?d.useLayoutEffect:()=>{};var Va;const th=(Va=d.useInsertionEffect)!==null&&Va!==void 0?Va:_l;function nh(n){const r=d.useRef(null);return th(()=>{r.current=n},[n]),d.useCallback((...e)=>{const t=r.current;return t==null?void 0:t(...e)},[])}const nn=n=>{var r;return(r=n==null?void 0:n.ownerDocument)!==null&&r!==void 0?r:document},wn=n=>n&&"window"in n&&n.window===n?n:nn(n).defaultView||window;function rh(n){return n!==null&&typeof n=="object"&&"nodeType"in n&&typeof n.nodeType=="number"}function oh(n){return rh(n)&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in n}let ah=!1;function za(){return ah}function Ol(n,r){if(!za())return r&&n?n.contains(r):!1;if(!n||!r)return!1;let e=r;for(;e!==null;){if(e===n)return!0;e.tagName==="SLOT"&&e.assignedSlot?e=e.assignedSlot.parentNode:oh(e)?e=e.host:e=e.parentNode}return!1}const qa=(n=document)=>{var r;if(!za())return n.activeElement;let e=n.activeElement;for(;e&&"shadowRoot"in e&&(!((r=e.shadowRoot)===null||r===void 0)&&r.activeElement);)e=e.shadowRoot.activeElement;return e};function Ml(n){return za()&&n.target.shadowRoot&&n.composedPath?n.composedPath()[0]:n.target}function fo(n){var r;if(typeof window>"u"||window.navigator==null)return!1;let e=(r=window.navigator.userAgentData)===null||r===void 0?void 0:r.brands;return Array.isArray(e)&&e.some(t=>n.test(t.brand))||n.test(window.navigator.userAgent)}function Ua(n){var r;return typeof window<"u"&&window.navigator!=null?n.test(((r=window.navigator.userAgentData)===null||r===void 0?void 0:r.platform)||window.navigator.platform):!1}function Rt(n){if(process.env.NODE_ENV==="test")return n;let r=null;return()=>(r==null&&(r=n()),r)}const Qa=Rt(function(){return Ua(/^Mac/i)}),ih=Rt(function(){return Ua(/^iPhone/i)}),sh=Rt(function(){return Ua(/^iPad/i)||Qa()&&navigator.maxTouchPoints>1}),lh=Rt(function(){return ih()||sh()});Rt(function(){return Qa()||lh()}),Rt(function(){return fo(/AppleWebKit/i)&&!uh()});const uh=Rt(function(){return fo(/Chrome/i)}),ch=Rt(function(){return fo(/Android/i)});Rt(function(){return fo(/Firefox/i)});function Tl(){let n=d.useRef(new Map),r=d.useCallback((o,a,i,s)=>{let l=s!=null&&s.once?(...u)=>{n.current.delete(i),i(...u)}:i;n.current.set(i,{type:a,eventTarget:o,fn:l,options:s}),o.addEventListener(a,l,s)},[]),e=d.useCallback((o,a,i,s)=>{var l;let u=((l=n.current.get(i))===null||l===void 0?void 0:l.fn)||i;o.removeEventListener(a,u,s),n.current.delete(i)},[]),t=d.useCallback(()=>{n.current.forEach((o,a)=>{e(o.eventTarget,o.type,a,o.options)})},[e]);return d.useEffect(()=>t,[t]),{addGlobalListener:r,removeGlobalListener:e,removeAllGlobalListeners:t}}function dh(n){return n.mozInputSource===0&&n.isTrusted?!0:ch()&&n.pointerType?n.type==="click"&&n.buttons===1:n.detail===0&&!n.pointerType}function Pl(n){let r=n;return r.nativeEvent=n,r.isDefaultPrevented=()=>r.defaultPrevented,r.isPropagationStopped=()=>r.cancelBubble,r.persist=()=>{},r}function fh(n,r){Object.defineProperty(n,"target",{value:r}),Object.defineProperty(n,"currentTarget",{value:r})}function Il(n){let r=d.useRef({isFocused:!1,observer:null});_l(()=>{const t=r.current;return()=>{t.observer&&(t.observer.disconnect(),t.observer=null)}},[]);let e=nh(t=>{n==null||n(t)});return d.useCallback(t=>{if(t.target instanceof HTMLButtonElement||t.target instanceof HTMLInputElement||t.target instanceof HTMLTextAreaElement||t.target instanceof HTMLSelectElement){r.current.isFocused=!0;let o=t.target,a=i=>{if(r.current.isFocused=!1,o.disabled){let s=Pl(i);e(s)}r.current.observer&&(r.current.observer.disconnect(),r.current.observer=null)};o.addEventListener("focusout",a,{once:!0}),r.current.observer=new MutationObserver(()=>{if(r.current.isFocused&&o.disabled){var i;(i=r.current.observer)===null||i===void 0||i.disconnect();let s=o===document.activeElement?null:document.activeElement;o.dispatchEvent(new FocusEvent("blur",{relatedTarget:s})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:s}))}}),r.current.observer.observe(o,{attributes:!0,attributeFilter:["disabled"]})}},[e])}let ph=!1,xr=null,Ga=new Set,Er=new Map,xn=!1,Ka=!1;const hh={Tab:!0,Escape:!0};function Xa(n,r){for(let e of Ga)e(n,r)}function mh(n){return!(n.metaKey||!Qa()&&n.altKey||n.ctrlKey||n.key==="Control"||n.key==="Shift"||n.key==="Meta")}function po(n){xn=!0,mh(n)&&(xr="keyboard",Xa("keyboard",n))}function lt(n){xr="pointer",(n.type==="mousedown"||n.type==="pointerdown")&&(xn=!0,Xa("pointer",n))}function Nl(n){dh(n)&&(xn=!0,xr="virtual")}function $l(n){n.target===window||n.target===document||ph||!n.isTrusted||(!xn&&!Ka&&(xr="virtual",Xa("virtual",n)),xn=!1,Ka=!1)}function Ll(){xn=!1,Ka=!0}function Ja(n){if(typeof window>"u"||typeof document>"u"||Er.get(wn(n)))return;const r=wn(n),e=nn(n);let t=r.HTMLElement.prototype.focus;r.HTMLElement.prototype.focus=function(){xn=!0,t.apply(this,arguments)},e.addEventListener("keydown",po,!0),e.addEventListener("keyup",po,!0),e.addEventListener("click",Nl,!0),r.addEventListener("focus",$l,!0),r.addEventListener("blur",Ll,!1),typeof PointerEvent<"u"?(e.addEventListener("pointerdown",lt,!0),e.addEventListener("pointermove",lt,!0),e.addEventListener("pointerup",lt,!0)):process.env.NODE_ENV==="test"&&(e.addEventListener("mousedown",lt,!0),e.addEventListener("mousemove",lt,!0),e.addEventListener("mouseup",lt,!0)),r.addEventListener("beforeunload",()=>{Fl(n)},{once:!0}),Er.set(r,{focus:t})}const Fl=(n,r)=>{const e=wn(n),t=nn(n);r&&t.removeEventListener("DOMContentLoaded",r),Er.has(e)&&(e.HTMLElement.prototype.focus=Er.get(e).focus,t.removeEventListener("keydown",po,!0),t.removeEventListener("keyup",po,!0),t.removeEventListener("click",Nl,!0),e.removeEventListener("focus",$l,!0),e.removeEventListener("blur",Ll,!1),typeof PointerEvent<"u"?(t.removeEventListener("pointerdown",lt,!0),t.removeEventListener("pointermove",lt,!0),t.removeEventListener("pointerup",lt,!0)):process.env.NODE_ENV==="test"&&(t.removeEventListener("mousedown",lt,!0),t.removeEventListener("mousemove",lt,!0),t.removeEventListener("mouseup",lt,!0)),Er.delete(e))};function vh(n){const r=nn(n);let e;return r.readyState!=="loading"?Ja(n):(e=()=>{Ja(n)},r.addEventListener("DOMContentLoaded",e)),()=>Fl(n,e)}typeof document<"u"&&vh();function Al(){return xr!=="pointer"}const gh=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function bh(n,r,e){let t=nn(e==null?void 0:e.target);const o=typeof window<"u"?wn(e==null?void 0:e.target).HTMLInputElement:HTMLInputElement,a=typeof window<"u"?wn(e==null?void 0:e.target).HTMLTextAreaElement:HTMLTextAreaElement,i=typeof window<"u"?wn(e==null?void 0:e.target).HTMLElement:HTMLElement,s=typeof window<"u"?wn(e==null?void 0:e.target).KeyboardEvent:KeyboardEvent;return n=n||t.activeElement instanceof o&&!gh.has(t.activeElement.type)||t.activeElement instanceof a||t.activeElement instanceof i&&t.activeElement.isContentEditable,!(n&&r==="keyboard"&&e instanceof s&&!hh[e.key])}function yh(n,r,e){Ja(),d.useEffect(()=>{let t=(o,a)=>{bh(!!(e!=null&&e.isTextInput),o,a)&&n(Al())};return Ga.add(t),()=>{Ga.delete(t)}},r)}function wh(n){let{isDisabled:r,onFocus:e,onBlur:t,onFocusChange:o}=n;const a=d.useCallback(l=>{if(l.target===l.currentTarget)return t&&t(l),o&&o(!1),!0},[t,o]),i=Il(a),s=d.useCallback(l=>{const u=nn(l.target),c=u?qa(u):qa();l.target===l.currentTarget&&c===Ml(l.nativeEvent)&&(e&&e(l),o&&o(!0),i(l))},[o,e,i]);return{focusProps:{onFocus:!r&&(e||o||t)?s:void 0,onBlur:!r&&(t||o)?a:void 0}}}function xh(n){let{isDisabled:r,onBlurWithin:e,onFocusWithin:t,onFocusWithinChange:o}=n,a=d.useRef({isFocusWithin:!1}),{addGlobalListener:i,removeAllGlobalListeners:s}=Tl(),l=d.useCallback(f=>{f.currentTarget.contains(f.target)&&a.current.isFocusWithin&&!f.currentTarget.contains(f.relatedTarget)&&(a.current.isFocusWithin=!1,s(),e&&e(f),o&&o(!1))},[e,o,a,s]),u=Il(l),c=d.useCallback(f=>{if(!f.currentTarget.contains(f.target))return;const h=nn(f.target),p=qa(h);if(!a.current.isFocusWithin&&p===Ml(f.nativeEvent)){t&&t(f),o&&o(!0),a.current.isFocusWithin=!0,u(f);let m=f.currentTarget;i(h,"focus",v=>{if(a.current.isFocusWithin&&!Ol(m,v.target)){let g=new h.defaultView.FocusEvent("blur",{relatedTarget:v.target});fh(g,m);let y=Pl(g);l(y)}},{capture:!0})}},[t,o,u,i,l]);return r?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:c,onBlur:l}}}let ho=!1,mo=0;function Za(){ho=!0,setTimeout(()=>{ho=!1},50)}function Rl(n){n.pointerType==="touch"&&Za()}function Eh(){if(!(typeof document>"u"))return mo===0&&(typeof PointerEvent<"u"?document.addEventListener("pointerup",Rl):process.env.NODE_ENV==="test"&&document.addEventListener("touchend",Za)),mo++,()=>{mo--,!(mo>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",Rl):process.env.NODE_ENV==="test"&&document.removeEventListener("touchend",Za))}}function ei(n){let{onHoverStart:r,onHoverChange:e,onHoverEnd:t,isDisabled:o}=n,[a,i]=d.useState(!1),s=d.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;d.useEffect(Eh,[]);let{addGlobalListener:l,removeAllGlobalListeners:u}=Tl(),{hoverProps:c,triggerHoverEnd:f}=d.useMemo(()=>{let h=(v,g)=>{if(s.pointerType=g,o||g==="touch"||s.isHovered||!v.currentTarget.contains(v.target))return;s.isHovered=!0;let y=v.currentTarget;s.target=y,l(nn(v.target),"pointerover",E=>{s.isHovered&&s.target&&!Ol(s.target,E.target)&&p(E,E.pointerType)},{capture:!0}),r&&r({type:"hoverstart",target:y,pointerType:g}),e&&e(!0),i(!0)},p=(v,g)=>{let y=s.target;s.pointerType="",s.target=null,!(g==="touch"||!s.isHovered||!y)&&(s.isHovered=!1,u(),t&&t({type:"hoverend",target:y,pointerType:g}),e&&e(!1),i(!1))},m={};return typeof PointerEvent<"u"?(m.onPointerEnter=v=>{ho&&v.pointerType==="mouse"||h(v,v.pointerType)},m.onPointerLeave=v=>{!o&&v.currentTarget.contains(v.target)&&p(v,v.pointerType)}):process.env.NODE_ENV==="test"&&(m.onTouchStart=()=>{s.ignoreEmulatedMouseEvents=!0},m.onMouseEnter=v=>{!s.ignoreEmulatedMouseEvents&&!ho&&h(v,"mouse"),s.ignoreEmulatedMouseEvents=!1},m.onMouseLeave=v=>{!o&&v.currentTarget.contains(v.target)&&p(v,"mouse")}),{hoverProps:m,triggerHoverEnd:p}},[r,e,t,o,s,l,u]);return d.useEffect(()=>{o&&f({currentTarget:s.target},s.pointerType)},[o]),{hoverProps:c,isHovered:a}}function ti(n={}){let{autoFocus:r=!1,isTextInput:e,within:t}=n,o=d.useRef({isFocused:!1,isFocusVisible:r||Al()}),[a,i]=d.useState(!1),[s,l]=d.useState(()=>o.current.isFocused&&o.current.isFocusVisible),u=d.useCallback(()=>l(o.current.isFocused&&o.current.isFocusVisible),[]),c=d.useCallback(p=>{o.current.isFocused=p,i(p),u()},[u]);yh(p=>{o.current.isFocusVisible=p,u()},[],{isTextInput:e});let{focusProps:f}=wh({isDisabled:t,onFocusChange:c}),{focusWithinProps:h}=xh({isDisabled:!t,onFocusWithinChange:c});return{isFocused:a,isFocusVisible:s,focusProps:t?h:f}}var Dh=Object.defineProperty,Sh=(n,r,e)=>r in n?Dh(n,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[r]=e,ni=(n,r,e)=>(Sh(n,typeof r!="symbol"?r+"":r,e),e);let kh=class{constructor(){ni(this,"current",this.detect()),ni(this,"handoffState","pending"),ni(this,"currentId",0)}set(r){this.current!==r&&(this.handoffState="pending",this.currentId=0,this.current=r)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},xt=new kh;function En(n){var r,e;return xt.isServer?null:n?"ownerDocument"in n?n.ownerDocument:"current"in n?(e=(r=n.current)==null?void 0:r.ownerDocument)!=null?e:document:null:document}function vo(n){typeof queueMicrotask=="function"?queueMicrotask(n):Promise.resolve().then(n).catch(r=>setTimeout(()=>{throw r}))}function ut(){let n=[],r={addEventListener(e,t,o,a){return e.addEventListener(t,o,a),r.add(()=>e.removeEventListener(t,o,a))},requestAnimationFrame(...e){let t=requestAnimationFrame(...e);return r.add(()=>cancelAnimationFrame(t))},nextFrame(...e){return r.requestAnimationFrame(()=>r.requestAnimationFrame(...e))},setTimeout(...e){let t=setTimeout(...e);return r.add(()=>clearTimeout(t))},microTask(...e){let t={current:!0};return vo(()=>{t.current&&e[0]()}),r.add(()=>{t.current=!1})},style(e,t,o){let a=e.style.getPropertyValue(t);return Object.assign(e.style,{[t]:o}),this.add(()=>{Object.assign(e.style,{[t]:a})})},group(e){let t=ut();return e(t),this.add(()=>t.dispose())},add(e){return n.includes(e)||n.push(e),()=>{let t=n.indexOf(e);if(t>=0)for(let o of n.splice(t,1))o()}},dispose(){for(let e of n.splice(0))e()}};return r}function rn(){let[n]=d.useState(ut);return d.useEffect(()=>()=>n.dispose(),[n]),n}let fe=(n,r)=>{xt.isServer?d.useEffect(n,r):d.useLayoutEffect(n,r)};function Yt(n){let r=d.useRef(n);return fe(()=>{r.current=n},[n]),r}let Z=function(n){let r=Yt(n);return d.useCallback((...e)=>r.current(...e),[r])};function Ch(n){let r=n.width/2,e=n.height/2;return{top:n.clientY-e,right:n.clientX+r,bottom:n.clientY+e,left:n.clientX-r}}function _h(n,r){return!(!n||!r||n.right<r.left||n.left>r.right||n.bottom<r.top||n.top>r.bottom)}function Yl({disabled:n=!1}={}){let r=d.useRef(null),[e,t]=d.useState(!1),o=rn(),a=Z(()=>{r.current=null,t(!1),o.dispose()}),i=Z(s=>{if(o.dispose(),r.current===null){r.current=s.currentTarget,t(!0);{let l=En(s.currentTarget);o.addEventListener(l,"pointerup",a,!1),o.addEventListener(l,"pointermove",u=>{if(r.current){let c=Ch(u);t(_h(c,r.current.getBoundingClientRect()))}},!1),o.addEventListener(l,"pointercancel",a,!1)}}});return{pressed:e,pressProps:n?{}:{onPointerDown:i,onPointerUp:a,onClick:a}}}let Oh=d.createContext(void 0);function go(){return d.useContext(Oh)}function ri(...n){return Array.from(new Set(n.flatMap(r=>typeof r=="string"?r.split(" "):[]))).filter(Boolean).join(" ")}function Fe(n,r,...e){if(n in r){let o=r[n];return typeof o=="function"?o(...e):o}let t=new Error(`Tried to handle "${n}" but there is no handler defined. Only defined handlers are: ${Object.keys(r).map(o=>`"${o}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Fe),t}var on=(n=>(n[n.None=0]="None",n[n.RenderStrategy=1]="RenderStrategy",n[n.Static=2]="Static",n))(on||{}),an=(n=>(n[n.Unmount=0]="Unmount",n[n.Hidden=1]="Hidden",n))(an||{});function Te(){let n=Th();return d.useCallback(r=>Mh({mergeRefs:n,...r}),[n])}function Mh({ourProps:n,theirProps:r,slot:e,defaultTag:t,features:o,visible:a=!0,name:i,mergeRefs:s}){s=s??Ph;let l=Wl(r,n);if(a)return bo(l,e,t,i,s);let u=o??0;if(u&2){let{static:c=!1,...f}=l;if(c)return bo(f,e,t,i,s)}if(u&1){let{unmount:c=!0,...f}=l;return Fe(c?0:1,{0(){return null},1(){return bo({...f,hidden:!0,style:{display:"none"}},e,t,i,s)}})}return bo(l,e,t,i,s)}function bo(n,r={},e,t,o){let{as:a=e,children:i,refName:s="ref",...l}=oi(n,["unmount","static"]),u=n.ref!==void 0?{[s]:n.ref}:{},c=typeof i=="function"?i(r):i;"className"in l&&l.className&&typeof l.className=="function"&&(l.className=l.className(r)),l["aria-labelledby"]&&l["aria-labelledby"]===l.id&&(l["aria-labelledby"]=void 0);let f={};if(r){let h=!1,p=[];for(let[m,v]of Object.entries(r))typeof v=="boolean"&&(h=!0),v===!0&&p.push(m.replace(/([A-Z])/g,g=>`-${g.toLowerCase()}`));if(h){f["data-headlessui-state"]=p.join(" ");for(let m of p)f[`data-${m}`]=""}}if(a===d.Fragment&&(Object.keys(sn(l)).length>0||Object.keys(sn(f)).length>0))if(!d.isValidElement(c)||Array.isArray(c)&&c.length>1){if(Object.keys(sn(l)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${t} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(sn(l)).concat(Object.keys(sn(f))).map(h=>` - ${h}`).join(`
53
+ We are expecting a valid React Element`));var sr,ba=!0;return ga===K&&(ba=!1,$&&(sr=b.setActiveSlide,en.overflowY="hidden")),u.createElement("div",{ref:sr,style:en,className:G,"aria-hidden":ba,"data-swipeable":"true"},Zr)}))))}}]),M}(u.Component);N.displayName="ReactSwipableView",N.propTypes=process.env.NODE_ENV!=="production"?{action:c.default.func,animateHeight:c.default.bool,animateTransitions:c.default.bool,axis:c.default.oneOf(["x","x-reverse","y","y-reverse"]),children:c.default.node.isRequired,containerStyle:c.default.object,disabled:c.default.bool,disableLazyLoading:c.default.bool,enableMouseEvents:c.default.bool,hysteresis:c.default.number,ignoreNativeScroll:c.default.bool,index:c.default.number,onChangeIndex:c.default.func,onMouseDown:c.default.func,onMouseLeave:c.default.func,onMouseMove:c.default.func,onMouseUp:c.default.func,onScroll:c.default.func,onSwitching:c.default.func,onTouchEnd:c.default.func,onTouchMove:c.default.func,onTouchStart:c.default.func,onTransitionEnd:c.default.func,resistance:c.default.bool,slideClassName:c.default.string,slideStyle:c.default.object,springConfig:c.default.shape({delay:c.default.string,duration:c.default.string,easeFunction:c.default.string}),style:c.default.object,threshold:c.default.number}:{},N.defaultProps={animateHeight:!1,animateTransitions:!0,axis:"x",disabled:!1,disableLazyLoading:!1,enableMouseEvents:!1,hysteresis:.6,ignoreNativeScroll:!1,index:0,threshold:5,springConfig:{duration:"0.35s",easeFunction:"cubic-bezier(0.15, 0.3, 0.25, 1)",delay:"0s"},resistance:!1};var _=N;return At.default=_,At}var Cl;function Gp(){return Cl||(Cl=1,function(n){var r=zs();Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(n,"SwipeableViewsContext",{enumerable:!0,get:function(){return e.SwipeableViewsContext}});var e=r(Qp())}(ka)),ka}var Kp=Gp();const Xp=jf(Kp),Jp=({className:n,tabList:r,isCuratedcontent:e,unswipeableContent:t,defaultIndex:o=0,onTabChange:a,disabled:i,allowScrollToSection:s=!0})=>{const[l,u]=d.useState(o),c=d.useRef(null),f=m=>{m.current&&window.scrollTo({top:m.current.offsetTop-50,behavior:"smooth"})},h=m=>{u(m),s&&f(c),a==null||a(m)},p=()=>{const v=100/r.length;return{width:`${v}%`,left:`${l*v}%`}};return R.jsxs("div",{ref:c,className:"w-full",children:[R.jsxs("div",{className:ot(n==null?void 0:n.tab,`z-50 mb-[20px] flex w-full flex-col bg-white ${e&&"sticky top-[50px]"}`),children:[R.jsx("div",{className:"flex",children:r.map((m,v)=>R.jsx("div",{className:"flex flex-1 flex-col",children:R.jsx("button",{className:ot(n==null?void 0:n.tabTitle,`cursor-pointer ${l===v?"text-petnow-grey-30 text-label-large":"text-petnow-grey-70 text-body-large disabled:opacity-40"}`),onClick:()=>h(v),disabled:i,children:m.displayName})},m.key))}),R.jsx("div",{className:ot(n==null?void 0:n.underline,`relative h-[2px] w-full ${i?"bg-petnow-grey-70/40":"bg-petnow-grey-70"}`),children:R.jsx("div",{className:ot(n==null?void 0:n.selectedUnderline,"bg-petnow-grey-30 absolute h-[2px] transition-all duration-200"),style:p()})})]}),t,R.jsx(Xp,{index:l,onChangeIndex:m=>{u(m),a==null||a(m)},disabled:i,children:r.map(m=>R.jsx("div",{children:m.content},m.key))})]})},Zp=({className:n,id:r,onChange:e,disabled:t,isChecked:o})=>R.jsxs("label",{className:"relative flex h-min w-min cursor-pointer items-center rounded-full",htmlFor:r,children:[R.jsx("input",{type:"checkbox",disabled:t,className:ot(n,"before:content[''] peer bg-petnow-grey-primary checked:border-petnow-orange-primary checked:bg-petnow-orange-primary checked:before:bg-petnow-orange-primary border-petnow-grey-primary relative size-6 cursor-pointer appearance-none rounded-xl border transition-all before:absolute before:top-2/4 before:left-2/4 before:block before:h-6 before:w-6 before:-translate-x-2/4 before:-translate-y-2/4 before:rounded-full before:opacity-0 before:transition-opacity"),id:r,checked:o,onChange:a=>{e(a.target.checked)}}),R.jsx("span",{className:"text-petnow-grey-secondary pointer-events-none absolute top-2/4 left-2/4 -translate-x-2/4 -translate-y-2/4 transition peer-checked:text-white",children:R.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",stroke:"currentColor",strokeWidth:"1",children:R.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})})]}),eh=({className:n,text:r,isSelected:e,onClick:t,disabled:o})=>R.jsx("button",{className:ot(n,`keen-slider__slide text-body-medium rounded-full border-1 px-[12px] py-[6px] whitespace-nowrap duration-200 active:brightness-90 ${e?"border-petnow-orange-primary bg-petnow-orange-secondary text-petnow-orange-primary":"border-petnow-grey-90 bg-white disabled:opacity-40"}`),onClick:t,style:{width:"min-content",minWidth:"fit-content"},disabled:o,children:r}),_l=typeof document<"u"?d.useLayoutEffect:()=>{};var Va;const th=(Va=d.useInsertionEffect)!==null&&Va!==void 0?Va:_l;function nh(n){const r=d.useRef(null);return th(()=>{r.current=n},[n]),d.useCallback((...e)=>{const t=r.current;return t==null?void 0:t(...e)},[])}const nn=n=>{var r;return(r=n==null?void 0:n.ownerDocument)!==null&&r!==void 0?r:document},wn=n=>n&&"window"in n&&n.window===n?n:nn(n).defaultView||window;function rh(n){return n!==null&&typeof n=="object"&&"nodeType"in n&&typeof n.nodeType=="number"}function oh(n){return rh(n)&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in n}let ah=!1;function za(){return ah}function Ol(n,r){if(!za())return r&&n?n.contains(r):!1;if(!n||!r)return!1;let e=r;for(;e!==null;){if(e===n)return!0;e.tagName==="SLOT"&&e.assignedSlot?e=e.assignedSlot.parentNode:oh(e)?e=e.host:e=e.parentNode}return!1}const qa=(n=document)=>{var r;if(!za())return n.activeElement;let e=n.activeElement;for(;e&&"shadowRoot"in e&&(!((r=e.shadowRoot)===null||r===void 0)&&r.activeElement);)e=e.shadowRoot.activeElement;return e};function Ml(n){return za()&&n.target.shadowRoot&&n.composedPath?n.composedPath()[0]:n.target}function fo(n){var r;if(typeof window>"u"||window.navigator==null)return!1;let e=(r=window.navigator.userAgentData)===null||r===void 0?void 0:r.brands;return Array.isArray(e)&&e.some(t=>n.test(t.brand))||n.test(window.navigator.userAgent)}function Ua(n){var r;return typeof window<"u"&&window.navigator!=null?n.test(((r=window.navigator.userAgentData)===null||r===void 0?void 0:r.platform)||window.navigator.platform):!1}function Rt(n){if(process.env.NODE_ENV==="test")return n;let r=null;return()=>(r==null&&(r=n()),r)}const Qa=Rt(function(){return Ua(/^Mac/i)}),ih=Rt(function(){return Ua(/^iPhone/i)}),sh=Rt(function(){return Ua(/^iPad/i)||Qa()&&navigator.maxTouchPoints>1}),lh=Rt(function(){return ih()||sh()});Rt(function(){return Qa()||lh()}),Rt(function(){return fo(/AppleWebKit/i)&&!uh()});const uh=Rt(function(){return fo(/Chrome/i)}),ch=Rt(function(){return fo(/Android/i)});Rt(function(){return fo(/Firefox/i)});function Tl(){let n=d.useRef(new Map),r=d.useCallback((o,a,i,s)=>{let l=s!=null&&s.once?(...u)=>{n.current.delete(i),i(...u)}:i;n.current.set(i,{type:a,eventTarget:o,fn:l,options:s}),o.addEventListener(a,l,s)},[]),e=d.useCallback((o,a,i,s)=>{var l;let u=((l=n.current.get(i))===null||l===void 0?void 0:l.fn)||i;o.removeEventListener(a,u,s),n.current.delete(i)},[]),t=d.useCallback(()=>{n.current.forEach((o,a)=>{e(o.eventTarget,o.type,a,o.options)})},[e]);return d.useEffect(()=>t,[t]),{addGlobalListener:r,removeGlobalListener:e,removeAllGlobalListeners:t}}function dh(n){return n.mozInputSource===0&&n.isTrusted?!0:ch()&&n.pointerType?n.type==="click"&&n.buttons===1:n.detail===0&&!n.pointerType}function Pl(n){let r=n;return r.nativeEvent=n,r.isDefaultPrevented=()=>r.defaultPrevented,r.isPropagationStopped=()=>r.cancelBubble,r.persist=()=>{},r}function fh(n,r){Object.defineProperty(n,"target",{value:r}),Object.defineProperty(n,"currentTarget",{value:r})}function Il(n){let r=d.useRef({isFocused:!1,observer:null});_l(()=>{const t=r.current;return()=>{t.observer&&(t.observer.disconnect(),t.observer=null)}},[]);let e=nh(t=>{n==null||n(t)});return d.useCallback(t=>{if(t.target instanceof HTMLButtonElement||t.target instanceof HTMLInputElement||t.target instanceof HTMLTextAreaElement||t.target instanceof HTMLSelectElement){r.current.isFocused=!0;let o=t.target,a=i=>{if(r.current.isFocused=!1,o.disabled){let s=Pl(i);e(s)}r.current.observer&&(r.current.observer.disconnect(),r.current.observer=null)};o.addEventListener("focusout",a,{once:!0}),r.current.observer=new MutationObserver(()=>{if(r.current.isFocused&&o.disabled){var i;(i=r.current.observer)===null||i===void 0||i.disconnect();let s=o===document.activeElement?null:document.activeElement;o.dispatchEvent(new FocusEvent("blur",{relatedTarget:s})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:s}))}}),r.current.observer.observe(o,{attributes:!0,attributeFilter:["disabled"]})}},[e])}let ph=!1,xr=null,Ga=new Set,Er=new Map,xn=!1,Ka=!1;const hh={Tab:!0,Escape:!0};function Xa(n,r){for(let e of Ga)e(n,r)}function mh(n){return!(n.metaKey||!Qa()&&n.altKey||n.ctrlKey||n.key==="Control"||n.key==="Shift"||n.key==="Meta")}function po(n){xn=!0,mh(n)&&(xr="keyboard",Xa("keyboard",n))}function lt(n){xr="pointer",(n.type==="mousedown"||n.type==="pointerdown")&&(xn=!0,Xa("pointer",n))}function Nl(n){dh(n)&&(xn=!0,xr="virtual")}function $l(n){n.target===window||n.target===document||ph||!n.isTrusted||(!xn&&!Ka&&(xr="virtual",Xa("virtual",n)),xn=!1,Ka=!1)}function Ll(){xn=!1,Ka=!0}function Ja(n){if(typeof window>"u"||typeof document>"u"||Er.get(wn(n)))return;const r=wn(n),e=nn(n);let t=r.HTMLElement.prototype.focus;r.HTMLElement.prototype.focus=function(){xn=!0,t.apply(this,arguments)},e.addEventListener("keydown",po,!0),e.addEventListener("keyup",po,!0),e.addEventListener("click",Nl,!0),r.addEventListener("focus",$l,!0),r.addEventListener("blur",Ll,!1),typeof PointerEvent<"u"?(e.addEventListener("pointerdown",lt,!0),e.addEventListener("pointermove",lt,!0),e.addEventListener("pointerup",lt,!0)):process.env.NODE_ENV==="test"&&(e.addEventListener("mousedown",lt,!0),e.addEventListener("mousemove",lt,!0),e.addEventListener("mouseup",lt,!0)),r.addEventListener("beforeunload",()=>{Fl(n)},{once:!0}),Er.set(r,{focus:t})}const Fl=(n,r)=>{const e=wn(n),t=nn(n);r&&t.removeEventListener("DOMContentLoaded",r),Er.has(e)&&(e.HTMLElement.prototype.focus=Er.get(e).focus,t.removeEventListener("keydown",po,!0),t.removeEventListener("keyup",po,!0),t.removeEventListener("click",Nl,!0),e.removeEventListener("focus",$l,!0),e.removeEventListener("blur",Ll,!1),typeof PointerEvent<"u"?(t.removeEventListener("pointerdown",lt,!0),t.removeEventListener("pointermove",lt,!0),t.removeEventListener("pointerup",lt,!0)):process.env.NODE_ENV==="test"&&(t.removeEventListener("mousedown",lt,!0),t.removeEventListener("mousemove",lt,!0),t.removeEventListener("mouseup",lt,!0)),Er.delete(e))};function vh(n){const r=nn(n);let e;return r.readyState!=="loading"?Ja(n):(e=()=>{Ja(n)},r.addEventListener("DOMContentLoaded",e)),()=>Fl(n,e)}typeof document<"u"&&vh();function Al(){return xr!=="pointer"}const gh=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function bh(n,r,e){let t=nn(e==null?void 0:e.target);const o=typeof window<"u"?wn(e==null?void 0:e.target).HTMLInputElement:HTMLInputElement,a=typeof window<"u"?wn(e==null?void 0:e.target).HTMLTextAreaElement:HTMLTextAreaElement,i=typeof window<"u"?wn(e==null?void 0:e.target).HTMLElement:HTMLElement,s=typeof window<"u"?wn(e==null?void 0:e.target).KeyboardEvent:KeyboardEvent;return n=n||t.activeElement instanceof o&&!gh.has(t.activeElement.type)||t.activeElement instanceof a||t.activeElement instanceof i&&t.activeElement.isContentEditable,!(n&&r==="keyboard"&&e instanceof s&&!hh[e.key])}function yh(n,r,e){Ja(),d.useEffect(()=>{let t=(o,a)=>{bh(!!(e!=null&&e.isTextInput),o,a)&&n(Al())};return Ga.add(t),()=>{Ga.delete(t)}},r)}function wh(n){let{isDisabled:r,onFocus:e,onBlur:t,onFocusChange:o}=n;const a=d.useCallback(l=>{if(l.target===l.currentTarget)return t&&t(l),o&&o(!1),!0},[t,o]),i=Il(a),s=d.useCallback(l=>{const u=nn(l.target),c=u?qa(u):qa();l.target===l.currentTarget&&c===Ml(l.nativeEvent)&&(e&&e(l),o&&o(!0),i(l))},[o,e,i]);return{focusProps:{onFocus:!r&&(e||o||t)?s:void 0,onBlur:!r&&(t||o)?a:void 0}}}function xh(n){let{isDisabled:r,onBlurWithin:e,onFocusWithin:t,onFocusWithinChange:o}=n,a=d.useRef({isFocusWithin:!1}),{addGlobalListener:i,removeAllGlobalListeners:s}=Tl(),l=d.useCallback(f=>{f.currentTarget.contains(f.target)&&a.current.isFocusWithin&&!f.currentTarget.contains(f.relatedTarget)&&(a.current.isFocusWithin=!1,s(),e&&e(f),o&&o(!1))},[e,o,a,s]),u=Il(l),c=d.useCallback(f=>{if(!f.currentTarget.contains(f.target))return;const h=nn(f.target),p=qa(h);if(!a.current.isFocusWithin&&p===Ml(f.nativeEvent)){t&&t(f),o&&o(!0),a.current.isFocusWithin=!0,u(f);let m=f.currentTarget;i(h,"focus",v=>{if(a.current.isFocusWithin&&!Ol(m,v.target)){let g=new h.defaultView.FocusEvent("blur",{relatedTarget:v.target});fh(g,m);let y=Pl(g);l(y)}},{capture:!0})}},[t,o,u,i,l]);return r?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:c,onBlur:l}}}let ho=!1,mo=0;function Za(){ho=!0,setTimeout(()=>{ho=!1},50)}function Rl(n){n.pointerType==="touch"&&Za()}function Eh(){if(!(typeof document>"u"))return mo===0&&(typeof PointerEvent<"u"?document.addEventListener("pointerup",Rl):process.env.NODE_ENV==="test"&&document.addEventListener("touchend",Za)),mo++,()=>{mo--,!(mo>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",Rl):process.env.NODE_ENV==="test"&&document.removeEventListener("touchend",Za))}}function ei(n){let{onHoverStart:r,onHoverChange:e,onHoverEnd:t,isDisabled:o}=n,[a,i]=d.useState(!1),s=d.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;d.useEffect(Eh,[]);let{addGlobalListener:l,removeAllGlobalListeners:u}=Tl(),{hoverProps:c,triggerHoverEnd:f}=d.useMemo(()=>{let h=(v,g)=>{if(s.pointerType=g,o||g==="touch"||s.isHovered||!v.currentTarget.contains(v.target))return;s.isHovered=!0;let y=v.currentTarget;s.target=y,l(nn(v.target),"pointerover",E=>{s.isHovered&&s.target&&!Ol(s.target,E.target)&&p(E,E.pointerType)},{capture:!0}),r&&r({type:"hoverstart",target:y,pointerType:g}),e&&e(!0),i(!0)},p=(v,g)=>{let y=s.target;s.pointerType="",s.target=null,!(g==="touch"||!s.isHovered||!y)&&(s.isHovered=!1,u(),t&&t({type:"hoverend",target:y,pointerType:g}),e&&e(!1),i(!1))},m={};return typeof PointerEvent<"u"?(m.onPointerEnter=v=>{ho&&v.pointerType==="mouse"||h(v,v.pointerType)},m.onPointerLeave=v=>{!o&&v.currentTarget.contains(v.target)&&p(v,v.pointerType)}):process.env.NODE_ENV==="test"&&(m.onTouchStart=()=>{s.ignoreEmulatedMouseEvents=!0},m.onMouseEnter=v=>{!s.ignoreEmulatedMouseEvents&&!ho&&h(v,"mouse"),s.ignoreEmulatedMouseEvents=!1},m.onMouseLeave=v=>{!o&&v.currentTarget.contains(v.target)&&p(v,"mouse")}),{hoverProps:m,triggerHoverEnd:p}},[r,e,t,o,s,l,u]);return d.useEffect(()=>{o&&f({currentTarget:s.target},s.pointerType)},[o]),{hoverProps:c,isHovered:a}}function ti(n={}){let{autoFocus:r=!1,isTextInput:e,within:t}=n,o=d.useRef({isFocused:!1,isFocusVisible:r||Al()}),[a,i]=d.useState(!1),[s,l]=d.useState(()=>o.current.isFocused&&o.current.isFocusVisible),u=d.useCallback(()=>l(o.current.isFocused&&o.current.isFocusVisible),[]),c=d.useCallback(p=>{o.current.isFocused=p,i(p),u()},[u]);yh(p=>{o.current.isFocusVisible=p,u()},[],{isTextInput:e});let{focusProps:f}=wh({isDisabled:t,onFocusChange:c}),{focusWithinProps:h}=xh({isDisabled:!t,onFocusWithinChange:c});return{isFocused:a,isFocusVisible:s,focusProps:t?h:f}}var Dh=Object.defineProperty,Sh=(n,r,e)=>r in n?Dh(n,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[r]=e,ni=(n,r,e)=>(Sh(n,typeof r!="symbol"?r+"":r,e),e);let kh=class{constructor(){ni(this,"current",this.detect()),ni(this,"handoffState","pending"),ni(this,"currentId",0)}set(r){this.current!==r&&(this.handoffState="pending",this.currentId=0,this.current=r)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},xt=new kh;function En(n){var r,e;return xt.isServer?null:n?"ownerDocument"in n?n.ownerDocument:"current"in n?(e=(r=n.current)==null?void 0:r.ownerDocument)!=null?e:document:null:document}function vo(n){typeof queueMicrotask=="function"?queueMicrotask(n):Promise.resolve().then(n).catch(r=>setTimeout(()=>{throw r}))}function ut(){let n=[],r={addEventListener(e,t,o,a){return e.addEventListener(t,o,a),r.add(()=>e.removeEventListener(t,o,a))},requestAnimationFrame(...e){let t=requestAnimationFrame(...e);return r.add(()=>cancelAnimationFrame(t))},nextFrame(...e){return r.requestAnimationFrame(()=>r.requestAnimationFrame(...e))},setTimeout(...e){let t=setTimeout(...e);return r.add(()=>clearTimeout(t))},microTask(...e){let t={current:!0};return vo(()=>{t.current&&e[0]()}),r.add(()=>{t.current=!1})},style(e,t,o){let a=e.style.getPropertyValue(t);return Object.assign(e.style,{[t]:o}),this.add(()=>{Object.assign(e.style,{[t]:a})})},group(e){let t=ut();return e(t),this.add(()=>t.dispose())},add(e){return n.includes(e)||n.push(e),()=>{let t=n.indexOf(e);if(t>=0)for(let o of n.splice(t,1))o()}},dispose(){for(let e of n.splice(0))e()}};return r}function rn(){let[n]=d.useState(ut);return d.useEffect(()=>()=>n.dispose(),[n]),n}let fe=(n,r)=>{xt.isServer?d.useEffect(n,r):d.useLayoutEffect(n,r)};function Yt(n){let r=d.useRef(n);return fe(()=>{r.current=n},[n]),r}let Z=function(n){let r=Yt(n);return d.useCallback((...e)=>r.current(...e),[r])};function Ch(n){let r=n.width/2,e=n.height/2;return{top:n.clientY-e,right:n.clientX+r,bottom:n.clientY+e,left:n.clientX-r}}function _h(n,r){return!(!n||!r||n.right<r.left||n.left>r.right||n.bottom<r.top||n.top>r.bottom)}function Yl({disabled:n=!1}={}){let r=d.useRef(null),[e,t]=d.useState(!1),o=rn(),a=Z(()=>{r.current=null,t(!1),o.dispose()}),i=Z(s=>{if(o.dispose(),r.current===null){r.current=s.currentTarget,t(!0);{let l=En(s.currentTarget);o.addEventListener(l,"pointerup",a,!1),o.addEventListener(l,"pointermove",u=>{if(r.current){let c=Ch(u);t(_h(c,r.current.getBoundingClientRect()))}},!1),o.addEventListener(l,"pointercancel",a,!1)}}});return{pressed:e,pressProps:n?{}:{onPointerDown:i,onPointerUp:a,onClick:a}}}let Oh=d.createContext(void 0);function go(){return d.useContext(Oh)}function ri(...n){return Array.from(new Set(n.flatMap(r=>typeof r=="string"?r.split(" "):[]))).filter(Boolean).join(" ")}function Fe(n,r,...e){if(n in r){let o=r[n];return typeof o=="function"?o(...e):o}let t=new Error(`Tried to handle "${n}" but there is no handler defined. Only defined handlers are: ${Object.keys(r).map(o=>`"${o}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Fe),t}var on=(n=>(n[n.None=0]="None",n[n.RenderStrategy=1]="RenderStrategy",n[n.Static=2]="Static",n))(on||{}),an=(n=>(n[n.Unmount=0]="Unmount",n[n.Hidden=1]="Hidden",n))(an||{});function Te(){let n=Th();return d.useCallback(r=>Mh({mergeRefs:n,...r}),[n])}function Mh({ourProps:n,theirProps:r,slot:e,defaultTag:t,features:o,visible:a=!0,name:i,mergeRefs:s}){s=s??Ph;let l=Wl(r,n);if(a)return bo(l,e,t,i,s);let u=o??0;if(u&2){let{static:c=!1,...f}=l;if(c)return bo(f,e,t,i,s)}if(u&1){let{unmount:c=!0,...f}=l;return Fe(c?0:1,{0(){return null},1(){return bo({...f,hidden:!0,style:{display:"none"}},e,t,i,s)}})}return bo(l,e,t,i,s)}function bo(n,r={},e,t,o){let{as:a=e,children:i,refName:s="ref",...l}=oi(n,["unmount","static"]),u=n.ref!==void 0?{[s]:n.ref}:{},c=typeof i=="function"?i(r):i;"className"in l&&l.className&&typeof l.className=="function"&&(l.className=l.className(r)),l["aria-labelledby"]&&l["aria-labelledby"]===l.id&&(l["aria-labelledby"]=void 0);let f={};if(r){let h=!1,p=[];for(let[m,v]of Object.entries(r))typeof v=="boolean"&&(h=!0),v===!0&&p.push(m.replace(/([A-Z])/g,g=>`-${g.toLowerCase()}`));if(h){f["data-headlessui-state"]=p.join(" ");for(let m of p)f[`data-${m}`]=""}}if(a===d.Fragment&&(Object.keys(sn(l)).length>0||Object.keys(sn(f)).length>0))if(!d.isValidElement(c)||Array.isArray(c)&&c.length>1){if(Object.keys(sn(l)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${t} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(sn(l)).concat(Object.keys(sn(f))).map(h=>` - ${h}`).join(`
54
54
  `),"","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(h=>` - ${h}`).join(`
55
55
  `)].join(`
56
56
  `))}else{let h=c.props,p=h==null?void 0:h.className,m=typeof p=="function"?(...y)=>ri(p(...y),l.className):ri(p,l.className),v=m?{className:m}:{},g=Wl(c.props,sn(oi(l,["ref"])));for(let y in f)y in g&&delete f[y];return d.cloneElement(c,Object.assign({},g,f,u,{ref:o(Ih(c),u.ref)},v))}return d.createElement(a,Object.assign({},oi(l,["ref"]),a!==d.Fragment&&u,a!==d.Fragment&&f),c)}function Th(){let n=d.useRef([]),r=d.useCallback(e=>{for(let t of n.current)t!=null&&(typeof t=="function"?t(e):t.current=e)},[]);return(...e)=>{if(!e.every(t=>t==null))return n.current=e,r}}function Ph(...n){return n.every(r=>r==null)?void 0:r=>{for(let e of n)e!=null&&(typeof e=="function"?e(r):e.current=r)}}function Wl(...n){if(n.length===0)return{};if(n.length===1)return n[0];let r={},e={};for(let t of n)for(let o in t)o.startsWith("on")&&typeof t[o]=="function"?(e[o]!=null||(e[o]=[]),e[o].push(t[o])):r[o]=t[o];if(r.disabled||r["aria-disabled"])for(let t in e)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(t)&&(e[t]=[o=>{var a;return(a=o==null?void 0:o.preventDefault)==null?void 0:a.call(o)}]);for(let t in e)Object.assign(r,{[t](o,...a){let i=e[t];for(let s of i){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;s(o,...a)}}});return r}function Dr(...n){if(n.length===0)return{};if(n.length===1)return n[0];let r={},e={};for(let t of n)for(let o in t)o.startsWith("on")&&typeof t[o]=="function"?(e[o]!=null||(e[o]=[]),e[o].push(t[o])):r[o]=t[o];for(let t in e)Object.assign(r,{[t](...o){let a=e[t];for(let i of a)i==null||i(...o)}});return r}function _e(n){var r;return Object.assign(d.forwardRef(n),{displayName:(r=n.displayName)!=null?r:n.name})}function sn(n){let r=Object.assign({},n);for(let e in r)r[e]===void 0&&delete r[e];return r}function oi(n,r=[]){let e=Object.assign({},n);for(let t of r)t in e&&delete e[t];return e}function Ih(n){return d.version.split(".")[0]>="19"?n.props.ref:n.ref}function jl(n,r,e){let[t,o]=d.useState(e),a=n!==void 0,i=d.useRef(a),s=d.useRef(!1),l=d.useRef(!1);return a&&!i.current&&!s.current?(s.current=!0,i.current=a,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!a&&i.current&&!l.current&&(l.current=!0,i.current=a,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[a?n:t,Z(u=>(a||o(u),r==null?void 0:r(u)))]}function Hl(n){let[r]=d.useState(n);return r}function Bl(n={},r=null,e=[]){for(let[t,o]of Object.entries(n))zl(e,Vl(r,t),o);return e}function Vl(n,r){return n?n+"["+r+"]":r}function zl(n,r,e){if(Array.isArray(e))for(let[t,o]of e.entries())zl(n,Vl(r,t.toString()),o);else e instanceof Date?n.push([r,e.toISOString()]):typeof e=="boolean"?n.push([r,e?"1":"0"]):typeof e=="string"?n.push([r,e]):typeof e=="number"?n.push([r,`${e}`]):e==null?n.push([r,""]):Bl(e,r,n)}function Nh(n){var r,e;let t=(r=n==null?void 0:n.form)!=null?r:n.closest("form");if(t){for(let o of t.elements)if(o!==n&&(o.tagName==="INPUT"&&o.type==="submit"||o.tagName==="BUTTON"&&o.type==="submit"||o.nodeName==="INPUT"&&o.type==="image")){o.click();return}(e=t.requestSubmit)==null||e.call(t)}}let $h="span";var jn=(n=>(n[n.None=1]="None",n[n.Focusable=2]="Focusable",n[n.Hidden=4]="Hidden",n))(jn||{});function Lh(n,r){var e;let{features:t=1,...o}=n,a={ref:r,"aria-hidden":(t&2)===2?!0:(e=o["aria-hidden"])!=null?e:void 0,hidden:(t&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(t&4)===4&&(t&2)!==2&&{display:"none"}}};return Te()({ourProps:a,theirProps:o,slot:{},defaultTag:$h,name:"Hidden"})}let Sr=_e(Lh),Fh=d.createContext(null);function Ah({children:n}){let r=d.useContext(Fh);if(!r)return d.createElement(d.Fragment,null,n);let{target:e}=r;return e?Le.createPortal(d.createElement(d.Fragment,null,n),e):null}function ql({data:n,form:r,disabled:e,onReset:t,overrides:o}){let[a,i]=d.useState(null),s=rn();return d.useEffect(()=>{if(t&&a)return s.addEventListener(a,"reset",t)},[a,r,t]),d.createElement(Ah,null,d.createElement(Rh,{setForm:i,formId:r}),Bl(n).map(([l,u])=>d.createElement(Sr,{features:jn.Hidden,...sn({key:l,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:r,disabled:e,name:l,value:u,...o})})))}function Rh({setForm:n,formId:r}){return d.useEffect(()=>{if(r){let e=document.getElementById(r);e&&n(e)}},[n,r]),r?null:d.createElement(Sr,{features:jn.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:e=>{if(!e)return;let t=e.closest("form");t&&n(t)}})}let Yh=d.createContext(void 0);function ai(){return d.useContext(Yh)}function ii(n){return typeof n!="object"||n===null?!1:"nodeType"in n}function Wt(n){return ii(n)&&"tagName"in n}function tt(n){return Wt(n)&&"accessKey"in n}function jt(n){return Wt(n)&&"tabIndex"in n}function Wh(n){return Wt(n)&&"style"in n}function jh(n){return tt(n)&&n.nodeName==="IFRAME"}function yo(n){return tt(n)&&n.nodeName==="INPUT"}function Ul(n){return tt(n)&&n.nodeName==="LABEL"}function Hh(n){return tt(n)&&n.nodeName==="FIELDSET"}function Ql(n){return tt(n)&&n.nodeName==="LEGEND"}function Bh(n){return Wt(n)?n.matches('a[href],audio[controls],button,details,embed,iframe,img[usemap],input:not([type="hidden"]),label,select,textarea,video[controls]'):!1}function Gl(n){let r=n.parentElement,e=null;for(;r&&!Hh(r);)Ql(r)&&(e=r),r=r.parentElement;let t=(r==null?void 0:r.getAttribute("disabled"))==="";return t&&Vh(e)?!1:t}function Vh(n){if(!n)return!1;let r=n.previousElementSibling;for(;r!==null;){if(Ql(r))return!1;r=r.previousElementSibling}return!0}let Kl=Symbol();function zh(n,r=!0){return Object.assign(n,{[Kl]:r})}function We(...n){let r=d.useRef(n);d.useEffect(()=>{r.current=n},[n]);let e=Z(t=>{for(let o of r.current)o!=null&&(typeof o=="function"?o(t):o.current=t)});return n.every(t=>t==null||(t==null?void 0:t[Kl]))?void 0:e}let wo=d.createContext(null);wo.displayName="DescriptionContext";function Xl(){let n=d.useContext(wo);if(n===null){let r=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(r,Xl),r}return n}function Jl(){var n,r;return(r=(n=d.useContext(wo))==null?void 0:n.value)!=null?r:void 0}function qh(){let[n,r]=d.useState([]);return[n.length>0?n.join(" "):void 0,d.useMemo(()=>function(e){let t=Z(a=>(r(i=>[...i,a]),()=>r(i=>{let s=i.slice(),l=s.indexOf(a);return l!==-1&&s.splice(l,1),s}))),o=d.useMemo(()=>({register:t,slot:e.slot,name:e.name,props:e.props,value:e.value}),[t,e.slot,e.name,e.props,e.value]);return d.createElement(wo.Provider,{value:o},e.children)},[r])]}let Uh="p";function Qh(n,r){let e=d.useId(),t=go(),{id:o=`headlessui-description-${e}`,...a}=n,i=Xl(),s=We(r);fe(()=>i.register(o),[o,i.register]);let l=t||!1,u=d.useMemo(()=>({...i.slot,disabled:l}),[i.slot,l]),c={ref:s,...i.props,id:o};return Te()({ourProps:c,theirProps:a,slot:u,defaultTag:Uh,name:i.name||"Description"})}let Gh=_e(Qh),Zl=Object.assign(Gh,{});var he=(n=>(n.Space=" ",n.Enter="Enter",n.Escape="Escape",n.Backspace="Backspace",n.Delete="Delete",n.ArrowLeft="ArrowLeft",n.ArrowUp="ArrowUp",n.ArrowRight="ArrowRight",n.ArrowDown="ArrowDown",n.Home="Home",n.End="End",n.PageUp="PageUp",n.PageDown="PageDown",n.Tab="Tab",n))(he||{});let xo=d.createContext(null);xo.displayName="LabelContext";function eu(){let n=d.useContext(xo);if(n===null){let r=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(r,eu),r}return n}function kr(n){var r,e,t;let o=(e=(r=d.useContext(xo))==null?void 0:r.value)!=null?e:void 0;return((t=n==null?void 0:n.length)!=null?t:0)>0?[o,...n].filter(Boolean).join(" "):o}function tu({inherit:n=!1}={}){let r=kr(),[e,t]=d.useState([]),o=n?[r,...e].filter(Boolean):e;return[o.length>0?o.join(" "):void 0,d.useMemo(()=>function(a){let i=Z(l=>(t(u=>[...u,l]),()=>t(u=>{let c=u.slice(),f=c.indexOf(l);return f!==-1&&c.splice(f,1),c}))),s=d.useMemo(()=>({register:i,slot:a.slot,name:a.name,props:a.props,value:a.value}),[i,a.slot,a.name,a.props,a.value]);return d.createElement(xo.Provider,{value:s},a.children)},[t])]}let Kh="label";function Xh(n,r){var e;let t=d.useId(),o=eu(),a=ai(),i=go(),{id:s=`headlessui-label-${t}`,htmlFor:l=a??((e=o.props)==null?void 0:e.htmlFor),passive:u=!1,...c}=n,f=We(r);fe(()=>o.register(s),[s,o.register]);let h=Z(g=>{let y=g.currentTarget;if(!(g.target!==g.currentTarget&&Bh(g.target))&&(Ul(y)&&g.preventDefault(),o.props&&"onClick"in o.props&&typeof o.props.onClick=="function"&&o.props.onClick(g),Ul(y))){let E=document.getElementById(y.htmlFor);if(E){let w=E.getAttribute("disabled");if(w==="true"||w==="")return;let S=E.getAttribute("aria-disabled");if(S==="true"||S==="")return;(yo(E)&&(E.type==="file"||E.type==="radio"||E.type==="checkbox")||E.role==="radio"||E.role==="checkbox"||E.role==="switch")&&E.click(),E.focus({preventScroll:!0})}}}),p=i||!1,m=d.useMemo(()=>({...o.slot,disabled:p}),[o.slot,p]),v={ref:f,...o.props,id:s,htmlFor:l,onClick:h};return u&&("onClick"in v&&(delete v.htmlFor,delete v.onClick),"onClick"in c&&delete c.onClick),Te()({ourProps:v,theirProps:c,slot:m,defaultTag:l?Kh:"div",name:o.name||"Label"})}let Jh=_e(Xh),Eo=Object.assign(Jh,{}),Zh=d.createContext(()=>{});function em({value:n,children:r}){return d.createElement(Zh.Provider,{value:n},r)}function Hn(n,r,e){let t=e.initialDeps??[],o;function a(){var i,s,l,u;let c;e.key&&((i=e.debug)!=null&&i.call(e))&&(c=Date.now());const f=n();if(!(f.length!==t.length||f.some((m,v)=>t[v]!==m)))return o;t=f;let p;if(e.key&&((s=e.debug)!=null&&s.call(e))&&(p=Date.now()),o=r(...f),e.key&&((l=e.debug)!=null&&l.call(e))){const m=Math.round((Date.now()-c)*100)/100,v=Math.round((Date.now()-p)*100)/100,g=v/16,y=(E,w)=>{for(E=String(E);E.length<w;)E=" "+E;return E};console.info(`%c⏱ ${y(v,5)} /${y(m,5)} ms`,`
@@ -73,7 +73,7 @@ So animateHeight is most likely having no effect at all.`);var en=(0,e.default)(
73
73
  * This source code is licensed under the MIT license found in the
74
74
  * LICENSE file in the root directory of this source tree.
75
75
  */var vu;function Dm(){return vu||(vu=1,process.env.NODE_ENV!=="production"&&function(){function n(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var r=d,e=typeof Object.is=="function"?Object.is:n,t=r.useSyncExternalStore,o=r.useRef,a=r.useEffect,i=r.useMemo,s=r.useDebugValue;hi.useSyncExternalStoreWithSelector=function(l,u,c,f,h){var p=o(null);if(p.current===null){var m={hasValue:!1,value:null};p.current=m}else m=p.current;p=i(function(){function g(x){if(!y){if(y=!0,E=x,x=f(x),h!==void 0&&m.hasValue){var T=m.value;if(h(T,x))return w=T}return w=x}if(T=w,e(E,x))return T;var N=f(x);return h!==void 0&&h(T,N)?(E=x,T):(E=x,w=N)}var y=!1,E,w,S=c===void 0?null:c;return[function(){return g(u())},S===null?void 0:function(){return g(S())}]},[u,c,f,h]);var v=t(l,p[0],p[1]);return a(function(){m.hasValue=!0,m.value=v},[v]),s(v),v},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),hi}var gu;function Sm(){return gu||(gu=1,process.env.NODE_ENV==="production"?Do.exports=Em():Do.exports=Dm()),Do.exports}var km=Sm();function we(n,r,e=fu){return km.useSyncExternalStoreWithSelector(Z(t=>n.subscribe(Cm,t)),Z(()=>n.state),Z(()=>n.state),Z(r),e)}function Cm(n){return n}function Or(n,r){let e=d.useId(),t=Bn.get(r),[o,a]=we(t,d.useCallback(i=>[t.selectors.isTop(i,e),t.selectors.inStack(i,e)],[t,e]));return fe(()=>{if(n)return t.actions.push(e),()=>t.actions.pop(e)},[t,n,e]),n?a?o:!0:!1}let mi=new Map,Mr=new Map;function bu(n){var r;let e=(r=Mr.get(n))!=null?r:0;return Mr.set(n,e+1),e!==0?()=>yu(n):(mi.set(n,{"aria-hidden":n.getAttribute("aria-hidden"),inert:n.inert}),n.setAttribute("aria-hidden","true"),n.inert=!0,()=>yu(n))}function yu(n){var r;let e=(r=Mr.get(n))!=null?r:1;if(e===1?Mr.delete(n):Mr.set(n,e-1),e!==1)return;let t=mi.get(n);t&&(t["aria-hidden"]===null?n.removeAttribute("aria-hidden"):n.setAttribute("aria-hidden",t["aria-hidden"]),n.inert=t.inert,mi.delete(n))}function vi(n,{allowed:r,disallowed:e}={}){let t=Or(n,"inert-others");fe(()=>{var o,a;if(!t)return;let i=ut();for(let l of(o=e==null?void 0:e())!=null?o:[])l&&i.add(bu(l));let s=(a=r==null?void 0:r())!=null?a:[];for(let l of s){if(!l)continue;let u=En(l);if(!u)continue;let c=l.parentElement;for(;c&&c!==u.body;){for(let f of c.children)s.some(h=>f.contains(h))||i.add(bu(f));c=c.parentElement}}return i.dispose},[t,r,e])}function gi(n,r,e){let t=Yt(o=>{let a=o.getBoundingClientRect();a.x===0&&a.y===0&&a.width===0&&a.height===0&&e()});d.useEffect(()=>{if(!n)return;let o=r===null?null:tt(r)?r:r.current;if(!o)return;let a=ut();if(typeof ResizeObserver<"u"){let i=new ResizeObserver(()=>t.current(o));i.observe(o),a.add(()=>i.disconnect())}if(typeof IntersectionObserver<"u"){let i=new IntersectionObserver(()=>t.current(o));i.observe(o),a.add(()=>i.disconnect())}return()=>a.dispose()},[r,t,n])}let So=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(n=>`${n}:not([tabindex='-1'])`).join(","),_m=["[data-autofocus]"].map(n=>`${n}:not([tabindex='-1'])`).join(",");var bt=(n=>(n[n.First=1]="First",n[n.Previous=2]="Previous",n[n.Next=4]="Next",n[n.Last=8]="Last",n[n.WrapAround=16]="WrapAround",n[n.NoScroll=32]="NoScroll",n[n.AutoFocus=64]="AutoFocus",n))(bt||{}),bi=(n=>(n[n.Error=0]="Error",n[n.Overflow=1]="Overflow",n[n.Success=2]="Success",n[n.Underflow=3]="Underflow",n))(bi||{}),Om=(n=>(n[n.Previous=-1]="Previous",n[n.Next=1]="Next",n))(Om||{});function wu(n=document.body){return n==null?[]:Array.from(n.querySelectorAll(So)).sort((r,e)=>Math.sign((r.tabIndex||Number.MAX_SAFE_INTEGER)-(e.tabIndex||Number.MAX_SAFE_INTEGER)))}function Mm(n=document.body){return n==null?[]:Array.from(n.querySelectorAll(_m)).sort((r,e)=>Math.sign((r.tabIndex||Number.MAX_SAFE_INTEGER)-(e.tabIndex||Number.MAX_SAFE_INTEGER)))}var yi=(n=>(n[n.Strict=0]="Strict",n[n.Loose=1]="Loose",n))(yi||{});function xu(n,r=0){var e;return n===((e=En(n))==null?void 0:e.body)?!1:Fe(r,{0(){return n.matches(So)},1(){let t=n;for(;t!==null;){if(t.matches(So))return!0;t=t.parentElement}return!1}})}var Tm=(n=>(n[n.Keyboard=0]="Keyboard",n[n.Mouse=1]="Mouse",n))(Tm||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",n=>{n.metaKey||n.altKey||n.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",n=>{n.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:n.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function Ht(n){n==null||n.focus({preventScroll:!0})}let Pm=["textarea","input"].join(",");function Im(n){var r,e;return(e=(r=n==null?void 0:n.matches)==null?void 0:r.call(n,Pm))!=null?e:!1}function wi(n,r=e=>e){return n.slice().sort((e,t)=>{let o=r(e),a=r(t);if(o===null||a===null)return 0;let i=o.compareDocumentPosition(a);return i&Node.DOCUMENT_POSITION_FOLLOWING?-1:i&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Nm(n,r){return Vn(wu(),r,{relativeTo:n})}function Vn(n,r,{sorted:e=!0,relativeTo:t=null,skipElements:o=[]}={}){let a=Array.isArray(n)?n.length>0?n[0].ownerDocument:document:n.ownerDocument,i=Array.isArray(n)?e?wi(n):n:r&64?Mm(n):wu(n);o.length>0&&i.length>1&&(i=i.filter(p=>!o.some(m=>m!=null&&"current"in m?(m==null?void 0:m.current)===p:m===p))),t=t??a.activeElement;let s=(()=>{if(r&5)return 1;if(r&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=(()=>{if(r&1)return 0;if(r&2)return Math.max(0,i.indexOf(t))-1;if(r&4)return Math.max(0,i.indexOf(t))+1;if(r&8)return i.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=r&32?{preventScroll:!0}:{},c=0,f=i.length,h;do{if(c>=f||c+f<=0)return 0;let p=l+c;if(r&16)p=(p+f)%f;else{if(p<0)return 3;if(p>=f)return 1}h=i[p],h==null||h.focus(u),c+=s}while(h!==a.activeElement);return r&6&&Im(h)&&h.select(),2}function Eu(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function $m(){return/Android/gi.test(window.navigator.userAgent)}function xi(){return Eu()||$m()}function zn(n,r,e,t){let o=Yt(e);d.useEffect(()=>{if(!n)return;function a(i){o.current(i)}return document.addEventListener(r,a,t),()=>document.removeEventListener(r,a,t)},[n,r,t])}function Du(n,r,e,t){let o=Yt(e);d.useEffect(()=>{if(!n)return;function a(i){o.current(i)}return window.addEventListener(r,a,t),()=>window.removeEventListener(r,a,t)},[n,r,t])}const Su=30;function Ei(n,r,e){let t=Yt(e),o=d.useCallback(function(s,l){if(s.defaultPrevented)return;let u=l(s);if(u===null||!u.getRootNode().contains(u)||!u.isConnected)return;let c=function f(h){return typeof h=="function"?f(h()):Array.isArray(h)||h instanceof Set?h:[h]}(r);for(let f of c)if(f!==null&&(f.contains(u)||s.composed&&s.composedPath().includes(f)))return;return!xu(u,yi.Loose)&&u.tabIndex!==-1&&s.preventDefault(),t.current(s,u)},[t,r]),a=d.useRef(null);zn(n,"pointerdown",s=>{var l,u;xi()||(a.current=((u=(l=s.composedPath)==null?void 0:l.call(s))==null?void 0:u[0])||s.target)},!0),zn(n,"pointerup",s=>{if(xi()||!a.current)return;let l=a.current;return a.current=null,o(s,()=>l)},!0);let i=d.useRef({x:0,y:0});zn(n,"touchstart",s=>{i.current.x=s.touches[0].clientX,i.current.y=s.touches[0].clientY},!0),zn(n,"touchend",s=>{let l={x:s.changedTouches[0].clientX,y:s.changedTouches[0].clientY};if(!(Math.abs(l.x-i.current.x)>=Su||Math.abs(l.y-i.current.y)>=Su))return o(s,()=>jt(s.target)?s.target:null)},!0),Du(n,"blur",s=>o(s,()=>jh(window.document.activeElement)?window.document.activeElement:null),!0)}function Bt(...n){return d.useMemo(()=>En(...n),[...n])}var Lm=(n=>(n[n.Ignore=0]="Ignore",n[n.Select=1]="Select",n[n.Close=2]="Close",n))(Lm||{});const Vt={Ignore:{kind:0},Select:n=>({kind:1,target:n}),Close:{kind:2}},Fm=200,ku=5;function Cu(n,{trigger:r,action:e,close:t,select:o}){let a=d.useRef(null),i=d.useRef(null),s=d.useRef(null);zn(n&&r!==null,"pointerdown",l=>{ii(l==null?void 0:l.target)&&r!=null&&r.contains(l.target)&&(i.current=l.x,s.current=l.y,a.current=l.timeStamp)}),zn(n&&r!==null,"pointerup",l=>{var u,c;let f=a.current;if(f===null||(a.current=null,!jt(l.target))||Math.abs(l.x-((u=i.current)!=null?u:l.x))<ku&&Math.abs(l.y-((c=s.current)!=null?c:l.y))<ku)return;let h=e(l);switch(h.kind){case 0:return;case 1:{l.timeStamp-f>Fm&&(o(h.target),t());break}case 2:{t();break}}},{capture:!0})}function Di(n,r,e,t){let o=Yt(e);d.useEffect(()=>{n=n??window;function a(i){o.current(i)}return n.addEventListener(r,a,t),()=>n.removeEventListener(r,a,t)},[n,r,t])}function _u(n){let r=d.useRef({value:"",selectionStart:null,selectionEnd:null});return Di(n,"blur",e=>{let t=e.target;yo(t)&&(r.current={value:t.value,selectionStart:t.selectionStart,selectionEnd:t.selectionEnd})}),Z(()=>{if(document.activeElement!==n&&yo(n)&&n.isConnected){if(n.focus({preventScroll:!0}),n.value!==r.current.value)n.setSelectionRange(n.value.length,n.value.length);else{let{selectionStart:e,selectionEnd:t}=r.current;e!==null&&t!==null&&n.setSelectionRange(e,t)}r.current={value:"",selectionStart:null,selectionEnd:null}}})}function Ou(n,r){return d.useMemo(()=>{var e;if(n.type)return n.type;let t=(e=n.as)!=null?e:"button";if(typeof t=="string"&&t.toLowerCase()==="button"||(r==null?void 0:r.tagName)==="BUTTON"&&!r.hasAttribute("type"))return"button"},[n.type,n.as,r])}function Am(n){return d.useSyncExternalStore(n.subscribe,n.getSnapshot,n.getSnapshot)}function Rm(n,r){let e=n(),t=new Set;return{getSnapshot(){return e},subscribe(o){return t.add(o),()=>t.delete(o)},dispatch(o,...a){let i=r[o].call(e,...a);i&&(e=i,t.forEach(s=>s()))}}}function Ym(){let n;return{before({doc:r}){var e;let t=r.documentElement,o=(e=r.defaultView)!=null?e:window;n=Math.max(0,o.innerWidth-t.clientWidth)},after({doc:r,d:e}){let t=r.documentElement,o=Math.max(0,t.clientWidth-t.offsetWidth),a=Math.max(0,n-o);e.style(t,"paddingRight",`${a}px`)}}}function Wm(){return Eu()?{before({doc:n,d:r,meta:e}){function t(o){return e.containers.flatMap(a=>a()).some(a=>a.contains(o))}r.microTask(()=>{var o;if(window.getComputedStyle(n.documentElement).scrollBehavior!=="auto"){let s=ut();s.style(n.documentElement,"scrollBehavior","auto"),r.add(()=>r.microTask(()=>s.dispose()))}let a=(o=window.scrollY)!=null?o:window.pageYOffset,i=null;r.addEventListener(n,"click",s=>{if(jt(s.target))try{let l=s.target.closest("a");if(!l)return;let{hash:u}=new URL(l.href),c=n.querySelector(u);jt(c)&&!t(c)&&(i=c)}catch{}},!0),r.addEventListener(n,"touchstart",s=>{if(jt(s.target)&&Wh(s.target))if(t(s.target)){let l=s.target;for(;l.parentElement&&t(l.parentElement);)l=l.parentElement;r.style(l,"overscrollBehavior","contain")}else r.style(s.target,"touchAction","none")}),r.addEventListener(n,"touchmove",s=>{if(jt(s.target)){if(yo(s.target))return;if(t(s.target)){let l=s.target;for(;l.parentElement&&l.dataset.headlessuiPortal!==""&&!(l.scrollHeight>l.clientHeight||l.scrollWidth>l.clientWidth);)l=l.parentElement;l.dataset.headlessuiPortal===""&&s.preventDefault()}else s.preventDefault()}},{passive:!1}),r.add(()=>{var s;let l=(s=window.scrollY)!=null?s:window.pageYOffset;a!==l&&window.scrollTo(0,a),i&&i.isConnected&&(i.scrollIntoView({block:"nearest"}),i=null)})})}}:{}}function jm(){return{before({doc:n,d:r}){r.style(n.documentElement,"overflow","hidden")}}}function Hm(n){let r={};for(let e of n)Object.assign(r,e(r));return r}let Dn=Rm(()=>new Map,{PUSH(n,r){var e;let t=(e=this.get(n))!=null?e:{doc:n,count:0,d:ut(),meta:new Set};return t.count++,t.meta.add(r),this.set(n,t),this},POP(n,r){let e=this.get(n);return e&&(e.count--,e.meta.delete(r)),this},SCROLL_PREVENT({doc:n,d:r,meta:e}){let t={doc:n,d:r,meta:Hm(e)},o=[Wm(),Ym(),jm()];o.forEach(({before:a})=>a==null?void 0:a(t)),o.forEach(({after:a})=>a==null?void 0:a(t))},SCROLL_ALLOW({d:n}){n.dispose()},TEARDOWN({doc:n}){this.delete(n)}});Dn.subscribe(()=>{let n=Dn.getSnapshot(),r=new Map;for(let[e]of n)r.set(e,e.documentElement.style.overflow);for(let e of n.values()){let t=r.get(e.doc)==="hidden",o=e.count!==0;(o&&!t||!o&&t)&&Dn.dispatch(e.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",e),e.count===0&&Dn.dispatch("TEARDOWN",e)}});function Bm(n,r,e=()=>({containers:[]})){let t=Am(Dn),o=r?t.get(r):void 0,a=o?o.count>0:!1;return fe(()=>{if(!(!r||!n))return Dn.dispatch("PUSH",r,e),()=>Dn.dispatch("POP",r,e)},[n,r]),a}function Si(n,r,e=()=>[document.body]){let t=Or(n,"scroll-lock");Bm(t,r,o=>{var a;return{containers:[...(a=o.containers)!=null?a:[],e]}})}function Mu(n){return[n.screenX,n.screenY]}function Tu(){let n=d.useRef([-1,-1]);return{wasMoved(r){let e=Mu(r);return n.current[0]===e[0]&&n.current[1]===e[1]?!1:(n.current=e,!0)},update(r){n.current=Mu(r)}}}function Vm(n=0){let[r,e]=d.useState(n),t=d.useCallback(l=>e(l),[r]),o=d.useCallback(l=>e(u=>u|l),[r]),a=d.useCallback(l=>(r&l)===l,[r]),i=d.useCallback(l=>e(u=>u&~l),[e]),s=d.useCallback(l=>e(u=>u^l),[e]);return{flags:r,setFlag:t,addFlag:o,hasFlag:a,removeFlag:i,toggleFlag:s}}var Pu,Iu;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((Pu=process==null?void 0:process.env)==null?void 0:Pu.NODE_ENV)==="test"&&typeof((Iu=Element==null?void 0:Element.prototype)==null?void 0:Iu.getAnimations)>"u"&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join(`
76
- `)),[]});var zm=(n=>(n[n.None=0]="None",n[n.Closed=1]="Closed",n[n.Enter=2]="Enter",n[n.Leave=4]="Leave",n))(zm||{});function ki(n){let r={};for(let e in n)n[e]===!0&&(r[`data-${e}`]="");return r}function Ci(n,r,e,t){let[o,a]=d.useState(e),{hasFlag:i,addFlag:s,removeFlag:l}=Vm(n&&o?3:0),u=d.useRef(!1),c=d.useRef(!1),f=rn();return fe(()=>{var h;if(n){if(e&&a(!0),!r){e&&s(3);return}return(h=t==null?void 0:t.start)==null||h.call(t,e),qm(r,{inFlight:u,prepare(){c.current?c.current=!1:c.current=u.current,u.current=!0,!c.current&&(e?(s(3),l(4)):(s(4),l(2)))},run(){c.current?e?(l(3),s(4)):(l(4),s(3)):e?l(1):s(1)},done(){var p;c.current&&typeof r.getAnimations=="function"&&r.getAnimations().length>0||(u.current=!1,l(7),e||a(!1),(p=t==null?void 0:t.end)==null||p.call(t,e))}})}},[n,e,r,f]),n?[o,{closed:i(1),enter:i(2),leave:i(4),transition:i(2)||i(4)}]:[e,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function qm(n,{prepare:r,run:e,done:t,inFlight:o}){let a=ut();return Qm(n,{prepare:r,inFlight:o}),a.nextFrame(()=>{e(),a.requestAnimationFrame(()=>{a.add(Um(n,t))})}),a.dispose}function Um(n,r){var e,t;let o=ut();if(!n)return o.dispose;let a=!1;o.add(()=>{a=!0});let i=(t=(e=n.getAnimations)==null?void 0:e.call(n).filter(s=>s instanceof CSSTransition))!=null?t:[];return i.length===0?(r(),o.dispose):(Promise.allSettled(i.map(s=>s.finished)).then(()=>{a||r()}),o.dispose)}function Qm(n,{inFlight:r,prepare:e}){if(r!=null&&r.current){e();return}let t=n.style.transition;n.style.transition="none",e(),n.offsetHeight,n.style.transition=t}function Gm(n,{container:r,accept:e,walk:t}){let o=d.useRef(e),a=d.useRef(t);d.useEffect(()=>{o.current=e,a.current=t},[e,t]),fe(()=>{if(!r||!n)return;let i=En(r);if(!i)return;let s=o.current,l=a.current,u=Object.assign(f=>s(f),{acceptNode:s}),c=i.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,u,!1);for(;c.nextNode();)l(c.currentNode)},[r,n,o,a])}function Tr(n,r){let e=d.useRef([]),t=Z(n);d.useEffect(()=>{let o=[...e.current];for(let[a,i]of r.entries())if(e.current[a]!==i){let s=t(r,o);return e.current=r,s}},[t,...r])}function ko(){return typeof window<"u"}function zt(n){return Nu(n)?(n.nodeName||"").toLowerCase():"#document"}function je(n){var r;return(n==null||(r=n.ownerDocument)==null?void 0:r.defaultView)||window}function qe(n){var r;return(r=(Nu(n)?n.ownerDocument:n.document)||window.document)==null?void 0:r.documentElement}function Nu(n){return ko()?n instanceof Node||n instanceof je(n).Node:!1}function Oe(n){return ko()?n instanceof Element||n instanceof je(n).Element:!1}function Ge(n){return ko()?n instanceof HTMLElement||n instanceof je(n).HTMLElement:!1}function $u(n){return!ko()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof je(n).ShadowRoot}const Km=new Set(["inline","contents"]);function ln(n){const{overflow:r,overflowX:e,overflowY:t,display:o}=He(n);return/auto|scroll|overlay|hidden|clip/.test(r+t+e)&&!Km.has(o)}const Xm=new Set(["table","td","th"]);function Lu(n){return Xm.has(zt(n))}const Jm=[":popover-open",":modal"];function Sn(n){return Jm.some(r=>{try{return n.matches(r)}catch{return!1}})}const Zm=["transform","translate","scale","rotate","perspective"],ev=["transform","translate","scale","rotate","perspective","filter"],tv=["paint","layout","strict","content"];function Pr(n){const r=Ir(),e=Oe(n)?He(n):n;return Zm.some(t=>e[t]?e[t]!=="none":!1)||(e.containerType?e.containerType!=="normal":!1)||!r&&(e.backdropFilter?e.backdropFilter!=="none":!1)||!r&&(e.filter?e.filter!=="none":!1)||ev.some(t=>(e.willChange||"").includes(t))||tv.some(t=>(e.contain||"").includes(t))}function Fu(n){let r=at(n);for(;Ge(r)&&!Dt(r);){if(Pr(r))return r;if(Sn(r))return null;r=at(r)}return null}function Ir(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const nv=new Set(["html","body","#document"]);function Dt(n){return nv.has(zt(n))}function He(n){return je(n).getComputedStyle(n)}function un(n){return Oe(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function at(n){if(zt(n)==="html")return n;const r=n.assignedSlot||n.parentNode||$u(n)&&n.host||qe(n);return $u(r)?r.host:r}function Au(n){const r=at(n);return Dt(r)?n.ownerDocument?n.ownerDocument.body:n.body:Ge(r)&&ln(r)?r:Au(r)}function cn(n,r,e){var t;r===void 0&&(r=[]),e===void 0&&(e=!0);const o=Au(n),a=o===((t=n.ownerDocument)==null?void 0:t.body),i=je(o);if(a){const s=Nr(i);return r.concat(i,i.visualViewport||[],ln(o)?o:[],s&&e?cn(s):[])}return r.concat(o,cn(o,[],e))}function Nr(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function rv(){const n=navigator.userAgentData;return n&&Array.isArray(n.brands)?n.brands.map(r=>{let{brand:e,version:t}=r;return e+"/"+t}).join(" "):navigator.userAgent}const dt=Math.min,Ne=Math.max,qt=Math.round,dn=Math.floor,Be=n=>({x:n,y:n}),ov={left:"right",right:"left",bottom:"top",top:"bottom"},av={start:"end",end:"start"};function _i(n,r,e){return Ne(n,dt(r,e))}function St(n,r){return typeof n=="function"?n(r):n}function ft(n){return n.split("-")[0]}function fn(n){return n.split("-")[1]}function Ru(n){return n==="x"?"y":"x"}function Co(n){return n==="y"?"height":"width"}const iv=new Set(["top","bottom"]);function it(n){return iv.has(ft(n))?"y":"x"}function _o(n){return Ru(it(n))}function Yu(n,r,e){e===void 0&&(e=!1);const t=fn(n),o=_o(n),a=Co(o);let i=o==="x"?t===(e?"end":"start")?"right":"left":t==="start"?"bottom":"top";return r.reference[a]>r.floating[a]&&(i=$r(i)),[i,$r(i)]}function Wu(n){const r=$r(n);return[Oi(n),r,Oi(r)]}function Oi(n){return n.replace(/start|end/g,r=>av[r])}const ju=["left","right"],Hu=["right","left"],sv=["top","bottom"],lv=["bottom","top"];function uv(n,r,e){switch(n){case"top":case"bottom":return e?r?Hu:ju:r?ju:Hu;case"left":case"right":return r?sv:lv;default:return[]}}function Bu(n,r,e,t){const o=fn(n);let a=uv(ft(n),e==="start",t);return o&&(a=a.map(i=>i+"-"+o),r&&(a=a.concat(a.map(Oi)))),a}function $r(n){return n.replace(/left|right|bottom|top/g,r=>ov[r])}function cv(n){return{top:0,right:0,bottom:0,left:0,...n}}function Mi(n){return typeof n!="number"?cv(n):{top:n,right:n,bottom:n,left:n}}function pn(n){const{x:r,y:e,width:t,height:o}=n;return{width:t,height:o,top:e,left:r,right:r+t,bottom:e+o,x:r,y:e}}function Vu(n,r,e){let{reference:t,floating:o}=n;const a=it(r),i=_o(r),s=Co(i),l=ft(r),u=a==="y",c=t.x+t.width/2-o.width/2,f=t.y+t.height/2-o.height/2,h=t[s]/2-o[s]/2;let p;switch(l){case"top":p={x:c,y:t.y-o.height};break;case"bottom":p={x:c,y:t.y+t.height};break;case"right":p={x:t.x+t.width,y:f};break;case"left":p={x:t.x-o.width,y:f};break;default:p={x:t.x,y:t.y}}switch(fn(r)){case"start":p[i]-=h*(e&&u?-1:1);break;case"end":p[i]+=h*(e&&u?-1:1);break}return p}const dv=async(n,r,e)=>{const{placement:t="bottom",strategy:o="absolute",middleware:a=[],platform:i}=e,s=a.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(r));let u=await i.getElementRects({reference:n,floating:r,strategy:o}),{x:c,y:f}=Vu(u,t,l),h=t,p={},m=0;for(let v=0;v<s.length;v++){const{name:g,fn:y}=s[v],{x:E,y:w,data:S,reset:x}=await y({x:c,y:f,initialPlacement:t,placement:h,strategy:o,middlewareData:p,rects:u,platform:i,elements:{reference:n,floating:r}});c=E??c,f=w??f,p={...p,[g]:{...p[g],...S}},x&&m<=50&&(m++,typeof x=="object"&&(x.placement&&(h=x.placement),x.rects&&(u=x.rects===!0?await i.getElementRects({reference:n,floating:r,strategy:o}):x.rects),{x:c,y:f}=Vu(u,h,l)),v=-1)}return{x:c,y:f,placement:h,strategy:o,middlewareData:p}};async function Oo(n,r){var e;r===void 0&&(r={});const{x:t,y:o,platform:a,rects:i,elements:s,strategy:l}=n,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=St(r,n),m=Mi(p),g=s[h?f==="floating"?"reference":"floating":f],y=pn(await a.getClippingRect({element:(e=await(a.isElement==null?void 0:a.isElement(g)))==null||e?g:g.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:l})),E=f==="floating"?{x:t,y:o,width:i.floating.width,height:i.floating.height}:i.reference,w=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),S=await(a.isElement==null?void 0:a.isElement(w))?await(a.getScale==null?void 0:a.getScale(w))||{x:1,y:1}:{x:1,y:1},x=pn(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:E,offsetParent:w,strategy:l}):E);return{top:(y.top-x.top+m.top)/S.y,bottom:(x.bottom-y.bottom+m.bottom)/S.y,left:(y.left-x.left+m.left)/S.x,right:(x.right-y.right+m.right)/S.x}}const fv=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(r){var e,t;const{placement:o,middlewareData:a,rects:i,initialPlacement:s,platform:l,elements:u}=r,{mainAxis:c=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:v=!0,...g}=St(n,r);if((e=a.arrow)!=null&&e.alignmentOffset)return{};const y=ft(o),E=it(s),w=ft(s)===s,S=await(l.isRTL==null?void 0:l.isRTL(u.floating)),x=h||(w||!v?[$r(s)]:Wu(s)),T=m!=="none";!h&&T&&x.push(...Bu(s,v,m,S));const N=[s,...x],_=await Oo(r,g),O=[];let M=((t=a.flip)==null?void 0:t.overflows)||[];if(c&&O.push(_[y]),f){const $=Yu(o,i,S);O.push(_[$[0]],_[$[1]])}if(M=[...M,{placement:o,overflows:O}],!O.every($=>$<=0)){var L,b;const $=(((L=a.flip)==null?void 0:L.index)||0)+1,Y=N[$];if(Y&&(!(f==="alignment"?E!==it(Y):!1)||M.every(C=>it(C.placement)===E?C.overflows[0]>0:!0)))return{data:{index:$,overflows:M},reset:{placement:Y}};let I=(b=M.filter(V=>V.overflows[0]<=0).sort((V,C)=>V.overflows[1]-C.overflows[1])[0])==null?void 0:b.placement;if(!I)switch(p){case"bestFit":{var k;const V=(k=M.filter(C=>{if(T){const q=it(C.placement);return q===E||q==="y"}return!0}).map(C=>[C.placement,C.overflows.filter(q=>q>0).reduce((q,P)=>q+P,0)]).sort((C,q)=>C[1]-q[1])[0])==null?void 0:k[0];V&&(I=V);break}case"initialPlacement":I=s;break}if(o!==I)return{reset:{placement:I}}}return{}}}},pv=new Set(["left","top"]);async function hv(n,r){const{placement:e,platform:t,elements:o}=n,a=await(t.isRTL==null?void 0:t.isRTL(o.floating)),i=ft(e),s=fn(e),l=it(e)==="y",u=pv.has(i)?-1:1,c=a&&l?-1:1,f=St(r,n);let{mainAxis:h,crossAxis:p,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return s&&typeof m=="number"&&(p=s==="end"?m*-1:m),l?{x:p*c,y:h*u}:{x:h*u,y:p*c}}const mv=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(r){var e,t;const{x:o,y:a,placement:i,middlewareData:s}=r,l=await hv(r,n);return i===((e=s.offset)==null?void 0:e.placement)&&(t=s.arrow)!=null&&t.alignmentOffset?{}:{x:o+l.x,y:a+l.y,data:{...l,placement:i}}}}},vv=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(r){const{x:e,y:t,placement:o}=r,{mainAxis:a=!0,crossAxis:i=!1,limiter:s={fn:g=>{let{x:y,y:E}=g;return{x:y,y:E}}},...l}=St(n,r),u={x:e,y:t},c=await Oo(r,l),f=it(ft(o)),h=Ru(f);let p=u[h],m=u[f];if(a){const g=h==="y"?"top":"left",y=h==="y"?"bottom":"right",E=p+c[g],w=p-c[y];p=_i(E,p,w)}if(i){const g=f==="y"?"top":"left",y=f==="y"?"bottom":"right",E=m+c[g],w=m-c[y];m=_i(E,m,w)}const v=s.fn({...r,[h]:p,[f]:m});return{...v,data:{x:v.x-e,y:v.y-t,enabled:{[h]:a,[f]:i}}}}}},gv=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(r){var e,t;const{placement:o,rects:a,platform:i,elements:s}=r,{apply:l=()=>{},...u}=St(n,r),c=await Oo(r,u),f=ft(o),h=fn(o),p=it(o)==="y",{width:m,height:v}=a.floating;let g,y;f==="top"||f==="bottom"?(g=f,y=h===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(y=f,g=h==="end"?"top":"bottom");const E=v-c.top-c.bottom,w=m-c.left-c.right,S=dt(v-c[g],E),x=dt(m-c[y],w),T=!r.middlewareData.shift;let N=S,_=x;if((e=r.middlewareData.shift)!=null&&e.enabled.x&&(_=w),(t=r.middlewareData.shift)!=null&&t.enabled.y&&(N=E),T&&!h){const M=Ne(c.left,0),L=Ne(c.right,0),b=Ne(c.top,0),k=Ne(c.bottom,0);p?_=m-2*(M!==0||L!==0?M+L:Ne(c.left,c.right)):N=v-2*(b!==0||k!==0?b+k:Ne(c.top,c.bottom))}await l({...r,availableWidth:_,availableHeight:N});const O=await i.getDimensions(s.floating);return m!==O.width||v!==O.height?{reset:{rects:!0}}:{}}}};function zu(n){const r=He(n);let e=parseFloat(r.width)||0,t=parseFloat(r.height)||0;const o=Ge(n),a=o?n.offsetWidth:e,i=o?n.offsetHeight:t,s=qt(e)!==a||qt(t)!==i;return s&&(e=a,t=i),{width:e,height:t,$:s}}function Ti(n){return Oe(n)?n:n.contextElement}function qn(n){const r=Ti(n);if(!Ge(r))return Be(1);const e=r.getBoundingClientRect(),{width:t,height:o,$:a}=zu(r);let i=(a?qt(e.width):e.width)/t,s=(a?qt(e.height):e.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!s||!Number.isFinite(s))&&(s=1),{x:i,y:s}}const bv=Be(0);function qu(n){const r=je(n);return!Ir()||!r.visualViewport?bv:{x:r.visualViewport.offsetLeft,y:r.visualViewport.offsetTop}}function yv(n,r,e){return r===void 0&&(r=!1),!e||r&&e!==je(n)?!1:r}function kn(n,r,e,t){r===void 0&&(r=!1),e===void 0&&(e=!1);const o=n.getBoundingClientRect(),a=Ti(n);let i=Be(1);r&&(t?Oe(t)&&(i=qn(t)):i=qn(n));const s=yv(a,e,t)?qu(a):Be(0);let l=(o.left+s.x)/i.x,u=(o.top+s.y)/i.y,c=o.width/i.x,f=o.height/i.y;if(a){const h=je(a),p=t&&Oe(t)?je(t):t;let m=h,v=Nr(m);for(;v&&t&&p!==m;){const g=qn(v),y=v.getBoundingClientRect(),E=He(v),w=y.left+(v.clientLeft+parseFloat(E.paddingLeft))*g.x,S=y.top+(v.clientTop+parseFloat(E.paddingTop))*g.y;l*=g.x,u*=g.y,c*=g.x,f*=g.y,l+=w,u+=S,m=je(v),v=Nr(m)}}return pn({width:c,height:f,x:l,y:u})}function Mo(n,r){const e=un(n).scrollLeft;return r?r.left+e:kn(qe(n)).left+e}function Uu(n,r){const e=n.getBoundingClientRect(),t=e.left+r.scrollLeft-Mo(n,e),o=e.top+r.scrollTop;return{x:t,y:o}}function wv(n){let{elements:r,rect:e,offsetParent:t,strategy:o}=n;const a=o==="fixed",i=qe(t),s=r?Sn(r.floating):!1;if(t===i||s&&a)return e;let l={scrollLeft:0,scrollTop:0},u=Be(1);const c=Be(0),f=Ge(t);if((f||!f&&!a)&&((zt(t)!=="body"||ln(i))&&(l=un(t)),Ge(t))){const p=kn(t);u=qn(t),c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}const h=i&&!f&&!a?Uu(i,l):Be(0);return{width:e.width*u.x,height:e.height*u.y,x:e.x*u.x-l.scrollLeft*u.x+c.x+h.x,y:e.y*u.y-l.scrollTop*u.y+c.y+h.y}}function xv(n){return Array.from(n.getClientRects())}function Ev(n){const r=qe(n),e=un(n),t=n.ownerDocument.body,o=Ne(r.scrollWidth,r.clientWidth,t.scrollWidth,t.clientWidth),a=Ne(r.scrollHeight,r.clientHeight,t.scrollHeight,t.clientHeight);let i=-e.scrollLeft+Mo(n);const s=-e.scrollTop;return He(t).direction==="rtl"&&(i+=Ne(r.clientWidth,t.clientWidth)-o),{width:o,height:a,x:i,y:s}}const Qu=25;function Dv(n,r){const e=je(n),t=qe(n),o=e.visualViewport;let a=t.clientWidth,i=t.clientHeight,s=0,l=0;if(o){a=o.width,i=o.height;const c=Ir();(!c||c&&r==="fixed")&&(s=o.offsetLeft,l=o.offsetTop)}const u=Mo(t);if(u<=0){const c=t.ownerDocument,f=c.body,h=getComputedStyle(f),p=c.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,m=Math.abs(t.clientWidth-f.clientWidth-p);m<=Qu&&(a-=m)}else u<=Qu&&(a+=u);return{width:a,height:i,x:s,y:l}}const Sv=new Set(["absolute","fixed"]);function kv(n,r){const e=kn(n,!0,r==="fixed"),t=e.top+n.clientTop,o=e.left+n.clientLeft,a=Ge(n)?qn(n):Be(1),i=n.clientWidth*a.x,s=n.clientHeight*a.y,l=o*a.x,u=t*a.y;return{width:i,height:s,x:l,y:u}}function Gu(n,r,e){let t;if(r==="viewport")t=Dv(n,e);else if(r==="document")t=Ev(qe(n));else if(Oe(r))t=kv(r,e);else{const o=qu(n);t={x:r.x-o.x,y:r.y-o.y,width:r.width,height:r.height}}return pn(t)}function Ku(n,r){const e=at(n);return e===r||!Oe(e)||Dt(e)?!1:He(e).position==="fixed"||Ku(e,r)}function Cv(n,r){const e=r.get(n);if(e)return e;let t=cn(n,[],!1).filter(s=>Oe(s)&&zt(s)!=="body"),o=null;const a=He(n).position==="fixed";let i=a?at(n):n;for(;Oe(i)&&!Dt(i);){const s=He(i),l=Pr(i);!l&&s.position==="fixed"&&(o=null),(a?!l&&!o:!l&&s.position==="static"&&!!o&&Sv.has(o.position)||ln(i)&&!l&&Ku(n,i))?t=t.filter(c=>c!==i):o=s,i=at(i)}return r.set(n,t),t}function _v(n){let{element:r,boundary:e,rootBoundary:t,strategy:o}=n;const i=[...e==="clippingAncestors"?Sn(r)?[]:Cv(r,this._c):[].concat(e),t],s=i[0],l=i.reduce((u,c)=>{const f=Gu(r,c,o);return u.top=Ne(f.top,u.top),u.right=dt(f.right,u.right),u.bottom=dt(f.bottom,u.bottom),u.left=Ne(f.left,u.left),u},Gu(r,s,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Ov(n){const{width:r,height:e}=zu(n);return{width:r,height:e}}function Mv(n,r,e){const t=Ge(r),o=qe(r),a=e==="fixed",i=kn(n,!0,a,r);let s={scrollLeft:0,scrollTop:0};const l=Be(0);function u(){l.x=Mo(o)}if(t||!t&&!a)if((zt(r)!=="body"||ln(o))&&(s=un(r)),t){const p=kn(r,!0,a,r);l.x=p.x+r.clientLeft,l.y=p.y+r.clientTop}else o&&u();a&&!t&&o&&u();const c=o&&!t&&!a?Uu(o,s):Be(0),f=i.left+s.scrollLeft-l.x-c.x,h=i.top+s.scrollTop-l.y-c.y;return{x:f,y:h,width:i.width,height:i.height}}function Pi(n){return He(n).position==="static"}function Xu(n,r){if(!Ge(n)||He(n).position==="fixed")return null;if(r)return r(n);let e=n.offsetParent;return qe(n)===e&&(e=e.ownerDocument.body),e}function Ju(n,r){const e=je(n);if(Sn(n))return e;if(!Ge(n)){let o=at(n);for(;o&&!Dt(o);){if(Oe(o)&&!Pi(o))return o;o=at(o)}return e}let t=Xu(n,r);for(;t&&Lu(t)&&Pi(t);)t=Xu(t,r);return t&&Dt(t)&&Pi(t)&&!Pr(t)?e:t||Fu(n)||e}const Tv=async function(n){const r=this.getOffsetParent||Ju,e=this.getDimensions,t=await e(n.floating);return{reference:Mv(n.reference,await r(n.floating),n.strategy),floating:{x:0,y:0,width:t.width,height:t.height}}};function Pv(n){return He(n).direction==="rtl"}const Iv={convertOffsetParentRelativeRectToViewportRelativeRect:wv,getDocumentElement:qe,getClippingRect:_v,getOffsetParent:Ju,getElementRects:Tv,getClientRects:xv,getDimensions:Ov,getScale:qn,isElement:Oe,isRTL:Pv};function Zu(n,r){return n.x===r.x&&n.y===r.y&&n.width===r.width&&n.height===r.height}function Nv(n,r){let e=null,t;const o=qe(n);function a(){var s;clearTimeout(t),(s=e)==null||s.disconnect(),e=null}function i(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),a();const u=n.getBoundingClientRect(),{left:c,top:f,width:h,height:p}=u;if(s||r(),!h||!p)return;const m=dn(f),v=dn(o.clientWidth-(c+h)),g=dn(o.clientHeight-(f+p)),y=dn(c),w={rootMargin:-m+"px "+-v+"px "+-g+"px "+-y+"px",threshold:Ne(0,dt(1,l))||1};let S=!0;function x(T){const N=T[0].intersectionRatio;if(N!==l){if(!S)return i();N?i(!1,N):t=setTimeout(()=>{i(!1,1e-7)},1e3)}N===1&&!Zu(u,n.getBoundingClientRect())&&i(),S=!1}try{e=new IntersectionObserver(x,{...w,root:o.ownerDocument})}catch{e=new IntersectionObserver(x,w)}e.observe(n)}return i(!0),a}function $v(n,r,e,t){t===void 0&&(t={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=t,u=Ti(n),c=o||a?[...u?cn(u):[],...cn(r)]:[];c.forEach(y=>{o&&y.addEventListener("scroll",e,{passive:!0}),a&&y.addEventListener("resize",e)});const f=u&&s?Nv(u,e):null;let h=-1,p=null;i&&(p=new ResizeObserver(y=>{let[E]=y;E&&E.target===u&&p&&(p.unobserve(r),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=p)==null||w.observe(r)})),e()}),u&&!l&&p.observe(u),p.observe(r));let m,v=l?kn(n):null;l&&g();function g(){const y=kn(n);v&&!Zu(v,y)&&e(),v=y,m=requestAnimationFrame(g)}return e(),()=>{var y;c.forEach(E=>{o&&E.removeEventListener("scroll",e),a&&E.removeEventListener("resize",e)}),f==null||f(),(y=p)==null||y.disconnect(),p=null,l&&cancelAnimationFrame(m)}}const Ii=Oo,Lv=mv,Fv=vv,Av=fv,Rv=gv,Yv=(n,r,e)=>{const t=new Map,o={platform:Iv,...e},a={...o.platform,_c:t};return dv(n,r,{...o,platform:a})};var Wv=typeof document<"u",jv=function(){},To=Wv?d.useLayoutEffect:jv;function Po(n,r){if(n===r)return!0;if(typeof n!=typeof r)return!1;if(typeof n=="function"&&n.toString()===r.toString())return!0;let e,t,o;if(n&&r&&typeof n=="object"){if(Array.isArray(n)){if(e=n.length,e!==r.length)return!1;for(t=e;t--!==0;)if(!Po(n[t],r[t]))return!1;return!0}if(o=Object.keys(n),e=o.length,e!==Object.keys(r).length)return!1;for(t=e;t--!==0;)if(!{}.hasOwnProperty.call(r,o[t]))return!1;for(t=e;t--!==0;){const a=o[t];if(!(a==="_owner"&&n.$$typeof)&&!Po(n[a],r[a]))return!1}return!0}return n!==n&&r!==r}function ec(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function tc(n,r){const e=ec(n);return Math.round(r*e)/e}function Ni(n){const r=H.useRef(n);return To(()=>{r.current=n}),r}function Hv(n){n===void 0&&(n={});const{placement:r="bottom",strategy:e="absolute",middleware:t=[],platform:o,elements:{reference:a,floating:i}={},transform:s=!0,whileElementsMounted:l,open:u}=n,[c,f]=H.useState({x:0,y:0,strategy:e,placement:r,middlewareData:{},isPositioned:!1}),[h,p]=H.useState(t);Po(h,t)||p(t);const[m,v]=H.useState(null),[g,y]=H.useState(null),E=H.useCallback(C=>{C!==T.current&&(T.current=C,v(C))},[]),w=H.useCallback(C=>{C!==N.current&&(N.current=C,y(C))},[]),S=a||m,x=i||g,T=H.useRef(null),N=H.useRef(null),_=H.useRef(c),O=l!=null,M=Ni(l),L=Ni(o),b=Ni(u),k=H.useCallback(()=>{if(!T.current||!N.current)return;const C={placement:r,strategy:e,middleware:h};L.current&&(C.platform=L.current),Yv(T.current,N.current,C).then(q=>{const P={...q,isPositioned:b.current!==!1};$.current&&!Po(_.current,P)&&(_.current=P,cr.flushSync(()=>{f(P)}))})},[h,r,e,L,b]);To(()=>{u===!1&&_.current.isPositioned&&(_.current.isPositioned=!1,f(C=>({...C,isPositioned:!1})))},[u]);const $=H.useRef(!1);To(()=>($.current=!0,()=>{$.current=!1}),[]),To(()=>{if(S&&(T.current=S),x&&(N.current=x),S&&x){if(M.current)return M.current(S,x,k);k()}},[S,x,k,M,O]);const Y=H.useMemo(()=>({reference:T,floating:N,setReference:E,setFloating:w}),[E,w]),I=H.useMemo(()=>({reference:S,floating:x}),[S,x]),V=H.useMemo(()=>{const C={position:e,left:0,top:0};if(!I.floating)return C;const q=tc(I.floating,c.x),P=tc(I.floating,c.y);return s?{...C,transform:"translate("+q+"px, "+P+"px)",...ec(I.floating)>=1.5&&{willChange:"transform"}}:{position:e,left:q,top:P}},[e,s,I.floating,c.x,c.y]);return H.useMemo(()=>({...c,update:k,refs:Y,elements:I,floatingStyles:V}),[c,k,Y,I,V])}const nc=(n,r)=>({...Lv(n),options:[n,r]}),Bv=(n,r)=>({...Fv(n),options:[n,r]}),Vv=(n,r)=>({...Av(n),options:[n,r]}),zv=(n,r)=>({...Rv(n),options:[n,r]}),rc={...H},qv=rc.useInsertionEffect||(n=>n());function oc(n){const r=H.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return qv(()=>{r.current=n}),H.useCallback(function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return r.current==null?void 0:r.current(...t)},[])}var $i=typeof document<"u"?d.useLayoutEffect:d.useEffect;let ac=!1,Uv=0;const ic=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Uv++;function Qv(){const[n,r]=H.useState(()=>ac?ic():void 0);return $i(()=>{n==null&&r(ic())},[]),H.useEffect(()=>{ac=!0},[]),n}const Gv=rc.useId||Qv;let Lr;process.env.NODE_ENV!=="production"&&(Lr=new Set);function Kv(){for(var n,r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];const o="Floating UI: "+e.join(" ");if(!((n=Lr)!=null&&n.has(o))){var a;(a=Lr)==null||a.add(o),console.warn(o)}}function Xv(){for(var n,r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];const o="Floating UI: "+e.join(" ");if(!((n=Lr)!=null&&n.has(o))){var a;(a=Lr)==null||a.add(o),console.error(o)}}function Jv(){const n=new Map;return{emit(r,e){var t;(t=n.get(r))==null||t.forEach(o=>o(e))},on(r,e){n.set(r,[...n.get(r)||[],e])},off(r,e){var t;n.set(r,((t=n.get(r))==null?void 0:t.filter(o=>o!==e))||[])}}}const Zv=H.createContext(null),eg=H.createContext(null),tg=()=>{var n;return((n=H.useContext(Zv))==null?void 0:n.id)||null},ng=()=>H.useContext(eg),rg="data-floating-ui-focusable";function og(n){const{open:r=!1,onOpenChange:e,elements:t}=n,o=Gv(),a=H.useRef({}),[i]=H.useState(()=>Jv()),s=tg()!=null;if(process.env.NODE_ENV!=="production"){const p=t.reference;p&&!Oe(p)&&Xv("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,u]=H.useState(t.reference),c=oc((p,m,v)=>{a.current.openEvent=p?m:void 0,i.emit("openchange",{open:p,event:m,reason:v,nested:s}),e==null||e(p,m,v)}),f=H.useMemo(()=>({setPositionReference:u}),[]),h=H.useMemo(()=>({reference:l||t.reference||null,floating:t.floating||null,domReference:t.reference}),[l,t.reference,t.floating]);return H.useMemo(()=>({dataRef:a,open:r,onOpenChange:c,elements:h,events:i,floatingId:o,refs:f}),[r,c,h,i,o,f])}function ag(n){n===void 0&&(n={});const{nodeId:r}=n,e=og({...n,elements:{reference:null,floating:null,...n.elements}}),t=n.rootContext||e,o=t.elements,[a,i]=H.useState(null),[s,l]=H.useState(null),c=(o==null?void 0:o.domReference)||a,f=H.useRef(null),h=ng();$i(()=>{c&&(f.current=c)},[c]);const p=Hv({...n,elements:{...o,...s&&{reference:s}}}),m=H.useCallback(w=>{const S=Oe(w)?{getBoundingClientRect:()=>w.getBoundingClientRect(),contextElement:w}:w;l(S),p.refs.setReference(S)},[p.refs]),v=H.useCallback(w=>{(Oe(w)||w===null)&&(f.current=w,i(w)),(Oe(p.refs.reference.current)||p.refs.reference.current===null||w!==null&&!Oe(w))&&p.refs.setReference(w)},[p.refs]),g=H.useMemo(()=>({...p.refs,setReference:v,setPositionReference:m,domReference:f}),[p.refs,v,m]),y=H.useMemo(()=>({...p.elements,domReference:c}),[p.elements,c]),E=H.useMemo(()=>({...p,...t,refs:g,elements:y,nodeId:r}),[p,g,y,r,t]);return $i(()=>{t.dataRef.current.floatingContext=E;const w=h==null?void 0:h.nodesRef.current.find(S=>S.id===r);w&&(w.context=E)}),H.useMemo(()=>({...p,context:E,refs:g,elements:y}),[p,g,y,E])}const sc="active",lc="selected";function Li(n,r,e){const t=new Map,o=e==="item";let a=n;if(o&&n){const{[sc]:i,[lc]:s,...l}=n;a=l}return{...e==="floating"&&{tabIndex:-1,[rg]:""},...a,...r.map(i=>{const s=i?i[e]:null;return typeof s=="function"?n?s(n):null:s}).concat(n).reduce((i,s)=>(s&&Object.entries(s).forEach(l=>{let[u,c]=l;if(!(o&&[sc,lc].includes(u)))if(u.indexOf("on")===0){if(t.has(u)||t.set(u,[]),typeof c=="function"){var f;(f=t.get(u))==null||f.push(c),i[u]=function(){for(var h,p=arguments.length,m=new Array(p),v=0;v<p;v++)m[v]=arguments[v];return(h=t.get(u))==null?void 0:h.map(g=>g(...m)).find(g=>g!==void 0)}}}else i[u]=c}),i),{})}}function ig(n){n===void 0&&(n=[]);const r=n.map(s=>s==null?void 0:s.reference),e=n.map(s=>s==null?void 0:s.floating),t=n.map(s=>s==null?void 0:s.item),o=H.useCallback(s=>Li(s,n,"reference"),r),a=H.useCallback(s=>Li(s,n,"floating"),e),i=H.useCallback(s=>Li(s,n,"item"),t);return H.useMemo(()=>({getReferenceProps:o,getFloatingProps:a,getItemProps:i}),[o,a,i])}function uc(n,r){return{...n,rects:{...n.rects,floating:{...n.rects.floating,height:r}}}}const sg=n=>({name:"inner",options:n,async fn(r){const{listRef:e,overflowRef:t,onFallbackChange:o,offset:a=0,index:i=0,minItemsVisible:s=4,referenceOverflowThreshold:l=0,scrollRef:u,...c}=St(n,r),{rects:f,elements:{floating:h}}=r,p=e.current[i],m=(u==null?void 0:u.current)||h,v=h.clientTop||m.clientTop,g=h.clientTop!==0,y=m.clientTop!==0,E=h===m;if(process.env.NODE_ENV!=="production"&&(r.placement.startsWith("bottom")||Kv('`placement` side must be "bottom" when using the `inner`',"middleware.")),!p)return{};const w={...r,...await nc(-p.offsetTop-h.clientTop-f.reference.height/2-p.offsetHeight/2-a).fn(r)},S=await Ii(uc(w,m.scrollHeight+v+h.clientTop),c),x=await Ii(w,{...c,elementContext:"reference"}),T=Ne(0,S.top),N=w.y+T,M=(m.scrollHeight>m.clientHeight?L=>L:qt)(Ne(0,m.scrollHeight+(g&&E||y?v*2:0)-T-Ne(0,S.bottom)));if(m.style.maxHeight=M+"px",m.scrollTop=T,o){const L=m.offsetHeight<p.offsetHeight*dt(s,e.current.length)-1||x.top>=-l||x.bottom>=-l;cr.flushSync(()=>o(L))}return t&&(t.current=await Ii(uc({...w,y:N},m.offsetHeight+v+h.clientTop),c)),{y:N}}});function lg(n,r){const{open:e,elements:t}=n,{enabled:o=!0,overflowRef:a,scrollRef:i,onChange:s}=r,l=oc(s),u=H.useRef(!1),c=H.useRef(null),f=H.useRef(null);H.useEffect(()=>{if(!o)return;function p(v){if(v.ctrlKey||!m||a.current==null)return;const g=v.deltaY,y=a.current.top>=-.5,E=a.current.bottom>=-.5,w=m.scrollHeight-m.clientHeight,S=g<0?-1:1,x=g<0?"max":"min";m.scrollHeight<=m.clientHeight||(!y&&g>0||!E&&g<0?(v.preventDefault(),cr.flushSync(()=>{l(T=>T+Math[x](g,w*S))})):/firefox/i.test(rv())&&(m.scrollTop+=g))}const m=(i==null?void 0:i.current)||t.floating;if(e&&m)return m.addEventListener("wheel",p),requestAnimationFrame(()=>{c.current=m.scrollTop,a.current!=null&&(f.current={...a.current})}),()=>{c.current=null,f.current=null,m.removeEventListener("wheel",p)}},[o,e,t.floating,a,i,l]);const h=H.useMemo(()=>({onKeyDown(){u.current=!0},onWheel(){u.current=!1},onPointerMove(){u.current=!1},onScroll(){const p=(i==null?void 0:i.current)||t.floating;if(!(!a.current||!p||!u.current)){if(c.current!==null){const m=p.scrollTop-c.current;(a.current.bottom<-.5&&m<-1||a.current.top<-.5&&m>1)&&cr.flushSync(()=>l(v=>v+m))}requestAnimationFrame(()=>{c.current=p.scrollTop})}}}),[t.floating,l,a,i]);return H.useMemo(()=>o?{floating:h}:{},[o,h])}let Un=d.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});Un.displayName="FloatingContext";let Fi=d.createContext(null);Fi.displayName="PlacementContext";function cc(n){return d.useMemo(()=>n?typeof n=="string"?{to:n}:n:null,[n])}function dc(){return d.useContext(Un).setReference}function ug(){return d.useContext(Un).getReferenceProps}function fc(){let{getFloatingProps:n,slot:r}=d.useContext(Un);return d.useCallback((...e)=>Object.assign({},n(...e),{"data-anchor":r.anchor}),[n,r])}function pc(n=null){n===!1&&(n=null),typeof n=="string"&&(n={to:n});let r=d.useContext(Fi),e=d.useMemo(()=>n,[JSON.stringify(n,(o,a)=>{var i;return(i=a==null?void 0:a.outerHTML)!=null?i:a})]);fe(()=>{r==null||r(e??null)},[r,e]);let t=d.useContext(Un);return d.useMemo(()=>[t.setFloating,n?t.styles:{}],[t.setFloating,n,t.styles])}let hc=4;function mc({children:n,enabled:r=!0}){let[e,t]=d.useState(null),[o,a]=d.useState(0),i=d.useRef(null),[s,l]=d.useState(null);cg(s);let u=r&&e!==null&&s!==null,{to:c="bottom",gap:f=0,offset:h=0,padding:p=0,inner:m}=dg(e,s),[v,g="center"]=c.split(" ");fe(()=>{u&&a(0)},[u]);let{refs:y,floatingStyles:E,context:w}=ag({open:u,placement:v==="selection"?g==="center"?"bottom":`bottom-${g}`:g==="center"?`${v}`:`${v}-${g}`,strategy:"absolute",transform:!1,middleware:[nc({mainAxis:v==="selection"?0:f,crossAxis:h}),Bv({padding:p}),v!=="selection"&&Vv({padding:p}),v==="selection"&&m?sg({...m,padding:p,overflowRef:i,offset:o,minItemsVisible:hc,referenceOverflowThreshold:p,onFallbackChange(L){var b,k;if(!L)return;let $=w.elements.floating;if(!$)return;let Y=parseFloat(getComputedStyle($).scrollPaddingBottom)||0,I=Math.min(hc,$.childElementCount),V=0,C=0;for(let q of(k=(b=w.elements.floating)==null?void 0:b.childNodes)!=null?k:[])if(tt(q)){let P=q.offsetTop,W=P+q.clientHeight+Y,G=$.scrollTop,j=G+$.clientHeight;if(P>=G&&W<=j)I--;else{C=Math.max(0,Math.min(W,j)-Math.max(P,G)),V=q.clientHeight;break}}I>=1&&a(q=>{let P=V*I-C+Y;return q>=P?q:P})}}):null,zv({padding:p,apply({availableWidth:L,availableHeight:b,elements:k}){Object.assign(k.floating.style,{overflow:"auto",maxWidth:`${L}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${b}px)`})}})].filter(Boolean),whileElementsMounted:$v}),[S=v,x=g]=w.placement.split("-");v==="selection"&&(S="selection");let T=d.useMemo(()=>({anchor:[S,x].filter(Boolean).join(" ")}),[S,x]),N=lg(w,{overflowRef:i,onChange:a}),{getReferenceProps:_,getFloatingProps:O}=ig([N]),M=Z(L=>{l(L),y.setFloating(L)});return H.createElement(Fi.Provider,{value:t},H.createElement(Un.Provider,{value:{setFloating:M,setReference:y.setReference,styles:E,getReferenceProps:_,getFloatingProps:O,slot:T}},n))}function cg(n){fe(()=>{if(!n)return;let r=new MutationObserver(()=>{let e=window.getComputedStyle(n).maxHeight,t=parseFloat(e);if(isNaN(t))return;let o=parseInt(e);isNaN(o)||t!==o&&(n.style.maxHeight=`${Math.ceil(t)}px`)});return r.observe(n,{attributes:!0,attributeFilter:["style"]}),()=>{r.disconnect()}},[n])}function dg(n,r){var e,t,o;let a=Ai((e=n==null?void 0:n.gap)!=null?e:"var(--anchor-gap, 0)",r),i=Ai((t=n==null?void 0:n.offset)!=null?t:"var(--anchor-offset, 0)",r),s=Ai((o=n==null?void 0:n.padding)!=null?o:"var(--anchor-padding, 0)",r);return{...n,gap:a,offset:i,padding:s}}function Ai(n,r,e=void 0){let t=rn(),o=Z((l,u)=>{if(l==null)return[e,null];if(typeof l=="number")return[l,null];if(typeof l=="string"){if(!u)return[e,null];let c=gc(l,u);return[c,f=>{let h=vc(l);{let p=h.map(m=>window.getComputedStyle(u).getPropertyValue(m));t.requestAnimationFrame(function m(){t.nextFrame(m);let v=!1;for(let[y,E]of h.entries()){let w=window.getComputedStyle(u).getPropertyValue(E);if(p[y]!==w){p[y]=w,v=!0;break}}if(!v)return;let g=gc(l,u);c!==g&&(f(g),c=g)})}return t.dispose}]}return[e,null]}),a=d.useMemo(()=>o(n,r)[0],[n,r]),[i=a,s]=d.useState();return fe(()=>{let[l,u]=o(n,r);if(s(l),!!u)return u(s)},[n,r]),i}function vc(n){let r=/var\((.*)\)/.exec(n);if(r){let e=r[1].indexOf(",");if(e===-1)return[r[1]];let t=r[1].slice(0,e).trim(),o=r[1].slice(e+1).trim();return o?[t,...vc(o)]:[t]}return[]}function gc(n,r){let e=document.createElement("div");r.appendChild(e),e.style.setProperty("margin-top","0px","important"),e.style.setProperty("margin-top",n,"important");let t=parseFloat(window.getComputedStyle(e).marginTop)||0;return r.removeChild(e),t}function fg({children:n,freeze:r}){let e=Io(r,n);return d.createElement(d.Fragment,null,e)}function Io(n,r){let[e,t]=d.useState(r);return!n&&e!==r&&t(r),n?e:r}let No=d.createContext(null);No.displayName="OpenClosedContext";var Ue=(n=>(n[n.Open=1]="Open",n[n.Closed=2]="Closed",n[n.Closing=4]="Closing",n[n.Opening=8]="Opening",n))(Ue||{});function Qn(){return d.useContext(No)}function Ri({value:n,children:r}){return d.createElement(No.Provider,{value:n},r)}function pg({children:n}){return d.createElement(No.Provider,{value:null},n)}function hg(n){function r(){document.readyState!=="loading"&&(n(),document.removeEventListener("DOMContentLoaded",r))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",r),r())}let kt=[];hg(()=>{function n(r){if(!jt(r.target)||r.target===document.body||kt[0]===r.target)return;let e=r.target;e=e.closest(So),kt.unshift(e??r.target),kt=kt.filter(t=>t!=null&&t.isConnected),kt.splice(10)}window.addEventListener("click",n,{capture:!0}),window.addEventListener("mousedown",n,{capture:!0}),window.addEventListener("focus",n,{capture:!0}),document.body.addEventListener("click",n,{capture:!0}),document.body.addEventListener("mousedown",n,{capture:!0}),document.body.addEventListener("focus",n,{capture:!0})});function mg(n){throw new Error("Unexpected object: "+n)}var se=(n=>(n[n.First=0]="First",n[n.Previous=1]="Previous",n[n.Next=2]="Next",n[n.Last=3]="Last",n[n.Specific=4]="Specific",n[n.Nothing=5]="Nothing",n))(se||{});function Gn(n,r){let e=r.resolveItems();if(e.length<=0)return null;let t=r.resolveActiveIndex(),o=t??-1;switch(n.focus){case 0:{for(let a=0;a<e.length;++a)if(!r.resolveDisabled(e[a],a,e))return a;return t}case 1:{o===-1&&(o=e.length);for(let a=o-1;a>=0;--a)if(!r.resolveDisabled(e[a],a,e))return a;return t}case 2:{for(let a=o+1;a<e.length;++a)if(!r.resolveDisabled(e[a],a,e))return a;return t}case 3:{for(let a=e.length-1;a>=0;--a)if(!r.resolveDisabled(e[a],a,e))return a;return t}case 4:{for(let a=0;a<e.length;++a)if(r.resolveId(e[a],a,e)===n.id)return a;return t}case 5:return null;default:mg(n)}}var $o=(n=>(n[n.Left=0]="Left",n[n.Right=2]="Right",n))($o||{});function Lo(n){let r=Z(n),e=d.useRef(!1);d.useEffect(()=>(e.current=!1,()=>{e.current=!0,vo(()=>{e.current&&r()})}),[r])}function vg(){let n=typeof document>"u";return"useSyncExternalStore"in H?(r=>r.useSyncExternalStore)(H)(()=>()=>{},()=>!1,()=>!n):!1}function Fr(){let n=vg(),[r,e]=H.useState(xt.isHandoffComplete);return r&&xt.isHandoffComplete===!1&&e(!1),H.useEffect(()=>{r!==!0&&e(!0)},[r]),H.useEffect(()=>xt.handoff(),[]),n?!1:r}let bc=d.createContext(!1);function gg(){return d.useContext(bc)}function yc(n){return d.createElement(bc.Provider,{value:n.force},n.children)}function bg(n){let r=gg(),e=d.useContext(xc),[t,o]=d.useState(()=>{var a;if(!r&&e!==null)return(a=e.current)!=null?a:null;if(xt.isServer)return null;let i=n==null?void 0:n.getElementById("headlessui-portal-root");if(i)return i;if(n===null)return null;let s=n.createElement("div");return s.setAttribute("id","headlessui-portal-root"),n.body.appendChild(s)});return d.useEffect(()=>{t!==null&&(n!=null&&n.body.contains(t)||n==null||n.body.appendChild(t))},[t,n]),d.useEffect(()=>{r||e!==null&&o(e.current)},[e,o,r]),t}let wc=d.Fragment,yg=_e(function(n,r){let{ownerDocument:e=null,...t}=n,o=d.useRef(null),a=We(zh(p=>{o.current=p}),r),i=Bt(o),s=e??i,l=bg(s),[u]=d.useState(()=>{var p;return xt.isServer?null:(p=s==null?void 0:s.createElement("div"))!=null?p:null}),c=d.useContext(Yi),f=Fr();fe(()=>{!l||!u||l.contains(u)||(u.setAttribute("data-headlessui-portal",""),l.appendChild(u))},[l,u]),fe(()=>{if(u&&c)return c.register(u)},[c,u]),Lo(()=>{var p;!l||!u||(ii(u)&&l.contains(u)&&l.removeChild(u),l.childNodes.length<=0&&((p=l.parentElement)==null||p.removeChild(l)))});let h=Te();return f?!l||!u?null:Le.createPortal(h({ourProps:{ref:a},theirProps:t,slot:{},defaultTag:wc,name:"Portal"}),u):null});function wg(n,r){let e=We(r),{enabled:t=!0,ownerDocument:o,...a}=n,i=Te();return t?d.createElement(yg,{...a,ownerDocument:o,ref:e}):i({ourProps:{ref:e},theirProps:a,slot:{},defaultTag:wc,name:"Portal"})}let xg=d.Fragment,xc=d.createContext(null);function Eg(n,r){let{target:e,...t}=n,o={ref:We(r)},a=Te();return d.createElement(xc.Provider,{value:e},a({ourProps:o,theirProps:t,defaultTag:xg,name:"Popover.Group"}))}let Yi=d.createContext(null);function Dg(){let n=d.useContext(Yi),r=d.useRef([]),e=Z(a=>(r.current.push(a),n&&n.register(a),()=>t(a))),t=Z(a=>{let i=r.current.indexOf(a);i!==-1&&r.current.splice(i,1),n&&n.unregister(a)}),o=d.useMemo(()=>({register:e,unregister:t,portals:r}),[e,t,r]);return[r,d.useMemo(()=>function({children:a}){return d.createElement(Yi.Provider,{value:o},a)},[o])]}let Sg=_e(wg),Ec=_e(Eg),Wi=Object.assign(Sg,{Group:Ec});var kg=Object.defineProperty,Cg=(n,r,e)=>r in n?kg(n,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[r]=e,Dc=(n,r,e)=>(Cg(n,typeof r!="symbol"?r+"":r,e),e),de=(n=>(n[n.Open=0]="Open",n[n.Closed=1]="Closed",n))(de||{}),st=(n=>(n[n.Single=0]="Single",n[n.Multi=1]="Multi",n))(st||{}),Ct=(n=>(n[n.Pointer=0]="Pointer",n[n.Focus=1]="Focus",n[n.Other=2]="Other",n))(Ct||{}),Sc=(n=>(n[n.OpenCombobox=0]="OpenCombobox",n[n.CloseCombobox=1]="CloseCombobox",n[n.GoToOption=2]="GoToOption",n[n.SetTyping=3]="SetTyping",n[n.RegisterOption=4]="RegisterOption",n[n.UnregisterOption=5]="UnregisterOption",n[n.DefaultToFirstOption=6]="DefaultToFirstOption",n[n.SetActivationTrigger=7]="SetActivationTrigger",n[n.UpdateVirtualConfiguration=8]="UpdateVirtualConfiguration",n[n.SetInputElement=9]="SetInputElement",n[n.SetButtonElement=10]="SetButtonElement",n[n.SetOptionsElement=11]="SetOptionsElement",n))(Sc||{});function ji(n,r=e=>e){let e=n.activeOptionIndex!==null?n.options[n.activeOptionIndex]:null,t=r(n.options.slice()),o=t.length>0&&t[0].dataRef.current.order!==null?t.sort((i,s)=>i.dataRef.current.order-s.dataRef.current.order):wi(t,i=>i.dataRef.current.domRef.current),a=e?o.indexOf(e):null;return a===-1&&(a=null),{options:o,activeOptionIndex:a}}let _g={1(n){var r;return(r=n.dataRef.current)!=null&&r.disabled||n.comboboxState===1?n:{...n,activeOptionIndex:null,comboboxState:1,isTyping:!1,activationTrigger:2,__demoMode:!1}},0(n){var r,e;if((r=n.dataRef.current)!=null&&r.disabled||n.comboboxState===0)return n;if((e=n.dataRef.current)!=null&&e.value){let t=n.dataRef.current.calculateIndex(n.dataRef.current.value);if(t!==-1)return{...n,activeOptionIndex:t,comboboxState:0,__demoMode:!1}}return{...n,comboboxState:0,__demoMode:!1}},3(n,r){return n.isTyping===r.isTyping?n:{...n,isTyping:r.isTyping}},2(n,r){var e,t,o,a;if((e=n.dataRef.current)!=null&&e.disabled||n.optionsElement&&!((t=n.dataRef.current)!=null&&t.optionsPropsRef.current.static)&&n.comboboxState===1)return n;if(n.virtual){let{options:u,disabled:c}=n.virtual,f=r.focus===se.Specific?r.idx:Gn(r,{resolveItems:()=>u,resolveActiveIndex:()=>{var p,m;return(m=(p=n.activeOptionIndex)!=null?p:u.findIndex(v=>!c(v)))!=null?m:null},resolveDisabled:c,resolveId(){throw new Error("Function not implemented.")}}),h=(o=r.trigger)!=null?o:2;return n.activeOptionIndex===f&&n.activationTrigger===h?n:{...n,activeOptionIndex:f,activationTrigger:h,isTyping:!1,__demoMode:!1}}let i=ji(n);if(i.activeOptionIndex===null){let u=i.options.findIndex(c=>!c.dataRef.current.disabled);u!==-1&&(i.activeOptionIndex=u)}let s=r.focus===se.Specific?r.idx:Gn(r,{resolveItems:()=>i.options,resolveActiveIndex:()=>i.activeOptionIndex,resolveId:u=>u.id,resolveDisabled:u=>u.dataRef.current.disabled}),l=(a=r.trigger)!=null?a:2;return n.activeOptionIndex===s&&n.activationTrigger===l?n:{...n,...i,isTyping:!1,activeOptionIndex:s,activationTrigger:l,__demoMode:!1}},4:(n,r)=>{var e,t,o,a;if((e=n.dataRef.current)!=null&&e.virtual)return{...n,options:[...n.options,r.payload]};let i=r.payload,s=ji(n,u=>(u.push(i),u));n.activeOptionIndex===null&&(o=(t=n.dataRef.current).isSelected)!=null&&o.call(t,r.payload.dataRef.current.value)&&(s.activeOptionIndex=s.options.indexOf(i));let l={...n,...s,activationTrigger:2};return(a=n.dataRef.current)!=null&&a.__demoMode&&n.dataRef.current.value===void 0&&(l.activeOptionIndex=0),l},5:(n,r)=>{var e;if((e=n.dataRef.current)!=null&&e.virtual)return{...n,options:n.options.filter(o=>o.id!==r.id)};let t=ji(n,o=>{let a=o.findIndex(i=>i.id===r.id);return a!==-1&&o.splice(a,1),o});return{...n,...t,activationTrigger:2}},6:(n,r)=>n.defaultToFirstOption===r.value?n:{...n,defaultToFirstOption:r.value},7:(n,r)=>n.activationTrigger===r.trigger?n:{...n,activationTrigger:r.trigger},8:(n,r)=>{var e,t;if(n.virtual===null)return{...n,virtual:{options:r.options,disabled:(e=r.disabled)!=null?e:()=>!1}};if(n.virtual.options===r.options&&n.virtual.disabled===r.disabled)return n;let o=n.activeOptionIndex;if(n.activeOptionIndex!==null){let a=r.options.indexOf(n.virtual.options[n.activeOptionIndex]);a!==-1?o=a:o=null}return{...n,activeOptionIndex:o,virtual:{options:r.options,disabled:(t=r.disabled)!=null?t:()=>!1}}},9:(n,r)=>n.inputElement===r.element?n:{...n,inputElement:r.element},10:(n,r)=>n.buttonElement===r.element?n:{...n,buttonElement:r.element},11:(n,r)=>n.optionsElement===r.element?n:{...n,optionsElement:r.element}},Og=class Yf extends ui{constructor(r){super(r),Dc(this,"actions",{onChange:e=>{let{onChange:t,compare:o,mode:a,value:i}=this.state.dataRef.current;return Fe(a,{0:()=>t==null?void 0:t(e),1:()=>{let s=i.slice(),l=s.findIndex(u=>o(u,e));return l===-1?s.push(e):s.splice(l,1),t==null?void 0:t(s)}})},registerOption:(e,t)=>(this.send({type:4,payload:{id:e,dataRef:t}}),()=>{this.state.activeOptionIndex===this.state.dataRef.current.calculateIndex(t.current.value)&&this.send({type:6,value:!0}),this.send({type:5,id:e})}),goToOption:(e,t)=>(this.send({type:6,value:!1}),this.send({type:2,...e,trigger:t})),setIsTyping:e=>{this.send({type:3,isTyping:e})},closeCombobox:()=>{var e,t;this.send({type:1}),this.send({type:6,value:!1}),(t=(e=this.state.dataRef.current).onClose)==null||t.call(e)},openCombobox:()=>{this.send({type:0}),this.send({type:6,value:!0})},setActivationTrigger:e=>{this.send({type:7,trigger:e})},selectActiveOption:()=>{let e=this.selectors.activeOptionIndex(this.state);if(e!==null){if(this.actions.setIsTyping(!1),this.state.virtual)this.actions.onChange(this.state.virtual.options[e]);else{let{dataRef:t}=this.state.options[e];this.actions.onChange(t.current.value)}this.actions.goToOption({focus:se.Specific,idx:e})}},setInputElement:e=>{this.send({type:9,element:e})},setButtonElement:e=>{this.send({type:10,element:e})},setOptionsElement:e=>{this.send({type:11,element:e})}}),Dc(this,"selectors",{activeDescendantId:e=>{var t,o;let a=this.selectors.activeOptionIndex(e);if(a!==null)return e.virtual?(o=e.options.find(i=>!i.dataRef.current.disabled&&e.dataRef.current.compare(i.dataRef.current.value,e.virtual.options[a])))==null?void 0:o.id:(t=e.options[a])==null?void 0:t.id},activeOptionIndex:e=>{if(e.defaultToFirstOption&&e.activeOptionIndex===null&&(e.virtual?e.virtual.options.length>0:e.options.length>0)){if(e.virtual){let{options:o,disabled:a}=e.virtual,i=o.findIndex(s=>{var l;return!((l=a==null?void 0:a(s))!=null&&l)});if(i!==-1)return i}let t=e.options.findIndex(o=>!o.dataRef.current.disabled);if(t!==-1)return t}return e.activeOptionIndex},activeOption:e=>{var t,o;let a=this.selectors.activeOptionIndex(e);return a===null?null:e.virtual?e.virtual.options[a??0]:(o=(t=e.options[a])==null?void 0:t.dataRef.current.value)!=null?o:null},isActive:(e,t,o)=>{var a;let i=this.selectors.activeOptionIndex(e);return i===null?!1:e.virtual?i===e.dataRef.current.calculateIndex(t):((a=e.options[i])==null?void 0:a.id)===o},shouldScrollIntoView:(e,t,o)=>!(e.virtual||e.__demoMode||e.comboboxState!==0||e.activationTrigger===0||!this.selectors.isActive(e,t,o))});{let e=this.state.id,t=Bn.get(null);this.disposables.add(t.on(fi.Push,o=>{!t.selectors.isTop(o,e)&&this.state.comboboxState===0&&this.actions.closeCombobox()})),this.on(0,()=>t.actions.push(e)),this.on(1,()=>t.actions.pop(e))}}static new({id:r,virtual:e=null,__demoMode:t=!1}){var o;return new Yf({id:r,dataRef:{current:{}},comboboxState:t?0:1,isTyping:!1,options:[],virtual:e?{options:e.options,disabled:(o=e.disabled)!=null?o:()=>!1}:null,activeOptionIndex:null,activationTrigger:2,inputElement:null,buttonElement:null,optionsElement:null,__demoMode:t})}reduce(r,e){return Fe(e.type,_g,r,e)}};const kc=d.createContext(null);function Ar(n){let r=d.useContext(kc);if(r===null){let e=new Error(`<${n} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,Cc),e}return r}function Cc({id:n,virtual:r=null,__demoMode:e=!1}){let t=d.useMemo(()=>Og.new({id:n,virtual:r,__demoMode:e}),[]);return Lo(()=>t.dispose()),t}let Rr=d.createContext(null);Rr.displayName="ComboboxDataContext";function Kn(n){let r=d.useContext(Rr);if(r===null){let e=new Error(`<${n} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,Kn),e}return r}let _c=d.createContext(null);function Mg(n){let r=Ar("VirtualProvider"),e=Kn("VirtualProvider"),{options:t}=e.virtual,o=we(r,p=>p.optionsElement),[a,i]=d.useMemo(()=>{let p=o;if(!p)return[0,0];let m=window.getComputedStyle(p);return[parseFloat(m.paddingBlockStart||m.paddingTop),parseFloat(m.paddingBlockEnd||m.paddingBottom)]},[o]),s=fm({enabled:t.length!==0,scrollPaddingStart:a,scrollPaddingEnd:i,count:t.length,estimateSize(){return 40},getScrollElement(){return r.state.optionsElement},overscan:12}),[l,u]=d.useState(0);fe(()=>{u(p=>p+1)},[t]);let c=s.getVirtualItems(),f=we(r,p=>p.activationTrigger===Ct.Pointer),h=we(r,r.selectors.activeOptionIndex);return c.length===0?null:d.createElement(_c.Provider,{value:s},d.createElement("div",{style:{position:"relative",width:"100%",height:`${s.getTotalSize()}px`},ref:p=>{p&&(f||h!==null&&t.length>h&&s.scrollToIndex(h))}},c.map(p=>{var m;return d.createElement(d.Fragment,{key:p.key},d.cloneElement((m=n.children)==null?void 0:m.call(n,{...n.slot,option:t[p.index]}),{key:`${l}-${p.key}`,"data-index":p.index,"aria-setsize":t.length,"aria-posinset":p.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${p.start}px)`,overflowAnchor:"none"}}))})))}let Tg=d.Fragment;function Pg(n,r){let e=d.useId(),t=go(),{value:o,defaultValue:a,onChange:i,form:s,name:l,by:u,invalid:c=!1,disabled:f=t||!1,onClose:h,__demoMode:p=!1,multiple:m=!1,immediate:v=!1,virtual:g=null,nullable:y,...E}=n,w=Hl(a),[S=m?[]:void 0,x]=jl(o,i,w),T=Cc({id:e,virtual:g,__demoMode:p}),N=d.useRef({static:!1,hold:!1}),_=lu(u),O=Z(B=>g?u===null?g.options.indexOf(B):g.options.findIndex(K=>_(K,B)):T.state.options.findIndex(K=>_(K.dataRef.current.value,B))),M=d.useCallback(B=>Fe(k.mode,{[st.Multi]:()=>S.some(K=>_(K,B)),[st.Single]:()=>_(S,B)}),[S]),L=we(T,B=>B.virtual),b=Z(()=>h==null?void 0:h()),k=d.useMemo(()=>({__demoMode:p,immediate:v,optionsPropsRef:N,value:S,defaultValue:w,disabled:f,invalid:c,mode:m?st.Multi:st.Single,virtual:g?L:null,onChange:x,isSelected:M,calculateIndex:O,compare:_,onClose:b}),[S,w,f,c,m,x,M,p,T,g,L,b]);fe(()=>{var B;g&&T.send({type:Sc.UpdateVirtualConfiguration,options:g.options,disabled:(B=g.disabled)!=null?B:null})},[g,g==null?void 0:g.options,g==null?void 0:g.disabled]),fe(()=>{T.state.dataRef.current=k},[k]);let[$,Y,I,V]=we(T,B=>[B.comboboxState,B.buttonElement,B.inputElement,B.optionsElement]),C=Bn.get(null),q=we(C,d.useCallback(B=>C.selectors.isTop(B,e),[C,e]));Ei(q,[Y,I,V],()=>T.actions.closeCombobox());let P=we(T,T.selectors.activeOptionIndex),W=we(T,T.selectors.activeOption),G=d.useMemo(()=>({open:$===de.Open,disabled:f,invalid:c,activeIndex:P,activeOption:W,value:S}),[k,f,S,c,W,$]),[j,F]=tu(),ne=r===null?{}:{ref:r},U=d.useCallback(()=>{if(w!==void 0)return x==null?void 0:x(w)},[x,w]),A=Te();return d.createElement(F,{value:j,props:{htmlFor:I==null?void 0:I.id},slot:{open:$===de.Open,disabled:f}},d.createElement(mc,null,d.createElement(Rr.Provider,{value:k},d.createElement(kc.Provider,{value:T},d.createElement(Ri,{value:Fe($,{[de.Open]:Ue.Open,[de.Closed]:Ue.Closed})},l!=null&&d.createElement(ql,{disabled:f,data:S!=null?{[l]:S}:{},form:s,onReset:U}),A({ourProps:ne,theirProps:E,slot:G,defaultTag:Tg,name:"Combobox"}))))))}let Ig="input";function Ng(n,r){var e,t;let o=Ar("Combobox.Input"),a=Kn("Combobox.Input"),i=d.useId(),s=ai(),{id:l=s||`headlessui-combobox-input-${i}`,onChange:u,displayValue:c,disabled:f=a.disabled||!1,autoFocus:h=!1,type:p="text",...m}=n,[v]=we(o,F=>[F.inputElement]),g=d.useRef(null),y=We(g,r,dc(),o.actions.setInputElement),E=Bt(v),[w,S]=we(o,F=>[F.comboboxState,F.isTyping]),x=rn(),T=Z(()=>{o.actions.onChange(null),o.state.optionsElement&&(o.state.optionsElement.scrollTop=0),o.actions.goToOption({focus:se.Nothing})}),N=d.useMemo(()=>{var F;return typeof c=="function"&&a.value!==void 0?(F=c(a.value))!=null?F:"":typeof a.value=="string"?a.value:""},[a.value,c]);Tr(([F,ne],[U,A])=>{if(o.state.isTyping)return;let B=g.current;B&&((A===de.Open&&ne===de.Closed||F!==U)&&(B.value=F),requestAnimationFrame(()=>{if(o.state.isTyping||!B||(E==null?void 0:E.activeElement)!==B)return;let{selectionStart:K,selectionEnd:J}=B;Math.abs((J??0)-(K??0))===0&&K===0&&B.setSelectionRange(B.value.length,B.value.length)}))},[N,w,E,S]),Tr(([F],[ne])=>{if(F===de.Open&&ne===de.Closed){if(o.state.isTyping)return;let U=g.current;if(!U)return;let A=U.value,{selectionStart:B,selectionEnd:K,selectionDirection:J}=U;U.value="",U.value=A,J!==null?U.setSelectionRange(B,K,J):U.setSelectionRange(B,K)}},[w]);let _=d.useRef(!1),O=Z(()=>{_.current=!0}),M=Z(()=>{x.nextFrame(()=>{_.current=!1})}),L=Z(F=>{switch(o.actions.setIsTyping(!0),F.key){case he.Enter:if(o.state.comboboxState!==de.Open||_.current)return;if(F.preventDefault(),F.stopPropagation(),o.selectors.activeOptionIndex(o.state)===null){o.actions.closeCombobox();return}o.actions.selectActiveOption(),a.mode===st.Single&&o.actions.closeCombobox();break;case he.ArrowDown:return F.preventDefault(),F.stopPropagation(),Fe(o.state.comboboxState,{[de.Open]:()=>o.actions.goToOption({focus:se.Next}),[de.Closed]:()=>o.actions.openCombobox()});case he.ArrowUp:return F.preventDefault(),F.stopPropagation(),Fe(o.state.comboboxState,{[de.Open]:()=>o.actions.goToOption({focus:se.Previous}),[de.Closed]:()=>{Le.flushSync(()=>o.actions.openCombobox()),a.value||o.actions.goToOption({focus:se.Last})}});case he.Home:if(F.shiftKey)break;return F.preventDefault(),F.stopPropagation(),o.actions.goToOption({focus:se.First});case he.PageUp:return F.preventDefault(),F.stopPropagation(),o.actions.goToOption({focus:se.First});case he.End:if(F.shiftKey)break;return F.preventDefault(),F.stopPropagation(),o.actions.goToOption({focus:se.Last});case he.PageDown:return F.preventDefault(),F.stopPropagation(),o.actions.goToOption({focus:se.Last});case he.Escape:return o.state.comboboxState!==de.Open?void 0:(F.preventDefault(),o.state.optionsElement&&!a.optionsPropsRef.current.static&&F.stopPropagation(),a.mode===st.Single&&a.value===null&&T(),o.actions.closeCombobox());case he.Tab:if(o.state.comboboxState!==de.Open)return;a.mode===st.Single&&o.state.activationTrigger!==Ct.Focus&&o.actions.selectActiveOption(),o.actions.closeCombobox();break}}),b=Z(F=>{u==null||u(F),a.mode===st.Single&&F.target.value===""&&T(),o.actions.openCombobox()}),k=Z(F=>{var ne,U,A;let B=(ne=F.relatedTarget)!=null?ne:kt.find(K=>K!==F.currentTarget);if(!((U=o.state.optionsElement)!=null&&U.contains(B))&&!((A=o.state.buttonElement)!=null&&A.contains(B))&&o.state.comboboxState===de.Open)return F.preventDefault(),a.mode===st.Single&&a.value===null&&T(),o.actions.closeCombobox()}),$=Z(F=>{var ne,U,A;let B=(ne=F.relatedTarget)!=null?ne:kt.find(K=>K!==F.currentTarget);(U=o.state.buttonElement)!=null&&U.contains(B)||(A=o.state.optionsElement)!=null&&A.contains(B)||a.disabled||a.immediate&&o.state.comboboxState!==de.Open&&x.microTask(()=>{Le.flushSync(()=>o.actions.openCombobox()),o.actions.setActivationTrigger(Ct.Focus)})}),Y=kr(),I=Jl(),{isFocused:V,focusProps:C}=ti({autoFocus:h}),{isHovered:q,hoverProps:P}=ei({isDisabled:f}),W=we(o,F=>F.optionsElement),G=d.useMemo(()=>({open:w===de.Open,disabled:f,invalid:a.invalid,hover:q,focus:V,autofocus:h}),[a,q,V,h,f,a.invalid]),j=Dr({ref:y,id:l,role:"combobox",type:p,"aria-controls":W==null?void 0:W.id,"aria-expanded":w===de.Open,"aria-activedescendant":we(o,o.selectors.activeDescendantId),"aria-labelledby":Y,"aria-describedby":I,"aria-autocomplete":"list",defaultValue:(t=(e=n.defaultValue)!=null?e:a.defaultValue!==void 0?c==null?void 0:c(a.defaultValue):null)!=null?t:a.defaultValue,disabled:f||void 0,autoFocus:h,onCompositionStart:O,onCompositionEnd:M,onKeyDown:L,onChange:b,onFocus:$,onBlur:k},C,P);return Te()({ourProps:j,theirProps:m,slot:G,defaultTag:Ig,name:"Combobox.Input"})}let $g="button";function Lg(n,r){let e=Ar("Combobox.Button"),t=Kn("Combobox.Button"),[o,a]=d.useState(null),i=We(r,a,e.actions.setButtonElement),s=d.useId(),{id:l=`headlessui-combobox-button-${s}`,disabled:u=t.disabled||!1,autoFocus:c=!1,...f}=n,[h,p,m]=we(e,b=>[b.comboboxState,b.inputElement,b.optionsElement]),v=_u(p),g=h===de.Open;Cu(g,{trigger:o,action:d.useCallback(b=>{if(o!=null&&o.contains(b.target)||p!=null&&p.contains(b.target))return Vt.Ignore;let k=b.target.closest('[role="option"]:not([data-disabled])');return tt(k)?Vt.Select(k):m!=null&&m.contains(b.target)?Vt.Ignore:Vt.Close},[o,p,m]),close:e.actions.closeCombobox,select:e.actions.selectActiveOption});let y=Z(b=>{switch(b.key){case he.Space:case he.Enter:b.preventDefault(),b.stopPropagation(),e.state.comboboxState===de.Closed&&Le.flushSync(()=>e.actions.openCombobox()),v();return;case he.ArrowDown:b.preventDefault(),b.stopPropagation(),e.state.comboboxState===de.Closed&&(Le.flushSync(()=>e.actions.openCombobox()),e.state.dataRef.current.value||e.actions.goToOption({focus:se.First})),v();return;case he.ArrowUp:b.preventDefault(),b.stopPropagation(),e.state.comboboxState===de.Closed&&(Le.flushSync(()=>e.actions.openCombobox()),e.state.dataRef.current.value||e.actions.goToOption({focus:se.Last})),v();return;case he.Escape:if(e.state.comboboxState!==de.Open)return;b.preventDefault(),e.state.optionsElement&&!t.optionsPropsRef.current.static&&b.stopPropagation(),Le.flushSync(()=>e.actions.closeCombobox()),v();return;default:return}}),E=Z(b=>{b.preventDefault(),!Gl(b.currentTarget)&&(b.button===$o.Left&&(e.state.comboboxState===de.Open?e.actions.closeCombobox():e.actions.openCombobox()),v())}),w=kr([l]),{isFocusVisible:S,focusProps:x}=ti({autoFocus:c}),{isHovered:T,hoverProps:N}=ei({isDisabled:u}),{pressed:_,pressProps:O}=Yl({disabled:u}),M=d.useMemo(()=>({open:h===de.Open,active:_||h===de.Open,disabled:u,invalid:t.invalid,value:t.value,hover:T,focus:S}),[t,T,S,_,u,h]),L=Dr({ref:i,id:l,type:Ou(n,o),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":m==null?void 0:m.id,"aria-expanded":h===de.Open,"aria-labelledby":w,disabled:u||void 0,autoFocus:c,onPointerDown:E,onKeyDown:y},x,N,O);return Te()({ourProps:L,theirProps:f,slot:M,defaultTag:$g,name:"Combobox.Button"})}let Fg="div",Ag=on.RenderStrategy|on.Static;function Rg(n,r){var e,t,o;let a=d.useId(),{id:i=`headlessui-combobox-options-${a}`,hold:s=!1,anchor:l,portal:u=!1,modal:c=!0,transition:f=!1,...h}=n,p=Ar("Combobox.Options"),m=Kn("Combobox.Options"),v=cc(l);v&&(u=!0);let[g,y]=pc(v),[E,w]=d.useState(null),S=fc(),x=We(r,v?g:null,p.actions.setOptionsElement,w),[T,N,_,O,M]=we(p,J=>[J.comboboxState,J.inputElement,J.buttonElement,J.optionsElement,J.activationTrigger]),L=Bt(N||_),b=Bt(O),k=Qn(),[$,Y]=Ci(f,E,k!==null?(k&Ue.Open)===Ue.Open:T===de.Open);gi($,N,p.actions.closeCombobox);let I=m.__demoMode?!1:c&&T===de.Open;Si(I,b);let V=m.__demoMode?!1:c&&T===de.Open;vi(V,{allowed:d.useCallback(()=>[N,_,O],[N,_,O])}),fe(()=>{var J;m.optionsPropsRef.current.static=(J=n.static)!=null?J:!1},[m.optionsPropsRef,n.static]),fe(()=>{m.optionsPropsRef.current.hold=s},[m.optionsPropsRef,s]),Gm(T===de.Open,{container:O,accept(J){return J.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:J.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(J){J.setAttribute("role","none")}});let C=kr([_==null?void 0:_.id]),q=d.useMemo(()=>({open:T===de.Open,option:void 0}),[T]),P=Z(()=>{p.actions.setActivationTrigger(Ct.Pointer)}),W=Z(J=>{J.preventDefault(),p.actions.setActivationTrigger(Ct.Pointer)}),G=Dr(v?S():{},{"aria-labelledby":C,role:"listbox","aria-multiselectable":m.mode===st.Multi?!0:void 0,id:i,ref:x,style:{...h.style,...y,"--input-width":si(N,!0).width,"--button-width":si(_,!0).width},onWheel:M===Ct.Pointer?void 0:P,onMouseDown:W,...ki(Y)}),j=$&&T===de.Closed,F=Io(j,(e=m.virtual)==null?void 0:e.options),ne=Io(j,m.value),U=Z(J=>m.compare(ne,J)),A=d.useMemo(()=>{if(!m.virtual)return m;if(F===void 0)throw new Error("Missing `options` in virtual mode");return F!==m.virtual.options?{...m,virtual:{...m.virtual,options:F}}:m},[m,F,(t=m.virtual)==null?void 0:t.options]);m.virtual&&Object.assign(h,{children:d.createElement(Rr.Provider,{value:A},d.createElement(Mg,{slot:q},h.children))});let B=Te(),K=d.useMemo(()=>m.mode===st.Multi?m:{...m,isSelected:U},[m,U]);return d.createElement(Wi,{enabled:u?n.static||$:!1,ownerDocument:L},d.createElement(Rr.Provider,{value:K},B({ourProps:G,theirProps:{...h,children:d.createElement(fg,{freeze:j},typeof h.children=="function"?(o=h.children)==null?void 0:o.call(h,q):h.children)},slot:q,defaultTag:Fg,features:Ag,visible:$,name:"Combobox.Options"})))}let Yg="div";function Wg(n,r){var e,t,o;let a=Kn("Combobox.Option"),i=Ar("Combobox.Option"),s=d.useId(),{id:l=`headlessui-combobox-option-${s}`,value:u,disabled:c=(o=(t=(e=a.virtual)==null?void 0:e.disabled)==null?void 0:t.call(e,u))!=null?o:!1,order:f=null,...h}=n,[p]=we(i,Y=>[Y.inputElement]),m=_u(p),v=we(i,d.useCallback(Y=>i.selectors.isActive(Y,u,l),[u,l])),g=a.isSelected(u),y=d.useRef(null),E=Yt({disabled:c,value:u,domRef:y,order:f}),w=d.useContext(_c),S=We(r,y,w?w.measureElement:null),x=Z(()=>{i.actions.setIsTyping(!1),i.actions.onChange(u)});fe(()=>i.actions.registerOption(l,E),[E,l]);let T=we(i,d.useCallback(Y=>i.selectors.shouldScrollIntoView(Y,u,l),[u,l]));fe(()=>{if(T)return ut().requestAnimationFrame(()=>{var Y,I;(I=(Y=y.current)==null?void 0:Y.scrollIntoView)==null||I.call(Y,{block:"nearest"})})},[T,y]);let N=Z(Y=>{Y.preventDefault(),Y.button===$o.Left&&(c||(x(),xi()||requestAnimationFrame(()=>m()),a.mode===st.Single&&i.actions.closeCombobox()))}),_=Z(()=>{if(c)return i.actions.goToOption({focus:se.Nothing});let Y=a.calculateIndex(u);i.actions.goToOption({focus:se.Specific,idx:Y})}),O=Tu(),M=Z(Y=>O.update(Y)),L=Z(Y=>{if(!O.wasMoved(Y)||c||v&&i.state.activationTrigger===Ct.Pointer)return;let I=a.calculateIndex(u);i.actions.goToOption({focus:se.Specific,idx:I},Ct.Pointer)}),b=Z(Y=>{O.wasMoved(Y)&&(c||v&&(a.optionsPropsRef.current.hold||i.state.activationTrigger===Ct.Pointer&&i.actions.goToOption({focus:se.Nothing})))}),k=d.useMemo(()=>({active:v,focus:v,selected:g,disabled:c}),[v,g,c]),$={id:l,ref:S,role:"option",tabIndex:c===!0?void 0:-1,"aria-disabled":c===!0?!0:void 0,"aria-selected":g,disabled:void 0,onMouseDown:N,onFocus:_,onPointerEnter:M,onMouseEnter:M,onPointerMove:L,onMouseMove:L,onPointerLeave:b,onMouseLeave:b};return Te()({ourProps:$,theirProps:h,slot:k,defaultTag:Yg,name:"Combobox.Option"})}let jg=_e(Pg),Hg=_e(Lg),Oc=_e(Ng),Bg=Eo,Mc=_e(Rg),Tc=_e(Wg),Vg=Object.assign(jg,{Input:Oc,Button:Hg,Label:Bg,Options:Mc,Option:Tc});function zg(n,r=typeof document<"u"?document.defaultView:null,e){let t=Or(n,"escape");Di(r,"keydown",o=>{t&&(o.defaultPrevented||o.key===he.Escape&&e(o))})}function qg(){var n;let[r]=d.useState(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)"):null),[e,t]=d.useState((n=r==null?void 0:r.matches)!=null?n:!1);return fe(()=>{if(!r)return;function o(a){t(a.matches)}return r.addEventListener("change",o),()=>r.removeEventListener("change",o)},[r]),e}function Ug({defaultContainers:n=[],portals:r,mainTreeNode:e}={}){let t=Bt(e),o=Z(()=>{var a,i;let s=[];for(let l of n)l!==null&&(Wt(l)?s.push(l):"current"in l&&Wt(l.current)&&s.push(l.current));if(r!=null&&r.current)for(let l of r.current)s.push(l);for(let l of(a=t==null?void 0:t.querySelectorAll("html > *, body > *"))!=null?a:[])l!==document.body&&l!==document.head&&Wt(l)&&l.id!=="headlessui-portal-root"&&(e&&(l.contains(e)||l.contains((i=e==null?void 0:e.getRootNode())==null?void 0:i.host))||s.some(u=>l.contains(u))||s.push(l));return s});return{resolveContainers:o,contains:Z(a=>o().some(i=>i.contains(a)))}}let Pc=d.createContext(null);function Ic({children:n,node:r}){let[e,t]=d.useState(null),o=Nc(r??e);return d.createElement(Pc.Provider,{value:o},n,o===null&&d.createElement(Sr,{features:jn.Hidden,ref:a=>{var i,s;if(a){for(let l of(s=(i=En(a))==null?void 0:i.querySelectorAll("html > *, body > *"))!=null?s:[])if(l!==document.body&&l!==document.head&&Wt(l)&&l!=null&&l.contains(a)){t(l);break}}}}))}function Nc(n=null){var r;return(r=d.useContext(Pc))!=null?r:n}function Hi(){let n=d.useRef(!1);return fe(()=>(n.current=!0,()=>{n.current=!1}),[]),n}var Yr=(n=>(n[n.Forwards=0]="Forwards",n[n.Backwards=1]="Backwards",n))(Yr||{});function Qg(){let n=d.useRef(0);return Du(!0,"keydown",r=>{r.key==="Tab"&&(n.current=r.shiftKey?1:0)},!0),n}function $c(n){if(!n)return new Set;if(typeof n=="function")return new Set(n());let r=new Set;for(let e of n.current)Wt(e.current)&&r.add(e.current);return r}let Gg="div";var Cn=(n=>(n[n.None=0]="None",n[n.InitialFocus=1]="InitialFocus",n[n.TabLock=2]="TabLock",n[n.FocusLock=4]="FocusLock",n[n.RestoreFocus=8]="RestoreFocus",n[n.AutoFocus=16]="AutoFocus",n))(Cn||{});function Kg(n,r){let e=d.useRef(null),t=We(e,r),{initialFocus:o,initialFocusFallback:a,containers:i,features:s=15,...l}=n;Fr()||(s=0);let u=Bt(e);eb(s,{ownerDocument:u});let c=tb(s,{ownerDocument:u,container:e,initialFocus:o,initialFocusFallback:a});nb(s,{ownerDocument:u,container:e,containers:i,previousActiveElement:c});let f=Qg(),h=Z(E=>{if(!tt(e.current))return;let w=e.current;(S=>S())(()=>{Fe(f.current,{[Yr.Forwards]:()=>{Vn(w,bt.First,{skipElements:[E.relatedTarget,a]})},[Yr.Backwards]:()=>{Vn(w,bt.Last,{skipElements:[E.relatedTarget,a]})}})})}),p=Or(!!(s&2),"focus-trap#tab-lock"),m=rn(),v=d.useRef(!1),g={ref:t,onKeyDown(E){E.key=="Tab"&&(v.current=!0,m.requestAnimationFrame(()=>{v.current=!1}))},onBlur(E){if(!(s&4))return;let w=$c(i);tt(e.current)&&w.add(e.current);let S=E.relatedTarget;jt(S)&&S.dataset.headlessuiFocusGuard!=="true"&&(Lc(w,S)||(v.current?Vn(e.current,Fe(f.current,{[Yr.Forwards]:()=>bt.Next,[Yr.Backwards]:()=>bt.Previous})|bt.WrapAround,{relativeTo:E.target}):jt(E.target)&&Ht(E.target)))}},y=Te();return d.createElement(d.Fragment,null,p&&d.createElement(Sr,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:h,features:jn.Focusable}),y({ourProps:g,theirProps:l,defaultTag:Gg,name:"FocusTrap"}),p&&d.createElement(Sr,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:h,features:jn.Focusable}))}let Xg=_e(Kg),Jg=Object.assign(Xg,{features:Cn});function Zg(n=!0){let r=d.useRef(kt.slice());return Tr(([e],[t])=>{t===!0&&e===!1&&vo(()=>{r.current.splice(0)}),t===!1&&e===!0&&(r.current=kt.slice())},[n,kt,r]),Z(()=>{var e;return(e=r.current.find(t=>t!=null&&t.isConnected))!=null?e:null})}function eb(n,{ownerDocument:r}){let e=!!(n&8),t=Zg(e);Tr(()=>{e||(r==null?void 0:r.activeElement)===(r==null?void 0:r.body)&&Ht(t())},[e]),Lo(()=>{e&&Ht(t())})}function tb(n,{ownerDocument:r,container:e,initialFocus:t,initialFocusFallback:o}){let a=d.useRef(null),i=Or(!!(n&1),"focus-trap#initial-focus"),s=Hi();return Tr(()=>{if(n===0)return;if(!i){o!=null&&o.current&&Ht(o.current);return}let l=e.current;l&&vo(()=>{if(!s.current)return;let u=r==null?void 0:r.activeElement;if(t!=null&&t.current){if((t==null?void 0:t.current)===u){a.current=u;return}}else if(l.contains(u)){a.current=u;return}if(t!=null&&t.current)Ht(t.current);else{if(n&16){if(Vn(l,bt.First|bt.AutoFocus)!==bi.Error)return}else if(Vn(l,bt.First)!==bi.Error)return;if(o!=null&&o.current&&(Ht(o.current),(r==null?void 0:r.activeElement)===o.current))return;console.warn("There are no focusable elements inside the <FocusTrap />")}a.current=r==null?void 0:r.activeElement})},[o,i,n]),a}function nb(n,{ownerDocument:r,container:e,containers:t,previousActiveElement:o}){let a=Hi(),i=!!(n&4);Di(r==null?void 0:r.defaultView,"focus",s=>{if(!i||!a.current)return;let l=$c(t);tt(e.current)&&l.add(e.current);let u=o.current;if(!u)return;let c=s.target;tt(c)?Lc(l,c)?(o.current=c,Ht(c)):(s.preventDefault(),s.stopPropagation(),Ht(u)):Ht(o.current)},!0)}function Lc(n,r){for(let e of n)if(e.contains(r))return!0;return!1}function Fc(n){var r;return!!(n.enter||n.enterFrom||n.enterTo||n.leave||n.leaveFrom||n.leaveTo)||((r=n.as)!=null?r:Rc)!==d.Fragment||d.Children.count(n.children)===1}let Fo=d.createContext(null);Fo.displayName="TransitionContext";var rb=(n=>(n.Visible="visible",n.Hidden="hidden",n))(rb||{});function ob(){let n=d.useContext(Fo);if(n===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return n}function ab(){let n=d.useContext(Ao);if(n===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return n}let Ao=d.createContext(null);Ao.displayName="NestingContext";function Ro(n){return"children"in n?Ro(n.children):n.current.filter(({el:r})=>r.current!==null).filter(({state:r})=>r==="visible").length>0}function Ac(n,r){let e=Yt(n),t=d.useRef([]),o=Hi(),a=rn(),i=Z((p,m=an.Hidden)=>{let v=t.current.findIndex(({el:g})=>g===p);v!==-1&&(Fe(m,{[an.Unmount](){t.current.splice(v,1)},[an.Hidden](){t.current[v].state="hidden"}}),a.microTask(()=>{var g;!Ro(t)&&o.current&&((g=e.current)==null||g.call(e))}))}),s=Z(p=>{let m=t.current.find(({el:v})=>v===p);return m?m.state!=="visible"&&(m.state="visible"):t.current.push({el:p,state:"visible"}),()=>i(p,an.Unmount)}),l=d.useRef([]),u=d.useRef(Promise.resolve()),c=d.useRef({enter:[],leave:[]}),f=Z((p,m,v)=>{l.current.splice(0),r&&(r.chains.current[m]=r.chains.current[m].filter(([g])=>g!==p)),r==null||r.chains.current[m].push([p,new Promise(g=>{l.current.push(g)})]),r==null||r.chains.current[m].push([p,new Promise(g=>{Promise.all(c.current[m].map(([y,E])=>E)).then(()=>g())})]),m==="enter"?u.current=u.current.then(()=>r==null?void 0:r.wait.current).then(()=>v(m)):v(m)}),h=Z((p,m,v)=>{Promise.all(c.current[m].splice(0).map(([g,y])=>y)).then(()=>{var g;(g=l.current.shift())==null||g()}).then(()=>v(m))});return d.useMemo(()=>({children:t,register:s,unregister:i,onStart:f,onStop:h,wait:u,chains:c}),[s,i,t,f,h,c,u])}let Rc=d.Fragment,Yc=on.RenderStrategy;function ib(n,r){var e,t;let{transition:o=!0,beforeEnter:a,afterEnter:i,beforeLeave:s,afterLeave:l,enter:u,enterFrom:c,enterTo:f,entered:h,leave:p,leaveFrom:m,leaveTo:v,...g}=n,[y,E]=d.useState(null),w=d.useRef(null),S=Fc(n),x=We(...S?[w,r,E]:r===null?[]:[r]),T=(e=g.unmount)==null||e?an.Unmount:an.Hidden,{show:N,appear:_,initial:O}=ob(),[M,L]=d.useState(N?"visible":"hidden"),b=ab(),{register:k,unregister:$}=b;fe(()=>k(w),[k,w]),fe(()=>{if(T===an.Hidden&&w.current){if(N&&M!=="visible"){L("visible");return}return Fe(M,{hidden:()=>$(w),visible:()=>k(w)})}},[M,w,k,$,N,T]);let Y=Fr();fe(()=>{if(S&&Y&&M==="visible"&&w.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[w,M,Y,S]);let I=O&&!_,V=_&&N&&O,C=d.useRef(!1),q=Ac(()=>{C.current||(L("hidden"),$(w))},b),P=Z(A=>{C.current=!0;let B=A?"enter":"leave";q.onStart(w,B,K=>{K==="enter"?a==null||a():K==="leave"&&(s==null||s())})}),W=Z(A=>{let B=A?"enter":"leave";C.current=!1,q.onStop(w,B,K=>{K==="enter"?i==null||i():K==="leave"&&(l==null||l())}),B==="leave"&&!Ro(q)&&(L("hidden"),$(w))});d.useEffect(()=>{S&&o||(P(N),W(N))},[N,S,o]);let G=!(!o||!S||!Y||I),[,j]=Ci(G,y,N,{start:P,end:W}),F=sn({ref:x,className:((t=ri(g.className,V&&u,V&&c,j.enter&&u,j.enter&&j.closed&&c,j.enter&&!j.closed&&f,j.leave&&p,j.leave&&!j.closed&&m,j.leave&&j.closed&&v,!j.transition&&N&&h))==null?void 0:t.trim())||void 0,...ki(j)}),ne=0;M==="visible"&&(ne|=Ue.Open),M==="hidden"&&(ne|=Ue.Closed),N&&M==="hidden"&&(ne|=Ue.Opening),!N&&M==="visible"&&(ne|=Ue.Closing);let U=Te();return d.createElement(Ao.Provider,{value:q},d.createElement(Ri,{value:ne},U({ourProps:F,theirProps:g,defaultTag:Rc,features:Yc,visible:M==="visible",name:"Transition.Child"})))}function sb(n,r){let{show:e,appear:t=!1,unmount:o=!0,...a}=n,i=d.useRef(null),s=Fc(n),l=We(...s?[i,r]:r===null?[]:[r]);Fr();let u=Qn();if(e===void 0&&u!==null&&(e=(u&Ue.Open)===Ue.Open),e===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[c,f]=d.useState(e?"visible":"hidden"),h=Ac(()=>{e||f("hidden")}),[p,m]=d.useState(!0),v=d.useRef([e]);fe(()=>{p!==!1&&v.current[v.current.length-1]!==e&&(v.current.push(e),m(!1))},[v,e]);let g=d.useMemo(()=>({show:e,appear:t,initial:p}),[e,t,p]);fe(()=>{e?f("visible"):!Ro(h)&&i.current!==null&&f("hidden")},[e,h]);let y={unmount:o},E=Z(()=>{var x;p&&m(!1),(x=n.beforeEnter)==null||x.call(n)}),w=Z(()=>{var x;p&&m(!1),(x=n.beforeLeave)==null||x.call(n)}),S=Te();return d.createElement(Ao.Provider,{value:h},d.createElement(Fo.Provider,{value:g},S({ourProps:{...y,as:d.Fragment,children:d.createElement(Wc,{ref:l,...y,...a,beforeEnter:E,beforeLeave:w})},theirProps:{},defaultTag:d.Fragment,features:Yc,visible:c==="visible",name:"Transition"})))}function lb(n,r){let e=d.useContext(Fo)!==null,t=Qn()!==null;return d.createElement(d.Fragment,null,!e&&t?d.createElement(Bi,{ref:r,...n}):d.createElement(Wc,{ref:r,...n}))}let Bi=_e(sb),Wc=_e(ib),Vi=_e(lb),jc=Object.assign(Bi,{Child:Vi,Root:Bi});var ub=(n=>(n[n.Open=0]="Open",n[n.Closed=1]="Closed",n))(ub||{}),cb=(n=>(n[n.SetTitleId=0]="SetTitleId",n))(cb||{});let db={0(n,r){return n.titleId===r.id?n:{...n,titleId:r.id}}},zi=d.createContext(null);zi.displayName="DialogContext";function Yo(n){let r=d.useContext(zi);if(r===null){let e=new Error(`<${n} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,Yo),e}return r}function fb(n,r){return Fe(r.type,db,n,r)}let Hc=_e(function(n,r){let e=d.useId(),{id:t=`headlessui-dialog-${e}`,open:o,onClose:a,initialFocus:i,role:s="dialog",autoFocus:l=!0,__demoMode:u=!1,unmount:c=!1,...f}=n,h=d.useRef(!1);s=function(){return s==="dialog"||s==="alertdialog"?s:(h.current||(h.current=!0,console.warn(`Invalid role [${s}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")}();let p=Qn();o===void 0&&p!==null&&(o=(p&Ue.Open)===Ue.Open);let m=d.useRef(null),v=We(m,r),g=Bt(m),y=o?0:1,[E,w]=d.useReducer(fb,{titleId:null,descriptionId:null,panelRef:d.createRef()}),S=Z(()=>a(!1)),x=Z(j=>w({type:0,id:j})),T=Fr()?y===0:!1,[N,_]=Dg(),O={get current(){var j;return(j=E.panelRef.current)!=null?j:m.current}},M=Nc(),{resolveContainers:L}=Ug({mainTreeNode:M,portals:N,defaultContainers:[O]}),b=p!==null?(p&Ue.Closing)===Ue.Closing:!1;vi(u||b?!1:T,{allowed:Z(()=>{var j,F;return[(F=(j=m.current)==null?void 0:j.closest("[data-headlessui-portal]"))!=null?F:null]}),disallowed:Z(()=>{var j;return[(j=M==null?void 0:M.closest("body > *:not(#headlessui-portal-root)"))!=null?j:null]})});let k=Bn.get(null);fe(()=>{if(T)return k.actions.push(t),()=>k.actions.pop(t)},[k,t,T]);let $=we(k,d.useCallback(j=>k.selectors.isTop(j,t),[k,t]));Ei($,L,j=>{j.preventDefault(),S()}),zg($,g==null?void 0:g.defaultView,j=>{j.preventDefault(),j.stopPropagation(),document.activeElement&&"blur"in document.activeElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur(),S()}),Si(u||b?!1:T,g,L),gi(T,m,S);let[Y,I]=qh(),V=d.useMemo(()=>[{dialogState:y,close:S,setTitleId:x,unmount:c},E],[y,E,S,x,c]),C=d.useMemo(()=>({open:y===0}),[y]),q={ref:v,id:t,role:s,tabIndex:-1,"aria-modal":u?void 0:y===0?!0:void 0,"aria-labelledby":E.titleId,"aria-describedby":Y,unmount:c},P=!qg(),W=Cn.None;T&&!u&&(W|=Cn.RestoreFocus,W|=Cn.TabLock,l&&(W|=Cn.AutoFocus),P&&(W|=Cn.InitialFocus));let G=Te();return d.createElement(pg,null,d.createElement(yc,{force:!0},d.createElement(Wi,null,d.createElement(zi.Provider,{value:V},d.createElement(Ec,{target:m},d.createElement(yc,{force:!1},d.createElement(I,{slot:C},d.createElement(_,null,d.createElement(Jg,{initialFocus:i,initialFocusFallback:m,containers:L,features:W},d.createElement(em,{value:S},G({ourProps:q,theirProps:f,slot:C,defaultTag:pb,features:hb,visible:y===0,name:"Dialog"})))))))))))}),pb="div",hb=on.RenderStrategy|on.Static;function mb(n,r){let{transition:e=!1,open:t,...o}=n,a=Qn(),i=n.hasOwnProperty("open")||a!==null,s=n.hasOwnProperty("onClose");if(!i&&!s)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!i)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!s)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!a&&typeof n.open!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${n.open}`);if(typeof n.onClose!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${n.onClose}`);return(t!==void 0||e)&&!o.static?d.createElement(Ic,null,d.createElement(jc,{show:t,transition:e,unmount:o.unmount},d.createElement(Hc,{ref:r,...o}))):d.createElement(Ic,null,d.createElement(Hc,{ref:r,open:t,...o}))}let vb="div";function gb(n,r){let e=d.useId(),{id:t=`headlessui-dialog-panel-${e}`,transition:o=!1,...a}=n,[{dialogState:i,unmount:s},l]=Yo("Dialog.Panel"),u=We(r,l.panelRef),c=d.useMemo(()=>({open:i===0}),[i]),f=Z(g=>{g.stopPropagation()}),h={ref:u,id:t,onClick:f},p=o?Vi:d.Fragment,m=o?{unmount:s}:{},v=Te();return d.createElement(p,{...m},v({ourProps:h,theirProps:a,slot:c,defaultTag:vb,name:"Dialog.Panel"}))}let bb="div";function yb(n,r){let{transition:e=!1,...t}=n,[{dialogState:o,unmount:a}]=Yo("Dialog.Backdrop"),i=d.useMemo(()=>({open:o===0}),[o]),s={ref:r,"aria-hidden":!0},l=e?Vi:d.Fragment,u=e?{unmount:a}:{},c=Te();return d.createElement(l,{...u},c({ourProps:s,theirProps:t,slot:i,defaultTag:bb,name:"Dialog.Backdrop"}))}let wb="h2";function xb(n,r){let e=d.useId(),{id:t=`headlessui-dialog-title-${e}`,...o}=n,[{dialogState:a,setTitleId:i}]=Yo("Dialog.Title"),s=We(r);d.useEffect(()=>(i(t),()=>i(null)),[t,i]);let l=d.useMemo(()=>({open:a===0}),[a]),u={ref:s,id:t};return Te()({ourProps:u,theirProps:o,slot:l,defaultTag:wb,name:"Dialog.Title"})}let Eb=_e(mb),Bc=_e(gb);_e(yb);let Vc=_e(xb),Wr=Object.assign(Eb,{Panel:Bc,Title:Vc,Description:Zl});function Db(n,r){let e=d.useRef({left:0,top:0});if(fe(()=>{if(!r)return;let o=r.getBoundingClientRect();o&&(e.current=o)},[n,r]),r==null||!n||r===document.activeElement)return!1;let t=r.getBoundingClientRect();return t.top!==e.current.top||t.left!==e.current.left}let zc=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function qc(n){var r,e;let t=(r=n.innerText)!=null?r:"",o=n.cloneNode(!0);if(!tt(o))return t;let a=!1;for(let s of o.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))s.remove(),a=!0;let i=a?(e=o.innerText)!=null?e:"":t;return zc.test(i)&&(i=i.replace(zc,"")),i}function Sb(n){let r=n.getAttribute("aria-label");if(typeof r=="string")return r.trim();let e=n.getAttribute("aria-labelledby");if(e){let t=e.split(" ").map(o=>{let a=document.getElementById(o);if(a){let i=a.getAttribute("aria-label");return typeof i=="string"?i.trim():qc(a).trim()}return null}).filter(Boolean);if(t.length>0)return t.join(", ")}return qc(n).trim()}function kb(n){let r=d.useRef(""),e=d.useRef("");return Z(()=>{let t=n.current;if(!t)return"";let o=t.innerText;if(r.current===o)return e.current;let a=Sb(t).trim().toLowerCase();return r.current=o,e.current=a,a})}var Cb=Object.defineProperty,_b=(n,r,e)=>r in n?Cb(n,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[r]=e,Uc=(n,r,e)=>(_b(n,typeof r!="symbol"?r+"":r,e),e),Ke=(n=>(n[n.Open=0]="Open",n[n.Closed=1]="Closed",n))(Ke||{}),_t=(n=>(n[n.Single=0]="Single",n[n.Multi=1]="Multi",n))(_t||{}),Wo=(n=>(n[n.Pointer=0]="Pointer",n[n.Other=1]="Other",n))(Wo||{}),Qc=(n=>(n[n.OpenListbox=0]="OpenListbox",n[n.CloseListbox=1]="CloseListbox",n[n.GoToOption=2]="GoToOption",n[n.Search=3]="Search",n[n.ClearSearch=4]="ClearSearch",n[n.RegisterOptions=5]="RegisterOptions",n[n.UnregisterOptions=6]="UnregisterOptions",n[n.SetButtonElement=7]="SetButtonElement",n[n.SetOptionsElement=8]="SetOptionsElement",n[n.SortOptions=9]="SortOptions",n))(Qc||{});function Gc(n,r=e=>e){let e=n.activeOptionIndex!==null?n.options[n.activeOptionIndex]:null,t=wi(r(n.options.slice()),a=>a.dataRef.current.domRef.current),o=e?t.indexOf(e):null;return o===-1&&(o=null),{options:t,activeOptionIndex:o}}let Ob={1(n){return n.dataRef.current.disabled||n.listboxState===1?n:{...n,activeOptionIndex:null,pendingFocus:{focus:se.Nothing},listboxState:1,__demoMode:!1}},0(n,r){if(n.dataRef.current.disabled||n.listboxState===0)return n;let e=n.activeOptionIndex,{isSelected:t}=n.dataRef.current,o=n.options.findIndex(a=>t(a.dataRef.current.value));return o!==-1&&(e=o),{...n,pendingFocus:r.focus,listboxState:0,activeOptionIndex:e,__demoMode:!1}},2(n,r){var e,t,o,a,i;if(n.dataRef.current.disabled||n.listboxState===1)return n;let s={...n,searchQuery:"",activationTrigger:(e=r.trigger)!=null?e:1,__demoMode:!1};if(r.focus===se.Nothing)return{...s,activeOptionIndex:null};if(r.focus===se.Specific)return{...s,activeOptionIndex:n.options.findIndex(c=>c.id===r.id)};if(r.focus===se.Previous){let c=n.activeOptionIndex;if(c!==null){let f=n.options[c].dataRef.current.domRef,h=Gn(r,{resolveItems:()=>n.options,resolveActiveIndex:()=>n.activeOptionIndex,resolveId:p=>p.id,resolveDisabled:p=>p.dataRef.current.disabled});if(h!==null){let p=n.options[h].dataRef.current.domRef;if(((t=f.current)==null?void 0:t.previousElementSibling)===p.current||((o=p.current)==null?void 0:o.previousElementSibling)===null)return{...s,activeOptionIndex:h}}}}else if(r.focus===se.Next){let c=n.activeOptionIndex;if(c!==null){let f=n.options[c].dataRef.current.domRef,h=Gn(r,{resolveItems:()=>n.options,resolveActiveIndex:()=>n.activeOptionIndex,resolveId:p=>p.id,resolveDisabled:p=>p.dataRef.current.disabled});if(h!==null){let p=n.options[h].dataRef.current.domRef;if(((a=f.current)==null?void 0:a.nextElementSibling)===p.current||((i=p.current)==null?void 0:i.nextElementSibling)===null)return{...s,activeOptionIndex:h}}}}let l=Gc(n),u=Gn(r,{resolveItems:()=>l.options,resolveActiveIndex:()=>l.activeOptionIndex,resolveId:c=>c.id,resolveDisabled:c=>c.dataRef.current.disabled});return{...s,...l,activeOptionIndex:u}},3:(n,r)=>{if(n.dataRef.current.disabled||n.listboxState===1)return n;let e=n.searchQuery!==""?0:1,t=n.searchQuery+r.value.toLowerCase(),o=(n.activeOptionIndex!==null?n.options.slice(n.activeOptionIndex+e).concat(n.options.slice(0,n.activeOptionIndex+e)):n.options).find(i=>{var s;return!i.dataRef.current.disabled&&((s=i.dataRef.current.textValue)==null?void 0:s.startsWith(t))}),a=o?n.options.indexOf(o):-1;return a===-1||a===n.activeOptionIndex?{...n,searchQuery:t}:{...n,searchQuery:t,activeOptionIndex:a,activationTrigger:1}},4(n){return n.dataRef.current.disabled||n.listboxState===1||n.searchQuery===""?n:{...n,searchQuery:""}},5:(n,r)=>{let e=n.options.concat(r.options),t=n.activeOptionIndex;if(n.pendingFocus.focus!==se.Nothing&&(t=Gn(n.pendingFocus,{resolveItems:()=>e,resolveActiveIndex:()=>n.activeOptionIndex,resolveId:o=>o.id,resolveDisabled:o=>o.dataRef.current.disabled})),n.activeOptionIndex===null){let{isSelected:o}=n.dataRef.current;if(o){let a=e.findIndex(i=>o==null?void 0:o(i.dataRef.current.value));a!==-1&&(t=a)}}return{...n,options:e,activeOptionIndex:t,pendingFocus:{focus:se.Nothing},pendingShouldSort:!0}},6:(n,r)=>{let e=n.options,t=[],o=new Set(r.options);for(let[a,i]of e.entries())if(o.has(i.id)&&(t.push(a),o.delete(i.id),o.size===0))break;if(t.length>0){e=e.slice();for(let a of t.reverse())e.splice(a,1)}return{...n,options:e,activationTrigger:1}},7:(n,r)=>n.buttonElement===r.element?n:{...n,buttonElement:r.element},8:(n,r)=>n.optionsElement===r.element?n:{...n,optionsElement:r.element},9:n=>n.pendingShouldSort?{...n,...Gc(n),pendingShouldSort:!1}:n},Mb=class Wf extends ui{constructor(r){super(r),Uc(this,"actions",{onChange:e=>{let{onChange:t,compare:o,mode:a,value:i}=this.state.dataRef.current;return Fe(a,{0:()=>t==null?void 0:t(e),1:()=>{let s=i.slice(),l=s.findIndex(u=>o(u,e));return l===-1?s.push(e):s.splice(l,1),t==null?void 0:t(s)}})},registerOption:di(()=>{let e=[],t=new Set;return[(o,a)=>{t.has(a)||(t.add(a),e.push({id:o,dataRef:a}))},()=>(t.clear(),this.send({type:5,options:e.splice(0)}))]}),unregisterOption:di(()=>{let e=[];return[t=>e.push(t),()=>{this.send({type:6,options:e.splice(0)})}]}),goToOption:di(()=>{let e=null;return[(t,o)=>{e={type:2,...t,trigger:o}},()=>e&&this.send(e)]}),closeListbox:()=>{this.send({type:1})},openListbox:e=>{this.send({type:0,focus:e})},selectActiveOption:()=>{if(this.state.activeOptionIndex!==null){let{dataRef:e,id:t}=this.state.options[this.state.activeOptionIndex];this.actions.onChange(e.current.value),this.send({type:2,focus:se.Specific,id:t})}},selectOption:e=>{let t=this.state.options.find(o=>o.id===e);t&&this.actions.onChange(t.dataRef.current.value)},search:e=>{this.send({type:3,value:e})},clearSearch:()=>{this.send({type:4})},setButtonElement:e=>{this.send({type:7,element:e})},setOptionsElement:e=>{this.send({type:8,element:e})}}),Uc(this,"selectors",{activeDescendantId(e){var t;let o=e.activeOptionIndex,a=e.options;return o===null||(t=a[o])==null?void 0:t.id},isActive(e,t){var o;let a=e.activeOptionIndex,i=e.options;return a!==null?((o=i[a])==null?void 0:o.id)===t:!1},shouldScrollIntoView(e,t){return e.__demoMode||e.listboxState!==0||e.activationTrigger===0?!1:this.isActive(e,t)}}),this.on(5,()=>{requestAnimationFrame(()=>{this.send({type:9})})});{let e=this.state.id,t=Bn.get(null);this.disposables.add(t.on(fi.Push,o=>{!t.selectors.isTop(o,e)&&this.state.listboxState===0&&this.actions.closeListbox()})),this.on(0,()=>t.actions.push(e)),this.on(1,()=>t.actions.pop(e))}}static new({id:r,__demoMode:e=!1}){return new Wf({id:r,dataRef:{current:{}},listboxState:e?0:1,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1,buttonElement:null,optionsElement:null,pendingShouldSort:!1,pendingFocus:{focus:se.Nothing},__demoMode:e})}reduce(r,e){return Fe(e.type,Ob,r,e)}};const Kc=d.createContext(null);function qi(n){let r=d.useContext(Kc);if(r===null){let e=new Error(`<${n} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,Xc),e}return r}function Xc({id:n,__demoMode:r=!1}){let e=d.useMemo(()=>Mb.new({id:n,__demoMode:r}),[]);return Lo(()=>e.dispose()),e}let jo=d.createContext(null);jo.displayName="ListboxDataContext";function jr(n){let r=d.useContext(jo);if(r===null){let e=new Error(`<${n} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,jr),e}return r}let Tb=d.Fragment;function Pb(n,r){let e=d.useId(),t=go(),{value:o,defaultValue:a,form:i,name:s,onChange:l,by:u,invalid:c=!1,disabled:f=t||!1,horizontal:h=!1,multiple:p=!1,__demoMode:m=!1,...v}=n;const g=h?"horizontal":"vertical";let y=We(r),E=Hl(a),[w=p?[]:void 0,S]=jl(o,l,E),x=Xc({id:e,__demoMode:m}),T=d.useRef({static:!1,hold:!1}),N=d.useRef(new Map),_=lu(u),O=d.useCallback(G=>Fe(M.mode,{[_t.Multi]:()=>w.some(j=>_(j,G)),[_t.Single]:()=>_(w,G)}),[w]),M=d.useMemo(()=>({value:w,disabled:f,invalid:c,mode:p?_t.Multi:_t.Single,orientation:g,onChange:S,compare:_,isSelected:O,optionsPropsRef:T,listRef:N}),[w,f,c,p,g,S,_,O,T,N]);fe(()=>{x.state.dataRef.current=M},[M]);let L=we(x,G=>G.listboxState),b=Bn.get(null),k=we(b,d.useCallback(G=>b.selectors.isTop(G,e),[b,e])),[$,Y]=we(x,G=>[G.buttonElement,G.optionsElement]);Ei(k,[$,Y],(G,j)=>{x.send({type:Qc.CloseListbox}),xu(j,yi.Loose)||(G.preventDefault(),$==null||$.focus())});let I=d.useMemo(()=>({open:L===Ke.Open,disabled:f,invalid:c,value:w}),[L,f,c,w]),[V,C]=tu({inherit:!0}),q={ref:y},P=d.useCallback(()=>{if(E!==void 0)return S==null?void 0:S(E)},[S,E]),W=Te();return d.createElement(C,{value:V,props:{htmlFor:$==null?void 0:$.id},slot:{open:L===Ke.Open,disabled:f}},d.createElement(mc,null,d.createElement(Kc.Provider,{value:x},d.createElement(jo.Provider,{value:M},d.createElement(Ri,{value:Fe(L,{[Ke.Open]:Ue.Open,[Ke.Closed]:Ue.Closed})},s!=null&&w!=null&&d.createElement(ql,{disabled:f,data:{[s]:w},form:i,onReset:P}),W({ourProps:q,theirProps:v,slot:I,defaultTag:Tb,name:"Listbox"}))))))}let Ib="button";function Nb(n,r){let e=d.useId(),t=ai(),o=jr("Listbox.Button"),a=qi("Listbox.Button"),{id:i=t||`headlessui-listbox-button-${e}`,disabled:s=o.disabled||!1,autoFocus:l=!1,...u}=n,c=We(r,dc(),a.actions.setButtonElement),f=ug(),[h,p,m]=we(a,C=>[C.listboxState,C.buttonElement,C.optionsElement]),v=h===Ke.Open;Cu(v,{trigger:p,action:d.useCallback(C=>{if(p!=null&&p.contains(C.target))return Vt.Ignore;let q=C.target.closest('[role="option"]:not([data-disabled])');return tt(q)?Vt.Select(q):m!=null&&m.contains(C.target)?Vt.Ignore:Vt.Close},[p,m]),close:a.actions.closeListbox,select:a.actions.selectActiveOption});let g=Z(C=>{switch(C.key){case he.Enter:Nh(C.currentTarget);break;case he.Space:case he.ArrowDown:C.preventDefault(),a.actions.openListbox({focus:o.value?se.Nothing:se.First});break;case he.ArrowUp:C.preventDefault(),a.actions.openListbox({focus:o.value?se.Nothing:se.Last});break}}),y=Z(C=>{switch(C.key){case he.Space:C.preventDefault();break}}),E=Z(C=>{var q;if(C.button===$o.Left){if(Gl(C.currentTarget))return C.preventDefault();a.state.listboxState===Ke.Open?(Le.flushSync(()=>a.actions.closeListbox()),(q=a.state.buttonElement)==null||q.focus({preventScroll:!0})):(C.preventDefault(),a.actions.openListbox({focus:se.Nothing}))}}),w=d.useRef(null),S=Z(C=>{w.current=C.pointerType,C.pointerType==="mouse"&&E(C)}),x=Z(C=>{w.current!=="mouse"&&E(C)}),T=Z(C=>C.preventDefault()),N=kr([i]),_=Jl(),{isFocusVisible:O,focusProps:M}=ti({autoFocus:l}),{isHovered:L,hoverProps:b}=ei({isDisabled:s}),{pressed:k,pressProps:$}=Yl({disabled:s}),Y=d.useMemo(()=>({open:h===Ke.Open,active:k||h===Ke.Open,disabled:s,invalid:o.invalid,value:o.value,hover:L,focus:O,autofocus:l}),[h,o.value,s,L,O,k,o.invalid,l]),I=we(a,C=>C.listboxState===Ke.Open),V=Dr(f(),{ref:c,id:i,type:Ou(n,p),"aria-haspopup":"listbox","aria-controls":m==null?void 0:m.id,"aria-expanded":I,"aria-labelledby":N,"aria-describedby":_,disabled:s||void 0,autoFocus:l,onKeyDown:g,onKeyUp:y,onKeyPress:T,onPointerDown:S,onClick:x},M,b,$);return Te()({ourProps:V,theirProps:u,slot:Y,defaultTag:Ib,name:"Listbox.Button"})}let Jc=d.createContext(!1),$b="div",Lb=on.RenderStrategy|on.Static;function Fb(n,r){let e=d.useId(),{id:t=`headlessui-listbox-options-${e}`,anchor:o,portal:a=!1,modal:i=!0,transition:s=!1,...l}=n,u=cc(o),[c,f]=d.useState(null);u&&(a=!0);let h=jr("Listbox.Options"),p=qi("Listbox.Options"),[m,v,g,y]=we(p,A=>[A.listboxState,A.buttonElement,A.optionsElement,A.__demoMode]),E=Bt(v),w=Bt(g),S=Qn(),[x,T]=Ci(s,c,S!==null?(S&Ue.Open)===Ue.Open:m===Ke.Open);gi(x,v,p.actions.closeListbox);let N=y?!1:i&&m===Ke.Open;Si(N,w);let _=y?!1:i&&m===Ke.Open;vi(_,{allowed:d.useCallback(()=>[v,g],[v,g])});let O=m!==Ke.Open,M=Db(O,v)?!1:x,L=x&&m===Ke.Closed,b=Io(L,h.value),k=Z(A=>h.compare(b,A)),$=we(p,A=>{var B;if(u==null||!((B=u==null?void 0:u.to)!=null&&B.includes("selection")))return null;let K=A.options.findIndex(J=>k(J.dataRef.current.value));return K===-1&&(K=0),K}),Y=(()=>{if(u==null)return;if($===null)return{...u,inner:void 0};let A=Array.from(h.listRef.current.values());return{...u,inner:{listRef:{current:A},index:$}}})(),[I,V]=pc(Y),C=fc(),q=We(r,u?I:null,p.actions.setOptionsElement,f),P=rn();d.useEffect(()=>{var A;let B=g;B&&m===Ke.Open&&B!==((A=En(B))==null?void 0:A.activeElement)&&(B==null||B.focus({preventScroll:!0}))},[m,g]);let W=Z(A=>{var B,K;switch(P.dispose(),A.key){case he.Space:if(p.state.searchQuery!=="")return A.preventDefault(),A.stopPropagation(),p.actions.search(A.key);case he.Enter:if(A.preventDefault(),A.stopPropagation(),p.state.activeOptionIndex!==null){let{dataRef:J}=p.state.options[p.state.activeOptionIndex];p.actions.onChange(J.current.value)}h.mode===_t.Single&&(Le.flushSync(()=>p.actions.closeListbox()),(B=p.state.buttonElement)==null||B.focus({preventScroll:!0}));break;case Fe(h.orientation,{vertical:he.ArrowDown,horizontal:he.ArrowRight}):return A.preventDefault(),A.stopPropagation(),p.actions.goToOption({focus:se.Next});case Fe(h.orientation,{vertical:he.ArrowUp,horizontal:he.ArrowLeft}):return A.preventDefault(),A.stopPropagation(),p.actions.goToOption({focus:se.Previous});case he.Home:case he.PageUp:return A.preventDefault(),A.stopPropagation(),p.actions.goToOption({focus:se.First});case he.End:case he.PageDown:return A.preventDefault(),A.stopPropagation(),p.actions.goToOption({focus:se.Last});case he.Escape:A.preventDefault(),A.stopPropagation(),Le.flushSync(()=>p.actions.closeListbox()),(K=p.state.buttonElement)==null||K.focus({preventScroll:!0});return;case he.Tab:A.preventDefault(),A.stopPropagation(),Le.flushSync(()=>p.actions.closeListbox()),Nm(p.state.buttonElement,A.shiftKey?bt.Previous:bt.Next);break;default:A.key.length===1&&(p.actions.search(A.key),P.setTimeout(()=>p.actions.clearSearch(),350));break}}),G=we(p,A=>{var B;return(B=A.buttonElement)==null?void 0:B.id}),j=d.useMemo(()=>({open:m===Ke.Open}),[m]),F=Dr(u?C():{},{id:t,ref:q,"aria-activedescendant":we(p,p.selectors.activeDescendantId),"aria-multiselectable":h.mode===_t.Multi?!0:void 0,"aria-labelledby":G,"aria-orientation":h.orientation,onKeyDown:W,role:"listbox",tabIndex:m===Ke.Open?0:void 0,style:{...l.style,...V,"--button-width":si(v,!0).width},...ki(T)}),ne=Te(),U=d.useMemo(()=>h.mode===_t.Multi?h:{...h,isSelected:k},[h,k]);return d.createElement(Wi,{enabled:a?n.static||x:!1,ownerDocument:E},d.createElement(jo.Provider,{value:U},ne({ourProps:F,theirProps:l,slot:j,defaultTag:$b,features:Lb,visible:M,name:"Listbox.Options"})))}let Ab="div";function Rb(n,r){let e=d.useId(),{id:t=`headlessui-listbox-option-${e}`,disabled:o=!1,value:a,...i}=n,s=d.useContext(Jc)===!0,l=jr("Listbox.Option"),u=qi("Listbox.Option"),c=we(u,M=>u.selectors.isActive(M,t)),f=l.isSelected(a),h=d.useRef(null),p=kb(h),m=Yt({disabled:o,value:a,domRef:h,get textValue(){return p()}}),v=We(r,h,M=>{M?l.listRef.current.set(t,M):l.listRef.current.delete(t)}),g=we(u,M=>u.selectors.shouldScrollIntoView(M,t));fe(()=>{if(g)return ut().requestAnimationFrame(()=>{var M,L;(L=(M=h.current)==null?void 0:M.scrollIntoView)==null||L.call(M,{block:"nearest"})})},[g,h]),fe(()=>{if(!s)return u.actions.registerOption(t,m),()=>u.actions.unregisterOption(t)},[m,t,s]);let y=Z(M=>{var L;if(o)return M.preventDefault();u.actions.onChange(a),l.mode===_t.Single&&(Le.flushSync(()=>u.actions.closeListbox()),(L=u.state.buttonElement)==null||L.focus({preventScroll:!0}))}),E=Z(()=>{if(o)return u.actions.goToOption({focus:se.Nothing});u.actions.goToOption({focus:se.Specific,id:t})}),w=Tu(),S=Z(M=>w.update(M)),x=Z(M=>{w.wasMoved(M)&&(o||c&&u.state.activationTrigger===Wo.Pointer||u.actions.goToOption({focus:se.Specific,id:t},Wo.Pointer))}),T=Z(M=>{w.wasMoved(M)&&(o||c&&u.state.activationTrigger===Wo.Pointer&&u.actions.goToOption({focus:se.Nothing}))}),N=d.useMemo(()=>({active:c,focus:c,selected:f,disabled:o,selectedOption:f&&s}),[c,f,o,s]),_=s?{}:{id:t,ref:v,role:"option",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,"aria-selected":f,disabled:void 0,onClick:y,onFocus:E,onPointerEnter:S,onMouseEnter:S,onPointerMove:x,onMouseMove:x,onPointerLeave:T,onMouseLeave:T},O=Te();return!f&&s?null:O({ourProps:_,theirProps:i,slot:N,defaultTag:Ab,name:"Listbox.Option"})}let Yb=d.Fragment;function Wb(n,r){let{options:e,placeholder:t,...o}=n,a={ref:We(r)},i=jr("ListboxSelectedOption"),s=d.useMemo(()=>({}),[]),l=i.value===void 0||i.value===null||i.mode===_t.Multi&&Array.isArray(i.value)&&i.value.length===0,u=Te();return d.createElement(Jc.Provider,{value:!0},u({ourProps:a,theirProps:{...o,children:d.createElement(d.Fragment,null,t&&l?t:e)},slot:s,defaultTag:Yb,name:"ListboxSelectedOption"}))}let jb=_e(Pb),Zc=_e(Nb),Hb=Eo,ed=_e(Fb),td=_e(Rb),Bb=_e(Wb),Vb=Object.assign(jb,{Button:Zc,Label:Hb,Options:ed,Option:td,SelectedOption:Bb});const zb=n=>{const{isOpen:r,setIsOpen:e,onClose:t,title:o,image:a,description:i,confirm:s,cancel:l,disableOutsideClick:u,className:c}=n,f=()=>{u||t()};return R.jsx(jc,{show:r,enter:"transition ease-out duration-200",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"transition-opacity ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:R.jsxs(Wr,{onClose:f,className:"relative z-50 focus:outline-hidden",children:[R.jsx("div",{className:"fixed inset-0 bg-black/40","aria-hidden":!r}),R.jsx("div",{className:"fixed inset-0 flex w-screen items-center justify-center p-4",children:R.jsxs(Bc,{className:ot(c==null?void 0:c.popup,"ja-break-all flex w-[90vw] max-w-[300px] flex-col gap-[16px] rounded-[16px] bg-white p-[20px]"),children:[R.jsxs("div",{className:"flex flex-col gap-[8px]",children:[o&&R.jsx(Vc,{className:ot(c==null?void 0:c.title,"global-break-all text-title-small font-bold text-black"),children:o}),a&&R.jsx("img",{className:c==null?void 0:c.image,src:a.url,alt:a.alt}),i&&i!==""&&R.jsx(Zl,{className:ot(c==null?void 0:c.description,"text-petnow-grey-tertiary text-body-large popup-scrollbar max-h-[314px] overflow-y-auto break-all"),children:i})]}),R.jsxs("div",{className:"flex flex-col gap-[8px]",children:[s&&R.jsx("button",{className:"bg-petnow-orange-primary sm:hover:bg-petnow-orange-40 text-label-medium w-full cursor-pointer rounded-[12px] py-[12px] font-bold text-white transition duration-200",onClick:s.onClick,children:s.text}),l&&R.jsx("button",{onClick:()=>e(!1),className:"bg-background-tertiary sm:hover:bg-petnow-grey-90 text-petnow-grey-tertiary text-label-medium w-full cursor-pointer rounded-[12px] py-[12px] font-bold transition duration-200",children:l.text})]})]})})]})})},qb=({className:n,id:r,name:e,onChange:t,disabled:o,isChecked:a})=>R.jsxs("label",{htmlFor:r,className:"relative inline-flex cursor-pointer items-center",children:[R.jsx("input",{type:"checkbox",disabled:o,checked:a,id:r,name:e,className:"peer sr-only",onChange:t}),R.jsx("div",{className:ot(n,"bg-petnow-grey-primary peer-checked:bg-petnow-orange-primary h-[32px] w-[52px] rounded-full duration-[250ms] peer-focus:outline-none after:absolute after:start-[2px] after:top-[3px] after:size-[26px] after:rounded-full after:bg-white after:shadow-[0_3px_8px_0_rgba(0,0,0,0.15)] after:transition-all after:duration-[250ms] after:content-[''] peer-checked:after:translate-x-[calc(100%-4px)] peer-checked:after:border-white",o&&"cursor-not-allowed opacity-50")})]});var nd={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},rd=d.createContext&&d.createContext(nd),Ub=["attr","size","title"];function Qb(n,r){if(n==null)return{};var e=Gb(n,r),t,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(o=0;o<a.length;o++)t=a[o],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(n,t)&&(e[t]=n[t])}return e}function Gb(n,r){if(n==null)return{};var e={};for(var t in n)if(Object.prototype.hasOwnProperty.call(n,t)){if(r.indexOf(t)>=0)continue;e[t]=n[t]}return e}function Ho(){return Ho=Object.assign?Object.assign.bind():function(n){for(var r=1;r<arguments.length;r++){var e=arguments[r];for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])}return n},Ho.apply(this,arguments)}function od(n,r){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(n);r&&(t=t.filter(function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable})),e.push.apply(e,t)}return e}function Bo(n){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?od(Object(e),!0).forEach(function(t){Kb(n,t,e[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):od(Object(e)).forEach(function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(e,t))})}return n}function Kb(n,r,e){return r=Xb(r),r in n?Object.defineProperty(n,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[r]=e,n}function Xb(n){var r=Jb(n,"string");return typeof r=="symbol"?r:r+""}function Jb(n,r){if(typeof n!="object"||!n)return n;var e=n[Symbol.toPrimitive];if(e!==void 0){var t=e.call(n,r);if(typeof t!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(n)}function ad(n){return n&&n.map((r,e)=>d.createElement(r.tag,Bo({key:e},r.attr),ad(r.child)))}function Hr(n){return r=>d.createElement(Zb,Ho({attr:Bo({},n.attr)},r),ad(n.child))}function Zb(n){var r=e=>{var{attr:t,size:o,title:a}=n,i=Qb(n,Ub),s=o||e.size||"1em",l;return e.className&&(l=e.className),n.className&&(l=(l?l+" ":"")+n.className),d.createElement("svg",Ho({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},e.attr,t,i,{className:l,style:Bo(Bo({color:n.color||e.color},e.style),n.style),height:s,width:s,xmlns:"http://www.w3.org/2000/svg"}),a&&d.createElement("title",null,a),n.children)};return rd!==void 0?d.createElement(rd.Consumer,null,e=>r(e)):r(nd)}function ey(n){return Hr({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M6.23 20.23 8 22l10-10L8 2 6.23 3.77 14.46 12z"},child:[]}]})(n)}function id(n){return Hr({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"},child:[]}]})(n)}const ty=({checked:n,label:r,onChange:e,termImageUrl:t})=>{const[o,a]=d.useState(!1);return R.jsxs(R.Fragment,{children:[R.jsx(ny,{isOpen:o,setIsOpen:a,termImageUrl:t}),R.jsxs("div",{className:"inline-flex items-center",children:[R.jsxs("label",{className:"relative flex cursor-pointer items-center rounded-full p-3",htmlFor:"check",children:[R.jsx("input",{type:"checkbox",className:"before:content[''] border-petnow-grey-primary peer bg-petnow-grey-primary checked:border-petnow-orange-primary checked:bg-petnow-orange-primary checked:before:bg-petnow-orange-primary relative size-6 cursor-pointer appearance-none rounded-xl border transition-all before:absolute before:top-2/4 before:left-2/4 before:block before:h-12 before:w-12 before:-translate-x-2/4 before:-translate-y-2/4 before:rounded-full before:opacity-0 before:transition-opacity",id:r,checked:n,onChange:i=>{e(i.target.checked)}}),R.jsx("span",{className:"text-petnow-grey-secondary pointer-events-none absolute top-2/4 left-2/4 -translate-x-2/4 -translate-y-2/4 transition peer-checked:text-white",children:R.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",stroke:"currentColor",strokeWidth:"1",children:R.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})})]}),r&&R.jsxs("div",{className:"flex items-center",children:[R.jsx("label",{className:"cursor-pointer font-medium",htmlFor:r,children:r}),R.jsx(ey,{onClick:()=>{a(!0)},className:"text-petnow-grey-tertiary mt-[2.5px] ml-2 cursor-pointer",size:24})]})]})]})},ny=({isOpen:n,setIsOpen:r,termImageUrl:e})=>R.jsxs(Wr,{open:n,onClose:()=>r(!1),className:"relative z-50",children:[R.jsx("div",{className:"fixed inset-0 bg-black/30","aria-hidden":"true"}),R.jsx("div",{className:"fixed inset-0 w-screen overflow-y-auto",children:R.jsx("div",{className:"flex min-h-full items-center justify-center p-4",children:R.jsxs(Wr.Panel,{className:"mx-auto flex max-w-sm flex-col items-center rounded-sm bg-white",children:[R.jsx("div",{className:"bg-background-tertiary flex h-[36px] w-full flex-row-reverse items-center",children:R.jsx(id,{size:20,className:"mr-2",onClick:()=>r(!1)})}),R.jsx("img",{src:e,alt:"약관동의 이미지"})]})})})]});var Ui=function(n,r){return Ui=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])},Ui(n,r)},Xn=function(){return Xn=Object.assign||function(n){for(var r,e=1,t=arguments.length;e<t;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o]);return n},Xn.apply(this,arguments)};function ry(n,r){var e={};for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&r.indexOf(t)<0&&(e[t]=n[t]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function"){var o=0;for(t=Object.getOwnPropertySymbols(n);o<t.length;o++)r.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(n,t[o])&&(e[t[o]]=n[t[o]])}return e}var Qi,sd="https://t1.daumcdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js",oy=(Qi=null,function(n){return n===void 0&&(n=sd),Qi||(Qi=new Promise(function(r,e){var t=document.createElement("script");t.src=n,t.onload=function(){var o;if(!((o=window==null?void 0:window.daum)===null||o===void 0)&&o.Postcode)return r(window.daum.Postcode);e(new Error("Script is loaded successfully, but cannot find Postcode module. Check your scriptURL property."))},t.onerror=function(o){return e(o)},t.id="daum_postcode_script",document.body.appendChild(t)}))}),ay=d.createElement("p",null,"현재 Daum 우편번호 서비스를 이용할 수 없습니다. 잠시 후 다시 시도해주세요."),iy={width:"100%",height:400},sy={scriptUrl:sd,errorMessage:ay,autoClose:!0},ly=function(n){function r(){var e=n!==null&&n.apply(this,arguments)||this;return e.mounted=!1,e.wrap=d.createRef(),e.state={hasError:!1,completed:!1},e.initiate=function(t){if(e.wrap.current){var o=e.props;o.scriptUrl,o.className,o.style;var a=o.defaultQuery,i=o.autoClose;o.errorMessage;var s=o.onComplete,l=o.onClose,u=o.onResize,c=o.onSearch,f=ry(o,["scriptUrl","className","style","defaultQuery","autoClose","errorMessage","onComplete","onClose","onResize","onSearch"]);new t(Xn(Xn({},f),{oncomplete:function(h){s&&s(h),e.setState({completed:!0})},onsearch:c,onresize:u,onclose:l,width:"100%",height:"100%"})).embed(e.wrap.current,{q:a,autoClose:i})}},e.onError=function(t){console.error(t),e.setState({hasError:!0})},e}return function(e,t){function o(){this.constructor=e}Ui(e,t),e.prototype=t===null?Object.create(t):(o.prototype=t.prototype,new o)}(r,n),r.prototype.componentDidMount=function(){var e=this.initiate,t=this.onError,o=this.props.scriptUrl;o&&(this.mounted||(oy(o).then(e).catch(t),this.mounted=!0))},r.prototype.render=function(){var e=this.props,t=e.className,o=e.style,a=e.errorMessage,i=e.autoClose,s=this.state,l=s.hasError,u=s.completed;return i===!0&&u===!0?null:d.createElement("div",{ref:this.wrap,className:t,style:Xn(Xn({},iy),o)},l&&a)},r.defaultProps=sy,r}(d.Component);const uy=({label:n,value:r,onFrontChange:e,onBackChange:t,onPostalCodeChange:o,disabled:a})=>{const[i,s]=d.useState(!1),l=f=>{let h=f.address,p="";f.addressType==="R"&&(f.bname!==""&&(p+=f.bname),f.buildingName!==""&&(p+=p!==""?`, ${f.buildingName}`:f.buildingName),h+=p!==""?` (${p})`:""),e(h),o&&o(f.zonecode),s(!1)},u=()=>{s(!0)},c=()=>r.front?r.front:R.jsx("p",{className:"text-petnow-grey-primary",children:"주소를 입력해주세요."});return R.jsxs(R.Fragment,{children:[R.jsx(cy,{isOpen:i,setIsOpen:s,handleComplete:l}),R.jsxs("div",{className:"text-petnow-grey-tertiary",children:[R.jsx("label",{htmlFor:n,className:"text-sm font-bold text-black",children:n}),R.jsxs("div",{className:"relative flex flex-col",children:[R.jsx("div",{className:`bg-background-secondary placeholder:text-petnow-grey-primary mt-4 h-[60px] w-full cursor-pointer overflow-hidden rounded-xl p-4 text-base whitespace-nowrap focus:outline-hidden ${a&&"opacity-50"}`,onClick:u,children:c()}),R.jsx("input",{disabled:!r.front||a,value:r.back,type:"text",name:n,id:n,placeholder:"상세 주소를 입력해주세요.",className:"bg-background-secondary placeholder:text-petnow-grey-primary mt-4 h-[60px] w-full rounded-xl p-4 text-base focus:outline-hidden disabled:opacity-50",autoComplete:"off",onChange:f=>t(f.target.value)})]})]})]})},cy=n=>{const{isOpen:r,setIsOpen:e,handleComplete:t}=n;return R.jsx(Wr,{open:r,onClose:()=>e(!1),className:"relateive z-50",children:R.jsx("div",{className:"fixed inset-0 flex w-screen items-center justify-center",children:R.jsx(Wr.Panel,{children:R.jsxs("div",{children:[R.jsx("div",{className:"bg-background-tertiary flex h-[36px] w-[100vw] flex-row-reverse items-center px-2",onClick:()=>e(!1),children:R.jsx(id,{size:24,onClick:()=>e(!1)})}),R.jsx(ly,{onComplete:t,style:{width:"100vw",height:"calc(100vh - 36px)"}})]})})})})};function dy(n){return Hr({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 294.1L383 167c9.4-9.4 24.6-9.4 33.9 0s9.3 24.6 0 34L273 345c-9.1 9.1-23.7 9.3-33.1.7L95 201.1c-4.7-4.7-7-10.9-7-17s2.3-12.3 7-17c9.4-9.4 24.6-9.4 33.9 0l127.1 127z"},child:[]}]})(n)}function fy(n){return Hr({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 217.9L383 345c9.4 9.4 24.6 9.4 33.9 0 9.4-9.4 9.3-24.6 0-34L273 167c-9.1-9.1-23.7-9.3-33.1-.7L95 310.9c-4.7 4.7-7 10.9-7 17s2.3 12.3 7 17c9.4 9.4 24.6 9.4 33.9 0l127.1-127z"},child:[]}]})(n)}const py=({title:n,description:r,titleTextClassName:e,descriptionTextClassName:t})=>{const[o,a]=d.useState(!1);return R.jsxs("div",{className:"my-2.5 flex w-full cursor-pointer flex-col justify-center rounded-xl px-4 pt-8 shadow-[0_2px_8px_0_rgba(0,0,0,0.08)] md:rounded-2xl md:pt-10",onClick:()=>a(i=>!i),children:[R.jsxs("div",{className:"flex w-full items-center justify-between px-2 pb-8 transition-all duration-300 md:px-4 md:pb-10",children:[R.jsxs("p",{className:ot("mr-4 text-lg font-medium md:text-xl",e),children:[R.jsx("span",{className:"font-semibold",children:"Q."})," ",n]}),o?R.jsx(fy,{className:"text-petnow-orange-primary min-w-6",size:24}):R.jsx(dy,{className:"text-petnow-orange-primary min-w-6",size:24})]}),R.jsx("p",{className:ot(`text-petnow-grey-secondary w-full overflow-hidden px-2 text-base leading-6 whitespace-pre-wrap transition-all duration-300 md:px-4 md:text-lg ${o?"max-h-[24rem] pb-8 sm:max-h-60 md:pb-10":"max-h-0"}`,t),children:r})]})},ld=6048e5,hy=864e5,Vo=6e4,zo=36e5,my=1e3,ud=Symbol.for("constructDateFrom");function De(n,r){return typeof n=="function"?n(r):n&&typeof n=="object"&&ud in n?n[ud](r):n instanceof Date?new n.constructor(r):new Date(r)}function ae(n,r){return De(r||n,n)}function yt(n,r,e){const t=ae(n,e==null?void 0:e.in);return isNaN(r)?De((e==null?void 0:e.in)||n,NaN):(r&&t.setDate(t.getDate()+r),t)}function wt(n,r,e){const t=ae(n,e==null?void 0:e.in);if(isNaN(r))return De(n,NaN);if(!r)return t;const o=t.getDate(),a=De(n,t.getTime());a.setMonth(t.getMonth()+r+1,0);const i=a.getDate();return o>=i?a:(t.setFullYear(a.getFullYear(),a.getMonth(),o),t)}function cd(n,r,e){return De(n,+ae(n)+r)}function vy(n,r,e){return cd(n,r*zo)}let gy={};function _n(){return gy}function Ut(n,r){var s,l,u,c;const e=_n(),t=(r==null?void 0:r.weekStartsOn)??((l=(s=r==null?void 0:r.locale)==null?void 0:s.options)==null?void 0:l.weekStartsOn)??e.weekStartsOn??((c=(u=e.locale)==null?void 0:u.options)==null?void 0:c.weekStartsOn)??0,o=ae(n,r==null?void 0:r.in),a=o.getDay(),i=(a<t?7:0)+a-t;return o.setDate(o.getDate()-i),o.setHours(0,0,0,0),o}function Jn(n,r){return Ut(n,{...r,weekStartsOn:1})}function dd(n,r){const e=ae(n,r==null?void 0:r.in),t=e.getFullYear(),o=De(e,0);o.setFullYear(t+1,0,4),o.setHours(0,0,0,0);const a=Jn(o),i=De(e,0);i.setFullYear(t,0,4),i.setHours(0,0,0,0);const s=Jn(i);return e.getTime()>=a.getTime()?t+1:e.getTime()>=s.getTime()?t:t-1}function qo(n){const r=ae(n),e=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return e.setUTCFullYear(r.getFullYear()),+n-+e}function Qt(n,...r){const e=De.bind(null,r.find(t=>typeof t=="object"));return r.map(e)}function On(n,r){const e=ae(n,r==null?void 0:r.in);return e.setHours(0,0,0,0),e}function Zn(n,r,e){const[t,o]=Qt(e==null?void 0:e.in,n,r),a=On(t),i=On(o),s=+a-qo(a),l=+i-qo(i);return Math.round((s-l)/hy)}function by(n,r){const e=dd(n,r),t=De(n,0);return t.setFullYear(e,0,4),t.setHours(0,0,0,0),Jn(t)}function Gi(n,r,e){const t=ae(n,e==null?void 0:e.in);return t.setTime(t.getTime()+r*Vo),t}function Ki(n,r,e){return wt(n,r*3,e)}function yy(n,r,e){return cd(n,r*1e3)}function Uo(n,r,e){return yt(n,r*7,e)}function Gt(n,r,e){return wt(n,r*12,e)}function fd(n,r){let e,t=r==null?void 0:r.in;return n.forEach(o=>{!t&&typeof o=="object"&&(t=De.bind(null,o));const a=ae(o,t);(!e||e<a||isNaN(+a))&&(e=a)}),De(t,e||NaN)}function pd(n,r){let e,t=r==null?void 0:r.in;return n.forEach(o=>{!t&&typeof o=="object"&&(t=De.bind(null,o));const a=ae(o,t);(!e||e>a||isNaN(+a))&&(e=a)}),De(t,e||NaN)}function wy(n,r,e){const[t,o]=Qt(e==null?void 0:e.in,n,r);return+On(t)==+On(o)}function Kt(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Qo(n){return!(!Kt(n)&&typeof n!="number"||isNaN(+ae(n)))}function Go(n,r,e){const[t,o]=Qt(e==null?void 0:e.in,n,r),a=t.getFullYear()-o.getFullYear(),i=t.getMonth()-o.getMonth();return a*12+i}function Mn(n,r){const e=ae(n,r==null?void 0:r.in);return Math.trunc(e.getMonth()/3)+1}function Ko(n,r,e){const[t,o]=Qt(e==null?void 0:e.in,n,r),a=t.getFullYear()-o.getFullYear(),i=Mn(t)-Mn(o);return a*4+i}function Xo(n,r,e){const[t,o]=Qt(e==null?void 0:e.in,n,r);return t.getFullYear()-o.getFullYear()}function xy(n,r,e){const[t,o]=Qt(e==null?void 0:e.in,n,r),a=hd(t,o),i=Math.abs(Zn(t,o));t.setDate(t.getDate()-a*i);const s=+(hd(t,o)===-a),l=a*(i-s);return l===0?0:l}function hd(n,r){const e=n.getFullYear()-r.getFullYear()||n.getMonth()-r.getMonth()||n.getDate()-r.getDate()||n.getHours()-r.getHours()||n.getMinutes()-r.getMinutes()||n.getSeconds()-r.getSeconds()||n.getMilliseconds()-r.getMilliseconds();return e<0?-1:e>0?1:e}function md(n,r){const e=ae(n,r==null?void 0:r.in);return e.setHours(23,59,59,999),e}function vd(n,r){const e=ae(n,r==null?void 0:r.in),t=e.getMonth();return e.setFullYear(e.getFullYear(),t+1,0),e.setHours(23,59,59,999),e}function Xi(n,r){const e=ae(n,r==null?void 0:r.in),t=e.getMonth(),o=t-t%3;return e.setMonth(o,1),e.setHours(0,0,0,0),e}function gd(n,r){const e=ae(n,r==null?void 0:r.in);return e.setDate(1),e.setHours(0,0,0,0),e}function bd(n,r){const e=ae(n,r==null?void 0:r.in),t=e.getFullYear();return e.setFullYear(t+1,0,0),e.setHours(23,59,59,999),e}function Jo(n,r){const e=ae(n,r==null?void 0:r.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function Ey(n,r){var s,l;const e=_n(),t=e.weekStartsOn??((l=(s=e.locale)==null?void 0:s.options)==null?void 0:l.weekStartsOn)??0,o=ae(n,r==null?void 0:r.in),a=o.getDay(),i=(a<t?-7:0)+6-(a-t);return o.setDate(o.getDate()+i),o.setHours(23,59,59,999),o}const Dy={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Sy=(n,r,e)=>{let t;const o=Dy[n];return typeof o=="string"?t=o:r===1?t=o.one:t=o.other.replace("{{count}}",r.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+t:t+" ago":t};function er(n){return(r={})=>{const e=r.width?String(r.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const ky={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Cy={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},_y={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Oy={date:er({formats:ky,defaultWidth:"full"}),time:er({formats:Cy,defaultWidth:"full"}),dateTime:er({formats:_y,defaultWidth:"full"})},My={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Ty=(n,r,e,t)=>My[n];function Ot(n){return(r,e)=>{const t=e!=null&&e.context?String(e.context):"standalone";let o;if(t==="formatting"&&n.formattingValues){const i=n.defaultFormattingWidth||n.defaultWidth,s=e!=null&&e.width?String(e.width):i;o=n.formattingValues[s]||n.formattingValues[i]}else{const i=n.defaultWidth,s=e!=null&&e.width?String(e.width):n.defaultWidth;o=n.values[s]||n.values[i]}const a=n.argumentCallback?n.argumentCallback(r):r;return o[a]}}const Py={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Iy={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Ny={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},$y={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Ly={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Fy={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Ay={ordinalNumber:(n,r)=>{const e=Number(n),t=e%100;if(t>20||t<10)switch(t%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},era:Ot({values:Py,defaultWidth:"wide"}),quarter:Ot({values:Iy,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Ot({values:Ny,defaultWidth:"wide"}),day:Ot({values:$y,defaultWidth:"wide"}),dayPeriod:Ot({values:Ly,defaultWidth:"wide",formattingValues:Fy,defaultFormattingWidth:"wide"})};function Mt(n){return(r,e={})=>{const t=e.width,o=t&&n.matchPatterns[t]||n.matchPatterns[n.defaultMatchWidth],a=r.match(o);if(!a)return null;const i=a[0],s=t&&n.parsePatterns[t]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(s)?Yy(s,f=>f.test(i)):Ry(s,f=>f.test(i));let u;u=n.valueCallback?n.valueCallback(l):l,u=e.valueCallback?e.valueCallback(u):u;const c=r.slice(i.length);return{value:u,rest:c}}}function Ry(n,r){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&r(n[e]))return e}function Yy(n,r){for(let e=0;e<n.length;e++)if(r(n[e]))return e}function yd(n){return(r,e={})=>{const t=r.match(n.matchPattern);if(!t)return null;const o=t[0],a=r.match(n.parsePattern);if(!a)return null;let i=n.valueCallback?n.valueCallback(a[0]):a[0];i=e.valueCallback?e.valueCallback(i):i;const s=r.slice(o.length);return{value:i,rest:s}}}const Wy=/^(\d+)(th|st|nd|rd)?/i,jy=/\d+/i,Hy={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},By={any:[/^b/i,/^(a|c)/i]},Vy={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},zy={any:[/1/i,/2/i,/3/i,/4/i]},qy={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Uy={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Qy={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Gy={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Ky={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Xy={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Jy={ordinalNumber:yd({matchPattern:Wy,parsePattern:jy,valueCallback:n=>parseInt(n,10)}),era:Mt({matchPatterns:Hy,defaultMatchWidth:"wide",parsePatterns:By,defaultParseWidth:"any"}),quarter:Mt({matchPatterns:Vy,defaultMatchWidth:"wide",parsePatterns:zy,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Mt({matchPatterns:qy,defaultMatchWidth:"wide",parsePatterns:Uy,defaultParseWidth:"any"}),day:Mt({matchPatterns:Qy,defaultMatchWidth:"wide",parsePatterns:Gy,defaultParseWidth:"any"}),dayPeriod:Mt({matchPatterns:Ky,defaultMatchWidth:"any",parsePatterns:Xy,defaultParseWidth:"any"})},wd={code:"en-US",formatDistance:Sy,formatLong:Oy,formatRelative:Ty,localize:Ay,match:Jy,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Zy(n,r){const e=ae(n,r==null?void 0:r.in);return Zn(e,Jo(e))+1}function Ji(n,r){const e=ae(n,r==null?void 0:r.in),t=+Jn(e)-+by(e);return Math.round(t/ld)+1}function Zi(n,r){var c,f,h,p;const e=ae(n,r==null?void 0:r.in),t=e.getFullYear(),o=_n(),a=(r==null?void 0:r.firstWeekContainsDate)??((f=(c=r==null?void 0:r.locale)==null?void 0:c.options)==null?void 0:f.firstWeekContainsDate)??o.firstWeekContainsDate??((p=(h=o.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??1,i=De((r==null?void 0:r.in)||n,0);i.setFullYear(t+1,0,a),i.setHours(0,0,0,0);const s=Ut(i,r),l=De((r==null?void 0:r.in)||n,0);l.setFullYear(t,0,a),l.setHours(0,0,0,0);const u=Ut(l,r);return+e>=+s?t+1:+e>=+u?t:t-1}function ew(n,r){var s,l,u,c;const e=_n(),t=(r==null?void 0:r.firstWeekContainsDate)??((l=(s=r==null?void 0:r.locale)==null?void 0:s.options)==null?void 0:l.firstWeekContainsDate)??e.firstWeekContainsDate??((c=(u=e.locale)==null?void 0:u.options)==null?void 0:c.firstWeekContainsDate)??1,o=Zi(n,r),a=De((r==null?void 0:r.in)||n,0);return a.setFullYear(o,0,t),a.setHours(0,0,0,0),Ut(a,r)}function xd(n,r){const e=ae(n,r==null?void 0:r.in),t=+Ut(e,r)-+ew(e,r);return Math.round(t/ld)+1}function Se(n,r){const e=n<0?"-":"",t=Math.abs(n).toString().padStart(r,"0");return e+t}const hn={y(n,r){const e=n.getFullYear(),t=e>0?e:1-e;return Se(r==="yy"?t%100:t,r.length)},M(n,r){const e=n.getMonth();return r==="M"?String(e+1):Se(e+1,2)},d(n,r){return Se(n.getDate(),r.length)},a(n,r){const e=n.getHours()/12>=1?"pm":"am";switch(r){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,r){return Se(n.getHours()%12||12,r.length)},H(n,r){return Se(n.getHours(),r.length)},m(n,r){return Se(n.getMinutes(),r.length)},s(n,r){return Se(n.getSeconds(),r.length)},S(n,r){const e=r.length,t=n.getMilliseconds(),o=Math.trunc(t*Math.pow(10,e-3));return Se(o,r.length)}},tr={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Ed={G:function(n,r,e){const t=n.getFullYear()>0?1:0;switch(r){case"G":case"GG":case"GGG":return e.era(t,{width:"abbreviated"});case"GGGGG":return e.era(t,{width:"narrow"});case"GGGG":default:return e.era(t,{width:"wide"})}},y:function(n,r,e){if(r==="yo"){const t=n.getFullYear(),o=t>0?t:1-t;return e.ordinalNumber(o,{unit:"year"})}return hn.y(n,r)},Y:function(n,r,e,t){const o=Zi(n,t),a=o>0?o:1-o;if(r==="YY"){const i=a%100;return Se(i,2)}return r==="Yo"?e.ordinalNumber(a,{unit:"year"}):Se(a,r.length)},R:function(n,r){const e=dd(n);return Se(e,r.length)},u:function(n,r){const e=n.getFullYear();return Se(e,r.length)},Q:function(n,r,e){const t=Math.ceil((n.getMonth()+1)/3);switch(r){case"Q":return String(t);case"QQ":return Se(t,2);case"Qo":return e.ordinalNumber(t,{unit:"quarter"});case"QQQ":return e.quarter(t,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(t,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(t,{width:"wide",context:"formatting"})}},q:function(n,r,e){const t=Math.ceil((n.getMonth()+1)/3);switch(r){case"q":return String(t);case"qq":return Se(t,2);case"qo":return e.ordinalNumber(t,{unit:"quarter"});case"qqq":return e.quarter(t,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(t,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(t,{width:"wide",context:"standalone"})}},M:function(n,r,e){const t=n.getMonth();switch(r){case"M":case"MM":return hn.M(n,r);case"Mo":return e.ordinalNumber(t+1,{unit:"month"});case"MMM":return e.month(t,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(t,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(t,{width:"wide",context:"formatting"})}},L:function(n,r,e){const t=n.getMonth();switch(r){case"L":return String(t+1);case"LL":return Se(t+1,2);case"Lo":return e.ordinalNumber(t+1,{unit:"month"});case"LLL":return e.month(t,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(t,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(t,{width:"wide",context:"standalone"})}},w:function(n,r,e,t){const o=xd(n,t);return r==="wo"?e.ordinalNumber(o,{unit:"week"}):Se(o,r.length)},I:function(n,r,e){const t=Ji(n);return r==="Io"?e.ordinalNumber(t,{unit:"week"}):Se(t,r.length)},d:function(n,r,e){return r==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):hn.d(n,r)},D:function(n,r,e){const t=Zy(n);return r==="Do"?e.ordinalNumber(t,{unit:"dayOfYear"}):Se(t,r.length)},E:function(n,r,e){const t=n.getDay();switch(r){case"E":case"EE":case"EEE":return e.day(t,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(t,{width:"short",context:"formatting"});case"EEEE":default:return e.day(t,{width:"wide",context:"formatting"})}},e:function(n,r,e,t){const o=n.getDay(),a=(o-t.weekStartsOn+8)%7||7;switch(r){case"e":return String(a);case"ee":return Se(a,2);case"eo":return e.ordinalNumber(a,{unit:"day"});case"eee":return e.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(o,{width:"short",context:"formatting"});case"eeee":default:return e.day(o,{width:"wide",context:"formatting"})}},c:function(n,r,e,t){const o=n.getDay(),a=(o-t.weekStartsOn+8)%7||7;switch(r){case"c":return String(a);case"cc":return Se(a,r.length);case"co":return e.ordinalNumber(a,{unit:"day"});case"ccc":return e.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(o,{width:"narrow",context:"standalone"});case"cccccc":return e.day(o,{width:"short",context:"standalone"});case"cccc":default:return e.day(o,{width:"wide",context:"standalone"})}},i:function(n,r,e){const t=n.getDay(),o=t===0?7:t;switch(r){case"i":return String(o);case"ii":return Se(o,r.length);case"io":return e.ordinalNumber(o,{unit:"day"});case"iii":return e.day(t,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(t,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(t,{width:"short",context:"formatting"});case"iiii":default:return e.day(t,{width:"wide",context:"formatting"})}},a:function(n,r,e){const o=n.getHours()/12>=1?"pm":"am";switch(r){case"a":case"aa":return e.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(n,r,e){const t=n.getHours();let o;switch(t===12?o=tr.noon:t===0?o=tr.midnight:o=t/12>=1?"pm":"am",r){case"b":case"bb":return e.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(n,r,e){const t=n.getHours();let o;switch(t>=17?o=tr.evening:t>=12?o=tr.afternoon:t>=4?o=tr.morning:o=tr.night,r){case"B":case"BB":case"BBB":return e.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(n,r,e){if(r==="ho"){let t=n.getHours()%12;return t===0&&(t=12),e.ordinalNumber(t,{unit:"hour"})}return hn.h(n,r)},H:function(n,r,e){return r==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):hn.H(n,r)},K:function(n,r,e){const t=n.getHours()%12;return r==="Ko"?e.ordinalNumber(t,{unit:"hour"}):Se(t,r.length)},k:function(n,r,e){let t=n.getHours();return t===0&&(t=24),r==="ko"?e.ordinalNumber(t,{unit:"hour"}):Se(t,r.length)},m:function(n,r,e){return r==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):hn.m(n,r)},s:function(n,r,e){return r==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):hn.s(n,r)},S:function(n,r){return hn.S(n,r)},X:function(n,r,e){const t=n.getTimezoneOffset();if(t===0)return"Z";switch(r){case"X":return Sd(t);case"XXXX":case"XX":return Tn(t);case"XXXXX":case"XXX":default:return Tn(t,":")}},x:function(n,r,e){const t=n.getTimezoneOffset();switch(r){case"x":return Sd(t);case"xxxx":case"xx":return Tn(t);case"xxxxx":case"xxx":default:return Tn(t,":")}},O:function(n,r,e){const t=n.getTimezoneOffset();switch(r){case"O":case"OO":case"OOO":return"GMT"+Dd(t,":");case"OOOO":default:return"GMT"+Tn(t,":")}},z:function(n,r,e){const t=n.getTimezoneOffset();switch(r){case"z":case"zz":case"zzz":return"GMT"+Dd(t,":");case"zzzz":default:return"GMT"+Tn(t,":")}},t:function(n,r,e){const t=Math.trunc(+n/1e3);return Se(t,r.length)},T:function(n,r,e){return Se(+n,r.length)}};function Dd(n,r=""){const e=n>0?"-":"+",t=Math.abs(n),o=Math.trunc(t/60),a=t%60;return a===0?e+String(o):e+String(o)+r+Se(a,2)}function Sd(n,r){return n%60===0?(n>0?"-":"+")+Se(Math.abs(n)/60,2):Tn(n,r)}function Tn(n,r=""){const e=n>0?"-":"+",t=Math.abs(n),o=Se(Math.trunc(t/60),2),a=Se(t%60,2);return e+o+r+a}const kd=(n,r)=>{switch(n){case"P":return r.date({width:"short"});case"PP":return r.date({width:"medium"});case"PPP":return r.date({width:"long"});case"PPPP":default:return r.date({width:"full"})}},Cd=(n,r)=>{switch(n){case"p":return r.time({width:"short"});case"pp":return r.time({width:"medium"});case"ppp":return r.time({width:"long"});case"pppp":default:return r.time({width:"full"})}},es={p:Cd,P:(n,r)=>{const e=n.match(/(P+)(p+)?/)||[],t=e[1],o=e[2];if(!o)return kd(n,r);let a;switch(t){case"P":a=r.dateTime({width:"short"});break;case"PP":a=r.dateTime({width:"medium"});break;case"PPP":a=r.dateTime({width:"long"});break;case"PPPP":default:a=r.dateTime({width:"full"});break}return a.replace("{{date}}",kd(t,r)).replace("{{time}}",Cd(o,r))}},tw=/^D+$/,nw=/^Y+$/,rw=["D","DD","YY","YYYY"];function ow(n){return tw.test(n)}function aw(n){return nw.test(n)}function iw(n,r,e){const t=sw(n,r,e);if(console.warn(t),rw.includes(n))throw new RangeError(t)}function sw(n,r,e){const t=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${r}\`) for formatting ${t} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const lw=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,uw=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,cw=/^'([^]*?)'?$/,dw=/''/g,fw=/[a-zA-Z]/;function _d(n,r,e){var c,f,h,p,m,v,g,y;const t=_n(),o=(e==null?void 0:e.locale)??t.locale??wd,a=(e==null?void 0:e.firstWeekContainsDate)??((f=(c=e==null?void 0:e.locale)==null?void 0:c.options)==null?void 0:f.firstWeekContainsDate)??t.firstWeekContainsDate??((p=(h=t.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??1,i=(e==null?void 0:e.weekStartsOn)??((v=(m=e==null?void 0:e.locale)==null?void 0:m.options)==null?void 0:v.weekStartsOn)??t.weekStartsOn??((y=(g=t.locale)==null?void 0:g.options)==null?void 0:y.weekStartsOn)??0,s=ae(n,e==null?void 0:e.in);if(!Qo(s))throw new RangeError("Invalid time value");let l=r.match(uw).map(E=>{const w=E[0];if(w==="p"||w==="P"){const S=es[w];return S(E,o.formatLong)}return E}).join("").match(lw).map(E=>{if(E==="''")return{isToken:!1,value:"'"};const w=E[0];if(w==="'")return{isToken:!1,value:pw(E)};if(Ed[w])return{isToken:!0,value:E};if(w.match(fw))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");return{isToken:!1,value:E}});o.localize.preprocessor&&(l=o.localize.preprocessor(s,l));const u={firstWeekContainsDate:a,weekStartsOn:i,locale:o};return l.map(E=>{if(!E.isToken)return E.value;const w=E.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&aw(w)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&ow(w))&&iw(w,r,String(n));const S=Ed[w[0]];return S(s,w,o.localize,u)}).join("")}function pw(n){const r=n.match(cw);return r?r[1].replace(dw,"'"):n}function Od(n,r){return ae(n,r==null?void 0:r.in).getDate()}function hw(n,r){return ae(n,r==null?void 0:r.in).getDay()}function mw(n,r){const e=ae(n,r==null?void 0:r.in),t=e.getFullYear(),o=e.getMonth(),a=De(e,0);return a.setFullYear(t,o+1,0),a.setHours(0,0,0,0),a.getDate()}function vw(){return Object.assign({},_n())}function Xt(n,r){return ae(n,r==null?void 0:r.in).getHours()}function gw(n,r){const e=ae(n,r==null?void 0:r.in).getDay();return e===0?7:e}function Jt(n,r){return ae(n,r==null?void 0:r.in).getMinutes()}function Je(n,r){return ae(n,r==null?void 0:r.in).getMonth()}function mn(n){return ae(n).getSeconds()}function ts(n){return+ae(n)}function le(n,r){return ae(n,r==null?void 0:r.in).getFullYear()}function vn(n,r){return+ae(n)>+ae(r)}function Pn(n,r){return+ae(n)<+ae(r)}function bw(n,r){return+ae(n)==+ae(r)}function yw(n,r){const e=ww(r)?new r(0):De(r,0);return e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e}function ww(n){var r;return typeof n=="function"&&((r=n.prototype)==null?void 0:r.constructor)===n}const xw=10;class Md{constructor(){te(this,"subPriority",0)}validate(r,e){return!0}}class Ew extends Md{constructor(r,e,t,o,a){super(),this.value=r,this.validateValue=e,this.setValue=t,this.priority=o,a&&(this.subPriority=a)}validate(r,e){return this.validateValue(r,this.value,e)}set(r,e,t){return this.setValue(r,e,this.value,t)}}class Dw extends Md{constructor(e,t){super();te(this,"priority",xw);te(this,"subPriority",-1);this.context=e||(o=>De(t,o))}set(e,t){return t.timestampIsSet?e:De(e,yw(e,this.context))}}class ge{run(r,e,t,o){const a=this.parse(r,e,t,o);return a?{setter:new Ew(a.value,this.validate,this.set,this.priority,this.subPriority),rest:a.rest}:null}validate(r,e,t){return!0}}class Sw extends ge{constructor(){super(...arguments);te(this,"priority",140);te(this,"incompatibleTokens",["R","u","t","T"])}parse(e,t,o){switch(t){case"G":case"GG":case"GGG":return o.era(e,{width:"abbreviated"})||o.era(e,{width:"narrow"});case"GGGGG":return o.era(e,{width:"narrow"});case"GGGG":default:return o.era(e,{width:"wide"})||o.era(e,{width:"abbreviated"})||o.era(e,{width:"narrow"})}}set(e,t,o){return t.era=o,e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}}const Ae={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Tt={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function Re(n,r){return n&&{value:r(n.value),rest:n.rest}}function Pe(n,r){const e=r.match(n);return e?{value:parseInt(e[0],10),rest:r.slice(e[0].length)}:null}function Pt(n,r){const e=r.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:r.slice(1)};const t=e[1]==="+"?1:-1,o=e[2]?parseInt(e[2],10):0,a=e[3]?parseInt(e[3],10):0,i=e[5]?parseInt(e[5],10):0;return{value:t*(o*zo+a*Vo+i*my),rest:r.slice(e[0].length)}}function Td(n){return Pe(Ae.anyDigitsSigned,n)}function $e(n,r){switch(n){case 1:return Pe(Ae.singleDigit,r);case 2:return Pe(Ae.twoDigits,r);case 3:return Pe(Ae.threeDigits,r);case 4:return Pe(Ae.fourDigits,r);default:return Pe(new RegExp("^\\d{1,"+n+"}"),r)}}function Zo(n,r){switch(n){case 1:return Pe(Ae.singleDigitSigned,r);case 2:return Pe(Ae.twoDigitsSigned,r);case 3:return Pe(Ae.threeDigitsSigned,r);case 4:return Pe(Ae.fourDigitsSigned,r);default:return Pe(new RegExp("^-?\\d{1,"+n+"}"),r)}}function ns(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function Pd(n,r){const e=r>0,t=e?r:1-r;let o;if(t<=50)o=n||100;else{const a=t+50,i=Math.trunc(a/100)*100,s=n>=a%100;o=n+i-(s?100:0)}return e?o:1-o}function Id(n){return n%400===0||n%4===0&&n%100!==0}class kw extends ge{constructor(){super(...arguments);te(this,"priority",130);te(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(e,t,o){const a=i=>({year:i,isTwoDigitYear:t==="yy"});switch(t){case"y":return Re($e(4,e),a);case"yo":return Re(o.ordinalNumber(e,{unit:"year"}),a);default:return Re($e(t.length,e),a)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,o){const a=e.getFullYear();if(o.isTwoDigitYear){const s=Pd(o.year,a);return e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}const i=!("era"in t)||t.era===1?o.year:1-o.year;return e.setFullYear(i,0,1),e.setHours(0,0,0,0),e}}class Cw extends ge{constructor(){super(...arguments);te(this,"priority",130);te(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(e,t,o){const a=i=>({year:i,isTwoDigitYear:t==="YY"});switch(t){case"Y":return Re($e(4,e),a);case"Yo":return Re(o.ordinalNumber(e,{unit:"year"}),a);default:return Re($e(t.length,e),a)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,o,a){const i=Zi(e,a);if(o.isTwoDigitYear){const l=Pd(o.year,i);return e.setFullYear(l,0,a.firstWeekContainsDate),e.setHours(0,0,0,0),Ut(e,a)}const s=!("era"in t)||t.era===1?o.year:1-o.year;return e.setFullYear(s,0,a.firstWeekContainsDate),e.setHours(0,0,0,0),Ut(e,a)}}class _w extends ge{constructor(){super(...arguments);te(this,"priority",130);te(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(e,t){return Zo(t==="R"?4:t.length,e)}set(e,t,o){const a=De(e,0);return a.setFullYear(o,0,4),a.setHours(0,0,0,0),Jn(a)}}class Ow extends ge{constructor(){super(...arguments);te(this,"priority",130);te(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(e,t){return Zo(t==="u"?4:t.length,e)}set(e,t,o){return e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}}class Mw extends ge{constructor(){super(...arguments);te(this,"priority",120);te(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,t,o){switch(t){case"Q":case"QQ":return $e(t.length,e);case"Qo":return o.ordinalNumber(e,{unit:"quarter"});case"QQQ":return o.quarter(e,{width:"abbreviated",context:"formatting"})||o.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return o.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return o.quarter(e,{width:"wide",context:"formatting"})||o.quarter(e,{width:"abbreviated",context:"formatting"})||o.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=1&&t<=4}set(e,t,o){return e.setMonth((o-1)*3,1),e.setHours(0,0,0,0),e}}class Tw extends ge{constructor(){super(...arguments);te(this,"priority",120);te(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,t,o){switch(t){case"q":case"qq":return $e(t.length,e);case"qo":return o.ordinalNumber(e,{unit:"quarter"});case"qqq":return o.quarter(e,{width:"abbreviated",context:"standalone"})||o.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return o.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return o.quarter(e,{width:"wide",context:"standalone"})||o.quarter(e,{width:"abbreviated",context:"standalone"})||o.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=1&&t<=4}set(e,t,o){return e.setMonth((o-1)*3,1),e.setHours(0,0,0,0),e}}class Pw extends ge{constructor(){super(...arguments);te(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);te(this,"priority",110)}parse(e,t,o){const a=i=>i-1;switch(t){case"M":return Re(Pe(Ae.month,e),a);case"MM":return Re($e(2,e),a);case"Mo":return Re(o.ordinalNumber(e,{unit:"month"}),a);case"MMM":return o.month(e,{width:"abbreviated",context:"formatting"})||o.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return o.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return o.month(e,{width:"wide",context:"formatting"})||o.month(e,{width:"abbreviated",context:"formatting"})||o.month(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=11}set(e,t,o){return e.setMonth(o,1),e.setHours(0,0,0,0),e}}class Iw extends ge{constructor(){super(...arguments);te(this,"priority",110);te(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(e,t,o){const a=i=>i-1;switch(t){case"L":return Re(Pe(Ae.month,e),a);case"LL":return Re($e(2,e),a);case"Lo":return Re(o.ordinalNumber(e,{unit:"month"}),a);case"LLL":return o.month(e,{width:"abbreviated",context:"standalone"})||o.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return o.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return o.month(e,{width:"wide",context:"standalone"})||o.month(e,{width:"abbreviated",context:"standalone"})||o.month(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=0&&t<=11}set(e,t,o){return e.setMonth(o,1),e.setHours(0,0,0,0),e}}function Nw(n,r,e){const t=ae(n,e==null?void 0:e.in),o=xd(t,e)-r;return t.setDate(t.getDate()-o*7),ae(t,e==null?void 0:e.in)}class $w extends ge{constructor(){super(...arguments);te(this,"priority",100);te(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(e,t,o){switch(t){case"w":return Pe(Ae.week,e);case"wo":return o.ordinalNumber(e,{unit:"week"});default:return $e(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,o,a){return Ut(Nw(e,o,a),a)}}function Lw(n,r,e){const t=ae(n,e==null?void 0:e.in),o=Ji(t,e)-r;return t.setDate(t.getDate()-o*7),t}class Fw extends ge{constructor(){super(...arguments);te(this,"priority",100);te(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(e,t,o){switch(t){case"I":return Pe(Ae.week,e);case"Io":return o.ordinalNumber(e,{unit:"week"});default:return $e(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,o){return Jn(Lw(e,o))}}const Aw=[31,28,31,30,31,30,31,31,30,31,30,31],Rw=[31,29,31,30,31,30,31,31,30,31,30,31];class Yw extends ge{constructor(){super(...arguments);te(this,"priority",90);te(this,"subPriority",1);te(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(e,t,o){switch(t){case"d":return Pe(Ae.date,e);case"do":return o.ordinalNumber(e,{unit:"date"});default:return $e(t.length,e)}}validate(e,t){const o=e.getFullYear(),a=Id(o),i=e.getMonth();return a?t>=1&&t<=Rw[i]:t>=1&&t<=Aw[i]}set(e,t,o){return e.setDate(o),e.setHours(0,0,0,0),e}}class Ww extends ge{constructor(){super(...arguments);te(this,"priority",90);te(this,"subpriority",1);te(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(e,t,o){switch(t){case"D":case"DD":return Pe(Ae.dayOfYear,e);case"Do":return o.ordinalNumber(e,{unit:"date"});default:return $e(t.length,e)}}validate(e,t){const o=e.getFullYear();return Id(o)?t>=1&&t<=366:t>=1&&t<=365}set(e,t,o){return e.setMonth(0,o),e.setHours(0,0,0,0),e}}function rs(n,r,e){var f,h,p,m;const t=_n(),o=(e==null?void 0:e.weekStartsOn)??((h=(f=e==null?void 0:e.locale)==null?void 0:f.options)==null?void 0:h.weekStartsOn)??t.weekStartsOn??((m=(p=t.locale)==null?void 0:p.options)==null?void 0:m.weekStartsOn)??0,a=ae(n,e==null?void 0:e.in),i=a.getDay(),l=(r%7+7)%7,u=7-o,c=r<0||r>6?r-(i+u)%7:(l+u)%7-(i+u)%7;return yt(a,c,e)}class jw extends ge{constructor(){super(...arguments);te(this,"priority",90);te(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(e,t,o){switch(t){case"E":case"EE":case"EEE":return o.day(e,{width:"abbreviated",context:"formatting"})||o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return o.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"});case"EEEE":default:return o.day(e,{width:"wide",context:"formatting"})||o.day(e,{width:"abbreviated",context:"formatting"})||o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=6}set(e,t,o,a){return e=rs(e,o,a),e.setHours(0,0,0,0),e}}class Hw extends ge{constructor(){super(...arguments);te(this,"priority",90);te(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(e,t,o,a){const i=s=>{const l=Math.floor((s-1)/7)*7;return(s+a.weekStartsOn+6)%7+l};switch(t){case"e":case"ee":return Re($e(t.length,e),i);case"eo":return Re(o.ordinalNumber(e,{unit:"day"}),i);case"eee":return o.day(e,{width:"abbreviated",context:"formatting"})||o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"});case"eeeee":return o.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"});case"eeee":default:return o.day(e,{width:"wide",context:"formatting"})||o.day(e,{width:"abbreviated",context:"formatting"})||o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=6}set(e,t,o,a){return e=rs(e,o,a),e.setHours(0,0,0,0),e}}class Bw extends ge{constructor(){super(...arguments);te(this,"priority",90);te(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(e,t,o,a){const i=s=>{const l=Math.floor((s-1)/7)*7;return(s+a.weekStartsOn+6)%7+l};switch(t){case"c":case"cc":return Re($e(t.length,e),i);case"co":return Re(o.ordinalNumber(e,{unit:"day"}),i);case"ccc":return o.day(e,{width:"abbreviated",context:"standalone"})||o.day(e,{width:"short",context:"standalone"})||o.day(e,{width:"narrow",context:"standalone"});case"ccccc":return o.day(e,{width:"narrow",context:"standalone"});case"cccccc":return o.day(e,{width:"short",context:"standalone"})||o.day(e,{width:"narrow",context:"standalone"});case"cccc":default:return o.day(e,{width:"wide",context:"standalone"})||o.day(e,{width:"abbreviated",context:"standalone"})||o.day(e,{width:"short",context:"standalone"})||o.day(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=0&&t<=6}set(e,t,o,a){return e=rs(e,o,a),e.setHours(0,0,0,0),e}}function Vw(n,r,e){const t=ae(n,e==null?void 0:e.in),o=gw(t,e),a=r-o;return yt(t,a,e)}class zw extends ge{constructor(){super(...arguments);te(this,"priority",90);te(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(e,t,o){const a=i=>i===0?7:i;switch(t){case"i":case"ii":return $e(t.length,e);case"io":return o.ordinalNumber(e,{unit:"day"});case"iii":return Re(o.day(e,{width:"abbreviated",context:"formatting"})||o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"}),a);case"iiiii":return Re(o.day(e,{width:"narrow",context:"formatting"}),a);case"iiiiii":return Re(o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"}),a);case"iiii":default:return Re(o.day(e,{width:"wide",context:"formatting"})||o.day(e,{width:"abbreviated",context:"formatting"})||o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"}),a)}}validate(e,t){return t>=1&&t<=7}set(e,t,o){return e=Vw(e,o),e.setHours(0,0,0,0),e}}class qw extends ge{constructor(){super(...arguments);te(this,"priority",80);te(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(e,t,o){switch(t){case"a":case"aa":case"aaa":return o.dayPeriod(e,{width:"abbreviated",context:"formatting"})||o.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return o.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaa":default:return o.dayPeriod(e,{width:"wide",context:"formatting"})||o.dayPeriod(e,{width:"abbreviated",context:"formatting"})||o.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,o){return e.setHours(ns(o),0,0,0),e}}class Uw extends ge{constructor(){super(...arguments);te(this,"priority",80);te(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(e,t,o){switch(t){case"b":case"bb":case"bbb":return o.dayPeriod(e,{width:"abbreviated",context:"formatting"})||o.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return o.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbb":default:return o.dayPeriod(e,{width:"wide",context:"formatting"})||o.dayPeriod(e,{width:"abbreviated",context:"formatting"})||o.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,o){return e.setHours(ns(o),0,0,0),e}}class Qw extends ge{constructor(){super(...arguments);te(this,"priority",80);te(this,"incompatibleTokens",["a","b","t","T"])}parse(e,t,o){switch(t){case"B":case"BB":case"BBB":return o.dayPeriod(e,{width:"abbreviated",context:"formatting"})||o.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return o.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBB":default:return o.dayPeriod(e,{width:"wide",context:"formatting"})||o.dayPeriod(e,{width:"abbreviated",context:"formatting"})||o.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,o){return e.setHours(ns(o),0,0,0),e}}class Gw extends ge{constructor(){super(...arguments);te(this,"priority",70);te(this,"incompatibleTokens",["H","K","k","t","T"])}parse(e,t,o){switch(t){case"h":return Pe(Ae.hour12h,e);case"ho":return o.ordinalNumber(e,{unit:"hour"});default:return $e(t.length,e)}}validate(e,t){return t>=1&&t<=12}set(e,t,o){const a=e.getHours()>=12;return a&&o<12?e.setHours(o+12,0,0,0):!a&&o===12?e.setHours(0,0,0,0):e.setHours(o,0,0,0),e}}class Kw extends ge{constructor(){super(...arguments);te(this,"priority",70);te(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(e,t,o){switch(t){case"H":return Pe(Ae.hour23h,e);case"Ho":return o.ordinalNumber(e,{unit:"hour"});default:return $e(t.length,e)}}validate(e,t){return t>=0&&t<=23}set(e,t,o){return e.setHours(o,0,0,0),e}}class Xw extends ge{constructor(){super(...arguments);te(this,"priority",70);te(this,"incompatibleTokens",["h","H","k","t","T"])}parse(e,t,o){switch(t){case"K":return Pe(Ae.hour11h,e);case"Ko":return o.ordinalNumber(e,{unit:"hour"});default:return $e(t.length,e)}}validate(e,t){return t>=0&&t<=11}set(e,t,o){return e.getHours()>=12&&o<12?e.setHours(o+12,0,0,0):e.setHours(o,0,0,0),e}}class Jw extends ge{constructor(){super(...arguments);te(this,"priority",70);te(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(e,t,o){switch(t){case"k":return Pe(Ae.hour24h,e);case"ko":return o.ordinalNumber(e,{unit:"hour"});default:return $e(t.length,e)}}validate(e,t){return t>=1&&t<=24}set(e,t,o){const a=o<=24?o%24:o;return e.setHours(a,0,0,0),e}}class Zw extends ge{constructor(){super(...arguments);te(this,"priority",60);te(this,"incompatibleTokens",["t","T"])}parse(e,t,o){switch(t){case"m":return Pe(Ae.minute,e);case"mo":return o.ordinalNumber(e,{unit:"minute"});default:return $e(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,o){return e.setMinutes(o,0,0),e}}class e0 extends ge{constructor(){super(...arguments);te(this,"priority",50);te(this,"incompatibleTokens",["t","T"])}parse(e,t,o){switch(t){case"s":return Pe(Ae.second,e);case"so":return o.ordinalNumber(e,{unit:"second"});default:return $e(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,o){return e.setSeconds(o,0),e}}class t0 extends ge{constructor(){super(...arguments);te(this,"priority",30);te(this,"incompatibleTokens",["t","T"])}parse(e,t){const o=a=>Math.trunc(a*Math.pow(10,-t.length+3));return Re($e(t.length,e),o)}set(e,t,o){return e.setMilliseconds(o),e}}class n0 extends ge{constructor(){super(...arguments);te(this,"priority",10);te(this,"incompatibleTokens",["t","T","x"])}parse(e,t){switch(t){case"X":return Pt(Tt.basicOptionalMinutes,e);case"XX":return Pt(Tt.basic,e);case"XXXX":return Pt(Tt.basicOptionalSeconds,e);case"XXXXX":return Pt(Tt.extendedOptionalSeconds,e);case"XXX":default:return Pt(Tt.extended,e)}}set(e,t,o){return t.timestampIsSet?e:De(e,e.getTime()-qo(e)-o)}}class r0 extends ge{constructor(){super(...arguments);te(this,"priority",10);te(this,"incompatibleTokens",["t","T","X"])}parse(e,t){switch(t){case"x":return Pt(Tt.basicOptionalMinutes,e);case"xx":return Pt(Tt.basic,e);case"xxxx":return Pt(Tt.basicOptionalSeconds,e);case"xxxxx":return Pt(Tt.extendedOptionalSeconds,e);case"xxx":default:return Pt(Tt.extended,e)}}set(e,t,o){return t.timestampIsSet?e:De(e,e.getTime()-qo(e)-o)}}class o0 extends ge{constructor(){super(...arguments);te(this,"priority",40);te(this,"incompatibleTokens","*")}parse(e){return Td(e)}set(e,t,o){return[De(e,o*1e3),{timestampIsSet:!0}]}}class a0 extends ge{constructor(){super(...arguments);te(this,"priority",20);te(this,"incompatibleTokens","*")}parse(e){return Td(e)}set(e,t,o){return[De(e,o),{timestampIsSet:!0}]}}const i0={G:new Sw,y:new kw,Y:new Cw,R:new _w,u:new Ow,Q:new Mw,q:new Tw,M:new Pw,L:new Iw,w:new $w,I:new Fw,d:new Yw,D:new Ww,E:new jw,e:new Hw,c:new Bw,i:new zw,a:new qw,b:new Uw,B:new Qw,h:new Gw,H:new Kw,K:new Xw,k:new Jw,m:new Zw,s:new e0,S:new t0,X:new n0,x:new r0,t:new o0,T:new a0},s0=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,l0=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,u0=/^'([^]*?)'?$/,c0=/''/g,d0=/\S/,f0=/[a-zA-Z]/;function p0(n,r,e,t){var g,y,E,w,S,x,T,N;const o=()=>De((t==null?void 0:t.in)||e,NaN),a=vw(),i=(t==null?void 0:t.locale)??a.locale??wd,s=(t==null?void 0:t.firstWeekContainsDate)??((y=(g=t==null?void 0:t.locale)==null?void 0:g.options)==null?void 0:y.firstWeekContainsDate)??a.firstWeekContainsDate??((w=(E=a.locale)==null?void 0:E.options)==null?void 0:w.firstWeekContainsDate)??1,l=(t==null?void 0:t.weekStartsOn)??((x=(S=t==null?void 0:t.locale)==null?void 0:S.options)==null?void 0:x.weekStartsOn)??a.weekStartsOn??((N=(T=a.locale)==null?void 0:T.options)==null?void 0:N.weekStartsOn)??0;if(!r)return n?o():ae(e,t==null?void 0:t.in);const u={firstWeekContainsDate:s,weekStartsOn:l,locale:i},c=[new Dw(t==null?void 0:t.in,e)],f=r.match(l0).map(_=>{const O=_[0];if(O in es){const M=es[O];return M(_,i.formatLong)}return _}).join("").match(s0),h=[];for(let _ of f){const O=_[0],M=i0[O];if(M){const{incompatibleTokens:L}=M;if(Array.isArray(L)){const k=h.find($=>L.includes($.token)||$.token===O);if(k)throw new RangeError(`The format string mustn't contain \`${k.fullToken}\` and \`${_}\` at the same time`)}else if(M.incompatibleTokens==="*"&&h.length>0)throw new RangeError(`The format string mustn't contain \`${_}\` and any other token at the same time`);h.push({token:O,fullToken:_});const b=M.run(n,_,i.match,u);if(!b)return o();c.push(b.setter),n=b.rest}else{if(O.match(f0))throw new RangeError("Format string contains an unescaped latin alphabet character `"+O+"`");if(_==="''"?_="'":O==="'"&&(_=h0(_)),n.indexOf(_)===0)n=n.slice(_.length);else return o()}}if(n.length>0&&d0.test(n))return o();const p=c.map(_=>_.priority).sort((_,O)=>O-_).filter((_,O,M)=>M.indexOf(_)===O).map(_=>c.filter(O=>O.priority===_).sort((O,M)=>M.subPriority-O.subPriority)).map(_=>_[0]);let m=ae(e,t==null?void 0:t.in);if(isNaN(+m))return o();const v={};for(const _ of p){if(!_.validate(m,u))return o();const O=_.set(m,v,u);Array.isArray(O)?(m=O[0],Object.assign(v,O[1])):m=O}return m}function h0(n){return n.match(u0)[1].replace(c0,"'")}function m0(n,r,e){const[t,o]=Qt(e==null?void 0:e.in,n,r);return t.getFullYear()===o.getFullYear()&&t.getMonth()===o.getMonth()}function v0(n,r,e){const[t,o]=Qt(e==null?void 0:e.in,n,r);return+Xi(t)==+Xi(o)}function g0(n,r,e){const[t,o]=Qt(e==null?void 0:e.in,n,r);return t.getFullYear()===o.getFullYear()}function Br(n,r,e){const t=+ae(n,e==null?void 0:e.in),[o,a]=[+ae(r.start,e==null?void 0:e.in),+ae(r.end,e==null?void 0:e.in)].sort((i,s)=>i-s);return t>=o&&t<=a}function b0(n,r,e){return yt(n,-1,e)}function y0(n,r){const e=()=>De(r==null?void 0:r.in,NaN),o=D0(n);let a;if(o.date){const u=S0(o.date,2);a=k0(u.restDateString,u.year)}if(!a||isNaN(+a))return e();const i=+a;let s=0,l;if(o.time&&(s=C0(o.time),isNaN(s)))return e();if(o.timezone){if(l=_0(o.timezone),isNaN(l))return e()}else{const u=new Date(i+s),c=ae(0,r==null?void 0:r.in);return c.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),c.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),c}return ae(i+s+l,r==null?void 0:r.in)}const ea={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},w0=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,x0=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,E0=/^([+-])(\d{2})(?::?(\d{2}))?$/;function D0(n){const r={},e=n.split(ea.dateTimeDelimiter);let t;if(e.length>2)return r;if(/:/.test(e[0])?t=e[0]:(r.date=e[0],t=e[1],ea.timeZoneDelimiter.test(r.date)&&(r.date=n.split(ea.timeZoneDelimiter)[0],t=n.substr(r.date.length,n.length))),t){const o=ea.timezone.exec(t);o?(r.time=t.replace(o[1],""),r.timezone=o[1]):r.time=t}return r}function S0(n,r){const e=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+r)+"})|(\\d{2}|[+-]\\d{"+(2+r)+"})$)"),t=n.match(e);if(!t)return{year:NaN,restDateString:""};const o=t[1]?parseInt(t[1]):null,a=t[2]?parseInt(t[2]):null;return{year:a===null?o:a*100,restDateString:n.slice((t[1]||t[2]).length)}}function k0(n,r){if(r===null)return new Date(NaN);const e=n.match(w0);if(!e)return new Date(NaN);const t=!!e[4],o=Vr(e[1]),a=Vr(e[2])-1,i=Vr(e[3]),s=Vr(e[4]),l=Vr(e[5])-1;if(t)return I0(r,s,l)?O0(r,s,l):new Date(NaN);{const u=new Date(0);return!T0(r,a,i)||!P0(r,o)?new Date(NaN):(u.setUTCFullYear(r,a,Math.max(o,i)),u)}}function Vr(n){return n?parseInt(n):1}function C0(n){const r=n.match(x0);if(!r)return NaN;const e=os(r[1]),t=os(r[2]),o=os(r[3]);return N0(e,t,o)?e*zo+t*Vo+o*1e3:NaN}function os(n){return n&&parseFloat(n.replace(",","."))||0}function _0(n){if(n==="Z")return 0;const r=n.match(E0);if(!r)return 0;const e=r[1]==="+"?-1:1,t=parseInt(r[2]),o=r[3]&&parseInt(r[3])||0;return $0(t,o)?e*(t*zo+o*Vo):NaN}function O0(n,r,e){const t=new Date(0);t.setUTCFullYear(n,0,4);const o=t.getUTCDay()||7,a=(r-1)*7+e+1-o;return t.setUTCDate(t.getUTCDate()+a),t}const M0=[31,null,31,30,31,30,31,31,30,31,30,31];function Nd(n){return n%400===0||n%4===0&&n%100!==0}function T0(n,r,e){return r>=0&&r<=11&&e>=1&&e<=(M0[r]||(Nd(n)?29:28))}function P0(n,r){return r>=1&&r<=(Nd(n)?366:365)}function I0(n,r,e){return r>=1&&r<=53&&e>=0&&e<=6}function N0(n,r,e){return n===24?r===0&&e===0:e>=0&&e<60&&r>=0&&r<60&&n>=0&&n<25}function $0(n,r){return r>=0&&r<=59}function pt(n,r,e){const t=ae(n,e==null?void 0:e.in),o=t.getFullYear(),a=t.getDate(),i=De(n,0);i.setFullYear(o,r,15),i.setHours(0,0,0,0);const s=mw(i);return t.setMonth(r,Math.min(a,s)),t}function ta(n,r,e){const t=ae(n,e==null?void 0:e.in);return t.setHours(r),t}function na(n,r,e){const t=ae(n,e==null?void 0:e.in);return t.setMinutes(r),t}function nr(n,r,e){const t=ae(n,e==null?void 0:e.in),o=Math.trunc(t.getMonth()/3)+1,a=r-o;return pt(t,t.getMonth()+a*3)}function ra(n,r,e){const t=ae(n,e==null?void 0:e.in);return t.setSeconds(r),t}function It(n,r,e){const t=ae(n,e==null?void 0:e.in);return isNaN(+t)?De(n,NaN):(t.setFullYear(r),t)}function In(n,r,e){return wt(n,-r,e)}function $d(n,r,e){return Ki(n,-1,e)}function Ld(n,r,e){return Uo(n,-1,e)}function rr(n,r,e){return Gt(n,-r,e)}const L0={lessThanXSeconds:{one:"1초 미만",other:"{{count}}초 미만"},xSeconds:{one:"1초",other:"{{count}}초"},halfAMinute:"30초",lessThanXMinutes:{one:"1분 미만",other:"{{count}}분 미만"},xMinutes:{one:"1분",other:"{{count}}분"},aboutXHours:{one:"약 1시간",other:"약 {{count}}시간"},xHours:{one:"1시간",other:"{{count}}시간"},xDays:{one:"1일",other:"{{count}}일"},aboutXWeeks:{one:"약 1주",other:"약 {{count}}주"},xWeeks:{one:"1주",other:"{{count}}주"},aboutXMonths:{one:"약 1개월",other:"약 {{count}}개월"},xMonths:{one:"1개월",other:"{{count}}개월"},aboutXYears:{one:"약 1년",other:"약 {{count}}년"},xYears:{one:"1년",other:"{{count}}년"},overXYears:{one:"1년 이상",other:"{{count}}년 이상"},almostXYears:{one:"거의 1년",other:"거의 {{count}}년"}},F0=(n,r,e)=>{let t;const o=L0[n];return typeof o=="string"?t=o:r===1?t=o.one:t=o.other.replace("{{count}}",r.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?t+" 후":t+" 전":t},A0={full:"y년 M월 d일 EEEE",long:"y년 M월 d일",medium:"y.MM.dd",short:"y.MM.dd"},R0={full:"a H시 mm분 ss초 zzzz",long:"a H:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},Y0={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},W0={date:er({formats:A0,defaultWidth:"full"}),time:er({formats:R0,defaultWidth:"full"}),dateTime:er({formats:Y0,defaultWidth:"full"})},j0={lastWeek:"'지난' eeee p",yesterday:"'어제' p",today:"'오늘' p",tomorrow:"'내일' p",nextWeek:"'다음' eeee p",other:"P"},H0=(n,r,e,t)=>j0[n],B0={narrow:["BC","AD"],abbreviated:["BC","AD"],wide:["기원전","서기"]},V0={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1분기","2분기","3분기","4분기"]},z0={narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],abbreviated:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],wide:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"]},q0={narrow:["일","월","화","수","목","금","토"],short:["일","월","화","수","목","금","토"],abbreviated:["일","월","화","수","목","금","토"],wide:["일요일","월요일","화요일","수요일","목요일","금요일","토요일"]},U0={narrow:{am:"오전",pm:"오후",midnight:"자정",noon:"정오",morning:"아침",afternoon:"오후",evening:"저녁",night:"밤"},abbreviated:{am:"오전",pm:"오후",midnight:"자정",noon:"정오",morning:"아침",afternoon:"오후",evening:"저녁",night:"밤"},wide:{am:"오전",pm:"오후",midnight:"자정",noon:"정오",morning:"아침",afternoon:"오후",evening:"저녁",night:"밤"}},Q0={narrow:{am:"오전",pm:"오후",midnight:"자정",noon:"정오",morning:"아침",afternoon:"오후",evening:"저녁",night:"밤"},abbreviated:{am:"오전",pm:"오후",midnight:"자정",noon:"정오",morning:"아침",afternoon:"오후",evening:"저녁",night:"밤"},wide:{am:"오전",pm:"오후",midnight:"자정",noon:"정오",morning:"아침",afternoon:"오후",evening:"저녁",night:"밤"}},G0={ordinalNumber:(n,r)=>{const e=Number(n);switch(String(r==null?void 0:r.unit)){case"minute":case"second":return String(e);case"date":return e+"일";default:return e+"번째"}},era:Ot({values:B0,defaultWidth:"wide"}),quarter:Ot({values:V0,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Ot({values:z0,defaultWidth:"wide"}),day:Ot({values:q0,defaultWidth:"wide"}),dayPeriod:Ot({values:U0,defaultWidth:"wide",formattingValues:Q0,defaultFormattingWidth:"wide"})},K0=/^(\d+)(일|번째)?/i,X0=/\d+/i,J0={narrow:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(기원전|서기)/i},Z0={any:[/^(bc|기원전)/i,/^(ad|서기)/i]},ex={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234]사?분기/i},tx={any:[/1/i,/2/i,/3/i,/4/i]},nx={narrow:/^(1[012]|[123456789])/,abbreviated:/^(1[012]|[123456789])월/i,wide:/^(1[012]|[123456789])월/i},rx={any:[/^1월?$/,/^2/,/^3/,/^4/,/^5/,/^6/,/^7/,/^8/,/^9/,/^10/,/^11/,/^12/]},ox={narrow:/^[일월화수목금토]/,short:/^[일월화수목금토]/,abbreviated:/^[일월화수목금토]/,wide:/^[일월화수목금토]요일/},ax={any:[/^일/,/^월/,/^화/,/^수/,/^목/,/^금/,/^토/]},ix={any:/^(am|pm|오전|오후|자정|정오|아침|저녁|밤)/i},sx={any:{am:/^(am|오전)/i,pm:/^(pm|오후)/i,midnight:/^자정/i,noon:/^정오/i,morning:/^아침/i,afternoon:/^오후/i,evening:/^저녁/i,night:/^밤/i}},lx={ordinalNumber:yd({matchPattern:K0,parsePattern:X0,valueCallback:n=>parseInt(n,10)}),era:Mt({matchPatterns:J0,defaultMatchWidth:"wide",parsePatterns:Z0,defaultParseWidth:"any"}),quarter:Mt({matchPatterns:ex,defaultMatchWidth:"wide",parsePatterns:tx,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Mt({matchPatterns:nx,defaultMatchWidth:"wide",parsePatterns:rx,defaultParseWidth:"any"}),day:Mt({matchPatterns:ox,defaultMatchWidth:"wide",parsePatterns:ax,defaultParseWidth:"any"}),dayPeriod:Mt({matchPatterns:ix,defaultMatchWidth:"any",parsePatterns:sx,defaultParseWidth:"any"})},ux={code:"ko",formatDistance:F0,formatLong:W0,formatRelative:H0,localize:G0,match:lx,options:{weekStartsOn:0,firstWeekContainsDate:1}};function cx(){return typeof window<"u"}function Fd(n){var r;return(n==null||(r=n.ownerDocument)==null?void 0:r.defaultView)||window}function zr(n){return cx()?n instanceof Element||n instanceof Fd(n).Element:!1}function dx(n){return Fd(n).getComputedStyle(n)}var oa=typeof document<"u"?d.useLayoutEffect:d.useEffect;const fx={...H}.useInsertionEffect||(n=>n());function px(n){const r=H.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return fx(()=>{r.current=n}),H.useCallback(function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return r.current==null?void 0:r.current(...t)},[])}function Ad(n,r,e){let{reference:t,floating:o}=n;const a=it(r),i=_o(r),s=Co(i),l=ft(r),u=a==="y",c=t.x+t.width/2-o.width/2,f=t.y+t.height/2-o.height/2,h=t[s]/2-o[s]/2;let p;switch(l){case"top":p={x:c,y:t.y-o.height};break;case"bottom":p={x:c,y:t.y+t.height};break;case"right":p={x:t.x+t.width,y:f};break;case"left":p={x:t.x-o.width,y:f};break;default:p={x:t.x,y:t.y}}switch(fn(r)){case"start":p[i]-=h*(e&&u?-1:1);break;case"end":p[i]+=h*(e&&u?-1:1);break}return p}const hx=async(n,r,e)=>{const{placement:t="bottom",strategy:o="absolute",middleware:a=[],platform:i}=e,s=a.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(r));let u=await i.getElementRects({reference:n,floating:r,strategy:o}),{x:c,y:f}=Ad(u,t,l),h=t,p={},m=0;for(let v=0;v<s.length;v++){const{name:g,fn:y}=s[v],{x:E,y:w,data:S,reset:x}=await y({x:c,y:f,initialPlacement:t,placement:h,strategy:o,middlewareData:p,rects:u,platform:i,elements:{reference:n,floating:r}});c=E??c,f=w??f,p={...p,[g]:{...p[g],...S}},x&&m<=50&&(m++,typeof x=="object"&&(x.placement&&(h=x.placement),x.rects&&(u=x.rects===!0?await i.getElementRects({reference:n,floating:r,strategy:o}):x.rects),{x:c,y:f}=Ad(u,h,l)),v=-1)}return{x:c,y:f,placement:h,strategy:o,middlewareData:p}};async function mx(n,r){var e;r===void 0&&(r={});const{x:t,y:o,platform:a,rects:i,elements:s,strategy:l}=n,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=St(r,n),m=Mi(p),g=s[h?f==="floating"?"reference":"floating":f],y=pn(await a.getClippingRect({element:(e=await(a.isElement==null?void 0:a.isElement(g)))==null||e?g:g.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:l})),E=f==="floating"?{x:t,y:o,width:i.floating.width,height:i.floating.height}:i.reference,w=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),S=await(a.isElement==null?void 0:a.isElement(w))?await(a.getScale==null?void 0:a.getScale(w))||{x:1,y:1}:{x:1,y:1},x=pn(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:E,offsetParent:w,strategy:l}):E);return{top:(y.top-x.top+m.top)/S.y,bottom:(x.bottom-y.bottom+m.bottom)/S.y,left:(y.left-x.left+m.left)/S.x,right:(x.right-y.right+m.right)/S.x}}const vx=n=>({name:"arrow",options:n,async fn(r){const{x:e,y:t,placement:o,rects:a,platform:i,elements:s,middlewareData:l}=r,{element:u,padding:c=0}=St(n,r)||{};if(u==null)return{};const f=Mi(c),h={x:e,y:t},p=_o(o),m=Co(p),v=await i.getDimensions(u),g=p==="y",y=g?"top":"left",E=g?"bottom":"right",w=g?"clientHeight":"clientWidth",S=a.reference[m]+a.reference[p]-h[p]-a.floating[m],x=h[p]-a.reference[p],T=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let N=T?T[w]:0;(!N||!await(i.isElement==null?void 0:i.isElement(T)))&&(N=s.floating[w]||a.floating[m]);const _=S/2-x/2,O=N/2-v[m]/2-1,M=dt(f[y],O),L=dt(f[E],O),b=M,k=N-v[m]-L,$=N/2-v[m]/2+_,Y=_i(b,$,k),I=!l.arrow&&fn(o)!=null&&$!==Y&&a.reference[m]/2-($<b?M:L)-v[m]/2<0,V=I?$<b?$-b:$-k:0;return{[p]:h[p]+V,data:{[p]:Y,centerOffset:$-Y-V,...I&&{alignmentOffset:V}},reset:I}}}),gx=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(r){var e,t;const{placement:o,middlewareData:a,rects:i,initialPlacement:s,platform:l,elements:u}=r,{mainAxis:c=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:v=!0,...g}=St(n,r);if((e=a.arrow)!=null&&e.alignmentOffset)return{};const y=ft(o),E=it(s),w=ft(s)===s,S=await(l.isRTL==null?void 0:l.isRTL(u.floating)),x=h||(w||!v?[$r(s)]:Wu(s)),T=m!=="none";!h&&T&&x.push(...Bu(s,v,m,S));const N=[s,...x],_=await mx(r,g),O=[];let M=((t=a.flip)==null?void 0:t.overflows)||[];if(c&&O.push(_[y]),f){const $=Yu(o,i,S);O.push(_[$[0]],_[$[1]])}if(M=[...M,{placement:o,overflows:O}],!O.every($=>$<=0)){var L,b;const $=(((L=a.flip)==null?void 0:L.index)||0)+1,Y=N[$];if(Y)return{data:{index:$,overflows:M},reset:{placement:Y}};let I=(b=M.filter(V=>V.overflows[0]<=0).sort((V,C)=>V.overflows[1]-C.overflows[1])[0])==null?void 0:b.placement;if(!I)switch(p){case"bestFit":{var k;const V=(k=M.filter(C=>{if(T){const q=it(C.placement);return q===E||q==="y"}return!0}).map(C=>[C.placement,C.overflows.filter(q=>q>0).reduce((q,P)=>q+P,0)]).sort((C,q)=>C[1]-q[1])[0])==null?void 0:k[0];V&&(I=V);break}case"initialPlacement":I=s;break}if(o!==I)return{reset:{placement:I}}}return{}}}};async function bx(n,r){const{placement:e,platform:t,elements:o}=n,a=await(t.isRTL==null?void 0:t.isRTL(o.floating)),i=ft(e),s=fn(e),l=it(e)==="y",u=["left","top"].includes(i)?-1:1,c=a&&l?-1:1,f=St(r,n);let{mainAxis:h,crossAxis:p,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return s&&typeof m=="number"&&(p=s==="end"?m*-1:m),l?{x:p*c,y:h*u}:{x:h*u,y:p*c}}const yx=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(r){var e,t;const{x:o,y:a,placement:i,middlewareData:s}=r,l=await bx(r,n);return i===((e=s.offset)==null?void 0:e.placement)&&(t=s.arrow)!=null&&t.alignmentOffset?{}:{x:o+l.x,y:a+l.y,data:{...l,placement:i}}}}};function Rd(n){const r=He(n);let e=parseFloat(r.width)||0,t=parseFloat(r.height)||0;const o=Ge(n),a=o?n.offsetWidth:e,i=o?n.offsetHeight:t,s=qt(e)!==a||qt(t)!==i;return s&&(e=a,t=i),{width:e,height:t,$:s}}function as(n){return Oe(n)?n:n.contextElement}function or(n){const r=as(n);if(!Ge(r))return Be(1);const e=r.getBoundingClientRect(),{width:t,height:o,$:a}=Rd(r);let i=(a?qt(e.width):e.width)/t,s=(a?qt(e.height):e.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!s||!Number.isFinite(s))&&(s=1),{x:i,y:s}}const wx=Be(0);function Yd(n){const r=je(n);return!Ir()||!r.visualViewport?wx:{x:r.visualViewport.offsetLeft,y:r.visualViewport.offsetTop}}function xx(n,r,e){return r===void 0&&(r=!1),!e||r&&e!==je(n)?!1:r}function Nn(n,r,e,t){r===void 0&&(r=!1),e===void 0&&(e=!1);const o=n.getBoundingClientRect(),a=as(n);let i=Be(1);r&&(t?Oe(t)&&(i=or(t)):i=or(n));const s=xx(a,e,t)?Yd(a):Be(0);let l=(o.left+s.x)/i.x,u=(o.top+s.y)/i.y,c=o.width/i.x,f=o.height/i.y;if(a){const h=je(a),p=t&&Oe(t)?je(t):t;let m=h,v=Nr(m);for(;v&&t&&p!==m;){const g=or(v),y=v.getBoundingClientRect(),E=He(v),w=y.left+(v.clientLeft+parseFloat(E.paddingLeft))*g.x,S=y.top+(v.clientTop+parseFloat(E.paddingTop))*g.y;l*=g.x,u*=g.y,c*=g.x,f*=g.y,l+=w,u+=S,m=je(v),v=Nr(m)}}return pn({width:c,height:f,x:l,y:u})}function is(n,r){const e=un(n).scrollLeft;return r?r.left+e:Nn(qe(n)).left+e}function Wd(n,r,e){e===void 0&&(e=!1);const t=n.getBoundingClientRect(),o=t.left+r.scrollLeft-(e?0:is(n,t)),a=t.top+r.scrollTop;return{x:o,y:a}}function Ex(n){let{elements:r,rect:e,offsetParent:t,strategy:o}=n;const a=o==="fixed",i=qe(t),s=r?Sn(r.floating):!1;if(t===i||s&&a)return e;let l={scrollLeft:0,scrollTop:0},u=Be(1);const c=Be(0),f=Ge(t);if((f||!f&&!a)&&((zt(t)!=="body"||ln(i))&&(l=un(t)),Ge(t))){const p=Nn(t);u=or(t),c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}const h=i&&!f&&!a?Wd(i,l,!0):Be(0);return{width:e.width*u.x,height:e.height*u.y,x:e.x*u.x-l.scrollLeft*u.x+c.x+h.x,y:e.y*u.y-l.scrollTop*u.y+c.y+h.y}}function Dx(n){return Array.from(n.getClientRects())}function Sx(n){const r=qe(n),e=un(n),t=n.ownerDocument.body,o=Ne(r.scrollWidth,r.clientWidth,t.scrollWidth,t.clientWidth),a=Ne(r.scrollHeight,r.clientHeight,t.scrollHeight,t.clientHeight);let i=-e.scrollLeft+is(n);const s=-e.scrollTop;return He(t).direction==="rtl"&&(i+=Ne(r.clientWidth,t.clientWidth)-o),{width:o,height:a,x:i,y:s}}function kx(n,r){const e=je(n),t=qe(n),o=e.visualViewport;let a=t.clientWidth,i=t.clientHeight,s=0,l=0;if(o){a=o.width,i=o.height;const u=Ir();(!u||u&&r==="fixed")&&(s=o.offsetLeft,l=o.offsetTop)}return{width:a,height:i,x:s,y:l}}function Cx(n,r){const e=Nn(n,!0,r==="fixed"),t=e.top+n.clientTop,o=e.left+n.clientLeft,a=Ge(n)?or(n):Be(1),i=n.clientWidth*a.x,s=n.clientHeight*a.y,l=o*a.x,u=t*a.y;return{width:i,height:s,x:l,y:u}}function jd(n,r,e){let t;if(r==="viewport")t=kx(n,e);else if(r==="document")t=Sx(qe(n));else if(Oe(r))t=Cx(r,e);else{const o=Yd(n);t={x:r.x-o.x,y:r.y-o.y,width:r.width,height:r.height}}return pn(t)}function Hd(n,r){const e=at(n);return e===r||!Oe(e)||Dt(e)?!1:He(e).position==="fixed"||Hd(e,r)}function _x(n,r){const e=r.get(n);if(e)return e;let t=cn(n,[],!1).filter(s=>Oe(s)&&zt(s)!=="body"),o=null;const a=He(n).position==="fixed";let i=a?at(n):n;for(;Oe(i)&&!Dt(i);){const s=He(i),l=Pr(i);!l&&s.position==="fixed"&&(o=null),(a?!l&&!o:!l&&s.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||ln(i)&&!l&&Hd(n,i))?t=t.filter(c=>c!==i):o=s,i=at(i)}return r.set(n,t),t}function Ox(n){let{element:r,boundary:e,rootBoundary:t,strategy:o}=n;const i=[...e==="clippingAncestors"?Sn(r)?[]:_x(r,this._c):[].concat(e),t],s=i[0],l=i.reduce((u,c)=>{const f=jd(r,c,o);return u.top=Ne(f.top,u.top),u.right=dt(f.right,u.right),u.bottom=dt(f.bottom,u.bottom),u.left=Ne(f.left,u.left),u},jd(r,s,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Mx(n){const{width:r,height:e}=Rd(n);return{width:r,height:e}}function Tx(n,r,e){const t=Ge(r),o=qe(r),a=e==="fixed",i=Nn(n,!0,a,r);let s={scrollLeft:0,scrollTop:0};const l=Be(0);if(t||!t&&!a)if((zt(r)!=="body"||ln(o))&&(s=un(r)),t){const h=Nn(r,!0,a,r);l.x=h.x+r.clientLeft,l.y=h.y+r.clientTop}else o&&(l.x=is(o));const u=o&&!t&&!a?Wd(o,s):Be(0),c=i.left+s.scrollLeft-l.x-u.x,f=i.top+s.scrollTop-l.y-u.y;return{x:c,y:f,width:i.width,height:i.height}}function ss(n){return He(n).position==="static"}function Bd(n,r){if(!Ge(n)||He(n).position==="fixed")return null;if(r)return r(n);let e=n.offsetParent;return qe(n)===e&&(e=e.ownerDocument.body),e}function Vd(n,r){const e=je(n);if(Sn(n))return e;if(!Ge(n)){let o=at(n);for(;o&&!Dt(o);){if(Oe(o)&&!ss(o))return o;o=at(o)}return e}let t=Bd(n,r);for(;t&&Lu(t)&&ss(t);)t=Bd(t,r);return t&&Dt(t)&&ss(t)&&!Pr(t)?e:t||Fu(n)||e}const Px=async function(n){const r=this.getOffsetParent||Vd,e=this.getDimensions,t=await e(n.floating);return{reference:Tx(n.reference,await r(n.floating),n.strategy),floating:{x:0,y:0,width:t.width,height:t.height}}};function Ix(n){return He(n).direction==="rtl"}const Nx={convertOffsetParentRelativeRectToViewportRelativeRect:Ex,getDocumentElement:qe,getClippingRect:Ox,getOffsetParent:Vd,getElementRects:Px,getClientRects:Dx,getDimensions:Mx,getScale:or,isElement:Oe,isRTL:Ix};function zd(n,r){return n.x===r.x&&n.y===r.y&&n.width===r.width&&n.height===r.height}function $x(n,r){let e=null,t;const o=qe(n);function a(){var s;clearTimeout(t),(s=e)==null||s.disconnect(),e=null}function i(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),a();const u=n.getBoundingClientRect(),{left:c,top:f,width:h,height:p}=u;if(s||r(),!h||!p)return;const m=dn(f),v=dn(o.clientWidth-(c+h)),g=dn(o.clientHeight-(f+p)),y=dn(c),w={rootMargin:-m+"px "+-v+"px "+-g+"px "+-y+"px",threshold:Ne(0,dt(1,l))||1};let S=!0;function x(T){const N=T[0].intersectionRatio;if(N!==l){if(!S)return i();N?i(!1,N):t=setTimeout(()=>{i(!1,1e-7)},1e3)}N===1&&!zd(u,n.getBoundingClientRect())&&i(),S=!1}try{e=new IntersectionObserver(x,{...w,root:o.ownerDocument})}catch{e=new IntersectionObserver(x,w)}e.observe(n)}return i(!0),a}function Lx(n,r,e,t){t===void 0&&(t={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=t,u=as(n),c=o||a?[...u?cn(u):[],...cn(r)]:[];c.forEach(y=>{o&&y.addEventListener("scroll",e,{passive:!0}),a&&y.addEventListener("resize",e)});const f=u&&s?$x(u,e):null;let h=-1,p=null;i&&(p=new ResizeObserver(y=>{let[E]=y;E&&E.target===u&&p&&(p.unobserve(r),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=p)==null||w.observe(r)})),e()}),u&&!l&&p.observe(u),p.observe(r));let m,v=l?Nn(n):null;l&&g();function g(){const y=Nn(n);v&&!zd(v,y)&&e(),v=y,m=requestAnimationFrame(g)}return e(),()=>{var y;c.forEach(E=>{o&&E.removeEventListener("scroll",e),a&&E.removeEventListener("resize",e)}),f==null||f(),(y=p)==null||y.disconnect(),p=null,l&&cancelAnimationFrame(m)}}const Fx=yx,Ax=gx,qd=vx,Rx=(n,r,e)=>{const t=new Map,o={platform:Nx,...e},a={...o.platform,_c:t};return hx(n,r,{...o,platform:a})};var aa=typeof document<"u"?d.useLayoutEffect:d.useEffect;function ia(n,r){if(n===r)return!0;if(typeof n!=typeof r)return!1;if(typeof n=="function"&&n.toString()===r.toString())return!0;let e,t,o;if(n&&r&&typeof n=="object"){if(Array.isArray(n)){if(e=n.length,e!==r.length)return!1;for(t=e;t--!==0;)if(!ia(n[t],r[t]))return!1;return!0}if(o=Object.keys(n),e=o.length,e!==Object.keys(r).length)return!1;for(t=e;t--!==0;)if(!{}.hasOwnProperty.call(r,o[t]))return!1;for(t=e;t--!==0;){const a=o[t];if(!(a==="_owner"&&n.$$typeof)&&!ia(n[a],r[a]))return!1}return!0}return n!==n&&r!==r}function Ud(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function Qd(n,r){const e=Ud(n);return Math.round(r*e)/e}function ls(n){const r=H.useRef(n);return aa(()=>{r.current=n}),r}function Yx(n){n===void 0&&(n={});const{placement:r="bottom",strategy:e="absolute",middleware:t=[],platform:o,elements:{reference:a,floating:i}={},transform:s=!0,whileElementsMounted:l,open:u}=n,[c,f]=H.useState({x:0,y:0,strategy:e,placement:r,middlewareData:{},isPositioned:!1}),[h,p]=H.useState(t);ia(h,t)||p(t);const[m,v]=H.useState(null),[g,y]=H.useState(null),E=H.useCallback(C=>{C!==T.current&&(T.current=C,v(C))},[]),w=H.useCallback(C=>{C!==N.current&&(N.current=C,y(C))},[]),S=a||m,x=i||g,T=H.useRef(null),N=H.useRef(null),_=H.useRef(c),O=l!=null,M=ls(l),L=ls(o),b=ls(u),k=H.useCallback(()=>{if(!T.current||!N.current)return;const C={placement:r,strategy:e,middleware:h};L.current&&(C.platform=L.current),Rx(T.current,N.current,C).then(q=>{const P={...q,isPositioned:b.current!==!1};$.current&&!ia(_.current,P)&&(_.current=P,cr.flushSync(()=>{f(P)}))})},[h,r,e,L,b]);aa(()=>{u===!1&&_.current.isPositioned&&(_.current.isPositioned=!1,f(C=>({...C,isPositioned:!1})))},[u]);const $=H.useRef(!1);aa(()=>($.current=!0,()=>{$.current=!1}),[]),aa(()=>{if(S&&(T.current=S),x&&(N.current=x),S&&x){if(M.current)return M.current(S,x,k);k()}},[S,x,k,M,O]);const Y=H.useMemo(()=>({reference:T,floating:N,setReference:E,setFloating:w}),[E,w]),I=H.useMemo(()=>({reference:S,floating:x}),[S,x]),V=H.useMemo(()=>{const C={position:e,left:0,top:0};if(!I.floating)return C;const q=Qd(I.floating,c.x),P=Qd(I.floating,c.y);return s?{...C,transform:"translate("+q+"px, "+P+"px)",...Ud(I.floating)>=1.5&&{willChange:"transform"}}:{position:e,left:q,top:P}},[e,s,I.floating,c.x,c.y]);return H.useMemo(()=>({...c,update:k,refs:Y,elements:I,floatingStyles:V}),[c,k,Y,I,V])}const Wx=n=>{function r(e){return{}.hasOwnProperty.call(e,"current")}return{name:"arrow",options:n,fn(e){const{element:t,padding:o}=typeof n=="function"?n(e):n;return t&&r(t)?t.current!=null?qd({element:t.current,padding:o}).fn(e):{}:t?qd({element:t,padding:o}).fn(e):{}}}},jx=(n,r)=>({...Fx(n),options:[n,r]}),Hx=(n,r)=>({...Ax(n),options:[n,r]}),Bx=(n,r)=>({...Wx(n),options:[n,r]}),Vx={...H};let Gd=!1,zx=0;const Kd=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+zx++;function qx(){const[n,r]=H.useState(()=>Gd?Kd():void 0);return oa(()=>{n==null&&r(Kd())},[]),H.useEffect(()=>{Gd=!0},[]),n}const Xd=Vx.useId||qx;let qr;process.env.NODE_ENV!=="production"&&(qr=new Set);function Ux(){for(var n,r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];const o="Floating UI: "+e.join(" ");if(!((n=qr)!=null&&n.has(o))){var a;(a=qr)==null||a.add(o),console.warn(o)}}function Qx(){for(var n,r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];const o="Floating UI: "+e.join(" ");if(!((n=qr)!=null&&n.has(o))){var a;(a=qr)==null||a.add(o),console.error(o)}}const Gx=H.forwardRef(function(r,e){const{context:{placement:t,elements:{floating:o},middlewareData:{arrow:a,shift:i}},width:s=14,height:l=7,tipRadius:u=0,strokeWidth:c=0,staticOffset:f,stroke:h,d:p,style:{transform:m,...v}={},...g}=r;process.env.NODE_ENV!=="production"&&(e||Ux("The `ref` prop is required for `FloatingArrow`."));const y=Xd(),[E,w]=H.useState(!1);if(oa(()=>{if(!o)return;dx(o).direction==="rtl"&&w(!0)},[o]),!o)return null;const[S,x]=t.split("-"),T=S==="top"||S==="bottom";let N=f;(T&&i!=null&&i.x||!T&&i!=null&&i.y)&&(N=null);const _=c*2,O=_/2,M=s/2*(u/-8+1),L=l/2*u/4,b=!!p,k=N&&x==="end"?"bottom":"top";let $=N&&x==="end"?"right":"left";N&&E&&($=x==="end"?"left":"right");const Y=(a==null?void 0:a.x)!=null?N||a.x:"",I=(a==null?void 0:a.y)!=null?N||a.y:"",V=p||"M0,0"+(" H"+s)+(" L"+(s-M)+","+(l-L))+(" Q"+s/2+","+l+" "+M+","+(l-L))+" Z",C={top:b?"rotate(180deg)":"",left:b?"rotate(90deg)":"rotate(-90deg)",bottom:b?"":"rotate(180deg)",right:b?"rotate(-90deg)":"rotate(90deg)"}[S];return R.jsxs("svg",{...g,"aria-hidden":!0,ref:e,width:b?s:s+_,height:s,viewBox:"0 0 "+s+" "+(l>s?l:s),style:{position:"absolute",pointerEvents:"none",[$]:Y,[k]:I,[S]:T||b?"100%":"calc(100% - "+_/2+"px)",transform:[C,m].filter(q=>!!q).join(" "),...v},children:[_>0&&R.jsx("path",{clipPath:"url(#"+y+")",fill:"none",stroke:h,strokeWidth:_+(p?0:1),d:V}),R.jsx("path",{stroke:_&&!p?g.fill:"none",d:V}),R.jsx("clipPath",{id:y,children:R.jsx("rect",{x:-O,y:O*(b?-1:1),width:s+_,height:s})})]})});function Kx(){const n=new Map;return{emit(r,e){var t;(t=n.get(r))==null||t.forEach(o=>o(e))},on(r,e){n.has(r)||n.set(r,new Set),n.get(r).add(e)},off(r,e){var t;(t=n.get(r))==null||t.delete(e)}}}const Xx=H.createContext(null),Jx=H.createContext(null),Zx=()=>{var n;return((n=H.useContext(Xx))==null?void 0:n.id)||null},eE=()=>H.useContext(Jx);function tE(n){const{open:r=!1,onOpenChange:e,elements:t}=n,o=Xd(),a=H.useRef({}),[i]=H.useState(()=>Kx()),s=Zx()!=null;if(process.env.NODE_ENV!=="production"){const p=t.reference;p&&!zr(p)&&Qx("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,u]=H.useState(t.reference),c=px((p,m,v)=>{a.current.openEvent=p?m:void 0,i.emit("openchange",{open:p,event:m,reason:v,nested:s}),e==null||e(p,m,v)}),f=H.useMemo(()=>({setPositionReference:u}),[]),h=H.useMemo(()=>({reference:l||t.reference||null,floating:t.floating||null,domReference:t.reference}),[l,t.reference,t.floating]);return H.useMemo(()=>({dataRef:a,open:r,onOpenChange:c,elements:h,events:i,floatingId:o,refs:f}),[r,c,h,i,o,f])}function nE(n){n===void 0&&(n={});const{nodeId:r}=n,e=tE({...n,elements:{reference:null,floating:null,...n.elements}}),t=n.rootContext||e,o=t.elements,[a,i]=H.useState(null),[s,l]=H.useState(null),c=(o==null?void 0:o.domReference)||a,f=H.useRef(null),h=eE();oa(()=>{c&&(f.current=c)},[c]);const p=Yx({...n,elements:{...o,...s&&{reference:s}}}),m=H.useCallback(w=>{const S=zr(w)?{getBoundingClientRect:()=>w.getBoundingClientRect(),getClientRects:()=>w.getClientRects(),contextElement:w}:w;l(S),p.refs.setReference(S)},[p.refs]),v=H.useCallback(w=>{(zr(w)||w===null)&&(f.current=w,i(w)),(zr(p.refs.reference.current)||p.refs.reference.current===null||w!==null&&!zr(w))&&p.refs.setReference(w)},[p.refs]),g=H.useMemo(()=>({...p.refs,setReference:v,setPositionReference:m,domReference:f}),[p.refs,v,m]),y=H.useMemo(()=>({...p.elements,domReference:c}),[p.elements,c]),E=H.useMemo(()=>({...p,...t,refs:g,elements:y,nodeId:r}),[p,g,y,r,t]);return oa(()=>{t.dataRef.current.floatingContext=E;const w=h==null?void 0:h.nodesRef.current.find(S=>S.id===r);w&&(w.context=E)}),H.useMemo(()=>({...p,context:E,refs:g,elements:y}),[p,g,y,E])}/*!
76
+ `)),[]});var zm=(n=>(n[n.None=0]="None",n[n.Closed=1]="Closed",n[n.Enter=2]="Enter",n[n.Leave=4]="Leave",n))(zm||{});function ki(n){let r={};for(let e in n)n[e]===!0&&(r[`data-${e}`]="");return r}function Ci(n,r,e,t){let[o,a]=d.useState(e),{hasFlag:i,addFlag:s,removeFlag:l}=Vm(n&&o?3:0),u=d.useRef(!1),c=d.useRef(!1),f=rn();return fe(()=>{var h;if(n){if(e&&a(!0),!r){e&&s(3);return}return(h=t==null?void 0:t.start)==null||h.call(t,e),qm(r,{inFlight:u,prepare(){c.current?c.current=!1:c.current=u.current,u.current=!0,!c.current&&(e?(s(3),l(4)):(s(4),l(2)))},run(){c.current?e?(l(3),s(4)):(l(4),s(3)):e?l(1):s(1)},done(){var p;c.current&&typeof r.getAnimations=="function"&&r.getAnimations().length>0||(u.current=!1,l(7),e||a(!1),(p=t==null?void 0:t.end)==null||p.call(t,e))}})}},[n,e,r,f]),n?[o,{closed:i(1),enter:i(2),leave:i(4),transition:i(2)||i(4)}]:[e,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function qm(n,{prepare:r,run:e,done:t,inFlight:o}){let a=ut();return Qm(n,{prepare:r,inFlight:o}),a.nextFrame(()=>{e(),a.requestAnimationFrame(()=>{a.add(Um(n,t))})}),a.dispose}function Um(n,r){var e,t;let o=ut();if(!n)return o.dispose;let a=!1;o.add(()=>{a=!0});let i=(t=(e=n.getAnimations)==null?void 0:e.call(n).filter(s=>s instanceof CSSTransition))!=null?t:[];return i.length===0?(r(),o.dispose):(Promise.allSettled(i.map(s=>s.finished)).then(()=>{a||r()}),o.dispose)}function Qm(n,{inFlight:r,prepare:e}){if(r!=null&&r.current){e();return}let t=n.style.transition;n.style.transition="none",e(),n.offsetHeight,n.style.transition=t}function Gm(n,{container:r,accept:e,walk:t}){let o=d.useRef(e),a=d.useRef(t);d.useEffect(()=>{o.current=e,a.current=t},[e,t]),fe(()=>{if(!r||!n)return;let i=En(r);if(!i)return;let s=o.current,l=a.current,u=Object.assign(f=>s(f),{acceptNode:s}),c=i.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,u,!1);for(;c.nextNode();)l(c.currentNode)},[r,n,o,a])}function Tr(n,r){let e=d.useRef([]),t=Z(n);d.useEffect(()=>{let o=[...e.current];for(let[a,i]of r.entries())if(e.current[a]!==i){let s=t(r,o);return e.current=r,s}},[t,...r])}function ko(){return typeof window<"u"}function zt(n){return Nu(n)?(n.nodeName||"").toLowerCase():"#document"}function je(n){var r;return(n==null||(r=n.ownerDocument)==null?void 0:r.defaultView)||window}function qe(n){var r;return(r=(Nu(n)?n.ownerDocument:n.document)||window.document)==null?void 0:r.documentElement}function Nu(n){return ko()?n instanceof Node||n instanceof je(n).Node:!1}function Oe(n){return ko()?n instanceof Element||n instanceof je(n).Element:!1}function Ge(n){return ko()?n instanceof HTMLElement||n instanceof je(n).HTMLElement:!1}function $u(n){return!ko()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof je(n).ShadowRoot}const Km=new Set(["inline","contents"]);function ln(n){const{overflow:r,overflowX:e,overflowY:t,display:o}=He(n);return/auto|scroll|overlay|hidden|clip/.test(r+t+e)&&!Km.has(o)}const Xm=new Set(["table","td","th"]);function Lu(n){return Xm.has(zt(n))}const Jm=[":popover-open",":modal"];function Sn(n){return Jm.some(r=>{try{return n.matches(r)}catch{return!1}})}const Zm=["transform","translate","scale","rotate","perspective"],ev=["transform","translate","scale","rotate","perspective","filter"],tv=["paint","layout","strict","content"];function Pr(n){const r=Ir(),e=Oe(n)?He(n):n;return Zm.some(t=>e[t]?e[t]!=="none":!1)||(e.containerType?e.containerType!=="normal":!1)||!r&&(e.backdropFilter?e.backdropFilter!=="none":!1)||!r&&(e.filter?e.filter!=="none":!1)||ev.some(t=>(e.willChange||"").includes(t))||tv.some(t=>(e.contain||"").includes(t))}function Fu(n){let r=at(n);for(;Ge(r)&&!Dt(r);){if(Pr(r))return r;if(Sn(r))return null;r=at(r)}return null}function Ir(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const nv=new Set(["html","body","#document"]);function Dt(n){return nv.has(zt(n))}function He(n){return je(n).getComputedStyle(n)}function un(n){return Oe(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function at(n){if(zt(n)==="html")return n;const r=n.assignedSlot||n.parentNode||$u(n)&&n.host||qe(n);return $u(r)?r.host:r}function Au(n){const r=at(n);return Dt(r)?n.ownerDocument?n.ownerDocument.body:n.body:Ge(r)&&ln(r)?r:Au(r)}function cn(n,r,e){var t;r===void 0&&(r=[]),e===void 0&&(e=!0);const o=Au(n),a=o===((t=n.ownerDocument)==null?void 0:t.body),i=je(o);if(a){const s=Nr(i);return r.concat(i,i.visualViewport||[],ln(o)?o:[],s&&e?cn(s):[])}return r.concat(o,cn(o,[],e))}function Nr(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function rv(){const n=navigator.userAgentData;return n&&Array.isArray(n.brands)?n.brands.map(r=>{let{brand:e,version:t}=r;return e+"/"+t}).join(" "):navigator.userAgent}const dt=Math.min,Ne=Math.max,qt=Math.round,dn=Math.floor,Be=n=>({x:n,y:n}),ov={left:"right",right:"left",bottom:"top",top:"bottom"},av={start:"end",end:"start"};function _i(n,r,e){return Ne(n,dt(r,e))}function St(n,r){return typeof n=="function"?n(r):n}function ft(n){return n.split("-")[0]}function fn(n){return n.split("-")[1]}function Ru(n){return n==="x"?"y":"x"}function Co(n){return n==="y"?"height":"width"}const iv=new Set(["top","bottom"]);function it(n){return iv.has(ft(n))?"y":"x"}function _o(n){return Ru(it(n))}function Yu(n,r,e){e===void 0&&(e=!1);const t=fn(n),o=_o(n),a=Co(o);let i=o==="x"?t===(e?"end":"start")?"right":"left":t==="start"?"bottom":"top";return r.reference[a]>r.floating[a]&&(i=$r(i)),[i,$r(i)]}function Wu(n){const r=$r(n);return[Oi(n),r,Oi(r)]}function Oi(n){return n.replace(/start|end/g,r=>av[r])}const ju=["left","right"],Hu=["right","left"],sv=["top","bottom"],lv=["bottom","top"];function uv(n,r,e){switch(n){case"top":case"bottom":return e?r?Hu:ju:r?ju:Hu;case"left":case"right":return r?sv:lv;default:return[]}}function Bu(n,r,e,t){const o=fn(n);let a=uv(ft(n),e==="start",t);return o&&(a=a.map(i=>i+"-"+o),r&&(a=a.concat(a.map(Oi)))),a}function $r(n){return n.replace(/left|right|bottom|top/g,r=>ov[r])}function cv(n){return{top:0,right:0,bottom:0,left:0,...n}}function Mi(n){return typeof n!="number"?cv(n):{top:n,right:n,bottom:n,left:n}}function pn(n){const{x:r,y:e,width:t,height:o}=n;return{width:t,height:o,top:e,left:r,right:r+t,bottom:e+o,x:r,y:e}}function Vu(n,r,e){let{reference:t,floating:o}=n;const a=it(r),i=_o(r),s=Co(i),l=ft(r),u=a==="y",c=t.x+t.width/2-o.width/2,f=t.y+t.height/2-o.height/2,h=t[s]/2-o[s]/2;let p;switch(l){case"top":p={x:c,y:t.y-o.height};break;case"bottom":p={x:c,y:t.y+t.height};break;case"right":p={x:t.x+t.width,y:f};break;case"left":p={x:t.x-o.width,y:f};break;default:p={x:t.x,y:t.y}}switch(fn(r)){case"start":p[i]-=h*(e&&u?-1:1);break;case"end":p[i]+=h*(e&&u?-1:1);break}return p}const dv=async(n,r,e)=>{const{placement:t="bottom",strategy:o="absolute",middleware:a=[],platform:i}=e,s=a.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(r));let u=await i.getElementRects({reference:n,floating:r,strategy:o}),{x:c,y:f}=Vu(u,t,l),h=t,p={},m=0;for(let v=0;v<s.length;v++){const{name:g,fn:y}=s[v],{x:E,y:w,data:S,reset:x}=await y({x:c,y:f,initialPlacement:t,placement:h,strategy:o,middlewareData:p,rects:u,platform:i,elements:{reference:n,floating:r}});c=E??c,f=w??f,p={...p,[g]:{...p[g],...S}},x&&m<=50&&(m++,typeof x=="object"&&(x.placement&&(h=x.placement),x.rects&&(u=x.rects===!0?await i.getElementRects({reference:n,floating:r,strategy:o}):x.rects),{x:c,y:f}=Vu(u,h,l)),v=-1)}return{x:c,y:f,placement:h,strategy:o,middlewareData:p}};async function Oo(n,r){var e;r===void 0&&(r={});const{x:t,y:o,platform:a,rects:i,elements:s,strategy:l}=n,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=St(r,n),m=Mi(p),g=s[h?f==="floating"?"reference":"floating":f],y=pn(await a.getClippingRect({element:(e=await(a.isElement==null?void 0:a.isElement(g)))==null||e?g:g.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:l})),E=f==="floating"?{x:t,y:o,width:i.floating.width,height:i.floating.height}:i.reference,w=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),S=await(a.isElement==null?void 0:a.isElement(w))?await(a.getScale==null?void 0:a.getScale(w))||{x:1,y:1}:{x:1,y:1},x=pn(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:E,offsetParent:w,strategy:l}):E);return{top:(y.top-x.top+m.top)/S.y,bottom:(x.bottom-y.bottom+m.bottom)/S.y,left:(y.left-x.left+m.left)/S.x,right:(x.right-y.right+m.right)/S.x}}const fv=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(r){var e,t;const{placement:o,middlewareData:a,rects:i,initialPlacement:s,platform:l,elements:u}=r,{mainAxis:c=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:v=!0,...g}=St(n,r);if((e=a.arrow)!=null&&e.alignmentOffset)return{};const y=ft(o),E=it(s),w=ft(s)===s,S=await(l.isRTL==null?void 0:l.isRTL(u.floating)),x=h||(w||!v?[$r(s)]:Wu(s)),T=m!=="none";!h&&T&&x.push(...Bu(s,v,m,S));const N=[s,...x],_=await Oo(r,g),O=[];let M=((t=a.flip)==null?void 0:t.overflows)||[];if(c&&O.push(_[y]),f){const $=Yu(o,i,S);O.push(_[$[0]],_[$[1]])}if(M=[...M,{placement:o,overflows:O}],!O.every($=>$<=0)){var L,b;const $=(((L=a.flip)==null?void 0:L.index)||0)+1,Y=N[$];if(Y&&(!(f==="alignment"?E!==it(Y):!1)||M.every(C=>it(C.placement)===E?C.overflows[0]>0:!0)))return{data:{index:$,overflows:M},reset:{placement:Y}};let I=(b=M.filter(V=>V.overflows[0]<=0).sort((V,C)=>V.overflows[1]-C.overflows[1])[0])==null?void 0:b.placement;if(!I)switch(p){case"bestFit":{var k;const V=(k=M.filter(C=>{if(T){const q=it(C.placement);return q===E||q==="y"}return!0}).map(C=>[C.placement,C.overflows.filter(q=>q>0).reduce((q,P)=>q+P,0)]).sort((C,q)=>C[1]-q[1])[0])==null?void 0:k[0];V&&(I=V);break}case"initialPlacement":I=s;break}if(o!==I)return{reset:{placement:I}}}return{}}}},pv=new Set(["left","top"]);async function hv(n,r){const{placement:e,platform:t,elements:o}=n,a=await(t.isRTL==null?void 0:t.isRTL(o.floating)),i=ft(e),s=fn(e),l=it(e)==="y",u=pv.has(i)?-1:1,c=a&&l?-1:1,f=St(r,n);let{mainAxis:h,crossAxis:p,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return s&&typeof m=="number"&&(p=s==="end"?m*-1:m),l?{x:p*c,y:h*u}:{x:h*u,y:p*c}}const mv=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(r){var e,t;const{x:o,y:a,placement:i,middlewareData:s}=r,l=await hv(r,n);return i===((e=s.offset)==null?void 0:e.placement)&&(t=s.arrow)!=null&&t.alignmentOffset?{}:{x:o+l.x,y:a+l.y,data:{...l,placement:i}}}}},vv=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(r){const{x:e,y:t,placement:o}=r,{mainAxis:a=!0,crossAxis:i=!1,limiter:s={fn:g=>{let{x:y,y:E}=g;return{x:y,y:E}}},...l}=St(n,r),u={x:e,y:t},c=await Oo(r,l),f=it(ft(o)),h=Ru(f);let p=u[h],m=u[f];if(a){const g=h==="y"?"top":"left",y=h==="y"?"bottom":"right",E=p+c[g],w=p-c[y];p=_i(E,p,w)}if(i){const g=f==="y"?"top":"left",y=f==="y"?"bottom":"right",E=m+c[g],w=m-c[y];m=_i(E,m,w)}const v=s.fn({...r,[h]:p,[f]:m});return{...v,data:{x:v.x-e,y:v.y-t,enabled:{[h]:a,[f]:i}}}}}},gv=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(r){var e,t;const{placement:o,rects:a,platform:i,elements:s}=r,{apply:l=()=>{},...u}=St(n,r),c=await Oo(r,u),f=ft(o),h=fn(o),p=it(o)==="y",{width:m,height:v}=a.floating;let g,y;f==="top"||f==="bottom"?(g=f,y=h===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(y=f,g=h==="end"?"top":"bottom");const E=v-c.top-c.bottom,w=m-c.left-c.right,S=dt(v-c[g],E),x=dt(m-c[y],w),T=!r.middlewareData.shift;let N=S,_=x;if((e=r.middlewareData.shift)!=null&&e.enabled.x&&(_=w),(t=r.middlewareData.shift)!=null&&t.enabled.y&&(N=E),T&&!h){const M=Ne(c.left,0),L=Ne(c.right,0),b=Ne(c.top,0),k=Ne(c.bottom,0);p?_=m-2*(M!==0||L!==0?M+L:Ne(c.left,c.right)):N=v-2*(b!==0||k!==0?b+k:Ne(c.top,c.bottom))}await l({...r,availableWidth:_,availableHeight:N});const O=await i.getDimensions(s.floating);return m!==O.width||v!==O.height?{reset:{rects:!0}}:{}}}};function zu(n){const r=He(n);let e=parseFloat(r.width)||0,t=parseFloat(r.height)||0;const o=Ge(n),a=o?n.offsetWidth:e,i=o?n.offsetHeight:t,s=qt(e)!==a||qt(t)!==i;return s&&(e=a,t=i),{width:e,height:t,$:s}}function Ti(n){return Oe(n)?n:n.contextElement}function qn(n){const r=Ti(n);if(!Ge(r))return Be(1);const e=r.getBoundingClientRect(),{width:t,height:o,$:a}=zu(r);let i=(a?qt(e.width):e.width)/t,s=(a?qt(e.height):e.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!s||!Number.isFinite(s))&&(s=1),{x:i,y:s}}const bv=Be(0);function qu(n){const r=je(n);return!Ir()||!r.visualViewport?bv:{x:r.visualViewport.offsetLeft,y:r.visualViewport.offsetTop}}function yv(n,r,e){return r===void 0&&(r=!1),!e||r&&e!==je(n)?!1:r}function kn(n,r,e,t){r===void 0&&(r=!1),e===void 0&&(e=!1);const o=n.getBoundingClientRect(),a=Ti(n);let i=Be(1);r&&(t?Oe(t)&&(i=qn(t)):i=qn(n));const s=yv(a,e,t)?qu(a):Be(0);let l=(o.left+s.x)/i.x,u=(o.top+s.y)/i.y,c=o.width/i.x,f=o.height/i.y;if(a){const h=je(a),p=t&&Oe(t)?je(t):t;let m=h,v=Nr(m);for(;v&&t&&p!==m;){const g=qn(v),y=v.getBoundingClientRect(),E=He(v),w=y.left+(v.clientLeft+parseFloat(E.paddingLeft))*g.x,S=y.top+(v.clientTop+parseFloat(E.paddingTop))*g.y;l*=g.x,u*=g.y,c*=g.x,f*=g.y,l+=w,u+=S,m=je(v),v=Nr(m)}}return pn({width:c,height:f,x:l,y:u})}function Mo(n,r){const e=un(n).scrollLeft;return r?r.left+e:kn(qe(n)).left+e}function Uu(n,r){const e=n.getBoundingClientRect(),t=e.left+r.scrollLeft-Mo(n,e),o=e.top+r.scrollTop;return{x:t,y:o}}function wv(n){let{elements:r,rect:e,offsetParent:t,strategy:o}=n;const a=o==="fixed",i=qe(t),s=r?Sn(r.floating):!1;if(t===i||s&&a)return e;let l={scrollLeft:0,scrollTop:0},u=Be(1);const c=Be(0),f=Ge(t);if((f||!f&&!a)&&((zt(t)!=="body"||ln(i))&&(l=un(t)),Ge(t))){const p=kn(t);u=qn(t),c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}const h=i&&!f&&!a?Uu(i,l):Be(0);return{width:e.width*u.x,height:e.height*u.y,x:e.x*u.x-l.scrollLeft*u.x+c.x+h.x,y:e.y*u.y-l.scrollTop*u.y+c.y+h.y}}function xv(n){return Array.from(n.getClientRects())}function Ev(n){const r=qe(n),e=un(n),t=n.ownerDocument.body,o=Ne(r.scrollWidth,r.clientWidth,t.scrollWidth,t.clientWidth),a=Ne(r.scrollHeight,r.clientHeight,t.scrollHeight,t.clientHeight);let i=-e.scrollLeft+Mo(n);const s=-e.scrollTop;return He(t).direction==="rtl"&&(i+=Ne(r.clientWidth,t.clientWidth)-o),{width:o,height:a,x:i,y:s}}const Qu=25;function Dv(n,r){const e=je(n),t=qe(n),o=e.visualViewport;let a=t.clientWidth,i=t.clientHeight,s=0,l=0;if(o){a=o.width,i=o.height;const c=Ir();(!c||c&&r==="fixed")&&(s=o.offsetLeft,l=o.offsetTop)}const u=Mo(t);if(u<=0){const c=t.ownerDocument,f=c.body,h=getComputedStyle(f),p=c.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,m=Math.abs(t.clientWidth-f.clientWidth-p);m<=Qu&&(a-=m)}else u<=Qu&&(a+=u);return{width:a,height:i,x:s,y:l}}const Sv=new Set(["absolute","fixed"]);function kv(n,r){const e=kn(n,!0,r==="fixed"),t=e.top+n.clientTop,o=e.left+n.clientLeft,a=Ge(n)?qn(n):Be(1),i=n.clientWidth*a.x,s=n.clientHeight*a.y,l=o*a.x,u=t*a.y;return{width:i,height:s,x:l,y:u}}function Gu(n,r,e){let t;if(r==="viewport")t=Dv(n,e);else if(r==="document")t=Ev(qe(n));else if(Oe(r))t=kv(r,e);else{const o=qu(n);t={x:r.x-o.x,y:r.y-o.y,width:r.width,height:r.height}}return pn(t)}function Ku(n,r){const e=at(n);return e===r||!Oe(e)||Dt(e)?!1:He(e).position==="fixed"||Ku(e,r)}function Cv(n,r){const e=r.get(n);if(e)return e;let t=cn(n,[],!1).filter(s=>Oe(s)&&zt(s)!=="body"),o=null;const a=He(n).position==="fixed";let i=a?at(n):n;for(;Oe(i)&&!Dt(i);){const s=He(i),l=Pr(i);!l&&s.position==="fixed"&&(o=null),(a?!l&&!o:!l&&s.position==="static"&&!!o&&Sv.has(o.position)||ln(i)&&!l&&Ku(n,i))?t=t.filter(c=>c!==i):o=s,i=at(i)}return r.set(n,t),t}function _v(n){let{element:r,boundary:e,rootBoundary:t,strategy:o}=n;const i=[...e==="clippingAncestors"?Sn(r)?[]:Cv(r,this._c):[].concat(e),t],s=i[0],l=i.reduce((u,c)=>{const f=Gu(r,c,o);return u.top=Ne(f.top,u.top),u.right=dt(f.right,u.right),u.bottom=dt(f.bottom,u.bottom),u.left=Ne(f.left,u.left),u},Gu(r,s,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Ov(n){const{width:r,height:e}=zu(n);return{width:r,height:e}}function Mv(n,r,e){const t=Ge(r),o=qe(r),a=e==="fixed",i=kn(n,!0,a,r);let s={scrollLeft:0,scrollTop:0};const l=Be(0);function u(){l.x=Mo(o)}if(t||!t&&!a)if((zt(r)!=="body"||ln(o))&&(s=un(r)),t){const p=kn(r,!0,a,r);l.x=p.x+r.clientLeft,l.y=p.y+r.clientTop}else o&&u();a&&!t&&o&&u();const c=o&&!t&&!a?Uu(o,s):Be(0),f=i.left+s.scrollLeft-l.x-c.x,h=i.top+s.scrollTop-l.y-c.y;return{x:f,y:h,width:i.width,height:i.height}}function Pi(n){return He(n).position==="static"}function Xu(n,r){if(!Ge(n)||He(n).position==="fixed")return null;if(r)return r(n);let e=n.offsetParent;return qe(n)===e&&(e=e.ownerDocument.body),e}function Ju(n,r){const e=je(n);if(Sn(n))return e;if(!Ge(n)){let o=at(n);for(;o&&!Dt(o);){if(Oe(o)&&!Pi(o))return o;o=at(o)}return e}let t=Xu(n,r);for(;t&&Lu(t)&&Pi(t);)t=Xu(t,r);return t&&Dt(t)&&Pi(t)&&!Pr(t)?e:t||Fu(n)||e}const Tv=async function(n){const r=this.getOffsetParent||Ju,e=this.getDimensions,t=await e(n.floating);return{reference:Mv(n.reference,await r(n.floating),n.strategy),floating:{x:0,y:0,width:t.width,height:t.height}}};function Pv(n){return He(n).direction==="rtl"}const Iv={convertOffsetParentRelativeRectToViewportRelativeRect:wv,getDocumentElement:qe,getClippingRect:_v,getOffsetParent:Ju,getElementRects:Tv,getClientRects:xv,getDimensions:Ov,getScale:qn,isElement:Oe,isRTL:Pv};function Zu(n,r){return n.x===r.x&&n.y===r.y&&n.width===r.width&&n.height===r.height}function Nv(n,r){let e=null,t;const o=qe(n);function a(){var s;clearTimeout(t),(s=e)==null||s.disconnect(),e=null}function i(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),a();const u=n.getBoundingClientRect(),{left:c,top:f,width:h,height:p}=u;if(s||r(),!h||!p)return;const m=dn(f),v=dn(o.clientWidth-(c+h)),g=dn(o.clientHeight-(f+p)),y=dn(c),w={rootMargin:-m+"px "+-v+"px "+-g+"px "+-y+"px",threshold:Ne(0,dt(1,l))||1};let S=!0;function x(T){const N=T[0].intersectionRatio;if(N!==l){if(!S)return i();N?i(!1,N):t=setTimeout(()=>{i(!1,1e-7)},1e3)}N===1&&!Zu(u,n.getBoundingClientRect())&&i(),S=!1}try{e=new IntersectionObserver(x,{...w,root:o.ownerDocument})}catch{e=new IntersectionObserver(x,w)}e.observe(n)}return i(!0),a}function $v(n,r,e,t){t===void 0&&(t={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=t,u=Ti(n),c=o||a?[...u?cn(u):[],...cn(r)]:[];c.forEach(y=>{o&&y.addEventListener("scroll",e,{passive:!0}),a&&y.addEventListener("resize",e)});const f=u&&s?Nv(u,e):null;let h=-1,p=null;i&&(p=new ResizeObserver(y=>{let[E]=y;E&&E.target===u&&p&&(p.unobserve(r),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=p)==null||w.observe(r)})),e()}),u&&!l&&p.observe(u),p.observe(r));let m,v=l?kn(n):null;l&&g();function g(){const y=kn(n);v&&!Zu(v,y)&&e(),v=y,m=requestAnimationFrame(g)}return e(),()=>{var y;c.forEach(E=>{o&&E.removeEventListener("scroll",e),a&&E.removeEventListener("resize",e)}),f==null||f(),(y=p)==null||y.disconnect(),p=null,l&&cancelAnimationFrame(m)}}const Ii=Oo,Lv=mv,Fv=vv,Av=fv,Rv=gv,Yv=(n,r,e)=>{const t=new Map,o={platform:Iv,...e},a={...o.platform,_c:t};return dv(n,r,{...o,platform:a})};var Wv=typeof document<"u",jv=function(){},To=Wv?d.useLayoutEffect:jv;function Po(n,r){if(n===r)return!0;if(typeof n!=typeof r)return!1;if(typeof n=="function"&&n.toString()===r.toString())return!0;let e,t,o;if(n&&r&&typeof n=="object"){if(Array.isArray(n)){if(e=n.length,e!==r.length)return!1;for(t=e;t--!==0;)if(!Po(n[t],r[t]))return!1;return!0}if(o=Object.keys(n),e=o.length,e!==Object.keys(r).length)return!1;for(t=e;t--!==0;)if(!{}.hasOwnProperty.call(r,o[t]))return!1;for(t=e;t--!==0;){const a=o[t];if(!(a==="_owner"&&n.$$typeof)&&!Po(n[a],r[a]))return!1}return!0}return n!==n&&r!==r}function ec(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function tc(n,r){const e=ec(n);return Math.round(r*e)/e}function Ni(n){const r=H.useRef(n);return To(()=>{r.current=n}),r}function Hv(n){n===void 0&&(n={});const{placement:r="bottom",strategy:e="absolute",middleware:t=[],platform:o,elements:{reference:a,floating:i}={},transform:s=!0,whileElementsMounted:l,open:u}=n,[c,f]=H.useState({x:0,y:0,strategy:e,placement:r,middlewareData:{},isPositioned:!1}),[h,p]=H.useState(t);Po(h,t)||p(t);const[m,v]=H.useState(null),[g,y]=H.useState(null),E=H.useCallback(C=>{C!==T.current&&(T.current=C,v(C))},[]),w=H.useCallback(C=>{C!==N.current&&(N.current=C,y(C))},[]),S=a||m,x=i||g,T=H.useRef(null),N=H.useRef(null),_=H.useRef(c),O=l!=null,M=Ni(l),L=Ni(o),b=Ni(u),k=H.useCallback(()=>{if(!T.current||!N.current)return;const C={placement:r,strategy:e,middleware:h};L.current&&(C.platform=L.current),Yv(T.current,N.current,C).then(q=>{const P={...q,isPositioned:b.current!==!1};$.current&&!Po(_.current,P)&&(_.current=P,cr.flushSync(()=>{f(P)}))})},[h,r,e,L,b]);To(()=>{u===!1&&_.current.isPositioned&&(_.current.isPositioned=!1,f(C=>({...C,isPositioned:!1})))},[u]);const $=H.useRef(!1);To(()=>($.current=!0,()=>{$.current=!1}),[]),To(()=>{if(S&&(T.current=S),x&&(N.current=x),S&&x){if(M.current)return M.current(S,x,k);k()}},[S,x,k,M,O]);const Y=H.useMemo(()=>({reference:T,floating:N,setReference:E,setFloating:w}),[E,w]),I=H.useMemo(()=>({reference:S,floating:x}),[S,x]),V=H.useMemo(()=>{const C={position:e,left:0,top:0};if(!I.floating)return C;const q=tc(I.floating,c.x),P=tc(I.floating,c.y);return s?{...C,transform:"translate("+q+"px, "+P+"px)",...ec(I.floating)>=1.5&&{willChange:"transform"}}:{position:e,left:q,top:P}},[e,s,I.floating,c.x,c.y]);return H.useMemo(()=>({...c,update:k,refs:Y,elements:I,floatingStyles:V}),[c,k,Y,I,V])}const nc=(n,r)=>({...Lv(n),options:[n,r]}),Bv=(n,r)=>({...Fv(n),options:[n,r]}),Vv=(n,r)=>({...Av(n),options:[n,r]}),zv=(n,r)=>({...Rv(n),options:[n,r]}),rc={...H},qv=rc.useInsertionEffect||(n=>n());function oc(n){const r=H.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return qv(()=>{r.current=n}),H.useCallback(function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return r.current==null?void 0:r.current(...t)},[])}var $i=typeof document<"u"?d.useLayoutEffect:d.useEffect;let ac=!1,Uv=0;const ic=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Uv++;function Qv(){const[n,r]=H.useState(()=>ac?ic():void 0);return $i(()=>{n==null&&r(ic())},[]),H.useEffect(()=>{ac=!0},[]),n}const Gv=rc.useId||Qv;let Lr;process.env.NODE_ENV!=="production"&&(Lr=new Set);function Kv(){for(var n,r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];const o="Floating UI: "+e.join(" ");if(!((n=Lr)!=null&&n.has(o))){var a;(a=Lr)==null||a.add(o),console.warn(o)}}function Xv(){for(var n,r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];const o="Floating UI: "+e.join(" ");if(!((n=Lr)!=null&&n.has(o))){var a;(a=Lr)==null||a.add(o),console.error(o)}}function Jv(){const n=new Map;return{emit(r,e){var t;(t=n.get(r))==null||t.forEach(o=>o(e))},on(r,e){n.set(r,[...n.get(r)||[],e])},off(r,e){var t;n.set(r,((t=n.get(r))==null?void 0:t.filter(o=>o!==e))||[])}}}const Zv=H.createContext(null),eg=H.createContext(null),tg=()=>{var n;return((n=H.useContext(Zv))==null?void 0:n.id)||null},ng=()=>H.useContext(eg),rg="data-floating-ui-focusable";function og(n){const{open:r=!1,onOpenChange:e,elements:t}=n,o=Gv(),a=H.useRef({}),[i]=H.useState(()=>Jv()),s=tg()!=null;if(process.env.NODE_ENV!=="production"){const p=t.reference;p&&!Oe(p)&&Xv("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,u]=H.useState(t.reference),c=oc((p,m,v)=>{a.current.openEvent=p?m:void 0,i.emit("openchange",{open:p,event:m,reason:v,nested:s}),e==null||e(p,m,v)}),f=H.useMemo(()=>({setPositionReference:u}),[]),h=H.useMemo(()=>({reference:l||t.reference||null,floating:t.floating||null,domReference:t.reference}),[l,t.reference,t.floating]);return H.useMemo(()=>({dataRef:a,open:r,onOpenChange:c,elements:h,events:i,floatingId:o,refs:f}),[r,c,h,i,o,f])}function ag(n){n===void 0&&(n={});const{nodeId:r}=n,e=og({...n,elements:{reference:null,floating:null,...n.elements}}),t=n.rootContext||e,o=t.elements,[a,i]=H.useState(null),[s,l]=H.useState(null),c=(o==null?void 0:o.domReference)||a,f=H.useRef(null),h=ng();$i(()=>{c&&(f.current=c)},[c]);const p=Hv({...n,elements:{...o,...s&&{reference:s}}}),m=H.useCallback(w=>{const S=Oe(w)?{getBoundingClientRect:()=>w.getBoundingClientRect(),contextElement:w}:w;l(S),p.refs.setReference(S)},[p.refs]),v=H.useCallback(w=>{(Oe(w)||w===null)&&(f.current=w,i(w)),(Oe(p.refs.reference.current)||p.refs.reference.current===null||w!==null&&!Oe(w))&&p.refs.setReference(w)},[p.refs]),g=H.useMemo(()=>({...p.refs,setReference:v,setPositionReference:m,domReference:f}),[p.refs,v,m]),y=H.useMemo(()=>({...p.elements,domReference:c}),[p.elements,c]),E=H.useMemo(()=>({...p,...t,refs:g,elements:y,nodeId:r}),[p,g,y,r,t]);return $i(()=>{t.dataRef.current.floatingContext=E;const w=h==null?void 0:h.nodesRef.current.find(S=>S.id===r);w&&(w.context=E)}),H.useMemo(()=>({...p,context:E,refs:g,elements:y}),[p,g,y,E])}const sc="active",lc="selected";function Li(n,r,e){const t=new Map,o=e==="item";let a=n;if(o&&n){const{[sc]:i,[lc]:s,...l}=n;a=l}return{...e==="floating"&&{tabIndex:-1,[rg]:""},...a,...r.map(i=>{const s=i?i[e]:null;return typeof s=="function"?n?s(n):null:s}).concat(n).reduce((i,s)=>(s&&Object.entries(s).forEach(l=>{let[u,c]=l;if(!(o&&[sc,lc].includes(u)))if(u.indexOf("on")===0){if(t.has(u)||t.set(u,[]),typeof c=="function"){var f;(f=t.get(u))==null||f.push(c),i[u]=function(){for(var h,p=arguments.length,m=new Array(p),v=0;v<p;v++)m[v]=arguments[v];return(h=t.get(u))==null?void 0:h.map(g=>g(...m)).find(g=>g!==void 0)}}}else i[u]=c}),i),{})}}function ig(n){n===void 0&&(n=[]);const r=n.map(s=>s==null?void 0:s.reference),e=n.map(s=>s==null?void 0:s.floating),t=n.map(s=>s==null?void 0:s.item),o=H.useCallback(s=>Li(s,n,"reference"),r),a=H.useCallback(s=>Li(s,n,"floating"),e),i=H.useCallback(s=>Li(s,n,"item"),t);return H.useMemo(()=>({getReferenceProps:o,getFloatingProps:a,getItemProps:i}),[o,a,i])}function uc(n,r){return{...n,rects:{...n.rects,floating:{...n.rects.floating,height:r}}}}const sg=n=>({name:"inner",options:n,async fn(r){const{listRef:e,overflowRef:t,onFallbackChange:o,offset:a=0,index:i=0,minItemsVisible:s=4,referenceOverflowThreshold:l=0,scrollRef:u,...c}=St(n,r),{rects:f,elements:{floating:h}}=r,p=e.current[i],m=(u==null?void 0:u.current)||h,v=h.clientTop||m.clientTop,g=h.clientTop!==0,y=m.clientTop!==0,E=h===m;if(process.env.NODE_ENV!=="production"&&(r.placement.startsWith("bottom")||Kv('`placement` side must be "bottom" when using the `inner`',"middleware.")),!p)return{};const w={...r,...await nc(-p.offsetTop-h.clientTop-f.reference.height/2-p.offsetHeight/2-a).fn(r)},S=await Ii(uc(w,m.scrollHeight+v+h.clientTop),c),x=await Ii(w,{...c,elementContext:"reference"}),T=Ne(0,S.top),N=w.y+T,M=(m.scrollHeight>m.clientHeight?L=>L:qt)(Ne(0,m.scrollHeight+(g&&E||y?v*2:0)-T-Ne(0,S.bottom)));if(m.style.maxHeight=M+"px",m.scrollTop=T,o){const L=m.offsetHeight<p.offsetHeight*dt(s,e.current.length)-1||x.top>=-l||x.bottom>=-l;cr.flushSync(()=>o(L))}return t&&(t.current=await Ii(uc({...w,y:N},m.offsetHeight+v+h.clientTop),c)),{y:N}}});function lg(n,r){const{open:e,elements:t}=n,{enabled:o=!0,overflowRef:a,scrollRef:i,onChange:s}=r,l=oc(s),u=H.useRef(!1),c=H.useRef(null),f=H.useRef(null);H.useEffect(()=>{if(!o)return;function p(v){if(v.ctrlKey||!m||a.current==null)return;const g=v.deltaY,y=a.current.top>=-.5,E=a.current.bottom>=-.5,w=m.scrollHeight-m.clientHeight,S=g<0?-1:1,x=g<0?"max":"min";m.scrollHeight<=m.clientHeight||(!y&&g>0||!E&&g<0?(v.preventDefault(),cr.flushSync(()=>{l(T=>T+Math[x](g,w*S))})):/firefox/i.test(rv())&&(m.scrollTop+=g))}const m=(i==null?void 0:i.current)||t.floating;if(e&&m)return m.addEventListener("wheel",p),requestAnimationFrame(()=>{c.current=m.scrollTop,a.current!=null&&(f.current={...a.current})}),()=>{c.current=null,f.current=null,m.removeEventListener("wheel",p)}},[o,e,t.floating,a,i,l]);const h=H.useMemo(()=>({onKeyDown(){u.current=!0},onWheel(){u.current=!1},onPointerMove(){u.current=!1},onScroll(){const p=(i==null?void 0:i.current)||t.floating;if(!(!a.current||!p||!u.current)){if(c.current!==null){const m=p.scrollTop-c.current;(a.current.bottom<-.5&&m<-1||a.current.top<-.5&&m>1)&&cr.flushSync(()=>l(v=>v+m))}requestAnimationFrame(()=>{c.current=p.scrollTop})}}}),[t.floating,l,a,i]);return H.useMemo(()=>o?{floating:h}:{},[o,h])}let Un=d.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});Un.displayName="FloatingContext";let Fi=d.createContext(null);Fi.displayName="PlacementContext";function cc(n){return d.useMemo(()=>n?typeof n=="string"?{to:n}:n:null,[n])}function dc(){return d.useContext(Un).setReference}function ug(){return d.useContext(Un).getReferenceProps}function fc(){let{getFloatingProps:n,slot:r}=d.useContext(Un);return d.useCallback((...e)=>Object.assign({},n(...e),{"data-anchor":r.anchor}),[n,r])}function pc(n=null){n===!1&&(n=null),typeof n=="string"&&(n={to:n});let r=d.useContext(Fi),e=d.useMemo(()=>n,[JSON.stringify(n,(o,a)=>{var i;return(i=a==null?void 0:a.outerHTML)!=null?i:a})]);fe(()=>{r==null||r(e??null)},[r,e]);let t=d.useContext(Un);return d.useMemo(()=>[t.setFloating,n?t.styles:{}],[t.setFloating,n,t.styles])}let hc=4;function mc({children:n,enabled:r=!0}){let[e,t]=d.useState(null),[o,a]=d.useState(0),i=d.useRef(null),[s,l]=d.useState(null);cg(s);let u=r&&e!==null&&s!==null,{to:c="bottom",gap:f=0,offset:h=0,padding:p=0,inner:m}=dg(e,s),[v,g="center"]=c.split(" ");fe(()=>{u&&a(0)},[u]);let{refs:y,floatingStyles:E,context:w}=ag({open:u,placement:v==="selection"?g==="center"?"bottom":`bottom-${g}`:g==="center"?`${v}`:`${v}-${g}`,strategy:"absolute",transform:!1,middleware:[nc({mainAxis:v==="selection"?0:f,crossAxis:h}),Bv({padding:p}),v!=="selection"&&Vv({padding:p}),v==="selection"&&m?sg({...m,padding:p,overflowRef:i,offset:o,minItemsVisible:hc,referenceOverflowThreshold:p,onFallbackChange(L){var b,k;if(!L)return;let $=w.elements.floating;if(!$)return;let Y=parseFloat(getComputedStyle($).scrollPaddingBottom)||0,I=Math.min(hc,$.childElementCount),V=0,C=0;for(let q of(k=(b=w.elements.floating)==null?void 0:b.childNodes)!=null?k:[])if(tt(q)){let P=q.offsetTop,W=P+q.clientHeight+Y,G=$.scrollTop,j=G+$.clientHeight;if(P>=G&&W<=j)I--;else{C=Math.max(0,Math.min(W,j)-Math.max(P,G)),V=q.clientHeight;break}}I>=1&&a(q=>{let P=V*I-C+Y;return q>=P?q:P})}}):null,zv({padding:p,apply({availableWidth:L,availableHeight:b,elements:k}){Object.assign(k.floating.style,{overflow:"auto",maxWidth:`${L}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${b}px)`})}})].filter(Boolean),whileElementsMounted:$v}),[S=v,x=g]=w.placement.split("-");v==="selection"&&(S="selection");let T=d.useMemo(()=>({anchor:[S,x].filter(Boolean).join(" ")}),[S,x]),N=lg(w,{overflowRef:i,onChange:a}),{getReferenceProps:_,getFloatingProps:O}=ig([N]),M=Z(L=>{l(L),y.setFloating(L)});return H.createElement(Fi.Provider,{value:t},H.createElement(Un.Provider,{value:{setFloating:M,setReference:y.setReference,styles:E,getReferenceProps:_,getFloatingProps:O,slot:T}},n))}function cg(n){fe(()=>{if(!n)return;let r=new MutationObserver(()=>{let e=window.getComputedStyle(n).maxHeight,t=parseFloat(e);if(isNaN(t))return;let o=parseInt(e);isNaN(o)||t!==o&&(n.style.maxHeight=`${Math.ceil(t)}px`)});return r.observe(n,{attributes:!0,attributeFilter:["style"]}),()=>{r.disconnect()}},[n])}function dg(n,r){var e,t,o;let a=Ai((e=n==null?void 0:n.gap)!=null?e:"var(--anchor-gap, 0)",r),i=Ai((t=n==null?void 0:n.offset)!=null?t:"var(--anchor-offset, 0)",r),s=Ai((o=n==null?void 0:n.padding)!=null?o:"var(--anchor-padding, 0)",r);return{...n,gap:a,offset:i,padding:s}}function Ai(n,r,e=void 0){let t=rn(),o=Z((l,u)=>{if(l==null)return[e,null];if(typeof l=="number")return[l,null];if(typeof l=="string"){if(!u)return[e,null];let c=gc(l,u);return[c,f=>{let h=vc(l);{let p=h.map(m=>window.getComputedStyle(u).getPropertyValue(m));t.requestAnimationFrame(function m(){t.nextFrame(m);let v=!1;for(let[y,E]of h.entries()){let w=window.getComputedStyle(u).getPropertyValue(E);if(p[y]!==w){p[y]=w,v=!0;break}}if(!v)return;let g=gc(l,u);c!==g&&(f(g),c=g)})}return t.dispose}]}return[e,null]}),a=d.useMemo(()=>o(n,r)[0],[n,r]),[i=a,s]=d.useState();return fe(()=>{let[l,u]=o(n,r);if(s(l),!!u)return u(s)},[n,r]),i}function vc(n){let r=/var\((.*)\)/.exec(n);if(r){let e=r[1].indexOf(",");if(e===-1)return[r[1]];let t=r[1].slice(0,e).trim(),o=r[1].slice(e+1).trim();return o?[t,...vc(o)]:[t]}return[]}function gc(n,r){let e=document.createElement("div");r.appendChild(e),e.style.setProperty("margin-top","0px","important"),e.style.setProperty("margin-top",n,"important");let t=parseFloat(window.getComputedStyle(e).marginTop)||0;return r.removeChild(e),t}function fg({children:n,freeze:r}){let e=Io(r,n);return d.createElement(d.Fragment,null,e)}function Io(n,r){let[e,t]=d.useState(r);return!n&&e!==r&&t(r),n?e:r}let No=d.createContext(null);No.displayName="OpenClosedContext";var Ue=(n=>(n[n.Open=1]="Open",n[n.Closed=2]="Closed",n[n.Closing=4]="Closing",n[n.Opening=8]="Opening",n))(Ue||{});function Qn(){return d.useContext(No)}function Ri({value:n,children:r}){return d.createElement(No.Provider,{value:n},r)}function pg({children:n}){return d.createElement(No.Provider,{value:null},n)}function hg(n){function r(){document.readyState!=="loading"&&(n(),document.removeEventListener("DOMContentLoaded",r))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",r),r())}let kt=[];hg(()=>{function n(r){if(!jt(r.target)||r.target===document.body||kt[0]===r.target)return;let e=r.target;e=e.closest(So),kt.unshift(e??r.target),kt=kt.filter(t=>t!=null&&t.isConnected),kt.splice(10)}window.addEventListener("click",n,{capture:!0}),window.addEventListener("mousedown",n,{capture:!0}),window.addEventListener("focus",n,{capture:!0}),document.body.addEventListener("click",n,{capture:!0}),document.body.addEventListener("mousedown",n,{capture:!0}),document.body.addEventListener("focus",n,{capture:!0})});function mg(n){throw new Error("Unexpected object: "+n)}var se=(n=>(n[n.First=0]="First",n[n.Previous=1]="Previous",n[n.Next=2]="Next",n[n.Last=3]="Last",n[n.Specific=4]="Specific",n[n.Nothing=5]="Nothing",n))(se||{});function Gn(n,r){let e=r.resolveItems();if(e.length<=0)return null;let t=r.resolveActiveIndex(),o=t??-1;switch(n.focus){case 0:{for(let a=0;a<e.length;++a)if(!r.resolveDisabled(e[a],a,e))return a;return t}case 1:{o===-1&&(o=e.length);for(let a=o-1;a>=0;--a)if(!r.resolveDisabled(e[a],a,e))return a;return t}case 2:{for(let a=o+1;a<e.length;++a)if(!r.resolveDisabled(e[a],a,e))return a;return t}case 3:{for(let a=e.length-1;a>=0;--a)if(!r.resolveDisabled(e[a],a,e))return a;return t}case 4:{for(let a=0;a<e.length;++a)if(r.resolveId(e[a],a,e)===n.id)return a;return t}case 5:return null;default:mg(n)}}var $o=(n=>(n[n.Left=0]="Left",n[n.Right=2]="Right",n))($o||{});function Lo(n){let r=Z(n),e=d.useRef(!1);d.useEffect(()=>(e.current=!1,()=>{e.current=!0,vo(()=>{e.current&&r()})}),[r])}function vg(){let n=typeof document>"u";return"useSyncExternalStore"in H?(r=>r.useSyncExternalStore)(H)(()=>()=>{},()=>!1,()=>!n):!1}function Fr(){let n=vg(),[r,e]=H.useState(xt.isHandoffComplete);return r&&xt.isHandoffComplete===!1&&e(!1),H.useEffect(()=>{r!==!0&&e(!0)},[r]),H.useEffect(()=>xt.handoff(),[]),n?!1:r}let bc=d.createContext(!1);function gg(){return d.useContext(bc)}function yc(n){return d.createElement(bc.Provider,{value:n.force},n.children)}function bg(n){let r=gg(),e=d.useContext(xc),[t,o]=d.useState(()=>{var a;if(!r&&e!==null)return(a=e.current)!=null?a:null;if(xt.isServer)return null;let i=n==null?void 0:n.getElementById("headlessui-portal-root");if(i)return i;if(n===null)return null;let s=n.createElement("div");return s.setAttribute("id","headlessui-portal-root"),n.body.appendChild(s)});return d.useEffect(()=>{t!==null&&(n!=null&&n.body.contains(t)||n==null||n.body.appendChild(t))},[t,n]),d.useEffect(()=>{r||e!==null&&o(e.current)},[e,o,r]),t}let wc=d.Fragment,yg=_e(function(n,r){let{ownerDocument:e=null,...t}=n,o=d.useRef(null),a=We(zh(p=>{o.current=p}),r),i=Bt(o),s=e??i,l=bg(s),[u]=d.useState(()=>{var p;return xt.isServer?null:(p=s==null?void 0:s.createElement("div"))!=null?p:null}),c=d.useContext(Yi),f=Fr();fe(()=>{!l||!u||l.contains(u)||(u.setAttribute("data-headlessui-portal",""),l.appendChild(u))},[l,u]),fe(()=>{if(u&&c)return c.register(u)},[c,u]),Lo(()=>{var p;!l||!u||(ii(u)&&l.contains(u)&&l.removeChild(u),l.childNodes.length<=0&&((p=l.parentElement)==null||p.removeChild(l)))});let h=Te();return f?!l||!u?null:Le.createPortal(h({ourProps:{ref:a},theirProps:t,slot:{},defaultTag:wc,name:"Portal"}),u):null});function wg(n,r){let e=We(r),{enabled:t=!0,ownerDocument:o,...a}=n,i=Te();return t?d.createElement(yg,{...a,ownerDocument:o,ref:e}):i({ourProps:{ref:e},theirProps:a,slot:{},defaultTag:wc,name:"Portal"})}let xg=d.Fragment,xc=d.createContext(null);function Eg(n,r){let{target:e,...t}=n,o={ref:We(r)},a=Te();return d.createElement(xc.Provider,{value:e},a({ourProps:o,theirProps:t,defaultTag:xg,name:"Popover.Group"}))}let Yi=d.createContext(null);function Dg(){let n=d.useContext(Yi),r=d.useRef([]),e=Z(a=>(r.current.push(a),n&&n.register(a),()=>t(a))),t=Z(a=>{let i=r.current.indexOf(a);i!==-1&&r.current.splice(i,1),n&&n.unregister(a)}),o=d.useMemo(()=>({register:e,unregister:t,portals:r}),[e,t,r]);return[r,d.useMemo(()=>function({children:a}){return d.createElement(Yi.Provider,{value:o},a)},[o])]}let Sg=_e(wg),Ec=_e(Eg),Wi=Object.assign(Sg,{Group:Ec});var kg=Object.defineProperty,Cg=(n,r,e)=>r in n?kg(n,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[r]=e,Dc=(n,r,e)=>(Cg(n,typeof r!="symbol"?r+"":r,e),e),de=(n=>(n[n.Open=0]="Open",n[n.Closed=1]="Closed",n))(de||{}),st=(n=>(n[n.Single=0]="Single",n[n.Multi=1]="Multi",n))(st||{}),Ct=(n=>(n[n.Pointer=0]="Pointer",n[n.Focus=1]="Focus",n[n.Other=2]="Other",n))(Ct||{}),Sc=(n=>(n[n.OpenCombobox=0]="OpenCombobox",n[n.CloseCombobox=1]="CloseCombobox",n[n.GoToOption=2]="GoToOption",n[n.SetTyping=3]="SetTyping",n[n.RegisterOption=4]="RegisterOption",n[n.UnregisterOption=5]="UnregisterOption",n[n.DefaultToFirstOption=6]="DefaultToFirstOption",n[n.SetActivationTrigger=7]="SetActivationTrigger",n[n.UpdateVirtualConfiguration=8]="UpdateVirtualConfiguration",n[n.SetInputElement=9]="SetInputElement",n[n.SetButtonElement=10]="SetButtonElement",n[n.SetOptionsElement=11]="SetOptionsElement",n))(Sc||{});function ji(n,r=e=>e){let e=n.activeOptionIndex!==null?n.options[n.activeOptionIndex]:null,t=r(n.options.slice()),o=t.length>0&&t[0].dataRef.current.order!==null?t.sort((i,s)=>i.dataRef.current.order-s.dataRef.current.order):wi(t,i=>i.dataRef.current.domRef.current),a=e?o.indexOf(e):null;return a===-1&&(a=null),{options:o,activeOptionIndex:a}}let _g={1(n){var r;return(r=n.dataRef.current)!=null&&r.disabled||n.comboboxState===1?n:{...n,activeOptionIndex:null,comboboxState:1,isTyping:!1,activationTrigger:2,__demoMode:!1}},0(n){var r,e;if((r=n.dataRef.current)!=null&&r.disabled||n.comboboxState===0)return n;if((e=n.dataRef.current)!=null&&e.value){let t=n.dataRef.current.calculateIndex(n.dataRef.current.value);if(t!==-1)return{...n,activeOptionIndex:t,comboboxState:0,__demoMode:!1}}return{...n,comboboxState:0,__demoMode:!1}},3(n,r){return n.isTyping===r.isTyping?n:{...n,isTyping:r.isTyping}},2(n,r){var e,t,o,a;if((e=n.dataRef.current)!=null&&e.disabled||n.optionsElement&&!((t=n.dataRef.current)!=null&&t.optionsPropsRef.current.static)&&n.comboboxState===1)return n;if(n.virtual){let{options:u,disabled:c}=n.virtual,f=r.focus===se.Specific?r.idx:Gn(r,{resolveItems:()=>u,resolveActiveIndex:()=>{var p,m;return(m=(p=n.activeOptionIndex)!=null?p:u.findIndex(v=>!c(v)))!=null?m:null},resolveDisabled:c,resolveId(){throw new Error("Function not implemented.")}}),h=(o=r.trigger)!=null?o:2;return n.activeOptionIndex===f&&n.activationTrigger===h?n:{...n,activeOptionIndex:f,activationTrigger:h,isTyping:!1,__demoMode:!1}}let i=ji(n);if(i.activeOptionIndex===null){let u=i.options.findIndex(c=>!c.dataRef.current.disabled);u!==-1&&(i.activeOptionIndex=u)}let s=r.focus===se.Specific?r.idx:Gn(r,{resolveItems:()=>i.options,resolveActiveIndex:()=>i.activeOptionIndex,resolveId:u=>u.id,resolveDisabled:u=>u.dataRef.current.disabled}),l=(a=r.trigger)!=null?a:2;return n.activeOptionIndex===s&&n.activationTrigger===l?n:{...n,...i,isTyping:!1,activeOptionIndex:s,activationTrigger:l,__demoMode:!1}},4:(n,r)=>{var e,t,o,a;if((e=n.dataRef.current)!=null&&e.virtual)return{...n,options:[...n.options,r.payload]};let i=r.payload,s=ji(n,u=>(u.push(i),u));n.activeOptionIndex===null&&(o=(t=n.dataRef.current).isSelected)!=null&&o.call(t,r.payload.dataRef.current.value)&&(s.activeOptionIndex=s.options.indexOf(i));let l={...n,...s,activationTrigger:2};return(a=n.dataRef.current)!=null&&a.__demoMode&&n.dataRef.current.value===void 0&&(l.activeOptionIndex=0),l},5:(n,r)=>{var e;if((e=n.dataRef.current)!=null&&e.virtual)return{...n,options:n.options.filter(o=>o.id!==r.id)};let t=ji(n,o=>{let a=o.findIndex(i=>i.id===r.id);return a!==-1&&o.splice(a,1),o});return{...n,...t,activationTrigger:2}},6:(n,r)=>n.defaultToFirstOption===r.value?n:{...n,defaultToFirstOption:r.value},7:(n,r)=>n.activationTrigger===r.trigger?n:{...n,activationTrigger:r.trigger},8:(n,r)=>{var e,t;if(n.virtual===null)return{...n,virtual:{options:r.options,disabled:(e=r.disabled)!=null?e:()=>!1}};if(n.virtual.options===r.options&&n.virtual.disabled===r.disabled)return n;let o=n.activeOptionIndex;if(n.activeOptionIndex!==null){let a=r.options.indexOf(n.virtual.options[n.activeOptionIndex]);a!==-1?o=a:o=null}return{...n,activeOptionIndex:o,virtual:{options:r.options,disabled:(t=r.disabled)!=null?t:()=>!1}}},9:(n,r)=>n.inputElement===r.element?n:{...n,inputElement:r.element},10:(n,r)=>n.buttonElement===r.element?n:{...n,buttonElement:r.element},11:(n,r)=>n.optionsElement===r.element?n:{...n,optionsElement:r.element}},Og=class Yf extends ui{constructor(r){super(r),Dc(this,"actions",{onChange:e=>{let{onChange:t,compare:o,mode:a,value:i}=this.state.dataRef.current;return Fe(a,{0:()=>t==null?void 0:t(e),1:()=>{let s=i.slice(),l=s.findIndex(u=>o(u,e));return l===-1?s.push(e):s.splice(l,1),t==null?void 0:t(s)}})},registerOption:(e,t)=>(this.send({type:4,payload:{id:e,dataRef:t}}),()=>{this.state.activeOptionIndex===this.state.dataRef.current.calculateIndex(t.current.value)&&this.send({type:6,value:!0}),this.send({type:5,id:e})}),goToOption:(e,t)=>(this.send({type:6,value:!1}),this.send({type:2,...e,trigger:t})),setIsTyping:e=>{this.send({type:3,isTyping:e})},closeCombobox:()=>{var e,t;this.send({type:1}),this.send({type:6,value:!1}),(t=(e=this.state.dataRef.current).onClose)==null||t.call(e)},openCombobox:()=>{this.send({type:0}),this.send({type:6,value:!0})},setActivationTrigger:e=>{this.send({type:7,trigger:e})},selectActiveOption:()=>{let e=this.selectors.activeOptionIndex(this.state);if(e!==null){if(this.actions.setIsTyping(!1),this.state.virtual)this.actions.onChange(this.state.virtual.options[e]);else{let{dataRef:t}=this.state.options[e];this.actions.onChange(t.current.value)}this.actions.goToOption({focus:se.Specific,idx:e})}},setInputElement:e=>{this.send({type:9,element:e})},setButtonElement:e=>{this.send({type:10,element:e})},setOptionsElement:e=>{this.send({type:11,element:e})}}),Dc(this,"selectors",{activeDescendantId:e=>{var t,o;let a=this.selectors.activeOptionIndex(e);if(a!==null)return e.virtual?(o=e.options.find(i=>!i.dataRef.current.disabled&&e.dataRef.current.compare(i.dataRef.current.value,e.virtual.options[a])))==null?void 0:o.id:(t=e.options[a])==null?void 0:t.id},activeOptionIndex:e=>{if(e.defaultToFirstOption&&e.activeOptionIndex===null&&(e.virtual?e.virtual.options.length>0:e.options.length>0)){if(e.virtual){let{options:o,disabled:a}=e.virtual,i=o.findIndex(s=>{var l;return!((l=a==null?void 0:a(s))!=null&&l)});if(i!==-1)return i}let t=e.options.findIndex(o=>!o.dataRef.current.disabled);if(t!==-1)return t}return e.activeOptionIndex},activeOption:e=>{var t,o;let a=this.selectors.activeOptionIndex(e);return a===null?null:e.virtual?e.virtual.options[a??0]:(o=(t=e.options[a])==null?void 0:t.dataRef.current.value)!=null?o:null},isActive:(e,t,o)=>{var a;let i=this.selectors.activeOptionIndex(e);return i===null?!1:e.virtual?i===e.dataRef.current.calculateIndex(t):((a=e.options[i])==null?void 0:a.id)===o},shouldScrollIntoView:(e,t,o)=>!(e.virtual||e.__demoMode||e.comboboxState!==0||e.activationTrigger===0||!this.selectors.isActive(e,t,o))});{let e=this.state.id,t=Bn.get(null);this.disposables.add(t.on(fi.Push,o=>{!t.selectors.isTop(o,e)&&this.state.comboboxState===0&&this.actions.closeCombobox()})),this.on(0,()=>t.actions.push(e)),this.on(1,()=>t.actions.pop(e))}}static new({id:r,virtual:e=null,__demoMode:t=!1}){var o;return new Yf({id:r,dataRef:{current:{}},comboboxState:t?0:1,isTyping:!1,options:[],virtual:e?{options:e.options,disabled:(o=e.disabled)!=null?o:()=>!1}:null,activeOptionIndex:null,activationTrigger:2,inputElement:null,buttonElement:null,optionsElement:null,__demoMode:t})}reduce(r,e){return Fe(e.type,_g,r,e)}};const kc=d.createContext(null);function Ar(n){let r=d.useContext(kc);if(r===null){let e=new Error(`<${n} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,Cc),e}return r}function Cc({id:n,virtual:r=null,__demoMode:e=!1}){let t=d.useMemo(()=>Og.new({id:n,virtual:r,__demoMode:e}),[]);return Lo(()=>t.dispose()),t}let Rr=d.createContext(null);Rr.displayName="ComboboxDataContext";function Kn(n){let r=d.useContext(Rr);if(r===null){let e=new Error(`<${n} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,Kn),e}return r}let _c=d.createContext(null);function Mg(n){let r=Ar("VirtualProvider"),e=Kn("VirtualProvider"),{options:t}=e.virtual,o=we(r,p=>p.optionsElement),[a,i]=d.useMemo(()=>{let p=o;if(!p)return[0,0];let m=window.getComputedStyle(p);return[parseFloat(m.paddingBlockStart||m.paddingTop),parseFloat(m.paddingBlockEnd||m.paddingBottom)]},[o]),s=fm({enabled:t.length!==0,scrollPaddingStart:a,scrollPaddingEnd:i,count:t.length,estimateSize(){return 40},getScrollElement(){return r.state.optionsElement},overscan:12}),[l,u]=d.useState(0);fe(()=>{u(p=>p+1)},[t]);let c=s.getVirtualItems(),f=we(r,p=>p.activationTrigger===Ct.Pointer),h=we(r,r.selectors.activeOptionIndex);return c.length===0?null:d.createElement(_c.Provider,{value:s},d.createElement("div",{style:{position:"relative",width:"100%",height:`${s.getTotalSize()}px`},ref:p=>{p&&(f||h!==null&&t.length>h&&s.scrollToIndex(h))}},c.map(p=>{var m;return d.createElement(d.Fragment,{key:p.key},d.cloneElement((m=n.children)==null?void 0:m.call(n,{...n.slot,option:t[p.index]}),{key:`${l}-${p.key}`,"data-index":p.index,"aria-setsize":t.length,"aria-posinset":p.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${p.start}px)`,overflowAnchor:"none"}}))})))}let Tg=d.Fragment;function Pg(n,r){let e=d.useId(),t=go(),{value:o,defaultValue:a,onChange:i,form:s,name:l,by:u,invalid:c=!1,disabled:f=t||!1,onClose:h,__demoMode:p=!1,multiple:m=!1,immediate:v=!1,virtual:g=null,nullable:y,...E}=n,w=Hl(a),[S=m?[]:void 0,x]=jl(o,i,w),T=Cc({id:e,virtual:g,__demoMode:p}),N=d.useRef({static:!1,hold:!1}),_=lu(u),O=Z(B=>g?u===null?g.options.indexOf(B):g.options.findIndex(K=>_(K,B)):T.state.options.findIndex(K=>_(K.dataRef.current.value,B))),M=d.useCallback(B=>Fe(k.mode,{[st.Multi]:()=>S.some(K=>_(K,B)),[st.Single]:()=>_(S,B)}),[S]),L=we(T,B=>B.virtual),b=Z(()=>h==null?void 0:h()),k=d.useMemo(()=>({__demoMode:p,immediate:v,optionsPropsRef:N,value:S,defaultValue:w,disabled:f,invalid:c,mode:m?st.Multi:st.Single,virtual:g?L:null,onChange:x,isSelected:M,calculateIndex:O,compare:_,onClose:b}),[S,w,f,c,m,x,M,p,T,g,L,b]);fe(()=>{var B;g&&T.send({type:Sc.UpdateVirtualConfiguration,options:g.options,disabled:(B=g.disabled)!=null?B:null})},[g,g==null?void 0:g.options,g==null?void 0:g.disabled]),fe(()=>{T.state.dataRef.current=k},[k]);let[$,Y,I,V]=we(T,B=>[B.comboboxState,B.buttonElement,B.inputElement,B.optionsElement]),C=Bn.get(null),q=we(C,d.useCallback(B=>C.selectors.isTop(B,e),[C,e]));Ei(q,[Y,I,V],()=>T.actions.closeCombobox());let P=we(T,T.selectors.activeOptionIndex),W=we(T,T.selectors.activeOption),G=d.useMemo(()=>({open:$===de.Open,disabled:f,invalid:c,activeIndex:P,activeOption:W,value:S}),[k,f,S,c,W,$]),[j,F]=tu(),ne=r===null?{}:{ref:r},U=d.useCallback(()=>{if(w!==void 0)return x==null?void 0:x(w)},[x,w]),A=Te();return d.createElement(F,{value:j,props:{htmlFor:I==null?void 0:I.id},slot:{open:$===de.Open,disabled:f}},d.createElement(mc,null,d.createElement(Rr.Provider,{value:k},d.createElement(kc.Provider,{value:T},d.createElement(Ri,{value:Fe($,{[de.Open]:Ue.Open,[de.Closed]:Ue.Closed})},l!=null&&d.createElement(ql,{disabled:f,data:S!=null?{[l]:S}:{},form:s,onReset:U}),A({ourProps:ne,theirProps:E,slot:G,defaultTag:Tg,name:"Combobox"}))))))}let Ig="input";function Ng(n,r){var e,t;let o=Ar("Combobox.Input"),a=Kn("Combobox.Input"),i=d.useId(),s=ai(),{id:l=s||`headlessui-combobox-input-${i}`,onChange:u,displayValue:c,disabled:f=a.disabled||!1,autoFocus:h=!1,type:p="text",...m}=n,[v]=we(o,F=>[F.inputElement]),g=d.useRef(null),y=We(g,r,dc(),o.actions.setInputElement),E=Bt(v),[w,S]=we(o,F=>[F.comboboxState,F.isTyping]),x=rn(),T=Z(()=>{o.actions.onChange(null),o.state.optionsElement&&(o.state.optionsElement.scrollTop=0),o.actions.goToOption({focus:se.Nothing})}),N=d.useMemo(()=>{var F;return typeof c=="function"&&a.value!==void 0?(F=c(a.value))!=null?F:"":typeof a.value=="string"?a.value:""},[a.value,c]);Tr(([F,ne],[U,A])=>{if(o.state.isTyping)return;let B=g.current;B&&((A===de.Open&&ne===de.Closed||F!==U)&&(B.value=F),requestAnimationFrame(()=>{if(o.state.isTyping||!B||(E==null?void 0:E.activeElement)!==B)return;let{selectionStart:K,selectionEnd:J}=B;Math.abs((J??0)-(K??0))===0&&K===0&&B.setSelectionRange(B.value.length,B.value.length)}))},[N,w,E,S]),Tr(([F],[ne])=>{if(F===de.Open&&ne===de.Closed){if(o.state.isTyping)return;let U=g.current;if(!U)return;let A=U.value,{selectionStart:B,selectionEnd:K,selectionDirection:J}=U;U.value="",U.value=A,J!==null?U.setSelectionRange(B,K,J):U.setSelectionRange(B,K)}},[w]);let _=d.useRef(!1),O=Z(()=>{_.current=!0}),M=Z(()=>{x.nextFrame(()=>{_.current=!1})}),L=Z(F=>{switch(o.actions.setIsTyping(!0),F.key){case he.Enter:if(o.state.comboboxState!==de.Open||_.current)return;if(F.preventDefault(),F.stopPropagation(),o.selectors.activeOptionIndex(o.state)===null){o.actions.closeCombobox();return}o.actions.selectActiveOption(),a.mode===st.Single&&o.actions.closeCombobox();break;case he.ArrowDown:return F.preventDefault(),F.stopPropagation(),Fe(o.state.comboboxState,{[de.Open]:()=>o.actions.goToOption({focus:se.Next}),[de.Closed]:()=>o.actions.openCombobox()});case he.ArrowUp:return F.preventDefault(),F.stopPropagation(),Fe(o.state.comboboxState,{[de.Open]:()=>o.actions.goToOption({focus:se.Previous}),[de.Closed]:()=>{Le.flushSync(()=>o.actions.openCombobox()),a.value||o.actions.goToOption({focus:se.Last})}});case he.Home:if(F.shiftKey)break;return F.preventDefault(),F.stopPropagation(),o.actions.goToOption({focus:se.First});case he.PageUp:return F.preventDefault(),F.stopPropagation(),o.actions.goToOption({focus:se.First});case he.End:if(F.shiftKey)break;return F.preventDefault(),F.stopPropagation(),o.actions.goToOption({focus:se.Last});case he.PageDown:return F.preventDefault(),F.stopPropagation(),o.actions.goToOption({focus:se.Last});case he.Escape:return o.state.comboboxState!==de.Open?void 0:(F.preventDefault(),o.state.optionsElement&&!a.optionsPropsRef.current.static&&F.stopPropagation(),a.mode===st.Single&&a.value===null&&T(),o.actions.closeCombobox());case he.Tab:if(o.state.comboboxState!==de.Open)return;a.mode===st.Single&&o.state.activationTrigger!==Ct.Focus&&o.actions.selectActiveOption(),o.actions.closeCombobox();break}}),b=Z(F=>{u==null||u(F),a.mode===st.Single&&F.target.value===""&&T(),o.actions.openCombobox()}),k=Z(F=>{var ne,U,A;let B=(ne=F.relatedTarget)!=null?ne:kt.find(K=>K!==F.currentTarget);if(!((U=o.state.optionsElement)!=null&&U.contains(B))&&!((A=o.state.buttonElement)!=null&&A.contains(B))&&o.state.comboboxState===de.Open)return F.preventDefault(),a.mode===st.Single&&a.value===null&&T(),o.actions.closeCombobox()}),$=Z(F=>{var ne,U,A;let B=(ne=F.relatedTarget)!=null?ne:kt.find(K=>K!==F.currentTarget);(U=o.state.buttonElement)!=null&&U.contains(B)||(A=o.state.optionsElement)!=null&&A.contains(B)||a.disabled||a.immediate&&o.state.comboboxState!==de.Open&&x.microTask(()=>{Le.flushSync(()=>o.actions.openCombobox()),o.actions.setActivationTrigger(Ct.Focus)})}),Y=kr(),I=Jl(),{isFocused:V,focusProps:C}=ti({autoFocus:h}),{isHovered:q,hoverProps:P}=ei({isDisabled:f}),W=we(o,F=>F.optionsElement),G=d.useMemo(()=>({open:w===de.Open,disabled:f,invalid:a.invalid,hover:q,focus:V,autofocus:h}),[a,q,V,h,f,a.invalid]),j=Dr({ref:y,id:l,role:"combobox",type:p,"aria-controls":W==null?void 0:W.id,"aria-expanded":w===de.Open,"aria-activedescendant":we(o,o.selectors.activeDescendantId),"aria-labelledby":Y,"aria-describedby":I,"aria-autocomplete":"list",defaultValue:(t=(e=n.defaultValue)!=null?e:a.defaultValue!==void 0?c==null?void 0:c(a.defaultValue):null)!=null?t:a.defaultValue,disabled:f||void 0,autoFocus:h,onCompositionStart:O,onCompositionEnd:M,onKeyDown:L,onChange:b,onFocus:$,onBlur:k},C,P);return Te()({ourProps:j,theirProps:m,slot:G,defaultTag:Ig,name:"Combobox.Input"})}let $g="button";function Lg(n,r){let e=Ar("Combobox.Button"),t=Kn("Combobox.Button"),[o,a]=d.useState(null),i=We(r,a,e.actions.setButtonElement),s=d.useId(),{id:l=`headlessui-combobox-button-${s}`,disabled:u=t.disabled||!1,autoFocus:c=!1,...f}=n,[h,p,m]=we(e,b=>[b.comboboxState,b.inputElement,b.optionsElement]),v=_u(p),g=h===de.Open;Cu(g,{trigger:o,action:d.useCallback(b=>{if(o!=null&&o.contains(b.target)||p!=null&&p.contains(b.target))return Vt.Ignore;let k=b.target.closest('[role="option"]:not([data-disabled])');return tt(k)?Vt.Select(k):m!=null&&m.contains(b.target)?Vt.Ignore:Vt.Close},[o,p,m]),close:e.actions.closeCombobox,select:e.actions.selectActiveOption});let y=Z(b=>{switch(b.key){case he.Space:case he.Enter:b.preventDefault(),b.stopPropagation(),e.state.comboboxState===de.Closed&&Le.flushSync(()=>e.actions.openCombobox()),v();return;case he.ArrowDown:b.preventDefault(),b.stopPropagation(),e.state.comboboxState===de.Closed&&(Le.flushSync(()=>e.actions.openCombobox()),e.state.dataRef.current.value||e.actions.goToOption({focus:se.First})),v();return;case he.ArrowUp:b.preventDefault(),b.stopPropagation(),e.state.comboboxState===de.Closed&&(Le.flushSync(()=>e.actions.openCombobox()),e.state.dataRef.current.value||e.actions.goToOption({focus:se.Last})),v();return;case he.Escape:if(e.state.comboboxState!==de.Open)return;b.preventDefault(),e.state.optionsElement&&!t.optionsPropsRef.current.static&&b.stopPropagation(),Le.flushSync(()=>e.actions.closeCombobox()),v();return;default:return}}),E=Z(b=>{b.preventDefault(),!Gl(b.currentTarget)&&(b.button===$o.Left&&(e.state.comboboxState===de.Open?e.actions.closeCombobox():e.actions.openCombobox()),v())}),w=kr([l]),{isFocusVisible:S,focusProps:x}=ti({autoFocus:c}),{isHovered:T,hoverProps:N}=ei({isDisabled:u}),{pressed:_,pressProps:O}=Yl({disabled:u}),M=d.useMemo(()=>({open:h===de.Open,active:_||h===de.Open,disabled:u,invalid:t.invalid,value:t.value,hover:T,focus:S}),[t,T,S,_,u,h]),L=Dr({ref:i,id:l,type:Ou(n,o),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":m==null?void 0:m.id,"aria-expanded":h===de.Open,"aria-labelledby":w,disabled:u||void 0,autoFocus:c,onPointerDown:E,onKeyDown:y},x,N,O);return Te()({ourProps:L,theirProps:f,slot:M,defaultTag:$g,name:"Combobox.Button"})}let Fg="div",Ag=on.RenderStrategy|on.Static;function Rg(n,r){var e,t,o;let a=d.useId(),{id:i=`headlessui-combobox-options-${a}`,hold:s=!1,anchor:l,portal:u=!1,modal:c=!0,transition:f=!1,...h}=n,p=Ar("Combobox.Options"),m=Kn("Combobox.Options"),v=cc(l);v&&(u=!0);let[g,y]=pc(v),[E,w]=d.useState(null),S=fc(),x=We(r,v?g:null,p.actions.setOptionsElement,w),[T,N,_,O,M]=we(p,J=>[J.comboboxState,J.inputElement,J.buttonElement,J.optionsElement,J.activationTrigger]),L=Bt(N||_),b=Bt(O),k=Qn(),[$,Y]=Ci(f,E,k!==null?(k&Ue.Open)===Ue.Open:T===de.Open);gi($,N,p.actions.closeCombobox);let I=m.__demoMode?!1:c&&T===de.Open;Si(I,b);let V=m.__demoMode?!1:c&&T===de.Open;vi(V,{allowed:d.useCallback(()=>[N,_,O],[N,_,O])}),fe(()=>{var J;m.optionsPropsRef.current.static=(J=n.static)!=null?J:!1},[m.optionsPropsRef,n.static]),fe(()=>{m.optionsPropsRef.current.hold=s},[m.optionsPropsRef,s]),Gm(T===de.Open,{container:O,accept(J){return J.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:J.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(J){J.setAttribute("role","none")}});let C=kr([_==null?void 0:_.id]),q=d.useMemo(()=>({open:T===de.Open,option:void 0}),[T]),P=Z(()=>{p.actions.setActivationTrigger(Ct.Pointer)}),W=Z(J=>{J.preventDefault(),p.actions.setActivationTrigger(Ct.Pointer)}),G=Dr(v?S():{},{"aria-labelledby":C,role:"listbox","aria-multiselectable":m.mode===st.Multi?!0:void 0,id:i,ref:x,style:{...h.style,...y,"--input-width":si(N,!0).width,"--button-width":si(_,!0).width},onWheel:M===Ct.Pointer?void 0:P,onMouseDown:W,...ki(Y)}),j=$&&T===de.Closed,F=Io(j,(e=m.virtual)==null?void 0:e.options),ne=Io(j,m.value),U=Z(J=>m.compare(ne,J)),A=d.useMemo(()=>{if(!m.virtual)return m;if(F===void 0)throw new Error("Missing `options` in virtual mode");return F!==m.virtual.options?{...m,virtual:{...m.virtual,options:F}}:m},[m,F,(t=m.virtual)==null?void 0:t.options]);m.virtual&&Object.assign(h,{children:d.createElement(Rr.Provider,{value:A},d.createElement(Mg,{slot:q},h.children))});let B=Te(),K=d.useMemo(()=>m.mode===st.Multi?m:{...m,isSelected:U},[m,U]);return d.createElement(Wi,{enabled:u?n.static||$:!1,ownerDocument:L},d.createElement(Rr.Provider,{value:K},B({ourProps:G,theirProps:{...h,children:d.createElement(fg,{freeze:j},typeof h.children=="function"?(o=h.children)==null?void 0:o.call(h,q):h.children)},slot:q,defaultTag:Fg,features:Ag,visible:$,name:"Combobox.Options"})))}let Yg="div";function Wg(n,r){var e,t,o;let a=Kn("Combobox.Option"),i=Ar("Combobox.Option"),s=d.useId(),{id:l=`headlessui-combobox-option-${s}`,value:u,disabled:c=(o=(t=(e=a.virtual)==null?void 0:e.disabled)==null?void 0:t.call(e,u))!=null?o:!1,order:f=null,...h}=n,[p]=we(i,Y=>[Y.inputElement]),m=_u(p),v=we(i,d.useCallback(Y=>i.selectors.isActive(Y,u,l),[u,l])),g=a.isSelected(u),y=d.useRef(null),E=Yt({disabled:c,value:u,domRef:y,order:f}),w=d.useContext(_c),S=We(r,y,w?w.measureElement:null),x=Z(()=>{i.actions.setIsTyping(!1),i.actions.onChange(u)});fe(()=>i.actions.registerOption(l,E),[E,l]);let T=we(i,d.useCallback(Y=>i.selectors.shouldScrollIntoView(Y,u,l),[u,l]));fe(()=>{if(T)return ut().requestAnimationFrame(()=>{var Y,I;(I=(Y=y.current)==null?void 0:Y.scrollIntoView)==null||I.call(Y,{block:"nearest"})})},[T,y]);let N=Z(Y=>{Y.preventDefault(),Y.button===$o.Left&&(c||(x(),xi()||requestAnimationFrame(()=>m()),a.mode===st.Single&&i.actions.closeCombobox()))}),_=Z(()=>{if(c)return i.actions.goToOption({focus:se.Nothing});let Y=a.calculateIndex(u);i.actions.goToOption({focus:se.Specific,idx:Y})}),O=Tu(),M=Z(Y=>O.update(Y)),L=Z(Y=>{if(!O.wasMoved(Y)||c||v&&i.state.activationTrigger===Ct.Pointer)return;let I=a.calculateIndex(u);i.actions.goToOption({focus:se.Specific,idx:I},Ct.Pointer)}),b=Z(Y=>{O.wasMoved(Y)&&(c||v&&(a.optionsPropsRef.current.hold||i.state.activationTrigger===Ct.Pointer&&i.actions.goToOption({focus:se.Nothing})))}),k=d.useMemo(()=>({active:v,focus:v,selected:g,disabled:c}),[v,g,c]),$={id:l,ref:S,role:"option",tabIndex:c===!0?void 0:-1,"aria-disabled":c===!0?!0:void 0,"aria-selected":g,disabled:void 0,onMouseDown:N,onFocus:_,onPointerEnter:M,onMouseEnter:M,onPointerMove:L,onMouseMove:L,onPointerLeave:b,onMouseLeave:b};return Te()({ourProps:$,theirProps:h,slot:k,defaultTag:Yg,name:"Combobox.Option"})}let jg=_e(Pg),Hg=_e(Lg),Oc=_e(Ng),Bg=Eo,Mc=_e(Rg),Tc=_e(Wg),Vg=Object.assign(jg,{Input:Oc,Button:Hg,Label:Bg,Options:Mc,Option:Tc});function zg(n,r=typeof document<"u"?document.defaultView:null,e){let t=Or(n,"escape");Di(r,"keydown",o=>{t&&(o.defaultPrevented||o.key===he.Escape&&e(o))})}function qg(){var n;let[r]=d.useState(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)"):null),[e,t]=d.useState((n=r==null?void 0:r.matches)!=null?n:!1);return fe(()=>{if(!r)return;function o(a){t(a.matches)}return r.addEventListener("change",o),()=>r.removeEventListener("change",o)},[r]),e}function Ug({defaultContainers:n=[],portals:r,mainTreeNode:e}={}){let t=Bt(e),o=Z(()=>{var a,i;let s=[];for(let l of n)l!==null&&(Wt(l)?s.push(l):"current"in l&&Wt(l.current)&&s.push(l.current));if(r!=null&&r.current)for(let l of r.current)s.push(l);for(let l of(a=t==null?void 0:t.querySelectorAll("html > *, body > *"))!=null?a:[])l!==document.body&&l!==document.head&&Wt(l)&&l.id!=="headlessui-portal-root"&&(e&&(l.contains(e)||l.contains((i=e==null?void 0:e.getRootNode())==null?void 0:i.host))||s.some(u=>l.contains(u))||s.push(l));return s});return{resolveContainers:o,contains:Z(a=>o().some(i=>i.contains(a)))}}let Pc=d.createContext(null);function Ic({children:n,node:r}){let[e,t]=d.useState(null),o=Nc(r??e);return d.createElement(Pc.Provider,{value:o},n,o===null&&d.createElement(Sr,{features:jn.Hidden,ref:a=>{var i,s;if(a){for(let l of(s=(i=En(a))==null?void 0:i.querySelectorAll("html > *, body > *"))!=null?s:[])if(l!==document.body&&l!==document.head&&Wt(l)&&l!=null&&l.contains(a)){t(l);break}}}}))}function Nc(n=null){var r;return(r=d.useContext(Pc))!=null?r:n}function Hi(){let n=d.useRef(!1);return fe(()=>(n.current=!0,()=>{n.current=!1}),[]),n}var Yr=(n=>(n[n.Forwards=0]="Forwards",n[n.Backwards=1]="Backwards",n))(Yr||{});function Qg(){let n=d.useRef(0);return Du(!0,"keydown",r=>{r.key==="Tab"&&(n.current=r.shiftKey?1:0)},!0),n}function $c(n){if(!n)return new Set;if(typeof n=="function")return new Set(n());let r=new Set;for(let e of n.current)Wt(e.current)&&r.add(e.current);return r}let Gg="div";var Cn=(n=>(n[n.None=0]="None",n[n.InitialFocus=1]="InitialFocus",n[n.TabLock=2]="TabLock",n[n.FocusLock=4]="FocusLock",n[n.RestoreFocus=8]="RestoreFocus",n[n.AutoFocus=16]="AutoFocus",n))(Cn||{});function Kg(n,r){let e=d.useRef(null),t=We(e,r),{initialFocus:o,initialFocusFallback:a,containers:i,features:s=15,...l}=n;Fr()||(s=0);let u=Bt(e);eb(s,{ownerDocument:u});let c=tb(s,{ownerDocument:u,container:e,initialFocus:o,initialFocusFallback:a});nb(s,{ownerDocument:u,container:e,containers:i,previousActiveElement:c});let f=Qg(),h=Z(E=>{if(!tt(e.current))return;let w=e.current;(S=>S())(()=>{Fe(f.current,{[Yr.Forwards]:()=>{Vn(w,bt.First,{skipElements:[E.relatedTarget,a]})},[Yr.Backwards]:()=>{Vn(w,bt.Last,{skipElements:[E.relatedTarget,a]})}})})}),p=Or(!!(s&2),"focus-trap#tab-lock"),m=rn(),v=d.useRef(!1),g={ref:t,onKeyDown(E){E.key=="Tab"&&(v.current=!0,m.requestAnimationFrame(()=>{v.current=!1}))},onBlur(E){if(!(s&4))return;let w=$c(i);tt(e.current)&&w.add(e.current);let S=E.relatedTarget;jt(S)&&S.dataset.headlessuiFocusGuard!=="true"&&(Lc(w,S)||(v.current?Vn(e.current,Fe(f.current,{[Yr.Forwards]:()=>bt.Next,[Yr.Backwards]:()=>bt.Previous})|bt.WrapAround,{relativeTo:E.target}):jt(E.target)&&Ht(E.target)))}},y=Te();return d.createElement(d.Fragment,null,p&&d.createElement(Sr,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:h,features:jn.Focusable}),y({ourProps:g,theirProps:l,defaultTag:Gg,name:"FocusTrap"}),p&&d.createElement(Sr,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:h,features:jn.Focusable}))}let Xg=_e(Kg),Jg=Object.assign(Xg,{features:Cn});function Zg(n=!0){let r=d.useRef(kt.slice());return Tr(([e],[t])=>{t===!0&&e===!1&&vo(()=>{r.current.splice(0)}),t===!1&&e===!0&&(r.current=kt.slice())},[n,kt,r]),Z(()=>{var e;return(e=r.current.find(t=>t!=null&&t.isConnected))!=null?e:null})}function eb(n,{ownerDocument:r}){let e=!!(n&8),t=Zg(e);Tr(()=>{e||(r==null?void 0:r.activeElement)===(r==null?void 0:r.body)&&Ht(t())},[e]),Lo(()=>{e&&Ht(t())})}function tb(n,{ownerDocument:r,container:e,initialFocus:t,initialFocusFallback:o}){let a=d.useRef(null),i=Or(!!(n&1),"focus-trap#initial-focus"),s=Hi();return Tr(()=>{if(n===0)return;if(!i){o!=null&&o.current&&Ht(o.current);return}let l=e.current;l&&vo(()=>{if(!s.current)return;let u=r==null?void 0:r.activeElement;if(t!=null&&t.current){if((t==null?void 0:t.current)===u){a.current=u;return}}else if(l.contains(u)){a.current=u;return}if(t!=null&&t.current)Ht(t.current);else{if(n&16){if(Vn(l,bt.First|bt.AutoFocus)!==bi.Error)return}else if(Vn(l,bt.First)!==bi.Error)return;if(o!=null&&o.current&&(Ht(o.current),(r==null?void 0:r.activeElement)===o.current))return;console.warn("There are no focusable elements inside the <FocusTrap />")}a.current=r==null?void 0:r.activeElement})},[o,i,n]),a}function nb(n,{ownerDocument:r,container:e,containers:t,previousActiveElement:o}){let a=Hi(),i=!!(n&4);Di(r==null?void 0:r.defaultView,"focus",s=>{if(!i||!a.current)return;let l=$c(t);tt(e.current)&&l.add(e.current);let u=o.current;if(!u)return;let c=s.target;tt(c)?Lc(l,c)?(o.current=c,Ht(c)):(s.preventDefault(),s.stopPropagation(),Ht(u)):Ht(o.current)},!0)}function Lc(n,r){for(let e of n)if(e.contains(r))return!0;return!1}function Fc(n){var r;return!!(n.enter||n.enterFrom||n.enterTo||n.leave||n.leaveFrom||n.leaveTo)||((r=n.as)!=null?r:Rc)!==d.Fragment||d.Children.count(n.children)===1}let Fo=d.createContext(null);Fo.displayName="TransitionContext";var rb=(n=>(n.Visible="visible",n.Hidden="hidden",n))(rb||{});function ob(){let n=d.useContext(Fo);if(n===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return n}function ab(){let n=d.useContext(Ao);if(n===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return n}let Ao=d.createContext(null);Ao.displayName="NestingContext";function Ro(n){return"children"in n?Ro(n.children):n.current.filter(({el:r})=>r.current!==null).filter(({state:r})=>r==="visible").length>0}function Ac(n,r){let e=Yt(n),t=d.useRef([]),o=Hi(),a=rn(),i=Z((p,m=an.Hidden)=>{let v=t.current.findIndex(({el:g})=>g===p);v!==-1&&(Fe(m,{[an.Unmount](){t.current.splice(v,1)},[an.Hidden](){t.current[v].state="hidden"}}),a.microTask(()=>{var g;!Ro(t)&&o.current&&((g=e.current)==null||g.call(e))}))}),s=Z(p=>{let m=t.current.find(({el:v})=>v===p);return m?m.state!=="visible"&&(m.state="visible"):t.current.push({el:p,state:"visible"}),()=>i(p,an.Unmount)}),l=d.useRef([]),u=d.useRef(Promise.resolve()),c=d.useRef({enter:[],leave:[]}),f=Z((p,m,v)=>{l.current.splice(0),r&&(r.chains.current[m]=r.chains.current[m].filter(([g])=>g!==p)),r==null||r.chains.current[m].push([p,new Promise(g=>{l.current.push(g)})]),r==null||r.chains.current[m].push([p,new Promise(g=>{Promise.all(c.current[m].map(([y,E])=>E)).then(()=>g())})]),m==="enter"?u.current=u.current.then(()=>r==null?void 0:r.wait.current).then(()=>v(m)):v(m)}),h=Z((p,m,v)=>{Promise.all(c.current[m].splice(0).map(([g,y])=>y)).then(()=>{var g;(g=l.current.shift())==null||g()}).then(()=>v(m))});return d.useMemo(()=>({children:t,register:s,unregister:i,onStart:f,onStop:h,wait:u,chains:c}),[s,i,t,f,h,c,u])}let Rc=d.Fragment,Yc=on.RenderStrategy;function ib(n,r){var e,t;let{transition:o=!0,beforeEnter:a,afterEnter:i,beforeLeave:s,afterLeave:l,enter:u,enterFrom:c,enterTo:f,entered:h,leave:p,leaveFrom:m,leaveTo:v,...g}=n,[y,E]=d.useState(null),w=d.useRef(null),S=Fc(n),x=We(...S?[w,r,E]:r===null?[]:[r]),T=(e=g.unmount)==null||e?an.Unmount:an.Hidden,{show:N,appear:_,initial:O}=ob(),[M,L]=d.useState(N?"visible":"hidden"),b=ab(),{register:k,unregister:$}=b;fe(()=>k(w),[k,w]),fe(()=>{if(T===an.Hidden&&w.current){if(N&&M!=="visible"){L("visible");return}return Fe(M,{hidden:()=>$(w),visible:()=>k(w)})}},[M,w,k,$,N,T]);let Y=Fr();fe(()=>{if(S&&Y&&M==="visible"&&w.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[w,M,Y,S]);let I=O&&!_,V=_&&N&&O,C=d.useRef(!1),q=Ac(()=>{C.current||(L("hidden"),$(w))},b),P=Z(A=>{C.current=!0;let B=A?"enter":"leave";q.onStart(w,B,K=>{K==="enter"?a==null||a():K==="leave"&&(s==null||s())})}),W=Z(A=>{let B=A?"enter":"leave";C.current=!1,q.onStop(w,B,K=>{K==="enter"?i==null||i():K==="leave"&&(l==null||l())}),B==="leave"&&!Ro(q)&&(L("hidden"),$(w))});d.useEffect(()=>{S&&o||(P(N),W(N))},[N,S,o]);let G=!(!o||!S||!Y||I),[,j]=Ci(G,y,N,{start:P,end:W}),F=sn({ref:x,className:((t=ri(g.className,V&&u,V&&c,j.enter&&u,j.enter&&j.closed&&c,j.enter&&!j.closed&&f,j.leave&&p,j.leave&&!j.closed&&m,j.leave&&j.closed&&v,!j.transition&&N&&h))==null?void 0:t.trim())||void 0,...ki(j)}),ne=0;M==="visible"&&(ne|=Ue.Open),M==="hidden"&&(ne|=Ue.Closed),N&&M==="hidden"&&(ne|=Ue.Opening),!N&&M==="visible"&&(ne|=Ue.Closing);let U=Te();return d.createElement(Ao.Provider,{value:q},d.createElement(Ri,{value:ne},U({ourProps:F,theirProps:g,defaultTag:Rc,features:Yc,visible:M==="visible",name:"Transition.Child"})))}function sb(n,r){let{show:e,appear:t=!1,unmount:o=!0,...a}=n,i=d.useRef(null),s=Fc(n),l=We(...s?[i,r]:r===null?[]:[r]);Fr();let u=Qn();if(e===void 0&&u!==null&&(e=(u&Ue.Open)===Ue.Open),e===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[c,f]=d.useState(e?"visible":"hidden"),h=Ac(()=>{e||f("hidden")}),[p,m]=d.useState(!0),v=d.useRef([e]);fe(()=>{p!==!1&&v.current[v.current.length-1]!==e&&(v.current.push(e),m(!1))},[v,e]);let g=d.useMemo(()=>({show:e,appear:t,initial:p}),[e,t,p]);fe(()=>{e?f("visible"):!Ro(h)&&i.current!==null&&f("hidden")},[e,h]);let y={unmount:o},E=Z(()=>{var x;p&&m(!1),(x=n.beforeEnter)==null||x.call(n)}),w=Z(()=>{var x;p&&m(!1),(x=n.beforeLeave)==null||x.call(n)}),S=Te();return d.createElement(Ao.Provider,{value:h},d.createElement(Fo.Provider,{value:g},S({ourProps:{...y,as:d.Fragment,children:d.createElement(Wc,{ref:l,...y,...a,beforeEnter:E,beforeLeave:w})},theirProps:{},defaultTag:d.Fragment,features:Yc,visible:c==="visible",name:"Transition"})))}function lb(n,r){let e=d.useContext(Fo)!==null,t=Qn()!==null;return d.createElement(d.Fragment,null,!e&&t?d.createElement(Bi,{ref:r,...n}):d.createElement(Wc,{ref:r,...n}))}let Bi=_e(sb),Wc=_e(ib),Vi=_e(lb),jc=Object.assign(Bi,{Child:Vi,Root:Bi});var ub=(n=>(n[n.Open=0]="Open",n[n.Closed=1]="Closed",n))(ub||{}),cb=(n=>(n[n.SetTitleId=0]="SetTitleId",n))(cb||{});let db={0(n,r){return n.titleId===r.id?n:{...n,titleId:r.id}}},zi=d.createContext(null);zi.displayName="DialogContext";function Yo(n){let r=d.useContext(zi);if(r===null){let e=new Error(`<${n} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,Yo),e}return r}function fb(n,r){return Fe(r.type,db,n,r)}let Hc=_e(function(n,r){let e=d.useId(),{id:t=`headlessui-dialog-${e}`,open:o,onClose:a,initialFocus:i,role:s="dialog",autoFocus:l=!0,__demoMode:u=!1,unmount:c=!1,...f}=n,h=d.useRef(!1);s=function(){return s==="dialog"||s==="alertdialog"?s:(h.current||(h.current=!0,console.warn(`Invalid role [${s}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")}();let p=Qn();o===void 0&&p!==null&&(o=(p&Ue.Open)===Ue.Open);let m=d.useRef(null),v=We(m,r),g=Bt(m),y=o?0:1,[E,w]=d.useReducer(fb,{titleId:null,descriptionId:null,panelRef:d.createRef()}),S=Z(()=>a(!1)),x=Z(j=>w({type:0,id:j})),T=Fr()?y===0:!1,[N,_]=Dg(),O={get current(){var j;return(j=E.panelRef.current)!=null?j:m.current}},M=Nc(),{resolveContainers:L}=Ug({mainTreeNode:M,portals:N,defaultContainers:[O]}),b=p!==null?(p&Ue.Closing)===Ue.Closing:!1;vi(u||b?!1:T,{allowed:Z(()=>{var j,F;return[(F=(j=m.current)==null?void 0:j.closest("[data-headlessui-portal]"))!=null?F:null]}),disallowed:Z(()=>{var j;return[(j=M==null?void 0:M.closest("body > *:not(#headlessui-portal-root)"))!=null?j:null]})});let k=Bn.get(null);fe(()=>{if(T)return k.actions.push(t),()=>k.actions.pop(t)},[k,t,T]);let $=we(k,d.useCallback(j=>k.selectors.isTop(j,t),[k,t]));Ei($,L,j=>{j.preventDefault(),S()}),zg($,g==null?void 0:g.defaultView,j=>{j.preventDefault(),j.stopPropagation(),document.activeElement&&"blur"in document.activeElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur(),S()}),Si(u||b?!1:T,g,L),gi(T,m,S);let[Y,I]=qh(),V=d.useMemo(()=>[{dialogState:y,close:S,setTitleId:x,unmount:c},E],[y,E,S,x,c]),C=d.useMemo(()=>({open:y===0}),[y]),q={ref:v,id:t,role:s,tabIndex:-1,"aria-modal":u?void 0:y===0?!0:void 0,"aria-labelledby":E.titleId,"aria-describedby":Y,unmount:c},P=!qg(),W=Cn.None;T&&!u&&(W|=Cn.RestoreFocus,W|=Cn.TabLock,l&&(W|=Cn.AutoFocus),P&&(W|=Cn.InitialFocus));let G=Te();return d.createElement(pg,null,d.createElement(yc,{force:!0},d.createElement(Wi,null,d.createElement(zi.Provider,{value:V},d.createElement(Ec,{target:m},d.createElement(yc,{force:!1},d.createElement(I,{slot:C},d.createElement(_,null,d.createElement(Jg,{initialFocus:i,initialFocusFallback:m,containers:L,features:W},d.createElement(em,{value:S},G({ourProps:q,theirProps:f,slot:C,defaultTag:pb,features:hb,visible:y===0,name:"Dialog"})))))))))))}),pb="div",hb=on.RenderStrategy|on.Static;function mb(n,r){let{transition:e=!1,open:t,...o}=n,a=Qn(),i=n.hasOwnProperty("open")||a!==null,s=n.hasOwnProperty("onClose");if(!i&&!s)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!i)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!s)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!a&&typeof n.open!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${n.open}`);if(typeof n.onClose!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${n.onClose}`);return(t!==void 0||e)&&!o.static?d.createElement(Ic,null,d.createElement(jc,{show:t,transition:e,unmount:o.unmount},d.createElement(Hc,{ref:r,...o}))):d.createElement(Ic,null,d.createElement(Hc,{ref:r,open:t,...o}))}let vb="div";function gb(n,r){let e=d.useId(),{id:t=`headlessui-dialog-panel-${e}`,transition:o=!1,...a}=n,[{dialogState:i,unmount:s},l]=Yo("Dialog.Panel"),u=We(r,l.panelRef),c=d.useMemo(()=>({open:i===0}),[i]),f=Z(g=>{g.stopPropagation()}),h={ref:u,id:t,onClick:f},p=o?Vi:d.Fragment,m=o?{unmount:s}:{},v=Te();return d.createElement(p,{...m},v({ourProps:h,theirProps:a,slot:c,defaultTag:vb,name:"Dialog.Panel"}))}let bb="div";function yb(n,r){let{transition:e=!1,...t}=n,[{dialogState:o,unmount:a}]=Yo("Dialog.Backdrop"),i=d.useMemo(()=>({open:o===0}),[o]),s={ref:r,"aria-hidden":!0},l=e?Vi:d.Fragment,u=e?{unmount:a}:{},c=Te();return d.createElement(l,{...u},c({ourProps:s,theirProps:t,slot:i,defaultTag:bb,name:"Dialog.Backdrop"}))}let wb="h2";function xb(n,r){let e=d.useId(),{id:t=`headlessui-dialog-title-${e}`,...o}=n,[{dialogState:a,setTitleId:i}]=Yo("Dialog.Title"),s=We(r);d.useEffect(()=>(i(t),()=>i(null)),[t,i]);let l=d.useMemo(()=>({open:a===0}),[a]),u={ref:s,id:t};return Te()({ourProps:u,theirProps:o,slot:l,defaultTag:wb,name:"Dialog.Title"})}let Eb=_e(mb),Bc=_e(gb);_e(yb);let Vc=_e(xb),Wr=Object.assign(Eb,{Panel:Bc,Title:Vc,Description:Zl});function Db(n,r){let e=d.useRef({left:0,top:0});if(fe(()=>{if(!r)return;let o=r.getBoundingClientRect();o&&(e.current=o)},[n,r]),r==null||!n||r===document.activeElement)return!1;let t=r.getBoundingClientRect();return t.top!==e.current.top||t.left!==e.current.left}let zc=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function qc(n){var r,e;let t=(r=n.innerText)!=null?r:"",o=n.cloneNode(!0);if(!tt(o))return t;let a=!1;for(let s of o.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))s.remove(),a=!0;let i=a?(e=o.innerText)!=null?e:"":t;return zc.test(i)&&(i=i.replace(zc,"")),i}function Sb(n){let r=n.getAttribute("aria-label");if(typeof r=="string")return r.trim();let e=n.getAttribute("aria-labelledby");if(e){let t=e.split(" ").map(o=>{let a=document.getElementById(o);if(a){let i=a.getAttribute("aria-label");return typeof i=="string"?i.trim():qc(a).trim()}return null}).filter(Boolean);if(t.length>0)return t.join(", ")}return qc(n).trim()}function kb(n){let r=d.useRef(""),e=d.useRef("");return Z(()=>{let t=n.current;if(!t)return"";let o=t.innerText;if(r.current===o)return e.current;let a=Sb(t).trim().toLowerCase();return r.current=o,e.current=a,a})}var Cb=Object.defineProperty,_b=(n,r,e)=>r in n?Cb(n,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[r]=e,Uc=(n,r,e)=>(_b(n,typeof r!="symbol"?r+"":r,e),e),Ke=(n=>(n[n.Open=0]="Open",n[n.Closed=1]="Closed",n))(Ke||{}),_t=(n=>(n[n.Single=0]="Single",n[n.Multi=1]="Multi",n))(_t||{}),Wo=(n=>(n[n.Pointer=0]="Pointer",n[n.Other=1]="Other",n))(Wo||{}),Qc=(n=>(n[n.OpenListbox=0]="OpenListbox",n[n.CloseListbox=1]="CloseListbox",n[n.GoToOption=2]="GoToOption",n[n.Search=3]="Search",n[n.ClearSearch=4]="ClearSearch",n[n.RegisterOptions=5]="RegisterOptions",n[n.UnregisterOptions=6]="UnregisterOptions",n[n.SetButtonElement=7]="SetButtonElement",n[n.SetOptionsElement=8]="SetOptionsElement",n[n.SortOptions=9]="SortOptions",n))(Qc||{});function Gc(n,r=e=>e){let e=n.activeOptionIndex!==null?n.options[n.activeOptionIndex]:null,t=wi(r(n.options.slice()),a=>a.dataRef.current.domRef.current),o=e?t.indexOf(e):null;return o===-1&&(o=null),{options:t,activeOptionIndex:o}}let Ob={1(n){return n.dataRef.current.disabled||n.listboxState===1?n:{...n,activeOptionIndex:null,pendingFocus:{focus:se.Nothing},listboxState:1,__demoMode:!1}},0(n,r){if(n.dataRef.current.disabled||n.listboxState===0)return n;let e=n.activeOptionIndex,{isSelected:t}=n.dataRef.current,o=n.options.findIndex(a=>t(a.dataRef.current.value));return o!==-1&&(e=o),{...n,pendingFocus:r.focus,listboxState:0,activeOptionIndex:e,__demoMode:!1}},2(n,r){var e,t,o,a,i;if(n.dataRef.current.disabled||n.listboxState===1)return n;let s={...n,searchQuery:"",activationTrigger:(e=r.trigger)!=null?e:1,__demoMode:!1};if(r.focus===se.Nothing)return{...s,activeOptionIndex:null};if(r.focus===se.Specific)return{...s,activeOptionIndex:n.options.findIndex(c=>c.id===r.id)};if(r.focus===se.Previous){let c=n.activeOptionIndex;if(c!==null){let f=n.options[c].dataRef.current.domRef,h=Gn(r,{resolveItems:()=>n.options,resolveActiveIndex:()=>n.activeOptionIndex,resolveId:p=>p.id,resolveDisabled:p=>p.dataRef.current.disabled});if(h!==null){let p=n.options[h].dataRef.current.domRef;if(((t=f.current)==null?void 0:t.previousElementSibling)===p.current||((o=p.current)==null?void 0:o.previousElementSibling)===null)return{...s,activeOptionIndex:h}}}}else if(r.focus===se.Next){let c=n.activeOptionIndex;if(c!==null){let f=n.options[c].dataRef.current.domRef,h=Gn(r,{resolveItems:()=>n.options,resolveActiveIndex:()=>n.activeOptionIndex,resolveId:p=>p.id,resolveDisabled:p=>p.dataRef.current.disabled});if(h!==null){let p=n.options[h].dataRef.current.domRef;if(((a=f.current)==null?void 0:a.nextElementSibling)===p.current||((i=p.current)==null?void 0:i.nextElementSibling)===null)return{...s,activeOptionIndex:h}}}}let l=Gc(n),u=Gn(r,{resolveItems:()=>l.options,resolveActiveIndex:()=>l.activeOptionIndex,resolveId:c=>c.id,resolveDisabled:c=>c.dataRef.current.disabled});return{...s,...l,activeOptionIndex:u}},3:(n,r)=>{if(n.dataRef.current.disabled||n.listboxState===1)return n;let e=n.searchQuery!==""?0:1,t=n.searchQuery+r.value.toLowerCase(),o=(n.activeOptionIndex!==null?n.options.slice(n.activeOptionIndex+e).concat(n.options.slice(0,n.activeOptionIndex+e)):n.options).find(i=>{var s;return!i.dataRef.current.disabled&&((s=i.dataRef.current.textValue)==null?void 0:s.startsWith(t))}),a=o?n.options.indexOf(o):-1;return a===-1||a===n.activeOptionIndex?{...n,searchQuery:t}:{...n,searchQuery:t,activeOptionIndex:a,activationTrigger:1}},4(n){return n.dataRef.current.disabled||n.listboxState===1||n.searchQuery===""?n:{...n,searchQuery:""}},5:(n,r)=>{let e=n.options.concat(r.options),t=n.activeOptionIndex;if(n.pendingFocus.focus!==se.Nothing&&(t=Gn(n.pendingFocus,{resolveItems:()=>e,resolveActiveIndex:()=>n.activeOptionIndex,resolveId:o=>o.id,resolveDisabled:o=>o.dataRef.current.disabled})),n.activeOptionIndex===null){let{isSelected:o}=n.dataRef.current;if(o){let a=e.findIndex(i=>o==null?void 0:o(i.dataRef.current.value));a!==-1&&(t=a)}}return{...n,options:e,activeOptionIndex:t,pendingFocus:{focus:se.Nothing},pendingShouldSort:!0}},6:(n,r)=>{let e=n.options,t=[],o=new Set(r.options);for(let[a,i]of e.entries())if(o.has(i.id)&&(t.push(a),o.delete(i.id),o.size===0))break;if(t.length>0){e=e.slice();for(let a of t.reverse())e.splice(a,1)}return{...n,options:e,activationTrigger:1}},7:(n,r)=>n.buttonElement===r.element?n:{...n,buttonElement:r.element},8:(n,r)=>n.optionsElement===r.element?n:{...n,optionsElement:r.element},9:n=>n.pendingShouldSort?{...n,...Gc(n),pendingShouldSort:!1}:n},Mb=class Wf extends ui{constructor(r){super(r),Uc(this,"actions",{onChange:e=>{let{onChange:t,compare:o,mode:a,value:i}=this.state.dataRef.current;return Fe(a,{0:()=>t==null?void 0:t(e),1:()=>{let s=i.slice(),l=s.findIndex(u=>o(u,e));return l===-1?s.push(e):s.splice(l,1),t==null?void 0:t(s)}})},registerOption:di(()=>{let e=[],t=new Set;return[(o,a)=>{t.has(a)||(t.add(a),e.push({id:o,dataRef:a}))},()=>(t.clear(),this.send({type:5,options:e.splice(0)}))]}),unregisterOption:di(()=>{let e=[];return[t=>e.push(t),()=>{this.send({type:6,options:e.splice(0)})}]}),goToOption:di(()=>{let e=null;return[(t,o)=>{e={type:2,...t,trigger:o}},()=>e&&this.send(e)]}),closeListbox:()=>{this.send({type:1})},openListbox:e=>{this.send({type:0,focus:e})},selectActiveOption:()=>{if(this.state.activeOptionIndex!==null){let{dataRef:e,id:t}=this.state.options[this.state.activeOptionIndex];this.actions.onChange(e.current.value),this.send({type:2,focus:se.Specific,id:t})}},selectOption:e=>{let t=this.state.options.find(o=>o.id===e);t&&this.actions.onChange(t.dataRef.current.value)},search:e=>{this.send({type:3,value:e})},clearSearch:()=>{this.send({type:4})},setButtonElement:e=>{this.send({type:7,element:e})},setOptionsElement:e=>{this.send({type:8,element:e})}}),Uc(this,"selectors",{activeDescendantId(e){var t;let o=e.activeOptionIndex,a=e.options;return o===null||(t=a[o])==null?void 0:t.id},isActive(e,t){var o;let a=e.activeOptionIndex,i=e.options;return a!==null?((o=i[a])==null?void 0:o.id)===t:!1},shouldScrollIntoView(e,t){return e.__demoMode||e.listboxState!==0||e.activationTrigger===0?!1:this.isActive(e,t)}}),this.on(5,()=>{requestAnimationFrame(()=>{this.send({type:9})})});{let e=this.state.id,t=Bn.get(null);this.disposables.add(t.on(fi.Push,o=>{!t.selectors.isTop(o,e)&&this.state.listboxState===0&&this.actions.closeListbox()})),this.on(0,()=>t.actions.push(e)),this.on(1,()=>t.actions.pop(e))}}static new({id:r,__demoMode:e=!1}){return new Wf({id:r,dataRef:{current:{}},listboxState:e?0:1,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1,buttonElement:null,optionsElement:null,pendingShouldSort:!1,pendingFocus:{focus:se.Nothing},__demoMode:e})}reduce(r,e){return Fe(e.type,Ob,r,e)}};const Kc=d.createContext(null);function qi(n){let r=d.useContext(Kc);if(r===null){let e=new Error(`<${n} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,Xc),e}return r}function Xc({id:n,__demoMode:r=!1}){let e=d.useMemo(()=>Mb.new({id:n,__demoMode:r}),[]);return Lo(()=>e.dispose()),e}let jo=d.createContext(null);jo.displayName="ListboxDataContext";function jr(n){let r=d.useContext(jo);if(r===null){let e=new Error(`<${n} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,jr),e}return r}let Tb=d.Fragment;function Pb(n,r){let e=d.useId(),t=go(),{value:o,defaultValue:a,form:i,name:s,onChange:l,by:u,invalid:c=!1,disabled:f=t||!1,horizontal:h=!1,multiple:p=!1,__demoMode:m=!1,...v}=n;const g=h?"horizontal":"vertical";let y=We(r),E=Hl(a),[w=p?[]:void 0,S]=jl(o,l,E),x=Xc({id:e,__demoMode:m}),T=d.useRef({static:!1,hold:!1}),N=d.useRef(new Map),_=lu(u),O=d.useCallback(G=>Fe(M.mode,{[_t.Multi]:()=>w.some(j=>_(j,G)),[_t.Single]:()=>_(w,G)}),[w]),M=d.useMemo(()=>({value:w,disabled:f,invalid:c,mode:p?_t.Multi:_t.Single,orientation:g,onChange:S,compare:_,isSelected:O,optionsPropsRef:T,listRef:N}),[w,f,c,p,g,S,_,O,T,N]);fe(()=>{x.state.dataRef.current=M},[M]);let L=we(x,G=>G.listboxState),b=Bn.get(null),k=we(b,d.useCallback(G=>b.selectors.isTop(G,e),[b,e])),[$,Y]=we(x,G=>[G.buttonElement,G.optionsElement]);Ei(k,[$,Y],(G,j)=>{x.send({type:Qc.CloseListbox}),xu(j,yi.Loose)||(G.preventDefault(),$==null||$.focus())});let I=d.useMemo(()=>({open:L===Ke.Open,disabled:f,invalid:c,value:w}),[L,f,c,w]),[V,C]=tu({inherit:!0}),q={ref:y},P=d.useCallback(()=>{if(E!==void 0)return S==null?void 0:S(E)},[S,E]),W=Te();return d.createElement(C,{value:V,props:{htmlFor:$==null?void 0:$.id},slot:{open:L===Ke.Open,disabled:f}},d.createElement(mc,null,d.createElement(Kc.Provider,{value:x},d.createElement(jo.Provider,{value:M},d.createElement(Ri,{value:Fe(L,{[Ke.Open]:Ue.Open,[Ke.Closed]:Ue.Closed})},s!=null&&w!=null&&d.createElement(ql,{disabled:f,data:{[s]:w},form:i,onReset:P}),W({ourProps:q,theirProps:v,slot:I,defaultTag:Tb,name:"Listbox"}))))))}let Ib="button";function Nb(n,r){let e=d.useId(),t=ai(),o=jr("Listbox.Button"),a=qi("Listbox.Button"),{id:i=t||`headlessui-listbox-button-${e}`,disabled:s=o.disabled||!1,autoFocus:l=!1,...u}=n,c=We(r,dc(),a.actions.setButtonElement),f=ug(),[h,p,m]=we(a,C=>[C.listboxState,C.buttonElement,C.optionsElement]),v=h===Ke.Open;Cu(v,{trigger:p,action:d.useCallback(C=>{if(p!=null&&p.contains(C.target))return Vt.Ignore;let q=C.target.closest('[role="option"]:not([data-disabled])');return tt(q)?Vt.Select(q):m!=null&&m.contains(C.target)?Vt.Ignore:Vt.Close},[p,m]),close:a.actions.closeListbox,select:a.actions.selectActiveOption});let g=Z(C=>{switch(C.key){case he.Enter:Nh(C.currentTarget);break;case he.Space:case he.ArrowDown:C.preventDefault(),a.actions.openListbox({focus:o.value?se.Nothing:se.First});break;case he.ArrowUp:C.preventDefault(),a.actions.openListbox({focus:o.value?se.Nothing:se.Last});break}}),y=Z(C=>{switch(C.key){case he.Space:C.preventDefault();break}}),E=Z(C=>{var q;if(C.button===$o.Left){if(Gl(C.currentTarget))return C.preventDefault();a.state.listboxState===Ke.Open?(Le.flushSync(()=>a.actions.closeListbox()),(q=a.state.buttonElement)==null||q.focus({preventScroll:!0})):(C.preventDefault(),a.actions.openListbox({focus:se.Nothing}))}}),w=d.useRef(null),S=Z(C=>{w.current=C.pointerType,C.pointerType==="mouse"&&E(C)}),x=Z(C=>{w.current!=="mouse"&&E(C)}),T=Z(C=>C.preventDefault()),N=kr([i]),_=Jl(),{isFocusVisible:O,focusProps:M}=ti({autoFocus:l}),{isHovered:L,hoverProps:b}=ei({isDisabled:s}),{pressed:k,pressProps:$}=Yl({disabled:s}),Y=d.useMemo(()=>({open:h===Ke.Open,active:k||h===Ke.Open,disabled:s,invalid:o.invalid,value:o.value,hover:L,focus:O,autofocus:l}),[h,o.value,s,L,O,k,o.invalid,l]),I=we(a,C=>C.listboxState===Ke.Open),V=Dr(f(),{ref:c,id:i,type:Ou(n,p),"aria-haspopup":"listbox","aria-controls":m==null?void 0:m.id,"aria-expanded":I,"aria-labelledby":N,"aria-describedby":_,disabled:s||void 0,autoFocus:l,onKeyDown:g,onKeyUp:y,onKeyPress:T,onPointerDown:S,onClick:x},M,b,$);return Te()({ourProps:V,theirProps:u,slot:Y,defaultTag:Ib,name:"Listbox.Button"})}let Jc=d.createContext(!1),$b="div",Lb=on.RenderStrategy|on.Static;function Fb(n,r){let e=d.useId(),{id:t=`headlessui-listbox-options-${e}`,anchor:o,portal:a=!1,modal:i=!0,transition:s=!1,...l}=n,u=cc(o),[c,f]=d.useState(null);u&&(a=!0);let h=jr("Listbox.Options"),p=qi("Listbox.Options"),[m,v,g,y]=we(p,A=>[A.listboxState,A.buttonElement,A.optionsElement,A.__demoMode]),E=Bt(v),w=Bt(g),S=Qn(),[x,T]=Ci(s,c,S!==null?(S&Ue.Open)===Ue.Open:m===Ke.Open);gi(x,v,p.actions.closeListbox);let N=y?!1:i&&m===Ke.Open;Si(N,w);let _=y?!1:i&&m===Ke.Open;vi(_,{allowed:d.useCallback(()=>[v,g],[v,g])});let O=m!==Ke.Open,M=Db(O,v)?!1:x,L=x&&m===Ke.Closed,b=Io(L,h.value),k=Z(A=>h.compare(b,A)),$=we(p,A=>{var B;if(u==null||!((B=u==null?void 0:u.to)!=null&&B.includes("selection")))return null;let K=A.options.findIndex(J=>k(J.dataRef.current.value));return K===-1&&(K=0),K}),Y=(()=>{if(u==null)return;if($===null)return{...u,inner:void 0};let A=Array.from(h.listRef.current.values());return{...u,inner:{listRef:{current:A},index:$}}})(),[I,V]=pc(Y),C=fc(),q=We(r,u?I:null,p.actions.setOptionsElement,f),P=rn();d.useEffect(()=>{var A;let B=g;B&&m===Ke.Open&&B!==((A=En(B))==null?void 0:A.activeElement)&&(B==null||B.focus({preventScroll:!0}))},[m,g]);let W=Z(A=>{var B,K;switch(P.dispose(),A.key){case he.Space:if(p.state.searchQuery!=="")return A.preventDefault(),A.stopPropagation(),p.actions.search(A.key);case he.Enter:if(A.preventDefault(),A.stopPropagation(),p.state.activeOptionIndex!==null){let{dataRef:J}=p.state.options[p.state.activeOptionIndex];p.actions.onChange(J.current.value)}h.mode===_t.Single&&(Le.flushSync(()=>p.actions.closeListbox()),(B=p.state.buttonElement)==null||B.focus({preventScroll:!0}));break;case Fe(h.orientation,{vertical:he.ArrowDown,horizontal:he.ArrowRight}):return A.preventDefault(),A.stopPropagation(),p.actions.goToOption({focus:se.Next});case Fe(h.orientation,{vertical:he.ArrowUp,horizontal:he.ArrowLeft}):return A.preventDefault(),A.stopPropagation(),p.actions.goToOption({focus:se.Previous});case he.Home:case he.PageUp:return A.preventDefault(),A.stopPropagation(),p.actions.goToOption({focus:se.First});case he.End:case he.PageDown:return A.preventDefault(),A.stopPropagation(),p.actions.goToOption({focus:se.Last});case he.Escape:A.preventDefault(),A.stopPropagation(),Le.flushSync(()=>p.actions.closeListbox()),(K=p.state.buttonElement)==null||K.focus({preventScroll:!0});return;case he.Tab:A.preventDefault(),A.stopPropagation(),Le.flushSync(()=>p.actions.closeListbox()),Nm(p.state.buttonElement,A.shiftKey?bt.Previous:bt.Next);break;default:A.key.length===1&&(p.actions.search(A.key),P.setTimeout(()=>p.actions.clearSearch(),350));break}}),G=we(p,A=>{var B;return(B=A.buttonElement)==null?void 0:B.id}),j=d.useMemo(()=>({open:m===Ke.Open}),[m]),F=Dr(u?C():{},{id:t,ref:q,"aria-activedescendant":we(p,p.selectors.activeDescendantId),"aria-multiselectable":h.mode===_t.Multi?!0:void 0,"aria-labelledby":G,"aria-orientation":h.orientation,onKeyDown:W,role:"listbox",tabIndex:m===Ke.Open?0:void 0,style:{...l.style,...V,"--button-width":si(v,!0).width},...ki(T)}),ne=Te(),U=d.useMemo(()=>h.mode===_t.Multi?h:{...h,isSelected:k},[h,k]);return d.createElement(Wi,{enabled:a?n.static||x:!1,ownerDocument:E},d.createElement(jo.Provider,{value:U},ne({ourProps:F,theirProps:l,slot:j,defaultTag:$b,features:Lb,visible:M,name:"Listbox.Options"})))}let Ab="div";function Rb(n,r){let e=d.useId(),{id:t=`headlessui-listbox-option-${e}`,disabled:o=!1,value:a,...i}=n,s=d.useContext(Jc)===!0,l=jr("Listbox.Option"),u=qi("Listbox.Option"),c=we(u,M=>u.selectors.isActive(M,t)),f=l.isSelected(a),h=d.useRef(null),p=kb(h),m=Yt({disabled:o,value:a,domRef:h,get textValue(){return p()}}),v=We(r,h,M=>{M?l.listRef.current.set(t,M):l.listRef.current.delete(t)}),g=we(u,M=>u.selectors.shouldScrollIntoView(M,t));fe(()=>{if(g)return ut().requestAnimationFrame(()=>{var M,L;(L=(M=h.current)==null?void 0:M.scrollIntoView)==null||L.call(M,{block:"nearest"})})},[g,h]),fe(()=>{if(!s)return u.actions.registerOption(t,m),()=>u.actions.unregisterOption(t)},[m,t,s]);let y=Z(M=>{var L;if(o)return M.preventDefault();u.actions.onChange(a),l.mode===_t.Single&&(Le.flushSync(()=>u.actions.closeListbox()),(L=u.state.buttonElement)==null||L.focus({preventScroll:!0}))}),E=Z(()=>{if(o)return u.actions.goToOption({focus:se.Nothing});u.actions.goToOption({focus:se.Specific,id:t})}),w=Tu(),S=Z(M=>w.update(M)),x=Z(M=>{w.wasMoved(M)&&(o||c&&u.state.activationTrigger===Wo.Pointer||u.actions.goToOption({focus:se.Specific,id:t},Wo.Pointer))}),T=Z(M=>{w.wasMoved(M)&&(o||c&&u.state.activationTrigger===Wo.Pointer&&u.actions.goToOption({focus:se.Nothing}))}),N=d.useMemo(()=>({active:c,focus:c,selected:f,disabled:o,selectedOption:f&&s}),[c,f,o,s]),_=s?{}:{id:t,ref:v,role:"option",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,"aria-selected":f,disabled:void 0,onClick:y,onFocus:E,onPointerEnter:S,onMouseEnter:S,onPointerMove:x,onMouseMove:x,onPointerLeave:T,onMouseLeave:T},O=Te();return!f&&s?null:O({ourProps:_,theirProps:i,slot:N,defaultTag:Ab,name:"Listbox.Option"})}let Yb=d.Fragment;function Wb(n,r){let{options:e,placeholder:t,...o}=n,a={ref:We(r)},i=jr("ListboxSelectedOption"),s=d.useMemo(()=>({}),[]),l=i.value===void 0||i.value===null||i.mode===_t.Multi&&Array.isArray(i.value)&&i.value.length===0,u=Te();return d.createElement(Jc.Provider,{value:!0},u({ourProps:a,theirProps:{...o,children:d.createElement(d.Fragment,null,t&&l?t:e)},slot:s,defaultTag:Yb,name:"ListboxSelectedOption"}))}let jb=_e(Pb),Zc=_e(Nb),Hb=Eo,ed=_e(Fb),td=_e(Rb),Bb=_e(Wb),Vb=Object.assign(jb,{Button:Zc,Label:Hb,Options:ed,Option:td,SelectedOption:Bb});const zb=n=>{const{isOpen:r,setIsOpen:e,onClose:t,title:o,image:a,description:i,confirm:s,cancel:l,disableOutsideClick:u,className:c}=n,f=()=>{u||t()};return R.jsx(jc,{show:r,enter:"transition ease-out duration-200",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"transition-opacity ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:R.jsxs(Wr,{onClose:f,className:"relative z-50 focus:outline-hidden",children:[R.jsx("div",{className:"fixed inset-0 bg-black/40","aria-hidden":!r}),R.jsx("div",{className:"fixed inset-0 flex w-screen items-center justify-center p-4",children:R.jsxs(Bc,{className:ot(c==null?void 0:c.popup,"ja-break-all flex w-[90vw] max-w-[300px] flex-col gap-[16px] rounded-[16px] bg-white p-[20px]"),children:[R.jsxs("div",{className:"flex flex-col gap-[8px]",children:[o&&R.jsx(Vc,{className:ot(c==null?void 0:c.title,"global-break-all text-title-small font-bold text-black"),children:o}),a&&R.jsx("img",{className:c==null?void 0:c.image,src:a.url,alt:a.alt}),i&&i!==""&&R.jsx(Zl,{className:ot(c==null?void 0:c.description,"text-petnow-grey-tertiary text-body-large popup-scrollbar max-h-[314px] overflow-y-auto break-all"),children:i})]}),R.jsxs("div",{className:"flex flex-col gap-[8px]",children:[s&&R.jsx("button",{className:"bg-petnow-orange-primary text-label-medium w-full cursor-pointer rounded-[12px] py-[12px] font-bold text-white transition duration-200 active:brightness-90 sm:hover:brightness-90",onClick:s.onClick,children:s.text}),l&&R.jsx("button",{onClick:()=>e(!1),className:"bg-background-tertiary text-petnow-grey-tertiary text-label-medium w-full cursor-pointer rounded-[12px] py-[12px] font-bold transition duration-200 active:brightness-90 sm:hover:brightness-90",children:l.text})]})]})})]})})},qb=({className:n,id:r,name:e,onChange:t,disabled:o,isChecked:a})=>R.jsxs("label",{htmlFor:r,className:"relative inline-flex cursor-pointer items-center",children:[R.jsx("input",{type:"checkbox",disabled:o,checked:a,id:r,name:e,className:"peer sr-only",onChange:t}),R.jsx("div",{className:ot(n,"bg-petnow-grey-primary peer-checked:bg-petnow-orange-primary h-[32px] w-[52px] rounded-full duration-[250ms] peer-focus:outline-none after:absolute after:start-[2px] after:top-[3px] after:size-[26px] after:rounded-full after:bg-white after:shadow-[0_3px_8px_0_rgba(0,0,0,0.15)] after:transition-all after:duration-[250ms] after:content-[''] peer-checked:after:translate-x-[calc(100%-4px)] peer-checked:after:border-white",o&&"cursor-not-allowed opacity-50")})]});var nd={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},rd=d.createContext&&d.createContext(nd),Ub=["attr","size","title"];function Qb(n,r){if(n==null)return{};var e=Gb(n,r),t,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(o=0;o<a.length;o++)t=a[o],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(n,t)&&(e[t]=n[t])}return e}function Gb(n,r){if(n==null)return{};var e={};for(var t in n)if(Object.prototype.hasOwnProperty.call(n,t)){if(r.indexOf(t)>=0)continue;e[t]=n[t]}return e}function Ho(){return Ho=Object.assign?Object.assign.bind():function(n){for(var r=1;r<arguments.length;r++){var e=arguments[r];for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])}return n},Ho.apply(this,arguments)}function od(n,r){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(n);r&&(t=t.filter(function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable})),e.push.apply(e,t)}return e}function Bo(n){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?od(Object(e),!0).forEach(function(t){Kb(n,t,e[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):od(Object(e)).forEach(function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(e,t))})}return n}function Kb(n,r,e){return r=Xb(r),r in n?Object.defineProperty(n,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[r]=e,n}function Xb(n){var r=Jb(n,"string");return typeof r=="symbol"?r:r+""}function Jb(n,r){if(typeof n!="object"||!n)return n;var e=n[Symbol.toPrimitive];if(e!==void 0){var t=e.call(n,r);if(typeof t!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(n)}function ad(n){return n&&n.map((r,e)=>d.createElement(r.tag,Bo({key:e},r.attr),ad(r.child)))}function Hr(n){return r=>d.createElement(Zb,Ho({attr:Bo({},n.attr)},r),ad(n.child))}function Zb(n){var r=e=>{var{attr:t,size:o,title:a}=n,i=Qb(n,Ub),s=o||e.size||"1em",l;return e.className&&(l=e.className),n.className&&(l=(l?l+" ":"")+n.className),d.createElement("svg",Ho({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},e.attr,t,i,{className:l,style:Bo(Bo({color:n.color||e.color},e.style),n.style),height:s,width:s,xmlns:"http://www.w3.org/2000/svg"}),a&&d.createElement("title",null,a),n.children)};return rd!==void 0?d.createElement(rd.Consumer,null,e=>r(e)):r(nd)}function ey(n){return Hr({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M6.23 20.23 8 22l10-10L8 2 6.23 3.77 14.46 12z"},child:[]}]})(n)}function id(n){return Hr({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"},child:[]}]})(n)}const ty=({checked:n,label:r,onChange:e,termImageUrl:t})=>{const[o,a]=d.useState(!1);return R.jsxs(R.Fragment,{children:[R.jsx(ny,{isOpen:o,setIsOpen:a,termImageUrl:t}),R.jsxs("div",{className:"inline-flex items-center",children:[R.jsxs("label",{className:"relative flex cursor-pointer items-center rounded-full p-3",htmlFor:"check",children:[R.jsx("input",{type:"checkbox",className:"before:content[''] border-petnow-grey-primary peer bg-petnow-grey-primary checked:border-petnow-orange-primary checked:bg-petnow-orange-primary checked:before:bg-petnow-orange-primary relative size-6 cursor-pointer appearance-none rounded-xl border transition-all before:absolute before:top-2/4 before:left-2/4 before:block before:h-12 before:w-12 before:-translate-x-2/4 before:-translate-y-2/4 before:rounded-full before:opacity-0 before:transition-opacity",id:r,checked:n,onChange:i=>{e(i.target.checked)}}),R.jsx("span",{className:"text-petnow-grey-secondary pointer-events-none absolute top-2/4 left-2/4 -translate-x-2/4 -translate-y-2/4 transition peer-checked:text-white",children:R.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",stroke:"currentColor",strokeWidth:"1",children:R.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})})]}),r&&R.jsxs("div",{className:"flex items-center",children:[R.jsx("label",{className:"cursor-pointer font-medium",htmlFor:r,children:r}),R.jsx(ey,{onClick:()=>{a(!0)},className:"text-petnow-grey-tertiary mt-[2.5px] ml-2 cursor-pointer",size:24})]})]})]})},ny=({isOpen:n,setIsOpen:r,termImageUrl:e})=>R.jsxs(Wr,{open:n,onClose:()=>r(!1),className:"relative z-50",children:[R.jsx("div",{className:"fixed inset-0 bg-black/30","aria-hidden":"true"}),R.jsx("div",{className:"fixed inset-0 w-screen overflow-y-auto",children:R.jsx("div",{className:"flex min-h-full items-center justify-center p-4",children:R.jsxs(Wr.Panel,{className:"mx-auto flex max-w-sm flex-col items-center rounded-sm bg-white",children:[R.jsx("div",{className:"bg-background-tertiary flex h-[36px] w-full flex-row-reverse items-center",children:R.jsx(id,{size:20,className:"mr-2",onClick:()=>r(!1)})}),R.jsx("img",{src:e,alt:"약관동의 이미지"})]})})})]});var Ui=function(n,r){return Ui=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])},Ui(n,r)},Xn=function(){return Xn=Object.assign||function(n){for(var r,e=1,t=arguments.length;e<t;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o]);return n},Xn.apply(this,arguments)};function ry(n,r){var e={};for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&r.indexOf(t)<0&&(e[t]=n[t]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function"){var o=0;for(t=Object.getOwnPropertySymbols(n);o<t.length;o++)r.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(n,t[o])&&(e[t[o]]=n[t[o]])}return e}var Qi,sd="https://t1.daumcdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js",oy=(Qi=null,function(n){return n===void 0&&(n=sd),Qi||(Qi=new Promise(function(r,e){var t=document.createElement("script");t.src=n,t.onload=function(){var o;if(!((o=window==null?void 0:window.daum)===null||o===void 0)&&o.Postcode)return r(window.daum.Postcode);e(new Error("Script is loaded successfully, but cannot find Postcode module. Check your scriptURL property."))},t.onerror=function(o){return e(o)},t.id="daum_postcode_script",document.body.appendChild(t)}))}),ay=d.createElement("p",null,"현재 Daum 우편번호 서비스를 이용할 수 없습니다. 잠시 후 다시 시도해주세요."),iy={width:"100%",height:400},sy={scriptUrl:sd,errorMessage:ay,autoClose:!0},ly=function(n){function r(){var e=n!==null&&n.apply(this,arguments)||this;return e.mounted=!1,e.wrap=d.createRef(),e.state={hasError:!1,completed:!1},e.initiate=function(t){if(e.wrap.current){var o=e.props;o.scriptUrl,o.className,o.style;var a=o.defaultQuery,i=o.autoClose;o.errorMessage;var s=o.onComplete,l=o.onClose,u=o.onResize,c=o.onSearch,f=ry(o,["scriptUrl","className","style","defaultQuery","autoClose","errorMessage","onComplete","onClose","onResize","onSearch"]);new t(Xn(Xn({},f),{oncomplete:function(h){s&&s(h),e.setState({completed:!0})},onsearch:c,onresize:u,onclose:l,width:"100%",height:"100%"})).embed(e.wrap.current,{q:a,autoClose:i})}},e.onError=function(t){console.error(t),e.setState({hasError:!0})},e}return function(e,t){function o(){this.constructor=e}Ui(e,t),e.prototype=t===null?Object.create(t):(o.prototype=t.prototype,new o)}(r,n),r.prototype.componentDidMount=function(){var e=this.initiate,t=this.onError,o=this.props.scriptUrl;o&&(this.mounted||(oy(o).then(e).catch(t),this.mounted=!0))},r.prototype.render=function(){var e=this.props,t=e.className,o=e.style,a=e.errorMessage,i=e.autoClose,s=this.state,l=s.hasError,u=s.completed;return i===!0&&u===!0?null:d.createElement("div",{ref:this.wrap,className:t,style:Xn(Xn({},iy),o)},l&&a)},r.defaultProps=sy,r}(d.Component);const uy=({label:n,value:r,onFrontChange:e,onBackChange:t,onPostalCodeChange:o,disabled:a})=>{const[i,s]=d.useState(!1),l=f=>{let h=f.address,p="";f.addressType==="R"&&(f.bname!==""&&(p+=f.bname),f.buildingName!==""&&(p+=p!==""?`, ${f.buildingName}`:f.buildingName),h+=p!==""?` (${p})`:""),e(h),o&&o(f.zonecode),s(!1)},u=()=>{s(!0)},c=()=>r.front?r.front:R.jsx("p",{className:"text-petnow-grey-primary",children:"주소를 입력해주세요."});return R.jsxs(R.Fragment,{children:[R.jsx(cy,{isOpen:i,setIsOpen:s,handleComplete:l}),R.jsxs("div",{className:"text-petnow-grey-tertiary",children:[R.jsx("label",{htmlFor:n,className:"text-sm font-bold text-black",children:n}),R.jsxs("div",{className:"relative flex flex-col",children:[R.jsx("div",{className:`bg-background-secondary placeholder:text-petnow-grey-primary mt-4 h-[60px] w-full cursor-pointer overflow-hidden rounded-xl p-4 text-base whitespace-nowrap focus:outline-hidden ${a&&"opacity-50"}`,onClick:u,children:c()}),R.jsx("input",{disabled:!r.front||a,value:r.back,type:"text",name:n,id:n,placeholder:"상세 주소를 입력해주세요.",className:"bg-background-secondary placeholder:text-petnow-grey-primary mt-4 h-[60px] w-full rounded-xl p-4 text-base focus:outline-hidden disabled:opacity-50",autoComplete:"off",onChange:f=>t(f.target.value)})]})]})]})},cy=n=>{const{isOpen:r,setIsOpen:e,handleComplete:t}=n;return R.jsx(Wr,{open:r,onClose:()=>e(!1),className:"relateive z-50",children:R.jsx("div",{className:"fixed inset-0 flex w-screen items-center justify-center",children:R.jsx(Wr.Panel,{children:R.jsxs("div",{children:[R.jsx("div",{className:"bg-background-tertiary flex h-[36px] w-[100vw] flex-row-reverse items-center px-2",onClick:()=>e(!1),children:R.jsx(id,{size:24,onClick:()=>e(!1)})}),R.jsx(ly,{onComplete:t,style:{width:"100vw",height:"calc(100vh - 36px)"}})]})})})})};function dy(n){return Hr({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 294.1L383 167c9.4-9.4 24.6-9.4 33.9 0s9.3 24.6 0 34L273 345c-9.1 9.1-23.7 9.3-33.1.7L95 201.1c-4.7-4.7-7-10.9-7-17s2.3-12.3 7-17c9.4-9.4 24.6-9.4 33.9 0l127.1 127z"},child:[]}]})(n)}function fy(n){return Hr({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 217.9L383 345c9.4 9.4 24.6 9.4 33.9 0 9.4-9.4 9.3-24.6 0-34L273 167c-9.1-9.1-23.7-9.3-33.1-.7L95 310.9c-4.7 4.7-7 10.9-7 17s2.3 12.3 7 17c9.4 9.4 24.6 9.4 33.9 0l127.1-127z"},child:[]}]})(n)}const py=({title:n,description:r,titleTextClassName:e,descriptionTextClassName:t})=>{const[o,a]=d.useState(!1);return R.jsxs("div",{className:"my-2.5 flex w-full cursor-pointer flex-col justify-center rounded-xl px-4 pt-8 shadow-[0_2px_8px_0_rgba(0,0,0,0.08)] md:rounded-2xl md:pt-10",onClick:()=>a(i=>!i),children:[R.jsxs("div",{className:"flex w-full items-center justify-between px-2 pb-8 transition-all duration-300 md:px-4 md:pb-10",children:[R.jsxs("p",{className:ot("mr-4 text-lg font-medium md:text-xl",e),children:[R.jsx("span",{className:"font-semibold",children:"Q."})," ",n]}),o?R.jsx(fy,{className:"text-petnow-orange-primary min-w-6",size:24}):R.jsx(dy,{className:"text-petnow-orange-primary min-w-6",size:24})]}),R.jsx("p",{className:ot(`text-petnow-grey-secondary w-full overflow-hidden px-2 text-base leading-6 whitespace-pre-wrap transition-all duration-300 md:px-4 md:text-lg ${o?"max-h-[24rem] pb-8 sm:max-h-60 md:pb-10":"max-h-0"}`,t),children:r})]})},ld=6048e5,hy=864e5,Vo=6e4,zo=36e5,my=1e3,ud=Symbol.for("constructDateFrom");function De(n,r){return typeof n=="function"?n(r):n&&typeof n=="object"&&ud in n?n[ud](r):n instanceof Date?new n.constructor(r):new Date(r)}function ae(n,r){return De(r||n,n)}function yt(n,r,e){const t=ae(n,e==null?void 0:e.in);return isNaN(r)?De((e==null?void 0:e.in)||n,NaN):(r&&t.setDate(t.getDate()+r),t)}function wt(n,r,e){const t=ae(n,e==null?void 0:e.in);if(isNaN(r))return De(n,NaN);if(!r)return t;const o=t.getDate(),a=De(n,t.getTime());a.setMonth(t.getMonth()+r+1,0);const i=a.getDate();return o>=i?a:(t.setFullYear(a.getFullYear(),a.getMonth(),o),t)}function cd(n,r,e){return De(n,+ae(n)+r)}function vy(n,r,e){return cd(n,r*zo)}let gy={};function _n(){return gy}function Ut(n,r){var s,l,u,c;const e=_n(),t=(r==null?void 0:r.weekStartsOn)??((l=(s=r==null?void 0:r.locale)==null?void 0:s.options)==null?void 0:l.weekStartsOn)??e.weekStartsOn??((c=(u=e.locale)==null?void 0:u.options)==null?void 0:c.weekStartsOn)??0,o=ae(n,r==null?void 0:r.in),a=o.getDay(),i=(a<t?7:0)+a-t;return o.setDate(o.getDate()-i),o.setHours(0,0,0,0),o}function Jn(n,r){return Ut(n,{...r,weekStartsOn:1})}function dd(n,r){const e=ae(n,r==null?void 0:r.in),t=e.getFullYear(),o=De(e,0);o.setFullYear(t+1,0,4),o.setHours(0,0,0,0);const a=Jn(o),i=De(e,0);i.setFullYear(t,0,4),i.setHours(0,0,0,0);const s=Jn(i);return e.getTime()>=a.getTime()?t+1:e.getTime()>=s.getTime()?t:t-1}function qo(n){const r=ae(n),e=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return e.setUTCFullYear(r.getFullYear()),+n-+e}function Qt(n,...r){const e=De.bind(null,r.find(t=>typeof t=="object"));return r.map(e)}function On(n,r){const e=ae(n,r==null?void 0:r.in);return e.setHours(0,0,0,0),e}function Zn(n,r,e){const[t,o]=Qt(e==null?void 0:e.in,n,r),a=On(t),i=On(o),s=+a-qo(a),l=+i-qo(i);return Math.round((s-l)/hy)}function by(n,r){const e=dd(n,r),t=De(n,0);return t.setFullYear(e,0,4),t.setHours(0,0,0,0),Jn(t)}function Gi(n,r,e){const t=ae(n,e==null?void 0:e.in);return t.setTime(t.getTime()+r*Vo),t}function Ki(n,r,e){return wt(n,r*3,e)}function yy(n,r,e){return cd(n,r*1e3)}function Uo(n,r,e){return yt(n,r*7,e)}function Gt(n,r,e){return wt(n,r*12,e)}function fd(n,r){let e,t=r==null?void 0:r.in;return n.forEach(o=>{!t&&typeof o=="object"&&(t=De.bind(null,o));const a=ae(o,t);(!e||e<a||isNaN(+a))&&(e=a)}),De(t,e||NaN)}function pd(n,r){let e,t=r==null?void 0:r.in;return n.forEach(o=>{!t&&typeof o=="object"&&(t=De.bind(null,o));const a=ae(o,t);(!e||e>a||isNaN(+a))&&(e=a)}),De(t,e||NaN)}function wy(n,r,e){const[t,o]=Qt(e==null?void 0:e.in,n,r);return+On(t)==+On(o)}function Kt(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Qo(n){return!(!Kt(n)&&typeof n!="number"||isNaN(+ae(n)))}function Go(n,r,e){const[t,o]=Qt(e==null?void 0:e.in,n,r),a=t.getFullYear()-o.getFullYear(),i=t.getMonth()-o.getMonth();return a*12+i}function Mn(n,r){const e=ae(n,r==null?void 0:r.in);return Math.trunc(e.getMonth()/3)+1}function Ko(n,r,e){const[t,o]=Qt(e==null?void 0:e.in,n,r),a=t.getFullYear()-o.getFullYear(),i=Mn(t)-Mn(o);return a*4+i}function Xo(n,r,e){const[t,o]=Qt(e==null?void 0:e.in,n,r);return t.getFullYear()-o.getFullYear()}function xy(n,r,e){const[t,o]=Qt(e==null?void 0:e.in,n,r),a=hd(t,o),i=Math.abs(Zn(t,o));t.setDate(t.getDate()-a*i);const s=+(hd(t,o)===-a),l=a*(i-s);return l===0?0:l}function hd(n,r){const e=n.getFullYear()-r.getFullYear()||n.getMonth()-r.getMonth()||n.getDate()-r.getDate()||n.getHours()-r.getHours()||n.getMinutes()-r.getMinutes()||n.getSeconds()-r.getSeconds()||n.getMilliseconds()-r.getMilliseconds();return e<0?-1:e>0?1:e}function md(n,r){const e=ae(n,r==null?void 0:r.in);return e.setHours(23,59,59,999),e}function vd(n,r){const e=ae(n,r==null?void 0:r.in),t=e.getMonth();return e.setFullYear(e.getFullYear(),t+1,0),e.setHours(23,59,59,999),e}function Xi(n,r){const e=ae(n,r==null?void 0:r.in),t=e.getMonth(),o=t-t%3;return e.setMonth(o,1),e.setHours(0,0,0,0),e}function gd(n,r){const e=ae(n,r==null?void 0:r.in);return e.setDate(1),e.setHours(0,0,0,0),e}function bd(n,r){const e=ae(n,r==null?void 0:r.in),t=e.getFullYear();return e.setFullYear(t+1,0,0),e.setHours(23,59,59,999),e}function Jo(n,r){const e=ae(n,r==null?void 0:r.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function Ey(n,r){var s,l;const e=_n(),t=e.weekStartsOn??((l=(s=e.locale)==null?void 0:s.options)==null?void 0:l.weekStartsOn)??0,o=ae(n,r==null?void 0:r.in),a=o.getDay(),i=(a<t?-7:0)+6-(a-t);return o.setDate(o.getDate()+i),o.setHours(23,59,59,999),o}const Dy={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Sy=(n,r,e)=>{let t;const o=Dy[n];return typeof o=="string"?t=o:r===1?t=o.one:t=o.other.replace("{{count}}",r.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+t:t+" ago":t};function er(n){return(r={})=>{const e=r.width?String(r.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const ky={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Cy={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},_y={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Oy={date:er({formats:ky,defaultWidth:"full"}),time:er({formats:Cy,defaultWidth:"full"}),dateTime:er({formats:_y,defaultWidth:"full"})},My={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Ty=(n,r,e,t)=>My[n];function Ot(n){return(r,e)=>{const t=e!=null&&e.context?String(e.context):"standalone";let o;if(t==="formatting"&&n.formattingValues){const i=n.defaultFormattingWidth||n.defaultWidth,s=e!=null&&e.width?String(e.width):i;o=n.formattingValues[s]||n.formattingValues[i]}else{const i=n.defaultWidth,s=e!=null&&e.width?String(e.width):n.defaultWidth;o=n.values[s]||n.values[i]}const a=n.argumentCallback?n.argumentCallback(r):r;return o[a]}}const Py={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Iy={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Ny={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},$y={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Ly={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Fy={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Ay={ordinalNumber:(n,r)=>{const e=Number(n),t=e%100;if(t>20||t<10)switch(t%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},era:Ot({values:Py,defaultWidth:"wide"}),quarter:Ot({values:Iy,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Ot({values:Ny,defaultWidth:"wide"}),day:Ot({values:$y,defaultWidth:"wide"}),dayPeriod:Ot({values:Ly,defaultWidth:"wide",formattingValues:Fy,defaultFormattingWidth:"wide"})};function Mt(n){return(r,e={})=>{const t=e.width,o=t&&n.matchPatterns[t]||n.matchPatterns[n.defaultMatchWidth],a=r.match(o);if(!a)return null;const i=a[0],s=t&&n.parsePatterns[t]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(s)?Yy(s,f=>f.test(i)):Ry(s,f=>f.test(i));let u;u=n.valueCallback?n.valueCallback(l):l,u=e.valueCallback?e.valueCallback(u):u;const c=r.slice(i.length);return{value:u,rest:c}}}function Ry(n,r){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&r(n[e]))return e}function Yy(n,r){for(let e=0;e<n.length;e++)if(r(n[e]))return e}function yd(n){return(r,e={})=>{const t=r.match(n.matchPattern);if(!t)return null;const o=t[0],a=r.match(n.parsePattern);if(!a)return null;let i=n.valueCallback?n.valueCallback(a[0]):a[0];i=e.valueCallback?e.valueCallback(i):i;const s=r.slice(o.length);return{value:i,rest:s}}}const Wy=/^(\d+)(th|st|nd|rd)?/i,jy=/\d+/i,Hy={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},By={any:[/^b/i,/^(a|c)/i]},Vy={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},zy={any:[/1/i,/2/i,/3/i,/4/i]},qy={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Uy={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Qy={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Gy={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Ky={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Xy={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Jy={ordinalNumber:yd({matchPattern:Wy,parsePattern:jy,valueCallback:n=>parseInt(n,10)}),era:Mt({matchPatterns:Hy,defaultMatchWidth:"wide",parsePatterns:By,defaultParseWidth:"any"}),quarter:Mt({matchPatterns:Vy,defaultMatchWidth:"wide",parsePatterns:zy,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Mt({matchPatterns:qy,defaultMatchWidth:"wide",parsePatterns:Uy,defaultParseWidth:"any"}),day:Mt({matchPatterns:Qy,defaultMatchWidth:"wide",parsePatterns:Gy,defaultParseWidth:"any"}),dayPeriod:Mt({matchPatterns:Ky,defaultMatchWidth:"any",parsePatterns:Xy,defaultParseWidth:"any"})},wd={code:"en-US",formatDistance:Sy,formatLong:Oy,formatRelative:Ty,localize:Ay,match:Jy,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Zy(n,r){const e=ae(n,r==null?void 0:r.in);return Zn(e,Jo(e))+1}function Ji(n,r){const e=ae(n,r==null?void 0:r.in),t=+Jn(e)-+by(e);return Math.round(t/ld)+1}function Zi(n,r){var c,f,h,p;const e=ae(n,r==null?void 0:r.in),t=e.getFullYear(),o=_n(),a=(r==null?void 0:r.firstWeekContainsDate)??((f=(c=r==null?void 0:r.locale)==null?void 0:c.options)==null?void 0:f.firstWeekContainsDate)??o.firstWeekContainsDate??((p=(h=o.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??1,i=De((r==null?void 0:r.in)||n,0);i.setFullYear(t+1,0,a),i.setHours(0,0,0,0);const s=Ut(i,r),l=De((r==null?void 0:r.in)||n,0);l.setFullYear(t,0,a),l.setHours(0,0,0,0);const u=Ut(l,r);return+e>=+s?t+1:+e>=+u?t:t-1}function ew(n,r){var s,l,u,c;const e=_n(),t=(r==null?void 0:r.firstWeekContainsDate)??((l=(s=r==null?void 0:r.locale)==null?void 0:s.options)==null?void 0:l.firstWeekContainsDate)??e.firstWeekContainsDate??((c=(u=e.locale)==null?void 0:u.options)==null?void 0:c.firstWeekContainsDate)??1,o=Zi(n,r),a=De((r==null?void 0:r.in)||n,0);return a.setFullYear(o,0,t),a.setHours(0,0,0,0),Ut(a,r)}function xd(n,r){const e=ae(n,r==null?void 0:r.in),t=+Ut(e,r)-+ew(e,r);return Math.round(t/ld)+1}function Se(n,r){const e=n<0?"-":"",t=Math.abs(n).toString().padStart(r,"0");return e+t}const hn={y(n,r){const e=n.getFullYear(),t=e>0?e:1-e;return Se(r==="yy"?t%100:t,r.length)},M(n,r){const e=n.getMonth();return r==="M"?String(e+1):Se(e+1,2)},d(n,r){return Se(n.getDate(),r.length)},a(n,r){const e=n.getHours()/12>=1?"pm":"am";switch(r){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,r){return Se(n.getHours()%12||12,r.length)},H(n,r){return Se(n.getHours(),r.length)},m(n,r){return Se(n.getMinutes(),r.length)},s(n,r){return Se(n.getSeconds(),r.length)},S(n,r){const e=r.length,t=n.getMilliseconds(),o=Math.trunc(t*Math.pow(10,e-3));return Se(o,r.length)}},tr={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Ed={G:function(n,r,e){const t=n.getFullYear()>0?1:0;switch(r){case"G":case"GG":case"GGG":return e.era(t,{width:"abbreviated"});case"GGGGG":return e.era(t,{width:"narrow"});case"GGGG":default:return e.era(t,{width:"wide"})}},y:function(n,r,e){if(r==="yo"){const t=n.getFullYear(),o=t>0?t:1-t;return e.ordinalNumber(o,{unit:"year"})}return hn.y(n,r)},Y:function(n,r,e,t){const o=Zi(n,t),a=o>0?o:1-o;if(r==="YY"){const i=a%100;return Se(i,2)}return r==="Yo"?e.ordinalNumber(a,{unit:"year"}):Se(a,r.length)},R:function(n,r){const e=dd(n);return Se(e,r.length)},u:function(n,r){const e=n.getFullYear();return Se(e,r.length)},Q:function(n,r,e){const t=Math.ceil((n.getMonth()+1)/3);switch(r){case"Q":return String(t);case"QQ":return Se(t,2);case"Qo":return e.ordinalNumber(t,{unit:"quarter"});case"QQQ":return e.quarter(t,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(t,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(t,{width:"wide",context:"formatting"})}},q:function(n,r,e){const t=Math.ceil((n.getMonth()+1)/3);switch(r){case"q":return String(t);case"qq":return Se(t,2);case"qo":return e.ordinalNumber(t,{unit:"quarter"});case"qqq":return e.quarter(t,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(t,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(t,{width:"wide",context:"standalone"})}},M:function(n,r,e){const t=n.getMonth();switch(r){case"M":case"MM":return hn.M(n,r);case"Mo":return e.ordinalNumber(t+1,{unit:"month"});case"MMM":return e.month(t,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(t,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(t,{width:"wide",context:"formatting"})}},L:function(n,r,e){const t=n.getMonth();switch(r){case"L":return String(t+1);case"LL":return Se(t+1,2);case"Lo":return e.ordinalNumber(t+1,{unit:"month"});case"LLL":return e.month(t,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(t,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(t,{width:"wide",context:"standalone"})}},w:function(n,r,e,t){const o=xd(n,t);return r==="wo"?e.ordinalNumber(o,{unit:"week"}):Se(o,r.length)},I:function(n,r,e){const t=Ji(n);return r==="Io"?e.ordinalNumber(t,{unit:"week"}):Se(t,r.length)},d:function(n,r,e){return r==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):hn.d(n,r)},D:function(n,r,e){const t=Zy(n);return r==="Do"?e.ordinalNumber(t,{unit:"dayOfYear"}):Se(t,r.length)},E:function(n,r,e){const t=n.getDay();switch(r){case"E":case"EE":case"EEE":return e.day(t,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(t,{width:"short",context:"formatting"});case"EEEE":default:return e.day(t,{width:"wide",context:"formatting"})}},e:function(n,r,e,t){const o=n.getDay(),a=(o-t.weekStartsOn+8)%7||7;switch(r){case"e":return String(a);case"ee":return Se(a,2);case"eo":return e.ordinalNumber(a,{unit:"day"});case"eee":return e.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(o,{width:"short",context:"formatting"});case"eeee":default:return e.day(o,{width:"wide",context:"formatting"})}},c:function(n,r,e,t){const o=n.getDay(),a=(o-t.weekStartsOn+8)%7||7;switch(r){case"c":return String(a);case"cc":return Se(a,r.length);case"co":return e.ordinalNumber(a,{unit:"day"});case"ccc":return e.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(o,{width:"narrow",context:"standalone"});case"cccccc":return e.day(o,{width:"short",context:"standalone"});case"cccc":default:return e.day(o,{width:"wide",context:"standalone"})}},i:function(n,r,e){const t=n.getDay(),o=t===0?7:t;switch(r){case"i":return String(o);case"ii":return Se(o,r.length);case"io":return e.ordinalNumber(o,{unit:"day"});case"iii":return e.day(t,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(t,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(t,{width:"short",context:"formatting"});case"iiii":default:return e.day(t,{width:"wide",context:"formatting"})}},a:function(n,r,e){const o=n.getHours()/12>=1?"pm":"am";switch(r){case"a":case"aa":return e.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(n,r,e){const t=n.getHours();let o;switch(t===12?o=tr.noon:t===0?o=tr.midnight:o=t/12>=1?"pm":"am",r){case"b":case"bb":return e.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(n,r,e){const t=n.getHours();let o;switch(t>=17?o=tr.evening:t>=12?o=tr.afternoon:t>=4?o=tr.morning:o=tr.night,r){case"B":case"BB":case"BBB":return e.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(n,r,e){if(r==="ho"){let t=n.getHours()%12;return t===0&&(t=12),e.ordinalNumber(t,{unit:"hour"})}return hn.h(n,r)},H:function(n,r,e){return r==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):hn.H(n,r)},K:function(n,r,e){const t=n.getHours()%12;return r==="Ko"?e.ordinalNumber(t,{unit:"hour"}):Se(t,r.length)},k:function(n,r,e){let t=n.getHours();return t===0&&(t=24),r==="ko"?e.ordinalNumber(t,{unit:"hour"}):Se(t,r.length)},m:function(n,r,e){return r==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):hn.m(n,r)},s:function(n,r,e){return r==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):hn.s(n,r)},S:function(n,r){return hn.S(n,r)},X:function(n,r,e){const t=n.getTimezoneOffset();if(t===0)return"Z";switch(r){case"X":return Sd(t);case"XXXX":case"XX":return Tn(t);case"XXXXX":case"XXX":default:return Tn(t,":")}},x:function(n,r,e){const t=n.getTimezoneOffset();switch(r){case"x":return Sd(t);case"xxxx":case"xx":return Tn(t);case"xxxxx":case"xxx":default:return Tn(t,":")}},O:function(n,r,e){const t=n.getTimezoneOffset();switch(r){case"O":case"OO":case"OOO":return"GMT"+Dd(t,":");case"OOOO":default:return"GMT"+Tn(t,":")}},z:function(n,r,e){const t=n.getTimezoneOffset();switch(r){case"z":case"zz":case"zzz":return"GMT"+Dd(t,":");case"zzzz":default:return"GMT"+Tn(t,":")}},t:function(n,r,e){const t=Math.trunc(+n/1e3);return Se(t,r.length)},T:function(n,r,e){return Se(+n,r.length)}};function Dd(n,r=""){const e=n>0?"-":"+",t=Math.abs(n),o=Math.trunc(t/60),a=t%60;return a===0?e+String(o):e+String(o)+r+Se(a,2)}function Sd(n,r){return n%60===0?(n>0?"-":"+")+Se(Math.abs(n)/60,2):Tn(n,r)}function Tn(n,r=""){const e=n>0?"-":"+",t=Math.abs(n),o=Se(Math.trunc(t/60),2),a=Se(t%60,2);return e+o+r+a}const kd=(n,r)=>{switch(n){case"P":return r.date({width:"short"});case"PP":return r.date({width:"medium"});case"PPP":return r.date({width:"long"});case"PPPP":default:return r.date({width:"full"})}},Cd=(n,r)=>{switch(n){case"p":return r.time({width:"short"});case"pp":return r.time({width:"medium"});case"ppp":return r.time({width:"long"});case"pppp":default:return r.time({width:"full"})}},es={p:Cd,P:(n,r)=>{const e=n.match(/(P+)(p+)?/)||[],t=e[1],o=e[2];if(!o)return kd(n,r);let a;switch(t){case"P":a=r.dateTime({width:"short"});break;case"PP":a=r.dateTime({width:"medium"});break;case"PPP":a=r.dateTime({width:"long"});break;case"PPPP":default:a=r.dateTime({width:"full"});break}return a.replace("{{date}}",kd(t,r)).replace("{{time}}",Cd(o,r))}},tw=/^D+$/,nw=/^Y+$/,rw=["D","DD","YY","YYYY"];function ow(n){return tw.test(n)}function aw(n){return nw.test(n)}function iw(n,r,e){const t=sw(n,r,e);if(console.warn(t),rw.includes(n))throw new RangeError(t)}function sw(n,r,e){const t=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${r}\`) for formatting ${t} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const lw=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,uw=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,cw=/^'([^]*?)'?$/,dw=/''/g,fw=/[a-zA-Z]/;function _d(n,r,e){var c,f,h,p,m,v,g,y;const t=_n(),o=(e==null?void 0:e.locale)??t.locale??wd,a=(e==null?void 0:e.firstWeekContainsDate)??((f=(c=e==null?void 0:e.locale)==null?void 0:c.options)==null?void 0:f.firstWeekContainsDate)??t.firstWeekContainsDate??((p=(h=t.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??1,i=(e==null?void 0:e.weekStartsOn)??((v=(m=e==null?void 0:e.locale)==null?void 0:m.options)==null?void 0:v.weekStartsOn)??t.weekStartsOn??((y=(g=t.locale)==null?void 0:g.options)==null?void 0:y.weekStartsOn)??0,s=ae(n,e==null?void 0:e.in);if(!Qo(s))throw new RangeError("Invalid time value");let l=r.match(uw).map(E=>{const w=E[0];if(w==="p"||w==="P"){const S=es[w];return S(E,o.formatLong)}return E}).join("").match(lw).map(E=>{if(E==="''")return{isToken:!1,value:"'"};const w=E[0];if(w==="'")return{isToken:!1,value:pw(E)};if(Ed[w])return{isToken:!0,value:E};if(w.match(fw))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");return{isToken:!1,value:E}});o.localize.preprocessor&&(l=o.localize.preprocessor(s,l));const u={firstWeekContainsDate:a,weekStartsOn:i,locale:o};return l.map(E=>{if(!E.isToken)return E.value;const w=E.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&aw(w)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&ow(w))&&iw(w,r,String(n));const S=Ed[w[0]];return S(s,w,o.localize,u)}).join("")}function pw(n){const r=n.match(cw);return r?r[1].replace(dw,"'"):n}function Od(n,r){return ae(n,r==null?void 0:r.in).getDate()}function hw(n,r){return ae(n,r==null?void 0:r.in).getDay()}function mw(n,r){const e=ae(n,r==null?void 0:r.in),t=e.getFullYear(),o=e.getMonth(),a=De(e,0);return a.setFullYear(t,o+1,0),a.setHours(0,0,0,0),a.getDate()}function vw(){return Object.assign({},_n())}function Xt(n,r){return ae(n,r==null?void 0:r.in).getHours()}function gw(n,r){const e=ae(n,r==null?void 0:r.in).getDay();return e===0?7:e}function Jt(n,r){return ae(n,r==null?void 0:r.in).getMinutes()}function Je(n,r){return ae(n,r==null?void 0:r.in).getMonth()}function mn(n){return ae(n).getSeconds()}function ts(n){return+ae(n)}function le(n,r){return ae(n,r==null?void 0:r.in).getFullYear()}function vn(n,r){return+ae(n)>+ae(r)}function Pn(n,r){return+ae(n)<+ae(r)}function bw(n,r){return+ae(n)==+ae(r)}function yw(n,r){const e=ww(r)?new r(0):De(r,0);return e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e}function ww(n){var r;return typeof n=="function"&&((r=n.prototype)==null?void 0:r.constructor)===n}const xw=10;class Md{constructor(){te(this,"subPriority",0)}validate(r,e){return!0}}class Ew extends Md{constructor(r,e,t,o,a){super(),this.value=r,this.validateValue=e,this.setValue=t,this.priority=o,a&&(this.subPriority=a)}validate(r,e){return this.validateValue(r,this.value,e)}set(r,e,t){return this.setValue(r,e,this.value,t)}}class Dw extends Md{constructor(e,t){super();te(this,"priority",xw);te(this,"subPriority",-1);this.context=e||(o=>De(t,o))}set(e,t){return t.timestampIsSet?e:De(e,yw(e,this.context))}}class ge{run(r,e,t,o){const a=this.parse(r,e,t,o);return a?{setter:new Ew(a.value,this.validate,this.set,this.priority,this.subPriority),rest:a.rest}:null}validate(r,e,t){return!0}}class Sw extends ge{constructor(){super(...arguments);te(this,"priority",140);te(this,"incompatibleTokens",["R","u","t","T"])}parse(e,t,o){switch(t){case"G":case"GG":case"GGG":return o.era(e,{width:"abbreviated"})||o.era(e,{width:"narrow"});case"GGGGG":return o.era(e,{width:"narrow"});case"GGGG":default:return o.era(e,{width:"wide"})||o.era(e,{width:"abbreviated"})||o.era(e,{width:"narrow"})}}set(e,t,o){return t.era=o,e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}}const Ae={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Tt={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function Re(n,r){return n&&{value:r(n.value),rest:n.rest}}function Pe(n,r){const e=r.match(n);return e?{value:parseInt(e[0],10),rest:r.slice(e[0].length)}:null}function Pt(n,r){const e=r.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:r.slice(1)};const t=e[1]==="+"?1:-1,o=e[2]?parseInt(e[2],10):0,a=e[3]?parseInt(e[3],10):0,i=e[5]?parseInt(e[5],10):0;return{value:t*(o*zo+a*Vo+i*my),rest:r.slice(e[0].length)}}function Td(n){return Pe(Ae.anyDigitsSigned,n)}function $e(n,r){switch(n){case 1:return Pe(Ae.singleDigit,r);case 2:return Pe(Ae.twoDigits,r);case 3:return Pe(Ae.threeDigits,r);case 4:return Pe(Ae.fourDigits,r);default:return Pe(new RegExp("^\\d{1,"+n+"}"),r)}}function Zo(n,r){switch(n){case 1:return Pe(Ae.singleDigitSigned,r);case 2:return Pe(Ae.twoDigitsSigned,r);case 3:return Pe(Ae.threeDigitsSigned,r);case 4:return Pe(Ae.fourDigitsSigned,r);default:return Pe(new RegExp("^-?\\d{1,"+n+"}"),r)}}function ns(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function Pd(n,r){const e=r>0,t=e?r:1-r;let o;if(t<=50)o=n||100;else{const a=t+50,i=Math.trunc(a/100)*100,s=n>=a%100;o=n+i-(s?100:0)}return e?o:1-o}function Id(n){return n%400===0||n%4===0&&n%100!==0}class kw extends ge{constructor(){super(...arguments);te(this,"priority",130);te(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(e,t,o){const a=i=>({year:i,isTwoDigitYear:t==="yy"});switch(t){case"y":return Re($e(4,e),a);case"yo":return Re(o.ordinalNumber(e,{unit:"year"}),a);default:return Re($e(t.length,e),a)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,o){const a=e.getFullYear();if(o.isTwoDigitYear){const s=Pd(o.year,a);return e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}const i=!("era"in t)||t.era===1?o.year:1-o.year;return e.setFullYear(i,0,1),e.setHours(0,0,0,0),e}}class Cw extends ge{constructor(){super(...arguments);te(this,"priority",130);te(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(e,t,o){const a=i=>({year:i,isTwoDigitYear:t==="YY"});switch(t){case"Y":return Re($e(4,e),a);case"Yo":return Re(o.ordinalNumber(e,{unit:"year"}),a);default:return Re($e(t.length,e),a)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,o,a){const i=Zi(e,a);if(o.isTwoDigitYear){const l=Pd(o.year,i);return e.setFullYear(l,0,a.firstWeekContainsDate),e.setHours(0,0,0,0),Ut(e,a)}const s=!("era"in t)||t.era===1?o.year:1-o.year;return e.setFullYear(s,0,a.firstWeekContainsDate),e.setHours(0,0,0,0),Ut(e,a)}}class _w extends ge{constructor(){super(...arguments);te(this,"priority",130);te(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(e,t){return Zo(t==="R"?4:t.length,e)}set(e,t,o){const a=De(e,0);return a.setFullYear(o,0,4),a.setHours(0,0,0,0),Jn(a)}}class Ow extends ge{constructor(){super(...arguments);te(this,"priority",130);te(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(e,t){return Zo(t==="u"?4:t.length,e)}set(e,t,o){return e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}}class Mw extends ge{constructor(){super(...arguments);te(this,"priority",120);te(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,t,o){switch(t){case"Q":case"QQ":return $e(t.length,e);case"Qo":return o.ordinalNumber(e,{unit:"quarter"});case"QQQ":return o.quarter(e,{width:"abbreviated",context:"formatting"})||o.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return o.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return o.quarter(e,{width:"wide",context:"formatting"})||o.quarter(e,{width:"abbreviated",context:"formatting"})||o.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=1&&t<=4}set(e,t,o){return e.setMonth((o-1)*3,1),e.setHours(0,0,0,0),e}}class Tw extends ge{constructor(){super(...arguments);te(this,"priority",120);te(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,t,o){switch(t){case"q":case"qq":return $e(t.length,e);case"qo":return o.ordinalNumber(e,{unit:"quarter"});case"qqq":return o.quarter(e,{width:"abbreviated",context:"standalone"})||o.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return o.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return o.quarter(e,{width:"wide",context:"standalone"})||o.quarter(e,{width:"abbreviated",context:"standalone"})||o.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=1&&t<=4}set(e,t,o){return e.setMonth((o-1)*3,1),e.setHours(0,0,0,0),e}}class Pw extends ge{constructor(){super(...arguments);te(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);te(this,"priority",110)}parse(e,t,o){const a=i=>i-1;switch(t){case"M":return Re(Pe(Ae.month,e),a);case"MM":return Re($e(2,e),a);case"Mo":return Re(o.ordinalNumber(e,{unit:"month"}),a);case"MMM":return o.month(e,{width:"abbreviated",context:"formatting"})||o.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return o.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return o.month(e,{width:"wide",context:"formatting"})||o.month(e,{width:"abbreviated",context:"formatting"})||o.month(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=11}set(e,t,o){return e.setMonth(o,1),e.setHours(0,0,0,0),e}}class Iw extends ge{constructor(){super(...arguments);te(this,"priority",110);te(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(e,t,o){const a=i=>i-1;switch(t){case"L":return Re(Pe(Ae.month,e),a);case"LL":return Re($e(2,e),a);case"Lo":return Re(o.ordinalNumber(e,{unit:"month"}),a);case"LLL":return o.month(e,{width:"abbreviated",context:"standalone"})||o.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return o.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return o.month(e,{width:"wide",context:"standalone"})||o.month(e,{width:"abbreviated",context:"standalone"})||o.month(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=0&&t<=11}set(e,t,o){return e.setMonth(o,1),e.setHours(0,0,0,0),e}}function Nw(n,r,e){const t=ae(n,e==null?void 0:e.in),o=xd(t,e)-r;return t.setDate(t.getDate()-o*7),ae(t,e==null?void 0:e.in)}class $w extends ge{constructor(){super(...arguments);te(this,"priority",100);te(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(e,t,o){switch(t){case"w":return Pe(Ae.week,e);case"wo":return o.ordinalNumber(e,{unit:"week"});default:return $e(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,o,a){return Ut(Nw(e,o,a),a)}}function Lw(n,r,e){const t=ae(n,e==null?void 0:e.in),o=Ji(t,e)-r;return t.setDate(t.getDate()-o*7),t}class Fw extends ge{constructor(){super(...arguments);te(this,"priority",100);te(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(e,t,o){switch(t){case"I":return Pe(Ae.week,e);case"Io":return o.ordinalNumber(e,{unit:"week"});default:return $e(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,o){return Jn(Lw(e,o))}}const Aw=[31,28,31,30,31,30,31,31,30,31,30,31],Rw=[31,29,31,30,31,30,31,31,30,31,30,31];class Yw extends ge{constructor(){super(...arguments);te(this,"priority",90);te(this,"subPriority",1);te(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(e,t,o){switch(t){case"d":return Pe(Ae.date,e);case"do":return o.ordinalNumber(e,{unit:"date"});default:return $e(t.length,e)}}validate(e,t){const o=e.getFullYear(),a=Id(o),i=e.getMonth();return a?t>=1&&t<=Rw[i]:t>=1&&t<=Aw[i]}set(e,t,o){return e.setDate(o),e.setHours(0,0,0,0),e}}class Ww extends ge{constructor(){super(...arguments);te(this,"priority",90);te(this,"subpriority",1);te(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(e,t,o){switch(t){case"D":case"DD":return Pe(Ae.dayOfYear,e);case"Do":return o.ordinalNumber(e,{unit:"date"});default:return $e(t.length,e)}}validate(e,t){const o=e.getFullYear();return Id(o)?t>=1&&t<=366:t>=1&&t<=365}set(e,t,o){return e.setMonth(0,o),e.setHours(0,0,0,0),e}}function rs(n,r,e){var f,h,p,m;const t=_n(),o=(e==null?void 0:e.weekStartsOn)??((h=(f=e==null?void 0:e.locale)==null?void 0:f.options)==null?void 0:h.weekStartsOn)??t.weekStartsOn??((m=(p=t.locale)==null?void 0:p.options)==null?void 0:m.weekStartsOn)??0,a=ae(n,e==null?void 0:e.in),i=a.getDay(),l=(r%7+7)%7,u=7-o,c=r<0||r>6?r-(i+u)%7:(l+u)%7-(i+u)%7;return yt(a,c,e)}class jw extends ge{constructor(){super(...arguments);te(this,"priority",90);te(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(e,t,o){switch(t){case"E":case"EE":case"EEE":return o.day(e,{width:"abbreviated",context:"formatting"})||o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return o.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"});case"EEEE":default:return o.day(e,{width:"wide",context:"formatting"})||o.day(e,{width:"abbreviated",context:"formatting"})||o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=6}set(e,t,o,a){return e=rs(e,o,a),e.setHours(0,0,0,0),e}}class Hw extends ge{constructor(){super(...arguments);te(this,"priority",90);te(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(e,t,o,a){const i=s=>{const l=Math.floor((s-1)/7)*7;return(s+a.weekStartsOn+6)%7+l};switch(t){case"e":case"ee":return Re($e(t.length,e),i);case"eo":return Re(o.ordinalNumber(e,{unit:"day"}),i);case"eee":return o.day(e,{width:"abbreviated",context:"formatting"})||o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"});case"eeeee":return o.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"});case"eeee":default:return o.day(e,{width:"wide",context:"formatting"})||o.day(e,{width:"abbreviated",context:"formatting"})||o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=6}set(e,t,o,a){return e=rs(e,o,a),e.setHours(0,0,0,0),e}}class Bw extends ge{constructor(){super(...arguments);te(this,"priority",90);te(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(e,t,o,a){const i=s=>{const l=Math.floor((s-1)/7)*7;return(s+a.weekStartsOn+6)%7+l};switch(t){case"c":case"cc":return Re($e(t.length,e),i);case"co":return Re(o.ordinalNumber(e,{unit:"day"}),i);case"ccc":return o.day(e,{width:"abbreviated",context:"standalone"})||o.day(e,{width:"short",context:"standalone"})||o.day(e,{width:"narrow",context:"standalone"});case"ccccc":return o.day(e,{width:"narrow",context:"standalone"});case"cccccc":return o.day(e,{width:"short",context:"standalone"})||o.day(e,{width:"narrow",context:"standalone"});case"cccc":default:return o.day(e,{width:"wide",context:"standalone"})||o.day(e,{width:"abbreviated",context:"standalone"})||o.day(e,{width:"short",context:"standalone"})||o.day(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=0&&t<=6}set(e,t,o,a){return e=rs(e,o,a),e.setHours(0,0,0,0),e}}function Vw(n,r,e){const t=ae(n,e==null?void 0:e.in),o=gw(t,e),a=r-o;return yt(t,a,e)}class zw extends ge{constructor(){super(...arguments);te(this,"priority",90);te(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(e,t,o){const a=i=>i===0?7:i;switch(t){case"i":case"ii":return $e(t.length,e);case"io":return o.ordinalNumber(e,{unit:"day"});case"iii":return Re(o.day(e,{width:"abbreviated",context:"formatting"})||o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"}),a);case"iiiii":return Re(o.day(e,{width:"narrow",context:"formatting"}),a);case"iiiiii":return Re(o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"}),a);case"iiii":default:return Re(o.day(e,{width:"wide",context:"formatting"})||o.day(e,{width:"abbreviated",context:"formatting"})||o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"}),a)}}validate(e,t){return t>=1&&t<=7}set(e,t,o){return e=Vw(e,o),e.setHours(0,0,0,0),e}}class qw extends ge{constructor(){super(...arguments);te(this,"priority",80);te(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(e,t,o){switch(t){case"a":case"aa":case"aaa":return o.dayPeriod(e,{width:"abbreviated",context:"formatting"})||o.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return o.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaa":default:return o.dayPeriod(e,{width:"wide",context:"formatting"})||o.dayPeriod(e,{width:"abbreviated",context:"formatting"})||o.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,o){return e.setHours(ns(o),0,0,0),e}}class Uw extends ge{constructor(){super(...arguments);te(this,"priority",80);te(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(e,t,o){switch(t){case"b":case"bb":case"bbb":return o.dayPeriod(e,{width:"abbreviated",context:"formatting"})||o.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return o.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbb":default:return o.dayPeriod(e,{width:"wide",context:"formatting"})||o.dayPeriod(e,{width:"abbreviated",context:"formatting"})||o.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,o){return e.setHours(ns(o),0,0,0),e}}class Qw extends ge{constructor(){super(...arguments);te(this,"priority",80);te(this,"incompatibleTokens",["a","b","t","T"])}parse(e,t,o){switch(t){case"B":case"BB":case"BBB":return o.dayPeriod(e,{width:"abbreviated",context:"formatting"})||o.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return o.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBB":default:return o.dayPeriod(e,{width:"wide",context:"formatting"})||o.dayPeriod(e,{width:"abbreviated",context:"formatting"})||o.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,o){return e.setHours(ns(o),0,0,0),e}}class Gw extends ge{constructor(){super(...arguments);te(this,"priority",70);te(this,"incompatibleTokens",["H","K","k","t","T"])}parse(e,t,o){switch(t){case"h":return Pe(Ae.hour12h,e);case"ho":return o.ordinalNumber(e,{unit:"hour"});default:return $e(t.length,e)}}validate(e,t){return t>=1&&t<=12}set(e,t,o){const a=e.getHours()>=12;return a&&o<12?e.setHours(o+12,0,0,0):!a&&o===12?e.setHours(0,0,0,0):e.setHours(o,0,0,0),e}}class Kw extends ge{constructor(){super(...arguments);te(this,"priority",70);te(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(e,t,o){switch(t){case"H":return Pe(Ae.hour23h,e);case"Ho":return o.ordinalNumber(e,{unit:"hour"});default:return $e(t.length,e)}}validate(e,t){return t>=0&&t<=23}set(e,t,o){return e.setHours(o,0,0,0),e}}class Xw extends ge{constructor(){super(...arguments);te(this,"priority",70);te(this,"incompatibleTokens",["h","H","k","t","T"])}parse(e,t,o){switch(t){case"K":return Pe(Ae.hour11h,e);case"Ko":return o.ordinalNumber(e,{unit:"hour"});default:return $e(t.length,e)}}validate(e,t){return t>=0&&t<=11}set(e,t,o){return e.getHours()>=12&&o<12?e.setHours(o+12,0,0,0):e.setHours(o,0,0,0),e}}class Jw extends ge{constructor(){super(...arguments);te(this,"priority",70);te(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(e,t,o){switch(t){case"k":return Pe(Ae.hour24h,e);case"ko":return o.ordinalNumber(e,{unit:"hour"});default:return $e(t.length,e)}}validate(e,t){return t>=1&&t<=24}set(e,t,o){const a=o<=24?o%24:o;return e.setHours(a,0,0,0),e}}class Zw extends ge{constructor(){super(...arguments);te(this,"priority",60);te(this,"incompatibleTokens",["t","T"])}parse(e,t,o){switch(t){case"m":return Pe(Ae.minute,e);case"mo":return o.ordinalNumber(e,{unit:"minute"});default:return $e(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,o){return e.setMinutes(o,0,0),e}}class e0 extends ge{constructor(){super(...arguments);te(this,"priority",50);te(this,"incompatibleTokens",["t","T"])}parse(e,t,o){switch(t){case"s":return Pe(Ae.second,e);case"so":return o.ordinalNumber(e,{unit:"second"});default:return $e(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,o){return e.setSeconds(o,0),e}}class t0 extends ge{constructor(){super(...arguments);te(this,"priority",30);te(this,"incompatibleTokens",["t","T"])}parse(e,t){const o=a=>Math.trunc(a*Math.pow(10,-t.length+3));return Re($e(t.length,e),o)}set(e,t,o){return e.setMilliseconds(o),e}}class n0 extends ge{constructor(){super(...arguments);te(this,"priority",10);te(this,"incompatibleTokens",["t","T","x"])}parse(e,t){switch(t){case"X":return Pt(Tt.basicOptionalMinutes,e);case"XX":return Pt(Tt.basic,e);case"XXXX":return Pt(Tt.basicOptionalSeconds,e);case"XXXXX":return Pt(Tt.extendedOptionalSeconds,e);case"XXX":default:return Pt(Tt.extended,e)}}set(e,t,o){return t.timestampIsSet?e:De(e,e.getTime()-qo(e)-o)}}class r0 extends ge{constructor(){super(...arguments);te(this,"priority",10);te(this,"incompatibleTokens",["t","T","X"])}parse(e,t){switch(t){case"x":return Pt(Tt.basicOptionalMinutes,e);case"xx":return Pt(Tt.basic,e);case"xxxx":return Pt(Tt.basicOptionalSeconds,e);case"xxxxx":return Pt(Tt.extendedOptionalSeconds,e);case"xxx":default:return Pt(Tt.extended,e)}}set(e,t,o){return t.timestampIsSet?e:De(e,e.getTime()-qo(e)-o)}}class o0 extends ge{constructor(){super(...arguments);te(this,"priority",40);te(this,"incompatibleTokens","*")}parse(e){return Td(e)}set(e,t,o){return[De(e,o*1e3),{timestampIsSet:!0}]}}class a0 extends ge{constructor(){super(...arguments);te(this,"priority",20);te(this,"incompatibleTokens","*")}parse(e){return Td(e)}set(e,t,o){return[De(e,o),{timestampIsSet:!0}]}}const i0={G:new Sw,y:new kw,Y:new Cw,R:new _w,u:new Ow,Q:new Mw,q:new Tw,M:new Pw,L:new Iw,w:new $w,I:new Fw,d:new Yw,D:new Ww,E:new jw,e:new Hw,c:new Bw,i:new zw,a:new qw,b:new Uw,B:new Qw,h:new Gw,H:new Kw,K:new Xw,k:new Jw,m:new Zw,s:new e0,S:new t0,X:new n0,x:new r0,t:new o0,T:new a0},s0=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,l0=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,u0=/^'([^]*?)'?$/,c0=/''/g,d0=/\S/,f0=/[a-zA-Z]/;function p0(n,r,e,t){var g,y,E,w,S,x,T,N;const o=()=>De((t==null?void 0:t.in)||e,NaN),a=vw(),i=(t==null?void 0:t.locale)??a.locale??wd,s=(t==null?void 0:t.firstWeekContainsDate)??((y=(g=t==null?void 0:t.locale)==null?void 0:g.options)==null?void 0:y.firstWeekContainsDate)??a.firstWeekContainsDate??((w=(E=a.locale)==null?void 0:E.options)==null?void 0:w.firstWeekContainsDate)??1,l=(t==null?void 0:t.weekStartsOn)??((x=(S=t==null?void 0:t.locale)==null?void 0:S.options)==null?void 0:x.weekStartsOn)??a.weekStartsOn??((N=(T=a.locale)==null?void 0:T.options)==null?void 0:N.weekStartsOn)??0;if(!r)return n?o():ae(e,t==null?void 0:t.in);const u={firstWeekContainsDate:s,weekStartsOn:l,locale:i},c=[new Dw(t==null?void 0:t.in,e)],f=r.match(l0).map(_=>{const O=_[0];if(O in es){const M=es[O];return M(_,i.formatLong)}return _}).join("").match(s0),h=[];for(let _ of f){const O=_[0],M=i0[O];if(M){const{incompatibleTokens:L}=M;if(Array.isArray(L)){const k=h.find($=>L.includes($.token)||$.token===O);if(k)throw new RangeError(`The format string mustn't contain \`${k.fullToken}\` and \`${_}\` at the same time`)}else if(M.incompatibleTokens==="*"&&h.length>0)throw new RangeError(`The format string mustn't contain \`${_}\` and any other token at the same time`);h.push({token:O,fullToken:_});const b=M.run(n,_,i.match,u);if(!b)return o();c.push(b.setter),n=b.rest}else{if(O.match(f0))throw new RangeError("Format string contains an unescaped latin alphabet character `"+O+"`");if(_==="''"?_="'":O==="'"&&(_=h0(_)),n.indexOf(_)===0)n=n.slice(_.length);else return o()}}if(n.length>0&&d0.test(n))return o();const p=c.map(_=>_.priority).sort((_,O)=>O-_).filter((_,O,M)=>M.indexOf(_)===O).map(_=>c.filter(O=>O.priority===_).sort((O,M)=>M.subPriority-O.subPriority)).map(_=>_[0]);let m=ae(e,t==null?void 0:t.in);if(isNaN(+m))return o();const v={};for(const _ of p){if(!_.validate(m,u))return o();const O=_.set(m,v,u);Array.isArray(O)?(m=O[0],Object.assign(v,O[1])):m=O}return m}function h0(n){return n.match(u0)[1].replace(c0,"'")}function m0(n,r,e){const[t,o]=Qt(e==null?void 0:e.in,n,r);return t.getFullYear()===o.getFullYear()&&t.getMonth()===o.getMonth()}function v0(n,r,e){const[t,o]=Qt(e==null?void 0:e.in,n,r);return+Xi(t)==+Xi(o)}function g0(n,r,e){const[t,o]=Qt(e==null?void 0:e.in,n,r);return t.getFullYear()===o.getFullYear()}function Br(n,r,e){const t=+ae(n,e==null?void 0:e.in),[o,a]=[+ae(r.start,e==null?void 0:e.in),+ae(r.end,e==null?void 0:e.in)].sort((i,s)=>i-s);return t>=o&&t<=a}function b0(n,r,e){return yt(n,-1,e)}function y0(n,r){const e=()=>De(r==null?void 0:r.in,NaN),o=D0(n);let a;if(o.date){const u=S0(o.date,2);a=k0(u.restDateString,u.year)}if(!a||isNaN(+a))return e();const i=+a;let s=0,l;if(o.time&&(s=C0(o.time),isNaN(s)))return e();if(o.timezone){if(l=_0(o.timezone),isNaN(l))return e()}else{const u=new Date(i+s),c=ae(0,r==null?void 0:r.in);return c.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),c.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),c}return ae(i+s+l,r==null?void 0:r.in)}const ea={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},w0=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,x0=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,E0=/^([+-])(\d{2})(?::?(\d{2}))?$/;function D0(n){const r={},e=n.split(ea.dateTimeDelimiter);let t;if(e.length>2)return r;if(/:/.test(e[0])?t=e[0]:(r.date=e[0],t=e[1],ea.timeZoneDelimiter.test(r.date)&&(r.date=n.split(ea.timeZoneDelimiter)[0],t=n.substr(r.date.length,n.length))),t){const o=ea.timezone.exec(t);o?(r.time=t.replace(o[1],""),r.timezone=o[1]):r.time=t}return r}function S0(n,r){const e=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+r)+"})|(\\d{2}|[+-]\\d{"+(2+r)+"})$)"),t=n.match(e);if(!t)return{year:NaN,restDateString:""};const o=t[1]?parseInt(t[1]):null,a=t[2]?parseInt(t[2]):null;return{year:a===null?o:a*100,restDateString:n.slice((t[1]||t[2]).length)}}function k0(n,r){if(r===null)return new Date(NaN);const e=n.match(w0);if(!e)return new Date(NaN);const t=!!e[4],o=Vr(e[1]),a=Vr(e[2])-1,i=Vr(e[3]),s=Vr(e[4]),l=Vr(e[5])-1;if(t)return I0(r,s,l)?O0(r,s,l):new Date(NaN);{const u=new Date(0);return!T0(r,a,i)||!P0(r,o)?new Date(NaN):(u.setUTCFullYear(r,a,Math.max(o,i)),u)}}function Vr(n){return n?parseInt(n):1}function C0(n){const r=n.match(x0);if(!r)return NaN;const e=os(r[1]),t=os(r[2]),o=os(r[3]);return N0(e,t,o)?e*zo+t*Vo+o*1e3:NaN}function os(n){return n&&parseFloat(n.replace(",","."))||0}function _0(n){if(n==="Z")return 0;const r=n.match(E0);if(!r)return 0;const e=r[1]==="+"?-1:1,t=parseInt(r[2]),o=r[3]&&parseInt(r[3])||0;return $0(t,o)?e*(t*zo+o*Vo):NaN}function O0(n,r,e){const t=new Date(0);t.setUTCFullYear(n,0,4);const o=t.getUTCDay()||7,a=(r-1)*7+e+1-o;return t.setUTCDate(t.getUTCDate()+a),t}const M0=[31,null,31,30,31,30,31,31,30,31,30,31];function Nd(n){return n%400===0||n%4===0&&n%100!==0}function T0(n,r,e){return r>=0&&r<=11&&e>=1&&e<=(M0[r]||(Nd(n)?29:28))}function P0(n,r){return r>=1&&r<=(Nd(n)?366:365)}function I0(n,r,e){return r>=1&&r<=53&&e>=0&&e<=6}function N0(n,r,e){return n===24?r===0&&e===0:e>=0&&e<60&&r>=0&&r<60&&n>=0&&n<25}function $0(n,r){return r>=0&&r<=59}function pt(n,r,e){const t=ae(n,e==null?void 0:e.in),o=t.getFullYear(),a=t.getDate(),i=De(n,0);i.setFullYear(o,r,15),i.setHours(0,0,0,0);const s=mw(i);return t.setMonth(r,Math.min(a,s)),t}function ta(n,r,e){const t=ae(n,e==null?void 0:e.in);return t.setHours(r),t}function na(n,r,e){const t=ae(n,e==null?void 0:e.in);return t.setMinutes(r),t}function nr(n,r,e){const t=ae(n,e==null?void 0:e.in),o=Math.trunc(t.getMonth()/3)+1,a=r-o;return pt(t,t.getMonth()+a*3)}function ra(n,r,e){const t=ae(n,e==null?void 0:e.in);return t.setSeconds(r),t}function It(n,r,e){const t=ae(n,e==null?void 0:e.in);return isNaN(+t)?De(n,NaN):(t.setFullYear(r),t)}function In(n,r,e){return wt(n,-r,e)}function $d(n,r,e){return Ki(n,-1,e)}function Ld(n,r,e){return Uo(n,-1,e)}function rr(n,r,e){return Gt(n,-r,e)}const L0={lessThanXSeconds:{one:"1초 미만",other:"{{count}}초 미만"},xSeconds:{one:"1초",other:"{{count}}초"},halfAMinute:"30초",lessThanXMinutes:{one:"1분 미만",other:"{{count}}분 미만"},xMinutes:{one:"1분",other:"{{count}}분"},aboutXHours:{one:"약 1시간",other:"약 {{count}}시간"},xHours:{one:"1시간",other:"{{count}}시간"},xDays:{one:"1일",other:"{{count}}일"},aboutXWeeks:{one:"약 1주",other:"약 {{count}}주"},xWeeks:{one:"1주",other:"{{count}}주"},aboutXMonths:{one:"약 1개월",other:"약 {{count}}개월"},xMonths:{one:"1개월",other:"{{count}}개월"},aboutXYears:{one:"약 1년",other:"약 {{count}}년"},xYears:{one:"1년",other:"{{count}}년"},overXYears:{one:"1년 이상",other:"{{count}}년 이상"},almostXYears:{one:"거의 1년",other:"거의 {{count}}년"}},F0=(n,r,e)=>{let t;const o=L0[n];return typeof o=="string"?t=o:r===1?t=o.one:t=o.other.replace("{{count}}",r.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?t+" 후":t+" 전":t},A0={full:"y년 M월 d일 EEEE",long:"y년 M월 d일",medium:"y.MM.dd",short:"y.MM.dd"},R0={full:"a H시 mm분 ss초 zzzz",long:"a H:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},Y0={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},W0={date:er({formats:A0,defaultWidth:"full"}),time:er({formats:R0,defaultWidth:"full"}),dateTime:er({formats:Y0,defaultWidth:"full"})},j0={lastWeek:"'지난' eeee p",yesterday:"'어제' p",today:"'오늘' p",tomorrow:"'내일' p",nextWeek:"'다음' eeee p",other:"P"},H0=(n,r,e,t)=>j0[n],B0={narrow:["BC","AD"],abbreviated:["BC","AD"],wide:["기원전","서기"]},V0={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1분기","2분기","3분기","4분기"]},z0={narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],abbreviated:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],wide:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"]},q0={narrow:["일","월","화","수","목","금","토"],short:["일","월","화","수","목","금","토"],abbreviated:["일","월","화","수","목","금","토"],wide:["일요일","월요일","화요일","수요일","목요일","금요일","토요일"]},U0={narrow:{am:"오전",pm:"오후",midnight:"자정",noon:"정오",morning:"아침",afternoon:"오후",evening:"저녁",night:"밤"},abbreviated:{am:"오전",pm:"오후",midnight:"자정",noon:"정오",morning:"아침",afternoon:"오후",evening:"저녁",night:"밤"},wide:{am:"오전",pm:"오후",midnight:"자정",noon:"정오",morning:"아침",afternoon:"오후",evening:"저녁",night:"밤"}},Q0={narrow:{am:"오전",pm:"오후",midnight:"자정",noon:"정오",morning:"아침",afternoon:"오후",evening:"저녁",night:"밤"},abbreviated:{am:"오전",pm:"오후",midnight:"자정",noon:"정오",morning:"아침",afternoon:"오후",evening:"저녁",night:"밤"},wide:{am:"오전",pm:"오후",midnight:"자정",noon:"정오",morning:"아침",afternoon:"오후",evening:"저녁",night:"밤"}},G0={ordinalNumber:(n,r)=>{const e=Number(n);switch(String(r==null?void 0:r.unit)){case"minute":case"second":return String(e);case"date":return e+"일";default:return e+"번째"}},era:Ot({values:B0,defaultWidth:"wide"}),quarter:Ot({values:V0,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Ot({values:z0,defaultWidth:"wide"}),day:Ot({values:q0,defaultWidth:"wide"}),dayPeriod:Ot({values:U0,defaultWidth:"wide",formattingValues:Q0,defaultFormattingWidth:"wide"})},K0=/^(\d+)(일|번째)?/i,X0=/\d+/i,J0={narrow:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(기원전|서기)/i},Z0={any:[/^(bc|기원전)/i,/^(ad|서기)/i]},ex={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234]사?분기/i},tx={any:[/1/i,/2/i,/3/i,/4/i]},nx={narrow:/^(1[012]|[123456789])/,abbreviated:/^(1[012]|[123456789])월/i,wide:/^(1[012]|[123456789])월/i},rx={any:[/^1월?$/,/^2/,/^3/,/^4/,/^5/,/^6/,/^7/,/^8/,/^9/,/^10/,/^11/,/^12/]},ox={narrow:/^[일월화수목금토]/,short:/^[일월화수목금토]/,abbreviated:/^[일월화수목금토]/,wide:/^[일월화수목금토]요일/},ax={any:[/^일/,/^월/,/^화/,/^수/,/^목/,/^금/,/^토/]},ix={any:/^(am|pm|오전|오후|자정|정오|아침|저녁|밤)/i},sx={any:{am:/^(am|오전)/i,pm:/^(pm|오후)/i,midnight:/^자정/i,noon:/^정오/i,morning:/^아침/i,afternoon:/^오후/i,evening:/^저녁/i,night:/^밤/i}},lx={ordinalNumber:yd({matchPattern:K0,parsePattern:X0,valueCallback:n=>parseInt(n,10)}),era:Mt({matchPatterns:J0,defaultMatchWidth:"wide",parsePatterns:Z0,defaultParseWidth:"any"}),quarter:Mt({matchPatterns:ex,defaultMatchWidth:"wide",parsePatterns:tx,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Mt({matchPatterns:nx,defaultMatchWidth:"wide",parsePatterns:rx,defaultParseWidth:"any"}),day:Mt({matchPatterns:ox,defaultMatchWidth:"wide",parsePatterns:ax,defaultParseWidth:"any"}),dayPeriod:Mt({matchPatterns:ix,defaultMatchWidth:"any",parsePatterns:sx,defaultParseWidth:"any"})},ux={code:"ko",formatDistance:F0,formatLong:W0,formatRelative:H0,localize:G0,match:lx,options:{weekStartsOn:0,firstWeekContainsDate:1}};function cx(){return typeof window<"u"}function Fd(n){var r;return(n==null||(r=n.ownerDocument)==null?void 0:r.defaultView)||window}function zr(n){return cx()?n instanceof Element||n instanceof Fd(n).Element:!1}function dx(n){return Fd(n).getComputedStyle(n)}var oa=typeof document<"u"?d.useLayoutEffect:d.useEffect;const fx={...H}.useInsertionEffect||(n=>n());function px(n){const r=H.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return fx(()=>{r.current=n}),H.useCallback(function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return r.current==null?void 0:r.current(...t)},[])}function Ad(n,r,e){let{reference:t,floating:o}=n;const a=it(r),i=_o(r),s=Co(i),l=ft(r),u=a==="y",c=t.x+t.width/2-o.width/2,f=t.y+t.height/2-o.height/2,h=t[s]/2-o[s]/2;let p;switch(l){case"top":p={x:c,y:t.y-o.height};break;case"bottom":p={x:c,y:t.y+t.height};break;case"right":p={x:t.x+t.width,y:f};break;case"left":p={x:t.x-o.width,y:f};break;default:p={x:t.x,y:t.y}}switch(fn(r)){case"start":p[i]-=h*(e&&u?-1:1);break;case"end":p[i]+=h*(e&&u?-1:1);break}return p}const hx=async(n,r,e)=>{const{placement:t="bottom",strategy:o="absolute",middleware:a=[],platform:i}=e,s=a.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(r));let u=await i.getElementRects({reference:n,floating:r,strategy:o}),{x:c,y:f}=Ad(u,t,l),h=t,p={},m=0;for(let v=0;v<s.length;v++){const{name:g,fn:y}=s[v],{x:E,y:w,data:S,reset:x}=await y({x:c,y:f,initialPlacement:t,placement:h,strategy:o,middlewareData:p,rects:u,platform:i,elements:{reference:n,floating:r}});c=E??c,f=w??f,p={...p,[g]:{...p[g],...S}},x&&m<=50&&(m++,typeof x=="object"&&(x.placement&&(h=x.placement),x.rects&&(u=x.rects===!0?await i.getElementRects({reference:n,floating:r,strategy:o}):x.rects),{x:c,y:f}=Ad(u,h,l)),v=-1)}return{x:c,y:f,placement:h,strategy:o,middlewareData:p}};async function mx(n,r){var e;r===void 0&&(r={});const{x:t,y:o,platform:a,rects:i,elements:s,strategy:l}=n,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=St(r,n),m=Mi(p),g=s[h?f==="floating"?"reference":"floating":f],y=pn(await a.getClippingRect({element:(e=await(a.isElement==null?void 0:a.isElement(g)))==null||e?g:g.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:l})),E=f==="floating"?{x:t,y:o,width:i.floating.width,height:i.floating.height}:i.reference,w=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),S=await(a.isElement==null?void 0:a.isElement(w))?await(a.getScale==null?void 0:a.getScale(w))||{x:1,y:1}:{x:1,y:1},x=pn(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:E,offsetParent:w,strategy:l}):E);return{top:(y.top-x.top+m.top)/S.y,bottom:(x.bottom-y.bottom+m.bottom)/S.y,left:(y.left-x.left+m.left)/S.x,right:(x.right-y.right+m.right)/S.x}}const vx=n=>({name:"arrow",options:n,async fn(r){const{x:e,y:t,placement:o,rects:a,platform:i,elements:s,middlewareData:l}=r,{element:u,padding:c=0}=St(n,r)||{};if(u==null)return{};const f=Mi(c),h={x:e,y:t},p=_o(o),m=Co(p),v=await i.getDimensions(u),g=p==="y",y=g?"top":"left",E=g?"bottom":"right",w=g?"clientHeight":"clientWidth",S=a.reference[m]+a.reference[p]-h[p]-a.floating[m],x=h[p]-a.reference[p],T=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let N=T?T[w]:0;(!N||!await(i.isElement==null?void 0:i.isElement(T)))&&(N=s.floating[w]||a.floating[m]);const _=S/2-x/2,O=N/2-v[m]/2-1,M=dt(f[y],O),L=dt(f[E],O),b=M,k=N-v[m]-L,$=N/2-v[m]/2+_,Y=_i(b,$,k),I=!l.arrow&&fn(o)!=null&&$!==Y&&a.reference[m]/2-($<b?M:L)-v[m]/2<0,V=I?$<b?$-b:$-k:0;return{[p]:h[p]+V,data:{[p]:Y,centerOffset:$-Y-V,...I&&{alignmentOffset:V}},reset:I}}}),gx=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(r){var e,t;const{placement:o,middlewareData:a,rects:i,initialPlacement:s,platform:l,elements:u}=r,{mainAxis:c=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:v=!0,...g}=St(n,r);if((e=a.arrow)!=null&&e.alignmentOffset)return{};const y=ft(o),E=it(s),w=ft(s)===s,S=await(l.isRTL==null?void 0:l.isRTL(u.floating)),x=h||(w||!v?[$r(s)]:Wu(s)),T=m!=="none";!h&&T&&x.push(...Bu(s,v,m,S));const N=[s,...x],_=await mx(r,g),O=[];let M=((t=a.flip)==null?void 0:t.overflows)||[];if(c&&O.push(_[y]),f){const $=Yu(o,i,S);O.push(_[$[0]],_[$[1]])}if(M=[...M,{placement:o,overflows:O}],!O.every($=>$<=0)){var L,b;const $=(((L=a.flip)==null?void 0:L.index)||0)+1,Y=N[$];if(Y)return{data:{index:$,overflows:M},reset:{placement:Y}};let I=(b=M.filter(V=>V.overflows[0]<=0).sort((V,C)=>V.overflows[1]-C.overflows[1])[0])==null?void 0:b.placement;if(!I)switch(p){case"bestFit":{var k;const V=(k=M.filter(C=>{if(T){const q=it(C.placement);return q===E||q==="y"}return!0}).map(C=>[C.placement,C.overflows.filter(q=>q>0).reduce((q,P)=>q+P,0)]).sort((C,q)=>C[1]-q[1])[0])==null?void 0:k[0];V&&(I=V);break}case"initialPlacement":I=s;break}if(o!==I)return{reset:{placement:I}}}return{}}}};async function bx(n,r){const{placement:e,platform:t,elements:o}=n,a=await(t.isRTL==null?void 0:t.isRTL(o.floating)),i=ft(e),s=fn(e),l=it(e)==="y",u=["left","top"].includes(i)?-1:1,c=a&&l?-1:1,f=St(r,n);let{mainAxis:h,crossAxis:p,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return s&&typeof m=="number"&&(p=s==="end"?m*-1:m),l?{x:p*c,y:h*u}:{x:h*u,y:p*c}}const yx=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(r){var e,t;const{x:o,y:a,placement:i,middlewareData:s}=r,l=await bx(r,n);return i===((e=s.offset)==null?void 0:e.placement)&&(t=s.arrow)!=null&&t.alignmentOffset?{}:{x:o+l.x,y:a+l.y,data:{...l,placement:i}}}}};function Rd(n){const r=He(n);let e=parseFloat(r.width)||0,t=parseFloat(r.height)||0;const o=Ge(n),a=o?n.offsetWidth:e,i=o?n.offsetHeight:t,s=qt(e)!==a||qt(t)!==i;return s&&(e=a,t=i),{width:e,height:t,$:s}}function as(n){return Oe(n)?n:n.contextElement}function or(n){const r=as(n);if(!Ge(r))return Be(1);const e=r.getBoundingClientRect(),{width:t,height:o,$:a}=Rd(r);let i=(a?qt(e.width):e.width)/t,s=(a?qt(e.height):e.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!s||!Number.isFinite(s))&&(s=1),{x:i,y:s}}const wx=Be(0);function Yd(n){const r=je(n);return!Ir()||!r.visualViewport?wx:{x:r.visualViewport.offsetLeft,y:r.visualViewport.offsetTop}}function xx(n,r,e){return r===void 0&&(r=!1),!e||r&&e!==je(n)?!1:r}function Nn(n,r,e,t){r===void 0&&(r=!1),e===void 0&&(e=!1);const o=n.getBoundingClientRect(),a=as(n);let i=Be(1);r&&(t?Oe(t)&&(i=or(t)):i=or(n));const s=xx(a,e,t)?Yd(a):Be(0);let l=(o.left+s.x)/i.x,u=(o.top+s.y)/i.y,c=o.width/i.x,f=o.height/i.y;if(a){const h=je(a),p=t&&Oe(t)?je(t):t;let m=h,v=Nr(m);for(;v&&t&&p!==m;){const g=or(v),y=v.getBoundingClientRect(),E=He(v),w=y.left+(v.clientLeft+parseFloat(E.paddingLeft))*g.x,S=y.top+(v.clientTop+parseFloat(E.paddingTop))*g.y;l*=g.x,u*=g.y,c*=g.x,f*=g.y,l+=w,u+=S,m=je(v),v=Nr(m)}}return pn({width:c,height:f,x:l,y:u})}function is(n,r){const e=un(n).scrollLeft;return r?r.left+e:Nn(qe(n)).left+e}function Wd(n,r,e){e===void 0&&(e=!1);const t=n.getBoundingClientRect(),o=t.left+r.scrollLeft-(e?0:is(n,t)),a=t.top+r.scrollTop;return{x:o,y:a}}function Ex(n){let{elements:r,rect:e,offsetParent:t,strategy:o}=n;const a=o==="fixed",i=qe(t),s=r?Sn(r.floating):!1;if(t===i||s&&a)return e;let l={scrollLeft:0,scrollTop:0},u=Be(1);const c=Be(0),f=Ge(t);if((f||!f&&!a)&&((zt(t)!=="body"||ln(i))&&(l=un(t)),Ge(t))){const p=Nn(t);u=or(t),c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}const h=i&&!f&&!a?Wd(i,l,!0):Be(0);return{width:e.width*u.x,height:e.height*u.y,x:e.x*u.x-l.scrollLeft*u.x+c.x+h.x,y:e.y*u.y-l.scrollTop*u.y+c.y+h.y}}function Dx(n){return Array.from(n.getClientRects())}function Sx(n){const r=qe(n),e=un(n),t=n.ownerDocument.body,o=Ne(r.scrollWidth,r.clientWidth,t.scrollWidth,t.clientWidth),a=Ne(r.scrollHeight,r.clientHeight,t.scrollHeight,t.clientHeight);let i=-e.scrollLeft+is(n);const s=-e.scrollTop;return He(t).direction==="rtl"&&(i+=Ne(r.clientWidth,t.clientWidth)-o),{width:o,height:a,x:i,y:s}}function kx(n,r){const e=je(n),t=qe(n),o=e.visualViewport;let a=t.clientWidth,i=t.clientHeight,s=0,l=0;if(o){a=o.width,i=o.height;const u=Ir();(!u||u&&r==="fixed")&&(s=o.offsetLeft,l=o.offsetTop)}return{width:a,height:i,x:s,y:l}}function Cx(n,r){const e=Nn(n,!0,r==="fixed"),t=e.top+n.clientTop,o=e.left+n.clientLeft,a=Ge(n)?or(n):Be(1),i=n.clientWidth*a.x,s=n.clientHeight*a.y,l=o*a.x,u=t*a.y;return{width:i,height:s,x:l,y:u}}function jd(n,r,e){let t;if(r==="viewport")t=kx(n,e);else if(r==="document")t=Sx(qe(n));else if(Oe(r))t=Cx(r,e);else{const o=Yd(n);t={x:r.x-o.x,y:r.y-o.y,width:r.width,height:r.height}}return pn(t)}function Hd(n,r){const e=at(n);return e===r||!Oe(e)||Dt(e)?!1:He(e).position==="fixed"||Hd(e,r)}function _x(n,r){const e=r.get(n);if(e)return e;let t=cn(n,[],!1).filter(s=>Oe(s)&&zt(s)!=="body"),o=null;const a=He(n).position==="fixed";let i=a?at(n):n;for(;Oe(i)&&!Dt(i);){const s=He(i),l=Pr(i);!l&&s.position==="fixed"&&(o=null),(a?!l&&!o:!l&&s.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||ln(i)&&!l&&Hd(n,i))?t=t.filter(c=>c!==i):o=s,i=at(i)}return r.set(n,t),t}function Ox(n){let{element:r,boundary:e,rootBoundary:t,strategy:o}=n;const i=[...e==="clippingAncestors"?Sn(r)?[]:_x(r,this._c):[].concat(e),t],s=i[0],l=i.reduce((u,c)=>{const f=jd(r,c,o);return u.top=Ne(f.top,u.top),u.right=dt(f.right,u.right),u.bottom=dt(f.bottom,u.bottom),u.left=Ne(f.left,u.left),u},jd(r,s,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Mx(n){const{width:r,height:e}=Rd(n);return{width:r,height:e}}function Tx(n,r,e){const t=Ge(r),o=qe(r),a=e==="fixed",i=Nn(n,!0,a,r);let s={scrollLeft:0,scrollTop:0};const l=Be(0);if(t||!t&&!a)if((zt(r)!=="body"||ln(o))&&(s=un(r)),t){const h=Nn(r,!0,a,r);l.x=h.x+r.clientLeft,l.y=h.y+r.clientTop}else o&&(l.x=is(o));const u=o&&!t&&!a?Wd(o,s):Be(0),c=i.left+s.scrollLeft-l.x-u.x,f=i.top+s.scrollTop-l.y-u.y;return{x:c,y:f,width:i.width,height:i.height}}function ss(n){return He(n).position==="static"}function Bd(n,r){if(!Ge(n)||He(n).position==="fixed")return null;if(r)return r(n);let e=n.offsetParent;return qe(n)===e&&(e=e.ownerDocument.body),e}function Vd(n,r){const e=je(n);if(Sn(n))return e;if(!Ge(n)){let o=at(n);for(;o&&!Dt(o);){if(Oe(o)&&!ss(o))return o;o=at(o)}return e}let t=Bd(n,r);for(;t&&Lu(t)&&ss(t);)t=Bd(t,r);return t&&Dt(t)&&ss(t)&&!Pr(t)?e:t||Fu(n)||e}const Px=async function(n){const r=this.getOffsetParent||Vd,e=this.getDimensions,t=await e(n.floating);return{reference:Tx(n.reference,await r(n.floating),n.strategy),floating:{x:0,y:0,width:t.width,height:t.height}}};function Ix(n){return He(n).direction==="rtl"}const Nx={convertOffsetParentRelativeRectToViewportRelativeRect:Ex,getDocumentElement:qe,getClippingRect:Ox,getOffsetParent:Vd,getElementRects:Px,getClientRects:Dx,getDimensions:Mx,getScale:or,isElement:Oe,isRTL:Ix};function zd(n,r){return n.x===r.x&&n.y===r.y&&n.width===r.width&&n.height===r.height}function $x(n,r){let e=null,t;const o=qe(n);function a(){var s;clearTimeout(t),(s=e)==null||s.disconnect(),e=null}function i(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),a();const u=n.getBoundingClientRect(),{left:c,top:f,width:h,height:p}=u;if(s||r(),!h||!p)return;const m=dn(f),v=dn(o.clientWidth-(c+h)),g=dn(o.clientHeight-(f+p)),y=dn(c),w={rootMargin:-m+"px "+-v+"px "+-g+"px "+-y+"px",threshold:Ne(0,dt(1,l))||1};let S=!0;function x(T){const N=T[0].intersectionRatio;if(N!==l){if(!S)return i();N?i(!1,N):t=setTimeout(()=>{i(!1,1e-7)},1e3)}N===1&&!zd(u,n.getBoundingClientRect())&&i(),S=!1}try{e=new IntersectionObserver(x,{...w,root:o.ownerDocument})}catch{e=new IntersectionObserver(x,w)}e.observe(n)}return i(!0),a}function Lx(n,r,e,t){t===void 0&&(t={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=t,u=as(n),c=o||a?[...u?cn(u):[],...cn(r)]:[];c.forEach(y=>{o&&y.addEventListener("scroll",e,{passive:!0}),a&&y.addEventListener("resize",e)});const f=u&&s?$x(u,e):null;let h=-1,p=null;i&&(p=new ResizeObserver(y=>{let[E]=y;E&&E.target===u&&p&&(p.unobserve(r),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=p)==null||w.observe(r)})),e()}),u&&!l&&p.observe(u),p.observe(r));let m,v=l?Nn(n):null;l&&g();function g(){const y=Nn(n);v&&!zd(v,y)&&e(),v=y,m=requestAnimationFrame(g)}return e(),()=>{var y;c.forEach(E=>{o&&E.removeEventListener("scroll",e),a&&E.removeEventListener("resize",e)}),f==null||f(),(y=p)==null||y.disconnect(),p=null,l&&cancelAnimationFrame(m)}}const Fx=yx,Ax=gx,qd=vx,Rx=(n,r,e)=>{const t=new Map,o={platform:Nx,...e},a={...o.platform,_c:t};return hx(n,r,{...o,platform:a})};var aa=typeof document<"u"?d.useLayoutEffect:d.useEffect;function ia(n,r){if(n===r)return!0;if(typeof n!=typeof r)return!1;if(typeof n=="function"&&n.toString()===r.toString())return!0;let e,t,o;if(n&&r&&typeof n=="object"){if(Array.isArray(n)){if(e=n.length,e!==r.length)return!1;for(t=e;t--!==0;)if(!ia(n[t],r[t]))return!1;return!0}if(o=Object.keys(n),e=o.length,e!==Object.keys(r).length)return!1;for(t=e;t--!==0;)if(!{}.hasOwnProperty.call(r,o[t]))return!1;for(t=e;t--!==0;){const a=o[t];if(!(a==="_owner"&&n.$$typeof)&&!ia(n[a],r[a]))return!1}return!0}return n!==n&&r!==r}function Ud(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function Qd(n,r){const e=Ud(n);return Math.round(r*e)/e}function ls(n){const r=H.useRef(n);return aa(()=>{r.current=n}),r}function Yx(n){n===void 0&&(n={});const{placement:r="bottom",strategy:e="absolute",middleware:t=[],platform:o,elements:{reference:a,floating:i}={},transform:s=!0,whileElementsMounted:l,open:u}=n,[c,f]=H.useState({x:0,y:0,strategy:e,placement:r,middlewareData:{},isPositioned:!1}),[h,p]=H.useState(t);ia(h,t)||p(t);const[m,v]=H.useState(null),[g,y]=H.useState(null),E=H.useCallback(C=>{C!==T.current&&(T.current=C,v(C))},[]),w=H.useCallback(C=>{C!==N.current&&(N.current=C,y(C))},[]),S=a||m,x=i||g,T=H.useRef(null),N=H.useRef(null),_=H.useRef(c),O=l!=null,M=ls(l),L=ls(o),b=ls(u),k=H.useCallback(()=>{if(!T.current||!N.current)return;const C={placement:r,strategy:e,middleware:h};L.current&&(C.platform=L.current),Rx(T.current,N.current,C).then(q=>{const P={...q,isPositioned:b.current!==!1};$.current&&!ia(_.current,P)&&(_.current=P,cr.flushSync(()=>{f(P)}))})},[h,r,e,L,b]);aa(()=>{u===!1&&_.current.isPositioned&&(_.current.isPositioned=!1,f(C=>({...C,isPositioned:!1})))},[u]);const $=H.useRef(!1);aa(()=>($.current=!0,()=>{$.current=!1}),[]),aa(()=>{if(S&&(T.current=S),x&&(N.current=x),S&&x){if(M.current)return M.current(S,x,k);k()}},[S,x,k,M,O]);const Y=H.useMemo(()=>({reference:T,floating:N,setReference:E,setFloating:w}),[E,w]),I=H.useMemo(()=>({reference:S,floating:x}),[S,x]),V=H.useMemo(()=>{const C={position:e,left:0,top:0};if(!I.floating)return C;const q=Qd(I.floating,c.x),P=Qd(I.floating,c.y);return s?{...C,transform:"translate("+q+"px, "+P+"px)",...Ud(I.floating)>=1.5&&{willChange:"transform"}}:{position:e,left:q,top:P}},[e,s,I.floating,c.x,c.y]);return H.useMemo(()=>({...c,update:k,refs:Y,elements:I,floatingStyles:V}),[c,k,Y,I,V])}const Wx=n=>{function r(e){return{}.hasOwnProperty.call(e,"current")}return{name:"arrow",options:n,fn(e){const{element:t,padding:o}=typeof n=="function"?n(e):n;return t&&r(t)?t.current!=null?qd({element:t.current,padding:o}).fn(e):{}:t?qd({element:t,padding:o}).fn(e):{}}}},jx=(n,r)=>({...Fx(n),options:[n,r]}),Hx=(n,r)=>({...Ax(n),options:[n,r]}),Bx=(n,r)=>({...Wx(n),options:[n,r]}),Vx={...H};let Gd=!1,zx=0;const Kd=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+zx++;function qx(){const[n,r]=H.useState(()=>Gd?Kd():void 0);return oa(()=>{n==null&&r(Kd())},[]),H.useEffect(()=>{Gd=!0},[]),n}const Xd=Vx.useId||qx;let qr;process.env.NODE_ENV!=="production"&&(qr=new Set);function Ux(){for(var n,r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];const o="Floating UI: "+e.join(" ");if(!((n=qr)!=null&&n.has(o))){var a;(a=qr)==null||a.add(o),console.warn(o)}}function Qx(){for(var n,r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];const o="Floating UI: "+e.join(" ");if(!((n=qr)!=null&&n.has(o))){var a;(a=qr)==null||a.add(o),console.error(o)}}const Gx=H.forwardRef(function(r,e){const{context:{placement:t,elements:{floating:o},middlewareData:{arrow:a,shift:i}},width:s=14,height:l=7,tipRadius:u=0,strokeWidth:c=0,staticOffset:f,stroke:h,d:p,style:{transform:m,...v}={},...g}=r;process.env.NODE_ENV!=="production"&&(e||Ux("The `ref` prop is required for `FloatingArrow`."));const y=Xd(),[E,w]=H.useState(!1);if(oa(()=>{if(!o)return;dx(o).direction==="rtl"&&w(!0)},[o]),!o)return null;const[S,x]=t.split("-"),T=S==="top"||S==="bottom";let N=f;(T&&i!=null&&i.x||!T&&i!=null&&i.y)&&(N=null);const _=c*2,O=_/2,M=s/2*(u/-8+1),L=l/2*u/4,b=!!p,k=N&&x==="end"?"bottom":"top";let $=N&&x==="end"?"right":"left";N&&E&&($=x==="end"?"left":"right");const Y=(a==null?void 0:a.x)!=null?N||a.x:"",I=(a==null?void 0:a.y)!=null?N||a.y:"",V=p||"M0,0"+(" H"+s)+(" L"+(s-M)+","+(l-L))+(" Q"+s/2+","+l+" "+M+","+(l-L))+" Z",C={top:b?"rotate(180deg)":"",left:b?"rotate(90deg)":"rotate(-90deg)",bottom:b?"":"rotate(180deg)",right:b?"rotate(-90deg)":"rotate(90deg)"}[S];return R.jsxs("svg",{...g,"aria-hidden":!0,ref:e,width:b?s:s+_,height:s,viewBox:"0 0 "+s+" "+(l>s?l:s),style:{position:"absolute",pointerEvents:"none",[$]:Y,[k]:I,[S]:T||b?"100%":"calc(100% - "+_/2+"px)",transform:[C,m].filter(q=>!!q).join(" "),...v},children:[_>0&&R.jsx("path",{clipPath:"url(#"+y+")",fill:"none",stroke:h,strokeWidth:_+(p?0:1),d:V}),R.jsx("path",{stroke:_&&!p?g.fill:"none",d:V}),R.jsx("clipPath",{id:y,children:R.jsx("rect",{x:-O,y:O*(b?-1:1),width:s+_,height:s})})]})});function Kx(){const n=new Map;return{emit(r,e){var t;(t=n.get(r))==null||t.forEach(o=>o(e))},on(r,e){n.has(r)||n.set(r,new Set),n.get(r).add(e)},off(r,e){var t;(t=n.get(r))==null||t.delete(e)}}}const Xx=H.createContext(null),Jx=H.createContext(null),Zx=()=>{var n;return((n=H.useContext(Xx))==null?void 0:n.id)||null},eE=()=>H.useContext(Jx);function tE(n){const{open:r=!1,onOpenChange:e,elements:t}=n,o=Xd(),a=H.useRef({}),[i]=H.useState(()=>Kx()),s=Zx()!=null;if(process.env.NODE_ENV!=="production"){const p=t.reference;p&&!zr(p)&&Qx("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,u]=H.useState(t.reference),c=px((p,m,v)=>{a.current.openEvent=p?m:void 0,i.emit("openchange",{open:p,event:m,reason:v,nested:s}),e==null||e(p,m,v)}),f=H.useMemo(()=>({setPositionReference:u}),[]),h=H.useMemo(()=>({reference:l||t.reference||null,floating:t.floating||null,domReference:t.reference}),[l,t.reference,t.floating]);return H.useMemo(()=>({dataRef:a,open:r,onOpenChange:c,elements:h,events:i,floatingId:o,refs:f}),[r,c,h,i,o,f])}function nE(n){n===void 0&&(n={});const{nodeId:r}=n,e=tE({...n,elements:{reference:null,floating:null,...n.elements}}),t=n.rootContext||e,o=t.elements,[a,i]=H.useState(null),[s,l]=H.useState(null),c=(o==null?void 0:o.domReference)||a,f=H.useRef(null),h=eE();oa(()=>{c&&(f.current=c)},[c]);const p=Yx({...n,elements:{...o,...s&&{reference:s}}}),m=H.useCallback(w=>{const S=zr(w)?{getBoundingClientRect:()=>w.getBoundingClientRect(),getClientRects:()=>w.getClientRects(),contextElement:w}:w;l(S),p.refs.setReference(S)},[p.refs]),v=H.useCallback(w=>{(zr(w)||w===null)&&(f.current=w,i(w)),(zr(p.refs.reference.current)||p.refs.reference.current===null||w!==null&&!zr(w))&&p.refs.setReference(w)},[p.refs]),g=H.useMemo(()=>({...p.refs,setReference:v,setPositionReference:m,domReference:f}),[p.refs,v,m]),y=H.useMemo(()=>({...p.elements,domReference:c}),[p.elements,c]),E=H.useMemo(()=>({...p,...t,refs:g,elements:y,nodeId:r}),[p,g,y,r,t]);return oa(()=>{t.dataRef.current.floatingContext=E;const w=h==null?void 0:h.nodesRef.current.find(S=>S.id===r);w&&(w.context=E)}),H.useMemo(()=>({...p,context:E,refs:g,elements:y}),[p,g,y,E])}/*!
77
77
  react-datepicker v8.4.0
78
78
  https://github.com/Hacker0x01/react-datepicker
79
79
  Released under the MIT License.