"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2037],{1253:function(e,t,n){let o,i,l,r;n.d(t,{h:function(){return ef}});var s=n(7653),a=n(3458);function u(e,t,n){var o;let i;let l=null!==(o=n.initialDeps)&&void 0!==o?o:[];return()=>{var o,r,s,a;n.key&&(null==(o=n.debug)?void 0:o.call(n))&&Date.now();let u=e();return(u.length!==l.length||u.some((e,t)=>l[t]!==e))&&(l=u,n.key&&(null==(r=n.debug)?void 0:r.call(n))&&Date.now(),i=t(...u),n.key&&(null==(s=n.debug)?void 0:s.call(n))&&(Date.now(),Date.now()),null==(a=null==n?void 0:n.onChange)||a.call(n,i)),i}}function c(e,t){if(void 0!==e)return e;throw Error("Unexpected undefined".concat(t?": ".concat(t):""))}let d=(e,t)=>1>Math.abs(e-t),p=(e,t,n)=>{let o;return function(){for(var i=arguments.length,l=Array(i),r=0;r<i;r++)l[r]=arguments[r];e.clearTimeout(o),o=e.setTimeout(()=>t.apply(this,l),n)}},h=e=>e,f=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},v=(e,t)=>{let n=e.scrollElement;if(!n)return;let o=e.targetWindow;if(!o)return;let i=e=>{let{width:n,height:o}=e;t({width:Math.round(n),height:Math.round(o)})};if(i(n.getBoundingClientRect()),!o.ResizeObserver)return()=>{};let l=new o.ResizeObserver(e=>{let t=e[0];if(null==t?void 0:t.borderBoxSize){let e=t.borderBoxSize[0];if(e){i({width:e.inlineSize,height:e.blockSize});return}}i(n.getBoundingClientRect())});return l.observe(n,{box:"border-box"}),()=>{l.unobserve(n)}},b={passive:!0},m="undefined"==typeof window||"onscrollend"in window,g=(e,t)=>{let n=e.scrollElement;if(!n)return;let o=e.targetWindow;if(!o)return;let i=0,l=m?()=>void 0:p(o,()=>{t(i,!1)},e.options.isScrollingResetDelay),r=o=>()=>{let{horizontal:r,isRtl:s}=e.options;i=r?n.scrollLeft*(s&&-1||1):n.scrollTop,l(),t(i,o)},s=r(!0),a=r(!1);return a(),n.addEventListener("scroll",s,b),n.addEventListener("scrollend",a,b),()=>{n.removeEventListener("scroll",s),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"])},O=(e,t,n)=>{var o,i;let{adjustments:l=0,behavior:r}=t;null==(i=null==(o=n.scrollElement)?void 0:o.scrollTo)||i.call(o,{[n.options.horizontal?"left":"top"]:e+l,behavior:r})};class R{constructor(e){var t=this;this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let e=null,t=()=>e||(this.targetWindow&&this.targetWindow.ResizeObserver?e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{this._measureElement(e.target,e)})}):null);return{disconnect:()=>{var n;null==(n=t())||n.disconnect(),e=null},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=>{let[n,o]=t;void 0===o&&delete e[n]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:h,rangeExtractor:f,onChange:()=>{},measureElement:x,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,...e}},this.notify=e=>{var t,n;null==(n=(t=this.options).onChange)||n.call(t,this,e)},this.maybeNotify=u(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e,t;let n=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==n){if(this.cleanup(),!n){this.maybeNotify();return}this.scrollElement=n,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=null!==(t=null==(e=this.scrollElement)?void 0:e.window)&&void 0!==t?t:null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<e?"forward":"backward":null,this.scrollOffset=e,this.isScrolling=t,this.maybeNotify()}))}},this.getSize=()=>{var e;return this.options.enabled?(this.scrollRect=null!==(e=this.scrollRect)&&void 0!==e?e:this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0)},this.getScrollOffset=()=>{var e;return this.options.enabled?(this.scrollOffset=null!==(e=this.scrollOffset)&&void 0!==e?e:"function"==typeof this.options.initialOffset?this.options.initialOffset():this.options.initialOffset,this.scrollOffset):(this.scrollOffset=null,0)},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 l=o.get(t.lane);if(null==l||t.end>l.end?o.set(t.lane,t):t.end<l.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.getMeasurementOptions=u(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(e,t,n,o,i)=>(this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:n,getItemKey:o,enabled:i}),{key:!1}),this.getMeasurements=u(()=>[this.getMeasurementOptions(),this.itemSizeCache],(e,t)=>{let{count:n,paddingStart:o,scrollMargin:i,getItemKey:l,enabled:r}=e;if(!r)return this.measurementsCache=[],this.itemSizeCache.clear(),[];0===this.measurementsCache.length&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let s=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];let a=this.measurementsCache.slice(0,s);for(let e=s;e<n;e++){let n=l(e),r=1===this.options.lanes?a[e-1]:this.getFurthestMeasurement(a,e),s=r?r.end+this.options.gap:o+i,u=t.get(n),c="number"==typeof u?u:this.options.estimateSize(e),d=s+c,p=r?r.lane:e%this.options.lanes;a[e]={index:e,start:s,size:c,end:d,key:n,lane:p}}return this.measurementsCache=a,a},{key:!1,debug:()=>this.options.debug}),this.calculateRange=u(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset()],(e,t,n)=>this.range=e.length>0&&t>0?function(e){let{measurements:t,outerSize:n,scrollOffset:o}=e,i=t.length-1,l=I(0,i,e=>t[e].start,o),r=l;for(;r<i&&t[r].end<o+n;)r++;return{startIndex:l,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):-1},this._measureElement=(e,t)=>{let n=this.indexFromElement(e),o=this.measurementsCache[n];if(!o)return;let i=o.key,l=this.elementsCache.get(i);l!==e&&(l&&this.observer.unobserve(l),this.observer.observe(e),this.elementsCache.set(i,e)),e.isConnected&&this.resizeItem(n,this.options.measureElement(e,t,this))},this.resizeItem=(e,t)=>{var n;let o=this.measurementsCache[e];if(!o)return;let i=t-(null!==(n=this.itemSizeCache.get(o.key))&&void 0!==n?n:o.size);0!==i&&((void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(o,i,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=i,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,t)),this.notify(!1))},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}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();if(0!==t.length)return c(t[I(0,t.length-1,e=>c(t[e]).start,e)])},this.getOffsetForAlignment=(e,t)=>{let n=this.getSize(),o=this.getScrollOffset();"auto"===t&&(t=e<=o?"start":e>=o+n?"end":"start"),"start"===t||("end"===t?e-=n:"center"===t&&(e-=n/2));let i=this.options.horizontal?"scrollWidth":"scrollHeight";return Math.max(Math.min((this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[i]:this.scrollElement[i]:0)-n,e),0)},this.getOffsetForIndex=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"auto";e=Math.max(0,Math.min(e,t.options.count-1));let o=t.measurementsCache[e];if(!o)return;let i=t.getSize(),l=t.getScrollOffset();if("auto"===n){if(o.end>=l+i-t.options.scrollPaddingEnd)n="end";else{if(!(o.start<=l+t.options.scrollPaddingStart))return[l,n];n="start"}}let r="end"===n?o.end+t.options.scrollPaddingEnd:o.start-t.options.scrollPaddingStart;return[t.getOffsetForAlignment(r,n),n]},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{null!==this.scrollToIndexTimeoutId&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=function(e){let{align:n="start",behavior:o}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.cancelScrollToIndex(),"smooth"===o&&t.isDynamicMode(),t._scrollToOffset(t.getOffsetForAlignment(e,n),{adjustments:void 0,behavior:o})},this.scrollToIndex=function(e){let{align:n="auto",behavior:o}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e=Math.max(0,Math.min(e,t.options.count-1)),t.cancelScrollToIndex(),"smooth"===o&&t.isDynamicMode();let i=t.getOffsetForIndex(e,n);if(!i)return;let[l,r]=i;t._scrollToOffset(l,{adjustments:void 0,behavior:o}),"smooth"!==o&&t.isDynamicMode()&&t.targetWindow&&(t.scrollToIndexTimeoutId=t.targetWindow.setTimeout(()=>{if(t.scrollToIndexTimeoutId=null,t.elementsCache.has(t.options.getItemKey(e))){let[n]=c(t.getOffsetForIndex(e,r));d(n,t.getScrollOffset())||t.scrollToIndex(e,{align:r,behavior:o})}else t.scrollToIndex(e,{align:r,behavior:o})}))},this.scrollBy=function(e){let{behavior:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.cancelScrollToIndex(),"smooth"===n&&t.isDynamicMode(),t._scrollToOffset(t.getScrollOffset()+e,{adjustments:void 0,behavior:n})},this.getTotalSize=()=>{var e,t;let n=this.getMeasurements();return Math.max((0===n.length?this.options.paddingStart:1===this.options.lanes?null!==(t=null==(e=n[n.length-1])?void 0:e.end)&&void 0!==t?t:0:Math.max(...n.slice(-this.options.lanes).map(e=>e.end)))-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,t)=>{let{adjustments:n,behavior:o}=t;this.options.scrollToFn(e,{behavior:o,adjustments:n},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(e)}}let I=(e,t,n,o)=>{for(;e<=t;){let i=(e+t)/2|0,l=n(i);if(l<o)e=i+1;else{if(!(l>o))return i;t=i-1}}return e>0?e-1:0},S="undefined"!=typeof document?s.useLayoutEffect:s.useEffect;var C=n(88135),T=n(99394),E=n(31240),y=n(62125),M=n(55281),z=n(11513),w=n(65960),P=n(88909),k=n(74277),A=n(56613),F=n(91335),D=n(94388),_=n(13852),L=n(22766),V=n(62308),j=n(32586),B=n(52865),N=n(27345),W=n(80646),U=n(28177),q=n(26959),K=n(41276),Y=n(87295),G=n(50478),Z=n(8840),H=n(85831),J=n(68571),Q=((o=Q||{})[o.Open=0]="Open",o[o.Closed=1]="Closed",o),X=((i=X||{})[i.Single=0]="Single",i[i.Multi=1]="Multi",i),$=((l=$||{})[l.Pointer=0]="Pointer",l[l.Focus=1]="Focus",l[l.Other=2]="Other",l),ee=((r=ee||{})[r.OpenCombobox=0]="OpenCombobox",r[r.CloseCombobox=1]="CloseCombobox",r[r.GoToOption=2]="GoToOption",r[r.RegisterOption=3]="RegisterOption",r[r.UnregisterOption=4]="UnregisterOption",r[r.RegisterLabel=5]="RegisterLabel",r[r.SetActivationTrigger=6]="SetActivationTrigger",r[r.UpdateVirtualOptions=7]="UpdateVirtualOptions",r);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,q.z2)(o,e=>e.dataRef.current.domRef.current),l=n?i.indexOf(n):null;return -1===l&&(l=null),{options:i,activeOptionIndex:l}}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,l,r;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===W.T.Specific?t.idx:(0,W.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!=(l=t.trigger)?l:2;return e.activeOptionIndex===n&&e.activationTrigger===o?e:{...e,activeOptionIndex:n,activationTrigger:o}}let s=et(e);if(null===s.activeOptionIndex){let e=s.options.findIndex(e=>!e.dataRef.current.disabled);-1!==e&&(s.activeOptionIndex=e)}let a=t.focus===W.T.Specific?t.idx:(0,W.d)(t,{resolveItems:()=>s.options,resolveActiveIndex:()=>s.activeOptionIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled}),u=null!=(r=t.trigger)?r:2;return e.activeOptionIndex===a&&e.activationTrigger===u?e:{...e,...s,activeOptionIndex:a,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 l=t.payload,r=et(e,e=>(e.push(l),e));null===e.activeOptionIndex&&null!=(o=e.dataRef.current)&&o.isSelected(t.payload.dataRef.current.value)&&(r.activeOptionIndex=r.options.indexOf(l));let s={...e,...r,activationTrigger:2};return null!=(i=e.dataRef.current)&&i.__demoMode&&void 0===e.dataRef.current.value&&(s.activeOptionIndex=0),s},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,s.createContext)(null);function ei(e){let t=(0,s.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 el=(0,s.createContext)(null);function er(e){var t;let n=ea("VirtualProvider"),[o,i]=(0,s.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]),l=function(e){let t=s.useReducer(()=>({}),{})[1],n={...e,onChange:(n,o)=>{var i;o?(0,a.flushSync)(t):t(),null==(i=e.onChange)||i.call(e,n,o)}},[o]=s.useState(()=>new R(n));return o.setOptions(n),s.useEffect(()=>o._didMount(),[]),S(()=>o._willUpdate()),o}({observeElementRect:v,observeElementOffset:g,scrollToFn:O,scrollPaddingStart:o,scrollPaddingEnd:i,count:n.virtual.options.length,estimateSize:()=>40,getScrollElement(){var e;return null!=(e=n.optionsRef.current)?e:null},overscan:12}),[r,u]=(0,s.useState)(0);return(0,z.e)(()=>{u(e=>e+1)},[null==(t=n.virtual)?void 0:t.options]),s.createElement(el.Provider,{value:l},s.createElement("div",{style:{position:"relative",width:"100%",height:"".concat(l.getTotalSize(),"px")},ref:e=>{e&&(void 0===J||void 0===J.env.JEST_WORKER_ID)&&0!==n.activationTrigger&&null!==n.activeOptionIndex&&n.virtual.options.length>n.activeOptionIndex&&l.scrollToIndex(n.activeOptionIndex)}},l.getVirtualItems().map(t=>{var o;return s.createElement(s.Fragment,{key:t.key},s.cloneElement(null==(o=e.children)?void 0:o.call(e,{option:n.virtual.options[t.index],open:0===n.comboboxState}),{key:"".concat(r,"-").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 es=(0,s.createContext)(null);function ea(e){let t=(0,s.useContext)(es);if(null===t){let t=Error("<".concat(e," /> is missing a parent <Combobox /> component."));throw Error.captureStackTrace&&Error.captureStackTrace(t,ea),t}return t}function eu(e,t){return(0,Y.E)(t.type,en,e,t)}es.displayName="ComboboxDataContext";let ec=s.Fragment,ed=Z.AN.RenderStrategy|Z.AN.Static,ep=(0,Z.yV)(function(e,t){let{value:n,defaultValue:o,onChange:i,form:l,name:r,by:a=null,disabled:u=!1,__demoMode:c=!1,nullable:d=!1,multiple:p=!1,immediate:h=!1,virtual:f=null,...v}=e,[b=p?[]:void 0,m]=(0,T.q)(n,i,o),[g,x]=(0,s.useReducer)(eu,{dataRef:(0,s.createRef)(),comboboxState:c?0:1,options:[],virtual:null,activeOptionIndex:null,activationTrigger:2,labelId:null}),O=(0,s.useRef)(!1),R=(0,s.useRef)({static:!1,hold:!1}),I=(0,s.useRef)(null),S=(0,s.useRef)(null),C=(0,s.useRef)(null),M=(0,s.useRef)(null),w=(0,y.z)("string"==typeof a?(e,t)=>(null==e?void 0:e[a])===(null==t?void 0:t[a]):null!=a?a:(e,t)=>e===t),k=(0,y.z)(e=>g.options.findIndex(t=>w(t.dataRef.current.value,e))),A=(0,s.useCallback)(e=>(0,Y.E)(D.mode,{1:()=>b.some(t=>w(t,e)),0:()=>w(b,e)}),[b]),F=(0,y.z)(e=>g.activeOptionIndex===k(e)),D=(0,s.useMemo)(()=>({...g,immediate:!1,optionsPropsRef:R,labelRef:I,inputRef:S,buttonRef:C,optionsRef:M,value:b,defaultValue:o,disabled:u,mode:p?1:0,virtual:g.virtual,get activeOptionIndex(){if(O.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:k,compare:w,isSelected:A,isActive:F,nullable:d,__demoMode:c}),[b,o,u,p,d,c,g,null]);(0,z.e)(()=>{},[null,void 0]),(0,z.e)(()=>{g.dataRef.current=D},[D]),(0,P.O)([D.buttonRef,D.inputRef,D.optionsRef],()=>Q.closeCombobox(),0===D.comboboxState);let _=(0,s.useMemo)(()=>{var e,t,n;return{open:0===D.comboboxState,disabled:u,activeIndex:D.activeOptionIndex,activeOption:null===D.activeOptionIndex?null:D.virtual?D.virtual.options[null!=(e=D.activeOptionIndex)?e:0]:null!=(n=null==(t=D.options[D.activeOptionIndex])?void 0:t.dataRef.current.value)?n:null,value:b}},[D,u,b]),L=(0,y.z)(()=>{if(null!==D.activeOptionIndex){if(D.virtual)H(D.virtual.options[D.activeOptionIndex]);else{let{dataRef:e}=D.options[D.activeOptionIndex];H(e.current.value)}Q.goToOption(W.T.Specific,D.activeOptionIndex)}}),B=(0,y.z)(()=>{x({type:0}),O.current=!0}),N=(0,y.z)(()=>{x({type:1}),O.current=!1}),U=(0,y.z)((e,t,n)=>(O.current=!1,e===W.T.Specific?x({type:2,focus:W.T.Specific,idx:t,trigger:n}):x({type:2,focus:e,trigger:n}))),q=(0,y.z)((e,t)=>(x({type:3,payload:{id:e,dataRef:t}}),()=>{D.isActive(t.current.value)&&(O.current=!0),x({type:4,id:e})})),G=(0,y.z)(e=>(x({type:5,id:e}),()=>x({type:5,id:null}))),H=(0,y.z)(e=>(0,Y.E)(D.mode,{0:()=>null==m?void 0:m(e),1(){let t=D.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)}})),J=(0,y.z)(e=>{x({type:6,trigger:e})}),Q=(0,s.useMemo)(()=>({onChange:H,registerOption:q,registerLabel:G,goToOption:U,closeCombobox:N,openCombobox:B,setActivationTrigger:J,selectActiveOption:L}),[]),X=(0,s.useRef)(null),$=(0,E.G)();return(0,s.useEffect)(()=>{X.current&&void 0!==o&&$.addEventListener(X.current,"reset",()=>{null==m||m(o)})},[X,m]),s.createElement(eo.Provider,{value:Q},s.createElement(es.Provider,{value:D},s.createElement(j.up,{value:(0,Y.E)(D.comboboxState,{0:j.ZM.Open,1:j.ZM.Closed})},null!=r&&null!=b&&(0,K.t)({[r]:b}).map((e,t)=>{let[n,o]=e;return s.createElement(V._,{features:V.A.Hidden,ref:0===t?e=>{var t;X.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:l,disabled:u,name:n,value:o})})}),(0,Z.sY)({ourProps:null===t?{}:{ref:t},theirProps:v,slot:_,defaultTag:ec,name:"Combobox"}))))}),eh=(0,Z.yV)(function(e,t){var n;let o=ea("Combobox.Button"),i=ei("Combobox.Button"),l=(0,F.T)(o.buttonRef,t),r=(0,M.M)(),{id:a="headlessui-combobox-button-".concat(r),...u}=e,c=(0,E.G)(),d=(0,y.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(W.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,y.z)(e=>{if((0,N.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})})}),h=(0,C.v)(()=>{if(o.labelId)return[o.labelId,a].join(" ")},[o.labelId,a]),f=(0,s.useMemo)(()=>({open:0===o.comboboxState,disabled:o.disabled,value:o.value}),[o]),v={ref:l,id:a,type:(0,A.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":h,disabled:o.disabled,onClick:p,onKeyDown:d};return(0,Z.sY)({ourProps:v,theirProps:u,slot:f,defaultTag:"button",name:"Combobox.Button"})}),ef=Object.assign(ep,{Input:(0,Z.yV)(function(e,t){var n,o,i,l,r,a;let u=(0,M.M)(),{id:c="headlessui-combobox-input-".concat(u),onChange:d,displayValue:p,type:h="text",...f}=e,v=ea("Combobox.Input"),b=ei("Combobox.Input"),m=(0,F.T)(v.inputRef,t),g=(0,k.i)(v.inputRef),x=(0,s.useRef)(!1),O=(0,E.G)(),R=(0,y.z)(()=>{b.onChange(null),v.optionsRef.current&&(v.optionsRef.current.scrollTop=0),b.goToOption(W.T.Nothing)}),I="function"==typeof p&&void 0!==v.value?null!=(a=p(v.value))?a:"":"string"==typeof v.value?v.value:"";(0,L.q)((e,t)=>{let[n,o]=e,[i,l]=t;if(x.current)return;let r=v.inputRef.current;r&&((0===l&&1===o||n!==i)&&(r.value=n),requestAnimationFrame(()=>{if(x.current||!r||(null==g?void 0:g.activeElement)!==r)return;let{selectionStart:e,selectionEnd:t}=r;0===Math.abs((null!=t?t:0)-(null!=e?e:0))&&0===e&&r.setSelectionRange(r.value.length,r.value.length)}))},[I,v.comboboxState,g]),(0,L.q)((e,t)=>{let[n]=e,[o]=t;if(0===n&&1===o){if(x.current)return;let e=v.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)}},[v.comboboxState]);let S=(0,s.useRef)(!1),T=(0,y.z)(()=>{S.current=!0}),z=(0,y.z)(()=>{O.nextFrame(()=>{S.current=!1})}),w=(0,y.z)(e=>{switch(x.current=!0,e.key){case H.R.Enter:if(x.current=!1,0!==v.comboboxState||S.current)return;if(e.preventDefault(),e.stopPropagation(),null===v.activeOptionIndex){b.closeCombobox();return}b.selectActiveOption(),0===v.mode&&b.closeCombobox();break;case H.R.ArrowDown:return x.current=!1,e.preventDefault(),e.stopPropagation(),(0,Y.E)(v.comboboxState,{0:()=>b.goToOption(W.T.Next),1:()=>b.openCombobox()});case H.R.ArrowUp:return x.current=!1,e.preventDefault(),e.stopPropagation(),(0,Y.E)(v.comboboxState,{0:()=>b.goToOption(W.T.Previous),1:()=>{b.openCombobox(),O.nextFrame(()=>{v.value||b.goToOption(W.T.Last)})}});case H.R.Home:if(e.shiftKey)break;return x.current=!1,e.preventDefault(),e.stopPropagation(),b.goToOption(W.T.First);case H.R.PageUp:return x.current=!1,e.preventDefault(),e.stopPropagation(),b.goToOption(W.T.First);case H.R.End:if(e.shiftKey)break;return x.current=!1,e.preventDefault(),e.stopPropagation(),b.goToOption(W.T.Last);case H.R.PageDown:return x.current=!1,e.preventDefault(),e.stopPropagation(),b.goToOption(W.T.Last);case H.R.Escape:return x.current=!1,0!==v.comboboxState?void 0:(e.preventDefault(),v.optionsRef.current&&!v.optionsPropsRef.current.static&&e.stopPropagation(),v.nullable&&0===v.mode&&null===v.value&&R(),b.closeCombobox());case H.R.Tab:if(x.current=!1,0!==v.comboboxState)return;0===v.mode&&1!==v.activationTrigger&&b.selectActiveOption(),b.closeCombobox()}}),P=(0,y.z)(e=>{null==d||d(e),v.nullable&&0===v.mode&&""===e.target.value&&R(),b.openCombobox()}),A=(0,y.z)(e=>{var t,n,o;let i=null!=(t=e.relatedTarget)?t:B.m.find(t=>t!==e.currentTarget);if(x.current=!1,!(null!=(n=v.optionsRef.current)&&n.contains(i))&&!(null!=(o=v.buttonRef.current)&&o.contains(i))&&0===v.comboboxState)return e.preventDefault(),0===v.mode&&(v.nullable&&null===v.value?R():1!==v.activationTrigger&&b.selectActiveOption()),b.closeCombobox()}),D=(0,y.z)(e=>{var t,n,o;let i=null!=(t=e.relatedTarget)?t:B.m.find(t=>t!==e.currentTarget);null!=(n=v.buttonRef.current)&&n.contains(i)||null!=(o=v.optionsRef.current)&&o.contains(i)||v.disabled||v.immediate&&0!==v.comboboxState&&(b.openCombobox(),O.nextFrame(()=>{b.setActivationTrigger(1)}))}),_=(0,C.v)(()=>{if(v.labelId)return[v.labelId].join(" ")},[v.labelId]),V=(0,s.useMemo)(()=>({open:0===v.comboboxState,disabled:v.disabled}),[v]),j={ref:m,id:c,role:"combobox",type:h,"aria-controls":null==(n=v.optionsRef.current)?void 0:n.id,"aria-expanded":0===v.comboboxState,"aria-activedescendant":null===v.activeOptionIndex?void 0:v.virtual?null==(o=v.options.find(e=>{var t;return!(null!=(t=v.virtual)&&t.disabled(e.dataRef.current.value))&&v.compare(e.dataRef.current.value,v.virtual.options[v.activeOptionIndex])}))?void 0:o.id:null==(i=v.options[v.activeOptionIndex])?void 0:i.id,"aria-labelledby":_,"aria-autocomplete":"list",defaultValue:null!=(r=null!=(l=e.defaultValue)?l:void 0!==v.defaultValue?null==p?void 0:p(v.defaultValue):null)?r:v.defaultValue,disabled:v.disabled,onCompositionStart:T,onCompositionEnd:z,onKeyDown:w,onChange:P,onFocus:D,onBlur:A};return(0,Z.sY)({ourProps:j,theirProps:f,slot:V,defaultTag:"input",name:"Combobox.Input"})}),Button:eh,Label:(0,Z.yV)(function(e,t){let n=(0,M.M)(),{id:o="headlessui-combobox-label-".concat(n),...i}=e,l=ea("Combobox.Label"),r=ei("Combobox.Label"),a=(0,F.T)(l.labelRef,t);(0,z.e)(()=>r.registerLabel(o),[o]);let u=(0,y.z)(()=>{var e;return null==(e=l.inputRef.current)?void 0:e.focus({preventScroll:!0})}),c=(0,s.useMemo)(()=>({open:0===l.comboboxState,disabled:l.disabled}),[l]);return(0,Z.sY)({ourProps:{ref:a,id:o,onClick:u},theirProps:i,slot:c,defaultTag:"label",name:"Combobox.Label"})}),Options:(0,Z.yV)(function(e,t){let n=(0,M.M)(),{id:o="headlessui-combobox-options-".concat(n),hold:i=!1,...l}=e,r=ea("Combobox.Options"),a=(0,F.T)(r.optionsRef,t),u=(0,j.oJ)(),c=null!==u?(u&j.ZM.Open)===j.ZM.Open:0===r.comboboxState;(0,z.e)(()=>{var t;r.optionsPropsRef.current.static=null!=(t=e.static)&&t},[r.optionsPropsRef,e.static]),(0,z.e)(()=>{r.optionsPropsRef.current.hold=i},[r.optionsPropsRef,i]),(0,_.B)({container:r.optionsRef.current,enabled:0===r.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,C.v)(()=>{var e,t;return null!=(t=r.labelId)?t:null==(e=r.buttonRef.current)?void 0:e.id},[r.labelId,r.buttonRef.current]),p=(0,s.useMemo)(()=>({open:0===r.comboboxState,option:void 0}),[r]),h={"aria-labelledby":d,role:"listbox","aria-multiselectable":1===r.mode||void 0,id:o,ref:a};return r.virtual&&0===r.comboboxState&&Object.assign(l,{children:s.createElement(er,null,l.children)}),(0,Z.sY)({ourProps:h,theirProps:l,slot:p,defaultTag:"ul",features:ed,visible:c,name:"Combobox.Options"})}),Option:(0,Z.yV)(function(e,t){var n;let o=(0,M.M)(),{id:i="headlessui-combobox-option-".concat(o),disabled:l=!1,value:r,order:a=null,...u}=e,c=ea("Combobox.Option"),d=ei("Combobox.Option"),p=c.virtual?c.activeOptionIndex===c.calculateIndex(r):null!==c.activeOptionIndex&&(null==(n=c.options[c.activeOptionIndex])?void 0:n.id)===i,h=c.isSelected(r),f=(0,s.useRef)(null),v=(0,w.E)({disabled:l,value:r,domRef:f,order:a}),b=(0,s.useContext)(el),m=(0,F.T)(t,f,b?b.measureElement:null),g=(0,y.z)(()=>d.onChange(r));(0,z.e)(()=>d.registerOption(i,v),[v,i]);let x=(0,s.useRef)(!(c.virtual||c.__demoMode));(0,z.e)(()=>{if(!c.virtual||!c.__demoMode)return;let e=(0,U.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,U.k)();return e.requestAnimationFrame(()=>{var e,t;null==(t=null==(e=f.current)?void 0:e.scrollIntoView)||t.call(e,{block:"nearest"})}),e.dispose},[f,p,c.comboboxState,c.activationTrigger,c.activeOptionIndex]);let O=(0,y.z)(e=>{var t;if(l||null!=(t=c.virtual)&&t.disabled(r))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())}),R=(0,y.z)(()=>{var e;if(l||null!=(e=c.virtual)&&e.disabled(r))return d.goToOption(W.T.Nothing);let t=c.calculateIndex(r);d.goToOption(W.T.Specific,t)}),I=(0,D.g)(),S=(0,y.z)(e=>I.update(e)),C=(0,y.z)(e=>{var t;if(!I.wasMoved(e)||l||null!=(t=c.virtual)&&t.disabled(r)||p)return;let n=c.calculateIndex(r);d.goToOption(W.T.Specific,n,0)}),T=(0,y.z)(e=>{var t;I.wasMoved(e)&&(l||null!=(t=c.virtual)&&t.disabled(r)||p&&(c.optionsPropsRef.current.hold||d.goToOption(W.T.Nothing)))}),E=(0,s.useMemo)(()=>({active:p,selected:h,disabled:l}),[p,h,l]);return(0,Z.sY)({ourProps:{id:i,ref:m,role:"option",tabIndex:!0===l?void 0:-1,"aria-disabled":!0===l||void 0,"aria-selected":h,disabled:void 0,onClick:O,onFocus:R,onPointerEnter:S,onMouseEnter:S,onPointerMove:C,onMouseMove:C,onPointerLeave:T,onMouseLeave:T},theirProps:u,slot:E,defaultTag:"li",name:"Combobox.Option"})})})},71584:function(e,t,n){n.d(t,{_:function(){return d},b:function(){return c}});var o=n(7653),i=n(62125),l=n(55281),r=n(11513),s=n(91335),a=n(8840);let u=(0,o.createContext)(null);function c(){let[e,t]=(0,o.useState)([]);return[e.length>0?e.join(" "):void 0,(0,o.useMemo)(()=>function(e){let n=(0,i.z)(e=>(t(t=>[...t,e]),()=>t(t=>{let n=t.slice(),o=n.indexOf(e);return -1!==o&&n.splice(o,1),n}))),l=(0,o.useMemo)(()=>({register:n,slot:e.slot,name:e.name,props:e.props}),[n,e.slot,e.name,e.props]);return o.createElement(u.Provider,{value:l},e.children)},[t])]}let d=Object.assign((0,a.yV)(function(e,t){let n=(0,l.M)(),{id:i="headlessui-label-".concat(n),passive:c=!1,...d}=e,p=function e(){let t=(0,o.useContext)(u);if(null===t){let t=Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,e),t}return t}(),h=(0,s.T)(t);(0,r.e)(()=>p.register(i),[i,p.register]);let f={ref:h,...p.props,id:i};return c&&("onClick"in f&&(delete f.htmlFor,delete f.onClick),"onClick"in d&&delete d.onClick),(0,a.sY)({ourProps:f,theirProps:d,slot:p.slot||{},defaultTag:"label",name:p.name||"Label"})}),{})}}]);
//# sourceMappingURL=2037-10ffab3ea31cfbc4.js.map