1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,762630,e=>{"use strict";let t,i,s,n,o;var l=e.i(783222),r=e.i(433336),a=e.i(271645),u=e.i(174080);function c(e,t,i){let s,n=i.initialDeps??[],o=!0;function l(){let l=e();return(l.length!==n.length||l.some((e,t)=>n[t]!==e))&&(n=l,s=t(...l),(null==i?void 0:i.onChange)&&!(o&&i.skipInitialOnChange)&&i.onChange(s),o=!1),s}return l.updateDeps=e=>{n=e},l}function d(e,t){if(void 0!==e)return e;throw Error(`Unexpected undefined${t?`: ${t}`:""}`)}e.i(247167);let h=(e,t)=>1.01>Math.abs(e-t),f=()=>{if(void 0!==t)return t;if("u"<typeof navigator)return t=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return t=!0;let e=navigator.maxTouchPoints;return t="MacIntel"===navigator.platform&&void 0!==e&&e>0},p=e=>{let{offsetWidth:t,offsetHeight:i}=e;return{width:t,height:i}},m=e=>e,g=e=>{let t=Math.max(e.startIndex-e.overscan,0),i=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,s=Array(i);for(let e=0;e<i;e++)s[e]=t+e;return s},v=(e,t)=>{let i=e.scrollElement;if(!i)return;let s=e.targetWindow;if(!s)return;let n=e=>{let{width:i,height:s}=e;t({width:Math.round(i),height:Math.round(s)})};if(n(p(i)),!s.ResizeObserver)return()=>{};let o=new s.ResizeObserver(t=>{let s=()=>{let e=t[0];if(null==e?void 0:e.borderBoxSize){let t=e.borderBoxSize[0];if(t)return void n({width:t.inlineSize,height:t.blockSize})}n(p(i))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s()});return o.observe(i,{box:"border-box"}),()=>{o.unobserve(i)}},b={passive:!0},S="u"<typeof window||"onscrollend"in window,x=(e,t)=>((e,t,i)=>{var s,n;let o,l=e.scrollElement;if(!l)return;let r=e.targetWindow;if(!r)return;let a=e.options.useScrollendEvent&&S,u=0,c=a?null:(s=()=>t(i(l),!1),n=e.options.isScrollingResetDelay,Object.assign(function(...e){r.clearTimeout(o),o=r.setTimeout(()=>s.apply(this,e),n)},{cancel:()=>{r.clearTimeout(o)}})),d=e=>()=>{u=i(l),null==c||c(),t(u,e)},h=d(!0),f=d(!1);return l.addEventListener("scroll",h,b),a&&l.addEventListener("scrollend",f,b),()=>{l.removeEventListener("scroll",h),a&&l.removeEventListener("scrollend",f),null==c||c.cancel()}})(e,t,t=>{let{horizontal:i,isRtl:s}=e.options;return i?t.scrollLeft*(s&&-1||1):t.scrollTop}),O=(e,t,i)=>{if(i.options.useCachedMeasurements){let t=i.indexFromElement(e),s=i.options.getItemKey(t);return i.itemSizeCache.get(s)??i.options.estimateSize(t)}if(null==t?void 0:t.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[i.options.horizontal?"inlineSize":"blockSize"])}if(!t){let t=i.indexFromElement(e),s=i.options.getItemKey(t),n=i.itemSizeCache.get(s);if(void 0!==n)return n}return e[i.options.horizontal?"offsetWidth":"offsetHeight"]},E=(e,{adjustments:t=0,behavior:i},s)=>{var n,o;null==(o=null==(n=s.scrollElement)?void 0:n.scrollTo)||o.call(n,{[s.options.horizontal?"left":"top"]:e+t,behavior:i})};class I{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this._clampedAdjustment=null,this.elementsCache=new Map,this.now=()=>{var e,t,i;return(null==(i=null==(t=null==(e=this.targetWindow)?void 0:e.performance)?void 0:t.now)?void 0:i.call(t))??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(this.targetWindow&&this.targetWindow.ResizeObserver?e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,i=this.indexFromElement(t);if(!t.isConnected){for(let[e,i]of(this.observer.unobserve(t),this.elementsCache))if(i===t){this.elementsCache.delete(e);break}return}this.isIndexInRange(i)&&this.shouldMeasureDuringScroll(i)&&this.resizeItem(i,this.options.measureElement(t,e,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}):null);return{disconnect:()=>{var i;null==(i=t())||i.disconnect(),e=null},observe:e=>{var i;return null==(i=t())?void 0:i.observe(e,{box:"border-box"})},unobserve:e=>{var i;return null==(i=t())?void 0:i.unobserve(e)}}})(),this.range=null,this.setOptions=e=>{var t;let i={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:m,rangeExtractor:g,onChange:()=>{},measureElement:O,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(let t in e){let s=e[t];void 0!==s&&(i[t]=s)}let s=this.options,n=null,o=null,l=!1;if(void 0!==s&&s.enabled&&i.enabled&&"end"===i.anchorTo&&null!==this.scrollElement){let e=s.count,r=i.count,a=this.getMeasurements(),u=(null==(t=this._singleLaneMeasurements)?void 0:t.items)??a,c=e=>{var t;
1return"object"==typeof(t=u[e])?t.key:t},d=e>0?c(0):null,h=e>0?c(e-1):null;if(r!==e||e>0&&r>0&&(i.getItemKey(0)!==d||i.getItemKey(r-1)!==h)){l=!0;let t=e>0?this.getVirtualItemForOffset(this.getScrollOffset())??a[0]:null;t&&(n=[t.key,this.getScrollOffset()-t.start]);let u=!0===i.followOnAppend?"auto":i.followOnAppend||null;u&&r>0&&this.isAtEnd(s.scrollEndThreshold)&&(0===e||i.getItemKey(r-1)!==h)&&(r>e||function(e,t,i,s){if(0===t)return!1;let n=s(0),o=new Set,l=0;for(;l<e;){let e=i(l);if(e===n)break;o.add(e),l++}let r=e-l;if(0===r||r>=t)return!1;for(let e=0;e<r;e++)if(s(e)!==i(l+e))return!1;for(let e=r;e<t;e++)if(o.has(s(e)))return!1;return!0}(e,r,c,i.getItemKey))&&(o=u)}}this.options=i,l&&(this.pendingMin=0,this.itemSizeCacheVersion++);let r=!1,a=0;if(n&&null!==this.scrollOffset){let[e,t]=n,i=this.getMeasurements(),{count:s,getItemKey:l}=this.options,u=0;for(;u<s&&l(u)!==e;)u++;if(u<s){let e=i[u];if(e){let i=Math.max(0,e.start+t);o||i===this.scrollOffset||(a=i-this.scrollOffset,this.scrollOffset=i,r=!0)}}}(r||o)&&(this.pendingScrollAnchor=[r?n[0]:null,r?n[1]:0,o,a])},this.notify=e=>{var t,i;null==(i=(t=this.options).onChange)||i.call(t,this,e)},this.maybeNotify=c(()=>(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(),null!=this.rafId&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.isScrolling=!1,this.scrollDirection=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._clampedAdjustment=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e,t;let i=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==i){if(this.cleanup(),!i)return void this.maybeNotify();if(this.scrollElement=i,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=(null==(e=this.scrollElement)?void 0:e.window)??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{if(t&&null===this._intendedScrollOffset&&e===this.scrollOffset)return;null!==this._intendedScrollOffset&&1.5>Math.abs(e-this._intendedScrollOffset)&&(e=this._intendedScrollOffset),this._intendedScrollOffset=null,null!==this._clampedAdjustment&&Math.abs(e-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null),this.scrollAdjustments=0;let i=this.getScrollOffset();this.scrollDirection=t?i===e?this.scrollDirection:i<e?"forward":"backward":null,this.scrollOffset=e,this.isScrolling=t,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){let e=this.scrollElement,t=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,null!==this._iosTouchEndTimerId&&null!=this.targetWindow&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},i=()=>{this._iosTouching=!1,f()&&null!=this.targetWindow&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};e.addEventListener("touchstart",t,b),e.addEventListener("touchend",i,b),this.unsubs.push(()=>{e.removeEventListener("touchstart",t),e.removeEventListener("touchend",i),null!==this._iosTouchEndTimerId&&null!=this.targetWindow&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}let s=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,s&&this.scrollElement&&this.options.enabled){let[e,i,n,o]=s;
1null!==e&&!n&&(f()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?0!==o&&(this._iosDeferredAdjustment+=o):((null==(t=this.scrollState)?void 0:t.behavior)!=="smooth"||h(this.getScrollOffset()-o,this.scrollState.lastTargetOffset))&&this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),n&&this.scrollToEnd({behavior:n})}this._retryClampedAdjustment()},this._retryClampedAdjustment=()=>{if(null===this._clampedAdjustment||!this.scrollElement||!this.options.enabled)return;let{target:e,maxAtWrite:t}=this._clampedAdjustment,i=this.getMaxScrollOffset();i>t+.5&&(this._clampedAdjustment=e>i+.5?{target:e,maxAtWrite:i}:null,this._scrollToOffset(e,{adjustments:void 0,behavior:void 0}))},this._flushIosDeferredIfReady=()=>{if(0===this._iosDeferredAdjustment||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;let e=this.getScrollOffset(),t=this.getMaxScrollOffset();if(e<0||e>t)return;if(this._iosDeferredAdjustment<0&&e>=t-1){this._iosDeferredAdjustment=0;return}let i=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(e,{adjustments:this.scrollAdjustments+=i,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??("function"==typeof this.options.initialOffset?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=c(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(e,t,i,s,n,o,l,r)=>(void 0!==this.prevLanes&&this.prevLanes!==o&&(this.lanesChangedFlag=!0),this.prevLanes=o,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:i,getItemKey:s,enabled:n,lanes:o,laneAssignmentMode:l,gap:r}),{key:!1}),this.isIndexInRange=e=>e>=0&&e<this.options.count,this.getMeasurements=c(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:i,getItemKey:s,enabled:n,lanes:o,laneAssignmentMode:l,gap:r},a)=>{var u,c;let d=this.itemSizeCache;if(!n)return this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),0!==this.measurementsCache.length||this.lanesSettling||(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let h=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),1===o){let n,o,l=2*e,a=null==(u=this._singleLaneMeasurements)?void 0:u.flat;if(!a||a.length<l){let e=new Float64Array(l);a&&h>0&&e.set(a.subarray(0,2*h)),a=e}let f=0===h?Array(e):this._singleLaneMeasurements.items.slice();if(0===h)n=t+i;else{let e=h-1;n=a[2*e]+a[2*e+1]+r}for(let t=h;t<e;t++){let e=s(t);f[t]=e;let i=d.get(e),o="number"==typeof i?i:this.options.estimateSize(t);a[2*t]=n,a[2*t+1]=o,n+=o+r}this._singleLaneMeasurements={flat:a,items:f};let p=(c=a,o=f.length,new Proxy(f,{get(e,t,i){if("string"==typeof t){let i=t.charCodeAt(0);if(i>=48&&i<=57){let i=+t;if(Number.isInteger(i)&&i>=0&&i<o){let t=e[i];if("object"!=typeof t){let s=c[2*i];t=e[i]={index:i,key:t,start:s,size:c[2*i+1],end:s+c[2*i+1],lane:0}}return t}}if("length"===t)return o}return Reflect.get(e,t,i)}}));return this.measurementsCache=p,p}let f=this.measurementsCache.slice(0,h),p=Array(o).fill(void 0),m=new Float64Array(o),g=0;for(let e=0;e<h;e++){let t=f[e];t&&(void 0===p[t.lane]&&g++,p[t.lane]=e,m[t.lane]=t.end)}for(let n=h;n<e;n++){let e,a,u=s(n),c=this.laneAssignments.get(n),h="estimate"===l||d.has(u);if(void 0!==c&&this.options.lanes>1){let s=p[e=c],n=void 0!==s?f[s]:void 0;a=n?n.end+r:t+i}else if(g===o){let t=0,i=m[0],s=p[0];for(let e=1;e<o;e++){let n=m[e];(n<i||n===i&&p[e]<s)&&(t=e,i=n,s=p[e])}e=t,a=i+r,h&&this.laneAssignments.set(n,e)}else e=n%this.options.lanes,a=t+i,h&&this.laneAssignments.set(n,e);let v=d.get(u),b="number"==typeof v?v:this.options.estimateSize(n),S=a+b;f[n]={index:n,start:a,size:b,end:S,key:u,lane:e},void 0===p[e]&&g++,p[e]=n,m[e]=S}return this.measurementsCache=f,f},{key:!1,debug:()=>this.options.debug}),this.calculateRange=c(()=>
1[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,i,s)=>0===e.length||0===t?(this.range=null,null):(this.range=function(e,t,i,s,n){let o=e.length-1;if(e.length<=s)return{startIndex:0,endIndex:o};if(1===s&&null!==n){let e=function(e,t,i){let s=0;for(;s<=t;){let n=(s+t)/2|0,o=e[2*n];if(o<i)s=n+1;else{if(!(o>i))return n;t=n-1}}return s>0?s-1:0}(n,o,i),s=e,l=i+t;for(;s<o&&n[2*s]+n[2*s+1]<l;)s++;return{startIndex:e,endIndex:s}}let l=T(0,o,t=>e[t].start,i),r=l;if(1===s)for(;r<o&&e[r].end<i+t;)r++;else if(s>1){let n=Array(s).fill(0);for(;r<o&&n.some(e=>e<i+t);){let t=e[r];n[t.lane]=t.end,r++}let a=Array(s).fill(i+t);for(;l>=0&&a.some(e=>e>=i);){let t=e[l];a[t.lane]=t.start,l--}l=Math.max(0,l-l%s),r=Math.min(o,r+(s-1-r%s))}return{startIndex:l,endIndex:r}}(e,t,i,s,1===s&&null!==this._singleLaneMeasurements?this._singleLaneMeasurements.flat:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=c(()=>{let e=null,t=null,i=this.calculateRange();return i&&(e=i.startIndex,t=i.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,i,s,n)=>null===s||null===n?[]:e({startIndex:s,endIndex:n,overscan:t,count:i}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,i=e.getAttribute(t);return i?parseInt(i,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{var t;if(!this.scrollState||"smooth"!==this.scrollState.behavior)return!0;let i=this.scrollState.index??(null==(t=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))?void 0:t.index);if(void 0!==i&&this.range){let t=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),s=Math.max(0,i-t),n=Math.min(this.options.count-1,i+t);return e>=s&&e<=n}return!0},this.measureElement=e=>{if(!e)return void this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});let t=this.indexFromElement(e);if(!this.isIndexInRange(t))return;let i=this.options.getItemKey(t),s=this.elementsCache.get(i);s!==e&&(s&&this.observer.unobserve(s),this.observer.observe(e),this.elementsCache.set(i,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{var i,s,n;let o,l,r;if(!this.isIndexInRange(e))return;let a=null==(i=this._singleLaneMeasurements)?void 0:i.flat;if(1===this.options.lanes&&null!=a)r=this.options.getItemKey(e),l=a[2*e],o=a[2*e+1];else{let t=this.measurementsCache[e];if(!t)return;r=t.key,l=t.start,o=t.size}let u=this.itemSizeCache.get(r)??o,c=t-u;if(0!==c){let i="end"===this.options.anchorTo&&(null==(s=this.scrollState)?void 0:s.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,a=i?this.getTotalSize():0,d=this.getScrollOffset()+this.scrollAdjustments,h=this.itemSizeCache.has(r)?l+u<=d&&"backward"!==this.scrollDirection:l<d,f=(null==(n=this.scrollState)?void 0:n.behavior)!=="smooth"&&(void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:r,start:l,size:o,end:l+o,lane:0},c,this):h);(null===this.pendingMin||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(r,t),this.itemSizeCacheVersion++;let p=!1;i?p=this.applyScrollAdjustment(this.getTotalSize()-a):f&&(p=this.applyScrollAdjustment(c)),this.notify(p),this._retryClampedAdjustment()}},this.getVirtualItems=c(()=>
1[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let i=[];for(let s=0,n=e.length;s<n;s++){let n=t[e[s]];i.push(n)}return i},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{var t;let i=this.getMeasurements();if(0===i.length)return;let s=null==(t=this._singleLaneMeasurements)?void 0:t.flat,n=1===this.options.lanes&&null!=s,o=T(0,i.length-1,n?e=>s[2*e]:e=>d(i[e]).start,e);return d(i[o])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,t,i=0)=>{if(!this.scrollElement)return 0;let s=this.getSize(),n=this.getScrollOffset();return"auto"===t&&(t=e>=n+s?"end":"start"),"center"===t?e+=(i-s)/2:"end"===t&&(e-=s),Math.max(Math.min(this.getMaxScrollOffset(),e),0)},this.getOffsetForIndex=(e,t="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));let i=this.getSize(),s=this.getScrollOffset(),n=this.measurementsCache[e];if(!n)return;if("auto"===t)if(n.end>=s+i-this.options.scrollPaddingEnd)t="end";else{if(!(n.start<=s+this.options.scrollPaddingStart))return[s,t];t="start"}if("end"===t&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let o="end"===t?n.end+this.options.scrollPaddingEnd:n.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(o,t,n.size),t]},this.scrollToOffset=(e,{align:t="start",behavior:i="auto"}={})=>{this._iosDeferredAdjustment=0;let s=this.getOffsetForAlignment(e,t),n=this.now();this.scrollState={index:null,align:t,behavior:i,startedAt:n,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t="auto",behavior:i="auto"}={})=>{this._iosDeferredAdjustment=0,e=Math.max(0,Math.min(e,this.options.count-1));let s=this.getOffsetForIndex(e,t);if(!s)return;let[n,o]=s,l=this.now();this.scrollState={index:e,align:o,behavior:i,startedAt:l,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t="auto"}={})=>{let i=this.getScrollOffset()+e,s=this.now();this.scrollState={index:null,align:"start",behavior:t,startedAt:s,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:e="auto"}={})=>{this.options.count>0?this.scrollToIndex(this.options.count-1,{align:"end",behavior:e}):this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.getTotalSize=()=>{var e,t;let i,s=this.getMeasurements();if(0===s.length)i=this.options.paddingStart;else if(1===this.options.lanes){let n=s.length-1,o=null==(e=this._singleLaneMeasurements)?void 0:e.flat;i=null!=o?o[2*n]+o[2*n+1]:(null==(t=s[n])?void 0:t.end)??0}else{let e=Array(this.options.lanes).fill(null),t=s.length-1;for(;t>=0&&e.some(e=>null===e);){let i=s[t];null===e[i.lane]&&(e[i.lane]=i.end),t--}i=Math.max(...e.filter(e=>null!==e))}return Math.max(i-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let e=[];
1if(0===this.itemSizeCache.size)return e;for(let t of this.getMeasurements())t&&this.itemSizeCache.has(t.key)&&e.push({index:t.index,key:t.key,start:t.start,size:t.size,end:t.end,lane:t.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:i})=>{this._intendedScrollOffset=e+(t??0),this.options.scrollToFn(e,{behavior:i,adjustments:t},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}applyScrollAdjustment(e,t){if(0===e)return!1;if(f()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded))return this._iosDeferredAdjustment+=e,!1;{let i=this.getScrollOffset()+this.scrollAdjustments+e,s=this.scrollElement,n=null!==s&&("scrollHeight"in s||"document"in s)?this.getMaxScrollOffset():null;return this._clampedAdjustment=null!==n&&i>n+.5?{target:i,maxAtWrite:n}:null,this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=e,behavior:t}),null!==this.scrollOffset&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0}}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}null==this.rafId&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=null!=this.scrollState.index?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,t=e?e[0]:this.scrollState.lastTargetOffset,i=t!==this.scrollState.lastTargetOffset;if(!i&&h(t,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.getScrollOffset()!==t&&this._scrollToOffset(t,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,i){let e=this.getSize()||600,i=Math.abs(t-this.getScrollOffset()),s="smooth"===this.scrollState.behavior&&i>e;this.scrollState.lastTargetOffset=t,s||(this.scrollState.behavior="auto"),this._scrollToOffset(t,{adjustments:void 0,behavior:s?"smooth":"auto"})}this.scheduleScrollReconcile()}}let T=(e,t,i,s)=>{for(;e<=t;){let n=(e+t)/2|0,o=i(n);if(o<s)e=n+1;else{if(!(o>s))return n;t=n-1}}return e>0?e-1:0},y="u">typeof document?a.useLayoutEffect:a.useEffect;var C=e.i(394487),M=e.i(436289),A=e.i(503269),R=e.i(214520),_=e.i(746725),w=e.i(992704),F=e.i(914189),P=e.i(488374),z=e.i(684653),D=e.i(835696),k=e.i(941444),j=e.i(877891),L=e.i(952744),W=e.i(605083),V=e.i(157138),K=e.i(813581),B=e.i(402155),$=e.i(693456);function H(e){let t=(0,a.useRef)({value:"",selectionStart:null,selectionEnd:null});return(0,$.useEventListener)(e,"blur",e=>{let i=e.target;K.isHTMLInputElement(i)&&(t.current={value:i.value,selectionStart:i.selectionStart,selectionEnd:i.selectionEnd})}),(0,F.useEvent)(()=>{if(!(0,B.isActiveElement)(e)&&K.isHTMLInputElement(e)&&e.isConnected){if(e.focus({preventScroll:!0}),e.value!==t.current.value)e.setSelectionRange(e.value.length,e.value.length);else{let{selectionStart:i,selectionEnd:s}=t.current;null!==i&&null!==s&&e.setSelectionRange(i,s)}t.current={value:"",selectionStart:null,selectionEnd:null}}})}var N=e.i(144279),U=e.i(101852),J=e.i(255743),q=e.i(294316),G=e.i(571616),Q=e.i(83733),Y=e.i(150800),X=e.i(833633),Z=e.i(601893),ee=e.i(919751),et=e.i(140721),ei=e.i(904016),es=e.i(942803),en=e.i(233137),eo=e.i(341650),el=e.i(140407),er=e.i(103935),ea=e.i(65659),eu=e.i(544508),ec=e.i(397701),ed=e.i(309507),eh=e.i(700020),ef=e.i(35889),ep=e.i(998348),em=e.i(722678),eg=e.i(863516),ev=e.i(635307),eb=e.i(825720),eS=e.i(667310),ex=e.i(652265),eO=Object.defineProperty,eE=(e,t,i)=>{let s;return(s="symbol"!=typeof t?t+"":t)in e?eO(e,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[s]=i,i},eI=((i=eI||{})[i.Open=0]="Open",i[i.Closed=1]="Closed",i),eT=((s=eT||{})[s.Single=0]="Single",s[s.Multi=1]="Multi",s),ey=((n=ey||{})[n.Pointer=0]="Pointer",n[n.Focus=1]="Focus",n[n.Other=2]="Other",n),eC=((o=eC||{})[o.OpenCombobox=0]="OpenCombobox",o[o.CloseCombobox=1]="CloseCombobox",o[o.GoToOption=2]="GoToOption",o[o.SetTyping=3]="SetTyping",o[o.RegisterOption=4]="RegisterOption",o[o.UnregisterOption=5]="UnregisterOption",o[o.DefaultToFirstOption=6]="DefaultToFirstOption",o[o.SetActivationTrigger=7]="SetActivationTrigger",o[o.UpdateVirtualConfiguration=8]="UpdateVirtualConfiguration",o[o.SetInputElement=9]="SetInputElement",o[o.SetButtonElement=10]="SetButtonElement",o[o.SetOptionsElement=11]="SetOptionsElement",o[o.MarkInputAsMoved=12]="MarkInputAsMoved",o);function eM(e,t=e=>e){let i=null!==e.activeOptionIndex?e.options[e.activeOptionIndex]:null,
1s=t(e.options.slice()),n=s.length>0&&null!==s[0].dataRef.current.order?s.sort((e,t)=>e.dataRef.current.order-t.dataRef.current.order):(0,ex.sortByDomNode)(s,e=>e.dataRef.current.domRef.current),o=i?n.indexOf(i):null;return -1===o&&(o=null),{options:n,activeOptionIndex:o}}let eA={1(e){var t;if(null!=(t=e.dataRef.current)&&t.disabled||1===e.comboboxState)return e;let i=e.inputElement?eS.ElementPositionState.Tracked((0,eS.computeVisualPosition)(e.inputElement)):e.inputPositionState;return{...e,activeOptionIndex:null,comboboxState:1,isTyping:!1,activationTrigger:2,inputPositionState:i,__demoMode:!1}},0(e){var t,i;if(null!=(t=e.dataRef.current)&&t.disabled||0===e.comboboxState)return e;if(null!=(i=e.dataRef.current)&&i.value){let t=e.dataRef.current.calculateIndex(e.dataRef.current.value);if(-1!==t)return{...e,activeOptionIndex:t,comboboxState:0,__demoMode:!1,inputPositionState:eS.ElementPositionState.Idle}}return{...e,comboboxState:0,inputPositionState:eS.ElementPositionState.Idle,__demoMode:!1}},3:(e,t)=>e.isTyping===t.isTyping?e:{...e,isTyping:t.isTyping},2(e,t){var i,s,n,o;if(null!=(i=e.dataRef.current)&&i.disabled||e.optionsElement&&!(null!=(s=e.dataRef.current)&&s.optionsPropsRef.current.static)&&1===e.comboboxState)return e;if(e.virtual){let{options:i,disabled:s}=e.virtual,o=t.focus===ea.Focus.Specific?t.idx:(0,ea.calculateActiveIndex)(t,{resolveItems:()=>i,resolveActiveIndex:()=>{var t,n;return null!=(n=null!=(t=e.activeOptionIndex)?t:i.findIndex(e=>!s(e)))?n:null},resolveDisabled:s,resolveId(){throw Error("Function not implemented.")}}),l=null!=(n=t.trigger)?n:2;return e.activeOptionIndex===o&&e.activationTrigger===l?e:{...e,activeOptionIndex:o,activationTrigger:l,isTyping:!1,__demoMode:!1}}let l=eM(e);if(null===l.activeOptionIndex){let e=l.options.findIndex(e=>!e.dataRef.current.disabled);-1!==e&&(l.activeOptionIndex=e)}let r=t.focus===ea.Focus.Specific?t.idx:(0,ea.calculateActiveIndex)(t,{resolveItems:()=>l.options,resolveActiveIndex:()=>l.activeOptionIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled}),a=null!=(o=t.trigger)?o:2;return e.activeOptionIndex===r&&e.activationTrigger===a?e:{...e,...l,isTyping:!1,activeOptionIndex:r,activationTrigger:a,__demoMode:!1}},4:(e,t)=>{var i,s,n,o;if(null!=(i=e.dataRef.current)&&i.virtual)return{...e,options:[...e.options,t.payload]};let l=t.payload,r=eM(e,e=>(e.push(l),e));null===e.activeOptionIndex&&null!=(n=(s=e.dataRef.current).isSelected)&&n.call(s,t.payload.dataRef.current.value)&&(r.activeOptionIndex=r.options.indexOf(l));let a={...e,...r,activationTrigger:2};return null!=(o=e.dataRef.current)&&o.__demoMode&&void 0===e.dataRef.current.value&&(a.activeOptionIndex=0),a},5:(e,t)=>{var i;if(null!=(i=e.dataRef.current)&&i.virtual)return{...e,options:e.options.filter(e=>e.id!==t.id)};let s=eM(e,e=>{let i=e.findIndex(e=>e.id===t.id);return -1!==i&&e.splice(i,1),e});return{...e,...s,activationTrigger:2}},6:(e,t)=>e.defaultToFirstOption===t.value?e:{...e,defaultToFirstOption:t.value},7:(e,t)=>e.activationTrigger===t.trigger?e:{...e,activationTrigger:t.trigger},8:(e,t)=>
1{var i,s;if(null===e.virtual)return{...e,virtual:{options:t.options,disabled:null!=(i=t.disabled)?i:()=>!1}};if(e.virtual.options===t.options&&e.virtual.disabled===t.disabled)return e;let n=e.activeOptionIndex;if(null!==e.activeOptionIndex){let i=t.options.indexOf(e.virtual.options[e.activeOptionIndex]);n=-1!==i?i:null}return{...e,activeOptionIndex:n,virtual:{options:t.options,disabled:null!=(s=t.disabled)?s:()=>!1}}},9:(e,t)=>e.inputElement===t.element?e:{...e,inputElement:t.element},10:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},11:(e,t)=>e.optionsElement===t.element?e:{...e,optionsElement:t.element},12:e=>"Tracked"!==e.inputPositionState.kind?e:{...e,inputPositionState:eS.ElementPositionState.Moved}};class eR extends eb.Machine{constructor(e){super(e),eE(this,"actions",{onChange:e=>{let{onChange:t,compare:i,mode:s,value:n}=this.state.dataRef.current;return(0,ec.match)(s,{0:()=>null==t?void 0:t(e),1:()=>{let s=n.slice(),o=s.findIndex(t=>i(t,e));return -1===o?s.push(e):s.splice(o,1),null==t?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}),null==(t=(e=this.state.dataRef.current).onClose)||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(null!==e){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:ea.Focus.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})}}),eE(this,"selectors",{activeDescendantId:e=>{var t,i;let s=this.selectors.activeOptionIndex(e);if(null!==s)return e.virtual?null==(i=e.options.find(t=>!t.dataRef.current.disabled&&e.dataRef.current.compare(t.dataRef.current.value,e.virtual.options[s])))?void 0:i.id:null==(t=e.options[s])?void 0:t.id},activeOptionIndex:e=>{if(e.defaultToFirstOption&&null===e.activeOptionIndex&&(e.virtual?e.virtual.options.length>0:e.options.length>0)){if(e.virtual){let{options:t,disabled:i}=e.virtual,s=t.findIndex(e=>{var t;return!(null!=(t=null==i?void 0:i(e))&&t)});if(-1!==s)return s}let t=e.options.findIndex(e=>!e.dataRef.current.disabled);if(-1!==t)return t}return e.activeOptionIndex},activeOption:e=>{var t,i;let s=this.selectors.activeOptionIndex(e);return null===s?null:e.virtual?e.virtual.options[null!=s?s:0]:null!=(i=null==(t=e.options[s])?void 0:t.dataRef.current.value)?i:null},isActive:(e,t,i)=>{var s;let n=this.selectors.activeOptionIndex(e);return null!==n&&(e.virtual?n===e.dataRef.current.calculateIndex(t):(null==(s=e.options[n])?void 0:s.id)===i)},shouldScrollIntoView:(e,t,i)=>!(e.virtual||e.__demoMode||0!==e.comboboxState||0===e.activationTrigger||!this.selectors.isActive(e,t,i)),didInputMove:e=>"Moved"===e.inputPositionState.kind});{let e=this.state.id,t=eo.stackMachines.get(null);this.disposables.add(t.on(eo.ActionTypes.Push,i=>{t.selectors.isTop(i,e)||0!==this.state.comboboxState||this.actions.closeCombobox()})),this.on(0,()=>t.actions.push(e)),this.on(1,()=>t.actions.pop(e))}this.disposables.group(e=>{this.on(1,t=>{t.inputElement&&(e.dispose(),e.add((0,eS.detectMovement)(t.inputElement,t.inputPositionState,()=>{this.send({type:12})})))})})}static new({id:e,virtual:t=null,__demoMode:i=!1}){var s;return new eR({id:e,dataRef:{current:{}},comboboxState:+!i,isTyping:!1,options:[],virtual:t?{options:t.options,disabled:null!=(s=t.disabled)?s:()=>!1}:null,activeOptionIndex:null,activationTrigger:2,inputElement:null,buttonElement:null,optionsElement:null,__demoMode:i,inputPositionState:eS.ElementPositionState.Idle})}reduce(e,t){return(0,ec.match)(t.type,eA,e,t)}}var e_=e.i(526599);let ew=(0,a.createContext)(null);function eF(e){let t=(0,a.useContext)(ew);if(null===t){let t=Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,eP),t}return t}function eP({id:e,virtual:t=null,__demoMode:i=!1}){let s=(0,a.useMemo)(()=>eR.new({id:e,virtual:t,__demoMode:i}),[]);return(0,e_.useOnUnmount)(()=>s.dispose()),s}let ez=(0,a.createContext)(null);function eD(e){let t=(0,a.useContext)(ez);if(null===t){let t=Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,eD),t}return t}ez.displayName="ComboboxDataContext";let ek=(0,a.createContext)(null);function ej(e){let t=eF("VirtualProvider"),{options:i}=eD("VirtualProvider").virtual,s=(0,el.useSlice)(t,e=>e.optionsElement),[n,o]=(0,a.useMemo)(()=>
1{if(!s)return[0,0];let e=window.getComputedStyle(s);return[parseFloat(e.paddingBlockStart||e.paddingTop),parseFloat(e.paddingBlockEnd||e.paddingBottom)]},[s]),l=function({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:i="transform",...s}){let n=a.useReducer(e=>e+1,0)[1],o=a.useRef({enabled:t,mode:i,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});o.current.enabled=t,o.current.mode=i;let l=a.useRef(!1),r=e=>{let t=o.current;if(!t.enabled||!t.container)return;let i=e.getTotalSize();if(i!==t.lastSize){t.lastSize=i;let s=e.options.horizontal?"width":"height";t.container.style[s]=`${i}px`}},c=e=>{let t=o.current;if(!t.enabled||!t.container)return;r(e);let i=!!e.options.horizontal,s="transform"===t.mode,n=i?"left":"top",l=e.options.scrollMargin;for(let o of e.getVirtualItems()){let r=o.start-l,a=e.elementsCache.get(o.key);a&&t.lastPositions.get(a)!==r&&(t.lastPositions.set(a,r),s?a.style.transform=i?`translate3d(${r}px, 0, 0)`:`translate3d(0, ${r}px, 0)`:a.style[n]=`${r}px`)}},d={...s,onChange:(t,i)=>{var r;let a=o.current,d=!0;if(a.enabled){c(t);let e=t.range,i=a.prevRange;(d=!i||i.isScrolling!==t.isScrolling||i.startIndex!==(null==e?void 0:e.startIndex)||i.endIndex!==(null==e?void 0:e.endIndex))&&(a.prevRange=e?{startIndex:e.startIndex,endIndex:e.endIndex,isScrolling:t.isScrolling}:null)}d&&(e&&i&&!l.current?(0,u.flushSync)(n):n()),null==(r=s.onChange)||r.call(s,t,i)}},[h]=a.useState(()=>{let e=new I(d),t=e.measureElement;return e.measureElement=e=>{l.current=!0;try{t(e)}finally{l.current=!1}},Object.assign(e,{containerRef:t=>{let i=o.current;if(i.container=t,i.lastSize=null,t&&i.enabled){let s=e.getTotalSize();i.lastSize=s;let n=e.options.horizontal?"width":"height";t.style[n]=`${s}px`}}})});return h.setOptions(d),y(()=>h._didMount(),[]),y(()=>(r(h),h._willUpdate())),y(()=>{c(h)}),h}({observeElementRect:v,observeElementOffset:x,scrollToFn:E,...{enabled:0!==i.length,scrollPaddingStart:n,scrollPaddingEnd:o,count:i.length,estimateSize:()=>40,getScrollElement:()=>t.state.optionsElement,overscan:12}}),[r,c]=(0,a.useState)(0);(0,D.useIsoMorphicEffect)(()=>{c(e=>e+1)},[i]);let d=l.getVirtualItems(),h=(0,el.useSlice)(t,e=>e.activationTrigger===ey.Pointer),f=(0,el.useSlice)(t,t.selectors.activeOptionIndex);return 0===d.length?null:a.default.createElement(ek.Provider,{value:l},a.default.createElement("div",{style:{position:"relative",width:"100%",height:`${l.getTotalSize()}px`},ref:e=>{e&&(h||null!==f&&i.length>f&&l.scrollToIndex(f))}},d.map(t=>{var s;return a.default.createElement(a.Fragment,{key:t.key},a.default.cloneElement(null==(s=e.children)?void 0:s.call(e,{...e.slot,option:i[t.index]}),{key:`${r}-${t.key}`,"data-index":t.index,"aria-setsize":i.length,"aria-posinset":t.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${t.start}px)`,overflowAnchor:"none"}}))})))}let eL=a.Fragment,eW=eh.RenderFeatures.RenderStrategy|eh.RenderFeatures.Static,eV=(0,eh.forwardRefWithAs)(function(e,t){let i=(0,a.useId)(),s=(0,Z.useDisabled)(),{value:n,defaultValue:o,onChange:l,form:r,name:u,by:c,invalid:d=!1,disabled:h=s||!1,onClose:f,__demoMode:p=!1,multiple:m=!1,immediate:g=!1,virtual:v=null,nullable:b,...S}=e,x=(0,R.useDefaultValue)(o),[O=m?[]:void 0,E]=(0,A.useControllable)(n,l,x),I=eP({id:i,virtual:v,__demoMode:p}),T=(0,a.useRef)({static:!1,hold:!1}),y=(0,M.useByComparator)(c),C=(0,F.useEvent)(e=>v?null===c?v.options.indexOf(e):v.options.findIndex(t=>y(t,e)):I.state.options.findIndex(t=>y(t.dataRef.current.value,e))),_=(0,a.useCallback)(e=>(0,ec.match)(z.mode,{[eT.Multi]:()=>O.some(t=>y(t,e)),[eT.Single]:()=>y(O,e)}),[O]),w=(0,el.useSlice)(I,e=>e.virtual),P=(0,F.useEvent)(()=>null==f?void 0:f()),z=(0,a.useMemo)(()=>({__demoMode:p,immediate:g,optionsPropsRef:T,value:O,defaultValue:x,disabled:h,invalid:d,mode:m?eT.Multi:eT.Single,virtual:v?w:null,onChange:E,isSelected:_,calculateIndex:C,compare:y,onClose:P}),[p,g,T,O,x,h,d,m,v,w,E,_,C,y,P]);(0,D.useIsoMorphicEffect)(()=>{var e;v&&I.send({type:eC.UpdateVirtualConfiguration,options:v.options,disabled:null!=(e=v.disabled)?e:null})},[v,null==v?void 0:v.options,null==v?void 0:v.disabled]),(0,D.useIsoMorphicEffect)(()=>{I.state.dataRef.current=z},[z]);let[k,j,W,V]=(0,el.useSlice)(I,e=>[e.comboboxState,e.buttonElement,e.inputElement,e.optionsElement]),K=eo.stackMachines.get(null),B=(0,el.useSlice)(K,(0,a.useCallback)(e=>K.selectors.isTop(e,i),[K,i]));(0,L.useOutsideClick)(B,[j,W,V],()=>I.actions.closeCombobox());let $=(0,el.useSlice)(I,I.selectors.activeOptionIndex),H=(0,el.useSlice)(I,I.selectors.activeOption),N=(0,J.useSlot)({open:k===eI.Open,disabled:h,invalid:d,activeIndex:$,activeOption:H,value:O}),[U,q]=(0,em.useLabels)(),G=(0,a.useCallback)(()=>
1{if(void 0!==x)return null==E?void 0:E(x)},[E,x]),Q=(0,eh.useRender)();return a.default.createElement(q,{value:U,props:{htmlFor:null==W?void 0:W.id},slot:{open:k===eI.Open,disabled:h}},a.default.createElement(ee.FloatingProvider,null,a.default.createElement(ez.Provider,{value:z},a.default.createElement(ew.Provider,{value:I},a.default.createElement(en.OpenClosedProvider,{value:(0,ec.match)(k,{[eI.Open]:en.State.Open,[eI.Closed]:en.State.Closed})},null!=u&&a.default.createElement(et.FormFields,{disabled:h,data:null!=O?{[u]:O}:{},form:r,onReset:G}),Q({ourProps:null===t?{}:{ref:t},theirProps:S,slot:N,defaultTag:eL,name:"Combobox"}))))))}),eK=(0,eh.forwardRefWithAs)(function(e,t){let i=eF("Combobox.Button"),s=eD("Combobox.Button"),[n,o]=(0,a.useState)(null),c=(0,q.useSyncRefs)(t,o,i.actions.setButtonElement),d=(0,a.useId)(),{id:h=`headlessui-combobox-button-${d}`,disabled:f=s.disabled||!1,autoFocus:p=!1,...m}=e,[g,v,b]=(0,el.useSlice)(i,e=>[e.comboboxState,e.inputElement,e.optionsElement]),S=H(v),x=g===eI.Open;(0,V.useQuickRelease)(x,{trigger:n,action:(0,a.useCallback)(e=>{if(null!=n&&n.contains(e.target)||null!=v&&v.contains(e.target))return V.Action.Ignore;let t=e.target.closest('[role="option"]:not([data-disabled])');return K.isHTMLElement(t)?V.Action.Select(t):null!=b&&b.contains(e.target)?V.Action.Ignore:V.Action.Close},[n,v,b]),close:i.actions.closeCombobox,select:i.actions.selectActiveOption});let O=(0,F.useEvent)(e=>{switch(e.key){case ep.Keys.Space:case ep.Keys.Enter:e.preventDefault(),e.stopPropagation(),i.state.comboboxState===eI.Closed&&(0,u.flushSync)(()=>i.actions.openCombobox()),S();return;case ep.Keys.ArrowDown:e.preventDefault(),e.stopPropagation(),i.state.comboboxState===eI.Closed&&((0,u.flushSync)(()=>i.actions.openCombobox()),i.state.dataRef.current.value||i.actions.goToOption({focus:ea.Focus.First})),S();return;case ep.Keys.ArrowUp:e.preventDefault(),e.stopPropagation(),i.state.comboboxState===eI.Closed&&((0,u.flushSync)(()=>i.actions.openCombobox()),i.state.dataRef.current.value||i.actions.goToOption({focus:ea.Focus.Last})),S();return;case ep.Keys.Escape:if(i.state.comboboxState!==eI.Open)return;e.preventDefault(),i.state.optionsElement&&!s.optionsPropsRef.current.static&&e.stopPropagation(),(0,u.flushSync)(()=>i.actions.closeCombobox()),S();return;default:return}}),E=(0,P.useHandleToggle)(()=>{i.state.comboboxState===eI.Open?i.actions.closeCombobox():i.actions.openCombobox(),S()}),I=(0,em.useLabelledBy)([h]),{isFocusVisible:T,focusProps:y}=(0,l.useFocusRing)({autoFocus:p}),{isHovered:M,hoverProps:A}=(0,r.useHover)({isDisabled:f}),{pressed:R,pressProps:_}=(0,C.useActivePress)({disabled:f}),w=(0,J.useSlot)({open:g===eI.Open,active:R||g===eI.Open,disabled:f,invalid:s.invalid,value:s.value,hover:M,focus:T}),z=(0,eh.mergeProps)({ref:c,id:h,type:(0,N.useResolveButtonType)(e,n),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":null==b?void 0:b.id,"aria-expanded":g===eI.Open,"aria-labelledby":I,disabled:f||void 0,autoFocus:p,onKeyDown:O},E,y,A,_);return(0,eh.useRender)()({ourProps:z,theirProps:m,slot:w,defaultTag:"button",name:"Combobox.Button"})}),eB=(0,eh.forwardRefWithAs)(function(e,t){var i,s;let n=eF("Combobox.Input"),o=eD("Combobox.Input"),c=(0,a.useId)(),d=(0,es.useProvidedId)(),{id:h=d||`headlessui-combobox-input-${c}`,onChange:f,displayValue:p,disabled:m=o.disabled||!1,autoFocus:g=!1,type:v="text",...b}=e,S=(0,a.useRef)(null),x=(0,q.useSyncRefs)(S,t,(0,ee.useFloatingReference)(),n.actions.setInputElement),[O,E]=(0,el.useSlice)(n,e=>[e.comboboxState,e.isTyping]),I=(0,_.useDisposables)(),T=(0,F.useEvent)(()=>{n.actions.onChange(null),n.state.optionsElement&&(n.state.optionsElement.scrollTop=0),n.actions.goToOption({focus:ea.Focus.Nothing})}),y=(0,a.useMemo)(()=>{var e;return"function"==typeof p&&void 0!==o.value?null!=(e=p(o.value))?e:"":"string"==typeof o.value?o.value:""},[o.value,p]);(0,X.useWatch)(([e,t],[i,s])=>{if(n.state.isTyping)return;let o=S.current;o&&((s===eI.Open&&t===eI.Closed||e!==i)&&(o.value=e),requestAnimationFrame(()=>{if(n.state.isTyping||!o||(0,B.isActiveElement)(o))return;let{selectionStart:e,selectionEnd:t}=o;0===Math.abs((null!=t?t:0)-(null!=e?e:0))&&0===e&&o.setSelectionRange(o.value.length,o.value.length)}))},[y,O,E]),(0,X.useWatch)(([e],[t])=>
1{if(e===eI.Open&&t===eI.Closed){if(n.state.isTyping)return;let e=S.current;if(!e)return;let t=e.value,{selectionStart:i,selectionEnd:s,selectionDirection:o}=e;e.value="",e.value=t,null!==o?e.setSelectionRange(i,s,o):e.setSelectionRange(i,s)}},[O]);let C=(0,a.useRef)(!1),M=(0,F.useEvent)(()=>{C.current=!0}),A=(0,F.useEvent)(()=>{I.nextFrame(()=>{C.current=!1})}),R=(0,F.useEvent)(e=>{switch(n.actions.setIsTyping(!0),e.key){case ep.Keys.Enter:if(n.state.comboboxState!==eI.Open||C.current)return;if(e.preventDefault(),e.stopPropagation(),null===n.selectors.activeOptionIndex(n.state))return void n.actions.closeCombobox();n.actions.selectActiveOption(),o.mode===eT.Single&&n.actions.closeCombobox();break;case ep.Keys.ArrowDown:return e.preventDefault(),e.stopPropagation(),(0,ec.match)(n.state.comboboxState,{[eI.Open]:()=>n.actions.goToOption({focus:ea.Focus.Next}),[eI.Closed]:()=>n.actions.openCombobox()});case ep.Keys.ArrowUp:return e.preventDefault(),e.stopPropagation(),(0,ec.match)(n.state.comboboxState,{[eI.Open]:()=>n.actions.goToOption({focus:ea.Focus.Previous}),[eI.Closed]:()=>{(0,u.flushSync)(()=>n.actions.openCombobox()),o.value||n.actions.goToOption({focus:ea.Focus.Last})}});case ep.Keys.Home:if(n.state.comboboxState===eI.Closed||e.shiftKey)break;return e.preventDefault(),e.stopPropagation(),n.actions.goToOption({focus:ea.Focus.First});case ep.Keys.PageUp:return e.preventDefault(),e.stopPropagation(),n.actions.goToOption({focus:ea.Focus.First});case ep.Keys.End:if(n.state.comboboxState===eI.Closed||e.shiftKey)break;return e.preventDefault(),e.stopPropagation(),n.actions.goToOption({focus:ea.Focus.Last});case ep.Keys.PageDown:return e.preventDefault(),e.stopPropagation(),n.actions.goToOption({focus:ea.Focus.Last});case ep.Keys.Escape:return n.state.comboboxState!==eI.Open?void 0:(e.preventDefault(),n.state.optionsElement&&!o.optionsPropsRef.current.static&&e.stopPropagation(),o.mode===eT.Single&&null===o.value&&T(),n.actions.closeCombobox());case ep.Keys.Tab:if(n.actions.setIsTyping(!1),n.state.comboboxState!==eI.Open)return;o.mode===eT.Single&&n.state.activationTrigger!==ey.Focus&&n.actions.selectActiveOption(),n.actions.closeCombobox()}}),w=(0,F.useEvent)(e=>{null==f||f(e),o.mode===eT.Single&&""===e.target.value&&T(),n.actions.openCombobox()}),P=(0,F.useEvent)(e=>{var t,i,s;let l=null!=(t=e.relatedTarget)?t:er.history.find(t=>t!==e.currentTarget);if(!(null!=(i=n.state.optionsElement)&&i.contains(l))&&!(null!=(s=n.state.buttonElement)&&s.contains(l))&&n.state.comboboxState===eI.Open)return e.preventDefault(),o.mode===eT.Single&&null===o.value&&T(),n.actions.closeCombobox()}),z=(0,F.useEvent)(e=>{var t,i,s;let l=null!=(t=e.relatedTarget)?t:er.history.find(t=>t!==e.currentTarget);null!=(i=n.state.buttonElement)&&i.contains(l)||null!=(s=n.state.optionsElement)&&s.contains(l)||o.disabled||o.immediate&&n.state.comboboxState!==eI.Open&&I.microTask(()=>{(0,u.flushSync)(()=>n.actions.openCombobox()),n.actions.setActivationTrigger(ey.Focus)})}),D=(0,em.useLabelledBy)(),k=(0,ef.useDescribedBy)(),{isFocused:j,focusProps:L}=(0,l.useFocusRing)({autoFocus:g}),{isHovered:W,hoverProps:V}=(0,r.useHover)({isDisabled:m}),K=(0,el.useSlice)(n,e=>e.optionsElement),$=(0,J.useSlot)({open:O===eI.Open,disabled:m,invalid:o.invalid,hover:W,focus:j,autofocus:g}),H=(0,eh.mergeProps)({ref:x,id:h,role:"combobox",type:v,"aria-controls":null==K?void 0:K.id,"aria-expanded":O===eI.Open,"aria-activedescendant":(0,el.useSlice)(n,n.selectors.activeDescendantId),"aria-labelledby":D,"aria-describedby":k,"aria-autocomplete":"list",defaultValue:null!=(s=null!=(i=e.defaultValue)?i:void 0!==o.defaultValue?null==p?void 0:p(o.defaultValue):null)?s:o.defaultValue,disabled:m||void 0,autoFocus:g,onCompositionStart:M,onCompositionEnd:A,onKeyDown:R,onChange:w,onFocus:z,onBlur:P},L,V);return(0,eh.useRender)()({ourProps:H,theirProps:b,slot:$,defaultTag:"input",name:"Combobox.Input"})}),e$=em.Label,eH=(0,eh.forwardRefWithAs)(function(e,t){var i,s,n;let o=(0,a.useId)(),{id:l=`headlessui-combobox-options-${o}`,hold:r=!1,anchor:u,portal:c=!1,modal:d=!0,transition:h=!1,...f}=e,p=eF("Combobox.Options"),m=eD("Combobox.Options"),g=(0,ee.useResolvedAnchor)(u);g&&(c=!0);let[v,b]=(0,ee.useFloatingPanel)(g),[S,x]=(0,a.useState)(null),O=(0,ee.useFloatingPanelProps)(),E=(0,q.useSyncRefs)(t,g?v:null,p.actions.setOptionsElement,x),[I,T,y,C,M]=(0,el.useSlice)(p,e=>[e.comboboxState,e.inputElement,e.buttonElement,e.optionsElement,e.activationTrigger]),A=(0,W.useOwnerDocument)(T||y),R=(0,W.useOwnerDocument)(C),_=(0,en.useOpenClosed)(),[P,k]=(0,Q.useTransition)(h,S,null!==_?(_&en.State.Open)===en.State.Open:I===eI.Open);(0,j.useOnDisappear)(P,T,p.actions.closeCombobox);let L=!m.__demoMode&&d&&I===eI.Open;(0,U.useScrollLock)(L,R);let V=!m.__demoMode&&d&&I===eI.Open;(0,z.useInertOthers)(V,{allowed:(0,a.useCallback)(()=>[T,y,C],[T,y,C])});let K=!(0,el.useSlice)(p,p.selectors.didInputMove)&&P;(0,D.useIsoMorphicEffect)(()=>{var t;m.optionsPropsRef.current.static=null!=(t=e.static)&&t},[m.optionsPropsRef,e.static]),(0,D.useIsoMorphicEffect)(()=>{m.optionsPropsRef.current.hold=r},[m.optionsPropsRef,r]),(0,Y.useTreeWalker)(I===eI.Open,{container:C,accept:e=>
1"option"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT,walk(e){e.setAttribute("role","none")}});let B=(0,em.useLabelledBy)([null==y?void 0:y.id]),$=(0,J.useSlot)({open:I===eI.Open,option:void 0}),H=(0,F.useEvent)(()=>{p.actions.setActivationTrigger(ey.Pointer)}),N=(0,F.useEvent)(e=>{e.preventDefault(),p.actions.setActivationTrigger(ey.Pointer)}),G=(0,eh.mergeProps)(g?O():{},{"aria-labelledby":B,role:"listbox","aria-multiselectable":m.mode===eT.Multi||void 0,id:l,ref:E,style:{...f.style,...b,"--input-width":(0,w.useElementSize)(P,T,!0).width,"--button-width":(0,w.useElementSize)(P,y,!0).width},onWheel:M===ey.Pointer?void 0:H,onMouseDown:N,...(0,Q.transitionDataAttributes)(k)}),X=P&&I===eI.Closed&&!e.static,Z=(0,ei.useFrozenData)(X,null==(i=m.virtual)?void 0:i.options),et=(0,ei.useFrozenData)(X,m.value),es=(0,a.useCallback)(e=>m.compare(et,e),[m.compare,et]),eo=(0,a.useMemo)(()=>{if(!m.virtual)return m;if(void 0===Z)throw Error("Missing `options` in virtual mode");return Z!==m.virtual.options?{...m,virtual:{...m.virtual,options:Z}}:m},[m,Z,null==(s=m.virtual)?void 0:s.options]);m.virtual&&Object.assign(f,{children:a.default.createElement(ez.Provider,{value:eo},a.default.createElement(ej,{slot:$},f.children))});let er=(0,eh.useRender)(),ea=(0,a.useMemo)(()=>m.mode===eT.Multi?m:{...m,isSelected:es},[m,es]);return a.default.createElement(ev.Portal,{enabled:!!c&&(e.static||P),ownerDocument:A},a.default.createElement(ez.Provider,{value:ea},er({ourProps:G,theirProps:{...f,children:a.default.createElement(ei.Frozen,{freeze:X},"function"==typeof f.children?null==(n=f.children)?void 0:n.call(f,$):f.children)},slot:$,defaultTag:"div",features:eW,visible:K,name:"Combobox.Options"}
1)))}),eN=(0,eh.forwardRefWithAs)(function(e,t){var i,s,n;let o=eD("Combobox.Option"),l=eF("Combobox.Option"),r=(0,a.useId)(),{id:u=`headlessui-combobox-option-${r}`,value:c,disabled:d=null!=(n=null==(s=null==(i=o.virtual)?void 0:i.disabled)?void 0:s.call(i,c))&&n,order:h=null,...f}=e,[p]=(0,el.useSlice)(l,e=>[e.inputElement]),m=H(p),g=(0,el.useSlice)(l,(0,a.useCallback)(e=>l.selectors.isActive(e,c,u),[c,u])),v=o.isSelected(c),b=(0,a.useRef)(null),S=(0,k.useLatestValue)({disabled:d,value:c,domRef:b,order:h}),x=(0,a.useContext)(ek),O=(0,q.useSyncRefs)(t,b,x?x.measureElement:null),E=(0,F.useEvent)(()=>{l.actions.setIsTyping(!1),l.actions.onChange(c)});(0,D.useIsoMorphicEffect)(()=>l.actions.registerOption(u,S),[S,u]);let I=(0,el.useSlice)(l,(0,a.useCallback)(e=>l.selectors.shouldScrollIntoView(e,c,u),[c,u]));(0,D.useIsoMorphicEffect)(()=>{if(I)return(0,eu.disposables)().requestAnimationFrame(()=>{var e,t;null==(t=null==(e=b.current)?void 0:e.scrollIntoView)||t.call(e,{block:"nearest"})})},[I,b]);let T=(0,F.useEvent)(e=>{e.preventDefault(),e.button===eg.MouseButton.Left&&(d||(E(),(0,ed.isMobile)()||requestAnimationFrame(()=>m()),o.mode===eT.Single&&l.actions.closeCombobox()))}),y=(0,F.useEvent)(()=>{if(d)return l.actions.goToOption({focus:ea.Focus.Nothing});let e=o.calculateIndex(c);l.actions.goToOption({focus:ea.Focus.Specific,idx:e})}),C=(0,G.useTrackedPointer)(),M=(0,F.useEvent)(e=>C.update(e)),A=(0,F.useEvent)(e=>{if(!C.wasMoved(e)||d||g&&l.state.activationTrigger===ey.Pointer)return;let t=o.calculateIndex(c);l.actions.goToOption({focus:ea.Focus.Specific,idx:t},ey.Pointer)}),R=(0,F.useEvent)(e=>{C.wasMoved(e)&&(d||g&&(o.optionsPropsRef.current.hold||l.state.activationTrigger===ey.Pointer&&l.actions.goToOption({focus:ea.Focus.Nothing})))}),_=(0,J.useSlot)({active:g,focus:g,selected:v,disabled:d});return(0,eh.useRender)()({ourProps:{id:u,ref:O,role:"option",tabIndex:!0===d?void 0:-1,"aria-disabled":!0===d||void 0,"aria-selected":v,disabled:void 0,onMouseDown:T,onFocus:y,onPointerEnter:M,onMouseEnter:M,onPointerMove:A,onMouseMove:A,onPointerLeave:R,onMouseLeave:R},theirProps:f,slot:_,defaultTag:"div",name:"Combobox.Option"})}),eU=Object.assign(eV,{Input:eB,Button:eK,Label:e$,Options:eH,Option:eN});e.s(["Combobox",0,eU,"ComboboxButton",0,eK,"ComboboxInput",0,eB,"ComboboxOption",0,eN,"ComboboxOptions",0,eH],762630)}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.