"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3687],{73687:function(e,t,n){n.d(t,{OK:function(){return x},td:function(){return w},x4:function(){return C},nP:function(){return y},mQ:function(){return h}});var r,o,a=n(67294),u=n.t(a,2),l=n(72677);/** * @reach/descendants v0.18.0 * * Copyright (c) 2018-2022, React Training LLC * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function createDescendantContext(e,t={}){let n=a.createContext({descendants:[],registerDescendant:()=>l.ZT,...t});return n.displayName=e,n}function useDescendant(e,t,n){let r=(0,l.NW)(),{registerDescendant:o,descendants:u}=a.useContext(t),i=n??u.findIndex(t=>t.element===e.element);return(0,l.LI)(()=>(e.element||r(),o({...e,index:i})),[e,r,i,o,...Object.values(e)]),i}function useDescendantsInit(){return a.useState([])}function DescendantProvider({context:e,children:t,items:n,set:r}){let o=a.useCallback(({element:e,index:t,...n})=>e?(r(r=>{if(null!=t&&-1!==t)return insertAt(r,{element:e,index:t,...n},t);if(0===r.length)return[{...n,element:e,index:0}];if(r.find(t=>t.element===e))return console.warn("[reach-ui]: `useDescendant` was called with an element that was already registered.\n\nIf you are using the `@reach/descendants` package directly, make sure to only register descendants once. Registering a descendant more than once will lead to bugs in your app.\n\nIf you are using another `reach-ui` package, this is probably our bug!\n\nTo report a bug, open a new issue:\n\n https://github.com/reach/reach-ui/issues/new?assignees=&labels=&template=Bug_report.md\n\nIMPORTANT: this check will only run in the development build, so if you see this warning please be aware that your app may crash when deployed."),r.sort((e,t)=>e.element&&t.element?isElementPreceding(e.element,t.element)?-1:1:0).map((e,t)=>({...e,index:t}));let o=function(e,t){if(!t||!e.length)return -1;let n=e.length;for(;n--;){let r=e[n].element;if(r&&isElementPreceding(r,t))return n+1}return -1}(r,e);return -1===o?[...r,{...n,element:e,index:r.length}]:insertAt(r,{...n,element:e,index:o},o)}),()=>{e&&r(t=>t.filter(t=>e!==t.element))}):l.ZT,[]);return a.createElement(e.Provider,{value:a.useMemo(()=>({descendants:n,registerDescendant:o}),[n,o])},t)}function isElementPreceding(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function insertAt(e,t,n){return null!=n&&n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}/** * @reach/auto-id v0.18.0 * * Copyright (c) 2018-2022, React Training LLC * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */var i=!1,c=0,s=u["useId".toString()],d=createDescendantContext("TabsDescendantsContext"),f=createDescendantContext("TabPanelDescendantsContext"),[m,p]=(0,l.kr)("Tabs"),b=((r=b||{}).Auto="auto",r.Manual="manual",r),g=((o=g||{}).Horizontal="horizontal",o.Vertical="vertical",o),h=a.forwardRef(({as:e="div",children:t,defaultIndex:n,orientation:r="horizontal",index:o,keyboardActivation:u="auto",onChange:f,readOnly:p=!1,...b},g)=>{let{current:h}=a.useRef(void 0!==o),v=function(e){if(void 0!==s){let t=s();return e??t}let t=e??(i?++c:null),[n,r]=a.useState(t);return(0,l.LI)(()=>{null===n&&r(++c)},[]),a.useEffect(()=>{!1===i&&(i=!0)},[]),e??n??void 0}(b.id||"tabs"),w=a.useRef(null),x=a.useRef(!1),[D,y]=(0,l.zk)({controlledValue:o,defaultValue:n??0,calledFrom:"Tabs"}),[C,k]=a.useState(-1),[P,E]=useDescendantsInit(),R=a.useCallback(()=>{w.current&&(0,l.mf)(w.current.focus)&&w.current.focus()},[]),O=a.useCallback(e=>{f&&f(e),y(e)},[f,y]),T=a.useCallback(e=>{let t=P[e]?.element,n=(0,l.r3)(t);"auto"===u&&(f&&f(e),y(e)),t&&t!==n.activeElement&&(0,l.mf)(t.focus)&&t.focus()},[u,f,y,P]);return a.createElement(DescendantProvider,{context:d,items:P,set:E},a.createElement(m,{focusedIndex:C,id:v,isControlled:h,isRTL:x,keyboardActivation:u,onFocusPanel:R,onSelectTab:p?l.ZT:O,onSelectTabWithKeyboard:p?l.ZT:T,orientation:r,selectedIndex:D,selectedPanelRef:w,setFocusedIndex:k,setSelectedIndex:y},a.createElement(e,{...b,ref:g,"data-reach-tabs":"","data-orientation":r,id:b.id},(0,l.mf)(t)?t({focusedIndex:C,id:v,selectedIndex:D}):t)))});h.displayName="Tabs";var v=a.forwardRef(({children:e,as:t="div",onKeyDown:n,...r},o)=>{let{focusedIndex:u,isControlled:i,isRTL:c,keyboardActivation:s,onSelectTabWithKeyboard:f,orientation:m,selectedIndex:b,setSelectedIndex:g}=p("TabList"),h=a.useContext(d).descendants,v=a.useRef(null),w=(0,l.ex)(o,v);a.useEffect(()=>{v.current&&(v.current.ownerDocument&&"rtl"===v.current.ownerDocument.dir||"rtl"===(0,l.Dx)(v.current,"direction"))&&(c.current=!0)},[c]);let x=(0,l.Mj)(n,function(e,t){let{descendants:n}=a.useContext(e),{callback:r,currentIndex:o,filter:u,key:l="index",orientation:i="vertical",rotate:c=!0,rtl:s=!1}=t;return function(e){if(!["ArrowDown","ArrowUp","ArrowLeft","ArrowRight","PageUp","PageDown","Home","End"].includes(e.key))return;let t=o??-1,a=u?n.filter(u):n;if(!a.length)return;let d=a.findIndex(e=>e.index===o);function getNextOption(){return t===getLastOption().index?c?a[0]:a[d]:a[(d+1)%a.length]}function getPreviousOption(){return t===a[0].index?c?getLastOption():a[d]:a[(d-1+a.length)%a.length]}function getLastOption(){return a[a.length-1]}switch(e.key){case"ArrowDown":if("vertical"===i||"both"===i){e.preventDefault();let t=getNextOption();r("option"===l?t:t[l])}break;case"ArrowUp":if("vertical"===i||"both"===i){e.preventDefault();let t=getPreviousOption();r("option"===l?t:t[l])}break;case"ArrowLeft":if("horizontal"===i||"both"===i){e.preventDefault();let t=(s?getNextOption:getPreviousOption)();r("option"===l?t:t[l])}break;case"ArrowRight":if("horizontal"===i||"both"===i){e.preventDefault();let t=(s?getPreviousOption:getNextOption)();r("option"===l?t:t[l])}break;case"PageUp":e.preventDefault();let f=(e.ctrlKey?getPreviousOption:function(){return a[0]})();r("option"===l?f:f[l]);break;case"Home":e.preventDefault();let m=a[0];r("option"===l?m:m[l]);break;case"PageDown":e.preventDefault();let p=(e.ctrlKey?getNextOption:getLastOption)();r("option"===l?p:p[l]);break;case"End":e.preventDefault();let b=getLastOption();r("option"===l?b:b[l])}}}(d,{currentIndex:"manual"===s?u:b,orientation:m,rotate:!0,callback:f,filter:e=>!e.disabled,rtl:c.current}));return(0,l.LI)(()=>{var e;if(!i&&("true"===(e=h[b]?.disabled)||(0,l.jn)(e)&&e)){let e=h.find(e=>!e.disabled);e&&g(e.index)}},[h,i,b,g]),a.createElement(t,{role:"tablist","aria-orientation":m,...r,"data-reach-tab-list":"",ref:w,onKeyDown:x},e)});v.displayName="TabList";var w=a.memo(v);w.displayName="TabList";var x=a.forwardRef(({isSelected:e,children:t,as:n="button",index:r,disabled:o,onBlur:u,onFocus:i,...c},s)=>{let{id:f,onSelectTab:m,orientation:b,selectedIndex:g,setFocusedIndex:h}=p("Tab"),v=a.useRef(null),[w,x]=(0,l.BR)(v,null),D=(0,l.ex)(s,x),y=useDescendant(a.useMemo(()=>({element:w,disabled:!!o}),[o,w]),d,r),C="button"===n&&null==c.type?"button":c.type,k=y===g;return a.createElement(n,{"aria-controls":(0,l.qR)(f,"panel",y),"aria-disabled":o,"aria-selected":k,role:"tab",tabIndex:k?0:-1,...c,ref:D,"data-reach-tab":"","data-orientation":b,"data-selected":k?"":void 0,disabled:o,id:(0,l.qR)(f,"tab",y),onClick:function(){m(y)},onFocus:(0,l.Mj)(i,()=>{h(y)}),onBlur:(0,l.Mj)(u,()=>{h(-1)}),type:C},t)});x.displayName="Tab";var D=a.forwardRef(({children:e,as:t="div",...n},r)=>{let o=a.useRef(),u=(0,l.ex)(o,r),[i,c]=useDescendantsInit();return a.createElement(DescendantProvider,{context:f,items:i,set:c},a.createElement(t,{...n,ref:u,"data-reach-tab-panels":""},e))});D.displayName="TabPanels";var y=a.memo(D);y.displayName="TabPanels";var C=a.forwardRef(({children:e,"aria-label":t,as:n="div",index:r,...o},u)=>{let{selectedPanelRef:i,selectedIndex:c,id:s}=p("TabPanel"),d=a.useRef(null),[m,b]=(0,l.BR)(d,null),g=useDescendant(a.useMemo(()=>({element:m}),[m]),f,r),h=(0,l.qR)(s,"panel",g),v=g===c,w=a.useRef(!1),x=!!w.current&&!v;a.useEffect(()=>{w.current=!0},[]);let D=(0,l.ex)(u,b,v?i:null);return a.createElement(n,{"aria-labelledby":(0,l.qR)(s,"tab",g),hidden:x,role:"tabpanel",tabIndex:v?0:-1,...o,ref:D,"data-reach-tab-panel":"",id:h},e)});C.displayName="TabPanel"},72677:function(e,t,n){n.d(t,{BR:function(){return useStatefulRefValue},Dx:function(){return getComputedStyle},LI:function(){return o},Mj:function(){return composeEventHandlers},NW:function(){return useForceUpdate},ZT:function(){return noop},ex:function(){return useComposedRefs},jn:function(){return isBoolean},kr:function(){return createContext2},mf:function(){return isFunction},qR:function(){return makeId},r3:function(){return getOwnerDocument},zk:function(){return useControlledState}});var r=n(67294);/** * @reach/utils v0.18.0 * * Copyright (c) 2018-2022, React Training LLC * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function canUseDOM(){return!!("undefined"!=typeof window&&window.document&&window.document.createElement)}function composeEventHandlers(e,t){return n=>{if(e&&e(n),!n.defaultPrevented)return t(n)}}function isBoolean(e){return"boolean"==typeof e}function isFunction(e){return!!(e&&"[object Function]"==({}).toString.call(e))}function useComposedRefs(...e){return(0,r.useCallback)(t=>{for(let n of e)!function(e,t){if(null!=e){if(isFunction(e))e(t);else try{e.current=t}catch(n){throw Error(`Cannot assign value "${t}" to ref "${e}"`)}}}(n,t)},e)}function getOwnerDocument(e){return canUseDOM()?e?e.ownerDocument:document:null}function getComputedStyle(e,t){let n,r;return((r=(n=getOwnerDocument(e))?n.defaultView||window:null)?r.getComputedStyle(e,null):null)?.getPropertyValue(t)||null}function createContext2(e,t){let n=r.createContext(t);function Provider(e){let{children:t,...o}=e,a=r.useMemo(()=>o,Object.values(o));return r.createElement(n.Provider,{value:a},t)}return n.displayName=`${e}Context`,Provider.displayName=`${e}Provider`,[Provider,function(o){let a=r.useContext(n);if(a)return a;if(t)return t;throw Error(`${o} must be rendered inside of a ${e} component.`)}]}function makeId(...e){return e.filter(e=>null!=e).join("--")}function noop(){}function useControlledState({controlledValue:e,defaultValue:t,calledFrom:n="A component"}){let o=void 0!==e,a=(0,r.useRef)(o);!a.current&&o&&console.warn(`${n} is changing from controlled to uncontrolled. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),a.current&&!o&&console.warn(`${n} is changing from uncontrolled to controlled. Components should not switch from uncontrolled to controlled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`);let[u,l]=(0,r.useState)(a.current?e:t),i=(0,r.useCallback)(e=>{a.current||l(e)},[]);return[a.current?e:u,i]}function useForceUpdate(){let[,e]=(0,r.useState)(Object.create(null));return(0,r.useCallback)(()=>{e(Object.create(null))},[])}var o=canUseDOM()?r.useLayoutEffect:r.useEffect;function useStatefulRefValue(e,t){let[n,o]=(0,r.useState)(t);return[n,(0,r.useCallback)(t=>{e.current=t,o(t)},[])]}}}]);