"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6836],{78026:function(e,t,n){let o,i,r,l;n.d(t,{h:function(){return ev}});var a=n(2265),s=n(54887);function u(e,t,n){let o,i=n.initialDeps??[];return()=>{var r,l,a,s;let u,c;n.key&&(null==(r=n.debug)?void 0:r.call(n))&&(u=Date.now());let d=e();if(!(d.length!==i.length||d.some((e,t)=>i[t]!==e)))return o;if(i=d,n.key&&(null==(l=n.debug)?void 0:l.call(n))&&(c=Date.now()),o=t(...d),n.key&&(null==(a=n.debug)?void 0:a.call(n))){let e=Math.round((Date.now()-u)*100)/100,t=Math.round((Date.now()-c)*100)/100,o=t/16,i=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${i(t,5)} /${i(e,5)} ms`,`
            font-size: .6rem;
            font-weight: bold;
            color: hsl(${Math.max(0,Math.min(120-120*o,120))}deg 100% 31%);`,null==n?void 0:n.key)}return null==(s=null==n?void 0:n.onChange)||s.call(n,o),o}}function c(e,t){if(void 0!==e)return e;throw Error(`Unexpected undefined${t?`: ${t}`:""}`)}let d=(e,t)=>1>Math.abs(e-t),p=(e,t)=>{let n;return function(...o){clearTimeout(n),n=setTimeout(()=>e.apply(this,o),t)}},f=e=>e,v=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),o=[];for(let e=t;e<=n;e++)o.push(e);return o},b=(e,t)=>{let n=e.scrollElement;if(!n)return;let o=e=>{let{width:n,height:o}=e;t({width:Math.round(n),height:Math.round(o)})};if(o(n.getBoundingClientRect()),"undefined"==typeof ResizeObserver)return()=>{};let i=new ResizeObserver(e=>{let t=e[0];if(null==t?void 0:t.borderBoxSize){let e=t.borderBoxSize[0];if(e){o({width:e.inlineSize,height:e.blockSize});return}}o(n.getBoundingClientRect())});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},h={passive:!0},m="undefined"==typeof window||"onscrollend"in window,g=(e,t)=>{let n=e.scrollElement;if(!n)return;let o=0,i=m?()=>void 0:p(()=>{t(o,!1)},e.options.isScrollingResetDelay),r=r=>()=>{o=n[e.options.horizontal?"scrollLeft":"scrollTop"],i(),t(o,r)},l=r(!0),a=r(!1);return a(),n.addEventListener("scroll",l,h),n.addEventListener("scrollend",a,h),()=>{n.removeEventListener("scroll",l),n.removeEventListener("scrollend",a)}},x=(e,t,n)=>{if(null==t?void 0:t.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?"inlineSize":"blockSize"])}return Math.round(e.getBoundingClientRect()[n.options.horizontal?"width":"height"])},R=(e,{adjustments:t=0,behavior:n},o)=>{var i,r;null==(r=null==(i=o.scrollElement)?void 0:i.scrollTo)||r.call(i,{[o.options.horizontal?"left":"top"]:e+t,behavior:n})};class O{constructor(e){this.unsubs=[],this.scrollElement=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollDirection=null,this.scrollAdjustments=0,this.measureElementCache=new Map,this.observer=(()=>{let e=null,t=()=>e||("undefined"!=typeof ResizeObserver?e=new ResizeObserver(e=>{e.forEach(e=>{this._measureElement(e.target,e)})}):null);return{disconnect:()=>{var e;return null==(e=t())?void 0:e.disconnect()},observe:e=>{var n;return null==(n=t())?void 0:n.observe(e,{box:"border-box"})},unobserve:e=>{var n;return null==(n=t())?void 0:n.unobserve(e)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([t,n])=>{void 0===n&&delete e[t]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:f,rangeExtractor:v,onChange:()=>{},measureElement:x,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,...e}},this.notify=(e,t)=>{var n,o;let{startIndex:i,endIndex:r}=this.range??{startIndex:void 0,endIndex:void 0},l=this.calculateRange();(e||i!==(null==l?void 0:l.startIndex)||r!==(null==l?void 0:l.endIndex))&&(null==(o=(n=this.options).onChange)||o.call(n,this,t))},this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.scrollElement=null},this._didMount=()=>(this.measureElementCache.forEach(this.observer.observe),()=>{this.observer.disconnect(),this.cleanup()}),this._willUpdate=()=>{let e=this.options.getScrollElement();this.scrollElement!==e&&(this.cleanup(),this.scrollElement=e,this._scrollToOffset(this.scrollOffset,{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.notify(!1,!1)})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.scrollOffset<e?"forward":"backward":null,this.scrollOffset=e;let n=this.isScrolling;this.isScrolling=t,this.notify(n!==t,t)})))},this.getSize=()=>this.scrollRect[this.options.horizontal?"width":"height"],this.getMeasurementOptions=u(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey],(e,t,n,o)=>(this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:n,getItemKey:o}),{key:!1}),this.getFurthestMeasurement=(e,t)=>{let n=new Map,o=new Map;for(let i=t-1;i>=0;i--){let t=e[i];if(n.has(t.lane))continue;let r=o.get(t.lane);if(null==r||t.end>r.end?o.set(t.lane,t):t.end<r.end&&n.set(t.lane,!0),n.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurements=u(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:t,scrollMargin:n,getItemKey:o},i)=>{let r=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];let l=this.measurementsCache.slice(0,r);for(let a=r;a<e;a++){let e=o(a),r=1===this.options.lanes?l[a-1]:this.getFurthestMeasurement(l,a),s=r?r.end+this.options.gap:t+n,u=i.get(e),c="number"==typeof u?u:this.options.estimateSize(a),d=s+c,p=r?r.lane:a%this.options.lanes;l[a]={index:a,start:s,size:c,end:d,key:e,lane:p}}return this.measurementsCache=l,l},{key:!1,debug:()=>this.options.debug}),this.calculateRange=u(()=>[this.getMeasurements(),this.getSize(),this.scrollOffset],(e,t,n)=>this.range=e.length>0&&t>0?function({measurements:e,outerSize:t,scrollOffset:n}){let o=e.length-1,i=S(0,o,t=>e[t].start,n),r=i;for(;r<o&&e[r].end<n+t;)r++;return{startIndex:i,endIndex:r}}({measurements:e,outerSize:t,scrollOffset:n}):null,{key:!1,debug:()=>this.options.debug}),this.getIndexes=u(()=>[this.options.rangeExtractor,this.calculateRange(),this.options.overscan,this.options.count],(e,t,n,o)=>null===t?[]:e({startIndex:t.startIndex,endIndex:t.endIndex,overscan:n,count:o}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this._measureElement=(e,t)=>{let n=this.measurementsCache[this.indexFromElement(e)];if(!n||!e.isConnected){this.measureElementCache.forEach((t,n)=>{t===e&&(this.observer.unobserve(e),this.measureElementCache.delete(n))});return}let o=this.measureElementCache.get(n.key);o!==e&&(o&&this.observer.unobserve(o),this.observer.observe(e),this.measureElementCache.set(n.key,e));let i=this.options.measureElement(e,t,this);this.resizeItem(n,i)},this.resizeItem=(e,t)=>{let n=t-(this.itemSizeCache.get(e.key)??e.size);0!==n&&((void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(e,n,this):e.start<this.scrollOffset+this.scrollAdjustments)&&this._scrollToOffset(this.scrollOffset,{adjustments:this.scrollAdjustments+=n,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(e.index),this.itemSizeCache=new Map(this.itemSizeCache.set(e.key,t)),this.notify(!0,!1))},this.measureElement=e=>{e&&this._measureElement(e,void 0)},this.getVirtualItems=u(()=>[this.getIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let o=0,i=e.length;o<i;o++){let i=t[e[o]];n.push(i)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();return c(t[S(0,t.length-1,e=>c(t[e]).start,e)])},this.getOffsetForAlignment=(e,t)=>{let n=this.getSize();"auto"===t&&(t=e<=this.scrollOffset?"start":e>=this.scrollOffset+n?"end":"start"),"start"===t||("end"===t?e-=n:"center"===t&&(e-=n/2));let o=this.options.horizontal?"scrollWidth":"scrollHeight";return Math.max(Math.min((this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[o]:this.scrollElement[o]:0)-this.getSize(),e),0)},this.getOffsetForIndex=(e,t="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=c(this.getMeasurements()[e]);if("auto"===t){if(n.end>=this.scrollOffset+this.getSize()-this.options.scrollPaddingEnd)t="end";else{if(!(n.start<=this.scrollOffset+this.options.scrollPaddingStart))return[this.scrollOffset,t];t="start"}}let o="end"===t?n.end+this.options.scrollPaddingEnd:n.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(o,t),t]},this.isDynamicMode=()=>this.measureElementCache.size>0,this.cancelScrollToIndex=()=>{null!==this.scrollToIndexTimeoutId&&(clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(e,{align:t="start",behavior:n}={})=>{this.cancelScrollToIndex(),"smooth"===n&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(e,t),{adjustments:void 0,behavior:n})},this.scrollToIndex=(e,{align:t="auto",behavior:n}={})=>{e=Math.max(0,Math.min(e,this.options.count-1)),this.cancelScrollToIndex(),"smooth"===n&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");let[o,i]=this.getOffsetForIndex(e,t);this._scrollToOffset(o,{adjustments:void 0,behavior:n}),"smooth"!==n&&this.isDynamicMode()&&(this.scrollToIndexTimeoutId=setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.measureElementCache.has(this.options.getItemKey(e))){let[t]=this.getOffsetForIndex(e,i);d(t,this.scrollOffset)||this.scrollToIndex(e,{align:i,behavior:n})}else this.scrollToIndex(e,{align:i,behavior:n})}))},this.scrollBy=(e,{behavior:t}={})=>{this.cancelScrollToIndex(),"smooth"===t&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.scrollOffset+e,{adjustments:void 0,behavior:t})},this.getTotalSize=()=>{var e;let t=this.getMeasurements();return(0===t.length?this.options.paddingStart:1===this.options.lanes?(null==(e=t[t.length-1])?void 0:e.end)??0:Math.max(...t.slice(-this.options.lanes).map(e=>e.end)))-this.options.scrollMargin+this.options.paddingEnd},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{var e,t;this.itemSizeCache=new Map,null==(t=(e=this.options).onChange)||t.call(e,this,!1)},this.setOptions(e),this.scrollRect=this.options.initialRect,this.scrollOffset="function"==typeof this.options.initialOffset?this.options.initialOffset():this.options.initialOffset,this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}),this.notify(!1,!1)}}let S=(e,t,n,o)=>{for(;e<=t;){let i=(e+t)/2|0,r=n(i);if(r<o)e=i+1;else{if(!(r>o))return i;t=i-1}}return e>0?e-1:0},T="undefined"!=typeof document?a.useLayoutEffect:a.useEffect;var I=n(36892),y=n(93169),E=n(99299),C=n(6584),M=n(72955),z=n(61463),w=n(88703),P=n(39110),D=n(62707),L=n(75180),k=n(41469),F=n(32633),A=n(35531),_=n(22270),N=n(89080),B=n(53509),V=n(47359),j=n(47986),U=n(1494),q=n(70777),Z=n(19309),Y=n(69331),K=n(5583),G=n(31555),Q=n(3600),H=n(7551),$=n(20357),J=((o=J||{})[o.Open=0]="Open",o[o.Closed=1]="Closed",o),W=((i=W||{})[i.Single=0]="Single",i[i.Multi=1]="Multi",i),X=((r=X||{})[r.Pointer=0]="Pointer",r[r.Focus=1]="Focus",r[r.Other=2]="Other",r),ee=((l=ee||{})[l.OpenCombobox=0]="OpenCombobox",l[l.CloseCombobox=1]="CloseCombobox",l[l.GoToOption=2]="GoToOption",l[l.RegisterOption=3]="RegisterOption",l[l.UnregisterOption=4]="UnregisterOption",l[l.RegisterLabel=5]="RegisterLabel",l[l.SetActivationTrigger=6]="SetActivationTrigger",l[l.UpdateVirtualOptions=7]="UpdateVirtualOptions",l);function et(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e=>e,n=null!==e.activeOptionIndex?e.options[e.activeOptionIndex]:null,o=t(e.options.slice()),i=o.length>0&&null!==o[0].dataRef.current.order?o.sort((e,t)=>e.dataRef.current.order-t.dataRef.current.order):(0,Z.z2)(o,e=>e.dataRef.current.domRef.current),r=n?i.indexOf(n):null;return -1===r&&(r=null),{options:i,activeOptionIndex:r}}let en={1(e){var t;return null!=(t=e.dataRef.current)&&t.disabled||1===e.comboboxState?e:{...e,activeOptionIndex:null,comboboxState:1}},0(e){var t,n;if(null!=(t=e.dataRef.current)&&t.disabled||0===e.comboboxState)return e;if(null!=(n=e.dataRef.current)&&n.value){let t=e.dataRef.current.calculateIndex(e.dataRef.current.value);if(-1!==t)return{...e,activeOptionIndex:t,comboboxState:0}}return{...e,comboboxState:0}},2(e,t){var n,o,i,r,l;if(null!=(n=e.dataRef.current)&&n.disabled||null!=(o=e.dataRef.current)&&o.optionsRef.current&&!(null!=(i=e.dataRef.current)&&i.optionsPropsRef.current.static)&&1===e.comboboxState)return e;if(e.virtual){let n=t.focus===U.T.Specific?t.idx:(0,U.d)(t,{resolveItems:()=>e.virtual.options,resolveActiveIndex:()=>{var t,n;return null!=(n=null!=(t=e.activeOptionIndex)?t:e.virtual.options.findIndex(t=>!e.virtual.disabled(t)))?n:null},resolveDisabled:e.virtual.disabled,resolveId(){throw Error("Function not implemented.")}}),o=null!=(r=t.trigger)?r:2;return e.activeOptionIndex===n&&e.activationTrigger===o?e:{...e,activeOptionIndex:n,activationTrigger:o}}let a=et(e);if(null===a.activeOptionIndex){let e=a.options.findIndex(e=>!e.dataRef.current.disabled);-1!==e&&(a.activeOptionIndex=e)}let s=t.focus===U.T.Specific?t.idx:(0,U.d)(t,{resolveItems:()=>a.options,resolveActiveIndex:()=>a.activeOptionIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled}),u=null!=(l=t.trigger)?l:2;return e.activeOptionIndex===s&&e.activationTrigger===u?e:{...e,...a,activeOptionIndex:s,activationTrigger:u}},3:(e,t)=>{var n,o,i;if(null!=(n=e.dataRef.current)&&n.virtual)return{...e,options:[...e.options,t.payload]};let r=t.payload,l=et(e,e=>(e.push(r),e));null===e.activeOptionIndex&&null!=(o=e.dataRef.current)&&o.isSelected(t.payload.dataRef.current.value)&&(l.activeOptionIndex=l.options.indexOf(r));let a={...e,...l,activationTrigger:2};return null!=(i=e.dataRef.current)&&i.__demoMode&&void 0===e.dataRef.current.value&&(a.activeOptionIndex=0),a},4:(e,t)=>{var n;if(null!=(n=e.dataRef.current)&&n.virtual)return{...e,options:e.options.filter(e=>e.id!==t.id)};let o=et(e,e=>{let n=e.findIndex(e=>e.id===t.id);return -1!==n&&e.splice(n,1),e});return{...e,...o,activationTrigger:2}},5:(e,t)=>e.labelId===t.id?e:{...e,labelId:t.id},6:(e,t)=>e.activationTrigger===t.trigger?e:{...e,activationTrigger:t.trigger},7:(e,t)=>{var n;if((null==(n=e.virtual)?void 0:n.options)===t.options)return e;let o=e.activeOptionIndex;if(null!==e.activeOptionIndex){let n=t.options.indexOf(e.virtual.options[e.activeOptionIndex]);o=-1!==n?n:null}return{...e,activeOptionIndex:o,virtual:Object.assign({},e.virtual,{options:t.options})}}},eo=(0,a.createContext)(null);function ei(e){let t=(0,a.useContext)(eo);if(null===t){let t=Error("<".concat(e," /> is missing a parent <Combobox /> component."));throw Error.captureStackTrace&&Error.captureStackTrace(t,ei),t}return t}eo.displayName="ComboboxActionsContext";let er=(0,a.createContext)(null);function el(e){var t;let n=es("VirtualProvider"),[o,i]=(0,a.useMemo)(()=>{let e=n.optionsRef.current;if(!e)return[0,0];let t=window.getComputedStyle(e);return[parseFloat(t.paddingBlockStart||t.paddingTop),parseFloat(t.paddingBlockEnd||t.paddingBottom)]},[n.optionsRef.current]),r=function(e){let t=a.useReducer(()=>({}),{})[1],n={...e,onChange:(n,o)=>{var i;o?(0,s.flushSync)(t):t(),null==(i=e.onChange)||i.call(e,n,o)}},[o]=a.useState(()=>new O(n));return o.setOptions(n),a.useEffect(()=>o._didMount(),[]),T(()=>o._willUpdate()),o}({observeElementRect:b,observeElementOffset:g,scrollToFn:R,scrollPaddingStart:o,scrollPaddingEnd:i,count:n.virtual.options.length,estimateSize:()=>40,getScrollElement(){var e;return null!=(e=n.optionsRef.current)?e:null},overscan:12}),[l,u]=(0,a.useState)(0);return(0,z.e)(()=>{u(e=>e+1)},[null==(t=n.virtual)?void 0:t.options]),a.createElement(er.Provider,{value:r},a.createElement("div",{style:{position:"relative",width:"100%",height:"".concat(r.getTotalSize(),"px")},ref:e=>{e&&(void 0===$||void 0===$.env.JEST_WORKER_ID)&&0!==n.activationTrigger&&null!==n.activeOptionIndex&&n.virtual.options.length>n.activeOptionIndex&&r.scrollToIndex(n.activeOptionIndex)}},r.getVirtualItems().map(t=>{var o;return a.createElement(a.Fragment,{key:t.key},a.cloneElement(null==(o=e.children)?void 0:o.call(e,{option:n.virtual.options[t.index],open:0===n.comboboxState}),{key:"".concat(l,"-").concat(t.key),"data-index":t.index,"aria-setsize":n.virtual.options.length,"aria-posinset":t.index+1,style:{position:"absolute",top:0,left:0,transform:"translateY(".concat(t.start,"px)"),overflowAnchor:"none"}}))})))}let ea=(0,a.createContext)(null);function es(e){let t=(0,a.useContext)(ea);if(null===t){let t=Error("<".concat(e," /> is missing a parent <Combobox /> component."));throw Error.captureStackTrace&&Error.captureStackTrace(t,es),t}return t}function eu(e,t){return(0,K.E)(t.type,en,e,t)}ea.displayName="ComboboxDataContext";let ec=a.Fragment,ed=Q.AN.RenderStrategy|Q.AN.Static,ep=(0,Q.yV)(function(e,t){let{value:n,defaultValue:o,onChange:i,form:r,name:l,by:s=null,disabled:u=!1,__demoMode:c=!1,nullable:d=!1,multiple:p=!1,immediate:f=!1,virtual:v=null,...b}=e,[h=p?[]:void 0,m]=(0,y.q)(n,i,o),[g,x]=(0,a.useReducer)(eu,{dataRef:(0,a.createRef)(),comboboxState:c?0:1,options:[],virtual:null,activeOptionIndex:null,activationTrigger:2,labelId:null}),R=(0,a.useRef)(!1),O=(0,a.useRef)({static:!1,hold:!1}),S=(0,a.useRef)(null),T=(0,a.useRef)(null),I=(0,a.useRef)(null),M=(0,a.useRef)(null),w=(0,C.z)("string"==typeof s?(e,t)=>(null==e?void 0:e[s])===(null==t?void 0:t[s]):null!=s?s:(e,t)=>e===t),D=(0,C.z)(e=>g.options.findIndex(t=>w(t.dataRef.current.value,e))),L=(0,a.useCallback)(e=>(0,K.E)(F.mode,{1:()=>h.some(t=>w(t,e)),0:()=>w(h,e)}),[h]),k=(0,C.z)(e=>g.activeOptionIndex===D(e)),F=(0,a.useMemo)(()=>({...g,immediate:!1,optionsPropsRef:O,labelRef:S,inputRef:T,buttonRef:I,optionsRef:M,value:h,defaultValue:o,disabled:u,mode:p?1:0,virtual:g.virtual,get activeOptionIndex(){if(R.current&&null===g.activeOptionIndex&&g.options.length>0){let e=g.options.findIndex(e=>!e.dataRef.current.disabled);if(-1!==e)return e}return g.activeOptionIndex},calculateIndex:D,compare:w,isSelected:L,isActive:k,nullable:d,__demoMode:c}),[h,o,u,p,d,c,g,null]);(0,z.e)(()=>{},[null,void 0]),(0,z.e)(()=>{g.dataRef.current=F},[F]),(0,P.O)([F.buttonRef,F.inputRef,F.optionsRef],()=>J.closeCombobox(),0===F.comboboxState);let A=(0,a.useMemo)(()=>{var e,t,n;return{open:0===F.comboboxState,disabled:u,activeIndex:F.activeOptionIndex,activeOption:null===F.activeOptionIndex?null:F.virtual?F.virtual.options[null!=(e=F.activeOptionIndex)?e:0]:null!=(n=null==(t=F.options[F.activeOptionIndex])?void 0:t.dataRef.current.value)?n:null,value:h}},[F,u,h]),_=(0,C.z)(()=>{if(null!==F.activeOptionIndex){if(F.virtual)H(F.virtual.options[F.activeOptionIndex]);else{let{dataRef:e}=F.options[F.activeOptionIndex];H(e.current.value)}J.goToOption(U.T.Specific,F.activeOptionIndex)}}),V=(0,C.z)(()=>{x({type:0}),R.current=!0}),j=(0,C.z)(()=>{x({type:1}),R.current=!1}),q=(0,C.z)((e,t,n)=>(R.current=!1,e===U.T.Specific?x({type:2,focus:U.T.Specific,idx:t,trigger:n}):x({type:2,focus:e,trigger:n}))),Z=(0,C.z)((e,t)=>(x({type:3,payload:{id:e,dataRef:t}}),()=>{F.isActive(t.current.value)&&(R.current=!0),x({type:4,id:e})})),G=(0,C.z)(e=>(x({type:5,id:e}),()=>x({type:5,id:null}))),H=(0,C.z)(e=>(0,K.E)(F.mode,{0:()=>null==m?void 0:m(e),1(){let t=F.value.slice(),n=t.findIndex(t=>w(t,e));return -1===n?t.push(e):t.splice(n,1),null==m?void 0:m(t)}})),$=(0,C.z)(e=>{x({type:6,trigger:e})}),J=(0,a.useMemo)(()=>({onChange:H,registerOption:Z,registerLabel:G,goToOption:q,closeCombobox:j,openCombobox:V,setActivationTrigger:$,selectActiveOption:_}),[]),W=(0,a.useRef)(null),X=(0,E.G)();return(0,a.useEffect)(()=>{W.current&&void 0!==o&&X.addEventListener(W.current,"reset",()=>{null==m||m(o)})},[W,m]),a.createElement(eo.Provider,{value:J},a.createElement(ea.Provider,{value:F},a.createElement(B.up,{value:(0,K.E)(F.comboboxState,{0:B.ZM.Open,1:B.ZM.Closed})},null!=l&&null!=h&&(0,Y.t)({[l]:h}).map((e,t)=>{let[n,o]=e;return a.createElement(N._,{features:N.A.Hidden,ref:0===t?e=>{var t;W.current=null!=(t=null==e?void 0:e.closest("form"))?t:null}:void 0,...(0,Q.oA)({key:n,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:r,disabled:u,name:n,value:o})})}),(0,Q.sY)({ourProps:null===t?{}:{ref:t},theirProps:b,slot:A,defaultTag:ec,name:"Combobox"}))))}),ef=(0,Q.yV)(function(e,t){var n;let o=es("Combobox.Button"),i=ei("Combobox.Button"),r=(0,k.T)(o.buttonRef,t),l=(0,M.M)(),{id:s="headlessui-combobox-button-".concat(l),...u}=e,c=(0,E.G)(),d=(0,C.z)(e=>{switch(e.key){case H.R.ArrowDown:return e.preventDefault(),e.stopPropagation(),1===o.comboboxState&&i.openCombobox(),c.nextFrame(()=>{var e;return null==(e=o.inputRef.current)?void 0:e.focus({preventScroll:!0})});case H.R.ArrowUp:return e.preventDefault(),e.stopPropagation(),1===o.comboboxState&&(i.openCombobox(),c.nextFrame(()=>{o.value||i.goToOption(U.T.Last)})),c.nextFrame(()=>{var e;return null==(e=o.inputRef.current)?void 0:e.focus({preventScroll:!0})});case H.R.Escape:return 0!==o.comboboxState?void 0:(e.preventDefault(),o.optionsRef.current&&!o.optionsPropsRef.current.static&&e.stopPropagation(),i.closeCombobox(),c.nextFrame(()=>{var e;return null==(e=o.inputRef.current)?void 0:e.focus({preventScroll:!0})}));default:return}}),p=(0,C.z)(e=>{if((0,j.P)(e.currentTarget))return e.preventDefault();0===o.comboboxState?i.closeCombobox():(e.preventDefault(),i.openCombobox()),c.nextFrame(()=>{var e;return null==(e=o.inputRef.current)?void 0:e.focus({preventScroll:!0})})}),f=(0,I.v)(()=>{if(o.labelId)return[o.labelId,s].join(" ")},[o.labelId,s]),v=(0,a.useMemo)(()=>({open:0===o.comboboxState,disabled:o.disabled,value:o.value}),[o]),b={ref:r,id:s,type:(0,L.f)(e,o.buttonRef),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":null==(n=o.optionsRef.current)?void 0:n.id,"aria-expanded":0===o.comboboxState,"aria-labelledby":f,disabled:o.disabled,onClick:p,onKeyDown:d};return(0,Q.sY)({ourProps:b,theirProps:u,slot:v,defaultTag:"button",name:"Combobox.Button"})}),ev=Object.assign(ep,{Input:(0,Q.yV)(function(e,t){var n,o,i,r,l,s;let u=(0,M.M)(),{id:c="headlessui-combobox-input-".concat(u),onChange:d,displayValue:p,type:f="text",...v}=e,b=es("Combobox.Input"),h=ei("Combobox.Input"),m=(0,k.T)(b.inputRef,t),g=(0,D.i)(b.inputRef),x=(0,a.useRef)(!1),R=(0,E.G)(),O=(0,C.z)(()=>{h.onChange(null),b.optionsRef.current&&(b.optionsRef.current.scrollTop=0),h.goToOption(U.T.Nothing)}),S="function"==typeof p&&void 0!==b.value?null!=(s=p(b.value))?s:"":"string"==typeof b.value?b.value:"";(0,_.q)((e,t)=>{let[n,o]=e,[i,r]=t;if(x.current)return;let l=b.inputRef.current;l&&((0===r&&1===o||n!==i)&&(l.value=n),requestAnimationFrame(()=>{if(x.current||!l||(null==g?void 0:g.activeElement)!==l)return;let{selectionStart:e,selectionEnd:t}=l;0===Math.abs((null!=t?t:0)-(null!=e?e:0))&&0===e&&l.setSelectionRange(l.value.length,l.value.length)}))},[S,b.comboboxState,g]),(0,_.q)((e,t)=>{let[n]=e,[o]=t;if(0===n&&1===o){if(x.current)return;let e=b.inputRef.current;if(!e)return;let t=e.value,{selectionStart:n,selectionEnd:o,selectionDirection:i}=e;e.value="",e.value=t,null!==i?e.setSelectionRange(n,o,i):e.setSelectionRange(n,o)}},[b.comboboxState]);let T=(0,a.useRef)(!1),y=(0,C.z)(()=>{T.current=!0}),z=(0,C.z)(()=>{R.nextFrame(()=>{T.current=!1})}),w=(0,C.z)(e=>{switch(x.current=!0,e.key){case H.R.Enter:if(x.current=!1,0!==b.comboboxState||T.current)return;if(e.preventDefault(),e.stopPropagation(),null===b.activeOptionIndex){h.closeCombobox();return}h.selectActiveOption(),0===b.mode&&h.closeCombobox();break;case H.R.ArrowDown:return x.current=!1,e.preventDefault(),e.stopPropagation(),(0,K.E)(b.comboboxState,{0:()=>h.goToOption(U.T.Next),1:()=>h.openCombobox()});case H.R.ArrowUp:return x.current=!1,e.preventDefault(),e.stopPropagation(),(0,K.E)(b.comboboxState,{0:()=>h.goToOption(U.T.Previous),1:()=>{h.openCombobox(),R.nextFrame(()=>{b.value||h.goToOption(U.T.Last)})}});case H.R.Home:if(e.shiftKey)break;return x.current=!1,e.preventDefault(),e.stopPropagation(),h.goToOption(U.T.First);case H.R.PageUp:return x.current=!1,e.preventDefault(),e.stopPropagation(),h.goToOption(U.T.First);case H.R.End:if(e.shiftKey)break;return x.current=!1,e.preventDefault(),e.stopPropagation(),h.goToOption(U.T.Last);case H.R.PageDown:return x.current=!1,e.preventDefault(),e.stopPropagation(),h.goToOption(U.T.Last);case H.R.Escape:return x.current=!1,0!==b.comboboxState?void 0:(e.preventDefault(),b.optionsRef.current&&!b.optionsPropsRef.current.static&&e.stopPropagation(),b.nullable&&0===b.mode&&null===b.value&&O(),h.closeCombobox());case H.R.Tab:if(x.current=!1,0!==b.comboboxState)return;0===b.mode&&1!==b.activationTrigger&&h.selectActiveOption(),h.closeCombobox()}}),P=(0,C.z)(e=>{null==d||d(e),b.nullable&&0===b.mode&&""===e.target.value&&O(),h.openCombobox()}),L=(0,C.z)(e=>{var t,n,o;let i=null!=(t=e.relatedTarget)?t:V.m.find(t=>t!==e.currentTarget);if(x.current=!1,!(null!=(n=b.optionsRef.current)&&n.contains(i))&&!(null!=(o=b.buttonRef.current)&&o.contains(i))&&0===b.comboboxState)return e.preventDefault(),0===b.mode&&(b.nullable&&null===b.value?O():1!==b.activationTrigger&&h.selectActiveOption()),h.closeCombobox()}),F=(0,C.z)(e=>{var t,n,o;let i=null!=(t=e.relatedTarget)?t:V.m.find(t=>t!==e.currentTarget);null!=(n=b.buttonRef.current)&&n.contains(i)||null!=(o=b.optionsRef.current)&&o.contains(i)||b.disabled||b.immediate&&0!==b.comboboxState&&(h.openCombobox(),R.nextFrame(()=>{h.setActivationTrigger(1)}))}),A=(0,I.v)(()=>{if(b.labelId)return[b.labelId].join(" ")},[b.labelId]),N=(0,a.useMemo)(()=>({open:0===b.comboboxState,disabled:b.disabled}),[b]),B={ref:m,id:c,role:"combobox",type:f,"aria-controls":null==(n=b.optionsRef.current)?void 0:n.id,"aria-expanded":0===b.comboboxState,"aria-activedescendant":null===b.activeOptionIndex?void 0:b.virtual?null==(o=b.options.find(e=>{var t;return!(null!=(t=b.virtual)&&t.disabled(e.dataRef.current.value))&&b.compare(e.dataRef.current.value,b.virtual.options[b.activeOptionIndex])}))?void 0:o.id:null==(i=b.options[b.activeOptionIndex])?void 0:i.id,"aria-labelledby":A,"aria-autocomplete":"list",defaultValue:null!=(l=null!=(r=e.defaultValue)?r:void 0!==b.defaultValue?null==p?void 0:p(b.defaultValue):null)?l:b.defaultValue,disabled:b.disabled,onCompositionStart:y,onCompositionEnd:z,onKeyDown:w,onChange:P,onFocus:F,onBlur:L};return(0,Q.sY)({ourProps:B,theirProps:v,slot:N,defaultTag:"input",name:"Combobox.Input"})}),Button:ef,Label:(0,Q.yV)(function(e,t){let n=(0,M.M)(),{id:o="headlessui-combobox-label-".concat(n),...i}=e,r=es("Combobox.Label"),l=ei("Combobox.Label"),s=(0,k.T)(r.labelRef,t);(0,z.e)(()=>l.registerLabel(o),[o]);let u=(0,C.z)(()=>{var e;return null==(e=r.inputRef.current)?void 0:e.focus({preventScroll:!0})}),c=(0,a.useMemo)(()=>({open:0===r.comboboxState,disabled:r.disabled}),[r]);return(0,Q.sY)({ourProps:{ref:s,id:o,onClick:u},theirProps:i,slot:c,defaultTag:"label",name:"Combobox.Label"})}),Options:(0,Q.yV)(function(e,t){let n=(0,M.M)(),{id:o="headlessui-combobox-options-".concat(n),hold:i=!1,...r}=e,l=es("Combobox.Options"),s=(0,k.T)(l.optionsRef,t),u=(0,B.oJ)(),c=null!==u?(u&B.ZM.Open)===B.ZM.Open:0===l.comboboxState;(0,z.e)(()=>{var t;l.optionsPropsRef.current.static=null!=(t=e.static)&&t},[l.optionsPropsRef,e.static]),(0,z.e)(()=>{l.optionsPropsRef.current.hold=i},[l.optionsPropsRef,i]),(0,A.B)({container:l.optionsRef.current,enabled:0===l.comboboxState,accept:e=>"option"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT,walk(e){e.setAttribute("role","none")}});let d=(0,I.v)(()=>{var e,t;return null!=(t=l.labelId)?t:null==(e=l.buttonRef.current)?void 0:e.id},[l.labelId,l.buttonRef.current]),p=(0,a.useMemo)(()=>({open:0===l.comboboxState,option:void 0}),[l]),f={"aria-labelledby":d,role:"listbox","aria-multiselectable":1===l.mode||void 0,id:o,ref:s};return l.virtual&&0===l.comboboxState&&Object.assign(r,{children:a.createElement(el,null,r.children)}),(0,Q.sY)({ourProps:f,theirProps:r,slot:p,defaultTag:"ul",features:ed,visible:c,name:"Combobox.Options"})}),Option:(0,Q.yV)(function(e,t){var n;let o=(0,M.M)(),{id:i="headlessui-combobox-option-".concat(o),disabled:r=!1,value:l,order:s=null,...u}=e,c=es("Combobox.Option"),d=ei("Combobox.Option"),p=c.virtual?c.activeOptionIndex===c.calculateIndex(l):null!==c.activeOptionIndex&&(null==(n=c.options[c.activeOptionIndex])?void 0:n.id)===i,f=c.isSelected(l),v=(0,a.useRef)(null),b=(0,w.E)({disabled:r,value:l,domRef:v,order:s}),h=(0,a.useContext)(er),m=(0,k.T)(t,v,h?h.measureElement:null),g=(0,C.z)(()=>d.onChange(l));(0,z.e)(()=>d.registerOption(i,b),[b,i]);let x=(0,a.useRef)(!(c.virtual||c.__demoMode));(0,z.e)(()=>{if(!c.virtual||!c.__demoMode)return;let e=(0,q.k)();return e.requestAnimationFrame(()=>{x.current=!0}),e.dispose},[c.virtual,c.__demoMode]),(0,z.e)(()=>{if(!x.current||0!==c.comboboxState||!p||0===c.activationTrigger)return;let e=(0,q.k)();return e.requestAnimationFrame(()=>{var e,t;null==(t=null==(e=v.current)?void 0:e.scrollIntoView)||t.call(e,{block:"nearest"})}),e.dispose},[v,p,c.comboboxState,c.activationTrigger,c.activeOptionIndex]);let R=(0,C.z)(e=>{var t;if(r||null!=(t=c.virtual)&&t.disabled(l))return e.preventDefault();g(),(0,G.tq)()||requestAnimationFrame(()=>{var e;return null==(e=c.inputRef.current)?void 0:e.focus({preventScroll:!0})}),0===c.mode&&requestAnimationFrame(()=>d.closeCombobox())}),O=(0,C.z)(()=>{var e;if(r||null!=(e=c.virtual)&&e.disabled(l))return d.goToOption(U.T.Nothing);let t=c.calculateIndex(l);d.goToOption(U.T.Specific,t)}),S=(0,F.g)(),T=(0,C.z)(e=>S.update(e)),I=(0,C.z)(e=>{var t;if(!S.wasMoved(e)||r||null!=(t=c.virtual)&&t.disabled(l)||p)return;let n=c.calculateIndex(l);d.goToOption(U.T.Specific,n,0)}),y=(0,C.z)(e=>{var t;S.wasMoved(e)&&(r||null!=(t=c.virtual)&&t.disabled(l)||p&&(c.optionsPropsRef.current.hold||d.goToOption(U.T.Nothing)))}),E=(0,a.useMemo)(()=>({active:p,selected:f,disabled:r}),[p,f,r]);return(0,Q.sY)({ourProps:{id:i,ref:m,role:"option",tabIndex:!0===r?void 0:-1,"aria-disabled":!0===r||void 0,"aria-selected":f,disabled:void 0,onClick:R,onFocus:O,onPointerEnter:T,onMouseEnter:T,onPointerMove:I,onMouseMove:I,onPointerLeave:y,onMouseLeave:y},theirProps:u,slot:E,defaultTag:"li",name:"Combobox.Option"})})})},49899:function(e,t,n){let o,i,r,l;n.d(t,{R:function(){return Z}});var a=n(2265),s=n(36892),u=n(93169),c=n(99299),d=n(6584),p=n(72955),f=n(61463),v=n(88703),b=n(39110),h=n(75180),m=n(41469),g=n(58606),x=n(32633),R=n(89080),O=n(53509),S=n(47986),T=n(1494),I=n(70777),y=n(19309),E=n(69331),C=n(5583),M=n(91498),z=n(3600),w=n(7551),P=((o=P||{})[o.Open=0]="Open",o[o.Closed=1]="Closed",o),D=((i=D||{})[i.Single=0]="Single",i[i.Multi=1]="Multi",i),L=((r=L||{})[r.Pointer=0]="Pointer",r[r.Other=1]="Other",r),k=((l=k||{})[l.OpenListbox=0]="OpenListbox",l[l.CloseListbox=1]="CloseListbox",l[l.GoToOption=2]="GoToOption",l[l.Search=3]="Search",l[l.ClearSearch=4]="ClearSearch",l[l.RegisterOption=5]="RegisterOption",l[l.UnregisterOption=6]="UnregisterOption",l[l.RegisterLabel=7]="RegisterLabel",l);function F(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e=>e,n=null!==e.activeOptionIndex?e.options[e.activeOptionIndex]:null,o=(0,y.z2)(t(e.options.slice()),e=>e.dataRef.current.domRef.current),i=n?o.indexOf(n):null;return -1===i&&(i=null),{options:o,activeOptionIndex:i}}let A={1:e=>e.dataRef.current.disabled||1===e.listboxState?e:{...e,activeOptionIndex:null,listboxState:1},0(e){if(e.dataRef.current.disabled||0===e.listboxState)return e;let t=e.activeOptionIndex,{isSelected:n}=e.dataRef.current,o=e.options.findIndex(e=>n(e.dataRef.current.value));return -1!==o&&(t=o),{...e,listboxState:0,activeOptionIndex:t}},2(e,t){var n;if(e.dataRef.current.disabled||1===e.listboxState)return e;let o=F(e),i=(0,T.d)(t,{resolveItems:()=>o.options,resolveActiveIndex:()=>o.activeOptionIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});return{...e,...o,searchQuery:"",activeOptionIndex:i,activationTrigger:null!=(n=t.trigger)?n:1}},3:(e,t)=>{if(e.dataRef.current.disabled||1===e.listboxState)return e;let n=""!==e.searchQuery?0:1,o=e.searchQuery+t.value.toLowerCase(),i=(null!==e.activeOptionIndex?e.options.slice(e.activeOptionIndex+n).concat(e.options.slice(0,e.activeOptionIndex+n)):e.options).find(e=>{var t;return!e.dataRef.current.disabled&&(null==(t=e.dataRef.current.textValue)?void 0:t.startsWith(o))}),r=i?e.options.indexOf(i):-1;return -1===r||r===e.activeOptionIndex?{...e,searchQuery:o}:{...e,searchQuery:o,activeOptionIndex:r,activationTrigger:1}},4:e=>e.dataRef.current.disabled||1===e.listboxState||""===e.searchQuery?e:{...e,searchQuery:""},5:(e,t)=>{let n={id:t.id,dataRef:t.dataRef},o=F(e,e=>[...e,n]);return null===e.activeOptionIndex&&e.dataRef.current.isSelected(t.dataRef.current.value)&&(o.activeOptionIndex=o.options.indexOf(n)),{...e,...o}},6:(e,t)=>{let n=F(e,e=>{let n=e.findIndex(e=>e.id===t.id);return -1!==n&&e.splice(n,1),e});return{...e,...n,activationTrigger:1}},7:(e,t)=>({...e,labelId:t.id})},_=(0,a.createContext)(null);function N(e){let t=(0,a.useContext)(_);if(null===t){let t=Error("<".concat(e," /> is missing a parent <Listbox /> component."));throw Error.captureStackTrace&&Error.captureStackTrace(t,N),t}return t}_.displayName="ListboxActionsContext";let B=(0,a.createContext)(null);function V(e){let t=(0,a.useContext)(B);if(null===t){let t=Error("<".concat(e," /> is missing a parent <Listbox /> component."));throw Error.captureStackTrace&&Error.captureStackTrace(t,V),t}return t}function j(e,t){return(0,C.E)(t.type,A,e,t)}B.displayName="ListboxDataContext";let U=a.Fragment,q=z.AN.RenderStrategy|z.AN.Static,Z=Object.assign((0,z.yV)(function(e,t){let{value:n,defaultValue:o,form:i,name:r,onChange:l,by:s=(e,t)=>e===t,disabled:p=!1,horizontal:v=!1,multiple:h=!1,...g}=e,x=v?"horizontal":"vertical",S=(0,m.T)(t),[I=h?[]:void 0,M]=(0,u.q)(n,l,o),[w,P]=(0,a.useReducer)(j,{dataRef:(0,a.createRef)(),listboxState:1,options:[],searchQuery:"",labelId:null,activeOptionIndex:null,activationTrigger:1}),D=(0,a.useRef)({static:!1,hold:!1}),L=(0,a.useRef)(null),k=(0,a.useRef)(null),F=(0,a.useRef)(null),A=(0,d.z)("string"==typeof s?(e,t)=>(null==e?void 0:e[s])===(null==t?void 0:t[s]):s),N=(0,a.useCallback)(e=>(0,C.E)(V.mode,{1:()=>I.some(t=>A(t,e)),0:()=>A(I,e)}),[I]),V=(0,a.useMemo)(()=>({...w,value:I,disabled:p,mode:h?1:0,orientation:x,compare:A,isSelected:N,optionsPropsRef:D,labelRef:L,buttonRef:k,optionsRef:F}),[I,p,h,w]);(0,f.e)(()=>{w.dataRef.current=V},[V]),(0,b.O)([V.buttonRef,V.optionsRef],(e,t)=>{var n;P({type:1}),(0,y.sP)(t,y.tJ.Loose)||(e.preventDefault(),null==(n=V.buttonRef.current)||n.focus())},0===V.listboxState);let q=(0,a.useMemo)(()=>({open:0===V.listboxState,disabled:p,value:I}),[V,p,I]),Z=(0,d.z)(e=>{let t=V.options.find(t=>t.id===e);t&&J(t.dataRef.current.value)}),Y=(0,d.z)(()=>{if(null!==V.activeOptionIndex){let{dataRef:e,id:t}=V.options[V.activeOptionIndex];J(e.current.value),P({type:2,focus:T.T.Specific,id:t})}}),K=(0,d.z)(()=>P({type:0})),G=(0,d.z)(()=>P({type:1})),Q=(0,d.z)((e,t,n)=>e===T.T.Specific?P({type:2,focus:T.T.Specific,id:t,trigger:n}):P({type:2,focus:e,trigger:n})),H=(0,d.z)((e,t)=>(P({type:5,id:e,dataRef:t}),()=>P({type:6,id:e}))),$=(0,d.z)(e=>(P({type:7,id:e}),()=>P({type:7,id:null}))),J=(0,d.z)(e=>(0,C.E)(V.mode,{0:()=>null==M?void 0:M(e),1(){let t=V.value.slice(),n=t.findIndex(t=>A(t,e));return -1===n?t.push(e):t.splice(n,1),null==M?void 0:M(t)}})),W=(0,d.z)(e=>P({type:3,value:e})),X=(0,d.z)(()=>P({type:4})),ee=(0,a.useMemo)(()=>({onChange:J,registerOption:H,registerLabel:$,goToOption:Q,closeListbox:G,openListbox:K,selectActiveOption:Y,selectOption:Z,search:W,clearSearch:X}),[]),et=(0,a.useRef)(null),en=(0,c.G)();return(0,a.useEffect)(()=>{et.current&&void 0!==o&&en.addEventListener(et.current,"reset",()=>{null==M||M(o)})},[et,M]),a.createElement(_.Provider,{value:ee},a.createElement(B.Provider,{value:V},a.createElement(O.up,{value:(0,C.E)(V.listboxState,{0:O.ZM.Open,1:O.ZM.Closed})},null!=r&&null!=I&&(0,E.t)({[r]:I}).map((e,t)=>{let[n,o]=e;return a.createElement(R._,{features:R.A.Hidden,ref:0===t?e=>{var t;et.current=null!=(t=null==e?void 0:e.closest("form"))?t:null}:void 0,...(0,z.oA)({key:n,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:i,disabled:p,name:n,value:o})})}),(0,z.sY)({ourProps:{ref:S},theirProps:g,slot:q,defaultTag:U,name:"Listbox"}))))}),{Button:(0,z.yV)(function(e,t){var n;let o=(0,p.M)(),{id:i="headlessui-listbox-button-".concat(o),...r}=e,l=V("Listbox.Button"),u=N("Listbox.Button"),f=(0,m.T)(l.buttonRef,t),v=(0,c.G)(),b=(0,d.z)(e=>{switch(e.key){case w.R.Space:case w.R.Enter:case w.R.ArrowDown:e.preventDefault(),u.openListbox(),v.nextFrame(()=>{l.value||u.goToOption(T.T.First)});break;case w.R.ArrowUp:e.preventDefault(),u.openListbox(),v.nextFrame(()=>{l.value||u.goToOption(T.T.Last)})}}),g=(0,d.z)(e=>{e.key===w.R.Space&&e.preventDefault()}),x=(0,d.z)(e=>{if((0,S.P)(e.currentTarget))return e.preventDefault();0===l.listboxState?(u.closeListbox(),v.nextFrame(()=>{var e;return null==(e=l.buttonRef.current)?void 0:e.focus({preventScroll:!0})})):(e.preventDefault(),u.openListbox())}),R=(0,s.v)(()=>{if(l.labelId)return[l.labelId,i].join(" ")},[l.labelId,i]),O=(0,a.useMemo)(()=>({open:0===l.listboxState,disabled:l.disabled,value:l.value}),[l]),I={ref:f,id:i,type:(0,h.f)(e,l.buttonRef),"aria-haspopup":"listbox","aria-controls":null==(n=l.optionsRef.current)?void 0:n.id,"aria-expanded":0===l.listboxState,"aria-labelledby":R,disabled:l.disabled,onKeyDown:b,onKeyUp:g,onClick:x};return(0,z.sY)({ourProps:I,theirProps:r,slot:O,defaultTag:"button",name:"Listbox.Button"})}),Label:(0,z.yV)(function(e,t){let n=(0,p.M)(),{id:o="headlessui-listbox-label-".concat(n),...i}=e,r=V("Listbox.Label"),l=N("Listbox.Label"),s=(0,m.T)(r.labelRef,t);(0,f.e)(()=>l.registerLabel(o),[o]);let u=(0,d.z)(()=>{var e;return null==(e=r.buttonRef.current)?void 0:e.focus({preventScroll:!0})}),c=(0,a.useMemo)(()=>({open:0===r.listboxState,disabled:r.disabled}),[r]);return(0,z.sY)({ourProps:{ref:s,id:o,onClick:u},theirProps:i,slot:c,defaultTag:"label",name:"Listbox.Label"})}),Options:(0,z.yV)(function(e,t){var n;let o=(0,p.M)(),{id:i="headlessui-listbox-options-".concat(o),...r}=e,l=V("Listbox.Options"),u=N("Listbox.Options"),f=(0,m.T)(l.optionsRef,t),v=(0,c.G)(),b=(0,c.G)(),h=(0,O.oJ)(),g=null!==h?(h&O.ZM.Open)===O.ZM.Open:0===l.listboxState;(0,a.useEffect)(()=>{var e;let t=l.optionsRef.current;t&&0===l.listboxState&&t!==(null==(e=(0,M.r)(t))?void 0:e.activeElement)&&t.focus({preventScroll:!0})},[l.listboxState,l.optionsRef]);let x=(0,d.z)(e=>{switch(b.dispose(),e.key){case w.R.Space:if(""!==l.searchQuery)return e.preventDefault(),e.stopPropagation(),u.search(e.key);case w.R.Enter:if(e.preventDefault(),e.stopPropagation(),null!==l.activeOptionIndex){let{dataRef:e}=l.options[l.activeOptionIndex];u.onChange(e.current.value)}0===l.mode&&(u.closeListbox(),(0,I.k)().nextFrame(()=>{var e;return null==(e=l.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case(0,C.E)(l.orientation,{vertical:w.R.ArrowDown,horizontal:w.R.ArrowRight}):return e.preventDefault(),e.stopPropagation(),u.goToOption(T.T.Next);case(0,C.E)(l.orientation,{vertical:w.R.ArrowUp,horizontal:w.R.ArrowLeft}):return e.preventDefault(),e.stopPropagation(),u.goToOption(T.T.Previous);case w.R.Home:case w.R.PageUp:return e.preventDefault(),e.stopPropagation(),u.goToOption(T.T.First);case w.R.End:case w.R.PageDown:return e.preventDefault(),e.stopPropagation(),u.goToOption(T.T.Last);case w.R.Escape:return e.preventDefault(),e.stopPropagation(),u.closeListbox(),v.nextFrame(()=>{var e;return null==(e=l.buttonRef.current)?void 0:e.focus({preventScroll:!0})});case w.R.Tab:e.preventDefault(),e.stopPropagation();break;default:1===e.key.length&&(u.search(e.key),b.setTimeout(()=>u.clearSearch(),350))}}),R=(0,s.v)(()=>{var e;return null==(e=l.buttonRef.current)?void 0:e.id},[l.buttonRef.current]),S=(0,a.useMemo)(()=>({open:0===l.listboxState}),[l]),y={"aria-activedescendant":null===l.activeOptionIndex||null==(n=l.options[l.activeOptionIndex])?void 0:n.id,"aria-multiselectable":1===l.mode||void 0,"aria-labelledby":R,"aria-orientation":l.orientation,id:i,onKeyDown:x,role:"listbox",tabIndex:0,ref:f};return(0,z.sY)({ourProps:y,theirProps:r,slot:S,defaultTag:"ul",features:q,visible:g,name:"Listbox.Options"})}),Option:(0,z.yV)(function(e,t){let n=(0,p.M)(),{id:o="headlessui-listbox-option-".concat(n),disabled:i=!1,value:r,...l}=e,s=V("Listbox.Option"),u=N("Listbox.Option"),c=null!==s.activeOptionIndex&&s.options[s.activeOptionIndex].id===o,b=s.isSelected(r),h=(0,a.useRef)(null),R=(0,g.x)(h),O=(0,v.E)({disabled:i,value:r,domRef:h,get textValue(){return R()}}),S=(0,m.T)(t,h);(0,f.e)(()=>{if(0!==s.listboxState||!c||0===s.activationTrigger)return;let e=(0,I.k)();return e.requestAnimationFrame(()=>{var e,t;null==(t=null==(e=h.current)?void 0:e.scrollIntoView)||t.call(e,{block:"nearest"})}),e.dispose},[h,c,s.listboxState,s.activationTrigger,s.activeOptionIndex]),(0,f.e)(()=>u.registerOption(o,O),[O,o]);let y=(0,d.z)(e=>{if(i)return e.preventDefault();u.onChange(r),0===s.mode&&(u.closeListbox(),(0,I.k)().nextFrame(()=>{var e;return null==(e=s.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))}),E=(0,d.z)(()=>{if(i)return u.goToOption(T.T.Nothing);u.goToOption(T.T.Specific,o)}),C=(0,x.g)(),M=(0,d.z)(e=>C.update(e)),w=(0,d.z)(e=>{C.wasMoved(e)&&(i||c||u.goToOption(T.T.Specific,o,0))}),P=(0,d.z)(e=>{C.wasMoved(e)&&(i||c&&u.goToOption(T.T.Nothing))}),D=(0,a.useMemo)(()=>({active:c,selected:b,disabled:i}),[c,b,i]);return(0,z.sY)({ourProps:{id:o,ref:S,role:"option",tabIndex:!0===i?void 0:-1,"aria-disabled":!0===i||void 0,"aria-selected":b,disabled:void 0,onClick:y,onFocus:E,onPointerEnter:M,onMouseEnter:M,onPointerMove:w,onMouseMove:w,onPointerLeave:P,onMouseLeave:P},theirProps:l,slot:D,defaultTag:"li",name:"Listbox.Option"})})})},36892:function(e,t,n){n.d(t,{v:function(){return l}});var o=n(2265),i=n(61463),r=n(88703);function l(e,t){let[n,l]=(0,o.useState)(e),a=(0,r.E)(e);return(0,i.e)(()=>l(a.current),[a,l,...t]),n}},93169:function(e,t,n){n.d(t,{q:function(){return r}});var o=n(2265),i=n(6584);function r(e,t,n){let[r,l]=(0,o.useState)(n),a=void 0!==e,s=(0,o.useRef)(a),u=(0,o.useRef)(!1),c=(0,o.useRef)(!1);return!a||s.current||u.current?a||!s.current||c.current||(c.current=!0,s.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.")):(u.current=!0,s.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?e:r,(0,i.z)(e=>(a||l(e),null==t?void 0:t(e)))]}},58606:function(e,t,n){n.d(t,{x:function(){return a}});var o=n(2265);let i=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function r(e){var t,n;let o=null!=(t=e.innerText)?t:"",r=e.cloneNode(!0);if(!(r instanceof HTMLElement))return o;let l=!1;for(let e of r.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))e.remove(),l=!0;let a=l?null!=(n=r.innerText)?n:"":o;return i.test(a)&&(a=a.replace(i,"")),a}var l=n(6584);function a(e){let t=(0,o.useRef)(""),n=(0,o.useRef)("");return(0,l.z)(()=>{let o=e.current;if(!o)return"";let i=o.innerText;if(t.current===i)return n.current;let l=(function(e){let t=e.getAttribute("aria-label");if("string"==typeof t)return t.trim();let n=e.getAttribute("aria-labelledby");if(n){let e=n.split(" ").map(e=>{let t=document.getElementById(e);if(t){let e=t.getAttribute("aria-label");return"string"==typeof e?e.trim():r(t).trim()}return null}).filter(Boolean);if(e.length>0)return e.join(", ")}return r(e).trim()})(o).trim().toLowerCase();return t.current=i,n.current=l,l})}},32633:function(e,t,n){n.d(t,{g:function(){return r}});var o=n(2265);function i(e){return[e.screenX,e.screenY]}function r(){let e=(0,o.useRef)([-1,-1]);return{wasMoved(t){let n=i(t);return(e.current[0]!==n[0]||e.current[1]!==n[1])&&(e.current=n,!0)},update(t){e.current=i(t)}}}},35531:function(e,t,n){n.d(t,{B:function(){return l}});var o=n(2265),i=n(91498),r=n(61463);function l(e){let{container:t,accept:n,walk:l,enabled:a=!0}=e,s=(0,o.useRef)(n),u=(0,o.useRef)(l);(0,o.useEffect)(()=>{s.current=n,u.current=l},[n,l]),(0,r.e)(()=>{if(!t||!a)return;let e=(0,i.r)(t);if(!e)return;let n=s.current,o=u.current,r=Object.assign(e=>n(e),{acceptNode:n}),l=e.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,r,!1);for(;l.nextNode();)o(l.currentNode)},[t,a,s,u])}},1494:function(e,t,n){let o;n.d(t,{T:function(){return i},d:function(){return r}});var i=((o=i||{})[o.First=0]="First",o[o.Previous=1]="Previous",o[o.Next=2]="Next",o[o.Last=3]="Last",o[o.Specific=4]="Specific",o[o.Nothing=5]="Nothing",o);function r(e,t){let n=t.resolveItems();if(n.length<=0)return null;let o=t.resolveActiveIndex(),i=null!=o?o:-1;switch(e.focus){case 0:for(let e=0;e<n.length;++e)if(!t.resolveDisabled(n[e],e,n))return e;return o;case 1:for(let e=i-1;e>=0;--e)if(!t.resolveDisabled(n[e],e,n))return e;return o;case 2:for(let e=i+1;e<n.length;++e)if(!t.resolveDisabled(n[e],e,n))return e;return o;case 3:for(let e=n.length-1;e>=0;--e)if(!t.resolveDisabled(n[e],e,n))return e;return o;case 4:for(let o=0;o<n.length;++o)if(t.resolveId(n[o],o,n)===e.id)return o;return o;case 5:return null;default:!function(e){throw Error("Unexpected object: "+e)}(e)}}},69331:function(e,t,n){function o(e,t){return e?e+"["+t+"]":t}function i(e){var t,n;let o=null!=(t=null==e?void 0:e.form)?t:e.closest("form");if(o){for(let t of o.elements)if(t!==e&&("INPUT"===t.tagName&&"submit"===t.type||"BUTTON"===t.tagName&&"submit"===t.type||"INPUT"===t.nodeName&&"image"===t.type)){t.click();return}null==(n=o.requestSubmit)||n.call(o)}}n.d(t,{g:function(){return i},t:function(){return function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];for(let[r,l]of Object.entries(t))!function t(n,i,r){if(Array.isArray(r))for(let[e,l]of r.entries())t(n,o(i,e.toString()),l);else r instanceof Date?n.push([i,r.toISOString()]):"boolean"==typeof r?n.push([i,r?"1":"0"]):"string"==typeof r?n.push([i,r]):"number"==typeof r?n.push([i,"".concat(r)]):null==r?n.push([i,""]):e(r,i,n)}(i,o(n,r),l);return i}}})},39422:function(e,t,n){var o=n(2265);let i=o.forwardRef(function(e,t){let{title:n,titleId:i,...r}=e;return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},r),n?o.createElement("title",{id:i},n):null,o.createElement("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z",clipRule:"evenodd"}))});t.Z=i},28140:function(e,t,n){var o=n(2265);let i=o.forwardRef(function(e,t){let{title:n,titleId:i,...r}=e;return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},r),n?o.createElement("title",{id:i},n):null,o.createElement("path",{fillRule:"evenodd",d:"M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))});t.Z=i},80422:function(e,t,n){var o=n(2265);let i=o.forwardRef(function(e,t){let{title:n,titleId:i,...r}=e;return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},r),n?o.createElement("title",{id:i},n):null,o.createElement("path",{fillRule:"evenodd",d:"M9.47 6.47a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 1 1-1.06 1.06L10 8.06l-3.72 3.72a.75.75 0 0 1-1.06-1.06l4.25-4.25Z",clipRule:"evenodd"}))});t.Z=i}}]);