"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7077],{7077:function(e,t,n){let o,i,l,r;n.d(t,{Ri:function(){return ev},O_:function(){return ef}});var a=n(67299),s=n(30256),u=n(44194),d=n(56321),c=n(75960),p=n(85996),f=n(22656),v=n(64045),b=n(2942),m=n(90696),x=n(80645),g=n(763),O=n(95274),S=n(247),E=n(24808),h=n(99611),R=n(79030),y=n(4849),T=n(82671),I=n(43240);let L=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function P(e){var t,n;let o=null!=(t=e.innerText)?t:"",i=e.cloneNode(!0);if(!(i instanceof HTMLElement))return o;let l=!1;for(let e of i.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))e.remove(),l=!0;let r=l?null!=(n=i.innerText)?n:"":o;return L.test(r)&&(r=r.replace(L,"")),r}var D=n(22639),C=n(16066),M=n(31991),z=n(32046),w=n(92041),F=n(44287),_=n(51786),k=n(58749),A=n(26813),B=n(2604),V=n(48858),N=n(61708),Q=n(54709),U=n(3505),G=n(20532),H=n(98545),K=n(89928),Z=n(38058),$=n(11460),q=n(63697),J=((o=J||{})[o.Open=0]="Open",o[o.Closed=1]="Closed",o),j=((i=j||{})[i.Single=0]="Single",i[i.Multi=1]="Multi",i),X=((l=X||{})[l.Pointer=0]="Pointer",l[l.Other=1]="Other",l),W=((r=W||{})[r.OpenListbox=0]="OpenListbox",r[r.CloseListbox=1]="CloseListbox",r[r.GoToOption=2]="GoToOption",r[r.Search=3]="Search",r[r.ClearSearch=4]="ClearSearch",r[r.RegisterOption=5]="RegisterOption",r[r.UnregisterOption=6]="UnregisterOption",r[r.SetButtonElement=7]="SetButtonElement",r[r.SetOptionsElement=8]="SetOptionsElement",r);function Y(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e=>e,n=null!==e.activeOptionIndex?e.options[e.activeOptionIndex]:null,o=(0,N.z2)(t(e.options.slice()),e=>e.dataRef.current.domRef.current),i=n?o.indexOf(n):null;return -1===i&&(i=null),{options:o,activeOptionIndex:i}}let ee={1:e=>e.dataRef.current.disabled||1===e.listboxState?e:{...e,activeOptionIndex:null,listboxState:1,__demoMode:!1},0(e){if(e.dataRef.current.disabled||0===e.listboxState)return e;let t=e.activeOptionIndex,{isSelected:n}=e.dataRef.current,o=e.options.findIndex(e=>n(e.dataRef.current.value));return -1!==o&&(t=o),{...e,listboxState:0,activeOptionIndex:t,__demoMode:!1}},2(e,t){var n,o,i,l,r;if(e.dataRef.current.disabled||1===e.listboxState)return e;let a={...e,searchQuery:"",activationTrigger:null!=(n=t.trigger)?n:1,__demoMode:!1};if(t.focus===B.T.Nothing)return{...a,activeOptionIndex:null};if(t.focus===B.T.Specific)return{...a,activeOptionIndex:e.options.findIndex(e=>e.id===t.id)};if(t.focus===B.T.Previous){let n=e.activeOptionIndex;if(null!==n){let l=e.options[n].dataRef.current.domRef,r=(0,B.d)(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});if(null!==r){let t=e.options[r].dataRef.current.domRef;if((null==(o=l.current)?void 0:o.previousElementSibling)===t.current||(null==(i=t.current)?void 0:i.previousElementSibling)===null)return{...a,activeOptionIndex:r}}}}else if(t.focus===B.T.Next){let n=e.activeOptionIndex;if(null!==n){let o=e.options[n].dataRef.current.domRef,i=(0,B.d)(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});if(null!==i){let t=e.options[i].dataRef.current.domRef;if((null==(l=o.current)?void 0:l.nextElementSibling)===t.current||(null==(r=t.current)?void 0:r.nextElementSibling)===null)return{...a,activeOptionIndex:i}}}}let s=Y(e),u=(0,B.d)(t,{resolveItems:()=>s.options,resolveActiveIndex:()=>s.activeOptionIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});return{...a,...s,activeOptionIndex:u}},3:(e,t)=>{if(e.dataRef.current.disabled||1===e.listboxState)return e;let n=""!==e.searchQuery?0:1,o=e.searchQuery+t.value.toLowerCase(),i=(null!==e.activeOptionIndex?e.options.slice(e.activeOptionIndex+n).concat(e.options.slice(0,e.activeOptionIndex+n)):e.options).find(e=>{var t;return!e.dataRef.current.disabled&&(null==(t=e.dataRef.current.textValue)?void 0:t.startsWith(o))}),l=i?e.options.indexOf(i):-1;return -1===l||l===e.activeOptionIndex?{...e,searchQuery:o}:{...e,searchQuery:o,activeOptionIndex:l,activationTrigger:1}},4:e=>e.dataRef.current.disabled||1===e.listboxState||""===e.searchQuery?e:{...e,searchQuery:""},5:(e,t)=>{let n={id:t.id,dataRef:t.dataRef},o=Y(e,e=>[...e,n]);return null===e.activeOptionIndex&&e.dataRef.current.isSelected(t.dataRef.current.value)&&(o.activeOptionIndex=o.options.indexOf(n)),{...e,...o}},6:(e,t)=>{let n=Y(e,e=>{let n=e.findIndex(e=>e.id===t.id);return -1!==n&&e.splice(n,1),e});return{...e,...n,activationTrigger:1}},7:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},8:(e,t)=>e.optionsElement===t.element?e:{...e,optionsElement:t.element}},et=(0,u.createContext)(null);function en(e){let t=(0,u.useContext)(et);if(null===t){let t=Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,en),t}return t}et.displayName="ListboxActionsContext";let eo=(0,u.createContext)(null);function ei(e){let t=(0,u.useContext)(eo);if(null===t){let t=Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,ei),t}return t}function el(e,t){return(0,U.E)(t.type,ee,e,t)}eo.displayName="ListboxDataContext";let er=u.Fragment,ea=(0,u.createContext)(!1),es=H.VN.RenderStrategy|H.VN.Static,eu=u.Fragment,ed=(0,H.yV)(function(e,t){var n;let o=(0,M.B)(),{value:i,defaultValue:l,form:r,name:a,onChange:s,by:d,invalid:c=!1,disabled:x=o||!1,horizontal:O=!1,multiple:S=!1,__demoMode:E=!1,...R}=e,y=O?"horizontal":"vertical",T=(0,I.T)(t),L=(0,v.L)(l),[P=S?[]:void 0,D]=(0,f.q)(i,s,L),[C,F]=(0,u.useReducer)(el,{dataRef:(0,u.createRef)(),listboxState:E?0:1,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1,optionsVisible:!1,buttonElement:null,optionsElement:null,__demoMode:E}),_=(0,u.useRef)({static:!1,hold:!1}),A=(0,u.useRef)(new Map),V=(0,p.J)(d),Q=(0,u.useCallback)(e=>(0,U.E)(G.mode,{1:()=>P.some(t=>V(t,e)),0:()=>V(P,e)}),[P]),G=(0,u.useMemo)(()=>({...C,value:P,disabled:x,invalid:c,mode:S?1:0,orientation:y,compare:V,isSelected:Q,optionsPropsRef:_,listRef:A}),[P,x,c,S,C,A]);(0,b.e)(()=>{C.dataRef.current=G},[G]);let K=0===G.listboxState;(0,h.O)(K,[G.buttonElement,G.optionsElement],(e,t)=>{var n;F({type:1}),(0,N.sP)(t,N.tJ.Loose)||(e.preventDefault(),null==(n=G.buttonElement)||n.focus())});let Z=(0,u.useMemo)(()=>({open:0===G.listboxState,disabled:x,invalid:c,value:P}),[G,x,P,c]),q=(0,g.z)(e=>{let t=G.options.find(t=>t.id===e);t&&en(t.dataRef.current.value)}),J=(0,g.z)(()=>{if(null!==G.activeOptionIndex){let{dataRef:e,id:t}=G.options[G.activeOptionIndex];en(e.current.value),F({type:2,focus:B.T.Specific,id:t})}}),j=(0,g.z)(()=>F({type:0})),X=(0,g.z)(()=>F({type:1})),W=(0,m.G)(),Y=(0,g.z)((e,t,n)=>{W.dispose(),W.microTask(()=>e===B.T.Specific?F({type:2,focus:B.T.Specific,id:t,trigger:n}):F({type:2,focus:e,trigger:n}))}),ee=(0,g.z)((e,t)=>(F({type:5,id:e,dataRef:t}),()=>F({type:6,id:e}))),en=(0,g.z)(e=>(0,U.E)(G.mode,{0:()=>null==D?void 0:D(e),1(){let t=G.value.slice(),n=t.findIndex(t=>V(t,e));return -1===n?t.push(e):t.splice(n,1),null==D?void 0:D(t)}})),ei=(0,g.z)(e=>F({type:3,value:e})),ea=(0,g.z)(()=>F({type:4})),es=(0,g.z)(e=>{F({type:7,element:e})}),eu=(0,g.z)(e=>{F({type:8,element:e})}),ed=(0,u.useMemo)(()=>({onChange:en,registerOption:ee,goToOption:Y,closeListbox:X,openListbox:j,selectActiveOption:J,selectOption:q,search:ei,clearSearch:ea,setButtonElement:es,setOptionsElement:eu}),[]),[ec,ep]=(0,$.bE)({inherit:!0}),ef=(0,u.useCallback)(()=>{if(void 0!==L)return null==D?void 0:D(L)},[D,L]),ev=(0,H.L6)();return u.createElement(ep,{value:ec,props:{htmlFor:null==(n=G.buttonElement)?void 0:n.id},slot:{open:0===G.listboxState,disabled:x}},u.createElement(z.HO,null,u.createElement(et.Provider,{value:ed},u.createElement(eo.Provider,{value:G},u.createElement(k.up,{value:(0,U.E)(G.listboxState,{0:k.ZM.Open,1:k.ZM.Closed})},null!=a&&null!=P&&u.createElement(w.Mt,{disabled:x,data:{[a]:P},form:r,onReset:ef}),ev({ourProps:{ref:T},theirProps:R,slot:Z,defaultTag:er,name:"Listbox"}))))))}),ec=(0,H.yV)(function(e,t){var n;let o=ei("Listbox.Button"),i=en("Listbox.Button"),l=(0,u.useId)(),r=(0,_.Q)(),{id:p=r||`headlessui-listbox-button-${l}`,disabled:f=o.disabled||!1,autoFocus:v=!1,...b}=e,m=(0,I.T)(t,(0,z.AZ)(),i.setButtonElement),x=(0,z.L)(),O=(0,g.z)(e=>{switch(e.key){case Z.R.Enter:(0,Q.g)(e.currentTarget);break;case Z.R.Space:case Z.R.ArrowDown:e.preventDefault(),(0,d.flushSync)(()=>i.openListbox()),o.value||i.goToOption(B.T.First);break;case Z.R.ArrowUp:e.preventDefault(),(0,d.flushSync)(()=>i.openListbox()),o.value||i.goToOption(B.T.Last)}}),S=(0,g.z)(e=>{e.key===Z.R.Space&&e.preventDefault()}),E=(0,g.z)(e=>{var t;if((0,A.P)(e.currentTarget))return e.preventDefault();0===o.listboxState?((0,d.flushSync)(()=>i.closeListbox()),null==(t=o.buttonElement)||t.focus({preventScroll:!0})):(e.preventDefault(),i.openListbox())}),h=(0,g.z)(e=>e.preventDefault()),R=(0,$.wp)([p]),T=(0,K.zH)(),{isFocusVisible:L,focusProps:P}=(0,a.F)({autoFocus:v}),{isHovered:D,hoverProps:C}=(0,s.X)({isDisabled:f}),{pressed:M,pressProps:w}=(0,c.x)({disabled:f}),F=(0,u.useMemo)(()=>({open:0===o.listboxState,active:M||0===o.listboxState,disabled:f,invalid:o.invalid,value:o.value,hover:D,focus:L,autofocus:v}),[o.listboxState,o.value,f,D,L,M,o.invalid,v]),k=(0,H.dG)(x(),{ref:m,id:p,type:(0,y.f)(e,o.buttonElement),"aria-haspopup":"listbox","aria-controls":null==(n=o.optionsElement)?void 0:n.id,"aria-expanded":0===o.listboxState,"aria-labelledby":R,"aria-describedby":T,disabled:f||void 0,autoFocus:v,onKeyDown:O,onKeyUp:S,onKeyPress:h,onClick:E},P,C,w);return(0,H.L6)()({ourProps:k,theirProps:b,slot:F,defaultTag:"button",name:"Listbox.Button"})}),ep=$.__,ef=(0,H.yV)(function(e,t){var n,o;let i=(0,u.useId)(),{id:l=`headlessui-listbox-options-${i}`,anchor:r,portal:a=!1,modal:s=!0,transition:c=!1,...p}=e,f=(0,z.Vy)(r),[v,S]=(0,u.useState)(null);f&&(a=!0);let h=ei("Listbox.Options"),y=en("Listbox.Options"),L=(0,R.i)(h.optionsElement),P=(0,k.oJ)(),[D,M]=(0,C.Y)(c,v,null!==P?(P&k.ZM.Open)===k.ZM.Open:0===h.listboxState);(0,E.m)(D,h.buttonElement,y.closeListbox);let w=!h.__demoMode&&s&&0===h.listboxState;(0,T.P)(w,L);let _=!h.__demoMode&&s&&0===h.listboxState;(0,O.s)(_,{allowed:(0,u.useCallback)(()=>[h.buttonElement,h.optionsElement],[h.buttonElement,h.optionsElement])});let A=!function(e,t){let n=(0,u.useRef)({left:0,top:0});if((0,b.e)(()=>{if(!t)return;let e=t.getBoundingClientRect();e&&(n.current=e)},[e,t]),null==t||!e||t===document.activeElement)return!1;let o=t.getBoundingClientRect();return o.top!==n.current.top||o.left!==n.current.left}(0!==h.listboxState,h.buttonElement)&&D,V=D&&1===h.listboxState,Q=(0,F._)(V,h.value),K=(0,g.z)(e=>h.compare(Q,e)),$=(0,u.useMemo)(()=>{var e;if(null==f||!(null!=(e=null==f?void 0:f.to)&&e.includes("selection")))return null;let t=h.options.findIndex(e=>K(e.dataRef.current.value));return -1===t&&(t=0),t},[f,h.options]),J=(()=>{if(null==f)return;if(null===$)return{...f,inner:void 0};let e=Array.from(h.listRef.current.values());return{...f,inner:{listRef:{current:e},index:$}}})(),[j,X]=(0,z.ES)(J),W=(0,z.U8)(),Y=(0,I.T)(t,f?j:null,y.setOptionsElement,S),ee=(0,m.G)();(0,u.useEffect)(()=>{var e;let t=h.optionsElement;t&&0===h.listboxState&&t!==(null==(e=(0,G.r)(t))?void 0:e.activeElement)&&(null==t||t.focus({preventScroll:!0}))},[h.listboxState,h.optionsElement]);let et=(0,g.z)(e=>{var t,n;switch(ee.dispose(),e.key){case Z.R.Space:if(""!==h.searchQuery)return e.preventDefault(),e.stopPropagation(),y.search(e.key);case Z.R.Enter:if(e.preventDefault(),e.stopPropagation(),null!==h.activeOptionIndex){let{dataRef:e}=h.options[h.activeOptionIndex];y.onChange(e.current.value)}0===h.mode&&((0,d.flushSync)(()=>y.closeListbox()),null==(t=h.buttonElement)||t.focus({preventScroll:!0}));break;case(0,U.E)(h.orientation,{vertical:Z.R.ArrowDown,horizontal:Z.R.ArrowRight}):return e.preventDefault(),e.stopPropagation(),y.goToOption(B.T.Next);case(0,U.E)(h.orientation,{vertical:Z.R.ArrowUp,horizontal:Z.R.ArrowLeft}):return e.preventDefault(),e.stopPropagation(),y.goToOption(B.T.Previous);case Z.R.Home:case Z.R.PageUp:return e.preventDefault(),e.stopPropagation(),y.goToOption(B.T.First);case Z.R.End:case Z.R.PageDown:return e.preventDefault(),e.stopPropagation(),y.goToOption(B.T.Last);case Z.R.Escape:e.preventDefault(),e.stopPropagation(),(0,d.flushSync)(()=>y.closeListbox()),null==(n=h.buttonElement)||n.focus({preventScroll:!0});return;case Z.R.Tab:e.preventDefault(),e.stopPropagation(),(0,d.flushSync)(()=>y.closeListbox()),(0,N.EO)(h.buttonElement,e.shiftKey?N.TO.Previous:N.TO.Next);break;default:1===e.key.length&&(y.search(e.key),ee.setTimeout(()=>y.clearSearch(),350))}}),el=null==(n=h.buttonElement)?void 0:n.id,er=(0,u.useMemo)(()=>({open:0===h.listboxState}),[h.listboxState]),ea=(0,H.dG)(f?W():{},{id:l,ref:Y,"aria-activedescendant":null===h.activeOptionIndex||null==(o=h.options[h.activeOptionIndex])?void 0:o.id,"aria-multiselectable":1===h.mode||void 0,"aria-labelledby":el,"aria-orientation":h.orientation,onKeyDown:et,role:"listbox",tabIndex:0===h.listboxState?0:void 0,style:{...p.style,...X,"--button-width":(0,x.h)(h.buttonElement,!0).width},...(0,C.X)(M)}),eu=(0,H.L6)();return u.createElement(q.h_,{enabled:!!a&&(e.static||D)},u.createElement(eo.Provider,{value:1===h.mode?h:{...h,isSelected:K}},eu({ourProps:ea,theirProps:p,slot:er,defaultTag:"div",features:es,visible:A,name:"Listbox.Options"})))}),ev=Object.assign(ed,{Button:ec,Label:ep,Options:ef,Option:(0,H.yV)(function(e,t){let n,o;let i=(0,u.useId)(),{id:l=`headlessui-listbox-option-${i}`,disabled:r=!1,value:a,...s}=e,c=!0===(0,u.useContext)(ea),p=ei("Listbox.Option"),f=en("Listbox.Option"),v=null!==p.activeOptionIndex&&p.options[p.activeOptionIndex].id===l,m=p.isSelected(a),x=(0,u.useRef)(null),O=(n=(0,u.useRef)(""),o=(0,u.useRef)(""),(0,g.z)(()=>{let e=x.current;if(!e)return"";let t=e.innerText;if(n.current===t)return o.current;let i=(function(e){let t=e.getAttribute("aria-label");if("string"==typeof t)return t.trim();let n=e.getAttribute("aria-labelledby");if(n){let e=n.split(" ").map(e=>{let t=document.getElementById(e);if(t){let e=t.getAttribute("aria-label");return"string"==typeof e?e.trim():P(t).trim()}return null}).filter(Boolean);if(e.length>0)return e.join(", ")}return P(e).trim()})(e).trim().toLowerCase();return n.current=t,o.current=i,i})),E=(0,S.E)({disabled:r,value:a,domRef:x,get textValue(){return O()}}),h=(0,I.T)(t,x,e=>{e?p.listRef.current.set(l,e):p.listRef.current.delete(l)});(0,b.e)(()=>{if(!p.__demoMode&&0===p.listboxState&&v&&0!==p.activationTrigger)return(0,V.k)().requestAnimationFrame(()=>{var e,t;null==(t=null==(e=x.current)?void 0:e.scrollIntoView)||t.call(e,{block:"nearest"})})},[x,v,p.__demoMode,p.listboxState,p.activationTrigger,p.activeOptionIndex]),(0,b.e)(()=>{if(!c)return f.registerOption(l,E)},[E,l,c]);let R=(0,g.z)(e=>{var t;if(r)return e.preventDefault();f.onChange(a),0===p.mode&&((0,d.flushSync)(()=>f.closeListbox()),null==(t=p.buttonElement)||t.focus({preventScroll:!0}))}),y=(0,g.z)(()=>{if(r)return f.goToOption(B.T.Nothing);f.goToOption(B.T.Specific,l)}),T=(0,D.g)(),L=(0,g.z)(e=>{T.update(e),!r&&(v||f.goToOption(B.T.Specific,l,0))}),C=(0,g.z)(e=>{T.wasMoved(e)&&(r||v||f.goToOption(B.T.Specific,l,0))}),M=(0,g.z)(e=>{T.wasMoved(e)&&(r||v&&f.goToOption(B.T.Nothing))}),z=(0,u.useMemo)(()=>({active:v,focus:v,selected:m,disabled:r,selectedOption:m&&c}),[v,m,r,c]),w=c?{}:{id:l,ref:h,role:"option",tabIndex:!0===r?void 0:-1,"aria-disabled":!0===r||void 0,"aria-selected":m,disabled:void 0,onClick:R,onFocus:y,onPointerEnter:L,onMouseEnter:L,onPointerMove:C,onMouseMove:C,onPointerLeave:M,onMouseLeave:M},F=(0,H.L6)();return!m&&c?null:F({ourProps:w,theirProps:s,slot:z,defaultTag:"div",name:"Listbox.Option"})}),SelectedOption:(0,H.yV)(function(e,t){let{options:n,placeholder:o,...i}=e,l={ref:(0,I.T)(t)},r=ei("ListboxSelectedOption"),a=(0,u.useMemo)(()=>({}),[]),s=void 0===r.value||null===r.value||1===r.mode&&Array.isArray(r.value)&&0===r.value.length,d=(0,H.L6)();return u.createElement(ea.Provider,{value:!0},d({ourProps:l,theirProps:{...i,children:u.createElement(u.Fragment,null,o&&s?o:n)},slot:a,defaultTag:eu,name:"ListboxSelectedOption"}))})})}}]);