Files
zen-code-docs/_next/static/chunks/2770-e894e62890be5e00.js
2026-02-14 13:32:31 +00:00

4 lines
49 KiB
JavaScript

"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2770],{79205:function(e,t,n){n.d(t,{Z:function(){return d}});var o=n(2265);let i=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),r=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),s=e=>{let t=r(e);return t.charAt(0).toUpperCase()+t.slice(1)},l=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter((e,t,n)=>!!e&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim()},a=e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};var u={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let c=(0,o.forwardRef)((e,t)=>{let{color:n="currentColor",size:i=24,strokeWidth:r=2,absoluteStrokeWidth:s,className:c="",children:d,iconNode:p,...h}=e;return(0,o.createElement)("svg",{ref:t,...u,width:i,height:i,stroke:n,strokeWidth:s?24*Number(r)/Number(i):r,className:l("lucide",c),...!d&&!a(h)&&{"aria-hidden":"true"},...h},[...p.map(e=>{let[t,n]=e;return(0,o.createElement)(t,n)}),...Array.isArray(d)?d:[d]])}),d=(e,t)=>{let n=(0,o.forwardRef)((n,r)=>{let{className:a,...u}=n;return(0,o.createElement)(c,{ref:r,iconNode:t,className:l("lucide-".concat(i(s(e))),"lucide-".concat(e),a),...u})});return n.displayName=s(e),n}},40875:function(e,t,n){n.d(t,{Z:function(){return o}});let o=(0,n(79205).Z)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},29202:function(e,t,n){n.d(t,{Z:function(){return o}});let o=(0,n(79205).Z)("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]])},7910:function(e,t,n){n.d(t,{CloseBannerButton:function(){return l}});var o=n(57437),i=n(83238),r=n(61994),s=n(85205);let l=e=>{let t,n;let r=(0,i.c)(5),{storageKey:l,children:u}=e;return r[0]!==l?(t=e=>{e.currentTarget.parentElement.classList.add("x:hidden");try{localStorage.setItem(l,"1")}catch(e){}},r[0]=l,r[1]=t):t=r[1],r[2]!==u||r[3]!==t?(n=(0,o.jsx)(s.z,{"aria-label":"Dismiss banner",className:a,onClick:t,children:u}),r[2]=u,r[3]=t,r[4]=n):n=r[4],n};function a(e){let{hover:t}=e;return(0,r.Z)("x:p-2",t?"x:opacity-100":"x:opacity-80")}},60595:function(e,t,n){n.d(t,{ClientBanner:function(){return s}});var o=n(57437),i=n(83238),r=n(2265);let s=e=>{let t,n,s;let a=(0,i.c)(4),u=(0,r.useRef)(null);return a[0]===Symbol.for("react.memo_cache_sentinel")?(t=()=>{let e=new ResizeObserver(l);return e.observe(u.current),()=>{e.disconnect()}},n=[],a[0]=t,a[1]=n):(t=a[0],n=a[1]),(0,r.useEffect)(t,n),a[2]!==e?(s=(0,o.jsx)("div",{ref:u,...e}),a[2]=e,a[3]=s):s=a[3],s};function l(e){for(let t of e){let{height:e}=t.contentRect;document.documentElement.style.setProperty("--nextra-banner-height","".concat(e,"px"))}}},30763:function(e,t,n){let o,i,r,s;n.d(t,{Search:function(){return e2}});var l=n(57437),a=n(83238),u=n(71049),c=n(11323),d=n(2265),p=n(54887);function h(e,t,n){let o,i=n.initialDeps??[];function r(){var r,s,l,a;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==(s=n.debug)?void 0:s.call(n))&&(c=Date.now()),o=t(...d),n.key&&(null==(l=n.debug)?void 0:l.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==(a=null==n?void 0:n.onChange)||a.call(n,o),o}return r.updateDeps=e=>{i=e},r}function m(e,t){if(void 0!==e)return e;throw Error(`Unexpected undefined${t?`: ${t}`:""}`)}let f=(e,t)=>1.01>Math.abs(e-t),g=(e,t,n)=>{let o;return function(...i){e.clearTimeout(o),o=e.setTimeout(()=>t.apply(this,i),n)}},x=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},v=e=>e,b=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},y=(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(x(n)),!o.ResizeObserver)return()=>{};let r=new o.ResizeObserver(t=>{let o=()=>{let e=t[0];if(null==e?void 0:e.borderBoxSize){let t=e.borderBoxSize[0];if(t){i({width:t.inlineSize,height:t.blockSize});return}}i(x(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()});return r.observe(n,{box:"border-box"}),()=>{r.unobserve(n)}},E={passive:!0},O="undefined"==typeof window||"onscrollend"in window,S=(e,t)=>{let n=e.scrollElement;if(!n)return;let o=e.targetWindow;if(!o)return;let i=0,r=e.options.useScrollendEvent&&O?()=>void 0:g(o,()=>{t(i,!1)},e.options.isScrollingResetDelay),s=o=>()=>{let{horizontal:s,isRtl:l}=e.options;i=s?n.scrollLeft*(l&&-1||1):n.scrollTop,r(),t(i,o)},l=s(!0),a=s(!1);a(),n.addEventListener("scroll",l,E);let u=e.options.useScrollendEvent&&O;return u&&n.addEventListener("scrollend",a,E),()=>{n.removeEventListener("scroll",l),u&&n.removeEventListener("scrollend",a)}},C=(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 e[n.options.horizontal?"offsetWidth":"offsetHeight"]},w=(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 T{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,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=>{let t=()=>{this._measureElement(e.target,e)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}):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,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:v,rangeExtractor:b,onChange:()=>{},measureElement:C,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...e}},this.notify=e=>{var t,n;null==(n=(t=this.options).onChange)||n.call(t,this,e)},this.maybeNotify=h(()=>(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;let t=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==t){if(this.cleanup(),!t){this.maybeNotify();return}this.scrollElement=t,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._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=()=>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.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.getMeasurementOptions=h(()=>[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=h(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:t,scrollMargin:n,getItemKey:o,enabled:i},r)=>{if(!i)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 l=this.measurementsCache.slice(0,s);for(let i=s;i<e;i++){let e=o(i),s=1===this.options.lanes?l[i-1]:this.getFurthestMeasurement(l,i),a=s?s.end+this.options.gap:t+n,u=r.get(e),c="number"==typeof u?u:this.options.estimateSize(i),d=a+c,p=s?s.lane:i%this.options.lanes;l[i]={index:i,start:a,size:c,end:d,key:e,lane:p}}return this.measurementsCache=l,l},{key:!1,debug:()=>this.options.debug}),this.calculateRange=h(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,o)=>this.range=e.length>0&&t>0?function({measurements:e,outerSize:t,scrollOffset:n,lanes:o}){let i=e.length-1;if(e.length<=o)return{startIndex:0,endIndex:i};let r=M(0,i,t=>e[t].start,n),s=r;if(1===o)for(;s<i&&e[s].end<n+t;)s++;else if(o>1){let l=Array(o).fill(0);for(;s<i&&l.some(e=>e<n+t);){let t=e[s];l[t.lane]=t.end,s++}let a=Array(o).fill(n+t);for(;r>=0&&a.some(e=>e>=n);){let t=e[r];a[t.lane]=t.start,r--}r=Math.max(0,r-r%o),s=Math.min(i,s+(o-1-s%o))}return{startIndex:r,endIndex:s}}({measurements:e,outerSize:t,scrollOffset:n,lanes:o}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=h(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,o,i)=>null===o||null===i?[]:e({startIndex:o,endIndex:i,overscan:t,count:n}),{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.indexFromElement(e),o=this.measurementsCache[n];if(!o)return;let i=o.key,r=this.elementsCache.get(i);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(i,e)),e.isConnected&&this.resizeItem(n,this.options.measureElement(e,t,this))},this.resizeItem=(e,t)=>{let n=this.measurementsCache[e];if(!n)return;let o=t-(this.itemSizeCache.get(n.key)??n.size);0!==o&&((void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(n,o,this):n.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=o,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(n.index),this.itemSizeCache=new Map(this.itemSizeCache.set(n.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=h(()=>[this.getVirtualIndexes(),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 m(t[M(0,t.length-1,e=>m(t[e]).start,e)])},this.getOffsetForAlignment=(e,t,n=0)=>{let o=this.getSize(),i=this.getScrollOffset();return"auto"===t&&(t=e>=i+o?"end":"start"),"center"===t?e+=(n-o)/2:"end"===t&&(e-=o),Math.max(Math.min(this.getTotalSize()+this.options.scrollMargin-o,e),0)},this.getOffsetForIndex=(e,t="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.measurementsCache[e];if(!n)return;let o=this.getSize(),i=this.getScrollOffset();if("auto"===t){if(n.end>=i+o-this.options.scrollPaddingEnd)t="end";else{if(!(n.start<=i+this.options.scrollPaddingStart))return[i,t];t="start"}}let r="end"===t?n.end+this.options.scrollPaddingEnd:n.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(r,t,n.size),t]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(e,{align:t="start",behavior:n}={})=>{"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}={})=>{"smooth"===n&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),e=Math.max(0,Math.min(e,this.options.count-1));let o=0,i=t=>{if(!this.targetWindow)return;let o=this.getOffsetForIndex(e,t);if(!o){console.warn("Failed to get offset for index:",e);return}let[i,s]=o;this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.targetWindow.requestAnimationFrame(()=>{let t=this.getScrollOffset(),n=this.getOffsetForIndex(e,s);if(!n){console.warn("Failed to get offset for index:",e);return}f(n[0],t)||r(s)})},r=t=>{this.targetWindow&&(++o<10?this.targetWindow.requestAnimationFrame(()=>i(t)):console.warn(`Failed to scroll to index ${e} after 10 attempts.`))};i(t)},this.scrollBy=(e,{behavior:t}={})=>{"smooth"===t&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+e,{adjustments:void 0,behavior:t})},this.getTotalSize=()=>{var e;let t;let n=this.getMeasurements();if(0===n.length)t=this.options.paddingStart;else if(1===this.options.lanes)t=(null==(e=n[n.length-1])?void 0:e.end)??0;else{let e=Array(this.options.lanes).fill(null),o=n.length-1;for(;o>=0&&e.some(e=>null===e);){let t=n[o];null===e[t.lane]&&(e[t.lane]=t.end),o--}t=Math.max(...e.filter(e=>null!==e))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(e)}}let M=(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},I="undefined"!=typeof document?d.useLayoutEffect:d.useEffect;var R=n(36750),k=n(29483),z=n(62963),_=n(47920),P=n(90945),F=n(40993),A=n(13323),D=n(16821),L=n(64518),j=n(31948),N=n(33106),V=n(76292),B=n(40048),Z=n(18303),W=n(91133);function U(e){var t,n,o,i;let r,s=(0,d.useRef)({value:"",selectionStart:null,selectionEnd:null});return t=e,n="blur",o=e=>{let t=e.target;W.LL(t)&&(s.current={value:t.value,selectionStart:t.selectionStart,selectionEnd:t.selectionEnd})},r=(0,j.E)(o),(0,d.useEffect)(()=>{function e(e){r.current(e)}return(t=null!=t?t:window).addEventListener(n,e,void 0),()=>t.removeEventListener(n,e,i)},[t,n,i]),(0,A.z)(()=>{if(document.activeElement!==e&&W.LL(e)&&e.isConnected){if(e.focus({preventScroll:!0}),e.value!==s.current.value)e.setSelectionRange(e.value.length,e.value.length);else{let{selectionStart:t,selectionEnd:n}=s.current;null!==t&&null!==n&&e.setSelectionRange(t,n)}s.current={value:"",selectionStart:null,selectionEnd:null}}})}var K=n(80004),q=n(26074),$=n(93689),H=n(15518),G=n(34723),J=n(71776);function X(e,t){let n=(0,d.useRef)([]),o=(0,A.z)(e);(0,d.useEffect)(()=>{let e=[...n.current];for(let[i,r]of t.entries())if(n.current[i]!==r){let i=o(t,e);return n.current=t,i}},[o,...t])}var Y=n(6885),Q=n(30054),ee=n(7722),et=n(60370),en=n(92807),eo=n(37863),ei=n(22055),er=n(46187),es=n(37105);let el=[];!function(e){function t(){"loading"!==document.readyState&&(e(),document.removeEventListener("DOMContentLoaded",t))}"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("DOMContentLoaded",t),t())}(()=>{function e(e){if(!W.sP(e.target)||e.target===document.body||el[0]===e.target)return;let t=e.target;t=t.closest(es.y),el.unshift(null!=t?t:e.target),(el=el.filter(e=>null!=e&&e.isConnected)).splice(10)}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});var ea=n(47634),eu=n(34778),ec=n(16015),ed=n(24536),ep=n(52108),eh=n(88533),em=n(33577),ef=n(37388),eg=n(34630),ex=n(1265),ev=n(58922),eb=n(46036),ey=Object.defineProperty,eE=(e,t,n)=>t in e?ey(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,eO=(e,t,n)=>(eE(e,"symbol"!=typeof t?t+"":t,n),n),eS=((o=eS||{})[o.Open=0]="Open",o[o.Closed=1]="Closed",o),eC=((i=eC||{})[i.Single=0]="Single",i[i.Multi=1]="Multi",i),ew=((r=ew||{})[r.Pointer=0]="Pointer",r[r.Focus=1]="Focus",r[r.Other=2]="Other",r),eT=((s=eT||{})[s.OpenCombobox=0]="OpenCombobox",s[s.CloseCombobox=1]="CloseCombobox",s[s.GoToOption=2]="GoToOption",s[s.SetTyping=3]="SetTyping",s[s.RegisterOption=4]="RegisterOption",s[s.UnregisterOption=5]="UnregisterOption",s[s.DefaultToFirstOption=6]="DefaultToFirstOption",s[s.SetActivationTrigger=7]="SetActivationTrigger",s[s.UpdateVirtualConfiguration=8]="UpdateVirtualConfiguration",s[s.SetInputElement=9]="SetInputElement",s[s.SetButtonElement=10]="SetButtonElement",s[s.SetOptionsElement=11]="SetOptionsElement",s);function eM(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,es.z2)(o,e=>e.dataRef.current.domRef.current),r=n?i.indexOf(n):null;return -1===r&&(r=null),{options:i,activeOptionIndex:r}}let eI={1(e){var t;return null!=(t=e.dataRef.current)&&t.disabled||1===e.comboboxState?e:{...e,activeOptionIndex:null,comboboxState:1,isTyping:!1,activationTrigger:2,__demoMode:!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,__demoMode:!1}}return{...e,comboboxState:0,__demoMode:!1}},3:(e,t)=>e.isTyping===t.isTyping?e:{...e,isTyping:t.isTyping},2(e,t){var n,o,i,r;if(null!=(n=e.dataRef.current)&&n.disabled||e.optionsElement&&!(null!=(o=e.dataRef.current)&&o.optionsPropsRef.current.static)&&1===e.comboboxState)return e;if(e.virtual){let{options:n,disabled:o}=e.virtual,r=t.focus===eu.T.Specific?t.idx:(0,eu.d)(t,{resolveItems:()=>n,resolveActiveIndex:()=>{var t,i;return null!=(i=null!=(t=e.activeOptionIndex)?t:n.findIndex(e=>!o(e)))?i:null},resolveDisabled:o,resolveId(){throw Error("Function not implemented.")}}),s=null!=(i=t.trigger)?i:2;return e.activeOptionIndex===r&&e.activationTrigger===s?e:{...e,activeOptionIndex:r,activationTrigger:s,isTyping:!1,__demoMode:!1}}let s=eM(e);if(null===s.activeOptionIndex){let e=s.options.findIndex(e=>!e.dataRef.current.disabled);-1!==e&&(s.activeOptionIndex=e)}let l=t.focus===eu.T.Specific?t.idx:(0,eu.d)(t,{resolveItems:()=>s.options,resolveActiveIndex:()=>s.activeOptionIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled}),a=null!=(r=t.trigger)?r:2;return e.activeOptionIndex===l&&e.activationTrigger===a?e:{...e,...s,isTyping:!1,activeOptionIndex:l,activationTrigger:a,__demoMode:!1}},4:(e,t)=>{var n,o,i,r;if(null!=(n=e.dataRef.current)&&n.virtual)return{...e,options:[...e.options,t.payload]};let s=t.payload,l=eM(e,e=>(e.push(s),e));null===e.activeOptionIndex&&null!=(i=(o=e.dataRef.current).isSelected)&&i.call(o,t.payload.dataRef.current.value)&&(l.activeOptionIndex=l.options.indexOf(s));let a={...e,...l,activationTrigger:2};return null!=(r=e.dataRef.current)&&r.__demoMode&&void 0===e.dataRef.current.value&&(a.activeOptionIndex=0),a},5:(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=eM(e,e=>{let n=e.findIndex(e=>e.id===t.id);return -1!==n&&e.splice(n,1),e});return{...e,...o,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)=>{var n,o;if(null===e.virtual)return{...e,virtual:{options:t.options,disabled:null!=(n=t.disabled)?n:()=>!1}};if(e.virtual.options===t.options&&e.virtual.disabled===t.disabled)return e;let i=e.activeOptionIndex;if(null!==e.activeOptionIndex){let n=t.options.indexOf(e.virtual.options[e.activeOptionIndex]);i=-1!==n?n:null}return{...e,activeOptionIndex:i,virtual:{options:t.options,disabled:null!=(o=t.disabled)?o:()=>!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}};class eR extends eb.J{static new(e){var t;let{id:n,virtual:o=null,__demoMode:i=!1}=e;return new eR({id:n,dataRef:{current:{}},comboboxState:i?0:1,isTyping:!1,options:[],virtual:o?{options:o.options,disabled:null!=(t=o.disabled)?t:()=>!1}:null,activeOptionIndex:null,activationTrigger:2,inputElement:null,buttonElement:null,optionsElement:null,__demoMode:i})}reduce(e,t){return(0,ed.E)(t.type,eI,e,t)}constructor(e){super(e),eO(this,"actions",{onChange:e=>{let{onChange:t,compare:n,mode:o,value:i}=this.state.dataRef.current;return(0,ed.E)(o,{0:()=>null==t?void 0:t(e),1:()=>{let o=i.slice(),r=o.findIndex(t=>n(t,e));return -1===r?o.push(e):o.splice(r,1),null==t?void 0:t(o)}})},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:eu.T.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})}}),eO(this,"selectors",{activeDescendantId:e=>{var t,n;let o=this.selectors.activeOptionIndex(e);if(null!==o)return e.virtual?null==(n=e.options.find(t=>!t.dataRef.current.disabled&&e.dataRef.current.compare(t.dataRef.current.value,e.virtual.options[o])))?void 0:n.id:null==(t=e.options[o])?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:n}=e.virtual,o=t.findIndex(e=>{var t;return!(null!=(t=null==n?void 0:n(e))&&t)});if(-1!==o)return o}let t=e.options.findIndex(e=>!e.dataRef.current.disabled);if(-1!==t)return t}return e.activeOptionIndex},activeOption:e=>{var t,n;let o=this.selectors.activeOptionIndex(e);return null===o?null:e.virtual?e.virtual.options[null!=o?o:0]:null!=(n=null==(t=e.options[o])?void 0:t.dataRef.current.value)?n:null},isActive:(e,t,n)=>{var o;let i=this.selectors.activeOptionIndex(e);return null!==i&&(e.virtual?i===e.dataRef.current.calculateIndex(t):(null==(o=e.options[i])?void 0:o.id)===n)},shouldScrollIntoView:(e,t,n)=>!(e.virtual||e.__demoMode||0!==e.comboboxState||0===e.activationTrigger||!this.selectors.isActive(e,t,n))});{let e=this.state.id,t=ei.n.get(null);this.disposables.add(t.on(ei.M.Push,n=>{t.selectors.isTop(n,e)||0!==this.state.comboboxState||this.actions.closeCombobox()})),this.on(0,()=>t.actions.push(e)),this.on(1,()=>t.actions.pop(e))}}}var ek=n(99417);let ez=(0,d.createContext)(null);function e_(e){let t=(0,d.useContext)(ez);if(null===t){let t=Error("<".concat(e," /> is missing a parent <Combobox /> component."));throw Error.captureStackTrace&&Error.captureStackTrace(t,eP),t}return t}function eP(e){let{id:t,virtual:n=null,__demoMode:o=!1}=e,i=(0,d.useMemo)(()=>eR.new({id:t,virtual:n,__demoMode:o}),[]);return(0,ek.L)(()=>i.dispose()),i}let eF=(0,d.createContext)(null);function eA(e){let t=(0,d.useContext)(eF);if(null===t){let t=Error("<".concat(e," /> is missing a parent <Combobox /> component."));throw Error.captureStackTrace&&Error.captureStackTrace(t,eA),t}return t}eF.displayName="ComboboxDataContext";let eD=(0,d.createContext)(null);function eL(e){let t=e_("VirtualProvider"),{options:n}=eA("VirtualProvider").virtual,o=(0,er.M)(t,e=>e.optionsElement),[i,r]=(0,d.useMemo)(()=>{if(!o)return[0,0];let e=window.getComputedStyle(o);return[parseFloat(e.paddingBlockStart||e.paddingTop),parseFloat(e.paddingBlockEnd||e.paddingBottom)]},[o]),s=function(e){let t=d.useReducer(()=>({}),{})[1],n={...e,onChange:(n,o)=>{var i;o?(0,p.flushSync)(t):t(),null==(i=e.onChange)||i.call(e,n,o)}},[o]=d.useState(()=>new T(n));return o.setOptions(n),I(()=>o._didMount(),[]),I(()=>o._willUpdate()),o}({observeElementRect:y,observeElementOffset:S,scrollToFn:w,enabled:0!==n.length,scrollPaddingStart:i,scrollPaddingEnd:r,count:n.length,estimateSize:()=>40,getScrollElement:()=>t.state.optionsElement,overscan:12}),[l,a]=(0,d.useState)(0);(0,L.e)(()=>{a(e=>e+1)},[n]);let u=s.getVirtualItems(),c=(0,er.M)(t,e=>e.activationTrigger===ew.Pointer),h=(0,er.M)(t,t.selectors.activeOptionIndex);return 0===u.length?null:d.createElement(eD.Provider,{value:s},d.createElement("div",{style:{position:"relative",width:"100%",height:"".concat(s.getTotalSize(),"px")},ref:e=>{e&&(c||null!==h&&n.length>h&&s.scrollToIndex(h))}},u.map(t=>{var o;return d.createElement(d.Fragment,{key:t.key},d.cloneElement(null==(o=e.children)?void 0:o.call(e,{...e.slot,option:n[t.index]}),{key:"".concat(l,"-").concat(t.key),"data-index":t.index,"aria-setsize":n.length,"aria-posinset":t.index+1,style:{position:"absolute",top:0,left:0,transform:"translateY(".concat(t.start,"px)"),overflowAnchor:"none"}}))})))}let ej=d.Fragment,eN=eh.VN.RenderStrategy|eh.VN.Static,eV=(0,eh.yV)(function(e,t){let n=(0,d.useId)(),o=(0,Y.B)(),{value:i,defaultValue:r,onChange:s,form:l,name:a,by:u,invalid:c=!1,disabled:p=o||!1,onClose:h,__demoMode:m=!1,multiple:f=!1,immediate:g=!1,virtual:x=null,nullable:v,...b}=e,y=(0,_.L)(r),[E=f?[]:void 0,O]=(0,z.q)(i,s,y),S=eP({id:n,virtual:x,__demoMode:m}),C=(0,d.useRef)({static:!1,hold:!1}),w=(0,k.J)(u),T=(0,A.z)(e=>x?null===u?x.options.indexOf(e):x.options.findIndex(t=>w(t,e)):S.state.options.findIndex(t=>w(t.dataRef.current.value,e))),M=(0,d.useCallback)(e=>(0,ed.E)(P.mode,{[eC.Multi]:()=>E.some(t=>w(t,e)),[eC.Single]:()=>w(E,e)}),[E]),I=(0,er.M)(S,e=>e.virtual),R=(0,A.z)(()=>null==h?void 0:h()),P=(0,d.useMemo)(()=>({__demoMode:m,immediate:g,optionsPropsRef:C,value:E,defaultValue:y,disabled:p,invalid:c,mode:f?eC.Multi:eC.Single,virtual:x?I:null,onChange:O,isSelected:M,calculateIndex:T,compare:w,onClose:R}),[E,y,p,c,f,O,M,m,S,x,I,R]);(0,L.e)(()=>{var e;x&&S.send({type:eT.UpdateVirtualConfiguration,options:x.options,disabled:null!=(e=x.disabled)?e:null})},[x,null==x?void 0:x.options,null==x?void 0:x.disabled]),(0,L.e)(()=>{S.state.dataRef.current=P},[P]);let[F,D,j,N]=(0,er.M)(S,e=>[e.comboboxState,e.buttonElement,e.inputElement,e.optionsElement]),B=ei.n.get(null),Z=(0,er.M)(B,(0,d.useCallback)(e=>B.selectors.isTop(e,n),[B,n]));(0,V.O)(Z,[D,j,N],()=>S.actions.closeCombobox());let W=(0,er.M)(S,S.selectors.activeOptionIndex),U=(0,er.M)(S,S.selectors.activeOption),K=(0,d.useMemo)(()=>({open:F===eS.Open,disabled:p,invalid:c,activeIndex:W,activeOption:U,value:E}),[P,p,E,c,U,F]),[q,$]=(0,eg.bE)(),H=(0,d.useCallback)(()=>{if(void 0!==y)return null==O?void 0:O(y)},[O,y]),G=(0,eh.L6)();return d.createElement($,{value:q,props:{htmlFor:null==j?void 0:j.id},slot:{open:F===eS.Open,disabled:p}},d.createElement(Q.HO,null,d.createElement(eF.Provider,{value:P},d.createElement(ez.Provider,{value:S},d.createElement(eo.up,{value:(0,ed.E)(F,{[eS.Open]:eo.ZM.Open,[eS.Closed]:eo.ZM.Closed})},null!=a&&d.createElement(ee.Mt,{disabled:p,data:null!=E?{[a]:E}:{},form:l,onReset:H}),G({ourProps:null===t?{}:{ref:t},theirProps:b,slot:K,defaultTag:ej,name:"Combobox"}))))))}),eB=(0,eh.yV)(function(e,t){let n=e_("Combobox.Button"),o=eA("Combobox.Button"),[i,r]=(0,d.useState)(null),s=(0,$.T)(t,r,n.actions.setButtonElement),l=(0,d.useId)(),{id:a="headlessui-combobox-button-".concat(l),disabled:h=o.disabled||!1,autoFocus:m=!1,...f}=e,[g,x,v]=(0,er.M)(n,e=>[e.comboboxState,e.inputElement,e.optionsElement]),b=U(x),y=g===eS.Open;(0,Z.G)(y,{trigger:i,action:(0,d.useCallback)(e=>{if(null!=i&&i.contains(e.target)||null!=x&&x.contains(e.target))return Z.a.Ignore;let t=e.target.closest('[role="option"]:not([data-disabled])');return W.Re(t)?Z.a.Select(t):null!=v&&v.contains(e.target)?Z.a.Ignore:Z.a.Close},[i,x,v]),close:n.actions.closeCombobox,select:n.actions.selectActiveOption});let E=(0,A.z)(e=>{switch(e.key){case ef.R.Space:case ef.R.Enter:e.preventDefault(),e.stopPropagation(),n.state.comboboxState===eS.Closed&&(0,p.flushSync)(()=>n.actions.openCombobox()),b();return;case ef.R.ArrowDown:e.preventDefault(),e.stopPropagation(),n.state.comboboxState===eS.Closed&&((0,p.flushSync)(()=>n.actions.openCombobox()),n.state.dataRef.current.value||n.actions.goToOption({focus:eu.T.First})),b();return;case ef.R.ArrowUp:e.preventDefault(),e.stopPropagation(),n.state.comboboxState===eS.Closed&&((0,p.flushSync)(()=>n.actions.openCombobox()),n.state.dataRef.current.value||n.actions.goToOption({focus:eu.T.Last})),b();return;case ef.R.Escape:if(n.state.comboboxState!==eS.Open)return;e.preventDefault(),n.state.optionsElement&&!o.optionsPropsRef.current.static&&e.stopPropagation(),(0,p.flushSync)(()=>n.actions.closeCombobox()),b();return;default:return}}),O=(0,A.z)(e=>{e.preventDefault(),(0,ea.P)(e.currentTarget)||(e.button===ex.t.Left&&(n.state.comboboxState===eS.Open?n.actions.closeCombobox():n.actions.openCombobox()),b())}),S=(0,eg.wp)([a]),{isFocusVisible:C,focusProps:w}=(0,u.F)({autoFocus:m}),{isHovered:T,hoverProps:M}=(0,c.X)({isDisabled:h}),{pressed:I,pressProps:k}=(0,R.x)({disabled:h}),z=(0,d.useMemo)(()=>({open:g===eS.Open,active:I||g===eS.Open,disabled:h,invalid:o.invalid,value:o.value,hover:T,focus:C}),[o,T,C,I,h,g]),_=(0,eh.dG)({ref:s,id:a,type:(0,K.f)(e,i),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":null==v?void 0:v.id,"aria-expanded":g===eS.Open,"aria-labelledby":S,disabled:h||void 0,autoFocus:m,onPointerDown:O,onKeyDown:E},w,M,k);return(0,eh.L6)()({ourProps:_,theirProps:f,slot:z,defaultTag:"button",name:"Combobox.Button"})}),eZ=(0,eh.yV)(function(e,t){var n,o;let i=e_("Combobox.Input"),r=eA("Combobox.Input"),s=(0,d.useId)(),l=(0,en.Q)(),{id:a=l||"headlessui-combobox-input-".concat(s),onChange:h,displayValue:m,disabled:f=r.disabled||!1,autoFocus:g=!1,type:x="text",...v}=e,[b]=(0,er.M)(i,e=>[e.inputElement]),y=(0,d.useRef)(null),E=(0,$.T)(y,t,(0,Q.AZ)(),i.actions.setInputElement),O=(0,B.i)(b),[S,C]=(0,er.M)(i,e=>[e.comboboxState,e.isTyping]),w=(0,P.G)(),T=(0,A.z)(()=>{i.actions.onChange(null),i.state.optionsElement&&(i.state.optionsElement.scrollTop=0),i.actions.goToOption({focus:eu.T.Nothing})});X((e,t)=>{let[n,o]=e,[r,s]=t;if(i.state.isTyping)return;let l=y.current;l&&((s===eS.Open&&o===eS.Closed||n!==r)&&(l.value=n),requestAnimationFrame(()=>{if(i.state.isTyping||!l||(null==O?void 0:O.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)}))},[(0,d.useMemo)(()=>{var e;return"function"==typeof m&&void 0!==r.value?null!=(e=m(r.value))?e:"":"string"==typeof r.value?r.value:""},[r.value,m]),S,O,C]),X((e,t)=>{let[n]=e,[o]=t;if(n===eS.Open&&o===eS.Closed){if(i.state.isTyping)return;let e=y.current;if(!e)return;let t=e.value,{selectionStart:n,selectionEnd:o,selectionDirection:r}=e;e.value="",e.value=t,null!==r?e.setSelectionRange(n,o,r):e.setSelectionRange(n,o)}},[S]);let M=(0,d.useRef)(!1),I=(0,A.z)(()=>{M.current=!0}),R=(0,A.z)(()=>{w.nextFrame(()=>{M.current=!1})}),k=(0,A.z)(e=>{switch(i.actions.setIsTyping(!0),e.key){case ef.R.Enter:if(i.state.comboboxState!==eS.Open||M.current)return;if(e.preventDefault(),e.stopPropagation(),null===i.selectors.activeOptionIndex(i.state)){i.actions.closeCombobox();return}i.actions.selectActiveOption(),r.mode===eC.Single&&i.actions.closeCombobox();break;case ef.R.ArrowDown:return e.preventDefault(),e.stopPropagation(),(0,ed.E)(i.state.comboboxState,{[eS.Open]:()=>i.actions.goToOption({focus:eu.T.Next}),[eS.Closed]:()=>i.actions.openCombobox()});case ef.R.ArrowUp:return e.preventDefault(),e.stopPropagation(),(0,ed.E)(i.state.comboboxState,{[eS.Open]:()=>i.actions.goToOption({focus:eu.T.Previous}),[eS.Closed]:()=>{(0,p.flushSync)(()=>i.actions.openCombobox()),r.value||i.actions.goToOption({focus:eu.T.Last})}});case ef.R.Home:if(e.shiftKey)break;return e.preventDefault(),e.stopPropagation(),i.actions.goToOption({focus:eu.T.First});case ef.R.PageUp:return e.preventDefault(),e.stopPropagation(),i.actions.goToOption({focus:eu.T.First});case ef.R.End:if(e.shiftKey)break;return e.preventDefault(),e.stopPropagation(),i.actions.goToOption({focus:eu.T.Last});case ef.R.PageDown:return e.preventDefault(),e.stopPropagation(),i.actions.goToOption({focus:eu.T.Last});case ef.R.Escape:return i.state.comboboxState!==eS.Open?void 0:(e.preventDefault(),i.state.optionsElement&&!r.optionsPropsRef.current.static&&e.stopPropagation(),r.mode===eC.Single&&null===r.value&&T(),i.actions.closeCombobox());case ef.R.Tab:if(i.state.comboboxState!==eS.Open)return;r.mode===eC.Single&&i.state.activationTrigger!==ew.Focus&&i.actions.selectActiveOption(),i.actions.closeCombobox()}}),z=(0,A.z)(e=>{null==h||h(e),r.mode===eC.Single&&""===e.target.value&&T(),i.actions.openCombobox()}),_=(0,A.z)(e=>{var t,n,o;let s=null!=(t=e.relatedTarget)?t:el.find(t=>t!==e.currentTarget);if(!(null!=(n=i.state.optionsElement)&&n.contains(s))&&!(null!=(o=i.state.buttonElement)&&o.contains(s))&&i.state.comboboxState===eS.Open)return e.preventDefault(),r.mode===eC.Single&&null===r.value&&T(),i.actions.closeCombobox()}),F=(0,A.z)(e=>{var t,n,o;let s=null!=(t=e.relatedTarget)?t:el.find(t=>t!==e.currentTarget);null!=(n=i.state.buttonElement)&&n.contains(s)||null!=(o=i.state.optionsElement)&&o.contains(s)||r.disabled||r.immediate&&i.state.comboboxState!==eS.Open&&w.microTask(()=>{(0,p.flushSync)(()=>i.actions.openCombobox()),i.actions.setActivationTrigger(ew.Focus)})}),D=(0,eg.wp)(),L=(0,em.zH)(),{isFocused:j,focusProps:N}=(0,u.F)({autoFocus:g}),{isHovered:V,hoverProps:Z}=(0,c.X)({isDisabled:f}),W=(0,er.M)(i,e=>e.optionsElement),U=(0,d.useMemo)(()=>({open:S===eS.Open,disabled:f,invalid:r.invalid,hover:V,focus:j,autofocus:g}),[r,V,j,g,f,r.invalid]),K=(0,eh.dG)({ref:E,id:a,role:"combobox",type:x,"aria-controls":null==W?void 0:W.id,"aria-expanded":S===eS.Open,"aria-activedescendant":(0,er.M)(i,i.selectors.activeDescendantId),"aria-labelledby":D,"aria-describedby":L,"aria-autocomplete":"list",defaultValue:null!=(o=null!=(n=e.defaultValue)?n:void 0!==r.defaultValue?null==m?void 0:m(r.defaultValue):null)?o:r.defaultValue,disabled:f||void 0,autoFocus:g,onCompositionStart:I,onCompositionEnd:R,onKeyDown:k,onChange:z,onFocus:F,onBlur:_},N,Z);return(0,eh.L6)()({ourProps:K,theirProps:v,slot:U,defaultTag:"input",name:"Combobox.Input"})}),eW=eg.__,eU=(0,eh.yV)(function(e,t){var n,o,i;let r=(0,d.useId)(),{id:s="headlessui-combobox-options-".concat(r),hold:l=!1,anchor:a,portal:u=!1,modal:c=!0,transition:p=!1,...h}=e,m=e_("Combobox.Options"),f=eA("Combobox.Options"),g=(0,Q.Vy)(a);g&&(u=!0);let[x,v]=(0,Q.ES)(g),[b,y]=(0,d.useState)(null),E=(0,Q.U8)(),O=(0,$.T)(t,g?x:null,m.actions.setOptionsElement,y),[S,C,w,T,M]=(0,er.M)(m,e=>[e.comboboxState,e.inputElement,e.buttonElement,e.optionsElement,e.activationTrigger]),I=(0,B.i)(C||w),R=(0,B.i)(T),k=(0,eo.oJ)(),[z,_]=(0,G.Y)(p,b,null!==k?(k&eo.ZM.Open)===eo.ZM.Open:S===eS.Open);(0,N.m)(z,C,m.actions.closeCombobox);let P=!f.__demoMode&&c&&S===eS.Open;(0,q.P)(P,R);let j=!f.__demoMode&&c&&S===eS.Open;(0,D.s)(j,{allowed:(0,d.useCallback)(()=>[C,w,T],[C,w,T])}),(0,L.e)(()=>{var t;f.optionsPropsRef.current.static=null!=(t=e.static)&&t},[f.optionsPropsRef,e.static]),(0,L.e)(()=>{f.optionsPropsRef.current.hold=l},[f.optionsPropsRef,l]),(0,J.B)(S===eS.Open,{container:T,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 V=(0,eg.wp)([null==w?void 0:w.id]),Z=(0,d.useMemo)(()=>({open:S===eS.Open,option:void 0}),[S]),W=(0,A.z)(()=>{m.actions.setActivationTrigger(ew.Pointer)}),U=(0,A.z)(e=>{e.preventDefault(),m.actions.setActivationTrigger(ew.Pointer)}),K=(0,eh.dG)(g?E():{},{"aria-labelledby":V,role:"listbox","aria-multiselectable":f.mode===eC.Multi||void 0,id:s,ref:O,style:{...h.style,...v,"--input-width":(0,F.h)(C,!0).width,"--button-width":(0,F.h)(w,!0).width},onWheel:M===ew.Pointer?void 0:W,onMouseDown:U,...(0,G.X)(_)}),H=z&&S===eS.Closed,X=(0,et._)(H,null==(n=f.virtual)?void 0:n.options),Y=(0,et._)(H,f.value),ee=(0,A.z)(e=>f.compare(Y,e)),en=(0,d.useMemo)(()=>{if(!f.virtual)return f;if(void 0===X)throw Error("Missing `options` in virtual mode");return X!==f.virtual.options?{...f,virtual:{...f.virtual,options:X}}:f},[f,X,null==(o=f.virtual)?void 0:o.options]);f.virtual&&Object.assign(h,{children:d.createElement(eF.Provider,{value:en},d.createElement(eL,{slot:Z},h.children))});let ei=(0,eh.L6)(),es=(0,d.useMemo)(()=>f.mode===eC.Multi?f:{...f,isSelected:ee},[f,ee]);return d.createElement(ev.h_,{enabled:!!u&&(e.static||z),ownerDocument:I},d.createElement(eF.Provider,{value:es},ei({ourProps:K,theirProps:{...h,children:d.createElement(et.F,{freeze:H},"function"==typeof h.children?null==(i=h.children)?void 0:i.call(h,Z):h.children)},slot:Z,defaultTag:"div",features:eN,visible:z,name:"Combobox.Options"})))}),eK=(0,eh.yV)(function(e,t){var n,o,i;let r=eA("Combobox.Option"),s=e_("Combobox.Option"),l=(0,d.useId)(),{id:a="headlessui-combobox-option-".concat(l),value:u,disabled:c=null!=(i=null==(o=null==(n=r.virtual)?void 0:n.disabled)?void 0:o.call(n,u))&&i,order:p=null,...h}=e,[m]=(0,er.M)(s,e=>[e.inputElement]),f=U(m),g=(0,er.M)(s,(0,d.useCallback)(e=>s.selectors.isActive(e,u,a),[u,a])),x=r.isSelected(u),v=(0,d.useRef)(null),b=(0,j.E)({disabled:c,value:u,domRef:v,order:p}),y=(0,d.useContext)(eD),E=(0,$.T)(t,v,y?y.measureElement:null),O=(0,A.z)(()=>{s.actions.setIsTyping(!1),s.actions.onChange(u)});(0,L.e)(()=>s.actions.registerOption(a,b),[b,a]);let S=(0,er.M)(s,(0,d.useCallback)(e=>s.selectors.shouldScrollIntoView(e,u,a),[u,a]));(0,L.e)(()=>{if(S)return(0,ec.k)().requestAnimationFrame(()=>{var e,t;null==(t=null==(e=v.current)?void 0:e.scrollIntoView)||t.call(e,{block:"nearest"})})},[S,v]);let C=(0,A.z)(e=>{e.preventDefault(),e.button===ex.t.Left&&(c||(O(),(0,ep.tq)()||requestAnimationFrame(()=>f()),r.mode===eC.Single&&s.actions.closeCombobox()))}),w=(0,A.z)(()=>{if(c)return s.actions.goToOption({focus:eu.T.Nothing});let e=r.calculateIndex(u);s.actions.goToOption({focus:eu.T.Specific,idx:e})}),T=(0,H.g)(),M=(0,A.z)(e=>T.update(e)),I=(0,A.z)(e=>{if(!T.wasMoved(e)||c||g&&s.state.activationTrigger===ew.Pointer)return;let t=r.calculateIndex(u);s.actions.goToOption({focus:eu.T.Specific,idx:t},ew.Pointer)}),R=(0,A.z)(e=>{T.wasMoved(e)&&(c||g&&(r.optionsPropsRef.current.hold||s.state.activationTrigger===ew.Pointer&&s.actions.goToOption({focus:eu.T.Nothing})))}),k=(0,d.useMemo)(()=>({active:g,focus:g,selected:x,disabled:c}),[g,x,c]);return(0,eh.L6)()({ourProps:{id:a,ref:E,role:"option",tabIndex:!0===c?void 0:-1,"aria-disabled":!0===c||void 0,"aria-selected":x,disabled:void 0,onMouseDown:C,onFocus:w,onPointerEnter:M,onMouseEnter:M,onPointerMove:I,onMouseMove:I,onPointerLeave:R,onMouseLeave:R},theirProps:h,slot:k,defaultTag:"div",name:"Combobox.Option"})}),eq=Object.assign(eV,{Input:eZ,Button:eB,Label:eW,Options:eU,Option:eK});var e$=n(61994),eH=n(1634),eG=n(27648),eJ=n(99376),eX=n(59195);let eY=e=>{let t,n;let o=(0,a.c)(3);return o[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,l.jsx)("path",{d:"M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"}),o[0]=t):t=o[0],o[1]!==e?(n=(0,l.jsx)("svg",{viewBox:"0 0 16 16",fill:"currentColor",...e,children:t}),o[1]=e,o[2]=n):n=o[2],n},eQ=e=>{let t,n,o;let i=(0,a.c)(4);return i[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,l.jsx)("circle",{className:"x:opacity-25",cx:12,cy:12,r:10,strokeWidth:4}),n=(0,l.jsx)("path",{className:"x:opacity-75",fill:"currentColor",stroke:"none",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"}),i[0]=t,i[1]=n):(t=i[0],n=i[1]),i[2]!==e?(o=(0,l.jsxs)("svg",{fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",...e,children:[t,n]}),i[2]=e,i[3]=o):o=i[3],o};async function e0(){window.pagefind=await import((0,eH.addBasePath)("/_pagefind/pagefind.js")),await window.pagefind.options({baseUrl:"/"})}let e1=new Set(["INPUT","SELECT","BUTTON","TEXTAREA"]);l.Fragment;let e2=e=>{let t,n,o,i,r,s,u,c,p,h,m,f,g,x,v,b,y,E,O,S,C,w,T,M,I,R,k;let z=(0,a.c)(60);z[0]!==e?({className:t,emptyResult:r,errorText:s,loading:u,placeholder:c,searchOptions:i,onSearch:n,...o}=e,z[0]=e,z[1]=t,z[2]=n,z[3]=o,z[4]=i,z[5]=r,z[6]=s,z[7]=u,z[8]=c):(t=z[1],n=z[2],o=z[3],i=z[4],r=z[5],s=z[6],u=z[7],c=z[8]);let _=void 0===r?"No results found.":r,P=void 0===s?"Failed to load search index.":s,F=void 0===u?"Loading…":u,A=void 0===c?"Search documentation…":c,[D,L]=(0,d.useState)(!0),[j,N]=(0,d.useState)("");z[9]===Symbol.for("react.memo_cache_sentinel")?(p=[],z[9]=p):p=z[9];let[V,B]=(0,d.useState)(p),[Z,W]=(0,d.useState)(""),U=(0,d.useDeferredValue)(Z);z[10]!==U||z[11]!==i?(h=()=>{(async e=>{if(!e){B([]),N("");return}if(L(!0),!window.pagefind)try{await e0()}catch(e){N(e instanceof Error?"".concat(e.constructor.name,": ").concat(e.message):String(e)),L(!1);return}let t=await window.pagefind.debouncedSearch(e,i);if(!t)return;let n=await Promise.all(t.results.map(e3));L(!1),N(""),B(n.map(e6))})(U)},z[10]=U,z[11]=i,z[12]=h):h=z[12],z[13]!==U?(m=[U],z[13]=U,z[14]=m):m=z[14],(0,d.useEffect)(h,m);let K=(0,eJ.useRouter)(),[q,$]=(0,d.useState)(!1),H=(0,eX.s)(),G=(0,d.useRef)(null);z[15]===Symbol.for("react.memo_cache_sentinel")?(f=()=>{let e=function(e){let t=document.activeElement;!t||e1.has(t.tagName)||t.isContentEditable||"/"!==e.key&&("k"!==e.key||e.shiftKey||(navigator.userAgent.includes("Mac")?!e.metaKey:!e.ctrlKey))||(e.preventDefault(),G.current.focus({preventScroll:!0}))};return window.addEventListener("keydown",e),()=>{window.removeEventListener("keydown",e)}},g=[],z[15]=f,z[16]=g):(f=z[15],g=z[16]),(0,d.useEffect)(f,g);let J=(!H||q)&&"x:invisible x:opacity-0";z[17]!==J?(x=(0,e$.Z)("x:absolute x:my-1.5 x:select-none x:pointer-events-none x:end-1.5 x:transition-all","x:h-5 x:rounded x:bg-nextra-bg x:px-1.5 x:font-mono x:text-[11px] x:font-medium x:text-gray-600 x:dark:text-gray-400","x:border nextra-border","x:contrast-more:text-current","x:items-center x:gap-1 x:flex","x:max-sm:hidden not-prose",J),z[17]=J,z[18]=x):x=z[18],z[19]!==H?(v=H&&navigator.userAgent.includes("Mac")?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{className:"x:text-xs",children:"⌘"}),"K"]}):"CTRL K",z[19]=H,z[20]=v):v=z[20],z[21]!==x||z[22]!==v?(b=(0,l.jsx)("kbd",{className:x,children:v}),z[21]=x,z[22]=v,z[23]=b):b=z[23];let X=b;z[24]===Symbol.for("react.memo_cache_sentinel")?(y=e=>{$("focus"===e.type)},z[24]=y):y=z[24];let Y=y;z[25]!==n?(E=e=>{let{value:t}=e.currentTarget;W(t),null==n||n(t)},z[25]=n,z[26]=E):E=z[26];let Q=E;z[27]!==K?(O=e=>{if(!e)return;G.current.blur();let[t,n]=e.url.split("#");location.pathname===t?location.href="#".concat(n):K.push(e.url),W("")},z[27]=K,z[28]=O):O=z[28];let ee=O;return z[29]!==t?(S=(0,e$.Z)("nextra-search","x:relative x:flex x:items-center","x:text-gray-900 x:dark:text-gray-300","x:contrast-more:text-gray-800 x:contrast-more:dark:text-gray-300",t),z[29]=t,z[30]=S):S=z[30],z[31]!==Q||z[32]!==A||z[33]!==o||z[34]!==Z?(C=(0,l.jsx)(eZ,{spellCheck:!1,autoComplete:"off",type:"search",...o,ref:G,className:e7,onChange:Q,onFocus:Y,onBlur:Y,value:Z,placeholder:A}),z[31]=Q,z[32]=A,z[33]=o,z[34]=Z,z[35]=C):C=z[35],z[36]!==X||z[37]!==S||z[38]!==C?(w=(0,l.jsxs)("div",{className:S,children:[C,X]}),z[36]=X,z[37]=S,z[38]=C,z[39]=w):w=z[39],z[40]===Symbol.for("react.memo_cache_sentinel")?(T={to:"top end",gap:10,padding:16},z[40]=T):T=z[40],z[41]!==j||z[42]!==D||z[43]!==V?(M=(0,e$.Z)("nextra-search-results","nextra-scrollbar x:max-md:h-full","x:border x:border-gray-200 x:text-gray-100 x:dark:border-neutral-800","x:z-30 x:rounded-xl x:py-2.5 x:shadow-xl","x:contrast-more:border x:contrast-more:border-gray-900 x:contrast-more:dark:border-gray-50","x:backdrop-blur-md x:bg-nextra-bg/70","x:motion-reduce:transition-none","x:origin-top x:transition x:duration-200 x:ease-out x:data-closed:scale-95 x:data-closed:opacity-0 x:empty:invisible",j||D||!V.length?["x:md:min-h-28 x:grow x:flex x:justify-center x:text-sm x:gap-2 x:px-8",j?"x:text-red-500 x:items-start":"x:text-gray-400 x:items-center"]:"x:md:max-h-[min(calc(100vh-5rem),400px)]!","x:w-full x:md:w-[576px]"),z[41]=j,z[42]=D,z[43]=V,z[44]=M):M=z[44],z[45]!==U||z[46]!==_||z[47]!==j||z[48]!==P||z[49]!==D||z[50]!==F||z[51]!==V?(I=j?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(eY,{height:"1.25em",className:"x:shrink-0"}),(0,l.jsxs)("div",{className:"x:grid",children:[(0,l.jsx)("b",{className:"x:mb-2",children:P}),j]})]}):D?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(eQ,{height:"20",className:"x:shrink-0 x:animate-spin"}),F]}):V.length?V.map(e8):U&&_,z[45]=U,z[46]=_,z[47]=j,z[48]=P,z[49]=D,z[50]=F,z[51]=V,z[52]=I):I=z[52],z[53]!==M||z[54]!==I?(R=(0,l.jsx)(eU,{transition:!0,anchor:T,className:M,children:I}),z[53]=M,z[54]=I,z[55]=R):R=z[55],z[56]!==ee||z[57]!==w||z[58]!==R?(k=(0,l.jsxs)(eq,{onChange:ee,children:[w,R]}),z[56]=ee,z[57]=w,z[58]=R,z[59]=k):k=z[59],k},e5=e=>{let t,n,o,i;let r=(0,a.c)(8),{data:s}=e;return r[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,e$.Z)("x:mx-2.5 x:mb-2 x:not-first:mt-6 x:select-none x:border-b x:border-black/10 x:px-2.5 x:pb-1.5 x:text-xs x:font-semibold x:uppercase x:text-gray-600 x:dark:border-white/20 x:dark:text-gray-300","x:contrast-more:border-gray-600 x:contrast-more:text-gray-900 x:contrast-more:dark:border-gray-50 x:contrast-more:dark:text-gray-50"),r[0]=t):t=r[0],r[1]!==s.meta.title?(n=(0,l.jsx)("div",{className:t,children:s.meta.title}),r[1]=s.meta.title,r[2]=n):n=r[2],r[3]!==s.sub_results?(o=s.sub_results.map(te),r[3]=s.sub_results,r[4]=o):o=r[4],r[5]!==n||r[6]!==o?(i=(0,l.jsxs)(l.Fragment,{children:[n,o]}),r[5]=n,r[6]=o,r[7]=i):i=r[7],i};function e3(e){return e.data()}function e4(e){let t=e.url.replace(/\.html$/,"").replace(/\.html#/,"#");return{...e,url:t}}function e6(e){return{...e,sub_results:e.sub_results.map(e4)}}function e7(e){let{focus:t}=e;return(0,e$.Z)("x:rounded-lg x:px-3 x:py-2 x:transition-all","x:w-full x:md:w-64","x:text-base x:leading-tight x:md:text-sm",t?"x:bg-transparent x:nextra-focus":"x:bg-black/[.05] x:dark:bg-gray-50/10","x:placeholder:text-gray-600 x:dark:placeholder:text-gray-400","x:contrast-more:border x:contrast-more:border-current","x:[&::-webkit-search-cancel-button]:appearance-none")}function e8(e){return(0,l.jsx)(e5,{data:e},e.url)}function e9(e){let{focus:t}=e;return(0,e$.Z)("x:mx-2.5 x:break-words x:rounded-md","x:contrast-more:border",t?"x:text-primary-600 x:contrast-more:border-current x:bg-primary-500/10":"x:text-gray-800 x:dark:text-gray-300 x:contrast-more:border-transparent","x:block x:scroll-m-12 x:px-2.5 x:py-2")}function te(e){return(0,l.jsxs)(eK,{as:eG.default,value:e,href:e.url,className:e9,children:[(0,l.jsx)("div",{className:"x:text-base x:font-semibold x:leading-5",children:e.title}),(0,l.jsx)("div",{className:(0,e$.Z)("x:mt-1 x:text-sm x:leading-[1.35rem] x:text-gray-600 x:dark:text-gray-400 x:contrast-more:dark:text-gray-50","x:[&_mark]:bg-primary-600/80 x:[&_mark]:text-white"),dangerouslySetInnerHTML:{__html:e.excerpt}})]},e.url)}}}]);